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lIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisjaWZuZGVmIFdMQU5fUUNUX1dMQU5CQVBfSAorI2RlZmluZSBXTEFOX1FDVF9XTEFOQkFQX0gKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgVyBMIEEgTiAgIEIgVCAtIEEgTSBQICBQIEEgTCAgIEwgQSBZIEUgUiAKKyAgICAgICAgICAgICAgICAgICAgICAgRSBYIFQgRSBSIE4gQSBMICBBIFAgSQorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgIAorREVTQ1JJUFRJT04KKyAgVGhpcyBmaWxlIGNvbnRhaW5zIHRoZSBleHRlcm5hbCBBUEkgZXhwb3NlZCBieSB0aGUgd2xhbiBCVC1BTVAgUEFMIGxheWVyIAorICBtb2R1bGUuCisgIAorICAgICAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICBFRElUIEhJU1RPUlkgRk9SIEZJTEUKKworCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLgorICBOb3RpY2UgdGhhdCBjaGFuZ2VzIGFyZSBsaXN0ZWQgaW4gcmV2ZXJzZSBjaHJvbm9sb2dpY2FsIG9yZGVyLgorCisKKyAgJEhlYWRlcjogL2N5Z2RyaXZlL2QvQnVpbGRzL003MjAxSlNEQ0FBUEFENTIyNDBCL1dNL3BsYXRmb3JtL21zbTcyMDAvU3JjL0RyaXZlcnMvU0QvQ2xpZW50RHJpdmVycy9XTEFOL1FDVF9CVEFNUF9SU04vQ09SRS9CQVAvaW5jL2JhcEFwaS5oLHYgMS4yMSAyMDA5LzAzLzA5IDA4OjU4OjI2IGp6bXVkYSBFeHAganptdWRhICQgJERhdGVUaW1lOiAkICRBdXRob3I6IGp6bXVkYSAkCisKKword2hlbiAgICAgICAgd2hvICAgIHdoYXQsIHdoZXJlLCB3aHkKKy0tLS0tLS0tICAgIC0tLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiswNy8wMS8wOCAgICBqZXogICAgIENyZWF0ZWQgbW9kdWxlLgorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgICAgICBJTkNMVURFIEZJTEVTIEZPUiBNT0RVTEUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKiBJbmNsdWRlIEZpbGVzCisgKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyNpbmNsdWRlICJ2b3NfYXBpLmgiIAorI2luY2x1ZGUgInZvc19wYWNrZXQuaCIgCisvL0kgbmVlZCB0aGUgVEw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uIDIuMCAKKy8vICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCAgPT4gQmx1ZXRvb3RoIEhDSSBTcGVjaWZpY2F0aW9uIDIuMSAKKy8vICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNSAgPT4gQmx1ZXRvb3RoIEhDSSBTcGVjaWZpY2F0aW9uIDMuMCAKKyNkZWZpbmUgV0xBTkJBUF9IQ0lfVkVSU0lPTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDUKKyNkZWZpbmUgV0xBTkJBUF9IQ0lfUkVWSVNJT04gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgCisjZGVmaW5lIFdMQU5CQVBfUEFMX1ZFUlNJT04gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAxCisjZGVmaW5lIFdMQU5CQVBfUEFMX1NVQlZFUlNJT04gICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwCisKKy8vIEFNUCBkZXZpY2Ugc3RhdHVzIAorI2RlZmluZSBXTEFOQkFQX0hDSV9BTVBfU1RBVFVTX1BPV0VSRURfRE9XTiAgICAgICAgICAgICAgMHgwMAorI2RlZmluZSBXTEFOQkFQX0hDSV9BTVBfU1RBVFVTX05PVF9TSEFSRUQgICAgICAgICAgICAgICAgMHgwMQorI2RlZmluZSBXTEFOQkFQX0hDSV9BTVBfU1RBVFVTX1NIQVJFRCAgICAgICAgICAgICAgICAgICAgMHgwMgorI2RlZmluZSBXTEFOQkFQX0hDSV9BTVBfU1RBVFVTX1JFU0VSVkVEICAgICAgICAgICAgICAgICAgMHgwMworCisvLyBBQ0wgUGFja2V0IHR5cGVzIChBTVAgb25seSB1c2VzIDB4MDMpIAorI2RlZmluZSBXTEFOQkFQX0hDSV9QS1RfU1RBUlRfTk9OX0ZMVVNIICAgICAgICAgICAgICAgICAgMHgwMAorI2RlZmluZSBXTEFOQkFQX0hDSV9QS1RfQ09OVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMQorI2RlZmluZSB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UF9FUlJPUl9QQUlSSU5HX05PVF9BTExPV0VEICAgICAgICAgICAgICgweDE4KSAgICAgIAorI2RlZmluZSBXTEFOQkFQX0VSUk9SX1VOS05PV05fTE1QX1BEVSAgICAgICAgICAgICAgICAgKDB4MTkpICAgICAgCisjZGVmaW5lIFdMQU5CQVBfRVJST1JfVU5TVVBQT1JURURfUkVNT1RFX0ZFQVQgICAgICAgICAoMHgxYSkgICAgICAKKyNkZWZpbmUgV0xBTkJBUF9FUlJPUl9TQ09fUkVKICAgICAgICAgICAgICAgICAgICAgICAgICgweDFiKSAgICAgIAorI2RlZmluZSBXTEFOQkFQX0VSUk9SX1NDT19JTlRFUlZBTF9SRUogICAgICAgICAgICAgICAgKDB4MWMpICAgICAgCisjZGVmaW5lIFdMQU5CQVBfRVJST1JfU0NPX0FJUl9NT0RFX1JFSiAgICAgICAgICAgICAgICAoMHgxZCkgICAgICAKKyNkZWZpbmUgV0xBTkJBUF9FUlJPUl9JTlZBTElEX0xNUF9QQVJBTUVURVIgICAgICAgICAgICgweDFlKSAgICAgIAorI2RlZmluZSBXTEFOQkFQX0VSUk9SX1VOU1BFQ0lGSUVEX0VSUk9SICAgICAgICAgICAgICAgKDB4MWYpICAgICAgCisjZGVmaW5lIFdMQU5CQVBfRVJST1JfVU5TVVBQT1JURURfTE1QX1BBUkFNICAgICAgICAgICAoMHgyMCkgICAgICAKKyNkZWZpbmUgV0xBTkJBUF9FUlJPUl9ST0xFX0NIQU5HRV9OT1RfQUxMT1dFRCAgICAgICAgICgweDIxKSAgICAgIAorI2RlZmluZSBXTEFOQkFQX0VSUk9SX0xNUF9SRVNQT05TRV9USU1FT1VUICAgICAgICAgICAgKDB4MjIpICAgICAgCisjZGVmaW5lIFdMQU5CQVBfRVJST1JfTE1QX0VSUk9SX1RSQU5TX0NPTExJU0lPTiAgICAgICAoMHgyMykgICAgICAKKyNkZWZpbmUgV0xBTkJBUF9FUlJPUl9MTVBfUERVX05PVF9BTExPV0VEICAgICAgICAgICAgICgweDI0KSAgICAgIAorI2RlZmluZSBXTEFOQkFQX0VSUk9SX0VOQ1JZUFRJT05fTU9ERV9OT1RfQUNDRVBUQUJMRSAgKDB4MjUpICAgICAgCisjZGVmaW5lIFdMQU5CQVBfRVJST1JfVU5JVF9LRVlfVVNFRCAgICAgICAgICAgICAgICAgICAoMHgyNikgICAgICAKKyNkZWZpbmUgV0xBTkJBUF9FUlJPUl9RT1NfSVNfTk9UX1NVUFBPUlRFRCAgICAgICAgICAgICgweDI3KSAgICAgIAorI2RlZmluZSBXTEFOQkFQX0VSUk9SX0lOU1RBTlRfUEFTU0VEICAgICAgICAgICAgICAgICAgKDB4MjgpICAgICAgCisjZGVmaW5lIFdMQU5CQVBfRVJST1JfVU5JVF9LRVlfUEFJUklOR19VTlNVUFBPUlRFRCAgICAoMHgyOSkgICAgICAKKworI2RlZmluZSBXTEFOQkFQX0VSUk9SX0RJRkZFUkVOVF9UUkFOU19DT0xMSVNJT04gICAgICAgKDB4MkEpICAgICAgCisKKy8qIHJlc2VydmVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDJCKSAqLworCisjZGVmaW5lIFdMQU5CQVBfRVJST1JfUU9TX1VOQUNDRVBUQUJMRV9QQVJBTUVURVIgICAgICAoMHgyQykgICAgICAKKyNkZWZpbmUgV0xBTkJBUF9FUlJPUl9RT1NfUkVKRUNURUQgICAgICAgICAgICAgICAgICAgICgweDJEKSAgICAgIAorI2RlZmluZSBXTEFOQkFQX0VSUk9SX0NIQU5ORUxfQ0xBU1NJRklDQVRJT05fTlMgICAgICAgKDB4MkUpICAgICAgCisjZGVmaW5lIFdMQU5CQVBfRVJST1JfSU5TVUZGSUNJRU5UX1NFQ1VSSVRZICAgICAgICAgICAoMHgyRikgICAgICAKKyNkZWZpbmUgV0xBTkJBUF9FUlJPUl9QQVJNX09VVF9PRl9NQU5EQVRPUllfUkFOR0UgICAgICgweDMwKSAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorLyogcmVzZXJ2ZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MzEpICovCisKKyNkZWZpbmUgV0xBTkJBUF9FUlJPUl9ST0xFX1NXSVRDSF9QRU5ESU5HICAgICAgICAgICAgICgweDMyKSAgICAgIAorCisvKiByZXNlcnZlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgzMykgKi8KKworI2RlZmluZSBXTEFOQkFQX0VSUk9SX1JFU0VSVkVEX1NMT1RfVklPTEFUSU9OICAgICAgICAgKDB4MzQpICAgICAgCisjZGVmaW5lIFdMQU5CQVBfRVJST1JfUk9MRV9TV0lUQ0hfRkFJTEVEICAgICAgICAgICAgICAoMHgzNSkgICAgICAKKyNkZWZpbmUgV0xBTkJBUF9FUlJPUl9FSVJfVE9PX0xBUkdFICAgICAgICAgICAgICAgICAgICgweDM2KSAgICAgIAorI2RlZmluZSBXTEFOQkFQX0VSUk9SX1NTUF9OT1RfU1VQUE9SVEVEX0JZX0hPU1QgICAgICAgKDB4MzcpICAgICAgCisjZGVmaW5lIFdMQU5CQVBfRVJST1JfSE9TVF9CVVNZX1BBSVJJTkcgICAgICAgICAgICAgICAoMHgzOCkgICAgICAKKyNkZWZpbmUgV0xBTkJBUF9FUlJPUl9OT19TVUlUQUJMRV9DSEFOTkVMICAgICAgICAgICAgICgweDM5KQorI2RlZmluZSBXTEFOQkFQX0VSUk9SX0NPTlRST0xMRVJfQlVTWSAgICAgICAgICAgICAgICAgKDB4M0EpICAgICAgCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICogICBFdmVudF9NYXNrX1BhZ2VfMiBkZWZpbmVzIGZvciBldmVudHMKKyAqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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0tLS0tLS0tLS0tLS0tLS0tLSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOQkFQX09wZW4KKworICBERVNDUklQVElPTiAKKyAgICBDYWxsZWQgYXQgZHJpdmVyIGluaXRpYWxpemF0aW9uICh2b3Nfb3BlbikuIEJBUCB3aWxsIGluaXRpYWxpemUgCisgICAgYWxsIGl0cyBpbnRlcm5hbCByZXNvdXJjZXMgYW5kIHdpbGwgd2FpdCBmb3IgdGhlIGNhbGwgdG8gc3RhcnQgdG8gCisgICAgcmVnaXN0ZXIgd2l0aCB0aGUgb3RoZXIgbW9kdWxlcy4gCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gQkFQJ3MgCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wgYmxvY2sgY2FuIGJlIGV4dHJhY3RlZCBmcm9tIGl0cyBjb250ZXh0IAorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfRV9GQVVMVDogIHBvaW50ZXIgdG8gQkFQIGNiIGlzIE5VTEwgOyBhY2Nlc3Mgd291bGQgY2F1c2UgYSBwYWdlIAorICAgICAgICAgICAgICAgICAgICAgICAgIGZhdWx0ICAKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikgCisKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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VzIGNhbiBiZSByZXR1cm5lZCBhcyBhIHJlc3VsdCBvZiBhIEJBTCBmYWlsdXJlOworICAgIAorICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIAorV0xBTkJBUF9TdGFydAorKCAKKyAgdl9QVk9JRF90ICBwdm9zR0N0eCAKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOQkFQX1N0b3AKKworICBERVNDUklQVElPTiAKKyAgICBDYWxsZWQgYnkgdm9zX3N0b3AgdG8gc3RvcCBvcGVyYXRpb24gaW4gQkFQLCBiZWZvcmUgY2xvc2UuIEJBUCB3aWxsIHN1c3BlbmQgYWxsIAorICAgIEJULUFNUCBQcm90b2NvbCBBZGFwdGlvbiBMYXllciBvcGVyYXRpb24gYW5kIHdpbGwgd2FpdCBmb3IgdGhlIGNsb3NlIAorICAgIHJlcXVlc3QgdG8gY2xlYW4gdXAgaXRzIHJlc291cmNlcy4gCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gQkFQJ3MgCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wgYmxvY2sgY2FuIGJlIGV4dHJhY3RlZCBmcm9tIGl0cyBjb250ZXh0IAorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfRV9GQVVMVDogIHBvaW50ZXIgdG8gQkFQIGNiIGlzIE5VTEwgOyBhY2Nlc3Mgd291bGQgY2F1c2UgYSBwYWdlIAorICAgICAgICAgICAgICAgICAgICAgICAgIGZhdWx0ICAKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikgCisKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyAKK1dMQU5CQVBfU3RvcAorKCAKKyAgdl9QVk9JRF90ICBwdm9zR0N0eCAKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOQkFQX0Nsb3NlCisKKyAgREVTQ1JJUFRJT04gCisgICAgQ2FsbGVkIGJ5IHZvc19jbG9zZSBkdXJpbmcgZ2VuZXJhbCBkcml2ZXIgY2xvc2UgcHJvY2VkdXJlLiBCQVAgd2lsbCBjbGVhbiB1cCAKKyAgICBhbGwgdGhlIGludGVybmFsIHJlc291cmNlcy4gCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gQkFQJ3MgCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wgYmxvY2sgY2FuIGJlIGV4dHJhY3RlZCBmcm9tIGl0cyBjb250ZXh0IAorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfRV9GQVVMVDogIHBvaW50ZXIgdG8gQkFQIGNiIGlzIE5VTEwgOyBhY2Nlc3Mgd291bGQgY2F1c2UgYSBwYWdlIAorICAgICAgICAgICAgICAgICAgICAgICAgIGZhdWx0ICAKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikgCisKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyAKK1dMQU5CQVBfQ2xvc2UKKyggCisgIHZfUFZPSURfdCAgcHZvc0dDdHggCispOworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICBIREQgaW50ZXJmYWNlcyAtIFBlciBpbnN0YW5jZSBpbml0aWFsaXphdGlvbiAKKyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTkJBUF9HZXROZXdIbmRsCisKKyAgREVTQ1JJUFRJT04gCisgICAgQ2FsbGVkIGJ5IEhERCBhdCBkcml2ZXIgb3BlbiAoQlNMX09wZW4pLiBCQVAgd2lsbCBpbml0aWFsaXplIAorICAgIGFsbG9jYXRlIGEgcGVyLWluc3RhbmNlICJmaWxlIGhhbmRsZSIgZXF1aXZhbGVudCBmb3IgdGhpcyBzcGVjaWZpYworICAgIG9wZW4gY2FsbC4gCisgICAgCisgICAgVGhlcmUgc2hvdWxkIG9ubHkgZXZlciBiZSBvbmUgY2FsbCB0byBCU0xfT3Blbi4gIFNpbmNlIAorICAgIHRoZSBvcGVuIGFwcCB1c2VyIGlzIHRoZSBCVCBzdGFjay4KKyAgICAKKyAgICAKKyAgREVQRU5ERU5DSUVTIAorICAgIAorICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICBoQnRhbXBIYW5kbGU6ICAgSGFuZGxlIHRvIHJldHVybiBidGFtcEhhbmRsZSB2YWx1ZSBpbi4KKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbiAgCisKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6ICBwb2ludGVyIHRvIEJBUCBjYiBpcyBOVUxMIDsgYWNjZXNzIHdvdWxkIGNhdXNlIGEgcGFnZSAKKyAgICAgICAgICAgICAgICAgICAgICAgICBmYXVsdCAgCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgRXZlcnl0aGluZyBpcyBnb29kIDopIAorCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgCitXTEFOQkFQX0dldE5ld0huZGwKKyggCisgIHB0QnRhbXBIYW5kbGUgKmhCdGFtcEhhbmRsZSAgLyogSGFuZGxlIHRvIHJldHVybiBidGFtcEhhbmRsZSB2YWx1ZSBpbiAgKi8gCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTkJBUF9SZWxlYXNlSG5kbAorCisgIERFU0NSSVBUSU9OIAorICAgIENhbGxlZCBieSBIREQgYXQgZHJpdmVyIGNsb3NlIChCU0xfQ2xvc2UpLiBCQVAgd2lsbCByZWN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S0tLS0qLworCit0eXBlZGVmIFZPU19TVEFUVVMgKCpXTEFOQkFQX1NUQUZldGNoUGt0Q0JUeXBlKSggCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfUFZPSURfdCAgICAgICAgICAgICBwSGRkSGRsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfQUNFbnVtVHlwZSAgICAgdWNBQywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX3BrdF90KiogICAgICAgICAgIHZvc0RhdGFCdWZmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfTWV0YUluZm9UeXBlKiAgdGxNZXRhSW5mbyk7CisKKyAKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgRlVOQ1RJT04gICAgKCpXTEFOQkFQX1NUQVJ4Q0JUeXBlKSggKQorCisgIERFU0NSSVBUSU9OICAgCisgICAgVHlwZSBvZiB0aGUgcmVjZWl2ZSBjYWxsYmFjayByZWdpc3RlcmVkIHdpdGggQkFQIGJ5IEhERC4gCisgICAgCisgICAgSXQgaXMgY2FsbGVkIGJ5IHRoZSBCQVAgaW1tZWRpYXRlbHkgdXBvbiB0aGUgdW5kZXJseWluZyAKKyAgICBXTEFOVExfU1RBUnhDQlR5cGUgcm91dGluZSBiZWluZyBjYWxsZWQuICBXaGljaCBpcyBjYWxsZWQgYnkKKyAgICBUTCB0byBub3RpZnkgd2hlbiBhIHBhY2tldCB3YXMgcmVjZWl2ZWQgZm9yIGEgcmVnaXN0ZXJlZCBTVEEuCisKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcEhkZEhkbDogICAgICAgIFRoZSBIREQoQlNMKSBzcGVjaWZpYyBjb250Z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rZXQKKyAgIAorICBSRVRVUk4gVkFMVUUKKworICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfRV9JTlZBTDogIElucHV0IHBhcmFtZXRlcnMgYXJlIGludmFsaWQgCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgQkFQIGhhbmRsZSBpcyBOVUxMICAKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikgCisKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTkJBUF9YbGF0ZVJ4RGF0YVBrdAorKCAKKyAgcHRCdGFtcEhhbmRsZSAgICAgYnRhbXBIYW5kbGUsIAorICB2X1U4X3QgICAgICAgICAgICBwaHlfbGlua19oYW5kbGUsICAvKiBVc2VkIGJ5IEJBUCB0byBpbmRlbnRpZnkgdGhlIFdMQU4gYXNzb2MuIChTdGFJZCkgKi8KKyAgV0xBTlRMX0FDRW51bVR5cGUgICAgICAgICAgICpwdWNBQywgICAgICAgIC8qIFJldHVybiB0aGUgQUMgaGVyZS4gSSBkb24ndCB0aGluayB0aGlzIGlzIG5lZWRlZCAqLworICB2b3NfcGt0X3QgICAgICAgICp2b3NEYXRhQnVmZgorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOQkFQX1NUQVBrdFBlbmRpbmcKKworICBERVNDUklQVElPTiAKKworICAgIEhERCB3aWxsIGNhbGwgdGhpcyBBUEkgd2hlbiBhIHBhY2tldCBpcyBwZW5kaW5nIHRyYW5zbWlzc2lvbiBpbi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Skgb3IgZ2xvYmFsICgwKSBldmVudAorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfRV9GQVVMVDogIHBvaW50ZXIgdG8gcEJhcEhDSUV2ZW50IGlzIE5VTEwgCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgU3VjY2VzcworICAKKyAgU0lERSBFRkZFQ1RTIAorICAKKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwordHlwZWRlZiBWT1NfU1RBVFVTICgqdHBXTEFOX0JBUEV2ZW50Q0IpCisoCisgIHZfUFZPSURfdCAgICAgIHBIZGRIZGwsICAgLyogdGhpcyBjb3VsZCByZWZlciB0byBlaXRoZXIgdGhlIEJTTCBwZXIgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXNzb2NpYXRpb24gY29udGV4dCB3aGljaCBnb3QgcGFzc2VkIGluIGR1cmluZyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWdpc3RlciBkYXRhIHBsYW5lIE9SIHRoZSBCU0wgcGVyIGFwcGxpY2F0aW9uIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRleHQgcGFzc2VkIGluIGR1cmluZyByZWdpc3RlciBCQVAgY2FsbGJhY2tzIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhc2VkIG9uIHNldHRpbmcgb2YgdGhlIEJvb2xlYW4gZmxhZyBiZWxvdyAqLyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBJdCdzIGxpa2UgZWFjaCBvZiB1cyBpcyB1c2luZyB0aGUgb3RoZXIgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBndX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ZXNjJyAgRm9yIG1vcmUgaW5mb3JtYXRpb24gb24gJ2ZyYW1lc2MnICYgdGhlCisgICogZnJhbWVzIGxhbmd1YWdlLCAgcnVuICdmcmFtZXNjIC0taGVscCcuCisgICoKKyAgKgorICAqLworCisKKyNkZWZpbmUgV0xBTkJBUF9NQVhfTE9HX0xJTktTIDE2ICAvKiBMb2dpY2FsIGxpbmtzIGFyZSBhc3NpZ25lZCBieSBCQVAgKi8KKworCisjaWYgMAorCisvKiAgQ2FsbGluZyBjb252ZW50aW9uczogVGhlIEdlbmVyYWwgZm9ybWF0IG9mIHRoZSBVbnBhY2sgYW5kIFBhY2sgcm91dGluZXMgKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFVucGFja19YeHhNZXNzYWdlCisKKyAgREVTQ1JJUFRJT04gCisgICAgVW5wYWNrIGZyb20gYSBNZXNzYWdlIGJ1ZmZlciBpbnRvIGEgc3RydWN0dXJlZCB0eXBlLiAKKworCisgIERFUEVOREVOQ0lFUyAKKworCisgIFBBUkFNRVRFUlMgCisgCisKKyAgICBJTgorICAgIHZvaWQgKiA6ICAgICAgIGhhbEhhbmRsZSAocGFzc2VkIGRvd24gdG8gdGhlIE1BQyBsYXllciBhbmQgYmVsb3cpCisgICAgdl9VOF90KiA6ICAgICAgUG9pbnRlciB0byB0aGUgc291cmNlIG1lc3NhZ2UgYnVmZmVyCisgICAgdl9VMTZfdCA6ICAgICAgTGVuZ3RoIGluIGJ5dGVzIG9mIHRoZSBjb250ZW50cyBvZiB0aGUgbWVzc2FnZSBidWZmZXIuCisgICAgdFh4eE1lc3NhZ2UqIDogUG9pbnRlciB0byB0aGUgc3RydWN0dXJlIGluIHdoaWNoIHRvIHJldHVybiB0aGUgdW5wYWNrZWQgdmFsdWVzLgorICAgCisgIFJFVFVSTiBWQUxVRQorCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorIAorCisgIFNJREUgRUZGRUNUUyAKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2X1UzMl90IFVucGFja19YeHhNZXNzYWdlKHZvaWQgKiwgdl9VOF90Kix2X1UxNl90LCB0WHh4TWVzc2FnZSopOworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBQYWNrX1h4eE1lc3NhZ2UKKworICBERVNDUklQVElPTiAKKyAgICBQYWNrIHRoZSBkYXRhIGZyb20gYSBzdHJ1Y3R1cmUgaW50byBhIE1lc3NhZ2UgYnVmZmVyLiAKKworCisgIERFUEVOREVOQ0lFUyAKKworCisgIFBBUkFNRVRFUlMgCisKKworICAgIElOCisgICAgdm9pZCAqIDogICAgICAgaGFsSGFuZGxlIChwYXNzZWQgZG93biB0byB0aGUgTUFDIGxheWVyIGFuZCBiZWxvdykKKyAgICB0WHh4TWVzc2FnZSogOiBQb2ludGVyIHRvIHRoZSBzdHJ1Y3R1cmUgZnJvbSB3aGljaCB0byBvYnRhaW4gdmFsdWVzLgorICAgIHZfVThfdCogOiAgICAgIFBvaW50ZXIgdG8gdGhlIGRlc3RpbmF0aW9uIG1lc3NhZ2UgYnVmZmVyLgorICAgIHZfVTMyX3QgOiAgICAgIExlbmd0aCBpbiBieXRlcyBvZiB0aGUgZGVzdGluYXRpb24gbWVzc2FnZSBidWZmZXIuCisgICAgdl9VMzJfdCogOiAgICAgUG9pbnRlciB0byByZXR1cm4gdGhlIGFjdHVhbCBsZW5ndGggb2YgdGhlIGVuY29kZWQgbWVzc2FnZSBidWZmZXIgaW4uCisKKworICBSRVRVUk4gVkFMVUUKKworICAgIFRoZSByZX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EQgICAoIDB4MTAwMDAwMDIgKQorI2RlZmluZSBCVEFNUF9CQURfSU5QVVRfQlVGRkVSICAgICAgKCAweDEwMDAwMDAzICkKKyNkZWZpbmUgQlRBTVBfQkFEX09VVFBVVF9CVUZGRVIgICAgICggMHgxMDAwMDAwNCApCisjZGVmaW5lIEJUQU1QX0JVRkZFUl9PVkVSRkxPVyAgICAgICAoIDB4MTAwMDAwMDUgKQorI2RlZmluZSBCVEFNUF9NQU5EQVRPUllfVExWX01JU1NJTkcgKCAweDAwMDAxMDAwICkKKyNkZWZpbmUgQlRBTVBfRkFJTEVEKGNvZGUpICAgICAgICAgICggKGNvZGUpICYgMHgxMDAwMDAwMCApCisjZGVmaW5lIEJUQU1QX1dBUk5FRChjb2RlKSAgICAgICAgICAoICggKCAwID09IChjb2RlKSApICYgMHgxMDAwMDAwMCApICYmIGNvZGUpCisjZGVmaW5lIEJUQU1QX1NVQ0NFRURFRChjb2RlKSAgICAgICAoIChjb2RlKSA9PSAwICkKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogRml4ZWQgRmllbGRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBUTFZzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8vIElEIDMgKDB4MDAwMykKK3R5cGVkZWYgc3RydWN0IHNCdGFtcFRMVkFNUF9Bc3NvY19Db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I2lmZGVmIF9fY3BsdXNwbHVzCit9OyAvKiBFbmQgZXh0ZXJuICJDIi4gKi8KKyNlbmRpZiAvKiBDKysgKi8KKy8vIElEIDE0ICgweDAwMGUpCit0eXBlZGVmIHN0cnVjdCBzQnRhbXBUTFZIQ0lfQ29tbWFuZF9Db21wbGV0ZV9FdmVudCB7CisgICAgdl9VOF90ICAgICAgIHByZXNlbnQ7CisgICAgdl9VOF90ICAgICAgIG51bV9oY2lfY29tbWFuZF9wYWNrZXRzOworICAgIHZfVTE2X3QgICAgICBjb21tYW5kX29wY29kZTsKKyAgICB1bmlvbgorICAgIHsKKyAgICAgICAgc3RydWN0CisgICAgICAgIHsKKyAgICAgICAgICAgIHZfVThfdCBzdGF0dXM7CisgICAgICAgIH0gUmVzZXQ7IC8qIGNvbW1hbmRfb3Bjb2RlID0gYzAzICovCisgICAgICAgIHN0cnVjdAorICAgICAgICB7CisgICAgICAgICAgICB2X1U4X3Qgc3RhdHVzOworICAgICAgICAgICAgdl9VMTZfdCBsb2dfbGlua19oYW5kbGU7CisgICAgICAgIH0gRmx1c2g7IC8qIGNvbW1hbmRfb3Bjb2RlID0gYzA4ICovCisgICAgICAgIHN0cnVjdAorICAgICAgICB7CisgICAgICAgICAgICB2X1U4X3Qgc3RhdHVzOworICAgICAgICAgICAgdl9VOF90IHBoeV9saW5rX2hhbmRsZTsKKyAgICAgICAgICAgIHZfVThfdCB0eF9mbG93X3NwZWNfaWQ7CisgICAgICAgIH0gTG9naWNhbF9MaW5rX0NhbmNlbDsgLyogY29tbWFuZF9vcGNvZGUgPSA0M2IgKi8KKyAgICAgICAgc3RydWN0CisgICAgICAgIHsKKyAgICAgICAgICAgIHZfVThfdCBzdGF0dXM7CisgICAgICAgIH0gU2V0X0V2ZW50X01hc2s7IC8qIGNvbW1hbmRfb3Bjb2RlID0gYzA1ICovCisgICAgICAgIHN0cnVjdAorICAgICAgICB7CisgICAgICAgICAgICB2X1U4X3Qgc3RhdHVzOworICAgICAgICAgICAgdl9VMTZfdCBjb25uZWN0aW9uX2FjY2VwdF90aW1lb3V0OworICAgICAgICB9IFJlYWRfQ29ubmVjdGlvbl9BY2NlcHRfVE87IC8qIGNvbW1hbmRfb3Bjb2RlID0gYzE1ICovCisgICAgICAgIHN0cnVjdAorICAgICAgICB7CisgICAgICAgICAgICB2X1U4X3Qgc3RhdHVzOworICAgICAgICB9IFdyaXRlX0Nvbm5lY3Rpb25fQWNjZXB0X1RPOyAvKiBjb21tYW5kX29wY29kZSA9IGMxNiAqLworICAgICAgICBzdHJ1Y3QKKyAgICAgICAgeworICAgICAgICAgICAgdl9VOF90IHN0YXR1czsKKyAgICAgICAgICAgIHZfVTE2X3QgbG9nX2xpbmtfaGFuZGxlOworICAgICAgICAgICAgdl9VMTZfdCBsaW5rX3N1cGVydmlzaW9uX3RpbWVvdXQ7CisgICAgICAgIH0gUmVhZF9MaW5rX1N1cGVydmlzaW9uX1RPOyAvKiBjb21tYW5kX29wY29kZSA9IGMzNiAqLworICAgICAgICBzdHJ1Y3QKKyAgICAgICAgeworICAgICAgICAgICAgdl9VOF90IHN0YXR1czsKKyAgICAgICAgICAgIHZfVTE2X3QgbG9nX2xpbmtfaGFuZGxlOworICAgICAgICB9IFdyaXRlX0xpbmtfU3VwZXJ2aXNpb25fVE87IC8qIGNvbW1hbmRfb3Bjb2RlID0gYzM3ICovCisgICAgICAgIHN0cnVjdAorICAgICAgICB7CisgICAgICAgICAgICB2X1U4X3Qgc3RhdHVzOworICAgICAgICAgICAgdl9VMTZfdCBsb2dpY2FsX2xpbmtfYWNjZXB0X3RpbWVvdXQ7CisgICAgICAgIH0gUmVhZF9Mb2dpY2FsX0xpbmtfQWNjZXB0X1RPOyAvKiBjb21tYW5kX29wY29kZSA9IGM2MSAqLworICAgICAgICBzdHJ1Y3QKKyAgICAgICAgeworICAgICAgICAgICAgdl9VOF90IHN0YXR1czsKKyAgICAgICAgfSBXcml0ZV9Mb2dpY2FsX0xpbmtfQWNjZXB0X1RPOyAvKiBjb21tYW5kX29wY29kZSA9IGM2MiAqLworICAgICAgICBzdHJ1Y3QKKyAgICAgICAgeworICAgICAgICAgICAgdl9VOF90IHN0YXR1czsKKyAgICAgICAgfSBTZXRfRXZlbnRfTWFza19QYWdlXzI7IC8qIGNvbW1hbmRfb3Bjb2RlID0gYzYzICovCisgICAgICAgIHN0cnVjdAorICAgICAgICB7CisgICAgICAgICAgICB2X1U4X3Qgc3RhdHVzOworICAgICAgICAgICAgdl9VOF90IGxvY19kb21haW5fYXdhcmU7CisgICAgICAgICAgICB2X1U4X3QgbG9jX2RvbWFpblszXTsKKyAgICAgICAgICAgIHZfVThfdCBsb2Nfb3B0aW9uczsKKyAgICAgICAgfSBSZWFkX0xvY2F0aW9uX0RhdGE7IC8qIGNvbW1hbmRfb3Bjb2RlID0gMzE3MiAqLworICAgICAgICBzdHJ1Y3QKKyAgICAgICAgeworICAgICAgICAgICAgdl9VOF90IHN0YXR1czsKKyAgICAgICAgfSBXcml0ZV9Mb2NhdGlvbl9EYXRhOyAvKiBjb21tYW5kX29wY29kZSA9IDMxNzMgKi8KKyAgICAgICAgc3RydWN0CisgICAgICAgIHsKKyAgICAgICAgICAgIHZfVThfdCBzdGF0dXM7CisgICAgICAgICAgICB2X1U4X3QgZmxvd19jb250cm9sX21vZGU7CisgICAgICAgIH0gUmVhZF9GbG93X0NvbnRyb2xfTW9kZTsgLyogY29tbWFuZF9vcGNvZGUgPSAzMTc0ICovCisgICAgICAgIHN0cnVjdAorICAgICAgICB7CisgICAgICAgICAgICB2X1U4X3Qgc3RhdHVzOworICAgICAgICB9IFdyaXRlX0Zsb3dfQ29udHJvbF9Nb2RlOyAvKiBjb21tYW5kX29wY29kZSA9IDMxNzUgKi8KKyAgICAgICAgc3RydWN0CisgICAgICAgIHsKKyAgICAgICAgICAgIHZfVThfdCBzdGF0dXM7CisgICAgICAgICAgICB2X1UzMl90IGJlc3RfZWZmb3J0X2ZsdXNoX3RpbWVvdXQ7CisgICAgICAgIH0gUmVhZF9CRV9GbHVzaF9UTzsgLyogY29tbWFuZF9vcGNvZGUgPSAzMTc3ICovCisgICAgICAgIHN0cnVjdAorICAgICAgICB7CisgICAgICAgICAgICB2X1U4X3Qgc3RhdHVzOworICAgICAgICB9IFdyaXRlX0JFX0ZsdXNoX1RPOyAvKiBjb21tYW5kX29wY29kZSA9IDMxNzggKi8KKyAgICAgICAgc3RydWN0CisgICAgICAgIHsKKyAgICAgICAgICAgIHZfVThfdCBzdGF0dXM7CisgICAgICAgIH0gU2V0X1Nob3J0X1JhbmdlX01vZGU7IC8qIGNvbW1hbmRfb3Bjb2RlID0gMzE3OSAqLworICAgICAgICBzdHJ1Y3QKKyAgICAgICAgeworICAgICAgICAgICAgdl9VOF90IHN0YXR1czsKKyAgICAgICAgICAgIHZfVThfdCBIQ19IQ0lfVmVyc2lvbjsKKyAgICAgICAgICAgIHZfVTE2X3QgSENfSENJX1JldmlzaW9uOworICAgICAgICAgICAgdl9VOF90IEhDX1BBTF9WZXJzaW9uOworICAgICAgICAgICAgdl9VMTZfdCBIQ19NYW51ZmFjX05hbWU7CisgICAgICAgICAgICB2X1UxNl90IEhDX1BBTF9TdWJfVmVyc2lvbjsKKyAgICAgICAgfSBSZWFkX0xvY2FsX1ZlcnNpb25fSW5mbzsgLyogY29tbWFuZF9vcGNvZGUgPSA0MDk3ICovCisgICAgICAgIHN0cnVjdAorICAgICAgICB7CisgICAgICAgICAgICB2X1U4X3Qgc3RhdHVzOworICAgICAgICAgICAgdl9VOF90IEhDX1N1cHBvcnRfQ21kc1s2NF07CisgICAgICAgIH0gUmVhZF9Mb2NhbF9TdXBwb3J0ZWRfQ21kczsgLyogY29tbWFuZF9vcGNvZGUgPSA0MDk4ICovCisgICAgICAgIHN0cnVjdAorICAgICAgICB7CisgICAgICAgICAgICB2X1U4X3Qgc3RhdHVzOworICAgICAgICAgICAgdl9VMTZfdCBIQ19BQ0xfRGF0YV9QYWNrZXRfTGVuZ3RoOworICAgICAgICAgICAgdl9VOF90IEhDX1NDT19QYWNrZXRfTGVuZ3RoOworICAgICAgICAgICAgdl9VMTZfdCBIQ19Ub3RhbF9OdW1fQUNMX1BhY2tldHM7CisgICAgICAgICAgICB2X1UxNl90IEhDX1RvdGFsX051bV9TQ09fUGFja2V0czsKKyAgICAgICAgfSBSZWFkX0J1ZmZlcl9TaXplOyAvKiBjb21tYW5kX29wY29kZSA9IDQxMDEgKi8KKyAgICAgICAgc3RydWN0CisgICAgICAgIHsKKyAgICAgICAgICAgIHZfVThfdCBzdGF0dXM7CisgICAgICAgICAgICB2X1UxNl90IEhDX01heF9BQ0xfRGF0YV9QYWNrZXRfTGVuZ3RoOworICAgICAgICAgICAgdl9VMTZfdCBIQ19EYXRhX0Jsb2NrX0xlbmd0aDsKKyAgICAgICAgICAgIHZfVTE2X3QgSENfVG90YWxfTnVtX0RhdGFfQmxvY2tzOworICAgICAgICB9IFJlYWRfRGF0YV9CbG9ja19TaXplOyAvKiBjb21tYW5kX29wY29kZSA9IDQxMDYgKi8KKyAgICAgICAgc3RydWN0CisgICAgICAgIHsKKyAgICAgICAgICAgIHZfVThfdCBzdGF0dXM7CisgICAgICAgICAgICB2X1UxNl90IGxvZ19saW5rX2hhbmRsZTsKKyAgICAgICAgICAgIHZfVTE2X3QgZmFpbGVkX2NvbnRhY3RfY291bnRlcjsKKyAgICAgICAgfSBSZWFkX0ZhaWxlZF9Db250YWN0X0NvdW50ZXI7IC8qIGNvbW1hbmRfb3Bjb2RlID0gNTEyMSAqLworICAgICAgICBzdHJ1Y3QKKyAgICAgICAgeworICAgICAgICAgICAgdl9VOF90IHN0YXR1czsKKyAgICAgICAgICAgIHZfVTE2X3QgbG9nX2xpbmtfaGFuZGxlOworICAgICAgICB9IFJlc2V0X0ZhaWxlZF9Db250YWN0X0NvdW50ZXI7IC8qIGNvbW1hbmRfb3Bjb2RlID0gNTEyMiAqLworICAgICAgICBzdHJ1Y3QKKyAgICAgICAgeworICAgICAgICAgICAgdl9VOF90IHN0YXR1czsKKyAgICAgICAgICAgIHZfVTE2X3QgbG9nX2xpbmtfaGFuZGxlOworICAgICAgICAgICAgdl9VOF90IGxpbmtfcXVhbGl0eTsKKyAgICAgICAgfSBSZWFkX0xpbmtfUXVhbGl0eTsgLyogY29tbWFuZF9vcGNvZGUgPSA1MTIzICovCisgICAgICAgIHN0cnVjdAorICAgICAgICB7CisgICAgICAgICAgICB2X1U4X3Qgc3RhdHVzOworICAgICAgICAgICAgLyogMiBieXRlcyBoYW5kbGUgdG8gY29tcGx5IHdpdGggc3BlYywgKGxvd2VyIGJ5dGUgdmFsaWQpICovCisgICAgICAgICAgICB2X1UxNl90IHBoeV9saW5rX2hhbmRsZTsKKyAgICAgICAgICAgIHZfUzdfdCByc3NpOworICAgICAgICB9IFJlYWRfUlNTSTsgLyogY29tbWFuZF9vcGNvZGUgPSA1MTI1ICovCisgICAgICAgIHN0cnVjdAorICAgICAgICB7CisgICAgICAgICAgICB2X1U4X3Qgc3RhdHVzOworICAgICAgICAgICAgdl9VOF90IEhDX0FNUF9TdGF0dXM7CisgICAgICAgICAgICB2X1UzMl90IEhDX1RvdGFsX0JXOworICAgICAgICAgICAgdl9VMzJfdCBIQ19NYXhfR3VhcmFudGVlZF9CVzsKKyAgICAgICAgICAgIHZfVTMyX3QgSENfTWluX0xhdGVuY3k7CisgICAgICAgICAgICB2X1UzMl90IEhDX01heF9QRFVfU2l6ZTsKKyAgICAgICAgICAgIHZfVThfdCBIQ19Db250cm9sbGVyX1R5cGU7CisgICAgICAgICAgICB2X1UxNl90IEhDX1BBTF9DYXBhYmlsaXRpZXM7CisgICAgICAgICAgICB2X1UxNl90IEhDX0FNUF9Bc3NvY19MZW5ndGg7CisgICAgICAgICAgICB2X1UzMl90IEhDX01heF9GbHVzaF9UaW1lb3V0OworICAgICAgICAgICAgdl9VMzJfdCBIQ19CRV9GbHVzaF9UaW1lb3V0OworICAgICAgICB9IFJlYWRfTG9jYWxfQU1QX0luZm87IC8qIGNvbW1hbmRfb3Bjb2RlID0gNTEyOSAqLworICAgICAgICBzdHJ1Y3QKKyAgICAgICAgeworICAgICAgICAgICAgdl9VOF90IHN0YXR1czsKKyAgICAgICAgICAgIHZfVThfdCBwaHlfbGlua19oYW5kbGU7CisgICAgICAgICAgICB2X1UxNl90IHJlbWFpbmluZ19sZW5ndGg7CisgICAgICAgICAgICB2X1U4X3QgQU1QX2Fzc29jX2ZyYWdtZW50WzI0OF07CisgICAgICAgIH0gUmVhZF9SZWFkX0xvY2FsX0FNUF9Bc3NvYzsgLyogY29tbWFuZF9vcGNvZGUgPSA1MTMwICovCisgICAgICAgIHN0cnVjdAorICAgICAgICB7CisgICAgICAgICAgICB2X1U4X3Qgc3RhdHVzOworICAgICAgICAgICAgdl9VOF90IHBoeV9saW5rX2hhbmRsZTsKKyAgICAgICAgfSBXcml0ZV9SZW1vdGVfQU1QX0Fzc29jOyAvKiBjb21tYW5kX29wY29kZSA9IDUxMzEgKi8KKyAgICAgICAgc3RydWN0CisgICAgICAgIHsKKyAgICAgICAgICAgIHZfVThfdCBzdGF0dXM7CisgICAgICAgICAgICB2X1U4X3QgbG9vcGJhY2tfbW9kZTsKKyAgICAgICAgfSBSZWFkX0xvb3BiYWNrX01vZGU7IC8qIGNvbW1hbmRfb3Bjb2RlID0gNjE0NSAqLworICAgICAgICBzdHJ1Y3QKKyAgICAgICAgeworICAgICAgICAgICAgdl9VOF90IHN0YXR1czsKKyAgICAgICAgfSBXcml0ZV9Mb29wYmFja19Nb2RlOyAvKiBjb21tYW5kX29wY29kZSA9IDYxNDYgKi8KKyAgICAgICAgc3RydWN0CisgICAgICAgIHsKKyAgICAgICAgICAgIHZfVThfdCBzdGF0dXM7CisgICAgICAgIH0gVmVuZG9yX1NwZWNpZmljX0NtZF8wOyAvKiBjb21tYW5kX29wY29kZSA9IGZjMDAgKi8KKyAgICAgICAgc3RydWN0CisgICAgICAgIHsKKyAgICAgICAgICAgIHZfVThfdCBzdGF0dXM7CisgICAgICAgIH0gVmVuZG9yX1NwZWN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Cit2X1UzMl90IGJ0YW1wR2V0UGFja2VkVGx2SENJX1dyaXRlX1JlbW90ZV9BTVBfQVNTT0NfQ21kKHZvaWQgKiwgdEJ0YW1wVExWSENJX1dyaXRlX1JlbW90ZV9BTVBfQVNTT0NfQ21kKiwgdl9VMzJfdCopOworCisjaWZkZWYgX19jcGx1c3BsdXMKK307IC8qIEVuZCBleHRlcm4gIkMiLiAqLworI2VuZGlmIC8qIEMrKyAqLworLy8gSUQgNjQ1MTIgKDB4ZmMwMCkKK3R5cGVkZWYgc3RydWN0IHNCdGFtcFRMVkhDSV9WZW5kb3JfU3BlY2lmaWNfQ21kXzAgeworICAgIHZfVThfdCAgICAgICBwcmVzZW50OworfSB0QnRhbXBUTFZIQ0lfVmVuZG9yX1NwZWNpZmljXzBfQ21kOworCisjZGVmaW5lIEJUQU1QX1RMVl9IQ0lfVkVORE9SX1NQRUNJRklDX0NNRF8wICggNjQ1MTIgKQorCisvLyBJRCA2NDUxMyAoMHhmYzAxKQordHlwZWRlZiBzdHJ1Y3Qgc0J0YW1wVExWSENJX1ZlbmRvcl9TcGVjaWZpY19DbWRfMSB7CisgICAgdl9VOF90ICAgICAgIHByZXNlbnQ7Cit9IHRCdGFtcFRMVkhDSV9WZW5kb3JfU3BlY2lmaWNfMV9DbWQ7CisKKyNkZWZpbmUgQlRBTVBfVExWX0hDSV9WRU5ET1JfU1BFQ0lGSUNfQ01EXzEgKCA2NDUxMyApCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIEluZm9ybWF0aW9uIEVsZW1lbnRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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GF0Zm9ybSBpbmRlcGVuZGVudCIgRGF0YSBwYXRoIGZ1bmN0aW9ucy4KKyAgCisgIFRoZSBmdW5jdGlvbnMgZXh0ZXJuYWxpemVkIGJ5IHRoaXMgbW9kdWxlIGFyZSB0byBiZSBjYWxsZWQgT05MWSBieSBvdGhlciAKKyAgV0xBTiBtb2R1bGVzIChIREQpIHRoYXQgcHJvcGVybHkgcmVnaXN0ZXIgd2l0aCB0aGUgQkFQIExheWVyIGluaXRpYWxseS4KKworICBERVBFTkRFTkNJRVM6IAorCisgIEFyZSBsaXN0ZWQgZm9yIGVhY2ggQVBJIGJlbG93LiAKKyAgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgIEVESVQgSElTVE9SWSBGT1IgRklMRQorCisKKyAgVGhpcyBzZWN0aW9uIGNvbnRhaW5zIGNvbW1lbnRzIGRlc2NyaWJpbmcgY2hhbmdlcyBtYWRlIHRvIHRoZSBtb2R1bGUuCisgIE5vdGljZSB0aGF0IGNoYW5nZXMgYXJlIGxpc3RlZCBpbiByZXZlcnNlIGNocm9ub2xvZ2ljYWwgb3JkZXIuCisKKworICAgJEhlYWRlcjogL2N5Z2RyaXZlL2UvQnVpbGRzL003MjAxSlNEQ0FBUEFENTIyNDBCL1dNL3BsYXRmb3JtL21zbTcyMDAvU3JjL0RyaXZlcnMvU0QvQ2xpZW50RHJpdmVycy9XTEFOL1FDVC9DT1JFL0JBUC9zcmMvYmFwQXBpRGF0YS5jLHYgMS40IDIwMDgvMTEvMTAgMjI6MzQ6MjIganptdWRhIEV4cCBqem11ZGEgJCREYXRlVGltZSQkQXV0aG9yOiBqem11ZGEgJAorCisKKyAgd2hlbiAgICAgICAg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FVNUExPRyhuLCBuYW1lMSwgbmFtZTIsIGFTdHIsIHNpemUpIGRvIHsgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgaW50IGk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCIlZC4gJXM6ICVzID0gXG4iLCBuLCBuYW1lMSwgbmFtZTIpOyBcCisgICAgICAgIGZvciAoaSA9IDA7IGkgPCBzaXplOyBpKyspICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIiUyLjJ4JXMiLCAoKHVuc2lnbmVkIGNoYXIgKilhU3RyKVtpXSwgaSAlIDE2ID09IDE1ID8gIlxuIiA6ICIgIik7IFwKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJcbiIpOyAgICAgIFwKKyAgICB9IHdoaWxlICgwKQorI2Vsc2UKKyNkZWZpbmUgRFVNUExPRyhuLCBuYW1lMSwgbmFtZTIsIGFTdHIsIHNpemUpCisjZW5kaWYKKworI2lmIDAKKy8vIERlYnVnIHJlbGF0ZWQgZGVmaW5lcworI2RlZmluZSBEQkdMT0cgcHJpbnRmCisjZGVmaW5lIERVTVBMT0cKKyNpZiBkZWZpbmVkIERVTVBMT0cKKyNkZWZpbmUgRFVNUExPRyhuLCBuYW1lMSwgbmFtZTIsIGFTdHIsIHNpemUpIGRvIHsgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgaW50IGk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFw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fVTE2X3QgIHVzTGVuVHlwZTsgIC8qIE51bSBieXRlcyBpbiBpbmZvIGZpZWxkIChpLmUuLCBleGNsdWRlIDgwMi4zIGhkcikgKi8KKyAgICAgICAgICAgICAgICAgICAgICAvKiBNYXggbGVuZ3RoIDE1MDAgKDB4NWRjKSAoV2hhdCBhYm91dCAweDVlZT8gVGhhdAorICAgICAgICAgICAgICAgICAgICAgICAqIGluY2x1ZGVzIDgwMi4zIEhlYWRlciBhbmQgRkNTLikgKi8KK31XTEFOQkFQXzgwMjNIZWFkZXJUeXBlOworI2VuZGlmCisKKy8qKgorICogXGJyaWVmIEhDSSBBQ0wgRGF0YSBwYWNrZXQgZm9ybWF0CisgKgorICogICAgIDAgICAgICA3IDggICAgICAxNSAxNiAgICAyMyAyNCAgICAzMQorICogICAgKy0tLS0tLS0tKy0tLS0rLS0tLSstLS0tLS0tLSstLS0tLS0tLSsKKyAqICAgIHwgcGh5XyAgIHxsb2dffCBQQi98ICAgRGF0YSBUb3RhbCAgICB8CisgKiAgICB8IGxpbmtfICB8bG5rX3wgQkMgfCAgICAgIExlbmd0aCAgICAgfAorICogICAgfCBoYW5kbGUgfGhuZGx8RmxhZ3wgICAgICAgICAgICAgICAgIHwKKyAqICAgICstLS0tLS0tLSstLS0tKy0tLS0rLS0tLS0tLS0rLS0tLS0tLS0rCisgKiAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorICogICAgfCAgICAgICAgICAgICAgICBEYXRhICAgICAgICAgICAgICAgIHwKKyAqICAgIH4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB+CisgKiAgICArLS0tLS0tLS0rLS0tLS0tLS0tKy0tLS0tLS0tKy0tLS0tLS0tKworICoKKyAqICBOQjogCisgKiAgVGhpcyBpcyBpbiBsaXR0bGUtZW5kaWFuCisgKiAgMSkgcGh5X2xpbmtfaGFuZGxlIGlzIHRoZSBmaXJzdCA4IGJpdHMKKyAqICAyKSBsb2dfbGlua19oYW5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orICAgIC8qIFB1c2ggb24gdGhlIExMQyBoZWFkZXIgKi8KKyAgICB2b3NfcGt0X3B1c2hfaGVhZCh2b3NEYXRhQnVmZiwgCisgICAgICAgICAgICBhdWNMTENIZWFkZXIsIAorICAgICAgICAgICAgV0xBTkJBUF9MTENfSEVBREVSX0xFTik7ICAKKworICAgIC8qIFB1c2ggb24gdGhlIDgwMi4zIGhlYWRlciAqLworICAgIHZvc19wa3RfcHVzaF9oZWFkKHZvc0RhdGFCdWZmLCAmdzgwMjNIZWFkZXIsIHNpemVvZih3ODAyM0hlYWRlcikpOworCisKKyAgICAvKlNldCB0aGUgbG9naWNhbCBsaW5rIGhhbmRsZSBhcyB1c2VyIGRhdGEgc28gdGhhdCB3ZSBjYW4gcmV0cmlldmUgaXQgb24gCisgICAgICBUeCBDb21wbGV0ZSAqLworICAgIHZhbHVlID0gKHVpbnRwdHJfdCloY2lBQ0xIZWFkZXIubG9nTGlua0hhbmRsZTsKKyAgICB2b3NfcGt0X3NldF91c2VyX2RhdGFfcHRyKCB2b3NEYXRhQnVmZiwgVk9TX1BLVF9VU0VSX0RBVEFfSURfQkFQLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2X1ZPSURfdCAqKXZhbHVlKTsKKworICAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9LypXTEFOQkFQX1hsYXRlVHhEYXRhUGt0Ki8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOQkFQX0dldEFjRnJvbVR4RGF0YVBrdAorCisgIERFU0NSSVBUSU9OIAorCisgICAgSEREIHdpbGwgY2FsbCB0aGlzIEFQSSB3aGVuIGl0IGhhcyBhIEhDSSBEYXRhIFBhY2tldCAoU0tCKSBhbmQgaXQgd2FudHMgCisgICAgdG8gZmluZCBBQyB0eXBlIG9mIHRoZSBkYXRhIGZyYW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B0byBiZSAKKyAgICAgICAgICAgICAgICAgdHJhbnNsYXRlZCB0byBCVCBIQ0kgRGF0YSBQYWNrZXQKKyAgIAorICBSRVRVUk4gVkFMVUUKKworICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfRV9JTlZBTDogIElucHV0IHBhcmFtZXRlcnMgYXJlIGludmFsaWQgCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgQkFQIGhhbmRsZSBpcyBOVUxMICAKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikgCisKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTkJBUF9YbGF0ZVJ4RGF0YVBrdAorKCAKKyAgcHRCdGFtcEhhbmRsZSAgICAgYnRhbXBIYW5kbGUsIAorICB2X1U4X3QgICAgICAgICAgICBwaHlfbGlua19oYW5kbGUsICAvKiBVc2VkIGJ5IEJBUCB0byBpbmRlbnRpZnkgdGhlIFdMQU4gYXNzb2MuIChTdGFJZCkgKi8KKyAgV0xBTlRMX0FDRW51bVR5cGUgICpwdWNBQywgICAgICAgIC8qIFJldHVybiB0aGUgQUMgaGVyZS4gSSBkb24ndCB0aGluayB0aGlzIGlzIG5lZWRlZCAqLworICB2b3NfcGt0X3QgICAgICAgICp2b3NEYXRhQnVmZgorKQoreworICAgIFdMQU5CQVBfODAyM0hlYWRlclR5cGUgIHc4MDIzSGVhZGVyOworICAgIFdMQU5CQVBfSENJQUNMSGVhZGVyVHlwZSBoY2lBQ0xIZWFkZXI7CisgICAgdl9VOF90ICAgICAgICAgICAgICAgICAgIGF1Y0xMQ0hlYWRlcltXTEFOQkFQX0xMQ19IRU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E9IHZvc1N0YXR1cyApIAorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIldMQU4gQkFQOiBGYWlsZWQgdG8gcG9wIExMQy9TTkFQIGhlYWRlciBmcm9tIHBhY2tldCAlZCIsCisgICAgICAgICAgICAgICAgICB2b3NTdGF0dXMpOworCisgICAgICAgIHJldHVybiB2b3NTdGF0dXM7CisgICAgfQorCisjaWZkZWYgQkFQX0RFQlVHCisgICAgLy8gSkVaMDgxMDAzOiBSZW1vdmUgdGhpcyBhZnRlciBkZWJ1Z2dpbmcgCisgICAgLy8gU2hvdWxkIEkgZG91YmxlIGNoZWNrIHRoYXQgSSBhbSBnZXR0aW5nIHRoZSBCVCBTSUcgT1VJID8KKyAgICBpZiAoICEodm9zX21lbV9jb21wYXJlKCBhdWNMTENIZWFkZXIsIAorICAgICAgICAgICAgIFdMQU5CQVBfTExDX0hFQURFUiwgIAorICAgICAgICAgICAgIHNpemVvZihXTEFOQkFQX0xMQ19IRUFERVIpICAKKyAgICAgICAgICAgICAtIFdMQU5CQVBfTExDX09VSV9TSVpFKSAgLyogRG9uJ3QgY2hlY2sgdGhlIGxhc3QgdGhyZWUgYnl0ZXMgaGVyZSAqLyAKKyAgICAgICAgICYmIHZvc19tZW1fY29tcGFyZSggJmF1Y0xMQ0hlYWRlcltXTEFOQkFQX0xMQ19PVUlfT0ZGU0VUXSwgCisgICAgICAgICAgICAgKHZfVk9JRF90KilXTEFOQkFQX0JUX0FNUF9PVUksICAKKyAgICAgICAgICAgICBXTEFOQkFQX0xMQ19PVUlfU0laRSkpKSAgLyogY2hlY2sgdGhlbSBoZXJlICovIAorICAgIHsKKworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAiSW52YW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V0IExpbmsgU3VwZXJ2aXNpb24gdGltZXIgKi8KKyAgICAgICAgICAgIC8vdm9zU3RhdHVzID0gV0xBTkJBUF9TdG9wTGlua1N1cGVydmlzaW9uVGltZXIoYmFwQ29udGV4dCk7IAorICAgICAgICAgICAgLy92b3NTdGF0dXMgPSBXTEFOQkFQX1N0YXJ0TGlua1N1cGVydmlzaW9uVGltZXIoYmFwQ29udGV4dCw3MDAwKTsKKyAgICAgICAgICAgIGJhcENvbnRleHQtPmRhdGFQa3RQZW5kaW5nID0gVk9TX1RSVUU7Ly9JbmRpY2F0aW9uIGZvciBMaW5rU3VwZXJ2aXNpb24gbW9kdWxlIHRoYXQgZGF0YSBpcyBwZW5kaW5nIAorICAgICAgICAgICAgLyogSW52b2tlIHRoZSBjYWxsYmFjayB0aGF0IEJTTCByZWdpc3RlcmVkIHdpdGggbWUgKi8gCisgICAgICAgICAgICB2b3NTdGF0dXMgPSAoKmJhcENvbnRleHQtPnBmbkJ0YW1wX1NUQVJ4Q0IpKCAKKyAgICAgICAgICAgICAgICBwSGRkSGRsLAorICAgICAgICAgICAgICAgIHZvc0RhdGFCdWZmLAorICAgICAgICAgICAgICAgIHBSeE1ldGFJbmZvKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICAgIldMQU5CQVBfU1RBUnhDQjpiYXBMaW5rU3VwZXJ2aXNpb25UaW1lckludGVydmFsIGlzIDAiKTsKKyAgICAgICAgICAgIC8qIERyb3AgcGFja2V0ICovCisgICAgICAgICAgICB2b3NfcGt0X3JldHVybl9wYWNrZXQodm9zRGF0YUJ1ZmYpOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOiBsaW5rIFN1cGVydmlzaW9uIHBhY2tldCByZWNlaXZlZCBvdmVyIFRMOiAlZCwgPT4gQkFQIiwKKyAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLHByb3RvVHlwZSk7CisgICAgICAgICAgYnRhbXBIYW5kbGUgPSAocHRCdGFtcEhhbmRsZSliYXBDb250ZXh0OyAKKyAgICAgICAgICB2b3NTdGF0dXMgPSBXTEFOQkFQX1J4UHJvY0xzUGt0KAorICAgICAgICAgICAgICAgICAgICAgICAgYnRhbXBIYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICBiYXBDb250ZXh0LT5waHlfbGlua19oYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICBwcm90b1R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICB2b3NEYXRhQnVmZgorICAgICAgICAgICAgICAgICAgICAgICAgKTsKKyAgICB9ICAKKworICAgIHJldHVybiB2b3NTdGF0dXM7Cit9IC8qIFdMQU5CQVBfU1RBUnhDQiAqLworCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIEZVTkNUSU9OICAgIFdMQU5CQVBfVHhDb21wQ0IKKworICBERVNDUklQVElPTiAgIAorICAgIFRoZSB0eCBjb21wbGV0ZSBjYWxsYmFjayByZWdpc3RlcmVkIHdpdGggVEwuIAorICAgIAorICAgIFRMIHdpbGwgY2FsbCB0aGlzIHRvIG5vdGlmeSB0aGUgY2xpZW50IHdoZW4gYSB0cmFuc21pc3Npb24gZm9yIGEgCisgICAgcGFja2V0ICBoYXMgZW5kZWQuIAorCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgIHB2b3NHQ3R4OiAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleH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iIGEgcCBBIHAgaSBEIGUgYiB1IGcgLiBDCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICBPVkVSVklFVzoKKyAgCisgIFRoaXMgc29mdHdhcmUgdW5pdCBob2xkcyB0aGUgaW1wbGVtZW50YXRpb24gb2YgdGhlIFdMQU4gQkFQIG1vZHVsZXMKKyAgRGVidWcgZnVuY3Rpb25zLgorICAKKyAgVGhlIGZ1bmN0aW9ucyBleHRlcm5hbGl6ZWQgYnkgdGhpcyBtb2R1bGUgYXJlIHRvIGJlIGNhbGxlZCBPTkxZIGJ5IG90aGVyIAorICBXTEFOIG1vZHVsZXMgKEhERCkgdGhhdCBwcm9wZXJseSByZWdpc3RlciB3aXRoIHRoZSBCQVAgTGF5ZXIgaW5pdGlhbGx5LgorCisgIERFUEVOREVOQ0lFUzogCisKKyAgQXJlIGxpc3RlZCBmb3IgZWFjaCBBUEkgYmVsb3cuIAorICAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisgICAkSGVhZGVyOiAvY3lnZHJpdmUvZS9CdWlsZHMvTTcyMDFKU0RDQUFQQUQ1MjI0MEIvV00vcGxhdGZvcm0vbXNtNzIwMC9TcmMvRHJpdmVycy9TRC9DbGllbnREcml2ZXJzL1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yB0aGUgaW1wbGVtZW50YXRpb24gb2YgdGhlIGV4dGVybmFsIGludGVyZmFjZXMKKyAgcmVxdWlyZWQgYnkgdGhlIFdMQU4gQkFQIG1vZHVsZS4gIEl0IGlzIGN1cnJlbnRseSBhIHRlbXBvcmFyeSAKKyAgcmVzcG9zaXRvcnkgZm9yIEFQSSByb3V0aW5lcyB3aGljaCBzaG91bGQgYmUgZnVybmlzaGVkIGJ5IENTUgorICBvciBUTCwgYnV0IGFyZW4ndCB5ZXQgaW1wbGVtZW50ZWQuCisgIAorICBUaGUgZnVuY3Rpb25zIHByb3ZpZGUgYnkgdGhpcyBtb2R1bGUgYXJlIGNhbGxlZCBieSB0aGUgcmVzdCBvZiAKKyAgdGhlIEJULUFNUCBQQUwgbW9kdWxlLgorCisgIERFUEVOREVOQ0lFUzogCisKKyAgQXJlIGxpc3RlZCBmb3IgZWFjaCBBUEkgYmVsb3cuIAorICAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisgICAkSGVhZGVyOiAvY3lnZHJpdmUvZS9CdWlsZHMvTTcyMDFKU0RDQUFQQUQ1MjI0MEIvV00vcGxhdGZvcm0vbXNtNzIwMC9TcmMvRHJpdmVycy9TRC9DbGllbnREcml2ZXJzL1dMQU4vUUNUL0NPUkUvQk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o9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5CQVBfR2V0Q3VycmVudENoYW5uZWwKKworICBERVNDUklQVElPTiAKKyAgICBDbGVhciBvdXQgYWxsIGZpZWxkcyBpbiB0aGUgQkFQIGNvbnRleHQuCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcEJ0YW1wQ3R4OiAgIHBvaW50ZXIgdG8gdGhlIEJBUCBjb250cm9sIGJsb2NrCisgICAgY2hhbm5lbDogICAgIGN1cnJlbnQgY29uZmlndXJlZCBjaGFubmVsIG51bWJlci4KKyAgICBhY3RpdmVGbGFnOiAgZmxhZyBpbmRpY2F0aW5nIHdoZXRoZXIgdGhlcmUgaXMgYW4gYWN0aXZlIGxpbmsuCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgcG9pbnRlciB0byByZXR1cm4gY2hhbm5lbCBpcyBOVUxMIDsgYWNjZXNzIHdvdWxkIGNhdXNlIGEgcGFnZSAKKyAgICAgICAgICAgICAgICAgICAgICAgICBmYXVsdCAgCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgRXZlcnl0aGluZyBpcyBnb29kIDopIAorCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgCitXTEFOQkFQX0dldEN1cnJlbnRDaGFubmVsCisoIAorICBwdEJ0YW1wQ29udGV4dCAgcEJ0YW1wQ3R4LAorICB2X1UzMl90ICpja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NzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKyNpZm5kZWYgV0xBTl9RQ1RfV0xBTkJBUF9BUElfRVhUX0gKKyNkZWZpbmUgV0xBTl9RQ1RfV0xBTkJBUF9BUElfRVhUX0gKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgVyBMIEEgTiAgIEIgVCAtIEEgTSBQICBQIEEgTCAgIEwgQSBZIEUgUiAKKyAgICAgICAgICAgICAgICAgICAgICAgRSBYIFQgRSBSIE4gQSBMICBBIFAgSQorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgIAorREVTQ1JJUFRJT04KKyAgVGhpcyBmaWxlIGNvbnRhaW5zIHRoZSBleHRlcm5hbCBBUElzIHVzZWQgYnkgdGhlIHdsYW4gQlQtQU1QIFBBTCBsYXllciAKKyAgbW9kdWxlLgorICAKKyAgICAgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisgICRIZWFkZXI6IC9jeWdkcml2ZS9lL0J1aWxkcy9NNzIwMUpTRENBQVBBRDUyMjQwQi9XTS9wbGF0Zm9ybS9tc203MjAwL1NyYy9Ecml2ZXJzL1NEL0NsaWVudERyaXZlcnMvV0xBTi9RQ1QvQ09SRS9CQVAvc3JjL2JhcEFwaUV4dC5oLHYgMS4xIDIwMDgvMTEvMjEgMjA6Mjk6MTMganptdWRhIEV4cCBqem11ZGEgJCAkRGF0ZVRpbWU6ICQgJEF1dGhvcjoganptdWRhICQKKworCit3aGVuICAgICAgICB3aG8gICAgd2hhdCwgd2hlcmUsIHdoeQorLS0tLS0tLS0gICAgLS0tICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKzEwLzIyLzA4ICAgIGpleiAgICAgQ3JlYXRlZCBtb2R1bGUuCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgICAgIElOQ0xVREUgRklMRVMgRk9SIE1PRFVMRQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAqIEluY2x1ZGUgRmlsZXMKKyAqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworLy8gUGljayB1cCBhbGwgdGhlIEJULUFNUCBpbnRlcm5hbCBkZWZpbml0aW9ucyAKKy8vIEFuZCB1bmRlcmx5aW5nIHN1cHBvcnRpbmcgdHlw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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICBiIGEgcCBBIHAgaSBIIEMgQiBCIC4gQworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgT1ZFUlZJRVc6CisgIAorICBUaGlzIHNvZnR3YXJlIHVuaXQgaG9sZHMgdGhlIGltcGxlbWVudGF0aW9uIG9mIHRoZSBXTEFOIEJBUCBtb2R1bGVzCisgIEhvc3QgQ29udHJvbGxlciBhbmQgQmFzZWJhbmQgZnVuY3Rpb25zLgorICAKKyAgVGhlIGZ1bmN0aW9ucyBleHRlcm5hbGl6ZWQgYnkgdGhpcyBtb2R1bGUgYXJlIHRvIGJlIGNhbGxlZCBPTkxZIGJ5IG90aGVyIAorICBXTEFOIG1vZHVsZXMgKEhERCkgdGhhdCBwcm9wZXJseSByZWdpc3RlciB3aXRoIHRoZSBCQVAgTGF5ZXIgaW5pdGlhbGx5LgorCisgIERFUEVOREVOQ0lFUzogCisKKyAgQXJlIGxpc3RlZCBmb3IgZWFjaCBBUEkgYmVsb3cuIAorICAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisg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AgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisgICAkSGVhZGVyOiAvY3lnZHJpdmUvYy9Ecm9wYm94L003MjAxSlNEQ0FBUEFENTIyNDBCL1dNL3BsYXRmb3JtL21zbTcyMDAvU3JjL0RyaXZlcnMvU0QvQ2xpZW50RHJpdmVycy9XTEFOL1FDVF9CVEFNUF9QQUwvQ09SRS9CQVAvc3JjL2JhcEFwaUluZm8uYyx2IDEuMiAyMDA4LzExLzEwIDIyOjU1OjI0IGp6bXVkYSBFeHAganptdWRhICQkRGF0ZVRpbWUkJEF1dGhvcjoganptdWRhICQKKworCisgIHdoZW4gICAgICAgIHdobyAgICAgd2hhdCwgd2hlcmUsIHdoeQorLS0tLS0tLS0tLSAgICAtLS0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKzIwMDgtMDktMTUgICAgamV6ICAgICBDcmVhdGVkIG1vZHVsZQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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LiAKKyAgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgIEVESVQgSElTVE9SWSBGT1IgRklMRQorCisKKyAgVGhpcyBzZWN0aW9uIGNvbnRhaW5zIGNvbW1lbnRzIGRlc2NyaWJpbmcgY2hhbmdlcyBtYWRlIHRvIHRoZSBtb2R1bGUuCisgIE5vdGljZSB0aGF0IGNoYW5nZXMgYXJlIGxpc3RlZCBpbiByZXZlcnNlIGNocm9ub2xvZ2ljYWwgb3JkZXIuCisKKworICAgJEhlYWRlcjogL2hvbWUvbGFidXNlci9hbXBCbHVlWl8yL0NPUkUvQkFQL3NyYy9iYXBBcGlMaW5rQ250bC5jLHYgMS4xIDIwMTAvMTAvMjMgMjM6NDA6MjggbGFidXNlciBFeHAgbGFidXNlciAkJERhdGVUaW1lJCRBdXRob3I6IGxhYnVzZXIgJAorCisKKyAgd2hlbiAgICAgICAgd2hvICAgICB3aGF0LCB3aGVyZSwgd2h5CistLS0tLS0tLS0tICAgIC0tLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorMjAwOC0wOS0xNSAgICBqZXogICAgIENyZWF0ZWQgbW9kdWxlCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICogSW5jbHVkZSBGaWxlcworICogLS0tLS0tLS0tLS0tL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RVlfU0VUX1NVQ0NFU1M7IAorICAgICAgICAgICAgYmFwRXZlbnQucGFyYW1zID0gcENzclJvYW1JbmZvOworICAgICAgICAgICAgYmFwRXZlbnQudTEgPSByb2FtU3RhdHVzOworICAgICAgICAgICAgYmFwRXZlbnQudTIgPSByb2FtUmVzdWx0OworCisgICAgICAgICAgICAvKiBIYW5kbGUgZXZlbnQgKi8gCisgICAgICAgICAgICB2b3NTdGF0dXMgPSBidGFtcEZzbShidGFtcENvbnRleHQsICZiYXBFdmVudCwgJnN0YXR1cyk7CisgIAorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fRElTQVNTT0NJQVRFRDogCisgICAgICAgICAgICAvKiBiYXBSb2FtQ29tcGxldGVDYWxsYmFjayB3aXRoIGVDU1JfUk9BTV9ESVNBU1NPQ0lBVEVEICovCisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiSW4gJXMsIENTUiByb2FtU3RhdHVzID0gJXMgKCVkKSIsIF9fZnVuY19fLCAiZUNTUl9ST0FNX0RJU0FTU09DSUFURUQiLCByb2FtU3RhdHVzKTsgICAKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fTE9TVExJTks6CisgICAgICAgICAgICAvKiBiYXBSb2FtQ29tcGxldGVDYWxsYmFjayB3aXRoIGVDU1JfUk9BTV9MT1NUTElOSyAqLworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIkluICVzLCBDU1Igcm9hbVN0YXR1cyA9ICVzICglZCkiLCBfX2Z1bmNfXywgImVDU1JfUk9BTV9MT1NUTElOSyIsIHJvYW1TdGF0dXMpOyAgIAorCisgICAgICAgICAgICBpZiAocm9hbVJlc3VsdCAhPSBlQ1NSX1JPQU1fUkVTVUxUX05PTkUpIHsKKyAgICAgICAgICAgICAgICAvKiBGaWxsIGluIHRoZSBldmVudCBzdHJ1Y3R1cmUgKi8gCisgICAgICAgICAgICAgICAgYmFwRXZlbnQuZXZlbnQgPSBlV0xBTl9CQVBfTUFDX1JFQURZX0ZPUl9DT05ORUNUSU9OUzsgCisgICAgICAgICAgICAgICAgYmFwRXZlbnQucGFyYW1zID0gcENzclJvYW1JbmZvOworICAgICAgICAgICAgICAgIGJhcEV2ZW50LnUxID0gcm9hbVN0YXR1czsKKyAgICAgICAgICAgICAgICBiYXBFdmVudC51MiA9IHJvYW1SZXN1bHQ7IAorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIC8qIEhhbmRsZSBldmVudCAqLyAKKyAgICAgICAgICAgICAgICB2b3NTdGF0dXMgPSBidGFtcEZzbShidGFtcENvbnRleHQsICZiYXBFdmVudCwgJnN0YXR1cyk7CisgICAgICAgICAgICB9CisgIAorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICJJbiAlcywgdW5zdXBwb3J0ZWQgQ1NSIHJvYW1TdGF0dXMgPSAlZCIsIF9fZnVuY19fLCByb2FtU3RhdHVzKTsKKworICAgICAgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIkluICVzLCBiZWZvcmUgc3dpdGNoIG9uIHJvYW1SZXN1bHQgPSAlZCIsIF9fZnVuY19fLCByb2FtUmVzdWx0KTsKKworICAgIHN3aXRjaCAocm9hbVJlc3VsdCkgeworICAgICAgICAvL0pFWjA4MTExMDogQ29tbWVudGVkIG91dCBmb3IgdGVzdGluZy4gVGVzdCByZWxpZXMgdXBvbiBJQlNTLiAKKyAgICAgICAgY2FzZ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AvKiBGaWxsIGluIHRoZSBldmVudCBzdHJ1Y3R1cmUgKi8gCisgICAgICAgICAgICBiYXBFdmVudC5ldmVudCA9ICBlV0xBTl9CQVBfTUFDX0lORElDQVRFU19NRURJQV9ESVNDT05ORUNUSU9OOyAKKyAgICAgICAgICAgIGJhcEV2ZW50LnBhcmFtcyA9IHBDc3JSb2FtSW5mbzsKKyAgICAgICAgICAgIGJhcEV2ZW50LnUxID0gcm9hbVN0YXR1czsKKyAgICAgICAgICAgIGJhcEV2ZW50LnUyID0gcm9hbVJlc3VsdDsKKworICAgICAgICAgICAgLyogSGFuZGxlIGV2ZW50ICovIAorICAgICAgICAgICAgdm9zU3RhdHVzID0gYnRhbXBGc20oYnRhbXBDb250ZXh0LCAmYmFwRXZlbnQsICZzdGF0dXMpOworICAKKyAgICAgICAgICAgIC8qIEZpbGwgaW4gdGhlIGV2ZW50IHN0cnVjdHVyZSAqLyAKKyAgICAgICAgICAgIGJhcEV2ZW50LmV2ZW50ID0gIGVXTEFOX0JBUF9NQUNfUkVBRFlfRk9SX0NPTk5FQ1RJT05TOworICAgICAgICAgICAgYmFwRXZlbnQucGFyYW1zID0gcENzclJvYW1JbmZvOworICAgICAgICAgICAgYmFwRXZlbnQudTEgPSByb2FtU3RhdHVzOworICAgICAgICAgICAgYmFwRXZlbnQudTIgPSByb2FtUmVzdWx0OworCisgICAgICAgICAgICAvKiBIYW5kbGUgZXZlbnQgKi8gCisgICAgICAgICAgICB2b3NTdGF0dXMgPSBidGFtcEZzbShidGFtcENvbnRleHQsICZiYXBFdmVudCwgJnN0YXR1cyk7CisKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIC8vSkVaMDgxMTEwOiBDb21tZW50ZWQgb3V0IGZvciB0ZXN0aW5nLiBUZXN0IHJlbGllcyB1cG9uIElCU1MuIAorICAgICAgICBjYXNlIGVDU1JfUk9BTV9SRVNVTFRfSUJTU19JTkFDVElWRToKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01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AgICAgICAgICAgIC8vIGluaXRpYWwgam9pbiBpbiBJQlNTIG1vZGUgZmFpbHMuICBBbmRyZWFzIFdvbGYKKyAgICAgICAgICAgIC8vIChhd29sZkBhcHBsZS5jb20pIGV4cGxhaW5zIHRoZSBiZWhhdmlvciBhcyBmb2xsb3dzOgorICAgICAgICAgICAgLy8gIklmIHRoZSBjbGllbnQgYXR0ZW1wdHMgdG8gam9pbiBhbiBvcGVuIG5ldHdvcmsgYW5kIGl0IGZhaWxzIAorICAgICAgICAgICAgLy8gb24gdGhlIGZpcnN0IGF0dGVtcHQsIGl0IHJldmVydHMgYmFjayB0byBiLW9ubHkgbW9kZS4gVGhpcworICAgICAgICAgICAgLy8gd29ya2Fyb3VuZCB3YXMgc3BlY2lmaWNhbGx5IHB1dCBpbiBwbGFjZSB0byBhbGxvdyB0aGUgY2xpZW50CisgICAgICAgICAgICAvLyB0byBhc3NvY2lhdGUgdG8gc29tZSB0aGlyZCBwYXJ0eSBiLW9ubHkgaW5mcmFzdHJ1Y3R1cmUgQVBzLgorICAgICAgICAgICAgLy8gSXQgZGlkIG5vdCB0YWtlIElCU1MgaW50byBhY2NvdW50LCBpdCBzZWVtcyB0aGF0IHRoZSBmYWxsYmFjaworICAgICAgICAgICAgLy8gYWx3YXlzIGZvcmNlcyBpbmZyYXN0cnVjdHVyZS4iIAorCisgICAgICAgICAgICBidGFtcENvbnRleHQtPnN5c3RlbVJvbGUgPSBlU1lTVEVNX1NUQV9JTl9JQlNTX1JPTEU7CisKKyAgICAgICAgICAgIGlmIChtTGlua1N0YXR1cyA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIGVuYWJsZSB0aGUgZmxvdyBvZiBkYXRhCisgICAgICAgICAgICAgICAgREJHTE9HKCIlczogbWFya2luZyBsaW5rIGFzIHVwIGluICVzXG4iLCBfX2Z1bmNfXywgImVDU1JfUk9BTV9SRVNVTFRfSUJTU19DT05ORUNUIik7CisgICAgICAgICAgICAgICAgbUxpbmtTdGF0dXMgPSAxOworICAgICAgICAgICAgICAgICgoSU84MDIxMUludGVyZmFjZSopIG1OZXR3b3JrSUYpLT5zZXRMaW5rU3RhdGUoa0lPODAyMTFOZXR3b3JrTGlua1VwKTsKKyAgICAgICAgICAgICAgICBvdXRwdXRRdWV1ZS0+c2V0Q2FwYWNpdHkoVFJBTlNNSVRfUVVFVUVfU0laRSk7CisgICAgICAgICAgICAgICAgb3V0cHV0UXVldWUtPnN0YXJ0KCk7CisgICAgICAgICAgICAgICAgLy8gTGV0IHRoZW0ga25vdyB3ZSBhcmUgcmVhZHkKKyAgICAgICAgICAgICAgICAoKElPODAyMTFJbnRlcmZhY2UqKSBtTmV0d29ya0lGKS0+cG9zdE1lc3NhZ2UoQVBQTEU4MDIxMV9NX0FTU09DX0RPTkUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIERCR0xPRygiJXM6IGxpbmsgaXMgYWxyZWFkeSB1cCBpbiAlc1xuIiwgX19mdW5jX18sICJlQ1NSX1JPQU1fUkVTVUxUX0lCU1NfQ09OTkVDVCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fUkVTVUxUX0lCU1NfSU5BQ1RJVkU6CisgICAgICAgICAgICAvLyB3ZSBoYXZlIG5vIG1vcmUgSUJTUyBwZWVycywgc28gZGlzYWJsZSB0aGUgZmxvdyBvZiBkYXRhCisgICAgICAgICAgICBpZiAobUxpbmtTdGF0dXMgIT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBEQkdMT0coIiVzOiBtYXJraW5nIGxpbmsgYXMgZG93biBpbiAlc1xuIiwgX19mdW5jX18sICJlQ1NSX1JPQU1fUkVTVUxUX0lCU1NfSU5BQ1RJVkUiKTsKKyAgICAgICAgICAgICAgICBtTGlua1N0YXR1cyA9ICh0QU5JX1U4KSAwOworICAgICAgICAgICAgICAgIC8vIEpFWjA3MDYyNzogUmV2aXNpdCA/CisgICAgICAgICAgICAgICAgKChJTzgwMjExSW50ZXJmYWNlKikgbU5ldHdvcmtJRiktPnNldExpbmtTdGF0ZShrSU84MDIxMU5ldHdvcmtMaW5rRG93bik7CisgICAgICAgICAgICAgICAgb3V0cHV0UXVldWUtPnN0b3AoKTsKKyAgICAgICAgICAgICAgICBvdXRwdXRRdWV1ZS0+c2V0Q2FwYWNpdHkoMCk7CisKKyAgICAgICAgICAgICAgICAvLyB1cGRhdGUgb3VyIHN0YXRlCisgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5tQXNzb2NpYXRlZCA9IGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIERCR0xPRygiJXM6IGxpbmsgYWxyZWFkeSBkb3duIGluICVzXG4iLCBfX2Z1bmNfXywgImVDU1JfUk9BTV9SRVNVTFRfSUJTU19JTkFDVElWRSIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVDU1JfUk9BTV9SRVNVTFRfQVNTT0NJQVRFRDoKKyAgICAgICAgICAgIGJ0YW1wQ29udGV4dC0+bUFzc29jaWF0ZWRTdGF0dXMgPSBBUFBMRTgwMjExX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5tQXNzb2NpYXRlZCA9IHRydWU7CisKKyAgICAgICAgICAgIGlmICgocENzclJvYW1JbmZvKSAmJiAocENzclJvYW1JbmZvLT5wQnNzRGVzYykpIHsKKyAgICAgICAgICAgICAgICBjY3BDc3JUb0FwcGxlU2NhblJlc3VsdChtUE1hY09iamVjdCwgcENzclJvYW1JbmZvLT5wQnNzRGVzYywgJnNjYW5SZXN1bHQpOyAKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAvKiBTYXZlIGF3YXkgdGhlIElFcyB1c2VkIGJ5IHRoZSBBUCAqLworICAgICAgICAgICAgICAgIGNjcENzclRvQXNzb2NBcGllZGF0YSggbVBNYWNPYmplY3QsIHBDc3JSb2FtSW5mby0+cEJzc0Rlc2MsICYoYnRhbXBDb250ZXh0LT5hcGllZGF0YSkpOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGlmIChCc3NpZENoYW5nZWQoKHRDc3JCc3NpZCopIGJ0YW1wQ29udGV4dC0+YXNzb2NCc3NpZCwgKGV0aGVyX2FkZHIqKSBzY2FuUmVzdWx0LmFzcl9ic3NpZCkpIHsgCisgICAgICAgICAgICAgICAgICAgIG1lbWNweShidGFtcENvbnRleHQtPmFzc29jQnNzaWQsIHNjYW5SZXN1bHQuYXNyX2Jzc2lkLCA2KTsKKyAgICAgICAgICAgICAgICAgICAgKChJTzgwMjExSW50ZXJmYWNlKikgbU5ldHdvcmtJRiktPnBvc3RNZXNzYWdlKEFQUExFODAyMTFfTV9CU1NJRF9DSEFOR0VEICk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAoKElPODAyMTFJbnRlcmZhY2UqKSBtTmV0d29ya0lGKS0+cG9zdE1lc3NhZ2UoQVBQTEU4MDIxMV9NX0FTU09DX0RPTkUpOworCisgICAgICAgICAgICBpZiAobUxpbmtTdGF0dXMgPT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBtTGlua1N0YXR1cyA9ICh0QU5JX1U4KSAxOworICAgICAgICAgICAgICAgICgoSU84MDIxMUludGVyZmFjZSopIG1OZXR3b3JrSUYpLT5zZXRMaW5rU3RhdGUoa0lPODAyMTFOZXR3b3JrTGlua1VwKTsKKyAgICAgICAgICAgICAgICBEQkdMT0coIiVzOiBtYXJraW5nIGxpbmsgYXMgdXAgaW4gJXNcbiIsIF9fZnVuY19fLCAiZUNTUl9ST0FNX1JFU1VMVF9BU1NPQ0lBVEVEIik7CisgICAgICAgICAgICAgICAgb3V0cHV0UXVldWUtPnNldENhcGFjaXR5KFRSQU5TTUlUX1FVRVVFX1NJWkUpOworICAgICAgICAgICAgICAgIG91dHB1dFF1ZXVlLT5zdGFydCgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIERCR0xPRygiJXM6IGxpbmsgaXMgYWxyZWFkeSB1cCBpbiAlc1xuIiwgX19mdW5jX18sICJlQ1NSX1JPQU1fUkVTVUxUX0FTU09DSUFURUQiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVDU1JfUk9BTV9SRVNVTFRfTk9UX0FTU09DSUFURUQ6CisgICAgICAgICAgICBidGFtcENvbnRleHQtPm1Bc3NvY2lhdGVkU3RhdHVzID0gQVBQTEU4MDIxMV9TVEFUVVNfVU5BVkFJTEFCTEU7CisgICAgICAgICAgICBidGFtcENvbnRleHQtPm1Bc3NvY2lhdGVkID0gZmFsc2U7CisKKyAgICAgICAgICAgIGlmIChtTGlua1N0YXR1cyAhPSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIERCR0xPRygiJXM6IG1hcmtpbmcgbGluayBhcyBkb3duIGluICVzXG4iLCBfX2Z1bmNfXywgImVDU1JfUk9BTV9SRVNVTFRfTk9UX0FTU09DSUFURUQiKTsKKyAgICAgICAgICAgICAgICBtTGlua1N0YXR1cyA9ICh0QU5JX1U4KSAwOworICAgICAgICAgICAgICAgICgoSU84MDIxMUludGVyZmFjZSopIG1OZXR3b3JrSUYpLT5zZXRMaW5rU3RhdGUoa0lPODAyMTFOZXR3b3JrTGlua0Rvd24pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIERCR0xPRygiJXM6IGxpbmsgYWxyZWFkeSBkb3duIGluICVzXG4iLCBfX2Z1bmNfXywgImVDU1JfUk9BTV9SRVNVTFRfTk9UX0FTU09DSUFURUQiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fUkVTVUxUX0ZBSUxVUkU6CisgICAgICAgICAgICBidGFtcENvbnRleHQtPm1Bc3NvY2lhdGVkU3RhdHVzID0gQVBQTEU4MDIxMV9TVEFUVVNfVU5TUEVDSUZJRURfRkFJTFVSRTsKKyAgICAgICAgICAgIGJ0YW1wQ29udGV4dC0+bUFzc29jaWF0ZWQgPSBmYWxzZTsKKworICAgICAgICAgICAgaWYgKG1MaW5rU3RhdHVzICE9IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgREJHTE9HKCIlczogbWFya2luZyBsaW5rIGFzIGRvd24gaW4gJXNcbiIsIF9fZnVuY19fLCAiZUNTUl9ST0FNX1JFU1VMVF9GQUlMVVJFIik7CisgICAgICAgICAgICAgICAgbUxpbmtTdGF0dXMgPSAodEFOSV9VOCkgMDsKKyAgICAgICAgICAgICAgICAoKElPODAyMTFJbnRlcmZhY2UqKSBtTmV0d29ya0lGKS0+c2V0TGlua1N0YXRlKGtJTzgwMjExTmV0d29ya0xpbmtEb3duKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBEQkdMT0coIiVzOiBsaW5rIGFscmVhZHkgZG93biBpbiAlc1xuIiwgX19mdW5jX18sICJlQ1NSX1JPQU1fUkVTVUxUX0ZBSUxVUkUiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fUkVTVUxUX0RJU0FTU09DX0lORDoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBidGFtcENvbnRleHQtPm1Bc3NvY2lhdGVkID0gZmFsc2U7CisKKyAgICAgICAgICAgICAgICBpZiAobUxpbmtTdGF0dXMgIT0gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIERCR0xPRygiJXM6IG1hcmtpbmcgbGluayBhcyBkb3duIGluICVzXG4iLCBfX2Z1bmNfXywgImVDU1JfUk9BTV9SRVNVTFRfRElTQVNTT0NfSU5EIik7CisgICAgICAgICAgICAgICAgICAgIG1MaW5rU3RhdHVzID0gKHRBTklfVTgpIDA7CisgICAgICAgICAgICAgICAgICAgICgoSU84MDIxMUludGVyZmFjZSopIG1OZXR3b3JrSUYpLT5zZXRMaW5rU3RhdGUoa0lPODAyMTFOZXR3b3JrTGlua0Rvd24pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBEQkdMT0coIiVzOiBsaW5rIGFscmVhZHkgZG93biBpbiAlc1xuIiwgX19mdW5jX18sICJlQ1NSX1JPQU1fUkVTVUxUX0RJU0FTU09DX0lORCIpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8vaWYgKHBDc3JSb2FtSW5mbykgIC8vIEZvciBub3csIGxlYXZlIHRoaXMgY29tbWVudGVkIG91dC4gVW50aWwgQ1NSIGNoYW5nZXMgaW50ZWdyYXRlZC4KKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vIE5vdyBzZXQgdGhlIHJlYXNvbiBhbmQgc3RhdHVzIGNvZGVzLiAgCisgICAgICAgICAgICAgICAgICAgIC8vIEFjdHVhbGx5LCB0aGUgInJlc3VsdCBjb2RlIiBmaWVsZCBpbiB0aGUgdFNpclNtZURpc2Fzc29jSW5kIHNob3VsZCBiZSBuYW1lZCByZWFzb25Db2RlIGFuZCBOT1Qgc3RhdHVzQ29kZS4gIAorICAgICAgICAgICAgICAgICAgICAvLyAiUmVhc29uIENvZGVzIiBhcmUgZm91bmQgaW4gRGlzQXNzb2Mgb3IgRGVBdXRoIEluZC4gIlN0YXR1cyBDb2RlIiBmaWVsZHMgYXJlIGZvdW5kIGluIFJ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KSBwQ2FsbGJhY2tJbmZvKS0+c3RhdHVzQ29kZTsgLy8gdFNpclJlc3VsdENvZGVzICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIGJ0YW1wQ29udGV4dC0+cmVhc29uQ29kZSA9ICh0QU5JX1UxNikgZVNJUl9NQUNfVU5TUEVDX0ZBSUxVUkVfUkVBU09OOyAvL3RBTklfVTE2IC8vIHRTaXJNYWNSZWFzb25Db2RlcyAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBidGFtcENvbnRleHQtPmRlQXV0aFJlYXNvbkNvZGUgPSAwOyAvLyB0QU5JX1UxNiAgIC8vIGVTSVJfU01FX0RFQVVUSF9GUk9NX1BFRVIgCisgICAgICAgICAgICAgICAgICAgIC8vIFNob3VsZG4ndCB0aGUgbmV4dCBsaW5lIHJlYWxseSB1c2UgYSB0QU5JX1UxNj8gLy8wOyAvLyB0QU5JX1UxNiAgIC8vIGVTSVJfU01FX0RJU0FTU09DX0ZST01fUEVFUgorICAgICAgICAgICAgICAgICAgICBidGFtcENvbnRleHQtPmRpc2Fzc29jUmVhc29uQ29kZSA9IGJ0YW1wQ29udGV4dC0+cmVhc29uQ29kZTsgLy8gdFNpck1hY1JlYXNvbkNvZGVzIAorICAgICAgICAgICAgICAgICAgICAvLyBMZXQncyByZW1lbWJlciB0aGUgcGVlciB3aG8ganVzdCBkaXNhc3NvYydkIHVzCisgICAgICAgICAgICAgICAgICAgIC8vbWVtY3B5KGJ0YW1wQ29udGV4dC0+cGVlck1hY0FkZHIsIHBDc3JSb2FtSW5mby0+cGVlck1hY09yQnNzaWRGb3JJQlNTLCA2KTsKKyAgICAgICAgICAgICAgICB9IAorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fUkVTVUxUX0RFQVVUSF9JTkQ6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5tQXNzb2NpYXRlZCA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgaWYgKG1MaW5rU3RhdHVzICE9IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBEQkdMT0coIiVzOiBtYXJraW5nIGxpbmsgYXMgZG93biBpbiAlc1xuIiwgX19mdW5jX18sICJlQ1NSX1JPQU1fUkVTVUxUX0RFQVVUSF9JTkQiKTsKKyAgICAgICAgICAgICAgICAgICAgbUxpbmtTdGF0dXMgPSAodEFOSV9VOCkgMDsKKyAgICAgICAgICAgICAgICAgICAgKChJTzgwMjExSW50ZXJmYWNlKikgbU5ldHdvcmtJRiktPnNldExpbmtTdGF0ZShrSU84MDIxMU5ldHdvcmtMaW5rRG93bik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIERCR0xPRygiJXM6IGxpbmsgYWxyZWFkeSBkb3duIGluICVzXG4iLCBfX2Z1bmNfXywgImVDU1JfUk9BTV9SRVNVTFRfREVBVVRIX0lORCIpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8vaWYgKHBDc3JSb2FtSW5mbykgIC8vIEZvciBub3csIGxlYXZlIHRoaXMgY29tbWVudGVkIG91dC4gVW50aWwgQ1NSIGNoYW5nZXMgaW50ZWdyYXRlZC4KKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vIE5vdyBzZXQgdGhlIHJlYXNvbiBhbmQgc3RhdHVzIGNvZGVzLiAgCisgICAgICAgICAgICAgICAgICAgIC8vIEFjdHVhbGx5LCB0aGUgInJlc3VsdCBjb2RlIiBmaWVsZCBpbiB0aGUgdFNpclNtZURlYXV0aEluZCBzaG91bGQgYmUgbmFtZWQgcmVhc29uQ29kZSBhbmQgTk9UIHN0YXR1c0NvZGUuICAKKyAgICAgICAgICAgICAgICAgICAgLy8gIlJlYXNvbiBDb2RlcyIgYXJlIGZvdW5kIGluIERpc0F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ICAgICAgICAgIC8vYnRhbXBDb250ZXh0LT5yZWFzb25Db2RlID0gKCh0cFNpclNtZURlYXV0aEluZCkgcENhbGxiYWNrSW5mbyktPnN0YXR1c0NvZGU7IC8vIHRTaXJSZXN1bHRDb2RlcyAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBidGFtcENvbnRleHQtPnJlYXNvbkNvZGUgPSAodEFOSV9VMTYpIGVTSVJfTUFDX1VOU1BFQ19GQUlMVVJFX1JFQVNPTjsgLy90QU5JX1UxNiAvLyB0U2lyTWFjUmVhc29uQ29kZXMgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5kaXNhc3NvY1JlYXNvbkNvZGUgPSAwOyAvLyB0QU5JX1UxNiAgIC8vIGVTSVJfU01FX0RJU0FTU09DX0ZST01fUEVFUiAKKyAgICAgICAgICAgICAgICAgICAgLy8gU2hvdWxkbid0IHRoZSBuZXh0IGxpbmUgcmVhbGx5IHVzZSBhIHRBTklfVTE2PyAvLzA7IC8vIHRBTklfVTE2ICAgLy8gZVNJUl9TTUVfREVBVVRIX0ZST01fUEVFUgorICAgICAgICAgICAgICAgICAgICBidGFtcENvbnRleHQtPmRlQXV0aFJlYXNvbkNvZGUgPSBidGFtcENvbnRleHQtPnJlYXNvbkNvZGU7IC8vIHRTaXJNYWNSZWFzb25Db2RlcyAKKyAgICAgICAgICAgICAgICAgICAgLy8gTGV0J3MgcmVtZW1iZXIgdGhlIHBlZXIgd2hvIGp1c3QgZGUtYXV0aCdkIHVzCisgICAgICAgICAgICAgICAgICAgIC8vbWVtY3B5KGJ0YW1wQ29udGV4dC0+cGVlck1hY0FkZHIsICgodHBTaXJTbWVEZWF1dGhJbmQpIHBDYWxsYmFja0luZm8pLT5wZWVyTWFjQWRkciwgNik7ICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIH0gCisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVDU1JfUk9BTV9SRVNVTFRfTUlDX0VSUk9SX1VOSUNBU1Q6IAorCisgICAgICAgICAgICAvL2lmIChlQ1NSX1JPQU1fTUlDX0VSUk9SX0lORCA9PSByb2FtU3RhdHVzKSAgLy8gTWFrZSBzdXJlCisgICAgICAgICAgICB7IAorICAgICAgICAgICAgICAgIGlmIChidGFtcENvbnRleHQtPm1US0lQQ291bnRlck1lYXN1cmVzKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgKChJTzgwMjExSW50ZXJmYWNlKikgbU5ldHdvcmtJRiktPnBvc3RNZXNzYWdlKEFQUExFODAyMTFfTV9NSUNfRVJST1JfVUNBU1QpOyAKKyAgICAgICAgICAgICAgICAgICAgREJHTE9HKCIlczogVEtJUCBDb3VudGVybWVhc3VyZXMgaW4gZWZmZWN0IGluICVzXG4iLCBfX2Z1bmNfXywgImVDU1JfUk9BTV9SRVNVTFRfTUlDX0VSUk9SX1VOSUNBU1QiKTsgCisgICAgICAgICAgICAgICAgfSAKKyAgICAgICAgICAgICAgICBlbHNlIAorICAgICAgICAgICAgICAgIHsgCisgICAgICAgICAgICAgICAgICAgIERCR0xPRygiJXM6IFRLSVAgQ291bnRlcm1lYXN1cmVzIGRpc2FibGVkIGluICVzXG4iLCBfX2Z1bmNfXywgImVDU1JfUk9BTV9SRVNVTFRfTUlDX0VSUk9SX1VOSUNBU1QiKTsgCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fUkVTVUxUX01JQ19FUlJPUl9HUk9VUDogCisKKyAgICAgICAgICAgIC8vaWYgKGVDU1JfUk9BTV9NSUNfRVJST1JfSU5EID09IHJvYW1TdGF0dXMpICAvLyBNYWtlIHN1cmUKKyAgICAgICAgICAgIHsgCisgICAgICAgICAgICAgICAgaWYgKGJ0YW1wQ29udGV4dC0+bVRLSVBDb3VudGVyTWVhc3VyZXMpCisgICAgICAgICAgICAgICAgeyAKKyAgICAgICAgICAgICAgICAgICAgKChJTzgwMjExSW50ZXJmYWNlKikgbU5ldHdvcmtJRiktPnBvc3RNZXNzYWdlKEFQUExFODAyMTFfTV9NSUNfRVJST1JfTUNBU1QpOyAKKyAgICAgICAgICAgICAgICAgICAgREJHTE9HKCIlczogVEtJUCBDb3VudGVybWVhc3VyZXMgaW4gZWZmZWN0IGluICVzXG4iLCBfX2Z1bmNfXywgImVDU1JfUk9BTV9SRVNVTFRfTUlDX0VSUk9SX0dST1VQIik7IAorICAgICAgICAgICAgICAgIH0gCisgICAgICAgICAgICAgICAgZWxzZSAKKyAgICAgICAgICAgICAgICB7IAorICAgICAgICAgICAgICAgICAgICBEQkdMT0coIiVzOiBUS0lQIENvdW50ZXJtZWFzdXJlcyBkaXNhYmxlZCBpbiAlc1xuIiwgX19mdW5jX18sICJlQ1NSX1JPQU1fUkVTVUxUX01JQ19FUlJPUl9HUk9VUCIpOyAKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgYnJlYWs7CisgICAgfQorICAgIHN3aXRjaCAocm9hbVN0YXR1cykgeworICAgICAgICBjYXNlIGVDU1JfUk9BTV9ST0FNSU5HX1NUQVJUOiAKKyAgICAgICAgICAgIERCR0xPRygiJXM6IEluICVzXG4iLCBfX2Z1bmNfXywgImVDU1JfUk9BTV9ST0FNSU5HX1NUQVJUIik7CisgICAgICAgICAgICAvLyBUaGlzIG9ubHkgZ2V0cyBjYWxsZWQgd2hlbiBDU1IgZGVjaWRlcyB0byByb2FtIG9uIGl0cyBvd24gLSBkdWUgdG8gbG9zdGxpbmsuIAorICAgICAgICAgICAgLy8gQXBwbGUgc3RpbGwgbmVlZHMgdG8gYmUgdG9sZC4KKyAgICAgICAgICAgIGlmICgocENzclJvYW1JbmZvKSAmJiAocENzclJvYW1JbmZvLT5wQ29ubmVjdGVkUHJvZmlsZSkgJiYgKHBDc3JSb2FtSW5mby0+cENvbm5lY3RlZFByb2ZpbGUtPnBCc3NEZXNjKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBtZW1jcHkoYnNzaWQuZXRoZXJfYWRkcl9vY3RldCwgcENzclJvYW1JbmZvLT5wQ29ubmVjdGVkUHJvZmlsZS0+cEJzc0Rlc2MtPmJzc0lkLAorICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsgCisgICAgICAgICAgICAgICAgYXBwbGU4MDIxMUludGVyZmFjZS0+d2lsbFJvYW0oJmJzc2lkKTsgIC8vIFJldHVybiByZXN1bHQgaXNuJ3Qgc2lnbmlmaWNhbnQgCisgICAgICAgICAgICAgICAgREJHTE9HKCIlczogd2lsbFJvYW0gcmV0dXJuc1xuIiwgX19mdW5jX18pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fU0hPVUxEX1JPQU06CisgICAgICAgICAgICBpZiAoKHBDc3JSb2FtSW5mbykgJiYgKHBDc3JSb2FtSW5mby0+cEJzc0Rlc2MpKSB7CisgICAgICAgICAgICAgICAgLy8gcENhbGxiYWNrSW5mbyBwb2ludHMgdG8gdGhlIEJTUyBkZXNjLiBDb252ZXJ0IHRvIEFwcGxlIFNjYW4gUmVzdWx0LgorICAgICAgICAgICAgICAgIGhhbFN0YXR1cyA9IGNjcENzclRvQXBwbGVTY2FuUmVzdWx0KCAKKyAgICAgICAgICAgICAgICAgICAgICAgIG1QTWFjT2JqZWN0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgIHBDc3JSb2FtSW5mby0+cEJzc0Rlc2MsIAorICAgICAgICAgICAgICAgICAgICAgICAgJnNjYW5SZXN1bHQpOyAKKyAgICAgICAgICAgICAgICBpZiAoIGhhbFN0YXR1cyAhPSAwICkgCisgICAgICAgICAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFO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3Qgc2lnbmlmaWNhbnQgCisgICAgICAgICAgICAgICAgICAgIERCR0xPRygiJXM6IHdpbGxSb2FtIChjYWxsZWQgb3V0IG9mIG9yZGVyKSByZXR1cm5zXG4iLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgICAgIERCR0xPRygiICAgIHdpdGggQlNTSUQgPSAiIE1BQ19BRERSX1NUUklORyhic3NpZC5ldGhlcl9hZGRyX29jdGV0KSk7CisvLyNlbmRpZgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeyAKKyAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhlIHJvYW0gaXMgTk9UIGFjY2VwdGFibGUsIHJldHVybiBGQUlMVVJFCisgICAgICAgICAgICAgICAgICAgIERCR0xPRygiJXM6IHNob3VsZFJvYW0gcmV0dXJucyBcIk5PVCBhY2NlcHRhYmxlXCJcbiIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fRElTQVNTT0NJQVRFRDoKKyAgICAgICAgICAgIC8vaWYgKGVDU1JfUk9BTV9SRVNVTFRfRk9SQ0VEID09IHJvYW1SZXN1bHQgfHwgZUNTUl9ST0FNX1JFU1VMVF9NSUNfRVJST1IgPT0gcm9hbVJlc3VsdCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBidGFtcENvbnRleHQtPm1Bc3NvY2lhdGVkID0gZmFsc2U7CisKKyAgICAgICAgICAgICAgICBpZiAobUxpbmtTdGF0dXMgIT0gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIERCR0xPRygiJXM6IG1hcmtpbmcgbGluayBhcyBkb3duIGluICVzXG4iLCBfX2Z1bmNfXywgImVDU1JfUk9BTV9ESVNBU1NPQ0lBVEVEIik7CisgICAgICAgICAgICAgICAgICAgIG1MaW5rU3RhdHVzID0gKHRBTklfVTgpIDA7CisgICAgICAgICAgICAgICAgICAgICgoSU84MDIxMUludGVyZmFjZSopIG1OZXR3b3JrSUYpLT5zZXRMaW5rU3RhdGUoa0lPODAyMTFOZXR3b3JrTGlua0Rvd24pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBEQkdMT0coIiVzOiBsaW5rIGFscmVhZHkgZG93biBpbiAlc1xuIiwgX19mdW5jX18sICJlQ1NSX1JPQU1fRElTQVNTT0NJQVRFRCIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUNTUl9ST0FNX0xPU1RMSU5LOgorICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5tQXNzb2NpYXRlZFN0YXR1cyA9IEFQUExFODAyMTFfU1RBVFVTX1VOU1BFQ0lGSUVEX0ZBSUxVUkU7CisgICAgICAgICAgICBidGFtcENvbnRleHQtPm1Bc3NvY2lhdGVkID0gZmFsc2U7CisKKyAgICAgICAgICAgIGlmIChtTGlua1N0YXR1cyAhPSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIERCR0xPRygiJXM6IG1hcmtpbmcgbGluayBhcyBkb3duIGluICVzXG4iLCBfX2Z1bmNfXywgImVDU1JfUk9BTV9MT1NUTElOSyIpOworICAgICAgICAgICAgICAgIG1MaW5rU3RhdHVzID0gKHRBTklfVTgpIDA7CisgICAgICAgICAgICAgICAgKChJTzgwMjExSW50ZXJmYWNlKikgbU5ldHdvcmtJRiktPnNldExpbmtTdGF0ZShrSU84MDIxMU5ldHdvcmtMaW5rRG93bik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbH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nRleHQtPmJ0YW1wX2xvZ2ljYWxfbGlua19jYW5jZWxfcGVuZGluZyApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBCYXBIQ0lFdmVudC0+dS5idGFtcExvZ2ljYWxMaW5rQ29tcGxldGVFdmVudC5zdGF0dXMgPQorICAgICAgICAgICAgICAgIFdMQU5CQVBfRVJST1JfTk9fQ05DVDsKKyAgICAgICAgICAgIGJhcEhDSUV2ZW50LnUuYnRhbXBDb21tYW5kU3RhdHVzRXZlbnQuc3RhdHVzID0gV0xBTkJBUF9FUlJPUl9OT19DTkNUOworICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5idGFtcF9sb2dpY2FsX2xpbmtfc3RhdGUgPSBXTEFOX0JBUExvZ0xpbmtDbG9zZWQ7CisgICAgICAgICAgICBidGFtcENvbnRleHQtPmJ0YW1wX2xvZ2ljYWxfbGlua19jYW5jZWxfcGVuZGluZyA9IEZBTFNFOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLyogSWYgYnRhbXBfYXN5bmNfbG9naWNhbF9saW5rX2NyZWF0ZSBpcyBzZXQsIHdlIHdpbGwgc2VyYWxpemUgdGhlIHJlcQorICAgICAgICAgICAgICAgb24gTUMgdGhyZWFkICYgaGFuZGxlIGl0IHRoZXJlIGFmdGVyOyBJZiB0aGUgYWJvdmUgZmxhZyBpcyBub3Qgc2V0CisgICAgICAgICAgICAgICByZXNwb25kIHRvIEhDSSB0aGUgc3luYyB3YXkgYXMgYmVmb3JlICovCisgICAgICAgICAgICBpZihGQUxTRSA9PSBidGFtcENvbnRleHQtPmJ0YW1wX2FzeW5jX2xvZ2ljYWxfbGlua19jcmVhdGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIC8qIEFsbG9jYXRlIGEgbG9naWNhbCBsaW5rIGluZGV4IGZvciB0aGVzZSBmbG93IHNwZWNzICovCisgICAgICAgICAgICAgICAgIHZvc1N0YXR1cyA9IFdMQU5CQVBfQ3JlYXRlTmV3TG9nTGlua0N0eCggCisgICAgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LCAvKiBwZXIgYXNzb2MgYnRhbXBDb250ZXh0IHZhbHVlICovIAorICAgICAgICAgICAgICAgICAgIHBCYXBIQ0lMb2dMaW5rQ3JlYXRlLT5waHlfbGlua19oYW5kbGUsIC8qICBJIGdldCBwaHlfbGlua19oYW5kbGUgZnJvbSB0aGUgQ29tbWFuZCAqLworICAgICAgICAgICAgICAgICAgIHBCYXBIQ0lMb2dMaW5rQ3JlYXRlLT50eF9mbG93X3NwZWMsIC8qICBJIGdldCB0eF9mbG93X3NwZWMgZnJvbSB0aGUgQ29tbWFuZCAqLworICAgICAgICAgICAgICAgICAgIHBCYXBIQ0lMb2dMaW5rQ3JlYXRlLT5yeF9mbG93X3NwZWMsIC8qICBJIGdldCByeF9mbG93X3NwZWMgZnJvbSB0aGUgQ29tbWFuZCAqLworICAgICAgICAgICAgICAgICAgICZsb2dfbGlua19pbmRleCAvKiAgUmV0dXJuIHRoZSBsb2dpY2FsIGxpbmsgaW5kZXggaGVyZSAqLworICAgICAgICAgICAgICAgICAgICk7CisgICAgICAgICAgICAgICAgIGlmIChWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gdm9zU3RhdHVzKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAvKiBJbnZhbGlkIGZsb3cgc3BlYyBmb3JtYXQgKi8KKyAgICAgICAgICAgICAgICAgICAgIHBCYXBIQ0lFdmVudC0+dS5idGFtcExvZ2ljYWxMaW5rQ29tcGxldGVFdmVudC5zdGF0dXMgPQorICAgICAgICAgICAgICAgICAgICAgICAgV0xBTkJBUF9FUlJPUl9JTlZBTElEX0hDSV9DTU5EX1BBUkFNOworICAgICAgICAgICAgICAgICAgICAgYmFwSENJRXZlbnQudS5idGFtcENvbW1hbmRTdGF0dXNFdmVudC5zdGF0dXMgPSBXTEFOQkFQX0VSUk9SX0lOVkFMSURfSENJX0NNTkRfUEFSQU07CisgICAgICAgICAgICAgICAgICAgICBidGFtcENvbnRleHQtPmJ0YW1wX2xvZ2ljYWxfbGlua19zdGF0ZSA9IFdMQU5fQkFQTG9nTGlua0Nsb3NlZDsKKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICByZXR2YWwgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICAgICAgICAgICAgYmFwSENJRXZlbnQudS5idGFtcENvbW1hbmRTdGF0dXNFdmVudC5zdGF0dXMgPSBXTEFOQkFQX1NUQVRVU19TVUNDRVNTOworCisgICAgICAgICAgICAgICAgICAgICAgcEJhcEhDSUV2ZW50LT51LmJ0YW1wTG9naWNhbExpbmtDb21wbGV0ZUV2ZW50LnN0YXR1cyA9IFdMQU5CQVBfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5idGFtcF9sb2dpY2FsX2xpbmtfc3RhdGUgPSBXTEFOX0JBUExvZ0xpbmtPcGVuOworICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5idGFtcF9sb2dpY2FsX2xpbmtfcmVxX2luZm8ucGh5TGlua0hhbmRsZSA9IAorICAgICAgICAgICAgICAgICAgICBwQmFwSENJTG9nTGlua0NyZWF0ZS0+cGh5X2xpbmtfaGFuZGxlOworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShidGFtcENvbnRleHQtPmJ0YW1wX2xvZ2ljYWxfbGlua19yZXFfaW5mby50eEZsb3dTcGVjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQmFwSENJTG9nTGlua0NyZWF0ZS0+dHhfZmxvd19zcGVjLCAxOCk7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KGJ0YW1wQ29udGV4dC0+YnRhbXBfbG9naWNhbF9saW5rX3JlcV9pbmZvLnJ4Rmxvd1NwZWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCYXBIQ0lMb2dMaW5rQ3JlYXRlLT5yeF9mbG93X3NwZWMsIDE4KTsKKyAgICAgICAgICAgICAgICBidGFtcENvbnRleHQtPmJ0YW1wX2FzeW5jX2xvZ2ljYWxfbGlua19jcmVhdGUgPSBGQUxTRTsKKyAgICAgICAgICAgICAgICB2b3NTdGF0dXMgPSBidGFtcEVzdGFibGlzaExvZ0xpbmsoYnRhbXBDb250ZXh0KTsKKyAgICAgICAgICAgICAgICBpZihWT1NfU1RBVFVTX1NVQ0NFU1MgPT0gdm9zU3RhdHVzKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dmFsID0gVk9TX1NUQVRVU19FX0JVU1k7Ly90aGlzIHdpbGwgbWFrZSBzdXJlIGV2ZW50IGNvbXBsZXRlIGlzIG5vdCBzZW50IHRvIEhDSQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwQmFwSENJRXZlbnQtPnUuYnRhbXBMb2dpY2FsTGlua0NvbXBsZXRlRXZlbnQuc3RhdHVzID0KKyAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5CQVBfRVJST1JfSU5WQUxJRF9IQ0lfQ01ORF9QQVJBTTsKKyAgICAgICAgICAgICAgICAgICAgYmFwSENJRXZlbnQudS5idGFtcENvbW1hbmRTdGF0dXNFdmVudC5zdGF0dXMgPSBXTEFOQkFQX0VSUk9SX0lOVkFMSURfSENJX0NNTkRfUEFSQU07CisgICAgICAgICAgICAgICAgICAgIGJ0YW1wQ29udGV4dC0+YnRhbXBfbG9naWNhbF9saW5rX3N0YXRlID0gV0xBTl9CQVBMb2dMaW5rQ2xvc2VkOworICAgICAgICAgICAgICAgIH0KKyAgICAKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHZvc1N0YXR1cyA9ICgqYnRhbXBDb250ZXh0LT5wQmFwSENJRXZlbnRDQikgCisgICAgICAgICAgICAgICAgKCAgCisgICAgICAgICAgICAgICAgIGJ0YW1wQ29udGV4dC0+cEhkZEhkbCwgICAvKiB0aGlzIHJlZmVycyB0byB0aGUgQlNMIHBlciBjb25uZWN0aW9uIGNvbnRleHQgKi8KKyAgICAgICAgICAgICAgICAgJmJhcEhDSUV2ZW50LCAvKiBUaGlzIG5vdyBlbmNvZGVzIEFMTCBldmVudCB0eXBlcyAqLworICAgICAgICAgICAgICAgICBWT1NfVFJVRSAvKiBGbGFnIHRvIGluZGljYXRlIGFzc29jLXNwZWNpZmljIGV2ZW50ICovIAorICAgICAgICAgICAgICAgICk7CisKKyAgICBpbmRleF9mb3JfbG9nTGlua0N0eCA9IGxvZ19saW5rX2luZGV4ID4+IDg7CisgICAgLyogRm9ybWF0IHRoZSBMb2dpY2FsIExpbmsgQ29tcGxldGUgZXZlbnQgdG8gcmV0dXJuLi4uICovIAorICAgIHBCYXBIQ0lFdmVudC0+YmFwSENJRXZlbnRDb2RlID0gQlRBTVBfVExWX0hDSV9MT0dJQ0FMX0xJTktfQ09NUExFVEVfRVZFTlQ7CisgICAgcEJhcEhDSUV2ZW50LT51LmJ0YW1wTG9naWNhbExpbmtDb21wbGV0ZUV2ZW50LnByZXNlbnQgPSAxOworCisgICAgLyogIFJldHVybiB0aGUgbG9naWNhbCBsaW5rIGluZGV4IGhlcmUgKi8KKyAgICBwQmFwSENJRXZlbnQtPnUuYnRhbXBMb2dpY2FsTGlua0NvbXBsZXRlRXZlbnQubG9nX2xpbmtfaGFuZGxlIAorICAgICAgICA9IGxvZ19saW5rX2luZGV4OworICAgIHBCYXBIQ0lFdmVudC0+dS5idGFtcExvZ2ljYWxMaW5rQ29tcGxldGVFdmVudC5waHlfbGlua19oYW5kbGUgCisgICAgICAgID0gcE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V2ZW50LnUuYnRhbXBDb21tYW5kU3RhdHVzRXZlbnQuc3RhdHVzID0gV0xBTkJBUF9FUlJPUl9OT19DTkNUOworICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5idGFtcF9sb2dpY2FsX2xpbmtfc3RhdGUgPSBXTEFOX0JBUExvZ0xpbmtDbG9zZWQ7CisgICAgICAgICAgICBidGFtcENvbnRleHQtPmJ0YW1wX2xvZ2ljYWxfbGlua19jYW5jZWxfcGVuZGluZyA9IEZBTFNFOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLyogSWYgYnRhbXBfYXN5bmNfbG9naWNhbF9saW5rX2NyZWF0ZSBpcyBzZXQsIHdlIHdpbGwgc2VyYWxpemUgdGhlIHJlcQorICAgICAgICAgICAgICAgb24gTUMgdGhyZWFkICYgaGFuZGxlIGl0IHRoZXJlIGFmdGVyOyBJZiB0aGUgYWJvdmUgZmxhZyBpcyBub3Qgc2V0CisgICAgICAgICAgICAgICByZXNwb25kIHRvIEhDSSB0aGUgc3luYyB3YXkgYXMgYmVmb3JlICovCisgICAgICAgICAgICBpZihGQUxTRSA9PSBidGFtcENvbnRleHQtPmJ0YW1wX2FzeW5jX2xvZ2ljYWxfbGlua19jcmVhdGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogQWxsb2NhdGUgYSBsb2dpY2FsIGxpbmsgaW5kZXggZm9yIHRoZXNlIGZsb3cgc3BlY3MgKi8KKyAgICAgICAgICAgICAgICB2b3NTdGF0dXMgPSBXTEFOQkFQX0NyZWF0ZU5ld0xvZ0xpbmtDdHgoIAorICAgICAgICAgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LCAvKiBwZXIgYXNzb2MgYnRhbXBDb250ZXh0IHZhbHVlICovIAorICAgICAgICAgICAgICAgICAgICAgICAgcEJhcEhDSUxvZ0xpbmtBY2NlcHQtPnBoeV9saW5rX2hhbmRsZSwgLyogIEkgZ2V0IHBoeV9saW5rX2hhbmRsZSBmcm9tIHRoZSBDb21tYW5kICovCisgICAgICAgICAgICAgICAgICAgICAgICBwQmFwSENJTG9nTGlua0FjY2VwdC0+dHhfZmxvd19zcGVjLCAvKiAgSSBnZXQgdHhfZmxvd19zcGVjIGZyb20gdGhlIENvbW1hbmQgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIHBCYXBIQ0lMb2dMaW5rQWNjZXB0LT5yeF9mbG93X3NwZWMsIC8qICBJIGdldCByeF9mbG93X3NwZWMgZnJvbSB0aGUgQ29tbWFuZCAqLworICAgICAgICAgICAgICAgICAgICAgICAgJmxvZ19saW5rX2luZGV4IC8qICBSZXR1cm4gdGhlIGxvZ2ljYWwgbGluayBpbmRleCBoZXJlICovCisgICAgICAgICAgICAgICAgICAgICAgICApOworICAgICAgICAgICAgICAgIGlmIChWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gdm9zU3RhdHVzKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogSW52YWxpZCBmbG93IHNwZWMgZm9ybWF0ICovCisgICAgICAgICAgICAgICAgICAgIHBCYXBIQ0lFdmVudC0+dS5idGFtcExvZ2ljYWxMaW5rQ29tcGxldGVFdmVudC5zdGF0dXMgPQorICAgICAgICAgICAgICAgICAgICAgICAgV0xBTkJBUF9FUlJPUl9JTlZBTElEX0hDSV9DTU5EX1BBUkFNOworICAgICAgICAgICAgICAgICAgICBiYXBIQ0lFdmVudC51LmJ0YW1wQ29tbWFuZFN0YXR1c0V2ZW50LnN0YXR1cyA9IFdMQU5CQVBfRVJST1JfSU5WQUxJRF9IQ0lfQ01ORF9QQVJBTTsKKyAgICAgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5idGFtcF9sb2dpY2FsX2xpbmtfc3RhdGUgPSBXTEFOX0JBUExvZ0xpbmtDbG9zZWQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHJldHZhbCA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgICAgICAgICAgYmFwSENJRXZlbnQudS5idGFtcENvbW1hbmRTdGF0dXNFdmVudC5zdGF0dXMgPSBXTEFOQkFQX1NUQVRVU19TVUNDRVNTOworCisgICAgICAgICAgICAgICAgICAgIHBCYXBIQ0lFdmVudC0+dS5idGFtcExvZ2ljYWxMaW5rQ29tcGxldGVFdmVudC5zdGF0dXMgPSBXTEFOQkFQX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgICAgICAgICBidGFtcENvbnRleHQtPmJ0YW1wX2xvZ2ljYWxfbGlua19zdGF0ZSA9IFdMQU5fQkFQTG9nTGlua09wZW47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGJ0YW1wQ29udGV4dC0+YnRhbXBfbG9naWNhbF9saW5rX3JlcV9pbmZvLnBoeUxpbmtIYW5kbGUgPSAKKyAgICAgICAgICAgICAgICAgICAgcEJhcEhDSUxvZ0xpbmtBY2NlcHQtPnBoeV9saW5rX2hhbmRsZTsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoYnRhbXBDb250ZXh0LT5idGFtcF9sb2dpY2FsX2xpbmtfcmVxX2luZm8udHhGbG93U3BlYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJhcEhDSUxvZ0xpbmtBY2NlcHQtPnR4X2Zsb3dfc3BlYywgMTgpOworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShidGFtcENvbnRleHQtPmJ0YW1wX2xvZ2ljYWxfbGlua19yZXFfaW5mby5yeEZsb3dTcGVjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQmFwSENJTG9nTGlua0FjY2VwdC0+cnhfZmxvd19zcGVjLCAxOCk7CisgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5idGFtcF9hc3luY19sb2dpY2FsX2xpbmtfY3JlYXRlID0gRkFMU0U7CisgICAgICAgICAgICAgICAgdm9zU3RhdHVzID0gYnRhbXBFc3RhYmxpc2hMb2dMaW5rKGJ0YW1wQ29udGV4dCk7CisgICAgICAgICAgICAgICAgaWYoVk9TX1NUQVRVU19TVUNDRVNTID09IHZvc1N0YXR1cykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHJldHZhbCA9IFZPU19TVEFUVVNfRV9CVVNZOy8vdGhpcyB3aWxsIG1ha2Ugc3VyZSBldmVudCBjb21wbGV0ZSBpcyBub3Qgc2VudCB0byBIQ0kKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEJhcEhDSUV2ZW50LT51LmJ0YW1wTG9naWNhbExpbmtDb21wbGV0ZUV2ZW50LnN0YXR1cyA9CisgICAgICAgICAgICAgICAgICAgICAgICBXTEFOQkFQX0VSUk9SX0lOVkFMSURfSENJX0NNTkRfUEFSQU07CisgICAgICAgICAgICAgICAgICAgIGJhcEhDSUV2ZW50LnUuYnRhbXBDb21tYW5kU3RhdHVzRXZlbnQuc3RhdHVzID0gV0xBTkJBUF9FUlJPUl9JTlZBTElEX0hDSV9DTU5EX1BBUkFNOworICAgICAgICAgICAgICAgICAgICBidGFtcENvbnRleHQtPmJ0YW1wX2xvZ2ljYWxfbGlua19zdGF0ZSA9IFdMQU5fQkFQTG9nTGlua0Nsb3NlZDsKKyAgICAgICAgICAgICAgICB9CisgICAgCisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgdm9zU3RhdHVzID0gKCpidGFtcENvbnRleHQtPnBCYXBIQ0lFdmVudENCKSAKKyAgICAgICAgICAgICggIAorICAgICAgICAgICAgIGJ0YW1wQ29udGV4dC0+cEhkZEhkbCwgICAvKiB0aGlzIHJlZmVycyB0byB0aGUgQlNMIHBlciBjb25uZW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W5rQ29udGV4dC0+bG9nX2xpbmtfaGFuZGxlKTsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIgTG9naWNhbCBMaW5rIGluZGV4ID0gJWQiLCBsb2dfbGlua19pbmRleCk7CisjZW5kaWYgLy9CQVBfREVCVUcKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgLyogRm9ybSBhbmQgcmV0dXJuIHRoZSBjb21tYW5kIHN0YXR1cyBldmVudC4uLiAqLyAKKyAgICAgICAgYmFwSENJRXZlbnQudS5idGFtcENvbW1hbmRTdGF0dXNFdmVudC5zdGF0dXMgPSBXTEFOQkFQX1NUQVRVU19TVUNDRVNTOworICAgICAgICBwQmFwSENJRXZlbnQtPnUuYnRhbXBEaXNjb25uZWN0TG9naWNhbExpbmtDb21wbGV0ZUV2ZW50LnN0YXR1cyAKKyAgICAgICAgICAgID0gV0xBTkJBUF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAKKworICAgICAgICBwTG9nTGlua0NvbnRleHQtPnByZXNlbnQgICAgICAgICA9IFZPU19GQUxTRTsgCisgICAgICAgIHBMb2dMaW5rQ29udGV4dC0+dVR4UGt0Q29tcGxldGVkID0gMDsKKyAgICAgICAgcExvZ0xpbmtDb250ZXh0LT5sb2dfbGlua19oYW5kbGUgPSAwOworICAgICAgICAvKiBEZWNyZW1lbnQgdGhlIHRvdGFsIGxvZ2ljYWwgbGluayBjb3VudCAqLworICAgICAgICBidGFtcENvbnRleHQtPnRvdGFsX2xvZ19saW5rX2luZGV4LS07CisgICAgICAgIGJ0YW1wQ29udGV4dC0+YnRhbXBfbG9naWNhbF9saW5rX3N0YXRlID0gV0xBTl9CQVBMb2dMaW5rQ2xvc2VkOworICAgIH0KKyAgICAKKyAgICAvKiBOb3RpZnkgdGhlIENvbW1hbmQgc3RhdHVzIEV2ZW50ICovCisgICAgKCpidGFtcENvbnRleHQtPnBCYXBIQ0lFdmVudENCKSAKKyAgICAgICAgKCAgCisgICAgICAgICAgICBidGFtcENvbnRleHQtPnBIZGRIZGwsICAgLyogdGhpcyByZWZlcnMgdG8gdGhlIEJTTCBwZXIgY29ubmVjdGlvbiBjb250ZXh0ICovCisgICAgICAgICAgICAmYmFwSENJRXZlbnQsIC8qIFRoaXMgbm93IGVuY29kZXMgQUxMIGV2ZW50IHR5cGVzICovCisgICAgICAgICAgICBWT1NfVFJVRSAvKiBGbGFnIHRvIGluZGljYXRlIGFzc29jLXNwZWNpZmljIGV2ZW50ICovIAorICAgICAgICApOworCisgICAgLyogRm9ybWF0IHRoZSBMb2dpY2FsIExpbmsgQ29tcGxldGUgZXZlbnQgdG8gcmV0dXJuLi4uICovIAorICAgIHBCYXBIQ0lFdmVudC0+YmFwSENJRXZlbnRDb2RlID0gQlRBTVBfVExWX0hDSV9ESVNDT05ORUNUX0xPR0lDQUxfTElOS19DT01QTEVURV9FVkVOVDsKKyAgICBwQmFwSENJRXZlbnQtPnUuYnRhbXBEaXNjb25uZWN0TG9naWNhbExpbmtDb21wbGV0ZUV2ZW50LnByZXNlbnQgPSAxOworICAgIC8qICBSZXR1cm4gdGhlIGxvZ2ljYWwgbGluayBpbmRleCBoZXJlICovCisgICAgcEJhcEhDSUV2ZW50LT51LmJ0YW1wRGlzY29ubmVjdExvZ2ljYWxMaW5rQ29tcGxldGVFdmVudC5sb2dfbGlua19oYW5kbGUgCisgICAgICAgID0gcEJhcEhDSUxvZ0xpbmtEaXNjb25uZWN0LT5sb2dfbGlua19oYW5kbGU7CisgICAgcEJhcEhDSUV2ZW50LT51LmJ0YW1wRGlzY29ubmVjdExvZ2ljYWxMaW5rQ29tcGxldGVFdmVudC5yZWFzb24gCisgICAgICAgID0gV0xBTkJBUF9FUlJPUl9URVJNX0JZX0xPQ0FMX0hPU1Q7CisKKyAgICByZXR1cm4gcmV0dmFsOworfSAvKiBXTEFOX0JBUExvZ2ljYWxMaW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HkuCisKKyAgREVQRU5ERU5DSUVTOiAKKworICBBcmUgbGlzdGVkIGZvciBlYWNoIEFQSSBiZWxvdy4gCisgIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICBFRElUIEhJU1RPUlkgRk9SIEZJTEUKKworCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLgorICBOb3RpY2UgdGhhdCBjaGFuZ2VzIGFyZSBsaXN0ZWQgaW4gcmV2ZXJzZSBjaHJvbm9sb2dpY2FsIG9yZGVyLgorCisKKworICB3aGVuICAgICAgICB3aG8gICAgIHdoYXQsIHdoZXJlLCB3aHkKKy0tLS0tLS0tLS0gICAgLS0tICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisyMDA4LTAzLTI1ICAgIGFydWx2ICAgICBDcmVhdGVkIG1vZHVsZQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAqIEluY2x1ZGUgRmlsZXMKKyAqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworLy8jaW5jbHVkZSAid2xhbl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CBWT1NfTUFDX0FERFJfU0laRSk7CisKKyAgIGhlYWRlckxlbmd0aCA9IFdMQU5CQVBfTExDX0hFQURFUl9MRU47CisgICAgICAgIC8qIE5vdyB0aGUgODAyLjMgbGVuZ3RoIGZpZWxkIGlzIGJpZy1lbmRpYW4/ISAqLworICAgdzgwMjNIZWFkZXIudXNMZW5UeXBlID0gdm9zX2NwdV90b19iZTE2KGhlYWRlckxlbmd0aCk7IAorICAgICAgICAKKyAgIC8qIE5vdyBhZGp1c3QgdGhlIHByb3RvY29sIHR5cGUgYnl0ZXMqLworICAgcHJvdG9UeXBlID0gdm9zX2NwdV90b19iZTE2KCBwcm90b1R5cGUpOworICAgICAgICAgLyogTm93IGZvcm0gdGhlIExMQyBoZWFkZXIgKi8KKyAgIHZvc19tZW1fY29weShhdWNMTENIZWFkZXIsIAorICAgICAgICAgICAgV0xBTkJBUF9MTENfSEVBREVSLCAgCisgICAgICAgICAgICBzaXplb2YoV0xBTkJBUF9MTENfSEVBREVSKSk7CisgICB2b3NfbWVtX2NvcHkoJmF1Y0xMQ0hlYWRlcltXTEFOQkFQX0xMQ19PVUlfT0ZGU0VUXSwgCisgICAgICAgICAgICBXTEFOQkFQX0JUX0FNUF9PVUksICAKKyAgICAgICAgICAgIFdMQU5CQVBfTExDX09VSV9TSVpFKTsKKyAgIHZvc19tZW1fY29weSgmYXVjTExDSGVhZGVyW1dMQU5CQVBfTExDX1BST1RPX1RZUEVfT0ZGU0VUXSwgCisgICAgICAgICAgICAmcHJvdG9UeXBlLCAgLy9XTEFOQkFQX0JUX0FNUF9UWVBFX0xTX1JFUQorICAgICAgICAgICAgV0xBTkJBUF9MTENfUFJPVE9fVFlQRV9TSVpFKTsKKyAKKyAgICAgICAgLyogUHVzaCBvbiB0aGUgTExDIGhlYWRlciAqLworICAgdm9zX3BrdF9wdXNoX2hlYWQocFBhY2tldCwgCisgICAgICAgICAgICBhdWNMTENIZWFkZXIsIAorICAgICAgICAgICAgV0xBTkJBUF9MTENfSEVBREVSX0xFTik7ICAKKworICAgICAgICAvKiBQdXNoIG9uIHRoZSA4MDIuMyBoZWFkZXIgKi8KKyAgIHZvc19wa3RfcHVzaF9oZWFkKHBQYWNrZXQsICZ3ODAyM0hlYWRlciwgc2l6ZW9mKHc4MDIzSGVhZGVyKSk7CisgICAqcHBQYWNrZXQgPSBwUGFja2V0OworICAgcmV0dXJuIHZvc1N0YXR1czsKK30KKworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTkJBUF9Jbml0TGlua1N1cGVydmlzaW9uCisKKyAgREVTQ1JJUFRJT04gCisKKyAgICBUaGlzIEFQSSB3aWxsIGJlIGNhbGxlZCB3aGVuIExpbmsgU3VwZXJ2aXNpb24gbW9kdWxlIGlzIHRvIGJlIGluaXRpYWxpemVkIHdoZW4gY29ubmVjdGVkIGF0IEJBUAorCisgIFBBUkFNRVRFUlMgCisKKyAgICBidGFtcEhhbmRsZTogVGhlIEJULUFNUCBQQUwgaGFuZGxlIHJldHVybmVkIGluIFdMQU5CQVBfR2V0TmV3SG5kbC4KKyAgIAorICBSRVRVUk4gVkFMVUUKKworICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfRV9JTlZBTDogIElucHV0IHBhcmFtZXRlcnMgYXJlIGludmFsaWQgCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgQkFQIGhhbmRsZSBpcyBOVUxMICAKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikgCisKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworI2RlZmluZSBUWF9MU19EQVRBTEVOICAgMzIKKworVk9TX1NUQVRVUworV0xBTkJBUF9Jbml0TGlua1N1cGVydmlzaW9uCisoIAorICBwdEJ0YW1wSGFuZGxlICAgICBidGFtcEhhbmRsZQorKQoreworICAgIFZPU19TVEFUVVMgICAgICAgICAgICAgICB2b3NTdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICAgcHRCdGFtcENvbnRleHQgICAgICAgICAgIHBCdGFtcEN0eCA9IChwdEJ0YW1wQ29udGV4dCkgYnRhbXBIYW5kbGU7CisgICAgdm9zX3BrdF90ICAgICAgICAgICAgICAgICpwTFNSZXFQYWNrZXQ7IAorICAgIHZvc19wa3RfdCAgICAgICAgICAgICAgICAqcExTUmVwUGFja2V0OyAKKyAgICB2X1UxNl90ICAgICAgICAgICAgICAgICAgIGxzUGt0bG47IAorCisgICAgaWYgKCBOVUxMID09IHBCdGFtcEN0eCkgCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAiSW52YWxpZCBCQVAgaGFuZGxlIHZhbHVlIGluICVzIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgIH0KKworI2lmIDAgICAgCisgICAgLyogSW5pdGlhbGl6ZSBMaW5rIHN1cGVydmlzaW9uIGRhdGEgc3RydWN0dXJlICovCisgICAgdm9zX21lbV9zZXQocExzSW5mbywgc2l6ZW9mKHRCdGFtcExTKSwwKTsKKworICAgIC8qIEFsbG9jYXRlIG1lbW9yeSBmb3IgU3RhdGljIFR4IERhdGEgKi8KKyAgICBwTHNJbmZvLT5wVHhQa3REYXRhID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRCdGFtcExzUGt0RGF0YSkrVFhfTFNfREFUQUxFTik7CisKKyAgICAvKiBJbml0aWFsaXplIF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1JlcFBhY2tldDsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6QWNxdWlyZUxTUGFja2V0IGZhaWxlZFxuIixfX2Z1bmNfXyk7CisgICAgICAgICBwQnRhbXBDdHgtPmxzUmVwUGFja2V0ID0gTlVMTDsKKyAgICAgICAgIHJldHVybiB2b3NTdGF0dXM7ICAgCisgICAgfSAgICAgICAgCisKKyAgICB2b3NTdGF0dXMgPSB2b3NfcGt0X2dldF9wYWNrZXRfbGVuZ3RoKHBCdGFtcEN0eC0+bHNSZXBQYWNrZXQsJmxzUGt0bG4pOyAKKworICAgIGlmICggVk9TX1NUQVRVU19TVUNDRVNTICE9IHZvc1N0YXR1cyApIAorICAgIHsKKyAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6dm9zX3BrdF9nZXRfbGVuZ3RoIGVycm9yIixfX2Z1bmNfXyk7CisgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgIH0KKyAgICBwQnRhbXBDdHgtPmxzUGt0bG4gPSBsc1BrdGxuOworCisgICAgLyogU3RhcnQgTGluayBTdXBlcnZpc2lvbiBUaW1lciBpZiBub3QgY29uZmlndXJlZCBmb3IgaW5maW5pdGUgKi8KKyAgICBpZiAocEJ0YW1wQ3R4LT5iYXBMaW5rU3VwZXJ2aXNpb25UaW1lckludGVydmFsKQorICAgIHsKKyAgICAgICAgdm9zU3RhdHVzID0gV0xBTkJBUF9TdGFydExpbmtTdXBlcnZpc2lvblRpbWVyIChwQnRhbXBDdHgsCisgICAgICAgICAgICAgICAgICAgcEJ0YW1wQ3R4LT5iYXBMaW5rU3VwZXJ2aXNpb25UaW1lckludGVydmFsICogV0xBTkJBUF9CUkVEUl9CQVNFQkFORF9TTE9UX1RJTUUpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICIlczpObyBMUyBjb25maWd1cmVkIGZvciBpbmZpbml0ZSIsX19mdW5jX18pOworICAgIH0KKyAgIAorICAgIHJldHVybiB2b3NTdGF0dXM7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTkJBUF9EZUluaXRMaW5rU3VwZXJ2aXNpb24KKworICBERVNDUklQVElPTiAKKworICAgIFRoaXMgQVBJIHdpbGwgYmUgY2FsbGVkIHdoZW4gTGluayBTdXBlcnZpc2lvbiBtb2R1bGUgaXMgdG8gYmUgc3RvcHBlZCBhZnRlciBkaXNjb25uZWN0ZWQgYXQgQkFQIAorCisgIFBBUkFNRVRFUlMgCisKKyAgICBidGFtcEhhbmRsZTogVGhlIEJULUFNUCBQQUwgaGFuZGxlIHJldHVybmVkIGluIFdMQU5CQVBfR2V0TmV3SG5kbC4KKyAgIAorICBSRVRVUk4gVkFMVUUKKworICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfRV9JTlZBTDogIElucHV0IHBhcmFtZXRlcnMgYXJlIGludmFsaWQgCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgQkFQIGhhbmRsZSBpcyBOVUxMICAKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikgCisKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT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HVzID0gV0xBTkJBUF9BY3F1aXJlTFNQYWNrZXQoIGJhcENvbnRleHQsICZwTFNQYWNrZXQsMzIsIFRSVUUgKTsKKyAgICBpZiggVk9TX0lTX1NUQVRVU19TVUNDRVNTKCB2b3NTdGF0dXMgKSApCisgICAgeworICAgICAgICAgICAgYmFwQ29udGV4dC0+bHNSZXFQYWNrZXQgPSBwTFNQYWNrZXQ7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOkFjcXVpcmVMU1BhY2tldCBmYWlsZWRcbiIsX19mdW5jX18pOworICAgICAgICAgYmFwQ29udGV4dC0+bHNSZXFQYWNrZXQgPSBOVUxMOworICAgICAgICAgcmV0dXJuIHZvc1N0YXR1czsgICAKKyAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHZvc1N0YXR1cyA9IFdMQU5CQVBfQWNxdWlyZUxTUGFja2V0KCBiYXBDb250ZXh0LCAmcExTUGFja2V0LDMyLCBGQUxTRSApOworICAgICAgICBpZiggVk9TX0lTX1NUQVRVU19TVUNDRVNTKCB2b3NTdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGJhcENvbnRleHQtPmxzUmVwUGFja2V0ID0gcExTUGFja2V0OworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOkFjcXVpcmVMU1BhY2tldCBmYWlsZWRcbiIsX19mdW5jX18pOworICAgICAgICAgICAgIGJhcENvbnRleHQtPmxzUmVwUGFja2V0ID0gTlVMTDsKKyAgICAgICAgICAgICByZXR1cm4gdm9zU3RhdHVzOy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yYW1ldGVycyBhcmUgaW52YWxpZCAKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6ICBCQVAgaGFuZGxlIGlzIE5VTEwgIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KSAKKworICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOQkFQX1R4TGlua1N1cGVydmlzaW9uCisoIAorICBwdEJ0YW1wSGFuZGxlICAgICBidGFtcEhhbmRsZSwgCisgIHZfVThfdCAgICAgICAgICAgIHBoeV9saW5rX2hhbmRsZSwgIC8qIFVzZWQgYnkgQkFQIHRvIGluZGVudGlmeSB0aGUgV0xBTiBhc3NvYy4gKFN0YUlkKSAqLworICB2b3NfcGt0X3QgICAgICAgICAqcFBhY2tldCwKKyAgdl9VMTZfdCAgICAgICAgICAgcHJvdG9UeXBlCispCit7CisgICAgcHRCdGFtcENvbnRleHQgICAgICAgICAgICAgcEJ0YW1wQ3R4ID0gKHB0QnRhbXBDb250ZXh0KWJ0YW1wSGFuZGxlOworICAgIFZPU19TVEFUVVMgICAgICAgICAgICAgICAgIHZvc1N0YXR1cyA9IFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgIHZfUFZPSURfdCAgICAgICAgICAgICAgICAgIHB2b3NHQ3R4OworICAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgIHVjU1RBSWQ7ICAvKiBUaGUgU3RhSWQgKHVzZWQgYnkgVEwsIFBFLCBhbmQgSEFMKSAqLworICAgIHZfUFZPSURfdCAgICAgICAgICAgICAgICAgIHBIZGRIZGw7IC8qIEhhbmRsZSB0byByZXR1cm4gQlNMIGNvbnRleHQgaW4gKi8KKyAgICBXTEFOVExfTWV0YUluZm9UeXBlICAgICAgICBtZXRhSW5mbzsKKworCisgICAgVk9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FRPUlRJT1VTIEFDVElPTiwgQVJJU0lORyBPVVQgT0YgT1IgSU4gQ09OTkVDVElPTiBXSVRIIFRIRSBVU0UgT1IKKyAqIFBFUkZPUk1BTkNFIE9GIFRISVMgU09GVFdBUkUuCisgKi8KKworLyoKKyAqIFRoaXMgZmlsZSB3YXMgb3JpZ2luYWxseSBkaXN0cmlidXRlZCBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICBiIGEgcCBBIHAgaSBTIHQgYSB0IHUgcyAuIEMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgIE9WRVJWSUVXOgorICAKKyAgVGhpcyBzb2Z0d2FyZSB1bml0IGhvbGRzIHRoZSBpbXBsZW1lbnRhdGlvbiBvZiB0aGUgV0xBTiBCQVAgbW9kdWxlcworICBTdGF0dXMgZnVuY3Rpb25zLgorICAKKyAgVGhlIGZ1bmN0aW9ucyBleHRlcm5hbGl6ZWQgYnkgdGhpcyBtb2R1bGUgYXJlIHRvIGJlIGNhbGxlZCBPTkxZIGJ5IG90aGVyIAorICBXTEFOIG1vZHVsZXMgKEhERCkgdGhhdCBwcm9wZXJseSByZWdpc3RlciB3aXRoIHRoZSBCQVAgTGF5ZXIgaW5pdGlhbGx5LgorCisgIERFUEVOREVOQ0lFUzogCisKKyAgQXJlIGxpc3RlZCBmb3IgZWFjaCBBUEkgYmVsb3cuIAorICAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisgICAkSGVhZGVyOiAvY3lnZHJpdmUvZC9CdWlsZHMvTTcyMDFKU0RDQUFQQUQ1MjI0MEIvV00vcGxhdGZvcm0vbXNtNzIwMC9TcmMvRHJpdmVycy9TRC9DbGllbnREcml2ZXJzL1dMQU4vUUNUX0JUQU1QX1JTTi9DT1JFL0JBUC9zcmMvYmFwQXBpU3RhdHVzLmMsdiAxLjcgMjAwOS8wMy8wOSAwODo0NTowNCBqem11ZGEgRXhwIGp6bXVkYSAkJERhdGVUaW1lJCRBdXRob3I6IGp6bXVkYSAkCisKKworICB3aGVuICAgICAgICB3aG8gICAgIHdoYXQsIHdoZXJlLCB3aHkKKy0tLS0tLS0tLS0gICAgLS0tICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisyMDA4LTA5LTE1ICAgIGpleiAgICAgQ3JlYXRlZCBtb2R1bGUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKiBJbmNsd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leHQtPnB2b3NHQ3R4LCBidGFtcENvbnRleHQtPnVjU1RBSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAmcEJhcEhDSUV2ZW50LT51LmJ0YW1wQ29tbWFuZENvbXBsZXRlRXZlbnQuY2NfZXZlbnQuUmVhZF9SU1NJLnJzc2kpOworCisgICAgICAgIGlmIChWT1NfU1RBVFVTX1NVQ0NFU1MgPT0gdm9zU3RhdHVzKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBHZXRSc3NpIHN1Y2Nlc3MsIGluZGljYXRlIHRoZSB0byB1cHBlciBsYXllciAqLworICAgICAgICAgICAgcEJhcEhDSUV2ZW50LT51LmJ0YW1wQ29tbWFuZENvbXBsZXRlRXZlbnQuY2NfZXZlbnQuUmVhZF9SU1NJLnN0YXR1cworICAgICAgICAgICAgICAgID0gV0xBTkJBUF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIEFQSSBmYWlsZWQsIGluZGljYXRlIHVuc3BlY2lmaWVkIGVycm9yIHRvIHVwcGVyIGxheWVyICovCisgICAgICAgICAgICBwQmFwSENJRXZlbnQtPnUuYnRhbXBDb21tYW5kQ29tcGxldGVFdmVudC5jY19ldmVudC5SZWFkX1JTU0kuc3RhdHVzCisgICAgICAgICAgICAgICAgPSBXTEFOQkFQX0VSUk9SX1VOU1BFQ0lGSUVEX0VSUk9SOworICAgICAgICB9CisgICAgfQorCisgICAgLyogRmlsbCBpbiB0aGUgcGFyYW1ldGVycyBmb3IgY29tbWFuZCBjb21wbGV0ZSBldmVudC4uLiAqLyAKKyAgICBwQmFwSENJRXZlbnQtPmJhcEhDSUV2ZW50Q29kZSA9IEJUQU1QX1RMVl9IQ0lfQ09NTUFORF9DT01QTEVURV9FVkVOVDsKKyAgICBwQmFwSENJRXZlbnQtPnUuYnRhbXBDb21tYW5kQ29tcGxldGVFdmVudC5wcmVzZW50ID0gVFJVRTsKKyA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Mi4xMSBQQUwgQ2FwYWJpbGl0aWVzCisKKyAgICAgNCAgICAgICAgICAgICAgIExlbmd0aAorCisgICAweFhYWFhYWFhYICAgICAgICBCaXQgMDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAwIHNpZ25pZmllcyB0aGUgUEFMIGlzIG5vdCBjYXBhYmxlIG9mIHV0aWxpemluZworICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjZWl2ZWQgQWN0aXZpdHkgUmVwb3J0cworICAgICAgICAgICAgICAgICAgICAgICAgIDEgc2lnbmlmaWVzIHRoZSBQQUwgaXMgY2FwYWJsZSBvZiB1dGlsaXppbmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlY2VpdmVkIEFjdGl2aXR5IFJlcG9ydHMKKyAgICAgICAgICAgICAgICAgICAgIEJpdCAxOgorICAgICAgICAgICAgICAgICAgICAgICAgIDAgc2lnbmlmaWVzIHRoZSBQQUwgaXMgbm90IGNhcGFibGUgb2YgdXRpbGl6aW5nCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2hlZHVsaW5nIGluZm9ybWF0aW9uIHNlbnQgaW4gYW4gQWN0aXZpdHkgUmVwb3J0CisgICAgICAgICAgICAgICAgICAgICAgICAgMSBzaWduaWZpZXMgdGhlIFBBTCBpcyBjYXBhYmxlIG9mIHV0aWxpemluZworICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NoZWR1bGluZyBpbmZvcm1hdGlvbiBzZW50IGluIGFuIEFjdGl2aXR5IFJlcG9ydAorICAgICAgICAgICAgICAgICAgICAgQml0cyAyLi4zMSBSZXNlcnZlZAorCisjZW5kaWYgLy8wCisKKyAgICBidGFtcF9BU1NPQy5BTVBfQXNzb2NfUEFMX0NhcGFiaWxpdGllcy5wYWxfY2FwYWJpbGl0aWVzIAorLy8gICAgICAgID0gYnRhbXBDb250ZXh0LT5idGFtcF9SZW1vdGVfQU1QX0Fzc29jLkhDX3BhbF9jYXBhYmlsaXRpZXM7IAorICAgICAgICAv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SU4gQ09OTkVDVElPTiBXSVRIIFRIRSBVU0UgT1IKKyAqIFBFUkZPUk1BTkNFIE9GIFRISVMgU09GVFdBUkUuCisgKi8KKworLyoKKyAqIFRoaXMgZmlsZSB3YXMgb3JpZ2luYWxseSBkaXN0cmlidXRlZCBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICBiIGEgcCBBIHAgaSBUIGkgbSBlIHIgLiBDCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICBPVkVSVklFVzoKKyAgCisgIFRoaXMgc29mdHdhcmUgdW5pdCBob2xkcyB0aGUgaW1wbGVtZW50YXRpb24gb2YgdGhlIHRpbWVyIHJvdXRpbmVzCisgIHJlcXVpcmVkIGJ5IHRoZSBXTEFOIEJBUCBtb2R1bGUuICAKKyAgCisgIFRoZSBmdW5jdGlvbnMgcHJvdmlkZSBieSB0aGlzIG1vZHVsZSBhcmUgY2FsbGVkIGJ5IHRoZSByZXN0IG9mIAorICB0aGUgQlQtQU1QIFBBTCBtb2R1bGUuCisKKyAgREVQRU5ERU5DSUVTOiAKKworICBBcmUgbGlzdGVkIGZvciBlYWNoIEFQSSBiZWxvdy4gCisgIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyA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pdCggCisgICAgICAgICAgJnBCdGFtcEN0eC0+YmFwQ29ubmVjdGlvbkFjY2VwdFRpbWVyLAorICAgICAgICAgIFZPU19USU1FUl9UWVBFX1NXLCAvKiB1c2UgdGhpcyB0eXBlICovCisgICAgICAgICAgV0xBTkJBUF9Db25uZWN0aW9uQWNjZXB0VGltZXJIYW5kbGVyLAorICAgICAgICAgIHBCdGFtcEN0eCk7CisgICAKKyAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30vKiBXTEFOQkFQX0luaXRDb25uZWN0aW9uQWNjZXB0VGltZXIgKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5CQVBfRGVpbml0Q29ubmVjdGlvbkFjY2VwdFRpbWVyCisKKyAgREVTQ1JJUFRJT04gCisgICAgRGVzdHJveSB0aGUgQ29ubmVjdGlvbiBBY2NlcHQgVGltZXIuCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcEJ0YW1wQ3R4OiAgIHBvaW50ZXIgdG8gdGhlIEJBUCBjb250cm9sIGJsb2NrCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgYWNjZXNzIHdvdWxkIGNhdXNlIGEgcGFnZSBmYXVsdCAgCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgRXZlcnl0aGluZyBpcyBnb29kIDopIAorCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TV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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5CQVBfU3RhcnRDb25uZWN0aW9uQWNjZXB0VGltZXIKKworICBERVNDUklQVElPTiAKKyAgICBTdGFydCB0aGUgQ29ubmVjdGlvbiBBY2NlcHQgVGltZXIuCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcEJ0YW1wQ3R4OiAgIHBvaW50ZXIgdG8gdGhlIEJBUCBjb250cm9sIGJsb2NrCisgICAgaW50ZXJ2YWw6ICAgIHRpbWUgaW50ZXJ2YWwuCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgYWNjZXNzIHdvdWxkIGNhdXNlIGEgcGFnZSBmYXVsdCAgCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgRXZlcnl0aGluZyBpcyBnb29kIDopIAorCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgCitXTEFOQkFQX1N0YXJ0Q29ubmVjdGlvbkFjY2VwdFRpbWVyCisoIAorICBwdEJ0YW1wQ29udGV4dCAgcEJ0YW1wQ3R4LAorICB2X1UzMl90IGludGVydmFsCispCit7CisgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgU2FuaXR5IGNoZWNrIEJBUCBjb250cm9sIGJsb2NrIAorICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKworICBpZiAoIE5VTEwgPT0gcEJ0YW1wQ3R4ICkgCisgIHsKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICJJbnZhbGlkIEJBUCBwb2ludGVyIGluICVzIiwgX19mdW5jX18pOworICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgIH0KKworICAvKlN0YXJ0IHRoZSBjb25uZWN0aW9uIGFjY2VwdCB0aW1lciovCisgIHZvc190aW1lcl9zdGFydCggCisgICAgICAgICAgJnBCdGFtcEN0eC0+YmFwQ29ubmVjdGlvbkFjY2VwdFRpbWVyLAorICAgICAgICAgIGludGVydmFsKTsKKworICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfS8qIFdMQU5CQVBfU3RhcnRDb25uZWN0aW9uQWNjZXB0VGltZXIgKi8KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTkJBUF9TdG9wQ29ubmVjdGlvbkFjY2VwdFRpbWVyIAorCisgIERFU0NSSVBUSU9OIAorICAgIFN0b3AgdGhlIENvbm5lY3Rpb24gQWNjZXB0IFRpbWVyLgorICAgIAorICBERVBFTkRFTkNJRVMgCisgICAgCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgIHBCdGFtcEN0eDogICBwb2ludGVyIHRvIHRoZSBCQVAgY29udHJvbCBibG9jaworICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVE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8KKyAgdm9zU3RhdHVzID0gIHZvc190aW1lcl9zdG9wKCAKKyAgICAgICAgICAgJnBCdGFtcEN0eC0+YmFwQ29ubmVjdGlvbkFjY2VwdFRpbWVyKTsKKyAKKyAgIAorICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfS8qIFdMQU5CQVBfU3RvcENvbm5lY3Rpb25BY2NlcHRUaW1lciAqLyAKKworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOQkFQX0Nvbm5lY3Rpb25BY2NlcHRUaW1lckhhbmRsZXIKKworICBERVNDUklQVElPTiAKKyAgICBDYWxsYmFjayBmdW5jdGlvbiByZWdpc3RlcmVkIHdpdGggdm9zIHRpbWVyIGZvciB0aGUgQ29ubmVjdGlvbgorICAgIEFjY2VwdCB0aW1lciAKKyAgICAKKyAgREVQRU5ERU5DSUVTIAorICAgIAorICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICB1c2VyRGF0YTogICAgICBwb2ludGVyIGNhbiBiZSB1c2VkIHRvIHJldHJpdmUgdGhlIEJULUFNUCBjb250ZXh0IAorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIE5vbmUKKyAgICAgICAgIAorICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2X1ZPSURfdCAKK1dMQU5CQVBfQ29ubmVjdGlvbkFjY2VwdFRpbWVySGFuZGxlcgorKCAKKyAgdl9QVk9JRF90IHVzZXJEYXRhIAorKQoreworICBwdEJ0YW1wQ29udGV4dCAgcEJ0YW1wQ3R4ID0gKHB0QnRhbXBDb250ZXh0KXVzZXJEYXRhOworICB0V0xBTl9CQVBFdmVudCBiYXBFdmVudDsgLyogU3RhdGUgbWFjaGluZSBldmVudCA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WVyICovCisgIHZvc1N0YXR1cyA9IHZvc190aW1lcl9pbml0KCAKKyAgICAgICAgICAmcEJ0YW1wQ3R4LT5iYXBMaW5rU3VwZXJ2aXNpb25UaW1lciwKKyAgICAgICAgICBWT1NfVElNRVJfVFlQRV9TVywgLyogdXNlIHRoaXMgdHlwZSAqLworICAgICAgICAgIFdMQU5CQVBfTGlua1N1cGVydmlzaW9uVGltZXJIYW5kbGVyLAorICAgICAgICAgIHBCdGFtcEN0eCk7CisgICAKKyAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30vKiBXTEFOQkFQX0luaXRMaW5rU3VwZXJ2aXNpb25UaW1lciAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTkJBUF9EZWluaXRMaW5rU3VwZXJ2aXNpb25UaW1lcgorCisgIERFU0NSSVBUSU9OIAorICAgIERlc3Ryb3kgdGhlIExpbmsgU3VwZXJ2aXNpb24gVGltZXIuCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcEJ0YW1wQ3R4OiAgIHBvaW50ZXIgdG8gdGhlIEJBUCBjb250cm9sIGJsb2NrCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgYWNjZXNzIHdvdWxkIGNhdXNlIGEgcGFnZSBmYXVsdCAgCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgRXZlcnl0aGluZyBpcyBnb29kIDopIAorCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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UgdGltZXIgKi8KKyAgdm9zU3RhdHVzID0gIHZvc190aW1lcl9zdG9wKCAKKyAgICAgICAgICAgJnBCdGFtcEN0eC0+YmFwTGlua1N1cGVydmlzaW9uVGltZXIpOworIAorICAgCisgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9LyogV0xBTkJBUF9TdG9wTGlua1N1cGVydmlzaW9uVGltZXIgKi8gCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5CQVBfTGlua1N1cGVydmlzaW9uVGltZXJIYW5kbGVyCisKKyAgREVTQ1JJUFRJT04gCisgICAgQ2FsbGJhY2sgZnVuY3Rpb24gcmVnaXN0ZXJlZCB3aXRoIHZvcyB0aW1lciBmb3IgdGhlIExpbmtTdXBlcnZpc2lvbiB0aW1lciAKKyAgICAKKyAgREVQRU5ERU5DSUVTIAorICAgIAorICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICB1c2VyRGF0YTogICAgICBwb2ludGVyIGNhbiBiZSB1c2VkIHRvIHJldHJpdmUgdGhlIEJULUFNUCBjb250ZXh0IAorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIE5vbmUKKyAgICAgICAgIAorICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2X1ZPSURfdCAKK1dMQU5CQVBfTGlua1N1cGVydmlzaW9uVGltZXJIYW5kbGVyCisoIAorICB2X1BWT0lEX3QgdXNlckRhdGEgCispCit7CisgICAgcHRCdGFtcENvbnRleHQgICAgICAgICAgIHBCdGFtcEN0eCA9ICAgICAgKHB0QnRhbXBDb250ZXh0KXVzZXJEYXRhOworICAgIFZPU19TVEFUVVMgICAgICAgICAgICAgICB2b3NTdGF0dXMgPSAgICAgIF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AgICAgICAgICAgICAgICAgICAgIiVzOiBSZXNlbmQgdGhlIExTIHBhY2tldCIsIF9fZnVuY19fICk7CisKKyAgICAgICAgLyogSWYgd2UgaGF2ZSB0cmFuc21pdCBwa3QgcGVuZGluZyBhbmQgdGhlIHRpbWUgb3V0IG9jY3VycmVkLHJlc2VuZCB0aGUgbHMgcGFja2V0ICovCisgICAgICAgIFdMQU5CQVBfU3RvcExpbmtTdXBlcnZpc2lvblRpbWVyKHBCdGFtcEN0eCk7CisgICAgICAgIHBCdGFtcEN0eC0+cFBhY2tldCA9IHBCdGFtcEN0eC0+bHNSZXFQYWNrZXQ7CisgICAgICAgIHZvc1N0YXR1cyA9IFdMQU5CQVBfVHhMaW5rU3VwZXJ2aXNpb24oIGJ0YW1wSGFuZGxlLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGh5X2xpbmtfaGFuZGxlLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJ0YW1wQ3R4LT5wUGFja2V0ICwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX0JUX0FNUF9UWVBFX0xTX1JFUSk7CisgICAgfQorICAgIAorfS8qV0xBTkJBUF9MaW5rU3VwZXJ2aXNpb25UaW1lckhhbmRsZXIqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTkJBUF9TdGFydFR4UGFja2V0TW9uaXRvclRpbWVyCisKKyAgREVTQ1JJUFRJT04gCisgICAgU3RhcnQgdGhlIFR4IFBhY2tldCBNb25pdG9yIFRpbWVyLgorICAgIAorICBERVBFTkRFTkNJRVMgCisgICAgCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgIHBCdGFtcEN0eDogICBwb2ludGVyIHRvIHRoZS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cEJ0YW1wQ3R4ICkgCisgIHsKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICJJbnZhbGlkIEJBUCBwb2ludGVyIGluICVzIiwgX19mdW5jX18pOworICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgIH0KKworICAvKlN0YXJ0IHRoZSB0aW1lciAqLworICB2b3NTdGF0dXMgPSB2b3NfdGltZXJfc3RhcnQoICZwQnRhbXBDdHgtPmJhcFR4UGt0TW9uaXRvclRpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1SW50ZXJ2YWwpOworCisgIHJldHVybiB2b3NTdGF0dXM7Cit9LyogV0xBTkJBUF9TdGFydFR4UGFja2V0TW9uaXRvclRpbWVyICovCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5CQVBfU3RvcFR4UGFja2V0TW9uaXRvclRpbWVyIAorCisgIERFU0NSSVBUSU9OIAorICAgIFN0b3AgdGhlIFR4IFBhY2tldCBNb25pdG9yIFRpbWVyLgorICAgIAorICBERVBFTkRFTkNJRVMgCisgICAgCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgIHBCdGFtcEN0eDogICBwb2ludGVyIHRvIHRoZSBCQVAgY29udHJvbCBibG9jaworICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfRV9GQVVMVDogIGFjY2VzcyB3b3VsZCBjYXVzZSBhIHBhZ2UgZmF1bHQgIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZC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FOQkFQX1N0b3BUeFBhY2tldE1vbml0b3JUaW1lciAqLyAKKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTkJBUF9TZW5kQ29tcGxldGVkUGt0c0V2ZW50CisKKyAgREVTQ1JJUFRJT04gCisgICAgVXRpbGl0eSBmdW5jdGlvbiBmb3Igc2VuZGluZyB0aGUgTlVNX09GX0NPTVBMRVRFRF9QS1RTX0VWRU5UIHRvIEhDSSAKKyAgICAKKyAgREVQRU5ERU5DSUVTIAorICAgIAorICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICBwQnRhbXBDdHg6ICAgcG9pbnRlciB0byB0aGUgQkFQIGNvbnRyb2wgYmxvY2sgCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgTm9uZQorICAgICAgICAgCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZfVk9JRF90IAorV0xBTkJBUF9TZW5kQ29tcGxldGVkUGt0c0V2ZW50CisoIAorICBwdEJ0YW1wQ29udGV4dCAgICAgcEJ0YW1wQ3R4IAorKQoreworICB2X1U4X3QgICAgICAgICAgICAgaSwgajsKKyAgdEJ0YW1wSENJX0V2ZW50ICAgIGJhcEhDSUV2ZW50OyAvKiBUaGlzIG5vdyBlbmNvZGVzIEFMTCBldmVudCB0eXBlcyAqLworICB2X1UzMl90ICAgICAgICAgICAgdVR4Q29tcGxldGVkICAgID0gMDsgCisgIHRwQnRhbXBMb2dMaW5rQ3R4ICBwTG9nTGlua0NvbnRleHQgPSBOVUxMOworICAvKi0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gL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wbGV0ZWRQa3RzRXZlbnQubnVtX2NvbXBsZXRlZF9wa3RzW2pdID0KKyAgICAgICAgICAgdVR4Q29tcGxldGVkOworCisgICAgICAgaisrOworCisgICAgICAgdm9zX2F0b21pY19kZWNyZW1lbnRfVTMyX2J5X3ZhbHVlKCh2X1UzMl90ICopICZwTG9nTGlua0NvbnRleHQtPnVUeFBrdENvbXBsZXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZfVTMyX3QpIHVUeENvbXBsZXRlZCk7CisKKyAgICAgICBpZiAodVR4Q29tcGxldGVkKSB7IAorICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgICAid2xhbiBiYXA6ICVzIExvZyBMaW5rIGhhbmRsZSAtICVkIE5vIE9mIFBrdHMgLSAlZCIsIF9fZnVuY19fLCAKKyAgICAgICAgICAgICAgICAgIHBMb2dMaW5rQ29udGV4dC0+bG9nX2xpbmtfaGFuZGxlLCB1VHhDb21wbGV0ZWQpOyAgCisgICAgICAgfQorICAgICB9CisgIH0KKworICAvKiBJbmRpY2F0ZSBvbmx5IGlmIGF0IGxlYXN0IG9uZSBsb2dpY2FsIGxpbmsgaXMgcHJlc2VudCBhbmQgbnVtYmVyIG9mCisgICAgIGNvbXBsZXRlZCBwYWNrZXRzIGlzIG5vbiB6ZXJvICovCisgIGlmIChqICYmIHVUeENvbXBsZXRlZCkKKyAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICJXTEFOIEJBUDogSW5kaWNhdGluZyBOdW0gQ29tcGxldGVkIHBhY2tldHMgRXZlbnQiKTsKKworICAgICAgLyppc3N1ZSBudW1fcGt0X2V2ZW50IGZvciB1VHhDb21wbGV0ZWQqLworICAgICAgYmFwSENJRXZlbnQudS5idGFtcE51bU9mQ29tcGxldGVkUGt0c0V2ZW50Lm51bV9oYW5kbGVzID0gajsKKyAgICAgICgqcEJ0YW1wQ3R4LT5wQmFwSENJRXZlbnRDQikKKyAgICAgICgKKyAgICAgICAgICAgcEJ0YW1wQ3R4LT5wSGRkSGRsLCAgIC8qIHRoaXMgcmVmZXJzIHRoZSBCU0wgcGVyIGFwcGxpY2F0aW9uIGNvbnRleHQgKi8KKyAgICAgICAgICAgJmJhcEhDSUV2ZW50LCAvKiBUaGlzIG5vdyBlbmNvZGVzIEFMTCBldmVudCB0eXBlcyAqLworICAgICAgICAgICBWT1NfVFJVRSAvKiBGbGFnIHRvIGluZGljYXRlIGFzc29jLXNwZWNpZmljIGV2ZW50ICovIAorICAgICAgKTsKKyAgfQorCit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOQkFQX1NlbmRDb21wbGV0ZWREYXRhQmxrc0V2ZW50CisKKyAgREVTQ1JJUFRJT04gCisgICAgVXRpbGl0eSBmdW5jdGlvbiBmb3Igc2VuZGluZyB0aGUgTlVNX09GX0NPTVBMRVRFRF9EQVRBX0JMT0NLU19FVkVOVCB0byBIQ0kgCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcEJ0YW1wQ3R4OiAgIHBvaW50ZXIgdG8gdGhlIEJBUCBjb250cm9sIGJsb2NrIAorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIE5vbmUKKyAgICAgICAgIAorICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2X1ZPSURfdCAKK1dMQU5CQVBfU2VuZENvbXBsZXRlZERhdGFCbGtzRXZlbnQK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ICAgICBWT1NfVFJVRSAvKiBGbGFnIHRvIGluZGljYXRlIGFzc29jLXNwZWNpZmljIGV2ZW50ICovIAorICAgICAgKTsKKyAgfQorCit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOQkFQX1R4UGFja2V0TW9uaXRvckhhbmRsZXIKKworICBERVNDUklQVElPTiAKKyAgICBDYWxsYmFjayBmdW5jdGlvbiByZWdpc3RlcmVkIHdpdGggdm9zIHRpbWVyIGZvciB0aGUgVHggUGFja2V0IE1vbml0b3IgCisgICAgVGltZXIuCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgdXNlckRhdGE6ICAgICAgcG9pbnRlciBjYW4gYmUgdXNlZCB0byByZXRyaXZlIHRoZSBCVC1BTVAgY29udGV4dCAKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBOb25lCisgICAgICAgICAKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordl9WT0lEX3QgCitXTEFOQkFQX1R4UGFja2V0TW9uaXRvckhhbmRsZXIKKyggCisgIHZfUFZPSURfdCB1c2VyRGF0YSAKKykKK3sKKyAgcHRCdGFtcENvbnRleHQgICAgIHBCdGFtcEN0eCAgICAgICA9IChwdEJ0YW1wQ29udGV4dCl1c2VyRGF0YTsKKyAgQlRBTVBGU01fSU5TVEFOQ0VEQVRBX1QgKmluc3RhbmNlVmFyID0gJnBCdGFtcEN0eC0+YmFwUGh5c0xpbmtNYWNoaW5lOworICAvKi0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC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oaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisjaWZuZGVmIFdMQU5fUUNUX1dMQU5CQVBfQVBJX1RJTUVSX0gKKyNkZWZpbmUgV0xBTl9RQ1RfV0xBTkJBUF9BUElfVElNRVJfSAorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICBXIEwgQSBOICAgQiBUIC0gQSBNIFAgIFAgQSBMICAgTCBBIFkgRSBSIAorICAgICAgICAgICAgICAgICAgICBUIEkgTSBFIFIgIFMgRSBSIFYgSSBDIEUgUyAgQSBQIEkKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAKK0RFU0NSSVBUSU9OCisgIFRoaXMgZmlsZSBjb250YWlucyB0aGUgdGltZXIgQVBJcyB1c2VkIGJ5IHRoZSB3bGFuIEJULUFNUCBQQUwgbGF5ZXIgCisgIG1vZHVsZS4KKyAgCisgICAgICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgIEVESVQgSElTVE9SWSBGT1IgRklMRQorCisKKyAgVGhpcyBzZWN0aW9uIGNvbnRhaW5zIGNvbW1lbnRzIGRlc2NyaWJpbmcgY2hhbmdlcyBtYWRlIHRvIHRoZSBtb2R1bGUuCisgIE5vdGljZSB0aGF0IGNoYW5nZXMgYXJlIGxpc3RlZCBpbiByZXZlcnNlIGNocm9ub2xvZ2ljYWwgb3JkZXIuCisKKworICAkSGVhZGVyOiAvY3lnZHJpdmUvZS9CdWlsZHMvTTcyMDFKU0RDQUFQQUQ1MjI0MEIvV00vcGxhdGZvcm0vbXNtNzIwMC9TcmMvRHJpdmVycy9TRC9DbGllbnREcml2ZXJzL1dMQU4vUUNUL0NPUkUvQkFQL3NyYy9iYXBBcGlUaW1lci5oLHYgMS4xIDIwMDgvMTEvMjEgMjA6MzA6MjAganptdWRhIEV4cCBqem11ZGEgJCAkRGF0ZVRpbWU6ICQgJEF1dGhvcjoganptdWRhICQKKworCit3aGVuICAgICAgICB3aG8gICAgd2hhdCwgd2hlcmUsIHdoeQorLS0tLS0tLS0gICAgLS0tICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKzEwLzIzLzA4ICAgIGpleiAgICAgQ3JlYXRlZCBtb2R1bGUuCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgICAgIElOQ0xVREUgRklMRVMgRk9SIE1PRFVMRQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAqIEluY2x1ZGUgRmlsZXMKKyAqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworLy8gUGljayB1cCBhbGwgdGhlIEJULUFNUCBpbnRlcm5hbCBkZWZpbml0aW9ucyAKKy8vIEFuZCB1bmR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EF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmbmRlZiBXTEFOX1FDVF9XTEFOQkFQX0lOVEVSTkFMX0gKKyNkZWZpbmUgV0xBTl9RQ1RfV0xBTkJBUF9JTlRFUk5BTF9ICisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgIFcgTCBBIE4gICBCIFQgLSBBIE0gUCAgUCBBIEwgICBMIEEgWSBFIFIgCisgICAgICAgICAgICAgICAgICAgICAgIEkgTiBUIEUgUiBOIEEgTCAgQSBQIEkKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAKK0RFU0NSSVBUSU9OCisgIFRoaXMgZmlsZSBjb250YWlucyB0aGUgaW50ZXJuYWwgQVBJIGV4cG9zZWQgYnkgdGhlIHdsYW4gQlQtQU1QIFBBTCBsYXllciAKKyAgbW9kdWxlLgorICAKKyAgICAgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisgICRIZWFkZXI6IC9ob21lL2xhYnVzZXIvYW1wQmx1ZVpfMi9DT1JFL0JBUC9zcmMvYmFwSW50ZXJuYWwuaCx2IDEuMyAyMDEwLzA3LzEyIDIwOjQwOjE4IGxhYnVzZXIgRXhwIGxhYnVzZXIgJCAkRGF0ZVRpbWU6ICQgJEF1dGhvcjogbGFidXNlciAkCisKKword2hlbiAgICAgICAgd2hvICAgIHdoYXQsIHdoZXJlLCB3aHkKKy0tLS0tLS0tICAgIC0tLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiswOS8xNS8wOCAgICBqZXogICAgIENyZWF0ZWQgbW9kdWxlLgorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgICAgICBJTkNMVURFIEZJTEVTIEZPUiBNT0RVTEUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKiBJbmNsdWRlIEZpbGVzCisgKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyNpbmNsdWRlICJ2b3NfYXBpLmgiIAorI2luY2x1ZGUgInZvc19wYWNrZXQuaCIgCisKKy8vIFBpY2sgdXAgdGhlIEN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gICAgICAgICAgICAgICBjc3JSb2FtSWQ7CisKKyAgICAvLyBRT1MgY29uZmlnCisgICAgdEJ0YW1wUW9zQ2ZnICAgICAgICAgICAgICBiYXBRb3NDZmc7CisKKyAgICAvKkZsYWcgZm9yIHNpZ25hbGluZyBpZiBzZWN1cml0eSBpcyBlbmFibGVkKi8KKyAgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgIHVjU2VjRW5hYmxlZDsKKworICAgIC8vIGFzc29jaWF0ZWQgYm9vbGVhbiBmbGFnCisgICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICBtQXNzb2NpYXRlZDsKKyAgICAvLyBhc3NvY2lhdGVkIHN0YXR1cyAKKyAgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgIG1Bc3NvY2lhdGVkU3RhdHVzOworICAgIHRDc3JCc3NpZCAgICAgICAgICAgICAgICAgYXNzb2NCc3NpZDsgIAorICAgIHRCc3NTeXN0ZW1Sb2xlICAgICAgICAgICAgc3lzdGVtUm9sZTsgCisKKyAgICAvLyBvd24gU1NJRCAgCisgICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICBvd25Tc2lkWzMyXTsKKyAgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgIG93blNzaWRMZW47CisKKyAgICAvLyBpbmNvbWluZyBBc3NvYyBTU0lEICAKKyAgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgIGFzc29jU3NpZFszMl07CisgICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICBhc3NvY1NzaWRMZW47CisKKyAgICAvLyBnTmVlZFBoeXNMaW5rQ29tcEV2ZW50CisgICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICBnTmVlZFBoeXNMaW5rQ29tcEV2ZW50OworICAgIC8vIGdQaHlzTGlua1N0YXR1cyAKKyAgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgIGdQaHlzTGlua1N0YXR1czsKKyAgICAvLyBnRGlzY1JlcXVlc3RlZAorICAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgZ0Rpc2NSZXF1ZXN0ZWQ7CisgICAgLy8gZ0Rpc2NSZWFzb24gCisgICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICBnRGlzY1JlYXNvbjsKKworICAgIC8vIEluY2x1ZGUgdGhlIEJTTCBwZXItYXBwbGljYXRpb24gY29udGV4dCBoZXJlCisgICAgdl9QVk9JRF90ICAgICAgICAgICAgICAgICBwQXBwSGRsOyAgLy8gUGVyLWFwcCBCU0wgY29udGV4dAorICAgIC8vIEluY2x1ZGUgdGhlIEJTTCBwZXItYXNzb2NpYXRpb24gY29udGV4dHMgaGVyZS4KKyAgICAvLyAoUmlnaHQgbm93LCB0aGVyZSBpcyBvbmx5IG9uZSkKKyAgICB2X1BWT0lEX3QgICAgICAgICAgICAgICAgIHBIZGRIZGw7CisgICAgLyogOCBiaXRzIG9mIHBoeV9saW5rX2hhbmRsZSBpZGVudGlmaWVzIHRoaXMgYXNzb2NpYXRpb24gKi8KKyAgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgIHBoeV9saW5rX2hhbmRsZTsgIAorICAgIC8vIFNob3J0IFJhbmdlIE1vZGUgc2V0dGluZyBmb3IgdGhpcyBwaHlzaWNhbCBsaW5rCisgICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICBwaHlfbGlua19zcm07CisKKyAgICAvLyBJbmNsdWRlIHRoZSBrZXkgbWF0ZXJpYWwgZm9yIHRoaXMgcGh5c2ljYWwgbGluaworICAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAga2V5X3R5cGU7CisgICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICBrZXlfbGVuZ3RoOworICAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAga2V5X21hdGVyaWFsWzMyXTsKKyAgICAKKyAgICAvKiBQaHlzaWNhbCBsaW5rIHF1YWxpdHkgc3RhdHVzCisgICAgICAgQWZ0ZXIgdGhlIHBoeXNpY2FsIGxpbmsgaXMgdXAsIFNNRSBpbmRpY2F0ZXMgdGhlIGxpbmsgcXVhbGl0eSB0aHJvdWdoCisgICAgICAgY2FsbGJhY2suIFRoaXMgdmFsdWUgaXMgcmV0dXJuZWQgdG8gdXBwZXIgbGF5ZXIgb24gcmVxdWVzdC4KKyAgICAgICAqLworICAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgbGlua19xdWFsaXR5OworICAgIAorICAgIC8qIENvbm5lY3Rpb24gQWNjZXB0IHRpbWVyKi8KKyAgICB2b3NfdGltZXJfdCAgICAgICAgICAgICAgIGJhcENvbm5lY3Rpb25BY2NlcHRUaW1lcjsgCisgICAgLyogTGluayBTdXBlcnZpc2lvbiB0aW1lciovCisgICAgdm9zX3RpbWVyX3QgICAgICAgICAgICAgICBiYXBMaW5rU3VwZXJ2aXNpb25UaW1lcjsgCisgICAgLyogTG9naWNhbCBMaW5rIEFjY2VwdCB0aW1lciovCisgICAgdm9zX3RpbWVyX3QgICAgICAgICAgICAgICBiYXBMb2dpY2FsTGlua0FjY2VwdFRpbWVyOyAKKyAgICAvKiBCZXN0IEVmZm9ydCBGbHVzaCB0aW1lciovCisgICAgdm9zX3RpbWVyX3QgICAgICAgICAgICAgICBiYXBCRUZsdXNoVGltZXI7IAorCisgICAgLyogVFggUGFja2V0IE1vbml0b3JpbmcgdGltZXIqLworICAgIHZvc190aW1lcl90ICAgICAgICAgICAgICAgYmFwVHhQa3RNb25pdG9yVGltZXI7IAorCisgICAgLyogQ29ubmVjdGlvbiBBY2NlcHQgVGltZXIgaW50ZXJ2YWwgKGluIEJSL0VEUiBiYXNlYmFuZCBzbG90cykKKyAgICAgKiBJbnRlcnZhbCBsZW5ndGggPSBOICogMC42MjUgbXNlYyAoMSBCUi9FRFIgYmFzZWJhbmQgc2xvdCkKKyAgICAgKi8KKyAgICB2X1UxNl90ICAgICAgICAgICAgICAgICAgIGJhcENvbm5lY3Rpb25BY2NlcHRUaW1lckludGVydmFsOyAKKworICAgIC8qIExpbmsgU3VwZXJ2aXNpb24gVGltZXIgaW50ZXJ2YWwgKGluIEJSL0VEUiBiYXNlYmFuZCBzbG90cykgKi8KKyAgICB2X1UxNl90ICAgICAgICAgICAgICAgICAgIGJhcExpbmtTdXBlcnZpc2lvblRpbWVySW50ZXJ2YWw7IAorCisgICAgLyogTG9naWNhbCBMaW5rIEFjY2VwdCBUaW1lciBpbnRlcnZhbCAoaW4gQlIvRURSIGJhc2ViYW5kIHNsb3RzKSAqLworICAgIHZfVTE2X3QgICAgICAgICAgICAgICAgICAgYmFwTG9naWNhbExpbmtBY2NlcHRUaW1lckludGVydmFsOyAKKworICAgIC8qIEJlc3QgRWZmb3J0IEZsdXNoIHRpbWVyIGludGVydmFsKi8KKyAgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgIGJhcEJFRmx1c2hUaW1lckludGVydmFsOyAKKworICAgIC8vIEluY2x1ZGUgdGhlIGN1cnJlbnQgY2hhbm5lbCBoZXJlCisgICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICBjaGFubmVsOworCisgICAgLy8gSW5jbHVkZSB0aGUgYXNzb2NpYXRpb25zIFNUQSBJZAorICAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgdWNTVEFJZDsKKworICAgIC8vIEluY2x1ZGUgdGhlIGFzc29jaWF0aW9ucyBNQUMgYWRkcmVzc2VzCisgICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICBzZWxmX21hY19hZGRyWzZdOworICAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgcGVlcl9tYWNfYWRkcls2XTsKKworICAgIC8vIFRoZSBhcnJheSBvZiBsb2dpY2FsIGxpbmtzCisgICAgLyogdGhlIGxhc3Qgc21hbGwgaW50ZWdlciAoPDE2KSB2YWx1ZSBhc3NpZ25lZCBieSB1cyAqLworICAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgY3VycmVudF9sb2dfbGlua19pbmRleDsgLyogYXNzaWduZWQgbW9kIDE2ICovICAKKyAgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgIHRvdGFsX2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AqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTkJBUF9DbGVhbkNCCisKKyAgREVTQ1JJUFRJT04gCisgICAgQ2xlYXIgb3V0IGFsbCBmaWVsZHMgaW4gdGhlIEJBUCBjb250ZXh0LgorICAgIAorICBERVBFTkRFTkNJRVMgCisgICAgCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgIHBCdGFtcEN0eDogIHBvaW50ZXIgdG8gdGhlIEJBUCBjb250cm9sIGJsb2NrCisgICAgZnJlZUZsYWc6ICAgZmxhZyBpbmRpY2F0aW5nIHdoZXRoZXIgdG8gZnJlZSBhbnkgYWxsb2NhdGlvbnMuCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgcG9pbnRlciB0byBCQVAgY2IgaXMgTlVMTCA7IGFjY2VzcyB3b3VsZCBjYXVzZSBhIHBhZ2UgCisgICAgICAgICAgICAgICAgICAgICAgICAgZmF1bHQgIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KSAKKworICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIAorV0xBTkJBUF9DbGVhbkNCCisoIAorICBwdEJ0YW1wQ29udGV4dCAgcEJ0YW1wQ3R4LAorICB2X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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyAKK1dMQU5CQVBfR2V0Q3R4RnJvbVN0YUlkCisoIAorICB2X1U4X3QgICAgICAgICB1Y1NUQUlkLCAgLyogVGhlIFN0YUlkICh1c2VkIGJ5IFRMLCBQRSwgYW5kIEhBTCkgKi8KKyAgcHRCdGFtcEhhbmRsZSAqaEJ0YW1wSGFuZGxlLCAgLyogSGFuZGxlIHRvIHJldHVybiBwZXIgYXBwIGJ0YW1wSGFuZGxlIHZhbHVlIGluICAqLyAKKyAgcHRCdGFtcENvbnRleHQgKmhCdGFtcENvbnRleHQsIC8qIEhhbmRsZSB0byByZXR1cm4gcGVyIGFzc29jIGJ0YW1wQ29udGV4dCB2YWx1ZSBpbiAgKi8gCisgIHZfUFZPSURfdCAgICAgKmhIZGRIZGwgLyogSGFuZGxlIHRvIHJldHVybiBCU0wgY29udGV4dCBpbiAqLworKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5CQVBfR2V0U3RhSWRGcm9tTGlua0N0eAorCisgIERFU0NSSVBUSU9OIAorICAgIENhbGxlZCBpbnNpZGUgdGhlIEJULUFNUCBQQUwgKEJBUCkgbGF5ZXIgd2hlbmV2ZXIgd2UgbmVlZCB0aGUKKyAgICBTdGFJZCAob3IgaEhkZEhkbCkgZnJvbSB0aGUgQlRBTVAgY29udGV4dCBhbmQgcGh5X2xpbmtfaGFuZGxlLgorICAgIAorICAgIAorICBERVBFTkRFTkNJRVMgCisgICAgCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgIGhCdGFtcEhhbmRsZTogSGFuZGxlIChwb2ludGVyIHRvIGEgcG9pbnRlcikgdG8gcmV0dXJuIHRoZSAKKyAgICAgICAgICAgIC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mV0dXJuIEJTTCBjb250ZXh0ICovCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTkJBUF9DcmVhdGVOZXdQaHlMaW5rQ3R4CisKKyAgREVTQ1JJUFRJT04gCisgICAgQ2FsbGVkIGluIG9yZGVyIHRvIGNyZWF0ZSAob3IgdXBkYXRlKSBhIEJBUCBQaHlzaWNhbCBMaW5rICJjb250ZXh0IgorICAgIAorICAgIAorICBERVBFTkRFTkNJRVMgCisgICAgCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgIGJ0YW1wSGFuZGxlOiAgICAgQkFQIGFwcCBjb250ZXh0IGhhbmRsZQorICAgIHBoeV9saW5rX2hhbmRsZTogcGh5X2xpbmtfaGFuZGxlIGZyb20gdGhlIENvbW1hbmQgCisgICAgcEhkZEhkbDogICAgICAgICBCU0wgcGFzc2VzIGluIGl0cyBzcGVjaWZpYyBjb250ZXh0CisgICAgCisgICAgT1VUCisgICAgaEJ0YW1wQ29udGV4dDogIEhhbmRsZSAocG9pbnRlciB0byBhIHBvaW50ZXIpIHRvIHJldHVybiB0aGUgCisgICAgICAgICAgICAgICAgICAgIHBlciAiUGh5IExpbmsiIHB0QnRhbXBDb250ZXh0IHZhbHVlIGluLgorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfRV9GQVVMVDogIE5VTEwgcG9pbnRlcjsgYWNjZXNzIHdvdWxkIGNhdXNlIGEgcGFnZSBmYXVsdCAgCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgRXZlcnl0aGluZyBpcyBnb29kIDopIAorCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgCitXTEFOQkFQX0NyZWF0ZU5ld1BoeUxpbmtDdHgKKyggCisgIHB0QnRhbXBIYW5kbGUgIGJ0YW1wSGFuZGxlLAorICB2X1U4X3QgICAgICAgICBwaHlfbGlua19oYW5kbGUsIC8qICBJIGdldCBwaHlfbGlua19oYW5kbGUgZnJvbSB0aGUgQ29tbWFuZCAqLworICB2X1BWT0lEX3QgICAgICBwSGRkSGRsLCAgIC8qIEJTTCBwYXNzZXMgaW4gaXRzIHNwZWNpZmljIGNvbnRleHQgKi8KKyAgcHRCdGFtcENvbnRleHQgKmhCdGFtcENvbnRleHQsIC8qIEhhbmRsZSB0byByZXR1cm4gcGVyIGFzc29jIGJ0YW1wQ29udGV4dCB2YWx1ZSBpbiAgKi8gCisgIHRXTEFOX0JBUFJvbGUgIEJBUERldmljZVJvbGUgIC8qIE5lZWRlZCB0byBkZXRlcm1pbmUgd2hpY2ggTUFDIGFkZHJlc3MgdG8gdXNlIGZvciBzZWxmIE1BQyAgKi8KKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOQkFQX1VwZGF0ZVBoeUxpbmtDdHhTdGFJZAorCisgIERFU0NSSVBUSU9OIAorICAgIENhbGxlZCB0byB1cGRhdGUgdGhlIFNUQUlkIHZhbHVlIGFzc29jaWF0ZWQgd2l0aCBQaHlzaWNhbCBMaW5rICJjb250ZXh0IgorICAgIAorICAgIAorICBERVBFTkRFTkNJRVMgCisgICAgCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgIHBCdGFtcENvbnRleHQ6ICAgcHRCdGFtcENvbnRleHQgdG8gdXBkYXRlLgorICAgIHVjU1RBSWQ6ICAgICAgICAgVGhlIFN0YUlkICh1c2VkIGJ5IFRMLCBQRSwgYW5kIEhBTCkgCisgICAgCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgTlVMTCBwb2ludGVyOyBhY2Nlc3Mgd291bGQgY2F1c2UgYSBwYWdlIGZhdWx0ICAKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikgCisKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyAKK1dMQU5CQVBfVXBkYXRlUGh5TGlua0N0eFN0YUlkCisoIAorICBwdEJ0YW1wQ29udGV4dCBwQnRhbXBDb250ZXh0LCAvKiBidGFtcENvbnRleHQgdmFsdWUgaW4gICovIAorICB2X1U4X3QgICAgICAgICB1Y1NUQUlkCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTkJBUF9DcmVhdGVOZXdMb2dMaW5rQ3R4CisKKyAgREVTQ1JJUFRJT04gCisgICAgQ2FsbGVkIGluIG9yZGVyIHRvIGFsbG9jYXRlIGEgQkFQIExvZ2ljYWwgTGluayAiY29udGV4dCIgYW5kICJpbmRleCIKKyAgICAKKyAgICAKKyAgREVQRU5ERU5DSUVTIAorICAgIAorICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICBwQnRhbXBDb250ZXh0OiAgUG9pbnRlciB0byB0aGUgcHRCdGFtcENvbnRleHQgdmFsdWUgaW4uCisgICAgcGh5X2xpbmtfaGFuZGxlOiBwaHlfbGlua19oYW5kbGUgaW52b2x2ZWQgCisgICAgCisgICAgT1VUCisgICAgcExvZ19saW5rX2hhbmRsZTogcmV0dXJuIHRoZSBsb2dfbGlua19oYW5kbGUgaGVyZSAKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbiAgCisKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6ICBOVUxMIHBvaW50ZXI7IGFjY2VzcyB3b3VsZCBjYXVzZSBhIHBhZ2UgZmF1bHQgIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KSAKKworICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIAorV0xBTkJBUF9DcmVhdGVOZXdMb2dMaW5rQ3R4CisoIAorICBwdEJ0YW1wQ29udGV4dCBwQnRhbXBDb250ZXh0LCAvKiBwb2ludGVyIHRvIHRoZSBwZXIgYXNzb2MgYnRhbXBDb250ZXh0IHZhbHVlICovIAorICB2X1U4X3QgICAgICAgICBwaHlfbGlua19oYW5kbGUsIC8qICBJIGdldCBwaHlfbGlua19oYW5kbGUgZnJvbSB0aGUgQ29tbWFuZCAqLworICB2X1U4X3QgICAgICAgICB0eF9mbG93X3NwZWNbMThdLAorICB2X1U4X3QgICAgICAgICByeF9mbG93X3NwZWNbMThdLAorICB2X1UxNl90ICAgICAgICAgKnBMb2dfbGlua19oYW5kbGUgLyogIFJldHVybiB0aGUgbG9naWNhbCBsaW5rIGluZGV4IGhlcmUgKi8KKyk7CisKKyAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTkJBUF9wbWNGdWxsUHdyUmVxQ0IKKworICBERVNDUklQVElPTiAKKyAgICBDYWxsYmFjayBwcm92aWRlIHRvIFBNQyBpbiB0aGUgcG1jUmVxdWVzdEZ1bGxQb3dlciBBUEkuIAorICAgIAorICAgIAorICBERVBFTkRFTkNJRVMgCisgICAgCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgIGNhbGxiYWNrQ29udGV4dDogIFRoZSB1c2VyIHBhc3NlZCBpbiBhIGNvbnRleHQgdG8gaWRlbnRpZnkgCisgICAgc3RhdHVzOiAgICAgICAgICAgVGhlIGhhbFN0YXR1cyAKKyAgICAKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBOb25lCisKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCAKK1dMQU5CQVBfcG1jRnVsbFB3clJlcUNCCisoIAorICB2b2lkICpjYWxsYmFja0NvbnRleHQsIAorICBlSGFsU3RhdHVzIHN0YXR1cworKTsKKyAgCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5CQVBfUnhQcm9jTHNQa3QKKworICBERVNDUklQVElPTiAKKworICAgIFRoaXMgQVBJIHdpbGwgYmUgY2FsbGVkIHdoZW4gTGluayBTdXBlcnZpc2lvbiBmcmFtZXMgYXJlIHJlY2VpdmVkIGF0IEJBUAorCisgIFBBUkFNRVRFUlMgCisKKyAgICBidGFtcEhhbmRsZTogVGhlIEJULUFNUCBQQUwgaGFuZGxlIHJldHVybmVkIGluIFdMQU5CQVBfR2V0TmV3SG5kbC4KKyAgICBwdWNBQzogICAgICAgUG9pbnRlciB0byByZXR1cm4gdGhlIGFjY2VzcyBjYXRlZ29yeSAKKyAgICBSeFByb3RvVH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ICBTdWNjZXNzCisgIAorICBTSURFIEVGRkVDVFMgCisgIAorLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCitWT1NfU1RBVFVTCitXTEFOQkFQX1R4TGlua1N1cGVydmlzaW9uCisoIAorICBwdEJ0YW1wSGFuZGxlICAgICBidGFtcEhhbmRsZSwgCisgIHZfVThfdCAgICAgICAgICAgIHBoeV9saW5rX2hhbmRsZSwgIC8qIFVzZWQgYnkgQkFQIHRvIGluZGVudGlmeSB0aGUgV0xBTiBhc3NvYy4gKFN0YUlkKSAqLworICB2b3NfcGt0X3QgICAgICAgICAqdm9zRGF0YUJ1ZmYsCisgIHZfVTE2X3QgICAgICAgICAgIHByb3RvVHlwZQorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5CQVBfUmVhZE1hY0NvbmZpZworCisgIERFU0NSSVBUSU9OIAorICAgIFRoaXMgZnVuY3Rpb24gc2V0cyB0aGUgTUFDIGNvbmZpZyAoQWRkcmVzcyBhbmQgU1NJRCB0byBCVC1BTVAgY29udGV4dAorICAgICAgICAKKyAgREVQRU5ERU5DSUVTIAorICAgIAorICBQQVJBTUVURVJTIAorCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gQkFQJ3MgCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wgYmxvY2sgY2FuIGJlIGV4dHJhY3RlZCBmcm9tIGl0cyBjb250ZXh0IAorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIE5vbmUKKworICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkCitXTEFOQkFQX1JlYWRNYWNDb25maWcKKyggCisgIHB0QnRhbXBDb250ZXh0ICBwQnRhbXBDdHggCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTkJBUF9OZWVkQlRDb2V4UHJpb3JpdHkKKworICBERVNDUklQVElPTiAKKyAgICBUaGlzIGZ1bmN0aW9uIHdpbGwgY2F1c2UgYSBtZXNzYWdlIHRvIGJlIHNlbnQgdG8gQlRDIGZpcm13YXJlCisgICAgaWYgYSBjaGFuZ2UgaW4gcHJpb3JpdHkgaGFzIG9jY3VycmVkLiAgKEZyb20gQU1QJ3MgcG9pbnQtb2Ytdmlldy4pCisgICAgICAgIAorICBERVBFTkRFTkNJRVMgCisgICAgCisgIFBBUkFNRVRFUlMgCisKKyAgICBwdm9zR0N0eDogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZSB0byBIQUwncyAKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQgCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgTm9uZQorCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQKK1dMQU5CQVBfTmVlZEJUQ29leFByaW9yaXR5CisoIAorICBwdEJ0YW1wQ29udGV4dCAgcEJ0YW1wQ3R4LCAKKyAgdl9VMzJfdCAgICAgICAgIG5lZWRDb2V4UHJpb3JpdHkKKyk7CisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5CQVBfUnhDYWxsYmFjaworCisgIERFU0NSSVBUSU9OIAorICAgIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIGJ5IFRMIGNhbGwgdGhpcyBmdW5jdGlvbiBmb3IgYWxsIGZyYW1lcyBleGNlcHQgZm9yIERhdGEgZnJhbWVzCisgICAgICAgIAorICBERVBFTkRFTkNJRVMgCisgICAgCisgIFBBUkFNRVRFUlMgCisKKyAgICBwdm9zR0N0eDogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZSB0byBCQVAncyAKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQKKyAgICBwUGFja2V0ICAgICAgICAgVm9zIHBhY2tldAorICAgIGZyYW1lVHlwZSAgICAgICBGcmFtZSB0eXBlCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgTm9uZQorCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgV0xBTkJBUF9SeENhbGxiYWNrCisoCisgICAgdl9QVk9JRF90ICAgICAgICAgICAgICAgcHZvc0dDdHgsIAorICAgIHZvc19wa3RfdCAgICAgICAgICAgICAgKnBQYWNrZXQsCisgICAgV0xBTlRMX0JBUEZyYW1lRW51bVR5cGUgZnJhbWVUeXBlCispOworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTkJBUF9Jbml0TGlua1N1cGVydmlzaW9uCisKKyAgREVTQ1JJUFRJT04gCisKKyAgICBUaGlzIEFQSSB3aWxsIGJlIGNhbGxlZCB3aGVuIExpbmsgU3VwZXJ2aXNpb24gbW9kdWxlIGlzIHRvIGJlIGluaXRpYWxpemVkIHdoZW4gY29ubmVjdGVkIGF0IEJBUAorCisgIFBBUkFNRVRFUlMgCisKKyAgICBidGFtcEhhbmRsZTogVGhlIEJULUFNUCBQQUwgaGFuZGxlIHJldHVybmVkIGluIFdMQU5CQVBfR2V0TmV3SG5kbC4KKyAgIAorICBSRVRVUk4gVkFMVUUKKworICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfRV9JTlZBTDogIElucHV0IHBhcmFtZXRlcnMgYXJlIGludmFsaWQgCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgQkFQIGhhbmRsZSBpcyBOVUxMICAKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikgCisKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworI2RlZmluZSBUWF9MU19EQVRBTEVOICAgMzIKKworVk9TX1NUQVRVUworV0xBTkJBUF9Jbml0TGlua1N1cGVydmlzaW9uCisoIAorICBwdEJ0YW1wSGFuZGxlICAgICBidGFtcEhhbmRsZQorKTsKKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5CQVBfRGVJbml0TGlua1N1cGVydmlzaW9uCisKKyAgREVTQ1JJUFRJT04gCisKKyAgICBUaGlzIEFQSSB3aWxsIGJlIGNhbGxlZCB3aGVuIExpbmsgU3VwZXJ2aXNpb24gbW9kdWxlIGlzIHRvIGJlI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W0gTGF5ZXIgKEJTTCkgKGluIEhERCkgd2hpY2ggaW1wbGVtZW50cyBhIHN0cmVhbSBkZXZpY2Ugb24gYQorICBwYXJ0aWN1bGFyIHBsYXRmb3JtLgorCisgIERFUEVOREVOQ0lFUzoKKworICBBcmUgbGlzdGVkIGZvciBlYWNoIEFQSSBiZWxvdy4KKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgIEVESVQgSElTVE9SWSBGT1IgRklMRQorCisKKyAgVGhpcyBzZWN0aW9uIGNvbnRhaW5zIGNvbW1lbnRzIGRlc2NyaWJpbmcgY2hhbmdlcyBtYWRlIHRvIHRoZSBtb2R1bGUuCisgIE5vdGljZSB0aGF0IGNoYW5nZXMgYXJlIGxpc3RlZCBpbiByZXZlcnNlIGNocm9ub2xvZ2ljYWwgb3JkZXIuCisKKworICAgJEhlYWRlcjogL2hvbWUvbGFidXNlci9hbXBCbHVlWl8yL0NPUkUvQkFQL3NyYy9iYXBNb2R1bGUuYyx2IDEuMSAyMDEwLzA3LzEyIDE5OjA1OjM1IGxhYnVzZXIgRXhwIGxhYnVzZXIgJCREYXRlVGltZSQkQXV0aG9yOiBsYWJ1c2VyICQKKworCisgIHdoZW4gICAgICAgIHdobyAgICAgd2hhdCwgd2hlcmUsIHdoeQorLS0tLS0tLS0tLSAgICAtLS0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKzIwMDgtMDktMTUgICAgamV6ICAgICBDcmVhdGVkIG1vZHVsZQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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gICAgJnBCdGFtcEN0eC0+YmFwVHhQa3RNb25pdG9yVGltZXIsCisgICAgICAgICAgVk9TX1RJTUVSX1RZUEVfU1csIC8qIHVzZSB0aGlzIHR5cGUgKi8KKyAgICAgICAgICBXTEFOQkFQX1R4UGFja2V0TW9uaXRvckhhbmRsZXIsCisgICAgICAgICAgcEJ0YW1wQ3R4KTsKKworICB2b3NTdGF0dXMgPSB2b3NfbG9ja19pbml0KCZwQnRhbXBDdHgtPmJhcExvY2spOworICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpCisgIHsKKyAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIkxvY2sgSW5pdCBGYWlsIik7CisgIH0KKworICByZXR1cm4gdm9zU3RhdHVzOworfS8qIFdMQU5CQVBfU3RhcnQgKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5CQVBfU3RvcAorCisgIERFU0NSSVBUSU9OIAorICAgIENhbGxlZCBieSB2b3Nfc3RvcCB0byBzdG9wIG9wZXJhdGlvbiBpbiBCQVAsIGJlZm9yZSBjbG9zZS4gQkFQIHdpbGwgc3VzcGVuZCBhbGwgCisgICAgQlQtQU1QIFByb3RvY29sIEFkYXB0aW9uIExheWVyIG9wZXJhdGlvbiBhbmQgd2lsbCB3YWl0IGZvciB0aGUgY2xvc2UgCisgICAgcmVxdWVzdCB0byBjbGVhbiB1cCBpdHMgcmVzb3VyY2VzLiAKKyAgICAKKyAgREVQRU5ERU5DSUVTIAorICAgIAorICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICBwdm9zR0N0eDogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZSB0byBCQVAncyAKKyAgICAgICAgICA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ICB7CisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIkNvdWxkbid0IGRlc3Ryb3kgIGJhcExpbmtTdXBlcnZpc2lvblRpbWVyIik7CisgIH0KKworICB2b3NTdGF0dXMgPSB2b3NfdGltZXJfZGVzdHJveSAoIAorICAgICZwQnRhbXBDdHgtPmJhcFR4UGt0TW9uaXRvclRpbWVyICk7CisgIGlmICggVk9TX1NUQVRVU19TVUNDRVNTICE9IHZvc1N0YXR1cykKKyAgeworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICJDb3VsZG4ndCBkZXN0cm95ICBiYXBUeFBrdE1vbml0b3JUaW1lciIpOworICB9CisgIHZvc19sb2NrX2Rlc3Ryb3koJnBCdGFtcEN0eC0+YmFwTG9jayk7CisgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9LyogV0xBTkJBUF9TdG9wICovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOQkFQX0Nsb3NlCisKKyAgREVTQ1JJUFRJT04gCisgICAgQ2FsbGVkIGJ5IHZvc19jbG9zZSBkdXJpbmcgZ2VuZXJhbCBkcml2ZXIgY2xvc2UgcHJvY2VkdXJlLiBCQVAgd2lsbCBjbGVhbiB1cCAKKyAgICBhbGwgdGhlIGludGVybmFsIHJlc291cmNlcy4gCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gQkFQJ3MgCisgIC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xpbmtDdHggKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5CQVBfQ3JlYXRlTmV3UGh5TGlua0N0eAorCisgIERFU0NSSVBUSU9OIAorICAgIENhbGxlZCBpbiBvcmRlciB0byBjcmVhdGUgKG9yIHVwZGF0ZSkgYSBCQVAgUGh5c2ljYWwgTGluayAiY29udGV4dCIKKyAgICAKKyAgICAKKyAgREVQRU5ERU5DSUVTIAorICAgIAorICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICBidGFtcEhhbmRsZTogICAgIEJBUCBhcHAgY29udGV4dCBoYW5kbGUKKyAgICBwaHlfbGlua19oYW5kbGU6IHBoeV9saW5rX2hhbmRsZSBmcm9tIHRoZSBDb21tYW5kIAorICAgIHBIZGRIZGw6ICAgICAgICAgQlNMIHBhc3NlcyBpbiBpdHMgc3BlY2lmaWMgY29udGV4dAorICAgIAorICAgIE9VVAorICAgIGhCdGFtcENvbnRleHQ6ICBIYW5kbGUgKHBvaW50ZXIgdG8gYSBwb2ludGVyKSB0byByZXR1cm4gdGhlIAorICAgICAgICAgICAgICAgICAgICBwZXIgIlBoeSBMaW5rIiBwdEJ0YW1wQ29udGV4dCB2YWx1ZSBpbi4KKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbiAgCisKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6ICBOVUxMIHBvaW50ZXI7IGFjY2VzcyB3b3VsZCBjYXVzZSBhIHBhZ2UgZmF1bHQgIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KSAKKworICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT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reworICByZXR1cm4gKysocEJ0YW1wQ29udGV4dC0+Y3VycmVudF9sb2dfbGlua19pbmRleCkgJSBXTEFOQkFQX01BWF9MT0dfTElOS1M7IAorfS8qIGJhcEFsbG9jTmV4dExvZ0xpbmtJbmRleCAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTkJBUF9DcmVhdGVOZXdMb2dMaW5rQ3R4CisKKyAgREVTQ1JJUFRJT04gCisgICAgQ2FsbGVkIGluIG9yZGVyIHRvIGFsbG9jYXRlIGEgQkFQIExvZ2ljYWwgTGluayAiY29udGV4dCIgYW5kICJpbmRleCIKKyAgICAKKyAgICAKKyAgREVQRU5ERU5DSUVTIAorICAgIAorICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICBwQnRhbXBDb250ZXh0OiAgUG9pbnRlciB0byB0aGUgcHRCdGFtcENvbnRleHQgdmFsdWUgaW4uCisgICAgcGh5X2xpbmtfaGFuZGxlOiBwaHlfbGlua19oYW5kbGUgaW52b2x2ZWQgCisgICAgCisgICAgT1VUCisgICAgcExvZ19saW5rX2hhbmRsZTogcmV0dXJuIHRoZSBsb2dfbGlua19oYW5kbGUgaGVyZSAKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbiAgCisKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6ICBOVUxMIHBvaW50ZXI7IGFjY2VzcyB3b3VsZCBjYXVzZSBhIHBhZ2UgZmF1bHQgIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KSAKKworICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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BXTEFOQkFQX0NyZWF0ZU5ld0xvZ0xpbmtDdHggKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5CQVBfcG1jRnVsbFB3clJlcUNCCisKKyAgREVTQ1JJUFRJT04gCisgICAgQ2FsbGJhY2sgcHJvdmlkZSB0byBQTUMgaW4gdGhlIHBtY1JlcXVlc3RGdWxsUG93ZXIgQVBJLiAKKyAgICAKKyAgICAKKyAgREVQRU5ERU5DSUVTIAorICAgIAorICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICBjYWxsYmFja0NvbnRleHQ6ICBUaGUgdXNlciBwYXNzZWQgaW4gYSBjb250ZXh0IHRvIGlkZW50aWZ5IAorICAgIHN0YXR1czogICAgICAgICAgIFRoZSBoYWxTdGF0dXMgCisgICAgCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgTm9uZQorCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgCitXTEFOQkFQX3BtY0Z1bGxQd3JSZXFDQgorKCAKKyAgdm9pZCAqY2FsbGJhY2tDb250ZXh0LCAKKyAgZUhhbFN0YXR1cyBzdGF0dXMKKykKK3sKKworfS8qIFdMQU5CQVBfcG1jRnVsbFB3clJlcUNCICovCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5CQVBfUmVhZE1hY0NvbmZpZworCisgIERFU0NSSVBUSU9OIAorICAgIFRoaXMgZnVuY3Rpb24gc2V0cyB0aGUgTUFDIGNvbmZpZyAoQWRkcmVzcyBhbmQgU1NJRCB0byBCVC1BTVAgY29ud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BBUkFNRVRFUlMgCisKKyAgICBwdm9zR0N0eDogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZSB0byBIQUwncyAKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQgCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgTm9uZQorCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKy8vIEdsb2JhbAorc3RhdGljIGludCBnQmFwQ29leFByaW9yaXR5OworCit2b2lkCitXTEFOQkFQX05lZWRCVENvZXhQcmlvcml0eQorKCAKKyAgcHRCdGFtcENvbnRleHQgIHBCdGFtcEN0eCwgCisgIHZfVTMyX3QgICAgICAgICBuZWVkQ29leFByaW9yaXR5CispCit7CisgIHRIYWxIYW5kbGUgICAgICBwTWFjID0gTlVMTDsKKyAgdFNtZUJ0QW1wRXZlbnQgIGJ0QW1wRXZlbnQ7CisKKworICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgIFJldHJpZXZlIHRoZSBwTWFjIChIQUwgY29udGV4dCkKKyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyAgcE1hYyA9ICh0SGFsSGFuZGxlKXZvc19nZXRfY29udGV4dCggVk9TX01PRFVMRV9JRF9TTUUsIHBCdGFtcEN0eC0+cHZvc0dDdHgpOworCisgIC8vIElzIHJlLWVudHJhbmN5IHByb3RlY3Rpb24gbmVlZGVkIGZvciB0aGlzPworICBpZiAobmV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NYWMsIGJ0QW1wRXZlbnQpOworCisgICAgICAgICAgYnJlYWs7CisKKyAgICAgIGRlZmF1bHQ6CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgQ29leGlzdGVuY2UgcHJpb3JpdHkgcmVxdWVzdDogJWQiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBuZWVkQ29leFByaW9yaXR5KTsKKyAgICB9CisKKyAgfQorfQorCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOQkFQX1J4Q2FsbGJhY2sKKworICBERVNDUklQVElPTiAKKyAgICBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCBieSBUTCBjYWxsIHRoaXMgZnVuY3Rpb24gZm9yIGFsbCBmcmFtZXMgZXhjZXB0IGZvciBEYXRhIGZyYW1lcworICAgICAgICAKKyAgREVQRU5ERU5DSUVTIAorICAgIAorICBQQVJBTUVURVJTIAorCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gQkFQJ3MgCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wgYmxvY2sgY2FuIGJlIGV4dHJhY3RlZCBmcm9tIGl0cyBjb250ZXh0CisgICAgcFBhY2tldCAgICAgICAgIFZvcyBwYWNrZXQKKyAgICBmcmFtZVR5cGUgICAgICAgRnJhbWUgdHlwZQorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIE5vbmUKKworICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1N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ZSk7CisgICAgICAgICAgV0xBTkJBUF9SeFByb2NMc1BrdCgocHRCdGFtcEhhbmRsZSlwQnRhbXBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJ0YW1wQ3R4LT5waHlfbGlua19oYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQYWNrZXQpOworICAgICAgICAgIGJyZWFrOworICAgICAgfQorCisgICAgICBjYXNlIFdMQU5UTF9CVF9BTVBfVFlQRV9BUjogLyogRmFsbCB0aHJvdWdoICovCisgICAgICBjYXNlIFdMQU5UTF9CVF9BTVBfVFlQRV9TRUM6CisgICAgICB7CisgICAgICAgICAgLyogQ2FsbCB0aGUgUlNOIGNhbGxiYWNrIGhhbmRsZXIgKi8KKyAgICAgICAgICBiYXBSc25SeENhbGxiYWNrIChwdm9zR0N0eCwgcFBhY2tldCk7CisgICAgICAgICAgYnJlYWs7CisgICAgICB9CisKKyAgICAgIGRlZmF1bHQ6CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgZnJhbWV0eXBlIGZyb20gVEw6ICVkLCA9PiBCQVAiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBmcmFtZVR5cGUpOworICAgIH0KKworICAgIHJldHVybiAoIFZPU19TVEFUVVNfU1VDQ0VTUyApOworfQpkaWZmIC0tZ2l0IGEvd2xhbi9wcmltYS9DT1JFL0JBUC9zcmMvYmFwUnNuODAyMXhBdXRoRnNtLmMgYi93bGFuL3ByaW1hL0NPUkUvQkFQL3NyYy9iYXBSc244MDIxeEF1dGhGc20uYwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5mY2JjNmU0Ci0tLSAvZGV2L251bGwKKysrIGIvd2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IEtFWV9VUERBVEUgICAgICAgICAgMTMKKyNkZWZpbmUgTlVNX1NUQVRFUyAoS0VZX1VQREFURSArIDEpCisKKworCitzdGF0aWMgdEF1dGhSc25Gc21Db25zdHMgYXV0aENvbnN0cyA9IHsgMjAwMCwgMyB9OyAgLy90aW1lb3V0LCByZXRyeSBsaW1pdAorc3RhdGljIHZfVThfdCBhbmlTc21JZVJzbk91aVtdID0gQU5JX1NTTV9JRV9SU05fT1VJOworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogU3RhdGljIGZ1bmN0aW9ucyBpbiB0aGlzIG1vZHVsZQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgCitpbnQgemVyb091dFB0ayh0QXV0aFJzbkZzbSAqZnNtKTsKK3N0YXRpYyAKK2ludCBzdG9wQWxsVGltZXJzKHRBdXRoUnNuRnNtICpmc20pOworCitzdGF0aWMKK2ludCBjaGVja01pYyh0QXV0aFJzbkZzbSAqZnNtLCAKKyAgICAgICAgICAgICB0QW5pRWFwb2xLZXlBdmFpbEV2ZW50RGF0YSAqZGF0YSk7CisKK3N0YXRpYyAKK2ludCBjaGVja0xvY2FsUmVwbGF5Q291bnRlcih0QXV0aFJzbkZzbSAqZnNtLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QW5pRWFwb2xLZXlBdmFpbEV2ZW50RGF0YSAqZGF0YSk7CitzdGF0aWMgCitpbnQgY2hlY2tQZWVyUmVwbGF5Q291bnRlcih0QXV0aFJzbkZzbSAqZnNtLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBbmlFYXBvbEtleUF2YWlsRXZlbnREYXRhICpkYXRhKTsKKworc3RhdGljIGludCBjaGVja0luZm9FbGVtZW50KHRBdXRoUnNuRnNtICpmc20sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFuaUVhcG9sS2V5QXZhaWxFdmVudERhdGEgKmRhdGEpOworCitzdGF0aWMKK2ludCBkZXJpdmVQdGsodEF1dGhSc25Gc20gKmZzbSwgCisgICAgICAgICAgICAgIHRBbmlFYXBvbEtleUF2YWlsRXZlbnREYXRhICpkYXRhKTsKKworCitzdGF0aWMgaW50IGNoZWNrVHJhbnNpdGlvbih0QXV0aFJzbkZzbSAqZnNtLCB2b2lkICphcmcpOworCitzdGF0aWMgaW50Citnb3RvU3RhdGVJbml0KHRBdXRoUnNuRnNtICpmc20pOworCitzdGF0aWMgdm9pZCBtc2cyVGltZXJDYWxsYmFjayggdm9pZCAqICk7CitzdGF0aWMgdm9pZCBtc2c0VGltZXJDYWxsYmFjayggdm9pZCAqICk7CisKK3N0YXRpYyBpbnQgYXV0aFJzblJ4RnJhbWVIYW5kbGVyKCB2X1BWT0lEX3QgcHZvc0dDdHgsIHZvc19wa3RfdCAqcFBhY2tldCApOworc3RhdGljIGludCBhdXRoUnNuVHhDb21wbGV0ZUhhbmRsZXIoIHZfUFZPSURfdCBwdm9zR0N0eCwgdm9zX3BrdF90ICpwUGFja2V0LCBWT1NfU1RBVFVTIHJldFN0YXR1cyApOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIEZ1bmN0aW9ucyBGb3J3YXJkIERlY2xhcmF0aW9ucworICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitpbnQgYXV0aFJzbkF1dGhTdGFydEV2ZW50SGFuZGxlciggdEF1dGhSc25Gc20gKmZzbSApOworaW50IGF1dGhSc25BdXRoRGlzY29uRXZlbnRIYW5kbGVyKCB0QXV0aFJzbkZzbSAqZnNtICk7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBUaGUgZXhwb3J0ZWQgZnVuY3Rpb25zCisgKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyoqCisgKiBhdXRoUnNuRnNtSW5pdAorICoKKyAqIEZVTkNUSU9OOgorICogSW5pdGlhbGl6ZXMgdGhlIGNvbnN0YW50cyBhbmQgdGhlIGNhb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ybiBBTklfT0sgaWYgdGhlIG9wZXJhdGlvbiBzdWNjZWVkcworICovCitpbnQKK2F1dGhSc25Gc21DcmVhdGUodEJ0YW1wQ29udGV4dCAqY3R4KQoreworICAgIGludCByZXRWYWwgPSBBTklfT0s7CisgICAgdEF1dGhSc25Gc20gKmZzbSA9ICZjdHgtPnVGc20uYXV0aEZzbTsKKworICAgIC8vIEZpcnN0LCBjbGVhciBldmVyeXRoaW5nIG91dAorICAgIHZvc19tZW1femVybyggZnNtLCBzaXplb2YodEF1dGhSc25Gc20pKTsKKworICAgIGlmKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBiYXBSc25SZWdpc3RlclR4UnhDYWxsYmFja3MoIGF1dGhSc25UeENvbXBsZXRlSGFuZGxlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV0aFJzblJ4RnJhbWVIYW5kbGVyICkgKSApCisgICAgeworICAgICAgICByZXR1cm4gQU5JX0VSUk9SOworICAgIH0KKworICAgIGlmKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBiYXBSc25SZWdpc3RlclJ4Q2FsbGJhY2soIGN0eC0+cHZvc0dDdHggKSApICkKKyAgICB7CisgICAgICAgIHJldHVybiBBTklfRVJST1I7CisgICAgfQorCisgICAgLy8gQWxsb2NhdGUgdGhlIHN0YXRpb24gY29udGV4dAorICAgIGZzbS0+c3RhQ3R4ID0gKHRTdGFDb250ZXh0ICopdm9zX21lbV9tYWxsb2MoIHNpemVvZih0U3RhQ29udGV4dCkgKTsKKyAgICBpZiAoZnNtLT5zdGFDdHggPT0gTlVMTCkgCisgICAgeworICAgICAgICByZXRWYWwgPSBBTklfRV9NQUxMT0NfRkFJTEVEOworICAgICAgICBWT1NfQVNTRVJUKCAwICk7CisgICAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorICAgIC8vIENsZWFyIG91dCB0aGUgc3RhdGlvbiBjb250ZXh0CisgICAgdm9zX21lbV96ZXJvKCBmc20tPnN0YUN0eCwgc2l6ZW9mKHRTdGFDb250ZXh0KSApOworICAgIAorICAgIGZzbS0+Y3R4ID0gY3R4OworICAgIGZzbS0+c3RhQ3R4LT5hdXRoUnNuRnNtID0gZnNtOworICAgIC8vT25seSBzdXBwb3J0IENDTVAKKyAgICBmc20tPnN0YUN0eC0+cHdDaXBoZXJUeXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfQUVTOworCisgICAgaWYoICFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIHZvc190aW1lcl9pbml0KCAmZnNtLT5tc2cyVGltZXIsIFZPU19USU1FUl9UWVBFX1NXLCBtc2cyVGltZXJDYWxsYmFjaywgZnNtICkgKSApCisgICAgeworICAgICAgICByZXRWYWwgPSBBTklfRV9NQUxMT0NfRkFJTEVEOworICAgICAgICBWT1NfQVNTRVJUKCAwICk7CisgICAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorCisgICAgaWYoICFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIHZvc190aW1lcl9pbml0KCAmZnNtLT5tc2c0VGltZXIsIFZPU19USU1FUl9UWVBFX1NXLCBtc2c0VGltZXJDYWxsYmFjaywgZnNtICkgKSApCisgICAgeworICAgICAgICByZXRWYWwgPSBBTklfRV9NQUxMT0NfRkFJTEVEOworICAgICAgICBWT1NfQVNTRVJUKCAwICk7CisgICAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorCisgICAgcmV0VmFsID0gYW5pQXNmUGFja2V0QWxsb2NhdGVFeHBsaWNpdCgmZnNtLT5sYXN0RWFwb2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSU05fTUFYX1BBQ0tFVF9TSVpFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRUFQT0xfVFhfSEVBREVSX1NJWkUgKTsKKyAgICBpZiAocmV0VmFsICE9IEFOSV9PSykgCisgICAgeworICAgICAgICBWT1NfQVNTRVJUKCAwICk7CisgICAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorCisgICAgYW5pQXNmUGFja2V0QWxsb2NhdGUoJmZzbS0+c3RhQ3R4LT5wbWspOworICAgIGlmIChmc20tPnN0YUN0eC0+cG1rID09IE5VTEwpIAorICAgIHsKKyAgICAgICAgcmV0VmFsID0gQU5JX0VfTUFMTE9DX0ZBSUxFRDsKKyAgICAgICAgVk9TX0FTU0VSVCggMCApOworICAgICAgICBnb3RvIGVycm9yOworICAgIH0KKworICAgIGFuaUFzZlBhY2tldEFsbG9jYXRlRXhwbGljaXQoJmZzbS0+c3RhQ3R4LT5pZVN0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJTTl9JRV9NQVhfUEFDS0VUX1NJWkUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSU05fSUVfSEVBREVSX1NJWkUgKTsKKyAgICBpZiAoZnNtLT5zdGFDdHgtPmllU3RhID09IE5VTEwpIAorICAgIHsKKyAgICAgICAgcmV0VmFsID0gQU5JX0VfTUFMTE9DX0ZBSUxFRDsKKyAgICAgICAgVk9TX0FTU0VSVCggMCApOworICAgICAgICBnb3RvIGVycm9yOworICAgIH0KKworICAgIGZzbS0+Y3J5cHRIYW5kbGUgPSAwOworICAgIGlmKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCB2b3NfY3J5cHRvX2luaXQoICZmc20tPmNyeXB0SGFuZGxlICkgKSApCisgICAgeworICAgICAgICByZXRWYWwgPSBBTklfRV9GQUlMRUQ7CisgICAgICAgIFZPU19BU1NFUlQoIDAgKTsKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICB9CisKKyAgICBmc20tPmN1cnJlbnRTdGF0ZSA9IElOSVRJQUxJWkU7CisgICAgZ290b1N0YXRlSW5pdChmc20pOworCisgICAgLy9XZSBjYW4gY2FsbCB0aGlzIGZ1bmN0aW9uIGhlcmUgYmVjYXVzZSBpdCBpcyBjb25uZWN0ZWQgYXQgdGhpcyB0aW1lCisgICAgYX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bG9jYXRlRXhwbGljaXQoJmZzbS0+bGFzdEVhcG9sLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUlNOX01BWF9QQUNLRVRfU0laRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVBUE9MX1RYX0hFQURFUl9TSVpFICk7CisjZW5kaWYgICAgCisgICAgYW5pQXNmUGFja2V0RW1wdHlFeHBsaWNpdChmc20tPmxhc3RFYXBvbCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFQVBPTF9UWF9IRUFERVJfU0laRSk7CisgICAgLy99CisgICAvLyBpZiAoMSkgCisgICAgLy97CisKKyAgICAgICAgdm9zX21lbV96ZXJvKCAmdHhEZXNjLCBzaXplb2YodHhEZXNjKSApOworCisgICAgICAgIC8vIFRoZSBLZXkgSW5mb3JtYXRpb24gYml0cy4uLgorICAgICAgICBpZiAoZnNtLT5zdGFDdHgtPnB3Q2lwaGVyVHlwZSA9PSBlQ1NSX0VOQ1JZUFRfVFlQRV9BRVMpIAorICAgICAgICB7CisgICAgICAgICAgICB0eERlc2MuaW5mby5rZXlEZXNjVmVycyA9IEFOSV9FQVBPTF9LRVlfREVTQ19WRVJTX0FFUzsKKyAgICAgICAgfSAKKyAgICAgICAgZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gQU5JX0VfSUxMRUdBTF9BUkc7CisgICAgICAgIH0KKyAgICAgICAgdHhEZXNjLmluZm8udW5pY2FzdEZsYWcgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgdHhEZXNjLmluZm8uYWNrRmxhZyA9IGVBTklfQk9PTEVBTl9UUlVFOworCisgICAgICAgIC8vIFRoZSBvdGhlciBmaWVsZHMuLi4KKyAgICAgICAgdHhEZXNjLmtleUxlbiA9IGFhZ0dldEtleU1hdGVyaWFsTGVuKGZzbS0+c3RhQ3R4LT5wd0NpcGhlclR5cGUpOworICAgICAgICBhbmlTc21SZXBsYXlDdHJOZXh0KGZzbS0+c3RhQ3R4LT5sb2NhbFJlcGxheUN0ciwgdHhEZXNjLnJlcGxheUNvdW50ZXIpOworICAgICAgICB2b3NfbWVtX2NvcHkodHhEZXNjLmtleU5vbmNlLCBmc20tPmFOb25jZSwgc2l6ZW9mKHR4RGVzYy5rZXlOb25jZSkpOworCisgICAgICAgIHJldFZhbCA9IGFuaUVhcG9sV3JpdGVLZXkoZnNtLT5jcnlwdEhhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmc20tPmxhc3RFYXBvbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmc20tPnN0YUN0eC0+c3VwcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmc20tPnN0YUN0eC0+YXV0aE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTklfRUFQT0xfS0VZX0RFU0NfVFlQRV9SU05fTkVXLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ0eERlc2MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwgMCk7CisgICAgICAgIGlmKCAhQU5JX0lTX1NUQVRVU19TVUNDRVNTKCByZXRWYWwgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHJldHVybiByZXRWYWw7CisgICAgICAgIH0KKyNpZiAwCisgICAgfSAKKyAgICBlbHNlIHsKKyAgICAgICAgcmV0cmFuc21pdCA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgIH0KKyNlbmRpZiAgICAKKworICAgIGlmKCBWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIGJhcFJzblNlbmRFYXBvbEZyYW1lKCBmc20tPmN0eC0+cHZvc0dDdHgsIGZzbS0+bGFzdEVhcG9sICkgKSApCisgICAgeworICAgICAgICByZXRWYWwgPSBBTklfT0s7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIC8vd2UgZmFpbCB0byBzZW5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gKiBAcmV0dXJuIEFOSV9PSyBpZiB0aGUgb3BlcmF0aW9uIHN1Y2NlZWRzCisgKi8KKyNkZWZpbmUgU1RBVElDX1dFUF9LRVlfTEVOIDE2CisjZGVmaW5lIEdST1VQX0tFWV9JRCAwCisjZGVmaW5lIEFOSV9TU01fSUVfUlNOX0tFWV9EQVRBX0VOQ0FQU19JRCAgICAgICAweERECisjZGVmaW5lIEFOSV9TU01fSUVfUlNOX0dST1VQX0tFWV9EQVRBX0VOQ0FQU19JRCAxCisKK2ludAorYWFnQXBwZW5kR3JvdXBLZXlGb3JSc24odEFuaVBhY2tldCAqcGFja2V0KQoreworI2lmIDAKKyAgICB0QW5pUGFja2V0ICpncm91cEtleSA9IE5VTEw7CisjZWxzZQorICAgIHRBTklfVTggZ3JvdXBLZXlbXSA9IHsweDAwLCAweDAxLCAweDAyLCAweDAzLCAweDA0LCAweDA1LCAweDA2LCAweDA3LAorICAgICAgICAgICAgICAgICAgICAgICAgICAweDA4LCAweDA5LCAweDEwLCAweDExLCAweDEyLCAweDEzLCAweDE0LCAweDE1fTsKKyNlbmRpZgorICAgIHRBTklfVTggKmdyb3VwS2V5Qnl0ZXMgPSBOVUxMOworICAgIHRBTklfVTggKmxlblB0ciA9IE5VTEw7CisgICAgdEFOSV9VOCAqZW5kUHRyID0gTlVMTDsKKyAgICBpbnQgZ3JvdXBLZXlMZW47CisgICAgaW50IHJldFZhbDsKKworI2lmIDAKKyAgICBncm91cEtleSA9IEFBR19HUk9VUF9LRVkocmFkaW9JZCk7CisgICAgaWYgKGdyb3VwS2V5ID09IE5VTEwpIHsKKyAgICAgICAgQU5JX0FBR19MT0dfRSgiR3JvdXAga2V5IGlzIG5vdCB5ZXQgc2V0IG9uIHJhZGlvICVkLCBpZCAlZCEiLAorICAgICAgICAgICAgICAgICAgICAgIHJhZGlvSWQsIEFBR19HUk9VUF9LRVlfSUQocmFkaW9JZCkpOworICAgICAgICBhc3NlcnQoMCAmJiAiR3JvdXAga2V5IGlzI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ICAgIHZfVThfdCAqd3JhcHBlZEtleSA9IE5VTEw7CisgICAgLy8gVmFyaWFibGVzIHVzZWQgZm9yIFJDNCBHVEsgd3JhcAorICAgIC8vdl9VOF90IGtleUl2W0FOSV9FQVBPTF9LRVlfUlNOX0lWX1NJWkVdOworICAgIC8vdl9VMzJfdCBrZXlJdkxzYjsKKyAgICBpbnQgcmV0VmFsID0gMDsKKworICAgIC8vaW52YWxpZGF0ZSB0aGlzCisgICAgZnNtLT5tc2c0VGltZU91dCA9IFZPU19GQUxTRTsKKyAgICBmc20tPmN1cnJlbnRTdGF0ZSA9IFBUS19JTklUX05FR09fVFggOworCisgICAgaWYgKGtleURhdGEgPT0gTlVMTCkgCisgICAgeworICAgICAgICAvLyBBbGxvY2F0ZSB0aGUgcGFja2V0IHRoZSBmaXJzdCB0aW1lIGFyb3VuZCB0aGF0IHlvdSBlbnRlcgorICAgICAgICByZXRWYWwgPSBhbmlBc2ZQYWNrZXRBbGxvY2F0ZUV4cGxpY2l0KCZrZXlEYXRhLCAxMDI0LCAxMCk7CisgICAgICAgIGlmKCAhQU5JX0lTX1NUQVRVU19TVUNDRVNTKCByZXRWYWwgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHJldHVybiByZXRWYWw7CisgICAgICAgIH0KKyAgICB9IAorICAgIGVsc2UgeworICAgICAgICAvLyBKdXN0IGVtcHR5IG91dCB0aGUgcGFja2V0CisgICAgICAgIGFuaUFzZlBhY2tldEVtcHR5RXhwbGljaXQoa2V5RGF0YSwgMTApOworICAgIH0KKworICAgIGRvCisgICAgeworICAgICAgICAvLyBDcmVhdGUgYSBuZXcgRUFQT0wgZnJhbWUgaWYgd2UgZG9uJ3QgaGF2ZSBvbmUgdG8gcmV0cmFuc21pdAorICAgICAgICAvL2lmIChhbmlBc2ZQYWNrZXRHZXRMZW4oZnNtLT5sYXN0RWFwb2wpID09IDApIAorI2lmIDAKKyAgICAgICAgaWYoIGZzbS0+bGFzdEVhcG9sICkKKyAgICAgICAgIHsKKyAgICAgICAgICAgICBhbmlBc2ZQYWNrZXRGcmVlKCBmc20tPmxhc3RFYXBvbCApOworICAgICAgICAgICAgIGZzbS0+bGFzdEVhcG9sID0gTlVMTDsKKworICAgICAgICAgICAgIHJldFZhbCA9IGFuaUFzZlBhY2tldEFsbG9jYXRlRXhwbGljaXQoJmZzbS0+bGFzdEVhcG9sLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUlNOX01BWF9QQUNLRVRfU0laRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVBUE9MX1RYX0hFQURFUl9TSVpFICk7CisjZW5kaWYgICAgIAorICAgICAgICAgICAgIGFuaUFzZlBhY2tldEVtcHR5RXhwbGljaXQoZnNtLT5sYXN0RWFwb2wsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRUFQT0xfVFhfSEVBREVSX1NJWkUpOworICAgICAgLy8gIH0KKworICAgICAgICBpZiAoMSkgCisgICAgICAgIHsKKworICAgICAgICAgICAgdm9zX21lbV96ZXJvKCAmdHhEZXNjLCBzaXplb2YodHhEZXNjKSApOworCisgICAgICAgICAgICAvLyBUaGUgS2V5IEluZm9ybWF0aW9uIGJpdHMuLi4KKyAgICAgICAgICAgIGlmIChmc20tPnN0YUN0eC0+cHdDaXBoZXJUeXBlID09IGVDU1JfRU5DUllQVF9UWVBFX0FFUykgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdHhEZXNjLmluZm8ua2V5RGVzY1ZlcnMgPSBBTklfRUFQT0xfS0VZX0RFU0NfVkVSU19BRVM7CisgICAgICAgICAgICB9IAorICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgdHhEZXNjLmluZm8ua2V5RGVzY1ZlcnMgPSBBTklfRUFQT0xfS0VZX0RFU0NfVkVSU19SQzQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB0eERlc2MuaW5mby51bmljYXN0RmxhZyA9IGVBTklfQk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lbmRHcm91cEtleUZvclJzbiAoIGtleURhdGEgKTsKKworICAgICAgICAgICAgaWYoICFBTklfSVNfU1RBVFVTX1NVQ0NFU1MoIHJldFZhbCApICkgYnJlYWs7CisKKyAgICAgICAgICAgIGdyb3VwS2V5TGVuID0gYW5pQXNmUGFja2V0R2V0Qnl0ZXMoa2V5RGF0YSwgJmdyb3VwS2V5Qnl0ZXMpOworICAgICAgICAgICAgaWYoICFBTklfSVNfU1RBVFVTX1NVQ0NFU1MoIGdyb3VwS2V5TGVuICkgKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByZXRWYWwgPSBBTklfRV9GQUlMRUQ7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHR4RGVzYy5pbmZvLnNlY3VyZUZsYWcgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgIHR4RGVzYy5pbmZvLmVuY0tleURhdGFGbGFnID0gZUFOSV9CT09MRUFOX1RSVUU7CisKKyAgICAgICAgICAgIGlmICggZnNtLT5zdGFDdHgtPnB3Q2lwaGVyVHlwZSA9PSBlQ1NSX0VOQ1JZUFRfVFlQRV9BRVMgKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAqIFVzZSB0aGUgQUVTIGtleSB3cmFwIGFsZ29yaXRobSBpZiBlaXRoZXIgb25lIG9mIHRoZSBwYWlyd2lzZQorICAgICAgICAgICAgICAgICAqIGtleSBvciB0aGUgZ3JvdXAga2V5IGlzIGFuIEFFUyBrZXkuCisgICAgICAgICAgICAgICAgICoKKyAgICAgICAgICAgICAgICAgKiBJZiB0aGUga2V5IGJlaW5nIHNlbnQgaXMgbm90IGEgbXVsdGlwbGUgb2YKKyAgICAgICAgICAgICAgICAgKiBBTklfU1NNX0FFU19LRVlfV1JBUF9CTE9DS19TSVpFLCB0aGVuIHBhZCBpdCB3aXRoCisgICAgICAgICAgICAgICAgICogemVyb2VzLiBlLmcuLCBpZiB3ZSBhcmUgc2VuZGluZyBhIFdFUCBrZXkgb2YgNSBvciAxMworICAgICAgICAgICAgICAgICAqIGJ5dGVzLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJBRVMgS2V5IFdyYXAgaW52b2tlZC4gZ3JvdXBLZXlMZW4gPSAlZCIsIGdyb3VwS2V5TGVuKTsKKworICAgICAgICAgICAgICAgIHBhZExlbiA9IGdyb3VwS2V5TGVuICUgQU5JX1NTTV9BRVNfS0VZX1dSQVBfQkxPQ0tfU0laRTsKKyAgICAgICAgICAgICAgICBpZiAocGFkTGVuICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgcGFkTGVuID0gQU5JX1NTTV9BRVNfS0VZX1dSQVBfQkxPQ0tfU0laRSAtIHBhZExlbjsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkJlZm9yZSBBRVMgS2V5IFdyYXA6IHBhZExlbiA9ICVkIiwgcGFkTGVuKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoZ3JvdXBLZXlMZW4gKyBwYWRMZW4gPiBzaXplb2YocGFkZGVkR3JvdXBLZXlFbmNhcHMpKSB7CisjaWYgMAorICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQ2Fubm90IGVuY29kZSBncm91cCBrZXkgZW5jYXBzdWxhdGlvbiBvZiBsZW4gJWQgYW5kIGNpcGhlciB0eXBlICVzICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInRvIHNlbmQgdG8gJXMgJXMgKGFpZCAlZCwgcmFkaW8gJWQsIHVzZXIgJXMpIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JvdXBLZXlMZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaVNzbUludEdldENpcGhlclN0cihBQUdfR1JPVVBfQ0lQSEVSKGZzbS0+Y3R4LT5yYWRpb0lkKSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmc20tPmN0eC0+YnBJbmRpY2F0b3IgPyAiQlAiIDogIlNUQSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmlBc2ZIZXhTdHIoZnNtLT5jdHgtPnN1cHBNYWMsIHNpemVvZih0QW5pTWFjQWRkcikpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmc20tPmN0eC0+YWlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmc20tPmN0eC0+cmFkaW9JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWFnR2V0U3RhVXNlcklkKGZzbS0+Y3R4KSk7CisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICByZXRWYWwgPSBBTklfRV9GQUlMRUQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgLy8gT0ssIGFmdGVyIHlvdSBjb21wdXRlIHRoZSBwYWQgbGVuZ3RoLCB5b3UgbmVlZCB0byAKKyAgICAgICAgICAgICAgICAgICAgLy8gYWRkIHRoZSBwYWRkaW5nICAtIDB4ZGQgZm9sbG93ZWQgYnkgMHgwMCdzCisgICAgICAgICAgICAgICAgICAgIGFkZFBhZCggZ3JvdXBLZXlCeXRlcyAsIGdyb3VwS2V5TGVuICwgcGFkTGVuICk7CisgICAgICAgICAgICAgICAgICAgIC8vIGFkZCB0aGUgcGFkZGluZyBsZW5ndGgKKyAgICAgICAgICAgICAgICAgICAgZ3JvdXBLZXlMZW4gKz0gcGFkTGVuOworICAgICAgICAgICAgICAgICAgICAvLyBJTU1FRElBVEVMWSBhZGp1c3QgdGhlIHBhY2tldCBzaXplIHRvIHJlZmxlY3QgdGhlIHBhZCAKKyAgICAgICAgICAgICAgICAgICAgYW5pQXNmUGFja2V0TW92ZVJpZ2h0KGtleURhdGEsIHBhZExlbik7IAorICAgICAgICAgICAgICAgICAgICBpZiggIUFOSV9JU19TVEFUVVNfU1VDQ0VTUyggcmV0VmFsKSApIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJCZWZvcmUgQUVTIEtleSBXcmFwOiBwYWRkZWQgZ3JvdXBLZXlMZW4gPSAlZCIsIGdyb3VwS2V5TGVuKTsKKworICAgICAgICAgICAgICAgIHJldFZhbCA9IGFuaVNzbUFlc0tleVdyYXAoZnNtLT5jcnlwdEhhbmRsZSwgZ3JvdXBLZXlCeXRlcywgZ3JvdXBLZXlMZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmc20tPnN0YUN0eC0+cHRrICsgQU5JX0VBUE9MX0tFWV9SU05fTUlDX1NJWkUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTklfRUFQT0xfS0VZX1JTTl9FTkNfS0VZX1NJWkUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmd3JhcHBlZEtleSk7CisgICAgICAgICAgICAgICAgaWYoICFBTklfSVNfU1RBVFVTX1NVQ0NFU1MoIHJldFZhbCkgKSBicmVhazsKKyAgICAgICAgICAgICAgICAvLyBUaGlzIGRvZXNuJ3Qgd29yay4uLgorICAgICAgICAgICAgICAgIC8vZ3JvdXBLZXlCeXRlcyA9IHdyYXBwZWRLZXk7CisgICAgICAgICAgICAgICAgLy9ncm91cEtleUxlbiArPSBBTklfU1NNX0FFU19LRVlfV1JBUF9CTE9DS19TSVpFOworICAgICAgICAgICAgICAgIC8vIC4uLmhlcmUgaXMgdGhlIHJpZ2h0IHdheSB0byBkbyBpdAorICAgICAgICAgICAgICAgIC8vIEFkZCB0aGUgbGVuZ3RoIG9mIHRoZSBwcmVwZW5kZWQgSVYgQVswXQorICAgICAgICAgICAgICAgIGlmIChOVUxMID09IHdyYXBwZWRLZXkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZ3JvdXBLZXlMZW4gKz0gQU5JX1NTTV9BRVNfS0VZX1dSQVBfQkxPQ0tfU0laRTsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoIGdyb3VwS2V5Qnl0ZXMsIHdyYXBwZWRLZXksIGdyb3VwS2V5TGVuKTsKKyAgICAgICAgICAgICAgICAvLyBGcmVlIHRoZSBhcnJheSB1c2VkIHRvIGhvbGQgdGhlIHdyYXBwZWQga2V5CisgICAgICAgICAgICAgICAgaWYgKHdyYXBwZWRLZXkpIHZvc19tZW1fZnJlZSggd3JhcHBlZEtleSk7CisgICAgICAgICAgICAgICAgLy8gSU1NRURJQVRFTFkgYWRqdXN0IHRoZSBwYWNrZXQgc2l6ZSB0byByZWZsZWN0IHRoZSBJViAKKyAgICAgICAgICAgICAgICBhbmlBc2ZQYWNrZXRNb3ZlUmlnaHQoa2V5RGF0YSwgQU5JX1NTTV9BRVNfS0VZX1dSQVBfQkxPQ0tfU0laRSk7CisgICAgICAgICAgICB9IAorICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICJBdXRoIFJDNCBLZXkgV3JhcCBpbnZva2VkLiBncm91cEtleUxlbiA9ICVkIiwgZ3JvdXBLZXlMZW4pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdHhEZXNjLmtleURhdGFMZW4gPSBhbmlBc2ZQYWNrZXRHZXRCeXRlcyhrZXlEYXRhLCAmdHhEZXNjLmtleURhdGEpOworCisgICAgICAgICAgICByZXRWYWwgPSBhbmlFYXBvbFdyaXRlS2V5KGZzbS0+Y3J5cHRIYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZzbS0+bGFzdEVhcG9sLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmc20tPnN0YUN0eC0+c3VwcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnNtLT5zdGFDdHgtPmF1dGhNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFOSV9FQVBPTF9LRVlfREVTQ19UWVBFX1JTTl9ORVcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ0eERlc2MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZzbS0+c3RhQ3R4LT5wdGssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENTUl9BRVNfS0VZX0xFTik7CisgICAgICAgICAgICBpZiggIUFOSV9JU19TVEFUVVNfU1VDQ0VTUyggcmV0VmFsKSApIGJyZWFrOworICAgICAgICB9IAorICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgIHJldHJhbnNtaXQgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgfQorCisgICAgICAgIGlmKCBWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIGJhcFJzblNlbmRFYXBvbEZyYW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TVA7CisgICAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICJBdXRoIGNhbm5vdCBnZW5lcmF0ZSBQVEsgZm9yIGludmFsaWQgYWxnb3JpdGhtICVkXG4iLAorICAgICAgICAgICAgICAgICAgICAgIGZzbS0+c3RhQ3R4LT5wd0NpcGhlclR5cGUpOworICAgICAgICByZXR1cm4gQU5JX0VfSUxMRUdBTF9BUkc7CisgICAgICAgIGJyZWFrOworICAgIH07CisKKyAgICByeERlc2MgPSAodEFuaUVhcG9sUnNuS2V5RGVzYyAqKSBkYXRhLT5rZXlEZXNjOworICAgIHJldHVybiBhYWdQdGtQcmYoZnNtLT5jcnlwdEhhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgIGZzbS0+c3RhQ3R4LT5wdGssCisgICAgICAgICAgICAgICAgICAgICBwcmZMZW4sCisgICAgICAgICAgICAgICAgICAgICBmc20tPnN0YUN0eC0+cG1rLAorICAgICAgICAgICAgICAgICAgICAgZnNtLT5zdGFDdHgtPmF1dGhNYWMsCisgICAgICAgICAgICAgICAgICAgICBmc20tPnN0YUN0eC0+c3VwcE1hYywKKyAgICAgICAgICAgICAgICAgICAgIGZzbS0+YU5vbmNlLAorICAgICAgICAgICAgICAgICAgICAgcnhEZXNjLT5rZXlOb25jZSk7Cit9CisKK3N0YXRpYyBpbnQgCitjaGVja01pYyh0QXV0aFJzbkZzbSAqZnNtLCAKKyAgICAgICAgIHRBbmlFYXBvbEtleUF2YWlsRXZlbnREYXRhICpkYXRhKQoreworICAgIGludCByZXRWYWw7CisKKyAgICByZXRWYWwgPSBhbmlFYXBvbEtleUNoZWNrTWljKGZzbS0+Y3J5cHRIYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLT5lYXBvbEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQU5JX0VBUE9MX0tFWV9ERVNDX1RZUEVfUlNOX05FVywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEtPmtleURlc2MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmc20tPnN0YUN0eC0+cHRrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1NSX0FFU19LRVlfTEVOKTsKKworICAgIGlmIChyZXRWYWwgPT0gQU5JX0VfTUlDX0ZBSUxFRCkgCisgICAgeworCisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICJBdXRoIGZhaWxlZCBFQVBPTC1NSUMgY2hlY2sgaW4gcGFpcndpc2Uga2V5IGV4Y2hhbmdlIVxuIik7IAorICAgIH0KKworICAgIHJldHVybiByZXRWYWw7Cit9CisKK3N0YXRpYyBpbnQgCitjaGVja0xvY2FsUmVwbGF5Q291bnRlcih0QXV0aFJzbkZzbSAqZnNtLCAKKyAgICAgICAgICAgICAgICAgICAgICAgIHRBbmlFYXBvbEtleUF2YWlsRXZlbnREYXRhICpkYXRhKQoreworICAgIGludCByZXRWYWwgPSBBTklfRV9OVUxMX1ZBTFVFOworICAgIGludCBjbXA7CisgICAgdEFuaUVhcG9sUnNuS2V5RGVzYyAqcnhEZXNjOworICAgIAorICAgIHJ4RGVzYyA9IGRhdGEtPmtleURlc2M7CisgICAgaWYoIHJ4RGVzYyApCisgICAgeworICAgICAgICBjbXAgPSBhbmlTc21SZXBsYXlDdHJDbXAoZnNtLT5zdGFDdHgtPmxvY2FsUmVwbGF5Q3RyLCByeERlc2MtPnJlcGxheUNvdW50ZXIpOworCisgICAgICAgIC8vIFRoZSBTVEEgc2hvdWxkIGhhdmUgc2VudCBiYWNrIHRoZSBzYW1lIHJlcGxheSBjdHIgYXMgaW4gb3VyIHJlcXVlc3QKKyAgICAgICAgaWYgKGNtcCAhPSAwKSAKKyAgICAgICAgeworICAgICAgICAgICAgcmV0VmFsID0gQU5JX0VfUkVQTEFZX0NIRUNLX0ZBSUxFRDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHJldFZhbCA9IEFOSV9PSzsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiByZXRWYWw7Cit9CisKK3N0YXRpYyAKK2ludCBjaGVja1BlZXJSZXBsYXlDb3VudGVyKHRBdXRoUnNuRnNtICpmc20sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFuaUVhcG9sS2V5QXZhaWxFdmVudERhdGEgKmRhdGEpCit7CisgICAgaW50IHJldFZhbCA9IEFOSV9FX05VTExfVkFMVUU7CisgICAgaW50IGNtcDsKKyAgICB0QW5pRWFwb2xSc25LZXlEZXNjICpyeERlc2M7CisgICAgCisgICAgcnhEZXNjID0gZGF0YS0+a2V5RGVzYzsKKyAgICBpZiggcnhEZXNjICkKKyAgICB7CisgICAgICAgIGNtcCA9IGFuaVNzbVJlcGxheUN0ckNtcChmc20tPnN0YUN0eC0+cGVlclJlcGxheUN0ciwgcnhEZXNjLT5yZXBsYXlDb3VudGVyKTsKKworICAgICAgICAvLyBUaGUgU1RBIHNob3VsZCBoYXZlIHNlbnQgYSBuZXdlciByZXBsYXkgY3RyIHRoYW4gaXRzIG9sZAorICAgICAgICAvLyByZXF1ZXN0LiBUaGUgZmlyc3QgbWVzc2FnZSBpcyBleGVtcHRlZCBmcm9tIHRoZSBjaGVjay4KKyAgICAgICAgaWYgKGZzbS0+c3RhQ3R4LT5wYXN0Rmlyc3RQZWVyUmVxdWVzdCAmJiBjbXAgPj0gMCkgCisgICAgICAgIHsKKyAgICAgICAgICAgIHJldFZhbCA9IEFOSV9FX1JFUExBWV9DSEVDS19GQUlMRUQ7CisgICAgICAgIH0KKworICAgICAgICBmc20tPnN0YUN0eC0+cGFzdEZpcnN0UGVlclJlcXVlc3QgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICB9CisKKyAgICByZXR1cm4gcmV0VmFsOworfQorCitzdGF0aWMgaW50IGNoZWNrSW5mb0VsZW1lbnQodEF1dGhSc25Gc20gKmZzbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QW5pRWFwb2xLZXlBdmFpbEV2ZW50RGF0YSAqZGF0YSkKK3sKKyAgICB0QW5pRWFwb2xSc25LZXlEZXNjICpkZXNjOworICAgIHZfVThfdCAqaWVTdGFCeXRlczsKKyAgICBpbnQgaWVTdGFMZW47CisKKyAgICBkZXNjID0gKHRBbmlFYXBvbFJzbktleURlc2MgKikgZGF0YS0+a2V5RGVzYzsKKyAgICBpZiggZGVzYyApCisgICAgeworICAgICAgICBpZVN0YUxlbiA9IGFuaUFzZlBhY2tldEdldEJ5dGVzKGZzbS0+c3RhQ3R4LT5pZVN0YSwgJmllU3RhQnl0ZXMpOworICAgICAgICBpZiggIUFOSV9JU19TVEFUVVNfU1VDQ0VTUyggaWVTdGFMZW4gKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHJldHVybiBpZVN0YUxlbjsKKyAgICAgICAgfQorCisgICAgICAgIGlmICgoZGVzYy0+a2V5RGF0YUxlbiAhPSBpZVN0YUxlbikgfHwKKyAgICAgICAgICAgICggIXZvc19tZW1fY29tcGFyZShkZXNjLT5rZXlEYXRhLCBpZVN0YUJ5dGVzLCBpZVN0YUxlbi0yKSApKSAKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICJBdXRoIFNUQSBzZW50IGluY29uc2lzdGVudCBSU04gSUUhXG4iKTsKKyAgICAgICAgICAgIHJldHVybiBBTklfRV9GQUlMRUQ7CisgICAgICAgIH0KKyAgICAgICAgLy8gQ29weSBSU04gSUUKKyAgICAgICAgLy92b3NfbWVtX2NvcHkoZnNtLT5hZHZlcnRpemVkUnNuSWUsIGRlc2MtPmtleURhdGEsIGllU3RhTGVuKTsKKyAgICAgICAgdm9zX21lbV9jb3B5KGZzbS0+YWR2ZXJ0aXplZFJzbkllLCBpZVN0YUJ5dGVzLCBpZVN0YUxlbik7CisKKyAgICAgICAgcmV0dXJuIEFOSV9PSzsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgcmV0dXJuIEFOSV9FX05VTExfVkFMVUU7CisgICAgfQorCit9CisKK3N0YXRpYyAKK2ludCBjaGVja1RyYW5zaXRpb24odEF1dGhSc25Gc20gKmZzbSwgdm9pZCAqYXJnKQoreworICAgIGludCByZXRWYWw7CisgICAgdEFuaUVhcG9sS2V5QXZhaWxFdmVudERhdGEgKmRhdGE7CisgICAgdEFuaUVhcG9sUnNuS2V5RGVzYyAqcnhEZXNjOworICAgIHRTaXJNaWNGYWlsdXJlSW5mbyAqbWljRmFpbHVyZUluZm87CisKKyAgICBpZiAoZnNtLT5kaXNjb25uZWN0KSAKKyAgICB7CisgICAgICAgIHN0b3BBbGxUaW1lcnMoZnNtKTsKKyAgICAgICAgZ290b1N0YXRlRGlzY29ubmVjdChmc20pOworICAgICAgICByZXR1cm4gQU5JX09LOworICAgIH0KKworICAgIGlmIChmc20tPmF1dGhSZXEpIAorICAgIHsKKyAgICAgICAgc3RvcEFsbFRpbWVycyhmc20pOworICAgICAgICBnb3RvU3RhdGVBdXRoZW50aWNhdGlvbihmc20pOworICAgICAgICByZXR1cm4gQU5JX09LOworICAgIH0KKworICAgIHN3aXRjaCAoZnNtLT5jdXJyZW50U3RhdGUpIAorICAgIHsKKyAgICBjYXNlIElOSVRJQUxJWkU6CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgQVVUSEVOVElDQVRJT046CisgICAgICAgIGdvdG9TdGF0ZUF1dGhlbnRpY2F0aW9uMihmc20pOworICAgICAgICBicmVhazsKKyAgICBjYXNlIEFVVEhFTlRJQ0FUSU9OXzI6CisgICAgICAgIGdvdG9TdGF0ZUdldFBzayggZnNtICk7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgR0VUX1BTSzoKKyAgICAgICAgLy9XZSBhbHdheXMgaGF2ZSBQTUsgb3RoZXJ3aXNlIEJBUCB3b24ndCBsZXQgdXMgaGVyZQorICAgICAgICBnb3RvU3RhdGVQdGtTdGFydChmc20pOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFBUS19TVEFSVDoKKyAgICAgICAgaWYgKCBmc20tPmVhcG9sQXZhaWwgKSAKKyAgICAgICAgeworICAgICAgICAgICAgZnNtLT5lYXBvbEF2YWlsID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgaWYgKE5VTEwgPT0gYXJnKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJhcmcgaXMgTlVMTCwgZXhpdGluZyBjaGVja1RyYW5zaXRpb24oKSIpOworICAgICAgICAgICAgICAgIHJldHVybiBBTklfRV9GQUlMRUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBkYXRhID0gKHRBbmlFYXBvbEtleUF2YWlsRXZlbnREYXRhICopIGFyZzsKKyAgICAgICAgICAgIHJldFZhbCA9IGNoZWNrTG9jYWxSZXBsYXlDb3VudGVyKGZzbSwgZGF0YSk7CisgICAgICAgICAgICBpZiAocmV0VmFsICE9IEFOSV9PSykKKyAgICAgICAgICAgICAgICByZXR1cm4gQU5JX09LOyAvLyBDYWxsZXIgc2hvdWxkIG5vdCBmYWlsCisgICAgICAgICAgICByZXRWYWwgPSBkZXJpdmVQdGsoZnNtLCBkYXRhKTsKKyAgICAgICAgICAgIGlmKCAhQU5JX0lTX1NUQVRVU19TVUNDRVNTKCByZXRWYWwgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICJBdXRoIGRlcml2ZVB0ayBmYWlsZWQgd2l0aCBjb2RlICVkIVxuIiwgcmV0VmFsKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gcmV0VmFsOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0VmFsID0gY2hlY2tNaWMoZnNtLCBkYXRhKTsKKyAgICAgICAgICAgIGlmIChyZXRWYWwgIT0gQU5JX09LKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBiYXBBdXRoRGlzY29ubmVjdCggZnNtLT5jdHggKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gcmV0VmFsOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0VmFsID0gZ290b1N0YXRlUHRrSW5pdE5lZ28oZnNtLCBhcmcpOworICAgICAgICB9IAorICAgICAgICBlbHNlIGlmICggZnNtLT5tc2cyVGltZU91dCApIAorICAgICAgICB7CisgICAgICAgICAgICBpZiAoZnNtLT5udW1UcmllcyA8PSBhdXRoQ29uc3RzLm1heFRyaWVzKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJBdXRoIFJldHJhbnNtaXR0aW5nIEVBUE9MLUtleSBNc2cxXG4iKTsKKyAgICAgICAgICAgICAgICAvLyBTdGF5IGluIHRoZSBzYW1lIHN0YXRlIGJ1dCByZXBlYXQgYWN0aW9ucworICAgICAgICAgICAgICAgIGdvdG9TdGF0ZVB0a1N0YXJ0KGZzbSk7CisgICAgICAgICAgICB9IAorICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQXV0aCBmYWlsZWQgdG8gcmVjdiBFQVBPTC1LZXkgTXNnMiAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJEaXNjb25uZWN0aW5nLi4uXG4iKTsKKworICAgICAgICAgICAgICAgIGdvdG9TdGF0ZURpc2Nvbm5lY3QoZnNtKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICBjYXNlIFBUS19JTklUX05FR086CisgICAgICAgIGlmIChOVUxMID09IGFyZykKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiYXJnIGlzIE5VTEwsIGV4aXRpbmcgY2hlY2tUcmFuc2l0aW9uKCkiKTsKKyAgICAgICAgICAgIHJldHVybiBBTklfRV9GQUlMRUQ7CisgICAgICAgIH0KKyAgICAgICAgZGF0YSA9ICh0QW5pRWFwb2xLZXlBdmFpbEV2ZW50RGF0YSAqKSBhcmc7CisgICAgICAgIHJldFZhbCA9IGNoZWNrSW5mb0VsZW1lbnQoZnNtLCBkYXRhKTsKKyAgICAgICAgaWYgKHJldFZhbCAhPSBBTklfT0spIAorICAgICAgICB7CisgICAgICAgICAgICBnb3RvU3RhdGVEaXNjb25uZWN0KGZzbSk7CisgICAgICAgIH0gCisgICAgICAgIGVsc2UgeworICAgICAgICAgICAgZ290b1N0YXRlUHRrSW5pdE5lZ29UeChmc20pOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgUFRLX0lOSVRfTkVHT19UWDoKKyAgICAgICAgaWYgKGZzbS0+ZWFwb2xBdmFpbCkgCisgICAgICAgIHsKKyAgICAgICAgICAgIGZzbS0+ZWFwb2xBdmFpbCA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgIGlmIChOVUxMID09IGFyZykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiYXJnIGlzIE5VTEwsIGV4aXRpbmcgY2hlY2tUcmFuc2l0aW9uKCkiKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gQU5JX0VfRkFJTEVEOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZGF0YSA9ICh0QW5pRWFwb2xLZXlBdmFpbEV2ZW50RGF0YSAqKSBhcmc7CisgICAgICAgICAgICByZXRWYWwgPSBjaGVja0xvY2FsUmVwbGF5Q291bnRlcihmc20sIGRhdGEpOworICAgICAgICAgICAgaWYgKHJldFZhbCAhPSBBTklfT0spCisgICAgICAgICAgICAgICAgcmV0dXJuIEFOSV9PSzsgLy8gQ2FsbGVyIHNob3VsZCBub3QgZmFpbAorICAgICAgICAgICAgcmV0VmFsID0gY2hlY2tNaWMoZnNtLCBkYXRhKTsKKyAgICAgICAgICAgIGlmIChyZXRWYWwgIT0gQU5JX09LKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBiYXBBdXRoRGlzY29ubmVjdCggZnNtLT5jdHggKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gcmV0VmFsOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0VmFsID0gZ290b1N0YXRlUHRrSW5pdERvbmUoZnNtLCBkYXRhKTsKKyAgICAgICAgfSBlbHNlIGlmICggZnNtLT5tc2c0VGltZU91dCApIAorICAgICAgICB7CisgICAgICAgICAgICBpZiAoZnNtLT5udW1UcmllcyA8PSBhdXRoQ29uc3RzLm1heFRyaWVzKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJBdXRoIHJldHJhbnNtaXR0aW5nIEVBUE9MLUtleSBNc2czIFxuIik7CisgICAgICAgICAgICAgICAgLy8gU3RheSBpbiB0aGUgc2FtZSBzdGF0ZSBidXQgcmVwZWF0IGFjdGlvbnMKKyAgICAgICAgICAgICAgICBnb3RvU3RhdGVQdGtJbml0TmVnb1R4KGZzbSk7CisgICAgICAgICAgICB9IAorICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQXV0aCBmYWlsZWQgdG8gcmVjdiBFQVBPTC1LZXkgTXNnNCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJEaXNjb25uZWN0aW5nLi4uXG4iICk7CisKKyAgICAgICAgICAgICAgICBnb3RvU3RhdGVEaXNjb25uZWN0KGZzbSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBQVEtfSU5JVF9ET05FOgorICAgICAgICBpZiAoZnNtLT5lYXBvbEF2YWlsKSB7CisKKyAgICAgICAgICAgIGZzbS0+ZWFwb2xBdmFpbCA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgIGlmIChOVUxMID09IGFyZykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiYXJnIGlzIE5VTEwsIGV4aXRpbmcgY2hlY2tUcmFuc2l0aW9uKCkiKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gQU5JX0VfRkFJTEVEOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZGF0YSA9ICh0QW5pRWFwb2xLZXlBdmFpbEV2ZW50RGF0YSAqKSBhcmc7CisgICAgICAgICAgICByeERlc2MgPSAodEFuaUVhcG9sUnNuS2V5RGVzYyAqKSBkYXRhLT5rZXlEZXNjOworCisgICAgICAgICAgICBpZiAocnhEZXNjLT5pbmZvLnJlcXVlc3RGbGFnKSAKKyAgICAgICAgICAgIHsKKworICAgICAgICAgICAgICAgIHJldFZhbCA9IGNoZWNrUGVlclJlcGxheUNvdW50ZXIoZnNtLCBkYXRhKTsKKyAgICAgICAgICAgICAgICBpZiAocmV0VmFsICE9IEFOSV9PSykKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEFOSV9PSzsgLy8gQ2FsbGVyIHNob3VsZCBub3QgZmFpbAorCisgICAgICAgICAgICAgICAgcmV0VmFsID0gY2hlY2tNaWMoZnNtLCBkYXRhKTsKKyAgICAgICAgICAgICAgICBpZiAocmV0VmFsICE9IEFOSV9PSykgCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBiYXBBdXRoRGlzY29ubmVjdCggZnNtLT5jdHgtPnB2b3NHQ3R4ICk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXRWYWw7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgcmV0VmFsID0gZ290b1N0YXRlVXBkYXRlS2V5c1JlcShmc20sIGFyZyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gCisgICAgICAgIGVsc2UgaWYgKGZzbS0+aW50ZWdGYWlsZWQpIHsKKworICAgICAgICAgICAgbWljRmFpbHVyZUluZm8gPSAodFNpck1pY0ZhaWx1cmVJbmZvICopIGFyZzsKKyAgICAgICAgICAgIGdvdG9TdGF0ZUludGVnRmFpbHVyZShmc20sIGFyZyk7CisKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICBjYXNlIFVQREFURV9LRVlTX1JFUToKKworICAgICAgICBpZiAoTlVMTCA9PSBhcmcpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgImFyZyBpcyBOVUxMLCBleGl0aW5nIGNoZWNrVHJhbnNpdGlvbigpIik7CisgICAgICAgICAgICByZXR1cm4gQU5JX0VfRkFJTEVEOworICAgICAgICB9CisgICAgICAgIGRhdGEgPSAodEFuaUVhcG9sS2V5QXZhaWxFdmVudERhdGEgKikgYXJnOworICAgICAgICByeERlc2MgPSAodEFuaUVhcG9sUnNuS2V5RGVzYyAqKSBkYXRhLT5rZXlEZXNjOworCisgICAgICAgIGlmIChyeERlc2MtPmluZm8uZXJyb3JGbGFnKSAKKyAgICAgICAgeworCisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogVGhpcyB3YXMgZ2VuZXJhdGVkIGJ5IGEgdW5pY2FzdCBwYWNrZXQgc2VudCBmcm9tIHRoZSBBUCB0byB0aGUgU1RBL0JQLgorICAgICAgICAgICAgICogVGhlIFRYIGFkZHJlc3MgaXMgdGhlIEFQJ3MgYWRkcmVzcy4gVGhlIHNyYyBhZGRyZXNzIGlzIGxvc3QuCisgICAgICAgICAgICAgKiBJZiB0aGUgU1RBIGlzIGEgQlAsIHRoZW4gdGhlIHRydWUgZHN0IGlzIGxvc3QuIFdlIHdpbGwgdHJlYXQKKyAgICAgICAgICAgICAqIHRoZSBkc3QgZmllbGQgYXMgdGhlIGFkZHJlc3Mgb2YgdGhlIHJlcG9ydGVyIG9mIHRoZSBNSUMgZmFpbHVyZS4KKyAgICAgICAgICAgICAqLworCisgICAgICAgICAgICBtaWNGYWlsdXJlSW5mbyA9ICh0U2lyTWljRmFpbHVyZUluZm8gKikgdm9zX21lbV9tYWxsb2MoIHNpemVvZih0U2lyTWljRmFpbHVyZUluZm8pICk7CisgICAgICAgICAgICBpZiggTlVMTCA9PSBtaWNGYWlsdXJlSW5mbyApCisgICAgICAgICAgICB7C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GxvY2FsIGFOb25jZSBhbmQgbG9jYWwgcmVwbHlDdHIgbm90IGluY3JlbWVudGVkIGluIHNwZWM/CisgICAgICAgICAgICBnb3RvU3RhdGVQdGtTdGFydChmc20pOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgSU5URUdfRkFJTFVSRToKKyAgICAgICAgZ290b1N0YXRlS2V5VXBkYXRlKGZzbSk7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgS0VZX1VQREFURToKKyAgICAgICAgZ290b1N0YXRlUHRrU3RhcnQoZnNtKTsKKyAgICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgIk5vdGhpbmcgdG8gZG8gaW4gdGhpcyBzdGF0ZSBmb3IgQXV0aFJzbkZzbTogJWRcbiIsCisgICAgICAgICAgICAgICAgICAgICAgZnNtLT5jdXJyZW50U3RhdGUpOworICAgICAgICAvLyBDYXRjaCBhbGwgZm9yIHN0YXRlcyB0aGF0IG5lZWQgbm8gY2hhbmdlOgorICAgICAgICAvLyAgICAgICAgYXNzZXJ0KGVBTklfQk9PTEVBTl9GQUxTRSAmJiAiSWxsZWdhbCBBdXRoUnNuRnNtIHN0YXRlISIpOworICAgICAgICByZXR1cm4gQU5JX0VfRkFJTEVEOworICAgIH0KKworICAgIHJldHVybiBBTklfT0s7Cit9CisKKworc3RhdGljIHZvaWQgbXNnMlRpbWVyQ2FsbGJhY2soIHZvaWQgKnB2ICkKK3sKKyAgICB0QXV0aFJzbkZzbSAqZnNtID0gKHRBdXRoUnNuRnNtICopcHY7CisgICAgaWYgKE5VTEwgPT0gZnNtKSAKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICJmc20gaXMgTlVMTCBpbiAlcyIsIF9fZnVuY19fKTsKKworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgLy9Pbmx5IHdoZW4gd2FpdGluZyBmb3IgbXNnMgorICAgIGlmKCBQVEtfU1RBUlQgPT0gZnNtLT5jdXJyZW50U3RhdGUgKQorICAgIHsKKyAgICAgICAgZnNtLT5tc2cyVGltZU91dCA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgIH0KKyAgICAvL1dlIG1heSBuZWVkIHRvIHN5bmNocm9uaXplIHRoaXMgY2FsbAorICAgIGF1dGhSc25Gc21Qcm9jZXNzRXZlbnQoIGZzbSwgUlNOX0ZTTV9USU1FUl9FWFBJUkVELCBOVUxMICk7Cit9CisKK3N0YXRpYyB2b2lkIG1zZzRUaW1lckNhbGxiYWNrKCB2b2lkICpwdiApCit7CisgICAgdEF1dGhSc25Gc20gKmZzbSA9ICh0QXV0aFJzbkZzbSAqKXB2OworICAgIGlmIChOVUxMID09IGZzbSkgCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAiZnNtIGlzIE5VTEwgaW4gJXMiLCBfX2Z1bmNfXyk7CisKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIC8vT25seSB3aGVuIHdlIGFyZSB3YWl0aW5nIGZvciBtc2c0CisgICAgaWYoIFBUS19JTklUX05FR09fVFggPT0gZnNtLT5jdXJyZW50U3RhdGUgKQorICAgIHsKKyAgICAgICAgZnNtLT5tc2c0VGltZU91dCA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgIH0KKyAgICAvL1dlIG1heSBuZWVkIHRvIHN5bmNocm9uaXplIHRoaXMgY2FsbAorICAgIGF1dGhSc25Gc21Qcm9jZXNzRXZlbnQoIGZzbSwgUlNOX0ZTTV9USU1FUl9FWFBJUkVELCBOVUxMICk7Cit9CisKKworLy8KKy8vVGhpcyBmdW5jdGlvbiBhbHdhc3kgYXNzdW1lIHRoZSBpbmNvbWluZyB2b3NfcGFja2V0IGlzIDgwMl8zIGZyYW1lLgorc3RhdGljIGludCBhdXRoUnNuUnhGcmFtZUhhbmRsZXIoIHZfUFZPSURfdCBwdm9zR0N0eCwgdm9zX3BrdF90ICpwUGFja2V0ICkKK3sKKyAgICBpbnQgcmV0VmFsID0gQU5JX0VSUk9SOworICAgIHRBbmlQYWNrZXQgKnBBbmlQYWNrZXQ7CisgICAgdEJ0YW1wQ29udGV4dCAqY3R4OworICAgIHRBdXRoUnNuRnNtICpmc207CisKKyAgICAvKiBWYWxpZGF0ZSBwYXJhbXMgKi8gCisgICAgaWYgKChwdm9zR0N0eCA9PSBOVUxMKSB8fCAoTlVMTCA9PSBwUGFja2V0KSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICJwYXJhbSBpcyBOVUxMIGluICVzIiwgX19mdW5jX18pOworCisgICAgICAgIHJldHVybiByZXRWYWw7CisgICAgfQorCisgICAgY3R4ID0gKHRCdGFtcENvbnRleHQgKilWT1NfR0VUX0JBUF9DQiggcHZvc0dDdHggKTsKKyAgICBpZiAoTlVMTCA9PSBjdHgpIAorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgImN0eCBpcyBOVUxMIGluICVzIiwgX19mdW5jX18pOworCisgICAgICAgIHJldHVybiByZXRWYWw7CisgICAgfQorCisgICAgZnNtID0gJmN0eC0+dUZzbS5hdXRoRnNtOworICAgIGlmIChOVUxMID09IGZzbSkgCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJ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R1cm5fcGFja2V0KCBwUGFja2V0ICk7CisKKyAgICByZXR1cm4gcmV0VmFsOworfQorCisKK3N0YXRpYyBpbnQgYXV0aFJzblR4Q29tcGxldGVIYW5kbGVyKCB2X1BWT0lEX3QgcHZvc0dDdHgsIHZvc19wa3RfdCAqcFBhY2tldCwgVk9TX1NUQVRVUyByZXRTdGF0dXMgKQoreworICAgIHRCdGFtcENvbnRleHQgKmN0eCA9ICh0QnRhbXBDb250ZXh0ICopVk9TX0dFVF9CQVBfQ0IoIHB2b3NHQ3R4ICk7CisgICAgdEF1dGhSc25Gc20gKmZzbTsKKworICAgIHZvc19wa3RfcmV0dXJuX3BhY2tldCggcFBhY2tldCApOworICAgIGlmIChOVUxMID09IGN0eCkgCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAiY3R4IGlzIE5VTEwgaW4gJXMiLCBfX2Z1bmNfXyk7CisKKyAgICAgICAgcmV0dXJuIEFOSV9FUlJPUjsKKyAgICB9CisKKyAgICBmc20gPSAmY3R4LT51RnNtLmF1dGhGc207CisgICAgaWYgKE5VTEwgPT0gZnNtKSAKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICJmc20gaXMgTlVMTCBpbiAlcyIsIF9fZnVuY19fKTsKKworICAgICAgICByZXR1cm4gQU5JX0VSUk9SOworICAgIH0KKworICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIHJldFN0YXR1cyApICkKKyAgICB7CisgICAgICAgIC8vTm8gbmVlZCB0byBkbyBhbnl0aGluZy4gUmV0cmFuc21pdCBpcyBoYW5kbGVkIGJ5IHRpbWVvdXQKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgIkF1dGg6IFRMIFR4IGNvbXBsZXRlIHdpdGggZXJyb3IgJWQgY3VycmVudCBzdGF0ZSBpcyAlZCBcbiIsIHJldFN0YXR1cywgZnNtLT5jdXJyZW50U3RhdGUgKTsKKyAgICB9CisgICAgaWYoIFBUS19TVEFSVCA9PSBmc20tPmN1cnJlbnRTdGF0ZSApCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICIgQXV0aDogc3RhcnQgbXNnMiB0aW1lclxuIiApOworICAgICAgICAvL1N0YXJ0IG1zZzJUaW1lcgorICAgICAgICBmc20tPm51bVRyaWVzKys7CisgICAgICAgIHZvc190aW1lcl9zdG9wKCAmZnNtLT5tc2cyVGltZXIgKTsKKyAgICAgICAgdm9zX3RpbWVyX3N0YXJ0KCZmc20tPm1zZzJUaW1lciwgYXV0aENvbnN0cy50aW1lb3V0UGVyaW9kKTsKKyAgICB9CisgICAgZWxzZSBpZiggKCBQVEtfSU5JVF9ORUdPID09IGZzbS0+Y3VycmVudFN0YXRlICkgfHwgCisgICAgICAgICggUFRLX0lOSVRfTkVHT19UWCA9PSBmc20tPmN1cnJlbnRTdGF0ZSApICkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgIiBBdXRoOiBzdGFydCBtc2c0IHRpbWVyXG4iICk7CisgICAgICAgIGZzbS0+bnVtVHJpZXMrKzsKKyAgICAgICAgdm9zX3RpbWVyX3N0b3AoICZmc20tPm1zZzRUaW1lciApOworICAgICAgICB2b3NfdGltZXJfc3RhcnQoJmZzbS0+bXNnNFRpbWVyLCBhdXRoQ29uc3RzLnRpbWVvdXRQZXJpb2QpOworICAgIH0KKworICAgIHJldHVybiBBTklfT0s7Cit9CisKKworc3RhdGljIGludAorYXV0aEVhcG9sS2V5SGFuZGxlciggdEF1dGhSc25Gc20gKmZzbSwgdEFuaVBhY2tldCAqZWFwb2xGcmFtZSwgdEFuaU1hY0FkZHIgc3RhTWFjICkKK3sKKyAgICBpbnQgcmV0VmFsOworCisgICAgaW50IGRlc2NUeXBlOworICAgIHZvaWQgKmtleURlc2M7CisgICAgdEFuaUVhcG9sUnNuS2V5RGVzYyAqcnNuRGVzYzsKKyAgICB0QW5pRWFwb2xLZXlBdmFpbEV2ZW50RGF0YSBkYXRhOworCisgICAgZG8KKyAgICB7CisgICAgICAgIHJldFZhbCA9IGFuaUVhcG9sUGFyc2VLZXkoZWFwb2xGcmFtZSwgJmRlc2NUeXBlLCAma2V5RGVzYyk7CisgICAgICAgIGlmKCAhQU5JX0lTX1NUQVRVU19TVUNDRVNTKCByZXRWYWwgKSApIGJyZWFrOworCisgICAgICAgIGlmICgoZGVzY1R5cGUgPT0gQU5JX0VBUE9MX0tFWV9ERVNDX1RZUEVfUlNOX05FVykgCisgICAgICAgICAgICAgICAgfHwgKGRlc2NUeXBlID09IEFOSV9FQVBPTF9LRVlfREVTQ19UWVBFX1JTTikpIAorICAgICAgICB7CisgICAgICAgICAgICByc25EZXNjID0gKHRBbmlFYXBvbFJzbktleURlc2MgKikga2V5RGVzYzsKKyAgICAgICAgICAgIGRhdGEua2V5RGVzYyA9IGtleURlc2M7CisgICAgICAgICAgICBkYXRhLmVhcG9sRnJhbWUgPSBlYXBvbEZyYW1lOworICAgICAgICAgICAgLy8gUGFzcyBvbiB0aGUgZXZlbnQgdG8gdGhlIFJTTiBGU00gb25seSBpZiBpdCBpcyBmb3IgYSBwYWlyd2lzZSBrZXkKKyAgICAgICAgICAgIGlmIChyc25EZXNjLT5pbmZvLnVuaWNhc3RGbGFnKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByZXRWYWwgPSBhdXRoUnNuRnNtUHJvY2Vzc0V2ZW50KGZzbSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSU05fRlNNX0VBUE9MX0ZSQU1FX0FWQUlMQUJMRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZkYXRhKTsKKyAgICAgICAgICAgIH0gCisgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAvL05vdCB3b3JyeSBhYm91dCBHVEsgc3R1ZmYKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSAKKyAgICAgICAgZWxzZSB7CisKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIkdvdCB1bmV4cGVjdGVkIGxlZ2FjeSA4MDIuMXggUkM0IEtleSBtZXNzYWdlIFxuIiApOworICAgICAgICAgICAgcmV0VmFsID0gQU5JX0VfRkFJTEVEOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9d2hpbGUoIDAgKTsKKworICAgIGFuaUVhcG9sS2V5RnJlZURlc2MoZGVzY1R5cGUsIGtleURlc2MpOworICAgIHJldHVybiByZXRWYWw7Cit9CisKKwordm9pZCBhdXRoRWFwb2xIYW5kbGVyKCB0QXV0aFJzbkZzbSAqZnNtLCB0QW5pUGFja2V0ICplYXBvbEZyYW1lLAorICAgICAgICAgICAgICAgICB0QW5pTWFjQWRkciBkc3RNYWMsIAorICAgICAgICAgICAgICAgICB0QW5pTWFjQWRkciBzcmNNYWMsCisgICAgICAgICAgICAgICAgIHZfVThfdCAqdHlwZSkKK3sKKyAgICBzd2l0Y2ggKCp0eXBlKSAKKyAgICB7CisgICAgY2FzZSBBTklfRUFQT0xfVFlQRV9TVEFSVDoKKyAgICAgICAgLy9ObyBkb2luZyBhbnl0aGluZyBiZWNhdXNlIHdlIG9ubHkgc3VwcG9ydCBXUEEyLVBTS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KKyAgICAgICAgICB0QW5pTWFjQWRkciBzdXBwQWRkciwKKyAgICAgICAgICB2X1U4X3QgYU5vbmNlW0FOSV9FQVBPTF9LRVlfUlNOX05PTkNFX1NJWkVdLAorICAgICAgICAgIHZfVThfdCBzTm9uY2VbQU5JX0VBUE9MX0tFWV9SU05fTk9OQ0VfU0laRV0pCit7CisgICAgdl9VOF90ICpsb3dNYWM7CisgICAgdl9VOF90ICpoaWdoTWFjOworICAgIHZfVThfdCAqbG93Tm9uY2U7CisgICAgdl9VOF90ICpoaWdoTm9uY2U7CisKKyAgICB2X1U4X3QgKmtleUJ5dGVzOworICAgIGludCBrZXlMZW47CisKKyAgICB2X1U4X3QgdGV4dFtBQUdfUFRLX1BSRl9URVhUX0xFTl07CisKKyAgICAvL0Nhbm5vdCB1c2Ugdm9zcyBmdW5jdGlvbiBoZXJlIGJlY2F1c2Ugdm9zX21lbV9jb21wYXJlIGRvZXNuJ3QgdGVsbCB3aGloYyBpcyBsYXJnZXIKKyAgICBpZiAodm9zX21lbV9jb21wYXJlMihhdXRoQWRkciwgc3VwcEFkZHIsIHNpemVvZih0QW5pTWFjQWRkcikpIDwgMCkgeworICAgICAgICBsb3dNYWMgPSBhdXRoQWRkcjsKKyAgICAgICAgaGlnaE1hYyA9IHN1cHBBZGRyOworICAgIH0gZWxzZSB7CisgICAgICAgIGxvd01hYyA9IHN1cHBBZGRyOworICAgICAgICBoaWdoTWFjID0gYXV0aEFkZHI7CisgICAgfQorCisgICAgaWYgKHZvc19tZW1fY29tcGFyZTIoYU5vbmNlLCBzTm9uY2UsIEFOSV9FQVBPTF9LRVlfUlNOX05PTkNFX1NJWkUpIDwgMCkgeworICAgICAgICBsb3dOb25jZSA9IGFOb25jZTsKKyAgICAgICAgaGlnaE5vbmNlID0gc05vbmNlOworICAgIH0gZWxzZSB7CisgICAgICAgIGxvd05vbmNlID0gc05vbmNlOworICAgICAgICBoaWdoTm9uY2UgPSBhTm9uY2U7CisgICAgfQorCisgICAgdm9z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FhZ1ByZih2X1UzMl90IGNyeXB0SGFuZGxlLAorICAgICAgIHZfVThfdCByZXN1bHRbQUFHX1BSRl9NQVhfT1VUUFVUX1NJWkVdLAorICAgICAgIHZfVThfdCAqa2V5LCB2X1U4X3Qga2V5TGVuLAorICAgICAgIHZfVThfdCAqYSwgdl9VOF90IGFMZW4sCisgICAgICAgdl9VOF90ICpiLCB2X1U4X3QgYkxlbiwKKyAgICAgICB2X1UzMl90IHByZkxlbikKK3sKKyAgICBzdGF0aWMgdl9VOF90IHk7CisKKyAgICB2X1U4X3QgKmhtYWNUZXh0ID0gTlVMTDsKKyAgICB2X1U4X3QgKnJlc3VsdE9mZnNldCA9IHJlc3VsdDsKKyAgICBpbnQgbnVtTG9vcHM7CisgICAgaW50IGxvb3BDdHJQb3M7CisgICAgaW50IGksIHJldFZhbD0wOworCisgICAgaG1hY1RleHQgPSB2b3NfbWVtX21hbGxvYyggYUxlbiArIGJMZW4gKyAyICk7CisgICAgaWYoIE5VTEwgPT0gaG1hY1RleHQgKQorICAgIHsKKyAgICAgICAgcmV0dXJuIEFOSV9FX05VTExfVkFMVUU7CisgICAgfQorCisgICAgdm9zX21lbV9jb3B5KGhtYWNUZXh0ICsgMCwgYSwgYUxlbik7CisgICAgaG1hY1RleHRbYUxlbl0gPSB5OworICAgIHZvc19tZW1fY29weShobWFjVGV4dCArIGFMZW4gKyAxLCBiLCBiTGVuKTsKKyAgICBsb29wQ3RyUG9zID0gYUxlbiArIDEgKyBiTGVuOworCisgICAgbnVtTG9vcHMgPSBwcmZMZW4gKyBBQUdfUFRLX1BSRl9BRERfUEFSQU07CisgICAgbnVtTG9vcHMgLz0gQUFHX1BUS19QUkZfRElWX1BBUkFNOworCisgICAgZm9yIChpID0gMDsgaSA8IG51bUxvb3BzOyBpKyspIAorICAgIHsKKyAgICAgICAgVk9TX0FTU0VSVCgocmVzdWx0T2Zmc2V0IC0gcmVzdWx0ICsgVk9TX0RJR0VTVF9TSEExX1NJWkUpCisgICAgICA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NkZWZpbmUgSU5JVElBTElaRSAgICAgICAgICAgMAorI2RlZmluZSBBVVRIRU5USUNBVElPTiAgICAgICAxCisjZGVmaW5lIEdPVF9QTUsgICAgICAgICAgICAgIDIKKyNkZWZpbmUgU1RBX0tFWV9TVEFSVCAgICAgICAgMworI2RlZmluZSBTVEFfS0VZX1NFVCAgICAgICAgICA0CisjZGVmaW5lIEtFWV9VUERBVEUgICAgICAgICAgIDUgICAKKyNkZWZpbmUgUkVLRVlfTVNHICAgICAgICAgICAgNgorI2RlZmluZSBHUk9VUF9LRVlfU0VUICAgICAgICA3CisjZGVmaW5lIE5VTV9TVEFURVMgKEdST1VQX0tFWV9TRVQgKyAxKQorCisKK3N0YXRpYyB0U3VwcFJzbkZzbUNvbnN0cyBzdXBwQ29uc3RzID0geyAyMDAwLCAzIH07ICAgIC8vdGltZW91dCwgcmV0cnkgbGltaXQKKworaW50IGdSZWFkVG9TZXRLZXk7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogU3RhdGljIGZ1bmN0aW9ucyBpbiB0aGlzIG1vZHVsZQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgCitpbnQgemVyb091dFB0ayh0U3VwcFJzbkZzbSAqZnNtKTsKKworc3RhdGljCitpbnQgY2hlY2tNaWModFN1cHBSc25Gc20gKmZzbSwgCisgICAgICAgICAgICAgdEFuaUVhcG9sS2V5QXZhaWxFdmVudERhdGEgKmRhdGEsCisgICAgICAgICAgICAgdl9CT09MX3QgcHdLZXlFeGNoYW5nZSk7CisKK3N0YXRpYyBpbnQgY2hlY2tJbmZvRWxlbWVudCh0U3VwcFJzbkZzbSAqZnNtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBbmlFYXBvbEtleUF2YWlsRXZlbnREYXRhICpkYXRhKTsKKworc3RhdGljCitpbnQgY2hlY2tQZWVyUmVwbGF5Q291bnRlcih0U3VwcFJzbkZzbSAqZnNtLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBbmlFYXBvbEtleUF2YWlsRXZlbnREYXRhICpkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9CT09MX3QgKnJldHJhbnNtaXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB2X0JPT0xfdCBhY3R1YWxNaWNGbGFnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9CT09MX3QgcmVUeE1pY0ZsYWcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICk7CisKK3N0YXRpYworaW50IGRlcml2ZVB0ayh0U3VwcFJzbkZzbSAqZnNtLCAKKyAgICAgICAgICAgICAgdEFuaUVhcG9sS2V5QXZhaWxFdmVudERhdGEgKmRhdGEpOworCitzdGF0aWMgCitpbnQgY2hlY2tUcmFuc2l0aW9uKHRTdXBwUnNuRnNtICpmc20sIHZvaWQgKmFyZyk7CisKK3N0YXRpYyBpbnQKK2dvdG9TdGF0ZUluaXQodFN1cHBSc25Gc20gKmZzbSk7CisKK3N0YXRpYyBpbnQgc3VwcFJzblJ4RnJhbWVIYW5kbGVyKCB2X1BWT0lEX3QgcHZvc0dDdHgsIHZvc19wa3RfdCAqcFBhY2tldCApOworc3RhdGljIGludCBzdXBwUnNuVHhDb21wbGV0ZUhhbmRsZXIoIHZfUFZPSURfdCBwdm9zR0N0eCwgdm9zX3BrdF90ICpwUGFja2V0LCBWT1NfU1RBVFVTIHJldFN0YXR1cyApOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKgorICogSW50ZXJuYWwgRnVuY3Rpb25zCisgKioqKioqKioqKioqKioqKioqKioqKioqKi8KK2ludCBzdXBwUnNuQXV0aFN0YXJ0RXZlbnRIYW5kbGVyKHRTdXBwUnNuRnNtICpmc20pOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKgorICogVGhlIGV4cG9ydGVkIGZ1bmN0aW9ucworICoqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qKgorICogc3VwcFJzbkZ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orc3VwcFJzbkZzbUNyZWF0ZSh0QnRhbXBDb250ZXh0ICpjdHgpCit7CisgICAgaW50IHJldFZhbCA9IEFOSV9PSzsKKyAgICB0U3VwcFJzbkZzbSAqZnNtID0gJmN0eC0+dUZzbS5zdXBwRnNtOworCisgICAgLy8gRmlyc3QsIGNsZWFyIGV2ZXJ5dGhpbmcgb3V0CisgICAgdm9zX21lbV96ZXJvKCBmc20sIHNpemVvZih0U3VwcFJzbkZzbSkpOworCisgICAgaWYoICFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIGJhcFJzblJlZ2lzdGVyVHhSeENhbGxiYWNrcyggc3VwcFJzblR4Q29tcGxldGVIYW5kbGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdXBwUnNuUnhGcmFtZUhhbmRsZXIgKSApICkKKyAgICB7CisgICAgICAgIHJldHVybiBBTklfRVJST1I7CisgICAgfQorCisgICAgaWYoICFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIGJhcFJzblJlZ2lzdGVyUnhDYWxsYmFjayggY3R4LT5wdm9zR0N0eCApICkgKQorICAgIHsKKyAgICAgICAgcmV0dXJuIEFOSV9FUlJPUjsKKyAgICB9CisKKyAgICAvLyBBbGxvY2F0ZSB0aGUgc3VwcGxpY2FudCBjb250ZXh0CisgICAgZnNtLT5zdXBwQ3R4ID0gKHRTdXBwQ29udGV4dCAqKXZvc19tZW1fbWFsbG9jKCBzaXplb2YodFN1cHBDb250ZXh0KSApOworICAgIGlmIChmc20tPnN1cHBDdHggPT0gTlVMTCkgCisgICAgeworICAgICAgICByZXRWYWwgPSBBTklfRV9NQUxMT0NfRkFJTEVEOworICAgICAgICBWT1NfQVNTRVJUKCAwICk7CisgICAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorICAgIC8vIENsZWFyIG91dCB0aGUgc3VwcGxpY2FudCBjb250ZXh0CisgICAgdm9zX21lbV96ZXJvKCBmc20tPnN1cHBDdHgsIHNpemVvZih0U3VwcENvbnRleHQpKTsKKworICAgIGZzbS0+Y3R4ID0gY3R4OworICAgIC8vT25seSBzdXBwb3J0IENDTVAKKyAgICBmc20tPnN1cHBDdHgtPnB3Q2lwaGVyVHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX0FFUzsKKworICAgIHJldFZhbCA9IGFuaUFzZlBhY2tldEFsbG9jYXRlRXhwbGljaXQoJmZzbS0+bGFzdEVhcG9sLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUlNOX01BWF9QQUNLRVRfU0laRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVBUE9MX1RYX0hFQURFUl9TSVpFKTsKKyAgICBpZiAocmV0VmFsICE9IEFOSV9PSykgCisgICAgeworICAgICAgICBWT1NfQVNTRVJUKCAwICk7CisgICAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorCisgICAgYW5pQXNmUGFja2V0QWxsb2NhdGUoJmZzbS0+c3VwcEN0eC0+cG1rKTsKKyAgICBpZiAoZnNtLT5zdXBwQ3R4LT5wbWsgPT0gTlVMTCkgCisgICAgeworICAgICAgICByZXRWYWwgPSBBTklfRV9NQUxMT0NfRkFJTEVEOworICAgICAgICBWT1NfQVNTRVJUKCAwICk7CisgICAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorCisgICAgZnNtLT5zdXBwQ3R4LT5pZUFwID0gTlVMTDsgCisKKyAgICBmc20tPmNyeXB0SGFuZGxlID0gMDsKKyAgICBpZiggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyggdm9zX2NyeXB0b19pbml0KCAmZnNtLT5jcnlwdEhhbmRsZSApICkgKQorICAgIHsKKyAgICAgICAgcmV0VmFsID0gQU5JX0VfRkFJTEVEOworICAgICAgICBWT1NfQVNTRVJUKCAwICk7CisgICAgfQorCisgICAgZnNtLT5jdXJyZW50U3RhdGUgPSBJTklUSUFMSVpFOworICAgIGdvdG9TdGF0ZUluaXQoZnNtKTsK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KGZzbSk7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgUlNOX0ZTTV9FQVBPTF9GUkFNRV9BVkFJTEFCTEU6CisgICAgICAgIGZzbS0+ZWFwb2xBdmFpbCA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFJTTl9GU01fSU5URUdfRkFJTEVEOgorICAgICAgICBmc20tPmludGVnRmFpbGVkID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIlN1cHAgdW5rbm93biBldmVudCBmb3IgU3VwcEZzbTogJWRcbiIsCisgICAgICAgICAgICAgICAgICAgICAgZXZlbnRJZCk7CisgICAgICAgIFZPU19BU1NFUlQoIDAgKTsKKyAgICAgICAgcmV0dXJuIEFOSV9FX0lMTEVHQUxfQVJHOworICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICBjaGVja1RyYW5zaXRpb24oZnNtLCBhcmcpOworCisgICAgcmV0dXJuIEFOSV9PSzsKK30KKworaW50CitzdXBwUnNuQXV0aFN0YXJ0RXZlbnRIYW5kbGVyKHRTdXBwUnNuRnNtICpmc20pCit7CisgICAgLy8gQ29weSByZXF1aXJlZCBpbmZvCisgICAgdm9zX21lbV9jb3B5KCAmZnNtLT5zdXBwQ3R4LT5hdXRoTWFjLCBmc20tPmN0eC0+cGVlcl9tYWNfYWRkciwgNik7CisgICAgdm9zX21lbV9jb3B5KCAmZnNtLT5zdXBwQ3R4LT5zdXBwTWFjLCBmc20tPmN0eC0+c2VsZl9tYWNfYWRkciwgNik7CisgICAgYW5pQXNmUGFja2V0QXBwZW5kQnVmZmVyKCBmc20tPnN1cHBDdHgtPnBtaywgZnNtLT5jdHgtPmtleV9tYXRlcmlhbCwgZnNtLT5jdHgtPmtleV9sZW5ndGgpOworCisgICAgcm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VUNDRVNTKCB2b3NfcmFuZF9nZXRfYnl0ZXMoIGZzbS0+Y3J5cHRIYW5kbGUsIGZzbS0+c05vbmNlLCBBTklfRUFQT0xfS0VZX1JTTl9OT05DRV9TSVpFICkgKSApCisgICAgeworICAgICAgICB6ZXJvT3V0UHRrKGZzbSk7CisgICAgICAgIC8vIFRPRE86IFplcm8gb3V0IGFsbCBHVEsncworICAgICAgICBmc20tPmF1dGhSZXEgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgIC8vLy8vZ2V0UG1rKGZzbS0+c3VwcEN0eCk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIlN1cHAgZmFpbCB0byByYW5kb20gbnVtYmVyXG4iICk7CisgICAgICAgIHJldHVybiBBTklfRVJST1I7CisgICAgfQorCisgICAgcmV0dXJuIEFOSV9PSzsKK30KKworc3RhdGljIGludAorZ290b1N0YXRlR290UG1rKHRTdXBwUnNuRnNtICpmc20pCit7CisgICAgZnNtLT5jdXJyZW50U3RhdGUgPSBHT1RfUE1LOworCisgICAgcmV0dXJuIEFOSV9PSzsKK30KKworc3RhdGljIGludAorZ290b1N0YXRlU3RhS2V5U3RhcnQodFN1cHBSc25Gc20gKmZzbSwgCisgICAgICAgICAgICAgICAgICAgICB0QW5pRWFwb2xLZXlBdmFpbEV2ZW50RGF0YSAqZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgIHZfQk9PTF90IHJldHJhbnNtaXQpCit7CisgICAgaW50IHJldFZhbDsKKyAgICB0QW5pRWFwb2xSc25LZXlEZXNjIHR4RGVzYzsKKyAgICB0QW5pRWFwb2xSc25LZXlEZXNjICpyeERlc2M7CisgICAgc3RhdGljIHZfVThfdCBidGFtcFJTTklFW10gPSB7MHgzMCwgMHgxNCwgMHgwMSwgMHgwMCwgMHgwMCwgMHgwZiwgMHhhYywgMHgw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q2lwaGVyVHlwZSA9PSBlQ1NSX0VOQ1JZUFRfVFlQRV9BRVMpIAorICAgICAgICB7CisgICAgICAgICAgICB0eERlc2MuaW5mby5rZXlEZXNjVmVycyA9IEFOSV9FQVBPTF9LRVlfREVTQ19WRVJTX0FFUzsKKyAgICAgICAgfQorICAgICAgICB0eERlc2MuaW5mby51bmljYXN0RmxhZyA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICB0eERlc2MuaW5mby5taWNGbGFnID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgIHR4RGVzYy5rZXlMZW4gPSAwOyAvL1JTTl84MDIxMV9LRVlfTEVOOworCisgICAgICAgIC8vIFNlbmQgYmFjayB0aGUgc2FtZSByZXBsYXlDdHIgdGhhdCB0aGUgYXV0aGVudGljYXRvciBzZW50CisgICAgICAgIHZvc19tZW1fY29weSh0eERlc2MucmVwbGF5Q291bnRlciwgCisgICAgICAgICAgICAgICByeERlc2MtPnJlcGxheUNvdW50ZXIsIAorICAgICAgICAgICAgICAgc2l6ZW9mKHR4RGVzYy5yZXBsYXlDb3VudGVyKSk7CisKKyAgICAgICAgdm9zX21lbV9jb3B5KHR4RGVzYy5rZXlOb25jZSwgZnNtLT5zTm9uY2UsIHNpemVvZih0eERlc2Mua2V5Tm9uY2UpKTsKKyAgICAgICAgdHhEZXNjLmtleURhdGFMZW4gPSBzaXplb2YoYnRhbXBSU05JRSk7Ly9hbmlBc2ZQYWNrZXRHZXRCeXRlcyhmc20tPnN1cHBDdHgtPmllQnAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vJnR4RGVzYy5rZXlEYXRhKTsgICAgCisgICAgICAgIHR4RGVzYy5rZXlEYXRhID0gYnRhbXBSU05JRTsKKyAgICAgICAgcmV0VmFsID0gYW5pRWFwb2xXcml0ZUtleShmc20tPmNyeXB0SGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZzbS0+bGFzdEVhcG9sLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZzbS0+c3VwcEN0eC0+YXV0aE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmc20tPnN1cHBDdHgtPnN1cHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQU5JX0VBUE9MX0tFWV9ERVNDX1RZUEVfUlNOX05FVywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdHhEZXNjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZzbS0+c3VwcEN0eC0+cHRrLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDU1JfQUVTX0tFWV9MRU4pOworICAgICAgICBpZiggIUFOSV9JU19TVEFUVVNfU1VDQ0VTUyggcmV0VmFsICkgKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJTdXBwIGdvdG9TdGF0ZVN0YUtleVN0YXJ0IGZhaWwgdG8gd3JpdGUga2V5ICVkXG4iLAorICAgICAgICAgICAgICAgICAgICAgIHJldFZhbCk7CisgICAgICAgICAgICByZXR1cm4gcmV0VmFsOworICAgICAgICB9CisgICAgLy99CisgCisgICAgaWYoIFZPU19JU19TVEFUVVNfU1VDQ0VTUyggYmFwUnNuU2VuZEVhcG9sRnJhbWUoIGZzbS0+Y3R4LT5wdm9zR0N0eCwgZnNtLT5sYXN0RWFwb2wgKSApICkKKyAgICB7CisgICAgICAgIHJldFZhbCA9IEFOSV9PSzsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgcmV0VmFsID0gQU5JX0VSUk9SOworICAgIH0KKworICAgIHJldHVybiByZXRWYWw7Cit9CisKK3N0YXRpYyBpbnQKK2dvdG9TdGF0ZVN0YUtleVNldCh0U3VwcFJzbkZzbSAqZnNtLCAKKyAgICAgICAgICAgICAgICAgICB0QW5pRWFwb2xLZXlBdmFpbEV2ZW50RGF0YSAqZGF0YSwKKyAgICAgICAgICAgICAgICAgICB2X0JPT0xfdCByZXRyYW5zbWl0KQoreworICAgIGludCByZXRWYWw9MDsKKyAgICB0QW5pRWFwb2xSc25LZXlEZXNjIHR4RGVzYzsKKyAgICB0QW5pRWFwb2xSc25LZXlEZXNjICpyeERlc2MgPSBOVUxMOworICAgIAorICAgIGZzbS0+Y3VycmVudFN0YXRlID0gU1RBX0tFWV9TRVQ7CisKKyAgICBpZiAoZGF0YSA9PSBOVUxMKSAKKyAgICB7CisgICAgICAgIC8vIFdlIGRvbid0IG5lZWQgdG8gZG8gYW55dGhpbmcKKyAgICAgICAgcmV0dXJuIEFOSV9PSzsKKyAgICB9CisgICAgCisgICAgLy8gQ3JlYXRlIGEgbmV3IEVBUE9MIGZyYW1lIGlmIHdlIGRvbid0IGhhdmUgdG8gcmV0cmFuc21pdAorICAgIGlmICghcmV0cmFuc21pdCkgCisgICAgeworICAgICAgICAvLyBGaXJzdCBjaGVjayB0aGUgSUUgdGhhdCB0aGUgQVAgc2VudAorICAgICAgICByZXRWYWwgPSBjaGVja0luZm9FbGVtZW50KGZzbSwgZGF0YSk7CisgICAgICAgIGlmIChyZXRWYWwgIT0gQU5JX09LKSAKKyAgICAgICAgeworICAgICAgICAgICAgLy9GSVhfUlNOIGFhZ1NldFN1cHBGYWlsdXJlQW5kQ2xlYW51cChmc20tPnN1cHBDdHgpOworCisgICAgICAgICAgICAvLyBGU00gZG9lcyBub3QgZXhpc3QgYWZ0ZXIgdGhpcy4uLgorCisgICAgICAgICAgICByZXR1cm4gcmV0VmFsOworICAgICAgICB9CisKKyAgICAgICAgLy8gQ3JlYXRlIGEgbmV3IEVBUE9MIGZyYW1lCisKKyAgICAgICAgcnhEZXNjID0gZGF0YS0+a2V5RGVzYzsKKyAgICAgICAgaWYoIE5VTEwgPT0gcnhEZXNjICkKKyAgICAgICAgICAgIHJldHVybiBBTklfRV9OVUxMX1ZBTFVFOworCisgICAgICAgIGFuaUFzZlBhY2tldEVtcHR5RXhwbGljaXQoZnNtLT5sYXN0RWFwb2wsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVBUE9MX1RYX0hFQURFUl9TSVpFICk7CisKKyAgICAgICAgdm9zX21lbV96ZXJvKCAmdHhEZXNjLCBzaXplb2YodHhEZXNjKSApOworCisgICAgICAgIC8vIFRoZSBLZXkgSW5mb3JtYXRpb24gYml0cy4uLgorICAgICAgICBpZiAoZnNtLT5zdXBwQ3R4LT5wd0NpcGhlclR5cGUgPT0gZUNTUl9FTkNSWVBUX1RZUEVfQUVTKSAKKyAgICAgICAgeworICAgICAgICAgICAgdHhEZXNjLmluZm8ua2V5RGVzY1ZlcnMgPSBBTklfRUFQT0xfS0VZX0RFU0NfVkVSU19BRVM7CisgICAgICAgIH0KKworICAgICAgICB0eERlc2MuaW5mby51bmljYXN0RmxhZyA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICB0eERlc2MuaW5mby5taWNGbGFnID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgIHR4RGVzYy5pbmZvLnNlY3VyZUZsYWcgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgdHhEZXNjLmtleUxlbiA9IDA7IC8vUlNOXzgwMjExX0tFWV9MRU47CisKKyAgICAgICAgLy8gU2VuZCBiYWNrIHRoZSBzYW1lIHJlcGxheUN0ciB0aGF0IHRoZSBhdXRoZW50aWNhdG9yIHNlbnQKKyAgICAgICAgdm9zX21lbV9jb3B5KHR4RGVzYy5yZXBsYXlDb3VudGVyLCAKKyAgICAgICAgICAgICAgIHJ4RGVzYy0+cmVwbGF5Q291bnRlciwgCisgICAgICAgICAgICAgICBzaXplb2YodHhEZXNjLnJlcGxheUNvdW50ZXIpKTsKKworICAgICAgICByZXRWYWwgPSBhbmlFYXBvbFdyaXRlS2V5KGZzbS0+Y3J5cHRIYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnNtLT5sYXN0RWFwb2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnNtLT5zdXBwQ3R4LT5hdXRoTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZzbS0+c3VwcEN0eC0+c3VwcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTklfRUFQT0xfS0VZX0RFU0NfVFlQRV9SU05fTkVXLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ0eERlc2MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnNtLT5zdXBwQ3R4LT5wdGssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1NSX0FFU19LRVlfTEVOKTsKKyAgICAgICAgaWYoICFBTklfSVNfU1RBVFVTX1NVQ0NFU1MoIHJldFZhbCApICkKKyAgICAgICAgeworICAgICAgICAgICAgcmV0dXJuIHJldFZhbDsKKyAgICAgICAgfQorICAgIH0KKyAgICBnUmVhZFRvU2V0S2V5ID0gQkFQX1NFVF9SU05fS0VZOworICAgIGlmKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBiYXBSc25TZW5kRWFwb2xGcmFtZSggZnNtLT5jdHgtPnB2b3NHQ3R4LCBmc20tPmxhc3RFYXBvbCApICkgKQorICAgIHsKKyAgICAgICAgLyogbWFraW5nIGl0IGdsb2JhbCB0byBhY2Nlc3MgaW4gYmFwVHhSeCBmaWxlICovCisjaWYgMAorICAgICAgICB0Q3NyUm9hbVNldEtleSBzZXRLZXlJbmZvOworCisKKyAgICAgICAgdm9zX21lbV96ZXJvKCAmc2V0S2V5SW5mbywgc2l6ZW9mKCB0Q3NyUm9hbVNldEtleSApICk7CisgICAgICAgIHNldEtleUluZm8uZW5jVHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX0FFUzsKKyAgICAgICAgc2V0S2V5SW5mby5rZXlEaXJlY3Rpb24gPSBlU0lSX1RYX1JYOworICAgICAgICB2b3NfbWVtX2NvcHkoIHNldEtleUluZm8ucGVlck1hYywgZnNtLT5zdXBwQ3R4LT5hdXRoTWFjLCBzaXplb2YoIHRBbmlNYWNBZGRyICkgKTsKKyAgICAgICAgc2V0S2V5SW5mby5wYWVSb2xlID0gMDsgLy90aGlzIGlzIGEgc3VwcGxpY2FudAorICAgICAgICBzZXRLZXlJbmZvLmtleUlkID0gMDsgICAvL2Fsd2F5cworICAgICAgICBzZXRLZXlJbmZvLmtleUxlbmd0aCA9IENTUl9BRVNfS0VZX0xFTjsgCisgICAgICAgIHZvc19tZW1fY29weSggc2V0S2V5SW5mby5LZXksICh2X1U4X3QgKilmc20tPnN1cHBDdHgtPnB0ayArICgyICogQ1NSX0FFU19LRVlfTEVOICksIENTUl9BRVNfS0VZX0xFTiApOworICAgICAgICAvL2ZzbS0+c3VwcEN0eC0+cHRrIGNvbnRhaW5zIHRoZSAzIDE2LWJ5dGVzIGtleXMuIFdlIG5lZWQgdGhlIGxhc3Qgb25lLgorICAgICAgICAvKgorICAgICAgICAgIFdlIHdpbGwgbW92ZSB0aGUgU2V0IGtleSB0byBFQVBPTCBDb21wbGV0aW9uIGhhbmRsZXIuIFdlIGZvdW5kIGEgcmFjZSBjb25kaXRpb24gYmV0d2VlbQorICAgICAgICAgIHNlbmRpbmcgRUFQT0wgZnJhbWUgYW5kIHNldHRpbmcgS2V5ICovCisKKworICAgICAgICBpZiggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyggYmFwU2V0S2V5KCBmc20tPmN0eC0+cHZvc0dDdHgsICZzZXRLZXlJbmZvICkgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiBTdXBwOiBnb3RvU3RhdGVTdGFLZXlTZXQgZmFpbCB0byBzZXQga2V5XG4iICk7CisgICAgICAgICAgICByZXRWYWwgPSBBTklfRVJST1I7CisgICAgICAgIH0KKyNlbmRpZgorICAgICAgICBnUmVhZFRvU2V0S2V5ID0gQkFQX1JFU0VUX1JTTl9LRVk7CisgICAgICAgIHJldFZhbCA9IEFOSV9FUlJPUjsKKyAgICB9CisKKyAgICByZXR1cm4gcmV0VmFsOworfQorCitzdGF0aWMgaW50Citnb3RvU3RhdGVHcm91cEtleVNldCh0U3VwcFJzbkZzbSAqZnNtLCAKKyAgICAgICAgICAgICAgICAgICAgIHRBbmlFYXBvbEtleUF2YWlsRXZlbnREYXRhICpkYXRhKQoreworICAgIGludCByZXRWYWw7CisgICAgdEFuaUVhcG9sUnNuS2V5RGVzYyB0eERlc2M7CisgICAgdEFuaUVhcG9sUnNuS2V5RGVzYyAqcnhEZXNjOworCisgICAgaW50IGdyb3VwS2V5TGVuOworICAgIAorICAgIGZzbS0+Y3VycmVudFN0YXRlID0gR1JPVVBfS0VZX1NFVDsKKyAgICAKKyAgICBkbworICAgIHsKKyAgICAgICAgcnhEZXNjID0gKHRBbmlFYXBvbFJzbktleURlc2MgKikgZGF0YS0+a2V5RGVzYzsKKyAgICAgICAgaWYoIE5VTEwgPT0gcnhEZXNjKSAKKyAgICAgICAgeworICAgICAgICAgICAgcmV0VmFsID0gQU5JX0VfTlVMTF9WQUxVRTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgaWYgKHJ4RGVzYy0+a2V5RGF0YUxlbiA9PSAwIHx8IHJ4RGVzYy0+a2V5RGF0YSA9PSBOVUxMKSAKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAiU3VwcDogQVAgc2VudCBubyBncm91cCBrZXkgaW4gZ3JvdXAgRUFQT0wtS2V5IG1lc3NhZ2UhXG4iICk7CisgICAgICAgICAgICByZXRWYWwgPSBBTklfRV9JTExFR0FMX0FSRzsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCByeERlc2MtPmluZm8ua2V5RGVzY1ZlcnMgPT0gQU5JX0VBUE9MX0tFWV9ERVNDX1ZFUlNfQUVTICkgCisgICAgICAgIHsKKyAgICAgICAgICAgIGdyb3VwS2V5TGVuID0gcnhEZXNjLT5rZXlEYXRhTGVuIC0gQU5JX1NTTV9BRVNfS0VZX1dSQVBfQkxPQ0tfU0laRTsKKyAgICAgICAgICAgIGlmKCBncm91cEtleUxlbiA8PSAwICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICAiU3VwcDogQVAgc2VudCBHVEsgdG9vIHNob3J0XG4iICk7CisgICAgICAgICAgICAgICAgcmV0VmFsID0gQU5JX0VfSUxMRUdBTF9BUkc7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0gCisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAiU3VwcDogQVAgc2VudCB1bnN1cHBvcnRlZCBrZXlEZXNjVmVyICVkIVxuIiwgcnhEZXNjLT5pbmZvLmtleURlc2NWZXJzICk7CisgICAgICAgICAgICByZXRWYWwgPSBBTklfRV9JTExFR0FMX0FSRzsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgLy8gQWx3YXlzIGNyZWF0ZSBhIG5ldyBFQVBPTCBmcmFtZQorCisgICAgICAgIGFuaUFzZlBhY2tldEVtcHR5RXhwbGljaXQoIGZzbS0+bGFzdEVhcG9sLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFQVBPTF9UWF9IRUFERVJfU0laRSApOworICAgICAgICAKKyAgICAgICAgdm9zX21lbV96ZXJvKCAmdHhEZXNjLCBzaXplb2YodHhEZXNjKSApOworCisgICAgICAgIC8vIFRoZSBLZXkgSW5mb3JtYXRpb24gYml0cy4uLgorICAgICAgICBpZiAoZnNtLT5zdXBwQ3R4LT5ncnBDaXBoZXJUeXBlID09IGVDU1JfRU5DUllQVF9UWVBFX0FFUykgCisgICAgICAgIHsKKyAgICAgICAgICAgIHR4RGVzYy5pbmZvLmtleURlc2NWZXJzID0gQU5JX0VBUE9MX0tFWV9ERVNDX1ZFUlNfQUVTOworICAgICAgICB9CisKKyAgICAgICAgdHhEZXNjLmluZm8udW5pY2FzdEZsYWcgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgIHR4RGVzYy5pbmZvLmtleUlkID0gcnhEZXNjLT5pbmZvLmtleUlkOworICAgICAgICB0eERlc2MuaW5mby5taWNGbGFnID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgIHR4RGVzYy5pbmZvLnNlY3VyZUZsYWcgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgdHhEZXNjLmtleUxlbiA9IFJTTl84MDIxMV9LRVlfTEVOOworCisgICAgICAgIC8vIFNlbmQgYmFjayB0aGUgc2FtZSByZXBsYXlDdHIgdGhhdCB0aGUgYXV0aGVudGljYXRvciBzZW50CisgICAgICAgIHZvc19tZW1fY29weSh0eERlc2MucmVwbGF5Q291bnRlciwgCisgICAgICAgICAgICAgICByeERlc2MtPnJlcGxheUNvdW50ZXIsIAorICAgICAgICAgICAgICAgc2l6ZW9mKHR4RGVzYy5yZXBsYXlDb3VudGVyKSk7CisKKyAgICAgICAgcmV0VmFsID0gYW5pRWFwb2xXcml0ZUtleShmc20tPmNyeXB0SGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZzbS0+bGFzdEVhcG9sLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZzbS0+c3VwcEN0eC0+YXV0aE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmc20tPnN1cHBDdHgtPnN1cHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQU5JX0VBUE9MX0tFWV9ERVNDX1RZUEVfUlNOX05FVywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdHhEZXNjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZzbS0+c3VwcEN0eC0+cHRrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENTUl9BRVNfS0VZX0xFTik7CisgICAgICAgIGlmKCAhQU5JX0lTX1NUQVRVU19TVUNDRVNTKCByZXRWYWwgKSApIGJyZWFrOyAgICAKKworICAgICAgICBpZiggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyggYmFwUnNuU2VuZEVhcG9sRnJhbWUoIGZzbS0+Y3R4LT5wdm9zR0N0eCwgZnNtLT5sYXN0RWFwb2wgKSApICkKKyAgICAgICAgeworICAgICAgICAgICAgcmV0VmFsID0gQU5JX0VSUk9SOworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiU3VwcCBjb3VsZCBub3Qgc2VuZCBlYXBvbC4gRGlzY29ubmVjdFxuIiApOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICAvL0ZJWF9SU04gdGhlcmUgaXMgbm8gbmVlZCB0byBzZXQgR1RLIHJldFZhbCA9IHNldEd0ayhmc20tPnN1cHBDdHgsIHJ4RGVzYy0+a2V5UmVjdlNlcUNvdW50ZXIpOworCisgICAgICAgIC8vIFRoaXMgaXMgbmV2ZXIgcmV0cmFuc21pdHRlZAorICAgICAgICBhbmlBc2ZQYWNrZXRFbXB0eUV4cGxpY2l0KCBmc20tPmxhc3RFYX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PSBBQUdfUlNOX1BUS19QUkZfTEVOX0NDTVA7CisgICAgICAgIGZzbS0+c3VwcEN0eC0+cHdLZXlMZW4gPSBBQUdfUlNOX0tFWV9NQVRFUklBTF9MRU5fQ0NNUDsKKyAgICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICJDYW5ub3QgZ2VuZXJhdGUgUFRLIGZvciBCUCBmb3IgaW52YWxpZCBhbGdvcml0aG0gJWRcbiIsCisgICAgICAgICAgICAgICAgICAgICAgZnNtLT5zdXBwQ3R4LT5wd0NpcGhlclR5cGUpOworICAgICAgICByZXR1cm4gQU5JX0VfSUxMRUdBTF9BUkc7CisgICAgICAgIGJyZWFrOworICAgIH07CisKKyAgICByeERlc2MgPSAodEFuaUVhcG9sUnNuS2V5RGVzYyAqKSBkYXRhLT5rZXlEZXNjOworICAgIHJldHVybiBhYWdQdGtQcmYoZnNtLT5jcnlwdEhhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgIGZzbS0+c3VwcEN0eC0+cHRrLAorICAgICAgICAgICAgICAgICAgICAgcHJmTGVuLAorICAgICAgICAgICAgICAgICAgICAgZnNtLT5zdXBwQ3R4LT5wbWssCisgICAgICAgICAgICAgICAgICAgICBmc20tPnN1cHBDdHgtPmF1dGhNYWMsCisgICAgICAgICAgICAgICAgICAgICBmc20tPnN1cHBDdHgtPnN1cHBNYWMsCisgICAgICAgICAgICAgICAgICAgICByeERlc2MtPmtleU5vbmNlLAorICAgICAgICAgICAgICAgICAgICAgZnNtLT5zTm9uY2UpOworfQorCitzdGF0aWMKK2ludCBjaGVja01pYyh0U3VwcFJzbkZzbSAqZnNtLCAKKyAgICAgICAgICAgICB0QW5pRWFwb2xLZXlBdmFpbEV2ZW50RGF0YSAqZGF0YSwKKyAgICAgICAgICAgICB2X0JPT0xfdCBwd0tleUV4Y2hhbmdlKQoreworICAgIGludCByZXRWYWw7CisKKyAgICByZXRWYWwgPSBhbmlFYXBvbEtleUNoZWNrTWljKGZzbS0+Y3J5cHRIYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLT5lYXBvbEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQU5JX0VBUE9MX0tFWV9ERVNDX1RZUEVfUlNOX05FVywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEtPmtleURlc2MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmc20tPnN1cHBDdHgtPnB0aywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENTUl9BRVNfS0VZX0xFTik7CisKKyAgICByZXR1cm4gcmV0VmFsOworfQorCisKK3N0YXRpYyBpbnQgY2hlY2tJbmZvRWxlbWVudCh0U3VwcFJzbkZzbSAqZnNtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBbmlFYXBvbEtleUF2YWlsRXZlbnREYXRhICpkYXRhKQoreworICAgIHRBbmlFYXBvbFJzbktleURlc2MgKmRlc2M7CisgICAgdl9VOF90ICppZUFwQnl0ZXM7CisgICAgaW50IGllQXBMZW47CisKKyAgICBkZXNjID0gKHRBbmlFYXBvbFJzbktleURlc2MgKikgZGF0YS0+a2V5RGVzYzsKKyAgICBpZiggTlVMTCA9PSBkZXNjICkKKyAgICB7CisgICAgICAgIHJldHVybiBBTklfRV9OVUxMX1ZBTFVFOworICAgIH0KKworICAgIGllQXBMZW4gPSBhbmlBc2ZQYWNrZXRHZXRCeXRlcyhmc20tPnN1cHBDdHgtPmllQXAsICZpZUFwQnl0ZXMpOworICAgIGlmKCBBTklfSVNfU1RBVFVTX1NVQ0NFU1MoIGllQXBMZW4gKSApCisgICAgeworCisgICAgICAgIGlmICgoZGVzYy0+a2V5RGF0YUxlbiAhPSBpZUFwTGVuKSB8fAorICAgICAgICAgICAgKCB2b3NfbWVtX2NvbXBhcmUoZGVzYy0+a2V5RGF0YSwgaWVBcEJ5dGVzLCBpZUFwTGVuKSApKSAKKyAgICAgICAgeworICAgICAgICAgICAgLy8gVE9ETzogU2VuZCBhIGZhdWx0IGhlcmUKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgIlN1cHAgQVAgc2VudCBpbmNvbnNpc3RlbnQgUlNOIElFIVxuIiApOworICAgICAgICAgICAgcmV0dXJuIEFOSV9FX0ZBSUxFRDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiBBTklfT0s7Cit9CisKK3N0YXRpYyAKK2ludCBjaGVja1BlZXJSZXBsYXlDb3VudGVyKHRTdXBwUnNuRnNtICpmc20sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFuaUVhcG9sS2V5QXZhaWxFdmVudERhdGEgKmRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB2X0JPT0xfdCAqcmV0cmFuc21pdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfQk9PTF90IGFjdHVhbE1pY0ZsYWcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB2X0JPT0xfdCByZVR4TWljRmxhZykKK3sKKyAgICBpbnQgcmV0VmFsID0gQU5JX09LOworICAgIGludCBjbXA7CisgICAgdEFuaUVhcG9sUnNuS2V5RGVzYyAqcnhEZXNjOworICAgIAorICAgIHJ4RGVzYyA9IGRhdGEtPmtleURlc2M7CisgICAgaWYoIE5VTEwgPT0gcnhEZXNjICkKKyAgICB7CisgICAgICAgIHJldHVybiBBTklfRV9OVUxMX1ZBTFVFOworICAgIH0KKworICAgICpyZXRyYW5zbWl0ID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgIAorICAgIGNtcCA9IGFuaVNzbVJlcGxheUN0ckNtcChmc20tPnBlZXJSZX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ICAgICBnb3RvU3RhdGVBdXRoZW50aWNhdGlvbihmc20pOworICAgICAgICByZXR1cm4gQU5JX09LOworICAgIH0KKworICAgIHN3aXRjaCAoZnNtLT5jdXJyZW50U3RhdGUpIAorICAgIHsKKyAgICBjYXNlIElOSVRJQUxJWkU6CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgQVVUSEVOVElDQVRJT046CisgICAgICAgIGdvdG9TdGF0ZUdvdFBtayhmc20pOworICAgICAgICBjaGVja1RyYW5zaXRpb24oZnNtLCBhcmcpOworICAgICAgICBicmVhazsKKyAgICBjYXNlIEdPVF9QTUs6CisgICAgICAgIGlmIChmc20tPmVhcG9sQXZhaWwpIHsKKworICAgICAgICAgICAgZnNtLT5lYXBvbEF2YWlsID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgZGF0YSA9ICh0QW5pRWFwb2xLZXlBdmFpbEV2ZW50RGF0YSAqKSBhcmc7CisgICAgICAgICAgICByeERlc2MgPSAodEFuaUVhcG9sUnNuS2V5RGVzYyAqKSBkYXRhLT5rZXlEZXNjOworCisgICAgICAgICAgICBpZiAocnhEZXNjLT5pbmZvLmFja0ZsYWcpIAorICAgICAgICAgICAgeworCisgICAgICAgICAgICAgICAgYW5pU3NtUmVwbGF5Q3RyVXBkYXRlKGZzbS0+cGVlclJlcGxheUN0ciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnhEZXNjLT5yZXBsYXlDb3VudGVyKTsKKworICAgICAgICAgICAgICAgIC8vIEdvaW5nIGZyb20gb25lIHN0YXRlIHRvIGFub3RoZXIgY2Fubm90IGJlIGEgcmV0cmFuc21pdAorICAgICAgICAgICAgICAgIHJldFZhbCA9IGdvdG9TdGF0ZVN0YUtleVN0YXJ0KGZzbSwgZGF0YSwgZUFOSV9CT09MRUFOX0ZBTFNFKTsKKworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgU1RBX0tFWV9TVEFSVDoKKyAgICAgICAgaWYgKGZzbS0+ZWFwb2xBdmFpbCkgeworCisgICAgICAgICAgICBmc20tPmVhcG9sQXZhaWwgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgICAgICBkYXRhID0gKHRBbmlFYXBvbEtleUF2YWlsRXZlbnREYXRhICopIGFyZzsKKyAgICAgICAgICAgIHJ4RGVzYyA9ICh0QW5pRWFwb2xSc25LZXlEZXNjICopIGRhdGEtPmtleURlc2M7CisKKyAgICAgICAgICAgIGlmIChyeERlc2MtPmluZm8uYWNrRmxhZykgeworCisgICAgICAgICAgICAgICAgcmV0VmFsID0gY2hlY2tQZWVyUmVwbGF5Q291bnRlcigKKyAgICAgICAgICAgICAgICAgICAgICAgIGZzbSwgCisgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICZyZXRyYW5zbWl0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgIHJ4RGVzYy0+aW5mby5taWNGbGFnLAorICAgICAgICAgICAgICAgICAgICAgICAgMCk7ICAvLyBNSUMgbm90IHNldCBtZWFucyBjaGVjayBmb3IgcmUtVHggTTEuCisgICAgICAgICAgICAgICAgaWYgKHJldFZhbCAhPSBBTklfT0spCisgICAgICAgICAgICAgICAgICAgIHJldHVybiBBTklfT0s7IC8vIENhbGxlciBzaG91bGQgbm90IGZhaWwKKworICAgICAgICAgICAgICAgIGlmIChyZXRyYW5zbWl0KSB7CisKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlJlc2VuZGluZyBFQVBPTC1LZXkgTXNnMiBmcm9tICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAic3VwcGxpY2FudCB0byBBUCIgKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0VmFsID0gZ290b1N0YXRlU3RhS2V5U3RhcnQoZnNtLCBkYXRhLCBlQU5JX0JPT0xFQU5fVFJVRSk7CisKKyAgICAgICAgICAgICAgICB9IAorICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICByZXRWYWwgPSBjaGVja01pYyhmc20sIGRhdGEsIHJ4RGVzYy0+aW5mby51bmljYXN0RmxhZyk7CisgICAgICAgICAgICAgICAgICAgIGlmIChyZXRWYWwgIT0gQU5JX09LKSAKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgYmFwU3VwcERpc2Nvbm5lY3QoIGZzbS0+Y3R4ICk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmV0VmFsOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgYW5pU3NtUmVwbGF5Q3RyVXBkYXRlKGZzbS0+cGVlclJlcGxheUN0ciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ4RGVzYy0+cmVwbGF5Q291bnRlcik7CisKKyAgICAgICAgICAgICAgICAgICAgZ290b1N0YXRlU3RhS2V5U2V0KGZzbSwgZGF0YSwgZUFOSV9CT09MRUFOX0ZBTFNFKTsKKworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICBjYXNlIFNUQV9LRVlfU0VUOgorICAgICAgICBpZiAoZnNtLT5lYXBvbEF2YWlsKSAKKyAgICAgICAgeworICAgICAgICAgICAgZnNtLT5lYXBvbEF2YWlsID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgZGF0YSA9ICh0QW5pRWFwb2xLZXlBdmFpbEV2ZW50RGF0YSAqKSBhcmc7CisgICAgICAgICAgICByeERlc2MgPSAodEFuaUVhcG9sUnNuS2V5RGVzYyAqKSBkYXRhLT5rZXlEZXNjOworCisgICAgICAgICAgICByZXRWYWwgPSBjaGVja1BlZXJSZXBsYXlDb3VudGVyKAorICAgICAgICAgICAgICAgICAgICAgICAgZnNtLCAKKyAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEsIAorICAgICAgICAgICAgICAgICAgICAgICAgJnJldHJhbnNtaXQsIAorICAgICAgICAgICAgICAgICAgICAgICAgcnhEZXNjLT5pbmZvLm1pY0ZsYWcsCisgICAgICAgICAgICAgICAgICAgICAgICAxKTsgIC8vIE1JQyBzZXQgbWVhbnMgY2hlY2sgZm9yIHJlLVR4IE0zLgorICAgICAgICAgICAgaWYgKHJldFZhbCAhPSBBTklfT0spCisgICAgICAgICAgICAgICAgcmV0dXJuIEFOSV9PSzsgLy8gQ2FsbGVyIHNob3VsZCBub3QgZmFpbAorCisgICAgICAgICAgICBpZiAoIXJldHJhbnNtaXQpIAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHJldFZhbCA9IGNoZWNrTWljKGZzbSwgZGF0YSwgcnhEZXNjLT5pbmZvLnVuaWNhc3RGbGFnKTsKKyAgICAgICAgICAgICAgICBpZiAocmV0VmFsICE9IEFOSV9PSykgCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBiYXBTdXBwRGlzY29ubmVjdCggZnNtLT5jdHggKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJldFZhbDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYW5pU3NtUmVwbGF5Q3RyVXBkYXRlKGZzbS0+cGVlclJlcGxheUN0ciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnhEZXNjLT5yZXBsYXlDb3VudGVyKTsKKworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAocnhEZXNjLT5pbmZvLnVuaWNhc3RGbGFnKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiAKKyAgICAgICAgICAgICAgICAgKiBIYW5kbGUgcGFpcndpc2Uga2V5IG1lc3NhZ2UuLi5pbiB0aGlzIHN0YXRlCisgICAgICAgICAgICAgICAgICogcGFpcndpc2Uga2V5IG1lc3NhZ2VzIGNhbiBvbmx5IGJlIGZvciByZXRyYW5zbWlzc2lvbnMuCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgaWYgKHJldHJhbnNtaXQpIAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlJlc2VuZGluZyBFQVBPTC1LZXkgTXNnNCBmcm9tICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAic3VwcGxpY2FudCBcbiIgKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0VmFsID0gZ290b1N0YXRlU3RhS2V5U2V0KGZzbSwgZGF0YSwgZUFOSV9CT09MRUFOX1RSVUUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgKiBIYW5kbGUgZ3JvdXAga2V5IG1lc3NhZ2UuLi53aXRoIGdyb3VwIGtleSBtZXNzYWdlcywKKyAgICAgICAgICAgICAgICAgKiB0aGUgcmVwbGF5IGNvdW50ZXIgaGFzIHRvIGNoYW5nZSBvbgorICAgICAgICAgICAgICAgICAqIHJldHJhbnNtaXNzaW9ucy4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBpZiAoIXJldHJhbnNtaXQpIAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0VmFsID0gZ290b1N0YXRlR3JvdXBLZXlTZXQoZnNtLCBkYXRhKTsKKyAgICAgICAgICAgICAgICAgICAgaWYoICFBTklfSVNfU1RBVFVTX1NVQ0NFU1MoIHJldFZhbCApICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgYmFwU3VwcERpc2Nvbm5lY3QoIGZzbS0+Y3R4ICk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmV0VmFsOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSAKKyAgICAgICAgfSAKKyAgICAgICAgZWxzZSB7CisgICAgICAgICAgICBpZiAoZnNtLT5pbnRlZ0ZhaWxlZCkgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZ290b1N0YXRlS2V5VXBkYXRlKGZzbSwgYXJnKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICBjYXNlIEdST1VQX0tFWV9TRVQ6CisgICAgICAgIGdvdG9TdGF0ZVN0YUtleVNldChmc20sIE5VTEwsIGVBTklfQk9PTEVBTl9GQUxTRSk7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgS0VZX1VQREFURToKKyAgICAgICAgZ290b1N0YXRlUmVrZXlNc2coZnNtLCBhcmcpOworICAgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJJbGxlZ2FsIHN0YXRlIGZvciBTdXBwUnNuRnNtOiAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgZnNtLT5jdXJyZW50U3RhdGUpOworICAgICAgICBWT1NfQVNTRVJUKCAwICk7CisgICAgICAgIHJldHVybiBBTklfRV9GQUlMRUQ7CisgICAgfQorCisgICAgcmV0dXJuIEFOSV9PSzsKK30KKworCisKK3N0YXRpYyBpbnQKK3N1cHBFYXBvbEtleUhhbmRsZXIoIHRTdXBwUnNuRnNtICpmc20sCisgICAgICAgICAgICAgICAgICAgIHRBbmlQYWNrZXQgKmVhcG9sRnJhbWUsIAorICAgICAgICAgICAgICAgICAgICB0QW5pTWFjQWRkciBzdXBwTWFjKQoreworICAgIGludCByZXRWYWw7CisgICAgCisgICAgaW50IGRlc2NUeXBlOworICAgIHZvaWQgKmtleURlc2M7CisgICAgdEFuaUVhcG9sUnNuS2V5RGVzYyAqcnNuRGVzYzsKKyAgICB0QW5pRWFwb2xLZXlBdmFpbEV2ZW50RGF0YSBkYXRhOworCisgICAgZG8KKyAgICB7CisgICAgICAgIHJldFZhbCA9IGFuaUVhcG9sUGFyc2VLZXkoZWFwb2xGcmFtZSwgJmRlc2NUeXBlLCAma2V5RGVzYyk7CisgICAgICAgIGlmKCAhQU5JX0lTX1NUQVRVU19TVUNDRVNTKCByZXRWYWwgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHJldHVybiByZXRWYWw7CisgICAgICAgIH0KKworICAgICAgICBpZiAoZGVzY1R5cGUgPT0gQU5JX0VBUE9MX0tFWV9ERVNDX1RZUEVfUlNOX05FVykgCisgICAgICAgIHsKKyAgICAgICAgICAgIHJzbkRlc2MgPSAodEFuaUVhcG9sUnNuS2V5RGVzYyAqKSBrZXlEZXNjOworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIFBhc3Mgb24gdGhlIGV2ZW50IHRvIHRoZSBSU04gRlNNIGlycmVzcGVjdGl2ZSBpZiBpdCBpcworICAgICAgICAgICAgICogcGFpcndpc2Ugb3Igbm90LgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBkYXRhLmtleURlc2MgPSBrZXlEZXNjOworICAgICAgICAgICAgZGF0YS5lYXBvbEZyYW1lID0gZWFwb2xGcmFtZTsKKyAgICAgICAgICAgIHJldFZhbCA9IHN1cHBSc25Gc21Qcm9jZXNzRXZlbnQoZnNtLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUlNOX0ZTTV9FQVBPTF9GUkFNRV9BVkFJTEFCTEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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AgY3R4ID0gKHRCdGFtcENvbnRleHQgKilWT1NfR0VUX0JBUF9DQiggcHZvc0dDdHggKTsKKyAgICBpZiAoTlVMTCA9PSBjdHgpIAorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgImN0eCBpcyBOVUxMIGluICVzIiwgX19mdW5jX18pOworCisgICAgICAgIHJldHVybiByZXRWYWw7CisgICAgfQorCisgICAgZnNtID0gJmN0eC0+dUZzbS5zdXBwRnNtOworICAgIGlmIChOVUxMID09IGZzbSkgCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAiZnNtIGlzIE5VTEwgaW4gJXMiLCBfX2Z1bmNfXyk7CisKKyAgICAgICAgcmV0dXJuIHJldFZhbDsKKyAgICB9CisKKyAgICBkbworICAgIHsKKyAgICAgICAgLy9Ub0RPOiBXZSBuZWVkIHRvIHN5bmNocm9uaXplIHRoaXMuIEZvciBub3csIHVzZSB0aGUgc2ltcGxlc3QgZm9ybSwgZHJvcCB0aGUgcGFja2V0IGNvbWVzIGxhdGVyLgorICAgICAgICBpZiggZnNtLT5mUmVjZWl2aW5nICkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIgKioqKioqc3VwcFJzblJ4RnJhbWVIYW5kbGVyIHJlY2VpdmUgZWFwb2wgcGFja2V0IHdoaWxlIHByb2Nlc3NpbmcuIERyb3AgdGhlIG5ldyBjb21lclxuIiApOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgZnNtLT5mUmVjZWl2aW5nID0gVk9TX1RSVUU7CisgICAgICAgIHJldFZhbCA9IGJhcFJzbkZvcm1Qa3RGcm9tVm9zUGt0KCAmcEFuaVBhY2tldCwgcFBhY2tldCApOworICAgICAgICBpZiggIUFOSV9JU19TVEFUVVNfU1VDQ0VTUyggcmV0VmFsICkgKSBicmVhazsKKyAgICAgICAgLy9Ob3cgd2UgY2FuIHByb2Nlc3MgdGhlIGVhcG9sIGZyYW1lCisgICAgICAgIC8vaGFuZGxlciB3aWxsIGZyZWUgdGhlIHBBbmlQYWNrZXQKKyAgICAgICAgYmFwUnNuRWFwb2xIYW5kbGVyKCBmc20sIHBBbmlQYWNrZXQsIFZPU19GQUxTRSApOworICAgIH13aGlsZSggMCApOworCisgICAgZnNtLT5mUmVjZWl2aW5nID0gVk9TX0ZBTFNFOworICAgIHZvc19wa3RfcmV0dXJuX3BhY2tldCggcFBhY2tldCApOworCisgICAgcmV0dXJuIHJldFZhbDsKK30KKworCitzdGF0aWMgaW50IHN1cHBSc25UeENvbXBsZXRlSGFuZGxlciggdl9QVk9JRF90IHB2b3NHQ3R4LCB2b3NfcGt0X3QgKnBQYWNrZXQsIFZPU19TVEFUVVMgcmV0U3RhdHVzICkKK3sKKyAgICB0QnRhbXBDb250ZXh0ICpjdHggPSAodEJ0YW1wQ29udGV4dCAqKVZPU19HRVRfQkFQX0NCKCBwdm9zR0N0eCApOworICAgIHRBdXRoUnNuRnNtICpmc207CisKKyAgICB2b3NfcGt0X3JldHVybl9wYWNrZXQoIHBQYWNrZXQgKTsKKyAgICBpZiAocHZvc0dDdHggPT0gTlVMTCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICJwYXJhbSBpcyBOVUxMIGluICVzIiwgX19mdW5jX18pOworCisgICAgICAgIHJldHVybiBBTklfRVJST1I7CisgICAgfQorCisgICAgaWYgKE5VTEwgPT0gY3R4KSAKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICJjdHggaXMgTlVMTCBpbiAlcyIsIF9fZnVuY19fKTsKKworICAgICAgICByZXR1cm4gQU5JX0VSUk9SOworICAgIH0KKworICAgIGZzbSA9ICZjdHgtPnVGc20uYXV0aEZzbTsKKyAgICBpZiAoTlVMTCA9PSBmc20pIAorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgImZzbSBpcyBOVUxMIGluICVzIiwgX19mdW5jX18pOworCisgICAgICAgIHJldHVybiBBTklfRVJST1I7CisgICAgfQorCisgICAgLy9TeW5jaHJvbml6YXRpb24gbmVlZGVkCisgICAgCisgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyggcmV0U3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgLy9UaGlzIGlzIGJhZC4KKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgIlN1cHA6IFRMIFR4IGNvbXBsZXRlIHdpdGggZXJyb3IgJWQgY3VycmVudCBzdGF0ZSBpcyAlZFxuIiwgcmV0U3RhdHVzLCBmc20tPmN1cnJlbnRTdGF0ZSApOworICAgICAgICBpZiggZnNtLT5udW1UcmllcyA8PSBzdXBwQ29uc3RzLm1heFRyaWVzICkKKyAgICAgICAgeworICAgICAgICAgICAgLy9yZXRyYW5zbWl0CisgICAgICAgICAgICBmc20tPm51bVRyaWVzKys7CisgICAgICAgICAgICBpZiggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyggYmFwUnNuU2VuZEVhcG9sRnJhbWUoIGZzbS0+Y3R4LT5wdm9zR0N0eCwgZnNtLT5s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AgICAgICAgICAgICAgICAgICBvbGRQYWNrZXQtPmhlYWQgLSBvbGRQYWNrZXQtPmJ1Zik7CisgICAgaWYgKHJldFZhbCAhPSBBTklfT0spCisgICAgICAgIHJldHVybiByZXRWYWw7CisKKyAgICByZXRWYWwgPSBhbmlBc2ZQYWNrZXRBcHBlbmRCdWZmZXIocGFja2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbGRQYWNrZXQtPmhlYWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9sZFBhY2tldC0+bGVuKTsKKyAgICBpZiAocmV0VmFsICE9IEFOSV9PSykgCisgICAgeworICAgICAgICBWT1NfQVNTRVJUKCAwICk7CisgICAgICAgIGFuaUFzZlBhY2tldEZyZWUocGFja2V0KTsKKyAgICAgICAgcmV0dXJuIEFOSV9FX0ZBSUxFRDsKKyAgICB9CisKKyAgICBpZiAob2xkUGFja2V0LT5yZWNvcmRIZWFkZXIgIT0gTlVMTCkgCisgICAgeworICAgICAgICByZWNvcmRQb3MgPSBvbGRQYWNrZXQtPnJlY29yZEhlYWRlciAtIG9sZFBhY2tldC0+YnVmOworICAgICAgICBwYWNrZXQtPnJlY29yZEhlYWRlciA9IHBhY2tldC0+YnVmICsgcmVjb3JkUG9zOworICAgIH0KKyAgICAqbmV3UGFja2V0UHRyID0gcGFja2V0OworCisgICAgcmV0dXJuIEFOSV9PSzsKK30KKworLyoqCisgKiBhbmlBc2ZQYWNrZXRGcmVlCisgKgorICogRlVOQ1RJT046CisgKiBGcmVlIGEgcHJldmlvdXNseSBhbGxvY2F0ZWQgdEFuaVBhY2tldCBhbmQgaXRzIGludGVybmFsIHJhdyBkYXRhCisgKiBidWZmZXIuCisgKgorICogQHBhcmFtIHBhY2tldCB0aGUgcGFja2V0IHRvIGZyZWUKKyAqCisgKiBAcmV0dXJuIEFOSV9PSyBpZiB0aGUgb3BlcmF0aW9uIHN1Y2NlZWRzOyBBTklfRV9OVUxMX1Z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AgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBsZW4pCit7CisgICAgaWYgKHBhY2tldCA9PSBOVUxMKQorICAgICAgICByZXR1cm4gQU5JX0VfTlVMTF9WQUxVRTsKKworICAgIGlmICghQU5JX0NIRUNLX1JBTkdFKGxlbiwgcGFja2V0LT5sZW4pKQorICAgICAgICByZXR1cm4gQU5JX0VfRkFJTEVEOworCisgICAgcGFja2V0LT50YWlsIC09IGxlbjsKKyAgICBwYWNrZXQtPmxlbiAtPSBsZW47CisKKyAgICByZXR1cm4gQU5JX09LOworfQorCisvKioKKyAqIGFuaUFzZlBhY2tldEdldExlbgorICoKKyAqIEZVTkNUSU9OOgorICogUmV0dXJucyB0aGUgbnVtYmVyIG9mIHZhbGlkIGRhdGEgYnl0ZXMgc3RvcmVkIGluIHRoZSBwYWNrZXQuCisgKgorICogQHBhcmFtIHBhY2tldCB0aGUgcGFja2V0IHdob3NlIGxlbiB3ZSBuZWVkCisgKgorICogQHJldHVybiB0aGUgbm9uLW5lZ2F0aXZlIG51bWJlciBvZiBieXRlcyBzdG9yZWQgaW4gdGhlIHBhY2tldAorICovCitpbnQKK2FuaUFzZlBhY2tldEdldExlbih0QW5pUGFja2V0ICpwYWNrZXQpCit7CisgICAgaWYgKHBhY2tldCA9PSBOVUxMKQorICAgICAgICByZXR1cm4gQU5JX0VfTlVMTF9WQUxVRTsKKworICAgIHJldHVybiBwYWNrZXQtPmxlbjsKK30KKworLyoqCisgKiBhbmlBc2ZQYWNrZXRHZXRCeXRlcworICoKKyAqIEZVTkNUSU9OOgorICogUmV0dXJucyBhIHBvaW50ZXIgdG8gdGhlIGhlYWQgb2YgdGhlIHZhbGlkIGRhdGEgc3RvcmVkIGluIHRoZQorICogcGFja2V0LgorICoKKyAqIEBwYXJhbSBwYWNrZXQgdGhlIHBhY2tldCB3aG9zZSBieXRlcyB3ZSBuZWVkCisgKiBAcGFyYW0gcmF3Qnl0ZXNQdHIgdGhlIHBvaW50ZXIgdGhhdCB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0IG9mIHRoZSBwYWNrZXQgYW5kIHJldHVybnMgaXQuIFRoZSBwYWNrZXQncyBoZWFkCisgKiBpcyBhZHZhbmNlZCBhbmQgaXRzIGxlbmd0aCBkZWNyZW1lbnRlZCBieSB0aGUgYXBwcm9wcmlhdGUgbGVuZ3RoLgorICogQWxsIG5ldHdvcmsgdG8gaG9zdCBieXRlIG9yZGVyIHRyYW5zbGF0aW9uIGlzIGFsc28gdGFrZW4gY2FyZSBvZi4KKyAqCisgKiBAcGFyYW0gcGFja2V0IHRoZSBwYWNrZXQgdG8gcmVhZCBmcm9tCisgKiBAcGFyYW0gdmFsIHRoZSB2YWx1ZSB0byBmaWxsIGluCisgKgorICogQHJldHVybiBBTklfT0sgaWYgdGhlIG9wZXJhdGlvbiBzdWNjZWVkcworICovCitpbnQKK2FuaUFzZlBhY2tldEdldDE2KHRBbmlQYWNrZXQgKnBhY2tldCwgdl9VMTZfdCAqdmFsKQoreworICAgIHZfVThfdCB1MTZBcnJbMl07CisKKyAgICBpZiAocGFja2V0ID09IE5VTEwpCisgICAgICAgIHJldHVybiBBTklfRV9OVUxMX1ZBTFVFOworCisgICAgaWYgKHZhbCA9PSBOVUxMKQorICAgICAgICByZXR1cm4gQU5JX0VfTlVMTF9WQUxVRTsKKworICAgIGlmIChwYWNrZXQtPmxlbiA8IDIpCisgICAgICAgIHJldHVybiBBTklfRV9TSE9SVF9QQUNLRVQ7CisKKyAgICB1MTZBcnJbMF0gPSBwYWNrZXQtPmhlYWRbMF07CisgICAgdTE2QXJyWzFdID0gcGFja2V0LT5oZWFkWzFdOworICAgICp2YWwgPSB2b3NfYmUxNl90b19jcHUoICoodl9VMTZfdCAqKXUxNkFyciApOworICAgIGFuaUFzZlBhY2tldFRydW5jYXRlRnJvbUZyb250KHBhY2tldCwgMik7CisKKyAgICByZXR1cm4gQU5JX09LOworfQorCisvKioKKyAqIGFuaUFzZlBhY2tldFByZXBlbmQxNgorICoKKyAqIEZVTkNUSU9OOgorICogUHJlcGV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BTFVFOworCisgICAgVk9TX0FTU0VSVChIRUFEX1NQQUNFKHBhY2tldCkgPj0gMSk7CisgICAgaWYgKEhFQURfU1BBQ0UocGFja2V0KSA8IDEpCisgICAgICAgIHJldHVybiBBTklfRV9GQUlMRUQ7CisKKyAgICBhbmlBc2ZQYWNrZXRNb3ZlTGVmdChwYWNrZXQsIDEpOworICAgICoocGFja2V0LT5oZWFkKSA9IHZhbDsKKworICAgIHJldHVybiBBTklfT0s7Cit9CisKKy8qKgorICogYW5pQXNmUGFja2V0QXBwZW5kOAorICoKKyAqIEZVTkNUSU9OOgorICogQXBwZW5kcyBhIEFOSV9VOCB0byB0aGUgZW5kIG9mIHRoZSBwYWNrZXQuCisgKiBBbGwgaG9zdCB0byBuZXR3b3JrIGJ5dGUgb3JkZXIgdHJhbnNsYXRpb24gaXMgYWxzbyB0YWtlbiBjYXJlIG9mLgorICoKKyAqIEBwYXJhbSBwYWNrZXQgdGhlIHBhY2tldCB0byB3cml0ZSB0bworICogQHBhcmFtIHZhbCB0aGUgdmFsdWUgdG8gYXBwZW5kCisgKgorICogQHJldHVybiBBTklfT0sgaWYgdGhlIG9wZXJhdGlvbiBzdWNjZWVkcworICovCitpbnQKK2FuaUFzZlBhY2tldEFwcGVuZDgodEFuaVBhY2tldCAqcGFja2V0LCB2X1U4X3QgdmFsKQoreworICAgIGlmIChwYWNrZXQgPT0gTlVMTCkKKyAgICAgICAgcmV0dXJuIEFOSV9FX05VTExfVkFMVUU7CisKKyAgICBpZiAoVEFJTF9TUEFDRShwYWNrZXQpIDwgMSkKKyAgICAgICAgcmV0dXJuIEFOSV9FX0ZBSUxFRDsKKworICAgICoocGFja2V0LT50YWlsKSA9IHZhbDsKKyAgICBhbmlBc2ZQYWNrZXRNb3ZlUmlnaHQocGFja2V0LCAxKTsKKworICAgIHJldHVybiBBTklfT0s7Cit9CisKKy8qKgorICogYW5pQXNmUGFja2V0R2V0TWFjCisgKgorICogRlVOQ1RJT046CisgKiBSZXR1cm5zIG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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5vbi1TRUMvUCB3aXRoIFJBRCBwcm94eWluZyBvbgorI2RlZmluZSBBTklfRV9DTElfTk9fRVhUX0FVVEhfWk9ORV9BTExPV0VEICAgICAgLTEwNjkgLy8gQ2Fubm90IGFkZCBleHQgYXV0aC16b25lIG9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB3aXRoIFJBRCBwcm94eWluZyBvbgorI2RlZmluZSBBTklfRV9DTElfUE9SVEFMX1pPTkVfQVVUT19DT05GSUdVUkVEICAgLTEwNzAgLy8gQ2Fubm90IG1hbmFnZSBwb3J0YWwgYXV0aC16b25lCisjZGVmaW5lIEFOSV9FX0NMSV9ERUxfUkVRX09OX1JFRl9BVVRIX1NFUlZFUiAgICAtMTA3MSAvLyBDYW5ub3QgZGVsZXRlIGF1dGgtc2VydmVyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGF0IGlzIGluIGEgem9uZQorI2RlZmluZSBBTklfRV9DTElfREVMX1JFUV9PTl9SRUZfQVVUSF9aT05FICAgICAgLTEwNzIgLy8gQ2Fubm90IGRlbGV0ZSBhdXRoLXpvbmUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoYXQgaXMgdXNlZCBieSBTU0lECisjZGVmaW5lIEFOSV9FX0NMSV9JTlZBTElEX0lOVEVSSU1fVVBEVF9WQUxVRSAgICAtMTA3MyAvLyBJbnZhbGlkIEFjY291bnRpbmcgaW50ZXJpbSB1cGRhdGUgaW50ZXJ2YWwKKyNkZWZpbmUgQU5JX0VfUkFOR0VfRU5EX0FBR19DTEkgICAgICAgICAgICAgICAgIC0xMTk5CisvLyAuLi5DTEkgUmFuZ2UgZW5kcyBoZXJlCisKKy8vIE5vbi1DTEkgcmVsYX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ZGxlLCB0QU5JX1U4ICpwbGFpblRleHQsIHRBTklfVTMyIGxlbiwKKyAgICAgICAgICAgICAgICAgdEFOSV9VOCAqa2V5RW5jS2V5LCB0QU5JX1UzMiBrZXlFbmNLZXlMZW4sCisgICAgICAgICAgICAgICAgIHRBTklfVTggKipjaXBoZXJUZXh0UHRyKQoreworICAgIGludCBpLCBqLCBuOworICAgIGludCByZXRWYWw7CisKKyAgICB0QU5JX1U4IGFbQU5JX1NTTV9BRVNfS0VZX1dSQVBfQkxPQ0tfU0laRV07CisgICAgdEFOSV9VOCAqciA9IE5VTEw7CisgICAgdEFOSV9VMzIgdDsKKworICAgIHRBTklfVTggYltBTklfU1NNX0FFU19LRVlfV1JBUF9CTE9DS19TSVpFKjJdOworCisgICAgbiA9IGxlbiAvIEFOSV9TU01fQUVTX0tFWV9XUkFQX0JMT0NLX1NJWkU7CisgICAgaWYgKChsZW4gJSBBTklfU1NNX0FFU19LRVlfV1JBUF9CTE9DS19TSVpFKSAhPSAwKSB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIklsbGVnYWwgbnVtYmVyIG9mIGlucHV0IGJ5dGVzIHRvIEFFUyBLZXkgV3JhcCEiKTsKKyAgICAgICAgcmV0dXJuIEFOSV9FX0lMTEVHQUxfQVJHOworICAgIH0KKworICAgIC8vIEFsbG9jYXRlIGVub3VnaCBzdG9yYWdlIGZvciAnQScgYXMgd2VsbCBhcyAnUicKKyAgICByID0gdm9zX21lbV9tYWxsb2MoKG4gKyAxKSAqIEFOSV9TU01fQUVTX0tFWV9XUkFQX0JMT0NLX1NJWkUpOworICAgIGlmIChyID09IE5VTEwpIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiQ291bGQgbm90IGFsbG9jYXRlIHNwYWNlIGZvciBSIik7CisgICAgICAgIHJldHVybiBBTklfRV9NQUxMT0NfRkFJTEVEOworICAgIH0KKworICAgIHZvc19tZW1fY29weShhLCBnQW5pU3NtQWVzS2V5V3JhcEl2LCBzaXplb2YoYSkpOworICAgIHZvc19tZW1fY29weShyICsgQU5JX1NTTV9BRVNfS0VZX1dSQVBfQkxPQ0tfU0laRSwgcGxhaW5UZXh0LCBsZW4pOworCisgICAgZm9yIChqID0gMDsgaiA8PSA1OyBqKyspIHsKKyAgICAgICAgZm9yIChpID0gMTsgaSA8PSBuOyBpKyspIHsKKworICAgICAgICAgICAgcmV0VmFsID0gYWVzKGNyeXB0SGFuZGxlLCBrZXlFbmNLZXksIGtleUVuY0tleUxlbiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgYSwKKyAgICAgICAgICAgICAgICAgICAgICAgICByICsgaSpBTklfU1NNX0FFU19LRVlfV1JBUF9CTE9DS19TSVpFLAorICAgICAgICAgICAgICAgICAgICAgICAgIGIpOworCisgICAgICAgICAgIGlmKCAhQU5JX0lTX1NUQVRVU19TVUNDRVNTKCByZXRWYWwpICkgZ290byBlcnJvcjsKKworICAgICAgICAgICAgdm9zX21lbV9jb3B5KGEsIGIsIEFOSV9TU01fQUVTX0tFWV9XUkFQX0JMT0NLX1NJWkUpOworICAgICAgICAgICAgdCA9IG4qaiArIGk7CisgICAgICAgICAgICB4b3IoYSwgdCk7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkociArIGkqQU5JX1NTTV9BRVNfS0VZX1dSQVBfQkxPQ0tfU0laRSwKKyAgICAgICAgICAgICAgICAgICBiICsgc2l6ZW9mKGIpIC0gQU5JX1NTTV9BRVNfS0VZX1dSQVBfQkxPQ0tfU0laRSwKKyAgICAgICAgICAgICAgICAgICBBTklfU1NNX0FFU19LRVlfV1JBUF9CTE9DS19TSVpFKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHZvc19tZW1fY29weShyLCBhLCBBTklfU1NNX0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ICAgIH0KKworICAgIC8vIEFsbG9jYXRlIGVub3VnaCBzdG9yYWdlIGZvciAnQScgYXMgd2VsbCBhcyAnUicKKyAgICByID0gdm9zX21lbV9tYWxsb2MoKG4gKyAxKSAqICBBTklfU1NNX0FFU19LRVlfV1JBUF9CTE9DS19TSVpFKTsKKyAgICBpZiAociA9PSBOVUxMKSB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiQ291bGQgbm90IGFsbG9jYXRlIHNwYWNlIGZvciBSIik7CisgICAgICAgIHJldHVybiBBTklfRV9NQUxMT0NfRkFJTEVEOworICAgIH0KKworICAgIHZvc19tZW1fY29weShhLCBjaXBoZXJUZXh0LCBzaXplb2YoYSkpOworICAgIHZvc19tZW1fY29weShyICsgQU5JX1NTTV9BRVNfS0VZX1dSQVBfQkxPQ0tfU0laRSwgCisgICAgICAgICAgIGNpcGhlclRleHQgKyBBTklfU1NNX0FFU19LRVlfV1JBUF9CTE9DS19TSVpFLCAKKyAgICAgICAgICAgbGVuIC0gQU5JX1NTTV9BRVNfS0VZX1dSQVBfQkxPQ0tfU0laRSk7CisKKyAgICBmb3IgKGogPSA1OyBqID49IDA7IGotLSkgeworICAgICAgICBmb3IgKGkgPSBuOyBpID49IDE7IGktLSkgeworCisgICAgICAgICAgICB0ID0gbipqICsgaTsKKyAgICAgICAgICAgIHhvcihhLCB0KTsKKyAgICAgICAgICAgIHJldFZhbCA9IGFlc18xKGNyeXB0SGFuZGxlLCBrZXlFbmNLZXksIGtleUVuY0tleUxlbiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICBhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgciArIGkqQU5JX1NTTV9BRVNfS0VZX1dSQVBfQkxPQ0tfU0laRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGIpOworICAgICAgICAgICBpZiggIUFOSV9JU19TVEFUVVNfU1VDQ0VTUyggcmV0VmFsKSApIGdvdG8gZXJyb3I7CisKKyAgICAgICAgICAgIHZvc19tZW1fY29weShhLCBiLCBBTklfU1NNX0FFU19LRVlfV1JBUF9CTE9DS19TSVpFKTsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShyICsgaSpBTklfU1NNX0FFU19LRVlfV1JBUF9CTE9DS19TSVpFLAorICAgICAgICAgICAgICAgICAgIGIgKyBzaXplb2YoYikgLSBBTklfU1NNX0FFU19LRVlfV1JBUF9CTE9DS19TSVpFLAorICAgICAgICAgICAgICAgICAgIEFOSV9TU01fQUVTX0tFWV9XUkFQX0JMT0NLX1NJWkUpOworICAgICAgICB9CisgICAgfQorCisgICAgaWYgKHZvc19tZW1fY29tcGFyZTIoYSwgZ0FuaVNzbUFlc0tleVdyYXBJdiwgQU5JX1NTTV9BRVNfS0VZX1dSQVBfQkxPQ0tfU0laRSkgIT0gMCkgeworICAgICAgICByZXRWYWwgPSBBTklfRV9NSUNfRkFJTEVEOworICAgICAgICBnb3RvIGVycm9yOworICAgIH0KKworICAgICpwbGFpblRleHRQdHIgPSByOworCisgICAgcmV0dXJuIEFOSV9PSzsKKworIGVycm9yOgorICAgIGlmIChyICE9IE5VTEwpCisgICAgICAgIHZvc19tZW1fZnJlZShyKTsKKworICAgIHJldHVybiByZXRWYWw7Cit9CisKK3N0YXRpYyBpbnQKK2Flcyh2X1UzMl90IGNyeXB0SGFuZGxlLCB0QU5JX1U4ICprZXlCeXRlcywgdEFOSV9VMzIga2V5TGVuLAorICAgIHRBTklfVTggYVtBTklfU1NNX0FFU19LRVlfV1JBUF9CTE9DS19TSVpFXSwKKyAgICB0QU5JX1U4IHJpW0FOSV9TU01fQUVTX0tFWV9XUkFQX0JMT0NLX1NJWkVdLAorICAgIHRBTklfVTggYltBRVNfQkxPQ0tfU0laRV0pIHsKKworICAgIGludCByZXRWYWwgPSAwOworCisvLyAgICBBRVNfS0VZIGFlc0tleTsKKworICAgIHRBTklfVTggaW5bQUVTX0JMT0NLX1NJWkVdOworICAgIHRBTklfVTggKm91dDsKKworICAgIFZPU19BU1NFUlQgKEFFU19CTE9DS19TSVpFID09IEFOSV9TU01fQUVTX0tFWV9XUkFQX0JMT0NLX1NJWkUqMik7CisKKyAgICAvLyBDb25jYXRlbmF0ZSBBIGFuZCBSW2ldCisgICAgdm9zX21lbV9jb3B5KGluLCBhLCBBTklfU1NNX0FFU19LRVlfV1JBUF9CTE9DS19TSVpFKTsKKyAgICB2b3NfbWVtX2NvcHkoaW4gKyBBTklfU1NNX0FFU19LRVlfV1JBUF9CTE9DS19TSVpFLCAKKyAgICAgICAgICAgcmksIEFOSV9TU01fQUVTX0tFWV9XUkFQX0JMT0NLX1NJWkUpOworICAgIG91dCA9IGI7CisKKyNpZiAwCisgICAgcmV0VmFsID0gQUVTX3NldF9lbmNyeXB0X2tleShrZXlCeXRlcywga2V5TGVuKjgsICZhZXNLZXkpOworICAgIGlmIChyZXRWYWwgIT0gMCkgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgIkFFU19zZXRfZW5jcnlwdF9rZXkgcmV0dXJuZWQgJWQiLCByZXRWYWwpOworICAgICAgICByZXR1cm4gQU5JX0VfRkFJTEVEOworICAgIH0KKworICAgIEFFU19lbmNyeXB0KGluLCBvdXQsICZhZXNLZXkpOworI2Vsc2UgLy8gRW5hYmxlIHRvIHVzZSBWT1MgZnVuY3Rpb24KKyAgICByZXRWYWwgPSB2b3NfZW5jcnlwdF9BRVMoY3J5cHRIYW5kbGUsIC8qIEhhbmRsZSAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbiwgLyogaW5wdXQgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0LCAvKiBvdXRwdXQgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5Qnl0ZXMpOyAvKiBrZXkg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VmFsID0gQUVTX3NldF9kZWNyeXB0X2tleShrZXlCeXRlcywga2V5TGVuKjgsICZhZXNLZXkpOworICAgIGlmIChyZXRWYWwgIT0gMCkgeworICAgICAgICBBTklfU1NNX0xPR19FKCJBRVNfc2V0X2VuY3J5cHRfa2V5IHJldHVybmVkICVkIiwgcmV0VmFsKTsKKyAgICAgICAgYXNzZXJ0KDAgJiYgIkFFU19zZXRfZW5jcnlwdF9rZXkgZmFpbGVkISIpOworICAgICAgICByZXR1cm4gQU5JX0VfRkFJTEVEOworICAgIH0KKworICAgIEFFU19kZWNyeXB0KGluLCBvdXQsICZhZXNLZXkpOworI2Vsc2UKKyAgICByZXRWYWwgPSB2b3NfZGVjcnlwdF9BRVMoY3J5cHRIYW5kbGUsIC8qIEhhbmRsZSAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbiwgLyogaW5wdXQgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0LCAvKiBvdXRwdXQgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5Qnl0ZXMpOyAvKiBrZXkgKi8KKyAgICBpZiAocmV0VmFsICE9IDApIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICJ2b3NfZGVjcnlwdF9BRVMgcmV0dXJuZWQgJWQiLCByZXRWYWwpOworICAgIH0KKyNlbmRpZgorICAgIHJldHVybiBBTklfT0s7Cit9CisKKy8vIEZyb20gRmlsZSA6IGFuaUFzZkhkci5oCisKKworCisvKgorICogUHV0IGEgbG9uZyBpbiBob3N0IG9yZGVyIGludG8gYSBjaGFyIGFycmF5IGluIG5ldHdvcmsgb3JkZXIuIAorICogCisgKi8KK3N0YXRpYyBpbmxpbmUgY2hhciAqYW5pQXNmV3IzMihjaGFyICpjcCwgdEFOSV9VMzIgeCkKK3sKKyAgICB0QW5pVTMyVmFsQ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IDAsIDAsIDB9Oworc3RhdGljIHZfVThfdCBCQVBfUlNOX0xMQ19IRUFERVJbXSA9ICB7MHhBQSwgMHhBQSwgMHgwMywgMHgwMCwgMHgxOSwgMHg1OCB9OworCisKKworc3RhdGljIGludAorcGFyc2VSc25LZXlEZXNjKHRBbmlQYWNrZXQgKnBhY2tldCwgCisgICAgICAgICAgICAgICAgdEFuaUVhcG9sUnNuS2V5RGVzYyAqKnJzbkRlc2NQdHIpOworCitzdGF0aWMgaW50CitwYXJzZVJzbktleUluZm8odEFuaVBhY2tldCAqcGFja2V0LCAKKyAgICAgICAgICAgICAgICB0QW5pUnNuS2V5SW5mbyAqaW5mbyk7CisKK3N0YXRpYyBpbnQKK3dyaXRlUnNuS2V5RGVzYyh0QW5pUGFja2V0ICpwYWNrZXQsCisgICAgICAgICAgICAgICAgdEFuaUVhcG9sUnNuS2V5RGVzYyAqcnNuRGVzYywKKyAgICAgICAgICAgICAgICB2X1U4X3Qga2V5RGVzY1R5cGUpOworCitzdGF0aWMgaW50Cit3cml0ZVJzbktleUluZm8odEFuaVBhY2tldCAqcGFja2V0LCB0QW5pUnNuS2V5SW5mbyAqaW5mbyk7CisKK3N0YXRpYyBpbnQKK3dyaXRlUnNuS2V5TWljKHZfVTMyX3QgY3J5cHRIYW5kbGUsCisgICAgICAgICAgICAgICB0QW5pUGFja2V0ICplYXBvbEZyYW1lLCAKKyAgICAgICAgICAgICAgIHRBbmlFYXBvbFJzbktleURlc2MgKnJzbkRlc2MsCisgICAgICAgICAgICAgICB2X1U4X3QgKm1pY0tleSwgCisgICAgICAgICAgICAgICB2X1UzMl90IG1pY0tleUxlbik7CisKK3N0YXRpYyBpbnQKK2NoZWNrUnNuS2V5TWljKHZfVTMyX3QgY3J5cHRIYW5kbGUsCisgICAgICAgICAgICAgICB0QW5pUGFja2V0ICplYXBvbEZyYW1lLAorICAgICAgICAgICAgICAgdEFuaUVhcG9sUnNuS2V5RGVzYyAqcnNuRGVzYywKKyAgICAgICAgICA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mV0dXJuIEFOSV9PSyBpZiB0aGUgb3BlcmF0aW9uIHN1Y2NlZWRzCisgKi8KK3N0YXRpYyBpbnQKK2FkZEVhcG9sSGVhZGVycyh0QW5pUGFja2V0ICpwYWNrZXQsIAorICAgICAgICAgICAgICAgIHRBbmlNYWNBZGRyIGRzdE1hYywgCisgICAgICAgICAgICAgICAgdEFuaU1hY0FkZHIgc3JjTWFjLCAKKyAgICAgICAgICAgICAgICB2X1U4X3QgZWFwb2xUeXBlKQoreworICAgIGludCByZXRWYWw7CisgICAgdl9VMTZfdCBsZW47CisgIAorICAgIGRvCisgICAgeworICAgICAgICByZXRWYWwgPSBhbmlBc2ZQYWNrZXRHZXRMZW4ocGFja2V0KTsKKyAgICAgICAgaWYoICFBTklfSVNfU1RBVFVTX1NVQ0NFU1MoIHJldFZhbCApICkgYnJlYWs7CisKKyAgICAgICAgbGVuID0gcmV0VmFsOworICAgICAgICByZXRWYWwgPSBhbmlBc2ZQYWNrZXRQcmVwZW5kMTYocGFja2V0LCBsZW4pOworCisgICAgICAgIHJldFZhbCA9IGFuaUFzZlBhY2tldFByZXBlbmQ4KHBhY2tldCwgZWFwb2xUeXBlKTsKKyAgICAgICAgaWYoICFBTklfSVNfU1RBVFVTX1NVQ0NFU1MoIHJldFZhbCApICkgYnJlYWs7CisKKyAgICAgICAgcmV0VmFsID0gYW5pQXNmUGFja2V0UHJlcGVuZEJ1ZmZlcihwYWNrZXQsIEVBUE9MX1ZFUlNJT05fQllURVMsIDEpOworICAgICAgICBpZiggIUFOSV9JU19TVEFUVVNfU1VDQ0VTUyggcmV0VmFsICkgKSBicmVhazsKKworICAgICAgICByZXRWYWwgPSBhbmlBc2ZQYWNrZXRQcmVwZW5kQnVmZmVyKHBhY2tldCwgQU5JX0VUSF9QX0VBUE9MX0JZVEVTLCAyKTsKKyAgICAgICAgaWYoICFBTklfSVNfU1RBVFVTX1NVQ0NFU1MoIHJldFZhbCApICkgYnJlYWs7CisKKyAgICAgICAgLy9TaW5j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KyAqIHN1Y2NlZWRzCisgKi8KK2ludCAKK2FuaUVhcG9sUGFyc2UodEFuaVBhY2tldCAqcGFja2V0LAorICAgICAgICAgICAgICB2X1U4X3QgKipkc3RNYWMsIAorICAgICAgICAgICAgICB2X1U4X3QgKipzcmNNYWMsIAorICAgICAgICAgICAgICB2X1U4X3QgKip0eXBlKQoreworICAgIHZfVTE2X3QgZnJhbWVUeXBlOworICAgIHZfVThfdCAqcHRyOworICAgIGludCByZXRWYWw7CisgICAgaW50IHRtcDsKKworICAgIGlmIChhbmlBc2ZQYWNrZXRHZXRMZW4ocGFja2V0KSA8IEVBUE9MX0JPRFlfUE9TKQorICAgICAgICByZXR1cm4gQU5JX0VfSUxMRUdBTF9BUkc7CisKKyAgICByZXRWYWwgPSBhbmlBc2ZQYWNrZXRHZXRCeXRlcyhwYWNrZXQsICZwdHIpOworICAgIGlmKCAhQU5JX0lTX1NUQVRVU19TVUNDRVNTKCByZXRWYWwgKSApCisgICAgeworICAgICAgICByZXR1cm4gcmV0VmFsOworICAgIH0KKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgIlN1cHAgcGFyc2luZyBFQVBPTCBwYWNrZXQgb2YgbGVuICVkOiBcbiIsCisgICAgICAgICAgICAgICAgcmV0VmFsKTsKKworICAgIGZyYW1lVHlwZSA9IChwdHJbRVRIRVJfUFJPVE9fUE9TXSA8PCA4KSArIHB0cltFVEhFUl9QUk9UT19QT1MrMV07CisKKyAgICAvKgorICAgICAqIFZhbGlkYXRlIHRoZSBFQVBPTC1GUkFNRQorICAgICAqLworCisgICAgaWYgKGZyYW1lVHlwZSAhPSBBTklfRVRIX1BfRUFQT0wpCisgICAgICAgIHJldHVybiBBTklfRV9JTExFR0FMX0FSRzsKKworICAgICpkc3RNYWMgPSBwdHIgKyBEU1RfTUFDX1BPUzsKKyAgICAqc3JjTWFjID0gcHRyICsgU1JDX01BQ19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FdyaXRlS2V5KHZfVTMyX3QgY3J5cHRIYW5kbGUsCisgICAgICAgICAgICAgICAgIHRBbmlQYWNrZXQgKnBhY2tldCwKKyAgICAgICAgICAgICAgICAgdEFuaU1hY0FkZHIgZHN0TWFjLCAKKyAgICAgICAgICAgICAgICAgdEFuaU1hY0FkZHIgc3JjTWFjLCAKKyAgICAgICAgICAgICAgICAgaW50IGRlc2NUeXBlLAorICAgICAgICAgICAgICAgICB2b2lkICprZXlEZXNjRGF0YSwKKyAgICAgICAgICAgICAgICAgdl9VOF90ICptaWNLZXksCisgICAgICAgICAgICAgICAgIHZfVTMyX3QgbWljS2V5TGVuKQoreworICAgIGludCByZXRWYWw7CisKKyAgICBpZiAocGFja2V0ID09IE5VTEwpCisgICAgICAgIHJldHVybiBBTklfRV9OVUxMX1ZBTFVFOworCisgICAgZG8KKyAgICB7CisgICAgICAgIGlmICgoZGVzY1R5cGUgPT0gQU5JX0VBUE9MX0tFWV9ERVNDX1RZUEVfUlNOX05FVykgCisgICAgICAgICAgICAgICAgfHwgKGRlc2NUeXBlID09IEFOSV9FQVBPTF9LRVlfREVTQ19UWVBFX1JTTikpIAorICAgICAgICB7CisKKyAgICAgICAgICAgIHJldFZhbCA9IHdyaXRlUnNuS2V5RGVzYyhwYWNrZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBbmlFYXBvbFJzbktleURlc2MgKikga2V5RGVzY0RhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSW5kaWNhdGUgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQU5JX0VBUE9MX0tFWV9ERVNDX1RZUEVfUlNOX05FVyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBvciBBTklfRUFQT0xfS0VZX0RFU0NfVFlQRV9SU04KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjVHlwZSk7CisgICAgICAgICAgICBpZiggIUFOSV9JU19TVEFUVVNfU1VDQ0VTUyggcmV0VmFsICkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICByZXRWYWwgPSBhZGRFYXBvbEhlYWRlcnMocGFja2V0LCBkc3RNYWMsIHNyY01hYywgQU5JX0VBUE9MX1RZUEVfS0VZKTsKKyAgICAgICAgICAgIGlmKCAhQU5JX0lTX1NUQVRVU19TVUNDRVNTKHJldFZhbCkgKSBicmVhazsKKworICAgICAgICAgICAgcmV0VmFsID0gd3JpdGVSc25LZXlNaWMoY3J5cHRIYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWNrZXQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBbmlFYXBvbFJzbktleURlc2MgKikga2V5RGVzY0RhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaWNLZXksIG1pY0tleUxlbik7CisgICAgICAgICAgICBpZiggIUFOSV9JU19TVEFUVVNfU1VDQ0VTUyhyZXRWYWwpICkgYnJlYWs7CisKKyAgICAgICAgfSAKKyAgICAgICAgZWxzZSB7CisgICAgICAgICAgICBWT1NfQVNTRVJUKCAwICk7CisgICAgICAgICAgICByZXR1cm4gQU5JX0VfSUxMRUdBTF9BUkc7CisgICAgICAgIH0KKyAgICB9d2hpbGUoIDAgKTsKKworICAgIHJldHVybiByZXRWYWw7Cit9CisKKworLyoqCisgKiBhbmlFYXBvbFBhcnNlS2V5CisgKgorICogUGFyc2VzIGFuZCB2ZXJpZmllcyBhIGNvbXBsZXRlIEVBUE9MLUtleSBmcmFtZS4gVGhlIGtleSBkZXNjcmlwdG9yCisgKiB0eXBlIGlzIHJldHVybmVkIGFuZCBzbyBpcyBhIG5ld2x5IGFsbG9jYXRlZCBrZXkgZGVzY3JpcHRvciBzdHJ1Y3R1cmUKKyAqIHRoYXQgaXMgYXBw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OworICAgICAgICAgICAgcmV0VmFsID0gQU5JX0VfSUxMRUdBTF9BUkc7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGFuaUFzZlBhY2tldE1vdmVMZWZ0KHBhY2tldCwgZWFwb2xGcmFtZUxlbik7CisgICAgfXdoaWxlKCAwICk7CisgICAgCisgICAgcmV0dXJuIHJldFZhbDsKK30KKworCisKK3N0YXRpYyBpbnQKK3BhcnNlUnNuS2V5RGVzYyh0QW5pUGFja2V0ICpwYWNrZXQsIAorICAgICAgICAgICAgICAgIHRBbmlFYXBvbFJzbktleURlc2MgKipyc25EZXNjUHRyKQoreworICAgIGludCByZXRWYWwgPSBBTklfT0s7CisgICAgaW50IGxlbjsKKyAgICB2X1U4X3QgKmJ5dGVzOworICAgIHRBbmlFYXBvbFJzbktleURlc2MgKnJzbkRlc2MgPSBOVUxMOworCisgICAgZG8KKyAgICB7CisgICAgICAgIGFuaUFzZlBhY2tldFRydW5jYXRlRnJvbUZyb250KHBhY2tldCwgMSk7IC8vIERlc2MtVHlwZQorCisgICAgICAgIHJzbkRlc2MgPSAodEFuaUVhcG9sUnNuS2V5RGVzYyAqKSAKKyAgICAgICAgICAgIHZvc19tZW1fbWFsbG9jKCBzaXplb2YodEFuaUVhcG9sUnNuS2V5RGVzYykgKTsKKworICAgICAgICBpZiAocnNuRGVzYyA9PSBOVUxMKSAKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiU3VwcCBjb3VsZCBub3QgbWFsbG9jIEVBUE9MLUtleSBEZXNjcmlwdG9yIGZvciBSU05cbiIpOworICAgICAgICAgICAgcmV0VmFsID0gQU5JX0VfTUFMTE9DX0ZBSUxFRDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgcmV0VmFsID0gcGFyc2VSc25LZXlJbmZvKHBhY2tldCwgJnJzbkRlc2MtPmluZm8pOworICAgICAgICBpZiAocmV0VmFsICE9IEFOSV9PSykgYnJlYWs7CisKKyAgICAgICAgcmV0VmFsID0gYW5pQXNmUGFja2V0R2V0MTYocGFja2V0LCAmcnNuRGVzYy0+a2V5TGVuKTsKKyAgICAgICAgaWYgKHJldFZhbCAhPSBBTklfT0spCisgICAgICAgIHsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgbGVuID0gc2l6ZW9mKHJzbkRlc2MtPnJlcGxheUNvdW50ZXIpOworICAgICAgICByZXRWYWwgPSBhbmlBc2ZQYWNrZXRHZXROKHBhY2tldCwgbGVuLCAmYnl0ZXMpOworICAgICAgICBpZiAocmV0VmFsICE9IEFOSV9PSykKKyAgICAgICAgeworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgdm9zX21lbV9jb3B5KHJzbkRlc2MtPnJlcGxheUNvdW50ZXIsIGJ5dGVzLCBsZW4pOworCisgICAgICAgIGxlbiA9IHNpemVvZihyc25EZXNjLT5rZXlOb25jZSk7CisgICAgICAgIHJldFZhbCA9IGFuaUFzZlBhY2tldEdldE4ocGFja2V0LCBsZW4sICZieXRlcyk7CisgICAgICAgIGlmIChyZXRWYWwgIT0gQU5JX09LKQorICAgICAgICB7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICB2b3NfbWVtX2NvcHkocnNuRGVzYy0+a2V5Tm9uY2UsIGJ5dGVzLCBsZW4pOworCisgICAgICAgIGxlbiA9IHNpemVvZihyc25EZXNjLT5rZXlJdik7CisgICAgICAgIHJldFZhbCA9IGFuaUFzZlBhY2tldEdldE4ocGFja2V0LCBsZW4sICZieXRlcyk7CisgICAgICAgIGlmIChyZXRWYWwgIT0gQU5JX09LKQorICAgICAgICB7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICB2b3NfbWVtX2NvcHkocnNuRGVzYy0+a2V5SXYsIGJ5dGVzLCBsZW4pOworCisgICAgICAgIGxlbiA9IHNpemVvZihyc25EZXNjLT5rZXlSZWN2U2VxQ291bnRlcik7CisgICAgICAgIHJldFZhbCA9IGFuaUFzZlBhY2tldEdldE4ocGFja2V0LCBsZW4sICZieXRlcyk7CisgICAgICAgIGlmIChyZXRWYWwgIT0gQU5JX09LKQorICAgICAgICB7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICB2b3NfbWVtX2NvcHkocnNuRGVzYy0+a2V5UmVjdlNlcUNvdW50ZXIsIGJ5dGVzLCBsZW4pOyAgICAKKworICAgICAgICBsZW4gPSBzaXplb2YocnNuRGVzYy0+a2V5SWQpOworICAgICAgICByZXRWYWwgPSBhbmlBc2ZQYWNrZXRHZXROKHBhY2tldCwgbGVuLCAmYnl0ZXMpOworICAgICAgICBpZiAocmV0VmFsICE9IEFOSV9PSykKKyAgICAgICAgeworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgdm9zX21lbV9jb3B5KHJzbkRlc2MtPmtleUlkLCBieXRlcywgbGVuKTsKKworICAgICAgICBsZW4gPSBzaXplb2YocnNuRGVzYy0+a2V5TWljKTsKKyAgICAgICAgcmV0VmFsID0gYW5pQXNmUGFja2V0R2V0TihwYWNrZXQsIGxlbiwgJmJ5dGVzKTsKKyAgICAgICAgaWYgKHJldFZhbCAhPSBBTklfT0spCisgICAgICAgIHsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIHZvc19tZW1fY29weShyc25EZXNjLT5rZXlNaWMsIGJ5dGVzLCBsZW4pOworCisgICAgICAgIHJldFZhbCA9IGFuaUFzZlBhY2tldEdldDE2KHBhY2tldCwgJnJzbkRlc2MtPmtleURhdGFMZW4pOworICAgICAgICBpZiAocmV0VmFsICE9IEFOSV9PSykKKyAgICAgICAgeworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBsZW4gPSByc25EZXNjLT5rZXlEYXRhTGVuOworICAgICAgICBpZiAobGVuID4gMCkgeworICAgICAgICAgICAgLy8gV2UgaGF2ZSBhIGtleQorICAgICAgICAgICAgcmV0VmFsID0gYW5pQXNmUGFja2V0R2V0TihwYWNrZXQsIGxlbiwgJmJ5dGVzKTsKKyAgICAgICAgICAgIGlmIChyZXRWYWwgIT0gQU5JX09LKQorICAgICAgICAgICAgeworICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcnNuRGVzYy0+a2V5RGF0YSA9ICh2X1U4X3QqKXZvc19tZW1fbWFsbG9jKGxlbik7CisgICAgICAgICAgICBpZiAocnNuRGVzYy0+a2V5RGF0YSA9PSBOVUxMKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJDb3VsZCBub3QgYWxsb2NhdGUgUlNOIGtleSBieXRlcyFcbiIpOworICAgICAgICAgICAgICAgIFZPU19BU1NFUlQoIDAgKTsKKyAgICAgICAgICAgICAgICByZXRWYWwgPSBBTklfRV9NQUxMT0NfRkFJTEVEOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdm9zX21lbV9jb3B5KHJzbkRlc2MtPmtleURhdGEsIGJ5dGVzLCBsZW4pOworICAgICAgICB9IAorICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgIHJzbkRlc2MtPmtleURhdGEgPSBOVUxMOworICAgICAgICB9CisKKyAgICAgICAgKnJzbkRlc2NQdHIgPSByc25EZXNjOworCisgICAgfXdoaWxlKCAwICk7CisKKyAgICBpZiggIUFOSV9JU19TVEFUVVNfU1VDQ0VTUyggcmV0VmFsICkgKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKHJzbkRlc2MpOworICAgIH0KKworICAgIHJldHVybiByZXRWYWw7Cit9CisKK3N0YXRpYyBpbnQKK3BhcnNlUnNuS2V5SW5mbyh0QW5pUGFja2V0ICpwYWNrZXQsIAorICAgICAgICAgICAgICAgIHRBbmlSc25LZXlJbmZvICppbmZvKQoreworICAgIHZfVTE2X3QgdG1wOworICAgIGludCByZXRWYWw7CisKKyAgICByZXRWYWwgPSBhbmlBc2ZQYWNrZXRHZXQxNihwYWNrZXQsICZ0bXApOworICAgIGlmKCAhQU5JX0lTX1NUQVRVU19TVUNDRVNTKCByZXRWYWwgKSApCisgICAgeworICAgICAgICByZXR1cm4gcmV0VmFsOworICAgIH0KKworICAgIGluZm8tPmtleURlc2NWZXJzID0gKHRtcCAmIEFOSV9TU01fUlNOX0tFWV9ERVNDX1ZFUlNfTUFTSykgCisgICAgICAgID4+IEFOSV9TU01fUlNOX0tFWV9ERVNDX1ZFUlNfT0ZGU0VUOworICAgIGlmIChpbmZvLT5rZXlEZXNjVmVycyAhPSBBTklfRUFQT0xfS0VZX0RFU0NfVkVSU19SQzQgJiYKKyAgICAgICAgaW5mby0+a2V5RGVzY1ZlcnMgIT0gQU5JX0VBUE9MX0tFWV9ERVNDX1ZFUlNfQUVTKQorICAgICAgICByZXR1cm4gQU5JX0VfSUxMRUdBTF9BUkc7CisKKyAgICBpbmZvLT51bmljYXN0RmxhZyA9ICh0bXAgJiBBTklfU1NNX1JTTl9VTklDQVNUX01BU0spID8gCisgICAgICAgIGVBTklfQk9PTEVBTl9UUlVFIDogZUFOSV9CT09MRUFOX0ZBTFNFOworICAgIGluZm8tPmtleUlkICAgID0gKHRtcCAmIEFOSV9TU01fUlNOX0tFWV9JTkRFWF9NQVNLKQorICAgICAgICA+PiBBTklfU1NNX1JTTl9LRVlfSU5ERVhfT0ZGU0VUOworICAgIGluZm8tPmluc3RhbGxGbGFnID0gKHRtcCAmIEFOSV9TU01fUlNOX0lOU1RBTExfTUFTSykgPworICAgICAgICBlQU5JX0JPT0xFQU5fVFJVRSA6IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICBpbmZvLT5hY2tGbGFnICAgICA9ICh0bXAgJiBBTklfU1NNX1JTTl9BQ0tfTUFTSykgPworICAgICAgICBlQU5JX0JPT0xFQU5fVFJVRSA6IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICBpbmZvLT5taWNGbGFnICAgICA9ICh0bXAgJiBBTklfU1NNX1JTTl9NSUNfTUFTSykgPworICAgICAgICBlQU5JX0JPT0xFQU5fVFJVRSA6IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICBpbmZvLT5zZWN1cmVGbGFnICA9ICh0bXAgJiBBTklfU1NNX1JTTl9TRUNVUkVfTUFTSykgPworICAgICAgICBlQU5JX0JPT0xFQU5fVFJVRSA6IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICBpbmZvLT5lcnJvckZsYWcgICA9ICh0bXAgJiBBTklfU1NNX1JTTl9FUlJPUl9NQVNLKSA/CisgICAgICAgIGVBTklfQk9PTEVBTl9UUlVFOiBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgaW5mby0+cmVxdWVzdEZsYWcgPSAodG1wICYgQU5JX1NTTV9SU05fUkVRVUVTVF9NQVNLKSA/CisgICAgICAgIGVBTklfQk9PTEVBTl9UUlVFIDogZUFOSV9CT09MRUFOX0ZBTFNFOworICAgIGluZm8tPmVuY0tleURhdGFGbGFnID0gKHRtcCAmIEFOSV9TU01fUlNOX0VOQ19LRVlfREFUQV9NQVNLKSA/CisgICAgICAgIGVBTklfQk9PTEVBTl9UUlVFIDogZUFOSV9CT09MRUFOX0ZBTFNFOworCisgICAgcmV0dXJuIEFOSV9PSzsKK30KKworCitzdGF0aWMgaW50Cit3cml0ZVJzbktleURlc2ModEFuaVBhY2tldCAqcGFja2V0LCAKKyAgICAgICAgICAgICAgICB0QW5pRWFwb2xSc25LZXlEZXNjICpyc25EZXNjLAorICAgICAgICAgICAgICAgIHZfVThfdCBrZXlEZXNjVHlwZSkKK3sKKyAgICBpbnQgcmV0VmFsOworCisgICAgZG8KKyAgICB7CisgICAgICAgIC8vIFRoaXMgY2FuIGJlIGVpdGhlciBBTklfRUFQT0xfS0VZX0RFU0NfVFlQRV9SU04KKyAgICAgICAgLy8gb3IgQU5JX0VBUE9MX0tFWV9ERVNDX1RZUEVfUlNOX05FVworICAgICAgICByZXRWYWwgPSBhbmlBc2ZQYWNrZXRBcHBlbmQ4KHBhY2tldCwga2V5RGVzY1R5cGUpOworICAgICAgICBpZiggIUFOSV9JU19TVEFUVVNfU1VDQ0VTUyggcmV0VmFsICkgKSBicmVhazsKKworICAgICAgICByZXRWYWwgPSB3cml0ZVJzbktleUluZm8ocGFja2V0LCAmcnNuRGVzYy0+aW5mbyk7CisgICAgICAgIGlmKCAhQU5JX0lTX1NUQVRVU19TVUNDRVNTKCByZXRWYWwgKSApIGJyZWFrOworCisgICAgICAgIHJldFZhbCA9IGFuaUFzZlBhY2tldEFwcGVuZDE2KHBhY2tldCwgcnNuRGVzYy0+a2V5TGVuKTsKKyAgICAgICAgaWYoICFBTklfSVNfU1RBVFVTX1NVQ0NFU1MoIHJldFZhbCApICkgYnJlYWs7CisKKyAgICAgICAgcmV0VmFsID0gYW5pQXNmUGFja2V0QXBwZW5kQnVmZmVyKHBhY2tldCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByc25EZXNjLT5yZXBsYXlDb3VudGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHJzbkRlc2MtPnJlcGxheUNvdW50ZXIpKTsKKyAgICAgICAgaWYoICFBTklfSVNfU1RBVFVTX1NVQ0NFU1MoIHJldFZhbCApICkgYnJlYWs7CisKKyAgICAgICAgcmV0VmFsID0gYW5pQXNmUGFja2V0QXBwZW5kQnVmZmVyKHBhY2tldCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByc25EZXNjLT5rZXlOb25jZSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YocnNuRGVzYy0+a2V5Tm9uY2UpKTsKKyAgICAgICAgaWYoICFBTklfSVNfU1RBVFVTX1NVQ0NFU1MoIHJldFZhbCApICkgYnJlYWs7CisKKyAgICAgICAgcmV0VmFsID0gYW5pQXNmUGFja2V0QXBwZW5kQnVmZmVyKHBhY2tldCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByc25EZXNjLT5rZXlJdiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YocnNuRGVzYy0+a2V5SXYpKTsKKyAgICAgICAgaWYoICFBTklfSVNfU1RBVFVTX1NVQ0NFU1MoIHJldFZhbCApICkgYnJlYWs7CisKKyAgICAgICAgcmV0VmFsID0gYW5pQXNmUGFja2V0QXBwZW5kQnVmZmVyKHBhY2tldCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByc25EZXNjLT5rZXlSZWN2U2VxQ291bnRlciwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YocnNuRGVzYy0+a2V5UmVjdlNlcUNvdW50ZXIpKTsKKyAgICAgICAgaWYoICFBTklfSVNfU1RBVFVTX1NVQ0NFU1MoIHJldFZhbCApICkgYnJlYWs7CisKKyAgICAgICAgcmV0VmFsID0gYW5pQXNmUGFja2V0QXBwZW5kQnVmZmVyKHBhY2tldCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByc25EZXNjLT5rZXlJZCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YocnNuRGVzYy0+a2V5SWQpKTsKKyAgICAgICAgaWYoICFBTklfSVNfU1RBVFVTX1NVQ0NFU1MoIHJldFZhbCApICkgYnJlYWs7CisKKyAgICAgICAgLy8gWmVybyBvdXQgdGhlIGtleSBNSUMKKyAgICAgICAgcmV0VmFsID0gYW5pQXNmUGFja2V0QXBwZW5kQnVmZmVyKHBhY2tldCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBaRVJPX0JZVEVTLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihyc25EZXNjLT5rZXlNaWMpKTsKKyAgICAgICAgaWYoICFBTklfSVNfU1RBVFVTX1NVQ0NFU1MoIHJldFZhbCApICkgYnJlYWs7CisKKyAgICAgICAgcmV0VmFsID0gYW5pQXNmUGFja2V0QXBwZW5kMTYocGFja2V0LCByc25EZXNjLT5rZXlEYXRhTGVuKTsKKyAgICAgICAgaWYoICFBTklfSVNfU1RBVFVTX1NVQ0NFU1MoIHJldFZhbCApICkgYnJlYWs7CisKKyAgICAgICAgaWYgKHJzbkRlc2MtPmtleURhdGFMZW4gIT0gMCkgCisgICAgICAgIHsKKyAgICAgICAgICAgIHJldFZhbCA9IGFuaUFzZlBhY2tldEFwcGVuZEJ1ZmZlcihwYWNrZXQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJzbkRlc2MtPmtleURhdGEsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJzbkRlc2MtPmtleURhdGFMZW4pOworICAgICAgICAgICAgaWYoICFBTklfSVNfU1RBVFVTX1NVQ0NFU1MoIHJldFZhbCApICkgYnJlYWs7CisgICAgICAgIH0KKyAgICB9d2hpbGUoIDAgKTsKKworICAgIHJldHVybiByZXRWYWw7Cit9CisKK3N0YXRpYyBpbnQKK3dyaXRlUnNuS2V5SW5mbyh0QW5pUGFja2V0ICpwYWNrZXQsIHRBbmlSc25LZXlJbmZvICppbmZvKQoreworICAgIGludCByZXRWYWw7CisgICAgdl9VMTZfdCB0bXA7CisgICAgdl9VMTZfdCBpbmZvVmFsdWU7CisKKyAgICBpbmZvVmFsdWUgPSAwOworCisgICAgdG1wID0gKHZfVTE2X3QpaW5mby0+a2V5RGVzY1ZlcnM7CisgIC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X01BU0s7CisgICAgCisgICAgcmV0VmFsID0gYW5pQXNmUGFja2V0QXBwZW5kMTYocGFja2V0LCBpbmZvVmFsdWUpOworCisgICAgcmV0dXJuIHJldFZhbDsKK30KKworCitzdGF0aWMgaW50Cit3cml0ZVJzbktleU1pYyh2X1UzMl90IGNyeXB0SGFuZGxlLAorICAgICAgICAgICAgICAgdEFuaVBhY2tldCAqZWFwb2xGcmFtZSwgCisgICAgICAgICAgICAgICB0QW5pRWFwb2xSc25LZXlEZXNjICpyc25EZXNjLAorICAgICAgICAgICAgICAgdl9VOF90ICptaWNLZXksIAorICAgICAgICAgICAgICAgdl9VMzJfdCBtaWNLZXlMZW4pCit7CisgICAgaW50IHJldFZhbCA9IEFOSV9PSzsKKyAgICBpbnQgbGVuOworCisgICAgdl9VOF90ICpwdHIgPSBOVUxMOworICAgIHZfVThfdCAqbWljUG9zID0gTlVMTDsKKyAgICB2X1U4X3QgcmVzdWx0W1ZPU19ESUdFU1RfU0hBMV9TSVpFXTsgLy8gTGFyZ2VyIG9mIHRoZSB0d28KKworICAgIC8vIFNhbml0eSBjaGVjayB0aGUgYXJndW1lbnRzIGFuZCByZXR1cm4gaWYgbm8gTUlDIGdlbmVyYXRpb24gaXMKKyAgICAvLyBuZWVkZWQKKyAgICBpZiAobWljS2V5ICE9IE5VTEwpIAorICAgIHsKKyAgICAgICAgaWYgKG1pY0tleUxlbiA9PSAwIHx8ICFyc25EZXNjLT5pbmZvLm1pY0ZsYWcpIAorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIlN1cHAgTUlDIGtleSBwcm92aWRlZCBidXQgbWljS2V5TGVuIG9yIG1pY0ZsYWcgaXMgbm90IHNldCFcbiIpOworICAgICAgICAgICAgVk9TX0FTU0VSVCggMCApOworICAgICAgICAgICAgcmV0dXJuIEFOSV9FX0lMTEVHQUxfQVJHOworICAgICAgICB9CisgICAgfSAKKyAgICBlbHNlIHsKKyAgICAgICAgaWYgKHJzbkRlc2MtPmluZm8ubWljRmxhZykgCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiU3VwcCBtaWNGbGFnIGlzIHNldCBidXQgTUlDIGtleSBub3QgcHJvdmlkZWQhXG4iKTsKKyAgICAgICAgICAgIFZPU19BU1NFUlQoIDAgKTsKKyAgICAgICAgICAgIHJldHVybiBBTklfRV9JTExFR0FMX0FSRzsKKyAgICAgICAgfQorICAgICAgICAvLyBOb3JtYWwgY29uZGl0aW9uIHdoZXJlIE1JQyBpcyBub3QgZGVzaXJlZCBieSB0aGUgY2FsbGVyCisgICAgICAgIHJldHVybiBBTklfT0s7CisgICAgfQorCisgICAgbGVuID0gYW5pQXNmUGFja2V0R2V0Qnl0ZXMoZWFwb2xGcmFtZSwgJnB0cik7CisgICAgaWYoICFBTklfSVNfU1RBVFVTX1NVQ0NFU1MoIGxlbiApICkKKyAgICB7CisgICAgICAgIHJldHVybiBsZW47CisgICAgfQorCisgICAgbWljUG9zID0gcHRyICsgQU5JX1NTTV9SU05fS0VZX01JQ19PRkZTRVQgKyBTTkFQX0hFQURFUl9TSVpFOworCisgICAgLy8gQ2xlYXIgdGhlIE1JQyBmaWVsZCBpbiB0aGUgcGFja2V0IGJlZm9yZSB0aGUgTUlDIGNvbXB1dGF0aW9uCisgICAgdm9zX21lbV96ZXJvKCBtaWNQb3MsIFZPU19ESUdFU1RfTUQ1X1NJWkUpOworCisgICAgLy8gU2tpcCB0byB0aGUgRUFQT0wgdmVyc2lvbiBmaWVsZCBmb3IgTUlDIGNvbXB1dGF0aW9uCisgICAgcHRyICs9IEVBUE9MX1ZFUlNJT05fUE9TICsgU05BUF9IRUFERVJfU0laRTsKKyAgICBsZW4gLT0gKEVBUE9MX1ZFUlNJT05fUE9TICsgU05BUF9IRUFERVJfU0laRSk7CisKKyAgICBpZiAocnNuRGVzYy0+aW5mby5rZXlEZXNjVmVycyA9PSBBTklfRUFQT0xfS0VZX0RFU0NfVkVSU19BRVMpIAorICAgIHsKKyAgICAgICAgaWYoIFZPU19JU19TVEFUVVNfU1VDQ0VTUyggdm9zX3NoYTFfaG1hY19zdHIoY3J5cHRIYW5kbGUsIHB0ciwgbGVuLCBtaWNLZXksIG1pY0tleUxlbiwgcmVzdWx0KSApICkKKyAgICAgICAgeworICAgICAgICAgICAgcmV0VmFsID0gQU5JX09LOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcmV0VmFsID0gQU5JX0VSUk9SOworICAgICAgICB9CisgICAgfSAKKyAgICBlbHNlIHsKKyAgICAgICAgVk9TX0FTU0VSVCggMCApOworICAgICAgICByZXRWYWwgPSBBTklfRV9JTExFR0FMX0FSRzsKKyAgICB9CisKKyAgICBpZiAocmV0VmFsID09IEFOSV9PSykgCisgICAgeworICAgICAgICAvLyBDb3B5IG9ubHkgMTZCIHdoaWNoIGlzIHRoZSBzbWFsbGVyIG9mIHRoZSB0d28gYW5kIHRoZSBzYW1lIGFzCisgICAgICAgIC8vIEFOSV9FQVBPTF9LRVlfUlNOX01JQ19TSVpFCisgICAgICAgIHZvc19tZW1fY29weShtaWNQb3MsIHJlc3VsdCwgVk9TX0RJR0VTVF9NRDVfU0laRSk7CisgICAgfQorCisgICAgcmV0dXJuIHJldFZhbDsKK30KKworLyoqCisgKiBhbmlFYXBvbEtleUNoZWNrTWljCisgKgorICogQHBhcmFtIGVhcG9sRnJhbWUgdGhlIGNvbXBsZXRlIEVBUE9MLUtleSBwYWNrZXQKKyAqIEBwYXJhbSBkZXNjVHlwZSB0aGUga2V5IGRlc2NyaXB0b3IgdHlwZQorICogQHBhcmFtIGtleURlc2NEYXRhIHRoZSBrZXkgZGVzY3JpcHRvcgorICogQHBhcmFtIG1pY0tleSB0aGUgTUlDIGtleQorICogQHBhcmFtIG1pY0tleUxlbiB0aGUgbnVtYmVyIG9mIGJ5dGVzIGluIHRoZSBNSUMga2V5CisgKgorICogQHJldHVybiBBTklfT0sgaWYgdGhlIG9wZXJhdGlvbiBzdWNjZWVkczsgQU5JX0VfTUlDX0ZBSUxFRCBpZiB0aGUKKyAqIE1JQyBjaGVjayBmYWlscy4KKyAqLworaW50CithbmlFYXBvbEtleUNoZWNrTWljKHZfVTMyX3QgY3J5cHRIYW5kbGUsCisgICAgICAgICAgICAgICAgICAgIHRBbmlQYWNrZXQgKmVhcG9sRnJhbWUsCisgICAgICAgICAgICAgICAgICAgIGludCBkZXNjVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgdm9pZCAqa2V5RGVzY0RhdGEsCisgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqbWljS2V5LAorICAgICAgICAgICAgICAgICAgICB2X1UzMl90IG1pY0tleUxlbikKK3sKKyAgICBpZiAoZGVzY1R5cGUgPT0gQU5JX0VBUE9MX0tFWV9ERVNDX1RZUEVfUlNOX05FVykgCisgICAgeworICAgICAgICByZXR1cm4gY2hlY2tSc25LZXlNaWMoY3J5cHRIYW5kbGUsIGVhcG9sRnJhbWUsIGtleURlc2NEYXRhLCBtaWNLZXksIG1pY0tleUxlbik7CisgICAgfSAKKyAgICBlbHNlIHsKKyAgICAgICAgVk9TX0FTU0VSVCggMCApOworICAgICAgICByZXR1cm4gQU5JX0VfSUxMRUdBTF9BUkc7CisgICAgfQorfQorCisKK3N0YXRpYyBpbnQKK2NoZWNrUnNuS2V5TWljKHZfVTMyX3QgY3J5cHRIYW5kbGUsCisgICAgICAgICAgICAgICB0QW5pUGFja2V0ICplYXBvbEZyYW1lLAorICAgICAgICAgICAgICAgdEFuaUVhcG9sUnNuS2V5RGVzYyAqcnNuRGVzYywKKyAgICAgICAgICAgICAgIHZfVThfdCAqbWljS2V5LAorICAgICAgICAgICAgICAgdl9VMzJfdCBtaWNLZXlMZW4p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uRGVzYy0+aW5mby5rZXlEZXNjVmVycyA9PSBBTklfRUFQT0xfS0VZX0RFU0NfVkVSU19BRVMpIAorICAgICAgICB7CisgICAgICAgICAgICBpZiggVk9TX0lTX1NUQVRVU19TVUNDRVNTKCB2b3Nfc2hhMV9obWFjX3N0cihjcnlwdEhhbmRsZSwgcHRyLCBsZW4sIG1pY0tleSwgbWljS2V5TGVuLCByZXN1bHQpICkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHJldFZhbCA9IEFOSV9PSzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSAKKyAgICAgICAgZWxzZSB7CisgICAgICAgICAgICBWT1NfQVNTRVJUKCAwICk7CisgICAgICAgICAgICByZXRWYWwgPSBBTklfRV9JTExFR0FMX0FSRzsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChyZXRWYWwgPT0gQU5JX09LKSAKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKCAhdm9zX21lbV9jb21wYXJlKGluY29taW5nTWljLCByZXN1bHQsIEFOSV9FQVBPTF9LRVlfUlNOX01JQ19TSVpFKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByZXRWYWwgPSBBTklfRV9NSUNfRkFJTEVEOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIHJldFZhbDsKK30KKworLyoqCisgKiBhbmlFYXBvbEtleUZyZWVEZXNjCisgKgorICogRnJlZXMgdGhlIEVBUE9MIGtleSBkZXNjcmlwdG9yIGFuZCB0aGUga2V5IGJ5dGVzIGNvbnRhaW5lZCB3aXRoaW4gaXQuCisgKgorICogQHBhcmFtIGRlc2NUeXBlIHRoZSBrZXkgZGVzY3JpcHRvciB0eXBlCisgKiBAcGFyYW0ga2V5RGVzY0RhdGEgdGhlIGtleSBkZXNjcmlwdG9yCisgKgorICogQHJldHVybiBBTklfT0sgaWYgdGhlIG9wZXJhdGlvbiBzdWNjZWVkcworICovCitpbnQKK2FuaUVhcG9sS2V5RnJlZURlc2MoaW50IGRlc2NUeXBlLCB2b2lkICprZXlEZXNjRGF0YSkKK3sKKyAgICB0QW5pRWFwb2xSc25LZXlEZXNjICpyc25EZXNjOworCisgICAgaWYoIGtleURlc2NEYXRhICkKKyAgICB7CisgICAgICAgIGlmICgoZGVzY1R5cGUgPT0gQU5JX0VBUE9MX0tFWV9ERVNDX1RZUEVfUlNOX05FVykgCisgICAgICAgICAgICAgICAgfHwgKGRlc2NUeXBlID09IEFOSV9FQVBPTF9LRVlfREVTQ19UWVBFX1JTTikpIAorICAgICAgICB7CisKKyAgICAgICAgICAgIHJzbkRlc2MgPSAodEFuaUVhcG9sUnNuS2V5RGVzYyAqKSBrZXlEZXNjRGF0YTsKKyAgICAgICAgICAgIGlmIChyc25EZXNjLT5rZXlEYXRhICE9IE5VTEwpCisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHJzbkRlc2MtPmtleURhdGEpOworCisgICAgICAgIH0gCisgICAgICAgIGVsc2UgeworCisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIlN1cHAgYXNrZWQgdG8gZnJlZSBpbGxlZ2FsIHR5cGU6ICVkXG4iLCBkZXNjVHlwZSk7CisKKyAgICAgICAgfQorCisgICAgICAgIHZvc19tZW1fZnJlZShrZXlEZXNjRGF0YSk7CisgICAgfQorCisgICAgcmV0dXJuIEFOSV9PSzsKK30KKwordl9VOF90ICoKK2FuaUVhcG9sVHlwZTJTdHIodl9VOF90IHR5cGUpCit7CisgICAgc3dpdGNoICh0eXBlKSAKKyAgICB7CisgICAgY2FzZSBBTklfRUFQT0xfVFlQRV9QQUNLRVQ6CisgICAgICAgIHJldHVybiAodl9VOF90ICopQU5JX0VBUE9MX1RZUEVfUEFDS0VUX1NUUjsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBBTklfRUFQT0xfVFlQRV9TVEFSVDoKKyAgICAgICAgcmV0dXJuICh2X1U4X3QgKilBTklfRUFQT0xfVFlQRV9TVEFSVF9TVFI7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgQU5JX0VBUE9MX1RZUEVfTE9HT0ZGOgorICAgICAgICByZXR1cm4gKHZfVThfdCAqKUFOSV9FQVBPTF9UWVBFX0xPR09GRl9TVFI7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgQU5JX0VBUE9MX1RZUEVfS0VZOgorICAgICAgICByZXR1cm4gKHZfVThfdCAqKUFOSV9FQVBPTF9UWVBFX0tFWV9TVFI7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgQU5JX0VBUE9MX1RZUEVfQVNGX0FMRVJUOgorICAgICAgICByZXR1cm4gKHZfVThfdCAqKUFOSV9FQVBPTF9UWVBFX0FTRl9BTEVSVF9TVFI7CisgICAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICAgIHJldHVybiAodl9VOF90ICopQU5JX0VBUE9MX1RZUEVfVU5LTk9XTl9TVFI7CisgICAgICAgIGJyZWFrOworICAgIH0KK30KKworCit2b2lkIGJhcFJzbkVhcG9sSGFuZGxlciggdl9QVk9JRF90IHB2RnNtLCB0QW5pUGFja2V0ICpwYWNrZXQsIHZfQk9PTF90IGZJc0F1dGggKQoreworICAgIGludCByZXRWYWw7CisgICAgdl9VOF90ICpkc3RNYWMgPSBOVUxMOworICAgIHZfVThfdCAqc3JjTWFjID0gTlVMTDsKKyAgICB2X1U4X3QgKnR5cGUgPSBOVUxMOworCisgICAgcmV0VmFsID0gYW5pRWFwb2xQYXJzZShwYWNrZXQsICZkc3RNYWMsICZzcmNNYWMsICZ0eXBlKTsKKyAgICBpZiAoIHJldFZhbCA+PSAwICkKKyAgICB7CisgICAgICAgIHJldFZhbCA9IEFOSV9PSzsKKworICAgICAgICAvLyBTYW5pdHkgY2hlY2sgdGhhdCBhIFBBRSByb2xlIGhhcyBiZWVuIGFzc2lnbmVkIHRvIGl0LAorICAgICAgICAvLyBhbmQgdGhlbiBkaXNwYXRjaCB0byB0aGUgYXBwcm9wcmlhdGUgaGFuZGxlcgorCisgICAgICAgIGlmKCBmSXNBdXRoICkKKyAgICAgICAgeworICAgICAgICAgICAgdEF1dGhSc25Gc20gKmZzbSA9ICh0QXV0aFJzbkZzbSAqKXB2RnNtOworICAgICAgICAgICAgYXV0aEVhcG9sSGFuZGxlciggZnNtLCBwYWNrZXQsIGRzdE1hYywgc3JjTWFjLCB0eXBlICk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICB0U3VwcFJzbkZzbSAqZnNtID0gKHRTdXBwUnNuRnNtICopcHZGc207CisgICAgICAgICAgICBzdXBwRWFwb2xIYW5kbGVyKGZzbSwgcGFja2V0LCBkc3RNYWMsIHNyY01hYywgdHlwZSk7CisgICAgICAgIH0gLy8gc3dpdGNoIHN0YXRlbWVudAorICAgIH0gLy8gU3VjY2Vzc2Z1bGx5IHBhcnNlZCBFQVBPTAorICAgIGVsc2UKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICJlYXBvbEhhbmRsZXIgUmVjZWl2ZWQgYmFkIEVBUE9MIG1lc3NhZ2Ugb2YgbGVuICVkIChzdGF0dXM9JWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgIGFuaUFzZlBhY2tldEdldExlbihwYWNrZXQpLCByZXRWYWwgKTsKKyAgICB9IAorICAgIGFuaUFzZlBhY2tldEZyZWUoIHBhY2tldCApOworfQorCisKK2ludCBiYXBSc25Gb3JtUGt0RnJvbVZvc1BrdCggdEFuaVBhY2tldCAqKnBwUGFja2V0LCB2b3NfcGt0X3QgKnBWb3NQYWNrZXQgKQoreworICAgIGludCByZXRWYWwgPSBBTklfRVJST1I7CisgICAgVk9TX1NUQVRVUyBzdGF0dXM7CisgICAgdl9VMTZfdC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ICAgICAgICAgICAgICAgICAgICAgICAgIHVQa3RMZW4gKTsKKyAgICAgICAgaWYoICFBTklfSVNfU1RBVFVTX1NVQ0NFU1MoIHJldFZhbCApICkgCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiIGF1dGhSc25SeEZyYW1lSGFuZGxlciBjYW5ub3QgcmV0cmlldmUgZWFwb2wgcGF5bG9hZCBzaXplICglZClcbiIsIAorICAgICAgICAgICAgICAgIHVQa3RMZW4gKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfXdoaWxlKCAwICk7CisKKyAgICBpZiggQU5JX0lTX1NUQVRVU19TVUNDRVNTKCByZXRWYWwgKSApCisgICAgeworICAgICAgICAqcHBQYWNrZXQgPSBwQW5pUGFja2V0OworICAgIH0KKyAgICBlbHNlIGlmKCBwQW5pUGFja2V0ICkKKyAgICB7CisgICAgICAgIGFuaUFzZlBhY2tldEZyZWUoIHBBbmlQYWNrZXQgKTsKKyAgICB9CisKKyAgICByZXR1cm4gcmV0VmFsOworfQorCisKZGlmZiAtLWdpdCBhL3dsYW4vcHJpbWEvQ09SRS9CQVAvc3JjL2JhcFJzblNzbUVhcG9sLmggYi93bGFuL3ByaW1hL0NPUkUvQkFQL3NyYy9iYXBSc25Tc21FYXBvbC5oCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmY5MGJhYjgKLS0tIC9kZXYvbnVsbAorKysgYi93bGFuL3ByaW1hL0NPUkUvQkFQL3NyYy9iYXBSc25Tc21FYXBvbC5oCkBAIC0wLDAgKzEsMzMzIEBACisvKgorICogQ29weXJpZ2h0IChjKSAyMDEyLTIwMTMgVGhlIExpbnV4IEZvdW5kYXRpb24uIEFsbCByaWdodHMgcmVzZXJ2ZWQuCisgKgorICogUHJldmlvdXNseSBsaWNlbnN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WRU5UIFNIQUxMIFRIRQorICogQVVUSE9SIEJFIExJQUJMRSBGT1IgQU5ZIFNQRUNJQUwsIERJUkVDVCwgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwKKyAqIERBTUFHRVMgT1IgQU5ZIERBTUFHRVMgV0hBVFNPRVZFUiBSRVNVTFRJTkcgRlJPTSBMT1NTIE9GIFVTRSwgREFUQSBPUgorICogUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1IgT1RIRVIKKyAqIFRPUlRJT1VTIEFDVElPTiwgQVJJU0lORyBPVVQgT0YgT1IgSU4gQ09OTkVDVElPTiBXSVRIIFRIRSBVU0UgT1IKKyAqIFBFUkZPUk1BTkNFIE9GIFRISVMgU09GVFdBUkUuCisgKi8KKworLyoKKyAqIFRoaXMgZmlsZSB3YXMgb3JpZ2luYWxseSBkaXN0cmlidXRlZCBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIAorICB2b3NfbGlzdC5jCisgIAorICBcYnJpZWYKKyAgCisgIERlc2NyaXB0aW9uLi4uCisgICAgCisgIAorICAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCisvKiAkSEVBREVSJCAqLworI2luY2x1ZGUgImJhcFJzblR4UnguaCIKKyNpbmNsdWRlICJiYXBSc244MDIxeEZzbS5oIgorI2luY2x1ZGUgImJhcEludGVybmFsLmgiCisjaW5jbHV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Fja2V0KCB2b3NfcGt0X3QgKipwcFBhY2tldCwgdl9VOF90ICoqcHBEYXRhLCB2X1UxNl90IHNpemUgKQoreworICAgIFZPU19TVEFUVVMgc3RhdHVzOworICAgIHZvc19wa3RfdCAqcFBhY2tldDsKKworICAgIHN0YXR1cyA9IHZvc19wa3RfZ2V0X3BhY2tldCggJnBQYWNrZXQsIFZPU19QS1RfVFlQRV9UWF84MDJfMTFfTUdNVCwgc2l6ZSwgMSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJVRSwgTlVMTCwgTlVMTCApOworICAgIGlmKCBWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgICB7CisgICAgICAgIHN0YXR1cyA9IHZvc19wa3RfcmVzZXJ2ZV9oZWFkKCBwUGFja2V0LCAodl9WT0lEX3QgKiopcHBEYXRhLCBzaXplICk7CisgICAgICAgIGlmKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiYmFwUnNuQWNxdWlyZVBhY2tldCBmYWlsZWQgdG8gcmVzZXJ2ZSBzaXplID0gJWRcbiIsIHNpemUgKTsKKyAgICAgICAgICAgIHZvc19wa3RfcmV0dXJuX3BhY2tldCggcFBhY2tldCApOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgKnBwUGFja2V0ID0gcFBhY2tldDsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgImJhcFJzbkFjcXVpcmVQYWNrZXQgZmFpbGVkIHRvIGdldCB2b3NfcGt0XG4iICk7CisgICAgfQorCisgICAgcmV0dXJuICggc3RhdHVzICk7Cit9CisKKworc3RhdGljIFZPU19TVEFUVVMgYmFwUnNuVHhDb21wbGV0ZUNhbGxiYWNrKCB2X1BWT0lEX3QgcHZvc0dDdHgsIHZvc19wa3RfdCAqcFBhY2tldCwgVk9TX1NUQVRVUyByZXRTdGF0dXMgKQoreworICAgIGludCByZXRWYWw7CisgICAgcHRCdGFtcENvbnRleHQgYnRhbXBDb250ZXh0OyAvLyB1c2UgYnRhbXBDb250ZXh0IHZhbHVlICAKKyAgICB0Q3NyUm9hbVNldEtleSBzZXRLZXlJbmZvOworICAgIHRTdXBwUnNuRnNtICpmc207CisKKyAgICBpZiAoTlVMTCA9PSBwdm9zR0N0eCkgCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAicHZvc0dDdHggaXMgTlVMTCBpbiAlcyIsIF9fZnVuY19fKTsKKworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgIH0KKworICAgIGJ0YW1wQ29udGV4dCA9IFZPU19HRVRfQkFQX0NCKHB2b3NHQ3R4KTsgCisgICAgaWYgKE5VTEwgPT0gYnRhbXBDb250ZXh0KSAKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICJidGFtcENvbnRleHQgaXMgTlVMTCBpbiAlcyIsIF9fZnVuY19fKTsKKworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgIH0KKworICAgIGZzbSA9ICZidGFtcENvbnRleHQtPnVGc20uc3VwcEZzbTsKKyAgICBpZiAoTlVMTCA9PSBmc20pIAorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1N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KworICBBcmUgbGlzdGVkIGZvciBlYWNoIEFQSSBiZWxvdy4KKworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisgICAkSGVhZGVyOiAvcHJqL3FjdC9hc3cvZW5nYnVpbGRzL3NjbC91c2VyczAyL2p6bXVkYS9nYi1ibHVlei92ZW5kb3IvcWNvbS9wcm9wcmlldGFyeS93bGFuL2xpYnJhL0NPUkUvQkFQL3NyYy9idGFtcEZzbS5jLHYgMS4xMSAyMDExLzAzLzMwIDIxOjUyOjEwIGp6bXVkYSBFeHAganptdWRhICQKKworCisgIHdoZW4gICAgICAgIHdobyAgICAgd2hhdCwgd2hlcmUsIHdoeQorLS0tLS0tLS0tLSAgICAtLS0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKzIwMDgtMTAtMTYgICAgamV6ICAgICBDcmVhdGVkIG1vZHVsZQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKiBUaGlzIGZpbGUgaXMgZ2VuZXJhdGVkIGZyb20gYnRhbXBGc20uY2RkIC0gZG8gbm90IGVkaXQgbWFudWFsbHkq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LZXkpICovIAorICAgIHZvc1N0YXR1cyA9IGJ0YW1wRnNtKGJ0YW1wQ29udGV4dCwgJmJhcEV2ZW50LCAmc3RhdHVzKTsKKworICAgIC8qIFNldCB0aGUgUGFpcndpc2UgS2V5ICovIAorICAgIGhhbFN0YXR1cyA9IHNtZV9Sb2FtU2V0S2V5KCAKKyAgICAgICAgICAgIGhIYWwsIAorICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5zZXNzaW9uSWQsIAorICAgICAgICAgICAgcFNldEtleUluZm8sIAorICAgICAgICAgICAgJnJvYW1JZCApOworICAgIGlmICggaGFsU3RhdHVzICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MgKQorICAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICJbJTRkXSBzbWVfUm9hbVNldEtleSByZXR1cm5lZCBFUlJPUiBzdGF0dXM9ICVkIiwgX19MSU5FX18sIGhhbFN0YXR1cyApOworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAvKiBTZXQgdGhlIEdyb3VwIEtleSAqLyAKKyAgICB2b3NfbWVtX2NvcHkoIHBTZXRLZXlJbmZvLT5wZWVyTWFjLCBncm91cE1hYywgc2l6ZW9mKCB0QW5pTWFjQWRkciApICk7CisgICAgaGFsU3RhdHVzID0gc21lX1JvYW1TZXRLZXkoIAorICAgICAgICAgICAgaEhhbCwgCisgICAgICAgICAgICBidGFtcENvbnRleHQtPnNlc3Npb25JZCwgCisgICAgICAgICAgICBwU2V0S2V5SW5mbywgCisgICAgICAgICAgICAmcm9hbUlkICk7CisgICAgaWYgKCBoYWxTdGF0dXMgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUyApCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICJbJTRkXSBzbWVfUm9hbVNldEtleSByZXR1cm5lZCBFUlJPUiBzdGF0dXM9ICVkIiwgX19MSU5FX18sIGhhbFN0YXR1cyApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICB9CisgIAorICAgIHJldHVybiB2b3NTdGF0dXM7Cit9CisKKy8qCisgKiBEZWJ1Zy1yZWxhdGVkIERlZmluZXMuIAorICogIC0gIFVsdGltYXRlbHksIHRoZXNlIGV2ZW50cyB3aWxsIGJlIHZhbHVlcworICogIC0gIGZyb20gYW4gZW51bWVyYXRpb24uICBUaGF0IGFyZSBzZXQgYnkgc29tZQorICogIC0gb2YgdGhlIGZvbGxvd2luZyBldmVudHMuCisgKi8KKyNkZWZpbmUgRFVNUExPR19PTgorI2lmIGRlZmluZWQgRFVNUExPR19PTgorI2RlZmluZSBEVU1QTE9HKG4sIG5hbWUxLCBuYW1lMiwgYVN0ciwgc2l6ZSkgZG8geyAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICBpbnQgaTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiJWQuICVzOiAlcyA9IFxuIiwgbiwgbmFtZTEsIG5hbWUyKTsgXAorICAgICAgICBmb3IgKGkgPSAwOyBpIDwgc2l6ZTsgaSsrKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIiUyLjJ4JXMiLCAoKHVuc2lnbmVkIGNoYXIgKilhU3RyKVtpXSwgaSAlIDE2ID09IDE1ID8g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1RZUEVfV0RTX0FQLCAgICAgICAgIC8vIEJULUFNUCBBUAorICAgIGVDU1JfQlNTX1RZUEVfV0RTX1NUQSwgICAgICAgIC8vIEJULUFNUCBzdGF0aW9uCisgICAgZUNTUl9CU1NfVFlQRV9BTlksIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisjZW5kaWYKK2VDc3JSb2FtQnNzVHlwZSAKK2NvbnZlcnRSb2xlVG9Cc3NUeXBlCisoCisgICAgdFdMQU5fQkFQUm9sZSBiYXBSb2xlICAvKiBCVC1BTVAgcm9sZSAqLworKSAKK3sKKyAgICBzd2l0Y2ggKGJhcFJvbGUpCisgICAgeworICAgICAgICBjYXNlIEJUX1JFU1BPTkRFUjogCisgICAgICAgICAgICAvLyBhbiBXRFMgbmV0d29yayB3ZSB3aWxsIGpvaW4KKyAgICAgICAgICAgIHJldHVybiBlQ1NSX0JTU19UWVBFX1dEU19TVEE7ICAgICAgICAgICAgCisgICAgICAgICAgICAvL3JldHVybiBlQ1NSX0JTU19UWVBFX0lORlJBU1RSVUNUVVJFOyAgICAgICAgICAgIAorICAgICAgICAgICAgLy9yZXR1cm4gZUNTUl9CU1NfVFlQRV9JQlNTOyAgICAgLy8gSW5pdGlhbCB0ZXN0aW5nIHdpdGggSUJTUyBvbiBib3RoIGVuZHMgbWFrZXMgbW9yZSBzZW5zZQorICAgICAgICBjYXNlIEJUX0lOSVRJQVRPUjogCisgICAgICAgICAgICAvLyBhbiBXRFMgbmV0d29yayB3ZSB3aWxsIHN0YXJ0IGlmIG5vIHBhcnRuZXJzIGRldGVjdGVkLgorICAgICAgICAgICAgcmV0dXJuIGVDU1JfQlNTX1RZUEVfV0RTX0FQOyAgICAgIAorICAgICAgICAgICAgLy9yZXR1cm4gZUNTUl9CU1NfVFlQRV9TVEFSVF9JQlNTOyAvLyBJIHJlYWxseSBzaG91bGQgdHJ5IElCU1Mgb24gYm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pdGVyOworICAgIC8vc3ByaW50ZihwdHIsICIlLjJ4JWMiLCBieXRlc1tpXSwgZGVsaW1pdGVyKTsKKyAgICAvL3B0ciArPSAzOworICB9CisKKyAgLy8gRGVsZXRlIHRoZSBleHRyYSBwdW5jdHVhdGlvbiBhbmQgbnVsbCB0ZXJtaW5hdGUgdGhlIHN0cmluZworICBpZiAobGVuID4gMCkKKyAgICAgIHB0ci0tOworICAqcHRyID0gJ1wwJzsKKworICByZXR1cm4gYnVmOworfS8vIGJhcEJpbjJIZXgKKworY2hhciBiYXBTc2lkUHJlZml4VmFsdWVbXSA9IHsnQScsICdNJywgJ1AnLCAnLSd9OworCit2X1U4X3QgKiAKK2NvbnZlcnRCU1NJRFRvU1NJRAorKAorICAgIHZfVThfdCAqYnNzaWQgIC8qIEJTU0lEIHZhbHVlICovCispIAoreworICAgIHN0YXRpYyB2X1U4X3Qgc3NJZFszMl07IAorCisgICAgdm9zX21lbV9jb3B5KCAKKyAgICAgICAgICAgIHNzSWQsIAorICAgICAgICAgICAgYmFwU3NpZFByZWZpeFZhbHVlLCAKKyAgICAgICAgICAgIDQpOyAKKworICAgIHZvc19tZW1fY29weSggCisgICAgICAgICAgICAmc3NJZFs0XSwgCisgICAgICAgICAgICBiYXBCaW4ySGV4KGJzc2lkLCA2LCAnLScpLAorICAgICAgICAgICAgMTcpOyAKKworICAgIHJldHVybiBzc0lkOworfSAvLyBjb252ZXJ0QlNTSURUb1NTSUQKKworVk9TX1NUQVRVUworY29udmVydFRvQ3NyUHJvZmlsZQorKAorICAgIHB0QnRhbXBDb250ZXh0IGJ0YW1wQ29udGV4dCwgLyogYnRhbXBDb250ZXh0IHZhbHVlICovICAgIAorICAgIGVDc3JSb2FtQnNzVHlwZSBic3NUeXBlLAorICAgIHRDc3JSb2FtUHJvZmlsZSAqcFByb2ZpbGUgICAvKiByZXR1cm4gdGhlIHByb2ZpbGUgaW5mbyBoZXJlICovCispIAoreworICAgIHN0YXRpYyB2X1U4X3QgYnRhb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yKSk7CisgICAgCisgICAgICAgIHZvc19tZW1femVybyhwUHJvZmlsZS0+U1NJRHMuU1NJRExpc3RbMF0uU1NJRC5zc0lkLCAKKyAgICAgICAgICAgICAgICBzaXplb2YocFByb2ZpbGUtPlNTSURzLlNTSURMaXN0WzBdLlNTSUQuc3NJZCkpOworICAgICAgICB2b3NfbWVtX2NvcHkocFByb2ZpbGUtPlNTSURzLlNTSURMaXN0WzBdLlNTSUQuc3NJZCwKKyAgICAgICAgICAgICAgICBjb252ZXJ0QlNTSURUb1NTSUQoYnRhbXBDb250ZXh0LT5idGFtcF9SZW1vdGVfQU1QX0Fzc29jLkhDX21hY19hZGRyKSwKKyAgICAgICAgICAgICAgICAyMSk7ICAvLyBMZW5ndGggb2YgQlRBTVAgU1NJRCBpcyAyMSBieXRlcworICAgICAgICBwUHJvZmlsZS0+U1NJRHMuU1NJRExpc3RbMF0uU1NJRC5sZW5ndGggPSAyMTsKKworICAgICAgICB2b3NfbWVtX3plcm8ocFByb2ZpbGUtPlNTSURzLlNTSURMaXN0WzFdLlNTSUQuc3NJZCwgCisgICAgICAgICAgICAgICAgc2l6ZW9mKHBQcm9maWxlLT5TU0lEcy5TU0lETGlzdFsxXS5TU0lELnNzSWQpKTsKKyAgICAgICAgdm9zX21lbV9jb3B5KHBQcm9maWxlLT5TU0lEcy5TU0lETGlzdFsxXS5TU0lELnNzSWQsCisgICAgICAgICAgICAgICAgY29udmVydEJTU0lEVG9TU0lEKGJ0YW1wQ29udGV4dC0+c2VsZl9tYWNfYWRkciksCisgICAgICAgICAgICAgICAgMjEpOyAgLy8gTGVuZ3RoIG9mIEJUQU1QIFNTSUQgaXMgMjEgYnl0ZXMKKyAgICAgICAgcFByb2ZpbGUtPlNTSURzLlNTSURMaXN0WzFdLlNTSUQubGVuZ3RoID0gMjE7CisgCisgICAgICAgIC8vU2V0IHRoZSBCU1NJRCB0byB0aGUgUmVtb3RlIEFQCisgICAgICAgIHBQcm9maWxlLT5CU1NJRHMubnVtT2ZCU1NJRHMgPSAxOworICAgICAgICB2b3NfbWVtX2NvcHkocFByb2ZpbGUtPkJTU0lEcy5ic3NpZCwgCisgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5idGFtcF9SZW1vdGVfQU1QX0Fzc29jLkhDX21hY19hZGRyLCAKKyAgICAgICAgICAgICAgICBzaXplb2YoIHRDc3JCc3NpZCApICk7IAorIAorICAgIH0KKyAgICBlbHNlIGlmICggYnNzVHlwZSA9PSBlQ1NSX0JTU19UWVBFX1dEU19BUCkKKyAgICB7CisgICAgICAgIHBQcm9maWxlLT5TU0lEcy5udW1PZlNTSURzID0gMTsKKworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiJXM6IGJzc1R5cGUgPSAlcywgU1NJRCBzcGVjaWZpZWQgPSAlc1xuIiwgX19mdW5jX18sICJlQ1NSX0JTU19UWVBFX1dEU19BUCIsIGNvbnZlcnRCU1NJRFRvU1NJRChidGFtcENvbnRleHQtPnNlbGZfbWFjX2FkZHIpKTsKKyAgICAKKyAgICAgICAgdm9zX21lbV96ZXJvKHBQcm9maWxlLT5TU0lEcy5TU0lETGlzdFswXS5TU0lELnNzSWQsIAorICAgICAgICAgICAgICAgIHNpemVvZihwUHJvZmlsZS0+U1NJRHMuU1NJRExpc3RbMF0uU1NJRC5zc0lkKSk7CisgICAgICAgIHZvc19tZW1fY29weShwUHJvZmlsZS0+U1NJRHMuU1NJRExpc3RbMF0uU1NJRC5zc0lkLAorICAgICAgICAgICAgICAgIGNvbnZlcnRCU1NJRFRvU1NJRChidGFtcENvbnRleHQtPnNlbGZfbWFjX2FkZHIpLAorICAgICAgICAgICAgICAgIDIxKTsgIC8vIExlbmd0aCBvZiBCVEFNUCBTU0lEIGlzIDIxIGJ5dGVzCisgICAgICAgIHBQcm9maWxlLT5TU0lEcy5TU0lETGlzdFswXS5TU0lELmxlbmd0aCA9IDIxOworIA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ICAgICAgICAgICAgIGNhc2UgMjU0OgorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogY2xhc3MgMjU0IGlzIHNwZWNpYWwgcmVndWxhdG9yeSBjbGFzcyBkZWZpbmVkIGJ5IEJUIEhTKzMuMCBzcGVjIHRoYXQKKyAgICAgICAgICAgICAgICAgICAgICAgaXMgdmFsaWQgb25seSBmb3IgdW5rbm93bi8nbW9iaWxlJyBjb3VudHJ5ICovCisgICAgICAgICAgICAgICAgICAgIGlmICgoYnRhbXBDb250ZXh0LT5idGFtcF9SZW1vdGVfQU1QX0Fzc29jLkhDX3ByZWZfY291bnRyeVswXSA9PSAnWCcpICYmCisgICAgICAgICAgICAgICAgICAgICAgICAoYnRhbXBDb250ZXh0LT5idGFtcF9SZW1vdGVfQU1QX0Fzc29jLkhDX3ByZWZfY291bnRyeVsxXSA9PSAnWCcpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICByZWd1bGF0b3J5Q2xhc3MgPSAyNTQ7CisgICAgICAgICAgICAgICAgICAgICAgICBmaXJzdENoYW5uZWwgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgbnVtQ2hhbm5lbHMgPSAxMTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBjYXNlIDEyOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBjbGFzcyAxMiBpbiB0aGUgVVMgcmVndWxhdG9yeSBkb21haW4gaXMgMi40R0h6IGNoYW5uZWxzIDEtMTEgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKChidGFtcENvbnRleHQtPmJ0YW1wX1JlbW90ZV9BTVBfQXNzb2MuSENfcHJlZl9jb3VudHJ5WzBdID09ICdVJykgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIChidGFtcENvbnRleHQtPmJ0YW1wX1JlbW90ZV9BTVBfQXNzb2MuSENfcHJlZl9jb3VudHJ5WzFdID09ICdTJykpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlZ3VsYXRvcnlDbGFzcyA9IDEyOworICAgICAgICAgICAgICAgICAgICAgICAgZmlyc3RDaGFubmVsID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bUNoYW5uZWxzID0gMTE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qIGNsYXNzIDQgaW4gdGhlIEV1cm9wZSByZWd1bGF0b3J5IGRvbWFpbiBpcyAyLjRHSHogY2hhbm5lbHMgMS0xMyAqLworICAgICAgICAgICAgICAgICAgICBpZiAoKGJ0YW1wQ29udGV4dC0+YnRhbXBfUmVtb3RlX0FNUF9Bc3NvYy5IQ19wcmVmX2NvdW50cnlbMF0gPT0gJ0cnKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgKGJ0YW1wQ29udGV4dC0+YnRhbXBfUmVtb3RlX0FNUF9Bc3NvYy5IQ19wcmVmX2NvdW50cnlbMV0gPT0gJ0InKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcmVndWxhdG9yeUNsYXNzID0gNDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0Q2hhbm5lbCA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICBudW1DaGFubmVscyA9IDEzOworICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY2FzZSAzMDoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogY2xhc3MgMzAgaW4gdGhlIEphcGFuIHJlZ3VsYXRvcnkgZG9tYWluIGlzIDIuNEdIeiBjaGFubmVscyAxLTEzICovCisgICAgICAgICAgICAgICAgICAgIGlmICgoYnRhbXBDb250ZXh0LT5idGFtcF9SZW1vdGVfQU1QX0Fzc29jLkhDX3ByZWZfY291bnRyeVswXSA9PSAnSicpICYmCisgICAgICAgICAgICAgICAgICAgICAgICAoYnRhbXBDb250ZXh0LT5idGFtcF9SZW1vdGVfQU1QX0Fzc29jLkhDX3ByZWZfY291bnRyeVsxXSA9PSAnUCcpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICByZWd1bGF0b3J5Q2xhc3MgPSAzMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0Q2hhbm5lbCA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICBudW1DaGFubmVscyA9IDEzOworICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgLyogaWYgdGhlIG5leHQgdHJpcGxldCBpcyBub3QgYW5vdGhlciByZWd1bGF0b3J5IGNsYXNzIHRyaXBsZXQgdGhlbiBpdCBtdXN0IGJlIGEgc3ViLWJhbmQKKyAgICAgICAgICAgICAgIHRyaXBsZXQuIFNraXAgcHJvY2Vzc2luZyB0aGUgZGVmYXVsdCBjaGFubmVscyBmb3IgdGhpcyByZWd1bGF0b3J5IGNsYXNzIHRyaXBsZXQgYW5kIGxldAorICAgICAgICAgICAgICAgdGhlIHN1Yi1iYW5kIHRyaXBsZXQgcmVzdHJpY3QgdGhlIGF2YWlsYWJsZSBjaGFubmVscyAqLworICAgICAgICAgICAgaWYgKCgodHJpcGxldCsxKSA8IGJ0YW1wQ29udGV4dC0+YnRhbXBfUmVtb3RlX0FNUF9Bc3NvYy5IQ19wcmVmX251bV90cmlwbGV0cykgJiYKKyAgICAgICAgICAgICAgICAoYnRhbXBDb250ZXh0LT5idGFtcF9SZW1vdGVfQU1QX0Fzc29jLkhDX3ByZWZfdHJpcGxldHNbdHJpcGxldCsxXVswXSAhPSAyMDEpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgICAgICAvKiBpZiB0aGUgcmVndWxhdG9yeSBjbGFzcyBpcyB2YWxpZCB0aGVuIHRoaXMgaXMgYSBzdWItYmFuZCB0cmlwbGV0ICovCisgICAgICAgICAgICBpZiAocmVndWxhdG9yeUNsYXNzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGZpcnN0Q2hhbm5lbCA9IGJ0YW1wQ29udGV4dC0+YnRhbXBfUmVtb3RlX0FNUF9Bc3NvYy5IQ19wcmVmX3RyaXBsZXRzW3RyaXBsZXRdWzBdOworICAgICAgICAgICAgICAgIG51bUNoYW5uZWxzID0gYnRhbXBDb250ZXh0LT5idGFtcF9SZW1vdGVfQU1QX0Fzc29jLkhDX3ByZWZfdHJpcGxldHNbdHJpcGxldF1bMV07CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoZmlyc3RDaGFubmVsICYmIG51bUNoYW5uZWxzKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoIWJ0YW1wQ29udGV4dC0+YnRhbXBfQU1QX0Fzc29jLkhDX3ByZWZfbnVtX3RyaXBsZXRzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBQcm9maWxlLT5vcGVyYXRpb25DaGFubmVsID0gZmlyc3RDaGFubmVsOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoKChidGFtcENvbnRleHQtPmJ0YW1wX0FNUF9Bc3NvYy5IQ19wcmVmX3RyaXBsZXRzWzFdWzBdICsgYnRhbXBDb250ZXh0LT5idGFtcF9BTVBfQXNzb2MuSENfcHJlZl90cmlwbGV0c1sxXVsxXSkgPD0gZmlyc3RDaGFubmVsKSB8fAorICAgICAgICAgICAgICAgKChmaXJzdENoYW5uZWwgKyBudW1DaGFubmVscyApIDw9IGJ0YW1wQ29udGV4dC0+YnRhbXBfQU1QX0Fzc29jLkhDX3ByZWZfdHJpcGxldHNbMV1bMF0pKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoKGJ0YW1wQ29udGV4dC0+YnRhbXBfQU1QX0Fzc29jLkhDX3ByZWZfdHJpcGxldHNbMV1bMF0gKyBidGFtcENvbnRleHQtPmJ0YW1wX0FNUF9Bc3NvYy5IQ19wcmVmX3RyaXBsZXRzWzFdWzFdKSA+IGZpcnN0Q2hhbm5lbCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwUHJvZmlsZS0+b3BlcmF0aW9uQ2hhbm5lbCA9IGZpcnN0Q2hhbm5lbDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKChmaXJzdENoYW5uZWwgKyBudW1DaGFubmVscykgPiBidGFtcENvbnRleHQtPmJ0YW1wX0FNUF9Bc3NvYy5IQ19wcmVmX3RyaXBsZXRzWzFdWzBdKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBQcm9maWxlLT5vcGVyYXRpb25DaGFubmVsID0gIGJ0YW1wQ29udGV4dC0+YnRhbXBfQU1QX0Fzc29jLkhDX3ByZWZfdHJpcGxldHNbMV1bMF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBpZiAoIXBQcm9maWxlLT5vcGVyYXRpb25DaGFubmVsKQorICAgIHsKKyAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTl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5CQVBfU1RBVFVTX1NVQ0NFU1M7CisgICAgLyogSW5pdGlhdGUgdGhlIGxpbmsgYXMgZWl0aGVyIFNUQVJUIG9yIEpPSU4gKi8KKyAgICAvL2hhbFN0YXR1cyA9IGNzclJvYW1PcGVuU2Vzc2lvbigmbmV3U2Vzc2lvbik7CisgICAgLypBZGRlZCBieSBMdWl6YToqLworCisgICAgaWYgKGJ0YW1wQ29udGV4dC0+aXNCYXBTZXNzaW9uT3BlbiA9PSBGQUxTRSkKKyAgICB7CisKKyAgICAgICAgaGFsU3RhdHVzID0gc21lX09wZW5TZXNzaW9uKGhIYWwsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTkJBUF9Sb2FtQ2FsbGJhY2ssIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gPD09PSBKRVowODEyMTA6IEZJWE1FCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyh0QU5JX1U4ICopIGJ0YW1wQ29udGV4dC0+c2VsZl9tYWNfYWRkciwgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5zZWxmX21hY19hZGRyLCAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmYnRhbXBDb250ZXh0LT5zZXNzaW9uSWQpOworICAgICAgICBpZihlSEFMX1NUQVRVU19TVUNDRVNTID09IGhhbFN0YXR1cykKKyAgICAgICAgeworICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5pc0JhcFNlc3Npb25PcGVuID0gVFJVRTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAic21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LnBDb25uZWN0ZWRQcm9maWxlLT5xb3NDb25uZWN0aW9uOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBidGFtcENvbnRleHQtPmJhcFFvc0NmZy5iV21tSXNFbmFibGVkID0gMDsgCisgICAgfQorCisgICAgLy8gc2V0IHRoZSBRb1MgZmllbGQgYXBwcm9wcmlhdGVseQorICAgIGlmKCBidGFtcENvbnRleHQtPmJhcFFvc0NmZy5iV21tSXNFbmFibGVkICkKKyAgICB7CisgICAgICAgc3RhRGVzYy51Y1Fvc0VuYWJsZWQgPSAxOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgIHN0YURlc2MudWNRb3NFbmFibGVkID0gMDsKKyAgICB9CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiQkFQIHJlZ2lzdGVyIFRMIFFvU19lbmFibGVkPSVkXG4iLCAKKyAgICAgICAgICAgICAgIHN0YURlc2MudWNRb3NFbmFibGVkICk7CisKKyAgICAvLyBVTUEgaXMgcmVhZHkgd2UgaW5mb3JtIFRMIG5vdCB0byBkbyBmcmFtZSAKKyAgICAvLyB0cmFuc2xhdGlvbiBmb3IgV2luTW9iIDYuMQorICAgIC8vKioqIE5vdCB0byBlbmFibGVkIFVNQS4KKyAgICAvKiBFbmFibGUgVU1BIGZvciBUWCB0cmFuc2xhdGlvbiBvbmx5IHdoZW4gdGhlcmUgaXMgbm8gY29uY3VycmVudCBzZXNzaW9uIGFjdGl2ZSAqLworICAgIHN0YURlc2MudWNTd0ZyYW1lVFhYbGF0aW9uID0gMTsKKyAgICBzdGFEZXNjLnVjU3dGcmFtZVJYWGxhdGlvbiA9IDE7IAorICAgIHN0YURlc2MudWNBZGRSbXZMTEMgPSAwOworCisgICAgaWYgKCBidGFtcENvbnRleHQtPnVjU2VjRW5hYmxlZCApCisgICAgeworICAgICAgIHN0YURlc2MudWNQcm90ZWN0ZWRGc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MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgICAiJXM6IFdMQU5UTF9SZWdpc3RlclNUQUNsaWVudCgpIGZhaWxlZCB0byByZWdpc3Rlci4gIFN0YXR1cz0gJWQgWzB4JTA4WF0iLAorICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHZvc1N0YXR1cywgdm9zU3RhdHVzICk7CisgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgIAorICAgIGlmICggISAgYnRhbXBDb250ZXh0LT51Y1NlY0VuYWJsZWQgKQorICAgIHsKKyAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19NRUQsCisgICAgICAgICAgICAgICAgICAib3Blbi9zaGFyZWQgYXV0aCBTdGFJZD0gJWQuICBDaGFuZ2luZyBUTCBzdGF0ZSB0byBBVVRIRU5USUNBVEVEIGF0IEpvaW4gdGltZSIsIGJ0YW1wQ29udGV4dC0+dWNTVEFJZCk7CisgICAgCisgICAgICAgLy8gQ29ubmVjdGlvbnMgdGhhdCBkbyBub3QgbmVlZCBVcHBlciBsYXllciBhdXRoLCB0cmFuc2l0aW9uIFRMIGRpcmVjdGx5CisgICAgICAgLy8gdG8gJ0F1dGhlbnRpY2F0ZWQnIHN0YXRlLiAgICAgIAorICAgICAgIHZvc1N0YXR1cyA9IFdMQU5UTF9DaGFuZ2VTVEFTdGF0ZSggYnRhbXBDb250ZXh0LT5wdm9zR0N0eCwgc3RhRGVzYy51Y1NUQUlkLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX1NUQV9BVVRIRU5USUNBVEVEICk7CisgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgZWxzZQorICAgIHsKKworICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX01FRCwKKyAgICAgICAgICAgICAgICAgICJVTEEgYXV0aCBTdGFJZD0gJWQuICBDaGFuZ2luZyBUTCBzdGF0ZSB0byBDT05ORUNURUQgYXQgSm9pbiB0aW1lIiwgYnRhbXBDb250ZXh0LT51Y1NUQUlkICk7CisgICAgICAKKyAgICAgICB2b3NTdGF0dXMgPSBXTEFOVExfQ2hhbmdlU1RBU3RhdGUoIGJ0YW1wQ29udGV4dC0+cHZvc0dDdHgsIHN0YURlc2MudWNTVEFJZCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfU1RBX0NPTk5FQ1RFRCApOworICAgIH0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorCisgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30gLyogcmVnU3RhV2l0aFRsICovCisKKyNpZiAwCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT046ICBkZXRlcm1pbmVDaGFuCisKKyAgREVTQ1JJUFRJT046ICBSZXR1cm4gdGhlIGN1cnJlbnQgY2hhbm5lbCB3ZSBhcmUgdG8gb3BlcmF0ZSBvbgorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKyNlbmRpZgorCitWT1NfU1RBVFVTCitkZXRlcm1pbmVDaGFuCisoCisgICAgcHRCdGFtcENvbnRleHQgYnRhbXBDb250ZXh0LCAvKiBidGFtcENvbnRleHQgdmFsdWUgKi8gICAgCisgICAgdFdMQU5fQkFQUm9sZSBCQVBEZXZpY2VSb2xlLAorICAgIHZfVTMyX3QgKmNoYW5uZWwsICAvKiBDdXJyZW50IGNoYW5uZWwgKi8KKyAgICB2X1U4X3QgKnN0YXR1cyAgICA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TWFyayB0aGlzIExvZ2ljYWwgTGluayBpbmRleCB2YWx1ZSBhcyBmcmVlICovCisgICAgICAgICAgICBwTG9nTGlua0NvbnRleHQtPnByZXNlbnQgPSBWT1NfRkFMU0U7IAorCisgICAgICAgICAgICAvLyBzaWduYWxIQ0lEaXNjTG9nTGluayhzdGF0dXMgPSBTVUNDRVNTLCByZWFzb24gPSBDT05ORUNUSU9OX1RFUk1fQllfUkVNT1RFX0hPU1QpOworICAgICAgICAgICAgc2lnbmFsSENJRGlzY0xvZ0xpbmtDb21wRXZlbnQgCisgICAgICAgICAgICAgICAgKCBidGFtcENvbnRleHQsIAorICAgICAgICAgICAgICAgICAgV0xBTkJBUF9TVEFUVVNfU1VDQ0VTUywgCisgICAgICAgICAgICAgICAgICBpLCAgIC8vIGxvZ2ljYWwgbGluayAKKyAgICAgICAgICAgICAgICAgIC8vIEkgZG9uJ3Qga25vdyBob3cgdG8gc2lnbmFsIENPTk5FQ1RJT05fVEVSTV9CWV9SRU1PVEVfSE9TVAorICAgICAgICAgICAgICAgICAgV0xBTkJBUF9FUlJPUl9URVJNX0JZX0xPQ0FMX0hPU1QpOworICAgICAgICB9CisgICAgfQorCisgICAgLypSZXNldCBjdXJyZW50X2xvZ19saW5rX2luZGV4IGFuZCB0b3RhbF9sb2dfbGlua19pbmRleCB2YWx1ZXMqLworICAgIGJ0YW1wQ29udGV4dC0+Y3VycmVudF9sb2dfbGlua19pbmRleCA9IDA7IAorICAgIGJ0YW1wQ29udGV4dC0+dG90YWxfbG9nX2xpbmtfaW5kZXggPSAwOyAKKworICAgIC8qIEZvcm1hdCB0aGUgUGh5c2ljYWwgTGluayBEaXNjb25uZWN0IENvbXBsZXRlIGV2ZW50IHRvIHJldHVybi4uLiAqLyAKKyAgICBiYXBIQ0lFdmVudC5iYXBIQ0lFdmVudENvZGUgPSBCVEFNUF9UTFZfSENJX0RJU0NPTk5FQ1RfUEhZU0lDQUxfTElOS19DT01QTEVURV9FVkVOVDsKKyAgICBiYX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BwcmVkaWNhdGUgKi8KK3ZfVTMyX3QgCit2YWxpZEFzc29jSW5kCisoIAorICAgIHB0QnRhbXBDb250ZXh0IGJ0YW1wQ29udGV4dCwgLyogYnRhbXBDb250ZXh0IHZhbHVlICovICAgIAorICAgIHRDc3JSb2FtSW5mbyAqcFJvYW1JbmZvCispCit7CisgICAgLyogdEhhbEhhbmRsZSAqLyAgICAKKyAgICB0SGFsSGFuZGxlIGhIYWwgPSBWT1NfR0VUX0hBTF9DQihidGFtcENvbnRleHQtPnB2b3NHQ3R4KTsKKyAgICB2X1UzMl90IGllTGVuOyAKKyAgCisgICAgLyogRm9yIG5vdywgYWx3YXlzIHJldHVybiB0cnVlICovIAorICAgIHJldHVybiBWT1NfVFJVRTsKKworICAgIC8qIENoZWNrIGZvciBhIHZhbGlkIHBlZXIgTUFDIGFkZHJlc3MgKi8KKyAgICAvKiBGb3IgYW4gaW5jb21pbmcgQXNzb2MgSW5kaWNhdGlvbiwgdGhlIHBlZXIgTUFDIGFkZHJlc3MKKyAgICAgKiBzaG91bGQgbWF0Y2ggdGhlIHZhbHVlIHRoYXQgdGhlIEJsdWVUb290aCBBTVAgCisgICAgICogY29uZmlndXJlZCB1cyB3aXRoLgorICAgICAqLworICAgIGlmICggIXZvc19tZW1fY29tcGFyZSggYnRhbXBDb250ZXh0LT5wZWVyX21hY19hZGRyLCAKKyAgICAgICAgICAgICAgICBwUm9hbUluZm8tPnBlZXJNYWMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKGJ0YW1wQ29udGV4dC0+cGVlcl9tYWNfYWRkcikgKSkKKyAgICB7CisgICAgICAgIC8qIFJldHVybiBub3QgdmFsaWQgKi8gCisgICAgICAgIHJldHVybiBWT1NfRkFMU0U7CisgICAgfQorCisgICAgLyogSkVaMDgxMTE1OiBGb3Igbm93LCBpZ25vcmUgdGhlIFJTTiBJRSAqLyAKKyAgICAvKiBPdGhlcndpc2UsIGl0IGlzIHZhbGlkICovIAorICAgIHJldHVybiBWT1NfVFJVRTsKKworICAgIC8qIENoZWNrIGZvciBhIHRyaXZpYWwgY2FzZTogSUVzIG1pc3NpbmcgKi8KKyAgICBpZiggcFJvYW1JbmZvLT5wcnNuSUUgPT0gTlVMTCApCisgICAgeworICAgICAgICAvL2J0YW1wQ29udGV4dC0+aWVGaWVsZHMgPSBOVUxMOworICAgICAgICAvL2J0YW1wQ29udGV4dC0+aWVMZW4gPSAwOyAKKyAgICAgICAgIC8qIFJldHVybiBub3QgdmFsaWQgKi8gCisgICAgICAgIHJldHVybiBWT1NfRkFMU0U7CisgICAgfQorCisgICAvL2J0YW1wQ29udGV4dC0+aWVMZW4gPSBHRVRfSUVfTEVOX0lOX0JTUyggcEJzc0Rlc2MtPmxlbmd0aCApOworICAgLy9pZUxlbiA9IEdFVF9JRV9MRU5fSU5fQlNTKCBwQnNzRGVzYy0+bGVuZ3RoICk7CisgICBpZUxlbiA9IHBSb2FtSW5mby0+cnNuSUVMZW47CisgCisgICAgLyogQ2hlY2sgZm9yIGEgdHJpdmlhbCBjYXNlOiBJRXMgemVybyBsZW5ndGggKi8KKyAgICAvL2lmKCBidGFtcENvbnRleHQtPmllTGVuID09IDAgKQorICAgIGlmKCBpZUxlbiA9PSAwICkKKyAgICB7CisgICAgICAgIC8vYnRhbXBDb250ZXh0LT5pZUZpZWxkcyA9IE5VTEw7CisgICAgICAgIC8vYnRhbXBDb250ZXh0LT5pZUxlbiA9IDA7IAorICAgICAgICAgLyogUmV0dXJuIG5vdCB2YWxpZCAqLyAKKyAgICAgICAgcmV0dXJuIFZPU19GQUxTRTsKKyAgICB9CisKKyAgICB7CisgICAgICAgIC8vIC0tLSAgU3RhcnQgb2YgYmxvY2sgLS0tCisgICAgdERvdDExZkJlYWNvbklFcyBkb3QxMUJlYWNvbklFczsgCisgICAgdERvdDExZklFU1NJRCAqcERvdDExU1NJRDsKKyAgICB0RG90MTFmSUVSU04gICpwRG90MTFSU047CisgCisgICAgLy8gSkVaMDgxMjE1OiB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WRMZW4gPSBwRG90MTFTU0lELT5udW1fc3NpZDsgIAorICAgICAgICB2b3NfbWVtX2NvcHkoYnRhbXBDb250ZXh0LT5hc3NvY1NzaWQsIAorICAgICAgICAgICAgICAgIHBEb3QxMVNTSUQtPnNzaWQsIAorICAgICAgICAgICAgICAgIGJ0YW1wQ29udGV4dC0+YXNzb2NTc2lkTGVuICk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICByZXR1cm4gVk9TX0ZBTFNFOworCisgICAgLy8gQ2hlY2sgdGhlIHZhbGlkaXR5IG9mIHRoZSBTU0lEIGFnYWluc3Qgb3VyIFNTSUQgdmFsdWUKKyAgICBpZiAoICF2b3NfbWVtX2NvbXBhcmUoIGJ0YW1wQ29udGV4dC0+b3duU3NpZCwgCisgICAgICAgICAgICAgICAgcERvdDExU1NJRC0+c3NpZCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5vd25Tc2lkTGVuICkpCisgICAgICAgIHsKKyAgICAgICAgLyogUmV0dXJuIG5vdCB2YWxpZCAqLyAKKyAgICAgICAgcmV0dXJuIFZPU19GQUxTRTsKKyAgICB9CisKKyAgICBwRG90MTFSU04gPSAmZG90MTFCZWFjb25JRXMuUlNOOyAKKworICAgIC8vIEFzc3VtZSB0aGVyZSB3YXNuJ3QgYW4gUlNOIElFIGluIHRoZSBBc3NvYyBSZXF1ZXN0CisgICAgLy9idGFtcENvbnRleHQtPmFzc29jUnNuSWVMZW4gPSAwOworCisgICAgICAgIGlmIChwRG90MTFSU04tPnByZXNlbnQgKQorICAgICAgICB7CisKKyAgICAgICAgLy9EVU1QTE9HKDEwLCAgX19mdW5jX18sICJwRG90MTFSU04gcHJlc2VudCIsIHBEb3QxMVJTTiwgNjQpOworCisgICAgICAgIC8vVGhlIDgwMi4xMSBCVC1BTVAgUEFMIG9ubHkgc3VwcG9ydHMgV1BBMi1QU0sgIAorICAgICAgICBpZiAoIXZvc19tZW1fY29tcGFy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ICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5zZXNzaW9uSWQpOworICAgICAgICAgIC8qQWRkZWQgYnkgTHVpemE6Ki8KKyAgICAgICAgICBidGFtcENvbnRleHQtPmlzQmFwU2Vzc2lvbk9wZW4gPSBGQUxTRTsgCisgICAgICAgICAgfQorICAgICAgICAgIC8qQWN0aW9uIGNvZGUgZm9yIHRyYW5zaXRpb24gKi8KKyNlbmRpZgorCisgICAgICAgICAgLyogU2V0IEJBUCBkZXZpY2Ugcm9sZSAqLworICAgICAgICAgIHZvc1N0YXR1cyA9IGdvdG9TMShidGFtcENvbnRleHQsIGJhcEV2ZW50LCBCVF9SRVNQT05ERVIsIHN0YXR1cyk7CisgICAgICAgICAgLypBZHZhbmNlIG91dGVyIHN0YXRldmFyICovCisgICAgICAgICAgYnRhbXBmc21DaGFuZ2VUb1N0YXRlKGluc3RhbmNlVmFyLFMxKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiSW4gJXMsIGluIHN0YXRlICVzLCBpbnZhbGlkIGV2ZW50IG1zZyAlZCIsIF9fZnVuY19fLCAiRElTQ09OTkVDVEVEIiwgbXNnKTsKKyAgICAgICAgICAvKiBJbnRlbnRpb25hbGx5IGxlZnQgYmxhbmsgKi8KKyAgICAgICAgfQorICAgICAgYnJlYWs7CisKKyAgICAgIGNhc2UgUzE6CisgICAgICAgIGlmKChtc2c9PShCVEFNUEZTTV9FVkVOVF9UKWVXTEFOX0JBUF9IQ0lfV1JJVEVfUkVNT1RFX0FNUF9BU1NPQworICAgICAgICAgICApICYmIChidGFtcENvbnRleHQtPkJBUERldmljZVJvbGUgPT0gQlRfSU5JVElBVE9SICYmICEoQ0hBTk5FTF9OT1RfU0VMRUNURUQpKSkKKyAgICAgICAgeworICAgICAgICAgIC8qVHJhbnNp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BfQVNTT0MKKyAgICAgICAgICAgICAgICApICYmIChidGFtcENvbnRleHQtPkJBUERldmljZVJvbGUgPT0gQlRfSU5JVElBVE9SICYmIENIQU5ORUxfTk9UX1NFTEVDVEVEKSkKKyAgICAgICAgeworICAgICAgICAgIC8qVHJhbnNpdGlvbiBmcm9tIFMxIHRvIFNDQU5OSU5HIChib3RoIHdpdGhvdXQgc3Vic3RhdGVzKSovCisgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIkluICVzLCBmcm9tIHN0YXRlICVzID0+ICVzIiwgX19mdW5jX18sICJTMSIsICJTQ0FOTklORyIpOworCisgICAgICAgICAgLypBY3Rpb24gY29kZSBmb3IgdHJhbnNpdGlvbiAqLworICAgICAgICAgIGdvdG9TY2FubmluZyhidGFtcENvbnRleHQsIEJUX1JFU1BPTkRFUiwgc3RhdHVzKTsKKyAgICAgICAgICAvKkFkdmFuY2Ugb3V0ZXIgc3RhdGV2YXIgKi8KKyAgICAgICAgICBidGFtcGZzbUNoYW5nZVRvU3RhdGUoaW5zdGFuY2VWYXIsU0NBTk5JTkcpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICJJbiAlcywgaW4gc3RhdGUgJXMsIGludmFsaWQgZXZlbnQgbXNnICVkIiwgX19mdW5jX18sICJTMSIsIG1zZyk7CisgICAgICAgICAgLyogSW50ZW50aW9uYWxseSBsZWZ0IGJsYW5rICovCisgICAgICAgIH0KKyAgICAgIGJyZWFrOworCisgICAgICBjYXNlIFNUQVJUSU5HOgorICAgICAgICBpZigobXNnPT0oQlRBTVBGU01fRVZFTlRfVCllV0xBTl9CQVBfTUFDX1NUQVJUX0JTU19TVUNDRVNTCisgICAgICAgICAgICkgJiYgKGJ0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JBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIkluICVzLCBmcm9tIHN0YXRlICVzID0+ICVzIiwgX19mdW5jX18sICJTVEFSVElORyIsICJESVNDT05ORUNUSU5HIik7CisKKyAgICAgICAgICAvKkFjdGlvbiBjb2RlIGZvciB0cmFuc2l0aW9uICovCisgICAgICAgICAgLy9jc3JSb2FtRGlzY29ubmVjdCgpOworICAgICAgICAgIHNtZV9Sb2FtRGlzY29ubmVjdChoSGFsLCAKKyAgICAgICAgICAgICAgICAgIC8vSkVaMDgxMTE1OiBGaXhtZSAKKyAgICAgICAgICAgICAgICAgIGJ0YW1wQ29udGV4dC0+c2Vzc2lvbklkLCAKKyAgICAgICAgICAgICAgICAgIC8vIERhbmxpbiwgd2hlcmUgYXJlIHRoZSByaWNoZXIgcmVhc29uIGNvZGVzPworICAgICAgICAgICAgICAgICAgLy8gSSB3YW50IHRvIGJlIGFibGUgdG8gY29udmV5IGV2ZXJ5dGhpbmcgODAyLjExIHN1cHBvcnRzLi4uCisgICAgICAgICAgICAgICAgICBlQ1NSX0RJU0NPTk5FQ1RfUkVBU09OX1VOU1BFQ0lGSUVEKTsKKworICAgICAgICAgIGdvdG9EaXNjb25uZWN0aW5nKAorICAgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LAorICAgICAgICAgICAgICAgICAgVk9TX1RSVUUsIAorICAgICAgICAgICAgICAgICAgV0xBTkJBUF9FUlJPUl9OT19DTkNULCAKKyAgICAgICAgICAgICAgICAgIC8vVk9TX1RSVUUsICAgLy8gU2hvdWxkIGJlIFZPU19GQUxTRSAhISEgCisgICAgICAgICAgICAgICAgICBWT1NfRkFMU0UsIAorICAgICAgICAgICAgICAgICAgV0xBTkJBUF9FUlJPUl9URVJNX0JZX0xPQ0FMX0hPU1QpOworICAgICAgICAgIC8qQWR2YW5jZSBvdXRlciBzdGF0ZXZhciAqLworICAgICAgICAgIGJ0YW1wZnNtQ2hhbmdlVG9TdGF0ZShpbnN0YW5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KCBidGFtcENvbnRleHQsIFdMQU5CQVBfRVJST1JfSE9TVF9SRUpfUkVTT1VSQ0VTICk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZigobXNnPT0oQlRBTVBGU01fRVZFTlRfVCllV0xBTl9CQVBfTUFDX1NUQVJUX0JTU19TVUNDRVNTCisgICAgICAgICAgICAgICAgKSAmJiAoYnRhbXBDb250ZXh0LT5CQVBEZXZpY2VSb2xlID09IEJUX1JFU1BPTkRFUikpCisgICAgICAgIHsKKyAgICAgICAgICAvKlRyYW5zaXRpb24gZnJvbSBTVEFSVElORyB0byBDT05ORUNUSU5HIChib3RoIHdpdGhvdXQgc3Vic3RhdGVzKSovCisgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIkluICVzLCBmcm9tIHN0YXRlICVzID0+ICVzIiwgX19mdW5jX18sICJTVEFSVElORyIsICJDT05ORUNUSU5HIik7CisKKyAgICAgICAgICAvKiBTZXQgdGhlIHNlbGVjdGVkIGNoYW5uZWwgKi8KKyAgICAgICAgICAvKnNob3VsZCBoYXZlIGJlZW4gYWxyZWFkeSBzZXQgKi8KKyAgICAgICAgICBidGFtcENvbnRleHQtPmNoYW5uZWwgPSAoIDAgPT0gYnRhbXBDb250ZXh0LT5jaGFubmVsICk/MTpidGFtcENvbnRleHQtPmNoYW5uZWw7CisKKyAgICAgICAgICAvKkFkdmFuY2Ugb3V0ZXIgc3RhdGV2YXIgKi8KKyAgICAgICAgICBidGFtcGZzbUNoYW5nZVRvU3RhdGUoaW5zdGFuY2VWYXIsQ09OTkVDVElORyk7CisgICAgICAgICAgLypBY3Rpb24gY29kZSBmb3IgdHJhbnNpdGlvbiAqLworICAgICAgICAgICAgZ290b0Nvbm5lY3RpbmcoYnRhbXBDb250ZXh0KTsKKyAgICAgICAgICAKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmKChtc2c9PShCVEFNUEZTTV9FVkVOVF9UKWVXTEFOX0JBUF9USU1FUl9DT05ORUNUX0FDQ0VQVF9USU1FT1VUKSkKKyAgICAgICAgeworICAgICAgICAgIC8qVHJhbnNpdGlvbiBmcm9tIFNUQVJUSU5HIHRvIERJU0NPTk5FQ1RJTkcgKGJvdGggd2l0aG91dCBzdWJzdGF0ZXMpKi8KKyAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiSW4gJXMsIGZyb20gc3RhdGUgJXMgPT4gJXMiLCBfX2Z1bmNfXywgIlNUQVJUSU5HIiwgIkRJU0NPTk5FQ1RJTkciKTsKKworICAgICAgICAgIC8qQWN0aW9uIGNvZGUgZm9yIHRyYW5zaXRpb24gKi8KKyAgICAgICAgICAvL2NzclJvYW1EaXNjb25uZWN0KCk7CisgICAgICAgICAgc21lX1JvYW1EaXNjb25uZWN0KGhIYWwsIAorICAgICAgICAgICAgICAgICAgLy9KRVowODExMTU6IEZpeG1lIAorICAgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5zZXNzaW9uSWQsIAorICAgICAgICAgICAgICAgICAgZUNTUl9ESVNDT05ORUNUX1JFQVNPTl9VTlNQRUNJRklFRCk7CisgICAgICAgICAgZ290b0Rpc2Nvbm5lY3RpbmcoCisgICAgICAgICAgICAgICAgICBidGFtcENvbnRleHQsIAorICAgICAgICAgICAgICAgICAgVk9TX1RSVUUsCisgICAgICAgICAgICAgICAgICBXTEFOQkFQX0VSUk9SX0hPU1RfVElNRU9VVCwgCisgICAgICAgICAgICAgICAgICBWT1NfRkFMU0UsCisgICAgICAgICAgICAgICAgICAwKTsKKyAgICAgICAgICAvKkFkdmFuY2Ugb3V0ZXIgc3RhdGV2YXIgKi8KKyAgICAgICAgICBidGFtcGZzbUNoYW5nZVRvU3RhdGUoaW5zdGFuY2VWYXIsRElTQ09OTkVDVElORyk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZigobXNnPT0oQlRBTVBGU01fRVZFTlRfVCllV0xBTl9CQVBfTUFDX1NUQVJUX0ZBSUxTKSkKKyAgICAgICAgeworICAgICAgICAgIC8qVHJhbnNpdGlvbiBmcm9tIFNUQVJUSU5HIHRvIERJU0NPTk5FQ1RFRCAoYm90aCB3aXRob3V0IHN1YnN0YXRlcykqLworICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICJJbiAlcywgZnJvbSBzdGF0ZSAlcyA9PiAlcyIsIF9fZnVuY19fLCAiU1RBUlRJTkciLCAiRElTQ09OTkVDVEVEIik7CisKKyAgICAgICAgICAvKkFjdGlvbiBjb2RlIGZvciB0cmFuc2l0aW9uICovCisgICAgICAgICAgZ290b0Rpc2Nvbm5lY3RlZChidGFtcENvbnRleHQpOworICAgICAgICAgIC8qQWR2YW5jZSBvdXRlciBzdGF0ZXZhciAqLworICAgICAgICAgIGJ0YW1wZnNtQ2hhbmdlVG9TdGF0ZShpbnN0YW5jZVZhcixESVNDT05ORUNURUQpOworICAgICAgICAgIHNpZ25hbEhDSVBoeXNMaW5rQ29tcEV2ZW50KCBidGFtcENvbnRleHQsIFdMQU5CQVBfRVJST1JfTUFYX05VTV9DTkNUUyApOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICJJbiAlcywgaW4gc3RhdGUgJXMsIGludmFsaWQgZXZlbnQgbXNnICVkIiwgX19mdW5jX18sICJTVEFSVElORyIsIG1zZyk7CisgICAgICAgICAgLyogSW50ZW50aW9uYWxseSBsZWZ0IGJsYW5rICovCisgICAgICAgIH0KKyAgICAgIGJyZWFrOworCisgICAgICBjYXNlIENPTk5FQ1RJTkc6CisgICAgICAgIGlmKChtc2c9PShCVEFNUEZTTV9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gICAgICAgICAgICAvL0pFWjA4MTExNTogRml4bWUgCisgICAgICAgICAgICAgICAgICBidGFtcENvbnRleHQtPnNlc3Npb25JZCwgCisgICAgICAgICAgICAgICAgICBlQ1NSX0RJU0NPTk5FQ1RfUkVBU09OX1VOU1BFQ0lGSUVEKTsKKyAgICAgICAgICBnb3RvRGlzY29ubmVjdGluZygKKyAgICAgICAgICAgICAgICAgIGJ0YW1wQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgIFZPU19UUlVFLCAKKyAgICAgICAgICAgICAgICAgIFdMQU5CQVBfRVJST1JfTk9fQ05DVCwgCisgICAgICAgICAgICAgICAgICAvL1ZPU19UUlVFLCAgIC8vIFNob3VsZCBiZSBWT1NfRkFMU0UgISEhIAorICAgICAgICAgICAgICAgICAgVk9TX0ZBTFNFLCAKKyAgICAgICAgICAgICAgICAgIFdMQU5CQVBfRVJST1JfVEVSTV9CWV9MT0NBTF9IT1NUKTsKKyAgICAgICAgICAvKkFkdmFuY2Ugb3V0ZXIgc3RhdGV2YXIgKi8KKyAgICAgICAgICBidGFtcGZzbUNoYW5nZVRvU3RhdGUoaW5zdGFuY2VWYXIsRElTQ09OTkVDVElORyk7CisgICAgICAgICAgLy8gSXQgaXMgTk9UIGNsZWFyIHRoYXQgd2UgbmVlZCB0byBzZW5kIHRoZSBQaHkgTGluayBEaXNjb25uZWN0CisgICAgICAgICAgLy8gQ29tcGxldGUgRXZlbnQgaGVyZS4KKyAgICAgICAgICBzaWduYWxIQ0lQaHlzTGlua0Rpc2NFdmVudCAKKyAgICAgICAgICAgICAgKCBidGFtcENvbnRleHQsIAorICAgICAgICAgICAgICAgIFdMQU5CQVBfU1RBVFVTX1NVQ0NFU1MsCisgICAgICAgICAgICAgICAgV0xBTkJBUF9FUlJPUl9URVJNX0JZX0xPQ0FMX0hPU1QpOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYoKG1zZz09KEJUQU1QRlNNX0VWRU5UX1QpZVdMQU5fQkFQX01BQ19DT05ORUNUX0lORElDQVRJT04KKyAgICAgICAgLy8pICYmIChic3NEZXNjIGluZGljYXRlcyBhbiBpbnZhbGlkIHBlZXIgTUFDIEFkZHIgb3IgU2VjUGFyYW0pKXsKKyAgICAgICAgICAgICAgICApICYmICF2YWxpZEFzc29jSW5kKGJ0YW1wQ29udGV4dCwgKHRDc3JSb2FtSW5mbyAqKWJhcEV2ZW50LT5wYXJhbXMpKQorICAgICAgICB7CisgICAgICAgICAgLypUcmFuc2l0aW9uIGZyb20gQ09OTkVDVElORyB0byBESVNDT05ORUNUSU5HIChib3RoIHdpdGhvdXQgc3Vic3RhdGVzKSovCisgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIkluICVzLCBmcm9tIHN0YXRlICVzID0+ICVzIiwgX19mdW5jX18sICJDT05ORUNUSU5HIiwgIkRJU0NPTk5FQ1RJTkciKTsKKyAgICAgICAgICAvKkFjdGlvbiBjb2RlIGZvciB0cmFuc2l0aW9uICovCisgICAgICAgICAgLy9jc3JSb2FtRGlzY29ubmVjdChERUFVVEgpOworICAgICAgICAgIC8vSkVaMDgxMTIwOiBEYW5saW4gcG9pbnRzIG91dCB0aGF0IEkgY291bGQganVzdCBpZ25vcmUgdGhpcworICAgICAgICAgIHNtZV9Sb2FtRGlzY29ubmVjdChoSGFsLCAKKyAgICAgICAgICAgICAgICAgIC8vSkVaMDgxMTE1OiBGaXhtZSAKKyAgICAgICAgICAgICAgICAgIGJ0YW1wQ29udGV4dC0+c2Vzc2lvbklkLCAKKyAgICAgICAgICAgICAgICAgIGVDU1JfRElTQ09OTkVDVF9SRUFTT05fREVBVVRIKTsKKyAgICAgICAgICAgICAgICAgIC8vZUNTUl9ESVNDT05ORUNUX1JFQVNPTl9VTlNQRUNJRklFRCk7CisgICAgICAgICAgZ290b0Rpc2Nvbm5lY3RpbmcoCisgICAgICAgICAgICAgICAgICBidGFtcENvbnRleHQsCisgICAgICAgICAgICAgICAgICBWT1NfVFJVRSwgCisgICAgICAgICAgICAgICAgICBXTEFOQkFQX0VSUk9SX0FVVEhFTlRfRkFJTFVSRSwgCisgICAgICAgICAgICAgICAgICBWT1NfRkFMU0UsIAorICAgICAgICAgICAgICAgICAgMCk7CisKKyAgICAgICAgICAvKlNldCB0aGUgc3RhdHVzIGNvZGUgYmVpbmcgcmV0dXJuZWQgdG8gdGhlIGJ0YW1wRnNtIGNhbGxlciAqLworICAgICAgICAgICpzdGF0dXMgPSBXTEFOQkFQX0VSUk9SX0FVVEhFTlRfRkFJTFVSRTsKKworICAgICAgICAgIC8qQWR2YW5jZSBvdXRlciBzdGF0ZXZhciAqLworICAgICAgICAgIGJ0YW1wZnNtQ2hhbmdlVG9TdGF0ZShpbnN0YW5jZVZhcixESVNDT05ORUNUSU5HKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmKChtc2c9PShCVEFNUEZTTV9FVkVOVF9UKWVXTEFOX0JBUF9NQUNfQ09OTkVDVF9JTkRJQ0FUSU9OCisgICAgICAgIC8vKSAmJiAoYnNzRGVzYyBpbmRpY2F0ZXMgYSB2YWxpZCBNQUMgQWRkciBhbmQgU2VjUGFyYW0pKXsKKyAgICAgICAgICAgICAgICApICYmIHZhbGlkQXNzb2NJbmQoYnRhbXBDb250ZXh0LCAodENzclJvYW1JbmZvICopYmFwRXZlbnQtPnBhcmFtcykpCisgICAgICAgIHsKKyAgICAgICAgICAvKlRyYW5zaXRpb24gZnJvbSBDT05ORUNUSU5HIHRvIFZBTElEQVRFRCAoYm90aCB3aXRob3V0IHN1YnN0YXRlcykqLworICAgICAgICAgIC8vVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIkluICVzLCBmcm9tIHN0YXRlICVzID0+ICVzIiwgX19mdW5jX18sICJDT05ORUNUSU5HIiwgIlZBTElEQVRFRCIpOworICAgICAgICAgIFZPU19U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B3ZWlyZC4KKyAgICAgICAgICAgKi8KKworICAgICAgICAgIC8qIHJlZ2lzdGVyIG91ciBTVEEgd2l0aCBUTCAqLworICAgICAgICAgIHJlZ1N0YVdpdGhUbCAoIAorICAgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LCAvKiBidGFtcENvbnRleHQgdmFsdWUgKi8gCisgICAgICAgICAgICAgICAgICBCVF9JTklUSUFUT1IsIAorICAgICAgICAgICAgICAgICAgKHRDc3JSb2FtSW5mbyAqKWJhcEV2ZW50LT5wYXJhbXMgKTsKKyAgICAgICAgICAKKyAgICAgICAgICAgIGdvdG9BdXRoZW50aWNhdGluZyhidGFtcENvbnRleHQpOworICAgICAgICAgIC8qQWN0aW9uIGNvZGUgZm9yIHRyYW5zaXRpb24gKi8KKyAgICAgICAgICBpbml0UnNuQXV0aGVudGljYXRvcihidGFtcENvbnRleHQsIEJUX0lOSVRJQVRPUik7CisKKyNpZiAxCisgICAgICAgICAgLypBZHZhbmNlIG91dGVyIHN0YXRldmFyICovCisgICAgICAgICAgLy9idGFtcGZzbUNoYW5nZVRvU3RhdGUoaW5zdGFuY2VWYXIsVkFMSURBVEVEKTsKKyAgICAgICAgICBidGFtcGZzbUNoYW5nZVRvU3RhdGUoaW5zdGFuY2VWYXIsQVVUSEVOVElDQVRJTkcpOworI2Vsc2UKKyAgICAgICAgICAvKkFjdGlvbiBjb2RlIGZvciB0cmFuc2l0aW9uICovCisgICAgICAgICAgc2lnbmFsSENJUGh5c0xpbmtDb21wRXZlbnQoYnRhbXBDb250ZXh0LCBXTEFOQkFQX1NUQVRVU19TVUNDRVNTKTsKKyAgICAgICAgICBnb3RvQ29ubmVjdGVkKGJ0YW1wQ29udGV4dCk7CisgICAgICAgICAgLypBZHZhbmNlIG91dGVyIHN0YXRldmFyICovCisgICAgICAgICAgYnRhbXBmc21DaGFuZ2VUb1N0YXRlKGluc3RhbmNlVmFyLENPTk5FQ1RFRCk7CisjZW5kaWYKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmKChtc2c9PShCVEFNUEZTTV9FVkVOVF9UKWVXTEFOX0JBUF9NQUNfQ09OTkVDVF9GQUlMRUQpKQorICAgICAgICB7CisgICAgICAgICAgLypUcmFuc2l0aW9uIGZyb20gQ09OTkVDVElORyB0byBESVNDT05ORUNUSU5HIChib3RoIHdpdGhvdXQgc3Vic3RhdGVzKSovCisgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIkluICVzLCBmcm9tIHN0YXRlICVzID0+ICVzIiwgX19mdW5jX18sICJDT05ORUNUSU5HIiwgIkRJU0NPTk5FQ1RJTkciKTsKKworICAgICAgICAgIC8qQWN0aW9uIGNvZGUgZm9yIHRyYW5zaXRpb24gKi8KKyAgICAgICAgICAgIHNtZV9Sb2FtRGlzY29ubmVjdChoSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ0YW1wQ29udGV4dC0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfRElTQ09OTkVDVF9SRUFTT05fVU5TUEVDSUZJRUQpOworICAgICAgICAgIC8qIFNlY3Rpb24gMy4xLjggYW5kIHNlY3Rpb24gMy4xLjkgaGF2ZSBjb250cmFkaWN0b3J5IHNlbWFudGljcyBmb3IgMHgxNi4gCisgICAgICAgICAgICogMy4xLjggaXMgImNvbm5lY3Rpb24gdGVybWluYXRlZCBieSBsb2NhbCBob3N0Ii4gMy4xLjkgaXMgImZhaWxlZCBjb25uZWN0aW9uIi4gIAorICAgICAgICAgICAqLworICAgICAgICAgIC8vZ290b0Rpc2Nvbm5lY3RpbmcoRkFJTEVEX0NPTk5FQ1RJT04pOworICAgICAgICAgIGdvdG9EaXNjb25uZWN0aW5nKAorICAgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LAorICAgICAgICAgICAgICAgICAgVk9TX1RSVUUsIAorICAgICAgICAgICAgICAgICAgV0xBTkJBUF9FUlJPUl9URVJNX0JZX0xPQ0FMX0hPU1QsIC8vRkFJTEVEX0NPTk5FQ1RJT04KKyAgICAgICAgICAgICAgICAgIFZPU19GQUxTRSwgCisgICAgICAgICAgICAgICAgICAwKTsKKyAgICAgICAgICAvKkFkdmFuY2Ugb3V0ZXIgc3RhdGV2YXIgKi8KKyAgICAgICAgICBidGFtcGZzbUNoYW5nZVRvU3RhdGUoaW5zdGFuY2VWYXIsRElTQ09OTkVDVElORyk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZigobXNnPT0oQlRBTVBGU01fRVZFTlRfVCllV0xBTl9CQVBfVElNRVJfQ09OTkVDVF9BQ0NFUFRfVElNRU9VVCkpCisgICAgICAgIHsKKyAgICAgICAgICAvKlRyYW5zaXRpb24gZnJvbSBDT05ORUNUSU5HIHRvIERJU0NPTk5FQ1RJTkcgKGJvdGggd2l0aG91dCBzdWJzdGF0ZXMpKi8KKyAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiSW4gJXMsIGZyb20gc3RhdGUgJXMgPT4gJXMiLCBfX2Z1bmNfXywgIkNPTk5FQ1RJTkciLCAiRElTQ09OTkVDVElORyIpOworCisgICAgICAgICAgLypBY3Rpb24gY29kZSBmb3IgdHJhbnNpdGlvbiAqLworICAgICAgICAgIC8vY3NyUm9hbURpc2Nvbm5lY3QoKTsKKyAgICAgICAgICBzbWVfUm9hbURpc2Nvbm5lY3QoaEhhbCwgCisgICAgICAgICAgICAgICAgICAvL0pFWjA4MTExNTogRml4bWUgCisgICAgICAgICAgICAgICAgICBidGFtcENvbnRleHQtPnNlc3Npb25JZCwgCisgICAgICAgICAgICAgICAgICBlQ1NSX0RJU0NPTk5FQ1RfUkVBU09OX1VOU1BFQ0lGSUVEKTsKKyAgICAgICAgICBnb3RvRGlzY29ubmVjdGluZygKKyAgICAgICAgICAgICAgICAgIGJ0YW1wQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgIFZPU19UUlVFLCAKKyAgICAgICAgICAgICAgICAgIFdMQU5CQVBfRVJST1JfSE9TVF9USU1FT1VULAorICAgICAgICAgICAgICAgICAgVk9TX0ZBTFNFLCAKKyAgICAgICAgICAgICAgICAgIDApOworICAgICAgICAgIC8qQWR2YW5jZSBvdXRlciBzdGF0ZXZhciAqLworICAgICAgICAgIGJ0YW1wZnNtQ2hhbmdlVG9TdGF0ZShpbnN0YW5jZVZhcixESVNDT05ORUNUSU5HKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiSW4gJXMsIGluIHN0YXRlICVzLCBpbnZhbGlkIGV2ZW50IG1zZyAlZCIsIF9fZnVuY19fLCAiQ09OTkVDVElORyIsIG1zZyk7CisgICAgICAgICAgLyogSW50ZW50aW9uYWxseSBsZWZ0IGJsYW5rICovCisgICAgICAgIH0KKyAgICAgIGJyZWFrOworCisgICAgICBjYXNlIEFVVEhFTlRJQ0FUSU5HOgorICAgICAgICBpZigobXNnPT0oQlRBTVBGU01fRVZFTlRfVCllV0xBTl9CQVBfUlNOX1NVQ0NFU1MKKyAgICAgICAgICAgKSAmJiAoYnRhbXBDb250ZXh0LT5CQVBEZXZpY2VSb2xlID09IEJUX1JFU1BPTkRFUikpCisgICAgICAgIHsKKyAgICAgICAgICAvKlRyYW5zaXRpb24gZnJvbSBBVVRIRU5USUNBVElORyB0byBLRVlJTkcgKGJvdGggd2l0aG91dCBzdWJzdGF0ZXMpKi8KKyAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiSW4gJXMsIGZyb20gc3RhdGUgJXMgPT4gJXMiLCBfX2Z1bmNfXywgIkFVVEhFTlRJQ0FUSU5HIiwgIktFWUlORyIpOworCisgICAgICAgICAgLypBY3Rpb24gY29kZSBmb3IgdHJhbnNpdGlvbiAqLworICAgICAgICAgIC8vc21lX1JvYW1TZXRDb250ZXh0KCk7IAorI2lmIDAKKyAgICAgICAgICBzbWVfUm9hbVNldEtleSgKKyAgICAgICAgICAgICAgICAgIFZPU19HRVRfSEFMX0NCKGJ0YW1wQ29udGV4dC0+cHZvc0dDdHgpLCAKKyAgICAgICAgICAgICAgICAgIGJ0YW1wQ29udGV4dC0+c2Vzc2lvbklkLCAKKyAgICAgICAgICAgICAgICAgIHRTaXJNYWNBZGRyIHBlZXJCc3NJZCwgCisgICAgICAgICAgICAgICAgICBlQ3NyRW5jcnlwdGlvblR5cGUgZW5jcnlwdFR5cGUsCisgICAgICAgICAgICAgICAgICB0QU5JX1UxNiBrZXlMZW5ndGgsIAorICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEtleSwKKyAgICAgICAgICAgICAgICAgIFZPU19UUlVFLCAgIC8vIFRSVUUgCisgICAgICAgICAgICAgICAgICB0QU5JX1U4IHBhZVJvbGUpOworI2VuZGlmIC8vMAorICAgICAgICAgIC8qQWR2YW5jZSBvdXRlciBzdGF0ZXZhciAqLworICAgICAgICAgIGJ0YW1wZnNtQ2hhbmdlVG9TdGF0ZShpbnN0YW5jZVZhcixLRVlJTkcpOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYoKG1zZz09KEJUQU1QRlNNX0VWRU5UX1QpZVdMQU5fQkFQX1JTTl9TVUNDRVNTCisgICAgICAgICAgICAgICAgKSAmJiAoYnRhbXBDb250ZXh0LT5CQVBEZXZpY2VSb2xlID09IEJUX0lOSVRJQVRPUikpCisgICAgICAgIHsKKyAgICAgICAgICAvKlRyYW5zaXRpb24gZnJvbSBBVVRIRU5USUNBVElORyB0byBLRVlJTkcgKGJvdGggd2l0aG91dCBzdWJzdGF0ZXMpKi8KKyAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiSW4gJXMsIGZyb20gc3RhdGUgJXMgPT4gJXMiLCBfX2Z1bmNfXywgIkFVVEhFTlRJQ0FUSU5HIiwgIktFWUlORyIpOworCisgICAgICAgICAgLypBY3Rpb24gY29kZSBmb3IgdHJhbnNpdGlvbiAqLworICAgICAgICAgIC8vc21lX1JvYW1TZXRDb250ZXh0KCk7IAorI2lmIDAKKyAgICAgICAgICBzbWVfUm9hbVNldEtleSgKKyAgICAgICAgICAgICAgICAgIFZPU19HRVRfSEFMX0NCKGJ0YW1wQ29udGV4dC0+cHZvc0dDdHgpLCAKKyAgICAgICAgICAgICAgICAgIGJ0YW1wQ29udGV4dC0+c2Vzc2lvbklkLCAKKyAgICAgICAgICAgICAgICAgIHRTaXJNYWNBZGRyIHBlZXJCc3NJZCwgCisgICAgICAgICAgICAgICAgICBlQ3NyRW5jcnlwdGlvblR5cGUgZW5jcnlwdFR5cGUsCisgICAgICAgICAgICAgICAgICB0QU5JX1UxNiBrZXlMZW5ndGgsIAorICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEtleSwKKyAgICAgICAgICAgICAgICAgIFZPU19UUlVFLCAgIC8vIFRSVUUgCisgICAgICAgICAgICAgICAgICB0QU5JX1U4IHBhZVJvbGUpOworI2VuZGlmIC8vMAorICAgICAgICAgIC8qQWR2YW5jZSBvdXRlciBzdGF0ZXZhciAqLworICAgICAgICAgIGJ0YW1wZnNtQ2hhbmdlVG9TdGF0ZShpbnN0YW5jZVZhcixLRVlJTkcpOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYoKG1zZz09KEJUQU1QRlNNX0VWRU5UX1QpZVdMQU5fQkFQX1RJTUVSX0NPTk5FQ1RfQUNDRVBUX1RJTUVPVVQpKQorICAgICAgICB7CisgICAgICAgICAgLypUcmFuc2l0aW9uIGZyb20gQVVUSEVOVElDQVRJTkcgdG8gRElTQ09OTkVDVElORyAoYm90aCB3aXRob3V0IHN1YnN0YXRlcykqLworICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICJJbiAlcywgZnJvbSBzdGF0ZSAlcyA9PiAlcyBDb25uZWN0QWNjZXB0VGltZW91dCIsIF9fZnVuY19fLCAiQVVUSEVOVElDQVRJTkciLCAiRElTQ09OTkVDVElORyIpOworCisgICAgICAgICAgZ290b0Rpc2Nvbm5lY3RpbmcoCisgICAgICAgICAgICAgICAgICBidGFtcENvbnRleHQsCisgICAgICAgICAgICAgICAgICBWT1NfVFJVRSwgCisgICAgICAgICAgICAgICAgICBXTEFOQkFQX0VSUk9SX0hPU1RfVElNRU9VVCwKKyAgICAgICAgICAgICAgICAgIFZPU19GQUxTRSwgCisgICAgICAgICAgICAgICAgICAwKTsKKyAgICAgICAgICAvKkFkdmFuY2Ugb3V0ZXIgc3RhdGV2YXIgKi8KKyAgICAgICAgICBidGFtcGZzbUNoYW5nZVRvU3RhdGUoaW5zdGFuY2VWYXIsRElTQ09OTkVDVElORyk7CisgICAgICAgICAgLypBY3Rpb24gY29kZSBmb3IgdHJhbnNpdGlvbiAqLworICAgICAgICAgc21lX1JvYW1EaXNjb25uZWN0KGhIYWwsIAorICAgICAgICAgICAgICAgICAgLy9KRVowODExMTU6IEZpeG1lIAorICAgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5zZXNzaW9uSWQsIAorICAgICAgICAgICAgICAgICAgZUNTUl9ESVNDT05ORUNUX1JFQVNPTl9VTlNQRUNJRklFRCk7CisgICAgICAgICAKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmKChtc2c9PShCVEFNUEZTTV9FVkVOVF9UKWVXTEFOX0JBUF9IQ0lfUEhZU0lDQUxfTElOS19ESVNDT05ORUNUKSkKKyAgICAgICAgeworICAgICAgICAgIC8qVHJhbnNpdGlvbiBmcm9tIEFVVEhFTlRJQ0FUSU5HIHRvIERJU0NPTk5FQ1RJTkcgKGJvdGggd2l0aG91dCBzdWJzdGF0ZXMpKi8KKyAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiSW4gJXMsIGZyb20gc3RhdGUgJXMgPT4gJXMgUGh5c2ljYWxsaW5rIERpc2Nvbm5lY3QiLCBfX2Z1bmNfXywgIkFVVEhFTlRJQ0FUSU5HIiwgIkRJU0NPTk5FQ1RJTkciKTsKKworICAgICAgICAgIC8qQWN0aW9uIGNvZGUgZm9yIHRyYW5zaXRpb24gKi8KKyAgICAgICAgICAvL2NzclJvYW1EaXNjb25uZWN0KCk7CisgICAgICAgICAgc21lX1JvYW1EaXNjb25uZWN0KGhIYWwsIAorICAgICAgICAgICAgICAgICAgLy9KRVowODExMTU6IEZpeG1lIAorICAgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5zZXNzaW9uSWQsIAorICAgICAgICAgICAgICAgICAgZUNTUl9ESVNDT05ORUNUX1JFQVNPTl9VTlNQRUNJRklFRCk7CisgICAgICAgICAgZ290b0Rpc2Nvbm5lY3RpbmcoCisgICAgICAgICAgICAgICAgICBidGFtcENvbnRleHQsCisgICAgICAgICAgICAgICAgICBWT1NfVFJVRSwgCisgICAgICAgICAgICAgICAgICBXTEFOQkFQX0VSUk9SX05PX0NOQ1QsCisgICAgICAgICAgICAgICAgICAvL1ZPU19UUlVFLCAgIC8vIFNob3VsZCBiZSBWT1NfRkFMU0UgISEhIAorICAgICAgICAgICAgICAgICAgVk9TX0ZBTFNFLCAKKyAgICAgICAgICAgICAgICAgIFdMQU5CQVBfRVJST1JfVEVSTV9CWV9MT0NBTF9IT1NUKTsKKyAgICAgICAgICAvKkFkdmFuY2Ugb3V0ZXIgc3RhdGV2YXIgKi8KKyAgICAgICAgICBidGFtcGZzbUNoYW5nZVRvU3RhdGUoaW5zdGFuY2VWYXIsRElTQ09OTkVDVElORyk7CisgICAgIC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FQVNPTl9ERUFVVEgpOworICAgICAgICAgICAgICAgICAgLy9lQ1NSX0RJU0NPTk5FQ1RfUkVBU09OX1VOU1BFQ0lGSUVEKTsKKyAgICAgICAgICBnb3RvRGlzY29ubmVjdGluZygKKyAgICAgICAgICAgICAgICAgIGJ0YW1wQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgIFZPU19UUlVFLCAKKyAgICAgICAgICAgICAgICAgIFdMQU5CQVBfRVJST1JfQVVUSEVOVF9GQUlMVVJFLCAKKyAgICAgICAgICAgICAgICAgIFZPU19GQUxTRSwgCisgICAgICAgICAgICAgICAgICAwKTsKKyAgICAgICAgICAvKkFkdmFuY2Ugb3V0ZXIgc3RhdGV2YXIgKi8KKyAgICAgICAgICBidGFtcGZzbUNoYW5nZVRvU3RhdGUoaW5zdGFuY2VWYXIsRElTQ09OTkVDVElORyk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIkluICVzLCBpbiBzdGF0ZSAlcywgaW52YWxpZCBldmVudCBtc2cgJWQiLCBfX2Z1bmNfXywgIkFVVEhFTlRJQ0FUSU5HIiwgbXNnKTsKKyAgICAgICAgICAvKiBJbnRlbnRpb25hbGx5IGxlZnQgYmxhbmsgKi8KKyAgICAgICAgfQorICAgICAgYnJlYWs7CisKKyAgICAgIGNhc2UgQ09OTkVDVEVEOgorICAgICAgICBpZigobXNnPT0oQlRBTVBGU01fRVZFTlRfVCllV0xBTl9CQVBfSENJX1BIWVNJQ0FMX0xJTktfRElTQ09OTkVDVCkpCisgICAgICAgIHsKKyAgICAgICAgICAvKlRyYW5zaXRpb24gZnJvbSBDT05ORUNURUQgdG8gRElTQ09OTkVDVElORyAoYm90aCB3aXRob3V0IHN1YnN0YXRlcykqLworICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICJJbiAlcywgZnJvbSBzdGF0ZSAlcyA9PiAlcyIsIF9fZnVuY19fLCAiQ09OTkVDVEVEIiwgIkRJU0NPTk5FQ1RJTkciKTsKKworICAgICAgICAgICAgZ290b0Rpc2Nvbm5lY3RpbmcoCisgICAgICAgICAgICAgICAgICBidGFtcENvbnRleHQsCisgICAgICAgICAgICAgICAgICBWT1NfRkFMU0UsIAorICAgICAgICAgICAgICAgICAgMCwgCisgICAgICAgICAgICAgICAgICBWT1NfVFJVRSwgCisgICAgICAgICAgICAgICAgICBXTEFOQkFQX0VSUk9SX1RFUk1fQllfTE9DQUxfSE9TVCk7CisgICAgICAgICAgLypBZHZhbmNlIG91dGVyIHN0YXRldmFyICovCisgICAgICAgICAgYnRhbXBmc21DaGFuZ2VUb1N0YXRlKGluc3RhbmNlVmFyLERJU0NPTk5FQ1RJTkcpOworCisgICAgICAgICAgV0xBTkJBUF9EZUluaXRMaW5rU3VwZXJ2aXNpb24oKCBwdEJ0YW1wSGFuZGxlKWJ0YW1wQ29udGV4dCk7CisgICAgICAgICAgLypBY3Rpb24gY29kZSBmb3IgdHJhbnNpdGlvbiAqLworICAgICAgICAgIC8vY3NyUm9hbURpc2Nvbm5lY3QoKTsKKyAgICAgICAgICBzbWVfUm9hbURpc2Nvbm5lY3QoaEhhbCwgCisgICAgICAgICAgICAgICAgICAvL0pFWjA4MTExNTogRml4bWUgCisgICAgICAgICAgICAgICAgICBidGFtcENvbnRleHQtPnNlc3Npb25JZCwgCisgICAgICAgICAgICAgICAgICBlQ1NSX0RJU0NPTk5FQ1RfUkVBU09OX1VOU1BFQ0lGSUVEKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmKChtc2c9PShCVEFNUEZTTV9FVkVOVF9UKWVXTEFOX0JBUF9NQUNfSU5ESUNBVEVTX01FRElBX0RJU0NPTk5FQ1RJT04pKQorICAgICAgICB7CisKKyAgICAgICAgICAvKlRyYW5zaXRpb24gZnJvbSBDT05ORUNURUQgdG8gRElTQ09OTkVDVElORyAoYm90aCB3aXRob3V0IHN1YnN0YXRlcykqLworICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICJJbiAlcywgZnJvbSBzdGF0ZSAlcyA9PiAlcyIsIF9fZnVuY19fLCAiQ09OTkVDVEVEIiwgIkRJU0NPTk5FQ1RJTkciKTsKKyAgICAgICAgICBXTEFOQkFQX0RlSW5pdExpbmtTdXBlcnZpc2lvbigoIHB0QnRhbXBIYW5kbGUpYnRhbXBDb250ZXh0KTsKKworICAgICAgICAgIGdvdG9EaXNjb25uZWN0aW5nKAorICAgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LAorICAgICAgICAgICAgICAgICAgVk9TX0ZBTFNFLCAKKyAgICAgICAgICAgICAgICAgIDAsIAorICAgICAgICAgICAgICAgICAgVk9TX1RSVUUsIAorICAgICAgICAgICAgICAgICAgV0xBTkJBUF9FUlJPUl9URVJNX0JZX0xPQ0FMX0hPU1QpOworICAgICAgICAgICAgLypBY3Rpb24gY29kZSBmb3IgdHJhbnNpdGlvbiAqLworICAgICAgICAgICAgc21lX1JvYW1EaXNjb25uZWN0KGhIYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5zZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ESVNDT05ORUNUX1JFQVNPTl9VTlNQRUNJRklFRCk7CisgICAgICAgICAgLypBZHZhbmNlIG91dGVyIHN0YXRldmFyICovCisgICAgICAgICAgYnRhbXBmc21DaGFuZ2VUb1N0YXRlKGluc3RhbmNlVmFyLERJU0NPTk5FQ1RJTkcpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19U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5HIHRvIERJU0NPTk5FQ1RFRCAoYm90aCB3aXRob3V0IHN1YnN0YXRlcykqLworICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICJJbiAlcywgZnJvbSBzdGF0ZSAlcyA9PiAlcyIsIF9fZnVuY19fLCAiRElTQ09OTkVDVElORyIsICJESVNDT05ORUNURUQiKTsKKworICAgIC8vQ2xlYXIgZ0Rpc2NSZXF1ZXN0ZWQ7CisgICAgYnRhbXBDb250ZXh0LT5nRGlzY1JlcXVlc3RlZCA9IFZPU19GQUxTRTsKKyAgICAgICAgICAgCisgICAgaWYoYnRhbXBDb250ZXh0LT5CQVBEZXZpY2VSb2xlID09IEJUX0lOSVRJQVRPUikgCisgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zX2xvY2tfYWNxdWlyZSgmYnRhbXBDb250ZXh0LT5iYXBMb2NrKSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJidGFtcEZzbSwgR2V0IExPQ0sgRmFpbCIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgYXV0aFJzbkZzbUZyZWUoYnRhbXBDb250ZXh0KTsKKyAgICAgICAgICAgICAgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc19sb2NrX3JlbGVhc2UoJmJ0YW1wQ29udGV4dC0+YmFwTG9jaykpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiYnRhbXBGc20sIFJlbGVhc2UgTE9DSyBGYWlsIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmKGJ0YW1wQ29udGV4dC0+QkFQRGV2aWNlUm9sZSA9PSBCVF9SRVNQT05ERVIpCisgICAgICAgICAgeworICAgICAgICAgICAgICBzdXBwUnNuRnNtRnJlZShidGFtcENvbnRleHQpOworICAgICAgICAgIH0KKworICAgICAgICAgIC8qIExvb2t1cCB0aGUgU3RhSWQgdXNpbmcgdGhlIHBoeV9saW5rX2hhbmRsZSBhbmQgdGhlIEJBUCBjb250ZXh0ICovIAorICAgICAgICAgIHZvc1N0YXR1cyA9IFdMQU5CQVBfR2V0U3RhSWRGcm9tTGlua0N0eCAoIAorICAgICAgICAgICAgICAgICAgICBidGFtcEhhbmRsZSwgIC8qIGJ0YW1wSGFuZGxlIHZhbHVlIGluICAqLyAKKyAgICAgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5waHlfbGlua19oYW5kbGUsICAvKiBwaHlfbGlua19oYW5kbGUgdmFsdWUgaW4gKi8KKyAgICAgICAgICAgICAgICAgICAgJnVjU1RBSWQsICAvKiBUaGUgU3RhSWQgKHVzZWQgYnkgVEwsIFBFLCBhbmQgSEFMKSAqLworICAgICAgICAgICAgICAgICAgICAmcEhkZEhkbCk7IC8qIEhhbmRsZSB0byByZXR1cm4gQlNMIGNvbnRleHQgKi8KKyAgICAgICAgICBpZiAoIFZPU19TVEFUVVNfU1VDQ0VTUyAhPSB2b3NTdGF0dXMgKSAKKyAgICAgICAgICB7CisgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAiVW5hYmxlIHRvIHJldHJpZXZlIFNUQSBJZCBmcm9tIEJBUCBjb250ZXh0IGFuZCBwaHlfbGlua19oYW5kbGUgaW4gJXMiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICAgICAgICAgfQorICAgICAgICAgIFdMQU5UTF9DbGVhclNUQUNsaWVudChidGFtcENvbnRleHQtPnB2b3NHQ3R4LCB1Y1NUQUlkKTsKKworICAgIC8vICAgICAgZ290b0Rpc2Nvbm5lY3RlZChidGFtcENvbnRleHQpOworCisgICAgICAvLyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiJXM6SW4gRElTQ09OTkVDVElORy1jaGFuZ2luZyBvdXRlciBzdGF0ZSB2YXIgdG8gRElTQ09OTkVDVEVEIiwgX19mdW5jX18pOworICAgICAgICAgIC8qQWR2YW5jZSBvdXRlciBzdGF0ZXZhciAqLworICAgICAgICAvLyAgYnRhbXBmc21DaGFuZ2VUb1N0YXRlKGluc3RhbmNlVmFyLERJU0NPTk5FQ1RFRCk7CisKKyAgICAgICAgICBzaWduYWxIQ0lQaHlzTGlua0Rpc2NFdmVudCAKKyAgICAgICAgICAgICAgKCBidGFtcENvbnRleHQsIAorICAgICAgICAgICAgICAgIFdMQU5CQVBfU1RBVFVTX1NVQ0NFU1MsCisgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5nRGlzY1JlYXNvbik7CisgICAgICAgICAgLypzbWVfQ2xvc2VTZXNzaW9uKFZPU19HRVRfSEFMX0NCKGJ0YW1wQ29udGV4dC0+cHZvc0dDdHgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBidGFtcENvbnRleHQtPnNlc3Npb25JZCk7Ki8KKyAgICAgICAgICAvKkFjdGlvbiBjb2RlIGZvciB0cmFuc2l0aW9uICovCisgICAgICAgICAgZ290b0Rpc2Nvbm5lY3RlZChidGFtcENvbnRleHQpOworCisgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIiVzOkluIERJU0NPTk5FQ1RJTkctY2hhbmdpbmcg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haWwiKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBhdXRoUnNuRnNtRnJlZShidGFtcENvbnRleHQpOworICAgICAgICAgICAgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc19sb2NrX3JlbGVhc2UoJmJ0YW1wQ29udGV4dC0+YmFwTG9jaykpKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiYnRhbXBGc20sIFJlbGVhc2UgTE9DSyBGYWlsIik7CisgICAgICAgICAgICAgIH0KKworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmKGJ0YW1wQ29udGV4dC0+QkFQRGV2aWNlUm9sZSA9PSBCVF9SRVNQT05ERVIpCisgICAgICAgICAgeworICAgICAgICAgICAgICBzdXBwUnNuRnNtRnJlZShidGFtcENvbnRleHQpOworICAgICAgICAgIH0KKyAgICAgICAgICAvKiBMb29rdXAgdGhlIFN0YUlkIHVzaW5nIHRoZSBwaHlfbGlua19oYW5kbGUgYW5kIHRoZSBCQVAgY29udGV4dCAqLyAKKyAgICAgICAgICB2b3NTdGF0dXMgPSBXTEFOQkFQX0dldFN0YUlkRnJvbUxpbmtDdHggKCAKKyAgICAgICAgICAgICAgICAgICAgYnRhbXBIYW5kbGUsICAvKiBidGFtcEhhbmRsZSB2YWx1ZSBpbiAgKi8gCisgICAgICAgICAgICAgICAgICAgIGJ0YW1wQ29udGV4dC0+cGh5X2xpbmtfaGFuZGxlLCAgLyogcGh5X2xpbmtfaGFuZGxlIHZhbHVlIGluICovCisgICAgICAgICAgICAgICAgICAgICZ1Y1NUQUlkLCAgLyogVGhlIFN0YUlkICh1c2VkIGJ5IFRMLCBQRSwgYW5kIEhBTCkgKi8KKyAgICAgICAgICAgICAgICAgICAgJnBIZGRIZGwpOyAvKiBIYW5kbGUgdG8gcmV0dXJuIEJTTCBjb250ZXh0ICovCisgICAgICAgICAgaWYgKCBWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gdm9zU3RhdHVzICkgCisgICAgICAgICAgeworICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIlVuYWJsZSB0byByZXRyaWV2ZSBTVEEgSWQgZnJvbSBCQVAgY29udGV4dCBhbmQgcGh5X2xpbmtfaGFuZGxlIGluICVzIiwgX19mdW5jX18pOworICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgICAgICAgIH0KKyAgICAgICAgICBXTEFOVExfQ2xlYXJTVEFDbGllbnQoYnRhbXBDb250ZXh0LT5wdm9zR0N0eCwgdWNTVEFJZCk7CisKKworICAgICAgICAgIC8qQWN0aW9uIGNvZGUgZm9yIHRyYW5zaXRpb24gKi8KKyAgICAgICAgIC8vIHNpZ25hbEhDSVBoeXNMaW5rQ29tcEV2ZW50KGJ0YW1wQ29udGV4dCwgV0xBTkJBUF9FUlJPUl9OT19DTkNULypidGFtcENvbnRleHQtPmdQaHlzTGlua1N0YXR1cyovKTsKKyAgICAgICAgICBzaWduYWxIQ0lQaHlzTGlua0NvbXBFdmVudChidGFtcENvbnRleHQsIGJ0YW1wQ29udGV4dC0+Z1BoeXNMaW5rU3RhdHVzKTsKKyAgICAgICAgICBnb3RvRGlzY29ubmVjdGVkKGJ0YW1wQ29udGV4dCk7CisgICAgICAgICAgLypzbWVfQ2xvc2VTZXNzaW9uKFZPU19HRVRfSEFMX0NCKGJ0YW1wQ29udGV4dC0+cHZvc0dDdHgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBidGFtcENvbnRleHQtPnNlc3Npb25JZCk7Ki8KKyAgICAgICAgICAvKkFkdmFuY2Ugb3V0ZXIgc3RhdGV2YXIgKi8KKyAgICAgICAgICBidGFtcGZzbUNoYW5nZVRvU3RhdGUoaW5zdGFuY2VWYXIsRElTQ09OTkVDVEVEKTsKKyAgICAgICAgIC8vIHNpZ25hbEhDSVBoeXNMaW5rQ29tcEV2ZW50KGJ0YW1wQ29udGV4dCwgYnRhbXBDb250ZXh0LT5nUGh5c0xpbmtTdGF0dXMpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICJJbiAlcywgaW4gc3RhdGUgJXMsIGludmFsaWQgZXZlbnQgbXNnICVkIiwgX19mdW5jX18sICJESVNDT05ORUNUSU5HIiwgbXNnKTsKKyAgICAgICAgICAvKiBJbnRlbnRpb25hbGx5IGxlZnQgYmxhbmsgKi8KKyAgICAgICAgfQorICAgICAgYnJlYWs7CisKKyAgICAgIGNhc2UgS0VZSU5HOgorICAgICAgICBpZigobXNnPT0oQlRBTVBGU01fRVZFTlRfVCllV0xBTl9CQVBfVElNRVJfQ09OTkVDVF9BQ0NFUFRfVElNRU9VVCkpCisgICAgICAgIHsKKyAgICAgICAgICAvKlRyYW5zaXRpb24gZnJvbSBLRVlJTkcgdG8gRElTQ09OTkVDVElORyAoYm90aCB3aXRob3V0IHN1YnN0YXRlcykqLworICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICJJbiAlcywgZnJvbSBzdGF0ZSAlcyA9PiAlcyIsIF9fZnVuY19fLCAiS0VZSU5HIiwgIkRJU0NPTk5FQ1RJTkciKTsKKworICAgICAgICAgIC8qQWN0aW9uIGNvZGUgZm9yIHRyYW5zaXRpb24gKi8KKyAgICAgICAgICAvL2NzclJvYW1EaXNjb25uZWN0KCk7CisgICAgICAgICAgc21lX1JvYW1EaXNjb25uZWN0KGhIYWwsIAorICAgICAgICAgICAgICAgICAgLy9KRVowODExMTU6IEZpeG1lIAorICAgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5zZXNzaW9uSWQsIAorICAgICAgICAgICAgICAgICAgZUNTUl9ESVNDT05ORUNUX1JFQVNPTl9VTlNQRUNJRklFRCk7CisgICAgICAgICAgZ290b0Rpc2Nvbm5lY3RpbmcoCisgICAgICAgICAgICAgICAgICBidGFtcENvbnRleHQsCisgICAgICAgICAgICAgICAgICBWT1NfVFJVRSwgCisgICAgICAgICAgICAgICAgICBXTEFOQkFQX0VSUk9SX0hPU1RfVElNRU9VVCwKKyAgICAgICAgICAgICAgICAgIFZPU19GQUxTRSwgCisgICAgICAgICAgICAgICAgICAwKTsKKyAgICAgICAgICAvKkFkdmFuY2Ugb3V0ZXIgc3RhdGV2YXIgKi8KKyAgICAgICAgICBidGFtcGZzbUNoYW5nZVRvU3RhdGUoaW5zdGFuY2VWYXIsRElTQ09OTkVDVElORyk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZigobXNnPT0oQlRBTVBGU01fRVZFTlRfVCllV0xBTl9CQVBfSENJX1BIWVNJQ0FMX0xJTktfRElTQ09OTkVDVCkpCisgICAgICAgIHsKKyAgICAgICAgICAvKlRyYW5zaXRpb24gZnJvbSBLRVlJTkcgdG8gRElTQ09OTkVDVElORyAoYm90aCB3aXRob3V0IHN1YnN0YXRlcykqLworICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICJJbiAlcywgZnJvbSBzdGF0ZSAlcyA9PiAlcyIsIF9fZnVuY19fLCAiS0VZSU5HIiwgIkRJU0NPTk5FQ1RJTkciKTsKKworICAgICAgICAgIC8qQWN0aW9uIGNvZGUgZm9yIHRyYW5zaXRpb24gKi8KKyAgICAgICAgICAvL2NzclJvYW1EaXNjb25uZWN0KCk7CisgICAgICAgICAgc21lX1JvYW1EaXNjb25uZWN0KGhIYWwsIAorICAgICAgICAgICAgICAgICAgLy9KRVowODExMTU6IEZpeG1lIAorICAgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5zZXNzaW9uSWQsIAorICAgICAgICAgICAgICAgICAgZUNTUl9ESVNDT05ORUNUX1JFQVNPTl9VTlNQRUNJRklFRCk7CisKKyAgICAgICAgICBnb3RvRGlzY29ubmVjdGluZygKKyAgICAgICAgICAgICAgICAgIGJ0YW1wQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgIFZPU19UUlVFLCAKKyAgICAgICAgICAgICAgICAgIFdMQU5CQVBfRVJST1JfTk9fQ05DVCwKKyAgICAgICAgICAgICAgICAgIC8vVk9TX1RSVUUsICAgLy8gU2hvdWxkIGJlIFZPU19GQUxTRSAhISEgCisgICAgICAgICAgICAgICAgICBWT1NfRkFMU0UsIAorICAgICAgICAgICAgICAgICAgV0xBTkJBUF9FUlJPUl9URVJNX0JZX0xPQ0FMX0hPU1QpOworICAgICAgICAgIC8qQWR2YW5jZSBvdXRlciBzdGF0ZXZhciAqLworICAgICAgICAgIGJ0YW1wZnNtQ2hhbmdlVG9TdGF0ZShpbnN0YW5jZVZhcixESVNDT05ORUNUSU5HKTsKKworICAgICAgICAgIC8vIEl0IGlzIE5PVCBjbGVhciB0aGF0IHdlIG5lZWQgdG8gc2VuZCB0aGUgUGh5IExpbmsgRGlzY29ubmVjdAorICAgICAgICAgIC8vIENvbXBsZXRlIEV2ZW50IGhlcmUuCisgICAgICAgICAgc2lnbmFsSENJUGh5c0xpbmtEaXNjRXZlbnQgCisgICAgICAgICAgICAgICggYnRhbXBDb250ZXh0LCAKKyAgICAgICAgICAgICAgICBXTEFOQkFQX1NUQVRVU19TVUNDRVNTLAorICAgICAgICAgICAgICAgIFdMQU5CQVBfRVJST1JfVEVSTV9CWV9MT0NBTF9IT1NUKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmKChtc2c9PShCVEFNUEZTTV9FVkVOVF9UKWVXTEFOX0JBUF9NQUNfS0VZX1NFVF9TVUNDRVNTK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jb2RlIGZvciB0cmFuc2l0aW9uICovCisgICAgICAgICAgZ290b0Rpc2Nvbm5lY3RlZChidGFtcENvbnRleHQpOworICAgICAgICAgIC8qQWR2YW5jZSBvdXRlciBzdGF0ZXZhciAqLworICAgICAgICAgIGJ0YW1wZnNtQ2hhbmdlVG9TdGF0ZShpbnN0YW5jZVZhcixESVNDT05ORUNURUQpOworICAgICAgICAgIHNpZ25hbEhDSVBoeXNMaW5rRGlzY0V2ZW50IAorICAgICAgICAgICAgICAoIGJ0YW1wQ29udGV4dCwgCisgICAgICAgICAgICAgICAgV0xBTkJBUF9TVEFUVVNfU1VDQ0VTUywKKyAgICAgICAgICAgICAgICBXTEFOQkFQX0VSUk9SX1RFUk1fQllfTE9DQUxfSE9TVCk7CisgICAgICAgICAgc2lnbmFsSENJUGh5c0xpbmtDb21wRXZlbnQoIGJ0YW1wQ29udGV4dCwgV0xBTkJBUF9FUlJPUl9OT19DTkNUKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiSW4gJXMsIGluIHN0YXRlICVzLCBpbnZhbGlkIGV2ZW50IG1zZyAlZCIsIF9fZnVuY19fLCAiU0NBTk5JTkciLCBtc2cpOworICAgICAgICAgIC8qIEludGVudGlvbmFsbHkgbGVmdCBibGFuayAqLworICAgICAgICB9CisgICAgICBicmVhazsKKworICAgICAgY2FzZSBWQUxJREFURUQ6CisgICAgICAgIGlmKChtc2c9PShCVEFNUEZTTV9FVkVOVF9UKWVXTEFOX0JBUF9NQUNfQ09OTkVDVF9DT01QTEVURUQKKyAgICAgICAgICAgKSAmJiAoYnRhbXBDb250ZXh0LT5CQVBEZXZpY2VSb2xlID09IEJUX0lOSVRJQVRPUikpCisgICAgICAgIHsKKyAgICAgICAgICAvKlRyYW5zaXRpb24gZnJvbSBWQUxJREFURUQgdG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k7CisgICAgICAgICAgc21lX1JvYW1EaXNjb25uZWN0KGhIYWwsIAorICAgICAgICAgICAgICAgICAgLy9KRVowODExMTU6IEZpeG1lIAorICAgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5zZXNzaW9uSWQsIAorICAgICAgICAgICAgICAgICAgZUNTUl9ESVNDT05ORUNUX1JFQVNPTl9VTlNQRUNJRklFRCk7CisgICAgICAgICAgZ290b0Rpc2Nvbm5lY3RpbmcoCisgICAgICAgICAgICAgICAgICBidGFtcENvbnRleHQsCisgICAgICAgICAgICAgICAgICBWT1NfVFJVRSwgCisgICAgICAgICAgICAgICAgICBXTEFOQkFQX0VSUk9SX0hPU1RfVElNRU9VVCwKKyAgICAgICAgICAgICAgICAgIFZPU19GQUxTRSwgCisgICAgICAgICAgICAgICAgICAwKTsKKyAgICAgICAgICAvKkFkdmFuY2Ugb3V0ZXIgc3RhdGV2YXIgKi8KKyAgICAgICAgICBidGFtcGZzbUNoYW5nZVRvU3RhdGUoaW5zdGFuY2VWYXIsRElTQ09OTkVDVElORyk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZigobXNnPT0oQlRBTVBGU01fRVZFTlRfVCllV0xBTl9CQVBfSENJX1BIWVNJQ0FMX0xJTktfRElTQ09OTkVDVCkpCisgICAgICAgIHsKKyAgICAgICAgICAvKlRyYW5zaXRpb24gZnJvbSBWQUxJREFURUQgdG8gRElTQ09OTkVDVElORyAoYm90aCB3aXRob3V0IHN1YnN0YXRlcykqLworICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICJJbiAlcywgZnJvbSBzdGF0ZSAlcyA9PiAlcyIsIF9fZnVuY19fLCAiVkFMSURBVEVEIiwgIkRJU0NPTk5FQ1RJTkciKTsKKworICAgICAgICAgIC8qQWN0aW9uIGNvZGUgZm9yIHRyYW5zaXRpb24gKi8KKyAgICAgICAgICAvL2NzclJvYW1EaXNjb25uZWN0KCk7CisgICAgICAgICAgc21lX1JvYW1EaXNjb25uZWN0KGhIYWwsIAorICAgICAgICAgICAgICAgICAgLy9KRVowODExMTU6IEZpeG1lIAorICAgICAgICAgICAgICAgICAgYnRhbXBDb250ZXh0LT5zZXNzaW9uSWQsIAorICAgICAgICAgICAgICAgICAgZUNTUl9ESVNDT05ORUNUX1JFQVNPTl9VTlNQRUNJRklFRCk7CisKKyAgICAgICAgICBnb3RvRGlzY29ubmVjdGluZygKKyAgICAgICAgICAgICAgICAgIGJ0YW1wQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgIFZPU19UUlVFLCAKKyAgICAgICAgICAgICAgICAgIFdMQU5CQVBfRVJST1JfTk9fQ05DVCwKKyAgICAgICAgICAgICAgICAgIC8vVk9TX1RSVUUsICAgLy8gU2hvdWxkIGJlIFZPU19GQUxTRSAhISEgCisgICAgICAgICAgICAgICAgICBWT1NfRkFMU0UsIAorICAgICAgICAgICAgICAgICAgV0xBTkJBUF9FUlJPUl9URVJNX0JZX0xPQ0FMX0hPU1QpOworICAgICAgICAgIC8qQWR2YW5jZSBvdXRlciBzdGF0ZXZhciAqLworICAgICAgICAgIGJ0YW1wZnNtQ2hhbmdlVG9TdGF0ZShpbnN0YW5jZVZhcixESVNDT05ORUNUSU5HKTsKKworICAgICAgICAgIC8vIEl0IGlzIE5PVCBjbGVhciB0aGF0IHdlIG5lZWQgdG8gc2VuZCB0aGUgUGh5IExpbmsgRGlzY29ubmVjdAorICAgICAgICAgIC8vIENvbXBsZXRlIEV2ZW50IGhlcmUuCisgICAgICAgICAgc2lnbmFsSENJUGh5c0xpbmtEaXNjRXZlbnQgCisgICAgICAgICAgICAgICggYnRhbXBDb250ZXh0LCAKKyAgICAgICAgICAgICAgICBXTEFOQkFQX1NUQVRVU19TVUNDRVNTLAorICAgICAgICAgICAgICAgIFdMQU5CQVBfRVJST1JfVEVSTV9CWV9MT0NBTF9IT1NUKTsKKyAgICAgICAgfQorICAgICAgICBlb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3BCdWY7CisgICAgICAgIERCR1BSSU5UKGJ1ZmZlcik7CisgICAgfQorICAgIERCR1BSSU5UKCJcbiIpOworfQorCisjZWxpZiBkZWZpbmVkIE9TX1ggLyogTm90IFdJTjMyICovCitzdGF0aWMgdm9pZCBmcmFtZXNMb2codm9pZCAqIHBDdHgsIGludCBuU2V2LAorICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKmxwc3pGb3JtYXQsIC4uLikKK3svLyBUbyBmaWxsIGluIHdoZW4gbmVlZGVkIHVzaW5nIElPTG9nCisKK30KKworc3RhdGljIHZvaWQgZnJhbWVzRHVtcCh2b2lkICogcEN0eCwgaW50IG5TZXYsIHZfVThfdCAqcEJ1ZiwgaW50IG5CdWYpCit7Cit9CisKKyNlbGlmIGRlZmluZWQgTElOVVgKKworc3RhdGljIHZvaWQgZnJhbWVzTG9nKHZvaWQgKiBwQ3R4LCBpbnQgblNldiwKKyAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyICpscHN6Rm9ybWF0LCAuLi4pCit7CisgICAgdmFfbGlzdCBtYXJrZXI7CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAoIG5TZXYgPD0gQlRBTVBfTE9HX0dBVEUgKQorICAgIHsKKyAgICAgICAgdmFfc3RhcnQoIG1hcmtlciwgbHBzekZvcm1hdCApOworICAgICAgICB2cHJpbnRmKGxwc3pGb3JtYXQsIG1hcmtlcik7CisgICAgICAgIHZhX2VuZCggbWFya2VyICk7CisgICAgfQorfQorCitzdGF0aWMgdm9pZCBmcmFtZXNEdW1wKHZvaWQgKiBwQ3R4LCBpbnQgblNldiwgdl9VOF90ICpwQnVmLCBpbnQgbkJ1ZikKK3sKKyAgICBjaGFyIGJ1ZmZlclszNV07CisgICAgaW50IGksIG9mZnNldDsKKyAgICAodm9pZClwQ3R4OworICAgIG9mZnNldCA9IDA7CisgICAgaWYgKCBuU2V2ID4gQlRBTVBfTE9HX0dBVEUgKSByZXR1cm47CisgICAgZm9yI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Q0syKHBTcmMsIHBCdWYsIG5CdWYsIHBuQ29uc3VtZWQpIGRvIHsgXAorICAgICAgICBpZiAoIXBTcmMgfHwgSXNCYWRSZWFkUHRyKHBTcmMsIDQpKSByZXR1cm4gQlRBTVBfQkFEX0lOUFVUX0JVRkZFUjsgXAorICAgICAgICBpZiAoIXBCdWYgfHwgSXNCYWRXcml0ZVB0cihwQnVmLCBuQnVmKSkgcmV0dXJuIEJUQU1QX0JBRF9PVVRQVVRfQlVGRkVSOyBcCisgICAgICAgIGlmICghbkJ1ZikgcmV0dXJuIEJUQU1QX0JBRF9PVVRQVVRfQlVGRkVSOyAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgIGlmIChJc0JhZFdyaXRlUHRyKHBuQ29uc3VtZWQsIDQpKSByZXR1cm4gQlRBTVBfQkFEX09VVFBVVF9CVUZGRVI7IFwKKyAgICB9IHdoaWxlICgwKQorCisjICAgZWxzZQorCisjICAgICAgIGRlZmluZSBCVEFNUF9QQVJBTUVURVJfQ0hFQ0syKHBTcmMsIHBCdWYsIG5CdWYsIHBuQ29uc3VtZWQpIGRvIHsgXAorICAgICAgICBpZiAoIXBTcmMpIHJldHVybiBCVEFNUF9CQURfSU5QVVRfQlVGRkVSOyAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICBpZiAoIXBCdWYpIHJldHVybiBCVEFNUF9CQURfT1VUUFVUX0JVRkZFUjsgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICBpZiAoIW5CdWYpIHJldHVybiBCVEFNUF9CQURfT1VUUFVUX0JVRkZFUjsgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICBpZiAoIXBuQ29uc3VtZWQpIHJldHVybiBCVEFNUF9CQURfT1VUUFVUX0JVRkZFUjsgICAgICAgICAgICAgICAgXAorICAgIH0gd2hpbGUgKDApCisjICAgZW5kaWYKKyNlbmRpZgorCitzdGF0aWMgdm9pZCBmcmFtZXNudG9ocyh2b2lkICogICAgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHZfVTE2X3QgKnBPdXQsCisgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgICpwSW4sCisgICAgICAgICAgICAgICAgICAgICAgICB0RlJBTUVTX0JPT0wgIGZNc2IpCit7CisgICAgKHZvaWQpcEN0eDsKKyMgICBpZiBkZWZpbmVkICggQlRBTVBfTElUVExFX0VORElBTl9IT1NUICkKKyAgICBpZiAoICFmTXNiICkKKyAgICB7CisgICAgICAgIEJUQU1QX01FTUNQWShwQ3R4LCAoIHZfVTE2X3QqIClwT3V0LCBwSW4sIDIpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAqcE91dCA9ICggdl9VMTZfdCApKCAqcEluIDw8IDggKSB8ICooIHBJbiArIDEgKTsKKyAgICB9CisjICAgZWxzZQorICAgIGlmICggIWZNc2IgKQorICAgIHsKKyAgICAgICAgKnBPdXQgPSAoIHZfVTE2X3QgKSggKnBJbiB8ICggKiggcEluICsgMSApIDw8IDggKSApOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBCVEFNUF9NRU1DUFkocEN0eCwgKCB2X1UxNl90KiApcE91dCwgcEluLCAyKTsKKyAgICB9CisjICAgZW5kaWYKK30KKworc3RhdGljIHZvaWQgZnJhbWVzbnRvaGwodm9pZCAqICAgIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90ICpwT3V0LAorICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICAqcEluLAorICAgICAgICAgICAgICAgICAgICAgICAgdEZSQU1FU19CT09MICBmTXNiKQoreworICAgICh2b2lkKXBDdHg7CisjICAgaWYgZGVmaW5lZCAoIEJUQU1QX0xJVFRMRV9FTkRJQU5fSE9TVCApCisgICAgaWYgKCAhZk1zYiApCisgICAgeworICAgICAgICAqcE91dCA9ICogKCB2X1UzMl90KiApcEluOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAqcE91dCA9ICggdl9VMzJfdCApKCAqcEluICAgICAgICAgPDwgMjQgKSB8CisgICAgICAgICAgICAgICAgKCAqKCBwSW4gKyAxICkgPDwgMTYgKSB8CisgICAgICAgICAgICAgICAgKCAqKCBwSW4gKyAyICkgPDwgIDggKSB8CisgICAgICAgICAgICAgICAgKCAqKCBwSW4gKyAzICkgKTsKKyAgICB9CisjICAgZWxzZQorICAgIGlmICggIWZNc2IgKQorICAgIHsKKyAgICAgICAgKnBPdXQgPSAoIHZfVTMyX3QgKSggKiggcEluICsgMyApIDw8IDI0ICkgfAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoICooIHBJbiArIDIgKSA8PCAxNiApIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCAqKCBwSW4gKyAxICkgPDwgIDggKSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggKiggcEluICkgKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgKnBPdXQgPSAqICggdl9VMzJfdCogKXBJbjsKKyAgICB9CisjICAgZW5kaWYKK30KKworc3RhdGljIHZvaWQgZnJhbWVzaHRvbnModm9pZCAqICAgIHBDdHgKKywgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgICpwT3V0LAorICAgICAgICAgICAgICAgICAgICAgICAgdl9VMTZfdCAgcEluLAorICAgICAgICAgICAgICAgICAgICAgICAgdEZSQU1FU19CT09MICBmTXNiKQoreworICAgICh2b2lkKXBDdHg7CisjICAgaWYgZGVmaW5lZCAoIEJUQU1QX0xJVFRMRV9FTkRJQU5fSE9TVCApCisgICAgaWYgKCAhZk1zYiApCisgICAgeworICAgICAgICBCVEFNUF9NRU1DUFkocEN0eCwgcE91dCwgJnBJbiwgMik7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgICpwT3V0ICAgICAgICAgPSAoIHBJbiAmIDB4ZmYwMCApID4+IDg7CisgICAgICAgICooIHBPdXQgKyAxICkgPSBwSW4gJiAweGZmOworICAgIH0KKyMgICBlbHNlCisgICAgaWYgKCAhZk1zYiApCisgICAgeworICAgICAgICAqcE91dCAgICAgICAgID0gcEluICYgMHhmZjsKKyAgICAgICAgKiggcE91dCArIDEgKSA9ICggcEluICYgMHhmZjAwICkgPj4gODsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgQlRBTVBfTUVNQ1BZKHBDdHgsIHBPdXQsICZwSW4sIDIpOworICAgIH0KKyMgICBlbmRpZgorfQorCitzdGF0aWMgdm9pZCBmcmFtZXNodG9ubCh2b2lkICogICAgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAgKnBPdXQsCisgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90ICBwSW4sCisgICAgICAgICAgICAgICAgICAgICAgICB0RlJBTUVTX0JPT0wgIGZNc2IpCit7CisgICAgKHZvaWQpcEN0eDsKKyMgICBpZiBkZWZpbmVkICggQlRBTVBfTElUVExFX0VORElBTl9IT1NUICkKKyAgICBpZiAoICFmTXNiICkKKyAgICB7CisgICAgICAgIEJUQU1QX01FTUNQWShwQ3R4LCBwT3V0LCAmcEluLCA0KTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgKnBPdXQgICAgICAgICA9ICggcEluICYgMHhmZjAwMDAwMCApID4+IDI0OworICAgICAgICAqKCBwT3V0ICsgMSApID0gKCBwSW4gJiAweDAwZmYwMDAwICkgPj4gMTY7CisgICAgICAgICooIHBPdXQgKyAyICkgPSAoIHBJbiAmIDB4MDAwMGZmMDAgKSA+PiAgODsKKyAgICAgICAgKiggcE91dCArIDMgKSA9ICggcEluICYgMHgwMDAwMDBmZiApOworICAgIH0KKyMgICBlbHNlCisgICAgaWYgKCAhZk1zYiApCisgICAgeworICAgICAgICAqKCBwT3V0ICAgICApID0gKCBwSW4gJiAweDAwMDAwMGZmICk7CisgICAgICAgICooIHBPdXQgKyAxICkgPSAoIHBJbiAmIDB4MDAwMGZmMDAgKSA+PiAgODsKKyAgICAgICAgKiggcE91dCArIDIgKSA9ICggcEluICYgMHgwMGZmMDAwMCApID4+IDE2OworICAgICAgICAqKCBwT3V0ICsgMyApID0gKCBwSW4gJiAweGZmMDAwMDAwICkgPj4gMjQ7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIEJUQU1QX01FTUNQWShwQ3R4LCBwT3V0LCAmcEluLCA0KTsKKyAgICB9CisjICAgZW5kaWYKK30KKwordHlwZWRlZiBzdHJ1Y3Qgc1RMVkRlZm4geworICAgIHZfVTMyX3QgICBpZDsKKyAgICB2X1UzMl90ICAgcGVjOworICAgIHZfVTMyX3QgICBtaW5TaXplOworICAgIHZfVTMyX3QgICBtYXhTaXplOworICAgIHNpemVfdCAgICAgICAgIG9mZnNldDsKKyAgICBzaXplX3QgICAgICAgICBwcmVzZW5jZU9mZnNldDsKKyAgICB2X1UxNl90ICAgc2lnOworICAgIHBmbkdlbmVyaWNfdCAgIHBmbjsKKyAgICBjb25zdCBjaGFyICogICBuYW1lOworICAgIHZfVThfdCAgICBmTWFuZGF0b3J5OworfSB0VExWRGVmbjsKKworc3RhdGljIHRUTFZEZWZuKiBGaW5kVExWRGVmbiggdm9pZCAqICAgIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRUTFZEZWZuICAgICAgVExWc1sgXSApCit7CisgICAgdFRMVkRlZm4gICAgKnBUbHY7CisgICAgdl9VMzJfdCAgICAgIHNUeXBlLCBzTGVuOworICAgIHZfVTMyX3QgcGVjOworICAgIHZfVTE2X3QgaWQ7CisgCisgICAgc1R5cGUgPSAxOworICAgIHNMZW4gID0gMjsKKyAKKyAgICAodm9pZClwQ3R4OworIAorICAgIGlmIChzVHlwZSA9PSAyKSAKKyAgICAgICAgZnJhbWVzbnRvaHMoIHBDdHgsICZpZCwgcEJ1ZiwgMiApOworICAgIGVsc2UgeworICAgICAgICBpZCA9ICpwQnVmOworICAgIH0KKworICAgIHBUbHYgPSAmKCBUTFZzWyAwIF0gKTsKKyAgICB3aGlsZSAoIDB4ZmZmZiAhPSBwVGx2LT5pZCApCisgICAgeworICAgICAgICBpZiAoIGlkID09IHBUbHYtPmlkICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKCAwID09IHBUbHYtPnBlYyApIHJldHVybiBwVGx2OworCisgICAgICAgICAgICBpZiggbkJ1ZiA+IDUgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBlYyA9ICAoICggKiAoIHBCdWYgKyA0ICkgKSA8PCAxNiApIHwKKyAgICAgICAgICAgICAgICAgICAgICAgKCAoICogKCBwQnVmICsgNSApICkgPDwgIDggKSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAqICggcEJ1ZiArIDYgKTsKKyAgICAgICAgICAgICAgICBpZiAoIHBlYyA9PSBwVGx2LT5wZWMgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBUbHY7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgKytwVGx2OworICAgIH0KKworICAgIHJldHVybiBOVUxMOworfQorCitzdGF0aWMgdl9VMzJfdCBVbnBhY2tUbHZDb3JlKCB2b2lkICogICBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFRMVkRlZm4gICAgIFRMVnNbIF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqcEZybSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90ICAgICAgIG5Gcm0gKTsKK3N0YXRpYyB2X1UzMl90IFBhY2tUbHZDb3JlKHZvaWQgKiBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcG5Db25zdW1lZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFRMVkRlZm4gIFRMVnNbXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcGlkeCk7CitzdGF0aWMgdl9VMzJfdCBHZXRQYWNrZWRTaXplVGx2Q29yZSh2b2lkICogcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwRnJtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90ICpwbk5lZWRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFRMVkRlZm4gIFRMVnNbXSk7CisKK3ZfVTMyX3QgYnRhbXBVbnBhY2tUbHZBTVBfQXNzb2NfQ29ubmVjdGVkX0NoYW5uZWwodm9pZCAqIHBDdHgsIHZfVThfdCAqcEJ1Ziwgdl9VMTZfdCB0bHZsZW4sIHRCdGFtcFRMVkFNUF9Bc3NvY19Db25uZWN0ZWRfQ2hhbm5lbCAqcERzdCkKK3sKKyAgICB2X1UzMl90IHN0YXR1cyA9IEJUQU1QX1BBUlNFX1NVQ0NFU1M7CisgICAgKHZvaWQpcEJ1ZjsgKHZvaWQpdGx2bGVuOyAvKiBTaHV0dXAgdGhlIGNvbXBpbGVyICovCisKKyAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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ZjsKKyAgICBwQnVmICs9IDE7CisgICAgdGx2bGVuIC09ICh2X1U4X3QpMTsKKyAgICBmcmFtZXNudG9ocyhwQ3R4LCAmcERzdC0+Y29tbWFuZF9vcGNvZGUsIHBCdWYsIDApOworICAgIHBCdWYgKz0gMjsKKyAgICB0bHZsZW4gLT0gKHZfVThfdCkyOworICAgIHN3aXRjaCAocERzdC0+Y29tbWFuZF9vcGNvZGUpCisgICAgeworICAgICAgICBjYXNlIDB4MGMwMzoKKyAgICAgICAgICAgIHBEc3QtPmNjX2V2ZW50LlJlc2V0LnN0YXR1cyA9ICpwQnVmOworICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgdGx2bGVuIC09ICh2X1U4X3QpMTsKKyAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgMHgwYzA4OgorICAgICAgICAgICAgcERzdC0+Y2NfZXZlbnQuRmx1c2guc3RhdHVzID0gKnBCdWY7CisgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICB0bHZsZW4gLT0gKHZfVThfdCkxOworICAgICAgICAgICAgZnJhbWVzbnRvaHMocEN0eCwgJnBEc3QtPmNjX2V2ZW50LkZsdXNoLmxvZ19saW5rX2hhbmRsZSwgcEJ1ZiwgMCk7CisgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICB0bHZsZW4gLT0gKHZfVThfdCkyOworICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAweDA0M2I6CisgICAgICAgICAgICBwRHN0LT5jY19ldmVudC5Mb2dpY2FsX0xpbmtfQ2FuY2VsLnN0YXR1cyA9ICpwQnVmOworICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgdGx2bGVuIC09ICh2X1U4X3QpMTsKKyAgICAgICAgICAgIHBEc3QtPmNjX2V2ZW50LkxvZ2ljYWxfTGlua19DYW5jZWwucGh5X2xpbmtfaGFuZGxlID0gKnBCdWY7CisgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICB0bHZsZW4gLT0gKHZfVThfdCkxOworICAgICAgICAgICAgcERzdC0+Y2NfZXZlbnQuTG9naWNhbF9MaW5rX0NhbmNlbC50eF9mbG93X3NwZWNfaWQgPSAqcEJ1ZjsKKyAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgIHRsdmxlbiAtPSAodl9VOF90KTE7CisgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIDB4MGMwNToKKyAgICAgICAgICAgIHBEc3QtPmNjX2V2ZW50LlNldF9FdmVudF9NYXNrLnN0YXR1cyA9ICpwQnVmOworICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgdGx2bGVuIC09ICh2X1U4X3QpMTsKKyAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgMHgwYzE1OgorICAgICAgICAgICAgcERzdC0+Y2NfZXZlbnQuUmVhZF9Db25uZWN0aW9uX0FjY2VwdF9UTy5zdGF0dXMgPSAqcEJ1ZjsKKyAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgIHRsdmxlbiAtPSAodl9VOF90KTE7CisgICAgICAgICAgICBmcmFtZXNudG9ocyhwQ3R4LCAmcERzdC0+Y2NfZXZlbnQuUmVhZF9Db25uZWN0aW9uX0FjY2VwdF9UTy5jb25uZWN0aW9uX2FjY2VwdF90aW1lb3V0LCBwQnVmLCAwKTsKKyAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgICAgIHRsdmxlbiAtPSAodl9VOF90KTI7CisgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIDB4MGMxNjoKKyAgICAgICAgICAgIHBEc3QtPmNjX2V2ZW50LldyaXRlX0Nvbm5lY3Rpb25fQWNjZXB0X1RPLnN0YXR1cyA9ICpwQnVmOworICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgdGx2bGVuIC09ICh2X1U4X3QpMTsKKyAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgMHgwYzM2OgorICAgICAgICAgICAgcERzdC0+Y2NfZXZlbnQuUmVhZF9MaW5rX1N1cGVydmlzaW9uX1RPLnN0YXR1cyA9ICpwQnVmOworICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgdGx2bGVuIC09ICh2X1U4X3QpMTsKKyAgICAgICAgICAgIGZyYW1lc250b2hzKHBDdHgsICZwRHN0LT5jY19ldmVudC5SZWFkX0xpbmtfU3VwZXJ2aXNpb25fVE8ubG9nX2xpbmtfaGFuZGxlLCBwQnVmLCAwKTsKKyAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgICAgIHRsdmxlbiAtPSAodl9VOF90KTI7CisgICAgICAgICAgICBmcmFtZXNudG9ocyhwQ3R4LCAmcERzdC0+Y2NfZXZlbnQuUmVhZF9MaW5rX1N1cGVydmlzaW9uX1RPLmxpbmtfc3VwZXJ2aXNpb25fdGltZW91dCwgcEJ1ZiwgMCk7CisgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICB0bHZsZW4gLT0gKHZfVThfdCkyOworICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAweDBjMzc6CisgICAgICAgICAgICBwRHN0LT5jY19ldmVudC5Xcml0ZV9MaW5rX1N1cGVydmlzaW9uX1RPLnN0YXR1cyA9ICpwQnVmOworICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgdGx2bGVuIC09ICh2X1U4X3QpMTsKKyAgICAgICAgICAgIGZyYW1lc250b2hzKHBDdHgsICZwRHN0LT5jY19ldmVudC5Xcml0ZV9MaW5rX1N1cGVydmlzaW9uX1RPLmxvZ19saW5rX2hhbmRsZSwgcEJ1ZiwgMCk7CisgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICB0bHZsZW4gLT0gKHZfVThfdCkyOworICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAweDBjNjE6CisgICAgICAgICAgICBwRHN0LT5jY19ldmVudC5SZWFkX0xvZ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1ZiArPSAxOworICAgICAgICAgICAgdGx2bGVuIC09ICh2X1U4X3QpMTsKKyAgICAgICAgICAgIEJUQU1QX01FTUNQWShwQ3R4LCBwRHN0LT5jY19ldmVudC5SZWFkX0xvY2F0aW9uX0RhdGEubG9jX2RvbWFpbiwgcEJ1ZiwgMyk7CisgICAgICAgICAgICBwQnVmICs9IDM7CisgICAgICAgICAgICB0bHZsZW4gLT0gKHZfVThfdCkzOworICAgICAgICAgICAgcERzdC0+Y2NfZXZlbnQuUmVhZF9Mb2NhdGlvbl9EYXRhLmxvY19vcHRpb25zID0gKnBCdWY7CisgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICB0bHZsZW4gLT0gKHZfVThfdCkxOworICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAzMTczOgorICAgICAgICAgICAgcERzdC0+Y2NfZXZlbnQuV3JpdGVfTG9jYXRpb25fRGF0YS5zdGF0dXMgPSAqcEJ1ZjsKKyAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgIHRsdmxlbiAtPSAodl9VOF90KTE7CisgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIDMxNzQ6CisgICAgICAgICAgICBwRHN0LT5jY19ldmVudC5SZWFkX0Zsb3dfQ29udHJvbF9Nb2RlLnN0YXR1cyA9ICpwQnVmOworICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgdGx2bGVuIC09ICh2X1U4X3QpMTsKKyAgICAgICAgICAgIHBEc3QtPmNjX2V2ZW50LlJlYWRfRmxvd19Db250cm9sX01vZGUuZmxvd19jb250cm9sX21vZGUgPSAqcEJ1ZjsKKyAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgIHRsdmxlbiAtPSAodl9VOF90KTE7CisgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIDMxNzU6CisgICAgICAgICAgICBwRHN0LT5jY19ldmVudC5Xcml0ZV9GbG93X0NvbnRyb2xfTW9kZS5zdGF0dXMgPSAqcEJ1ZjsKKyAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgIHRsdmxlbiAtPSAodl9VOF90KTE7CisgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIDMxNzc6CisgICAgICAgICAgICBwRHN0LT5jY19ldmVudC5SZWFkX0JFX0ZsdXNoX1RPLnN0YXR1cyA9ICpwQnVmOworICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgdGx2bGVuIC09ICh2X1U4X3QpMTsKKyAgICAgICAgICAgIGZyYW1lc250b2hsKHBDdHgsICZwRHN0LT5jY19ldmVudC5SZWFkX0JFX0ZsdXNoX1RPLmJlc3RfZWZmb3J0X2ZsdXNoX3RpbWVvdXQsIHBCdWYsIDApOworICAgICAgICAgICAgcEJ1ZiArPSA0OworICAgICAgICAgICAgdGx2bGVuIC09ICh2X1U4X3QpNDsKKyAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgMzE3ODoKKyAgICAgICAgICAgIHBEc3QtPmNjX2V2ZW50LldyaXRlX0JFX0ZsdXNoX1RPLnN0YXR1cyA9ICpwQnVmOworICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgdGx2bGVuIC09ICh2X1U4X3QpMTsKKyAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgMzE3OToKKyAgICAgICAgICAgIHBEc3QtPmNjX2V2ZW50LlNldF9TaG9ydF9SYW5nZV9Nb2RlLnN0YXR1cyA9ICpwQnVmOworICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgdGx2bGVuIC09ICh2X1U4X3QpMTsKKyAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgNDA5NzoKKyAgICAgICAgICAgIHBEc3QtPmNjX2V2ZW50LlJlYWRfTG9jYWxfVmVyc2lvbl9JbmZvLnN0YXR1cyA9ICpwQnVmOworICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgdGx2bGVuIC09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DUxMjE6CisgICAgICAgICAgICBwRHN0LT5jY19ldmVudC5SZWFkX0ZhaWxlZF9Db250YWN0X0NvdW50ZXIuc3RhdHVzID0gKnBCdWY7CisgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICB0bHZsZW4gLT0gKHZfVThfdCkxOworICAgICAgICAgICAgZnJhbWVzbnRvaHMocEN0eCwgJnBEc3QtPmNjX2V2ZW50LlJlYWRfRmFpbGVkX0NvbnRhY3RfQ291bnRlci5sb2dfbGlua19oYW5kbGUsIHBCdWYsIDApOworICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgdGx2bGVuIC09ICh2X1U4X3QpMjsKKyAgICAgICAgICAgIGZyYW1lc250b2hzKHBDdHgsICZwRHN0LT5jY19ldmVudC5SZWFkX0ZhaWxlZF9Db250YWN0X0NvdW50ZXIuZmFpbGVkX2NvbnRhY3RfY291bnRlciwgcEJ1ZiwgMCk7CisgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICB0bHZsZW4gLT0gKHZfVThfdCkyOworICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSA1MTIyOgorICAgICAgICAgICAgcERzdC0+Y2NfZXZlbnQuUmVzZXRfRmFpbGVkX0NvbnRhY3RfQ291bnRlci5zdGF0dXMgPSAqcEJ1ZjsKKyAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgIHRsdmxlbiAtPSAodl9VOF90KTE7CisgICAgICAgICAgICBmcmFtZXNudG9ocyhwQ3R4LCAmcERzdC0+Y2NfZXZlbnQuUmVzZXRfRmFpbGVkX0NvbnRhY3RfQ291bnRlci5sb2dfbGlua19oYW5kbGUsIHBCdWYsIDApOworICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgdGx2bGVuIC09ICh2X1U4X3QpMjsKKyAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgNTEyMzoKKyAgICAgICAgICAgIHBEc3QtPmNjX2V2ZW50LlJlYWRfTGlua19RdWFsaXR5LnN0YXR1cyA9ICpwQnVmOworICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgdGx2bGVuIC09ICh2X1U4X3QpMTsKKyAgICAgICAgICAgIGZyYW1lc250b2hzKHBDdHgsICZwRHN0LT5jY19ldmVudC5SZWFkX0xpbmtfUXVhbGl0eS5sb2dfbGlua19oYW5kbGUsIHBCdWYsIDApOworICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgdGx2bGVuIC09ICh2X1U4X3QpMjsKKyAgICAgICAgICAgIHBEc3QtPmNjX2V2ZW50LlJlYWRfTGlua19RdWFsaXR5LmxpbmtfcXVhbGl0eSA9ICpwQnVmOworICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgdGx2bGVuIC09ICh2X1U4X3QpMTsKKyAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgNTEyNToKKyAgICAgICAgICAgIHBEc3QtPmNjX2V2ZW50LlJlYWRfUlNTSS5zdGF0dXMgPSAqcEJ1ZjsKKyAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgIHRsdmxlbiAtPSAodl9VOF90KTE7CisgICAgICAgICAgICBwRHN0LT5jY19ldmVudC5SZWFkX1JTU0kucGh5X2xpbmtfaGFuZGxlID0gKnBCdWY7CisgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICB0bHZsZW4gLT0gKHZfVThfdCkxOworICAgICAgICAgICAgcERzdC0+Y2NfZXZlbnQuUmVhZF9SU1NJLnJzc2kgPSAqcEJ1ZjsKKyAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgIHRsdmxlbiAtPSAodl9VOF90KTE7CisgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIDUxMjk6CisgICAgICAgICAgICBwRHN0LT5jY19ldmVudC5SZWFkX0xvY2FsX0FNUF9JbmZvLnN0YXR1cyA9ICpwQnVmOworICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgdGx2bGVuIC09ICh2X1U4X3QpMTsKKyAgICAgICAgICAgIHBEc3QtPmNjX2V2ZW50LlJlYWRfTG9jYWxfQU1QX0luZm8uSENfQU1QX1N0YXR1cyA9ICpwQnVmOworICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgdGx2bGVuIC09ICh2X1U4X3QpMTsKKyAgICAgICAgICAgIGZyYW1lc250b2hsKHBDdHgsICZwRHN0LT5jY19ldmVudC5SZWFkX0xvY2FsX0FNUF9JbmZvLkhDX1RvdGFsX0JXLCBwQnVmLCAwKTsKKyAgICAgICAgICAgIHBCdWYgKz0gNDsKKyAgICAgICAgICAgIHRsdmxlbiAtPSAodl9VOF90KTQ7CisgICAgICAgICAgICBmcmFtZXNudG9obChwQ3R4LCAmcERzdC0+Y2NfZXZlbnQuUmVhZF9Mb2NhbF9BTVBfSW5mby5IQ19NYXhfR3VhcmFudGVlZF9CVywgcEJ1ZiwgMCk7CisgICAgICAgICAgICBwQnVmICs9IDQ7CisgICAgICAgICAgICB0bHZsZW4gLT0gKHZfVThfdCk0OworICAgICAgICAgICAgZnJhbWVzbnRvaGwocEN0eCwgJnBEc3QtPmNjX2V2ZW50LlJlYWRfTG9jYWxfQU1QX0luZm8uSENfTWluX0xhdGVuY3ksIHBCdWYsIDApOworICAgICAgICAgICAgcEJ1ZiArPSA0OworICAgICAgICAgICAgdGx2bGVuIC09ICh2X1U4X3QpNDsKKyAgICAgICAgICAgIGZyYW1lc250b2hsKHBDdHgsICZwRHN0LT5jY19ldmVudC5SZWFkX0xvY2FsX0FNUF9JbmZvLkhDX01heF9QRFVfU2l6ZSwgcEJ1ZiwgMCk7CisgICAgICAgICAgICBwQnVmICs9IDQ7CisgICAgICAgICAgICB0bHZsZW4gLT0gKHZfVThfdCk0OworICAgICAgICAgICAgcERzdC0+Y2NfZXZlbnQuUmVhZF9Mb2NhbF9BTVBfSW5mby5IQ19Db250cm9sbGVyX1R5cGUg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ldmVudC5SZWFkX1JlYWRfTG9jYWxfQU1QX0Fzc29jLnJlbWFpbmluZ19sZW5ndGggKTsKKyAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgNTEzMToKKyAgICAgICAgICAgIHBEc3QtPmNjX2V2ZW50LldyaXRlX1JlbW90ZV9BTVBfQXNzb2Muc3RhdHVzID0gKnBCdWY7CisgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICB0bHZsZW4gLT0gKHZfVThfdCkxOworICAgICAgICAgICAgcERzdC0+Y2NfZXZlbnQuV3JpdGVfUmVtb3RlX0FNUF9Bc3NvYy5waHlfbGlua19oYW5kbGUgPSAqcEJ1ZjsKKyAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgIHRsdmxlbiAtPSAodl9VOF90KTE7CisgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIDYxNDU6CisgICAgICAgICAgICBwRHN0LT5jY19ldmVudC5SZWFkX0xvb3BiYWNrX01vZGUuc3RhdHVzID0gKnBCdWY7CisgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICB0bHZsZW4gLT0gKHZfVThfdCkxOworICAgICAgICAgICAgcERzdC0+Y2NfZXZlbnQuUmVhZF9Mb29wYmFja19Nb2RlLmxvb3BiYWNrX21vZGUgPSAqcEJ1ZjsKKyAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgIHRsdmxlbiAtPSAodl9VOF90KTE7CisgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIDYxNDY6CisgICAgICAgICAgICBwRHN0LT5jY19ldmVudC5Xcml0ZV9Mb29wYmFja19Nb2RlLnN0YXR1cyA9ICpwQnVmOworICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgdGx2bGVuIC09ICh2X1U4X3QpMTsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kI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U1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIEJUQU1QX0FNUF9BU1NPQyksICggdl9VOF90KiApJnBGcm0tPkFNUF9Bc3NvY19QQUxfVmVyc2lvbi5wYWxfdmVyc2lvbiwgMSk7CisgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBCVEFNUF9BTVBfQVNTT0MpLCAoIHZfVThfdCogKSZwRnJtLT5BTVBfQXNzb2NfUEFMX1ZlcnNpb24ucGFsX0NvbXBhbnlJRCwgMik7CisgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBCVEFNUF9BTVBfQVNTT0MpLCAoIHZfVThfdCogKSZwRnJtLT5BTVBfQXNzb2NfUEFMX1ZlcnNpb24ucGFsX3N1YnZlcnNpb24sIDIpOworICAgICAgICB9CisgICAgfQorIyAgIGVuZGlmIC8vIEJUQU1QX0RVTVBfRlJBTUVTCisgICAgcmV0dXJuIHN0YXR1czsKKworfSAvKiBFbmQgYnRhbXBVbnBhY2tBTVBfQVNTT0MuICovCisKK3N0YXRpYyB2X1UzMl90IFVucGFja1RsdkNvcmUoIHZvaWQgKiAgIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0VExWRGVmbiAgICAgVExWc1sgXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwRnJtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplX3QgICAgICAgbkZybSApCit7CisgICAgdFRMVkRlZm4gKnBUbHY7CisgICAgdl9VMzJfdCAgICAgIG5CdW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ICAgICAgICAgIGdvdG8gTWFuZGF0b3J5Q2hlY2s7CisgICAgICAgIH0KKworICAgICAgICBucGVjID0gMFU7CisjaWZkZWYgV0xBTl9CQVBIQ0lfRU5BQkxFX0xPR0dJTkcKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfQkFQLFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAiQ2FsbGluZyBGaW5kVExWRGVmbi4uLlxuIiwgbkJ1ZlJlbWFpbmluZyk7IAorI2VuZGlmCisKKyAgICAgICAgLy8gTG9vayBmb3IgYSBtYXRjaGluZyBUTFYgZGVmaW5pdGlvbiwKKyAgICAgICAgcFRsdiA9IEZpbmRUTFZEZWZuKCBwQ3R4LCBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCBUTFZzICk7CisgICAgICAgIHNUeXBlID0gMTsKKyAgICAgICAgc0xlbiAgPSAyOworICAgICAgICAvLyBjb25zdW1lIHRoZSB0eXBlLAorICAgICAgICBpZiAoc1R5cGUgPT0gMikgCisgICAgICAgICAgICBmcmFtZXNudG9ocyhwQ3R4LCAmaWQsIHBCdWZSZW1haW5pbmcsIDEpOworICAgICAgICBlbHNlIHsgCisgICAgICAgICAgICBpZCA9ICpwQnVmUmVtYWluaW5nOyAKKyAgICAgICAgfQorICAgICAgICBwQnVmUmVtYWluaW5nICs9IHNUeXBlOworICAgICAgICBuQnVmUmVtYWluaW5nIC09IHNUeXBlOworICAgICAgICAvLyAmIGxlbmd0aCwKKyAgICAgICAgZnJhbWVzbnRvaHMocEN0eCwgJmxlbiwgcEJ1ZlJlbWFpbmluZywgMSk7CisgICAgICAgIHBCdWZSZW1haW5pbmcgKz0gc0xlbjsKKyAgICAgICAgbkJ1ZlJlbWFpbmluZyAtPSBzTGVuOworCisgICAgICAgIGlmICggcFRsdiAmJiBwVGx2LT5wZWMgKQorICAgICAgICB7CisgICAgICAgICAgICBucGVjID0gM1U7CisgICAgICAgICAgICBpZiAoIDMgPiBuQnVmUmVtYWluaW5nICkKKyAgICAgICAgICAgIHsKKyNpZmRlZiBXTEFOX0JBUEhDSV9FTkFCTEVfTE9HR0lORworICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0JBUCxWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiMyA+IG5CdWZSZW1haW5pbmdcbiIpOyAKKyNlbmRpZgorCisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzIocEN0eCwgRlJMT0dXLCBGUkZMKCJUTFYgJWQgcmVwb3J0cyBsZW5ndGgiCisgICAgICAgICAgICAgICAgICAgICIlZCwgYnV0IGl0IGhhcyBhIFByaXZhdGUgRW50ZXJwcmlzZSBDb2RlICgzIGJ5dGUiCisgICAgICAgICAgICAgICAgICAgICJzLlxuIiksIGlkLCBsZW4pOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSTE9HMSwgcEJ1ZiwgbkJ1Zik7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzIocEN0eCwgRlJMT0cxLCBGUkZMKCJXZSd2ZSBwYXJzZWQgJWQgYnl0ZXMiCisgICAgICAgICAgICAgICAgICAgICJvZiB0aGlzIGJ1ZmZlciwgYW5kIHNob3cgJWQgbGVmdC5cbiIpLAorICAgICAgICAgICAgICAgIHBCdWZSZW1haW5pbmcgLSBwQnVmLCBuQnVmUmVtYWluaW5nKTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgfD0gQlRBTVBfSU5DT01QTEVURV9UTFY7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RCR19CUkVBSygpOworICAgICAgICAgICAgICAgIGdvdG8gTWFuZGF0b3J5Q2hlY2s7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwQnVmUmVtYWluaW5nICs9IDM7CisgICAgICAgICAgICBuQnVmUmVtYWluaW5nIC09IDM7CisgICAgICAgICAgICBsZW4gICAgICAgICAgIC09IDM7CisgICAgIC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CisgICAgICAgICAgICBnb3RvIE1hbmRhdG9yeUNoZWNrOworICAgICAgICB9CisKKyAgICAgICAgLy8gTm93LCAqaWYqIHdlIGZvdW5kIGEgaGl0Li4uCisgICAgICAgIGlmICggcFRsdiApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmICggbkJ1ZlJlbWFpbmluZyA8IHBUbHYtPm1pblNpemUgLSBucGVjIC0gKHNUeXBlICsgc0xlbikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzMoIHBDdHgsIEZSTE9HVywgRlJGTCgiVGhlIElFICVzIG11c3QgYmUgIgorICAgICAgICAgICAgICAgICAgICAiYXQgbGVhc3QgJWQgYnl0ZXMgaW4gc2l6ZSwgYnV0IHRoZXJlIGFyZSBvbmx5ICIKKyAgICAgICAgICAgICAgICAgICAgIiVkIGJ5dGVzIHJlbWFpbmluZyBpbiB0aGlzIGZyYW1lLlxuIiksCisgICAgICAgICAgICAgICAgICAgICBwVGx2LT5uYW1lLCBwVGx2LT5taW5TaXplLCBuQnVmUmVtYWluaW5nICk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAoIHBDdHgsIEZSTE9HMSwgcEJ1ZiwgbkJ1ZiApOworICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBCVEFNUF9JTkNPTVBMRVRFX1RMVjsKKyAgICAgICAgICAgICAgICBGUkFNRVNfREJHX0JSRUFLKCApOworICAgICAgICAgICAgICAgIGdvdG8gTWFuZGF0b3J5Q2hlY2s7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmICggbGVuID4gcFRsdi0+bWF4U2l6ZSAtIG5wZWMgLSAoc1R5cGUgKyBzTGVuKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMSggcEN0eCwgRlJMT0dXLCBGUkZMKCJUaGUgVExWICVzIHJlcG9ydHMgIgorICAgICAgICAgICAgICAgICAgICAiYW4gaWxsZWdhbGx5IGxhcmdlIHNpemU7IHRoaXMgVExWIGlzIHByZXN1bWFibHkiCisgICAgICAgICAgICAgICAgICAgICJjb3JydXB0IG9yIG90aGVyd2lzZSBpbnZhbGlkICYgd2lsbCBiZSBza2lwcGVkICIKKyAgICAgICAgICAgICAgICAgICAgImlwcGVkLlxuIiksIHBUbHYtPm5hbWUgKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUCggcEN0eCwgRlJMT0cxLCBwQnVmLCBuQnVmICk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzIoIHBDdHgsIEZSTE9HMSwgRlJGTCgiV2UndmUgcGFyc2VkICVkIGJ5IgorICAgICAgICAgICAgICAgICAgICAidGVzIG9mIHRoaXMgYnVmZmVyLCBhbmQgc2hvdyAlZCBsZWZ0LlxuIiksCisgICAgICAgICAgICAgICAgICAgIHBCdWZSZW1haW5pbmcgLSBwQnVmLCBuQnVmUmVtYWluaW5nKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfREJHX0JSRUFLKCk7CisgICAgICAgICAgICAgICAgc3RhdHVzIHw9IEJUQU1QX1NLSVBQRURfQkFEX1RMVjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyNpZmRlZiBXTEFOX0JBUEhDSV9FTkFCTEVfTE9HR0lORworICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0JBUCxWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAicFRsdi0+c2lnIC0gJWRcbiIsIHBUbHYtPnNpZyk7IAorI2VuZGlmCisKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKHBUbHYtPnNpZykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdVbnBhY2tUbHZBTVBfQXNzb2NfQ29ubmVjdGVkX0NoYW5uZWw6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuVW5wYWNrVGx2QU1QX0Fzc29jX0Nvbm5lY3RlZF9DaGFubmVsX3QpKHBUbHYtPnBmbikgKShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdEJ0YW1wVExWQU1QX0Fzc29jX0Nvbm5lY3RlZF9DaGFubmVsKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVW5wYWNrVGx2QU1QX0Fzc29jX01BQ19BZGRyOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblVucGFja1RsdkFNUF9Bc3NvY19NQUNfQWRkcl90KShwVGx2LT5wZm4pICkocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHRCdGFtcFRMVkFNUF9Bc3NvY19NQUNfQWRkciogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1VucGFja1RsdkFNUF9Bc3NvY19QQUxfQ2FwYWJpbGl0aWVzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblVucGFja1RsdkFNUF9Bc3NvY19QQUxfQ2FwYWJpbGl0aWVzX3QpKHBUbHYtPnBmbikgKShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdEJ0YW1wVExWQU1QX0Fzc29jX1BBTF9DYXBhYmlsaXRpZXMqICkocEZybSArIHBUbHYtPm9mZnNldCApKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdVbnBhY2tUbHZBTVBfQXNzb2NfUEFMX1ZlcnNpb246CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuVW5wYWNrVGx2QU1QX0Fzc29jX1BBTF9WZXJzaW9uX3QpKHBUbHYtPnBmbikgKShw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7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVW5wYWNrVGx2SENJX0RhdGFfQnVmZmVyX092ZXJmbG93X0V2ZW50OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblVucGFja1RsdkhDSV9EYXRhX0J1ZmZlcl9PdmVyZmxvd19FdmVudF90KShwVGx2LT5wZm4pICkocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHRCdGFtcFRMVkhDSV9EYXRhX0J1ZmZlcl9PdmVyZmxvd19FdmVudCogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1VucGFja1RsdkhDSV9EaXNjb25uZWN0X0xvZ2ljYWxfTGlua19DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuVW5wYWNrVGx2SENJX0Rpc2Nvbm5lY3RfTG9naWNhbF9MaW5rX0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHRCdGFtcFRMVkhDSV9EaXNjb25uZWN0X0xvZ2ljYWxfTGlua19DbWQqICkocEZybSArIHBUbHYtPm9mZnNldCApKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdVbnBhY2tUbHZIQ0lfRGlzY29ubmVjdF9Mb2dpY2FsX0xpbmtfQ29tcGxldGVfRXZlbnQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuVW5wYWNrVGx2SENJX0Rpc2Nvbm5lY3RfTG9naWNhbF9MaW5rX0NvbXBsZXRlX0V2ZW50X3QpKHBUbHYtPnBmbikgKShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdEJ0YW1wVExWSENJX0Rpc2Nvbm5lY3RfTG9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UmVtYWluaW5nLCBsZW4sICggdEJ0YW1wVExWSENJX0xvZ2ljYWxfTGlua19DYW5jZWxfQ21kKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVW5wYWNrVGx2SENJX0xvZ2ljYWxfTGlua19Db21wbGV0ZV9FdmVudDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5VbnBhY2tUbHZIQ0lfTG9naWNhbF9MaW5rX0NvbXBsZXRlX0V2ZW50X3QpKHBUbHYtPnBmbikgKShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdEJ0YW1wVExWSENJX0xvZ2ljYWxfTGlua19Db21wbGV0ZV9FdmVudCogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1VucGFja1RsdkhDSV9Mb29wYmFja19Db21tYW5kX0V2ZW50OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblVucGFja1RsdkhDSV9Mb29wYmFja19Db21tYW5kX0V2ZW50X3QpKHBUbHYtPnBmbikgKShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdEJ0YW1wVExWSENJX0xvb3BiYWNrX0NvbW1hbmRfRXZlbnQqICkocEZybSArIHBUbHYtPm9mZnNldCApKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdVbnBhY2tUbHZIQ0lfUGh5c2ljYWxfTGlua19Db21wbGV0ZV9FdmVudDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5VbnBhY2tUbHZIQ0lfUGh5c2ljYWxfTGlua19Db21wbGV0ZV9FdmVudF90KShwVGx2LT5wZm4pICkocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHRCdGFtcFRMVkhDSV9QaHlzaWNhbF9MaW5rX0NvbXBsZXRlX0V2ZW50KiApKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVW5wYWNrVGx2SENJX1BoeXNpY2FsX0xpbmtfTG9zc19XYXJuaW5nX0V2ZW50OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblVucGFja1RsdkhDSV9QaHlzaWNhbF9MaW5rX0xvc3NfV2FybmluZ19FdmVudF90KShwVGx2LT5wZm4pICkocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHRCdGFtcFRMVkhDSV9QaHlzaWNhbF9MaW5rX0xvc3NfV2FybmluZ19FdmVudCogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1VucGFja1RsdkhDSV9QaHlzaWNhbF9MaW5rX1JlY292ZXJ5X0V2ZW50OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblVucGFja1RsdkhDSV9QaHlzaWNhbF9MaW5rX1JlY292ZXJ5X0V2ZW50X3QpKHBUbHYtPnBmbikgKShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdEJ0YW1wVExWSENJX1BoeXNpY2FsX0xpbmtfUmVjb3ZlcnlfRXZlbnQqICkocEZybSArIHBUbHYtPm9mZnNldCApKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdVbnBhY2tUbHZIQ0lfUW9zX1Zpb2xhdGlvbl9FdmVudDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5VbnBhY2tUbHZIQ0lfUW9zX1Zpb2xhdGlvbl9FdmVudF90KShwVGx2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gICAgICAgICBzdGF0dXMyID0gKCAocGZuVW5wYWNrVGx2SENJX1JlYWRfRmxvd19Db250cm9sX01vZGVfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdEJ0YW1wVExWSENJX1JlYWRfRmxvd19Db250cm9sX01vZGVfQ21kKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVW5wYWNrVGx2SENJX1JlYWRfTGlua19RdWFsaXR5X0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5VbnBhY2tUbHZIQ0lfUmVhZF9MaW5rX1F1YWxpdHlfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdEJ0YW1wVExWSENJX1JlYWRfTGlua19RdWFsaXR5X0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1VucGFja1RsdkhDSV9SZWFkX0xpbmtfU3VwZXJ2aXNpb25fVGltZW91dF9DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuVW5wYWNrVGx2SENJX1JlYWRfTGlua19TdXBlcnZpc2lvbl9UaW1lb3V0X0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHRCdGFtcFRMVkhDSV9SZWFkX0xpbmtfU3VwZXJ2aXNpb25fVGltZW91dF9DbWQqICkocEZybSArIHBUbHYtPm9mZnNldCApKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdVbnBhY2tUbHZIQ0lfUmVhZF9Mb2NhbF9BTVBfQXNzb2NfQ21kOgorICAgIC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gYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdVbnBhY2tUbHZIQ0lfUmVhZF9Mb29wYmFja19Nb2RlX0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5VbnBhY2tUbHZIQ0lfUmVhZF9Mb29wYmFja19Nb2RlX0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHRCdGFtcFRMVkhDSV9SZWFkX0xvb3BiYWNrX01vZGVfQ21kKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVW5wYWNrVGx2SENJX1JlYWRfUlNTSV9DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuVW5wYWNrVGx2SENJX1JlYWRfUlNTSV9DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0QnRhbXBUTFZIQ0lfUmVhZF9SU1NJX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1VucGFja1RsdkhDSV9SZXNldF9DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuVW5wYWNrVGx2SENJX1Jlc2V0X0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHRCdGFtcFRMVkhDSV9SZXNldF9DbWQqICkocEZybSArIHBUbHYtPm9mZnNldCApKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdVbnBhY2tUbHZIQ0lfUmVzZXRfRmFpbGVkX0NvbnRhY3RfQ291bnRlcl9DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuVW5wYWNrVGx2SENJX1Jlc2V0X0ZhaWxlZF9Db250YWN0X0NvdW50ZXJfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdEJ0YW1wVExWSENJX1Jlc2V0X0ZhaWxlZF9Db250YWN0X0NvdW50ZXJfQ21kKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVW5wYWNrVGx2SENJX1NldF9FdmVudF9NYXNrX0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5VbnBhY2tUbHZIQ0lfU2V0X0V2ZW50X01hc2tfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdEJ0YW1wVExWSENJX1NldF9FdmVudF9NYXNrX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1VucGFja1RsdkhDSV9TZXRfRXZlbnRfTWFza19QYWdlXzJfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblVucGFja1RsdkhDSV9TZXRfRXZlbnRfTWFza19QYWdlXzJfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdEJ0YW1wVExWSENJX1NldF9FdmVudF9NYXNrX1BhZ2VfMl9DbWQqICkocEZybSArIHBUbHYtPm9mZnNldCApKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdVbnBhY2tUbHZIQ0lfU2V0X1Nob3J0X1JhbmdlX01vZGVfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAg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2aXNpb25fVGltZW91dF9DbWQqICkocEZybSArIHBUbHYtPm9mZnNldCApKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdVbnBhY2tUbHZIQ0lfV3JpdGVfTG9jYXRpb25fRGF0YV9DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuVW5wYWNrVGx2SENJX1dyaXRlX0xvY2F0aW9uX0RhdGFfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdEJ0YW1wVExWSENJX1dyaXRlX0xvY2F0aW9uX0RhdGFfQ21kKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVW5wYWNrVGx2SENJX1dyaXRlX0xvZ2ljYWxfTGlua19BY2NlcHRfVGltZW91dF9DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuVW5wYWNrVGx2SENJX1dyaXRlX0xvZ2ljYWxfTGlua19BY2NlcHRfVGltZW91dF9DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0QnRhbXBUTFZIQ0lfV3JpdGVfTG9naWNhbF9MaW5rX0FjY2VwdF9UaW1lb3V0X0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1VucGFja1RsdkhDSV9Xcml0ZV9Mb29wYmFja19Nb2RlX0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5VbnBhY2tUbHZIQ0lfV3JpdGVfTG9vcGJhY2tfTW9kZV9DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0QnRhbXBUTFZIQ0lfV3JpdGVfTG9vcGJhY2tfTW9kZV9DbWQqICkocEZybSArIHBUbHYtPm9mZnNldCApKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdVbnBhY2tUbHZIQ0lfV3JpdGVfUmVtb3RlX0FNUF9BU1NPQ19DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuVW5wYWNrVGx2SENJX1dyaXRlX1JlbW90ZV9BTVBfQVNTT0NfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdEJ0YW1wVExWSENJX1dyaXRlX1JlbW90ZV9BTVBfQVNTT0NfQ21kKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSTE9HRSwgRlJGTCgiSU5URVJOQUwgRVJST1I6IEkiCisgICAgICAgICAgICAgICAgICAgICAgICAiIGRvbid0IGtub3cgYWJvdXQgdGhlIFRMViBzaWduYXR1cmUgJWQtLSB0aGkiCisgICAgICAgICAgICAgICAgICAgICAgICAicyBpcyBtb3N0IGxpa2VseSBhICdmcmFtZXNjJyBidWcuXG4iKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUbHYtPnNpZyk7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EQkdfQlJFQUsoKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEJUQU1QX0lOVEVSTkFMX0VSUk9SOworICAgICAgICAgICAgICAgIH0gLy8gRW5kIHN3aXRjaCBvbiBzaWcuCisgICAgICAgICAgICB9IC8vIEVuZCBpZiBvbiBsZW5ndGggY2hlY2suCisKKyAgICAgICAgICAgIHN0YXR1cyB8PSBzdGF0dXMyOworI2lmZGVmIFdMQU5fQkFQSENJX0VOQUJMRV9MT0dHSU5HCisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9CQVAsVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAic3RhdHVzIC0gJXhcbiIsIHN0YXR1cyk7IAorI2VuZGlmCisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMihwQ3R4LCBGUkxPRzMsIEZSRkwoIlNraXBwaW5nIHVua25vd24gVExWICVkICgiCisgICAgICAgICAgICAgICAgImxlbmd0aCAlZClcbiIpLCBpZCwgbGVuKTsKKyAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSTE9HMywgcEJ1ZlJlbWFpbmluZyAtIChzVHlwZSArIHNMZW4pLCBsZW4pOworICAgICAgICAgICAgc3RhdHVzIHw9IEJUQU1QX1VOS05PV05fVExWUzsKKyAgICAgICAgfQorCisgICAgICAgIC8vIEFkdmFuY2UgdG8gdGhlIG5leHQgVExWCisgICAgICAgIHBCdWZSZW1haW5pbmcgKz0gbGVuOworI2lmZGVmIFdMQU5fQkFQSENJX0VOQUJMRV9MT0dHSU5HCisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0JBUCxWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgImxlbiAtICVkIG5CdWZSZW1haW5pbmcgLSAlZFxuIiwgbGVuLCBuQnVmUmVtYWluaW5nKTsgCisjZW5kaWYKKworICAgICAgICBpZiAobGVuID4gbkJ1ZlJlbWFpbmluZykKKyAgICAgICAgIHsKKyAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkxPR1csIEZSRkwoIlRoaXMgVExWIGV4dGVuZHMgcGFzdCB0aCIKKyAgICAgICAgICAgICAgICAgImUgYnVmZmVyIGFzIGl0IHdhcyBkZWZpbmVkIHRvIHVzLiAgVGhpcyBjb3VsZCBtZWFuICIKKyAgICAgICAgICAgICAgICAgImEgY29ycnVwdCBmcmFtZSwgb3IganVzdCBhbiBpbmNvcnJlY3QgbGVuZ3RoIHBhcmFtZSIKKyAgICAgICAgICAgICAgICAgInRlci5cbiIpKTsKKyAgICAgICAgICAgICBGUkFNRVNfREJHX0JSRUFLKCk7CisgICAgICAgICAgICAgc3RhdHVzIHw9IEJUQU1QX0xBU1RfVExWX1RPT19MT05HOworICAgICAgICAgICAgIGdvdG8gTWFuZGF0b3J5Q2hlY2s7CisgICAgICAgICB9CisKKyAgICAgICAgbkJ1ZlJlbWFpbmluZyAtPSBsZW47CisKKyAgICB9IC8vIEVuZCBpdGVyYXRpb24gb3ZlciBUTFZzLgorCitNYW5kYXRvcnlDaGVjazoKKyAgICBwVGx2ID0gJlRMVnNbMF07CisjaWZkZWYgV0xBTl9CQVBIQ0lfRU5BQkxFX0xPR0dJTkcKKyAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9CQVAsVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgInBUbHYtPmlkIC0gJXhcbiIsIHBUbHYtPmlkKTsgCisjZW5kaWYgICAgCisKKyAgICB3aGlsZSAoMHhmZmZmICE9IHBUbHYtPmlkKQorICAgIHsKKyAgICAgICAgaWYgKHBUbHYtPmZNYW5kYXRvcnkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBmRm91bmQgPSAodl9VOF90KikocEZybSArIHBUbHYtPm9mZnNldCArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUbHYtPnByZXNlbmNlT2Zmc2V0KTsKKyAgICAgICAgICAgIGlmICghKnBmRm91bmQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJMT0dXLCBGUkZMKCJFUlJPUjogVGhlIG1hbmRhdG9yeSAiCisgICAgICAgICAgICAgICAgICAgICJUTFYgJXMgd2Fzbid0IHNlZW4uXG4iKSwKKyAgICAgICAgICAgICAgICAgICAgcFRsdi0+bmFtZSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RCR19CUkVBSygpOworICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBCVEFNUF9NQU5EQVRPUllfVExWX01JU1NJTkc7CisgICAgICAgICAgICB9CisKKyAgICAgICAgfQorICAgICAgICArK3BUbHY7CisgICAgfQorCisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIFVucGFjVGx2a0NvcmUuICovCit2X1UzMl90IGJ0YW1wR2V0UGFja2VkVGx2QU1QX0Fzc29jX0Nvbm5lY3RlZF9DaGFubmVsKHZvaWQgKiBwQ3R4LCB0QnRhbXBUTFZBTVBfQXNzb2NfQ29ubmVjdGVkX0NoYW5uZWwgKnBUbHYsIHZfVTMyX3QgKnBuTmVlZGVkKQoreworICAgIHZfVTMyX3Qgc3RhdHVzID0gQlRBTVBfUEFSU0VfU1VDQ0VTUzsKKyAgICAodm9pZClwQ3R4OyAodm9pZClwVGx2OyAodm9pZClwbk5lZWRlZDsKKyNpZmRlZiBXTEFOX0JBUEhDSV9FTkFCTEVfTE9HR0lORworICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0JBUCxWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAiSW4gYnRhbXBHZXRQYWNrZWRUbHZBTVBfQXNzb2NfQ29ubmVjdGVkX0NoYW5uZWxcbiIpOyAKKyNlbmRpZiAgICAKKworICAgIHdoaWxlICggcFRsdi0+cHJlc2VudCApCisgICAgeworICAgICAgICAqcG5OZWVkZWQgKz0gMzsKKyAgICAgICAgaWYgKCBwVGx2LT5udW1fdHJpcGxldHMgKQorICAgICAgICB7CisgICAgICAgICAgICAqcG5OZWVkZWQgKz0gKCBwVGx2LT5udW1fdHJpcGxldHMgKiAzICk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBicmVhazsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgIHJldHVybiBzdGF0d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VlZGVkKQoreworICAgIHZfVTMyX3Qgc3RhdHVzID0gQlRBTVBfUEFSU0VfU1VDQ0VTUzsKKyAgICAodm9pZClwQ3R4OyAodm9pZClwVGx2OyAodm9pZClwbk5lZWRlZDsKKyAgICB3aGlsZSAoIHBUbHYtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICBzd2l0Y2ggKHBUbHYtPmNvbW1hbmRfb3Bjb2RlKQorICAgICAgICB7CisgICAgICAgICAgICBjYXNlIDMwNzU6CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMzA4MDoKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAxMDgzOgorICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDMwNzc6CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMzA5MzoKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAzMDk0OgorICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDMxMjY6CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDI7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDI7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMzEyNzoKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAzMTY5OgorICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDMxNzA6CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMzE3MToKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAzMTcyOgorICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAzOworICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDMxNzM6CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMzE3NDoKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAzMTc1OgorICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDMxNzc6CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMzE3ODoKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAzMTc5OgorICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDQwOTc6CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDI7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDI7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDI7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgNDA5ODoKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gNjQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgNDEwMToKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMjsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMjsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSA0MTA2OgorICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDUxMjE6CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDI7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDI7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgNTEyMjoKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSA1MTIzOgorICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDUxMjU6CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgNTEyOToKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gNDsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gNDsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gNDsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gNDsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMjsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMjsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gNDsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gNDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSA1MTMwOgorICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSBwVGx2LT5jY19ldmVudC5SZWFkX1JlYWRfTG9jYWxfQU1QX0Fzc29jLnJlbWFpbmluZ19sZW5ndGg7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgNTEzMToKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSA2MTQ1OgorICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDYxNDY6CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGJ0YW1wR2V0UGFja2VkVExWSENJX0NvbW1hbmRfQ29tcGxldGVfRXZlbnQuICovCisKK3R5cGVkZWYgdl9VMzJfdCAoKnBmblBhY2tTaXplVGx2SENJX0NvbW1hbmRfQ29tcGxldGVfRXZlbnRfdCkodm9pZCAqLCB0QnRhbXBUTFZIQ0lfQ29tbWFuZF9Db21wbGV0ZV9FdmVudCosIHZfVTMyX3QqKTsKKyNkZWZpbmUgU2lnUGFja1Npem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ICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tTaXplVGx2QU1QX0Fzc29jX0Nvbm5lY3RlZF9DaGFubmVsX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkFNUF9Bc3NvY19Db25uZWN0ZWRfQ2hhbm5lbCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2QU1QX0Fzc29jX01BQ19BZGRyOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tTaXplVGx2QU1QX0Fzc29jX01BQ19BZGRyX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkFNUF9Bc3NvY19NQUNfQWRkciogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2QU1QX0Fzc29jX1BBTF9DYXBhYmlsaXRpZXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1NpemVUbHZBTVBfQXNzb2NfUEFMX0NhcGFiaWxpdGllc190KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZBTVBfQXNzb2NfUEFMX0NhcGFiaWxpdGllcyogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2QU1QX0Fzc29jX1BBTF9WZXJzaW9uOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tTaXplVGx2QU1QX0Fzc29jX1BBTF9WZXJzaW9uX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkFNUF9Bc3NvY19QQUxfVmVyc2lvbiogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2QU1QX0Fzc29jX1ByZWZlcnJlZF9DaGFubmVsX0xpc3Q6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1NpemVUbHZBTVBfQXNzb2NfUHJlZmVycmVkX0NoYW5uZWxfTGlzdF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZBTVBfQXNzb2NfUHJlZmVycmVkX0NoYW5uZWxfTGlzdCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2Rmxvd19TcGVjOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tTaXplVGx2Rmxvd19TcGVjX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkZsb3dfU3BlYyogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX0FjY2VwdF9Mb2dpY2FsX0xpbmtfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tTaXplVGx2SENJX0FjY2VwdF9Mb2dpY2FsX0xpbmtfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9BY2NlcHRfTG9naWNhbF9MaW5rX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX0FjY2VwdF9QaHlzaWNhbF9MaW5rX0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrU2l6ZVRsdkhDSV9BY2NlcHRfUGh5c2ljYWxfTGlua19DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX0FjY2VwdF9QaHlzaWNhbF9MaW5rX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX0NoYW5uZWxfU2VsZWN0ZWRfRXZlbnQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1NpemVUbHZIQ0lfQ2hhbm5lbF9TZWxlY3RlZF9FdmVudF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfQ2hhbm5lbF9TZWxlY3RlZF9FdmVudCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX0NvbW1hbmRfQ29tcGxldGVfRXZlbnQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1NpemVUbHZIQ0lfQ29tbWFuZF9Db21wbGV0ZV9FdmVudF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfQ29tbWFuZF9Db21wbGV0ZV9FdmVudCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX0NvbW1hbmRfU3RhdHVzX0V2ZW50OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tTaXplVGx2SENJX0NvbW1hbmRfU3RhdHVzX0V2ZW50X3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9Db21tYW5kX1N0YXR1c19FdmVudCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYX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d19FdmVudCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX0Rpc2Nvbm5lY3RfTG9naWNhbF9MaW5rX0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrU2l6ZVRsdkhDSV9EaXNjb25uZWN0X0xvZ2ljYWxfTGlua19DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX0Rpc2Nvbm5lY3RfTG9naWNhbF9MaW5rX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX0Rpc2Nvbm5lY3RfTG9naWNhbF9MaW5rX0NvbXBsZXRlX0V2ZW50OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tTaXplVGx2SENJX0Rpc2Nvbm5lY3RfTG9naWNhbF9MaW5rX0NvbXBsZXRlX0V2ZW50X3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9EaXNjb25uZWN0X0xvZ2ljYWxfTGlua19Db21wbGV0ZV9FdmVudCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX0Rpc2Nvbm5lY3RfUGh5c2ljYWxfTGlua19DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1NpemVUbHZIQ0lfRGlzY29ubmVjdF9QaHlzaWNhbF9MaW5rX0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfRGlzY29ubmVjdF9QaHlzaWNhbF9MaW5rX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX0Rpc2Nvbm5lY3RfUGh5c2ljYWxfTGlua19Db21wbGV0ZV9FdmVudDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrU2l6ZVRsdkhDSV9EaXNjb25uZWN0X1BoeXNpY2FsX0xpbmtfQ29tcGxldGVfRXZlbnRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX0Rpc2Nvbm5lY3RfUGh5c2ljYWxfTGlua19Db21wbGV0ZV9FdmVudCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX0Zsb3dfU3BlY19Nb2RpZnlfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tTaXplVGx2SENJX0Zsb3dfU3BlY19Nb2RpZnlfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9GbG93X1NwZWNfTW9kaWZ5X0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX0Zsb3dfU3BlY19Nb2RpZnlfQ29tcGxldGVfRXZlbnQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1NpemVUbHZIQ0lfRmxvd19TcGVjX01vZGlmeV9Db21wbGV0ZV9FdmVudF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfRmxvd19TcGVjX01vZGlmeV9Db21wbGV0ZV9FdmVudCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX0ZsdXNoX0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrU2l6ZVRsdkhDSV9GbHVzaF9DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX0ZsdXNoX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX0ZsdXNoX09jY3VycmVkX0V2ZW50OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tTaXplVGx2SENJX0ZsdXNoX09jY3VycmVkX0V2ZW50X3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9GbHVzaF9PY2N1cnJlZF9FdmVudCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX0dlbmVyaWNfQU1QX0xpbmtfS2V5X05vdGlmaWNhdGlvbl9FdmVudDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrU2l6ZVRsdkhDSV9HZW5lcmljX0FNUF9MaW5rX0tleV9Ob3RpZmljYXRpb25fRXZlbnRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX0dlbmVyaWNfQU1QX0xpbmtfS2V5X05vdGlmaWNhdGlvbl9FdmVudCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX0hhcmR3YXJlX0Vycm9yX0V2ZW50OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tTaXplVGx2SENJX0hhcmR3YXJlX0Vycm9yX0V2ZW50X3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9IYXJkd2FyZV9FcnJvcl9FdmVudCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX0xvZ2ljYWxfTGlua19DYW5jZWxfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tTaXplVGx2SENJX0xvZ2ljYWxfTGlua19DYW5jZWxfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9Mb2dpY2FsX0xpbmtfQ2FuY2VsX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX0xvZ2ljYWxfTGlua19Db21wbGV0ZV9FdmVudDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrU2l6ZVRsdkhDSV9Mb2dpY2FsX0xpbmtfQ29tcGxldGVfRXZlbnRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX0xvZ2ljYWxfTGlua19Db21wbGV0ZV9FdmVudCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX0xvb3BiYWNrX0NvbW1hbmRfRXZlbnQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1NpemVUbHZIQ0lfTG9vcGJhY2tfQ29tbWFuZF9FdmVudF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfTG9vcGJhY2tfQ29tbWFuZF9FdmVudCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1BoeXNpY2FsX0xpbmtfQ29tcGxldGVfRXZlbnQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1NpemVUbHZIQ0lfUGh5c2ljYWxfTGlua19Db21wbGV0ZV9FdmVudF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfUGh5c2ljYWxfTGlua19Db21wbGV0ZV9FdmVudCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1BoeXNpY2FsX0xpbmtfTG9zc19XYXJuaW5nX0V2ZW50OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tTaXplVGx2SENJX1BoeXNpY2FsX0xpbmtfTG9zc19XYXJuaW5nX0V2ZW50X3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9QaHlzaWNhbF9MaW5rX0xvc3NfV2FybmluZ19FdmVudCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1BoeXNpY2FsX0xpbmtfUmVjb3ZlcnlfRXZlbnQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1NpemVUbHZIQ0lfUGh5c2ljYWxfTGlua19SZWNvdmVyeV9FdmVudF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfUGh5c2ljYWxfTGlua19SZWNvdmVyeV9FdmVudCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1Fvc19WaW9sYXRpb25fRXZlbnQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1NpemVUbHZIQ0lfUW9zX1Zpb2xhdGlvbl9FdmVudF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfUW9zX1Zpb2xhdGlvbl9FdmVudCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1JlYWRfQmVzdF9FZmZvcnRfRmx1c2hfVGltZW91dF9DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1NpemVUbHZIQ0lfUmVhZF9CZXN0X0VmZm9ydF9GbHVzaF9UaW1lb3V0X0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfUmVhZF9CZXN0X0VmZm9ydF9GbHVzaF9UaW1lb3V0X0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1JlYWRfQnVmZmVyX1NpemVfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tTaXplVGx2SENJX1JlYWRfQnVmZmVyX1NpemVfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9SZWFkX0J1ZmZlcl9TaXplX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1JlYWRfQ29ubmVjdGlvbl9BY2NlcHRfVGltZW91dF9DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1NpemVUbHZIQ0lfUmVhZF9Db25uZWN0aW9uX0FjY2VwdF9UaW1lb3V0X0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfUmVhZF9Db25uZWN0aW9uX0FjY2VwdF9UaW1lb3V0X0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1JlYWRfRGF0YV9CbG9ja19TaXplX0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrU2l6ZVRsdkhDSV9SZWFkX0RhdGFfQmxvY2tfU2l6ZV9DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX1JlYWRfRGF0YV9CbG9ja19TaXplX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1JlYWRfRmFpbGVkX0NvbnRhY3RfQ291bnRlcl9DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1NpemVUbHZIQ0lfUmVhZF9GYWlsZWRfQ29udGFjdF9Db3VudGVyX0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfUmVhZF9GYWlsZWRfQ29udGFjdF9Db3VudGVyX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1JlYWRfRmxvd19Db250cm9sX01vZGVfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tTaXplVGx2SENJX1JlYWRfRmxvd19Db250cm9sX01vZGVfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9SZWFkX0Zsb3dfQ29udHJvbF9Nb2RlX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1JlYWRfTGlua19RdWFsaXR5X0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrU2l6ZVRsdkhDSV9SZWFkX0xpbmtfUXVhbGl0eV9DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX1JlYWRfTGlua19RdWFsaXR5X0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1JlYWRfTGlua19TdXBlcnZpc2lvbl9UaW1lb3V0X0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrU2l6ZVRsdkhDSV9SZWFkX0xpbmtfU3VwZXJ2aXNpb25fVGltZW91dF9DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX1JlYWRfTGlua19TdXBlcnZpc2lvbl9UaW1lb3V0X0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1JlYWRfTG9jYWxfQU1QX0Fzc29jX0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrU2l6ZVRsdkhDSV9SZWFkX0xvY2FsX0FNUF9Bc3NvY19DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX1JlYWRfTG9jYWxfQU1QX0Fzc29jX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1JlYWRfTG9jYWxfQU1QX0luZm9ybWF0aW9uX0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrU2l6ZVRsdkhDSV9SZWFkX0xvY2FsX0FNUF9JbmZvcm1hdGlvbl9DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX1JlYWRfTG9jYWxfQU1QX0luZm9ybWF0aW9uX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1JlYWRfTG9jYWxfU3VwcG9ydGVkX0NtZHNfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tTaXplVGx2SENJX1JlYWRfTG9jYWxfU3VwcG9ydGVkX0NtZHNfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9SZWFkX0xvY2FsX1N1cHBvcnRlZF9DbWRzX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1JlYWRfTG9jYWxfVmVyc2lvbl9JbmZvX0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrU2l6ZVRsdkhDSV9SZWFkX0xvY2FsX1ZlcnNpb25fSW5mb19DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX1JlYWRfTG9jYWxfVmVyc2lvbl9JbmZvX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1JlYWRfTG9jYXRpb25fRGF0YV9DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1NpemVUbHZIQ0lfUmVhZF9Mb2NhdGlvbl9EYXRhX0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfUmVhZF9Mb2NhdGlvbl9EYXRhX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1JlYWRfTG9naWNhbF9MaW5rX0FjY2VwdF9UaW1lb3V0X0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrU2l6ZVRsdkhDSV9SZWFkX0xvZ2ljYWxfTGlua19BY2NlcHRfVGltZW91dF9DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX1JlYWRfTG9naWNhbF9MaW5rX0FjY2VwdF9UaW1lb3V0X0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1JlYWRfTG9vcGJhY2tfTW9kZV9DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1NpemVUbHZIQ0lfUmVhZF9Mb29wYmFja19Nb2RlX0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfUmVhZF9Mb29wYmFja19Nb2RlX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1JlYWRfUlNTSV9DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1NpemVUbHZIQ0lfUmVhZF9SU1NJX0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfUmVhZF9SU1NJX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1Jlc2V0X0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrU2l6ZVRsdkhDSV9SZXNldF9DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX1Jlc2V0X0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1Jlc2V0X0ZhaWxlZF9Db250YWN0X0NvdW50ZXJfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tTaXplVGx2SENJX1Jlc2V0X0ZhaWxlZF9Db250YWN0X0NvdW50ZXJfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9SZXNldF9GYWlsZWRfQ29udGFjdF9Db3VudGVyX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1NldF9FdmVudF9NYXNrX0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrU2l6ZVRsdkhDSV9TZXRfRXZlbnRfTWFza19DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX1NldF9FdmVudF9NYXNrX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1NldF9FdmVudF9NYXNrX1BhZ2VfMl9DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1NpemVUbHZIQ0lfU2V0X0V2ZW50X01hc2tfUGFnZV8yX0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfU2V0X0V2ZW50X01hc2tfUGFnZV8yX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1NldF9TaG9ydF9SYW5nZV9Nb2RlX0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrU2l6ZVRsdkhDSV9TZXRfU2hvcnRfUmFuZ2VfTW9kZV9DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX1NldF9TaG9ydF9SYW5nZV9Nb2RlX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8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Glua19TdXBlcnZpc2lvbl9UaW1lb3V0X0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1dyaXRlX0xvY2F0aW9uX0RhdGFfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tTaXplVGx2SENJX1dyaXRlX0xvY2F0aW9uX0RhdGFfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9Xcml0ZV9Mb2NhdGlvbl9EYXRhX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1dyaXRlX0xvZ2ljYWxfTGlua19BY2NlcHRfVGltZW91dF9DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1NpemVUbHZIQ0lfV3JpdGVfTG9naWNhbF9MaW5rX0FjY2VwdF9UaW1lb3V0X0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfV3JpdGVfTG9naWNhbF9MaW5rX0FjY2VwdF9UaW1lb3V0X0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1dyaXRlX0xvb3BiYWNrX01vZGVfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tTaXplVGx2SENJX1dyaXRlX0xvb3BiYWNrX01vZGVfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9Xcml0ZV9Mb29wYmFja19Nb2RlX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tTaXplVGx2SENJX1dyaXRlX1JlbW90ZV9BTVBfQVNTT0NfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tTaXplVGx2SENJX1dyaXRlX1JlbW90ZV9BTVBfQVNTT0NfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9Xcml0ZV9SZW1vdGVfQU1QX0FTU09DX0NtZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJMT0dFLCBGUkZMKCJJTlRFUk5BTCBFUlJPUi0tIEkgZG9uIgorICAgICAgICAgICAgICAgICAgICAiJ3Qga25vdyBhYm91dCB0aGUgVExWIHNpZ25hdHVyZSAlZDsgdGhpcyBpcyBtb3N0IGwiCisgICAgICAgICAgICAgICAgICAgICJpa2VseSBhIGJ1ZyBpbiAnZnJhbWVzYycuXG4iKSwgcFRsdi0+c2lnKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gQlRBTVBfSU5URVJOQUxfRVJST1I7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgKytwVGx2OworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfQordl9VMzJfdCBidGFtcFBhY2tUbHZBTVBfQXNzb2NfQ29ubmVjdGVkX0NoYW5uZWwodm9pZCAqIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QnRhbXBUTFZBTVBfQXNzb2NfQ29ubmVjdGVkX0NoYW5uZWwgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90ICpwbkNvbnN1bWVkKQoreworICAgIHZfVThfdCogcFRsdkxlbiA9IDA7CisgICAgdl9VMzJfdCBuQ29uc3VtZWRPbkVudHJ5OworICAgIHZfVTMyX3Qgc3RhdHVzID0gQlRBTVBfUEFSU0VfU1VDQ0VTUzsKKyAgICB2X1UzMl90IG5OZWVkZWQgPSAwVTsKKyAgICB2X1UzMl90IHNUeXBlID0gMFU7CisgICAgdl9VMzJfdCBzTGVuID0gMFU7CisgICAgc1R5cGUgPSAxOworICAgIHNMZW4gPSAyOworI2lmZGVmIFdMQU5fQkFQSENJX0VOQUJMRV9MT0dHSU5HCisgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfQkFQLFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICJJbiBidGFtcFBhY2tUbHZBTVBfQXNzb2NfQ29ubmVjdGVkX0NoYW5uZWxcbiIpOyAKKyNlbmRpZiAgIC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mMtPmNvdW50cnksIDMpOworICAgICAgICAqcG5Db25zdW1lZCArPSAzOworICAgICAgICBwQnVmICs9IDM7CisgICAgICAgIG5CdWYgLT0gMzsKKyAgICAgICAgaWYgKCBwU3JjLT5udW1fdHJpcGxldHMgKSAgICAgICAgeworICAgICAgICAgICAgQlRBTVBfTUVNQ1BZKHBDdHgsIHBCdWYsICYoIHBTcmMtPnRyaXBsZXRzICksICggcFNyYy0+bnVtX3RyaXBsZXRzICogMyApKTsKKyAgICAgICAgICAgICpwbkNvbnN1bWVkICs9ICggcFNyYy0+bnVtX3RyaXBsZXRzICogMyApOworICAgICAgICAgICAgcEJ1ZiArPSAoICggcFNyYy0+bnVtX3RyaXBsZXRzICogMyApICk7CisgICAgICAgICAgICBuQnVmIC09ICggKCBwU3JjLT5udW1fdHJpcGxldHMgKiAzICkgKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGJyZWFrOworICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICBpZiAocFRsdkxlbiAmJiBzTGVuID09IDIpCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcFRsdkxlbiwgKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gc1R5cGUgLSBzTGVuLCAwKTsKKyAgICB9IAorICAgIGVsc2UgaWYoTlVMTCAhPSBwVGx2TGVuKQorICAgIHsKKyAgICAgICAgKnBUbHZMZW4gPSAodl9VOF90KSgqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSBzVHlwZSAtIHNMZW4pOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgYnRhbXBQYWNrVGx2QU1QX0Fzc29jX0Nvbm5lY3RlZF9DaGFubmVsLiAqLworCit0eXBlZGVmIHZfVTMyX3QgKCpwZm5QYWNrVGx2QU1QX0Fzc29jX0Nvbm5lY3RlZF9DaGFubmVsX3QpKHZvaWQgKiwgdEJ0YW1wVExWQU1QX0Fzc29jX0Nvbm5lY3RlZF9DaGFubmVsICosIHZfVThfdCosIHZfVTMyX3QsIHZfVTMyX3QqKTsKKyNkZWZpbmUgU2lnUGFja1RsdkFNUF9Bc3NvY19Db25uZWN0ZWRfQ2hhbm5lbCAoIDB4MDA3YiApCisKK3ZfVTMyX3QgYnRhbXBQYWNrVGx2QU1QX0Fzc29jX01BQ19BZGRyKHZvaWQgKiBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEJ0YW1wVExWQU1QX0Fzc29jX01BQ19BZGRyICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcG5Db25zdW1lZCkKK3sKKyAgICB2X1U4X3QqIHBUbHZMZW4gPSAwOworICAgIHZfVTMyX3QgbkNvbnN1bWVkT25FbnRyeTsKKyAgICB2X1UzMl90IHN0YXR1cyA9IEJUQU1QX1BBUlNFX1NVQ0NFU1M7CisgICAgdl9VMzJfdCBuTmVlZGVkID0gMFU7CisgICAgdl9VMzJfdCBzVHlwZSA9IDBVOworICAgIHZfVTMyX3Qgc0xlbiA9IDBVOworICAgIHNUeXBlID0gMTsKKyAgICBzTGVuID0gMjsKKyNpZmRlZiBXTEFOX0JBUEhDSV9FTkFCTEVfTE9HR0lORworICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0JBUCxWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAiSW4gYnRhbXBQYWNrVGx2QU1QX0Fzc29jX01BQ19BZGRyXG4iKTsgCisjZW5kaWYgICAgCisgICAgLy8gc2FuaXR5IGNoZWNraW5nCisgICAgaWYoIHBDdHggPT0gTlVMTCB8fCBwU3JjID09IE5VTEwgfHwKKyAgICAgICAgcEJ1ZiA9PS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ICBicmVhazsKKyAgICB9CisKKyAgICBpZiAocFRsdkxlbiAmJiBzTGVuID09IDIpCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcFRsdkxlbiwgKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gc1R5cGUgLSBzTGVuLCAwKTsKKyAgICB9IGVsc2UgaWYoTlVMTCAhPSBwVGx2TGVuKQorICAgIHsKKyAgICAgICAgKnBUbHZMZW4gPSAodl9VOF90KSgqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSBzVHlwZSAtIHNMZW4pOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgYnRhbXBQYWNrVGx2QU1QX0Fzc29jX01BQ19BZGRyLiAqLworCit0eXBlZGVmIHZfVTMyX3QgKCpwZm5QYWNrVGx2QU1QX0Fzc29jX01BQ19BZGRyX3QpKHZvaWQgKiwgdEJ0YW1wVExWQU1QX0Fzc29jX01BQ19BZGRyICosIHZfVThfdCosIHZfVTMyX3QsIHZfVTMyX3QqKTsKKyNkZWZpbmUgU2lnUGFja1RsdkFNUF9Bc3NvY19NQUNfQWRkciAoIDB4MDA3YyApCisKK3ZfVTMyX3QgYnRhbXBQYWNrVGx2QU1QX0Fzc29jX1BBTF9DYXBhYmlsaXRpZXModm9pZCAqIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRCdGFtcFRMVkFNUF9Bc3NvY19QQUxfQ2FwYWJpbGl0aWVzICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcG5Db25zdW1lZCkKK3sKK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IDB4MDA3ZSApCisKK3ZfVTMyX3QgYnRhbXBQYWNrVGx2QU1QX0Fzc29jX1ByZWZlcnJlZF9DaGFubmVsX0xpc3Qodm9pZCAqIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRCdGFtcFRMVkFNUF9Bc3NvY19QcmVmZXJyZWRfQ2hhbm5lbF9MaXN0ICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcG5Db25zdW1lZCkKK3sKKyAgICB2X1U4X3QqIHBUbHZMZW4gPSAwOworICAgIHZfVTMyX3QgbkNvbnN1bWVkT25FbnRyeTsKKyAgICB2X1UzMl90IHN0YXR1cyA9IEJUQU1QX1BBUlNFX1NVQ0NFU1M7CisgICAgdl9VMzJfdCBuTmVlZGVkID0gMFU7CisgICAgdl9VMzJfdCBzVHlwZSA9IDBVOworICAgIHZfVTMyX3Qgc0xlbiA9IDBVOworICAgIHNUeXBlID0gMTsKKyAgICBzTGVuID0gMjsKKyNpZmRlZiBXTEFOX0JBUEhDSV9FTkFCTEVfTE9HR0lORworICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0JBUCxWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAiSW4gYnRhbXBQYWNrVGx2QU1QX0Fzc29jX1ByZWZlcnJlZF9DaGFubmVsX0xpc3RcbiIpOyAKKyNlbmRpZiAgICAKKyAgICAvLyBzYW5pdHkgY2hlY2tpbmcKKyAgICBpZiggcEN0eCA9PSBOVUxMIHx8IHBTcmMgPT0gTlVMTCB8fAorICAgICAgICBwQnVmID09IE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ZSBTaWdQYWNrVGx2QU1QX0Fzc29jX1ByZWZlcnJlZF9DaGFubmVsX0xpc3QgKCAweDAwN2YgKQorCit2X1UzMl90IGJ0YW1wUGFja1RsdkZsb3dfU3BlYyh2b2lkICogcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRCdGFtcFRMVkZsb3dfU3BlYyAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgKnBuQ29uc3VtZWQpCit7CisgICAgdl9VOF90KiBwVGx2TGVuID0gMDsKKyAgICB2X1UzMl90IG5Db25zdW1lZE9uRW50cnk7CisgICAgdl9VMzJfdCBzdGF0dXMgPSBCVEFNUF9QQVJTRV9TVUNDRVNTOworICAgIHZfVTMyX3Qgbk5lZWRlZCA9IDBVOworICAgIHZfVTMyX3Qgc1R5cGUgPSAwVTsKKyAgICB2X1UzMl90IHNMZW4gPSAwVTsKKyAgICBzVHlwZSA9IDE7CisgICAgc0xlbiA9IDE7CisgICAgICAgIC8vIHNhbml0eSBjaGVja2luZworICAgIGlmKCBwQ3R4ID09IE5VTEwgfHwgcFNyYyA9PSBOVUxMIHx8CisgICAgICAgIHBCdWYgPT0gTlVMTCB8fCBwbkNvbnN1bWVkID09IE5VTEwpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJiYWQgaW5wdXQiICk7CisgICAgICAgIHJldHVybiBCVEFNUF9CQURfSU5QVVRfQlVGRkVSOworICAgIH0KKworICAgIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKworICAgIHN0YXR1cyA9IGJ0YW1wR2V0UGFja2VkVGx2Rmxvd19TcGVjKHBDdHgsIHB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fQ21kKHZvaWQgKiBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEJ0YW1wVExWSENJX0FjY2VwdF9Mb2dpY2FsX0xpbmtfQ21kICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcG5Db25zdW1lZCkKK3sKKyAgICB2X1U4X3QqIHBUbHZMZW4gPSAwOworICAgIHZfVTMyX3QgbkNvbnN1bWVkT25FbnRyeTsKKyAgICB2X1UzMl90IHN0YXR1cyA9IEJUQU1QX1BBUlNFX1NVQ0NFU1M7CisgICAgdl9VMzJfdCBuTmVlZGVkID0gMFU7CisgICAgdl9VMzJfdCBzVHlwZSA9IDBVOworICAgIHZfVTMyX3Qgc0xlbiA9IDBVOworICAgIHNUeXBlID0gMjsKKyAgICBzTGVuID0gMTsKKyAgICAgICAgLy8gc2FuaXR5IGNoZWNraW5nCisgICAgaWYoIHBDdHggPT0gTlVMTCB8fCBwU3JjID09IE5VTEwgfHwKKyAgICAgICAgcEJ1ZiA9PSBOVUxMIHx8IHBuQ29uc3VtZWQgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgImJhZCBpbnB1dCIgKTsKKyAgICAgICAgcmV0dXJuIEJUQU1QX0JBRF9JTlBVVF9CVUZGRVI7CisgICAgfQorCisgICAgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworCisgICAgc3RhdHVzID0gYnRhbXBHZXRQYWNrZWRUbHZIQ0lfQWNjZXB0X0xvZ2ljYWxfTGlua19DbWQocEN0eCwgcFNyYywgJm5OZWVkZWQpOworICAgIGlmICggISBCVEFNUF9TVUNDRUVERUQoIHN0YXR1cyApICkgcmV0dXJuIHN0YXR1czsKKyAgICBuTmVlZGVkICs9IHNUeXBlICsgc0xlbjsKKyAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIEJUQU1QX0JVRkZFUl9PVkVSRkxPVzsKKyAgICBwVGx2TGVuID0gcEJ1ZjsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYoIHNUeXBlID09IDIpIGZyYW1lc2h0b25zKCBwQ3R4LCBwQnVmLCAxMDgxLCAwKTsKKyAgICAgICAgcEJ1ZiArPSBzVHlwZTsgbkJ1ZiAtPSBzVHlwZTsgKnBuQ29uc3VtZWQgKz0gc1R5cGU7CisgICAgICAgIHBUbHZMZW4gPSBwQnVmOworICAgICAgICBwQnVmICs9IHNMZW47IG5CdWYgLT0gc0xlbjsgKnBuQ29uc3VtZWQgKz0gc0xlbjsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5waHlfbGlua19oYW5kbGU7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICBCVEFNUF9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+dHhfZmxvd19zcGVjLCAxOCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE4OworICAgICAgICBwQnVmICs9IDE4OworICAgICAgICBuQnVmIC09IDE4OworICAgICAgICBCVEFNUF9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+cnhfZmxvd19zcGVjLCAxOCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE4OworICAgICAgICBwQnVmICs9IDE4OworICAgICAgICBuQnVmIC09IDE4OworICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICBpZiAocFRsdkxlbiAmJiBzTGVuID09IDIpCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcFRsdkxlbiwgKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gc1R5cGUgLSBzTGVuLCAwKTsKKyAgICB9IGVsc2UgaWYoTlVMTCAhPSBwVGx2TGVuKQorICAgIHsKKyAgICAgICAgKnBUbHZMZW4gPSAodl9VOF90KSgqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSBzVHlwZSAtIHNMZW4pOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgYnRhbXBQYWNrVGx2SENJX0FjY2VwdF9Mb2dpY2FsX0xpbmtfQ21kLiAqLworCit0eXBlZGVmIHZfVTMyX3QgKCpwZm5QYWNrVGx2SENJX0FjY2VwdF9Mb2dpY2FsX0xpbmtfQ21kX3QpKHZvaWQgKiwgdEJ0YW1wVExWSENJX0FjY2VwdF9Mb2dpY2FsX0xpbmtfQ21kICosIHZfVThfdCosIHZfVTMyX3QsIHZfVTMyX3QqKTsKKyNkZWZpbmUgU2lnUGFja1RsdkhDSV9BY2NlcHRfTG9naWNhbF9MaW5rX0NtZCAoIDB4MDA4MSApCisKK3ZfVTMyX3QgYnRhbXBQYWNrVGx2SENJX0FjY2VwdF9QaHlzaWNhbF9MaW5rX0NtZCh2b2lkICogcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QnRhbXBUTFZIQ0lfQWNjZXB0X1BoeXNpY2FsX0xpbmtfQ21kICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcG5Db25z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ICE9IHBUbHZMZW4pCisgICAgeworICAgICAgICAqcFRsdkxlbiA9ICh2X1U4X3QpKCpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIHNUeXBlIC0gc0xlbik7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBidGFtcFBhY2tUbHZIQ0lfQWNjZXB0X1BoeXNpY2FsX0xpbmtfQ21kLiAqLworCit0eXBlZGVmIHZfVTMyX3QgKCpwZm5QYWNrVGx2SENJX0FjY2VwdF9QaHlzaWNhbF9MaW5rX0NtZF90KSh2b2lkICosIHRCdGFtcFRMVkhDSV9BY2NlcHRfUGh5c2ljYWxfTGlua19DbWQgKiwgdl9VOF90Kiwgdl9VMzJfdCwgdl9VMzJfdCopOworI2RlZmluZSBTaWdQYWNrVGx2SENJX0FjY2VwdF9QaHlzaWNhbF9MaW5rX0NtZCAoIDB4MDA4MiApCisKK3ZfVTMyX3QgYnRhbXBQYWNrVGx2SENJX0NoYW5uZWxfU2VsZWN0ZWRfRXZlbnQodm9pZCAqIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRCdGFtcFRMVkhDSV9DaGFubmVsX1NlbGVjdGVkX0V2ZW50ICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcG5Db25zdW1lZCkKK3sKKyAgICB2X1U4X3QqIHBUbHZMZW4gPSAwOworICAgIHZfVTMyX3QgbkNvbnN1bWVkT25FbnRyeTsKKyAgICB2X1UzMl90IHN0YXR1cyA9IEJUQU1QX1BBUlNFX1NVQ0NFU1M7CisgICAgdl9VMzJfdCBuTmVl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bmRfQ29tcGxldGVfRXZlbnQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90ICpwbkNvbnN1bWVkKQoreworICAgIHZfVThfdCogcFRsdkxlbiA9IDA7CisgICAgdl9VMzJfdCBuQ29uc3VtZWRPbkVudHJ5OworICAgIHZfVTMyX3Qgc3RhdHVzID0gQlRBTVBfUEFSU0VfU1VDQ0VTUzsKKyAgICB2X1UzMl90IG5OZWVkZWQgPSAwVTsKKyAgICB2X1UzMl90IHNUeXBlID0gMFU7CisgICAgdl9VMzJfdCBzTGVuID0gMFU7CisgICAgc1R5cGUgPSAxOworICAgIHNMZW4gPSAxOworICAgICAgICAvLyBzYW5pdHkgY2hlY2tpbmcKKyAgICBpZiggcEN0eCA9PSBOVUxMIHx8IHBTcmMgPT0gTlVMTCB8fAorICAgICAgICBwQnVmID09IE5VTEwgfHwgcG5Db25zdW1lZCA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiYmFkIGlucHV0IiApOworICAgICAgICByZXR1cm4gQlRBTVBfQkFEX0lOUFVUX0JVRkZFUjsKKyAgICB9CisKKyAgICBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisKKyAgICBzdGF0dXMgPSBidGFtcEdldFBhY2tlZFRsdkhDSV9Db21tYW5kX0NvbXBsZXRlX0V2ZW50KHBDdHgsIHBTcmMsICZuTmVlZGVkKTsKKyAgICBpZiAoICEgQlRBTVBfU1VDQ0VFREVEKCBzdGF0dXMgKSApIHJldHVybiBzdGF0dXM7CisgICAgbk5lZWRlZCArPSBzVHlwZSArIHNMZW47CisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBCVEFNUF9CVUZGRVJfT1ZFUkZMT1c7CisgICAgcFRsdkxlbiA9IHBCdWY7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmKCBzVHlwZSA9PSAyKSBmcmFtZXNodG9ucyggcEN0eCwgcEJ1ZiwgMTQsIDApOworICAgICAgICBlbHNlICpwQnVmID0gMTQ7CisgICAgICAgIHBCdWYgKz0gc1R5cGU7IG5CdWYgLT0gc1R5cGU7ICpwbkNvbnN1bWVkICs9IHNUeXBlOworICAgICAgICBwVGx2TGVuID0gcEJ1ZjsKKyAgICAgICAgcEJ1ZiArPSBzTGVuOyBuQnVmIC09IHNMZW47ICpwbkNvbnN1bWVkICs9IHNMZW47CisgICAgICAgICpwQnVmID0gcFNyYy0+bnVtX2hjaV9jb21tYW5kX3BhY2tldHM7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5jb21tYW5kX29wY29kZSwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgbkJ1ZiAtPSAyOworICAgICAgICBzd2l0Y2ggKHBTcmMtPmNvbW1hbmRfb3Bjb2RlKQorICAgICAgICB7CisgICAgICAgICAgICBjYXNlIDMwNzU6CisgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5jY19ldmVudC5SZXNldC5zdGF0dXM7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDMwODA6CisgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5jY19ldmVudC5GbHVzaC5zdGF0dXM7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICAgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmNjX2V2ZW50LkZsdXNoLmxvZ19saW5rX2hhbmRsZSwgMCk7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICAgICAgbkJ1ZiAtPSAyOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDEwODM6CisgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5jY19ldmVudC5Mb2dpY2FsX0xpbmtfQ2FuY2VsLnN0YXR1czsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5jY19ldmVudC5Mb2dpY2FsX0xpbmtfQ2FuY2VsLnBoeV9saW5rX2hhbmRsZTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5jY19ldmVudC5Mb2dpY2FsX0xpbmtfQ2FuY2VsLnR4X2Zsb3dfc3BlY19pZDsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMzA3NzoKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNjX2V2ZW50LlNldF9FdmVudF9NYXNrLnN0YXR1czsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMzA5MzoKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNjX2V2ZW50LlJlYWRfQ29ubmVjdGlvbl9BY2NlcHRfVE8uc3RhdHVzOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMTsKKyAgICAgICAgICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5jY19ldmVudC5SZWFkX0Nvbm5lY3Rpb25fQWNjZXB0X1RPLmNvbm5lY3Rpb25fYWNjZXB0X3RpbWVvdXQsIDApOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAzMDk0OgorICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+Y2NfZXZlbnQuV3JpdGVfQ29ubmVjdGlvbl9BY2NlcHRfVE8uc3RhdHVzOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAzMTI2OgorICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+Y2NfZXZlbnQuUmVhZF9MaW5rX1N1cGVydmlzaW9uX1RPLnN0YXR1czsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+Y2NfZXZlbnQuUmVhZF9MaW5rX1N1cGVydmlzaW9uX1RPLmxvZ19saW5rX2hhbmRsZSwgMCk7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICAgICAgbkJ1ZiAtPSAyOworICAgICAgICAgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmNjX2V2ZW50LlJlYWRfTGlua19TdXBlcnZpc2lvbl9UTy5saW5rX3N1cGVydmlzaW9uX3RpbWVvdXQsIDApOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAzMTI3OgorICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+Y2NfZXZlbnQuV3JpdGVfTGlua19TdXBlcnZpc2lvbl9UTy5zdGF0dXM7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICAgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmNjX2V2ZW50LldyaXRlX0xpbmtfU3VwZXJ2aXNpb25fVE8ubG9nX2xpbmtfaGFuZGxlLCAwKTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDI7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMzE2OToKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNjX2V2ZW50LlJlYWRfTG9naWNhbF9MaW5rX0FjY2VwdF9UTy5zdGF0dXM7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICAgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmNjX2V2ZW50LlJlYWRfTG9naWNhbF9MaW5rX0FjY2VwdF9UTy5sb2dpY2FsX2xpbmtfYWNjZXB0X3RpbWVvdXQsIDApOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAzMTcwOgorICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+Y2NfZXZlbnQuV3JpdGVfTG9naWNhbF9MaW5rX0FjY2VwdF9UTy5zdGF0dXM7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDMxNzE6CisgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5jY19ldmVudC5TZXRfRXZlbnRfTWFza19QYWdlXzIuc3RhdHVzOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAzMTcyOgorICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+Y2NfZXZlbnQuUmVhZF9Mb2NhdGlvbl9EYXRhLnN0YXR1czsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5jY19ldmVudC5SZWFkX0xvY2F0aW9uX0RhdGEubG9jX2RvbWFpbl9hd2FyZTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICAgICAgICAgQlRBTVBfTUVNQ1BZKHBDdHgsIHBCdWYsIHBTcmMtPmNjX2V2ZW50LlJlYWRfTG9jYXRpb25fRGF0YS5sb2NfZG9tYWluLCAzKTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAzOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMzsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDM7CisgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5jY19ldmVudC5SZWFkX0xvY2F0aW9uX0RhdGEubG9jX29wdGlvbnM7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDMxNzM6CisgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5jY19ldmVudC5Xcml0ZV9Mb2NhdGlvbl9EYXRhLnN0YXR1czsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMzE3NDoKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNjX2V2ZW50LlJlYWRfRmxvd19Db250cm9sX01vZGUuc3RhdHVzOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMTsKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNjX2V2ZW50LlJlYWRfRmxvd19Db250cm9sX01vZGUuZmxvd19jb250cm9sX21vZGU7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDMxNzU6CisgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5jY19ldmVudC5Xcml0ZV9GbG93X0NvbnRyb2xfTW9kZS5zdGF0dXM7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDMxNzc6CisgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5jY19ldmVudC5SZWFkX0JFX0ZsdXNoX1RPLnN0YXR1czsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICAgICAgICAgZnJhbWVzaHRvbmwocEN0eCwgcEJ1ZiwgcFNyYy0+Y2NfZXZlbnQuUmVhZF9CRV9GbHVzaF9UTy5iZXN0X2VmZm9ydF9mbHVzaF90aW1lb3V0LCAwKTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSA0OworICAgICAgICAgICAgICAgIHBCdWYgKz0gNDsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMzE3ODoKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNjX2V2ZW50LldyaXRlX0JFX0ZsdXNoX1RPLnN0YXR1czsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMzE3OToKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNjX2V2ZW50LlNldF9TaG9ydF9SYW5nZV9Nb2RlLnN0YXR1czsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgNDA5NzoKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNjX2V2ZW50LlJlYWRfTG9jYWxfVmVyc2lvbl9JbmZvLnN0YXR1czsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5jY19ldmVudC5SZWFkX0xvY2FsX1ZlcnNpb25fSW5mby5IQ19IQ0lfVmVyc2lvbjsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+Y2NfZXZlbnQuUmVhZF9Mb2NhbF9WZXJzaW9uX0luZm8uSENfSENJX1JldmlzaW9uLCAwKTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDI7CisgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5jY19ldmVudC5SZWFkX0xvY2FsX1ZlcnNpb25fSW5mby5IQ19QQUxfVmVyc2lvbjsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+Y2NfZXZlbnQuUmVhZF9Mb2NhbF9WZXJzaW9uX0luZm8uSENfTWFudWZhY19OYW1lLCAwKTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDI7CisgICAgICAgICAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+Y2NfZXZlbnQuUmVhZF9Mb2NhbF9WZXJzaW9uX0luZm8uSENfUEFMX1N1Yl9WZXJzaW9uLCAwKTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDI7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgNDA5ODoKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNjX2V2ZW50LlJlYWRfTG9jYWxfU3VwcG9ydGVkX0NtZHMuc3RhdHVzOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMTsKKyAgICAgICAgICAgICAgICBCVEFNUF9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+Y2NfZXZlbnQuUmVhZF9Mb2NhbF9TdXBwb3J0ZWRfQ21kcy5IQ19TdXBwb3J0X0NtZHMsIDY0KTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSA2NDsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDY0OworICAgICAgICAgICAgICAgIG5CdWYgLT0gNjQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgNDEwMToKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNjX2V2ZW50LlJlYWRfQnVmZmVyX1NpemUuc3RhdHVzOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMTsKKyAgICAgICAgICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5jY19ldmVudC5SZWFkX0J1ZmZlcl9TaXplLkhDX0FDTF9EYXRhX1BhY2tldF9MZW5ndGgsIDApOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNjX2V2ZW50LlJlYWRfQnVmZmVyX1NpemUuSENfU0NPX1BhY2tldF9MZW5ndGg7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICAgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmNjX2V2ZW50LlJlYWRfQnVmZmVyX1NpemUuSENfVG90YWxfTnVtX0FDTF9QYWNrZXRzLCAwKTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDI7CisgICAgICAgICAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+Y2NfZXZlbnQuUmVhZF9CdWZmZXJfU2l6ZS5IQ19Ub3RhbF9OdW1fU0NPX1BhY2tldHMsIDApOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSA0MTA2OgorICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+Y2NfZXZlbnQuUmVhZF9EYXRhX0Jsb2NrX1NpemUuc3RhdHVzOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMTsKKyAgICAgICAgICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5jY19ldmVudC5SZWFkX0RhdGFfQmxvY2tfU2l6ZS5IQ19NYXhfQUNMX0RhdGFfUGFja2V0X0xlbmd0aCwgMCk7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICAgICAgbkJ1ZiAtPSAyOworICAgICAgICAgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmNjX2V2ZW50LlJlYWRfRGF0YV9CbG9ja19TaXplLkhDX0RhdGFfQmxvY2tfTGVuZ3RoLCAwKTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDI7CisgICAgICAgICAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+Y2NfZXZlbnQuUmVhZF9EYXRhX0Jsb2NrX1NpemUuSENfVG90YWxfTnVtX0RhdGFfQmxvY2tzLCAwKTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDI7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgNTEyMToKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNjX2V2ZW50LlJlYWRfRmFpbGVkX0NvbnRhY3RfQ291bnRlci5zdGF0dXM7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICAgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmNjX2V2ZW50LlJlYWRfRmFpbGVkX0NvbnRhY3RfQ291bnRlci5sb2dfbGlua19oYW5kbGUsIDApOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5jY19ldmVudC5SZWFkX0ZhaWxlZF9Db250YWN0X0NvdW50ZXIuZmFpbGVkX2NvbnRhY3RfY291bnRlciwgMCk7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICAgICAgbkJ1ZiAtPSAyOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDUxMjI6CisgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5jY19ldmVudC5SZXNldF9GYWlsZWRfQ29udGFjdF9Db3VudGVyLnN0YXR1czsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+Y2NfZXZlbnQuUmVzZXRfRmFpbGVkX0NvbnRhY3RfQ291bnRlci5sb2dfbGlua19oYW5kbGUsIDApOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSA1MTIzOgorICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+Y2NfZXZlbnQuUmVhZF9MaW5rX1F1YWxpdHkuc3RhdHVzOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMTsKKyAgICAgICAgICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5jY19ldmVudC5SZWFkX0xpbmtfUXVhbGl0eS5sb2dfbGlua19oYW5kbGUsIDApOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNjX2V2ZW50LlJlYWRfTGlua19RdWFsaXR5LmxpbmtfcXVhbGl0eTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgNTEyNToKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNjX2V2ZW50LlJlYWRfUlNTSS5zdGF0dXM7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+Y2NfZXZlbnQuUmVhZF9SU1NJLnBoeV9saW5rX2hhbmRsZTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5jY19ldmVudC5SZWFkX1JTU0kucnNzaTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgNTEyOToKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNjX2V2ZW50LlJlYWRfTG9jYWxfQU1QX0luZm8uc3RhdHVzOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMTsKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNjX2V2ZW50LlJlYWRfTG9jYWxfQU1QX0luZm8uSENfQU1QX1N0YXR1czsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICAgICAgICAgZnJhbWVzaHRvbmwocEN0eCwgcEJ1ZiwgcFNyYy0+Y2NfZXZlbnQuUmVhZF9Mb2NhbF9BTVBfSW5mby5IQ19Ub3RhbF9CVywgMCk7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gNDsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDQ7CisgICAgICAgICAgICAgICAgbkJ1ZiAtPSA0OworICAgICAgICAgICAgICAgIGZyYW1lc2h0b25sKHBDdHgsIHBCdWYsIHBTcmMtPmNjX2V2ZW50LlJlYWRfTG9jYWxfQU1QX0luZm8uSENfTWF4X0d1YXJhbnRlZWRfQlcsIDApOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDQ7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSA0OworICAgICAgICAgICAgICAgIG5CdWYgLT0gNDsKKyAgICAgICAgICAgICAgICBmcmFtZXNodG9ubChwQ3R4LCBwQnVmLCBwU3JjLT5jY19ldmVudC5SZWFkX0xvY2FsX0FNUF9JbmZvLkhDX01pbl9MYXRlbmN5LCAwKTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSA0OworICAgICAgICAgICAgICAgIHBCdWYgKz0gNDsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDQ7CisgICAgICAgICAgICAgICAgZnJhbWVzaHRvbmwocEN0eCwgcEJ1ZiwgcFNyYy0+Y2NfZXZlbnQuUmVhZF9Mb2NhbF9BTVBfSW5mby5IQ19NYXhfUERVX1NpemUsIDApOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDQ7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSA0OworICAgICAgICAgICAgICAgIG5CdWYgLT0gNDsKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNjX2V2ZW50LlJlYWRfTG9jYWxfQU1QX0luZm8uSENfQ29udHJvbGxlcl9UeXBlOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMTsKKyAgICAgICAgICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5jY19ldmVudC5SZWFkX0xvY2FsX0FNUF9JbmZvLkhDX1BBTF9DYXBhYmlsaXRpZXMsIDApOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5jY19ldmVudC5SZWFkX0xvY2FsX0FNUF9JbmZvLkhDX0FNUF9Bc3NvY19MZW5ndGgsIDApOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgICAgICAgICBmcmFtZXNodG9ubChwQ3R4LCBwQnVmLCBwU3JjLT5jY19ldmVudC5SZWFkX0xvY2FsX0FNUF9JbmZvLkhDX01heF9GbHVzaF9UaW1lb3V0LCAwKTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSA0OworICAgICAgICAgICAgICAgIHBCdWYgKz0gNDsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDQ7CisgICAgICAgICAgICAgICAgZnJhbWVzaHRvbmwocEN0eCwgcEJ1ZiwgcFNyYy0+Y2NfZXZlbnQuUmVhZF9Mb2NhbF9BTVBfSW5mby5IQ19CRV9GbHVzaF9UaW1lb3V0LCAwKTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSA0OworICAgICAgICAgICAgICAgIHBCdWYgKz0gNDsKKyAgICAgICAgICAgICAgICBuQnVmIC09IDQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgNTEzMDoKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNjX2V2ZW50LlJlYWRfUmVhZF9Mb2NhbF9BTVBfQXNzb2Muc3RhdHVzOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMTsKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNjX2V2ZW50LlJlYWRfUmVhZF9Mb2NhbF9BTVBfQXNzb2MucGh5X2xpbmtfaGFuZGxlOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMTsKKyAgICAgICAgICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5jY19ldmVudC5SZWFkX1JlYWRfTG9jYWxfQU1QX0Fzc29jLnJlbWFpbmluZ19sZW5ndGgsIDApOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgICAgICAgICBCVEFNUF9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+Y2NfZXZlbnQuUmVhZF9SZWFkX0xvY2FsX0FNUF9Bc3NvYy5BTVBfYXNzb2NfZnJhZ21lbnQgKSwgcFNyYy0+Y2NfZXZlbnQuUmVhZF9SZWFkX0xvY2FsX0FNUF9Bc3NvYy5yZW1haW5pbmdfbGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSBwU3JjLT5jY19ldmVudC5SZWFkX1JlYWRfTG9jYWxfQU1QX0Fzc29jLnJlbWFpbmluZ19sZW5ndGg7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAoIHBTcmMtPmNjX2V2ZW50LlJlYWRfUmVhZF9Mb2NhbF9BTVBfQXNzb2MucmVtYWluaW5nX2xlbmd0aCApOworICAgICAgICAgICAgICAgIG5CdWYgLT0gKCBwU3JjLT5jY19ldmVudC5SZWFkX1JlYWRfTG9jYWxfQU1QX0Fzc29jLnJlbWFpbmluZ19sZW5ndGggKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSA1MTMxOgorICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+Y2NfZXZlbnQuV3JpdGVfUmVtb3RlX0FNUF9Bc3NvYy5zdGF0dXM7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+Y2NfZXZlbnQuV3JpdGVfUmVtb3RlX0FNUF9Bc3NvYy5waHlfbGlua19oYW5kbGU7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDYxNDU6CisgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5jY19ldmVudC5SZWFkX0xvb3BiYWNrX01vZGUuc3RhdHVzOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMTsKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNjX2V2ZW50LlJlYWRfTG9vcGJhY2tfTW9kZS5sb29wYmFja19tb2RlOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgIG5CdWYgLT0gMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSA2MTQ2OgorICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+Y2NfZXZlbnQuV3JpdGVfTG9vcGJhY2tfTW9kZS5zdGF0dXM7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgaWYgKHBUbHZMZW4gJiYgc0xlbiA9PSAyKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBUbHZMZW4sICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIHNUeXBlIC0gc0xlbiwgMCk7CisgICAgfSBlbHNlIGlmKE5VTEwgIT0gcFRsdkxlbikKKyAgICB7CisgICAgICAgICpwVGx2TGVuID0gKHZfVThfdCkoKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gc1R5cGUgLSBzTGVuKTsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGJ0YW1wUGFja1RsdkhDSV9Db21tYW5kX0NvbXBsZXRlX0V2ZW50LiAqLworCit0eXBlZGVmIHZfVTMyX3QgKCpwZm5QYWNrVGx2SENJX0NvbW1hbmRfQ29tcGxldGVfRXZlbnRfdCkodm9pZCAqLCB0QnRhbXBUTFZIQ0lfQ29tbWFuZF9Db21wbGV0ZV9FdmVudCAqLCB2X1U4X3QqLCB2X1UzMl90LCB2X1UzMl90Kik7CisjZGVmaW5lIFNpZ1BhY2tUbHZIQ0lfQ29tbWFuZF9Db21wbGV0ZV9FdmVudCAoIDB4MDA4NCApCisKK3ZfVTMyX3QgYnRhbXBQYWNrVGx2SENJX0NvbW1hbmRfU3RhdHVzX0V2ZW50KHZvaWQgKiBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEJ0YW1wVExWSENJX0NvbW1hbmRfU3RhdHVzX0V2ZW50ICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcG5Db25zdW1lZCkKK3sKKyAgICB2X1U4X3QqIHBUbHZMZW4gPSAwOworICAgIHZfVTMyX3QgbkNvbnN1bWVkT25FbnRyeTsKKyAgICB2X1UzMl90IHN0YXR1cyA9IEJUQU1QX1BBUlNFX1NVQ0NFU1M7CisgICAgdl9VMzJfdCBuTmVlZGVkID0gMFU7CisgICAgdl9VMzJfdCBzVHlwZSA9IDBVOworICAgIHZfVTMyX3Qgc0xlbiA9IDBVOworICAgIHNUeXBlID0gMTsKKyAgICBzTGVuID0gMTsKKyAgICAgICAgLy8gc2FuaXR5IGNoZWNraW5nCisgICAgaWYoIHBDdHggPT0gTlVMTCB8fCBwU3JjID09IE5VTEwgfHwKKyAgICAgICAgcEJ1ZiA9PSBOVUxMIHx8IHBuQ29uc3VtZWQgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIFZPU19UUk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Glua19DbWQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90ICpwbkNvbnN1bWVkKQoreworICAgIHZfVThfdCogcFRsdkxlbiA9IDA7CisgICAgdl9VMzJfdCBuQ29uc3VtZWRPbkVudHJ5OworICAgIHZfVTMyX3Qgc3RhdHVzID0gQlRBTVBfUEFSU0VfU1VDQ0VTUzsKKyAgICB2X1UzMl90IG5OZWVkZWQgPSAwVTsKKyAgICB2X1UzMl90IHNUeXBlID0gMFU7CisgICAgdl9VMzJfdCBzTGVuID0gMFU7CisgICAgc1R5cGUgPSAyOworICAgIHNMZW4gPSAxOworICAgICAgICAvLyBzYW5pdHkgY2hlY2tpbmcKKyAgICBpZiggcEN0eCA9PSBOVUxMIHx8IHBTcmMgPT0gTlVMTCB8fAorICAgICAgICBwQnVmID09IE5VTEwgfHwgcG5Db25zdW1lZCA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiYmFkIGlucHV0IiApOworICAgICAgICByZXR1cm4gQlRBTVBfQkFEX0lOUFVUX0JVRkZFUjsKKyAgICB9CisKKyAgICBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgc3RhdHVzID0gYnRhbXBHZXRQYWNrZWRUbHZIQ0lfQ3JlYXRlX0xvZ2ljYWxfTGlua19DbWQocEN0eCwgcFNyYywgJm5OZWVkZWQpOworICAgIGlmICggISBCVEFNUF9TVUNDRUVERUQoIHN0YXR1cyApICkgcmV0dXJuIHN0YXR1czsKKyAgICBuTmVlZGVkICs9IHN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dWY7CisgICAgICAgIHBCdWYgKz0gc0xlbjsgbkJ1ZiAtPSBzTGVuOyAqcG5Db25zdW1lZCArPSBzTGVuOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnBoeV9saW5rX2hhbmRsZTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICpwQnVmID0gcFNyYy0+a2V5X2xlbmd0aDsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICpwQnVmID0gcFNyYy0+a2V5X3R5cGU7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICBCVEFNUF9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+a2V5X21hdGVyaWFsICksIHBTcmMtPmtleV9sZW5ndGgpOworICAgICAgICAqcG5Db25zdW1lZCArPSBwU3JjLT5rZXlfbGVuZ3RoOworICAgICAgICBwQnVmICs9ICggcFNyYy0+a2V5X2xlbmd0aCApOworICAgICAgICBuQnVmIC09ICggcFNyYy0+a2V5X2xlbmd0aCApOworICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICBpZiAocFRsdkxlbiAmJiBzTGVuID09IDIpCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcFRsdkxlbiwgKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gc1R5cGUgLSBzTGVuLCAwKTsKKyAgICB9IGVsc2UgaWYoTlVMTCAhPSBwVGx2TGVuKQorICAgIHsKKyAgICAgICAgKnBUbHZMZW4gPSAodl9VOF90KSgqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSBzVHlwZSAtIHNMZW4pOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgYnRhbXBQYWNrVGx2SENJX0NyZWF0ZV9QaHlzaWNhbF9MaW5rX0NtZC4gKi8KKwordHlwZWRlZiB2X1UzMl90ICgqcGZuUGFja1RsdkhDSV9DcmVhdGVfUGh5c2ljYWxfTGlua19DbWRfdCkodm9pZCAqLCB0QnRhbXBUTFZIQ0lfQ3JlYXRlX1BoeXNpY2FsX0xpbmtfQ21kICosIHZfVThfdCosIHZfVTMyX3QsIHZfVTMyX3QqKTsKKyNkZWZpbmUgU2lnUGFja1RsdkhDSV9DcmVhdGVfUGh5c2ljYWxfTGlua19DbWQgKCAweDAwODcgKQorCit2X1UzMl90IGJ0YW1wUGFja1RsdkhDSV9EYXRhX0J1ZmZlcl9PdmVyZmxvd19FdmVudCh2b2lkICogcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRCdGFtcFRMVkhDSV9EYXRhX0J1ZmZlcl9PdmVyZmxvd19FdmVudCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgKnBuQ29uc3VtZWQpCit7CisgICAgdl9VOF90KiBwVGx2TGVuID0gMDsKKyAgICB2X1UzMl90IG5Db25zdW1lZE9uRW50cnk7CisgICAgdl9VMzJfdCBzdGF0dXMgPSBCVEFNUF9QQVJTRV9TVUNDRVNTOworICAgIHZfVTMyX3Qgbk5lZWRlZCA9IDBVOworICAgIHZfVTMyX3Qgc1R5cGUgPSAwVTsKKyAgICB2X1UzMl90IHNMZW4gPSAwVTsKKyAgICBzVHlwZSA9IDE7CisgICAgc0xlbiA9IDE7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ICAgdl9VOF90ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90ICpwbkNvbnN1bWVkKQoreworICAgIHZfVThfdCogcFRsdkxlbiA9IDA7CisgICAgdl9VMzJfdCBuQ29uc3VtZWRPbkVudHJ5OworICAgIHZfVTMyX3Qgc3RhdHVzID0gQlRBTVBfUEFSU0VfU1VDQ0VTUzsKKyAgICB2X1UzMl90IG5OZWVkZWQgPSAwVTsKKyAgICB2X1UzMl90IHNUeXBlID0gMFU7CisgICAgdl9VMzJfdCBzTGVuID0gMFU7CisgICAgc1R5cGUgPSAyOworICAgIHNMZW4gPSAxOworICAgICAgICAvLyBzYW5pdHkgY2hlY2tpbmcKKyAgICBpZiggcEN0eCA9PSBOVUxMIHx8IHBTcmMgPT0gTlVMTCB8fAorICAgICAgICBwQnVmID09IE5VTEwgfHwgcG5Db25zdW1lZCA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiYmFkIGlucHV0IiApOworICAgICAgICByZXR1cm4gQlRBTVBfQkFEX0lOUFVUX0JVRkZFUjsKKyAgICB9CisgICAgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworCisgICAgc3RhdHVzID0gYnRhbXBHZXRQYWNrZWRUbHZIQ0lfRGlzY29ubmVjdF9Mb2dpY2FsX0xpbmtfQ21kKHBDdHgsIHBTcmMsICZuTmVlZGVkKTsKKyAgICBpZiAoICEgQlRBTVBfU1VDQ0VFREVEKCBzdGF0dXMgKSApIHJldHVybiBzdGF0dXM7CisgICAgbk5lZWRlZCArPSBzVHlwZSArIHNMZW47CisgICAgaWYgKCBuTmVlZGVkID4gbkJ1Z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Glua19DbWRfdCkodm9pZCAqLCB0QnRhbXBUTFZIQ0lfRGlzY29ubmVjdF9Mb2dpY2FsX0xpbmtfQ21kICosIHZfVThfdCosIHZfVTMyX3QsIHZfVTMyX3QqKTsKKyNkZWZpbmUgU2lnUGFja1RsdkhDSV9EaXNjb25uZWN0X0xvZ2ljYWxfTGlua19DbWQgKCAweDAwODkgKQorCit2X1UzMl90IGJ0YW1wUGFja1RsdkhDSV9EaXNjb25uZWN0X0xvZ2ljYWxfTGlua19Db21wbGV0ZV9FdmVudCh2b2lkICogcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRCdGFtcFRMVkhDSV9EaXNjb25uZWN0X0xvZ2ljYWxfTGlua19Db21wbGV0ZV9FdmVudCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgKnBuQ29uc3VtZWQpCit7CisgICAgdl9VOF90KiBwVGx2TGVuID0gMDsKKyAgICB2X1UzMl90IG5Db25zdW1lZE9uRW50cnk7CisgICAgdl9VMzJfdCBzdGF0dXMgPSBCVEFNUF9QQVJTRV9TVUNDRVNTOworICAgIHZfVTMyX3Qgbk5lZWRlZCA9IDBVOworICAgIHZfVTMyX3Qgc1R5cGUgPSAwVTsKKyAgICB2X1UzMl90IHNMZW4gPSAwVTsKKyAgICBzVHlwZSA9IDE7CisgICAgc0xlbiA9IDE7CisgICAgICAgIC8vIHNhbml0eSBjaGVja2luZworICAgIGlmKCBwQ3R4ID09IE5VTEwgfHwgcFNyYy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0V2ZW50ICggMHgwMDhhICkKKwordl9VMzJfdCBidGFtcFBhY2tUbHZIQ0lfRGlzY29ubmVjdF9QaHlzaWNhbF9MaW5rX0NtZCh2b2lkICogcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEJ0YW1wVExWSENJX0Rpc2Nvbm5lY3RfUGh5c2ljYWxfTGlua19DbWQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90ICpwbkNvbnN1bWVkKQoreworICAgIHZfVThfdCogcFRsdkxlbiA9IDA7CisgICAgdl9VMzJfdCBuQ29uc3VtZWRPbkVudHJ5OworICAgIHZfVTMyX3Qgc3RhdHVzID0gQlRBTVBfUEFSU0VfU1VDQ0VTUzsKKyAgICB2X1UzMl90IG5OZWVkZWQgPSAwVTsKKyAgICB2X1UzMl90IHNUeXBlID0gMFU7CisgICAgdl9VMzJfdCBzTGVuID0gMFU7CisgICAgc1R5cGUgPSAyOworICAgIHNMZW4gPSAxOworICAgICAgICAvLyBzYW5pdHkgY2hlY2tpbmcKKyAgICBpZiggcEN0eCA9PSBOVUxMIHx8IHBTcmMgPT0gTlVMTCB8fAorICAgICAgICBwQnVmID09IE5VTEwgfHwgcG5Db25zdW1lZCA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiYmFkIGlucHV0IiApOworICAgICAgICByZXR1cm4gQlRBTVBfQkFEX0lOUFVUX0JVRkZFUjsKKyAgICB9CisgICAgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworCisgICAgc3RhdHVzID0gYnRhbXBHZXRQYWNrZWRUbHZIQ0lfRGlzY29ubmVjdF9QaHlzaWNhbF9MaW5rX0NtZChwQ3R4LCBwU3JjLCAmbk5lZWRlZCk7CisgICAgaWYgKCAhIEJUQU1QX1NVQ0NFRURFRCggc3RhdHVzICkgKSByZXR1cm4gc3RhdHVzOworICAgIG5OZWVkZWQgKz0gc1R5cGUgKyBzTGVuOworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gQlRBTVBfQlVGRkVSX09WRVJGTE9XOworICAgIHBUbHZMZW4gPSBwQnVmOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiggc1R5cGUgPT0gMikgZnJhbWVzaHRvbnMoIHBDdHgsIHBCdWYsIDEwNzksIDApOworICAgICAgICBwQnVmICs9IHNUeXBlOyBuQnVmIC09IHNUeXBlOyAqcG5Db25zdW1lZCArPSBzVHlwZTsKKyAgICAgICAgcFRsdkxlbiA9IHBCdWY7CisgICAgICAgIHBCdWYgKz0gc0xlbjsgbkJ1ZiAtPSBzTGVuOyAqcG5Db25zdW1lZCArPSBzTGVuOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnBoeV9saW5rX2hhbmRsZTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICpwQnVmID0gcFNyYy0+cmVhc29uOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIG5CdWYgLT0gMTsKKyAgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgaWYgKHBUbHZMZW4gJiYgc0xlbiA9PSAyKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBUbHZMZW4sICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIHNUeXBlIC0gc0xlbiwgMCk7CisgICAgfSBlbHNlIGlmKE5VTEwgIT0gcFRsdkxlbikKKyAgICB7CisgICAgICAgICpwVGx2TGVuID0gKHZfVThfdCkoKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gc1R5cGUgLSBzTGVuKTsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGJ0YW1wUGFja1RsdkhDSV9EaXNjb25uZWN0X1BoeXNpY2FsX0xpbmtfQ21kLiAqLworCit0eXBlZGVmIHZfVTMyX3QgKCpwZm5QYWNrVGx2SENJX0Rpc2Nvbm5lY3RfUGh5c2ljYWxfTGlua19DbWRfdCkodm9pZCAqLCB0QnRhbXBUTFZIQ0lfRGlzY29ubmVjdF9QaHlzaWNhbF9MaW5rX0NtZCAqLCB2X1U4X3QqLCB2X1UzMl90LCB2X1UzMl90Kik7CisjZGVmaW5lIFNpZ1BhY2tUbHZIQ0lfRGlzY29ubmVjdF9QaHlzaWNhbF9MaW5rX0NtZCAoIDB4MDA4YiApCisKK3ZfVTMyX3QgYnRhbXBQYWNrVGx2SENJX0Rpc2Nvbm5lY3RfUGh5c2ljYWxfTGlua19Db21wbGV0ZV9FdmVudCh2b2lkICogcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QnRhbXBUTFZIQ0lfRGlzY29ubmVjdF9QaHlzaWNhbF9MaW5rX0NvbXBsZXRlX0V2ZW50ICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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worICAgICAgICBpZiggc1R5cGUgPT0gMikgZnJhbWVzaHRvbnMoIHBDdHgsIHBCdWYsIDY2LCAwKTsKKyAgICAgICAgZWxzZSAqcEJ1ZiA9IDY2OworICAgICAgICBwQnVmICs9IHNUeXBlOyBuQnVmIC09IHNUeXBlOyAqcG5Db25zdW1lZCArPSBzVHlwZTsKKyAgICAgICAgcFRsdkxlbiA9IHBCdWY7CisgICAgICAgIHBCdWYgKz0gc0xlbjsgbkJ1ZiAtPSBzTGVuOyAqcG5Db25zdW1lZCArPSBzTGVuOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnN0YXR1czsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBuQnVmIC09IDE7CisgICAgICAgICpwQnVmID0gcFNyYy0+cGh5X2xpbmtfaGFuZGxlOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIG5CdWYgLT0gMTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5yZWFzb247CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICBpZiAocFRsdkxlbiAmJiBzTGVuID09IDIpCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcFRsdkxlbiwgKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gc1R5cGUgLSBzTGVuLCAwKTsKKyAgICB9IGVsc2UgaWYoTlVMTCAhPSBwVGx2TGVuKQorICAgIHsKKyAgICAgICAgKnBUbHZMZW4gPSAodl9VOF90KSgqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSBzVHlwZSAtIHNMZW4pOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgYnRhbXBQYWNrVGx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lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5iZV9hZ2dyX2NvdW50ZXI7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICBCVEFNUF9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+dHhfZmxvd19zcGVjLCAxOCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE4OworICAgICAgICBwQnVmICs9IDE4OworICAgICAgICBuQnVmIC09IDE4OworICAgICAgICBCVEFNUF9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+cnhfZmxvd19zcGVjLCAxOCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE4OworICAgICAgICBwQnVmICs9IDE4OworICAgICAgICBuQnVmIC09IDE4OworICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICBpZiAocFRsdkxlbiAmJiBzTGVuID09IDIpCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcFRsdkxlbiwgKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gc1R5cGUgLSBzTGVuLCAwKTsKKyAgICB9IGVsc2UgaWYoTlVMTCAhPSBwVGx2TGVuKQorICAgIHsKKyAgICAgICAgKnBUbHZMZW4gPSAodl9VOF90KSgqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSBzVHlwZSAtIHNMZW4pOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgYnRhbXBQYWNrVGx2SENJX0Zsb3dfU3BlY19Nb2RpZnlfQ21kLiAqLworCit0eXBlZGVmIHZfVTMyX3QgKCpwZm5QYWNrVGx2SENJX0Zsb3dfU3BlY19Nb2RpZnlfQ21kX3QpKHZvaWQgKiwgdEJ0YW1wVExWSENJX0Zsb3dfU3BlY19Nb2RpZnlfQ21kICosIHZfVThfdCosIHZfVTMyX3QsIHZfVTMyX3QqKTsKKyNkZWZpbmUgU2lnUGFja1RsdkhDSV9GbG93X1NwZWNfTW9kaWZ5X0NtZCAoIDB4MDA4ZCApCisKK3ZfVTMyX3QgYnRhbXBQYWNrVGx2SENJX0Zsb3dfU3BlY19Nb2RpZnlfQ29tcGxldGVfRXZlbnQodm9pZCAqIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRCdGFtcFRMVkhDSV9GbG93X1NwZWNfTW9kaWZ5X0NvbXBsZXRlX0V2ZW50ICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcG5Db25zdW1lZCkKK3sKKyAgICB2X1U4X3QqIHBUbHZMZW4gPSAwOworICAgIHZfVTMyX3QgbkNvbnN1bWVkT25FbnRyeTsKKyAgICB2X1UzMl90IHN0YXR1cyA9IEJUQU1QX1BBUlNFX1NVQ0NFU1M7CisgICAgdl9VMzJfdCBuTmVlZGVkID0gMFU7CisgICAgdl9VMzJfdCBzVHlwZSA9IDBVOworICAgIHZfVTMyX3Qgc0xlbiA9IDBVOworICAgIHNUeXBlID0gMTsKKyAgICBzTGVuID0gMTsKKyAgICAgICAgLy8gc2FuaXR5IGNoZWNraW5nCisgICAgaWYoIHBDdHggPT0gTlVMTCB8fCBwU3JjID09IE5VTEwgfHwKKyAgICAgICAgcEJ1ZiA9PSBOVUxMIHx8IHBuQ29uc3VtZWQgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9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cFBhY2tUbHZIQ0lfRmx1c2hfT2NjdXJyZWRfRXZlbnQodm9pZCAqIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QnRhbXBUTFZIQ0lfRmx1c2hfT2NjdXJyZWRfRXZlbnQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90ICpwbkNvbnN1bWVkKQoreworICAgIHZfVThfdCogcFRsdkxlbiA9IDA7CisgICAgdl9VMzJfdCBuQ29uc3VtZWRPbkVudHJ5OworICAgIHZfVTMyX3Qgc3RhdHVzID0gQlRBTVBfUEFSU0VfU1VDQ0VTUzsKKyAgICB2X1UzMl90IG5OZWVkZWQgPSAwVTsKKyAgICB2X1UzMl90IHNUeXBlID0gMFU7CisgICAgdl9VMzJfdCBzTGVuID0gMFU7CisgICAgc1R5cGUgPSAxOworICAgIHNMZW4gPSAxOworICAgICAgICAvLyBzYW5pdHkgY2hlY2tpbmcKKyAgICBpZiggcEN0eCA9PSBOVUxMIHx8IHBTcmMgPT0gTlVMTCB8fAorICAgICAgICBwQnVmID09IE5VTEwgfHwgcG5Db25zdW1lZCA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiYmFkIGlucHV0IiApOworICAgICAgICByZXR1cm4gQlRBTVBfQkFEX0lOUFVUX0JVRkZFUjsKKyAgICB9CisgICAgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworCisgICAgc3RhdHVzID0gYnRhbXBHZXRQYWNrZWRUbHZIQ0lfRmx1c2hfT2NjdX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OworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIG5CdWYgLT0gMTsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+Y29ubl9oYW5kbGVzWzBdLCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICBuQnVmIC09IDI7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPm51bV9jb21wbGV0ZWRfcGt0c1swXSwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgbkJ1ZiAtPSAyOworI2lmIDAKKyAgICAgICAgLy8gTmV3CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIDAsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgMCwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgbkJ1ZiAtPSAyOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCAwLCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICBuQnVmIC09IDI7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIDAsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgMCwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgbkJ1ZiAtPSAyOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCAwLCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICBuQnVmIC09IDI7CisvLyBFbmQgb2YgbmV3CisjZW5kaWYKKy8vICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICBpZiAocFRsdkxlbiAmJiBzTGVuID09IDIpCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcFRsdkxlbiwgKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gc1R5cGUgLSBzTGVuLCAwKTsKKyAgICB9IGVsc2UgaWYoTlVMTCAhPSBwVGx2TGVuKQorICAgIHsKKyAgICAgICAgKnBUbHZMZW4gPSAodl9VOF90KSgqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSBzVHlwZSAtIHNMZW4pOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgYnRhbXBQYWNrVGx2SENJX051bV9Db21wbGV0ZWRfUGt0c19FdmVudC4gKi8KKwordl9VMzJfdCBidGFtcFBhY2tUbHZIQ0lfTnVtX0NvbXBsZXRlZF9EYXRhX0Jsb2Nrc19FdmVudCh2b2lkICogcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRCdGFtcFRMVkhDSV9OdW1fQ29tcGxldGVkX0RhdGFfQmxvY2tzX0V2ZW50ICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcG5Db25zdW1lZCkKK3sKKyAgICB2X1U4X3QqIHB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OworICAgICAgICBwQnVmICs9IHNUeXBlOyBuQnVmIC09IHNUeXBlOyAqcG5Db25zdW1lZCArPSBzVHlwZTsKKyAgICAgICAgcFRsdkxlbiA9IHBCdWY7CisgICAgICAgIHBCdWYgKz0gc0xlbjsgbkJ1ZiAtPSBzTGVuOyAqcG5Db25zdW1lZCArPSBzTGVuOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT50b3RhbF9udW1fZGF0YV9ibG9ja3MsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5udW1faGFuZGxlczsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBuQnVmIC09IDE7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmNvbm5faGFuZGxlc1swXSwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgbkJ1ZiAtPSAyOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5udW1fY29tcGxldGVkX3BrdHNbMF0sIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+bnVtX2NvbXBsZXRlZF9ibG9ja3NbMF0sIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIG5CdWYgLT0gMjsKKyNpZiAwCisgICAgICAgIC8vIE5ldworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCAwLCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICBuQnVmIC09IDI7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIDAsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgMCwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgbkJ1ZiAtPSAyOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCAwLCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICBuQnVmIC09IDI7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIDAsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgMCwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgbkJ1ZiAtPSAyOworLy8gRW5kIG9mIG5ldworI2VuZGlmCisvLyAgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgaWYgKHBUbHZMZW4gJiYgc0xlbiA9PSAyKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBUbHZMZW4sICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIHNUeXBlIC0gc0xlbiwgMCk7CisgICAgfSBlbHNlIGlmKE5VTEwgIT0gcFRsdkxlbikKKyAgICB7CisgICAgICAgICpwVGx2TGVuID0gKHZfVThfdCkoKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gc1R5cGUgLSBzTGVuKTsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGJ0YW1wUGFja1RsdkhDSV9OdW1fQ29tcGxldGVkX0RhdGFfQmxvY2tzX0V2ZW50LiAqLworCisvL3R5cGVkZWYgdl9VMzJfdCAoKnBmblBhY2tUbHZIQ0lfTnVtX0NvbXBsZXRlZF9Qa3RzX0V2ZW50X3QpKHZvaWQgKiwgdEJ0YW1wVExWSENJX051bV9Db21wbGV0ZWRfUGt0c19FdmVudCAqLCB2X1U4X3QqLCB2X1UzMl90LCB2X1UzMl90Kik7CisvLyNkZWZpbmUgU2lnUGFja1RsdkhDSV9OdW1fQ29tcGxldGVkX1BrdHNfRXZlbnQgKCAweDAwODUgKQorCit2X1UzMl90IGJ0YW1wUGFja1RsdkhDSV9HZW5lcmljX0FNUF9MaW5rX0tleV9Ob3RpZmljYXRpb25fRXZlbnQodm9pZCAqIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEJ0YW1wVExWSENJX0dlbmVyaWNfQU1QX0xpbmtfS2V5X05vdGlmaWNhdGlvbl9FdmVudCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgKnBuQ29uc3VtZWQpCit7CisgICAgdl9VOF90KiBwVGx2TGVuID0gMDsKKyAgICB2X1UzMl90IG5Db25zdW1lZE9uRW50cnk7CisgICAgdl9VMzJfdCBzdGF0dXMgPSBCVEFNUF9QQVJTRV9TVU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VtZWQgKz0gc1R5cGU7CisgICAgICAgIHBUbHZMZW4gPSBwQnVmOworICAgICAgICBwQnVmICs9IHNMZW47IG5CdWYgLT0gc0xlbjsgKnBuQ29uc3VtZWQgKz0gc0xlbjsKKyAgICAgICAgQlRBTVBfTUVNQ1BZKHBDdHgsIHBCdWYsIHBTcmMtPmJkX2FkZHIsIDYpOworICAgICAgICAqcG5Db25zdW1lZCArPSA2OworICAgICAgICBwQnVmICs9IDY7CisgICAgICAgIG5CdWYgLT0gNjsKKyAgICAgICAgQlRBTVBfTUVNQ1BZKHBDdHgsIHBCdWYsIHBTcmMtPmdlbmVyaWNfYW1wX2xpbmtfa2V5LCAzMik7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDMyOworICAgICAgICBwQnVmICs9IDMyOworICAgICAgICBuQnVmIC09IDMyOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPmtleV90eXBlOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIG5CdWYgLT0gMTsKKyAgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgaWYgKHBUbHZMZW4gJiYgc0xlbiA9PSAyKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBUbHZMZW4sICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIHNUeXBlIC0gc0xlbiwgMCk7CisgICAgfSBlbHNlIGlmKE5VTEwgIT0gcFRsdkxlbikKKyAgICB7CisgICAgICAgICpwVGx2TGVuID0gKHZfVThfdCkoKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gc1R5cGUgLSBzTGVuKTsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGJ0YW1wUGFja1RsdkhDSV9HZW5lcmljX0FNUF9MaW5rX0tleV9Ob3RpZmljYXRpb25fRXZlbnQuICovCisKK3R5cGVkZWYgdl9VMzJfdCAoKnBmblBhY2tUbHZIQ0lfR2VuZXJpY19BTVBfTGlua19LZXlfTm90aWZpY2F0aW9uX0V2ZW50X3QpKHZvaWQgKiwgdEJ0YW1wVExWSENJX0dlbmVyaWNfQU1QX0xpbmtfS2V5X05vdGlmaWNhdGlvbl9FdmVudCAqLCB2X1U4X3QqLCB2X1UzMl90LCB2X1UzMl90Kik7CisjZGVmaW5lIFNpZ1BhY2tUbHZIQ0lfR2VuZXJpY19BTVBfTGlua19LZXlfTm90aWZpY2F0aW9uX0V2ZW50ICggMHgwMDkxICkKKwordl9VMzJfdCBidGFtcFBhY2tUbHZIQ0lfSGFyZHdhcmVfRXJyb3JfRXZlbnQodm9pZCAqIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QnRhbXBUTFZIQ0lfSGFyZHdhcmVfRXJyb3JfRXZlbnQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90ICpwbkNvbnN1bWVkKQoreworICAgIHZfVThfdCogcFRsdkxlbiA9IDA7CisgICAgdl9VMzJfdCBuQ29uc3VtZWRPbkVudHJ5OworICAgIHZfVTMyX3Qgc3RhdHVzID0gQlRBTVBfUEFSU0VfU1VDQ0VTUzsKKyAgICB2X1UzMl90IG5OZWVkZWQgPSAwVTsKKyAgICB2X1UzMl90IHNUeXBlID0gMFU7CisgICAgdl9VMzJfdCBzTGVuID0gMFU7CisgICAgc1R5cGUgPSAxOworICAgIHNMZW4gPSAxOworICAgICAgICAvLyBzYW5pdHkgY2hlY2tpbmcKKyAgICBpZiggcEN0eCA9PSBOVUxMIHx8IHBTcmMgPT0gTlVMTCB8fAorICAgICAgICBwQnVmID09IE5VTEwgfH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X0NtZCAqLCB2X1U4X3QqLCB2X1UzMl90LCB2X1UzMl90Kik7CisjZGVmaW5lIFNpZ1BhY2tUbHZIQ0lfTG9naWNhbF9MaW5rX0NhbmNlbF9DbWQgKCAweDAwOTMgKQorCit2X1UzMl90IGJ0YW1wUGFja1RsdkhDSV9Mb2dpY2FsX0xpbmtfQ29tcGxldGVfRXZlbnQodm9pZCAqIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEJ0YW1wVExWSENJX0xvZ2ljYWxfTGlua19Db21wbGV0ZV9FdmVudCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgKnBuQ29uc3VtZWQpCit7CisgICAgdl9VOF90KiBwVGx2TGVuID0gMDsKKyAgICB2X1UzMl90IG5Db25zdW1lZE9uRW50cnk7CisgICAgdl9VMzJfdCBzdGF0dXMgPSBCVEFNUF9QQVJTRV9TVUNDRVNTOworICAgIHZfVTMyX3Qgbk5lZWRlZCA9IDBVOworICAgIHZfVTMyX3Qgc1R5cGUgPSAwVTsKKyAgICB2X1UzMl90IHNMZW4gPSAwVTsKKyAgICBzVHlwZSA9IDE7CisgICAgc0xlbiA9IDE7CisgICAgICAgIC8vIHNhbml0eSBjaGVja2luZworICAgIGlmKCBwQ3R4ID09IE5VTEwgfHwgcFNyYyA9PSBOVUxMIHx8CisgICAgICAgIHBCdWYgPT0gTlVMTCB8fCBwbkNvbnN1bWVkID09IE5VTEwpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJ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odm9pZCAqIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRCdGFtcFRMVkhDSV9Mb29wYmFja19Db21tYW5kX0V2ZW50ICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcG5Db25zdW1lZCkKK3sKKyAgICB2X1U4X3QqIHBUbHZMZW4gPSAwOworICAgIHZfVTMyX3QgbkNvbnN1bWVkT25FbnRyeTsKKyAgICB2X1UzMl90IHN0YXR1cyA9IEJUQU1QX1BBUlNFX1NVQ0NFU1M7CisgICAgdl9VMzJfdCBuTmVlZGVkID0gMFU7CisgICAgdl9VMzJfdCBzVHlwZSA9IDBVOworICAgIHZfVTMyX3Qgc0xlbiA9IDBVOworICAgIHNUeXBlID0gMTsKKyAgICBzTGVuID0gMTsKKyAgICAgICAgLy8gc2FuaXR5IGNoZWNraW5nCisgICAgaWYoIHBDdHggPT0gTlVMTCB8fCBwU3JjID09IE5VTEwgfHwKKyAgICAgICAgcEJ1ZiA9PSBOVUxMIHx8IHBuQ29uc3VtZWQgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgImJhZCBpbnB1dCIgKTsKKyAgICAgICAgcmV0dXJuIEJUQU1QX0JBRF9JTlBVVF9CVUZGRVI7CisgICAgfQorICAgIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKworICAgIHN0YXR1cyA9IGJ0YW1wR2V0UGFja2VkVGx2SENJX0xvb3BiYWNrX0NvbW1hbmRfRXZlbnQocEN0eCwg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RPbkVudHJ5IC0gc1R5cGUgLSBzTGVuKTsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGJ0YW1wUGFja1RsdkhDSV9Mb29wYmFja19Db21tYW5kX0V2ZW50LiAqLworCit0eXBlZGVmIHZfVTMyX3QgKCpwZm5QYWNrVGx2SENJX0xvb3BiYWNrX0NvbW1hbmRfRXZlbnRfdCkodm9pZCAqLCB0QnRhbXBUTFZIQ0lfTG9vcGJhY2tfQ29tbWFuZF9FdmVudCAqLCB2X1U4X3QqLCB2X1UzMl90LCB2X1UzMl90Kik7CisjZGVmaW5lIFNpZ1BhY2tUbHZIQ0lfTG9vcGJhY2tfQ29tbWFuZF9FdmVudCAoIDB4MDA5NSApCisKK3ZfVTMyX3QgYnRhbXBQYWNrVGx2SENJX1BoeXNpY2FsX0xpbmtfQ29tcGxldGVfRXZlbnQodm9pZCAqIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRCdGFtcFRMVkhDSV9QaHlzaWNhbF9MaW5rX0NvbXBsZXRlX0V2ZW50ICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcG5Db25zdW1lZCkKK3sKKyAgICB2X1U4X3QqIHBUbHZMZW4gPSAwOworICAgIHZfVTMyX3QgbkNvbnN1bWVkT25FbnRyeTsKKyAgICB2X1UzMl90IHN0YXR1cyA9IEJUQU1QX1BBUlNFX1NVQ0NFU1M7CisgICAgdl9VMzJfdCBuTmVlZGVkID0gMFU7CisgICAgdl9VMzJfdCBzVHlwZSA9IDBVOworICAgIHZfVTM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5rX0xvc3NfV2FybmluZ19FdmVudCh2b2lkICogcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRCdGFtcFRMVkhDSV9QaHlzaWNhbF9MaW5rX0xvc3NfV2FybmluZ19FdmVudCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgKnBuQ29uc3VtZWQpCit7CisgICAgdl9VOF90KiBwVGx2TGVuID0gMDsKKyAgICB2X1UzMl90IG5Db25zdW1lZE9uRW50cnk7CisgICAgdl9VMzJfdCBzdGF0dXMgPSBCVEFNUF9QQVJTRV9TVUNDRVNTOworICAgIHZfVTMyX3Qgbk5lZWRlZCA9IDBVOworICAgIHZfVTMyX3Qgc1R5cGUgPSAwVTsKKyAgICB2X1UzMl90IHNMZW4gPSAwVTsKKyAgICBzVHlwZSA9IDE7CisgICAgc0xlbiA9IDE7CisgICAgICAgIC8vIHNhbml0eSBjaGVja2luZworICAgIGlmKCBwQ3R4ID09IE5VTEwgfHwgcFNyYyA9PSBOVUxMIHx8CisgICAgICAgIHBCdWYgPT0gTlVMTCB8fCBwbkNvbnN1bWVkID09IE5VTEwpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJiYWQgaW5wdXQiICk7CisgICAgICAgIHJldHVybiBCVEFNUF9CQURfSU5QVVRfQlVGRkVSOworICAgIH0KKyAgICBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisKKyAgICB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bnRyeSAtIHNUeXBlIC0gc0xlbiwgMCk7CisgICAgfSBlbHNlIGlmKE5VTEwgIT0gcFRsdkxlbikKKyAgICB7CisgICAgICAgICpwVGx2TGVuID0gKHZfVThfdCkoKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gc1R5cGUgLSBzTGVuKTsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGJ0YW1wUGFja1RsdkhDSV9QaHlzaWNhbF9MaW5rX0xvc3NfV2FybmluZ19FdmVudC4gKi8KKwordHlwZWRlZiB2X1UzMl90ICgqcGZuUGFja1RsdkhDSV9QaHlzaWNhbF9MaW5rX0xvc3NfV2FybmluZ19FdmVudF90KSh2b2lkICosIHRCdGFtcFRMVkhDSV9QaHlzaWNhbF9MaW5rX0xvc3NfV2FybmluZ19FdmVudCAqLCB2X1U4X3QqLCB2X1UzMl90LCB2X1UzMl90Kik7CisjZGVmaW5lIFNpZ1BhY2tUbHZIQ0lfUGh5c2ljYWxfTGlua19Mb3NzX1dhcm5pbmdfRXZlbnQgKCAweDAwOTcgKQorCit2X1UzMl90IGJ0YW1wUGFja1RsdkhDSV9QaHlzaWNhbF9MaW5rX1JlY292ZXJ5X0V2ZW50KHZvaWQgKiBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QnRhbXBUTFZIQ0lfUGh5c2ljYWxfTGlua19SZWNvdmVyeV9FdmVudCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgKnBuQ29uc3VtZWQpCit7CisgICAgdl9VOF90KiBwVGx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MDA5OCApCisKK3ZfVTMyX3QgYnRhbXBQYWNrVGx2SENJX1Fvc19WaW9sYXRpb25fRXZlbnQodm9pZCAqIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRCdGFtcFRMVkhDSV9Rb3NfVmlvbGF0aW9uX0V2ZW50ICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcG5Db25zdW1lZCkKK3sKKyAgICB2X1U4X3QqIHBUbHZMZW4gPSAwOworICAgIHZfVTMyX3QgbkNvbnN1bWVkT25FbnRyeTsKKyAgICB2X1UzMl90IHN0YXR1cyA9IEJUQU1QX1BBUlNFX1NVQ0NFU1M7CisgICAgdl9VMzJfdCBuTmVlZGVkID0gMFU7CisgICAgdl9VMzJfdCBzVHlwZSA9IDBVOworICAgIHZfVTMyX3Qgc0xlbiA9IDBVOworICAgIHNUeXBlID0gMTsKKyAgICBzTGVuID0gMTsKKyAgICAgICAgLy8gc2FuaXR5IGNoZWNraW5nCisgICAgaWYoIHBDdHggPT0gTlVMTCB8fCBwU3JjID09IE5VTEwgfHwKKyAgICAgICAgcEJ1ZiA9PSBOVUxMIHx8IHBuQ29uc3VtZWQgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgImJhZCBpbnB1dCIgKTsKKyAgICAgICAgcmV0dXJuIEJUQU1QX0JBRF9JTlBVVF9CVUZGRVI7CisgICAgfQorICAgIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKworICAgIHN0YXR1cyA9IGJ0YW1wR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pKCpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIHNUeXBlIC0gc0xlbik7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBidGFtcFBhY2tUbHZIQ0lfUW9zX1Zpb2xhdGlvbl9FdmVudC4gKi8KKwordHlwZWRlZiB2X1UzMl90ICgqcGZuUGFja1RsdkhDSV9Rb3NfVmlvbGF0aW9uX0V2ZW50X3QpKHZvaWQgKiwgdEJ0YW1wVExWSENJX1Fvc19WaW9sYXRpb25fRXZlbnQgKiwgdl9VOF90Kiwgdl9VMzJfdCwgdl9VMzJfdCopOworI2RlZmluZSBTaWdQYWNrVGx2SENJX1Fvc19WaW9sYXRpb25fRXZlbnQgKCAweDAwOTkgKQorCit2X1UzMl90IGJ0YW1wUGFja1RsdkhDSV9SZWFkX0Jlc3RfRWZmb3J0X0ZsdXNoX1RpbWVvdXRfQ21kKHZvaWQgKiBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QnRhbXBUTFZIQ0lfUmVhZF9CZXN0X0VmZm9ydF9GbHVzaF9UaW1lb3V0X0NtZCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgKnBuQ29uc3VtZWQpCit7CisgICAgdl9VOF90KiBwVGx2TGVuID0gMDsKKyAgICB2X1UzMl90IG5Db25zdW1lZE9uRW50cnk7CisgICAgdl9VMzJfdCBzdGF0dXMgPSBCVEFNUF9QQVJTRV9TVUNDRVNTOworICAgIHZfVTMyX3Qgbk5lZWRlZCA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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QnRhbXBUTFZIQ0lfUmVhZF9CdWZmZXJfU2l6ZV9DbWQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90ICpwbkNvbnN1bWVkKQoreworICAgIHZfVThfdCogcFRsdkxlbiA9IDA7CisgICAgdl9VMzJfdCBuQ29uc3VtZWRPbkVudHJ5OworICAgIHZfVTMyX3Qgc3RhdHVzID0gQlRBTVBfUEFSU0VfU1VDQ0VTUzsKKyAgICB2X1UzMl90IG5OZWVkZWQgPSAwVTsKKyAgICB2X1UzMl90IHNUeXBlID0gMFU7CisgICAgdl9VMzJfdCBzTGVuID0gMFU7CisgICAgc1R5cGUgPSAyOworICAgIHNMZW4gPSAxOworICAgICAgICAvLyBzYW5pdHkgY2hlY2tpbmcKKyAgICBpZiggcEN0eCA9PSBOVUxMIHx8IHBTcmMgPT0gTlVMTCB8fAorICAgICAgICBwQnVmID09IE5VTEwgfHwgcG5Db25zdW1lZCA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiYmFkIGlucHV0IiApOworICAgICAgICByZXR1cm4gQlRBTVBfQkFEX0lOUFVUX0JVRkZFUjsKKyAgICB9CisgICAgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworCisgICAgc3RhdHVzID0gYnRhbXBHZXRQYWNrZWRUbHZIQ0lfUmVhZF9CdWZmZXJfU2l6ZV9DbWQocEN0eCwgcFNyYywgJm5OZWVkZWQpOworICAgIGlmICggISBCVEFNUF9TV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1ZmZlcl9TaXplX0NtZCAqLCB2X1U4X3QqLCB2X1UzMl90LCB2X1UzMl90Kik7CisjZGVmaW5lIFNpZ1BhY2tUbHZIQ0lfUmVhZF9CdWZmZXJfU2l6ZV9DbWQgKCAweDAwOWIgKQorCit2X1UzMl90IGJ0YW1wUGFja1RsdkhDSV9SZWFkX0Nvbm5lY3Rpb25fQWNjZXB0X1RpbWVvdXRfQ21kKHZvaWQgKiBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QnRhbXBUTFZIQ0lfUmVhZF9Db25uZWN0aW9uX0FjY2VwdF9UaW1lb3V0X0NtZCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgKnBuQ29uc3VtZWQpCit7CisgICAgdl9VOF90KiBwVGx2TGVuID0gMDsKKyAgICB2X1UzMl90IG5Db25zdW1lZE9uRW50cnk7CisgICAgdl9VMzJfdCBzdGF0dXMgPSBCVEFNUF9QQVJTRV9TVUNDRVNTOworICAgIHZfVTMyX3Qgbk5lZWRlZCA9IDBVOworICAgIHZfVTMyX3Qgc1R5cGUgPSAwVTsKKyAgICB2X1UzMl90IHNMZW4gPSAwVTsKKyAgICBzVHlwZSA9IDI7CisgICAgc0xlbiA9IDE7CisgICAgICAgIC8vIHNhbml0eSBjaGVja2luZworICAgIGlmKCBwQ3R4ID09IE5VTEwgfHwgcFNyYyA9PSBOVUxMIHx8CisgICAgICAgIHBCdWYgPT0gTlVMTCB8fCBwbkNvbnN1bWVkID09IE5VTEwpCisgICAgeworICAgICAgICBWT1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MZW4pCisgICAgeworICAgICAgICAqcFRsdkxlbiA9ICh2X1U4X3QpKCpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIHNUeXBlIC0gc0xlbik7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBidGFtcFBhY2tUbHZIQ0lfUmVhZF9Db25uZWN0aW9uX0FjY2VwdF9UaW1lb3V0X0NtZC4gKi8KKwordHlwZWRlZiB2X1UzMl90ICgqcGZuUGFja1RsdkhDSV9SZWFkX0Nvbm5lY3Rpb25fQWNjZXB0X1RpbWVvdXRfQ21kX3QpKHZvaWQgKiwgdEJ0YW1wVExWSENJX1JlYWRfQ29ubmVjdGlvbl9BY2NlcHRfVGltZW91dF9DbWQgKiwgdl9VOF90Kiwgdl9VMzJfdCwgdl9VMzJfdCopOworI2RlZmluZSBTaWdQYWNrVGx2SENJX1JlYWRfQ29ubmVjdGlvbl9BY2NlcHRfVGltZW91dF9DbWQgKCAweDAwOWMgKQorCit2X1UzMl90IGJ0YW1wUGFja1RsdkhDSV9SZWFkX0RhdGFfQmxvY2tfU2l6ZV9DbWQodm9pZCAqIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEJ0YW1wVExWSENJX1JlYWRfRGF0YV9CbG9ja19TaXplX0NtZCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgKnBuQ29uc3VtZWQpCit7CisgICAgdl9VOF90KiBwVGx2TGVuID0gMDsKKyAgICB2X1UzMl90IG5Db25zdW1lZE9uRW50cnk7CisgICAgdl9VMzJfdCBzdGF0dXMgPSBCVE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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90ICpwbkNvbnN1bWVkKQoreworICAgIHZfVThfdCogcFRsdkxlbiA9IDA7CisgICAgdl9VMzJfdCBuQ29uc3VtZWRPbkVudHJ5OworICAgIHZfVTMyX3Qgc3RhdHVzID0gQlRBTVBfUEFSU0VfU1VDQ0VTUzsKKyAgICB2X1UzMl90IG5OZWVkZWQgPSAwVTsKKyAgICB2X1UzMl90IHNUeXBlID0gMFU7CisgICAgdl9VMzJfdCBzTGVuID0gMFU7CisgICAgc1R5cGUgPSAyOworICAgIHNMZW4gPSAxOworICAgICAgICAvLyBzYW5pdHkgY2hlY2tpbmcKKyAgICBpZiggcEN0eCA9PSBOVUxMIHx8IHBTcmMgPT0gTlVMTCB8fAorICAgICAgICBwQnVmID09IE5VTEwgfHwgcG5Db25zdW1lZCA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiYmFkIGlucHV0IiApOworICAgICAgICByZXR1cm4gQlRBTVBfQkFEX0lOUFVUX0JVRkZFUjsKKyAgICB9CisgICAgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworCisgICAgc3RhdHVzID0gYnRhbXBHZXRQYWNrZWRUbHZIQ0lfUmVhZF9GYWlsZWRfQ29udGFjdF9Db3VudGVyX0NtZChwQ3R4LCBwU3JjLCAmbk5lZWRlZCk7CisgICAgaWYgKCAhIEJUQU1QX1NVQ0NFRURFRCggc3RhdHVzICkgKSByZXR1cm4gc3RhdHVzOworICAgIG5OZWVkZWQgKz0gc1R5c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2SENJX1JlYWRfRmFpbGVkX0NvbnRhY3RfQ291bnRlcl9DbWRfdCkodm9pZCAqLCB0QnRhbXBUTFZIQ0lfUmVhZF9GYWlsZWRfQ29udGFjdF9Db3VudGVyX0NtZCAqLCB2X1U4X3QqLCB2X1UzMl90LCB2X1UzMl90Kik7CisjZGVmaW5lIFNpZ1BhY2tUbHZIQ0lfUmVhZF9GYWlsZWRfQ29udGFjdF9Db3VudGVyX0NtZCAoIDB4MDA5ZSApCisKK3ZfVTMyX3QgYnRhbXBQYWNrVGx2SENJX1JlYWRfRmxvd19Db250cm9sX01vZGVfQ21kKHZvaWQgKiBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEJ0YW1wVExWSENJX1JlYWRfRmxvd19Db250cm9sX01vZGVfQ21kICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcG5Db25zdW1lZCkKK3sKKyAgICB2X1U4X3QqIHBUbHZMZW4gPSAwOworICAgIHZfVTMyX3QgbkNvbnN1bWVkT25FbnRyeTsKKyAgICB2X1UzMl90IHN0YXR1cyA9IEJUQU1QX1BBUlNFX1NVQ0NFU1M7CisgICAgdl9VMzJfdCBuTmVlZGVkID0gMFU7CisgICAgdl9VMzJfdCBzVHlwZSA9IDBVOworICAgIHZfVTMyX3Qgc0xlbiA9IDBVOworICAgIHNUeXBlID0gMjsKKyAgICBzTGVuID0gMTsKKyAgICAgICAgLy8gc2FuaXR5IGNoZWNraW5nCisgICAgaWYoIHBDdHggPT0gTlVMTCB8fCBwU3JjID09IE5VTEwgfHwKKyAgICAgICAgcEJ1ZiA9P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gLSBzTGVuLCAwKTsKKyAgICB9IGVsc2UgaWYoTlVMTCAhPSBwVGx2TGVuKQorICAgIHsKKyAgICAgICAgKnBUbHZMZW4gPSAodl9VOF90KSgqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSBzVHlwZSAtIHNMZW4pOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgYnRhbXBQYWNrVGx2SENJX1JlYWRfRmxvd19Db250cm9sX01vZGVfQ21kLiAqLworCit0eXBlZGVmIHZfVTMyX3QgKCpwZm5QYWNrVGx2SENJX1JlYWRfRmxvd19Db250cm9sX01vZGVfQ21kX3QpKHZvaWQgKiwgdEJ0YW1wVExWSENJX1JlYWRfRmxvd19Db250cm9sX01vZGVfQ21kICosIHZfVThfdCosIHZfVTMyX3QsIHZfVTMyX3QqKTsKKyNkZWZpbmUgU2lnUGFja1RsdkhDSV9SZWFkX0Zsb3dfQ29udHJvbF9Nb2RlX0NtZCAoIDB4MDA5ZiApCisKK3ZfVTMyX3QgYnRhbXBQYWNrVGx2SENJX1JlYWRfTGlua19RdWFsaXR5X0NtZCh2b2lkICogcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QnRhbXBUTFZIQ0lfUmVhZF9MaW5rX1F1YWxpdHlfQ21kICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcG5Db25zdW1lZCkKK3sKKyAgICB2X1U4X3QqIHBUbHZMZW4gPSAwOworICAgIHZfVTMyX3QgbkNvbnN1bWVkT25FbnRyeTsKKyAgICB2X1UzMl90IHN0YXR1cyA9IEJUQU1QX1BBUlNFX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YgKz0gc0xlbjsgbkJ1ZiAtPSBzTGVuOyAqcG5Db25zdW1lZCArPSBzTGVuOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5sb2dfbGlua19oYW5kbGUsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgIAorICAgIGlmIChwVGx2TGVuICYmIHNMZW4gPT0gMikKKyAgICB7CisgICAgICAgIGZyYW1lc2h0b25zKCBwQ3R4LCBwVGx2TGVuLCAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSBzVHlwZSAtIHNMZW4sIDApOworICAgIH0gZWxzZSBpZihOVUxMICE9IHBUbHZMZW4pCisgICAgeworICAgICAgICAqcFRsdkxlbiA9ICh2X1U4X3QpKCpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIHNUeXBlIC0gc0xlbik7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBidGFtcFBhY2tUbHZIQ0lfUmVhZF9MaW5rX1F1YWxpdHlfQ21kLiAqLworCit0eXBlZGVmIHZfVTMyX3QgKCpwZm5QYWNrVGx2SENJX1JlYWRfTGlua19RdWFsaXR5X0NtZF90KSh2b2lkICosIHRCdGFtcFRMVkhDSV9SZWFkX0xpbmtfUXVhbGl0eV9DbWQgKiwgdl9VOF90Kiwgdl9VMzJfdCwgdl9VMzJfdCopOworI2RlZmluZSBTaWdQYWNrVGx2SENJX1JlYWRfTGlua19RdWFsaXR5X0NtZCAoIDB4MDBhMCApCisKK3ZfVTMyX3QgYnRhbXBQYWNrVGx2SENJX1JlYWRfTGlua19TdXBlcnZpc2lvbl9UaW1lb3V0X0NtZCh2b2lkICogcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QnRhbXBUTFZIQ0lfUmVhZF9MaW5rX1N1cGVydmlzaW9uX1RpbWVvdXRfQ21kICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcG5Db25zdW1lZCkKK3sKKyAgICB2X1U4X3QqIHBUbHZMZW4gPSAwOworICAgIHZfVTMyX3QgbkNvbnN1bWVkT25FbnRyeTsKKyAgICB2X1UzMl90IHN0YXR1cyA9IEJUQU1QX1BBUlNFX1NVQ0NFU1M7CisgICAgdl9VMzJfdCBuTmVlZGVkID0gMFU7CisgICAgdl9VMzJfdCBzVHlwZSA9IDBVOworICAgIHZfVTMyX3Qgc0xlbiA9IDBVOworICAgIHNUeXBlID0gMjsKKyAgICBzTGVuID0gMTsKKyAgICAgICAgLy8gc2FuaXR5IGNoZWNraW5nCisgICAgaWYoIHBDdHggPT0gTlVMTCB8fCBwU3JjID09IE5VTEwgfHwKKyAgICAgICAgcEJ1ZiA9PSBOVUxMIHx8IHBuQ29uc3VtZWQgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgImJhZCBpbnB1dCIgKTsKKyAgICAgICAgcmV0dXJuIEJUQU1QX0JBRF9JTlBVVF9CVUZGRVI7CisgICAgfQorICAgIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKworICAgIHN0YXR1cyA9IGJ0YW1wR2V0UGFja2VkVGx2SENJX1JlYWRfTGlua19TdXBlcnZpc2lvbl9UaW1lb3V0X0NtZChwQ3R4LCBwU3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RW5kIGJ0YW1wUGFja1RsdkhDSV9SZWFkX0xpbmtfU3VwZXJ2aXNpb25fVGltZW91dF9DbWQuICovCisKK3R5cGVkZWYgdl9VMzJfdCAoKnBmblBhY2tUbHZIQ0lfUmVhZF9MaW5rX1N1cGVydmlzaW9uX1RpbWVvdXRfQ21kX3QpKHZvaWQgKiwgdEJ0YW1wVExWSENJX1JlYWRfTGlua19TdXBlcnZpc2lvbl9UaW1lb3V0X0NtZCAqLCB2X1U4X3QqLCB2X1UzMl90LCB2X1UzMl90Kik7CisjZGVmaW5lIFNpZ1BhY2tUbHZIQ0lfUmVhZF9MaW5rX1N1cGVydmlzaW9uX1RpbWVvdXRfQ21kICggMHgwMGExICkKKwordl9VMzJfdCBidGFtcFBhY2tUbHZIQ0lfUmVhZF9Mb2NhbF9BTVBfQXNzb2NfQ21kKHZvaWQgKiBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRCdGFtcFRMVkhDSV9SZWFkX0xvY2FsX0FNUF9Bc3NvY19DbWQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90ICpwbkNvbnN1bWVkKQoreworICAgIHZfVThfdCogcFRsdkxlbiA9IDA7CisgICAgdl9VMzJfdCBuQ29uc3VtZWRPbkVudHJ5OworICAgIHZfVTMyX3Qgc3RhdHVzID0gQlRBTVBfUEFSU0VfU1VDQ0VTUzsKKyAgICB2X1UzMl90IG5OZWVkZWQgPSAwVTsKKyAgICB2X1UzMl90IHNUeXBlID0gMFU7CisgICAgdl9VMzJfdCBzTGVuID0gMFU7CisgICAgc1R5cGUgPSAyOworICAgIHNMZ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Y2tUbHZIQ0lfUmVhZF9Mb2NhbF9BTVBfQXNzb2NfQ21kICggMHgwMGEyICkKKwordl9VMzJfdCBidGFtcFBhY2tUbHZIQ0lfUmVhZF9Mb2NhbF9BTVBfSW5mb3JtYXRpb25fQ21kKHZvaWQgKiBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRCdGFtcFRMVkhDSV9SZWFkX0xvY2FsX0FNUF9JbmZvcm1hdGlvbl9DbWQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90ICpwbkNvbnN1bWVkKQoreworICAgIHZfVThfdCogcFRsdkxlbiA9IDA7CisgICAgdl9VMzJfdCBuQ29uc3VtZWRPbkVudHJ5OworICAgIHZfVTMyX3Qgc3RhdHVzID0gQlRBTVBfUEFSU0VfU1VDQ0VTUzsKKyAgICB2X1UzMl90IG5OZWVkZWQgPSAwVTsKKyAgICB2X1UzMl90IHNUeXBlID0gMFU7CisgICAgdl9VMzJfdCBzTGVuID0gMFU7CisgICAgc1R5cGUgPSAyOworICAgIHNMZW4gPSAxOworICAgICAgICAvLyBzYW5pdHkgY2hlY2tpbmcKKyAgICBpZiggcEN0eCA9PSBOVUxMIHx8IHBTcmMgPT0gTlVMTCB8fAorICAgICAgICBwQnVmID09IE5VTEwgfHwgcG5Db25zdW1lZCA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiYmFkIGlucHV0IiApOworICAgICAgICByZXR1cm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lbik7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBidGFtcFBhY2tUbHZIQ0lfUmVhZF9Mb2NhbF9BTVBfSW5mb3JtYXRpb25fQ21kLiAqLworCit0eXBlZGVmIHZfVTMyX3QgKCpwZm5QYWNrVGx2SENJX1JlYWRfTG9jYWxfQU1QX0luZm9ybWF0aW9uX0NtZF90KSh2b2lkICosIHRCdGFtcFRMVkhDSV9SZWFkX0xvY2FsX0FNUF9JbmZvcm1hdGlvbl9DbWQgKiwgdl9VOF90Kiwgdl9VMzJfdCwgdl9VMzJfdCopOworI2RlZmluZSBTaWdQYWNrVGx2SENJX1JlYWRfTG9jYWxfQU1QX0luZm9ybWF0aW9uX0NtZCAoIDB4MDBhMyApCisKK3ZfVTMyX3QgYnRhbXBQYWNrVGx2SENJX1JlYWRfTG9jYWxfU3VwcG9ydGVkX0NtZHNfQ21kKHZvaWQgKiBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEJ0YW1wVExWSENJX1JlYWRfTG9jYWxfU3VwcG9ydGVkX0NtZHNfQ21kICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcG5Db25zdW1lZCkKK3sKKyAgICB2X1U4X3QqIHBUbHZMZW4gPSAwOworICAgIHZfVTMyX3QgbkNvbnN1bWVkT25FbnRyeTsKKyAgICB2X1UzMl90IHN0YXR1cyA9IEJUQU1QX1BBUlNFX1NVQ0NFU1M7CisgICAgdl9VMzJfdCBuTmVlZGVkID0gMFU7CisgICAgdl9VMzJfdCBzVHlwZSA9IDBV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Ml90IGJ0YW1wUGFja1RsdkhDSV9SZWFkX0xvY2F0aW9uX0RhdGFfQ21kKHZvaWQgKiBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QnRhbXBUTFZIQ0lfUmVhZF9Mb2NhdGlvbl9EYXRhX0NtZCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgKnBuQ29uc3VtZWQpCit7CisgICAgdl9VOF90KiBwVGx2TGVuID0gMDsKKyAgICB2X1UzMl90IG5Db25zdW1lZE9uRW50cnk7CisgICAgdl9VMzJfdCBzdGF0dXMgPSBCVEFNUF9QQVJTRV9TVUNDRVNTOworICAgIHZfVTMyX3Qgbk5lZWRlZCA9IDBVOworICAgIHZfVTMyX3Qgc1R5cGUgPSAwVTsKKyAgICB2X1UzMl90IHNMZW4gPSAwVTsKKyAgICBzVHlwZSA9IDI7CisgICAgc0xlbiA9IDE7CisgICAgICAgIC8vIHNhbml0eSBjaGVja2luZworICAgIGlmKCBwQ3R4ID09IE5VTEwgfHwgcFNyYyA9PSBOVUxMIHx8CisgICAgICAgIHBCdWYgPT0gTlVMTCB8fCBwbkNvbnN1bWVkID09IE5VTEwpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJiYWQgaW5wdXQiICk7CisgICAgICAgIHJldHVybiBCVEFNUF9CQURfSU5QVVRfQlVGRkVSOworICAgIH0KKyAgICBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisKKyAgICBzdGF0dXMgPSBidGFtcEdldFBhY2t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GZuUGFja1RsdkhDSV9SZWFkX0xvY2F0aW9uX0RhdGFfQ21kX3QpKHZvaWQgKiwgdEJ0YW1wVExWSENJX1JlYWRfTG9jYXRpb25fRGF0YV9DbWQgKiwgdl9VOF90Kiwgdl9VMzJfdCwgdl9VMzJfdCopOworI2RlZmluZSBTaWdQYWNrVGx2SENJX1JlYWRfTG9jYXRpb25fRGF0YV9DbWQgKCAweDAwYTYgKQorCit2X1UzMl90IGJ0YW1wUGFja1RsdkhDSV9SZWFkX0xvZ2ljYWxfTGlua19BY2NlcHRfVGltZW91dF9DbWQodm9pZCAqIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEJ0YW1wVExWSENJX1JlYWRfTG9naWNhbF9MaW5rX0FjY2VwdF9UaW1lb3V0X0NtZCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgKnBuQ29uc3VtZWQpCit7CisgICAgdl9VOF90KiBwVGx2TGVuID0gMDsKKyAgICB2X1UzMl90IG5Db25zdW1lZE9uRW50cnk7CisgICAgdl9VMzJfdCBzdGF0dXMgPSBCVEFNUF9QQVJTRV9TVUNDRVNTOworICAgIHZfVTMyX3Qgbk5lZWRlZCA9IDBVOworICAgIHZfVTMyX3Qgc1R5cGUgPSAwVTsKKyAgICB2X1UzMl90IHNMZW4gPSAwVTsKKyAgICBzVHlwZSA9IDI7CisgICAgc0xlbiA9IDE7CisgICAgICAgIC8vIHNhbml0eSBjaGVja2luZworICAgIGlmKCBwQ3R4ID09IE5VTEwgfHwgc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ZCAqLCB0QnRhbXBUTFZIQ0lfUmVzZXRfQ21kICosIHZfVThfdCosIHZfVTMyX3QsIHZfVTMyX3QqKTsKKyNkZWZpbmUgU2lnUGFja1RsdkhDSV9SZXNldF9DbWQgKCAweDAwYWEgKQorCit2X1UzMl90IGJ0YW1wUGFja1RsdkhDSV9SZXNldF9GYWlsZWRfQ29udGFjdF9Db3VudGVyX0NtZCh2b2lkICogcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRCdGFtcFRMVkhDSV9SZXNldF9GYWlsZWRfQ29udGFjdF9Db3VudGVyX0NtZCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgKnBuQ29uc3VtZWQpCit7CisgICAgdl9VOF90KiBwVGx2TGVuID0gMDsKKyAgICB2X1UzMl90IG5Db25zdW1lZE9uRW50cnk7CisgICAgdl9VMzJfdCBzdGF0dXMgPSBCVEFNUF9QQVJTRV9TVUNDRVNTOworICAgIHZfVTMyX3Qgbk5lZWRlZCA9IDBVOworICAgIHZfVTMyX3Qgc1R5cGUgPSAwVTsKKyAgICB2X1UzMl90IHNMZW4gPSAwVTsKKyAgICBzVHlwZSA9IDI7CisgICAgc0xlbiA9IDE7CisgICAgICAgIC8vIHNhbml0eSBjaGVja2luZworICAgIGlmKCBwQ3R4ID09IE5VTEwgfHwgcFNyYyA9PSBOVUxMIHx8CisgICAgICAgIHBCdWYgPT0gTlVMTCB8fCBwbkNvbnN1bWVkID09IE5VTEwpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJiYWQgaW5wdXQiICk7CisgICAgICAgIHJldHVybiBCVEFNUF9CQURfSU5QVVRfQlVGRkVSOworICAgIH0KKyAgICBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisKKyAgICBzdGF0dXMgPSBidGFtcEdldFBhY2tlZFRsdkhDSV9SZXNldF9GYWlsZWRfQ29udGFjdF9Db3VudGVyX0NtZChwQ3R4LCBwU3JjLCAmbk5lZWRlZCk7CisgICAgaWYgKCAhIEJUQU1QX1NVQ0NFRURFRCggc3RhdHVzICkgKSByZXR1cm4gc3RhdHVzOworICAgIG5OZWVkZWQgKz0gc1R5cGUgKyBzTGVuOworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gQlRBTVBfQlVGRkVSX09WRVJGTE9XOworICAgIHBUbHZMZW4gPSBwQnVmOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiggc1R5cGUgPT0gMikgZnJhbWVzaHRvbnMoIHBDdHgsIHBCdWYsIDUxMjIsIDApOworICAgICAgICBwQnVmICs9IHNUeXBlOyBuQnVmIC09IHNUeXBlOyAqcG5Db25zdW1lZCArPSBzVHlwZTsKKyAgICAgICAgcFRsdkxlbiA9IHBCdWY7CisgICAgICAgIHBCdWYgKz0gc0xlbjsgbkJ1ZiAtPSBzTGVuOyAqcG5Db25zdW1lZCArPSBzTGVuOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5sb2dfbGlua19oYW5kbGUsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgaWYgKHBUbHZMZW4gJiYgc0xlbiA9PSAyKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBUbHZMZW4sICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIHNUeXBlIC0gc0xlbiwgMCk7CisgICAgfSBlbHNlIGlmKE5VTEwgIT0gcFRsdkxlbikKKyAgICB7CisgICAgICAgICpwVGx2TGVuID0gKHZfVThfdCkoKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gc1R5cGUgLSBzTGVuKTsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGJ0YW1wUGFja1RsdkhDSV9SZXNldF9GYWlsZWRfQ29udGFjdF9Db3VudGVyX0NtZC4gKi8KKwordHlwZWRlZiB2X1UzMl90ICgqcGZuUGFja1RsdkhDSV9SZXNldF9GYWlsZWRfQ29udGFjdF9Db3VudGVyX0NtZF90KSh2b2lkICosIHRCdGFtcFRMVkhDSV9SZXNldF9GYWlsZWRfQ29udGFjdF9Db3VudGVyX0NtZCAqLCB2X1U4X3QqLCB2X1UzMl90LCB2X1UzMl90Kik7CisjZGVmaW5lIFNpZ1BhY2tUbHZIQ0lfUmVzZXRfRmFpbGVkX0NvbnRhY3RfQ291bnRlcl9DbWQgKCAweDAwYWIgKQorCit2X1UzMl90IGJ0YW1wUGFja1RsdkhDSV9TZXRfRXZlbnRfTWFza19DbWQodm9pZCAqIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEJ0YW1wVExWSENJX1NldF9FdmVudF9NYXNrX0NtZCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgKnBuQ29uc3VtZWQpCit7CisgICAgdl9VOF90KiBwVGx2TGVuID0gMDsKKy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EN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEJ0YW1wVExWSENJX1NldF9FdmVudF9NYXNrX1BhZ2VfMl9DbWQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90ICpwbkNvbnN1bWVkKQoreworICAgIHZfVThfdCogcFRsdkxlbiA9IDA7CisgICAgdl9VMzJfdCBuQ29uc3VtZWRPbkVudHJ5OworICAgIHZfVTMyX3Qgc3RhdHVzID0gQlRBTVBfUEFSU0VfU1VDQ0VTUzsKKyAgICB2X1UzMl90IG5OZWVkZWQgPSAwVTsKKyAgICB2X1UzMl90IHNUeXBlID0gMFU7CisgICAgdl9VMzJfdCBzTGVuID0gMFU7CisgICAgc1R5cGUgPSAyOworICAgIHNMZW4gPSAxOworICAgICAgICAvLyBzYW5pdHkgY2hlY2tpbmcKKyAgICBpZiggcEN0eCA9PSBOVUxMIHx8IHBTcmMgPT0gTlVMTCB8fAorICAgICAgICBwQnVmID09IE5VTEwgfHwgcG5Db25zdW1lZCA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiYmFkIGlucHV0IiApOworICAgICAgICByZXR1cm4gQlRBTVBfQkFEX0lOUFVUX0JVRkZFUjsKKyAgICB9CisgICAgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworCisgICAgc3RhdHVzID0gYnRhbXBHZXRQYWNrZWRUbHZIQ0lfU2V0X0V2ZW50X01hc2tfUGFnZV8yX0NtZChwQ3R4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XR1czsKK30gLyogRW5kIGJ0YW1wUGFja1RsdkhDSV9TZXRfRXZlbnRfTWFza19QYWdlXzJfQ21kLiAqLworCit0eXBlZGVmIHZfVTMyX3QgKCpwZm5QYWNrVGx2SENJX1NldF9FdmVudF9NYXNrX1BhZ2VfMl9DbWRfdCkodm9pZCAqLCB0QnRhbXBUTFZIQ0lfU2V0X0V2ZW50X01hc2tfUGFnZV8yX0NtZCAqLCB2X1U4X3QqLCB2X1UzMl90LCB2X1UzMl90Kik7CisjZGVmaW5lIFNpZ1BhY2tUbHZIQ0lfU2V0X0V2ZW50X01hc2tfUGFnZV8yX0NtZCAoIDB4MDBhZCApCisKK3ZfVTMyX3QgYnRhbXBQYWNrVGx2SENJX1NldF9TaG9ydF9SYW5nZV9Nb2RlX0NtZCh2b2lkICogcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QnRhbXBUTFZIQ0lfU2V0X1Nob3J0X1JhbmdlX01vZGVfQ21kICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcG5Db25zdW1lZCkKK3sKKyAgICB2X1U4X3QqIHBUbHZMZW4gPSAwOworICAgIHZfVTMyX3QgbkNvbnN1bWVkT25FbnRyeTsKKyAgICB2X1UzMl90IHN0YXR1cyA9IEJUQU1QX1BBUlNFX1NVQ0NFU1M7CisgICAgdl9VMzJfdCBuTmVlZGVkID0gMFU7CisgICAgdl9VMzJfdCBzVHlwZSA9IDBVOworICAgIHZfVTMyX3Qgc0xlbiA9IDBVOworICAgIHNUeXBlID0gMjsKKyAgICBzTGVuID0gMTsKKyAgICAgICAgLy8gc2F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ExWSENJX1Nob3J0X1JhbmdlX01vZGVfQ2hhbmdlX0NvbXBsZXRlX0V2ZW50ICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcG5Db25zdW1lZCkKK3sKKyAgICB2X1U4X3QqIHBUbHZMZW4gPSAwOworICAgIHZfVTMyX3QgbkNvbnN1bWVkT25FbnRyeTsKKyAgICB2X1UzMl90IHN0YXR1cyA9IEJUQU1QX1BBUlNFX1NVQ0NFU1M7CisgICAgdl9VMzJfdCBuTmVlZGVkID0gMFU7CisgICAgdl9VMzJfdCBzVHlwZSA9IDBVOworICAgIHZfVTMyX3Qgc0xlbiA9IDBVOworICAgIHNUeXBlID0gMTsKKyAgICBzTGVuID0gMTsKKyAgICAgICAgLy8gc2FuaXR5IGNoZWNraW5nCisgICAgaWYoIHBDdHggPT0gTlVMTCB8fCBwU3JjID09IE5VTEwgfHwKKyAgICAgICAgcEJ1ZiA9PSBOVUxMIHx8IHBuQ29uc3VtZWQgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgImJhZCBpbnB1dCIgKTsKKyAgICAgICAgcmV0dXJuIEJUQU1QX0JBRF9JTlBVVF9CVUZGRVI7CisgICAgfQorICAgIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKworICAgIHN0YXR1cyA9IGJ0YW1wR2V0UGFja2VkVGx2SENJX1Nob3J0X1JhbmdlX01vZGVfQ2hhbmdlX0NvbXBsZXRlX0V2ZW50KHBDdHgsIHBTcmMsICZuTmVlZGVkKTsKKyAgICBpZiAoICEgQlRBTVBfU1VDQ0VFREVEKCBzdGF0dXMgKSApIHJldHVybiBzdGF0dXM7CisgICAgbk5lZWRlZCArPSBzVHlwZSArIHNMZW47CisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBCVEFNUF9CVUZGRVJfT1ZFUkZMT1c7CisgICAgcFRsdkxlbiA9IHBCdWY7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmKCBzVHlwZSA9PSAyKSBmcmFtZXNodG9ucyggcEN0eCwgcEJ1ZiwgNzYsIDApOworICAgICAgICBlbHNlICpwQnVmID0gNzY7CisgICAgICAgIHBCdWYgKz0gc1R5cGU7IG5CdWYgLT0gc1R5cGU7ICpwbkNvbnN1bWVkICs9IHNUeXBlOworICAgICAgICBwVGx2TGVuID0gcEJ1ZjsKKyAgICAgICAgcEJ1ZiArPSBzTGVuOyBuQnVmIC09IHNMZW47ICpwbkNvbnN1bWVkICs9IHNMZW47CisgICAgICAgICpwQnVmID0gcFNyYy0+c3RhdHVzOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIG5CdWYgLT0gMTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5waHlfbGlua19oYW5kbGU7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnNob3J0X3JhbmdlX21vZGU7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICBpZiAocFRsdkxlbiAmJiBzTGVuID09IDIpCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggc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ZCBidGFtcFBhY2tUbHZIQ0lfV3JpdGVfQmVzdF9FZmZvcnRfRmx1c2hfVGltZW91dF9DbWQuICovCisKK3R5cGVkZWYgdl9VMzJfdCAoKnBmblBhY2tUbHZIQ0lfV3JpdGVfQmVzdF9FZmZvcnRfRmx1c2hfVGltZW91dF9DbWRfdCkodm9pZCAqLCB0QnRhbXBUTFZIQ0lfV3JpdGVfQmVzdF9FZmZvcnRfRmx1c2hfVGltZW91dF9DbWQgKiwgdl9VOF90Kiwgdl9VMzJfdCwgdl9VMzJfdCopOworI2RlZmluZSBTaWdQYWNrVGx2SENJX1dyaXRlX0Jlc3RfRWZmb3J0X0ZsdXNoX1RpbWVvdXRfQ21kICggMHgwMGIwICkKKwordl9VMzJfdCBidGFtcFBhY2tUbHZIQ0lfV3JpdGVfQ29ubmVjdGlvbl9BY2NlcHRfVGltZW91dF9DbWQodm9pZCAqIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QnRhbXBUTFZIQ0lfV3JpdGVfQ29ubmVjdGlvbl9BY2NlcHRfVGltZW91dF9DbWQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90ICpwbkNvbnN1bWVkKQoreworICAgIHZfVThfdCogcFRsdkxlbiA9IDA7CisgICAgdl9VMzJfdCBuQ29uc3VtZWRPbkVudHJ5OworICAgIHZfVTMyX3Qgc3RhdHVzID0gQlRBTVBfUEFSU0VfU1VDQ0VTUzsKKyAgICB2X1UzMl90IG5OZWVkZWQgPSAwVTsKKyAgICB2X1UzMl90I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EN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QnRhbXBUTFZIQ0lfV3JpdGVfRmxvd19Db250cm9sX01vZGVfQ21kICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcG5Db25zdW1lZCkKK3sKKyAgICB2X1U4X3QqIHBUbHZMZW4gPSAwOworICAgIHZfVTMyX3QgbkNvbnN1bWVkT25FbnRyeTsKKyAgICB2X1UzMl90IHN0YXR1cyA9IEJUQU1QX1BBUlNFX1NVQ0NFU1M7CisgICAgdl9VMzJfdCBuTmVlZGVkID0gMFU7CisgICAgdl9VMzJfdCBzVHlwZSA9IDBVOworICAgIHZfVTMyX3Qgc0xlbiA9IDBVOworICAgIHNUeXBlID0gMjsKKyAgICBzTGVuID0gMTsKKyAgICAgICAgLy8gc2FuaXR5IGNoZWNraW5nCisgICAgaWYoIHBDdHggPT0gTlVMTCB8fCBwU3JjID09IE5VTEwgfHwKKyAgICAgICAgcEJ1ZiA9PSBOVUxMIHx8IHBuQ29uc3VtZWQgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgImJhZCBpbnB1dCIgKTsKKyAgICAgICAgcmV0dXJuIEJUQU1QX0JBRF9JTlBVVF9CVUZGRVI7CisgICAgfQorICAgIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKworICAgIHN0YXR1cyA9IGJ0YW1wR2V0UGFja2VkVGx2SENJX1dyaXRlX0Zsb3dfQ29udHJvb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30gLyogRW5kIGJ0YW1wUGFja1RsdkhDSV9Xcml0ZV9GbG93X0NvbnRyb2xfTW9kZV9DbWQuICovCisKK3R5cGVkZWYgdl9VMzJfdCAoKnBmblBhY2tUbHZIQ0lfV3JpdGVfRmxvd19Db250cm9sX01vZGVfQ21kX3QpKHZvaWQgKiwgdEJ0YW1wVExWSENJX1dyaXRlX0Zsb3dfQ29udHJvbF9Nb2RlX0NtZCAqLCB2X1U4X3QqLCB2X1UzMl90LCB2X1UzMl90Kik7CisjZGVmaW5lIFNpZ1BhY2tUbHZIQ0lfV3JpdGVfRmxvd19Db250cm9sX01vZGVfQ21kICggMHgwMGIyICkKKwordl9VMzJfdCBidGFtcFBhY2tUbHZIQ0lfV3JpdGVfTGlua19TdXBlcnZpc2lvbl9UaW1lb3V0X0NtZCh2b2lkICogcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEJ0YW1wVExWSENJX1dyaXRlX0xpbmtfU3VwZXJ2aXNpb25fVGltZW91dF9DbWQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90ICpwbkNvbnN1bWVkKQoreworICAgIHZfVThfdCogcFRsdkxlbiA9IDA7CisgICAgdl9VMzJfdCBuQ29uc3VtZWRPbkVudHJ5OworICAgIHZfVTMyX3Qgc3RhdHVzID0gQlRBTVBfUEFSU0VfU1VDQ0VTUzsKKyAgICB2X1UzMl90IG5OZWVkZWQgPSAwVTsKKyAgICB2X1UzMl90IHNUeXBlID0gMFU7CisgICAgdl9VMzJfdCBzTGVuID0g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90IGJ0YW1wUGFja1RsdkhDSV9Xcml0ZV9Mb2NhdGlvbl9EYXRhX0NtZCh2b2lkICogcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRCdGFtcFRMVkhDSV9Xcml0ZV9Mb2NhdGlvbl9EYXRhX0NtZCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgKnBuQ29uc3VtZWQpCit7CisgICAgdl9VOF90KiBwVGx2TGVuID0gMDsKKyAgICB2X1UzMl90IG5Db25zdW1lZE9uRW50cnk7CisgICAgdl9VMzJfdCBzdGF0dXMgPSBCVEFNUF9QQVJTRV9TVUNDRVNTOworICAgIHZfVTMyX3Qgbk5lZWRlZCA9IDBVOworICAgIHZfVTMyX3Qgc1R5cGUgPSAwVTsKKyAgICB2X1UzMl90IHNMZW4gPSAwVTsKKyAgICBzVHlwZSA9IDI7CisgICAgc0xlbiA9IDE7CisgICAgICAgIC8vIHNhbml0eSBjaGVja2luZworICAgIGlmKCBwQ3R4ID09IE5VTEwgfHwgcFNyYyA9PSBOVUxMIHx8CisgICAgICAgIHBCdWYgPT0gTlVMTCB8fCBwbkNvbnN1bWVkID09IE5VTEwpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJiYWQgaW5wdXQiICk7CisgICAgICAgIHJldHVybiBCVEFNUF9CQURfSU5QVVRfQlVGRkVSOworICAgIH0KKyAgICBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisKKyAgICBzdGF0dXMgPSBidGFtcEdldFBhY2tlZFRsdkhDSV9Xcml0ZV9Mb2NhdGlvbl9EYXRhX0NtZChwQ3R4LCBwU3JjLCAmbk5lZWRlZCk7CisgICAgaWYgKCAhIEJUQU1QX1NVQ0NFRURFRCggc3RhdHVzICkgKSByZXR1cm4gc3RhdHVzOworICAgIG5OZWVkZWQgKz0gc1R5cGUgKyBzTGVuOworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gQlRBTVBfQlVGRkVSX09WRVJGTE9XOworICAgIHBUbHZMZW4gPSBwQnVmOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiggc1R5cGUgPT0gMikgZnJhbWVzaHRvbnMoIHBDdHgsIHBCdWYsIDMxNzMsIDApOworICAgICAgICBwQnVmICs9IHNUeXBlOyBuQnVmIC09IHNUeXBlOyAqcG5Db25zdW1lZCArPSBzVHlwZTsKKyAgICAgICAgcFRsdkxlbiA9IHBCdWY7CisgICAgICAgIHBCdWYgKz0gc0xlbjsgbkJ1ZiAtPSBzTGVuOyAqcG5Db25zdW1lZCArPSBzTGVuOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPmxvY19kb21haW5fYXdhcmU7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgbkJ1ZiAtPSAxOworICAgICAgICBCVEFNUF9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+bG9jX2RvbWFpbiwgMyk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDM7CisgICAgICAgIHBCdWYgKz0gMzsKKyAgICAgICAgbkJ1ZiAtPSAzOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPmxvY19vcHRpb25zOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIG5CdWYgLT0gMTsKKyAgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgaWYgKHBUbHZMZ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X0NtZF90KSh2b2lkICosIHRCdGFtcFRMVkhDSV9Xcml0ZV9Mb2dpY2FsX0xpbmtfQWNjZXB0X1RpbWVvdXRfQ21kICosIHZfVThfdCosIHZfVTMyX3QsIHZfVTMyX3QqKTsKKyNkZWZpbmUgU2lnUGFja1RsdkhDSV9Xcml0ZV9Mb2dpY2FsX0xpbmtfQWNjZXB0X1RpbWVvdXRfQ21kICggMHgwMGI1ICkKKwordl9VMzJfdCBidGFtcFBhY2tUbHZIQ0lfV3JpdGVfTG9vcGJhY2tfTW9kZV9DbWQodm9pZCAqIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QnRhbXBUTFZIQ0lfV3JpdGVfTG9vcGJhY2tfTW9kZV9DbWQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90ICpwbkNvbnN1bWVkKQoreworICAgIHZfVThfdCogcFRsdkxlbiA9IDA7CisgICAgdl9VMzJfdCBuQ29uc3VtZWRPbkVudHJ5OworICAgIHZfVTMyX3Qgc3RhdHVzID0gQlRBTVBfUEFSU0VfU1VDQ0VTUzsKKyAgICB2X1UzMl90IG5OZWVkZWQgPSAwVTsKKyAgICB2X1UzMl90IHNUeXBlID0gMFU7CisgICAgdl9VMzJfdCBzTGVuID0gMFU7CisgICAgc1R5cGUgPSAyOworICAgIHNMZW4gPSAxOworICAgICAgICAvLyBzYW5pdHkgY2hlY2tpbmcKKyAgICBpZiggcEN0eCA9PSBOVUxMIHx8IHBTcmMgPT0gTlVMTCB8fAorICAgICAgICBwQnVmID09IE5VTEwgfHwgcG5Db25zdW1lZCA9PSBOVUxMKQorICAgIHsKK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ICAgICAgICBwQnVmICs9IHNUeXBlOyBuQnVmIC09IHNUeXBlOyAqcG5Db25zdW1lZCArPSBzVHlwZTsKKyAgICAgICAgcFRsdkxlbiA9IHBCdWY7CisgICAgICAgIHBCdWYgKz0gc0xlbjsgbkJ1ZiAtPSBzTGVuOyAqcG5Db25zdW1lZCArPSBzTGVuOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnBoeV9saW5rX2hhbmRsZTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBuQnVmIC09IDE7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmxlbmd0aF9zb19mYXIsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+YW1wX2Fzc29jX3JlbWFpbmluZ19sZW5ndGgsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIG5CdWYgLT0gMjsKKyAgICAgICAgQlRBTVBfTUVNQ1BZKHBDdHgsIHBCdWYsICYoIHBTcmMtPmFtcF9hc3NvY19mcmFnbWVudCApLCBwU3JjLT5hbXBfYXNzb2NfcmVtYWluaW5nX2xlbmd0aCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IHBTcmMtPmFtcF9hc3NvY19yZW1haW5pbmdfbGVuZ3RoOworICAgICAgICBwQnVmICs9ICggcFNyYy0+YW1wX2Fzc29jX3JlbWFpbmluZ19sZW5ndGggKTsKKyAgICAgICAgbkJ1ZiAtPSAoIHBTcmMtPmFtcF9hc3NvY19yZW1haW5pbmdfbGVuZ3RoICk7CisgICAgICAgIGJyZWFrOworICAgIH0KKworICAgIGlmIChwVGx2TGVuICYmIHNMZW4gPT0gMikKKyAgICB7Cis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5lIFNpZ1BhY2tUbHZIQ0lfRW5oYW5jZWRfRmx1c2hfQ21kICggMHgwMGI4ICkKKwordl9VMzJfdCBidGFtcFBhY2tUbHZIQ0lfRW5oYW5jZWRfRmx1c2hfQ29tcGxldGVfRXZlbnQodm9pZCAqIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QnRhbXBUTFZIQ0lfRW5oYW5jZWRfRmx1c2hfQ29tcGxldGVfRXZlbnQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90ICpwbkNvbnN1bWVkKQoreworICAgIHZfVThfdCogcFRsdkxlbiA9IDA7CisgICAgdl9VMzJfdCBuQ29uc3VtZWRPbkVudHJ5OworICAgIHZfVTMyX3Qgc3RhdHVzID0gQlRBTVBfUEFSU0VfU1VDQ0VTUzsKKyAgICB2X1UzMl90IG5OZWVkZWQgPSAwVTsKKyAgICB2X1UzMl90IHNUeXBlID0gMFU7CisgICAgdl9VMzJfdCBzTGVuID0gMFU7CisgICAgc1R5cGUgPSAxOworICAgIHNMZW4gPSAxOworICAgICAgICAvLyBzYW5pdHkgY2hlY2tpbmcKKyAgICBpZiggcEN0eCA9PSBOVUxMIHx8IHBTcmMgPT0gTlVMTCB8fAorICAgICAgICBwQnVmID09IE5VTEwgfHwgcG5Db25zdW1lZCA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiYmFkIGlucHV0IiApOworICAgICAgICByZXR1cm4gQlRBTVBfQ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AgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgQlRBTVBfQU1QX0FTU09DKSwgRlJGTCgidG86XG4iKSk7CisgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIEJUQU1QX0FNUF9BU1NPQyksIHBCdWYsIG5CdWYpOworICAgIH0KKyMgICBlbmRpZiAvLyBCVEFNUF9EVU1QX0ZSQU1FUworICAgIHJldHVybiBzdGF0dXM7CisKK30gLyogRW5kIGJ0YW1wVW5wYWNrQU1QX0FTU09DLiAqLworCisKK3N0YXRpYyB2X1UzMl90IFBhY2tUbHZDb3JlKHZvaWQgKiBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgKnBuQ29uc3VtZWQsCisgICAgICAgICAgICAgICAgICAgICAgICB0VExWRGVmbiAgVExWc1tdLAorICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAqcGlkeCkKK3sKKyAgICB0VExWRGVmbiAgICAgKnBUbHY7CisgICAgdEZSQU1FU19CT09MICpwZkZvdW5kOworICAgIHZfVThfdCAqcEJ1ZlJlbWFpbmluZzsKKyAgICB2X1UzMl90IG5CdWZSZW1haW5pbmcsIHN0YXR1cywgc3RhdHVzMiwgbGVuOworCisgICAgQlRBTVBfUEFSQU1FVEVSX0NIRUNLMihwU3JjLCBwQnVmLCBuQnVmLCBwbkNvbnN1bWVkKTsKKworICAgICh2b2lkKXBDdHg7CisgICAgc3RhdHVzID0gQlRBTVBfUEFSU0VfU1VDQ0VTUzsKKyAgICBzdGF0dXMyID0gQlRBTVBfUEFSU0VfU1VDQ0VTUzsKKyAgICBwQnVmUmVtYWluaW5nID0gcEJ1ZjsKKyAgICBuQnVmUmVtYWluaW5nID0gbkJ1ZjsKKworICAgIHBUbHYgPSAmKCBUTFZzWzBdICk7CisgICAgd2hpbGUgKCAweGZmZmYgIT0gcFRsdi0+aWQgKQorICAgIHsKKyAgICAgICAgcGZGb3VuZCA9ICh0RlJBTUVTX0JPT0wqKShwU3JjICsgcFRsdi0+b2Zmc2V0ICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVGx2LT5wcmVzZW5jZU9mZnNldCk7CisgICAgICAgIGlmICggKnBmRm91bmQgJiYgcFRsdi0+bWluU2l6ZSA+IG5CdWZSZW1haW5pbmcgKQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMyhwQ3R4LCBGUkxPR0UsIEZSRkwoIlRoZSBUTFYgJXMgdGFrZXMgYXQgbGVhc3QiCisgICAgICAgICAgICAgICAgIiAlZCBieXRlcywgYnV0IHRoZXJlIGFyZSBvbmx5ICVkIGxlZnQgaW4gdGhlIGJ1ZmZlci4iCisgICAgICAgICAgICAgICAgIlxuIiksIHBUbHYtPm5hbWUsIHBUbHYtPm1pblNpemUsIG5CdWZSZW1haW5pbmcpOworICAgICAgICAgICAgcmV0dXJuIEJUQU1QX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgfQorCisgICAgICAgIGxlbiA9IDBVOworCisgICAgICAgIGlmICggKnBmRm91bmQgKSB7CisgICAgICAgIHN3aXRjaCAoIHBUbHYtPnNpZyApCisgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZBTVBfQXNzb2NfQ29ubmVjdGVkX0NoYW5uZWw6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkFNUF9Bc3NvY19Db25uZWN0ZWRfQ2hhbm5lbF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZBTVBfQXNzb2NfQ29ubmVjdGVkX0NoYW5uZWwqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZBTVBfQXNzb2NfTUFDX0FkZHI6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkFNUF9Bc3NvY19NQUNfQWRkcl90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZBTVBfQXNzb2NfTUFDX0FkZHIqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZBTVBfQXNzb2NfUEFMX0NhcGFiaWxpdGllczoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrVGx2QU1QX0Fzc29jX1BBTF9DYXBhYmlsaXRpZXNfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWQU1QX0Fzc29jX1BBTF9DYXBhYmlsaXRpZXMqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZBTVBfQXNzb2NfUEFMX1ZlcnNpb246CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkFNUF9Bc3NvY19QQUxfVmVyc2lvbl90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZBTVBfQXNzb2NfUEFMX1ZlcnNpb24qICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZBTVBfQXNzb2NfUHJlZmVycmVkX0NoYW5uZWxfTGlzdDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrVGx2QU1QX0Fzc29jX1ByZWZlcnJlZF9DaGFubmVsX0xpc3RfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWQU1QX0Fzc29jX1ByZWZlcnJlZF9DaGFubmVsX0xpc3QqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZGbG93X1NwZWM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkZsb3dfU3BlY190KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZGbG93X1NwZWMqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfQWNjZXB0X0xvZ2ljYWxfTGlua19DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkhDSV9BY2NlcHRfTG9naWNhbF9MaW5rX0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfQWNjZXB0X0xvZ2ljYWxfTGlua19DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfQWNjZXB0X1BoeXNpY2FsX0xpbmtfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tUbHZIQ0lfQWNjZXB0X1BoeXNpY2FsX0xpbmtfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9BY2NlcHRfUGh5c2ljYWxfTGlua19DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfQ2hhbm5lbF9TZWxlY3RlZF9FdmVudDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrVGx2SENJX0NoYW5uZWxfU2VsZWN0ZWRfRXZlbnRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX0NoYW5uZWxfU2VsZWN0ZWRfRXZlbnQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfQ29tbWFuZF9Db21wbGV0ZV9FdmVudDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrVGx2SENJX0NvbW1hbmRfQ29tcGxldGVfRXZlbnRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX0NvbW1hbmRfQ29tcGxldGVfRXZlbnQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfQ29tbWFuZF9TdGF0dXNfRXZlbnQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkhDSV9Db21tYW5kX1N0YXR1c19FdmVudF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfQ29tbWFuZF9TdGF0dXNfRXZlbnQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfQ3JlYXRlX0xvZ2ljYWxfTGlua19DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkhDSV9DcmVhdGVfTG9naWNhbF9MaW5rX0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfQ3JlYXRlX0xvZ2ljYWxfTGlua19DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfQ3JlYXRlX1BoeXNpY2FsX0xpbmtfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tUbHZIQ0lfQ3JlYXRlX1BoeXNpY2FsX0xpbmtfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9DcmVhdGVfUGh5c2ljYWxfTGlua19DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfRGF0YV9CdWZmZXJfT3ZlcmZsb3dfRXZlbnQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkhDSV9EYXRhX0J1ZmZlcl9PdmVyZmxvd19FdmVudF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfRGF0YV9CdWZmZXJfT3ZlcmZsb3dfRXZlbnQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfRGlzY29ubmVjdF9Mb2dpY2FsX0xpbmtfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tUbHZIQ0lfRGlzY29ubmVjdF9Mb2dpY2FsX0xpbmtfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9EaXNjb25uZWN0X0xvZ2ljYWxfTGlua19DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfRGlzY29ubmVjdF9Mb2dpY2FsX0xpbmtfQ29tcGxldGVfRXZlbnQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkhDSV9EaXNjb25uZWN0X0xvZ2ljYWxfTGlua19Db21wbGV0ZV9FdmVudF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfRGlzY29ubmVjdF9Mb2dpY2FsX0xpbmtfQ29tcGxldGVfRXZlbnQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfRGlzY29ubmVjdF9QaHlzaWNhbF9MaW5rX0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrVGx2SENJX0Rpc2Nvbm5lY3RfUGh5c2ljYWxfTGlua19DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX0Rpc2Nvbm5lY3RfUGh5c2ljYWxfTGlua19DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfRGlzY29ubmVjdF9QaHlzaWNhbF9MaW5rX0NvbXBsZXRlX0V2ZW50OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tUbHZIQ0lfRGlzY29ubmVjdF9QaHlzaWNhbF9MaW5rX0NvbXBsZXRlX0V2ZW50X3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9EaXNjb25uZWN0X1BoeXNpY2FsX0xpbmtfQ29tcGxldGVfRXZlbnQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfRmxvd19TcGVjX01vZGlmeV9DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkhDSV9GbG93X1NwZWNfTW9kaWZ5X0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfRmxvd19TcGVjX01vZGlmeV9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfRmxvd19TcGVjX01vZGlmeV9Db21wbGV0ZV9FdmVudDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrVGx2SENJX0Zsb3dfU3BlY19Nb2RpZnlfQ29tcGxldGVfRXZlbnRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX0Zsb3dfU3BlY19Nb2RpZnlfQ29tcGxldGVfRXZlbnQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfRmx1c2hfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tUbHZIQ0lfRmx1c2hfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9GbHVzaF9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfRmx1c2hfT2NjdXJyZWRfRXZlbnQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkhDSV9GbHVzaF9PY2N1cnJlZF9FdmVudF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfRmx1c2hfT2NjdXJyZWRfRXZlbnQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfR2VuZXJpY19BTVBfTGlua19LZXlfTm90aWZpY2F0aW9uX0V2ZW50OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tUbHZIQ0lfR2VuZXJpY19BTVBfTGlua19LZXlfTm90aWZpY2F0aW9uX0V2ZW50X3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9HZW5lcmljX0FNUF9MaW5rX0tleV9Ob3RpZmljYXRpb25fRXZlbnQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfSGFyZHdhcmVfRXJyb3JfRXZlbnQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkhDSV9IYXJkd2FyZV9FcnJvcl9FdmVudF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfSGFyZHdhcmVfRXJyb3JfRXZlbnQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfTG9naWNhbF9MaW5rX0NhbmNlbF9DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkhDSV9Mb2dpY2FsX0xpbmtfQ2FuY2VsX0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfTG9naWNhbF9MaW5rX0NhbmNlbF9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfTG9naWNhbF9MaW5rX0NvbXBsZXRlX0V2ZW50OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tUbHZIQ0lfTG9naWNhbF9MaW5rX0NvbXBsZXRlX0V2ZW50X3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9Mb2dpY2FsX0xpbmtfQ29tcGxldGVfRXZlbnQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfTG9vcGJhY2tfQ29tbWFuZF9FdmVudDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrVGx2SENJX0xvb3BiYWNrX0NvbW1hbmRfRXZlbnRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX0xvb3BiYWNrX0NvbW1hbmRfRXZlbnQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfUGh5c2ljYWxfTGlua19Db21wbGV0ZV9FdmVudDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrVGx2SENJX1BoeXNpY2FsX0xpbmtfQ29tcGxldGVfRXZlbnRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX1BoeXNpY2FsX0xpbmtfQ29tcGxldGVfRXZlbnQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfUGh5c2ljYWxfTGlua19Mb3NzX1dhcm5pbmdfRXZlbnQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkhDSV9QaHlzaWNhbF9MaW5rX0xvc3NfV2FybmluZ19FdmVudF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfUGh5c2ljYWxfTGlua19Mb3NzX1dhcm5pbmdfRXZlbnQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfUGh5c2ljYWxfTGlua19SZWNvdmVyeV9FdmVudDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrVGx2SENJX1BoeXNpY2FsX0xpbmtfUmVjb3ZlcnlfRXZlbnRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX1BoeXNpY2FsX0xpbmtfUmVjb3ZlcnlfRXZlbnQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfUW9zX1Zpb2xhdGlvbl9FdmVudDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrVGx2SENJX1Fvc19WaW9sYXRpb25fRXZlbnRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX1Fvc19WaW9sYXRpb25fRXZlbnQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfUmVhZF9CZXN0X0VmZm9ydF9GbHVzaF9UaW1lb3V0X0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrVGx2SENJX1JlYWRfQmVzdF9FZmZvcnRfRmx1c2hfVGltZW91dF9DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX1JlYWRfQmVzdF9FZmZvcnRfRmx1c2hfVGltZW91dF9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfUmVhZF9CdWZmZXJfU2l6ZV9DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkhDSV9SZWFkX0J1ZmZlcl9TaXplX0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfUmVhZF9CdWZmZXJfU2l6ZV9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfUmVhZF9Db25uZWN0aW9uX0FjY2VwdF9UaW1lb3V0X0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrVGx2SENJX1JlYWRfQ29ubmVjdGlvbl9BY2NlcHRfVGltZW91dF9DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX1JlYWRfQ29ubmVjdGlvbl9BY2NlcHRfVGltZW91dF9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfUmVhZF9EYXRhX0Jsb2NrX1NpemVfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tUbHZIQ0lfUmVhZF9EYXRhX0Jsb2NrX1NpemVfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9SZWFkX0RhdGFfQmxvY2tfU2l6ZV9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfUmVhZF9GYWlsZWRfQ29udGFjdF9Db3VudGVyX0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrVGx2SENJX1JlYWRfRmFpbGVkX0NvbnRhY3RfQ291bnRlcl9DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX1JlYWRfRmFpbGVkX0NvbnRhY3RfQ291bnRlcl9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfUmVhZF9GbG93X0NvbnRyb2xfTW9kZV9DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkhDSV9SZWFkX0Zsb3dfQ29udHJvbF9Nb2RlX0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfUmVhZF9GbG93X0NvbnRyb2xfTW9kZV9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfUmVhZF9MaW5rX1F1YWxpdHlfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tUbHZIQ0lfUmVhZF9M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WZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfUmVhZF9Mb2NhbF9BTVBfSW5mb3JtYXRpb25fQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tUbHZIQ0lfUmVhZF9Mb2NhbF9BTVBfSW5mb3JtYXRpb25fQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9SZWFkX0xvY2FsX0FNUF9JbmZvcm1hdGlvbl9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfUmVhZF9Mb2NhbF9TdXBwb3J0ZWRfQ21kc19DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkhDSV9SZWFkX0xvY2FsX1N1cHBvcnRlZF9DbWRzX0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfUmVhZF9Mb2NhbF9TdXBwb3J0ZWRfQ21kc19DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFN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UbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9SZWFkX0xvZ2ljYWxfTGlua19BY2NlcHRfVGltZW91dF9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfUmVhZF9Mb29wYmFja19Nb2RlX0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrVGx2SENJX1JlYWRfTG9vcGJhY2tfTW9kZV9DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX1JlYWRfTG9vcGJhY2tfTW9kZV9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfUmVhZF9SU1NJX0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrVGx2SENJX1JlYWRfUlNTSV9DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX1JlYWRfUlNTSV9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfUmVzZXRfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tUbHZIQ0lfUmVzZXRfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9SZXNldF9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfUmVzZXRfRmFpbGVkX0NvbnRhY3RfQ291bnRlcl9DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkhDSV9SZXNldF9GYWlsZWRfQ29udGFjdF9Db3VudGVyX0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfUmVzZXRfRmFpbGVkX0NvbnRhY3RfQ291bnRlcl9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfU2V0X0V2ZW50X01hc2tfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tUbHZIQ0lfU2V0X0V2ZW50X01hc2tfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9TZXRfRXZlbnRfTWFza19DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfU2V0X0V2ZW50X01hc2tfUGFnZV8yX0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrVGx2SENJX1NldF9FdmVudF9NYXNrX1BhZ2VfMl9DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX1NldF9FdmVudF9NYXNrX1BhZ2VfMl9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfU2V0X1Nob3J0X1JhbmdlX01vZGVfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tUbHZIQ0lfU2V0X1Nob3J0X1JhbmdlX01vZGVfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9TZXRfU2hvcnRfUmFuZ2VfTW9kZV9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAg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ICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkhDSV9Xcml0ZV9Db25uZWN0aW9uX0FjY2VwdF9UaW1lb3V0X0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfV3JpdGVfQ29ubmVjdGlvbl9BY2NlcHRfVGltZW91dF9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfV3JpdGVfRmxvd19Db250cm9sX01vZGVfQ21kOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzMiA9ICggKHBmblBhY2tUbHZIQ0lfV3JpdGVfRmxvd19Db250cm9sX01vZGVfQ21kX3QpKHBUbHYtPnBmbikgKShwQ3R4LCAoIHRCdGFtcFRMVkhDSV9Xcml0ZV9GbG93X0NvbnRyb2xfTW9kZV9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfV3JpdGVfTGlua19TdXBlcnZpc2lvbl9UaW1lb3V0X0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrVGx2SENJX1dyaXRlX0xpbmtfU3VwZXJ2aXNpb25fVGltZW91dF9DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX1dyaXRlX0xpbmtfU3VwZXJ2aXNpb25fVGltZW91dF9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfV3JpdGVfTG9jYXRpb25fRGF0YV9DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkhDSV9Xcml0ZV9Mb2NhdGlvbl9EYXRhX0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfV3JpdGVfTG9jYXRpb25fRGF0YV9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfV3JpdGVfTG9naWNhbF9MaW5rX0FjY2VwdF9UaW1lb3V0X0NtZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czIgPSAoIChwZm5QYWNrVGx2SENJX1dyaXRlX0xvZ2ljYWxfTGlua19BY2NlcHRfVGltZW91dF9DbWRfdCkocFRsdi0+cGZuKSApKHBDdHgsICggdEJ0YW1wVExWSENJX1dyaXRlX0xvZ2ljYWxfTGlua19BY2NlcHRfVGltZW91dF9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfV3JpdGVfTG9vcGJhY2tfTW9kZV9DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkhDSV9Xcml0ZV9Mb29wYmFja19Nb2RlX0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfV3JpdGVfTG9vcGJhY2tfTW9kZV9DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1BhY2tUbHZIQ0lfV3JpdGVfUmVtb3RlX0FNUF9BU1NPQ19DbWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMyID0gKCAocGZuUGFja1RsdkhDSV9Xcml0ZV9SZW1vdGVfQU1QX0FTU09DX0NtZF90KShwVGx2LT5wZm4pICkocEN0eCwgKCB0QnRhbXBUTFZIQ0lfV3JpdGVfUmVtb3RlX0FNUF9BU1NPQ19DbWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1czIpIHN0YXR1cyB8PSBzdGF0dXMyOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSTE9HRSwgRlJGTCgiSU5URVJOQUwgRVJST1ItLSBJIGRvbid0ICIKKyAgICAgICAgICAgICAg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ciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKyNpZm5kZWYgV0xBTl9RQ1RfRFhFX0gKKyNkZWZpbmUgV0xBTl9RQ1RfRFhFX0gKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAKKyAgQGZpbGUgIHdsYW5fcWN0X2R4ZS5oCisgIAorICBAYnJpZWYgCisgICAgICAgICAgICAgICAKKyAgIFRoaXMgZmlsZSBjb250YWlucyB0aGUgZXh0ZXJuYWwgQVBJIGV4cG9zZWQgYnkgdGhlIHdsYW4gZGF0YSB0cmFuc2ZlciBhYnN0cmFjdGlvbiBsYXllciBtb2R1bGUuCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisgICRIZWFkZXI6JCAkRGF0ZVRpbWU6ICQgJEF1dGhvcjogJAorCisKK3doZW4gICAgICAgICAgIHdobyAgICAgICAgd2hhdCwgd2hlcmUsIHdoeQorLS0tLS0tLS0gICAgLS0tICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorMDgvMDMvMTAgICAgc2NoYW5nICAgICAgQ3JlYXRlZCBtb2R1bGUuCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgSU5DTFVERSBGSUxFUyBGT1IgTU9EVUxFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICogSW5jbHVkZSBGaWxlcworICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisjaW5jbHVkZSAid2xhbl9xY3RfcGFsX2FwaS5oIgorI2luY2x1ZGUgIndsYW5fcWN0X3BhbF9wYWNrZXQuaCIKKyNpbmNsdWRlICJ3bGFuX3FjdF9wYWxfc3RhdHVzLmgiCisjaW5jbHVkZSAid2xhbl9xY3RfcGFsX3R5cGUuaCIKKyNpbmNsdWRlICJ3bGFuX3FjdF9wYWxfbXNnLmgiCisjaW5jbHVkZSAid2xhbl9xY3RfcGFsX3N5bmMuaCIKKyNpbmNsdWRlICJ3bGFuX3FjdF93ZGlfZHRzLmgiCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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QVRFX01BWAorfSBXTEFORFhFX1JpdmFQb3dlclN0YXRlVHlwZTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBUeXBlIE5hbWUKKyAgICAgIFdMQU5EWEVfUnhGcmFtZVJlYWR5Q2JUeXBlIAorCisgIEAgIERlc2NyaXB0aW9uIAorICAgICAgIFJYIEZyYW1lIFJlYWR5IGluZGljYXRpb24gQ0IKKworICBAICBQYXJhbWV0ZXJzCisgICAgICAgICBwVm9pZCAgICAgICAgIHBBZGFwdGVyIDogRHJpdmVyIGdsb2JhbCBjb250cm9sIGJsb2NrIHBvaW50ZXIKKyAgICAgICAgIHBhbFBhY2tldCAgICAgcFJYRnJhbWVQdHIgOiBSZWNlaXZlZCBGcmFtZSBQb2ludGVyCisgICAgICAgICBwVm9pZCAgICAgICAgIHVzZXJDdHh0IDogRFRTIHVzZXIgY29udGVjdCBwb2ludGVyCisKKyAgQCAgUmV0dXJuCisgICAgICAgIHdwdF9zdGF0dXMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit0eXBlZGVmIFdEVFNfUnhGcmFtZVJlYWR5Q2JUeXBlIFdMQU5EWEVfUnhGcmFtZVJlYWR5Q2JUeXBlOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEAgIFR5cGUgTmFtZQorICAgICAgIFdMQU5EWEVfVHhDb21wbGV0ZUNiVHlwZSAKKworICBAICBEZXNjcmlwdGlvbiAKKyAgICAgIFRYIGNvbXBsZXRlIGluZGljYXRpb24gQ0IKKworICBAICBQYXJhbWV0ZXJzCisgICAgICAgICBwVm9pZCAgICAgIHBBZGFwdGVyIDogRHJpdmVyIGdsb2JhbCBjb250cm9sIGJsb2NrIHBvaW50ZXIKKyAgICAgICAgIHZvaWQgICAgICAgcFRYRnJhbWVQdHIgOiBDb21wbGV0ZWQgVFggRnJhbWUgUG9pbnRlcgorICAgICAgICAgcFZvaWQgICAgICB1c2VyQ3R4dCA6IERUUyB1c2VyIGNvbnRlY3QgcG9pbnRlcgorCisgIEAgIFJldHVybgorICAgICAgIHdwdF9zdGF0dXMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit0eXBlZGVmIFdEVFNfVHhDb21wbGV0ZUNiVHlwZSBXTEFORFhFX1R4Q29tcGxldGVDYlR5cGU7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQCAgVHlwZSBOYW1lCisgICAgICBXTEFORFhFX0xvd1Jlc291cmNlQ2JUeXBlIAorCisgIEAgIERlc2NyaXB0aW9uIAorICAgICAgIERYRSBMb3cgcmVzb3VyY2UgaW5kaWNhdGlvbiBDQgorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIHBWb2lkICAgICAgcEFkYXB0ZXIgOiBEcml2ZXIgZ2xvYmFsIGNvbnRyb2wgYmxvY2sgcG9pbnRlcgorICAgICAgQk9PTCAgICAgIGxvd1Jlc291cmNlQ29uZGl0aW9uIDogRFhFIGxvdyByZXNvdXJjZSBvciBub3QKKyAgICAgIHBWb2lkICAgICAgdXNlckN0eHQgOiBEVFMgdXNlciBjb250ZWN0IHBvaW50ZXIKKworICBAICBSZXR1cm4KKyAgICAgIHdwdF9zdGF0dXMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit0eXBlZGVmIFdEVFNfTG93UmVzb3VyY2VDYlR5cGUgV0xBTkRYRV9Mb3dSZXNvdXJjZUNiVHlwZTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBUeXBlIE5hbWUKKyAgV0xBTkRYRV9NYlJlY2VpdmVNc2dDYlR5cGUKKworICBAICBEZXNjcmlwdGlvbgorICBEWEUgTWFpbGJveCBtZXMgcmVjZWl2ZSBpbmRpYWNhdGlvbgorCisgIEAgIFBhcmFtZXRlcnMKKyAgdm9pZAorCisgIEAgIFJldHVybgorICB2b2lkCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordHlwZWRlZiBXRFRTX01iUmVjZWl2ZU1zZ1R5cGUgV0xBTkRYRV9NYlJlY2VpdmVNc2dDYlR5cGU7CisKK3R5cGVkZWYgV0RUU19SeExvZ0RvbmVUeXBlIFdMQU5EWEVfUnhMb2dEb25lVHlwZTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBUeXBlIE5hbWUKKyAgICAgIFdMQU5EWEVfU2V0UG93ZXJTdGF0ZUNiVHlwZSAKKworICBAICBEZXNjcmlwdGlvbiAKKyAgICAgICBEWEUgU2V0IHBvd2VyIHN0YXRlIEFDSyBjYWxsYmFjay4gVGhpcyBjYWxsYmFjayBmdW5jdGlvbiBzaG91bGQgYmUKKyAgICAgICBpbnZva2VkIGJ5IHRoZSBEWEUgdG8gbm90aWZ5IFdESSB0aGF0IHNldCBwb3dlciBzdGF0ZSByZXF1ZXN0IGlzIGNvbXBsZXRlCisKKyAgQCAgUGFyYW1ldGVycworICAgICAgc3RhdHVzICAgIHN0YXR1cyBvZiB0aGUgc2V0IG9wZXJhdGlvbgorICAgICAgcFVzZXJEYXRhIENvb2tpZSB0aGF0IHNob3VsZCBiZSBwYXNzZWQgYmFjayB0byB0aGUgY2FsbGVyIGFsb25nIHdpdGggdGhlCisgICAgICAgICAgICAgICAgY2FsbGJhY2suCisKKyAgQCAgUmV0dXJuCisgICAgICBOb25lCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordHlwZWRlZiBXRFRTX1NldFBTQ2JUeXBlICBXTEFORFhFX1NldFBvd2VyU3RhdGVDYlR5cGU7CisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICpGdW5jdGlvbiBkZWNsYXJhdGlvbnMgYW5kIGRvY3VtZW5hdGlvbgorICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQCAgRnVuY3Rpb24gTmFtZSAKKyAgICAgIFdMQU5EWEVfT3BlbgorCisgIEAgIERlc2NyaXB0aW9uIAorICAgICAgT3BlbiBob3N0IERYRSBkcml2ZXIsIGFsbG9jYXRlIERYRSByZXNvdXJjZXMKKyAgICAgIEFsbG9jYXRlLCBEWEUgbG9jYWwgY29udHJvbCBibG9jaywgRFhFIGRlc2NyaXB0b3IgcG9vbCwgRFhFIGRlc2NyaXB0b3IgY29udHJvbCBibG9jayBwb29sCisKKyAgQCAgUGFyYW1ldGVycworICAgICAgcFZvaWQgICAgICBwQWRhcHRlciA6IERyaXZlciBnbG9iYWwgY29udHJvbCBibG9jayBwb2ludGVyCisKKyAgQCAgUmV0dXJuCisgICAgICBwVm9pZCBEWEUgbG9jYWwgbW9kdWxlIGNvbnRyb2wgYmxvY2sgcG9pbnRlcgorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgKldMQU5EWEVfT3BlbgorKAorICAgdm9pZAorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lIAorICAgICAgV0xBTkRYRV9DbGllbnRSZWdpc3RyYXRpb24KKworICBAICBEZXNjcmlwdGlvbiAKKyAgICAgIE1ha2UgY2FsbGJhY2sgZnVuY3Rpb25zIHJlZ2lzdHJhdGlvbiBpbnRvIERYRSBkcml2ZXIgZnJvbSBEWEUgZHJpdmVyIGNsaWVudAorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIHBWb2lkICAgICAgICAgICAgICAgICAgICAgICBwRFhFQ29udGV4dCA6IERYRSBtb2R1bGUgY29udHJvbCBibG9jaworICAgICAgV0RUU19DbGllbnRDYWxsYmFja3MgICAgICAgIFdEVFNDYiA6IENhbGxiYWNrcyB0byBXRFRTIHRvIGluZGljYXRlIHZhcmlvdXMgZXZlbnRzCisgICAgICB2b2lkICAgICAgICAgICAgICAgICAgICAgICAqdXNlckNvbnRleHQgOiBEWEUgQ2xpZW5udCBjb250cm9sIGJsb2NrCisKKyAgQCAgUmV0dXJuCisgICAgICB3cHRfc3RhdHVzCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLword3B0X3N0YXR1cyBXTEFORFhFX0NsaWVudFJlZ2lzdHJhdGlvbgorKAorICAgdm9pZCAgICAgICAgICAgICAgICAgICAgICAgKnBEWEVDb250ZXh0LAorICAgV0RUU19DbGllbnRDYWxsYmFja3MgICAgICAgV0RUU0NiLAorICAgdm9pZCAgICAgICAgICAgICAgICAgICAgICAgKnVzZXJDb250ZXh0CispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEAgIEZ1bmN0aW9uIE5hbWUgCisgICAgICBXTEFORFhFX1N0YXJ0CisKKyAgQCAgRGVzY3JpcHRpb24gCisgICAgICBTdGFydCBIb3N0IERYRSBkcml2ZXIKKyAgICAgIEluaXRpYWxpemUgRFhFIGNoYW5uZWxzIGFuZCBzdGFydCBjaGFubmVsCisKKyAgQCAgUGFyYW1ldGVycworICAgICAgcFZvaWQgICAgICAgICAgICAgICAgICAgICAgIHBEWEVDb250ZXh0IDogRFhFIG1vZHVsZSBjb250cm9sIGJsb2NrCisKKyAgQCAgUmV0dXJuCisgICAgICB3cHRfc3RhdHVzCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLword3B0X3N0YXR1cyBXTEFORFhFX1N0YXJ0CisoCisgICB2b2lkICAqcERYRUNvbnRleHQKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQCAgRnVuY3Rpb24gTmFtZSAKKyAgICAgIFdMQU5EWEVfVFhGcmFtZQorCisgIEAgIERlc2NyaXB0aW9uIAorICAgICAgVHJpZ2dlciBmcmFtZSB0cmFuc21pdCBmcm9tIGhvc3QgdG8gUklWQQorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIHBWb2lkICAgICAgICAgICAgcERYRUNvbnRleHQgOiBEWEUgQ29udHJvbCBCbG9jaworICAgICAgd3B0X3BhY2tldCAgICAgICBwUGFja2V0IDogdHJhbnNtaXQgcGFja2V0IHN0cnVjdHVyZQorICAgICAgV0RUU19DaGFubmVsVHlwZSBjaGFubmVsIDogVFggY2hhbm5lbAorCisgIEAgIFJldHVybgorICAgICAgd3B0X3N0YXR1cworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3dwdF9zdGF0dXMgV0xBTkRYRV9UeEZyYW1lCisoCisgICB2b2lkICAgICAgICAgICAgICAgICAqcERYRUNvbnRleHQsCisgICB3cHRfcGFja2V0ICAgICAgICAgICAqcFBhY2tldCwKKyAgIFdEVFNfQ2hhbm5lbFR5cGUgICAgICBjaGFubmVsCispOworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQCAgRnVuY3Rpb24gTmFtZSAKKyAgICAgIFdMQU5EWEVfQ29tcGxldGVUWAorCisgIEAgIERlc2NyaXB0aW9uIAorICAgICAgSW5mb3JtcyBEWEUgdGhhdCB0aGUgY3VycmVudCBzZXJpZXMgb2YgVHggcGFja2V0cyBpcyBjb21wbGV0ZQorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIHBEWEVDb250ZXh0IDogRFhFIENvbnRyb2wgQmxvY2sKKyAgICAgIHVjVHhSZXNSZXEgICAgICAgICAgVFggcmVzb3VyY2UgbnVtYmVyIHJlcXVpcmVkIGJ5IFRML1dESQorCisgIEAgIFJldHVybgorICAgICAgd3B0X3N0YXR1cworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3dwdF9zdGF0dXMKK1dMQU5EWEVfQ29tcGxldGVUWAorKAorICB2b2lkKiBwRFhFQ29udGV4dCwKKyAgd3B0X3VpbnQzMiB1Y1R4UmVzUmVxCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEAgIEZ1bmN0aW9uIE5hbWUgCisgICAgICBXTEFORFhFX1N0b3AKKworICBAICBEZXNjcmlwdGlvbiAKKyAgICAgIFN0b3AgRFhFIGNoYW5uZWxzIGFuZCBEWEUgZW5naW5lIG9wZXJhdGlvbnMKKworICBAICBQYXJhbWV0ZXJzCisgICAgICBwVm9pZCAgICAgICAgICAgIHBEWEVDb250ZXh0IDogRFhFIENvbnRyb2wgQmxvY2sKKworICBAICBSZXR1cm4KKyAgICAgIHdwdF9zdGF0dXMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit3cHRfc3RhdHVzIFdMQU5EWEVfU3RvcAorKAorICAgdm9pZCAqcERYRUNvbnRleHQKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQCAgRnVuY3Rpb24gTmFtZSAKKyAgICAgIFdMQU5EWEVfQ2xvc2UKKworICBAICBEZXNjcmlwdGlvbiAKKyAgICAgIENsb3NlIERYRSBjaGFubmVscworICAgICAgRnJlZSBEWEUgcmVsYXRlZCByZXNvdXJjZXMKKyAgICAgIERYRSBkZXNjcmlwdG9yIGZyZWUKKyAgICAgIERlc2NyaXB0b3IgY29udHJvbCBibG9jayBmcmVlCisgICAgICBQcmUgYWxsb2NhdGVkIFJYIGJ1ZmZlciBmcmVlCisKKyAgQCAgUGFyYW1ldGVycworICAgICAgcFZvaWQgICAgICAgICAgICBwRFhFQ29udGV4dCA6IERYRSBDb250cm9sIEJsb2NrCisKKyAgQCAgUmV0dXJuCisgICAgICB3cHRfc3RhdHVzCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLword3B0X3N0YXR1cyBXTEFORFhFX0Nsb3NlCisoCisgICB2b2lkICpwRFhFQ29udGV4dAorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lIAorICAgICAgV0xBTkRYRV9UcmlnZ2VyVFgKKworICBAICBEZXNjcmlwdGlvbiAKKyAgICAgIFRCRAorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIHBWb2lkICAgICAgICAgICAgcERYRUNvbnRleHQgOiBEWEUgQ29udHJvbCBCbG9jaworCisgIEAgIFJldHVybgorICAgICAgd3B0X3N0YXR1cworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3dwdF9zdGF0dXMgV0xBTkRYRV9UcmlnZ2VyVFgKKygKKyAgIHZvaWQgKnBEWEVDb250ZXh0CispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEAgIEZ1bmN0aW9uIE5hbWUgCisgICAgICBXTEFORFhFX1NldFBvd2VyU3RhdGUKKworICBAICBEZXNjcmlwdGlvbiAKKyAgICAgIEZyb20gQ2xpZW50IGxldCBEWEUga25vd3Mgd2hhdCBpcyB0aGUgV0xBTiBIVyhSSVZBKSBwb3dlciBzdGF0ZQorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIHBWb2lkICAgICAgICAgICAgICAgICAgICBwRFhFQ29udGV4dCA6IERYRSBDb250cm9sIEJsb2NrCisgICAgICBXTEFORFhFX1Bvd2VyU3RhdGVUeXBlICAgcG93ZXJTdGF0ZQorCisgIEAgIFJldHVybgorICAgICAgd3B0X3N0YXR1cworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3dwdF9zdGF0dXMgV0xBTkRYRV9TZXRQb3dlclN0YXRlCisoCisgICB2b2lkICAgICAgICAgICAgICAgICAgICAqcERYRUNvbnRleHQsCisgICBXRFRTX1Bvd2VyU3RhdGVUeXBlICAgICAgcG93ZXJTdGF0ZSwKKyAgIFdEVFNfU2V0UFNDYlR5cGUgICAgICAgICBjQmFjaworKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lIAorICAgICAgV0xBTkRYRV9HZXRGcmVlVHhEYXRhUmVzTnVtYmVyCisKKyAgQCAgRGVzY3JpcHRpb24gCisgICAgICBSZXR1cm5zIGZyZWUgZGVzY3JpcHRvciBudW1iZXJzIGZvciBUWCBkYXRhIGNoYW5uZWwgKFRYIGhpZ2ggcHJpb3JpdHkpCisKKyAgQCAgUGFyYW1ldGVycworICAgICAgcFZvaWQgICAgICAgICAgICBwRFhFQ29udGV4dCA6IERYRSBDb250cm9sIEJsb2NrCisKKyAgQCAgUmV0dXJuCisgICAgICB3cHRfdWludDMyICAgICAgRnJlZSBkZXNjcmlwdG9yIG51bWJlciBvZiBUWCBoaWdoIHByaSBjaAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3dwdF91aW50MzIgV0xBTkRYRV9HZXRGcmVlVHhEYXRhUmVzTnVtYmVyCisoCisgICB2b2lkICpwRFhFQ29udGV4dAorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lCisgICAgV0xBTkRYRV9DaGFubmVsRGVidWcKKworICBAICBEZXNjcmlwdGlvbgorICAgIERpc3BsYXkgRFhFIENoYW5uZWwgZGVidWdnaW5nIGluZm9ybWF0aW9uCisgICAgVXNlciBtYXkgcmVxdWVzdCB0byBkaXNwbGF5IERYRSBjaGFubmVsIHNuYXBzaG90CisgICAgT3IgaWYgaG9zdCBkcml2ZXIgZGV0ZWN0cyBhbnkgYWJub3JtYWwgc3RjdWsgbWF5IGRpc3BsYXkKKworICBAICBQYXJhbWV0ZXJzCisgICAgZGlzcGxheVNuYXBzaG90IDogRGlzcGxheSBEWEUgc25hcHNob3Qgb3B0aW9uCisgICAgZGVidWdGbGFncyAgICAgIDogRW5hYmxlIHN0YWxsIGRldGVjdCBmZWF0dXJlcworICAgICAgICAgICAgICAgICAgICAgIGRlZmluZWQgYnkgV1BBTF9EZXZpY2VEZWJ1Z0ZsYWdzCisgICAgICAgICAgICAgICAgICAgICAgVGhlc2UgZmVhdHVyZXMgbWF5IGVmZmVjdAorICAgICAgICAgICAgICAgICAgICAgIGRhdGEgcGVyZm9ybWFuY2UuCisKKyAgQCAgUmV0dXJuCisgICAgTk9ORQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBXTEFORFhFX0NoYW5uZWxEZWJ1ZworKAorICAgd3B0X2Jvb2xlYW4gICAgZGlzcGxheVNuYXBzaG90LAorICAgd3B0X3VpbnQ4ICAgICAgZGVidWdGbGFncworKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lCisgICAgV0xBTkRYRV9LaWNrRHhlCisKKyAgQCAgRGVzY3JpcHRpb24KKyAgICBLaWNrIER4ZSB3aGVuIEhERCBUWCB0aW1lb3V0IGhhcHBlbgorCisgIEAgIFBhcmFtZXRlcnMKKyAgICBOT05FCisKKyAgQCAgUmV0dXJuCisgICAgTk9ORQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBXTEFORFhFX0tpY2tEeGUKKygKKyAgIHZvaWQKKyk7CisKK3dwdF91aW50MzIgV0xBTkRYRV9TZXR1cExvZ1RyYW5zZmVyCisoC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YW4gZGF0YSB0cmFuc2ZlciBhYnN0cmFjdGlvbiBsYXllciBtb2R1bGUuCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisgICRIZWFkZXI6JCAkRGF0ZVRpbWU6ICQgJEF1dGhvcjogJAorCisKK3doZW4gICAgICAgICAgIHdobyAgICAgICAgd2hhdCwgd2hlcmUsIHdoeQorLS0tLS0tLS0gICAgLS0tICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorMDgvMDMvMTAgICAgc2NoYW5nICAgICAgQ3JlYXRlZCBtb2R1bGUuCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgSU5DTFVERSBGSUxFUyBGT1IgTU9EVUxFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qLS0tLS0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bm5lbEVudHJ5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2hhbm5lbCBzcGVjaWZpYyBjb250cm9sIGJsb2NrCisKKyAgQCAgUmV0dXJuCisgICAgICB3cHRfc3RhdHVzCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitzdGF0aWMgd3B0X3N0YXR1cyBkeGVDaGFubmVsTW9uaXRvcgorKAorICAgY2hhciAgICAgICAgICAgICAgICAgICAgKm1vbml0b3JEZXNjcmlwdGlvbiwKKyAgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgICpjaGFubmVsRW50cnksCisgICB3cHRfbG9nX2RhdGFfc3RhbGxfY2hhbm5lbF90eXBlICpjaGFubmVsTG9nCispCit7CisgICB3cHRfc3RhdHVzICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUzsKKworICAgaWYoKE5VTEwgPT0gbW9uaXRvckRlc2NyaXB0aW9uKSB8fCAoTlVMTCA9PSBjaGFubmVsRW50cnkpKQorICAgeworICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAiSU5WQUxJRCBJbnB1dCBBUkciKTsKKyAgICAgIHJldHVybiBlV0xBTl9QQUxfU1RBVFVTX0VfSU5WQUw7CisgICB9CisKKyAgIGlmKGNoYW5uZWxFbnRyeS0+Y2hhbm5lbFR5cGUgPj0gV0RUU19DSEFOTkVMX01BWCkKKyAgIHsKKyAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgIklOVkFMSUQgQ2hhbm5lbCB0eXBlIik7CisgICAgICByZXR1cm4gZVdMQU5fUE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ICVkLCBSREMgJWQsIFRGQyAlZCIsCisgICAgICAgICAgICAgY2hhbm5lbFR5cGVbY2hhbm5lbEVudHJ5LT5jaGFubmVsVHlwZV0sCisgICAgICAgICAgICAgY2hhbm5lbEVudHJ5LT5udW1GcmVlRGVzYywKKyAgICAgICAgICAgICBjaGFubmVsRW50cnktPm51bVJzdmREZXNjLAorICAgICAgICAgICAgIGNoYW5uZWxFbnRyeS0+bnVtVG90YWxGcmFtZSk7CisKKyAgIGlmKGNoYW5uZWxMb2cpCisgICB7CisgICAgICBjaGFubmVsTG9nLT5udW1EZXNjICAgICAgID0gY2hhbm5lbEVudHJ5LT5udW1EZXNjOworICAgICAgY2hhbm5lbExvZy0+bnVtRnJlZURlc2MgICA9IGNoYW5uZWxFbnRyeS0+bnVtRnJlZURlc2M7CisgICAgICBjaGFubmVsTG9nLT5udW1Sc3ZkRGVzYyAgID0gY2hhbm5lbEVudHJ5LT5udW1Sc3ZkRGVzYzsKKyAgICAgIGNoYW5uZWxMb2ctPmhlYWREZXNjT3JkZXIgPSBjaGFubmVsRW50cnktPmhlYWRDdHJsQmxrLT5jdHJsQmxrT3JkZXI7CisgICAgICBjaGFubmVsTG9nLT50YWlsRGVzY09yZGVyID0gY2hhbm5lbEVudHJ5LT50YWlsQ3RybEJsay0+Y3RybEJsa09yZGVyOworICAgfQorCisgICByZXR1cm4gc3RhdHVzOworfQorCisjaWZkZWYgV0xBTkRYRV9ERUJVR19NRU1PUllfRFVNUAorLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lIAorICAgICAgZHhlTWVtb3J5RHVtcAorCisgIEAgIERlc2NyaXB0aW9uIAorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgICpjaGFubmVsRW50cnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGFubmVsIHNwZWNpZmljIGNvbnRyb2wgYmxvY2sKKworICBAICBSZXR1cm4KKyAgICAgIHdwdF9zdGF0dXMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3N0YXRpYyB3cHRfc3RhdHVzIGR4ZU1lbW9yeUR1bXAKKygKKyAgIHdwdF91aW50OCAgICAqZHVtcFBvaW50ZXIsCisgICB3cHRfdWludDMyICAgIGR1bXBTaXplLAorICAgY2hhciAgICAgICAgICpkdW1wVGFyZ2V0CispCit7CisgICB3cHRfc3RhdHVzICAgICAgICAgICAgICAgIHN0YXR1cyAgICAgID0gZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICBudW1CeXRlcyAgICA9IDA7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgIGlkeDsKKworICAgaWYoKE5VTEwgPT0gZHVtcFBvaW50ZXIpIHx8CisgICAgICAoTlVMTCA9PSBkdW1wVGFyZ2V0KSkKKyAgIHsKKyAgICAgIHJldHVybiBzdGF0dXM7CisgICB9CisKKyAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgIisrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysiKTsKKyAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgIiVzIExvY2F0aW9uIDB4JXgsIFNpemUgJWQiLCBkdW1wVGFyZ2V0LCBkdW1wUG9pbnRlciwgZHVtcFNpemUpOworCisgICBudW1CeXRlcyA9IGR1bXBTaXplICUgVF9XTEFORFhFX01FTURVTVBfQllURV9QRVJfTElORTsKKyAgIGZvcihpZHggPSAwOyBpZHggPCBkdW1wU2l6ZTsgaWR4KyspCisgICB7CisgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICAgICIweCUyeCAiLCBkdW1wUG9pbnRlcltpZHhdKTsKKyAgICAgIGlmKDAgPT0gKChpZHggKyAxKSAlIFRfV0xBTkRYRV9NRU1EVU1QX0JZVEVfUEVSX0xJTkUpKQorICAgICAgeworICAgICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csICJcbiIpOworICAgICAgfQorICAgfQorICAgaWYoMCAhPSBudW1CeXRlcykKKyAgIHsKKyAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0lORk9fTE9XLCAiXG4iKTsKKyAgIH0KKyAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgIisrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysiKTsKKworICAgcmV0dXJuIHN0YXR1czsKK30KKyNlbmRpZiAvKiBXTEFORFhFX0RFQlVHX01FTU9SWV9EVU1QICovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQCAgRnVuY3Rpb24gTmFtZSAKKyAgICAgIGR4ZURlc2NyaXB0b3JEdW1wCisKKyAgQCAgRGVzY3JpcHRpb24gCisKKyAgQCAgUGFyYW1ldGVycworICAgICAgV0xBTkRYRV9DaGFubmVsQ0JUeXBlICAgKmNoYW5uZWxFbnRyeQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENoYW5uZWwgc3BlY2lmaWMgY29udHJvbCBibG9jaworCisgIEAgIFJldHVybgorICAgICAgd3B0X3N0YXR1cworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLword3B0X3N0YXR1cyBkeGVEZXNjcmlwdG9yRHVtcAorKAorICAgV0xBTkRYRV9DaGFubmVsQ0JUeXBlICAgKmNoYW5uZWxFbnRyeSwKKyAgIFdMQU5EWEVfRGVzY1R5cGUgICAgICAgICp0YXJnZXREZXNjLAorICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgIGZyYWdtZW50T3JkZXIKKykKK3sKKyAgIHdwdF9zdGF0dXMgICAgICAgICAgICAgICAgc3RhdHVzICAgICAgPSBlV0xBTl9QQUxfU1RBVFVTX1NVQ0NFU1M7CisKKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAiKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKyIpOworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAiRGVzY3JpcHRvciBEdW1wIGZvciBjaGFubmVsICVzLCAlZCAvICVkIGZyYWdtZW50IiwKKyAgICAgICAgICAgICAgICAgICBjaGFubmVsVHlwZVtjaGFubmVsRW50cnktPmNoYW5uZWxUeXBlXSwKKyAgICAgICAgICAgICAgICAgICBmcmFnbWVudE9yZGVyICsgMSwKKyAgICAgICAgICAgICAgICAgICBjaGFubmVsRW50cnktPm51bUZyYWdtZW50Q3VycmVudENoYWluKTsKKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAiQ1RSTCBXT1JEIDB4JXgsIFRyYW5zZmVyU2l6ZSAlZCIsCisgICAgICAgICAgICAgICAgICAgV0xBTkRYRV9VMzJfU1dBUF9FTkRJQU4odGFyZ2V0RGVzYy0+ZGVzY0N0cmwuY3RybCksCisgICAgICAgICAgICBXTEFORFhFX1UzMl9TV0FQX0VORElBTih0YXJnZXREZXNjLT54ZnJTaXplKSk7CisgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICJTUkMgQUREIDB4JXgsIERTVCBBREQgMHgleCwgTkVYVCBERVNDIDB4JXgiLAorICAgICAgICAgICAgICAgICAgIFdMQU5EWEVfVTMyX1NXQVBfRU5ESUFOKHRhcmdldERlc2MtPmR4ZWRlc2MuZHhlX3Nob3J0X2Rlc2Muc3JjTWVtQWRkckwpLAorICAgICAgICAgICAgICAgICAgIFdMQU5EWEVfVTMyX1NXQVBfRU5ESUFOKHRhcmdldERlc2MtPmR4ZWRlc2MuZHhlX3Nob3J0X2Rlc2MuZHN0TWVtQWRkckwpLAorICAgICAgICAgICAgICAgICAgIFdMQU5EWEVfVTMyX1NXQVBfRU5ESUFOKHRhcmdldERlc2MtPmR4ZWRlc2MuZHhlX3Nob3J0X2Rlc2MucGh5TmV4dEwpKTsKKyAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgIisrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysiKTsKKworICAgcmV0dXJuIHN0YXR1czsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lIAorICAgICAgZHhlQ2hhbm5lbFJlZ2lzdGVyRHVtcAorCisgIEAgIERlc2NyaXB0aW9uIAorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgICpjaGFubmVsRW50cnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGFubmVsIHNwZWNpZmljIGNvbnRyb2wgYmxvY2sKKworICBAICBSZXR1cm4KKyAgICAgIHdwdF9zdGF0dXMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3dwdF9zdGF0dXMgZHhlQ2hhbm5lbFJlZ2lzdGVyRHVtcAorKAorICAgV0xBTkRYRV9DaGFubmVsQ0JUeXBlICAgKmNoYW5uZWxFbnRyeSwKKyAgIGNoYXIgICAgICAgICAgICAgICAgICAgICpkdW1wVGFyZ2V0LAorICAgd3B0X2xvZ19kYXRhX3N0YWxsX2NoYW5uZWxfdHlwZSAqY2hhbm5lbExvZworKQoreworICAgd3B0X3N0YXR1cyAgIHN0YXR1cyAgICAgID0gZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTOworICAgd3B0X3VpbnQzMiAgIGNoU3RhdHVzUmVnLCBjaENvbnRyb2xSZWcsIGNoRGVzY1JlZywgY2hMRGVzY1JlZzsKKworICAgLyogV2hhdGV2ZXIgUklWQSBwb3dlciBjb25kaXRpb24gdHJ5IHRvIHdha2V1cCBSSVZBIHRocm91Z2ggU01TTQorICAgICogVGhpcyB3aWxsIG5vdCBzaW1wbHkgd2FrZXVwIFJJVkEKKyAgICAqIEp1c3QgaW5jYXNlIFRYIG5vdCB3YW50ZWQgc3R1Y2ssIFRyaWdnZXIgVFggYWdhaW4gKi8KKyAgIGR4ZU5vdGlmeVNtc20oZVdMQU5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BlW2NoYW5uZWxFbnRyeS0+Y2hhbm5lbFR5cGVdLAorICAgICAgICAgICAgIGNoQ29udHJvbFJlZywgY2hTdGF0dXNSZWcsIGNoRGVzY1JlZywgY2hMRGVzY1JlZyk7CisKKyAgIGlmKGNoYW5uZWxMb2cpCisgICB7CisgICAgICBjaGFubmVsTG9nLT5jdHJsUmVnVmFsID0gY2hDb250cm9sUmVnOworICAgICAgY2hhbm5lbExvZy0+c3RhdFJlZ1ZhbCA9IGNoU3RhdHVzUmVnOworICAgfQorCisgICByZXR1cm4gc3RhdHVzOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEAgIEZ1bmN0aW9uIE5hbWUgCisgICAgICBkeGVDaGFubmVsQWxsRGVzY0R1bXAKKworICBAICBEZXNjcmlwdGlvbiAKKyAgICAgIER1bXAgYWxsIERYRSBkZXNjcmlwdG9ycyB3aXRoaW4gYXNzaWduZWQgY2hhbm5lOworCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgICpjaGFubmVsRW50cnkKKworICBAICBSZXR1cm4KKyAgICAgIE5PTkUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgZHhlQ2hhbm5lbEFsbERlc2NEdW1wCisoCisgICBXTEFORFhFX0NoYW5uZWxDQlR5cGUgICAqY2hhbm5lbEVudHJ5LAorICAgV0RUU19DaGFubmVsVHlwZSAgICAgICAgIGNoYW5uZWwsCisgICB3cHRfbG9nX2RhdGFfc3RhbGxfY2hhbm5lbF90eXBlICpjaGFubmVsTG9nCispCit7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgY2hhbm5lbExvb3A7CisgICBXTEFORFhFX0Rlc2NDdHJsQmxrVHlwZSAqdGFyZ2V0Q3Ryb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mwuY3RybCAmIFdMQU5EWEVfREVTQ19DVFJMX1ZBTElEOworICAgICAgdGFyZ2V0Q3RybEJsayA9IChXTEFORFhFX0Rlc2NDdHJsQmxrVHlwZSAqKXRhcmdldEN0cmxCbGstPm5leHRDdHJsQmxrOworICAgICAgZm9yKGNoYW5uZWxMb29wID0gMDsgY2hhbm5lbExvb3AgPCBjaGFubmVsRW50cnktPm51bURlc2M7IGNoYW5uZWxMb29wKyspCisgICAgICB7CisgICAgICAgICBjdXJyZW50Q3RybFZhbGlkID0gdGFyZ2V0Q3RybEJsay0+bGlua2VkRGVzYy0+ZGVzY0N0cmwuY3RybCAmIFdMQU5EWEVfREVTQ19DVFJMX1ZBTElEOworICAgICAgICAgaWYoY3VycmVudEN0cmxWYWxpZCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHZhbERlc2NDb3VudCsrOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgaW52YWxEZXNjQ291bnQrKzsKKyAgICAgICAgIH0KKyAgICAgICAgIGlmKGN1cnJlbnRDdHJsVmFsaWQgIT0gcHJldmlvdXNDdHJsVmFsaWQpCisgICAgICAgICB7CisgICAgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAgICIlNWQgOiAweCV4IiwgdGFyZ2V0Q3RybEJsay0+Y3RybEJsa09yZGVyLAorICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0Q3RybEJsay0+bGlua2VkRGVzYy0+ZGVzY0N0cmwuY3RybCk7CisgICAgICAgICB9CisgICAgICAgICBwcmV2aW91c0N0cmxWYWxpZCA9IGN1cnJlbnRDdHJsVmFsaWQ7CisgICAgICAgICB0YXJnZXRDdHJsQmxrID0gKFdMQU5EWEVfRGVzY0N0cmxCbGtUeXBlICopdGFyZ2V0Q3RybEJsay0+bmV4dEN0cmxCbGs7CisgICAgICB9CisgICB9CisKKyAgIGlmKGNoYW5uZWxMb2cpCisgICB7CisgICAgICBjaGFubmVsTG9nLT5udW1WYWxEZXNjICAgPSB2YWxEZXNjQ291bnQ7CisgICAgICBjaGFubmVsTG9nLT5udW1JbnZhbERlc2MgPSBpbnZhbERlc2NDb3VudDsKKyAgIH0KKworICAgcmV0dXJuOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEAgIEZ1bmN0aW9uIE5hbWUKKyAgICAgIGR4ZUVyckhhbmRsZXIKKworICBAICBEZXNjcmlwdGlvbgorICAgICAgRHVtcCBjaGFubmVsIGluZm9ybWF0aW9uIGZvciB3aGljaCBFcnJvciBpbnRlcnJ1cHQgaGFzIG9jY3VyZWQgYW5kCisgICAgICB0cnkgdG8gcmVjb3ZlciBmcm9tIHRoZSBFcnJvcgorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgKmNoYW5uZWxDYgorCisgIEAgIFJldHVybgorICAgICAgd3B0X3N0YXR1czogZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTIGlmIHJlY292ZXJ5IGlzIHBvc3NpYmxlIGFuZAorICAgICAgICAgICAgICAgICAgc3VjY2Vzc2Z1bAorICAgICAgICAgICAgICAgICAgZVdMQU5fUEFMX1NUQVRVU19FX0ZBSUxVUkUgaWYgcmVjb3ZlcnkgaXMgbm90IHBvc3NpYmxlCisgICAgICAgICAgICAgICAgICBvciByZWNvdmVyeSBmYWlscworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3dwdF9zdGF0dXMgZHhlRXJySGFuZGxlcgorKAorICAgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgICAqY2hhbm5lbENiLAorICAgIHdwdF91aW50MzIg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sQ2ItPmhlYWRDdHJsQmxrOworCisgICAgICAgICBmb3IoY2hhbm5lbExvb3AgPSAwOyBjaGFubmVsTG9vcCA8IGNoYW5uZWxDYi0+bnVtRGVzYzsgY2hhbm5lbExvb3ArKykKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGlmICh0YXJnZXRDdHJsQmxrLT5saW5rZWREZXNjUGh5QWRkciA9PSBjaExEZXNjUmVnKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICAgICAgICIlMTFzIDpDSHhfREVTQ0w6IGRlc2MgY3RybCAweCV4LCBzcmMgMHgleCwgZHN0IDB4JXgsIG5leHQgMHgleCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbFR5cGVbY2hhbm5lbENiLT5jaGFubmVsVHlwZV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0Q3RybEJsay0+bGlua2VkRGVzYy0+ZGVzY0N0cmwuY3RybCwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXRDdHJsQmxrLT5saW5rZWREZXNjLT5keGVkZXNjLmR4ZV9zaG9ydF9kZXNjLnNyY01lbUFkZHJMLAorICAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldEN0cmxCbGstPmxpbmtlZERlc2MtPmR4ZWRlc2MuZHhlX3Nob3J0X2Rlc2MuZHN0TWVtQWRkckwsCisgICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0Q3RybEJsay0+bGlua2VkRGVzYy0+ZHhlZGVzYy5keGVfc2hvcnRfZGVzYy5waHlOZXh0TCk7CisKKyAgICAgICAgICAgICAgICB0YXJnZXRDdHJsQmxrID0gKFdMQU5EWEVfRGVzY0N0cmxCbGtUeXBlICopdGFyZ2V0Q3RybEJsay0+bmV4dEN0cmxCbGs7CisKKyAgICAgICAgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAiJTExcyA6TmV4dCBEZXNjOiBkZXNjIGN0cmwgMHgleCwgc3JjIDB4JXgsIGRzdCAweCV4LCBuZXh0IDB4JXgiLAorICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxUeXBlW2NoYW5uZWxDYi0+Y2hhbm5lbFR5cGVdLAorICAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldEN0cmxCbGstPmxpbmtlZERlc2MtPmRlc2NDdHJsLmN0cmwsCisgICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0Q3RybEJsay0+bGlua2VkRGVzYy0+ZHhlZGVzYy5keGVfc2hvcnRfZGVzYy5zcmNNZW1BZGRyTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXRDdHJsQmxrLT5saW5rZWREZXNjLT5keGVkZXNjLmR4ZV9zaG9ydF9kZXNjLmRzdE1lbUFkZHJMLAorICAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldEN0cmxCbGstPmxpbmtlZERlc2MtPmR4ZWRlc2MuZHhlX3Nob3J0X2Rlc2MucGh5TmV4dEwpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdGFyZ2V0Q3RybEJsayA9IChXTEFORFhFX0Rlc2NDdHJsQmxrVHlwZSAqKXRhcmdldEN0cmxCbGstPm5leHRDdHJsQmxrOworICAgICAgICAgfQorICAgICAgICAgd3BhbEZ3RHVtcFJlcSgxNywgMCwgMCwgMCwgMCwgMSk7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGNhc2UgV0xBTkRYRV9FUlJPUl9BQk9SVDoKKyAgICAgIHsKKyAgICAgICAgICB3cHRfdWludDMyIHJlZ1ZhbHVlLCByZWdWYWx1ZU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SX0FERFJFU1MsIHJlZ1ZhbHVlKTsKKworICAgICAgICAgICAgICAvLyBXYWl0IGZvciBmaXJtd2FyZSB0byBjb21wbGV0ZSB0aGUgY2xlYW51cAorICAgICAgICAgICAgICBkbworICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICB3cGFsUmVhZFJlZ2lzdGVyKFdBTE5ERVhfRE1BX0NTUl9BRERSRVNTLCAmcmVnVmFsdWUpOworICAgICAgICAgICAgICAgICAgd3BhbEJ1c3lXYWl0KDUwMDApOworICAgICAgICAgICAgICAgICAgY291bnQrKzsKKyAgICAgICAgICAgICAgICAgIC8vY291bnQgaXMgNjAgYmVjYXVzZSB3YWl0IGlzIGZvciA1IG1zIGFuZCA2MCo1PTMwMG1zCisgICAgICAgICAgICAgICAgICAvL3doaWNoIGlzIHRoZSB0aW1lIFdEIGJhcmsgaGFwcGVucyBpbiBmaXJtd2FyZQorICAgICAgICAgICAgICB9IHdoaWxlKGNvdW50IDwgNjAgJiYgIShyZWdWYWx1ZSAmIFdMQU5EWEVfRE1BX0NTUl9SRUNPVkVSWV9ET05FKSk7CisgICAgICAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEZXIENsZWFudXAgZG9uZSAlMDh4IiwgX19mdW5jX18scmVnVmFsdWUpOworCisgICAgICAgICAgICAgIC8vY2xlYXIgYWxsIHNwYXJlIGJpdHMgaW4gQ1NSCisgICAgICAgICAgICAgIHdwYWxXcml0ZVJlZ2lzdGVyKFdBTE5ERVhfRE1BX0NTUl9BRERSRVNTLHJlZ1ZhbHVlICYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfihXTEFORFhFX0RNQV9DU1JfUkVDT1ZFUllfRE9ORSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTkRYRV9ETUFfQ1NSX0ZXX0JNVV9SRUNPVkVSWSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTkRYRV9ETUFfQ1NSX0hPU1RfUkVDT1ZFUllfRE9ORSkpOworCisgICAgICAgICAgICAgIC8vY2hlY2sgaWYgdGhlIGgvdyByZXNvdXJjZXMgaGF2ZSByZWNvdmVyZWQKKyAgICAgICAgICAgICAgd3BhbFJlYWRSZWdpc3RlcihXTEFORFhFX0JNVV9BVkFJTEFCTEVfQkRfUERVLCAmcmVnVmFsdWUpOworICAgICAgICAgICAgICB3cGFsUmVhZFJlZ2lzdGVyKFdMQU5EWEVfQk1VX0FWQUlMQUJMRV9CRF9QRFVfTE9DQUwsICZyZWdWYWx1ZUxvY2FsKTsKKyAgICAgICAgICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgICAgICI9PT09PSBjb3VudCAlZCBBQkQgJWQsIEFCRCBMT0NBTCAlZCA9PT09PSIsIGNvdW50LAorICAgICAgICAgICAgICAgICAgICAgICByZWdWYWx1ZSwgcmVnVmFsdWVMb2NhbCk7CisgICAgICAgICAgICAgIGlmKHJlZ1ZhbHVlID09IDAgfHwgcmVnVmFsdWVMb2NhbCA9PSAwKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICByZXR1cm4gZVdMQU5fUEFMX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICByZXR1cm4gZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgIH0KKyAgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGRlZmF1bHQ6CisgICAgICB7CisgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICIlczogTm8gRGVidWcgSW5vcm1hdGlvbiIsIF9fZnVuY19fKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorCisgICB9CisgICByZXR1cm4gZVdMQU5fUEFMX1NUQVRVU19FX0ZBSUxVUkU7Cit9CisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEAgIEZ1bmN0aW9uIE5hbWUKKyAgICAgIGR4ZVR4VGhyZWFkQ2hhbm5lbERlYnVnSGFuZGxlcgorCisgIEAgIERlc2NyaXB0aW9uCisgICAgICBEdW1wIFRYIGNoYW5uZWwgaW5mb3JtYXRpb24KKworICBAICBQYXJhbWV0ZXJzCisgICAgICBXd3B0X21zZyAgICAgICAgICAgICAgICptc2dQdHIKKworICBAICBSZXR1cm4KKyAgICAgIE5PTkUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgZHhlVHhUaHJlYWRDaGFubmVsRGVidWdIYW5kbGVyCisoCisgICAgd3B0X21zZyAgICAgICAgICAgICAgICptc2dQdHIKKykKK3sKKyAgIHdwdF91aW50OCAgICAgICAgICAgICAgICBjaGFubmVsTG9vcDsKKyAgIHdwdF9sb2dfZGF0YV9zdGFsbF9jaGFubmVsX3R5cGUgY2hhbm5lbExvZzsKKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAiJXMgRW50ZXIiLCBfX2Z1bmNfXyk7CisKKyAgIC8qIFdoYXRldmVyIFJJVkEgcG93ZXIgY29uZGl0aW9uIHRyeSB0byB3YWtldXAgUklWQSB0aHJvdWdoIFNNU00KKyAgICAqIFRoaXMgd2lsbCBub3Qgc2ltcGx5IHdha2V1cCBSSVZBCisgICAgKiBKdXN0IGluY2FzZSBUWCBub3Qgd2FudGVkIHN0dWNrLCBUcmlnZ2VyIFRYIGFnYWluICovCisgICBmb3IoY2hhbm5lbExvb3AgPSAwOyBjaGFubmVsTG9vcCA8IFdEVFNfQ0hBTk5FTF9SWF9MT1dfUFJJOyBjaGFubmVsTG9vcCsrKQorICAgeworICAgICAgZHhlQ2hhbm5lbE1vbml0b3IoIioqKioqKioqIEdldCBEZXNjcmlwdG9yIFNuYXBzaG90ICIsCisgICAgICAgICAgICAgICAgICAgICAgICAmdGVtcER4ZUN0cmxCbGstPmR4ZUNoYW5uZWxbY2hhbm5lbExvb3BdLAorICAgICAgICAgICAgICAgICAgICAgICAgJmNoYW5uZWxMb2cpOworICAgICAgZHhlQ2hhbm5lbFJlZ2lzdGVyRHVtcCgmdGVtcER4ZUN0cmxCbGstPmR4ZUNoYW5uZWxbY2hhbm5lbExvb3BdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQWJub3JtYWwgc3VjY2Vzc2l2ZSBlbXB0eSBpbnRlcnJ1cHQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmY2hhbm5lbExvZyk7CisgICAgICBkeGVDaGFubmVsQWxsRGVzY0R1bXAoJnRlbXBEeGVDdHJsQmxrLT5keGVDaGFubmVsW2NoYW5uZWxMb29wXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsTG9vcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmY2hhbm5lbExvZyk7CisKKyAgICAgIHdwYWxNZW1vcnlDb3B5KGNoYW5uZWxMb2cuY2hhbm5lbE5hbWUsCisgICAgICAgICAgICAgICAgICAgICBjaGFubmVsVHlwZVtjaGFubmVsTG9vcF0sCisgICAgICAgICAgICAgICAgICAgICBXUFRfVFJQVF9DSEFOTkVMX05BTUUpOworICAgICAgd3BhbFBhY2tldFN0YWxsVXBkYXRlSW5mbyhOVUxMLCBOVUxMLCAmY2hhbm5lbExvZywgY2hhbm5lbExvb3ApOworICAgfQorCisgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICI9PT09PT09PT09PT09PT09PT0gRFhFIER1bXAgRW5kID09PT09PT09PT09PT09PT09PT09PT0iKTsKKyAgIHdwYWxNZW1vcnlGcmVlKG1zZ1B0cik7CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRElBR19TVVBQT1JUCisgICB3cGFsUGFja2V0U3RhbGxEdW1wTG9nKCk7CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0RJQUdfU1VQUE9SVCAqLworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAiJXMgRXhpdCIsIF9fZnVuY19fKTsKKyAgIHJldHVybjsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lCisgICAgICBkeGVSeFRocmVhZENoYW5uZWxEZWJ1Z0hhbmRsZXIKKworICBAICBEZXNjcmlwdGlvbgorICAgICAgRHVtcCBSWCBjaGFubmVsIGluZm9ybWF0aW9uCisKKyAgQCAgUGFyYW1ldGVycworICAgICAgV3dwdF9tc2cgICAgICAgICAgICAgICAqbXNnUHRyCisKKyAgQCAgUmV0dXJuCisgICAgICBOT05FCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIGR4ZVJ4VGhyZWFkQ2hhbm5lbERlYnVnSGFuZGxlcgorKAorICAgIHdwdF9tc2cgICAgICAgICAgICAgICAqbXNnUHRyCispCit7CisgICB3cHRfc3RhdHVzICAgICAgICAgICAgICAgc3RhdHVzID0gZV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TEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIlR4IHRocmVhZCBzdGF0ZSBkdW1wIHJlcSBzZXJpYWxpemUgZmFpbCBzdGF0dXM9JWQiLAorICAgICAgICAgICAgICAgc3RhdHVzKTsKKyAgIH0KKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAiJXMgRXhpdCIsIF9fZnVuY19fKTsKKyAgIHJldHVybjsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lIAorICAgICAgZHhlQ3RybEJsa0FsbG9jCisKKyAgQCAgRGVzY3JpcHRpb24gCisgICAgICBBbGxvY2F0ZSBEWEUgQ29udHJvbCBibG9jaworICAgICAgRFhFIGNvbnRyb2wgYmxvY2sgd2lsbCB1c2VkIGJ5IEhvc3QgRFhFIGRyaXZlciBvbmx5LCBpbnRlcm5hbCBzdHJ1Y3R1cmUKKyAgICAgIFdpbGwgbWFrZSByaW5nIGxpbmtlZCBsaXN0CisKKyAgQCAgUGFyYW1ldGVycworICAgICAgV0xBTkRYRV9DdHJsQmxrVHlwZSAgICAgKmR4ZUN0cmxCbGssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRFhFIGhvc3QgZHJpdmVyIG1haW4gY29udHJvbCBibG9jaworICAgICAgV0xBTkRYRV9DaGFubmVsQ0JUeXBlICAgKmNoYW5uZWxFbnRyeQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENoYW5uZWwgc3BlY2lmaWMgY29udHJvbCBibG9jaworCisgIEAgIFJldHVybgorICAgICAgd3B0X3N0YXR1cworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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fRV9JTlZBTDsKKyAgIH0KKworICAgLyogQWxsb2NhdGUgcHJlIGFzaWduZWQgbnVtYmVyIG9mIGNvbnRyb2wgYmxvY2tzICovCisgICBmb3IoaWR4ID0gMDsgaWR4IDwgY2hhbm5lbEVudHJ5LT5udW1EZXNjOyBpZHgrKykKKyAgIHsKKyAgICAgIGN1cnJlbnRDdHJsQmxrID0gKFdMQU5EWEVfRGVzY0N0cmxCbGtUeXBlICopd3BhbE1lbW9yeUFsbG9jYXRlKHNpemVvZihXTEFORFhFX0Rlc2NDdHJsQmxrVHlwZSkpOworICAgICAgaWYoTlVMTCA9PSBjdXJyZW50Q3RybEJsaykKKyAgICAgIHsKKyAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgImR4ZUN0cmxCbGtPcGVuIE1lbUFsbG9jIEZhaWwgZm9yIGNoYW5uZWwgJWQiLAorICAgICAgICAgICAgICAgICAgY2hhbm5lbEVudHJ5LT5jaGFubmVsVHlwZSk7CisgICAgICAgICBmcmVlQ3RybEJsayA9IGNoYW5uZWxFbnRyeS0+aGVhZEN0cmxCbGs7CisgICAgICAgICBmb3IoZklkeCA9IDA7IGZJZHggPCBpZHg7IGZJZHgrKykKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGlmKE5VTEwgPT0gZnJlZUN0cmxCbGspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbmV4dEN0cmxCbGsgPSBmcmVlQ3RybEJsay0+bmV4dEN0cmxCbGs7CisgICAgICAgICAgICB3cGFsTWVtb3J5RnJlZSgodm9pZCAqKWZyZWVDdHJsQmxrKTsKKyAgICAgICAgICAgIGZyZWVDdHJsQmxrID0gbmV4dEN0cmxCbGs7CisgICAgICAgICB9CisgICAgICAgICByZXR1cm4gZVdMQU5fUEFMX1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keCA8IChjaGFubmVsRW50cnktPm51bURlc2MgLSAxKSkpCisgICAgICB7CisgICAgICAgICBwcmV2Q3RybEJsay0+bmV4dEN0cmxCbGsgPSBjdXJyZW50Q3RybEJsazsKKyAgICAgIH0KKyAgICAgIC8qIFRoaXMgaXMgbGFzdCBjb250cm9sIGJsb2NsCisgICAgICAgKiBuZXh0IGNvbnRyb2wgYmxvY2sgZm9yIHRoZSBsYXN0IGNvbnRyb2wgYmxvY2sgaXMgaGVhZCwgZmlyc3QgY29udHJvbCBibG9jaworICAgICAgICogdGhlbiB3aG9sZSBsaW5rZWQgbGlzdCBtYWRlIFJJTkcgKi8KKyAgICAgIGVsc2UgaWYoKGNoYW5uZWxFbnRyeS0+bnVtRGVzYyAtIDEpID09IGlkeCkKKyAgICAgIHsKKyAgICAgICAgIHByZXZDdHJsQmxrLT5uZXh0Q3RybEJsayAgICA9IGN1cnJlbnRDdHJsQmxrOworICAgICAgICAgY3VycmVudEN0cmxCbGstPm5leHRDdHJsQmxrID0gY2hhbm5lbEVudHJ5LT5oZWFkQ3RybEJsazsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgImR4ZUN0cmxCbGtPcGVuIEludmFsaWQgQ3RybCBCbGsgbG9jYXRpb24gJWQiLAorICAgICAgICAgICAgICAgICAgY2hhbm5lbEVudHJ5LT5jaGFubmVsVHlwZSk7CisgICAgICAgICB3cGFsTWVtb3J5RnJlZShjdXJyZW50Q3RybEJsayk7CisgICAgICAgICByZXR1cm4gZVdMQU5fUEFMX1NUQVRVU19FX0ZBVUxUOworICAgICAgfQorCisgICAgICBwcmV2Q3RybEJsayA9IGN1cnJlbnRDdHJsQmxrOworICAgICAgY2hhbm5lbEVudHJ5LT5udW1GcmVlRGVzYysrOworICAgfQorCisgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9JTkZPX0xPVywiJXMgRXhpdCIsIF9fZnVuY19fKTsKKyAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQCAgRnVuY3Rpb24gTmFtZSAKKyAgICAgIGR4ZURlc2NMaW5rQWxsb2MKKworICBAICBEZXNjcmlwdGlvbiAKKyAgICAgIEFsbG9jYXRlIERYRSBkZXNjcmlwdG9yCisgICAgICBEWEUgZGVzY3JpcHRvciB3aWxsIGJlIHNoYXJlZCBieSBEWEUgaG9zdCBkcml2ZXIgYW5kIFJJVkEgRFhFIGVuZ2luZQorICAgICAgV2lsbCBtYWtlIFJJTkcgbGlua2VkIGxpc3QKKyAgICAgIFdpbGwgYmUgbGlua2VkIHdpdGggRGVzY3JpcHRvciBjb250cm9sIGJsb2NrIG9uZSBieSBvbmUKKworICBAICBQYXJhbWV0ZXJzCisgICAgICBXTEFORFhFX0N0cmxCbGtUeXBlICAgICAqZHhlQ3RybEJsaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEWEUgaG9zdCBkcml2ZXIgbWFpbiBjb250cm9sIGJsb2NrCisgICAgICBXTEFORFhFX0NoYW5uZWxDQlR5cGUgICAqY2hhbm5lbEVudHJ5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2hhbm5lbCBzcGVjaWZpYyBjb250cm9sIGJsb2NrCisgIEAgIFJldHVybgorICAgICAgd3B0X3N0YXR1cworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworc3RhdGljIHdwdF9zdGF0dXMgZHhlRGVzY0FsbG9jQW5kTGluaworKAorICAgV0xBTkRYRV9DdHJsQmx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7CisgICAgICAgICBjdXJyZW50RGVzYy0+ZHhlZGVzYy5keGVfc2hvcnRfZGVzYy5zcmNNZW1BZGRyTCA9IGNoYW5uZWxFbnRyeS0+ZXh0cmFDb25maWcucmVmV1Ffc3dhcHBlZDsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgIC8qIEp1c3QgaW4gY2FzZS4gSDJIIFJYIGNoYW5uZWwsIGRvIG5vdGhpbmcKKyAgICAgICAgICAqIEJ5IERlZmluaXRpb24gdGhpcyBtdXN0IG5vdCBoYXBwZW4gKi8KKyAgICAgIH0KKworICAgICAgY3VycmVudEN0cmxCbGsgPSBjdXJyZW50Q3RybEJsay0+bmV4dEN0cmxCbGs7CisgICAgICBwcmV2RGVzYyAgICAgICA9IGN1cnJlbnREZXNjOworCisgICAgICAvLyBhZHZhbmNlIHRvIHRoZSBuZXh0IHByZS1hbGxvY2F0ZWQgZGVzY3JpcHRvciBpbiB0aGUgY2h1bmsKKyAgICAgIGN1cnJlbnREZXNjKys7CisgICAgICBwaHlzQWRkcmVzcyA9IChwaHlzQWRkcmVzcyArIHNpemVvZihXTEFORFhFX0Rlc2NUeXBlKSk7CisgICB9CisKKyAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgIiVzIEV4aXQiLCBfX2Z1bmNfXyk7CisgICByZXR1cm4gc3RhdHVzOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEAgIEZ1bmN0aW9uIE5hbWUKKworICBAICBEZXNjcmlwdGlvbiAKKworICBAICBQYXJhbWV0ZXJzCisKKyAgQCAgUmV0dXJuCisgICAgICB3cHRfc3RhdHVzCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitzdGF0aWMgd3B0X3N0YXR1cyBkeGVTZXRJbnRlcnJ1cHRQYXRoCisoCisgICBXTEFORFhFX0N0cmxCbGtUeXBlICAgICAqZHhlQ3RybEJsaworKQoreworICAgd3B0X3N0YXR1cyAgICAgICAgICAgICAgICAgc3RhdHVzICAgICAgICA9IGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgIGludGVycnVwdFBhdGggPSAwOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgaWR4OworICAgV0xBTkRYRV9DaGFubmVsQ0JUeXBlICAgICAqY2hhbm5lbEVudHJ5ID0gTlVMTDsKKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAiJXMgRW50ZXIiLCBfX2Z1bmNfXyk7CisKKyAgIGZvcmVhY2hfdmFsaWRfY2hhbm5lbChpZHgpCisgICB7CisgICAgICBjaGFubmVsRW50cnkgPSAmZHhlQ3RybEJsay0+ZHhlQ2hhbm5lbFtpZHhdOworICAgICAgaWYoKFdEVFNfQ0hBTk5FTF9UWF9MT1dfUFJJID09IGNoYW5uZWxFbnRyeS0+Y2hhbm5lbFR5cGUpIHx8CisgICAgICAgICAoV0RUU19DSEFOTkVMX1RYX0hJR0hfUFJJID09IGNoYW5uZWxFbnRyeS0+Y2hhbm5lbFR5cGUpKQorICAgICAgeworICAgICAgICAgaW50ZXJydXB0UGF0aCB8PSAoMSA8PCBjaGFubmVsRW50cnktPmFzc2lnbmVkRE1BQ2hhbm5lbCk7CisgICAgICB9CisgICAgICBlbHNlIGlmKChXRFRTX0NIQU5ORUxfUlhfTE9XX1BSSSA9PSBjaGFubmVsRW50cnktPmNoYW5uZWxUeXBlKSB8fAorICAgICAgICAgICAgICAoV0RUU19DSEFOTkVMX1JYX0hJR0hfUFJJID09IGNoYW5uZWxFbnRyeS0+Y2hhbm5lbFR5cGUpfHwKKyAgICAgICAgICAgICAgKFdEVFNfQ0hBTk5FTF9SWF9GV19MT0cgPT0gY2hhbm5lbEVudHJ5LT5jaGFubmVsVHlwZSkgIHx8CisgICAgICAgICAgICAgIChXRFRTX0NIQU5ORUxfUlhfTE9HID09IGNoYW5uZWxFbnRyeS0+Y2hhbm5lbFR5cGUpKQorICAgICAgeworICAgICAgICAgaW50ZXJydXB0UGF0aCB8PSAoMSA8PCAoY2hhbm5lbEVudHJ5LT5hc3NpZ25lZERNQUNoYW5uZWwgKyAxNikpOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiSDJIIFRFU1QgUlg/Pz8/ICVkIiwgY2hhbm5lbEVudHJ5LT5jaGFubmVsVHlwZSk7CisgICAgICB9CisgICB9CisgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgIkludGVycnVwdCBQYXRoIE11c3QgYmUgMHgleCIsIGludGVycnVwdFBhdGgpOworICAgZHhlQ3RybEJsay0+aW50ZXJydXB0UGF0aCA9IGludGVycnVwdFBhdGg7CisgICB3cGFsV3JpdGVSZWdpc3RlcihXTEFORFhFX0NDVV9EWEVfSU5UX1NFTEVDVCwgaW50ZXJydXB0UGF0aCk7CisKKyAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgIiVzIEV4aXQiLCBfX2Z1bmNfXyk7CisgICByZXR1cm4gc3RhdHVzOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEAgIEZ1bmN0aW9uIE5hbWUKKyAgICAgIGR4ZUVuZ2luZUNvcmVTdGFydCAKKworICBAICBEZXNjcmlwdGlvbiAKKyAgICAgIFRyaWdnZXIgdG8gc3RhcnQgUklWQSBEWEUgSGFyZHdhcmUKKworICBAICBQYXJhbWV0ZXJzCisgICAgICBXTEFORFhFX0N0cmxCbGtUeXBlICAgICAqZHhlQ3RybEJsaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEWEUgaG9zdCBkcml2ZXIgbWFpbiBjb250cm9sIGJsb2NrCisKKyAgQCAgUmV0dXJuCisgICAgICB2b2lkCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitzdGF0aWMgdm9pZCBkeGVFbmdpbmVDb3JlU3RhcnQKKygKKyAgIFdMQU5EWEVfQ3RybEJsa1R5cGUgICAgICpkeGVDdHJsQmxrCispCit7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICByZWdpc3RlckRhdGEgPSAwOworICAgd3B0X3VpbnQ4ICAgICAgICAgICAgICAgICAgcmVhZFJldHJ5OworCisgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICIlcyBFbnRlciIsIF9fZnVuY19fKTsKKworI2lmZGVmIFdDTl9QUk9OVE8KKyAgIC8qIFJlYWQgZGVmYXVsdCAqLworICAgd3BhbFJlYWRSZWdpc3RlcihXTEFORFhFX0NDVV9TT0ZUX1JFU0VULCAmcmVnaXN0ZXJEYXRhKTsKKyAgIHJlZ2lzdGVyRGF0YSB8PSBXTEFORFhFX0RNQV9DQ1VfRFhFX1JFU0VUX01BU0s7CisKKyAgIC8qIE1ha2UgcmVzZXQgKi8KKyAgIHdwYWxXc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sIGJsb2NrCisgIEAgIFJldHVybgorICAgICAgd3B0X3N0YXR1cworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworc3RhdGljIHdwdF9zdGF0dXMgZHhlQ2hhbm5lbEluaXRQcm9ncmFtCisoCisgICBXTEFORFhFX0N0cmxCbGtUeXBlICAgICAqZHhlQ3RybEJsaywKKyAgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgICpjaGFubmVsRW50cnkKKykKK3sKKyAgIHdwdF9zdGF0dXMgICAgICAgICAgICAgICAgc3RhdHVzID0gZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICBpZHg7CisgICBXTEFORFhFX0Rlc2NUeXBlICAgICAgICAgKmN1cnJlbnREZXNjID0gTlVMTDsKKyAgIFdMQU5EWEVfRGVzY0N0cmxCbGtUeXBlICAqY3VycmVudEN0cmxCbGsgPSBOVUxMOworCisgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICIlcyBFbnRlciIsIF9fZnVuY19fKTsKKworICAgLyogU2FuaXR5IENoZWNrICovCisgICBpZigoTlVMTCA9PSBkeGVDdHJsQmxrKSB8fCAoTlVMTCA9PSBjaGFubmVsRW50cnkpKQorICAgeworICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiZHhlQ2hhbm5lbEluaXRQcm9ncmFtIENoYW5uZWwgRW50cnkgaXMgbm90IHZhbGlkIik7CisgICAgICByZXR1cm4gZVdMQU5fUEFMX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICAvKiBQcm9ncmFtIFNvdXJjZSBhZGRyZXNzI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gfQorICAgZWxzZQorICAgeworICAgICAgLyogSDJIIHRlc3QgY2hhbm5lbCwgbm90IHVzZSB3b3JrIFEgKi8KKyAgIH0KKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAiJXMgRXhpdCIsIF9fZnVuY19fKTsKKyAgIHJldHVybiBzdGF0dXM7Cit9CisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lIAorICAgICAgZHhlQ2hhbm5lbFN0YXJ0CisKKyAgQCAgRGVzY3JpcHRpb24gCisgICAgICBTdGFydCBTcGVjaWZpYyBDaGFubmVsCisKKyAgQCAgUGFyYW1ldGVycworICAgICAgV0xBTkRYRV9DdHJsQmxrVHlwZSAgICAgKmR4ZUN0cmxCbGssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRFhFIGhvc3QgZHJpdmVyIG1haW4gY29udHJvbCBibG9jaworICAgICAgV0xBTkRYRV9DaGFubmVsQ0JUeXBlICAgKmNoYW5uZWxFbnRyeQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENoYW5uZWwgc3BlY2lmaWMgY29udHJvbCBibG9jaworCisgIEAgIFJldHVybgorICAgICAgd3B0X3N0YXR1cworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworc3RhdGljIHdwdF9zdGF0dXMgZHhlQ2hhbm5lbFN0YXJ0CisoCisgICBXTEFORFhFX0N0cmxCbGtUeXBlICAgICAqZHhlQ3RybEJsaywKKyAgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgICpjaGFubmVsRW50cnkKKykKK3sKKyAgIHdwdF9zdGF0dXMgICAgICAgICAgICAgICAgc3R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zID0gd3BhbFJlYWRSZWdpc3RlcihXTEFORFhFX0lOVF9NQVNLX1JFR19BRERSRVNTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZpbnRNYXNrVmFsKTsKKyAgIGlmKGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpCisgICB7CisgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICJkeGVDaGFubmVsU3RhcnQgUmVhZCBJTlRfTUFTSyByZWdpc3RlciBmYWlsIik7CisgICAgICByZXR1cm4gc3RhdHVzOyAgICAgICAgIAorICAgfQorICAgaW50TWFza1ZhbCB8PSBjaGFubmVsRW50cnktPmV4dHJhQ29uZmlnLmludE1hc2s7CisgICBzdGF0dXMgPSB3cGFsV3JpdGVSZWdpc3RlcihXTEFORFhFX0lOVF9NQVNLX1JFR19BRERSRVNTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRNYXNrVmFsKTsKKyAgIGlmKGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpCisgICB7CisgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICJkeGVDaGFubmVsU3RhcnQgV3JpdGUgSU5UX01BU0sgcmVnaXN0ZXIgZmFpbCIpOworICAgICAgcmV0dXJuIHN0YXR1czsgICAgICAgICAKKyAgIH0KKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAiJXMgRXhpdCIsIF9fZnVuY19fKTsKKyAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQCAgRnVuY3Rpb24gTmFtZQorICAgICAgZHhlQ2hhbm5lbFN0b3AKKworICBAICBEZXNjcmlwdGlvbiAKKyAgICAgIFN0b3AgU3BlY2lmaWMgQ2hhbm5lbAorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIFdMQU5EWEVfQ3RybEJsa1R5cGUgICAgICpkeGVDdHJsQmxrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERYRSBob3N0IGRyaXZlciBtYWluIGNvbnRyb2wgYmxvY2sKKyAgICAgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgICpjaGFubmVsRW50cnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGFubmVsIHNwZWNpZmljIGNvbnRyb2wgYmxvY2sKKworICBAICBSZXR1cm4KKyAgICAgIHdwdF9zdGF0dXMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3N0YXRpYyB3cHRfc3RhdHVzIGR4ZUNoYW5uZWxTdG9wCisoCisgICBXTEFORFhFX0N0cmxCbGtUeXBlICAgICAqZHhlQ3RybEJsaywKKyAgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgICpjaGFubmVsRW50cnkKKykKK3sKKyAgIHdwdF9zdGF0dXMgICAgICAgICAgICAgICAgc3RhdHVzICAgICA9IGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgaW50TWFza1ZhbCA9IDA7CisKKyAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgIiVzIEVudGVyIiwgX19mdW5jX18pOworCisgICAvKiBTYW5pdHkgKi8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yIGZhaWwiKTsKKyAgICAgIHJldHVybiBzdGF0dXM7ICAgICAgICAgCisgICB9CisgICBpbnRNYXNrVmFsIF49IGNoYW5uZWxFbnRyeS0+ZXh0cmFDb25maWcuaW50TWFzazsKKyAgIHN0YXR1cyA9IHdwYWxXcml0ZVJlZ2lzdGVyKFdMQU5EWEVfSU5UX01BU0tfUkVHX0FERFJFU1MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludE1hc2tWYWwpOworICAgaWYoZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgIHsKKyAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgImR4ZUNoYW5uZWxTdG9wIFdyaXRlIElOVF9NQVNLIHJlZ2lzdGVyIGZhaWwiKTsKKyAgICAgIHJldHVybiBzdGF0dXM7ICAgICAgICAgCisgICB9CisKKyAgIGNoYW5uZWxFbnRyeS0+ZXh0cmFDb25maWcuY2hFbmFibGVkICAgID0gZVdMQU5fUEFMX0ZBTFNFOworCisgICAvKiBTdG9wIENoYW5uZWwgPz8/ICovCisgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICIlcyBFeGl0IiwgX19mdW5jX18pOworICAgcmV0dXJuIHN0YXR1czsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lIAorICAgICAgZHhlQ2hhbm5lbENsb3NlCisKKyAgQCAgRGVzY3JpcHRpb24gCisgICAgICBDbG9zZSBTcGVjaWZpYyBDaGFubmVsCisgICAgICBGcmVlIHByZSBhbGxvY2F0ZWQgUlggZnJhbWUgYnVmZmVyIGlmIFJYIGNoYW5uZWwKKyAgICAgIEZyZWUgRFhFIGRlc2NyaXB0b3IgZm9yIGVhY2ggY2hhbm5lbAorICAgICAgRnJlZSBEZXNjcmlwdG9yIGNvbnRyb2wgYmxvY2sgZm9yIGVhY2ggY2hhbm5lbAorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIFdMQU5EWEVfQ3RybEJsa1R5cGUgICAgICpkeGVDdHJsQmxrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERYRSBob3N0IGRyaXZlciBtYWluIGNvbnRyb2wgYmxvY2sKKyAgICAgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgICpjaGFubmVsRW50cnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGFubmVsIHNwZWNpZmljIGNvbnRyb2wgYmxvY2sKKworICBAICBSZXR1cm4KKyAgICAgIHdwdF9zdGF0dXMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3N0YXRpYyB3cHRfc3RhdHVzIGR4ZUNoYW5uZWxDbG9zZQorKAorICAgV0xBTkRYRV9DdHJsQmxrVHlwZSAgICAgKmR4ZUN0cmxCbGssCisgICBXTEFORFhFX0NoYW5uZWxDQlR5cGUgICAqY2hhbm5lbEVudHJ5CispCit7CisgICB3cHRfc3RhdHVzICAgICAgICAgICAgICAgIHN0YXR1cyAgICAgICAgICAgID0gZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICBpZHg7CisgICBXTEFORFhFX0Rlc2NDdHJsQmxrVHlwZSAgKmN1cnJlbnRDdHJsQmxrICAgID0gTlVMTDsKKyAgIFdMQU5EWEVfRGVzY0N0cmxCbGtUeXBlICAqbmV4dEN0cmxCbGsgICAgICAgPSBOVUxMOworICAgV0xBTkRYRV9EZXNjVHlwZSAgICAgICAgICpjdXJyZW50RGVzY3JpcHRvciA9IE5VTEw7CisgICBXTEFORFhFX0Rlc2NUeXBlICAgICAgICAgKm5leHREZXNjcmlwdG9yICAgID0gTlVMTDsKKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAiJXMgRW50ZXIiLCBfX2Z1bmNfXyk7CisKKyAgIC8qIFNhbml0eSAqLworICAgaWYoKE5VTEwgPT0gZHhlQ3RybEJsaykgfHwgKE5VTEwgPT0gY2hhbm5lbEVudHJ5KSkKKyAgIHsKKyAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgImR4ZUNoYW5uZWxTdG9wIEludmFsaWQgYXJnIGlucHV0Iik7CisgICAgICByZXR1cm4gZVdMQU5fUEFMX1NUQVRVU19FX0lOVkFMOyAKKyAgIH0KKworICAgY3VycmVudEN0cmxCbGsgICAgPSBjaGFubmVsRW50cnktPmhlYWRDdHJsQmxrOworICAgaWYoTlVMTCAhPSBjdXJyZW50Q3RybEJsaykKKyAgIHsKKyAgICAgIGN1cnJlbnREZXNjcmlwdG9yID0gY3VycmVudEN0cmxCbGstPmxpbmtlZERlc2M7CisgICAgICBmb3IoaWR4ID0gMDsgaWR4IDwgY2hhbm5lbEVudHJ5LT5udW1EZXNjOyBpZHgrKykKKyAgICAgIHsKKyAgICAgICAgICBpZiAoaWR4ICsgMSAhPSBjaGFubmVsRW50cnktPm51bURlc2MpCisgICAgICAgICAgeworICAgICAgICAgICAgICBuZXh0Q3RybEJsayAgICA9IGN1cnJlbnRDdHJsQmxrLT5uZXh0Q3RybEJsazsKKyAgICAgICAgICAgICAgbmV4dERlc2NyaXB0b3IgPSBuZXh0Q3RybEJsay0+bGlua2VkRGVzYzsKKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbmV4dEN0cmxCbGsgPSBOVUxMOworICAgICAgICAgICAgICBuZXh0RGVzY3JpcHRvciA9IE5VTEw7CisgICAgICAgICAgfQorICAgICAgICAgIGlmKChXRFRTX0NIQU5ORUxfUlhfTE9XX1BSSSAgPT0gY2hhbm5lbEVudHJ5LT5jaGFubmVsVHlwZSkgfHwKKyAgICAgICAgICAgICAoV0RUU19DSEFOTkVMX1JYX0hJR0hfUFJJID09IGNoYW5uZWxFbnRyeS0+Y2hhbm5lbFR5cGUpIHx8CisgICAgICAgICAgICAgKFdEVFNfQ0hBTk5FTF9SWF9MT0cgPT0gY2hhbm5lbEVudHJ5LT5jaGFubmVsVHlwZSkpCisgICAgICAgICAgeworICAgICAgICAgICAgaWYgKE5VTEwgIT0gY3VycmVudEN0cmxCbGstPnhmckZyYW1lKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgd3BhbFVubG9ja1BhY2tldChjdXJyZW50Q3RybEJsay0+eGZyRnJhbWUpOworICAgICAgICAgICAgICAgd3BhbFBhY2tldEZyZWUoY3VycmVudEN0cmxCbGstPnhmckZyYW1lKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgICAgIC8qICAKKyAgICAgICAgICAqICBJdCBpcyB0aGUgcmVzcG9uc2liaWxpdHkgb2YgRFhFIHRvIHdhbGsgdGhyb3VnaCB0aGUgCisgICAgICAgICAgKiAgZGVzY3JpcHRvciBjaGFpbiBhbmQgdW5sb2NrIGFueSBwZW5kaW5nIHBhY2tldHMgKGlmIAorICAgICAgICAgICogIGxvY2tlZCkuIAorICAgICAgICAgICovCisgICAgICAgICBpZigoV0RUU19DSEFOTkVMX1RYX0xPV19QUkkgID09IGNoYW5uZWxFbnRyeS0+Y2hhbm5lbFR5cGUpIHx8CisgICAgICAgICAgICAoV0RUU19DSEFOTkVMX1RYX0hJR0hfUFJJID09IGNoYW5uZWxFbnRyeS0+Y2hhbm5lbFR5cGUpKQorICAgICAgICAgeworICAgICAgICAgICAgIGlmKChOVUxMICE9IGN1cnJlbnRDdHJsQmxrLT54ZnJGcmFtZSkgJiYgCisgICAgICAgICAgICAgICAgICAgICAoZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTID09IHdwYWxJc1BhY2tldExvY2tlZChjdXJyZW50Q3RybEJsay0+eGZyRnJhbWUpKSkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHdwYWxVbmxvY2tQYWNrZXQoY3VycmVudEN0cmxCbGstPnhmckZyYW1lKTsKKyAgICAgICAgICAgICAgICAgIHdwYWxQYWNrZXRGcmVlKGN1cnJlbnRDdHJsQmxrLT54ZnJGcmFtZSk7CisgICAgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgICB3cGFsTWVtb3J5RnJlZShjdXJyZW50Q3RybEJsayk7CisKKyAgICAgICAgIGN1cnJlbnRDdHJsQmxrICAgID0gbmV4dEN0cmxCbGs7CisgICAgICAgICBjdXJyZW50RGVzY3JpcHRvciA9IG5leHREZXNjcmlwdG9yOworICAgICAgICAgaWYoTlVMTCA9PSBjdXJyZW50Q3RybEJsaykKKyAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIEFscmVhZHkgcmVhY2ggbGFzdCBvZiB0aGUgY29udHJvbCBibG9jaworICAgICAgICAgICAgICogTm90IG5lZWQgdG8gcHJvY2VzcyBhbnltb3JlLCBicmVhayAqLworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisgICAgICB9CisgICB9CisKKyAgIC8vIGRlc2NyaXB0b3JzIHdlcmUgYWxsb2NhdGVkIGFzIGEgc2luZ2xlIGNodW5rIHNvIGZyZWUgdGhlIGNodW5rCisgICBpZihOVUxMICE9IGNoYW5uZWxFbnRyeS0+ZGVzY3JpcHRvckFsbG9jYXRpb24pCisgICB7CisgICAgICB3cGFsRG1hTWVtb3J5RnJlZShjaGFubmVsRW50cnktPmRlc2NyaXB0b3JBbGxvY2F0aW9uKTsKKyAgIH0KKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAiJXMgRXhpdCIsIF9fZnVuY19fKTsKKyAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQCAgRnVuY3Rpb24gTmFtZQorICAgICAgZHhlQ2hhbm5lbENsZWFuSW50CisKKyAgQCAgRGVzY3JpcHRpb24gCisgICAgICBDbGVhbiB1cCBpbnRlcnJ1cHQgZnJvbSBSSVZBIEhXCisgICAgICBBZnRlciBIb3N0IGZpbmlzaCB0byBoYW5kbGUgaW50ZXJydXB0LCBpbnRlcnJ1cHQgc2lnbmFsIG11c3QgYmUgY2xlYW5lZCB1cAorICAgICAgT3RoZXJ3aXNlIG5leHQgaW50ZXJydXB0IHdpbGwgbm90IGJlIGdlbmVyYXRlZAorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgICpjaGFubmVsRW50cnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGFubmVsIHNwZWNpZmljIGNvbnRyb2wgYmxvY2sKKyAgICAgIHdwdF91aW50MzIgICAgICAgICAgICAgICpjaFN0YXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGFubmVsIFN0YXR1cyByZWdpc3RlciB2YWx1ZQorCisgIEAgIFJldHVybgorICAgICAgd3B0X3N0YXR1cworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworc3RhdGljIHdwdF9zdGF0dXMgZHhlQ2hhbm5lbENsZWFuSW50CisoCisgICBXTEFORFhFX0NoYW5uZWxDQlR5cGUgICAqY2hh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VnaXN0ZXIgZmFpbCIpOworICAgICAgICAgcmV0dXJuIGVXTEFOX1BBTF9TVEFUVVNfRV9GQVVMVDsgICAgICAgICAKKyAgICAgIH0KKyAgIH0KKworICAgLyogQ2xlYW4gdXAgRE9ORSBJTlQgQml0ICovCisgICBpZihXTEFORFhFX0NIX1NUQVRfSU5UX0RPTkVfTUFTSyAmICpjaFN0YXQpCisgICB7CisgICAgICBzdGF0dXMgPSB3cGFsV3JpdGVSZWdpc3RlcihXTEFORFhFX0lOVF9ET05FX0NMUl9BRERSRVNTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMSA8PCBjaGFubmVsRW50cnktPmFzc2lnbmVkRE1BQ2hhbm5lbCkpOworICAgICAgaWYoZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgIHsKKyAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgImR4ZUNoYW5uZWxDbGVhbkludCBSZWFkIENIIFNUQVQgcmVnaXN0ZXIgZmFpbCIpOworICAgICAgICAgcmV0dXJuIGVXTEFOX1BBTF9TVEFUVVNfRV9GQVVMVDsgICAgICAgICAKKyAgICAgIH0KKyAgIH0KKworICAgLyogQ2xlYW4gdXAgRUQgSU5UIEJpdCAqLworICAgaWYoV0xBTkRYRV9DSF9TVEFUX0lOVF9FRF9NQVNLICYgKmNoU3RhdCkKKyAgIHsKKyAgICAgIHN0YXR1cyA9IHdwYWxXcml0ZVJlZ2lzdGVyKFdMQU5EWEVfSU5UX0VEX0NMUl9BRERSRVNTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMSA8PCBjaGFubmVsRW50cnktPmFzc2lnbmVkRE1BQ2hhbm5lbCkpOworICAgICAgaWYoZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgIHsKKyAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgImR4ZUNoYW5uZWxDbGVhbkludCBSZWFkIENIIFNUQVQgcmVnaXN0ZXIgZmFpbCIpOworICAgICAgICAgcmV0dXJuIGVXTEFOX1BBTF9TVEFUVVNfRV9GQVVMVDsgICAgICAgICAKKyAgICAgIH0KKyAgIH0KKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAiJXMgRXhpdCIsIF9fZnVuY19fKTsKKyAgIHJldHVybiBzdGF0dXM7Cit9CisKKyNpZmRlZiBXTEFOX0RYRV9MT1dfUkVTT1VSQ0VfVElNRVIKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQCAgRnVuY3Rpb24gTmFtZQorCQkJICAgICAgZHhlUlhSZXNvdXJjZUF2YWlsYWJsZVRpbWVyRXhwSGFuZGxlcgorCisgIEAgIERlc2NyaXB0aW9uCisgICAgICBEdXJpbmcgcHJlLXNldCB0aW1lcGVyaW9kLCBpZiBmcmVlIGF2YWlsYWJsZSBSWCBidWZmZXIgaXMgbm90IGFsbG9jYXRlZAorICAgICAgVHJpZ2dlciBEcml2ZXIgcmUtbG9hZGluZyB0byByZWNvdmVyIFJYIGRlYWQgZW5kCisKKyAgQCAgUGFyYW1ldGVycworICAgdl9WT0lEX3QgICAgICp1c3JEYXRhCisgICAgICAgICAgICAgICAgRFhFIGNvbnRleHQKKworICBAICBSZXR1cm4KKyAgICAgIE5PTkUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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X1RSVUU7CisKKyAgICAgIHdwYWxXbGFuUmVsb2FkKCk7CisKKyAgICAgIGlmIChOVUxMICE9IHVzckRhdGEpCisgICAgICAgICBkeGVTdGFydFNTUlRpbWVyKChXTEFORFhFX0N0cmxCbGtUeXBlICopdXNyRGF0YSk7CisgICB9CisgICBlbHNlCisgICB7CisgICAgICAgd3BhbFRpbWVyU3RhcnQoJmR4ZUN0eHQtPnJ4UmVzb3VyY2VBdmFpbGFibGVUaW1lciwKKyAgICAgICAgICAgICAgICAgICAgICB3cGFsR2V0RHhlUmVwbGVuaXNoUlhUaW1lclZhbCgpKTsKKyAgIH0KKyAgIHJldHVybjsKK30KKyNlbmRpZgorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEAgIEZ1bmN0aW9uIE5hbWUKKyAgICAgZHhlU3RhcnRTU1JUaW1lcgorCisgIEAgIERlc2NyaXB0aW9uCisgICAgICBTdGFydCB0aGUgZHhlU1NSVGltZXIgYWZ0ZXIgaXNzdWluZyB0aGUgRklRIHRvIHJlc3RhcnQgdGhlIFdDTiBjaGlwLAorICAgICAgdGhpcyBtYWtlcyBzdXJlIHRoYXQgaWYgdGhlIGNoaXAgZG9lcyBub3QgcmVzcG9uZCB0byB0aGUgRklRIHdpdGhpbgorICAgICAgdGhlIHRpbWVvdXQgcGVyaW9kIHRoZSBkeGVTU1JUaW1lciBleHBpcmF0aW9uIGhhbmRsZXIgd2lsbCB0YWtlIHRoZQorICAgICAgYXBwcm9wcmlhdGUgYWN0aW9uLgorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIE5PTkUKKworICBAICBSZXR1cm4KKyAgICAgIE5PTkUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3N0YXRpYyB2b2lkIGR4ZVN0YXJ0U1NSVGltZXIKKygKKyAgV0xBTkRYRV9DdHJsQmxrVHlwZSAgICAgKmR4ZUN0eHQKKykKK3sKKyAgIGlmKFZPU19USU1FUl9TVEFURV9SVU5OSU5HICE9CisgICAgICB3cGFsVGltZXJHZXRDdXJTdGF0dXMoJmR4ZUN0eHQtPmR4ZVNTUlRpbWVyKSkKKyAgIHsKKyAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAiJXM6IFN0YXJ0aW5nIFNTUiBUaW1lciIsX19mdW5jX18pOworICAgICAgd3BhbFRpbWVyU3RhcnQoJmR4ZUN0eHQtPmR4ZVNTUlRpbWVyLAorICAgICAgICAgICAgICAgICAgICAgVF9XTEFORFhFX1NTUl9USU1FT1VUKTsKKyAgIH0KK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lCisgICAgIGR4ZVNTUlRpbWVyRXhwSGFuZGxlcgorCisgIEAgIERlc2NyaXB0aW9uCisgICAgICBJc3N1ZSBhbiBleHBsaWNpdCBzdWJzeXN0ZW0gcmVzdGFydCBvZiB0aGUgd2Nuc3Mgc3Vic3lzdGVtIGlmIHRoZQorICAgICAgV0NOIGNoaXAgZG9lcyBub3QgcmVzcG9uZCB0byB0aGUgRklRIHdpdGhpbiB0aGUgdGltZW91dCBwZXJpb2QKKworICBAICBQYXJhbWV0ZXJzCisgICB2X1ZPSURfdCAgICAgKnVzckRhdGEKKworICBAICBSZXR1cm4KKyAgICAgIE5PTkUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgZHhlU1NSVGltZXJFeHBIYW5kbGVyCisoCisgICB2b2lkICAgICp1c3JEYXRhCispCit7CisgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICJEWEUgbm90IHNodXRkb3duICVkIG1zIGFmdGVyIEZJUSEhIElzc3VlIFNTUiIsCisgICAgICAgICAgICBUX1dMQU5EWEVfU1NSX1RJTUVPVVQpOworICAgd3BhbFJpdmFTdWJ5c3RlbVJlc3RhcnQoKTsKKworICAgcmV0dXJuOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEAgIEZ1bmN0aW9uIE5hbWUgCisgICAgICBkeGVSWFBhY2tldEF2YWlsYWJsZUNCCisKKyAgQCAgRGVzY3JpcHRpb24gCisgICAgICBJZiBSWCBmcmFtZSBoYW5kbGVyIGVuY291bnRzIFJYIGJ1ZmZlciBwb29sIGVtcHR5IGNvbmRpdGlvbiwKKyAgICAgIERYRSBSWCBoYW5kbGUgbG9vcCB3aWxsIGJlIGJsb2NrZWQgdGlsbCBnZXQgYXZhaWxhYmxlIFJYIGJ1ZmZlciBwb29sLgorICAgICAgV2hlbiBuZXcgUlggYnVmZmVyIHBvb2wgYXZhaWxhYmxlLCBQYWNrZXQgYXZhaWxhYmxlIENCIGZ1bmN0aW9uIHdpbGwKKyAgICAgIGJlIGNhbGxlZC4KKworICBAICBQYXJhbWV0ZXJzCisgICB3cHRfcGFja2V0ICAgKmZyZWVQYWNrZXQKKyAgICAgICAgICAgICAgICBOZXdseSBhbGxvY2F0ZWQgUlggYnVmZmVyCisgICB2X1ZPSURfdCAgICAgKnVzckRhdGEKKyAgICAgICAgICAgICAgICBEWEUgY29udGV4dAorCisgIEAgIFJldHVybgorICAgICAgTk9ORQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBkeGV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gYmUgcHJlIGFsbG9jdGVkIGFuZCBtdXN0IGJlIGFzaWduZWQgdG8KKyAgICAgIGRlc2NyaXB0b3IKKyAgICAgIHRoZW4gd2hlbmV2ZXIgRE1BIGVuZ2luZSB3YW50IHRvIHRyYW5mZXIgZnJhbWUgZnJvbSBCTVUsCisgICAgICBidWZmZXIgbXVzdCBiZSByZWFkeQorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIFdMQU5EWEVfQ3RybEJsa1R5cGUgICAgICpkeGVDdHJsQmxrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERYRSBob3N0IGRyaXZlciBtYWluIGNvbnRyb2wgYmxvY2sKKyAgICAgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgICpjaGFubmVsRW50cnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGFubmVsIHNwZWNpZmljIGNvbnRyb2wgYmxvY2sKKyAgICAgIFdMQU5EWEVfRGVzY0N0cmxCbGtUeXBlICBjdXJyZW50Q3RybEJsb2NrCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudCBjb250cm9sIGJsb2NrIHdoaWNoIGhhdmUgdG8gYmUgYXNpZ25lZCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZSBidWZmZXIKKworICBAICBSZXR1cm4KKyAgICAgIHdwdF9zdGF0dXMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3N0YXRpYyB3cHRfc3RhdHVzIGR4ZVJYRnJhbWVTaW5nbGVCdWZmZXJBbGxvYworKAorICAgV0xBTkRYRV9DdHJsQmxrVHlwZSAgICAgICpkeGVDdHh0LAorICAgV0xBTkRYRV9DaGFubmVsQ0JUeXBlICAgICpjaGFubmVsRW50cnksCisgICBXTEFORFhFX0Rlc2NDdHJsQmxrVHlwZSAgKmN1cnJlbnRDdHJsQmxvY2sKKykKK3sKKyAgIHdwdF9zdGF0dXMgICAgICAgICAgICAgICAgc3RhdHVzID0gZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTOworICAgd3B0X3BhY2tldCAgICAgICAgICAgICAgICpjdXJyZW50UGFsUGFja2V0QnVmZmVyID0gTlVMTDsKKyAgIFdMQU5EWEVfRGVzY1R5cGUgICAgICAgICAqY3VycmVudERlc2MgICAgICAgICAgICA9IE5VTEw7CisgICB3cHRfaXRlcmF0b3IgICAgICAgICAgICAgIGl0ZXJhdG9yOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICBhbGxvY2F0ZWRTaXplICAgICAgICAgID0gMDsKKyAgIHZvaWQgICAgICAgICAgICAgICAgICAgICAqcGh5c0FkZHJlc3MgICAgICAgICAgICA9IE5VTEw7CisKKyAgIGN1cnJlbnREZXNjICAgICAgICAgICAgPSBjdXJyZW50Q3RybEJsb2NrLT5saW5rZWREZXNjOworCisgICBpZihjdXJyZW50RGVzYy0+ZGVzY0N0cmwudmFsaWQpCisgICB7CisgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICJUaGlzIERlc2NyaXB0b3IgaXMgdmFsaWQsIERvIG5vdCByZWZpbGwiKTsKKyAgICAgIHJldHVybiBlV0xBTl9QQUxfU1RBVFVTX0VfRVhJU1RTOworICAgfQorCisgICAvKiBGaXJzdCBjaGVjayBpZiBhIHBhY2tldCBwb2ludGVyIGhhcyBhbHJlYWR5IGJlZW4gcHJvdmlkZWQgYnkgYSBwcmV2aW91c2x5CisgICAgICBpbnZva2VkIFJ4IHBhY2tldCBhdmFpbGFibGUgY2FsbGJhY2suIElmIHNvIHVzZSB0aGF0IHBhY2tldC4gKi8KKyAgIGlmKGR4ZUN0eHQtPnJ4UGFsUGFja2V0VW5hdmFpbGFibGUgJiYgKE5VTEwgIT0gZHhlQ3R4dC0+ZnJl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BTl9QQUxfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiZHhlUlhGcmFtZUJ1ZmZlckFsbG9jIGl0ZXJhdG9yIGluaXQgZmFpbCIpOworICAgICAgcmV0dXJuIHN0YXR1czsKKyAgIH0KKyAgIHN0YXR1cyA9IHdwYWxJdGVyYXRvck5leHQoJml0ZXJhdG9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50UGFsUGFja2V0QnVmZmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcGh5c0FkZHJlc3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZhbGxvY2F0ZWRTaXplKTsKKyAgIGlmKGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpCisgICB7CisgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICJkeGVSWEZyYW1lQnVmZmVyQWxsb2MgaXRlcmF0b3IgR2V0IE5leHQgcG9pbnRlciBmYWlsIik7CisgICAgICByZXR1cm4gc3RhdHVzOworICAgfQorICAgY3VycmVudFBhbFBhY2tldEJ1ZmZlci0+cEJEUGh5cyA9IHBoeXNBZGRyZXNzOworCisgICAvKiBEWEUgZGVzY3JpcHRvciBtdXN0IGhhdmUgU1dBUFBFRCBhZGRyZXMgaW4gaXQncyBzdHJ1Y3R1cmUKKyAgICAqICEhISBTV0FQUEVEICEhISAqLworICAgY3VycmVudERlc2MtPmR4ZWRlc2MuZHhlX3Nob3J0X2Rlc2MuZHN0TWVtQWRkckwgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTkRYRV9VMzJfU1dBUF9FTkRJQU4oKHdwdF91aW50MzIpKHVpbnRwdHJfdCljdXJyZW50UGFsUGFja2V0QnVmZmVyLT5wQkRQaHlzKTsKKworICAgcmV0dXJuIHN0YXR1czsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lIAorICAgICAgZHhlUlhGcmFtZVJlZmlsbFJpbmcKKworICBAICBEZXNjcmlwdGlvbiAKKyAgICAgIEFsbG9jYXRlIFBsYXRmb3JtIHBhY2tldCBidWZmZXJzIHRvIHRyeSB0byBmaWxsIHVwIHRoZSBEWEUgUnggcmluZworCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIFdMQU5EWEVfQ3RybEJsa1R5cGUgICAgICpkeGVDdHJsQmxrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERYRSBob3N0IGRyaXZlciBtYWluIGNvbnRyb2wgYmxvY2sKKyAgICAgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgICpjaGFubmVsRW50cnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGFubmVsIHNwZWNpZmljIGNvbnRyb2wgYmxvY2sKKyAgICAgIAorICBAICBSZXR1cm4KKyAgICAgIHdwdF9zdGF0dXMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3N0YXRpYyB3cHRfc3RhdHVzIGR4ZVJYRnJhbWVSZWZpbGxSaW5nCisoCisgICBXTEFORFhFX0N0cmxCbGtUeXBlICAgICAgKmR4ZUN0eHQsCisgICBXTEFORFhFX0NoYW5uZWxDQlR5cGUgICAgKmNoYW5uZWxFbnRyeQorKQoreworICAgd3B0X3N0YXR1cyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlV0xBTl9QQUxfU1RBVFVTX1NVQ0NFU1M7CisgICBXTEFORFhFX0Rlc2NDdHJsQmxrVHlwZSAgKmN1cnJlbnRDdHJsQmxrID0gY2hhbm5lbEVudHJ5LT50YWlsQ3RybEJsazsKKyAgIFdMQU5EWEVfRGVzY1R5cGUgICAgICAgICAqY3VycmVudERlc2MgICAgPSBOVUxMOworCisgICB3aGlsZShjaGFubmVsRW50cnktPm51bUZyZWVEZXNjID4gMCkKKyAgIHsKKyAgICAgIC8qIEN1cnJlbnQgQ29udHJvbCBibG9jayBpcyBmcmVlCisgICAgICAgKiBhbmQgYXNzb2NpYXRlZCBmcmFtZSBidWZmZXIgaXMgbm90IGxpbmtlZCB3aXRoIGNvbnRyb2wgYmxvY2sgYW55bW9yZQorICAgICAgICogYWxsb2NhdGUgbmV3IGZyYW1lIGJ1ZmZlciBmb3IgY3VycmVudCBjb250cm9sIGJsb2NrICovCisgICAgICBzdGF0dXMgPSBkeGVSWEZyYW1lU2luZ2xlQnVmZmVyQWxsb2MoZHhlQ3R4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudEN0cmxCbGspOworCisgICAgICBpZigoZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykgJiYKKyAgICAgICAgIChlV0xBTl9QQUxfU1RBVFVTX0VfRVhJU1RTICE9IHN0YXR1cykpCisgICAgICB7CisgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgImR4ZVJYRnJhbWVSZWZpbGxSaW5nLCBvdXQgb2YgUlggYnVmZmVyIHBvb2wsIGJyZWFrIGhlcmUiKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorCisgICAgICBpZihlV0xBTl9QQUxfU1RBVFVTX0VfRVhJU1RTID09IHN0YXR1cykKKyAgICAgIHsKKyAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX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uID0gMDsKKworICAgd2hpbGUoYnVmZmVyTGVuID4gMCAmJiBjaGFubmVsRW50cnktPm51bUZyZWVEZXNjID4gMCkKKyAgIHsKKyAgICAgIC8qIEN1cnJlbnQgQ29udHJvbCBibG9jayBpcyBmcmVlCisgICAgICAgKiBhbmQgYXNzb2NpYXRlZCBmcmFtZSBidWZmZXIgaXMgbm90IGxpbmtlZCB3aXRoIGNvbnRyb2wgYmxvY2sgYW55bW9yZQorICAgICAgICogYWxsb2NhdGUgbmV3IGZyYW1lIGJ1ZmZlciBmb3IgY3VycmVudCBjb250cm9sIGJsb2NrICovCisgICAgICBzdGF0dXMgPSBkeGVSWEZyYW1lU2luZ2xlQnVmZmVyQWxsb2MoZHhlQ3R4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudEN0cmxCbGspOworCisgICAgICBpZigoZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykgJiYKKyAgICAgICAgIChlV0xBTl9QQUxfU1RBVFVTX0VfRVhJU1RTICE9IHN0YXR1cykpCisgICAgICB7CisgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgImR4ZVJYRnJhbWVSZWZpbGxSaW5nLCBvdXQgb2YgUlggYnVmZmVyIHBvb2wsIGJyZWFrIGhlcmUiKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorCisgICAgICBpZihlV0xBTl9QQUxfU1RBVFVTX0VfRVhJU1RTID09IHN0YXR1cykKKyAgICAgIHsKKyAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzLCBEZXNjcmlwdG9yIE5vbi1FbXB0eSIsX19mdW5jX18pOworICAgICAgfQorCisgICAgICBjdXJyZW50RGVzYyA9IGN1cnJlbnRDdHJsQmxrLT5saW5rZWREZXNjOworICAgICAgY3VycmVudERlc2MtPmRlc2NDdHJsLmN0cmwgPSBjaGFubmVsRW50cnktPmV4dHJhQ29uZmlnLmN3X2N0cmxfcmVhZDsKKyAgICAgIHhmclNpemUgPSBXTEFORFhFX0ZXX0xPR0dJTkdfWEZTSVpFID4gYnVmZmVyTGVuID8KKyAgICAgICAgICAgICAgICAgICBidWZmZXJMZW4gOiBXTEFORFhFX0ZXX0xPR0dJTkdfWEZTSVpFOworICAgICAgY3VycmVudERlc2MtPnhmclNpemUgPSB4ZnJTaXplOworICAgICAgYWxsb2NhdGVkTGVuICs9IHhmclNpemU7CisgICAgICBidWZmZXJMZW4gLT0geGZyU2l6ZTsKKyAgICAgIHdwYWxQYWNrZXRTZXRSeExlbmd0aChjdXJyZW50Q3RybEJsay0+eGZyRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeGZyU2l6ZSk7CisKKyAgICAgIGN1cnJlbnREZXNjLT5keGVkZXNjLmR4ZV9zaG9ydF9kZXNjLnNyY01lbUFkZHJMID0KKyAgICAgICAgICAgICAgV0xBTkRYRV9VMzJfU1dBUF9FTkRJQU4oKHdwdF91aW50MzIpKHVpbnRwdHJfdClidWZmZXJBZGRyKTsKKworICAgICAgLyogSXNzdWUgYSBkdW1teSByZWFkIGZyb20gdGhlIERYRSBkZXNjcmlwdG9yIEREUiBsb2NhdGlvbiB0byBlbnN1cmUKKyAgICAgICAgIHRoYXQgYW55IHBvc3RlZCB3cml0ZXMgYXJlIHJlZmxlY3RlZCBpbiBtZW1vcnkgYmVmb3JlIERYRSBsb29rcyBhdAorICAgICAgICAgdGhlIGRlc2NyaXB0b3IuICovCisgICAgICBpZihjaGFubmVsRW50cnktPmV4dHJhQ29uZmlnLmN3X2N0cmxfcmVhZCAhPSBjdXJyZW50RGVzYy0+ZGVzY0N0cmwuY3RybCkKKyAgICAgIHsKKyAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzLCBEZXNjcmlwdG9yIHdyaXRlIGZhaWxlZCIsX19mdW5jX18pOworICAgICAgICAgKytjaGFubmVsRW50cnktPmRlc2Nfd3JpdGVfZmFpbF9jb3VudDsKKyAgICAgIH0KKworICAgICAgY3VycmVudEN0cmxCbGsgPSBjdXJyZW50Q3RybEJsay0+bmV4dEN0cmxCbGs7CisgICAgICAtLWNoYW5uZWxFbnRyeS0+bnVtRnJlZURlc2M7CisgICAgICBidWZmZXJBZGRyICs9IHhmclNpemU7CisgICB9CisKKyAgIGNoYW5uZWxFbnRyeS0+dGFpbEN0cmxCbGsgPSBjdXJyZW50Q3RybEJsazsKKworICAgcmV0dXJuIGFsbG9jYXRlZExlbjsKK30KKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQCAgRnVuY3Rpb24gTmFtZQorICAgICAgZHhlUlhGcmFtZVJvdXRlVXBwZXJMYXllcgorCisgIEAgIERlc2NyaXB0aW9uIAorICAgICAgVGVzdCBEWEUgZGVzY3JpcHRvcnMgYW5kIGlmIGFueSBSWCBmcmFtZSBwZW5kaW5nIHdpdGhpbiBSSU5HLAorICAgICAgUm91dGUgdG8gdXBwZXIgbGF5ZXIKKworICBAICBQYXJhbWV0ZXJzCisgICAgICBXTEFORFhFX0N0cmxCbGtUeXBlICAgICAqZHhlQ3RybEJsaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEWEUgaG9zdCBkcml2ZXIgbWFpbiBjb250cm9sIGJsb2NrCisgICAgICBXTEFORFhFX0NoYW5uZWxDQlR5cGUgICAqY2hhbm5lbEVudHJ5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2hhbm5lbCBzcGVjaWZpYyBjb250cm9sIGJsb2NrCisgIEAgIFJldHVybgorICAgICAgPCAwIEFueSBlcnJvciBoYXBwZW4KKyAgICAgIDAgIE5vIGZyYW1lIHB1bGxlZCBmcm9tIFJYIFJJTkcKKyAgICAgIGludCBudW1iZXIgb2YgUlggZnJhbWVzIHB1bGxlZCBmcm9tIFJYIHJpbmcKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3N0YXRpYyB3cHRfaW50MzIgZHhlUlhGcmFtZVJvdXRlVXBwZXJMYXllcgorKAorICAgV0xBTkRYRV9DdHJsQmxrVHlwZSAgICAgKmR4ZUN0eHQsCisgICBXTEFORFhFX0NoYW5uZWxDQlR5cGUgICAqY2hhbm5lbEVudHJ5CispCit7CisgICB3cHRfc3RhdHVzICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgIFdMQU5EWEVfRGVzY0N0cmxCbGtUeXBlICAqY3VycmVudEN0cmxCbGsgPSBOVUxMOworICAgV0xBTkRYRV9EZXNjVHlwZSAgICAgICAgICpjdXJyZW50RGVzYyAgICA9IE5VTEw7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgIGRlc2NDdHJsLCBmcmFtZUNvdW50ID0gMCwgaTsKKyAgIHdwdF9pbnQzMiAgICAgICAgICAgICAgICAgcmV0X3ZhbCA9IC0xOworCisgICBjdXJyZW50Q3RybEJsayA9IGNoYW5uZWxFbnRyeS0+aGVhZEN0cmxCbGs7CisgICBjdXJyZW50RGVzYyAgICA9IGN1cnJlbnRDdHJsQmxrLT5saW5rZWREZXNjOworCisgICAvKiBEZXNjcmlwdG9lIHNob3VsZCBiZSBTV0FQUEVEID8/Pz8gKi8KKyAgIGRlc2NDdHJsID0gY3VycmVudERlc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BoZWFkIGNvbnRyb2wgYmxvY2sKKyAgICAqIGN1cnJlbnQgY29udHJvbCBibG9jaydzIHZhbGlkIGJpdCB3YXMgMAorICAgICogbmV4dCB0cmlhbCBmaXJzdCBjb250cm9sIGJsb2NrIG11c3QgYmUgY3VycmVudCBjb250cm9sIGJsb2NrICovCisgICBjaGFubmVsRW50cnktPmhlYWRDdHJsQmxrID0gY3VycmVudEN0cmxCbGs7CisKKyAgIC8qIERlbGl2ZXIgYWxsIHRoZSByZWFwZWQgUlggZnJhbWVzIHRvIHVwcGVyIGxheWVycyAqLworICAgaSA9IDA7CisgICB3aGlsZShpIDwgZnJhbWVDb3VudCkKKyAgIHsKKyAgICAgIGR4ZUN0eHQtPnJ4UmVhZHlDQihkeGVDdHh0LT5jbGllbnRDdHh0LCByeF9yZWFwZWRfYnVmW2ldLCBjaGFubmVsRW50cnktPmNoYW5uZWxUeXBlKTsKKyAgICAgIGkrKzsKKyAgIH0KKworICAgcmV0dXJuIGZyYW1lQ291bnQ7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQCAgRnVuY3Rpb24gTmFtZSAKKyAgICAgIGR4ZVJYRnJhbWVSZWFkeQorCisgIEAgIERlc2NyaXB0aW9uIAorICAgICAgUG9wIGZyYW1lIGZyb20gZGVzY3JpcHRvciBhbmQgcm91dGUgZnJhbWUgdG8gdXBwZXIgdHJhbnNwb3J0IGxheWVyCisgICAgICBBc3NpZ24gbmV3IHBsYXRmb3JtIHBhY2tldCBidWZmZXIgaW50byB1c2VkIGRlc2NyaXB0b3IKKyAgICAgIEFjdHVhbCBmcmFtZSBwb3AgYW5kIHJlc291cmNlIHJlYWxsb2MKKworICBAICBQYXJhbWV0ZXJzCisgICAgICBXTEFORFhFX0N0cmxCbGtUeXBlICAgICAqZHhlQ3RybEJsaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEWEUgaG9zdCBkcml2ZXIgbWFpbiBjb250cm9sIGJsb2NrCisgICAgICBXTEFORFhFX0NoYW5uZWxDQlR5cGUgICAqY2hhbm5lbEVudHJ5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2hhbm5lbCBzcGVjaWZpYyBjb250cm9sIGJsb2NrCisKKyAgQCAgUmV0dXJuCisgICAgICB3cHRfc3RhdHVzCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitzdGF0aWMgd3B0X3N0YXR1cyBkeGVSWEZyYW1lUmVhZHkKKygKKyAgIFdMQU5EWEVfQ3RybEJsa1R5cGUgICAgICpkeGVDdHh0LAorICAgV0xBTkRYRV9DaGFubmVsQ0JUeXBlICAgKmNoYW5uZWxFbnRyeSwKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICBjaFN0YXQKKykKK3sKKyAgIHdwdF9zdGF0dXMgICAgICAgICAgICAgICAgc3RhdHVzID0gZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTOworICAgV0xBTkRYRV9EZXNjQ3RybEJsa1R5cGUgICpjdXJyZW50Q3RybEJsayA9IE5VTEw7CisgICBXTEFORFhFX0Rlc2NUeXBlICAgICAgICAgKmN1cnJlbnREZXNjICAgID0gTlVMTDsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgZGVzY0N0cmw7CisgICB3cHRfaW50MzIgICAgICAgICAgICAgICAgIGZyYW1lQ291bnQgPSAwOworCisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgIGRlc2NMb29wOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICBpbnZhbGlkYXRlZEZvdW5kID0gMDsKKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAiJXMgRW50ZXIiLCBfX2Z1bmN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gICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiUGFja2V0IE5vdCBMb2NrZWQsIGNhbm5vdCB0cmFuc2ZlciBmcmFtZSIpOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgY3VycmVudEN0cmxCbGsgPSAoV0xBTkRYRV9EZXNjQ3RybEJsa1R5cGUgKiljdXJyZW50Q3RybEJsay0+bmV4dEN0cmxCbGs7CisgICAgICAgICAgICBjdXJyZW50RGVzYyAgICA9IGN1cnJlbnRDdHJsQmxrLT5saW5rZWREZXNjOworICAgICAgICAgICAgZGVzY0N0cmwgICAgICAgPSBjdXJyZW50RGVzYy0+ZGVzY0N0cmwuY3RybDsKKyAgICAgICAgIH0KKworICAgICAgICAgLyogSW52YWxpZGF0ZWQgZGVzY3JpcHRvciBmb3VuZCwgYW5kIHRoYXQgaXMgbm90IGhlYWQgZGVzY3JpcHRvcgorICAgICAgICAgICogVGhpcyBtZWFucyBIVy9TVyBkZXNjcmlwdG9yIG1pc3MgbWF0Y2ggaGFwcGVuLCBhbmQgd2UgbWF5IHJlY292ZXIgd2l0aCBqdXN0IHJlc3luYworICAgICAgICAgICogVHJ5IHJlLXN5bmMgaGVyZSAqLworICAgICAgICAgaWYoKGludmFsaWRhdGVkRm91bmQpICYmICgwICE9IGRlc2NMb29wKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgIkZvdW5kIE5ldyBTeW5jIGxv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yY2UsIGFuZCBJTlQgY2FtZSBpbiwgZG8gbm90aGluZyB0aWxsIGdldCBSWCByZXNvdXJjZSIpOworICAgICAgICAgfQorICAgICAgICAgLyogQ3JpdGljYWwgZXJyb3IsIHJlbG9hZCBkcml2ZXIgKi8KKyAgICAgICAgIGVsc2UKKyAgICAgICAgIHsKKyAgICAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgIkNvdWxkIG5vdCBmb3VuZCBpbnZhbGlkYXRlZCBkZXNjcmlwdG9yIik7CisgICAgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICJSWCBzdWNjZXNzaXZlIGVtcHR5IGludGVycnVwdCwgQ291bGQgbm90IGZpbmQgaW52YWxpZGF0ZWQgREVTQyByZWxvYWQgZHJpdmVyIik7CisgICAgICAgICAgICBkeGVDdHh0LT5kcml2ZXJSZWxvYWRJblByb2Nlc3NpbmcgPSBlV0xBTl9QQUxfVFJVRTsKKyAgICAgICAgICAgIHdwYWxXbGFuUmVsb2FkKCk7CisgICAgICAgICAgICBkeGVTdGFydFNTUlRpbWVyKGR4ZUN0eHQpOworICAgICAgICAgfQorICAgICAgfQorICAgfQorICAgY2hhbm5lbEVudHJ5LT5udW1GcmFnbWVudEN1cnJlbnRDaGFpbiA9IGZyYW1lQ291bnQ7CisgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICIlcyBFeGl0IiwgX19mdW5jX18pOworICAgcmV0dXJuIHN0YXR1czsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lIAorICAgICAgZHhlTm90aWZ5U21zbQorCisgIEAgIERlc2NyaXB0aW9uOiBOb3RpZnkgU01TTSB0byBzdGFydCBEWEUgZW5naW5lIGFuZC9vciBjb25kaXRpb24gb2YgVHggcmluZworICBidWZmZXIgCisKKyAgQCAgUGFyYW1ldGVycworCisgIEAgIFJldHVybgorICAgICAgd3B0X3N0YXR1cworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworc3RhdGljIHdwdF9zdGF0dXMgZHhlTm90aWZ5U21zbQorKAorICB3cHRfYm9vbGVhbiBraWNrRHhlLAorICB3cHRfYm9vbGVhbiByaW5nRW1wdHkKKykKK3sKKyAgIHdwdF91aW50MzIgY2xyU3QgPSAwOworICAgd3B0X3VpbnQzMiBzZXRTdCA9IDA7CisKKyAgIGlmKGtpY2tEeGUpCisgICB7CisgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9JTkZPX01FRCwgIktpY2sgb2ZmIERYRSIpOworCisgICAgIGlmKHRlbXBEeGVDdHJsQmxrLT5sYXN0S2lja09mZkR4ZSA9PSAwKQorICAgICB7CisgICAgICAgc2V0U3QgfD0gV1BBTF9TTVNNX1dMQU5fVFhfRU5BQkxFOyAKKyAgICAgICB0ZW1wRHhlQ3RybEJsay0+bGFzdEtpY2tPZmZEeGUgPSAxOworICAgICB9CisgICAgIGVsc2UgaWYodGVtcER4ZUN0cmxCbGstPmxhc3RLaWNrT2ZmRHhlID09IDEpCisgICAgIHsKKyAgICAgICBjbHJTdCB8PSBXUEFMX1NNU01fV0xBTl9UWF9FTkFCTEU7CisgICAgICAgdGVtcER4ZUN0cmxCbGstPmxhc3RLaWNrT2ZmRHhlID0gMDsKKyAgICAgfQorICAgICBlbHNlC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kxFKQorICAgeworICAgICAgdGVtcER4ZUN0cmxCbGstPnNtc21EeGVIaXN0b2dyYW0gfD0gMTsKKyAgIH0KKyAgIGVsc2UKKyAgIHsKKyAgICAgIHRlbXBEeGVDdHJsQmxrLT5zbXNtRHhlSGlzdG9ncmFtICY9IH4oKHdwdF91aW50MzIpMSk7CisgICB9CisgICB0ZW1wRHhlQ3RybEJsay0+c21zbVJpbmdzRW1wdHlIaXN0b2dyYW0gPSAodGVtcER4ZUN0cmxCbGstPnNtc21SaW5nc0VtcHR5SGlzdG9ncmFtIDw8IDEpOworICAgaWYoc2V0U3QgJiBXUEFMX1NNU01fV0xBTl9UWF9SSU5HU19FTVBUWSkKKyAgIHsKKyAgICAgIHRlbXBEeGVDdHJsQmxrLT5zbXNtUmluZ3NFbXB0eUhpc3RvZ3JhbSB8PSAxOworICAgfQorICAgZWxzZQorICAgeworICAgICAgdGVtcER4ZUN0cmxCbGstPnNtc21SaW5nc0VtcHR5SGlzdG9ncmFtICY9IH4oKHdwdF91aW50MzIpMSk7CisgICB9CisgICB3cGFsTm90aWZ5U21zbShjbHJTdCwgc2V0U3QpOworCisgICByZXR1cm4gZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEAgIEZ1bmN0aW9uIE5hbWUgCisgICAgICBkeGVQc0NvbXBsZXRlCisKKyAgQCAgRGVzY3JpcHRpb246IFV0aWxpdHkgZnVuY3Rpb24gdG8gY2hlY2sgdGhlIHJlc3YgZGVzYyB0byBkZXNpZGUgaWYgd2UgY2FuCisgIGdldCBpbnRvIFBvd2VyIFNhdmUgbW9kZSBub3cgCisKKyAgQCAgUGFyYW1ldGVycworCisgIEAgIFJldHVybgorICAgICAgTm9uZQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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AgfQorICAgfQorICAgZWxzZSAvL3N0aWxsIG1vcmUgcGt0cyB0byBiZSBzZXJ2ZWQgYnkgUklWQQorICAgeworICAgICAgdGVtcER4ZUN0cmxCbGstPnJpbmdOb3RFbXB0eSA9IGVXTEFOX1BBTF9UUlVFOworCisgICAgICBzd2l0Y2goZHhlQ3R4dC0+cml2YVBvd2VyU3RhdGUpCisgICAgICB7CisgICAgICAgICBjYXNlIFdMQU5EWEVfUklWQV9QT1dFUl9TVEFURV9BQ1RJVkU6CisgICAgICAgICAgICAvL05PUAorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICBjYXNlIFdMQU5EWEVfUklWQV9QT1dFUl9TVEFURV9CTVBTX1VOS05PV046CisgICAgICAgICAgICBpZihpbnRyX2Jhc2VkKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgZHhlQ3R4dC0+cml2YVBvd2VyU3RhdGUgPSBXTEFORFhFX1JJVkFfUE9XRVJfU1RBVEVfQUNUSVZFOworICAgICAgICAgICAgICAgZHhlTm90aWZ5U21zbShlV0xBTl9QQUxfVFJVRSwgZVdMQU5fUEFMX0ZBTFNFKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIC8vYXNzZXJ0CisgICAgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgIH0KK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lIAorICAgICAgZHhlUlhFdmVudEhhbmRsZXIKKworICBAICBEZXNjcmlwdGlvbiAKKyAgICAgIEhhbmRsZSBzZXJhaWxpemVkIFJYIGZyYW1lIHJlYWR5IGV2ZW50CisgICAgICBGaXJzdCBkaXNhYmxlIGludGVycnVwdCB0aGVuIHBpY2sgdXAgZnJhbWUgZnJvbSBwcmUgYWxsb2NhdGVkIGJ1ZmZlcgorICAgICAgU2luY2UgZnJhbWUgaGFuZGxlIGlzIGRvZW4sIGNsZWFyIGludGVycnVwdCBiaXQgdG8gcmVhZHkgbmV4dCBpbnRlcnJ1cHQKKyAgICAgIEZpbmFsbHkgcmUgZW5hYmxlIGludGVycnVwdAorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIHdwdF9tc2cgICAqcnhSZWFkeU1zZworICAgICAgICAgICAgICAgICBSWCBmcmFtZSByZWFkeSBNU0cgcG9pbnRlcgorICAgICAgICAgICAgICAgICBpbmNsdWRlIERYRSBjb250cm9sIGNvbnRleHQKKworICBAICBSZXR1cm4KKyAgICAgIE5PTkUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgZHhlUlhFdmVudEhhbmRsZXIKKygKKyAgIHdwdF9tc2cgICAgICAgICAgICAgICAgICpyeFJlYWR5TXNnCispCit7CisgICB3cHRfbXNnICAgICAgICAgICAgICAgICAgKm1zZ0NvbnRlbnQgPSAod3B0X21zZyAqKXJ4UmVhZHlNc2c7CisgICBXTEFORFhFX0N0cmxCbGtUeXBlICAgICAgKmR4ZUN0eHQgICAgPSBOVUxMOworICAgd3B0X3N0YXR1cyAgICAgICAgICAgICAgICBzdGF0dXMgICAgID0gZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICBpbnRTcmMgICAgID0gMDsKKyAgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgICAqY2hhbm5lbENiICA9IE5VTEw7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgIGNoSGlnaFN0YXQgPSAwOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICBjaExvd1N0YXQgID0gMDsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgY2hMb2dSeFN0YXQgID0gMDsKKyAgIHdwdF91aW50MzIgICA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AvKiBJbiBjYXNlIEZXIGNvdWxkIG5vdCBwb3dlciBjb2xsYXBzZSBpbiBJTVBTIG1vZGUKKyAgICAgICAqIE5leHQgcG93ZXIgcmVzdG9yZSBtaWdodCBoYXZlIGVtcHR5IGludGVycnVwdAorICAgICAgICogSWYgSU1QUyBtb2RlIGhhcyBlbXB0eSBpbnRlcnJ1cHQgc2luY2UgUlggdGhyZWFkIHJhY2UsCisgICAgICAgKiBJbnZhbGlkIHJlLWxvYWQgZHJpdmVyIG1pZ2h0IGhhcHBlbgorICAgICAgICogVG8gcHJldmVudCBpbnZhbGlkIHJlLWxvYWQgZHJpdmVyLAorICAgICAgICogSU1QUyBldmVudCBoYW5kbGVyIHNldCBkdW1tcHkgZnJhbWUgY291bnQgKi8KKyAgICAgIGNoYW5uZWxDYi0+bnVtRnJhZ21lbnRDdXJyZW50Q2hhaW4gPSAxOworCisgICAgICAgLyogU2Vjb25kIGxvdyBwcmlvcml0eSAqLworICAgICAgY2hhbm5lbENiID0gJmR4ZUN0eHQtPmR4ZUNoYW5uZWxbV0RUU19DSEFOTkVMX1JYX0xPV19QUkldOworICAgICAgc3RhdHVzID0gZHhlUlhGcmFtZVJlYWR5KGR4ZUN0eHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbENiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoTG93U3RhdCk7CisgICAgICBpZihlV0xBTl9QQUxfU1RBVFVTX1NVQ0NFU1MgIT0gc3RhdHVzKQorICAgICAgeworICAgICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiZHhlUlhFdmVudEhhbmRsZXIgUHVsbCBmcm9tIFJYIGxvdyBjaGFubmVsIGZhaWwiKTsKKyAgICAgIH0KKyAgICAgIC8qIExPVyBQcmlvcml0eSBDSCBzYW1lIGFib3ZlICovCisgICAgICBjaGFubmVsQ2ItPm51bUZyYWdtZW50Q3VycmVudENoYWluID0gMTsKKworICAgICAgaWYgKFdMQU5EWEVfSVNfVkFMSURfQ0hBTk5FTChXRFRTX0NIQU5ORUxfUlhfTE9HKSkKKyAgICAgIHsKKyAgICAgICAgIGNoYW5uZWxDYiA9ICZkeGVDdHh0LT5keGVDaGFubmVsW1dEVFNfQ0hBTk5FTF9SWF9MT0ddOworICAgICAgICAgc3RhdHVzID0gZHhlUlhGcmFtZVJlYWR5KGR4ZUN0eHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbENiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoTG9nUnhTdGF0KTsKKyAgICAgICAgIGlmKGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpCisgICAgICAgICB7CisgICAgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICJkeGVSWEV2ZW50SGFuZGxlciBQdWxsIGZyb20gUlggbG9nIGNoYW5uZWwgZmFpbCIpOworICAgICAgICAgfQorICAgICAgICAgY2hhbm5lbENiLT5udW1GcmFnbWVudEN1cnJlbnRDaGFpbiA9IDE7CisgICAgICB9CisgICAgICAvKiBJbnRlcnJ1cHQgd2lsbCBub3QgZW5hYmxlZCBhdCBoZXJlLCBpdCB3aWxsIGJlIGVuYWJsZWQgYXQgUFMgbW9kZSBjaGFuZ2UgKi8KKyAgICAgIHRlbXBEeGVDdHJsQmxrLT5yeEludERpc2FibGVkQnlJTVBTID0gZVdMQU5fUEFMX1RSVUU7CisgICAgICBkeGVFbnZCbGsucnhJbnREaXNhYmxlUmV0dXJuID0gVk9TX1JFVFVSTl9BRERSRVNTOworCisgICAgICByZXR1cm47CisgICB9CisKK3B1bGxfZnJhbWVzOgorICAgLyogVGVzdCB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XIoY2hhbm5lbENiLCBjaEhpZ2hTdGF0KSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGR4ZUN0eHQtPmRyaXZlclJlbG9hZEluUHJvY2Vzc2luZyA9IGVXTEFOX1BBTF9UUlVFOworICAgICAgICAgICAgd3BhbFdsYW5SZWxvYWQoKTsKKyAgICAgICAgICAgIGR4ZVN0YXJ0U1NSVGltZXIoZHhlQ3R4dCk7CisgICAgICAgICB9CisgICAgICB9CisgICAgICBlbHNlIGlmKChXTEFORFhFX0NIX1NUQVRfSU5UX0RPTkVfTUFTSyAmIGNoSGlnaFN0YXQpIHx8CisgICAgICAgICAgICAgIChXTEFORFhFX0NIX1NUQVRfSU5UX0VEX01BU0sgJiBjaEhpZ2hTdGF0KSkKKyAgICAgIHsKKyAgICAgICAgIC8qIEhhbmRsZSBSWCBSZWFkeSBmb3IgaGlnaCBwcmlvcml0eSBjaGFubmVsICovCisgICAgICAgICBzdGF0dXMgPSBkeGVSWEZyYW1lUmVhZHkoZHhlQ3R4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsQ2IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hIaWdoU3RhdCk7CisgICAgICB9CisgICAgICBlbHNlIGlmKFdMQU5EWEVfQ0hfU1RBVF9NQVNLRURfTUFTSyAmIGNoSGlnaFN0YXQpCisgICAgICB7CisgICAgICAgICBzdGF0dXMgPSBkeGVSWEZyYW1lUmVhZHkoZHhlQ3R4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsQ2IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hIaWdoU3RhdCk7CisgICAgICB9CisgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgIlJYIEhJR0ggQ0ggRVZOVCBTVEFUIDB4JX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7CisgICAgICAgICByZXR1cm47ICAgICAgICAgCisgICAgICB9CisKKyAgICAgIGlmKFdMQU5EWEVfQ0hfU1RBVF9JTlRfRVJSX01BU0sgJiBjaExvd1N0YXQpCisgICAgICB7CisgICAgICAgICAvKiBFcnJvciBIYXBwZW4gZHVyaW5nIHRyYW5zYWN0aW9uLCBIYW5kbGUgaXQgKi8KKyAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgIiUxMXMgOiAweCV4IEVycm9yIFJlcG9ydGVkLCBSZWxvYWQgRHJpdmVyIiwKKyAgICAgICAgICAgICAgICAgIGNoYW5uZWxUeXBlW2NoYW5uZWxDYi0+Y2hhbm5lbFR5cGVdLCBjaExvd1N0YXQpOworCisgICAgICAgICBpZiAoZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTICE9CisgICAgICAgICAgICAgICAgICAgICAgICAgZHhlRXJySGFuZGxlcihjaGFubmVsQ2IsIGNoTG93U3RhdCkpCisgICAgICAgICB7CisgICAgICAgICAgICBkeGVDdHh0LT5kcml2ZXJSZWxvYWRJblByb2Nlc3NpbmcgPSBlV0xBTl9QQUxfVFJVRTsKKyAgICAgICAgICAgIHdwYWxXbGFuUmVsb2FkKCk7CisgICAgICAgICAgICBkeGVTdGFydFNTUlRpbWVyKGR4ZUN0eHQpOworICAgICAgICAgfQorICAgICAgfQorICAgICAgZWxzZSBpZigoV0xBTkRYRV9DSF9TVEFUX0lOVF9FRF9NQVNLICYgY2hMb3dTdGF0KSB8fAorICAgICAgICAgICAgICAgKFdMQU5EWEVfQ0hfU1RBVF9JTlRfRE9ORV9NQVNLICYgY2hMb3dTdGF0KSkKKyAgICAgIHsKKyAgICAgICAgIC8qIEhhbmRsZSBSWCBSZWFkeSBmb3IgbG93IHByaW9yaXR5IGNoYW5uZWwgKi8KKyAgICAgICAgIHN0YXR1cyA9IG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aGFubmVsQ2xlYW5JbnQoY2hhbm5lbENiLCZjaExvZ1J4U3RhdCk7CisgICAgICAgICBpZihlV0xBTl9QQUxfU1RBVFVTX1NVQ0NFU1MgIT0gc3RhdHVzKQorICAgICAgICAgeworICAgICAgICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAiZHhlUlhFdmVudEhhbmRsZXIgSU5UIENsZWFuIHVwIGZhaWwiKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgIH0KKworICAgICAgICAgaWYoV0xBTkRYRV9DSF9TVEFUX0lOVF9FUlJfTUFTSyAmIGNoTG9nUnhTdGF0KQorICAgICAgICAgeworICAgICAgICAgICAgLyogRXJyb3IgSGFwcGVuIGR1cmluZyB0cmFuc2FjdGlvbiwgSGFuZGxlIGl0ICovCisgICAgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAgICIlMTFzIDogMHgleCBFcnJvciBSZXBvcnRlZCwgUmVsb2FkIERyaXZlciIsCisgICAgICAgICAgICAgICAgICAgICBjaGFubmVsVHlwZVtjaGFubmVsQ2ItPmNoYW5uZWxUeXBlXSwgY2hMb2dSeFN0YXQpOworCisgICAgICAgICAgICBpZiAoZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTICE9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHhlRXJySGFuZGxlcihjaGFubmVsQ2IsIGNoTG9nUnhTdGF0KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGR4ZUN0eHQtPmRyaXZlclJlbG9hZEluUHJvY2Vzc2luZyA9IGVXTEFOX1BBTF9UUlVFOworICAgICAgICAgICAgICAgd3BhbFdsYW5SZWxvYWQoKTsKKyAgICAgICAgICAgICAgIGR4ZVN0YXJ0U1NSVGltZXIoZHhlQ3R4dCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UgaWYoKFdMQU5EWEVfQ0hfU1RBVF9JTlRfRURfTUFTSyAmIGNoTG9nUnhTdGF0KSB8fAorICAgICAgICAgICAgICAgICAgKFdMQU5EWEVfQ0hfU1RBVF9JTlRfRE9ORV9NQVNLICYgY2hMb2dSeFN0YXQpKQorICAgICAgICAgeworICAgICAgICAgICAgLyogSGFuZGxlIFJYIFJlYWR5IGZvciBsb3cgcHJpb3JpdHkgY2hhbm5lbCAqLworICAgICAgICAgICAgc3RhdHVzID0gZHhlUlhGcmFtZVJlYWR5KGR4ZUN0eHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbENiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoTG9nUnhTdGF0KTsKKyAgICAgICAgICB9CisKKyAgICAgICAgIC8qIFVwZGF0ZSB0aGUgUnggRE9ORSBoaXN0b2dyYW0gKi8KKyAgICAgICAgIGNoYW5uZWxDYi0+cnhEb25lSGlzdG9ncmFtID0gKGNoYW5uZWxDYi0+cnhEb25lSGlzdG9ncmFtIDw8IDEpOworICAgICAgICAgaWYoV0xBTkRYRV9DSF9TVEFUX0lOVF9ET05FX01BU0sgJiBjaExvZ1J4U3RhdCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGNoYW5uZWxDYi0+cnhEb25lSGlzdG9ncmFtIHw9IDE7CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICBjaGFubmVsQ2ItPnJ4RG9uZUhpc3RvZ3JhbSAmPSB+MTsKKyAgICAgICAgIH0KKyAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAiU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AiJTExcyA6IDB4JXggRXJyb3IgUmVwb3J0ZWQsIFJlbG9hZCBEcml2ZXIiLAorICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbFR5cGVbY2hhbm5lbENiLT5jaGFubmVsVHlwZV0sIGNoTG9nUnhGd1N0YXQpOworCisgICAgICAgICAgICBpZiAoZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTICE9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHhlRXJySGFuZGxlcihjaGFubmVsQ2IsIGNoTG9nUnhGd1N0YXQpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgZHhlQ3R4dC0+ZHJpdmVyUmVsb2FkSW5Qcm9jZXNzaW5nID0gZVdMQU5fUEFMX1RSVUU7CisgICAgICAgICAgICAgICB3cGFsV2xhblJlbG9hZCgpOworICAgICAgICAgICAgICAgZHhlU3RhcnRTU1JUaW1lcihkeGVDdHh0KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgfQorICAgICAgICAgZWxzZSBpZigoV0xBTkRYRV9DSF9TVEFUX0lOVF9FRF9NQVNLICYgY2hMb2dSeEZ3U3RhdCkgfHwKKyAgICAgICAgICAgICAgICAgKFdMQU5EWEVfQ0hfU1RBVF9JTlRfRE9ORV9NQVNLICYgY2hMb2dSeEZ3U3RhdCkpCisgICAgICAgICB7CisgICAgICAgICAgICBpZiAoIWR4ZUN0eHQtPmhvc3RJbml0aWF0ZWRIMkgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBkeGVDdHh0LT5yZWNlaXZlTWJNc2dDQihkeGVDdHh0LT5jbGllbnRDdHh0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHN0YXR1cyA9IGR4ZVJYRnJhbWVSZWFkeShkeGVDdHh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxDYiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaExvZ1J4RndTdGF0KTsKKyAgICAgICAgICAgICAgIGlmIChjaGFubmVsQ2ItPm51bUZyZWVEZXNjID09IGNoYW5uZWxDYi0+bnVtRGVzYykKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICAgKiBXZSBoYXZlIGFscmVhZHkgY2xlYXJlZCB0aGUgaW50ZXJydXB0cyBiZWZvcmUgY29taW5nIGhlcmUsCisgICAgICAgICAgICAgICAgICAgKiBidXQgaXQgY2FuIGhhcHBlbiB0aGF0IERYRSB3aWxsIGNvcHkgc29tZSBuZXcgcGFja2V0cyBhZnRlcgorICAgICAgICAgICAgICAgICAgICogdGhhdCBhbmQgcmFpc2UgaW50ZXJydXB0cyBmb3IgdGhvc2UuIFRoZSBwYWNrZXRzIHdpbGwgYmUKKyAgICAgICAgICAgICAgICAgICAqIHByb2Nlc3NlZCBhYm92ZSBidXQgdGhlIGludGVycnVwdHMgd2lsbCBzdGlsbCBiZSBwZW5kaW5nLgorICAgICAgICAgICAgICAgICAgICogSXRzIHNhZmUgdG8gY2xlYXIgdGhvc2UgaW50ZXJydXB0cyBoZXJlIGJlY2F1c2Ugd2UgaGF2ZQorICAgICAgICAgICAgICAgICAgICogcHVsbGVkIGRhdGEgZnJvbSBhbGwgdGhlIGFsbG9jYXRlZCBkZXNjcmlwdG9ycy4KKyAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgZHhlQ2hhbm5lbENsZWFuSW50KGNoYW5uZWxDYiwmY2hMb2dSeEZ3U3RhdCk7CisgICAgICAgICAgICAgICAgICBkeGVDdHh0LT5ob3N0SW5pdGlhdGVkSDJIID0gMDsKKyAgICAgICAgICAgICAgICAgIGR4ZUN0eHQtPnJlY2VpdmVMb2dDb21wbGV0ZUNCKGR4ZUN0eHQtPmNsaWVudEN0eHQpOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAg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YmxlIFJ4IHBhY2tldCBidWZmZXIKKyAgICAgIHBvaW50ZXJzLgorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIHdwdF9tc2cgICAqcnhQa3RBdmFpbE1zZworICAgICAgICAgICAgICAgICBSWCBmcmFtZSByZWFkeSBNU0cgcG9pbnRlcgorICAgICAgICAgICAgICAgICBpbmNsdWRlIERYRSBjb250cm9sIGNvbnRleHQKKworICBAICBSZXR1cm4KKyAgICAgIE5PTkUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgZHhlUlhQYWNrZXRBdmFpbGFibGVFdmVudEhhbmRsZXIKKygKKyAgIHdwdF9tc2cgICAgICAgICAgICAgICAgICpyeFBrdEF2YWlsTXNnCispCit7CisgICBXTEFORFhFX0N0cmxCbGtUeXBlICAgICAgKmR4ZUN0eHQgICAgPSBOVUxMOworICAgd3B0X3N0YXR1cyAgICAgICAgICAgICAgICBzdGF0dXMgICAgID0gZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTOworICAgV0xBTkRYRV9DaGFubmVsQ0JUeXBlICAgICpjaGFubmVsQ2IgID0gTlVMTDsKKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAiJXMgRW50ZXIiLCBfX2Z1bmNfXyk7CisKKyAgIC8qIFNhbml0eSBDaGVjayAqLworICAgaWYoTlVMTCA9PSByeFBrdEF2YWlsTXNnKQorICAgeworICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiZHhlUlhQYWNrZXRBdmFpbGFibGVFdmVudEhhbmRsZXIgQ29udGV4dCBpcyBub3QgdmFsaWQiKTsKKyAgICAgIH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uID0gVk9TX1JFVFVSTl9BRERSRVNTOworICAgfQorfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEAgIEZ1bmN0aW9uIE5hbWUgCisgICAgICBkeGVSWElTUgorCisgIEAgIERlc2NyaXB0aW9uIAorICAgICAgUlggZnJhbWUgcmVhZHkgaW50ZXJydXB0IHNlcnZpY2Ugcm91dGluZQorICAgICAgaW50ZXJydXB0IGVudHJ5IGZ1bmN0aW9uLCB0aGlzIGZ1bmN0aW9uIGNhbGxlZCBiYXNlZCBvbiBJU1IgY29udGV4dAorICAgICAgTXVzdCBiZSBzZXJpYWxpemVkCisKKyAgQCAgUGFyYW1ldGVycworICAgICAgdm9pZCAgICAqaG9zdEN0eHQKKyAgICAgICAgICAgICAgIERYRSBob3N0IGRyaXZlciBjb250cm9sIGNvbnRleHQsCisgICAgICAgICAgICAgICBwcmUgcmVnaXN0ZXJkIGR1cmluZyBpbnRlcnJ1cHQgcmVnaXN0cmF0aW9uCisKKyAgQCAgUmV0dXJuCisgICAgICBOT05FCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitzdGF0aWMgdm9pZCBkeGVSWElTUgorKAorICAgdm9pZCAgICAgICAgICAgICAgICAgICAgKmhvc3RDdHh0CispCit7CisgICBXTEFORFhFX0N0cmxCbGtUeXBlICAgICAgKmR4ZUN0eHQgICAgPSAoV0xBTkRYRV9DdHJsQmxrVHlwZSAqKWhvc3RDdHh0OworICAgd3B0X3N0YXR1cyAgICAgICAgICAgICAgICBzdGF0dXMgICAgID0gZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICByZWdWYWx1ZTsKKworICAgLyogU2V0IEludGVycnVwdCBwcm9jZXNzaW5nIGJpdAorICAgICogRHVyaW5n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ICAgICAgICAgICAgICAiZHhlUlhGcmFtZVJlYWR5SVNSIERpc2FibGUgUlggcmVhZHkgaW50ZXJydXB0IGZhaWwiKTsKKyAgICAgIHJldHVybjsgICAgICAgICAKKyAgIH0KKworICAgLyogU2VyaWFsaXplIFJYIFJlYWR5IGludGVycnVwdCB1cG9uIFJYIHRocmVhZCAqLworICAgaWYoTlVMTCA9PSBkeGVDdHh0LT5yeElzck1zZykKKyAgIHsKKyAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgImR4ZVJYRnJhbWVSZWFkeUlTUiBOVUxMIG1lc3NhZ2UiKTsKKyAgICAgIEhEWEVfQVNTRVJUKDApOworICAgICAgcmV0dXJuOworICAgfQorCisgICBzdGF0dXMgPSB3cGFsUG9zdFJ4TXNnKFdESV9HRVRfUEFMX0NUWCgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICBkeGVDdHh0LT5yeElzck1zZyk7CisgICBpZihlV0xBTl9QQUxfU1RBVFVTX1NVQ0NFU1MgIT0gc3RhdHVzKQorICAgeworICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAiZHhlUlhGcmFtZVJlYWR5SVNSIGludGVycnVwdCBzZXJpYWxpemUgZmFpbCIpOworICAgfQorCisgICByZXR1cm47Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQCAgRnVuY3Rpb24gTmFtZSAKKyAgICAgIGR4ZVRYUHVzaEZyYW1lCisKKyAgQCAgRGVzY3JpcHRpb24KKyAgICAgIFB1c2ggVFggZnJhbWUgaW50byBEWEUgZGVzY3JpcHRvciBhbmQgRFhFIHJlZ2lzdGVyCisgICAgICBTZW5kIG5vdGlmaWNhdGlvbiB0byBEWEUgcmVnaXN0ZXIgdGhhdCBUWCBmcmFtZSBpcyByZWFkeSB0byB0cmFuc2ZlcgorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgICpjaGFubmVsRW50cnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGFubmVsIHNwZWNpZmljIGNvbnRyb2wgYmxvY2sKKyAgICAgIHdwdF9wYWNrZXQgICAgICAgICAgICAgICpwYWxQYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYWNrZXQgcG9pbnRlciByZWFkeSB0byB0cmFuc2ZlcgorCisgIEAgIFJldHVybgorICAgICAgUEFMX1NUQVRVU19UCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworc3RhdGljIHdwdF9zdGF0dXMgZHhlVFhQdXNoRnJhbWUKKygKKyAgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgICpjaGFubmVsRW50cnksCisgICB3cHRfcGFja2V0ICAgICAgICAgICAgICAqcGFsUGFja2V0CispCit7CisgICB3cHRfc3RhdHVzICAgICAgICAgICAgICAgICAgc3RhdHVzID0gZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTOworICAgV0xBTkRYRV9EZXNjQ3RybEJsa1R5cGUgICAgKmN1cnJlbnRDdHJsQmxrID0gTlVMTDsKKyAgIFdMQU5EWEVfRGVzY0N0cmxCbGtUeXBlICAgICp0YWlsQ3RybEJsayAgICA9IE5VTEw7CisgICBXTEFORFhFX0Rlc2NUeXBlICAgICAgICAgICAqY3VycmVudERlc2MgICAgPSBOVUxMOworICAgV0xBTkRYRV9EZXNjVHlwZSAgICAgICAgICAgKmZpcnN0RGVzYyAgICAgID0gTlVMTDsKKyAgIFdMQU5EWEVfRGVzY1R5cGUgICAgICAgICAgICpMYXN0RGVzYyAgICAgICA9IE5VTEw7CisgICBXTEFORFhFX0Rlc2NUeXBlICAgICAgICAgICAqdGFpbERlc2MgICAgICAgPSBOVUxMOworICAgdm9pZCAgICAgICAgICAgICAgICAgICAgICAgKnNvdXJjZVBoeXNpY2FsQWRkcmVzcyA9IE5VTEw7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgeGZlclNpemUgPSAwOworICAgd3B0X2l0ZXJhdG9yICAgICAgICAgICAgICAgIGl0ZXJhdG9yOworICAgd3B0X3VpbnQ4ICAgICAgICAgICAgICAgICAgIEtpY2tEeGUgICA9IDA7CisKKyAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgIiVzIEVudGVyIiwgX19mdW5jX18pOworCisgICB0ZW1wRHhlQ3RybEJsay0+c21zbVRvZ2dsZWQgPSBlV0xBTl9QQUxfRkFMU0U7CisgICBpZigoMCA9PSB0ZW1wRHhlQ3RybEJsay0+ZHhlQ2hhbm5lbFtXRFRTX0NIQU5ORUxfVFhfTE9XX1BSSV0ubnVtUnN2ZERlc2MpICYmCisgICAgICAoMCA9PSB0ZW1wRHhlQ3RybEJsay0+ZHhlQ2hhbm5lbFtXRFRTX0NIQU5ORUxfVFhfSElHSF9QUkldLm51bVJzdmREZXNjKSkKKyAgIHsKKyAgICAgICBLaWNrRHhlID0gMTsKKyAgIH0KKworICAgLyogS2ljayBEWEUgd2hlbiB0aGUgcmluZyBpcyBhYm91dCB0byBmaWxsICovCisgICBpZiAoV0xBTkRYRV9UWF9MT1dfUkVTX1RIUkVTSE9MRCA+PSBjaGFubmVsRW50cnktPm51bUZyZWVEZXNjKQorICAgeworICAgICAgIEtpY2tEeGUgPSAxOworICAgICAgIHRhaWxDdHJsQmxrID0gY2hhbm5lbEVudHJ5LT50YWlsQ3RybEJsazsKKyAgICAgICB0YWlsRGVzYyA9IHRha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iZHhlVFhQdXNoRnJhbWUgaXRlcmF0b3IgaW5pdCBmYWlsIik7CisgICAgICByZXR1cm4gc3RhdHVzOworICAgfQorCisgICAvKiAhISEhIFJldmlzaXQgYnJlYWsgY29uZGl0aW9uICEhISEhISEgKi8KKyAgIHdoaWxlKDEpCisgICB7CisgICAgICAvKiBHZXQgY3VycmVudCBkZXNjcmlwdG9yIHBvaW50ZXIgZnJvbSBjdXJyZW50IGNvbnRyb2wgYmxvY2sgKi8KKyAgICAgIGN1cnJlbnREZXNjID0gY3VycmVudEN0cmxCbGstPmxpbmtlZERlc2M7CisgICAgICBpZihOVUxMID09IGZpcnN0RGVzYykKKyAgICAgIHsKKyAgICAgICAgIGZpcnN0RGVzYyA9IGN1cnJlbnRDdHJsQmxrLT5saW5rZWREZXNjOworICAgICAgfQorICAgICAgLyogQWxsIGNvbnRyb2wgYmxvY2sgd2lsbCBoYXZlIHNhbWUgcGFsUGFja2V0IFBvaW50ZXIKKyAgICAgICAqIHRvIG1ha2UgbG9naWMgc2ltcGxlciAqLworICAgICAgY3VycmVudEN0cmxCbGstPnhmckZyYW1lID0gcGFsUGFja2V0OworCisgICAgICAvKiBHZXQgbmV4dCBmcmFnbWVudCBwaHlzaWNhbCBhZGRyZXNzIGFuZCBmcmFnbWVudCBzaXplCisgICAgICAgKiBpZiB0aGlzIGlzIHRoZSBmaXJzdCB0cmlhbCwgd2lsbCBnZXQgZmlyc3QgcGh5c2ljYWwgYWRkcmVzcworICAgICAgICogaWYgbm8gbW9yZSBmcmFnbWVudCwgRGVzY3JpcHRvciBzcmMgYWRkcmVzcyB3aWxsIGJlIHNldCBhcyBOVUxMLCBPSz8/PyAqLworICAgICAgc3RhdHVzID0gd3BhbEl0ZXJhdG9yTmV4dCgmaXRlcmF0b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhbFBhY2tldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnNvdXJjZVBoeXNpY2FsQWRkcmVzcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnhmZXJTaXplKTsKKyAgICAgIGlmKGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpCisgICAgICB7CisgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICJkeGVUWFB1c2hGcmFtZSBHZXQgbmV4dCBmcmFtZSBmYWlsIik7CisgICAgICAgICByZXR1cm4gc3RhdHVzOworICAgICAgfQorICAgICAgaWYoKE5VTEwgPT0gc291cmNlUGh5c2ljYWxBZGRyZXNzKSB8fAorICAgICAgICAgKDAgICAgPT0geGZlclNpemUpKQorICAgICAgeworICAgICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAgICAgICAiZHhlVFhQdXNoRnJhbWUgZW5kIG9mIGN1cnJlbnQgZnJhbWUiKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorCisgICAgICAvKiBUaGlzIGlzIHRoZSBMQVNUIGRlc2NyaXB0b3IgdmFsaWQgZm9yIHRoaXMgdHJhbnNhY3Rpb24gKi8KKyAgICAgIExhc3REZXNjICAgID0gY3VycmVudEN0cmxCbGstPmxpbmtlZERlc2M7CisKKyAgICAgIC8qIFByb2dyYW0gRFhFIGRlc2NyaXB0b3IgKi8KKyAgICAgIGN1cnJlbnREZXNjLT5keGVkZXNjLmR4ZV9zaG9ydF9kZXNjLnNyY01lbUFkZHJMID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFORFhFX1UzMl9TV0FQX0VORElBTigod3B0X3VpbnQzMikodWludHB0cl90KXNvdXJjZVBoeXNpY2FsQWRkcmVzcyk7CisKKyAgICAgIC8qIEp1c3Qgbm9ybWFsIGRhdGEgdHJhbnNmZXIgZnJvbSBhQ1BVIEZsYXQgTWVtb3J5IHRvIEJNVSBRICovCisgICAgICBpZigoV0RUU19DSEFOTkVMX1RYX0xPV19QUkkgID09IGNoYW5uZWxFbnRyeS0+Y2hhbm5lbFR5cGUpIHx8CisgICAgICAgICAoV0RUU19DSEFOTkVMX1RYX0hJR0hfUFJJID09IGNoYW5uZWxFbnRyeS0+Y2hhbm5lbFR5cGUpKQorICAgICAgeworICAgICAgICAgY3VycmVudERlc2MtPmR4ZWRlc2MuZHhlX3Nob3J0X2Rlc2MuZHN0TWVtQWRkckwgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFORFhFX1UzMl9TV0FQX0VORElBTihjaGFubmVsRW50cnktPmNoYW5uZWxDb25maWcucmVmV1EpOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgLyogVGVzdCBzcGVjaWZpYyBIMkggdHJhbnNmZXIsIGRlc3RpbmF0aW9uIGFkZHJlc3MgYWxyZWFkeSBzZXQKKyAgICAgICAgICAqIERvIE5vdGhpbmcgKi8KKyAgICAgIH0KKyAgICAgIGN1cnJlbnREZXNjLT54ZnJTaXplID0gV0xBTkRYRV9VMzJfU1dBUF9FTkRJQU4oeGZlclNpemUpOworCisgICAgICAvKiBQcm9ncmFtIGNoYW5uZWwgY29udHJvbCByZWdpc3RlciAqLworICAgICAgLyogRmlyc3QgZnJhbWUgbm90IHNldCBWQUwgYml0LCB3aHkgPz8/ICovCisgICAgICBpZigwID09IGNoYW5uZWxFbnRyeS0+bnVtRnJhZ21lbnRDdXJyZW50Q2hhaW4pCisgICAgICB7CisgICAgICAgICBjdXJyZW50RGVzYy0+ZGVzY0N0cmwuY3RybCA9IGNoYW5uZWxFbnRyeS0+ZXh0cmFDb25maWcuY3dfY3RybF93cml0ZTsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgIGN1cnJlbnREZXNjLT5kZXNjQ3RybC5jdHJsID0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FubmVsUmVnaXN0ZXIuY2hEWEVDdHJsUmVnQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbEVudHJ5LT5leHRyYUNvbmZpZy5jaGFuX21hc2spOworICAgaWYoZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgIHsKKyAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgImR4ZVRYUHVzaEZyYW1lIFdyaXRlIENoYW5uZWwgQ3RybCBSZWdpc3RlciBmYWlsIik7CisgICAgICByZXR1cm4gc3RhdHVzOworICAgfQorCisgICAvKiBVcGRhdGUgY2hhbm5lbCBoZWFkIGFzIG5leHQgYXZhbGlhYmxlIGxpbmtlZCBzbG90ICovCisgICBjaGFubmVsRW50cnktPmhlYWRDdHJsQmxrID0gY3VycmVudEN0cmxCbGs7CisKKyAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgIiVzIEV4aXQiLCBfX2Z1bmNfXyk7CisgICByZXR1cm4gc3RhdHVzOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEAgIEZ1bmN0aW9uIE5hbWUgCisgICAgICBkeGVUWENvbXBGcmFtZQorCisgIEAgIERlc2NyaXB0aW9uIAorICAgICAgVFggRnJhbWUgdHJhbnNmZXIgY29tcGxldGUgZXZlbnQgaGFuZGxlcgorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIFdMQU5EWEVfQ3RybEJsa1R5cGUgICAgICpkeGVDdHJsQmxrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERYRSBob3N0IGRyaXZlciBtYWluIGNvbnRyb2wgYmxvY2sKKyAgICAgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgICpjaGFubmVsRW50cnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGFubmVsIHNwZWNpZmljIGNvbnRyb2wgYmxvY2sKKworICBAICBSZXR1cm4KKyAgICAgIFBBTF9TVEFUVVNfVAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3N0YXRpYyB3cHRfc3RhdHVzIGR4ZVRYQ29tcEZyYW1lCisoCisgICBXTEFORFhFX0N0cmxCbGtUeXBlICAgICAqaG9zdEN0eHQsCisgICBXTEFORFhFX0NoYW5uZWxDQlR5cGUgICAqY2hhbm5lbEVudHJ5CispCit7CisgICB3cHRfc3RhdHVzICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgIFdMQU5EWEVfRGVzY0N0cmxCbGtUeXBlICAqY3VycmVudEN0cmxCbGsgPSBOVUxMOworICAgV0xBTkRYRV9EZXNjVHlwZSAgICAgICAgICpjdXJyZW50RGVzYyAgICA9IE5VTEw7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgIGRlc2NDdHJsVmFsdWUgID0gMDsKKyAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAqbG93VGhyZXNob2xkICAgPSBOVUxMOworCisgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICIlcyBFbnRlciIsIF9fZnVuY19fKTsKKworICAgLyogU2FuaXR5ICovCisgICBpZigoTlVMTCA9PSBob3N0Q3R4dCkgfHwgKE5VTEwgPT0gY2hhbm5lbEVudHJ5KSkKKyAgIHsKKyAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSw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isgICAgICAgICAgICAgICAgICAiSW52YWxpZCB0cmFuc2ZlciBmcmFtZSIpOworICAgICAgICAgIEhEWEVfQVNTRVJUKDApOworICAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2hhbm5lbEVudHJ5LT5udW1GcmVlRGVzYysrOworICAgICAgY2hhbm5lbEVudHJ5LT5udW1Sc3ZkRGVzYy0tOworCisgICAgICAvKiBTZW5kIEZyYW1lIFRYIENvbXBsZXRlIG5vdGlmaWNhdGlvbiB3aXRoIGZyYW1lIHN0YXJ0IGZyYWdtZW50IGxvY2F0aW9uICovCisgICAgICBpZihXTEFORFhFX1UzMl9TV0FQX0VORElBTihkZXNjQ3RybFZhbHVlKSAmIFdMQU5EWEVfREVTQ19DVFJMX0VPUCkKKyAgICAgIHsKKyAgICAgICAgIGhvc3RDdHh0LT50eENvbXBsZXRlZEZyYW1lcy0tOworICAgICAgICAgc3RhdHVzID0gd3BhbFVubG9ja1BhY2tldChjdXJyZW50Q3RybEJsay0+eGZyRnJhbWUpOworICAgICAgICAgaWYgKGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpCisgICAgICAgICB7CisgICAgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICJkeGVSWEZyYW1lUmVhZHkgdW5hYmxlIHRvIHVubG9jayBwYWNrZXQiKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IHdwYWxNdXRleFJlbGVhc2UoJmNoYW5uZWxFbnRyeS0+ZHhlQ2hhbm5lbExvY2spOworICAgICAgICAgICAgaWYoZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgImR4ZVRYQ29tcEZyYW1lIE11dGV4IFJlbGVhc2UgZmFpbCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgIH0KKyAgICAgICAgIGhvc3RDdHh0LT50eENvbXBDQihob3N0Q3R4dC0+Y2xpZW50Q3R4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50Q3RybEJsay0+eGZyRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTKTsKKyAgICAgICAgIGNoYW5uZWxFbnRyeS0+bnVtRnJhZ21lbnRDdXJyZW50Q2hhaW4gPSAwOworICAgICAgfQorICAgICAgY3VycmVudEN0cmxCbGsgPSBjdXJyZW50Q3RybEJsay0+bmV4dEN0cmxCbGs7CisgICAgICBjdXJyZW50RGVzYyAgICA9IGN1cnJlbnRDdHJsQmxrLT5saW5rZWREZXNjOworCisgICAgICAvKiBCcmVhayBjb25kaXRpb24KKyAgICAgICAqIEhlYWQgY29udHJvbCBibG9jayBpcyB0aGUgY29udHJvbCBibG9jayBtdXN0IGJlIHByb2dyYW1lZCBmb3IgdGhlIG5leHQgVFgKKyAgICAgICAqIHNvLCBoZWFkIGNvbnRyb2wgYmxvY2sgaXMgbm90IHByb2dyYW1tZWQgY29udHJvbCBibG9jayB5ZXQKKyAgICAgICAqIGlmIGxvb3AgZW5jb3VudGUgaGVhZCBjb250cm9sIGJsb2NrLCBzdG9wIHRvIGNvbXBsZXRlCisgICAgICAgKiBpbiB0aGVvcnksIENPTVAgQ0IgbXVzdCBiZSBjYWxsZWQgYWxyZWFkeSA/Pz8gKi8KKyAgICAgIGlmKGN1cnJlbnRDdHJsQmxrID09IGNoYW5uZWxFbnRyeS0+aGVhZEN0cmxCbGspCisgICAgICB7CisgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RV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ICpsb3dUaHJlc2hvbGQgPSBXTEFORFhFX1RYX0xPV19SRVNfVEhSRVNIT0xEOworICAgICAgfQorCisgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgIkRYRSBUWCAlZCBjaGFubmVsIHJlY292ZXJlZCBmcm9tIGxvdyByZXNvdXJjZSIsIGNoYW5uZWxFbnRyeS0+Y2hhbm5lbFR5cGUpOworICAgICAgaG9zdEN0eHQtPmxvd1Jlc291cmNlQ0IoaG9zdEN0eHQtPmNsaWVudEN0eHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsRW50cnktPmNoYW5uZWxUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVdMQU5fUEFMX1RSVUUpOworICAgICAgY2hhbm5lbEVudHJ5LT5oaXRMb3dSZXNvdXJjZSA9IGVXTEFOX1BBTF9GQUxTRTsKKyAgIH0KKworICAgc3RhdHVzID0gd3BhbE11dGV4UmVsZWFzZSgmY2hhbm5lbEVudHJ5LT5keGVDaGFubmVsTG9jayk7CisgICBpZihlV0xBTl9QQUxfU1RBVFVTX1NVQ0NFU1MgIT0gc3RhdHVzKQorICAgeworICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiZHhlVFhDb21wRnJhbWUgTXV0ZXggUmVsZWFzZSBmYWlsIik7CisgICB9CisKKyAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgIiVzIEV4aXQiLCBfX2Z1bmNfXyk7CisgICByZXR1cm4gc3RhdHVzOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEAgIEZ1bmN0aW9uIE5hbWUKKyAgICAgIGR4ZVRYQ2xlYW51cAorCisgIEAgIERlc2NyaXB0aW9uCisgICAgICBDbGVhbnVwIHRoZSBUWCBjaGFubmVscyBhZnRlciBEWEUgRXJyb3IKKworICBAICBQYXJhbWV0ZXJzCisgICAgICBXTEFORFhFX0N0cmxCbGtUeXBlICAgICAqZHhlQ3RybEJsaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEWEUgaG9zdCBkcml2ZXIgbWFpbiBjb250cm9sIGJsb2NrCisKKyAgQCAgUmV0dXJuCisgICAgICBQQUxfU1RBVFVTX1QKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitzdGF0aWMgd3B0X3N0YXR1cyBkeGVUWENsZWFudXAKKygKKyAgIFdMQU5EWEVfQ3RybEJsa1R5cGUgICAgICpob3N0Q3R4dAorKQoreworICAgd3B0X3N0YXR1cyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlV0xBTl9QQUxfU1RBVFVTX1NVQ0NFU1M7CisgICBXTEFORFhFX0Rlc2NDdHJsQmxrVHlwZSAgKmN1cnJlbnRDdHJsQmxrID0gTlVMTDsKKyAgIFdMQU5EWEVfRGVzY1R5cGUgICAgICAgICAqY3VycmVudERlc2MgICAgPSBOVUxMOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICBkZXNjQ3RybFZhbHVlICA9IDA7CisgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgKmxvd1RocmVzaG9sZCAgID0gTlVMTDsKKyAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgaWR4OworICAgV0xBTkRYRV9DaGFubmVsQ0JUeXBlICAgICpjaGFubmVsRW50cnk7CisKKyAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1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EVudHJ5LT5jaGFubmVsVHlwZV0pOworICAgICAgICAgIGNvbnRpbnVlOworICAgICAgfQorCisgICAgICBzdGF0dXMgPSB3cGFsTXV0ZXhBY3F1aXJlKCZjaGFubmVsRW50cnktPmR4ZUNoYW5uZWxMb2NrKTsKKyAgICAgIGlmKGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpCisgICAgICB7CisgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogJTExcyBNdXRleCBBY3F1aXJlIGZhaWwiLF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgY2hhbm5lbFR5cGVbY2hhbm5lbEVudHJ5LT5jaGFubmVsVHlwZV0pOworICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgIH0KKworICAgICAgY3VycmVudEN0cmxCbGsgPSBjaGFubmVsRW50cnktPnRhaWxDdHJsQmxrOworICAgICAgY3VycmVudERlc2MgICAgPSBjdXJyZW50Q3RybEJsay0+bGlua2VkRGVzYzsKKworICAgICAgaWYoIGN1cnJlbnRDdHJsQmxrID09IGNoYW5uZWxFbnRyeS0+aGVhZEN0cmxCbGsgKQorICAgICAgeworICAgICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAiJXM6ICUxMXMgSGVhZCBhbmQgVGFpbCBhcmUgU2FtZSIsX19mdW5jX18sCisgICAgICAgICAgICAgICAgICBjaGFubmVsVHlwZVtjaGFubmVsRW50cnktPmNoYW5uZWxUeXBlXSk7CisKKyAgICAgICAgIHN0YXR1cyA9IHdwYWxNdXRleFJlbGVhc2UoJmNoYW5uZWxFbnRyeS0+ZHhlQ2hhbm5lbExvY2spOworICAgICAgICAgaWYoZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgICAgIHsKKyAgICAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgIiVzOiAlMTFzIE11dGV4IFJlbGVhc2UgZmFpbCIsX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICBjaGFubmVsVHlwZVtjaGFubmVsRW50cnktPmNoYW5uZWxUeXBlXSk7CisgICAgICAgICAgICByZXR1cm4gc3RhdHVzOworICAgICAgICAgfQorICAgICAgICAgY29udGludWU7CisgICAgICB9CisKKyAgICAgIHdoaWxlKDEpCisgICAgICB7CisgICAgICAgICBkZXNjQ3RybFZhbHVlID0gY3VycmVudERlc2MtPmRlc2NDdHJsLmN0cmw7CisgICAgICAgICBpZigoZGVzY0N0cmxWYWx1ZSAmIFdMQU5EWEVfREVTQ19DVFJMX1ZBTElEKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgICAvKiBpbnZhbGlkYXRlLi4uICovCisgICAgICAgICAgICAgY3VycmVudERlc2MtPmRlc2NDdHJsLmN0cmwgJj0gfldMQU5EWEVfREVTQ19DVFJMX1ZBTElEOworICAgICAgICAgfQorCisgICAgICAgICBpZihjdXJyZW50Q3RybEJsay0+eGZyRnJhbWUgPT0gTlVMTCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAgICIlczogJTExcyBJbnZhbGlkIHRyYW5zZmVyIGZyYW1lIixfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxUeXBlW2NoYW5uZWxFbnRyeS0+Y2hhbm5lbFR5cGVdKTsKKyAgICAgICAgICAgICBIRFhFX0FTU0VSVCg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KyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogTXV0ZXggUmVsZWFzZSBmYWlsIixfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICByZXR1cm4gc3RhdHVzOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaG9zdEN0eHQtPnR4Q29tcENCKGhvc3RDdHh0LT5jbGllbnRDdHh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRDdHJsQmxrLT54ZnJGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlV0xBTl9QQUxfU1RBVFVTX1NVQ0NFU1MpOyAvL21pcjogU1VDQ0VTUyBvciBGQUlMVVJFPworICAgICAgICAgICAgY2hhbm5lbEVudHJ5LT5udW1GcmFnbWVudEN1cnJlbnRDaGFpbiA9IDA7CisgICAgICAgICB9CisgICAgICAgICBjdXJyZW50Q3RybEJsayA9IGN1cnJlbnRDdHJsQmxrLT5uZXh0Q3RybEJsazsKKyAgICAgICAgIGN1cnJlbnREZXNjICAgID0gY3VycmVudEN0cmxCbGstPmxpbmtlZERlc2M7CisKKyAgICAgICAgIC8qIEJyZWFrIGNvbmRpdGlvbgorICAgICAgICAgICogSGVhZCBjb250cm9sIGJsb2NrIGlzIHRoZSBjb250cm9sIGJsb2NrIG11c3QgYmUgcHJvZ3JhbWVkIGZvciB0aGUgbmV4dCBUWAorICAgICAgICAgICogc28sIGhlYWQgY29udHJvbCBibG9jayBpcyBub3QgcHJvZ3JhbW1lZCBjb250cm9sIGJsb2NrIHlldAorICAgICAgICAgICogaWYgbG9vcCBlbmNvdW50ZSBoZWFkIGNvbnRyb2wgYmxvY2ssIHN0b3AgdG8gY29tcGxldGUKKyAgICAgICAgICAqIGluIHRoZW9yeSwgQ09NUCBDQiBtdXN0IGJlIGNhbGxlZCBhbHJlYWR5ID8/PyAqLworICAgICAgICAgaWYoY3VycmVudEN0cmxCbGsgPT0gY2hhbm5lbEVudHJ5LT5oZWFkQ3RybEJsaykKKyAgICAgICAgIHsKKyAgICAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICAgIiVzOiAlMTFzIGNhdWdodCB1cCB3aXRoIGhlYWQgcHRyIixfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxUeXBlW2NoYW5uZWxFbnRyeS0+Y2hhbm5lbFR5cGVdKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgfQorICAgICAgICAgLyogVkFMSUQgQml0IGNoZWNrID8/Pz8gKi8KKyAgICAgIH0KKworICAgICAgLyogVGFpbCBhbmQgSGVhZCBDb250cm9sIGJsb2NrIG11c3QgYmUgc2FtZSAqLworICAgICAgY2hhbm5lbEVudHJ5LT50YWlsQ3RybEJsayA9IGN1cnJlbnRDdHJsQmxrOworICAgICAgLyogUmUtU3luYyBIZWFkIGFuZCBDRFIgKi8KKyAgICAgIHN0YXR1cyA9IHdwYWxXcml0ZVJlZ2lzdGVyKGNoYW5uZWxFbnRyeS0+Y2hhbm5lbFJlZ2lzdGVyLmNoRFhFRGVzY2xSZWdBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsRW50cnktPmhlYWRDdHJsQmxrLT5saW5rZWREZXNjUGh5QWRkcik7CisgICAgICBpZihlV0xBTl9QQUxfU1RBVFVTX1NVQ0NFU1MgIT0gc3RhdHVzKQorICAgICAgeworICAgICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiZHhlQ2hhbm5lbEluaXRQcm9ncmFtIFdyaXRlIERFU0MgQWRkcmVzcyByZWdpc3RlciBmYWlsIik7CisgICAgICAgICBzdGF0dXMgPSB3cGFsT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nIGEgcmVtYWluaW5nIHBhY2tldCBmcm9tIFRMICovCisgICAgICAgICBpZihXTEFORFhFX1RYX0xPV19SRVNfVEhSRVNIT0xEID4gKmxvd1RocmVzaG9sZCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgICpsb3dUaHJlc2hvbGQgPSBXTEFORFhFX1RYX0xPV19SRVNfVEhSRVNIT0xEOworICAgICAgICAgfQorCisgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgIkRYRSBUWCAlZCBjaGFubmVsIHJlY292ZXJlZCBmcm9tIGxvdyByZXNvdXJjZSIsIGNoYW5uZWxFbnRyeS0+Y2hhbm5lbFR5cGUpOworICAgICAgICAgaG9zdEN0eHQtPmxvd1Jlc291cmNlQ0IoaG9zdEN0eHQtPmNsaWVudEN0eHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsRW50cnktPmNoYW5uZWxUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVdMQU5fUEFMX1RSVUUpOworICAgICAgICAgY2hhbm5lbEVudHJ5LT5oaXRMb3dSZXNvdXJjZSA9IGVXTEFOX1BBTF9GQUxTRTsKKyAgICAgIH0KKyAgICAgIHN0YXR1cyA9IHdwYWxNdXRleFJlbGVhc2UoJmNoYW5uZWxFbnRyeS0+ZHhlQ2hhbm5lbExvY2spOworICAgICAgaWYoZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgIHsKKyAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiAlMTFzIE11dGV4IFJlbGVhc2UgZmFpbCIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgY2hhbm5lbFR5cGVbY2hhbm5lbEVudHJ5LT5jaGFubmVsVHlwZV0pOworICAgICAgfQorICAgfQorCisgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICIlcyBFeGl0IiwgX19mdW5jX18pOworICAgcmV0dXJuIHN0YXR1czsKK30KKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQCAgRnVuY3Rpb24gTmFtZSAKKyAgICAgIGR4ZVRYRXZlbnRIYW5kbGVyCisKKyAgQCAgRGVzY3JpcHRpb24gCisgICAgICBJZiBEWEUgSFcgc2VuZHMgVFggcmVsYXRlZCBpbnRlcnJ1cHQsIHRoaXMgZXZlbnQgaGFuZGxlciB3aWxsIGJlIGNhbGxlZAorICAgICAgSGFuZGxlIGhpZ2hlciBwcmlvcml0eSBjaGFubmVsIGZpcnN0CisgICAgICBGaWd1cmVvdXQgd2h5IGludGVycnVwdCBoYXBwZW4gYW5kIGNhbGwgYXBwcm9wcmlhdGUgZmluYWwgZXZlbiBoYW5kbGVyCisgICAgICBUWCBjb21wbGV0ZSBvciBlcnJvciBoYXBwZW4KKworICBAICBQYXJhbWV0ZXJzCisgICAgICAgICB2b2lkICAgICAgICAgICAgICAgKm1zZ1B0cgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFdmVuIE1TRworCisgIEAgIFJldHVybgorICAgICAgUEFMX1NUQVRVU19UCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBkeGVUWEV2ZW50SGFuZGxlcgorKAorICAgd3B0X21zZyAgICAgICAgICAgICAgICptc2dQdHIKKykKK3sKKyAgIHdwdF9tc2cgICAgICAgICAgICAgICAgICAqbXNnQ29udGVudCA9IC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ByZWdpc3RlciBhbmQgZXhjbHVzaXZlIG9ubHkgdGhpcyBjaGFubmVsIGludCAqLworICAgc3RhdHVzID0gd3BhbFJlYWRSZWdpc3RlcihXTEFORFhFX0lOVF9TUkNfUkFXX0FERFJFU1MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmludFNyYyk7CisgICBpZihlV0xBTl9QQUxfU1RBVFVTX1NVQ0NFU1MgIT0gc3RhdHVzKQorICAgeworICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiZHhlVFhDb21wbGV0ZUV2ZW50SGFuZGxlciBSZWFkIElOVF9ET05FX1NSQyByZWdpc3RlciBmYWlsIik7CisgICAgICByZXR1cm47CisgICB9CisgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9JTkZPX01FRCwKKyAgICAgICAgICAgICJUWCBFdmVudCBIYW5kbGVyIElOVCBTb3VyY2UgMHgleCIsIGludFNyYyk7CisKKyAgIGR4ZUVudkJsay50eENtcEludENoYW5sU3JjID0gaW50U3JjJjB4RkY7CisKKyAgIC8qIFJldHVybiBmcm9tIGhlcmUgaWYgdGhlIFJJVkEgaXMgaW4gSU1QUywgdG8gYXZvaWQgcmVnaXN0ZXIgYWNjZXNzICovCisgICBpZihXTEFORFhFX1BPV0VSX1NUQVRFX0lNUFMgPT0gZHhlQ3R4dC0+aG9zdFBvd2VyU3RhdGUpCisgICB7CisgICAgICBzdWNjZXNzaXZlSW50V2l0aElNUFMrKzsKKyAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgImR4ZVRYRXZlbnRIYW5kbGVyIElNUFMgVFggQ09NUCBJTlQgc3VjY2Vzc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gICAgCisgICAgICB9CisKKyAgICAgIGlmKFdMQU5EWEVfQ0hfU1RBVF9JTlRfRVJSX01BU0sgJiBjaFN0YXQpCisgICAgICB7CisgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICIlMTFzIDogMHgleCBFcnJvciBSZXBvcnRlZCwgUmVsb2FkIERyaXZlciIsCisgICAgICAgICAgICAgICAgICBjaGFubmVsVHlwZVtjaGFubmVsQ2ItPmNoYW5uZWxUeXBlXSwgY2hTdGF0KTsKKworICAgICAgICAgaWYgKGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUyAhPQorICAgICAgICAgICAgICAgICAgICAgICAgIGR4ZUVyckhhbmRsZXIoY2hhbm5lbENiLCBjaFN0YXQpKQorICAgICAgICAgeworICAgICAgICAgICAgZHhlQ3R4dC0+ZHJpdmVyUmVsb2FkSW5Qcm9jZXNzaW5nID0gZVdMQU5fUEFMX1RSVUU7CisgICAgICAgICAgICB3cGFsV2xhblJlbG9hZCgpOworICAgICAgICAgICAgZHhlU3RhcnRTU1JUaW1lcihkeGVDdHh0KTsKKyAgICAgICAgIH0KKyAgICAgICAgIGJFbmFibGVJU1IgPSAxOworICAgICAgfQorICAgICAgZWxzZSBpZihXTEFORFhFX0NIX1NUQVRfSU5UX0RPTkVfTUFTSyAmIGNoU3RhdCkKKyAgICAgIHsKKyAgICAgICAgIC8qIEhhbmRsZSBUWCBjb21wbGV0ZSBmb3IgaGlnaCBwcmlvcml0eSBjaGFubmVsICovCisgICAgICAgICBzdGF0dXMgPSBkeGVUWENvbXBGcmFtZShkeGVDdHh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbENiKTsKKyAgICAgICAgIGJFbmFibGVJU1IgPSAxOworICAgICAgfQorICAgICAgZWxzZSBpZihXTEFORFhFX0NIX1NUQVRfSU5UX0VE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DdHh0LT5keGVDaGFubmVsW1dEVFNfQ0hBTk5FTF9UWF9MT1dfUFJJXTsKKyAgIGlmKGludFNyYyAmICgxIDw8IGNoYW5uZWxDYi0+YXNzaWduZWRETUFDaGFubmVsKSkKKyAgIHsKKyAgICAgIHN0YXR1cyA9IGR4ZUNoYW5uZWxDbGVhbkludChjaGFubmVsQ2IsICZjaFN0YXQpOworICAgICAgaWYoZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgIHsKKyAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgImR4ZVRYRXZlbnRIYW5kbGVyIElOVCBDbGVhbiB1cCBmYWlsIik7CisgICAgICAgICByZXR1cm47ICAgICAgICAgCisgICAgICB9CisKKyAgICAgIGlmKFdMQU5EWEVfQ0hfU1RBVF9JTlRfRVJSX01BU0sgJiBjaFN0YXQpCisgICAgICB7CisgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICIlMTFzIDogMHgleCBFcnJvciBSZXBvcnRlZCwgUmVsb2FkIERyaXZlciIsCisgICAgICAgICAgICAgICAgICBjaGFubmVsVHlwZVtjaGFubmVsQ2ItPmNoYW5uZWxUeXBlXSwgY2hTdGF0KTsKKworICAgICAgICAgaWYgKGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUyAhPQorICAgICAgICAgICAgICAgICAgICAgICAgIGR4ZUVyckhhbmRsZXIoY2hhbm5lbENiLCBjaFN0YXQpKQorICAgICAgICAgeworICAgICAgICAgICAgIGR4ZUN0eHQtPmRyaXZlclJlbG9hZEluUHJvY2Vzc2luZyA9IGVXTEFOX1BBTF9UUlVFOworICAgICAgICAgICAgIHdwYWxXbGFuUmV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WCBDb21wbGV0ZSBpbnRlcnJ1cHQgd2FzIGVuYWJsZWQgLSB0byBhdm9pZCAKKyAgICAgdGhlIHBvc2liaWxpdHkgb2YgYSByYWNlKi8KKyAgIGR4ZVBzQ29tcGxldGUoZHhlQ3R4dCwgZVdMQU5fUEFMX1RSVUUpOworCisgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICIlcyBFeGl0IiwgX19mdW5jX18pOworICAgcmV0dXJuOworfQorCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQCAgRnVuY3Rpb24gTmFtZSAKKyAgICAgIGR4ZVRYQ29tcGxldGVQcm9jZXNzaW5nCisKKyAgQCAgRGVzY3JpcHRpb24gCisgICAgICBJZiBEWEUgSFcgc2VuZHMgVFggcmVsYXRlZCBpbnRlcnJ1cHQsIHRoaXMgZXZlbnQgaGFuZGxlciB3aWxsIGJlIGNhbGxlZAorICAgICAgSGFuZGxlIGhpZ2hlciBwcmlvcml0eSBjaGFubmVsIGZpcnN0CisgICAgICBGaWd1cmVvdXQgd2h5IGludGVycnVwdCBoYXBwZW4gYW5kIGNhbGwgYXBwcm9wcmlhdGUgZmluYWwgZXZlbiBoYW5kbGVyCisgICAgICBUWCBjb21wbGV0ZSBvciBlcnJvciBoYXBwZW4KKworICBAICBQYXJhbWV0ZXJzCisgICAgICBkeGVDdHh0ICAgICAgRFhFIGNvbnRleHQgCisKKyAgQCAgUmV0dXJuCisgICAgICBQQUxfU1RBVFVTX1QKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIGR4ZVRYQ29tcGxldGVQcm9jZXNzaW5nCisoCisgICBXTEFORFhFX0N0cmxCbGtUe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BIGNvbWVvdXQgZnJvbSBJTVBTLCBjaGVjayBEWEUgVFggbmV4dCB0cmFuc2ZlciBjYW5kaWRhdGUgZGVzY3JpcHRvcgorICAgICAgQW5kIEhXIHByb2dyYW1tZWQgZGVzY3JpcHRvci4KKyAgICAgIElmIGFueSBhc3luYyBoYXBwZW4gYmV0d2VlbiBIVy9TVyBUWCBzdGFsbCB3aWxsIGhhcHBlbgorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIHZvaWQgICAgKm1zZ1B0cgorICAgICAgICAgICAgICAgTWVzc2FnZSBwb2ludGVyIHRvIHN5bmMgd2l0aCBUWCB0aHJlYWQKKworICBAICBSZXR1cm4KKyAgICAgIE5PTkUKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIGR4ZVRYUmVTeW5jRGVzYworKAorICAgd3B0X21zZyAgICAgICAgICAgICAgICAgICptc2dQdHIKKykKK3sKKyAgIHdwdF9tc2cgICAgICAgICAgICAgICAgICAqbXNnQ29udGVudCA9ICh3cHRfbXNnICopbXNnUHRyOworICAgV0xBTkRYRV9DdHJsQmxrVHlwZSAgICAgICpwRHhlQ3RybEJsazsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgbmV4dERlc2NSZWc7CisgICBXTEFORFhFX0NoYW5uZWxDQlR5cGUgICAgKmNoYW5uZWxFbnRyeTsKKyAgIFdMQU5EWEVfRGVzY0N0cmxCbGtUeXBlICAqdmFsaWRDdHJsQmxrOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICBkZXNjTG9vcDsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgY2hhbm5lbExvb3A7CisKKyAgIGlmKE5VTEwgPT0gbXNnQ29udGVudCkKKyAgIHsKKyAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0V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jTG9vcCA9IDA7IGRlc2NMb29wIDwgY2hhbm5lbEVudHJ5LT5udW1EZXNjOyBkZXNjTG9vcCsrKQorICAgICAgICAgeworICAgICAgICAgICAgaWYodmFsaWRDdHJsQmxrLT5saW5rZWREZXNjLT5kZXNjQ3RybC5jdHJsICYgV0xBTkRYRV9ERVNDX0NUUkxfVkFMSUQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBpZihuZXh0RGVzY1JlZyAhPSB2YWxpZEN0cmxCbGstPmxpbmtlZERlc2NQaHlBZGRyKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiVFggQXN5bmMiKTsKKworICAgICAgICAgICAgICAgICAgZHhlQ2hhbm5lbE1vbml0b3IoIiEhISBUWCBBc3luYyAhISEiLCBjaGFubmVsRW50cnksIE5VTEwpOworICAgICAgICAgICAgICAgICAgZHhlQ2hhbm5lbFJlZ2lzdGVyRHVtcChjaGFubmVsRW50cnksICIhISEgVFggQXN5bmMgISEhIiwgTlVMTCk7CisKKyAgICAgICAgICAgICAgICAgIHdwYWxXcml0ZVJlZ2lzdGVyKGNoYW5uZWxFbnRyeS0+Y2hhbm5lbFJlZ2lzdGVyLmNoRFhFRGVzY2xSZWdBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsaWRDdHJsQmxrLT5saW5rZWREZXNjUGh5QWRkcik7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHZhbGlkQ3RybEJsayA9IChXTEFORFhFX0Rlc2NDdHJsQmxrVHlwZSAqKXZhbGlkQ3RybEJsay0+bmV4dEN0cmxCbGs7CisgICAgICAgICAgICBpZih2YWxpZEN0cmxCbGsgPT0gY2hhbm5lbEVudHJ5LT5oZWFkQ3RybEJsay0+bmV4dEN0cmxCbGspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvKiBGaW5pc2hlZCB0byB0ZXN0IHRpbGwgaGVhZCBjb250cm9sIGJsY29rLCBidXQgY291bGQgbm90IGZpbmQgdmFsaWQgZGVzY3JpcHRvcgorICAgICAgICAgICAgICAgICogZnJvbSBoZWFkIHRvIHRhaWwgYWxsIGRlc2NyaXB0b3JzIGFyZSBpbnZhbGlkYXRlZAorICAgICAgICAgICAgICAgICogaG9zdCBwb2ludCBvZiB2aWV3IGhlYWQgZGVzY3JpcHRvciBpcyBuZXh0IFRYIGNhbmRpZGF0ZQorICAgICAgICAgICAgICAgICogU28sIG5leHQgZGVzY3JpcHRvciBjb250cm9sIGhhdmUgdG8gYmUgcHJvZ3JhbW1lZCB3aXRoIGhlYWQgZGVzY3JpcHRvcgorICAgICAgICAgICAgICAgICogY2hlY2sgKi8KKyAgICAgICAgICAgICAgIGlmKG5leHREZXNjUmVnICE9IGNoYW5uZWxFbnRyeS0+aGVhZEN0cmxCbGstPmxpbmtlZERlc2NQaHlBZGRyKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiVFggQXN5bmMgd2l0aCBub3QgY29tcGxldGVkIHRyYW5zZmVycmVkIGZyYW1lcywgbmV4dCBkZXNjcmlwdG9yIG11c3QgYmUgaGVhZCIpOworCisgICAgICAgICAgICAgICAgICBkeGVDaGFubmVsTW9uaXRvcigiISEhIFRYIEFzeW5jICEhISIsIGNoYW5uZWxFbnRyeSwgTlVMTCk7CisgICAgICAgICAgICAgICAgICBkeGVDaGFubmVsUmVnaXN0ZXJEdW1wKGNoYW5uZWxFbnRyeSwgIiEhISBUWCBBc3luYyAhISEiLCBOVUxMK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ICAgICAgIGNoYW5uZWxFbnRyeS0+ZXh0cmFDb25maWcuY2hhbl9tYXNrKTsKKyAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdmFsaWRDdHJsQmxrID0gKFdMQU5EWEVfRGVzY0N0cmxCbGtUeXBlICopdmFsaWRDdHJsQmxrLT5uZXh0Q3RybEJsazsKKyAgICAgICAgICAgIGlmKHZhbGlkQ3RybEJsayA9PSBjaGFubmVsRW50cnktPmhlYWRDdHJsQmxrLT5uZXh0Q3RybEJsaykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8qIEZpbmlzaGVkIHRvIHRlc3QgdGlsbCBoZWFkIGNvbnRyb2wgYmxjb2ssIGJ1dCBjb3VsZCBub3QgZmluZCB2YWxpZCBkZXNjcmlwdG9yCisgICAgICAgICAgICAgICAgKiBmcm9tIGhlYWQgdG8gdGFpbCBhbGwgZGVzY3JpcHRvcnMgYXJlIGludmFsaWRhdGVkICovCisgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgIH0KKyAgIH0KKworICAgd3BhbE1lbW9yeUZyZWUobXNnUHRyKTsKKyAgIHJldHVybjsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lCisgICAgICBkeGVEZWJ1Z1R4RGVzY1JlU3luYworCisgIEAgIERlc2NyaXB0aW9uCisgICAgICAgQ2hlY2sgRFhFIFR4IGNoYW5uZWwgc3RhdGUgYW5kIGNvcnJlY3QgaXQgaW4KKyAgICAgICBjYXNlIFR4IERhdGEgc3RhbGwgaXMgZGV0ZWN0ZWQgYnkgY2FsbGluZworICAgICAgICVkeGVUWFJlU3luY0Rlc2MuIEFsc28gZW5zdXJlIHRoYXQgV0NOIFNTCisgICAgICAgaXMgbm90IHBvd2VyIGNvbGxhcHNlZCBiZWZvcmUgY2FsbGluZworICAgICAgICVkeGVUWFJlU3luY0Rlc2MKKworICBAICBQYXJhbWV0ZXJzCisgICAgICB2b2lkICAgICptc2dQdHIKKyAgICAgICAgICAgICAgIE1lc3NhZ2UgcG9pbnRlciB0byBzeW5jIHdpdGggVFggdGhyZWFkCisKKyAgQCAgUmV0dXJuCisgICAgICBOT05FCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBkeGVEZWJ1Z1R4RGVzY1JlU3luYworKAorICAgd3B0X21zZyAgICAgICAgICAgICAgICAgICptc2dQdHIKKykKK3sKKyAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIiVzOiBDaGVjayBmb3IgRFhFIFRYIEFzeW5jIixfX2Z1bmNfXyk7CisgICAvKiBNYWtlIHdha2UgdXAgSFcgKi8KKyAgIGR4ZU5vdGlmeVNtc20oZVdMQU5fUEFMX0ZBTFNFLCBlV0xBTl9QQUxfVFJVRSk7CisgICBkeGVOb3RpZnlTbXNtKGVXTEFOX1BBTF9UUlVFLCBlV0xBTl9QQUxfRkFMU0UpOworCisgICB3cGFsU2xlZXAoMTApOworCisgICBkeGVUWFJlU3luY0Rlc2MobXNnUHRyKTsKK30KKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQCAgRnVuY3Rpb24gTmFtZSAKKyAgICAgIGR4ZVRYSVNSCisKKyAgQCAgRGVzY3JpcHRpb24gCisgICAgICBUWCBpbnRlcnJ1cHQgSVNSCisgICAgICBQbGF0Zm9ybSB3aWxsIGNhbGwgdGhpcyBmdW5jdGlvbiBpZiBJTlQgaXMgaGFwcGVuCisgICAgICBUaGlzIGZ1bmN0aW9uIG11c3QgYmUgcmVnaXN0ZXJlZCBpbnRvIHBsYXRmb3JtIGludGVycnVwdCBtb2R1bGUKKworICBAICBQYXJhbWV0ZXJzCisgICAgICB2b2lkICAgICpob3N0Q3R4dAorICAgICAgICAgICAgICAgRFhFIGhvc3QgZHJpdmVyIGNvbnRyb2wgY29udGV4dCwKKyAgICAgICAgICAgICAgIHByZSByZWdpc3RlcmQgZHVyaW5nIGludGVycnVwdCByZWdpc3RyYXRpb24KKworICBAICBSZXR1cm4KKyAgICAgIFBBTF9TVEFUVVNfVAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3N0YXRpYyB2b2lkIGR4ZVRYSVNSCisoCisgICB2b2lkICAgICAgICAgICAgICAgICAgICAqaG9zdEN0eHQKKykKK3sKKyAgIFdMQU5EWEVfQ3RybEJsa1R5cGUgICAgICAqZHhlQ3R4dCAgICA9IChXTEFORFhFX0N0cmxCbGtUeXBlICopaG9zdEN0eHQ7CisgICB3cHRfc3RhdHVzICAgICAgICAgICAgICAgIHN0YXR1cyAgPSBlV0xBTl9QQUxfU1RBVFVTX1NVQ0NFU1M7CisKKyAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgIiVzIEVudGVyIiwgX19mdW5jX18pOworCisgICAvKiBSZXR1cm4gZnJvbSBoZXJlIGlmIHRoZSBSSVZBIGlzIGluIElNUFMsIHRvIGF2b2lkIHJlZ2lzdGVyIGFjY2VzcyAqLworICAgaWYoV0xBTkRYRV9QT1dFUl9TVEFURV9ET1dOID09IGR4ZUN0eHQtPmhvc3RQb3dlclN0YXRlKQorICAgeworICAgICAgZHhlQ3R4dC0+dHhJbnRFbmFibGUgPSBlV0xBTl9QQUxfRkFMU0U7CisgICAgICAvKiBEaXNhYmxlIGludGV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ICAgICAgImR4ZVRYQ29tcElTUiBpbnRlcnJ1cHQgc2VyaWFsaXplIGZhaWwgc3RhdHVzPSVkIiwgc3RhdHVzKTsKKyAgIH0KKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAiJXMgRXhpdCIsIF9fZnVuY19fKTsKKyAgIHJldHVybjsKK30KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKiAgR2xvYmFsIEZ1bmN0aW9uCisgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lIAorICAgICAgV0xBTkRYRV9PcGVuCisKKyAgQCAgRGVzY3JpcHRpb24gCisgICAgICBPcGVuIGhvc3QgRFhFIGRyaXZlciwgYWxsb2NhdGUgRFhFIHJlc291cmNlcworICAgICAgQWxsb2NhdGUsIERYRSBsb2NhbCBjb250cm9sIGJsb2NrLCBEWEUgZGVzY3JpcHRvciBwb29sLCBEWEUgZGVzY3JpcHRvciBjb250cm9sIGJsb2NrIHBvb2wKKworICBAICBQYXJhbWV0ZXJzCisgICAgICBwVm9pZCAgICAgIHBBZGFwdGVyIDogRHJpdmVyIGdsb2JhbCBjb250cm9sIGJsb2NrIHBvaW50ZXIKKworICBAICBSZXR1cm4KKyAgICAgIHBWb2lkIERYRSBsb2NhbCBtb2R1bGUgY29udHJvbCBibG9jayBwb2ludGVyCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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JYUmVzb3VyY2VBdmFpbGFibGVUaW1lckV4cEhhbmRsZXIsCisgICAgICAgICAgICAgICAgIHRlbXBEeGVDdHJsQmxrKTsKKyNlbmRpZgorCisgICB3cGFsVGltZXJJbml0KCZ0ZW1wRHhlQ3RybEJsay0+ZHhlU1NSVGltZXIsCisgICAgICAgICAgICAgICAgIGR4ZVNTUlRpbWVyRXhwSGFuZGxlciwgdGVtcER4ZUN0cmxCbGspOworCisgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgIldMQU5EWEVfT3BlbiBTdWNjZXNzIik7CisgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICIlcyBFeGl0IiwgX19mdW5jX18pOworICAgcmV0dXJuICh2b2lkICopdGVtcER4ZUN0cmxCbGs7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQCAgRnVuY3Rpb24gTmFtZSAKKyAgICAgIFdMQU5EWEVfQ2xpZW50UmVnaXN0cmF0aW9uCisKKyAgQCAgRGVzY3JpcHRpb24gCisgICAgICBNYWtlIGNhbGxiYWNrIGZ1bmN0aW9ucyByZWdpc3RyYXRpb24gaW50byBEWEUgZHJpdmVyIGZyb20gRFhFIGRyaXZlciBjbGllbnQKKworICBAICBQYXJhbWV0ZXJzCisgICAgICBwVm9pZCAgICAgICAgICAgICAgICAgICAgICAgcERYRUNvbnRleHQgOiBEWEUgbW9kdWxlIGNvbnRyb2wgYmxvY2sKKyAgICAgIFdEVFNfQ2xpZW50Q2FsbGJhY2tzICAgICAgICBXRFRTQ2IgOiBDYWxsYmFja3MgdG8gV0RUUyB0byBpbmRpY2F0ZSB2YXJpb3VzIGV2ZW50cworICAgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgICAgKnVzZXJDb250ZXh0IDogRFhFIENsaWVubnQgY29udHJvbCBibG9jaworCisgIEAgIFJldHVybgorICAgICAgd3B0X3N0YXR1cworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3dwdF9zdGF0dXMgV0xBTkRYRV9DbGllbnRSZWdpc3RyYXRpb24KKygKKyAgIHZvaWQgICAgICAgICAgICAgICAgICAgICAgICpwRFhFQ29udGV4dCwKKyAgIFdEVFNfQ2xpZW50Q2FsbGJhY2tzICAgICAgIFdEVFNDYiwKKyAgIHZvaWQgICAgICAgICAgICAgICAgICAgICAgICp1c2VyQ29udGV4dAorKQoreworICAgd3B0X3N0YXR1cyAgICAgICAgICAgICAgICAgc3RhdHVzICA9IGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgIFdMQU5EWEVfQ3RybEJsa1R5cGUgICAgICAgKmR4ZUN0eHQ7CisKKyAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgIiVzIEVudGVyIiwgX19mdW5jX18pOworCisgICAvKiBTYW5pdHkgKi8KKyAgIGlmKE5VTEwgPT0gcERYRUNvbnRleHQpCisgICB7CisgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICJXTEFORFhFX0NsaWVudFJlZ2lzdHJhdGlvbiBJbnZhbGlkIERYRSBDQiIpOworICAgICAgcmV0dXJuIGVXTEFOX1BBTF9TVEFUVVNfRV9JTlZBTDsgICAKKyAgIH0KKworICAgaWYoTlVMTCA9PSB1c2VyQ29udGV4dCkKKyAgIHsKKyAgICAgIEhEWEVf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pb24gCisgICAgICBTdGFydCBIb3N0IERYRSBkcml2ZXIKKyAgICAgIEluaXRpYWxpemUgRFhFIGNoYW5uZWxzIGFuZCBzdGFydCBjaGFubmVsCisKKyAgQCAgUGFyYW1ldGVycworICAgICAgcFZvaWQgICAgICAgICAgICAgICAgICAgICAgIHBEWEVDb250ZXh0IDogRFhFIG1vZHVsZSBjb250cm9sIGJsb2NrCisKKyAgQCAgUmV0dXJuCisgICAgICB3cHRfc3RhdHVzCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLword3B0X3N0YXR1cyBXTEFORFhFX1N0YXJ0CisoCisgICB2b2lkICAqcERYRUNvbnRleHQKKykKK3sKKyAgIHdwdF9zdGF0dXMgICAgICAgICAgICAgICAgIHN0YXR1cyAgPSBlV0xBTl9QQUxfU1RBVFVTX1NVQ0NFU1M7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICBpZHg7CisgICBXTEFORFhFX0N0cmxCbGtUeXBlICAgICAgICpkeGVDdHh0ID0gTlVMTDsKKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAiJXMgRW50ZXIiLCBfX2Z1bmNfXyk7CisKKyAgIC8qIFNhbml0eSAqLworICAgaWYoTlVMTCA9PSBwRFhFQ29udGV4dCkKKyAgIHsKKyAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIldMQU5EWEVfU3RhcnQgSW52YWxpZCBEWEUgQ0IiKTsKKyAgICAgIHJldHVybiBlV0xBTl9QQUxfU1RBVFVTX0VfSU5WQUw7ICAgCisgICB9CisgICBkeGVDdHh0ID0gKFdMQU5EWEVfQ3RybEJsa1R5cGUgKilw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gICAgICAgICAgIldMQU5EWEVfU3RhcnQgJWQgQ2hhbm5lbCBTdGFydCBGYWlsIiwgaWR4KTsKKyAgICAgICAgIHJldHVybiBzdGF0dXM7ICAgICAgICAgCisgICAgICB9CisgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgIldMQU5EWEVfU3RhcnQgQ2hhbm5lbCAlcyBTdGFydCBTdWNjZXNzIiwgY2hhbm5lbFR5cGVbaWR4XSk7CisgICB9CisKKyAgIC8qIFJlZ2lzdGVyIElTUiB0byBPUyAqLworICAgLyogUmVnaXN0ZXIgVFggY29tcGxldGUgaW50ZXJydXB0IGludG8gcGxhdGZvcm0gKi8KKyAgIHN0YXR1cyA9IHdwYWxSZWdpc3RlckludGVycnVwdChEWEVfSU5URVJSVVBUX1RYX0NPTVBMRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGR4ZVRYSVNSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHhlQ3R4dCk7CisgICBpZihlV0xBTl9QQUxfU1RBVFVTX1NVQ0NFU1MgIT0gc3RhdHVzKQorICAgeworICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiV0xBTkRYRV9TdGFydCBUWCBjb21wIGludGVycnVwdCByZWdpc3RyYXRpb24gRmFpbCIpOworICAgICAgcmV0dXJuIHN0YXR1czsgICAgICAgICAKKyAgIH0KKworICAgLyogUmVnaXN0ZXIgUlggcmVhZHkgaW50ZXJydXB0IGludG8gcGxhdGZvcm0gKi8KKyAgIHN0YXR1cyA9IHdwYWxSZWdpc3RlckludGVycnVwdChEWEVfSU5URVJSVVBUX1JYX1JFQURZLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHhlUlhJU1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkeGVDdHh0KTsKKyAgIGlmKGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpCisgICB7CisgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICJXTEFORFhFX1N0YXJ0IFJYIFJlYWR5IGludGVycnVwdCByZWdpc3RyYXRpb24gRmFpbCIpOworICAgICAgcmV0dXJuIHN0YXR1czsgICAgICAgICAKKyAgIH0KKworICAgLyogRW5hYmxlIHN5c3RlbSBsZXZlbCBJU1IgKi8KKyAgIC8qIEVuYWJsZSBSWCByZWFkeSBJbnRlcnJ1cHQgYXQgaGVyZSAqLworICAgc3RhdHVzID0gd3BhbEVuYWJsZUludGVycnVwdChEWEVfSU5URVJSVVBUX1JYX1JFQURZKTsKKyAgIGlmKGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpCisgICB7CisgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICJkeGVUWENvbXBsZXRlRXZlbnRIYW5kbGVyIEVuYWJsZSBUWCBjb21wbGV0ZSBpbnRlcnJ1cHQgZmFpbCIpOworICAgICAgcmV0dXJuIHN0YXR1czsgICAgICAgICAKKyAgIH0KKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAiJXMgRXhpdCIsIF9fZnVuY19fKTsKKyAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQCAgRnVuY3Rpb24gTmFtZSAKKyAgICAgIFdMQU5EWEVfVFhGcmFtZQorCisgIEAgIERlc2NyaXB0aW9uIAorICAgICAgVHJpZ2dlciBmcmFtZSB0cmFuc21pdCBmcm9tIGhvc3QgdG8gUklWQQorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIHBWb2lkICAgICAgICAgICAgcERYRUNvbnRleHQgOiBEWEUgQ29udHJvbCBCbG9jaworICAgICAgd3B0X3BhY2tldCAgICAgICBwUGFja2V0IDogdHJhbnNtaXQgcGFja2V0IHN0cnVjdHVyZQorICAgICAgV0RUU19DaGFubmVsVHlwZSBjaGFubmVsIDogVFggY2hhbm5lbAorCisgIEAgIFJldHVybgorICAgICAgd3B0X3N0YXR1cworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3dwdF9zdGF0dXMgV0xBTkRYRV9UeEZyYW1lCisoCisgICB2b2lkICAgICAgICAgICAgICAgICpwRFhFQ29udGV4dCwKKyAgIHdwdF9wYWNrZXQgICAgICAgICAgKnBQYWNrZXQsCisgICBXRFRTX0NoYW5uZWxUeXBlICAgICBjaGFubmVsCispCit7CisgICB3cHRfc3RhdHVzICAgICAgICAgICAgICAgICBzdGF0dXMgICAgICAgICA9IGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgICAgKmN1cnJlbnRDaGFubmVsID0gTlVMTDsKKyAgIFdMQU5EWEVfQ3RybEJsa1R5cGUgICAgICAgKmR4ZUN0eHQgICAgICAgID0gTlVMTDsKKyAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgKmxvd1RocmVzaG9sZCAgID0gTlVMTDsKKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0Vf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wKKyAgICAgICAgICAgICAgICIlMTFzIDogTG93IFJlc291cmNlIGN1cnJlbnRDaGFubmVsLT5udW1Sc3ZkRGVzYyAlZCIsCisgICAgICAgICAgICAgICBjaGFubmVsVHlwZVtjdXJyZW50Q2hhbm5lbC0+Y2hhbm5lbFR5cGVdLAorICAgICAgICAgICAgICAgY3VycmVudENoYW5uZWwtPm51bVJzdmREZXNjKTsKKyAgICAgIGlmIChXTEFORFhFX1JJVkFfUE9XRVJfU1RBVEVfQk1QU19VTktOT1dOID09IGR4ZUN0eHQtPnJpdmFQb3dlclN0YXRlKQorICAgICAgeworICAgICAgICAgZHhlTm90aWZ5U21zbShlV0xBTl9QQUxfRkFMU0UsIGVXTEFOX1BBTF9UUlVFKTsKKyAgICAgICAgIGR4ZU5vdGlmeVNtc20oZVdMQU5fUEFMX1RSVUUsIGVXTEFOX1BBTF9GQUxTRSk7CisgICAgICB9CisgICB9CisgICBzdGF0dXMgPSB3cGFsTXV0ZXhSZWxlYXNlKCZjdXJyZW50Q2hhbm5lbC0+ZHhlQ2hhbm5lbExvY2spOworICAgaWYoZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgIHsKKyAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIldMQU5EWEVfVHhGcmFtZSBNdXRleCBSZWxlYXNlIGZhaWwiKTsKKyAgIH0KKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAiJXMgRXhpdCIsIF9fZnVuY19fKTsKKyAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQCAgRnVuY3Rpb24gTmFtZSAKKyAgICAgIFdMQU5EWEVfQ29tcGxldGVUWAorCisgIEAgIERlc2NyaXB0aW9uIAorICAgICAgSW5mb3JtcyBEWEUgdGhhdCB0aGUgY3VycmVudCBzZXJpZXMgb2YgVHggcGFja2V0cyBpcyBjb21wbGV0ZQorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIHBDb250ZXh0ICAgICAgICAgICAgcERYRUNvbnRleHQgOiBEWEUgQ29udHJvbCBCbG9jaworICAgICAgdWNUeFJlc1JlcSAgICAgICAgICBUWCByZXNvdXJjZSBudW1iZXIgcmVxdWlyZWQgYnkgVEwvV0RJCisKKyAgQCAgUmV0dXJuCisgICAgICB3cHRfc3RhdHVzCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLword3B0X3N0YXR1cworV0xBTkRYRV9Db21wbGV0ZVRYCisoCisgIHZvaWQqIHBDb250ZXh0LAorICB3cHRfdWludDMyIHVjVHhSZXNSZXEKKykKK3sKKyAgd3B0X3N0YXR1cyAgICAgICAgICAgICAgICBzdGF0dXMgID0gZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTOworICBXTEFORFhFX0N0cmxCbGtUeXBlICAgICAgKmR4ZUN0eHQgPSAoV0xBTkRYRV9DdHJsQmxrVHlwZSAqKShwQ29udGV4dCk7CisgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgICAqY2hhbm5lbENiICA9IE5VTEw7CisgIHdwdF9ib29sZWFuICAgICAgICAgICAgICAgaW5Mb3dSZXM7CisKKyAgLyogU2FuaXR5IENoZWNrICovCisgIGlmKCBOVUxMID09IHBDb250ZXh0ICkKKyAgeworICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiV0xBTkRYRV9Db21wbGV0ZVRYIGlud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Gl0cyBmcmFnbWVudCBzaXplIGlzIGxhcmdlciB0aGFuIERYRSBmcmVlIHJlc291cmNlLiAqLworICBpZigwIDwgdWNUeFJlc1JlcSkKKyAgeworICAgIC8qIERYRSBzdWNjZXNzZnVsbHkgY2xhaW1lZCBlbm91Z2ggZnJlZSBEWEUgcmVzb3VjZXMgZm9yIG5leHQgZmV0Y2guICovCisgICAgaWYoV0xBTkRYRV9HZXRGcmVlVHhEYXRhUmVzTnVtYmVyKGR4ZUN0eHQpID49IHVjVHhSZXNSZXEpCisgICAgeworICAgICAgLyogRFhFIGhhcyBub3QgYmVlbiBpbiBsb3cgcmVzb3VyY2UgY29uZGl0aW9uLiBEWEUgZm9yY2VzIHRvIGtpY2sgb2ZmCisgICAgICAgICBUWCB0cmFubWl0ICovCisgICAgICBpZigoZVdMQU5fUEFMX0ZBTFNFID09IGluTG93UmVzKSAmJiAKKyAgICAgICAgIChlV0xBTl9QQUxfRkFMU0UgPT0gY2hhbm5lbENiLT5oaXRMb3dSZXNvdXJjZSkpCisgICAgICB7CisgICAgICAgIGR4ZUN0eHQtPmxvd1Jlc291cmNlQ0IoZHhlQ3R4dC0+Y2xpZW50Q3R4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXRFRTX0NIQU5ORUxfVFhfTE9XX1BSSSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlV0xBTl9QQUxfRkFMU0UpOworICAgICAgICBkeGVDdHh0LT5sb3dSZXNvdXJjZUNCKGR4ZUN0eHQtPmNsaWVudEN0eHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0RUU19DSEFOTkVMX1RYX0xPV19QUkksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVdMQU5fUEFMX1RSVUUpOworICAgICAgICBjaGFubmVsQ2ItPmhpdExvd1Jlc291cmNlID0gZVdMQU5fUEFMX0ZBTFNFOworICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgLyogRFhFIGRvZXNuJ3QgaGF2ZSBlbm91Z2ggZnJlZSBEWEUgcmVzb3VyY2VzLiBQdXQgdGhlIGNoYW5uZWwKKyAgICAgICAgIHRvIGxvdyByZXNvdXJjZSBjb25kaXRpb24uICovCisgICAgICBpZihlV0xBTl9QQUxfRkFMU0UgPT0gY2hhbm5lbENiLT5oaXRMb3dSZXNvdXJjZSkKKyAgICAgIHsKKyAgICAgICAgLyogUHV0IHRoZSBjaGFubmVsIHRvIGxvdyByZXNvdXJjZSBjb25kaXRpb24gKi8KKyAgICAgICAgZHhlQ3R4dC0+bG93UmVzb3VyY2VDQihkeGVDdHh0LT5jbGllbnRDdHh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXRFRTX0NIQU5ORUxfVFhfTE9XX1BSSSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVdMQU5fUEFMX0ZBTFNFKTsKKyAgICAgICAgY2hhbm5lbENiLT5oaXRMb3dSZXNvdXJjZSA9IGVXTEFOX1BBTF9UUlVFOworICAgICAgfQorICAgIH0KKyAgfQorIAorICByZXR1cm4gc3RhdHVzOyAKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lIAorICAgICAgV0xBTkRYRV9TdG9wCisKKyAgQCAgRGVzY3JpcHRpb24gCisgICAgICBTdG9wIERYRSBjaGFubmVscyBhbmQgRFhFIGVuZ2luZSBvcGVyYXRpb25zCisgICAgICBEaXNhYmxlIGFsbCBjaGFubmVsIGludGVycnVwdAorICAgICAgU3RvcCBhbGwgY2hhbm5lbCBvcGVyYXRpb24KKworICBAICBQYXJhbWV0ZXJzCisgICAgICBwVm9pZCAgICAgICAgICAgIHBEWEVDb250ZXh0IDogRFhFIENvbnRyb2wgQmxvY2sKKworICBAICBSZXR1cm4KKyAgICAgIHdwdF9zdGF0dXMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit3cHRfc3RhdHVzIFdMQU5EWEVfU3RvcAorKAorICAgdm9pZCAqcERYRUNvbnRleHQKKykKK3sKKyAgIHdwdF9zdGF0dXMgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgIGlkeDsKKyAgIFdMQU5EWEVfQ3RybEJsa1R5cGUgICAgICAgKmR4ZUN0eHQgPSBOVUxMOworCisgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICIlcyBFbnRlciIsIF9fZnVuY19fKTsKKworICAgLyogU2FuaXR5ICovCisgICBpZihOVUxMID09IHBEWEVDb250ZXh0KQorICAgeworICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiV0xBTkRYRV9TdG9wIEludmFsaWQgRFhFIENCIik7CisgICAgICByZXR1cm4gZVdMQU5fUEFMX1NUQVRVU19FX0lOVkFMOyAgIAorICAgfQorCisgICBkeGVDdHh0ID0gKFdMQU5EWEVfQ3RybEJsa1R5cGUgKilwRFhFQ29udGV4dDsKKyAgIGZvcmVhY2hfdmFsaWRfY2hhbm5lbChpZHgpCisgICB7CisgICAgICBzdGF0dXMgPSBkeGVDaGFubmVsU3RvcChkeGVDdHh0LCAmZHhlQ3R4dC0+ZHhlQ2hhbm5lbFtpZHhdKTsKKyAgICAgIGlmKGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpCisgICAgICB7CisgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXT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lwdG9yIGNvbnRyb2wgYmxvY2sgZnJlZQorICAgICAgUHJlIGFsbG9jYXRlZCBSWCBidWZmZXIgZnJlZQorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIHBWb2lkICAgICAgICAgICAgcERYRUNvbnRleHQgOiBEWEUgQ29udHJvbCBCbG9jaworCisgIEAgIFJldHVybgorICAgICAgd3B0X3N0YXR1cworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3dwdF9zdGF0dXMgV0xBTkRYRV9DbG9zZQorKAorICAgdm9pZCAqcERYRUNvbnRleHQKKykKK3sKKyAgIHdwdF9zdGF0dXMgICAgICAgICAgICAgICBzdGF0dXMgPSBlV0xBTl9QQUxfU1RBVFVTX1NVQ0NFU1M7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICBpZHg7CisgICBXTEFORFhFX0N0cmxCbGtUeXBlICAgICAgICpkeGVDdHh0ID0gTlVMTDsKKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAiJXMgRW50ZXIiLCBfX2Z1bmNfXyk7CisKKyAgIC8qIFNhbml0eSAqLworICAgaWYoTlVMTCA9PSBwRFhFQ29udGV4dCkKKyAgIHsKKyAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIldMQU5EWEVfU3RvcCBJbnZhbGlkIERYRSBDQiIpOworICAgICAgcmV0dXJuIGVXTEFOX1BBTF9TVEFUVVNfRV9JTlZBTDsgICAKKyAgIH0KKworICAgZHhlQ3R4dCA9IChXTEFORFhFX0N0cmxCbGtUeXBlICopcERYRUNvbnRleHQ7CisjaWZkZWYgV0xBTl9EWEVfTE9XX1JFU09VU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ICAgV0xBTkRYRV9UcmlnZ2VyVFgKKworICBAICBEZXNjcmlwdGlvbiAKKyAgICAgIFRCRAorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIHBWb2lkICAgICAgICAgICAgcERYRUNvbnRleHQgOiBEWEUgQ29udHJvbCBCbG9jaworCisgIEAgIFJldHVybgorICAgICAgd3B0X3N0YXR1cworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3dwdF9zdGF0dXMgV0xBTkRYRV9UcmlnZ2VyVFgKKygKKyAgIHZvaWQgKnBEWEVDb250ZXh0CispCit7CisgICB3cHRfc3RhdHVzICAgICAgICAgICAgICAgc3RhdHVzID0gZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTOworCisgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICIlcyBFbnRlciIsIF9fZnVuY19fKTsKKworICAgLyogVEJEICovCisKKyAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgIiVzIEV4aXQiLCBfX2Z1bmNfXyk7CisgICByZXR1cm4gc3RhdHVzOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEAgIEZ1bmN0aW9uIE5hbWUgCisgICAgICBkeGVUeFRocmVhZFNldFBvd2VyU3RhdGVFdmVudEhhbmRsZXIKKworICBAICBEZXNjcmlwdGlvbiAKKyAgICAgIElmIFdESSBzZW5kcyBzZXQgcG93ZXIgc3RhdGUgcmVxLCB0aGlzIGV2ZW50IGhhbmRsZXIgd2lsbCBiZSBjYWxsZWQgaW4gVHgKKyAgICAgIHRocmVhZCBjb250ZXh0CisKKyAgQCAgUGFyYW1ldGVycworICAgICAgICAgdm9pZCAgICAgICAgICAgICAgICptc2dQdHIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRXZlbnQgTVNHCisKKyAgQCAgUmV0dXJuCisgICAgICBOb25lCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBkeGVUeFRocmVhZFNldFBvd2VyU3RhdGVFdmVudEhhbmRsZXIKKygKKyAgICB3cHRfbXNnICAgICAgICAgICAgICAgKm1zZ1B0cgorKQoreworICAgd3B0X21zZyAgICAgICAgICAgICAgICAgICptc2dDb250ZW50ID0gKHdwdF9tc2cgKiltc2dQdHI7CisgICBXTEFORFhFX0N0cmxCbGtUeXBlICAgICAgKmR4ZUN0eHQ7CisgICB3cHRfc3RhdHVzICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgIFdMQU5EWEVfUG93ZXJTdGF0ZVR5cGUgICAgcmVxUG93ZXJTdGF0ZTsKKyAgIHdwdF9pbnQ4ICAgICAgICAgICAgICAgICAgaTsKKyAgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgICAgKmNoYW5uZWxFbnRyeTsKKyAgIHdwdF9sb2dfZGF0YV9zdGFsbF9jaGFubmVsX3R5cGUgY2hhbm5lbExvZzsKKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAiJXMgRW50ZXIiLCBfX2Z1bmNfXyk7CisKKyAgIGR4ZUN0eHQgPSAoV0xBTkRYRV9DdHJsQmxrVHlwZSAqKShtc2dDb250ZW50LT5wQ29udGV4dCk7CisgICByZXFQb3dlclN0YXRlID0gKFdMQU5EWEVfUG93ZXJTdGF0ZVR5cGUpbXNnQ29udGVudC0+dmFsOworICAgZHhlQ3R4dC0+c2V0UG93ZXJTdGF0ZUNiID0gKFdMQU5EWEVfU2V0UG93ZXJTdGF0ZUNiVHlwZSltc2dDb250ZW50LT5wdHI7CisKKyAgIHN3aXRjaChyZXFQb3dlclN0YXRlKQorICAgeworICAgICAgY2FzZSBXTEFORFhFX1BPV0VSX1NUQVRFX0JNUFM6CisgICAgICAgICBpZihXTEFORFhFX1JJVkFfUE9XRVJfU1RBVEVfQUNUSVZFID09IGR4ZUN0eHQtPnJpdmFQb3dlclN0YXRlKQorICAgICAgICAgeworICAgICAgICAgICAgLy9kb24ndCBibG9jayBNQyB3YWl0aW5nIGZvciBudW1fcnN2ZCB0byBiZWNvbWUgMCBzaW5jZSBpdCBtYXkgdGFrZSBhIHdoaWxlCisgICAgICAgICAgICAvL2Jhc2VkIG9uIGFtb3VudCBvZiBUWCBhbmQgUlggYWN0aXZpdHkgLSBkdXJpbmcgdGhpcyB0aW1lIGFueSByZWNlaXZlZCAKKyAgICAgICAgICAgIC8vIG1hbmFnZW1lbnQgZnJhbWVzIHdpbGwgcmVtYWluIHVuLXByb2Nlc3NlZCBjb25zdW1pbmcgUlggYnVmZmVycworICAgICAgICAgICAgZHhlQ3R4dC0+cml2YVBvd2VyU3RhdGUgPSBXTEFORFhFX1JJVkFfUE9XRVJfU1RBVEVfQk1QU19VTktOT1dOOworICAgICAgICAgICAgZHhlQ3R4dC0+aG9zdFBvd2VyU3RhdGUgPSByZXFQb3dlclN0YXRlOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzID0gZVdMQU5fUEFMX1NUQVRVU19FX0lOVkFMOworICAgICAgICAgfQorICAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIFdMQU5EWEVfUE9XRVJfU1RBVEVfSU1QUzoKKyAgICAgICAgIGlmKFdMQU5EWEVfUklWQV9QT1dFUl9TVEFURV9BQ1RJVkUgPT0gZHhlQ3R4dC0+cml2YVBvd2VyU3RhdGUpCisgICAgICAgICB7CisKKyAgICAgICAgICAgIGZvcihpID0gV0RUU19DSEFOTkVMX1RYX0xPV19QUkk7IGkgPCBXRFRTX0NIQU5ORUxfUlhfTE9XX1BSSTsgaSsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgY2hhbm5lbEVudHJ5ID0gJmR4ZUN0eHQtPmR4ZUNoYW5uZWxbaV07CisgICAgICAgICAgICAgICBpZihjaGFubmVsRW50cnktPnRhaWxDdHJsQmxrICE9IGNoYW5uZWxFbnRyeS0+aGVhZEN0cmxCbGspCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBlV0xBTl9QQUxfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiUxMXMgOiAlcyA6VFggUGVuZGluZyBmcmFtZSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsVHlwZVtjaGFubmVsRW50cnktPmNoYW5uZWxUeXBlXSwgX19mdW5jX18pOworCisgICAgICAgICAgICAgICAgICBkeGVDaGFubmVsTW9uaXRvcigiRFhFX0lNUF9FUlIiLCBjaGFubmVsRW50cnksICZjaGFubmVsTG9nKTsKKyAgICAgICAgICAgICAgICAgIGR4ZURlc2NyaXB0b3JEdW1wKGNoYW5uZWxFbnRyeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxFbnRyeS0+aGVhZEN0cmxCbGstPmxpbmtlZERlc2MsIDApOworICAgICAgICAgICAgICAgICAgZHhlQ2hhbm5lbFJlZ2lzdGVyRHVtcChjaGFubmVsRW50cnksICJEWEVfSU1QU19FUlIiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmY2hhbm5lbExvZyk7CisgICAgICAgICAgICAgICAgICBkeGVDaGFubmVsQWxsRGVzY0R1bXAoY2hhbm5lbEVudHJ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxFbnRyeS0+Y2hhbm5lbFR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmNoYW5uZWxMb2cpOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTID09IHN0YXR1cykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGR4ZUN0eHQtPnJpdmFQb3dlclN0YXRlID0gV0xBTkRYRV9SSVZBX1BPV0VSX1NUQVRFX0lNUFNfVU5LTk9XTjsKKyAgICAgICAgICAgICAgIGR4ZUN0eHQtPmhvc3RQb3dlclN0YXRlID0gV0xBTkRYRV9QT1dFUl9TVEFURV9JTVBTOworICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzID0gZVdMQU5fUEFMX1NUQVRVU19FX0lOVkFMOworICAgICAgICAgfQorICAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIFdMQU5EWEVfUE9XRVJfU1RBVEVfRlVMTDoKKyAgICAgICAgIGlmKFdMQU5EWEVfUklWQV9QT1dFUl9TVEFURV9CTVBTX1VOS05PV04gPT0gZHhlQ3R4dC0+cml2YVBvd2VyU3RhdGUpCisgICAgICAgICB7CisgICAgICAgICAgICBkeGVDdHh0LT5yaXZhUG93ZXJTdGF0ZSA9IFdMQU5EWEVfUklWQV9QT1dFUl9TVEFURV9BQ1RJVkU7CisgICAgICAgICB9CisgICAgICAgICBkeGVDdHh0LT5ob3N0UG93ZXJTdGF0ZSA9IHJlcVBvd2VyU3RhdGU7CisgICAgICAgICBkeGVOb3RpZnlTbXNtKGVXTEFOX1BBTF9GQUxTRSwgZVdMQU5fUEFMX1RSVUUpOworICAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIFdMQU5EWEVfUE9XRVJfU1RBVEVfRE9XTjoKKyAgICAgICAgIFdMQU5EWEVfU3RvcCgodm9pZCAqKWR4ZUN0eHQpOyAgICAgICAgIAorICAgICAgICAgYnJlYWs7CisgICAgICBkZWZhdWx0OgorICAgICAgICAgLy9hc3NlcnQKKyAgICAgICAgIGJyZWFrOworICAgfQorCisgICBpZihXTEFORFhFX1BPV0VSX1NUQVRFX0JNUFNfUEVORElORyAhPSBkeGVDdHh0LT5ob3N0UG93ZXJTdGF0ZSkKKyAgIHsKKyAgICAgIGR4ZUN0eHQtPnNldFBvd2VyU3RhdGVDYihzdGF0dXMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGR4ZUN0eHQtPmR4ZUNoYW5uZWxbV0RUU19DSEFOTkVMX1RYX0xPV19QUkldLmRlc2NCb3R0b21Mb2NQaHlBZGRyKTsKKyAgIH0KKyAgIGVsc2UKKyAgIHsKKyAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgIiVzIFN0YXRlIG9mIERYRSBpcyBXTEFORFhFX1BPV0VSX1NUQVRFX0JNUFNfUEVORElORywgc28gY2Fubm90IHByb2NlZWQiLCBfX2Z1bmNfXyk7CisgICB9CisgICAvKiBGcmVlIE1TRyBidWZmZXIgKi8KKyAgIHdwYWxNZW1vcnlGcmVlKG1zZ1B0cik7CisgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICIlcyBFeGl0IiwgX19mdW5jX18pOworICAgcmV0dXJuOworfQorCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQCAgRnVuY3Rpb24gTmFtZSAKKyAgICAgIGR4ZVJ4VGhyZWFkU2V0UG93ZXJTdGF0ZUV2ZW50SGFuZGxlcgorCisgIEAgIERlc2NyaXB0aW9uIAorICAgICAgSWYgV0RJIHNlbmRzIHNldCBwb3dlciBzdGF0ZSByZXEsIHRoaXMgZXZlbnQgaGFuZGxlciB3aWxsIGJlIGNhbGxlZCBpbiBSeAorICAgICAgdGhyZWFkIGNvbnRleHQKKworICBAICBQYXJhbWV0ZXJzCisgICAgICAgICB2b2lkICAgICAgICAgICAgICAgKm1zZ1B0cgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFdmVudCBNU0cKKworICBAICBSZXR1cm4KKyAgICAgIE5vbmUKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIGR4ZVJ4VGhyZWFkU2V0UG93ZXJTdGF0ZUV2ZW50SGFuZGxlcgorKAorICAgIHdwdF9tc2cgICAgICAgICAgICAgICAqbXNnUHRyCispCit7CisgICB3cHRfc3RhdHVzICAgICAgICAgICAgICAgc3RhdHVzID0gZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTOworCisgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICIlcyBFbnRlciIsIF9fZnVuY19fKTsKKworICAgLyogTm93IHNlcmlhbGlzZSB0aGUgbWVzc2FnZSB0aHJvdWdoIFR4IHRocmVhZCBhbHNvIHRvIG1ha2Ugc3VyZQorICAgICogbm8gcmVnaXN0ZXIgYWNjZXNzIHdoZW4gUklWQSBpcyBpbiBwb3dlcnNhdmUgKi8KKyAgIC8qVXNlIHRoZSBzYW1lIG1lc3NhZ2UgcG9pbnRlciBqdXN0IGNoYW5nZSB0aGUgY2FsbCBiYWNrIGZ1bmN0aW9uICovCisgICBtc2dQdHItPmNhbGxiYWNrID0gZHhlVHhUaHJlYWRTZXRQb3dlclN0YXRlRXZlbnRIYW5kbGVyOworICAgc3RhdHVzID0gd3BhbFBvc3RUeE1zZyhXRElfR0VUX1BBTF9DVFgoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgbXNnUHRyKTsKKyAgIGlmICggZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cyApCisgICB7CisgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICJUeCB0aHJlYWQgU2V0IHBvd2VyIHN0YXRlIHJlcSBzZXJpYWxpemUgZmFpbCBzdGF0dXM9JWQiLAorICAgICAgICAgICAgICAgc3RhdHVzKTsKKyAgIH0KKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAiJXMgRXhpdCIsIF9fZnVuY19fKTsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lIAorICAgICAgV0xBTkRYRV9TZXRQb3dlclN0YXRlCisKKyAgQCAgRGVzY3JpcHRpb24gCisgICAgICBGcm9tIENsaWVudCBsZXQgRFhFIGtub3dzIHdoYXQgaXMgdGhlIFdMQU4gSFcoUklWQSkgcG93ZXIgc3RhdGUKKworICBAICBQYXJhbWV0ZXJzCisgICAgICBwVm9pZCAgICAgICAgICAgICAgICAgICAgcERYRUNvbnRleHQgOiBEWEUgQ29udHJvbCBCbG9jaworICAgICAgV0xBTkRYRV9Qb3dlclN0YXRlVHlwZSAgIHBvd2VyU3RhdGUKKworICBAICBSZXR1cm4KKyAgICAgIHdwdF9zdGF0dXMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit3cHRfc3RhdHVzIFdMQU5EWEVfU2V0UG93ZXJTdGF0ZQorKAorICAgdm9pZCAgICAgICAgICAgICAgICAgICAgKnBEWEVDb250ZXh0LAorICAgV0RUU19Qb3dlclN0YXRlVHlwZSAgICAgIHBvd2VyU3RhdGUsCisgICBXRFRTX1NldFBTQ2JUeXBlICAgICAgICAgY0JhY2sKKykKK3sKKyAgIHdwdF9zdGF0dXMgICAgICAgICAgICAgICBzdGF0dXMgPSBlV0xBTl9QQUxfU1RBVFVTX1NVQ0NFU1M7CisgICBXTEFORFhFX0N0cmxCbGtUeXBlICAgICAqcER4ZUN0cmxCbGs7CisgICBXTEFORFhFX1Bvd2VyU3RhdGVUeXBlICAgaG9zdFBvd2VyU3RhdGU7CisgICB3cHRfbXNnICAgICAgICAgICAgICAgICAqcnhDb21wTXNnOworICAgd3B0X21zZyAgICAgICAgICAgICAgICAgKnR4RGVzY1JlU3luY01zZzsKKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAiJXMgRW50ZXIiLCBfX2Z1bmNfXyk7CisgICBpZihOVUxMID09IHBEWEVDb250ZXh0KQorICAgeworICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiTlVMTCBwRFhFQ29udGV4dCBwYXNzZWQgYnkgY2FsbGVyIik7CisgICAgICByZXR1cm4gZVdMQU5fUEFMX1NUQVRVU19FX0ZBSUxVUkU7CisgICB9CisgICBwRHhlQ3RybEJsayA9IChXTEFORFhFX0N0cmxCbGtUeXBlICopcERYRUNvbnRleHQ7CisKKyAgIHN3aXRjaChwb3dlclN0YXRlKQorICAgeworICAgICAgY2FzZSBXRFRTX1BPV0VSX1NUQVRFX0ZVTEw6CisgICAgICAgICBpZihXTEFORFhFX1BPV0VSX1NUQVRFX0lNUFMgPT0gcER4ZUN0cmxCbGstPmhvc3RQb3dlclN0YXRlKQorICAgICAgICAgeworICAgICAgICAgICAgdHhEZXNjUmVTeW5jTXNnID0gKHdwdF9tc2cgKil3cGFsTWVtb3J5QWxsb2NhdGUoc2l6ZW9mKHdwdF9tc2cpKTsKKyAgICAgICAgICAgIGlmKE5VTEwgPT0gdHhEZXNjUmVTeW5jTXNnKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAiV0xBTkRYRV9TZXRQb3dlclN0YXRlLCBUWCBSZXN5bmMgTVNHIE1FTSBhbGxvYyBGYWlsIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICB0eERlc2NSZVN5bmNNc2ctPmNhbGxiYWNrID0gZHhlVFhSZVN5bmNEZXNjOworICAgICAgICAgICAgICAgdHhEZXNjUmVTeW5jTXNnLT5wQ29udGV4dCA9IHBEeGVDdHJsQmxrOworICAgICAgICAgICAgICAgc3RhdHVzID0gd3BhbFBvc3RUeE1zZyhXRElfR0VUX1BBTF9DVFgoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHhEZXNjUmVTeW5jTXNnKTsKKyAgICAgICAgICAgICAgIGlmKGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJXTEFORFhFX1NldFBvd2VyU3RhdGUsIFBvc3QgVFggcmUtc3luYyBNU0cgZmFpbCIpOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICAgICAgaG9zdFBvd2VyU3RhdGUgPSBXTEFORFhFX1BPV0VSX1NUQVRFX0ZVTEw7CisgICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgV0RUU19QT1dFUl9TVEFURV9CTVBTOgorICAgICAgICAgcER4ZUN0cmxCbGstPmhvc3RQb3dlclN0YXRlID0gV0xBTkRYRV9QT1dFUl9TVEFURV9CTVBTOworICAgICAgICAgaG9zdFBvd2VyU3RhdGUgPSBXTEFORFhFX1BPV0VSX1NUQVRFX0JNUFM7CisgICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgV0RUU19QT1dFUl9TVEFURV9JTVBTOgorICAgICAgICAgaG9zdFBvd2VyU3RhdGUgPSBXTEFORFhFX1BPV0VSX1NUQVRFX0lNUFM7CisgICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgV0RUU19QT1dFUl9TVEFURV9ET1dOOgorICAgICAgICAgcER4ZUN0cmxCbGstPmhvc3RQb3dlclN0YXRlID0gV0xBTkRYRV9QT1dFUl9TVEFURV9ET1dOOworICAgICAgICAgaG9zdFBvd2VyU3RhdGUgPSBXTEFORFhFX1BPV0VSX1NUQVRFX0RPV047CisgICAgICAgICBicmVhazsKKyAgICAgIGRlZmF1bHQ6CisgICAgICAgICBob3N0UG93ZXJTdGF0ZSA9IFdMQU5EWEVfUE9XRVJfU1RBVEVfTUFYOworICAgfQorCisgICAvLyBBIGNhbGxiYWNrIGkuZS4gQUNLIGJhY2sgaXMgbmVlZGVkIG9ubHkgd2hlbiB3ZSB3YW50IHRvIGVuYWJsZSBCTVBTCisgICAvLyBhbmQgdGhlIGRhdGEvbWFuYWdlbWVudCBwYXRoIGlzIGFjdGl2ZSBiZWNh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ICAgICB9CisgICB9CisgICBlbHNlCisgICB7CisgICAgICBpZiAoIFdMQU5EWEVfUE9XRVJfU1RBVEVfRlVMTCA9PSBob3N0UG93ZXJTdGF0ZSApCisgICAgICB7CisgICAgICAgICBpZiggV0xBTkRYRV9QT1dFUl9TVEFURV9CTVBTID09IHBEeGVDdHJsQmxrLT5ob3N0UG93ZXJTdGF0ZSApCisgICAgICAgICB7CisgICAgICAgICAgICBkeGVOb3RpZnlTbXNtKGVXTEFOX1BBTF9GQUxTRSwgZVdMQU5fUEFMX1RSVUUpOworICAgICAgICAgfQorICAgICAgICAgZWxzZSBpZiggV0xBTkRYRV9QT1dFUl9TVEFURV9JTVBTID09IHBEeGVDdHJsQmxrLT5ob3N0UG93ZXJTdGF0ZSApCisgICAgICAgICB7CisgICAgICAgICAgICAvKiBSZXF1ZXN0ZWQgRnVsbCBwb3dlciBmcm9tIGV4aXQgSU1QUywgcmVlbmFibGUgdGhlIGludGVycnVwdHMqLworICAgICAgICAgICAgaWYoZVdMQU5fUEFMX1RSVUUgPT0gcER4ZUN0cmxCbGstPnJ4SW50RGlzYWJsZWRCeUlNUFMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBwRHhlQ3RybEJsay0+cnhJbnREaXNhYmxlZEJ5SU1QUyA9IGVXTEFOX1BBTF9GQUxTRTsKKyAgICAgICAgICAgICAgIC8qIEVuYWJsZSBSWCBpbnRlcnJ1cHQgYXQgaGVyZSwgaWYgbmV3IFBTIGlzIG5vdCBJTVBTICovCisgICAgICAgICAgICAgICBzdGF0dXMgPSB3cGFsRW5hYmxlSW50ZXJydXB0KERYRV9JTlRFUlJVUFRfUlhfUkVBRFkpOworICAgICAgICAgICAgICAgaWYoZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzIEVuYWJsZSBSWCByZWFkeSBpbnRlcnJ1cHQgZmFpbCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZihlV0xBTl9QQUxfVFJVRSA9PSBwRHhlQ3RybEJsay0+dHhJbnREaXNhYmxlZEJ5SU1QUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHBEeGVDdHJsQmxrLT50eEludERpc2FibGVkQnlJTVBTID0gZVdMQU5fUEFMX0ZBTFNFOworICAgICAgICAgICAgICAgcER4ZUN0cmxCbGstPnR4SW50RW5hYmxlID0gIGVXTEFOX1BBTF9UUlVFOworICAgICAgICAgICAgICAgLyogRW5hYmxlIFJYIGludGVycnVwdCBhdCBoZXJlLCBpZiBuZXcgUFMgaXMgbm90IElNUFMgKi8KKyAgICAgICAgICAgICAgIHN0YXR1cyA9IHdwYWxFbmFibGVJbnRlcnJ1cHQoRFhFX0lOVEVSUlVQVF9UWF9DT01QTEUpOworICAgICAgICAgICAgICAgaWYoZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIEhEWEVfTVNHKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzIEVuYWJsZSBUWCBjb21wIGludGVycnVwdCBmYWlsIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgICAgIHBEeGVDdHJsQmxrLT5ob3N0UG93ZXJTdGF0ZSA9IGhvc3RQb3dlclN0YXRlOworICAgICAgICAgcER4ZUN0cmxCbGstPnJpdmFQb3dlclN0YXRlID0gV0xBTkRYRV9SSVZBX1BPV0VSX1NUQVRFX0FDVElWRTsKKyAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCBob3N0UG93ZXJTdGF0ZSA9PSBXTEFORFhFX1BPV0VSX1NUQVRFX0JNUFMgKQorICAgICAgeworICAgICAgICAgcER4ZUN0cmxCbGstPmhvc3RQb3dlclN0YXRlID0gaG9zdFBvd2VyU3RhdGU7CisgICAgICAgICBwRHhlQ3RybEJsay0+cml2YVBvd2VyU3RhdGUgPSBXTEFORFhFX1JJVkFfUE9XRVJfU1RBVEVfQk1QU19VTktOT1dOOworICAgICAgfQorICAgICAgZWxzZSBpZiAoIGhvc3RQb3dlclN0YXRlID09IFdMQU5EWEVfUE9XRVJfU1RBVEVfSU1QUyApCisgICAgICB7CisgICAgICAgICBwRHhlQ3RybEJsay0+aG9zdFBvd2VyU3RhdGUgPSBXTEFORFhFX1BPV0VSX1NUQVRFX0lNUFM7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICBIRFhFX0FTU0VSVCgwKTsKKyAgICAgIH0KKyAgIH0KKworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAiJXMgRXhpdCIsIF9fZnVuY19fKTsKKworICAgcmV0dXJuIHN0YXR1czsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lIAorICAgICAgV0xBTkRYRV9HZXRGcmVlVHhEYXRhUmVzTnVtYmVyCisKKyAgQCAgRGVzY3JpcHRpb24gCisgICAgICBSZXR1cm5zIGZyZWUgZGVzY3JpcHRvciBudW1iZXJzIGZvciBUWCBkYXRhIGNoYW5uZWwgKFRYIGhpZ2ggcHJpb3JpdHkpCisKKyAgQCAgUGFyYW1ldGVycworICAgICAgcFZvaWQgICAgICAgICAgICBwRFhFQ29udGV4dCA6IERYRSBDb250cm9sIEJsb2NrCisKKyAgQCAgUmV0dXJuCisgICAgICB3cHRfdWludDMyICAgICAgRnJlZSBkZXNjcmlwdG9yIG51bWJlciBvZiBUWCBoaWdoIHByaSBjaAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3dwdF91aW50MzIgV0xBTkRYRV9HZXRGcmVlVHhEYXRhUmVzTnVtYmVyCisoCisgICB2b2lkICpwRFhFQ29udGV4dAorKQoreworICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAiJXMgRW50ZXIiLCBfX2Z1bmNfXyk7CisKKyAgIGlmKE5VTEwgPT0gcERYRUNvbnRleHQpCisgICB7CisgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICJOVUxMIHBhcmFtZXRlciBwYXNzZWQgYnkgY2FsbGVyIik7CisgICAgICByZXR1cm4gKDApOworICAgfQorCisgICByZXR1cm4gKChXTEFORFhFX0N0cmxCbGtUeXBlICopcERYRUNvbnRleHQpLT5keGVDaGFubmVsW1dEVFNfQ0hBTk5FTF9UWF9MT1dfUFJJXS5udW1GcmVlRGVzYzsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lCisgICAgV0xBTkRYRV9DaGFubmVsRGVidWcKKworICBAICBEZXNjcmlwdGlvbgorICAgIERpc3BsYXkgRFhFIENoYW5uZWwgZGVidWdnaW5nIGluZm9ybWF0aW9uCisgICAgVXNlciBtYXkgcmVxdWVzdCB0byBkaXNwbGF5IERYRSBjaGFubmVsIHNuYXBzaG90CisgICAgT3IgaWYgaG9zdCBkcml2ZXIgZGV0ZWN0cyBhbnkgYWJub3JtYWwgc3RjdWsgbWF5IGRpc3BsYXkKKworICBAICBQYXJhbWV0ZXJzCisgICAgZGlzcGxheVNuYXBzaG90IDogRGlzcGxheSBEWEUgc25hcHNob3Qgb3B0aW9uCisgICAgZGVidWdGbGFncyAgICAgIDogRW5hYmxlIHN0YWxsIGRldGVjdCBmZWF0dXJlcworICAgICAgICAgICAgICAgICAgICAgIGRlZmluZWQgYnkgV1BBTF9EZXZpY2VEZWJ1Z0ZsYWdzCisgICAgICAgICAgICAgICAgICAgICAgVGhlc2UgZmVhdHVyZXMgbWF5IGVmZmVjdAorICAgICAgICAgICAgICAgICAgICAgIGRhdGEgcGVyZm9ybWFuY2UuCisKKyAgQCAgUmV0dXJuCisgICAgTk9ORQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBXTEFORFhFX0NoYW5uZWxEZWJ1ZworKAorICAgd3B0X2Jvb2xlYW4gZGlzcGxheVNuYXBzaG90LAorICAgd3B0X3VpbnQ4ICAgZGVidWdGbGFncworKQoreworICAgd3B0X21zZyAgICAgICAgICAgICAgICAgICpjaGFubmVsRGVidWdNc2c7CisgICB3cHRfbXNnICAgICAgICAgICAgICAgICAgKnR4RGVzY1JlU3luY01zZyA7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgIHJlZ1ZhbHVlLCByZWdWYWx1ZUxvY2FsID0gMDsKKyAgIHdwdF9zdGF0dXMgICAgICAgICAgICAgICAgc3RhdHVzID0gZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTOworCisgICAvKiBEZWJ1ZyBUeXBlIDEsIERpc3BsYXkgY3V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0cmxCbGstPnR4Q29tcGxldGVkRnJhbWVzLCByZWdWYWx1ZSwgcmVnVmFsdWVMb2NhbCk7CisKKyAgICAgIHdwYWxQYWNrZXRTdGFsbFVwZGF0ZUluZm8oKHdwdF91aW50MzIgKikmdGVtcER4ZUN0cmxCbGstPnJpdmFQb3dlclN0YXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcmVnVmFsdWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApOworCisgICAgICBjaGFubmVsRGVidWdNc2cgPSAod3B0X21zZyAqKXdwYWxNZW1vcnlBbGxvY2F0ZShzaXplb2Yod3B0X21zZykpOworICAgICAgaWYoTlVMTCA9PSBjaGFubmVsRGVidWdNc2cpCisgICAgICB7CisgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICJXTEFORFhFX0NoYW5uZWxEZWJ1ZywgTVNHIE1FTSBhbGxvYyBGYWlsIik7CisgICAgICAgICByZXR1cm4gOworICAgICAgfQorCisgICAgICBjaGFubmVsRGVidWdNc2ctPmNhbGxiYWNrID0gZHhlUnhUaHJlYWRDaGFubmVsRGVidWdIYW5kbGVyOworICAgICAgc3RhdHVzID0gd3BhbFBvc3RSeE1zZyhXRElfR0VUX1BBTF9DVFgoKSwgY2hhbm5lbERlYnVnTXNnKTsKKyAgICAgIGlmICggZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cyApCisgICAgICB7CisgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICJUeCB0aHJlYWQgU2V0IHBvd2VyIHN0YXRlIHJlcSBzZXJpYWxpemUgZmFpbCBzdGF0dXM9JWQiLAorICAgICAgICAgICAgICAgICAgc3RhdHVzKTsKKyAgICAgIH0KKyAgIH0KKworICAgaWYoZGVidWdGbGFncyAmIFdQQUxfREVCVUdfVFhfREVTQ19SRVNZTkMpCisgICB7CisgICAgICB0eERlc2NSZVN5bmNNc2cgPSAod3B0X21zZyAqKXdwYWxNZW1vcnlBbGxvY2F0ZShzaXplb2Yod3B0X21zZykpOworICAgICAgaWYoTlVMTCA9PSB0eERlc2NSZVN5bmNNc2cpCisgICAgICB7CisgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogUmVzeW5jIE1TRyBNRU0gYWxsb2MgRmFpbCIsX19mdW5jX18pOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgdHhEZXNjUmVTeW5jTXNnLT5jYWxsYmFjayA9IGR4ZURlYnVnVHhEZXNjUmVTeW5jOworICAgICAgICAgdHhEZXNjUmVTeW5jTXNnLT5wQ29udGV4dCA9IHRlbXBEeGVDdHJsQmxrOworICAgICAgICAgc3RhdHVzID0gd3BhbFBvc3RUeE1zZyhXRElfR0VUX1BBTF9DVFgoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHhEZXNjUmVTeW5jTXNnKTsKKyAgICAgICAgIGlmKGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpCisgICAgICAgICB7CisgICAgICAgICAgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICIlczogUG9zdCBUWCByZS1zeW5jIE1TRyBmYWlsIixfX2Z1bmNfXyk7CisgICAgICAgICB9CisgICAgICB9CisgICB9CisKKyAgIHJldHVybjsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lCisgICAgV0xBTkRYRV9LaWNrRHhlCisKKyAgQCAgRGVzY3JpcHRpb24KKyAgICBLaWNrIERYRSB3aGVuIEhERCBUWCB0aW1lIG91dCBoYXBwZW4KKworICBAICBQYXJhbWV0ZXJzCisgICAgTk9ORQorCisgIEAgIFJldHVybgorICAgIE5PTkUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgV0xBTkRYRV9LaWNrRHhlKHZvaWQpCit7CisgICBIRFhFX01TRyhlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICIlczogS2ljayBEeGUgZm9yIEhERCBUWCB0aW1lb3V0IixfX2Z1bmNfXyk7CisgICAvKiBNYWtlIHdha2UgdXAgSFcgKi8KKyAgIGR4ZU5vdGlmeVNtc20oZVdMQU5fUEFMX0ZBTFNFLCBlV0xBTl9QQUxfVFJVRSk7CisgICBkeGVOb3RpZnlTbXNtKGVXTEFOX1BBTF9UUlVFLCBlV0xBTl9QQUxfRkFMU0UpOworfQorCit3cHRfdWludDMyIFdMQU5EWEVfU2V0dXBMb2dUcmFuc2Zlcih3cHRfdWludDY0IGJ1ZmZlckFkZHIsIHdwdF91aW50MzIgYnVmZmVyTGVuKQoreworICAgV0xBTkRYRV9DaGFubmVsQ0JUeXBlICAgICpjaGFubmVsRW50cnk7CisKKyAgIGNoYW5uZWxFbnRyeSA9ICZ0ZW1wRHhlQ3RybEJsay0+ZHhlQ2hhbm5lbFtXRFRTX0NIQU5ORUxfUlhfRldfTE9HXTsKKworCisgICByZXR1cm4gZHhlUlhMb2dSZWZpbGxSaW5nKHRlbXBEeGVDdHJs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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAKKyAgQGZpbGUgIHdsYW5fcWN0X2R4ZV9jZmdfaS5jCisgIAorICBAYnJpZWYgCisgICAgICAgICAgICAgICAKKyAgIFRoaXMgZmlsZSBjb250YWlucyB0aGUgZXh0ZXJuYWwgQVBJIGV4cG9zZWQgYnkgdGhlIHdsYW4gZGF0YSB0cmFuc2ZlciBhYnN0cmFjdGlvbiBsYXllciBtb2R1bGUuCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisgICRIZWFkZXI6JCAkRGF0ZVRpbWU6ICQgJEF1dGhvcjogJAorCisKK3doZW4gICAgICAgICAgIHdobyAgICAgICAgd2hhdCwgd2hlcmUsIHdoeQorLS0tLS0tLS0gICAgLS0tICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorMDgvMDMvMTAgICAgc2NoYW5nICAgICAgQ3JlYXRlZCBtb2R1bGUuCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgSU5DTFVERSBGSUxFUyBGT1IgTU9EVUxFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICogSW5jbHVkZSBGaWxlcworICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisjaW5jbHVkZSAid2xhbl9xY3RfZHhlX2kuaCIKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKiBQcmVwcm9jZXNzb3IgRGVmaW5pdGlvbnMgYW5kIENvbnN0YW50cworICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCit0eXBlZGVmIHN0cnVjdAoreworICAgV0RUU19DaGFubmVsVHlwZSAgICAgICAgICAgd2xhbkNoYW5uZWw7CisgICBXTEFORFhFX0RNQUNoYW5uZWxUeXBlICAgICBETUFDaGFubmVsOworICAgV0xBTkRYRV9DaGFubmVsQ29uZmlnVHlwZSAqY2hhbm5lbENvbmZpZzsKK30gV0xBTkRYRV9DaGFubmVsTWFwcGluZ1R5cGU7CisKK3dwdF91aW50MzIgY2hhbm5lbEJhc2VBZGRyZXNzTGlzdFtXTEFORFhFX0RNQV9DSEFOTkVMX01BWF0gPQoreworICAgV0xBTkRY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LworICAgMCwKKworICAgLyogUmVmZXJlbmNlIFdRLCBUWDIzICovCisgICAyMywKKworICAgLyogVVNCIE9ubHksIEVuZCBwb2ludCBpbmZvICovCisgICAwLAorCisgICAvKiBUcmFuc2ZlciBUeXBlICovCisgICBXTEFORFhFX0RFU0NfQ1RSTF9YVFlQRV9IMkIsCisKKyAgIC8qIENoYW5uZWwgUHJpb3JpdHkgNyhIaWdoZXN0KSAtIDAoTG93ZXN0KSBOT1QgQ0xFQVIgWUVUICEhISAqLworICAgNCwKKworICAgLyogQkQgYXR0YWNoZWQgdG8gZnJhbWVzIGZvciB0aGlzIHBpcGUgKi8KKyAgIGVXTEFOX1BBTF9UUlVFLAorCisgICAvKiBjaGtfc2l6ZSwgTk9UIENMRUFSIFlFVCAhISEqLworICAgMCwKKworICAgLyogYm11VGhkU2VsLCBOT1QgQ0xFQVIgWUVUICEhISAqLworICAgNSwKKworICAgLyogQWRkZWQgaW4gR2VuNSBmb3IgUHJlZmV0Y2gsIE5PVCBDTEVBUiBZRVQgISEhICovCisgICBlV0xBTl9QQUxfVFJVRSwKKworICAgLyogVXNlIHNob3J0IERlc2NyaXB0b3IgKi8KKyAgIGVXTEFOX1BBTF9UUlVFCit9OworCitXTEFORFhFX0NoYW5uZWxDb25maWdUeXBlIGNoYW5UWEhpZ2hQcmlDb25maWcgPQoreworICAgLyogUSBoYW5kbGUgdHlwZSwgQ2lyY3VsYXIgKi8KKyAgIFdMQU5EWEVfQ0hBTk5FTF9IQU5ETEVfQ0lSQ1VMQSwKKworICAgLyogTnVtYmVyIG9mIERlc2NyaXB0b3IsIE5PVCBDTEVBUiBZRVQgISEhICovCisgICBXTEFORFhFX0hJX1BSSV9SRVNfTlVNICwKKworICAgLyogTUFYIG51bSBSWCBCdWZmZXIgKi8KKyAgIDAsCisKKyAgIC8qIFJlZmVyZW5jZSBXUSwgVFgyMyAqLworICAgMjMsCisKKyAgIC8qIFVTQiBPbmx5LCBFbmQgcG9pbnQgaW5mbyAqLworICAgMCwKKworICAgLyogVHJhbnNmZXIgVHlwZSAqLworICAgV0xBTkRYRV9ERVNDX0NUUkxfWFRZUEVfSDJCLAorCisgICAvKiBDaGFubmVsIFByaW9yaXR5IDcoSGlnaGVzdCkgLSAwKExvd2VzdCksIE5PVCBDTEVBUiBZRVQgISEhICovCisgICA2LAorCisgICAvKiBCRCBhdHRhY2hlZCB0byBmcmFtZXMgZm9yIHRoaXMgcGlwZSAqLworICAgZVdMQU5fUEFMX1RSVUUsCisKKyAgIC8qIGNoa19zaXplLCBOT1QgQ0xFQVIgWUVUICEhISovCisgICAwLAorCisgICAvKiBibXVUaGRTZWwsIE5PVCBDTEVBUiBZRVQgISEhICovCisgICA3LAorCisgICAvKiBBZGRlZCBpbiBHZW41IGZvciBQcmVmZXRjaCwgTk9UIENMRUFSIFlFVCAhISEqLworICAgZVdMQU5fUEFMX1RSVUUsCisKKyAgIC8qIFVzZSBzaG9ydCBEZXNjcmlwdG9yICovCisgICBlV0xBTl9QQUxfVFJVRQorfTsKKworV0xBTkRYRV9DaGFubmVsQ29uZmlnVHlwZSBjaGFuUlhMb3dQcmlDb25maWcgPQoreworICAgLyogUSBoYW5kbGUgdHlwZSwgQ2lyY3VsYXIgKi8KKyAgIFdMQU5EWEVfQ0hBTk5FTF9IQU5ETEVfQ0lSQ1VMQSwKKworICAgLyogTnVtYmVyIG9mIERlc2NyaXB0b3IsIE5PVCBDTEVBUiBZRVQgISEhICovCisgICAyNTYsCisKKyAgIC8qIE1BWCBudW0gUlggQnVmZmVyLCBOT1QgQ0xFQVIgWUVUICEhISAqLworICAgMSwKKworICAgLyogUmVmZXJlbmNlIFdRLCBOT1QgQ0xFQVIgWUVUICEhISAqLworICAgLyogVGVtcG9yYXJ5IEJNVSBXb3JrIFEgNCAqLworICAgMTEsCisKKyAgIC8qIFVTQiBPbmx5LCBFbmQgcG9pbnQgaW5mbyAqLworICAgMCwKKworICAgLyogVHJhbnNmZXIgVHlwZSAqLworICAgV0xBTkRYRV9ERVN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KyAgIDYsCisKKyAgIC8qIEJEIGF0dGFjaGVkIHRvIGZyYW1lcyBmb3IgdGhpcyBwaXBlICovCisgICBlV0xBTl9QQUxfVFJVRSwKKworICAgLyogY2hrX3NpemUsIE5PVCBDTEVBUiBZRVQgISEhKi8KKyAgIDAsCisKKyAgIC8qIGJtdVRoZFNlbCwgTk9UIENMRUFSIFlFVCAhISEgKi8KKyAgIDgsCisKKyAgIC8qIEFkZGVkIGluIEdlbjUgZm9yIFByZWZldGNoLCBOT1QgQ0xFQVIgWUVUICEhISovCisgICBlV0xBTl9QQUxfVFJVRSwKKworICAgLyogVXNlIHNob3J0IERlc2NyaXB0b3IgKi8KKyAgIGVXTEFOX1BBTF9UUlVFCit9OworCitXTEFORFhFX0NoYW5uZWxDb25maWdUeXBlIGNoYW5SWExvZ0NvbmZpZyA9Cit7CisgICAvKiBRIGhhbmRsZSB0eXBlLCBDaXJjdWxhciAqLworICAgV0xBTkRYRV9DSEFOTkVMX0hBTkRMRV9DSVJDVUxBLAorCisgICAvKiBOdW1iZXIgb2YgRGVzY3JpcHRvcnMqLworICAgOCwKKworICAgLyogTUFYIG51bSBSWCBCdWZmZXIqLworICAgMSwKKworICAgLyogUmVmZXJlbmNlIFdRLCBSWDIzICovCisgICAyMywKKworICAgLyogVVNCIE9ubHksIEVuZCBwb2ludCBpbmZvICovCisgICAwLAorCisgICAvKiBUcmFuc2ZlciBUeXBlICovCisgICBXTEFORFhFX0RFU0NfQ1RSTF9YVFlQRV9CMkgsCisKKyAgIC8qIENoYW5uZWwgUHJpb3JpdHkgNyhIaWdoZXN0KSAtIDAoTG93ZXN0KSovCisgICAxLAorCisgICAvKiBCRCBhdHRhY2hlZCB0byBmcmFtZXMgZm9yIHRoaXMgcGlwZSAqLworICAgZVdMQU5fUEFMX1RSVUUsCisKKyAgIC8qIGNoa19zaXplKi8KKyAgIDAsCisKKyAgIC8qIGJtdVRoZFNlbCovCisgICA4LAorCisgICAvKiBBZGRlZCBpbiBHZW41IGZvciBQcmVmZXRjaCovCisgICBlV0xBTl9QQUxfVFJVRSwKKworICAgLyogVXNlIHNob3J0IERlc2NyaXB0b3IgKi8KKyAgIGVXTEFOX1BBTF9UUlVFCit9OworCitXTEFORFhFX0NoYW5uZWxDb25maWdUeXBlIGNoYW5SWEZXTG9nQ29uZmlnID0KK3sKKyAgIC8qIFEgaGFuZGxlIHR5cGUsIENpcmN1bGFyICovCisgICBXTEFORFhFX0NIQU5ORUxfSEFORExFX0NJUkNVTEEsCisKKyAgIC8qIE51bWJlciBvZiBEZXNjcmlwdG9ycyovCisgICAzMiwKKworICAgLyogTUFYIG51bSBSWCBCdWZmZXIqLworICAgMSwKKworICAgLyogUmVmZXJlbmNlIFdRIC0gTkEgYXMgY2hhbm5lbCB1c2VkIGZvciBIMkggKi8KKyAgIDAsCisKKyAgIC8qIFVTQiBPbmx5LCBFbmQgcG9pbnQgaW5mbyAqLworICAgMCwKKworICAgLyogVHJhbnNmZXIgVHlwZSAqLworICAgV0xBTkRYRV9ERVNDX0NUUkxfWFRZUEVfSDJILAorCisgICAvKiBDaGFubmVsIFByaW9yaXR5IDcoSGlnaGVzdCkgLSAwKExvd2VzdCkqLworICAgMCwKKworICAgLyogQkQgYXR0YWNoZWQgdG8gZnJhbWVzIGZvciB0aGlzIHBpcGUgKi8KKyAgIGVXTEFOX1BBTF9UUlVFLAorCisgICAvKiBjaGtfc2l6ZSovCisgICAwLAorCisgICAvKiBibXVUaGRTZWwqLworICAgOCwKKworICAgLyogQWRkZWQgaW4gR2VuNSBmb3IgUHJlZmV0Y2gqLworICAgZVdMQU5fUEFMX1RSVUUsCisKKyAgIC8qIFVzZSBzaG9ydCBEZXNjcmlwdG9yICovCisgICBlV0xBTl9QQUxfVFJVRQorfTsKKworV0xBTkRYRV9DaGFubmVsTWFwcGluZ1R5cGUgY2hhbm5lbExpc3RbV0RUU19DSEFOTkVMX01BWF0gPQoreworICAge1dEVFNfQ0hBTk5FTF9UWF9MT1dfUFJJLCAgV0xBTk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AgLyogUGVyIEsgZnJhbWUgZW5hYmxlIEludGVycnVwdCAqLworICAgLypXTEFORFhFX0hJX1BSSV9SRVNfTlVNKi8gNSwKKworICAgLyogUGVyaW9kaWMgdGltZXIgbXNlYyAqLworICAgMTAKK307CisKKy8vIEluZGljYXRlcyB0aGUgRFhFIGNoYW5uZWxzIGJlaW5nIHVzZWQgaW4gdGhlIGN1cnJlbnQgcnVuLgorc3RhdGljIHdwdF91aW50OCBkeGVFbmFibGVkQ2hhbm5lbHM7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQCAgRnVuY3Rpb24gTmFtZQorICAgICAgZHhlU2V0RW5hYmxlZENoYW5uZWxzCisKKyAgQCAgRGVzY3JpcHRpb24KKworICBAICBQYXJhbWV0ZXJzCisKKyAgQCAgUmV0dXJuCisgICAgICB2b2lkCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIGR4ZVNldEVuYWJsZWRDaGFubmVscworKAorICAgd3B0X3VpbnQ4IGVuYWJsZWRDaGFubmVscworKQoreworICAgZHhlRW5hYmxlZENoYW5uZWxzID0gZW5hYmxlZENoYW5uZWxzOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEAgIEZ1bmN0aW9uIE5hbWUKKyAgICAgIGR4ZUdldEVuYWJsZWRDaGFubmVscworCisgIEAgIERlc2NyaXB0aW9uCisKKyAgQCAgUGFyYW1ldGVycworCisgIEAgIFJldHVybgorICAgICAgd3B0X3VpbnQ4CisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit3cHRfdWludDggZHhlR2V0RW5hYmxlZENoYW5uZWxzCisoCisgICB2b2lkCispCit7CisgICByZXR1cm4gZHhlRW5hYmxlZENoYW5uZWxzOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEAgIEZ1bmN0aW9uIE5hbWUgCisgICAgICBkeGVDb21tb25EZWZhdWx0Q29uZmlnCisKKyAgQCAgRGVzY3JpcHRpb24gCisKKyAgQCAgUGFyYW1ldGVycworICAgICAgV0xBTkRYRV9DdHJsQmxrVHlwZSAgICAgKmR4ZUN0cmxCbGssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRFhFIGhvc3QgZHJpdmVyIG1haW4gY29udHJvbCBibG9jaworCisgIEAgIFJldHVybgorICAgICAgdm9pZAorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBkeGVDb21tb25EZWZhdWx0Q29uZmlnCisoCisgICBXTEFORFhFX0N0cmxCbGtUeXBlICAgICAqZHhlQ3RybEJsaworKQoreworICAgZHhlQ3RybEJsay0+cnhSZWFkeUNCICAgICA9IE5VTEw7CisgICBkeGVDdHJsQmxrLT50eENvbXBDQiAgICAgID0gTlVMTDsKKyAgIGR4ZUN0cmxCbGstPmxvd1Jlc291cmNlQ0IgPSBOVUxMOworCisgICB3cGFsTWVtb3J5Q29weSgmZHhlQ3RybEJsay0+dHhDb21wSW50LAorICAgICAgICAgICAgICAgICAgJnR4Q29tcEludCwKKyAgICAgICAgICAgICAgICAgIHNpemVvZihXTEFORFhFX1R4Q29tcEludENvbmZpZ1R5cGUpKTsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lIAorICAgICAgZHhlQ2hhbm5lbERlZmF1bHRDb25maWcKKworICBAICBEZXNjcmlwdGlvbiAKKyAgICAgIEdldCBkZWZ1YWx0IGNvbmZpZ3VyYXRpb24gdmFsdWVzIGZyb20gcHJlIGRlZmluZWQgc3RydWN0dXJlCisgICAgICBBbGwgdGhlIGNoYW5uZWxzIG11c3QgaGF2ZSBpdCdzIG93biBjb25maWd1cmF0aW9ucworCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIFdMQU5EWEVfQ3RybEJsa1R5cGU6ICAgICpkeGVDdHJsQmxrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERYRSBob3N0IGRyaXZlciBtYWluIGNvbnRyb2wgYmxvY2sKKyAgICAgIFdMQU5EWEVfQ2hhbm5lbENCVHlwZSAgICpjaGFubmVsRW50cnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGFubmVsIHNwZWNpZmljIGNvbnRyb2wgYmxvY2sKKworICBAICBSZXR1cm4KKyAgICAgIHdwdF9zdGF0dXMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3dwdF9zdGF0dXMgZHhlQ2hhbm5lbERlZmF1bHRDb25maWcKKygKKyAgIFdMQU5EWEVfQ3RybEJsa1R5cGUgICAgICpkeGVDdHJsQmxrLAorICAgV0xBTkRYRV9DaGFubmVsQ0JUeXBlICAgKmNoYW5uZWxFbnRyeQorKQoreworICAgd3B0X3N0YXR1cyAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICBiYXNlQWRkcmVzczsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICBkeGVDb250cm9sUmVhZCAgPSAwOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgIGR4ZUNvbnRyb2xXcml0ZSA9IDA7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgZHhlQ29udHJvbFdyaXRlVmFsaWQgPSAwOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgIGR4ZUNvbnRyb2xXcml0ZUVvcCA9IDA7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgZHhlQ29udHJvbFdyaXRlRW9wSW50ID0gMDsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICBpZHg7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgcnhSZXNvdXJjZUNvdW50ID0gMDsKKyAgIFdMQU5EWEVfQ2hhbm5lbE1hcHBpbmdUeXBlICptYXBwZWRDaGFubmVsID0gTlVMTDsKKworICAgLyogU2FuaXR5IENoZWNrICovCisgICBpZigoTlVMTCA9PSBkeGVDdHJsQmxrKSB8fCAoTlVMTCA9PSBjaGFubmVsRW50cnkpKQorICAgeworICAgICAgSERYRV9NU0coZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiZHhlTGlua0Rlc2NBbmRDdHJsQmxrIENoYW5uZWwgRW50cnkgaXMgbm90IHZhbGlkIik7CisgICAgICByZXR1cm4gZVdMQU5fUEFMX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICBmb3IoaWR4ID0gMDsgaWR4IDwgV0RUU19DSEFOTkVMX01BWDsgaWR4KyspCisgICB7CisgICAgICBpZihjaGFubmVsRW50cnktPmNoYW5uZWxUeXBlID09IGNoYW5uZWxMaXN0W2lkeF0ud2xhbkNoYW5uZWwpCisgICAgICB7CisgICAgICAgICBtYXBwZWRDaGFubmVsID0gJmNoYW5uZWxMaXN0W2lkeF07CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgIH0KKworICAgaWYoKE5VTEwgPT0gbWFwcGVkQ2hhbm5lbCkgfHwgKFdEVFNfQ0hBTk5FTF9NQVggPT0gaWR4KSkKKyAgIHsKKyAgICAgIEhEWEVf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yAgIC8qIENvbnRyb2wgV3JpdGUgaW5jbHVkZSBFT1AgYW5kIElOVAorICAgICogaW5kaWNhdGUgRW5kIE9mIFBhY2tldCBhbmQgZ2VuZXJhdGUgaW50ZXJydXB0IG9uIGRlc2NyaXB0b3IgRG9uZSAqLworICAgY2hhbm5lbEVudHJ5LT5leHRyYUNvbmZpZy5jd19jdHJsX3dyaXRlX2VvcF9pbnQgPQorICAgICAgICAgICAgICAgICAgV0xBTkRYRV9VMzJfU1dBUF9FTkRJQU4oZHhlQ29udHJvbFdyaXRlRW9wSW50KTsKKworCisgICAvKiBzaXplIG1hc2s/Pz8/ICovCisgICBjaGFubmVsRW50cnktPmV4dHJhQ29uZmlnLmNoa19zaXplX21hc2sgPSAKKyAgICAgICAgICAgIG1hcHBlZENoYW5uZWwtPmNoYW5uZWxDb25maWctPmNoa19zaXplIDw8IDEwOworCisgICBjaGFubmVsRW50cnktPmV4dHJhQ29uZmlnLnJlZldRX3N3YXBwZWQgPSAKKyAgICAgICAgICAgICAgICBXTEFORFhFX1UzMl9TV0FQX0VORElBTihjaGFubmVsRW50cnktPmNoYW5uZWxDb25maWcucmVmV1EpOworCisgICAvKiBTZXQgQ2hhbm5lbCBzcGVjaWZpYyBJbnRlcnJ1cHQgbWFzayAqLworICAgY2hhbm5lbEVudHJ5LT5leHRyYUNvbmZpZy5pbnRNYXNrID0gY2hhbm5lbEludGVycnVwdE1hc2tbbWFwcGVkQ2hhbm5lbC0+RE1BQ2hhbm5lbF07CisKKworICAgd3BhbEdldE51bVJ4UmF3UGFja2V0KCZyeFJlc291cmNlQ291bnQpOworICAgaWYoKFdEVFNfQ0hBTk5FTF9UWF9MT1dfUFJJID09IGNoYW5uZWxFbnRyeS0+Y2hhbm5lbFR5cGUpIHx8CisgICAgICAoMCA9PSByeFJlc291cmNlQ291bnQpKQorICAgeworICAgICAgY2hhbm5lbEVudHJ5LT5udW1EZXNjICAgICAgICAgPSBtYXBwZWRDaGFubmVsLT5jaGFubmVsQ29u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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisgICRIZWFkZXI6JCAkRGF0ZVRpbWU6ICQgJEF1dGhvcjogJAorCisKK3doZW4gICAgICAgICAgIHdobyAgICAgICAgd2hhdCwgd2hlcmUsIHdoeQorLS0tLS0tLS0gICAgLS0tICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorMDgvMDMvMTAgICAgc2NoYW5nICAgICAgQ3JlYXRlZCBtb2R1bGUuCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgSU5DTFVERSBGSUxFUyBGT1IgTU9EVUxFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICogSW5jbHVkZSBGaWxlcworICogLS0tLS0tLS0tLS0tLS0tLS0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FREFEUiAgICAgICA9IDIxLAorICAgV0xBTkRYRV9FUlJPUl9QUkdfSU5WX1NSQ19XUUlEICAgID0gMjIsCisgICBXTEFORFhFX0VSUk9SX1BSR19JTlZfRFNUX1dRSUQgICAgPSAyMywKKyAgIFdMQU5EWEVfRVJST1JfUFJHX1hUWVBFX01TTVRDSCAgICA9IDI0LAorICAgV0xBTkRYRV9FUlJPUl9QS1RfRVJSICAgICAgICAgICAgID0gMjUsCisgICBXTEFORFhFX0VSUk9SX0FCT1JUICAgICAgICAgICAgICAgPSAyNiwKKyAgIFdMQU5EWEVfRVJST1JfUERVX0NOVF9PVkZMICAgICAgICA9IDI3LAorfVdMQU5EWEVfRXJyb3JDb2RlOworCisvKiBEWEUgRGVzY3JpcHRvciBFbmRpYW4gc3dhcCBtYWNybyAqLworI2lmZGVmIFdMQU5EWEVfRU5ESUFOX1NXQVBfRU5BQkxFCisjZGVmaW5lIFdMQU5EWEVfVTMyX1NXQVBfRU5ESUFOKGEpICgoKGEgJiAweDAwMDAwMEZGKSA8PCAyNCkgfCAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGEgJiAweDAwMDBGRjAwKSA8PCA4KSAgfCAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGEgJiAweDAwRkYwMDAwKSA+PiA4KSAgfCAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGEgJiAweEZGMDAwMDAwKSA+PiAyNCkpCisjZWxzZQorLyogSWYgRFhFIEhXIGRvZXMgbm90IG5lZWQgZW5kaWFuIHN3YXAsIERPIE5PVEhJTkcgKi8KKyNkZWZpbmUgV0xBTkRYRV9VMzJfU1dBUF9FTkRJQU4oYSkgKGEpCisjZW5kaWYgLyogV0xBTkRYRV9FTkRJQU5fU1dBUF9FTkFCTEUgKi8KKworLyogTG9nIERlZmluaXRpb24gd2lsbCBiZSBtYXBwcGVkIHdpdGggUEFMIE1TRyAqLworI2R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dMQU5EWEVfRE1BX0NIQU5ORUxfMSwKKyAgIFdMQU5EWEVfRE1BX0NIQU5ORUxfMiwKKyAgIFdMQU5EWEVfRE1BX0NIQU5ORUxfMywKKyAgIFdMQU5EWEVfRE1BX0NIQU5ORUxfNCwKKyAgIFdMQU5EWEVfRE1BX0NIQU5ORUxfNSwKKyAgIFdMQU5EWEVfRE1BX0NIQU5ORUxfNiwKKyAgIFdMQU5EWEVfRE1BX0NIQU5ORUxfNywKKyAgIFdMQU5EWEVfRE1BX0NIQU5ORUxfTUFYCit9IFdMQU5EWEVfRE1BQ2hhbm5lbFR5cGU7CisKKy8qKiBEWEUgSFcgTG9uZyBEZXNjcmlwdG9yIGZvcm1hdCAqLwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgc3JjTWVtQWRkckw7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgICAgIHNyY01lbUFkZHJIOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICAgICBkc3RNZW1BZGRyTDsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgZHN0TWVtQWRkckg7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgICAgIHBoeU5leHRMOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICAgICBwaHlOZXh0SDsKK30gV0xBTkRYRV9Mb25nRGVzYzsKKworCisvKiogRFhFIEhXIFNob3J0IERlc2NyaXB0b3IgZm9ybWF0ICovCit0eXBlZGVmIHN0cnVjdCB0RFhFU2hvcnREZXNjCit7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgICAgIHNyY01lbUFkZHJMOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICAgICBkc3RNZW1BZGRyTDsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgcGh5TmV4dEw7Cit9IFdMQU5EWEVfU2hvcnREZXNjOworCisKKy8qIERYRSBEZXNjcmlwdG9yIERhdGEgVHlwZQorICAqIFBpY2sgdXAgZnJvbSBHRU41ICovCit0eXBlZGVmIHN0cnVjdAoreworICAgdW5pb24KKyAgIHsKKyAgICAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgY3RybDsKKyAgICAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgdmFsaWQgICAgICAgICAgOjE7ICAgICAvLzAgPSBETUEgc3RvcCwgMSA9IERNQSBjb250aW51ZSB3aXRoIHRoaXMgZGVzY3JpcHRvcgorICAgICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICB0cmFuc2ZlclR5cGUgICA6MjsgICAgIC8vMCA9IEhvc3QgdG8gSG9zdCBzcGFjZQorICAgICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICBlb3AgICAgICAgICAgICA6MTsgICAgIC8vRW5kIG9mIFBhY2tldAorICAgICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICBiZEhhbmRsaW5nICAgICA6MTsgICAgICAgICAgLy9pZiB0cmFuc2ZlclR5cGUgPSBIb3N0IHRvIEJNVSwgdGhlbiAwIG1lYW5zIGZpcnN0IDEyOCBieXRlcyBjb250YWluIEJELCBhbmQgMSBtZWFucyBjcmVhdGUgbmV3IGVtcHR5IEJECisgICAgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgIHNpcSAgICAgICAgICAgIDoxOyAgICAgLy8gU0lRCisgICAgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgIGRpcSAgICAgICAgICAgIDoxOyAgICAgLy8gRElRCisgICAgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgIHBkdVJlbCAgICAgICAgIDoxOyAgICAgLy8wID0gZG9uJ3QgcmVsZWFzZSBCRCBhbmQgUERVcyB3aGVuIGRvbmUsIDEgPSByZWxlYXNlIHRoZW0KKyAgICAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgYnRobGRTZWwgICAgICAgOjQ7ICAgICAvL0JNVSBUaHJlc2hvbGQgU2VsZWN0CisgICAgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgIHByaW8gICAgICAgICAgIDozOyAgICAgLy9TcGVjaWZpZXMgdGhlIHByaW9yaXR5IGxldmVsIHRvIHVzZSBmb3IgdGhlIHRyYW5zZmVyCisgICAgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgIHN0b3BDaGFubmVsICAgIDoxOyAgICAgLy8xID0gRE1BIHN0b3BzIHByb2Nlc3NpbmcgZnVydGhlciwgY2hhbm5lbCByZXF1aXJlcyByZS1lbmFibGluZyBhZnRlciB0aGlzCisgICAgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgIGludHIgICAgICAgICAgIDoxOyAgICAgLy9JbnRlcnJ1cHQgb24gRGVzY3JpcHRvciBEb25lCisgICAgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgIHJzdmQgICAgICAgICAgIDoxOyAgICAgLy9yZXNlcnZlZAorICAgICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICB0cmFuc2ZlclNpemUgICA6MTQ7ICAgIC8vMTQgYml0cyB1c2VkIC0gaWdub3JlZCBmb3IgQk1VIHRyYW5zZmVycywgb25seSB1c2VkIGZvciBob3N0IHRvIGhvc3QgdHJhbnNmZXJzPworICAgfSBkZXNjQ3RybDsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgeGZyU2l6ZTsKKyAgIHVuaW9uCisgICB7CisgICAgICBXTEFORFhFX0xvbmdEZXNjICAgICAgICAgICAgIGR4ZV9sb25nX2Rlc2M7CisgICAgICBXTEFORFhFX1Nob3J0RGVzYyAgICAgICAgICAgIGR4ZV9zaG9ydF9kZXNjOworICAgfWR4ZWRlc2M7IAorfSBXTEFORFhFX0Rlc2NUeXBlOworCit0eXBlZGVmIHN0cnVjdAoreworICAgdm9pZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAqbmV4dEN0cmxCbGs7CisgICB3cHRfcGFja2V0ICAgICAgICAgICAgICAgICAgICAgICp4ZnJGcmFtZTsgIAorICAgV0xBTkRYRV9EZXNjVHlwZSAgICAgICAgICAgICAgICAqbGlua2VkRGVzYzsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgIGxpbmtlZERlc2NQaHlBZGRyOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICAgICAgY3RybEJsa09yZGVyOworfSBXTEFORFhFX0Rlc2NDdHJsQmxrVHlwZTsKKwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgIC8qIFEgaGFuZGxlIG1ldGhvZCwgbGluZWFyIG9yIHJpbmcgKi8KKyAgIFdMQU5EWEVfQ2hhbm5lbEhhbmRsZVR5cGUgICAgICAgcXVldWVNZXRob2Q7CisKKyAgIC8qIE51bWJlciBvZiBkZXNjcmlwdG9ycyBmb3IgRFhFIHRoYXQgY2FuIGJlIHF1ZXVlZCBmb3IgdHJhbnNmZXIgYXQgb25lIHRpbWUgKi8KKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgbkRlc2NzOworCisgICAvKiBNYXhpbXVtIG51bWJlciBvZiByZWNlaXZlIGJ1ZmZlcnMgIG9mIHNoYXJlZCBtZW1vcnkgdG8gdXNlIGZvciB0aGlzIHBpcGUgKi8KKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgblJ4QnVmZmVyczsKKworICAgLyogUmVmZXJlbmNlIFdRIC0gZm9yIEgyQiBhbmQgQjJIIG9ubHkgKi8KKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgcmVmV1E7CisKKyAgIC8qIGZvciB1c2Igb25seSwgZW5kcG9pbnQgaW5mbyBmb3IgQ0hfU0FEUiBvciBDSF9EQURSICovCisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgICAgIHJlZkVQOworCisgICAvKiBIMkIoVHgpLCBCMkgoUngpLCBIMkgoU1JBTTwtPkhvc3RNZW0gUi9XKSAqLworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICAgICB4ZnJUeXBlOworCisgICAvKiBDaGFubmVsIFByaW9yaXR5IDcoSGlnaGVzdCkgLSAwKExvd2VzdCkgKi8KKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgY2hQcmlvcml0eTsKKworICAgLyogMSA9IEJEIGF0dGFjaGVkIHRvIGZyYW1lcyBmb3IgdGhpcyBwaXBlICovCisgICB3cHRfYm9vbGVhbiAgICAgICAgICAgICAgICAgICAgIGJkUHJlc2VudDsKKworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICAgICBjaGtfc2l6ZTsKKworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICAgICBibXVUaGRTZWw7CisKKyAgIC8qICBBZGRlZCBpbiBHZW41IGZvciBQcmVmZXRjaCAqLworICAgd3B0X2Jvb2xlYW4gICAgICAgICAgICAgICAgICAgICB1c2VMb3dlcjRHOworCisgICB3cHRfYm9vbGVhbiAgICAgICAgICAgICAgICAgICAgIHVzZVNob3J0RGVzY0ZtdDsKKyAgIC8qIFRpbGwgaGVyZSBpbmhhcml0ZWQgZnJvbSBHRU41IGNvZGUgKi8KKyAgIC8qIEZyb20gbm93IG9uLCBhZGRlZCBmb3IgUFJJTUEgICovCit9IFdMQU5EWEVfQ2hhbm5lbENvbmZpZ1R5cGU7CisKK3R5cGVkZWYgc3RydWN0Cit7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgICAgIGNoRFhFQmFzZUFkZHI7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgICAgIGNoRFhFU3RhdHVzUmVnQWRkcjsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgY2hEWEVEZXNjbFJlZ0FkZHI7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgICAgIGNoRFhFRGVzY2hSZWdBZGRyOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICAgICBjaERYRUxzdERlc2NsUmVnQWRkcjsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgY2hEWEVDdHJsUmVnQWRkcjsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgY2hEWEVTelJlZ0FkZHI7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgICAgIGNoRFhFRGFkcmxSZWdBZGRyOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICAgICBjaERYRURhZHJoUmVnQWRkcjsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgY2hEWEVTYWRybFJlZ0FkZHI7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgICAgIGNoRFhFU2FkcmhSZWdBZGRyOworfSBXTEFORFhFX0NoYW5uZWxSZWdpc3RlclR5cGU7CisKK3R5cGVkZWYgc3RydWN0Cit7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgICAgIHJlZldRX3N3YXBwZWQ7CisgICB3cHRfYm9vbGVhbiAgICAgICAgICAgICAgICAgICAgIGNoRW5hYmxlZDsKKyAgIHdwdF9ib29sZWFuICAgICAgICAgICAgICAgICAgICAgY2hDb25maWd1cmVkOyAgICAKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbDsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgY2hrX3NpemVfbWFzazsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgYm11VGhkU2VsX21hc2s7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgICAgIGN3X2N0cmxfcmVhZDsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgY3dfY3RybF93cml0ZTsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgY3dfY3RybF93cml0ZV92YWxpZDsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgY3dfY3RybF93cml0ZV9lb3A7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgICAgIGN3X2N0cmxfd3JpdGVfZW9wX2ludDsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgY2hhbl9tYXNrOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICAgICBjaGFuX21hc2tfcmVhZF9kaXNhYmxlOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICAgICBpbnRNYXNrOworfSBXTEFORFhFX0NoYW5uZWxFeENvbmZpZ1R5cGU7CisKK3R5cGVkZWYgc3RydWN0Cit7CisgICBXRFRTX0NoYW5uZWxUeXBlICAgICAgICAgICAgICAgIGNoYW5uZWxUeXBlOworICAgV0xBTkRYRV9EZXNjQ3RybEJsa1R5cGUgICAgICAgICpoZWFkQ3RybEJsazsKKyAgIFdMQU5EWEVfRGVzY0N0cmxCbGtUeXBlICAgICAgICAqdGFpbEN0cmxCbGs7CisgICBXTEFORFhFX0Rlc2NUeXBlICAgICAgICAgICAgICAgKmRlc2NyaXB0b3JBbGxvY2F0aW9uOworICAgV0xBTkRYRV9EZXNjVHlwZSAgICAgICAgICAgICAgICpEZXNjQm90dG9tTG9jOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICAgICBkZXNjQm90dG9tTG9jUGh5QWRkcjsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgbnVtRGVzYzsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgbnVtRnJlZURlc2M7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgICAgIG51bVJzdmREZXNjOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICAgICBkZXNjX3dyaXRlX2ZhaWxfY291bnQ7CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgICAgIG1heEZyYW1lU2l6ZTsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgbnVtRnJhZ21lbnRDdXJyZW50Q2hhaW47CisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgICAgIG51bUZyYW1lQmVmb3JlSW50OworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICAgICBudW1Ub3RhbEZyYW1lOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICAgICBkb25lSW50RGlzYWJsZWQ7CisgICB3cHRfbXV0ZXggICAgICAgICAgICAgICAgICAgICAgIGR4ZUNoYW5uZWxMb2NrOworICAgd3B0X2Jvb2xlYW4gICAgICAgICAgICAgICAgICAgICBoaXRMb3dSZXNvdXJjZTsKKyAgIFdMQU5EWEVfQ2hhbm5lbENvbmZpZ1R5cGUgICAgICAgY2hhbm5lbENvbmZpZzsKKyAgIFdMQU5EWEVfQ2hhbm5lbFJlZ2lzdGVyVHlwZSAgICAgY2hhbm5lbFJlZ2lzdGVyOworICAgV0xBTkRYRV9DaGFubmVsRXhDb25maWdUeXBlICAgICBleHRyYUNvbmZpZzsKKyAgIFdMQU5EWEVfRE1BQ2hhbm5lbFR5cGUgICAgICAgICAgYXNzaWduZWRETUFDaGFubmVsOworICAgd3B0X3VpbnQ2NCAgICAgICAgICAgICAgICAgICAgICByeERvbmVIaXN0b2dyYW07Cit9IFdMQU5EWEVfQ2hhbm5lbENCVHlwZTsKKwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgIFdMQU5EWEVfVFhDb21wSW50RW5hYmxlVHlwZSAgICAgdHhJbnRFbmFibGU7CisgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgICAgIHR4TG93UmVzb3VyY2VUaHJlc2hvbGRfTG9QcmlDaDsKKyAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgICAgICAgdHhMb3dSZXNvdXJjZVRocmVzaG9sZF9IaVByaUNoOworICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICByeExvd1Jlc291cmNlVGhyZXNob2xkOworICAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgICAgICB0eEludGVycnVwdEVuYWJsZUZyYW1lQ291bnQ7CisgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgICAgIHR4SW50ZXJydXB0RW5hYmxlUGVyaW9kOworfSBXTEFORFhFX1R4Q29tcEludENvbmZpZ1R5cGU7CisKK3R5cGVkZWYgc3RydWN0Cit7CisgICBXTEFORFhFX0NoYW5uZWxDQlR5cGUgICAgICAgICAgIGR4ZUNoYW5uZWxbV0RUU19DSEFOTkVMX01BWF07CisgICBXTEFORFhFX1J4RnJhbWVSZWFkeUNiVHlwZSAgICAgIHJ4UmVhZHlDQjsKKyAgIFdMQU5EWEVfVHhDb21wbGV0ZUNiVHlwZSAgICAgICAgdHhDb21wQ0I7CisgICBXTEFORFhFX0xvd1Jlc291cmNlQ2JUeXBlICAgICAgIGxvd1Jlc291cmNlQ0I7CisgICBXTEFORFhFX01iUmVjZWl2ZU1zZ0NiVHlwZSAgICAgIHJlY2VpdmVNYk1zZ0NCOworICAgV0xBTkRYRV9SeExvZ0RvbmVUeXBlICAgICAgICAgICByZWNlaXZlTG9nQ29tcGxldGVDQjsKKyAgIFdMQU5EWEVfVHhDb21wSW50Q29uZmlnVHlwZSAgICAgdHhDb21wSW50OworICAgdm9pZCAgICAgICAgICAgICAgICAgICAgICAgICAgICpjbGllbnRDdHh0OworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICAgICBpbnRlcnJ1cHRQYXRoOworICAgd3B0X21zZyAgICAgICAgICAgICAgICAgICAgICAgICpyeElzck1zZzsKKyAgIHdwdF9tc2cgICAgICAgICAgICAgICAgICAgICAgICAqdHhJc3JNc2c7CisgICB3cHRfbXNnICAgICAgICAgICAgICAgICAgICAgICAgKnJ4UGt0QXZhaWxNc2c7CisgICB2b2xhdGlsZSBXTEFORFhFX1Bvd2VyU3RhdGVUeXBlIGhvc3RQb3dlclN0YXRlOworICAgd3B0X2Jvb2xlYW4gICAgICAgICAgICAgICAgICAgICByeEludERpc2FibGVkQnlJTVBTOworICAgd3B0X2Jvb2xlYW4gICAgICAgICAgICAgICAgICAgICB0eEludERpc2FibGVkQnlJTVBTOworICAgV0xBTkRYRV9TZXRQb3dlclN0YXRlQ2JUeXBlICAgICBzZXRQb3dlclN0YXRlQ2I7CisgICB2b2xhdGlsZSBXTEFORFhFX1JpdmFQb3dlclN0YXRlVHlwZSByaXZhUG93ZXJTdGF0ZTsKKyAgIHdwdF9ib29sZWFuICAgICAgICAgICAgICAgICAgICAgcmluZ05vdEVtcHR5OworICAgd3B0X2Jvb2xlYW4gICAgICAgICAgICAgICAgICAgICB0eEludEVuYWJsZTsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgdHhDb21wbGV0ZWRGcmFtZXM7CisgICB3cHRfdWludDggICAgICAgICAgICAgICAgICAgICAgIHVjVHhNc2dDbnQ7CisgICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICAgICAgIGxhc3RLaWNrT2ZmRHhlOworICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICAgICBzbXNtUmluZ3NFbXB0eUhpc3RvZ3JhbTsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgc21zbUR4ZUhpc3RvZ3JhbTsKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgZHhlQ29va2llOworICAgd3B0X3BhY2tldCAgICAgICAgICAgICAgICAgICAgICpmcmVlUlhQYWNrZXQ7CisgICB3cHRfYm9vbGVhbiAgICAgICAgICAgICAgICAgICAgIHJ4UGFsUGFja2V0VW5hdmFpbGFibGU7CisgICB3cHRfYm9vbGVhbiAgICAgICAgICAgICAgICAgICAgIGRyaXZlclJlbG9hZEluUHJvY2Vzc2luZzsKKyAgIHdwdF9ib29sZWFuICAgICAgICAgICAgICAgICAgICAgc21zbVRvZ2dsZWQ7CisgICB3cHRfYm9vbGVhbiAgICAgICAgICAgICAgICAgICAgIHR4UmluZ3NFbXB0eTsKKyAgIHdwdF9ib29sZWFuICAgICAgICAgICAgICAgICAgICAgaG9zdEluaXRpYXRlZEgySDsKKyNpZmRlZiBXTEFOX0RYRV9MT1dfUkVTT1VSQ0VfVElNRVIKKyAgIHdwdF90aW1lciAgICAgICAgICAgICAgICAgICAgICAgcnhSZXNvdXJjZUF2YWlsYWJsZVRpbWVyOworI2VuZGlmCisgICB3cHRfdGltZXIgICAgICAgICAgICAgICAgICAgICAgIGR4ZVNTUlRpbWVyOworfSBXTEFORFhFX0N0cmxCbGtUeXBlOworCit0eXBlZGVmIHN0cnVjdAoreworICAgdTY0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqcnhJbnREaXNhYmxlUmV0dXJuOworICAgd3B0X3VpbnQ4ICAgICAgICAgICAgICAgICAgICAgICByeEludENoYW5sU3JjOworICAgd3B0X3VpbnQ4ICAgICAgICAgICAgICAgICAgICAgICB0eENtcEludENoYW5sU3JjOworfSBXTEFORFhFX0VudkluZm9ybWF0aW9uOworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAICBGdW5jdGlvbiBOYW1lIAorICAgICAgZHhlQ29tbW9uRGVmYXVsdENvbmZpZworCisgIEAgIERlc2NyaXB0aW9uIAorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIFdMQU5EWEVfQ3RybEJsa1R5cGUgICAgICpkeGVDdHJsQmxrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERYRSBob3N0IGRyaXZlciBtYWluIGNvbnRyb2wgYmxvY2sKKworICBAICBSZXR1cm4KKyAgICAgIHZvaWQKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK2V4dGVybiB2b2lkIGR4ZUNvbW1vbkRlZmF1bHRDb25maWcKKygKKyAgIFdMQU5EWEVfQ3RybEJsa1R5cGUgICAgICpkeGVDdHJsQmxrCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEAgIEZ1bmN0aW9uIE5hbWUgCisgICAgICBkeGVDaGFubmVsRGVmYXVsdENvbmZpZworCisgIEAgIERlc2NyaXB0aW9uIAorICAgICAgR2V0IGRlZnVhbHQgY29uZmlndXJhdGlvbiB2YWx1ZXMgZnJvbSBwcmUgZGVmaW5lZCBzdHJ1Y3R1cmUKKyAgICAgIEFsbCB0aGUgY2hhbm5lbHMgbXVzdCBoYXZlIGl0J3Mgb3duIGNvbmZpZ3VyYXRpb25zCisKKyAgQCAgUGFyYW1ldGVycworICAgICAgV0xBTkRYRV9DdHJsQmxrVHlwZSAgICAgKmR4ZUN0cmxCbGssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRFhFIGhvc3QgZHJpdmVyIG1haW4gY29udHJvbCBibG9jaworICAgICAgV0xBTkRYRV9DaGFubmVsQ0JUeXBlICAgKmNoYW5uZWxFbnRyeQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENoYW5uZWwgc3BlY2lmaWMgY29udHJvbCBibG9jaworCisgIEAgIFJldHVybgorICAgICAgd3B0X3N0YXR1cworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworZXh0ZXJuIHdwdF9zdGF0dXMgZHhlQ2hhbm5lbERlZmF1bHRDb25maWcKKygKKyAgIFdMQU5EWEVfQ3RybEJsa1R5cGUgICAgICpkeGVDdHJsQmxrLAorICAgV0xBTkRYRV9DaGFubmVsQ0JUeXBlICAgKmNoYW5uZWxFbnRyeQorKTsKKwordm9pZCBkeGVTZXRFbmFibGVkQ2hhbm5lbHMKKygKKyAgIHdwdF91aW50OCBlbmFibGVkQ2hhbm5lbHMKKyk7CisKK3dwdF91aW50OCBkeGVHZXRFbmFibGVkQ2hh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JJTElUWSBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFCisgKiBBVVRIT1IgQkUgTElBQkxFIEZPUiBBTlkgU1BFQ0lBTCwgRElSRUNULCBJTkRJUkVDVCwgT1IgQ09OU0VRVUVOVElBTAorICogREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NIExPU1MgT0YgVVNFLCBEQVRBIE9SCisgKiBQUk9GSVRTLCBXSEVUSEVSIElOIEFOIEFDVElPTiBPRiBDT05UUkFDVCwgTkVHTElHRU5DRSBPUiBPVEhFUgorICogVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmICFkZWZpbmVkKCBCQVBfSEREX01BSU5fSCApCisjZGVmaW5lIEJBUF9IRERfTUFJTl9ICisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAKKyAgXGZpbGUgIEJBUF9IRERfTUFJTl9ILmgKKyAgCisgIFxicmllZiBMaW51eCBIREQgQWRhcHRlciBUeXBlCisgIAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisgIAorLyotLS0tLS0tLS0tLS0tLS0tLS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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBcZmlsZSAgaGRkX0NvbmZpZy5oCisKKyAgXGJyaWVmIEFuZHJvaWQgV0xBTiBBZGFwdGVyIENvbmZpZ3VyYXRpb24gZnVuY3Rpb25zCisKKworICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qICRIRUFERVIkICovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tIAorICBJbmNsdWRlIGZpbGVzCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLyAKKyNpbmNsdWRlIDx3bGFuX2hkZF9pbmNsdWRlcy5oPgorI2luY2x1ZGUgPHdsYW5faGRkX3dtbS5oPgorI2luY2x1ZGUgPHZvc190eXBlcy5oPgorI2luY2x1ZGUgPGNzckFwaS5oPgorCisvL051bWJlciBvZiBpdGVtcyB0aGF0IGNhbiBiZSBjb25maWd1cmVkCisjZGVmaW5lIE1BWF9DRkdfSU5JX0lURU1TICAgNTEyCisKKy8vIERlZmluZXMgZm9yIGFsbCBvZiB0aGUgdGhpbmdzIHdlIHJlYWQgZnJvbSB0aGUgY29uZmlndXJhdGlvbiAocmVnaXN0cnkpLgorCisjZGVmaW5lIENGR19SVFNfVEhSRVNIT0xEX05BTUUgICAgICAgICAgICAgICAgICJSVFNUaHJlc2hvbGQiCisjZGVmaW5lIENGR19SVFNfVEhSRVNIT0xEX01JTiAgICAgICAgICAgICAgICAgIFdOSV9DRkdfUlRTX1RIUkVTSE9MRF9TVEFNSU4gLy8gbWluIGlzIDAsIG1lYW5pbmc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maW5lIENGR19HRU5FUklDX0lEMV9NSU4gICAgICAgICAgICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19HRU5FUklDX0lEMV9NQVggICAgICAgICAgICAgICAgICAgICggMHhmZmZmZmZmZiApCisjZGVmaW5lIENGR19HRU5FUklDX0lEMV9ERUZBVUxUICAgICAgICAgICAgICAgICggMCApCisKKyNkZWZpbmUgQ0ZHX0dFTkVSSUNfSUQyX05BTUUgICAgICAgICAgICAgICAgICAgImdDZmcySWQiCisjZGVmaW5lIENGR19HRU5FUklDX0lEMl9NSU4gICAgICAgICAgICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19HRU5FUklDX0lEMl9NQVggICAgICAgICAgICAgICAgICAgICggMHhmZmZmZmZmZiApCisjZGVmaW5lIENGR19HRU5FUklDX0lEMl9ERUZBVUxUICAgICAgICAgICAgICAgICggMCApCisKKyNkZWZpbmUgQ0ZHX0dFTkVSSUNfSUQzX05BTUUgICAgICAgICAgICAgICAgICAgImdDZmczSWQiCisjZGVmaW5lIENGR19HRU5FUklDX0lEM19NSU4gICAgICAgICAgICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19HRU5FUklDX0lEM19NQVggICAgICAgICAgICAgICAgICAgICggMHhmZmZmZmZmZiApCisjZGVmaW5lIENGR19HRU5FUklDX0lEM19ERUZBVUxUICAgICAgICAgICAgICAgICggMCApCisKKyNkZWZpbmUgQ0ZHX0dFTkVSSUNfSUQ0X05BTUUgICAgICAgICAgICAgICAgICAgImdDZmc0SWQiCisjZGVmaW5lIENGR19HRU5FUklDX0lENF9NSU4gICAgICAgICAgICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19HRU5FUklDX0lENF9NQVggICAgICAgICAgICAgICAgICAgICggMHhmZmZmZmZmZiApCisjZGVmaW5lIENGR19HRU5FUklDX0lENF9ERUZBVUxUICAgICAgICAgICAgICAgICggMCApCisKKyNkZWZpbmUgQ0ZHX0dFTkVSSUNfSUQ1X05BTUUgICAgICAgICAgICAgICAgICAgImdDZmc1SWQiCisjZGVmaW5lIENGR19HRU5FUklDX0lENV9NSU4gICAgICAgICAgICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19HRU5FUklDX0lENV9NQVggICAgICAgICAgICAgICAgICAgICggMHhmZmZmZmZmZiApCisjZGVmaW5lIENGR19HRU5FUklDX0lENV9ERUZBVUxUICAgICAgICAgICAgICAgICggMCApCisKKyNkZWZpbmUgQ0ZHX0dFTkVSSUNfVkFMVUUxX05BTUUgICAgICAgICAgICAgICAgImdDZmcxVmFsdWUiCisjZGVmaW5lIENGR19HRU5FUklDX1ZBTFVFMV9NSU4gICAgICAgICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19HRU5FUklDX1ZBTFVFMV9NQVggICAgICAgICAgICAgICAgICggMHhmZmZmZmZmZiApCisjZGVmaW5lIENGR19HRU5FUklDX1ZBTFVFMV9ERUZBVUxUICAgICAgICAgICAgICggMCApCisKKyNkZWZpbmUgQ0ZHX0dFTkVSSUNfVkFMVUUyX05BTUUgICAgICAgICAgICAgICAgImdDZmcyVmFsdWUiCisjZGVmaW5lIENGR19HRU5FUklDX1ZBTFVFMl9NSU4gICAgICAgICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19HRU5FUklDX1ZBTFVFMl9NQVggICAgICAgICAgICAgICAgICggMHhmZmZmZmZmZiApCisjZGVmaW5lIENGR19HRU5FUklDX1ZBTFVFMl9ERUZBVUxUICAgICAgICAgICAgICggMCApCisKKyNkZWZpbmUgQ0ZHX0dFTkVSSUNfVkFMVUUzX05BTUUgICAgICAgICAgICAgICAgImdDZmczVmFsdWUiCisjZGVmaW5lIENGR19HRU5FUklDX1ZBTFVFM19NSU4gICAgICAgICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19HRU5FUklDX1ZBTFVFM19NQVggICAgICAgICAgICAgICAgICggMHhmZmZmZmZmZiApCisjZGVmaW5lIENGR19HRU5FUklDX1ZBTFVFM19ERUZBVUxUICAgICAgICAgICAgICggMCApCisKKyNkZWZpbmUgQ0ZHX0dFTkVSSUNfVkFMVUU0X05BTUUgICAgICAgICAgICAgICAgImdDZmc0VmFsdWUiCisjZGVmaW5lIENGR19HRU5FUklDX1ZBTFVFNF9NSU4gICAgICAgICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19HRU5FUklDX1ZBTFVFNF9NQVggICAgICAgICAgICAgICAgICggMHhmZmZmZmZmZiApCisjZGVmaW5lIENGR19HRU5FUklDX1ZBTFVFNF9ERUZBVUxUICAgICAgICAgICAgICggMCApCisKKyNkZWZpbmUgQ0ZHX0dFTkVSSUNfVkFMVUU1X05BTUUgICAgICAgICAgICAgICAgImdDZmc1VmFsdWUiCisjZGVmaW5lIENGR19HRU5FUklDX1ZBTFVFNV9NSU4gICAgICAgICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19HRU5FUklDX1ZBTFVFNV9NQVggICAgICAgICAgICAgICAgICggMHhmZmZmZmZmZiApCisjZGVmaW5lIENGR19HRU5FUklDX1ZBTFVFNV9ERUZBVUxUICAgICAgICAgICAgICggMCApCisKKyNkZWZpbmUgQ0ZHX0hFQVJUQkVBVF9USFJFU0hfMjRfTkFNRSAgICAgICAgICAgImdIZWFydGJlYXQyNCIKKyNkZWZpbmUgQ0ZHX0hFQVJUQkVBVF9USFJFU0hfMjRfTUlOICAgICAgICAgICAgV05JX0NGR19IRUFSVF9CRUFUX1RIUkVTSE9MRF9TVEFNSU4KKyNkZWZpbmUgQ0ZHX0hFQVJUQkVBVF9USFJFU0hfMjRfTUFYICAgICAgICAgICAgV05JX0NGR19IRUFSVF9CRUFUX1RIUkVTSE9MRF9TVEFNQVgKKyNkZWZpbmUgQ0ZHX0hFQVJUQkVBVF9USFJFU0hfMjRfREVGQVVMVCAgICAgICAgV05JX0NGR19IRUFSVF9CRUFUX1RIUkVTSE9MRF9TVEFERUYKKworI2RlZmluZSBDRkdfUE9XRVJfVVNBR0VfTkFNRSAgICAgICAgICAgICAgICAgICAiZ1Bvd2VyVXNhZ2UiCisjZGVm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9QX0RFRkFVTFQgICggMCApCisKKyNkZWZpbmUgQ0ZHX1dPV0xfUEFUVEVSTl9OQU1FICAgICAgICAgICAgICAgICAgImdXb3dsUGF0dGVybiIKKyNkZWZpbmUgQ0ZHX1dPV0xfUEFUVEVSTl9ERUZBVUxUICAgICAgICAgICAgICAgIiIKKworLy9JTVBTID0gSWRsZU1vZGVQb3dlclNhdmUKKyNkZWZpbmUgQ0ZHX0VOQUJMRV9JTVBTX05BTUUgICAgICAgICAgICAgICAgICAgImdFbmFibGVJbXBzIgorI2RlZmluZSBDRkdfRU5BQkxFX0lNUFNfTUlOICAgICAgICAgICAgICAgICAgICAoIDAgKQorI2RlZmluZSBDRkdfRU5BQkxFX0lNUFNfTUFYICAgICAgICAgICAgICAgICAgICAoIDEgKQorI2RlZmluZSBDRkdfRU5BQkxFX0lNUFNfREVGQVVMVCAgICAgICAgICAgICAgICAoIDEgKQorCisvL1NTUiA9IFN1YlN5dGVtUmVzdGFydAorI2RlZmluZSBDRkdfU1NSX1BBTklDX09OX0ZBSUxVUkVfTkFNRSAgICAgICAgICAiZ1NzclBhbmljT25GYWlsdXJlIgorI2RlZmluZSBDRkdfU1NSX1BBTklDX09OX0ZBSUxVUkVfTUlOICAgICAgICAgICAoIDAgKQorI2RlZmluZSBDRkdfU1NSX1BBTklDX09OX0ZBSUxVUkVfTUFYICAgICAgICAgICAoIDEgKQorI2RlZmluZSBDRkdfU1NSX1BBTklDX09OX0ZBSUxVUkVfREVGQVVMVCAgICAgICAoIDAgKQorCisjZGVmaW5lIENGR19JTVBTX01JTklNVU1fU0xFRVBfVElNRV9OQU1FICAgICAgICJnSW1wc01pblNsZWVwVGltZSIgCisjZGVmaW5lIENGR19JTVBTX01JTklNVU1fU0xFRVBfVElNRV9NSU4gICAgICAgICggMCApCisjZGVmaW5lIENGR19JTVBTX01JTklNVU1fU0xFRVBfVElNRV9NQVggICAgICAgICggNjU1MzUgKQorI2RlZmluZSBDRkdfSU1QU19NSU5JTVVNX1NMR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mluZSBDRkdfREVGRVJfU0NBTl9USU1FX0lOVEVSVkFMX01BWCAgICAgICAgKCA2NTUzNSApCisjZGVmaW5lIENGR19ERUZFUl9TQ0FOX1RJTUVfSU5URVJWQUxfREVGQVVMVCAgICAoIDIwMDAgICkKKworLy9CTVBTID0gQmVhY29uTW9kZVBvd2VyU2F2ZQorI2RlZmluZSBDRkdfRU5BQkxFX0JNUFNfTkFNRSAgICAgICAgICAgICAgICAgICAiZ0VuYWJsZUJtcHMiCisjZGVmaW5lIENGR19FTkFCTEVfQk1QU19NSU4gICAgICAgICAgICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19FTkFCTEVfQk1QU19NQVggICAgICAgICAgICAgICAgICAgICggMSApCisjZGVmaW5lIENGR19FTkFCTEVfQk1QU19ERUZBVUxUICAgICAgICAgICAgICAgICggMSApCisKKyNkZWZpbmUgQ0ZHX0JNUFNfTUlOSU1VTV9MSV9OQU1FICAgICAgICAgICAgICAgImdCbXBzTWluTGlzdGVuSW50ZXJ2YWwiCisjZGVmaW5lIENGR19CTVBTX01JTklNVU1fTElfTUlOICAgICAgICAgICAgICAgICggMSApCisjZGVmaW5lIENGR19CTVBTX01JTklNVU1fTElfTUFYICAgICAgICAgICAgICAgICggNjU1MzUgKQorI2RlZmluZSBDRkdfQk1QU19NSU5JTVVNX0xJX0RFRkFVTFQgICAgICAgICAgICAoIDEgKQorICAgIAorI2RlZmluZSBDRkdfQk1QU19NT0RFUkFURV9MSV9OQU1FICAgICAgICAgICAgICAiZ0JtcHNNb2RMaXN0ZW5JbnRlcnZhbCIKKyNkZWZpbmUgQ0ZHX0JNUFNfTU9ERVJBVEVfTElfTUlOICAgICAgICAgICAgICAgKCAxICkKKyNkZWZpbmUgQ0ZHX0JNUFNfTU9ERVJBVEVfTElfTUFYICAgICAgICAgICAgICAgKCA2NTUzNSApCisjZGVmaW5lIENGR19CTVBTX01PREVSQVRFX0xJX0RFRkFVTFQgICAgICAgICAgICggMSApCisKKyNkZWZpbmUgQ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9ET1QxMV9NT0RFXzExbiwKKyAgICBlSEREX0RPVDExX01PREVfMTFnX09OTFksCisgICAgZUhERF9ET1QxMV9NT0RFXzExbl9PTkxZLAorICAgIGVIRERfRE9UMTFfTU9ERV8xMWJfT05MWSwKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgIGVIRERfRE9UMTFfTU9ERV8xMWFjX09OTFksCisgICAgZUhERF9ET1QxMV9NT0RFXzExYWMsCisjZW5kaWYKK31lSGRkRG90MTFNb2RlOworCisjZGVmaW5lIENGR19ET1QxMV9NT0RFX05BTUUgICAgICAgICAgICAgICAgICAgICJnRG90MTFNb2RlIgorI2RlZmluZSBDRkdfRE9UMTFfTU9ERV9NSU4gICAgICAgICAgICAgICAgICAgICBlSEREX0RPVDExX01PREVfQVVUTworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisjZGVmaW5lIENGR19ET1QxMV9NT0RFX01BWCAgICAgICAgICAgICAgICAgICAgIGVIRERfRE9UMTFfTU9ERV8xMWFjCisjZGVmaW5lIENGR19ET1QxMV9NT0RFX0RFRkFVTFQgICAgICAgICAgICAgICAgIGVIRERfRE9UMTFfTU9ERV8xMWFjCisjZWxzZQorI2RlZmluZSBDRkdfRE9UMTFfTU9ERV9NQVggICAgICAgICAgICAgICAgICAgICBlSEREX0RPVDExX01PREVfMTFiX09OTFkKKyNkZWZpbmUgQ0ZHX0RPVDExX01PREVfREVGQVVMVCAgICAgICAgICAgICAgICAgZUhERF9ET1QxMV9NT0RFXzExbgorI2VuZGlmCisKKyNkZWZpbmUgQ0ZHX1NBUF9FTkFCTEVfMTFBQ19OQU1FICAgICAgICAgICAgICAgImdTYXBFbmFibGUxMUFDIgorI2RlZmluZSBDRkdfU0FQX0VOQUJMRV8xMUFDX01JTiAgICAgICAgICAgICAgICAoIDAgKQorI2RlZmluZSBDRkdfU0FQX0VOQUJMRV8xMUFDX01BWCAgICAgICAgICAgICAgICAoIDEgKQorI2RlZmluZSBDRkdfU0FQX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AgICAgICAgICAgIFdOSV9DRkdfSUJTU19BVVRPX0JTU0lEX1NUQU1JTgorI2RlZmluZSBDRkdfSUJTU19BVVRPX0JTU0lEX01BWCAgICAgICAgICAgICAgICBXTklfQ0ZHX0lCU1NfQVVUT19CU1NJRF9TVEFNQVgKKyNkZWZpbmUgQ0ZHX0lCU1NfQVVUT19CU1NJRF9ERUZBVUxUICAgICAgICAgICAgV05JX0NGR19JQlNTX0FVVE9fQlNTSURfU1RBREVGCisKKyNkZWZpbmUgQ0ZHX0lCU1NfQlNTSURfTkFNRSAgICAgICAgICAgICAgICAgICAgImdJYnNzQnNzaWQiCisjZGVmaW5lIENGR19JQlNTX0JTU0lEX01JTiAgICAgICAgICAgICAgICAgICAgICIwMDAwMDAwMDAwMDAiCisjZGVmaW5lIENGR19JQlNTX0JTU0lEX01BWCAgICAgICAgICAgICAgICAgICAgICJmZmZmZmZmZmZmZmYiCisjZGVmaW5lIENGR19JQlNTX0JTU0lEX0RFRkFVTFQgICAgICAgICAgICAgICAgICIwMDBBRjUwNDA1MDYiCisKKyNkZWZpbmUgQ0ZHX0lOVEYwX01BQ19BRERSX05BTUUgICAgICAgICAgICAgICAgICAiSW50ZjBNYWNBZGRyZXNzIgorI2RlZmluZSBDRkdfSU5URjBfTUFDX0FERFJfTUlOICAgICAgICAgICAgICAgICAgICIwMDAwMDAwMDAwMDAiCisjZGVmaW5lIENGR19JTlRGMF9NQUNfQUREUl9NQVggICAgICAgICAgICAgICAgICAgImZmZmZmZmZmZmZmZiIKKyNkZWZpbmUgQ0ZHX0lOVEYwX01BQ19BRERSX0RFRkFVTFQgICAgICAgICAgICAgICAiMDAwQUY1ODk4OTgwIgorCisjZGVmaW5lIENGR19JTlRGMV9NQUNfQUREUl9OQU1FICAgICAgICAgICAgICAgICAgIkludGYxTWFjQWRkcmVzcyIKKyNkZWZpbmUgQ0ZHX0lOVEYxX01BQ19BRERSX01JTiAgICAgICAgICAgICAgICAgICAiMDAwMDAwMDAwMDAwIgorI2RlZmluZSBDRkdfSU5URjFfTUFDX0FERFJfTUFYICAgICAgICAgICAgICAgICAgICJmZmZmZmZmZmZmZmYiCisjZGVmaW5lIENGR19JTlRGMV9NQUNfQUREUl9ERUZBVUxUICAgICAgICAgICAgICAgIjAwMEFGNTg5ODk4MSIKKworI2RlZmluZSBDRkdfSU5URjJfTUFDX0FERFJfTkFNRSAgICAgICAgICAgICAgICAgICJJbnRmMk1hY0FkZHJlc3MiCisjZGVmaW5lIENGR19JTlRGMl9NQUNfQUREUl9NSU4gICAgICAgICAgICAgICAgICAgIjAwMDAwMDAwMDAwMCIKKyNkZWZpbmUgQ0ZHX0lOVEYyX01BQ19BRERSX01BWCAgICAgICAgICAgICAgICAgICAiZmZmZmZmZmZmZmZmIgorI2RlZmluZSBDRkdfSU5URjJfTUFDX0FERFJfREVGQVVMVCAgICAgICAgICAgICAgICIwMDBBRjU4OTg5ODIiCisKKyNkZWZpbmUgQ0ZHX0lOVEYzX01BQ19BRERSX05BTUUgICAgICAgICAgICAgICAgICAiSW50ZjNNYWNBZGRyZXNzIgorI2RlZmluZSBDRkdfSU5URjNfTUFDX0FERFJfTUlOICAgICAgICAgICAgICAgICAgICIwMDAwMDAwMDAwMDAiCisjZGVmaW5lIENGR19JTlRGM19NQUNfQUREUl9NQVggICAgICAgICAgICAgICAgICAgImZmZmZmZmZmZmZmZiIKKyNkZWZpbmUgQ0ZHX0lOVEYzX01BQ19BRERSX0RFRkFVTFQgICAgICAgICAgICAgICAiMDAwQUY1ODk4OTgzIgorCisjZGVmaW5lIENGR19BUF9RT1NfVUFQU0RfTU9ERV9OQU1FICAgICAgICAgICAgICJnRW5hYmxlQXBVYXBzZCIgLy8gQUNzIHRvIHNldHVwIFUtQVBTRCBmb3IgYXQgYXNzb2MKKyNkZWZpbmUgQ0ZHX0FQX1FPU19VQVBTRF9NT0RFX01JTiAgICAgICAgICAgICAgKCAwICkKKyNkZWZpbmUgQ0ZHX0FQX1FPU19VQVBTRF9NT0RFX01BWC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1RJT05fTU9ERV9ERUZBVUxUCisvLyBMT1dFUiBieXRlIGZvciBhc3NvY2lhdGVkIHN0YXRpb25zCisvLyBVUFBFUiBieXRlIGZvciBvdmVybGFwcGluZyBzdGF0aW9ucworLy8gZWFjaCBieXRlIHdpbGwgaGF2ZSB0aGUgZm9sbG93aW5nIGluZm8KKy8vIGJpdDE1IGJpdDE0IGJpdDEzICAgICBiaXQxMiAgYml0MTEgYml0MTAgICAgYml0OSAgICAgYml0OAorLy8gT0JTUyAgUklGUyAgTFNJR19UWE9QIE5PTl9HRiBIVDIwICBGUk9NXzExRyBGUk9NXzExQiBGUk9NXzExQQorLy8gYml0NyAgYml0NiAgYml0NSAgICAgIGJpdDQgICBiaXQzICBiaXQyICAgICBiaXQxICAgICBiaXQwCisvLyBPQlNTICBSSUZTICBMU0lHX1RYT1AgTk9OX0dGIEhUXzIwIEZST01fMTFHIEZST01fMTFCIEZST01fMTFBCisjZGVmaW5lIENGR19BUF9QUk9URUNUSU9OX01PREVfTkFNRSAgICAgICAgICAgICJnQXBQcm90ZWN0aW9uIgorI2RlZmluZSBDRkdfQVBfUFJPVEVDVElPTl9NT0RFX01JTiAgICAgICAgICAgICAoIDB4MCApCisjZGVmaW5lIENGR19BUF9QUk9URUNUSU9OX01PREVfTUFYICAgICAgICAgICAgICggMHhGRkZGICkKKyNkZWZpbmUgQ0ZHX0FQX1BST1RFQ1RJT05fTU9ERV9ERUZBVUxUICAgICAgICAgKCAweEJGRkYgKQorCisjZGVmaW5lIENGR19BUF9PQlNTX1BST1RFQ1RJT05fTU9ERV9OQU1FICAgICAgICJnRW5hYmxlQXBPQlNTUHJvdCIgCisjZGVmaW5lIENGR19BUF9PQlNTX1BST1RFQ1RJT05fTU9ERV9NSU4gICAgICAgICggMCApCisjZGVmaW5lIENGR19BUF9PQlNTX1BST1RFQ1RJT05fTU9ERV9NQVggICAgICAgICggMSApIAorI2RlZmluZSBDRkdfQVBfT0JTU19QUk9URUNUSU9OX01PREVfREVGQVV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isjZGVmaW5lIENGR19HT19LRUVQX0FMSVZFX1BFUklPRF9OQU1FICAgICAgICAgICJnR29LZWVwQWxpdmVQZXJpb2QiCisjZGVmaW5lIENGR19HT19LRUVQX0FMSVZFX1BFUklPRF9NSU4gICAgICAgICAgICggMyApCisjZGVmaW5lIENGR19HT19LRUVQX0FMSVZFX1BFUklPRF9NQVggICAgICAgICAgICggMjU1ICkKKyNkZWZpbmUgQ0ZHX0dPX0tFRVBfQUxJVkVfUEVSSU9EX0RFRkFVTFQgICAgICAgKCA1ICkKKworI2RlZmluZSBDRkdfQVBfTElOS19NT05JVE9SX1BFUklPRF9OQU1FICAgICAgICAgICJnQXBMaW5rTW9uaXRvclBlcmlvZCIKKyNkZWZpbmUgQ0ZHX0FQX0xJTktfTU9OSVRPUl9QRVJJT0RfTUlOICAgICAgICAgICAoIDMgKQorI2RlZmluZSBDRkdfQVBfTElOS19NT05JVE9SX1BFUklPRF9NQVggICAgICAgICAgICggNTAgKQorI2RlZmluZSBDRkdfQVBfTElOS19NT05JVE9SX1BFUklPRF9ERUZBVUxUICAgICAgICggMTAgKQorCisvKiBnR29MaW5rTW9uaXRvclBlcmlvZCBpcyBwZXJpb2Qgd2hlcmUgbGluayBpcyBpZGxlIGFuZCB3aGVyZQorICogd2Ugc2VuZCBOVUxMIGZyYW1lCisgKi8KKyNkZWZpbmUgQ0ZHX0dPX0xJTktfTU9OSVRPUl9QRVJJT0RfTkFNRSAgICAgICAgICAiZ0dvTGlua01vbml0b3JQZXJpb2QiCisjZGVmaW5lIENGR19HT19MSU5LX01PTklUT1JfUEVSSU9EX01JTiAgICAgICAgICAgKCAzICkKKyNkZWZpbmUgQ0ZHX0dPX0xJTktfTU9OSVRPUl9QRVJJT0RfTUFYICAgICAgICAgICAoIDUwICkKKyNkZWZpbmUgQ0ZHX0dPX0xJTktfTU9OSVRPUl9QRVJJT0RfREVGQVVMVCAgICAgICAoIDEwICkKKworCisjZGVmaW5lIENGR19CRUFDT05fSU5URVJWQUxfTkFNRSAgICAgICAgICAgICAgICJnQmVhY29uSW50ZXJ2YWwiCisjZGVmaW5lIENGR19CRUFDT05fSU5URVJWQUxfTUlOICAgICAgICAgICAgICAgIFdOSV9DRkdfQkVBQ09OX0lOVEVSVkFMX1NUQU1JTgorI2RlZmluZSBDRkdfQkVBQ09OX0lOVEVSVkFMX01BWCAgICAgICAgICAgICAgICBXTklfQ0ZHX0JFQUNPTl9JTlRFUlZBTF9TVEFNQVgKKyNkZWZpbmUgQ0ZHX0JFQUNPTl9JTlRFUlZBTF9ERUZBVUxUICAgICAgICAgICAgV05JX0NGR19CRUFDT05fSU5URVJWQUxfU1RBREVGCisKKy8vQWRkaXRpb25hbCBIYW5kb2ZmIHJlbGF0ZWQgUGFyYW1ldGVycyAgCisjZGVmaW5lIENGR19FTkFCTEVfSURMRV9TQ0FOX05BTUUgICAgICAgICAgICAgImdFbmFibGVJZGxlU2NhbiIgICAgICAKKyNkZWZpbmUgQ0ZHX0VOQUJMRV9JRExFX1NDQU5fTUlOICAgICAgICAgICAgICAoIDAgKQorI2RlZmluZSBDRkdfRU5BQkxFX0lETEVfU0NBTl9NQVggICAgICAgICAgICAgICggMSApCisjZGVmaW5lIENGR19FTkFCTEVfSURMRV9TQ0FOX0RFRkFVTFQgICAgICAgICAgKCAxICkgCisKKyNkZWZpbmUgQ0ZHX1JPQU1JTkdfVElNRV9OQU1FICAgICAgICAgICAgICAgICAiZ1JvYW1pbmdUaW1lIgorI2RlZmluZSBDRkdfUk9BTUlOR19USU1FX01JTiAgICAgICAgICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19ST0FNSU5HX1RJTUVfTUFYICAgICAgICAgICAgICAgICAgKCA0Mjk0OTY3VUwgKQorI2RlZmluZSBDRkdfUk9BTUlOR19USU1FX0RFRkFVTFQgICAgICAgICAgICAgICggMTAgKQorCisjZGVmaW5lIENGR19WQ0NfUlNTSV9UUklHR0VSX05BTUUgICAgICAgICAgICAgImdWY2NSc3NpVHJpZ2dlciIKK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W5lIENGR19SWF9BTlRfQ09ORklHVVJBVElPTl9OQU1FICAgICAgICAgICJnTnVtUnhBbnQiCisjZGVmaW5lIENGR19SWF9BTlRfQ09ORklHVVJBVElPTl9OQU1FX01JTiAgICAgICggMSApCisjZGVmaW5lIENGR19SWF9BTlRfQ09ORklHVVJBVElPTl9OQU1FX01BWCAgICAgICggMiApCisjZGVmaW5lIENGR19SWF9BTlRfQ09ORklHVVJBVElPTl9OQU1FX0RFRkFVTFQgICggMiApCisKKyNkZWZpbmUgQ0ZHX0ZXX0hFQVJUX0JFQVRfTU9OSVRPUklOR19OQU1FICAgICAgImdFbmFibGVGV0hlYXJ0QmVhdE1vbml0b3JpbmciCisjZGVmaW5lIENGR19GV19IRUFSVF9CRUFUX01PTklUT1JJTkdfTUlOICAgICAgICggMCApCisjZGVmaW5lIENGR19GV19IRUFSVF9CRUFUX01PTklUT1JJTkdfTUFYICAgICAgICggMSApCisjZGVmaW5lIENGR19GV19IRUFSVF9CRUFUX01PTklUT1JJTkdfREVGQVVMVCAgICggMSApCisKKyNkZWZpbmUgQ0ZHX0ZXX0JFQUNPTl9GSUxURVJJTkdfTkFNRSAgICAgICAgICAgImdFbmFibGVGV0JlYWNvbkZpbHRlcmluZyIKKyNkZWZpbmUgQ0ZHX0ZXX0JFQUNPTl9GSUxURVJJTkdfTUlOICAgICAgICAgICAgKCAwICkKKyNkZWZpbmUgQ0ZHX0ZXX0JFQUNPTl9GSUxURVJJTkdfTUFYICAgICAgICAgICAgKCAxICkKKyNkZWZpbmUgQ0ZHX0ZXX0JFQUNPTl9GSUxURVJJTkdfREVGQVVMVCAgICAgICAgKCAxICkKKworI2RlZmluZSBDRkdfRldfUlNTSV9NT05JVE9SSU5HX05BTUUgICAgICAgICAgICAiZ0VuYWJsZUZXUnNzaU1vbml0b3JpbmciCisjZGVmaW5lIENGR19GV19SU1NJX01PTklUT1JJTkdfTUlOICAgICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19GV19SU1NJX01PTklUT1JJTkdfTUFYICAgICAgICAgICAgICggMSApCisjZGVmaW5lIENGR19GV19SU1NJX01PTklUT1JJTkdfREVGQVVMVCAgICAgICAgICggMSApCisKKyNkZWZpbmUgQ0ZHX0RBVEFfSU5BQ1RJVklUWV9USU1FT1VUX05BTUUgICAgICAgImdEYXRhSW5hY3Rpdml0eVRpbWVvdXQiCisjZGVmaW5lIENGR19EQVRBX0lOQUNUSVZJVFlfVElNRU9VVF9NSU4gICAgICAgICggMSApCisjZGVmaW5lIENGR19EQVRBX0lOQUNUSVZJVFlfVElNRU9VVF9NQVggICAgICAgICggMjU1ICkKKyNkZWZpbmUgQ0ZHX0RBVEFfSU5BQ1RJVklUWV9USU1FT1VUX0RFRkFVTFQgICAgKCAyMCApCisKKyNkZWZpbmUgQ0ZHX05USF9CRUFDT05fRklMVEVSX05BTUUgICAgICAgICAgICAgImdOdGhCZWFjb25GaWx0ZXIiCisjZGVmaW5lIENGR19OVEhfQkVBQ09OX0ZJTFRFUl9NSU4gICAgICAgICAgICAgICggV05JX0NGR19OVEhfQkVBQ09OX0ZJTFRFUl9TVEFNSU4gKQorI2RlZmluZSBDRkdfTlRIX0JFQUNPTl9GSUxURVJfTUFYICAgICAgICAgICAgICAoIFdOSV9DRkdfTlRIX0JFQUNPTl9GSUxURVJfU1RBTUFYICkKKyNkZWZpbmUgQ0ZHX05USF9CRUFDT05fRklMVEVSX0RFRkFVTFQgICAgICAgICAgKCBXTklfQ0ZHX05USF9CRUFDT05fRklMVEVSX1NUQURFRiApCisKKyNkZWZpbmUgQ0ZHX1JGX1NFVFRMSU5HX1RJTUVfQ0xLX05BTUUgICAgICAgICAgInJmU2V0dGxpbmdUaW1lVXMiCisjZGVmaW5lIENGR19SRl9TRVRUTElOR19USU1FX0NMS19NSU4gICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19SRl9TRVRUTElOR19USU1FX0NMS19NQVggICAgICAgICAgICggNjAwMDAgKQorI2RlZmluZSBDRkdfUkZfU0VUVExJTkdfVElNRV9DTEtfREVGQVVMVCAgICAgICAoIDE1MDAgKQorCisjZGVmaW5lIENGR19JTkZSQV9TVEFfS0VFUF9BTElWRV9QRVJJT0RfTkFNRSAgICAgICAgICAiZ1N0YUtlZXBBbGl2ZVBlcmlvZCIKKyNkZWZpbmUgQ0ZHX0lORlJBX1NUQV9LRUVQX0FMSVZFX1BFUklPRF9NSU4gICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19JTkZSQV9TVEFfS0VFUF9BTElWRV9QRVJJT0RfTUFYICAgICAgICAgICAoIDY1NTM1KQorI2RlZmluZSBDRkdfSU5GUkFfU1RBX0tFRVBfQUxJVkVfUEVSSU9EX0RFRkFVTFQgICAgICAgKCAwICkKKworLy9XTU0gY29uZmlndXJhdGlvbgorI2RlZmluZSBDRkdfUU9TX1dNTV9NT0RFX05BTUUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJXbW1Jc0VuYWJsZWQiCisjZGVmaW5lIENGR19RT1NfV01NX01PREVfTUlOICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgwKQorI2RlZmluZSBDRkdfUU9TX1dNTV9NT0RFX01BWCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMikgLy9IRERfV01NX05PX1FPUworI2RlZmluZSBDRkdfUU9TX1dNTV9NT0RFX0RFRkFVTFQgICAgICAgICAgICAgICAgICAgICAgICAgICAoMCkgLy9IRERfV01NX0FVVE8KKworI2RlZmluZSBDRkdfUU9TX1dNTV84MDIxMUVfRU5BQkxFRF9OQU1FICAgICAgICAgICAgICAgICAgICI4MDIxMWVJc0VuYWJsZWQiCisjZGVmaW5lIENGR19RT1NfV01NXzgwMjExRV9FTkFCTEVEX01JTiAgICAgICAgICAgICAgICAgICAgICgwKQorI2RlZmluZSBDRkdfUU9TX1dNTV84MDIxMUVfRU5BQkxFRF9NQVggICAgICAgICAgICAgICAgICAgICAoMSkgCisjZGVmaW5lIENGR19RT1NfV01NXzgwMjExRV9FTkFCTEVEX0RFRkFVTF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VOQUJMRURfTUFYICAgICAgICAgICAgICAgICAgICAgICAgICgxKQorI2RlZmluZSBDRkdfRVNFX0ZFQVRVUkVfRU5BQkxFRF9ERUZBVUxUICAgICAgICAgICAgICAgICAgICAgKDApIC8vZGlzYWJsZWQKKyNlbmRpZiAvLyBGRUFUVVJFX1dMQU5fRVNFCisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fTEZSCisjZGVmaW5lIENGR19MRlJfRkVBVFVSRV9FTkFCTEVEX05BTUUgICAgICAgICAgICAgICAgICAgICAgICJGYXN0Um9hbUVuYWJsZWQiCisjZGVmaW5lIENGR19MRlJfRkVBVFVSRV9FTkFCTEVEX01JTiAgICAgICAgICAgICAgICAgICAgICAgICAoMCkKKyNkZWZpbmUgQ0ZHX0xGUl9GRUFUVVJFX0VOQUJMRURfTUFYICAgICAgICAgICAgICAgICAgICAgICAgICgxKQorI2RlZmluZSBDRkdfTEZSX0ZFQVRVUkVfRU5BQkxFRF9ERUZBVUxUICAgICAgICAgICAgICAgICAgICAgKDApIC8vZGlzYWJsZWQKKworI2RlZmluZSBDRkdfTEZSX01BV0NfRkVBVFVSRV9FTkFCTEVEX05BTUUgICAgICAgICAgICAgICAgICAgIk1BV0NFbmFibGVkIgorI2RlZmluZSBDRkdfTEZSX01BV0NfRkVBVFVSRV9FTkFCTEVEX01JTiAgICAgICAgICAgICAgICAgICAgKDApCisjZGVmaW5lIENGR19MRlJfTUFXQ19GRUFUVVJFX0VOQUJMRURfTUFYICAgICAgICAgICAgICAgICAgICAoMSkKKyNkZWZpbmUgQ0ZHX0xGUl9NQVdDX0ZFQVRVUkVfRU5BQkxFRF9ERUZBVUxUICAgICAgICAgICAgICAgICgwKSAvKiBkaXNhYmxlZCAqLworI2VuZGlmIC8vIEZFQVRVUkVfV0xBTl9MRlIKKworI2lmICBkZWZpbmVkIChXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUikgfHwgZGVmaW5lZCAoRkVBVFVSRV9XTEFOX0VTRSkgfHwgZGV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YWx1ZSBvZiAwIG1lYW5zIHRoYXQgaW1tZWRpYXRlIHJvYW1pbmcgaXMgZW5hYmxlZCBieSBkZWZhdWx0CisgKi8KKyNkZWZpbmUgQ0ZHX0lNTUVESUFURV9ST0FNX1JTU0lfRElGRl9OQU1FICAgICAgICAgICAgICAgICAgICJnSW1tZWRpYXRlUm9hbVJzc2lEaWZmIgorI2RlZmluZSBDRkdfSU1NRURJQVRFX1JPQU1fUlNTSV9ESUZGX01JTiAgICAgICAgICAgICAgICAgICAgKDApCisjZGVmaW5lIENGR19JTU1FRElBVEVfUk9BTV9SU1NJX0RJRkZfTUFYICAgICAgICAgICAgICAgICAgICAoMTI1KQorI2RlZmluZSBDRkdfSU1NRURJQVRFX1JPQU1fUlNTSV9ESUZGX0RFRkFVTFQgICAgICAgICAgICAgICAgKDApCisKKy8qVGhpcyBwYXJhbWV0ZXIgaXMgdXNlZCB0byBzZXQgV2lyZWxlc3MgRXh0ZW5kZWQgU2VjdXJpdHkgTW9kZS4qLworI2RlZmluZSBDRkdfRU5BQkxFX1dFU19NT0RFX05BTUUgICAgICAgICAgICAgICAgICAgICAgICAgICAgImdXRVNNb2RlRW5hYmxlZCIKKyNkZWZpbmUgQ0ZHX0VOQUJMRV9XRVNfTU9ERV9OQU1FX01JTiAgICAgICAgICAgICAgICAgICAgICAgICgwKQorI2RlZmluZSBDRkdfRU5BQkxFX1dFU19NT0RFX05BTUVfTUFYICAgICAgICAgICAgICAgICAgICAgICAgKDEpCisjZGVmaW5lIENGR19FTkFCTEVfV0VTX01PREVfTkFNRV9ERUZBVUxUICAgICAgICAgICAgICAgICAgICAoMCkKKworI2RlZmluZSBDRkdfUk9BTV9TQ0FOX05fUFJPQkVTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZ1JvYW1TY2FuTlByb2JlcyIKKyNkZWZpbmUgQ0ZHX1JPQU1fU0NBTl9OX1BST0JFU19NSU4gICAgICAgICAgICAgICAgICAgICAgICAgICgxKQorI2RlZmluZSBDRkdfUk9BTV9TQ0FOX05fUFJPQkVTX01BWCAgICAgICAgICAgICAgICAgICAgICAgICAgKDEwKQorI2RlZmluZSBDRkdfUk9BTV9TQ0FOX05fUFJPQkVTX0RFRkFVTFQgICAgICAgICAgICAgICAgICAgICAgKDIpCisKKyNkZWZpbmUgQ0ZHX1JPQU1fU0NBTl9IT01FX0FXQVlfVElNRSAgICAgICAgICAgICAgICAgICAgICAgICJnUm9hbVNjYW5Ib21lQXdheVRpbWUiCisjZGVmaW5lIENGR19ST0FNX1NDQU5fSE9NRV9BV0FZX1RJTUVfTUlOICAgICAgICAgICAgICAgICAgICAoMykKKyNkZWZpbmUgQ0ZHX1JPQU1fU0NBTl9IT01FX0FXQVlfVElNRV9NQVggICAgICAgICAgICAgICAgICAgICgzMDApCisjZGVmaW5lIENGR19ST0FNX1NDQU5fSE9NRV9BV0FZX1RJTUVfREVGQVVMVCAgICAgICAgICAgICAgICAoQ0ZHX1JPQU1fU0NBTl9IT01FX0FXQVlfVElNRV9NSU4pCisjZW5kaWYgLyogKFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSKSB8fCBkZWZpbmVkIChGRUFUVVJFX1dMQU5fRVNFKSB8fCBkZWZpbmVkKEZFQVRVUkVfV0xBTl9MRlIpICovCisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fT0tDCisjZGVmaW5lIENGR19PS0NfRkVBVFVSRV9FTkFCTEVEX05BTUUgICAgICAgICAgICAgICAgICAgICAgICJPa2NFbmFibGVkIgorI2RlZmluZSBDRkdfT0tDX0ZFQVRVUkVfRU5BQkxFRF9NSU4gICAgICAgICAgICAgICAgICAgICAgICAoMCkKKyNkZWZpbmUgQ0ZHX09LQ19GRUFUVVJFX0VOQUJMRURfTUFYICAgICAgICAgICAgICAgICAgICAgICAgKDEpCisjZGVmaW5lIENGR19PS0NfRkVBVFVSRV9FTkFCTEVEX0RFRkFVTFQgICAgICAgICAgICAgICAgICAgICgxKQorI2VuZGlmCisKKyNpZmRlZiBXTEFO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AgICAgICAgICAgICAgKDB4MjAwMSkKKyNkZWZpbmUgQ0ZHX1FPU19XTU1fSU5GUkFfU0JBX0FDX0JFX01BWCAgICAgICAgICAgICAgICAgICAgICgweEZGRkYpCisjZGVmaW5lIENGR19RT1NfV01NX0lORlJBX1NCQV9BQ19CRV9ERUZBVUxUICAgICAgICAgICAgICAgICAoMHgyMDAxKQorCisvKiBkZWZhdWx0IFRTUEVDIHBhcmFtZXRlcnMgZm9yIEFDX0JrKi8KKyNkZWZpbmUgQ0ZHX1FPU19XTU1fSU5GUkFfRElSX0FDX0JLX05BTUUgICAgICAgICAgICAgICAgICAgIkluZnJhRGlyQWNCayIKKyNkZWZpbmUgQ0ZHX1FPU19XTU1fSU5GUkFfRElSX0FDX0JLX01JTiAgICAgICAgICAgICAgICAgICAgICgwKQorI2RlZmluZSBDRkdfUU9TX1dNTV9JTkZSQV9ESVJfQUNfQktfTUFYICAgICAgICAgICAgICAgICAgICAgKDMpCisjZGVmaW5lIENGR19RT1NfV01NX0lORlJBX0RJUl9BQ19CS19ERUZBVUxUICAgICAgICAgICAgICAgICAoMykgLy9XTEFOX1FDVF9DVVNUX1dNTV9UU0RJUl9CT1RICisKKyNkZWZpbmUgQ0ZHX1FPU19XTU1fSU5GUkFfTk9NX01TRFVfU0laRV9BQ19CS19OQU1FICAgICAgICAgIkluZnJhTm9tTXNkdVNpemVBY0JrIgorI2RlZmluZSBDRkdfUU9TX1dNTV9JTkZSQV9OT01fTVNEVV9TSVpFX0FDX0JLX01JTiAgICAgICAgICAgKDB4MCkKKyNkZWZpbmUgQ0ZHX1FPU19XTU1fSU5GUkFfTk9NX01TRFVfU0laRV9BQ19CS19NQVggICAgICAgICAgICgweEZGRkYpCisjZGVmaW5lIENGR19RT1NfV01NX0lORlJBX05PTV9NU0RVX1NJWkVfQUNfQktfREVGQVVMVCAgICAgICAoMHg4NURDKQorCisjZGVmaW5lIENGR19RT1NfV01NX0lORlJBX01FQU5fREFUQV9SQVRFX0FDX0JLX05BTUUgICAgICAgICJJbmZyYU1lYW5EYXRhUmF0ZUFjQmsiCisjZGVmaW5lIENGR19RT1NfV01NX0lORlJBX01FQU5fREFUQV9SQVRFX0FDX0JLX01JTiAgICAgICAgICAoMHgwKQorI2RlZmluZSBDRkdfUU9TX1dNTV9JTkZSQV9NRUFOX0RBVEFfUkFURV9BQ19CS19NQVggICAgICAgICAgKDB4RkZGRkZGRkYpCisjZGVmaW5lIENGR19RT1NfV01NX0lORlJBX01FQU5fREFUQV9SQVRFX0FDX0JLX0RFRkFVTFQgICAgICAoMHg0OTNFMCkKKworI2RlZmluZSBDRkdfUU9TX1dNTV9JTkZSQV9NSU5fUEhZX1JBVEVfQUNfQktfTkFNRSAgICAgICAgICAiSW5mcmFNaW5QaHlSYXRlQWNCayIKKyNkZWZpbmUgQ0ZHX1FPU19XTU1fSU5GUkFfTUlOX1BIWV9SQVRFX0FDX0JLX01JTiAgICAgICAgICAgICgweDApCisjZGVmaW5lIENGR19RT1NfV01NX0lORlJBX01JTl9QSFlfUkFURV9BQ19CS19NQVggICAgICAgICAgICAoMHhGRkZGRkZGRikKKyNkZWZpbmUgQ0ZHX1FPU19XTU1fSU5GUkFfTUlOX1BIWV9SQVRFX0FDX0JLX0RFRkFVTFQgICAgICAgICgweDVCOEQ4MCkKKworI2RlZmluZSBDRkdfUU9TX1dNTV9JTkZSQV9TQkFfQUNfQktfTkFNRSAgICAgICAgICAgICAgICAgICAiSW5mcmFTYmFBY0JrIgorI2RlZmluZSBDRkdfUU9TX1dNTV9JTkZSQV9TQkFfQUNfQktfTUlOICAgICAgICAgICAgICAgICAgICAgKDB4MjAwMSkKKyNkZWZpbmUgQ0ZHX1FPU19XTU1fSU5GUkFfU0JBX0FDX0JLX01BWCAgICAgICAgICAgICAgICAgICAgICgweEZGRkYpCisjZGVmaW5lIENGR19RT1NfV01NX0lORlJBX1NCQV9BQ19CS19ERUZBVUxUICAgICAgICAgICAgICAgICAoMHgyMDAxKQorCisvLyBUTCBjb25maWd1cmF0aW9uCisjZGVmaW5lIENGR19UTF9XRlFfQktfV0VJR0hUX05BTUUgICAgICAgICAgICAgICAgICAgICAgICAgICAiV2ZxQmtXZWlnaHQiCisjZGVmaW5lIENGR19UTF9XRlFfQktfV0VJR0hUX01JTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAxCisjZGVmaW5lIENGR19UTF9XRlFfQktfV0VJR0hUX01BWCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEZGCisjZGVmaW5lIENGR19UTF9XRlFfQktfV0VJR0hUX0RFRkFVTFQgICAgICAgICAgICAgICAgICAgICAgICAxCisKKyNkZWZpbmUgQ0ZHX1RMX1dGUV9CRV9XRUlHSFRfTkFNRSAgICAgICAgICAgICAgICAgICAgICAgICAgICJXZnFCZVdlaWdodCIKKyNkZWZpbmUgQ0ZHX1RMX1dGUV9CRV9XRUlHSFRfTUlOICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEKKyNkZWZpbmUgQ0ZHX1RMX1dGUV9CRV9XRUlHSFRfTUFYICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RkYKKyNkZWZpbmUgQ0ZHX1RMX1dGUV9CRV9XRUlHSFRfREVGQVVMVCAgICAgICAgICAgICAgICAgICAgICAgIDMKKworI2RlZmluZSBDRkdfVExfV0ZRX1ZJX1dFSUdIVF9OQU1FICAgICAgICAgICAgICAgICAgICAgICAgICAgIldmcVZpV2VpZ2h0IgorI2RlZmluZSBDRkdfVExfV0ZRX1ZJX1dFSUdIVF9NSU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMQorI2RlZmluZSBDRkdfVExfV0ZRX1ZJX1dFSUdIVF9NQVggICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhGRgorI2RlZmluZSBDRkdfVExfV0ZRX1ZJX1dFSUdIVF9ERUZBVUxUICAgICAgICAgICAgICAgICAgICAgICAgNQorCisjZGVmaW5lIENGR19UTF9XRlFfVk9fV0VJR0hUX05BTUUgICAgICAgICAgICAgICAgICAgICAgICAgICAiV2ZxVm9XZWlnaHQiCisjZGVmaW5lIENGR19UTF9XRlFfVk9fV0VJR0hUX01JTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAxCisjZGVmaW5lIENGR19UTF9XRlFfVk9fV0VJR0hUX01BWCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEZGCisjZGVmaW5lIENGR19UTF9XRlFfVk9fV0VJR0hUX0RFRkFVTFQgICAgICAgICAgICAgICAgICAgICAgICA3CisKKyNkZWZpbmUgQ0ZHX1RMX0RFTEFZRURfVFJHUl9GUk1fSU5UX05BTUUgICAgICAgICAgICAgICAgICAgIkRlbGF5ZWRUcmlnZ2VyRnJtSW50IgorI2RlZmluZSBDRkdfVExfREVMQVlFRF9UUkdSX0ZSTV9JTlRfTUlOICAgICAgICAgICAgICAgICAgICAgMQorI2RlZmluZSBDRkdfVExfREVMQVlFRF9UUkdSX0ZSTV9JTlRfTUFYICAgICAgICAgICAgICAgICAgICAgKDQyOTQ5NjcyOTVVTCkKKyNkZWZpbmUgQ0ZHX1RMX0RFTEFZRURfVFJHUl9GUk1fSU5UX0RFRkFVTFQgICAgICAgICAgICAgICAgIDMwMDAKKworI2RlZmluZSBDRkdfUkVPUkRFUl9USU1FX0JLX05BTUUgICAgICAgICAgICAgICAgICAgICAgICAgICAiQmtSZW9yZGVyVGltZSIKKyNkZWZpbmUgQ0ZHX1JFT1JERVJfVElNRV9CS19NSU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMzAKKyNkZWZpbmUgQ0ZHX1JFT1JERVJfVElNRV9CS19NQVggICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAwMAorI2RlZmluZSBDRkdfUkVPUkRFUl9USU1FX0JLX0RFRkFVTFQgICAgICAgICAgICAgICAgICAgICAgICAxMDAKKworI2RlZmluZSBDRkdfUkVPUkRFUl9USU1FX0JFX05BTUUgICAgICAgICAgICAgICAgICAgICAgICAgICAiQmVSZW9yZGVyVGltZSIKKyNkZWZpbmUgQ0ZHX1JFT1JERVJfVElNRV9CRV9NSU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMzAKKyNkZWZpbmUgQ0ZHX1JFT1JERVJfVElNRV9CRV9NQVggICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAwMAorI2RlZmluZSBDRkdfUkVPUkRFUl9USU1FX0JFX0RFRkFVTFQgICAgICAgICAgICAgICAgICAgICAgICAxMDAKKworI2RlZmluZSBDRkdfUkVPUkRFUl9USU1FX1ZJX05BTUUgICAgICAgICAgICAgICAgICAgICAgICAgICAiVmlSZW9yZGVyVGltZSIKKyNkZWZpbmUgQ0ZHX1JFT1JERVJfVElNRV9WSV9NSU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMzAKKyNkZWZpbmUgQ0ZHX1JFT1JERVJfVElNRV9WSV9NQVggICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAwMAorI2RlZmluZSBDRkdfUkVPUkRFUl9USU1FX1ZJX0RFRkFVTFQgICAgICAgICAgICAgICAgICAgICAgICAxMDAKKworI2RlZmluZSBDRkdfUkVPUkRFUl9USU1FX1ZPX05BTUUgICAgICAgICAgICAgICAgICAgICAgICAgICAiVm9SZW9yZGVyVGltZSIKKyNkZWZpbmUgQ0ZHX1JFT1JERVJfVElNRV9WT19NSU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMzAKKyNkZWZpbmUgQ0ZHX1JFT1JERVJfVElNRV9WT19NQVggICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAwMAorI2RlZmluZSBDRkdfUkVPUkRFUl9USU1FX1ZPX0RFRkFVTFQgICAgICAgICAgICAgICAgICAgICAgICA0MAorCisjaWYgZGVmaW5lZCBXTEFOX0ZFQVRVUkVfVk9XSUZJCisjZGVmaW5lIENGR19SUk1fRU5BQkxFX05BTUUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZ1JybUVuYWJsZSIKKyNkZWZpbmUgQ0ZHX1JSTV9FTkFCTEVfTUlOICAgICAgICAgICAgICAgICAgICAgICAg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fTUFYX0RVUkFUSU9OX0RFRkFVTFQgICgzKQorCisjZGVmaW5lIENGR19SUk1fTUVBU19SQU5ET01JWkFUSU9OX0lOVFZMX05BTUUgICAgICAgICAgICAiZ1JybVJhbmRuSW50dmwiCisjZGVmaW5lIENGR19SUk1fTUVBU19SQU5ET01JWkFUSU9OX0lOVFZMX01JTiAgICAgICAgICAgICAoMTApCisjZGVmaW5lIENGR19SUk1fTUVBU19SQU5ET01JWkFUSU9OX0lOVFZMX01BWCAgICAgICAgICAgICAoMTAwKSAgCisjZGVmaW5lIENGR19SUk1fTUVBU19SQU5ET01JWkFUSU9OX0lOVFZMX0RFRkFVTFQgICAgICAgICAoMTAwKQorI2VuZGlmCisKKyNkZWZpbmUgQ0ZHX1FPU19JTVBMSUNJVF9TRVRVUF9FTkFCTEVEX05BTUUgICAgICAgICAgICAgICAgICJJbXBsaWNpdFFvc0lzRW5hYmxlZCIKKyNkZWZpbmUgQ0ZHX1FPU19JTVBMSUNJVF9TRVRVUF9FTkFCTEVEX01JTiAgICAgICAgICAgICAgICAgICgwKQorI2RlZmluZSBDRkdfUU9TX0lNUExJQ0lUX1NFVFVQX0VOQUJMRURfTUFYICAgICAgICAgICAgICAgICAgKDEpIAorI2RlZmluZSBDRkdfUU9TX0lNUExJQ0lUX1NFVFVQX0VOQUJMRURfREVGQVVMVCAgICAgICAgICAgICAgKDEpCisKKyNkZWZpbmUgQ0ZHX0VOQUJMRV9MT0dQX05BTUUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJnRW5hYmxlTG9ncCIKKyNkZWZpbmUgQ0ZHX0VOQUJMRV9MT0dQX01JTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19FTkFCTEVfTE9HUF9NQVggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIDEgKQorI2RlZmluZSBDRkdfRU5BQkxFX0xPR1BfREVGQVVMVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCAwICkKKworI2RlZmluZSBDRkdfQlRDX0VYRUNVVElPTl9NT0RFX05BTUUgICAgICAgICAgICAgICAgICAgICAgICAgIkJ0Y0V4ZWN1dGlvbk1vZGUiCisjZGVmaW5lIENGR19CVENfRVhFQ1VUSU9OX01PREVfTUlOICAgICAgICAgICAgICAgICAgICAgICAgICAoIDAgKQorI2RlZmluZSBDRkdfQlRDX0VYRUNVVElPTl9NT0RFX01BWCAgICAgICAgICAgICAgICAgICAgICAgICAgKCA1ICkKKyNkZWZpbmUgQ0ZHX0JUQ19FWEVDVVRJT05fTU9ERV9ERUZBVUxUICAgICAgICAgICAgICAgICAgICAgICggMCApCisKKyNkZWZpbmUgQ0ZHX0JUQ19ESENQX1BST1RFQ1RJT05fTkFNRSAgICAgICAgICAgICAgICAgICAgICAgICAiQnRjQ29uc0J0U2xvdFRvQmxvY2tEdXJpbmdEaGNwIgorI2RlZmluZSBDRkdfQlRDX0RIQ1BfUFJPVEVDVElPTl9NSU4gICAgICAgICAgICAgICAgICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19CVENfREhDUF9QUk9URUNUSU9OX01BWCAgICAgICAgICAgICAgICAgICAgICAgICAgKCAweEZGICkKKyNkZWZpbmUgQ0ZHX0JUQ19ESENQX1BST1RFQ1RJT05fREVGQVVMVCAgICAgICAgICAgICAgICAgICAgICAoIDAgKQorCisjZGVmaW5lIENGR19CVENfQTJEUF9ESENQX1BST1RFQ1RJT05fTkFNRSAgICAgICAgICAgICAgICAgICAgIkJ0Y0EyRFBEaGNwUHJvdGVjdExldmVsIgorI2RlZmluZSBDRkdfQlRDX0EyRFBfREhDUF9QUk9URUNUSU9OX01JTiAgICAgICAgICAgICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19CVENfQTJEUF9ESENQX1BST1RFQ1RJT05fTUFYICAgICAgICAgICAgICAgICAgICAgKCAweEZGICkKKyNkZWZpbmUgQ0ZHX0JUQ19BMkRQX0RIQ1BfUFJPVEVDVElPTl9ERUZBVUxUICAg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leENvbmZpZzEiCisjZGVmaW5lIENGR19NV1NfQ09FWF9DT05GSUdYX01JTiAgICAgICAgICAgICAoIDAgKQorI2RlZmluZSBDRkdfTVdTX0NPRVhfQ09ORklHWF9NQVggICAgICAgICAgICAgKCAweEZGRkZGRkZGICkKKyNkZWZpbmUgQ0ZHX01XU19DT0VYX0NPTkZJR1hfREVGQVVMVCAgICAgICAgICggMCApCisjZGVmaW5lIENGR19NV1NfQ09FWF9DT05GSUcyX05BTUUgICAgICAgICAgICAibXdzQ29leENvbmZpZzIiCisjZGVmaW5lIENGR19NV1NfQ09FWF9DT05GSUczX05BTUUgICAgICAgICAgICAibXdzQ29leENvbmZpZzMiCisjZGVmaW5lIENGR19NV1NfQ09FWF9DT05GSUc0X05BTUUgICAgICAgICAgICAibXdzQ29leENvbmZpZzQiCisjZGVmaW5lIENGR19NV1NfQ09FWF9DT05GSUc1X05BTUUgICAgICAgICAgICAibXdzQ29leENvbmZpZzUiCisjZGVmaW5lIENGR19NV1NfQ09FWF9DT05GSUc2X05BTUUgICAgICAgICAgICAibXdzQ29leENvbmZpZzYiCisKKyNkZWZpbmUgQ0ZHX1NBUl9QT1dFUl9CQUNLT0ZGX05BTUUgICAgICAgICAgICJTQVJQb3dlckJhY2tvZmYiCisjZGVmaW5lIENGR19TQVJfUE9XRVJfQkFDS09GRl9NSU4gICAgICAgICAgICAoIDAgKQorI2RlZmluZSBDRkdfU0FSX1BPV0VSX0JBQ0tPRkZfTUFYICAgICAgICAgICAgKCAweEZGRkZGRkZGICkKKyNkZWZpbmUgQ0ZHX1NBUl9QT1dFUl9CQUNLT0ZGX0RFRkFVTFQgICAgICAgICggMTMgKQorCisjaWYgZGVmaW5lZCBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUgorI2RlZmluZSBDRkdfRlRfUkVTT1VSQ0VfUkVRX05BTUUgICAgICAgICAgICAgICAgICAgICAgICAiZ0ZUUmVzb3VyY2VSZXFTdXBwb3J0ZWQiCisjZGVmaW5lIENGR19GVF9SRVNPVVJDRV9SRVFfTUlOICAgICAgICAgICAgICAgICAgICAgICAgICgwKQorI2RlZmluZSBDRkdfRlRfUkVTT1VSQ0VfUkVRX01BWCAgICAgICAgICAgICAgICAgICAgICAgICAoMSkKKyNkZWZpbmUgQ0ZHX0ZUX1JFU09VUkNFX1JFUV9ERUZBVUxUICAgICAgICAgICAgICAgICAgICAgKDApCisjZW5kaWYKKworI2RlZmluZSBDRkdfVEVMRV9CQ05fVFJBTlNfTElfTkFNRSAgICAgICAgICAgICAgICAgICAidGVsZXNjb3BpY0JlYWNvblRyYW5zTGlzdGVuSW50ZXJ2YWwiCisjZGVmaW5lIENGR19URUxFX0JDTl9UUkFOU19MSV9NSU4gICAgICAgICAgICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19URUxFX0JDTl9UUkFOU19MSV9NQVggICAgICAgICAgICAgICAgICAgICggNyApCisjZGVmaW5lIENGR19URUxFX0JDTl9UUkFOU19MSV9ERUZBVUxUICAgICAgICAgICAgICAgICggMyApCisKKyNkZWZpbmUgQ0ZHX1RFTEVfQkNOX1RSQU5TX0xJX05VTV9JRExFX0JDTlNfTkFNRSAgICAgInRlbGVzY29waWNCZWFjb25UcmFuc0xpc3RlbkludGVydmFsTnVtSWRsZUJjbnMiCisjZGVmaW5lIENGR19URUxFX0JDTl9UUkFOU19MSV9OVU1fSURMRV9CQ05TX01JTiAgICAgICggNSApCisjZGVmaW5lIENGR19URUxFX0JDTl9UUkFOU19MSV9OVU1fSURMRV9CQ05TX01BWCAgICAgICggMjU1ICkKKyNkZWZpbmUgQ0ZHX1RFTEVfQkNOX1RSQU5TX0xJX05VTV9JRExFX0JDTlNfREVGQVVMVCAgKCAxMCApCisKKyNkZWZpbmUgQ0ZHX1RFTEVfQkNOX01BWF9MSV9OQU1FICAgICAgICAgICAgICAgICAgICAgInRlbGVzY29waWNCZWFjb25NYXhMaXN0ZW5JbnRlcnZhbCIKKyNkZWZpbmUgQ0ZHX1RFTEVfQkNOX01BWF9MSV9NSU4gICAgICAgICAgICAgICAgICAgICAgKCAwICkKKyNkZWZpbmUgQ0ZHX1RFTEVfQkNOX01BWF9MSV9NQVggICAgICAgICAgICAgICAgICAgICAgKCA3ICkKKyNkZWZpbmUgQ0ZHX1RFTEVfQkNOX01BWF9MSV9ERUZBVUxUICAgICAgICAgICAgICAgICAgKCA1ICkKKworI2RlZmluZSBDRkdfVEVMRV9CQ05fTUFYX0xJX05VTV9JRExFX0JDTlNfTkFNRSAgICAgICAidGVsZXNjb3BpY0JlYWNvbk1heExpc3RlbkludGVydmFsTnVtSWRsZUJjbnMiCisjZGVmaW5lIENGR19URUxFX0JDTl9NQVhfTElfTlVNX0lETEVfQkNOU19NSU4gICAgICAgICggNSApCisjZGVmaW5lIENGR19URUxFX0JDTl9NQVhfTElfTlVNX0lETEVfQkNOU19NQVggICAgICAgICggMjU1ICkKKyNkZWZpbmUgQ0ZHX1RFTEVfQkNOX01BWF9MSV9OVU1fSURMRV9CQ05TX0RFRkFVTFQgICAgKCAxNSApCisKKyNkZWZpbmUgQ0ZHX0JDTl9FQVJMWV9URVJNX1dBS0VfTkFNRSAgICAgICAgICAgICAgICAgImJlYWNvbkVhcmx5VGVybWluYXRpb25XYWtlSW50ZXJ2YWwiCisjZGVmaW5lIENGR19CQ05fRUFSTFlfVEVSTV9XQUtFX01JTiAgICAgICAgICAgICAgICAgICggMiApCisjZGVmaW5lIENGR19CQ05fRUFSTFlfVEVSTV9XQUtFX01BWCAgICAgICAgICAgICAgICAgICggMjU1ICkKKyNkZWZpbmUgQ0ZHX0JDTl9FQVJMWV9URVJNX1dBS0VfREVGQVVMVCAgICAgICAgICAgICAgKCAzICkKKworI2RlZmluZSBDRkdfRU5BQkxFX1JPQU1fREVMQVlfU1RBVFMgICAgICAgICAgICAgICAgICAiZ0VuYWJsZVJvYW1EZWxheVN0YXRzIgorI2RlZmluZSBDRkdfRU5BQkxFX1JPQU1fREVMQVlfU1RBVFNfTUlOICAgICAgICAgICAgICAoIDAg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MT09LVVBfUlNTSV9USFJFU0hPTERfTUlOICAgICAgICgwKQorI2RlZmluZSBDRkdfTkVJR0hCT1JfTE9PS1VQX1JTU0lfVEhSRVNIT0xEX01BWCAgICAgICAoMTIwKQorI2RlZmluZSBDRkdfTkVJR0hCT1JfTE9PS1VQX1JTU0lfVEhSRVNIT0xEX0RFRkFVTFQgICAoMCkgLypBIFplcm8gdmFsdWUgaW5kaWNhdGVzIHRoZSBob3N0IHRvIGNhbGN1bGF0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBZGFwdGl2ZSB0aHJlc29sZCBiYXNlZCBvbiB0aGUgbWluaW11bQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdXBwb3J0ZWQgZGF0YSByYXRlLiovCisKKyNkZWZpbmUgQ0ZHX05FSUdIQk9SX1NDQU5fQ0hBTl9MSVNUX05BTUUgICAgICAgICAgICAgICAgICAgICAgImdOZWlnaGJvclNjYW5DaGFubmVsTGlzdCIKKyNkZWZpbmUgQ0ZHX05FSUdIQk9SX1NDQU5fQ0hBTl9MSVNUX0RFRkFVTFQgICAgICAgICAgICAgICAgICAgIiIKKworI2RlZmluZSBDRkdfTkVJR0hCT1JfU0NBTl9NSU5fQ0hBTl9USU1FX05BTUUgICAgICAgICAgICAgICAgICAiZ05laWdoYm9yU2NhbkNoYW5uZWxNaW5UaW1lIgorI2RlZmluZSBDRkdfTkVJR0hCT1JfU0NBTl9NSU5fQ0hBTl9USU1FX01JTiAgICAgICAgICAgICAgICAgICAoMTApICAgCisjZGVmaW5lIENGR19ORUlHSEJPUl9TQ0FOX01JTl9DSEFOX1RJTUVfTUFYICAgICAgICAgICAgICAgICAgICg0MCkgICAKKyNkZWZpbmUgQ0ZHX05FSUdIQk9SX1NDQU5fTUlOX0NIQU5fVElNRV9ERUZBVUxUICAgICAgICAgICAgICAgKDIwKSAgIAorCisjZG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ZHX1FPU19XTU1fQlVSU1RfU0laRV9ERUZOX01BWCAgICAgICAgICAgICAgICAgICAgICAgICAoMSkKKyNkZWZpbmUgQ0ZHX1FPU19XTU1fQlVSU1RfU0laRV9ERUZOX0RFRkFVTFQgICAgICAgICAgICAgICAgICAgICAoMCkKKworI2RlZmluZSBDRkdfUU9TX1dNTV9UU19JTkZPX0FDS19QT0xJQ1lfTkFNRSAgICAgICAgICAgICAgICAgICAgICAgICJ0c0luZm9BY2tQb2xpY3kiIAorI2RlZmluZSBDRkdfUU9TX1dNTV9UU19JTkZPX0FDS19QT0xJQ1lfTUlOICAgICAgICAgICAgICAgICAgICAgICAgICgweDAwKQorI2RlZmluZSBDRkdfUU9TX1dNTV9UU19JTkZPX0FDS19QT0xJQ1lfTUFYICAgICAgICAgICAgICAgICAgICAgICAgICgweDAxKQorI2RlZmluZSBDRkdfUU9TX1dNTV9UU19JTkZPX0FDS19QT0xJQ1lfREVGQVVMVCAgICAgICAgICAgICAgICAgICAgICgweDAwKQorCisjZGVmaW5lIENGR19TSU5HTEVfVElEX1JDX05BTUUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJTaW5nbGVUSURSQyIKKyNkZWZpbmUgQ0ZHX1NJTkdMRV9USURfUkNfTUlOICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgwKSAvLyBTZXBlcmF0ZSByZXBsYXkgY291bnRlciBmb3IgYWxsIFRJRAorI2RlZmluZSBDRkdfU0lOR0xFX1RJRF9SQ19NQVggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDEpIC8vIFNpbmdsZSByZXBsYXkgY291bnRlciBmb3IgYWxsIFRJRCAKKyNkZWZpbmUgQ0ZHX1NJTkdMRV9USURfUkNfREVGQVVMVCAgICAgICAgICAgICAgICAgICAgICAgICAgICgxKSAKKyNkZWZpbmUgQ0ZHX01DQVNUX0JDQVNUX0ZJTFRFUl9TRVRUSU5HX05BTUUgICAgICAgICAgIk1jYXN0QmNhc3RGaWx0ZXIi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Q2hhbm5lbFdpZHRoIgorI2RlZmluZSBDRkdfVkhUX0NIQU5ORUxfV0lEVEhfTUlOICAgICAgICAgICAgKCAwICkKKyNkZWZpbmUgQ0ZHX1ZIVF9DSEFOTkVMX1dJRFRIX01BWCAgICAgICAgICAgICggMiApCisjZGVmaW5lIENGR19WSFRfQ0hBTk5FTF9XSURUSF9ERUZBVUxUICAgICAgICAoIDIgKQorCisjZGVmaW5lIENGR19WSFRfRU5BQkxFX1JYX01DU184XzkgICAgICAgICAgICAgICAiZ1ZodFJ4TUNTIgorI2RlZmluZSBDRkdfVkhUX0VOQUJMRV9SWF9NQ1NfOF85X01JTiAgICAgICAgICAgKCAwICkKKyNkZWZpbmUgQ0ZHX1ZIVF9FTkFCTEVfUlhfTUNTXzhfOV9NQVggICAgICAgICAgICggMiApCisjZGVmaW5lIENGR19WSFRfRU5BQkxFX1JYX01DU184XzlfREVGQVVMVCAgICAgICAoIDAgKQorCisjZGVmaW5lIENGR19WSFRfRU5BQkxFX1RYX01DU184XzkgICAgICAgICAgICAgICAiZ1ZodFR4TUNTIgorI2RlZmluZSBDRkdfVkhUX0VOQUJMRV9UWF9NQ1NfOF85X01JTiAgICAgICAgICAgKCAwICkKKyNkZWZpbmUgQ0ZHX1ZIVF9FTkFCTEVfVFhfTUNTXzhfOV9NQVggICAgICAgICAgICggMiApCisjZGVmaW5lIENGR19WSFRfRU5BQkxFX1RYX01DU184XzlfREVGQVVMVCAgICAgICAoIDAgKQorCisjZW5kaWYKKworI2RlZmluZSBDRkdfUkVQT1JUX01BWF9MSU5LX1NQRUVEICAgICAgICAgICAgICAgICAgImdSZXBvcnRNYXhMaW5rU3BlZWQiCisjZGVmaW5lIENGR19SRVBPUlRfTUFYX0xJTktfU1BFRURfTUlOICAgICAgICAgICAgICAoIGVIRERfTElOS19TUEVFRF9SRVBPUlRfQUNUVUFMICkKKyNkZWZpbmUgQ0ZHX1JFUE9SVF9NQVhfTElOS19TUEVFRF9NQVggICAgICAgICAgICAgICggZUhERF9MSU5LX1NQRUVEX1JFUE9SVF9NQVhfU0NBTEVEICkKKyNkZWZpbmUgQ0ZHX1JFUE9SVF9NQVhfTElOS19TUEVFRF9ERUZBVUxUICAgICAgICAgICggZUhERF9MSU5LX1NQRUVEX1JFUE9SVF9NQVhfU0NBTEVEICkKKworLyoKKyAqIFJTU0kgVGhyZXNob2xkcworICogVXNlZCB3aGVuIGVIRERfTElOS19TUEVFRF9SRVBPUlRfU0NBTEVEIGlzIHNlbGVjdGVkCisgKi8KKyNkZWZpbmUgQ0ZHX0xJTktfU1BFRURfUlNTSV9ISUdIICAgICAgICAgICAgICAgICAgICJnTGlua1NwZWVkUnNzaUhpZ2giCisjZGVmaW5lIENGR19MSU5LX1NQRUVEX1JTU0lfSElHSF9NSU4gICAgICAgICAgICAgICAoIC0xMjcgKQorI2RlZmluZSBDRkdfTElOS19TUEVFRF9SU1NJX0hJR0hfTUFYICAgICAgICAgICAgICAgKCAgMCApCisjZGVmaW5lIENGR19MSU5LX1NQRUVEX1JTU0lfSElHSF9ERUZBVUxUICAgICAgICAgICAoIC01NSApCisKKyNkZWZpbmUgQ0ZHX0xJTktfU1BFRURfUlNTSV9NSUQgICAgICAgICAgICAgICAgICAgICJnTGlua1NwZWVkUnNzaU1lZCIKKyNkZWZpbmUgQ0ZHX0xJTktfU1BFRURfUlNTSV9NSURfTUlOICAgICAgICAgICAgICAgICggLTEyNyApCisjZGVmaW5lIENGR19MSU5LX1NQRUVEX1JTU0lfTUlEX01BWCAgICAgICAgICAgICAgICAoICAwICkKKyNkZWZpbmUgQ0ZHX0xJTktfU1BFRURfUlNTSV9NSURfREVGQVVMVCAgICAgICAgICAgICggLTY1ICkKKworI2RlZmluZSBDRkdfTElOS19TUEVFRF9SU1NJX0xPVyAgICAgICAgICAgICAgICAgICAgImdMaW5rU3BlZWRSc3NpTG93IgorI2RlZmluZSBDRkdfTElOS19TUEVFRF9SU1NJX0xPV19NSU4gICAgICAgICAgICAgICAgKCAtMTI3ICkKKyNkZWZpbmUgQ0ZHX0xJTktfU1BFRURfUlNTSV9MT1dfTUFYICAgICAgICAgICAgICAgICggIDAgKQorI2RlZmluZSBDRkdfTElOS19TUEVFRF9SU1NJX0xPV19ERUZBVUxUICAgICAgICAgICAgKCAtODAgKQorCisjZGVmaW5lIENGR19QMlBfREVWSUNFX0FERFJFU1NfQURNSU5JU1RSQVRFRF9OQU1FICAgICAgICAgICAgICAgICJpc1AycERldmljZUFkZHJBZG1pbmlzdHJhdGVkIgorI2RlZmluZSBDRkdfUDJQX0RFVklDRV9BRERSRVNTX0FETUlOSVNUUkFURURfTUlOICAgICAgICAgICAgICAgICAoIDAgKQorI2RlZmluZSBDRkdfUDJQX0RFVklDRV9BRERSRVNTX0FETUlOSVNUUkFURURfTUFYICAgICAgICAgICAgICAgICAoIDEgKQorI2RlZmluZSBDRkdfUDJQX0RFVklDRV9BRERSRVNTX0FETUlOSVNUUkFURURfREVGQVVMVCAgICAgICAgICAgICAoIDEgKQorCisKKyNkZWZpbmUgQ0ZHX0VOQUJMRV9TU1IgICAgICAgICAgICAgICAgICAgICAgImdFbmFibGVTU1IiCisjZGVmaW5lIENGR19FTkFCTEVfU1NSX01JTiAgICAgICAgICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19FTkFCTEVfU1NSX01BWCAgICAgICAgICAgICAgICAgICggMSApCisjZGVmaW5lIENGR19FTkFCTEVfU1NSX0RFRkFVTFQgICAgICAgICAgICAgICggMSApCisKKyNkZWZpbmUgQ0ZHX0JUQ19BQ1RJVkVfV0xBTl9MRU5fTkFNRSAgICAgICAgICAgImJ0Y0FjdGl2ZVdsYW5MZW4iCisjZGVmaW5lIENGR19CVENfQUNUSVZFX1dMQU5fTEVOX01JTiAgICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19CVENfQUNUSVZFX1dMQU5fTEVOX01BWCAgICAgICAgICAgICggMjUwMDAwICkKKyNkZWZpbmUgQ0ZHX0JUQ19BQ1RJVkVfV0xBTl9MRU5fREVGQ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GxUaW1lIgorI2RlZmluZSBDRkdfT0JTU19IVDQwX1NDQU5fQUNUSVZFX0RXRUxMX1RJTUVfTUlOICAgICAgICAgICAgICAgICAoIDUgKQorI2RlZmluZSBDRkdfT0JTU19IVDQwX1NDQU5fQUNUSVZFX0RXRUxMX1RJTUVfTUFYICAgICAgICAgICAgICAgICAoIDEwMDAgKQorI2RlZmluZSBDRkdfT0JTU19IVDQwX1NDQU5fQUNUSVZFX0RXRUxMX1RJTUVfREVGQVVMVCAgICAgICAgICAgICAoIDEwICkKKworI2RlZmluZSBDRkdfT0JTU19IVDQwX1NDQU5fUEFTU0lWRV9EV0VMTF9USU1FX05BTUUgICAgICAgICAgICAgICAgImdPYnNzU2NhblBhc3NpdmVEd2VsbFRpbWUiCisjZGVmaW5lIENGR19PQlNTX0hUNDBfU0NBTl9QQVNTSVZFX0RXRUxMX1RJTUVfTUlOICAgICAgICAgICAgICAgICAoIDEwICkKKyNkZWZpbmUgQ0ZHX09CU1NfSFQ0MF9TQ0FOX1BBU1NJVkVfRFdFTExfVElNRV9NQVggICAgICAgICAgICAgICAgICggMTAwMCApCisjZGVmaW5lIENGR19PQlNTX0hUNDBfU0NBTl9QQVNTSVZFX0RXRUxMX1RJTUVfREVGQVVMVCAgICAgICAgICAgICAoIDIwICkKKworI2RlZmluZSBDRkdfT0JTU19IVDQwX1NDQU5fV0lEVEhfVFJJR0dFUl9JTlRFUlZBTF9OQU1FICAgICAgICAgICAgImdPYnNzU2NhbldpZHRoVHJpZ2dlckludGVydmFsIgorI2RlZmluZSBDRkdfT0JTU19IVDQwX1NDQU5fV0lEVEhfVFJJR0dFUl9JTlRFUlZBTF9NSU4gICAgICAgICAgICAgKCAxMCApCisjZGVmaW5lIENGR19PQlNTX0hUNDBfU0NBTl9XSURUSF9UUklHR0VSX0lOVEVSVkFMX01BWCAgICAgICAgICAgICAoIDkwMCApCisjZGVmaW5lIENGR19PQlNTX0hUNDBfU0NBTl9XSURUSF9UUklHR0VSX0lOVEVSV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VudCBiZWFjb24gaW50ZXJ2YWwgdGhhbiBTVEEncy4KKyAqIEFkZGVkIGZvciBXaS1GaSBDZXJ0LiA1LjEuMTIKKyAqIERlZmF1bHQ6IGdBbGxvd01DQ0dPRGlmZkJJID0gMgorICogSWYgZ0FsbG93TUNDR09EaWZmQkkgPSAxICAvLyBTZXQgdG8gMSBmb3IgV0ZBIGNlcnRpZmljYXRpb24uIEdPIEJlYWNvbgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlcnZhbCBpcyBub3QgY2hhbmdlZC4gTUNDIEdPCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvZXNuJ3Qgd29yayB3ZWxsIGluIG9wdGltaXplZCB3YXkuCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEluIHdvcnN0IHNjZW5hcmlvLCBpdCBtYXkgaW52aXRlIFNUQQorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNjb25uZWN0aW9uLgorICogZ0FsbG93TUNDR09EaWZmQkkgPSAyICAgICAvL0lmIHNldCB0byAyIHdvcmthcm91bmQgMSBkaXNhc3NvYyBhbGwgdGhlIGNsaWVudHMKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmQgdXBkYXRlIGJlYWNvbiBJbnRlcnZhbAorICogZ0FsbG93TUNDR09EaWZmQkkgPSAzICAgICAvL0lmIHNldCB0byAzIHRlYXIgZG93biB0aGUgUDJQIGxpbmsgaW4gYXV0by8gCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTm9uLWF1dG9ub21vdXMgLUdPIGNhc2UKKyAqIGdBbGxvd01DQ0dPRGlmZkJJID0gNCAgICAgLy9JZiBzZXQgdG8gNCBkb24ndCBkaXNjb25uZWN0IHRoZSBQMlAgY2xpZW50CisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW4gYXV0b25vbW91cy9Ob24tYXV0b25vbW91cyAtR08gY2FzZSB1cGRhdGUKKyAqICAgICAg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QkxFX01JTiAgICAgICAgICAgICAgICAgKCAwICkKKyNkZWZpbmUgQ0ZHX1RETFNfU1VQUE9SVF9FTkFCTEVfTUFYICAgICAgICAgICAgICAgICAoIDEgKQorI2RlZmluZSBDRkdfVERMU19TVVBQT1JUX0VOQUJMRV9ERUZBVUxUICAgICAgICAgICAgICggMCApCisKKyNkZWZpbmUgQ0ZHX1RETFNfSU1QTElDSVRfVFJJR0dFUiAgICAgICAgICAgICAgICAgICAiZ0VuYWJsZVRETFNJbXBsaWNpdFRyaWdnZXIiCisjZGVmaW5lIENGR19URExTX0lNUExJQ0lUX1RSSUdHRVJfTUlOICAgICAgICAgICAgICAgKCAwICkKKyNkZWZpbmUgQ0ZHX1RETFNfSU1QTElDSVRfVFJJR0dFUl9NQVggICAgICAgICAgICAgICAoIDEgKQorI2RlZmluZSBDRkdfVERMU19JTVBMSUNJVF9UUklHR0VSX0RFRkFVTFQgICAgICAgICAgICggMCApCisKKyNkZWZpbmUgQ0ZHX1RETFNfVFhfU1RBVFNfUEVSSU9EICAgICAgICAgICAgICAgICAgICAiZ1RETFNUeFN0YXRzUGVyaW9kIgorI2RlZmluZSBDRkdfVERMU19UWF9TVEFUU19QRVJJT0RfTUlOICAgICAgICAgICAgICAgICggMTAgKQorI2RlZmluZSBDRkdfVERMU19UWF9TVEFUU19QRVJJT0RfTUFYICAgICAgICAgICAgICAgICggNDI5NDk2NzI5NVVMICkKKyNkZWZpbmUgQ0ZHX1RETFNfVFhfU1RBVFNfUEVSSU9EX0RFRkFVTFQgICAgICAgICAgICAoIDUwMDAgKQorCisjZGVmaW5lIENGR19URExTX1RYX1BBQ0tFVF9USFJFU0hPTEQgICAgICAgICAgICAgICAgImdURExTVHhQYWNrZXRUaHJlc2hvbGQiCisjZGVmaW5lIENGR19URExTX1RYX1BBQ0tFVF9USFJFU0hPTERfTUlOICAgICAgICAgICAgKCAwICkKKyNkZWZpbmUgQ0ZHX1RETFNfVFhfUEFDS0VUX1RIUkVTSE9MRF9NQVggICAgICAgICAgICAoIDQyOTQ5NjcyOTVVTCApCisjZGVmaW5lIENGR19URExTX1RYX1BBQ0tFVF9USFJFU0hPTERfREVGQVVMVCAgICAgICAgKCAxMDAgKQorCisjZGVmaW5lIENGR19URExTX0RJU0NPVkVSWV9QRVJJT0QgICAgICAgICAgICAgICAgICAgImdURExTRGlzY292ZXJ5UGVyaW9kIgorI2RlZmluZSBDRkdfVERMU19ESVNDT1ZFUllfUEVSSU9EX01JTiAgICAgICAgICAgICAgICggNTAwMCApCisjZGVmaW5lIENGR19URExTX0RJU0NPVkVSWV9QRVJJT0RfTUFYICAgICAgICAgICAgICAgKCA0Mjk0OTY3Mjk1VUwgKQorI2RlZmluZSBDRkdfVERMU19ESVNDT1ZFUllfUEVSSU9EX0RFRkFVTFQgICAgICAgICAgICggMjAwMDAgKQorCisjZGVmaW5lIENGR19URExTX01BWF9ESVNDT1ZFUllfQVRURU1QVCAgICAgICAgICAgICAgImdURExTTWF4RGlzY292ZXJ5QXR0ZW1wdCIKKyNkZWZpbmUgQ0ZHX1RETFNfTUFYX0RJU0NPVkVSWV9BVFRFTVBUX01JTiAgICAgICAgICAoIDEgKQorI2RlZmluZSBDRkdfVERMU19NQVhfRElTQ09WRVJZX0FUVEVNUFRfTUFYICAgICAgICAgICggMTAwICkKKyNkZWZpbmUgQ0ZHX1RETFNfTUFYX0RJU0NPVkVSWV9BVFRFTVBUX0RFRkFVTFQgICAgICAoIDMgKQorCisjZGVmaW5lIENGR19URExTX0lETEVfVElNRU9VVCAgICAgICAgICAgICAgICAgICAgICAgImdURExTSWRsZVRpbWVvdXQiCisjZGVmaW5lIENGR19URExTX0lETEVfVElNRU9VVF9NSU4gICAgICAgICAgICAgICAgICAgKCAyMDAwICkKKyNkZWZpbmUgQ0ZHX1RETFNfSURMRV9USU1FT1VUX01BWCAgICAgICAgICAgICAgICAgICAoIDQwMDAwICkKKyNkZWZpbmUgQ0ZHX1RETFNfSURMRV9USU1FT1VUX0RFRkFVTFQgICAgICAgICAgICAgICAoIDUwMDAgKQorCisjZGVmaW5lIENGR19URExTX0lETEVfUEFDS0VUX1RIUkVTSE9MRCAgICAgICAgICAgICAgImdURExTSWRsZVBhY2tldFRocmVzaG9sZCIKKyNkZWZpbmUgQ0ZHX1RETFNfSURMRV9QQUNLRVRfVEhSRVNIT0xEX01JTiAgICAgICAgICAoIDAgKQorI2RlZmluZSBDRkdfVERMU19JRExFX1BBQ0tFVF9USFJFU0hPTERfTUFYICAgICAgICAgICggNDAwMDAgKQorI2RlZmluZSBDRkdfVERMU19JRExFX1BBQ0tFVF9USFJFU0hPTERfREVGQVVMVCAgICAgICggNSApCisKKyNkZWZpbmUgQ0ZHX1RETFNfUlNTSV9IWVNURVJFU0lTICAgICAgICAgICAgICAgICAgICAiZ1RETFNSc3NpSHlzdGVyZXNpcyIKKyNkZWZpbmUgQ0ZHX1RETFNfUlNTSV9IWVNURVJFU0lTX01JTiAgICAgICAgICAgICAgICAoIDAgKQorI2RlZmluZSBDRkdfVERMU19SU1NJX0hZU1RFUkVTSVNfTUFYICAgICAgICAgICAgICAgICggMTAwICkKKyNkZWZpbmUgQ0ZHX1RETFNfUlNTSV9IWVNURVJFU0lTX0RFRkFVTFQgICAgICAgICAgICAoIDEwMCApCisKKyNkZWZpbmUgQ0ZHX1RETFNfUlNTSV9UUklHR0VSX1RIUkVTSE9MRCAgICAgICAgICAgICAiZ1RETFNSU1NJVHJpZ2dlclRocmVzaG9sZCIKKyNkZWZpbmUgQ0ZHX1RETFNfUlNTSV9UUklHR0VSX1RIUkVTSE9MRF9NSU4gICAgICAgICAoIC0xMjAgKQorI2RlZmluZSBDRkdfVERMU19SU1NJX1RSSUdHRVJfVEhSRVNIT0xEX01BWCAgICAgICAgICggMCApCisjZGVmaW5lIENGR19URExTX1JTU0lfVFJJR0dFUl9USFJFU0hPTERfREVGQVVMVCAgICAgKCAtNzUgKQorCisjZGVmaW5lIENGR19URExTX1JTU0lfVEVBUkRPV05fVEhSRVNIT0xEICAgICAgICAgICAgImdURExTUlNTSVRlYXJkb3duVGhyZXNob2xkIgorI2RlZmluZSBDRkdfVERMU19SU1NJX1RFQVJET1dOX1RIUkVTSE9MRF9NSU4gICAgICAgICggLTEyMCApCisjZGVmaW5lIENGR19URExTX1JTU0lfVEVBUkRPV05fVEhSRVNIT0xEX01BWCAgICAgICAgKCAwICkKKyNkZWZpbmUgQ0ZHX1RETFNfUlNTSV9URUFSRE9XTl9USFJFU0hPTERfREVGQVVMVCAgICAoIC03NSApCisKKyNkZWZpbmUgQ0ZHX1RETFNfUU9TX1dNTV9VQVBTRF9NQVNLX05BTUUgICAgICAgICAgICAiZ1RETFNVYXBzZE1hc2siIC8vIEFDcyB0byBzZXR1cCBVLUFQU0QgZm9yIFRETFMgU3RhCisjZGVmaW5lIENGR19URExTX1FPU19XTU1fVUFQU0RfTUFTS19NSU4gICAgICAgICAgICAgKDApCisjZGVmaW5lIENGR19URExTX1FPU19XTU1fVUFQU0RfTUFTS19NQVggICAgICAgICAgICAgKDE1KQorI2RlZmluZSBDRkdfVERMU19RT1NfV01NX1VBUFNEX01BU0tfREVGQVVMVCAgICAgICAgICgwKQorCisjZGVmaW5lIENGR19URExTX0JVRkZFUl9TVEFfU1VQUE9SVF9FTkFCTEUgICAgICAgICAgImdFbmFibGVURExTQnVmZmVyU3RhIgorI2RlZmluZSBDRkdfVERMU19CVUZGRVJfU1RBX1NVUFBPUlRfRU5BQkxFX01JTiAgICAgICgwKQorI2RlZmluZSBDRkdfVERMU19CVUZGRVJfU1RBX1NVUFBPUlRfRU5BQkxFX01BWCAgICAgICgxKQorI2RlZmluZSBDRkdfVERMU19CVUZGRVJfU1RBX1NVUFBPUlRfRU5BQkxFX0RFRkFVTFQgICgxKQorCisjZGVmaW5lIENGR19URExTX1BVQVBTRF9JTkFDVElWSVRZX1RJTUUgICAgICAgICAgICAgImdURExTUHVhcHNkSW5hY3Rpdml0eVRpbWUiCisjZGVmaW5lIENGR19URExTX1BVQVBTRF9JTkFDVElW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BVEhfREVGQVVMVCAgICAgICAgICAgICAgICAgICAgKDApCisKKy8vRW5hYmxlIE1lbW9yeSBEZWJ1ZworI2lmZGVmIE1FTU9SWV9ERUJVRworI2RlZmluZSBDRkdfRU5BQkxFX01FTU9SWV9ERUJVR19OQU1FICAgICAgICAgICAgICJnRW5hYmxlTWVtb3J5RGVidWciCisjZGVmaW5lIENGR19FTkFCTEVfTUVNT1JZX0RFQlVHX01JTiAgICAgICAgICAgICAgKDApCisjZGVmaW5lIENGR19FTkFCTEVfTUVNT1JZX0RFQlVHX01BWCAgICAgICAgICAgICAgKDEpCisjZGVmaW5lIENGR19FTkFCTEVfTUVNT1JZX0RFQlVHX0RFRkFVTFQgICAgICAgICAgKDApCisjZW5kaWYKKworI2RlZmluZSBDRkdfT1ZFUlJJREVfQ09VTlRSWV9DT0RFICAgICAgICAgICAgICAgICJnU3RhQ291bnRyeUNvZGUiCisjZGVmaW5lIENGR19PVkVSUklERV9DT1VOVFJZX0NPREVfREVGQVVMVCAgICAgICAgIjAwMCIKKworLypPbmNlIHRoZSBwZXJpb2QgZXhwaXJlcyB0aGUgUlNTSSB3aWxsIGJlIGNvbXBhcmVkIHdpdGggVGhyZXNob2xkCisgKiBhbmQgaWYgbmVlZGVkIHRyaWdnZXIgZXZlbnRzIHdpbGwgYmUgcmFpc2VkCisgKi8KKyNkZWZpbmUgQ0ZHX0FTRF9QUk9CRV9JTlRFUlZBTF9OQU1FICAgICAgICAgICAgICAgICAgICAgImdBc2RQcm9iZUludGVydmFsIgorI2RlZmluZSBDRkdfQVNEX1BST0JFX0lOVEVSVkFMX0RFRkFVTFQgICAgICAgICAgICAgICAgICAoNTApCisjZGVmaW5lIENGR19BU0RfUFJPQkVfSU5URVJWQUxfTUlOICAgICAgICAgICAgICAgICAgICAgICgxKQorI2RlZmluZSBDRkdfQVNEX1BST0JFX0lOVEVSVkFMX01BWCAgICAgICAgICAgICAgICAgICAgICAoNTAwKQorCisvKiBSU1NJIFRocmVzaG9sZCB1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I2RlZmluZSBDRkdfQlRDX0RZTl9PUFBfVFhfUVVFVUVfVEhPTERfTUlOICAgICAgICAgICAgICAgICAgICggMCApCisjZGVmaW5lIENGR19CVENfRFlOX09QUF9UWF9RVUVVRV9USE9MRF9NQVggICAgICAgICAgICAgICAgICAgKCAzICkKKyNkZWZpbmUgQ0ZHX0JUQ19EWU5fT1BQX1RYX1FVRVVFX1RIT0xEX0RFRkFVTFQgICAgICAgICAgICAgICAoIDEgKQorCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworI2RlZmluZSBDRkdfUE1GX1NBX1FVRVJZX01BWF9SRVRSSUVTX05BTUUgICAgICAgICAgICAgICAgICAgICJwbWZTYVF1ZXJ5TWF4UmV0cmllcyIKKyNkZWZpbmUgQ0ZHX1BNRl9TQV9RVUVSWV9NQVhfUkVUUklFU19ERUZBVUxUICAgICAgICAgICAgICAgICAoIDUgICkKKyNkZWZpbmUgQ0ZHX1BNRl9TQV9RVUVSWV9NQVhfUkVUUklFU19NSU4gICAgICAgICAgICAgICAgICAgICAoIDAgICkKKyNkZWZpbmUgQ0ZHX1BNRl9TQV9RVUVSWV9NQVhfUkVUUklFU19NQVggICAgICAgICAgICAgICAgICAgICAoIDIwICkKKworI2RlZmluZSBDRkdfUE1GX1NBX1FVRVJZX1JFVFJZX0lOVEVSVkFMX05BTUUgICAgICAgICAgICAgICAgICJwbWZTYVF1ZXJ5UmV0cnlJbnRlcnZhbCIKKyNkZWZpbmUgQ0ZHX1BNRl9TQV9RVUVSWV9SRVRSWV9JTlRFUlZBTF9ERUZBVUxUICAgICAgICAgICAgICAoIDIwMCAgKQorI2RlZmluZSBDRkdfUE1GX1NBX1FVRVJZX1JFVFJZX0lOVEVSVkFMX01JTiAgICAgICAgICAgICAgICAgICggMCAgICApCisjZGVmaW5lIENGR19QTUZfU0FfUVVFUllfUkVUUllfSU5URVJWQUxfTUFYICAgICAgICAgICAgICAgICAgKCAyMDAwICkKKyNlbmRpZgorCisjZGVmaW5lIENGR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IgPT4gZW5hYmxlIG1hYyBzcG9vZmluZyBpbiBGVyBhbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc2FibGUgbWFjIHNwb29maW5nIGluIEhPU1QKKyAqLworI2RlZmluZSBDRkdfRU5BQkxFX01BQ19BRERSX1NQT09GSU5HICAgICAgICAgICAgICAgICAgICAgICAgICJnRW5hYmxlTWFjQWRkclNwb29mIgorI2RlZmluZSBDRkdfRU5BQkxFX01BQ19BRERSX1NQT09GSU5HX01JTiAgICAgICAgICAgICAgICAgICAgICgwKQorI2RlZmluZSBDRkdfRU5BQkxFX01BQ19BRERSX1NQT09GSU5HX01BWCAgICAgICAgICAgICAgICAgICAgICgyKQorI2RlZmluZSBDRkdfRU5BQkxFX01BQ19BRERSX1NQT09GSU5HX0RFRkFVTFQgICAgICAgICAgICAgICAgICgwKQorCisvKiBEaXNhYmxlIE1hYyBTcG9vZiBmb3IgcDJwIFNjYW4gKi8KKyNkZWZpbmUgQ0ZHX0RJU0FCTEVfUDJQX01BQ19BRERSX1NQT09GSU5HICAgICAgICAgICAgICAiZ0Rpc2FibGVQMlBNYWNBZGRyU3Bvb2YiCisjZGVmaW5lIENGR19ESVNBQkxFX1AyUF9NQUNfQUREUl9TUE9PRklOR19NSU4gICAgICAgICAgKDApCisjZGVmaW5lIENGR19ESVNBQkxFX1AyUF9NQUNfQUREUl9TUE9PRklOR19NQVggICAgICAgICAgKDEpCisjZGVmaW5lIENGR19ESVNBQkxFX1AyUF9NQUNfQUREUl9TUE9PRklOR19ERUZBVUxUICAgICAgKDApCisKKworI2RlZmluZSBDRkdfRU5BQkxFX01HTVRfTE9HR0lORyAgICAgICAgICAgICAgICAgICAgICAgICAiZ0VuYWJsZU1nbXRMb2dnaW5nIgorI2RlZmluZSBDRkdfRU5BQkxFX01HTVRfTE9HR0lOR19NSU4gICAgICAgICAgICAgICAgICAgICAoMCkKKyNkZWZpbmUgQ0ZHX0VOQUJMRV9NR01UX0xPR0dJTkdfTUFYICAgICAgICAgICAgICAgICAgICAgKDEpCisjZGVmaW5lIENGR19FTkFCTEVfTUdNVF9MT0dHSU5HX0RFRkFVTFQgICAgICAgICAgICAgICAgICgwKQorCisjZGVmaW5lIENGR19FTkFCTEVfQk1VSFdfVFJBQ0lORyAgICAgICAgICAgICAgICAgICAgICAgICAiZ0VuYWJsZUJNVUhXdHJhY2luZyIKKyNkZWZpbmUgQ0ZHX0VOQUJMRV9CTVVIV19UUkFDSU5HX01JTiAgICAgICAgICAgICAgICAgICAgICgwKQorI2RlZmluZSBDRkdfRU5BQkxFX0JNVUhXX1RSQUNJTkdfTUFYICAgICAgICAgICAgICAgICAgICAgKDEpCisjZGVmaW5lIENGR19FTkFCTEVfQk1VSFdfVFJBQ0lOR19ERUZBVUxUICAgICAgICAgICAgICAgICAoMSkKKworI2RlZmluZSBDRkdfRU5BQkxFX0ZXX0xPR0dJTkcgICAgICAgICAgICAgICAgICAgICAgICAgICAgImdFbmFibGVGV0xvZ2dpbmciCisjZGVmaW5lIENGR19FTkFCTEVfRldfTE9HR0lOR19NSU4gICAgICAgICAgICAgICAgICAgICAgICAoMCkKKyNkZWZpbmUgQ0ZHX0VOQUJMRV9GV19MT0dHSU5HX01BWCAgICAgICAgICAgICAgICAgICAgICAgICgxKQorI2RlZmluZSBDRkdfRU5BQkxFX0ZXX0xPR0dJTkdfREVGQVVMVCAgICAgICAgICAgICAgICAgICAgKDEpCisKKy8vIGZpcm13YXJlIHdpbGwgd2FrZXVwIHRoZSBob3N0IHRvIHNlbmQgbG9ncyBhbHdheXMKKyNkZWZpbmUgQ0ZHX0VOQUJMRV9GV19DT05USU5JT1VTX0xPR0dJTkcgICAgICAgICAgICAgICAgICJnRW5hYmxlQ29udEZXTG9nZ2luZyIKKyNkZWZpbmUgQ0ZHX0VOQUJMRV9GV19DT05USU5JT1VTX0xPR0dJTkdfTUlOICAgICAgICAgICAgICgwKQorI2RlZmluZSBDRkdfRU5BQkxFX0ZXX0NPTlRJTklPVVNfTE9HR0lOR19NQVggICAgICAgICAgICAgKDEpCisjZGVmaW5lIENGR19FTkFCTEVfRldfQ09OVElOSU9VU19MT0dHSU5HX0RFRkFVTFQgICAgICAgICAoMCkKKworLyogd2hlbiBmaXJtd2FyZSBsb2cgcmVhY2hlcyB0aGlzIHRocmVzaG9sZCBhbmQKKyAqIGlmIGhvc3QgaXMgYXdha2UgaXQgd2lsbCBwdXNoIHRoZSBsb2dzLgorICovCisjZGVmaW5lIENGR19NSU5fTE9HR0lOR19CVUZGRVJfU0laRSAgICAgICAgICAgICAgICAgICAgICAiZ01pbkxvZ2dpbmdCdWZmZXJTaXplIgorI2RlZmluZSBDRkdfTUlOX0xPR0dJTkdfQlVGRkVSX1NJWkVfTUlOICAgICAgICAgICAgICAgICAgKDApCisjZGVmaW5lIENGR19NSU5fTE9HR0lOR19CVUZGRVJfU0laRV9NQVggICAgICAgICAgICAgICAgICAoNikKKyNkZWZpbmUgQ0ZHX01JTl9MT0dHSU5HX0JVRkZFUl9TSVpFX0RFRkFVTFQgICAgICAgICAgICAgICgxKQorCisvLyBNYXggcmluZyBzaXplIGluIGZpcm13YXJlIHRvIGxvZyBtc2dzIHdoZW4gaG9zdCBpcyBzdXNwZW5kZWQgc3RhdGUKKyNkZWZpbmUgQ0ZHX01BWF9MT0dHSU5HX0JVRkZFUl9TSVpFICAgICAgICAgICAgICAgICAgICAgICJnTWF4TG9nZ2luZ0J1ZmZlclNpemUiCisjZGVmaW5lIENGR19NQVhfTE9HR0lOR19CVUZGRVJfU0laRV9NSU4gICAgICAgICAgICAgICAgICAoMCkKKyNkZWZpbmUgQ0ZHX01BWF9MT0dHSU5HX0JVRkZFUl9TSVpFX01BWCAgICAgICAgICAgICAgICAgICg2KQorI2RlZmluZSBDRkdfTUFYX0xPR0dJTkdfQlVGRkVSX1NJWkVfREVGQVVMVCAgICAgICAgICAgICAgKDYpCisKKyNkZWZpbmUgQ0ZHX0VOQUJMRV9DSF9BVk9JRCAgICAgICAgICAgICAgICAgICA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ENvbmM7ICAgLy9udW1iZXIgb2YgY2hhbm5lbHMgY29tYmluZWQgZm9yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1AyUCBpbiBlYWNoIHNwbGl0IHNjYW4gb3BlcmF0aW9uCisjZW5kaWYKKworICAgdl9VOF90ICAgICAgICAgbk1heFBzUG9sbDsKKworICAgdl9VOF90ICAgICAgICAgblJzc2lGaWx0ZXJQZXJpb2Q7CisgICB2X0JPT0xfdCAgICAgICBmSWdub3JlRHRpbTsKKyAgIHZfVThfdCAgICAgICAgIGZNYXhMSU1vZHVsYXRlZERUSU07CisKKyAgIHZfVThfdCAgICAgICAgIG5SeEFudDsKKyAgIHZfVThfdCAgICAgICAgIGZFbmFibGVGd0hlYXJ0QmVhdE1vbml0b3Jpbmc7CisgICB2X1U4X3QgICAgICAgICBmRW5hYmxlRndCZWFjb25GaWx0ZXJpbmc7CisgICB2X0JPT0xfdCAgICAgICBmRW5hYmxlRndSc3NpTW9uaXRvcmluZzsKKyAgIHZfVThfdCAgICAgICAgIG5EYXRhSW5hY3Rpdml0eVRpbWVvdXQ7CisgICB2X1U4X3QgICAgICAgICBudGhCZWFjb25GaWx0ZXI7CisKKyAgIC8vV01NIFFvUyBDb25maWd1cmF0aW9uCisgICBoZGRfd21tX3VzZXJfbW9kZV90ICAgICAgICAgIFdtbU1vZGU7CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgIGI4MDIxMWVJc0VuYWJsZWQ7CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgIFVhcHNkTWFzazsgICAgLy8gd2hhdCBBQ3MgdG8gc2V0dXAgVS1BUFNEIGZvciBhdCBhc3NvYworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgICBJbmZyYVVhcHNkVm9TcnZJbnR2OworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgICBJbmZyYVVhcHNkVm9TdXNwSW50djsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICAgSW5mcmFVYXBzZFZpU3J2SW50djsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICAgSW5mcmFVYXBzZFZpU3VzcEludHY7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgIEluZnJhVWFwc2RCZVNydkludHY7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgIEluZnJhVWFwc2RCZVN1c3BJbnR2OworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgICBJbmZyYVVhcHNkQmtTcnZJbnR2OworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgICBJbmZyYVVhcHNkQmtTdXNwSW50djsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fTEZSCisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgIGlzRmFzdFJvYW1JbmlGZWF0dXJlRW5hYmxlZDsKKyAgIHZfQk9PTF90ICAgICAgICAgICAgICAgICAgICAgTUFXQ0VuYWJsZWQ7CisjZW5kaWYKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgIEluZnJhSW5hY3Rpdml0eUludGVydmFsOworICAgdl9CT09MX3QgICAgICAgICAgICAgICAgICAgICBpc0VzZUluaUZlYXR1cmVFbmFibGVkOworI2VuZGlmCisjaWYgIGRlZmluZWQgKFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSKSB8fCBkZWZpbmVkIChGRUFUVVJFX1dMQU5fRVNFKSB8fCBkZWZpbmVkKEZFQVRVUkVfV0xBTl9MRlIpCisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgIGlzRmFzdFRyYW5zaXRpb25FbmFibGVkOworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgICBSb2FtUnNzaURpZmY7CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgIG5JbW1lZGlhdGVSb2FtUnNzaURpZmY7CisgICB2X0JPT0xfdCAgIC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AgICAgICAgICAgICAgICAgICAgSW5mcmFNZWFuRGF0YVJhdGVBY1ZpOworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgICBJbmZyYU1pblBoeVJhdGVBY1ZpOworICAgdl9VMTZfdCAgICAgICAgICAgICAgICAgICAgICBJbmZyYVNiYUFjVmk7CisKKyAgIC8qIGRlZmF1bHQgVFNQRUMgcGFyYW1ldGVycyBmb3IgQUNfQkUgKi8KKyAgIHNtZV9Rb3NXbW1EaXJUeXBlICAgICAgICAgICAgSW5mcmFEaXJBY0JlOworICAgdl9VMTZfdCAgICAgICAgICAgICAgICAgICAgICBJbmZyYU5vbU1zZHVTaXplQWNCZTsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICAgSW5mcmFNZWFuRGF0YVJhdGVBY0JlOworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgICBJbmZyYU1pblBoeVJhdGVBY0JlOworICAgdl9VMTZfdCAgICAgICAgICAgICAgICAgICAgICBJbmZyYVNiYUFjQmU7CisKKyAgIC8qIGRlZmF1bHQgVFNQRUMgcGFyYW1ldGVycyBmb3IgQUNfQksgKi8KKyAgIHNtZV9Rb3NXbW1EaXJUeXBlICAgICAgICAgICAgSW5mcmFEaXJBY0JrOworICAgdl9VMTZfdCAgICAgICAgICAgICAgICAgICAgICBJbmZyYU5vbU1zZHVTaXplQWNCazsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICAgSW5mcmFNZWFuRGF0YVJhdGVBY0JrOworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgICBJbmZyYU1pblBoeVJhdGVBY0JrOworICAgdl9VMTZfdCAgICAgICAgICAgICAgICAgICAgICBJbmZyYVNiYUFjQms7CisKKyAgIC8qIFRMIHJlbGF0ZWQgY29uZmlndXJhdGlvbiAqLworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgICBXZnFCa1dlaWdodDsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICAgV2ZxQmVXZWlnaHQ7CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgIFdmcVZpV2VpZ2h0OworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgICBXZnFWb1dlaWdodDsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICAgRGVsYXllZFRyaWdnZXJGcm1JbnQ7CisgICB2X1UxNl90ICAgICAgICAgICAgICAgICAgICAgIEJrUmVvcmRlckFnaW5nVGltZTsKKyAgIHZfVTE2X3QgICAgICAgICAgICAgICAgICAgICAgQmVSZW9yZGVyQWdpbmdUaW1lOworICAgdl9VMTZfdCAgICAgICAgICAgICAgICAgICAgICBWaVJlb3JkZXJBZ2luZ1RpbWU7CisgICB2X1UxNl90ICAgICAgICAgICAgICAgICAgICAgIFZvUmVvcmRlckFnaW5nVGltZTsKKworICAgLyogV293bCBwYXR0ZXJuICovCisgICBjaGFyICAgICAgICAgICAgICAgICAgICAgICAgd293bFBhdHRlcm5bMTAyNF07ICAgICAgICAgCisKKyAgIC8qIENvbnRyb2wgZm9yIFJlcGxheSBjb3VuZXRyLiB2YWx1ZSAxIG1lYW5zIAorICAgICAgc2luZ2xlIHJlcGxheSBjb3VudGVyIGZvciBhbGwgVElEKi8KKyAgIHZfQk9PTF90ICAgICAgICAgICAgICAgICAgICBiU2luZ2xlVGlkUmM7CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgbWNhc3RCY2FzdEZpbHRlclNldHRpbmc7CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgZmhvc3RBcnBPZmZsb2FkOworICAgdl9CT09MX3QgICAgICAgICAgICAgICAgICAgIGZob3N0TlNPZmZsb2FkOworICAgdl9CT09MX3QgICAgICAgICAgICAgICAgICAgIGJ1cnN0U2l6ZURlZmluaXRpb247CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgdHNJbmZvQWNrUG9saWN5OworICAgCisgICAvKiBSRiBTZXR0bGluZyBUaW1lIENsb2NrICovCisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgcmZTZXR0bGluZ1RpbWVVczsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICBlbmFibGVCdEFtcDsKKyNpZmRlZiBXTEFOX0JUQU1QX0ZFQVRVUkUKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICBwcmVmZXJyZWRDaGFubmVsOworI2VuZGlmIC8vV0xBTl9CVEFNUF9GRUFUVVJFCisKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICBkeW5hbWljUHNQb2xsVmFsdWU7CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgQWRkVFNXaGVuQUNNSXNPZmY7CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgZlZhbGlkYXRlU2Nhbkxpc3Q7CisKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICBpbmZyYVN0YUtlZXBBbGl2ZVBlcmlvZDsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICBuTnVsbERhdGFBcFJlc3BUaW1lb3V0OworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgIG5CYW5kQ2FwYWJpbGl0eTsKKworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgIGFwRGF0YUF2YWlsUG9sbFBlcmlvZEluTXM7CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgZkVuYWJsZUJlYWNvbkVhcmx5VGVybWluYXRpb247CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgdGVsZUJjbldha2V1cEVuOworCisvKiBWT1MgVHJhY2UgQ29udHJvbCovCisgICB2X1UxNl90ICAgICAgICAgICAgICAgICAgICAgdm9zVHJhY2VFbmFibGVCQVA7CisgICB2X1UxNl90ICAgICAgICAgICAgICAgICAgICAgdm9zVHJhY2VFbmFibGVUTDsKKyAgIHZfVTE2X3QgICAgICAgICAgICAgICAgICAgICB2b3NUcmFjZUVuYWJsZVdESTsKKyAgIHZfVTE2X3QgICAgICAgICAgICAgICAgICAgICB2b3NUcmFjZUVuYWJsZUhERDsKKyAgIHZfVTE2X3QgICAgICAgICAgICAgICAgICAgICB2b3NUcmFjZUVuYWJsZVNNRTsKKyAgIHZfVTE2X3QgICAgICAgICAgICAgICAgICAgICB2b3NUcmFjZUVuYWJsZVBFOworICAgdl9VMTZfdCAgICAgICAgICAgICAgICAgICAgIHZvc1RyYWNlRW5hYmxlUE1DOworICAgdl9VMTZfdCAgICAgICAgICAgICAgICAgICAgIHZvc1RyYWNlRW5hYmxlV0RBOworICAgdl9VMTZfdCAgICAgICAgICAgICAgICAgICAgIHZvc1RyYWNlRW5hYmxlU1lTOworICAgdl9VMTZfdCAgICAgICAgICAgICAgICAgICAgIHZvc1RyYWNlRW5hYmxlVk9TUzsKKyAgIHZfVTE2X3QgICAgICAgICAgICAgICAgICAgICB2b3NUcmFjZUVuYWJsZVNBUDsKKyAgIHZfVTE2X3QgICAgICAgICAgICAgICAgICAgICB2b3NUcmFjZUVuYWJsZUhERFNBUDsKKworICAgLyogV0RJIFRyYWNlIENvbnRyb2wgKi8KKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICB3ZGlUcmFjZUVuYWJsZURBTDsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICB3ZGlUcmFjZUVuYWJsZUNUTDsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICB3ZGlUcmFjZUVuYWJsZURBVDsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICB3ZGlUcmFjZUVuYWJsZVBBTDsKKyAgIHZfVTE2X3QgICAgICAgICAgICAgICAgICAgICBuVGVsZUJjblRyYW5zTGlzdGVuSW50ZXJ2YWw7CisgICB2X1UxNl90ICAgICAgICAgICAgICAgICAgICAgblRlbGVCY25NYXhMaXN0ZW5JbnRlcnZhbDsKKyAgIHZfVTE2X3QgICAgICAgICAgICAgICAgICAgICBuVGVsZUJjblRyYW5zTGlOdW1JZGxlQmVhY29uczsKKyAgIHZfVTE2X3QgICAgICAgICAgICAgICAgICAgICBuVGVsZUJjbk1heExpTnVtSWRsZUJlYWNvbnM7CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgYmNuRWFybHlUZXJtV2FrZUludGVydmFsOworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgIGVuYWJsZUNsb3NlTG9vcDsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICBlbmFibGVCeXBhc3MxMWQ7CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgZW5hYmxlREZTQ2hubFNjYW47CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgZW5hYmxlREZTUG5vQ2hubFNjYW47CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgZW5hYmxlRHluYW1pY0RUSU07CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgZW5hYmxlQXV0b21hdGljVHhQb3dlckNvbnRyb2w7CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgU2hvcnRHSTQwTWh6RW5hYmxlOworICAgZUhkZExpbmtTcGVlZFJlcG9ydFR5cGUgICAgIHJlcG9ydE1heExpbmtTcGVlZDsKKyAgIHZfUzMxX3QgICAgICAgICAgICAgICAgICAgICBsaW5rU3BlZWRSc3NpSGlnaDsKKyNpZiAgZGVmaW5lZCAoV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIpIHx8IGRlZmluZWQgKEZFQVRVUkVfV0xBTl9FU0UpIHx8IGRlZmluZWQoRkVBVFVSRV9XTEFOX0xGUikKKyAgIHZfQk9PTF90ICAgICAgICAgICAgICAgICAgICBuUm9hbVByZWZlcjVHSHo7CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgblJvYW1JbnRyYUJhbmQ7CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgblByb2JlczsKKyAgIHZfVTE2X3QgICAgICAgICAgICAgICAgICAgICBuUm9hbVNjYW5Ib21lQXdheVRpbWU7CisjZW5kaWYKKyAgIHZfUzMxX3QgICAgICAgICAgICAgICAgICAgICBsaW5rU3BlZWRSc3NpTWlkOworICAgdl9TMzFfdCAgICAgICAgICAgICAgICAgICAgIGxpbmtTcGVlZFJzc2lMb3c7CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgZW5hYmxlTUNDOworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgIGFsbG93TUNDR09EaWZmQkk7CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgaXNQMnBEZXZpY2VBZGRyQWRtaW5pc3RyYXRlZDsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICB0aGVybWFsTWl0aWdhdGlvbkVuYWJsZTsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgIHZodENoYW5uZWxXaWR0aDsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICB2aHRSeE1DUzsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICB2aHRUeE1DUzsKKyAgIHZfQk9PTF90ICAgICAgICAgICAgICAgICAgICBlbmFibGVUeEJGOworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgIHR4QkZDc25WYWx1ZTsKKyAgIHZfQk9PTF90ICAgICAgICAgICAgICAgICAgICBlbmFibGVNdUJmb3JtZWU7CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgZ1ZodE1heEFtcGR1TGVuRXhwOworI2VuZGlmCisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgZW5hYmxlTW9kdWxhdGVkRFRJTTsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICBmRW5hYmxlTUNBZGRyTGlzdDsKKyAgIHZfQk9PTF90ICAgICAgICAgICAgICAgICAgICBlbmFibGVGaXJzdFNjYW4yR09ubHk7CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgc2tpcERmc0NobmxJblAycFNlYXJjaDsKKyAgIHZfQk9PTF90ICAgICAgICAgICAgICAgICAgICBpZ25vcmVEeW5hbWljRHRpbUluUDJwTW9kZTsKKyAgIHZfVTE2X3QgICAgICAgICAgICAgICAgICAgICBjb25maWdNY2NQYXJhbTsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICBudW1CdWZmQWR2ZXJ0OworICAgdl9CT09MX3QgICAgICAgICAgICAgICAgICAgIGVuYWJsZVJ4U1RCQzsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUyAgICAgICAKKyAgIHZfQk9PTF90ICAgICAgICAgICAgICAgICAgICBmRW5hYmxlVERMU1N1cHBvcnQ7CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgZkVuYWJsZVRETFNJbXBsaWNpdFRyaWdnZXI7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgZlRETFNUeFN0YXRzUGVyaW9kOworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgIGZURExTVHhQYWNrZXRUaHJlc2hvbGQ7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgZlRETFNEaXNjb3ZlcnlQZXJpb2Q7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgZlRETFNNYXhEaXNjb3ZlcnlBdHRlbXB0OworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgIGZURExTSWRsZVRpbWVvdXQ7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgZlRETFNJZGxlUGFja2V0VGhyZXNob2xkOworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgIGZURExTUlNTSUh5c3RlcmVzaXM7CisgICB2X1MzMV90ICAgICAgICAgICAgICAgICAgICAgZlRETFNSU1NJVHJpZ2dlclRocmVzaG9sZDsKKyAgIHZfUzMxX3QgICAgICAgICAgICAgICAgICAgICBmVERMU1JTU0lUZWFyZG93blRocmVzaG9sZDsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICBmVERMU1VhcHNkTWFzazsgICAgLy8gd2hhdCBBQ3MgdG8gc2V0dXAgVS1BUFNEIGZvciBURExTCisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgZkVuYWJsZVRETFNCdWZmZXJTdGE7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgZlRETFNQdWFwc2RJbmFjdGl2aXR5VGltZXI7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgZlRETFNSeEZyYW1lVGhyZXNob2xkOworICAgdl9CT09MX3QgICAgICAgICAgICAgICAgICAgIGZURExTRXh0ZXJuYWxDb250cm9sOworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgIGZFbmFibGVURExTT2ZmQ2hhbm5lbDsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICBmRW5hYmxlVERMU1dtbU1vZGU7CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgZkVuYWJsZVRETFNTY2FuQ29leFN1cHBvcnQ7CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgZkVuYWJsZVRETFNTY2FuOworI2VuZGlmCisjaWZkZWYgV0xBTl9GRUFUVVJFX0xJTktfTEFZRVJfU1RBVFMKKyAgIHZfQk9PTF90ICAgICAgICAgICAgICAgICAgICBmRW5hYmxlTExTdGF0czsKKyNlbmRpZgorI2lmZGVmIFdMQU5fRkVBVFVSRV9FWFRTQ0FOCisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgZkVuYWJsZUVYVFNjYW47CisjZW5kaWYKKyNpZmRlZiBXTEFOX1NPRlRBUF9WU1RBX0ZFQVRVUkUKKyAgIHZfQk9PTF90ICAgICAgICAgICAgICAgICAgICBmRW5hYmxlVlNUQVN1cHBvcnQ7CisjZW5kaWYKKyNpZmRlZiBXTEFOX0FDVElWRU1PREVfT0ZGTE9BRF9GRUFUVVJFCisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgZkVuYWJsZUFjdGl2ZU1vZGVPZmZsb2FkOworI2VuZGlmCisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgZW5hYmxlTHB3ckltZ1RyYW5zaXRpb247CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgc2NhbkFnaW5nVGltZW91dDsKKyAgIHZfQk9PTF90ICAgICAgICAgICAgICAgICAgICBlbmFibGVUeExkcGM7CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgZGlzYWJsZUxEUENXaXRoVHhiZkFQOworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgIGVuYWJsZU1DQ0FkYXB0aXZlU2NoZWR1bGVyOworICAgdl9CT09MX3QgICAgICAgICAgICAgICAgICAgIGlzQW5kcm9pZFBzRW47CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgc2FwQWxsb3dBbGxDaGFubmVsOworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgIHJldHJ5TGltaXRaZXJvOworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgIHJldHJ5TGltaXRPbmU7CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgcmV0cnlMaW1pdFR3bzsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICBkaXNhYmxlQWdnV2l0aEJ0YzsKKyAgIGNoYXIgICAgICAgICAgICAgICAgICAgICAgICBsaXN0T2ZOb25EZnNDb3VudHJ5Q29kZVsxMjhdOworICAgdl9CT09MX3QgICAgICAgICAgICAgICAgICAgIGVuYWJsZVNTUjsKKyAgIGNoYXIgICAgICAgICAgICAgICAgICAgICAgICBsaXN0T2ZOb24xMWFjQ291bnRyeUNvZGVbMTI4XTsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICBjZmdNYXhNZWRpdW1UaW1lOworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgIGVuYWJsZVRyYWZmaWNNb25pdG9yOworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgIHRyYWZmaWNJZGxlVGltZW91dDsKKyAgIHZfQk9PTF90ICAgICAgICAgICAgICAgICAgICBlbmFibGVWaHRGb3IyNEdIekJhbmQ7CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgZlNjYW5PZmZsb2FkOworI2lmZGVmIFdMQU5fRkVBVFVSRV9ST0FNX1NDQU5fT0ZGTE9BRAorICAgLyogRmxhZyBpbmRpY2F0aW5nIHdoZXRoZXIgbGVnYWN5IGZhc3Qgcm9hbSBkdXJpbmcgY29uY3VycmVuY3kgaXMgZW5hYmxlZCBpbiBjZmcuaW5pIG9yIG5vdCAqLworICAgdl9CT09MX3QgICAgICAgICAgICAgICAgICAgIGJGYXN0Um9hbUluQ29uSW5pRmVhdHVyZUVuYWJsZWQ7CisjZW5kaWYKKyAgIHZfQk9PTF90ICAgICAgICAgICAgICAgICAgICBmRW5hYmxlQWRhcHRSeERyYWluOworICAgLy9UWCBhbmQgUlggdHJhZmZpYyB0aHJlc2hvbGQgZm9yIHNwbGl0IHNjYW4KKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICB0eFJ4VGhyZXNob2xkRm9yU3BsaXRTY2FuOworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgIGR5blNwbGl0c2NhbjsgICAvL0VuYWJsZS9EaXNhYmxlIGR5bmFtaWMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3NwbGl0c2NhbgorICAgLy9UcmFmZmljIG1vbml0b3IgdGltZXIgZm9yIHNwbGl0IHNjYW4KKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICB0cmFmZmljTW50clRtckZvclNwbGl0U2NhbjsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICBmbGV4Q29ubmVjdFBvd2VyRmFjdG9yOworICAgdl9CT09MX3QgICAgICAgICAgICAgICAgICAgIGVuYWJsZUlic3NIZWFydEJlYXRPZmZsb2FkOworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgIGFudGVubmFEaXZlcnNpdHk7CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgZkVuYWJsZVNOUk1vbml0b3Jpbmc7CisgICAvKlBOTyByZWxhdGVkIHBhcmFtZXRlcnMgKi8KKyNpZmRlZiBGRUFUVVJFX1dMQU5fU0NBTl9QTk8KKyAgIHZfQk9PTF90ICAgICAgICAgICAgICAgICAgICBjb25maWdQTk9TY2FuU3VwcG9ydDsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICBjb25maWdQTk9TY2FuVGltZXJSZXBlYXRWYWx1ZTsKKyNlbmRpZgorICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgIGlzQW1zZHVTdXBwb3J0SW5BTVBEVTsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICBuU2VsZWN0NUdIek1hcmdpbjsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICBpc0NvYWxlc2luZ0luSUJTU0FsbG93ZWQ7CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgY2ZnQXRoRGlzYWJsZTsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICBjZmdCdGNBY3RpdmVXbGFuTGVuOworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgIGNmZ0J0Y0FjdGl2ZUJ0TGVuOworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgIGNmZ0J0Y1NhcEFjdGl2ZVdsYW5MZW47CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgY2ZnQnRjU2FwQWN0aXZlQnRMZW47CisjaWZkZWYgTUVNT1JZX0RFQlVHCisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgSXNNZW1vcnlEZWJ1Z1N1cHBvcnRFbmFibGVkOworI2VuZGlmCisgICBjaGFyICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcnJpZGVDb3VudHJ5Q29kZVs0XTsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICBnQXNkUHJvYmVJbnRlcnZhbDsKKyAgIHZfUzdfdCAgICAgICAgICAgICAgICAgICAgICBnQXNkVHJpZ2dlclRocmVzaG9sZDsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICBnQXNkUlRUUnNzaUh5c3RUaHJlc2hvbGQ7CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgZGVidWdQMnBSZW1haW5PbkNoYW5uZWw7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgY2ZnQnRjQ1RTMlNkdXJpbmdTQ087CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgZ0VuYWJsZURlYnVnTG9nOworICAgdl9VMTZfdCAgICAgICAgICAgICAgICAgICAgIG5PQlNTU2NhbkFjdGl2ZUR3ZWxsVGltZTsKKyAgIHZfVTE2X3QgICAgICAgICAgICAgICAgICAgICBuT0JTU1NjYW5QYXNzaXZlRHdlbGxUaW1lOworICAgdl9VMTZfdCAgICAgICAgICAgICAgICAgICAgIG5PQlNTU2NhbldpZHRoVHJpZ2dlckludGVydmFsOworICAgdl9CT09MX3QgICAgICAgICAgICAgICAgICAgIGdFbmFibGVTdHJpY3RSZWd1bGF0b3J5Rm9yRkNDOworICAgdl9CT09MX3QgICAgICAgICAgICAgICAgICAgIGFkdmVydGlzZUNvbmN1cnJlbnRPcGVyYXRpb247CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdFJhdGVJbmRleDI0R2h6OworICAgdl9CT09MX3QgICAgICAgICAgICAgICAgICAgIHNhcEVuYWJsZTExQUM7CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgY2ZnUkFGaWx0ZXJFbmFibGU7CisgICB2X1UxNl90ICAgICAgICAgICAgICAgICAgICAgY2ZnUkFSYXRlTGltaXRJbnRlcnZhbDsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICBhbGxvd0RGU0NoYW5uZWxSb2FtOworCisjaWZkZWYgV0xBTl9MT0dHSU5HX1NPQ0tfU1ZDX0VOQUJMRQorICAgLy9XTEFOIExvZ2dpbmcKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICB3bGFuTG9nZ2luZ0VuYWJsZTsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICB3bGFuTG9nZ2luZ0ZFVG9Db25zb2xlOworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgIHdsYW5Mb2dnaW5nTnVtQnVmOworI2VuZGlmCisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgaWdub3JlUGVlckVycEluZm87CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgaW5pdGlhbFNjYW5Ta2lwREZTQ2g7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgY2ZnQnRjRmF0YWxIaWRuU25pZmZCbGtHdWlkYW5jZTsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICBjZmdCdGNDcml0aWNhbEhpZG5TbmlmZkJsa0d1aWRhbmNlOworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgIGNmZ0J0Y0EyZHBUeFF1ZXVlVGhvbGQ7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgY2ZnQnRjT3BwVHhRdWV1ZVRob2xkOworCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgIHBtZlNhUXVlcnlNYXhSZXRyaWVzOworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgIHBtZlNhUXVlcnlSZXRyeUludGVydmFsOworI2VuZGlmCisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgZGVmZXJJbXBzVGltZTsKKyAgIHZfQk9PTF90ICAgICAgICAgICAgICAgICAgICBzZW5kRGVhdXRoQmVmb3JlQ29uOworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgIGVuYWJsZU1hY1Nwb29maW5nOworICAgdl9CT09MX3QgICAgICAgICAgICAgICAgICAgIGRpc2FibGVQMlBNYWNTcG9vZmluZzsKKyAgIHZfQk9PTF90ICAgICAgICAgICAgICAgICAgICBlbmFibGVNZ210TG9nZ2luZzsKKyAgIHZfQk9PTF90ICAgICAgICAgICAgICAgICAgICBlbmFibGVCTVVIV3RyYWNpbmc7CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgZW5hYmxlRldMb2dnaW5nOworICAgdl9CT09MX3QgICAgICAgICAgICAgICAgICAgIGVuYWJsZUNvbnRGV0xvZ2dpbmc7CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgbWluTG9nZ2luZ0J1ZmZlclNpemU7CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgbWF4TG9nZ2luZ0J1ZmZlclNpemU7CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgZmVuYWJsZUNIQXZvaWRhbmNlOworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgIGdNYXhDb25jdXJyZW50QWN0aXZlU2Vzc2lvbnM7CisKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICBlbmFibGVEeW5hbWljV01NUFM7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgbWF4VWFwc2RDb25zZWNTUDsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICBtYXhVYXBzZENvbnNlY1J4Q250OworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgIG1heFVhcHNkQ29uc2VjVHhDbnQ7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgdWFwc2RDb25zZWNSeENudE1lYXNXaW5kb3c7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgdWFwc2RDb25zZWNUeENudE1lYXNXaW5kb3c7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgbWF4UHNQb2xsSW5XbW1VYXBzZE1vZGU7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgbWF4VWFwc2RJbmFjdGl2aXR5SW50ZXJ2YWxzOworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgIGJ1cnN0TW9kZVRYT1BWYWx1ZTsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICBhY3NTY2FuQmFuZFByZWZlcmVuY2U7CisgICB2X1UxNl90ICAgICAgICAgICAgICAgICAgICAgYWNzQmFuZFN3aXRjaFRocmVzaG9sZDsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICBlbmFibGVEeW5hbWljUkFTdGFydFJhdGU7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgZW5hYmxlUnRzQ3RzSHRWaHQ7CisjaWZkZWYgV0xBTl9GRUFUVVJFX0FQX0hUNDBfMjRHCisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgYXBIVDQwXzI0R0VuYWJsZWQ7CisjZW5kaWYKKyAgIHZfVTE2X3QgICAgICAgICAgICAgICAgICAgICBnUDJQTGlzdGVuRGVmZXJJbnRlcnZhbDsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICBidGNFbmFibGVJbmRUaW1lclZhbDsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICBidGNGYXN0V2xhbkNvbm5QcmVmOworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgIGR4ZVJlcGxlbmlzaFJYVGltZXJWYWw7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgZHhlU1NSRW5hYmxlOworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgIG11bHRpY2FzdF9ob3N0X21zZ3M7CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgdG9nZ2xlQXJwQkRSYXRlczsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICBidGNTdGF0aWNPcHBXbGFuSWRsZVdsYW5MZW47CisgIC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FQ0tfQVNTVU1FX01JTk1BWCAoIFZBUl9GTEFHU19SQU5HRV9DSEVDSyApCisKKyNkZWZpbmUgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxUICggMSA8PCAyICkgIC8vIGJpdCAyIGlzIHJhbmdlIGNoZWNraW5nIHRoYXQgYXNzdW1lcyB0aGUgREVGQVVMVCB2YWx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgbGVzcyB0aGFuIE1JTiwgYXNzdW1lIERFRkFVTFQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiBncmF0ZWVyIHRoYW4gTUFYLCBhc3N1bWUgREVGQVVMVC4KKworI2RlZmluZSBWQVJfRkxBR1NfRFlOQU1JQ19DRkcgKCAxIDw8IDMgKSAgLy8gQml0IDMgaW5kaWNhdGVzIHRoYXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBjb25maWcgaXRlbSBjYW4gYmUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1vZGlmaWVkIGR5bmFtaWNpYWxseQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gb24gYSBydW5uaW5nIHN5c3RlbQorCit0eXBlZGVmIGVudW0gCit7CisgIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgV0xBTl9QQVJBTV9TaWduZWRJbnRlZ2VyLAorICBXTEFOX1BBUkFNX0hleEludGVnZXIsCisgIFdMQU5fUEFSQU1fU3RyaW5nLAorICBXTEFOX1BBUkFNX01hY0FkZHIsCit9V0xBTl9QQVJBTUVURVJfVFlQRTsKKworI2RlZmluZSBSRUdfVkFSSUFCTEUoIF9OYW1lLCBfVHlwZSwgIF9TdHJ1Y3QsIF9WYXJOYW1lLCAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgX0ZsYWdzLCBfRGVmYXVsdCwgX01pbiwgX01heCApICAgICAgICAgICAgIFwKK3sgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAoIF9OYW1lICksICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICggX1R5cGUgKSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgKCBfRmxhZ3MgKSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICBWQVJfT0ZGU0VUKCBfU3RydWN0LCBfVmFyTmFtZSApLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgIFZBUl9TSVpFKCBfU3RydWN0LCBfVmFyTmFtZSApLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgKCBfRGVmYXVsdCApLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAoIF9NaW4gKSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICggX01heCApLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgTlVMTCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCit9CisKKyNkZWZpbmUgUkVHX0RZTkFNSUNfVkFSSUFCTEUoIF9OYW1lLCBfVHlwZSwgIF9TdHJ1Y3QsIF9WYXJOYW1lLCAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX0ZsYWdzLCBfRGVmYXVsdCwgX01pbiwgX01heCwgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfQ0JGdW5jLCBfQ0JQYXJhbSApICAgICAgICAgICAgICAgIFwKK3sgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAoIF9OYW1lICksICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICggX1R5cGUgKSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgKCBWQVJfRkxBR1NfRFlOQU1JQ19DRkcgfCAoIF9GbGFncyApICksICAgICAgICAgICAgICAgICAgICAgICAgXAorICBWQVJfT0ZGU0VUKCBfU3RydWN0LCBfVmFyTmFtZSApLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgIFZBUl9TSVpFKCBfU3RydWN0LCBfVmFyTmFtZSApLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgKCBfRGVmYXVsdCApLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAoIF9NaW4gKSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICggX01heCApLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgKCBfQ0JGdW5jICksICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAoIF9DQlBhcmFtICkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCit9CisKKyNkZWZpbmUgUkVHX1ZBUklBQkxFX1NUUklORyggX05hbWUsIF9UeXBlLCAgX1N0cnVjdCwgX1Zhck5hbWUsICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfRmxhZ3MsIF9EZWZhdWx0ICkgICAgICAgICAgICAgICAgICBcCit7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgKCBfTmFtZSApLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAoIF9UeXBlICksICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICggX0ZsYWdzICksICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgVkFSX09GRlNFVCggX1N0cnVjdCwgX1Zhck5hbWUgKSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICBWQVJfU0laRSggX1N0cnVjdCwgX1Zhck5hbWUgKSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICh1bnNpZ25lZCBsb25nKSggX0RlZmF1bHQgKSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgMCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAwLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgIE5VTEwsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorfQorCit0eXBlZGVmIHN0cnVjdCB0UkVHX1RBQkxFX0VOVFJZIHsKKworICBjaGFyKiAgICAgICAgICAgICAgIFJlZ05hbWU7ICAgICAgICAgICAgLy8gdmFyaWFibGUgbmFtZSBpbiB0aGUgcWNvbV9jZmcuaW5pIGZpbGUKKyAgV0xBTl9QQVJBTUVURVJfVFlQRSBSZWdUeXBlO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LyogRXh0ZW5kZWQgU2NhbiBBUElzICovCisjZGVmaW5lIFdJRklfRkVBVFVSRV9OQU4gICAgICAgICAgICAgICAgMHgwMDQwICAgLyogTmVpZ2hib3IgQXdhcmVuZXNzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTmV0d29ya2luZyAqLworI2RlZmluZSBXSUZJX0ZFQVRVUkVfRDJEX1JUVCAgICAgICAgICAgIDB4MDA4MCAgIC8qIERldmljZS10by1kZXZpY2UgUlRUICovCisjZGVmaW5lIFdJRklfRkVBVFVSRV9EMkFQX1JUVCAgICAgICAgICAgMHgwMTAwICAgLyogRGV2aWNlLXRvLUFQIFJUVCAqLworI2RlZmluZSBXSUZJX0ZFQVRVUkVfQkFUQ0hfU0NBTiAgICAgICAgIDB4MDIwMCAgIC8qIEJhdGNoZWQgU2NhbiAobGVnYWN5KSAqLworI2RlZmluZSBXSUZJX0ZFQVRVUkVfUE5PICAgICAgICAgICAgICAgIDB4MDQwMCAgIC8qIFByZWZlcnJlZCBuZXR3b3JrIG9mZmxvYWQgKi8KKyNkZWZpbmUgV0lGSV9GRUFUVVJFX0FERElUSU9OQUxfU1RBICAgICAweDA4MDAgICAvKiBTdXBwb3J0IGZvciB0d28gU1RBcyAqLworI2RlZmluZSBXSUZJX0ZFQVRVUkVfVERMUyAgICAgICAgICAgICAgIDB4MTAwMCAgIC8qIFR1bm5lbCBkaXJlY3RlZCBsaW5rCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0dXAgKi8KKyNkZWZpbmUgV0lGSV9GRUFUVVJFX1RETFNfT0ZGQ0hBTk5FTCAgICAweDIwMDAgICAvKiBTdXBwb3J0IGZvciBURExTIG9mZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWwgKi8KKyNkZWZpbmUgV0lGSV9GRUFUVVJFX0VQUiAgICAgICAgIC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orICogREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NIExPU1MgT0YgVVNFLCBEQVRBIE9SCisgKiBQUk9GSVRTLCBXSEVUSEVSIElOIEFOIEFDVElPTiBPRiBDT05UUkFDVCwgTkVHTElHRU5DRSBPUiBPVEhFUgorICogVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmICFkZWZpbmVkKCBfX1dMQU5fSEREX0RQX1VUSUxTX0ggKQorI2RlZmluZSBfX1dMQU5fSEREX0RQX1VUSUxTX0gKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgd2xhbl9oZGRfZHBfdXRpbHMuaAorCisgIFxicmllZiAgICAgIFV0aWxpdHkgZnVuY3Rpb25zIGZvciBkYXRhIHBhdGggbW9kdWxlCisKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09KiovCisvKiAkSEVBREVSJCAqLworCisvKiotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBJbmN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k9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmbmRlZiBfX1dMQU5fSEREX0hPU1RfT0ZGTE9BRF9IX18KKyNkZWZpbmUgX19XTEFOX0hERF9IT1NUX09GRkxPQURfSF9fCisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIFxmaWxlICB3bGFuX2hkZF9ob3N0X29mZmxvYWQuaAorCisgIFxicmllZiBBbmRyb2lkIFdMQU4gSEREIEhvc3QgT2ZmbG9hZCBBUEkKKworCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyogT2ZmbG9hZCB0eXBlcy4gKi8KKyNkZWZpbmUgV0xBTl9JUFY0X0FSUF9SRVBMWV9PRkZMT0FEICAgICAgICAgICAwCisjZGVmaW5lIFdMQU5fSVBWNl9ORUlHSEJPUl9ESVNDT1ZFUllfT0ZGTE9BRCAgMQorCisvKiBFbmFibGUgb3IgZGlzYWJsZSBvZmZsb2FkLiAqLworI2RlZmluZSBXTEFOX09GRkxPQURfRElTQUJMRSAgICAgICAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgV0xBTl9PRkZMT0FEX0VOQUJMRSAgICAgICAgICAgICAgICAgICAgICAweDEKKyNkZWZpbmUgV0xBTl9PRkZMT0FEX0JDX0ZJTFRFUl9FTkFCTEUgICAgICAgICAgICAweDIKKyNkZWZ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cnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisjaWYgIWRlZmluZWQoIEhERF9JTkNMVURFU19IX18gKQorI2RlZmluZSBIRERfSU5DTFVERVNfSF9fCisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAKKyAgXGZpbGUgIHdsYW5faGRkX2luY2x1ZGVzLmgKKyAgCisgIFxicmllZiBJbnRlcm5hbCBpbmNsdWRlcyBmb3IgdGhlIExpbnV4IEhERCAKKyAgCisgIAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisgIAorLyogJEhFQURFUiQgKi8KKyAgCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAKKyAgSW5jbHVkZSBmaWxlcworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8gCisKKy8vIHRocm93IGFsbCB0aGUgaW5jbHVkZXMgaW4gaGVyZSBmIHRvIGdldCB0aGUgLmMgZmlsZXMgIGluIHRoZSBIREQgdG8gY29tcGlsZS4KKworI2luY2x1ZGUgPGxpbnV4L3ZlcnNpb24uaD4KKyNpbmNsdWRlIDxsaW51eC9tb2R1bGUuaD4KKyNpbmNsdWRlIDxsaW51eC9rZXJuZWwuaD4KKyNpbmNsdWRlIDxsaW51eC9pbml0Lmg+CisjaW5jbHVkZSA8bGludXgvd2lyZWxlc3MuaD4KKyNpbmNsdWRlIDxsaW51eC9pZl9hcnAuaD4K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pbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisjaWZuZGVmIF9fV0xBTl9IRERfS0VFUF9BTElWRV9IX18KKyNkZWZpbmUgX19XTEFOX0hERF9LRUVQX0FMSVZFX0hfXworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBcZmlsZSAgd2xhbl9oZGRfa2VlcF9hbGl2ZS5oCisKKyAgXGJyaWVmIEFuZHJvaWQgV0xBTiBIREQgS2VlcC1BbGl2ZSBBUEkKKworCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyogUGFja2V0IFR5cGVzLiAqLworI2RlZmluZSBXTEFOX0tFRVBfQUxJVkVfVU5TT0xJQ0lUX0FSUF9SU1AgICAgIDIKKyNkZWZpbmUgV0xBTl9LRUVQX0FMSVZFX05VTExfUEtUICAgICAgICAgICAgICAxCisKKy8qIEVuYWJsZSBvciBkaXNhYmxlIG9mZmxvYWQuICovCisjZGVmaW5lIFdMQU5fS0VFUF9BTElWRV9ESVNBQkxFICAgICAwCisjZGVmaW5lIFdMQU5fS0VFUF9BTElWRV9FTkFCTEUgICAgMHgxCisKKy8qIE9mZmxvYWQgcmVxdWVzdC4gKi8KK3R5cGVkZWYgc3RydWN0Cit7CisgICAgdl9VOF90IHBhY2tldFR5cGU7CisgICAgdl9VMzJfdCB0aW1lUGVyaW9kOworICAgIHZfVThfdCAgaG9zdElwdjRBZGRyWzRdOyAKKyAgICB2X1U4X3QgIGRlc3RJcHY0QW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X3dtbV9zdGF0dXNfdCBoZGRXbW1TdGF0dXM7CisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogVE9ETyAtIFJlbW92ZSBpdCBsYXRlcgorICovCisgICAgLyoqIE11bHRpcGxlIHN0YXRpb24gc3VwcG9ydHMgKi8KKyAgIC8qKiBQZXItc3RhdGlvbiBzdHJ1Y3R1cmUgKi8KKyAgIC8vdl9VOF90IHVOdW1BY3RpdmVTdGF0aW9uOworCisgICB2X1UxNl90IGFUeFF1ZXVlTGltaXRbTlVNX1RYX1FVRVVFU107CisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICovCisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fV0FQSQorICAgaGRkX3dhcGlfaW5mb190IHdhcGlfaW5mbzsKKyNlbmRpZgorICAgCisgICB2X1M3X3QgcnNzaTsKKyAgIHZfUzdfdCByc3NpX29uX2Rpc2Nvbm5lY3Q7CisKKyAgIHRBTklfVTggc25yOworCisgICBzdHJ1Y3Qgd29ya19zdHJ1Y3QgIG1vblR4V29ya1F1ZXVlOworICAgc3RydWN0IHNrX2J1ZmYgKnNrYl90b190eDsKKworICAgLyogc3RhX2lkIHRvIG1hYyBhZGRyIGhhc2gqLworICAgc3BpbmxvY2tfdCBzdGFfaGFzaF9sb2NrOworICAgdEFOSV9VOCBpc19zdGFfaWRfaGFzaF9pbml0aWFsaXplZDsKKyAgIHN0cnVjdCBzdGFfaGFzaHsKKyAgICAgIHRBTklfVTE2IG1hc2s7CisgICAgICB0QU5JX1UxNiBpZHhfYml0czsKKyAgICAgIGhkZF9saXN0X3QgKmJpbnM7CisgICB9IHN0YV9pZF9oYXNoOworCisgICB1bmlvbiB7CisgICAgICBoZGRfc3RhdGlvb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aW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmZGVmIEZFQVRVUkVfT0VNX0RBVEFfU1VQUE9SVAorCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgCisgIFxmaWxlICB3bGFuX2hkZF9vZW1kYXRhLmgKKyAgCisgIFxicmllZiBJbnRlcm5hbCBpbmNsdWRlcyBmb3IgdGhlIG9lbSBkYXRhCisgIAorICAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisKKyNpZm5kZWYgX19XTEFOX0hERF9PRU1fREFUQV9IX18KKyNkZWZpbmUgX19XTEFOX0hERF9PRU1fREFUQV9IX18KKworI2lmbmRlZiBPRU1fREFUQV9SRVFfU0laRQorI2RlZmluZSBPRU1fREFUQV9SRVFfU0laRSAxMzQKKyNlbmRpZgorCisjaWZuZGVmIE9FTV9EQVRBX1JTUF9TSVpFCisjZGVmaW5lIE9FTV9EQVRBX1JTUF9TSVpFIDE5NjgKKyNlbmRpZgorCitzdHJ1Y3QgaXdfb2VtX2RhdGFfcmVxCit7CisgICAgdl9VOF90ICAgICAgICAgICAgICAgICAgb2VtRGF0YVJlcVtPRU1fREFUQV9SRVFfU0laRV07Cit9OworCitpbnQgaXdfc2V0X29lbV9kYXRhX3JlcSgKKyAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgdW5pb24gaXdyZXFfZ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GludXggRm91bmRhdGlvbi4KKyAqLworCisjaWZuZGVmIF9fUDJQX0gKKyNkZWZpbmUgX19QMlBfSAorLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKK1xmaWxlICAgICAgICAgd2xhbl9oZGRfcDJwLmgKKworXGJyaWVmICAgICAgIExpbnV4IEhERCBQMlAgaW5jbHVkZSBmaWxlCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKyNpbmNsdWRlIDxsaW51eC9uZXRkZXZpY2UuaD4KKyNpbmNsdWRlIDxsaW51eC9pbmV0ZGV2aWNlLmg+CisjZGVmaW5lIEFDVElPTl9GUkFNRV9UWF9USU1FT1VUIDIwMDAKKyNkZWZpbmUgV0FJVF9DQU5DRUxfUkVNX0NIQU4gICAgMTAwMAorI2RlZmluZSBXQUlUX1JFTV9DSEFOX1JFQURZICAgICAxMDAwCisjZGVmaW5lIFdBSVRfQ0hBTkdFX0NIQU5ORUxfRk9SX09GRkNIQU5ORUxfVFggMzAwMAorI2RlZmluZSBSRUFEWV9FVkVOVF9QUk9QT0dBVEVfVElNRSAyCisKKyNkZWZpbmUgQUNUSU9OX0ZSQU1FX0RFRkFVTFRfV0FJVCAyMDAKKworI2RlZmluZSBFU1RJTUFURURfUk9DX0RVUl9SRVFEX0ZPUl9BQ1RJT05fVFggMjAKKworI2RlZmluZSBXTEFOX0hERF9HRVRfVFlQRV9GUk1fRkMoX19mY19fKSAgICAgICAgICgoKF9fZmNfXykgJiAweDBGKSA+PiAyKQorI2RlZmluZSBXTEFOX0hERF9HRVRfU1VCVFlQRV9GUk1fRkMoX19mY19fKSAgICAgICgoKF9fZmNfXykgJiAweEYwKSA+PiA0KQorI2RlZmluZSBXTEFOX0hERF84MDIxMV9GUk1fREFfT0ZGU0VUICAgICAgICAgICAgIDQKKy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Q09NUExFVEVELAorICAgICAgICAgICAgICAgIFAyUF9DTElFTlRfQ09OTkVDVElOR19TVEFURV8xLAorICAgICAgICAgICAgICAgIFAyUF9HT19DT01QTEVURURfU1RBVEUsCisgICAgICAgICAgICAgICAgUDJQX0NMSUVOVF9DT05ORUNURURfU1RBVEVfMSwKKyAgICAgICAgICAgICAgICBQMlBfQ0xJRU5UX0RJU0NPTk5FQ1RFRF9TVEFURSwKKyAgICAgICAgICAgICAgICBQMlBfQ0xJRU5UX0NPTk5FQ1RJTkdfU1RBVEVfMiwKKyAgICAgICAgICAgICAgICBQMlBfQ0xJRU5UX0NPTVBMRVRFRF9TVEFURQorICAgICAgICAgICAgICAgfXRQMlBDb25uZWN0aW9uU3RhdHVzOworCitleHRlcm4gdFAyUENvbm5lY3Rpb25TdGF0dXMgZ2xvYmFsUDJQQ29ubmVjdGlvblN0YXR1czsKKyNlbmRpZgorCit0eXBlZGVmIHN0cnVjdCBwMnBfYXBwX3NldFAycFBzeworICAgdEFOSV9VOCAgICAgb3BwX3BzOworICAgdEFOSV9VMzIgICAgIGN0V2luZG93OworICAgdEFOSV9VOCAgICAgY291bnQ7CisgICB0QU5JX1UzMiAgICAgZHVyYXRpb247CisgICB0QU5JX1UzMiAgICBpbnRlcnZhbDsKKyAgIHRBTklfVTMyICAgIHNpbmdsZV9ub2FfZHVyYXRpb247CisgICB0QU5JX1U4ICAgICAgcHNTZWxlY3Rpb247Cit9cDJwX2FwcF9zZXRQMnBQc190OworCitpbnQgd2xhbl9oZGRfY2ZnODAyMTFfcmVtYWluX29uX2NoYW5uZWwoIHN0cnVjdCB3aXBoeSAqd2lwaHksCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDYsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXJlbGVzc19kZXYgKndkZXYsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpZWVlODAyMTFfY2hhbm5lbCAqY2hhbiwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFIDwgS0VSTkVMX1ZFUlNJT04oMyw4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG5sODAyMTFfY2hhbm5lbF90eXBlIGNoYW5uZWxfdHlwZSwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgZHVyYXRpb24sIHU2NCAqY29va2llICk7CisKK2ludCB3bGFuX2hkZF9jZmc4MDIxMV9jYW5jZWxfcmVtYWluX29uX2NoYW5uZWwoIHN0cnVjdCB3aXBoeSAqd2lwaHksCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDYsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgd2lyZWxlc3NfZGV2ICp3ZGV2LAorI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU2NCBjb29raWUgKTsKKworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMiw2LDM4KSkKK2ludCB3bGFuX2hkZF9jZmc4MDIxMV9tZ210X3R4X2NhbmNlbF93YWl0KHN0cnVjdCB3aXBoeSAqd2lwaHksIAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMyw2LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHdpcmVsZXNzX2RldiAqd2RldiwKKyNl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RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpZWVlODAyMTFfY2hhbm5lbCAqY2hhbiwgYm9vbCBvZmZjaGFuLAorICAgICAgICAgICAgICAgICAgICAgZW51bSBubDgwMjExX2NoYW5uZWxfdHlwZSBjaGFubmVsX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICBib29sIGNoYW5uZWxfdHlwZV92YWxpZCwgdW5zaWduZWQgaW50IHdhaXQsCisgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqYnVmLCBzaXplX3QgbGVuLCAgYm9vbCBub19jY2ssCisgICAgICAgICAgICAgICAgICAgICBib29sIGRvbnRfd2FpdF9mb3JfYWNrLCB1NjQgKmNvb2tpZSApOworI2VsaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigyLDYsMzgpKQoraW50IHdsYW5faGRkX21nbXRfdHgoIHN0cnVjdCB3aXBoeSAqd2lwaHksIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaWVlZTgwMjExX2NoYW5uZWwgKmNoYW4sIGJvb2wgb2ZmY2hhbiwKKyAgICAgICAgICAgICAgICAgICAgIGVudW0gbmw4MDIxMV9jaGFubmVsX3R5cGUgY2hhbm5lbF90eXBlLAorICAgICAgICAgICAgICAgICAgICAgYm9vbCBjaGFubmVsX3R5cGVfdmFsaWQsIHVuc2lnbmVkIGludCB3YWl0LAorICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKmJ1Ziwgc2l6ZV90IGxlbiwgdTY0ICpjb29raWUgKTsKKyNlbHNlCitpbnQgd2xhbl9oZGRfbWdtdF90eCggc3RydWN0IHdpcGh5ICp3aXBoeSwgc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpZWVlODAyMTFfY2hhbm5lbCAqY2hhbiwKKyA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gQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1IgT1RIRVIKKyAqIFRPUlRJT1VTIEFDVElPTiwgQVJJU0lORyBPVVQgT0YgT1IgSU4gQ09OTkVDVElPTiBXSVRIIFRIRSBVU0UgT1IKKyAqIFBFUkZPUk1BTkNFIE9GIFRISVMgU09GVFdBUkUuCisgKi8KKworLyoKKyAqIFRoaXMgZmlsZSB3YXMgb3JpZ2luYWxseSBkaXN0cmlidXRlZCBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogTmFtZTogIHdsYW5faGRkX3BhY2tldF9maWx0ZXJpbmcuaAorKgorKiBEZXNjcmlwdGlvbjogUGFja2V0IEZpbHRlciBEZWZpbml0aW9ucy4KKyoKKyoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2lmbmRlZiBfX1dMQU5fSEREX1BBQ0tFVF9GSUxURVJJTkdfSF9fCisjZGVmaW5lIF9fV0xBTl9IRERfUEFDS0VUX0ZJTFRFUklOR19IX18KKworCisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfUEFDS0VUX0ZJTFRFUklORworCisjZGVmaW5lIEhERF9NQVhfQ01QX1BFUl9QQUNLRVRfRklMVEVSICAgICA1CisjZGVmaW5lIEhERF9GSUxURVJfSVBWNl9NQ19VQyAgICAgICAgICAgICAxCisjZGVmaW5lIEhERF9GSUxURVJfSVBWNl9NQyAgICAgICAgICAgICAgICAwCisjZGVmaW5lIEhERF9GSUxURVJfSURfSVBWNl9NQyAgICAgICAgICAgICAxMAorI2RlZmluZSBIRERfRklMVEVSX0lEX0lQVjZfVUMgICAgICAgICAgICAgMTEKKworI2RlZmluZSBIRERfSVBWNl9NQ19DTVBfREFUQSAgICAgICAgICAgICAgMHgzMworI2RlZmluZSBIRERfSVBWNl9VQ19DTVBfREFUQSAgICAgICAgICAgICAgMHgwMQorI2RlZmluZSBIRERfSVBWNl9DTVBfREFUQV8wICAgICAgICAgICAgICAgMHg4NgorI2RlZmluZSBIRERfSVBWNl9DTVBfREFUQV8xICAgICAgICAgICAgICAgMHhERAorCisjZGVmaW5lIEhERF9XTEFOX01BQ19BRERSX0xFTiAgICAgICAgICAgICA2CisjZGVmaW5lIEhERF9NQVhfTlVNX01VTFRJQ0FTVF9BRERSRVNTICAgICAxMAorCit0eXBlZGVmIGVudW0KK3sKKyAgSEREX0ZJTFRFUl9QUk9UT19UWVBFX0lOVkFMSUQgPSAwLAorICBIRERfRklMVEVSX1BST1RPX1RZUEVfTUFDID0gMSwKKyAgSEREX0ZJTFRFUl9QUk9UT19UWVBFX0FSUCA9IDIsCisgIEhERF9GSUxURVJfUFJPVE9fVFlQRV9JUFY0ID0zICwKKyAgSEREX0ZJTFRFUl9QUk9UT19UWVBFX0lQVjYgPSA0LAorICBIRERfRklMVEVSX1BST1RPX1RZUEVfVURQID0gNSwKKyAgSEREX0ZJTFRFUl9QUk9UT19UWVBFX01BWAorfSBlUHJvdG9MYXllcjsKKwordHlwZWRlZiBlbnVtCit7CisgIEhERF9SQ1ZfRklMVEVSX0lOVkFMSUQgPSAwLAorICBIRERfUkNWX0ZJTFRFUl9TRVQgPSAxLAorICBIRERfUkNWX0ZJTFRFUl9DTEVBUiA9IDIsCisgIEhERF9SQ1ZfRklMVEVSX01BWAorfWVGaWx0ZXJBY3Rpb247CisKK3R5cGVkZWYgZW51bQoreworICBIRERfRklMVEVSX0NNUF9UWVBFX0lOVkFMSUQgPSAwLAorICBIRERfRklMVEVSX0NNUF9U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TlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NIExPU1MgT0YgVVNFLCBEQVRBIE9SCisgKiBQUk9GSVRTLCBXSEVUSEVSIElOIEFOIEFDVElPTiBPRiBDT05UUkFDVCwgTkVHTElHRU5DRSBPUiBPVEhFUgorICogVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmICFkZWZpbmVkKCBXTEFOX0hERF9TT0ZUQVBfVFhfUlhfSCApCisjZGVmaW5lIFdMQU5fSEREX1NPRlRBUF9UWF9SWF9ICisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAKKyAgXGZpbGUgIHdsYW5faGRkX3NvZnRhcF90eF9yeC5oCisgIAorICBcYnJpZWYgTGludXggSEREIFNPRlRBUCBUeC9SWCBBUElzCisgIAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisgIAorLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gCisgIEluY2x1ZGUgZmlsZXMKKyAgLS0tLS0tLS0tLS0tLS0t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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitleHRlcm4gaW50IGhkZF9zb2Z0YXBfaGFyZF9zdGFydF94bWl0KHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpOworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfc29mdGFwX3R4X3RpbWVvdXQoKSAtIEZ1bmN0aW9uIGNhbGxlZCBieSBPUyBpZiB0aGVyZSBpcyBhbnkKKyAgdGltZW91dCBkdXJpbmcgdHJhbnNtaXNzaW9uLiBTaW5jZSBIREQgc2ltcGx5IGVucXVldWVzIHBhY2tldAorICBhbmQgcmV0dXJucyBjb250cm9sIHRvIE9TIHJpZ2h0IGF3YXksIHRoaXMgd291bGQgbmV2ZXIgYmUgaW52b2tlZAorCisgIEBwYXJhbSBkZXYgOiBbaW5dIHBvaW50ZXIgdG8gTGlicmEgbmV0d29yayBkZXZpY2UKKyAgQHJldHVybiAgICA6IE5vbmUKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK2V4dGVybiB2b2lkIGhkZF9zb2Z0YXBfdHhfdGltZW91dChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3NvZnRhcF9zdGF0cygpIC0gRnVuY3Rpb24gcmVnaXN0ZXJlZCB3aXRoIHRoZSBMaW51eCBPUyBmb3IgCisgIGRldmljZSBUWC9SWCBzdGF0aXN0aWNzCisKKyAgQHBhcmFtIGRldiAgICAgIDogW2luXSBwb2ludGVyIHRvIExpYnJhIG5ldHdvcmsgZGV2aWNlCisgIAorICBAcmV0dXJuICAgICAgICAgOiBwb2ludGVyIHRvIG5ldF9kZXZpY2Vfc3RhdHMgc3RydWN0dXJlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitleHRlcm4gc3RydWN0IG5ldF9kZXZpY2Vfc3RhdHMqIGhkZF9zb2Z0YXBfc3RhdHMoc3RydWN0IG5ldF9kZXZpY2UgKmRldik7CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF9zb2Z0YXBfaW5pdF90eF9yeCgpIC0gSW5pdCBmdW5jdGlvbiB0byBpbml0aWFsaXplIFR4L1JYCisgIG1vZHVsZXMgaW4gSERECisKKyAgQHBhcmFtIHBBZGFwdGVyIDogW2luXSBwb2ludGVyIHRvIGFkYXB0ZXIgY29udGV4dCAgCisgIEByZXR1cm4gICAgICAgICA6IFZPU19TVEFUVVNfRV9GQUlMVVJFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQgCisgICAgICAgICAgICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK2V4dGVybiBWT1NfU1RBVFVTIGhkZF9zb2Z0YXBfaW5pdF90eF9yeCggaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3NvZnRhcF9kZWluaXRfdHhfcngoKSAtIERlaW5pdCBmdW5jdGlvbiB0byBjbGVhbiB1cCBUeC9SWAorICBtb2R1bGVzIGluIEhERAorCisgIEBwYXJhbSBwQWRhcHRlciA6IFtpbl0gcG9pbnRlciB0byBhZGFwdGVyIGNvbnRleHQgIAorICBAcmV0dXJuICAgICAgICAgOiBWT1NfU1RBVFVTX0VfRkFJTFVSRSBpZiBhbnkgZXJyb3JzIGVuY291bnRlcmVkIAorICAgICAgICAgICAgICAgICAgOiBWT1NfU1RBVFVTX1NVQ0NFU1Mgb3RoZXJ3aXNlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitleHRlcm4gVk9TX1NUQVRVUyBoZGRfc29mdGFwX2RlaW5pdF90eF9yeCggaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3NvZnRhcF9pbml0X3R4X3J4X3N0YSgpIC0gSW5pdCBmdW5jdGlvbiB0byBpbml0aWFsaXplIGEgc3RhdGlvbiBpbiBUeC9SWAorICBtb2R1bGVzIGluIEhERAorCisgIEBwYXJhbSBwQWRhcHRlciA6IFtpbl0gcG9pbnRlciB0byBhZGFwdGVyIGNvbnRleHQKKyAgQHBhcmFtIFNUQUlkICAgIDogW2luXSBTdGF0aW9uIElEIHRvIGRlaW5pdAorICBAcGFyYW0gcG1hY0FkZHJTVEEgIDogW2luXSBwb2ludGVyIHRvIHRoZSBNQUMgYWRkcmVzcyBvZiB0aGUgc3RhdGlvbiAgCisgIEByZXR1cm4gICAgICAgICA6IFZPU19TVEFUVVNfRV9GQUlMVVJFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQgCisgICAgICAgICAgICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK2V4dGVybiBWT1NfU1RBVFVTIGhkZF9zb2Z0YXBfaW5pdF90eF9yeF9zdGEoIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLCB2X1U4X3QgU1RBSWQsIHZfTUFDQUREUl90ICpwbWFjQWRkclNUQSk7CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF9zb2Z0YXBfZGVpbml0X3R4X3J4X3N0YSgpIC0gRGVpbml0IGZ1bmN0aW9uIHRvIGNsZWFuIHVwIGEgc3RhdGlvaW4gaW4gVHgvUlgKKyAgbW9kdWxlcyBpbiBIREQKKworICBAcGFyYW0gcEFkYXB0ZXIgOiBbaW5dIHBvaW50ZXIgdG8gYWRhcHRlciBjb250ZXh0CisgIEBwYXJhbSBTVEFJZCAgICA6IFtpbl0gU3RhdGlvbiBJRCB0byBkZWluaXQgCisgIEByZXR1cm4gICAgICAgICA6IFZPU19TVEFUVVNfRV9GQUlMVVJFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQgCisgICAgICAgICAgICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK2V4dGVybiBWT1NfU1RBVFVTIGhkZF9zb2Z0YXBfZGVpbml0X3R4X3J4X3N0YSAoIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLCB2X1U4X3QgU1RBSWQgKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX2Rpc2Nvbm5lY3RfdHhfcngoKSAtIERpc2Nvbm5lY3QgZnVuY3Rpb24gdG8gY2xlYW4gdXAgVHgvUlgKKyAgbW9kdWxlcyBpbiBIREQKKworICBAcGFyYW0gcEFkYXB0ZXIgOiBbaW5dIHBvaW50ZXIgdG8gYWRhcHRlciBjb250ZXh0ICAKKyAgQHJldHVybiAgICAgICAgIDogVk9TX1NUQVRVU19FX0ZBSUxVUkUgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZCAKKyAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworZXh0ZXJuIFZPU19TVEFUVVMgaGRkX3NvZnRhcF9kaXNjb25uZWN0X3R4X3J4KCBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciApOworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfdHhfY29tcGxldGVfY2JrKCkgLSBDYWxsYmFjayBmdW5jdGlvbiBpbnZva2VkIGJ5IFRMCisgIHRvIGluZGljYXRlIHRoYXQgYSBwYWNrZXQgaGFzIGJlZW4gdHJhbnNtaXR0ZWQgYWNyb3NzIHRoZSBTRElPIGJ1cworICBzdWNjZXNmdWxseS4gT1MgcGFja2V0IHJlc291cmNlcyBjYW4gYmUgcmVsZWFzZWQgYWZ0ZXIgdGhpcyBjYmsuCisKKyAgQHBhcmFtIHZvc0NvbnRleHQgICA6IFtpbl0gcG9pbnRlciB0byBWT1MgY29udGV4dCAgIAorICBAcGFyYW0gcFZvc1BhY2tldCAgIDogW2luXSBwb2ludGVyIHRvIFZPUyBwYWNrZXQgKGNvbnRhaW5pbmcgc2tiKSAKKyAgQHBhcmFtIHZvc1N0YXR1c0luICA6IFtpbl0gc3RhdHVzIG9mIHRoZSB0cmFuc21pc3Npb24gCisKKyAgQHJldHVybiAgICAgICAgICAgICA6IFZPU19TVEFUVVNfRV9GQUlMVVJFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQgCisgICAgICAgICAgICAgICAgICAgICAgOiBWT1NfU1RBVFVTX1NVQ0NFU1Mgb3RoZXJ3aXNlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitleHRlcm4gVk9TX1NUQVRVUyBoZGRfc29mdGFwX3R4X2NvbXBsZXRlX2Niayggdl9WT0lEX3QgKnZvc0NvbnRleHQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX3BrdF90ICpwVm9zUGFja2V0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19TVEFUVVMgdm9zU3RhdHVzSW4gKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3NvZnRhcF90eF9mZXRjaF9wYWNrZXRfY2JrKCkgLSBDYWxsYmFjayBmdW5jdGlvbiBpbnZva2VkIGJ5IFRMIHRvIAorICBmZXRjaCBhIHBhY2tldCBmb3IgdHJhbnNtaXNzaW9uLgorCisgIEBwYXJhbSB2b3NDb250ZXh0ICAgOiBbaW5dIHBvaW50ZXIgdG8gVk9TIGNvbnRleHQgIAorICBAcGFyYW0gc3RhSWQgICAgICAgIDogW2luXSBTdGF0aW9uIGZvciB3aGljaCBUTCBpcyByZXF1ZXN0aW5nIGEgcGt0CisgIEBwYXJhbSB1Y0FDICAgICAgICAgOiBbaW5dIHBvaW50ZXIgdG8gYWNjZXNzIGNhdGVnb3J5IHJlcXVlc3RlZCBieSBUTAorICBAcGFyYW0gcFZvc1BhY2tldCAgIDogW291dF0gcG9pbnRlciB0byBWT1MgcGFja2V0IHBhY2tldCBwb2ludGVyCisgIEBwYXJhbSBwUGt0TWV0YUluZm8gOiBbb3V0XSBwb2ludGVyIHRvIG1ldGEgaW5mbyBmb3IgdGhlIHBrdCAKKyAgCisgIEByZXR1cm4gICAgICAgICAgICAgOiBWT1NfU1RBVFVTX0VfRU1QVFkgaWYgbm8gcGFja2V0cyB0byB0cmFuc21pdAorICAgICAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19FX0ZBSUxVUkUgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZCAKKyAgICAgICAgICAgICAgICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK2V4dGVybiBWT1NfU1RBVFVTIGhkZF9zb2Z0YXBfdHhfZmV0Y2hfcGFja2V0X2Niayggdl9WT0lEX3QgKnZvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwU3RhSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX0FDRW51bVR5cGUgICAgdWNBQywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfcGt0X3QgKipwcFZvc1BhY2tldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfTWV0YUluZm9UeXBlICpwUGt0TWV0YUluZm8gKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3NvZnRhcF90eF9sb3dfcmVzb3VyY2VfY2JrKCkgLSBDYWxsYmFjayBmdW5jdGlvbiBpbnZva2VkIGluIHRoZSAKKyAgY2FzZSB3aGVyZSBWT1MgcGFja2V0cyBhcmUgbm90IGF2YWlsYWJsZSBhdCB0aGUgdGltZSBvZiB0aGUgY2FsbCB0byBnZXQgCisgIHBhY2tldHMuIFRoaXMgY2FsbGJhY2sgZnVuY3Rpb24gaXMgaW52b2tlZCBieSBWT1Mgd2hlbiBwYWNrZXRzIGFyZSAKKyAgYXZhaWxhYmxlLgorCisgIEBwYXJhbSBwVm9zUGFja2V0IDogW2luXSAgcG9pbnRlciB0byBWT1MgcGFja2V0IAorICBAcGFyYW0gdXNlckRhdGEgICA6IFtpbl0gIG9wYXF1ZSB1c2VyIGRhdGEgdGhhdCB3YXMgcGFzc2VkIGluaXRpYWxseSAKKyAgCisgIEByZXR1cm4gICAgICAgICAgIDogVk9TX1NUQVRVU19FX0ZBSUxVUkUgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZCwgCisgICAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitleHRlcm4gVk9TX1NUQVRVUyBoZGRfc29mdGFwX3R4X2xvd19yZXNvdXJjZV9jYmsoIHZvc19wa3RfdCAqcFZvc1BhY2tldCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9WT0lEX3QgKnVzZXJEYXRhICk7CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF9zb2Z0YXBfcnhfcGFja2V0X2NiaygpIC0gUmVjZWl2ZSBjYWxsYmFjayByZWdpc3RlcmVkIHdpdGggVEwuCisgIFRMIHdpbGwgY2FsbCB0aGlzIHRvIG5vdGlmeSB0aGUgSEREIHdoZW4gYSBwYWNrZXQgd2FzIHJlY2VpdmVkIAorICBmb3IgYSByZWdpc3RlcmVkIFNUQS4KKworICBAcGFyYW0gdm9zQ29udGV4dCAgIDogW2luXSBwb2ludGVyIHRvIFZPUyBjb250ZXh0ICAKKyAgQHBhcmFtIHBWb3NQYWNrZXQgICA6IFtpbl0gcG9pbnRlciB0byBWT1MgcGFja2V0IChjb25hdGluaW5nIHNrX2J1ZmYpIAorICBAcGFyYW0gc3RhSWQgICAgICAgIDogW2luXSBTdGF0aW9uIElkCisgIEBwYXJhbSBwUnhNZXRhSW5mbyAgOiBbaW5dIHBvaW50ZXIgdG8gbWV0YSBpbmZvIGZvciB0aGUgcmVjZWl2ZWQgcGt0KHMpIAorCisgIEByZXR1cm4gICAgICAgICAgICAgOiBWT1NfU1RBVFVTX0VfRkFJTFVSRSBpZiBhbnkgZXJyb3JzIGVuY291bnRlcmVkLCAKKyAgICAgICAgICAgICAgICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK2V4dGVybiBWT1NfU1RBVFVTIGhkZF9zb2Z0YXBfcnhfcGFja2V0X2Niayggdl9WT0lEX3QgKnZvc0NvbnRleHQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19wa3RfdCAqcFZvc1BhY2tldCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90IHN0YUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9SeE1ldGFJbmZvVHlwZSogcFJ4TWV0YUluZm8gKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3NvZnRhcF9EZXJlZ2lzdGVyU1RBIC0gRGVyZWdpc3RlciBhIHN0YXRpb24gZnJvbSBUTCBibG9jaworCisgIEBwYXJhbSBwQWRhcHRlciA6IFtpbl0gcG9pbnRlciB0byBhZGFwdGVyIGNvbnRleHQKKyAgQHBhcmFtIFNUQUlkICAgIDogW2luXSBTdGF0aW9uIElEIHRvIGRlcmVnaXN0ZXIKKyAgQHJldHVybiAgICAgICAgIDogVk9TX1NUQVRVU19FX0ZBSUxVUkUgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZCAKKyAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworZXh0ZXJuIFZPU19TVEFUVVMgaGRkX3NvZnRhcF9EZXJlZ2lzdGVyU1RBKCBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwgdEFOSV9VOCBzdGFJZCApOworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfc29mdGFwX1JlZ2lzdGVyU1RBIC0gUmVnaXN0ZXIgYSBzdGF0aW9uIGludG8gVEwgYmxvY2sKKworICBAcGFyYW0gcEFkYXB0ZXIgOiBbaW5dIHBvaW50ZXIgdG8gYWRhcHRlciBjb250ZXh0CisgIEBwYXJhbSBTVEFJZCAgICA6IFtpbl0gU3RhdGlvbiBJRCB0byBkZXJlZ2lzdGVyCisgIEBwYXJhbSBmQXV0aFJlcXVpcmVkOiBbaW5dIFN0YXRpb24gcmVxdWlyZXMgZnVydGhlciBzZWN1cml0eSBuZWdvdGlhdGlvbiBvciBub3QKKyAgQHBhcmFtIGZQcml2YWN5Qml0ICA6IFtpbl0gcHJpdmFjeSBiaXQgbmVlZHMgdG8gYmUgc2V0IG9yIG5vdAorICBAcGFyYW0gdWNhc3RTaWcgIDogW2luXSBVbmljYXN0IFNpZ25hdHVyZSBzZW5kIHRvIFRMCisgIEBwYXJhbSBiY2FzdFNpZyAgOiBbaW5dIEJyb2FkY2FzdCBTaWduYXR1cmUgc2VuZCB0byBUTAorICBAcGFyYW0gcFBlZXJNYWNBZGRyZXNzICA6IFtpbl0gc3RhdGlvbiBNQUMgYWRkcmVzcworICBAcGFyYW0gZldtbUVuYWJsZWQgIDogW2luXSBXbW0gZW5hYmxlZCBzdGEgb3Igbm90CisgIEByZXR1cm4gICAgICAgICA6IFZPU19TVEFUVVNfRV9GQUlMVVJFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQgCisgICAgICAgICAgICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCitleHRlcm4gVk9TX1NUQVRVUyBoZGRfc29mdGFwX1JlZ2lzdGVyU1RBKCBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfQk9PTF90IGZBdXRoUmVxdWlyZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X0JPT0xfdCBmUHJpdmFjeUJpdCwgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3Qgc3RhSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgdWNhc3RTaWcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgYmNhc3RTaWcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X01BQ0FERFJfdCAqcFBlZXJNYWNBZGRyZXNzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9CT09MX3QgZldtbUVuYWJsZWQpOworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfc29mdGFwX1JlZ2lzdGVyX0JDX1NUQSAtIFJlZ2lzdGVyIGEgZGVmYXVsdCBicm9hZGNhc3Qgc3RhdGlvbiBpbnRvIFRMIGJsb2NrCisKKyAgQHBhcmFtIHBBZGFwdGVyIDogW2luXSBwb2ludGVyIHRvIGFkYXB0ZXIgY29udGV4dAorICBAcGFyYW0gZlByaXZhY3lCaXQgOiBbaW5dIHByaXZhY3kgYml0IG5lZWRzIHRvIGJlIHNldCBvciBub3QKKyAgQHJldHVybiAgICAgICAgIDogVk9TX1NUQVRVU19FX0ZBSUxVUkUgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZCAKKyAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KK2V4dGVybiBWT1NfU1RBVFVTIGhkZF9zb2Z0YXBfUmVnaXN0ZXJfQkNfU1RBKCBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwgdl9CT09MX3QgZlByaXZhY3lCaXQpOworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfc29mdGFwX0RlcmVnaXN0ZXJTVEEgLSBEZVJlZ2lzdGVyIHRoZSBkZWZhdWx0IGJyb2FkY2FzdCBzdGF0aW9uIGludG8gVEwgYmxvY2sKKworICBAcGFyYW0gcEFkYXB0ZXIgOiBbaW5dIHBvaW50ZXIgdG8gYWRhcHRlciBjb250ZXh0CisgIEByZXR1cm4gICAgICAgICA6IFZPU19TVEFUVVNfRV9GQUlMVVJFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQgCisgICAgICAgICAgICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCitleHRlcm4gVk9TX1NUQVRVUyBoZGRfc29mdGFwX0RlcmVnaXN0ZXJfQkNfU1RBKCBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcik7CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF9zb2Z0YXBfc3RvcF9ic3MgLSBIZWxwZXIgZnVuY3Rpb24gdG8gc3RvcCBic3MgYW5kIGRvIGNsZWFudXAgaW4gSEREIGFuZCBUTAorCisgIEBwYXJhbSBwQWRhcHRlciA6IFtpbl0gcG9pbnRlciB0byBhZGFwdGVyIGNvbnRleHQKKyAgQHJldHVybiAgICAgICAgIDogVk9TX1NUQVRVU19FX0ZBSUxVUkUgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZCAKKyAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KK2V4dGVybiBWT1NfU1RBVFVTIGhkZF9zb2Z0YXBfc3RvcF9ic3MoIGhkZF9hZGFwdGVyX3QgKnBIb3N0YXBkQWRhcHRlcik7CisKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3NvZnRhcF9jaGFuZ2VfU1RBX3N0YXRlIC0gSGVscGVyIGZ1bmN0aW9uIHRvIGNoYW5nZSBzdGF0a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b24gaWQKKyAgQHJldHVybiAgICAgICAgIDogVk9TX1NUQVRVU19FX0ZBSUxVUkUgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZCAKKyAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KK2V4dGVybiBWT1NfU1RBVFVTIGhkZF9zb2Z0YXBfR2V0U3RhSWQoIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLCB2X01BQ0FERFJfdCAqcE1hY0FkZHJlc3MsIHZfVThfdCAqc3RhSWQpOworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfc29mdGFwX0dldENvbm5lY3RlZFN0YUlkIC0gSGVscGVyIGZ1bmN0aW9uIHRvIGdldCBzdGF0aW9uIElkIG9mIHRoZSBjb25uZWN0ZWQgZGV2aWNlCisKKyAgQHBhcmFtIHBBZGFwdGVyIDogW2luXSBwb2ludGVyIHRvIGFkYXB0ZXIgY29udGV4dAorICBAcGFyYW0gc3RhSWQgICAgOiBbb3V0XSBzdGF0aW9uIGlkCisgIEByZXR1cm4gICAgICAgICA6IFZPU19TVEFUVVNfRV9GQUlMVVJFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQKKyAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KK2V4dGVybiBWT1NfU1RBVFVTIGhkZF9zb2Z0YXBfR2V0Q29ubmVjdGVkU3RhSWQoIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLCB2X1U4X3QgKnN0YUlkKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBcYnJpZWYgaGRkX3N0YXJ0X3RyYWZmaWNNb25pdG9yKCkgLQorICAgVGhpcyBmdW5jdGlvbiBkeW5hbWljYWxseSBlbmFibGUgdHJhZmZpYyBtb25pdG9yIGZ1bmN0b25hbGl0eQorICAgdGhlIGNvbW1hbmQgaXdwcml2IHdsYW5YIHNldFRyYWZmaWNNb24gPHZhbHVlPi4KKworICBAcGFyYW0gcEFkYXB0ZXIgOiBbaW5dIHBvaW50ZXIgdG8gYWRhcHRlciBjb250ZXh0CisgIEByZXR1cm4gICAgICAgICA6IFZPU19TVEFUVVNfRV9GQUlMVVJFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQKKworICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworVk9TX1NUQVRVUyBoZGRfc3RhcnRfdHJhZmZpY01vbml0b3IoIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyICk7CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgXGJyaWVmIGhkZF9zdG9wX3RyYWZmaWNNb25pdG9yKCkgLQorICAgVGhpcyBmdW5jdGlvbiBkeW5hbWljYWxseSBkaXNhYmxlIHRyYWZmaWMgbW9uaXRvciBmdW5jdG9uYWxpdHkKKyAgIHRoZSBjb21tYW5kIGl3cHJpdiB3bGFuWCBzZXRUcmFmZmljTW9uIDx2YWx1ZT4uCisKKyAgQHBhcmFtIHBBZGFwdGVyIDogW2luXSBwb2ludGVyIHRvIGFkYXB0ZXIgY29udGV4dAorICBAcmV0dXJuICAgICAgICAgOiBWT1NfU1RBVFVTX0VfRkFJTFVSRSBpZiB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XGZpbGUgICAgICAgICB3bGFuX2hkZF90ZGxzLmgKKworXGJyaWVmICAgICAgIExpbnV4IEhERCBURExTIGluY2x1ZGUgZmlsZQorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKworI2RlZmluZSBNQVhfTlVNX1RETFNfUEVFUiAgICAgICAgICAgMworCisjZGVmaW5lIFRETFNfU1VCX0RJU0NPVkVSWV9QRVJJT0QgICAxMDAKKworI2RlZmluZSBURExTX01BWF9ESVNDT1ZFUl9SRVFTX1BFUl9USU1FUiAxCisKKyNkZWZpbmUgVERMU19ESVNDT1ZFUllfUEVSSU9EICAgICAgIDM2MDAwMDAKKworI2RlZmluZSBURExTX1RYX1NUQVRTX1BFUklPRCAgICAgICAgMzYwMDAwMAorCisjZGVmaW5lIFRETFNfSU1QTElDSVRfVFJJR0dFUl9QS1RfVEhSRVNIT0xEICAgICAxMDAKKworI2RlZmluZSBURExTX1JYX0lETEVfVElNRU9VVCAgICAgICAgNTAwMAorCisjZGVmaW5lIFRETFNfUlNTSV9UUklHR0VSX0hZU1RFUkVTSVMgNTAKKworLyogYmVmb3JlIFVwZGF0ZVRpbWVyIGV4cGlyZXMsIHdlIHdhbnQgdG8gdGltZW91dCBkaXNjb3ZlcnkgcmVzcG9uc2UuCitzaG91bGQgbm90IGJlIG1vcmUgdGhhbiAyMDAwICovCisjZGVmaW5lIFRETFNfRElTQ09WRVJZX1RJTUVPVVRfQkVGT1JFX1VQREFURSAgICAgMTAwMAorCisjZGVmaW5lIFRETFNfQ1RYX01BR0lDIDB4NTQ0NDRjNTMgICAgLy8gIlRETFMiCisKKyNkZWZpbmUgVERMU19NQVhfU0NBTl9TQ0hFRFVMRSAgICAgICAgICAxMAorI2RlZmluZSBURExTX01BWF9TQ0FOX1JFSkVDVCAgICAgICAgICAgIDUKKyNkZWZpbmUgVERMU19ERUxBWV9TQ0FOX1BFUl9DT05ORUNUSU9OIDEwMAorCisjZGVmaW5lIFRETFNfSVNfQ09OTkVDVEVEKHBlZXIpICBcCisgICAgICAgICgoZVRETFNfTElOS19DT05ORUNURUQgPT0gKHBlZXIpLT5saW5rX3N0YXR1cykgfHwgXAorICAgICAgICAgKGVURExTX0xJTktfVEVBUklORyA9PSAocGVlciktPmxpbmtfc3RhdHVzKSkKKworLyogVERMUyBPZmYgQ2hhbm5lbCBCYW5kd2lkdGggT2Zmc2V0ICovCisjZGVmaW5lIFRETFNfT0ZGX0NIQU5ORUxfQldfT0ZGU0VUICAwCisKKy8qIFRETFMgQ2hhbm5lbCBTd2l0Y2ggUmVxdWVzdCAqLworI2RlZmluZSBURExTX0NIQU5ORUxfU1dJVENIX0VOQUJMRSAgMQorI2RlZmluZSBURExTX0NIQU5ORUxfU1dJVENIX0RJU0FCTEUgMgorCit0eXBlZGVmIHN0cnVjdAoreworICAgIHRBTklfVTMyICAgIHRkbHM7CisgICAgdEFOSV9VMzIgICAgdHhfcGVyaW9kX3Q7CisgICAgdEFOSV9VMzIgICAgdHhfcGFja2V0X247CisgICAgdEFOSV9VMzIgICAgZGlzY292ZXJ5X3BlcmlvZF90OworICAgIHRBTklfVTMyICAgIGRpc2NvdmVyeV90cmllc19uOworICAgIHRBTklfVTMyICAgIGlkbGVfdGltZW91dF90OworICAgIHRBTklfVTMyICAgIGlkbGVfcGFja2V0X247CisgICAgdEFOSV9VMzIgICAgcnNzaV9oeXN0ZXJlc2lzOworICAgIHRBTklfUzMyICAgIHJzc2lfdHJpZ2dlcl90aHJlc2hvbGQ7CisgICAgdEFOSV9TMzIgICAgcnNzaV90ZWFyZG93bl90aHJlc2hvbGQ7Cit9IHRkbHNfY29uZmlnX3BhcmFtc190OworCit0eXBlZGVmIHN0cnVjdAoreworICAgIHN0cnVjdCB3aXBoeSAqd2lwaHk7CisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA8IEtFUk5FTF9WRVJT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Q1RFRCwKKyAgICBlVERMU19MSU5LX1RFQVJJTkcsCit9IHRURExTTGlua1N0YXR1czsKKworCit0eXBlZGVmIGVudW0geworICAgIGVURExTX0xJTktfU1VDQ0VTUywgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTdWNjZXNzICovCisgICAgZVRETFNfTElOS19VTlNQRUNJRklFRCAgICAgICAgICAgPSAtMSwgICAgICAgICAgIC8qIFVuc3BlY2lmaWVkIHJlYXNvbiAqLworICAgIGVURExTX0xJTktfTk9UX1NVUFBPUlRFRCAgICAgICAgID0gLTIsICAgICAgICAgICAvKiBSZW1vdGUgc2lkZSBkb2Vzbid0IHN1cHBvcnQgVERMUyAqLworICAgIGVURExTX0xJTktfVU5TVVBQT1JURURfQkFORCAgICAgID0gLTMsICAgICAgICAgICAvKiBSZW1vdGUgc2lkZSBkb2Vzbid0IHN1cHBvcnQgdGhpcyBiYW5kICovCisgICAgZVRETFNfTElOS19OT1RfQkVORUZJQ0lBTCAgICAgICAgPSAtNCwgICAgICAgICAgIC8qIEdvaW5nIHRvIEFQIGlzIGJldHRlciB0aGFuIGdvaW5nIGRpcmVjdCAqLworICAgIGVURExTX0xJTktfRFJPUFBFRF9CWV9SRU1PVEUgICAgID0gLTUgICAgICAgICAgICAvKiBSZW1vdGUgc2lkZSBkb2Vzbid0IHdhbnQgaXQgYW55bW9yZSAqLworfSB0VERMU0xpbmtSZWFzb247CisKK3R5cGVkZWYgc3RydWN0IHsKKyAgICBpbnQgY2hhbm5lbDsgICAgICAgICAgICAgICAgICAgICAgICAvKiBjaGFubmVsIGhpbnQsIGluIGNoYW5uZWwgbnVtYmVyIChOT1QgZnJlcXVlbmN5ICkgKi8KKyAgICBpbnQgZ2xvYmFsX29wZXJhdGluZ19jbGFzczsgICAgICAgICAvKiBvcGVyYXRpbmcgY2xhc3MgdG8gdXNlICovCisgICAgaW50IG1heF9sYXRlbmN5X21zOyAgICAgICAgICAgICAgICAgLyogbWF4IGxhdGVuY3kgdGhhdCBjYW4gYmUgdG9sZXJhdGVkIGJ5IGFwcHMgKi8KKyAgICBpbnQgbWluX2JhbmR3aWR0aF9rYnBzOyAgICAgICAgICAgICAvKiBiYW5kd2lkdGggcmVxdWlyZWQgYnkgYXBwcywgaW4ga2lsbyBiaXRzIHBlciBzZWNvbmQgKi8KK30gdGRsc19yZXFfcGFyYW1zX3Q7CisKK3R5cGVkZWYgZW51bSB7CisgICAgV0lGSV9URExTX0RJU0FCTEVELCAgICAgICAgICAgICAgICAgLyogVERMUyBpcyBub3QgZW5hYmxlZCwgb3IgaXMgZGlzYWJsZWQgbm93ICovCisgICAgV0lGSV9URExTX0VOQUJMRUQsICAgICAgICAgICAgICAgICAgLyogVERMUyBpcyBlbmFibGVkLCBidXQgbm90IHlldCB0cmllZCAqLworICAgIFdJRklfVERMU19UUllJTkcsICAgICAgICAgICAgICAgICAgIC8qIERpcmVjdCBsaW5rIGlzIGJlaW5nIGF0dGVtcHRlZCAob3B0aW9uYWwpICovCisgICAgV0lGSV9URExTX0VTVEFCTElTSEVELCAgICAgICAgICAgICAgLyogRGlyZWN0IGxpbmsgaXMgZXN0YWJsaXNoZWQgKi8KKyAgICBXSUZJX1RETFNfRVNUQUJMSVNIRURfT0ZGX0NIQU5ORUwsICAvKiBEaXJlY3QgbGluayBpcyBlc3RhYmxpc2hlZCB1c2luZyBNQ0MgKi8KKyAgICBXSUZJX1RETFNfRFJPUFBFRCwgICAgICAgICAgICAgICAgICAvKiBEaXJlY3QgbGluayB3YXMgZXN0YWJsaXNoZWQsIGJ1dCBpcyBub3cgZHJvcHBlZCAqLworICAgIFdJRklfVERMU19GQUlMRUQgICAgICAgICAgICAgICAgICAgIC8qIERpcmVjdCBsaW5rIGZhaWxlZCAqLworfSB0ZGxzX3N0YXRlX3Q7CisKK3R5cGVkZWYgaW50ICgqY2ZnODAyMTFfZXh0dGRsc19jYWxsYmFjaykoCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0QU5JX1U4KiBtYWMsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4KiBtYWMsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9TMzIgc3RhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfUzMyIHJlYXNvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqY3R4KTsKK3R5cGVkZWYgc3RydWN0IHsKKyAgICB0QU5JX1UxNiAgICBwZXJpb2Q7CisgICAgdEFOSV9VMTYgICAgYnl0ZXM7Cit9IHRkbHNfdHhfdHB1dF9jb25maWdfdDsKKwordHlwZWRlZiBzdHJ1Y3QgeworICAgIHRBTklfVTE2ICAgIHBlcmlvZDsKKyAgICB0QU5JX1UxNiAgICB0cmllczsKK30gdGRsc19kaXNjb3ZlcnlfY29uZmlnX3Q7CisKK3R5cGVkZWYgc3RydWN0IHsKKyAgICB0QU5JX1UxNiAgICB0aW1lb3V0OworfSB0ZGxzX3J4X2lkbGVfY29uZmlnX3Q7CisKK3R5cGVkZWYgc3RydWN0IHsKKyAgICB0QU5JX1UxNiAgICByc3NpX3RocmVzOworfSB0ZGxzX3Jzc2lfY29uZmlnX3Q7CisKK3N0cnVjdCBfaGRkVGRsc1BlZXJfdDsKKwordHlwZWRlZiBzdHJ1Y3QgeworICAgIHN0cnVjdCBsaXN0X2hlYWQgcGVlcl9saXN0WzI1Nl07CisgICAgaGRkX2FkYXB0ZXJfdCAgICpwQWRhcHRlcjsKKyNpZmRlZiBURExTX1VTRV9TRVBBUkFURV9ESVNDT1ZFUllfVElNRVIKKyAgICB2b3NfdGltZXJfdCAgICAgcGVlckRpc2NvdmVyVGltZXI7CisjZW5kaWYKK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Ki8KKyAgICB2X01BQ0FERFJfdCBwZWVyTWFjOworfSB0ZGxzQ29ubkluZm9fdDsKKworaW50IHdsYW5faGRkX3N0YV90ZGxzX2luaXQoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIpOworCit2b2lkIHdsYW5faGRkX3RkbHNfaW5pdChoZGRfY29udGV4dF90ICogcEhkZEN0eCk7CisKK3ZvaWQgd2xhbl9oZGRfdGRsc19leGl0KGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLCB0QU5JX0JPT0xFQU4gbXV0ZXhMb2NrKTsKKwordm9pZCB3bGFuX2hkZF90ZGxzX2V4dHJhY3RfZGEoc3RydWN0IHNrX2J1ZmYgKnNrYiwgdTggKm1hYyk7CisKK3ZvaWQgd2xhbl9oZGRfdGRsc19leHRyYWN0X3NhKHN0cnVjdCBza19idWZmICpza2IsIHU4ICptYWMpOworCitpbnQgd2xhbl9oZGRfdGRsc19pbmNyZW1lbnRfcGt0X2NvdW50KGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKm1hYywKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICptYWMsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggdHgpOworCitpbnQgd2xhbl9oZGRfdGRsc19zZXRfc3RhX2lkKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKm1hYywKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICptYWMsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggc3RhSWQpOworCitoZGRUZGxzUGVlcl90ICp3bGFuX2hkZF90ZGxzX2ZpbmRfcGVlcihoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqbWFjLAorI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICptYWMsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfQk9PTEVBTiBtdXRleExvY2spOworCitoZGRUZGxzUGVlcl90ICp3bGFuX2hkZF90ZGxzX2ZpbmRfYWxsX3BlZXIoaGRkX2NvbnRleHRfdCAqcEhkZEN0eCwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKm1hYworI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCAqbWFjCisjZW5kaWYKKyk7CisKK2ludCB3bGFuX2hkZF90ZGxzX2dldF9saW5rX2VzdGFibGlzaF9wYXJhbXMoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqbWFjLAorI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggKm1hYywKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Q3NyVGRsc0xpbmtFc3RhYmxpc2hQYXJhbXMqIHRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zKTsKK2hkZFRkbHNQZWVyX3QgKndsYW5faGRkX3RkbHNfZ2V0X3BlZXIoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqbWFjCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCAqbWFjCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApOworCitpbnQgd2xhbl9oZGRfdGRsc19zZXRfY2FwKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTgqIG1hYywKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgIHU4KiBtYWMsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdFRETFNDYXBUeXBlIGNhcCk7CisKK3ZvaWQgd2xhbl9oZGRfdGRsc19zZXRfcGVlcl9saW5rX3N0YXR1cyhoZGRUZGxzUGVlcl90ICpjdXJyX3BlZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFRETFNMaW5rU3RhdHVzIHN0YXR1cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0VERMU0xpbmtSZWFzb24gcmVhc29uKTsKK3ZvaWQgd2xhbl9oZGRfdGRsc19zZXRfbGlua19zdGF0dXMoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqbWFjLAorI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggKm1hYywKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0VERMU0xpbmtTdGF0dXMgbGlua1N0YXR1cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFRETFNMaW5rUmVhc29uIHJlYXNvbik7CisKK2ludCB3bGFuX2hkZF90ZGxzX3JlY3ZfZGlzY292ZXJ5X3Jlc3AoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsIHU4ICptYWMpOworCitpbnQgd2xhbl9oZGRfdGRsc19zZXRfcGVlcl9jYXBzKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKm1hYywKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICptYWMsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdENzclN0YVBhcmFtcyAqU3RhUGFyYW1zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX0JPT0xFQU4gaXNCdWZTdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfQk9PTEVBTiBpc09mZkNoYW5uZWxTdXBwb3J0ZWQpOworCitpbnQgd2xhbl9oZGRfdGRsc19zZXRfcnNzaShoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqbWFjLAorI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICptYWMsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfUzggcnhSc3NpKTsKKworaW50IHdsYW5faGRkX3RkbHNfc2V0X3Jlc3BvbmRlcihoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICptYWMsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCAqbWFjLAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggcmVzcG9uZGVyKTsKKworaW50IHdsYW5faGRkX3RkbHNfZ2V0X3Jlc3BvbmRlcihoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwgdTggKm1hYyk7CisKK2ludCB3bGFuX2hkZF90ZGxzX3NldF9zaWduYXR1cmUoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqbWFjLAorI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggKm1hYywKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IHVTaWduYXR1cmUpOworCitpbnQgd2xhbl9oZGRfdGRsc19zZXRfcGFyYW1zKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsIHRkbHNfY29uZmlnX3BhcmFtc190ICpjb25maWcpOworCitpbnQgd2xhbl9oZGRfdGRsc19yZXNldF9wZWVyKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLAorI2l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EFkYXB0ZXIsIHU4ICptYWMpOworCitoZGRUZGxzUGVlcl90ICp3bGFuX2hkZF90ZGxzX2lzX3Byb2dyZXNzKGhkZF9jb250ZXh0X3QgKnBIZGRDdHgsCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqbWFjLAorI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggKm1hYywKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCBza2lwX3NlbGYsIHRBTklfQk9PTEVBTiBtdXRleExvY2spOworCit2b2lkIHdsYW5faGRkX3RkbHNfc2V0X21vZGUoaGRkX2NvbnRleHRfdCAqcEhkZEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlVERMU1N1cHBvcnRNb2RlIHRkbHNfbW9kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X0JPT0xfdCBiVXBkYXRlTGFzdCk7CisKK3RBTklfVTMyIHdsYW5faGRkX3RkbHNfZGlzY292ZXJ5X3NlbnRfY250KGhkZF9jb250ZXh0X3QgKnBIZGRDdHgpOworCit2b2lkIHdsYW5faGRkX3RkbHNfY2hlY2tfcG93ZXJfc2F2ZV9wcm9oaWJpdGVkKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyKTsKKwordm9pZCB3bGFuX2hkZF90ZGxzX2ZyZWVfc2Nhbl9yZXF1ZXN0ICh0ZGxzX3NjYW5fY29udGV4dF90ICp0ZGxzX3NjYW5fY3R4KTsKKworaW50IHdsYW5faGRkX3RkbHNfY29weV9zY2FuX2NvbnRleHQoaGRkX2NvbnRleHRfdCAqcEhkZEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPCBLRVJORUxfVkVSU0lPTigzLDYsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBjZmc4MDIxMV9zY2FuX3JlcXVlc3QgKnJlcXVlc3QpOworCitpbnQgd2xhbl9oZGRfdGRsc19zY2FuX2NhbGxiYWNrIChoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHdpcGh5ICp3aXBoeSwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFIDwgS0VSTkVMX1ZFUlNJT04oMyw2LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBjZmc4MDIxMV9zY2FuX3JlcXVlc3QgKnJlcXVlc3QpOworCit2b2lkIHdsYW5faGRkX3RkbHNfc2Nhbl9kb25lX2NhbGxiYWNrKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyKTsKKwordm9pZCB3bGFuX2hkZF90ZGxzX3RpbWVyX3Jlc3RhcnQoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfdGltZXJfdCAqdGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IGV4cGlyYXRpb25UaW1lKTsKK3ZvaWQgd2xhbl9oZGRfdGRsc19pbmRpY2F0ZV90ZWFyZG93bihoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZGRUZGxzUGVlcl90ICpjdXJyX3BlZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMTYgcmVhc29uKTsKKworaW50IHdsYW5faGRkX3RkbHNfc2V0X2ZvcmNlX3BlZXIoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKm1hYywKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCAqbWFjLAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX0JPT0xFQU4gZm9yY2VQZWVyKTsKK2ludCB3bGFuX2hkZF90ZGxzX2V4dGN0cmxfZGVjb25maWdfcGVlcihoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKnBlZXIKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggKnBlZXIKKyNlbmRpZgorKTsKK2ludCB3bGFuX2hkZF90ZGxzX2V4dGN0cmxfY29uZmlnX3BlZXIoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqcGVlciwKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICpwZWVyLAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRkbHNfcmVxX3BhcmFtc190ICp0ZGxzX3BlZXJfcGFyYW1zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZmc4MDIxMV9leHR0ZGxzX2NhbGxiYWNrIGNhbGxiYWNrKTsKK3ZvaWQgaGRkX3RkbHNfbm90aWZ5X21vZGVfY2hhbmdlKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCk7Cit2b2lkIHdsYW5faGRkX3RkbHNfZGlzYWJsZV9vZmZjaGFuX2FuZF90ZWFyZG93bl9saW5rcyhoZGRfY29udGV4dF90ICpwSGRkQ3R4KTsKKy8qRVhUIFRETFMqLworaW50IHdsYW5faGRkX3RkbHNfZ2V0X3N0YXR1cyhoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHRBTklfVTgqIG1hYywKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTgqIG1hYywKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1MzMiAqc3RhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfUzMyICpyZWFzb24pOwordm9pZCB3bGFuX2hkZF90ZGxzX2dldF93aWZpX2hhbF9zdGF0ZShoZGRUZGxzUGVlcl90ICpjdXJyX3BlZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfUzMyICpzdGF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9TMzIgKnJlYXNvbik7CitpbnQgd2xhbl9oZGRfc2V0X2NhbGxiYWNrKGhkZFRkbHNQZWVyX3QgKmN1cnJfcGVlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgY2ZnODAyMTFfZX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BQkxFIEZPUiBBTlkgU1BFQ0lBTCwgRElSRUNULCBJTkRJUkVDVCwgT1IgQ09OU0VRVUVOVElBTAorICogREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NIExPU1MgT0YgVVNFLCBEQVRBIE9SCisgKiBQUk9GSVRTLCBXSEVUSEVSIElOIEFOIEFDVElPTiBPRiBDT05UUkFDVCwgTkVHTElHRU5DRSBPUiBPVEhFUgorICogVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmICFkZWZpbmVkKCBXTEFOX0hERF9UWF9SWF9IICkKKyNkZWZpbmUgV0xBTl9IRERfVFhfUlhfSAorCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBcZmlsZSAgd2xhbl9oZGRfdHhfcnguaAorCisgIFxicmllZiBMaW51eCBIREQgVHgvUlggQVBJcworICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgIElu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1RMICAyCisjZGVmaW5lIEhERF9MTENfSERSX0xFTiAgICAgICAgICAgNgorI2RlZmluZSBIRERfRlJBTUVfVFlQRV9NQVNLICAgICAgIDB4MGMgCisjZGVmaW5lIEhERF9GUkFNRV9TVUJUWVBFX01BU0sgICAgMHhmMCAKKyNkZWZpbmUgSEREX0ZSQU1FX1RZUEVfREFUQSAgICAgICAweDA4CisjZGVmaW5lIEhERF9GUkFNRV9UWVBFX01HTVQgICAgICAgMHgwMAorI2RlZmluZSBIRERfRlJBTUVfU1VCVFlQRV9RT1NEQVRBIDB4ODAKKyNkZWZpbmUgSEREX0ZSQU1FX1NVQlRZUEVfREVBVVRIICAweEMwCisjZGVmaW5lIEhERF9GUkFNRV9TVUJUWVBFX0RJU0FTU09DIDB4QTAKKyNkZWZpbmUgSEREX0RFU1RfQUREUl9PRkZTRVQgICAgICA2CisKKyNkZWZpbmUgSEREX01BQ19IRFJfU0laRSAgICAgICAgICA2CisKKyNkZWZpbmUgSEREX1BTQl9DRkdfSU5WQUxJRCAgICAgICAgICAgICAgICAgICAweEZGCisjZGVmaW5lIEhERF9QU0JfQ0hBTkdFRCAgICAgICAgICAgICAgICAgICAgICAgMHhGRgorI2RlZmluZSBTTUVfUU9TX1VBUFNEX0NGR19CS19DSEFOR0VEX01BU0sgICAgIDB4RjEKKyNkZWZpbmUgU01FX1FPU19VQVBTRF9DRkdfQkVfQ0hBTkdFRF9NQVNLICAgICAweEYyCisjZGVmaW5lIFNNRV9RT1NfVUFQU0RfQ0ZHX1ZJX0NIQU5HRURfTUFTSyAgICAgMHhGNAorI2RlZmluZSBTTUVfUU9TX1VBUFNEX0NGR19WT19DSEFOR0VEX01BU0sgICAgIDB4RjgKKworLyogV0xBTl9ESENQX0RFQlVHICovCisjZGVmaW5lIFJYX1BBVEggICAgICggMCApCisjZGVmaW5lIFRYX1BBVEggICAgICggMSApCisKKyNkZWZpbmUgQk9PVFBfU0VSVkVSX1BPUlQgICAgICAgICggNjcgKQorI2RlZmluZSBCT09UUF9DTElFTlRfUE9SVCAgICAgICAgKCA2OCApCisKKyNkZWZpbmUgRVRIX1RZUEVfT0ZGU0VUICAgICAgICggMTIgKQorI2RlZmluZSBFVEhfVFlQRV9JUF9QS1QgICAgICAgKCAweDA4MDAgKQorI2RlZmluZSBCT09UUF9NU0dfT0ZGU0VUICAgICAgKCA0MiApCisjZGVmaW5lIEJPT1RQX1JFUVVFU1RfTVNHICAgICAoIDEgKQorI2RlZmluZSBCT09UUF9SRVNQT05TRV9NU0cgICAgKCAyICkKKworI2RlZmluZSBESENQRElTQ09WRVIgICggMSApCisjZGVmaW5lIERIQ1BPRkZFUiAgICAgKCAyICkKKyNkZWZpbmUgREhDUFJFUVVFU1QgICAoIDMgKQorI2RlZmluZSBESENQQUNLICAgICAgICggNSApCisjZGVmaW5lIERIQ1BOQUsgICAgICAgKCA2ICkKKyNkZWZpbmUgREhDUFJFTEVBU0UgICAoIDcgKQorI2RlZmluZSBESENQSU5GT1JNICAgICggOCApCisKKyNkZWZpbmUgU0tCX01JTl9MRU5HVEggICAoIDM1ICkKKyNkZWZpbmUgUFJPVE9DT0xfT0ZGU0VUICAoIDkgKQorI2RlZmluZSBVRFBfUFJPVE9DT0wgICAgICggMTcgKQorCisjZGVmaW5lIFVEUF9TUkNfUE9SVF9PRkZTRVQgICAgICAgICAgICggMzQgKQorI2RlZmluZSBVRFBfREVTVF9QT1JUX09GRlNFVCAgICAgICAgICAoIDM2ICkKKworI2RlZmluZSBESENQX09QVElPTjUzICAgICAgICAgICAgICAgICAgKCAweDM1ICkKKyNkZWZpbmUgREhDUF9PUFRJT041M19MRU5HVEggICAgICAgICAgICggMSApCisjZGVmaW5lIERIQ1BfT1BUSU9ONTNfT0ZGU0VUICAgICAgICAgICAoIDB4MTFBICkKKyNkZWZpbmUgREhDUF9PUFRJT041M19MRU5HVEhfT0ZGU0VUICAgICggMHgxMUIgKQorI2RlZmluZSBESENQX09QVElPTjUzX1NUQVRVU19PRkZTRVQgICAgKCAwe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gICA6IE5FVF9YTUlUX1NVQ0NFU1MgaWYgcGFja2V0IGlzIGVucXVldWVkIHN1Y2Nlc2Z1bGx5CisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitleHRlcm4gaW50IGhkZF9pYnNzX2hhcmRfc3RhcnRfeG1pdChzdHJ1Y3Qgc2tfYnVmZiAqc2tiLCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX2hhcmRfc3RhcnRfeG1pdCgpIC0gRnVuY3Rpb24gcmVnaXN0ZXJlZCB3aXRoIHRoZSBMaW51eCBPUyBmb3IKKyAgdHJhbnNtaXR0aW5nIHBhY2tldHMKKworICBAcGFyYW0gc2tiICAgICAgOiBbaW5dICBwb2ludGVyIHRvIE9TIHBhY2tldCAoc2tfYnVmZikKKyAgQHBhcmFtIGRldiAgICAgIDogW2luXSBwb2ludGVyIHRvIExpYnJhIG5ldHdvcmsgZGV2aWNlCisgIAorICBAcmV0dXJuICAgICAgICAgOiBORVRfWE1JVF9EUk9QIGlmIHBhY2tldHMgYXJlIGRyb3BwZWQKKyAgICAgICAgICAgICAgICAgIDogTkVUX1hNSVRfU1VDQ0VTUyBpZiBwYWNrZXQgaXMgZW5xdWV1ZWQgc3VjY2VzZnVsbHkKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK2V4dGVybiBpbnQgaGRkX2hhcmRfc3RhcnRfeG1pdChzdHJ1Y3Qgc2tfYnVmZiAqc2tiLCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KTsKKworZXh0ZXJuIGludCBoZGRfbW9uX2hhcmRfc3RhcnRfeG1pdChzdHJ1Y3Qgc2tfYnVmZiAqc2tiLCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KTsKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF90eF90aW1lb3V0KCkgLSBGdW5jdGlvbiBjYWxsZWQgYnkgT1MgaWYgdGhlcmUgaXMgYW55CisgIHRpbWVvdXQgZHVyaW5nIHRyYW5zbWlzc2lvbi4gU2luY2UgSEREIHNpbXBseSBlbnF1ZXVlcyBwYWNrZXQKKyAgYW5kIHJldHVybnMgY29udHJvbCB0byBPUyByaWdodCBhd2F5LCB0aGlzIHdvdWxkIG5ldmVyIGJlIGludm9rZWQKKworICBAcGFyYW0gZGV2IDogW2luXSBwb2ludGVyIHRvIExpYnJhIG5ldHdvcmsgZGV2aWNlCisgIEByZXR1cm4gICAgOiBOb25lCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitleHRlcm4gdm9pZCBoZGRfdHhfdGltZW91dChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3N0YXRzKCkgLSBGdW5jdGlvbiByZWdpc3RlcmVkIHdpdGggdGhlIExpbnV4IE9TIGZvciAKKyAgZGV2aWNlIFRYL1JYIHN0YXRpc3RpY3MKKworICBAcGFyYW0gZGV2ICAgICAgOiBbaW5dIHBvaW50ZXIgdG8gTGlicmEgbmV0d29yayBkZXZpY2UKKyAgCisgIEByZXR1cm4gICAgICAgICA6IHBvaW50ZXIgdG8gbmV0X2RldmljZV9zdGF0cyBzdHJ1Y3R1cmUKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK2V4dGVybiBzdHJ1Y3QgbmV0X2RldmljZV9zdGF0cyogaGRkX3N0YXRzKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpOworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfaWJzc19pbml0X3R4X3J4KCkgLSBJbml0IGZ1bmN0aW9uIHRvIGluaXRpYWxpemUgVHgvUlgKKyAgbW9kdWxlcyBpbiBIREQKKworICBAcGFyYW0gcEFkYXB0ZXIgOiBbaW5dIHBvaW50ZXIgdG8gYWRhcHRlciBjb250ZXh0CisgIEByZXR1cm4gICAgICAgICA6IFZPU19TVEFUVVNfRV9GQUlMVVJFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQKKyAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworZXh0ZXJuIHZvaWQgaGRkX2lic3NfaW5pdF90eF9yeCggaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX2lic3NfZGVpbml0X3R4X3J4KCkgLSBEZWluaXQgZnVuY3Rpb24gdG8gY2xlYW4gdXAgVHgvUlgKKyAgbW9kdWxlcyBpbiBIREQKKworICBAcGFyYW0gcEFkYXB0ZXIgOiBbaW5dIHBvaW50ZXIgdG8gYWRhcHRlciBjb250ZXh0Li4KKyAgQHJldHVybiAgICAgICAgIDogVk9TX1NUQVRVU19FX0ZBSUxVUkUgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZC4KKyAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworZXh0ZXJuIFZPU19TVEFUVVMgaGRkX2lic3NfZGVpbml0X3R4X3J4KCBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciApOworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfaW5pdF90eF9yeCgpIC0gSW5pdCBmdW5jdGlvbiB0byBpbml0aWFsaXplIFR4L1JYCisgIG1vZHVsZXMgaW4gSERECisKKyAgQHBhcmFtIHBBZGFwdGVyIDogW2luXSBwb2ludGVyIHRvIGFkYXB0ZXIgY29udGV4dCAgCisgIEByZXR1cm4gICAgICAgICA6IFZPU19TVEFUVVNfRV9GQUlMVVJFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQgCisgICAgICAgICAgICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK2V4dGVybiBWT1NfU1RBVFVTIGhkZF9pbml0X3R4X3J4KCBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciApOworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfZGVpbml0X3R4X3J4KCkgLSBEZWluaXQgZnVuY3Rpb24gdG8gY2xlYW4gdXAgVHgvUlgKKyAgbW9kdWxlcyBpbiBIREQKKworICBAcGFyYW0gcEFkYXB0ZXIgOiBbaW5dIHBvaW50ZXIgdG8gYWRhcHRlciBjb250ZXh0ICAKKyAgQHJldHVybiAgICAgICAgIDogVk9TX1NUQVRVU19FX0ZBSUxVUkUgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZCAKKyAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworZXh0ZXJuIFZPU19TVEFUVVMgaGRkX2RlaW5pdF90eF9yeCggaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX2Rpc2Nvbm5lY3RfdHhfcngoKSAtIERpc2Nvbm5lY3QgZnVuY3Rpb24gdG8gY2xlYW4gdXAgVHgvUlgKKyAgbW9kdWxlcyBpbiBIREQKKworICBAcGFyYW0gcEFkYXB0ZXIgOiBbaW5dIHBvaW50ZXIgdG8gYWRhcHRlciBjb250ZXh0ICAKKyAgQHJldHVybiAgICAgICAgIDogVk9TX1NUQVRVU19FX0ZBSUxVUkUgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZCAKKyAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworZXh0ZXJuIFZPU19TVEFUVVMgaGRkX2Rpc2Nvbm5lY3RfdHhfcngoIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyICk7CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF90eF9jb21wbGV0ZV9jYmsoKSAtIENhbGxiYWNrIGZ1bmN0aW9uIGludm9rZWQgYnkgVEwKKyAgdG8gaW5kaWNhdGUgdGhhdCBhIHBhY2tldCBoYXMgYmVlbiB0cmFuc21pdHRlZCBhY3Jvc3MgdGhlIFNESU8gYnVzCisgIHN1Y2Nlc2Z1bGx5LiBPUyBwYWNrZXQgcmVzb3VyY2VzIGNhbiBiZSByZWxlYXNlZCBhZnRlciB0aGlzIGNiay4KKworICBAcGFyYW0gdm9zQ29udGV4dCAgIDogW2luXSBwb2ludGVyIHRvIFZPUyBjb250ZXh0ICAgCisgIEBwYXJhbSBwVm9zUGFja2V0ICAgOiBbaW5dIHBvaW50ZXIgdG8gVk9TIHBhY2tldCAoY29udGFpbmluZyBza2IpIAorICBAcGFyYW0gdm9zU3RhdHVzSW4gIDogW2luXSBzdGF0dXMgb2YgdGhlIHRyYW5zbWlzc2lvbiAKKworICBAcmV0dXJuICAgICAgICAgICAgIDogVk9TX1NUQVRVU19FX0ZBSUxVUkUgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZCAKKyAgICAgICAgICAgICAgICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK2V4dGVybiBWT1NfU1RBVFVTIGhkZF90eF9jb21wbGV0ZV9jYmsoIHZfVk9JRF90ICp2b3NDb250ZXh0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19wa3RfdCAqcFZvc1BhY2tldCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfU1RBVFVTIHZvc1N0YXR1c0luICk7CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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ICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBTdGFJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfQUNFbnVtVHlwZSAgICB1Y0FDLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19wa3RfdCAqKnBwVm9zUGFja2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9NZXRhSW5mb1R5cGUgKnBQa3RNZXRhSW5mbyApOworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfdHhfZmV0Y2hfcGFja2V0X2NiaygpIC0gQ2FsbGJhY2sgZnVuY3Rpb24gaW52b2tlZCBieSBUTCB0byAKKyAgZmV0Y2ggYSBwYWNrZXQgZm9yIHRyYW5zbWlzc2lvbi4KKworICBAcGFyYW0gdm9zQ29udGV4dCAgIDogW2luXSBwb2ludGVyIHRvIFZPUyBjb250ZXh0ICAKKyAgQHBhcmFtIHN0YUlkICAgICAgICA6IFtpbl0gU3RhdGlvbiBmb3Igd2hpY2ggVEwgaXMgcmVxdWVzdGluZyBhIHBrdAorICBAcGFyYW0gdWNBQyAgICAgICAgIDogW2luXSBwb2ludGVyIHRvIGFjY2VzcyBjYXRlZ29yeSByZXF1ZXN0ZWQgYnkgVEwKKyAgQHBhcmFtIHBWb3NQYWNrZXQgICA6IFtvdXRdIHBvaW50ZXIgdG8gVk9TIHBhY2tldCBwYWNrZXQgcG9pbnRlcgorICBAcGFyYW0gcFBrdE1ldGFJbmZvIDogW291dF0gcG9pbnRlciB0byBtZXRhIGluZm8gZm9yIHRoZSBwa3QgCisgIAorICBAcmV0dXJuICAgICAgICAgICAgIDogVk9TX1NUQVRVU19FX0VNUFRZIGlmIG5vIHBhY2tldHMgdG8gdHJhbnNtaXQKKyAgICAgICAgICAgICAgICAgICAgICA6IFZPU19TVEFUVVNfRV9GQUlMVVJFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQgCisgICAgICAgICAgICAgICAgICAgICAgOiBWT1NfU1RBVFVTX1NVQ0NFU1Mgb3RoZXJ3aXNlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitleHRlcm4gVk9TX1NUQVRVUyBoZGRfdHhfZmV0Y2hfcGFja2V0X2Niayggdl9WT0lEX3QgKnZvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwU3RhSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX0FDRW51bVR5cGUgICAgdWNBQywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfcGt0X3QgKipwcFZvc1BhY2tldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfTWV0YUluZm9UeXBlICpwUGt0TWV0YUluZm8gKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3R4X2xvd19yZXNvdXJjZV9jYmsoKSAtIENhbGxiYWNrIGZ1bmN0aW9uIGludm9rZWQgaW4gdGhlIAorICBjYXNlIHdoZXJlIFZPUyBwYWNrZXRzIGFyZSBub3QgYXZhaWxhYmxlIGF0IHRoZSB0aW1lIG9mIHRoZSBjYWxsIHRvIGdldCAKKyAgcGFja2V0cy4gVGhpcyBjYWxsYmFjayBmdW5jdGlvbiBpcyBpbnZva2VkIGJ5IFZPUyB3aGVuIHBhY2tldHMgYXJlIAorICBhdmFpbGFibGUuCisKKyAgQHBhcmFtIHBWb3NQYWNrZXQgOiBbaW5dICBwb2ludGVyIHRvIFZPUyBwYWNrZXQgCisgIEBwYXJhbSB1c2VyRGF0YSAgIDogW2luXSAgb3BhcXVlIHVzZXIgZGF0YSB0aGF0IHdhcyBwYXNzZWQgaW5pdGlhbGx5IAorICAKKyAgQHJldHVybiAgICAgICAgICAgOiBWT1NfU1RBVFVTX0VfRkFJTFVSRSBpZiBhbnkgZXJyb3JzIGVuY291bnRlcmVkLCAKKyAgICAgICAgICAgICAgICAgICAgOiBWT1NfU1RBVFVTX1NVQ0NFU1Mgb3RoZXJ3aXNlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK2V4dGVybiBWT1NfU1RBVFVTIGhkZF90eF9sb3dfcmVzb3VyY2VfY2JrKCB2b3NfcGt0X3QgKnBWb3NQYWNrZXQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVk9JRF90ICp1c2VyRGF0YSApOworCitleHRlcm4gVk9TX1NUQVRVUyBoZGRfcnhfcGFja2V0X21vbml0b3JfY2JrKHZfVk9JRF90ICp2b3NDb250ZXh0LHZvc19wa3RfdCAqcFZvc1BhY2tldCwgaW50IGNvbnZlcnNpb24pOworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfcnhfcGFja2V0X2NiaygpIC0gUmVjZWl2ZSBjYWxsYmFjayByZWdpc3RlcmVkIHdpdGggVEwuCisgIFRMIHdpbGwgY2FsbCB0aGlzIHRvIG5vdGlmeSB0aGUgSEREIHdoZW4gYSBwYWNrZXQgd2FzIHJlY2VpdmVkIAorICBmb3IgYSByZWdpc3RlcmVkIFNUQS4KKworICBAcGFyYW0gdm9zQ29udGV4dCAgIDogW2luXSBwb2ludGVyIHRvIFZPUyBjb250ZXh0ICAKKyAgQHBhcmFtIHBWb3NQYWNrZXQgICA6IFtpbl0gcG9pbnRlciB0byBWT1MgcGFja2V0IChjb25hdGluaW5nIHNrX2J1ZmYpIAorICBAcGFyYW0gc3RhSWQgICAgICAgIDogW2luXSBTdGF0aW9uIElkCisgIEBwYXJhbSBwUnhNZXRhSW5mbyAgOiBbaW5dIHBvaW50ZXIgdG8gbWV0YSBpbmZvIGZvciB0aGUgcmVjZWl2ZWQgcGt0KHMpIAorCisgIEByZXR1cm4gICAgICAgICAgICAgOiBWT1NfU1RBVFVTX0VfRkFJTFVSRSBpZiBhbnkgZXJyb3JzIGVuY291bnRlcmVkLCAKKyAgICAgICAgICAgICAgICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK2V4dGVybiBWT1NfU1RBVFVTIGhkZF9yeF9wYWNrZXRfY2JrKCB2X1ZPSURfdCAqdm9zQ29udGV4dCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX3BrdF90ICpwVm9zUGFja2V0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3Qgc3RhSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX1J4TWV0YUluZm9UeXBlKiBwUnhNZXRhSW5mbyApOworCisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF9Jc0VBUE9MUGFja2V0KCkgLSBDaGVja3MgdGhlIHBhY2tldCBpcyBFQVBPTCBvciBub3QuCisKKyAgQHBhcmFtIHBWb3NQYWNrZXQgOiBbaW5dIHBvaW50ZXIgdG8gdm9zIHBhY2tldCAgCisgIEByZXR1cm4gICAgICAgICA6IFZPU19UUlVFIGlmIHRoZSBwYWNrZXQgaXMgRUFQT0wgCisgICAgICAgICAgICAgICAgICA6IFZPU19GQUxTRSBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK2V4dGVybiB2X0JPT0xfdCBoZGRfSXNFQVBPTFBhY2tldCggdm9zX3BrdF90ICpwVm9zUGFja2V0ICk7CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF9tb25fdHhfbWdtdF9wa3QoKSAtIFRyYW5zbWl0IE1HTVQgcGFja2V0IHJlY2VpdmVkIG9uIG1vbml0b3IgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlcmZhY2UuCisKKyAgQHBhcmFtIHBBZGFwdGVyOiBbaW5dIFNBUC9QMlAgR08gYWRhcHRlci4KKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgaGRkX21vbl90eF9tZ210X3BrdChoZGRfYWRhcHRlcl90KiBwQWRhcHRlcik7CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF9tb25fdHhfd29ya19xdWV1ZSgpIC0gd29ya3F1ZXVlIGhhbmRsZXIgZm9yIHRyYW5zbWl0dGluZyBtZ210IHBhY2tldHMuLgorCisgIEBwYXJhbSB3b3JrOiBbaW5dIHdvcmtxdWV1ZSBzdHJ1Y3R1cmUuCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIGhkZF9tb25fdHhfd29ya19xdWV1ZShzdHJ1Y3Qgd29ya19zdHJ1Y3QgKndvcmspOworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfSWJzc19HZXRTdGFJZCgpIC0gR2V0IHRoZSBTdGF0aW9uSUQgdXNpbmcgdGhlIFBlZXIgTWFjIGFkZHJlc3MKKyAgQHBhcmFtIHBIZGRTdGFDdHggOiBbaW5dIHBvaW50ZXIgdG8gSEREIFN0YXRpb24gQ29udGV4dAorICBwTWFjQWRkcmVzcyBbaW5dICBwb2ludGVyIHRvIFBlZXIgTWFjIGFkZHJlc3MKKyAgc3RhSUQgW291dF0gIHBvaW50ZXIgdG8gU3RhdGlvbiBJbmRleAorICBAcmV0dXJuICAgIDogVk9TX1NUQVRVU19TVUNDRVNTL1ZPU19TVEFUVVNfRV9GQUlMVVJFCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIGhkZF9JYnNzX0dldFN0YUlkKGhkZF9zdGF0aW9uX2N0eF90ICpwSGRkU3RhQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfTUFDQUREUl90ICpwTWFjQWRkcmVzcywgdl9VOF90ICpzdGFJZCk7CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF90eF9yeF9wa3RfY250X3N0YXRfdGltZXJfaGFuZGxlcigpIC0KKyAgICAgICAgICAgICAgICAgICAgVGltZXIgaGFuZGxlciB0byBjaGVjayBlbmFibGUvZGlzYWJsZSBzcGxpdCBzY2FuCisgIEBwYXJhbSBwSGRkU3RhQ3R4IDogSGRkIGFkYXB0ZXIKKyAgQHJldHVybiAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUy9WT1NfU1RBVFVTX0VfRkFJTFVSRQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBoZGRfdHhfcnhfcGt0X2NudF9zdGF0X3RpbWVyX2hhbmRsZXIoIHZvaWQgKnBBZGFwdGVyKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX2ZsdXNoX2lic3NfdHhfcXVldWVzKCkgLQorICAgICAgICAgICAgICAgICAgICBGbHVzaCB0eCBxdWV1ZXMgaW4gSUJTUyBtb2RlCisgIEBwYXJhbSBwQWRhcHRlcjogSGRkIGFkYXB0ZXIKKyAgQHBhcmFtIFNUQUlkOiAgICBTdGEgaW5kZXgKKyAgQHJldHVybiAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUy9WT1NfU1RBVFVTX0VfRkFJTFVSRQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBoZGRfZmx1c2hfaWJzc190eF9xdWV1ZXMoIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLCB2X1U4X3QgU1RBSWQpOworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfd21tX2FjcXVpcmVfYWNjZXNzX3JlcXVpcmVkKCktCisgICAgICAgICAgICAgICAgICAgRGV0ZXJtaW5lIHdoZXRoZXIgd21tIGFjIGFjcXVpcmUgYWNjZXNzIGlzIHJlcXVpcmVkCisgIEBwYXJhbSBwQWRhcHRlciAgOiBwb2ludGVyIHRvIEFkYXB0ZXIgY29udGV4dAorICBAcGFyYW0gYWNUeXBlICAgIDogQUMKKyAgQHJldHVybiAgICAgICAgICA6IHZvaWQKKyAgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIGhkZF93bW1fYWNxdWlyZV9hY2Nlc3NfcmVxdWlyZWQoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX0FDRW51bVR5cGUgYWNUeXBlKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX2R1bXBfZGhjcF9wa3QoKS0gRm9yIHByaW50aW5nIERIQ1AgbG9ncworICBAcGFyYW0gc2tiICAgICA6IHBvaW50ZXIgdG8gc2tiCisgIEBwYXJhbSBwYXRoICAgIDogcGF0aCBkaXJlY3Rpb24KKyAgQHJldHVybiAgICAgICAgOiB2b2lkCisgICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBoZGRfZHVtcF9kaGNwX3BrdChzdHJ1Y3Qgc2tfYnVmZiAqc2tiLCBpbnQgcGF0aCk7CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRElBR19TVVBQT1JUCisvKioKKyAqIHdsYW5faGRkX2xvZ19lYXBvbCgpIC0gRnVuY3Rpb24gdG8gY2hlY2sgYW5kIGV4dHJhY3QgRUFQT0wgcGFyYW1zCisgKiBAc2tiOiAgICAgICAgICAgICAgIHNrYiBkYXRhCisgKiBAZXZlbnRfdHlwZTogICAgICAgIE9uZSBvZiBlbnVtIHdpZmlfY29ubmVjdGl2aXR5X2V2ZW50cyB0byBpbmRpY2F0ZSBUeC9SeAorIC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UaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorLy8KKy8vICBGaWxlOiAgICAgICAgIGhkZF9WZXJzaW9uLmgKKy8vCisvLyAgRGVzY3JpcHRpb246ICBNaW5pcG9ydCBkcml2ZXIgdmVyc2lvbiBpbmZvcm1hdGlvbgorLy8KKy8vICBBdXRob3I6ICAgICAgIExhcnJ5IENhd2xleQorLy8gCisvLyAgQ29weXJpZ2h0IDIwMDcsIFFVQUxDT01NLCBJbmMuICBBbGwgcmlnaHRzIHJlc2VydmVkLgorLy8KKy8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorI2lmICFkZWZpbmVkKCBfX2hkZFZlcnNpb25faF9fICkKKyNkZWZpbmUgX19oZGRWZXJzaW9uX2hfXworCisvLyBmb3JjZSBzdHJpbmcgZXhwYW5zaW9uIGZyb20gY2hhcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisjZGVmaW5lIHN0ckVYUEFORCh4KSAjeAorI2RlZmluZSBzdHJTVFJJTkcoeCkgc3RyRVhQQU5EKHgpCisjZGVmaW5lIHN0clZFUlNJT04oIF9taiwgX21uLCBfc2Z4LCBfYnVpbGQgKSBzdHJTVFJJTkcoX21qKSAiLiIgc3RyU1RSSU5HKF9tbikgIi4iIHN0clNUUklORyhfc2Z4KSAiLiIgc3RyU1RSSU5HKF9idWlsZCkKKworCisjaWYgZGVmaW5lZCggQkxEX1JFTCApCisjZGVmaW5lIEhERF9EUklWRVJfTUFKT1JfVkVSU0lPTiBCTERfUkVMCisjZWxzZSAKKyNkZWZpbmUgSEREX0RSSVZFUl9NQUpPUl9WRVJTSU9OICAgICAgICAgICAgIDAgICAKKyNlbmRpZgorCisjaWYgZGVmaW5lZCggQkxEX1ZFUiApCisjZGVmaW5lIEhERF9EUklWRVJfTUlOT1JfVkVSU0lPTiBCTERfVkVSCisjZWxzZSAKKyNkZWZpbmUgSEREX0RSSVZFUl9NSU5PUl9WRVJTSU9OICAgICAgICAgICAgIDAKKyNlbmRpZgorCisjaWYgZGVmaW5lZCggQkxEX1NGWCApCisjZGVmaW5lIEhERF9EUklWRVJfU1VGRklYIEJMRF9TRlggCisjZWxzZQorI2RlZmluZSBIRERfRFJJVkVSX1NVRkZJWCAgICAgICAgICAgICAgICAgICAgMAorI2VuZGlmIAorCisjaWYgZGVmaW5lZCggQkxEX05VTSApCisjZGVmaW5lIEhERF9EUklWRVJfQlVJTEQgQkxEX05VTQorI2Vsc2UgCisjZGVmaW5lIEhERF9EUklWRVJfQlVJTEQgICAgICAgICAgICAgICAgICAgICAwMDAwICAKKyNlbmRpZiAKKyNkZWZpbmUgSEREX0JVSUxEX0RBVEVUSU1FIF9fREFURV9fICIgIiBfX1RJTUVfXyAgCisKKyNkZWZpbmUgSEREX0RSSVZFUl9WRVJTSU9OIFdOSV9EUklWRVJfTUFKT1JfVkVSU0lPTixXTklfRFJJVkVSX01JTk9SX1ZFUlNJT04KKworI2RlZmluZSBIRERfRFJJVkVSX1ZFUlNJT05fU1RSIHN0clZFUlNJT04oIFdOSV9EUklWRVJfTUFKT1JfVkVSU0lPTiwgV05JX0RSSVZFUl9NSU5PUl9WRVJTSU9OLCBXTklfRFJJVkVSX1NVRkZJWCwgV05JX0RSSVZFUl9CVUlMRCApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorI2RlZmluZSBIRERfQ09NUEFOWU5BTUVfRlVMTCAgICAgICAgIlFVQUxDT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lIDxsaW51eC90aW1lci5oPgorI2luY2x1ZGUgInZvc19ldmVudC5oIgorCisvKgorICogb3JkZXIgb2YgcGFyYW1ldGVycyBpbiBhZGRUcyBwcml2YXRlIGlvY3RsCisgKi8KKyNkZWZpbmUgSEREX1dMQU5fV01NX1BBUkFNX0hBTkRMRSAgICAgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBIRERfV0xBTl9XTU1fUEFSQU1fVElEICAgICAgICAgICAgICAgICAgICAgICAgICAxCisjZGVmaW5lIEhERF9XTEFOX1dNTV9QQVJBTV9ESVJFQ1RJT04gICAgICAgICAgICAgICAgICAgIDIKKyNkZWZpbmUgSEREX1dMQU5fV01NX1BBUkFNX0FQU0QgICAgICAgICAgICAgICAgICAgICAgICAgMworI2RlZmluZSBIRERfV0xBTl9XTU1fUEFSQU1fVVNFUl9QUklPUklUWSAgICAgICAgICAgICAgICA0CisjZGVmaW5lIEhERF9XTEFOX1dNTV9QQVJBTV9OT01JTkFMX01TRFVfU0laRSAgICAgICAgICAgIDUKKyNkZWZpbmUgSEREX1dMQU5fV01NX1BBUkFNX01BWElNVU1fTVNEVV9TSVpFICAgICAgICAgICAgNgorI2RlZmluZSBIRERfV0xBTl9XTU1fUEFSQU1fTUlOSU1VTV9EQVRBX1JBVEUgICAgICAgICAgICA3CisjZGVmaW5lIEhERF9XTEFOX1dNTV9QQVJBTV9NRUFOX0RBVEFfUkFURSAgICAgICAgICAgICAgIDgKKyNkZWZpbmUgSEREX1dMQU5fV01NX1BBUkFNX1BFQUtfREFUQV9SQVRFICAgICAgICAgICAgICAgOQorI2RlZmluZSBIRERfV0xBTl9XTU1fUEFSQU1fTUFYX0JVUlNUX1NJWkUgICAgICAgICAgICAgIDEwCisjZGVmaW5lIEhERF9XTEFOX1dNTV9QQVJBTV9NSU5JTVVNX1BIWV9SQVRFICAgICAgICAgICAgMTEKKyNkZWZpbmUgSEREX1dMQU5fV01NX1BBUkFNX1NVUlBMVVNfQkFORFdJRFRIX0FMTE9XQU5DRSAxMgorI2RlZmluZSBIRERfV0xBTl9XTU1fUEFSQU1fU0VSVklDRV9JTlRFUlZBTCAgICAgICAgICAgIDEzCisjZGVmaW5lIEhERF9XTEFOX1dNTV9QQVJBTV9TVVNQRU5TSU9OX0lOVEVSVkFMICAgICAgICAgMTQKKyNkZWZpbmUgSEREX1dMQU5fV01NX1BBUkFNX0JVUlNUX1NJWkVfREVGTiAgICAgICAgICAgICAxNQorI2RlZmluZSBIRERfV0xBTl9XTU1fUEFSQU1fQUNLX1BPTElDWSAgICAgICAgICAgICAgICAgIDE2CisjZGVmaW5lIEhERF9XTEFOX1dNTV9QQVJBTV9JTkFDVElWSVRZX0lOVEVSVkFMICAgICAgICAgMTcKKyNkZWZpbmUgSEREX1dMQU5fV01NX1BBUkFNX01BWF9TRVJWSUNFX0lOVEVSVkFMICAgICAgICAxOAorI2RlZmluZSBIRERfV0xBTl9XTU1fUEFSQU1fQ09VTlQgICAgICAgICAgICAgICAgICAgICAgIDE5CisKKyNkZWZpbmUgTUhaIDYKKworI2RlZmluZSBXRV9NQVhfU1RSX0xFTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwMjQKKyNkZWZpbmUgV0xBTl9IRERfVUlfQkFORF9BVVRPICAgICAgICAgICAgICAgICAgICAgICAgICAwCisjZGVmaW5lIFdMQU5fSEREX1VJX0JBTkRfNV9HSFogICAgICAgICAgICAgICAgICAgICAgICAgMQorI2RlZmluZSBXTEFOX0hERF9VSV9CQU5EXzJfNF9HSFogICAgICAgICAgICAgICAgICAgICAgIDIKKy8qIFNFVEJBTkQgeCAqLworLyogMDEyMzQ1Njc4ICovCisjZGVmaW5lIFdMQU5fSEREX1VJX1NFVF9CQU5EX1ZBTFVFX09GRlNFVCAgICAgICAgICAgICAgOAorCisjaWZkZWYgV0xBTl9TT0ZUQVBfVlNUQV9GRUFUVVJFCisvKiA0MSAtIFNUQSBzdXBwb3J0IHdpdGggVmlydHVhbCBTVEEgZmVhdHVyZQorICog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V1BTX0VMRU1fUkZfQkFORFMgICAgICAgICAgICAgICAweDEwM2MgCisjZGVmaW5lIEhERF9XUFNfRUxFTV9BU1NPQ0lBVElPTl9TVEFURSAgICAgIDB4MTAwMiAKKyNkZWZpbmUgSEREX1dQU19FTEVNX0NPTkZJR1VSQVRJT05fRVJST1IgICAgMHgxMDA5CisjZGVmaW5lIEhERF9XUFNfRUxFTV9ERVZJQ0VfUEFTU1dPUkRfSUQgICAgIDB4MTAxMiAKKworI2RlZmluZSBIRERfV1BBX0VMRU1fVkVORE9SX0VYVEVOU0lPTiAgICAgICAweDEwNDkKKworI2RlZmluZSBIRERfV1BTX01BTlVGQUNUVVJFUl9MRU4gICAgICAgICAgICA2NAorI2RlZmluZSBIRERfV1BTX01PREVMX05BTUVfTEVOICAgICAgICAgICAgICAzMgorI2RlZmluZSBIRERfV1BTX01PREVMX05VTV9MRU4gICAgICAgICAgICAgICAzMgorI2RlZmluZSBIRERfV1BTX1NFUklBTF9OVU1fTEVOICAgICAgICAgICAgICAzMgorI2RlZmluZSBIRERfV1BTX0RFVklDRV9PVUlfTEVOICAgICAgICAgICAgICAgNAorI2RlZmluZSBIRERfV1BTX0RFVklDRV9OQU1FX0xFTiAgICAgICAgICAgICAzMgorCisjZGVmaW5lIEhERF9XUFNfRUxFTV9XUFNfU1RBVEUgICAgICAgICAgICAgIDB4MTA0NAorI2RlZmluZSBIRERfV1BTX0VMRU1fQVBTRVRVUExPQ0sgICAgICAgICAgICAweDEwNTcKKyNkZWZpbmUgSEREX1dQU19FTEVNX1NFTEVDVEVEUkVHSVNUUkEgICAgICAgMHgxMDQxICAKKyNkZWZpbmUgSEREX1dQU19FTEVNX1JTUF9UWVBFICAgICAgICAgICAgICAgMHgxMDNCCisjZGVmaW5lIEhERF9XUFNfRUxFTV9NQU5VRkFDVFVSRVIgICAgICAgICAgIDB4MTAyMQorI2RlZmluZSBIRERfV1BTX0VMRU1fTU9ERUxfTkFNRSAgICAgICAgICAgICAweDEwMjMKKyN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ICpmcmVxKTsKK2V4dGVybiBpbnQgaGRkX3dsYW5fZ2V0X3J0c190aHJlc2hvbGQoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUpOworZXh0ZXJuIGludCBoZGRfd2xhbl9nZXRfZnJhZ190aHJlc2hvbGQoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUpOworZXh0ZXJuIHZvaWQgaGRkX3dsYW5fZ2V0X3ZlcnNpb24oaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSk7CisKK2V4dGVybiBpbnQgaXdfZ2V0X3NjYW4oc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKTsKKworZXh0ZXJuIGludCBpd19zZXRfc2NhbihzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSk7CisKK2V4dGVybiBpbnQgaXdfc2V0X2NzY2FuKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSk7CisKK2V4dGVybiBpbnQgaXdfc2V0X2Vzc2lkKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsIAorICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKTsKKworZXh0ZXJuIGludCBpd19nZXRfZXNzaWQoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19wb2ludCAqZHdycSwgY2hhciAqZXh0cmEpOworCisKK2V4dGVybiBpbnQgaXdfc2V0X2FwX2FkZHJlc3Moc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpOworCitleHRlcm4gaW50IGl3X2dldF9hcF9hZGRyZXNzKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKTsKKworZXh0ZXJuIGludCBpd19zZXRfYXV0aChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsY2hhciAqZXh0cmEpOworCitleHRlcm4gaW50IGl3X2dldF9hdXRoKHN0cnVjdCBuZXRfZGV2aWNlICpkZXY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F5cyAiQXV0byIuIEluCisgICAvLyB0aGF0IGNhc2UsIFNUQSBpcyBmcmVlIHRvIGpvaW4gMTFuIEFQLiBBbHRob3VnaCBmcm9tIEhERCBwb2ludCBvZiB2aWV3LAorICAgLy8gaXQgd2lsbCBub3QgYmUgZG9pbmcgYW55IHBhY2tldCBjbGFzc2lmaWNhdGlvbnMKKyAgIEhERF9XTU1fVVNFUl9NT0RFX05PX1FPUyA9IDIsCisKK30gaGRkX3dtbV91c2VyX21vZGVfdDsKKworLy8gVUFQU0QgTWFzayBiaXRzCisvLyAoQml0MDpWTzsgQml0MTpWSTsgQml0MjpCSzsgQml0MzpCRSBhbGwgb3RoZXIgYml0cyBhcmUgaWdub3JlZCkKKyNkZWZpbmUgSEREX0FDX1ZPIDB4MQorI2RlZmluZSBIRERfQUNfVkkgMHgyCisjZGVmaW5lIEhERF9BQ19CSyAweDQKKyNkZWZpbmUgSEREX0FDX0JFIDB4OAorCisvKiEgQGJyaWVmIFdNTSBRb3MgaW5zdGFuY2UgY29udHJvbCBibG9jaworKi8KK3R5cGVkZWYgc3RydWN0Cit7CisgICBzdHJ1Y3QgbGlzdF9oZWFkICAgICAgICAgICAgIG5vZGU7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZTsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICAgcW9zRmxvd0lkOworICAgaGRkX2FkYXB0ZXJfdCogICAgICAgICAgICAgICBwQWRhcHRlcjsKKyAgIFdMQU5UTF9BQ0VudW1UeXBlICAgICAgICAgICAgYWNUeXBlOworICAgaGRkX3dsYW5fd21tX3N0YXR1c19lICAgICAgICBsYXN0U3RhdHVzOworICAgc3RydWN0IHdvcmtfc3RydWN0ICAgICAgICAgICB3bW1BY1NldHVwSW1wbGljaXRRb3M7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgIG1hZ2ljOworfSBoZGRfd21tX3Fvc19jb250ZXh0X3Q7CisKKy8qISBAYnJpZWYg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Wxsb3dlZDsKKworICAgLy8gaXMgdGhlIHdtbUFjVHNwZWNJbmZvIHZhbGlkPworICAgdl9CT09MX3QgICAgICAgICAgICAgICAgICAgICB3bW1BY1RzcGVjVmFsaWQ7CisKKyAgIC8vIGFyZSB0aGUgd21tQWNVYXBzZCogZmllbGRzIHZhbGlkPworICAgdl9CT09MX3QgICAgICAgICAgICAgICAgICAgICB3bW1BY1VhcHNkSW5mb1ZhbGlkOworCisgICAvLyBjdXJyZW50IChwb3NzaWJseSBhZ2dyZWdhdGUpIFRzcGVjIGZvciB0aGlzIEFDCisgICBzbWVfUW9zV21tVHNwZWNJbmZvICAgICAgICAgIHdtbUFjVHNwZWNJbmZvOworCisgICAvLyBjdXJyZW50IFUtQVBTRCBwYXJhbWV0ZXJzCisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgIHdtbUFjSXNVYXBzZEVuYWJsZWQ7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgIHdtbUFjVWFwc2RTZXJ2aWNlSW50ZXJ2YWw7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgIHdtbUFjVWFwc2RTdXNwZW5zaW9uSW50ZXJ2YWw7CisgICBzbWVfUW9zV21tRGlyVHlwZSAgICAgICAgICAgIHdtbUFjVWFwc2REaXJlY3Rpb247CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICAvLyBJbmFjdGl2aXR5IHRpbWUgcGFyYW1ldGVycyBmb3IgVFNQRUMKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICAgd21tSW5hY3Rpdml0eVRpbWU7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgIHdtbVByZXZUcmFmZmljQ250OworICAgdm9zX3RpbWVyX3QgICAgICAgICAgICAgICAgICB3bW1JbmFjdGl2aXR5VGltZXI7CisjZW5kaWYKKworfSBoZGRfd21tX2FjX3N0YXR1c190OworCisvKiEgQGJyaWVmIFdNTSBzdGF0ZSAmIHN0YXR1cyBpbmZvCisqLwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgIHN0cnVjdCBsaXN0X2hlYWQgICAgICAgICAgICAgd21tQ29udGV4dExpc3Q7CisgICBoZGRfd21tX2FjX3N0YXR1c190ICAgICAgICAgIHdtbUFjU3RhdHVzW1dMQU5UTF9NQVhfQUNdOworICAgdl9CT09MX3QgICAgICAgICAgICAgICAgICAgICB3bW1RYXA7CisgICB2X0JPT0xfdCAgICAgICAgICAgICAgICAgICAgIHdtbVFvc0Nvbm5lY3Rpb247Cit9IGhkZF93bW1fc3RhdHVzX3Q7CisKK2V4dGVybiBjb25zdCB2X1U4X3QgaGRkX1FkaXNjQWNUb1RsQUNbXTsKK2V4dGVybiBjb25zdCB2X1U4X3QgaGRkV21tVXBUb0FjTWFwW107IAorZXh0ZXJuIGNvbnN0IHZfVThfdCBoZGRMaW51eFVwVG9BY01hcFtdOworCisjZGVmaW5lIFdMQU5fSEREX01BWF9EU0NQIDB4M2YKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3dtbV9pbml0KCkgLSBGdW5jdGlvbiB3aGljaCB3aWxsIGluaXRpYWxpemUgdGhlIFdNTSBjb25maWd1YXRpb24KKyAgYW5kIHN0YXR1cyB0byBhbiBpbml0aWFsIHN0YXRlLiAgVGhlIGNvbmZpZ3VyYXRpb24gY2FuIGxhdGVyIGJlIG92ZXJ3cml0dGVuCisgIHZpYSBhcHBsaWNhdGlvbiBBUElzCisKKyAgQHBhcmFtIHBBZGFwdGVyIDogW2luXSAgcG9pbnRlciB0byBBZGFwdGVyIGNvbnRleHQKKworICBAcmV0dXJuICAgICAgICAgOiBWT1NfU1RBVFVTX1NVQ0NFU1MgaWYgc3VjY3NzZnVsCisgICAgICAgICAgICAgICAgICA6IG90aGVyIHZhbHVlcyBpZiBmYWlsdXJlCisKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgaGRkX3dtbV9pbml0ICggaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3dtbV9hZGFwdGVyX2luaXQoKSAtIEZ1bmN0aW9uIHdoaWNoIHdpbGwgaW5pdGlhbGl6ZSB0aGUgV01NIGNvbmZpZ3VhdGlvbgorICBhbmQgc3RhdHVzIHRvIGFuIGluaXRpYWwgc3RhdGUuICBUaGUgY29uZmlndXJhdGlvbiBjYW4gbGF0ZXIgYmUgb3ZlcndyaXR0ZW4KKyAgdmlhIGFwcGxpY2F0aW9uIEFQSXMKKworICBAcGFyYW0gcEFkYXB0ZXIgOiBbaW5dICBwb2ludGVyIHRvIEFkYXB0ZXIgY29udGV4dAorCisgIEByZXR1cm4gICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBpZiBzdWNjc3NmdWwKKyAgICAgICAgICAgICAgICAgIDogb3RoZXIgdmFsdWVzIGlmIGZhaWx1cmUKKworICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBoZGRfd21tX2FkYXB0ZXJfaW5pdCggaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3dtbV9hZGFwdGVyX2Nsb3NlKCkgLSBGdW5jdGlvbiB3aGljaCB3aWxsIHBlcmZvcm0gYW55IG5lY2Vzc2FyeSB3b3JrIHRvCisgIHRvIGNsZWFuIHVwIHRoZSBXTU0gZnVuY3Rpb25hbGl0eSBwcmlvciB0byB0aGUga2VybmVsIG1vZHVsZSB1bmxvYWQKKworICBAcGFyYW0gcEFkYXB0ZXIgOiBbaW5dICBwb2ludGVyIHRvIGFkYXB0ZXIgY29udGV4dAorCisgIEByZXR1cm4gICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBpZiBzdWNjc3NmdWwKKyAgICAgICAgICAgICAgICAgIDogb3RoZXIgdmFsdWVzIGlmIGZhaWx1cmUKKworICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBoZGRfd21tX2FkYXB0ZXJfY2xvc2UgKCBoZGRfYWRhcHRlcl90KiBwQWRhcHRlciApOworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfd21tX3NlbGVjdF9xdWV1ZSgpIC0gRnVuY3Rpb24gd2hpY2ggd2lsbCBjbGFzc2lmeSBhbiBPUyBwYWNrZXQKKyAgaW50byBsaW51eCBRZGlzYyBleHBlY3RhdGlvbgorCisgIEBwYXJhbSBkZXYgICAgICA6IFtpbl0gIHBvaW50ZXIgdG8gbmV0X2RldmljZSBzdHJ1Y3R1cmUKKyAgQHBhcmFtIHNrYiAgICAgIDogW2luXSAgcG9pbnRlciB0byBPUyBwYWNrZXQgKHNrX2J1ZmYpCisKKyAgQHJldHVybiAgICAgICAgIDogcXVldWVfaW5kZXgvbGludXggQUMgdmFsdWUuCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2X1UxNl90IGhkZF93bW1fc2VsZWN0X3F1ZXVlKHN0cnVjdCBuZXRfZGV2aWNlICogZGV2LCBzdHJ1Y3Qgc2tfYnVmZiAqc2tiKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX2hvc3RhcGRfc2VsZWN0X3F1ZXVlKCkgLSBGdW5jdGlvbiB3aGljaCB3aWxsIGNsYXNzaWZ5IHRoZSBwYWNrZXQKKyAgICAgICAgIGFjY29yZGluZyB0byBsaW51eCBxZGlzYyBleHBlY3RhdGlvbi4KKworCisgIEBwYXJhbSBkZXYgICAgICA6IFtpbl0gIHBvaW50ZXIgdG8gbmV0X2RldmljZSBzdHJ1Y3R1cmUKKyAgQHBhcmFtIHNrYiAgICAgIDogW2luXSAgcG9pbnRlciB0byBvcyBwYWNrZXQKKworICBAcmV0dXJuICAgICAgICAgOiBRZGlzYyBxdWV1ZSBpbmRleAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCit2X1UxNl90IGhkZF9ob3N0YXBkX3NlbGVjdF9xdWV1ZShzdHJ1Y3QgbmV0X2RldmljZSAqIGRldiwgc3RydWN0IHNrX2J1ZmYgKnNrYgorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxMywwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICwgdm9pZCAqYWNjZWxfcHJpdgorI2VuZGlmCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE0LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLCBzZWxlY3RfcXVldWVfZmFsbGJhY2tfdCBmYWxsYmFjCisjZW5kaWYKKyk7CisKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3dtbV9jbGFzc2lmeV9wa3QoKSAtIEZ1bmN0aW9uIHdoaWNoIHdpbGwgY2xhc3NpZnkgYW4gT1MgcGFja2V0CisgIGludG8gYSBXTU0gQUMgYmFzZWQgb24gZWl0aGVyIDgwMi4xUSBvciBEU0NQCisKKyAgQHBhcmFtIHBBZGFwdGVyIDogW2luXSAgcG9pbnRlciB0byBhZGFwdGVyIGNvbnRleHQKKyAgQHBhcmFtIHNrYiAgICAgIDogW2luXSAgcG9pbnRlciB0byBPUyBwYWNrZXQgKHNrX2J1ZmYpCisgIEBwYXJhbSBwQWNUeXBlICA6IFtvdXRdIHBvaW50ZXIgdG8gV01NIEFDIHR5cGUgb2YgT1MgcGFja2V0CisKKyAgQHJldHVybiAgICAgICAgIDogTm9uZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordl9WT0lEX3QgaGRkX3dtbV9jbGFzc2lmeV9wa3QgKCBoZGRfYWRhcHRlcl90KiBwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHNrX2J1ZmYgKnNrYiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX0FDRW51bVR5cGUqIHBBY1R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtZV9Rb3NXbW1VcFR5cGUqIHBVc2VyUHJpKTsKKworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfd21tX2FjcXVpcmVfYWNjZXNzKCkgLSBGdW5jdGlvbiB3aGljaCB3aWxsIGF0dGVtcHQgdG8gYWNxdWlyZQorICBhZG1pdHRhbmNlIGZvciBhIFdNTSBBQworCisgIEBwYXJhbSBwQWRhcHRlciA6IFtpbl0gIHBvaW50ZXIgdG8gYWRhcHRlciBjb250ZXh0CisgIEBwYXJhbSBhY1R5cGUgICA6IFtpbl0gIFdNTSBBQyB0eXBlIG9mIE9TIHBhY2tldAorICBAcGFyYW0gcEdyYW50ZWQgOiBbb3V0XSBwb2ludGVyIHRvIGJvb2xlYW4gZmxhZyB3aGVuIGluZGljYXRlcyBpZiBhY2Nlc3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaGFzIGJlZW4gZ3JhbnRlZCBvciBub3QKKworICBAcmV0dXJuICAgICAgICAgOiBWT1NfU1RBVFVTX1NVQ0NFU1MgaWYgc3VjY3NzZnVsCisgICAgICAgICAgICAgICAgICA6IG90aGVyIHZhbHVlcyBpZiBmYWlsdXJlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIGhkZF93bW1fYWNxdWlyZV9hY2Nlc3MoIGhkZF9hZGFwdGVyX3QqIHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfQUNFbnVtVHlwZSBhY1R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfQk9PTF90ICogcEdyYW50ZWQgKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3dtbV9hc3NvYygpIC0gRnVuY3Rpb24gd2hpY2ggd2lsbCBoYW5kbGUgdGhlIGhvdXNla2VlcGluZworICByZXF1aXJlZCBieSBXTU0gd2hlbiBhc3NvY2lhdGlvbiB0YWtlcyBwbGFjZQorCisgIEBwYXJhbSBwQWRhcHRlciA6IFtpbl0gIHBvaW50ZXIgdG8gYWRhcHRlciBjb250ZXh0CisgIEBwYXJhbSBwUm9hbUluZm86IFtpbl0gIHBvaW50ZXIgdG8gcm9hbSBpbmZvcm1hdGlvbgorICBAcGFyYW0gZUJzc1R5cGUgOiBbaW5dICB0eXBlIG9mIEJTUworCisgIEByZXR1cm4gICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBpZiBzdWNjc3NmdWwKKyAgICAgICAgICAgICAgICAgIDogb3RoZXIgdmFsdWVzIGlmIGZhaWx1cmUKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgaGRkX3dtbV9hc3NvYyggaGRkX2FkYXB0ZXJfdCogcEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRDc3JSb2FtSW5mbyAqcFJvYW1JbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICBlQ3NyUm9hbUJzc1R5cGUgZUJzc1R5cGUgKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3dtbV9jb25uZWN0KCkgLSBGdW5jdGlvbiB3aGljaCB3aWxsIGhhbmRsZSB0aGUgaG91c2VrZWVwaW5nCisgIHJlcXVpcmVkIGJ5IFdNTSB3aGVuIGEgY29ubmVjdGlvbiBpcyBlc3RhYmxpc2hlZAorCisgIEBwYXJhbSBwQWRhcHRlciA6IFtpbl0gIHBvaW50ZXIgdG8gYWRhcHRlciBjb250ZXh0CisgIEBwYXJhbSBwUm9hbUluZm86IFtpbl0gIHBvaW50ZXIgdG8gcm9hbSBpbmZvcm1hdGlvbgorICBAcGFyYW0gZUJzc1R5cGUgOiBbaW5dICB0eXBlIG9mIEJTUworCisgIEByZXR1cm4gICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBpZiBzdWNjc3NmdWwKKyAgICAgICAgICAgICAgICAgIDogb3RoZXIgdmFsdWVzIGlmIGZhaWx1cmUKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgaGRkX3dtbV9jb25uZWN0KCBoZGRfYWRhcHRlcl90KiBwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Q3NyUm9hbUluZm8gKnBSb2FtSW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ3NyUm9hbUJzc1R5cGUgZUJzc1R5cGUgKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3dtbV9nZXRfdWFwc2RfbWFzaygpIC0gRnVuY3Rpb24gd2hpY2ggd2lsbCBjYWxjdWxhdGUgdGhlCisgIGluaXRpYWwgdmFsdWUgb2YgdGhlIFVBUFNEIG1hc2sgYmFzZWQgdXBvbiB0aGUgZGV2aWNlIGNvbmZpZ3VyYXRpb24KKworICBAcGFyYW0gcEFkYXB0ZXIgIDogW2luXSAgcG9pbnRlciB0byBhZGFwdGVyIGNvbnRleHQKKyAgQHBhcmFtIHBVYXBzZE1hc2s6IFtpbl0gIHBvaW50ZXIgdG8gd2hlcmUgdGhlIFVBUFNEIE1hc2sgaXMgdG8gYmUgc3RvcmVkCisKKyAgQHJldHVybiAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIGlmIHN1Y2Nzc2Z1bAorICAgICAgICAgICAgICAgICAgOiBvdGhlciB2YWx1ZXMgaWYgZmFpbHVyZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBoZGRfd21tX2dldF91YXBzZF9tYXNrKCBoZGRfYWRhcHRlcl90KiBwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcFVhcHNkTWFzayApOworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfd21tX2lzX2FjdGl2ZSgpIC0gRnVuY3Rpb24gd2hpY2ggd2lsbCBkZXRlcm1pbmUgaWYgV01NIGlzCisgIGFjdGl2ZSBvbiB0aGUgY3VycmVudCBjb25uZWN0aW9uCisKKyAgQHBhcmFtIHBBZGFwdGVyICA6IFtpbl0gIHBvaW50ZXIgdG8gYWRhcHRlciBjb250ZXh0CisKKyAgQHJldHVybiAgICAgICAgIDogVk9TX1RSVUUgaWYgV01NIGlzIGVuYWJsZWQKKyAgICAgICAgICAgICAgICAgIDogVk9TX0ZBTFNFIGlmIFdNTSBpcyBub3QgZW5hYmxlZAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordl9CT09MX3QgaGRkX3dtbV9pc19hY3RpdmUoIGhkZF9hZGFwdGVyX3QqIHBBZGFwdGVyICk7CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF93bW1fYWRkdHMoKSAtIEZ1bmN0aW9uIHdoaWNoIHdpbGwgYWRkIGEgdHJhZmZpYyBzcGVjIGF0IHRoZQorICByZXF1ZXN0IG9mIGFuIGFwcGxpY2F0aW9uCisKKyAgQHBhcmFtIHBBZGFwdGVyICA6IFtpbl0gIHBvaW50ZXIgdG8gYWRhcHRlciBjb250ZXh0CisgIEBwYXJhbSBoYW5kbGUgICAgOiBbaW5dICBoYW5kbGUgdG8gdW5pcXVlbHkgaWRlbnRpZnkgYSBUUworICBAcGFyYW0gcFRzcGVjICAgIDogW2luXSAgcG9pbnRlciB0byB0aGUgdHJhZmZpYyBzcGVjCisKKyAgQHJldHVybiAgICAgICAgICA6IEhERF9XTEFOX1dNTV9TVEFUVVNfKiAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK2hkZF93bGFuX3dtbV9zdGF0dXNfZSBoZGRfd21tX2FkZHRzKCBoZGRfYWRhcHRlcl90KiBwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IGhhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbWVfUW9zV21tVHNwZWNJbmZvKiBwVHNwZWMgKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3dtbV9kZWx0cygpIC0gRnVuY3Rpb24gd2hpY2ggd2lsbCBkZWxldGUgYSB0cmFmZmljIHNwZWMgYXQgdGhlCisgIHJlcXVlc3Qgb2YgYW4gYXBwbGljYXRpb24KKworICBAcGFyYW0gcEFkYXB0ZXIgIDogW2luXSAgcG9pbnRlciB0byBhZGFwdGVyIGNvbnRleHQKKyAgQHBhcmFtIGhhbmRsZSAgICA6IFtpbl0gIGhhbmRsZSB0byB1bmlxdWVseSBpZGVudGlmeSBhIFRTCisKKyAgQHJldHVybiAgICAgICAgICA6IEhERF9XTEFOX1dNTV9TVEFUVVNfKiAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK2hkZF93bGFuX3dtbV9zdGF0dXNfZSBoZGRfd21tX2RlbHRzKCBoZGRfYWRhcHRlcl90KiBwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IGhhbmRsZSApOworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfd21tX2NoZWNrdHMoKSAtIEZ1bmN0aW9uIHdoaWNoIHdpbGwgcmV0dXJuIHRoZSBzdGF0dXMgb2YgYSB0cmFmZmljCisgIHNwZWMgYXQgdGhlIHJlcXVlc3Qgb2YgYW4gYXBwbGljYXRpb24KKworICBAcGFyYW0gcEFkYXB0ZXIgIDogW2luXSAgcG9pbnRlciB0byBhZGFwdGVyIGNvbnRleHQKKyAgQHBhcmFtIGhhbmRsZSAgICA6IFtpbl0gIGhhbmRsZSB0byB1bmlxdWVseSBpZGVudGlmeSBhIFRTCisKKyAgQHJldHVybiAgICAgICAgICA6IEhERF9XTEFOX1dNTV9TVEFUVVNfKiAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK2hkZF93bGFuX3dtbV9zdGF0dXNfZSBoZGRfd21tX2NoZWNrdHMoIGhkZF9hZGFwdGVyX3QqIHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBoYW5kbGUgKTsKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF93bW1fYWRhcHRlcl9jbGVhcigpIC0gRnVuY3Rpb24gd2hpY2ggd2lsbCBjbGVhciB0aGUgV01NIHN0YXR1cworICBvZiBhbGwgQUNzCisgIEBwYXJhbSBwQWRhcHRlciAgOiBbaW5dICBwb2ludGVyIHRvIGFkYXB0ZXIgY29udGV4dAorCisgIEByZXR1cm4gICAgICAgICAgOiBWT1NfU1RBVFVTX1NVQ0NFU1MgaWYgc3VjY3NzZnVsCisgICAgICAgICAgICAgICAgICAgO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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICogVHlwZSBEZWNsYXJhdGlvbnMKKyAqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfYWRkX3dvd2xfcHRybigpIC0gRnVuY3Rpb24gd2hpY2ggd2lsbCBhZGQgdGhlIFdvV0wgcGF0dGVybiB0byBiZQorICB1c2VkIHdoZW4gUEJNIGZpbHRlcmluZyBpcyBlbmFibGVkCisKKyAgQHBhcmFtIHB0cm4gOiBbaW5dICBwb2ludGVyIHRvIHRoZSBwYXR0ZXJuIHN0cmluZyB0byBiZSBhZGRlZAorCisgIEByZXR1cm4gICAgIDogRkFMU0UgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZAorICAgICAgICAgICAgICA6IFRSVUUgb3RoZXJ3aXNlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2X0JPT0xfdCBoZGRfYWRkX3dvd2xfcHRybiAoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsIGNvbnN0IGNoYXIgKiBwdHJuKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX2RlbF93b3dsX3B0cm4oKSAtIEZ1bmN0aW9uIHdoaWNoIHdpbGwgcmVtb3ZlIGEgV29XTCBwYXR0ZXJuCisKKyAgQHBhcmFtIHB0cm4gOiBbaW5dICBwb2ludGVyIHRvIHRoZSBwYXR0ZXJuIHN0cmluZyB0byBiZSByZW1vdmVkCisKKyAgQHJldHVybiAgICAgOiBGQUxTRSBpZiBhbnkgZXJyb3JzIGVuY291bnRlcmVkCisgICAgICAgICAgICAgIDogVFJVRSBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZfQk9PTF90IGhkZF9kZWxfd293bF9wdHJuIChoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwgY29uc3QgY2hhciAqIHB0cm4pOworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfYWRkX3dvd2xfcHRybl9kZWJ1Z2ZzKCkgLSBGdW5jdGlvbiB3aGljaCB3aWxsIGFkZCBhIFdvVyBwYXR0ZXJuCisgIHNlbnQgZnJvbSBkZWJ1Z2ZzIGludGVyZmFjZQorCisgIEBwYXJhbSBwQWRhcHRlciAgICAgICA6IFtpbl0gcG9pbnRlciB0byB0aGUgYWRhcHRlcgorICAgICAgICAgcGF0dGVybl9pZHggICAgOiBbaW5dIGluZGV4IG9mIHRoZSBwYXR0ZXJuIHRvIGJlIGFkZGVkCisgICAgICAgICBwYXR0ZXJuX29mZnNldCA6IFtpbl0gb2Zmc2V0IG9mIHRoZSBwYXR0ZXJuIGluIHRoZSBmcmFtZSBwYXlsb2FkCisgICAgICAgICBwYXR0ZXJuX2J1ZiAgICA6IFtpbl0gcG9pbnRlciB0byB0aGUgcGF0dGVybiBoZXggc3RyaW5nIHRvIGJlIGFkZGVkCisgICAgICAgICBwYXR0ZXJuX21hc2sgICA6IFtpbl0gcG9pbnRlciB0byB0aGUgcGF0dGVybiBtYXNrIGhleCBzdHJpbmcKKworICBAcmV0dXJuICAgICAgICAgICAgICAgOiBGQUxTRSBpZiBhbnkgZXJyb3JzIGVuY291bnRlcmVkCisgICAgICAgICAgICAgICAgICAgICAgICA6IFRSVUUgb3RoZXJ3aXNlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2X0JPT0xfdCBoZGRfYWRkX3dvd2xfcHRybl9kZWJ1Z2ZzKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLCB2X1U4X3QgcGF0dGVybl9pZHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCBwYXR0ZXJuX29mZnNldCwgY2hhciAqcGF0dGVybl9idWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgKnBhdHRlcm5fbWFzayk7CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF9kZWxfd293bF9wdHJuX2RlYnVnZnMoKSAtIEZ1bmN0aW9uIHdoaWNoIHdpbGwgcmVtb3ZlIGEgV29XIHBhdHRlcm4KKyAgc2VudCBmcm9tIGRlYnVnZnMgaW50ZXJmYWNlCisKKyAgQHBhcmFtIHBBZGFwdGVyICAgIDogW2luXSBwb2ludGVyIHRvIHRoZSBhZGFwdGVyCisgICAgICAgICBwYXR0ZXJuX2lkeCA6IFtpbl0gaW5kZXggb2YgdGhlIHBhdHRlcm4gdG8gYmUgcmVtb3ZlZAorCisgIEByZXR1cm4gICAgICAgICAgICA6IEZBTFNFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQKKyAgICAgICAgICAgICAgICAgICAgIDogVFJVRSBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZfQk9PTF90IGhkZF9kZWxfd293bF9wdHJuX2RlYnVnZnMoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsIHZfVThfdCBwYXR0ZXJuX2lkeCk7CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF9lbnRlcl93b3dsKCkgLSBGdW5jdGlvbiB3aGljaCB3aWxsIGVuYWJsZSBXb1dMLiBBdGxlYXN0IG9uZQorICBvZiBNUCBhbmQgUEJNIG11c3QgYmUgZW5hYmxlZAorCisgIEBwYXJhbSBlbmFibGVfbXAgIDogW2luXSBXaGV0aGVyIHRvIGVuYWJsZSBtYWdpYyBwYWNrZXQgV29XTCBtb2RlCisgIEBwYXJhbSBlbmFibGVfcGJtIDogW2luXSBXaGV0aGVyIHRvIGVuYWJsZSBwYXR0ZXJuIGJ5dGUgbWF0Y2hpbmcgV29XTCBtb2RlCisKKyAgQHJldHVybiAgICAgICAgICAgOiBGQUxTRSBpZiBhbnkgZXJyb3JzIGVuY291bnRlcmVkCisgICAgICAgICAgICAgICAgICAgIDogVFJVRSBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZfQk9PTF90IGhkZF9lbnRlcl93b3dsIChoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwgdl9CT09MX3QgZW5hYmxlX21wLCB2X0JPT0xfdCBlbmFibGVfcGJtKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX2V4aXRfd293bCgpIC0gRnVuY3Rpb24gd2hpY2ggd2lsbCBkaXNhYmxlIFdvV0wKKworICBAcGFyYW0gd293bEV4aXRTcmM6IGlzIHdvd2wgZXhpdGluZyBiZWNhdXNlIG9mIHdha2V1cCBwa3Qgb3IgdXNlciBleHBsaWNpdGx5CisgICAgICAgICAgICAgICAgICAgICAgZGlzYWJsaW5nIFdvV0wKKworICBAcmV0dXJuICAgICAgICAgICA6IEZBTFNFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQKKyAgICAgICAgICAgICAgICAgICAgOiBUUlVFIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordl9CT09MX3QgaGRkX2V4aXRfd293bCAoaGRkX2FkYXB0ZXJfdCpwQWRhcHRlciwgdFdvd2xFeGl0U291cmNlIHdvd2xFeGl0U3JjKTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX2luaXRfd293bCgpIC0gSW5pdCBmdW5jdGlvbiB3aGljaCB3aWxsIGluaXRpYWxpemUgdGhlIFdvV0wgbW9kdWxlCisgIGFuZCBwZXJmb3JtIGFueSByZXF1aXJlZCBpbnRpYWwgY29uZmlndXJhdGlvbiAKKworICBAcmV0dXJuICAgICAgICAgICA6IEZBTFNFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQKKyAgICAgICAgICAgICAgICAgICAgOiBUUlVFIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordl9CT09MX3QgaGRkX2luaXRfd293bCAoaGRkX2FkYXB0ZXJfdCogcEFkYXB0ZXIpOworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRf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5lIF9fV0xBTl9RQ1RfRFJJVkVSX0gKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIAorICBcZmlsZSAgd2xhbl9xY3RfZHJpdmVyLmgKKyAgCisgIFxicmllZiBIZWFkZXIgZmlsZSBmb3IgV2lyZWxlc3MgTEFOIEhvc3QgRGV2aWNlIERyaXZlciBLZXJuZWwgTW9kdWxlCisgICAgICAgICAgICAgICAKKyAgCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAKKworICAgICAgICAgICAgICAgICAgICAgICBFRElUIEhJU1RPUlkgRk9SIEZJTEUgCisgICAKKyAgIAorICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4gCisgIE5vdGljZSB0aGF0IGNoYW5nZXMgYXJlIGxpc3RlZCBpbiByZXZlcnNlIGNocm9ub2xvZ2ljYWwgb3JkZXIuIAorICAgCisgICAKKyAgJEhlYWRlcjokICREYXRlVGltZTogJCAkQXV0aG9yOiAkIAorICAgCisgICAKKyAgd2hlbiAgICAgICAgd2hvICAgIHdoYXQsIHdoZXJlLCB3aHkgCisgIC0tLS0tLS0tICAgIC0tLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAwNC8wNS8wOSAgICBrYW5hbmQgICAgIENyZWF0ZWQgbW9kdWxlLiAKKworICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL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lsZSB3YXMgb3JpZ2luYWxseSBkaXN0cmlidXRlZCBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIFxmaWxlICBiYXBfaGRkX21haW4uYworCisgIFxicmllZiA4MDIuMTEgQlQtQU1QIFBBTCBIb3N0IERldmljZSBEcml2ZXIgaW1wbGVtZW50YXRpb24KKworCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgICBFRElUIEhJU1RPUlkgRk9SIEZJTEUKKworCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLgorICBOb3RpY2UgdGhhdCBjaGFuZ2VzIGFyZSBsaXN0ZWQgaW4gcmV2ZXJzZSBjaHJvbm9sb2dpY2FsIG9yZGVyLgorCisKKyAgJEhlYWRlcjogL3Byai9xY3QvYXN3L2VuZ2J1aWxkcy9zY2wvdXNlcnMwMi9qem11ZGEvZ2ItYmx1ZXovdmVuZG9yL3Fjb20vcHJvcHJpZXRhcnkvd2xhbi9saWJyYS9DT1JFL0hERC9zcmMvYmFwX2hkZF9tYWluLmMsdiAxLjYzIDIwMTEvMDQvMDEgMTU6MjQ6MjAganptdWRhIEV4cCBqem11ZGEgJCAgICREYXRlVGltZTogJ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fTEVOX1NJWkUgIChDTURfVExWX1RZUEVfU0laRSArIENNRF9UTFZfTEVOX1NJWkUpCisKKy8vIEV2ZW50IFRMViByZWxhdGVkIGRlZmluZXMKKyNkZWZpbmUgRVZFTlRfVExWX1RZUEVfU0laRSAxCisjZGVmaW5lIEVWRU5UX1RMVl9MRU5fU0laRSAxCisjZGVmaW5lIEVWRU5UX1RMVl9UWVBFX0FORF9MRU5fU0laRSAgKEVWRU5UX1RMVl9UWVBFX1NJWkUgKyBFVkVOVF9UTFZfTEVOX1NJWkUpCisKKy8vIERhdGEgaGVhZGVyIHNpemUgcmVsYXRlZCBkZWZpbmVzCisjZGVmaW5lIERBVEFfSEVBREVSX1NJWkUgNAorCisjZW5kaWYgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBVU0VfRklOQUxfRlJBTUVTQworLy8gamltegorCisjZGVmaW5lIEJTTF9NQVhfRVZFTlRfU0laRSA3MDAKKworI2RlZmluZSBCU0xfREVWX0hBTkRMRSAweDEyMzQKKworLy8gRGVidWcgcmVsYXRlZCBkZWZpbmVzCisjZGVmaW5lIERCR0xPRyBwcmludGYKKy8vI2RlZmluZSBEVU1QTE9HCisjaWYgZGVmaW5lZCBEVU1QTE9HCisjZGVmaW5lIERVTVBMT0cobiwgbmFtZTEsIG5hbWUyLCBhU3RyLCBzaXplKSBkbyB7ICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgIGludCBpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgIERCR0xPRygiJWQuICVzOiAlcyA9IFxuIiwgbiwgbmFtZTEsIG5hbWUyKTsgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgIGZvciAoaSA9IDA7IGkgPCBzaXplOyBpKyspICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICBEQkdMT0coIiUyLjJ4JXMiLCAoKHVuc2lnbmVkIGNoYXIgKilhU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XBlZGVmIHN0cnVjdAoreworICAgIEJPT0wgICAgICAgICAgICAgICAgICAgICAgICAgdXNlZDsgICAgICAgICAgLy8gaXMgdGhpcyBhIHZhbGlkIGNvbnRleHQ/CisgICAgdm9zX2V2ZW50X3QgICAgICAgICAgICAgICAgICBSZWFkYWJsZUV2dDsgICAvLyB0aGUgZXZlbnQgYSBSZWFkRmlsZSBjYW4gYmxvY2sgb24KKyAgICBwdEJ0YW1wSGFuZGxlICAgICAgICAgICAgICAgIGJhcEhkbDsgICAgICAgIC8vIG91ciBoYW5kbGUgaW4gQkFQCisgICAgdm9zX2xpc3RfdCAgICAgICAgICAgICAgICAgICBQaHlMaW5rczsgICAgICAvLyBhIGxpc3Qgb2YgYWxsIGFzc29jaWF0aW9ucyBzZXR1cCBieSB0aGlzIGNsaWVudAorLy8gIE5ld2x5IGFkZGVkIGZvciBCbHVlWgorICAgIHN0cnVjdCBoY2lfZGV2ICAgICAgICAgICAgICAgKmhkZXY7ICAgICAgICAvLyB0aGUgQmx1ZVogSENJIGRldmljZSBzdHJ1Y3R1cmUKKworICAgIC8qIEkgZG9uJ3Qga25vdyBob3cgbWFueSBvZiB0aGVzZSBUeCBmaWVsZHMgd2UgbmVlZCAqLworICAgIHNwaW5sb2NrX3QgICAgICAgICAgICAgICAgICAgbG9jazsgICAgICAgICAvKiBGb3Igc2VyaWFsaXppbmcgb3BlcmF0aW9ucyAqLworCisgICAgc3RydWN0ICAgICAgICAgICAgICAgICAgICAgICBza19idWZmX2hlYWQgdHhxOyAvKiBXZSBuZWVkIHRoZSBBQ0wgRGF0YSBUeCBxdWV1ZSAqLworCisgICAgLyogV2UgZGVmaW5pdGVseSBuZWVkIHNvbWUgb2YgdGhlc2Ugcnhfc2tiIGZpZWxkcyAqLworICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgICAgICAgcnhfc3RhdGU7CisgICAgdW5zaWduZWQgbG9uZyAgICAgICAgICAgICAgICByeF9jb3VudDsKKyAgICBzdHJ1Y3Q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ApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIFF1ZXVlIGlzIGVtcHR5LiAgVGhpcyBjYW4gaGFwcGVuLiAgSnVzdCByZXR1cm4gTlVMTCBiYWNrIHRvIFRMLi4uCisgICAgICAgICAgICByZXR1cm4oVk9TX1NUQVRVU19FX0VNUFRZKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmICggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyggVm9zU3RhdHVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfQVNTRVJUKCAwICk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBpZiAoICFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIFZvc1N0YXR1cyApICkKKyAgICB7CisgICAgICAgIFZPU19BU1NFUlQoIDAgKTsKKyAgICB9CisKKyAgICBwTm9kZSA9IChCc2xUeExpc3ROb2RlVHlwZSAqKXBMaW5rOworICAgIHNrYiAgID0gcE5vZGUtPnNrYjsKKworICAgLy8gSSB3aWxsIGFjY2VzcyB0aGUgc2tiIGluIGEgVk9TUyBwYWNrZXQKKyAgIC8vIFdyYXAgdGhlIE9TIHByb3ZpZGVkIHNrYiBpbiBhIFZPU1MgcGFja2V0CisgICAgLy8gQXR0YWNoIHNrYiB0byBWT1MgcGFja2V0LgorICAgIFZvc1N0YXR1cyA9IHZvc19wa3Rfd3JhcF9kYXRhX3BhY2tldCggJnBWb3NQa3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfUEtUX1RZUEVfVFhfODAyXzNfREFUQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNrYiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMKTsKKworICAgIGlmICggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyggVm9zU3RhdHVzIC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GVja2luZworICAgIGlmICggcEhkZEhkbCA9PSBOVUxMIHx8IHZvc0RhdGFCdWZmID09IE5VTEwgfHwgcFJ4TWV0YUluZm8gPT0gTlVMTCApCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJXTEFOQkFQX1NUQVJ4Q0IgYmFkIGlucHV0IiApOworICAgICAgICBpZihOVUxMICE9IHZvc0RhdGFCdWZmKQorICAgICAgICB7CisgICAgICAgICAgICBWb3NTdGF0dXMgPSB2b3NfcGt0X3JldHVybl9wYWNrZXQoIHZvc0RhdGFCdWZmICk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgIH0KKworICAgIHBjdHggPSAoQnNsUGh5TGlua0N0eFR5cGUgKilwSGRkSGRsOworICAgIHBwY3R4ID0gcGN0eC0+cENsaWVudEN0eDsKKworICAgIGlmKCBOVUxMID09IHBwY3R4ICkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIldMQU5CQVBfU1RBUnhDQiBDbGllbnRDdHggaXMgTlVMTCIgKTsKKyAgICAgICAgVm9zU3RhdHVzID0gdm9zX3BrdF9yZXR1cm5fcGFja2V0KCB2b3NEYXRhQnVmZiApOworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgfQorCisgICAgLy8gd2FsayB0aGUgY2hhaW4gdW50aWwgYWxsIGFyZSBwcm9jZXNzZWQKKyAgIHBWb3NQYWNrZXQgPSB2b3NEYXRhQnVmZjsKKyAgIGRvCisgICB7CisgICAgICAgLy8gZ2V0IHRoZSBwb2ludGVyIHRvIHRoZSBuZXh0IHBhY2tldCBpbiB0aGUgY2hhaW4KKyAgICAgICAvLyAoYnV0IGRvbid0IHVubGluayB0aGUgcGFja2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FVkVOVCAhPSBwQmFwSENJRXZlbnQtPmJhcEhDSUV2ZW50Q29kZSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBjdHggPSBncEJzbGN0eDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwgIldMQU5CQVBfRXZlbnRDQiBiYWQgaW5wdXQiICk7CisgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICAgIH0KKyAgICB9CisKKworICAgIGlmKE5VTEwgIT0gcEhkZEhkbCkKKyAgICB7CisgICAgICAgIGlmICggQXNzb2NTcGVjaWZpY0V2ZW50ICkKKyAgICAgICAgeworICAgICAgICAgICAgLy8gZ2V0IHRoZSBhcHAgY29udGV4dCBmcm9tIHRoZSBhc3NvYyBjb250ZXh0CisgICAgICAgICAgICBwY3R4ID0gKChCc2xQaHlMaW5rQ3R4VHlwZSAqKXBIZGRIZGwpLT5wQ2xpZW50Q3R4OworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcGN0eCA9IChCc2xDbGllbnRDdHhUeXBlICopcEhkZEhkbDsKKyAgICAgICAgfQorICAgIH0KKworICAgIGlmKE5VTEwgPT0gcGN0eCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICJwY3R4IGlzIE5VTEwgaW4gJXMiLCBfX2Z1bmNfXyk7CisKKyAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKworICAgIH0KKworICAgIFZvc1N0YXR1cyA9IHZvc19wa3RfZ2V0X3BhY2tldCggJnBWb3NQa3QsIFZPU19QS1RfVFlQRV9SWF9SQVcsCisgICAgICAgIC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uX3BhY2tldCggcFZvc1BrdCApOworCisgICAgICAgICAgICBWT1NfQVNTRVJUKFZPU19JU19TVEFUVVNfU1VDQ0VTUyggVm9zU3RhdHVzICkpOworCisgICAgICAgICAgICByZXR1cm4oVk9TX1NUQVRVU19FX0ZBSUxVUkUpOworICAgICAgICB9CisKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgQlRBTVBfVExWX0hDSV9RT1NfVklPTEFUSU9OX0VWRU5UOgorICAgIHsKKyAgICAgICAgLy8gcGFjaworICAgICAgICBQYWNrU3RhdHVzID0gYnRhbXBQYWNrVGx2SENJX1Fvc19WaW9sYXRpb25fRXZlbnQoIHBjdHgsCisgICAgICAgICAgICAgICAgICAgICAmcEJhcEhDSUV2ZW50LT51LmJ0YW1wUW9zVmlvbGF0aW9uRXZlbnQsIEJ1ZmYsIEJTTF9NQVhfRVZFTlRfU0laRSwgJldyaXR0ZW4gKTsKKworICAgICAgICBpZiAoICFCVEFNUF9TVUNDRUVERUQoIFBhY2tTdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICJXTEFOQkFQX0V2ZW50Q0I6IGJ0YW1wVW5wYWNrVGx2SENJX0NyZWF0ZV9QaHlzaWNhbF9MaW5rX0NtZCBmYWlsZWQgc3RhdHVzICVkIiwgUGFja1N0YXR1cyk7CisgICAgICAgICAgICAvLyBoYW5kbGUgdGhlIGVycm9yCisgICAgICAgICAgICBWb3NTdGF0dXMgPSB2b3NfcGt0X3JldHVybl9wYWNrZXQoIHBWb3NQa3QgKTsKKworICAgICAgICAgICAgVk9TX0FTU0VSVChWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIFZvc1N0YXR1cyApKTsKKworICAgICAgICAgICAgcmV0dXJuKFZPU19TVEFUVVNfRV9GQUlMVVJFKTsKKyAgICAgICAgfQorCisgICAgICAgIGJyZ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ICAgICB7CisgICAgICAgICAgICAvLyByZWdpc3RlciB0aGUgZGF0YSBwbGFuZSBub3cKKyAgICAgICAgICAgIFZvc1N0YXR1cyA9IFdMQU5CQVBfUmVnaXN0ZXJEYXRhUGxhbmUoIHBjdHgtPmJhcEhkbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5CQVBfU1RBRmV0Y2hQa3RDQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5CQVBfU1RBUnhDQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5CQVBfVHhDb21wQ0IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoQnNsUGh5TGlua0N0eFR5cGUgKilwSGRkSGRsICk7CisKKyAgICAgICAgICAgIGlmICggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyggVm9zU3RhdHVzICkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIldMQU5CQVBfRXZlbnRDQiBXTEFOQkFQX1JlZ2lzdGVyRGF0YVBsYW5lICIKKyAgICAgICAgICAgICAgICAgICJmYWlsZWQgc3RhdHVzID0gJWQiLCBWb3NTdGF0dXMgKTsKKyAgICAgICAgICAgICAgICAvLyB3ZSBzdGlsbCB3YW50IHRvIHNlbmQgdGhlIGV2ZW50IHVwdG8gYXBwIHNvIGRvIG5vdCBiYWlsCisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gdXBkYXRlIHRoZSBwaHkgbGluayBoYW5kbGUgYmFzZWQgbWFwIHNvIFRYIGRhdGEgY2FuIHN0YXJ0IGZsb3dpbmcgdGhyb3VnaAorICAgICAgICAgICAgICAgIE9sZE1hcFZhbCA9IHZvc19hdG9taWNfc2V0KCAodWludHB0cl90KilCc2xQaHlMaW5rTWFwK3BCYXBIQ0lFdmVudC0+dS5idGFtcFBoeXNpY2FsTGlua0NvbXBsZXRlRXZlbnQucGh5X2xpbmtfaGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVpbnRwdHJfdCkgcEhkZEhkbCApOworCisvLyAgICAgICAgICAgICAgICAgIFZPU19BU1NFUlQoIE9sZE1hcFZhbCA9PSAwICk7Ly9Db21tZW50ZWQgdG8gdGVzdCByZWNvbm5lY3QKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmICggcEJhcEhDSUV2ZW50LT51LmJ0YW1wUGh5c2ljYWxMaW5rQ29tcGxldGVFdmVudC5zdGF0dXMgPT0KKyAgICAgICAgICAgICAgICAgIFdMQU5CQVBfRVJST1JfSE9TVF9SRUpfUkVTT1VSQ0VTICkKKyAgICAgICAgeworICAgICAgICAgICAgQnNsUmVsZWFzZVBoeUN0eCggKEJzbFBoeUxpbmtDdHhUeXBlICopcEhkZEhkbCApOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKCBwQmFwSENJRXZlbnQtPnUuYnRhbXBQaHlzaWNhbExpbmtDb21wbGV0ZUV2ZW50LnN0YXR1cyA9PQorICAgICAgICAgICAgICAgICAgV0xBTkJBUF9FUlJPUl9IT1NUX1RJTUVPVVQgKQorICAgICAgICB7CisgICAgICAgICAgICAvL1dlIG5lZWQgdG8gdXBkYXRlIHRoZSBwaHkgbGluayBoYW5kbGUgaGVyZSB0byBiZSBhYmxlIHRvIHJlaXNzdWUgcGh5c2ljYWwgbGluayBhY2NlcHQKKyAgICAgICAgICAgIC8vIHVwZGF0ZSB0aGUgcGh5IGxpbmsgaGFuZGxlIGJhc2VkIG1hcCBzbyBUWCBkYXRhIGNhbiBzdGFydCBmbG93aW5nIHRocm91Z2gKKyAgICAgICAgICAgIE9sZE1hcFZhbCA9IHZvc19hdG9taWNfc2V0KCAodWludHB0cl90KilCc2xQaHlMaW5rTWFwK3BCYXBIQ0lFdmVudC0+dS5idGFtcFBoeXNpY2FsTGlua0NvbXBsZXRlRXZlbnQucGh5X2xpbmtfaGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodWludHB0cl90KSBwSGRkSGRsICk7CisKKy8vICAgICAgICAgICAgICAgICAgVk9TX0FTU0VSVCggT2xkTWFwVmFsID09IDAgKTsvL0NvbW1lbnRlZCB0byB0ZXN0IHJlY29ubmVjdAorCisgICAgICAgICAgICBCc2xSZWxlYXNlUGh5Q3R4KCAoQnNsUGh5TGlua0N0eFR5cGUgKilwSGRkSGRsICk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoIHBCYXBIQ0lFdmVudC0+dS5idGFtcFBoeXNpY2FsTGlua0NvbXBsZXRlRXZlbnQuc3RhdHVzID09CisgICAgICAgICAgICAgICAgICBXTEFOQkFQX0VSUk9SX01BWF9OVU1fQ05DVFMgKQorICAgICAgICB7CisgICAgICAgICAgICAvL1dlIG5lZWQgdG8gdXBkYXRlIHRoZSBwaHkgbGluayBoYW5kbGUgaGVyZSB0byBiZSBhYmxlIHRvIHJlaXNzdWUgcGh5c2ljYWwgbGluayAvY3JlYXRlL2FjY2VwdAorICAgICAgICAgICAgLy8gdXBkYXRlIHRoZSBwaHkgbGluayBoYW5kbGUgYmFzZWQgbWFwIHNvIFRYIGRhdGEgY2FuIHN0YXJ0IGZsb3dpbmcgdGhyb3VnaAorICAgICAgICAgICAgT2xkTWFwVmFsID0gdm9zX2F0b21pY19zZXQoICh1aW50cHRyX3QqKUJzbFBoeUxpbmtNYXArcEJhcEhDSUV2ZW50LT51LmJ0YW1wUGh5c2ljYWxMaW5rQ29tcGxldGVFdmVudC5waHlfbGlua19oYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1aW50cHRyX3QpIHBIZGRIZGwgKTsKKy8vICAgICAgICAgICAgICAgICAgVk9TX0FTU0VSVCggT2xkTWFwVmFsID09IDAgKTsvL0NvbW1lbnRlZCB0byB0ZXN0IHJlY29ubmVjdAorCisgICAgICAgICAgICBCc2xSZWxlYXNlUGh5Q3R4KCAoQnNsUGh5TGlua0N0eFR5cGUgKilwSGRkSGRsICk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoIHBCYXBIQ0lFdmVudC0+dS5idGFtcFBoeXNpY2FsTGlua0NvbXBsZXRlRXZlbnQuc3RhdHVzID09CisgICAgICAgICAgICAgICAgICBXTEFOQkFQX0VSUk9SX0hPU1RfVElNRU9VVCApCisgICAgICAgIHsKKyAgICAgICAgICAgIEJzbFJlbGVhc2VQaHlDdHgoIChCc2xQaHlMaW5rQ3R4VHlwZSAqKXBIZGRIZGwgKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmICggcEJhcEhDSUV2ZW50LT51LmJ0YW1wUGh5c2ljYWxMaW5rQ29tcGxldGVFdmVudC5zdGF0dXMgPT0KKyAgICAgICAgICAgICAgICAgIDB4MTYgLyogV0xBTkJBUF9FUlJPUl9GQUlMRURfQ09OTkVDVElPTj8gKi8gKQorICAgICAgICB7CisgICAgICAgICAgICBCc2xSZWxlYXNlUGh5Q3R4KCAoQnNsUGh5TGlua0N0eFR5cGUgKilwSGRkSGRsICk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoIHBCYXBIQ0lFdmVudC0+dS5idGFtcFBoeXNpY2FsTGlua0NvbXBsZXRlRXZlbnQuc3RhdHVzID09CisgICAgICAgICAgICAgICAgICAweDggLyogV0xBTkJBUF9FUlJPUl9BVVRIX0ZBSUxFRD8gKi8gKQorICAgICAgICB7CisgICAgICAgICAgICBCc2xSZWxlYXNlUGh5Q3R4KCAoQnNsUGh5TGlua0N0eFR5cGUgKilwSGRkSGRsICk7CisgICAgICAgIH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zU3RhdHVzICkpOworCisgICAgICAgICAgICByZXR1cm4oVk9TX1NUQVRVU19FX0ZBSUxVUkUpOworICAgICAgICB9CisKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgQlRBTVBfVExWX0hDSV9MT0dJQ0FMX0xJTktfQ09NUExFVEVfRVZFTlQ6CisgICAgeworICAgICAgICAvLyBwYWNrCisgICAgICAgIFBhY2tTdGF0dXMgPSBidGFtcFBhY2tUbHZIQ0lfTG9naWNhbF9MaW5rX0NvbXBsZXRlX0V2ZW50KCBwY3R4LAorICAgICAgICAgICAgICAgICAgICAgJnBCYXBIQ0lFdmVudC0+dS5idGFtcExvZ2ljYWxMaW5rQ29tcGxldGVFdmVudCwgQnVmZiwgQlNMX01BWF9FVkVOVF9TSVpFLCAmV3JpdHRlbiApOworCisgICAgICAgIGlmICggIUJUQU1QX1NVQ0NFRURFRCggUGFja1N0YXR1cyApICkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIldMQU5CQVBfRXZlbnRDQjogYnRhbXBVbnBhY2tUbHZIQ0lfQ3JlYXRlX1BoeXNpY2FsX0xpbmtfQ21kIGZhaWxlZCBzdGF0dXMgJWQiLCBQYWNrU3RhdHVzKTsKKyAgICAgICAgICAgIC8vIGhhbmRsZSB0aGUgZXJyb3IKKyAgICAgICAgICAgIFZvc1N0YXR1cyA9IHZvc19wa3RfcmV0dXJuX3BhY2tldCggcFZvc1BrdCApOworCisgICAgICAgICAgICBWT1NfQVNTRVJUKFZPU19JU19TVEFUVVNfU1VDQ0VTUyggVm9zU3RhdHVzICkpOworCisgICAgICAgICAgICByZXR1cm4oVk9TX1NUQVRVU19FX0ZBSUxVUkUpOworICAgICAgICB9CisKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgQlRBTVBfVExWX0hDSV9ESVNDT05ORUNUX0xPR0lDQUxfTElOS19DT01QTEVURV9FVkVOVDoKKyAgICB7CisgICAgICAgIC8vIHBhY2sKKyAgICAgICAgUGFja1N0YXR1cyA9IGJ0YW1wUGFja1RsdkhDSV9EaXNjb25uZWN0X0xvZ2ljYWxfTGlua19Db21wbGV0ZV9FdmVudCggcGN0eCwKKyAgICAgICAgICAgICAgICAgICAgICZwQmFwSENJRXZlbnQtPnUuYnRhbXBEaXNjb25uZWN0TG9naWNhbExpbmtDb21wbGV0ZUV2ZW50LCBCdWZmLCBCU0xfTUFYX0VWRU5UX1NJWkUsICZXcml0dGVuICk7CisKKyAgICAgICAgaWYgKCAhQlRBTVBfU1VDQ0VFREVEKCBQYWNrU3RhdHVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiV0xBTkJBUF9FdmVudENCOiBidGFtcFVucGFja1RsdkhDSV9DcmVhdGVfUGh5c2ljYWxfTGlua19DbWQgZmFpbGVkIHN0YXR1cyAlZCIsIFBhY2tTdGF0dXMpOworICAgICAgICAgICAgLy8gaGFuZGxlIHRoZSBlcnJvcgorICAgICAgICAgICAgVm9zU3RhdHVzID0gdm9zX3BrdF9yZXR1cm5fcGFja2V0KCBwVm9zUGt0ICk7CisKKyAgICAgICAgICAgIFZPU19BU1NFUlQoVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBWb3NTdGF0dXMgKSk7CisKKyAgICAgICAgICAgIHJldHVybihWT1NfU1RBVFVTX0VfRkFJTFVSRSk7CisgICAgICAgIH0KKworICAgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBCVEFNUF9UTFZfSENJX0ZMT1dfU1BFQ19NT0RJRllfQ09NUExFVEVfRVZFTlQ6CisgICAgeworICAgICAgICAvLyBwYWNrCisgICAgICAgIFBhY2tTdGF0dXMgPSBidGFtcFBhY2tUbHZIQ0lfRmxvd19TcGVjX01vZGlmeV9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21wbGV0ZUV2ZW50LCBCdWZmLCBCU0xfTUFYX0VWRU5UX1NJWkUsICZXcml0dGVuICk7CisKKyAgICAgICAgaWYgKCAhQlRBTVBfU1VDQ0VFREVEKCBQYWNrU3RhdHVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiV0xBTkJBUF9FdmVudENCOiBidGFtcFVucGFja1RsdkhDSV9DcmVhdGVfUGh5c2ljYWxfTGlua19DbWQgZmFpbGVkIHN0YXR1cyAlZCIsIFBhY2tTdGF0dXMpOworICAgICAgICAgICAgLy8gaGFuZGxlIHRoZSBlcnJvcgorICAgICAgICAgICAgVm9zU3RhdHVzID0gdm9zX3BrdF9yZXR1cm5fcGFja2V0KCBwVm9zUGt0ICk7CisKKyAgICAgICAgICAgIFZPU19BU1NFUlQoVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBWb3NTdGF0dXMgKSk7CisKKyAgICAgICAgICAgIHJldHVybihWT1NfU1RBVFVTX0VfRkFJTFVSRSk7CisgICAgICAgIH0KKworICAgICAgICBicmVhazsKKyAgICB9CisgICAgZGVmYXVsdDoKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIldMQU5CQVBfRXZlbnRDQiB1bmV4cGVjdGVkIGV2ZW50IiApOworCisgICAgICAgIFZvc1N0YXR1cyA9IHZvc19wa3RfcmV0dXJuX3BhY2tldCggcFZvc1BrdCApOworCisgICAgICAgIFZPU19BU1NFUlQoVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBWb3NTdGF0dXMgKSk7CisKKyAgICAgICAgcmV0dXJuKFZPU19TVEFUVVNfRV9GQUlMVVJFKTsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgIH0KKworICAgIFZPU19BU1NFUlQoV3JpdHRlbiA8P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ayBhbHJlYWR5IGluaXRlZCIsX19mdW5jX18pOworICAgICAgICAvLyByZXR1cm4oMCk7CisgICAgfQorCisgICAgZm9yICggaT0wOyBpIDwgQlNMX01BWF9DTElFTlRTOyBpKysgKQorICAgIHsKKyAgICAgICAgaWYgKCAhQnNsQ2xpZW50Q3R4W2ldLnVzZWQgKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsIiVzOkJzbENsaWVudEN0eFslZF0gc2VsZWN0ZWQiLF9fZnVuY19fLCBpKTsKKyAgICAgICAgICAgIEJzbENsaWVudEN0eFtpXS51c2VkID0gVFJVRTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgICAgaWYgKCBpID09IEJTTF9NQVhfQ0xJRU5UUyApCisgICAgeworICAgICAgICAvLyBubyBtb3JlIGNsaWVudHMgY2FuIGJlIHN1cHBvcnRlZAorICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJCc2xGaW5kQW5kSW5pdENsaWVudEN0eCBubyBtb3JlICIKKyAgICAgICAgICAiY2xpZW50cyBjYW4gYmUgc3VwcG9ydGVkIE1BWD0lZCIsIEJTTF9NQVhfQ0xJRU5UUyApOworICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgfQorCisgICAgLy9wY3R4ID0gQnNsQ2xpZW50Q3R4ICsgaTsKKyAgICBwY3R4ID0gZ3BCc2xjdHg7CisKKyAgICAvLyBnZXQgYSBoYW5kbGUgZnJvbSBCQVAKKyAgICBWb3NTdGF0dXMgPSBXTEFOQkFQX0dldE5ld0huZGwoJnBjdHgtPmJhcEhkbCk7CisKKyAgICBpZiAoICFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIFZvc1N0YXR1cyApICkKKyAgICB7CisgICAgICAgIHBjdHgtPnVz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SENJX0NyZWF0ZV9Mb2dpY2FsX0xpbmtfQ21kIENyZWF0ZUxvZ2ljYWxMaW5rQ21kOworICAgICAgICBDb3VudCAtPSAzOyAvL1RvIHNlbmQgdGhlIGNvcnJlY3QgbGVuZ3RoIHRvIHVucGFjayBldmVudAorICAgICAgICAvLyB1bnBhY2sKKyAgICAgICAgVW5wYWNrU3RhdHVzID0gYnRhbXBVbnBhY2tUbHZIQ0lfQ3JlYXRlX0xvZ2ljYWxfTGlua19DbWQoIE5VTEwsCisgICAgICAgICAgICAgICAgICAgICAgIHBCdWYsIENvdW50LCAmQ3JlYXRlTG9naWNhbExpbmtDbWQgKTsKKworICAgICAgICBpZiAoICFCVEFNUF9TVUNDRUVERUQoIFVucGFja1N0YXR1cyApICkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIkJzbFByb2Nlc3NIQ0lDb21tYW5kOiBidGFtcFVucGFja1RsdkhDSV9DcmVhdGVfTG9naWNhbF9MaW5rX0NtZCBmYWlsZWQgc3RhdHVzICVkIiwgVW5wYWNrU3RhdHVzKTsKKyAgICAgICAgICAgIC8vIGhhbmRsZSB0aGUgZXJyb3IKKyAgICAgICAgICAgIHJldHVybihGQUxTRSk7CisgICAgICAgIH0KKworICAgICAgICBWb3NTdGF0dXMgPSBXTEFOX0JBUExvZ2ljYWxMaW5rQ3JlYXRlKCBwY3R4LT5iYXBIZGwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZDcmVhdGVMb2dpY2FsTGlua0NtZCwgJkhDSUV2dCApOworCisgICAgICAgIGlmICggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyggVm9zU3RhdHVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5G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cmV0dXJuKEZBTFNFKTsKKyAgICAgICAgfQorCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIEJUQU1QX1RMVl9IQ0lfQUNDRVBUX0xPR0lDQUxfTElOS19DTUQ6CisgICAgeworICAgICAgICB0QnRhbXBUTFZIQ0lfQWNjZXB0X0xvZ2ljYWxfTGlua19DbWQgQWNjZXB0TG9naWNhbExpbmtDbWQ7CisgICAgICAgIENvdW50ID0gQ291bnQgLSAzOy8vU3VidHJhY3QgVHlwZSBhbmQgTGVuZ3RoIGZpZWxkcworICAgICAgICAvLyB1bnBhY2sKKyAgICAgICAgVW5wYWNrU3RhdHVzID0gYnRhbXBVbnBhY2tUbHZIQ0lfQWNjZXB0X0xvZ2ljYWxfTGlua19DbWQoIE5VTEwsCisgICAgICAgICAgICAgICAgICAgICAgIHBCdWYsIENvdW50LCAmQWNjZXB0TG9naWNhbExpbmtDbWQgKTsKKworICAgICAgICBpZiAoICFCVEFNUF9TVUNDRUVERUQoIFVucGFja1N0YXR1cyApICkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIkJzbFByb2Nlc3NIQ0lDb21tYW5kOiBidGFtcFVucGFja1RsdkhDSV9BY2NlcHRfTG9naWNhbF9MaW5rX0NtZCBmYWlsZWQgc3RhdHVzICVkIiwgVW5wYWNrU3RhdHVzKTsKKyAgICAgICAgICAgIC8vIGhhbmRsZSB0aGUgZXJyb3IKKyAgICAgICAgICAgIHJldHVybihGQUxTRSk7CisgICAgICAgIH0KKworICAgICAgICBWb3NTdGF0dXMgPSBXTEFOX0JBUExvZ2ljYWxMaW5rQWNjZXB0KCBwY3R4LT5iYXBIZGwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZBY2NlcHRMb2dpY2FsTGlua0NtZCwgJkhDSUV2dCApOworCisgICAgICAgIGl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0lFdnQsIEZBTFNFICk7CisKKyAgICAgICAgaWYgKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBWb3NTdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICJCc2xQcm9jZXNzSENJQ29tbWFuZDogV0xBTkJBUF9FdmVudENCIGZhaWxlZCBzdGF0dXMgJWQiLCBWb3NTdGF0dXMpOworICAgICAgICAgICAgLy8gaGFuZGxlIHRoZSBlcnJvcgorICAgICAgICAgICAgcmV0dXJuKEZBTFNFKTsKKyAgICAgICAgfQorCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAvKgorICAgICAgSG9zdCBDb250cm9sbGVyIGFuZCBCYXNlYmFuZCBDb21tYW5kcworICAgICovCisgICAgY2FzZSBCVEFNUF9UTFZfSENJX1JFU0VUX0NNRDoKKyAgICB7CisgICAgICAgIFZvc1N0YXR1cyA9IFdMQU5fQkFQUmVzZXQoIHBjdHgtPmJhcEhkbCApOworCisgICAgICAgIGlmICggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyggVm9zU3RhdHVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiQnNsUHJvY2Vzc0hDSUNvbW1hbmQ6IFdMQU5fQkFQUmVzZXQgZmFpbGVkIHN0YXR1cyAlZCIsIFZvc1N0YXR1cyk7CisgICAgICAgICAgICAvLyBoYW5kbGUgdGhlIGVycm9yCisgICAgICAgICAgICByZXR1cm4oRkFMU0UpOworICAgICAgICB9CisKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgQlRBTVBfVExWX0hDSV9TRVRfRVZFTlRfTUFTS19DTUQ6CisgICAgeworICAgICAgICB0QnRhbXBUTFZIQ0lfU2V0X0V2ZW50X01hc2tfQ21kIFNldEV2ZW50TWFza0NtZDsKKyAgICAgICAgLy8gdW5wYWNrCisgICAgICAgIFVucGFja1N0YXR1cyA9IGJ0YW1wVW5wYWNrVGx2SENJX1NldF9FdmVudF9NYXNrX0NtZCggTlVMTCwKKyAgICAgICAgICAgICAgICAgICAgICAgcEJ1ZiwgQ291bnQsICZTZXRFdmVudE1hc2tDbWQgKTsKKworICAgICAgICBpZiAoICFCVEFNUF9TVUNDRUVERUQoIFVucGFja1N0YXR1cyApICkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIkJzbFByb2Nlc3NIQ0lDb21tYW5kOiBidGFtcFVucGFja1RsdkhDSV9TZXRfRXZlbnRfTWFza19DbWQgZmFpbGVkIHN0YXR1cyAlZCIsIFVucGFja1N0YXR1cyk7CisgICAgICAgICAgICAvLyBoYW5kbGUgdGhlIGVycm9yCisgICAgICAgICAgICByZXR1cm4oRkFMU0UpOworICAgICAgICB9CisKKyAgICAgICAgVm9zU3RhdHVzID0gV0xBTl9CQVBTZXRFdmVudE1hc2soIHBjdHgtPmJhcEhkbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZTZXRFdmVudE1hc2tDbWQsICZIQ0lFdnQgKTsKKworICAgICAgICBpZiAoICFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIFZvc1N0YXR1cyApICkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIkJzbFByb2Nlc3NIQ0lDb21tYW5kOiBXTEFOX0JBUFNldEV2ZW50TWFzayBmYWlsZWQgc3RhdHVzICVkIiwgVm9zU3RhdHVzKTsKKyAgICAgICAgICAgIC8vIGhhbmRsZSB0aGUgZXJyb3IKKyAgIC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aENtZCApOworCisgICAgICAgIGlmICggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyggVm9zU3RhdHVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJCc2xQcm9jZXNzSENJQ29tbWFuZDogV0xBTl9CQVBGbHVzaCBmYWlsZWQgc3RhdHVzICVkIiwgVm9zU3RhdHVzKTsKKyAgICAgICAgICAgIC8vIGhhbmRsZSB0aGUgZXJyb3IKKyAgICAgICAgICAgIHJldHVybihGQUxTRSk7CisgICAgICAgIH0KKworICAgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBCVEFNUF9UTFZfSENJX0VOSEFOQ0VEX0ZMVVNIX0NNRDoKKyAgICB7CisgICAgICAgIHRCdGFtcFRMVkhDSV9FbmhhbmNlZF9GbHVzaF9DbWQgRmx1c2hDbWQ7CisKKyAgICAgICAgLy8gdW5wYWNrCisgICAgICAgIFVucGFja1N0YXR1cyA9IGJ0YW1wVW5wYWNrVGx2SENJX0VuaGFuY2VkX0ZsdXNoX0NtZCggTlVMTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQnVmLCBDb3VudCwgJkZsdXNoQ21kICk7CisKKyAgICAgICAgaWYgKCAhQlRBTVBfU1VDQ0VFREVEKCBVbnBhY2tTdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIkJzbFByb2Nlc3NIQ0lDb21tYW5kOiBidGFtcFVucGFja1RsdkhDSV9FbmhhbmNlZF9GbHVzaF9DbWQgZmFpbGVkIHN0YXR1cyAlZCIsIFVucGFja1N0YXR1cyk7CisgICAgICAgICAgICAvLyBoYW5kbGUgdGhlIGVycm9yCisgICAgICAgICAgIC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SENJX1dyaXRlX0xvY2F0aW9uX0RhdGFfQ21kKCBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICBwQnVmLCBDb3VudCwgJldyaXRlTG9jYXRpb25EYXRhQ21kICk7CisKKyAgICAgICAgaWYgKCAhQlRBTVBfU1VDQ0VFREVEKCBVbnBhY2tTdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICJCc2xQcm9jZXNzSENJQ29tbWFuZDogYnRhbXBVbnBhY2tUbHZIQ0lfV3JpdGVfTG9jYXRpb25fRGF0YV9DbWQgZmFpbGVkIHN0YXR1cyAlZCIsIFVucGFja1N0YXR1cyk7CisgICAgICAgICAgICAvLyBoYW5kbGUgdGhlIGVycm9yCisgICAgICAgICAgICByZXR1cm4oRkFMU0UpOworICAgICAgICB9CisKKyAgICAgICAgVm9zU3RhdHVzID0gV0xBTl9CQVBXcml0ZUxvY2F0aW9uRGF0YSggcGN0eC0+YmFwSGRsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmV3JpdGVMb2NhdGlvbkRhdGFDbWQsICZIQ0lFdnQgKTsKKworICAgICAgICBpZiAoICFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIFZvc1N0YXR1cyApICkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIkJzbFByb2Nlc3NIQ0lDb21tYW5kOiBXTEFOX0JBUFdyaXRlTG9jYXRpb25EYXRhIGZhaWxlZCBzdGF0dXMgJWQiLCBWb3NTdGF0dXMpOworICAgICAgICAgICAgLy8gaGFuZGxlIHRoZSBlcnJvcgorICAgICAgICAgICAgcmV0dXJuKEZBTFNFKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIHR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nlc3NIQ0lDb21tYW5kOiBidGFtcFVucGFja1RsdkhDSV9Xcml0ZV9SZW1vdGVfQU1QX0FTU09DX0NtZCBmYWlsZWQgc3RhdHVzICVkIiwgVW5wYWNrU3RhdHVzKTsKKyAgICAgICAgICAgIC8vIGhhbmRsZSB0aGUgZXJyb3IKKyAgICAgICAgICAgIHJldHVybihGQUxTRSk7CisgICAgICAgIH0KKworLy8jZGVmaW5lIEJBUF9VTklUX1RFU1QKKyNpZmRlZiBCQVBfVU5JVF9URVNUCisgICAgICAgIHsKKyAgICAgICAgICAgIHVuc2lnbmVkIGNoYXIgdGVzdF9hbXBfYXNzb2NfZnJhZ21lbnRbXSA9CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgMHgwMSwgMHgwMCwgMHgwNiwgMHgwMCwgMHgwMCwgMHhkZSwgMHhhZCwgMHhiZSwKKyAgICAgICAgICAgICAgICAweGVmLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAyLCAweDAwLAorICAgICAgICAgICAgICAgIDB4MGMsIDB4MDAsIDB4NTUsIDB4NTMsIDB4MjAsIDB4YzksIDB4MGMsIDB4MDAsCisgICAgICAgICAgICAgICAgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwKKyAgICAgICAgICAgICAgICAweDAwLCAweDAwLCAweDAzLCAweDAwLCAweDA2LCAweDAwLCAweDU1LCAweDUzLAorICAgICAgICAgICAgICAgIDB4MjAsIDB4YzksIDB4MGMsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsCisgICAgICAgICAgICAgICAgMHgwNCwgMHgwMCwgMHgwNCwgMHgwMCwgMHgwMywgMHgwMCwgMHgwMCwgMHgwMCwKKyAgICAgICAgICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDA1LCAweDAwLCAweDA2LCAweDAwLAorICAgICAgICAgICAgICAgIDB4MDAsIDB4ZjUsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsCisgICAgICAgICAgICAgICAgMHgwMCwgMHgwMAorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIFdyaXRlUmVtb3RlQW1wQXNzb2NDbWQucHJlc2VudCA9IDE7CisgICAgICAgICAgICBXcml0ZVJlbW90ZUFtcEFzc29jQ21kLnBoeV9saW5rX2hhbmRsZSA9IDE7CisgICAgICAgICAgICBXcml0ZVJlbW90ZUFtcEFzc29jQ21kLmxlbmd0aF9zb19mYXIgPSAwOworICAgICAgICAgICAgV3JpdGVSZW1vdGVBbXBBc3NvY0NtZC5hbXBfYXNzb2NfcmVtYWluaW5nX2xlbmd0aCA9IDc0OworICAgICAgICAgICAgLyogU2V0IHRoZSBhbXBfYXNzb2NfZnJhZ21lbnQgdG8gdGhlIHJpZ2h0IHZhbHVlcyBvZiBNQUMgYWRkciBhbmQKKyAgICAgICAgICAgICAqIGNoYW5uZWxzCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHZvc19tZW1fY29weSgKKyAgICAgICAgICAgICAgICBXcml0ZVJlbW90ZUFtcEFzc29jQ21kLmFtcF9hc3NvY19mcmFnbWVudCwKKyAgICAgICAgICAgICAgICB0ZXN0X2FtcF9hc3NvY19mcmFnbWVudCwKKyAgICAgICAgICAgICAgICBzaXplb2YoIHRlc3RfYW1wX2Fzc29jX2ZyYWdtZW50KSk7CisKKyAgICAgICAgfQorI2VuZGlmCisKKyAgICAgICAgVm9zU3RhdHVzID0gV0xBTl9CQVBXcml0ZVJlbW90ZUFNUEFzc29jKCBwY3R4LT5iYXBIZGwsCisgICAgICAgICAgICAgICAgICAgICZXcml0ZVJlbW90ZUFtcEFzc29jQ21kLCAmSENJRXZ0ICk7CisKKyAgICAgICAgaWYgKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBWb3NTdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMR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bmRsZSB0aGUgZXJyb3IKKyAgICAgICAgICAgIHJldHVybihGQUxTRSk7CisgICAgICAgIH0KKworICAgICAgICBicmVhazsKKyAgICB9CisgICAgLyoKKyAgICAgIERlYnVnIENvbW1hbmRzCisgICAgKi8KKyAgICBjYXNlIEJUQU1QX1RMVl9IQ0lfUkVBRF9MT09QQkFDS19NT0RFX0NNRDoKKyAgICB7CisgICAgICAgIHRCdGFtcFRMVkhDSV9SZWFkX0xvb3BiYWNrX01vZGVfQ21kIFJlYWRMb29wYmFja01vZGVDbWQ7CisgICAgICAgIC8vIHVucGFjaworICAgICAgICBVbnBhY2tTdGF0dXMgPSBidGFtcFVucGFja1RsdkhDSV9SZWFkX0xvb3BiYWNrX01vZGVfQ21kKCBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICBwQnVmLCBDb3VudCwgJlJlYWRMb29wYmFja01vZGVDbWQgKTsKKworICAgICAgICBpZiAoICFCVEFNUF9TVUNDRUVERUQoIFVucGFja1N0YXR1cyApICkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIkJzbFByb2Nlc3NIQ0lDb21tYW5kOiBidGFtcFVucGFja1RsdkhDSV9SZWFkX0xvb3BiYWNrX01vZGVfQ21kIGZhaWxlZCBzdGF0dXMgJWQiLCBVbnBhY2tTdGF0dXMpOworICAgICAgICAgICAgLy8gaGFuZGxlIHRoZSBlcnJvcgorICAgICAgICAgICAgcmV0dXJuKEZBTFNFKTsKKyAgICAgICAgfQorCisgICAgICAgIFZvc1N0YXR1cyA9IFdMQU5fQkFQUmVhZExvb3BiYWNrTW9kZSggcGN0eC0+YmFwSGRsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZSZWFkTG9vcGJhY2tNb2RlQ21kLCAmSENJRXZ0ICk7CisKKyAgICAgICAgaWYgKCAhVk9TX0lTX1N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IFdMQU5CQVBfRXZlbnRDQiBmYWlsZWQgc3RhdHVzICVkIiwgVm9zU3RhdHVzKTsKKyAgICAgICAgICAgIC8vIGhhbmRsZSB0aGUgZXJyb3IKKyAgICAgICAgICAgIHJldHVybihGQUxTRSk7CisgICAgICAgIH0KKworICAgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBCVEFNUF9UTFZfSENJX1dSSVRFX0xPT1BCQUNLX01PREVfQ01EOgorICAgIHsKKyAgICAgICAgdEJ0YW1wVExWSENJX1dyaXRlX0xvb3BiYWNrX01vZGVfQ21kIFdyaXRlTG9vcGJhY2tNb2RlQ21kOworICAgICAgICAvLyB1bnBhY2sKKyAgICAgICAgVW5wYWNrU3RhdHVzID0gYnRhbXBVbnBhY2tUbHZIQ0lfV3JpdGVfTG9vcGJhY2tfTW9kZV9DbWQoIE5VTEwsCisgICAgICAgICAgICAgICAgICAgICAgIHBCdWYsIENvdW50LCAmV3JpdGVMb29wYmFja01vZGVDbWQgKTsKKworICAgICAgICBpZiAoICFCVEFNUF9TVUNDRUVERUQoIFVucGFja1N0YXR1cyApICkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIkJzbFByb2Nlc3NIQ0lDb21tYW5kOiBidGFtcFVucGFja1RsdkhDSV9Xcml0ZV9Mb29wYmFja19Nb2RlX0NtZCBmYWlsZWQgc3RhdHVzICVkIiwgVW5wYWNrU3RhdHVzKTsKKyAgICAgICAgICAgIC8vIGhhbmRsZSB0aGUgZXJyb3IKKyAgICAgICAgICAgIHJldHVybihGQUxTRSk7CisgICAgICAgIH0KKworICAgICAgICBWb3NTdGF0dXMgPSBXTEFOX0JBUFdyaXRlTG9vcGJhY2tNb2RlKCBwY3R4LT5iYXBIZGwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZXcml0ZUxvb3BiYWN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3NpemUoICZwUGh5Q3R4LT5BQ0xUeFF1ZXVlW0FjXSwgJkxpc3RTaXplICk7CisKKyAgICAgICAgaWYgKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBWb3NTdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIExpc3RTaXplID09IDEgKQorICAgICAgICB7CisgICAgICAgICAgICAvLyBMZXQgVEwga25vdyB3ZSBoYXZlIGEgcGFja2V0IHRvIHNlbmQgZm9yIHRoaXMgQUMKKyAgICAgICAgICAgIFZvc1N0YXR1cyA9IFdMQU5CQVBfU1RBUGt0UGVuZGluZyggcGN0eC0+YmFwSGRsLCBwUGh5Q3R4LT5QaHlMaW5rSGRsLCBBYyApOworCisgICAgICAgICAgICBpZiAoICFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIFZvc1N0YXR1cyApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJCc2xQcm9jZXNzQUNMRGF0YVR4IFdMQU5CQVBfU1RBUGt0UGVuZGluZyAiCisgICAgICAgICAgICAgICAgImZhaWxlZCBzdGF0dXMgPSVkIiwgVm9zU3RhdHVzICk7CisgICAgICAgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybihUUlVFKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiQnNsUHJvY2Vzc0FDTERhdGFUeCBhdHRlbXB0aW5nIHRvIHNlbmQgIgorICAgICAgICAgICJkYXRhIGZvciBhIG5vbi1leGlzdGFudCBhc3NvY2F0aW9uIiAp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pc3RlciBhcyBIQ0kgZGV2aWNlIik7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKyAgICBlbHNlIGlmKDAgPT0gcENvbmZpZy0+ZW5hYmxlQnRBbXApCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgIkRpZG4ndCByZWdpc3RlciBhcyBIQ0kgZGV2aWNlLCB1c2VyIG9wdGlvbihnRW5hYmxlQnRBbXApIGlzIHNldCB0byAwIik7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIGlmIChWT1NfU1RBX1NBUF9NT0RFID09IGhkZF9nZXRfY29ucGFyYW0oKSkKKyAgICB7CisgICAgICAgIHN0YXR1cyA9IGhkZF9nZXRfZnJvbnRfYWRhcHRlciAoIHBIZGRDdHgsICZwQWRhcHRlck5vZGUgKTsKKyAgICAgICAgaWYgKCBOVUxMICE9IHBBZGFwdGVyTm9kZSAmJiBWT1NfU1RBVFVTX1NVQ0NFU1MgPT0gc3RhdHVzICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKCBXTEFOX0hERF9TT0ZUQVAgPT0gcEFkYXB0ZXJOb2RlLT5wQWRhcHRlci0+ZGV2aWNlX21vZGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcEFkYXB0ZXIgPSBoZGRfZ2V0X2FkYXB0ZXIocEhkZEN0eCwgV0xBTl9IRERfU09GVEFQKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKFdMQU5fSEREX1AyUF9HTyA9PSBwQWRhcHRlck5vZGUtPnBBZGFwdGVyLT5kZXZpY2VfbW9kZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwQWRhcHRlciA9IGhkZF9nZXRfYWRhcHRlcihwSGRkQ3R4LCBXTEFOX0hERF9QMlBfR08pOworICAgICAgICAgICAgfQorICAgICAgICB9CisgIC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Cc2xDbGllbnRDdHhUeXBlICopKGhjaV9nZXRfZHJ2ZGF0YShoZGV2KSk7CisgICAgdl9VMTZfdCBpOworICAgIEJPT0wgcnZhbDsKKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICJCU0xfT3BlbiIpOworCisgICAgLyogIHlvdSBjYW4gb25seSBvcGVuIGEgYnRhbXAgZGV2aWNlIG9uZSB0aW1lICovCisgICAgaWYgKGJCc2xJbml0ZWQpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJCU0xfT3BlbjogQWxyZWFkeSBPcGVuZWQuIik7CisgICAgICAgIHJldHVybiAtRVBFUk07IC8qIE9wZXJhdGlvbiBub3QgcGVybWl0dGVkICovCisgICAgfQorCisgICAgaWYgKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBWb3NTdGF0dXMgKSApCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiQlNMQ2xpZW50TG9jayBhbHJlYWR5IGluaXRlZCIpOworICAgICAgICAvLyByZXR1cm4gLUVJTzsgIC8qIEkvTyBlcnJvciAqLworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisKKyAgICBWb3NTdGF0dXMgPSB2b3NfbGlzdF9pbml0KCAmQnNsUGh5TGlua3NEZXNjUG9vbCApOworCisgICAgaWYgKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBWb3NTdGF0dXMgKSApCisgICAgeworICAgICAgICAvL3JldHVybiAtRUlPOyAgLyogSS9PIGVycm9yICovCisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIC8vIG5vdyB3ZSBuZWVkIHRvIHBvcHVsYXRlIHRoaXMgcG9vbCB3aXRoIHRoZSBmcmVl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1ZmYgKnNrYikKK3sKKyAgICBzdHJ1Y3QgaGNpX2RldiAqaGRldjsKKyAgICBCc2xDbGllbnRDdHhUeXBlKiBwY3R4OworICAgIHZfU0laRV90IHdyaXR0ZW4gPSAwOworICAgIEJPT0wgc3RhdHVzOworICAgIC8vY2hhciAqYnNsQnVmZiA9IE5VTEw7CisgICAgQnNsSGNpV29ya1N0cnVjdHVyZSAqcEhjaUNvbnRleHQ7CisKKyAgICAvL1ZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICIlcyIsIF9fZnVuY19fKTsKKworICAgIC8vIFNhbml0eSBjaGVjayBpbnB1dHMKKyAgICBpZiAoIHNrYiA9PSBOVUxMICkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICIlczogc2tiIGlzIGJhZCBpL3AiLCBfX2Z1bmNfXyk7CisgICAgICAgIC8vcmV0dXJuIC1FRkFVTFQ7IC8qIEJhZCBhZGRyZXNzICovCisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICIlczogQ291bnQgKHNrYi0+bGVuKT0lZCIsIF9fZnVuY19fLCBza2ItPmxlbik7CisKKyAgICAvLyBTYW5pdHkgY2hlY2sgaW5wdXRzCisgICAgaWYgKCAwID09IHNrYi0+bGVuICkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICIlczogc2tiIGlzIGVtcHR5IiwgX19mdW5jX18pOworICAgICAgICAvL3JldHVybiAtRUZBVUxUOyAvKiBCYWQgYWRkcmVzcyAqLworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisKKyAgICBoZGV2ID0gKHN0cnVjdCBoY2lfZGV2ICopKHNrYi0+ZGV2KTsKKworICAgIC8vIFNhbml0eSBjaGVjayB0aGUgSENJIGRldmljZSBpbiB0aGUgc2tiCisgICAgaWYgKCBoZGV2ID09IE5VTEwgKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIiVzOiBGcmFtZSBmb3IgVW5rbm93biBIQ0kgZGV2aWNlIChoZGV2PU5VTEwpIiwgX19mdW5jX18pOworICAgICAgICAvL3JldHVybiAtRU5PREVWOyAvKiBubyBkZXZpY2UgKi8KKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgcGN0eCA9IChCc2xDbGllbnRDdHhUeXBlICopaGNpX2dldF9kcnZkYXRhKGhkZXYpOworCisgICAgLy8gU2FuaXR5IGNoZWNrIGlucHV0cworICAgIGlmICggcGN0eCA9PSBOVUxMICkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICIlczogcGN0eCBpcyBiYWQgaS9wIiwgX19mdW5jX18pOworICAgICAgICAvL3JldHVybiAtRUZBVUxUOyAvKiBCYWQgYWRkcmVzcyAqLworICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgLyogTWF5YmUgSSBzaG91bGQgcmV0dXJuICJubyBkZXZpY2UiICovCisgICAgICAgIC8vcmV0dXJuIC1FTk9ERVY7IC8qIG5vIGRldmljZSAqLworICAgIH0KKworICAgIC8vIFN3aXRjaCBmb3IgZWFjaCBjYXNlIG9mIHBhY2tldCB0eXBlCisgICAgc3dpdGNoIChidF9jYihza2IpLT5wa3RfdHlwZSkKKyAgICB7CisgICAgY2FzZSBIQ0lfQUNMREFUQV9QS1Q6CisgICAgICAgIC8vIERpcmVjdGx5IGV4ZWN1dGUgdGhlIGRhdGEgd3Jp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AgICAgICBwSGNpQ29udGV4dCA9IGttYWxsb2Moc2l6ZW9mKCpwSGNpQ29udGV4dCksIEdGUF9BVE9NSUMpOworICAgICAgICBpZiAoTlVMTCA9PSBwSGNpQ29udGV4dCkKKyAgICAgICAgeworICAgICAgICAgICAgLy8gbm8gbWVtb3J5IGZvciBIQ0kgY29udGV4dC4gIE5vdGhpbmcgd2UgY2FuIGRvIGJ1dCBkcm9wCisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IFVuYWJsZSB0byBhbGxvY2F0ZSBjb250ZXh0IiwgX19mdW5jX18pOworICAgICAgICAgICAga2ZyZWVfc2tiKHNrYik7CisgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorCisgICAgICAgIC8vIHNhdmUgYXdheSB0aGUgdHggc2tiIGluIHRoZSBIQ0kgY29udGV4dC4uLnNvIGl0IGNhbiBiZQorICAgICAgICAvLyByZXRyaWV2ZWQgYnkgdGhlIHdvcmsgcHJvY2VkdXJlLgorICAgICAgICBwSGNpQ29udGV4dC0+dHhfc2tiID0gc2tiOworICAgICAgICAvLyBzYXZlIGF3YXkgdGhlIHBjdHggY29udGV4dC4uLnNvIGl0IGNhbiBiZSByZXRyaWV2ZWQgYnkgdGhlIHdvcmsgcHJvY2VkdXJlLgorICAgICAgICBwSGNpQ29udGV4dC0+cGN0eCA9IHBjdHg7CisgICAgICAgIHBIY2lDb250ZXh0LT5tYWdpYyA9IEJUX0FNUF9IQ0lfQ1RYX01BR0lDOworICAgICAgICB2b3NfaW5pdF93b3JrKCZwSGNpQ29udGV4dC0+aGNpSW50ZXJmYWNlUHJvY2Vzc2luZywKKyAgICAgICAgICAgICAgICAgIGJzbFdyaXRlRmluaXNoKTsKKworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9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FMU0U7CisgICAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICAgIC8vIGFueXRoaW5nIGVsc2UgaW5jbHVkaW5nIEhDSSBldmVudHMgYW5kIFNDTyBkYXRhCisgICAgICAgIHN0YXR1cyA9IEZBTFNFOworICAgICAgICBicmVhazsKKyAgICB9OworCisgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAiJXM6IEZyZWVpbmcgc2tiICVwIiwKKyAgICAgICAgICAgICAgX19mdW5jX18sIHNrYik7CisKKyAgICBjb25zdW1lX3NrYihza2IpOworCisvLyBIb3cgZG8gSSByZXR1cm4gdGhlIGFjdHVhbCBudW1iZXIgb2YgYnl0ZXMgd3JpdHRlbiB0byB0aGUgY2FsbGVyPworLy8gICByZXR1cm4od3JpdHRlbik7CisgICAgcmV0dXJuOworfSAvL2JzbFdyaXRlRmluaXNoKCkKKworVk9TX1NUQVRVUyBXTEFOQkFQX1NldENvbmZpZworKAorICAgIFdMQU5CQVBfQ29uZmlnVHlwZSAqcENvbmZpZworKQoreworICAgIEJzbENsaWVudEN0eFR5cGUqIHBjdHg7CisgICAgVk9TX1NUQVRVUyBzdGF0dXM7CisgICAgLy8gc2FuaXR5IGNoZWNraW5nCisgICAgaWYgKCBwQ29uZmlnID09IE5VTEwgKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0JBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiV0xBTkJBUF9TZXRDb25maWcgYmFkIGlucHV0IiApOworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgfQorICAgIHBjdHggPSBncEJzbGN0eDsKKyAgICBpZiAoIE5VTEwgPT0gcGN0eCApCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfQkFQLCBWT1NfVFJBQ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nRDdHhUeXBlKiBwY3R4ID0gTlVMTDsKKyAgICBpbnQgZXJyID0gMDsKKyAgICB2X0NPTlRFWFRfdCBwVm9zQ29udGV4dCA9IHZvc19nZXRfZ2xvYmFsX2NvbnRleHQoIFZPU19NT0RVTEVfSURfSERELCBOVUxMICk7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKworICAgIHBjdHggPSBncEJzbGN0eDsKKworICAgIGlmICggTlVMTCA9PSBwY3R4ICkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiSW52YWxpZCBCU0wgcG9pbnRlciBmcm9tIHBjdHggb24gV0xBTkJBUF9SZWdpc3RlcldpdGhIQ0kiKTsKKyAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICB9CisgICAgaWYgKCBOVUxMID09IHBBZGFwdGVyICkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiSW52YWxpZCBIREQgQWRhcHRlciBwb2ludGVyIGZyb20gcHZvc0dDdHggb24gV0xBTkJBUF9SZWdpc3RlcldpdGhIQ0kiKTsKKyAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICB9CisKKyAgICBpZihOVUxMICE9IHBjdHgtPmhkZXYpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9CQVAsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgIkFscmVhZHkgcmVnaXN0ZXJlZCBhcyBIQ0kgZGV2aWNlIik7CisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICAgfQorCisKKworICAgIC8qIFNhdmUgYX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GlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgXGZpbGUgIHdsYW5faGRkX2Fzc29jLmMKKyAgXGJyaWVmIFdMQU4gSG9zdCBEZXZpY2UgRHJpdmVyIGltcGxlbWVudGF0aW9uCisKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisgICRIZWFkZXI6JCAgICREYXRlVGltZTogJCAkQXV0aG9yOiAkCisKKworICB3aGVuICAgICAgICB3aG8gICAgd2hhdCwgd2hlcmUsIHdoeQorICAtLS0tLS0tLSAgICAtLS0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgMDUvMDYvMDkgICAgIFNoYWlsZW5kZXIgICAgIENyZWF0ZWQgbW9kdWxlLgorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKyNpbmNsdWRlICJ3bGFuX2hkZF9pbmNsdWRlcy5oIgorI2luY2x1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EtleUNvbXBsZXRlSGFuZGxlciggaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Q3NyUm9hbUluZm8gKnBSb2FtSW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIHJvYW1JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVSb2FtQ21kU3RhdHVzIHJvYW1TdGF0dXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ3NyUm9hbVJlc3VsdCByb2FtUmVzdWx0ICk7CisKK3ZfVk9JRF90IGhkZF9jb25uU2V0Q29ubmVjdGlvblN0YXRlKCBoZGRfc3RhdGlvbl9jdHhfdCAqcEhkZFN0YUN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ29ubmVjdGlvblN0YXRlIGNvbm5TdGF0ZSApCit7CisgICAvLyBzYXZlIHRoZSBuZXcgY29ubmVjdGlvbiBzdGF0ZQorICAgaGRkTG9nKExPRzEsIEZMKCJDb25uZWN0aW9uU3RhdGUgQ2hhbmdlZCBmcm9tIG9sZFN0YXRlOiVkIHRvIFN0YXRlOiVkIiksCisgICAgICAgICAgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5jb25uU3RhdGUsY29ublN0YXRlKTsKKyAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5jb25uU3RhdGUgPSBjb25uU3RhdGU7Cit9CisKKy8vIHJldHVybnMgRkFMU0UgaWYgbm90IGNvbm5lY3RlZC4KKy8vIHJldHVybnMgVFJVRSBmb3IgdGhlIHR3byAnY29ubmVjdGVkJyBzdGF0ZXMgKEluZnJhIEFzc29jaWF0ZWQgb3IgSUJTUyBDb25uZWN0ZWQgKS4KKy8vIHJldHVybnMgdGhlIG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ZG9lc24ndCBjaGFuZ2UgYW5kIGl0IG1heSBiZSBpbnZhbGlkIGluIHRoaXMgc3RydWN0dXJlCisgICAgICAgICAgLy9zbyBubyBjaGFuZ2UgaGVyZS4KKyAgICAgICAgICBpZiggIXBSb2FtSW5mby0+ZlJlYXNzb2NSZXEgKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICAgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLnN0YUlkIFswXT0gcFJvYW1JbmZvLT5zdGFJZDsKKyAgICAgICAgICB9CisgICAgICB9CisgICAgICBlbHNlIGlmICggZUNTUl9CU1NfVFlQRV9JQlNTID09IGVCc3NUeXBlICkKKyAgICAgIHsKKyAgICAgICAgIHZvc19tZW1fY29weShwSGRkU3RhQ3R4LT5jb25uX2luZm8uYnNzSWQsIHBSb2FtSW5mby0+YnNzaWQsc2l6ZW9mKHBSb2FtSW5mby0+YnNzaWQpICk7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICAvLyBjYW4ndCBoYXBwZW4uICBXZSBuZWVkIGEgdmFsaWQgSUJTUyBvciBJbmZyYSBzZXR0aW5nIGluIHRoZSBCU1NEZXNjcmlwdGlvbgorICAgICAgICAgLy8gb3Igd2UgY2FuJ3QgZnVuY3Rpb24uCisgICAgICAgICBWT1NfQVNTRVJUKCAwICk7CisgICAgICB9CisKKyAgICAgIC8vIG5vdGlmeSBXTU0KKyAgICAgIGhkZF93bW1fY29ubmVjdChwQWRhcHRlciwgcFJvYW1JbmZvLCBlQnNzVHlwZSk7CisKKyAgICAgIGlmKCAhcFJvYW1JbmZvLT51LnBDb25uZWN0ZWRQcm9maWxlICkKKyAgICAgIHsKKyAgICAgICAgIFZPU19BU1NFUlQoIHBSb2FtSW5mby0+dS5wQ29ubmVjdGVkUHJvZmlsZSApOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgIC8vIEdldCBNdWx0aWNhc3QgRW5jcnlwdGlvbiBUeXBlCisgICAgICAgICAgZ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ApCisgICAgeworICAgICAgICBoZGRMb2coTE9HRSwKKyAgICAgICAgICAgICIlczogcENzclJvYW1JbmZvLT5uQXNzb2NSc3BMZW5ndGg9JWQiLAorICAgICAgICAgICAgX19mdW5jX18sIChpbnQpcENzclJvYW1JbmZvLT5uQXNzb2NSc3BMZW5ndGgpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgcEZUQXNzb2NSc3AgPSAodTggKikocENzclJvYW1JbmZvLT5wYkZyYW1lcyArIHBDc3JSb2FtSW5mby0+bkJlYWNvbkxlbmd0aCArCisgICAgICAgIHBDc3JSb2FtSW5mby0+bkFzc29jUmVxTGVuZ3RoKTsKKyAgICBpZiAocEZUQXNzb2NSc3AgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIGhkZExvZyhMT0dFLCAiJXM6IEFzc29jUmVxIG9yIEFzc29jUnNwIGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICAvLyBwRlRBc3NvY1JzcCBuZWVkcyB0byBwb2ludCB0byB0aGUgSUVzCisgICAgcEZUQXNzb2NSc3AgKz0gRlRfQVNTT0NfUlNQX0lFU19PRkZTRVQ7CisgICAgaGRkTG9nKExPRzEsICIlczogQXNzb2NSc3AgaXMgbm93IGF0ICUwMnglMDJ4IiwgX19mdW5jX18sCisgICAgICAgICh1bnNpZ25lZCBpbnQpcEZUQXNzb2NSc3BbMF0sCisgICAgICAgICh1bnNpZ25lZCBpbnQpcEZUQXNzb2NSc3BbMV0pOworCisgICAgLy8gV2UgbmVlZCB0byBzZW5kIHRoZSBJRXMgdG8gdGhlIHN1cHBsaWNhbnQuCisgICAgYnVmZiA9IGttYWxsb2MoSVdfR0VORVJJQ19JRV9NQVgsIEdGUF9BVE9NSUMpOworICAgIGlmIChidWZmID09IE5VTEwpCisgICAgeworICAgICAgICBoZGRMb2coTE9HRSwgIiVzOiBrbWFsbG9jIHVuYWJsZSB0byBhbGxvY2F0ZSBtZW1vcnki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bCwgKHU4ICopJihidWZmW3N0cl9sZW5dKSwKKyAgICAgICAgICAgIChJV19DVVNUT01fTUFYIC0gc3RyX2xlbiksICZyaWNfaWVzX2xlbmd0aCApOworICAgIGlmIChyaWNfaWVzX2xlbmd0aCA9PSAwKQorICAgIHsKKyAgICAgICAgaGRkTG9nKExPR1csCisgICAgICAgICAgICAgICAiJXM6IFJJQyBJRXMgaXMgb2YgbGVuZ3RoIDAgbm90IHNlbmRpbmcgUklDIEluZm9ybWF0aW9uIGZvciBub3ciLAorICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICB3cnF1LmRhdGEubGVuZ3RoID0gc3RyX2xlbiArIHJpY19pZXNfbGVuZ3RoOworICAgICAgICB3aXJlbGVzc19zZW5kX2V2ZW50KHBBZGFwdGVyLT5kZXYsIElXRVZDVVNUT00sICZ3cnF1LCBidWZmKTsKKyAgICB9CisKKyAgICAvLyBTbWUgbmVlZHMgdG8gcHJvdmlkZSB0aGUgQXV0aCBSZXNwCisgICAgdm9zX21lbV96ZXJvKGJ1ZmYsIElXX0NVU1RPTV9NQVgpOworICAgIHN0cl9sZW4gPSBzdHJsY3B5KGJ1ZmYsICJBVVRIPSIsIElXX0NVU1RPTV9NQVgpOworICAgIHNtZV9HZXRGVFByZUF1dGhSZXNwb25zZShwSGRkQ3R4LT5oSGFsLCAodTggKikmYnVmZltzdHJfbGVuXSwKKyAgICAgICAgICAgICAgICAgICAgKElXX0NVU1RPTV9NQVggLSBzdHJfbGVuKSwgJmF1dGhfcmVzcF9sZW4pOworCisgICAgaWYgKGF1dGhfcmVzcF9sZW4gPT0gMCkKKyAgICB7CisgICAgICAgIGhkZExvZyhMT0dFLCAiJXM6IEF1dGhSc3AgRlRJRVMgaXMgb2YgbGVuZ3RoIDAiLCBfX2Z1bmNfXyk7CisgICAgICAgIGtmcmVlKGJ1ZmYpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgd3JxdS5kYXR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AgIHR5cGUgPSBXTEFOX1NUQV9BU1NPQ19ET05FX0lORDsKKworI2lmZGVmIFdMQU5fRkVBVFVSRV9QMlBfREVCVUcKKyAgICAgICAgaWYocEFkYXB0ZXItPmRldmljZV9tb2RlID09IFdMQU5fSEREX1AyUF9DTElFTlQpCisgICAgICAgIHsKKyAgICAgICAgICAgICBpZihnbG9iYWxQMlBDb25uZWN0aW9uU3RhdHVzID09IFAyUF9DTElFTlRfQ09OTkVDVElOR19TVEFURV8xKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgZ2xvYmFsUDJQQ29ubmVjdGlvblN0YXR1cyA9IFAyUF9DTElFTlRfQ09OTkVDVEVEX1NUQVRFXzE7CisgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIltQMlAgU3RhdGVdIENoYW5naW5nIHN0YXRlIGZyb20gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQ29ubmVjdGluZyBzdGF0ZSB0byBDb25uZWN0ZWQgU3RhdGUgZm9yIDgtd2F5ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkhhbmRzaGFrZSIpOworICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICBlbHNlIGlmKGdsb2JhbFAyUENvbm5lY3Rpb25TdGF0dXMgPT0gUDJQX0NMSUVOVF9DT05ORUNUSU5HX1NUQVRFXzIpCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBnbG9iYWxQMlBDb25uZWN0aW9uU3RhdHVzID0gUDJQX0NMSUVOVF9DT01QTEVURURfU1RBVEU7CisgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIltQMlAgU3RhdGVdIENoYW5naW5nIHN0YXRlIGZyb20gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIkNvbm5lY3Rpbmcgc3RhdGUgdG8gUDJQIENsaWVudCBDb25uZWN0aW9uIENvbXBsZX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LCAmc3RhRGVzYy52U1RBTUFDQWRkcmVzcyk7CisKKyAgIC8vIFVNQSBpcyBOb3QgcmVhZHkgeWV0LCBYbGF0aW9uIHdpbGwgYmUgZG9uZSBieSBUTAorICAgc3RhRGVzYy51Y1N3RnJhbWVUWFhsYXRpb24gPSAxOworICAgc3RhRGVzYy51Y1N3RnJhbWVSWFhsYXRpb24gPSAxOworICAgc3RhRGVzYy51Y0FkZFJtdkxMQyA9IDE7CisgICAvLyBJbml0aWFsaXplIHNpZ25hdHVyZXMgYW5kIHN0YXRlCisgICBzdGFEZXNjLnVjVWNhc3RTaWcgID0gcFJvYW1JbmZvLT51Y2FzdFNpZzsKKyAgIHN0YURlc2MudWNCY2FzdFNpZyAgPSBwUm9hbUluZm8tPmJjYXN0U2lnOworICAgc3RhRGVzYy51Y0luaXRTdGF0ZSA9IFdMQU5UTF9TVEFfQVVUSEVOVElDQVRFRDsKKworICAgc3RhRGVzYy51Y0lzUmVwbGF5Q2hlY2tWYWxpZCA9IFZPU19GQUxTRTsKKworICAgLy8gUmVnaXN0ZXIgdGhlIFN0YXRpb24gd2l0aCBUTC4KKyAgIHZvc1N0YXR1cyA9IFdMQU5UTF9SZWdpc3RlclNUQUNsaWVudCggcEhkZEN0eC0+cHZvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhkZF9yeF9wYWNrZXRfY2JrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZGRfdHhfY29tcGxldGVfY2JrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZGRfaWJzc190eF9mZXRjaF9wYWNrZXRfY2JrLCAmc3RhRGVzYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJzc0Rlc2MtPnJzc2kgKTsKKyAgIGlmICggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyggdm9zU3RhdHVzICkgKQorICAgeworICAgICAgV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lY3RIYW5kbGVyKCBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwgdENzclJvYW1JbmZvICpwUm9hbUluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIHJvYW1JZCwgZVJvYW1DbWRTdGF0dXMgcm9hbVN0YXR1cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNzclJvYW1SZXN1bHQgcm9hbVJlc3VsdCApCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIFZPU19TVEFUVVMgdnN0YXR1czsKKyAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ID0gcEFkYXB0ZXItPmRldjsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKyAgICB2X1U4X3Qgc3RhX2lkOworICAgIHZfQk9PTF90IHNlbmREaXNjb25JbmQgPSBUUlVFOworCisgICAgLy8gU2FuaXR5IGNoZWNrCisgICAgaWYoZGV2ID09IE5VTEwpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICIlczogbmV0X2RldiBpcyByZWxlYXNlZCByZXR1cm4iLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIH0KKworICAgIC8vIG5vdGlmeSBhcHBzIHRoYXQgd2UgY2FuJ3QgcGFzcyB0cmFmZmljIGFueW1vcmUKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sIEZMKCJEaXNhYmxpbmcgcXVldWVzIikpOworICAgIG5ldGlmX3R4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ZWN0aW9uU3RhdHVzID09IFAyUF9DTElFTlRfQ09OTkVDVEVEX1NUQVRFXzEpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBnbG9iYWxQMlBDb25uZWN0aW9uU3RhdHVzID0gUDJQX0NMSUVOVF9ESVNDT05ORUNURURfU1RBVEU7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIltQMlAgU3RhdGVdIDggd2F5IEhhbmRzaGFrZSBjb21wbGV0ZWQgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAiYW5kIG1vdmVkIHRvIGRpc2Nvbm5lY3RlZCBzdGF0ZSIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmKGdsb2JhbFAyUENvbm5lY3Rpb25TdGF0dXMgPT0gUDJQX0NMSUVOVF9DT01QTEVURURfU1RBVEUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBnbG9iYWxQMlBDb25uZWN0aW9uU3RhdHVzID0gUDJQX05PVF9BQ1RJVkU7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIltQMlAgU3RhdGVdIFAyUCBDbGllbnQgaXMgcmVtb3ZlZCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICJhbmQgbW92ZWQgdG8gaW5hY3RpdmUgc3RhdGUiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgICAgICAgIGlmICgocm9hbVN0YXR1cyA9PSBlQ1NSX1JPQU1fTE9TVExJTkspICYmCisgICAgICAgICAgICAgICAgICAgICFwUm9hbUluZm8tPnJlYXNvbkNvZGUpCisgICAgICAgICAgICAgICAgICAgd2xhbl9oZGRfZ2V0X2ZyYW1lX2xvZ3MocEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5fSEREX0dFVF9GUkFNRV9MT0dfQ01EX1NFTkRfQU5EX0NMRUFSKTsKKyAgICAgICAgICAgIC8qT25seSBzZW5kIGluZGljYXRpb24gdG8ga2VybmVsIGlmIG5vdCBpbml0aWF0ZWQgYnkga2VybmVsKi8KKyAgICAgICAgICAgIGlmICggc2VuZERpc2NvbkluZCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvKiBUbyBhdm9pZCB3cGFfc3VwcGxpY2FudCBzZW5kaW5nICJIQU5HRUQiIENNRCB0byBJQ1MgVUkgKi8KKyAgICAgICAgICAgICAgIGlmICggZUNTUl9ST0FNX0xPU1RMSU5LID09IHJvYW1TdGF0dXMgKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIGNmZzgwMjExX2Rpc2Nvbm5lY3RlZChkZXYsIHBSb2FtSW5mby0+cmVhc29uQ29kZSwgTlVMTCwgMCwgR0ZQX0tFUk5FTCk7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgY2ZnODAyMTFfZGlzY29ubmVjdGVkKGRldiwgV0xBTl9SRUFTT05fVU5TUEVDSUZJRUQsIE5VTEwsIDAsIEdGUF9LRVJORUwpOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAocEFkYXB0ZXItPmRldmljZV9tb2RlID09IFdMQU5fSEREX1AyUF9DTElFTlQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKExPRzEsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJQMlAgY2xpZW50IGlzIGdldHRpbmcgcmVtb3ZlZCBhbmQgd2UgYXJlIHRyeWlnIHRvIHJlLWVuYWJsZSBURExTIikpOworICAgICAgICAgICAgICAgIHdsYW5faGRkX3RkbHNfcmVlbmFibGUocEhkZEN0eCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vSWYgdGhlIERldmljZSBNb2RlIGlzIFN0YXRpb24KKyAgICAgICAgICAgIC8vIGFuZCB0aGUgUDJQIENsaWVudCBpcyBDb25uZWN0ZWQKKyAgICAgICAgICAgIC8vRW5hYmxlIEJNUFMKKworICAgICAgICAgICAgLy8gSW4gY2FzZSBvZiBKQiwgYXMgQ2hhbmdlLUlmYWNlIG1heSBvciBtYXlub3QgYmUgY2FsbGVkIGZvciBwMnAwCisgICAgICAgICAgICAvLyBFbmFibGUgQk1QUy9JTVBTIGluIGNhc2UgUDJQX0NMSUVOVCBkaXNjb25uZWN0ZWQKKyAgICAgICAgICAgIGlmKFZPU19TVEFUVVNfU1VDQ0VTUyA9PSBoZGRfaXNzdGFfcDJwX2NsaWVudGNvbm5lY3RlZChwSGRkQ3R4KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8vRW5hYmxlIEJNUFMgb25seSBvZiBvdGhlciBTZXNzaW9uIGlzIFAyUCBDbGllbnQKKyAgICAgICAgICAgICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSBOVUxMOworICAgICAgICAgICAgICAgdl9DT05URVhUX3QgcFZvc0NvbnRleHQgPSB2b3NfZ2V0X2dsb2JhbF9jb250ZXh0KCBWT1NfTU9EVUxFX0lEX0hERCwgTlVMTCApOworCisgICAgICAgICAgICAgICBpZiAoTlVMTCAhPSBwVm9zQ29udGV4dCkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBwSGRkQ3R4ID0gdm9zX2dldF9jb250ZXh0KCBWT1NfTU9EVUxFX0lEX0hERCwgcFZvc0NvbnRleHQpOworCisgICAgICAgICAgICAgICAgICAgaWYoTlVMTCAhPSBwSGRkQ3R4KQorICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgLy9Pbmx5IFAyUCBDbGllbnQgaXMgdGhlcmUgRW5hYmxlIEJtcHMgYmFjaworICAgICAgICAgICAgICAgICAgICAgICBpZigoMCA9PSBwSGRkQ3R4LT5ub19vZl9vcGVuX3Nlc3Npb25zW1ZPU19TVEFfU0FQX01PREVdKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAoMCA9PSBwSGRkQ3R4LT5ub19vZl9vcGVuX3Nlc3Npb25zW1ZPU19QMlBfR09fTU9ERV0pKQorICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocEhkZEN0eC0+aGRkX3dsYW5fc3VzcGVuZGVkKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhkZF9zZXRfcHdycGFyYW1zKHBIZGRDdHgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgaGRkX2VuYWJsZV9ibXBzX2ltcHMocEhkZEN0eCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgICBoZGRfd21tX2FkYXB0ZXJfY2xlYXIocEFkYXB0ZXIpOworI2lmIGRlZmluZWQoV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIpCisgICAgIHNtZV9GVFJlc2V0KFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSk7CisjZW5kaWYKKworICAgIGlmIChlQ1NSX1JPQU1fSUJTU19MRUFWRSA9PSByb2FtU3RhdHVzKQorICAgIHsKKyAgICAgICAgdl9VOF90IGk7CisKKyAgICAgICAgc3RhX2lkID0gSUJTU19CUk9BRENBU1RfU1RBSUQ7CisgICAgICAgIHZzdGF0dXMgPSBoZGRfaWJzc19EZXJlZ2lzdGVyU1RBKCBwQWRhcHRlciwgc3RhX2lkICk7CisgICAgICAgIGlmICggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2c3RhdHVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgRkwoImhkZF9yb2FtRGVyZWdpc3RlclNUQSgpIGZhaWxlZCB0byBmb3Igc3RhSUQgJWQuICAiCisgICAgICAgICAgICAgICAgICAgICAiU3RhdHVzPSAlZCBbMHgleF0iKSwKKyAgICAgICAgICAgICAgICAgICAgIHN0YV9pZCwgc3RhdHVzLCBzdGF0dXMgKTsKKworICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgfQorICAgICAgICBwSGRkQ3R4LT5zdGFfdG9fYWRhcHRlcltzdGFfaWRdID0gTlVMTDsKKworICAgICAgICAvKkNsZWFyIGFsbCB0aGUgcGVlciBzdGEgcmVnaXN0ZXIgd2l0aCBUTC4qLworICAgICAgICBmb3IgKGkgPTA7IGkgPCBIRERfTUFYX05VTV9JQlNTX1NUQTsgaSsrICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKDAgIT0gcEhkZFN0YUN0eC0+Y29ubl9pbmZvLnN0YUlkW2ldKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgc3RhX2lkID0gcEhkZFN0YUN0eC0+Y29ubl9pbmZvLnN0YUlkW2ldOworCisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgRkwoIkRlcmVnaXN0ZXIgU3RhSUQgJWQiKSxzdGFfaWQpOworICAgICAgICAgICAgICAgdnN0YXR1cyA9IGhkZF9pYnNzX0RlcmVnaXN0ZXJTVEEoIHBBZGFwdGVyLCBzdGFfaWQgKTsKKyAgICAgICAgICAgICAgIGlmICggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2c3RhdHVzICkgKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgRkwoImhkZF9yb2FtRGVyZWdpc3RlclNUQSgpIGZhaWxlZCB0byBmb3Igc3RhSUQgJWQuICAiCisgICAgICAgICAgICAgICAgICAgICAgIlN0YXR1cz0gJWQgWzB4JXhdIiksCisgICAgICAgICAgICAgICAgICAgICAgIHN0YV9pZCwgc3RhdHVzLCBzdGF0dXMgKTsKKyAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICB2c3RhdHVzID0gaGRkX3N0YV9pZF9oYXNoX3JlbW92ZV9lbnRyeShwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YV9pZCwgJnBIZGRTdGFDdHgtPmNvbm5faW5mby5wZWVyTWFjQWRkcmVzc1tpXSk7CisgICAgICAgICAgICAgICBpZiAodnN0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpIHsKKyAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiTm90IGFibGUgdG8gcmVtb3ZlIHN0YWlkIGhhc2ggJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhX2lkKTsKKyAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgRkwoImlic3Mgc3RhdGlvbiByZW1vdmVkIHN0YV9pZCAlZCBtYWM6IgorICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSRVNTX1NUUiksIHN0YV9pZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwSGRkU3RhQ3R4LT5jb25uX2luZm8ucGVlck1hY0FkZHJlc3NbaV0uYnl0ZXMpKTsKKyAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgLypzZXQgdGhlIHN0YWlkIGFuZCBwZWVyIG1hYyBhcyAwLCBhbGwgb3RoZXIgcmVzZXQgYXJlCisgICAgICAgICAgICAgICAgKiBkb25lIGluIGhkZF9jb25uUmVtb3ZlQ29ubmVjdEluZm8uCisgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5zdGFJZFtpXT0gMDsKKyAgICAgICAgICAgICAgIHZvc19tZW1femVybyggJnBIZGRTdGFDdHgtPmNvbm5faW5mby5wZWVyTWFjQWRkcmVzc1tpXSwgc2l6ZW9mKCB2X01BQ0FERFJfdCApICk7CisKKyAgICAgICAgICAgICAgIGlmIChzdGFfaWQgPCAoV0xBTl9NQVhfU1RBX0NPVU5UICsgMykpCisgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPnN0YV90b19hZGFwdGVyW3N0YV9pZF0gPSBOVUxMOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICBzdGFfaWQgPSBwSGRkU3RhQ3R4LT5jb25uX2luZm8uc3RhSWRbMF07CisKKyAgICAgICAvL1dlIHNob3VsZCBjbGVhciBhbGwgc3RhIHJlZ2lzdGVyIHdpdGggVEwsIGZvciBub3csIG9ubHkgb25lLgorICAgICAgIHZzdGF0dXMgPSBoZGRfcm9hbURlcmVnaXN0ZXJTVEEoIHBBZGFwdGVyLCBzdGFfaWQgKTsKKyAgICAgICBpZiAoICFWT1NfSVNfU1RBVFVTX1NVQ0NFU1ModnN0YXR1cyApICkKKyAgICAgICB7CisgICAgICAgICAgIFZPU19UUkFDRShWT1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kVfV0xBTl9URExTCisgICAgaWYgKGVDU1JfUk9BTV9JQlNTX0xFQVZFICE9IHJvYW1TdGF0dXMpCisgICAgeworICAgICAgICB3bGFuX2hkZF90ZGxzX2Rpc2Nvbm5lY3Rpb25fY2FsbGJhY2socEFkYXB0ZXIpOworICAgIH0KKyNlbmRpZgorCisgICAgLy9VbmJsb2NrIGFueW9uZSB3YWl0aW5nIGZvciBkaXNjb25uZWN0IHRvIGNvbXBsZXRlCisgICAgY29tcGxldGUoJnBBZGFwdGVyLT5kaXNjb25uZWN0X2NvbXBfdmFyKTsKKyAgICByZXR1cm4oIHN0YXR1cyApOworfQorCitzdGF0aWMgdm9pZCBoZGRfcG9zdFRMUGFja2V0UGVuZGluZ0luZChoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCBzdGFJZCkKK3sKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgdl9TSU5UX3QgaTsKKyAgICB2X1NJWkVfdCBzaXplOworICAgIFZPU19TVEFUVVMgc3RhdHVzOworICAgIHZfQk9PTF90IGdyYW50ZWQgPSBWT1NfRkFMU0U7CisKKyAgICBpZiAoKHBBZGFwdGVyLT5kZXZpY2VfbW9kZSA9PSBXTEFOX0hERF9JTkZSQV9TVEFUSU9OKSB8fAorICAgICAgICAocEFkYXB0ZXItPmRldmljZV9tb2RlID09IFdMQU5fSEREX1AyUF9DTElFTlQpIHx8CisgICAgICAgIChwQWRhcHRlci0+ZGV2aWNlX21vZGUgPT0gV0xBTl9IRERfUDJQX0RFVklDRSkpCisgICAgeworICAgICAgICAvL0luZGljYXRlIHRvIFRMIHRoYXQgdGhlcmUgaXMgcGVuZGluZyBkYXRhIGlmIGEgcXVldWUgaXMgbm9uIGVtcHR5CisgICAgICAgIGZvciAoaSA9IFdMQU5UTF9BQ19ISUdIX1BSSU87IGk+PTA7IC0taSkKKyAgICAgICAgeworICAgICAgICAgICAgc2l6ZSA9IDA7CisgICAgICAgICAgICBoZGRfbGlzdF9zaXplKCZwQWRhcHRlci0+d21tX3R4X3F1ZXVlW2ldLCAmc2l6ZSk7CisgICAgICAgICAgICBpZiAoc2l6ZSA+IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBpZiAoaSAhPSBXTEFOVExfQUNfSElHSF9QUklPKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKFZPU19GQUxTRSA9PQorICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5oZGRXbW1TdGF0dXMud21tQWNTdGF0dXNbaV0ud21tQWNBY2Nlc3NBbGxvd2VkKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgaGRkX3dtbV9hY3F1aXJlX2FjY2VzcyhwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV0xBTlRMX0FDRW51bVR5cGUpaSwgJmdyYW50ZWQpOworICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnBzYkNoYW5nZWQgfD0gKDEgPDwgaSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICBncmFudGVkID0gVk9TX1RSVUU7CisgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgIGlmIChncmFudGVkIHx8IChpID09IFdMQU5UTF9BQ19ISUdIX1BSSU8pKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgc3RhdHVzID0gV0xBTlRMX1NUQVBrdFBlbmRpbmcocEhkZEN0eC0+cHZvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFJZCwgKFdMQU5UTF9BQ0VudW1UeXBlKWkpOworICAgICAgICAgICAgICAgICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogRmFpbHVyZSBpbiBpbmRpY2F0aW5nIHBrdCB0byBUTCBmb3IgUUlEPSVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgaSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cit9CisKK3N0YXRpYyBWT1NfU1RBVFVTIGhkZF9yb2FtUmVnaXN0ZXJTVEEoIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdENzclJvYW1JbmZvICpwUm9hbUluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3Qgc3RhSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X01BQ0FERFJfdCAqcFBlZXJNYWNBZGRyZXNzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpckJzc0Rlc2NyaXB0aW9uICpwQnNzRGVzYyApCit7CisgICBWT1NfU1RBVFVTIHZvc1N0YXR1cyA9IFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgV0xBTl9TVEFEZXNjVHlwZSBzdGFEZXNjID0gezB9OworICAgZUNzckVuY3J5cHRpb25UeXBlIGNvbm5lY3RlZENpcGhlckFsZ287CisgICB2X0JPT0xfdCAgZkNvbm5lY3RlZDsKKyAgIGhkZF9zdGF0aW9uX2N0eF90ICpwSGRkU3RhQ3R4ID0gV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1B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2xpZW50KCBwSGRkQ3R4LT5wdm9zQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGRkX3J4X3BhY2tldF9jYmssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhkZF90eF9jb21wbGV0ZV9jYmssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhkZF90eF9mZXRjaF9wYWNrZXRfY2JrLCAmc3RhRGVzYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJzc0Rlc2MtPnJzc2kgKTsKKworICAgaWYgKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCB2b3NTdGF0dXMgKSApCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgICAgIldMQU5UTF9SZWdpc3RlclNUQUNsaWVudCgpIGZhaWxlZCB0byByZWdpc3Rlci4gIFN0YXR1cz0gJWQgWzB4JTA4WF0iLAorICAgICAgICAgICAgICAgICB2b3NTdGF0dXMsIHZvc1N0YXR1cyApOworICAgICAgcmV0dXJuIHZvc1N0YXR1czsKKyAgIH0KKworICAgaWYgKCBjZmdfcGFyYW0tPmR5blNwbGl0c2NhbiAmJgorICAgICAgKCBWT1NfVElNRVJfU1RBVEVfUlVOTklORyAhPQorICAgICAgICAgICAgICAgICAgICAgIHZvc190aW1lcl9nZXRDdXJyZW50U3RhdGUoJnBIZGRDdHgtPnR4X3J4X3RyYWZmaWNUbXIpKSkKKyAgIHsKKyAgICAgICB2b3NfdGltZXJfc3RhcnQoJnBIZGRDdHgtPnR4X3J4X3RyYWZmaWNUbXIsCisgICAgICAgICAgICAgICAgICAgICAgIGNmZ19wYXJhbS0+dHJhZmZpY01udHJUbXJGb3JTcGxpdFNjYW4pOworICAgfQorCisgICAvLyBpZiAoV1BBKSwgdGV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CBWT1NfVFJBQ0VfTEVWRUxfSU5GT19NRUQsCisgICAgICAgICAgICAgICAgICJVTEEgYXV0aCBTdGFJZD0gJWQuIENoYW5naW5nIFRMIHN0YXRlIHRvIENPTk5FQ1RFRCIKKyAgICAgICAgICAgICAgICAgImF0IEpvaW4gdGltZSIsIHBIZGRTdGFDdHgtPmNvbm5faW5mby5zdGFJZFswXSApOworICAgICAgdm9zU3RhdHVzID0gV0xBTlRMX0NoYW5nZVNUQVN0YXRlKCBwSGRkQ3R4LT5wdm9zQ29udGV4dCwgc3RhRGVzYy51Y1NUQUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfU1RBX0NPTk5FQ1RFRCApOworICAgICAgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLnVJc0F1dGhlbnRpY2F0ZWQgPSBWT1NfRkFMU0U7CisgICB9CisgICByZXR1cm4oIHZvc1N0YXR1cyApOworfQorCitzdGF0aWMgdm9pZCBoZGRfU2VuZFJlQXNzb2NFdmVudChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyAgICB0Q3NyUm9hbUluZm8gKnBDc3JSb2FtSW5mbywgdl9VOF90ICpyZXFSc25JZSwgdEFOSV9VMzIgcmVxUnNuTGVuZ3RoKQoreworICAgIHVuc2lnbmVkIGludCBsZW4gPSAwOworICAgIHU4ICpwRlRBc3NvY1JzcCA9IE5VTEw7CisgICAgdl9VOF90ICpyc3BSc25JZSA9IGttYWxsb2MoSVdfR0VORVJJQ19JRV9NQVgsIEdGUF9LRVJORUwpOworICAgIHRBTklfVTMyIHJzcFJzbkxlbmd0aCA9IDA7CisgICAgc3RydWN0IGllZWU4MDIxMV9jaGFubmVsICpjaGFuOworCisgICAgaWYgKCFyc3BSc25JZSkgeworICAgICAgICBoZGRMb2coTE9HRSwgIiVzOiBVbmFibGUgdG8gYWxsb2NhdGUgUlNOIElFIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaWYgKHBDc3JSb2FtSW5mbyA9PSBOVUxMKSB7CisgICAgICAgIGhkZExvZyhMT0dFLCAiJXM6IEludmFsaWQgQ1NSIHJvYW0gaW5mbyIsIF9fZnVuY19fKTsKKyAgICAgICAgZ290byBkb25lOworICAgIH0KKworICAgIGlmIChwQ3NyUm9hbUluZm8tPm5Bc3NvY1JzcExlbmd0aCA9PSAwKSB7CisgICAgICAgIGhkZExvZyhMT0dFLCAiJXM6IEludmFsaWQgYXNzb2MgcmVzcG9uc2UgbGVuZ3RoIiwgX19mdW5jX18pOworICAgICAgICBnb3RvIGRvbmU7CisgICAgfQorCisgICAgcEZUQXNzb2NSc3AgPSAodTggKikocENzclJvYW1JbmZvLT5wYkZyYW1lcyArIHBDc3JSb2FtSW5mby0+bkJlYWNvbkxlbmd0aCArCisgICAgICAgICAgICAgICAgICAgIHBDc3JSb2FtSW5mby0+bkFzc29jUmVxTGVuZ3RoKTsKKyAgICBpZiAocEZUQXNzb2NSc3AgPT0gTlVMTCkKKyAgICAgICAgZ290byBkb25lOworCisgICAgLy9wRlRBc3NvY1JzcCBuZWVkcyB0byBwb2ludCB0byB0aGUgSUVzCisgICAgcEZUQXNzb2NSc3AgKz0gRlRfQVNTT0NfUlNQX0lFU19PRkZTRVQ7CisgICAgaGRkTG9nKExPRzEsICIlczogQXNzb2NSc3AgaXMgbm93IGF0ICUwMnglMDJ4IiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBpbnQpcEZUQXNzb2NSc3BbMF0sCisgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBpbnQpcEZUQXNzb2NSc3BbMV0pOworCisgICAgLy8gU2VuZCB0aGUgQXNzb2MgUmVzcCwgdGhlIHN1cHBsaWNhbnQgbmVlZHMgdGhpcyBmb3IgaW5pdGlhbCBBdXRoLgorICAgIGxlbiA9IHBDc3JSb2FtSW5mby0+bkFzc29jUnNwTGVuZ3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nBlZXJNYWMsCisgICAgICAgICAgICAgICAgIHBIZGRTdGFDdHgtPnJvYW1faW5mby5wZWVyTWFjLAorICAgICAgICAgICAgICAgICBXTklfQ0ZHX0JTU0lEX0xFTik7CisKKyAgICBoYWxTdGF0dXMgPSBoZGRfUm9hbVNldEtleUNvbXBsZXRlSGFuZGxlcihwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcm9hbUluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZFN0YUN0eC0+cm9hbV9pbmZvLnJvYW1JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkU3RhQ3R4LT5yb2FtX2luZm8ucm9hbVN0YXR1cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fUkVTVUxUX0FVVEhFTlRJQ0FURUQpOworICAgIGlmIChoYWxTdGF0dXMgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIGhkZExvZyhMT0dFLCAiJXM6IFNldCBLZXkgY29tcGxldGUgZmFpbHVyZSIsIF9fZnVuY19fKTsKKyAgICB9CisgICAgcEhkZFN0YUN0eC0+cm9hbV9pbmZvLmRlZmVyS2V5Q29tcGxldGUgPSBGQUxTRTsKK30KKworc3RhdGljIGVIYWxTdGF0dXMgaGRkX0Fzc29jaWF0aW9uQ29tcGxldGlvbkhhbmRsZXIoIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLCB0Q3NyUm9hbUluZm8gKnBSb2FtSW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiByb2FtSWQsIGVSb2FtQ21kU3RhdHVzIHJvYW1TdGF0dXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNzclJvYW1SZXN1bHQgcm9hbVJlc3VsdCApC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JXzExUgorICAgICAgICAgICAgdTggKnBGVEFzc29jUnNwID0gTlVMTDsKKyAgICAgICAgICAgIHVuc2lnbmVkIGludCBhc3NvY1JzcGxlbiA9IDA7CisgICAgICAgICAgICB1OCAqcEZUQXNzb2NSZXEgPSBOVUxMOworICAgICAgICAgICAgdW5zaWduZWQgaW50IGFzc29jUmVxbGVuID0gMDsKKyAgICAgICAgICAgIHN0cnVjdCBpZWVlODAyMTFfY2hhbm5lbCAqY2hhbjsKKyNlbmRpZgorICAgICAgICAgICAgdl9VOF90IHJzcFJzbkllW0RPVDExRl9JRV9SU05fTUFYX0xFTl07CisgICAgICAgICAgICB0QU5JX1UzMiByc3BSc25MZW5ndGggPSBET1QxMUZfSUVfUlNOX01BWF9MRU47CisKKyAgICAgICAgICAgIC8qIGFkZCBic3NfaWQgdG8gY2ZnODAyMTEgZGF0YSBiYXNlICovCisgICAgICAgICAgICBic3MgPSB3bGFuX2hkZF9jZmc4MDIxMV91cGRhdGVfYnNzX2RiKHBBZGFwdGVyLCBwUm9hbUluZm8pOworICAgICAgICAgICAgaWYgKE5VTEwgPT0gYnNzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHByX2Vycigid2xhbjogTm90IGFibGUgdG8gY3JlYXRlIEJTUyBlbnRyeVxuIik7CisgICAgICAgICAgICAgICAgbmV0aWZfY2Fycmllcl9vZmYoZGV2KTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIH0KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUgorICAgICAgICAgICAgaWYocFJvYW1JbmZvLT51LnBDb25uZWN0ZWRQcm9maWxlLT5BdXRoVHlwZSA9PSBlQ1NSX0FVVEhfVFlQRV9GVF9SU04gfHwKKyAgICAgICAgICAgICAgICBwUm9hbUluZm8tPnUucENvbm5lY3RlZFByb2ZpbGUtPkF1dGhUeXBlID09IGVDU1JfQVVUSF9UWVBFX0ZUX1JTTl9QU0sgKQorICAgICAgICAgICAgeworCisgICAgICAgICAgICAgICAgLy9Bc3NvY2lhdGlvbiBSZXNwb25zZQorICAgICAgICAgICAgICAgIHBGVEFzc29jUnNwID0gKHU4ICopKHBSb2FtSW5mby0+cGJGcmFtZXMgKyBwUm9hbUluZm8tPm5CZWFjb25MZW5ndGggKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT5uQXNzb2NSZXFMZW5ndGgpOworICAgICAgICAgICAgICAgIGlmIChwRlRBc3NvY1JzcCAhPSBOVUxMKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gcEZUQXNzb2NSc3AgbmVlZHMgdG8gcG9pbnQgdG8gdGhlIElFcworICAgICAgICAgICAgICAgICAgICBwRlRBc3NvY1JzcCArPSBGVF9BU1NPQ19SU1BfSUVTX09GRlNFVDsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKExPRzEsICIlczogQXNzb2NSc3AgaXMgbm93IGF0ICUwMnglMDJ4IiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGludClwRlRBc3NvY1JzcFswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgaW50KXBGVEFzc29jUnNwWzFdKTsKKyAgICAgICAgICAgICAgICAgICAgYXNzb2NSc3BsZW4gPSBwUm9hbUluZm8tPm5Bc3NvY1JzcExlbmd0aCAtIEZUX0FTU09DX1JTUF9JRVNfT0ZGU0VUOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIiVzOkFzc29jUnNwIGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgICAgIGFzc29jUnNwbGVuID0gMDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvL0Fzc29jaWF0aW9uIFJlcXVlc3QKKyAgICAgICAgICAgICAgICBwRlRBc3NvY1JlcSA9ICh1OCAqKShwUm9hbUluZm8tPnBiRnJhbWVzICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPm5CZWFjb25MZW5ndGgpOworICAgICAgICAgICAgICAgIGlmIChwRlRBc3NvY1JlcSAhPSBOVUxMKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoIWZ0X2NhcnJpZXJfb24pCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAvLyBwRlRBc3NvY1JlcSBuZWVkcyB0byBwb2ludCB0byB0aGUgSUVzCisgICAgICAgICAgICAgICAgICAgICAgICBwRlRBc3NvY1JlcSArPSBGVF9BU1NPQ19SRVFfSUVTX09GRlNFVDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0cxLCAiJXM6IHBGVEFzc29jUmVxIGlzIG5vdyBhdCAlMDJ4JTAyeCIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBpbnQpcEZUQXNzb2NSZXFbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGludClwRlRBc3NvY1JlcVsxXSk7CisgICAgICAgICAgICAgICAgICAgICAgICBhc3NvY1JlcWxlbiA9IHBSb2FtSW5mby0+bkFzc29jUmVxTGVuZ3RoIC0gRlRfQVNTT0NfUkVRX0lFU19PRkZTRVQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvKiBUaGlzIHNob3VsZCBjb250YWluIG9ubHkgdGhlIEZUSUVzICovCisgICAgICAgICAgICAgICAgICAgICAgICBhc3NvY1JlcWxlbiA9IHBSb2FtSW5mby0+bkFzc29jUmVxTGVuZ3RoOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCAiJXM6QXNzb2NSZXEgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICAgICAgYXNzb2NSZXFsZW4gPSAwOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmKGZ0X2NhcnJpZXJfb24pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAoICFoZGREaXNjb25JblByb2dyZXNzICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKExPRzEsICIlcyBmdF9jYXJyaWVyX29uIGlzICVkLCBzZW5kaW5nIHJvYW1lZCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaW5kaWNhdGlvbiIsIF9fRlVOQ1RJT05fXywgZnRfY2Fycmllcl9vbik7CisgICAgICAgICAgICAgICAgICAgICAgICBjaGFuID0gaWVlZTgwMjExX2dldF9jaGFubmVsKHBBZGFwdGVyLT53ZGV2LndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaW50KXBSb2FtSW5mby0+cEJzc0Rlc2MtPmNoYW5uZWxJZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HMSwgImFzc29jUmVxbGVuICVkIGFzc29jUnNwbGVuICVkIiwgYXNzb2NSZXFsZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFzc29jUnNwbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwSGRkQ3R4LT5jZmdfaW5pLT5nRW5hYmxlUm9hbURlbGF5U3RhdHMpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX3JlY29yZF9yb2FtX2V2ZW50KGVfSEREX1NFTkRfUkVBU1NPQ19SU1AsIE5VTEwsIDApOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgY2ZnODAyMTFfcm9hbWVkKGRldixjaGFuLCBwUm9hbUluZm8tPmJzc2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEZUQXNzb2NSZXEsIGFzc29jUmVxbGVuLCBwRlRBc3NvY1JzcCwgYXNzb2NSc3BsZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHRlBfS0VSTkVMKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoc21lX0dldEZUUFRLU3RhdGUoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc21lX1NldEZUUFRLU3RhdGUoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLCBGQUxTRSk7CisgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPmZBdXRoUmVxdWlyZWQgPSBGQUxTRTsKKworICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBIZGRTdGFDdHgtPnJvYW1faW5mby5ic3NpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPmJzc2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhERF9NQUNfQUREUl9MRU4pOworICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBIZGRTdGFDdHgtPnJvYW1faW5mby5wZWVyTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+cGVlck1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIRERfTUFDX0FERFJfTEVOKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRTdGFDdHgtPnJvYW1faW5mby5yb2FtSWQgPSByb2FtSWQ7CisgICAgICAgICAgICAgICAgICAgICAgICBwSGRkU3RhQ3R4LT5yb2FtX2luZm8ucm9hbVN0YXR1cyA9IHJvYW1TdGF0dXM7CisgICAgICAgICAgICAgICAgICAgICAgICBwSGRkU3RhQ3R4LT5yb2FtX2luZm8uZGVmZXJLZXlDb21wbGV0ZSA9IFRSVUU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoICFoZGREaXNjb25JblByb2dyZXNzICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0cxLCAiJXMgZnRfY2Fycmllcl9vbiBpcyAlZCwgc2VuZGluZyBjb25uZWN0ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpbmRpY2F0aW9uIiwgX19GVU5DVElPTl9fLCBmdF9jYXJyaWVyX29uKTsKKyAgICAgICAgICAgICAgICAgICAgY2ZnODAyMTFfY29ubmVjdF9yZXN1bHQoZGV2LCBwUm9hbUluZm8tPmJzc2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRlRBc3NvY1JlcSwgYXNzb2NSZXFsZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBGVEFzc29jUnNwLCBhc3NvY1JzcGxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9TVEFUVVNfU1VDQ0VTUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR0ZQX0tFUk5FTCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorI2VuZGlmCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogd3BhIHN1cHBsaWNhbnQgZXhwZWN0aW5nIFdQQS9SU04gSUUgaW4gY29ubmVjdCByZXN1bHQgKi8KKyAgICAgICAgICAgICAgICBjc3JSb2FtR2V0V3BhUnNuUmVxSUUoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLAorICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICZyZXFSc25MZW5ndGgsCisgICAgICAgICAgICAgICAgICAgICAgICByZXFSc25JZSk7CisKKyAgICAgICAgICAgICAgICBjc3JSb2FtR2V0V3BhUnNuUnNwSUUoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLAorICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICZyc3BSc25MZW5ndGgsCisgICAgICAgICAgICAgICAgICAgICAgICByc3BSc25JZSk7CisgICAgICAgICAgICAgICAgaWYgKCAhaGRkRGlzY29uSW5Qcm9ncmVzcyApCisgICAgICAgICAgICAgICAgeworI2lmICBkZWZpbmVkIChGRUFUVVJFX1dMQU5fRVNFKSB8fCBkZWZpbmVkKEZFQVRVUkVfV0xBTl9MRlIpCisgICAgICAgICAgICAgICAgICAgIGlmKGZ0X2NhcnJpZXJfb24pCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGhkZF9TZW5kUmVBc3NvY0V2ZW50KGRldiwgcEFkYXB0ZXIsIHBSb2FtSW5mbywgcmVxUnNuSWUsIHJlcVJzbkxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAocEhkZEN0eC0+Y2ZnX2luaS0+Z0VuYWJsZVJvYW1EZWxheVN0YXRzKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19yZWNvcmRfcm9hbV9ldmVudChlX0hERF9TRU5EX1JFQVNTT0NfUlNQLCBOVUxMLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0VTRSAqLworCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBzZW5kaW5nIGNvbm5lY3QgaW5kaWNhdGlvbiB0byBubDgwMjExOiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGZvciBic3NpZCAiIE1BQ19BRERSRVNTX1NUUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgcmVzdWx0OiVkIGFuZCBTdGF0dXM6JWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBNQUNfQUREUl9BUlJBWShwUm9hbUluZm8tPmJzc2lkKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByb2FtUmVzdWx0LCByb2FtU3RhdHVzKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGluZm9ybSBjb25uZWN0IHJlc3VsdCB0byBubDgwMjExICovCisgICAgICAgICAgICAgICAgICAgICAgICAgY2ZnODAyMTFfY29ubmVjdF9yZXN1bHQoZGV2LCBwUm9hbUluZm8tPmJzc2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcVJzbkllLCByZXFSc25MZW5ndGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnNwUnNuSWUsIHJzcFJzbkxlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOX1NUQVRVU19TVUNDRVNTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdGUF9LRVJORUwpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKCAhaGRkRGlzY29uSW5Qcm9ncmVzcyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2ZnODAyMTFfcHV0X2JzcygKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsOSwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPndpcGh5LAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJzcyk7CisgICAgICAgICAgICAgICAgLy8gUmVnaXN0ZXIgdGhlIFN0YXRpb24gd2l0aCBUTCBhZnRlciBhc3NvY2lhdGVkLi4uCisgICAgICAgICAgICAgICAgdm9zU3RhdHVzID0gaGRkX3JvYW1SZWdpc3RlclNUQSggcEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mbywKKyAgICAgICAgICAgICAgICAgICAgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLnN0YUlkWyAwIF0sCisgICAgICAgICAgICAgICAgICAgIE5VTEwsCisgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+cEJzc0Rlc2MgKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIHdwYSBzdXBwbGljYW50IGV4cGVjdGluZyBXUEEvUlNOIElFIGluIGNvbm5lY3QgcmVzdWx0ICovCisgICAgICAgICAgICAvKiAgaW4gY2FzZSBvZiByZWFzc29jaWF0aW9uIGFsc28gbmVlZCB0byBpbmRpY2F0ZSBpdCB0byBzdXBwbGljYW50ICovCisgICAgICAgICAgICBjc3JSb2FtR2V0V3BhUnNuUmVxSUUoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLAorICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAmcmVxUnNuTGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICByZXFSc25JZSk7CisKKyAgICAgICAgICAgIGhkZF9TZW5kUmVBc3NvY0V2ZW50KGRldiwgcEFkYXB0ZXIsIHBSb2FtSW5mbywgcmVxUnNuSWUsIHJlcVJzbkxlbmd0aCk7CisgICAgICAgICAgICAvL1JlYXNzb2Mgc3VjY2Vzc2Z1bGx5CisgICAgICAgICAgICBpZiggcFJvYW1JbmZvLT5mQXV0aFJlcXVpcmVkICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NTdGF0dXMgPSBXTEFOVExfQ2hhbmdlU1RBU3RhdGUoIHBIZGRDdHgtPnB2b3NDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLnN0YUlkWyAwIF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfU1RBX0NPTk5FQ1RFRCApOworICAgICAgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby51SXNBdXRoZW50aWNhdGVkID0gVk9TX0ZBTFNFOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogc3RhSWQ6ICVkIENoYW5naW5nIFRMIHN0YXRlIHRvIEFVVEhFTlRJQ0FURUQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLnN0YUlkWyAwIF0gKTsKKyAgICAgICAgICAgICAgICB2b3NTdGF0dXMgPSBXTEFOVExfQ2hhbmdlU1RBU3RhdGUoIHBIZGRDdHgtPnB2b3NDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLnN0YUlkWyAwIF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfU1RBX0FVVEhFTlRJQ0FURUQgKTsKKyAgICAgICAgICAgICAgICBwSGRkU3RhQ3R4LT5jb25uX2luZm8udUlzQXV0aGVudGljYXRlZCA9IFZPU19UUlVFOworICAgICAgICAgICAgICAgIGhkZF9wb3N0VExQYWNrZXRQZW5kaW5nSW5kKHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5zdGFJZFswXSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoIFZPU19JU19TVEFUVVNfU1VDQ0VTUyggdm9zU3RhdHVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICAvLyBwZXJmb3JtIGFueSBXTU0tcmVsYXRlZCBhc3NvY2lhdGlvbiBwcm9jZXNzaW5nCisgICAgICAgICAgICBoZGRfd21tX2Fzc29jKHBBZGFwdGVyLCBwUm9hbUluZm8sIGVDU1JfQlNTX1RZUEVfSU5GUkFTVFJVQ1RVUkUpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICAgICJDYW5ub3QgcmVnaXN0ZXIgU1RBIHdpdGggVEwuICBGYWlsZWQgd2l0aCB2b3NTdGF0dXMgPSAlZCBbJTA4WF0iLAorICAgICAgICAgICAgICAgICAgICB2b3NTdGF0dXMsIHZvc1N0YXR1cyApOworICAgICAgICB9CisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgICAgICB2b3NfbWVtX3plcm8oICZwQWRhcHRlci0+aGRkX3N0YXRzLmhkZFBtZlN0YXRzLAorICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihwQWRhcHRlci0+aGRkX3N0YXRzLmhkZFBtZlN0YXRzKSApOworI2VuZGlmCisKKyAgICAgICAgLy8gU3RhcnQgdGhlIFF1ZXVlCisgICAgICAgIGlmICggIWhkZERpc2NvbkluUHJvZ3Jlc3MgKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sIEZMKCJFbmFibGluZyBxdWV1ZXMiKSk7CisgICAgICAgICAgICBuZXRpZl90eF93YWtlX2FsbF9xdWV1ZXMoZGV2KTsKKyAgICAgICAgfQorICAgICAgICBpZiAocEhkZEN0eC0+Y2ZnX2luaS0+Z0VuYWJsZVJvYW1EZWxheVN0YXRzKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfcmVjb3JkX3JvYW1fZXZlbnQoZV9IRERfRU5BQkxFX1RYX1FVRVVFLCBOVUxMLCAwKTsKKyAgICAgICAgfQorI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgICAgICAgIHdsYW5faGRkX3RkbHNfY29ubmVjdGlvbl9jYWxsYmFjayhwQWRhcHRlcik7CisjZW5kaWYKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgaGRkX2NvbnRleHRfdCogcEhkZEN0eCA9IChoZGRfY29udGV4dF90KilwQWRhcHRlci0+cEhkZEN0eDsKKworICAgICAgICBoZGRfd2V4dF9zdGF0ZV90ICpwV2V4dFN0YXRlID0gV0xBTl9IRERfR0VUX1dFWFRfU1RBVEVfUFRSKHBBZGFwdGVyKTsKKyAgICAgICAgaWYgKHBSb2FtSW5mbykKKyAgICAgICAgICAgIHByX2luZm8oIndsYW46IGNvbm5lY3Rpb24gZmFpbGVkIHdpdGggIiBNQUNfQUREUkVTU19TVFIKKyAgICAgICAgICAgICAgICAgICAgIiByZXN1bHQ6JWQgYW5kIFN0YXR1czolZCIsCisgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBSb2FtSW5mby0+YnNzaWQpLAorICAgICAgICAgICAgICAgICAgICByb2FtUmVzdWx0LCByb2FtU3RhdHVzKTsKKyAgICAgICAgZWxzZQorICAgICAgICAgICAgcHJfaW5mbygid2xhbjogY29ubmVjdGlvbiBmYWlsZWQgd2l0aCAiIE1BQ19BRERSRVNTX1NUUgorICAgICAgICAgICAgICAgICAgICAiIHJlc3VsdDolZCBhbmQgU3RhdHVzOiVkIiwKKyAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocFdleHRTdGF0ZS0+cmVxX2Jzc0lkKSwKKyAgICAgICAgICAgICAgICAgICAgcm9hbVJlc3VsdCwgcm9hbVN0YXR1cyk7CisKKyAgICAgICAgaWYgKCggZUNTUl9ST0FNX0FTU09DSUFUSU9OX0ZBSUxVUkUgPT0gcm9hbVN0YXR1cykgfHwKKyAgICAgICAgICAgICgocm9hbVJlc3VsdCAhPSBlQ1NSX1JPQU1fUkVTVUxUX0FTU09DSUFURUQpICYmCisgICAgICAgICAgICAgKGVDU1JfUk9BTV9BU1NPQ0lBVElPTl9DT01QTEVUSU9OID09IHJvYW1TdGF0dXMpKSkKKyAgICAgICAgICAgIHdsYW5faGRkX2dldF9mcmFtZV9sb2dzKHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOX0hERF9HRVRfRlJBTUVfTE9HX0NNRF9TRU5EX0FORF9DTEVBUik7CisKKyAgICAgICAgLyogU2V0IGNvbm5lY3Rpb24gc3RhdGUgdG8gZUNvbm5lY3Rpb25TdGF0ZV9Ob3RDb25uZWN0ZWQgb25seSB3aGVuIENTUgorICAgICAgICAgKiBoYXMgY29tcGxldGVkIG9wZXJhdGlvbiAtIHdpdGggYSBBU1NPQ0lBVElPTl9GQUlMVVJFIHN0YXR1cworICAgICAgICAgKi8KKyAgICAgICAgaWYgKCBlQ1NSX1JPQU1fQVNTT0NJQVRJT05fRkFJTFVSRSA9PSByb2FtU3RhdHVzICYmICAhaGRkRGlzY29uSW5Qcm9ncmVzcyApCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICIlczogU2V0IEhERCBjb25uU3RhdGUgdG8gZUNvbm5lY3Rpb25TdGF0ZV9Ob3RDb25uZWN0ZWQiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgICAgIGhkZF9jb25uU2V0Q29ubmVjdGlvblN0YXRlKCBwSGRkU3RhQ3R4LCBlQ29ubmVjdGlvblN0YXRlX05vdENvbm5lY3RlZCk7CisgICAgICAgIH0KKyAgICAgICAgaWYoKHBIZGRDdHgtPmNvbmN1cnJlbmN5X21vZGUgPD0gMSkgJiYKKyAgICAgICAgICAgKHBIZGRDdHgtPm5vX29mX29wZW5fc2Vzc2lvbnNbV0xBTl9IRERfSU5GUkFfU1RBVElPTl0gPD0xKSkKKyAgICAgICAgeworICAgICAgICAgICAgcEhkZEN0eC0+aXNBbXBBbGxvd2VkID0gVk9TX1RSVUU7CisgICAgICAgIH0KKworICAgICAgICAvL0lmIHRoZSBEZXZpY2UgTW9kZSBpcyBTdGF0aW9uCisgICAgICAgIC8vIGFuZCB0aGUgUDJQIENsaWVudCBpcyBDb25uZWN0ZWQKKyAgICAgICAgLy9FbmFibGUgQk1QUworCisgICAgICAgIC8vIEluIGNhc2Ugb2YgSkIsIGFzIENoYW5nZS1JZmFjZSBtYXkgb3IgbWF5bm90IGJlIGNhbGxlZCBmb3IgcDJwMAorICAgICAgICAvLyBFbmFibGUgQk1QUy9JTVBTIGluIGNhc2UgUDJQX0NMSUVOVCBkaXNjb25uZWN0ZWQKKyAgICAgICAgaWYoKChXTEFOX0hERF9JTkZSQV9TVEFUSU9OID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkgfHwKKyAgICAgICAgICAgIChXTEFOX0hERF9QMlBfQ0xJRU5UID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkpICYmCisgICAgICAgICAgICAodm9zX2NvbmN1cnJlbnRfb3Blbl9zZXNzaW9uc19ydW5uaW5nKCkpKQorICAgICAgICB7CisgICAgICAgICAgIC8vRW5hYmxlIEJNUFMgb25seSBvZiBvdGhlciBTZXNzaW9uIGlzIFAyUCBDbGllbnQKKyAgICAgICAgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IE5VTEw7CisgICAgICAgICAgIHZfQ09OVEVYVF90IHBWb3NDb250ZXh0ID0gdm9zX2dldF9nbG9iYWxfY29udGV4dCggVk9TX01PRFVMRV9JRF9IREQsIE5VTEwgKTsKKworICAgICAgICAgICBpZiAoTlVMTCAhPSBwVm9zQ29udGV4dCkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgcEhkZEN0eCA9IHZvc19nZXRfY29udGV4dCggVk9TX01PRFVMRV9JRF9IREQsIHBWb3NDb250ZXh0KTsKKworICAgICAgICAgICAgICAgaWYoTlVMTCAhPSBwSGRkQ3R4KQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvL09ubHkgUDJQIENsaWVudCBpcyB0aGVyZSBFbmFibGUgQm1wcyBiYWNrCisgICAgICAgICAgICAgICAgICAgIGlmKCgwID09IHBIZGRDdHgtPm5vX29mX29wZW5fc2Vzc2lvbnNbVk9TX1NUQV9TQVBfTU9ERV0pICYmCisgICAgICAgICAgICAgICAgICAgICAgICgwID09IHBIZGRDdHgtPm5vX29mX29wZW5fc2Vzc2lvbnNbVk9TX1AyUF9HT19NT0RFXSkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocEhkZEN0eC0+aGRkX3dsYW5fc3VzcGVuZGVkKQorICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGRkX3NldF9wd3JwYXJhbXMocEhkZEN0eCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgIGhkZF9lbmFibGVfYm1wc19pbXBzKHBIZGRDdHgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8qIENSNDY1NDc4OiBPbmx5IHNlbmQgdXAgYSBjb25uZWN0aW9uIGZhaWx1cmUgcmVzdWx0IHdoZW4gQ1NSIGhhcworICAgICAgICAgKiBjb21wbGV0ZWQgb3BlcmF0aW9uIC0gd2l0aCBhIEFTU09DSUFUSU9OX0ZBSUxVUkUgc3RhdHVzLiovCisgICAgICAgIGlmICggZUNTUl9ST0FNX0FTU09DSUFUSU9OX0ZBSUxVUkUgPT0gcm9hbVN0YXR1cyAmJiAgIWhkZERpc2NvbkluUHJvZ3Jlc3MgKQorICAgICAgICB7CisKKyAgICAgICAgICAgIGlmIChwQWRhcHRlci0+ZGV2aWNlX21vZGUgPT0gV0xBTl9IRERfUDJQX0NMSUVOVCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coTE9HMSwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIkFzc29pY2F0aW9uIEZhaWx1cmUgZm9yIFAyUCBjbGllbnQgYW5kIHdlIGFyZSB0cnlpbmcgdG8gcmUtZW5hYmxlIFRETFMiKSk7CisgICAgICAgICAgICAgICAgd2xhbl9oZGRfdGRsc19yZWVuYWJsZShwSGRkQ3R4KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHBSb2FtSW5mbykKKyAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgIiVzOiBzZW5kIGNvbm5lY3QgZmFpbHVyZSB0byBubDgwMjExOiIKKyAgICAgICAgICAgICAgICAgICAgICIgZm9yIGJzc2lkICIgTUFDX0FERFJFU1NfU1RSCisgICAgICAgICAgICAgICAgICAgICAiIHJlc3VsdDolZCBhbmQgU3RhdHVzOiVkIHJlYXNvbkNvZGUgJWQiICwKKyAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBNQUNfQUREUl9BUlJBWShwUm9hbUluZm8tPmJzc2lkKSwKKyAgICAgICAgICAgICAgICAgICAgIHJvYW1SZXN1bHQsIHJvYW1TdGF0dXMsIHBSb2FtSW5mby0+cmVhc29uQ29kZSk7CisgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgIiVzOiBjb25uZWN0IGZhaWxlZDoiCisgICAgICAgICAgICAgICAgICAgICAiIGZvciBic3NpZCAiIE1BQ19BRERSRVNTX1NUUgorICAgICAgICAgICAgICAgICAgICAgIiByZXN1bHQ6JWQgYW5kIFN0YXR1czolZCIgLAorICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIE1BQ19BRERSX0FSUkFZKHBXZXh0U3RhdGUtPnJlcV9ic3NJZCksCisgICAgICAgICAgICAgICAgICAgICByb2FtUmVzdWx0LCByb2FtU3RhdHVzKTsKKworICAgICAgICAgICAgLyogaW5mb3JtIGFzc29jaWF0aW9uIGZhaWx1cmUgZXZlbnQgdG8gbmw4MDIxMSAqLworICAgICAgICAgICAgaWYgKCBlQ1NSX1JPQU1fUkVTVUxUX0FTU09DX0ZBSUxfQ09OX0NIQU5ORUwgPT0gcm9hbVJlc3VsdCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBpZiAocFJvYW1JbmZvKQorICAgICAgICAgICAgICAgICAgIGNmZzgwMjExX2Nvbm5lY3RfcmVzdWx0ICggZGV2LCBwUm9hbUluZm8tPmJzc2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwgMCwgTlVMTCwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5fU1RBVFVTX0FTU09DX0RFTklFRF9VTlNQRUMsCisgICAgICAgICAgICAgICAgICAgICAgICBHRlBfS0VSTkVMICk7CisgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgY2ZnODAyMTFfY29ubmVjdF9yZXN1bHQgKCBkZXYsIHBXZXh0U3RhdGUtPnJlcV9ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsIDAsIE5VTEwsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICBXTEFOX1NUQVRVU19BU1NPQ19ERU5JRURfVU5TUEVDLAorICAgICAgICAgICAgICAgICAgICAgICAgR0ZQX0tFUk5FTCApOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHJlYXNvbl9jb2RlID0gV0xBTl9TVEFUVVNfVU5TUEVDSUZJRURfRkFJTFVSRTsKKworICAgICAgICAgICAgICAgIGlmIChwUm9hbUluZm8gJiYgcFJvYW1JbmZvLT5yZWFzb25Db2RlKQorICAgICAgICAgICAgICAgICAgICByZWFzb25fY29kZSA9ICh0QU5JX1UxNilwUm9hbUluZm8tPnJlYXNvbkNvZGU7CisKKyAgICAgICAgICAgICAgICBjZmc4MDIxMV9jb25uZWN0X3Jlc3VsdChkZXYsIHBXZXh0U3RhdGUtPnJlcV9ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgTlVMTCwgMCwgTlVMTCwgMCwgcmVhc29uX2NvZGUsIEdGUF9LRVJORUwpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLypDbGVhciB0aGUgcm9hbSBwcm9maWxlKi8KKyAgICAgICAgICAgIGhkZF9jbGVhclJvYW1Qcm9maWxlSWUoIHBBZGFwdGVyICk7CisgICAgICAgIH0KKworICAgICAgICBoZGRfd21tX2luaXQoIHBBZGFwdGVyICk7CisKKyAgICAgICAgaWYgKHBSb2FtSW5mbykKKyAgICAgICAgeworICAgICAgICAgICAgV0xBTlRMX0Fzc29jRmFpbGVkKHBSb2FtSW5mby0+c3RhSWQpOworICAgICAgICB9CisKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCBGTCgiRGlzYWJsaW5nIHF1ZXVlcyIpKTsKKyAgICAgICAgbmV0aWZfdHhfZGlzYWJsZShkZXYpOworICAgICAgICBuZXRpZl9jYXJyaWVyX29mZihkZXYpOworCisgICAgfQorCisgICAgaWYgKGVDU1JfUk9BTV9SRVNVTFRfQVNTT0NJQVRFRCA9PSByb2FtUmVzdWx0KQorICAgIHsKKyAgICAgICAgcEhvc3RhcGRBZGFwdGVyID0gaGRkX2dldF9hZGFwdGVyKHBIZGRDdHgsIFdMQU5fSEREX1NPRlRBUCk7CisgICAgICAgIGlmIChwSG9zdGFwZEFkYXB0ZXIgIT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgICAgIC8qIFJlc3RhcnQgU0FQIGlmIGl0cyBvcGVyYXRpbmcgY2hhbm5lbCBpcyBkaWZmZXJlbnQKKyAgICAgICAgICAgICAgKiBmcm9tIEFQIGNoYW5uZWwuCisgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgaWYgKHBIb3N0YXBkQWRhcHRlci0+c2Vzc2lvbkN0eC5hcC5vcGVyYXRpbmdDaGFubmVsICE9CisgICAgICAgICAgICAgICAgKGludClwUm9hbUluZm8tPnBCc3NEZXNjLT5jaGFubmVsSWQpCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywiUmVzdGFydCBTYXAgYXMgU0FQIGNoYW5uZWwgaXMgJWQgIgorICAgICAgICAgICAgICAgICAgICAgICAiYW5kIFNUQSBjaGFubmVsIGlzICVkIiwgcEhvc3RhcGRBZGFwdGVyLT5zZXNzaW9uQ3R4LmFwLm9wZXJhdGluZ0NoYW5uZWwsCisgICAgICAgICAgICAgICAgICAgICAgIChpbnQpcFJvYW1JbmZvLT5wQnNzRGVzYy0+Y2hhbm5lbElkKTsKKyAgICAgICAgICAgICAgICBoZGRfaG9zdGFwZF9zdG9wKHBIb3N0YXBkQWRhcHRlci0+ZGV2KTsKKyAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIGVIQUxfU1RBVFVTX1NVQ0NFU1M7Cit9CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqCisgIEBicmllZiBoZGRfUm9hbUlic3NJbmRpY2F0aW9uSGFuZGxlcigpIC0gSGVyZSB3ZSB1cGRhdGUgdGhlIHN0YXR1cyBvZiB0aGUKKyAgSWJzcyB3aGVuIHdlIHJlY2VpdmUgaW5mb3JtYXRpb24gdGhhdCB3ZSBoYXZlIHN0YXJ0ZWQvam9pbmVkIGFuIGlic3Mgc2Vzc2lvbgorCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitzdGF0aWMgdm9pZCBoZGRfUm9hbUlic3NJbmRpY2F0aW9uSGFuZGxlciggaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdENzclJvYW1JbmZvICpwUm9hbUluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgcm9hbUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVSb2FtQ21kU3RhdHVzIHJvYW1TdGF0dXMsCisgICAgICAgICAgICAgICAgICAgICAg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G5lZWQgdG8gbW92ZQorICAgICAgICAgICogY29ubmVjdGlvbiBzdGF0ZSB0byBJQlNTIERpc2Nvbm5lY3RlZCAobWVhbmluZyBubyBwZWVycworICAgICAgICAgICogYXJlIGluIHRoZSBJQlNTKS4KKyAgICAgICAgICAqLworICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgIiVzOiBTZXQgSEREIGNvbm5TdGF0ZSB0byBlQ29ubmVjdGlvblN0YXRlX0lic3NEaXNjb25uZWN0ZWQiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgIGhkZF9jb25uU2V0Q29ubmVjdGlvblN0YXRlKCBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ29ubmVjdGlvblN0YXRlX0lic3NEaXNjb25uZWN0ZWQgKTsKKyAgICAgICAgIC8qbm90aWZ5IHdtbSAqLworICAgICAgICAgaGRkX3dtbV9jb25uZWN0KHBBZGFwdGVyLCBwUm9hbUluZm8sIGVDU1JfQlNTX1RZUEVfSUJTUyk7CisgICAgICAgICBwSGRkQ3R4LT5zdGFfdG9fYWRhcHRlcltJQlNTX0JST0FEQ0FTVF9TVEFJRF0gPSBwQWRhcHRlcjsKKworICAgICAgICAgaWYgKHBSb2FtSW5mby0+cEJzc0Rlc2MpCisgICAgICAgICB7CisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE1LDApKQorICAgICAgICAgICAgIHN0cnVjdCBpZWVlODAyMTFfY2hhbm5lbCAqY2hhbjsKKyAgICAgICAgICAgICBpbnQgY2hhbl9ubzsKKyAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgZnJlcTsKKyNlbmRpZgorICAgICAgICAgICAgIGhkZF9pYnNzX1JlZ2lzdGVyU1RBIChwQWRhcHRlciwgcFJvYW1JbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICBJQlNTX0JST0FEQ0FTVF9TVEFJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJmJyb2FkY2FzdE1hY0FkZHIsIHBSb2FtSW5mby0+cEJzc0Rlc2MpOworCisgICAgICAgICAgICAvKiB3ZSBjcmVhdGVkIHRoZSBJQlNTLCBub3RpZnkgc3VwcGxpY2FudCAqLworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXM6ICVzOiBjcmVhdGVkIGlic3MgIgorICAgICAgICAgICAgICAgICAgIE1BQ19BRERSRVNTX1NUUiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcEFkYXB0ZXItPmRldi0+bmFtZSwKKyAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwUm9hbUluZm8tPnBCc3NEZXNjLT5ic3NJZCkpOworCisgICAgICAgICAgICAvKiB3ZSBtdXN0IGZpcnN0IGdpdmUgY2ZnODAyMTEgdGhlIEJTUyBpbmZvcm1hdGlvbiAqLworICAgICAgICAgICAgYnNzID0gd2xhbl9oZGRfY2ZnODAyMTFfdXBkYXRlX2Jzc19kYihwQWRhcHRlciwgcFJvYW1JbmZvKTsKKyAgICAgICAgICAgIGlmIChOVUxMID09IGJzcykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlczogdW5hYmxlIHRvIGNyZWF0ZSBJQlNTIGVudHJ5IiwKKyAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcEFkYXB0ZXItPmRldi0+bmFtZSk7CisgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE1LDApKQorICAgICAgICAgICAgY2hhbl9ubyA9IHBSb2FtSW5mby0+cEJzc0Rlc2MtPmNoYW5uZWxJZDsKKworICAgICAgICAgICAgaWYgKGNoYW5fbm8gPD0gMTQpCisgICAgICAgICAgICAgICAgZnJlcSA9IGllZWU4MDIxMV9jaGFubmVsX3RvX2ZyZXF1ZW5jeShjaGFuX25vLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSUVFRTgwMjExX0JBTkRfMkdIWik7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgZnJlcSA9IGllZWU4MDIxMV9jaGFubmVsX3RvX2ZyZXF1ZW5jeShjaGFuX25vLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSUVFRTgwMjExX0JBTkRfNUdIWik7CisKKyAgICAgICAgICAgIGNoYW4gPSBpZWVlODAyMTFfZ2V0X2NoYW5uZWwocEFkYXB0ZXItPndkZXYud2lwaHksIGZyZXEpOworCisgICAgICAgICAgICBpZiAoY2hhbikKKyAgICAgICAgICAgICAgICBjZmc4MDIxMV9pYnNzX2pvaW5lZChwQWRhcHRlci0+ZGV2LCBic3MtPmJzc2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW4sIEdGUF9LRVJORUwpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCBGTCgiJXM6IGNoYW5JZDogJWQsIGNhbid0IGZpbmQgY2hhbm5lbCIpLAorICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+ZGV2LT5uYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAoaW50KXBSb2FtSW5mby0+cEJzc0Rlc2MtPmNoYW5uZWxJZCk7CisjZWxzZQorICAgICAgICAgICAgY2ZnODAyMTFfaWJzc19qb2luZWQocEFkYXB0ZXItPmRldiwgYnNzLT5ic3NpZCwgR0ZQX0tFUk5FTCk7CisjZW5kaWYKKyAgICAgICAgICAgIGNmZzgwMjExX3B1dF9ic3MoCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDksMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPndpcGh5LAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJzcyk7CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IE5VTEwgQnNzIERlc2MiLF9fZnVuY19fKTsKKyAgICAgICAgIH0KKworICAgICAgICAgLyogU2V0IEJyb2FkY2FzdCBrZXkgYWdhaW4gaW4gY2FzZSBJQlNTX0NPQUxFU0NFRCBhcyBERUwgQlNTLAorICAgICAgICAgICogaW4gSUJTU19DT0FMRVNDRUQgd2lsbCByZW1vdmUgdGhlIEJDIGtleS4KKyAgICAgICAgICAqLworICAgICAgICAgaWYgKChlQ1NSX1JPQU1fUkVTVUxUX0lCU1NfQ09BTEVTQ0VEID09IHJvYW1SZXN1bHQpICYmCisgICAgICAgICAgICAgKCBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVA0MF9TVEFUSUNLRVkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSBwSGRkU3RhQ3R4LT5pYnNzX2VuY19rZXkuZW5jVHlwZQorICAgICAgICAgICAgICAgfHxlQ1NSX0VOQ1JZUFRfVFlQRV9XRVAxMDRfU1RBVElDS0VZCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gcEhkZFN0YUN0eC0+aWJzc19lbmNfa2V5LmVuY1R5cGUKKyAgICAgICAgICAgICAgIHx8ZUNTUl9FTkNSWVBUX1RZUEVfVEtJUCA9PSBwSGRkU3RhQ3R4LT5pYnNzX2VuY19rZXkuZW5jVHlwZQorICAgICAgICAgICAgICAgfHxlQ1NSX0VOQ1JZUFRfVFlQRV9BRVMgPT0gcEhkZFN0YUN0eC0+aWJzc19lbmNfa2V5LmVuY1R5cGUgKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgICB1OCBncnBtYWNhZGRyW1dOSV9DRkdfQlNTSURfTEVOXSA9IHsweEZGLDB4RkYsMHhGRiwweEZGLDB4RkYsMHhGRn07CisgICAgICAgICAgICAgVk9TX1NUQVRVUyB2b3NTdGF0dXM7CisKKyAgICAgICAgICAgICBwSGRkU3RhQ3R4LT5pYnNzX2VuY19rZXkua2V5RGlyZWN0aW9uID0gZVNJUl9UWF9SWDsKKworICAgICAgICAgICAgIG1lbWNweSgmcEhkZFN0YUN0eC0+aWJzc19lbmNfa2V5LnBlZXJNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JwbWFjYWRkciwgV05JX0NGR19CU1NJRF9MRU4pOworICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIiBTRVQgR1RLIGluIGNhc2Ugb2YgQ09BTEVTQ0VEIikpOworICAgICAgICAgICAgIHZvc1N0YXR1cyA9IHNtZV9Sb2FtU2V0S2V5KCBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwgJnBIZGRTdGFDdHgtPmlic3NfZW5jX2tleSwgJnJvYW1JZCApOworICAgICAgICAgICAgIGlmICggVk9TX1NUQVRVU19TVUNDRVNTICE9IHZvc1N0YXR1cyApCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJzbWVfUm9hbVNldEtleSBmYWlsZWQsIHJldHVybmVkICVkIiksdm9zU3RhdHVzKTsKKyAgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKworICAgICAgY2FzZSBlQ1NSX1JPQU1fUkVTVUxUX0lCU1NfU1RBUlRfRkFJTEVEOgorICAgICAgeworICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiAlczogdW5hYmxlIHRvIGNyZWF0ZSBJQlNTIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcEFkYXB0ZXItPmRldi0+bmFtZSk7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKworICAgICAgZGVmYXVsdDoKKyAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogJXM6IHVuZXhwZWN0ZWQgcmVzdWx0ICVkIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcEFkYXB0ZXItPmRldi0+bmFtZSwgKGludClyb2FtUmVzdWx0KTsKKyAgICAgICAgIGJyZWFrOworICAgfQorCisgICByZXR1cm47Cit9CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqCisgIEBicmllZiByb2FtU2F2ZUlic3NTdGF0aW9uKCkgLSBTYXZlIHRoZSBJQlNTIHBlZXIgTUFDIGFkZHJlc3MgaW4gdGhlIGFkYXB0ZXIuCisgIFRoaXMgaW5mb3JtYXRpb24gaXMgcGFzc2VkIHRvIGl3Y29uZmlnIGxhdGVyLiBUaGUgcGVlciB0aGF0IGpvaW5lZAorICBsYXN0IGlzIHBhc3NlZCBhcyBpbmZvcm1hdGlvbiB0byBpd2NvbmZpZy4KKyAgSWYgd2UgYWRkIEhERF9NQVhfTlVNX0lCU1NfU1RBIG9yIGxlc3MgU1RBIHdlIHJldHVybiBzdWNjZXNzIG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ICAgICAgICAgICAgICAgICBGTCgiTm90IGFibGUgdG8gYWRkIHN0YWlkIGhhc2ggJWQiKSwgc3RhSWQpOworICAgICAgIHJldHVybiBGQUxTRTsKKyAgIH0KKworICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgIEZMKCJOZXcgc3RhdGlvbiBhZGRlZCBzdGFfaWQgJWQgbWFjOiIKKyAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIpLCBzdGFJZCwKKyAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwZWVyTWFjQWRkcmVzcy0+Ynl0ZXMpKTsKKworICAgcmV0dXJuKCBmU3VjY2VzcyApOworfQorLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAgQGJyaWVmIHJvYW1SZW1vdmVJYnNzU3RhdGlvbigpIC0gUmVtb3ZlIHRoZSBJQlNTIHBlZXIgTUFDIGFkZHJlc3MgaW4gdGhlIGFkYXB0ZXIuCisgIElmIHdlIHJlbW92ZSBIRERfTUFYX05VTV9JQlNTX1NUQSBvciBsZXNzIFNUQSB3ZSByZXR1cm4gc3VjY2VzcyBlbHNlIHdlCisgIHJldHVybiBGQUxTRS4KKworICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworc3RhdGljIGludCByb2FtUmVtb3ZlSWJzc1N0YXRpb24oIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLCB2X1U4X3Qgc3RhSWQgKQoreworICAgaW50IGZTdWNjZXNzID0gRkFMU0U7CisgICBpbnQgaWR4ID0gMDsKKyAgIHZfVThfdCAgdmFsaWRfaWR4ICAgPSAwOworICAgdl9VOF90ICBkZWxfaWR4ICAgPSAwOworICAgdl9VOF90ICBlbXB0eV9zbG90cyA9IDA7CisgICBoZGRfc3RhdG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gICAgICAgICAgIHZvc196ZXJvX21hY2FkZHIoICZwSGRkU3RhQ3R4LT5jb25uX2luZm8ucGVlck1hY0FkZHJlc3NbIGlkeCBdICk7CisKKyAgICAgICAgICAgICBmU3VjY2VzcyA9IFRSVUU7CisgICAgICAgICAgICAgLy8gTm90ZSB0aGUgZGVsZXRlZCBJbmRleCwgaWYgaXRzIDAgd2UgbmVlZCBzcGVjaWFsIGhhbmRsaW5nCisgICAgICAgICAgICAgZGVsX2lkeCA9IGlkeDsKKyAgICAgICAgICAgICBlbXB0eV9zbG90cysrOworICAgICAgICAgfQorICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgaWYgKHBIZGRTdGFDdHgtPmNvbm5faW5mby5zdGFJZFtpZHhdICE9IDApCisgICAgICAgICB7CisgICAgICAgICAgICB2YWxpZF9pZHggPSBpZHg7CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICAvLyBGb3VuZCBhbiBlbXB0eSBzbG90CisgICAgICAgICAgICBlbXB0eV9zbG90cysrOworICAgICAgICAgfQorICAgICAgfQorICAgfQorCisgICBpZiAoSEREX01BWF9OVU1fSUJTU19TVEEgPT0gZW1wdHlfc2xvdHMpCisgICB7CisgICAgICAvLyBMYXN0IHBlZXIgZGVwYXJ0ZWQsIHNldCB0aGUgSUJTUyBzdGF0ZSBhcHByb3ByaWF0ZWx5CisgICAgICBwSGRkU3RhQ3R4LT5jb25uX2luZm8uY29ublN0YXRlID0gZUNvbm5lY3Rpb25TdGF0ZV9JYnNzRGlzY29ubmVjdGVkOworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiTGFzdCBJQlNTIFBlZXIgRGVwYXJ0ZWQhISEiICk7CisgICB9CisKKyAgIC8vIEZpbmQgbmV4dCBhY3RpdmUgc3RhSWQsIHRvIGhhdmUgYSB2YWxpZCBzdGEgdHJpZ2dlciBmb3IgVEwuCisgICBpZiAoZlN1Y2Nlc3MgPT0gVFJVRSkKKyAgIHsKKyAgICAgIGlmIChkZWxfaWR4ID09IDApCisgICAgICB7CisgICAgICAgICBpZiAocEhkZFN0YUN0eC0+Y29ubl9pbmZvLnN0YUlkW3ZhbGlkX2lkeF0gIT0gMCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5zdGFJZFswXSA9IHBIZGRTdGFDdHgtPmNvbm5faW5mby5zdGFJZFt2YWxpZF9pZHhdOworICAgICAgICAgICAgdm9zX2NvcHlfbWFjYWRkciggJnBIZGRTdGFDdHgtPmNvbm5faW5mby5wZWVyTWFjQWRkcmVzc1sgMCBdLAorICAgICAgICAgICAgICAgJnBIZGRTdGFDdHgtPmNvbm5faW5mby5wZWVyTWFjQWRkcmVzc1sgdmFsaWRfaWR4IF0pOworCisgICAgICAgICAgICBwSGRkU3RhQ3R4LT5jb25uX2luZm8uc3RhSWRbdmFsaWRfaWR4XSA9IDA7CisgICAgICAgICAgICB2b3NfemVyb19tYWNhZGRyKCAmcEhkZFN0YUN0eC0+Y29ubl9pbmZvLnBlZXJNYWNBZGRyZXNzWyB2YWxpZF9pZHggXSApOworICAgICAgICAgfQorICAgICAgfQorICAgfQorICAgcmV0dXJuKCBmU3VjY2VzcyApOworfQorCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKgorICBAYnJpZWYgcm9hbUlic3NDb25uZWN0SGFuZGxlcigpIDogV2UgdXBkYXRlIHRoZSBzdGF0dXMgb2YgdGhlIElCU1MgdG8KKyAgY29ubmVjdGVkIGluIHRoaXMgZnVuY3Rpb24uCisKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3N0YXRpYyB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MgPSB3bGFuX2hkZF9jZmc4MDIxMV91cGRhdGVfYnNzX2RiKHBBZGFwdGVyLCBwUm9hbUluZm8pOworICAgaWYgKE5VTEwgPT0gYnNzKQorICAgeworICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAiJXM6ICVzOiB1bmFibGUgdG8gY3JlYXRlIElCU1MgZW50cnkiLAorICAgICAgICAgICAgIF9fZnVuY19fLCBwQWRhcHRlci0+ZGV2LT5uYW1lKTsKKyAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgfQorICAgY2ZnODAyMTFfcHV0X2JzcygKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsOSwwKSkKKyAgICAgICAgICAgICAgICAgICAgV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlciktPndpcGh5LAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgIGJzcyk7CisKKyAgIHJldHVybiggZUhBTF9TVEFUVVNfU1VDQ0VTUyApOworfQorLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAgQGJyaWVmIGhkZF9SZUNvbmZpZ1N1c3BlbmREYXRhQ2xlYXJlZER1cmluZ1JvYW1pbmcoKSAtIFJlY29uZmlndXJlIHRoZQorICBzdXNwZW5kIHJlbGF0ZWQgZGF0YSB3aGljaCB3YXMgY2xlYXJlZCBkdXJpbmcgcm9hbWluZyBpbiBGV1IuCisKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3N0YXRpYyB2b2lkIGhkZF9SZUNvbmZpZ1N1c3BlbmREYXRhQ2xlYXJlZER1cmluZ1JvYW1pbmcoaGRkX2NvbnRleHRfdCAqcEhkZEN0eCkKK3sKKyAg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ICAgICAgLy9Db25maWd1cmUgQVJQT0ZGTE9BRAorICAgICAgICAgICAgICAgIHZzdGF0dXMgPSBoZGRfY29uZl9hcnBfb2ZmbG9hZChwQWRhcHRlciwgVFJVRSk7CisgICAgICAgICAgICAgICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1ModnN0YXR1cykpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkZhaWxlZCB0byBkaXNhYmxlIEFSUE9mZmxvYWQgRmVhdHVyZSAlZCIpLCB2c3RhdHVzKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisjaWZkZWYgV0xBTl9OU19PRkZMT0FECisgICAgICAgICAgICAvL0NvbmZpZ3VyZSBOU09GRkxPQUQKKyAgICAgICAgICAgIGlmIChwSGRkQ3R4LT5jZmdfaW5pLT5maG9zdE5TT2ZmbG9hZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRfY29uZl9uc19vZmZsb2FkKHBBZGFwdGVyLCBUUlVFKTsKKyAgICAgICAgICAgIH0KKyNlbmRpZgorI2lmZGVmIFdMQU5fRkVBVFVSRV9QQUNLRVRfRklMVEVSSU5HCisgICAgICAgICAgICAvKiBEdXJpbmcgc3VzcGVuZCwgY29uZmlndXJlIE1DIEFkZHIgbGlzdCBmaWx0ZXIgdG8gdGhlIGZpcm13YXJlCisgICAgICAgICAgICAgKiBmdW5jdGlvbiB0YWtlcyBjYXJlIG9mIGNoZWNraW5nIG5lY2Vzc2FyeSBjb25kaXRpb25zIGJlZm9yZQorICAgICAgICAgICAgICogY29uZmlndXJpbmcuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHdsYW5faGRkX3NldF9tY19hZGRyX2xpc3QocEFkYXB0ZXIsIFRSVUUpOworI2VuZGlmCisgICAgICAgIH0KKyAgICAgICAgdnN0YXR1cyA9IGhkZF9nZXRfbmV4dF9hZGFwdGVyICggcEhkZEN0eCwgcEFkYXB0ZXJOb2RlLCAmcE5leHQgKTsKKyAgICAgICAgcEFkYXB0ZXJOb2RlID0gcE5leHQ7CisgICAgfQorICAgIEVYSVQoKTsKK30KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAgQGJyaWVmIGhkZF9Sb2FtU2V0S2V5Q29tcGxldGVIYW5kbGVyKCkgLSBVcGRhdGUgdGhlIHNlY3VyaXR5IHBhcmFtZXRlcnMuCisKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3N0YXRpYyBlSGFsU3RhdHVzIGhkZF9Sb2FtU2V0S2V5Q29tcGxldGVIYW5kbGVyKCBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwgdENzclJvYW1JbmZvICpwUm9hbUluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgcm9hbUlkLCBlUm9hbUNtZFN0YXR1cyByb2FtU3RhdHVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDc3JSb2FtUmVzdWx0IHJvYW1SZXN1bHQgKQoreworICAgZUNzckVuY3J5cHRpb25UeXBlIGNvbm5lY3RlZENpcGhlckFsZ287CisgICB2X0JPT0xfdCBmQ29ubmVjdGVkICAgPSBGQUxTRTsKKyAgIFZPU19TVEFUVVMgdm9zU3RhdHVzICAgID0gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICBoZGRfd2V4dF9zdGF0ZV90ICpwV2V4dFN0YXRlID0gV0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gaGRkX2Nvbm5HZXRDb25uZWN0ZWRDaXBoZXJBbGdvKCBwSGRkU3RhQ3R4LCAmY29ubmVjdGVkQ2lwaGVyQWxnbyApOworICAgaWYoIGZDb25uZWN0ZWQgKQorICAgeworICAgICAgaWYgKCBXTEFOX0hERF9JQlNTID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSApCisgICAgICB7CisgICAgICAgICB2X1U4X3Qgc3RhSWQ7CisKKyAgICAgICAgIHZfTUFDQUREUl90IGJyb2FkY2FzdE1hY0FkZHIgPSBWT1NfTUFDX0FERFJfQlJPQURDQVNUX0lOSVRJQUxJWkVSOworCisgICAgICAgICBpZiAoIDAgPT0gbWVtY21wKCBwUm9hbUluZm8tPnBlZXJNYWMsCisgICAgICAgICAgICAgICAgICAgICAgJmJyb2FkY2FzdE1hY0FkZHIsIFZPU19NQUNfQUREUl9TSVpFICkgKQorICAgICAgICAgeworICAgICAgICAgICAgdm9zU3RhdHVzID0gV0xBTlRMX1NUQVB0a0luc3RhbGxlZCggcEhkZEN0eC0+cHZvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJQlNTX0JST0FEQ0FTVF9TVEFJRCk7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgIldMQU4gVEwgU1RBIEdUSyBJbnN0YWxsZWQgZm9yIFNUQUlEPSVkIiwgSUJTU19CUk9BRENBU1RfU1RBSUQpOworICAgICAgICAgICAgcEhkZFN0YUN0eC0+cm9hbV9pbmZvLnJvYW1pbmdTdGF0ZSA9IEhERF9ST0FNX1NUQVRFX05PTkU7CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICB2b3NTdGF0dXMgPSBoZGRfSWJzc19HZXRTdGFJZChwSGRkU3RhQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZfTUFDQUREUl90KilwUm9hbUluZm8tPnBlZXJNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmc3RhSWQpOworICAgICAgICAgICAgaWYgKCBWT1NfU1RBVFVTX1NVQ0NFU1MgPT0gdm9zU3RhdHVzICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAiV0xBTiBUTCBTVEEgUHRrIEluc3RhbGxlZCBmb3IgU1RBSUQ9JWQiLCBzdGFJZCk7CisgICAgICAgICAgICAgICB2b3NTdGF0dXMgPSBXTEFOVExfU1RBUHRrSW5zdGFsbGVkKCBwSGRkQ3R4LT5wdm9zQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhSWQpOworICAgICAgICAgICAgICAgcEhkZFN0YUN0eC0+cm9hbV9pbmZvLnJvYW1pbmdTdGF0ZSA9IEhERF9ST0FNX1NUQVRFX05PTkU7CisgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICAgICBXTEFOVExfR2V0U1RBU3RhdGUocEhkZEN0eC0+cHZvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLnN0YUlkWzBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwcmV2VExTdGF0ZSk7CisgICAgICAgICAvLyBUT0RPOiBDb25zaWRlcmluZyBnZXR0aW5nIGEgc3RhdGUgbWFjaGluZSBpbiBIREQgbGF0ZXIuCisgICAgICAgICAvLyBUaGlzIHJvdXRpbmUgaXMgaW52b2tlZCB0d2ljZS4gMSlzZXQgUFRLIDIpc2V0IEdUSy4KKyAgICAgICAgI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gICAgICAgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLnN0YUlkWyAwIF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9TVEFfQVVUSEVOVElDQVRFRCApOworCisgICAgICAgICAgICBwSGRkU3RhQ3R4LT5jb25uX2luZm8udUlzQXV0aGVudGljYXRlZCA9IFZPU19UUlVFOworCisgICAgICAgICAgICBpZiAoV0xBTlRMX1NUQV9BVVRIRU5USUNBVEVEICE9IHByZXZUTFN0YXRlKQorICAgICAgICAgICAgICAgIGhkZF9wb3N0VExQYWNrZXRQZW5kaW5nSW5kKHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5zdGFJZFswXSk7CisgICAgICAgICAgICAvL05lZWQgdG8gY2FsbCBvZmZsb2FkIGJlY2F1c2Ugd2hlbiByb2FtaW5nIGhhcHBlbiBhdCB0aGF0IHRpbWUgZndyCisgICAgICAgICAgICAvL2NsZWFuIG9mZmxvYWQgaW5mbyBhcyBwYXJ0IG9mIHRoZSBEZWxCc3MKKyAgICAgICAgICAgIC8vIE5vIG5lZWQgdG8gY29uZmlndXJlIG9mZmxvYWQgaWYgaG9zdCB3YXMgbm90IHN1c3BlbmRlZAorICAgICAgICAgICAgc3Bpbl9sb2NrKCZwSGRkQ3R4LT5maWx0ZXJfbG9jayk7CisgICAgICAgICAgICBpZihwSGRkQ3R4LT5oZGRfd2xhbl9zdXNwZW5kZWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3Bpbl91bmxvY2soJnBIZGRDdHgtPmZpbHRlcl9sb2NrKTsKKyAgICAgICAgICAgICAgICBoZGRfUmVDb25maWdTdXNwZW5kRGF0YUNsZWFyZWREdXJpbmdSb2FtaW5nKHBIZGRDdHgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNwaW5fdW5sb2NrKCZwSGRkQ3R4LT5maWx0ZXJfbG9jayk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAocEhkZEN0eC0+Y2ZnX2luaS0+Z0VuYWJsZVJvYW1EZWxheVN0YXRzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19yZWNvcmRfcm9hbV9ldmVudChlX0hERF9TRVRfR1RLX1JTUCwgTlVMTCwgMCk7CisgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICB2b3NTdGF0dXMgPSBXTEFOVExfU1RBUHRrSW5zdGFsbGVkKCBwSGRkQ3R4LT5wdm9zQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5zdGFJZFsgMCBdKTsKKworICAgICAgICAgICAgLyogSW4gY2FzZSBvZiAgT1NFTiBtb3ZlIFRMIHRvICdBdXRoZW50aWNhdGVkJyBhZnRlciBQVEsgaXMgc2V0ICovCisgICAgICAgICAgICBpZiAocFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUuYk9TRU5Bc3NvY2lhdGlvbiA9PSBWT1NfVFJVRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPX01FRCwgIlBUSyBzZXQiCisgICAgICAgICAgICAgICAgICAgICAgIiBmb3IgU3RhSWQ9JWQuIER1ZSB0byBPU0VOLCBDaGFuZ2luZyBUTCBzdGF0ZSB0byIKKyAgICAgICAgICAgICAgICAgICAgICAiQVVUSEVOVElDQVRFRCBmcm9tIHN0YXRlOiVkIiwKKyAgICAgICAgICAgICAgICAgICAgICBwSGRkU3RhQ3R4LT5jb25uX2luZm8uc3RhSWRbMF0sIHByZXZUTFN0YXRlKTsKKworICAgICAgICAgICAgICAgIHZvc1N0YXR1cyA9IFdMQU5UTF9DaGFuZ2VTVEFTdGF0ZSggcEhkZEN0eC0+cHZvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5zdGFJZFsgMCBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfU1RBX0FVVEhFTlRJQ0FURUQgKTsKKworICAgICAgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby51SXNBdXRoZW50aWNhdGVkID0gVk9TX1RSVUU7CisKKyAgICAgICAgICAgICAgICBpZiAoV0xBTlRMX1NUQV9BVVRIRU5USUNBVEVEICE9IHByZXZUTFN0YXRlKQorICAgICAgICAgICAgICAgICAgICBoZGRfcG9zdFRMUGFja2V0UGVuZGluZ0luZChwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLnN0YUlkWzBdKTsKKyAgICAgICAgICAgIH0KKworCisKKyAgICAgICAgICAgIGlmIChwSGRkQ3R4LT5jZmdfaW5pLT5nRW5hYmxlUm9hbURlbGF5U3RhdHMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX3JlY29yZF9yb2FtX2V2ZW50KGVfSEREX1NFVF9QVEtfUlNQLCAodm9pZCAqKXBSb2FtSW5mby0+cGVlck1hYywgNik7CisgICAgICAgICAgICB9CisgICAgICAgICB9CisKKyAgICAgICAgIHBIZGRTdGFDdHgtPnJvYW1faW5mby5yb2FtaW5nU3RhdGUgPSBIRERfUk9BTV9TVEFURV9OT05FOworICAgICAgfQorICAgfQorICAgZWxzZQorICAgeworICAgICAgLy8gcG9zc2libGUgZGlzYXNzb2MgYWZ0ZXIgaXNzdWluZyBzZXQga2V5IGFuZCB3YWl0aW5nIHNldCBrZXkgY29tcGxldGUKKyAgICAgIHBIZGRTdGFDdHgtPnJvYW1faW5mby5yb2FtaW5nU3RhdGUgPSBIRERfUk9BTV9TVEFURV9OT05FOworICAgfQorCisgICBFWElUKCk7CisgICByZXR1cm4oIGVIQUxfU1RBVFVTX1NVQ0NFU1MgKTsKK30KKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqCisgIEBicmllZiBoZGRfUm9hbU1pY0Vycm9ySW5kaWNhdGlvbkhhbmRsZXIoKSAtIFRoaXMgZnVuY3Rpb24gaW5kaWNhdGVzIHRoZSBNaWMgZmFpbHVyZSB0byB0aGUgc3VwcGxpY2FudC4KKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3N0YXRpYyBlSGFsU3RhdHVzIGhkZF9Sb2FtTWljRXJyb3JJbmRpY2F0aW9uSGFuZGxlciggaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsIHRDc3JSb2FtSW5mbyAqcFJvYW1JbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIHJvYW1JZCwgZVJvYW1DbWRTdGF0dXMgcm9hbVN0YXR1cywgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ3NyUm9hbVJlc3VsdCByb2FtUmVzdWx0ICkKK3sKKyAgIGhkZF9zdGF0aW9uX2N0eF90ICpwSGRkU3RhQ3R4ID0gV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlcik7CisKKyAgIGlmKCBlQ29ubmVjdGlvblN0YXRlX0Fzc29jaWF0ZWQgPT0gcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmNvbm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9ybSBtaWMgZmFpbHVyZSB0byBubDgwMjExICovCisgICAgICBjZmc4MDIxMV9taWNoYWVsX21pY19mYWlsdXJlKHBBZGFwdGVyLT5kZXYsCisgICAgICAgICAgICAgIHBSb2FtSW5mby0+dS5wTUlDRmFpbHVyZUluZm8tPnRhTWFjQWRkciwKKyAgICAgICAgICAgICAgKChwUm9hbUluZm8tPnUucE1JQ0ZhaWx1cmVJbmZvLT5tdWx0aWNhc3QgPT0gZVNJUl9UUlVFKSA/CisgICAgICAgICAgICAgICBOTDgwMjExX0tFWVRZUEVfR1JPVVAgOgorICAgICAgICAgICAgICAgTkw4MDIxMV9LRVlUWVBFX1BBSVJXSVNFKSwKKyAgICAgICAgICAgICAgcFJvYW1JbmZvLT51LnBNSUNGYWlsdXJlSW5mby0+a2V5SWQsCisgICAgICAgICAgICAgIHBSb2FtSW5mby0+dS5wTUlDRmFpbHVyZUluZm8tPlRTQywKKyAgICAgICAgICAgICAgR0ZQX0tFUk5FTCk7CisKKyAgIH0KKworICAgcmV0dXJuKCBlSEFMX1NUQVRVU19TVUNDRVNTICk7Cit9CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqCisgIEBicmllZiByb2FtUm9hbUNvbm5lY3RTdGF0dXNVcGRhdGVIYW5kbGVyKCkgLSBUaGUgSWJzcyBjb25uZWN0aW9uIHN0YXR1cyBpcworICB1cGRhdGVkIHJlZ3VsYXJseSBoZXJlIGluIHRoaXMgZnVuY3Rpb24uCisKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3N0YXRpYyBlSGFsU3RhdHVzIHJvYW1Sb2FtQ29ubmVjdFN0YXR1c1VwZGF0ZUhhbmRsZXIoIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLCB0Q3NyUm9hbUluZm8g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AgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICAgICAgICJOZXcgSUJTUyBwZWVyIGJ1dCB3ZSBhbHJlYWR5IGhhdmUgdGhlIG1heCB3ZSBjYW4gaGFuZGxlLiAgQ2FuJ3QgcmVnaXN0ZXIgdGhpcyBvbmUiICk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIH0KKworICAgICAgICAgcEhkZEN0eC0+c3RhX3RvX2FkYXB0ZXJbcFJvYW1JbmZvLT5zdGFJZF0gPSBwQWRhcHRlcjsKKworICAgICAgICAgcEhkZEN0eC0+c3RhX3RvX2FkYXB0ZXJbSUJTU19CUk9BRENBU1RfU1RBSURdID0gcEFkYXB0ZXI7CisgICAgICAgICBXTEFOVExfVXBkYXRlU1RBQnNzSWRmb3JJQlNTKHBIZGRDdHgtPnB2b3NDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgIElCU1NfQlJPQURDQVNUX1NUQUlELHBIZGRTdGFDdHgtPmNvbm5faW5mby5ic3NJZCk7CisKKyAgICAgICAgIC8vIFJlZ2lzdGVyIHRoZSBTdGF0aW9uIHdpdGggVEwgZm9yIHRoZSBuZXcgcGVlci4KKyAgICAgICAgIHZvc1N0YXR1cyA9IGhkZF9pYnNzX1JlZ2lzdGVyU1RBKCBwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+c3RhSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodl9NQUNBRERSX3QgKilwUm9hbUluZm8tPnBlZXJNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPnBCc3NEZXNjICk7CisgICAgICAgICBpZi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R5cGUKKyAgICAgICAgICAgIHx8ZUNTUl9FTkNSWVBUX1RZUEVfQUVTID09IHBIZGRTdGFDdHgtPmlic3NfZW5jX2tleS5lbmNUeXBlICkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHBIZGRTdGFDdHgtPmlic3NfZW5jX2tleS5rZXlEaXJlY3Rpb24gPSBlU0lSX1RYX1JYOworCisgICAgICAgICAgICBtZW1jcHkoJnBIZGRTdGFDdHgtPmlic3NfZW5jX2tleS5wZWVyTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT5wZWVyTWFjLCBXTklfQ0ZHX0JTU0lEX0xFTik7CisKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsCisgICAgICAgICAgICAgICBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiTmV3IHBlZXIgam9pbmVkIHNldCBQVEsgZW5jVHlwZT0lZCIsCisgICAgICAgICAgICAgICBwSGRkU3RhQ3R4LT5pYnNzX2VuY19rZXkuZW5jVHlwZSk7CisKKyAgICAgICAgICAgIHZvc1N0YXR1cyA9IHNtZV9Sb2FtU2V0S2V5KCBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCAmcEhkZFN0YUN0eC0+aWJzc19lbmNfa2V5LCAmcm9hbUlkICk7CisKKyAgICAgICAgICAgIGlmICggVk9TX1NUQVRVU19TVUNDRVNTICE9IHZvc1N0YXR1cyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IHNtZV9Sb2FtU2V0S2V5IGZhaWxlZCwgcmV0dXJuZWQgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgdm9zU3RhdHVzKTsKKyAgICAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgICAgIG5ldGlmX2NhcnJpZXJfb24ocEFkYXB0ZXItPmRldik7CisgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sIEZMKCJFbmFibGluZyBxdWV1ZXMiKSk7CisgICAgICAgICBuZXRpZl90eF9zdGFydF9hbGxfcXVldWVzKHBBZGFwdGVyLT5kZXYpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisKKyAgICAgIGNhc2UgZUNTUl9ST0FNX1JFU1VMVF9JQlNTX0NPTk5FQ1Q6CisgICAgICB7CisKKyAgICAgICAgIHJvYW1JYnNzQ29ubmVjdEhhbmRsZXIoIHBBZGFwdGVyLCBwUm9hbUluZm8gKTsKKworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIGVDU1JfUk9BTV9SRVNVTFRfSUJTU19QRUVSX0RFUEFSVEVEOgorICAgICAgeworICAgICAgICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKworICAgICAgICAgaWYgKCAhcm9hbVJlbW92ZUlic3NTdGF0aW9uKHBBZGFwdGVyLCBwUm9hbUluZm8tPnN0YUlkICkgKQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICAgICJJQlNTIHBlZXIgZGVwYXJ0ZWQgYnkgY2Fubm90IGZpbmQgcGVlciBpbiBvdXIgcmVnaXN0cmF0aW9uIHRhYmxlIHdpdGggVEwiICk7CisgICAgICAgICB9CisKKyAgICAgICAgIHByX2luZm8gKCAiSUJTUyBQZWVyIERlcGFydGVkIGZyb20gU01FICIKKyAgICAgICAgICAgICAgICAgICAgIndpdGggcGVlck1hYyAiIE1BQ19BRERSRVNTX1NUUiAiIEJTU0lEOiAiIE1BQ19BRERSRVNTX1NUUiAiIGFuZCBzdGF0aW9uSUQ9ICVkIiwKKyAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocFJvYW1JbmZvLT5wZWVyTWFjKSwKKyAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkZFN0YUN0eC0+Y29ubl9pbmZvLmJzc0lkKSwKKyAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT5zdGFJZCApOworCisgICAgICAgICBoZGRfaWJzc19EZXJlZ2lzdGVyU1RBKCBwQWRhcHRlciwgcFJvYW1JbmZvLT5zdGFJZCApOworCisgICAgICAgICBwSGRkQ3R4LT5zdGFfdG9fYWRhcHRlcltwUm9hbUluZm8tPnN0YUlkXSA9IE5VTEw7CisgICAgICAgICBwSGRkU3RhQ3R4LT5pYnNzX3N0YV9nZW5lcmF0aW9uKys7CisKKyAgICAgICAgIGNmZzgwMjExX2RlbF9zdGEocEFkYXB0ZXItPmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAoY29uc3QgdTggKikmcFJvYW1JbmZvLT5wZWVyTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgIEdGUF9LRVJORUwpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIGVDU1JfUk9BTV9SRVNVTFRfSUJTU19JTkFDVElWRToKKyAgICAgIHsKKyAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19NRUQsCisgICAgICAgICAgICAgICAgICAgICJSZWNlaXZlZCBlQ1NSX1JPQU1fUkVTVUxUX0lCU1NfSU5BQ1RJVkUgZnJvbSBTTUUiKTsKKyAgICAgICAgIC8vIFN0b3Agb25seSB3aGVuIHdlIGFyZSBpbmFjdGl2ZQorICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCBGTCgiRGlzYWJsaW5nIHF1ZXVlcyIpKTsKKyAgICAgICAgIG5ldGlmX3R4X2Rpc2FibGUocEFkYXB0ZXItPmRldik7CisgICAgICAgICBuZXRpZl9jYXJyaWVyX29mZihwQWRhcHRlci0+ZGV2KTsKKyAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICIlczogU2V0IEhERCBjb25uU3RhdGUgdG8gZUNvbm5lY3Rpb25TdGF0ZV9Ob3RDb25uZWN0ZWQiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgIGhkZF9jb25uU2V0Q29ubmVjdGlvblN0YXRlKCBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKSwgZUNvbm5lY3Rpb25TdGF0ZV9Ob3RDb25uZWN0ZWQgKTsKKworICAgICAgICAgLy8gU2VuZCB0aGUgYnNzaWQgYWRkcmVzcyB0byB0aGUgd2V4dC4KKyAgICAgICAgIGhkZF9TZW5kQXNzb2NpYXRpb25FdmVudChwQWRhcHRlci0+ZGV2LCBwUm9hbUluZm8pOworICAgICAgICAgLy8gY2xlYW4gdXAgZGF0YSBwYXRoCisgICAgICAgICBoZGRfZGlzY29ubmVjdF90eF9yeChwQWRhcHRlcik7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGRlZmF1bHQ6CisgICAgICAgICBicmVhazsKKworICAgfQorCisgICByZXR1cm4oIGVIQUxfU1RBVFVTX1NVQ0NFU1MgKTsKK30KKworI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKgorICBAYnJpZWYgaGRkX3JvYW1SZWdpc3RlclRETFNTVEEoKSAtIENvbnN0cnVjdCB0aGUgc3RhRGVzYyBhbmQgcmVnaXN0ZXIgd2l0aAorICBUTCB0aGUgbmV3IFNUQS4gVGhpcyBpcyBjYWxsZWQgYXMgcGFydCBvZiBBRERfU1RBIGluIHRoZSBURExTIHNldHVwCisgIFJldHVybjogVk9TX1NUQVRVUworCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIGhkZF9yb2FtUmVnaXN0ZXJURExTU1RBKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdEFOSV9VOCAqcGVlck1hYywKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBlZXJNYWMsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMTYgc3RhSWQsIHRBTklfVTggdWNhc3RTaWcpCit7CisgICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKyAgICB2X0NPTlRFWFRfdCBwVm9zQ29udGV4dCA9IChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPnB2b3NDb250ZXh0OworICAgIFZPU19TVEFUVVMgdm9zU3RhdHVzID0gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgV0xBTl9TVEFEZXNjVHlwZSBzdGFEZXNjID0gezB9OworICAgIGVDc3JFbmNyeXB0aW9uVHlwZSBjb25uZWN0ZWRDaXBoZXJBbGdvID0gZUNTUl9FTkNSWVBUX1RZUEVfVU5LTk9XTjsKKyAgICB2X0JPT0xfdCBmQ29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cmVzIGFuZCBzdGF0ZSAqLworICAgIHN0YURlc2MudWNVY2FzdFNpZyAgPSB1Y2FzdFNpZyA7CisKKyAgICAvKiB0ZGxzIERpcmVjdCBMaW5rIGRvIG5vdCBuZWVkIGJjYXN0U2lnICovCisgICAgc3RhRGVzYy51Y0JjYXN0U2lnICA9IDAgOworCisjaWZkZWYgVk9MQU5TX0VOQUJMRV9TV19SRVBMQVlfQ0hFQ0sKKyAgICBpZihzdGFEZXNjLnVjUHJvdGVjdGVkRnJhbWUpCisgICAgICAgIHN0YURlc2MudWNJc1JlcGxheUNoZWNrVmFsaWQgPSBWT1NfVFJVRTsKKyAgICBlbHNlCisgICAgICAgIHN0YURlc2MudWNJc1JlcGxheUNoZWNrVmFsaWQgPSBWT1NfRkFMU0U7CisjZW5kaWYKKworICAgIHN0YURlc2MudWNJbml0U3RhdGUgPSBXTEFOVExfU1RBX0NPTk5FQ1RFRCA7CisKKyAgIC8qIFJlZ2lzdGVyIHRoZSBTdGF0aW9uIHdpdGggVEwuLi4gICovCisgICAgdm9zU3RhdHVzID0gV0xBTlRMX1JlZ2lzdGVyU1RBQ2xpZW50KCBwVm9zQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhkZF9yeF9wYWNrZXRfY2JrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGRkX3R4X2NvbXBsZXRlX2NiaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhkZF90eF9mZXRjaF9wYWNrZXRfY2JrLCAmc3RhRGVzYywgMCApOworCisgICAgaWYgKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCB2b3NTdGF0dXMgKSApCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgIiVzOiBXTEFOVExfUmVnaXN0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FpbGVkIHRvIGZvciBzdGFJRCAlZC4gICIKKyAgICAgICAgICAgICAgICAgICAiU3RhdHVzPSAlZCBbMHglMDhYXSIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHN0YUlkLCB2b3NTdGF0dXMsIHZvc1N0YXR1cyApOworICAgIH0KKyAgICByZXR1cm4oIHZvc1N0YXR1cyApOworfQorCisKKy8qCisgKiBIREQgaW50ZXJmYWNlIGJldHdlZW4gU01FIGFuZCBUTCB0byBlbnN1cmUgVERMUyBjbGllbnQgcmVnaXN0cmF0aW9uIHdpdGgKKyAqIFRMIGluIGNhc2Ugb2YgbmV3IFRETFMgY2xpZW50IGlzIGFkZGVkIGFuZCBkZXJlZ2lzdHJhdGlvbiBhdCB0aGUgdGltZQorICogVERMUyBjbGllbnQgaXMgZGVsZXRlZC4KKyAqLworCitlSGFsU3RhdHVzIGhkZF9Sb2FtVGRsc1N0YXR1c1VwZGF0ZUhhbmRsZXIoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Q3NyUm9hbUluZm8gKnBSb2FtSW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiByb2FtSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlUm9hbUNtZFN0YXR1cyByb2FtU3RhdHVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ3NyUm9hbVJlc3VsdCByb2FtUmVzdWx0KQoreworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkUgOworICAgIHRBTklfVTggc3RhSWR4OworCisgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAoImhkZF90ZGxzU3RhdHVzVXBkYXRlOiAlcyBzdGFJZHggJWQgIiBNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICByb2FtUmVzdWx0ID09IGVDU1JfUk9BTV9SRVNVTFRfQUREX1RETFNfUEVFUiA/CisgICAgICAgICAgICAgICJBRERfVERMU19QRUVSIiA6CisgICAgICAgICAgICAgIHJvYW1SZXN1bHQgPT0gZUNTUl9ST0FNX1JFU1VMVF9ERUxFVEVfVERMU19QRUVSID8KKyAgICAgICAgICAgICAgIkRFTF9URExTX1BFRVIiIDoKKyAgICAgICAgICAgICAgcm9hbVJlc3VsdCA9PSBlQ1NSX1JPQU1fUkVTVUxUX1RFQVJET1dOX1RETFNfUEVFUl9JTkQgPworICAgICAgICAgICAgICAiREVMX1RETFNfUEVFUl9JTkQiIDoKKyAgICAgICAgICAgICAgcm9hbVJlc3VsdCA9PSBlQ1NSX1JPQU1fUkVTVUxUX0RFTEVURV9BTExfVERMU19QRUVSX0lORCA/CisgICAgICAgICAgICAgICJERUxfQUxMX1RETFNfUEVFUl9JTkQiIDoKKyAgICAgICAgICAgICAgcm9hbVJlc3VsdCA9PSBlQ1NSX1JPQU1fUkVTVUxUX1VQREFURV9URExTX1BFRVIgPworICAgICAgICAgICAgICAiVVBEQVRFX1RETFNfUEVFUiIgOgorICAgICAgICAgICAgICByb2FtUmVzdWx0ID09IGVDU1JfUk9BTV9SRVNVTFRfTElOS19FU1RBQkxJU0hfUkVRX1JTUCA/CisgICAgICAgICAgICAgICJMSU5LX0VTVEFCTElTSF9SRVFfUlNQIiA6ICJVTktOT1dOIiwKKyAgICAgICAgICAgICAgcFJvYW1JbmZvLT5zdGFJZCwgTUFDX0FERFJfQVJSQVkocFJvYW1JbmZvLT5wZWVyTWFjKSk7CisgICAgc3dpdGNoKCByb2FtUmVzdWx0ICkKKyAgICB7CisgICAgICAgIGNhc2UgZUNTUl9ST0FNX1JFU1VMVF9BRERfVERMU19QRUVSOgorICAgICAgICB7CisgICAgICAgICAgICBpZihlU0lSX1NNRV9TVUNDRVNTICE9IHBSb2FtSW5mby0+c3RhdHVzQ29kZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICgiJXM6IEFkZCBTdGEgaXMgZmFpbGVkLiAlZCIpLF9fZnVuY19fLCBwUm9hbUluZm8tPnN0YXR1c0NvZGUpOworICAgICAgICAgICAgICAgIHdsYW5faGRkX3RkbHNfY2hlY2tfYm1wcyhwQWRhcHRlcik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisKKyAgICAgICAgICAgICAgICAvKiBjaGVjayBpZiB0aGVyZSBpcyBhdmFpbGFibGUgaW5kZXggZm9yIHRoaXMgbmV3IFRETFMgU1RBICovCisgICAgICAgICAgICAgICAgZm9yICggc3RhSWR4ID0gMDsgc3RhSWR4IDwgSEREX01BWF9OVU1fVERMU19TVEE7IHN0YUlkeCsrICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmICgwID09IHBIZGRDdHgtPnRkbHNDb25uSW5mb1tzdGFJZHhdLnN0YUlkICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+dGRsc0Nvbm5JbmZvW3N0YUlkeF0uc2Vzc2lvbklkID0gcFJvYW1JbmZvLT5zZXNzaW9uSWQ7CisgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT50ZGxzQ29ubkluZm9bc3RhSWR4XS5zdGFJZCA9IHBSb2FtSW5mby0+c3RhSWQ7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCJURExTOiBTVEEgSURYIGF0ICVkIGlzICVkICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib2YgbWFjICIgTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFJZHgsIHBIZGRDdHgtPnRkbHNDb25uSW5mb1tzdGFJZHhdLnN0YUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBSb2FtSW5mby0+cGVlck1hYykpOworCisgICAgICAgICAgICAgICAgICAgICAgICB2b3NfY29weV9tYWNhZGRyKCZwSGRkQ3R4LT50ZGxzQ29ubkluZm9bc3RhSWR4XS5wZWVyTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodl9NQUNBRERSX3QgKilwUm9hbUluZm8tPnBlZXJNYWMpIDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1MgOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChzdGFJZHggPCBIRERfTUFYX05VTV9URExTX1NUQSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmICgtMSA9PSB3bGFuX2hkZF90ZGxzX3NldF9zdGFfaWQocEFkYXB0ZXIsIHBSb2FtSW5mby0+cGVlck1hYywgcFJvYW1JbmZvLT5zdGFJZCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAid2xhbl9oZGRfdGRsc19zZXRfc3RhX2lkKCkgZmFpbGVkIik7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gVk9TX0ZBTFNFOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+c3RhX3RvX2FkYXB0ZXJbcFJvYW1JbmZvLT5zdGFJZF0gPSBwQWRhcHRlcjsKKyAgICAgICAgICAgICAgICAgICAgLyogc3RvcmUgdGhlIHVjYXN0IHNpZ25hdHVyZSAsIGlmIHJlcXVpcmVkIGZvciBmdXJ0aGVyIHJlZmVyZW5jZS4gKi8KKworICAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF90ZGxzX3NldF9zaWduYXR1cmUoIHBBZGFwdGVyLCBwUm9hbUluZm8tPnBlZXJNYWMsIHBSb2FtSW5mby0+dWNhc3RTaWcgKTsKKyAgICAgICAgICAgICAgICAgICAgLyogc3RhcnQgVERMUyBjbGllbnQgcmVnaXN0cmF0aW9uIHdpdGggVEwgKi8KKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gaGRkX3JvYW1SZWdpc3RlclRETFNTVEEoIHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT5wZWVyTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT5zdGFJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+dWNhc3RTaWcpOworICAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF90ZGxzX2luY3JlbWVudF9wZWVyX2NvdW50KHBBZGFwdGVyKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICIlczogbm8gYXZhaWxhYmxlIHNsb3QgaW4gY29ubl9pbmZvLiBzdGFJZCAlZCBjYW5ub3QgYmUgc3RvcmVkIiwgX19mdW5jX18sIHBSb2FtSW5mby0+c3RhSWQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwQWRhcHRlci0+dGRsc0FkZFN0YVN0YXR1cyA9IHN0YXR1czsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGNvbXBsZXRlKCZwQWRhcHRlci0+dGRsc19hZGRfc3RhdGlvbl9jb21wKTsKKyAgICAgICAgICAgIGJyZWFrIDsKKyAgICAgICAgfQorICAgICAgICBjYXNlIGVDU1JfUk9BTV9SRVNVTFRfVVBEQVRFX1RETFNfUEVFUjoKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKGVTSVJfU01FX1NVQ0NFU1MgIT0gcFJvYW1JbmZvLT5zdGF0dXNDb2RlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgIiVzOiBBZGQgU3RhIGlzIGZhaWxlZC4gJWQiLCBfX2Z1bmNfXywgcFJvYW1JbmZvLT5zdGF0dXNDb2RlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8qIHN0b3JlIHRoZSB1Y2FzdCBzaWduYXR1cmUgd2hpY2ggd2lsbCBiZSB1c2VkIGxhdGVyIHdoZW4KKyAgICAgICAgICAgICAqIHJlZ2lzdGVyaW5nIHRvIFRMCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHBBZGFwdGVyLT50ZGxzQWRkU3RhU3RhdHVzID0gcFJvYW1JbmZvLT5zdGF0dXNDb2RlOworICAgICAgICAgICAgY29tcGxldGUoJnBBZGFwdGVyLT50ZGxzX2FkZF9zdGF0aW9uX2NvbXApOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fUkVTVUxUX0xJTktfRVNUQUJMSVNIX1JFUV9SU1A6CisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChlU0lSX1NNRV9TVUNDRVNTICE9IHBSb2FtSW5mby0+c3RhdHVzQ29kZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICIlczogTGluayBFc3RhYmxpc2ggUmVxdWVzdCBmYWlsZWQuICVkIiwgX19mdW5jX18sIHBSb2FtSW5mby0+c3RhdHVzQ29kZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjb21wbGV0ZSgmcEFkYXB0ZXItPnRkbHNfbGlua19lc3RhYmxpc2hfcmVxX2NvbXApOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fUkVTVUxUX0RFTEVURV9URExTX1BFRVI6CisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZFRkbHNQZWVyX3QgKmN1cnJfcGVlcjsKKyAgICAgICAgICAgIGZvciAoIHN0YUlkeCA9IDA7IHN0YUlkeCA8IEhERF9NQVhfTlVNX1RETFNfU1RBOyBzdGFJZHgrKyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKChwSGRkQ3R4LT50ZGxzQ29ubkluZm9bc3RhSWR4XS5zZXNzaW9uSWQgPT0gcFJvYW1JbmZvLT5zZXNzaW9uSWQpICYmCisgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+c3RhSWQgPT0gcEhkZEN0eC0+dGRsc0Nvbm5JbmZvW3N0YUlkeF0uc3RhSWQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIkhERDogZGVsIFNUQSBJRFggPSAleCIpLCBwUm9hbUluZm8tPnN0YUlkKSA7CisKKyAgICAgICAgICAgICAgICAgICAgbXV0ZXhfbG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICAgICAgICAgICAgICAgICAgY3Vycl9wZWVyID0gd2xhbl9oZGRfdGRsc19maW5kX3BlZXIocEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+cGVlck1hYywgRkFMU0UpOworICAgICAgICAgICAgICAgICAgICBpZiAoTlVMTCAhPSBjdXJyX3BlZXIpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgQ3VycmVudCBzdGF0dXMgZm9yIHBlZXIiIE1BQ19BRERSRVNTX1NUUiAiaXMgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocFJvYW1JbmZvLT5wZWVyTWFjKSwgY3Vycl9wZWVyLT5saW5rX3N0YXR1cyk7CisgICAgICAgICAgICAgICAgICAgICAgIGlmIChURExTX0lTX0NPTk5FQ1RFRChjdXJyX3BlZXIpIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgIChlVERMU19MSU5LX0NPTk5FQ1RJTkcgPT0gY3Vycl9wZWVyLT5saW5rX3N0YXR1cykpCisgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGhkZF9yb2FtRGVyZWdpc3RlclRETFNTVEEgKCBwQWRhcHRlciwgcFJvYW1JbmZvLT5zdGFJZCApOworICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKworICAgICAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF90ZGxzX2RlY3JlbWVudF9wZWVyX2NvdW50KHBBZGFwdGVyKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisKKyAgICAgICAgICAgICAgICAgICAgd2xhbl9oZGRfdGRsc19yZXNldF9wZWVyKHBBZGFwdGVyLCBwUm9hbUluZm8tPnBlZXJNYWMpOworCisgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPnRkbHNDb25uSW5mb1tzdGFJZHhdLnN0YUlkID0gMCA7CisgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPnRkbHNDb25uSW5mb1tzdGFJZHhdLnNlc3Npb25JZCA9IDI1NTsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV96ZXJvKCZwSGRkQ3R4LT50ZGxzQ29ubkluZm9bc3RhSWR4XS5wZWVyTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2Yodl9NQUNBRERSX3QpKSA7CisgICAgICAgICAgICAgICAgICAgIHdsYW5faGRkX3RkbHNfY2hlY2tfYm1wcyhwQWRhcHRlcik7CisgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1MgOworICAgICAgICAgICAgICAgICAgICBicmVhayA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgY29tcGxldGUoJnBBZGFwdGVyLT50ZGxzX2RlbF9zdGF0aW9uX2NvbXApOworICAgICAgICB9CisgICAgICAgIGJyZWFrIDsKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fUkVTVUxUX1RFQVJET1dOX1RETFNfUEVFUl9JTkQ6CisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZFRkbHNQZWVyX3QgKmN1cnJfcGVlcjsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBTZW5kaW5nIHRlYXJkb3duIHRvIHN1cHBsaWNhbnQgd2l0aCByZWFzb24gY29kZSAldSIsCisgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBwUm9hbUluZm8tPnJlYXNvbkNvZGUpOworCisjaWZkZWYgQ09ORklHX1RETFNfSU1QTElDSVQKKyAgICAgICAgICAgIG11dGV4X2xvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgICAgICAgICBjdXJyX3BlZXIgPSB3bGFuX2hkZF90ZGxzX2ZpbmRfcGVlcihwQWRhcHRlciwgcFJvYW1JbmZvLT5wZWVyTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkFMU0UpOworICAgICAgICAgICAgd2xhbl9oZGRfdGRsc19pbmRpY2F0ZV90ZWFyZG93bihwQWRhcHRlciwgY3Vycl9wZWVyLCBwUm9hbUluZm8tPnJlYXNvbkNvZGUpOworICAgICAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworI2VuZGlmCisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTIDsKKyAgICAgICAgICAgIGJyZWFrIDsKKyAgICAgICAgfQorICAgICAgICBjYXNlIGVDU1JfUk9BTV9SRVNVTFRfREVMRVRFX0FMTF9URExTX1BFRVJfSU5EOgorICAgICAgICB7CisgICAgICAgICAgICAvKiAwIHN0YUlkeCBpcyBhc3NpZ25lZCB0byBBUCB3ZSBkb250IHdhbnQgdG8gdG91Y2ggdGhhdCAqLworICAgICAgICAgICAgZm9yICggc3RhSWR4ID0gMDsgc3RhSWR4IDwgSEREX01BWF9OVU1fVERMU19TVEE7IHN0YUlkeCsrICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoKHBIZGRDdHgtPnRkbHNDb25uSW5mb1tzdGFJZHhdLnNlc3Npb25JZCA9PSBwUm9hbUluZm8tPnNlc3Npb25JZCkgJiYKKyAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+dGRsc0Nvbm5JbmZvW3N0YUlkeF0uc3RhSWQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCJoZGRfdGRsc1N0YXR1c1VwZGF0ZTogc3RhSWR4ICVkICIgTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+dGRsc0Nvbm5JbmZvW3N0YUlkeF0uc3RhSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBIZGRDdHgtPnRkbHNDb25uSW5mb1tzdGFJZHhdLnBlZXJNYWMuYnl0ZXMpKTsKKyAgICAgICAgICAgICAgICAgICAgd2xhbl9oZGRfdGRsc19yZXNldF9wZWVyKHBBZGFwdGVyLCBwSGRkQ3R4LT50ZGxzQ29ubkluZm9bc3RhSWR4XS5wZWVyTWFjLmJ5dGVzKTsKKyAgICAgICAgICAgICAgICAgICAgaGRkX3JvYW1EZXJlZ2lzdGVyVERMU1NUQSAoIHBBZGFwdGVyLCAgcEhkZEN0eC0+dGRsc0Nvbm5JbmZvW3N0YUlkeF0uc3RhSWQgKTsKKyAgICAgICAgICAgICAgICAgICAgd2xhbl9oZGRfdGRsc19kZWNyZW1lbnRfcGVlcl9jb3VudChwQWRhcHRlcik7CisKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV96ZXJvKCZwSGRkQ3R4LT50ZGxzQ29ubkluZm9bc3RhSWR4XS5wZWVyTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2Yodl9NQUNBRERSX3QpKSA7CisgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPnRkbHNDb25uSW5mb1tzdGFJZHhdLnN0YUlkID0gMCA7CisgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPnRkbHNDb25uSW5mb1tzdGFJZHhdLnNlc3Npb25JZCA9IDI1NTsKKworICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTIDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICB3bGFuX2hkZF90ZGxzX2NoZWNrX2JtcHMocEFkYXB0ZXIpOworICAgICAgICAgICAgYnJlYWsgOworICAgICAgICB9CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgIHsKKyAgICAgICAgICAgIGJyZWFrIDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiBzdGF0dXMgOworfQorI2VuZGlmCisKK3N0YXRpYyB2b2lkIGl3X2Z1bGxfcG93ZXJfY2JmbiAodm9pZCAqcENvbnRleHQsIGVIYWxTdGF0dXMgc3RhdHVzKQoreworICAgIGhkZF9hZGFwdGV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HgtPmNmZ19pbmktPmdFbmFibGVSb2FtRGVsYXlTdGF0cykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHZvc19yZWNvcmRfcm9hbV9ldmVudChlX0hERF9ESVNBQkxFX1RYX1FVRVVFLCBOVUxMLCAwKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgKiBEZXJlZ2lzdGVyIHRoaXMgU1RBIHdpdGggVEwsIGJ1dCBkbyBub3QgZmx1c2ggdGhlIHBhY2tldHMKKyAgICAgICAgICAgICAgICAgKiBmb3IgdGhpcyBTVEEgZnJvbSB3bW1fdHhfcXVldWUuIFNpbmNlIHRoZXJlIGlzIG5vIHZhbGlkIFNUQQorICAgICAgICAgICAgICAgICAqIGZvciB0aGVzZSBwYWNrZXRzIHRoZXkgd2lsbCBub3QgYmUgdHJhbnNtaXR0ZWQuIEV2ZW50dWFsbHkKKyAgICAgICAgICAgICAgICAgKiBhZnRlciB0aGUgcmVhc3NvY2lhdGlvbiBpcyBzdWNjZXNzZnVsLCB0aGVzZSBwYWNrZXRzIHdpbGwgYmUKKyAgICAgICAgICAgICAgICAgKiB0cmFuc21pdHRlZCBhZnRlciByZWdpc3RlcmluZyBTVEEgd2l0aCBUTCBhZ2Fpbi4gVGhpcyBlbnN1cmVzCisgICAgICAgICAgICAgICAgICogdGhhdCBkcml2ZXIgZG9lcyBub3QgZHJvcCBwYWNrZXRzIGR1cmluZyByb2FtaW5nLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIHN0YXR1cyA9IFdMQU5UTF9DbGVhclNUQUNsaWVudChwSGRkQ3R4LT5wdm9zQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLnN0YUlkWzBdKTsKKyAgICAgICAgICAgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiV0xBTlRMX0NsZWFyU1RBQ2xpZW50IGZhaWxlZCBmb3Igc3RhSUQgJWQuIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlN0YXR1cz0gJWQgWzB4JXhdIiksIHBIZGRTdGFDdHgtPmNvbm5faW5mby5zdGFJZFswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cywgc3RhdHVzKTsKKyAgICAgICAgICAgICAgICAgICAgaGFsU3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwSGRkU3RhQ3R4LT5mdF9jYXJyaWVyX29uID0gVFJVRTsKKyAgICAgICAgICAgIHBIZGRTdGFDdHgtPmhkZF9SZWFzc29jU2NlbmFyaW8gPSBWT1NfVFJVRTsKKyAgICAgICAgICAgIGJyZWFrOworI2VuZGlmCisKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fU0hPVUxEX1JPQU06CisgICAgICAgICAgIC8vIERvbnQgbmVlZCB0byBkbyBhbnl0aGluZworICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgPSBwQWRhcHRlci0+ZGV2OworICAgICAgICAgICAgICAgIGhkZF9zdGF0aW9uX2N0eF90ICpwSGRkU3RhQ3R4ID0gV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlcik7CisgICAgICAgICAgICAgICAgLy8gbm90aWZ5IGFwcHMgdGhhdCB3ZSBjYW4ndCBwYXNzIHRyYWZmaWMgYW55bW9yZQorICAgICAgICAgICAgICAgIGhkZExv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X0hERCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICAgICAgICBGTCgiaGRkX3JvYW1EZXJlZ2lzdGVyU1RBKCkgZmFpbGVkIHRvIGZvciBzdGFJRCAlZC4gIFN0YXR1cz0gJWQgWzB4JXhdIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLnN0YUlkWzBdLCBzdGF0dXMsIHN0YXR1cyApOworICAgICAgICAgICAgICAgICAgICBoYWxTdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgICAgIH0KKyNlbmRpZgorICAgICAgICAgICAgfQorICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fTE9TVExJTks6CisgICAgICAgIGNhc2UgZUNTUl9ST0FNX0RJU0FTU09DSUFURUQ6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICIqKioqZUNTUl9ST0FNX0RJU0FTU09DSUFURUQqKioqIik7CisgICAgICAgICAgICAgICAgc21lX3Jlc2V0Q29leEVldmVudChXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlcikpOworICAgICAgICAgICAgICAgIGhhbFN0YXR1cyA9IGhkZF9EaXNDb25uZWN0SGFuZGxlciggcEFkYXB0ZXIsIHBSb2FtSW5mbywgcm9hbUlkLCByb2FtU3RhdHVzLCByb2FtUmVzdWx0ICk7CisgICAgICAgICAgICAgICAgLyogQ2hlY2sgaWYgTWNhc3QvQmNhc3QgRmlsdGVycyBhcmUgc2V0LCBpZiB5ZXMgY2xlYXIgdGhlIGZpbHRlcnMgaGVyZSAqLworICAgICAgICAgICAgICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICAgICAgICAgICAgICBpZiAocEhkZEN0eC0+aGRkX21jYXN0YmNhc3RfZmlsdGVyX3NldCA9PSBUUlVFKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaGRkX2NvbmZfbWNhc3RiY2FzdF9maWx0ZXIocEhkZEN0eCwgRkFMU0UpOworCisgICAgICAgICAgICAgICAgICAgIGlmIChWT1NfVFJVRSA9PSBwSGRkQ3R4LT5zdXNfcmVzX21jYXN0YmNhc3RfZmlsdGVyX3ZhbGlkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT5jb25maWd1cmVkTWNhc3RCY2FzdEZpbHRlciA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+c3VzX3Jlc19tY2FzdGJjYXN0X2ZpbHRlcjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPnN1c19yZXNfbWNhc3RiY2FzdF9maWx0ZXJfdmFsaWQgPSBWT1NfRkFMU0U7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAib2ZmbG9hZDogZGlzYXNzb2NpYXRpb24gaGFwcGVuaW5nLCByZXN0b3JpbmcgY29uZmlndXJlZE1jYXN0QmNhc3RGaWx0ZXIiKTsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCJNY2FzdEJjYXN0RmlsdGVyID0gJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+Y29uZmlndXJlZE1jYXN0QmNhc3RGaWx0ZXIpOworICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAib2ZmbG9hZDogYWxyZWFkeSBjYWxsZWQgbWNhc3RiY2FzdCBmaWx0ZXIiKTsKKyAgICAgICAgICAgICAgICAgICAgKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+aGRkX21jYXN0YmNhc3RfZmlsdGVyX3NldCA9IEZBTFNFOworICAgICAgICAgICAgICAgIH0KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfUEFDS0VUX0ZJTFRFUklORworICAgICAgICAgICAgICAgIC8qIENhbGwgdG8gY2xlYXIgYW55IE1DIEFkZHIgTGlzdCBmaWx0ZXIgYXBwbGllZCBhZnRlcgorICAgICAgICAgICAgICAgICAqIHN1Y2Nlc3NmdWwgY29ubmVjdGlvbi4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICB3bGFuX2hkZF9zZXRfbWNfYWRkcl9saXN0KHBBZGFwdGVyLCBGQUxTRSk7CisjZW5kaWYKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVDU1JfUk9BTV9JQlNTX0xFQVZFOgorICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgIioqKiplQ1NSX1JPQU1fSUJTU19MRUFWRSoqKioiKTsKKyAgICAgICAgICAgIGhhbFN0YXR1cyA9IGhkZF9EaXNDb25uZWN0SGFuZGxlciggcEFkYXB0ZXIsIHBSb2FtSW5mbywgcm9hbUlkLCByb2FtU3RhdHVzLCByb2FtUmVzdWx0ICk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fQVNTT0NJQVRJT05fQ09NUExFVElPTjoKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICIqKioqZUNTUl9ST0FNX0FTU09DSUFUSU9OX0NPTV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RhdHVzLCByb2FtUmVzdWx0ICk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVDU1JfUk9BTV9DT05ORUNUX1NUQVRVU19VUERBVEU6CisgICAgICAgICAgICBoYWxTdGF0dXMgPSByb2FtUm9hbUNvbm5lY3RTdGF0dXNVcGRhdGVIYW5kbGVyKCBwQWRhcHRlciwgcFJvYW1JbmZvLCByb2FtSWQsIHJvYW1TdGF0dXMsIHJvYW1SZXN1bHQgKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUNTUl9ST0FNX01JQ19FUlJPUl9JTkQ6CisgICAgICAgICAgICBoYWxTdGF0dXMgPSBoZGRfUm9hbU1pY0Vycm9ySW5kaWNhdGlvbkhhbmRsZXIoIHBBZGFwdGVyLCBwUm9hbUluZm8sIHJvYW1JZCwgcm9hbVN0YXR1cywgcm9hbVJlc3VsdCApOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZUNTUl9ST0FNX0xPU1RfTElOS19QQVJBTVNfSU5EOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICogVGhlIFJTU0kgd2lsbCBiZSBzdWJ0cmFjdGVkIGZyb20gMTAwIGFzIEZXIGlzIHNlbmRpbmcgdGhlIFJTU0kgYnkKKyAgICAgICAgICAgICAgICAgKiBhZGRpbmcgdGhlIDEwMCB2YWx1ZS4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBwQWRhcHRlci0+cnNzaV9vbl9kaXNjb25uZWN0ID0gcFJvYW1JbmZvLT51LnBMb3N0TGlua1BhcmFtcy0+cnNzaSAtIDEwMDsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAiJXMgOiBSc3NpIG9uIERpc2Nvbm5lY3QgOiAlZCIsCisgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBwQWRhcHRlci0+cnNzaV9vbl9kaXNjb25uZWN0KTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fU0VUX0tFWV9DT01QTEVURToKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRfY29udGV4dF90KiBwSGRkQ3R4ID0gKGhkZF9jb250ZXh0X3QqKXBBZGFwdGVyLT5wSGRkQ3R4OworCisgICAgICAgICAgICAgICAgaWYoKHBIZGRDdHgpICYmCisgICAgICAgICAgICAgICAgICAgKFRSVUUgPT0gcEhkZEN0eC0+aGRkX3dsYW5fc3VzcGVuZGVkKSAmJgorICAgICAgICAgICAgICAgICAgIChlQ1NSX1JPQU1fUkVTVUxUX05PTkUgPT0gcm9hbVJlc3VsdCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBTZW5kIERUSU0gcGVyaW9kIHRvIHRoZSBGVzsgb25seSBpZiB0aGUgd2xhbiBpcyBhbHJlYWR5CisgICAgICAgICAgICAgICAgICAgICAgIGluIHN1c3BlbmQuIFRoaXMgaXMgdGhlIGNhc2Ugd2l0aCByb2FtaW5nIChyZWFzc29jKSwKKyAgICAgICAgICAgICAgICAgICAgICAgREVMRVRFX0JTU19SRVEgemVyb2VzIG91dCBNb2R1bGF0ZWQvRHluYW1pYyBEVElNIHNlbnQgaW4KKyAgICAgICAgICAgICAgICAgICAgICAgcHJldmlvdXMgc3VzcGVuZF93bGFuLiBTZW5kaW5nIFNFVF9QT1dFUl9QQVJBTVNfUkVRCisgICAgICAgICAgICAgICAgICAgICAgIGJlZm9yZSB0aGUgRU5URVJfQk1QU19SRVEgZW5zdXJlcyBMaXN0ZW4gSW50ZXJ2YWwgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgcmVnYWluZWQgYmFjayB0byBMSSAqIE1vZHVsYXRlZCBEVElNICovCisgICAgICAgICAgICAgICAgICAgIGhkZF9zZXRfcHdycGFyYW1zKHBIZGRDdHgpOworCisgICAgICAgICAgICAgICAgICAgIC8qIEF0IHRoaXMgcG9pbnQsIGRldmljZSBzaG91bGQgbm90IGJlIGluIEJNUFM7CisgICAgICAgICAgICAgICAgICAgICAgIGlmIGR1ZSB0byB1bmV4cGVjdGVkIHNjZW5hcmlvLCBpZiB3ZSBhcmUgaW4gQk1QUywKKyAgICAgICAgICAgICAgICAgICAgICAgdGhlbiB0cmlnZ2VyIEV4aXQgYW5kIEVudGVyIEJNUFMgdG8gdGFrZSBEVElNIHBlcmlvZAorICAgICAgICAgICAgICAgICAgICAgICBlZmZlY3RpdmUgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKEJNUFMgPT0gcG1jR2V0UG1jU3RhdGUocEhkZEN0eC0+aEhhbCkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyggTE9HRSwgRkwoIk5vdCBleHBlY3RlZDogZGV2aWNlIGlzIGFscmVhZHkgaW4gQk1QUyBtb2RlLCBFeGl0ICYgRW50ZXIgQk1QUyBhZ2FpbiEiKSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHNtZV9SZXF1ZXN0RnVsbFBvd2VyKFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXdfZnVsbF9wb3dlcl9jYmZuLCBwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNNRV9GVUxMX1BXUl9ORUVERURfQllfSEREKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmICgocEhkZEN0eCkgJiYKKyAgICAgICAgICAgICAgICAgICAgKEZVTExfUE9XRVIgPT0gcG1jR2V0UG1jU3RhdGUocEhkZEN0eC0+aEhhbCkpICYmCisgICAgICAgICAgICAgICAgICAgIChWT1NfVFJVRSA9PSBwSGRkU3RhQ3R4LT5oZGRfUmVhc3NvY1NjZW5hcmlvKSAmJgorICAgICAgICAgICAgICAgICAgICAoZUNTUl9ST0FNX1JFU1VMVF9OT05FID09IHJvYW1SZXN1bHQpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKCBMT0cxLCBGTCgiRGV2aWNlIGluIGZ1bGwgcG93ZXIuIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIlN0b3AgYW5kIHN0YXJ0IHRyYWZmaWMgdGltZXIgZm9yIHJvYW1pbmciKSk7CisgICAgICAgICAgICAgICAgICAgIHBtY1N0b3BUcmFmZmljVGltZXIocEhkZEN0eC0+aEhhbCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChwbWNTdGFydFRyYWZmaWNUaW1lcihwSGRkQ3R4LT5oSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgVFJBRkZJQ19USU1FUl9ST0FNSU5HKSAhPSBlSEFMX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0dQLCBGTCgiQ2Fubm90IHN0YXJ0IHRyYWZmaWMgdGltZXIiKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBoYWxTdGF0dXMgPSBoZGRfUm9hbVNldEtleUNvbXBsZXRlSGFuZGxlciggcEFkYXB0ZXIsIHBSb2FtSW5mbywgcm9hbUlkLCByb2FtU3RhdHVzLCByb2FtUmVzdWx0ICk7CisgICAgICAgICAgICAgICAgaWYgKGVDU1JfUk9BTV9SRVNVTFRfTk9ORSA9PSByb2FtUmVzdWx0KQorICAgICAgICAgICAgICAgICAgICBwSGRkU3RhQ3R4LT5oZGRfUmVhc3NvY1NjZW5hcmlvID0gRkFMU0U7CisgICAgICAgIC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ICAgICAgICAgICAgIGhhbFN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZUNTUl9ST0FNX1BSRUFVVEhfU1RBVFVTX1NVQ0NFU1M6CisgICAgICAgICAgIC8qIFRoaXMgZXZlbnQgd2lsbCBub3RpZnkgcHJlLWF1dGggY29tcGxldGlvbiBpbiBjYXNlIG9mIHN1Y2Nlc3MgKi8KKyAgICAgICAgICAgaWYgKFZPU19TVEFUVVNfU1VDQ0VTUyAhPQorICAgICAgICAgICAgICAgd2xhbl9oZGRfY2ZnODAyMTFfcm9hbV9tZXRyaWNzX3ByZWF1dGhfc3RhdHVzKHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mbywgMSkpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGhhbFN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZUNTUl9ST0FNX1BSRUFVVEhfU1RBVFVTX0ZBSUxVUkU6CisgICAgICAgICAgIC8qIFRoaXMgZXZlbnQgd2lsbCBub3RpZnkgcHJlLWF1dGggY29tcGxldGlvbiBpbiBjYXNlIG9mIGZhaWx1cmUuICovCisgICAgICAgICAgIGlmIChWT1NfU1RBVFVTX1NVQ0NFU1MgIT0KKyAgICAgICAgICAgICAgIHdsYW5faGRkX2NmZzgwMjExX3JvYW1fbWV0cmljc19wcmVhdXRoX3N0YXR1cyhwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8sIDApKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBoYWxTdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICB9CisgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVDU1JfUk9BTV9IQU5ET1ZFUl9TVUNDRVNTOgorICAgICAgICAgICAvKiBUaGlzIGV2ZW50IGlzIHRvIG5vdGlmeSBoYW5kb3ZlciBzdWNjZXNzLgorICAgICAgICAgICAgICBJdCB3aWxsIGJlIG9ubHkgaW52b2tlZCBvbiBzdWNjZXNzICovCisgICAgICAgICAgIGlmIChWT1NfU1RBVFVTX1NVQ0NFU1MgIT0KKyAgICAgICAgICAgICAgIHdsYW5faGRkX2NmZzgwMjExX3JvYW1fbWV0cmljc19oYW5kb3ZlcihwQWRhcHRlciwgcFJvYW1JbmZvKSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgaGFsU3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgfQorICAgICAgICAgICBicmVhazsKKyNlbmRpZgorICAgICAgICBjYXNlIGVDU1JfUk9BTV9SRU1BSU5fQ0hBTl9SRUFEWToKKyAgICAgICAgICAgIGhkZF9yZW1haW5DaGFuUmVhZHlIYW5kbGVyKCBwQWRhcHRlciApOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZUNTUl9ST0FNX1NFTkRfQUNUSU9OX0NORjoKKyAgICAgICAgICAgIGhkZF9zZW5kQWN0aW9uQ25mKCBwQWRhcHRlciwKKyAgICAgICAgICAgICAgIChyb2FtUmVzdWx0ID09IGVDU1JfUk9BTV9SRVNVTFRfTk9ORSkgPyBUUlVFIDogRkFMU0UgKTsKKyAgICAgICAgICAgIGJyZWFrOworI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgICAgICAgIGNhc2UgZUNTUl9ST0FNX1RETFNfU1RBVFVTX1VQREFURToKKyAgICAgICAgICAgIGhhbFN0YXR1cyA9IGhkZF9Sb2FtVGRsc1N0YXR1c1VwZGF0ZUhhbmRsZXIoIHBBZGFwdGVyLCBwUm9hbUluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb2FtSWQsIHJvYW1TdGF0dXMsIHJvYW1SZXN1bHQgKTsKKyAgICAgICAgICAgIGJyZWFrIDsKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fUkVTVUxUX01HTVRfVFhfQ09NUExFVEVfSU5EOgorICAgICAgICAgICAgd2xhbl9oZGRfdGRsc19tZ210X2NvbXBsZXRpb25fY2FsbGJhY2socEFkYXB0ZXIsIHBSb2FtSW5mby0+cmVhc29uQ29kZSk7CisgICAgICAgICAgICBicmVhazsKKyNlbmRpZgorI2lmZGVmIFdMQU5fRkVBVFVSRV8xMVcKKyAgICAgICBjYXNlIGVDU1JfUk9BTV9VTlBST1RfTUdNVF9GUkFNRV9JTkQ6CisgICAgICAgICAgICBoZGRfaW5kaWNhdGVVbnByb3RNZ210RnJhbWUocEFkYXB0ZXIsIHBSb2FtSW5mby0+bkZyYW1lTGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPnBiRnJhbWVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPmZyYW1lVHlwZSk7CisgICAgICAgICAgICBicmVhazsKKyNlbmRpZgorI2lmIGRlZmluZWQoRkVBVFVSRV9XTEFOX0VTRSkgJiYgZGVmaW5lZChGRUFUVVJFX1dMQU5fRVNFX1VQTE9BRCkKKyAgICAgICBjYXNlIGVDU1JfUk9BTV9UU01fSUVfSU5EOgorICAgICAgICAgICAgaGRkX2luZGljYXRlVHNtSWUocEFkYXB0ZXIsIHBSb2FtSW5mby0+dHNtSWUudHNpZCwKKyAgICAgICAgICAgICAgICBwUm9hbUluZm8tPnRzbUllLnN0YXRlLCBwUm9hbUluZm8tPnRzbUllLm1zbXRfaW50ZXJ2YWwpOworICAgICAgICAgICBicmVhazsKKworICAgICAgIGNhc2UgZUNTUl9ST0FNX0NDS01fUFJFQVVUSF9OT1RJRlk6CisgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoZUNTUl9BVVRIX1RZUEVfQ0NLTV9XUEEgPT0gcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmF1dGhUeXBlIHx8CisgICAgICAgICAgICAgICAgICBlQ1NSX0FVVEhfVFlQRV9DQ0tNX1JTTiA9PSBwSGRkU3RhQ3R4LT5jb25uX2luZm8uYXV0aFR5cGUpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGhkZF9pbmRpY2F0ZUNja21QcmVBdXRoKHBBZGFwdGVyLCBwUm9hbUluZm8pOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIH0KKworICAgICAgIGNhc2UgZUNTUl9ST0FNX0VTRV9BREpfQVBfUkVQT1JUX0lORDoKKyAgICAgICAgIHsKKyAgICAgICAgICAgICBoZGRfaW5kaWNhdGVFc2VBZGpBcFJlcEluZChwQWRhcHRlciwgcFJvYW1JbmZvKTsKKyAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIH0KKworICAgICAgIGNhc2UgZUNTUl9ST0FNX0VTRV9CQ05fUkVQT1JUX0lORDoKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGhkZF9pbmRpY2F0ZUVzZUJjblJlcG9ydEluZChwQWRhcHRlciwgcFJvYW1JbmZvKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgfQorI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9FU0UgJiYgRkVBVFVSRV9XTEFOX0VTRV9VUExPQUQgKi8KKyAgICAgICBjYXNlIGVDU1JfUk9BTV9VUERBVEVfTUFYX1JBVEVfSU5EOgorICAgICAgICAgeworICAgICAgICAgICAgcEFkYXB0ZXItPm1heFJhdGVGbGFncyA9IHJvYW1SZXN1bHQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIH0KKyAgICAgICBkZWZhdWx0OgorICAgICAgICAgICA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1JfRU5DUllQVF9UWVBFX05PTkU7CisgICAgfQorICAgIGVsc2UgaWYgKG1lbWNtcChjaXBoZXJfc3VpdGUgLCBjY3BSU05PdWkwMSwgNCkgPT0gMCkKKyAgICB7CisgICAgICAgIGNpcGhlcl90eXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfV0VQNDBfU1RBVElDS0VZOworICAgIH0KKyAgICBlbHNlIGlmIChtZW1jbXAoY2lwaGVyX3N1aXRlICwgY2NwUlNOT3VpMDUsIDQpID09IDApCisgICAgeworICAgICAgICBjaXBoZXJfdHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX1dFUDEwNF9TVEFUSUNLRVk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGNpcGhlcl90eXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfRkFJTEVEOworICAgIH0KKyAgICBoZGRMb2coTE9HMSwgRkwoImNpcGhlcl90eXBlOiAlZCIpLCBjaXBoZXJfdHlwZSk7CisgICAgcmV0dXJuIGNpcGhlcl90eXBlOworfQorLyogVG8gZmluZCBpZiB0aGUgTUFDIGFkZHJlc3MgaXMgTlVMTCAqLworc3RhdGljIHRBTklfVTggaGRkX0lzTUFDQWRkck5VTEwgKHRBTklfVTggKm1hY0FkZHIsIHRBTklfVTggbGVuZ3RoKQoreworICAgIGludCBpOworICAgIGZvciAoaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykKKyAgICB7CisgICAgICAgIGlmICgweDAwICE9IChtYWNBZGRyW2ldKSkKKyAgICAgICAgeworICAgICAgICAgICAgcmV0dXJuIEZBTFNFOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiBUUlVFOworfSAvKioqKioqIGVuZCBoZGRfSXNNQUNBZGRyTlVMTCgpICoqKioqKi8KKworZUNzckVuY3J5cHRpb25UeXBlCitoZGRfVHJhbnNsYXRlV1BBVG9Dc3JFbmNyeXB0aW9uVHlwZSh1X2ludDhfdCBjaXBoZXJfc3VpdGVbNF0pCit7CisgICA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mxhZyB0byAwICovCisgICAgbWVtc2V0KCAmZG90MTFXUEFJRSwgMCAsIHNpemVvZih0RG90MTFmSUVXUEEpICk7CisgICAgbWVtc2V0KCAmZG90MTFSU05JRSwgMCAsIHNpemVvZih0RG90MTFmSUVSU04pICk7CisKKyAgICAvLyBUeXBlIGNoZWNrCisgICAgaWYgKCBnZW5faWVbMF0gPT0gIERPVDExRl9FSURfUlNOKQorICAgIHsKKyAgICAgICAgLy8gVmFsaWRpdHkgY2hlY2tzCisgICAgICAgIGlmICgoZ2VuX2llX2xlbiA8IERPVDExRl9JRV9SU05fTUlOX0xFTiApIHx8CisgICAgICAgICAgICAgICAgKGdlbl9pZV9sZW4gPiBET1QxMUZfSUVfUlNOX01BWF9MRU4pICkKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKExPR0UsICIlczogSW52YWxpZCBET1QxMUYgUlNOIElFIGxlbmd0aCA6JWRcbiIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIGdlbl9pZV9sZW4pOworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgIH0KKyAgICAgICAgLy8gU2tpcCBwYXN0IHRoZSBFSUQgYnl0ZSBhbmQgbGVuZ3RoIGJ5dGUKKyAgICAgICAgcFJzbkllID0gZ2VuX2llICsgMjsKKyAgICAgICAgUlNOSWVMZW4gPSBnZW5faWVfbGVuIC0gMjsKKyAgICAgICAgLy8gVW5wYWNrIHRoZSBSU04gSUUKKyAgICAgICAgZG90MTFmVW5wYWNrSWVSU04oKHRwQW5pU2lyR2xvYmFsKSBoYWxIYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJzbkllLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJTTkllTGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICZkb3QxMVJTTklFKTsKKyAgICAgICAgLy8gQ29weSBvdXQgdGhlIGVuY3J5cHRpb24gYW5kIGF1dGhlbnRpY2F0aW9uIHR5cG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0ZFQVRVUkVfMTFXCisgICAgICAgICpwTWZwUmVxdWlyZWQgPSAoZG90MTFSU05JRS5SU05fQ2FwWzBdID4+IDYpICYgMHgxIDsKKyAgICAgICAgKnBNZnBDYXBhYmxlID0gKGRvdDExUlNOSUUuUlNOX0NhcFswXSA+PiA3KSAmIDB4MSA7CisjZW5kaWYKKyAgICAgICAgLy8gU2V0IHRoZSBQTUtTQSBJRCBDYWNoZSBmb3IgdGhpcyBpbnRlcmZhY2UKKyAgICAgICAgZm9yIChpPTA7IGk8ZG90MTFSU05JRS5wbWtpZF9jb3VudDsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoIHBCc3NpZCA9PSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCAiJXM6IHBCc3NpZCBwYXNzZWQgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICggaGRkX0lzTUFDQWRkck5VTEwoICh1X2NoYXIgKikgcEJzc2lkLT5ldGhlcl9hZGRyX29jdGV0ICwgNikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsICIlczogSW52YWxpZCBNQUMgYWRyciIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHVwZGF0ZVBNS0NhY2hlID0gVFJVRTsKKyAgICAgICAgICAgIC8vIEZvciByaWdodCBub3csIEkgYXNzdW1lIHNldEFTU09DSUFURSgpIGhhcyBwYXNzZWQgaW4gdGhlIGJzc2lkLgorICAgICAgICAgICAgdm9zX21lbV9jb3B5KFBNS0lEQ2FjaGVbaV0uQlNTSUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJzc2lkLCBFVEhFUl9BRERSX0xFTik7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoUE1LSURDYWNoZVtpXS5QTUtJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3QxMVJTTklFLnBta2lkW2ldLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIENTUl9SU05fUE1LSURfU0laRSk7CisgICAgICAgIH0KKworICAgICAgICBpZiAodXBkYXRlUE1LQ2FjaGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIENhbGxpbmcgY3NyUm9hbVNldFBNS0lEQ2FjaGUgdG8gY29uZmlndXJlIHRoZSBQTUtJRHMgaW50byB0aGUgY2FjaGUKKyAgICAgICAgICAgIGhkZExvZyhMT0cxLCBGTCgiJXM6IENhbGxpbmcgY3NyUm9hbVNldFBNS0lEQ2FjaGUgd2l0aCBjYWNoZSBlbnRyeSAlZC4iKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgaSApOworICAgICAgICAgICAgLy8gRmluYWxseSBzZXQgdGhlIFBNS1NBIElEIENhY2hlIGluIENTUgorICAgICAgICAgICAgcmVzdWx0ID0gc21lX1JvYW1TZXRQTUtJRENhY2hlKGhhbEhhbmRsZSxwQWRhcHRlci0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBNS0lEQ2FjaGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG90MTFSU05JRS5wbWtpZF9jb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGQUxTRSk7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoZ2VuX2llWzBdID09IERPVDExRl9FSURfV1BBKQorICAgIHsKKyAgICAgICAgLy8gVmFsaWRpdHkgY2hlY2tzCisgICAgICAgIGlmICgoZ2VuX2llX2xlbiA8IERPVDExRl9JRV9XUEFfTUlOX0xFTiApIHx8CisgICAgICAgICAgICAgICAgICAgIChnZW5faWVfbGVuID4gRE9UMTFGX0lFX1dQQV9NQVhfTEVOKSkKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKExPR0UsICIlczogSW52YWxpZCBET1QxMUYgV1BBIElFIGxlbmd0aCA6JWRcbiIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIGdlbl9pZV9sZW4pOworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgIH0KKyAgICAgICAgLy8gU2tpcCBwYXN0IHRoZSBFSUQgYnl0ZSBhbmQgbGVuZ3RoIGJ5dGUgLSBhbmQgZm91ciBieXRlIFdpRmkgT1VJCisgICAgICAgIHBSc25JZSA9IGdlbl9pZSArIDIgKyA0OworICAgICAgICBSU05JZUxlbiA9IGdlbl9pZV9sZW4gLSAoMiArIDQpOworICAgICAgICAvLyBVbnBhY2sgdGhlIFdQQSBJRQorICAgICAgICBkb3QxMWZVbnBhY2tJZVdQQSgodHBBbmlTaXJHbG9iYWwpIGhhbEhhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnNuSWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUlNOSWVMZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmRvdDExV1BBSUUpOworICAgICAgICAvLyBDb3B5IG91dCB0aGUgZW5jcnlwdGlvbiBhbmQgYXV0aGVudGljYXRpb24gdHlwZXMKKyAgICAgICAgaGRkTG9nKExPRzEsIEZMKCIlczogV1BBIHVuaWNhc3QgY2lwaGVyIHN1aXRlIGNvdW50OiAlZCIpLAorICAgICAgICAgICAgICAgX19mdW5jX18sIGRvdDExV1BBSUUudW5pY2FzdF9jaXBoZXJfY291bnQgKTsKKyAgICAgICAgaGRkTG9nKExPRzEsIEZMKCIlczogV1BBIGF1dGhlbnRpY2F0aW9uIHN1aXRlIGNvdW50OiAlZCIpLAorICAgICAgICAgICAgICAgX19mdW5jX18sIGRvdDExV1BBSUUuYXV0aF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gICAgICAgICAgICAgICAgcFJvYW1Qcm9maWxlLT5BdXRoVHlwZS5hdXRoVHlwZVswXSA9IGVDU1JfQVVUSF9UWVBFX0NDS01fV1BBOworICAgICAgICAgICAgfSBlbHNlCisjZW5kaWYKKyAgICAgICAgICAgIGlmKChwV2V4dFN0YXRlLT5hdXRoS2V5TWdtdCAmIElXX0FVVEhfS0VZX01HTVRfODAyXzFYKQorICAgICAgICAgICAgICAgICAgICA9PSBJV19BVVRIX0tFWV9NR01UXzgwMl8xWCkgeworICAgICAgICAgICAgICAgcFJvYW1Qcm9maWxlLT5BdXRoVHlwZS5hdXRoVHlwZVswXSA9IGVDU1JfQVVUSF9UWVBFX1dQQTsKKyAgICAgICAgICAgIH0gZWxzZQorICAgICAgICAgICAgaWYgKChwV2V4dFN0YXRlLT5hdXRoS2V5TWdtdCAmIElXX0FVVEhfS0VZX01HTVRfUFNLKQorICAgICAgICAgICAgICAgICAgICA9PSBJV19BVVRIX0tFWV9NR01UX1BTSykgeworICAgICAgICAgICAgICAgcFJvYW1Qcm9maWxlLT5BdXRoVHlwZS5hdXRoVHlwZVswXSA9IGVDU1JfQVVUSF9UWVBFX1dQQV9QU0s7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgcFJvYW1Qcm9maWxlLT5BdXRoVHlwZS5hdXRoVHlwZVswXSA9IGVDU1JfQVVUSF9UWVBFX1dQQV9OT05FOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChwV2V4dFN0YXRlLT53cGFWZXJzaW9uICYgSVdfQVVUSF9XUEFfVkVSU0lPTl9XUEEyKSB7CisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRQorICAgICAgICAgICAgaWYgKChSU05BdXRoVHlwZSA9PSBlQ1NSX0FVVEhfVFlQRV9DQ0tNX1JTTikgJiYKKyAgICAgICAgICAgICAgICAoKHBXZXh0U3RhdGUtPmF1dGhLZXlNZ210ICYgSVdfQVVUSF9LRVlfTUdNVF84MDJfMVgpCisgICAgICAgICAgICAgICAgID09IElXX0FVVEhfS0VZX01HTVRfODAyXzFYKSkgeworICAgICAgICAgICAgICAgIGhkZExvZyggTE9HMSwgIiVzOiBzZXQgYXV0aFR5cGUgdG8gQ0NLTSBSU04uIEFLTSBhbHNvIDgwMi4xWC4iLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgcFJvYW1Qcm9maWxlLT5BdXRoVHlwZS5hdXRoVHlwZVswXSA9IGVDU1JfQVVUSF9UWVBFX0NDS01fUlNOOworICAgICAgICAgICAgfSBlbHNlCisgICAgICAgICAgICBpZiAoKFJTTkF1dGhUeXBlID09IGVDU1JfQVVUSF9UWVBFX0NDS01fUlNOKSkgeworICAgICAgICAgICAgICAgIGhkZExvZyggTE9HMSwgIiVzOiBMYXN0IGNoYW5jZSB0byBzZXQgYXV0aFR5cGUgdG8gQ0NLTSBSU04uIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgIHBSb2FtUHJvZmlsZS0+QXV0aFR5cGUuYXV0aFR5cGVbMF0gPSBlQ1NSX0FVVEhfVFlQRV9DQ0tNX1JTTjsKKyAgICAgICAgICAgIH0gZWxzZQorI2VuZGlmCisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUgorICAgICAgICAgICAgaWYgKChSU05BdXRoVHlwZSA9PSBlQ1NSX0FVVEhfVFlQRV9GVF9SU04pICYmCisgICAgICAgICAgICAgICAgKChwV2V4dFN0YXRlLT5hdXRoS2V5TWdtdCAmIElXX0FVVEhfS0VZX01HTVRfODAyXzFYKQorICAgICAgICAgICAgICAgICA9PSBJV19BVVRIX0tFWV9NR01UXzgwMl8xWCkpIHsKKyAgICAgICAgICAgICAgIHBSb2FtUHJvZmlsZS0+QXV0aFR5cGUuYXV0aFR5cGVbMF0gPSBlQ1NSX0FVVEhfVFlQRV9GVF9SU047CisgICAgICAgICAgICB9ZWxzZQorICAgICAgICAgICAgaWYgKChSU05BdXRoVHlwZSA9PSBlQ1NSX0FVVEhfVFlQRV9GVF9SU05fUFNLKSAmJgorICAgICAgICAgICAgICAgICgocFdleHRTdGF0ZS0+YXV0aEtleU1nbXQgJiBJV19BVVRIX0tFWV9NR01UX1BTSykKKyAgICAgICAgICAgICAgICAgPT0gSVdfQVVUSF9LRVlfTUdNVF9QU0spKSB7CisgICAgICAgICAgICAgICBwUm9hbVByb2ZpbGUtPkF1dGhUeXBlLmF1dGhUeXBlWzBdID0gZUNTUl9BVVRIX1RZUEVfRlRfUlNOX1BTSzsKKyAgICAgICAgICAgIH0gZWxzZQorI2VuZGlmCisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisgICAgICAgICAgICBpZiAoUlNOQXV0aFR5cGUgPT0gZUNTUl9BVVRIX1RZUEVfUlNOX1BTS19TSEEyNTYpIHsKKyAgICAgICAgICAgICAgICBwUm9hbVByb2ZpbGUtPkF1dGhUeXBlLmF1dGhUeXBlWzBdID0gZUNTUl9BVVRIX1RZUEVfUlNOX1BTS19TSEEyNTY7CisgICAgICAgICAgICB9IGVsc2UKKyAgICAgICAgICAgIGlmIChSU05BdXRoVHlwZSA9PSBlQ1NSX0FVVEhfVFlQRV9SU05fODAyMVhfU0hBMjU2KSB7CisgICAgICAgICAgICAgICAgcFJvYW1Qcm9maWxlLT5BdXRoVHlwZS5hdXRoVHlwZVswXSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfQVVUSF9UWVBFX1JTTl84MDIxWF9TSEEyNTY7CisgICAgICAgICAgICB9IGVsc2UKKyNlbmRpZgorCisgICAgICAgICAgICBpZiggKHBXZXh0U3RhdGUtPmF1dGhLZXlNZ210ICYgSVdfQVVUSF9LRVlfTUdNVF84MDJfMVgpCisgICAgICAgICAgICAgICAgICAgID09IElXX0FVVEhfS0VZX01HTVRfODAyXzFYKSB7CisgICAgICAgICAgICAgICBwUm9hbVByb2ZpbGUtPkF1dGhUeXBlLmF1dGhUeXBlWzBdID0gZUNTUl9BVVRIX1RZUEVfUlNOOworICAgICAgICAgICAgfSBlbHNlCisgICAgICAgICAgICBpZiAoIChwV2V4dFN0YXRlLT5hdXRoS2V5TWdtdCAmIElXX0FVVEhfS0VZX01HTVRfUFNLKQorICAgICAgICAgICAgICAgICAgICA9PSBJV19BVVRIX0tFWV9NR01UX1BTSykgeworICAgICAgICAgICAgICAgcFJvYW1Qcm9maWxlLT5BdXRoVHlwZS5hdXRoVHlwZVswXSA9IGVDU1JfQVVUSF9UWVBFX1JTTl9QU0s7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgcFJvYW1Qcm9maWxlLT5BdXRoVHlwZS5hdXRoVHlwZVswXSA9IGVDU1JfQVVUSF9UWVBFX1VOS05PV047CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisKKyAgICAgICBjYXNlIGVDU1JfQVVUSF9UWVBFX1NIQVJFRF9LRVk6CisKKyAgICAgICAgICBwUm9hbVByb2ZpbGUtPkF1dGhUeXBlLmF1dGhUeXBlWzBdID0gZUNTUl9BVVRIX1RZUEVfU0hBUkVEX0tFWTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKworI2lmZGVmIEZFQVRVUkVfV0xBTl9FU0UKKyAgICAgICAgICAgaGRkTG9nKCBMT0cxLCAiJXM6IEluIGRlZmF1bHQsIHVua25vd24gYXV0aCB0eXBlLiIsIF9fZnVuY19fKTsKKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fRVNFICovCisgICAgICAgICAgIHBSb2FtUHJvZmlsZS0+QXV0aFR5cGUuYXV0aFR5cGVbMF0gPSBlQ1NSX0FVVEhfVFlQRV9VTktOT1dOOworICAgICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICBoZGRMb2coIExPRzEsICIlcyBTZXQgcm9hbSBBdXRodHlwZSB0byAlZCIsCisgICAgICAgICAgICBfX2Z1bmNfXywgcFdleHRTdGF0ZS0+cm9hbVByb2ZpbG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nBBZGFwdGVyOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgdl9VMzJfdCByb2FtSWQ7CisgICAgdENzclJvYW1Qcm9maWxlICAgICAgICAgICpwUm9hbVByb2ZpbGU7CisgICAgZU1pYl9kb3QxMURlc2lyZWRCc3NUeXBlIGNvbm5lY3RlZEJzc1R5cGU7CisgICAgZUNzckF1dGhUeXBlIFJTTkF1dGhUeXBlOworICAgIHRIYWxIYW5kbGUgaEhhbDsKKyAgICBoZGRfc3RhdGlvbl9jdHhfdCAqcEhkZFN0YUN0eDsKKyAgICBpbnQgcmV0ID0gMDsKKworICAgIEVOVEVSKCk7CisgICAgcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgICBpZiAoTlVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBBZGFwdGVyIGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIHJldCA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gcmV0KQorICAgIHsKKyAgICAgICAgcmV0dXJuIHJldDsKKyAgICB9CisKKyAgICBoSGFsID0gV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpOworICAgIGlmIChOVUxMID09IGhIYWwpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogSGFsIENvbnRleHQgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgcEhkZFN0YUN0eCA9IFdMQU5fSEREX0dFVF9TVEFUSU9OX0NUWF9QVFIocEFkYXB0ZXIpOworICAgIGlmIChOVUxMID09IHBIZGRTdGFDdHgpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogU1RBIENvbnRleHQgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgcFdleHRTdGF0ZSA9IFdMQU5fSEREX0dFVF9XRVhUX1NUQVRFX1BUUihwQWRhcHRlcik7CisgICAgaWYgKE5VTEwgPT0gcFdleHRTdGF0ZSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBwV2V4dFN0YXRlIGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIGlmKHBXZXh0U3RhdGUtPm1US0lQQ291bnRlck1lYXN1cmVzID09IFRLSVBfQ09VTlRFUl9NRUFTVVJFX1NUQVJURUQpIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICIlcyA6Q291bnRlciBtZWFzdXJlIGlzIGluIHByb2dyZXNzIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVCVVNZOworICAgIH0KKyAgICBpZiggU0lSX01BQ19NQVhfU1NJRF9MRU5HVEggPCB3cnF1LT5lc3NpZC5sZW5ndGggKQorICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICBwUm9hbVByb2ZpbGUgPSAmcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGU7CisgICAgaWYgKHBSb2F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wZS5hdXRoVHlwZVswXSA9IGVDU1JfQVVUSF9UWVBFX1dBUElfV0FJX1BTSzsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGNhc2UgV0FQSV9BVVRIX01PREVfQ0VSVDoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coTE9HMSwgIiVzOiBXQVBJIEFVVEggVFlQRTogQ0VSVDogJWQiLCBfX2Z1bmNfXywgcEFkYXB0ZXItPndhcGlfaW5mby53YXBpQXV0aE1vZGUpOworICAgICAgICAgICAgICAgIHBSb2FtUHJvZmlsZS0+QXV0aFR5cGUubnVtRW50cmllcyA9IDE7CisgICAgICAgICAgICAgICAgcFJvYW1Qcm9maWxlLT5BdXRoVHlwZS5hdXRoVHlwZVswXSA9IGVDU1JfQVVUSF9UWVBFX1dBUElfV0FJX0NFUlRJRklDQVRFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9IC8vIEVuZCBvZiBzd2l0Y2gKKyAgICAgICAgaWYgKCBwQWRhcHRlci0+d2FwaV9pbmZvLndhcGlBdXRoTW9kZSA9PSBXQVBJX0FVVEhfTU9ERV9QU0sgfHwKKyAgICAgICAgICAgICBwQWRhcHRlci0+d2FwaV9pbmZvLndhcGlBdXRoTW9kZSA9PSBXQVBJX0FVVEhfTU9ERV9DRVJUKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coTE9HMSwgIiVzOiBXQVBJIFBBSVJXSVNFL0dST1VQIEVOQ1JZUFRJT046IFdQSSIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHBSb2FtUHJvZmlsZS0+RW5jcnlwdGlvblR5cGUubnVtRW50cmllcyA9IDE7CisgICAgICAgICAgICBwUm9hbVByb2ZpbGUtPkVuY3J5cHRpb25UeXBlLmVuY3J5cHRpb25UeXBlWzBdID0gZUNTUl9FTkNSWVBUX1RZUEVfV1BJOworICAgICAgICAgICAg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DdHg7CisgICB0Q3NyUm9hbVByb2ZpbGUgKnBSb2FtUHJvZmlsZTsKKyAgIGVDc3JFbmNyeXB0aW9uVHlwZSBtY0VuY3J5cHRpb25UeXBlOworICAgZUNzckVuY3J5cHRpb25UeXBlIHVjRW5jcnlwdGlvblR5cGU7CisgICBpbnQgcmV0ID0gMDsKKworICAgRU5URVIoKTsKKworICAgcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgfQorCisgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgaWYgKDAgIT0gcmV0KQorICAgeworICAgICAgIHJldHVybiByZXQ7CisgICB9CisKKyAgIHBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKyAgIGlmIChOVUxMID09IHBIZGRTdGFDdHgpCisgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogU1RBIENvbnRleHQgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgfQorCisgICBwV2V4dFN0YXRlID0gV0xBTl9IRERfR0VUX1dFWFRfU1RBVEVfUFRSKHBBZGFwdGVyKTsKKyAgIGlmIChOVUxMID09IHBXZXh0U3RhdGUpCisgICB7CisgICAgICAgVk9TX1RSQU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gICAgICAgICAgICAgPT0gKHBXZXh0U3RhdGUtPmF1dGhLZXlNZ210ICYgSVdfQVVUSF9LRVlfTUdNVF84MDJfMVgpICApCisgICAgICAgICAgICAgICAgICYmIChlQ1NSX0FVVEhfVFlQRV9PUEVOX1NZU1RFTSA9PSBwSGRkU3RhQ3R4LT5jb25uX2luZm8uYXV0aFR5cGUpICkKKyAgICAgICAgICAgICAgICAvKkR5bmFtaWMgV0VQIGtleSovCisgICAgICAgICAgICAgdWNFbmNyeXB0aW9uVHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX1dFUDQwOworICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIC8qU3RhdGljIFdFUCBrZXkqLworICAgICAgICAgICAgIHVjRW5jcnlwdGlvblR5cGUgPSBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVA0MF9TVEFUSUNLRVk7CisgICAgICB9CisgICAgICBlbHNlIGlmKHdycXUtPnBhcmFtLnZhbHVlICYgSVdfQVVUSF9DSVBIRVJfV0VQMTA0KSB7CisKKyAgICAgICAgIGlmKCAoIElXX0FVVEhfS0VZX01HTVRfODAyXzFYCisgICAgICAgICAgICAgICAgICAgICA9PSAocFdleHRTdGF0ZS0+YXV0aEtleU1nbXQgJiBJV19BVVRIX0tFWV9NR01UXzgwMl8xWCkgKQorICAgICAgICAgICAgICAgICAmJiAoZUNTUl9BVVRIX1RZUEVfT1BFTl9TWVNURU0gPT0gcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmF1dGhUeXBlKSkKKyAgICAgICAgICAgICAgICAgIC8qRHluYW1pYyBXRVAga2V5Ki8KKyAgICAgICAgICAgIHVjRW5jcnlwdGlvblR5cGUgPSBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVAxMDQ7CisgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgLypTdGF0aWMgV0VQIGtleSovCisgICAgICAgICAgICB1Y0VuY3J5cHRpb25UeXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfV0VQMTA0X1NUQVRJQ0tFWTsKKworICAgICAgICAgfQorICAgICAgICAgZWxzZSB7CisKKyAgICAgICAgICAgICAgIGhkZExvZyhMT0dXLCAiJXMgdmFsdWUgJWQgVU5LTk9XTiBJV19BVVRIX0NJUEhFUiIsCisgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHdycXUtPnBhcmFtLnZhbHVlKTsKKyAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgfQorCisgICAgICAgICBwUm9hbVByb2ZpbGUtPkVuY3J5cHRpb25UeXBlLm51bUVudHJpZXMgPSAxOworICAgICAgICAgcFJvYW1Qcm9maWxlLT5FbmNyeXB0aW9uVHlwZS5lbmNyeXB0aW9uVHlwZVswXSA9IHVjRW5jcnlwdGlvblR5cGU7CisgICAgICB9CisgICAgICBicmVhazsKKyAgICAgIGNhc2UgSVdfQVVUSF9DSVBIRVJfR1JPVVA6CisgICAgICB7CisgICAgICAgICAgaWYod3JxdS0+cGFyYW0udmFsdWUgJiBJV19BVVRIX0NJUEhFUl9OT05FKSB7CisgICAgICAgICAgICBtY0VuY3J5cHRpb25UeXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfTk9ORTsKKyAgICAgIH0KKworICAgICAgZWxzZSBpZih3cnF1LT5wYXJhbS52YWx1ZSAmIElXX0FVVEhfQ0lQSEVSX1RLSVApIHsKKyAgICAgICAgICAgICBtY0VuY3J5cHRpb25UeXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfVEtJUDsKKyAgICAgIH0KKworICAgICAgZWxzZSBpZih3cnF1LT5wYXJhbS52YWx1ZSAmIElXX0FVVEhfQ0lQSEVSX0NDTVApIHsKKyAgICAgICAgICAgICAgbWNFbmNyeXB0aW9uVHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX0FFUzsKKyAgICAgIH0KKworICAgICAgZWxzZSBpZih3cnF1LT5wYXJhbS52YWx1ZSAmIElXX0FVVEhfQ0lQSEVSX1dFUDQwKSB7CisKKyAgICAgICAgIGlmKCAoIElXX0FVVEhfS0VZX01HTVRfODAyXzFYCisgICAgICAgICAgICAgICAgICAgICA9PSAocFdleHRTdGF0ZS0+YXV0aEtleU1nbXQgJiBJV19BVVRIX0tFWV9NR01UXzgwMl8xWCApKQorICAgICAgICAgICAgICAgICAmJiAoZUNTUl9BVVRIX1RZUEVfT1BFTl9TWVNURU0gPT0gcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmF1dGhUeXBlKSkKKworICAgICAgICAgICAgbWNFbmNyeXB0aW9uVHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX1dFUDQwOworCisgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICBtY0VuY3J5cHRpb25UeXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfV0VQNDBfU1RBVElDS0VZOworICAgICAgfQorCisgICAgICBlbHNlIGlmKHdycXUtPnBhcmFtLnZhbHVlICYgSVdfQVVUSF9DSVBIRVJfV0VQMTA0KQorICAgICAgeworICAgICAgICAgICAgIC8qRHluYW1pYyBXRVAga2V5cyB3b24ndCB3b3JrIHdpdGggc2hhcmVkIGtleXMqLworICAgICAgICAgaWYoICggSVdfQVVUSF9LRVlfTUdNVF84MDJfMVgKKyAgICAgICAgICAgICAgICAgICAgID09IChwV2V4dFN0YXRlLT5hdXRoS2V5TWdtdCAmIElXX0FVVEhfS0VZX01HTVRfODAyXzFYKSkKKyAgICAgICAgICAgICAgICAgJiYgKGVDU1JfQVVUSF9UWVBFX09QRU5fU1lTVEVNID09IHBIZGRTdGFDdHgtPmNvbm5faW5mby5hdXRoVHlwZSkpCisgICAgICAgICB7CisgICAgICAgICAgICBtY0VuY3J5cHRpb25UeXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfV0VQMTA0OworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgbWNFbmNyeXB0aW9uVHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX1dFUDEwNF9TVEFUSUNLRVk7CisgICAgICAgICB9CisgICAgICB9CisgICAgICBlbHNlIHsKKworICAgICAgICAgIGhkZExvZyhMT0dXLCAiJXMgdmFsdWUgJWQgVU5LTk9XTiBJV19BVVRIX0NJUEhFUiIsCisgICAgICAgICAgICAgICAgIF9fZnVuY19fLCB3cnF1LT5wYXJhbS52YWx1ZSk7CisgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgfQorCisgICAgICAgICBwUm9hbVByb2ZpbGUtPm1jRW5jcnlwdGlvblR5cGUubnVtRW50cmllcyA9IDE7CisgICAgICAgICBwUm9hbVByb2ZpbGUtPm1jRW5jcnlwdGlvblR5cGUuZW5jcnlwdGlvblR5cGVbMF0gPSBtY0VuY3J5cHRpb25UeXBlOworICAgICAgfQorICAgICAgYnJlYWs7CisKKyAgICAgIGNhc2UgSVdfQVVUSF84MDIxMV9BVVRIX0FMRzoKKyAgICAgIHsKKyAgICAgICAgICAgLypTYXZlIHRoZSBhdXRoIGFsZ28gaGVyZSBhbmQgc2V0IGF1dGggdHlwZSB0byBTTUUgUm9hbSBwcm9maWxlCisgICAgICAgICAgICAgICAgaW4gdGhlIGl3X3NldF9hcF9hZGRyZXNzKi8KKyAgICAgICAgICBpZiggd3JxdS0+cGFyYW0udmFsdWUgJiBJV19BVVRIX0FMR19PUEVOX1NZU1RFTSkKKyAgICAgICAgICAgICBwSGRkU3RhQ3R4LT5jb25uX2luZm8uYXV0aFR5cGUgPSBlQ1NSX0FVVEhfVFlQRV9PUEVOX1NZU1RFTTsKKworICAgICAgICAgIGVsc2UgaWYod3JxdS0+cGFyYW0udmFsdWUgJiBJV19BVVRIX0FMR19TSEFSRURfS0VZKQorICAgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5hdXRoVHlwZSA9IGVDU1JfQVVUSF9UWVBFX1NIQVJFRF9LRVk7CisKKyAgICAgICAgICBlbHNlIGlmKHdycXUtPnBhcmFtLnZhbHVlICYgSVdfQVVUSF9BTEdfTEVBUCkKKyAgICAgICAgICAgIC8qTm90IHN1cHBvcnRlZCovCisgICAgICAgICAgICAgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmF1dGhUeXBlID0gZUNTUl9BVVRIX1RZUEVfT1BFTl9TWVNURU07CisgICAgICAgICAgcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUuQXV0aFR5cGUuYXV0aFR5cGVbMF0gPSBwSGRkU3RhQ3R4LT5jb25uX2luZm8uYXV0aFR5cGU7CisgICAgICB9CisgICAgICBicmVhazsKKworICAgICAgY2FzZSBJV19BVVRIX0tFWV9NR01UOgorICAgICAgeworI2lmZGVmIEZFQVRVUkVfV0xBTl9FU0UKKyNkZWZpbmUgSVdfQVVUSF9LRVlfTUdNVF9DQ0tNICAgICAgIDggIC8qIFNob3VsZCBiZSBpbiBsaW51eC93aXJlbGVzcy5oICovCisgICAgICAgICAvKkNoZWNrIGZvciBDQ0tNIEFLTSB0eXBlICovCisgICAgICAgICBpZiAoIHdycXUtPnBhcmFtLnZhbHVlICYgSVdfQVVUSF9LRVlfTUdNVF9DQ0tNKSB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sIiVzOiBDQ0tNIEFLTSBTZXQgJWQiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCB3cnF1LT5wYXJhbS52YWx1ZSk7CisgICAgICAgICAgICAvKiBTZXQgdGhlIENDS00gYml0IGluIGF1dGhLZXlNZ210ICovCisgICAgICAgICAgICAvKiBSaWdodCBub3csIHRoaXMgYnJlYWtzIGFsbCByZWYgdG8gYXV0aEtleU1nbXQgYmVjYXVzZSBvdXIKKyAgICAgICAgICAgICAqIGNvZGUgZG9lc24ndCByZWFsaXplIGl0IGlzIGEgImJpdGZpZWxkIgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwV2V4dFN0YXRlLT5hdXRoS2V5TWdtdCB8PSBJV19BVVRIX0tFWV9NR01UX0NDS007CisgICAgICAgICAgICAvKlNldCB0aGUga2V5I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aW9uIGl3cmVxX2RhdGEgKndycXUsY2hhciAqZXh0cmEpCit7CisgICAgaGRkX2FkYXB0ZXJfdCogcEFkYXB0ZXI7CisgICAgaGRkX3dleHRfc3RhdGVfdCAqcFdleHRTdGF0ZTsKKyAgICB0Q3NyUm9hbVByb2ZpbGUgKnBSb2FtUHJvZmlsZTsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgIGludCByZXQgPSAwOworCisgICAgRU5URVIoKTsKKworICAgIHBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogQWRhcHRlciBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHJldCkKKyAgICB7CisgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorCisgICAgcFdleHRTdGF0ZSA9IFdMQU5fSEREX0dFVF9XRVhUX1NUQVRFX1BUUihwQWRhcHRlcik7CisgICAgaWYgKE5VTEwgPT0gcFdleHRTdGF0ZSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBwV2V4dFN0YXRlIGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIHBSb2FtUHJvZmlsZSA9ICZwV2V4dFN0YXRlLT5yb2FtUHJvZmlsZTsKKworICAgIHN3aXRjaChwUm9hbVByb2ZpbGUtPm5lZ290aWF0ZWRBdXRoVHlwZSkKKyAgICB7CisgICAgICAgIGNhc2UgZUNTUl9BVVRIX1RZUEVfV1BBX05PTkU6CisgICAgICAgICAgICB3cnF1LT5wYXJhbS5mbGFncyA9IElXX0FVVEhfV1BBX1ZFUlNJT047CisgICAgICAgICAgICB3cnF1LT5wYXJhbS52YWx1ZSA9ICBJV19BVVRIX1dQQV9WRVJTSU9OX0RJU0FCTEVEOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZUNTUl9BVVRIX1RZUEVfV1BBOgorICAgICAgICAgICAgd3JxdS0+cGFyYW0uZmxhZ3MgPSBJV19BVVRIX1dQQV9WRVJTSU9OOworICAgICAgICAgICAgd3JxdS0+cGFyYW0udmFsdWUgPSBJV19BVVRIX1dQQV9WRVJTSU9OX1dQQTsKKyAgICAgICAgICAgIGJyZWFrOworI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCisgICAgICAgIGNhc2UgZUNTUl9BVVRIX1RZUEVfRlRfUlNOOgorI2VuZGlmCisgICAgICAgIGNhc2UgZUNTUl9BVVRIX1RZUEVfUlNOOgorICAgICAgICAgICAgd3JxdS0+cGFyYW0uZmxhZ3MgPSBJV19BVVRIX1dQQV9WRVJTSU9OOworICAgICAgICAgICAgd3JxdS0+cGFyYW0udmFsdWUgPSAgSVdfQVVUSF9XUEFfVkVSU0lPTl9XUEEyOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICBjYXNlIGVDU1JfQVVUSF9UWVBFX09QRU5fU1lTVEVNOgorICAgICAgICAgICAgIHdycXUtPnBhcmFtLnZhbHVlID0gSVdfQVVUSF9BTEdfT1BFTl9TWVNURU07CisgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICBjYXNlIGVDU1JfQVVUSF9UWVBFX1NIQVJFRF9LRVk6CisgICAgICAgICAgICAgd3JxdS0+cGFyYW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TE9HMSwiJXMgY2FsbGVkIHdpdGggUlNOIFBTSyBhdXRoIHR5cGUiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgd3JxdS0+cGFyYW0udmFsdWUgPSBJV19BVVRIX0FMR19PUEVOX1NZU1RFTTsKKyAgICAgICAgICAgICByZXR1cm4gLUVJTzsKKyAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgaGRkTG9nKExPR0UsIiVzIGNhbGxlZCB3aXRoIHVua25vd24gYXV0aCB0eXBlIiwgX19mdW5jX18pOworICAgICAgICAgICAgIHdycXUtPnBhcmFtLnZhbHVlID0gSVdfQVVUSF9BTEdfT1BFTl9TWVNURU07CisgICAgICAgICAgICAgcmV0dXJuIC1FSU87CisgICAgfQorICAgIGlmKCgod3JxdS0+cGFyYW0uZmxhZ3MgJiBJV19BVVRIX0lOREVYKSA9PSBJV19BVVRIX0NJUEhFUl9QQUlSV0lTRSkpCisgICAgeworICAgICAgICBzd2l0Y2gocFJvYW1Qcm9maWxlLT5uZWdvdGlhdGVkVUNFbmNyeXB0aW9uVHlwZSkKKyAgICAgICAgeworICAgICAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9OT05FOgorICAgICAgICAgICAgICAgIHdycXUtPnBhcmFtLnZhbHVlID0gSVdfQVVUSF9DSVBIRVJfTk9ORTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNTUl9FTkNSWVBUX1RZUEVfV0VQNDA6CisgICAgICAgICAgICBjYXNlIGVDU1JfRU5DUllQVF9UWVBFX1dFUDQwX1NUQVRJQ0tFWToKKyAgICAgICAgICAgICAgICB3cnF1LT5wYXJhbS52YWx1ZSA9IElXX0FVVEhfQ0lQSEVSX1dFUDQwOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9US0lQOgorICAgICAgICAgICAgICAgIHdycXUtPnBhcmFtLnZhbHVlID0gSVdfQVVUSF9DSVBIRVJfVEtJUDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNTUl9FTkNSWVBUX1RZUEVfV0VQMTA0OgorICAgICAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVAxMDRfU1RBVElDS0VZOgorICAgICAgICAgICAgICAgIHdycXUtPnBhcmFtLnZhbHVlID0gSVdfQVVUSF9DSVBIRVJfV0VQMTA0OworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9BRVM6CisgICAgICAgICAgICAgICAgd3JxdS0+cGFyYW0udmFsdWUgPSBJV19BVVRIX0NJUEhFUl9DQ01QOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBoZGRMb2coTE9HMSwgIiVzIGNhbGxlZCB3aXRoIHVua25vd24gYXV0aCB0eXBlICVkICIsCisgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHBSb2FtUHJvZmlsZS0+bmVnb3RpYXRlZFVDRW5jcnlwdGlvblR5cGUpOworICAgICAgICAgICAgICAgIHJldHVybiAtRUlPOworICAgICAgICB9CisgICB9CisKKyAgICBpZigoKHdycXUtPnBhcmFtLmZsYWdzICYgSVdfQVVUSF9JTkRFWCkgPT0gSVdfQVVUSF9DSVBIRVJfR1JPVVApKQorICAgIHsKKyAgICAgICAgc3dpdGNoKHBSb2FtUHJvZmlsZS0+bmVnb3RpYXRlZE1DRW5jcnlwdGlvblR5cGUpCisgICAgICAgIHsKKyAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9OT05FOgorICAgICAgICAgICAgd3JxdS0+cGFyYW0udmFsdWUgPSBJV19BVVRIX0NJUEhFUl9OT05FOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZUNTUl9FTkNSWVBUX1RZUEVfV0VQNDA6CisgICAgICAgIGNhc2UgZUNTUl9FTkNSWVBUX1RZUEVfV0VQNDBfU1RBVElDS0VZOgorICAgICAgICAgICAgd3JxdS0+cGFyYW0udmFsdWUgPSBJV19BVVRIX0NJUEhFUl9XRVA0MDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVDU1JfRU5DUllQVF9UWVBFX1RLSVA6CisgICAgICAgICAgICB3cnF1LT5wYXJhbS52YWx1ZSA9IElXX0FVVEhfQ0lQSEVSX1RLSVA7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIGNhc2UgZUNTUl9FTkNSWVBUX1RZUEVfV0VQMTA0OgorICAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVAxMDRfU1RBVElDS0VZOgorICAgICAgICAgICAgIHdycXUtPnBhcmFtLnZhbHVlID0gSVdfQVVUSF9DSVBIRVJfV0VQMTA0OworICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9BRVM6CisgICAgICAgICAgICAgd3JxdS0+cGFyYW0udmFsdWUgPSBJV19BVVRIX0NJUEhFUl9DQ01QOworICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICBoZGRMb2coTE9HMSwgIiVzIGNhbGxlZCB3aXRoIHVua25vd24gYXV0aCB0eXBlICVkICIsCisgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHBSb2FtUHJvZmlsZS0+bmVnb3RpYXRlZE1DRW5jcnlwdGlvblR5cGUpOworICAgICAgICAgICAgcmV0dXJuIC1FSU87CisgICAgICAgfQorICAgfQorCisgICAgaGRkTG9nKExPRzEsICIlcyBjYWxsZWQgd2l0aCBhdXRoIHR5cGUgJWQiLAorICAgICAgICAgICBfX2Z1bmNfXywgcFJvYW1Qcm9maWxlLT5BdXRoVHlwZS5hdXRoVHlwZVswXSk7CisgICAgRVhJVC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AgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwordm9pZCBoZGRfaW5kaWNhdGVVbnByb3RNZ210RnJhbWUoIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5GcmFtZUxlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4KiBwYkZyYW1lcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGZyYW1lVHlwZSApCit7CisgICAgdEFOSV9VOCB0eXBlID0gMDsKKyAgICB0QU5JX1U4IHN1YlR5cGUgPSAwOworCisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXM6IEZyYW1lIFR5cGUgPSAlZCBGcmFtZSBMZW5ndGggPSAlZCIsCisgICAgICAgICAgICBfX2Z1bmNfXywgZnJhbWVUeXBlLCBuRnJhbWVMZW5ndGgpOworCisgICAgLyogU2FuaXR5IENoZWNrcyAqLworICAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgIHsKKyAgICAgICAgaGRkTG9nKCBMT0dFLCBGTCgicEFkYXB0ZXIgaXMgTlVMTCIpKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmIChOVUxMID09IHBBZGFwdGVyLT5kZXYpCisgICAgeworICAgICAgICBoZGRMb2coIExPR0UsIEZMKCJwQWRhcHRlci0+ZGV2IGlzIE5VTEwiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBpZiAoV0xBTl9IRERfQURBUFRFUl9NQUdJQyAhPSBwQWRhcHRlci0+bWFnaWMpCisgICAgeworICAgICAgICBoZGRMb2coIExPR0UsIEZMKCJwQWRhcHRlciBoYXMgaW52YWxpZCBtYWdpYyIpKTsKKyAgICAgICAgcmV0dXJuO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5cGUgPT0gU0lSX01BQ19NR01UX0RFQVVUSCkKKyAgICB7CisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLCAxMSwgMCkpCisgICAgICAgIGNmZzgwMjExX3J4X3VucHJvdF9tbG1lX21nbXQocEFkYXB0ZXItPmRldiwgcGJGcmFtZXMsIG5GcmFtZUxlbmd0aCk7CisjZWxzZQorICAgICAgICBjZmc4MDIxMV9zZW5kX3VucHJvdF9kZWF1dGgocEFkYXB0ZXItPmRldiwgcGJGcmFtZXMsIG5GcmFtZUxlbmd0aCk7CisjZW5kaWYKKyAgICAgICAgcEFkYXB0ZXItPmhkZF9zdGF0cy5oZGRQbWZTdGF0cy5udW1VbnByb3REZWF1dGhSeCsrOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBoZGRMb2coIExPR0UsIEZMKCJGcmFtZSB0eXBlICVkIGFuZCBzdWJ0eXBlICVkIGFyZSBub3QgdmFsaWQiKSwgdHlwZSwgc3ViVHlwZSk7CisgICAgICAgIHJldHVybjsKKyAgICB9Cit9CisjZW5kaWYKKworI2lmIGRlZmluZWQgKEZFQVRVUkVfV0xBTl9FU0UpICYmIGRlZmluZWQoRkVBVFVSRV9XTEFOX0VTRV9VUExPQUQpCit2b2lkIGhkZF9pbmRpY2F0ZVRzbUllKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLCB0QU5JX1U4IHRpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IHN0YXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTE2IG1lYXNJbnRlcnZhbCApCit7CisgICAgdW5pb24gaXdyZXFfZGF0YSB3cnF1OworICAgIGNoYXIgYnVmW0lXX0NVU1RPTV9NQVggKyAxXTsKKyAgICBpbnQgbkJ5dGVzID0gMDsKKworICAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgICAgICByZXR1cm47CisKKyAg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25zdCBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHRBTklfVTE2IG1lYXN1cmVtZW50VG9rZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0QU5JX0JPT0xFQU4gZmxhZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHRBTklfVTggbnVtQnNzKQoreworICAgIHVuaW9uIGl3cmVxX2RhdGEgd3JxdTsKKyAgICBjaGFyIGJ1ZltJV19DVVNUT01fTUFYXTsKKyAgICBjaGFyICpwb3MgPSBidWY7CisgICAgaW50IG5CeXRlcyA9IDAsIGZyZWVCeXRlcyA9IElXX0NVU1RPTV9NQVg7CisKKyAgICBtZW1zZXQoJndycXUsICdcMCcsIHNpemVvZih3cnF1KSk7CisgICAgbWVtc2V0KGJ1ZiwgJ1wwJywgc2l6ZW9mKGJ1ZikpOworCisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCBGTCgiQ0NYQkNOUkVQPSVkICVkICVkIiksIG1lYXN1cmVtZW50VG9rZW4sIGZsYWcsCisgICAgICAgICAgIG51bUJzcyk7CisKKyAgICBuQnl0ZXMgPSBzbnByaW50Zihwb3MsIGZyZWVCeXRlcywgIkNDWEJDTlJFUD0lZCAlZCAlZCIsIG1lYXN1cmVtZW50VG9rZW4sCisgICAgICAgICAgICAgICAgICAgICAgZmxhZywgbnVtQnNzKTsKKworICAgIHdycXUuZGF0YS5wb2ludGVyID0gYnVmOworICAgIHdycXUuZGF0YS5sZW5ndGggPSBuQnl0ZXM7CisgICAgLy8gc2VuZCB0aGUgZXZlbnQKKyAgICB3aXJlbGVzc19zZW5kX2V2ZW50KHBBZGFwdGVyLT5kZXYsIElXRVZDVVNUT00sICZ3cnF1LCBidWYpOworfQorCisKK3N0YXRpYyB2b2lkIGhkZF9pbmRpY2F0ZUVzZ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tPm51bUJzcyk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHdoaWxlIChsYXN0U2VudCA8IHBSb2FtSW5mby0+cEVzZUJjblJlcG9ydFJzcC0+bnVtQnNzKQorICAgICAgICB7CisgICAgICAgICAgICBtZW1zZXQoJndycXUsICdcMCcsIHNpemVvZih3cnF1KSk7CisgICAgICAgICAgICBtZW1zZXQoYnVmLCAnXDAnLCBzaXplb2YoYnVmKSk7CisgICAgICAgICAgICB0b3RfYmNuX2llTGVuID0gMDsKKyAgICAgICAgICAgIHNlbmRCc3MgPSAwOworICAgICAgICAgICAgcG9zID0gYnVmOworICAgICAgICAgICAgZnJlZUJ5dGVzID0gSVdfQ1VTVE9NX01BWDsKKworICAgICAgICAgICAgZm9yIChpID0gbGFzdFNlbnQ7IGkgPCBwUm9hbUluZm8tPnBFc2VCY25SZXBvcnRSc3AtPm51bUJzczsgaSsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxlbiA9IGJjblJlcEZpZWxkU2l6ZSArIGllTGVuQnl0ZSArIHBSb2FtSW5mby0+cEVzZUJjblJlcG9ydFJzcC0+YmNuUmVwQnNzSW5mb1tpXS5pZUxlbjsKKyAgICAgICAgICAgICAgICBpZiAoKGxlbiArIHRvdF9iY25faWVMZW4pID4gKElXX0NVU1RPTV9NQVggLSBFU0VCQ05SRVBIRUFERVJfTEVOKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB0b3RfYmNuX2llTGVuICs9IGxlbjsKKyAgICAgICAgICAgICAgICBzZW5kQnNzKys7CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiaSglZCkgc2l6ZW9mIGJjblJlcG9ydEZpZWxkcyglZCkiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJJZUxlbmd0aCglZCkgTGVuZ3RoIG9mIEllKCVkKSB0b3RMZW4oJWQpIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGksIGJjblJlcEZpZWxkU2l6ZSwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+cEVzZUJjblJlcG9ydFJzcC0+YmNuUmVwQnNzSW5mb1tpXS5pZUxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvdF9iY25faWVMZW4pOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICJTZW5kaW5nICVkIEJTUyBJbmZvIiwgc2VuZEJzcyk7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICJDQ1hCQ05SRVA9JWQgJWQgJWQgJWQiLAorICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+cEVzZUJjblJlcG9ydFJzcC0+bWVhc3VyZW1lbnRUb2tlbiwgcFJvYW1JbmZvLT5wRXNlQmNuUmVwb3J0UnNwLT5mbGFnLAorICAgICAgICAgICAgICAgIHNlbmRCc3MsIHRvdF9iY25faWVMZW4pOworCisgICAgICAgICAgICBuQnl0ZXMgPSBzbnByaW50Zihwb3MsIGZyZWVCeXRlcywgIkNDWEJDTlJFUD0lZCAlZCAlZCAiLAorICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+cEVzZUJjblJlcG9ydFJzcC0+bWVhc3VyZW1lbnRUb2tlbiwgcFJvYW1JbmZvLT5wRXNlQmNuUmVwb3J0UnNwLT5mbGFnLAorICAgICAgICAgICAgICAgIHNlbmRCc3MpOworICAgICAgICAgICAgcG9zICs9IG5CeXRlczsKKyAgICAgICAgICAgIGZyZWVCeXRlcyAtPSBuQnl0ZXM7CisKKyAgICAgICAgICAgIC8qIENvcHkgdG90YWwgQmVhY29uIHJlcG9ydCBkYXRhIGxlbmd0aCAqLworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBvcywgKGNoYXIqKSZ0b3RfYmNuX2llTGVuLCBzaXplb2YodG90X2Jjbl9pZUxlbikpOworICAgICAgICAgICAgcG9zICs9IHNpemVvZih0b3RfYmNuX2llTGVuKTsKKyAgICAgICAgICAgIGZyZWVCeXRlcyAtPSBzaXplb2YodG90X2Jjbl9pZUxlbik7CisKKyAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBzZW5kQnNzOyBpKyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiQ2hhbk51bSglZCkgU3BhcmUoJWQpIE1lYXNEdXJhdGlvbiglZCkiCisgICAgICAgICAgICAgICAgICAgICAgICIgUGh5VHlwZSglZCkgUmVjdlNpZ1Bvd2VyKCVkKSBQYXJlbnRUU0YoJXUpIgorICAgICAgICAgICAgICAgICAgICAgICAiIFRhcmdldFRTRlswXSgldSkgVGFyZ2V0VFNGWzFdKCV1KSBCZWFjb25JbnRlcnZhbCgldSkiCisgICAgICAgICAgICAgICAgICAgICAgICIgQ2FwYWJpbGl0eUluZm8oJWQpIEJTU0lEKCUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWDolMDJYKSIsCisgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPnBFc2VCY25SZXBvcnRSc3AtPmJjblJlcEJzc0luZm9baStsYXN0U2VudF0uYmNuUmVwb3J0RmllbGRzLkNoYW5OdW0sCisgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPnBFc2VCY25SZXBvcnRSc3AtPmJjblJlcEJzc0luZm9baStsYXN0U2VudF0uYmNuUmVwb3J0RmllbGRzLlNwYXJlLAorICAgICAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT5wRXNlQmNuUmVwb3J0UnNwLT5iY25SZXBCc3NJbmZvW2krbGFzdFNlbnRdLmJjblJlcG9ydEZpZWxkcy5NZWFzRHVyYXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPnBFc2VCY25SZXBvcnRSc3AtPmJjblJlcEJzc0luZm9baStsYXN0U2VudF0uYmNuUmVwb3J0RmllbGRzLlBoeVR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPnBFc2VCY25SZXBvcnRSc3AtPmJjblJlcEJzc0luZm9baStsYXN0U2VudF0uYmNuUmVwb3J0RmllbGRzLlJlY3ZTaWdQb3dlciwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+cEVzZUJjblJlcG9ydFJzcC0+YmNuUmVwQnNzSW5mb1tpK2xhc3RTZW50XS5iY25SZXBvcnRGaWVsZHMuUGFyZW50VHNmLAorICAgICAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT5wRXNlQmNuUmVwb3J0UnNwLT5iY25SZXBCc3NJbmZvW2krbGFzdFNlbnRdLmJjblJlcG9ydEZpZWxkcy5UYXJnZXRUc2ZbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPnBFc2VCY25SZXBvcnRSc3AtPmJjblJlcEJzc0luZm9baStsYXN0U2VudF0uYmNuUmVwb3J0RmllbGRzLlRhcmdldFRzZlsxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+cEVzZUJjblJlcG9ydFJzcC0+YmNuUmVwQnNzSW5mb1tpK2xhc3RTZW50XS5iY25SZXBvcnRGaWVsZHMuQmNuSW50ZXJ2YWwsCisgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPnBFc2VCY25SZXBvcnRSc3AtPmJjblJlcEJzc0luZm9baStsYXN0U2VudF0uYmNuUmVwb3J0RmllbGRzLkNhcGFiaWxpdHlJbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT5wRXNlQmNuUmVwb3J0UnNwLT5iY25SZXBCc3NJbmZvW2krbGFzdFNlbnRdLmJjblJlcG9ydEZpZWxkcy5Cc3NpZFswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+cEVzZUJjblJlcG9ydFJzcC0+YmNuUmVwQnNzSW5mb1tpK2xhc3RTZW50XS5iY25SZXBvcnRGaWVsZHMuQnNzaWRbMV0sCisgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPnBFc2VCY25SZXBvcnRSc3AtPmJjblJlcEJzc0luZm9baStsYXN0U2VudF0uYmNuUmVwb3J0RmllbGRzLkJzc2lkWzJdLAorICAgICAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT5wRXNlQmNuUmVwb3J0UnNwLT5iY25SZXBCc3NJbmZvW2krbGFzdFNlbnRdLmJjblJlcG9ydEZpZWxkcy5Cc3NpZFszXSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+cEVzZUJjblJlcG9ydFJzcC0+YmNuUmVwQnNzSW5mb1tpK2xhc3RTZW50XS5iY25SZXBvcnRGaWVsZHMuQnNzaWRbNF0sCisgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPnBFc2VCY25SZXBvcnRSc3AtPmJjblJlcEJzc0luZm9baStsYXN0U2VudF0uYmNuUmVwb3J0RmllbGRzLkJzc2lkWzVdKTsKKworICAgICAgICAgICAgICAgIC8qIGJjbiByZXBvcnQgZmllbGRzIGFyZSBjb3BpZWQgKi8KKyAgICAgICAgICAgICAgICBsZW4gPSBzaXplb2YocFJvYW1JbmZvLT5wRXNlQmNuUmVwb3J0UnNwLT5iY25SZXBCc3NJbmZvW2krbGFzdFNlbnRdLmJjblJlcG9ydEZpZWxkcyk7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBvcywgKGNoYXIqKSZwUm9hbUluZm8tPnBFc2VCY25SZXBvcnRSc3AtPmJjblJlcEJzc0luZm9baStsYXN0U2VudF0uYmNuUmVwb3J0RmllbGRzLCBsZW4pOworICAgICAgICAgICAgICAgIHBvcyArPSBsZW47CisgICAgICAgICAgICAgICAgZnJlZUJ5dGVzIC09IGxlbjsKKworICAgICAgICAgICAgICAgIC8qIEFkZCAxIGJ5dGUgb2YgaWUgbGVuICovCisgICAgICAgICAgICAgICAgbGVuID0gcFJvYW1JbmZvLT5wRXNlQmNuUmVwb3J0UnNwLT5iY25SZXBCc3NJbmZvW2krbGFzdFNlbnRdLmllTGVuOworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwb3MsIChjaGFyKikmbGVuLCBzaXplb2YobGVuKSk7CisgICAgICAgICAgICAgICAgcG9zICs9IHNpemVvZihsZW4pOworICAgICAgICAgICAgICAgIGZyZWVCeXRlcyAtPSBzaXplb2YobGVuKTsKKworICAgICAgICAgICAgICAgIC8qIGNvcHkgSUUgZnJvbSBzY2FuIHJlc3VsdHMgKi8KKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocG9zLCAoY2hhciopcFJvYW1JbmZvLT5wRXNlQmNuUmVwb3J0UnNwLT5iY25SZXBCc3NJbmZvW2krbGFzdFNlbnRdLnBCdWYsIGxlbik7CisgICAgICAgICAgICAgICAgcG9zICs9IGxlbjsKKyAgICAgICAgICAgICAgICBmcmVlQnl0ZXMgLT0gbGVuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB3cnF1LmRhdGEucG9pbnRlciA9IGJ1ZjsKKyAgICAgICAgICAgIHdycXUuZGF0YS5sZW5ndGggPSBzdHJsZW4oYnVmKTsKKworICAgICAgICAgICAgLy8gc2VuZCB0aGUgZXZlbnQKKyAgICAgICAgICAgIHdpcmVsZXNzX3NlbmRfZXZlbnQocEFkYXB0ZXItPmRldiwgSVdFVkNVU1RPTSwgJndycXUsIGJ1Zik7CisgICAgICAgICAgICBsYXN0U2VudCArPSBzZW5kQnNzOworICAgICAgICB9CisgICAgfQorfQorCisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0VTRSAmJiBGRUFUVVJFX1dMQU5fRVNFX1VQTE9BRCAqLworCmRpZmYgLS1naXQgYS93bGFuL3ByaW1hL0NPUkUvSEREL3NyYy93b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MRF9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgRnJhZ21lbnRhdGlvblRocmVzaG9sZCwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfRlJBR19USFJFU0hPTERfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0ZSQUdfVEhSRVNIT0xEX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX0ZSQUdfVEhSRVNIT0xEX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19DQUxJQlJBVElPTl9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgQ2FsaWJyYXRpb24sCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0NBTElCUkFUSU9OX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19DQUxJQlJBVElPTl9NSU4sCisgICAgICAgICAgICAgICAgIENGR19DQUxJQlJBVElPTl9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfQ0FMSUJSQVRJT05fUEVSSU9EX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBDYWxpYnJhdGlvblBlcmlvZCwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfQ0FMSUJSQVRJT05fUEVSSU9EX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19DQUxJQlJBVElPTl9QRVJJT0RfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfQ0FMSUJSQVRJT05fUEVSSU9EX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19PUEVSQVRJTkdfQ0hBTk5FTF9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgT3BlcmF0aW5nQ2hhbm5lbCwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfT1BFUkFUSU5HX0NIQU5ORUxfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX09QRVJBVElOR19DSEFOTkVMX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX09QRVJBVElOR19DSEFOTkVMX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19TSE9SVF9TTE9UX1RJTUVfRU5BQkxFRF9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgU2hvcnRTbG90VGltZUVuYWJsZWQsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDSywKKyAgICAgICAgICAgICAgICAgQ0ZHX1NIT1JUX1NMT1RfVElNRV9FTkFCTEVEX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19TSE9SVF9TTE9UX1RJTUVfRU5BQkxFRF9NSU4sCisgICAgICAgICAgICAgICAgIENGR19TSE9SVF9TTE9UX1RJTUVfRU5BQkxFRF9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfMTFEX1NVUFBPUlRfRU5BQkxFRF9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgSXMxMWRTdXBwb3J0RW5hYmxlZCwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLLAorICAgICAgICAgICAgICAgICBDRkdfMTFEX1NVUFBPUlRfRU5BQkxFRF9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfMTFEX1NVUFBPUlRfRU5BQkxFRF9NSU4sCisgICAgICAgICAgICAgICAgIENGR18xMURfU1VQUE9SVF9FTkFCTEVEX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR18xMUhfU1VQUE9SVF9FTkFCTEVEX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBJczExaFN1cHBvcnRFbmFibGVkLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0ssCisgICAgICAgICAgICAgICAgIENGR18xMUhfU1VQUE9SVF9FTkFCTEVEX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR18xMUhfU1VQUE9SVF9FTkFCTEVEX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHXzExSF9TVVBQT1JUX0VOQUJMRURfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX0VORk9SQ0VfMTFEX0NIQU5ORUxTX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBmRW5mb3JjZTExZENoYW5uZWxzLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0ssCisgICAgICAgICAgICAgICAgIENGR19FTkZPUkNFXzExRF9DSEFOTkVMU19ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfRU5GT1JD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sIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBmRW5mb3JjZURlZmF1bHREb21haW4sCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDSywKKyAgICAgICAgICAgICAgICAgQ0ZHX0VORk9SQ0VfREVGQVVMVF9ET01BSU5fREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0VORk9SQ0VfREVGQVVMVF9ET01BSU5fTUlOLAorICAgICAgICAgICAgICAgICBDRkdfRU5GT1JDRV9ERUZBVUxUX0RPTUFJTl9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfR0VORVJJQ19JRDFfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIENmZzFJZCwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfR0VORVJJQ19JRDFfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0dFTkVSSUNfSUQxX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX0dFTkVSSUNfSUQxX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19HRU5FUklDX0lEMl9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgQ2ZnMklkLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19HRU5FUklDX0lEMl9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfR0VORVJJQ19JRDJfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfR0VORVJJQ19JRDJfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX0dFTkVSSUNfSUQzX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBDZmczSWQsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0dFTkVSSUNfSUQzX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19HRU5FUklDX0lEM19NSU4sCisgICAgICAgICAgICAgICAgIENGR19HRU5FUklDX0lEM19NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfR0VORVJJQ19JRDRfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIENmZzRJZCwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfR0VORVJJQ19JRDRfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0dFTkVSSUNfSUQ0X01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX0dFTkVSSUNfSUQ0X01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19HRU5FUklDX0lENV9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgQ2ZnNUlkLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19HRU5FUklDX0lENV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfR0VORVJJQ19JRDVfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfR0VORVJJQ19JRDVfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX0dFTkVSSUNfVkFMVUUxX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBDZmcxVmFsdWUsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0dFTkVSSUNfVkFMVUUxX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19HRU5FUklDX1ZBTFVFMV9NSU4sCisgICAgICAgICAgICAgICAgIENGR19HRU5FUklDX1ZBTFVFMV9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfR0VORVJJQ19WQUxVRTJfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIENmZzJWYWx1ZSwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfR0VORVJJQ19WQUxVRTJfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0dFTkVSSUNfVkFMVUUyX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX0dFTkVSSUNfVkFMVUUyX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19HRU5FUklDX1ZBTFVFM19OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgQ2ZnM1ZhbHVlLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19HRU5FUklDX1ZBTFVFM19ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfR0VORVJJQ19WQUxVRTNfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfR0VORVJJQ19WQUxVRTNfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX0dFTkVSSUNfVkFMVUU0X05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBDZmc0VmFsdWUsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0dFTkVSSUNfVkFMVUU0X0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19HRU5FUklDX1ZBTFVFNF9NSU4sCisgICAgICAgICAgICAgICAgIENGR19HRU5FUklDX1ZBTFVFNF9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfR0VORVJJQ19WQUxVRTVfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIENmZzVWYWx1ZSwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfR0VORVJJQ19WQUxVRTVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0dFTkVSSUNfVkFMVUU1X01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX0dFTkVSSUNfVkFMVUU1X01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19IRUFSVEJFQVRfVEhSRVNIXzI0X05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBIZWFydGJlYXRUaHJlc2gyNCwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfSEVBUlRCRUFUX1RIUkVTSF8yNF9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfSEVBUlRCRUFUX1RIUkVTSF8yNF9NSU4sCisgICAgICAgICAgICAgICAgIENGR19IRUFSVEJFQVRfVEhSRVNIXzI0X01BWCApLAorCisgICBSRUdfVkFSSUFCTEVfU1RSSU5HKCBDRkdfUE9XRVJfVVNBR0VfTkFNRSwgV0xBTl9QQVJBTV9TdHJpbmcsCisgICAgICAgICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIFBvd2VyVXNhZ2VDb250cm9sLAorICAgICAgICAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMLAorICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilDRkdfUE9XRVJfVVNBR0VfREVGQVVMVCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19FTkFCTEVfU1VTUEVORF9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgbkVuYWJsZVN1c3BlbmQsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0VOQUJMRV9TVVNQRU5EX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19FTkFCTEVfU1VTUEVORF9NSU4sCisgICAgICAgICAgICAgICAgIENGR19FTkF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X0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfU1NSX1BBTklDX09OX0ZBSUxVUkVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1NTUl9QQU5JQ19PTl9GQUlMVVJFX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX1NTUl9QQU5JQ19PTl9GQUlMVVJFX01BWCksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX0VOQUJMRV9MT0dQX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBmSXNMb2dwRW5hYmxlZCwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfRU5BQkxFX0xPR1BfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0VOQUJMRV9MT0dQX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX0VOQUJMRV9MT0dQX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19JTVBTX01JTklNVU1fU0xFRVBfVElNRV9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgbkltcHNNaW5TbGVlcFRpbWUsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0lNUFNfTUlOSU1VTV9TTEVFUF9USU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19JTVBTX01JTklNVU1fU0xFRVBfVElNRV9NSU4sCisgICAgICAgICAgICAgICAgIENGR19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ICAgICAgaGRkX2NvbmZpZ190LCBuSW1wc01vZFNsZWVwVGltZSwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfSU1QU19NT0RFUkFURV9TTEVFUF9USU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19JTVBTX01PREVSQVRFX1NMRUVQX1RJTUVfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfSU1QU19NT0RFUkFURV9TTEVFUF9USU1FX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19FTkFCTEVfQk1QU19OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgZklzQm1wc0VuYWJsZWQsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0VOQUJMRV9CTVBTX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19FTkFCTEVfQk1QU19NSU4sCisgICAgICAgICAgICAgICAgIENGR19FTkFCTEVfQk1QU19NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfQk1QU19NSU5JTVVNX0xJX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBuQm1wc01pbkxpc3RlbkludGVydmFsLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19CTVBTX01JTklNVU1fTElfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0JNUFNfTUlOSU1VTV9MSV9NSU4sCisgICAgICAgICAgICAgICAgIENGR19CTVBTX01JTklNVU1fTElfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX0JNUFNfTUFYSU1VTV9MSV9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgbkJtcHNNYXhMaXN0ZW5JbnRlcnZhbCwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfQk1QU19NQVhJTVVNX0xJX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19CTVBTX01BWElNVU1fTElfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfQk1QU19NQVhJTVVNX0xJX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19CTVBTX01PREVSQVRFX0xJX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBuQm1wc01vZExpc3RlbkludGVydmFsLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19CTVBTX01PREVSQVRFX0xJX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19CTVBTX01PREVSQVRFX0xJX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX0JNUFNfTU9ERVJBVEVfTElfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX0VOQUJMRV9BVVRPX0JNUFNfVElNRVJfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGZJc0F1dG9CbXBzVGltZXJFbmFibGVkLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19FTkFCTEVfQVVUT19CTVBTX1RJTUVSX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19FTkFCTEVfQVVUT19CTVBTX1RJTUVSX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX0VOQUJMRV9BVVRPX0JNUFNfVElNRVJfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX0FVVE9fQk1QU19USU1FUl9WQUxVRV9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgbkF1dG9CbXBzVGltZXJWYWx1ZSwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfQVVUT19CTVBTX1RJTUVSX1ZBTFVFX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19BVVRPX0JNUFNfVElNRVJfVkFMVUVfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfQVVUT19CTVBTX1RJTUVSX1ZBTFVFX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19ET1QxMV9NT0RFX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBkb3QxMU1vZGUsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDSywKKyAgICAgICAgICAgICAgICAgQ0ZHX0RPVDExX01PREVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0RPVDExX01PREVfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfRE9UMTFfTU9ERV9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfQ0hBTk5FTF9CT05ESU5HX01PREVfMjRHSFpfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG5DaGFubmVsQm9uZGluZ01vZGUyNEdIeiwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLLAorICAgICAgICAgICAgICAgICBDRkdfQ0hBTk5FTF9CT05ESU5HX01PREVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0NIQU5ORUxfQk9ORElOR19NT0RFX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX0NIQU5ORUxfQk9ORElOR19NT0RFX01BWCksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX0NIQU5ORUxfQk9ORElOR19NT0RFXzVHSFpfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG5DaGFubmVsQm9uZGluZ01vZGU1R0h6LAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0ssCisgICAgICAgICAgICAgICAgIENGR19DSEFOTkVMX0JPTkRJTkdfTU9ERV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfQ0hBTk5FTF9CT05ESU5HX01PREVfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfQ0hBTk5FTF9CT05ESU5HX01PREVfTUFYKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfTUFYX1JYX0FNUERVX0ZBQ1RPUl9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgTWF4UnhBbXBkdUZhY3RvciwKKyAgICAgICAgICAgICA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T19TRVRVUF9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgQmxvY2tBY2tBdXRvU2V0dXAsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDSywKKyAgICAgICAgICAgICAgICAgQ0ZHX0JMT0NLX0FDS19BVVRPX1NFVFVQX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19CTE9DS19BQ0tfQVVUT19TRVRVUF9NSU4sCisgICAgICAgICAgICAgICAgIENGR19CTE9DS19BQ0tfQVVUT19TRVRVUF9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfU0NBTl9SRVNVTFRfQUdFX0NPVU5UX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBTY2FuUmVzdWx0QWdlQ291bnQsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDSywKKyAgICAgICAgICAgICAgICAgQ0ZHX1NDQU5fUkVTVUxUX0FHRV9DT1VOVF9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfU0NBTl9SRVNVTFRfQUdFX0NPVU5UX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX1NDQU5fUkVTVUxUX0FHRV9DT1VOVF9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfU0NBTl9SRVNVTFRfQUdFX1RJTUVfTkNOUFNfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG5TY2FuQWdlVGltZU5DTlBTLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0ssCisgICAgICAgICAgICAgICAgIENGR19TQ0FOX1JFU1VMVF9BR0VfVElNRV9OQ05QU19ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfU0NBTl9SRVNVTFRfQUdFX1RJTUVfTkNOUFNfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfU0NBTl9SRVNVTFRfQUdFX1RJTUVfTkNOUFNfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX1NDQU5fUkVTVUxUX0FHRV9USU1FX05DUFNfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG5TY2FuQWdlVGltZU5DUFMsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDSywKKyAgICAgICAgICAgICAgICAgQ0ZHX1NDQU5fUkVTVUxUX0FHRV9USU1FX05DUFNfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1NDQU5fUkVTVUxUX0FHRV9USU1FX05DUFNfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfU0NBTl9SRVNVTFRfQUdFX1RJTUVfTkNQU19NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfU0NBTl9SRVNVTFRfQUdFX1RJTUVfQ05QU19OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgblNjYW5BZ2VUaW1lQ05QUywKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLLAorICAgICAgICAgICAgICAgICBDRkdfU0NBTl9SRVNVTFRfQUdFX1RJTUVfQ05QU19ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfU0NBTl9SRVNVTFRfQUdFX1RJTUVfQ05QU19NSU4sCisgICAgICAgICAgICAgICAgIENGR19TQ0FOX1JFU1VMVF9BR0VfVElNRV9DTlBTX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19TQ0FOX1JFU1VMVF9BR0VfVElNRV9DUFNfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG5TY2FuQWdlVGltZUNQUywKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLLAorICAgICAgICAgICAgICAgICBDRkdfU0NBTl9SRVNVTFRfQUdFX1RJTUVfQ1BTX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19TQ0FOX1JFU1VMVF9BR0VfVElNRV9DUFNfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfU0NBTl9SRVNVTFRfQUdFX1RJTUVfQ1BTX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19SU1NJX0NBVEVHT1JZX0dBUF9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgblJzc2lDYXRHYXAsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1JTU0lfQ0FURUdPUllfR0FQX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19SU1NJX0NBVEVHT1JZX0dBUF9NSU4sCisgICAgICAgICAgICAgICAgIENGR19SU1NJX0NBVEVHT1JZX0dBUF9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfU0hPUlRfUFJFQU1CTEVfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGZJc1Nob3J0UHJlYW1ibGUsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1NIT1JUX1BSRUFNQkxFX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19TSE9SVF9QUkVBTUJMRV9NSU4sCisgICAgICAgICAgICAgICAgIENGR19TSE9SVF9QUkVBTUJMRV9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfSUJTU19BVVRPX0JTU0lEX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBmSXNBdXRvSWJzc0Jzc2lkLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19JQlNTX0FVVE9fQlNTSURfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0lCU1NfQVVUT19CU1NJRF9NSU4sCisgICAgICAgICAgICAgICAgIENGR19JQlNTX0FVVE9fQlNTSURfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRV9TVFJJTkcoIENGR19JQlNTX0JTU0lEX05BTUUsIFdMQU5fUEFSQU1fTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgSWJzc0Jzc2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMLAorICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilDRkdfSUJTU19CU1NJRF9ERUZBVUxUICksCisKKyAgIFJFR19WQVJJQUJMRV9TVFJJTkcoIENGR19JTlRGMF9NQUNfQUREUl9OQU1FLCBXTEFOX1BBUkFNX01hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGludGZNYWNBZGRyWzBdLAorICAgICAgICAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMLAorICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilDRkdfSU5URjBfTUFDX0FERFJfREVGQVVMVCApLAorCisgICBSRUdfVkFSSUFCTEVfU1RSSU5HKCBDRkdfSU5URjFfTUFDX0FERFJfTkFNRSwgV0xBTl9QQVJBTV9NYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBpbnRmTWFjQWRkclsxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopQ0ZHX0lOVEYxX01BQ19BRERSX0RFRkFVTFQgKSwKKworICAgUkVHX1ZBUklBQkxFX1NUUklORyggQ0ZHX0lOVEYyX01BQ19BRERSX05BTUUsIFdMQU5fUEFSQU1fTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgaW50Zk1hY0FkZHJbMl0sCisgICAgICAgICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwsCisgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKUNGR19JTlRGMl9NQUNfQUREUl9ERUZBVUxUICksCisKKyAgIFJFR19WQVJJQUJMRV9TVFJJTkcoIENGR19JTlRGM19NQUNfQUREUl9OQU1FLCBXTEFOX1BBUkFNX01hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGludGZNYWNBZGRyWzNdLAorICAgICAgICAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMLAorICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilDRkdfSU5URjNfTUFDX0FERFJfREVGQVVMVCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19BUF9RT1NfVUFQU0RfTU9ERV9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGFwVWFwc2RFbmFibGVkLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19BUF9RT1NfVUFQU0RfTU9ERV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfQVBfUU9TX1VBUFNEX01PREVfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfQVBfUU9TX1VBUFNEX01PREVfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRV9TVFJJTkcoIENGR19BUF9DT1VOVFJZX0NPREUsIFdMQU5fUEFSQU1fU3RyaW5nLAorICAgICAgICAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBhcENudHJ5Q29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopQ0ZHX0FQX0NPVU5UUllfQ09ERV9ERUZBVUxUICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX0FQX0VOQUJMRV9SQU5ET01fQlNTSURfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBhcFJhbmRvbUJzc2lkRW5hYmxlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgICAgICAgIENGR19BUF9FTkFCTEVfUkFORE9NX0JTU0lEX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgICAgICAgICBDRkdfQVBfRU5BQkxFX1JBTkRPTV9CU1NJRF9NSU4sCisgICAgICAgICAgICAgICAgICAgICAgICBDRkdfQVBfRU5BQkxFX1JBTkRPTV9CU1NJRF9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfQVBfRU5BQkxFX1BST1RFQ1RJT05fTU9ERV9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGFwUHJvdEVuYWJsZWQsCisgICAgICAgICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgICAgICAgICBDRkdfQVBfRU5BQkxFX1BST1RFQ1RJT05fTU9ERV9ERUZBVUxULAorICAgICAgICAgICAgICAgICAgICAgICAgQ0ZHX0FQX0VOQUJMRV9QUk9URUNUSU9OX01PREVfTUlOLAorICAgICAgICAgICAgICAgICAgICAgICAgQ0ZHX0FQX0VOQUJMRV9QUk9URUNUSU9OX01PREVfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX0FQX1BST1RFQ1RJT05fTU9ERV9OQU1FLCBXTEFOX1BBUkFNX0hleEludGVnZXIsCisgICAgICAgICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGFwUHJvdGVjdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgICAgICAgIENGR19BUF9QUk9URUNUSU9OX01PREVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgICAgICAgIENGR19BUF9QUk9URUNUSU9OX01PREVfTUlOLAorICAgICAgICAgICAgICAgICAgICAgICAgQ0ZHX0FQX1BST1RFQ1RJT05fTU9ERV9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfQVBfT0JTU19QUk9URUNUSU9OX01PREVfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBhcE9CU1NQcm90RW5hYmxlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgICAgICAgIENGR19BUF9PQlNTX1BST1RFQ1RJT05fTU9ERV9ERUZBVUxULAorICAgICAgICAgICAgICAgICAgICAgICAgQ0ZHX0FQX09CU1NfUFJPVEVDVElPTl9NT0RFX01JTiwKKyAgICAgICAgICAgICAgICAgICAgICAgIENGR19BUF9PQlNTX1BST1RFQ1RJT05fTU9ERV9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfQVBfU1RBX1NFQ1VSSVRZX1NFUEVSQVRJT05fTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBhcERpc2FibGVJbnRyYUJzc0Z3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgICAgICAgIENGR19BUF9TVEFfU0VDVVJJVFlfU0VQRVJBVElPTl9ERUZBVUxULAorICAgICAgICAgICAgICAgICAgICAgICAgQ0ZHX0FQX1NUQV9TRUNVUklUWV9TRVBFUkFUSU9OX01JTiwKKyAgICAgICAgICAgICAgICAgICAgICAgIENGR19BUF9TVEFfU0VDVVJJVFlfU0VQRVJBVElPTl9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfRlJBTUVTX1BST0NFU1NJTkdfVEhfTU9ERV9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIE1pbkZyYW1lc1Byb2NUaHJlc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QVVUT19DSEFOTkVMX1NFTEVDVElPTl9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfU0FQX0FVVE9fQ0hBTk5FTF9TRUxFQ1RJT05fTUlOLAorICAgICAgICAgICAgICAgICBDRkdfU0FQX0FVVE9fQ0hBTk5FTF9TRUxFQ1RJT05fTUFYICksCisKKyAgIFJFR19WQVJJQUJMRShDRkdfRU5BQkxFX0xURV9DT0VYICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGVuYWJsZUxURUNvZXgsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0VOQUJMRV9MVEVfQ09FWF9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfRU5BQkxFX0xURV9DT0VYX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX0VOQUJMRV9MVEVfQ09FWF9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfQVBfS0VFUF9BTElWRV9QRVJJT0RfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGFwS2VlcEFsaXZlUGVyaW9kLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19BUF9LRUVQX0FMSVZFX1BFUklPRF9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfQVBfS0VFUF9BTElWRV9QRVJJT0RfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfQVBfS0VFUF9BTElWRV9QRVJJT0RfTUFYKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfR09fS0VFUF9BTElWRV9QRVJJT0RfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGdvS2VlcEFsaXZlUGVyaW9kLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19HT19LRUVQX0FMSVZFX1BFUklPRF9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfR09fS0VFUF9BTElWRV9QRVJJT0RfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfR09fS0VFUF9BTElWRV9QRVJJT0RfTUFYKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfQVBfTElOS19NT05JVE9SX1BFUklPRF9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgYXBMaW5rTW9uaXRvclBlcmlvZCwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfQVBfTElOS19NT05JVE9SX1BFUklPRF9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfQVBfTElOS19NT05JVE9SX1BFUklPRF9NSU4sCisgICAgICAgICAgICAgICAgIENGR19BUF9MSU5LX01PTklUT1JfUEVSSU9EX01BWCksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX0dPX0xJTktfTU9OSVRPUl9QRVJJT0RfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGdvTGlua01vbml0b3JQZXJpb2QsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1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VTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0FDVElWRV9NSU5fQ0hBTk5FTF9USU1FX0JUQ19ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfQUNUSVZFX01JTl9DSEFOTkVMX1RJTUVfQlRDX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX0FDVElWRV9NSU5fQ0hBTk5FTF9USU1FX0JUQ19NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUkVUUllfTElNSVRfWkVST19OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgcmV0cnlMaW1pdFplcm8sCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1JFVFJZX0xJTUlUX1pFUk9fREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1JFVFJZX0xJTUlUX1pFUk9fTUlOLAorICAgICAgICAgICAgICAgICBDRkdfUkVUUllfTElNSVRfWkVST19NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUkVUUllfTElNSVRfT05FX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCByZXRyeUxpbWl0T25lLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19SRVRSWV9MSU1JVF9PTkVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1JFVFJZX0xJTUlUX09ORV9NSU4sCisgICAgICAgICAgICAgICAgIENGR19SRVRSWV9MSU1JVF9PTkVfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX1JFVFJZX0xJTUlUX1RXT19OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgcmV0cnlMaW1pdFR3bywKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfUkVUUllfTElNSVRfVFdPX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19SRVRSWV9MSU1JVF9UV09fTUlOLAorICAgICAgICAgICAgICAgICBDRkdfUkVUUllfTElNSVRfVFdPX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19ESVNBQkxFX0FHR19XSVRIX0JUQ19OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgZGlzYWJsZUFnZ1dpdGhCdGMsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0RJU0FCTEVfQUdHX1dJVEhfQlRDX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19ESVNBQkxFX0FHR19XSVRIX0JUQ19NSU4sCisgICAgICAgICAgICAgICAgIENGR19ESVNBQkxFX0FHR19XSVRIX0JUQ19NQVggKSwKKworI2lmZGVmIFdMQU5fQVBfU1RBX0NPTkNVUlJFTkNZCisgICBSRUdfVkFSSUFCTEUoIENGR19QQVNTSVZFX01BWF9DSEFOTkVMX1RJTUVfQ09OQ19OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgblBhc3NpdmVNYXhDaG5UaW1lQ29uYywKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQU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BDRkdfUkVTVF9USU1FX0NPTkNfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX05VTV9TVEFfQ0hBTl9DT01CSU5FRF9DT05DX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBuTnVtU3RhQ2hhbkNvbWJpbmVkQ29uYywKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTlVNX1NUQV9DSEFOX0NPTUJJTkVEX0NPTkNfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX05VTV9TVEFfQ0hBTl9DT01CSU5FRF9DT05DX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX05VTV9TVEFfQ0hBTl9DT01CSU5FRF9DT05DX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19OVU1fUDJQX0NIQU5fQ09NQklORURfQ09OQ19OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgbk51bVAyUENoYW5Db21iaW5lZENvbmMsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX05VTV9QMlBfQ0hBTl9DT01CSU5FRF9DT05DX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19OVU1fUDJQX0NIQU5fQ09NQklORURfQ09OQ19NSU4sCisgICAgICAgICAgICAgICAgIENGR19OVU1fUDJQX0NIQU5fQ09NQklORURfQ09OQ19NQVggKSwKKyNlbmRpZgorCisgICBSRUdfVkFSSUFCTEUoIENGR19NQVhfUFNfUE9MTF9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgbk1heFBzUG9sbCwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTUFYX1BTX1BPTExfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01BWF9QU19QT0xMX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX01BWF9QU19QT0xMX01BWCApLAorCisgICAgUkVHX1ZBUklBQkxFKCBDRkdfTUFYX1RYX1BPV0VSX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBuVHhQb3dlckNhcCwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTUFYX1RYX1BPV0VSX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NQVhfVFhfUE9XRVJfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTUFYX1RYX1BPV0VSX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19MT1dfR0FJTl9PVkVSUklERV9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgZklzTG93R2Fpbk92ZXJyaWRlLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19MT1dfR0FJTl9PVkVSUklERV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTE9XX0dBSU5fT1ZFUlJJREVfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTE9XX0dBSU5fT1ZFUlJJREVfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX1JTU0lfRklMVEVSX1BFUklPRF9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgblJzc2lGaWx0ZXJQZXJpb2QsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1JTU0lfRklMVEVSX1BFUklPRF9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfUlNTSV9GSUxURVJfUEVSSU9EX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX1JTU0lfRklMVEVSX1BFUklPRF9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfSUdOT1JFX0RUSU1fTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGZJZ25vcmVEdGltLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19JR05PUkVfRFRJTV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfSUdOT1JFX0RUSU1fTUlOLAorICAgICAgICAgICAgICAgICBDRkdfSUdOT1JFX0RUSU1fTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX01BWF9MSV9NT0RVTEFURURfRFRJTV9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgZk1heExJTW9kdWxhdGVkRFRJTSwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTUFYX0xJX01PRFVMQVRFRF9EVElNX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NQVhfTElfTU9EVUxBVEVEX0RUSU1fTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTUFYX0xJX01PRFVMQVRFRF9EVElNX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19SWF9BTlRfQ09ORklHVVJBVElPTl9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBuUnhBbnQsCisgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgIENGR19SWF9BTlRfQ09ORklHVVJBVElPTl9OQU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgQ0ZHX1JYX0FOVF9DT05GSUdVUkFUSU9OX05BTUVfTUlOLAorICAgICAgICAgICAgICAgIENGR19SWF9BTlRfQ09ORklHVVJBVElPTl9OQU1FX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19GV19IRUFSVF9CRUFUX01PTklUT1JJTkdfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgZkVuYWJsZUZ3SGVhcnRCZWF0TW9uaXRvcmluZywKKyAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgQ0ZHX0ZXX0hFQVJUX0JFQVRfTU9OSVRPUklOR19ERUZBVUxULAorICAgICAgICAgICAgICAgIENGR19GV19IRUFSVF9CRUFUX01PTklUT1JJTkdfTUlOLAorICAgICAgICAgICAgICAgIENGR19GV19IRUFSVF9CRUFUX01PTklUT1JJTkdfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX0ZXX0JFQUNPTl9GSUxURVJJTkdfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgZkVuYWJsZUZ3QmVhY29uRmlsdGVyaW5nLAorICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICBDRkdfRldfQkVBQ09OX0ZJTFRFUklOR19ERUZBVUxULAorICAgICAgICAgICAgICAgIENGR19GV19CRUFDT05fRklMVEVSSU5HX01JTiwKKyAgICAgICAgICAgICAgICBDRkdfRldfQkVBQ09OX0ZJTFRFUklOR19NQVggKSwKKworICAgUkVHX0RZTkFNSUNfVkFSSUFCTEUoIENGR19GV19SU1NJX01PTklUT1JJTkdfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgZkVuYWJsZUZ3UnNzaU1vbml0b3JpbmcsCisgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgIENGR19GV19SU1NJX01PTklUT1JJTkdfREVGQVVMVCwKKyAgICAgICAgICAgICAgICBDRkdfRldfUlNTSV9NT05JVE9SSU5HX01JTiwKKyAgICAgICAgICAgICAgICBDRkdfRldfUlNTSV9NT05JVE9SSU5HX01BWCwKKyAgICAgICAgICAgICAgICBjYk5vdGlmeVNldEZ3UnNzaU1vbml0b3JpbmcsIDAgKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfREFUQV9JTkFDVElWSVRZX1RJTUVPVVRfTkFNRSwgV0xB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TU1fTU9ERV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfUU9TX1dNTV9NT0RFX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fTU9ERV9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUU9TX1dNTV84MDIxMUVfRU5BQkxFRF9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGI4MDIxMWVJc0VuYWJsZWQsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fODAyMTFFX0VOQUJMRURfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fODAyMTFFX0VOQUJMRURfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfUU9TX1dNTV84MDIxMUVfRU5BQkxFRF9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUU9TX1dNTV9VQVBTRF9NQVNLX05BTUUgLCBXTEFOX1BBUkFNX0hleEludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgVWFwc2RNYXNrLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX1VBUFNEX01BU0tfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fVUFQU0RfTUFTS19NSU4sCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX1VBUFNEX01BU0tfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX1FPU19XTU1fSU5GUkFfVUFQU0RfVk9fU1JWX0lOVFZfT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9jb25maWdfdCwgSW5mcmFVYXBzZFZpU3J2SW50diwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfUU9TX1dNTV9JTkZSQV9VQVBTRF9WSV9TUlZfSU5UVl9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfUU9TX1dNTV9JTkZSQV9VQVBTRF9WSV9TUlZfSU5UVl9NSU4sCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX1VBUFNEX1ZJX1NSVl9JTlRWX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19RT1NfV01NX0lORlJBX1VBUFNEX1ZJX1NVU19JTlRWX05BTUUgLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgSW5mcmFVYXBzZFZpU3VzcEludHYsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fSU5GUkFfVUFQU0RfVklfU1VTX0lOVFZfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fSU5GUkFfVUFQU0RfVklfU1VTX0lOVFZfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfUU9TX1dNTV9JTkZSQV9VQVBTRF9WSV9TVVNfSU5UVl9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUU9TX1dNTV9JTkZSQV9VQVBTRF9CRV9TUlZfSU5UVl9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIEluZnJhVWFwc2RCZVNydkludHYsCisgICAgICAgICAgICAgICAgIFZBUl9G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EFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1JPQU1fUlNTSV9ESUZGX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19ST0FNX1JTU0lfRElGRl9NSU4sCisgICAgICAgICAgICAgICAgIENGR19ST0FNX1JTU0lfRElGRl9NQVgsCisgICAgICAgICAgICAgICAgIGNiTm90aWZ5U2V0Um9hbVJzc2lEaWZmLCAwKSwKKworICAgUkVHX0RZTkFNSUNfVkFSSUFCTEUoIENGR19JTU1FRElBVEVfUk9BTV9SU1NJX0RJRkZfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgbkltbWVkaWF0ZVJvYW1Sc3NpRGlmZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgICAgICAgICAgQ0ZHX0lNTUVESUFURV9ST0FNX1JTU0lfRElGRl9ERUZBVUxULAorICAgICAgICAgICAgICAgICAgICAgICAgIENGR19JTU1FRElBVEVfUk9BTV9SU1NJX0RJRkZfTUlOLAorICAgICAgICAgICAgICAgICAgICAgICAgIENGR19JTU1FRElBVEVfUk9BTV9SU1NJX0RJRkZfTUFYLAorICAgICAgICAgICAgICAgICAgICAgICAgIGNiTm90aWZ5U2V0SW1tZWRpYXRlUm9hbVJzc2lEaWZmLCAwKSwKKworICAgUkVHX0RZTkFNSUNfVkFSSUFCTEUoIENGR19FTkFCTEVfV0VTX01PREVfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgaXNXRVNNb2RlRW5hYmxlZCwKKyAgICAgICAgICAgICA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TEVELCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBpc1JvYW1PZmZsb2FkU2NhbkVuYWJsZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICAgICAgICAgIENGR19ST0FNX1NDQU5fT0ZGTE9BRF9FTkFCTEVEX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgICAgICAgICAgQ0ZHX1JPQU1fU0NBTl9PRkZMT0FEX0VOQUJMRURfTUlOLAorICAgICAgICAgICAgICAgICAgICAgICAgIENGR19ST0FNX1NDQU5fT0ZGTE9BRF9FTkFCTEVEX01BWCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjYk5vdGlmeVVwZGF0ZVJvYW1TY2FuT2ZmbG9hZEVuYWJsZWQsIDApLAorI2VuZGlmCisgICBSRUdfVkFSSUFCTEUoIENGR19RT1NfV01NX1BLVF9DTEFTU0lGWV9CQVNJU19OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIFBrdENsYXNzaWZpY2F0aW9uQmFzaXMsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fUEtUX0NMQVNTSUZZX0JBU0lTX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX1BLVF9DTEFTU0lGWV9CQVNJU19NSU4sCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX1BLVF9DTEFTU0lGWV9CQVNJU19NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUU9TX1dNTV9JTkZSQV9ESVJfQUNfVk9fTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBJbmZyYURpckFjVm8sCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fSU5GUkFfRElSX0FDX1ZPX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX0RJUl9BQ19WT19NSU4sCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX0RJUl9BQ19WT19NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUU9TX1dNTV9JTkZSQV9OT01fTVNEVV9TSVpFX0FDX1ZPX05BTUUgLCBXTEFOX1BBUkFNX0hleEludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgSW5mcmFOb21Nc2R1U2l6ZUFjVm8sCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fSU5GUkFfTk9NX01TRFVfU0laRV9BQ19WT19ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfUU9TX1dNTV9JTkZSQV9OT01fTVNEVV9TSVpFX0FDX1ZPX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fSU5GUkFfTk9NX01TRFVfU0laRV9BQ19WT19NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUU9TX1dNTV9JTkZSQV9NRUFOX0RBVEFfUkFURV9BQ19WT19OQU1FICwgV0xBTl9QQVJBTV9IZXhJbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIEluZnJhTWVhbkRhdGFSYXRlQWNWbywKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfUU9TX1dNTV9JTkZSQV9NRUFOX0RBVEFfUkFURV9BQ19WT19ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfUU9TX1dNTV9JTkZSQV9NRUFOX0RBVEFfUkFURV9BQ19WT19NSU4sCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX01FQU5fREFUQV9SQVRFX0FDX1ZPX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19RT1NfV01NX0lORlJBX01JTl9QSFlfUkFURV9BQ19WT19OQU1FICwgV0xBTl9QQVJBTV9IZXhJbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIEluZnJhTWluUGh5UmF0ZUFjVm8sCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fSU5GUkFfTUlOX1BIWV9SQVRFX0FDX1ZPX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX01JTl9QSFlfUkFURV9BQ19WT19NSU4sCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX01JTl9QSFlfUkFURV9BQ19WT19NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUU9TX1dNTV9JTkZSQV9TQkFfQUNfVk9fTkFNRSAsIFdMQU5fUEFSQU1fSGV4SW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBJbmZyYVNiYUFjVm8sCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fSU5GUkFfU0JBX0FDX1ZPX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX1NCQV9BQ19WT19NSU4sCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX1NCQV9BQ19WT19NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUU9TX1dNTV9JTkZSQV9ESVJfQUNfVklfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBJbmZyYURpckFjVmksCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fSU5GUkFfRElSX0FDX1ZJX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX0RJUl9BQ19WSV9NSU4sCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX0RJUl9BQ19WSV9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUU9TX1dNTV9JTkZSQV9OT01fTVNEVV9TSVpFX0FDX1ZJX05BTUUgLCBXTEFOX1BBUkFNX0hleEludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgSW5mcmFOb21Nc2R1U2l6ZUFjVmksCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fSU5GUkFfTk9NX01TRFVfU0laRV9BQ19WSV9ERUZBVUxULAorICAgICAgICAgICAgICAgICB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UkFURV9BQ19WSV9NSU4sCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX01JTl9QSFlfUkFURV9BQ19WSV9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUU9TX1dNTV9JTkZSQV9TQkFfQUNfVklfTkFNRSAsIFdMQU5fUEFSQU1fSGV4SW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBJbmZyYVNiYUFjVmksCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fSU5GUkFfU0JBX0FDX1ZJX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX1NCQV9BQ19WSV9NSU4sCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX1NCQV9BQ19WSV9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUU9TX1dNTV9JTkZSQV9ESVJfQUNfQkVfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBJbmZyYURpckFjQmUsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fSU5GUkFfRElSX0FDX0JFX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX0RJUl9BQ19CRV9NSU4sCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX0RJUl9BQ19CRV9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUU9TX1dNTV9JTkZSQV9OT01fTVNEVV9TSVpFX0FDX0JFX05BTUUgLCBXTEFOX1BBUkFNX0hleEludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgSW5mcmFOb21Nc2R1U2l6ZUFjQmUsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fSU5GUkFfTk9NX01TRFVfU0laRV9BQ19CRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfUU9TX1dNTV9JTkZSQV9OT01fTVNEVV9TSVpFX0FDX0JFX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fSU5GUkFfTk9NX01TRFVfU0laRV9BQ19CRV9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUU9TX1dNTV9JTkZSQV9NRUFOX0RBVEFfUkFURV9BQ19CRV9OQU1FICwgV0xBTl9QQVJBTV9IZXhJbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIEluZnJhTWVhbkRhdGFSYXRlQWNCZSwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfUU9TX1dNTV9JTkZSQV9NRUFOX0RBVEFfUkFURV9BQ19CRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfUU9TX1dNTV9JTkZSQV9NRUFOX0RBVEFfUkFURV9BQ19CRV9NSU4sCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX01FQU5fREFUQV9SQVRFX0FDX0JFX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19RT1NfV01NX0lORlJBX01JTl9QSFlfUkFURV9BQ19CRV9OQU1FICwgV0xBTl9QQVJBTV9IZXhJbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIEluZnJhTWluUGh5UmF0ZUFjQmUsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fSU5GUkFfTUlOX1BIWV9SQVRFX0FDX0JFX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX01JTl9QSFlfUkFURV9BQ19CRV9NSU4sCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX01JTl9QSFlfUkFURV9BQ19CRV9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUU9TX1dNTV9JTkZSQV9TQkFfQUNfQkVfTkFNRSAsIFdMQU5fUEFSQU1fSGV4SW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBJbmZyYVNiYUFjQmUsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fSU5GUkFfU0JBX0FDX0JFX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX1NCQV9BQ19CRV9NSU4sCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX1NCQV9BQ19CRV9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUU9TX1dNTV9JTkZSQV9ESVJfQUNfQktfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBJbmZyYURpckFjQmssCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fSU5GUkFfRElSX0FDX0JLX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX0RJUl9BQ19CS19NSU4sCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX0RJUl9BQ19CS19NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUU9TX1dNTV9JTkZSQV9OT01fTVNEVV9TSVpFX0FDX0JLX05BTUUgLCBXTEFOX1BBUkFNX0hleEludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgSW5mcmFOb21Nc2R1U2l6ZUFjQmssCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fSU5GUkFfTk9NX01TRFVfU0laRV9BQ19CS19ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfUU9TX1dNTV9JTkZSQV9OT01fTVNEVV9TSVpFX0FDX0JLX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fSU5GUkFfTk9NX01TRFVfU0laRV9BQ19CS19NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUU9TX1dNTV9JTkZSQV9NRUFOX0RBVEFfUkFURV9BQ19CS19OQU1FICwgV0xBTl9QQVJBTV9IZXhJbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIEluZnJhTWVhbkRhdGFSYXRlQWNCaywKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfUU9TX1dNTV9JTkZSQV9NRUFOX0RBVEFfUkFURV9BQ19CS19ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfUU9TX1dNTV9JTkZSQV9NRUFOX0RBVEFfUkFURV9BQ19CS19NSU4sCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX01FQU5fREFUQV9SQVRFX0FDX0JLX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19RT1NfV01NX0lORlJBX01JTl9QSFlfUkFURV9BQ19CS19OQU1FICwgV0xBTl9QQVJBTV9IZXhJbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIEluZnJhTWluUGh5UmF0ZUFjQmssCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fSU5GUkFfTUlOX1BIWV9SQVRFX0FDX0JLX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX01JTl9QSFlfUkFURV9BQ19CS19NSU4sCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX01JTl9QSFlfUkFURV9BQ19CS19NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUU9TX1dNTV9JTkZSQV9TQkFfQUNfQktfTkFNRSAsIFdMQU5fUEFSQU1fSGV4SW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBJbmZyYVNiYUFjQmssCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fSU5GUkFfU0JBX0FDX0JLX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX1NCQV9BQ19CS19NSU4sCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX0lORlJBX1NCQV9BQ19CS19NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfVExfV0ZRX0JLX1dFSUdIVF9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIFdmcUJrV2VpZ2h0LAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19UTF9XRlFfQktfV0VJR0hUX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19UTF9XRlFfQktfV0VJR0hUX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX1RMX1dGUV9CS19XRUlHSFRfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX1RMX1dGUV9CRV9XRUlHSFRfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBXZnFCZVdlaWdodCwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfVExfV0ZRX0JFX1dFSUdIVF9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfVExfV0ZRX0JFX1dFSUdIVF9NSU4sCisgICAgICAgICAgICAgICAgIENGR19UTF9XRlFfQkVfV0VJR0hUX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19UTF9XRlFfVklfV0VJR0hUX05BTUUgLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgV2ZxVmlXZWlnaHQsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05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R19UTF9ERUxBWUVEX1RSR1JfRlJNX0lOVF9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUkVPUkRFUl9USU1FX0JLX05BTUUgLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgQmtSZW9yZGVyQWdpbmdUaW1lLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19SRU9SREVSX1RJTUVfQktfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1JFT1JERVJfVElNRV9CS19NSU4sCisgICAgICAgICAgICAgICAgIENGR19SRU9SREVSX1RJTUVfQktfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX1JFT1JERVJfVElNRV9CRV9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIEJlUmVvcmRlckFnaW5nVGltZSwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfUkVPUkRFUl9USU1FX0JFX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19SRU9SREVSX1RJTUVfQkVfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfUkVPUkRFUl9USU1FX0JFX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19SRU9SREVSX1RJTUVfVklfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBWaVJlb3JkZXJBZ2luZ1RpbWUsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1JFT1JERVJfVElNRV9WSV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfUkVPUkRFUl9USU1FX1ZJX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX1JFT1JERVJfVElNRV9WSV9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUkVPUkRFUl9USU1FX1ZPX05BTUUgLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgVm9SZW9yZGVyQWdpbmdUaW1lLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19SRU9SREVSX1RJTUVfVk9fREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1JFT1JERVJfVElNRV9WT19NSU4sCisgICAgICAgICAgICAgICAgIENGR19SRU9SREVSX1RJTUVfVk9fTUFYICksCisKKyAgIFJFR19WQVJJQUJMRV9TVFJJTkcoIENGR19XT1dMX1BBVFRFUk5fTkFNRSwgV0xBTl9QQVJBTV9TdHJpbmcsCisgICAgICAgICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIHdvd2xQYXR0ZXJuLAorICAgICAgICAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMLAorICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilDRkdfV09XTF9QQVRURVJOX0RFRkFVTFQgKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUU9TX0lNUExJQ0lUX1NFVFVQX0VOQUJMRURfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBiSW1wbGljaXRRb3NFbmFib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Q1RJT05fREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0JUQ19ESENQX1BST1RFQ1RJT05fTUlOLAorICAgICAgICAgICAgICAgICBDRkdfQlRDX0RIQ1BfUFJPVEVDVElPTl9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfQlRDX0EyRFBfREhDUF9QUk9URUNUSU9OX05BTUUgLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgYnRjQTJEUEJ0U3ViSW50ZXJ2YWxzRHVyaW5nRGhjcCwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfQlRDX0EyRFBfREhDUF9QUk9URUNUSU9OX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19CVENfQTJEUF9ESENQX1BST1RFQ1RJT05fTUlOLAorICAgICAgICAgICAgICAgICBDRkdfQlRDX0EyRFBfREhDUF9QUk9URUNUSU9OX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19CVENfU1RBVElDX0xFTl9JTlFfQlRfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBidGNTdGF0aWNMZW5JbnFCdCwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfQlRDX1NUQVRJQ19MRU5fSU5RX0JUX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19CVENfU1RBVElDX0xFTl9JTlFfQlRfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfQlRDX1NUQVRJQ19MRU5fSU5RX0JUX01BWCApLAorCisgICBSRU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X0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19CVENfU1RBVElDX0xFTl9QQUdFX1dMQU5fTUlOLAorICAgICAgICAgICAgICAgICBDRkdfQlRDX1NUQVRJQ19MRU5fUEFHRV9XTEFOX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19CVENfU1RBVElDX0xFTl9DT05OX1dMQU5fTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBidGNTdGF0aWNMZW5Db25uV2xhbiwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfQlRDX1NUQVRJQ19MRU5fQ09OTl9XTEFOX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19CVENfU1RBVElDX0xFTl9DT05OX1dMQU5fTUlOLAorICAgICAgICAgICAgICAgICBDRkdfQlRDX1NUQVRJQ19MRU5fQ09OTl9XTEFOX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19CVENfU1RBVElDX0xFTl9MRV9XTEFOX05BTUUgLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgYnRjU3RhdGljTGVuTGVXbGFuLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19CVENfU1RBVElDX0xFTl9MRV9XTEFOX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19CVENfU1RBVElDX0xFTl9MRV9XTEFOX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX0JUQ19TVEFUSUNfTEVOX0xFX1dMQU5fTUFYICksCisKKyAgIFJFR19WQVJJ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VJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19CVENfTUFYX1NDT19CTE9DS19QRVJDX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19CVENfTUFYX1NDT19CTE9DS19QRVJDX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX0JUQ19NQVhfU0NPX0JMT0NLX1BFUkNfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX0JUQ19ESENQX1BST1RfT05fQTJEUF9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGJ0Y0RoY3BQcm90T25BMmRwLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19CVENfREhDUF9QUk9UX09OX0EyRFBfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0JUQ19ESENQX1BST1RfT05fQTJEUF9NSU4sCisgICAgICAgICAgICAgICAgIENGR19CVENfREhDUF9QUk9UX09OX0EyRFBfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX0JUQ19ESENQX1BST1RfT05fU0NPX05BTUUgLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgYnRjRGhjcFByb3RPblNjbywKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfQlRDX0RIQ1BfUFJPVF9PTl9TQ09fREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0JUQ19ESENQX1BST1RfT05fU0NPX01JTiwKKyAgICAgIC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ICAgaGRkX2NvbmZpZ190LCBtd3NDb2V4VmljdGltQ29uZmlnWzBdLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX1ZYX0NPTkZJR19NSU4sCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX01XU19DT0VYX1YxX0NPTkZJRzJfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBtd3NDb2V4VmljdGltQ29uZmlnMlswXSwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfQ09ORklHX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfQ09ORklHX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19NV1NfQ09FWF9WMl9XQU5fRlJFUV9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG13c0NvZXhWaWN0aW1XQU5GcmVxWzFdLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9XQU5fRlJFUV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0FOX0ZSRVFfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0FOX0ZSRVFfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX01XU19DT0VYX1YyX1dMQU5fRlJFUV9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG13c0NvZXhWaWN0aW1XTEFORnJlcVsxXSwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0xBTl9GUkVRX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9XTEFOX0ZSRVFfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0xBTl9GUkVRX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19NV1NfQ09FWF9WMl9DT05GSUdfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBtd3NDb2V4VmljdGltQ29uZmlnWzFdLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX1ZYX0NPTkZJR19NSU4sCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX01XU19DT0VYX1YyX0NPTkZJRzJfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBtd3NDb2V4VmljdGltQ29uZmlnMlsxXSwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfQ09ORklHX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfQ09ORklHX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19NV1NfQ09FWF9WM19XQU5fRlJFUV9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG13c0NvZXhWaWN0aW1XQU5GcmVxWzJdLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9XQU5fRlJFUV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0FOX0ZSRVFfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0FOX0ZSRVFfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX01XU19DT0VYX1YzX1dMQU5fRlJFUV9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG13c0NvZXhWaWN0aW1XTEFORnJlcVsyXSwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0xBTl9GUkVRX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9XTEFOX0ZSRVFfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0xBTl9GUkVRX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19NV1NfQ09FWF9WM19DT05GSUdfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBtd3NDb2V4VmljdGltQ29uZmlnWzJdLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX1ZYX0NPTkZJR19NSU4sCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX01XU19DT0VYX1YzX0NPTkZJRzJfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBtd3NDb2V4VmljdGltQ29uZmlnMlsyXSwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfQ09ORklHX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfQ09ORklHX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19NV1NfQ09FWF9WNF9XQU5fRlJFUV9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG13c0NvZXhWaWN0aW1XQU5GcmVxWzNdLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9XQU5fRlJFUV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0FOX0ZSRVFfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0FOX0ZSRVFfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX01XU19DT0VYX1Y0X1dMQU5fRlJFUV9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG13c0NvZXhWaWN0aW1XTEFORnJlcVszXSwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0xBTl9GUkVRX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9XTEFOX0ZSRVFfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0xBTl9GUkVRX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19NV1NfQ09FWF9WNF9DT05GSUdfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBtd3NDb2V4VmljdGltQ29uZmlnWzNdLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX1ZYX0NPTkZJR19NSU4sCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX01XU19DT0VYX1Y0X0NPTkZJRzJfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBtd3NDb2V4VmljdGltQ29uZmlnMlszXSwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfQ09ORklHX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfQ09ORklHX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19NV1NfQ09FWF9WNV9XQU5fRlJFUV9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG13c0NvZXhWaWN0aW1XQU5GcmVxWzRdLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9XQU5fRlJFUV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0FOX0ZSRVFfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0FOX0ZSRVFfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX01XU19DT0VYX1Y1X1dMQU5fRlJFUV9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG13c0NvZXhWaWN0aW1XTEFORnJlcVs0XSwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0xBTl9GUkVRX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9XTEFOX0ZSRVFfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0xBTl9GUkVRX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19NV1NfQ09FWF9WNV9DT05GSUdfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBtd3NDb2V4VmljdGltQ29uZmlnWzRdLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX1ZYX0NPTkZJR19NSU4sCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfTUFYICksCisKKyAgIFJFR19WQVJJQUJ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QUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0xBTl9GUkVRX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9XTEFOX0ZSRVFfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0xBTl9GUkVRX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19NV1NfQ09FWF9WNl9DT05GSUdfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBtd3NDb2V4VmljdGltQ29uZmlnWzVdLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX1ZYX0NPTkZJR19NSU4sCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX01XU19DT0VYX1Y2X0NPTkZJRzJfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBtd3NDb2V4VmljdGltQ29uZmlnMls1XSwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfQ09ORklHX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSU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ICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBtd3NDb2V4VmljdGltQ29uZmlnWzZdLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX1ZYX0NPTkZJR19NSU4sCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX01XU19DT0VYX1Y3X0NPTkZJRzJfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBtd3NDb2V4VmljdGltQ29uZmlnMls2XSwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfQ09ORklHX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfQ09ORklHX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19NV1NfQ09FWF9WOF9XQU5fRlJFUV9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG13c0NvZXhWaWN0aW1XQU5GcmVxWzddLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9XQU5fRlJFUV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0FOX0ZSRVFfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0FOX0ZSRVFfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX01XU19DT0VYX1Y4X1dMQU5fRlJFUV9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG13c0NvZXhWaWN0aW1XTEFORnJlcVs3XSwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0xBTl9GUkVRX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9XTEFOX0ZSRVFfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0xBTl9GUkVRX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19NV1NfQ09FWF9WOF9DT05GSUdfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBtd3NDb2V4VmljdGltQ29uZmlnWzddLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX1ZYX0NPTkZJR19NSU4sCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfTUFYICksCisKKyAgIFJFR19WQ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SX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0xBTl9GUkVRX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9XTEFOX0ZSRVFfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfV0xBTl9GUkVRX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19NV1NfQ09FWF9WOV9DT05GSUdfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBtd3NDb2V4VmljdGltQ29uZmlnWzhdLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX1ZYX0NPTkZJR19NSU4sCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX01XU19DT0VYX1Y5X0NPTkZJRzJfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBtd3NDb2V4VmljdGltQ29uZmlnMls4XSwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfQ09ORklHX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9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fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBtd3NDb2V4VmljdGltQ29uZmlnWzldLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX1ZYX0NPTkZJR19NSU4sCisgICAgICAgICAgICAgICAgIENGR19NV1NfQ09FWF9WWF9DT05GSUdfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX01XU19DT0VYX1YxMF9DT05GSUcyX05BTUUgLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgbXdzQ29leFZpY3RpbUNvbmZpZzJbOV0sCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX1ZYX0NPTkZJR19ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfVlhfQ09ORklHX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX1ZYX0NPTkZJR19NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfTVdTX0NPRVhfTU9ERU1fQkFDS09GRl9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG13c0NvZXhNb2RlbUJhY2tvZmYsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX01PREVNX0JBQ0tPRkZfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX01PREVNX0JBQ0tPRkZfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfTU9ERU1fQkFDS09GRl9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfTVdTX0NPRVhfQ09ORklHMV9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG13c0NvZXhDb25maWdbMF0sCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX0NPTkZJR1hfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX0NPTkZJR1hfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfQ09ORklHWF9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfTVdTX0NPRVhfQ09ORklHMl9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG13c0NvZXhDb25maWdbMV0sCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX0NPTkZJR1hfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX0NPTkZJR1hfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfQ09ORklHWF9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfTVdTX0NPRVhfQ09ORklHM19OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG13c0NvZXhDb25maWdbMl0sCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX0NPTkZJR1hfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX0NPTkZJR1hfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfQ09ORklHWF9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfTVdTX0NPRVhfQ09ORklHNF9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG13c0NvZXhDb25maWdbM10sCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX0NPTkZJR1hfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX0NPTkZJR1hfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfQ09ORklHWF9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfTVdTX0NPRVhfQ09ORklHNV9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG13c0NvZXhDb25maWdbNF0sCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX0NPTkZJR1hfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX0NPTkZJR1hfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfQ09ORklHWF9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfTVdTX0NPRVhfQ09ORklHNl9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG13c0NvZXhDb25maWdbNV0sCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX0NPTkZJR1hfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX01XU19DT0VYX0NPTkZJR1hfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfTVdTX0NPRVhfQ09ORklHWF9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfU0FSX1BPV0VSX0JBQ0tPRkZfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBTQVJQb3dlckJhY2tvZmYsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1NBUl9QT1dFUl9CQUNLT0ZGX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19TQVJfUE9XRVJfQkFDS09GRl9NSU4sCisgICAgICAgICAgICAgICAgIENGR19TQVJfUE9XRVJfQkFDS09GRl9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfQVBfTElTVEVOX01PREVfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBuRW5hYmxlTGlzdGVuTW9kZSwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfQVBfTElTVEVOX01PREVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0FQX0xJU1RFTl9NT0RFX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX0FQX0xJU1RFTl9NT0RFX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19BUF9BVVRPX1NIVVRfT0ZGICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG5BUEF1dG9TaHV0T2ZmLAorICAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfQVBfQVVUT19TSFVUX09GRl9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfQVBfQVVUT19TSFVUX09GRl9NSU4sCisgICAgICAgICAgICAgICAgIENGR19BUF9BVVRPX1NIVVRfT0ZGX01BWCApLAorCisjaWYgZGVmaW5lZCBXTEFOX0ZFQVRVUkVfVk9XSUZJCisgICBSRUdfVkFSSUFCTEUoIENGR19SUk1fRU5BQkxFX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBmUnJtRW5hYmxlLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19SUk1fRU5BQkxFX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19SUk1fRU5BQ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GVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgZmhvc3ROU09mZmxvYWQsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0VOQUJMRV9IT1NUX05TT0ZGTE9BRF9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfRU5BQkxFX0hPU1RfTlNPRkZMT0FEX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX0VOQUJMRV9IT1NUX05TT0ZGTE9BRF9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfUU9TX1dNTV9UU19JTkZPX0FDS19QT0xJQ1lfTkFNRSAsIFdMQU5fUEFSQU1fSGV4SW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCB0c0luZm9BY2tQb2xpY3ksCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1FPU19XTU1fVFNfSU5GT19BQ0tfUE9MSUNZX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX1RTX0lORk9fQUNLX1BPTElDWV9NSU4sCisgICAgICAgICAgICAgICAgIENGR19RT1NfV01NX1RTX0lORk9fQUNLX1BPTElDWV9NQVggKSwKKworICAgIFJFR19WQVJJQUJMRSggQ0ZHX1NJTkdMRV9USURfUkNfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBiU2luZ2xlVGlkUmMsCisgICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgICBDRkdfU0lOR0xFX1RJRF9SQ19ERUZBVUxULAorICAgICAgICAgICAgICAgICAgQ0ZHX1NJTkdMRV9USURfUkNfTUlOLAorICAgICAgICAgICAgICAgICAgQ0ZHX1NJTkdMRV9USURfUkNfTUFYKSwKKworICAgIFJFR19WQVJJQUJMRSggQ0ZHX0RZTkFNSUNfUFNQT0xMX1ZBTFVFX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgZHluYW1pY1BzUG9sbFZhbHVlLAorICAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICAgQ0ZHX0RZTkFNSUNfUFNQT0xMX1ZBTFVFX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgICBDRkdfRFlOQU1JQ19QU1BPTExfVkFMVUVfTUlOLAorICAgICAgICAgICAgICAgICAgQ0ZHX0RZTkFNSUNfUFNQT0xMX1ZBTFVFX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19URUxFX0JDTl9XQUtFVVBfRU5fTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCB0ZWxlQmNuV2FrZXVwRW4sCisgICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgICBDRkdfVEVMRV9CQ05fV0FLRVVQX0VOX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgICBDRkdfVEVMRV9CQ05fV0FLRVVQX0VOX01JTiwKKyAgICAgICAgICAgICAgICAgIENGR19URUxFX0JDTl9XQUtFVVBfRU5fTUFYICksCisKKyAgICBSRUdfVkFSSUFCTEUoIENGR19JTkZSQV9TVEFfS0VFUF9BTElWRV9QRVJJT0RfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBpbmZyYVN0YUtlZXBBbGl2ZVBlcmlvZCwKKyAgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgIENGR19JTkZSQV9TVEFfS0VFUF9BTElWRV9QRVJJT0RfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgIENGR19JTkZSQV9TVEFfS0VFUF9BTElWRV9QRVJJT0RfTUlOLAorICAgICAgICAgICAgICAgICAgQ0ZHX0lORlJBX1NUQV9LRUVQX0FMSVZFX1BFUklPRF9NQVgpLAorCisgICAgUkVHX1ZBUklBQkxFKCBDRkdfUU9TX0FERFRTX1dIRU5fQUNNX0lTX09GRl9OQU1FICwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBBZGRUU1doZW5BQ01Jc09mZiwKKyAgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgIENGR19RT1NfQUREVFNfV0hFTl9BQ01fSVNfT0ZGX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgICBDRkdfUU9TX0FERFRTX1dIRU5fQUNNX0lTX09GRl9NSU4sCisgICAgICAgICAgICAgICAgICBDRkdfUU9TX0FERFRTX1dIRU5fQUNNX0lTX09GRl9NQVggKSwKKworCisgICAgUkVHX1ZBUklBQkxFKCBDRkdfVkFMSURBVEVfU0NBTl9MSVNUX05BTUUgLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGZWYWxpZGF0ZVNjYW5MaXN0LAorICAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICAgQ0ZHX1ZBTElEQVRFX1NDQU5fTElTVF9ERUZBVUxULAorICAgICAgICAgICAgICAgICAgQ0ZHX1ZBTElEQVRFX1NDQU5fTElTVF9NSU4sCisgICAgICAgICAgICAgICAgICBDRkdfVkFMSURBVEVfU0NBTl9MSVNUX01BWCApLAorCisgICAgUkVHX1ZBUklBQkxFKCBDRkdfTlVMTERBVEFfQVBfUkVTUF9USU1FT1VUX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG5OdWxsRGF0YUFwUmVzcFRpbWVvdXQsCisgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgIENGR19OVUxMREFUQV9BUF9SRVNQX1RJTUVPVVRfREVGQVVMVCwKKyAgICAgICAgICAgICAgICBDRkdfTlVMTERBVEFfQVBfUkVTUF9USU1FT1VUX01JTiwKKyAgICAgICAgICAgICAgICBDRkdfTlVMTERBVEFfQVBfUkVTUF9USU1FT1VUX01BWCApLAorCisgICAgUkVHX1ZBUklBQkxFKCBDRkdfQVBfREFUQV9BVkFJTF9QT0xMX1BFUklPRF9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBhcERhdGFBdmFpbFBvbGxQZXJpb2RJbk1zLAorICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICBDRkdfQVBfREFUQV9BVkFJTF9QT0xMX1BFUklPRF9ERUZBVUxULAorICAgICAgICAgICAgICAgIENGR19BUF9EQVRBX0FWQUlMX1BPTExfUEVSSU9EX01JTiwKKyAgICAgICAgICAgICAgICBDRkdfQVBfREFUQV9BVkFJTF9QT0xMX1BFUklPRF9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfRU5BQkxFX0JUQU1QX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBlbmFibGVCdEFtcCwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfRU5BQkxFX0JUQU1QX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19FTkFCTEVfQlRBTVBfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfRU5BQkxFX0JUQU1QX01BWCApLAorCisjaWZkZWYgV0xBTl9CVEFNUF9GRUFUVVJFCisgICBSRUdfVkFSSUFCTEUoIENGR19CVF9BTVBfUFJFRkVSUkVEX0NIQU5ORUxfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIHByZWZlcnJlZENoYW5uZWwsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0JUX0FNUF9QUkVGRVJSRURfQ0hBTk5FTF9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfQlRfQU1QX1BSRUZFUlJFRF9DSEFOTkVMX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX0JUX0FNUF9QUkVGRVJSRURfQ0hBTk5FTF9NQVggKSwK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ZHX1ZPU19UUkFDRV9FTkFCTEVfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX1ZPU19UUkFDRV9FTkFCTEVfUE1DX05BTUUsICBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgdm9zVHJhY2VFbmFibGVQTUMsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1ZPU19UUkFDRV9FTkFCTEVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1ZPU19UUkFDRV9FTkFCTEVfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfVk9TX1RSQUNFX0VOQUJMRV9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfVk9TX1RSQUNFX0VOQUJMRV9XREFfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgdm9zVHJhY2VFbmFibGVXREEsCisgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMLAorICAgICAgICAgICAgICAgIENGR19WT1NfVFJBQ0VfRU5BQkxFX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgQ0ZHX1ZPU19UUkFDRV9FTkFCTEVfTUlOLAorICAgICAgICAgICAgICAgIENGR19WT1NfVFJBQ0VfRU5BQkxFX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19WT1NfVFJBQ0VfRU5BQkxFX1NZU19OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCB2b3NUcmFjZUVuYWJsZVNZUywKKyAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwsCisgICAgICAgICAgICAgICAgQ0ZHX1ZPU19UUkFDRV9FTkFCTEVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICBDRkdfVk9TX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IENGR19URUxFX0JDTl9UUkFOU19MSV9NSU4sCisgICAgICAgICAgICAgICBDRkdfVEVMRV9CQ05fVFJBTlNfTElfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX1RFTEVfQkNOX1RSQU5TX0xJX05VTV9JRExFX0JDTlNfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBuVGVsZUJjblRyYW5zTGlOdW1JZGxlQmVhY29ucywKKyAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgIENGR19URUxFX0JDTl9UUkFOU19MSV9OVU1fSURMRV9CQ05TX0RFRkFVTFQsCisgICAgICAgICAgICAgICBDRkdfVEVMRV9CQ05fVFJBTlNfTElfTlVNX0lETEVfQkNOU19NSU4sCisgICAgICAgICAgICAgICBDRkdfVEVMRV9CQ05fVFJBTlNfTElfTlVNX0lETEVfQkNOU19NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfVEVMRV9CQ05fTUFYX0xJX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgblRlbGVCY25NYXhMaXN0ZW5JbnRlcnZhbCwKKyAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgIENGR19URUxFX0JDTl9NQVhfTElfREVGQVVMVCwKKyAgICAgICAgICAgICAgIENGR19URUxFX0JDTl9NQVhfTElfTUlOLAorICAgICAgICAgICAgICAgQ0ZHX1RFTEVfQkNOX01BWF9MSV9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfVEVMRV9CQ05fTUFYX0xJX05VTV9JRExFX0JDTlNfTkF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HSV80ME1IWl9NSU4sCisgICAgICAgICAgICAgIENGR19TSE9SVF9HSV80ME1IWl9NQVggKSwKKworICAgUkVHX0RZTkFNSUNfVkFSSUFCTEUoIENGR19SRVBPUlRfTUFYX0xJTktfU1BFRUQsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCByZXBvcnRNYXhMaW5rU3BlZWQsCisgICAgICAgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgICAgICAgQ0ZHX1JFUE9SVF9NQVhfTElOS19TUEVFRF9ERUZBVUxULAorICAgICAgICAgICAgICAgICAgICAgICBDRkdfUkVQT1JUX01BWF9MSU5LX1NQRUVEX01JTiwKKyAgICAgICAgICAgICAgICAgICAgICAgQ0ZHX1JFUE9SVF9NQVhfTElOS19TUEVFRF9NQVgsCisgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsIDAgKSwKKworICAgUkVHX0RZTkFNSUNfVkFSSUFCTEUoIENGR19MSU5LX1NQRUVEX1JTU0lfSElHSCwgV0xBTl9QQVJBTV9TaWduZWRJbnRlZ2VyLAorICAgICAgICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGxpbmtTcGVlZFJzc2lIaWdoLAorICAgICAgICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgICAgICAgIENGR19MSU5LX1NQRUVEX1JTU0lfSElHSF9ERUZBVUxULAorICAgICAgICAgICAgICAgICAgICAgICBDRkdfTElOS19TUEVFRF9SU1NJX0hJR0hfTUlOLAorICAgICAgICAgICAgICAgICAgICAgICBDRkdfTElOS19TUEVFRF9SU1NJX0hJR0hfTUFYLAorICAgICAgICAgICAgICAgICAgICAgICBOVUxMLCAwICksCisKKyAgIFJFR19EWU5BTUlDX1ZBUklBQkxFKCBDRkdfTElOS19TUEVFRF9SU1NJX01JRCwgV0xBTl9QQVJBTV9TaWduZWRJbnRlZ2VyLAorICAgICAgICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGxpbmtTcGVlZFJzc2lNaWQsCisgICAgICAgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgICAgICAgQ0ZHX0xJTktfU1BFRURfUlNTSV9NSURfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgICAgICAgQ0ZHX0xJTktfU1BFRURfUlNTSV9NSURfTUlOLAorICAgICAgICAgICAgICAgICAgICAgICBDRkdfTElOS19TUEVFRF9SU1NJX01JRF9NQVgsCisgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsIDAgKSwKKworICAgUkVHX0RZTkFNSUNfVkFSSUFCTEUoIENGR19MSU5LX1NQRUVEX1JTU0lfTE9XLCBXTEFOX1BBUkFNX1NpZ25lZEludGVnZXIsCisgICAgICAgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgbGlua1NwZWVkUnNzaUxvdywKKyAgICAgICAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICAgICAgICBDRkdfTElOS19TUEVFRF9SU1NJX0xPV19ERUZBVUxULAorICAgICAgICAgICAgICAgICAgICAgICBDRkdfTElOS19TUEVFRF9SU1NJX0xPV19NSU4sCisgICAgICAgICAgICAgICAgICAgICAgIENGR19MSU5LX1NQRUVEX1JTU0lfTE9XX01BWCwKKyAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwgMCApLAorCisjaWYgIGRlZmluZWQgKFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSKSB8fCBkZWZpbmVkIChGRUFUVVJFX1dMQU5fRVNFKSB8fCBkZWZpbmVkKEZFQVRVUkVfV0xBTl9MRlIpCisgICBSRUdfRFlOQU1JQ19WQVJJQUJMRSggQ0ZHX1JPQU1fUFJFRkVSXzVHSFosIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBuUm9hbVByZWZlcjVHSHosCisgICAgICAgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgICAgICAgQ0ZHX1JPQU1fUFJFRkVSXzVHSFpfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgICAgICAgQ0ZHX1JPQU1fUFJFRkVSXzVHSFpfTUlOLAorICAgICAgICAgICAgICAgICAgICAgICBDRkdfUk9BTV9QUkVGRVJfNUdIWl9NQVgsCisgICAgICAgICAgICAgICAgICAgICAgIGNiTm90aWZ5U2V0Um9hbVByZWZlcjVHSHosIDAgKSwKKworICAgUkVHX0RZTkFNSUNfVkFSSUFCTEUoIENGR19ST0FNX0lOVFJBX0JBTkQsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBuUm9hbUludHJhQmFuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICAgICAgICBDRkdfUk9BTV9JTlRSQV9CQU5EX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgICAgICAgIENGR19ST0FNX0lOVFJBX0JBTkRfTUlOLAorICAgICAgICAgICAgICAgICAgICAgICBDRkdfUk9BTV9JTlRSQV9CQU5EX01BWCwKKyAgICAgICAgICAgICAgICAgICAgICAgY2JOb3RpZnlTZXRSb2FtSW50cmFCYW5kLCAwICksCisKKyBSRUdfRFlOQU1JQ19WQVJJQUJMRSggQ0ZHX1JPQU1fU0NBTl9OX1BST0JFUywgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG5Qcm9iZXMsCisgICAgICAgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgICAgICAgQ0ZHX1JPQU1fU0NBTl9OX1BST0JFU19ERUZBVUxULAorICAgICAgICAgICAgICAgICAgICAgICBDRkdfUk9BTV9TQ0FOX05fUFJPQkVTX01JTiwKKyAgICAgICAgICAgICAgICAgICAgICAgQ0ZHX1JPQU1fU0NBTl9OX1BST0JFU19NQVgsCisgICAgICAgICAgICAgICAgICAgICAgIGNiTm90aWZ5U2V0Um9hbVNjYW5OUHJvYmVzLCAwICksCisKKyBSRUdfRFlOQU1JQ19WQVJJQUJMRSggQ0ZHX1JPQU1fU0NBTl9IT01FX0FXQVlfVElNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG5Sb2FtU2NhbkhvbWVBd2F5VGltZSwKKyAgICAgICAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICAgICAgICBDRkdfUk9BTV9TQ0FOX0hPTUVfQVdBWV9USU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgICAgICAgIENGR19ST0FNX1NDQU5fSE9NRV9BV0FZX1RJTUVfTUlOLAorICAgICAgICAgICAgICAgICAgICAgICBDRkdfUk9BTV9TQ0FO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05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGFsbG93TUNDR09EaWZmQkksCisgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgIENGR19BTExPV19NQ0NfR09fRElGRl9CSV9ERUZBVUxULAorICAgICAgICAgICAgIENGR19BTExPV19NQ0NfR09fRElGRl9CSV9NSU4sCisgICAgICAgICAgICAgQ0ZHX0FMTE9XX01DQ19HT19ESUZGX0JJX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19USEVSTUFMX01JR1JBVElPTl9FTkFCTEVfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIHRoZXJtYWxNaXRpZ2F0aW9uRW5hYmxlLAorICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgIENGR19USEVSTUFMX01JR1JBVElPTl9FTkFCTEVfREVGQVVMVCwKKyAgICAgICAgICAgICAgQ0ZHX1RIRVJNQUxfTUlHUkFUSU9OX0VOQUJMRV9NSU4sCisgICAgICAgICAgICAgIENGR19USEVSTUFMX01JR1JBVElPTl9FTkFCTEVfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX0VOQUJMRV9NT0RVTEFURURfRFRJTV9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgZW5hYmxlTW9kdWxhdGVkRFRJTSwKKyAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAg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19DT05GSUdfUEFSQU1fTUlOLAorICAgICAgICAgICAgIENGR19NQ0NfQ09ORklHX1BBUkFNX01BWCApLAorICAgUkVHX1ZBUklBQkxFKCBDRkdfRU5BQkxFX1JYX1NUQkMsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBlbmFibGVSeFNUQkMsCisgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgQ0ZHX0VOQUJMRV9SWF9TVEJDX0RFRkFVTFQsCisgICAgICAgICAgICAgIENGR19FTkFCTEVfUlhfU1RCQ19NSU4sCisgICAgICAgICAgICAgIENGR19FTkFCTEVfUlhfU1RCQ19NQVggKSwKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworICAgUkVHX1ZBUklBQkxFKCBDRkdfVERMU19TVVBQT1JUX0VOQUJMRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGZFbmFibGVURExTU3VwcG9ydCwKKyAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICBDRkdfVERMU19TVVBQT1JUX0VOQUJMRV9ERUZBVUxULAorICAgICAgICAgICAgICBDRkdfVERMU19TVVBQT1JUX0VOQUJMRV9NSU4sCisgICAgICAgICAgICAgIENGR19URExTX1NVUFBPUlRfRU5BQkxFX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19URExTX0lNUExJQ0lUX1RSSUdHRVIsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBmRW5hYmxlVERMU0ltcGxpY2l0VHJpZ2dlciwKKyAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICBDRkdfVERMU19JTVBMSUNJVF9UUklHR0VSX0RFRkFVTFQsCisgICAgICAgICAgICAgIENGR19URExTX0lNUExJQ0lUX1RSSUdHRVJfTUlOLAorICAgICAgICAgICAgICBDRkdfVERMU19JTVBMSUNJVF9UUklHR0VSX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19URExTX1RYX1NUQVRTX1BFUklPRCwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGZURExTVHhTdGF0c1BlcmlvZCwKKyAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICBDRkdfVERMU19UWF9TVEFUU19QRVJJT0RfREVGQVVMVCwKKyAgICAgICAgICAgICAgQ0ZHX1RETFNfVFhfU1RBVFNfUEVSSU9EX01JTiwKKyAgICAgICAgICAgICAgQ0ZHX1RETFNfVFhfU1RBVFNfUEVSSU9EX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19URExTX1RYX1BBQ0tFVF9USFJFU0hPTEQsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBmVERMU1R4UGFja2V0VGhyZXNob2xkLAorICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgIENGR19URExTX1RYX1BBQ0tFVF9USFJFU0hPTERfREVGQVVMVCwKKyAgICAgICAgICAgICAgQ0ZHX1RETFNfVFhfUEFDS0VUX1RIUkVTSE9MRF9NSU4sCisgICAgICAgICAgICAgIENGR19URExTX1RYX1BBQ0tFVF9USFJFU0hPTERfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX1RETFNfRElTQ09WRVJZX1BFUklPRCwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGZURExTRGlzY292ZXJ5UGVyaW9kLAorICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgIENGR19URExTX0RJU0NPVkVSWV9QRVJJT0RfREVGQVVMVCwKKyAgICAgICAgICAgICAgQ0ZHX1RETFNfRElTQ09WRVJZX1BFUklPRF9NSU4sCisgICAgICAgICAgICAgIENGR19URExTX0RJU0NPVkVSWV9QRVJJT0RfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX1RETFNfTUFYX0RJU0NPVkVSWV9BVFRFTVBULCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgZlRETFNNYXhEaXNjb3ZlcnlBdHRlbXB0LAorICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgIENGR19URExTX01BWF9ESVNDT1ZFUllfQVRURU1QVF9ERUZBVUxULAorICAgICAgICAgICAgICBDRkdfVERMU19NQVhfRElTQ09WRVJZX0FUVEVNUFRfTUlOLAorICAgICAgICAgICAgICBDRkdfVERMU19NQVhfRElTQ09WRVJZX0FUVEVNUFRfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX1RETFNfSURMRV9USU1FT1VULCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgZlRETFNJZGxlVGltZW91dCwKKyAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICBDRkdfVERMU19JRExFX1RJTUVPVVRfREVGQVVMVCwKKyAgICAgICAgICAgICAgQ0ZHX1RETFNfSURMRV9USU1FT1VUX01JTiwKKyAgICAgICAgICAgICAgQ0ZHX1RETFNfSURMRV9USU1FT1VUX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19URExTX0lETEVfUEFDS0VUX1RIUkVTSE9MRCwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGZURExTSWRsZVBhY2tldFRocmVzaG9sZCwKKyAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICBDRkdfVERMU19JRExFX1BBQ0tFVF9USFJFU0hPTERfREVGQVVMVCwKKyAgICAgICAgICAgICAgQ0ZHX1RETFNfSURMRV9QQUNLRVRfVEhSRVNIT0xEX01JTiwKKyAgICAgICAgICAgICAgQ0ZHX1RETFNfSURMRV9QQUNLRVRfVEhSRVNIT0xEX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19URExTX1JTU0lfSFlTVEVSRVNJUywgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGZURExTUlNTSUh5c3RlcmVzaXMsCisgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgQ0ZHX1RETFNfUlNTSV9IWVNURVJFU0lTX0RFRkFVTFQsCisgICAgICAgICAgICAgIENGR19URExTX1JTU0lfSFlTVEVSRVNJU19NSU4sCisgICAgICAgICAgICAgIENGR19URExTX1JTU0lfSFlTVEVSRVNJU19NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfVERMU19SU1NJX1RSSUdHRVJfVEhSRVNIT0xELCBXTEFOX1BBUkFNX1NpZ25lZEludGVnZXIsCisgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgZlRETFNSU1NJVHJpZ2dlclRocmVzaG9sZCwKKyAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICBDRkdfVERMU19SU1NJX1RSSUdHRVJfVEhSRVNIT0xEX0RFRkFVTFQsCisgICAgICAgICAgICAgIENGR19URExTX1JTU0lfVFJJR0dFUl9USFJFU0hPTERfTUlOLAorICAgICAgICAgICAgICBDRkdfVERMU19SU1NJX1RSSUdHRVJfVEhSRVNIT0xEX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19URExTX1JTU0lfVEVBUkRPV05fVEhSRVNIT0xELCBXTEFOX1BBUkFNX1NpZ25lZEludGVnZXIsCisgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgZlRETFNSU1NJVGVhcmRvd25UaHJlc2hvbGQsCisgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgQ0ZHX1RETFNfUlNTSV9URUFSRE9XTl9USFJFU0hPTERfREVGQVVMVCwKKyAgICAgICAgICAgICAgQ0ZHX1RETFNfUlNTSV9URUFSRE9XTl9USFJFU0hPTERfTUlOLAorICAgICAgICAgICAgICBDRkdfVERMU19SU1NJX1RFQVJET1dOX1RIUkVTSE9MRF9NQVggKSwKKworUkVHX1ZBUklBQkxFKCBDRkdfVERMU19RT1NfV01NX1VBUFNEX01BU0tfTkFNRSAsIFdMQU5fUEFSQU1fSGV4SW50ZWdlciwKKyAgICAgICAgICAgIC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lOLAorICAgICAgICAgICAgICBDRkdfVERMU19QVUFQU0RfUlhfRlJBTUVfVEhSRVNIT0xEX01BWCApLAorCitSRUdfVkFSSUFCTEUoIENGR19URExTX0VYVEVSTkFMX0NPTlRST0wsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBmVERMU0V4dGVybmFsQ29udHJvbCwKKyAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICBDRkdfVERMU19FWFRFUk5BTF9DT05UUk9MX0RFRkFVTFQsCisgICAgICAgICAgICAgIENGR19URExTX0VYVEVSTkFMX0NPTlRST0xfTUlOLAorICAgICAgICAgICAgICBDRkdfVERMU19FWFRFUk5BTF9DT05UUk9MX01BWCApLAorCitSRUdfVkFSSUFCTEUoIENGR19URExTX1dNTV9NT0RFX0VOQUJMRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGZFbmFibGVURExTV21tTW9kZSwKKyAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICBDRkdfVERMU19XTU1fTU9ERV9FTkFCTEVfREVGQVVMVCwKKyAgICAgICAgICAgICAgQ0ZHX1RETFNfV01NX01PREVfRU5BQkxFX01JTiwKKyAgICAgICAgICAgICAgQ0ZHX1RETFNfV01NX01PREVfRU5BQkxFX01BWCApLAorCitSRUdfVkFSSUFCTEUoIENGR19URExTX1NDQU5fQ09FWF9TVVBQT1JUX0VOQUJMRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGZFbmFibGVURExTU2NhbkNvZXhTdXBwb3J0LAorICAgICAgICAgICAg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3V0LAorICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCwKKyAgICAgICAgICAgICBDRkdfU0NBTl9BR0lOR19QQVJBTV9ERUZBVUxULAorICAgICAgICAgICAgIENGR19TQ0FOX0FHSU5HX1BBUkFNX01JTiwKKyAgICAgICAgICAgICBDRkdfU0NBTl9BR0lOR19QQVJBTV9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfVFhfTERQQ19FTkFCTEVfRkVBVFVSRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGVuYWJsZVR4TGRwYywKKyAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICBDRkdfVFhfTERQQ19FTkFCTEVfRkVBVFVSRV9ERUZBVUxULAorICAgICAgICAgICAgICBDRkdfVFhfTERQQ19FTkFCTEVfRkVBVFVSRV9NSU4sCisgICAgICAgICAgICAgIENGR19UWF9MRFBDX0VOQUJMRV9GRUFUVVJFX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19FTkFCTEVfTUNDX0FEQVRJVkVfU0NIRURVTEVSX0VOQUJMRURfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgZW5hYmxlTUNDQWRhcHRpdmVTY2hlZHVsZXIsCisgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgIENGR19FTkFCTEVfTUNDX0FEQVRJVkVfU0NIRURVTEVSX0VOQUJMRURfREVGQVVMVCwKKyAgICAgICAgICAgICBDRkdfRU5BQkxFX01DQ19BREFUSVZFX1NDSEVEVUxFUl9FTkFCTEVEX01JTiwKKyAgICAgICAgIC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V9ERUZBVUxULAorICAgICAgICAgICAgICAgIENGR19FTkFCTEVfU1NSX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgQ0ZHX0VOQUJMRV9TU1JfTUlOLAorICAgICAgICAgICAgICAgIENGR19FTkFCTEVfU1NSX01BWCwKKyAgICAgICAgICAgICAgICBjYk5vdGlmeVNldEVuYWJsZVNTUiwgMCApLAorCisgICBSRUdfVkFSSUFCTEVfU1RSSU5HKCBDRkdfTElTVF9PRl9OT05fMTFBQ19DT1VOVFJZX0NPREUsIFdMQU5fUEFSQU1fU3RyaW5nLAorICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgbGlzdE9mTm9uMTFhY0NvdW50cnlDb2RlLAorICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAodm9pZCAqKUNGR19MSVNUX09GX05PTl8xMUFDX0NPVU5UUllfQ09ERV9ERUZBVUxUKSwKKworICAgUkVHX1ZBUklBQkxFKENGR19NQVhfTUVESVVNX1RJTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGNmZ01heE1lZGl1bVRpbWUsCisgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgIENGR19NQVhfTUVESVVNX1RJTUVfU1RBREVGQVVMVCwKKyAgICAgICAgICAgICBDRkdfTUFYX01FRElVTV9USU1FX1NUQU1JTiwKKyAgICAgICAgICAgICBDRkdfTUFYX01FRElVTV9USU1FX1NUQU1BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19FTkFCTEVfVFJBRkZJQ19NT05JVE9SLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBlbmFib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FZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0FOVEVOTkFfRElWRVJTSVRZX1BBUkFNX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19BTlRFTk5BX0RJVkVSU0lUWV9QQVJBTV9NSU4sCisgICAgICAgICAgICAgICAgIENGR19BTlRFTk5BX0RJVkVSU0lUWV9QQVJBTV9NQVgpLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19FTkFCTEVfU05SX01PTklUT1JJTkdfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGZFbmFibGVTTlJNb25pdG9yaW5nLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0sgLAorICAgICAgICAgICAgICAgICBDRkdfRU5BQkxFX1NOUl9NT05JVE9SSU5HX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19FTkFCTEVfU05SX01PTklUT1JJTkdfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfRU5BQkxFX1NOUl9NT05JVE9SSU5HX01BWCksCisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fU0NBTl9QTk8KKyAgIFJFR19WQVJJQUJMRSggQ0ZHX1BOT19TQ0FOX1NVUFBPUlQsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBjb25maWdQTk9TY2FuU3VwcG9ydCwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfUE5PX1NDQU5fU1VQUE9SVF9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfUE5PX1NDQU5fU1VQUE9SVF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SUNUXzVHSFpfUFJFRl9CWV9NQVJHSU4gLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgblNlbGVjdDVHSHpNYXJnaW4sCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1NUUklDVF81R0haX1BSRUZfQllfTUFSR0lOX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19TVFJJQ1RfNUdIWl9QUkVGX0JZX01BUkdJTl9NSU4sCisgICAgICAgICAgICAgICAgIENGR19TVFJJQ1RfNUdIWl9QUkVGX0JZX01BUkdJTl9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfQ09BTEVTSU5HX0lOX0lCU1NfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBpc0NvYWxlc2luZ0luSUJTU0FsbG93ZWQsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0NPQUxFU0lOR19JTl9JQlNTX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19DT0FMRVNJTkdfSU5fSUJTU19NSU4sCisgICAgICAgICAgICAgICAgIENGR19DT0FMRVNJTkdfSU5fSUJTU19NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfRElTQUJMRV9BVEhfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBjZmdBdGhEaXNhYmxlLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFO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QsCisgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgIENGR19FTkFCTEVfTUVNT1JZX0RFQlVHX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgQ0ZHX0VOQUJMRV9NRU1PUllfREVCVUdfTUlOLAorICAgICAgICAgICAgICAgIENGR19FTkFCTEVfTUVNT1JZX0RFQlVHX01BWCApLAorI2VuZGlmCisKKyAgIFJFR19WQVJJQUJMRV9TVFJJTkcoIENGR19PVkVSUklERV9DT1VOVFJZX0NPREUsIFdMQU5fUEFSQU1fU3RyaW5nLAorICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgb3ZlcnJpZGVDb3VudHJ5Q29kZSwKKyAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwsCisgICAgICAgICAgICAgICAodm9pZCAqKUNGR19PVkVSUklERV9DT1VOVFJZX0NPREVfREVGQVVMVCksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX0FTRF9QUk9CRV9JTlRFUlZBTF9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgZ0FzZFByb2JlSW50ZXJ2YWwsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0FTRF9QUk9CRV9JTlRFUlZBTF9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfQVNEX1BST0JFX0lOVEVSVkFMX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX0FTRF9QUk9CRV9JTlRFUlZBTF9NQVgpLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19BU0RfVFJJR0dFUl9USFJFU0hPTERfTkFNRSwgV0xBT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gICBoZGRfY29uZmlnX3QsIHNhcEVuYWJsZTExQUMsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDSywKKyAgICAgICAgICAgICAgICAgQ0ZHX1NBUF9FTkFCTEVfMTFBQ19ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfU0FQX0VOQUJMRV8xMUFDX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX1NBUF9FTkFCTEVfMTFBQ19NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKENGR19SQV9GSUxURVJfRU5BQkxFX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGNmZ1JBRmlsdGVyRW5hYmxlLAorICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICBDRkdfUkFfRklMVEVSX0VOQUJMRV9ERUZBVUxULAorICAgICAgICAgICAgICAgIENGR19SQV9GSUxURVJfRU5BQkxFX01JTiwKKyAgICAgICAgICAgICAgICBDRkdfUkFfRklMVEVSX0VOQUJMRV9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKENGR19SQV9SQVRFX0xJTUlUX0lOVEVSVkFMX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgY2ZnUkFSYXRlTGltaXRJbnRlcnZhbCwKKyAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgIENGR19SQV9SQVRFX0xJTUlUX0lOVEVSVkFMX0RFRkFVTFQsCisgICAgICAgICAgICAgICBDRkdfUkFfUkFURV9MSU1JVF9JTlRFUlZBTF9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ICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgaWdub3JlUGVlckVycEluZm8sCisgICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfAorICAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICAgQ0ZHX0lHTk9SRV9QRUVSX0VSUF9JTkZPX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgICBDRkdfSUdOT1JFX1BFRVJfRVJQX0lORk9fTUlOLAorICAgICAgICAgICAgICAgICAgQ0ZHX0lHTk9SRV9QRUVSX0VSUF9JTkZPX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19JR05PUkVfUEVFUl9IVF9NT0RFX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgaWdub3JlUGVlckhUb3BNb2RlLAorICAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwKKyAgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgIENGR19JR05PUkVfUEVFUl9IVF9NT0RFX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgICBDRkdfSUdOT1JFX1BFRVJfSFRfTU9ERV9NSU4sCisgICAgICAgICAgICAgICAgICBDRkdfSUdOT1JFX1BFRVJfSFRfTU9ERV9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKENGR19JTklUSUFMX0RXRUxMX1RJTUVfTkFNRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBuSW5pdGlhbER3ZWxsVGltZSwKKyAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCw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GVnZXIsCisgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBlbmFibGVGV0xvZ2dpbmcsCisgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgIENGR19FTkFCTEVfRldfTE9HR0lOR19ERUZBVUxULAorICAgICAgICAgICAgICAgIENGR19FTkFCTEVfRldfTE9HR0lOR19NSU4sCisgICAgICAgICAgICAgICAgQ0ZHX0VOQUJMRV9GV19MT0dHSU5HX01BWCksCisKKyAgIFJFR19WQVJJQUJMRShDRkdfRU5BQkxFX0ZXX0NPTlRJTklPVVNfTE9HR0lORywgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgZW5hYmxlQ29udEZXTG9nZ2luZywKKyAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfCBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgQ0ZHX0VOQUJMRV9GV19DT05USU5JT1VTX0xPR0dJTkdfREVGQVVMVCwKKyAgICAgICAgICAgICAgICBDRkdfRU5BQkxFX0ZXX0NPTlRJTklPVVNfTE9HR0lOR19NSU4sCisgICAgICAgICAgICAgICAgQ0ZHX0VOQUJMRV9GV19DT05USU5JT1VTX0xPR0dJTkdfTUFYKSwKKworICAgUkVHX1ZBUklBQkxFKENGR19NSU5fTE9HR0lOR19CVUZGRVJfU0laRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgbWluTG9nZ2luZ0J1ZmZlclNpemUsCisgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgIENGR19NSU5fTE9HR0lOR19CVUZGRVJfU0laRV9ERUZBVUxULAorICAgICAgICAgICAgICAgIENGR19NSU5fTE9HR0lOR19CVUZGRVJfU0laRV9NSU4sCisgICAgICAgICAgICAgICAgQ0ZHX01JTl9MT0dHSU5HX0JVRkZFUl9TSVpFX01BWCksCisKKyAgIFJFR19WQVJJQUJMRShDRkdfTUFYX0xPR0dJTkdfQlVGRkVSX1NJWkUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG1heExvZ2dpbmdCdWZmZXJTaXplLAorICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICBDRkdfTUFYX0xPR0dJTkdfQlVGRkVSX1NJWkVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICBDRkdfTUFYX0xPR0dJTkdfQlVGRkVSX1NJWkVfTUlOLAorICAgICAgICAgICAgICAgIENGR19NQVhfTE9HR0lOR19CVUZGRVJfU0laRV9NQVgpLAorCisgICBSRUdfVkFSSUFCTEUoQ0ZHX0VOQUJMRV9DSF9BVk9JRCwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIGZlbmFibGVDSEF2b2lkYW5jZSwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfRU5BQkxFX0NIX0FWT0lEX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19FTkFCTEVfQ0hfQVZPSURfTUlOLAorICAgICAgICAgICAgICAgICBDRkdfRU5BQkxFX0NIX0FWT0lEX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoQ0ZHX01BWF9DT05DV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gICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgIENGR19FTkFCTEVfRFlOQU1JQ19XTU1fUFNfREVGQVVMVCwKKyAgICAgICAgICAgICAgICBDRkdfRU5BQkxFX0RZTkFNSUNfV01NX1BTX01JTiwKKyAgICAgICAgICAgICAgICBDRkdfRU5BQkxFX0RZTkFNSUNfV01NX1BTX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19NQVhfVUFQU0RfQ09OU0VDX1NQX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG1heFVhcHNkQ29uc2VjU1AsCisgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgIENGR19NQVhfVUFQU0RfQ09OU0VDX1NQX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgQ0ZHX01BWF9VQVBTRF9DT05TRUNfU1BfTUlOLAorICAgICAgICAgICAgICAgIENGR19NQVhfVUFQU0RfQ09OU0VDX1NQX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19NQVhfVUFQU0RfQ09OU0VDX1JYX0NOVF9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBtYXhVYXBzZENvbnNlY1J4Q250LAorICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICBDRkdfTUFYX1VBUFNEX0NPTlNFQ19SWF9DTlRfREVGQVVMVCwKKyAgICAgICAgICAgICAgICBDRkdfTUFYX1VBUFNEX0N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TEUoIENGR19VQVBTRF9DT05TRUNfVFhfQ05UX01FQVNfV0lORE9XX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIHVhcHNkQ29uc2VjVHhDbnRNZWFzV2luZG93LAorICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICBDRkdfVUFQU0RfQ09OU0VDX1RYX0NOVF9NRUFTX1dJTkRPV19ERUZBVUxULAorICAgICAgICAgICAgICAgIENGR19VQVBTRF9DT05TRUNfVFhfQ05UX01FQVNfV0lORE9XX01JTiwKKyAgICAgICAgICAgICAgICBDRkdfVUFQU0RfQ09OU0VDX1RYX0NOVF9NRUFTX1dJTkRPV19NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfVUFQU0RfUFNQT0xMX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG1heFBzUG9sbEluV21tVWFwc2RNb2RlLAorICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICBDRkdfVUFQU0RfUFNQT0xMX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgQ0ZHX1VBUFNEX1BTUE9MTF9NSU4sCisgICAgICAgICAgICAgICAgQ0ZHX1VBUFNEX1BTUE9MTF9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfTUFYX1VBUFNEX0lOQUNUX0lOVFZMX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICBoZGRfY29uZmlnX3QsIG1heFVhcHNkSW5hY3Rpdml0eUludGVydmFscywKKyAgICAgICAgICAgICAgICBWQVJfR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TlRFUlZBTF9NSU4sCisgICAgICAgICAgICAgICAgICBDRkdfUDJQX0xJU1RFTl9ERUZFUl9JTlRFUlZBTF9NQVgpLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19CVENfRU5BQkxFX0lORF9USU1FUl9WQUxVRSwgV0xBTl9QQVJBTV9JbnRlZ2VyLAorICAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBidGNFbmFibGVJbmRUaW1lclZhbCwKKyAgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8CisgICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgICBDRkdfQlRDX0VOQUJMRV9JTkRfVElNRVJfVkFMVUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgIENGR19CVENfRU5BQkxFX0lORF9USU1FUl9WQUxVRV9NSU4sCisgICAgICAgICAgICAgICAgICBDRkdfQlRDX0VOQUJMRV9JTkRfVElNRVJfVkFMVUVfTUFYKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfQlRDX0ZBU1RfV0xBTl9DT05OX1BSRUYgLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgYnRjRmFzdFdsYW5Db25uUHJlZiwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfQlRDX0ZBU1RfV0xBTl9DT05OX1BSRUZfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0JUQ19GQVNUX1dMQU5fQ09OTl9QUkVGX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX0JUQ19GQVNUX1dMQU5fQ09OTl9QUkVGX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19FT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ZVNTUkVuYWJsZSwKKyAgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8CisgICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgICBDRkdfRFhFX1NTUl9FTkFCTEVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgIENGR19EWEVfU1NSX0VOQUJMRV9NSU4sCisgICAgICAgICAgICAgICAgICBDRkdfRFhFX1NTUl9FTkFCTEVfTUFYICksCisKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX01VTFRJQ0FTVF9IT1NUX0ZXX01TR1MsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgbXVsdGljYXN0X2hvc3RfbXNncywKKyAgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8CisgICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgICBDRkdfTVVMVElDQVNUX0hPU1RfRldfTVNHU19ERUZBVUxULAorICAgICAgICAgICAgICAgICAgQ0ZHX01VTFRJQ0FTVF9IT1NUX0ZXX01TR1NfTUlOLAorICAgICAgICAgICAgICAgICAgQ0ZHX01VTFRJQ0FTVF9IT1NUX0ZXX01TR1NfTUFYKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfVE9HR0xFX0FSUF9CRFJBVEVTX05BTUUsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCB0b2dnbGVBcnBCRFJhdGVzLAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfT1BUSU9OQUwgfAorICAgICAgICAgICAgICAgICBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQsCisgICAgICAgICAgICAgIC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UNfT1BQX1dMQU5fSURMRV9CVF9MRU5fTUlOLAorICAgICAgICAgICAgICAgICBDRkdfQlRDX1NUQVRJQ19PUFBfV0xBTl9JRExFX0JUX0xFTl9NQVggKSwKKworICAgUkVHX1ZBUklBQkxFKCBDRkdfTElOS19GQUlMX1RJTUVPVVRfTkFNRSAsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBsaW5rRmFpbFRpbWVvdXQsCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX0xJTktfRkFJTF9USU1FT1VUX0RFRiwKKyAgICAgICAgICAgICAgICAgQ0ZHX0xJTktfRkFJTF9USU1FT1VUX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX0xJTktfRkFJTF9USU1FT1VUX01BWCApLAorCisgICBSRUdfVkFSSUFCTEUoIENGR19MSU5LX0ZBSUxfVFhfQ05UX05BTUUgLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgbGlua0ZhaWxUeENudCwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfTElOS19GQUlMX1RYX0NOVF9ERUYsCisgICAgICAgICAgICAgICAgIENGR19MSU5LX0ZBSUxfVFhfQ05UX01JTiwKKyAgICAgICAgICAgICAgICAgQ0ZHX0xJTktfRkFJTF9UWF9DTlRfTUFYICksCisgICBSRUdfVkFSSUFCTEUoIENGR19PUFRJTUlaRV9DQV9FVkVOVF9OQU1FLCBXTEFOX1BBUkFNX0ludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgZ09wdGltaXplQ0FldmVudCwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfT1BUSU1JWkVfQ0FfRVZFTlRfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX09QVElNSVpFX0NBX0VWRU5UX0RJU0FCTEUsCisgICAgICAgICAgICAgICAgIENGR19PUFRJTUlaRV9DQV9FVkVOVF9FTkFCTEUgKSwKKyAgIFJFR19WQVJJQUJMRSggQ0ZHX0VOQUJMRV9DUkFTSF9JTkpFQ1QsIFdMQU5fUEFSQU1fSW50ZWdlciwKKyAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190LCBjcmFzaF9pbmplY3RfZW5hYmxlZCwKKyAgICAgICAgICAgICAgICAgVkFSX0ZMQUdTX09QVElPTkFMIHwgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLX0FTU1VNRV9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfRU5BQkxFX0NSQVNIX0lOSkVDVF9ERUZBVUxULAorICAgICAgICAgICAgICAgICBDRkdfRU5BQkxFX0NSQVNIX0lOSkVDVF9NSU4sCisgICAgICAgICAgICAgICAgIENGR19FTkFCTEVfQ1JBU0hfSU5KRUNUX01BWCksCisKKyAgICBSRUdfVkFSSUFCTEUoIENGR19SUFNfQ1BVX01BUF9OQU1FLCBXTEFOX1BBUkFNX0hleEludGVnZXIsCisgICAgICAgICAgICAgICAgIGhkZF9jb25maWdfdCwgcnBzX21hc2ssCisgICAgICAgICAgICAgICAgIFZBUl9GTEFHU19PUFRJT05BTCB8IFZBUl9GTEFHU19SQU5HRV9DSEVDS19BU1NVTUVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgQ0ZHX1JQU19DUFVfTUFQX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgIENGR19SUFNfQ1BVX01BUF9NSU4sCisg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yAgICAgIGJ1ZmZlciA9IGlfdHJpbShidWZmZXIpOworCisgICAgICBoZGRMb2coTE9HMSwgIiVzOiBpdGVtIiwgYnVmZmVyKTsKKworICAgICAgaWYoc3RybGVuKChjaGFyKilidWZmZXIpID09IDAgfHwgKmJ1ZmZlciA9PSAnIycpICB7CisgICAgICAgICBidWZmZXIgPSBsaW5lOworICAgICAgICAgY29udGludWU7CisgICAgICB9CisgICAgICBlbHNlIGlmKHN0cm5jbXAoYnVmZmVyLCAiRU5EIiwgMykgPT0gMCApIHsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgbmFtZSA9IGJ1ZmZlcjsKKyAgICAgICAgIHdoaWxlKCpidWZmZXIgIT0gJz0nICYmICpidWZmZXIgIT0gJ1wwJykKKyAgICAgICAgICAgIGJ1ZmZlcisrOworICAgICAgICAgaWYoKmJ1ZmZlciAhPSAnXDAnKSB7CisgICAgICAgICAgICAqYnVmZmVyKysgPSAnXDAnOworICAgICAgICAgICAgaV90cmltKG5hbWUpOworICAgICAgICAgICAgaWYoc3RybGVuIChuYW1lKSAhPSAwKSB7CisgICAgICAgICAgICAgICBidWZmZXIgPSBpX3RyaW0oYnVmZmVyKTsKKyAgICAgICAgICAgICAgIGlmKHN0cmxlbihidWZmZXIpPjApIHsKKyAgICAgICAgICAgICAgICAgIHZhbHVlID0gYnVmZmVyOworICAgICAgICAgICAgICAgICAgd2hpbGUoIWlfaXNzcGFjZSgqYnVmZmVyKSAmJiAqYnVmZmVyICE9ICdcMCcpCisgICAgICAgICAgICAgICAgICAgICBidWZmZXIrKzsKKyAgICAgICAgICAgICAgICAgICpidWZmZXIgPSAnXDAnOworICAgICAgICAgICAgICAgICAgY2ZnSW5pVGFibGVbaV0ubmFtZT0gbmFtZTsKKyAgICAgICAgICAgICAgICAgIGNmZ0luaVRhYmxlW2krK10udmFsdWU9IHZhbHVlOworICAgICAgICAgICAgICAgICAgaWYoaSA+PSBNQVhfQ0ZHX0lOSV9JVEVNUykgeworICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsIiVzOiBOdW1iZXIgb2YgaXRlbXMgaW4gJXMgPiAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgV0xBTl9JTklfRklMRSwgTUFYX0NGR19JTklfSVRFTVMpOworICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICB9CisgICAgICBidWZmZXIgPSBsaW5lOworICAgfQorCisgICAvL0xvb3AgdGhyb3VnaCB0aGUgcmVnaXN0cnkgdGFibGUgYW5kIGFwcGx5IGFsbCB0aGVzZSBjb25maWdzCisgICB2b3Nfc3RhdHVzID0gaGRkX2FwcGx5X2NmZ19pbmkocEhkZEN0eCwgY2ZnSW5pVGFibGUsIGkpOworCitjb25maWdfZXhpdDoKKyAgIHJlbGVhc2VfZmlybXdhcmUoZncpOworICAgdm9zX21lbV92ZnJlZShwVGVtcCk7CisgICByZXR1cm4gdm9zX3N0YXR1czsKK30KKworCitzdGF0aWMgdm9pZCBwcmludF9oZGRfY2ZnKGhkZF9jb250ZXh0X3QgKnBIZGRDdHgpCit7CisgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIioqKioqKioqKkNvbmZpZyB2YWx1ZXMgaW4gSEREIEFkYXB0ZXIqKioqKioqIik7CisgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIk5hbWUgPSBbUlRTVGhyZXNob2xkXSBWYWx1ZSA9ICV1IixwSGRkQ3R4LT5jZmdfaW5pLT5SVFNUaHJlc2hvbGQpIDsKKyAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5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BQ0FERFJfdCAqcE1hY0FkZHI7CisgICBjaGFyICpwQ3VyID0gcEJ1ZjsKKyAgIGludCBjdXJsZW47CisKKyAgIC8vIHN0YXJ0IHdpdGggYW4gZW1wdHkgc3RyaW5nCisgICAqcEN1ciA9ICdcMCc7CisKKyAgIGZvciAoIGlkeCA9IDA7IGlkeCA8IGNSZWdUYWJsZUVudHJpZXM7IGlkeCsrLCBwUmVnRW50cnkrKyApCisgICB7CisgICAgICBwRmllbGQgPSAoICh2X1U4X3QgKilwSGRkQ3R4LT5jZmdfaW5pKSArIHBSZWdFbnRyeS0+VmFyT2Zmc2V0OworCisgICAgICBpZiAoICggV0xBTl9QQVJBTV9JbnRlZ2VyICAgICAgID09IHBSZWdFbnRyeS0+UmVnVHlwZSApIHx8CisgICAgICAgICAgICggV0xBTl9QQVJBTV9TaWduZWRJbnRlZ2VyID09IHBSZWdFbnRyeS0+UmVnVHlwZSApIHx8CisgICAgICAgICAgICggV0xBTl9QQVJBTV9IZXhJbnRlZ2VyICAgID09IHBSZWdFbnRyeS0+UmVnVHlwZSApICkKKyAgICAgIHsKKyAgICAgICAgIHZhbHVlID0gMDsKKyAgICAgICAgIG1lbWNweSggJnZhbHVlLCBwRmllbGQsIHBSZWdFbnRyeS0+VmFyU2l6ZSApOworICAgICAgICAgaWYgKCBXTEFOX1BBUkFNX0hleEludGVnZXIgPT0gcFJlZ0VudHJ5LT5SZWdUeXBlICkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGZtdCA9ICIleCI7CisgICAgICAgICB9CisgICAgICAgICBlbHNlIGlmICggV0xBTl9QQVJBTV9TaWduZWRJbnRlZ2VyID09IHBSZWdFbnRyeS0+UmVnVHlwZSApCisgICAgICAgICB7CisgICAgICAgICAgICBmbXQgPSAiJWQiOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgZm10ID0gIiV1IjsKKyAgICAgICAgIH0KKyAgICAgICAgIHNucHJpbnRmKHZhbHVlU3RyLCBDRkdfVkFMVUVfTUFYX0xFTiwgZm10LCB2YWx1ZSk7CisgICAgICB9CisgICAgICBlbHNlIGlmICggV0xBTl9QQVJBTV9TdHJpbmcgPT0gcFJlZ0VudHJ5LT5SZWdUeXBlICkKKyAgICAgIHsKKyAgICAgICAgIHNucHJpbnRmKHZhbHVlU3RyLCBDRkdfVkFMVUVfTUFYX0xFTiwgIiVzIiwgKGNoYXIgKilwRmllbGQpOworICAgICAgfQorICAgICAgZWxzZSBpZiAoIFdMQU5fUEFSQU1fTWFjQWRkciA9PSBwUmVnRW50cnktPlJlZ1R5cGUgKQorICAgICAgeworICAgICAgICAgcE1hY0FkZHIgPSAodl9NQUNBRERSX3QgKikgcEZpZWxkOworICAgICAgICAgc25wcmludGYodmFsdWVTdHIsIENGR19WQUxVRV9NQVhfTEVOLAorICAgICAgICAgICAgICAgICAgIiUwMng6JTAyeDolMDJ4OiUwMng6JTAyeDolMDJ4IiwKKyAgICAgICAgICAgICAgICAgIHBNYWNBZGRyLT5ieXRlc1swXSwKKyAgICAgICAgICAgICAgICAgIHBNYWNBZGRyLT5ieXRlc1sxXSwKKyAgICAgICAgICAgICAgICAgIHBNYWNBZGRyLT5ieXRlc1syXSwKKyAgICAgICAgICAgICAgICAgIHBNYWNBZGRyLT5ieXRlc1szXSwKKyAgICAgICAgICAgICAgICAgIHBNYWNBZGRyLT5ieXRlc1s0XSwKKyAgICAgICAgICAgICAgICAgIHBNYWNBZGRyLT5ieXRlc1s1XSk7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICBzbnByaW50Zih2YWx1ZVN0ciwgQ0ZHX1ZBTFVFX01BWF9MRU4sICIodW5oYW5kbGVkKSIpOworICAgICAgfQorICAgICAgY3VybGVuID0gc2NucHJpbnRmKGNvbmZpZ1N0ciwgQ0ZHX0VOVFJZX01BWF9MRU4sCisgICAgICAgICAgICAgICAgICAgICAgICAiJXM9WyVzXSVzXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgcFJlZ0VudHJ5LT5SZWdOYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWVTdHIsCisgICAgICAgICAgICAgICAgICAgICAgICB0ZXN0X2JpdChpZHgsICh2b2lkICopJnBIZGRDdHgtPmNmZ19pbmktPmJFeHBsaWNpdENmZykgPworICAgICAgICAgICAgICAgICAgICAgICAgIioiIDogIiIpOworCisgICAgICAvLyBpZGVhbGx5IHdlIHdhbnQgdG8gcmV0dXJuIHRoZSBjb25maWcgdG8gdGhlIGFwcGxpY2F0aW9uCisgICAgICAvLyBob3dldmVyIHRoZSBjb25maWcgaXMgdG9vIGJpZyBzbyB3ZSBqdXN0IHByaW50aygpIGZvciBub3cKKyNpZmRlZiBSRVRVUk5fSU5fQlVGRkVSCisgICAgICBpZiAoY3VybGVuIDw9IGJ1ZmxlbikKKyAgICAgIHsKKyAgICAgICAgIC8vIGNvcHkgc3RyaW5nICsgJ1wwJworICAgICAgICAgbWVtY3B5KHBDdXIsIGNvbmZpZ1N0ciwgY3VybGVuKzEpOworCisgICAgICAgICAvLyBhY2NvdW50IGZvciBhZGRpdGlvbjsKKyAgICAgICAgIHBDdXIgKz0gY3VybGVuOworICAgICAgICAgYnVmbGVuIC09IGN1cmxlbjsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgIC8vIGJ1ZmZlciBzcGFjZSBleGhhdXN0ZWQsIHJldHVybiB3aGF0IHdlIGhhdmUKKyAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfUkVTT1VSQ0VTOworICAgICAgfQorI2Vsc2UKKyAgICAgIHByaW50ayhLRVJOX0NSSVQgIiVzIiwgY29uZmlnU3RyKTsKKyNlbmRpZiAvLyBSRVRVUk5fSU5fQlVGRkVSCisKK30KKworI2lmbmRlZiBSRVRVUk5fSU5fQlVGRkVSCisgICAvLyBub3RpZnkgYXBwbGljYXRpb24gdGhhdCBvdXRwdXQgaXMgaW4gc3lzdGVtIGxvZworICAgc25w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W1lKTsKKyAgICAgICAgICAgICAgICB2YWx1ZSA9IHBSZWdFbnRyeS0+VmFyRGVmYXVsdDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgdmFsdWUgPSBwUmVnRW50cnktPlZhckRlZmF1bHQ7CisgICAgICAgICB9CisKKyAgICAgICAgIC8vIElmIHRoaXMgcGFyYW1ldGVyIG5lZWRzIHJhbmdlIGNoZWNraW5nLCBkbyBpdCBoZXJlLgorICAgICAgICAgaWYgKCBwUmVnRW50cnktPkZsYWdzICYgVkFSX0ZMQUdTX1JBTkdFX0NIRUNLICkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGlmICggdmFsdWUgPiBwUmVnRW50cnktPlZhck1heCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIiVzOiBSZWcgUGFyYW1ldGVyICVzID4gYWxsb3dlZCBNYXhpbXVtIFsldSA+ICVsdV0uIEVuZm9yY2luZyBNYXhpbXVtIiwKKyAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcFJlZ0VudHJ5LT5SZWdOYW1lLCB2YWx1ZSwgcFJlZ0VudHJ5LT5WYXJNYXggKTsKKyAgICAgICAgICAgICAgIHZhbHVlID0gcFJlZ0VudHJ5LT5WYXJNYXg7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICggdmFsdWUgPCBwUmVnRW50cnktPlZhck1pbiApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIiVzOiBSZWcgUGFyYW1ldGVyICVzIDwgYWxsb3dlZCBNaW5pbXVtIFsldSA8ICVsdV0uIEVuZm9yY2luZyBNaW5pbXVtIiwKKyAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcFJlZ0VudHJ5LT5SZWdOYW1lLCB2YWx1ZSwgcFJlZ0VudHJ5LT5WYXJNaW4pOworICAgICAgICAgICAgICAgdm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mVnRW50cnktPlZhckRlZmF1bHQ7CisgICAgICAgICAgICB9CisgICAgICAgICB9CisKKyAgICAgICAgIC8vIE1vdmUgdGhlIHZhcmlhYmxlIGludG8gdGhlIG91dHB1dCBmaWVsZC4KKyAgICAgICAgIG1lbWNweSggcEZpZWxkLCAmdmFsdWUsIHBSZWdFbnRyeS0+VmFyU2l6ZSApOworICAgICAgfQorICAgICAgZWxzZSBpZiAoIFdMQU5fUEFSQU1fU2lnbmVkSW50ZWdlciA9PSBwUmVnRW50cnktPlJlZ1R5cGUgKQorICAgICAgeworICAgICAgICAgLy8gSWYgc3VjY2Vzc2Z1bGx5IHJlYWQgZnJvbSB0aGUgcmVnaXN0cnksIHVzZSB0aGUgdmFsdWUgcmVhZC4KKyAgICAgICAgIC8vIElmIG5vdCwgdXNlIHRoZSBkZWZhdWx0IHZhbHVlLgorICAgICAgICAgaWYgKFZPU19TVEFUVVNfU1VDQ0VTUyA9PSBtYXRjaF9zdGF0dXMpCisgICAgICAgICB7CisgICAgICAgICAgICBydiA9IGtzdHJ0b3MzMih2YWx1ZV9zdHIsIDEwLCAmc3ZhbHVlKTsKKyAgICAgICAgICAgIGlmIChydiA8IDApIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX1dBUk4sICIlczogUmVnIFBhcmFtZXRlciAlcyBpbnZhbGlkLiBFbmZvcmNpbmcgRGVmYXVsdCIsCisgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBwUmVnRW50cnktPlJlZ05hbWUpOworICAgICAgICAgICAgICAgIHN2YWx1ZSA9ICh2X1MzMV90KXBSZWdFbnRyeS0+VmFyRGVmYXVsdDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHN2YWx1ZSA9ICh2X1MzMV90KXBSZWdFbnRyeS0+VmFyRGVmYXVsdDsKKyAgICAgICAgIH0KKworICAgICAgICAgLy8gSWYgdGhpcyBwYXJhbWV0ZXIgbmVlZHMgcmFuZ2UgY2hlY2tpbmcsIGRvIGl0IGhlcmUuCisgICAgICAgICBpZiAoIHBSZWdFbnRyeS0+RmxhZ3MgJiBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0sgKQorICAgICAgICAgeworICAgICAgICAgICAgaWYgKCBzdmFsdWUgPiAodl9TMzFfdClwUmVnRW50cnktPlZhck1heCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIiVzOiBSZWcgUGFyYW1ldGVyICVzID4gYWxsb3dlZCBNYXhpbXVtICIKKyAgICAgICAgICAgICAgICAgICAgICAiWyVkID4gJWRdLiBFbmZvcmNpbmcgTWF4aW11bSIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICAgIHBSZWdFbnRyeS0+UmVnTmFtZSwgc3ZhbHVlLCAoaW50KXBSZWdFbnRyeS0+VmFyTWF4ICk7CisgICAgICAgICAgICAgICBzdmFsdWUgPSAodl9TMzFfdClwUmVnRW50cnktPlZhck1heDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKCBzdmFsdWUgPCAodl9TMzFfdClwUmVnRW50cnktPlZhck1pbiApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIiVzOiBSZWcgUGFyYW1ldGVyICVzIDwgYWxsb3dlZCBNaW5pbXVtICIKKyAgICAgICAgICAgICAgICAgICAgICAiWyVkIDwgJWRdLiBFbmZvcmNpbmcgTWluaW11bSIsICBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgICBwUmVnRW50cnktPlJlZ05hbWUsIHN2YWx1ZSwgKGludClwUmVnRW50cnktPlZhck1pbik7CisgICAgICAgICAgICAgICBzdmFsdWUgPSAodl9TMzFfdClwUmVnRW50cnktPlZhck1pbjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgICAgIC8vIElmIHRoaXMgcGFyYW1ldGVyIG5lZWRzIHJhbmdlIGNoZWNraW5nLCBkbyBpdCBoZXJlLgorICAgICAgICAgZWxzZSBpZiAoIHBSZWdFbnRyeS0+RmxhZ3MgJiBWQVJfRkxBR1NfUkFOR0VfQ0hFQ0tfQVNTVU1FX0RFRkFVTFQgKQorICAgICAgICAgeworICAgICAgICAgICAgaWYgKCBzdmFsdWUgPiAodl9TMzFfdClwUmVnRW50cnktPlZhck1heCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIiVzOiBSZWcgUGFyYW1ldGVyICVzID4gYWxsb3dlZCBNYXhpbXVtICIKKyAgICAgICAgICAgICAgICAgICAgICAiWyVkID4gJWRdLiBFbmZvcmNpbmcgRGVmYXVsdD0gJWQiLAorICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBwUmVnRW50cnktPlJlZ05hbWUsIHN2YWx1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAoaW50KXBSZWdFbnRyeS0+VmFyTWF4LAorICAgICAgICAgICAgICAgICAgICAgIChpbnQpcFJlZ0VudHJ5LT5WYXJEZWZhdWx0ICApOworICAgICAgICAgICAgICAgc3ZhbHVlID0gKHZfUzMxX3QpcFJlZ0VudHJ5LT5WYXJEZWZhdWx0OworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoIHN2YWx1ZSA8ICh2X1MzMV90KXBSZWdFbnRyeS0+VmFyTWluICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCAiJXM6IFJlZyBQYXJhbWV0ZXIgJXMgPCBhbGxvd2VkIE1pbmltdW0gIgorICAgICAgICAgICAgICAgICAgICAgICJbJWQgPCAlZF0uIEVuZm9yY2luZyBEZWZhdWx0PSAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHBSZWdFbnRyeS0+UmVnTmFtZSwgc3ZhbHVlLAorICAgICAgICAgICAgICAgICAgICAgIChpbnQpcFJlZ0Vud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U9WyVzXSBzcGVjaWZpZWQgZm9yIE5hbWU9WyVzXSBpbiAlcyIsCisgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgdmFsdWVfc3RyLCBwUmVnRW50cnktPlJlZ05hbWUsIFdMQU5fSU5JX0ZJTEUpOworICAgICAgICAgICAgICAgY2JPdXRTdHJpbmcgPSB1dGlsTWluKCBzdHJsZW4oIChjaGFyICopcFJlZ0VudHJ5LT5WYXJEZWZhdWx0ICksIHBSZWdFbnRyeS0+VmFyU2l6ZSAtIDEgKTsKKyAgICAgICAgICAgICAgIG1lbWNweSggcEZpZWxkLCAodm9pZCAqKShwUmVnRW50cnktPlZhckRlZmF1bHQpLCBjYk91dFN0cmluZyApOworICAgICAgICAgICAgICAgKCAodl9VOF90ICopcEZpZWxkIClbIGNiT3V0U3RyaW5nIF0gPSAnXDAnOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgbWVtY3B5KCBwRmllbGQsICh2b2lkICopKHZhbHVlX3N0ciksIGxlbl92YWx1ZV9zdHIpOworICAgICAgICAgICAgICAgKCAodl9VOF90ICopcEZpZWxkIClbIGxlbl92YWx1ZV9zdHIgXSA9ICdcMCc7CisgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICAvLyBGYWlsZWQgdG8gcmVhZCB0aGUgc3RyaW5nIHBhcmFtZXRlciBmcm9tIHRoZSByZWdpc3RyeS4gIFVzZSB0aGUgZGVmYXVsdC4KKyAgICAgICAgICAgIGNiT3V0U3RyaW5nID0gdXRpbE1pbiggc3RybGVuKCAoY2hhciAqKXBSZWdFbnRyeS0+VmFyRGVmYXVsdCApLCBwUmVnRW50cnktPlZhclNpemUgLSAxICk7CisgICAgICAgICAgICBtZW1jcHkoIHBGaWVsZCwgKHZvaWQgKikocFJlZ0VudHJ5LT5WYXJEZWZhdWx0KSwgY2JPdXRTdHJpbmcgKTsKKyAgICAgICAgICAgICggKHZfVThfdCAqKXBGaWVsZCApWyBjYk91dFN0cmluZyBdID0gJ1wwJzsKKyAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCBXTEFOX1BBUkFNX01hY0FkZHIgPT0gcFJlZ0VudHJ5LT5SZWdUeXBlICkKKyAgICAgIHsKKyAgICAgICAgIGlmKHBSZWdFbnRyeS0+VmFyU2l6ZSAhPSBWT1NfTUFDX0FERFJfU0laRSkgeworICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsICIlczogSW52YWxpZCBWYXJTaXplICV1IGZvciBOYW1lPVslc10iLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBwUmVnRW50cnktPlZhclNpemUsIHBSZWdFbnRyeS0+UmVnTmFtZSk7CisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgIH0KKyAgICAgICAgIGNhbmRpZGF0ZSA9IChjaGFyKilwUmVnRW50cnktPlZhckRlZmF1bHQ7CisgICAgICAgICBpZiAoIG1hdGNoX3N0YXR1cyA9PSBWT1NfU1RBVFVTX1NVQ0NFU1MpIHsKKyAgICAgICAgICAgIGxlbl92YWx1ZV9zdHIgPSBzdHJsZW4odmFsdWVfc3RyKTsKKyAgICAgICAgICAgIGlmKGxlbl92YWx1ZV9zdHIgIT0gKFZPU19NQUNfQUREUl9TSVpFKjIpKSB7CisgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIiVzOiBJbnZhbGlkIE1BQyBhZGRyIFslc10gc3BlY2lmaWVkIGZvciBOYW1lPVslc10gaW4gJXMiLAorICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHZhbHVlX3N0ciwgcFJlZ0VudHJ5LT5SZWdOYW1lLCBXTEFOX0lOSV9GSUxFKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgIGNhbmRpZGF0ZSA9IHZhbHVlX3N0cjsKKyAgICAgICAgIH0KKyAgICAgICAgIC8vcGFyc2UgdGhlIHN0cmluZyBhbmQgc3RvcmUgaXQgaW4gdGhlIGJ5dGUgYXJyYXkKKyAgICAgICAgIGZvcihpPTA7IGk8Vk9TX01BQ19BRERSX1NJWkU7IGkrKykKKyAgICAgICAgIHsKKyAgICAgICAgICAgICgoY2hhciopcEZpZWxkKVtpXSA9CisgICAgICAgICAgICAgIChjaGFyKShwYXJzZUhleERpZ2l0KGNhbmRpZGF0ZVtpKjJdKSoxNiArIHBhcnNlSGV4RGlnaXQoY2FuZGlkYXRlW2kqMisxXSkpOworICAgICAgICAgfQorICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgaGRkTG9nKExPR0UsICIlczogVW5rbm93biBwYXJhbSB0eXBlIGZvciBuYW1lWyVzXSBpbiByZWdpc3RyeSB0YWJsZSIsCisgICAgICAgICAgICBfX2Z1bmNfXywgcFJlZ0VudHJ5LT5SZWdOYW1lKTsKKyAgICAgIH0KKworICAgICAgLy8gZGlkIHdlIHN1Y2Nlc3NmdWxseSBwYXJzZSBhIGNmZyBpdGVtIGZvciB0aGlzIHBhcmFtZXRlcj8KKyAgICAgIGlmKCAobWF0Y2hfc3RhdHVzID09IFZPU19TVEFUVVNfU1VDQ0VTUykgJiYKKyAgICAgICAgICAoaWR4IDwgTUFYX0NGR19JTklfSVRFTVMpICkKKyAgICAgIHsKKyAgICAgICAgIHNldF9iaXQoaWR4LCAodm9pZCAqKSZwSGRkQ3R4LT5jZmdfaW5pLT5iRXhwbGljaXRDZmcpOworICAgICAgfQorICAgfQorCisgICBwcmludF9oZGRfY2ZnKHBIZGRDdHgpOworCisgIHJldHVybiggcmV0X3N0YXR1cyApOworfQorCitlQ3NyUGh5TW9kZSBoZGRfY2ZnX3hsYXRlX3RvX2Nzcl9waHlfbW9kZSggZUhkZERvdDExTW9kZSBkb3QxMU1vZGUgKQoreworICAgc3dpdGNoIChkb3QxMU1vZGUpCisgICB7CisgICAgICBjYXNlIChlSEREX0RPVDExX01PREVfYWJnKToKKyAgICAgICAgIHJldHVybiBlQ1NSX0RPVDExX01PREVfYWJnOworICAgICAgY2FzZSAoZUhERF9ET1QxMV9NT0RFXzExYik6CisgICAgICAgICByZXR1cm4gZUNTUl9ET1QxMV9NT0RFXzExYjsKKyAgICAgIGNhc2UgKGVIRERfRE9UMTFfTU9ERV8xMWcpOgorICAgICAgICAgcmV0dXJuIGVDU1JfRE9UMTFfTU9ERV8xMWc7CisgICAgICBkZWZhdWx0OgorICAgICAgY2FzZSAoZUhERF9ET1QxMV9NT0RFXzExbik6CisgICAgICAgICByZXR1cm4gZUNTUl9ET1QxMV9NT0RFXzExbjsKKyAgICAgIGNhc2UgKGVIRERfRE9UMTFfTU9ERV8xMWdfT05MWSk6CisgICAgICAgICByZXR1cm4gZUNTUl9ET1QxMV9NT0RFXzExZ19PTkxZOworICAgICAgY2FzZSAoZUhERF9ET1QxMV9NT0RFXzExbl9PTkxZKToKKyAgICAgICAgIHJldHVybiBlQ1NSX0RPVDExX01PREVfMTFuX09OTFk7CisgICAgICBjYXNlIChlSEREX0RPVDExX01PREVfMTFiX09OTFkpOgorICAgICAgICAgcmV0dXJuIGVDU1JfRE9UMTFfTU9ERV8xMWJfT05MWTsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgICAgY2FzZSAoZUhERF9ET1QxMV9NT0RFXzExYWNfT05MWSk6CisgICAgICAgICByZXR1cm4gZUNTUl9ET1QxMV9NT0RFXzExYWNfT05MWTsKKyAgICAgIGNhc2UgKGVIRERfRE9UMTFfTU9ERV8xMWFjKToKKyAgICAgICAgIHJldHVybiBlQ1NSX0RPVDExX01PREVfMTFhYzsKKyNlbmRpZgorICAgICAgY2FzZSAoZUhERF9ET1QxMV9NT0RFX0FVVE8pOgorICAgICAgICAgcmV0dXJuIGVDU1JfRE9UMTFfTU9ERV9BVVRPOworICAgfQorCit9CisKK3N0YXRpYyB2b2lkIGhkZF9zZXRfYnRjX2NvbmZpZyhoZGRfY29udGV4dF90ICpw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ZpZy0+YmNuRWFybHlUZXJtV2FrZUludGVydmFsOworICAgfQorICAgaWYgKHN0cmNtcChwQ29uZmlnLT5Qb3dlclVzYWdlQ29udHJvbCwgIk1heCIpID09IDApCisgICB7CisgICAgICBzbWVDb25maWctPmNzckNvbmZpZy5pbXBzU2xlZXBUaW1lICAgPSBwQ29uZmlnLT5uSW1wc01heFNsZWVwVGltZTsKKyAgICAgIGJtcHNQYXJhbXMuYm1wc1BlcmlvZCAgICAgICAgICAgICAgICA9IHBDb25maWctPm5CbXBzTWF4TGlzdGVuSW50ZXJ2YWw7CisgICAgICBibXBzUGFyYW1zLmVuYWJsZUJlYWNvbkVhcmx5VGVybWluYXRpb24gPSBwQ29uZmlnLT5mRW5hYmxlQmVhY29uRWFybHlUZXJtaW5hdGlvbjsKKyAgICAgIGJtcHNQYXJhbXMuYmNuRWFybHlUZXJtV2FrZUludGVydmFsICA9IHBDb25maWctPmJjbkVhcmx5VGVybVdha2VJbnRlcnZhbDsKKyAgIH0KKyAgIGlmIChzdHJjbXAocENvbmZpZy0+UG93ZXJVc2FnZUNvbnRyb2wsICJNb2QiKSA9PSAwKQorICAgeworICAgICAgc21lQ29uZmlnLT5jc3JDb25maWcuaW1wc1NsZWVwVGltZSAgID0gcENvbmZpZy0+bkltcHNNb2RTbGVlcFRpbWU7CisgICAgICBibXBzUGFyYW1zLmJtcHNQZXJpb2QgICAgICAgICAgICAgICAgPSBwQ29uZmlnLT5uQm1wc01vZExpc3RlbkludGVydmFsOworICAgICAgYm1wc1BhcmFtcy5lbmFibGVCZWFjb25FYXJseVRlcm1pbmF0aW9uID0gcENvbmZpZy0+ZkVuYWJsZUJlYWNvbkVhcmx5VGVybWluYXRpb247CisgICAgICBibXBzUGFyYW1zLmJjbkVhcmx5VGVybVdha2VJbnRlcnZhbCAgPSBwQ29uZmlnLT5iY25FYXJseVRlcm1XYWtlSW50ZXJ2YWw7CisgICB9CisKKyAgIGlmIChwQ29uZmlnLT5mSXNJbXBzRW5hYmxl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VJFKQorICAgeworICAgICAgaGRkTG9nKExPR0UsICJTZXRDb25maWdQb3dlclNhdmUgZmFpbGVkIHRvIHNldCBCTVBTIHBhcmFtcyIpOworICAgfQorCisgICBpZihwQ29uZmlnLT5mSXNBdXRvQm1wc1RpbWVyRW5hYmxlZCkKKyAgIHsKKyAgICAgIHNtZV9TdGFydEF1dG9CbXBzVGltZXIocEhkZEN0eC0+aEhhbCk7CisgICB9CisKK30KKworI2lmZGVmIFdMQU5fRkVBVFVSRV9ORUlHSEJPUl9ST0FNSU5HCitzdGF0aWMgVk9TX1NUQVRVUyBoZGRfc3RyaW5nX3RvX3U4X2FycmF5KCBjaGFyICpzdHIsIHRBTklfVTggKmludEFycmF5LCB0QU5JX1U4ICpsZW4sIHRBTklfVTggaW50QXJyYXlNYXhMZW4gKQoreworICAgY2hhciAqcyA9IHN0cjsKKworICAgaWYoIHN0ciA9PSBOVUxMIHx8IGludEFycmF5ID09IE5VTEwgfHwgbGVuID09IE5VTEwgKQorICAgeworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgIH0KKyAgICpsZW4gPSAwOworCisgICB3aGlsZSAoIChzICE9IE5VTEwpICYmICgqbGVuIDwgaW50QXJyYXlNYXhMZW4pICkKKyAgIHsKKyAgICAgIGludCB2YWw7CisgICAgICAvL0luY3JlbWVudCBsZW5ndGggb25seSBpZiBzc2NhbmYgc3VjY2VzZnVsbHkgZXh0cmFjdGVkIG9uZSBlbGVtZW50LgorICAgICAgLy9Bbnkgb3RoZXIgcmV0dXJuIHZhbHVlIG1lYW5zIGVycm9yLiBJZ25vcmUgaXQuCisgICAgICBpZiggc3NjYW5mKHMsICIlZCIsICZ2YWwgKSA9PSAxICkKKyAgICAgIHsKKyAgICAgICAgIGludEFycmF5WypsZW5dID0gKHRBTklfVTgpIHZhbDsKKyAgICAgICAgICpsZW4gKz0gMTsKKyAgICAgIH0KKyAgICAgIHMgPSBzdHJwYnJrKCBzLCAiLCIgKTsKKyAg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UQVRJT05fVEhSRVNIT0xEIGNvbmZpZ3VyYXRpb24gaW5mbyB0byBDQ00iICApOworICAgIH0KKyAgICBpZihjY21DZmdTZXRJbnQocEhkZEN0eC0+aEhhbCwgV05JX0NGR19SVFNfVEhSRVNIT0xELCBwQ29uZmlnLT5SVFNUaHJlc2hvbGQsCisgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLCBlQU5JX0JPT0xFQU5fRkFMU0UpID09IGVIQUxfU1RBVFVTX0ZBSUxVUkUpCisgICAgeworICAgICAgICBmU3RhdHVzID0gRkFMU0U7CisgICAgICAgIGhkZExvZyhMT0dFLCJGYWlsdXJlOiBDb3VsZCBub3QgcGFzcyBvbiBXTklfQ0ZHX1JUU19USFJFU0hPTEQgY29uZmlndXJhdGlvbiBpbmZvIHRvIENDTSIgICk7CisgICAgfQorCisgICAgaWYoY2NtQ2ZnU2V0SW50KHBIZGRDdHgtPmhIYWwsIFdOSV9DRkdfMTFEX0VOQUJMRUQsIHBDb25maWctPklzMTFkU3VwcG9ydEVuYWJsZWQsCisgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLCBlQU5JX0JPT0xFQU5fRkFMU0UpID09IGVIQUxfU1RBVFVTX0ZBSUxVUkUpCisgICAgeworICAgICAgICBmU3RhdHVzID0gRkFMU0U7CisgICAgICAgIGhkZExvZyhMT0dFLCJGYWlsdXJlOiBDb3VsZCBub3QgcGFzcyBvbiBXTklfQ0ZHXzExRF9FTkFCTEVEIGNvbmZpZ3VyYXRpb24gaW5mbyB0byBDQ00iICApOworICAgIH0KKyAgICBpZihjY21DZmdTZXRJbnQocEhkZEN0eC0+aEhhbCwgV05JX0NGR19IRUFSVF9CRUFUX1RIUkVTSE9MRCwgcENvbmZpZy0+SGVhcnRiZWF0VGhyZXNoMjQsCisgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLCBlQU5JX0JPT0xFQU5fRkFMU0UpID09IGVIQUxfU1RBVFVTX0ZBSUxVUkUpCisgICAgeworICAgICAgICBmU3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1hcCBpbiB0aGUgY2ZnLmRhdCAqLworICAgLyogdmFsaWQgdmFsdWVzIGFyZSAwKE1DUzAtNyksIDEoTUNTMC04KSwgMihNQ1MwLTkpICovCisgICAvKiB3ZSB1cGRhdGUgb25seSB0aGUgbGVhc3Qgc2lnbmlmaWNhbnQgMiBiaXRzIGluIHRoZSBjb3JyZXNwb25kaW5nIGZpZWxkcyAqLworICAgaWYoIChwQ29uZmlnLT5kb3QxMU1vZGUgPT0gZUhERF9ET1QxMV9NT0RFX0FVVE8pIHx8CisgICAgICAgKHBDb25maWctPmRvdDExTW9kZSA9PSBlSEREX0RPVDExX01PREVfMTFhY19PTkxZKSB8fAorICAgICAgIChwQ29uZmlnLT5kb3QxMU1vZGUgPT0gZUhERF9ET1QxMV9NT0RFXzExYWMpICkKKyAgIHsKKyAgICAgICB7CisgICAgICAgICAgIHRBTklfVTMyIHRlbXAgPSAwOworCisgICAgICAgICAgIGNjbUNmZ0dldEludChwSGRkQ3R4LT5oSGFsLCBXTklfQ0ZHX1ZIVF9CQVNJQ19NQ1NfU0VULCAmdGVtcCk7CisgICAgICAgICAgIHRlbXAgPSAodGVtcCAmIDB4RkZGQykgfCBwQ29uZmlnLT52aHRSeE1DUzsKKworICAgICAgICAgICBpZihjY21DZmdTZXRJbnQocEhkZEN0eC0+aEhhbCwgV05JX0NGR19WSFRfQkFTSUNfTUNTX1NFVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAsIE5VTEwsIGVBTklfQk9PTEVBTl9GQUxTRSkKKyAgICAgICAgICAgICAgID09ZUhBTF9TVEFUVVNfRkFJTFVSRSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgZlN0YXR1cyA9IEZBTFNFOworICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsICJDb3VsZCBub3QgcGFzcyBvbiBXTklfQ0ZHX1ZIVF9CQVNJQ19NQ1NfU0VUIHRvIENDTSIpOworICAgICAgICAgICB9CisKKyAgICAgICAgICAgY2NtQ2ZnR2V0SW50KHBIZGRDdHgtPmhIYWwsIFdOSV9DRkdfVkhUX1JYX01DU19NQVAsICZ0ZW1wKTsKKyAgICAgICAgICAgdGVtcCA9ICh0ZW1wICYgMHhGRkZDKSB8IHBDb25maWctPnZodFJ4TUNTOworCisgICAgICAgICAgIGlmKGNjbUNmZ1NldEludChwSGRkQ3R4LT5oSGFsLCBXTklfQ0ZHX1ZIVF9SWF9NQ1NfTUFQLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCwgTlVMTCwgZUFOSV9CT09MRUFOX0ZBTFNFKQorICAgICAgICAgICAgICAgPT1lSEFMX1NUQVRVU19GQUlMVVJFKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgIGZTdGF0dXMgPSBGQUxTRTsKKyAgICAgICAgICAgICAgaGRkTG9nKExPR0UsICJDb3VsZCBub3QgcGFzcyBvbiBXTklfQ0ZHX1ZIVF9SWF9NQ1NfTUFQIHRvIENDTSIpOworICAgICAgICAgICB9CisKKyAgICAgICAgICAgY2NtQ2ZnR2V0SW50KHBIZGRDdHgtPmhIYWwsIFdOSV9DRkdfVkhUX1RYX01DU19NQVAsICZ0ZW1wKTsKKyAgICAgICAgICAgdGVtcCA9ICh0ZW1wICYgMHhGRkZDKSB8IHBDb25maWctPnZodFR4TUNTOworCisgICAgICAgICAgIGlmKGNjbUNmZ1NldEludChwSGRkQ3R4LT5oSGFsLCBXTklfQ0ZHX1ZIVF9UWF9NQ1NfTUFQLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCwgTlVMTCwgZUFOSV9CT09MRUFOX0ZBTFNFKQorICAgICAgICAgICAgICAgPT1lSEFMX1NUQVRVU19GQUlMVVJFKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBmU3RhdHVzID0gRkFMU0U7CisgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIkNvdWxkIG5vdCBwYXNzIG9uIFdOSV9DRkdfVkhUX1RYX01DU19NQVAgdG8gQ0NNIik7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgLyogQ3VycmVudGx5IHNob3J0R0k0ME1oeiBpcyB1c2VkIGZvciBzaG9ydEdJODBNaHogKi8KKyAgICAgICAgICAgaWYgKGNjbUNmZ1NldEludChwSGRkQ3R4LT5oSGFsLCBXTklfQ0ZHX1ZIVF9TSE9SVF9HSV84ME1IWiwKKyAgICAgICAgICAgICAgIHBDb25maWctPlNob3J0R0k0ME1oekVuYWJsZSwgTlVMTCwgZUFOSV9CT09MRUFOX0ZBTFNFKQorICAgICAgICAgICAgICAgPT0gZUhBTF9TVEFUVVNfRkFJTFVSRSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgZlN0YXR1cyA9IEZBTFNFOworICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsICJDb3VsZCBub3QgcGFzcyBXTklfVkhUX1NIT1JUX0dJXzgwTUhaIHRvIENDTVxuIik7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgaWYgKGNjbUNmZ1NldEludChwSGRkQ3R4LT5oSGFsLCBXTklfQ0ZHX1ZIVF9BTVBEVV9MRU5fRVhQT05FTlQsCisgICAgICAgICAgICAgICBwQ29uZmlnLT5nVmh0TWF4QW1wZHVMZW5FeHAsIE5VTEwsIGVBTklfQk9PTEVBTl9GQUxTRSkKKyAgICAgICAgICAgICAgID09ZUhBTF9TVEFUVVNfRkFJTFVSRSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgZlN0YXR1cyA9IEZBTFNFOworICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsICJDb3VsZCBub3QgcGFzcyBvbiBXTklfQ0ZHX1ZIVF9BTVBEVV9MRU5fRVhQT05FTlQgdG8gQ0NNIik7CisgICAgICAgICAgIH0KKworICAgICAgIH0KKyAgIH0KKyNlbmRpZgorCisgICAgIGlmIChjY21DZmdTZXRJbnQocEhkZEN0eC0+aEhhbCwgV05JX0NGR19OVU1fQlVGRl9BRFZFUlQscENvbmZpZy0+bnVtQnVmZkFkdmVydC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HBIZGRDdHgtPmhIYWwsIFdOSV9DRkdfQVNEX1JUVF9SU1NJX0hZU1RfVEhSRVNIT0xELAorICAgICAgICAgICAgICAgICAgICBwQ29uZmlnLT5nQXNkUlRUUnNzaUh5c3RUaHJlc2hvbGQsIE5VTEwsCisgICAgICAgICAgICAgICAgICAgIGVBTklfQk9PTEVBTl9GQUxTRSk9PWVIQUxfU1RBVFVTX0ZBSUxVUkUpCisgICB7CisgICAgICBmU3RhdHVzID0gRkFMU0U7CisgICAgICBoZGRMb2coTE9HRSwgIkNvdWxkIG5vdCBwYXNzIG9uIFdOSV9DRkdfQVNEX1JTU0lfSFlTVF9USFJFU0hPTEQgdG8gQ0NNIik7CisgICB9CisKKyAgIGlmIChjY21DZmdTZXRJbnQocEhkZEN0eC0+aEhhbCwKKyAgICAgICAgICAgICAgICAgICAgV05JX0NGR19ERUJVR19QMlBfUkVNQUlOX09OX0NIQU5ORUwsCisgICAgICAgICAgICAgICAgICAgIHBDb25maWctPmRlYnVnUDJwUmVtYWluT25DaGFubmVsLAorICAgICAgICAgICAgICAgICAgICBOVUxMLCBlQU5JX0JPT0xFQU5fRkFMU0UpID09IGVIQUxfU1RBVFVTX0ZBSUxVUkUpCisgICB7CisgICAgICAgZlN0YXR1cyA9IEZBTFNFOworICAgICAgIGhkZExvZyhMT0dFLAorICAgICAgICAgICAgICAiQ291bGQgbm90IHBhc3Mgb24gV05JX0NGR19ERUJVR19QMlBfUkVNQUlOX09OX0NIQU5ORUwgdG8gQ0NNIik7CisgICB9CisKKyAgIGlmIChjY21DZmdTZXRJbnQocEhkZEN0eC0+aEhhbCwKKyAgICAgICAgICAgICAgICAgICAgV05JX0NGR19CVENfQ1RTMlNfRFVSSU5HX1NDTywKKyAgICAgICAgICAgICAgICAgICAgcENvbmZpZy0+Y2ZnQnRjQ1RTMlNkdXJpbmdTQ08sCisgICAgICAgICAgICAgICAgICAgIE5VTEwsIGVBTklfQk9PTEVBTl9GQUxTRSkgPT0gZUhBTF9TVEF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HsKKwkJCSAgICAgICBmU3RhdHVzID0gRkFMU0U7CisgICAgICAgaGRkTG9nKExPR0UsICJDb3VsZCBub3QgcGFzcyBvbiIKKyAgICAgICAgICAgICAgICAgICAgIldOSV9DRkdfQlRDX0NSSVRJQ0FMX0hJRF9OU05JRkZfQkxLX0dVSURBTkNFIHRvIENDTSIpOworICAgfQorCisgICBpZiAoY2NtQ2ZnU2V0SW50KHBIZGRDdHgtPmhIYWwsCisgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfQlRDX0RZTl9BMkRQX1RYX1FVRVVFX1RIT0xELAorICAgICAgICAgICAgICAgICAgICBwQ29uZmlnLT5jZmdCdGNBMmRwVHhRdWV1ZVRob2xkLAorICAgICAgICAgICAgICAgICAgICBOVUxMLCBlQU5JX0JPT0xFQU5fRkFMU0UpID09IGVIQUxfU1RBVFVTX0ZBSUxVUkUpCisgICB7CisJCQkgICAgICAgZlN0YXR1cyA9IEZBTFNFOworICAgICAgIGhkZExvZyhMT0dFLCAiQ291bGQgbm90IHBhc3Mgb24iCisgICAgICAgICAgICAgICAgICAgICJXTklfQ0ZHX0JUQ19EWU5fQTJEUF9UWF9RVUVVRV9USE9MRCB0byBDQ00iKTsKKyAgIH0KKworICAgaWYgKGNjbUNmZ1NldEludChwSGRkQ3R4LT5oSGFsLAorICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX0JUQ19EWU5fT1BQX1RYX1FVRVVFX1RIT0xELAorICAgICAgICAgICAgICAgICAgICBwQ29uZmlnLT5jZmdCdGNPcHBUeFF1ZXVlVGhvbGQsCisgICAgICAgICAgICAgICAgICAgIE5VTEwsIGVBTklfQk9PTEVBTl9GQUxTRSkgPT0gZUhBTF9TVEFUVVNfRkFJTFVSRSkKKyAgIHsKKwkJCSAgICAgICBmU3RhdHVzID0gRkFMU0U7CisgICAgICAgaGRkTG9nKExPR0UsICJDb3VsZCBub3QgcGFzcyBvbiIKKyAgICAgICAgICAgICAgICAgICAgIldOSV9DRkdfQlRDX0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kZExvZyhMT0dFLCAiQ291bGQgbm90IHBhc3Mgb24gV05JX0NGR19NQVhfUFNQT0xMX0lOX1dNTV9VQVBTRF9QU19NT0RFIik7CisgICB9CisKKyAgIGlmIChjY21DZmdTZXRJbnQocEhkZEN0eC0+aEhhbCwgV05JX0NGR19NQVhfVUFQU0RfSU5BQ1RJVklUWV9JTlRFUlZBTFMsCisgICAgICAgICAgICAgICAgICAgIHBDb25maWctPm1heFVhcHNkSW5hY3Rpdml0eUludGVydmFscywgTlVMTCwKKyAgICAgICAgICAgICAgICAgICAgZUFOSV9CT09MRUFOX0ZBTFNFKSA9PSBlSEFMX1NUQVRVU19GQUlMVVJFKQorICAgeworICAgICAgZlN0YXR1cyA9IEZBTFNFOworICAgICAgaGRkTG9nKExPR0UsICJDb3VsZCBub3QgcGFzcyBvbiBXTklfQ0ZHX01BWF9VQVBTRF9JTkFDVElWSVRZX0lOVEVSVkFMUyIpOworICAgfQorCisgICBpZiAoY2NtQ2ZnU2V0SW50KHBIZGRDdHgtPmhIYWwsIFdOSV9DRkdfRU5BQkxFX0RZTkFNSUNfV01NUFMsCisgICAgICAgICAgICAgICAgICAgIHBDb25maWctPmVuYWJsZUR5bmFtaWNXTU1QUywgTlVMTCwKKyAgICAgICAgICAgICAgICAgICAgZUFOSV9CT09MRUFOX0ZBTFNFKSA9PSBlSEFMX1NUQVRVU19GQUlMVVJFKQorICAgeworICAgICAgZlN0YXR1cyA9IEZBTFNFOworICAgICAgaGRkTG9nKExPR0UsICJDb3VsZCBub3QgcGFzcyBvbiBXTklfQ0ZHX0VOQUJMRV9EWU5BTUlDX1dNTVBTIik7CisgICB9CisKKyAgIGlmIChjY21DZmdTZXRJbnQocEhkZEN0eC0+aEhhbCwgV05JX0NGR19CVVJTVF9NT0RFX0JFX1RYT1BfVkFMVUUsCisgICAgICAgICAgICAgICAgICAgIHBDb25maWctPmJ1cnN0TW9kZVRYT1BWYWx1ZSwgTlVMTCwKKyAgICAgICAgICAgICAgICAgICAgZU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Q291bGQgbm90IHBhc3Mgb24gV05JX0NGR19CVENfU1RBVElDX09QUF9XTEFOX0lETEVfV0xBTl9MRU4gIik7CisgICB9CisKKyAgIGlmIChjY21DZmdTZXRJbnQocEhkZEN0eC0+aEhhbCwgV05JX0NGR19CVENfU1RBVElDX09QUF9XTEFOX0lETEVfQlRfTEVOLAorICAgICAgICAgICAgICAgICAgICBwQ29uZmlnLT5idGNTdGF0aWNPcHBXbGFuSWRsZUJ0TGVuLCBOVUxMLAorICAgICAgICAgICAgICAgICAgICBlQU5JX0JPT0xFQU5fRkFMU0UpID09IGVIQUxfU1RBVFVTX0ZBSUxVUkUpCisgICB7CisgICAgICBmU3RhdHVzID0gRkFMU0U7CisgICAgICBoZGRMb2coTE9HRSwgIkNvdWxkIG5vdCBwYXNzIG9uIFdOSV9DRkdfQlRDX1NUQVRJQ19PUFBfV0xBTl9JRExFX0JUX0xFTiAiKTsKKyAgIH0KKworICAgaWYgKGNjbUNmZ1NldEludChwSGRkQ3R4LT5oSGFsLCBXTklfQ0ZHX0xJTktfRkFJTF9USU1FT1VULAorICAgICAgICAgICAgICAgICAgICBwQ29uZmlnLT5saW5rRmFpbFRpbWVvdXQsIE5VTEwsCisgICAgICAgICAgICAgICAgICAgIGVBTklfQk9PTEVBTl9GQUxTRSkgPT0gZUhBTF9TVEFUVVNfRkFJTFVSRSkKKyAgIHsKKyAgICAgIGZTdGF0dXMgPSBGQUxTRTsKKyAgICAgIGhkZExvZyhMT0dFLCAiQ291bGQgbm90IHBhc3Mgb24gV05JX0NGR19MSU5LX0ZBSUxfVElNRU9VVCAiKTsKKyAgIH0KKworICAgaWYgKGNjbUNmZ1NldEludChwSGRkQ3R4LT5oSGFsLCBXTklfQ0ZHX0xJTktfRkFJTF9UWF9DTlQsCisgICAgICAgICAgICAgICAgICAgIHBDb25maWctPmxpbmtGYWlsVHhDbnQsIE5VTEwsCisgICAgICAgICAgICAgICAgICAgIGVBTklfQk9PTEVBTl9GQUxTRSkgPT0gZUh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NfbWVtX21hbGxvYyhzaXplb2YodFNtZUNvbmZpZ1BhcmFtcykpOworICAgIGlmIChOVUxMID09IHNtZUNvbmZpZykKKyAgIHsKKyAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlcyBzbWVDb25maWcgYWxsb2NhdGlvbiBmYWlsZWQiLF9fZnVuY19fKTsKKyAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTEVEX0FMTE9DOworICAgfQorICAgdm9zX21lbV96ZXJvKCBzbWVDb25maWcsIHNpemVvZiggdFNtZUNvbmZpZ1BhcmFtcyApICk7CisKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICIlcyBiV21tSXNFbmFibGVkPSVkIDgwMl8xMWVfZW5hYmxlZD0lZCBkb3QxMU1vZGU9JWQiLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgcENvbmZpZy0+V21tTW9kZSwgcENvbmZpZy0+YjgwMjExZUlzRW5hYmxlZCwgcENvbmZpZy0+ZG90MTFNb2RlKTsKKworICAgLy8gQ29uZmlnIHBhcmFtcyBvYnRhaW5lZCBmcm9tIHRoZSByZWdpc3RyeQorCisgICBzbWVDb25maWctPmNzckNvbmZpZy5SVFNUaHJlc2hvbGQgICAgICAgICAgICAgPSBwQ29uZmlnLT5SVFNUaHJlc2hvbGQ7CisgICBzbWVDb25maWctPmNzckNvbmZpZy5GcmFnbWVudGF0aW9uVGhyZXNob2xkICAgPSBwQ29uZmlnLT5GcmFnbWVudGF0aW9uVGhyZXNob2xkOworICAgc21lQ29uZmlnLT5jc3JDb25maWcuc2hvcnRTbG90VGltZSAgICAgICAgICAgID0gcENvbmZpZy0+U2hvcnRTbG90VGltZUVuYWJsZWQ7CisgICBzbWVDb25maWctPmNzckNvbmZpZy5JczExZFN1cHBvcnRFbmFibGVkICAgICAgPSBwQ29uZmlnLT5JczExZFN1cHBvcnRFbmFibGVkOworICAgc21lQ29uZmlnLT5jc3JDb25maWcuSGVhcnRiZWF0VGhyZXNoMjQgICAgICAgID0gcENvbmZpZy0+SGVhcnRiZWF0VGhyZXNoMjQ7CisKKyAgIHNtZUNvbmZpZy0+Y3NyQ29uZmlnLnBoeU1vZGUgICAgICAgICAgICAgICAgICA9IGhkZF9jZmdfeGxhdGVfdG9fY3NyX3BoeV9tb2RlICggcENvbmZpZy0+ZG90MTFNb2RlICk7CisKKyAgIGlmKCAocENvbmZpZy0+ZG90MTFNb2RlID09IGVIRERfRE9UMTFfTU9ERV9hYmcpIHx8CisgICAgICAgKHBDb25maWctPmRvdDExTW9kZSA9PSBlSEREX0RPVDExX01PREVfMTFiKSB8fAorICAgICAgIChwQ29uZmlnLT5kb3QxMU1vZGUgPT0gZUhERF9ET1QxMV9NT0RFXzExZykgfHwKKyAgICAgICAocENvbmZpZy0+ZG90MTFNb2RlID09IGVIRERfRE9UMTFfTU9ERV8xMWJfT05MWSkgfHwKKyAgICAgICAocENvbmZpZy0+ZG90MTFNb2RlID09IGVIRERfRE9UMTFfTU9ERV8xMWdfT05MWSkpCisgICB7CisgICAgICAgc21lQ29uZmlnLT5jc3JDb25maWcuY2hhbm5lbEJvbmRpbmdNb2RlMjRHSHogID0gMDsKKyAgICAgICBzbWVDb25maWctPmNzckNvbmZpZy5jaGFubmVsQm9uZGluZ01vZGU1R0h6ICA9IDA7CisgICB9CisgICBlbHNlCisgICB7CisgICAgICAgc21lQ29uZmlnLT5jc3JDb25maWcuY2hhbm5lbEJvbmRpbmdNb2RlMjRHSHogICA9IHBDb25maWctPm5DaGFubmVsQm9uZGluZ01vZGUyNEdIejsKKyAgICAgICBzbWVDb25maWctPmNzckNvbmZpZy5jaGFubmVsQm9uZGluZ01vZGU1R0h6ICAgPSBwQ29uZmlnLT5uQ2hhbm5lbEJvbmRpbmdNb2RlNUdIejsKKyAgIH0KKyAgIHNt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b3JtZWUgb25seSBpZiBTVS1iZWFtZm9ybWVlIGlzIGVuYWJsZWQgKi8KKyAgICBpZiAoIHBDb25maWctPmVuYWJsZVR4QkYgKQorICAgICAgICBzbWVDb25maWctPmNzckNvbmZpZy5lbmFibGVNdUJmb3JtZWUgPSBwQ29uZmlnLT5lbmFibGVNdUJmb3JtZWU7CisgICAgZWxzZQorICAgICAgICBzbWVDb25maWctPmNzckNvbmZpZy5lbmFibGVNdUJmb3JtZWUgPSAwOworI2VuZGlmCisgICBzbWVDb25maWctPmNzckNvbmZpZy5BZEhvY0NoYW5uZWw1RyAgICAgICAgICAgID0gcENvbmZpZy0+QWRIb2NDaGFubmVsNUc7CisgICBzbWVDb25maWctPmNzckNvbmZpZy5BZEhvY0NoYW5uZWwyNCAgICAgICAgICAgID0gcENvbmZpZy0+QWRIb2NDaGFubmVsMjRHOworICAgc21lQ29uZmlnLT5jc3JDb25maWcuUHJvcHJpZXRhcnlSYXRlc0VuYWJsZWQgICA9IDA7CisgICBzbWVDb25maWctPmNzckNvbmZpZy5IZWFydGJlYXRUaHJlc2g1MCAgICAgICAgID0gNDA7CisgICBzbWVDb25maWctPmNzckNvbmZpZy5iYW5kQ2FwYWJpbGl0eSAgICAgICAgICAgID0gcENvbmZpZy0+bkJhbmRDYXBhYmlsaXR5OworICAgaWYgKHBDb25maWctPm5CYW5kQ2FwYWJpbGl0eSA9PSBlQ1NSX0JBTkRfMjQpCisgICB7CisgICAgICAgc21lQ29uZmlnLT5jc3JDb25maWcuSXMxMWhTdXBwb3J0RW5hYmxlZCAgICAgICA9IDA7CisgICB9IGVsc2UgeworICAgICAgIHNtZUNvbmZpZy0+Y3NyQ29uZmlnLklzMTFoU3VwcG9ydEVuYWJsZWQgICAgICAgPSBwQ29uZmlnLT5JczExaFN1cHBvcnRFbmFibGVkOworICAgfQorICAgc21lQ29uZmlnLT5jc3JDb25maWcuY2JDaG9pY2UgICAgICAgICAgICAgICAgICA9IDA7CisgICBzbWVDb25maWctPmNz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2luZyBzdXJlIGlmIEhXIGRvZXMgbm90IHN1cHBvcnQgNUcgUkYgYmFuZCB0aGVuIG5vIG5lZWQgdG8KKyAgIC8vZW5hYmxlIHRoaXMgZmVhdHVyZSBldmVuIHRob3VnaCBpdCBpcyBlbmFibGVkIGluIC5pbmkuCisgICBpZigocENvbmZpZy0+ZW5hYmxlRmlyc3RTY2FuMkdPbmx5KSAmJiAocENvbmZpZy0+bkJhbmRDYXBhYmlsaXR5ICE9IGVDU1JfQkFORF8yNCkpCisgICB7CisgICAgICAgc21lQ29uZmlnLT5jc3JDb25maWcubmVpZ2hib3JSb2FtQ29uZmlnLm5OZWlnaGJvckluaXRpYWxGb3JjZWRSb2FtVG81R2hFbmFibGUKKyAgICAgICA9IHBDb25maWctPm5OZWlnaGJvckluaXRpYWxGb3JjZWRSb2FtVG81R2hFbmFibGU7CisgICB9CisgICBoZGRfc3RyaW5nX3RvX3U4X2FycmF5KCBwQ29uZmlnLT5uZWlnaGJvclNjYW5DaGFuTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbWVDb25maWctPmNzckNvbmZpZy5uZWlnaGJvclJvYW1Db25maWcubmVpZ2hib3JTY2FuQ2hhbkxpc3QuY2hhbm5lbExpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnNtZUNvbmZpZy0+Y3NyQ29uZmlnLm5laWdoYm9yUm9hbUNvbmZpZy5uZWlnaGJvclNjYW5DaGFuTGlzdC5udW1DaGFubmVscywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU4gKTsKKyNlbmRpZgorCisgICBzbWVDb25maWctPmNzckNvbmZpZy5hZGRUU1doZW5BQ01Jc09mZiA9IHBDb25maWctPkFkZFRTV2hlbkFDTUlzT2ZmOworICAgc21lQ29uZmlnLT5jc3JDb25maWcuZlZhbGlkYXRlTGlzdCA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gY2FuIG1hbmlwdWxhdGUgaXQKKyAgIGNsb25lID0ga3N0cmR1cChjb21tYW5kLCBHRlBfQVRPTUlDKTsKKyAgIGlmIChOVUxMID09IGNsb25lKQorICAgeworICAgICAgaGRkTG9nKExPR0UsICIlczogbWVtb3J5IGFsbG9jYXRpb24gZmFpbHVyZSwgdW5hYmxlIHRvIHByb2Nlc3MgWyVzXSIsCisgICAgICAgICAgICAgX19mdW5jX18sIGNvbW1hbmQpOworICAgICAgcmV0dXJuIHZzdGF0dXM7CisgICB9CisKKyAgIC8vICdjbG9uZScgd2lsbCBwb2ludCB0byB0aGUgYmVnaW5uaW5nIG9mIHRoZSBzdHJpbmcgc28gaXQgY2FuIGJlIGZyZWVkCisgICAvLyAncENtZCcgd2lsbCBiZSB1c2VkIHRvIHdhbGsvcGFyc2UgdGhlIGNvbW1hbmQKKyAgIHBDbWQgPSBjbG9uZTsKKworICAgLy8gZ2V0IHJpZCBvZiBsZWFkaW5nL3RyYWlsaW5nIHdoaXRlc3BhY2UKKyAgIHBDbWQgPSBpX3RyaW0ocENtZCk7CisgICBpZiAoJ1wwJyA9PSAqcENtZCkKKyAgIHsKKyAgICAgIC8vIG9ubHkgd2hpdGVzcGFjZQorICAgICAgaGRkTG9nKExPR0UsICIlczogaW52YWxpZCBjb21tYW5kLCBvbmx5IHdoaXRlc3BhY2U6WyVzXSIsCisgICAgICAgICAgICAgX19mdW5jX18sIGNvbW1hbmQpOworICAgICAgZ290byBkb25lOworICAgfQorCisgICAvLyBwYXJzZSB0aGUgPG5hbWU+ID0gPHZhbHVlPgorICAgbmFtZSA9IHBDbWQ7CisgICB3aGlsZSAoKCc9JyAhPSAqcENtZCkgJiYgKCdcMCcgIT0gKnBDbWQpKQorICAgeworICAgICAgcENtZCsrOworICAgfQorICAgaWYgKCdcMCcgPT0gKnBDbWQpCisgICB7CisgICAgICAvLyBkaWQgbm90IGZpbmQgJz0nCisgICAgICBoZGRMb2coTE9HRSwgIiVzOiBpbnZhbGlkIGNvbW1hbmQsIG5vICc9JzpbJXNdIiwKKyAgICAgICAgICAgICBfX2Z1bmNfXywgY29tbWFuZCk7CisgICAgICBnb3RvIGRvbmU7CisgICB9CisKKyAgIC8vIHJlcGxhY2UgJz0nIHdpdGggTlVMIHRvIHRlcm1pbmF0ZSB0aGUgPG5hbWU+CisgICAqcENtZCsrID0gJ1wwJzsKKyAgIG5hbWUgPSBpX3RyaW0obmFtZSk7CisgICBpZiAoJ1wwJyA9PSAqbmFtZSkKKyAgIHsKKyAgICAgIC8vIGRpZCBub3QgZmluZCBhIG5hbWUKKyAgICAgIGhkZExvZyhMT0dFLCAiJXM6IGludmFsaWQgY29tbWFuZCwgbm8gPG5hbWU+Olslc10iLAorICAgICAgICAgICAgIF9fZnVuY19fLCBjb21tYW5kKTsKKyAgICAgIGdvdG8gZG9uZTsKKyAgIH0KKworICAgdmFsdWVfc3RyID0gaV90cmltKHBDbWQpOworICAgaWYgKCdcMCcgPT0gKnZhbHVlX3N0cikKKyAgIHsKKyAgICAgIC8vIGRpZCBub3QgZmluZCBhIHZhbHVlCisgICAgICBoZGRMb2coTE9HRSwgIiVzOiBpbnZhbGlkIGNvbW1hbmQsIG5vIDx2YWx1ZT46WyVzXSIsCisgICAgICAgICAgICAgX19mdW5jX18sIGNvbW1hbmQpOworICAgICAgZ290byBkb25lOworICAgfQorCisgICAvLyBsb29rdXAgdGhlIGNvbmZpZ3VyYXRpb24gaXRlbQorICAgZm9yIChpZHggPSAwOyBpZHggPCB0YWJsZVNpemU7IGlkeCsrKQorICAgeworICAgICAgaWYgKDAgPT0gc3RyY21wKG5hbWUsIGdfcmVnaXN0cnlfdGFibGVbaWR4XS5SZWdOYW1lKSkKKyAgICAgIHsKKyAgICAgICAgIC8vIGZvdW5kIGEgbWF0Y2gKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgfQorICAgaWYgKHRhYmxlU2l6ZSA9PSBpZHgpCisgICB7CisgICAgICAvLyBkaWQgbm90IG1hdGNoIHRoZS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UsIHBSZWdFbnRyeS0+VmFyTWluKTsKKyAgICAgICAgIGdvdG8gZG9uZTsKKyAgICAgIH0KKyAgICAgIGlmICh2YWx1ZSA+IHBSZWdFbnRyeS0+VmFyTWF4KQorICAgICAgeworICAgICAgICAgLy8gb3V0IG9mIHJhbmdlCisgICAgICAgICBoZGRMb2coTE9HRSwgIiVzOiBpbnZhbGlkIGNvbW1hbmQsIHZhbHVlICV1ID4gbWF4IHZhbHVlICVsdSIsCisgICAgICAgICAgICAgICAgX19mdW5jX18sIHZhbHVlLCBwUmVnRW50cnktPlZhck1heCk7CisgICAgICAgICBnb3RvIGRvbmU7CisgICAgICB9CisgICAgICBtZW1jcHkocEZpZWxkLCAmdmFsdWUsIHBSZWdFbnRyeS0+VmFyU2l6ZSk7CisgICAgICBicmVhazsKKworICAgY2FzZSBXTEFOX1BBUkFNX0hleEludGVnZXI6CisgICAgICBydiA9IGtzdHJ0b3UzMih2YWx1ZV9zdHIsIDE2LCAmdmFsdWUpOworICAgICAgaWYgKHJ2IDwgMCkKKyAgICAgICAgIGdvdG8gZG9uZTsKKyAgICAgIGlmICh2YWx1ZSA8IHBSZWdFbnRyeS0+VmFyTWluKQorICAgICAgeworICAgICAgICAgLy8gb3V0IG9mIHJhbmdlCisgICAgICAgICBoZGRMb2coTE9HRSwgIiVzOiBpbnZhbGlkIGNvbW1hbmQsIHZhbHVlICV4IDwgbWluIHZhbHVlICVseCIsCisgICAgICAgICAgICAgICAgX19mdW5jX18sIHZhbHVlLCBwUmVnRW50cnktPlZhck1pbik7CisgICAgICAgICBnb3RvIGRvbmU7CisgICAgICB9CisgICAgICBpZiAodmFsdWUgPiBwUmVnRW50cnktPlZhck1heCkKKyAgICAgIHsKKyAgICAgICAgIC8vIG91dCBvZiByYW5nZQorICAgICAgICAgaGRkTG9nKExPR0UsICIlczogaW52YWxpZCBjb21tYW5kLCB2YWx1ZSAleCA+IG1heCB2YWx1ZSAlbHgiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fLCB2YWx1ZSwgcFJlZ0VudHJ5LT5WYXJNYXgpOworICAgICAgICAgZ290byBkb25lOworICAgICAgfQorICAgICAgbWVtY3B5KHBGaWVsZCwgJnZhbHVlLCBwUmVnRW50cnktPlZhclNpemUpOworICAgICAgYnJlYWs7CisKKyAgIGNhc2UgV0xBTl9QQVJBTV9TaWduZWRJbnRlZ2VyOgorICAgICAgcnYgPSBrc3RydG9zMzIodmFsdWVfc3RyLCAxMCwgJnN2YWx1ZSk7CisgICAgICBpZiAocnYgPCAwKQorICAgICAgICAgZ290byBkb25lOworICAgICAgaWYgKHN2YWx1ZSA8ICh2X1MzMV90KXBSZWdFbnRyeS0+VmFyTWluKQorICAgICAgeworICAgICAgICAgLy8gb3V0IG9mIHJhbmdlCisgICAgICAgICBoZGRMb2coTE9HRSwgIiVzOiBpbnZhbGlkIGNvbW1hbmQsIHZhbHVlICVkIDwgbWluIHZhbHVlICVkIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgc3ZhbHVlLCAoaW50KXBSZWdFbnRyeS0+VmFyTWluKTsKKyAgICAgICAgIGdvdG8gZG9uZTsKKyAgICAgIH0KKyAgICAgIGlmIChzdmFsdWUgPiAodl9TMzFfdClwUmVnRW50cnktPlZhck1heCkKKyAgICAgIHsKKyAgICAgICAgIC8vIG91dCBvZiByYW5nZQorICAgICAgICAgaGRkTG9nKExPR0UsICIlczogaW52YWxpZCBjb21tYW5kLCB2YWx1ZSAlZCA+IG1heCB2YWx1ZSAlZCIsCisgICAgICAgICAgICAgICAgX19mdW5jX18sIHN2YWx1ZSwgKGludClwUmVnRW50cnktPlZhck1heCk7CisgICAgICAgICBnb3RvIGRvbmU7CisgICAgICB9CisgICAgICBtZW1jcHkocEZpZWxkLCAmc3ZhbHVlLCBwUmVnRW50cnktPlZhclNpemUpOworICAgICAgYnJlYWs7CisKKyAgIGNhc2UgV0xBTl9QQVJBTV9TdHJpbmc6CisgICAgICBsZW5fdmFsdWVfc3RyID0gc3RybGVuKHZhbHVlX3N0cik7CisgICAgICBpZiAobGVuX3ZhbHVlX3N0ciA+IChwUmVnRW50cnktPlZhclNpemUgLSAxKSkKKyAgICAgIHsKKyAgICAgICAgIC8vIHRvbyBiaWcKKyAgICAgICAgIGhkZExvZyhMT0dFLAorICAgICAgICAgICAgICAgICIlczogaW52YWxpZCBjb21tYW5kLCBzdHJpbmcgWyVzXSBsZW5ndGggIgorICAgICAgICAgICAgICAgICIlenUgZXhjZWVkcyBtYXhpbXVtIGxlbmd0aCAldSIsCisgICAgICAgICAgICAgICAgX19mdW5jX18sIHZhbHVlX3N0ciwKKyAgICAgICAgICAgICAgICBsZW5fdmFsdWVfc3RyLCAocFJlZ0VudHJ5LT5WYXJTaXplIC0gMSkpOworICAgICAgICAgZ290byBkb25lOworICAgICAgfQorICAgICAgLy8gY29weSBzdHJpbmcgcGx1cyBOVUwKKyAgICAgIG1lbWNweShwRmllbGQsIHZhbHVlX3N0ciwgKGxlbl92YWx1ZV9zdHIgKyAxKSk7CisgICAgICBicmVhazsKKworICAgY2FzZSBXTEFOX1BBUkFNX01hY0FkZHI6CisgICAgICBsZW5fdmFsdWVfc3RyID0gc3RybGVuKHZhbHVlX3N0cik7CisgICAgICBpZiAobGVuX3ZhbHVlX3N0ciAhPSAoVk9TX01BQ19BRERSX1NJWkUgKiAyKSkKKyAgICAgIHsKKyAgICAgICAgIC8vIG91dCBvZiByYW5nZQorICAgICAgICAgaGRkTG9nKExPR0UsCisgICAgICAgICAgICAgICAgIiVzOiBpbnZhbGlkIGNvbW1hbmQsIE1BQyBhZGRyZXNzIFslc10gbGVuZ3RoICIKKyAgICAgICAgICAgICAgICAiJXp1IGlzIG5vdCBleHBlY3RlZCBsZW5ndGggJXUiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fLCB2YWx1ZV9zdHIsCisgICAgICAgICAgICAgICAgbGVuX3ZhbHVlX3N0ciwgKFZPU19NQUNfQUREUl9TSVpFICogMikpOworICAgICAgICAgZ290byBkb25lOworICAgIC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TE9TUyBPRiBVU0UsIERBVEEgT1IKKyAqIFBST0ZJVFMsIFdIRVRIRVIgSU4gQU4gQUNUSU9OIE9GIENPTlRSQUNULCBORUdMSUdFTkNFIE9SIE9USEVSCisgKiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SCisgKiBQRVJGT1JNQU5DRSBPRiBUSElTIFNPRlRXQVJFLgorICovCisKKy8qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqCisgKi8KKworCisKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgXGZpbGUgIHdsYW5faGRkX2NmZzgwMjExLmMKKworICBcYnJpZWYgV0xBTiBIb3N0IERldmljZSBEcml2ZXIgaW1wbGVtZW50YXRpb24KKworICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4K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X01PREVfUkFURVRBQigxODAsIDB4ODAsIDApLAorICAgIEhERF9HX01PREVfUkFURVRBQigyNDAsIDB4MTAwLCAwKSwKKyAgICBIRERfR19NT0RFX1JBVEVUQUIoMzYwLCAweDIwMCwgMCksCisgICAgSEREX0dfTU9ERV9SQVRFVEFCKDQ4MCwgMHg0MDAsIDApLAorICAgIEhERF9HX01PREVfUkFURVRBQig1NDAsIDB4ODAwLCAwKSwKK307CisKK3N0YXRpYyBzdHJ1Y3QgaWVlZTgwMjExX3JhdGUgYV9tb2RlX3JhdGVzW10gPQoreworICAgIEhERF9HX01PREVfUkFURVRBQig2MCwgMHgxMCwgMCksCisgICAgSEREX0dfTU9ERV9SQVRFVEFCKDkwLCAweDIwLCAwKSwKKyAgICBIRERfR19NT0RFX1JBVEVUQUIoMTIwLCAweDQwLCAwKSwKKyAgICBIRERfR19NT0RFX1JBVEVUQUIoMTgwLCAweDgwLCAwKSwKKyAgICBIRERfR19NT0RFX1JBVEVUQUIoMjQwLCAweDEwMCwgMCksCisgICAgSEREX0dfTU9ERV9SQVRFVEFCKDM2MCwgMHgyMDAsIDApLAorICAgIEhERF9HX01PREVfUkFURVRBQig0ODAsIDB4NDAwLCAwKSwKKyAgICBIRERfR19NT0RFX1JBVEVUQUIoNTQwLCAweDgwMCwgMCksCit9OworCitzdGF0aWMgc3RydWN0IGllZWU4MDIxMV9zdXBwb3J0ZWRfYmFuZCB3bGFuX2hkZF9iYW5kXzJfNF9HSFogPQoreworICAgIC5jaGFubmVscyA9IE5VTEwsCisgICAgLm5fY2hhbm5lbHMgPSBBUlJBWV9TSVpFKGhkZF9jaGFubmVsc18yXzRfR0haKSwKKyAgICAuYmFuZCAgICAgICA9IElFRUU4MDIxMV9CQU5EXzJHSFosCisgICAgLmJpdHJhdGVzID0gZ19tb2RlX3JhdGVzLAorICAgIC5uX2JpdHJhdGVzID0gZ19tb2RlX3JhdGVzX3NpemUsCisgICAgLmh0X2NhcC5odF9zdXBwb3J0ZWQgICA9ID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uaHRfY2FwLmNhcCAgICAgICAgICAgID0gIElFRUU4MDIxMV9IVF9DQVBfU0dJXzIwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBJRUVFODAyMTFfSFRfQ0FQX0dSTl9GTEQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IElFRUU4MDIxMV9IVF9DQVBfRFNTU0NDSzQwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBJRUVFODAyMTFfSFRfQ0FQX0xTSUdfVFhPUF9QUk9UCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBJRUVFODAyMTFfSFRfQ0FQX1NHSV80MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgSUVFRTgwMjExX0hUX0NBUF9TVVBfV0lEVEhfMjBfNDAsCisgICAgLmh0X2NhcC5hbXBkdV9mYWN0b3IgICA9IElFRUU4MDIxMV9IVF9NQVhfQU1QRFVfNjRLLAorICAgIC5odF9jYXAuYW1wZHVfZGVuc2l0eSAgPSBJRUVFODAyMTFfSFRfTVBEVV9ERU5TSVRZXzE2LAorICAgIC5odF9jYXAubWNzLnJ4X21hc2sgICAgPSB7IDB4ZmYsIDAsIDAsIDAsIDAsIDAsIDAsIDAsIDAsIDAsIH0sCisgICAgLmh0X2NhcC5tY3MucnhfaGlnaGVzdCA9IGNwdV90b19sZTE2KCA3MiApLAorICAgIC5odF9jYXAubWNzLnR4X3BhcmFtcyAgPSBJRUVFODAyMTFfSFRfTUNTX1RYX0RFRklORUQsCit9OworCisvKiBUaGlzIHN0cnVjdHVyZSBjb250YWluIGluZm9ybWF0aW9uIHdoYXQga2luZCBvZiBmcmFtZSBhcmUgZXhwZWN0ZWQgaW4KKyAgICAgVFgvUlggZGlyZWN0aW9uIGZvciBlYWNoIGtpbmQgb2YgaW50ZXJmYWNlICovCitzdGF0aWMgY29uc3Qgc3RydWN0IGllZWU4MDIxMV90eHJ4X3N0eXBlcword2xhbl9oZGRfdHhyeF9zdHlwZXNbTlVNX05MODAyMTFfSUZUWVBFU10gPSB7CisgICAgW05MODAyMTFfSUZUWVBFX1NUQVRJT05dID0geworICAgICAgICAudHggPSAweGZmZmYsCisgICAgICAgIC5yeCA9IEJJVChTSVJfTUFDX01HTVRfQUNUSU9OKSB8CisgICAgICAgICAgICBCSVQoU0lSX01BQ19NR01UX1BST0JFX1JFUSksCisgICAgfSwKKyAgICBbTkw4MDIxMV9JRlRZUEVfQVBdID0geworICAgICAgICAudHggPSAweGZmZmYsCisgICAgICAgIC5yeCA9IEJJVChTSVJfTUFDX01HTVRfQVNTT0NfUkVRKSB8CisgICAgICAgICAgICBCSVQoU0lSX01BQ19NR01UX1JFQVNTT0NfUkVRKSB8CisgICAgICAgICAgICBCSVQoU0lSX01BQ19NR01UX1BST0JFX1JFUSkgfAorICAgICAgICAgICAgQklUKFNJUl9NQUNfTUdNVF9ESVNBU1NPQykgfAorICAgICAgICAgICAgQklUKFNJUl9NQUNfTUdNVF9BVVRIKSB8CisgICAgICAgICAgICBCSVQoU0lSX01BQ19NR01UX0RFQVVUSCkgfAorICAgICAgICAgICAgQklUKFNJUl9NQUNfTUdNVF9BQ1RJT04pLAorICAgIH0sCisgICAgW05MODAyMTFfSUZUWVBFX0FESE9DXSA9IHsKKyAgICAgICAgLnR4ID0gMHhmZmZmLAorICAgICAgICAucnggPSBCSVQoU0lSX01BQ19NR01UX0FTU09DX1JFUSkgfAorICAgICAgICAgICAgQklUKFNJUl9NQUNfTUdNVF9SRUFTU09DX1JFUSkgfAorICAgICAgICAgICAgQklUKFNJUl9NQUNfTUdNVF9QUk9CRV9SRVEpIHwKKyAgICAgICAgICAgIEJJVChTSVJfTUFDX01HTVRfRElTQVNTT0MpIHwKKyAgICAgICAgICAgIEJJVChTSVJfTUFDX01HTVRfQVVUSCkgfAorICAgICAgICAgICAgQklUKFNJUl9NQUNfTUdNVF9ERUFVVEgpIHwKKyAgICAgICAgICAgIEJJVChTSVJfTUFDX01HTVRfQUNUSU9OKSwKKyAgICB9LAorICAgIFtOTDgwMjExX0lGVFlQRV9QMlBfQ0xJRU5UXSA9IHsKKyAgICAgICAgLnR4ID0gMHhmZmZmLAorICAgICAgICAucnggPSBCSVQoU0lSX01BQ19NR01UX0FDVElPTikgfAorICAgICAgICAgICAgQklUKFNJUl9NQUNfTUdNVF9QUk9CRV9SRVEpLAorICAgIH0sCisgICAgW05MODAyMTFfSUZUWVBFX1AyUF9HT10gPSB7CisgICAgICAgIC8qIFRoaXMgaXMgYWxzbyBzYW1lIGFzIGZvciBTb2Z0QVAgKi8KKyAgICAgICAgLnR4ID0gMHhmZmZmLAorICAgICAgICAucnggPSBCSVQoU0lSX01BQ19NR01UX0FTU09DX1JFUSkgfAorICAgICAgICAgICAgQklUKFNJUl9NQUNfTUdNVF9SRUFTU09DX1JFUSkgfAorICAgICAgICAgICAgQklUKFNJUl9NQUNfTUdNVF9QUk9CRV9SRVEpIHwKKyAgICAgICAgICAgIEJJVChTSVJfTUFDX01HTVRfRElTQVNTT0MpIHwKKyAgICAgICAgICAgIEJJVChTSVJfTUFDX01HTVRfQVVUSCkgfAorICAgICAgICAgICAgQklUKFNJUl9NQUNfTUdNVF9ERUFVVEgpIHwKKyAgICAgICAgICAgIEJJVChTSVJfTUFDX01HTVRfQUNUSU9OKSwKKyAgICB9LAorfTsKKworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMyw0LDApKQorc3RhdGljIGNvbnN0IHN0cnVjdCBpZWVlODAyMTFfaWZhY2VfbGltaXQKK3dsYW5faGRkX2lmYWNlX2xpbWl0W10gPSB7CisgICAgeworICAgICAgICAvKiBtYXggPSAzIDsgT3VyIGRyaXZlciBjcmVhdGUgdHdvIGludGVyZmFjZXMgZHVyaW5nIGRyaXZlciBpbml0CisgICAgICAgICAqIHdsYW4wIGFuZCBwMnAwIGludGVyZmFjZXMuIHAycDAgaXMgY29uc2lkZXJlZCBhcyBzdGF0aW9uCisgICAgICAgICAqIGludGVyZmFjZSB1bn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FudAorICAgICAgICAgKiBzaG91bGQgbm90IHRyeSB0byBjaGFuZ2UgdGhlIDNyZCBpbnRlcmZhY2UgbW9kZSB0byBTdGF0aW9uIHR5cGUuCisgICAgICAgICAqIFRpbGwgd2UgZ2V0IGEgZml4IGluIHdwYV9zdXBwbGljYW50LCB3ZSBhZHZlcnRpemUgbWF4IFNUQQorICAgICAgICAgKiBpbnRlcmZhY2UgdHlwZSB0byAzCisgICAgICAgICAqLworICAgICAgICAubWF4ID0gMywKKyAgICAgICAgLnR5cGVzID0gQklUKE5MODAyMTFfSUZUWVBFX1NUQVRJT04pLAorICAgIH0sCisgICAgeworICAgICAgICAubWF4ID0gMSwKKyAgICAgICAgLnR5cGVzID0gQklUKE5MODAyMTFfSUZUWVBFX0FESE9DKSB8IEJJVChOTDgwMjExX0lGVFlQRV9BUCksCisgICAgfSwKKyAgICB7CisgICAgICAgIC5tYXggPSAxLAorICAgICAgICAudHlwZXMgPSBCSVQoTkw4MDIxMV9JRlRZUEVfUDJQX0dPKSB8CisgICAgICAgICAgICAgICAgIEJJVChOTDgwMjExX0lGVFlQRV9QMlBfQ0xJRU5UKSwKKyAgICB9LAorfTsKKworLyogQnkgZGVmYXVsdCwgb25seSBzaW5nbGUgY2hhbm5lbCBjb25jdXJyZW5jeSBpcyBhbGxvd2VkICovCitzdGF0aWMgc3RydWN0IGllZWU4MDIxMV9pZmFjZV9jb21iaW5hdGlvbgord2xhbl9oZGRfaWZhY2VfY29tYmluYXRpb24gPSB7CisgICAgICAgIC5saW1pdHMgPSB3bGFuX2hkZF9pZmFjZV9saW1pdCwKKyAgICAgICAgLm51bV9kaWZmZXJlbnRfY2hhbm5lbHMgPSAxLAorICAgICAgICAvKgorICAgICAgICAgKiBtYXggPSBXTEFOX01BWF9JTlRFUkZBQ0VTIDsgSmVsbHlCZWFuIGFyY2hpdGVjdHVyZSBjcmVhdGVzIHdsYW4wCisgICAgICAgICAqIGFuZCBwMnAwIGludGVyZmFjZXMgZHVyaW5nIGR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3QgKnBBdm9pZEZyZXFMaXN0KQoreworICAgIHN0cnVjdCBza19idWZmICp2ZW5kb3JfZXZlbnQ7CisKKyAgICBFTlRFUigpOworCisgICAgaWYgKCFwSGRkQ3R4KQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEhERCBjb250ZXh0IGlzIG51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisKKyAgICBpZiAoIXBBdm9pZEZyZXFMaXN0KQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IHBBdm9pZEZyZXFMaXN0IGlzIG51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisKKyAgICB2ZW5kb3JfZXZlbnQgPSBjZmc4MDIxMV92ZW5kb3JfZXZlbnRfYWxsb2MocEhkZEN0eC0+d2lwaHksCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLCAxOCwgMCkpCisgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRIZGRBdm9pZEZyZXFMaXN0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgUUNBX05MODAyMTFfVkVORE9SX1NVQkNNRF9BVk9JRF9GUkVRVUVOQ1lfSU5ERVgsCisgICAgICAgICAgICAgICAgICAgICAgIEdGUF9LRVJORUwpOworICAgIGlmICghdmVuZG9yX2V2ZW50KQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgIC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XJfdCAqcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgICB0SGFsSGFuZGxlIGhIYWwgPSBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlcik7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IHdpcGh5X3ByaXYod2lwaHkpOworCisgICAgaWYgKDAgPT0gZGF0YV9sZW4pCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIEZMKCJOQU4gLSBJbnZhbGlkIFJlcXVlc3QsIGxlbmd0aCA9IDAiKSk7CisgICAgICAgIHJldHVybiByZXRfdmFsOworICAgIH0KKworICAgIGlmIChOVUxMID09IGRhdGEpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIEZMKCJOQU4gLSBJbnZhbGlkIFJlcXVlc3QsIGRhdGEgaXMgTlVMTCIpKTsKKyAgICAgICAgcmV0dXJuIHJldF92YWw7CisgICAgfQorCisgICAgc3RhdHVzID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSBzdGF0dXMpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgRkwoIkhERCBjb250ZXh0IGlzIG5vdCB2YWxpZCIpKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgaGRkTG9nKExPRzEsIEZMKCJSZWNlaXZlZCBOQU4gY29tbWFuZCIpKTsKKyAgICB2b3NfdHJhY2VfaGV4X2R1bXAoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgKHRBTklfVTggKilkYXRhLCBkYXRhX2xlbik7CisKKyAgICAvKiBjaGVjayB0aGUgTkFOIENhcGFiaWxpdHkgKi8KKyAgICBpZiAoVFJVRSAhPSBzbWVfSXNGZWF0dXJlU3VwcG9ydGVkQnlGVyhOQU4pKQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIEZMKCJOQU4gaXMgbm90IHN1cHBvcnRlZCBieSBGaXJtd2FyZSIpKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgbmFuX3JlcS5yZXF1ZXN0X2RhdGFfbGVuID0gZGF0YV9sZW47CisgICAgbmFuX3JlcS5yZXF1ZXN0X2RhdGEgPSBkYXRhOworCisgICAgc3RhdHVzID0gc21lX05hblJlcXVlc3QoaEhhbCwgJm5hbl9yZXEsIHBBZGFwdGVyLT5zZXNzaW9uSWQpOworICAgIGlmIChWT1NfU1RBVFVTX1NVQ0NFU1MgPT0gc3RhdHVzKQorICAgIHsKKyAgICAgICAgcmV0X3ZhbCA9IDA7CisgICAgfQorICAgIHJldHVybiByZXRfdmFsOworfQorCisvKgorICogRlVOQ1RJT046IHdsYW5faGRkX2NmZzgwMjExX25hbl9yZXF1ZXN0CisgKiBXcmFwcGVyIHRvIHByb3RlY3QgdGhlIG5hbiB2ZW5kb3IgY29tbWFuZCBmcm9tIHNzcgorICovCitzdGF0aWMgaW50IHdsYW5faGRkX2NmZzgwMjExX25hbl9yZXF1ZXN0KHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXJlbGVzc19kZXYgKndkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsIGludCBkYXRhX2xlbikKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX3dsYW5faGRkX2NmZzgwMjExX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AgICAgICAgICAgIEZMKCJIREQgY29udGV4dCBpcyBub3QgdmFsaWQiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICB2ZW5kb3JfZXZlbnQgPSBjZmc4MDIxMV92ZW5kb3JfZXZlbnRfYWxsb2MocEhkZEN0eC0+d2lwaHksCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLCAxOCwgMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS0+ZXZlbnRfZGF0YV9sZW4gKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOTE1TR19IRFJMRU4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFFDQV9OTDgwMjExX1ZFTkRPUl9TVUJDTURfTkFOX0lOREVYLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHRlBfS0VSTkVMKTsKKworICAgIGlmICghdmVuZG9yX2V2ZW50KQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIEZMKCJjZmc4MDIxMV92ZW5kb3JfZXZlbnRfYWxsb2MgZmFpbGVkIikpOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIGlmIChubGFfcHV0KHZlbmRvcl9ldmVudCwgUUNBX1dMQU5fVkVORE9SX0FUVFJfTkFOLAorICAgICAgICAgICAgICAgIGRhdGEtPmV2ZW50X2RhdGFfbGVuLCBkYXRhLT5ldmVudF9kYXRhKSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICBGTCgiUUNBX1dMQU5fVkVORE9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VMsCisgICAgICAgICAgICAgICAgc3RhdHMtPnJldHJpZXMpICAgICB8fAorICAgICAgICBubGFfcHV0X3UzMih2ZW5kb3JfZXZlbnQsCisgICAgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfUkFURV9SRVRSSUVTX1NIT1JULAorICAgICAgICAgICAgICAgIHN0YXRzLT5yZXRyaWVzU2hvcnQgKSAgIHx8CisgICAgICAgIG5sYV9wdXRfdTMyKHZlbmRvcl9ldmVudCwKKyAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9MTF9TVEFUU19SQVRFX1JFVFJJRVNfTE9ORywKKyAgICAgICAgICAgICAgICBzdGF0cy0+cmV0cmllc0xvbmcpKQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICBGTCgiUUNBX1dMQU5fVkVORE9SX0FUVFIgcHV0IGZhaWwiKSk7CisgICAgICAgIHJldHVybiBGQUxTRTsKKyAgICB9CisgICAgcmV0dXJuIFRSVUU7Cit9CisKK3N0YXRpYyB2X0JPT0xfdCBwdXRfd2lmaV9wZWVyX2luZm8oIHRwU2lyV2lmaVBlZXJJbmZvIHN0YXRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBza19idWZmICp2ZW5kb3JfZXZlbnQpCit7CisgICAgdTMyIGkgPSAwOworICAgIHN0cnVjdCBubGF0dHIgKnJhdGVJbmZvOworICAgIGlmIChubGFfcHV0X3UzMih2ZW5kb3JfZXZlbnQsIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX1BFRVJfSU5GT19UWVBFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRzLT50eXBlKSB8fAorICAgICAgICBubGFfcHV0KHZlbmRvcl9ldmVudCwKKyAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9MTF9TVEFUU19QRUVSX0lORk9fTUFDX0FERFJFU1MsCisgICAgICAgICAgICAgICAgVk9TX01BQ19BRERSX1NJWkUsICZzdGF0cy0+cGVlck1hY0FkZHJlc3NbMF0pIHx8CisgICAgICAgIG5sYV9wdXRfdTMyKHZlbmRvcl9ldmVudCwKKyAgICAgICAgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfUEVFUl9JTkZPX0NBUEFCSUxJVElFUywKKyAgICAgICAgICAgICAgICAgICAgc3RhdHMtPmNhcGFiaWxpdGllcykgfHwKKyAgICAgICAgbmxhX3B1dF91MzIodmVuZG9yX2V2ZW50LAorICAgICAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9MTF9TVEFUU19QRUVSX0lORk9fTlVNX1JBVEVTLAorICAgICAgICAgICAgICAgICAgICBzdGF0cy0+bnVtUmF0ZSkpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIEZMKCJRQ0FfV0xBTl9WRU5ET1JfQVRUUiBwdXQgZmFpbCIpKTsKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICB9CisKKyAgICByYXRlSW5mbyA9IG5sYV9uZXN0X3N0YXJ0KHZlbmRvcl9ldmVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9MTF9TVEFUU19QRUVSX0lORk9fUkFURV9JTkZPKTsKKyAgICBpZighcmF0ZUluZm8pCisgICAgICAgIHJldHVybiBGQUxTRTsKKyAgICBmb3IgKGkgPSAwOyBpIDwgc3RhdHMtPm51bVJhdGU7IGkrKykKKyAgICB7CisgICAgICAgIHN0cnVjdCBubGF0dHIgKnJhdGVzOworICAgICAgICB0cFNpcldpZmlSYXRlU3RhdCBwUmF0ZVN0YXRzID0gKHRwU2lyV2lmaVJhdGVTdGF0ICkoKHVpbnQ4ICopCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRzLT5yYXRlU3RhdHMgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGkgKiBzaXplb2YodFNpcldpZmlSYXRlU3RhdCkpKTsKKyAgICAgICAgcmF0ZXMgPSBubGFfbmVzdF9zdGFydCh2ZW5kb3JfZXZlbnQsIGkpOworICAgICAgICBpZighcmF0ZXMpCisgICAgICAgICAgICByZXR1cm4gRkFMU0U7CisKKyAgICAgICAgaWYgKEZBTFNFID09IHB1dF93aWZpX3JhdGVfc3RhdChwUmF0ZVN0YXRzLCB2ZW5kb3JfZXZlbnQpKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIEZMKCJRQ0FfV0xBTl9WRU5ET1JfQVRUUiBwdXQgZmFpbCIpKTsKKyAgICAgICAgICAgIHJldHVybiBGQUxTRTsKKyAgICAgICAgfQorICAgICAgICBubGFfbmVzdF9lbmQodmVuZG9yX2V2ZW50LCByYXRlcyk7CisgICAgfQorICAgIG5sYV9uZXN0X2VuZCh2ZW5kb3JfZXZlbnQsIHJhdGVJbmZvKTsKKworICAgIHJldHVybiBUUlVFOworZXJyb3I6CisgICAgcmV0dXJuIEZBTFNFOworfQorCitzdGF0aWMgdl9CT09MX3QgcHV0X3dpZmlfd21tX2FjX3N0YXQoIHRwU2lyV2lmaVdtbUFjU3RhdCBzdGF0cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgc2tfYnVmZiAqdmVuZG9yX2V2ZW50KQoreworICAgIGlmIChubGFfcHV0X3UzMih2ZW5kb3JfZXZlbnQsIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX1dNTV9BQ19BQywKKyAgICAgICAgICAgICAgICAgICAgc3RhdHMtPmFjICkgfHwKKyAgICAgICAgbmxhX3B1dF91MzIodmVuZG9yX2V2ZW50LAorICAgICAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9MTF9TVEFUU19XTU1fQUNfVFhfTVBEVSwKKyAgICAgICAgICAgICAgICAgICAgc3RhdHMtPnR4TXBkdSApIHx8CisgICAgICAgIG5sYV9wdXRfdTMyKHZlbmRvcl9ldmVudCwKKyAgICAgICAgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfV01NX0FDX1JYX01QRFUsCisgICAgICAgICAgICAgICAgICAgIHN0YXRzLT5yeE1wZHUgKSB8fAorICAgICAgICBubGFfcHV0X3UzMih2ZW5kb3JfZXZlbnQsCisgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX1dNTV9BQ19UWF9NQ0FTVCwKKyAgICAgICAgICAgICAgICAgICAgc3RhdHMtPnR4TWNhc3QgKSB8fAorICAgICAgICBubGFfcHV0X3UzMih2ZW5kb3JfZXZlbnQsCisgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX1dNTV9BQ19SWF9NQ0FTVCwKKyAgICAgICAgICAgICAgICAgICAgc3RhdHMtPnJ4TWNhc3QgKSB8fAorICAgICAgICBubGFfcHV0X3UzMih2ZW5kb3JfZXZlbnQsCisgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX1dNTV9BQ19SWF9BTVBEVSwKKyAgICAgICAgICAgICAgICAgICAgc3RhdHMtPnJ4QW1wZHUgKSB8fAorICAgICAgICBubGFfcHV0X3UzMih2ZW5kb3JfZXZlbnQsCisgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX1dNTV9BQ19UWF9BTVBEVSwKKyAgICAgICAgICAgICAgICAgICAgc3RhdHMtPnR4QW1wZHUgKSB8fAorICAgICAgICBubGFfcHV0X3UzMih2ZW5kb3JfZXZlbnQsCisgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX1dNTV9BQ19NUERVX0xPU1QsCisgICAgICAgICAgICAgICAgICAgIHN0YXRzLT5tcGR1TG9zdCApfHwKKyAgICAgICAgbmxhX3B1dF91MzIodmVuZG9yX2V2ZW50LAorICAgICAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9MTF9TVEFUU19XTU1fQUNfUkVUUklFUywKKyAgICAgICAgICAgICAgICAgICAgc3RhdHMtPnJldHJpZXMgKSB8fAorICAgICAgICBubGFfcHV0X3UzMih2ZW5kb3JfZXZlbnQsCisgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX1dNTV9BQ19SRVRSSUVTX1NIT1JULAorICAgICAgICAgICAgICAgICAgICBzdGF0cy0+cmV0cmllc1Nob3J0ICkgfHwKKyAgICAgICAgbmxhX3B1dF91MzIodmVuZG9yX2V2ZW50LAorICAgICAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9MTF9TVEFUU19XTU1fQUNfUkVUUklFU19MT05HLAorICAgICAgICAgICAgICAgICAgICBzdGF0cy0+cmV0cmllc0xvbmcgKSB8fAorICAgICAgICBubGFfcHV0X3UzMih2ZW5kb3JfZXZlbnQsCisgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX1dNTV9BQ19DT05URU5USU9OX1RJTUVfTUlOLAorICAgICAgICAgICAgICAgICAgICBzdGF0cy0+Y29udGVudGlvblRpbWVNaW4gKSB8fAorICAgICAgICBubGFfcHV0X3UzMih2ZW5kb3JfZXZlbnQsCisgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX1dNTV9BQ19DT05URU5USU9OX1RJTUVfTUFYLAorICAgICAgICAgICAgICAgICAgICBzdGF0cy0+Y29udGVudGlvblRpbWVNYXggKSB8fAorICAgICAgICBubGFfcHV0X3UzMih2ZW5kb3JfZXZlbnQsCisgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX1dNTV9BQ19DT05URU5USU9OX1RJTUVfQVZHLAorICAgICAgICAgICAgICAgICAgICBzdGF0cy0+Y29udGVudGlvblRpbWVBdmcgKSB8fAorICAgICAgICBubGFfcHV0X3UzMih2ZW5kb3JfZXZlbnQsCisgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX1dNTV9BQ19DT05URU5USU9OX05VTV9TQU1QTEVTLAorICAgICAgICAgICAgICAgICAgICBzdGF0cy0+Y29udGVudGlvbk51bVNhbXBsZXMgKSkKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgRkwoIlFDQV9XTEFOX1ZFTkRPUl9BVFRSIHB1dCBmYWlsIikgKTsKKyAgICAgICAgcmV0dXJuIEZBTFNFOworICAgIH0KKyAgICByZXR1cm4gVFJVRTsKK30KKworc3RhdGljIHZfQk9PTF90IHB1dF93aWZpX2ludGVyZmFjZV9pbmZvKHRwU2lyV2lmaUludGVyZmFjZUluZm8gc3RhdHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgc2tfYnVmZiAqdmVuZG9yX2V2ZW50KQoreworICAgIGlmIChubGFfcHV0X3MzMih2ZW5kb3JfZXZlbnQsCisgICAgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfSUZBQ0VfSU5GT19NT0RFLCBzdGF0cy0+bW9kZSApIHx8CisgICAgICAgICAgICBubGFfcHV0KHZlbmRvcl9ldmVudCwKKyAgICAgICAgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfSUZBQ0VfSU5GT19NQUNfQUREUiwKKyAgICAgICAgICAgICAgICAgICAgVk9TX01BQ19BRERSX1NJWkUsIHN0YXRzLT5tYWNBZGRyKSB8fAorICAgICAgICAgICAgbmxhX3B1dF91MzIodmVuZG9yX2V2ZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfSUZBQ0VfSU5GT19TVEFURSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRzLT5zdGF0ZSApIHx8CisgICAgICAgICAgICBubGFfcHV0X3UzMih2ZW5kb3JfZXZlbnQsCisgICAgICAgICAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9MTF9TVEFUU19JRkFDRV9JTkZPX1JPQU1JTkcsCisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0cy0+cm9hbWluZyApIHx8CisgICAgICAgICAgICBubGFfcHV0X3UzMih2ZW5kb3JfZXZlbnQsCisgICAgICAgICAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9MTF9TVEFUU19JRkFDRV9JTkZPX0NBUEFCSUxJVElFUywKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRzLT5jYXBhYmlsaXRpZXMgKSB8fAorICAgICAgICAgICAgbmxhX3B1dCh2ZW5kb3JfZXZlbnQsCisgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX0lGQUNFX0lORk9fU1NJRCwKKyAgICAgICAgICAgICAgICAgICAgc3RybGVuKHN0YXRzLT5zc2lkKSwgc3RhdHMtPnNzaWQpIHx8CisgICAgICAgICAgICBubGFfcHV0KHZlbmRvcl9ldmVudCwKKyAgICAgICAgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfSUZBQ0VfSU5GT19CU1NJRCwKKyAgICAgICAgICAgICAgICAgICAgV05JX0NGR19CU1NJRF9MRU4sIHN0YXRzLT5ic3NpZCkgfHwKKyAgICAgICAgICAgIG5sYV9wdXQodmVuZG9yX2V2ZW50LAorICAgICAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9MTF9TVEFUU19JRkFDRV9JTkZPX0FQX0NPVU5UUllfU1RSLAorICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX0NPVU5UUllfQ09ERV9MRU4sIHN0YXRzLT5hcENvdW50cnlTdHIpIHx8CisgICAgICAgICAgICBubGFfcHV0KHZlbmRvcl9ldmVudCwKKyAgICAgICAgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfSUZBQ0VfSU5GT19DT1VOVFJZX1NUUiwKKyAgICAgICAgICAgICAgICAgICAgV05JX0NGR19DT1VOVFJZX0NPREVfTEVOLCBzdGF0cy0+Y291bnRyeVN0cikKKyAgICAgICkKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgRkwoIlFDQV9XTEFOX1ZFTkRPUl9BVFRSIHB1dCBmYWlsIikgKTsKKyAgICAgICAgcmV0dXJuIEZBTFNFOworICAgIH0KKyAgICByZXR1cm4gVFJVRTsKK30KKworc3RhdGljIHZfQk9PTF90IHB1dF93aWZpX2lmYWNlX3N0YXRzKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyV2lmaUlmYWNlU3RhdCBwV2lmaUlmYWNlU3RhdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBza19idWZmICp2ZW5kb3JfZXZlbnQpCit7CisgICAgaW50IGkgPSAwOworICAgIHN0cnVjdCBubGF0dHIgKndtbUluZm87CisgICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHggPSBXTEF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AgICAgIG5sYV9wdXRfdTMyKHZlbmRvcl9ldmVudCwKKyAgICAgICAgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfSUZBQ0VfTUdNVF9BQ1RJT05fVFgsCisgICAgICAgICAgICAgICAgICAgIHBXaWZpSWZhY2VTdGF0LT5tZ210QWN0aW9uVHgpIHx8CisgICAgICAgIG5sYV9wdXRfczMyKHZlbmRvcl9ldmVudCwKKyAgICAgICAgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfSUZBQ0VfUlNTSV9NR01ULAorICAgICAgICAgICAgICAgICAgICBwV2lmaUlmYWNlU3RhdC0+cnNzaU1nbXQpIHx8CisgICAgICAgIG5sYV9wdXRfczMyKHZlbmRvcl9ldmVudCwKKyAgICAgICAgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfSUZBQ0VfUlNTSV9EQVRBLAorICAgICAgICAgICAgICAgICAgICBwV2lmaUlmYWNlU3RhdC0+cnNzaURhdGEpIHx8CisgICAgICAgIG5sYV9wdXRfczMyKHZlbmRvcl9ldmVudCwKKyAgICAgICAgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfSUZBQ0VfUlNTSV9BQ0ssCisgICAgICAgICAgICAgICAgICAgIHBXaWZpSWZhY2VTdGF0LT5yc3NpQWNrKSkKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgRkwoIlFDQV9XTEFOX1ZFTkRPUl9BVFRSIHB1dCBmYWlsIikpOworICAgICAgICB2b3NfbWVtX2ZyZWUocFdpZmlJZmFjZVN0YXRUTCk7CisgICAgICAgIHJldHVybiBGQUxTRTsKKyAgICB9CisKKyAgICB3bW1JbmZvID0gbmxhX25lc3Rfc3RhcnQodmVuZG9yX2V2ZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX1dNTV9JTkZPKTsKKyAgICBpZighd21tSW5mbykKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZShwV2lmaUlmYWNlU3RhdFRMKTsKKyAgICAgICAgcmV0dXJuIEZBTFNFOworICAgIH0KKyAgICBmb3IgKGkgPSAwOyBpIDwgV0lGSV9BQ19NQVg7IGkrKykKKyAgICB7CisgICAgICAgIHN0cnVjdCBubGF0dHIgKndtbVN0YXRzOworICAgICAgICB3bW1TdGF0cyA9IG5sYV9uZXN0X3N0YXJ0KHZlbmRvcl9ldmVudCwgaSk7CisgICAgICAgIGlmKCF3bW1TdGF0cykKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBXaWZpSWZhY2VTdGF0VEwpOworICAgICAgICAgICAgcmV0dXJuIEZBTFNFOworICAgICAgICB9CisgICAgICAgIGlmIChGQUxTRSA9PSBwdXRfd2lmaV93bW1fYWNfc3RhdCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBXaWZpSWZhY2VTdGF0LT5BY2Nlc3NjbGFzc1N0YXRzW2ldLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ZW5kb3JfZXZlbnQpKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICBGTCgiUUNBX1dMQU5fVkVORE9SX0FUVFIgcHV0IEZhaWwiKSk7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocFdpZmlJZmFjZVN0YXRUTCk7CisgICAgICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgICAgIH0KKworICAgICAgICBubGFfbmVzdF9lbmQodmVuZG9yX2V2ZW50LCB3bW1TdGF0cyk7CisgICAgfQorICAgIG5sYV9uZXN0X2VuZCh2ZW5kb3JfZXZlbnQsIHdtbUluZm8pOworICAgIHZvc19t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gICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQpOworICAgICAgICAgICAgcEluZm8tPnN0YXRlID0gV0lGSV9BU1NPQ0lBVElORzsKKyAgICAgICAgfQorICAgICAgICBpZiAoKGVDb25uZWN0aW9uU3RhdGVfQXNzb2NpYXRlZCA9PSBwSGRkU3RhQ3R4LT5jb25uX2luZm8uY29ublN0YXRlKSAmJgorICAgICAgICAgICAgKFZPU19GQUxTRSA9PSBwSGRkU3RhQ3R4LT5jb25uX2luZm8udUlzQXV0aGVudGljYXRlZCkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHN0YU1hYyA9ICh2X1U4X3QgKikgJihwQWRhcHRlci0+bWFjQWRkcmVzc0N1cnJlbnQuYnl0ZXNbMF0pOworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IGNsaWVudCAiIE1BQ19BRERSRVNTX1NUUgorICAgICAgICAgICAgICAgICIgaXMgaW4gdGhlIG1pZGRsZSBvZiBXUFMvRUFQT0wgZXhjaGFuZ2UuIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkoc3RhTWFjKSk7CisgICAgICAgICAgICBwSW5mby0+c3RhdGUgPSBXSUZJX0FVVEhFTlRJQ0FUSU5HOworICAgICAgICB9CisgICAgICAgIGlmIChlQ29ubmVjdGlvblN0YXRlX0Fzc29jaWF0ZWQgPT0gcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmNvbm5TdGF0ZSkKKyAgICAgICAgeworICAgICAgICAgICAgcEluZm8tPnN0YXRlID0gV0lGSV9BU1NPQ0lBVEVEOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBJbmZvLT5ic3NpZCwKKyAgICAgICAgICAgICAgICAgICAgJnBIZGRTdGFDdHgtPmNvbm5faW5mby5ic3NJZCwgV05JX0NGR19CU1NJRF9MRU4pOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBJ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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1ZPSURfdCAqcERhdGEpCit7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIHRwU2lyV2lmaVBlZXJTdGF0ICAgcFdpZmlQZWVyU3RhdDsKKyAgICB0cFNpcldpZmlQZWVySW5mbyAgIHBXaWZpUGVlckluZm87CisgICAgc3RydWN0IG5sYXR0ciAqcGVlckluZm87CisgICAgc3RydWN0IHNrX2J1ZmYgKnZlbmRvcl9ldmVudDsKKyAgICBpbnQgc3RhdHVzLCBpOworCisgICAgRU5URVIoKTsKKworICAgIHN0YXR1cyA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gc3RhdHVzKQorICAgIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHBXaWZpUGVlclN0YXQgPSAodHBTaXJXaWZpUGVlclN0YXQpIHBEYXRhOworCisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgIkxMX1NUQVRTX1BFRVJfQUxMIDogbnVtUGVlcnMgJXUiLAorICAgICAgICAgICAgcFdpZmlQZWVyU3RhdC0+bnVtUGVlcnMpOworICAgIC8qCisgICAgICogQWxsb2NhdGUgYSBzaXplIG9mIDQwOTYgZm9yIHRoZSBwZWVyIHN0YXRzIGNvbXByaXNpbmcKKyAgICAgKiBlYWNoIG9mIHNpemUgPSBzaXplb2YgKHRTaXJXaWZpUGVlckluZm8pICsgbnVtUmF0ZSAqCisgICAgICogc2l6ZW9mICh0U2lyV2lmaVJhdGVTdGF0KS5FYWNoIGZpZWxkIGlzIHB1dCB3aXRoIGFuCisgICAgICogTkwgYXR0cmlidXRlLlRoZSBzaXplIG9mIDQwOTYgaXMgY29uc2lkZXJlZCBhc3N1bWluZworICAgICAqIHRoYXQgbnVtYmVyIG9mIHJhdGVzI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IHJldHVybjsKKyAgICB9CisKKyAgICBwZWVySW5mbyA9IG5sYV9uZXN0X3N0YXJ0KHZlbmRvcl9ldmVudCwKKyAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX1BFRVJfSU5GTyk7CisgICAgaWYoIXBlZXJJbmZvKQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX1BFRVJfSU5GTyBwdXQgZmFpbCIsCisgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICBrZnJlZV9za2IodmVuZG9yX2V2ZW50KTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHBXaWZpUGVlckluZm8gPSAodHBTaXJXaWZpUGVlckluZm8pICAoKHVpbnQ4ICopCisgICAgICAgICAgICAgICAgcFdpZmlQZWVyU3RhdC0+cGVlckluZm8pOworCisgICAgZm9yIChpID0gMTsgaSA8PSBwV2lmaVBlZXJTdGF0LT5udW1QZWVyczsgaSsrKQorICAgIHsKKyAgICAgICAgaW50IG51bVJhdGUgPSBwV2lmaVBlZXJJbmZvLT5udW1SYXRlOworICAgICAgICBzdHJ1Y3QgbmxhdHRyICpwZWVycyA9IG5sYV9uZXN0X3N0YXJ0KHZlbmRvcl9ldmVudCwgaSk7CisKKyAgICAgICAgaWYoIXBlZXJzKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiJXM6IHBlZXIgc3RhdHMgcHV0IGZhaWwiLAorICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgICBrZnJlZV9za2IodmVuZG9yX2V2ZW50KTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBpZiAoRkFMU0UgPT0gcHV0X3dpZmlfcGVlcl9pbmZvKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBXaWZpUGVlckluZm8sIHZlbmRvcl9ldmVudCkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOiBwdXRfd2lmaV9wZWVyX2luZm8gcHV0IGZhaWwiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICBrZnJlZV9za2IodmVuZG9yX2V2ZW50KTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIHBXaWZpUGVlckluZm8gPSAodHBTaXJXaWZpUGVlckluZm8pICAoKHVpbnQ4ICopCisgICAgICAgICAgICAgICAgcFdpZmlQZWVyU3RhdC0+cGVlckluZm8gKworICAgICAgICAgICAgICAgIChpICogc2l6ZW9mKHRTaXJXaWZpUGVlckluZm8pKSArCisgICAgICAgICAgICAgICAgKG51bVJhdGUgKiBzaXplb2YgKHRTaXJXaWZpUmF0ZVN0YXQpKSk7CisgICAgICAgIG5sYV9uZXN0X2VuZCh2ZW5kb3JfZXZlbnQsIHBlZXJzKTsKKyAgICB9CisgICAgbmxhX25lc3RfZW5kKHZlbmRvcl9ldmVudCwgcGVlckluZm8pOworICAgIGNmZzgwMjExX3ZlbmRvcl9jbWRfcmVwbHkodmVuZG9yX2V2ZW50KTsKKyAgICBFWElUKCk7Cit9CisKKy8qCisgKiBoZGRfbGlua19sYXllcl9wcm9jZXNzX2lmYWNlX3N0YXRzICgpIC0gVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgYWZ0ZXIKKyAqIHJlY2VpdmluZyBMaW5rIExheWVyIEludGVyZmFjZSBzdGF0aXN0aWNzIGZyb20gRlcuVGhpcyBmdW5jdGlvbiBjb252ZXJ0cworICogdGhlIGZpcm13YXJlIGRhdGEgdG8gdGhlIE5MIGRhdGEgYW5kIHNlbmRzIHRoZSBz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NrYihwSGRkQ3R4LT53aXBoeSwKKyAgICAgICAgICAgTExfU1RBVFNfRVZFTlRfQlVGX1NJWkUpOworICAgIGlmICghdmVuZG9yX2V2ZW50KQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIEZMKCJjZmc4MDIxMV92ZW5kb3JfY21kX2FsbG9jX3JlcGx5X3NrYiBmYWlsZWQiKSApOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgcFdpZmlJZmFjZVN0YXQgPSAodHBTaXJXaWZpSWZhY2VTdGF0KSBwRGF0YTsKKworCisgICAgaWYgKEZBTFNFID09IGhkZF9nZXRfaW50ZXJmYWNlX2luZm8oIHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwV2lmaUlmYWNlU3RhdC0+aW5mbykpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgRkwoImhkZF9nZXRfaW50ZXJmYWNlX2luZm8gZ2V0IGZhaWwiKSApOworICAgICAgICBrZnJlZV9za2IodmVuZG9yX2V2ZW50KTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmIChGQUxTRSA9PSBwdXRfd2lmaV9pZmFjZV9zdGF0cyggcEFkYXB0ZXIsIHBXaWZpSWZhY2VTdGF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmVuZG9yX2V2ZW50KSkKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICBGTCgicHV0X3dpZmlfaWZhY2Vfc3RhdHMgZmFpbCIpICk7CisgICAgICAgIGtmcmVlX3NrYih2ZW5kb3JfZXZlbnQpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPL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gcmV0dXJuOworICAgIH0KKyAgICBwV2lmaVJhZGlvU3RhdCA9ICh0cFNpcldpZmlSYWRpb1N0YXQpIHBEYXRhOworCisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAiTExfU1RBVFNfUkFESU8iCisgICAgICAgICAgICIgcmFkaW8gaXMgJWQgb25UaW1lIGlzICV1ICIKKyAgICAgICAgICAgIiB0eFRpbWUgaXMgJXUgIHJ4VGltZSBpcyAldSAiCisgICAgICAgICAgICIgb25UaW1lU2NhbiBpcyAldSAgb25UaW1lTmJkIGlzICV1ICIKKyAgICAgICAgICAgIiBvblRpbWVFWFRTY2FuIGlzICV1IG9uVGltZVJvYW1TY2FuIGlzICV1ICIKKyAgICAgICAgICAgIiBvblRpbWVQbm9TY2FuIGlzICV1ICBvblRpbWVIczIwIGlzICV1ICIKKyAgICAgICAgICAgIiBudW1DaGFubmVscyBpcyAldSIsCisgICAgICAgICAgIHBXaWZpUmFkaW9TdGF0LT5yYWRpbywgcFdpZmlSYWRpb1N0YXQtPm9uVGltZSwKKyAgICAgICAgICAgcFdpZmlSYWRpb1N0YXQtPnR4VGltZSwgcFdpZmlSYWRpb1N0YXQtPnJ4VGltZSwKKyAgICAgICAgICAgcFdpZmlSYWRpb1N0YXQtPm9uVGltZVNjYW4sIHBXaWZpUmFkaW9TdGF0LT5vblRpbWVOYmQsCisgICAgICAgICAgIHBXaWZpUmFkaW9TdGF0LT5vblRpbWVFWFRTY2FuLAorICAgICAgICAgICBwV2lmaVJhZGlvU3RhdC0+b25UaW1lUm9hbVNjYW4sCisgICAgICAgICAgIHBXaWZpUmFkaW9TdGF0LT5vblRpbWVQbm9TY2FuLAorICAgICAgICAgICBwV2lmaVJhZGlvU3RhdC0+b25UaW1lSHMyMCwKKyAgICAgICAgICAgcFdpZmlSYWRpb1N0YXQtPm51bUNoYW5uZWxzKTsKKyAgICAvKgorICAgICAqIEFsbG9jYXRlIGEgc2l6ZSBvZiA0MDk2IGZvciB0aGUgUmFkaW8gc3RhdHMgY29tcHJpc2luZworICAgICAqIHNpemVvZiAodFNpcldpZmlSYWRpb1N0YXQpICsgbnVtQ2hhbm5lbHMgKiBzaXplb2YKKyAgICAgKiAodFNpcldpZmlDaGFubmVsU3RhdHMpLkVhY2ggY2hhbm5lbCBkYXRhIGlzIHB1dCB3aXRoIGFuCisgICAgICogTkwgYXR0cmlidXRlLlRoZSBzaXplIG9mIDQwOTYgaXMgY29uc2lkZXJlZCBhc3N1bWluZyB0aGF0CisgICAgICogbnVtYmVyIG9mIGNoYW5uZWxzIHNoYWxsIG5vdCBleGNlZWQgYmV5b25kICA2MCB3aXRoIHRoZQorICAgICAqIHNpemVvZiAodFNpcldpZmlDaGFubmVsU3RhdHMpIGJlaW5nIDI0IGJ5dGVzLgorICAgICAqLworCisgICAgdmVuZG9yX2V2ZW50ID0gY2ZnODAyMTFfdmVuZG9yX2NtZF9hbGxvY19yZXBseV9za2IocEhkZEN0eC0+d2lwaHksCisgICAgICAgICAgIExMX1NUQVRTX0VWRU5UX0JVRl9TSVpFKTsKKyAgICBpZiAoIXZlbmRvcl9ldmVudCkKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICBGTCgiY2ZnODAyMTFfdmVuZG9yX2NtZF9hbGxvY19yZXBseV9za2IgZmFpbGVkIikgKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmIChubGFfcHV0X3UzMih2ZW5kb3JfZXZlbnQsCisgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfVFlQRSwKKyAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9MTF9TVEFUU19UWVBFX1JBRElPKSB8fAorICAgICAgICBubGFfcHV0X3UzMih2ZW5kb3JfZXZlbnQsCisgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfUkFESU9fSUQsCisgICAgICAgICAgICAgcFdpZmlSYWRpb1N0YXQtPnJhZGlvKSAgICAgIHx8CisgICAgICAgIG5sYV9wdXRfdTMyKHZlbmRvcl9ldmVudCwKKyAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9MTF9TVEFUU19SQURJT19PTl9USU1FLAorICAgICAgICAgICAgIHBXaWZpUmFkaW9TdGF0LT5vblRpbWUpICAgICB8fAorICAgICAgICBubGFfcHV0X3UzMih2ZW5kb3JfZXZlbnQsCisgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfUkFESU9fVFhfVElNRSwKKyAgICAgICAgICAgICBwV2lmaVJhZGlvU3RhdC0+dHhUaW1lKSAgICAgfHwKKyAgICAgICAgbmxhX3B1dF91MzIodmVuZG9yX2V2ZW50LAorICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX1JBRElPX1JYX1RJTUUsCisgICAgICAgICAgICAgcFdpZmlSYWRpb1N0YXQtPnJ4VGltZSkgICAgIHx8CisgICAgICAgIG5sYV9wdXRfdTMyKHZlbmRvcl9ldmVudCwKKyAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9MTF9TVEFUU19SQURJT19PTl9USU1FX1NDQU4sCisgICAgICAgICAgICAgcFdpZmlSYWRpb1N0YXQtPm9uVGltZVNjYW4pIHx8CisgICAgICAgIG5sYV9wdXRfdTMyKHZlbmRvcl9ldmVudCwKKyAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9MTF9TVEFUU19SQURJT19PTl9USU1FX05CRCwKKyAgICAgICAgICAgICBwV2lmaVJhZGlvU3RhdC0+b25UaW1lTmJkKSAgfHwKKyAgICAgICAgbmxhX3B1dF91MzIodmVuZG9yX2V2ZW50LAorICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX1JBRElPX09OX1RJTUVfRVhUU0NBTiwKKyAgICAgICAgICAgICBwV2lmaVJhZGlvU3RhdC0+b25UaW1lRVhUU2Nhbil8fAorICAgICAgICBubGFfcHV0X3UzMih2ZW5kb3JfZXZlbnQsCisgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfUkFESU9fT05fVElNRV9ST0FNX1NDQU4sCisgICAgICAgICAgICAgcFdpZmlSYWRpb1N0YXQtPm9uVGltZVJvYW1TY2FuKSB8fAorICAgICAgICBubGFfcHV0X3UzMih2ZW5kb3JfZXZlbnQsCisgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfUkFESU9fT05fVElNRV9QTk9fU0NBTiwKKyAgICAgICAgICAgICBwV2lmaVJhZGlvU3RhdC0+b25UaW1lUG5vU2NhbikgfHwKKyAgICAgICAgbmxhX3B1dF91MzIodmVuZG9yX2V2ZW50LAorICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX1JBRElPX09OX1RJTUVfSFMyMCwKKyAgICAgICAgICAgICBwV2lmaVJhZGlvU3RhdC0+b25UaW1lSHMyMCkgICAgfHwKKyAgICAgICAgbmxhX3B1dF91MzIodmVuZG9yX2V2ZW50LAorICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX1JBRElPX05VTV9DSEFOTkVMUywKKyAgICAgICAgICAgICBwV2lmaVJhZGlvU3RhdC0+bnVtQ2hhbm5lbHMpKQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICBGTCgiUUNBX1dMQU5fVkVORE9SX0FUVFIgcHV0IGZhaWwiKSk7CisgICAgICAgIGtmcmVlX3NrYih2ZW5kb3JfZXZlbnQpOworICAgICAgICByZXR1cm4gOworICAgIH0KKworICAgIGNoTGlzdCA9IG5sYV9uZXN0X3N0YXJ0KHZlbmRvcl9ldmVudCwKKyAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9MTF9TVEFUU19DSF9JTkZPKTsKKyAgICBpZighY2hMaXN0KQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX0NIX0lORk8gcHV0IGZhaWwiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAga2ZyZWVfc2tiKHZlbmRvcl9ldmVudCk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgZm9yIChpID0gMDsgaSA8IHBXaWZpUmFkaW9TdGF0LT5udW1DaGFubmVsczsgaSsrKQorICAgIHsKKyAgICAgICAgc3RydWN0IG5sYXR0ciAqY2hJbmZvOworCisgICAgICAgIHBXaWZpQ2hhbm5lbFN0YXRzID0gKHRwU2lyV2lmaUNoYW5uZWxTdGF0cykgKCh1aW50OCopCisgICAgICAgICAgICAgICAgcFdpZmlSYWRpb1N0YXQtPmNoYW5uZWxzICsKKyAgICAgICAgICAgICAgICAoaSAqIHNpemVvZih0U2lyV2lmaUNoYW5uZWxTdGF0cykpKTsKKworICAgICAgICBjaEluZm8gPSBubGFfbmVzdF9zdGFydCh2ZW5kb3JfZXZlbnQsIGkpOworICAgICAgICBpZighY2hJbmZvKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiJXM6IGZhaWxlZCB0byBwdXQgY2hJbmZvIiwKKyAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICAga2ZyZWVfc2tiKHZlbmRvcl9ldmVudCk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBpZiAobmxhX3B1dF91MzIodmVuZG9yX2V2ZW50LAor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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqcFJzcCwgdTggICptYWNBZGRyKQoreworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSAoaGRkX2NvbnRleHRfdCAqKXBDdHg7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgPSBOVUxMOworICAgIHN0cnVjdCBoZGRfbGxfc3RhdHNfY29udGV4dCAqY29udGV4dDsKKyAgICB0cFNpckxMU3RhdHNSZXN1bHRzIGxpbmtMYXllclN0YXRzUmVzdWx0cyA9ICh0cFNpckxMU3RhdHNSZXN1bHRzKXBSc3A7CisgICAgaW50IHN0YXR1czsKKworICAgIEVOVEVSKCk7CisKKyAgICBzdGF0dXMgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHN0YXR1cykKKyAgICB7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBwQWRhcHRlciA9IGhkZF9nZXRfYWRhcHRlcl9ieV9tYWNhZGRyKHBIZGRDdHgsIG1hY0FkZHIpOworICAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICBGTCgiIE1BQyBhZGRyZXNzICVwTSBkb2VzIG5vdCBleGlzdCB3aXRoIGhvc3QiKSwKKyAgICAgICAgICAgICAgICBtYWNBZGRyKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAiJXM6IEludGVyZmFjZTogJXMgTExTdGF0cyBpbmRUeXBlOiAlZCIsIF9fZnVuY19fLAorICAgICAgICAgICAgcEFkYXB0ZXItPmRldi0+bmFtZSwgaW5kVHlwZSk7CisKKyAgICBzd2l0Y2ggKGluZFR5cGUpCisgICAgeworICAgIGNhc2UgU0lSX0hBTF9MTF9TVEFUU19SRVNVTFRTX1JTUDoKKyAgICAgICAgeworICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICJMTF9TVEFUUyBSRVNQIHBhcmFtSUQgPSAweCV4LCBpZmFjZUlkID0gJXUgTUFDOiAlcE0gIgorICAgICAgICAgICAgICAgICAgICAicmVzcElkID0gJXUsIG1vcmVSZXN1bHRUb0ZvbGxvdyA9ICV1IiwKKyAgICAgICAgICAgICAgICAgICAgbGlua0xheWVyU3RhdHNSZXN1bHRzLT5wYXJhbUlkLCBsaW5rTGF5ZXJTdGF0c1Jlc3VsdHMtPmlmYWNlSWQsCisgICAgICAgICAgICAgICAgICAgIG1hY0FkZHIsIGxpbmtMYXllclN0YXRzUmVzdWx0cy0+cmVzcElkLAorICAgICAgICAgICAgICAgICAgICBsaW5rTGF5ZXJTdGF0c1Jlc3VsdHMtPm1vcmVSZXN1bHRUb0ZvbGxvdyk7CisgICAgICAgICAgIHNwaW5fbG9jaygmaGRkX2NvbnRleHRfbG9jayk7CisgICAgICAgICAgICBjb250ZXh0ID0gJnBIZGRDdHgtPmxsX3N0YXRzX2NvbnRleHQ7CisgICAgICAgICAgICAvKiB2YWxpZGF0ZSByZXNwb25zZSByZWNlaXZlZCBmcm9tIHRhcmdldCAqLworICAgICAgICAgICAgaWYgKChjb250ZXh0LT5yZXF1ZXN0X2lkICE9IGxpbmtMYXllclN0YXRzUmVzdWx0cy0+cmVzcElkKSB8fAorICAgICAgICAgICAgICAgICEoY29udGV4dC0+cmVxdWVzdF9iaXRtYXAgJiBsaW5rTGF5ZXJTdGF0c1Jlc3VsdHMtPnBhcmFtSWQpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNwaW5fdW5sb2NrKCZoZGRfY29udGV4dF9sb2NrKTsKKyAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwKKyAgICAgICAgICAgICAgICAgICBGTCgiRXJyb3IgOiBSZXF1ZXN0IGlkICVkIHJlc3BvbnNlIGlkICVkIHJlcXVlc3QgYml0bWFwIDB4JXgiCisgICAgICAgICAgICAgICAgICAgICAgInJlc3BvbnNlIGJpdG1hcCAweCV4IiksCisgICAgICAgICAgICAgICAgICAgY29udGV4dC0+cmVxdWVzdF9pZCwgbGlua0xheWVyU3RhdHNSZXN1bHRzLT5yZXNwSWQsCisgICAgICAgICAgICAgICAgICAgY29udGV4dC0+cmVxdWVzdF9iaXRtYXAsIGxpbmtMYXllclN0YXRzUmVzdWx0cy0+cGFyYW1JZCk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc3Bpbl91bmxvY2soJmhkZF9jb250ZXh0X2xvY2spOworCisgICAgICAgICAgICBpZiAoIGxpbmtMYXllclN0YXRzUmVzdWx0cy0+cGFyYW1JZCAmIFdNSV9MSU5LX1NUQVRTX1JBRElPICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRfbGlua19sYXllcl9wcm9jZXNzX3JhZGlvX3N0YXRzKHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodl9WT0lEX3QgKilsaW5rTGF5ZXJTdGF0c1Jlc3VsdHMtPnJlc3VsdCk7CisgICAgICAgICAgICAgICAgc3Bpbl9sb2NrKCZoZGRfY29udGV4dF9sb2NrKTsKKyAgICAgICAgICAgICAgICBjb250ZXh0LT5yZXF1ZXN0X2JpdG1hcCAmPSB+KFdNSV9MSU5LX1NUQVRTX1JBRElPKTsKKyAgICAgICAgICAgICAgICBzcGluX3VubG9jaygmaGRkX2NvbnRleHRfbG9jayk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmICggbGlua0xheWVyU3RhdHNSZXN1bHRzLT5wYXJhbUlkICYgV01JX0xJTktfU1RBVFNfSUZBQ0UgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZF9saW5rX2xheWVyX3Byb2Nlc3NfaWZhY2Vfc3RhdHMocEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2X1ZPSURfdCAqKWxpbmtMYXllclN0YXRzUmVzdWx0cy0+cmVzdWx0KTsKKyAgICAgICAgICAgICAgICBzcGluX2xvY2soJmhkZF9jb250ZXh0X2xvY2spOworICAgICAgICAgICAgICAgIGNvbnRleHQtPnJlcXVlc3RfYml0bWFwICY9IH4oV01JX0xJTktfU1RBVFNfSUZBQ0UpOworICAgICAgICAgICAgICAgIHNwaW5fdW5sb2NrKCZoZGRfY29udGV4dF9sb2NrKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKCBsaW5rTGF5ZXJTdGF0c1Jlc3VsdHMtPnBhcmFtSWQgJgorICAgICAgICAgICAgICAgICAgICBXTUlfTElOS19TVEFUU19BTExfUEVFUiApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkX2xpbmtfbGF5ZXJfcHJvY2Vzc19wZWVyX3N0YXRzKHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodl9WT0lEX3QgKilsaW5rTGF5ZXJTdGF0c1Jlc3VsdHMtPnJlc3VsdCk7CisgICAgICAgICAgICAgICAgc3Bpbl9sb2NrKCZoZGRfY29udGV4dF9sb2NrKTsKKyAgICAgICAgICAgICAgICBjb250ZXh0LT5yZXF1ZXN0X2JpdG1hcCAmPSB+KFdNSV9MSU5LX1NUQVRTX0FMTF9QRUVSKTsKKyAgICAgICAgICAgICAgICBzcGluX3VubG9jaygmaGRkX2NvbnRleHRfbG9jayk7CisgICAgICAgICAgICB9IC8qIFdNSV9MSU5LX1NUQVRTX0FMTF9QRUVSICovCisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJJTlZBTElEIExMX1NUQVRTX05PVElGWSBSRVNQT05TRSAqKioqKioqKioqKiIpKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc3Bpbl9sb2NrKCZoZGRfY29udGV4dF9sb2NrKTsKKyAgICAgICAgICAgIC8qIGNvbXBsZXRlIHJlc3BvbnNlIGV2ZW50IGlmIGFsbCByZXF1ZXN0cyBhcmUgY29tcGxldGVkICovCisgICAgICAgICAgICBpZiAoMCA9PSBjb250ZXh0LT5yZXF1ZXN0X2JpdG1hcCkKKyAgICAgICAgICAgICAgICBjb21wbGV0ZSgmY29udGV4dC0+cmVzcG9uc2VfZXZlbnQpOworICAgICAgICAgICAgc3Bpbl91bmxvY2soJmhkZF9jb250ZXh0X2xvY2spOworCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgImludmFsaWQgZXZlbnQgdHlwZSAlZCIsIGluZFR5cGUpOworICAgICAgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgRVhJVCgpOworICAgIHJldHVybjsKK30KKworY29uc3Qgc3RydWN0CitubGFfcG9saWN5CitxY2Ffd2xhbl92ZW5kb3JfbGxfc2V0X3BvbGljeVtRQ0FfV0xBTl9WRU5ET1JfQVRUUl9MTF9TVEFUU19TRVRfTUFYICsxXSA9Cit7CisgICAgW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX1NFVF9DT05GSUdfTVBEVV9TSVpFX1RIUkVTSE9MRF0gPQorICAgIHsgLnR5cGUgPSBOTEFfVTMyIH0sCisgICAgW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX1NFVF9DT05GSUdfQUdHUkVTU0lWRV9TVEFUU19HQVRIRVJJTkddID0KKyAgICB7IC50eXBlID0gTkxBX1UzMiB9LAorfTsKKworc3RhdGljIGludCBfX3dsYW5faGRkX2NmZzgwMjExX2xsX3N0YXRzX3NldChzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgd2lyZWxlc3NfZGV2ICp3ZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2b2lkICpkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGF0YV9sZW4pCit7CisgICAgaW50IHN0YXR1czsKKyAgICBzdHJ1Y3QgbmxhdHRyICp0Yl92ZW5kb3JbUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfU0VUX01BWCArIDFdOworICAgIHRTaXJMTFN0YXRzU2V0UmVxIGxpbmtMYXllclN0YXRzU2V0UmVxOworICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgPSB3ZGV2LT5uZXRkZXY7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gd2lwaHlfcHJpdih3aXBoeSk7CisKKyAgICBFTlRFUigpOworCisgICAgc3RhdHVzID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSBzdGF0dXMpCisgICAgeworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBpZiAoTlVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICBGTCgiSEREIGFkYXB0ZXIgaXMgTnVsbCIpKTsKKyAgICAgICAgcmV0dXJuIC1FTk9ERVY7CisgICAgfQorICAgIC8qIGNoZWNrIHRoZSBMTFN0YXRzIENhcG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GxpbmtMYXllclN0YXRzU2V0UmVxLnJlcUlkLCBsaW5rTGF5ZXJTdGF0c1NldFJlcS5tYWNBZGRyLAorICAgICAgICAgICBsaW5rTGF5ZXJTdGF0c1NldFJlcS5tcGR1U2l6ZVRocmVzaG9sZCwKKyAgICAgICAgICAgbGlua0xheWVyU3RhdHNTZXRSZXEuYWdncmVzc2l2ZVN0YXRpc3RpY3NHYXRoZXJpbmcpOworCisgICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gc21lX1NldExpbmtMYXllclN0YXRzSW5kQ0IoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+aEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZGRfbGlua19sYXllcl9zdGF0c19pbmRfY2FsbGJhY2spKQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiIKKyAgICAgICAgICAgInNtZV9TZXRMaW5rTGF5ZXJTdGF0c0luZENCIEZhaWxlZCIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisKKyAgICB9CisKKyAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzbWVfTExTdGF0c1NldFJlcSggcEhkZEN0eC0+aEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmxpbmtMYXllclN0YXRzU2V0UmVxKSkKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczoiCisgICAgICAgICAgICJzbWVfTExTdGF0c1NldFJlcSBGYWlsZWQiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIHBBZGFwdGVyLT5pc0xpbmtMYXllclN0YXRzU2V0ID0gMTsKKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gMDsKK30KK3N0YXRpY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dID0geyAudHlwZSA9IE5MQV9VMzIgfSwKKworICAgIC8qIFVuc2lnbmVkIDMyYml0IHZhbHVlIC4gYml0IG1hc2sgdG8gaWRlbnRpZnkgd2hhdCBzdGF0aXN0aWNzIGFyZQorICAgICAgICAgcmVxdWVzdGVkIGZvciByZXRyaWV2YWwgKi8KKyAgICBbUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfR0VUX0NPTkZJR19SRVFfTUFTS10gPSB7IC50eXBlID0gTkxBX1UzMiB9LAorfTsKKworc3RhdGljIGludCBfX3dsYW5faGRkX2NmZzgwMjExX2xsX3N0YXRzX2dldChzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgd2lyZWxlc3NfZGV2ICp3ZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2b2lkICpkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGF0YV9sZW4pCit7CisgICAgdW5zaWduZWQgbG9uZyByYzsKKyAgICBzdHJ1Y3QgaGRkX2xsX3N0YXRzX2NvbnRleHQgKmNvbnRleHQ7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IHdpcGh5X3ByaXYod2lwaHkpOworICAgIHN0cnVjdCBubGF0dHIgKnRiX3ZlbmRvcltRQ0FfV0xBTl9WRU5ET1JfQVRUUl9MTF9TVEFUU19HRVRfTUFYICsgMV07CisgICAgdFNpckxMU3RhdHNHZXRSZXEgbGlua0xheWVyU3RhdHNHZXRSZXE7CisgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiA9IHdkZXYtPm5ldGRldjsKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciA9IFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgIGhkZF9zdGF0aW9uX2N0eF90ICpwSGRkU3RhQ3R4ID0gV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlcik7CisgICAgaW50IHN0YXR1czsKKworICAgIEVOVEVSKCk7CisKKyAgICBzdGF0dXMgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHN0YXR1cykKKyAgICB7CisgICAgICAgIHJldHVybiAtRUlOVkFMIDsKKyAgICB9CisKKyAgICBpZiAoTlVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAiJXM6IEhERCBhZGFwdGVyIGlzIE51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRU5PREVWOworICAgIH0KKworICAgIGlmIChwSGRkU3RhQ3R4ID09IE5VTEwpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgIiVzOiBIZGRTdGFDdHggaXMgTnVsbCIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FTk9ERVY7CisgICAgfQorCisgICAgLyogY2hlY2sgdGhlIExMU3RhdHMgQ2FwYWJpbGl0eSAqLworICAgIGlmICggKFRSVUUgIT0gcEhkZEN0eC0+Y2ZnX2luaS0+ZkVuYWJsZUxMU3RhdHMpIHx8CisgICAgICAgICAoVFJVRSAhPSBzbWVfSXNGZWF0dXJlU3VwcG9ydGVkQnlGVyhMSU5LX0xBWUVSX1NUQVRTX01FQVMpKSkKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICBGTCgiTGluayBMYXllciBTdGF0aXN0aWNzIG5vdCBzdXBwb3J0ZWQgYnkgRmlybXdhcmUiKSk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworCisgICAgaWYgKCF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ICAgIGxpbmtMYXllclN0YXRzR2V0UmVxLnBhcmFtSWRNYXNrKTsKKworICAgIHNwaW5fbG9jaygmaGRkX2NvbnRleHRfbG9jayk7CisgICAgY29udGV4dCA9ICZwSGRkQ3R4LT5sbF9zdGF0c19jb250ZXh0OworICAgIGNvbnRleHQtPnJlcXVlc3RfaWQgPSBsaW5rTGF5ZXJTdGF0c0dldFJlcS5yZXFJZDsKKyAgICBjb250ZXh0LT5yZXF1ZXN0X2JpdG1hcCA9IGxpbmtMYXllclN0YXRzR2V0UmVxLnBhcmFtSWRNYXNrOworICAgIElOSVRfQ09NUExFVElPTihjb250ZXh0LT5yZXNwb25zZV9ldmVudCk7CisgICAgc3Bpbl91bmxvY2soJmhkZF9jb250ZXh0X2xvY2spOworCisgICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgICE9IHNtZV9MTFN0YXRzR2V0UmVxKCBwSGRkQ3R4LT5oSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmxpbmtMYXllclN0YXRzR2V0UmVxKSkKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczoiCisgICAgICAgICAgICAgICAic21lX0xMU3RhdHNHZXRSZXEgRmFpbGVkIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICByYyA9IHdhaXRfZm9yX2NvbXBsZXRpb25fdGltZW91dCgmY29udGV4dC0+cmVzcG9uc2VfZXZlbnQsCisgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKFdMQU5fV0FJVF9USU1FX0xMX1NUQVRTKSk7CisgICAgaWYgKCFyYykKKyAgICB7CisgICAgICAgIGhkZExvZyhMT0dFLAorICAgICAgICAgICAgRkwoIlRhcmdldCByZXNwb25zZSB0aW1lZCBvdXQgcmVxdWVzdCBpZCAlZCByZXF1ZXN0IGJpdG1hcCAweCV4IiksCisgICAgICAgICAgICBjb250ZXh0LT5yZXF1ZXN0X2lkLCBjb250ZXh0LT5yZXF1ZXN0X2JpdG1hcCk7CisgICAgICAgIHJldHVybiAtRVRJTUVET1VUOworICAgIH0KKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV9sbF9zdGF0c19nZXQoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXJlbGVzc19kZXYgKndkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2b2lkICpkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGRhdGFfbGVuKQoreworICAgIGludCByZXQgPSAwOworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX3dsYW5faGRkX2NmZzgwMjExX2xsX3N0YXRzX2dldCh3aXBoeSwgd2RldiwgZGF0YSwgZGF0YV9sZW4pOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKK2NvbnN0IHN0cnVjdAorbmxhX3BvbGljeQorcWNhX3dsYW5fdmVuZG9yX2xsX2Nscl9wb2xpY3lbUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfQ0xSX01BWCArMV0gPQoreworICAgIFtRQ0FfV0xBTl9WRU5ET1JfQVRUUl9MTF9TVEFUU19DTFJfQ09ORklHX1JFUV9NQVNLXSA9IHsudHlwZSA9IE5MQV9VMzIgfSwKKyAgICBbUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfQ0xSX0NPTkZJR19TVE9QX1JFUV0gPSB7LnR5cGUgPSBOTEFfVTggfSwKKyAgICBbUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfQ0xSX0NPTkZJR19SU1BfTUFTS10gPSB7LnR5cGUgPSBOTEFfVTMyIH0sCisgICAgW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX0NMUl9DT05GSUdfU1RPUF9SU1BdID0gey50eXBlID0gTkxBX1U4IH0sCit9OworCitzdGF0aWMgaW50IF9fd2xhbl9oZGRfY2ZnODAyMTFfbGxfc3RhdHNfY2xlYXIoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgd2lyZWxlc3NfZGV2ICp3ZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGRhdGFfbGVuKQoreworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSB3aXBoeV9wcml2KHdpcGh5KTsKKyAgICBzdHJ1Y3QgbmxhdHRyICp0Yl92ZW5kb3JbUUNBX1dMQU5fVkVORE9SX0FUVFJfTExfU1RBVFNfQ0xSX01BWCArIDFdOworICAgIHRTaXJMTFN0YXRzQ2xlYXJSZXEgbGlua0xheWVyU3RhdHNDbGVhclJlcTsKKyAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ID0gd2Rldi0+bmV0ZGV2OworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgdTMyIHN0YXRzQ2xlYXJSZXFNYXNrOworICAgIHU4IHN0b3BSZXE7CisgICAgaW50IHN0YXR1czsKKworICAgIEVOVEVSKCk7CisKKyAgICBzdGF0dXMgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHN0YXR1cykKKyAgICB7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAiJXM6IEhERCBhZGFwdGVyIGlzIE51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRU5PREVWOworICAgIH0KKyAgICAvKiBjaGVjayB0aGUgTExTdGF0cyBDYXBhYmlsaXR5ICovCisgICAgaWYgKCAoVFJVRSAhPSBwSGRkQ3R4LT5jZmdfaW5pLT5mRW5hYmxlTExTdGF0cykgfHwKKyAgICAgICAgIChUUlVFICE9IHNtZV9Jc0ZlYXR1cmVTdXBwb3J0ZWRCeUZXKExJTktfTEFZRVJfU1RBVFNfTUVBUykpKQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIEZMKCJFbmFibGUgTExTdGF0cyBDYXBhYmlsaXR5IikpOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBpZiAoIXBBZGFwdGVyLT5pc0xpbmtMYXllclN0YXRzU2V0KQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAiJXM6IGlzTGlua0xheWVyU3RhdHNTZXQgOiAlZCIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHBBZGFwdGVyLT5pc0xpbmtMYXllclN0YXRzU2V0KTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgaWYgKG5sYV9wYXJzZSh0Yl92ZW5kb3IsIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX0NMUl9NQVgsCisgICAgICAgICAgICAoc3RydWN0IG5sYXR0ciAqKWRhdGEsCisgICAgICAgICAgICBkYXRhX2xlbiwgcW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IHZvc19tZW1fY29weShsaW5rTGF5ZXJTdGF0c0NsZWFyUmVxLm1hY0FkZHIsCisgICAgICAgICAgICAgICBwQWRhcHRlci0+bWFjQWRkcmVzc0N1cnJlbnQuYnl0ZXMsIHNpemVvZih2X01BQ0FERFJfdCkpOworCisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgIkxMX1NUQVRTX0NMRUFSIHJlcUlkID0gJWQsIE1BQyA9ICVwTSwiCisgICAgICAgICAgICAic3RhdHNDbGVhclJlcU1hc2sgPSAweCVYLCBzdG9wUmVxICA9ICVkIiwKKyAgICAgICAgICAgIGxpbmtMYXllclN0YXRzQ2xlYXJSZXEucmVxSWQsCisgICAgICAgICAgICBsaW5rTGF5ZXJTdGF0c0NsZWFyUmVxLm1hY0FkZHIsCisgICAgICAgICAgICBsaW5rTGF5ZXJTdGF0c0NsZWFyUmVxLnN0YXRzQ2xlYXJSZXFNYXNrLAorICAgICAgICAgICAgbGlua0xheWVyU3RhdHNDbGVhclJlcS5zdG9wUmVxKTsKKworICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTID09IHNtZV9MTFN0YXRzQ2xlYXJSZXEocEhkZEN0eC0+aEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmxpbmtMYXllclN0YXRzQ2xlYXJSZXEpKQorICAgIHsKKyAgICAgICAgc3RydWN0IHNrX2J1ZmYgKnRlbXBfc2tidWZmOworICAgICAgICBoZGRfc3RhdGlvbl9jdHhfdCAqcEhkZFN0YUN0eDsKKworICAgICAgICBwSGRkU3RhQ3R4ID0gV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlcik7CisgICAgICAgIGlmIChWT1NfU1RBVFVTX1NVQ0NFU1MgIT0KKyAgICAgICAgICAgV0xBTlRMX0NsZWFySW50ZXJmYWNlU3RhdHMoKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+cHZvc0NvbnRleHQsCisgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5zdGFJZFswXSwgc3RhdHNDbGVhclJlcU1hc2spKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IgorICAgICAgICAgICAgICAgICAgICAiV0xBTlRMX0NsZWFySW50ZXJmYWNlU3RhdHMgRmFpbGVkIiwgX19mdW5jX18pOworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgIH0KKyAgICAgICAgaWYgKChzdGF0c0NsZWFyUmVxTWFzayAmIFdJRklfU1RBVFNfSUZBQ0VfQUMpIHx8CisgICAgICAgICAgICAgICAgKHN0YXRzQ2xlYXJSZXFNYXNrICYgV0lGSV9TVEFUU19JRkFDRSkpIHsKKyAgICAgICAgICAgIHBBZGFwdGVyLT5oZGRfc3RhdHMuaGRkVHhSeFN0YXRzLnR4TWNhc3RbV0xBTlRMX0FDX1ZPXSA9IDA7CisgICAgICAgICAgICBwQWRhcHRlci0+aGRkX3N0YXRzLmhkZFR4UnhTdGF0cy50eE1jYXN0W1dMQU5UTF9BQ19WSV0gPSAwOworICAgICAgICAgICAgcEFkYXB0ZXItPmhkZF9zdGF0cy5oZGRUeFJ4U3RhdHMudHhNY2FzdFtXTEFOVExfQUNfQkVdID0gMDsKKyAgICAgICAgICAgIHBBZGFwdGVyLT5oZGRfc3RhdHMuaGRkVHhSeFN0YXRzLnR4TWNhc3RbV0xBTlRMX0FDX0JLXSA9IDA7CisgICAgICAgIH0KKworICAgICAgICB0ZW1wX3NrYnVmZiA9IGNmZzgwMjExX3ZlbmRvcl9jbWRfYWxsb2NfcmVwbHlfc2tiKHdpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyICogc2l6ZW9mKHUzMikgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5MTVNHX0hEUkxFTik7CisKKyAgICAgICAgaWYgKHRlbXBfc2tidWZmICE9IE5VTEwpCisgICAgICAgIHsKKworICAgICAgICAgICAgaWYgKG5sYV9wdXRfdTMyKHRlbXBfc2tidWZmLAorICAgICAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9MTF9TVEFUU19DTFJfQ09ORklHX1JTUF9NQVNLLAorICAgICAgICAgICAgICAgICAgICBzdGF0c0NsZWFyUmVxTWFzaykgfHwKKyAgICAgICAgICAgICAgICAgbmxhX3B1dF91MzIodGVtcF9za2J1ZmYsCisgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0xMX1NUQVRTX0NMUl9DT05GSUdfU1RPUF9SU1AsCisgICAgICAgICAgICAgICAgICAgIHN0b3BSZXEpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgiTExfU1RBVFNfQ0xSIHB1dCBmYWlsIikpOworICAgICAgICAgICAgICAgICBrZnJlZV9za2IodGVtcF9za2J1ZmYpOworICAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8qIElmIHRoZSBhc2sgaXMgdG8gc3RvcCB0aGUgc3RhdHMgY29sbGVjdGlvbiBhcyBwYXJ0IG9mIGNsZWFyCisgICAgICAgICAgICAgKiAoc3RvcFJlcSA9IDEpICwgZW5zdXJlIHRoYXQgbm8gZnVydGhlciByZXF1ZXN0cyBvZiBnZXQKKyAgICAgICAgICAgICAqIGdvIHRvIHRoZSBmaXJtd2FyZSBieSBoYXZpbmcgaXNMaW5rTGF5ZXJTdGF0c1NldCBzZXQgdG8gMC4KKyAgICAgICAgICAgICAqIEhvd2V2ZXIgaXQgdGhlIHN0b3BSZXEgYXMgcGFydCBvZiB0aGUgY2xlYXIgcmVxdWVzdCBpcyAwICwKKyAgICAgICAgICAgICAqIHRoZSByZXF1ZXN0IHRvIGdldCB0aGUgc3RhdGlzdGljcyBhcmUgaG9ub3VyZWQgYXMgaW4gdGhpcworICAgICAgICAgICAgICogY2FzZSB0aGUgZmlybXdhcmUgaXMganVzdCBhc2tlZCB0byBjbGVhciB0aGUgc3RhdGlzdGljcy4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgaWYgKGxpbmtMYXllclN0YXRzQ2xlYXJSZXEuc3RvcFJlcSA9PSAxKQorICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5pc0xpbmtMYXllclN0YXRzU2V0ID0gMDsKKyAgICAgICAgICAgIHJldHVybiBjZmc4MDIxMV92ZW5kb3JfY21kX3JlcGx5KHRlbXBfc2tidWZmKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gLUVOT01FTTsKKyAgICB9CisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIC1FSU5WQUw7Cit9CitzdGF0aWMgaW50IHdsYW5faGRkX2NmZzgwMjExX2xsX3N0YXRzX2NsZWFyKHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXJlbGVzc19kZXYgKndkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkYXRhX2xlbikKK3sKKyAgIGludCByZXQgPSAwOworCisgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgcmV0ID0gX193bGFuX2hkZF9jZmc4MDIxMV9sbF9zdGF0c19jbGVhcih3aXBoeSwgd2RldiwgZGF0YSwgZGF0YV9sZW4pOworICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICByZXR1cm4gcmV0OworCisKK30KKyNlbmRpZiAvKiBXTEFOX0ZFQVRVUkVfTElOS19MQVlFUl9TVEFUUyAqLworCisja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XBlID0gTkxBX1U4IH0sCisKKyAgICBbUUNBX1dMQU5fVkVORE9SX0FUVFJfRVhUU0NBTl9CVUNLRVRfU1BFQ19JTkRFWF0gPSB7IC50eXBlID0gTkxBX1U4IH0sCisgICAgW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fQlVDS0VUX1NQRUNfQkFORF0gPSB7IC50eXBlID0gTkxBX1U4IH0sCisgICAgW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fQlVDS0VUX1NQRUNfUEVSSU9EXSA9IHsgLnR5cGUgPSBOTEFfVTMyIH0sCisgICAgW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fQlVDS0VUX1NQRUNfUkVQT1JUX0VWRU5UU10gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAudHlwZSA9IE5MQV9VOCB9LAorICAgIFtRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX0JVQ0tFVF9TUEVDX05VTV9DSEFOTkVMX1NQRUNTXSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IC50eXBlID0gTkxBX1UzMiB9LAorICAgIFtRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1NDQU5fQ01EX1BBUkFNU19CQVNFX1BFUklPRF0gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAudHlwZSA9IE5MQV9VMzIgfSwKKyAgICBbUUNBX1dMQU5fVkVORE9SX0FUVFJfRVhUU0NBTl9TQ0FOX0NNRF9QQVJBTVNfTUFYX0FQX1BFUl9TQ0FOXSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IC50eXBlID0gTkxBX1UzMiB9LAorICAgIFtRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1NDQU5fQ01EX1BBUkFNU19SRVBPUlRfVEhSRVNIT0xEXSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IC50eXBlID0gTkxBX1U4IH0sCisgICAgW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fU0NBTl9DTURfUEFSQU1TX05VTV9CVUNLRVRTXSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IC50eXBlID0gTkxBX1U4IH0sCisgICAgW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fR0VUX0NBQ0hFRF9TQ0FOX1JFU1VMVFNfQ09ORklHX1BBUkFNX0ZMVVNIXSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAudHlwZSA9IE5MQV9VOCB9LAorCisgICAgW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fR0VUX0NBQ0hFRF9TQ0FOX1JFU1VMVFNfQ09ORklHX1BBUkFNX01BWF0gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAudHlwZSA9IE5MQV9VMzIgfSwKKyAgICBbUUNBX1dMQU5fVkVORE9SX0FUVFJfRVhUU0NBTl9BUF9USFJFU0hPTERfUEFSQU1fQlNTSURdID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAudHlwZSA9IE5MQV9VTlNQRUMgfSwKKyAgICBbUUNBX1dMQU5fVkVORE9SX0FUVFJfRVhUU0NBTl9BUF9USFJFU0hPTERfUEFSQU1fUlNTSV9MT1ddID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgLnR5cGUgPSBOTEFfUzMyIH0sCisgICAgW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fQVBfVEhSRVNIT0xEX1BBUkFNX1JTU0lfSElHSF0gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAudHlwZSA9IE5MQV9TMzIgfSwKKyAgICBbUUNBX1dMQU5fVkVORE9SX0FUVFJfRVhUU0NBTl9BUF9USFJFU0hPTERfUEFSQU1fQ0hBTk5FTF0gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAudHlwZSA9IE5MQV9VMzIgfSwKKyAgICBbUUNBX1dMQU5fVkVORE9SX0FUVFJfRVhUU0NBTl9CU1NJRF9IT1RMSVNUX1BBUkFNU19OVU1fQVBdID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgLnR5cGUgPSBOTEFfVTMyIH0sCisgICAgW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fU0lHTklGSUNBTlRfQ0hBTkdFX1BBUkFNU19SU1NJX1NBTVBMRV9TSVpFXSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IC50eXBlID0gTkxBX1UzMiB9LAorICAgIFtRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1NJR05JRklDQU5UX0NIQU5HRV9QQVJBTVNfTE9TVF9BUF9TQU1QTEVfU0laRV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0geyAudHlwZSA9IE5MQV9VMzIgfSwKKyAgICBbUUNBX1dMQU5fVkVORE9SX0FUVFJfRVhUU0NBTl9TSUdOSUZJQ0FOVF9DSEFOR0VfUEFSQU1TX01JTl9CUkVBQ0hJTkddID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAudHlwZSA9IE5MQV9VMzIgfSwKKyAgICBbUUNBX1dMQU5fVkVORE9SX0FUVFJfRVhUU0NBTl9TSUdOSUZJQ0FOVF9DSEFOR0VfUEFSQU1TX05VTV9BUF0gPSB7IC50eXBlID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5MQV9VMzIgfSwKK307CisKK3N0YXRpYyB2b2lkIHdsYW5faGRkX2NmZzgwMjExX2V4dHNjYW5fZ2V0X2NhcGFiaWxpdGllc19pbmQodm9pZCAqY3R4LCB2b2lkICpwTXNnKQoreworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggID0gKGhkZF9jb250ZXh0X3QgKiljdHg7CisgICAgc3RydWN0IHNrX2J1ZmYgKnNrYiAgICAgPSBOVUxMOworICAgIHRwU2lyRVhUU2NhbkNhcGFiaWxpdGllc0V2ZW50IHBEYXRhID0KKyAgICAgICAgICAgICAgICAgICAgKHRwU2lyRVhUU2NhbkNhcGFiaWxpdGllc0V2ZW50KSBwTXNnOworCisgICAgRU5URVIoKTsKKworICAgIGlmICh3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpKQorICAgIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmICghcE1zZykKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJwTXNnIGlzIG51bGwiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgc2tiID0gY2ZnODAyMTFfdmVuZG9yX2V2ZW50X2FsbG9jKHBIZGRDdHgtPndpcGh5LAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywgMTgsIDApKQorICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgRVhUU0NBTl9FVkVOVF9CVUZfU0laRSArIE5MTVNHX0hEUkxFTiwKKyAgICAgICAgICAgICAgICAgICAgICAgIFFDQV9OTDgwMjExX1ZFTkRPUl9TVUJDTURfRVhUU0NBTl9HRVRfQ0FQQUJJTElUSUVTX0lOREVYLAorICAgICAgICAgICAgICAgICAgICAgICAgR0ZQX0tFUk5FTCk7CisKKyAgICBpZiAoIXNrYikgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgRkwoImNmZzgwMjExX3ZlbmRvcl9ldmVudF9hbGxvYyBmYWlsZWQiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICJSZXEgSWQgKCV1KSIsIHBEYXRhLT5yZXF1ZXN0SWQpOworICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIlNjYW4gY2FjaGUgc2l6ZSAoJXUpIiwgcERhdGEtPnNjYW5DYWNoZVNpemUpOworICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIlNjYW4gYnVja2V0cyAoJXUpIiwgcERhdGEtPnNjYW5CdWNrZXRzKTsKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICJNYXggQVAgcGVyIHNjYW4gKCV1KSIsIHBEYXRhLT5tYXhBcFBlclNjYW4pOworICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIm1heFJzc2lTYW1wbGVTaXplICgldSkiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEYXRhLT5tYXhSc3NpU2FtcGxlU2l6ZSk7CisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAibWF4U2NhblJlcG9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JuOworICAgIH0KKyAgICBpZiAoIXBNc2cpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgicE1zZyBpcyBudWxsIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgc2tiID0gY2ZnODAyMTFfdmVuZG9yX2V2ZW50X2FsbG9jKHBIZGRDdHgtPndpcGh5LAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywgMTgsIDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFWFRTQ0FOX0VWRU5UX0JVRl9TSVpFICsgTkxNU0dfSERSTEVOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFFDQV9OTDgwMjExX1ZFTkRPUl9TVUJDTURfRVhUU0NBTl9TVEFSVF9JTkRFWCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHRlBfS0VSTkVMKTsKKworICAgIGlmICghc2tiKSB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICBGTCgiY2ZnODAyMTFfdmVuZG9yX2V2ZW50X2FsbG9jIGZhaWxlZCIpKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sIEZMKCJFbnRlcmluZyAiKSk7CisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiUmVxIElkICgldSkiLCBwRGF0YS0+cmVxdWVzdElkKTsKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICJTdGF0dXMgKCV1KSIsIHBEYXRhLT5zdGF0dXMpOworCisgICAgaWYgKG5sYV9wdXRfdTMyKHNrYiwgUUNBX1dMQU5fVkVORE9SX0FUVFJfRV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WMtPnNtZS5leHRTY2FuU3RhcnRSZXFJZCA9IHBEYXRhLT5yZXF1ZXN0SWQ7CisKKworICAgIGNmZzgwMjExX3ZlbmRvcl9ldmVudChza2IsIEdGUF9LRVJORUwpOworICAgIEVYSVQoKTsKKyAgICByZXR1cm47CisKK25sYV9wdXRfZmFpbHVyZToKKyAgICBrZnJlZV9za2Ioc2tiKTsKKyAgICByZXR1cm47Cit9CisKKworc3RhdGljIHZvaWQgd2xhbl9oZGRfY2ZnODAyMTFfZXh0c2Nhbl9zdG9wX3JzcCh2b2lkICpjdHgsIHZvaWQgKnBNc2cpCit7CisgICAgdHBTaXJFWFRTY2FuU3RvcFJzcFBhcmFtcyBwRGF0YSA9ICh0cFNpckVYVFNjYW5TdG9wUnNwUGFyYW1zKSBwTXNnOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggICAgICAgID0gKGhkZF9jb250ZXh0X3QgKiljdHg7CisgICAgc3RydWN0IHNrX2J1ZmYgKnNrYiAgICAgICAgICAgPSBOVUxMOworCisgICAgRU5URVIoKTsKKworICAgIGlmICh3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpKXsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBpZiAoIXBNc2cpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgicE1zZyBpcyBudWxsIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgc2tiID0gY2ZnODAyMTFfdmVuZG9yX2V2ZW50X2FsbG9jKHBIZGRDdHgtPndpcGh5LAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywgMTgsIDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRVhUU0NBTl9FVkVOVF9CVUZfU0laRSArIE5MTVNHX0hEUkxFTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFFDQV9OTDgwMjExX1ZFTkRPUl9TVUJDTURfRVhUU0NBTl9TVE9QX0lOREVYLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR0ZQX0tFUk5FTCk7CisKKyAgICBpZiAoIXNrYikgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgRkwoImNmZzgwMjExX3ZlbmRvcl9ldmVudF9hbGxvYyBmYWlsZWQiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCBGTCgiRW50ZXJpbmcgIikpOworICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIlJlcSBJZCAoJXUpIiwgcERhdGEtPnJlcXVlc3RJZCk7CisKKyAgICBpZiAobmxhX3B1dF91MzIoc2tiLCBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1JFU1VMVFNfUkVRVUVTVF9JRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBwRGF0YS0+cmVxdWVzdElkKSB8fAorICAgICAgICBubGFfcHV0X3UzMihza2IsIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fU1RBVFVTLCBwRGF0YS0+c3RhdHVzKSkgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgibmxhIHB1dCBmYWlsIikpOworICAgICAgICBnb3RvIG5sYV9wdXRfZmFpbHVyZTsKKyAgICB9CisKKyAgICBjZmc4MDIxMV92ZW5kb3JfZXZlbnQoc2tiLCBHRlBfS0VSTkVMKTsKKyAgICBFWElUKCk7CisgICAgcmV0dXJuOworCitubGFfcHV0X2ZhaWx1cmU6CisgICAga2ZyZWVfc2tiKHNrYik7CisgICAgcmV0dXJuOworfQorCisKK3N0YXRpYyB2b2lkIHdsYW5faGRkX2NmZzgwMjExX2V4dHNjYW5fc2V0X2Jzc19ob3RsaXN0X3JzcCh2b2lkICpjdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnBNc2cpCit7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCAgICA9IChoZGRfY29udGV4dF90ICopY3R4OworICAgIHN0cnVjdCBza19idWZmICpza2IgICAgICAgPSBOVUxMOworICAgIHRwU2lyRVhUU2NhblNldEJzc2lkSG90TGlzdFJzcFBhcmFtcyBwRGF0YSA9CisgICAgICAgICAgICAgICAgICAgICh0cFNpckVYVFNjYW5TZXRCc3NpZEhvdExpc3RSc3BQYXJhbXMpIHBNc2c7CisKKyAgICBFTlRFUigpOworCisgICAgaWYgKHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCkpeworICAgICAgICByZXR1cm47CisgICAgfQorICAgIGlmICghcE1zZykKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJwTXNnIGlzIG51bGwiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBza2IgPSBjZmc4MDIxMV92ZW5kb3JfZXZlbnRfYWxsb2MocEhkZEN0eC0+d2lwaHksCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLCAxOCwgMCkpCisgICAgICAgICAgICAgICAgICAgICAgTlVMTCwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgIEVYVFNDQU5fRVZFTlRfQlVGX1NJWkUgKyBOTE1TR19IRFJMRU4sCisgICAgICAgICAgICAgICAgICAgICAgUUNBX05MODAyMTFfVkVORE9SX1NVQkNNRF9FWFRTQ0FOX1NFVF9CU1NJRF9IT1RMSVNUX0lOREVYLAorICAgICAgICAgICAgICAgICAgICAgIEdGUF9LRVJORUwpOworCisgICAg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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqcE1zZykKK3sKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ICA9IChoZGRfY29udGV4dF90ICopY3R4OworICAgIHN0cnVjdCBza19idWZmICpza2IgICAgID0gTlVMTDsKKyAgICB0cFNpckVYVFNjYW5SZXNldEJzc2lkSG90bGlzdFJzcFBhcmFtcyBwRGF0YSA9CisgICAgICAgICAgICAgICAgICAgICh0cFNpckVYVFNjYW5SZXNldEJzc2lkSG90bGlzdFJzcFBhcmFtcykgcE1zZzsKKworICAgIEVOVEVSKCk7CisKKyAgICBpZiAod2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KSkgeworICAgICAgICByZXR1cm47CisgICAgfQorICAgIGlmICghcE1zZykKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJwTXNnIGlzIG51bGwiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBza2IgPSBjZmc4MDIxMV92ZW5kb3JfZXZlbnRfYWxsb2MocEhkZEN0eC0+d2lwaHksCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLCAxOCwgMCkpCisgICAgICAgICAgICAgICAgICAgICAgTlVMTCwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgIEVYVFNDQU5fRVZFTlRfQlVGX1NJWkUgKyBOTE1TR19IRFJMRU4sCisgICAgICAgICAgICAgICAgICAgICAgUUNBX05MODAyMTFfVkVORE9SX1NVQkNNRF9FWFRTQ0FOX1JFU0VUX0JTU0lEX0hPVExJU1RfSU5ERVgsCisgICAgICAgICAgICAgICAgICAgICAgR0ZQX0tFUk5FTCk7CisKKyAgICBpZiAoIXNrYikgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAg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AgICBzdHJ1Y3Qgc2tfYnVmZiAqc2tiICAgICA9IE5VTEw7CisgICAgdHBTaXJFWFRTY2FuU2V0U2lnbmlmaWNhbnRDaGFuZ2VSc3BQYXJhbXMgcERhdGEgPQorICAgICAgICAgICAgICAgICAgICAodHBTaXJFWFRTY2FuU2V0U2lnbmlmaWNhbnRDaGFuZ2VSc3BQYXJhbXMpIHBNc2c7CisKKyAgICBFTlRFUigpOworCisgICAgaWYgKHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCkpIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBpZiAoIXBNc2cpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgicE1zZyBpcyBudWxsIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgc2tiID0gY2ZnODAyMTFfdmVuZG9yX2V2ZW50X2FsbG9jKHBIZGRDdHgtPndpcGh5LAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywgMTgsIDApKQorICAgICAgICAgICAgICAgIE5VTEwsCisjZW5kaWYKKyAgICAgICAgICAgICAgICBFWFRTQ0FOX0VWRU5UX0JVRl9TSVpFICsgTkxNU0dfSERSTEVOLAorICAgICAgICAgICAgICAgIFFDQV9OTDgwMjExX1ZFTkRPUl9TVUJDTURfRVhUU0NBTl9TRVRfU0lHTklGSUNBTlRfQ0hBTkdFX0lOREVYLAorICAgICAgICAgICAgICAgIEdGUF9LRVJORUwpOworCisgICAgaWYgKCFza2IpIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIEZMKCJjZmc4MDIxMV92ZW5kb3JfZXZlbnRfYWxsb2MgZmFpbGVkIikpOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgRkwoIkV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RVhUU2NhblJlc2V0U2lnbmlmaWNhbnRDaGFuZ2VSc3BQYXJhbXMgcERhdGEgPQorICAgICAgICAgICAgICAgICAgICAodHBTaXJFWFRTY2FuUmVzZXRTaWduaWZpY2FudENoYW5nZVJzcFBhcmFtcykgcE1zZzsKKworICAgIEVOVEVSKCk7CisKKyAgICBpZiAod2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KSkgeworICAgICAgICByZXR1cm47CisgICAgfQorICAgIGlmICghcE1zZykKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJwTXNnIGlzIG51bGwiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBza2IgPSBjZmc4MDIxMV92ZW5kb3JfZXZlbnRfYWxsb2MocEhkZEN0eC0+d2lwaHksCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLCAxOCwgMCkpCisgICAgICAgICAgICAgIE5VTEwsCisjZW5kaWYKKyAgICAgICAgICAgICAgRVhUU0NBTl9FVkVOVF9CVUZfU0laRSArIE5MTVNHX0hEUkxFTiwKKyAgICAgICAgICAgICAgUUNBX05MODAyMTFfVkVORE9SX1NVQkNNRF9FWFRTQ0FOX1JFU0VUX1NJR05JRklDQU5UX0NIQU5HRV9JTkRFWCwKKyAgICAgICAgICAgICAgR0ZQX0tFUk5FTCk7CisKKyAgICBpZiAoIXNrYikgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgRkwoImNmZzgwMjExX3ZlbmRvcl9ldmVudF9hbGxvYyBmYWlsZWQiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCBGTCgiRW50ZXJpbmcgIikpOworICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIlJl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eSwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsIDE4LCAwKSkKKyAgICAgICAgICAgICAgICBOVUxMLAorI2VuZGlmCisgICAgICAgICAgICAgICAgRVhUU0NBTl9FVkVOVF9CVUZfU0laRSArIE5MTVNHX0hEUkxFTiwKKyAgICAgICAgICAgICAgICBRQ0FfTkw4MDIxMV9WRU5ET1JfU1VCQ01EX0VYVFNDQU5fR0VUX0NBQ0hFRF9SRVNVTFRTX0lOREVYLAorICAgICAgICAgICAgICAgIEdGUF9LRVJORUwpOworCisgICAgICAgIGlmICghc2tiKSB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICBGTCgiY2ZnODAyMTFfdmVuZG9yX2V2ZW50X2FsbG9jIGZhaWxlZCIpKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgInJlc3VsdHNQZXJFdmVudCAoJXUpIiwgcmVzdWx0c1BlckV2ZW50KTsKKworICAgICAgICBpZiAobmxhX3B1dF91MzIoc2tiLCBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1JFU1VMVFNfUkVRVUVTVF9JRCwKKyAgICAgICAgICAgICAgICAgICAgcERhdGEtPnJlcXVlc3RJZCkgfHwKKyAgICAgICAgICAgICAgICBubGFfcHV0X3UzMihza2IsCisgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fUkVTVUxUU19OVU1fUkVTVUxUU19BVkFJTEFCTEUsCisgICAgICAgICAgICAgICAgICAgIHJlc3VsdHNQZXJFdmVudCkpIHsKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJwdXQgZmFpbCIpKTsKKyAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgfQorICAgICAgICBpZiAobmxhX3B1dF91OChza2IsCisgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fUkVTVUxUU19TQ0FOX1JFU1VMVF9NT1JFX0RBVEEsCisgICAgICAgICAgICAgICAgICAgIHBEYXRhLT5tb3JlRGF0YSA/IDEgOiAodG90YWxSZXN1bHRzID4gMCA/IDEgOiAwICkpKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgicHV0IGZhaWwiKSk7CisgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgIH0KKworICAgICAgICBpZiAocmVzdWx0c1BlckV2ZW50KSB7CisgICAgICAgICAgICBzdHJ1Y3QgbmxhdHRyICphcHM7CisKKyAgICAgICAgICAgIGFwcyA9IG5sYV9uZXN0X3N0YXJ0KHNrYiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1JFU1VMVFNfTElTVCk7CisgICAgICAgICAgICBpZiAoIWFwcykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgicHV0IGZhaWwiKSk7CisgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgcmVzdWx0c1BlckV2ZW50OyBqKyssIGkrKykgeworICAgICAgICAgICAgICAgIHN0cnVjdCBubGF0dHIgKmFwOworICAgICAgICAgICAgICAgIHBTaXJXaWZpU2NhblJlc3VsdCA9ICAodHBTaXJXaWZpU2NhblJlc3VsdCkgKCh0QU5JX1U4ICopCisgICAgICAgICAgICAgICAgICAgICAgICBwRGF0YS0+YXAgKyAoIGkqIHNpemVvZih0U2lyV2lmaVNjYW5SZXN1bHQpKSk7CisKKyAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICJbaW5kZXg9JXVdIFRpbWVzdGFtcCglbGx1KSAiCisgICAgICAgICAgICAgICAgICAgICAgICAiU3NpZCAoJXMpIgorICAgICAgICAgICAgICAgICAgICAgICAgIkJzc2lkOiAlcE0gIgorICAgICAgICAgICAgICAgICAgICAgICAgIkNoYW5uZWwgKCV1KSIKKyAgICAgICAgICAgICAgICAgICAgICAgICJSc3NpICglZCkiCisgICAgICAgICAgICAgICAgICAgICAgICAiUlRUICgldSkiCisgICAgICAgICAgICAgICAgICAgICAgICAiUlRUX1NEICgldSkiLAorICAgICAgICAgICAgICAgICAgICAgICAgaSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTaXJXaWZpU2NhblJlc3VsdC0+dHMsCisgICAgICAgICAgICAgICAgICAgICAgICBwU2lyV2lmaVNjYW5SZXN1bHQtPnNzaWQsCisgICAgICAgICAgICAgICAgICAgICAgICBwU2lyV2lmaVNjYW5SZXN1bHQtPmJzc2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgcFNpcldpZmlTY2FuUmVzdWx0LT5jaGFubmVsLAorICAgICAgICAgICAgICAgICAgICAgICAgcFNpcldpZmlTY2FuUmVzdWx0LT5yc3NpLAorICAgICAgICAgICAgICAgICAgICAgICAgcFNpcldpZmlTY2FuUmVzdWx0LT5ydHQsCisgICAgICAgICAgICAgICAgICAgICAgICBwU2lyV2lmaVNjYW5SZXN1bHQtPnJ0dF9zZCk7CisKKyAgICAgICAgICAgICAgICBhcCA9IG5sYV9uZXN0X3N0YXJ0KHNrYiwgaiArIDEpOworICAgICAgICAgICAgICAgIGlmICghYXApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgicHV0IGZhaWwiKSk7CisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAobmxhX3B1dF91NjQoc2tiLAorICAgICAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1JFU1VMVFNfU0NBTl9SRVNVTFRfVElNRV9TVEFNUCwKKyAgICAgICAgICAgICAgICAgICAgcFNpcldpZmlTY2FuUmVzdWx0LT50cykgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoInB1dCBmYWlsIikpOworICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChubGFfcHV0KHNrYiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1JFU1VMVFNfU0NBTl9SRVNVTFRfU1NJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YocFNpcldpZmlTY2FuUmVzdWx0LT5zc2lkKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTaXJXaWZpU2NhblJlc3VsdC0+c3NpZCkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoInB1dCBmYWlsIikpOworICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChubGFfcHV0KHNrYiwKKyAgICAgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fUkVTVUxUU19TQ0FOX1JFU1VMVF9CU1NJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihwU2lyV2lmaVNjYW5SZXN1bHQtPmJzc2lkKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTaXJXaWZpU2NhblJlc3VsdC0+YnNzaWQpICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJwdXQgZmFpbCIpKTsKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAobmxhX3B1dF91MzIoc2tiLAorICAgICAgICAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1JFU1VMVFNfU0NBTl9SRVNVTFRfQ0hBTk5FTCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTaXJXaWZpU2NhblJlc3VsdC0+Y2hhbm5lbCkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoInB1dCBmYWlsIikpOworICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChubGFfcHV0X3MzMihza2IsCisgICAgICAgICAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1JFU1VMVFNfU0NBTl9SRVNVTFRfUlNTSSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTaXJXaWZpU2NhblJlc3VsdC0+cnNzaSkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoInB1dCBmYWlsIikpOworICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChubGFfcHV0X3UzMihza2IsCisgICAgICAgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fUkVTVUxUU19TQ0FOX1JFU1VMVF9SVFQsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBTaXJXaWZpU2NhblJlc3VsdC0+cnR0KSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgicHV0IGZhaWwiKSk7CisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKG5sYV9wdXRfdTMyKHNrYiwKKyAgICAgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fUkVTVUxUU19TQ0FOX1JFU1VMVF9SVFRfU0QsCisgICAgICAgICAgICAgICAgICAgICAgICBwU2lyV2lmaVNjYW5SZXN1bHQtPnJ0dF9zZCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgicHV0IGZhaWwiKSk7CisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBubGFfbmVzdF9lbmQoc2tiLCBhcCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBubGFfbmVzdF9lbmQoc2tiLCBhcHMpOworCisgICAgICAgIH0KKyAgICAgICAgY2ZnODAyMTFfdmVuZG9yX2V2ZW50KHNrYiwgR0ZQX0tFUk5FTCk7CisgICAgfSB3aGlsZSAodG90YWxSZXN1bHRzID4gMCk7CisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuOworZmFpbDoKKyAgICBrZnJlZV9za2Ioc2tiKTsKKyAgICByZXR1cm47Cit9CisKK3N0YXRpYyB2b2lkIHdsYW5faGRkX2NmZzgwMjExX2V4dHNjYW5faG90bGlzdF9tYXRjaF9pbmQodm9pZCAqY3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqcE1zZykKK3sKKyAgICB0cFNpcldpZmlTY2FuUmVzdWx0RXZlbnQgcERhdGEgPSAodHBTaXJXaWZpU2NhblJlc3VsdEV2ZW50KSBwTXNnOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggICAgICAgICA9IChoZGRfY29udGV4dF90ICopY3R4OworICAgIHN0cnVjdCBza19idWZmICpza2IgICAgICAgICAgICA9IE5VTEw7CisgICAgdEFOSV9VMzIgaTsKKworICAgIEVOVEVSKCk7CisKKyAgICBpZiAod2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KSkgeworICAgICAgICByZXR1cm47CisgICAgfQorICAgIGlmICghcE1zZykKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJwTXNnIGlzIG51bGwiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBza2IgPSBjZmc4MDIxMV92ZW5kb3JfZXZlbnRfYWxsb2MocEhkZEN0eC0+d2lwaHksCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLCAxOCwgMCkpCisgICAgICAgICAgICAgICAgICAgICAgTlVMTCwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgIEVYVFNDQU5fRVZFTlRfQlVGX1NJWkUgKyBOTE1TR19IRFJMRU4sCisgICAgICAgICAgICAgICAgICAgICAgUUNBX05MODAyMTFfVkVORE9SX1NVQkNNRF9FWFRTQ0FOX0hPVExJU1RfQVBfRk9VTkRfSU5ERVgsCisgICAgICAgICAgICAgICAgICAgICAgR0ZQX0tFUk5FTCk7CisKKyAgICBpZiAoIXNrYikgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgRkwoImNmZzgwMjExX3ZlbmRvcl9ldmVudF9hbGxvYyBmYWlsZWQiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCBGTCgiRW50ZXJpbmcgIikpOworICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIlJlcSBJZCAoJXUpIiwgcERhdGEtPnJlcXVlc3RJZCk7CisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiTnVtIHJlc3VsdHMgKCV1KSIsIHBEYXRhLT5udW1PZkFwcyk7CisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiTW9yZSBEYXRhICgldSkiLCBwRGF0YS0+bW9yZURhdGEpOworCisgICAgZm9yIChpID0gMDsgaSA8IHBEYXRhLT5udW1PZkFwczsgaSsrKSB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIltpbmRleD0ldV0gVGltZXN0YW1wKDB4JWxsZCkgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlNzaWQgKCVzKSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQnNzaWQgKCIgTUFDX0FERFJFU1NfU1RSICIpICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJDaGFubmVsICgldSkgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlJzc2kgKCVkKSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiUlRUICgldSkgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlJUVF9TRCAoJXUpICIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERhdGEtPmFwW2ldLnRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERhdGEtPmFwW2ldLnNzaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwRGF0YS0+YXBbaV0uYnNzaWQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERhdGEtPmFwW2ldLmNoYW5uZWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRGF0YS0+YXBbaV0ucnNzaSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEYXRhLT5hcFtpXS5ydHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRGF0YS0+YXBbaV0ucnR0X3NkKTsKKyAgICB9CisKKyAgICBpZiAobmxhX3B1dF91MzIoc2tiLCBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1JFU1VMVFNfUkVRVUVTVF9JRCwKKyAgICAgICAgICAgICAgICAgICAgICBwRGF0YS0+cmVxdWVzdElkKSB8fAorICAgICAgICBubGFfcHV0X3UzMihza2IsCisgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fUkVTVUxUU19OVU1fUkVTVUxUU19BVkFJTEFCTEUsCisgICAgICAgICAgICAgICAgICAgICAgcERhdGEtPm51bU9mQXBzKSkgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgicHV0IGZhaWwiKSk7CisgICAgICAgIGdvdG8gZmFpbDsKKyAgICB9CisgICAgaWYgKHBEYXRhLT5udW1PZkFwcykgeworICAgICAgICBzdHJ1Y3QgbmxhdHRyICphcHM7CisKKyAgICAgICAgYXBzID0gbmxhX25lc3Rfc3RhcnQoc2tiLAorICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fUkVTVUxUU19MSVNUKTsKKyAgICAgICAgaWYgKCFhcHMpCisgICAgICAgICAgICBnb3RvIGZhaWw7CisKKyAgICAgICAgZm9yIChpID0gMDsgaSA8IHBEYXRhLT5udW1PZkFwczsgaSsrKSB7CisgICAgICAgICAgICBzdHJ1Y3QgbmxhdHRyICphcDsKKworICAgICAgICAgICAgYXAgPSBubGFfbmVzdF9zdGFydChza2IsIGkgKyAxKTsKKyAgICAgICAgICAgIGlmICghYXApCisgICAgICAgICAgICAgICAgZ290byBmYWlsOworCisgICAgICAgICAgICBpZiAobmxhX3B1dF91NjQoc2tiLAorICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fUkVTVUxUU19TQ0FOX1JFU1VMVF9USU1FX1NUQU1QLAorICAgICAgICAgICAgICAgICAgICBwRGF0YS0+YXBbaV0udHMpIHx8CisgICAgICAgICAgICAgICAgbmxhX3B1dChza2IsCisgICAgICAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1JFU1VMVFNfU0NBTl9SRVNVTFRfU1NJRCwKKyAgICAgICAgICAgICAgICAgICAgIHNpemVvZihwRGF0YS0+YXBbaV0uc3NpZCksCisgICAgICAgICAgICAgICAgICAgICBwRGF0YS0+YXBbaV0uc3NpZCkgfHwKKyAgICAgICAgICAgICAgICBubGFfcHV0KHNrYiwKKyAgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fUkVTVUxUU19TQ0FOX1JFU1VMVF9CU1NJRCwKKyAgICAgICAgICAgICAgICAgICAgIHNpemVvZihwRGF0YS0+YXBbaV0uYnNzaWQpLAorICAgICAgICAgICAgICAgICAgICAgcERhdGEtPmFwW2ldLmJzc2lkKSB8fAorICAgICAgICAgICAgICAgIG5sYV9wdXRfdTMyKHNrYiwKKyAgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fUkVTVUxUU19TQ0FOX1JFU1VMVF9DSEFOTkVMLAorICAgICAgICAgICAgICAgICAgICAgcERhdGEtPmFwW2ldLmNoYW5uZWwpIHx8CisgICAgICAgICAgICAgICAgbmxhX3B1dF9zMzIoc2tiLAorICAgICAgICAgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfRVhUU0NBTl9SRVNVTFRTX1NDQU5fUkVTVUxUX1JTU0ksCisgICAgICAgICAgICAgICAgICAgICBwRGF0YS0+YXBbaV0ucnNzaSkgfHwKKyAgICAgICAgICAgICAgICBubGFfcHV0X3UzMihza2IsCisgICAgICAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1JFU1VMVFNfU0NBTl9SRVNVTFRfUlRULAorICAgICAgICAgICAgICAgICAgICAgcERhdGEtPmFwW2ldLnJ0dCkgfHwKKyAgICAgICAgICAgICAgICBubGFfcHV0X3UzMihza2IsCisgICAgICAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1JFU1VMVFNfU0NBTl9SRVNVTFRfUlRUX1NELAorICAgICAgICAgICAgICAgICAgICAgcERhdGEtPmFwW2ldLnJ0dF9zZCkpCisgICAgICAgICAgICAgICAgZ290byBmYWlsOworCisgICAgICAgICAgICAgIG5sYV9uZXN0X2VuZChza2IsIGFwKTsKKyAgICAgICAgfQorICAgICAgICBubGFfbmVzdF9lbmQoc2tiLCBhcHMpOworCisgICAgICAgIGlmIChubGFfcHV0X3U4KHNrYiwKKyAgICAgICAgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfRVhUU0NBTl9SRVNVTFRTX1NDQU5fUkVTVUxUX01PUkVfREFUQSwKKyAgICAgICAgICAgICAgICAgICAgICBwRGF0YS0+bW9yZURhdGEpKQorICAgICAgICAgICAgZ290byBmYWlsOworICAgIH0KKworICAgIGNmZzgwMjExX3ZlbmRvcl9ldmVudChza2IsIEdGUF9LRVJORUwpOworICAgIEVYSVQoKTsKKyAgICByZXR1cm47CisKK2ZhaWw6CisgICAga2ZyZWVfc2tiKHNrYik7CisgICAgcmV0dXJuOworCit9CitzdGF0aWMgdm9pZCB3bGFuX2hkZF9jZmc4MDIxMV9leHRzY2FuX3NpZ25pZl93aWZpX2NoYW5nZV9yZXN1bHRzX2luZCh2b2lkICpjdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqcE1zZykKK3sKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ICA9IChoZGRfY29udGV4dF90ICopY3R4OworICAgIHN0cnVjdCBza19idWZmICpza2IgICAgID0gTlVMTDsKKyAgICB0QU5JX1UzMiBpLCBqOworICAgIHRwU2lyV2lmaVNpZ25pZmljYW50Q2hhbmdlRXZlbnQgcERhdGEgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0cFNpcldpZmlTaWduaWZpY2FudENoYW5nZUV2ZW50KSBwTXNnOworCisgICAgRU5URVIoKTsKKworICAgIGlmICh3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpKSB7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgaWYgKCFwTXNnKQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoInBNc2cgaXMgbnVsbCIpKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHNrYiA9IGNmZzgwMjExX3ZlbmRvcl9ldmVudF9hbGxvYyhwSGRkQ3R4LT53aXBoeSwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsIDE4LCAwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICBFWFRTQ0FOX0VWRU5UX0JVRl9TSVpFLAorICAgICAgICAgICAgICAgICAgICBRQ0FfTkw4MDIxMV9WRU5ET1JfU1VCQ01EX0VYVFNDQU5fU0lHTklGSUNBTlRfQ0hBTkdFX0lOREVYLAorICAgICAgICAgICAgICAgICAgICBHRlBfS0VSTkVMKTsKKworICAg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GZvciAoaiA9IDA7IGogPCBwRGF0YS0+c2lnUnNzaVJlc3VsdFtpXS5udW1Sc3NpOyBqKyspeworCisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICIgWyVkXSIsCisgICAgICAgICAgICAgICAgICAgIHBEYXRhLT5zaWdSc3NpUmVzdWx0W2ldLnJzc2lbal0pOworCisgICAgICAgIH0KKyAgICB9CisKKworICAgIGlmIChubGFfcHV0X3UzMihza2IsIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fUkVTVUxUU19SRVFVRVNUX0lELAorICAgICAgICAgICAgICAgIHBEYXRhLT5yZXF1ZXN0SWQpIHx8CisgICAgICAgICAgICBubGFfcHV0X3UzMihza2IsCisgICAgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfRVhUU0NBTl9SRVNVTFRTX05VTV9SRVNVTFRTX0FWQUlMQUJMRSwKKyAgICAgICAgICAgICAgICBwRGF0YS0+bnVtU2lnUnNzaUJzcykpIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoInB1dCBmYWlsIikpOworICAgICAgICBnb3RvIGZhaWw7CisgICAgfQorCisgICAgaWYgKHBEYXRhLT5udW1TaWdSc3NpQnNzKSB7CisgICAgICAgIHN0cnVjdCBubGF0dHIgKmFwczsKKyAgICAgICAgYXBzID0gbmxhX25lc3Rfc3RhcnQoc2tiLCBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1JFU1VMVFNfTElTVCk7CisgICAgICAgIGlmICghYXBzKQorICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcERhdGEtPm51bVNpZ1Jzc2lCc3M7IGkrKykgeworICAgICAgICAgICAgc3RydWN0IG5sYXR0ciAqYXA7CisKKyAgICAgICAgICAgIGFwID0gbmxhX25lc3Rfc3RhcnQo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pKSkKKyAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICBubGFfbmVzdF9lbmQoc2tiLCBhcCk7CisgICAgICAgIH0KKyAgICAgICAgbmxhX25lc3RfZW5kKHNrYiwgYXBzKTsKKyAgICAgICAgaWYgKG5sYV9wdXRfdTgoc2tiLAorICAgICAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1JFU1VMVFNfU0NBTl9SRVNVTFRfTU9SRV9EQVRBLAorICAgICAgICAgICAgICAgICAgICBwRGF0YS0+bW9yZURhdGEpKQorICAgICAgICAgICAgZ290byBmYWlsOworICAgIH0KKyAgICBjZmc4MDIxMV92ZW5kb3JfZXZlbnQoc2tiLCBHRlBfS0VSTkVMKTsKKyAgICBFWElUKCk7CisgICAgcmV0dXJuOworZmFpbDoKKyAgICBrZnJlZV9za2Ioc2tiKTsKKyAgICByZXR1cm47Cit9CisKK3N0YXRpYyB2b2lkIHdsYW5faGRkX2NmZzgwMjExX2V4dHNjYW5fZnVsbF9zY2FuX3Jlc3VsdF9ldmVudCh2b2lkICpjdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnBNc2cpCit7CisgICAgc3RydWN0IHNrX2J1ZmYgKnNrYjsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ICA9IChoZGRfY29udGV4dF90ICopY3R4OworICAgIHRwU2lyV2lmaUZ1bGxTY2FuUmVzdWx0RXZlbnQgcERhdGEgPQorICAgICAgICAodHBTaXJXaWZpRnVsbFNjYW5SZXN1bHRFdmVudCkgKHBNc2cpOworCisgICAgRU5URVIoKTsKKworICAgIGlmICh3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpKSB7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgaWYgKCFwTXNnKQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UU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IikiCisgICAgICAgICAgICAgICAgIkNoYW5uZWwgKCV1KSIKKyAgICAgICAgICAgICAgICAiUnNzaSAoJWQpIgorICAgICAgICAgICAgICAgICJSVFQgKCV1KSIKKyAgICAgICAgICAgICAgICAiUlRUX1NEICgldSkiKSwKKyAgICAgICAgICAgIHBEYXRhLT5hcC50cywKKyAgICAgICAgICAgIHBEYXRhLT5hcC5zc2lkLAorICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocERhdGEtPmFwLmJzc2lkKSwKKyAgICAgICAgICAgIHBEYXRhLT5hcC5jaGFubmVsLAorICAgICAgICAgICAgcERhdGEtPmFwLnJzc2ksCisgICAgICAgICAgICBwRGF0YS0+YXAucnR0LAorICAgICAgICAgICAgcERhdGEtPmFwLnJ0dF9zZCk7CisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiSUUgTGVuZ3RoICgldSkiLCBwRGF0YS0+aWVMZW5ndGgpOworICAgIGlmIChubGFfcHV0X3UzMihza2IsIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fUkVTVUxUU19SRVFVRVNUX0lELAorICAgICAgICAgICAgICAgIHBEYXRhLT5yZXF1ZXN0SWQpIHx8CisgICAgICAgIG5sYV9wdXRfdTY0KHNrYiwKKyAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fUkVTVUxUU19TQ0FOX1JFU1VMVF9USU1FX1NUQU1QLAorICAgICAgICAgICAgcERhdGEtPmFwLnRzKSB8fAorICAgICAgICBubGFfcHV0KHNrYiwgUUNBX1dMQU5fVkVORE9SX0FUVFJfRVhUU0NBTl9SRVNVTFRTX1NDQU5fUkVTVUxUX1NTSUQsCisgICAgICAgICAgICBzaXplb2YocERhdGEtPmFwLnNzaWQpLAorICAgICAgICAgICAgcERhdGEtPmFwLnNzaWQpIHx8CisgICAgICAgIG5sYV9wdXQoc2tiLCBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWF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VBBQklMSVRZLAorICAgICAgICAgICAgcERhdGEtPmFwLmNhcGFiaWxpdHkpIHx8CisgICAgICAgIG5sYV9wdXRfdTMyKHNrYiwKKyAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1JFU1VMVFNfU0NBTl9SRVNVTFRfSUVfTEVOR1RILAorICAgICAgICAgICAgcERhdGEtPmllTGVuZ3RoKSkKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJubGEgcHV0IGZhaWwiKSk7CisgICAgICAgIGdvdG8gbmxhX3B1dF9mYWlsdXJlOworICAgIH0KKyAgICBpZiAobmxhX3B1dChza2IsIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fUkVTVUxUU19TQ0FOX1JFU1VMVF9JRV9EQVRBLAorICAgICAgICAgICAgICAgIHBEYXRhLT5pZUxlbmd0aCwKKyAgICAgICAgICAgICAgICBwRGF0YS0+aWUpKQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoIm5sYSBwdXQgZmFpbCIpKTsKKyAgICAgICAgZ290byBubGFfcHV0X2ZhaWx1cmU7CisgICAgfQorCisgICAgY2ZnODAyMTFfdmVuZG9yX2V2ZW50KHNrYiwgR0ZQX0tFUk5FTCk7CisgICAgRVhJVCgpOworICAgIHJldHVybjsKKworbmxhX3B1dF9mYWlsdXJlOgorICAgIGtmcmVlX3NrYihza2IpOworICAgIHJldHVybjsKK30KKworc3RhdGljIHZvaWQgd2xhbl9oZGRfY2ZnODAyMTFfZXh0c2Nhbl9zY2FuX3Jlc19hdmFpbGFibGVfZXZlbnQodm9pZCAqY3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnBNc2cpCit7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCAgPSAoaGRkX2NvbnRleHRfdCAqKWN0eDsKKyAgICBzdHJ1Y3Qgc2tfYnVmZiAqc2tiICAgICA9IE5VTEw7CisgICAgdHBTaXJFWFRTY2FuUmVzdWx0c0F2YWlsYWJsZUluZFBhcmFtcyBwRGF0YSA9CisgICAgICAgICAgICAgICAgICAgICh0cFNpckVYVFNjYW5SZXN1bHRzQXZhaWxhYmxlSW5kUGFyYW1zKSBwTXNnOworCisgICAgRU5URVIoKTsKKworICAgIGlmICh3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpKXsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBpZiAoIXBNc2cpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgicE1zZyBpcyBudWxsIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgc2tiID0gY2ZnODAyMTFfdmVuZG9yX2V2ZW50X2FsbG9jKHBIZGRDdHgtPndpcGh5LAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywgMTgsIDApKQorICAgICAgICAgICAgICAgIE5VTEwsCisjZW5kaWYKKyAgICAgICAgICAgICAgICBFWFRTQ0FOX0VWRU5UX0JVRl9TSVpFICsgTkxNU0dfSERSTEVOLAorICAgICAgICAgICAgICAgIFFDQV9OTDgwMjExX1ZFTkRPUl9TVUJDTURfRVhUU0NBTl9TQ0FOX1JFU1VMVFNfQVZBSUxBQkxFX0lOREVYLAorICAgICAgICAgICAgICAgIEdGUF9LRVJORUwpOworCisgICAgaWYgKCFza2IpIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIEZMKCJjZmc4MDIxMV92ZW5kb3JfZXZlbnRfYWxsb2MgZmFpbGVkIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCBGTCgiRW50ZXJpbmcgIikpOworICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIlJlcSBJZCAoJXUpIiwgcERhdGEtPnJlcXVlc3RJZCk7CisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiTnVtIHJlc3VsdHMgKCV1KSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERhdGEtPm51bVJlc3VsdHNBdmFpbGFibGUpOworICAgIGlmIChubGFfcHV0X3UzMihza2IsIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fUkVTVUxUU19SRVFVRVNUX0lELAorICAgICAgICAgICAgICAgICAgICBwRGF0YS0+cmVxdWVzdElkKSB8fAorICAgICAgICBubGFfcHV0X3UzMihza2IsCisgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fUkVTVUxUU19OVU1fUkVTVUxUU19BVkFJTEFCTEUsCisgICAgICAgICAgICAgICAgICAgIHBEYXRhLT5udW1SZXN1bHRzQXZhaWxhYmxlKSkgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgibmxhIHB1dCBmYWlsIikpOworICAgICAgICBnb3RvIG5sYV9wdXRfZmFpbHVyZTsKKyAgICB9CisKKyAgICBjZmc4MDIxMV92ZW5kb3JfZXZlbnQoc2tiLCBHRlBfS0VSTkVMKTsKKyAgICBFWElUKCk7CisgICAgcmV0dXJuOworCitubGFfcHV0X2ZhaWx1cmU6CisgICAga2ZyZWVfc2tiKHNrYik7CisgICAgcmV0dXJuOworfQorCitzdGF0aWMgdm9pZCB3bGFuX2hkZF9jZmc4MDIxMV9leHRzY2FuX3NjYW5fcHJvZ3Jlc3NfZXZlbnQodm9pZCAqY3R4LCB2b2lkICpwTXNnKQoreworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggID0gKGhkZF9jb250ZXh0X3QgKiljdHg7CisgICAgc3RydWN0IHNrX2J1ZmYgKnNrYiAgICAgPSBOVUxMOworICAgIHRwU2lyRVhUU2NhblByb2dyZXNzSW5kUGFyYW1zIHBEYXRhID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRwU2lyRVhUU2NhblByb2dyZXNzSW5kUGFyYW1zKSBwTXNnOworCisgICAgRU5URVIoKTsKKworICAgIGlmICh3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpKXsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBpZiAoIXBNc2cpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgicE1zZyBpcyBudWxsIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgc2tiID0gY2ZnODAyMTFfdmVuZG9yX2V2ZW50X2FsbG9jKHBIZGRDdHgtPndpcGh5LAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywgMTgsIDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBFWFRTQ0FOX0VWRU5UX0JVRl9TSVpFICsgTkxNU0dfSERSTEVOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFFDQV9OTDgwMjExX1ZFTkRPUl9TVUJDTURfRVhUU0NBTl9TQ0FOX0VWRU5UX0lOREVYLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdGUF9LRVJORUwpOworCisgICAgaWYgKCFza2IpIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIEZMKCJjZmc4MDIxMV92ZW5kb3JfZXZlbnRfYWxsb2MgZmFpbGVkIikpOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIGhkZExvZyhWT1NfVFJBQ0V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7CisgICAgfQorICAgIEVYSVQoKTsKK30KKworc3RhdGljIGludCBfX3dsYW5faGRkX2NmZzgwMjExX2V4dHNjYW5fZ2V0X2NhcGFiaWxpdGllcyhzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgd2lyZWxlc3NfZGV2ICp3ZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2b2lkICpkYXRhLCBpbnQgZGF0YUxlbikKK3sKKyAgICB0U2lyR2V0RVhUU2NhbkNhcGFiaWxpdGllc1JlcVBhcmFtcyByZXFNc2c7CisgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiAgICAgICAgICAgICAgICAgICAgID0gd2Rldi0+bmV0ZGV2OworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyICAgICAgICAgICAgICAgICAgICA9IFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggICAgICAgICAgICAgICAgICAgICA9IHdpcGh5X3ByaXYod2lwaHkpOworICAgIHN0cnVjdCBubGF0dHIKKyAgICAgICAgKnRiW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fU1VCQ01EX0NPTkZJR19QQVJBTV9NQVggKyAxXTsKKyAgICBlSGFsU3RhdHVzIHN0YXR1czsKKworICAgIEVOVEVSKCk7CisKKyAgICBzdGF0dXMgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHN0YXR1cykKKyAgICB7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICAvKiBjaGVjayB0aGUgRVhUU2NhbiBDYXBhYmlsaXR5ICovCisgICAgaWYgKCAoVFJVRSAhPSBwSGRkQ3R4LT5jZmdfaW5pL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gICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCBGTCgiUmVxIElkICglZCkiKSwgcmVxTXNnLnJlcXVlc3RJZCk7CisKKyAgICByZXFNc2cuc2Vzc2lvbklkID0gcEFkYXB0ZXItPnNlc3Npb25JZDsKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sIEZMKCJTZXNzaW9uIElkICglZCkiKSwgcmVxTXNnLnNlc3Npb25JZCk7CisKKyAgICBzdGF0dXMgPSBzbWVfRVhUU2NhbkdldENhcGFiaWxpdGllcyhwSGRkQ3R4LT5oSGFsLCAmcmVxTXNnKTsKKyAgICBpZiAoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKSB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICBGTCgic21lX0VYVFNjYW5HZXRDYXBhYmlsaXRpZXMgZmFpbGVkKGVycj0lZCkiKSwgc3RhdHVzKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIEVYSVQoKTsKKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV9leHRzY2FuX2dldF9jYXBhYmlsaXRpZXMoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXJlbGVzc19kZXYgKndkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsIGludCBkYXRhTGVuKQoreworICAgaW50IHJldCA9IDA7CisKKyAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICByZXQgPSBfX3dsYW5faGRkX2NmZzgwMjExX2V4dHNjYW5fZ2V0X2NhcGFiaWxpdGllcyh3aXBoeSwgd2RldiwgZGF0YSwgZGF0YUxlbik7CisgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQgX193bGFuX2hkZF9jZmc4MDIxMV9leHRzY2FuX2dldF9jYWNoZWRfcmVzdWx0cyhzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHdpcmVsZXNzX2RldiAqd2RldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsIGludCBkYXRhTGVuKQoreworICAgIHRTaXJFWFRTY2FuR2V0Q2FjaGVkUmVzdWx0c1JlcVBhcmFtcyByZXFNc2c7CisgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiAgICAgICAgICAgICAgICAgICAgICA9IHdkZXYtPm5ldGRldjsKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciAgICAgICAgICAgICAgICAgICAgID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCAgICAgICAgICAgICAgICAgICAgICA9IHdpcGh5X3ByaXYod2lwaHkpOworICAgIHN0cnVjdCBubGF0dHIKKyAgICAgICAgICAgICp0YltRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1NVQkNNRF9DT05GSUdfUEFSQU1fTUFYICsgMV07CisgICAgZUhhbFN0YXR1cyBzdGF0dXM7CisKKyAgICBFTlRFUigpOworCisgICAgc3RhdHVzID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSBzdGF0dXMpCisgICAgeworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgLyogY2hlY2sgdGhlIEVYVFNjYW4gQ2FwYWJpbGl0eSAqLwor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N1bHRzIGZhaWxlZChlcnI9JWQpIiksIHN0YXR1cyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBFWElUKCk7CisgICAgcmV0dXJuIDA7CisKK2ZhaWxlZDoKKyAgICByZXR1cm4gLUVJTlZBTDsKK30KK3N0YXRpYyBpbnQgd2xhbl9oZGRfY2ZnODAyMTFfZXh0c2Nhbl9nZXRfY2FjaGVkX3Jlc3VsdHMoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXJlbGVzc19kZXYgKndkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2b2lkICpkYXRhLCBpbnQgZGF0YUxlbikKK3sKKyAgIGludCByZXQgPSAwOworCisgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgcmV0ID0gX193bGFuX2hkZF9jZmc4MDIxMV9leHRzY2FuX2dldF9jYWNoZWRfcmVzdWx0cyh3aXBoeSwgd2RldiwgZGF0YSwgZGF0YUxlbik7CisgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQgX193bGFuX2hkZF9jZmc4MDIxMV9leHRzY2FuX3NldF9ic3NpZF9ob3RsaXN0KHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHdpcmVsZXNzX2RldiAqd2RldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2b2lkICpkYXRhLCBpbnQgZGF0YUxlbikKK3sKKyAgICB0cFNpckVYVFNjYW5TZXRCc3NpZEhvdExpc3RSZXFQYXJhbXMgcFJlcU1zZyA9IE5VTEw7CisgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiAgICAgICAgICAgICAgICAgICAgID0gd2Rldi0+bmV0ZGV2OworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyICAgICAgICAgICAgICAgICAgICA9IFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggICAgICAgICAgICAgICAgICAgICA9IHdpcGh5X3ByaXYod2lwaHkpOworICAgIHN0cnVjdCBubGF0dHIKKyAgICAgICAgICAgICp0YltRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1NVQkNNRF9DT05GSUdfUEFSQU1fTUFYICsgMV07CisgICAgc3RydWN0IG5sYXR0cgorICAgICAgICAgICAgKnRiMltRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1NVQkNNRF9DT05GSUdfUEFSQU1fTUFYICsgMV07CisgICAgc3RydWN0IG5sYXR0ciAqYXBUaDsKKyAgICBlSGFsU3RhdHVzIHN0YXR1czsKKyAgICB0QU5JX1U4IGkgPSAwOworICAgIGludCByZW07CisKKyAgICBFTlRFUigpOworCisgICAgc3RhdHVzID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSBzdGF0dXMpCisgICAgeworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgLyogY2hlY2sgdGhlIEVYVFNjYW4gQ2FwYWJpbGl0eSAqLworICAgIGlmICggKFRSVUUgIT0gcEhkZEN0eC0+Y2ZnX2luaS0+ZkVuYWJsZUVYVFNjYW4pIHx8CisgICAgICAgICAoVFJVRSAhPSBzbWVfSXNGZWF0dXJlU3VwcG9ydGVkQnlGVyhFWFRFTkRFRF9TQ0FOKSkpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgRkwoIkVYVFNjYW4gbm90IGVuYWJsZWQvc3VwcG9ydGVkIGJ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FRSX0VYVFNDQU5fU1VCQ01EX0NPTkZJR19QQVJBTV9NQVgsCisgICAgICAgICAgICAgICAgbmxhX2RhdGEoYXBUaCksIG5sYV9sZW4oYXBUaCksCisgICAgICAgICAgICAgICAgTlVMTCkpIHsKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJubGFfcGFyc2UgZmFpbGVkIikpOworICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICB9CisKKyAgICAgICAgLyogUGFyc2UgYW5kIGZldGNoIE1BQyBhZGRyZXNzICovCisgICAgICAgIGlmICghdGIyW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fQVBfVEhSRVNIT0xEX1BBUkFNX0JTU0lEXSkgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoImF0dHIgbWFjIGFkZHJlc3MgZmFpbGVkIikpOworICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICB9CisgICAgICAgIG1lbWNweShwUmVxTXNnLT5hcFtpXS5ic3NpZCwgbmxhX2RhdGEoCisgICAgICAgICAgICAgICAgdGIyW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fQVBfVEhSRVNIT0xEX1BBUkFNX0JTU0lEXSksCisgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgRkwoIkJTU0lEOiAlcE0gIiksIHBSZXFNc2ctPmFwW2ldLmJzc2lkKTsKKworICAgICAgICAvKiBQYXJzZSBhbmQgZmV0Y2ggbG93IFJTU0kgKi8KKyAgICAgICAgaWYgKCF0YjJbUUNBX1dMQU5fVkVORE9SX0FUVFJfRVhUU0NBTl9BUF9USFJFU0hPTERfUEFSQU1fUlNTSV9MT1ddKSB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX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CB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHdpcmVsZXNzX2RldiAqd2RldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2b2lkICpkYXRhLCBpbnQgZGF0YUxlbikKK3sKKyAgIGludCByZXQgPSAwOworCisgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgcmV0ID0gX193bGFuX2hkZF9jZmc4MDIxMV9leHRzY2FuX3NldF9ic3NpZF9ob3RsaXN0KHdpcGh5LCB3ZGV2LCBkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFMZW4pOworICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IF9fd2xhbl9oZGRfY2ZnODAyMTFfZXh0c2Nhbl9zZXRfc2lnbmlmaWNhbnRfY2hhbmdlKHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHdpcmVsZXNzX2RldiAqd2RldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2b2lkICpkYXRhLCBpbnQgZGF0YUxlbikKK3sKKyAgICB0cFNpckVYVFNjYW5TZXRTaWduaWZpY2FudENoYW5nZVJlcVBhcmFtcyBwUmVxTXNnID0gTlVMTDsKKyAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ICAgICAgICAgICAgICAgICAgPSB3ZGV2LT5uZXRkZXY7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgICAgICAgICAgICAgICAgID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCAgICAgICAgICAgICAgICAgID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CwgcFJlcU1zZyk7CisgICAgaWYgKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgRkwoInNtZV9TZXRTaWduaWZpY2FudENoYW5nZSBmYWlsZWQoZXJyPSVkKSIpLCBzdGF0dXMpOworICAgICAgICB2b3NfbWVtX2ZyZWUocFJlcU1zZyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICB2b3NfbWVtX2ZyZWUocFJlcU1zZyk7CisgICAgRVhJVCgpOworICAgIHJldHVybiAwOworCitmYWlsOgorICAgIHZvc19tZW1fZnJlZShwUmVxTXNnKTsKKyAgICByZXR1cm4gLUVJTlZBTDsKK30KKworc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV9leHRzY2FuX3NldF9zaWduaWZpY2FudF9jaGFuZ2Uoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgd2lyZWxlc3NfZGV2ICp3ZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsIGludCBkYXRhTGVuKQoreworICAgIGludCByZXQgPSAwOworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX3dsYW5faGRkX2NmZzgwMjExX2V4dHNjYW5fc2V0X3NpZ25pZmljYW50X2NoYW5nZSh3aXBoeSwgd2RldiwgZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhTGVuKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IF9fd2xhbl9oZGRfY2ZnODAyMTFfZXh0c2Nhbl9nZXRfdmFsaWRfY2hhbm5lbHMoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgd2lyZWxlc3NfZGV2ICp3ZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsIGludCBkYXRhTGVuKQoreworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSB3aXBoeV9wcml2KHdpcGh5KTsKKyAgICB0QU5JX1UzMiBDaGFubmVsTGlzdFtXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU5dID0gezB9OworICAgIHRBTklfVTggbnVtQ2hhbm5lbHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSAwOworICAgIHN0cnVjdCBubGF0dHIgKnRiW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fU1VCQ01EX0NPTkZJR19QQVJBTV9NQVggKyAxXTsKKyAgICB0QU5JX1UzMiByZXF1ZXN0SWQ7CisgICAgdFdpZmlCYW5kIHdpZmlCYW5kOworICAgIGVIYWxTdGF0dXMgc3RhdHVzOworICAgIHN0cnVjdCBza19idWZmICpyZXBseVNrYjsKKyAgICB0QU5JX1U4IGk7CisgICAgaW50IHJldDsKKworICAgIEVOVEVSKCk7CisKKyAgICBzdGF0dXMgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHN0YXR1cykKKyAgICB7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIGlmIChubGFfcGFyc2UodGIsIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fU1VCQ01EX0NPTkZJR19QQVJBTV9NQVgsCisgICAgICAgICAgICAgICAgICBkYXRhLCBkYXRh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lbHMgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5MTVNHX0hEUkxFTik7CisKKyAgICBpZiAoIXJlcGx5U2tiKSB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgRkwoInZhbGlkIGNoYW5uZWxzOiBidWZmZXIgYWxsb2MgZmFpbCIpKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIGlmIChubGFfcHV0X3UzMihyZXBseVNrYiwKKyAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1JFU1VMVFNfTlVNX0NIQU5ORUxTLAorICAgICAgICAgICAgICAgIG51bUNoYW5uZWxzKSB8fAorICAgICAgICAgICAgbmxhX3B1dChyZXBseVNrYiwgUUNBX1dMQU5fVkVORE9SX0FUVFJfRVhUU0NBTl9SRVNVTFRTX0NIQU5ORUxTLAorICAgICAgICAgICAgICAgIHNpemVvZih1MzIpICogbnVtQ2hhbm5lbHMsIENoYW5uZWxMaXN0KSkgeworCisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJubGEgcHV0IGZhaWwiKSk7CisgICAgICAgIGtmcmVlX3NrYihyZXBseVNrYik7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIHJldCA9IGNmZzgwMjExX3ZlbmRvcl9jbWRfcmVwbHkocmVwbHlTa2IpOworCisgICAgRVhJVCgpOworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQgd2xhbl9oZGRfY2ZnODAyMTFfZXh0c2Nhbl9nZXRfdmFsaWRfY2hhbm5lbHMoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgd2lyZWxlc3NfZGV2ICp3ZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsIGludCBkYXRhTGVuKQoreworICAgIGludCByZXQgPSAwOworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX3dsYW5faGRkX2NmZzgwMjExX2V4dHNjYW5fZ2V0X3ZhbGlkX2NoYW5uZWxzKHdpcGh5LCB3ZGV2LCBkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YUxlbik7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBfX3dsYW5faGRkX2NmZzgwMjExX2V4dHNjYW5fc3RhcnQoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgd2lyZWxlc3NfZGV2ICp3ZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsIGludCBkYXRhTGVuKQoreworICAgIHRwU2lyRVhUU2NhblN0YXJ0UmVxUGFyYW1zIHBSZXFNc2cgPSBOVUxMOworICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgICAgICAgICAgICAgICAgICA9IHdkZXYtPm5ldGRldjsKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciAgICAgICAgICAgICAgICAgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ICAgICAgICAgICAgICAgICAgPSB3aXBoeV9wcml2KHdpcGh5KTsKKyAgICBzdHJ1Y3QgbmxhdHRyICp0YltRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1NVQkNNRF9DT05GSUdfUEFSQU1fTU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gICAgICAgICAgICAgICAgdGJbUUNBX1dMQU5fVkVORE9SX0FUVFJfRVhUU0NBTl9CVUNLRVRfU1BFQ10sIHJlbTEpIHsKKyAgICAgICAgaWYobmxhX3BhcnNlKGJ1Y2tldCwKKyAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fU1VCQ01EX0NPTkZJR19QQVJBTV9NQVgsCisgICAgICAgICAgICBubGFfZGF0YShidWNrZXRzKSwgbmxhX2xlbihidWNrZXRzKSwgTlVMTCkpIHsgLy9wb2xpY3kKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJubGFfcGFyc2UgZmFpbGVkIikpOworICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICB9CisKKyAgICAgICAgLyogUGFyc2UgYW5kIGZldGNoIGJ1Y2tldCBzcGVjICovCisgICAgICAgIGlmICghYnVja2V0W1FDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fQlVDS0VUX1NQRUNfSU5ERVhdKSB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgiYXR0ciBidWNrZXQgaW5kZXggZmFpbGVkIikpOworICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICB9CisKKyAgICAgICAgcFJlcU1zZy0+YnVja2V0c1tpbmRleF0uYnVja2V0ID0gbmxhX2dldF91OCgKKyAgICAgICAgICAgICAgICBidWNrZXRbUUNBX1dMQU5fVkVORE9SX0FUVFJfRVhUU0NBTl9CVUNLRVRfU1BFQ19JTkRFWF0pOworCisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgRkwoIkJ1Y2tldCBzcGVjIEluZGV4ICglZCkiKSwKKyAgICAgICAgICAgICAgICBwUmVxTXNnLT5idWNrZXRzW2luZGV4XS5idWNrZXQpOworCisgICAgICAgIC8qIFBhcnNlIGFuZCBmZXRjaCB3aWZ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CgiQ2hubCBzcGVjIHBhc3NpdmUgKCV1KSIpLAorICAgICAgICAgICAgICAgICAgICAgcFJlcU1zZy0+YnVja2V0c1tpbmRleF0uY2hhbm5lbHNbal0ucGFzc2l2ZSk7CisgICAgICAgICAgICBqKys7CisgICAgICAgIH0KKyAgICAgICAgaW5kZXgrKzsKKyAgICB9CisgICAgc3RhdHVzID0gc21lX0VYVFNjYW5TdGFydChwSGRkQ3R4LT5oSGFsLCBwUmVxTXNnKTsKKyAgICBpZiAoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKSB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICBGTCgic21lX0VYVFNjYW5TdGFydCBmYWlsZWQoZXJyPSVkKSIpLCBzdGF0dXMpOworICAgICAgICB2b3NfbWVtX2ZyZWUocFJlcU1zZyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIHZvc19tZW1fZnJlZShwUmVxTXNnKTsKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIDA7CisKK2ZhaWw6CisgICAgdm9zX21lbV9mcmVlKHBSZXFNc2cpOworICAgIHJldHVybiAtRUlOVkFMOworfQorCitzdGF0aWMgaW50IHdsYW5faGRkX2NmZzgwMjExX2V4dHNjYW5fc3RhcnQoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgd2lyZWxlc3NfZGV2ICp3ZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsIGludCBkYXRhTGVuKQoreworICAgaW50IHJldCA9IDA7CisKKyAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICByZXQgPSBfX3dsYW5faGRkX2NmZzgwMjExX2V4dHNjYW5fc3RhcnQod2lwaHksIHdkZXYsIGRhdGEsIGRhdGFMZW4pOworICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IF9fd2xhbl9oZGRfY2ZnODAyMTFfZXh0c2Nhbl9zdG9wKHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHdpcmVsZXNzX2RldiAqd2RldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2b2lkICpkYXRhLCBpbnQgZGF0YUxlbikKK3sKKyAgICB0U2lyRVhUU2NhblN0b3BSZXFQYXJhbXMgcmVxTXNnOworICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgICAgICAgICAgICAgICAgICA9IHdkZXYtPm5ldGRldjsKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciAgICAgICAgICAgICAgICAgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ICAgICAgICAgICAgICAgICAgPSB3aXBoeV9wcml2KHdpcGh5KTsKKyAgICBzdHJ1Y3QgbmxhdHRyICp0YltRQ0FfV0xBTl9WRU5ET1JfQVRUUl9FWFRTQ0FOX1NVQkNNRF9DT05GSUdfUEFSQU1fTUFYICsgMV07CisgICAgZUhhbFN0YXR1cyBzdGF0dXM7CisKKyAgICBFTlRFUigpOworCisgICAgc3RhdHVzID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSBzdGF0dXMpCisgICAgeworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgLyogY2hlY2sgdGhlIEVYVFNjYW4gQ2FwYWJpbGl0eSAqLworICAgIGlmICggKFRSVUUgIT0gcEhkZEN0eC0+Y2ZnX2luaS0+ZkVuYWJsZUVYVFNjYW4pIHx8Cis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YW5faGRkX2NmZzgwMjExX2V4dHNjYW5fcmVzZXRfYnNzaWRfaG90bGlzdChzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXJlbGVzc19kZXYgKndkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgdm9pZCAqZGF0YSwgaW50IGRhdGFMZW4pCit7CisgICAgdFNpckVYVFNjYW5SZXNldEJzc2lkSG90bGlzdFJlcVBhcmFtcyByZXFNc2c7CisgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiAgICAgICAgICAgICAgICAgICAgICAgPSB3ZGV2LT5uZXRkZXY7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgICAgICAgICAgICAgICAgICAgICAgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ICAgICAgICAgICAgICAgICAgICAgICA9IHdpcGh5X3ByaXYod2lwaHkpOworICAgIHN0cnVjdCBubGF0dHIgKnRiW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fU1VCQ01EX0NPTkZJR19QQVJBTV9NQVggKyAxXTsKKyAgICBlSGFsU3RhdHVzIHN0YXR1czsKKworICAgIEVOVEVSKCk7CisKKyAgICBzdGF0dXMgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHN0YXR1cykKKyAgICB7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICAvKiBjaGVjayB0aGUgRVhUU2NhbiBDYXBhYmlsaXR5ICovCisgICAgaWYgKCAoVFJVRSAhPSBwSGRkQ3R4LT5jZmdfaW5pLT5mRW5hYmxlRVhUU2NhbikgfHwKKyAgICAgICAgIChUUlVFICE9IHNtZV9Jc0ZlYXR1cmVTdXBwb3J0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5yZXF1ZXN0SWQpOworCisgICAgcmVxTXNnLnNlc3Npb25JZCA9IHBBZGFwdGVyLT5zZXNzaW9uSWQ7CisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCBGTCgiU2Vzc2lvbiBJZCAoJWQpIiksIHJlcU1zZy5zZXNzaW9uSWQpOworCisgICAgc3RhdHVzID0gc21lX1Jlc2V0QnNzSG90bGlzdChwSGRkQ3R4LT5oSGFsLCAmcmVxTXNnKTsKKyAgICBpZiAoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKSB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJzbWVfUmVzZXRCc3NIb3RsaXN0IGZhaWxlZChlcnI9JWQpIiksIHN0YXR1cyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBFWElUKCk7CisgICAgcmV0dXJuIDA7Cit9CisKK3N0YXRpYyBpbnQgd2xhbl9oZGRfY2ZnODAyMTFfZXh0c2Nhbl9yZXNldF9ic3NpZF9ob3RsaXN0KHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHdpcmVsZXNzX2RldiAqd2RldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2b2lkICpkYXRhLCBpbnQgZGF0YUxlbikKK3sKKyAgIGludCByZXQgPSAwOworCisgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgcmV0ID0gX193bGFuX2hkZF9jZmc4MDIxMV9leHRzY2FuX3Jlc2V0X2Jzc2lkX2hvdGxpc3Qod2lwaHksIHdkZXYsIGRhdGEsIGRhdGFMZW4pOworICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IF9fd2xhbl9oZGRfY2ZnODAyMTFfZXh0c2Nhbl9yZXNldF9zaWduaWZpY2FudF9jaGFuZ2UoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgd2lyZWxlc3NfZGV2ICp3ZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsIGludCBkYXRhTGVuKQoreworICAgIHRTaXJFWFRTY2FuUmVzZXRTaWduaWZpY2FudENoYW5nZVJlcVBhcmFtcyByZXFNc2c7CisgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiAgICAgICAgICAgICAgICAgICAgICAgPSB3ZGV2LT5uZXRkZXY7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgICAgICAgICAgICAgICAgICAgICAgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ICAgICAgICAgICAgICAgICAgICAgICA9IHdpcGh5X3ByaXYod2lwaHkpOworICAgIHN0cnVjdCBubGF0dHIgKnRiW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX0VYVFNDQU5fU1VCQ01EX0NPTkZJR19QQVJBTV9NQVggKyAxXTsKKyAgICBlSGFsU3RhdHVzIHN0YXR1czsKKworICAgIEVOVEVSKCk7CisKKyAgICBzdGF0dXMgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHN0YXR1cykKKyAgICB7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICAvKiBjaGVjayB0aGUgRVhUU2NhbiBDYXBhYmlsaXR5ICovCisgICAgaWYgKCAoVFJVRSAhPSBwSGRkQ3R4LT5jZmdfaW5pLT5mRW5hYmx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9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCBGTCgiUmVxIElkICglZCkiKSwgcmVxTXNnLnJlcXVlc3RJZCk7CisKKyAgICByZXFNc2cuc2Vzc2lvbklkID0gcEFkYXB0ZXItPnNlc3Npb25JZDsKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sIEZMKCJTZXNzaW9uIElkICglZCkiKSwgcmVxTXNnLnNlc3Npb25JZCk7CisKKyAgICBzdGF0dXMgPSBzbWVfUmVzZXRTaWduaWZpY2FudENoYW5nZShwSGRkQ3R4LT5oSGFsLCAmcmVxTXNnKTsKKyAgICBpZiAoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKSB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgRkwoInNtZV9SZXNldFNpZ25pZmljYW50Q2hhbmdlIGZhaWxlZChlcnI9JWQpIiksIHN0YXR1cyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV9leHRzY2FuX3Jlc2V0X3NpZ25pZmljYW50X2NoYW5nZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXJlbGVzc19kZXYgKndkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgdm9pZCAqZGF0YSwgaW50IGRhdGFMZW4pCit7CisgICBpbnQgcmV0ID0gMDsKKworICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgIHJldCA9IF9fd2xhbl9oZGRfY2ZnODAyMTFfZXh0c2Nhbl9yZXNldF9zaWduaWZpY2FudF9jaGFuZ2Uod2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkZXYsIGRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFMZW4pOworICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICByZXR1cm4gcmV0OworfQorI2VuZGlmIC8qIFdMQU5fRkVBVFVSRV9FWFRTQ0FOICovCisKKy8qRVhUIFRETFMqLworc3RhdGljIGNvbnN0IHN0cnVjdCBubGFfcG9saWN5Cit3bGFuX2hkZF90ZGxzX2NvbmZpZ19lbmFibGVfcG9saWN5W1FDQV9XTEFOX1ZFTkRPUl9BVFRSX1RETFNfRU5BQkxFX01BWCArMV0gPQoreworICAgIFtRQ0FfV0xBTl9WRU5ET1JfQVRUUl9URExTX0VOQUJMRV9NQUNfQUREUl0gPSB7LnR5cGUgPSBOTEFfVU5TUEVDIH0sCisgICAgW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX1RETFNfRU5BQkxFX0NIQU5ORUxdID0gey50eXBlID0gTkxBX1MzMiB9LAorICAgIFtRQ0FfV0xBTl9WRU5ET1JfQVRUUl9URExTX0VOQUJMRV9HTE9CQUxfT1BFUkFUSU5HX0NMQVNTXSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgey50eXBlID0gTkxBX1MzMiB9LAorICAgIFtRQ0FfV0xBTl9WRU5ET1JfQVRUUl9URExTX0VOQUJMRV9NQVhfTEFURU5DWV9NU10gPSB7LnR5cGUgPSBOTEFfUzMyIH0sCisgICAgW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX1RETFNfRU5BQkxFX01JTl9CQU5EV0lEVEhfS0JQU10gPSB7LnR5cGUgPSBOTEFfUzMyIH0sCisKK307CisKK3N0YXRpYyBjb25zdCBzdHJ1Y3Qg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Moc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXJlbGVzc19kZXYgKndkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2b2lkICpkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGRhdGFfbGVuKQoreworICAgIHU4IHBlZXJbNl0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IHswfTsKKyAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ICAgICAgICAgICAgICAgICAgICAgPSB3ZGV2LT5uZXRkZXY7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgICAgICAgICAgICAgICAgICAgID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCAgICAgICAgICAgICAgICAgICAgID0gd2lwaHlfcHJpdih3aXBoeSk7CisgICAgc3RydWN0IG5sYXR0ciAqdGJbUUNBX1dMQU5fVkVORE9SX0FUVFJfVERMU19HRVRfU1RBVFVTX01BWCArIDFdOworICAgIGVIYWxTdGF0dXMgcmV0OworICAgIHRBTklfUzMyIHN0YXRlOworICAgIHRBTklfUzMyIHJlYXNvbjsKKyAgICB0QU5JX1MzMiBnbG9iYWxfb3BlcmF0aW5nX2NsYXNzID0gMDsKKyAgICB0QU5JX1MzMiBjaGFubmVsID0gMDsKKyAgICBzdHJ1Y3Qgc2tfYnVmZiAqc2tiICAgICAgICAgPSBOVUxMOworICAgIGludCByZXRWYWw7CisKKyAgICBFTlRFUigpOworCisgICAgaWYgKCFwQWRhcHRlcikgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgiSEREIGFkcGF0ZXIgaXMgTlVMTCIpKTsKKyAgICAgICAgcmV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W1jcHkocGVlciwgbmxhX2RhdGEoCisgICAgICAgICAgIHRiW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX1RETFNfR0VUX1NUQVRVU19NQUNfQUREUl0pLAorICAgICAgICAgICBzaXplb2YocGVlcikpOworICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgRkwoTUFDX0FERFJFU1NfU1RSKSxNQUNfQUREUl9BUlJBWShwZWVyKSk7CisKKyAgICB3bGFuX2hkZF90ZGxzX2dldF9zdGF0dXMocEFkYXB0ZXIsIHBlZXIsICZzdGF0ZSwgJnJlYXNvbik7CisKKyAgICBza2IgPSBjZmc4MDIxMV92ZW5kb3JfY21kX2FsbG9jX3JlcGx5X3NrYih3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0ICogc2l6ZW9mKHMzMikgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5MTVNHX0hEUkxFTik7CisKKyAgICBpZiAoIXNrYikgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgRkwoImNmZzgwMjExX3ZlbmRvcl9jbWRfYWxsb2NfcmVwbHlfc2tiIGZhaWxlZCIpKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgRkwoIlJlYXNvbiAoJWQpIFN0YXR1cyAoJWQpIGNsYXNzICglZCkgY2hhbm5lbCAoJWQpIHBlZXIiIE1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWFzb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdsb2JhbF9vcGVyYXRpbmdfY2xhc3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocGVlcikpOworICAgIGlmIChubGFfcHV0X3MzMihza2IsCisgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX1RETFNfR0VUX1NUQVRVU19TVEFURSwKKyAgICAgICAgICAgICAgICAgICAgc3RhdGUpIHx8CisgICAgICAgIG5sYV9wdXRfczMyKHNrYiwKKyAgICAgICAgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfVERMU19HRVRfU1RBVFVTX1JFQVNPTiwKKyAgICAgICAgICAgICAgICAgICAgcmVhc29uKSB8fAorICAgICAgICBubGFfcHV0X3MzMihza2IsCisgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX1RETFNfR0VUX1NUQVRVU19HTE9CQUxfT1BFUkFUSU5HX0NMQVNTLAorICAgICAgICAgICAgICAgICAgICBnbG9iYWxfb3BlcmF0aW5nX2NsYXNzKSB8fAorICAgICAgICBubGFfcHV0X3MzMihza2IsCisgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX1RETFNfR0VUX1NUQVRVU19DSEFOTkVMLAorICAgICAgICAgICAgICAgICAgICBjaGFubmVsKSkgeworCisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJubGEgcHV0IGZhaWwiKSk7CisgICAgICAgIGdvdG8gbmxhX3B1dF9mYWlsdXJlOworICAgIH0KKworICAgIHJldFZhbCA9IGNmZzgwMjExX3ZlbmRvcl9jbWRfcmVwbHkoc2tiKTsKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIHJldFZhbDsKKworbmxhX3B1dF9mYWlsdXJlOgorICAgIGtmcmVlX3NrYihza2IpOworICAgIHJldHVybiAtRUlOVkFMOworfQorCitzdGF0aWMgaW50IHdsYW5faGRkX2NmZzgwMjExX2V4dHRkbHNfZ2V0X3N0YXR1cyhzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHdpcmVsZXNzX2RldiAqd2RldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGF0YV9sZW4pCit7CisgICAgaW50IHJldCA9IDA7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9fd2xhbl9oZGRfY2ZnODAyMTFfZXh0dGRsc19nZXRfc3RhdHVzKHdpcGh5LCB3ZGV2LCBkYXRhLCBkYXRhX2xlbik7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV9leHR0ZGxzX2NhbGxiYWNrKAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0QU5JX1U4KiBtYWMsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTgqIG1hYywKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfUzMyIHN0YXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfUzMyIHJlYXNvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpjdHgpCit7CisgICAgaGRkX2FkYXB0ZXJfdCogcEFkYXB0ZXIgICAgICAgPSAoaGRkX2FkYXB0ZXJfdCopY3R4OworICAgIHN0cnVjdCBza19idWZmICpza2IgICAgICAgICAgID0gTlVMTDsKKyAgICB0QU5JX1MzMiBnbG9iYWxfb3BlcmF0aW5nX2NsYXNzID0gMDsKKyAgICB0QU5JX1MzMiBjaGFubmVsID0gMDsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworCisgICAgRU5URVIoKTsKKworICAgIGlmICghcEFkYXB0ZXIpIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoIkhERCBhZHBhdGVyIGlzIE5VTEwiKSk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICBpZiAod2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KSkgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgiSW52YWxpZCBIREQgY29udGV4dCIpKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgaWYgKHBIZGRDdHgtPmNmZ19pbmktPmZURExTRXh0ZXJuYWxDb250cm9sID09IEZBTFNFKSB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJURExTIGV4dGVybmFsIGNvbnRyb2wgaXMgZGlzYWJsZWQiKSk7CisgICAgICAgIHJldHVybiAtRU5PVFNVUFA7CisgICAgfQorICAgIHNrYiA9IGNmZzgwMjExX3ZlbmRvcl9ldmVudF9hbGxvYyhwSGRkQ3R4LT53aXBoeSwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsIDE4LCAwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRVhUVERMU19FVkVOVF9CVUZfU0laRSArIE5MTVNHX0hEUkxFTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBRQ0FfTkw4MDIxMV9WRU5ET1JfU1VCQ01EX1RETFNfU1RBVEVfQ0hBTkdFX0lOREVYLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdGUF9LRVJORUwpOworCisgICAgaWYgKCFza2IpIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIEZMKCJjZmc4MDIxMV92ZW5kb3JfZXZlbnRfYWxsb2MgZmFpbGVkIikpOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCBGTCgiRW50ZXJpbmcgIikpOworICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIlJlYXNvbjogKCVkKSBTdGF0dXM6ICglZCkgQ2xhc3M6ICglZCkgQ2hhbm5lbDogKCVkKSIsCisgICAgICAgICAgIHJlYXNvbiwKKyAgICAgICAgICAgc3RhdGUsCisgICAgICAgICAgIGdsb2JhbF9vcGVyYXRpbmdfY2xhc3MsCisgICAgICAgICAgIGNoYW5uZWwpOworICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfV0FSTiwgInRkbHMgcGVlciAiIE1BQ19BRERSRVNTX1NUUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKG1hYykpOworCisgICAgaWYgKG5sYV9wdXQoc2tiLAorICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX1RETFNfU1RBVEVfTUFDX0FERFIsCisgICAgICAgICAgICAgICAgVk9TX01BQ19BRERSX1NJWkUsIG1hYykgfHwKKyAgICAgICAgbmxhX3B1dF9zMzIoc2tiLAorICAgICAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9URExTX05FV19TVEFURSwKKyAgICAgICAgICAgICAgICAgICAgc3RhdGUpIHx8CisgICAgICAgIG5sYV9wdXRfczMyKHNrYiwKKyAgICAgICAgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfVERMU19TVEFURV9SRUFTT04sCisgICAgICAgICAgICAgICAgICAgIHJlYXNvbikgfHwKKyAgICAgICAgbmxhX3B1dF9zMzIoc2tiLAorICAgICAgICAgICAgICAgICAgICBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9URExTX1NUQVRFX0NIQU5ORUwsCisgICAgICAgICAgICAgICAgICAgIGNoYW5uZWwpIHx8CisgICAgICAgIG5sYV9wdXRfczMyKHNrYiwKKyAgICAgICAgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfVERMU19TVEFURV9HTE9CQUxfT1BFUkFUSU5HX0NMQVNTLAorICAgICAgICAgICAgICAgICAgICBnbG9iYWxfb3BlcmF0aW5nX2NsYXNzKQorICAgICAgICApIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoIm5sYSBwdXQgZmFpbCIpKTsKKyAgICAgICAgZ290byBubGFfcHV0X2ZhaWx1cmU7CisgICAgfQorCisgICAgY2ZnODAyMTFfdmVuZG9yX2V2ZW50KHNrYiwgR0ZQX0tFUk5FTCk7CisgICAgRVhJVCgpOworICAgIHJldHVybiAoMCk7CisKK25sYV9wdXRfZmFpbHVyZToKKyAgICBrZnJlZV9za2Ioc2tiKTsKKyAgICByZXR1cm4gLUVJTlZBTDsKK30KKworc3RhdGljIGludCBfX3dsYW5faGRkX2NmZzgwMjExX2V4dHRkbHNfZW5hYmxlKHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXJlbGVzc19kZXYgKndkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkYXRhX2xlbikKK3sKKyAgICB1OCBwZWVyWzZdICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSB7MH07CisgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiAgICAgICAgICAgICAgICAgICAgID0gd2Rldi0+bmV0ZGV2OworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggICAgICAgICAgICAgICAgICAgICA9IHdpcGh5X3ByaXYod2lwaHkpOworICAgIHN0cnVjdCBubGF0dHIgKnRiW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX1RETFNfRU5BQkxFX01BWCArIDFdOworICAgIGVIYWxTdGF0dXMgc3RhdHVzOworICAgIHRkbHNfcmVxX3BhcmFtc190ICAgcFJlcU1zZyA9IHswfTsKKyAgICBpbnQgcmV0OworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyOworCisgICAgRU5URVIoKTsKKworICAgIGlmICghZGV2KSB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJEZXYgcG9pbnRlciBpcyBOVUxMIikpOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBwQWRhcHRlciA9IFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgIGlmICghcEFkYXB0ZXIpIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoIkhERCBhZHBhdGVyIGlzIE5VTEwiKSk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIHN0YXR1cyA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gc3RhdHVzKSB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJJbnZhbGlkIEhERCBjb250ZXh0IikpOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgaWYgKHBIZGRDdHgtPmNmZ19pbmktPmZURExTRXh0ZXJuYWxDb250cm9sID09IEZBTFNFKSB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJURExTIGV4dGVybmFsIGNvbnRyb2wgaXMgZGlzYWJsZWQiKSk7CisgICAgICAgIHJldHVybiAtRU5PVFNVUFA7CisgICAgfQorICAgIGlmIChubGFfcGFyc2UodGIsIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX1RETFNfRU5BQkxFX01BWCwKKyAgICAgICAgICAgICAgICAgICAgZGF0YSwgZGF0YV9sZW4sCisgICAgICAgICAgICAgICAgICAgIHdsYW5faGRkX3RkbHNfY29uZmlnX2VuYWJsZV9wb2xpY3kpKSB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJJbnZhbGlkIEFUVFIiKSk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIC8qIFBhcnNlIGFuZCBmZXRjaCBtYWMgYWRkcmVzcyAqLworICAgIGlmICghdGJbUUNBX1dMQU5fVkVORE9SX0FUVFJfVERMU19FTkFCTEVfTUFDX0FERFJdKSB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJhdHRyIG1hYyBhZGRyIGZhaWxlZCIpKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgbWVtY3B5KHBlZXIsIG5sYV9kYXRhKAorICAgICAgICAgICAgICAgIHRiW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX1RETFNfRU5BQkxFX01BQ19BRERSXSksCisgICAgICAgICAgICAgICAgc2l6ZW9mKHBlZXIpKTsKKyAgICBoZGRMb2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FCTEVfTUlOX0JBTkRXSURUSF9LQlBTXSk7CisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCBGTCgiQmFuZHdpZHRoICglZCkiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUmVxTXNnLm1pbl9iYW5kd2lkdGhfa2Jwcyk7CisKKyAgICByZXQgPSB3bGFuX2hkZF90ZGxzX2V4dGN0cmxfY29uZmlnX3BlZXIocEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBSZXFNc2csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF9jZmc4MDIxMV9leHR0ZGxzX2NhbGxiYWNrKTsKKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IHdsYW5faGRkX2NmZzgwMjExX2V4dHRkbHNfZW5hYmxlKHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXJlbGVzc19kZXYgKndkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkYXRhX2xlbikKK3sKKyAgIGludCByZXQgPSAwOworCisgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgcmV0ID0gX193bGFuX2hkZF9jZmc4MDIxMV9leHR0ZGxzX2VuYWJsZSh3aXBoeSwgd2RldiwgZGF0YSwgZGF0YV9sZW4pOworICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IF9fd2xhbl9oZGRfY2ZnODAyMTFfZXh0dGRsc19kaXNhYmxlKHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgd2lyZWxlc3NfZGV2ICp3ZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgdm9pZCAqZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkYXRhX2xlbikKK3sKKyAgICB1OCBwZWVyWzZdICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSB7MH07CisgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiAgICAgICAgICAgICAgICAgICAgID0gd2Rldi0+bmV0ZGV2OworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggICAgICAgICAgICAgICAgICAgICA9IHdpcGh5X3ByaXYod2lwaHkpOworICAgIHN0cnVjdCBubGF0dHIgKnRiW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX1RETFNfRElTQUJMRV9NQVggKyAxXTsKKyAgICBlSGFsU3RhdHVzIHN0YXR1czsKKyAgICBpbnQgcmV0OworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyOworCisgICAgRU5URVIoKTsKKworICAgIGlmICghZGV2KSB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJEZXYgcG9pbnRlciBpcyBOVUxMIikpOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBwQWRhcHRlciA9IFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgIGlmICghcEFkYXB0ZXIpIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoIkhERCBhZGFwdGVyIGlzIE5VTEwiKSk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIHN0YXR1cyA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gc3RhdHVzKSB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJJbnZhbGlkIEhERCBjb250ZXh0IikpOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgaWYgKHBIZGRDdHgtPmNmZ19pbmktPmZURExTRXh0ZXJuYWxDb250cm9sID09IEZBTFNFKSB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJURExTIGV4dGVybmFsIGNvbnRyb2wgaXMgZGlzYWJsZWQiKSk7CisgICAgICAgIHJldHVybiAtRU5PVFNVUFA7CisgICAgfQorICAgIGlmIChubGFfcGFyc2UodGIsIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX1RETFNfRElTQUJMRV9NQVgsCisgICAgICAgICAgICAgICAgICAgIGRhdGEsIGRhdGFfbGVuLAorICAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF90ZGxzX2NvbmZpZ19kaXNhYmxlX3BvbGljeSkpIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoIkludmFsaWQgQVRUUiIpKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIC8qIFBhcnNlIGFuZCBmZXRjaCBtYWMgYWRkcmVzcyAqLworICAgIGlmICghdGJbUUNBX1dMQU5fVkVORE9SX0FUVFJfVERMU19ESVNBQkxFX01BQ19BRERSXSkgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgiYXR0ciBtYWMgYWRkciBmYWlsZWQiKSk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIG1lbWNweShwZWVyLCBubGFfZGF0YSgKKyAgICAgICAgICAgICAgICB0YltRQ0FfV0xBTl9WRU5ET1JfQVRUUl9URExTX0RJU0FCTEVfTUFDX0FERFJdKSwKKyAgICAgICAgICAgICAgICBzaXplb2YocGVlcikpOworICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgRkwoTUFDX0FERFJFU1NfU1RSKSxNQUNfQUREUl9BUlJBWShwZWVyKSk7CisKKyAgICByZXQgPSB3bGFuX2hkZF90ZGxzX2V4dGN0cmxfZGVjb25maWdfcGVlcihwQWRhcHRlciwgcGVlcik7CisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV9leHR0ZGxzX2Rpc2FibGUoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXJlbGVzc19kZXYgKndkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2b2lkICpkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGRhdGFfbGVuKQoreworICAgaW50IHJldCA9IDA7CisKKyAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICByZXQgPSBfX3dsYW5faGRkX2NmZzgwMjExX2V4dHRkbHNfZGlzYWJsZSh3aXBoeSwgd2RldiwgZGF0YSwgZGF0YV9sZW4pOworICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50CitfX3dsYW5faGRkX2NmZzgwMjExX2dldF9zdXBwb3J0ZWRfZmVhdHVyZXMoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHdpcmVsZXNzX2RldiAqd2RldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgdm9pZCAqZGF0YSwgaW50IGRhdGFfbGVuKQoreworICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgICAgICAgICAgICAgICAgICAgICA9IHdkZXYtPm5ldGRldjsKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciAgICAgICAgICAgICAgICAgICAgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ICAgICAgPSB3aXBoeV9wcml2KHdpcGh5KTsKKyAgICBzdHJ1Y3Qgc2tfYnVmZiAqc2tiICAgICAgICAgPSBOVUxMOworICAgIHRBTklfVTMyICAgICAgIGZzZXQgICAgICAgICA9IDA7CisgICAgaW50IHJldCA9IDA7CisKKyAgICBFTlRFUigpOworCisgICAgcmV0ID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSByZXQpCisgICAgeworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKyAgICBpZiAod2lwaHktPmludGVyZmFjZV9tb2RlcyAmIEJJVChOTDgwMjExX0lGVFlQRV9TVEFUSU9OKSkgeworICAgICAgICBoZGRMb2coTE9HMSwgRkwoIkluZnJhIFN0YXRpb24gbW9kZSBpcyBzdXBwb3J0ZWQgYnkgZHJpdmVyIikpOworICAgICAgICBmc2V0IHw9IFdJRklfRkVBVFVSRV9JTkZSQTsKKyAgICB9CisKKyAgICBpZiAoVFJVRSA9PSBoZGRfaXNfNWdfc3VwcG9ydGVkKHBIZGRDdHgpKSB7CisgICAgICAgIGhkZExvZyhMT0cxLCBGTCgiSU5GUkFfNUcgaXMgc3VwcG9ydGVkIGJ5IGZpcm13YXJlIikpOworICAgICAgICBmc2V0IHw9IFdJRklfRkVBVFVSRV9JTkZSQV81RzsKKyAgICB9CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfUDJQCisgICAgaWYgKCh3aXBoeS0+aW50ZXJmYWNlX21vZGVzICYgQklUK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AgICAgICAgICAgICAgICAgICBOTE1TR19IRFJMRU4pOworCisgICAgaWYgKCFza2IpIHsKKyAgICAgICAgaGRkTG9nKExPR0UsIEZMKCJjZmc4MDIxMV92ZW5kb3JfY21kX2FsbG9jX3JlcGx5X3NrYiBmYWlsZWQiKSk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBoZGRMb2coTE9HMSwgRkwoIlN1cHBvcnRlZCBGZWF0dXJlcyA6IDB4JXgiKSwgZnNldCk7CisKKyAgICBpZiAobmxhX3B1dF91MzIoc2tiLCBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9GRUFUVVJFX1NFVCwgZnNldCkpIHsKKyAgICAgICAgaGRkTG9nKExPR0UsIEZMKCJubGEgcHV0IGZhaWwiKSk7CisgICAgICAgIGdvdG8gbmxhX3B1dF9mYWlsdXJlOworICAgIH0KKworICAgIHJldCA9IGNmZzgwMjExX3ZlbmRvcl9jbWRfcmVwbHkoc2tiKTsKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIHJldDsKKworbmxhX3B1dF9mYWlsdXJlOgorICAgIGtmcmVlX3NrYihza2IpOworICAgIHJldHVybiAtRUlOVkFMOworfQorCitzdGF0aWMgaW50Cit3bGFuX2hkZF9jZmc4MDIxMV9nZXRfc3VwcG9ydGVkX2ZlYXR1cmVzKHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXJlbGVzc19kZXYgKndkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsIGludCBkYXRhX2xlbikKK3sKKyAgICBpbnQgcmV0ID0gMDsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX193bGFuX2hkZF9jZmc4MDIxMV9nZXRfc3VwcG9ydGVkX2ZlYXR1cmVzKHdpcGh5LCB3ZGV2LCBkYXRhLCBkYXRhX2xlbik7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludAorX193bGFuX2hkZF9jZmc4MDIxMV9nZXRfY29uY3VycmVuY3lfbWF0cml4KHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXJlbGVzc19kZXYgKndkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsIGludCBkYXRhX2xlbikKK3sKKyAgICB1aW50MzJfdCBmZWF0dXJlX3NldF9tYXRyaXhbV0xBTl9IRERfTUFYX0ZFQVRVUkVfU0VUXSA9IHswfTsKKyAgICB1aW50OF90IGksIGZlYXR1cmVfc2V0cywgbWF4X2ZlYXR1cmVfc2V0czsKKyAgICBzdHJ1Y3QgbmxhdHRyICp0YltRQ0FfV0xBTl9WRU5ET1JfQVRUUl9HRVRfQ09OQ1VSUkVOQ1lfTUFUUklYX01BWCArIDFdOworICAgIHN0cnVjdCBza19idWZmICpyZXBseV9za2I7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IHdpcGh5X3ByaXYod2lwaHkpOworICAgIGludCByZXQ7CisKKyAgICBFTlRFUigpOworCisgICAgcmV0ID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSByZXQpCisgICAgeworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKworICAgIGlmIChubGFfcGFyc2UodGIsIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0dFVF9DT05DVVJSRU5DWV9NQVRSSVhfTUFYLAorICAgICAgICAgICAgICAgICAgZGF0YSwgZGF0YV9sZW4sIE5VTEwpKSB7CisgICAgICAgIGhkZExvZyhMT0dFLCBGTCgiSW52YWxpZCBBVFRSI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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXSUZJX0ZFQVRVUkVfU09GVF9BUDsKKworICAgIGZlYXR1cmVfc2V0X21hdHJpeFtmZWF0dXJlX3NldHMrK10gPSBXSUZJX0ZFQVRVUkVfSU5GUkEgfAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXSUZJX0ZFQVRVUkVfU09GVF9BUCB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdJRklfRkVBVFVSRV9QMlA7CisKKyAgICAvKiBBZGQgbW9yZSBmZWF0dXJlIGNvbWJpbmF0aW9ucyBoZXJlICovCisKKyAgICBmZWF0dXJlX3NldHMgPSBWT1NfTUlOKGZlYXR1cmVfc2V0cywgbWF4X2ZlYXR1cmVfc2V0cyk7CisgICAgaGRkTG9nKExPRzEsIEZMKCJOdW1iZXIgb2YgZmVhdHVyZSBzZXRzICglZCkiKSwgZmVhdHVyZV9zZXRzKTsKKyAgICBoZGRMb2coTE9HMSwgIkZlYXR1cmUgc2V0IG1hdHJpeCIpOworICAgIGZvciAoaSA9IDA7IGkgPCBmZWF0dXJlX3NldHM7IGkrKykKKyAgICAgICAgaGRkTG9nKExPRzEsICJbJWRdIDB4JTAyWCIsIGksIGZlYXR1cmVfc2V0X21hdHJpeFtpXSk7CisKKyAgICByZXBseV9za2IgPSBjZmc4MDIxMV92ZW5kb3JfY21kX2FsbG9jX3JlcGx5X3NrYih3aXBoeSwgc2l6ZW9mKHUzMikgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih1MzIpICogZmVhdHVyZV9zZXRzICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOTE1TR19IRFJMRU4pOworCisgICAgaWYgKHJlcGx5X3NrYikgeworICAgICAgICBpZiAobmxhX3B1dF91MzIocmVwbHlfc2tiLAorICAgICAgICAgICAgICAgICAgICAgICAgUUNBX1dMQU5fVkVORE9SX0FUVFJfR0VUX0NPTkNVUlJFTkNZX01BVFJJWF9SRVNVTFRTX1NFVF9TSVpFLAorICAgICAgICAgICAgICAgICAgICAgICAgZmVhdHVyZV9zZXRzKSB8fAorICAgICAgICAgICAgbmxhX3B1dChyZXBseV9za2IsCisgICAgICAgICAgICAgICAgICAgIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX0dFVF9DT05DVVJSRU5DWV9NQVRSSVhfUkVTVUxUU19TRVQsCisgICAgICAgICAgICAgICAgICAgIHNpemVvZih1MzIpICogZmVhdHVyZV9zZXRzLCBmZWF0dXJlX3NldF9tYXRyaXgpKSB7CisgICAgICAgICAgICBoZGRMb2coTE9HRSwgRkwoIm5sYSBwdXQgZmFpbCIpKTsKKyAgICAgICAgICAgIGtmcmVlX3NrYihyZXBseV9za2IpOworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgIH0KKworICAgICAgICByZXQgPSBjZmc4MDIxMV92ZW5kb3JfY21kX3JlcGx5KHJlcGx5X3NrYik7CisgICAgICAgIEVYSVQoKTsKKyAgICAgICAgcmV0dXJuIHJldDsKKyAgICB9CisgICAgaGRkTG9nKExPR0UsIEZMKCJGZWF0dXJlIHNldCBtYXRyaXg6IGJ1ZmZlciBhbGxvYyBmYWlsIikpOworICAgIHJldHVybiAtRU5PTUVNOworCit9CisKK3N0YXRpYyBpbnQKK3dsYW5faGRkX2NmZzgwMjExX2dldF9jb25jdXJyZW5jeV9tYXRyaXgoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHdpcmVsZXNzX2RldiAqd2RldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgdm9pZCAqZGF0YSwgaW50IGRhdGFfbGVuKQoreworICAgIGludCByZXQgPSAwOworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX3dsYW5faGRkX2NmZzgwMjExX2dldF9jb25jdXJyZW5jeV9tYXRyaXgod2lwaHksIHdkZXYsIGRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfbGVuKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgY29uc3Qgc3RydWN0IG5sYV9wb2xpY3kKK3dsYW5faGRkX3NldF9ub19kZnNfZmxhZ19jb25maWdfcG9saWN5W1FDQV9XTEFOX1ZFTkRPUl9BVFRSX1NFVF9OT19ERlNfRkxBR19NQVgKKyArMV0gPQoreworICAgIFtRQ0FfV0xBTl9WRU5ET1JfQVRUUl9TRVRfTk9fREZTX0ZMQUddID0gey50eXBlID0gTkxBX1UzMiB9LAorfTsKKworc3RhdGljIGludCBfX3dsYW5faGRkX2NmZzgwMjExX2Rpc2FibGVfZGZzX2NoYW5uZWxzKHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXJlbGVzc19kZXYgKndkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkYXRhX2xlbikKK3sKKyAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ICAgICAgICAgICAgICAgICAgICAgPSB3ZGV2LT5uZXRkZXY7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgICAgICAgICAgICAgICAgICAgID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgdEhhbEhhbmRsZSBoSGFsID0gV0xBTl9IRERfR0VUX0hBTF9DVFgocEF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ET1JfQVRUUl9TRVRfTk9fREZTX0ZMQUddKTsKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sIEZMKCIgREZTIGZsYWcgKCVkKSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRmc0ZsYWcpOworCisgICAgcEhkZEN0eC0+ZGlzYWJsZV9kZnNfZmxhZyA9IGRmc0ZsYWc7CisKKyAgICBzbWVfZGlzYWJsZV9kZnNfY2hhbm5lbChoSGFsLCBkZnNGbGFnKTsKKyAgICBzbWVfRmlsdGVyU2NhblJlc3VsdHMoaEhhbCwgcEFkYXB0ZXItPnNlc3Npb25JZCk7CisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIDA7Cit9CisKK3N0YXRpYyBpbnQgd2xhbl9oZGRfY2ZnODAyMTFfZGlzYWJsZV9kZnNfY2hhbm5lbHMoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHdpcmVsZXNzX2RldiAqd2RldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgdm9pZCAqZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGRhdGFfbGVuKQoreworICAgaW50IHJldCA9IDA7CisKKyAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICByZXQgPSBfX3dsYW5faGRkX2NmZzgwMjExX2Rpc2FibGVfZGZzX2NoYW5uZWxzKHdpcGh5LCB3ZGV2LCBkYXRhLCBkYXRhX2xlbik7CisgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgIHJldHVybiByZXQ7CisKK30KKworY29uc3Qgc3RydWN0CitubGFfcG9saWN5IHFjYV93bGFuX3ZlbmRvcl9hdHRyW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX01BWCsxXSA9Cit7CisgICAgW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX1JPQU1JTkdfUE9MSUNZXSA9IHsgLnR5cGUgPSBOTEFfVTMyIH0sCisgICAgW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX01BQ19BRERSXSAgICAgICA9IHsgLnR5cGUgPSBOTEFfVU5TUEVDIH0sCit9OworCitzdGF0aWMgaW50IF9fd2xhbl9oZGRfY2ZnODAyMTFfZmlybXdhcmVfcm9hbWluZyhzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgc3RydWN0IHdpcmVsZXNzX2RldiAqd2RldiwgY29uc3Qgdm9pZCAqZGF0YSwgaW50IGRhdGFfbGVuKQoreworCisgICAgdTggYnNzaWRbNl0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IHswfTsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ICAgICAgICAgICAgICAgICAgICAgID0gd2lwaHlfcHJpdih3aXBoeSk7CisgICAgc3RydWN0IG5sYXR0ciAqdGJbUUNBX1dMQU5fVkVORE9SX0FUVFJfTUFYICsgMV07CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIHZfVTMyX3QgaXNGd3JSb2FtRW5hYmxlZCA9IEZBTFNFOworICAgIGludCByZXQ7CisKKyAgICBFTlRFUigpOworCisgICAgcmV0ID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSByZXQpIHsKKyAgICAgICAgcmV0dXJuIHJldDsKKyAgICB9CisKKyAgICByZXQgPSBubGFfcGFyc2UodGIsIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX01BWCwKKyAgICAgICAgICAgICAgICAgICAgZGF0YSwgZGF0YV9sZW4sCisgICAgICAgICAgICAgICAgICAgIHFjYV93bGFuX3ZlbmRvcl9hdHRyKTsKKyAgICBpZiAocmV0KXsKKyAgICAgICAgaG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gICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGRhdGFfbGVuKQoreworICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgPSB3ZGV2LT5uZXRkZXY7CisgICAgaGRkX2NvbnRleHRfdCAqaGRkX2N0eCA9IHdpcGh5X3ByaXYod2lwaHkpOworICAgIHN0cnVjdCBubGF0dHIgKnRiW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX01BWCArIDFdOworICAgIGludCByZXQ7CisgICAgc3RhdGljIGNvbnN0IHN0cnVjdCBubGFfcG9saWN5IHBvbGljeVtRQ0FfV0xBTl9WRU5ET1JfQVRUUl9NQVggKyAxXQorICAgICAgICAgICAgICAgID0ge1tRQ0FfV0xBTl9WRU5ET1JfQVRUUl9TRVRCQU5EX1ZBTFVFXSA9IHsgLnR5cGUgPSBOTEFfVTMyIH19OworCisgICAgRU5URVIoKTsKKworICAgIHJldCA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQoaGRkX2N0eCk7CisgICAgaWYgKDAgIT0gcmV0KSB7CisgICAgICAgIGhkZExvZyhMT0dFLCBGTCgiSEREIGNvbnRleHQgaXMgbm90IHZhbGlkIikpOworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKworICAgIGlmIChubGFfcGFyc2UodGIsIFFDQV9XTEFOX1ZFTkRPUl9BVFRSX01BWCwgZGF0YSwgZGF0YV9sZW4sCisgICAgICAgICAgICAgICAgICBwb2xpY3kpKSB7CisgICAgICAgIGhkZExvZyhMT0dFLCBGTCgiSW52YWxpZCBBVFRSIikpOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBpZiAoIXRiW1FDQV9XTEFOX1ZFTkRPUl9BVFRSX1NFVEJBTkRfVkFMVUVdKSB7CisgICAgICAgIGhkZExvZyhMT0dFLCBGTCgiYXR0ciBRQ0FfV0xBTl9WRU5ET1JfQVRUUl9TRVRCQU5EX1ZBTFVFIGZhaWxlZCIpKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgaGRkX2N0eC0+aXNTZXRCYW5kQnlOTCA9IFRSVUU7CisgICAgcmV0ID0gaGRkX3NldEJhbmQoZGV2LAorICAgICAgICAgICAgICAgICAgICAgICBubGFfZ2V0X3UzMih0YltRQ0FfV0xBTl9WRU5ET1JfQVRUUl9TRVRCQU5EX1ZBTFVFXSkpOworICAgIGhkZF9jdHgtPmlzU2V0QmFuZEJ5TkwgPSBGQUxTRTsKKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gcmV0OworfQorCisvKioKKyAqIHdsYW5faGRkX2NmZzgwMjExX3NldGJhbmQoKSAtIFdyYXBwZXIgdG8gb2ZmbG9hZCBwYWNrZXRzCisgKiBAd2lwaHk6ICAgIHdpcGh5IHN0cnVjdHVyZSBwb2ludGVyCisgKiBAd2RldjogICAgIFdpcmVsZXNzIGRldmljZSBzdHJ1Y3R1cmUgcG9pbnRlcgorICogQGRhdGE6ICAgICBQb2ludGVyIHRvIHRoZSBkYXRhIHJlY2VpdmVkCisgKiBAZGF0YV9sZW46IExlbmd0aCBvZiBAZGF0YQorICoKKyAqIFJldHVybjogMCBvbiBzdWNjZXNzOyBlcnJubyBvbiBmYWlsdXJlCisgKi8KK3N0YXRpYyBpbnQgd2xhbl9oZGRfY2ZnODAyMTFfc2V0YmFuZChzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXJlbGVzc19kZXYgKndkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgdm9pZCAqZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGF0YV9sZW4pCit7CisgICAgaW50IHJldCA9IDA7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9fd2xhbl9oZGRfY2ZnODAyMTFfc2V0YmFuZCh3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgd2RldiwgZGF0YSwgZGF0YV9sZW4pOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKK2NvbnN0IHN0cnVjdCB3aXBoeV92ZW5kb3JfY29tbWFuZCBoZGRfd2lwaHlfdmVuZG9yX2NvbW1hbmRzW10gPQoreworICAgIHsKKyAgICAgICAgLmluZm8udmVuZG9yX2lkID0gUUNBX05MODAyMTFfVkVORE9SX0lELAorICAgICAgICAuaW5mby5zdWJjbWQgPSBRQ0FfTkw4MDIxMV9WRU5ET1JfU1VCQ01EX1JPQU1JTkcsCisgICAgICAgIC5mbGFncyA9IFdJUEhZX1ZFTkRPUl9DTURfTkVFRF9XREVWIHwKKyAgICAgICAgICAgICAgICAgV0lQSFlfVkVORE9SX0NNRF9ORUVEX05FVERFViB8CisgICAgICAgICAgICAgICAgIFdJUEhZX1ZFTkRPUl9DTURfTkVFRF9SVU5OSU5HLAorICAgICAgICAuZG9pdCA9IHdsYW5faGRkX2NmZzgwMjExX2Zpcm13YXJlX3JvYW1pbmcKKyAgICB9LAorCisgICAgeworICAgICAgICAuaW5mby52ZW5kb3JfaWQgPSBRQ0FfTkw4MDIxMV9WRU5ET1JfSUQsCisgICAgICAgIC5pbmZvLnN1YmNtZCA9IFFDQV9OTDgwMjExX1ZFTkRPUl9TVUJDTURfTkFOLAorICAgICAgICAuZmxhZ3MgPSBXSVBIWV9WRU5ET1JfQ01EX05FRURfV0RFViB8CisgICAgICAgICAgICAgICAgIFdJUEhZX1ZFTkRPUl9DTURfTkVFRF9ORVRERVYgfAorICAgICAgICAgICAgICAgICBXSVBIWV9WRU5ET1JfQ01EX05FRURfUlVOTklORywKKyAgICAgICAgLmRvaXQgPSB3bGFuX2hkZF9jZmc4MDIxMV9uYW5fcmVxdWVzdAorICAgIH0sCisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfTElOS19MQVlFUl9TVEFUUworICAgIHsKKyAgICAgICAgLmluZm8udmVuZG9yX2lkID0gUUNBX05MODAyMTFfVkVORE9SX0lELAorICAgICAgICAuaW5mby5zdWJjbWQgPSBRQ0FfTkw4MDIxMV9WRU5ET1JfU1VCQ01EX0xMX1NUQVRTX0NMUiwKKyAgICAgICAgLmZsYWdzID0gV0lQSFlfVkVORE9SX0NNRF9ORUVEX1dERVYgfAorICAgICAgICAgICAgV0lQSFlfVkVORE9SX0NNRF9ORUVEX05FVERFViB8CisgICAgICAgICAgICBXSVBIWV9WRU5ET1JfQ01EX05FRURfUlVOTklORywKKyAgICAgICAgLmRvaXQgPSB3bGFuX2hkZF9jZmc4MDIxMV9sbF9zdGF0c19jbGVhcgorICAgIH0sCisKKyAgICB7CisgICAgICAgIC5pbmZvLnZlbmRvcl9pZCA9IFFDQV9OTDgwMjExX1ZFTkRPUl9JRCwKKyAgICAgICAgLmluZm8uc3ViY21kID0gUUNBX05MODAyMTFfVkVORE9SX1NVQkNNRF9MTF9TVEFUU19TRVQsCisgICAgICAgIC5mbGFncyA9IFdJUEhZX1ZFTkRPUl9DTURfTkVFRF9XREVWIHwKKyAgICAgICAgICAgIFdJUEhZX1ZFTkRPUl9DTURfTkVFRF9ORVRERVYgfAorICAgICAgICAgICAgV0lQSFlfVkVORE9SX0NNRF9ORUVEX1JVTk5JTkcsCisgICAgICAgIC5kb2l0ID0gd2xhbl9oZGRfY2ZnODAyMTFfbGxfc3RhdHNfc2V0CisgICAgfSwKKworICAgIHsKKyAgICAgICAgLmluZm8udmVuZG9yX2lkID0gUUNBX05MODAyMTFfVkVORE9SX0lELAorICAgICAgICAuaW5mby5zdWJjbWQgPSBRQ0FfTkw4MDIxMV9WRU5ET1JfU1VCQ01EX0xMX1NUQVRTX0dFVCwKKyAgICAgICAgLmZsYWdzID0gV0lQSFlfVkVORE9SX0NNRF9ORUVEX1dERVYgfAorICAgICAgICAgICAgV0lQSF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wKKyAgICAgICAgLmluZm8uc3ViY21kID0gUUNBX05MODAyMTFfVkVORE9SX1NVQkNNRF9URExTX0VOQUJMRSwKKyAgICAgICAgLmZsYWdzID0gV0lQSFlfVkVORE9SX0NNRF9ORUVEX1dERVYgfAorICAgICAgICAgICAgICAgICBXSVBIWV9WRU5ET1JfQ01EX05FRURfTkVUREVWIHwKKyAgICAgICAgICAgICAgICAgV0lQSFlfVkVORE9SX0NNRF9ORUVEX1JVTk5JTkcsCisgICAgICAgIC5kb2l0ID0gd2xhbl9oZGRfY2ZnODAyMTFfZXh0dGRsc19lbmFibGUKKyAgICB9LAorICAgIHsKKyAgICAgICAgLmluZm8udmVuZG9yX2lkID0gUUNBX05MODAyMTFfVkVORE9SX0lELAorICAgICAgICAuaW5mby5zdWJjbWQgPSBRQ0FfTkw4MDIxMV9WRU5ET1JfU1VCQ01EX1RETFNfRElTQUJMRSwKKyAgICAgICAgLmZsYWdzID0gV0lQSFlfVkVORE9SX0NNRF9ORUVEX1dERVYgfAorICAgICAgICAgICAgICAgICBXSVBIWV9WRU5ET1JfQ01EX05FRURfTkVUREVWIHwKKyAgICAgICAgICAgICAgICAgV0lQSFlfVkVORE9SX0NNRF9ORUVEX1JVTk5JTkcsCisgICAgICAgIC5kb2l0ID0gd2xhbl9oZGRfY2ZnODAyMTFfZXh0dGRsc19kaXNhYmxlCisgICAgfSwKKyAgICB7CisgICAgICAgIC5pbmZvLnZlbmRvcl9pZCA9IFFDQV9OTDgwMjExX1ZFTkRPUl9JRCwKKyAgICAgICAgLmluZm8uc3ViY21kID0gUUNBX05MODAyMTFfVkVORE9SX1NVQkNNRF9URExTX0dFVF9TVEFUVVMsCisgICAgICAgIC5mbGFncyA9IFdJUEhZX1ZFTkRPUl9DTURfTkVFRF9XREVWIHwKKyAgICAgICAgICAgICAgICAgV0lQSFlfVkVORE9SX0NNRF9ORUVEX05FVERFViwKKyAgICAgICAgLmRvaXQgPSB3bGFuX2hkZF9jZmc4MDIxMV9leHR0Z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Nwb29mZWRfbWFjX291aQorICAgIH0sCisgICAgeworICAgICAgICAuaW5mby52ZW5kb3JfaWQgPSBRQ0FfTkw4MDIxMV9WRU5ET1JfSUQsCisgICAgICAgIC5pbmZvLnN1YmNtZCA9IFFDQV9OTDgwMjExX1ZFTkRPUl9TVUJDTURfR0VUX0NPTkNVUlJFTkNZX01BVFJJWCwKKyAgICAgICAgLmZsYWdzID0gV0lQSFlfVkVORE9SX0NNRF9ORUVEX1dERVYgfAorICAgICAgICAgICAgICAgICBXSVBIWV9WRU5ET1JfQ01EX05FRURfTkVUREVWLAorICAgICAgICAuZG9pdCA9IHdsYW5faGRkX2NmZzgwMjExX2dldF9jb25jdXJyZW5jeV9tYXRyaXgKKyAgICB9LAorICAgIHsKKyAgICAgICAgLmluZm8udmVuZG9yX2lkID0gUUNBX05MODAyMTFfVkVORE9SX0lELAorICAgICAgICAuaW5mby5zdWJjbWQgPSBRQ0FfTkw4MDIxMV9WRU5ET1JfU1VCQ01EX1NFVEJBTkQsCisgICAgICAgIC5mbGFncyA9IFdJUEhZX1ZFTkRPUl9DTURfTkVFRF9XREVWIHwKKyAgICAgICAgICAgIFdJUEhZX1ZFTkRPUl9DTURfTkVFRF9ORVRERVYgfAorICAgICAgICAgICAgV0lQSFlfVkVORE9SX0NNRF9ORUVEX1JVTk5JTkcsCisgICAgICAgIC5kb2l0ID0gd2xhbl9oZGRfY2ZnODAyMTFfc2V0YmFuZAorICAgIH0KK307CisKKy8qIHZlbmRvciBzcGVjaWZpYyBldmVudHMgKi8KK3N0YXRpYyBjb25zdAorc3RydWN0IG5sODAyMTFfdmVuZG9yX2NtZF9pbmZvIHdsYW5faGRkX2NmZzgwMjExX3ZlbmRvcl9ldmVudHNbXSA9Cit7CisjaWZkZWYgRkVBVFVSRV9XTEFOX0NIX0FWT0lECisgICAgeworICAgICAgICAudmVuZG9yX2lkID0gUUNBX05MODAyMTFfVkVORE9SX0lELAorICAgICAgICAuc3ViY21kID0gUUNBX05MODAyMTFfVkVORE9SX1NVQkNNRF9BVk9JRF9GUkVRVUVOQ1kKKyAgICB9LAorI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9DSF9BVk9JRCBJbmRleCA9IDAqLworI2lmZGVmIFdMQU5fRkVBVFVSRV9MSU5LX0xBWUVSX1NUQVRTCisgICAgeworICAgICAgICAvKiBJbmRleCA9IDEqLworICAgICAgICAudmVuZG9yX2lkID0gUUNBX05MODAyMTFfVkVORE9SX0lELAorICAgICAgICAuc3ViY21kID0gUUNBX05MODAyMTFfVkVORE9SX1NVQkNNRF9MTF9TVEFUU19TRVQKKyAgICB9LAorICAgIHsKKyAgICAgICAgLyogSW5kZXggPSAyKi8KKyAgICAgICAgLnZlbmRvcl9pZCA9IFFDQV9OTDgwMjExX1ZFTkRPUl9JRCwKKyAgICAgICAgLnN1YmNtZCA9IFFDQV9OTDgwMjExX1ZFTkRPUl9TVUJDTURfTExfU1RBVFNfR0VUCisgICAgfSwKKyAgICB7CisgICAgICAgIC8qIEluZGV4ID0gMyovCisgICAgICAgIC52ZW5kb3JfaWQgPSBRQ0FfTkw4MDIxMV9WRU5ET1JfSUQsCisgICAgICAgIC5zdWJjbWQgPSBRQ0FfTkw4MDIxMV9WRU5ET1JfU1VCQ01EX0xMX1NUQVRTX0NMUgorICAgIH0sCisgICAgeworICAgICAgICAvKiBJbmRleCA9IDQqLworICAgICAgICAudmVuZG9yX2lkID0gUUNBX05MODAyMTFfVkVORE9SX0lELAorICAgICAgICAuc3ViY21kID0gUUNBX05MODAyMTFfVkVORE9SX1NVQkNNRF9MTF9TVEFUU19SQURJT19SRVNVTFRTCisgICAgfSwKKyAgICB7CisgICAgICAgIC8qIEluZGV4ID0gNSovCisgICAgICAgIC52ZW5kb3JfaWQgPSBRQ0FfTkw4MDIxMV9WRU5ET1JfSUQsCisgICAgICAgIC5zdWJjbWQgPSBRQ0FfTkw4MDIxMV9WRU5ET1JfU1VCQ01EX0xMX1NUQVRTX0lGQUNFX1JFU1VMVFMKKyAg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U1VCQ01EX0VYVFNDQU5fU0NBTl9SRVNVTFRTX0FWQUlMQUJMRQorICAgIH0sCisgICAgeworICAgICAgICAudmVuZG9yX2lkID0gUUNBX05MODAyMTFfVkVORE9SX0lELAorICAgICAgICAuc3ViY21kID0gUUNBX05MODAyMTFfVkVORE9SX1NVQkNNRF9FWFRTQ0FOX0ZVTExfU0NBTl9SRVNVTFQKKyAgICB9LAorICAgIHsKKyAgICAgICAgLnZlbmRvcl9pZCA9IFFDQV9OTDgwMjExX1ZFTkRPUl9JRCwKKyAgICAgICAgLnN1YmNtZCA9IFFDQV9OTDgwMjExX1ZFTkRPUl9TVUJDTURfRVhUU0NBTl9TQ0FOX0VWRU5UCisgICAgfSwKKyAgICB7CisgICAgICAgIC52ZW5kb3JfaWQgPSBRQ0FfTkw4MDIxMV9WRU5ET1JfSUQsCisgICAgICAgIC5zdWJjbWQgPSBRQ0FfTkw4MDIxMV9WRU5ET1JfU1VCQ01EX0VYVFNDQU5fSE9UTElTVF9BUF9GT1VORAorICAgIH0sCisgICAgeworICAgICAgICAudmVuZG9yX2lkID0gUUNBX05MODAyMTFfVkVORE9SX0lELAorICAgICAgICAuc3ViY21kID0gUUNBX05MODAyMTFfVkVORE9SX1NVQkNNRF9FWFRTQ0FOX1NFVF9CU1NJRF9IT1RMSVNUCisgICAgfSwKKyAgICB7CisgICAgICAgIC52ZW5kb3JfaWQgPSBRQ0FfTkw4MDIxMV9WRU5ET1JfSUQsCisgICAgICAgIC5zdWJjbWQgPSBRQ0FfTkw4MDIxMV9WRU5ET1JfU1VCQ01EX0VYVFNDQU5fUkVTRVRfQlNTSURfSE9UTElTVAorICAgIH0sCisgICAgeworICAgICAgICAudmVuZG9yX2lkID0gUUNBX05MODAyMTFfVkVORE9SX0lELAorICAgICAgICAuc3ViY21kID0gUUNBX05MODAyMTFfVkVORE9SX1NVQkNNRF9FWFRTQ0FOX1NJR05JRklDQU5UX0NIQU5HRQorICAgIH0sCisgICAgeworICAgICAgICAudmVuZG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IiwKKyAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBpKTsKKyAgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKworICAgICAgICBmb3IgKGogPSAwOyBqIDwgd2lwaHktPmJhbmRzW2ldLT5uX2NoYW5uZWxzOyBqKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIHN0cnVjdCBpZWVlODAyMTFfc3VwcG9ydGVkX2JhbmQgKmJhbmQgPSB3aXBoeS0+YmFuZHNbaV07CisKKyAgICAgICAgICAgIGNoYW5uZWxFbmFibGVkU3RhdGUgPSB2b3NfbnZfZ2V0Q2hhbm5lbEVuYWJsZWRTdGF0ZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYW5kLT5jaGFubmVsc1tqXS5od192YWx1ZSk7CisKKyAgICAgICAgICAgIGlmIChJRUVFODAyMTFfQkFORF8yR0haID09IGkgJiYgZUNTUl9CQU5EXzVHID09IGVCYW5kKSAvLyA1RyBvbmx5CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYmFuZC0+Y2hhbm5lbHNbal0uZmxhZ3MgfD0gSUVFRTgwMjExX0NIQU5fRElTQUJMRUQ7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChJRUVFODAyMTFfQkFORF81R0haID09IGkgJiYgZUNTUl9CQU5EXzI0ID09IGVCYW5kKSAvLyAyRyBvbmx5CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYmFuZC0+Y2hhbm5lbHNbal0uZmxhZ3MgfD0gSUVFRTgwMjExX0NIQU5fRElTQUJMRUQ7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChOVl9DSEFOTkVMX0RJU0FCTEUgPT0gY2hhbm5lbEVuYWJsZWRTdGF0ZSB8fAorICAgICAgICAgICAgICAgIE5WX0NIQU5ORUxfSU5WQUxJRCA9PSBjaGFubmVsRW5hYmxlZFN0YXRlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGJhbmQtPmNoYW5uZWxzW2pdLmZsYWdzIHw9IElFRUU4MDIxMV9DSEFOX0RJU0FCTEVEOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoTlZfQ0hBTk5FTF9ERlMgPT0gY2hhbm5lbEVuYWJsZWRTdGF0ZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBiYW5kLT5jaGFubmVsc1tqXS5mbGFncyAmPSB+SUVFRTgwMjExX0NIQU5fRElTQUJMRUQ7CisgICAgICAgICAgICAgICAgYmFuZC0+Y2hhbm5lbHNbal0uZmxhZ3MgfD0gSUVFRTgwMjExX0NIQU5fUkFEQVI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYmFuZC0+Y2hhbm5lbHNbal0uZmxhZ3MgJj0gfihJRUVFODAyMTFfQ0hBTl9ESVNBQkxFRAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfElFRUU4MDIxMV9DSEFOX1JBREFSKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gMDsKK30KKy8qCisgKiBGVU5DVElPTjogd2xhbl9oZGRfY2ZnODAyMTFfaW5pdAorICogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgYnkgaGRkX3dsYW5fc3RhcnR1cCgpCisgKiBkdXJpbmcgaW5pdGlhbGl6YXRpb24uCisgKiBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgdG8gaW5pdGlhbGl6ZSBhbmQgcmVnaXN0ZXIgd2lwaHkgc3RydWN0dXJlLgorICovCitpbnQgd2xhbl9oZGRfY2ZnODAyMTFfaW5pdChzdHJ1Y3QgZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHdpcGh5ICp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uZWVkIHRvIGRldGVybWluZSB3aGF0IHRvIGRvIHdpdGggYm90aAorICAgICAgIHJlZ3VsYXRvcnkgc2V0dGluZ3MgKi8KKworICAgIHdpcGh5LT5yZWdfbm90aWZpZXIgPSB3bGFuX2hkZF9saW51eF9yZWdfbm90aWZpZXI7CisjZWxzZQorICAgIHdpcGh5LT5yZWdfbm90aWZpZXIgPSB3bGFuX2hkZF9jcmRhX3JlZ19ub3RpZmllcjsKKyNlbmRpZgorCisgICAgd2lwaHktPm1heF9zY2FuX3NzaWRzID0gTUFYX1NDQU5fU1NJRDsKKworICAgIHdpcGh5LT5tYXhfc2Nhbl9pZV9sZW4gPSBTSVJfTUFDX01BWF9BRERfSUVfTEVOR1RIOworCisgICAgd2lwaHktPm1heF9hY2xfbWFjX2FkZHJzID0gTUFYX0FDTF9NQUNfQUREUkVTUzsKKworICAgIC8qIFN1cHBvcnRzIFNUQVRJT04gJiBBRC1IT0MgbW9kZXMgcmlnaHQgbm93ICovCisgICAgd2lwaHktPmludGVyZmFjZV9tb2RlcyA9IEJJVChOTDgwMjExX0lGVFlQRV9TVEFUSU9OKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgQklUKE5MODAyMTFfSUZUWVBFX0FESE9DKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgQklUKE5MODAyMTFfSUZUWVBFX1AyUF9DTElFTlQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBCSVQoTkw4MDIxMV9JRlRZUEVfUDJQX0dPKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgQklUKE5MODAyMTFfSUZUWVBFX0FQKTsKKworICAgIGlmIChWT1NfTU9OSVRPUl9NT0RFID09IGhkZF9nZXRfY29ucGFyYW0oKSkKKyAgICB7CisgICAgICAgIHdpcGh5LT5pbnRlcmZhY2VfbW9kZXMgfD0gQklUKE5MODAyMTFfSUZUWVBFX01PTklUT1IpOworICAgIH0KKworICAgIGlmKCBwQ2ZnLT5hZHZlcnRpc2VDb25jdXJyZW50T3BlcmF0aW9uICkKKyAgICB7CisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDQsMCkpCisgICAgICAgIGlmKCBwQ2ZnLT5lbmFibGVNQ0MgKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBDdXJyZW50bHksIHN1cHBvcnRzIHVwIHRvIHR3byBjaGFubmVscyAqLworICAgICAgICAgICAgd2xhbl9oZGRfaWZhY2VfY29tYmluYXRpb24ubnVtX2RpZmZlcmVudF9jaGFubmVscyA9IDI7CisKKyAgICAgICAgICAgIGlmKCAhcENmZy0+YWxsb3dNQ0NHT0RpZmZCSSApCisgICAgICAgICAgICAgICAgd2xhbl9oZGRfaWZhY2VfY29tYmluYXRpb24uYmVhY29uX2ludF9pbmZyYV9tYXRjaCA9IHRydWU7CisKKyAgICAgICAgfQorICAgICAgICB3aXBoeS0+aWZhY2VfY29tYmluYXRpb25zID0gJndsYW5faGRkX2lmYWNlX2NvbWJpbmF0aW9uOworICAgICAgICB3aXBoeS0+bl9pZmFjZV9jb21iaW5hdGlvbnMgPSAxOworI2VuZGlmCisgICAgfQorCisgICAgLyogQmVmb3JlIHJlZ2lzdGVyaW5nIHdlIG5lZWQgdG8gdXBkYXRlIHRoZSBodCBjYXBhYmlsaXRpZWQgYmFzZWQKKyAgICAgKiBvbiBpbmkgdmFsdWVzKi8KKyAgICBpZiggIXBDZmctPlNob3J0R0kyME1oekVuYWJsZSApCisgICAgeworICAgICAgICB3bGFuX2hkZF9iYW5kXzJfNF9HSFouaHRfY2FwLmNhcCAgICAgJj0gfklFRUU4MDIxMV9IVF9DQVBfU0dJXzIwOworICAgICAgICB3bGFuX2hkZF9iYW5kXzVfR0haLmh0X2NhcC5jYXAgICAgICAgJj0gfklFRUU4MDIxMV9IVF9DQVBfU0dJXzIwOworICAgICAgICB3bGFuX2hkZF9iYW5kX3AycF8yXzRfR0haLmh0X2NhcC5jYXAgJj0gfklFRUU4MD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VscyIpKTsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZSh3aXBoeS0+YmFuZHNbSUVFRTgwMjExX0JBTkRfMkdIWl0tPmNoYW5uZWxzKTsKKyAgICAgICAgICAgIHdpcGh5LT5iYW5kc1tJRUVFODAyMTFfQkFORF8yR0haXS0+Y2hhbm5lbHMgPSBOVUxMOworICAgICAgICAgICAgcmV0dXJuIC1FTk9NRU07CisgICAgICAgIH0KKyAgICAgICAgdm9zX21lbV9jb3B5KHdpcGh5LT5iYW5kc1tJRUVFODAyMTFfQkFORF81R0haXS0+Y2hhbm5lbHMsCisgICAgICAgICAgICAgICAgJmhkZF9jaGFubmVsc181X0dIWlswXSwKKyAgICAgICAgICAgICAgICBzaXplb2YoaGRkX2NoYW5uZWxzXzVfR0haKSk7CisgICAgfQorCisgICBmb3IgKGkgPSAwOyBpIDwgSUVFRTgwMjExX05VTV9CQU5EUzsgaSsrKQorICAgeworCisgICAgICAgaWYgKE5VTEwgPT0gd2lwaHktPmJhbmRzW2ldKQorICAgICAgIHsKKyAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sIiVzOiB3aXBoeS0+YmFuZHNbaV0gaXMgTlVMTCwgaSA9ICVkIiwKKyAgICAgICAgICAgICAgICAgX19mdW5jX18sIGkpOworICAgICAgICAgIGNvbnRpbnVlOworICAgICAgIH0KKworICAgICAgIGZvciAoaiA9IDA7IGogPCB3aXBoeS0+YmFuZHNbaV0tPm5fY2hhbm5lbHM7IGorKykKKyAgICAgICB7CisgICAgICAgICAgIHN0cnVjdCBpZWVlODAyMTFfc3VwcG9ydGVkX2JhbmQgKmJhbmQgPSB3aXBoeS0+YmFuZHNbaV07CisKKyAgICAgICAgICAgaWYgKElFRUU4MDIxMV9CQU5EXzJHSFogPT0gaSAmJiBlQ1NSX0JBTkRfNUcgPT0gcENmZy0+bkJhbmRDYXBhYmlsaXR5KSAvLyA1RyBvbmx5CisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8vIEVuYWJsZSBzb2NpYWwgY2hhbm5lbHMgZm9yIFAyUAorICAgICAgICAgICAgICAgaWYgKFdMQU5fSEREX0lTX1NPQ0lBTF9DSEFOTkVMKGJhbmQtPmNoYW5uZWxzW2pdLmNlbnRlcl9mcmVxKSkKKyAgICAgICAgICAgICAgICAgICBiYW5kLT5jaGFubmVsc1tqXS5mbGFncyAmPSB+SUVFRTgwMjExX0NIQU5fRElTQUJMRUQ7CisgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgYmFuZC0+Y2hhbm5lbHNbal0uZmxhZ3MgfD0gSUVFRTgwMjExX0NIQU5fRElTQUJMRUQ7CisgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgfQorICAgICAgICAgICBlbHNlIGlmIChJRUVFODAyMTFfQkFORF81R0haID09IGkgJiYgZUNTUl9CQU5EXzI0ID09IHBDZmctPm5CYW5kQ2FwYWJpbGl0eSkgLy8gMkcgb25seQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBiYW5kLT5jaGFubmVsc1tqXS5mbGFncyB8PSBJRUVFODAyMTFfQ0hBTl9ESVNBQkxFRDsKKyAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICB9CisgICAgICAgfQorICAgIH0KKyAgICAvKkluaXRpYWxpc2UgdGhlIHN1cHBvcnRlZCBjaXBoZXIgc3VpdGUgZGV0YWlscyovCisgICAgd2lwaHktPmNpcGhlcl9zdWl0ZXMgPSBoZGRfY2lwaGVyX3N1aXRlczsKKyAgICB3aXBoeS0+bl9jaXBoZXJfc3VpdGVzID0gQVJSQVlfU0laRShoZGRfY2lwaGVyX3N1aXRlcyk7CisKKyAgICAvKnNpZ25hbCBzdHJlbmd0aCBpbiBtQm0gKDEwMCpkQm0pICovCisgICAgd2lwaHktPnNpZ25hbF90eXBlID0gQ0ZHODAyMTFfU0lHTkFMX1RZUEVfTUJNOworCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+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GVyLT5zZXNzaW9uSWQsIHR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgKHZfVThfdCopR0FTX0NPTUVCQUNLX1JFUSwgR0FTX0NPTUVCQUNLX1JFUV9TSVpFICk7CisKKyAgICAvKiBHQVMgQ29tZWJhY2sgUmVzcG9uc2UgKi8KKyAgICBzbWVfUmVnaXN0ZXJNZ210RnJhbWUoaEhhbCwgcEFkYXB0ZXItPnNlc3Npb25JZCwgdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAodl9VOF90KilHQVNfQ09NRUJBQ0tfUlNQLCBHQVNfQ09NRUJBQ0tfUlNQX1NJWkUgKTsKKworICAgIC8qIFAyUCBQdWJsaWMgQWN0aW9uICovCisgICAgc21lX1JlZ2lzdGVyTWdtdEZyYW1lKGhIYWwsIHBBZGFwdGVyLT5zZXNzaW9uSWQsIHR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgKHZfVThfdCopUDJQX1BVQkxJQ19BQ1RJT05fRlJBTUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUDJQX1BVQkxJQ19BQ1RJT05fRlJBTUVfU0laRSApOworCisgICAgLyogUDJQIEFjdGlvbiAqLworICAgIHNtZV9SZWdpc3Rlck1nbXRGcmFtZShoSGFsLCBwQWRhcHRlci0+c2Vzc2lvbklkLCB0eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICh2X1U4X3QqKVAyUF9BQ1RJT05fRlJBTUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUDJQX0FDVElPTl9GUkFNRV9TSVpFICk7CisKKyAgICAvKiBXTk0gQlNTIFRyYW5zaXRpb24gUmVxdWVzdCBmcmFtZSAqLworICAgIHNtZV9SZWdpc3Rlck1nbXRGcmFtZShoSGFsLCBwQWRhcHRlci0+c2Vzc2lvbklkLCB0eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICh2X1U4X3QqKVdOTV9CU1NfQUNUSU9OX0ZSQU1FL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yZWdpc3Rlck1nbXRGcmFtZShoSGFsLCBwQWRhcHRlci0+c2Vzc2lvbklkLCB0eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAodl9VOF90KilHQVNfSU5JVElBTF9SRVEsIEdBU19JTklUSUFMX1JFUV9TSVpFICk7CisKKyAgICAvKiBHQVMgSW5pdGlhbCBSZXNwb25zZSAqLworICAgIHNtZV9EZXJlZ2lzdGVyTWdtdEZyYW1lKGhIYWwsIHBBZGFwdGVyLT5zZXNzaW9uSWQsIHR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgKHZfVThfdCopR0FTX0lOSVRJQUxfUlNQLCBHQVNfSU5JVElBTF9SU1BfU0laRSApOworCisgICAgLyogR0FTIENvbWViYWNrIFJlcXVlc3QgKi8KKyAgICBzbWVfRGVyZWdpc3Rlck1nbXRGcmFtZShoSGFsLCBwQWRhcHRlci0+c2Vzc2lvbklkLCB0eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICh2X1U4X3QqKUdBU19DT01FQkFDS19SRVEsIEdBU19DT01FQkFDS19SRVFfU0laRSApOworCisgICAgLyogR0FTIENvbWViYWNrIFJlc3BvbnNlICovCisgICAgc21lX0RlcmVnaXN0ZXJNZ210RnJhbWUoaEhhbCwgcEFkYXB0ZXItPnNlc3Npb25JZCwgdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAodl9VOF90KilHQVNfQ09NRUJBQ0tfUlNQLCBHQVNfQ09NRUJBQ0tfUlNQX1NJWkUgKTsKKworICAgIC8qIFAyUCBQdWJsaWMgQWN0aW9uICovCisgICAgc21lX0RlcmVnaXN0ZXJNZ210RnJhbWUoaEhhbCwgcEFkYXB0ZXItPnNlc3Npb25JZCwgdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAodl9VOF90KilQMlBfUFVCTElDX0FDVElPTl9GUkFNRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQMlBfUFVCTElDX0FDVElPTl9GUkFNRV9TSVpFICk7CisKKyAgICAvKiBQMlAgQWN0aW9uICovCisgICAgc21lX0RlcmVnaXN0ZXJNZ210RnJhbWUoaEhhbCwgcEFkYXB0ZXItPnNlc3Npb25JZCwgdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAodl9VOF90KilQMlBfQUNUSU9OX0ZSQU1FLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFAyUF9BQ1RJT05fRlJBTUVfU0laRSApOworICAgIC8qIFdOTS1Ob3RpZmljYXRpb24gKi8KKyAgICBzbWVfRGVyZWdpc3Rlck1nbXRGcmFtZShoSGFsLCBwQWRhcHRlci0+c2Vzc2lvbklkLCB0eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICh2X1U4X3QqKVdOTV9OT1RJRklDQVRJT05fRlJBTUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV05NX05PVElGSUNBVElPTl9GUkFNRV9TSVpFICk7Cit9CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fV0FQSQordm9pZCB3bGFuX2hkZF9jZmc4MDIxMV9zZXRfa2V5X3dhcGkoaGRkX2FkYXB0ZXJfdCogcEFkYXB0ZXIsIHU4IGtleV9pbmRleCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqbWFjX2FkZHIsIGNvbnN0IHU4ICprZXkgLCBpbnQga2V5X0xlbikKK3sKKyAgICBoZGRfc3RhdGlvbl9jdHhfdCAqcEhkZFN0YUN0eCA9IFdMQU5fSEREX0dFVF9TVEFUSU9OX0NUWF9QVFIocEFkYXB0ZXIpOworICAgIHRDc3JSb2FtU2V0S2V5ICBzZXRLZXk7CisgICAgdl9CT09MX3QgaXNDb25uZWN0ZWQgPSBUUlVFOworICAgIGludCBzdGF0dXMgPSAwOworICAgIHZfVTMyX3Qgcm9hbUlkPSAweEZGOworICAgIHRBTklfVTggKnBLZXlQdHIgPSBOVUxMOworICAgIGludCBuID0gMDsKKwor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RyID0gc2V0S2V5LktleTsKKyAgICBtZW1jcHkoIHBLZXlQdHIsIGtleSwga2V5X0xlbik7CisKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sIiVzOiBXQVBJIEtFWSBMRU5HVEg6MHglMDR4IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIGtleV9MZW4pOworICAgIGZvciAobiA9IDAgOyBuIDwga2V5X0xlbjsgbisrKQorICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlcyBXQVBJIEtFWSBEYXRhWyVkXTolMDJ4ICIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sbixzZXRLZXkuS2V5W25dKTsKKworICAgIHBIZGRTdGFDdHgtPnJvYW1faW5mby5yb2FtaW5nU3RhdGUgPSBIRERfUk9BTV9TVEFURV9TRVRUSU5HX0tFWTsKKyAgICBpZiAoIGlzQ29ubmVjdGVkICkKKyAgICB7CisgICAgICAgIHN0YXR1cz0gc21lX1JvYW1TZXRLZXkoIFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwgJnNldEtleSwgJnJvYW1JZCApOworICAgIH0KKyAgICBpZiAoIHN0YXR1cyAhPSAwICkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICJbJTRkXSBzbWVfUm9hbVNldEtleSByZXR1cm5lZCBFUlJPUiBzdGF0dXM9ICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fTElORV9fLCBzdGF0dXMgKTsKKyAgICAgICAgcEhkZFN0YUN0eC0+cm9hbV9pbmZvLnJvYW1pbmdTdGF0ZSA9IEhERF9ST0FNX1NUQVRFX05PTkU7CisgICAgfQorICAgIC8qIE5lZWQgdG8gY2xlYXIgYW55IHRyYWNlIG9mIGtleSB2YWx1ZSBpbiB0aGUgbWVtb3J5LgorICAgICAqIFRodXMgemVybyBvdXQgdGhlIG1lbW9yeSBldmVuIHRob3VnaCBpdCBpcyBsb2NhbAorICAgICAqIHZhcmlhYmxlLgorICAgICAqLworICAgIHZvc19tZW1femVybygmc2V0S2V5LCBzaXplb2Yoc2V0S2V5KSk7Cit9CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX1dBUEkqLworCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA8IEtFUk5FTF9WRVJTSU9OKDMsNCwwKSkKK2ludCB3bGFuX2hkZF9jZmc4MDIxMV9hbGxvY19uZXdfYmVhY29uKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmVhY29uX2RhdGFfdCAqKnBwQmVhY29uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGJlYWNvbl9wYXJhbWV0ZXJzICpwYXJhbXMpCisjZWxzZQoraW50IHdsYW5faGRkX2NmZzgwMjExX2FsbG9jX25ld19iZWFjb24oaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiZWFjb25fZGF0YV90ICoqcHBCZWFjb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgY2ZnODAyMTFfYmVhY29uX2RhdGEgKnBhcmFtcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkdGltX3BlcmlvZCkKKyNlbmRpZgoreworICAgIGludCBzaXplOworICAgIGJlYWNvbl9kYXRhX3QgKmJlYWNvbiA9IE5VTEw7CisgICAgYmVhY29uX2RhdGFfdCAqb2xkID0gTlVMTDsKKyAgICBpbnQgaGVhZF9sZW4sdGFpbF9sZW47CisKKyAgICBFTlRFUigpOworICAgIGlmIChwYXJhbXMtPmhlYWQgJiYgIXBhcmFtcy0+aGVhZF9sZW4pCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICBGTCgiaGVhZF9sZW4gaXMgIE5VTEwiKSk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIG9sZCA9IHBBZGFwdGVyLT5zZXNzaW9uQ3R4LmFwLmJlYWNvbjsKKworICAgIGlmICghcGFyYW1zLT5oZWFkICYmICFvbGQpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIEZMKCJzZXNzaW9uKCVkKSBvbGQgYW5kIG5ldyBoZWFkcyBwb2ludHMgdG8gTlVMTCIpLAorICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIGlmIChwYXJhbXMtPnRhaWwgJiYgIXBhcmFtcy0+dGFpbF9sZW4pCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICBGTCgidGFpbF9sZW4gaXMgemVybyBidXQgdGFpbCBpcyBub3QgTlVMTCIpKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA8PSBLRVJORUxfVkVSU0lPTigyLDYsMzgpKQorICAgIC8qIEtlcm5lbCAzLjAgaXMgbm90IHVwZGF0aW5nIGR0aW1fcGVyaW9kIGZvciBzZXQgYmVhY29uICovCisgICAgaWYgKCFwYXJhbXMtPmR0aW1fcGVyaW9kKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgRkwoImR0aW0gcGVyaW9kIGlzIDAiKSk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyNlbmRpZgorCisgICAgaWYocGFyYW1zLT5oZWFkKQorICAgICAgICBoZWFkX2xlbiA9IHBhcmFtcy0+aGVhZF9sZW47CisgICAgZWxzZQorICAgICAgICBoZWFkX2xlbiA9IG9sZC0+aGVhZF9sZW47CisKKyAgICBpZihwYXJhbXMtPnRhaWwgfHwgIW9sZCkKKyAgICAgICAgdGFpbF9sZW4gPSBwYXJhbXMtPnRhaWxfbGVuOworICAgIGVsc2UKKyAgICAgICAgdGFpbF9sZW4gPSBvbGQtPnRhaWxfbGVuOworCisgICAgc2l6ZSA9IHNpemVvZihiZWFjb25fZGF0YV90KSArIGhlYWRfbGVuICsgdGFpbF9sZW47CisKKyAgICBiZWFjb24gPSBremFsbG9jKHNpemUsIEdGUF9LRVJORUwpOworCisgICAgaWYoIGJlYWNvbiA9PSBOVUxMICkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIEZMKCJNZW0gYWxsb2NhdGlvbiBmb3IgYmVhY29uIGZhaWxlZCIpKTsKKyAgICAgICAgcmV0dXJuIC1FTk9NRU07CisgICAgfQorCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA8IEtFUk5FTF9WRVJTSU9OKDMsNCwwKSkKKyAgICBpZihwYXJhbXMtPmR0aW1fcGVyaW9kIHx8ICFvbGQgKQorICAgICAgICBiZWFjb24tPmR0aW1fcGVyaW9kID0gcGFyYW1zLT5kdGltX3BlcmlvZDsKKyAgICBlbHNlCisgICAgICAgIGJlYWNvbi0+ZHRpbV9wZXJpb2QgPSBvbGQtPmR0aW1fcGVyaW9kOworI2Vsc2UKKyAgICBpZihkdGltX3BlcmlvZCB8fCAhb2xkICkKKyAgICAgICAgYmVhY29uLT5kdGltX3BlcmlvZCA9IGR0aW1fcGVyaW9kOworICAgIGVsc2UKKyAgICAgICAgYmVhY29uLT5kdGltX3BlcmlvZCA9IG9sZC0+ZHRpbV9wZXJpb2Q7CisjZW5kaWYKKworICAgIGJlYWNvbi0+aGVhZCA9ICgodTggKikgYmVhY29uKSArIHNpemVvZihiZWFjb25fZGF0YV90KTsKKyAgICBiZWFjb24tPnRhaWwgPSBiZWFjb24tPmhlYWQgKyBoZWFkX2xlbjsKKyAgICBiZWFjb24tPmhlYWRfbGVuID0gaGVhZF9sZW47CisgICAgYmVhY29uLT50YWlsX2xlbiA9IHRhaWxfbGVuOworCisgICAgaWYocGFyYW1zLT5oZWFkKSB7CisgICAgICAgIG1lbWNweSAoYmVhY29uLT5oZWFkLHBhcmFtcy0+aGVhZCxiZWFjb24tPmhlYWRfbGVuKTsKKyAgICB9CisgICAgZWxzZSB7CisgICAgICAgIGlmKG9sZCkKKyAgICAgICAgICAgIG1lbWNweSAoYmVhY29uLT5oZWFkLG9sZC0+aGVhZCxiZWFjb24tPmhlYWRfbGVuKTsKKyAgICB9CisKKyAgICBpZihwYXJhbXMtPnRhaWwpIHsKKyAgICAgICAgbWVtY3B5IChiZWFjb24tPnRhaWwscGFyYW1zLT50YWlsLGJlYWNvbi0+dGFpbF9sZW4pOworICAgIH0KKyAgICBlbHNlIHsKKyAgICAgICBpZihvbGQpCisgICAgICAgICAgIG1lbWNweSAoYmVhY29uLT50YWlsLG9sZC0+dGFpbCxiZWFjb24tPnRhaWxfbGVuKTsKKyAgICB9CisKKyAgICAqcHBCZWFjb24gPSBiZWFjb247CisKKyAgICBrZnJlZShvbGQpOworCisgICAgcmV0dXJuIDA7CisKK30KKwordl9VOF90KiB3bGFuX2hkZF9jZmc4MDIxMV9nZXRfaWVfcHRyKAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywgMTgsIDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZfVThfdCAqcEllcywKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwSWVzLAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGxlbmd0aCwgdl9VOF90IGVpZCkKK3sKKyAgICBpbnQgbGVmdCA9IGxlbmd0aDsKKyAgICB2X1U4X3QgKnB0ciA9ICAodl9VOF90ICopcEllczsKKyAgICB2X1U4X3QgZWxlbV9pZCxlbGVtX2xlbjsKKworICAgIHdoaWxlKGxlZnQgPj0gMikKKyAgICB7CisgICAgICAgIGVsZW1faWQgID0gIHB0clswXTsKKyAgICAgICAgZWxlbV9sZW4gPSAgcHRyWzFdOworICAgICAgICBsZWZ0IC09IDI7CisgICAgICAgIGlmKGVsZW1fbGVuID4gbGVmdCkKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAgRkwoIioqKipJbnZhbGlkIElFcyBlaWQgPSAlZCBlbGVtX2xlbj0lZCBsZWZ0PSVkKioqKioiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlaWQsZWxlbV9sZW4sbGVmdCk7CisgICAgICAgICAgICByZXR1cm4gTlVMTDsKKyAgICAgICAgfQorICAgICAgICBpZiAoZWxlbV9pZCA9PSBlaWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIHJldHVybiBwdHI7CisgICAgICAgIH0KKworICAgICAgICBsZWZ0IC09IGVsZW1fbGVuOworICAgICAgICBwdHIgKz0gKGVsZW1fbGVuICsgMik7CisgICAgfQorICAgIHJldHVybiBOVUxMOworfQorCisvKiBDaGVjayBpZiByYXRlIGlzIDExZyByYXRlIG9yIG5vdCAqLworc3RhdGljIGludCB3bGFuX2hkZF9yYXRlX2lzXzExZyh1OCByYXRlKQoreworICAgIHN0YXRpYyBjb25zdCB1OCBnUmF0ZUFycmF5WzhdID0gezEyLCAxOCwgMjQsIDM2LCA0OCwgNzIsIDk2LCAxMDh9OyAvKiBhY3R1YWwgcmF0ZSAqIDIgKi8KKyAgICB1OCBpOworICAgIGZvciAoaSA9IDA7IGkgPCA4OyBpKyspCisgICAgeworICAgICAgICBpZihyYXRlID09IGdSYXRlQXJyYXlbaV0pCisgICAgICAgICAgICByZXR1cm4gVFJVRTsKKyAgICB9CisgICAgcmV0dXJuIEZBTFNFOworfQorCisvKiBDaGVjayBmb3IgMTFnIHJhdGUgYW5kIHNldCBwcm9wZXIgMTFnIG9ubHkgbW9kZSAqLworc3RhdGljIHZvaWQgd2xhbl9oZGRfY2hlY2tfMTFnbW9kZSh1OCAqcEllLCB1OCogcmVxdWlyZV9odCwKKyAgICAgICAgICAgICAgICAgICAgIHU4KiBwQ2hlY2tSYXRlc2ZvcjExZywgZVNhcFBoeU1vZGUqIHBTYXBId19tb2RlKQoreworICAgIHU4IGksIG51bV9yYXRlcyA9IHBJZVswXTsKKworICAgIHBJZSArPSAxOworICAgIGZvciAoIGkgPSAwOyBpIDwgbnVtX3JhdGVzOyBpKyspCisgICAgeworICAgICAgICBpZiggKnBDaGVja1JhdGVzZm9yMTFnICYmIChUUlVFID09IHdsYW5faGRkX3JhdGVfaXNfMTFnKHBJZVtpXSAmIFJBVEVfTUFTSykpKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBJZiByYXRlIHNldCBoYXZlIDExZyByYXRlIHRoYW4gY2hhbmdlIHRoZSBtb2RlIHRvIDExRyAqLworICAgICAgICAgICAgKnBTYXBId19tb2RlID0gZVNBUF9ET1QxMV9NT0RFXzExZzsKKyAgICAgICAgICAgIGlmIChwSWVbaV0gJiBCQVNJQ19SQVRFX01BU0spCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogSWYgd2UgaGF2ZSAxMWcgcmF0ZSBhcyAgYmFzaWMgcmF0ZSwgaXQgbWVhbnMgbW9kZQorICAgICAgICAgICAgICAgICAgIGlzIDExZyBvbmx5IG1vZGUuCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAqcFNhcEh3X21vZGUgPSBlU0FQX0RPVDExX01PREVfMTFnX09OTFk7CisgICAgICAgICAgICAgICAqcENoZWNrUmF0ZXNmb3IxMWcgPSBGQUxTRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmKChCQVNJQ19SQVRFX01BU0sgfCBXTEFOX0JTU19NRU1CRVJTSElQX1NFTEVDVE9SX0hUX1BIWSkgPT0gcEllW2ldKQorICAgICAgICB7CisgICAgICAgICAgICAqcmVxdWlyZV9odCA9IFRSVUU7CisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuOworfQorCitzdGF0aWMgdm9pZCB3bGFuX2hkZF9zZXRfc2FwSHdtb2RlKGhkZF9hZGFwdGVyX3QgKnBIb3N0YXBkQWRhcHRlcikKK3sKKyAgICB0c2FwX0NvbmZpZ190ICpwQ29uZmlnID0gJnBIb3N0YXBkQWRhcHRlci0+c2Vzc2lvbkN0eC5hcC5zYXBDb25maWc7CisgICAgYmVhY29uX2RhdGFfdCAqcEJlYWNvbiA9IHBIb3N0YXBkQWRhcHRlci0+c2Vzc2lvbkN0eC5hcC5iZWFjb247CisgICAgc3RydWN0IGllZWU4MDIxMV9tZ210ICpwTWdtdF9mcmFtZSA9IChzdHJ1Y3QgaWVlZTgwMjExX21nbXQqKXBCZWFjb24tPmhlYWQ7CisgICAgdTggY2hlY2tSYXRlc2ZvcjExZyA9IFRSVUU7CisgICAgdTggcmVxdWlyZV9odCA9IEZBTFNFOworICAgIHU4ICpwSWU9TlVMTDsKKworICAgIHBDb25maWctPlNhcEh3X21vZGU9IGVTQVBfRE9UMTFfTU9ERV8xMWI7CisKKyAgICBwSWUgPSB3bGFuX2hkZF9jZmc4MDIxMV9nZXRfaWVfcHRyKCZwTWdtdF9mcmFtZS0+dS5iZWFjb24udmFyaWFibGVbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQmVhY29uLT5oZWFkX2xlbiwgV0xBTl9FSURfU1VQUF9SQVRFUyk7CisgICAgaWYgKHBJZSAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgcEllICs9IDE7CisgICAgICAgIHdsYW5faGRkX2NoZWNrXzExZ21vZGUocEllLCAmcmVxdWlyZV9odCwgJmNoZWNrUmF0ZXNmb3IxMWcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBDb25maWctPlNhcEh3X21vZGUpOworICAgIH0KKworICAgIHBJZSA9IHdsYW5faGRkX2NmZzgwMjExX2dldF9pZV9wdHIocEJlYWNvbi0+dGFpbCwgcEJlYWNvbi0+dGFpbF9sZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5fRUlEX0VYVF9TVVBQX1JBVEVTKTsKKyAgICBpZiAocEllICE9IE5VTEwpCisgICAgeworCisgICAgICAgIHBJZSArPSAxOworICAgICAgICB3bGFuX2hkZF9jaGVja18xMWdtb2RlKHBJZSwgJnJlcXVpcmVfaHQsICZjaGVja1JhdGVzZm9yMTFnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwQ29uZmlnLT5TYXBId19tb2RlKTsKKyAgICB9CisKKyAgICBpZiggcENvbmZpZy0+Y2hhbm5lbCA+IDE0ICkKKyAgICB7CisgICAgICAgIHBDb25maWctPlNhcEh3X21vZGU9IGVTQVBfRE9UMTFfTU9ERV8xMWE7CisgICAgfQorCisgICAgcEllID0gd2xhbl9oZGRfY2ZnODAyMTFfZ2V0X2llX3B0cihwQmVhY29uLT50YWlsLCBwQmVhY29uLT50YWlsX2xlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5fRUlEX0hUX0NBUEFCSUxJVFkpOworCisgICAgaWYocEllKQorICAgIHsKKyAgICAgICAgcENvbmZpZy0+U2FwSHdfbW9kZT0gZVNBUF9ET1QxMV9NT0RFXzExbjsKKyAgICAgICAgaWYocmVxdWlyZV9odCkKKyAgICAgICAgICAgIHBDb25maWctPlNhcEh3X21vZGU9IGVTQVBfRE9UMTFfTU9ERV8xMW5fT05MWTsKKyAgICB9Cit9CisKK3N0YXRpYyBpbnQgd2xhbl9oZGRfYWRkX2llKGhkZF9hZGFwdGVyX3QqIHBIb3N0YXBkQWRhcHRlciwgdl9VOF90ICpnZW5pZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqdG90YWxfaWVsZW4sIHZfVThfdCAqb3VpLCB2X1U4X3Qgb3VpX3NpemUpCit7CisgICAgdl9VMTZfdCBpZWxlbiA9IDA7CisgICAgdl9VOF90ICpwSWUgPSBOVUxMOworICAgIGJlYWNvbl9kYXRhX3QgKnBCZWFjb24gPSBwSG9zdGFwZEFkYXB0ZXItPnNlc3Npb25DdHguYXAuYmVhY29uOworCisgICAgcEllID0gd2xhbl9oZGRfZ2V0X3ZlbmRvcl9vdWlfaWVfcHRyKG91aSwgb3VpX3NpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQmVhY29uLT50YWlsLCBwQmVhY29uLT50YWlsX2xlbik7CisKKyAgICBpZiAocEllKQorICAgIHsKKyAgICAgICAgaWVsZW4gPSBwSWVbMV0gKyAyOworICAgICAgICBpZiAoKCp0b3RhbF9pZWxlbiArIGllbGVuKSA8PSBNQVhfR0VOSUVfTEVOKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJmdlbmllWyp0b3RhbF9pZWxlbl0sIHBJZSwgaWVsZW4pOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIqKkllIExlbmd0aCBpcyB0b28gYmlnKioqIik7CisgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgfQorICAgICAgICAqdG90YWxfaWVsZW4gKz0gaWVsZW47CisgICAgfQorICAgIHJldHVybiAwOworfQorCitzdGF0aWMgdm9pZCB3bGFuX2hkZF9hZGRfaG9zdGFwZF9jb25mX3ZzaWUoaGRkX2FkYXB0ZXJfdCogcEhvc3RhcGRBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAqZ2VuaWUsIHZfVThfdCAqdG90YWxfaWVsZW4pCit7CisgICAgYmVhY29uX2RhdGFfdCAqcEJlYWNvbiA9IHBIb3N0YXBkQWRhcHRlci0+c2Vzc2lvbkN0eC5hcC5iZWFjb247CisgICAgaW50IGxlZnQgPSBwQmVhY29uLT50YWlsX2xlbjsKKyAgICB2X1U4X3QgKnB0ciA9IHBCZWFjb24tPnRhaWw7CisgICAgdl9VOF90IGVsZW1faWQsIGVsZW1fbGVuOworICAgIHZfVTE2X3QgaWVsZW4gPSAwOworCisgICAgaWYgKCBOVUxMID09IHB0ciB8fCAwID09IGxlZnQgKQorICAgICAgICByZXR1cm47CisKKyAgICB3aGlsZSAobGVmdCA+PSAyKQorICAgIHsKKyAgICAgICAgZWxlbV9pZCAgPSBwdHJbMF07CisgICAgICAgIGVsZW1fbGVuID0gcHRyWzFdOworICAgICAgICBsZWZ0IC09IDI7CisgICAgICAgIGlmIChlbGVtX2xlbiA+IGxlZnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyggVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiKioqKkludmFsaWQgSUVzIGVpZCA9ICVkIGVsZW1fbGVuPSVkIGxlZnQ9JWQqKioqKiIsCisgICAgICAgICAgICAgICAgICAgIGVsZW1faWQsIGVsZW1fbGVuLCBsZWZ0KTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBpZiAoSUVfRUlEX1ZFTkRPUiA9PSBlbGVtX2lkKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBza2lwcGluZyB0aGUgVlNJRSdzIHdoaWNoIHdlIGRvbid0IHdhbnQgdG8gaW5jbHVkZSBvcgorICAgICAgICAgICAgICogaXQgd2lsbCBiZSBpbmNsdWRlZCBieSBleGlzdGluZyBjb2RlCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmICgobWVtY21wKCAmcHRyWzJdLCBXUFNfT1VJX1RZUEUsIFdQU19PVUlfVFlQRV9TSVpFKSAhPSAwICkgJiYKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfV0ZECisgICAgICAgICAgICAgICAobWVtY21wKCAmcHRyWzJdLCBXRkRfT1VJX1RZUEUsIFdGRF9PVUlfVFlQRV9TSVpFKSAhPSAwKSAmJgorI2VuZGlmCisgICAgICAgICAgICAgICAobWVtY21wKCAmcHRyWzJdLCBXSElURUxJU1RfT1VJX1RZUEUsIFdQQV9PVUlfVFlQRV9TSVpFKSAhPSAwKSAmJgorICAgICAgICAgICAgICAgKG1lbWNtcCggJnB0clsyXSwgQkxBQ0tMSVNUX09VSV9UWVBFLCBXUEFfT1VJX1RZUEVfU0laRSkgIT0gMCkgJiYKKyAgICAgICAgICAgICAgIChtZW1jbXAoICZwdHJbMl0sICJceDAwXHg1MFx4ZjJceDAyIiwgV1BBX09VSV9UWVBFX1NJWkUpICE9IDApICYmCisgICAgICAgICAgICAgICAobWVtY21wKCAmcHRyWzJdLCBXUEFfT1VJX1RZUEUsIFdQQV9PVUlfVFlQRV9TSVpFKSAhPSAwKSAmJgorICAgICAgICAgICAgICAgKG1lbWNtcCggJnB0clsyXSwgUDJQX09VSV9UWVBFLCBQMlBfT1VJX1RZUEVfU0laRSkgIT0gMCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBpZWxlbiA9IHB0clsxXSArIDI7CisgICAgICAgICAgICAgICBpZiAoKCp0b3RhbF9pZWxlbiArIGllbGVuKSA8PSBNQVhfR0VOSUVfTEVOKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmZ2VuaWVbKnRvdGFsX2llbGVuXSwgcHRyLCBpZWxlbik7CisgICAgICAgICAgICAgICAgICAgKnRvdGFsX2llbGVuICs9IGllbGVuOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIGhkZExvZyggVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIklFIExlbmd0aCBpcyB0b28gYmlnICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJJRXMgZWlkPSVkIGVsZW1fbGVuPSVkIHRvdGFsX2llX2xlbnQ9JWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbV9pZCwgZWxlbV9sZW4sICp0b3RhbF9pZWxlbik7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBsZWZ0IC09IGVsZW1fbGVuOworICAgICAgICBwdHIgKz0gKGVsZW1fbGVuICsgMik7CisgICAgfQorICAgIHJldHVybjsKK30KKworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPCBLRVJORUxfVkVSU0lPTigzLDQsMCkpCitzdGF0aWMgaW50IHdsYW5faGRkX2NmZzgwMjExX3VwZGF0ZV9hcGllcyhoZGRfYWRhcHRlcl90KiBwSG9zdGFwZEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGJlYWNvbl9wYXJhbWV0ZXJzICpwYXJhbXMpCisjZWxzZQorc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV91cGRhdGVfYXBpZXMoaGRkX2FkYXB0ZXJfdCogcEhvc3RhcGRBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBjZmc4MDIxMV9iZWFjb25fZGF0YSAqcGFyYW1zKQorI2VuZGlmCit7CisgICAgdl9VOF90ICpnZW5pZTsKKyAgICB2X1U4X3QgdG90YWxfaWVsZW4gPSAwOworICAgIHZfVThfdCBhZGRJRVsxXSA9IHswfTsKKyAgICBpbnQgcmV0ID0gMDsKKworICAgIGdlbmllID0gdm9zX21lbV9tYWxsb2MoTUFYX0dFTklFX0xFTik7CisKKyAgICBpZihnZW5pZSA9PSBOVUxMKSB7CisKKyAgICAgICAgcmV0dXJuIC1FTk9NRU07CisgICAgfQorCisgICAgaWYgKDAgIT0gd2xhbl9oZGRfYWRkX2llKHBIb3N0YXBkQWRhcHRlciwgZ2VuaWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdG90YWxfaWVsZW4sIFdQU19PVUlfVFlQRSwgV1BTX09VSV9UWVBFX1NJWkUpKQorICAgIHsKKyAgICAgICAgIGhkZExvZyhMT0dFLAorICAgICAgICAgICAgICAgRkwoIkFkZGluZyBXUFMgSUUgZmFpbGVkIikpOworICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgIGdvdG8gZG9uZTsKKyAgICB9CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfV0ZECisgICAgaWYgKDAgIT0gd2xhbl9oZGRfYWRkX2llKHBIb3N0YXBkQWRhcHRlciwgZ2VuaWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdG90YWxfaWVsZW4sIFdGRF9PVUlfVFlQRSwgV0ZEX09VSV9UWVBFX1NJWkUpKQorICAgIHsKKyAgICAgICAgIGhkZExvZyhMT0dFLAorICAgICAgICAgICAgICAgRkwoIkFkZGluZyBXRkQgSUUgZmFpbGVkIikpOworICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgIGdvdG8gZG9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YXJlIG5vdCBhYmxlCisgICAgICAgICAgIFN0b3JlIE1vcmUgdGhlbiAyNTUgYnl0ZXMgaW50byBPbmUgVmFyaWFibGUuCisgICAgICAgICovCisgICAgICAgIHdoaWxlICgocmVtX3Byb2JlX3Jlc3BfaWVfbGVuID4gMCkgJiYgKGNvdW50ZXIgPCAzKSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKHJlbV9wcm9iZV9yZXNwX2llX2xlbiA+IE1BWF9DRkdfU1RSSU5HX0xFTikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwcm9iZV9yc3BfaWVfbGVuW2NvdW50ZXIrK10gPSBNQVhfQ0ZHX1NUUklOR19MRU47CisgICAgICAgICAgICAgICAgcmVtX3Byb2JlX3Jlc3BfaWVfbGVuIC09IE1BWF9DRkdfU1RSSU5HX0xFTjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwcm9iZV9yc3BfaWVfbGVuW2NvdW50ZXIrK10gPSByZW1fcHJvYmVfcmVzcF9pZV9sZW47CisgICAgICAgICAgICAgICAgcmVtX3Byb2JlX3Jlc3BfaWVfbGVuID0gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJlbV9wcm9iZV9yZXNwX2llX2xlbiA9IDA7CisKKyAgICAgICAgaWYgKHByb2JlX3JzcF9pZV9sZW5bMF0gPiAwKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoY2NtQ2ZnU2V0U3RyKChXTEFOX0hERF9HRVRfQ1RYKHBIb3N0YXBkQWRhcHRlcikpLT5oSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfUFJPQkVfUlNQX0FERE5JRV9EQVRBMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCopJnBhcmFtcy0+cHJvYmVyZXNwX2llc1tyZW1fcHJvYmVfcmVzcF9pZV9sZW5dLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb2JlX3JzcF9pZV9sZW5bMF0sIE5VTEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUFOSV9CT09MRUFOX0ZBTFNFKSA9PSBlSEFMX1NUQVRVU19GQUlMVVJFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgIkNvdWxkIG5vdCBwYXNzIG9uIFdOSV9DRkdfUFJPQkVfUlNQX0FERE5JRV9EQVRBMSB0byBDQ00iKTsKKyAgICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgICAgZ290byBkb25lOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmVtX3Byb2JlX3Jlc3BfaWVfbGVuICs9IHByb2JlX3JzcF9pZV9sZW5bMF07CisgICAgICAgIH0KKworICAgICAgICBpZiAocHJvYmVfcnNwX2llX2xlblsxXSA+IDApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChjY21DZmdTZXRTdHIoKFdMQU5fSEREX0dFVF9DVFgocEhvc3RhcGRBZGFwdGVyKSktPmhIYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19QUk9CRV9SU1BfQURETklFX0RBVEEyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4KikmcGFyYW1zLT5wcm9iZXJlc3BfaWVzW3JlbV9wcm9iZV9yZXNwX2llX2xlbl0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvYmVfcnNwX2llX2xlblsxXSwgTlVMTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQU5JX0JPT0xFQU5fRkFMU0UpID09IGVIQUxfU1RBVFVTX0ZBSUxVUkUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAiQ291bGQgbm90IHBhc3Mgb24gV05JX0NGR19QUk9CRV9SU1BfQURETklFX0RBVEEyIHRvIENDTSIpOworICAgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgICBnb3RvIGRvbmU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZW1fcHJvYmVfcmVzcF9pZV9sZW4gKz0gcHJvYmVfcnNwX2llX2xlblsxXTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChwcm9iZV9yc3BfaWVfbGVuWzJdID4gMCkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKGNjbUNmZ1NldFN0cigoV0xBTl9IRERfR0VUX0NUWChwSG9zdGFwZEFkYXB0ZXIpKS0+aEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX1BST0JFX1JTUF9BREROSUVfREFUQTMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTgqKSZwYXJhbXMtPnByb2JlcmVzcF9pZXNbcmVtX3Byb2JlX3Jlc3BfaWVfbGVuXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9iZV9yc3BfaWVfbGVuWzJdLCBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVBTklfQk9PTEVBTl9GQUxTRSkgPT0gZUhBTF9TVEFUVVNfRkFJTFVSRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICJDb3VsZCBub3QgcGFzcyBvbiBXTklfQ0ZHX1BST0JFX1JTUF9BREROSUVfREFUQTMgdG8gQ0NNIik7CisgICAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICAgIGdvdG8gZG9uZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJlbV9wcm9iZV9yZXNwX2llX2xlbiArPSBwcm9iZV9yc3BfaWVfbGVuWzJdOworICAgICAgICB9CisKKyAgICAgICAgaWYgKHByb2JlX3JzcF9pZV9sZW5bMV0gPT0gMCApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmICggZUhBTF9TVEFUVVNfRkFJTFVSRSA9PSBjY21DZmdTZXRTdHIoKFdMQU5fSEREX0dFVF9DVFgocEhvc3RhcGRBZGFwdGVyKSktPmhIYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19QUk9CRV9SU1BfQURETklFX0RBVEEyLCAodEFOSV9VOCopYWRkSUUsIDAsIE5VTEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUFOSV9CT09MRUFOX0ZBTFNFKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsCisgICAgICAgICAgICAgICAgICAgIkNvdWxkIG5vdCBwYXNzIG9uIFdOSV9DRkdfUFJPQkVfUlNQX0FERE5JRV9EQVRBMiB0byBDQ00iKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmIChwcm9iZV9yc3BfaWVfbGVuWzJdID09IDAgKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoIGVIQUxfU1RBVFVTX0ZBSUxVUkUgPT0gY2NtQ2ZnU2V0U3RyKChXTEFOX0hERF9HRVRfQ1RYKHBIb3N0YXBkQWRhcHRlcikpLT5oSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfUFJPQkVfUlNQX0FERE5JRV9EQVRBMywgKHRBTklfVTgqKWFkZElFLCAwLCBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVBTklfQk9PTEVBTl9GQUxTRSkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLAorICAgICAgICAgICAgICAgICAgICJDb3VsZCBub3QgcGFzcyBvbiBXTklfQ0ZHX1BST0JFX1JTUF9BREROSUVfREFUQTMgdG8gQ0NNIik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoY2NtQ2ZnU2V0SW50KChXTEFOX0hERF9HRVRfQ1RYKHBIb3N0YXBkQWRhcHRlcikpLT5oSGFsLAorICAgICAgICAgICAgIFdOSV9DRkdfUFJPQkVfUlNQX0FERE5JRV9GTEFHLCAxLE5VTEwsCisgICAgICAgICAgICAgdGVzdF9iaXQoU09GVEFQX0JTU19TVEFSVEVELCAmcEhvc3RhcGRBZGFwdGVyLT5ldmVudF9mbGFncykgPworICAgICAgICAgICAgICAgICAgICAgIGVBTklfQk9PTEVBTl9UUlVFIDogZUFOSV9CT09MRUFOX0ZBTFNFKQorICAgICAgICAgICAgID09IGVIQUxfU1RBVFVTX0ZBSUxVUkUpCisgICAgICAgIHsKKyAgICAgICAgICAgaGRkTG9nKExPR0UsCisgICAgICAgICAgICAgIkNvdWxkIG5vdCBwYXNzIG9uIFdOSV9DRkdfUFJPQkVfUlNQX0FERE5JRV9GTEFHIHRvIENDTSIpOworICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICBnb3RvIGRvbmU7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgLy8gUmVzZXQgV05JX0NGR19QUk9CRV9SU1AgRmxhZ3MKKyAgICAgICAgd2xhbl9oZGRfcmVzZXRfcHJvYl9yc3BpZXMocEhvc3RhcGRBZGFwdGVyKTsKKworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAiJXM6IE5vIFByb2JlIFJlc3BvbnNlIElFIHJlY2VpdmVkIGluIHNldCBiZWFjb24iLAorICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgIH0KKworICAgIC8vIEFkZGVkIGZvciBBc3NvY1Jlc3AgSUUKKyAgICBpZiAoIChwYXJhbXMtPmFzc29jcmVzcF9pZXMgIT0gTlVMTCkgJiYgKHBhcmFtcy0+YXNzb2NyZXNwX2llc19sZW4gIT0gMCkgKQorICAgIHsKKyAgICAgICBpZ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OworICAgICAgICAgIGdvdG8gZG9uZTsKKyAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICIlczogTm8gQXNzb2MgUmVzcG9uc2UgSUUgcmVjZWl2ZWQgaW4gc2V0IGJlYWNvbiIsCisgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisKKyAgICAgICAgaWYgKCBlSEFMX1NUQVRVU19GQUlMVVJFID09IGNjbUNmZ1NldEludCgoV0xBTl9IRERfR0VUX0NUWChwSG9zdGFwZEFkYXB0ZXIpKS0+aEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX0FTU09DX1JTUF9BREROSUVfRkxBRywgMCwgTlVMTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQU5JX0JPT0xFQU5fRkFMU0UpICkKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKExPR0UsCisgICAgICAgICAgICAgICAiQ291bGQgbm90IHBhc3Mgb24gV05JX0NGR19BU1NPQ19SU1BfQURETklFX0ZMQUcgdG8gQ0NNIik7CisgICAgICAgIH0KKyAgICB9CisKK2RvbmU6CisgICAgdm9zX21lbV9mcmVlKGdlbmllKTsKKyAgICByZXR1cm4gcmV0OworfQorCisvKgorICogRlVOQ1RJT046IHdsYW5faGRkX3ZhbGlkYXRlX29wZXJhdGlvbl9jaGFubmVsCisgKiBjYWxsZWQgYnkgd2xhbl9oZGRfY2ZnODAyMTFfc3RhcnRfYnNzKCkgYW5kCisgKiB3bGFuX2hkZF9jZmc4MDIxMV9zZXRfY2hhbm5lbCgpCisgKiBUaGlzIGZ1bmN0aW9uIHZhbGlkYXRlcyB3aGV0aGVyIGdpdmVuIGNoYW5uZWwgaXMgcGFydCBvZiB2YWxpZAorICogY2hhbm5lbCBsaXN0LgorICovCitWT1NfU1RBVFVTIHdsYW5faGRkX3ZhbGlkYXRlX29wZXJhdGlvbl9jaGFubmVsKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLGludCBjaGFubmVsKQoreworCisgICAgdl9VMzJfdCBudW1fY2ggPSAwOworICAgIHU4IHZhbGlkX2NoW1dOSV9DRkdfVkFMSURfQ0hBTk5FTF9MSVNUX0xFTl07CisgICAgdTMyIGluZHggPSAwOworICAgIHRIYWxIYW5kbGUgaEhhbCA9IFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKTsKKyAgICB2X1U4X3QgZlZhbGlkQ2hhbm5lbCA9IEZBTFNFLCBjb3VudCA9IDA7CisgICAgaGRkX2NvbmZpZ190ICpoZGRfcENvbmZpZ19pbmk9IChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPmNmZ19pbmk7CisKKyAgICBudW1fY2ggPSBXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU47CisKKyAgICBpZiAoIGhkZF9wQ29uZmlnX2luaS0+c2FwQWxsb3dBbGxDaGFubmVsKQorICAgIHsKKyAgICAgICAgIC8qIFZhbGlkYXRlIHRoZSBjaGFubmVsICovCisgICAgICAgIGZvciAoY291bnQgPSBSRl9DSEFOXzEgOyBjb3VudCA8PSBSRl9DSEFOXzE2NSA7IGNvdW50KyspCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmICggY2hhbm5lbCA9PSByZkNoYW5uZWxzW2NvdW50XS5jaGFubmVsTnVtICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBmVmFsaWRDaGFubmVsID0gVFJVRTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAoZlZhbGlkQ2hhbm5lbCAhPSBUUlVFKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogSW52YWxpZCBDaGFubmVsIFslZF0iLCBfX2Z1bmNfXywgY2hhbm5lbCk7CisgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgaWYgKDAgIT0gY2NtQ2ZnR2V0U3RyKGhIYWwsIFdOSV9DRkdfVkFMSURfQ0hBTk5FTF9MSVNULAorICAgICAgICAgICAgdmFsaWRfY2gsICZudW1fY2gpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICIlczogZmFpbGVkIHRvIGdldCB2YWxpZCBjaGFubmVsIGxpc3QiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgICAgICAgICAgfQorICAgICAgICBmb3IgKGluZHggPSAwOyBpbmR4IDwgbnVtX2NoOyBpbmR4KyspCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChjaGFubmVsID09IHZhbGlkX2NoW2luZHhdKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgfQorCisgICAgICAgICBpZiAoaW5keCA+PSBudW1fY2gpCisgICAgICAgICB7CisgICAgICAgICAgICAgaWYgKFdMQU5fSEREX1AyUF9HTyA9PSBwQWRhcHRlci0+ZGV2aWNlX21vZGUpCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBlQ3NyQmFuZCBiYW5kOworICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgZnJlcTsKKworICAgICAgICAgICAgICAgICBzbWVfR2V0RnJlcUJhbmQoaEhhbCwgJmJhbmQpOworCisgICAgICAgICAgICAgICAgIGlmIChlQ1NSX0JBTkRfNUcgPT0gYmFuZCkKKyAgICAgICAgICAgICAgICAgeworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPiBLRVJORUxfVkVSU0lPTigyLDYsMzgpKQorICAgICAgICAgICAgICAgICAgICAgaWYgKGNoYW5uZWwgPD0gQVJSQVlfU0laRShoZGRfY2hhbm5lbHNfMl80X0dIWikpCisgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgZnJlcSA9IGllZWU4MDIxMV9jaGFubmVsX3RvX2ZyZXF1ZW5jeShjaGFubmVsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElFRUU4MDIxMV9CQU5EXzJHSFopOworICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgIGZyZXEgPSBpZWVlODAyMTFfY2hhbm5lbF90b19mcmVxdWVuY3koY2hhbm5lbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJRUVFODAyMTFfQkFORF81R0haKTsKKyAgICAgICAgICAgICAgICAgICAgIH0KKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICBmcmVxID0gaWVlZTgwMjExX2NoYW5uZWxfdG9fZnJlcXVlbmN5KGNoYW5uZWwpOworI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICBpZihXTEFOX0hERF9JU19TT0NJQUxfQ0hBTk5FTChmcmVxKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIENoYW5uZWwgWyVkXSIsIF9fZnVuY19fLCBjaGFubmVsKTsKKyAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKKworfQorCisvKioKKyAqIEZVTkNUSU9OOiBfX3dsYW5faGRkX2NmZzgwMjExX3NldF9jaGFubmVsCisgKiBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgdG8gc2V0IHRoZSBjaGFubmVsIG51bWJlcgorICovCitzdGF0aWMgaW50IF9fd2xhbl9oZGRfY2ZnODAyMTFfc2V0X2NoYW5uZWwoIHN0cnVjdCB3aXBoeSAqd2lwaHksIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpZWVlODAyMTFfY2hhbm5lbCAqY2hhbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBubDgwMjExX2NoYW5uZWxfdHlwZSBjaGFubmVsX3R5cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciA9IE5VTEw7CisgICAgdl9VMzJfdCBudW1fY2ggPSAwOworICAgIGludCBjaGFubmVsID0gMDsKKyAgICBpbnQgZnJlcSA9IGNoYW4tPmNlbnRlcl9mcmVxOyAvKiBmcmVxIGlzIGluIE1IWiAqLworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgaW50IHN0YXR1czsKKworICAgIEVOVEVSKCk7CisKKyAgICBpZiggTlVMTCA9PSBkZXYgKQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IENhbGxlZCB3aXRoIGRldiA9IE5VTEwuIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVOT0RFVjsKKyAgICB9CisgICAgcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoIGRldiApOworCisgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX0hERCwKKyAgICAgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfSEREX0NGRzgwMjExX1NFVF9DSEFOTkVMLCBwQWRhcHRlci0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbF90eXBlICkpOworICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAiJXM6IGRldmljZV9tb2RlID0gJXMgKCVkKSAgZnJlcSA9ICVkIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgaGRkX2RldmljZV9tb2RldG9TdHJpbmcocEFkYXB0ZXItPmRldmljZV9tb2RlKSwKKyAgICAgICAgICAgICAgICBwQWRhcHRlci0+ZGV2aWNlX21vZGUsIGNoYW4tPmNlbnRlcl9mcmVxKTsKKworICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICBzdGF0dXMgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHN0YXR1cykKKyAgICB7CisgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgfQorCisgICAgLyoKKyAgICAgKiBEbyBmcmVxIHRvIGNoYW4gY29udmVyc2lvbgorICAgICAqIFRPRE86IGZvciAxMWEKKyAgICAgKi8KKworICAgIGNoYW5uZWwgPSBpZWVlODAyMTFfZnJlcXVlbmN5X3RvX2NoYW5uZWwoZnJlcSk7CisKKyAgICAvKiBDaGVjayBmcmVxIHJhbmdlICovCisgICAgaWYgKChXTklfQ0ZHX0NVUlJFTlRfQ0hBTk5FTF9TVEFNSU4gPiBjaGFubmVsKSB8fAorICAgICAgICAgICAgKFdOSV9DRkdfQ1VSUkVOVF9DSEFOTkVMX1NUQU1BWCA8IGNoYW5uZWwpKQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IENoYW5uZWwgWyVkXSBpcyBvdXRzaWRlIHZhbGlkIHJhbmdlIGZyb20gJWQgdG8gJWQiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fLCBjaGFubmVsLCBXTklfQ0ZHX0NVUlJFTlRfQ0hBTk5FTF9TVEFNSU4sCisgICAgICAgICAgICAgICAgV05JX0NGR19DVVJSRU5UX0NIQU5ORUxfU1RBTUFYKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgbnVtX2NoID0gV05JX0NGR19WQUxJRF9DSEFOTkVMX0xJU1RfTEVOOworCisgICAgaWYgKChXTEFOX0hERF9TT0ZUQVAgIT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKSAmJgorICAgICAgIChXTEFOX0hERF9QMlBfR08gIT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKSkKKyAgICB7CisgICAgICAgIGlmKFZPU19TVEFUVVNfU1VDQ0VTUyAhPSB3bGFuX2hkZF92YWxpZGF0ZV9vcGVyYXRpb25fY2hhbm5lbChwQWRhcHRlcixjaGFubmVsKSkKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIENoYW5uZWwgWyVkXSIsIF9fZnVuY19fLCBjaGFubmVsKTsKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICB9CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICIlczogc2V0IGNoYW5uZWwgdG8gWyVkXSBmb3IgZGV2aWNlIG1vZGUgPSVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIGNoYW5uZWwscEFkYXB0ZXItPmRldmljZV9tb2RlKTsKKyAgICB9CisgICAgaWYoIChwQWRhcHRlci0+ZGV2aWN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dGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKworICAgICAgICBpZiAoZUNvbm5lY3Rpb25TdGF0ZV9JYnNzQ29ubmVjdGVkID09IHBIZGRTdGFDdHgtPmNvbm5faW5mby5jb25uU3RhdGUpCisgICAgICAgIHsKKyAgICAgICAgICAgLyogTGluayBpcyB1cCB0aGVuIHJldHVybiBjYW50IHNldCBjaGFubmVsKi8KKyAgICAgICAgICAgIGhkZExvZyggVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICIlczogSUJTUyBBc3NvY2lhdGVkLCBjYW4ndCBzZXQgdGhlIGNoYW5uZWwiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgfQorCisgICAgICAgIG51bV9jaCA9IHBSb2FtUHJvZmlsZS0+Q2hhbm5lbEluZm8ubnVtT2ZDaGFubmVscyA9IDE7CisgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5vcGVyYXRpb25DaGFubmVsID0gY2hhbm5lbDsKKyAgICAgICAgcFJvYW1Qcm9maWxlLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdCA9CisgICAgICAgICAgICAmcEhkZFN0YUN0eC0+Y29ubl9pbmZvLm9wZXJhdGlvbkNoYW5uZWw7CisgICAgfQorICAgIGVsc2UgaWYgKChwQWRhcHRlci0+ZGV2aWNlX21vZGUgPT0gV0xBTl9IRERfU09GVEFQKQorICAgICAgICB8fCAgIChwQWRhcHRlci0+ZGV2aWNlX21vZGUgPT0gV0xBTl9IRERfUDJQX0dPKQorICAgICAgICAgICAgKQorICAgIHsKKyAgICAgICAgaWYgKFdMQU5fSEREX1AyUF9HTyA9PSBwQWRhcHRlci0+ZGV2aWNlX21vZGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKFZPU19TVEFUVVNfU1VDQ0VTUyAhPQorICAgICAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF92YWxpZGF0ZV9vcGVyYXRpb25fY2hhbm5lbChwQWRhcHRlcixjaGFubmVsKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIENoYW5uZWwgWyVkXSIsIF9fZnVuY19fLCBjaGFubmVsKTsKKyAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgKFdMQU5fSEREX0dFVF9BUF9DVFhfUFRSKHBBZGFwdGVyKSktPnNhcENvbmZpZy5jaGFubmVsID0gY2hhbm5lbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmICggV0xBTl9IRERfU09GVEFQID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZF9jb25maWdfdCAqY2ZnX3BhcmFtID0gKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+Y2ZnX2luaTsKKworICAgICAgICAgICAgLyogSWYgYXV0byBjaGFubmVsIHNlbGVjdGlvbiBpcyBjb25maWd1cmVkIGFzIGVuYWJsZS8gMSB0aGVuIGlnbm9yZQorICAgICAgICAgICAgY2hhbm5lbCBzZXQgYnkgc3VwcGxpY2FudAorICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmICggY2ZnX3BhcmFtLT5hcEF1dG9DaGFubmVsU2VsZWN0aW9uICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAoV0xBTl9IRERfR0VUX0FQX0NUWF9QVFIocEFkYXB0ZXIpKS0+c2FwQ29uZmlnLmNoYW5uZWwgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFVVE9fQ0hBTk5FTF9TRUxFQ1Q7CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAiJXM6IHNldCBjaGFubmVsIHRvIGF1dG8gY2hhbm5lbCAoMCkgZm9yIGRldmljZSBtb2RlID0lcyAoJWQpIiwKKyAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBoZGRfZGV2aWNlX21vZGV0b1N0cmluZyhwQWRhcHRlci0+ZGV2aWNlX21vZGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+ZGV2aWNlX21vZGUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKFZPU19TVEFUVVNfU1VDQ0VTUyAhPQorICAgICAgICAgICAgICAgICAgICAgICAgIHdsYW5faGRkX3ZhbGlkYXRlX29wZXJhdGlvbl9jaGFubmVsKHBBZGFwdGVyLGNoYW5uZWwpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgQ2hhbm5lbCBbJWRdIiwgX19mdW5jX18sIGNoYW5uZWwpOworICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAoV0xBTl9IRERfR0VUX0FQX0NUWF9QVFIocEFkYXB0ZXIpKS0+c2FwQ29uZmlnLmNoYW5uZWwgPSBjaGFubmVsOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgZGV2aWNlIG1vZGUgZmFpbGVkIHRvIHNldCB2YWxpZCBjaGFubmVsIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgRVhJVCgpOworICAgIHJldHVybiBzdGF0dXM7Cit9CisKK3N0YXRpYyBpbnQgd2xhbl9oZGRfY2ZnODAyMTFfc2V0X2NoYW5uZWwoIHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGllZWU4MDIxMV9jaGFubmVsICpjaGFuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBubDgwMjExX2NoYW5uZWxfdHlwZSBjaGFubmVsX3R5cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApCit7CisgICAgaW50IHJldDsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX193bGFuX2hkZF9jZmc4MDIxMV9zZXRfY2hhbm5lbCh3aXBoeSwgZGV2LCBjaGFuLCBjaGFubmVsX3R5cGUpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFIDwgS0VSTkVMX1ZFUlNJT04oMyw0LDApKQorc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV9zdGFydF9ic3MoaGRkX2FkYXB0ZXJfdCAqcEhvc3RhcGRBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBiZWFjb25fcGFyYW1ldGVycyAqcGFyYW1zKQorI2Vsc2UKK3N0YXRpYyBpbnQgd2xhbl9oZGRfY2ZnODAyMTFfc3RhcnRfYnNzKGhkZF9hZGFwdGVyX3QgKnBIb3N0YXBkQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBjZmc4MDIxMV9iZWFjb25fZGF0YSAqcGFyYW1zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKnNzaWQsIHNpemVfdCBzc2lkX2xlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbmw4MDIxMV9oaWRkZW5fc3NpZCBoaWRkZW5fc3NpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCBhdXRoX3R5cGUpCisjZW5kaWYKK3sKKyAgICB0c2FwX0NvbmZpZ190ICpwQ29uZmlnOworICAgIGJlYWNvbl9kYXRhX3QgKnBCZWFjb24gPSBOVUxMOworICAgIHN0cnVjdCBpZWVlODAyMTFfbWdtdCAqcE1nbXRfZnJhbWU7CisgICAgdl9VOF90ICpwSWU9TlVMTDsKKyAgICB2X1UxNl90IGNhcGFiX2luZm87CisgICAgZUNzckF1dGhUeXBlIFJTTkF1dGhUeXBlOworICAgIGVDc3JFbmNyeXB0aW9uVHlwZSBSU05FbmNyeXB0VHlwZTsKKyAgICBlQ3NyRW5jcnlwdGlvblR5cGUgbWNSU05FbmNyeXB0VHlwZTsKKyAgICBpbnQgc3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgIHRwV0xBTl9TQVBFdmVudENCIHBTYXBFdmVudENhbGxiYWNrOworICAgIGhkZF9ob3N0YXBkX3N0YXRlX3QgKnBIb3N0YXBkU3RhdGU7CisgICAgdl9VOF90IHdwYVJzbklFZGF0YVsoU0lSX01BQ19NQVhfSUVfTEVOR1RIICogMikrNF07ICAvL01heCBpZSBsZW5ndGggMjU1ICogMihXUEErUlNOKSArIDIgYnl0ZXMgKHZlbmRvciBzcGVjaWZpYyBJRCkgKiAyCisgICAgdl9DT05URVhUX3QgcFZvc0NvbnRleHQgPSAoV0xBTl9IRERfR0VUX0NUWCh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ID0gMTsKKyAgICAgICAgICAgdm9zX21lbV9jb3B5KHBDb25maWctPmNvdW50cnlDb2RlLCBwSGRkQ3R4LT5jZmdfaW5pLT5hcENudHJ5Q29kZSwgMyk7CisgICAgICAgICAgIHNtZV9zZXRSZWdJbmZvKGhIYWwsIHBDb25maWctPmNvdW50cnlDb2RlKTsKKyAgICAgICAgICAgc21lX1Jlc2V0Q291bnRyeUNvZGVJbmZvcm1hdGlvbihoSGFsLCAmcmVzdGFydE5lZWRlZCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZihwSWUpCisgICAgICAgIHsKKyAgICAgICAgICAgIHRBTklfQk9PTEVBTiByZXN0YXJ0TmVlZGVkOworICAgICAgICAgICAgcENvbmZpZy0+aWVlZTgwMjExZCA9IDE7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocENvbmZpZy0+Y291bnRyeUNvZGUsICZwSWVbMl0sIDMpOworICAgICAgICAgICAgc21lX3NldFJlZ0luZm8oaEhhbCwgcENvbmZpZy0+Y291bnRyeUNvZGUpOworICAgICAgICAgICAgc21lX1Jlc2V0Q291bnRyeUNvZGVJbmZvcm1hdGlvbihoSGFsLCAmcmVzdGFydE5lZWRlZCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBwQ29uZmlnLT5pZWVlODAyMTFkID0gMDsKKyAgICAgICAgfQorICAgICAgICAvKgorICAgICAgICAqIElmIGF1dG8gY2hhbm5lbCBpcyBjb25maWd1cmVkIGkuZS4gY2hhbm5lbCBpcyAwLAorICAgICAgICAqIHNvIHNraXAgY2hhbm5lbCB2YWxpZGF0aW9uLgorICAgICAgICAqLworICAgICAgICBpZiggQVVUT19DSEFOTkVMX1NFTEVDVCAhPSBwQ29uZmlnLT5jaGFubmVsICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYoVk9TX1NUQVRVU19TVUNDRVNTICE9IHdsYW5faGRkX3ZhbGlkYXRlX29wZXJhdGlvbl9jaGFubmVsKHBIb3N0YXBkQWRhcHRlcixwQ29uZmlnLT5jaGFubmVsKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgQ2hhbm5lbCBbJWRdIiwgX19mdW5jX18sIHBDb25maWctPmNoYW5uZWwpOworICAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgICBpZigxICE9IHBIZGRDdHgtPmlzX2R5bmFtaWNfY2hhbm5lbF9yYW5nZV9zZXQpCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaGRkX2NvbmZpZ190ICpoZGRfcENvbmZpZz0gKFdMQU5fSEREX0dFVF9DVFgocEhvc3RhcGRBZGFwdGVyKSktPmNmZ19pbmk7CisgICAgICAgICAgICAgICAgICBXTEFOU0FQX1NldENoYW5uZWxSYW5nZShoSGFsLCBoZGRfcENvbmZpZy0+YXBTdGFydENoYW5uZWxOdW0sCisgICAgICAgICAgICAgICAgICAgICAgIGhkZF9wQ29uZmlnLT5hcEVuZENoYW5uZWxOdW0saGRkX3BDb25maWctPmFwT3BlcmF0aW5nQmFuZCk7CisgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPmlzX2R5bmFtaWNfY2hhbm5lbF9yYW5nZV9zZXQgPSAwOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHBDb25maWctPmllZWU4MDIxMWQgPSAwOworICAgIH0KKworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPCBLRVJORUxfVkVSU0lPTigzLDQsMCkpCisgICAgaWYgKHBhcmFtcy0+YXV0aF90eXBlID09IE5MODAyMTFfQVVUSFRZUEVfT1BFTl9TWVNURU0pCisgICAgICA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pbCwgcEJlYWNvbi0+dGFpbF9sZW4pOworCisgICAgaWYocEllKQorICAgIHsKKyAgICAgICAgaWYocEllWzFdIDwgKDIgKyBXUFNfT1VJX1RZUEVfU0laRSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyggVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiKipXcHMgSWUgTGVuZ3RoIGlzIHRvbyBzbWFsbCoqKiIpOworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZihtZW1jbXAoJnBJZVsyXSwgV1BTX09VSV9UWVBFLCBXUFNfT1VJX1RZUEVfU0laRSkgPT0gMCkKKyAgICAgICAgeworICAgICAgICAgICAgIGhkZExvZyggVk9TX1RSQUNFX0xFVkVMX0lORk8sICIqKiBXUFMgSUUobGVuICVkKSAqKioiLCAocEllWzFdKzIpKTsKKyAgICAgICAgICAgICAvKiBDaGVjayAxNSBiaXQgb2YgV1BTIElFIGFzIGl0IGNvbnRhaW4gaW5mb3JtYXRpb24gZm9yIHdwcyBzdGF0ZQorICAgICAgICAgICAgICAqIFdQUyBzdGF0ZQorICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICBpZihTQVBfV1BTX0VOQUJMRURfVU5DT05GSUdVUkVEID09IHBJZVsxNV0pCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHBDb25maWctPndwc19zdGF0ZSA9IFNBUF9XUFNfRU5BQkxFRF9VTkNPTkZJR1VSRUQ7CisgICAgICAgICAgICAgIH0gZWxzZSBpZihTQVBfV1BTX0VOQUJMRURfQ09ORklHVVJFRCA9PSBwSWVbMTVdKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBwQ29uZmlnLT53cHNfc3RhdGUgPSBTQVBfV1BTX0VOQUJMRURfQ09ORklHVVJFRDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgI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LCBqdXN0IGNvbnN1bWUgYW55IFBNS0lEcyB0aGF0IGFyZSAgc2VudCBpbgorICAgICAgICAgKiBieSB0aGUgYXBwLgorICAgICAgICAgKiAqLworICAgICAgICBzdGF0dXMgPSBoZGRfc29mdGFwX3VucGFja0lFKAorICAgICAgICAgICAgICAgICAgICAgICAgdm9zX2dldF9jb250ZXh0KCBWT1NfTU9EVUxFX0lEX1NNRSwgcFZvc0NvbnRleHQpLAorICAgICAgICAgICAgICAgICAgICAgICAgJlJTTkVuY3J5cHRUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgJm1jUlNORW5jcnlwdFR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAmUlNOQXV0aFR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAmTUZQQ2FwYWJsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICZNRlBSZXF1aXJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBDb25maWctPnBSU05XUEFSZXFJRVsxXSsyLAorICAgICAgICAgICAgICAgICAgICAgICAgcENvbmZpZy0+cFJTTldQQVJlcUlFICk7CisKKyAgICAgICAgaWYoIFZPU19TVEFUVVNfU1VDQ0VTUyA9PSBzdGF0dXMgKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBOb3cgY29weSBvdmVyIGFsbCB0aGUgc2VjdXJpdHkgYXR0cmlidXRlcyB5b3UgaGF2ZQorICAgICAgICAgICAgICogcGFyc2VkIG91dAorICAgICAgICAgICAgICogKi8KKyAgICAgICAgICAgIHBDb25maWctPlJTTkVuY3J5cHRUeXBlID0gUlNORW5jcnlwdFR5cGU7IC8vIFVzZSB0aGUgY2lwaGVyIHR5cGUgaW4gdGhlIFJTTiBJRQorICAgICAgICAgICAgcENvbmZpZy0+bWNSU05FbmNyeXB0VHlwZSA9IG1jUlNORW5jcnlwdFR5cGU7CisgICAgICAgICAgICAoV0xBTl9IRERfR0VUX0FQX0NUWF9QVFIocEhvc3RhcGRBZGFwdGVyKSktPnVjRW5jcnlwdFR5cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSBSU05FbmNyeXB0VHlwZTsKKyAgICAgICAgICAgIGhkZExvZyggTE9HMSwgRkwoIkNTUiBBdXRoVHlwZSA9ICVkLCAiCisgICAgICAgICAgICAgICAgICAgICAgICAiRW5jcnlwdGlvblR5cGUgPSAlZCBtY0VuY3J5cHRpb25UeXBlID0gJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIFJTTkF1dGhUeXBlLCBSU05FbmNyeXB0VHlwZSwgbWNSU05FbmNyeXB0VHlwZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwSWUgPSB3bGFuX2hkZF9nZXRfdmVuZG9yX291aV9pZV9wdHIoV1BBX09VSV9UWVBFLCBXUEFfT1VJX1RZUEVfU0laRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJlYWNvbi0+dGFpbCwgcEJlYWNvbi0+dGFpbF9sZW4pOworCisgICAgaWYocEllICYmIHBJZVsxXSAmJiAocEllWzBdID09IERPVDExRl9FSURfV1BBKSkKKyAgICB7CisgICAgICAgIGlmIChwQ29uZmlnLT5wUlNOV1BBUmVxSUUpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qTWl4ZWQgbW9kZSBXUEEvV1BBMiovCisgICAgICAgICAgICBtZW1jcHkoKCZ3cGFSc25JRWRhdGFbMF0gKyBwQ29uZmlnLT5SU05XUEFSZXFJRUxlbmd0aCksIHBJZSwgcEllWzFdICsgMik7CisgICAgICAgICAgICBwQ29uZmlnLT5SU05XUEFSZXFJRUxlbmd0aCArPSBwSWVbMV0gKyAyOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcENvbmZpZy0+UlNOV1BBUmVxSUVMZW5ndGggPSBwSWVbMV0gKyAyOworICAgICAgICAgICAgbWVtY3B5KCZ3cGFSc25JRWRhdGFbMF0sIHBJZSwgcENvbmZpZy0+UlNOV1BBUmVxSUVMZW5ndGgpOworICAgICAgICAgICAgcENvbmZpZy0+cFJTTldQQVJlcUlFID0gJndwYVJzbklFZGF0YVswXTsKKyAgICAgICAgICAgIHN0YXR1cyA9IGhkZF9zb2Z0YXBfdW5wYWNrSUUoCisgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19nZXRfY29udGV4dCggVk9TX01PRFVMRV9JRF9TTUUsIHBWb3NDb250ZXh0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJlJTTkVuY3J5cHRUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAmbWNSU05FbmNyeXB0VHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJlJTTkF1dGhUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAmTUZQQ2FwYWJsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJk1GUFJlcXVpcmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICBwQ29uZmlnLT5wUlNOV1BBUmVxSUVbMV0rMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcENvbmZpZy0+cFJTTldQQVJlcUlFICk7CisKKyAgICAgICAgICAgIGlmKCBWT1NfU1RBVFVTX1NVQ0NFU1MgPT0gc3RhdHVzICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBOb3cgY29weSBvdmVyIGFsbCB0aGUgc2VjdXJpdHkgYXR0cmlidXRlcyB5b3UgaGF2ZQorICAgICAgICAgICAgICAgICAqIHBhcnNlZCBvdXQKKyAgICAgICAgICAgICAgICAgKiAqLworICAgICAgICAgICAgICAgIHBDb25maWctPlJTTkVuY3J5cHRUeXBlID0gUlNORW5jcnlwdFR5cGU7IC8vIFVzZSB0aGUgY2lwaGVyIHR5cGUgaW4gdGhlIFJTTiBJRQorICAgICAgICAgICAgICAgIHBDb25maWctPm1jUlNORW5jcnlwdFR5cGUgPSBtY1JTTkVuY3J5cHRUeXBlOworICAgICAgICAgICAgICAgIChXTEFOX0hERF9HRVRfQVBfQ1RYX1BUUihwSG9zdGFwZEFkYXB0ZXIpKS0+dWNFbmNyeXB0VHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IFJTTkVuY3J5cHRUeXBlOworICAgICAgICAgICAgICAgIGhkZExvZyggTE9HMSwgRkwoIkNTUiBBdXRoVHlwZSA9ICVkLCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJFbmNyeXB0aW9uVHlwZSA9ICVkIG1jRW5jcnlwdGlvblR5cGUgPSAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSU05BdXRoVHlwZSwgUlNORW5jcnlwdFR5cGUsIG1jUlNORW5jcnlwdFR5cGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgaWYgKHBDb25maWctPlJTTldQQVJlcUlFTGVuZ3RoID4gc2l6ZW9mIHdwYVJzbklFZGF0YSkgeworICAgICAgICBoZGRMb2coIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIioqUlNOV1BBUmVxSUVMZW5ndGggaXMgdG9vIGxhcmdlKioqIik7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIHBDb25maWctPlNTSURpbmZvLnNzaWRIaWRkZW4gPSBWT1NfRkFMU0U7CisKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFIDwgS0VSTkVMX1ZFUlNJT04oMyw0LDApKQorICAgIGlmIChwYXJhbXMtPnNzaWQgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIG1lbWNweShwQ29uZmlnLT5TU0lEaW5mby5zc2lkLnNzSWQsIHBhcmFtcy0+c3NpZCwgcGFyYW1zLT5zc2lkX2xlbik7CisgICAgICAgIHBDb25maWctPlNTSURpbmZvLnNzaWQubGVuZ3RoID0gcGFyYW1zLT5zc2lkX2xlbjsKKyAg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9sZW4pOworCisgICAgLyogcEllIGZvciBibGFjayBsaXN0IGlzIGZvbGxvd2luZyBmb3JtOgorICAgICAgICAgICAgdHlwZSAgICA6IDEgYnl0ZQorICAgICAgICAgICAgbGVuZ3RoICA6IDEgYnl0ZQorICAgICAgICAgICAgT1VJICAgICA6IDQgYnl0ZXMKKyAgICAgICAgICAgIGFjbCB0eXBlIDogMSBieXRlCisgICAgICAgICAgICBubyBvZiBtYWMgYWRkciBpbiBibGFjayBsaXN0OiAxIGJ5dGUKKyAgICAgICAgICAgIGxpc3Qgb2YgbWFjX2FjbF9lbnRyaWVzOiB2YXJpYWJsZSwgNiBieXRlcyBwZXIgbWFjIGFkZHJlc3MgKyBzaXplb2YoaW50KSBmb3IgdmxhbiBpZAorICAgICovCisgICAgaWYgKChwSWUgIT0gTlVMTCkgJiYgKHBJZVsxXSAhPSAwKSkKKyAgICB7CisgICAgICAgIHBDb25maWctPlNhcE1hY2FkZHJfYWNsID0gcEllWzZdOworICAgICAgICBwQ29uZmlnLT5udW1fZGVueV9tYWMgICA9IHBJZVs3XTsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCJhY2wgdHlwZSA9ICVkIG5vIGRlbnkgbWFjID0gJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVs2XSwgcEllWzddKTsKKyAgICAgICAgaWYgKHBDb25maWctPm51bV9kZW55X21hYyA+IE1BWF9BQ0xfTUFDX0FERFJFU1MpCisgICAgICAgICAgICBwQ29uZmlnLT5udW1fZGVueV9tYWMgPSBNQVhfQUNMX01BQ19BRERSRVNTOworICAgICAgICBhY2xfZW50cnkgPSAoc3RydWN0IHFjX21hY19hY2xfZW50cnkgKikocEllICsgOCk7CisgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwQ29uZmlnLT5udW1fZGVueV9tYWM7IGkrKykKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwQ29uZmlnLT5kZW55X21hY1tpXSwgYWNsX2VudHJ5LT5hZGRyLCBzaXplb2YocWNtYWNhZGRyKSk7CisgICAgICAgICAgICBhY2xfZW50cnkrKzsKKyAgICAgICAgfQorICAgIH0KKyAgICBwSWUgPSB3bGFuX2hkZF9nZXRfdmVuZG9yX291aV9pZV9wdHIoV0hJVEVMSVNUX09VSV9UWVBFLCBXUEFfT1VJX1RZUEVfU0laRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJlYWNvbi0+dGFpbCwgcEJlYWNvbi0+dGFpbF9sZW4pOworCisgICAgLyogcEllIGZvciB3aGl0ZSBsaXN0IGlzIGZvbGxvd2luZyBmb3JtOgorICAgICAgICAgICAgdHlwZSAgICA6IDEgYnl0ZQorICAgICAgICAgICAgbGVuZ3RoICA6IDEgYnl0ZQorICAgICAgICAgICAgT1VJICAgICA6IDQgYnl0ZXMKKyAgICAgICAgICAgIGFjbCB0eXBlIDogMSBieXRlCisgICAgICAgICAgICBubyBvZiBtYWMgYWRkciBpbiB3aGl0ZSBsaXN0OiAxIGJ5dGUKKyAgICAgICAgICAgIGxpc3Qgb2YgbWFjX2FjbF9lbnRyaWVzOiB2YXJpYWJsZSwgNiBieXRlcyBwZXIgbWFjIGFkZHJlc3MgKyBzaXplb2YoaW50KSBmb3IgdmxhbiBpZAorICAgICovCisgICAgaWYgKChwSWUgIT0gTlVMTCkgJiYgKHBJZVsxXSAhPSAwKSkKKyAgICB7CisgICAgICAgIHBDb25maWctPlNhcE1hY2FkZHJfYWNsID0gcEllWzZdOworICAgICAgICBwQ29uZmlnLT5udW1fYWNjZXB0X21hYyAgID0gcEllWzddOworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sImFjbCB0eXBlID0gJWQgbm8gYWNjZXB0IG1hYyA9ICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllWzZdLCBwSWVbN10pOworICAgICAgICBpZiAocENvbmZp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jI0R0h6QmFuZCA9PSBGQUxTRSkKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKExPR1csIEZMKCJTZXR0aW5nIGh3bW9kZSB0byAxMW4sIG9wZXJhdGluZ0JhbmQgPSAlZCwgQ2hhbm5lbCA9ICVkIiksCisgICAgICAgICAgICAgICAgICAgIG9wZXJhdGluZ0JhbmQsIHBDb25maWctPmNoYW5uZWwpOworICAgICAgICAgICAgcENvbmZpZy0+U2FwSHdfbW9kZSA9IGVTQVBfRE9UMTFfTU9ERV8xMW47CisgICAgICAgIH0KKyAgICB9CisjZW5kaWYKKworICAgIC8vIGh0X2NhcGFiIGlzIG5vdCB3aGF0IHRoZSBuYW1lIGNvbnZleXMsdGhpcyBpcyB1c2VkIGZvciBwcm90ZWN0aW9uIGJpdG1hcAorICAgIHBDb25maWctPmh0X2NhcGFiID0KKyAgICAgICAgICAgICAgICAgKFdMQU5fSEREX0dFVF9DVFgocEhvc3RhcGRBZGFwdGVyKSktPmNmZ19pbmktPmFwUHJvdGVjdGlvbjsKKworICAgIGlmICggMCAhPSB3bGFuX2hkZF9jZmc4MDIxMV91cGRhdGVfYXBpZXMocEhvc3RhcGRBZGFwdGVyLCBwYXJhbXMpICkKKyAgICB7CisgICAgICAgIGhkZExvZyhMT0dFLCBGTCgiU0FQIE5vdCBhYmxlIHRvIHNldCBBUCBJRXMiKSk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIC8vVWFwc2QgRW5hYmxlZCBCaXQKKyAgICBwQ29uZmlnLT5VYXBzZEVuYWJsZSA9CisgICAgICAgICAgKFdMQU5fSEREX0dFVF9DVFgocEhvc3RhcGRBZGFwdGVyKSktPmNmZ19pbmktPmFwVWFwc2RFbmFibGVkOworICAgIC8vRW5hYmxlIE9CU1MgcHJvdGVjdGlvbgorICAgIHBDb25maWctPm9ic3NQcm90RW5hYmxlZCA9CisgICAgICAgICAgIChXTEFOX0hERF9HRVRfQ1RYKHBIb3N0YXBkQWRhcHRlcikpLT5jZmdfaW5pLT5hcE9CU1NQcm90RW5hYmxlZDsKKworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMVcKKyAgICBwQ29uZmlnLT5tZnBDYXBhYmxlID0gTUZQQ2FwYWJsZTsKKyAgICBwQ29uZmlnLT5tZnBSZXF1aXJlZCA9IE1GUFJlcXVpcmVkOworICAgIGhkZExvZyhMT0dXLCBGTCgiU29mdCBBUCBNRlAgY2FwYWJsZSAlZCwgTUZQIHJlcXVpcmVkICVkXG4iKSwKKyAgICAgICAgICAgcENvbmZpZy0+bWZwQ2FwYWJsZSwgcENvbmZpZy0+bWZwUmVxdWlyZWQpOworI2VuZGlmCisKKyAgICBoZGRMb2coTE9HVywgRkwoIlNPZnRBUCBtYWNhZGRyZXNzIDogIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBIb3N0YXBkQWRhcHRlci0+bWFjQWRkcmVzc0N1cnJlbnQuYnl0ZXMpKTsKKyAgICBoZGRMb2coTE9HVyxGTCgic3NpZCA9JXMsIGJlYWNvbmludD0lZCwgY2hhbm5lbD0lZCIpLAorICAgICAgICAgICAgICAgICAgIHBDb25maWctPlNTSURpbmZvLnNzaWQuc3NJZCwgKGludClwQ29uZmlnLT5iZWFjb25faW50LAorICAgICAgICAgICAgICAgICAgICAoaW50KXBDb25maWctPmNoYW5uZWwpOworICAgIGhkZExvZyhMT0dXLEZMKCJod19tb2RlPSV4LCBwcml2YWN5PSVkLCBhdXRoVHlwZT0lZCIpLAorICAgICAgICAgICAgICAgICAgIHBDb25maWctPlNhcEh3X21vZGUsIHBDb25maWctPnByaXZhY3ksCisgICAgICAgICAgICAgICAgICAgcENvbmZpZy0+YXV0aFR5cGUpOworICAgIGhkZExvZyhMT0dXLEZMKCJSU04vV1BBTGVuPSVkLCBVYXBzZCA9ICVkIiksCisgICAgICAgICAgICAgICAgICAgKGludClwQ29uZmlnLT5SU05XUEFSZXFJRUxlbmd0a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RFRCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgICBnbG9iYWxQMlBDb25uZWN0aW9uU3RhdHVzID0gUDJQX0dPX0NPTVBMRVRFRF9TVEFURTsKKyAgICAgICAgICAgICBoZGRMb2coTE9HRSwiW1AyUCBTdGF0ZV0gRnJvbSBHbyBuZWdvIGNvbXBsZXRlZCB0byAiCisgICAgICAgICAgICAgICAgICAgICAgICAgIk5vbi1hdXRvbm9tb3VzIEdyb3VwIHN0YXJ0ZWQiKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UgaWYoZ2xvYmFsUDJQQ29ubmVjdGlvblN0YXR1cyA9PSBQMlBfTk9UX0FDVElWRSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgICBnbG9iYWxQMlBDb25uZWN0aW9uU3RhdHVzID0gUDJQX0dPX0NPTVBMRVRFRF9TVEFURTsKKyAgICAgICAgICAgICBoZGRMb2coTE9HRSwiW1AyUCBTdGF0ZV0gRnJvbSBJbmFjdGl2ZSB0byAiCisgICAgICAgICAgICAgICAgICAgICAgICAgIkF1dG9ub21vdXMgR3JvdXAgc3RhcnRlZCIpOworICAgICAgICAgfQorICAgIH0KKyNlbmRpZgorCisgICAgcEhvc3RhcGRTdGF0ZS0+YkNvbW1pdCA9IFRSVUU7CisgICAgRVhJVCgpOworCisgICByZXR1cm4gMDsKK30KKworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPCBLRVJORUxfVkVSU0lPTigzLDQsMCkpCitzdGF0aWMgaW50IF9fd2xhbl9oZGRfY2ZnODAyMTFfYWRkX2JlYWNvbihzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGJlYWNvbl9wYXJhbWV0ZXJzICpwYXJhbXMpCit7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgPSAgV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaGRkX2NvbnRleHRfdCAgKnBIZGRDdHg7CisgICAgaW50IHN0YXR1czsKKworICAgIEVOVEVSKCk7CisKKyAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfSERELAorICAgICAgICAgICAgICAgICAgICAgVFJBQ0VfQ09ERV9IRERfQ0ZHODAyMTFfQUREX0JFQUNPTiwKKyAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsIHBhcmFtcy0+aW50ZXJ2YWwpKTsKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgImRldmljZSBtb2RlPSVzICglZCkiLAorICAgICAgICAgICBoZGRfZGV2aWNlX21vZGV0b1N0cmluZyhwQWRhcHRlci0+ZGV2aWNlX21vZGUpLAorICAgICAgICAgICBwQWRhcHRlci0+ZGV2aWNlX21vZGUpOworCisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIHN0YXR1cyA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gc3RhdHVzKQorICAgIHsKKyAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICB9CisKKyAgICBpZiAodm9zX21heF9jb25jdXJyZW50X2Nvbm5lY3Rpb25zX3JlYWNoZWQoKSkgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sIEZMKCJSZWFjaGVkIG1heCBjb25jdXJyZW50IGNvbm5lY3Rpb25zIikpOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBpZiAoIChwQWRhcHRlci0+ZGV2aWNlX21vZGUgPT0gV0xBTl9IRERfU09GVEFQKQorICAgICAgfHwgKHBBZGFwdGVyLT5kZXZpY2VfbW9kZSA9PSBXTEFOX0hERF9QMlBfR08pCisgICAgICAgKQorICAgIHsKKyAgICAgICAgYmVhY29uX2RhdGFfdCAqb2xkLCpuZXc7CisKKyAgICAgICAgb2xkID0gcEFkYXB0ZXItPnNlc3Npb25DdHguYXAuYmVhY29uOworCisgICAgICAgIGlmIChvbGQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgICAgICBGTCgiYWxyZWFkeSBiZWFjb24gaW5mbyBhZGRlZCB0byBzZXNzaW9uKCVkKSIpLAorICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkKTsKKyAgICAgICAgICAgIHJldHVybiAtRUFMUkVBRFk7CisgICAgICAgIH0KKworICAgICAgICBzdGF0dXMgPSB3bGFuX2hkZF9jZmc4MDIxMV9hbGxvY19uZXdfYmVhY29uKHBBZGFwdGVyLCZuZXcscGFyYW1zKTsKKworICAgICAgICBpZihzdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAiJXM6RXJyb3IhISEgQWxsb2NhdGluZyB0aGUgbmV3IGJlYWNvbiIsX19mdW5jX18pOworICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICB9CisKKyAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25DdHguYXAuYmVhY29uID0gbmV3OworCisgICAgICAgIHN0YXR1cyA9IHdsYW5faGRkX2NmZzgwMjExX3N0YXJ0X2JzcyhwQWRhcHRlciwgcGFyYW1zKTsKKyAgICB9CisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIHN0YXR1czsKK30KKworc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV9hZGRfYmVhY29uKHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgYmVhY29uX3BhcmFtZXRlcnMgKnBhcmFtcykKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX3dsYW5faGRkX2NmZzgwMjExX2FkZF9iZWFjb24od2lwaHksIGRldiwgcGFyYW1zKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IF9fd2xhbl9oZGRfY2ZnODAyMTFfc2V0X2JlYWNvbihzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGJlYWNvbl9wYXJhbWV0ZXJzICpwYXJhbXMpCit7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgPSAgV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKyAgICBoZGRfY29udGV4dF90ICAqcEhkZEN0eDsKKyAgICBpbnQgc3RhdHVzOworCisgICAgRU5URVIoKTsKKworICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9IREQsCisgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX0hERF9DRkc4MDIxMV9TRVRfQkVBQ09OLAorICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmF1dGhUeXBlKSk7CisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXM6IGRldmljZV9tb2RlID0gJXMgKCVkKSIsCisgICAgICAgICAgIF9fZnVuY19fLCBoZGRfZGV2aWNlX21vZGV0b1N0cmluZyhwQWRhcHRlci0+ZGV2aWNlX21vZGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPmRldmljZV9tb2RlKTsKKworICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICBzdGF0dXMgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHN0YXR1cykKKyAgICB7CisgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgfQorCisgICAgaWYgKChwQWRhcHRlci0+ZGV2aWNlX21vZGUgPT0gV0xBTl9IRERfU09GVEFQKQorICAgICB8fCAocEFkYXB0ZXItPmRldmljZV9tb2RlID09IFdMQU5fSEREX1AyUF9HTykKKyAgICAgICApCisgICAgeworICAgICAgICBiZWFjb25fZGF0YV90ICpvbGQsKm5ldzsKKworICAgICAgICBvbGQgPSBwQWRhcHRlci0+c2Vzc2lvbkN0eC5hcC5iZWFjb247CisKKyAgICAgICAgaWYgKCFvbGQpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICBGTCgic2Vzc2lvbiglZCkgb2xkIGFuZCBuZXcgaGVhZHMgcG9pbnRzIHRvIE5VTEwiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCk7CisgICAgICAgICAgICByZXR1cm4gLUVOT0VOVDsKKyAgICAgICAgfQorCisgICAgICAgIHN0YXR1cyA9IHdsYW5faGRkX2NmZzgwMjExX2FsbG9jX25ld19iZWFjb24ocEFkYXB0ZXIsJm5ldyxwYXJhbXMpOworCisgICAgICAgIGlmKHN0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpIHsKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgIiVzOiBFcnJvciEhISBBbGxvY2F0aW5nIHRoZSBuZXcgYmVhY29uIixfX2Z1bmNfXyk7CisgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICB9CisKKyAgICAgICBwQWRhcHRlci0+c2Vzc2lvbkN0eC5hcC5iZWFjb24gPSBuZXc7CisKKyAgICAgICBzdGF0dXMgPSB3bGFuX2hkZF9jZmc4MDIxMV9zdGFydF9ic3MocEFkYXB0ZXIsIHBhcmFtcyk7CisgICAgfQorCisgICAgRVhJVCgpOworICAgIHJldHVybiBzdGF0dXM7Cit9CisKK3N0YXRpYyBpbnQgd2xhbl9oZGRfY2ZnODAyMTFfc2V0X2JlYWNvbihzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGJlYWNvbl9wYXJhbWV0ZXJzICpwYXJhbXMpCit7CisgICAgaW50IHJldDsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX193bGFuX2hkZF9jZmc4MDIxMV9zZXRfYmVhY29uKHdpcGh5LCBkZXYsIHBhcmFtcyk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworI2VuZGlmIC8vKExJTlVYX1ZFUlNJT05fQ09ERSA8IEtFUk5FTF9WRVJTSU9OKDMsNCwwKSkKKworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPCBLRVJORUxfVkVSU0lPTigzLDQsMCkpCitzdGF0aWMgaW50IF9fd2xhbl9oZGRfY2ZnODAyMTFfZGVsX2JlYWNvbihzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCisjZWxzZQorc3RhdGljIGludCBfX3dsYW5faGRkX2NmZzgwMjExX3N0b3BfYXAgKHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCisjZW5kaWYKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciA9ICBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgICBoZGRfY29udGV4dF90ICAqcEhkZEN0eCAgICA9IE5VTEw7CisgICAgaGRkX3NjYW5pbmZvX3QgKnBTY2FuSW5mbyAgPSBOVUxMOworICAgIFZPU19TVEFUVVMgc3RhdHVzOworICAgIGxvbmcgcmV0OworCisgICAgRU5URVIoKTsKKworICAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICIlczogSEREIGFkYXB0ZXIgY29udGV4dCBpcyBOdWxsIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVOT0RFVjsKKyAgICB9CisKKyAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfSERELAorICAgICAgICAgICAgICAgICAgICAgVFJBQ0VfQ09ERV9IRERfQ0ZHODAyMTFfU1RPUF9BUCwKKyAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkpOworICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICBzdGF0dXMgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHN0YXR1cykKKyAgICB7CisgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgfQorCisgICAgcFNjYW5JbmZvID0gICZwSGRkQ3R4LT5zY2FuX2luZm87CisKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczogZGV2aWNlX21vZGUgPSAlcyAoJWQpIiwKKyAgICAgICAgICAgX19mdW5jX18sIGhkZF9kZXZpY2VfbW9kZXRvU3RyaW5nKHBBZGFwdGVyLT5kZXZpY2VfbW9kZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+ZGV2aWNlX21vZGUpOworCisgICAgcmV0ID0gd2xhbl9oZGRfc2Nhbl9hYm9ydChwQWRhcHRlcik7CisKKyAgICBpZiAocmV0IDwgMCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICBGTCgiVGltZW91dCBvY2N1cnJlZCB3aGlsZSB3YWl0aW5nIGZvciBhYm9ydHNjYW4gJWxkIiksIHJldCk7CisKKyAgICAgICAgaWYgKHBIZGRDdHgtPmlzTG9ncEluUHJvZ3Jlc3MpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICIlczogTE9HUCBpbiBQcm9ncmVzcy4gSWdub3JlISEhIiwgX19mdW5jX18pOworCisgICAgICAgICAgICBWT1NfQVNTRVJUKHBTY2FuSW5mby0+bVNjYW5QZW5kaW5nKTsKKyAgICAgICAgICAgIHJldHVybiAtRUFHQUlOOworICAgICAgICB9CisgICAgICAgIFZPU19BU1NFUlQocFNjYW5JbmZvLT5tU2NhblBlbmRpbmcpOworICAgIH0KKworICAgIC8qIERlbGV0ZSBhbGwgYXNzb2NpYXRlZCBTVEFzIGJlZm9yZSBzdG9wcGluZyBBUC9QMlAgR08gKi8KKyAgICBoZGRfZGVsX2FsbF9zdGEocEFkYXB0ZXIpOworICAgIGhkZF9ob3N0YXBkX3N0b3AoZGV2KTsKKworICAgIGlmICgocEFkYXB0ZXItPmRldmljZV9tb2RlID09IFdMQU5fSEREX1NPRlRBUCkKKyAgICAgfHwgKHBBZGFwdGVyLT5kZXZpY2VfbW9kZSA9PSBXTEFOX0hERF9QMlBfR08pCisgICAgICAgKQorICAgIHsKKyAgICAgICAgYmVhY29uX2RhdGFfdCAqb2xkOworCisgICAgICAgIG9sZCA9IHBBZGFwdGVyLT5zZXNzaW9uQ3R4LmFwLmJlYWNvbjsKKworICAgICAgICBpZiAoIW9sZCkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIEZMKCJzZXNzaW9uKCVkKSBiZWFjb24gZGF0YSBwb2ludHMgdG8gTlVMTCIpLAorICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQpOworICAgICAgICAgICAgcmV0dXJuIC1FTk9FTlQ7CisgICAgICAgIH0KKworICAgICAgICBoZGRfY2xlYW51cF9hY3Rpb25mcmFtZShwSGRkQ3R4LCBwQWRhcHRlcik7CisKKyAgICAgICAgbXV0ZXhfbG9jaygmcEhkZEN0eC0+c2FwX2xvY2spOworICAgICAgICBpZih0ZXN0X2JpdChTT0ZUQVBfQlNTX1NUQVJURUQsICZwQWRhcHRlci0+ZXZlbnRfZmxhZ3MpKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoIFZPU19TVEFUVVNfU1VDQ0VTUyA9PSAoc3RhdHVzID0gV0xBTlNBUF9TdG9wQnNzKHBIZGRDdHgtPnB2b3NDb250ZXh0KSApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRfaG9zdGFwZF9zdGF0ZV90ICpwSG9zdGFwZFN0YXRlID0gV0xBTl9IRERfR0VUX0hPU1RBUF9TVEFURV9QVFIocEFkYXB0ZXIpOworCisgICAgICAgICAgICAgICAgc3RhdHVzID0gdm9zX3dhaXRfc2luZ2xlX2V2ZW50KCZwSG9zdGFwZFN0YXRlLT52b3NFdmVudCwgMTAwMDApOworCisgICAgICAgICAgICAgICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIkVSUk9SOiBIREQgdm9zIHdhaXQgZm9yIHNpbmdsZV9ldmVudCBmYWlsZWQhISIpKTsKKyAgICAgICAgICAgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGNsZWFyX2JpdChTT0ZUQVBfQlNTX1NUQVJURUQsICZwQWRhcHRlci0+ZXZlbnRfZmxhZ3MpOworICAgICAgICAgICAgLyogQlNTIHN0b3BwZWQsIGNsZWFyIHRoZSBhY3RpdmUgc2Vzc2lvbnMgZm9yIHRoaXMgZGV2aWNlIG1vZGUgKi8KKyAgICAgICAgICAgIHdsYW5faGRkX2RlY3JfYWN0aXZlX3Nlc3Npb24ocEhkZEN0eCwgcEFkYXB0ZXItPmRldmljZV9tb2RlKTsKKyAgICAgICAgfQorICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnNhcF9sb2NrKTsKKworICAgICAgICBpZihzdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICAiJXM6RXJyb3IhISEgU3RvcHBpbmcgdGhlIEJTUyIsX19mdW5jX18pOworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgIH0KKworICAgICAgICBpZiAoY2NtQ2ZnU2V0SW50KHBIZGRDdHgtPmhIYWwsCisgICAgICAgICAgICBXTklfQ0ZHX1BST0JFX1JTUF9CQ05fQURETklFX0ZMQUcsIDAsTlVMTCwgZUFOSV9CT09MRUFOX0ZBTFNFKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09ZUhBTF9TVEFUVVNfRkFJTFVSRSkKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKExPR0UsCisgICAgICAgICAgICAgICAiQ291bGQgbm90IHBhc3Mgb24gV05JX0NGR19QUk9CRV9SU1BfQkNOX0FERE5JRV9GTEFHIHRvIENDTSIpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCBlSEFMX1NUQVRVU19GQUlMVVJFID09IGNjbUNmZ1NldEludChwSGRkQ3R4LT5oSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfQVNTT0NfUlNQX0FERE5JRV9GTEFHLCAwLCBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVBTklfQk9PTEVBTl9GQUxTRSkgKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coTE9HRSwKKyAgICAgICAgICAgICAgICJDb3VsZCBub3QgcGFzcyBvbiBXTklfQ0ZHX0FTU09DX1JTUF9BREROSUVfRkxBRyB0byBDQ00iKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIFJlc2V0IFdOSV9DRkdfUFJPQkVfUlNQIEZsYWdzCisgICAgICAgIHdsYW5faGRkX3Jlc2V0X3Byb2JfcnNwaWVzKHBBZGFwdGVyKTsKKworICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbkN0eC5hcC5iZWFjb24gPSBOVUxMOworICAgICAgICBrZnJlZShvbGQpOworI2lmZGVmIFdMQU5fRkVBVFVSRV9QMlBfREVCVUcKKyAgICAgICAgaWYoKHBBZGFwdGVyLT5kZXZpY2VfbW9kZSA9PSBXTEFOX0hERF9QMlBfR08pICYmCisgICAgICAgICAgIChnbG9iYWxQMlBDb25uZWN0aW9uU3RhdHVzID09IFAyUF9HT19DT01QTEVURURfU1RBVEUpKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coTE9HRSwiW1AyUCBTdGF0ZV0gRnJvbSBHTyBjb21wbGV0ZWQgdG8gSW5hY3RpdmUgc3RhdGUgIgorICAgICAgICAgICAgICAgICAgICAgICAgIkdPIGdvdCByZW1vdmVkIik7CisgICAgICAgICAgICBnbG9iYWxQMlBDb25uZWN0aW9uU3RhdHVzID0gUDJQX05PVF9BQ1RJVkU7CisgICAgICAgIH0KKyNlbmRpZgorICAgIH0KKyAgICBFWElUKCk7CisgICAgcmV0dXJuIHN0YXR1czsKK30KKworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPCBLRVJORUxfVkVSU0lPTigzLDQsMCkpCitzdGF0aWMgaW50IHdsYW5faGRkX2NmZzgwMjExX2RlbF9iZWFjb24oc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9fd2xhbl9oZGRfY2ZnODAyMTFfZGVsX2JlYWNvbih3aXBoeSwgZGV2KTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorI2Vsc2UKK3N0YXRpYyBpbnQgd2xhbl9oZGRfY2ZnODAyMTFfc3RvcF9hcChzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9fd2xhbl9oZGRfY2ZnODAyMTFfc3RvcF9hcCh3aXBoeSwgZGV2KTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorI2VuZGlmCisKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID4gS0VSTkVMX1ZFUlNJT04oMywzLDApKQorCitzdGF0aWMgaW50IF9fd2xhbl9oZGRfY2ZnODAyMTFfc3RhcnRfYXAoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGNmZzgwMjExX2FwX3NldHRpbmdzICpwYXJhbXMpCit7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXI7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgICBpbnQgICAgICAgICAgICBzdGF0dXM7CisKKyAgICBFTlRFUigpOworCisgICAgaWYgKE5VTEwgPT0gZGV2IHx8IE5VTEwgPT0gcGFyYW1zKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICIlczogRGV2aWNlIG9yIHBhcmFtcyBpcyBOdWxsIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVOT0RFVjsKKyAgICB9CisKKyAgICBwQWRhcHRlciA9IFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICIlczogSEREIGFkYXB0ZXIgaXMgTnVsbCIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FTk9ERVY7CisgICAgfQorCisgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX0hERCwKKyAgICAgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfSEREX0NGRzgwMjExX1NUQVJUX0FQLCBwQWRhcHRlci0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLT4gYmVhY29uX2ludGVydmFsKSk7CisgICAgaWYgKFdMQU5fSEREX0FEQVBURVJfTUFHSUMgIT0gcEFkYXB0ZXItPm1hZ2ljKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICIlczogSEREIGFkYXB0ZXIgbWFnaWMgaXMgaW52YWxpZCIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FTk9ERVY7CisgICAgfQorCisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIHN0YXR1cyA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gc3RhdHVzKQorICAgIHsKKyAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICB9CisKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIiVzOiBkZXZpY2UgbW9kZSA9ICVzICglZCkiLAorICAgICAgICAgICBfX2Z1bmNfXywgaGRkX2RldmljZV9tb2RldG9TdHJpbmcocEFkYXB0ZXItPmRldmljZV9tb2RlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSk7CisKKyAgICBpZiAoKHBBZGFwdGVyLT5kZXZpY2VfbW9kZSA9PSBXTEFOX0hERF9TT0ZUQVApCisgICAgICB8fCAocEFkYXB0ZXItPmRldmljZV9tb2RlID09IFdMQU5fSEREX1AyUF9HTykKKyAgICAgICApCisgICAgeworICAgICAgICBiZWFjb25fZGF0YV90ICAqb2xkLCAqbmV3OworCisgICAgICAgIG9sZCA9IHBBZGFwdGVyLT5zZXNzaW9uQ3R4LmFwLmJlYWNvbjsKKworICAgICAgICBpZiAob2xkKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgICAgICBGTCgiYWxyZWFkeSBiZWFjb24gaW5mbyBhZGRlZCB0byBzZXNzaW9uKCVkKSIpLAorICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkKTsKKyAgICAgICAgICAgIHJldHVybiAtRUFMUkVBRFk7CisgICAgICAgIH0KKworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPCBLRVJORUxfVkVSU0lPTigzLDQsMCkpCisgICAgICAgIHN0YXR1cyA9IHdsYW5faGRkX2NmZzgwMjExX2FsbG9jX25ld19iZWFjb24ocEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm5ldywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcGFyYW1zLT5iZWFjb24pOworI2Vsc2UKKyAgICAgICAgc3RhdHVzID0gd2xhbl9oZGRfY2ZnODAyMTFfYWxsb2NfbmV3X2JlYWNvbihwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbmV3LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwYXJhbXMtPmJlYWNvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMtPmR0aW1fcGVyaW9kKTsKKyNlbmRpZgorCisgICAgICAgIGlmIChzdGF0dXMgIT0gMCkKKyAgICAgICAgeworICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgIiVzOkVycm9yISEhIEFsbG9jYXRpbmcgdGhlIG5ldyBiZWFjb24iLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgIH0KKyAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25DdHguYXAuYmVhY29uID0gbmV3OworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMyw2LDApKQorICAgICAgICB3bGFuX2hkZF9jZmc4MDIxMV9zZXRfY2hhbm5lbCh3aXBoeSwgZGV2LAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPCBLRVJORUxfVkVSU0lPTigzLDgsMCkpCisgICAgICAgIHBhcmFtcy0+Y2hhbm5lbCwgcGFyYW1zLT5jaGFubmVsX3R5cGUpOworI2Vsc2UKKyAgICAgICAgcGFyYW1zLT5jaGFuZGVmLmNoYW4sIGNmZzgwMjExX2dldF9jaGFuZGVmX3R5cGUoJihwYXJhbXMtPmNoYW5kZWYpKSk7CisjZW5kaWYKKyNlbmRpZgorICAgICAgICBzdGF0dXMgPSB3bGFuX2hkZF9jZmc4MDIxMV9zdGFydF9ic3MocEFkYXB0ZXIsICZwYXJhbXMtPmJlYWNvbiwgcGFyYW1zLT5zc2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLT5zc2lkX2xlbiwgcGFyYW1zLT5oaWRkZW5fc3NpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy0+YXV0aF90eXBlKTsKKyAgICB9CisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIHN0YXR1czsKK30KKworc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV9zdGFydF9hcChzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgY2ZnODAyMTFfYXBfc2V0dGluZ3MgKnBhcmFtcykKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX3dsYW5faGRkX2NmZzgwMjExX3N0YXJ0X2FwKHdpcGh5LCBkZXYsIHBhcmFtcyk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBfX3dsYW5faGRkX2NmZzgwMjExX2NoYW5nZV9iZWFjb24oc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBjZmc4MDIxMV9iZWFjb25fZGF0YSAqcGFyYW1zKQoreworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyID0gIFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgaW50IHN0YXR1czsKKworICAgIEVOVEVSKCk7CisKKyAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfSERELAorICAgICAgICAgICAgICAgICAgICAgVFJBQ0VfQ09ERV9IRERfQ0ZHODAyMTFfQ0hBTkdFX0JFQUNPTiwKKyAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkpOworICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIiVzOiBkZXZpY2VfbW9kZSA9ICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSk7CisKKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgc3RhdHVzID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSBzdGF0dXMpCisgICAgeworICAgICAgICByZXR1cm4gc3RhdHVzOworICAgIH0KKworICAgIGlmICgocEFkYXB0ZXItPmRldmljZV9tb2RlID09IFdMQU5fSEREX1NPRlRBUCkKKyAgICAgfHwgKHBBZGFwdGVyLT5kZXZpY2VfbW9kZSA9PSBXTEFOX0hERF9QMlBfR08pCisgICAgICAgKQorICAgIHsKKyAgICAgICAgYmVhY29uX2RhdGFfdCAqb2xkLCpuZXc7CisKKyAgICAgICAgb2xkID0gcEFkYXB0ZXItPnNlc3Npb25DdHguYXAuYmVhY29uOworCisgICAgICAgIGlmICghb2xkKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgRkwoInNlc3Npb24oJWQpIGJlYWNvbiBkYXRhIHBvaW50cyB0byBOVUxMIiksCisgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCk7CisgICAgICAgICAgICByZXR1cm4gLUVOT0VOVDsKKyAgICAgICAgfQorCisgICAgICAgIHN0YXR1cyA9IHdsYW5faGRkX2NmZzgwMjExX2FsbG9jX25ld19iZWFjb24ocEFkYXB0ZXIsICZuZXcsIHBhcmFtcywgMCk7CisKKyAgICAgICAgaWYoc3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUykgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAiJXM6IEVycm9yISEhIEFsbG9jYXRpbmcgdGhlIG5ldyBiZWFjb24iLF9fZnVuY19fKTsKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgIH0KKworICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uQ3R4LmFwLmJlYWNvbiA9IG5ldzsKKworICAgICAgIHN0YXR1cyA9IHdsYW5faGRkX2NmZzgwMjExX3N0YXJ0X2JzcyhwQWRhcHRlciwgcGFyYW1zLCBOVUxMLCAwLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbkN0eC5hcC5zYXBDb25maWcuYXV0aFR5cGUpOworICAgIH0KKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gc3RhdHVzOworfQorCitzdGF0aWMgaW50IHdsYW5faGRkX2NmZzgwMjExX2NoYW5nZV9iZWFjb24oc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBjZmc4MDIxMV9iZWFjb25fZGF0YSAqcGFyYW1zKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9fd2xhbl9oZGRfY2ZnODAyMTFfY2hhbmdlX2JlYWNvbih3aXBoeSwgZGV2LCBwYXJhbXMpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKKyNlbmRpZiAvLyhMSU5VWF9WRVJTSU9OX0NPREUgPiBLRVJORUxfVkVSU0lPTigzLDMsMCkpCisKK3N0YXRpYyBpbnQgX193bGFuX2hkZF9jZmc4MDIxMV9jaGFuZ2VfYnNzIChzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgYnNzX3BhcmFtZXRlcnMgKnBhcmFtcykKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciA9ICBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgIGludCByZXQgPSAwOworCisgICAgRU5URVIoKTsKKworICAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICIlczogSEREIGFkYXB0ZXIgaXMgTnVsbCIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FTk9ERVY7CisgICAgfQorICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHJldCkKKyAgICB7CisgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9IREQsCisgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX0hERF9DRkc4MDIxMV9DSEFOR0VfQlNTLAorICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwgcGFyYW1zLT5hcF9pc29sYXRlKSk7CisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXM6IGRldmljZV9tb2RlID0gJXMgKCVkKSIsCisgICAgICAgICAgIF9fZnVuY19fLCBoZGRfZGV2aWNlX21vZGV0b1N0cmluZyhwQWRhcHRlci0+ZGV2aWNlX21vZGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPmRldmljZV9tb2RlKTsKKworICAgIGlmKChwQWRhcHRlci0+ZGV2aWNlX21vZGUgPT0gV0xBTl9IRERfU09GVEFQKQorICAgICB8fCAgKHBBZGFwdGVyLT5kZXZpY2VfbW9kZSA9PSBXTEFOX0hERF9QMlBfR08pCisgICAgICApCisgICAgeworICAgICAgICAvKiBhcF9pc29sYXRlID09IC0xIG1lYW5zIHRoYXQgaW4gY2hhbmdlIGJzcywgdXBwZXIgbGF5ZXIgZG9lc24ndAorICAgICAgICAgKiB3YW50IHRvIHVwZGF0ZSB0aGlzIHBhcmFtZXRlciAqLworICAgICAgICBpZiAoLTEgIT0gcGFyYW1zLT5hcF9pc29sYXRlKQorICAgICAgICB7CisgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbkN0eC5hcC5hcERpc2FibGVJbnRyYUJzc0Z3ZCA9ICEhcGFyYW1zLT5hcF9pc29sYXRlOworICAgICAgICB9CisgICAgfQorCisgICAgRVhJVCgpOworICAgIHJldHVybiAwOworfQorCitzdGF0aWMgaW50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ICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKm5kZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG5sODAyMTFfaWZ0eXBlIHR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MzIgKmZsYWdzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHZpZl9wYXJhbXMgKnBhcmFtcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKK3sKKyAgICBzdHJ1Y3Qgd2lyZWxlc3NfZGV2ICp3ZGV2OworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKCBuZGV2ICk7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgICBoZGRfYWRhcHRlcl90ICAqcFAycEFkYXB0ZXIgPSBOVUxMOworICAgIHRDc3JSb2FtUHJvZmlsZSAqcFJvYW1Qcm9maWxlID0gTlVMTDsKKyAgICBlQ3NyUm9hbUJzc1R5cGUgTGFzdEJTU1R5cGU7CisgICAgaGRkX2NvbmZpZ190ICpwQ29uZmlnID0gTlVMTDsKKyAgICBlTWliX2RvdDExRGVzaXJlZEJzc1R5cGUgY29ubmVjdGVkQnNzVHlwZTsKKyAgICBWT1NfU1RBVFVTIHN0YXR1czsKKyAgICBsb25nIHJldDsKKworICAgIEVOVEVSKCk7CisKKyAgIGlmICghcEFkYXB0ZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogQWRhcHRlciBjb250ZXh0IGlzIG51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICB9CisKKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgaWYgKCFwSGRkQ3R4KQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEhERCBjb250ZXh0IGlzIG51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICB9CisKKyAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfSERELAorICAgICAgICAgICAgICAgICAgICAgVFJBQ0VfQ09ERV9IRERfQ0ZHODAyMTFfQ0hBTkdFX0lGQUNFLAorICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwgdHlwZSkpOworICAgIHN0YXR1cyA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gc3RhdHVzKQorICAgIHsKKyAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICB9CisKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczogZGV2aWNlX21vZGUgPSAlcyAoJWQpIiwKKyAgICAgICAgICAgIF9fZnVuY19fLCBoZGRfZGV2aWNlX21vZGV0b1N0cmluZyhwQWRhcHRlci0+ZGV2aWNlX21vZGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSk7CisKKyAgICBpZiAodm9zX21heF9jb25jdXJyZW50X2Nvbm5lY3Rpb25zX3JlYWNoZWQoKSkgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sIEZMKCJSZWFjaGVkIG1heCBjb25jdXJyZW50IGNvbm5lY3Rpb25zIikpOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9C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VWSUNFKSAmJgorICAgICAgICAoKHR5cGUgPT0gTkw4MDIxMV9JRlRZUEVfUDJQX0NMSUVOVCkgfHwKKyAgICAgICAgICh0eXBlID09IE5MODAyMTFfSUZUWVBFX1AyUF9HTykpKQorICAgIHsKKyAgICAgICAgLyogTm90aWZ5IE1vZGUgY2hhbmdlIGluIGNhc2Ugb2YgY29uY3VycmVuY3kuCisgICAgICAgICAqIEJlbG93IGZ1bmN0aW9uIGludm9rZXMgVERMUyB0ZWFyZG93biBGdW5jdGlvbmFsaXR5IFNpbmNlIFRETFMgaXMKKyAgICAgICAgICogbm90IFN1cHBvcnRlZCBpbiBjYXNlIG9mIGNvbmN1cnJlbmN5IGkuZSBPbmNlIFAyUCBzZXNzaW9uCisgICAgICAgICAqIGlzIGRldGVjdGVkIGRpc2FibGUgb2ZmY2hhbm5lbCBhbmQgdGVhcmRvd24gVERMUyBsaW5rcworICAgICAgICAgKi8KKyAgICAgICAgaGRkTG9nKExPRzEsCisgICAgICAgICAgICAgICBGTCgiRGV2aWNlIG1vZGUgPSAlZCBJbnRlcmZhY2UgdHlwZSA9ICVkIiksCisgICAgICAgICAgICAgICBwQWRhcHRlci0+ZGV2aWNlX21vZGUsIHR5cGUpOworICAgICAgICBoZGRfdGRsc19ub3RpZnlfbW9kZV9jaGFuZ2UocEFkYXB0ZXIsIHBIZGRDdHgpOworICAgIH0KKworICAgIGlmKCAocEFkYXB0ZXItPmRldmljZV9tb2RlID09IFdMQU5fSEREX0lORlJBX1NUQVRJT04pCisgICAgICB8fCAocEFkYXB0ZXItPmRldmljZV9tb2RlID09IFdMQU5fSEREX1AyUF9DTElFTlQpCisgICAgICB8fCAocEFkYXB0ZXItPmRldmljZV9tb2RlID09IFdMQU5fSEREX1AyUF9ERVZJQ0UpCisgICAgICApCisgICAgeworICAgICAgICBoZGRfd2V4dF9zdGF0ZV90ICpwV2V4dFN0YXRlID0gV0xBTl9IRERfR0VUX1dFWFRfU1RBVEVfUFRSKHBBZGFwdGVyKTsKKyAgICAgICAgaWYgKCFwV2V4dFN0YXRlKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IHBXZXh0U3RhdGUgaXMgbnVsbCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICAgICAgfQorICAgICAgICBwUm9hbVByb2ZpbGUgPSAmcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGU7CisgICAgICAgIExhc3RCU1NUeXBlID0gcFJvYW1Qcm9maWxlLT5CU1NUeXBlOworCisgICAgICAgIHN3aXRjaCAodHlwZSkKKyAgICAgICAgeworICAgICAgICAgICAgY2FzZSBOTDgwMjExX0lGVFlQRV9TVEFUSU9OOgorICAgICAgICAgICAgY2FzZSBOTDgwMjExX0lGVFlQRV9QMlBfQ0xJRU5UOgorICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAiJXM6IHNldHRpbmcgaW50ZXJmYWNlIFR5cGUgdG8gSU5GUkFTVFJVQ1RVUkUiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgcFJvYW1Qcm9maWxlLT5CU1NUeXBlID0gZUNTUl9CU1NfVFlQRV9JTkZSQVNUUlVDVFVSRTsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgICAgICAgICAgICAgIGlmKHBDb25maWctPmRvdDExTW9kZSA9PSBlSEREX0RPVDExX01PREVfQVVUTykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBDb25maWctPmRvdDExTW9kZSA9IGVIRERfRE9UMTFfTU9ERV8xMWFjOworICAgICAgICAgICAgICAgIH0KKyNlbmRpZgorICAgICAgICAgICAgICAgIHBSb2FtUHJvZmlsZS0+cGh5TW9kZSA9CisgICAgICAgICAgICAgICAgaGRkX2NmZ194bGF0ZV90b19jc3JfcGh5X21vZGUocENvbmZpZy0+ZG90MTFNb2RlKTsKKyAgICAgICAgICAgICAgICB3ZGV2LT5pZnR5cGUgPSB0eXBlOworICAgICAgICAgICAgICAgIC8vQ2hlY2sgZm9yIHN1Yi1zdHJpbmcgcDJwIHRvIGNvbmZpcm0gaXRzIGEgcDJwIGludGVyZmFjZQorICAgICAgICAgICAgICAgIGlmIChOVUxMICE9IHN0cnN0cihuZGV2LT5uYW1lLCJwMnAiKSkKKyAgICAgICAgICAgICAgICB7CisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICAgICAgICAgICAgICAgICBtdXRleF9sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgICAgICAgICAgICAgICAgIHdsYW5faGRkX3RkbHNfZXhpdChwQWRhcHRlciwgVFJVRSk7CisgICAgICAgICAgICAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworI2VuZGlmCisgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSA9ICh0eXBlID09IE5MODAyMTFfSUZUWVBFX1NUQVRJT04pID8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9IRERfUDJQX0RFVklDRSA6IFdMQU5fSEREX1AyUF9DTElFTlQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSA9ICh0eXBlID09IE5MODAyMTFfSUZUWVBFX1NUQVRJT04pID8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9IRERfSU5GUkFfU1RBVElPTjogV0xBTl9IRERfUDJQX0NMSUVOVDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgTkw4MDIxMV9JRlRZUEVfQURIT0M6CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgIiVzOiBzZXR0aW5nIGludGVyZmFjZSBUeXBlIHRvIEFESE9DIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgIHBSb2FtUHJvZmlsZS0+QlNTVHlwZSA9IGVDU1JfQlNTX1RZUEVfU1RBUlRfSUJTUzsKKyAgICAgICAgICAgICAgICBwUm9hbVByb2ZpbGUtPnBoeU1vZGUgPQorICAgICAgICAgICAgICAgICAgICBoZGRfY2ZnX3hsYXRlX3RvX2Nzcl9waHlfbW9kZShwQ29uZmlnLT5kb3QxMU1vZGUpOworICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSA9IFdMQU5fSEREX0lCU1M7CisgICAgICAgICAgICAgICAgd2Rldi0+aWZ0eXBlID0gdHlwZTsKKyAgICAgICAgICAgICAgICBoZGRfc2V0X2lic3Nfb3BzKCBwQWRhcHRlciApOworICAgICAgICAgICAgICAgIGhkZF9pYnNzX2luaXRfdHhfcngoIHBBZGFwdGVyICk7CisKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBoZGRfc3RhX2lkX2hhc2hfYXR0YWNoKHBBZGFwdGVyKTsKKyAgICAgICAgICAgICAgICBpZiAoVk9TX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykgeworICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiRmFpbGVkIHRvIGluaXRpYWxpemUgaGFzaCBmb3IgSUJTUyIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgTkw4MDIxMV9JRlRZUEVfQVA6CisgICAgICAgICAgICBjYXNlIE5MODAyMTFfSUZUWVBFX1AyUF9HTzoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IHNldHRpbmcgaW50ZXJmYWNlIFR5cGUgdG8gJXMiLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgICAodHlwZSA9PSBOTDgwMjExX0lGVFlQRV9BUCkgPyAiU29mdEFQIiA6ICJQMnBHbyIpOworCisgICAgICAgICAgICAgICAgLy9DYW5jZWwgYW55IHJlbWFpbiBvbiBjaGFubmVsIGZvciBHTyBtb2RlCisgICAgICAgICAgICAgICAgaWYgKE5MODAyMTFfSUZUWVBFX1AyUF9HTyA9PSB0eXBlKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgd2xhbl9oZGRfY2FuY2VsX2V4aXN0aW5nX3JlbWFpbl9vbl9jaGFubmVsKHBBZGFwdGVyKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKE5MODAyMTFfSUZUWVBFX0FQID09IHR5cGUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgLyogQXMgTG9hZGluZyBXTEFOIERyaXZlciBvbmUgaW50ZXJmYWNlIGJlaW5nIGNyZWF0ZWQgZm9yIHAycCBkZXZpY2UKKyAgICAgICAgICAgICAgICAgICAgICAqIGFkZHJlc3MuIFRoaXMgd2lsbCB0YWtlIG9uZSBIVyBTVEEgYW5kIHRoZSBtYXggbnVtYmVyIG9mIGNsaWVudHMKKyAgICAgICAgICAgICAgICAgICAgICAqIHRoYXQgY2FuIGNvbm5lY3QgdG8gc29mdEFQIHdpbGwgYmUgcmVkdWNlZCBieSBvbmUuIHNvIHdoaWxlIGNoYW5naW5nCisgICAgICAgICAgICAgICAgICAgICAgKiB0aGUgaW50ZXJmYWNlIHR5cGUgdG8gTkw4MDIxMV9JRlRZUEVfQVAgKFNvZnRBUCkgcmVtb3ZlIHAycDAKKyAgICAgICAgICAgICAgICAgICAgICAqIGludGVyZmFjZSBhcyBpdCBpcyBub3QgcmVxdWlyZWQgaW4gU29mdEFQIG1vZGUuCisgICAgICAgICAgICAgICAgICAgICAgKi8KKworICAgICAgICAgICAgICAgICAgICAvLyBHZXQgUDJQIEFkYXB0ZXIKKyAgICAgICAgICAgICAgICAgICAgcFAycEFkYXB0ZXIgPSBoZGRfZ2V0X2FkYXB0ZXIocEhkZEN0eCwgV0xBTl9IRERfUDJQX0RFVklDRSk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKHBQMnBBZGFwdGVyKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBoZGRfc3RvcF9hZGFwdGVyKHBIZGRDdHgsIHBQMnBBZGFwdGVyLCBWT1NfVFJVRSk7CisgICAgICAgICAgICAgICAgICAgICAgICBoZGRfZGVpbml0X2FkYXB0ZXIocEhkZEN0eCwgcFAycEFkYXB0ZXIsIFRSVUUpOworICAgICAgICAgICAgICAgICAgICAgICAgaGRkX2Nsb3NlX2FkYXB0ZXIocEhkZEN0eCwgcFAycEFkYXB0ZXIsIFZPU19UUlVFKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvL0Rpc2FibGUgSU1QUyAmIEJNUFMgZm9yIFNBUC9HTworICAgICAgICAgICAgICAgIGlmKFZPU19TVEFUVVNfRV9GQUlMVVJFID09CisgICAgICAgICAgICAgICAgICAgICAgIGhkZF9kaXNhYmxlX2JtcHNfaW1wcyhwSGRkQ3R4LCBXTEFOX0hERF9QMlBfR08pKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy9GYWlsIHRvIEV4aXQgQk1QUworICAgICAgICAgICAgICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGhkZF9zdG9wX2FkYXB0ZXIoIHBIZGRDdHgsIHBBZGFwdGVyLCBWT1NfVFJVRSApOworCisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKworICAgICAgICAgICAgICAgIC8qIEEgTXV0ZXggTG9jayBpcyBpbnRyb2R1Y2VkIHdoaWxlIGNoYW5naW5nIHRoZSBtb2RlIHRvCisgICAgICAgICAgICAgICAgICogcHJvdGVjdCB0aGUgY29uY3VycmVudCBhY2Nlc3MgZm9yIHRoZSBBZGFwdGVycyBieSBURExTCisgICAgICAgICAgICAgICAgICogbW9kdWxlLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIG11dGV4X2xvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisjZW5kaWYKKyAgICAgICAgICAgICAgICAvL0RlLWluaXQgdGhlIGFkYXB0ZXIuCisgICAgICAgICAgICAgICAgaGRkX2RlaW5pdF9hZGFwdGVyKCBwSGRkQ3R4LCBwQWRhcHRlciwgVFJVRSk7CisgICAgICAgICAgICAgICAgbWVtc2V0KCZwQWRhcHRlci0+c2Vzc2lvbkN0eCwgMCwgc2l6ZW9mKHBBZGFwdGVyLT5zZXNzaW9uQ3R4KSk7CisgICAgICAgICAgICAgICAgcEFkYXB0ZXItPmRldmljZV9tb2RlID0gKHR5cGUgPT0gTkw4MDIxMV9JRlRZUEVfQVApID8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9IRERfU09GVEFQIDogV0xBTl9IRERfUDJQX0dPOworI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgICAgICAgICAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworI2VuZGlmCisgICAgICAgICAgICAgICAgaWYgKChXTEFOX0hERF9TT0ZUQVAgPT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKSAmJgorICAgICAgICAgICAgICAgICAgICAocENvbmZpZy0+YXBSYW5kb21Cc3NpZEVuYWJsZWQpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogVG8gbWVldCBBbmRyb2lkIHJlcXVpcmVtZW50cyBjcmVhdGUgYSByYW5kb21pemVkCisgICAgICAgICAgICAgICAgICAgICAgIE1BQyBhZGRyZXNzIG9mIHRoZSBmb3JtIDAyOjFBOjExOkZ4Onh4Onh4ICovCisgICAgICAgICAgICAgICAgICAgIGdldF9yYW5kb21fYnl0ZXMoJm5kZXYtPmRldl9hZGRyWzNdLCAzKTsKKyAgICAgICAgICAgICAgICAgICAgbmRldi0+ZGV2X2FkZHJbMF0gPSAweDAyOworICAgICAgICAgICAgICAgICAgICBuZGV2LT5kZXZfYWRkclsxXSA9IDB4MUE7CisgICAgICAgICAgICAgICAgICAgIG5kZXYtPmRldl9hZGRyWzJdID0gMHgxMTsKKyAgICAgICAgICAgICAgICAgICAgbmRldi0+ZGV2X2FkZHJbM10gfD0gMHhGMDsKKyAgICAgICAgICAgICAgICAgICAgbWVtY3B5KHBBZGFwdGVyLT5tYWNBZGRyZXNzQ3VycmVudC5ieXRlcywgbmRldi0+ZGV2X2FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfTUFDX0FERFJfU0laRSk7CisgICAgICAgICAgICAgICAgICAgIHByX2luZm8oIndsYW46IEdlbmVyYXRlZCBIb3RTcG90IEJTU0lEICIgTUFDX0FERFJFU1NfU1RSIlxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShuZGV2LT5kZXZfYWRkcikpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGhkZF9zZXRfYXBfb3BzKCBwQWRhcHRlci0+ZGV2ICk7CisKKyAgICAgICAgICAgICAgICAvKiBUaGlzIGlzIGZvciBvbmx5IFNBUCBtb2RlIHdoZXJlIHVzZXJzIGNhbgorICAgICAgICAgICAgICAgICAqIGNvbnRyb2wgY291bnRyeSB0aHJvdWdoIGluaS4KKyAgICAgICAgICAgICAgICAgKiBQMlAgR08gZm9sbG93cyBzdGF0aW9uIGNvdW50cnkgY29kZQorICAgICAgICAgICAgICAgICAqIGFjcXVpcmVkIGR1cmluZyB0aGUgU1RBIHNjYW5uaW5nLiAqLworICAgICAgICAgICAgICAgIGlmKChOTDgwMjExX0lGVFlQRV9BUCA9PSB0eXBlKSAmJgorICAgICAgICAgICAgICAgICAgIChtZW1jbXAocENvbmZpZy0+YXBDbnRyeUNvZGUsIENGR19BUF9DT1VOVFJZX0NPREVfREVGQVVMVCwgMykgIT0gMCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpbnQgc3RhdHVzID0gMDsKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICIlczogc2V0dGluZyBjb3VudHJ5IGNvZGUgZnJvbSBJTkkgIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgICAgICBpbml0X2NvbXBsZXRpb24oJnBBZGFwdGVyLT5jaGFuZ2VfY291bnRyeV9jb2RlKTsKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gKGludClzbWVfQ2hhbmdlQ291bnRyeUNvZGUocEhkZEN0eC0+aEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKSh0U21lQ2hhbmdlQ291bnRyeUNhbGxiYWNrKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF9jaGFuZ2VfY291bnRyeV9jb2RlX2NiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ29uZmlnLT5hcENudHJ5Q29kZSwgcEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPnB2b3NDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX0ZBTFNFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX1RSVUUpOworICAgICAgICAgICAgICAgICAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyA9PSBzdGF0dXMpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIFdhaXQgZm9yIGNvbXBsZXRpb24gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIHJldCA9IHdhaXRfZm9yX2NvbXBsZXRpb25faW50ZXJydXB0aWJsZV90aW1lb3V0KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBZGFwdGVyLT5jaGFuZ2VfY291bnRyeV9jb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcyhXTEFOX1dBSVRfVElNRV9DT1VOVFJZKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmV0IDw9IDApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiU01FIFRpbWVkIG91dCB3aGlsZSBzZXR0aW5nIGNvdW50cnkgY29kZSAlbGQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocEhkZEN0eC0+aXNMb2dwSW5Qcm9ncmVzcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBMT0dQIGluIFByb2dyZXNzLiBJZ25vcmUhISEiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUFHQUlOOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogU01FIENoYW5nZSBDb3VudHJ5IGNvZGUgZmFpbGVkIixfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc3RhdHVzID0gaGRkX2luaXRfYXBfbW9kZShwQWRhcHRlcik7CisgICAgICAgICAgICAgICAgaWYoc3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEVycm9yIGluaXRpYWxpemluZyB0aGUgYXAgbW9kZSIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGhkZF9zZXRfY29ucGFyYW0oMSk7CisKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBoZGRfc3RhX2lkX2hhc2hfYXR0YWNoKHBBZGFwdGVyKTsKKyAgICAgICAgICAgICAgICBpZiAoVk9TX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiRmFpbGVkIHRvIGluaXRpYWxpemUgaGFzaCBmb3IgQVAiKSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8qaW50ZXJmYWNlIHR5cGUgY2hhbmdlZCB1cGRhdGUgaW4gd2lwaHkgc3RydWN0dXJlKi8KKyAgICAgICAgICAgICAgICBpZih3ZGV2KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgd2Rldi0+aWZ0eXBlID0gdHlwZTsKKyAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+Y2hhbmdlX2lmYWNlID0gdHlwZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEVSUk9SICEhISEgV2lyZWxlc3MgZGV2IGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBnb3RvIGRvbmU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiBVbnN1cHBvcnRlZCBpbnRlcmZhY2UgVHlwZSIsCisgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgcmV0dXJuIC1FT1BOT1RTVVBQOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYgKCAocEFkYXB0ZXItPmRldmljZV9tb2RlID09IFdMQU5fSEREX1NPRlRBUCkKKyAgICAgICAgICAgfHwgKHBBZGFwdGVyLT5kZXZpY2VfbW9kZSA9PSBXTEFOX0hERF9QMlBfR08pCisgICAgICAgICAgICApCisgICAgeworICAgICAgIHN3aXRjaCh0eXBlKQorICAgICAgIHsKKyAgICAgICAgICAgY2FzZSBOTDgwMjExX0lGVFlQRV9TVEFUSU9OOgorICAgICAgICAgICBjYXNlIE5MODAyMTFfSUZUWVBFX1AyUF9DTElFTlQ6CisgICAgICAgICAgIGNhc2UgTkw4MDIxMV9JRlRZUEVfQURIT0M6CisKKyAgICAgICAgICAgICAgICBoZGRfc3RvcF9hZGFwdGVyKCBwSGRkQ3R4LCBwQWRhcHRlciwgVk9TX1RSVUUgKTsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworCisgICAgICAgICAgICAgICAgLyogQSBNdXRleCBMb2NrIGlzIGludHJvZHVjZWQgd2hpbGUgY2hhbmdpbmcgdGhlIG1vZGUgdG8KKyAgICAgICAgICAgICAgICAgKiBwcm90ZWN0IHRoZSBjb25jdXJyZW50IGFjY2VzcyBmb3IgdGhlIEFkYXB0ZXJzIGJ5IFRETFMKKyAgICAgICAgICAgICAgICAgKiBtb2R1bGUuCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgbXV0ZXhfbG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyNlbmRpZgorICAgICAgICAgICAgICAgIGhkZF9kZWluaXRfYWRhcHRlciggcEhkZEN0eCwgcEFkYXB0ZXIsIFRSVUUpOworICAgICAgICAgICAgICAgIHdkZXYtPmlmdHlwZSA9IHR5cGU7CisgICAgICAgICAgICAgICAgLy9DaGVjayBmb3Igc3ViLXN0cmluZyBwMnAgdG8gY29uZmlybSBpdHMgYSBwMnAgaW50ZXJmYWNlCisgICAgICAgICAgICAgICAgaWYgKE5VTEwgIT0gc3Ryc3RyKG5kZXYtPm5hbWUsInAycCIpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPmRldmljZV9tb2RlID0gKHR5cGUgPT0gTkw4MDIxMV9JRlRZUEVfU1RBVElPTikgPworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5fSEREX1AyUF9ERVZJQ0UgOiBXTEFOX0hERF9QMlBfQ0xJRU5UOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+ZGV2aWNlX21vZGUgPSAodHlwZSA9PSBOTDgwMjExX0lGVFlQRV9TVEFUSU9OKSA/CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9IRERfSU5GUkFfU1RBVElPTjogV0xBTl9IRERfUDJQX0NMSUVOVDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaGRkX3NldF9jb25wYXJhbSgwKTsKKyAgICAgICAgICAgICAgICBwSGRkQ3R4LT5jaGFuZ2VfaWZhY2UgPSB0eXBlOworICAgICAgICAgICAgICAgIG1lbXNldCgmcEFkYXB0ZXItPnNlc3Npb25DdHgsIDAsIHNpemVvZihwQWRhcHRlci0+c2Vzc2lvbkN0eCkpOworICAgICAgICAgICAgICAgIGhkZF9zZXRfc3RhdGlvbl9vcHMoIHBBZGFwdGVyLT5kZXYgKTsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworICAgICAgICAgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyNlbmRpZgorICAgICAgICAgICAgICAgIHN0YXR1cyA9IGhkZF9pbml0X3N0YXRpb25fbW9kZSggcEFkYXB0ZXIgKTsKKyAgICAgICAgICAgICAgICBpZiggVk9TX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cyApCisgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRU9QTk9UU1VQUDsKKyAgICAgICAgICAgICAgICAvKiBJbiBjYXNlIG9mIEpCLCBmb3IgUDJQLUdPLCBvbmx5IGNoYW5nZSBpbnRlcmZhY2Ugd2lsbCBiZSBjYWxsZWQsCisgICAgICAgICAgICAgICAgICogVGhpcyBpcyB0aGUgcmlnaHQgcGxhY2UgdG8gZW5hYmxlIGJhY2sgYm1wc19pbXBzKCkKKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBpZiAocEhkZEN0eC0+aGRkX3dsYW5fc3VzcGVuZGVkKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaGRkX3NldF9wd3JwYXJhbXMocEhkZEN0eCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGhkZF9lbmFibGVfYm1wc19pbXBzKHBIZGRDdHgpOworICAgICAgICAgICAgICAgIGdvdG8gZG9uZTsKKyAgICAgICAgICAgIGNhc2UgTkw4MDIxMV9JRlRZUEVfQVA6CisgICAgICAgICAgICBjYXNlIE5MODAyMTFfSUZUWVBFX1AyUF9HTzoKKyAgICAgICAgICAgICAgICB3ZGV2LT5pZnR5cGUgPSB0eXBlOworICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSA9ICh0eXBlID09IE5MODAyMTFfSUZUWVBFX0FQKSA/CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9IRERfU09GVEFQIDogV0xBTl9IRERfUDJQX0dPOworICAgICAgICAgICAgICAgZ290byBkb25lOworICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogVW5zdXBwb3J0ZWQgaW50ZXJmYWNlIFR5cGUiLAorICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICAgICAgIHJldHVybiAtRU9QTk9UU1VQUDsKKworICAgICAgIH0KKworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiJXM6IHVuc3VwcG9ydGVkIGRldmljZSBtb2RlKCVzICglZCkpIiwKKyAgICAgICAgICAgX19mdW5jX18sIGhkZF9kZXZpY2VfbW9kZXRvU3RyaW5nKHBBZGFwdGVyLT5kZXZpY2VfbW9kZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+ZGV2aWNlX21vZGUpOworICAgICAgcmV0dXJuIC1FT1BOT1RTVVBQOworICAgIH0KKworCisgICAgaWYocFJvYW1Qcm9maWxlKQorICAgIHsKKyAgICAgICAgaWYgKCBMYXN0QlNTVHlwZSAhPSBwUm9hbVByb2ZpbGUtPkJTU1R5cGUgKQorICAgICAgICB7CisgICAgICAgICAgICAvKmludGVyZmFjZSB0eXBlIGNoYW5nZWQgdXBkYXRlIGluIHdpcGh5IHN0cnVjdHVyZSovCisgICAgICAgICAgICB3ZGV2LT5pZnR5cGUgPSB0eXBlOworCisgICAgICAgICAgICAvKnRoZSBCU1MgbW9kZSBjaGFuZ2VkLCBXZSBuZWVkIHRvIGlzc3VlIGRpc2Nvbm5lY3QKKyAgICAgICAgICAgICAgaWYgY29ubmVjdGVkIG9yIGluIElCU1MgZGlzY29ubmVjdCBzdGF0ZSovCisgICAgICAgICAgICBpZiAoIGhkZF9jb25uR2V0Q29ubmVjdGVkQnNzVHlwZSgKKyAgICAgICAgICAgICAgICAgV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlciksICZjb25uZWN0ZWRCc3NUeXBlICkgfHwKKyAgICAgICAgICAgICAgICAoIGVDU1JfQlNTX1RZUEVfU1RBUlRfSUJTUyA9PSBMYXN0QlNTVHlwZSApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKm5lZWQgdG8gaXNzdWUgYSBkaXNjb25uZWN0IHRvIENTUi4qLworICAgICAgICAgICAgICAgIElOSVRfQ09NUExFVElPTihwQWRhcHRlci0+ZGlzY29ubmVjdF9jb21wX3Zhcik7CisgICAgICAgICAgICAgICAgaWYoIGVIQUxfU1RBVFVTX1NVQ0NFU1MgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgIHNtZV9Sb2FtRGlzY29ubmVjdCggV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX0RJU0NPTk5FQ1RfUkVBU09OX1VOU1BFQ0lGSUVEICkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0ID0gd2FpdF9mb3JfY29tcGxldGlvbl9pbnRlcnJ1cHRpYmxlX3RpbWVvdXQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwQWRhcHRlci0+ZGlzY29ubmVjdF9jb21wX3ZhciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcyhXTEFOX1dBSVRfVElNRV9ESVNDT05ORUNUKSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChyZXQgPD0gMCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIndhaXQgb24gZGlzY29ubmVjdF9jb21wX3ZhciBmYWlsZWQgJWxkIiksIHJldCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKK2RvbmU6CisgICAgL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uCisgKi8KK2ludCB3bGFuX2hkZF9jZmc4MDIxMV9jaGFuZ2VfaWZhY2UoIHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqbmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbmw4MDIxMV9pZnR5cGUgdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUzMiAqZmxhZ3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgdmlmX3BhcmFtcyAqcGFyYW1zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9fd2xhbl9oZGRfY2ZnODAyMTFfY2hhbmdlX2lmYWNlKHdpcGh5LCBuZGV2LCB0eXBlLCBmbGFncywgcGFyYW1zKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKK3N0YXRpYyBpbnQgd2xhbl9oZGRfdGRsc19hZGRfc3RhdGlvbihzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE4LDApKQorICAgICAgICAgIGNvbnN0IHU4ICptYWMsCisjZWxzZQorICAgICAgICAgIHU4ICptYWMsCisjZW5kaWYKKyAgICAgICAgICBib29sIHVwZGF0ZSwgdENzclN0YVBhcmFtcyAqU3RhUGFyYW1zKQoreworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSB3aXBoeV9wcml2KHdpcGh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ICAgICAgIiVzOiBURExTIG1vZGUgaXMgZGlzYWJsZWQgT1Igbm90IGVuYWJsZWQgaW4gRlcuIgorICAgICAgICAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIgIiBSZXF1ZXN0IGRlY2xpbmVkLiIsCisgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBNQUNfQUREUl9BUlJBWShtYWMpKTsKKyAgICAgICAgcmV0dXJuIC1FTk9UU1VQUDsKKyAgICB9CisKKyAgICBpZiAocEhkZEN0eC0+aXNMb2dwSW5Qcm9ncmVzcykKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczpMT0dQIGluIFByb2dyZXNzLiBJZ25vcmUhISEiLCBfX2Z1bmNfXyk7CisgICAgICAgIHdsYW5faGRkX3RkbHNfc2V0X2xpbmtfc3RhdHVzKHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVURExTX0xJTktfSURMRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVRETFNfTElOS19VTlNQRUNJRklFRCk7CisgICAgICAgIHJldHVybiAtRUJVU1k7CisgICAgfQorCisgICAgbXV0ZXhfbG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICBwVGRsc1BlZXIgPSB3bGFuX2hkZF90ZGxzX2dldF9wZWVyKHBBZGFwdGVyLCBtYWMpOworCisgICAgaWYgKCBOVUxMID09IHBUZGxzUGVlciApIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIiVzOiAiIE1BQ19BRERSRVNTX1NUUiAiICh1cGRhdGUgJWQpIG5vdCBleGlzdC4gcmV0dXJuIGludmFsaWQiLAorICAgICAgICAgICAgICAgX19mdW5jX18sIE1BQ19BRERSX0FSUkFZKG1hYyksIHVwZGF0ZSk7CisgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgLyogaW4gYWRkIHN0YXRpb24sIHdlIGFjY2VwdCBleGlzdGluZyB2YWxpZCBzdGFJZCBpZiB0aGVyZSBpcyAqLworICAgIGlmICgoMCA9PSB1cGRhdGUpICYmCisgICAgICAgICgocFRkbHNQZWVyLT5saW5rX3N0YXR1cyA+PSBlVERMU19MSU5LX0NPTk5FQ1RJTkcpIHx8CisgICAgICAgICAoVERMU19TVEFfSU5ERVhfVkFMSUQocFRkbHNQZWVyLT5zdGFJZCkpKSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICIlczogIiBNQUNfQUREUkVTU19TVFIKKyAgICAgICAgICAgICAgICAgICAiIGxpbmtfc3RhdHVzICVkLiBzdGFJZCAlZC4gYWRkIHN0YXRpb24gaWdub3JlZC4iLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBNQUNfQUREUl9BUlJBWShtYWMpLCBwVGRsc1BlZXItPmxpbmtfc3RhdHVzLCBwVGRsc1BlZXItPnN0YUlkKTsKKyAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisgICAgLyogaW4gY2hhbmdlIHN0YXRpb24sIHdlIGFjY2VwdCBvbmx5IHdoZW4gc3RhSWQgaXMgdmFsaWQgKi8KKyAgICBpZiAoKDEgPT0gdXBkYXRlKSAmJgorICAgICAgICAoKHBUZGxzUGVlci0+bGlua19zdGF0dXMgPiBlVERMU19MSU5LX0NPTk5FQ1RJTkcpIHx8CisgICAgICAgICAoIVRETFNfU1RBX0lOREVYX1ZBTElEKHBUZGxzUGVlci0+c3RhSWQpKSkpCisgICAgeworICAgICAgICB0QU5JX1UxNiBzdGFJZCA9IHBUZGxzUGVlci0+c3RhSWQ7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiJXM6ICIgTUFDX0FERFJFU1NfU1RSCisgICAgICAgICAgICAgICAgICAgIiBsaW5rIHN0YXR1cyAlZC4gc3RhSWQgJWQuIGNoYW5nZSBzdGF0aW9uICVzLiIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIE1BQ19BRERSX0FSUkFZKG1hYyksIHBUZGxzUGVlci0+bGlua19zdGF0dXMsIHN0YUlkLAorICAgICAgICAgICAgICAgICAgIChURExTX1NUQV9JTkRFWF9WQUxJRChzdGFJZCkpID8gImlnbm9yZWQiIDogImRlY2xpbmVkIik7CisgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICAgICAgcmV0dXJuIChURExTX1NUQV9JTkRFWF9WQUxJRChzdGFJZCkpID8gMCA6IC1FUEVSTTsKKyAgICB9CisgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworCisgICAgLyogd2hlbiBvdGhlcnMgYXJlIG9uLWdvaW5nLCB3ZSB3YW50IHRvIGNoYW5nZSBsaW5rX3N0YXR1cyB0byBpZGxlICovCisgICAgaWYgKE5VTEwgIT0gd2xhbl9oZGRfdGRsc19pc19wcm9ncmVzcyhwSGRkQ3R4LCBtYWMsIFRSVUUsIFRSVUUpKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICIlczogIiBNQUNfQUREUkVTU19TVFIKKyAgICAgICAgICAgICAgICAgICAiIFRETFMgc2V0dXAgaXMgb25nb2luZy4gUmVxdWVzdCBkZWNsaW5lZC4iLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBNQUNfQUREUl9BUlJBWShtYWMpKTsKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICB9CisKKyAgICAvKiBmaXJzdCB0byBjaGVjayBpZiB3ZSByZWFjaGVkIHRvIG1heGltdW0gc3VwcG9ydGVkIFRETFMgcGVlci4KKyAgICAgICBUT0RPOiBmb3Igbm93LCByZXR1cm4gLUVQRVJNIGxvb2tzIHdvcmtpbmcgZmluZSwKKyAgICAgICBidXQgbmVlZCB0byBjaGVjayBpZiBhbnkgb3RoZXIgZXJybm8gZml0IGludG8gdGhpcyBjYXRlZ29yeS4qLworICAgIG51bUN1cnJUZGxzUGVlcnMgPSB3bGFuX2hkZF90ZGxzQ29ubmVjdGVkUGVlcnMocEFkYXB0ZXIpOworICAgIGlmIChIRERfTUFYX05VTV9URExTX1NUQSA8PSBudW1DdXJyVGRsc1BlZXJzKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICIlczogIiBNQUNfQUREUkVTU19TVFIKKyAgICAgICAgICAgICAgICAgICAiIFRETFMgTWF4IHBlZXIgYWxyZWFkeSBjb25uZWN0ZWQuIFJlcXVlc3QgZGVjbGluZWQuIgorICAgICAgICAgICAgICAgICAgICIgTnVtIG9mIHBlZXJzICglZCksIE1heCBhbGxvd2VkICglZCkuIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgTUFDX0FERFJfQVJSQVkobWFjKSwgbnVtQ3VyclRkbHNQZWVycywKKyAgICAgICAgICAgICAgICAgICBIRERfTUFYX05VTV9URExTX1NUQSk7CisgICAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGhkZFRkbHNQZWVyX3QgKnBUZGxzUGVlcjsKKyAgICAgICAgbXV0ZXhfbG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICAgICAgcFRkbHNQZWVyID0gd2xhbl9oZGRfdGRsc19maW5kX3BlZXIocEFkYXB0ZXIsIG1hYywgRkFMU0UpOworICAgICAgICBpZiAocFRkbHNQZWVyICYmIFRETFNfSVNfQ09OTkVDVEVEKHBUZGxzUGVlcikpCisgICAgICAgIHsKKyAgICAgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiAiIE1BQ19BRERSRVNTX1NUUiAiIGFscmVhZHkgY29ubmVjdGVkLiBSZXF1ZXN0IGRlY2xpbmVkLiIsCisgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBNQUNfQUREUl9BUlJBWShtYWMpKTsKKyAgICAgICAgICAgIHJldHVybiAtRVBFUk07CisgICAgICAgIH0KKyAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgIH0KKyAgICBpZiAoMCA9PSB1cGRhdGUpCisgICAgICAgIHdsYW5faGRkX3RkbHNfc2V0X2xpbmtfc3RhdHVzKHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVURExTX0xJTktfQ09OTkVDVElORywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVRETFNfTElOS19TVUNDRVNTKTsKKworICAgIC8qIGRlYnVnIGNvZGUgKi8KKyAgICBpZiAoTlVMTCAhPSBTdGFQYXJhbXMpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgIiVzOiBURExTIFBlZXIgUGFyYW1ldGVycy4iLCBfX2Z1bmNfXyk7CisgICAgICAgIGlmKFN0YVBhcmFtcy0+aHRjYXBfcHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAiaHRfY2FwYS0+Y2FwX2luZm86ICUweCIsIFN0YVBhcmFtcy0+SFRDYXAuY2FwSW5mbyk7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICJodF9jYXBhLT5leHRlbmRlZF9jYXBhYmlsaXRpZXM6ICUweCIsCisgICAgICAgICAgICAgICAgICAgICAgU3RhUGFyYW1zLT5IVENhcC5leHRlbmRlZEh0Q2FwSW5mbyk7CisgICAgICAgIH0KKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICJwYXJhbXMtPmNhcGFiaWxpdHk6ICUweCIsU3RhUGFyYW1zLT5jYXBhYmlsaXR5KTsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICJwYXJhbXMtPmV4dF9jYXBhYl9sZW46ICUweCIsU3RhUGFyYW1zLT5leHRuX2NhcGFiaWxpdHlbMF0pOworICAgICAgICBpZihTdGFQYXJhbXMtPnZodGNhcF9wcmVzZW50KQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFV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NDRVNTKSB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICBGTCgiRmFpbGVkIHRvIGFkZCBURExTIHBlZXIgU1RBLiBFbmFibGUgQm1wcyIpKTsKKyAgICAgICAgICAgIHdsYW5faGRkX3RkbHNfY2hlY2tfYm1wcyhwQWRhcHRlcik7CisgICAgICAgICAgICByZXR1cm4gLUVQRVJNOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHJldCA9IHNtZV9DaGFuZ2VUZGxzUGVlclN0YShXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCBtYWMsIFN0YVBhcmFtcyk7CisgICAgICAgIGlmIChyZXQgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUykgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoIkZhaWxlZCB0byBjaGFuZ2UgVERMUyBwZWVyIFNUQSBwYXJhbXMiKSk7CisgICAgICAgICAgICByZXR1cm4gLUVQRVJNOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0ID0gd2FpdF9mb3JfY29tcGxldGlvbl9pbnRlcnJ1cHRpYmxlX3RpbWVvdXQoJnBBZGFwdGVyLT50ZGxzX2FkZF9zdGF0aW9uX2NvbXAsCisgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoV0FJVF9USU1FX1RETFNfQUREX1NUQSkpOworCisgICAgaWYgKHJldCA8PSAwKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOiB0aW1lb3V0IHdhaXRpbmcgZm9yIHRkbHMgYWRkIHN0YXRpb24gaW5kaWNhdGlvbiAlbGQiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fLCByZXQpOworICAgICAgICByZXR1cm4gLUVQRVJNOworICAgIH0KKworICAgIGlmICggZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSBwQWRhcHRlci0+dGRsc0FkZFN0YVN0YXR1cykKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogQWRkIFN0YXRpb24gaXMgdW5zdWNlc3NmdWwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRVBFUk07CisgICAgfQorCisgICAgcmV0dXJuIDA7CisKK2Vycm9yOgorICAgIHdsYW5faGRkX3RkbHNfc2V0X2xpbmtfc3RhdHVzKHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlVERMU19MSU5LX0lETEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVRETFNfTElOS19VTlNQRUNJRklFRCk7CisgICAgcmV0dXJuIC1FUEVSTTsKKworfQorI2VuZGlmCisKK3N0YXRpYyBpbnQgX193bGFuX2hkZF9jaGFuZ2Vfc3RhdGlvbihzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKm1hYywKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICptYWMsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHN0YXRpb25fcGFyYW1ldGVycyAqcGFyYW1zKQoreworICAgIFZPU19TVEFUVVMgc3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHg7CisgICAgdl9NQUNBRERSX3QgU1RBTWFjQWRkcmVzczsKKyAgICBpbnQgcmV0ID0gMDsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworICAgIHRDc3JTdGFQYXJhbXMgU3RhUGFyYW1zID0gezB9OworICAgIHRBTklfVTggaXNCdWZTdGEgPSAwOworICAgIHRBTklfVTggaXNPZmZDaGFubmVsU3VwcG9ydGVkID0gMDsKKyNlbmRpZgorCisgICAgRU5URVIoKTsKKworICAgIHBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaWYgKChOVUxMID09IHBBZGFwdGVyKSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgImludmFsaWQgYWRhcHRlciAiKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX0hERCwKKyAgICAgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfSEREX0NIQU5HRV9TVEFUSU9OLAorICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsIHBhcmFtcy0+bGlzdGVuX2ludGVydmFsKSk7CisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworCisgICAgcmV0ID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSByZXQpCisgICAgeworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKworICAgIHBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKworICAgIGlmIChOVUxMID09IHBIZGRTdGFDdHgpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICJpbnZhbGlkIEhERCBzdGF0aW9uIGNvbnRleHQiKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIHZvc19tZW1fY29weShTVEFNYWNBZGRyZXNzLmJ5dGVzLCBtYWMsIHNpemVvZih2X01BQ0FERFJfdCkpOworCisgICAgaWYgKChwQWRhcHRlci0+ZGV2aWNlX21vZGUgPT0gV0xBTl9IRERfU09GVEFQKQorICAgICAgfHwgKHBBZGFwdGVyLT5kZXZpY2VfbW9kZSA9PSBXTEFOX0hERF9QMlBfR08pKQorICAgIHsKKyAgICAgICAgaWYgKHBhcmFtcy0+c3RhX2ZsYWdzX3NldCAmIEJJVChOTDgwMjExX1NUQV9GTEFHX0FVVEhPUklaRUQpKQorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSBoZGRfc29mdGFwX2NoYW5nZV9TVEFfc3RhdGUoIHBBZGFwdGVyLCAmU1RBTWFjQWRkcmVzcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX1NUQV9BVVRIRU5USUNBVEVEKTsKKworICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgIC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VtYmVyCisgICAgICAgICAgICAgKiBvZiBjaGFubmVscy4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgaWYgKDAgIT0gcGFyYW1zLT5zdXBwb3J0ZWRfY2hhbm5lbHNfbGVuKSB7CisgICAgICAgICAgICAgICAgaW50IGkgPSAwLGogPSAwLGsgPSAwLCBub19vZl9jaGFubmVscyA9IDAgOworICAgICAgICAgICAgICAgIGZvciAoIGkgPSAwIDsgaSA8IHBhcmFtcy0+c3VwcG9ydGVkX2NoYW5uZWxzX2xlbiA7IGkrPTIpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpbnQgd2lmaV9jaGFuX2luZGV4OworICAgICAgICAgICAgICAgICAgICBTdGFQYXJhbXMuc3VwcG9ydGVkX2NoYW5uZWxzW2pdID0gcGFyYW1zLT5zdXBwb3J0ZWRfY2hhbm5lbHNbaV07CisgICAgICAgICAgICAgICAgICAgIHdpZmlfY2hhbl9pbmRleCA9CisgICAgICAgICAgICAgICAgICAgICAgICAoKFN0YVBhcmFtcy5zdXBwb3J0ZWRfY2hhbm5lbHNbal0gPD0gSEREX0NIQU5ORUxfMTQgKSA/IDEgOiA0ICk7CisgICAgICAgICAgICAgICAgICAgIG5vX29mX2NoYW5uZWxzID0gcGFyYW1zLT5zdXBwb3J0ZWRfY2hhbm5lbHNbaSsxXTsKKyAgICAgICAgICAgICAgICAgICAgZm9yKGs9MTsgayA8PSBub19vZl9jaGFubmVsczsgaysrKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBTdGFQYXJhbXMuc3VwcG9ydGVkX2NoYW5uZWxzW2orMV0gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RhUGFyYW1zLnN1cHBvcnRlZF9jaGFubmVsc1tqXSArIHdpZmlfY2hhbl9pbmRleDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGorPTE7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgU3RhUGFyYW1zLnN1cHBvcnRlZF9jaGFubmVsc19sZW4gPSBqOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdm9zX21lbV9jb3B5KFN0YVBhcmFtcy5zdXBwb3J0ZWRfb3Blcl9jbGFzc2VzLAorICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy0+c3VwcG9ydGVkX29wZXJfY2xhc3NlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMtPnN1cHBvcnRlZF9vcGVyX2NsYXNzZXNfbGVuKTsKKyAgICAgICAgICAgIFN0YVBhcmFtcy5zdXBwb3J0ZWRfb3Blcl9jbGFzc2VzX2xlbiAgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLT5zdXBwb3J0ZWRfb3Blcl9jbGFzc2VzX2xlbjsKKworICAgICAgICAgICAgaWYgKDAgIT0gcGFyYW1zLT5leHRfY2FwYWJfbGVuKQorICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShTdGFQYXJhbXMuZXh0bl9jYXBhYmlsaXR5LCBwYXJhbXMtPmV4dF9jYXBhYiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKFN0YVBhcmFtcy5leHRuX2NhcGFiaWxpdHkpKTsKKworICAgICAgICAgICAgaWYgKE5VTEwgIT0gcGFyYW1zLT5odF9jYXBhKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFN0YVBhcmFtcy5odGNhcF9wcmVzZW50ID0gMTsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJlN0YVBhcmFtcy5IVENhcCwgcGFyYW1zLT5odF9jYXBhLCBzaXplb2YodFNpckhUQ2FwKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFN0YVBhcmFtcy5zdXBwb3J0ZWRfcmF0ZXNfbGVuID0gcGFyYW1zLT5zdXBwb3J0ZWRfcmF0ZXNfbGVuOworCisgICAgICAgICAgICAvKiBOb3RlIDogVGhlIE1heGltdW0gc2l6ZW9mIHN1cHBvcnRlZF9yYXRlcyBzZW50IGJ5IHRoZSBTdXBwbGljYW50IGlzIDMyLgorICAgICAgICAgICAgICogVGhlIHN1cHBvcnRlZF9yYXRlcyBhcnJheSAsIGZvciBhbGwgdGhlIHN0cnVjdHVyZXMgcHJvcG9nYXRpbmcgdGlsbCBBZGQgU3RhCisgICAgICAgICAgICAgKiB0byB0aGUgZmlybXdhcmUgaGFzIHRvIGJlIG1vZGlmaWVkICwgaWYgdGhlIHN1cHBsaWNhbnQgKGllZWU4MDIxMSkgaXMKKyAgICAgICAgICAgICAqIG1vZGlmaWVkIHRvIHNlbmQgbW9yZSByYXRlcy4KKyAgICAgICAgICAgICAqLworCisgICAgICAgICAgICAvKiBUbyBhdm9pZCBEYXRhIEN1cnJwdGlvbiAsIHNldCB0byBtYXggbGVuZ3RoIHRvIFNJUl9NQUNfTUFYX1NVUFBfUkFURVMKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgaWYgKFN0YVBhcmFtcy5zdXBwb3J0ZWRfcmF0ZXNfbGVuID4gU0lSX01BQ19NQVhfU1VQUF9SQVRFUykKKyAgICAgICAgICAgICAgICBTdGFQYXJhbXMuc3VwcG9ydGVkX3JhdGVzX2xlbiA9IFNJUl9NQUNfTUFYX1NVUFBfUkFURVM7CisKKyAgICAgICAgICAgIGlmICgwICE9IFN0YVBhcmFtcy5zdXBwb3J0ZWRfcmF0ZXNfbGVuKSB7CisgICAgICAgICAgICAgICAgaW50IGkgPSAwOworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShTdGFQYXJhbXMuc3VwcG9ydGVkX3JhdGVzLCBwYXJhbXMtPnN1cHBvcnRlZF9yYXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RhUGFyYW1zLnN1cHBvcnRlZF9yYXRlc19sZW4pOworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIlN1cHBvcnRlZCBSYXRlcyB3aXRoIExlbmd0aCAlZCIsIFN0YVBhcmFtcy5zdXBwb3J0ZWRfcmF0ZXNfbGVuKTsKKyAgICAgICAgICAgICAgICBmb3IgKGk9MDsgaSA8IFN0YVBhcmFtcy5zdXBwb3J0ZWRfcmF0ZXNfbGVuOyBpKyspCisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJbJWRdOiAlMHgiLCBpLCBTdGFQYXJhbXMuc3VwcG9ydGVkX3JhdGVzW2ldKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKE5VTEwgIT0gcGFyYW1zLT52aHRfY2FwYSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBTdGFQYXJhbXMudmh0Y2FwX3ByZXNlbnQgPSAxOworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmU3RhUGFyYW1zLlZIVENhcCwgcGFyYW1zLT52aHRfY2FwYSwgc2l6ZW9mKHRTaXJWSFRDYXApKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKDAgIT0gcGFyYW1zLT5leHRfY2FwYWJfbGVuICkgeworICAgICAgICAgICAgICAgIC8qRGVmaW5lIEEgTWFjcm8gOiBUT0RPIFN1bmlsKi8KKyAgICAgICAgICAgICAgICBpZiAoKDE8PDQpICYgU3RhUGFyYW1zLmV4dG5fY2FwYWJpbGl0eVszXSkgeworICAgICAgICAgICAgICAgICAgICBpc0J1ZlN0YSA9IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8qIFRETFMgQ2hhbm5lbCBTd2l0Y2hpbmcgU3VwcG9ydCAqLworICAgICAgICAgICAgICAgIGlmICgoMTw8NikgJiBTdGFQYXJhbXMuZXh0bl9jYXBhYmlsaXR5WzNdKSB7CisgICAgICAgICAgICAgICAgICAgIGlzT2ZmQ2hhbm5lbFN1cHBvcnRlZCA9IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgc3RhdHVzID0gd2xhbl9oZGRfdGRsc19zZXRfcGVlcl9jYXBzKCBwQWRhcHRlciwgbWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmU3RhUGFyYW1zLCBpc0J1ZlN0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNPZmZDaGFubmVsU3VwcG9ydGVkKTsKKworICAgICAgICAgICAgaWYgKFZPU19TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiB3bGFuX2hkZF90ZGxzX3NldF9wZWVyX2NhcHMgZmFpbGVkISIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHN0YXR1cyA9IHdsYW5faGRkX3RkbHNfYWRkX3N0YXRpb24od2lwaHksIGRldiwgbWFjLCAxLCAmU3RhUGFyYW1zKTsKKworICAgICAgICAgICAgaWYgKFZPU19TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBzbWVfQ2hhbmdlVGRsc1BlZXJTdGEgZmFpbGVkISIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorI2VuZGlmCisgICAgfQorICAgIEVYSVQoKTsKKyAgICByZXR1cm4gc3RhdHVzOworfQorCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE2LDApKQorc3RhdGljIGludCB3bGFuX2hkZF9jaGFuZ2Vfc3RhdGlvbihzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqbWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgc3RhdGlvbl9wYXJhbWV0ZXJzICpwYXJhbXMpCisjZWxzZQorc3RhdGljIGludCB3bGFuX2hkZF9jaGFuZ2Vfc3RhdGlvbihzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCAqbWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgc3RhdGlvbl9wYXJhbWV0ZXJzICpwYXJhbXMpCisjZW5kaWYKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX3dsYW5faGRkX2NoYW5nZV9zdGF0aW9uKHdpcGh5LCBkZXYsIG1hYywgcGFyYW1zKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCisvKgorICogRlVOQ1RJT046IF9fd2xhbl9oZGRfY2ZnODAyMTFfYWRkX2tleQorICogVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHRvIGluaXRpYWxpemUgdGhlIGtleSBpbmZvcm1hdGlvbgorICovCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigyLDYsMzgpKQorc3RhdGljIGludCBfX3dsYW5faGRkX2NmZzgwMjExX2FkZF9rZXkoIHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpuZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCBrZXlfaW5kZXgsIGJvb2wgcGFpcndpc2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICptYWNfYWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGtleV9wYXJhbXMgKnBhcmFtcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApCisjZWxzZQorc3RhdGljIGludCBfX3dsYW5faGRkX2NmZzgwMjExX2FkZF9rZXkoIHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpuZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCBrZXlfaW5kZXgsIGNvbnN0IHU4ICptYWNfYWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGtleV9wYXJhbXMgKnBhcmFtcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApCisjZW5kaWYKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciA9IFdMQU5fSEREX0dFVF9QUklWX1BUUiggbmRldiApOworICAgIHRDc3JSb2FtU2V0S2V5ICBzZXRLZXk7CisgICAgdTggZ3JvdXBtYWNhZGRyW1dOSV9DRkdfQlNTSURfTEVOXSA9IHsweEZGLDB4RkYsMHhGRiwweEZGLDB4RkYsMHhGRn07CisgICAgaW50IHN0YXR1czsKKyAgICB2X1UzMl90IHJvYW1JZD0gMHhGRjsKKyAgICB2X0NPTlRFWFRfdCBwVm9zQ29udGV4dCA9IChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPnB2b3NDb250ZXh0OworICAgIGhkZF9ob3N0YXBkX3N0YXRlX3QgKnBIb3N0YXBkU3RhdGU7CisgICAgVk9TX1NUQVRVUyB2b3Nfc3RhdHVzOworICAgIGVIYWxTdGF0dXMgaGFsU3RhdHVzOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisKKyAgICBFTlRFUigpOworCisgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX0hERCwKKyAgICAgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfSEREX0NGRzgwMjExX0FERF9LRVksCisgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwgcGFyYW1zLT5rZXlfbGVuKSk7CisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIHN0YXR1cyA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gc3RhdHVzKQorICAgIHsKKyAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICB9CisKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczogZGV2aWNlX21vZGUgPSAlcyAoJWQpIiwKKyAgICAgICAgICAgIF9fZnVuY19fLCBoZGRfZGV2aWNlX21vZGV0b1N0cmluZyhwQWRhcHRlci0+ZGV2aWNlX21vZGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSk7CisKKyAgICBpZiAoQ1NSX01BWF9OVU1fS0VZIDw9IGtleV9pbmRleCkKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogSW52YWxpZCBrZXkgaW5kZXggJWQiLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICBrZXlfaW5kZXgpOworCisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIGlmIChDU1JfTUFYX0tFWV9MRU4gPCBwYXJhbXMtPmtleV9sZW4pCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IEludmFsaWQga2V5IGxlbmd0aCAlZCIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgIHBhcmFtcy0+a2V5X2xlbik7CisKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAiJXM6IGNhbGxlZCB3aXRoIGtleSBpbmRleCA9ICVkICYga2V5IGxlbmd0aCAlZCIsCisgICAgICAgICAgIF9fZnVuY19fLCBrZXlfaW5kZXgsIHBhcmFtcy0+a2V5X2xlbik7CisKKyAgICAvKmV4dHJhY3Qga2V5IGlkeCwga2V5IGxlbiBhbmQga2V5Ki8KKyAgICB2b3NfbWVtX3plcm8oJnNldEtleSxzaXplb2YodENzclJvYW1TZXRLZXkpKTsKKyAgICBzZXRLZXkua2V5SWQgPSBrZXlfaW5kZXg7CisgICAgc2V0S2V5LmtleUxlbmd0aCA9IHBhcmFtcy0+a2V5X2xlbjsKKyAgICB2b3NfbWVtX2NvcHkoJnNldEtleS5LZXlbMF0scGFyYW1zLT5rZXksIHBhcmFtcy0+a2V5X2xlbik7CisKKyAgICBzd2l0Y2ggKHBhcmFtcy0+Y2lwaGVyKQorICAgIHsKKyAgICAgICAgY2FzZSBXTEFOX0NJUEhFUl9TVUlURV9XRVA0MDoKKyAgICAgICAgICAgIHNldEtleS5lbmNUeXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfV0VQNDBfU1RBVElDS0VZOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBXTEFOX0NJUEhFUl9TVUlURV9XRVAxMDQ6CisgICAgICAgICAgICBzZXRLZXkuZW5jVHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX1dFUDEwNF9TVEFUSUNLRVk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFdMQU5fQ0lQSEVSX1NVSVRFX1RLSVA6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdTggKnBLZXkgPSAmc2V0S2V5LktleVswXTsKKyAgICAgICAgICAgICAgICBzZXRLZXkuZW5jVHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX1RLSVA7CisKKyAgICAgICAgICAgICAgICB2b3NfbWVtX3plcm8ocEtleSwgQ1NSX01BWF9LRVlfTEVOKTsKKworICAgICAgICAgICAgICAgIC8qU3VwcGxpY2FudCBzZW5kcyB0aGUgMzJieXRlcyBrZXkgaW4gdGhpcyBvcmRlcgorCisgICAgICAgICAgICAgICAgICB8LS0tLS0tLS0tLS0tLS18LS0tLS0tLS0tLXwtLS0tLS0tLS0tfAorICAgICAgICAgICAgICAgICAgfCAgIFRrMSAgICAgICAgfFRYLU1JQyAgICB8ICBSWCBNaWMgIHwKKyAgICAgICAgICAgICAgICAgIHwtLS0tLS0tLS0tLS0tLXwtLS0tLS0tLS0tfC0tLS0tLS0tLS18CisgICAgICAgICAgICAgICAgICA8LS0tMTZieXRlcy0tLT48LS04Ynl0ZXMtLT48LS04Ynl0ZXMtLT4KKworICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgLypTbWUgZXhwZWN0cyB0aGUgMzIgYnl0ZXMga2V5IHRvIGJlIGluIHRoZSBiZWxvdyBvcmRlcgorCisgICAgICAgICAgICAgICAgICB8LS0tLS0tLS0tLS0tLS18LS0tLS0tLS0tLXwtLS0tLS0tLS0tfAorICAgICAgICAgICAgICAgICAgfCAgIFRrMSAgICAgICAgfFJYLU1JQyAgICB8ICBUWCBNaWMgIHwKKyAgICAgICAgICAgICAgICAgIHwtLS0tLS0tLS0tLS0tLXwtLS0tLS0tLS0tfC0tLS0tLS0tLS18CisgICAgICAgICAgICAgICAgICA8LS0tMTZieXRlcy0tLT48LS04Ynl0ZXMtLT48LS04Ynl0ZXMtLT4KKyAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgLyogQ29weSB0aGUgVGVtcG9yYWwgS2V5IDEgKFRLMSkgKi8KKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocEtleSwgcGFyYW1zLT5rZXksIDE2KTsKKworICAgICAgICAgICAgICAgIC8qQ29weSB0aGUgcnggbWljIGZpcnN0Ki8KKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnBLZXlbMTZdLCAmcGFyYW1zLT5rZXlbMjRdLCA4KTsKKworICAgICAgICAgICAgICAgIC8qQ29weSB0aGUgdHggbWljICovCisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwS2V5WzI0XSwgJnBhcmFtcy0+a2V5WzE2XSwgOCk7CisKKworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorCisgICAgICAgIGNhc2UgV0xBTl9DSVBIRVJfU1VJVEVfQ0NNUDoKKyAgICAgICAgICAgIHNldEtleS5lbmNUeXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfQUVTOworICAgICAgICAgICAgYnJlYWs7CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fV0FQSQorICAgICAgICBjYXNlIFdMQU5fQ0lQSEVSX1NVSVRFX1NNUzQ6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV96ZXJvKCZzZXRLZXksc2l6ZW9mKHRDc3JSb2FtU2V0S2V5KSk7CisgICAgICAgICAgICAgICAgd2xhbl9oZGRfY2ZnODAyMTFfc2V0X2tleV93YXBpKHBBZGFwdGVyLCBrZXlfaW5kZXgsIG1hY19hZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLT5rZXksIHBhcmFtcy0+a2V5X2xlbik7CisgICAgICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgICAgICB9CisjZW5kaWYKKworI2lmZGVmIEZFQVRVUkVfV0xBTl9FU0UKKyAgICAgICAgY2FzZSBXTEFOX0NJUEhFUl9TVUlURV9LUks6CisgICAgICAgICAgICBzZXRLZXkuZW5jVHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX0tSSzsKKyAgICAgICAgICAgIGJyZWFrOworI2VuZGlmCisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisgICAgICAgIGNhc2UgV0xBTl9DSVBIRVJfU1VJVEVfQUVTX0NNQUM6CisgICAgICAgICAgICBzZXRLZXkuZW5jVHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX0FFU19DTUFDOworICAgICAgICAgICAgYnJlYWs7CisjZW5kaWYKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiB1bnN1cHBvcnRlZCBjaXBoZXIgdHlwZSAldSIsCisgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBwYXJhbXMtPmNpcGhlcik7CisgICAgICAgICAgICBzdGF0dXMgPSAtRU9QTk9UU1VQUDsKKyAgICAgICAgICAgIGdvdG8gZW5kOworICAgIH0KKworICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GT19NRUQsICIlczogZW5jcnlwdGlvbiB0eXBlICVkIiwKKyAgICAgICAgICAgIF9fZnVuY19fLCBzZXRLZXkuZW5jVHlwZSk7CisKKyAgICBpZiAoCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigyLDYsMzgpKQorICAgICAgICAgICAgICAgICghcGFpcndpc2UpCisjZWxzZQorICAgICAgICAgICAgICAgICghbWFjX2FkZHIgfHwgaXNfYnJvYWRjYXN0X2V0aGVyX2FkZHIobWFjX2FkZHIpKQorI2VuZGlmCisgICAgICAgKQorICAgIHsKKyAgICAgICAgLyogc2V0IGdyb3VwIGtleSovCisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICIlcy0gJWQ6IHNldHRpbmcgQnJvYWRjYXN0IGtleSIsCisgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fKTsKKyAgICAgICAgc2V0S2V5LmtleURpcmVjdGlvbiA9IGVTSVJfUlhfT05MWTsKKyAgICAgICAgdm9zX21lbV9jb3B5KHNldEtleS5wZWVyTWFjLGdyb3VwbWFjYWRkcixXTklfQ0ZHX0JTU0lEX0xFTik7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIC8qIHNldCBwYWlyd2lzZSBrZXkqLworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAiJXMtICVkOiBzZXR0aW5nIHBhaXJ3aXNlIGtleSIsCisgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fKTsKKyAgICAgICAgc2V0S2V5LmtleURpcmVjdGlvbiA9IGVTSVJfVFhfUlg7CisgICAgICAgIHZvc19tZW1fY29weShzZXRLZXkucGVlck1hYywgbWFjX2FkZHIsV05JX0NGR19CU1NJRF9MRU4pOworICAgIH0KKyAgICBpZiAoKFdMQU5fSEREX0lCU1MgPT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKSAmJiAhcGFpcndpc2UpCisgICAgeworICAgICAgICBzZXRLZXkua2V5RGlyZWN0aW9uID0gZVNJUl9UWF9SWDsKKyAgICAgICAgLypTZXQgdGhlIGdyb3VwIGtleSovCisgICAgICAgIHN0YXR1cyA9IHNtZV9Sb2FtU2V0S2V5KCBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCAmc2V0S2V5LCAmcm9hbUlkICk7CisKKyAgICAgICAgaWYgKCAwICE9IHN0YXR1cyApCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICIlczogc21lX1JvYW1TZXRLZXkgZmFpbGVkLCByZXR1cm5lZCAlZCIsIF9fZnVuY19fLCBzdGF0dXMpOworICAgICAgICAgICAgc3RhdHVzID0gLUVJTlZBTDsKKyAgICAgICAgICAgIGdvdG8gZW5kOworICAgICAgICB9CisgICAgICAgIC8qU2F2ZSB0aGUga2V5cyBoZXJlIGFuZCBjYWxsIHNtZV9Sb2FtU2V0S2V5IGZvciBzZXR0aW5nCisgICAgICAgICAgdGhlIFBUSyBhZnRlciBwZWVyIGpvaW5zIHRoZSBJQlNTIG5ldHdvcmsqLworICAgICAgICB2b3NfbWVtX2NvcHkoJnBBZGFwdGVyLT5zZXNzaW9uQ3R4LnN0YXRpb24uaWJzc19lbmNfa2V5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnNldEtleSwgc2l6ZW9mKHRDc3JSb2FtU2V0S2V5KSk7CisgICAgICAgIGdvdG8gZW5kOworICAgIH0KKyAgICBpZiAoKHBBZGFwdGVyLT5kZXZpY2VfbW9kZSA9PSBXTEFOX0hERF9TT0ZUQVApIHx8CisgICAgICAgICAgIChwQWRhcHRlci0+ZGV2aWNlX21vZGUgPT0gV0xBTl9IRERfUDJQX0dPKSkKKyAgICB7CisgICAgICAgIHBIb3N0YXBkU3RhdGUgPSBXTEFOX0hERF9HRVRfSE9TVEFQX1NUQVRFX1BUUihwQWRhcHRlcik7CisgICAgICAgIGlmKCBwSG9zdGFwZFN0YXRlLT5ic3NTdGF0ZSA9PSBCU1NfU1RBUlQgKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRfc3RhdGlvbl9jdHhfdCAqcEhkZFN0YUN0eCA9IFdMQU5fSEREX0dFVF9TVEFUSU9OX0NUWF9QVFIocEFkYXB0ZXIpOworICAgICAgICAgICAgdm9zX3N0YXR1cyA9IHdsYW5faGRkX2NoZWNrX3VsYV9kb25lKHBBZGFwdGVyKTsKKworICAgICAgICAgICAgaWYgKCB2b3Nfc3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgIlslNGRdIHdsYW5faGRkX2NoZWNrX3VsYV9kb25lIHJldHVybmVkIEVSUk9SIHN0YXR1cz0gJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgX19MSU5FX18sIHZvc19zdGF0dXMgKTsKKworICAgICAgICAgICAgICAgIHBIZGRTdGFDdHgtPnJvYW1faW5mby5yb2FtaW5nU3RhdGUgPSBIRERfUk9BTV9TVEFURV9OT05FOworCisgICAgICAgICAgICAgICAgc3RhdHVzID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgICBnb3RvIGVuZDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc3RhdHVzID0gV0xBTlNBUF9TZXRLZXlTdGEoIHBWb3NDb250ZXh0LCAmc2V0S2V5KTsKKworICAgICAgICAgICAgaWYgKCBzdGF0dXMgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgIlslNGRdIFdMQU5TQVBfU2V0S2V5U3RhIHJldHVybmVkIEVSUk9SIHN0YXR1cz0gJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgX19MSU5FX18sIHN0YXR1cyApOworICAgICAgICAgICAgICAgIHN0YXR1cyA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICAgZ290byBlbmQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvKiBTYXZpbmcgV0VQIGtleXMgKi8KKyAgICAgICAgZWxzZSBpZiggZUNTUl9FTkNSWVBUX1RZUEVfV0VQNDBfU1RBVElDS0VZICA9PSBzZXRLZXkuZW5jVHlwZSB8fAorICAgICAgICAgICAgICAgIGVDU1JfRU5DUllQVF9UWVBFX1dFUDEwNF9TVEFUSUNLRVkgID09IHNldEtleS5lbmNUeXBlICApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vU2F2ZSB0aGUgd2VwIGtleSBpbiBhcCBjb250ZXh0LiBJc3N1ZSBzZXRrZXkgYWZ0ZXIgdGhlIEJTUyBpcyBzdGFydGVkLgorICAgICAgICAgICAgaGRkX2FwX2N0eF90ICpwQVBDdHggPSBXTEFOX0hERF9HRVRfQVBfQ1RYX1BUUihwQWRhcHRlcik7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnBBUEN0eC0+d2VwS2V5W2tleV9pbmRleF0sICZzZXRLZXksIHNpemVvZih0Q3NyUm9hbVNldEtleSkpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLy9TYXZlIHRoZSBrZXkgaW4gYXAgY29udGV4dC4gSXNzdWUgc2V0a2V5IGFmdGVyIHRoZSBCU1MgaXMgc3RhcnRlZC4KKyAgICAgICAgICAgIGhkZF9hcF9jdHhfdCAqcEFQQ3R4ID0gV0xBTl9IRERfR0VUX0FQX0NUWF9QVFIocEFkYXB0ZXIpOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwQVBDdHgtPmdyb3VwS2V5LCAmc2V0S2V5LCBzaXplb2YodENzclJvYW1TZXRLZXkpKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmICggKHBBZGFwdGVyLT5kZXZpY2VfbW9kZSA9PSBXTEFOX0hERF9JTkZSQV9TVEFUSU9OKSB8fAorICAgICAgICAgICAgICAocEFkYXB0ZXItPmRldmljZV9tb2RlID09IFdMQU5fSEREX1AyUF9DTElFTlQpICkKKyAgICB7CisgICAgICAgIGhkZF93ZXh0X3N0YXRlX3QgKnBXZXh0U3RhdGUgPSBXTEFOX0hERF9HRVRfV0VYVF9TVEFURV9QVFIocEFkYXB0ZXIpOworICAgICAgICBoZGRfc3RhdGlvbl9jdHhfdCAqcEhkZFN0YUN0eCA9IFdMQU5fSEREX0dFVF9TVEFUSU9OX0NUWF9QVFIocEFkYXB0ZXIpOworCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigyLDYsMzgpKQorICAgICAgICBpZiAoIXBhaXJ3aXNlKQorI2Vsc2UKKyAgICAgICAgaWYgKCFtYWNfYWRkciB8fCBpc19icm9hZGNhc3RfZXRoZXJfYWRkcihtYWNfYWRkcikpCisjZW5kaWYKKyAgICAgICAgeworICAgICAgICAgICAgLyogc2V0IGdyb3VwIGtleSovCisgICAgICAgICAgICBpZiAocEhkZFN0YUN0eC0+cm9hbV9pbmZvLmRlZmVyS2V5Q29tcGxldGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXMtICVkOiBQZXJmb3JtIFNldCBrZXkgQ29tcGxldGUiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fKTsKKyAgICAgICAgICAgICAgICBoZGRfUGVyZm9ybVJvYW1TZXRLZXlDb21wbGV0ZShwQWRhcHRlcik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwV2V4dFN0YXRlLT5yb2FtUHJvZmlsZS5LZXlzLktleUxlbmd0aFtrZXlfaW5kZXhdID0gKHU4KXBhcmFtcy0+a2V5X2xlbjsKKworICAgICAgICBwV2V4dFN0YXRlLT5yb2FtUHJvZmlsZS5LZXlzLmRlZmF1bHRJbmRleCA9IGtleV9pbmRleDsKKworCisgICAgICAgIHZvc19tZW1fY29weSgmcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUuS2V5cy5LZXlNYXRlcmlhbFtrZXlfaW5kZXhdWzBdLAorICAgICAgICAgICAgICAgIHBhcmFtcy0+a2V5LCBwYXJhbXMtPmtleV9sZW4pOworCisKKyAgICAgICAgcEhkZFN0YUN0eC0+cm9hbV9pbmZvLnJvYW1pbmdTdGF0ZSA9IEhERF9ST0FNX1NUQVRFX1NFVFRJTkdfS0VZOworCisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GT19NRUQsCisgICAgICAgICAgICAgICAgIiVzOiBzZXQga2V5IGZvciBwZWVyTWFjICUyeDolMng6JTJ4OiUyeDolMng6JTJ4LCBkaXJlY3Rpb24gJWQiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fLCBzZXRLZXkucGVlck1hY1swXSwgc2V0S2V5LnBlZXJNYWNbMV0sCisgICAgICAgICAgICAgICAgc2V0S2V5LnBlZXJNYWNbMl0sIHNldEtleS5wZWVyTWFjWzNdLAorICAgICAgICAgICAgICAgIHNldEtleS5wZWVyTWFjWzRdLCBzZXRLZXkucGVlck1hY1s1XSwKKyAgICAgICAgICAgICAgICBzZXRLZXkua2V5RGlyZWN0aW9uKTsKKworICAgICAgICB2b3Nfc3RhdHVzID0gd2xhbl9oZGRfY2hlY2tfdWxhX2RvbmUocEFkYXB0ZXIpOworCisgICAgICAgIGlmICggdm9zX3N0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MgKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICJbJTRkXSB3bGFuX2hkZF9jaGVja191bGFfZG9uZSByZXR1cm5lZCBFUlJPUiBzdGF0dXM9ICVkIiwKKyAgICAgICAgICAgICAgICAgICAgX19MSU5FX18sIHZvc19zdGF0dXMgKTsKKworICAgICAgICAgICAgcEhkZFN0YUN0eC0+cm9hbV9pbmZvLnJvYW1pbmdTdGF0ZSA9IEhERF9ST0FNX1NUQVRFX05PTkU7CisKKyAgICAgICAgICAgIHN0YXR1cyA9IC1FSU5WQUw7CisgICAgICAgICAgICBnb3RvIGVuZDsKKworICAgICAgICB9CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUgorICAgICAgICAvKiBUaGUgc3VwcGxpY2FudCBtYXkgYXR0ZW1wdCB0byBzZXQgdGhlIFBUSyBvbmNlIHByZS1hdXRoZW50aWNhdGlvbgorICAgICAgICAgICBpcyBkb25lLiBTYXZlIHRoZSBrZXkgaW4gdGhlIFVNQUMgYW5kIGluY2x1ZGUgaXQgaW4gdGhlIEFERCBCU1MKKyAgICAgICAgICAgcmVxdWVzdCAqLworICAgICAgICBoYWxTdGF0dXMgPSBzbWVfRlRVcGRhdGVLZXkoIFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwgJnNldEtleSk7CisgICAgICAgIGlmICggaGFsU3RhdHVzID09IGVIQUxfU1RBVFVTX0ZUX1BSRUFVVEhfS0VZX1NVQ0NFU1MgKQorICAgICAgICB7CisgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GT19NRUQsCisgICAgICAgICAgICAgICAgICAiJXM6IFVwZGF0ZSBQcmVBdXRoIEtleSBzdWNjZXNzIiwgX19mdW5jX18pOworICAgICAgICAgICBzdGF0dXMgPSAwOworICAgICAgICAgICBnb3RvIGVuZDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmICggaGFsU3RhdHVzID09IGVIQUxfU1RBVFVTX0ZUX1BSRUFVVEhfS0VZX0ZBSUxFRCApCisgICAgICAgIHsKKyAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogVXBkYXRlIFByZUF1dGggS2V5IGZhaWxlZCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgc3RhdHVzID0gLUVJTlZBTDsKKyAgICAgICAgICAgZ290byBlbmQ7CisgICAgICAgIH0KKyNlbmRpZiAvKiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUiAqLworCisgICAgICAgIC8qIGlzc3VlIHNldCBrZXkgcmVxdWVzdCB0byBTTUUqLworICAgICAgICBzdGF0dXMgPSBzbWVfUm9hbVNldEtleSggV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLAorICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsICZzZXRLZXksICZyb2FtSWQgKTsKKworICAgICAgICBpZiAoIDAgIT0gc3RhdHVzICkKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIiVzOiBzbWVfUm9hbVNldEtleSBmYWlsZWQsIHJldHVybmVkICVkIiwgX19mdW5jX18sIHN0YXR1cyk7CisgICAgICAgICAgICBwSGRkU3RhQ3R4LT5yb2FtX2luZm8ucm9hbWluZ1N0YXRlID0gSEREX1JPQU1fU1RBVEVfTk9ORTsKKyAgICAgICAgICAgIHN0YXR1cyA9IC1FSU5WQUw7CisgICAgICAgICAgICBnb3RvIGVuZDsKKyAgICAgICAgfQorCisKKyAgICAgICAgLyogaW4gY2FzZSBvZiBJQlNTIGFzIHRoZXJlIHdhcyBubyBpbmZvcm1hdGlvbiBhdmFpbGFibGUgYWJvdXQgV0VQIGtleXMgZHVyaW5nCisgICAgICAgICAqIElCU1Mgam9pbiwgZ3JvdXAga2V5IGludGlhbGl6ZWQgd2l0aCBOVUxMIGtleSwgc28gcmUtaW5pdGlhbGl6ZSBncm91cCBrZXkKKyAgICAgICAgICogd2l0aCBjb3JyZWN0IHZhbHVlKi8KKyAgICAgICAgaWYgKCAoZUNTUl9CU1NfVFlQRV9TVEFSVF9JQlNTID09IHBXZXh0U3RhdGUtPnJvYW1Qcm9maWxlLkJTU1R5cGUpICYmCisgICAgICAgICAgICAhKCAgKCBJV19BVVRIX0tFWV9NR01UXzgwMl8xWAorICAgICAgICAgICAgICAgICAgICA9PSAocFdleHRTdGF0ZS0+YXV0aEtleU1nbXQgJiBJV19BVVRIX0tFWV9NR01UXzgwMl8xWCkpCisgICAgICAgICAgICAgICAgICAgICYmIChlQ1NSX0FVVEhfVFlQRV9PUEVOX1NZU1RFTSA9PSBwSGRkU3RhQ3R4LT5jb25uX2luZm8uYXV0aFR5cGUpCisgICAgICAgICAgICAgICAgICkKKyAgICAgICAgICAgICAgICAmJgorICAgICAgICAgICAgICAgICggIChXTEFOX0NJUEhFUl9TVUlURV9XRVA0MCA9PSBwYXJhbXMtPmNpcGhlcikKKyAgICAgICAgICAgICAgICAgICB8fCAoV0xBTl9DSVBIRVJfU1VJVEVfV0VQMTA0ID09IHBhcmFtcy0+Y2lwaGVyKQorICAgICAgICAgICAgICAgICkKKyAgICAgICAgICAgKQorICAgICAgICB7CisgICAgICAgICAgICBzZXRLZXkua2V5RGlyZWN0aW9uID0gZVNJUl9SWF9PTkxZOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHNldEtleS5wZWVyTWFjLGdyb3VwbWFjYWRkcixXTklfQ0ZHX0JTU0lEX0xFTik7CisKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GT19NRUQsCisgICAgICAgICAgICAgICAgICAgICIlczogc2V0IGtleSBwZWVyTWFjICUyeDolMng6JTJ4OiUyeDolMng6JTJ4LCBkaXJlY3Rpb24gJWQiLAorICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgc2V0S2V5LnBlZXJNYWNbMF0sIHNldEtleS5wZWVyTWFjWzFdLAorICAgICAgICAgICAgICAgICAgICBzZXRLZXkucGVlck1hY1syXSwgc2V0S2V5LnBlZXJNYWNbM10sCisgICAgICAgICAgICAgICAgICAgIHNldEtleS5wZWVyTWFjWzRdLCBzZXRLZXkucGVlck1hY1s1XSwKKyAgICAgICAgICAgICAgICAgICAgc2V0S2V5LmtleURpcmVjdGlvbik7CisKKyAgICAgICAgICAgIHN0YXR1cyA9IHNtZV9Sb2FtU2V0S2V5KCBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsICZzZXRLZXksICZyb2FtSWQgKTsKKworICAgICAgICAgICAgaWYgKCAwICE9IHN0YXR1cyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICIlczogc21lX1JvYW1TZXRLZXkgZmFpbGVkIGZvciBncm91cCBrZXkgKElCU1MpLCByZXR1cm5lZCAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgc3RhdHVzKTsKKyAgICAgICAgICAgICAgICBwSGRkU3RhQ3R4LT5yb2FtX2luZm8ucm9hbWluZ1N0YXRlID0gSEREX1JPQU1fU1RBVEVfTk9ORTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgIGdvdG8gZW5kOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCitlbmQ6CisgICAgLyogTmVlZCB0byBjbGVhciBhbnkgdHJhY2Ugb2Yga2V5IHZhbHVlIGluIHRoZSBtZW1vcnkuCisgICAgICogVGh1cyB6ZXJvIG91dCB0aGUgbWVtb3J5IGV2ZW4gdGhvdWdoIGl0IGlzIGxvY2FsCisgICAgICogdmFyaWFibGUuCisgICAgICovCisgICAgdm9zX21lbV96ZXJvKCZzZXRLZXksIHNpemVvZihzZXRLZXkpKTsKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIHN0YXR1czsKK30KKworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMiw2LDM4KSkKK3N0YXRpYyBpbnQgd2xhbl9oZGRfY2ZnODAyMTFfYWRkX2tleSggc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKm5kZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4IGtleV9pbmRleCwgYm9vbCBwYWlyd2lzZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKm1hY19hZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qga2V5X3BhcmFtcyAqcGFyYW1zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKKyNlbHNlCitzdGF0aWMgaW50IHdsYW5faGRkX2NmZzgwMjExX2FkZF9rZXkoIHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpuZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCBrZXlfaW5kZXgsIGNvbnN0IHU4ICptYWNfYWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGtleV9wYXJhbXMgKnBhcmFtcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApCisjZW5kaWYKK3sKKyAgICBpbnQgcmV0OworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigyLDYsMzgpKQorICAgIHJldCA9IF9fd2xhbl9oZGRfY2ZnODAyMTFfYWRkX2tleSh3aXBoeSwgbmRldiwga2V5X2luZGV4LCBwYWlyd2lzZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFjX2FkZHIsIHBhcmFtcyk7CisjZWxzZQorICAgIHJldCA9IF9fd2xhbl9oZGRfY2ZnODAyMTFfYWRkX2tleSh3aXBoeSwgbmRldiwga2V5X2luZGV4LCBtYWNfYWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcyk7CisjZW5kaWYKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCisvKgorICogRlVOQ1RJT046IF9fd2xhbl9oZGRfY2ZnODAyMTFfZ2V0X2tleQorICogVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHRvIGdldCB0aGUga2V5IGluZm9ybWF0aW9uCisgKi8KKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDIsNiwzOCkpCitzdGF0aWMgaW50IF9fd2xhbl9oZGRfY2ZnODAyMTFfZ2V0X2tleSgKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqbmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHU4IGtleV9pbmRleCwgYm9vbCBwYWlyd2lzZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICptYWNfYWRkciwgdm9pZCAqY29va2llLAorICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAoKmNhbGxiYWNrKSh2b2lkICpjb29raWUsIHN0cnVjdCBrZXlfcGFyYW1zKikKKyAgICAgICAgICAgICAgICAgICAgICAgICkKKyNlbHNlCitzdGF0aWMgaW50IF9fd2xhbl9oZGRfY2ZnODAyMTFfZ2V0X2tleSgKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqbmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHU4IGtleV9pbmRleCwgY29uc3QgdTggKm1hY19hZGRyLCB2b2lkICpjb29raWUsCisgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICgqY2FsbGJhY2spKHZvaWQgKmNvb2tpZSwgc3RydWN0IGtleV9wYXJhbXMqKQorICAgICAgICAgICAgICAgICAgICAgICAgKQorI2VuZGlmCit7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoIG5kZXYgKTsKKyAgICBoZGRfd2V4dF9zdGF0ZV90ICpwV2V4dFN0YXRlID0gTlVMTDsKKyAgICB0Q3NyUm9hbVByb2ZpbGUgKnBSb2FtUHJvZmlsZSA9IE5VTEw7CisgICAgc3RydWN0IGtleV9wYXJhbXMgcGFyYW1zOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgaW50IHJldCA9IDA7CisKKyAgICBFTlRFUigpOworCisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgIiVzOiBIREQgYWRhcHRlciBpcyBOdWxsIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVOT0RFVjsKKyAgICB9CisKKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgcmV0ID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSByZXQpCisgICAgeworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKworICAgIHBXZXh0U3RhdGUgPSBXTEFOX0hERF9HRVRfV0VYVF9TVEFURV9QVFIocEFkYXB0ZXIpOworICAgIHBSb2FtUHJvZmlsZSA9ICYocFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUpOworCisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXM6IGRldmljZV9tb2RlID0gJXMgKCVkKSIsCisgICAgICAgICAgICBfX2Z1bmNfXywgaGRkX2RldmljZV9tb2RldG9TdHJpbmcocEFkYXB0ZXItPmRldmljZV9tb2RlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+ZGV2aWNlX21vZGUpOworCisgICAgbWVtc2V0KCZwYXJhbXMsIDAsIHNpemVvZihwYXJhbXMpKTsKKworICAgIGlmIChDU1JfTUFYX05VTV9LRVkgPD0ga2V5X2luZGV4KQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoImludmFsaWQga2V5IGluZGV4ICVkIiksIGtleV9pbmRleCk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIHN3aXRjaChwUm9hbVByb2ZpbGUtPkVuY3J5cHRpb25UeXBlLmVuY3J5cHRpb25UeXBlWzBdKQorICAgIHsKKyAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9OT05FOgorICAgICAgICAgICAgcGFyYW1zLmNpcGhlciA9IElXX0FVVEhfQ0lQSEVSX05PTkU7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVDU1JfRU5DUllQVF9UWVBFX1dFUDQwX1NUQVRJQ0tFWToKKyAgICAgICAgY2FzZ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gIHBhcmFtcy5zZXEgPSBOVUxMOworICAgIHBhcmFtcy5rZXkgPSAmcFJvYW1Qcm9maWxlLT5LZXlzLktleU1hdGVyaWFsW2tleV9pbmRleF1bMF07CisgICAgY2FsbGJhY2soY29va2llLCAmcGFyYW1zKTsKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIDA7Cit9CisKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDIsNiwzOCkpCitzdGF0aWMgaW50IHdsYW5faGRkX2NmZzgwMjExX2dldF9rZXkoCisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKm5kZXYsCisgICAgICAgICAgICAgICAgICAgICAgICB1OCBrZXlfaW5kZXgsIGJvb2wgcGFpcndpc2UsCisgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqbWFjX2FkZHIsIHZvaWQgKmNvb2tpZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKCpjYWxsYmFjaykodm9pZCAqY29va2llLCBzdHJ1Y3Qga2V5X3BhcmFtcyopCisgICAgICAgICAgICAgICAgICAgICAgICApCisjZWxzZQorc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV9nZXRfa2V5KAorICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpuZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgdTgga2V5X2luZGV4LCBjb25zdCB1OCAqbWFjX2FkZHIsIHZvaWQgKmNvb2tpZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKCpjYWxsYmFjaykodm9pZCAqY29va2llLCBzdHJ1Y3Qga2V5X3BhcmFtcyopCisgICAgICAgICAgICAgICAgICAgICAgICApCisjZW5kaWYKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDIsNiwzOCkpCisgICAgcmV0ID0gX193bGFuX2hkZF9jZmc4MDIxMV9nZXRfa2V5KHdpcGh5LCBuZGV2LCBrZXlfaW5kZXgsIHBhaXJ3aXNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFjX2FkZHIsIGNvb2tpZSwgY2FsbGJhY2spOworI2Vsc2UKKyAgICByZXQgPSBfX3dsYW5faGRkX2NmZzgwMjExX2dldF9rZXkod2lwaHksIG5kZXYsIGtleV9pbmRleCwgbWFjX2FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayk7CisjZW5kaWYKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCisvKgorICogRlVOQ1RJT046IF9fd2xhbl9oZGRfY2ZnODAyMTFfZGVsX2tleQorICogVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHRvIGRlbGV0ZSB0aGUga2V5IGluZm9ybWF0aW9uCisgKi8KKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDIsNiwzOCkpCitzdGF0aWMgaW50IF9fd2xhbl9oZGRfY2ZnODAyMTFfZGVsX2tleSggc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKm5kZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4IGtleV9pbmRleCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBwYWlyd2lzZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKm1hY19hZGRyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApCisjZWxzZQorc3RhdGljIGludCBfX3dsYW5faGRkX2NmZzgwMjExX2RlbF9rZXkoIHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpuZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCBrZXlfaW5kZXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICptYWNfYWRkcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKQorI2VuZGlmCit7CisgICAgaW50IHN0YXR1cyA9IDA7CisKKyAgICAvL1RoaXMgY29kZSBuZWVkcyB0byBiZSByZXZpc2l0ZWQuIFRoZXJlIGlzIHNtZV9yZW1vdmVLZXkgQVBJLCB3ZSBzaG91bGQKKyAgICAvL3BsYW4gdG8gdXNlIHRoYXQuIEFmdGVyIHRoZSBjaGFuZ2UgdG8gdXNlIGNvcnJlY3QgaW5kZXggaW4gc2V0a2V5LAorICAgIC8vaXQgaXMgb2JzZXJ2ZWQgdGhhdCB0aGlzIGlzIGludmFsaWRhdGluZyBwZWVyCisgICAgLy9rZXkgaW5kZXggd2hlbmV2ZXIgcmUta2V5IGlzIGRvbmUuIFRoaXMgaXMgYWZmZWN0aW5nIGRhdGEgbGluay4KKyAgICAvL0l0IHNob3VsZCBiZSBvayB0byBpZ25vcmUgZGVsX2tleS4KKyNpZiAwCisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoIG5kZXYgKTsKKyAgICB2X0NPTlRFWFRfdCBwVm9zQ29udGV4dCA9IChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPnB2b3NDb250ZXh0OworICAgIHU4IGdyb3VwbWFjYWRkcltXTklfQ0ZHX0JTU0lEX0xFTl0gPSB7MHhGRiwweEZGLDB4RkYsMHhGRiwweEZGLDB4RkZ9OworICAgIHRDc3JSb2FtU2V0S2V5ICBzZXRLZXk7CisgICAgdl9VMzJfdCByb2FtSWQ9IDB4RkY7CisKKyAgICBFTlRFUigpOworCisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICIlczogZGV2aWNlX21vZGUgPSAlZFxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyxwQWRhcHRlci0+ZGV2aWNlX21vZGUpOworCisgICAgaWYgKENTUl9NQVhfTlVNX0tFWSA8PSBrZXlfaW5kZXgpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IEludmFsaWQga2V5IGluZGV4ICVkIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAga2V5X2luZGV4KTsKKworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICB2b3NfbWVtX3plcm8oJnNldEtleSxzaXplb2YodENzclJvYW1TZXRLZXkpKTsKKyAgICBzZXRLZXkua2V5SWQgPSBrZXlfaW5kZXg7CisKKyAgICBpZiAobWFjX2FkZHIpCisgICAgICAgIHZvc19tZW1fY29weShzZXRLZXkucGVlck1hYywgbWFjX2FkZHIsV05JX0NGR19CU1NJRF9MRU4pOworICAgIGVsc2UKKyAgICAgICAgdm9zX21lbV9jb3B5KHNldEtleS5wZWVyTWFjLCBncm91cG1hY2FkZHIsIFdOSV9DRkdfQlNTSURfTEVOKTsKKworICAgIHNldEtleS5lbmNUeXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfTk9ORTsKKworICAgIGlmICgocEFkYXB0ZXItPmRldmljZV9tb2RlID09IFdMQU5fSEREX1NPRlRBUCkKKyAgICAgIHx8IChwQWRhcHRlci0+ZGV2aWNlX21vZGUgPT0gV0xBTl9IRERfUDJQX0dPKQorICAgICAgICkKKyAgICB7CisKKyAgICAgICAgaGRkX2hvc3RhcGRfc3RhdGVfdCAqcEhvc3RhcGRTdGF0ZSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9IRERfR0VUX0hPU1RBUF9TVEFURV9QVFIocEFkYXB0ZXIpOworICAgICAgICBpZiggcEhvc3RhcGRTdGF0ZS0+YnNzU3RhdGUgPT0gQlNTX1NUQVJUKQorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSBXTEFOU0FQX1NldEtleVN0YSggcFZvc0NvbnRleHQsICZzZXRLZXkpOworCisgICAgICAgICAgICBpZiAoIHN0YXR1cyAhPSBlSEFMX1NUQVRVU19TVUNDRVNTICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAiWyU0ZF0gV0xBTlNBUF9TZXRLZXlTdGEgcmV0dXJuZWQgRVJST1Igc3RhdHVzPSAlZCIsCisgICAgICAgICAgICAgICAgICAgICBfX0xJTkVfXywgc3RhdHVzICk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoIChwQWRhcHRlci0+ZGV2aWNlX21vZGUgPT0gV0xBTl9IRERfSU5GUkFfU1RBVElPTikKKyAgICAgICAgICAgfHwgKHBBZGFwdGVyLT5kZXZpY2VfbW9kZSA9PSBXTEFOX0hERF9QMlBfQ0xJRU5UKQorICAgICAgICAgICAgKQorICAgIHsKKyAgICAgICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKworICAgICAgICBwSGRkU3RhQ3R4LT5yb2FtX2luZm8ucm9hbWluZ1N0YXRlID0gSEREX1JPQU1fU1RBVEVfU0VUVElOR19LRVk7CisKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPX01FRCwKKyAgICAgICAgICAgICAgICAiJXM6IGRlbGV0ZSBrZXkgZm9yIHBlZXJNYWMgJTJ4OiUyeDolMng6JTJ4OiUyeDolMngiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fLCBzZXRLZXkucGVlck1hY1swXSwgc2V0S2V5LnBlZXJNYWNbMV0sCisgICAgICAgICAgICAgICAgc2V0S2V5LnBlZXJNYWNbMl0sIHNldEtleS5wZWVyTWFjWzNdLAorICAgICAgICAgICAgICAgIHNldEtleS5wZWVyTWFjWzRdLCBzZXRLZXkucGVlck1hY1s1XSk7CisgICAgICAgIGlmKHBBZGFwdGVyLT5zZXNzaW9uQ3R4LnN0YXRpb24uY29ubl9pbmZvLmNvbm5TdGF0ZSA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNvbm5lY3Rpb25TdGF0ZV9Bc3NvY2lhdGVkKQorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSBzbWVfUm9hbVNldEtleSggV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCAmc2V0S2V5LCAmcm9hbUlkICk7CisKKyAgICAgICAgICAgIGlmICggMCAhPSBzdGF0dXMgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IHNtZV9Sb2FtU2V0S2V5IGZhaWx1cmUsIHJldHVybmVkICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHN0YXR1cyk7CisgICAgICAgICAgICAgICAgcEhkZFN0YUN0eC0+cm9hbV9pbmZvLnJvYW1pbmdTdGF0ZSA9IEhERF9ST0FNX1NUQVRFX05PTkU7CisgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisjZW5kaWYKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIHN0YXR1czsKK30KKworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMiw2LDM4KSkKK3N0YXRpYyBpbnQgd2xhbl9oZGRfY2ZnODAyMTFfZGVsX2tleSggc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKm5kZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4IGtleV9pbmRleCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBwYWlyd2lzZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKm1hY19hZGRyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApCisjZWxzZQorc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV9kZWxfa2V5KCBzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqbmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTgga2V5X2luZGV4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqbWFjX2FkZHIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKKyNlbmRpZgoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMiw2LDM4KSkKKyAgICByZXQgPSBfX3dsYW5faGRkX2NmZzgwMjExX2RlbF9rZXkod2lwaHksIG5kZXYsIGtleV9pbmRleCwgcGFpcndpc2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWNfYWRkcik7CisjZWxzZQorICAgIHJldCA9IF9fd2xhbl9oZGRfY2ZnODAyMTFfZGVsX2tleSh3aXBoeSwgbmRldiwga2V5X2luZGV4LCBtYWNfYWRkcik7CisjZW5kaWYKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCisvKgorICogRlVOQ1RJT046IF9fd2xhbl9oZGRfY2ZnODAyMTFfc2V0X2RlZmF1bHRfa2V5CisgKiBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgdG8gc2V0IHRoZSBkZWZhdWx0IHR4IGtleSBpbmRleAorICovCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigyLDYsMzgpKQorc3RhdGljIGludCBfX3dsYW5faGRkX2NmZzgwMjExX3NldF9kZWZhdWx0X2tleSggc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqbmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCBrZXlfaW5kZXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCB1bmljYXN0LCBib29sIG11bHRpY2FzdCkKKyNlbHNlCitzdGF0aWMgaW50IF9fd2xhbl9oZGRfY2ZnODAyMTFfc2V0X2RlZmF1bHRfa2V5KCBzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpuZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4IGtleV9pbmRleCkKKyNlbmRpZgoreworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKCBuZGV2ICk7CisgICAgaW50IHN0YXR1czsKKyAgICBoZGRfd2V4dF9zdGF0ZV90ICpwV2V4dFN0YXRlOworICAgIGhkZF9zdGF0aW9uX2N0eF90ICpwSGRkU3RhQ3R4OworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisKKyAgICBFTlRFUigpOworCisgICAgaWYgKChOVUxMID09IHBBZGFwdGVyKSkKKyAgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgImludmFsaWQgYWRhcHRlciIpOworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9IREQsCisgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX0hERF9DRkc4MDIxMV9TRVRfREVGQVVMVF9LRVksCisgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCBrZXlfaW5kZXgpKTsKKworICAgIHBXZXh0U3RhdGUgPSBXTEFOX0hERF9HRVRfV0VYVF9TVEFURV9QVFIocEFkYXB0ZXIpOworICAgIHBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKworICAgIGlmICgoTlVMTCA9PSBwV2V4dFN0YXRlKSB8fCAoTlVMTCA9PSBwSGRkU3RhQ3R4KSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgImludmFsaWQgV2V4dCBzdGF0ZSBvciBIREQgY29udGV4dCIpOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczogZGV2aWNlX21vZGUgPSAlZCBrZXlfaW5kZXggPSAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLHBBZGFwdGVyLT5kZXZpY2VfbW9kZSwga2V5X2luZGV4KTsKKworICAgIGlmIChDU1JfTUFYX05VTV9LRVkgPD0ga2V5X2luZGV4KQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiBJbnZhbGlkIGtleSBpbmRleCAlZCIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgIGtleV9pbmRleCk7CisKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIHN0YXR1cyA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gc3RhdHVzKQorICAgIHsKKyAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICB9CisKKyAgICBpZiAoKHBBZGFwdGVyLT5kZXZpY2VfbW9kZSA9PSBXTEFOX0hERF9JTkZSQV9TVEFUSU9OKQorICAgICB8fCAocEFkYXB0ZXItPmRldmljZV9tb2RlID09IFdMQU5fSEREX1AyUF9DTElFTlQpCisgICAgICAgKQorICAgIHsKKyAgICAgICAgaWYgKCAoZUNTUl9FTkNSWVBUX1RZUEVfVEtJUCAhPQorICAgICAgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby51Y0VuY3J5cHRpb25UeXBlKSAmJgorICAgICAgICAgICAgIChlQ1NSX0VOQ1JZUFRfVFlQRV9BRVMgIT0KKyAgICAgICAgICAgICAgICBwSGRkU3RhQ3R4LT5jb25uX2luZm8udWNFbmNyeXB0aW9uVHlwZSkKKyAgICAgICAgICAgKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBpZiBkZWZhdWx0IGtleSBpbmRleCBpcyBub3Qgc2FtZSBhcyBwcmV2aW91cyBvbmUsCisgICAgICAgICAgICAgKiB0aGVuIHVwZGF0ZSB0aGUgZGVmYXVsdCBrZXkgaW5kZXggKi8KKworICAgICAgICAgICAgdENzclJvYW1TZXRLZXkgIHNldEtleTsKKyAgICAgICAgICAgIHZfVTMyX3Qgcm9hbUlkPSAweEZGOworICAgICAgICAgICAgdENzcktleXMgKktleXMgPSAmcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUuS2V5czsKKworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICIlczogZGVmYXVsdCB0eCBrZXkgaW5kZXggJWQiLAorICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywga2V5X2luZGV4KTsKKworICAgICAgICAgICAgS2V5cy0+ZGVmYXVsdEluZGV4ID0gKHU4KWtleV9pbmRleDsKKyAgICAgICAgICAgIHZvc19tZW1femVybygmc2V0S2V5LHNpemVvZih0Q3NyUm9hbVNldEtleSkpOworICAgICAgICAgICAgc2V0S2V5LmtleUlkID0ga2V5X2luZGV4OworICAgICAgICAgICAgc2V0S2V5LmtleUxlbmd0aCA9IEtleXMtPktleUxlbmd0aFtrZXlfaW5kZXhdOworCisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnNldEtleS5LZXlbMF0sCisgICAgICAgICAgICAgICAgICAgICZLZXlzLT5LZXlNYXRlcmlhbFtrZXlfaW5kZXhdWzBdLAorICAgICAgICAgICAgICAgICAgICBLZXlzLT5LZXlMZW5ndGhba2V5X2luZGV4XSk7CisKKyAgICAgICAgICAgIHNldEtleS5rZXlEaXJlY3Rpb24gPSBlU0lSX1RYX1JYOworCisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoc2V0S2V5LnBlZXJNYWMsCisgICAgICAgICAgICAgICAgICAgICZwSGRkU3RhQ3R4LT5jb25uX2luZm8uYnNzSWRbMF0sCisgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfQlNTSURfTEVOKTsKKworICAgICAgICAgICAgaWYgKEtleXMtPktleUxlbmd0aFtrZXlfaW5kZXhdID09IENTUl9XRVA0MF9LRVlfTEVOICYmCisgICAgICAgICAgICAgICBwV2V4dFN0YXRlLT5yb2FtUHJvZmlsZS5FbmNyeXB0aW9uVHlwZS5lbmNyeXB0aW9uVHlwZVswXSA9PQorICAgICAgICAgICAgICAgZUNTUl9FTkNSWVBUX1RZUEVfV0VQMTA0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qSW4gdGhlIGNhc2Ugb2YgZHluYW1pYyB3ZXAgc3VwcGxpY2FudCBoYXJkY29kZXMgRFdFUCB0eXBlIHRvIGVDU1JfRU5DUllQVF9UWVBFX1dFUDEwNAorICAgICAgICAgICAgICAgICBldmVuIHRob3VnaCBhcCBpcyBjb25maWd1cmVkIGZvciBXRVAtNDAgZW5jcnlwdGlvbi4gSW4gdGhpcyBjYW5zZSB0aGUga2V5IGxlbmd0aAorICAgICAgICAgICAgICAgICBpcyA1IGJ1dCB0aGUgZW5jcnlwdGlvbiB0eXBlIGlzIDEwNCBoZW5jZSBjaGVja2luZyB0aGUga2V5IGxhbmdodCg1KSBhbmQgZW5jcnlwdGlvbgorICAgICAgICAgICAgICAgICB0eXBlKDEwNCkgYW5kIHN3aXRjaGluZyBlbmNyeXB0aW9uIHR5cGUgdG8gNDAqLworICAgICAgICAgICAgICAgIHBXZXh0U3RhdGUtPnJvYW1Qcm9maWxlLkVuY3J5cHRpb25UeXBlLmVuY3J5cHRpb25UeXBlWzBdID0KKyAgICAgICAgICAgICAgICAgICBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVA0MDsKKyAgICAgICAgICAgICAgICBwV2V4dFN0YXRlLT5yb2FtUHJvZmlsZS5tY0VuY3J5cHRpb25UeXBlLmVuY3J5cHRpb25UeXBlWzBdID0KKyAgICAgICAgICAgICAgICAgICBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVA0MDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc2V0S2V5LmVuY1R5cGUgPQorICAgICAgICAgICAgICAgIHBXZXh0U3RhdGUtPnJvYW1Qcm9maWxlLkVuY3J5cHRpb25UeXBlLmVuY3J5cHRpb25UeXBlWzBdOworCisgICAgICAgICAgICAvKiBpc3N1ZSBzZXQga2V5IHJlcXVlc3QgKi8KKyAgICAgICAgICAgIHN0YXR1cyA9IHNtZV9Sb2FtU2V0S2V5KCBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsICZzZXRLZXksICZyb2FtSWQgKTsKKworICAgICAgICAgICAgaWYgKCAwICE9IHN0YXR1cyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICIlczogc21lX1JvYW1TZXRLZXkgZmFpbGVkLCByZXR1cm5lZCAlZCIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qIEluIFNvZnRBcCBtb2RlIHNldHRpbmcga2V5IGRpcmVjdGlvbiBmb3IgZGVmYXVsdCBtb2RlICovCisgICAgZWxzZSBpZiAoIFdMQU5fSEREX1NPRlRBUCA9PSBwQWRhcHRlci0+ZGV2aWNlX21vZGUgKQorICAgIHsKKyAgICAgICAgaWYgKCAoZUNTUl9FTkNSWVBUX1RZUEVfVEtJUCAhPQorICAgICAgICAgICAgICAgIHBXZXh0U3RhdGUtPnJvYW1Qcm9maWxlLkVuY3J5cHRpb25UeXBlLmVuY3J5cHRpb25UeXBlWzBdKSAmJgorICAgICAgICAgICAgIChlQ1NSX0VOQ1JZUFRfVFlQRV9BRVMgIT0KKyAgICAgICAgICAgICAgICBwV2V4dFN0YXRlLT5yb2FtUHJvZmlsZS5FbmNyeXB0aW9uVHlwZS5lbmNyeXB0aW9uVHlwZVswXSkKKyAgICAgICAgICAgKQorICAgICAgICB7CisgICAgICAgICAgICAvKiAgU2F2aW5nIGtleSBkaXJlY3Rpb24gZm9yIGRlZmF1bHQga2V5IGluZGV4IHRvIFRYIGRlZmF1bHQgKi8KKyAgICAgICAgICAgIGhkZF9hcF9jdHhfdCAqcEFQQ3R4ID0gV0xBTl9IRERfR0VUX0FQX0NUWF9QVFIocEFkYXB0ZXIpOworICAgICAgICAgICAgcEFQQ3R4LT53ZXBLZXlba2V5X2luZGV4XS5rZXlEaXJlY3Rpb24gPSBlU0lSX1RYX0RFRkFVTFQ7CisgICAgICAgIH0KKyAgICB9CisgICAgRVhJVCgpOworICAgIHJldHVybiBzdGF0dXM7Cit9CisKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDIsNiwzOCkpCitzdGF0aWMgaW50IHdsYW5faGRkX2NmZzgwMjExX3NldF9kZWZhdWx0X2tleSggc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqbmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCBrZXlfaW5kZXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCB1bmljYXN0LCBib29sIG11bHRpY2FzdCkKKyNlbHNlCitzdGF0aWMgaW50IHdsYW5faGRkX2NmZzgwMjExX3NldF9kZWZhdWx0X2tleSggc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqbmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCBrZXlfaW5kZXgpCisjZW5kaWYKK3sKKyAgICBpbnQgcmV0OworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigyLDYsMzgpKQorICAgIHJldCA9IF9fd2xhbl9oZGRfY2ZnODAyMTFfc2V0X2RlZmF1bHRfa2V5KHdpcGh5LCBuZGV2LCBrZXlfaW5kZXgsIHVuaWNhc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXVsdGljYXN0KTsKKyNlbHNlCisgICAgcmV0ID0gX193bGFuX2hkZF9jZmc4MDIxMV9zZXRfZGVmYXVsdF9rZXkod2lwaHksIG5kZXYsIGtleV9pbmRleCk7CisjZW5kaWYKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCisvKgorICogRlVOQ1RJT046IHdsYW5faGRkX2NmZzgwMjExX2luZm9ybV9ic3MKKyAqIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCB0byBpbmZvcm0gdGhlIEJTUyBkZXRhaWxzIHRvIG5sODAyMTEgaW50ZXJmYWNlLgorICovCitzdGF0aWMgc3RydWN0IGNmZzgwMjExX2Jzcyogd2xhbl9oZGRfY2ZnODAyMTFfaW5mb3JtX2JzcygKKyAgICAgICAgICAgICAgICAgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsIHRDc3JSb2FtQ29ubmVjdGVkUHJvZmlsZSAqcm9hbVByb2ZpbGUpCit7Cisg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B9CisKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID4gS0VSTkVMX1ZFUlNJT04oMiw2LDM4KSkKKyAgICBpZiAoY2hhbl9ubyA8PSBBUlJBWV9TSVpFKGhkZF9jaGFubmVsc18yXzRfR0haKSkKKyAgICB7CisgICAgICAgIGZyZXEgPSBpZWVlODAyMTFfY2hhbm5lbF90b19mcmVxdWVuY3koY2hhbl9ubywgSUVFRTgwMjExX0JBTkRfMkdIWik7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGZyZXEgPSBpZWVlODAyMTFfY2hhbm5lbF90b19mcmVxdWVuY3koY2hhbl9ubywgSUVFRTgwMjExX0JBTkRfNUdIWik7CisgICAgfQorI2Vsc2UKKyAgICBmcmVxID0gaWVlZTgwMjExX2NoYW5uZWxfdG9fZnJlcXVlbmN5KGNoYW5fbm8pOworI2VuZGlmCisKKyAgICBjaGFuID0gX19pZWVlODAyMTFfZ2V0X2NoYW5uZWwod2lwaHksIGZyZXEpOworCisgICAgaWYgKCFjaGFuKSB7CisgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzIGNoYW4gcG9pbnRlciBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICAgIHJzc2kgPSAoVk9TX01JTiAoKHBCc3NEZXNjLT5yc3NpICsgcEJzc0Rlc2MtPnNpbnIpLCAwKSkqMTAwOworCisgICAgcmV0dXJuIGNmZzgwMjExX2luZm9ybV9ic3Mod2lwaHksIGNoYW4sCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE4LDApKQorICAgICAgICAgICAgICAgIENGRzgwMjExX0JTU19GVFlQRV9VTktOT1dOLAorI2VuZGlmCisgICAgICAgICAgICAgICAgcEJzc0Rlc2MtPmJzc0lkLAorICAgICAgICAgICAgICAgIGxlNjRfdG9fY3B1KCooX19sZTY0ICopcEJzc0Rl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lc3VsdCB3aXRoIHRoaXMgcG9pbnRlciBudWxsIHdhcm5pbmcga2VybmVsIHRyYWNlIGlzIHByaW50ZWQuCisgICAgICogaWYgdGhlIHNjYW4gcmVzdWx0cyBjb250YWluIGxhcmdlIG51bWJlciBvZiBBUHMgY29udGludW9zbHkga2VybmVsIHdhcm5pbmcgdHJhY2UgaXMgcHJpbnRlZCBhbmQgaXQgd2lsbCBsZWFkIHRvIGFwcHMgd2F0Y2ggZG9nIGJhcmsuCisgICAgICogU28gZHJvcCB0aGUgYnNzIGFuZCBjb250aW51ZSB0byBuZXh0IGJzcy4KKyAgICAgKi8KKyAgICBpZihjaGFuID09IE5VTEwpCisgICAgeworICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlcyBjaGFuIHBvaW50ZXIgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICBrZnJlZShtZ210KTsKKyAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisgICAgLypUbyBrZWVwIHRoZSByc3NpIGljb24gb2YgdGhlIGNvbm5lY3RlZCBBUCBpbiB0aGUgc2NhbiB3aW5kb3cKKyAgICAqYW5kIHRoZSByc3NpIGljb24gb2YgdGhlIHdpcmVsZXNzIG5ldHdvcmtzIGluIHN5bmMKKyAgICAqICovCisgICAgaWYgKCggZUNvbm5lY3Rpb25TdGF0ZV9Bc3NvY2lhdGVkID09CisgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25DdHguc3RhdGlvbi5jb25uX2luZm8uY29ublN0YXRlICkgJiYKKyAgICAgICAgICAgICAoIFZPU19UUlVFID09IHZvc19tZW1fY29tcGFyZShic3NfZGVzYy0+YnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uQ3R4LnN0YXRpb24uY29ubl9pbmZvLmJzc0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX0JTU0lEX0xFTikpICYmCisg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ZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdENzclJvYW1JbmZvICpwUm9hbUluZm8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKQoreworICAgIHRDc3JSb2FtQ29ubmVjdGVkUHJvZmlsZSByb2FtUHJvZmlsZTsKKyAgICB0SGFsSGFuZGxlIGhIYWwgPSBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlcik7CisgICAgc3RydWN0IGNmZzgwMjExX2JzcyAqYnNzID0gTlVMTDsKKworICAgIEVOVEVSKCk7CisKKyAgICBtZW1zZXQoJnJvYW1Qcm9maWxlLCAwLCBzaXplb2YodENzclJvYW1Db25uZWN0ZWRQcm9maWxlKSk7CisgICAgc21lX1JvYW1HZXRDb25uZWN0UHJvZmlsZShoSGFsLCBwQWRhcHRlci0+c2Vzc2lvbklkLCAmcm9hbVByb2ZpbGUpOworCisgICAgaWYgKE5VTEwgIT0gcm9hbVByb2ZpbGUucEJzc0Rlc2MpCisgICAgeworICAgICAgICBic3MgPSB3bGFuX2hkZF9jZmc4MDIxMV9pbmZvcm1fYnNzX2ZyYW1lKHBBZGFwdGVyLAorICAgICAgICAgICAgICAgIHJvYW1Qcm9maWxlLnBCc3NEZXNjKTsKKworICAgICAgICBpZiAoTlVMTCA9PSBic3MpCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIiVzOiBjZmc4MDIxMV9pbmZvcm1fYnNzIHJldHVybiBOVUxMIiwKKyAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICB9CisKKyAgICAgICAgc21lX1JvYW1GcmVlQ29ubmVjdFByb2ZpbGUoaEhhbCwgJnJvYW1Qcm9maWxlKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiAgcm9hbVByb2ZpbGUucEJzc0Rlc2MgaXMgTlVMTCIsCisgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgIH0KKyAgICByZXR1cm4gYnNzOworfQorCisvKgorICogRlVOQ1RJT046IHdsYW5faGRkX2NmZzgwMjExX3VwZGF0ZV9ic3MKKyAqLworc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV91cGRhdGVfYnNzKCBzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKK3sKKyAgICB0SGFsSGFuZGxlIGhIYWwgPSBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlcik7CisgICAgdENzclNjYW5SZXN1bHRJbmZvICpwU2NhblJlc3VsdDsKKyAgICBlSGFsU3RhdHVzIHN0YXR1cyA9IDA7CisgICAgdFNjYW5SZXN1bHRIYW5kbGUgcFJlc3VsdDsKKyAgICBzdHJ1Y3QgY2ZnODAyMTFfYnNzICpic3Nfc3RhdHVzID0gTlVMTDsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgIGJvb2wgaXNfcDJwX3NjYW4gPSBmYWxzZTsKKyAgICBFTlRFUigpOworCisgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX0hERCwKKyAgICAgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfSEREX0NGRzgwMjExX1VQREFURV9CU1MsCisgICAgICAgICAgICAgICAgICAgICAgIE5PX1NFU1NJT04sIHBBZGFwdGVyLT5zZXNzaW9uSWQpKTsKKworICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKworICAgIGlmIChwSGRkQ3R4LT5pc0xvZ3BJblByb2dyZXNzKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgIiVzOkxPR1AgaW4gUHJvZ3Jlc3MuIElnbm9yZSEhISIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVBR0FJTjsKKyAgICB9CisKKworICAgIC8qYnNzX3VwZGF0ZSBpcyBub3QgYWxsb3dlZCBkdXJpbmcgd2xhbiBkcml2ZXIgbG9hZGluZyBvciB1bmxvYWRpbmcqLworICAgIGlmIChXTEFOX0hERF9JU19MT0FEX1VOTE9BRF9JTl9QUk9HUkVTUyhwSGRkQ3R4KSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICIlczpMb2FkaW5nX3VubG9hZGluZyBpbiBQcm9ncmVzcy4gSWdub3JlISEhIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfUEVSTTsKKyAgICB9CisKKyAgICBpZiAocEFkYXB0ZXItPnJlcXVlc3QgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIGlmICgocEFkYXB0ZXItPnJlcXVlc3QtPm5fc3NpZHMgPT0gMSkKKyAgICAgICAgICAgICAgICAmJiAocEFkYXB0ZXItPnJlcXVlc3QtPnNzaWRzICE9IE5VTEwpCisgICAgICAgICAgICAgICAgJiYgdm9zX21lbV9jb21wYXJlKCZwQWRhcHRlci0+cmVxdWVzdC0+c3NpZHNbMF0sICJESVJFQ1QtIiwgNykpCisgICAgICAgICAgICBpc19wMnBfc2NhbiA9IHRydWU7CisgICAgfQorICAgIC8qCisgICAgICogc3RhcnQgZ2V0dGluZyBzY2FuIHJlc3VsdHMgYW5kIHBvcHVsYXRlIGNnZjgwMjExIEJTUyBkYXRhYmFzZQorICAgICAqLworICAgIHN0YXR1cyA9IHNtZV9TY2FuR2V0UmVzdWx0KGhIYWwsIHBBZGFwdGVyLT5zZXNzaW9uSWQsIE5VTEwsICZwUmVzdWx0KTsKKworICAgIC8qIG5vIHNjYW4gcmVzdWx0cyAqLworICAgIGlmIChOVUxMID09IHBSZXN1bHQpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczogTm8gc2NhbiByZXN1bHQgU3RhdHVzICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBzdGF0dXMpOworICAgICAgICB3bGFuX2hkZF9nZXRfZnJhbWVfbG9ncyhwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9IRERfR0VUX0ZSQU1FX0xPR19DTURfU0VORF9BTkRfQ0xFQVIpOworICAgICAgICByZXR1cm4gc3RhdHVzOworICAgIH0KKworICAgIHBTY2FuUmVzdWx0ID0gc21lX1NjYW5SZXN1bHRHZXRGaXJzdChoSGFsLCBwUmVzdWx0KTsKKworICAgIHdoaWxlIChwU2NhblJlc3VsdCkKKyAgICB7CisgICAgICAgIC8qCisgICAgICAgICAqIGNmZzgwMjExX2luZm9ybV9ic3MoKSBpcyBub3QgdXBkYXRpbmcgaWUgZmllbGQgb2YgYnNzIGVudHJ5LCBpZgorICAgICAgICAgKiBlbnRyeSBhbHJlYWR5IGV4aXN0cyBpbiBic3MgZGF0YSBiYXNlIG9mIGNmZzgwMjExIGZvciB0aGF0CisgICAgICAgICAqIHBhcnRpY3VsYXIgQlNTIElELiAgVXNpbmcgY2ZnODAyMTFfaW5mb3JtX2Jzc19mcmFtZSB0byB1cGRhdGUgdGhlCisgICAgICAgICAqIGJzcyBlbnRyeSBpbnN0ZWFkIG9mIGNmZzgwMjExX2luZm9ybV9ic3MsIEJ1dCB0aGlzIGNhbGwgZXhwZWN0cworICAgICAgICAgKiBtZ210IHBhY2tldCBhcyBpbnB1dC4gQXMgb2Ygbm93IHRoZXJlIGlzIG5vIHBvc3NpYmlsaXR5IHRvIGdldAorICAgICAgICAgKiB0aGUgbWdtdChwcm9iZSByZXNwb25zZSkgZnJhbWUgZnJvbSBQRSwgY29udmVydGluZyBic3NfZGVzYyB0bworICAgICAgICAgKiBpZWVlODAyMTFfbWdtdChwcm9iZSByZXNwb25zZSkgYW5kIHBhc3NpbmcgdG8gYworICAgICAgICAgKiBmZzgwMjExX2luZm9ybV9ic3NfZnJhbWUuCisgICAgICAgICAqICovCisgICAgICAgIGlmKGlzX3AycF9zY2FuICYmIChwU2NhblJlc3VsdC0+c3NJZC5zc0lkICE9IE5VTEwpICYmCisgICAgICAgICAgICAgICAgIXZvc19tZW1fY29tcGFyZSggcFNjYW5SZXN1bHQtPnNzSWQuc3NJZCwgIkRJUkVDVC0iLCA3KSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBTY2FuUmVzdWx0ID0gc21lX1NjYW5SZXN1bHRHZXROZXh0KGhIYWwsIHBSZXN1bHQpOworICAgICAgICAgICAgY29udGludWU7IC8vU2tpcCB0aGUgbm9uIHAycCBic3MgZW50cmllcworICAgICAgICB9CisgICAgICAgIGJzc19zdGF0dXMgPSB3bGFuX2hkZF9jZmc4MDIxMV9pbmZvcm1fYnNzX2ZyYW1lKHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICZwU2NhblJlc3VsdC0+QnNzRGVzY3JpcHRvcik7CisKKworICAgICAgICBpZiAoTlVMTCA9PSBic3Nfc3RhdHVzKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICIlczogTlVMTCByZXR1cm5lZCBieSBjZmc4MDIxMV9pbmZvcm1fYnNzIiwgX19mdW5jX18pOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgY2ZnODAyMTFfcHV0X2JzcygKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsOSwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lwaHksCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnNzX3N0YXR1cyk7CisgICAgICAgIH0KKworICAgICAgICBwU2NhblJlc3VsdCA9IHNtZV9TY2FuUmVzdWx0R2V0TmV4dChoSGFsLCBwUmVzdWx0KTsKKyAgICB9CisKKyAgICBzbWVfU2NhblJlc3VsdFB1cmdlKGhIYWwsIHBSZXN1bHQpOworICAgIGlzX3AycF9zY2FuID0gZmFsc2U7CisgICAgcmV0dXJuIDA7Cit9CisKK3ZvaWQKK2hkZFByaW50TWFjQWRkcih0Q3NyQnNzaWQgbWFjQWRkciwgdEFOSV9VOCBsb2dMZXZlbCkKK3sKKyAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIGxvZ0xldmVsLAorICAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIsIE1BQ19BRERSX0FSUkFZKG1hY0FkZHIpKTsKK30gLyoqKioqKiBlbmQgaGRkUHJpbnRNYWNBZGRyKCkgKioqKioqLworCit2b2lkCitoZGRQcmludFBta0lkKHRBTklfVTggKnBta0lkLCB0QU5JX1U4IGxvZ0xldmVsKQoreworICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgbG9nTGV2ZWwsCisgICAgICAgICAgICAgICIlMDJYOiUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWDolMDJYIiwKKyAgICAgICAgICAgICAgcG1rSWRbMF0sIHBta0lkWzFdLCBwbWtJZFsyXSwgcG1rSWRbM10sIHBta0lkWzRdLAorICAgICAgICAgICAgICBwbWtJZFs1XSwgcG1rSWRbNl0sIHBta0lkWzddLCBwbWtJZFs4XSwgcG1rSWRbOV0sIHBta0lkWzEwXSwKKyAgICAgICAgICAgICAgcG1rSWR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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+YnNzaWQsIHByZWF1dGgsIEdGUF9LRVJORUwpOworICAgIH0KKyNlbmRpZiAgLyogRkVBVFVSRV9XTEFOX09LQyAqLworICAgIHJldHVybiAwOworfQorI2VuZGlmIC8vRkVBVFVSRV9XTEFOX0xGUgorCisjaWZkZWYgRkVBVFVSRV9XTEFOX0xGUl9NRVRSSUNTCisvKgorICogRlVOQ1RJT046IHdsYW5faGRkX2NmZzgwMjExX3JvYW1fbWV0cmljc19wcmVhdXRoCisgKiA4MDIuMTFyL0xGUiBtZXRyaWNzIHJlcG9ydGluZyBmdW5jdGlvbiB0byByZXBvcnQgcHJlYXV0aCBpbml0aWF0aW9uCisgKgorICovCisjZGVmaW5lIE1BWF9MRlJfTUVUUklDU19FVkVOVF9MRU5HVEggMTAwCitWT1NfU1RBVFVTIHdsYW5faGRkX2NmZzgwMjExX3JvYW1fbWV0cmljc19wcmVhdXRoKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Q3NyUm9hbUluZm8gKnBSb2FtSW5mbykKK3sKKyAgICB1bnNpZ25lZCBjaGFyIG1ldHJpY3Nfbm90aWZpY2F0aW9uW01BWF9MRlJfTUVUUklDU19FVkVOVF9MRU5HVEggKyAxXTsKKyAgICB1bmlvbiBpd3JlcV9kYXRhIHdycXU7CisKKyAgICBFTlRFUigpOworCisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBoZGRMb2coTE9HRSwgIiVzOiBwQWRhcHRlciBpcyBOVUxMISIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgIH0KKworICAgIC8qIGNyZWF0ZSB0aGUgZXZlbnQgKi8KKyAgICBtZW1zZXQoJndycXUsIDAsIHNpemVvZih3cnF1KSk7Cis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9kYXRhIHdycXU7CisKKyAgICBFTlRFUigpOworCisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBoZGRMb2coTE9HRSwgIiVzOiBwQWRhcHRlciBpcyBOVUxMISIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgIH0KKworICAgIC8qIGNyZWF0ZSB0aGUgZXZlbnQgKi8KKyAgICBtZW1zZXQoJndycXUsIDAsIHNpemVvZih3cnF1KSk7CisgICAgbWVtc2V0KG1ldHJpY3Nfbm90aWZpY2F0aW9uLCAwLCBzaXplb2YobWV0cmljc19ub3RpZmljYXRpb24pKTsKKworICAgIHNjbnByaW50ZihtZXRyaWNzX25vdGlmaWNhdGlvbiwgc2l6ZW9mKG1ldHJpY3Nfbm90aWZpY2F0aW9uKSwKKyAgICAgICAgIlFDT006IExGUl9QUkVBVVRIX1NUQVRVUyAiTUFDX0FERFJFU1NfU1RSLAorICAgICAgICBNQUNfQUREUl9BUlJBWShwUm9hbUluZm8tPmJzc2lkKSk7CisKKyAgICBpZiAoMSA9PSBwcmVhdXRoX3N0YXR1cykKKyAgICAgICAgc3RybmNhdChtZXRyaWNzX25vdGlmaWNhdGlvbiwgIiBUUlVFIiwgNSk7CisgICAgZWxzZQorICAgICAgICBzdHJuY2F0KG1ldHJpY3Nfbm90aWZpY2F0aW9uLCAiIEZBTFNFIiwgNik7CisKKyAgICB3cnF1LmRhdGEucG9pbnRlciA9IG1ldHJpY3Nfbm90aWZpY2F0aW9uOworICAgIHdycXUuZGF0YS5sZW5ndGggPSBzdHJsZW4obWV0cmljc19ub3RpZmljYXRpb24pOworCisgICAgd2lyZWxlc3Nfc2VuZF9ldmVudChwQWRhcHRlci0+ZGV2LCBJV0VWQ1VTVE9NLCAmd3JxdSwgbWV0cmljc19ub3RpZmljYXRpb24pOworCisgICAgRVhJVCgpOworCisgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ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0gMDsKKyAgICB0QU5JX1U4IGk7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKworICAgIEVOVEVSKCk7CisKKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgaWYgKE5VTEwgPT0gcEhkZEN0eCkgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgiSEREIGNvbnRleHQgaXMgTnVsbCIpKTsKKyAgICAgICAgZ290byBhbGxvd19zdXNwZW5kOworICAgIH0KKworICAgIHBTY2FuSW5mbyA9ICZwSGRkQ3R4LT5zY2FuX2luZm87CisKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAiJXMgY2FsbGVkIHdpdGggaGFsSGFuZGxlID0gJXAsIHBDb250ZXh0ID0gJXAsIgorICAgICAgICAgICAgInNjYW5JRCA9ICVkLCByZXR1cm5lZCBzdGF0dXMgPSAlZCIsCisgICAgICAgICAgICBfX2Z1bmNfXywgaGFsSGFuZGxlLCBwQ29udGV4dCwgKGludCkgc2NhbklkLCAoaW50KSBzdGF0dXMpOworCisgICAgcFNjYW5JbmZvLT5tU2NhblBlbmRpbmdDb3VudGVyID0gMDsKKworICAgIC8vQmxvY2sgb24gc2NhbiByZXEgY29tcGxldGlvbiB2YXJpYWJsZS4gQ2FuJ3Qgd2FpdCBmb3JldmVyIHRob3VnaC4KKyAgICB3YWl0UmV0ID0gd2FpdF9mb3JfY29tcGxldGlvbl9pbnRlcnJ1cHRpYmxlX3RpbWVvdXQoCisgICAgICAgICAgICAgICAgICAgICAgICAgJnBTY2FuSW5mby0+c2Nhbl9yZXFfY29tcGxldGlvbl9ldmVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKFdMQU5fV0FJVF9USU1FX1NDQU5fUkVRKSk7CisgICAgaWYgKHdhaXRSZXQgPD0gMCkKKyAgICB7CisgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICIlcyB3YWl0IG9uIHNjYW5fcmVxX2NvbXBsZXRpb25fZXZlbnQgZmFpbGVkICVsZCIsX19mdW5jX18sIHdhaXRSZXQpOworICAgICAgIFZPU19BU1NFUlQocFNjYW5JbmZvLT5tU2NhblBlbmRpbmcpOworICAgICAgIGdvdG8gYWxsb3dfc3VzcGVuZDsKKyAgICB9CisKKyAgICBpZiAocFNjYW5JbmZvLT5tU2NhblBlbmRpbmcgIT0gVk9TX1RSVUUpCisgICAgeworICAgICAgICBWT1NfQVNTRVJUKHBTY2FuSW5mby0+bVNjYW5QZW5kaW5nKTsKKyAgICAgICAgZ290byBhbGxvd19zdXNwZW5kOworICAgIH0KKworICAgIC8qIENoZWNrIHRoZSBzY2FuSWQgKi8KKyAgICBpZiAocFNjYW5JbmZvLT5zY2FuSWQgIT0gc2NhbklkKQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICIlcyBjYWxsZWQgd2l0aCBtaXNtYXRjaGVkIHNjYW5JZCBwU2NhbkluZm8tPnNjYW5JZCA9ICVkICIKKyAgICAgICAgICAgICAgICAic2NhbklkID0gJWQiLCBfX2Z1bmNfXywgKGludCkgcFNjYW5JbmZvLT5zY2FuSWQsCisgICAgICAgICAgICAgICAgKGludCkgc2NhbklkKTsKKyAgICB9CisKKyAgICByZXQgPSB3bGFuX2hkZF9jZmc4MDIxMV91cGRhdGVfYnNzKChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyKTsKKworICAgIGlmICgwID4gcmV0KQorICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczogTk8gU0NBTiByZXN1bHQiLCBfX2Z1bmNfXyk7CisKKworIC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5sYXN0X3NjYW5fdGltZXN0YW1wID0gdm9zX3RpbWVyX2dldF9zeXN0ZW1fdGltZSgpOworCisgICAgICAgIGlmICggcmVxLT5uX2NoYW5uZWxzICkKKyAgICAgICAgeworICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHJlcS0+bl9jaGFubmVscyA7IGkrKyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcEhkZEN0eC0+c2Nhbl9pbmZvLmxhc3Rfc2Nhbl9jaGFubmVsTGlzdFtpXSA9IHJlcS0+Y2hhbm5lbHNbaV0tPmh3X3ZhbHVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLyogc3RvcmUgbm8gb2YgY2hhbm5lbCBzY2FubmVkICovCisgICAgICAgICAgICBwSGRkQ3R4LT5zY2FuX2luZm8ubGFzdF9zY2FuX251bUNoYW5uZWxzPSByZXEtPm5fY2hhbm5lbHM7CisgICAgICAgIH0KKworICAgIH0KKworICAgIC8qCisgICAgICogY2ZnODAyMTFfc2Nhbl9kb25lIGluZm9ybWluZyBOTDgwMjExIGFib3V0IGNvbXBsZXRpb24KKyAgICAgKiBvZiBzY2FubmluZworICAgICAqLworICAgIGlmIChzdGF0dXMgPT0gZUNTUl9TQ0FOX0FCT1JUIHx8IHN0YXR1cyA9PSBlQ1NSX1NDQU5fRkFJTFVSRSkKKyAgICB7CisgICAgICAgICBhYm9ydGVkID0gdHJ1ZTsKKyAgICB9CisgICAgY2ZnODAyMTFfc2Nhbl9kb25lKHJlcSwgYWJvcnRlZCk7CisgICAgY29tcGxldGUoJnBTY2FuSW5mby0+YWJvcnRzY2FuX2V2ZW50X3Zhcik7CisKKyAgICBpZiAoKHBIZGRDdHgtPmNmZ19pbmktPmVuYWJsZU1hY1Nwb29maW5nID09IE1BQ19BRERSX1NQT09GSU5HX0ZXX0hPU1RfRU5BQkxFCisgICAgICAgKSAmJiAocEhkZEN0eC0+c3Bvb2ZNYWNBZGRyLmlzRW5hYmxlZAorICAgICAgICAgfHwg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ZiggcEFkYXB0ZXIgKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICIlczogQWRhcHRlciB3aXRoIGRldmljZSBtb2RlICVzICglZCkgZXhpc3RzIiwKKyAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIGhkZF9kZXZpY2VfbW9kZXRvU3RyaW5nKHBBZGFwdGVyLT5kZXZpY2VfbW9kZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPmRldmljZV9tb2RlKTsKKyAgICAgICAgICAgIGlmICgoKFdMQU5fSEREX0lORlJBX1NUQVRJT04gPT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKSB8fAorICAgICAgICAgICAgICAgICAoV0xBTl9IRERfUDJQX0NMSUVOVCA9PSBwQWRhcHRlci0+ZGV2aWNlX21vZGUpIHx8CisgICAgICAgICAgICAgICAgIChXTEFOX0hERF9QMlBfREVWSUNFID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkpICYmCisgICAgICAgICAgICAgICAgIChlQ29ubmVjdGlvblN0YXRlX0Nvbm5lY3RpbmcgPT0KKyAgICAgICAgICAgICAgICAoV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlcikpLT5jb25uX2luZm8uY29ublN0YXRlKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVwKCVkKSBDb25uZWN0aW9uIGlzIGluIHByb2dyZXNzIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgIFdMQU5fSEREX0dFVF9TVEFUSU9OX0NUWF9QVFIocEFkYXB0ZXIpLCBwQWRhcHRlci0+c2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gVk9TX1RSVUU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoKFdMQU5fSEREX0lORlJBX1NUQVRJT04gPT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKSAmJgorICAgICAgICAgICAgICAgICBzbWVOZWlnaGJvck1pZGRsZU9mUm9hbWluZyhXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlcikpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICIlczogJXAoJWQpIFJlYXNzb2NpYXRpb24gaXMgaW4gcHJvZ3Jlc3MiLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlciksIHBBZGFwdGVyLT5zZXNzaW9uSWQpOworICAgICAgICAgICAgICAgIHJldHVybiBWT1NfVFJVRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICgoV0xBTl9IRERfSU5GUkFfU1RBVElPTiA9PSBwQWRhcHRlci0+ZGV2aWNlX21vZGUpIHx8CisgICAgICAgICAgICAgICAgICAgICAoV0xBTl9IRERfUDJQX0NMSUVOVCA9PSBwQWRhcHRlci0+ZGV2aWNlX21vZGUpIHx8CisgICAgICAgICAgICAgICAgICAgICAoV0xBTl9IRERfUDJQX0RFVklDRSA9PSBwQWRhcHRlci0+ZGV2aWNlX21vZGUpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKyAgICAgICAgICAgICAgICBpZiAoKGVDb25uZWN0aW9uU3RhdGVfQXNzb2NpYXRlZCA9PSBwSGRkU3RhQ3R4LT5jb25uX2luZm8uY29ublN0YXRlKSAmJgorICAgICAgICAgICAgICAgICAgICAoVk9TX0ZBTFNFID09IHBIZGRTdGFDdHgtPmNvbm5faW5mby51SXNBdXRoZW50aWNhdGVkKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHN0YU1hYyA9ICh2X1U4X3QgKikgJihwQWRhcHRlci0+bWFjQWRkcmVzc0N1cnJlbnQuYnl0ZXNbMF0pOworICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBjbGllbnQgIiBNQUNfQUREUkVTU19TVFIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIgaXMgaW4gdGhlIG1pZGRsZSBvZiBXUFMvRUFQT0wgZXhjaGFuZ2UuIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkoc3RhTWFjKSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBWT1NfVFJVRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmICgoV0xBTl9IRERfU09GVEFQID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkgfHwKKyAgICAgICAgICAgICAgICAgICAgKFdMQU5fSEREX1AyUF9HTyA9PSBwQWRhcHRlci0+ZGV2aWNlX21vZGUpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZfQ09OVEVYVF90IHBWb3NDb250ZXh0ID0gKCBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPnB2b3NDb250ZXh0OworICAgICAgICAgICAgICAgIHB0U2FwQ29udGV4dCBwU2FwQ3R4ID0gTlVMTDsKKyAgICAgICAgICAgICAgICBwU2FwQ3R4ID0gVk9TX0dFVF9TQVBfQ0IocFZvc0NvbnRleHQpOworICAgICAgICAgICAgICAgIGlmKHBTYXBDdHggPT0gTlVMTCl7CisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJwc2FwQ3R4IGlzIE5VTEwiKSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBWT1NfRkFMU0U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGZvciAoc3RhSWQgPSAwOyBzdGFJZCA8IFdMQU5fTUFYX1NUQV9DT1VOVDsgc3RhSWQrKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmICgocFNhcEN0eC0+YVN0YUluZm9bc3RhSWRdLmlzVXNlZCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV0xBTlRMX1NUQV9DT05ORUNURUQgPT0gcFNhcEN0eC0+YVN0YUluZm9bc3RhSWRdLnRsU1RBU3RhdGUpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzdGFNYWMgPSAodl9VOF90ICopICYocFNhcEN0eC0+YVN0YUluZm9bc3RhSWRdLm1hY0FkZHJTVEEuYnl0ZXNbMF0pOworCisgICAgICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogY2xpZW50ICIgTUFDX0FERFJFU1NfU1RSICIgb2YgU29mdEFQL1AyUC1HTyBpcyBpbiB0aGUgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJtaWRkbGUgb2YgV1BTL0VBUE9MIGV4Y2hhbmdlLiIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShzdGFNYWMpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBWT1NfVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgIC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IiVzOiBObyBzY2FubmluZyB3aGVuIEFNUCBpcyBvbiIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FT1BOT1RTVVBQOworICAgIH0KKyNlbmRpZgorICAgIC8vU2NhbiBvbiBhbnkgb3RoZXIgaW50ZXJmYWNlIGlzIG5vdCBzdXBwb3J0ZWQuCisgICAgaWYgKHBBZGFwdGVyLT5kZXZpY2VfbW9kZSA9PSBXTEFOX0hERF9TT0ZUQVApCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAiJXM6IE5vdCBzY2FubmluZyBvbiBkZXZpY2VfbW9kZSA9ICVzICglZCkiLAorICAgICAgICAgICAgICBfX2Z1bmNfXywgaGRkX2RldmljZV9tb2RldG9TdHJpbmcocEFkYXB0ZXItPmRldmljZV9tb2RlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSk7CisgICAgICAgIHJldHVybiAtRU9QTk9UU1VQUDsKKyAgICB9CisKKyAgICBpZiAoVFJVRSA9PSBwU2NhbkluZm8tPm1TY2FuUGVuZGluZykKKyAgICB7CisgICAgICAgIGlmICggTUFYX1BFTkRJTkdfTE9HID4gcFNjYW5JbmZvLT5tU2NhblBlbmRpbmdDb3VudGVyKysgKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IG1TY2FuUGVuZGluZyBpcyBUUlVFIiwgX19mdW5jX18pOworICAgICAgICB9CisgICAgICAgIHJldHVybiAtRUJVU1k7CisgICAgfQorCisgICAgLy8gRG9uJ3QgYWxsb3cgc2NhbiBpZiBQTk8gc2NhbiBpcyBnb2luZyBvbi4KKyAgICBpZiAocEhkZEN0eC0+aXNQbm9FbmFibGUpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfS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zclNTSURJbmZvICpTc2lkSW5mbzsKKyAgICAgICAgaW50IGo7CisgICAgICAgIHNjYW5SZXF1ZXN0LlNTSURzLm51bU9mU1NJRHMgPSByZXF1ZXN0LT5uX3NzaWRzOworICAgICAgICAvKiBBbGxvY2F0ZSBudW1fc3NpZCB0Q3NyU1NJREluZm8gc3RydWN0dXJlICovCisgICAgICAgIFNzaWRJbmZvID0gc2NhblJlcXVlc3QuU1NJRHMuU1NJRExpc3QgPQorICAgICAgICAgICAgICAgICAgKCB0Q3NyU1NJREluZm8gKil2b3NfbWVtX21hbGxvYygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC0+bl9zc2lkcypzaXplb2YodENzclNTSURJbmZvKSk7CisKKyAgICAgICAgaWYoTlVMTCA9PSBzY2FuUmVxdWVzdC5TU0lEcy5TU0lETGlzdCkKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IG1lbW9yeSBhbGxvYyBmYWlsZWQgU1NJREluZm8gYnVmZmVyIiwgX19mdW5jX18pOworICAgICAgICAgICAgcmV0dXJuIC1FTk9NRU07CisgICAgICAgIH0KKworICAgICAgICAvKiBjb3B5IGFsbCB0aGUgc3NpZCdzIGFuZCB0aGVpciBsZW5ndGggKi8KKyAgICAgICAgZm9yKGogPSAwOyBqIDwgcmVxdWVzdC0+bl9zc2lkczsgaisrLCBTc2lkSW5mbysrKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBnZXQgdGhlIHNzaWQgbGVuZ3RoICovCisgICAgICAgICAgICBTc2lkSW5mby0+U1NJRC5sZW5ndGggPSByZXF1ZXN0LT5zc2lkc1tqXS5zc2lkX2xlbjsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShTc2lkSW5mby0+U1NJRC5zc0lkLCAmcmVxdWVzdC0+c3NpZHNbal0uc3NpZFswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBTc2lkSW5mby0+U1NJRC5sZW5ndGgpOworICAgICAgICAgICAgU3NpZEluZm8tPlNTSUQuc3NJZFtTc2lkSW5mby0+U1NJRC5sZW5ndGhdID0gJ1wwJzsKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIlNTSUQgbnVtYmVyICVkOiAgJXMiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiwgU3NpZEluZm8tPlNTSUQuc3NJZCk7CisgICAgICAgIH0KKyAgICAgICAgLyogc2V0IHRoZSBzY2FuIHR5cGUgdG8gYWN0aXZlICovCisgICAgICAgIHNjYW5SZXF1ZXN0LnNjYW5UeXBlID0gZVNJUl9BQ1RJVkVfU0NBTjsKKyAgICB9CisgICAgZWxzZSBpZihXTEFOX0hERF9QMlBfR08gPT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKQorICAgIHsKKyAgICAgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX0hERCwKKyAgICAgICAgICAgICAgICAgICAgVFJBQ0VfQ09ERV9IRERfQ0ZHODAyMTFfU0NBTiwKKyAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwgMCkpOworICAgICAgICAvKiBzZXQgdGhlIHNjYW4gdHlwZSB0byBhY3RpdmUgKi8KKyAgICAgICAgc2NhblJlcXVlc3Quc2NhblR5cGUgPSBlU0lSX0FDVElWRV9TQ0FOOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAvKlNldCB0aGUgc2NhbiB0eXBlIHRvIGRlZmF1bHQgdHlwZSwgaW4gdGhpcyBjYXNlIGl0IGlzIEFDVElWRSovCisgICAgICAgIHNjYW5SZXF1ZXN0LnNjYW5UeXBlID0gcFNjYW5JbmZvLT5zY2FuX21vZGU7CisgICAgfQorICAgIHNjYW5SZXF1ZXN0Lm1pbkNoblRpbWUgPSBjZmdfcGFyYW0tPm5BY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AgICBpZiAoIHJlcXVlc3QtPm5vX2NjayA9PSBGQUxTRSAmJiBzY2FuUmVxdWVzdC5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzICE9IDEgJiYKKyAgICAgICAgICAgICAgIChwU2NhbkluZm8tPmxhc3Rfc2Nhbl9udW1DaGFubmVscyA9PSBzY2FuUmVxdWVzdC5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzKSAmJgorICAgICAgICAgICAgICAgIHZvc19tZW1fY29tcGFyZShwU2NhbkluZm8tPmxhc3Rfc2Nhbl9jaGFubmVsTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxMaXN0LCBwU2NhbkluZm8tPmxhc3Rfc2Nhbl9udW1DaGFubmVscykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICAgIiBOZXcgYW5kIG9sZCBzdGF0aW9uIHNjYW4gdGltZSBkaWZmZXIgaXMgbGVzcyB0aGVuICV1IiwKKyAgICAgICAgICAgICAgICBwSGRkQ3R4LT5jZmdfaW5pLT5uRGVmZXJTY2FuVGltZUludGVydmFsKTsKKworICAgICAgICAgICAgICAgIHJldCA9IHdsYW5faGRkX2NmZzgwMjExX3VwZGF0ZV9ic3MoKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+d2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXIpOworCisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICAiUmV0dXJuIG9sZCBjYWNoZWQgc2NhbiBhcyBhbGwgY2hhbm5lbHMgYW5kIG5vIG9mIGNoYW5uZWxzIGFyZSBzYW1lIik7CisKKyAgICAgICAgICAgICAgICBpZiAoMCA+IHJldCkKKyAgICAgICAgICAgICAgICAgICAgaGR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F1ZXN0LT5pZV9sZW4pOworICAgICAgICBwU2NhbkluZm8tPnNjYW5BZGRJRS5sZW5ndGggPSByZXF1ZXN0LT5pZV9sZW47CisKKyAgICAgICAgaWYgKChXTEFOX0hERF9JTkZSQV9TVEFUSU9OID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkgfHwKKyAgICAgICAgICAgIChXTEFOX0hERF9QMlBfQ0xJRU5UID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkgfHwKKyAgICAgICAgICAgIChXTEFOX0hERF9QMlBfREVWSUNFID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChyZXF1ZXN0LT5pZV9sZW4gPD0gU0lSX01BQ19NQVhfQUREX0lFX0xFTkdUSCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwd2V4dEJ1Zi0+cm9hbVByb2ZpbGUubkFkZElFU2Nhbkxlbmd0aCA9IHJlcXVlc3QtPmllX2xlbjsKKyAgICAgICAgICAgICAgICBtZW1jcHkoIHB3ZXh0QnVmLT5yb2FtUHJvZmlsZS5hZGRJRVNjYW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXF1ZXN0LT5pZSwgcmVxdWVzdC0+aWVfbGVuKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiU2NhbiBJZSBsZW5ndGggaXMgaW52YWxpZDoiCisgICAgICAgICAgICAgICAgICAgICAgICAgIiV6dSIsIHJlcXVlc3QtPmllX2xlbik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgfQorICAgICAgICBzY2FuUmVxdWVzdC51SUVGaWVsZExlbiA9IHBTY2FuSW5mby0+c2NhbkFkZElFLmxlbmd0aDsKKyAgICAgICAgc2NhblJlcXVlc3QucElFRmllbGQgPSBwU2NhbkluZm8tPnNjYW5BZGRJRS5hZGRJRWRhdGE7CisKKyAgICAgICAgcFAycEllID0gd2xhbl9oZGRfZ2V0X3AycF9pZV9wdHIoKHZfVThfdCopcmVxdWVzdC0+aWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXF1ZXN0LT5pZV9sZW4pOworICAgICAgICBpZiAocFAycEllICE9IE5VTEwpCisgICAgICAgIHsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfUDJQX0RFQlVHCisgICAgICAgICAgICBpZiAoKChnbG9iYWxQMlBDb25uZWN0aW9uU3RhdHVzID09IFAyUF9HT19ORUdfQ09NUExFVEVEKSB8fAorICAgICAgICAgICAgICAgIChnbG9iYWxQMlBDb25uZWN0aW9uU3RhdHVzID09IFAyUF9HT19ORUdfUFJPQ0VTUykpICYmCisgICAgICAgICAgICAgICAgKFdMQU5fSEREX1AyUF9DTElFTlQgPT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBnbG9iYWxQMlBDb25uZWN0aW9uU3RhdHVzID0gUDJQX0NMSUVOVF9DT05ORUNUSU5HX1NUQVRFXzE7CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiW1AyUCBTdGF0ZV0gQ2hhbmdpbmcgc3RhdGUgZnJvbSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJHbyBuZWdvIGNvbXBsZXRlZCB0byBDb25uZWN0aW9uIGlzIHN0YXJ0ZWQiKTsKKyAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJbUDJQXVAyUCBTY2FubmluZyBpcyBzdGFydGVkICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZm9yIDh3YXkgSGFuZHNoYWtlIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKChnbG9iYWxQMlBDb25uZWN0aW9uU3RhdHVzID09IFAyUF9DTElFTlRfRElTQ09OTkVDVEVEX1NUQVRFKSAmJgorICAgICAgICAgICAgICAgICAgICAoV0xBTl9IRERfUDJQX0NMSUVOVCA9PSBwQWRhcHRlci0+ZGV2aWNlX21vZGUpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGdsb2JhbFAyUENvbm5lY3Rpb25TdGF0dXMgPSBQMlBfQ0xJRU5UX0NPTk5FQ1RJTkdfU1RBVEVfMjsKKyAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJbUDJQIFN0YXRlXSBDaGFuZ2luZyBzdGF0ZSBmcm9tICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkRpc2Nvbm5lY3RlZCBzdGF0ZSB0byBDb25uZWN0aW9uIGlzIHN0YXJ0ZWQiKTsKKyAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJbUDJQXVAyUCBTY2FubmluZyBpcyBzdGFydGVkICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZm9yIDR3YXkgSGFuZHNoYWtlIik7CisgICAgICAgICAgICB9CisjZW5kaWYKKworICAgICAgICAgICAgLyogbm9fY2NrIHdpbGwgYmUgc2V0IGR1cmluZyBwMnAgZmluZCB0byBkaXNhYmxlIDExYiByYXRlcyAqLworICAgICAgICAgICAgaWYoVFJVRSA9PSByZXF1ZXN0LT5ub19jY2spCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFRoaXMgaXMgYSBQMlAgU2VhcmNoIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgIHNjYW5SZXF1ZXN0LnAycFNlYXJjaCA9IDE7CisKKyAgICAgICAgICAgICAgICBpZiggcmVxdWVzdC0+bl9jaGFubmVscyA9PSBXTEFOX0hERF9QMlBfU09DSUFMX0NIQU5ORUxTICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAvKiBzZXQgcmVxdWVzdFR5cGUgdG8gUDJQIERpc2NvdmVyeSAqLworICAgICAgICAgICAgICAgICAgICAgc2NhblJlcXVlc3QucmVxdWVzdFR5cGUgPSBlQ1NSX1NDQU5fUDJQX0RJU0NPVkVSWTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAgIFNraXAgRGZzIENoYW5uZWwgaW4gY2FzZSBvZiBQMlAgU2VhcmNoCisgICAgICAgICAgICAgICAgICAgaWYgaXQgaXMgc2V0IGluIGluaSBmaWxlCisgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBpZihjZmdfcGFyYW0tPnNraXBEZnNDaG5sSW5QMnBTZWFyY2gpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIHNjYW5SZXF1ZXN0LnNraXBEZnNDaG5sSW5QMnBTZWFyY2ggPSAxOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIHNjYW5SZXF1ZXN0LnNraXBEZnNDaG5sSW5QMnBTZWFyY2ggPSAwOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgSU5JVF9DT01QTEVUSU9OKHBTY2FuSW5mby0+c2Nhbl9yZXFfY29tcGxldGlvbl9ldmVudCk7CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworICAgIC8qIGlmIHRkbHMgZGlzYWdyZWUgc2NhbiByaWdodCBub3csIHJldHVybiBpbW1lZGlhdGVseS4KKyAgICAgICB0ZGxzIHdpbGwgc2NoZWR1bGUgdGhlIHNjYW4gd2hlbiBzY2FuIGlzIGFsbG93ZWQuIChyZXR1cm4gU1VDQ0VTUykKKyAgICAgICBvciB3aWxsIHJlamVjdCB0aGUgc2NhbiBpZiBhbnkgVERMUyBpcyBpbiBwcm9ncmVzcy4gKHJldHVybiAtRUJVU1kpCisgICAgICovCisgICAgc3RhdHVzID0gd2xhbl9oZGRfdGRsc19zY2FuX2NhbGxiYWNrIChwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpcGh5LAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPCBLRVJORUxfVkVSU0lPTigzLDYsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXYsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVlc3QpOworICAgIGlmKHN0YXR1cyA8PSAwKQorICAgIHsKKyAgICAgICBpZighc3RhdHVzKQorICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IFRETFMgaW4gcHJvZ3Jlc3MuIgorICAgICAgICAgICAgICAgICAgInNjYW4gcmVqZWN0ZWQgICVkIiwgX19mdW5jX18sIHN0YXR1cyk7CisgICAgICAgZWxzZQorICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IFRETFMgdGVhcmRvd24gaXMgb25nb2luZyAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgc3RhdHVzKTsKKworICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgfQorI2VuZGlmCisKKyAgICAvKiBhY3F1aXJlIHRoZSB3YWtlbG9jayB0byBhdm9pZCB0aGUgYXBwcyBzdXNwZW5kIGR1cmluZyB0aGUgc2Nhbi4gVG8KKyAgICAgKiBhZGRyZXNzIHRoZSBmb2xsb3dpbmcgaXNzdWVzLgorICAgICAqID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GFwdGVyLCBXTEFOX0hERF9HRVRfRlJBTUVfTE9HX0NNRF9DTEVBUik7CisgICAgc3RhdHVzID0gc21lX1NjYW5SZXF1ZXN0KCBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCAmc2NhblJlcXVlc3QsICZzY2FuSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmaGRkX2NmZzgwMjExX3NjYW5fZG9uZV9jYWxsYmFjaywgZGV2ICk7CisKKyAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogc21lX1NjYW5SZXF1ZXN0IHJldHVybmVkIGVycm9yICVkIiwgX19mdW5jX18sIHN0YXR1cyk7CisgICAgICAgIGNvbXBsZXRlKCZwU2NhbkluZm8tPnNjYW5fcmVxX2NvbXBsZXRpb25fZXZlbnQpOworICAgICAgICBpZihlSEFMX1NUQVRVU19SRVNPVVJDRVMgPT0gc3RhdHVzKQorICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiBITyBpcyBpbiBwcm9ncmVzcy4iCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiU28gZGVmZXIgdGhlIHNjYW4gYnkgaW5mb3JtaW5nIGJ1c3kiLF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSAtRUJVU1k7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gLUVJTzsKKyAgICAgICAgfQorICAgICAgICBoZGRfYWxsb3dfc3VzcGVuZChXSUZJX1BPV0VSX0VWRU5UX1dBS0VMT0NLX1NDQU4pOworCisjaWZkZWYgRkVBVFVSRV9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wMjExX3NjYW4od2lwaHksCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA8IEtFUk5FTF9WRVJTSU9OKDMsNiwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGV2LAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVlc3QpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKK3ZvaWQgaGRkX3NlbGVjdF9jYm1vZGUoIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLHZfVThfdCBvcGVyYXRpb25DaGFubmVsKQoreworICAgIHZfVThfdCBpbmlEb3QxMU1vZGUgPQorICAgICAgICAgICAgICAgKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+Y2ZnX2luaS0+ZG90MTFNb2RlOworICAgIGVIZGREb3QxMU1vZGUgICBoZGREb3QxMU1vZGUgPSBpbmlEb3QxMU1vZGU7CisKKyAgICBoZGRMb2coTE9HMSwgRkwoIkNoYW5uZWwgQm9uZGluZyBNb2RlIFNlbGVjdGVkIGlzICV1IiksCisgICAgICAgICAgIGluaURvdDExTW9kZSk7CisgICAgc3dpdGNoICggaW5pRG90MTFNb2RlICkKKyAgICB7CisgICAgICAgY2FzZSBlSEREX0RPVDExX01PREVfQVVUTzoKKyAgICAgICBjYXNlIGVIRERfRE9UMTFfTU9ERV8xMWFjOgorICAgICAgIGNhc2UgZUhERF9ET1QxMV9NT0RFXzExYWNfT05MWToKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgICAgICAgIGlmICggc21lX0lzRmVhdHVyZVN1cHBvcnRlZEJ5RHJpdmVyKERPVDExQUMpICYmCisgICAgICAgICAgICAgICBzbWVfSXNGZWF0dXJlU3VwcG9ydGVkQnlGVyhET1QxMUFDKSApCisgICAgICAgICAgICAgIGhkZERvdDExTW9kZSA9IGVIRERfRE9UMTFfTU9ERV8xMWFjOworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgaGRkRG90MTFNb2RlID0gZUhERF9ET1QxMV9NT0RFXzExbjsKKyNlbHNlCisgICAgICAgICAgaGRkRG90MTFNb2RlID0gZUhERF9ET1QxMV9NT0RFXzExbjsKKyNlbmRpZgorICAgICAgICAgIGJyZWFrOworICAgICAgIGNhc2UgZUhERF9ET1QxMV9NT0RFXzExbjoKKyAgICAgICBjYXNlIGVIRERfRE9UMTFfTU9ERV8xMW5fT05MWToKKyAgICAgICAgICBoZGREb3QxMU1vZGUgPSBlSEREX0RPVDExX01PREVfMTFuOworICAgICAgICAgIGJyZWFrOworICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgaGRkRG90MTFNb2RlID0gaW5pRG90MTFNb2RlOworICAgICAgICAgIGJyZWFrOworICAgIH0KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfQVBfSFQ0MF8yNEcKKyAgICBpZiAob3BlcmF0aW9uQ2hhbm5lbCA+IFNJUl8xMUJfQ0hBTk5FTF9FTkQpCisjZW5kaWYKKyAgICB7CisgICAgICAgIC8qIFRoaXMgY2FsbCBkZWNpZGVzIHJlcXVpcmVkIGNoYW5uZWwgYm9uZGluZyBtb2RlICovCisgICAgICAgIHNtZV9TZWxlY3RDQk1vZGUoKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpLT5oSGFsKSwKKyAgICAgICAgICAgICAgICAgICAgIGhkZF9jZmdfeGxhdGVfdG9fY3NyX3BoeV9tb2RlKGhkZERvdDExTW9kZSksCisgICAgICAgICAgICAgICAgICAgICBvcGVyYXRpb25DaGFubmVsKTsKKyAgICB9Cit9CisKKy8qCisgKiBGVU5DVElPTjogd2xhbl9oZGRfY2ZnODAyMTFfY29ubmVjdF9zdGFydAorICogVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHRvIHN0YXJ0IHRoZSBhc3NvY2lhdGlvbiBwcm9jZXNzCisgKi8KK2ludCB3bGFuX2hkZF9jZmc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gICAgICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHg7CisgICAgICAgIHBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKworICAgICAgICB3bGFuX2hkZF9nZXRfZnJhbWVfbG9ncyhwQWRhcHRlciwgV0xBTl9IRERfR0VUX0ZSQU1FX0xPR19DTURfQ0xFQVIpOworCisgICAgICAgIGlmIChIRERfV01NX1VTRVJfTU9ERV9OT19RT1MgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgIChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPmNmZ19pbmktPldtbU1vZGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qUW9TIG5vdCBlbmFibGVkIGluIGNmZyBmaWxlKi8KKyAgICAgICAgICAgIHBSb2FtUHJvZmlsZS0+dWFwc2RfbWFzayA9IDA7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvKlFvUyBlbmFibGVkLCB1cGRhdGUgdWFwc2QgbWFzayBmcm9tIGNmZyBmaWxlKi8KKyAgICAgICAgICAgIHBSb2FtUHJvZmlsZS0+dWFwc2RfbWFzayA9CisgICAgICAgICAgICAgICAgICAgICAoV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcikpLT5jZmdfaW5pLT5VYXBzZE1hc2s7CisgICAgICAgIH0KKworICAgICAgICBwUm9hbVByb2ZpbGUtPlNTSURzLm51bU9mU1NJRHMgPSAxOworICAgICAgICBwUm9hbVByb2ZpbGUtPlNTSURzLlNTSURMaXN0LT5TU0lELmxlbmd0aCA9IHNzaWRfbGVuOworICAgICAgICB2b3NfbWVtX3plcm8ocFJvYW1Qcm9maWxlLT5TU0lEcy5TU0lETGlzdC0+U1NJRC5zc0lkLAorICAgICAgICAgICAgICAgIHNpemVvZihwUm9hbVByb2ZpbGUtPlNTSURzLlNTSURMaXN0LT5TU0lELnNzSWQpKTsKKyAgICAgICAgdm9zX21lbV9jb3B5KCh2b2lkICopKHBSb2FtUHJvZmlsZS0+U1NJRHMuU1NJRExpc3QtPlNTSUQuc3NJZCksCisgICAgICAgICAgICAgICAgc3NpZCwgc3NpZF9sZW4pOworCisgICAgICAgIGlmIChic3NpZCkKKyAgICAgICAgeworICAgICAgICAgICAgcFZhbGlkQnNzaWQgPSBic3NpZDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChic3NpZF9oaW50KQorICAgICAgICB7CisgICAgICAgICAgICBwVmFsaWRCc3NpZCA9IGJzc2lkX2hpbnQ7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHBWYWxpZEJzc2lkKQorICAgICAgICB7CisgICAgICAgICAgICBwUm9hbVByb2ZpbGUtPkJTU0lEcy5udW1PZkJTU0lEcyA9IDE7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHZvaWQgKikocFJvYW1Qcm9maWxlLT5CU1NJRHMuYnNzaWQpLCBwVmFsaWRCc3NpZCwKKyAgICAgICAgICAgICAgICAgICAgV05JX0NGR19CU1NJRF9MRU4pOworICAgICAgICAgICAgLyogU2F2ZSBCU1NJRCBpbiBzZXBlcmF0ZSB2YXJpYWJsZSBhcyB3ZWxsLCBhcyBSb2FtUHJvZmlsZQorICAgICAgICAgICAgICAgQlNTSUQgaXMgZ2V0dGluZyB6ZXJvZWQgb3V0IGluIHRoZSBhc3NvY2lhdGlvbiBwcm9jZXNzLiBBbmQgaW4KKyAgICAgICAgICAgICAgIGNhc2Ugb2Ygam9pbiBmYWlsdXJlIHdlIHNob3VsZCBzZW5kIHZhbGlkIEJTU0lEIHRvIHN1cHBsaWNhbnQKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCh2b2lkICopKHBXZXh0U3RhdGUtPnJlcV9ic3NJZCksIHBWYWxpZEJzc2lkLAorICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX0JTU0lEX0xFTik7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX3plcm8oKHZvaWQgKikocFJvYW1Qcm9maWxlLT5CU1NJRHMuYnNzaWQpLFdOSV9DRkdfQlNTSURfTEVOKTsKKyAgICAgICAgfQorCisgICAgICAgIGhkZExvZyhMT0cxLCBGTCgiQ29ubmVjdCB0byBTU0lEOiAlcyBvcGVydGF0aW5nIENoYW5uZWw6ICV1IiksCisgICAgICAgICAgICAgICBwUm9hbVByb2ZpbGUtPlNTSURzLlNTSURMaXN0LT5TU0lELnNzSWQsIG9wZXJhdGluZ0NoYW5uZWwpOworICAgICAgICBpZiAoKElXX0FVVEhfV1BBX1ZFUlNJT05fV1BBID09IHBXZXh0U3RhdGUtPndwYVZlcnNpb24pIHx8CisgICAgICAgICAgICAgICAgKElXX0FVVEhfV1BBX1ZFUlNJT05fV1BBMiA9PSBwV2V4dFN0YXRlLT53cGFWZXJzaW9uKSkKKyAgICAgICAgeworICAgICAgICAgICAgLypzZXQgZ2VuIGllKi8KKyAgICAgICAgICAgIGhkZF9TZXRHRU5JRVRvQ3NyKHBBZGFwdGVyLCAmUlNOQXV0aFR5cGUpOworICAgICAgICAgICAgLypzZXQgYXV0aCovCisgICAgICAgICAgICBoZGRfc2V0X2Nzcl9hdXRoX3R5cGUocEFkYXB0ZXIsIFJTTkF1dGhUeXBlKTsKKyAgICAgICAgfQorI2lmZGVmIEZFQVRVUkVfV0xBTl9XQVBJCisgICAgICAgIGlmIChwQWRhcHRlci0+d2FwaV9pbmZvLm5XYXBpTW9kZSkKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKExPRzEsICIlczogU2V0dGluZyBXQVBJIEFVVEggVHlwZSBhbmQgRW5jcnlwdGlvbiBNb2RlIHZhbHVlcyIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHN3aXRjaCAocEFkYXB0ZXItPndhcGlfaW5mby53YXBpQXV0aE1vZGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2FzZSBXQVBJX0FVVEhfTU9ERV9QU0s6CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HMSwgIiVzOiBXQVBJIEFVVEggVFlQRTogUFNLOiAlZCIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPndhcGlfaW5mby53YXBpQXV0aE1vZGUpOworICAgICAgICAgICAgICAgICAgICBwUm9hbVByb2ZpbGUtPkF1dGhUeXBlLmF1dGhUeXBlWzBdID0gZUNTUl9BVVRIX1RZUEVfV0FQSV9XQUlfUFNLOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY2FzZSBXQVBJX0FVVEhfTU9ERV9DRVJUOgorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKExPRzEsICIlczogV0FQSSBBVVRIIFRZUEU6IENFUlQ6ICVkIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPndhcGlfaW5mby53YXBpQXV0aE1vZGUpOworICAgICAgICAgICAgICAgICAgICBwUm9hbVByb2ZpbGUtPkF1dGhUeXBlLmF1dGhUeXBlWzBdID0gZUNTUl9BVVRIX1RZUEVfV0FQSV9XQUlfQ0VSVElGSUNBVEU7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gLy8gRW5kIG9mIHN3aXRjaAorICAgICAgICAgICAgaWYgKCBwQWRhcHRlci0+d2FwaV9pbmZvLndhcGlBdXRoTW9kZSA9PSBXQVBJX0FVVEhfTU9ERV9QU0sgfHwKKyAgICAgICAgICAgICAgICBwQWRhcHRlci0+d2FwaV9pbmZvLndhcGlBdXRoTW9kZSA9PSBXQVBJX0FVVEhfTU9ERV9DRVJUKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhMT0cxLCAiJXM6IFdBUEkgUEFJUldJU0UvR1JPVVAgRU5DUllQVElPTjogV1BJIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgIHBSb2FtUHJvZmlsZS0+QXV0aFR5cGUubnVtRW50cmllcyA9IDE7CisgICAgICAgICAgICAgICAgcFJvYW1Qcm9maWxlLT5FbmNyeXB0aW9uVHlwZS5udW1FbnRyaWVzID0gMTsKKyAgICAgICAgICAgICAgICBwUm9hbVByb2ZpbGUtPkVuY3J5cHRpb25UeXBlLmVuY3J5cHRpb25UeXBlWzBdID0gZUNTUl9FTkNSWVBUX1RZUEVfV1BJOworICAgICAgICAgICAgICAgIHBSb2FtUHJvZmlsZS0+bWNFbmNyeXB0aW9uVHlwZS5udW1FbnRyaWVzID0gMTsKKyAgICAgICAgICAgICAgICBwUm9hbVByb2ZpbGUtPm1jRW5jcnlwdGlvblR5cGUuZW5jcnlwdGlvblR5cGVbMF0gPSBlQ1NSX0VOQ1JZUFRfVFlQRV9XUEk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fV0FQSSAqLworI2lmZGVmIFdMQU5fRkVBVFVSRV9HVEtfT0ZGTE9BRAorICAgICAgICAvKiBJbml0aWFsaXppbmcgZ3RrT2ZmbG9hZFJlcVBhcmFtcyAqLworICAgICAgICBpZiAoKFdMQU5fSEREX0lORlJBX1NUQVRJT04gPT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKSB8fAorICAgICAgICAgICAgKFdMQU5fSEREX1AyUF9DTElFTlQgPT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKSkKKyAgICAgICAgeworICAgICAgICAgICAgbWVtc2V0KCZwSGRkU3RhQ3R4LT5ndGtPZmZsb2FkUmVxUGFyYW1zLCAwLAorICAgICAgICAgICAgICAgICAgc2l6ZW9mICh0U2lyR3RrT2ZmbG9hZFBhcmFtcykpOworICAgICAgICAgICAgcEhkZFN0YUN0eC0+Z3RrT2ZmbG9hZFJlcVBhcmFtcy51bEZsYWdzID0gR1RLX09GRkxPQURfRElTQUJMRTsKKyAgICAgICAgfQorI2VuZGlmCisgICAgICAgIHBSb2FtUHJvZmlsZS0+Y3NyUGVyc29uYSA9IHBBZGFwdGVyLT5kZXZpY2VfbW9kZTsKKworICAgICAgICBpZiggb3BlcmF0aW5nQ2hhbm5lbCApCisgICAgICAgIHsKKyAgICAgICAgICAgcFJvYW1Qcm9maWxlLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdCA9ICZvcGVyYXRpbmdDaGFubmVsOworICAgICAgICAgICBwUm9hbVByb2ZpbGUtPkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHMgPSAxOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcFJvYW1Qcm9maWxlLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdCA9IE5VTEw7CisgICAgICAgICAgICBwUm9hbVByb2ZpbGUtPkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHMgPSAwOworICAgICAgICB9CisgICAgICAgIGlmICggKFdMQU5fSEREX0lCU1MgPT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKSAmJiBvcGVyYXRpbmdDaGFubmVsKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRfc2VsZWN0X2NibW9kZShwQWRhcHRlcixvcGVyYXRpbmdDaGFubmVsKTsKKyAgICAgICAgfQorCisgICAgICAgLyoKKyAgICAgICAgKiBDaGFuZ2UgY29ubl9zdGF0ZSB0byBjb25uZWN0aW5nIGJlZm9yZSBzbWVfUm9hbUNvbm5lY3QoKSwKKyAgICAgICAgKiBiZWNhdXNlIHNtZV9Sb2FtQ29ubmVjdCgpIGhhcyBhIGRpcmVjdCBwYXRoIHRvIGNhbGwKKyAgICAgICAgKiBoZGRfc21lUm9hbUNhbGxiYWNrKCksIHdoaWNoI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ElPTiA9PSBwQWRhcHRlci0+ZGV2aWNlX21vZGUgfHwKKyAgICAgICAgICAgIFdMQU5fSEREX1AyUF9DTElFTlQgPT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICBGTCgiU2V0IEhERCBjb25uU3RhdGUgdG8gZUNvbm5lY3Rpb25TdGF0ZV9Db25uZWN0aW5nIikpOworICAgICAgICAgICAgaGRkX2Nvbm5TZXRDb25uZWN0aW9uU3RhdGUoV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNvbm5lY3Rpb25TdGF0ZV9Db25uZWN0aW5nKTsKKyAgICAgICAgfQorICAgICAgICBzdGF0dXMgPSBzbWVfUm9hbUNvbm5lY3QoIFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCBwUm9hbVByb2ZpbGUsICZyb2FtSWQpOworCisgICAgICAgIGlmICgoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpICYmCisgICAgICAgICAgICAoV0xBTl9IRERfSU5GUkFfU1RBVElPTiA9PSBwQWRhcHRlci0+ZGV2aWNlX21vZGUgfHwKKyAgICAgICAgICAgICBXTEFOX0hERF9QMlBfQ0xJRU5UID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkpCisKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJzbWVfUm9hbUNvbm5lY3QgKHNlc3Npb24gJWQpIGZhaWxlZCB3aXRoIHN0YXR1cyAlZC4gLT4gTm90Q29ubmVjdGVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCBzdGF0dXMpOworICAgICAgICAgICAgLyogY2hhbmdlIGJhY2sgdG8gTm90QXNzb2NpYXRlZCAqLworICAgICAgICAgICAgaGRkX2Nvbm5TZXRDb25uZWN0aW9uU3RhdGUoV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ29ubmVjdGlvblN0YXRlX05vdENvbm5lY3RlZCk7CisgICAgICAgIH0KKworICAgICAgICBwUm9hbVByb2ZpbGUtPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0ID0gTlVMTDsKKyAgICAgICAgcFJvYW1Qcm9maWxlLT5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzID0gMDsKKworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IE5vIHZhbGlkIFJvYW0gcHJvZmlsZSIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIEVYSVQoKTsKKyAgICByZXR1cm4gc3RhdHVzOworfQorCisvKgorICogRlVOQ1RJT046IHdsYW5faGRkX3NldF9jZmc4MDIxMV9hdXRoX3R5cGUKKyAqIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCB0byBzZXQgdGhlIGF1dGhlbnRpY2F0aW9uIHR5cGUgKE9QRU4vU0hBUkVEKS4KKyAqCisgKi8KK3N0YXRpYyBpbnQgd2xhbl9oZGRfY2ZnODAyMTFfc2V0X2F1dGhfdHlwZShoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyAgICAgICAgZW51bSBubDgwMjExX2F1dGhfdHlwZSBhdXRoX3R5cGUpCit7CisgICAgaGRk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TktOT1dOOworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUuQXV0aFR5cGUuYXV0aFR5cGVbMF0gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5hdXRoVHlwZTsKKyAgICByZXR1cm4gMDsKK30KKworLyoKKyAqIEZVTkNUSU9OOiB3bGFuX2hkZF9zZXRfYWttX3N1aXRlCisgKiBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgdG8gc2V0IHRoZSBrZXkgbWdtdCB0eXBlKFBTSy84MDIxeCkuCisgKgorICovCitzdGF0aWMgaW50IHdsYW5faGRkX3NldF9ha21fc3VpdGUoIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MzIga2V5X21nbXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKQoreworICAgIGhkZF93ZXh0X3N0YXRlX3QgKnBXZXh0U3RhdGUgPSBXTEFOX0hERF9HRVRfV0VYVF9TVEFURV9QVFIocEFkYXB0ZXIpOworICAgIEVOVEVSKCk7CisgICAgLyogU2hvdWxkIGJlIGluIGllZWU4MDJfMTFfZGVmcy5oICovCisjZGVmaW5lIFdMQU5fQUtNX1NVSVRFXzgwMjFYX1NIQTI1NiAweDAwMEZBQzA1CisjZGVmaW5lIFdMQU5fQUtNX1NVSVRFX1BTS19TSEEyNTYgICAweDAwMEZBQzA2CisgICAgLypzZXQga2V5IG1nbXQgdHlwZSovCisgICAgc3dpdGNoKGtleV9tZ210KQorICAgIHsKKyAgICAgICAgY2FzZSBXTEFOX0FLTV9TVUlURV9QU0s6CisgICAgICAgIGNhc2UgV0xBTl9BS01fU1VJVEVfUFNLX1NIQTI1NjoKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUgorICAgICAgIC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0lORk8sICIlczogc2V0dGluZyBrZXkgbWdtdCB0eXBlIHRvIENDS00iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHBXZXh0U3RhdGUtPmF1dGhLZXlNZ210IHw9IElXX0FVVEhfS0VZX01HTVRfQ0NLTTsKKyAgICAgICAgICAgIGJyZWFrOworI2VuZGlmCisjaWZuZGVmIFdMQU5fQUtNX1NVSVRFX09TRU4KKyNkZWZpbmUgV0xBTl9BS01fU1VJVEVfT1NFTiAgICAgICAgIDB4NTA2ZjlhMDEgLyogU2hvdWxkIGJlIGluIGllZWU4MDJfMTFfZGVmcy5oICovCisgICAgICAgIGNhc2UgV0xBTl9BS01fU1VJVEVfT1NFTjoKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIiVzOiBzZXR0aW5nIGtleSBtZ210IHR5cGUgdG8gT1NFTiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICAgcFdleHRTdGF0ZS0+YXV0aEtleU1nbXQgfD0gSVdfQVVUSF9LRVlfTUdNVF84MDJfMVg7CisgICAgICAgICAgICBicmVhazsKKyNlbmRpZgorCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IFVuc3VwcG9ydGVkIGtleSBtZ210IHR5cGUgJWQiLAorICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywga2V5X21nbXQpOworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisKKyAgICB9CisgICAgcmV0dXJuIDA7Cit9CisKKy8qCisgKiBGVU5DVElPTjogd2xhbl9oZGRfY2ZnODAyMTFfc2V0X2NpcGhlcgorICogVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHRvIHNldCB0aGUgZW5jcnlwdGlvbiB0eXBlCisgKiAoTk9ORS9XRVA0MC9XRVAxMDQvVEtJUC9DQ01QKS4KKyAqLworc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV9zZXRfY2lwaGVyKCBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTMyIGNpcGhlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCB1Y2FzdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApCit7CisgICAgZUNzckVuY3J5cHRpb25UeXBlIGVuY3J5cHRpb25UeXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfTk9ORTsKKyAgICBoZGRfd2V4dF9zdGF0ZV90ICpwV2V4dFN0YXRlID0gV0xBTl9IRERfR0VUX1dFWFRfU1RBVEVfUFRSKHBBZGFwdGVyKTsKKyAgICBoZGRfc3RhdGlvbl9jdHhfdCAqcEhkZFN0YUN0eCA9IFdMQU5fSEREX0dFVF9TVEFUSU9OX0NUWF9QVFIocEFkYXB0ZXIpOworCisgICAgRU5URVIoKTsKKworICAgIGlmICghY2lwaGVyKQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXM6IHJlY2VpdmVkIGNpcGhlciAlZCAtIGNvbnNpZGVyaW5nIG5vbmUiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fLCBjaXBoZXIpOworICAgICAgICBlbmNyeXB0aW9uVHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX05PTkU7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisKKyAgICAgICAgLypzZXQgZW5jcnlwdGlvbiBtZXRob2QqLworICAgICAgICBzd2l0Y2ggKGNpcGhlcikKKyAgICAgICAgeworICAgICAgICAgICAgY2FzZSBJV19BVVRIX0NJUEhFUl9OT05FOgorICAgICAgICAgICAgICAgIGVuY3J5cHRpb25UeXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfTk9ORTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBXTEFOX0NJUEhFUl9TVUlURV9XRVA0MDoKKyAgICAgICAgICAgICAgICBlbmNyeXB0aW9uVHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX1dFUDQwOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIFdMQU5fQ0lQSEVSX1NVSVRFX1dFUDEwNDoKKyAgICAgICAgICAgICAgICBlbmNyeXB0aW9uVHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX1dFUDEwNDsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBXTEFOX0NJUEhFUl9TVUlURV9US0lQOgorICAgICAgICAgICAgICAgIGVuY3J5cHRpb25UeXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfVEtJUDsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBXTEFOX0NJUEhFUl9TVUlURV9DQ01QOgorICAgICAgICAgICAgICAgIGVuY3J5cHRpb25UeXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfQUVTOworICAgICAgICAgICAgICAgIGJyZWFrOworI2lmZGVmIEZFQVRVUkVfV0xBTl9XQVBJCisgICAgICAgIGNhc2UgV0xBTl9DSVBIRVJfU1VJVEVfU01TNDoKKyAgICAgICAgICAgIGVuY3J5cHRpb25UeXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfV1BJOworICAgICAgICAgICAgYnJlYWs7CisjZW5kaWYKKworI2lmZGVmIEZFQVRVUkVfV0xBTl9FU0UKKyAgICAgICAgY2FzZSBXTEFOX0NJUEhFUl9TVUlURV9LUks6CisgICAgICAgICAgICBlbmNyeXB0aW9uVHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX0tSSzsKKyAgICAgICAgICAgIGJyZWFrOworI2VuZGlmCisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogVW5zdXBwb3J0ZWQgY2lwaGVyIHR5cGUgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIGNpcGhlcik7CisgICAgICAgICAgICAgICAgcmV0dXJuIC1FT1BOT1RTVVBQOworICAgICAgICB9CisgICAgfQorCisgICAgaWYgKHVjYXN0KQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXM6IHNldHRpbmcgdW5pY2FzdCBjaXBoZXIgdHlwZSB0byAlZCIsCisgICAgICAgICAgICAgICAgX19mdW5jX18sIGVuY3J5cHRpb25UeXBlKTsKKyAgICAgICAgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLnVjRW5jcnlwdGlvblR5cGUgICAgICAgICAgICA9IGVuY3J5cHRpb25UeXBlOworICAgICAgICBwV2V4dFN0YXRlLT5yb2FtUHJvZmlsZS5FbmNyeXB0aW9uVHlwZS5udW1FbnRyaWVzID0gMTsKKyAgICAgICAgcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUuRW5jcnlwdGlvblR5cGUuZW5jcnlwdGlvblR5cGVbMF0gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5jcnlwdGlvblR5cGU7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIiVzOiBzZXR0aW5nIG1jYXN0IGNpcGhlciB0eXBlIHRvICVkIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgZW5jcnlwdGlvblR5cGUpOworICAgICAgICBwSGRkU3RhQ3R4LT5jb25uX2luZm8ubWNFbmNyeXB0aW9uVHlwZSAgICAgICAgICAgICAgICAgICAgICAgPSBlbmNyeXB0aW9uVHlwZTsKKyAgICAgICAgcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUubWNFbmNyeXB0aW9uVHlwZS5udW1FbnRyaWVzICAgICAgICA9IDE7CisgICAgICAgIHBXZXh0U3RhdGUtPnJvYW1Qcm9maWxlLm1jRW5jcnlwdGlvblR5cGUuZW5jcnlwdGlvblR5cGVbMF0gPSBlbmNyeXB0aW9uVHlwZTsKKyAgICB9CisKKyAgICByZXR1cm4gMDsKK30KKworCisvKgorICogRlVOQ1RJT046IHdsYW5faGRkX2NmZzgwMjExX3NldF9pZQorICogVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHRvIHBhcnNlIFdQQS9SU04gSUUncy4KKyAqLworaW50IHdsYW5faGRkX2NmZzgwMjExX3NldF9pZSggaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKmllLAorI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICppZSwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90IGllX2xlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKQoreworICAgIGhkZF93ZXh0X3N0YXRlX3QgKnBXZXh0U3RhdGUgPSBXTEFOX0hERF9HRVRfV0VYVF9TVEFURV9QVFIocEFkYXB0ZXIpOworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxOCwwKSkKKyAgICBjb25zdCB1OCAqZ2VuaWUgPSBpZTsKKyNlbHNlCisgICAgdTggKmdlbmllID0gaWU7CisjZW5kaWYKKyAgICB2X1UxNl90IHJlbUxlbiA9IGllX2xlbjsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fV0FQSQorICAgIHZfVTMyX3QgYWttc3VpdGVbTUFYX05VTV9BS01fU1VJVEVTXTsKKyAgICB1MTYgKnRtcDsKKyAgICB2X1UxNl90IGFrbXN1aXRlQ291bnQ7CisgICAgaW50ICpha21saXN0OworI2VuZGlmCisgICAgRU5URVIoKTsKKworICAgIC8qIGNsZWFyIHByZXZpb3VzIGFzc29jQWRkSUUgKi8KKyAgICBwV2V4dFN0YXRlLT5hc3NvY0FkZElFLmxlbmd0aCA9IDA7CisgICAgcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUuYldQU0Fzc29jaWF0aW9uID0gVk9TX0ZBTFNFOworICAgIHBXZXh0U3RhdGUtPnJvYW1Qcm9maWxlLmJPU0VOQXNzb2NpYXRpb24gPSBWT1NfRkFMU0U7CisKKyAgICB3aGlsZSAocmVtTGVuID49IDIpCisgICAgeworICAgICAgICB2X1UxNl90IGVMZW4gPSAwOworICAgICAgICB2X1U4X3QgZWxlbWVudElkOworICAgICAgICBlbGVtZW50SWQgPSAqZ2VuaWUrKzsKKyAgICAgICAgZUxlbiAgPSAqZ2VuaWUrKzsKKyAgICAgICAgcmVtTGVuIC09IDI7CisKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXM6IElFWzB4JVhdLCBMRU5bJWRdIiwKKyAgICAgICAgICAgIF9fZnVuY19fLCBlbGVtZW50SWQsIGVMZW4pOworCisgICAgICAgIHN3aXRjaCAoIGVsZW1lbnRJZCApCisgICAgICAgIHsKKyAgICAgICAgICAgIGNhc2UgRE9UMTFGX0VJRF9XUEE6CisgICAgICAgICAgICAgICAgaWYgKDQgPiBlTGVuKSAvKiBzaG91bGQgaGF2ZSBhdCBsZWFzdCBPVUkgd2hpY2ggaXMgNCBieXRlcyBzbyBleHRyYSAyIGJ5dGVzIG5vdCBuZWVkZWQgKi8KKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgV1BBIElFIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoMCA9PSBtZW1jbXAoJmdlbmllWzBdLCAiXHgwMFx4NTBceGYyXHgwNCIsIDQpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdl9VMTZfdCBjdXJBZGRJRUxlbiA9IHBXZXh0U3RhdGUtPmFzc29jQWRkSUUubGVuZ3RoOworICAgICAgICAgICAgICAgICAgICBoZGRMb2cgKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXMgU2V0IFdQUyBJRShsZW4gJWQpIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgZUxlbiArIDIpOworCisgICAgICAgICAgICAgICAgICAgIGlmKCBTSVJfTUFDX01BWF9BRERfSUVfTEVOR1RIIDwgKHBXZXh0U3RhdGUtPmFzc29jQWRkSUUubGVuZ3RoICsgZUxlbikgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsICJDYW5ub3QgYWNjb21tb2RhdGUgYXNzb2NBZGRJRS4gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIk5lZWQgYmlnZ2VyIGJ1ZmZlciBzcGFjZSIpOworICAgICAgICAgICAgICAgICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVOT01FTTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvLyBXU0MgSUUgaXMgc2F2ZWQgdG8gQWRkaXRpb25hbCBJRSA7IGl0IHNob3VsZCBiZSBhY2N1bXVsYXRlZCB0byBoYW5kbGUgV1BTIElFICsgUDJQIElFCisgICAgICAgICAgICAgICAgICAgIG1lbWNweSggcFdleHRTdGF0ZS0+YXNzb2NBZGRJRS5hZGRJRWRhdGEgKyBjdXJBZGRJRUxlbiwgZ2VuaWUgLSAyLCBlTGVuICsgMik7CisgICAgICAgICAgICAgICAgICAgIHBXZXh0U3RhdGUtPmFzc29jQWRkSUUubGVuZ3RoICs9IGVMZW4gKyAyOworCisgICAgICAgICAgICAgICAgICAgIHBXZXh0U3RhdGUtPnJvYW1Qcm9maWxlLmJXUFNBc3NvY2lhdGlvbiA9IFZPU19UUlVFOworICAgICAgICAgICAgICAgICAgICBwV2V4dFN0YXRlLT5yb2FtUHJvZmlsZS5wQWRkSUVBc3NvYyA9IHBXZXh0U3RhdGUtPmFzc29jQWRkSUUuYWRkSUVkYXRhOworICAgICAgICAgICAgICAgICAgICBwV2V4dFN0YXRlLT5yb2FtUHJvZmlsZS5uQWRkSUVBc3NvY0xlbmd0aCA9IHBXZXh0U3RhdGUtPmFzc29jQWRkSUUubGVuZ3RoOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmICgwID09IG1lbWNtcCgmZ2VuaWVbMF0sICJceDAwXHg1MFx4ZjIiLCAzKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyAoVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlcyBTZXQgV1BBIElFIChsZW4gJWQpIixfX2Z1bmNfXywgZUxlbiArIDIpOworICAgICAgICAgICAgICAgICAgICBtZW1zZXQoIHBXZXh0U3RhdGUtPldQQVJTTklFLCAwLCBNQVhfV1BBX1JTTl9JRV9MRU4gKTsKKyAgICAgICAgICAgICAgICAgICAgbWVtY3B5KCBwV2V4dFN0YXRlLT5XUEFSU05JRSwgZ2VuaWUgLSAyLCAoZUxlbiArIDIpIC8qaWVfbGVuKi8pOworICAgICAgICAgICAgICAgICAgICBwV2V4dFN0YXRlLT5yb2FtUHJvZmlsZS5wV1BBUmVxSUUgPSBwV2V4dFN0YXRlLT5XUEFSU05JRTsKKyAgICAgICAgICAgICAgICAgICAgcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUubldQQVJlcUlFTGVuZ3RoID0gZUxlbiArIDI7Ly9pZV9sZW47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKCAoMCA9PSBtZW1jbXAoJmdlbmllWzBdLCBQMlBfT1VJX1RZUEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQMlBfT1VJX1RZUEVfU0laRSkpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdl9VMTZfdCBjdXJBZGRJRUxlbiA9IHBXZXh0U3RhdGUtPmFzc29jQWRkSUUubGVuZ3RoOworICAgICAgICAgICAgICAgICAgICBoZGRMb2cgKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXMgU2V0IFAyUCBJRShsZW4gJWQpIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgZUxlbiArIDIpOworCisgICAgICAgICAgICAgICAgICAgIGlmKCBTSVJfTUFDX01BWF9BRERfSUVfTEVOR1RIIDwgKHBXZXh0U3RhdGUtPmFzc29jQWRkSUUubGVuZ3RoICsgZUxlbikgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsICJDYW5ub3QgYWNjb21tb2RhdGUgYXNzb2NBZGRJRSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTmVlZCBiaWdnZXIgYnVmZmVyIHNwYWNlIik7CisgICAgICAgICAgICAgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRU5PTUVNOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8vIFAyUCBJRSBpcyBzYXZlZCB0byBBZGRpdGlvbmFsIElFIDsgaXQgc2hvdWxkIGJlIGFjY3VtdWxhdGVkIHRvIGhhbmRsZSBXUFMgSUUgKyBQMlAgSUUKKyAgICAgICAgICAgICAgICAgICAgbWVtY3B5KCBwV2V4dFN0YXRlLT5hc3NvY0FkZElFLmFkZElFZGF0YSArIGN1ckFkZElFTGVuLCBnZW5pZSAtIDIsIGVMZW4gKyAyKTsKKyAgICAgICAgICAgICAgICAgICAgcFdleHRTdGF0ZS0+YXNzb2NBZGRJRS5sZW5ndGggKz0gZUxlbiArIDI7CisKKyAgICAgICAgICAgICAgICAgICAgcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUucEFkZElFQXNzb2MgPSBwV2V4dFN0YXRlLT5hc3NvY0FkZElFLmFkZElFZGF0YTsKKyAgICAgICAgICAgICAgICAgICAgcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUubkFkZElFQXNzb2NMZW5ndGggPSBwV2V4dFN0YXRlLT5hc3NvY0FkZElFLmxlbmd0aDsKKyAgICAgICAgICAgICAgICB9CisjaWZkZWYgV0xBTl9GRUFUVVJFX1dGRAorICAgICAgICAgICAgICAgIGVsc2UgaWYgKCAoMCA9PSBtZW1jbXAoJmdlbmllWzBdLCBXRkRfT1VJX1RZUEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXRkRfT1VJX1RZUEVfU0laRSkpCisgICAgICAgICAgICAgICAgICAgICAgICAvKkNvbnNpZGVyIFdGRCBJRSwgb25seSBmb3IgUDJQIENsaWVudCAqLworICAgICAgICAgICAgICAgICAgICAgICAgICYmIChXTEFOX0hERF9QMlBfQ0xJRU5UID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdl9VMTZfdCBjdXJBZGRJRUxlbiA9IHBXZXh0U3RhdGUtPmFzc29jQWRkSUUubGVuZ3RoOworICAgICAgICAgICAgICAgICAgICBoZGRMb2cgKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXMgU2V0IFdGRCBJRShsZW4gJWQpIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgZUxlbiArIDIpOworCisgICAgICAgICAgICAgICAgICAgIGlmKCBTSVJfTUFDX01BWF9BRERfSUVfTEVOR1RIIDwgKHBXZXh0U3RhdGUtPmFzc29jQWRkSUUubGVuZ3RoICsgZUxlbikgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsICJDYW5ub3QgYWNjb21tb2RhdGUgYXNzb2NBZGRJRSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTmVlZCBiaWdnZXIgYnVmZmVyIHNwYWNlIik7CisgICAgICAgICAgICAgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRU5PTUVNOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8vIFdGRCBJRSBpcyBzYXZlZCB0byBBZGRpdGlvbmFsIElFIDsgaXQgc2hvdWxkIGJlIGFjY3VtdWxhdGVkIHRvIGhhbmRsZQorICAgICAgICAgICAgICAgICAgICAvLyBXUFMgSUUgKyBQMlAgSUUgKyBXRkQgSUUKKyAgICAgICAgICAgICAgICAgICAgbWVtY3B5KCBwV2V4dFN0YXRlLT5hc3NvY0FkZElFLmFkZElFZGF0YSArIGN1ckFkZElFTGVuLCBnZW5pZSAtIDIsIGVMZW4gKyAyKTsKKyAgICAgICAgICAgICAgICAgICAgcFdleHRTdGF0ZS0+YXNzb2NBZGRJRS5sZW5ndGggKz0gZUxlbiArIDI7CisKKyAgICAgICAgICAgICAgICAgICAgcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUucEFkZElFQXNzb2MgPSBwV2V4dFN0YXRlLT5hc3NvY0FkZElFLmFkZElFZGF0YTsKKyAgICAgICAgICAgICAgICAgICAgcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUubkFkZElFQXNzb2NMZW5ndGggPSBwV2V4dFN0YXRlLT5hc3NvY0FkZElFLmxlbmd0aDsKKyAgICAgICAgICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgICAgICAgICAvKiBBcHBlbmRpbmcgSFMgMi4wIEluZGljYXRpb24gRWxlbWVudCBpbiBBc3NpY2lhdGlvbiBSZXF1ZXN0ICovCisgICAgICAgICAgICAgICAgZWxzZSBpZiAoICgwID09IG1lbWNtcCgmZ2VuaWVbMF0sIEhTMjBfT1VJX1RZUEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIUzIwX09VSV9UWVBFX1NJWkUpKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB2X1UxNl90IGN1ckFkZElFTGVuID0gcFdleHRTdGF0ZS0+YXNzb2NBZGRJRS5sZW5ndGg7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyAoVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlcyBTZXQgSFMyMCBJRShsZW4gJWQpIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgZUxlbiArIDIpOworCisgICAgICAgICAgICAgICAgICAgIGlmKCBTSVJfTUFDX01BWF9BRERfSUVfTEVOR1RIIDwgKHBXZXh0U3RhdGUtPmFzc29jQWRkSUUubGVuZ3RoICsgZUxlbikgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCAiQ2Fubm90IGFjY29tbW9kYXRlIGFzc29jQWRkSUUgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOZWVkIGJpZ2dlciBidWZmZXIgc3BhY2UiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVOT01FTTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBtZW1jcHkoIHBXZXh0U3RhdGUtPmFzc29jQWRkSUUuYWRkSUVkYXRhICsgY3VyQWRkSUVMZW4sIGdlbmllIC0gMiwgZUxlbiArIDIpOworICAgICAgICAgICAgICAgICAgICBwV2V4dFN0YXRlLT5hc3NvY0FkZElFLmxlbmd0aCArPSBlTGVuICsgMjsKKworICAgICAgICAgICAgICAgICAgICBwV2V4dFN0YXRlLT5yb2FtUHJvZmlsZS5wQWRkSUVBc3NvYyA9IHBXZXh0U3RhdGUtPmFzc29jQWRkSUUuYWRkSUVkYXRhOworICAgICAgICAgICAgICAgICAgICBwV2V4dFN0YXRlLT5yb2FtUHJvZmlsZS5uQWRkSUVBc3NvY0xlbmd0aCA9IHBXZXh0U3RhdGUtPmFzc29jQWRkSUUubGVuZ3RoOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgLyogQXBwZW5kaW5nIE9TRU4gSW5mb3JtYXRpb24gIEVsZW1lbnQgaW4gQXNzaWNpYXRpb24gUmVxdWVzdCAqLworICAgICAgICAgICAgICAgIGVsc2UgaWYgKCAoMCA9PSBtZW1jbXAoJmdlbmllWzBdLCBPU0VOX09VSV9UWVBFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT1NFTl9PVUlfVFlQRV9TSVpFKSkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdl9VMTZfdCBjdXJBZGRJRUxlbiA9IHBXZXh0U3RhdGUtPmFzc29jQWRkSUUubGVuZ3RoOworICAgICAgICAgICAgICAgICAgICBoZGRMb2cgKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXMgU2V0IE9TRU4gSUUobGVuICVkKSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIGVMZW4gKyAyKTsKKworICAgICAgICAgICAgICAgICAgICBpZiggU0lSX01BQ19NQVhfQUREX0lFX0xFTkdUSCA8IChwV2V4dFN0YXRlLT5hc3NvY0FkZElFLmxlbmd0aCArIGVMZW4pICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwgIkNhbm5vdCBhY2NvbW1vZGF0ZSBhc3NvY0FkZElFICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTmVlZCBiaWdnZXIgYnVmZmVyIHNwYWNlIik7CisgICAgICAgICAgICAgICAgICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FTk9NRU07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgbWVtY3B5KCBwV2V4dFN0YXRlLT5hc3NvY0FkZElFLmFkZElFZGF0YSArIGN1ckFkZElFTGVuLCBnZW5pZSAtIDIsIGVMZW4gKyAyKTsKKyAgICAgICAgICAgICAgICAgICAgcFdleHRTdGF0ZS0+YXNzb2NBZGRJRS5sZW5ndGggKz0gZUxlbiArIDI7CisKKyAgICAgICAgICAgICAgICAgICAgcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUuYk9TRU5Bc3NvY2lhdGlvbiA9IFZPU19UUlVFOworICAgICAgICAgICAgICAgICAgICBwV2V4dFN0YXRlLT5yb2FtUHJvZmlsZS5wQWRkSUVBc3NvYyA9IHBXZXh0U3RhdGUtPmFzc29jQWRkSUUuYWRkSUVkYXRhOworICAgICAgICAgICAgICAgICAgICBwV2V4dFN0YXRlLT5yb2FtUHJvZmlsZS5uQWRkSUVBc3NvY0xlbmd0aCA9IHBXZXh0U3RhdGUtPmFzc29jQWRkSUUubGVuZ3RoOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAvKiBVcGRhdGUgb25seSBmb3IgV1BBIElFICovCisgICAgICAgICAgICAgICAgaWYgKCFtZW1jbXAoZ2VuaWUsIFdQQV9PVUlfVFlQRSwgV1BBX09VSV9UWVBFX1NJWkUpICYmCisgICAgICAgICAgICAgICAgICAgICAgIChXTEFOX0hERF9JQlNTID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkpIHsKKworICAgICAgICAgICAgICAgICAgIC8qIHBvcHVsYXRpbmcgYXMgQURESUUgaW4gYmVhY29uIGZyYW1lcyAqLworICAgICAgICAgICAgICAgICAgIGlmIChjY21DZmdTZXRTdHIoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLAorICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX1BST0JFX1JTUF9CQ05fQURETklFX0RBVEEsICh1OCAqKWdlbmllIC0gMiwgZUxlbiArIDIsCisgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsIGVBTklfQk9PTEVBTl9GQUxTRSk9PSBlSEFMX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNjbUNmZ1NldEludChXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX1BST0JFX1JTUF9CQ05fQURETklFX0ZMQUcsIDEsTlVMTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGVBTklfQk9PTEVBTl9GQUxTRSkgPT0gZUhBTF9TVEFUVVNfRkFJTFVSRSkKKyAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkNvbGRuJ3QgcGFzcyAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIldOSV9DRkdfUFJPQkVfUlNQX0JDTl9BREROSUVfRkxBRyB0byBDQ00iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgIH0vKiBjY21DZmdTZXRTdHIoLFdOSV9DRkdfUFJPQkVfUlNQX0JDTl9BREROSUVfREFUQSwgLCApKi8KKyAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkNvdWxkIG5vdCBwYXNzIG9uICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJXTklfQ0ZHX1BST0JFX1JTUF9CQ05fQURETklFX0RBVEEgdG8gQ0NNIik7CisKKyAgICAgICAgICAgICAgICAgICAvKiBJQlNTIG1vZGUgZG9lc24ndCBjb250YWluIHBhcmFtcy0+cHJvYmVyZXNwX2llcyBzdGlsbAorICAgICAgICAgICAgICAgICAgICBiZWFjb25JRSdzIG5lZWQgdG8gYmUgcG9wdWxhdGVkIGluIHByb2JlIHJlc3BvbnNlIGZyYW1lcyAqLworICAgICAgICAgICAgICAgICAgIGlmICggKE5VTEwgIT0gKGdlbmllIC0gMikpICYmICgwICE9IGVMZW4gKyAyKSApCisgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIHUxNiByZW1fcHJvYmVfcmVzcF9pZV9sZW4gPSBlTGVuICsgMjsKKyAgICAgICAgICAgICAgICAgICAgICB1OCBwcm9iZV9yc3BfaWVfbGVuWzNdID0gezB9OworICAgICAgICAgICAgICAgICAgICAgIHU4IGNvdW50ZXIgPSAwOworCisgICAgICAgICAgICAgICAgICAgICAgLyogQ2hlY2sgUHJvYmUgUmVzcCBMZW5ndGggaWYgaXQgaXMgZ3JlYXRlciB0aGVuIDI1NSB0aGVuCisgICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgUHJvYmUgUnNwIElFcyBpbnRvIFdOSV9DRkdfUFJPQkVfUlNQX0FERE5JRV9EQVRBMQorICAgICAgICAgICAgICAgICAgICAgICAgICYgV05JX0NGR19QUk9CRV9SU1BfQURETklFX0RBVEEyIENGRyBWYXJpYWJsZSBBcyBXZSBhcmUKKyAgICAgICAgICAgICAgICAgICAgICAgICBub3QgYWJsZSBTdG9yZSBNb3JlIHRoZW4gMjU1IGJ5dGVzIGludG8gT25lIFZhcmlhYmxlICovCisKKyAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoKHJlbV9wcm9iZV9yZXNwX2llX2xlbiA+IDApICYmIChjb3VudGVyIDwgMykpCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZW1fcHJvYmVfcmVzcF9pZV9sZW4gPiBNQVhfQ0ZHX1NUUklOR19MRU4pCisgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb2JlX3JzcF9pZV9sZW5bY291bnRlcisrXSA9IE1BWF9DRkdfU1RSSU5HX0xFTjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1fcHJvYmVfcmVzcF9pZV9sZW4gLT0gTUFYX0NGR19TVFJJTkdfTEVOOworICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb2JlX3JzcF9pZV9sZW5bY291bnRlcisrXSA9IHJlbV9wcm9iZV9yZXNwX2llX2xlbjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1fcHJvYmVfcmVzcF9pZV9sZW4gPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICByZW1fcHJvYmVfcmVzcF9pZV9sZW4gPSAwOworCisgICAgICAgICAgICAgICAgICAgICAgaWYgKHByb2JlX3JzcF9pZV9sZW5bMF0gPiAwKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2NtQ2ZnU2V0U3RyKFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfUFJPQkVfUlNQX0FERE5JRV9EQVRBMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4KikoZ2VuaWUgLSAyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb2JlX3JzcF9pZV9sZW5bMF0sIE5VTEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQU5JX0JPT0xFQU5fRkFMU0UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSBlSEFMX1NUQVRVU19GQUlMVVJFKQorICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkNvdWxkIG5vdCBwYXNzIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib24gV05JX0NGR19QUk9CRV9SU1BfQURETklFX0RBVEExIHRvIENDTSIpOworICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICByZW1fcHJvYmVfcmVzcF9pZV9sZW4gKz0gcHJvYmVfcnNwX2llX2xlblswXTsKKyAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICBpZiAocHJvYmVfcnNwX2llX2xlblsxXSA+IDApCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjY21DZmdTZXRTdHIoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19QUk9CRV9SU1BfQURETklFX0RBVEEyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTgqKShnZW5pZSAtICgyICsgcmVtX3Byb2JlX3Jlc3BfaWVfbGVuKSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9iZV9yc3BfaWVfbGVuWzFdLCBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUFOSV9CT09MRUFOX0ZBTFNFKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gZUhBTF9TVEFUVVNfRkFJTFVSRSkKKyAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkNvdWxkIG5vdCBwYXNzIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm9uIFdOSV9DRkdfUFJPQkVfUlNQX0FERE5JRV9EQVRBMiB0byBDQ00iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgcmVtX3Byb2JlX3Jlc3BfaWVfbGVuICs9IHByb2JlX3JzcF9pZV9sZW5bMV07CisgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgaWYgKHByb2JlX3JzcF9pZV9sZW5bMl0gPiAwKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2NtQ2ZnU2V0U3RyKFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfUFJPQkVfUlNQX0FERE5JRV9EQVRBMywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4KikoZ2VuaWUgLSAoMiArIHJlbV9wcm9iZV9yZXNwX2llX2xlbikpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvYmVfcnNwX2llX2xlblsyXSwgTlVMTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVBTklfQk9PTEVBTl9GQUxTRSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IGVIQUxfU1RBVFVTX0ZBSUxVUkUpCisgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkNvdWxkIG5vdCBwYXNzIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib24gV05JX0NGR19QUk9CRV9SU1BfQURETklFX0RBVEEzIHRvIENDTSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbV9wcm9iZV9yZXNwX2llX2xlbiArPSBwcm9iZV9yc3BfaWVfbGVuWzJdOworICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNjbUNmZ1NldEludChXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX1BST0JFX1JTUF9BREROSUVfRkxBRywgMSxOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZUFOSV9CT09MRUFOX0ZBTFNFKSA9PSBlSEFMX1NUQVRVU19GQUlMVVJFKQorICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQ291bGQgbm90IHBhc3MiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvbiBXTklfQ0ZHX1BST0JFX1JTUF9BREROSUVfRkxBRyB0byBDQ00iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IC8qIGVuZCBvZiBpZiAoV0xBTl9IRERfSUJTUyA9PSBwQWRhcHRlci0+ZGV2aWNlX21vZGUpICovCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIERPVDExRl9FSURfUlNOOgorICAgICAgICAgICAgICAgIGhkZExvZyAoVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlcyBTZXQgUlNOIElFKGxlbiAlZCkiLF9fZnVuY19fLCBlTGVuICsgMik7CisgICAgICAgICAgICAgICAgbWVtc2V0KCBwV2V4dFN0YXRlLT5XUEFSU05JRSwgMCwgTUFYX1dQQV9SU05fSUVfTEVOICk7CisgICAgICAgICAgICAgICAgbWVtY3B5KCBwV2V4dFN0YXRlLT5XUEFSU05JRSwgZ2VuaWUgLSAyLCAoZUxlbiArIDIpLyppZV9sZW4qLyk7CisgICAgICAgICAgICAgICAgcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUucFJTTlJlcUlFID0gcFdleHRTdGF0ZS0+V1BBUlNOSUU7CisgICAgICAgICAgICAgICAgcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUublJTTlJlcUlFTGVuZ3RoID0gZUxlbiArIDI7IC8vaWVfbGVuOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgLyogQXBwZW5kaW5nIEV4dGVuZGVkIENhcGFiaWxpdGllcyB3aXRoIEludGVyd29ya2luZyBiaXQgc2V0CisgICAgICAgICAgICAgICAgICogaW4gQXNzb2MgUmVxLgorICAgICAgICAgICAgICAgICAqCisgICAgICAgICAgICAgICAgICogSW4gYXNzb2MgcmVxIHRoaXMgRVhUIENhcCB3aWxsIG9ubHkgYmUgdGFrZW4gaW50byBhY2NvdW50IGlmCisgICAgICAgICAgICAgICAgICogaW50ZXJ3b3JraW5nU2VydmljZSBiaXQgaXMgc2V0IHRvIDEuIEN1cnJlbnRseQorICAgICAgICAgICAgICAgICAqIGRyaXZlciBpcyBvbmx5IGludGVyZXN0ZWQgaW4gaW50ZXJ3b3JraW5nU2VydmljZSBjYXBhYmlsaXR5CisgICAgICAgICAgICAgICAgICogZnJvbSBzdXBwbGljYW50LiBJZiBpbiBmdXR1cmUgYW55IG90aGVyIEVYVCBDYXAgaW5mbyBpcworICAgICAgICAgICAgICAgICAqIHJlcXVpcmVkIGZyb20gc3VwcGxpY2F0LCBpdCBuZWVkcyB0byBiZSBoYW5kbGVkIHdoaWxlCisgICAgICAgICAgICAgICAgICogc2VuZGluZyBBc3NvYyBSZXEgaW4gTElNLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgY2FzZSBET1QxMUZfRUlEX0VYVENBUDoKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHZfVTE2X3QgY3VyQWRkSUVMZW4gPSBwV2V4dFN0YXRlLT5hc3NvY0FkZElFLmxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nIChWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIiVzIFNldCBFeHRlbmRlZCBDQVBTIElFKGxlbiAlZCkiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBlTGVuICsgMik7CisKKyAgICAgICAgICAgICAgICAgICAgaWYoIFNJUl9NQUNfTUFYX0FERF9JRV9MRU5HVEggPCAocFdleHRTdGF0ZS0+YXNzb2NBZGRJRS5sZW5ndGggKyBlTGVuKSApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwgIkNhbm5vdCBhY2NvbW1vZGF0ZSBhc3NvY0FkZElFICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOZWVkIGJpZ2dlciBidWZmZXIgc3BhY2UiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FTk9NRU07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgbWVtY3B5KCBwV2V4dFN0YXRlLT5hc3NvY0FkZElFLmFkZElFZGF0YSArIGN1ckFkZElFTGVuLCBnZW5pZSAtIDIsIGVMZW4gKyAyKTsKKyAgICAgICAgICAgICAgICAgICAgcFdleHRTdGF0ZS0+YXNzb2NBZGRJRS5sZW5ndGggKz0gZUxlbiArIDI7CisKKyAgICAgICAgICAgICAgICAgICAgcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUucEFkZElFQXNzb2MgPSBwV2V4dFN0YXRlLT5hc3NvY0FkZElFLmFkZElFZGF0YTsKKyAgICAgICAgICAgICAgICAgICAgcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUubkFkZElFQXNzb2NMZW5ndGggPSBwV2V4dFN0YXRlLT5hc3NvY0FkZElFLmxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorI2lmZGVmIEZFQVRVUkVfV0xBTl9XQVBJCisgICAgICAgICAgICBjYXNlIFdMQU5fRUlEX1dBUEk6CisgICAgICAgICAgICAgICAgcEFkYXB0ZXItPndhcGlfaW5mby5uV2FwaU1vZGUgPSAxOyAgIC8vU2V0dGluZyBXQVBJIE1vZGUgdG8gT049MQorICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIldBUEkgTU9ERSBJUyAldSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+d2FwaV9pbmZvLm5XYXBpTW9kZSk7CisgICAgICAgICAgICAgICAgdG1wID0gKHUxNiAqKWllOworICAgICAgICAgICAgICAgIHRtcCA9IHRtcCArIDI7IC8vIFNraXAgZWxlbWVudCBJZCBhbmQgTGVuLCBWZXJzaW9uCisgICAgICAgICAgICAgICAgYWttc3VpdGVDb3VudCA9IFdQQV9HRVRfTEUxNih0bXApOworICAgICAgICAgICAgICAgIHRtcCA9IHRtcCArIDE7CisgICAgICAgICAgICAgICAgYWttbGlzdCA9IChpbnQgKikodG1wKTsKKyAgICAgICAgICAgICAgICBpZihha21zdWl0ZUNvdW50IDw9IE1BWF9OVU1fQUtNX1NVSVRFUykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIG1lbWNweShha21zdWl0ZSwgYWttbGlzdCwgKDQqYWttc3VpdGVDb3VudCkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCAiSW52YWxpZCBha21TdWl0ZSBjb3VudCIpOworICAgICAgICAgICAgICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoV0FQSV9QU0tfQUtNX1NVSVRFID09IGFrbXN1aXRlWzBdKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXM6IFdBUEkgQVVUSCBNT0RFIFNFVCBUTyBQU0siLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+d2FwaV9pbmZvLndhcGlBdXRoTW9kZSA9IFdBUElfQVVUSF9NT0RFX1BTSzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKFdBUElfQ0VSVF9BS01fU1VJVEUgPT0gYWttc3VpdGVbMF0pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczogV0FQSSBBVVRIIE1PREUgU0VUIFRPIENFUlRJRklDQVRFIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT53YXBpX2luZm8ud2FwaUF1dGhNb2RlID0gV0FQSV9BVVRIX01PREVfQ0VSVDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisjZW5kaWYKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgaGRkTG9nIChWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAiJXMgU2V0IFVOS05PV04gSUUgJVgiLCBfX2Z1bmNfXywgZWxlbWVudElkKTsKKyAgICAgICAgICAgICAgICAvKiB3aGVuIFVua25vd24gSUUgaXMgcmVjZWl2ZWQgd2Ugc2hvdWxkIGJyZWFrIGFuZCBjb250aW51ZQorICAgICAgICAgICAgICAgICAqIHRvIHRoZSBuZXh0IElFIGluIHRoZSBidWZmZXIgaW5zdGVhZCB3ZSB3ZXJlIHJldHVybmluZworICAgICAgICAgICAgICAgICAqIHNvIGNoYW5naW5nIHRoaXMgdG8gYnJlYWsgKi8KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBnZW5pZSArPSBlTGVuOworICAgICAgICByZW1MZW4gLT0gZUxlbjsKKyAgICB9CisgICAgRVhJVCgpOworICAgIHJldHVybiAwOworfQorCisvKgorICogRlVOQ1RJT046IGhkZF9pc1dQQUlFUHJlc2VudAorICogUGFyc2UgdGhlIHJlY2VpdmVkIElFIHRvIGZpbmQgdGhlIFdQQSBJRQorICoKKyAqLworc3RhdGljIGJvb2wgaGRkX2lzV1BBSUVQcmVzZW50KAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywgMTgsIDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICppZSwKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggKmllLAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggaWVfbGVuKQoreworICAgIHZfVThfdCBlTGVuID0gMDsKKyAgICB2X1UxNl90IHJlbUxlbiA9IGllX2xlbjsKKyAgICB2X1U4X3QgZWxlbWVudElkID0gMDsKKworICAgIHdoaWxlIChyZW1MZW4gPj0gMikKKyAgICB7CisgICAgICAgIGVsZW1lbnRJZCA9ICppZSsrOworICAgICAgICBlTGVuICA9ICppZSsrOworICAgICAgICByZW1MZW4gLT0gMjsKKyAgICAgICAgaWYgKGVMZW4gPiByZW1MZW4pCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOiBJRSBsZW5ndGggaXMgd3JvbmcgJWQiLCBfX2Z1bmNfXywgZUxlbik7CisgICAgICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgICAgIH0KKyAgICAgICAgaWYgKChlbGVtZW50SWQgPT0gRE9UMTFGX0VJRF9XUEEpICYmIChyZW1MZW4gPiA1KSkKKyAgICAgICAgeworICAgICAgICAgIC8qIE9VSSAtIDB4MDAgMFg1MCAwWEYyCisgICAgICAgICAgICAgV1BBIEluZm9ybWF0aW9uIEVsZW1lbnQgLSAweDAxCisgICAgICAgICAgICAgV1BBIHZlcnNpb24gLSAweDAxKi8KKyAgICAgICAgICAgIGlmICgwID09IG1lbWNtcCgmaWVbMF0sICJceDAwXHg1MFx4ZjJceDAxXHgwMSIsIDUpKQorICAgICAgICAgICAgICAgcmV0dXJuIFRSVUU7CisgICAgICAgIH0KKyAgICAgICAgaWUgKz0gZUxlbjsKKyAgICAgICAgcmVtTGVuIC09IGVMZW47CisgICAgfQorICAgIHJldHVybiBGQUxTRTsKK30KKworLyoKKyAqIEZVTkNUSU9OOiB3bGFuX2hkZF9jZmc4MDIxMV9zZXRfcHJpdmFjeQorICogVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHRvIGluaXRpYWxpemUgdGhlIHNlY3VyaXR5CisgKiBwYXJhbWV0ZXJzIGR1cmluZyBjb25uZWN0IG9wZXJhdGlvbi4KKyAqLworaW50IHdsYW5faGRkX2NmZzgwMjExX3NldF9wcml2YWN5KGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgY2ZnODAyMTFfY29ubmVjdF9wYXJhbXMgKnJlcQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKK3sKKyAgICBpbnQgc3RhdHVzID0gMDsKKyAgICBoZGRfd2V4dF9zdGF0ZV90ICpwV2V4dFN0YXRlID0gV0xBTl9IRERfR0VUX1dFWFRfU1RBVEVfUFRSKHBBZGFwdGVyKTsKKyAgICBFTlRFUigpOworCisgICAgLypzZXQgd3BhIHZlcnNpb24qLworICAgIHBXZXh0U3RhdGUtPndwYVZlcnNpb24gPSBJV19BVVRIX1dQQV9WRVJTSU9OX0RJU0FCTEVEOworCisgICAgaWYgKHJlcS0+Y3J5cHRvLndwYV92ZXJzaW9ucykKKyAgICB7CisgICAgICAgIGlmIChOTDgwMjExX1dQQV9WRVJTSU9OXzEgPT0gcmVxLT5jcnlwdG8ud3BhX3ZlcnNpb25zKQorICAgICAgICB7CisgICAgICAgICAgICBwV2V4dFN0YXRlLT53cGFWZXJzaW9uID0gSVdfQVVUSF9XUEFfVkVSU0lPTl9XUEE7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoTkw4MDIxMV9XUEFfVkVSU0lPTl8yID09IHJlcS0+Y3J5cHRvLndwYV92ZXJzaW9ucykKKyAgICAgICAgeworICAgICAgICAgICAgcFdleHRTdGF0ZS0+d3BhVmVyc2lvbiA9IElXX0FVVEhfV1BBX1ZFUlNJT05fV1BBMjsKKyAgICAgICAgfQorICAgIH0KKworICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIiVzOiBzZXQgd3BhIHZlcnNpb24gdG8gJWQiLCBfX2Z1bmNfXywKKyAgICAgICAgICAgIHBXZXh0U3RhdGUtPndwYVZlcnNpb24pOworCisgICAgLypzZXQgYXV0aGVudGljYXRpb24gdHlwZSovCisgICAgc3RhdHVzID0gd2xhbl9oZGRfY2ZnODAyMTFfc2V0X2F1dGhfdHlwZShwQWRhcHRlciwgcmVxLT5hdXRoX3R5cGUpOworCisgICAgaWYgKDAgPiBzdGF0dXMpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogZmFpbGVkIHRvIHNldCBhdXRoZW50aWNhdGlvbiB0eXBlICIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICB9CisKKyAgICAvKnNldCBrZXkgbWdtdCB0eXBlKi8KKyAgICBpZiAocmVxLT5jcnlwdG8ubl9ha21fc3VpdGVzKQorICAgIHsKKyAgICAgICAgc3RhdHVzID0gd2xhbl9oZGRfc2V0X2FrbV9zdWl0ZShwQWRhcHRlciwgcmVxLT5jcnlwdG8uYWttX3N1aXRlc1swXSk7CisgICAgICAgIGlmICgwID4gc3RhdHVzKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IGZhaWxlZCB0byBzZXQgYWttIHN1aXRlIiwKKyAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qc2V0IHBhaXJ3aXNlIGNpcGhlciB0eXBlKi8KKyAgICBpZiAocmVxLT5jcnlwdG8ubl9jaXBoZXJzX3BhaXJ3aXNlKQorICAgIHsKKyAgICAgICAgc3RhdHVzID0gd2xhbl9oZGRfY2ZnODAyMTFfc2V0X2NpcGhlcihwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxLT5jcnlwdG8uY2lwaGVyc19wYWlyd2lzZVswXSwgdHJ1ZSk7CisgICAgICAgIGlmICgwID4gc3RhdHVzKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiJXM6IGZhaWxlZCB0byBzZXQgdW5pY2FzdCBjaXBoZXIgdHlwZSIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgLypSZXNldCBwcmV2aW91cyBjaXBoZXIgc3VpdGUgdG8gbm9uZSovCisgICAgICAgIHN0YXR1cyA9IHdsYW5faGRkX2NmZzgwMjExX3NldF9jaXBoZXIocEFkYXB0ZXIsIDAsIHRydWUpOworICAgICAgICBpZiAoMCA+IHN0YXR1cykKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIiVzOiBmYWlsZWQgdG8gc2V0IHVuaWNhc3QgY2lwaGVyIHR5cGUiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICByZXR1cm4gc3RhdHVzOworICAgICAgICB9CisgICAgfQorCisgICAgLypzZXQgZ3JvdXAgY2lwaGVyIHR5cGUqLworICAgIHN0YXR1cyA9IHdsYW5faGRkX2NmZzgwMjExX3NldF9jaXBoZXIocEFkYXB0ZXIsIHJlcS0+Y3J5cHRvLmNpcGhlcl9ncm91cCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UpOworCisgICAgaWYgKDAgPiBzdGF0dXMpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IGZhaWxlZCB0byBzZXQgbWNhc3QgY2lwaGVyIHR5cGUiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICB9CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisgICAgcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUuTUZQRW5hYmxlZCA9IChyZXEtPm1mcCA9PSBOTDgwMjExX01GUF9SRVFVSVJFRCk7CisjZW5kaWYKKworICAgIC8qcGFyc2UgV1BBL1JTTiBJRSwgYW5kIHNldCB0aGUgY29ycmVzcG9pbmcgZmlsZWRzIGluIFJvYW0gcHJvZmlsZSovCisgICAgaWYgKHJlcS0+aWVfbGVuKQorICAgIHsKKyAgICAgICAgc3RhdHVzID0gd2xhbl9oZGRfY2ZnODAyMTFfc2V0X2llKHBBZGFwdGVyLCByZXEtPmllLCByZXEtPmllX2xlbik7CisgICAgICAgIGlmICggMCA+IHN0YXR1cykKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiBmYWlsZWQgdG8gcGFyc2UgdGhlIFdQQS9SU04gSUUiLAorICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgICByZXR1cm4gc3RhdHVzOworICAgICAgICB9CisgICAgfQorCisgICAgLyppbmNhc2Ugb2YgV0VQIHNldCBkZWZhdWx0IGtleSBpbmZvcm1hdGlvbiovCisgICAgaWYgKHJlcS0+a2V5ICYmIHJlcS0+a2V5X2xlbikKKyAgICB7CisgICAgICAgIGlmICggKFdMQU5fQ0lQSEVSX1NVSVRFX1dFUDQwID09IHJlcS0+Y3J5cHRvLmNpcGhlcnNfcGFpcndpc2VbMF0pCisgICAgICAgICAgICAgICAgfHwgKFdMQU5fQ0lQSEVSX1NVSVRFX1dFUDEwNCA9PSByZXEtPmNyeXB0by5jaXBoZXJzX3BhaXJ3aXNlWzBdKQorICAgICAgICAgICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKCBJV19BVVRIX0tFWV9NR01UXzgwMl8xWAorICAgICAgICAgICAgICAgICAgICA9PSAocFdleHRTdGF0ZS0+YXV0aEtleU1nbXQgJiBJV19BVVRIX0tFWV9NR01UXzgwMl8xWCAgKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IER5bmFtaWMgV0VQIG5vdCBzdXBwb3J0ZWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICAgICAgIHJldHVybiAtRU9QTk9UU1VQUDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB1OCBrZXlfbGVuID0gcmVxLT5rZXlfbGVuOworICAgICAgICAgICAgICAgIHU4IGtleV9pZHggPSByZXEtPmtleV9pZHg7CisKKyAgICAgICAgICAgICAgICBpZiAoKGVDU1JfU0VDVVJJVFlfV0VQX0tFWVNJWkVfTUFYX0JZVEVTID49IGtleV9sZW4pCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoQ1NSX01BWF9OVU1fS0VZID4ga2V5X2lkeCkKKyAgICAgICAgICAgICAgICAgICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICIlczogc2V0dGluZyBkZWZhdWx0IHdlcCBrZXksIGtleV9pZHggPSAlaHUga2V5X2xlbiAlaHUiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBrZXlfaWR4LCBrZXlfbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KAorICAgICAgICAgICAgICAgICAgICAgICAmcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUuS2V5cy5LZXlNYXRlcmlhbFtrZXlfaWR4XVswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXEtPmtleSwga2V5X2xlbik7CisgICAgICAgICAgICAgICAgICAgIHBXZXh0U3RhdGUtPnJvYW1Qcm9maWxlLktleXMuS2V5TGVuZ3RoW2tleV9pZHhdID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1OClrZXlfbGVuOworICAgICAgICAgICAgICAgICAgICBwV2V4dFN0YXRlLT5yb2FtUHJvZmlsZS5LZXlzLmRlZmF1bHRJbmRleCA9ICh1OClrZXlfaWR4OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qCisgKiBGVU5DVElPTjogd2xhbl9oZGRfdHJ5X2Rpc2Nvbm5lY3QKKyAqIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCB0byBkaXNjb25uZWN0IGZyb20gcHJldmlvdXMKKyAqIGNvbm5lY3Rpb24KKyAqLworc3RhdGljIGludCB3bGFuX2hkZF90cnlfZGlzY29ubmVjdCggaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgKQoreworICAgIGxvbmcgcmV0ID0gMDsKKyAgICBoZGRfc3RhdGlvbl9jdHhfdCAqcEhkZFN0YUN0eDsKKyAgICBlTWliX2RvdDExRGVzaXJlZEJzc1R5cGUgY29ubmVjdGVkQnNzVHlwZTsKKworICAgIHBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKworICAgIGhkZF9jb25uR2V0Q29ubmVjdGVkQnNzVHlwZShwSGRkU3RhQ3R4LCZjb25uZWN0ZWRCc3NUeXBlICk7CisKKyAgICBpZigoZU1pYl9kb3QxMURlc2lyZWRCc3NUeXBlX2luZGVwZW5kZW50ID09IGNvbm5lY3RlZEJzc1R5cGUpIHx8CisgICAgICAoZUNvbm5lY3Rpb25TdGF0ZV9Bc3NvY2lhdGVkID09IHBIZGRTdGFDdHgtPmNvbm5faW5mby5jb25uU3RhdGUpIHx8CisgICAgICAoZUNvbm5lY3Rpb25TdGF0ZV9JYnNzQ29ubmVjdGVkID09IHBIZGRTdGFDdHgtPmNvbm5faW5mby5jb25uU3RhdGUpKQorICAgIHsKKyAgICAgICAgLyogSXNzdWUgZGlzY29ubmVjdCB0byBDU1IgKi8KKyAgICAgICAgSU5JVF9DT01QTEVUSU9OKHBBZGFwdGVyLT5kaXNjb25uZWN0X2NvbXBfdmFyKTsKKyAgICAgICAgaWYoIGVIQUxfU1RBVFVTX1NVQ0NFU1MgPT0KKyAgICAgICAgICAgICAgc21lX1JvYW1EaXNjb25uZWN0KCBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ESVNDT05ORUNUX1JFQVNPTl9VTlNQRUNJRklFRCApICkKKyAgICAgICAgeworICAgICAgICAgICAgcmV0ID0gd2FpdF9mb3JfY29tcGxldGlvbl9pbnRlcnJ1cHRpYmxlX3RpbWVvdXQoCisgICAgICAgICAgICAgICAgICAgICAgICAgJnBBZGFwdGVyLT5kaXNjb25uZWN0X2NvbXBfdmFyLAorICAgICAgICAgICAgICAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoV0xBTl9XQUlUX1RJTUVfRElTQ09OTkVDVCkpOworICAgICAgICAgICAgaWYgKDAgPj0gIHJldCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgRkwoIkZhaWxlZCB0byByZWNlaXZlIGRpc2Nvbm5lY3QgZXZlbnQiKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIC1FQUxSRUFEWTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmKGVDb25uZWN0aW9uU3RhdGVfRGlzY29ubmVjdGluZyA9PSBwSGRkU3RhQ3R4LT5jb25uX2luZm8uY29ublN0YXRlKQorICAgIHsKKyAgICAgICAgcmV0ID0gd2FpdF9mb3JfY29tcGxldGlvbl9pbnRlcnJ1cHRpYmxlX3RpbWVvdXQoCisgICAgICAgICAgICAgICAgICAgICAmcEFkYXB0ZXItPmRpc2Nvbm5lY3RfY29tcF92YXIsCisgICAgICAgICAgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKFdMQU5fV0FJVF9USU1FX0RJU0NPTk5FQ1QpKTsKKyAgICAgICAgaWYgKDAgPj0gcmV0KQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coTE9HRSwgRkwoIkZhaWxlZCB0byByZWNlaXZlIGRpc2Nvbm5lY3QgZXZlbnQiKSk7CisgICAgICAgICAgICByZXR1cm4gLUVBTFJFQURZOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIDA7Cit9CisKKy8qCisgKiBGVU5DVElPTjogX193bGFuX2hkZF9jZmc4MDIxMV9jb25uZWN0CisgKiBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgdG8gc3RhcnQgdGhlIGFzc29jaWF0aW9uIHByb2Nlc3MKKyAqLworc3RhdGljIGludCBfX3dsYW5faGRkX2NmZzgwMjExX2Nvbm5lY3QoIHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpuZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgY2ZnODAyMTFfY29ubmVjdF9wYXJhbXMgKnJlcQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApCit7CisgICAgaW50IHN0YXR1czsKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciA9IFdMQU5fSEREX0dFVF9QUklWX1BUUiggbmRldiApOworICAgIFZPU19TVEFUVVMgZXhpdGJtcHNTdGF0dXMgPSBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IE5VTEw7CisKKyAgICBFTlRFUigpOworCisgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX0hERCwKKyAgICAgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfSEREX0NGRzgwMjExX0NPTk5FQ1QsCisgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwgcEFkYXB0ZXItPmRldmljZV9tb2RlKSk7CisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAiJXM6IGRldmljZV9tb2RlID0gJXMgKCVkKSIsIF9fZnVuY19fLAorICAgICAgICAgICBoZGRfZGV2aWNlX21vZGV0b1N0cmluZyhwQWRhcHRlci0+ZGV2aWNlX21vZGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+ZGV2aWNlX21vZGUpOworCisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIGlmICghcEhkZEN0eCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBIREQgY29udGV4dCBpcyBudWxsIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZB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tcHNTdGF0dXMgPSBoZGRfZGlzYWJsZV9ibXBzX2ltcHMocEhkZEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9IRERfSU5GUkFfU1RBVElPTik7CisgICAgfQorCisgICAgLypUcnkgZGlzY29ubmVjdGluZyBpZiBhbHJlYWR5IGluIGNvbm5lY3RlZCBzdGF0ZSovCisgICAgc3RhdHVzID0gd2xhbl9oZGRfdHJ5X2Rpc2Nvbm5lY3QocEFkYXB0ZXIpOworICAgIGlmICggMCA+IHN0YXR1cykKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJGYWlsZWQgdG8gZGlzY29ubmVjdCB0aGUgZXhpc3RpbmciCisgICAgICAgICAgICAgICAgIiBjb25uZWN0aW9uIikpOworICAgICAgICByZXR1cm4gLUVBTFJFQURZOworICAgIH0KKworICAgIC8qaW5pdGlhbGlzZSBzZWN1cml0eSBwYXJhbWV0ZXJzKi8KKyAgICBzdGF0dXMgPSB3bGFuX2hkZF9jZmc4MDIxMV9zZXRfcHJpdmFjeShwQWRhcHRlciwgcmVxKTsKKworICAgIGlmICggMCA+IHN0YXR1cykKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogZmFpbGVkIHRvIHNldCBzZWN1cml0eSBwYXJhbXMiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICB9CisKKyAgICBpZiAocEhkZEN0eC0+c3Bvb2ZNYWNBZGRyLmlzRW5hYmxlZCkKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICIlczogTUFDIFNwb29maW5nIGVuYWJsZWQgIiwgX19mdW5jX18pOworICAgICAgICAvKiBVcGRhdGluZyBTZWxmU3RhIE1hYyBBZGRyIGluIFRMIHdoaWNoIHdpbGwgYmUgdXNlZCB0byBnZXQgc3RhaWR4CisgICAgICAgICAqIHRvIGZpbGwgVHhCZHMgZm9yIHByb2JlIHJlcXVlc3QgZHVyaW5nIFNTSUQgc2NhbiB3aGljaCBtYXkgaGFwcGVuCisgICAgICAgICAqIGFzIHBhcnQgb2YgY29ubmVjdCBjb21tYW5kCisgICAgICAgICAqLworICAgICAgICBzdGF0dXMgPSBXTEFOVExfdXBkYXRlU3Bvb2ZNYWNBZGRyKHBIZGRDdHgtPnB2b3NDb250ZXh0LAorICAgICAgICAgICAgJnBIZGRDdHgtPnNwb29mTWFjQWRkci5yYW5kb21NYWNBZGRyLCAmcEFkYXB0ZXItPm1hY0FkZHJlc3NDdXJyZW50KTsKKyAgICAgICAgaWYgKHN0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICByZXR1cm4gLUVDT05OUkVGVVNFRDsKKyAgICB9CisKKyAgICBpZiAoIHJlcS0+Y2hhbm5lbCApCisgICAgeworICAgICAgICBzdGF0dXMgPSB3bGFuX2hkZF9jZmc4MDIxMV9jb25uZWN0X3N0YXJ0KHBBZGFwdGVyLCByZXEtPnNzaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcS0+c3NpZF9sZW4sIHJlcS0+YnNzaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcS0+YnNzaWRfaGludCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxLT5jaGFubmVsLT5od192YWx1ZSk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHN0YXR1cyA9IHdsYW5faGRkX2NmZzgwMjExX2Nvbm5lY3Rfc3RhcnQocEFkYXB0ZXIsIHJlcS0+c3NpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxLT5zc2lkX2xlbiwgcmVxLT5ic3NpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcS0+YnNzaWRfaGludCwgMCk7CisgICAgfQorCisgICAgaWYgKDAgIT0gc3RhdHVzKQorICAgIHsKKyAgICAgICAgLy9SZUVuYWJsZSBCTVBTIGlmIGRpc2FibGVkCisgICAgICAgIGlmKChWT1NfU1RBVFVTX1NVQ0NFU1MgPT0gZXhpdGJtcHNTdGF0dXMpICYmCisgICAgICAgICAgICAoTlVMTCAhPSBwSGRkQ3R4KSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKHBIZGRDdHgtPmhkZF93bGFuX3N1c3BlbmRlZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRfc2V0X3B3cnBhcmFtcyhwSGRkQ3R4KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgLy9SZUVuYWJsZSBCbXBzIGFuZCBJbXBzIGJhY2sKKyAgICAgICAgICAgaGRkX2VuYWJsZV9ibXBzX2ltcHMocEhkZEN0eCk7CisgICAgICAgIH0KKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoImNvbm5lY3QgZmFpbGVkIikpOworICAgICAgICByZXR1cm4gc3RhdHVzOworICAgIH0KKyAgICBwSGRkQ3R4LT5pc0FtcEFsbG93ZWQgPSBWT1NfRkFMU0U7CisgICAgRVhJVCgpOworICAgIHJldHVybiBzdGF0dXM7Cit9CisKK3N0YXRpYyBpbnQgd2xhbl9oZGRfY2ZnODAyMTFfY29ubmVjdCggc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKm5kZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBjZmc4MDI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ZMKCJTZXQgSEREIGNvbm5TdGF0ZSB0byBlQ29ubmVjdGlvblN0YXRlX05vdENvbm5lY3RlZCIpKTsKKyAgICBwSGRkU3RhQ3R4LT5jb25uX2luZm8uY29ublN0YXRlID0gZUNvbm5lY3Rpb25TdGF0ZV9Ob3RDb25uZWN0ZWQ7CisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIHJlc3VsdDsKK30KKworCisvKgorICogRlVOQ1RJT046IF9fd2xhbl9oZGRfY2ZnODAyMTFfZGlzY29ubmVjdAorICogVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHRvIGlzc3VlIGEgZGlzY29ubmVjdCByZXF1ZXN0IHRvIFNNRQorICovCitzdGF0aWMgaW50IF9fd2xhbl9oZGRfY2ZnODAyMTFfZGlzY29ubmVjdCggc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTE2IHJlYXNvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApCit7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoIGRldiApOworICAgIGludCBzdGF0dXM7CisgICAgdENzclJvYW1Qcm9maWxlICAqcFJvYW1Qcm9maWxlOworICAgIGhkZF9zdGF0aW9uX2N0eF90ICpwSGRkU3RhQ3R4OworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICB0QU5JX1U4IHN0YUlkeDsKKyNlbmRpZgorCisgICAgRU5URVIoKTsKKworICAgIGlmICghcEFkYXB0ZXIpIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoIkhERCBhZHBhdGVyIGlzIE5VTEwiKSk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIHBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKyAgICBpZiAoIXBIZGRTdGFDdHgpIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoIkhERCBTVEEgY29udGV4dCBpcyBOVUxMIikpOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgc3RhdHVzID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSBzdGF0dXMpCisgICAgeworICAgICAgICByZXR1cm4gc3RhdHVzOworICAgIH0KKworICAgIHBSb2FtUHJvZmlsZSA9ICYoV0xBTl9IRERfR0VUX1dFWFRfU1RBVEVfUFRSKHBBZGFwdGVyKSktPnJvYW1Qcm9maWxlOworCisgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX0hERCwKKyAgICAgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfSEREX0NGRzgwMjExX0RJU0NPTk5FQ1QsCisgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCByZWFzb24pKTsKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczogZGV2aWNlX21vZGUgPSAlcyglZCkiLAorICAgICAgICAgICBfX2Z1bmNfXywgaGRkX2RldmljZV9tb2RldG9TdHJpbmcocEFkYXB0ZXItPmRldmljZV9tb2RlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSk7CisKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczogRGlzY29ubmVjdCBjYWxsZWQgd2l0aCByZWFzb24gY29kZSAlZCIsCisgICAgICAgICAgICBfX2Z1bmNfXywgcmVhc29uKTsKKworICAgIGlmIChOVUxMICE9IHBSb2FtUHJvZmlsZSkKKyAgICB7CisgICAgICAgIC8qaXNzdWUgZGlzY29ubmVjdCByZXF1ZXN0IHRvIFNNRSwgaWYgc3RhdGlvbiBpcyBpbiBjb25uZWN0ZWQgc3RhdGUqLworICAgICAgICBpZiAoKHBIZGRTdGFDdHgtPmNvbm5faW5mby5jb25uU3RhdGUgPT0gZUNvbm5lY3Rpb25TdGF0ZV9Bc3NvY2lhdGVkKSB8fAorICAgICAgICAgICAgKHBIZGRTdGFDdHgtPmNvbm5faW5mby5jb25uU3RhdGUgPT0gZUNvbm5lY3Rpb25TdGF0ZV9Db25uZWN0aW5nKSkKKyAgICAgICAgeworICAgICAgICAgICAgZUNzclJvYW1EaXNjb25uZWN0UmVhc29uIHJlYXNvbkNvZGUgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ESVNDT05ORUNUX1JFQVNPTl9VTlNQRUNJRklFRDsKKyAgICAgICAgICAgIGhkZF9zY2FuaW5mb190ICpwU2NhbkluZm87CisgICAgICAgICAgICBzd2l0Y2gocmVhc29uKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNhc2UgV0xBTl9SRUFTT05fTUlDX0ZBSUxVUkU6CisgICAgICAgICAgICAgICAgICAgIHJlYXNvbkNvZGUgPSBlQ1NSX0RJU0NPTk5FQ1RfUkVBU09OX01JQ19FUlJPUjsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIFdMQU5fUkVBU09OX0RJU0FTU09DX0RVRV9UT19JTkFDVElWSVRZOgorICAgICAgICAgICAgICAgIGNhc2UgV0xBTl9SRUFTT05fRElTQVNTT0NfQVBfQlVTWToKKyAgICAgICAgICAgICAgICBjYXNlIFdMQU5fUkVBU09OX0NMQVNTM19GUkFNRV9GUk9NX05PTkFTU09DX1NUQToKKyAgICAgICAgICAgICAgICAgICAgcmVhc29uQ29kZSA9IGVDU1JfRElTQ09OTkVDVF9SRUFTT05fRElTQVNTT0M7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBXTEFOX1JFQVNPTl9QUkVWX0FVVEhfTk9UX1ZBTElEOgorICAgICAgICAgICAgICAgIGNhc2UgV0xBTl9SRUFTT05fQ0xBU1MyX0ZSQU1FX0ZST01fTk9OQVVUSF9TVEE6CisgICAgICAgICAgICAgICAgY2FzZSBXTEFOX1JFQVNPTl9ERUFVVEhfTEVBVklORzoKKyAgICAgICAgICAgICAgICAgICAgcmVhc29uQ29kZSA9IGVDU1JfRElTQ09OTkVDVF9SRUFTT05fREVBVVRIOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgIHJlYXNvbkNvZGUgPSBlQ1NSX0RJU0NPTk5FQ1RfUkVBU09OX1VOU1BFQ0lGSUVEOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBTY2FuSW5mbyA9ICAmcEhkZEN0eC0+c2Nhbl9pbmZvOworICAgICAgICAgICAgaWYgKHBTY2FuSW5mby0+bVNjYW5QZW5kaW5nKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIkRpc2Nvbm5lY3QgaXMgaW4gcHJvZ3Jlc3MsICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJBYm9ydGluZyBTY2FuIik7CisgICAgICAgICAgICAgICAgaGRkX2Fib3J0X21hY19zY2FuKHBIZGRDdHgsIHBTY2FuSW5mby0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1NDQU5fQUJPUlRfREVGQVVMVCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB3bGFuX2hkZF9jYW5jZWxfZXhpc3RpbmdfcmVtYWluX29uX2NoYW5uZWwocEFkYXB0ZXIpOworI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgICAgICAgICAgICAvKiBGaXJzdCBjbGVhbiB1cCB0aGUgdGRscyBwZWVycyBpZiBhbnkgKi8KKyAgICAgICAgICAgIGZvciAoc3RhSWR4ID0gMCA7IHN0YUlkeCA8IEhERF9NQVhfTlVNX1RETFNfU1RBOyBzdGFJZHgrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoKHBIZGRDdHgtPnRkbHNDb25uSW5mb1tzdGFJZHhdLnNlc3Npb25JZCA9PSBwQWRhcHRlci0+c2Vzc2lvbklkKSAmJgorICAgICAgICAgICAgICAgICAgICAocEhkZEN0eC0+dGRsc0Nvbm5JbmZvW3N0YUlkeF0uc3RhSWQpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdWludDggKm1hYzsKKyAgICAgICAgICAgICAgICAgICAgbWFjID0gcEhkZEN0eC0+dGRsc0Nvbm5JbmZvW3N0YUlkeF0ucGVlck1hYy5ieXRlczsKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IGNhbGwgc21lX0RlbGV0ZVRkbHNQZWVyU3RhIHN0YUlkICVkIHNlc3Npb25JZCAlZCAiIE1BQ19BRERSRVNTX1NUUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcEhkZEN0eC0+dGRsc0Nvbm5JbmZvW3N0YUlkeF0uc3RhSWQsIHBBZGFwdGVyLT5zZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkobWFjKSk7CisgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IHNtZV9EZWxldGVUZGxzUGVlclN0YSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWMpOworICAgICAgICAgICAgICAgICAgICBpZiAoc3RhdHVzICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJGYWlsZWQgdG8gZGVsZXRlIFRETFMgcGVlciBTVEEiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVQRVJNOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorI2VuZGlmCisgICAgICAgICAgIGhkZExvZyhMT0cxLCBGTCgiRGlzY29ubmVjdGluZyB3aXRoIHJlYXNvbmNvZGU6JXUiKSwgcmVhc29uQ29kZSk7CisgICAgICAgICAgICBzdGF0dXMgPSB3bGFuX2hkZF9kaXNjb25uZWN0KHBBZGFwdGVyLCByZWFzb25Db2RlKTsKKyAgICAgICAgICAgIGlmICggMCAhPSBzdGF0dXMgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAiJXMgd2xhbl9oZGRfZGlzY29ubmVjdCBmYWlsdXJlLCByZXR1cm5lZCAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgKGludClzdGF0dXMgKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogdW5leHBlY3RlZCBjZmcgZGlzY29ubmVjdCBBUEkiCisgICAgICAgICAgICAgICAgICAgImNhbGxlZCB3aGlsZSBpbiAlZCBzdGF0ZSIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICBwSGRkU3RhQ3R4LT5jb25uX2luZm8uY29ublN0YXRlKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IE5vIHZhbGlkIHJvYW0gcHJvZmlsZSIsIF9fZnVuY19fKTsKKyAgICB9CisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIHN0YXR1czsKK30KKworc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV9kaXNjb25uZWN0KCBzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MTYgcmVhc29uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKK3sKKyAgICBpbnQgcmV0OworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX193bGFuX2hkZF9jZmc4MDIxMV9kaXNjb25uZWN0KHdpcGh5LCBkZXYsIHJlYXNvbik7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworLyoKKyAqIEZVTkNUSU9OOiB3bGFuX2hkZF9jZmc4MDIxMV9zZXRfcHJpdmFjeV9pYnNzCisgKiBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgdG8gaW5pdGlhbGl6ZSB0aGUgc2VjdXJpdHkKKyAqIHNldHRpbmdzIGluIElCU1MgbW9kZS4KKyAqLworc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV9zZXRfcHJpdmFjeV9pYnNzKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGNmZzgwMjExX2lic3NfcGFyYW1zICpwYXJhbXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKQoreworICAgIGludCBzdGF0dXMgPSAwOworICAgIGhkZF93ZXh0X3N0YXRlX3QgKnBXZXh0U3RhdGUgPSBXTEFOX0hERF9HRVRfV0VYVF9TVEFURV9QVFIocEFkYXB0ZXIpOworICAgIGVDc3JFbmNyeXB0aW9uVHlwZSBlbmNyeXB0aW9uVHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX05PTkU7CisgICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKworICAgIEVOVEVSKCk7CisKKyAgICBwV2V4dFN0YXRlLT53cGFWZXJzaW9uID0gSVdfQVVUSF9XUEFfVkVSU0lPTl9ESVNBQkxFRDsKKyAgICB2b3NfbWVtX3plcm8oJnBIZGRTdGFDdHgtPmlic3NfZW5jX2tleSwgc2l6ZW9mKHRDc3JSb2FtU2V0S2V5KSk7CisKKyAgICBpZiAocGFyYW1zLT5pZV9sZW4gJiYgKCBOVUxMICE9IHBhcmFtcy0+aWUpICkKKyAgICB7CisgICAgICAgIGlmICh3bGFuX2hkZF9jZmc4MDIxMV9nZXRfaWVfcHRyIChwYXJhbXMtPmllLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy0+aWVfbGVuLCBXTEFOX0VJRF9SU04gKSkKKyAgICAgICAgeworICAgICAgICAgICAgcFdleHRTdGF0ZS0+d3BhVmVyc2lvbiA9IElXX0FVVEhfV1BBX1ZFUlNJT05fV1BBMjsKKyAgICAgICAgICAgIGVuY3J5cHRpb25UeXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfQUVTOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKCBoZGRfaXNXUEFJRVByZXNlbnQgKHBhcmFtcy0+aWUsIHBhcmFtcy0+aWVfbGVuICkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHREb3QxMWZJRVdQQSBkb3QxMVdQQUlFOworICAgICAgICAgICAgdEhhbEhhbmRsZSBoYWxIYW5kbGUgPSBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlcik7CisgICAgICAgICAgICB1OCAqaWU7CisKKyAgICAgICAgICAgIG1lbXNldCgmZG90MTFXUEFJRSwgMCwgc2l6ZW9mKGRvdDExV1BBSUUpKTsKKyAgICAgICAgICAgIGllID0gd2xhbl9oZGRfY2ZnODAyMTFfZ2V0X2llX3B0ciAocGFyYW1zLT5pZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMtPmllX2xlbiwgRE9UMTFGX0VJRF9XUEEpOworICAgICAgICAgICAgaWYgKCBOVUxMICE9IGllICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwV2V4dFN0YXRlLT53cGFWZXJzaW9uID0gSVdfQVVUSF9XUEFfVkVSU0lPTl9XUEE7CisgICAgICAgICAgICAgICAgLy8gVW5wYWNrIHRoZSBXUEEgSUUKKyAgICAgICAgICAgICAgICAvL1NraXAgcGFzdCB0aGUgRUlEIGJ5dGUgYW5kIGxlbmd0aCBieXRlIC0gYW5kIGZvdXIgYnl0ZSBXaUZpIE9VSQorICAgICAgICAgICAgICAgIGRvdDExZlVucGFja0llV1BBKCh0cEFuaVNpckdsb2JhbCkgaGFsSGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmaWVbMis0XSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWVbMV0gLSA0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZG90MTFXUEFJRSk7CisgICAgICAgICAgICAgICAgLypFeHRyYWN0IHRoZSBtdWx0aWNhc3QgY2lwaGVyLCB0aGUgZW5jVHlwZSBmb3IgdW5pY2FzdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpcGhlciBmb3Igd3BhLW5vbmUgaXMgbm9uZSovCisgICAgICAgICAgICAgICAgZW5jcnlwdGlvblR5cGUgPQorICAgICAgICAgICAgICAgICAgaGRkX1RyYW5zbGF0ZVdQQVRvQ3NyRW5jcnlwdGlvblR5cGUoZG90MTFXUEFJRS5tdWx0aWNhc3RfY2lwaGVyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHN0YXR1cyA9IHdsYW5faGRkX2NmZzgwMjExX3NldF9pZShwQWRhcHRlciwgcGFyYW1zLT5pZSwgcGFyYW1zLT5pZV9sZW4pOworCisgICAgICAgIGlmICgwID4gc3RhdHVzKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IGZhaWxlZCB0byBwYXJzZSBXUEEvUlNOIElFIiwKKyAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgfQorICAgIH0KKworICAgIHBXZXh0U3RhdGUtPnJvYW1Qcm9maWxlLkF1dGhUeXBlLmF1dGhUeXBlWzBdID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmF1dGhUeXBlID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9BVVRIX1RZUEVfT1BFT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VuY3J5cHRpb25UeXBlLmVuY3J5cHRpb25UeXBlWzBdID0gZW5jcnlwdGlvblR5cGU7CisgICAgcmV0dXJuIHN0YXR1czsKK30KKworLyoKKyAqIEZVTkNUSU9OOiBfX3dsYW5faGRkX2NmZzgwMjExX2pvaW5faWJzcworICogVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHRvIGNyZWF0ZS9qb2luIGFuIElCU1MKKyAqLworc3RhdGljIGludCBfX3dsYW5faGRkX2NmZzgwMjExX2pvaW5faWJzcyggc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBjZmc4MDIxMV9pYnNzX3BhcmFtcyAqcGFyYW1zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApCit7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoIGRldiApOworICAgIGhkZF93ZXh0X3N0YXRlX3QgKnBXZXh0U3RhdGUgPSBXTEFOX0hERF9HRVRfV0VYVF9TVEFURV9QVFIocEFkYXB0ZXIpOworICAgIHRDc3JSb2FtUHJvZmlsZSAgICAgICAgICAqcFJvYW1Qcm9maWxlOworICAgIGludCBzdGF0dXM7CisgICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgdFNpck1hY0FkZHIgYnNzaWQ7CisKKyAgICBFTlRFUigpOworCisgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX0hERCwKKyAgICAgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfSEREX0NGRzgwMjExX0pPSU5fSUJTUywKKyAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkpOworICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgIiVzOiBkZXZpY2VfbW9kZSA9ICVzICglZCkiLCBfX2Z1bmNfXywKKyAgICAgICAgICAgaGRkX2RldmljZV9tb2RldG9TdHJpbmcocEFkYXB0ZXItPmRldmljZV9tb2RlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPmRldmljZV9tb2RlKTsKKworICAgIHN0YXR1cyA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gc3RhdHVzKQorICAgIHsKKyAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICB9CisKKyAgICBpZiAoTlVMTCA9PSBwV2V4dFN0YXRlKQorICAgIHsKKyAgICAgICAgaGRkTG9nIChWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlcyBFUlJPUjogRGF0YSBTdG9yYWdlIENvcnJ1cHRpb24iLAorICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU87CisgICAgfQorCisgICAgaWYgKHZvc19tYXhfY29uY3VycmVudF9jb25uZWN0aW9uc19yZWFjaGVkKCkpIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCBGTCgiUmVhY2hlZCBtYXggY29uY3VycmVudCBjb25uZWN0aW9ucyIpKTsKKyAgICAgICAgcmV0dXJuIC1FQ09OTlJFRlVTRUQ7CisgICAgfQorCisgICAgLypUcnkgZGlzY29ubmVjdGluZyBpZiBhbHJlYWR5IGluIGNvbm5lY3RlZCBzdGF0ZSovCisgICAgc3RhdHVzID0gd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JTU19BVVRPX0JTU0lEIiwgX19mdW5jX18pOworICAgICAgICAgICByZXR1cm4gLUVJTzsKKyAgICAgICB9CisgICAgICAgdm9zX21lbV9jb3B5KCh2X1U4X3QgKilic3NpZCwgKHZfVThfdCAqKXBhcmFtcy0+YnNzaWQsIHNpemVvZihic3NpZCkpOworICAgIH0KKyAgICBlbHNlIGlmKHBIZGRDdHgtPmNmZ19pbmktPmlzQ29hbGVzaW5nSW5JQlNTQWxsb3dlZCA9PSAwKQorICAgIHsKKyAgICAgICAgaWYgKGNjbUNmZ1NldEludChwSGRkQ3R4LT5oSGFsLCBXTklfQ0ZHX0lCU1NfQVVUT19CU1NJRCwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLCBlQU5JX0JPT0xFQU5fRkFMU0UpPT1lSEFMX1NUQVRVU19GQUlMVVJFKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2cgKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIiVzOmNjbUNmZ1N0SW50IGZhaWxkIGZvciBXTklfQ0ZHX0lCU1NfQVVUT19CU1NJRCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHJldHVybiAtRUlPOworICAgICAgICB9CisKKyAgICAgICAgdm9zX21lbV9jb3B5KCh2X1U4X3QgKilic3NpZCwKKyAgICAgICAgICAgICAgICAgICAgICh2X1U4X3QgKikmcEhkZEN0eC0+Y2ZnX2luaS0+SWJzc0Jzc2lkLmJ5dGVzWzBdLAorICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihic3NpZCkpOworICAgIH0KKworICAgIC8qIFNldCBDaGFubmVsICovCisgICAgaWYgKE5VTEwgIT0KKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsOCwwKSkKKyAgICAgICAgICAgICAgICBwYXJhbXMtPmNoYW5kZWYuY2hhbikKKyNlbHNlCisgICAgICAgICAgICAgICAgcGFyYW1zLT5jaGFubmVsKQorI2VuZGlmCisgICAgeworICAgICAgICB1OCBjaGFubmVsTnVtOworICAgICAgICB2X1UzMl90IG51bUNoYW5zID0gV05JX0NGR19WQUxJRF9DSEFOTkVMX0xJU1RfTEVOOworICAgICAgICB2X1U4X3QgdmFsaWRDaGFuW1dOSV9DRkdfVkFMSURfQ0hBTk5FTF9MSVNUX0xFTl07CisgICAgICAgIHRIYWxIYW5kbGUgaEhhbCA9IFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKTsKKyAgICAgICAgaW50IGluZHg7CisKKyAgICAgICAgLyogR2V0IGNoYW5uZWwgbnVtYmVyICovCisgICAgICAgIGNoYW5uZWxOdW0gPQorICAgICAgICAgICAgICAgaWVlZTgwMjExX2ZyZXF1ZW5jeV90b19jaGFubmVsKAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMyw4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMtPmNoYW5kZWYuY2hhbi0+Y2VudGVyX2ZyZXEpOworI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLT5jaGFubmVsLT5jZW50ZXJfZnJlcSk7CisjZW5kaWYKKworICAgICAgICBpZiAoMCAhPSBjY21DZmdHZXRTdHIoaEhhbCwgV05JX0NGR19WQUxJRF9DSEFOTkVMX0xJU1QsCisgICAgICAgICAgICAgICAgICAgIHZhbGlkQ2hhbiwgJm51bUNoYW5zKSkKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiBObyB2YWxpZCBjaGFubmVsIGxpc3QiLAorICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgICByZXR1cm4gLUVPUE5PVFNVUFA7CisgICAgICAgIH0KKworICAgICAgICBmb3IgKGluZHggPSAwOyBpbmR4IDwgbnVtQ2hhbnM7IGluZHgrKykKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKGNoYW5uZWxOdW0gPT0gdmFsaWRDaGFuW2luZHhdKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChpbmR4ID49IG51bUNoYW5zKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IE5vdCB2YWxpZCBDaGFubmVsICVkIiwKKyAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIGNoYW5uZWxOdW0pOworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgIH0KKyAgICAgICAgLyogU2V0IHRoZSBPcGVyYXRpb25hbCBDaGFubmVsICovCisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiJXM6IHNldCBjaGFubmVsICVkIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgY2hhbm5lbE51bSk7CisgICAgICAgIHBSb2FtUHJvZmlsZS0+Q2hhbm5lbEluZm8ubnVtT2ZDaGFubmVscyA9IDE7CisgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5vcGVyYXRpb25DaGFubmVsID0gY2hhbm5lbE51bTsKKyAgICAgICAgcFJvYW1Qcm9maWxlLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdCA9CisgICAgICAgICAgICAmcEhkZFN0YUN0eC0+Y29ubl9pbmZvLm9wZXJhdGlvbkNoYW5uZWw7CisgICAgfQorCisgICAgLyogSW5pdGlhbGl6ZSBzZWN1cml0eSBwYXJhbWV0ZXJzICovCisgICAgc3RhdHVzID0gd2xhbl9oZGRfY2ZnODAyMTFfc2V0X3ByaXZhY3lfaWJzcyhwQWRhcHRlciwgcGFyYW1zKTsKKyAgICBpZiAoc3RhdHVzIDwgMCkKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogZmFpbGVkIHRvIHNldCBzZWN1cml0eSBwYXJhbWV0ZXJzIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgfQorCisgICAgLyogSXNzdWUgY29ubmVjdCBzdGFydCAqLworICAgIHN0YXR1cyA9IHdsYW5faGRkX2NmZzgwMjExX2Nvbm5lY3Rfc3RhcnQocEFkYXB0ZXIsIHBhcmFtcy0+c3NpZCwKKyAgICAgICAgICAgIHBhcmFtcy0+c3NpZF9sZW4sIChjb25zdCB1OCAqKSZic3NpZCwgTlVMTCwKKyAgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5vcGVyYXRpb25DaGFubmVsKTsKKworICAgIGlmICgwID4gc3RhdHVzKQorICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IGNvbm5lY3QgZmFpbGVkIiwgX19mdW5jX18pOworCisgICAgRVhJVCgpOworICAgIHJldHVybiBzdGF0dXM7Cit9CisKK3N0YXRpYyBpbnQgd2xhbl9oZGRfY2ZnODAyMTFfam9pbl9pYnNzKCBzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGNmZzgwMjExX2lic3NfcGFyYW1zICpwYXJhbXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKK3sKKyAgICBpbnQgcmV0ID0gMDsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX193bGFuX2hkZF9jZmc4MDIxMV9qb2luX2lic3Mod2lwaHksIGRldiwgcGFyYW1zKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCisvKgorICogRlVOQ1RJT046IF9fd2xhbl9oZGRfY2ZnODAyMTFfbGVhdmVfaWJzcworICogVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHRvIGxlYXZlIGFuIElCU1MKKyAqLworc3RhdGljIGludCBfX3dsYW5faGRkX2NmZzgwMjExX2xlYXZlX2lic3MoIHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKQoreworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKCBkZXYgKTsKKyAgICBoZGRfd2V4dF9zdGF0ZV90ICpwV2V4dFN0YXRlID0gV0xBTl9IRERfR0VUX1dFWFRfU1RBVEVfUFRSKHBBZGFwdGVyKTsKKyAgICB0Q3NyUm9hbVByb2ZpbGUgKnBSb2FtUHJvZmlsZTsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgaW50IHN0YXR1czsKKworICAgIEVOVEVSKCk7CisKKyAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfSERELAorICAgICAgICAgICAgICAgICAgICAgVFJBQ0VfQ09ERV9IRERfQ0ZHODAyMTFfTEVBVkVfSUJTUywKKyAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCBlQ1NSX0RJU0NPTk5FQ1RfUkVBU09OX0lCU1NfTEVBVkUpKTsKKyAgICBzdGF0dXMgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHN0YXR1cykKKyAgICB7CisgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgfQorCisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXM6IGRldmljZV9tb2RlID0gJXMgKCVkKSIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICAgICBoZGRfZGV2aWNlX21vZGV0b1N0cmluZyhwQWRhcHRlci0+ZGV2aWNlX21vZGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+ZGV2aWNlX21vZGUpOworICAgIGlmIChOVUxMID09IHBXZXh0U3RhdGUpCisgICAgeworICAgICAgICBoZGRMb2cgKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzIEVSUk9SOiBEYXRhIFN0b3JhZ2UgQ29ycnVwdGlvbiIsCisgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTzsKKyAgICB9CisKKyAgICBwUm9hbVByb2ZpbGUgPSAmcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGU7CisKKyAgICAvKiBJc3N1ZSBkaXNjb25uZWN0IG9ubHkgaWYgaW50ZXJmYWNlIHR5cGUgaXMgc2V0IHRvIElCU1MgKi8KKyAgICBpZiAoZUNTUl9CU1NfVFlQRV9TVEFSVF9JQlNTICE9IHBSb2FtUHJvZmlsZS0+QlNTVHlwZSkKKyAgICB7CisgICAgICAgIGhkZExvZyAoVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IEJTUyBUeXBlIGlzIG5vdCBzZXQgdG8gSUJTUyIsCisgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICAvKiBJc3N1ZSBEaXNjb25uZWN0IHJlcXVlc3QgKi8KKyAgICBJTklUX0NPTVBMRVRJT04ocEFkYXB0ZXItPmRpc2Nvbm5lY3RfY29tcF92YXIpOworICAgIHNtZV9Sb2FtRGlzY29ubmVjdCggV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLCBwQWRhcHRlci0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfRElTQ09OTkVDVF9SRUFTT05fSUJTU19MRUFWRSk7CisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIDA7Cit9CisKK3N0YXRpYyBpbnQgd2xhbl9oZGRfY2ZnODAyMTFfbGVhdmVfaWJzcyggc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApCit7CisgICAgaW50IHJldCA9IDA7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9fd2xhbl9oZGRfY2ZnODAyMTFfbGVhdmVfaWJzcyh3aXBoeSwgZGV2KTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCisvKgorICogRlVOQ1RJT046IF9fd2xhbl9oZGRfY2ZnODAyMTFfc2V0X3dpcGh5X3BhcmFtcworICogVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHRvIHNldCB0aGUgcGh5IHBhcmFtZXRlcnMKKyAqIChSVFMgVGhyZXNob2xkL0ZSQUcgVGhyZXNob2xkL1JldHJ5IENvdW50IGV0YyAuLi4pCisgKi8KK3N0YXRpYyBpbnQgX193bGFuX2hkZF9jZmc4MDIxMV9zZXRfd2lwaHlfcGFyYW1zKHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgIHUzMiBjaGFuZ2VkKQoreworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSB3aXBoeV9wcml2KHdpcGh5KTsKKyAgICB0SGFsSGFuZGxlIGhIYWwgPSBwSGRkQ3R4LT5oSGFsOworICAgIGludCBzdGF0dXM7CisKKyAgICBFTlRFUigpOworCisgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX0hERCwKKyAgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX0hERF9DRkc4MDIxMV9TRVRfV0lQSFlfUEFSQU1TLAorICAgICAgICAgICAgICAgICAgICAgICBOT19TRVNTSU9OLCB3aXBoeS0+cnRzX3RocmVzaG9sZCkpOworCisgICAgc3RhdHVzID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSBzdGF0dXMpCisgICAgeworICAgICAgICByZXR1cm4gc3RhdHVzOworICAgIH0KKworICAgIGlmIChjaGFuZ2VkICYgV0lQSFlfUEFSQU1fUlRTX1RIUkVTSE9MRCkKKyAgICB7CisgICAgICAgIHUxNiBydHNfdGhyZXNob2xkID0gKHdpcGh5LT5ydHNfdGhyZXNob2xkID09IC0xKSA/CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19SVFNfVEhSRVNIT0xEX1NUQU1BWCA6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lwaHktPnJ0c190aHJlc2hvbGQ7CisKKyAgICAgICAgaWYgKChXTklfQ0ZHX1JUU19USFJFU0hPTERfU1RBTUlOID4gcnRzX3RocmVzaG9sZCkgfHwKKyAgICAgICAgICAgICAgICAoV05JX0NGR19SVFNfVEhSRVNIT0xEX1NUQU1BWCA8IHJ0c190aHJlc2hvbGQpKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgUlRTIFRocmVzaG9sZCB2YWx1ZSAlaHUiLAorICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcnRzX3RocmVzaG9sZCk7CisgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgfQorCisgICAgICAgIGlmICgwICE9IGNjbUNmZ1NldEludChoSGFsLCBXTklfQ0ZHX1JUU19USFJFU0hPTEQsCisgICAgICAgICAgICAgICAgICAgIHJ0c190aHJlc2hvbGQsIGNjbUNmZ1NldENhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICBlQU5JX0JPT0xFQU5fVFJVRSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICIlczogY2NtQ2ZnU2V0SW50IGZhaWxlZCBmb3IgcnRzX3RocmVzaG9sZCB2YWx1ZSAlaHUiLAorICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcnRzX3RocmVzaG9sZCk7CisgICAgICAgICAgICByZXR1cm4gLUVJTzsKKyAgICAgICAgfQorCisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GT19NRUQsICIlczogc2V0IHJ0cyB0aHJlc2hvbGQgJWh1IiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgcnRzX3RocmVzaG9sZCk7CisgICAgfQorCisgICAgaWYgKGNoYW5nZWQgJiBXSVBIWV9QQVJBTV9GUkFHX1RIUkVTSE9MRCkKKyAgICB7CisgICAgICAgIHUxNiBmcmFnX3RocmVzaG9sZCA9ICh3aXBoeS0+ZnJhZ190aHJlc2hvbGQgPT0gLTEpID8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19GUkFHTUVOVEFUSU9OX1RIUkVTSE9MRF9TVEFNQVggOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXBoeS0+ZnJhZ190aHJlc2hvbGQ7CisKKyAgICAgICAgaWYgKChXTklfQ0ZHX0ZSQUdNRU5UQVRJT05fVEhSRVNIT0xEX1NUQU1JTiA+IGZyYWdfdGhyZXNob2xkKXx8CisgICAgICAgICAgICAgICAgKFdOSV9DRkdfRlJBR01FTlRBVElPTl9USFJFU0hPTERfU1RBTUFYIDwgZnJhZ190aHJlc2hvbGQpICkKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIGZyYWdfdGhyZXNob2xkIHZhbHVlICVodSIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICBmcmFnX3RocmVzaG9sZCk7CisgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgfQorCisgICAgICAgIGlmICgwICE9IGNjbUNmZ1NldEludChoSGFsLCBXTklfQ0ZHX0ZSQUdNRU5UQVRJT05fVEhSRVNIT0xELAorICAgICAgICAgICAgICAgICAgICBmcmFnX3RocmVzaG9sZCwgY2NtQ2ZnU2V0Q2FsbGJhY2ssCisgICAgICAgICAgICAgICAgICAgIGVBTklfQk9PTEVBTl9UUlVFKSkKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIiVzOiBjY21DZmdTZXRJbnQgZmFpbGVkIGZvciBmcmFnX3RocmVzaG9sZCB2YWx1ZSAlaHUiLAorICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgZnJhZ190aHJlc2hvbGQpOworICAgICAgICAgICAgcmV0dXJuIC1FSU87CisgICAgICAgIH0KKworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk9fTUVELCAiJXM6IHNldCBmcmFnIHRocmVzaG9sZCAlaHUiLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICBmcmFnX3RocmVzaG9sZCk7CisgICAgfQorCisgICAgaWYgKChjaGFuZ2VkICYgV0lQSFlfUEFSQU1fUkVUUllfU0hPUlQpCisgICAgICAgICAgICB8fCAoY2hhbmdlZCAmIFdJUEhZX1BBUkFNX1JFVFJZX0xPTkcpKQorICAgIHsKKyAgICAgICAgdTggcmV0cnlfdmFsdWUgPSAoY2hhbmdlZCAmIFdJUEhZX1BBUkFNX1JFVFJZX1NIT1JUKSA/CisgICAgICAgICAgICAgICAgICAgICAgICAgd2lwaHktPnJldHJ5X3Nob3J0IDoKKyAgICAgICAgICAgICAgICAgICAgICAgICB3aXBoeS0+cmV0cnlfbG9uZzsKKworICAgICAgICBpZiAoKFdOSV9DRkdfTE9OR19SRVRSWV9MSU1JVF9TVEFNSU4gPiByZXRyeV92YWx1ZSkgfHwKKyAgICAgICAgICAgICAgICAoV05JX0NGR19MT05HX1JFVFJZX0xJTUlUX1NUQU1BWCA8IHJldHJ5X3ZhbHVlKSkKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiBJbnZhbGlkIFJldHJ5IGNvdW50ICVodSIsCisgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCByZXRyeV92YWx1ZSk7CisgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChjaGFuZ2VkICYgV0lQSFlfUEFSQU1fUkVUUllfU0hPUlQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmICgwICE9IGNjbUNmZ1NldEludChoSGFsLCBXTklfQ0ZHX0xPTkdfUkVUUllfTElNSVQsCisgICAgICAgICAgICAgICAgICAgICAgICByZXRyeV92YWx1ZSwgY2NtQ2ZnU2V0Q2FsbGJhY2ssCisgICAgICAgICAgICAgICAgICAgICAgICBlQU5JX0JPT0xFQU5fVFJVRSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICIlczogY2NtQ2ZnU2V0SW50IGZhaWxlZCBmb3IgbG9uZyByZXRyeSBjb3VudCAlaHUiLAorICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHJldHJ5X3ZhbHVlKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GT19NRUQsICIlczogc2V0IGxvbmcgcmV0cnkgY291bnQgJWh1IiwKKyAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHJldHJ5X3ZhbHVlKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChjaGFuZ2VkICYgV0lQSFlfUEFSQU1fUkVUUllfU0hPUlQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmICgwICE9IGNjbUNmZ1NldEludChoSGFsLCBXTklfQ0ZHX1NIT1JUX1JFVFJZX0xJTUlULAorICAgICAgICAgICAgICAgICAgICAgICAgcmV0cnlfdmFsdWUsIGNjbUNmZ1NldENhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgZUFOSV9CT09MRUFOX1RSVUUpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IGNjbUNmZ1NldEludCBmYWlsZWQgZm9yIHNob3J0IHJldHJ5IGNvdW50ICVodSIsCisgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcmV0cnlfdmFsdWUpOworICAgICAgICAgICAgICAgIHJldHVybiAtRUlPOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPX01FRCwgIiVzOiBzZXQgc2hvcnQgcmV0cnkgY291bnQgJWh1IiwKKyAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHJldHJ5X3ZhbHVlKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV9zZXRfd2lwaHlfcGFyYW1zKHN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LDB4RkYsMHhGRiwweEZGfTsKKyAgICB0U2lyTWFjQWRkciBzZWxmTWFjID0gezB4RkYsMHhGRiwweEZGLDB4RkYsMHhGRiwweEZGfTsKKyAgICBpbnQgc3RhdHVzOworCisgICAgRU5URVIoKTsKKworICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9IREQsCisgICAgICAgICAgICAgICAgICAgICAgVFJBQ0VfQ09ERV9IRERfQ0ZHODAyMTFfU0VUX1RYUE9XRVIsCisgICAgICAgICAgICAgICAgICAgICAgTk9fU0VTU0lPTiwgdHlwZSApKTsKKyAgICBzdGF0dXMgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHN0YXR1cykKKyAgICB7CisgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgfQorCisgICAgaEhhbCA9IHBIZGRDdHgtPmhIYWw7CisKKyAgICBpZiAoMCAhPSBjY21DZmdTZXRJbnQoaEhhbCwgV05JX0NGR19DVVJSRU5UX1RYX1BPV0VSX0xFVkVMLAorICAgICAgICAgICAgICAgIGRibSwgY2NtQ2ZnU2V0Q2FsbGJhY2ssCisgICAgICAgICAgICAgICAgZUFOSV9CT09MRUFOX1RSVUUpKQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IGNjbUNmZ1NldEludCBmYWlsZWQgZm9yIHR4IHBvd2VyICVodSIsIF9fZnVuY19fLCBkYm0pOworICAgICAgICByZXR1cm4gLUVJTzsKKyAgICB9CisKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk9fTUVELCAiJXM6IHNldCB0eCBwb3dlciBsZXZlbCAlZCBkYm0iLCBfX2Z1bmNfXywKKyAgICAgICAgICAgIGRibSk7CisKKyAgICBzd2l0Y2godHlwZSkKKyAgICB7CisgICAgY2FzZSBOTDgwMjExX1RYX1BPV0VSX0FVVE9NQVRJQzogLyphdXRvbWF0aWNhbGx5IGRldGVybWluZSB0cmFuc21pdCBwb3dlciovCisgICAgICAgLyogRmFsbCB0aHJvdWdoICovCisgICAgY2FzZSBOTDgwMjExX1RYX1BPV0VSX0xJTUlURUQ6IC8qbGltaXQgVFggcG93ZXIgYnkgdGhlIG1CbSBwYXJhbWV0ZXIqLworICAgICAgIGlmKCBzbWVfU2V0TWF4VHhQb3dlcihoSGFsLCBic3NpZCwgc2VsZk1hYywgZGJtKSAhPSBlSEFMX1NUQVRVU19TVUNDRVNTICkKKyAgICAgICB7CisgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiBTZXR0aW5nIG1heGltdW0gdHggcG93ZXIgZmFpbGVkIiwKKyAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgIHJldHVybiAtRUlPOworICAgICAgIH0KKyAgICAgICBicmVhazsKKyAgICBjYXNlIE5MODAyMTFfVFhfUE9XRVJfRklYRUQ6IC8qZml4IFRYIHBvd2VyIHRvIHRoZSBtQm0gcGFyYW1ldGVyKi8KKyAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IE5MODAyMTFfVFhfUE9XRVJfRklYRUQgbm90IHN1cHBvcnRlZCIsCisgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICByZXR1cm4gLUVPUE5PVFNVUFA7CisgICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IEludmFsaWQgcG93ZXIgc2V0dGluZyB0eXBlICVkIiwKKyAgICAgICAgICAgICAgX19mdW5jX18sIHR5cGUpOworICAgICAgIHJldHVybiAtRUlPOworICAgIH0KKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV9zZXRfdHhwb3dlcihzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorI2lmIExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDgsMCkKKyAgICAgICAgc3RydWN0IHdpcmVsZXNzX2RldiAqd2RldiwKKyNlbmRpZgorI2lmIExJTlVYX1ZFUlNJT05fQ09ERSA8PSBLRVJORUxfVkVSU0lPTigyLDYsMzUpCisgICAgICAgIGVudW0gdHhfcG93ZXJfc2V0dGluZyB0eXBlLAorI2Vsc2UKKyAgICAgICAgZW51bSBubDgwMjExX3R4X3Bvd2VyX3NldHRpbmcgdHlwZSwKKyNlbmRpZgorICAgICAgICBpbnQgZGJtKQoreworICAgIGludCByZXQ7CisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX3dsYW5faGRkX2NmZzgwMjExX3NldF90eHBvd2VyKHdpcGh5LAorI2lmIExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDgsMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ZGV2LAorI2VuZGlmCisjaWYgTElOVVhfVkVSU0lPTl9DT0RFIDw9IEtFUk5FTF9WRVJTSU9OKDIsNiwzNSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlLAorI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlLAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGJtKTsKKyAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgcmV0dXJuIHJldDsKK30KKworLyoKKyAqIEZVTkNUSU9OOiBfX3dsYW5faGRkX2NmZzgwMjExX2dldF90eHBvd2VyCisgKiBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgdG8gcmVhZCB0aGUgdHhwb3dlcgorICovCitzdGF0aWMgaW50IF9fd2xhbl9oZGRfY2ZnODAyMTFfZ2V0X3R4cG93ZXIoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyNpZiBMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMyw4LDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXJlbGVzc19kZXYgKndkZXYsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ICpkYm0pCit7CisKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcjsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gKGhkZF9jb250ZXh0X3QqKSB3aXBoeV9wcml2KHdpcGh5KTsKKyAgICBpbnQgc3RhdHVzOworCisgICAgRU5URVIoKTsKKworICAgIHN0YXR1cyA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gc3RhdHVzKQorICAgIHsKKyAgICAgICAgKmRibSA9IDA7CisgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgfQorCisgICAgcEFkYXB0ZXIgPSBoZGRfZ2V0X2FkYXB0ZXIocEhkZEN0eCwgV0xBTl9IRERfSU5GUkFfU1RBVElPTik7CisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCAiJXM6IE5vdCBpbiBzdGF0aW9uIGNvbnRleHQgIiAsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVOT0VOVDsKKyAgICB9CisKKyAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfSERELAorICAgICAgICAgICAgICAgICAgICAgVFJBQ0VfQ09ERV9IRERfQ0ZHODAyMTFfR0VUX1RYUE9XRVIsCisgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCBwQWRhcHRlci0+ZGV2aWNlX21vZGUpKTsKKyAgICB3bGFuX2hkZF9nZXRfY2xhc3NBc3RhdHMocEFkYXB0ZXIpOworICAgICpkYm0gPSBwQWRhcHRlci0+aGRkX3N0YXRzLkNsYXNzQV9zdGF0Lm1heF9wd3I7CisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIDA7Cit9CisKK3N0YXRpYyBpbnQgd2xhbl9oZGRfY2ZnODAyMTFfZ2V0X3R4cG93ZXIoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyNpZiBMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMyw4LDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXJlbGVzc19kZXYgKndkZXYsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ICpkYm0pCit7CisgICAgaW50IHJldDsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX193bGFuX2hkZF9jZmc4MDIxMV9nZXRfdHhwb3dlcih3aXBoeSwKKyNpZiBMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMyw4LDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ZGV2LAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYm0pOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQgX193bGFuX2hkZF9jZmc4MDIxMV9nZXRfc3RhdGlvbihzdHJ1Y3Qgd2lwaHkgKndpcGh5LCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04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gPSBwQWRhcHRlci0+aGRkX3N0YXRzLkNsYXNzQV9zdGF0LnR4X3JhdGUgKiA1OworCisjaWZkZWYgTElOS1NQRUVEX0RFQlVHX0VOQUJMRUQKKyAgICBwcl9pbmZvKCJSU1NJICVkLCBSTE1TICV1LCByYXRlICVkLCByc3NpIGhpZ2ggJWQsIHJzc2kgbWlkICVkLCByc3NpIGxvdyAlZCwgcmF0ZV9mbGFncyAweCV4LCBNQ1MgJWRcbiIsCisgICAgICAgICAgICBzaW5mby0+c2lnbmFsLAorICAgICAgICAgICAgcENmZy0+cmVwb3J0TWF4TGlua1NwZWVkLAorICAgICAgICAgICAgbXlSYXRlLAorICAgICAgICAgICAgKGludCkgcENmZy0+bGlua1NwZWVkUnNzaUhpZ2gsCisgICAgICAgICAgICAoaW50KSBwQ2ZnLT5saW5rU3BlZWRSc3NpTWlkLAorICAgICAgICAgICAgKGludCkgcENmZy0+bGlua1NwZWVkUnNzaUxvdywKKyAgICAgICAgICAgIChpbnQpIHJhdGVfZmxhZ3MsCisgICAgICAgICAgICAoaW50KSBwQWRhcHRlci0+aGRkX3N0YXRzLkNsYXNzQV9zdGF0Lm1jc19pbmRleCk7CisjZW5kaWYgLy9MSU5LU1BFRURfREVCVUdfRU5BQkxFRAorCisgICAgaWYgKGVIRERfTElOS19TUEVFRF9SRVBPUlRfQUNUVUFMICE9IHBDZmctPnJlcG9ydE1heExpbmtTcGVlZCkKKyAgICB7CisgICAgICAgIC8vIHdlIGRvIG5vdCB3YW50IHRvIG5lY2Vzc2FyaWx5IHJlcG9ydCB0aGUgY3VycmVudCBzcGVlZAorICAgICAgICBpZiAoZUhERF9MSU5LX1NQRUVEX1JFUE9SVF9NQVggPT0gcENmZy0+cmVwb3J0TWF4TGlua1NwZWVkKQorICAgICAgICB7CisgICAgICAgICAgICAvLyByZXBvcnQgdGhlIG1heCBwb3NzaWJsZSBzcGVlZAorICAgICAgICAgICAgcnNzaWR4ID0gMDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChlSEREX0xJTktfU1BFRURfUkVQT1JUX01BWF9TQ0FMRUQgPT0gcENmZy0+cmVwb3J0TWF4TGlua1NwZWVkKQorICAgICAgICB7CisgICAgICAgICAgICAvLyByZXBvcnQgdGhlIG1heCBwb3NzaWJsZSBzcGVlZCB3aXRoIFJTU0kgc2NhbGluZworICAgICAgICAgICAgaWYgKHNpbmZvLT5zaWduYWwgPj0gcENmZy0+bGlua1NwZWVkUnNzaUhpZ2gpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gcmVwb3J0IHRoZSBtYXggcG9zc2libGUgc3BlZWQKKyAgICAgICAgICAgICAgICByc3NpZHggPSAwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoc2luZm8tPnNpZ25hbCA+PSBwQ2ZnLT5saW5rU3BlZWRSc3NpTWlkKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIHJlcG9ydCBtaWRkbGUgc3BlZWQKKyAgICAgICAgICAgICAgICByc3NpZHggPSAxOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoc2luZm8tPnNpZ25hbCA+PSBwQ2ZnLT5saW5rU3BlZWRSc3NpTG93KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIHJlcG9ydCBtaWRkbGUgc3BlZWQKKyAgICAgICAgICAgICAgICByc3NpZHggPSAyOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIHJlcG9ydCBhY3R1YWwgc3BlZWQKKyAgICAgICAgICAgICAgICByc3NpZHggPSAzOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLy8gdW5rbm93biwgdHJlYXQgYXMgZUhERF9MSU5LX1NQRUVEX1JFUE9SVF9NQVgKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIHZhbHVlIGZvciByZXBvcnRNYXhMaW5rU3BlZWQ6ICV1IiwKKyAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHBDZmctPnJlcG9ydE1heExpbmtTcGVlZCk7CisgICAgICAgICAgICByc3NpZHggPSAwOworICAgICAgICB9CisKKyAgICAgICAgbWF4UmF0ZSA9IDA7CisKKyAgICAgICAgLyogR2V0IEJhc2ljIFJhdGUgU2V0ICovCisgICAgICAgIGlmICgwICE9IGNjbUNmZ0dldFN0cihXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksIFdOSV9DRkdfT1BFUkFUSU9OQUxfUkFURV9TRVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9wZXJhdGlvbmFsUmF0ZXMsICZPUkxlbmcpKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IGNjbSBhcGkgcmV0dXJuZWQgZmFpbHVyZSIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIC8qVG8ga2VlcCBHVUkgaGFwcHkqLworICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIH0KKworICAgICAgICBmb3IgKGkgPSAwOyBpIDwgT1JMZW5nOyBpKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCAoc2l6ZW9mKHN1cHBvcnRlZF9kYXRhX3JhdGUpIC8gc2l6ZW9mKHN1cHBvcnRlZF9kYXRhX3JhdGVbMF0pKTsgaiArKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBWYWxpZGF0ZSBSYXRlIFNldCAqLworICAgICAgICAgICAgICAgIGlmIChzdXBwb3J0ZWRfZGF0YV9yYXRlW2pdLmJlYWNvbl9yYXRlX2luZGV4ID09IChPcGVyYXRpb25hbFJhdGVzW2ldICYgMHg3RikpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBjdXJyZW50UmF0ZSA9IHN1cHBvcnRlZF9kYXRhX3JhdGVbal0uc3VwcG9ydGVkX3JhdGVbcnNzaWR4XTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgLyogVXBkYXRlIE1BWCByYXRlICovCisgICAgICAgICAgICBtYXhSYXRlID0gKGN1cnJlbnRSYXRlID4gbWF4UmF0ZSk/Y3VycmVudFJhdGU6bWF4UmF0ZTsKKyAgICAgICAgfQorCisgICAgICAgIC8qIEdldCBFeHRlbmRlZCBSYXRlIFNldCAqLworICAgICAgICBpZiAoMCAhPSBjY21DZmdHZXRTdHIoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLCBXTklfQ0ZHX0VYVEVOREVEX09QRVJBVElPTkFMX1JBVEVfU0VULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRlbmRlZFJhdGVzLCAmRVJMZW5nKSkKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiBjY20gYXBpIHJldHVybmVkIGZhaWx1cmUiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAvKlRvIGtlZXAgR1VJIGhhcHB5Ki8KKyAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9CisKKyAgICAgICAgZm9yIChpID0gMDsgaSA8IEVSTGVuZzsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgKHNpemVvZihzdXBwb3J0ZWRfZGF0YV9yYXRlKSAvIHNpemVvZihzdXBwb3J0ZWRfZGF0YV9yYXRlWzBdKSk7IGogKyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHN1cHBvcnRlZF9kYXRhX3JhdGVbal0uYmVhY29uX3JhdGVfaW5kZXggPT0gKEV4dGVuZGVkUmF0ZXNbaV0gJiAweDdGKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRSYXRlID0gc3VwcG9ydGVkX2RhdGFfcmF0ZVtqXS5zdXBwb3J0ZWRfcmF0ZVtyc3NpZHhdOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBVcGRhdGUgTUFYIHJhdGUgKi8KKyAgICAgICAgICAgIG1heFJhdGUgPSAoY3VycmVudFJhdGUgPiBtYXhSYXRlKT9jdXJyZW50UmF0ZTptYXhSYXRlOworICAgICAgICB9CisKKyAgICAgICAgLyogR2V0IE1DUyBSYXRlIFNldCAtLQorICAgICAgICAgICBPbmx5IGlmIHdlIGFyZSBhbHdheXMgcmVwb3J0aW5nIG1heCBzcGVlZCAgKG9yKQorICAgICAgICAgICBpZiB3ZSBoYXZlIGdvb2QgcnNzaSAqLworICAgICAgICBpZiAoKDMgIT0gcnNzaWR4KSAmJiAhKHJhdGVfZmxhZ3MgJiBlSEFMX1RYX1JBVEVfTEVHQUNZKSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKHJhdGVfZmxhZ3MgJiBlSEFMX1RYX1JBVEVfVkhUODApCisgICAgICAgICAgICAgICAgbW9kZSA9IDI7CisgICAgICAgICAgICBlbHNlIGlmIChyYXRlX2ZsYWdzICYgKGVIQUxfVFhfUkFURV9WSFQ0MCB8IGVIQUxfVFhfUkFURV9IVDQwKSkKKyAgICAgICAgICAgICAgICBtb2RlID0gMTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBtb2RlID0gMDsKKworICAgICAgICAgICAgaWYgKDAgIT0gY2NtQ2ZnR2V0U3RyKFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwgV05JX0NGR19DVVJSRU5UX01DU19TRVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQ1NSYXRlcywgJk1DU0xlbmcpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogY2NtIGFwaSByZXR1cm5lZCBmYWlsdXJlIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgIC8qVG8ga2VlcCBHVUkgaGFwcHkqLworICAgICAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmF0ZUZsYWcgPSAwOworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisgICAgICAgICAgICAvKiBWSFQ4MCByYXRlIGhhcyBzZXBlcmF0ZSByYXRlIHRhYmxlICovCisgICAgICAgICAgICBpZiAocmF0ZV9mbGFncyAmIChlSEFMX1RYX1JBVEVfVkhUMjB8ZUhBTF9UWF9SQVRFX1ZIVDQwfGVIQUxfVFhfUkFURV9WSFQ4MCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2NtQ2ZnR2V0SW50KFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwgV05JX0NGR19WSFRfVFhfTUNTX01BUCwgJnZodF9tY3NfbWFwKTsKKyAgICAgICAgICAgICAgICB2aHRNYXhNY3MgPSAoZURhdGFSYXRlMTFBQ01heE1jcykodmh0X21jc19tYXAgJiBEQVRBX1JBVEVfMTFBQ19NQ1NfTUFTSyApOworICAgICAgICAgICAgICAgIGlmIChyYXRlX2ZsYWdzICYgZUhBTF9UWF9SQVRFX1NHSSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHJhdGVGbGFnIHw9IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChEQVRBX1JBVEVfMTFBQ19NQVhfTUNTXzcgPT0gdmh0TWF4TWNzKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbWF4TUNTSWR4ID0gNzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoREFUQV9SQVRFXzExQUNfTUFYX01DU184ID09IHZodE1heE1jcykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIG1heE1DU0lkeCA9IDg7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKERBVEFfUkFURV8xMUFDX01BWF9NQ1NfOSA9PSB2aHRNYXhNY3MpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvL1ZIVDIwIGlzIHN1cHBvcnRpbmcgMH44CisgICAgICAgICAgICAgICAgICAgIGlmIChyYXRlX2ZsYWdzICYgZUhBTF9UWF9SQVRFX1ZIVDIwKQorICAgICAgICAgICAgICAgICAgICAgICAgbWF4TUNTSWR4ID0gODsKKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgbWF4TUNTSWR4ID0gOTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoMCAhPSByc3NpZHgpLypjaGVjayBmb3Igc2NhbGVkICovCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvL2dldCBtaWRkbGUgcmF0ZSBNQ1MgaW5kZXggaWYgcnNzaT0xLzIKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpPTA7IGkgPD0gbWF4TUNTSWR4OyBpKyspCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzaW5mby0+c2lnbmFsIDw9IHJzc2lNY3NUYmxbbW9kZV1baV0pCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4TUNTSWR4ID0gaTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgIC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yYXRlRmxhZ107CisgICAgICAgICAgICAgICAgICAgIG1heFJhdGUgPSBzdXBwb3J0ZWRfdmh0X21jc19yYXRlW21heE1DU0lkeF0uc3VwcG9ydGVkX1ZIVDIwX3JhdGVbcmF0ZUZsYWddOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIG1heFNwZWVkTUNTID0gMTsKKyAgICAgICAgICAgICAgICBpZiAoY3VycmVudFJhdGUgPiBtYXhSYXRlKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbWF4UmF0ZSA9IGN1cnJlbnRSYXRlOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorI2VuZGlmIC8qIFdMQU5fRkVBVFVSRV8xMUFDICovCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHJhdGVfZmxhZ3MgJiBlSEFMX1RYX1JBVEVfSFQ0MCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHJhdGVGbGFnIHw9IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChyYXRlX2ZsYWdzICYgZUhBTF9UWF9SQVRFX1NHSSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHJhdGVGbGFnIHw9IDI7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgdGVtcCA9IHNpemVvZihzdXBwb3J0ZWRfbWNzX3JhdGUpIC8gc2l6ZW9mKHN1cHBvcnRlZF9tY3NfcmF0ZVswXSk7CisgICAgICAgICAgICAgICAgaWYgKHJzc2lkeCA9PSAxIHx8IHJzc2lkeCA9PSAyKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy9nZXQgbWlkZGxlIHJhdGUgTUNTIGluZGV4IGlmIHJzc2k9MS8yCisgICAgICAgICAgICAgICAgICAgIGZvciAoaT0wOyBpIDw9IDc7IGkrKykKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNpbmZvLT5zaWduYWwgPD0gcnNzaU1jc1RibFttb2RlXVtpXSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gaSsxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTUNTTGVuZzsgaSsrKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IHRlbXA7IGorKykKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN1cHBvcnRlZF9tY3NfcmF0ZVtqXS5iZWFjb25fcmF0ZV9pbmRleCA9PSBNQ1NSYXRlc1tpXSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50UmF0ZSA9IHN1cHBvcnRlZF9tY3NfcmF0ZVtqXS5zdXBwb3J0ZWRfcmF0ZVtyYXRlRmxhZ107CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4TUNTSWR4ICAgPSBzdXBwb3J0ZWRfbWNzX3JhdGVbal0uYmVhY29uX3JhdGVfaW5kZXg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKChqIDwgdGVtcCkgJiYgKGN1cnJlbnRSYXRlID4gbWF4UmF0ZSkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1heFJhdGUgICAgID0gY3VycmVudFJhdGU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbWF4U3BlZWRNQ1MgPSAxOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgZWxzZSBpZiAoIShyYXRlX2ZsYWdzICYgZUhBTF9UWF9SQVRFX0xFR0FDWSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIG1heFJhdGUgPSBteVJhdGU7CisgICAgICAgICAgICBtYXhTcGVlZE1DUyA9IDE7CisgICAgICAgICAgICBtYXhNQ1NJZHggPSBwQWRhcHRlci0+aGRkX3N0YXRzLkNsYXNzQV9zdGF0Lm1jc19pbmRleDsKKyAgICAgICAgfQorICAgICAgICAvLyBtYWtlIHN1cmUgd2UgcmVwb3J0IGEgdmFsdWUgYXQgbGVhc3QgYXMgYmlnIGFzIG91ciBjdXJyZW50IHJhdGUKKyAgICAgICAgaWYgKChtYXhSYXRlIDwgbXlSYXRlKSB8fCAoMCA9PSBtYXhSYXRlKSkKKyAgICAgICAgeworICAgICAgICAgICBtYXhSYXRlID0gbXlSYXRlOworICAgICAgICAgICBpZiAocmF0ZV9mbGFncyAmIGVIQUxfVFhfUkFURV9MRUdBQ1kpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWF4U3BlZWRNQ1MgPSAwOworICAgICAgICAgICB9CisgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgeworICAgICAgICAgICAgICBtYXhTcGVlZE1DUyA9IDE7CisgICAgICAgICAgICAgIG1heE1DU0lkeCA9IHBBZGFwdGVyLT5oZGRfc3RhdHMuQ2xhc3NBX3N0YXQubWNzX2luZGV4OworICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAocmF0ZV9mbGFncyAmIGVIQUxfVFhfUkFURV9MRUdBQ1kpCisgICAgICAgIHsKKyAgICAgICAgICAgIHNpbmZvLT50eHJhdGUubGVnYWN5ICA9IG1heFJhdGU7CisjaWZkZWYgTElOS1NQRUVEX0RFQlVHX0VOQUJMRUQKKyAgICAgICAgICAgIHByX2luZm8oIlJlcG9ydGluZyBsZWdhY3kgcmF0ZSAlZFxuIiwgc2luZm8tPnR4cmF0ZS5sZWdhY3kpOworI2VuZGlmIC8vTElOS1NQRUVEX0RFQlVHX0VOQUJMRUQKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHNpbmZvLT50eHJhdGUubWNzICAgID0gbWF4TUNTSWR4OworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisgICAgICAgICAgICBzaW5mby0+dHhyYXRlLm5zcyA9IDE7CisgICAgICAgICAgICBpZiAocmF0ZV9mbGFncyAmIGVIQUxfVFhfUkFURV9WSFQ4MCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzaW5mby0+dHhyYXRlLmZsYWdzIHw9IFJBVEVfSU5GT19GTEFHU19WSFRfTUNTOworICAgICAgICAgICAgICAgIHNpbmZvLT50eHJhdGUuZmxhZ3MgfD0gUkFURV9JTkZPX0ZMQUdTXzgwX01IWl9XSURUSDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKHJhdGVfZmxhZ3MgJiBlSEFMX1RYX1JBVEVfVkhUNDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2luZm8tPnR4cmF0ZS5mbGFncyB8PSBSQVRFX0lORk9fRkxBR1NfVkhUX01DUzsKKyAgICAgICAgICAgICAgICBzaW5mby0+dHhyYXRlLmZsYWdzIHw9IFJBVEVfSU5GT19GTEFHU180MF9NSFpfV0lEVEg7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChyYXRlX2ZsYWdzICYgZUhBTF9UWF9SQVRFX1ZIVDIwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNpbmZvLT50eHJhdGUuZmxhZ3MgfD0gUkFURV9JTkZPX0ZMQUdTX1ZIVF9NQ1M7CisgICAgICAgICAgICB9CisjZW5kaWYgLyogV0xBTl9GRUFUVVJFXzExQUMgKi8KKyAgICAgICAgICAgIGlmIChyYXRlX2ZsYWdzICYgKGVIQUxfVFhfUkFURV9IVDIwIHwgZUhBTF9UWF9SQVRFX0hUNDApKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNpbmZvLT50eHJhdGUuZmxhZ3MgfD0gUkFURV9JTkZPX0ZMQUdTX01DUzsKKyAgICAgICAgICAgICAgICBpZiAocmF0ZV9mbGFncyAmIGVIQUxfVFhfUkFURV9IVDQwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc2luZm8tPnR4cmF0ZS5mbGFncyB8PSBSQVRFX0lORk9fRkxBR1NfNDBfTUhaX1dJRFRIOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChyYXRlX2ZsYWdzICYgZUhBTF9UWF9SQVRFX1NHSSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzaW5mby0+dHhyYXRlLmZsYWdzIHw9IFJBVEVfSU5GT19GTEFHU19TSE9SVF9HSTsKKyAgICAgICAgICAgIH0KKworI2lmZGVmIExJTktTUEVFRF9ERUJVR19FTkFCTEVECisgICAgICAgICAgICBwcl9pbmZvKCJSZXBvcnRpbmcgTUNTIHJhdGUgJWQgZmxhZ3MgJXhcbiIsCisgICAgICAgICAgICAgICAgICAgIHNpbmZvLT50eHJhdGUubWNzLAorICAgICAgICAgICAgICAgICAgICBzaW5mby0+dHhyYXRlLmZsYWdzICk7CisjZW5kaWYgLy9MSU5LU1BFRURfREVCVUdfRU5BQkxFRAorICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIC8vIHJlcG9ydCBjdXJyZW50IHJhdGUgaW5zdGVhZCBvZiBtYXggcmF0ZQorCisgICAgICAgIGlmIChyYXRlX2ZsYWdzICYgZUhBTF9UWF9SQVRFX0xFR0FDWSkKKyAgICAgICAgeworICAgICAgICAgICAgLy9wcm92aWRlIHRvIHRoZSBVSSBpbiB1bml0cyBvZiAxMDBrYnBzCisgICAgICAgICAgICBzaW5mby0+dHhyYXRlLmxlZ2FjeSA9IG15UmF0ZTsKKyNpZmRlZiBMSU5LU1BFRURfREVCVUdfRU5BQkxFRAorICAgICAgICAgICAgcHJfaW5mbygiUmVwb3J0aW5nIGFjdHVhbCBsZWdhY3kgcmF0ZSAlZFxuIiwgc2luZm8tPnR4cmF0ZS5sZWdhY3kpOworI2VuZGlmIC8vTElOS1NQRUVEX0RFQlVHX0VOQUJMRUQKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vbXVzdCBiZSBNQ1MKKyAgICAgICAgICAgIHNpbmZvLT50eHJhdGUubWNzID0gcEFkYXB0ZXItPmhkZF9zdGF0cy5DbGFzc0Ffc3RhdC5tY3NfaW5kZXg7CisjaWZkZWYgV0xBTl9GRUFUVVJFXzExQUMKKyAgICAgICAgICAgIHNpbmZvLT50eHJhdGUubnNzID0gMTsKKyAgICAgICAgICAgIGlmIChyYXRlX2ZsYWdzICYgZUhBTF9UWF9SQVRFX1ZIVDgwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNpbmZvLT50eHJhdGUuZmxhZ3MgfD0gUkFURV9JTkZPX0ZMQUdTX1ZIVF9NQ1M7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisjZW5kaWYgLyogV0xBTl9GRUFUVVJFXzExQUMgKi8KKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzaW5mby0+dHhyYXRlLmZsYWdzIHw9IFJBVEVfSU5GT19GTEFHU19NQ1M7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAocmF0ZV9mbGFncyAmIGVIQUxfVFhfUkFURV9TR0kpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2luZm8tPnR4cmF0ZS5mbGFncyB8PSBSQVRFX0lORk9fRkxBR1NfU0hPUlRfR0k7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAocmF0ZV9mbGFncyAmIGVIQUxfVFhfUkFURV9IVDQwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNpbmZvLT50eHJhdGUuZmxhZ3MgfD0gUkFURV9JTkZPX0ZMQUdTXzQwX01IWl9XSURUSDsKKyAgICAgICAgICAgIH0KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgICAgICAgICAgZWxzZSBpZiAocmF0ZV9mbGFncyAmIGVIQUxfVFhfUkFURV9WSFQ4MCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzaW5mby0+dHhyYXRlLmZsYWdzIHw9IFJBVEVfSU5GT19GTEFHU184MF9NSFpfV0lEVEg7CisgICAgICAgICAgICB9CisjZW5kaWYgLyogV0xBTl9GRUFUVVJFXzExQUMgKi8KKyNpZmRlZiBMSU5LU1BFRURfREVCVUdfRU5BQkxFRAorICAgICAgICAgICAgcHJfaW5mbygiUmVwb3J0aW5nIGFjdHVhbCBNQ1MgcmF0ZSAlZCBmbGFncyAleFxuIiwKKyAgICAgICAgICAgICAgICAgICAgc2luZm8tPnR4cmF0ZS5tY3MsCisgICAgICAgICAgICAgICAgICAgIHNpbmZvLT50eHJhdGUuZmxhZ3MgKTsKKyNlbmRpZiAvL0xJTktTUEVFRF9ERUJVR19FTkFCTEVECisgICAgICAgIH0KKyAgICB9CisgICAgc2luZm8tPmZpbGxlZCB8PSBTVEFUSU9OX0lORk9fVFhfQklUUkFURTsKKworICAgIHNpbmZvLT50eF9wYWNrZXRzID0KKyAgICAgICBwQWRhcHRlci0+aGRkX3N0YXRzLnN1bW1hcnlfc3RhdC50eF9mcm1fY250WzBdICsKKyAgICAgICBwQWRhcHRlci0+aGRkX3N0YXRzLnN1bW1hcnlfc3RhdC50eF9mcm1fY250WzFdICsKKyAgICAgICBwQWRhcHRlci0+aGRkX3N0YXRzLnN1bW1hc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ICpwSGRkQ3R4OworICAgIFZPU19TVEFUVVMgdm9zX3N0YXR1czsKKyAgICBpbnQgc3RhdHVzOworCisgICAgRU5URVIoKTsKKworICAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiBBZGFwdGVyIGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRU5PREVWOworICAgIH0KKworICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9IREQsCisgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX0hERF9DRkc4MDIxMV9TRVRfUE9XRVJfTUdNVCwKKyAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsIHRpbWVvdXQpKTsKKworICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICBzdGF0dXMgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHN0YXR1cykKKyAgICB7CisgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgfQorCisgICAgaWYgKChEUklWRVJfUE9XRVJfTU9ERV9BVVRPID09ICFtb2RlKSAmJgorICAgICAgICAoVFJVRSA9PSBwSGRkQ3R4LT5oZGRfd2xhbl9zdXNwZW5kZWQpICYmCisgICAgICAgIChwSGRkQ3R4LT5jZmdfaW5pLT5maG9zdEFycE9mZmxvYWQpICYmCisgICAgICAgIChlQ29ubmVjdGlvblN0YXRlX0Fzc29jaWF0ZWQgPT0KKyAgICAgICAgICAgICAoV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlcikpLT5jb25uX2luZm8uY29ublN0YXRlKSkKKyAgICB7CisKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICA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OworfQorCitzdGF0aWMgaW50IHdsYW5faGRkX2NmZzgwMjExX3NldF9wb3dlcl9tZ210KHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBib29sIG1vZGUsIGludCB0aW1lb3V0KQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9fd2xhbl9oZGRfY2ZnODAyMTFfc2V0X3Bvd2VyX21nbXQod2lwaHksIGRldiwgbW9kZSwgdGltZW91dCk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDIsNiwzOCkpCitzdGF0aWMgaW50IF9fd2xhbl9oZGRfc2V0X2RlZmF1bHRfbWdtdF9rZXkoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqbmV0ZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4IGtleV9pbmRleCkKK3sKKyAgICBFTlRFUigpOworICAgIHJldHVybiAwOworfQorCitzdGF0aWMgaW50IHdsYW5faGRkX3NldF9kZWZhdWx0X21nbXRfa2V5KHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpuZXRkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4IGtleV9pbmRleCkKK3sKKyAgICBpbnQgcmV0OworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX193bGFuX2hkZF9zZXRfZGVmYXV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gKnBhcmFtcykKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX3dsYW5faGRkX3NldF90eHFfcGFyYW1zKHdpcGh5LCBkZXYsIHBhcmFtcyk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworICAgIHJldHVybiByZXQ7Cit9CisjZWxpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDIsNiwzOCkpCitzdGF0aWMgaW50IHdsYW5faGRkX3NldF90eHFfcGFyYW1zKHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgc3RydWN0IGllZWU4MDIxMV90eHFfcGFyYW1zICpwYXJhbXMpCit7CisgICAgaW50IHJldDsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX193bGFuX2hkZF9zZXRfdHhxX3BhcmFtcyh3aXBoeSwgcGFyYW1zKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0dXJuIHJldDsKK30KKyNlbmRpZgorCitzdGF0aWMgaW50IF9fd2xhbl9oZGRfY2ZnODAyMTFfZGVsX3N0YXRpb24oc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgdGFnQ3NyRGVsU3RhUGFyYW1zICpwRGVsU3RhUGFyYW1zKQoreworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgICBWT1NfU1RBVFVTIHZvc19zdGF0dXM7CisgICAgaW50I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VMTCl7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgRkwoInBzYXBDdHggaXMgTlVMTCIpKTsKKyAgICAgICAgICAgIHJldHVybiAtRU5PRU5UOworICAgICAgICB9CisgICAgICAgIGlmICh2b3NfaXNfbWFjYWRkcl9icm9hZGNhc3QoKHZfTUFDQUREUl90ICopcERlbFN0YVBhcmFtcy0+cGVlck1hY0FkZHIpKQorICAgICAgICB7CisgICAgICAgICAgICB2X1UxNl90IGk7CisgICAgICAgICAgICBmb3IoaSA9IDA7IGkgPCBXTEFOX01BWF9TVEFfQ09VTlQ7IGkrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoKHBTYXBDdHgtPmFTdGFJbmZvW2ldLmlzVXNlZCkgJiYKKyAgICAgICAgICAgICAgICAgICAgKCFwU2FwQ3R4LT5hU3RhSW5mb1tpXS5pc0RlYXV0aEluUHJvZ3Jlc3MpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBEZWxTdGFQYXJhbXMtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNhcEN0eC0+YVN0YUluZm9baV0ubWFjQWRkclNUQS5ieXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVUSEVSX0FERFJfTEVOKTsKKworICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IERlbGV0ZSBTVEEgd2l0aCBNQUM6OiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocERlbFN0YVBhcmFtcy0+cGVlck1hY0FkZHIpKTsKKyAgICAgICAgICAgICAgICAgICAgdm9zX3N0YXR1cyA9IGhkZF9zb2Z0YXBfc3RhX2RlYXV0aChwQWRhcHRlciwgcERlbFN0YVBhcmFtcyk7CisgICAgICAgICAgICAgICAgICAgIGlmIChWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zX3N0YXR1cykpCisgICAgICAgICAgICAgICAgICAgICAgICBwU2FwQ3R4LT5hU3RhSW5mb1tpXS5pc0RlYXV0aEluUHJvZ3Jlc3MgPSBUUlVFOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKworICAgICAgICAgICAgdm9zX3N0YXR1cyA9IGhkZF9zb2Z0YXBfR2V0U3RhSWQocEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZfTUFDQUREUl90ICopcERlbFN0YVBhcmFtcy0+cGVlck1hY0FkZHIsICZzdGFJZCk7CisgICAgICAgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3Nfc3RhdHVzKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICIlczogU2tpcCB0aGlzIERFTCBTVEEgYXMgdGhpcyBpcyBub3QgdXNlZDo6IgorICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIsCisgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBNQUNfQUREUl9BUlJBWShwRGVsU3RhUGFyYW1zLT5wZWVyTWFjQWRkcikpOworICAgICAgICAgICAgICAgIHJldHVybiAtRU5PRU5UOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiggcFNhcEN0eC0+YVN0YUluZm9bc3RhSWRdLmlzRGVhdXRoSW5Qcm9ncmVzcyA9PSBUUlVFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBTa2lwIHRoaXMgREVMIFNUQSBhcyBkZWF1dGggaXMgaW4gcHJvZ3Jlc3M6OiIKKyAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJFU1NfU1RSLAorICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgTUFDX0FERFJfQVJSQVkocERlbFN0YVBhcmFtcy0+cGVlck1hY0FkZHIpKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVOT0VOVDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcFNhcEN0eC0+YVN0YUluZm9bc3RhSWRdLmlzRGVhdXRoSW5Qcm9ncmVzcyA9IFRSVUU7CisKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBEZWxldGUgU1RBIHdpdGggTUFDOjoiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSRVNTX1NUUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBEZWxTdGFQYXJhbXMtPnBlZXJNYWNBZGRyKSk7CisKKyAgICAgICAgICAgIHZvc19zdGF0dXMgPSBoZGRfc29mdGFwX3N0YV9kZWF1dGgocEFkYXB0ZXIsIHBEZWxTdGFQYXJhbXMpOworICAgICAgICAgICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zX3N0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFNhcEN0eC0+YVN0YUluZm9bc3RhSWRdLmlzRGVhdXRoSW5Qcm9ncmVzcyA9IEZBTFNFOworICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBTVEEgcmVtb3ZhbCBmYWlsZWQgZm9yIDo6IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwRGVsU3RhUGFyYW1zLT5wZWVyTWFjQWRkcikpOworICAgICAgICAgICAgICAgIHJldHVybiAtRU5PRU5UOworICAgICAgICAgICAgfQorCisgICAgICAgIH0KKyAgICB9CisKKyAgICBFWElUKCk7CisKKyAgICByZXR1cm4gMDsKK30KKworI2lmZGVmIENGRzgwMjExX0RFTF9TVEFfVjIKK3N0YXRpYyBpbnQgd2xhbl9oZGRfY2ZnODAyMTFfZGVsX3N0YXRpb24oc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHN0YXRpb25fZGVsX3BhcmFtZXRlcnMgKnBhcmFtKQorI2Vsc2UKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTYsMCkpCitzdGF0aWMgaW50IHdsYW5faGRkX2NmZzgwMjExX2RlbF9zdGF0aW9uKHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsIGNvbnN0IHU4ICptYWMpCisjZWxzZQorc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV9kZWxfc3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0dXJuIHJldDsKK30KKworc3RhdGljIGludCBfX3dsYW5faGRkX2NmZzgwMjExX2FkZF9zdGF0aW9uKHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKm1hYywKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggKm1hYywKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBzdGF0aW9uX3BhcmFtZXRlcnMgKnBhcmFtcykKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcjsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgIGludCBzdGF0dXMgPSAtRVBFUk07CisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICB1MzIgbWFzaywgc2V0OworCisgICAgRU5URVIoKTsKKworICAgIHBBZGFwdGVyID0gIFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIHN0YXR1cyA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gc3RhdHVzKQorICAgIHsKKyAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICB9CisKKyAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfSERELAorICAgICAgICAgICAgICAgICAgICAgVFJBQ0VfQ09ERV9IRERfQ0ZHODAyMTFfQUREX1NUQSwKKyAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsIHBhcmFtcy0+bGlzdGVuX2ludGVydmFsKSk7CisgICAgbWFzayA9IHBhcmFtcy0+c3RhX2ZsYWdzX21hc2s7CisKKyAgICBzZXQgPSBwYXJhbXMtPnN0YV9mbGFnc19zZXQ7CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICIlczogbWFzayAweCV4IHNldCAweCV4ICIgTUFDX0FERFJFU1NfU1RSLAorICAgICAgICAgICAgICAgX19mdW5jX18sIG1hc2ssIHNldCwgTUFDX0FERFJfQVJSQVkobWFjKSk7CisKKyAgICBpZiAobWFzayAmIEJJVChOTDgwMjExX1NUQV9GTEFHX1RETFNfUEVFUikpIHsKKyAgICAgICAgaWYgKHNldCAmIEJJVChOTDgwMjExX1NUQV9GTEFHX1RETFNfUEVFUikpIHsKKyAgICAgICAgICAgIHN0YXR1cyA9IHdsYW5faGRkX3RkbHNfYWRkX3N0YXRpb24od2lwaHksIGRldiwgbWFjLCAwLCBOVUxMKTsKKyAgICAgICAgfQorICAgIH0KKyNlbmRpZgorICAgIEVYSVQoKTsKKyAgICByZXR1cm4gc3RhdHVzOworfQorCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE2LDApKQorc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV9hZGRfc3RhdGlvbihzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgIHN0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wdGVyICkKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogSW52YWxpZCBBZGFwdGVyIiAsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBpZiAoIXBta3NhKSB7CisgICAgICAgIGhkZExvZyhMT0dFLCBGTCgicG1rc2EgaXMgTlVMTCIpKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgaWYgKCFwbWtzYS0+YnNzaWQgfHwgIXBta3NhLT5wbWtpZCkgeworICAgICAgIGhkZExvZyhMT0dFLCBGTCgicG1rc2EtPmJzc2lkKCVwKSBvciBwbWtzYS0+cG1raWQoJXApIGlzIE5VTEwiKSwKKyAgICAgICAgICAgICAgcG1rc2EtPmJzc2lkLCBwbWtzYS0+cG1raWQpOworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfREVCVUcsICIlczogc2V0IFBNS1NBIGZvciAiIE1BQ19BRERSRVNTX1NUUiwKKyAgICAgICAgICAgX19mdW5jX18sIE1BQ19BRERSX0FSUkFZKHBta3NhLT5ic3NpZCkpOworCisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIHN0YXR1cyA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gc3RhdHVzKQorICAgIHsKKyAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICB9CisKKyAgICAvLyBSZXRyaWV2ZSBoYWxIYW5kbGUKKyAgICBoYWxIYW5kbGUgPSBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlcik7CisKKyAgICB2b3NfbWVtX2NvcHkocG1rX2lkLkJTU0lELCBwbWtzYS0+YnNzaWQsIEVUSEVSX0FERFJfTEVOKTsKKyAgICB2b3NfbWVtX2NvcHkocG1rX2lkLlBNS0lELCBwbWtzYS0+cG1raWQsIENTUl9SU05fUE1LSURfU0laRSk7CisKKyAgICAvKiBBZGQgdG8gdGhlIFBNS1NBIElEIENhY2hlIGluIENTUiAqLworICAgIHJlc3VsdCA9IHNtZV9Sb2FtU2V0UE1LSURDYWNoZShoYWxIYW5kbGUscEFkYXB0ZXItPnNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBta19pZCwgMSwgRkFMU0UpOworCisgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX0hERCwKKyAgICAgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfSEREX0NGRzgwMjExX1NFVF9QTUtTQSwKKyAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsIHJlc3VsdCkpOworCisgICAgRVhJVCgpOworICAgIHJldHVybiBIQUxfU1RBVFVTX1NVQ0NFU1MocmVzdWx0KSA/IDAgOiAtRUlOVkFMOworfQorCitzdGF0aWMgaW50IHdsYW5faGRkX2NmZzgwMjExX3NldF9wbWtzYShzdHJ1Y3Qgd2lwaHkgKndpcGh5LCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgc3RydWN0IGNmZzgwMjExX3Bta3NhICpwbWtzYSkKK3sKKyAgIGludCByZXQ7CisKKyAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICByZXQgPSBfX3dsYW5faGRkX2NmZzgwMjExX3NldF9wbWtzYSh3aXBoeSwgZGV2LCBwbWtzYSk7CisgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgIHJldHVybiByZXQ7Cit9CisKKworc3RhdGljIGludCBfX3dsYW5faGRkX2NmZzgwMjExX2RlbF9wbWtzYShzdHJ1Y3Qgd2lwaHkgKndpcGh5LCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgIHN0cnVjdCBjZmc4MDIxMV9wbWtzYSAqcG1rc2EpCit7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgICB0SGFsSGFuZGxlIGhhbEhhbmRsZTsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgIGludCBzdGF0dXMgPSAwOworCisgICAgRU5URVIoKTsKKworICAgIC8qIFZhbGlkYXRlIHBBZGFwdGVyICovCisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogSW52YWxpZCBBZGFwdGVyIiAsX19mdW5jX18pOworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIGlmICghcG1rc2EpIHsKKyAgICAgICAgaGRkTG9nKExPR0UsIEZMKCJwbWtzYSBpcyBOVUxMIikpOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBpZiAoIXBta3NhLT5ic3NpZCkgeworICAgICAgIGhkZExvZyhMT0dFLCBGTCgicG1rc2EtPmJzc2lkIGlzIE5VTEwiKSk7CisgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9ERUJVRywgIiVzOiBkZWxldGluZyBQTUtTQSBmb3IgIiBNQUNfQUREUkVTU19TVFIsCisgICAgICAgICAgIF9fZnVuY19fLCBNQUNfQUREUl9BUlJBWShwbWtzYS0+YnNzaWQpKTsKKworICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICBzdGF0dXMgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHN0YXR1cykKKyAgICB7CisgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgfQorCisgICAgLypSZXRyaWV2ZSBoYWxIYW5kbGUqLworICAgIGhhbEhhbmRsZSA9IFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKTsKKworICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9IREQsCisgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX0hERF9DRkc4MDIxMV9ERUxfUE1LU0EsCisgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCAwKSk7CisgICAgLyogRGVsZXRlIHRoZSBQTUtJRCBDU1IgY2FjaGUgKi8KKyAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPQorICAgICAgICBzbWVfUm9hbURlbFBNS0lEZnJvbUNhY2hlKGhhbEhhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCBwbWtzYS0+YnNzaWQsIEZBTFNFKSkgeworICAgICAgICBoZGRMb2coTE9HRSwgRkwoIkZhaWxlZCB0byBkZWxldGUgUE1LU0EgZm9yICJNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocG1rc2EtPmJzc2lkKSk7CisgICAgICAgIHN0YXR1cyA9IC1FSU5WQUw7CisgICAgfQorCisgICAgRVhJVCgpOworICAgIHJldHVybiBzdGF0dXM7Cit9CisKKworc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV9kZWxfcG1rc2Eoc3RydWN0IHdpcGh5ICp3aXBoeSwgc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICBzdHJ1Y3QgY2ZnODAyMTFfcG1rc2EgKnBta3NhKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9fd2xhbl9oZGRfY2ZnODAyMTFfZGVsX3Bta3NhKHdpcGh5L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F9fZnVuY19fKTsKKyAgICByZXQgPSBfX3dsYW5faGRkX2NmZzgwMjExX3VwZGF0ZV9mdF9pZXMod2lwaHksIGRldiwgZnRpZSk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKyNlbmRpZgorCisjaWZkZWYgRkVBVFVSRV9XTEFOX1NDQU5fUE5PCisKK3ZvaWQgaGRkX2NmZzgwMjExX3NjaGVkX3NjYW5fZG9uZV9jYWxsYmFjayh2b2lkICpjYWxsYmFja0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyUHJlZk5ldHdvcmtGb3VuZEluZCAqcFByZWZOZXR3b3JrRm91bmRJbmQpCit7CisgICAgaW50IHJldDsKKyAgICBoZGRfYWRhcHRlcl90KiBwQWRhcHRlciA9IChoZGRfYWRhcHRlcl90KiljYWxsYmFja0NvbnRleHQ7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKworICAgIEVOVEVSKCk7CisKKyAgICBpZiAoTlVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiJXM6IEhERCBhZGFwdGVyIGlzIE51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiA7CisgICAgfQorCisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIGlmIChOVUxMID09IHBIZGRDdHgpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IEhERCBjb250ZXh0IGlzIE51bGwhISEiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiA7CisgICAgfQorCisgICAgc3Bp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MOworICAgIHZfVTMyX3QgbnVtX2lnbm9yZV9kZnNfY2ggPSAwOworCisgICAgRU5URVIoKTsKKworICAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAiJXM6IEhERCBhZGFwdGVyIGlzIE51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRU5PREVWOworICAgIH0KKworICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworCisgICAgaWYgKDAgIT0gcmV0KQorICAgIHsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgcENvbmZpZyA9IHBIZGRDdHgtPmNmZ19pbmk7CisgICAgaEhhbCA9IFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKTsKKyAgICBpZiAoTlVMTCA9PSBoSGFsKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEhBTCBjb250ZXh0ICBpcyBOdWxsISEhIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX0hERCwKKyAgICAgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfSEREX0NGRzgwMjExX1NDSEVEX1NDQU5fU1RBUlQsCisgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCBwQWRhcHRlci0+ZGV2aWNlX21vZGUpKTsKKyAgICBzbWVfU2NhbkZsdXNoUmVzdWx0K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OiBhYm9ydCBST0MgZmFpbGVkICIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FQlVTWTsKKyAgICB9CisKKyAgICBwSGRkQ3R4LT5pc1Bub0VuYWJsZSA9IFRSVUU7CisKKyAgICBwbm9SZXF1ZXN0LmVuYWJsZSA9IDE7IC8qRW5hYmxlIFBOTyAqLworICAgIHBub1JlcXVlc3QudWNOZXR3b3Jrc0NvdW50ID0gcmVxdWVzdC0+bl9tYXRjaF9zZXRzOworCisgICAgaWYgKCggIXBub1JlcXVlc3QudWNOZXR3b3Jrc0NvdW50ICkgfHwKKyAgICAgICAgKCBwbm9SZXF1ZXN0LnVjTmV0d29ya3NDb3VudCA+IFNJUl9QTk9fTUFYX1NVUFBfTkVUV09SS1MgKSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBOZXR3b3JrIGlucHV0IGlzIG5vdCBjb3JyZWN0ICVkIE1heCBOZXR3b3JrIHN1cHBvcnRlZCBpcyAlZCIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHBub1JlcXVlc3QudWNOZXR3b3Jrc0NvdW50LAorICAgICAgICAgICAgICAgICAgIFNJUl9QTk9fTUFYX1NVUFBfTkVUV09SS1MpOworICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICBnb3RvIGVycm9yOworICAgIH0KKworICAgIGlmICggU0lSX1BOT19NQVhfTkVUV19DSEFOTkVMU19FWCA8IHJlcXVlc3QtPm5fY2hhbm5lbHMgKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEluY29ycmVjdCBudW1iZXIgb2YgY2hhbm5lbHMgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCByZXF1ZXN0LT5uX2NoYW5uZWxzKTsKKyAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICB9CisKKyAgICAvKiBGcmFtZXdvcmsgcHJvdmlkZXMgb25lIHNldCBvZiBjaGFubmVscyhhbGwpCisgICAgICogY29tbW9uIGZvciBhbGwgc2F2ZWQgcHJvZmlsZSAqLworICAgIGlmICgwICE9IGNjbUNmZ0dldFN0cihoSGFsLCBXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVCwKKyAgICAgICAgICAgIGNoYW5uZWxzX2FsbG93ZWQsICZudW1fY2hhbm5lbHNfYWxsb3dlZCkpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IGZhaWxlZCB0byBnZXQgdmFsaWQgY2hhbm5lbCBsaXN0IiwgX19mdW5jX18pOworICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICBnb3RvIGVycm9yOworICAgIH0KKyAgICAvKiBDaGVja2luZyBlYWNoIGNoYW5uZWwgYWdhaW5zdCBhbGxvd2VkIGNoYW5uZWwgbGlzdCAqLworICAgIG51bV9jaCA9IDA7CisgICAgaWYgKHJlcXVlc3QtPm5fY2hhbm5lbHMpCisgICAgeworICAgICAgICBjaGFyIGNoTGlzdCBbKHJlcXVlc3QtPm5fY2hhbm5lbHMqNSkrMV07CisgICAgICAgIGludCBsZW47CisgICAgICAgIGZvciAoaSA9IDAsIGxlbiA9IDA7IGkgPCByZXF1ZXN0LT5uX2NoYW5uZWxzOyBpKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIGZvciAoaW5keCA9IDA7IGluZHggPCBudW1fY2hhbm5lbHNfYWxsb3dlZDsgaW5keCsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChyZXF1ZXN0LT5jaGFubmVsc1tpXS0+aHdfdmFsdWUgPT0gY2hhbm5lbHNfYWxsb3dlZFtpbmR4XSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmICgoIXBDb25maWctPmVuYWJsZURGU1Bub0NobmxTY2FuKSAmJgorICAgICAgICAgICAgICAgICAgICAgIChOVl9DSEFOTkVMX0RGUyA9PSB2b3NfbnZfZ2V0Q2hhbm5lbEVuYWJsZWRTdGF0ZShjaGFubmVsc19hbGxvd2VkW2luZHhdKSkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAiJXMgOiBEcm9wcGluZyBERlMgY2hhbm5lbCA6ICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLGNoYW5uZWxzX2FsbG93ZWRbaW5keF0pOworICAgICAgICAgICAgICAgICAgICAgICAgbnVtX2lnbm9yZV9kZnNfY2grKzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgdmFsaWRfY2hbbnVtX2NoKytdID0gcmVxdWVzdC0+Y2hhbm5lbHNbaV0tPmh3X3ZhbHVlOworICAgICAgICAgICAgICAgICAgICBsZW4gKz0gc25wcmludGYoY2hMaXN0K2xlbiwgNSwgIiVkICIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVlc3QtPmNoYW5uZWxzW2ldLT5od192YWx1ZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrIDsKKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywiQ2hhbm5lbC1MaXN0OiAgJXMgIiwgY2hMaXN0KTsKKworICAgICAgICAvKklmIGFsbCBjaGFubmVscyBhcmUgREZTIGFuZCBkcm9wcGVkLCB0aGVuIGlnbm9yZSB0aGUgUE5PIHJlcXVlc3QqLworICAgICAgICBpZiAobnVtX2lnbm9yZV9kZnNfY2ggPT0gcmVxdWVzdC0+bl9jaGFubmVscykKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAiJXMgOiBBbGwgcmVxdWVzdGVkIGNoYW5uZWxzIGFyZSBERlMgY2hhbm5lbHMiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgZ290byBlcnJvcjsKKyAgICAgICAgfQorICAgICB9CisKKyAgICBwbm9SZXF1ZXN0LmFOZXR3b3JrcyA9CisgICAgICAgICAgICAgdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRTaXJOZXR3b3JrVHlwZSkqcG5vUmVxdWVzdC51Y05ldHdvcmtzQ291bnQpOworICAgIGlmIChwbm9SZXF1ZXN0LmFOZXR3b3JrcyA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICBGTCgiZmFpbGVkIHRvIGFsbG9jYXRlIG1lbW9yeSBhTmV0d29ya3MgJXUiKSwKKyAgICAgICAgICAgICAgICAodWludDMyKXNpemVvZih0U2lyTmV0d29ya1R5cGUpKnBub1JlcXVlc3QudWNOZXR3b3Jrc0NvdW50KTsKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICB9CisgICAgdm9zX21lbV96ZXJvKHBub1JlcXVlc3QuYU5ldHdvcmtzLAorICAgICAgICAgICAgICAgICBzaXplb2YodFNpck5ldHdvcmtUeXBlKSpwbm9SZXF1ZXN0LnVjTmV0d29ya3NDb3VudCk7CisKKyAgICAvKiBGaWxsaW5nIHBlciBwcm9maWxlICBwYXJhbXMgKi8KKyAgICBmb3IgKGkgPSAwOyBpIDwgcG5vUmVxdWVzdC51Y05ldHdvcmtzQ291bnQ7IGkrKykKKyAgICB7CisgICAgICAgIHBub1JlcXVlc3QuYU5ldHdvcmtzW2ldLnNzSWQubGVuZ3RoID0KKyAgICAgICAgICAgICAgIHJlcXVlc3QtPm1hdGNoX3NldHNbaV0uc3NpZC5zc2lkX2xlbjsKKworICAgICAgICBpZiAoKCAwID09IHBub1JlcXVlc3QuYU5ldHdvcmtzW2ldLnNzSWQubGVuZ3RoICkgfHwKKyAgICAgICAgICAgICggcG5vUmVxdWVzdC5hTmV0d29ya3NbaV0uc3NJZC5sZW5ndGggPiAzMiApICkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBTU0lEIExlbiAlZCBpcyBub3QgY29ycmVjdCBmb3IgbmV0d29yayAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHBub1JlcXVlc3QuYU5ldHdvcmtzW2ldLnNzSWQubGVuZ3RoLCBpKTsKKyAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICBnb3RvIGVycm9yOworICAgICAgICB9CisKKyAgICAgICAgbWVtY3B5KHBub1JlcXVlc3QuYU5ldHdvcmtzW2ldLnNzSWQuc3NJZCwKKyAgICAgICAgICAgICAgIHJlcXVlc3QtPm1hdGNoX3NldHNbaV0uc3NpZC5zc2lkLAorICAgICAgICAgICAgICAgcmVxdWVzdC0+bWF0Y2hfc2V0c1tpXS5zc2lkLnNzaWRfbGVuKTsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAg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wID09IG1lbWNtcChwbm9SZXF1ZXN0LmFOZXR3b3Jrc1tqXS5zc0lkLnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC0+c3NpZHNbaV0uc3NpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbm9SZXF1ZXN0LmFOZXR3b3Jrc1tqXS5zc0lkLmxlbmd0aCkpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBub1JlcXVlc3QuYU5ldHdvcmtzW2pdLmJjYXN0TmV0d1R5cGUgPSBlQkNBU1RfSElEREVOOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaisrOworICAgICAgICB9CisgICAgfQorICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICJOdW1iZXIgb2YgaGlkZGVuIG5ldHdvcmtzIGJlaW5nIENvbmZpZ3VyZWQgPSAlZCIsCisgICAgICAgICAgICAgIHJlcXVlc3QtPm5fc3NpZHMpOworICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICJyZXF1ZXN0LT5pZV9sZW4gPSAlenUiLCByZXF1ZXN0LT5pZV9sZW4pOworCisgICAgcG5vUmVxdWVzdC5wMjRHUHJvYmVUZW1wbGF0ZSA9IHZvc19tZW1fbWFsbG9jKFNJUl9QTk9fTUFYX1BCX1JFUV9TSVpFKTsKKyAgICBpZiAocG5vUmVxdWVzdC5wMjRHUHJvYmVUZW1wbGF0ZSA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICBGTCgiZmFpbGVkIHRvIGFsbG9jYXRlIG1lbW9yeSBwMjRHUHJvYmVUZ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RpbWVycy51Y1NjYW5UaW1lcnNDb3VudCA9IEhERF9QTk9fU0NBTl9USU1FUlNfU0VUX09ORTsKKyAgICBlbHNlCisgICAgICAgIHBub1JlcXVlc3Quc2NhblRpbWVycy51Y1NjYW5UaW1lcnNDb3VudCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhERF9QTk9fU0NBTl9USU1FUlNfU0VUX01VTFRJUExFOworCisgICAgdGVtcEludGVydmFsID0gKHJlcXVlc3QtPmludGVydmFsKS8xMDAwOworICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICJCYXNlIHNjYW4gaW50ZXJ2YWwgPSAlZCBQTk9TY2FuVGltZXJSZXBlYXRWYWx1ZSA9ICVkIiwKKyAgICAgICAgICAgICAgdGVtcEludGVydmFsLCBwSGRkQ3R4LT5jZmdfaW5pLT5jb25maWdQTk9TY2FuVGltZXJSZXBlYXRWYWx1ZSk7CisgICAgZm9yICggaSA9IDA7IGkgPCBwbm9SZXF1ZXN0LnNjYW5UaW1lcnMudWNTY2FuVGltZXJzQ291bnQ7IGkrKykKKyAgICB7CisgICAgICAgIHBub1JlcXVlc3Quc2NhblRpbWVycy5hVGltZXJWYWx1ZXNbaV0udVRpbWVyUmVwZWF0ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPmNmZ19pbmktPmNvbmZpZ1BOT1NjYW5UaW1lclJlcGVhdFZhbHVlOworICAgICAgICBwbm9SZXF1ZXN0LnNjYW5UaW1lcnMuYVRpbWVyVmFsdWVzW2ldLnVUaW1lclZhbHVlID0gdGVtcEludGVydmFsOworICAgICAgICB0ZW1wSW50ZXJ2YWwgKj0gMjsKKyAgICB9CisgICAgLy9SZXBlYXQgbGFzdCB0aW1lciB1bnRpbCBwbm8gZGlzYWJsZWQuCisgICAgcG5vUmVxdWVzdC5zY2FuV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gc3RhdHVzKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEZhaWxlZCB0byBlbmFibGUgUE5PIiwgX19mdW5jX18pOworICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICBnb3RvIGVycm9yOworICAgIH0KKworICAgIHJldCA9IHdhaXRfZm9yX2NvbXBsZXRpb25fdGltZW91dCgKKyAgICAgICAgICAgICAgICAgJnBBZGFwdGVyLT5wbm9fY29tcF92YXIsCisgICAgICAgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKFdMQU5fV0FJVF9USU1FX1BOTykpOworICAgIGlmICgwID49IHJldCkKKyAgICB7CisgICAgICAgIC8vIERpZCBub3QgcmVjZWl2ZSB0aGUgcmVzcG9uc2UgZm9yIFBOTyBlbmFibGUgaW4gdGltZS4KKyAgICAgICAgLy8gQXNzdW1pbmcgdGhlIFBOTyBlbmFibGUgd2FzIHN1Y2Nlc3MuCisgICAgICAgIC8vIFJldHVybmluZyBlcnJvciBmcm9tIGhlcmUsIGJlY2F1c2Ugd2UgdGltZW91dCwgcmVzdWx0cworICAgICAgICAvLyBpbiBzaWRlIGVmZmVjdCBvZiBXaWZpIChXaWZpIFNldHRpbmcpIG5vdCB0byB3b3JrLgorICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIEZMKCJUaW1lZCBvdXQgd2FpdGluZyBmb3IgUE5PIHRvIGJlIEVuYWJsZWQiKSk7CisgICAgICAgIHJldCA9IDA7CisgICAgfQorCisgICAgcmV0ID0gcEFkYXB0ZXItPnBub19yZXFfc3RhdHVzOworICAgIHJldHVybiByZXQ7CisKK2Vycm9yOgorICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUN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c3RhdHVzX2NiOworICAgIHBub1JlcXVlc3QuY2FsbGJhY2tDb250ZXh0ID0gcEFkYXB0ZXI7CisgICAgcEFkYXB0ZXItPnBub19yZXFfc3RhdHVzID0gMDsKKyAgICBzdGF0dXMgPSBzbWVfU2V0UHJlZmVycmVkTmV0d29ya0xpc3QoaEhhbCwgJnBub1JlcXVlc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsIHBBZGFwdGVyKTsKKyAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICJGYWlsZWQgdG8gZGlzYWJsZWQgUE5PIik7CisgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorICAgIHJldCA9IHdhaXRfZm9yX2NvbXBsZXRpb25fdGltZW91dCgKKyAgICAgICAgICAgICAgICAgJnBBZGFwdGVyLT5wbm9fY29tcF92YXIsCisgICAgICAgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKFdMQU5fV0FJVF9USU1FX1BOTykpOworICAgIGlmICgwID49IHJldCkKKyAgICB7CisgICAgICAgIC8vIERpZCBub3QgcmVjZWl2ZSB0aGUgcmVzcG9uc2UgZm9yIFBOTyBkaXNhYmxlIGluIHRpbWUuCisgICAgICAgIC8vIEFzc3VtaW5nIHRoZSBQTk8gZGlzYWJsZSB3YXMgc3VjY2Vzcy4KKyAgICAgICAgLy8gUmV0dXJuaW5nIGVycm9yIGZyb20gaGVyZSwgYmVjYXVzZSB3ZSB0aW1lb3V0LCByZXN1bHRzCisgICAgICAgIC8vIGluIHNpZGUgZWZmZWN0IG9mIFdpZmkgKFdpZmkgU2V0dGluZykgbm90IHRvIHdvcmsuCisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgRkwoIlRpbWVkIG91dCB3YWl0aW5nIGZvciBQTk8gdG8gYmUgZGlzYWJsZWQiKSk7CisgICAgICAgIHJldCA9IDA7CisgICAgfQorCisgICAgcmV0ID0gcEFkYXB0ZXItPnBub19yZXFfc3RhdHVzOworICAgIHBIZGRDdHgtPmlzUG5vRW5hYmxlID0gKHJldCA9PSAwKSA/IEZBTFNFIDogVFJVRTsKKworZXJyb3I6CisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgRkwoIlBOTyBzY2FuIGRpc2FibGVkIHJldCA9ICVkIiksIHJldCk7CisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIHJldDsKK30KKworLyoKKyAqIEZVTkNUSU9OOiB3bGFuX2hkZF9jZmc4MDIxMV9zY2hlZF9zY2FuX3N0b3AKKyAqIE5MIGludGVyZmFjZSB0byBkaXNhYmxlIFBOTworICovCitzdGF0aWMgaW50IHdsYW5faGRkX2NmZzgwMjExX3NjaGVkX3NjYW5fc3RvcChzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCit7CisgICAgaW50IHJldDsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX193bGFuX2hkZF9jZmc4MDIxMV9zY2hlZF9zY2FuX3N0b3Aod2lwaHksIGRldik7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKyNlbmRpZiAvKkZFQVRVUkVfV0xBTl9TQ0FOX1BOTyovCisKKworI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisjaWYgVERMU19NR01UX1ZFUlNJT04yCitzdGF0aWMgaW50IF9fd2xhbl9oZGRfY2ZnODAyMTFfdGRsc19tZ210KHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICpwZWVyLCB1OCBhY3Rpb25fY29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggZGlhbG9nX3Rva2VuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MTYgc3RhdHVzX2NvZGUsIHUzMiBwZWVyX2NhcGFiaWxpdHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICpidWYsIHNpemVfdCBsZW4pCisjZWxzZSAvKiBURExTX01HTVRfVkVSU0lPTjIgKi8KKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsIDE3LCAwKSkgfHwgZGVmaW5lZChXSVRIX0JBQ0tQT1JUUykKK3N0YXRpYyBpbnQgX193bGFuX2hkZF9jZmc4MDIxMV90ZGxzX21nbXQoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKnBlZXIsIHU4IGFjdGlvbl9jb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCBkaWFsb2dfdG9rZW4sIHUxNiBzdGF0dXNfY29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTMyIHBlZXJfY2FwYWJpbGl0eSwgYm9vbCBpbml0aWF0b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICpidWYsIHNpemVfdCBsZW4pCisjZWxpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsIDE2LCAwKSkKK3N0YXRpYyBpbnQgX193bGFuX2hkZF9jZmc4MDIxMV90ZGxzX21nbXQoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKnBlZXIsIHU4IGFjdGlvbl9jb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCBkaWFsb2dfdG9rZW4sIHUxNiBzdGF0dXNfY29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTMyIHBlZXJfY2FwYWJpbGl0eSwgY29uc3QgdTggKmJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90IGxlbikKKyNlbGlmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywgMTUsIDApKQorc3RhdGljIGludCBfX3dsYW5faGRkX2NmZzgwMjExX3RkbHNfbWdtdChzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCAqcGVlciwgdTggYWN0aW9uX2NvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4IGRpYWxvZ190b2tlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTE2IHN0YXR1c19jb2RlLCB1MzIgcGVlcl9jYXBhYmlsaXR5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqYnVmLCBzaXplX3QgbGVuKQorI2Vsc2UKK3N0YXRpYyBpbnQgX193bGFuX2hkZF9jZmc4MDIxMV90ZGxzX21nbXQoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggKnBlZXIsIHU4IGFjdGlvbl9jb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCBkaWFsb2dfdG9rZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxNiBzdGF0dXNfY29kZSwgY29uc3QgdTggKmJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90IGxlbikKKyNlbmRpZgorI2VuZGlmCit7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXI7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgICBWT1NfU1RBVFVTIHN0YXR1czsKKyAgICBpbnQgbWF4X3N0YV9mYWlsZWQgPSAwOworICAgIGludCByZXNwb25kZXI7CisgICAgbG9uZyByYzsKKyAgICBpbnQgcmV0OworI2lmICEoVERMU19NR01UX1ZFUlNJT04yKSAmJiAoTElOVVhfVkVSU0lPTl9DT0RFIDwgS0VSTkVMX1ZFUlNJT04oMywxNSwwKSkKKyAgICB1MzIgcGVlcl9jYXBhYmlsaXR5ID0gMDsKKyNlbmRpZgorICAgIHRBTklfVTE2IG51bUN1cnJUZGxzUGVlcnM7CisgICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHggPSBOVUxMOworCisgICAgcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgICBpZiAoTlVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBBZGFwdGVyIGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9IREQsCisgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX0hERF9DRkc4MDIxMV9URExTX01HTVQsCisgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCBhY3Rpb25fY29kZSkpOworCisgICAgcEhkZEN0eCA9IHdpcGh5X3ByaXYod2lwaHkpOworICAgIGlmIChOVUxMID09IHBIZGRDdHggfHwgTlVMTCA9PSBwSGRkQ3R4LT5jZmdfaW5pKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICJJbnZhbGlkIGFyZ3VtZW50cyIpOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBpZiAocEhkZEN0eC0+aXNMb2dwSW5Qcm9ncmVzcykKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczpMT0dQIGluIFByb2dyZXNzLiBJZ25vcmUhISEiLCBfX2Z1bmNfXyk7CisgICAgICAgIHdsYW5faGRkX3RkbHNfc2V0X2xpbmtfc3RhdHVzKHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlVERMU19MSU5LX0lETEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVURExTX0xJTktfVU5TUEVDSUZJRUQpOworICAgICAgICByZXR1cm4gLUVCVVNZOworICAgIH0KKworICAgIGlmIChXTEFOX0hERF9JU19MT0FEX1VOTE9BRF9JTl9QUk9HUkVTUyhwSGRkQ3R4KSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBVbmxvYWRpbmcvTG9hZGluZyBpbiBQcm9ncmVzcy4gSWdub3JlISEhIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVBR0FJTjsKKyAgICB9CisKKyAgICBpZiAoZVRETFNfU1VQUE9SVF9OT1RfRU5BQkxFRCA9PSBwSGRkQ3R4LT50ZGxzX21vZGUpCisgICAgeworICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICIlczogVERMUyBtb2RlIGlzIGRpc2FibGVkIE9SIG5vdCBlbmFibGVkIGluIEZXLiIKKyAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJFU1NfU1RSICIgYWN0aW9uICVkIGRlY2xpbmVkLiIsCisgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBNQUNfQUREUl9BUlJBWShwZWVyKSwgYWN0aW9uX2NvZGUpOworICAgICAgICByZXR1cm4gLUVOT1RTVVBQOworICAgIH0KKworICAgIHBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKworICAgIGlmKCBOVUxMID09IHBIZGRTdGFDdHggKQorICAgIHsKKyAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiJXM6IEhERCBzdGF0aW9uIGNvbnRleHQgTlVMTCAiLF9fZnVuY19fKTsKKyAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICAvKiBTVEEgc2hvdWxkIGJlIGNvbm5lY3RlZCBhbmQgYXV0aGVudGljYXRlZAorICAgICAqIGJlZm9yZSBzZW5kaW5nIGFueSBURExTIGZyYW1lcworICAgICAqLworICAgIGlmICgoZUNvbm5lY3Rpb25TdGF0ZV9Bc3NvY2lhdGVkICE9IHBIZGRTdGFDdHgtPmNvbm5faW5mby5jb25uU3RhdGUpIHx8CisgICAgICAgIChGQUxTRSA9PSBwSGRkU3RhQ3R4LT5jb25uX2luZm8udUlzQXV0aGVudGljYXRlZCkpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIlNUQSBpcyBub3QgY29ubmVjdGVkIG9yIHVuYXV0aGVudGljYXRlZC4gIgorICAgICAgICAgICAgICAgICJjb25uU3RhdGUgJXUsIHVJc0F1dGhlbnRpY2F0ZWQgJXUiLAorICAgICAgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5jb25uU3RhdGUsCisgICAgICAgICAgICAgICAgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLnVJc0F1dGhlbnRpY2F0ZWQpOworICAgICAgICByZXR1cm4gLUVBR0FJTjsKKyAgICB9CisKKyAgICAvKiBvdGhlciB0aGFuIHRlYXJkb3duIGZyYW1lLCBvdGhlciBtZ210IGZyYW1lcyBhcmUgbm90IHNlbnQgaWYgZGlzYWJsZWQgKi8KKyAgICBpZiAoU0lSX01BQ19URExTX1RFQVJET1dOICE9IGFjdGlvbl9jb2RlKQorICAgIHsKKyAgICAgICAvKiBpZiB0ZGxzX21vZGUgaXMgZGlzYWJsZWQgdG8gcmVzcG9uZCB0byBwZWVyJ3MgcmVxdWVzdCAqLworICAgICAgICBpZiAoZVRETFNfU1VQUE9SVF9ESVNBQkxFRCA9PSBwSGRkQ3R4LT50ZGxzX21vZGUpCisgICAgICAgIHsKKyAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICIlczogIiBNQUNfQUREUkVTU19TVFIKKyAgICAgICAgICAgICAgICAgICAgICAgICIgVERMUyBtb2RlIGlzIGRpc2FibGVkLiBhY3Rpb24gJWQgZGVjbGluZWQuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBNQUNfQUREUl9BUlJBWShwZWVyKSwgYWN0aW9uX2NvZGUpOworCisgICAgICAgICAgICAgcmV0dXJuIC1FTk9UU1VQUDsKKyAgICAgICAgfQorCisgICAgICAgIGlmICh2b3NfbWF4X2NvbmN1cnJlbnRfY29ubmVjdGlvbnNfcmVhY2hlZCgpKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sIEZMKCJSZWFjaGVkIG1heCBjb25jdXJyZW50IGNvbm5lY3Rpb25zIikpOworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBpZiAoV0xBTl9JU19URExTX1NFVFVQX0FDVElPTihhY3Rpb25fY29kZSkpCisgICAgeworICAgICAgICBpZiAoTlVMTCAhPSB3bGFuX2hkZF90ZGxzX2lzX3Byb2dyZXNzKHBIZGRDdHgsIHBlZXIsIFRSVUUsIFRSVUUpKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICIlczogIiBNQUNfQUREUkVTU19TVFIKKyAgICAgICAgICAgICAgICAgICAgICAgIiBURExTIHNldHVwIGlzIG9uZ29pbmcuIGFjdGlvbiAlZCBkZWNsaW5lZC4iLAorICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgTUFDX0FERFJfQVJSQVkocGVlciksIGFjdGlvbl9jb2RlKTsKKyAgICAgICAgICAgIHJldHVybiAtRVBFUk07CisgICAgICAgIH0KKyAgICB9CisKKyAgICBpZiAoU0lSX01BQ19URExTX1NFVFVQX1JFUSA9PSBhY3Rpb25fY29kZSB8fAorICAgICAgICBTSVJfTUFDX1RETFNfU0VUVVBfUlNQID09IGFjdGlvbl9jb2RlICkKKyAgICB7CisgICAgICAgIG51bUN1cnJUZGxzUGVlcnMgPSB3bGFuX2hkZF90ZGxzQ29ubmVjdGVkUGVlcnMocEFkYXB0ZXIpOworICAgICAgICBpZiAoSEREX01BWF9OVU1fVERMU19TVEEgPD0gbnVtQ3VyclRkbHNQZWVycykKKyAgICAgICAgeworICAgICAgICAgICAgLyogc3VwcGxpY2FudCBzdGlsbCBzZW5kcyB0ZGxzX21nbXQoU0VUVVBfUkVRKSBldmVuIGFmdGVyCisgICAgICAgICAgICAgICB3ZSByZXR1cm4gZXJyb3IgY29kZSBhdCAnYWRkX3N0YXRpb24oKScuIEhlbmNlIHdlIGhhdmUgdGhpcworICAgICAgICAgICAgICAgY2hlY2sgYWdhaW4gaW4gYWRkdGlvbiB0byBhZGRfc3RhdGlvbigpLgorICAgICAgICAgICAgICAgQW55d2F5LCB0aGVyZSBpcyBubyBoYXJkIHRvIGRvdWJsZS1jaGVjay4gKi8KKyAgICAgICAgICAgIGlmIChTSVJfTUFDX1RETFNfU0VUVVBfUkVRID09IGFjdGlvbl9jb2RlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogIiBNQUNfQUREUkVTU19TVFIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIgVERMUyBNYXggcGVlciBhbHJlYWR5IGNvbm5lY3RlZC4gYWN0aW9uICglZCkgZGVjbGluZWQuIE51bSBvZiBwZWVycyAoJWQpLCBNYXggYWxsb3dlZCAoJWQpLiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgTUFDX0FERFJfQVJSQVkocGVlciksIGFjdGlvbl9jb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtQ3VyclRkbHNQZWVycywgSEREX01BWF9OVU1fVERMU19TVEEpOworICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIG1heGltdW0gcmVhY2hlZC4gdHdlYWsgdG8gc2VuZCBlcnJvciBjb2RlIHRvIHBlZXIgYW5kIHJldHVybgorICAgICAgICAgICAgICAgICAgIGVycm9yIGNvZGUgdG8gc3VwcGxpY2FudCAqLworICAgICAgICAgICAgICAgIHN0YXR1c19jb2RlID0gZVNJUl9NQUNfVU5TUEVDX0ZBSUxVUkVfU1RBVFVTOworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogIiBNQUNfQUREUkVTU19TVFIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIgVERMUyBNYXggcGVlciBhbHJlYWR5IGNvbm5lY3RlZCwgc2VuZCByZXNwb25zZSBzdGF0dXMgKCVkKS4gTnVtIG9mIHBlZXJzICglZCksIE1heCBhbGxvd2VkICglZCkuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBNQUNfQUREUl9BUlJBWShwZWVyKSwgc3RhdHVzX2NvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1DdXJyVGRsc1BlZXJzLCBIRERfTUFYX05VTV9URExTX1NUQSk7CisgICAgICAgICAgICAgICAgbWF4X3N0YV9mYWlsZWQgPSAtRVBFUk07CisgICAgICAgICAgICAgICAgLyogZmFsbCB0aHJvdWdoIHRvIHNlbmQgc2V0dXAgcmVzcCB3aXRoIGZhaWx1cmUgc3RhdHVzCisgICAgICAgICAgICAgICAgY29kZSAqLworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgaGRkVGRsc1BlZXJfdCAqcFRkbHNQZWVyOworICAgICAgICAgICAgbXV0ZXhfbG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICAgICAgICAgIHBUZGxzUGVlciA9IHdsYW5faGRkX3RkbHNfZmluZF9wZWVyKHBBZGFwdGVyLCBwZWVyLCBGQUxTRSk7CisgICAgICAgICAgICBpZiAocFRkbHNQZWVyICYmIFRETFNfSVNfQ09OTkVDVEVEKHBUZGxzUGVlcikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICIlczoiIE1BQ19BRERSRVNTX1NUUiAiIGFscmVhZHkgY29ubmVjdGVkLiBhY3Rpb24gJWQgZGVjbGluZWQuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBNQUNfQUREUl9BUlJBWShwZWVyKSwgYWN0aW9uX2NvZGUpOworICAgICAgICAgICAgICAgIHJldHVybiAtRVBFUk07CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICIlczogIiBNQUNfQUREUkVTU19TVFIgIiBhY3Rpb24gJWQsIGRpYWxvZ190b2tlbiAlZCBzdGF0dXMgJWQsIGxlbiA9ICV6dSIsCisgICAgICAgICAgICAgICAidGRsc19tZ210IiwgTUFDX0FERFJfQVJSQVkocGVlciksCisgICAgICAgICAgICAgICBhY3Rpb25fY29kZSwgZGlhbG9nX3Rva2VuLCBzdGF0dXNfY29kZSwgbGVuKTsKKworICAgIC8qRXhjZXB0IHRlYXJkb3duIHJlc3BvbmRlciB3aWxsIG5vdCBiZSB1c2VkIHNvIGp1c3QgbWFrZSAwKi8KKyAgICByZXNwb25kZXIgPSAwOworICAgIGlmIChTSVJfTUFDX1RETFNfVEVBUkRPV04gPT0gYWN0aW9uX2NvZGUpCisgICAgeworCisgICAgICAgaGRkVGRsc1BlZXJfdCAqcFRkbHNQZWVyOworCisgICAgICAgbXV0ZXhfbG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICAgICBwVGRsc1BlZXIgPSB3bGFuX2hkZF90ZGxzX2ZpbmRfcGVlcihwQWRhcHRlciwgcGVlciwgRkFMU0UpOworCisgICAgICAgaWYocFRkbHNQZWVyICYmIFRETFNfSVNfQ09OTkVDVEVEKHBUZGxzUGVlcikpCisgICAgICAgICAgICByZXNwb25kZXIgPSBwVGRsc1BlZXItPmlzX3Jlc3BvbmRlcjsKKyAgICAgICBlbHNlCisgICAgICAgeworICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICIlczogIiBNQUNfQUREUkVTU19TVFIgIiBwZWVyIGRvZXNuJ3QgZXhpc3Qgb3Igbm90IGNvbm5lY3RlZCAlZCBkaWFsb2dfdG9rZW4gJWQgc3RhdHVzICVkLCBsZW4gPSAlenUiLAorICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgTUFDX0FERFJfQVJSQVkocGVlciksIChOVUxMID09IHBUZGxzUGVlcikgPyAtMSA6IHBUZGxzUGVlci0+bGlua19zdGF0dXMsCisgICAgICAgICAgICAgICAgICAgICBkaWFsb2dfdG9rZW4sIHN0YXR1c19jb2RlLCBsZW4pOworICAgICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgICAgICAgIHJldHVybiAtRVBFUk07CisgICAgICAgfQorICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICB9CisKKyAgICAvKiBGb3IgZXhwbGljaXQgdHJpZ2dlciBvZiBESVNfUkVRIGNvbWUgb3V0IG9mIEJNUFMgZm9yCisgICAgICAgc3VjY2Vzc2Z1bGx5IHJlY2VpdmluZyBESVNfUlNQIGZyb20gcGVlci4gKi8KKyAgICBpZiAoKFNJUl9NQUNfVERMU19TRVRVUF9SU1AgPT0gYWN0aW9uX2NvZGUpIHx8CisgICAgICAgIChTSVJfTUFDX1RETFNfRElTX1JTUCA9PSBhY3Rpb25fY29kZSkgfHwKKyAgICAgICAgKFNJUl9NQUNfVERMU19ESVNfUkVRID09IGFjdGlvbl9jb2RlKSkKKyAgICB7CisgICAgICAgIGlmIChUUlVFID09IHNtZV9Jc1BtY0JtcHMoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpKSkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICIlczogU2VuZGluZyBmcmFtZSBhY3Rpb25fY29kZSAldS5EaXNhYmxlIEJNUFMiLCBfX2Z1bmNfXywgYWN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Rpb25fY29kZSk7CisgICAgICAgIHJldCA9IC1FQlVTWTsKKyAgICAgICAgZ290byB0eF9mYWlsZWQ7CisgICAgfQorCisgICAgcEFkYXB0ZXItPm1nbXRUeENvbXBsZXRpb25TdGF0dXMgPSBURExTX0NUWF9NQUdJQzsKKyAgICBJTklUX0NPTVBMRVRJT04ocEFkYXB0ZXItPnRkbHNfbWdtdF9jb21wKTsKKworICAgIHN0YXR1cyA9IHNtZV9TZW5kVGRsc01nbXRGcmFtZShXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCBwZWVyLCBhY3Rpb25fY29kZSwgZGlhbG9nX3Rva2VuLAorICAgICAgICAgICAgc3RhdHVzX2NvZGUsIHBlZXJfY2FwYWJpbGl0eSwgKHRBTklfVTggKilidWYsIGxlbiwKKyAgICAgICAgICAgIHJlc3BvbmRlcik7CisKKyAgICBpZiAoVk9TX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogc21lX1NlbmRUZGxzTWdtdEZyYW1lIGZhaWxlZCEiLCBfX2Z1bmNfXyk7CisgICAgICAgIHBBZGFwdGVyLT5tZ210VHhDb21wbGV0aW9uU3RhdHVzID0gRkFMU0U7CisgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgIGdvdG8gdHhfZmFpbGVkOworICAgIH0KKworICAgIGlmICgoU0lSX01BQ19URExTX0RJU19SRVEgPT0gYWN0aW9uX2NvZGUpIHx8CisgICAgICAgIChTSVJfTUFDX1RETFNfRElTX1JTUCA9PSBhY3Rpb25fY29kZSkpCisgICAgeworICAgICAgICAvKiBmb3IgRElTX1JFUS9ESVNfUlNQLCBzdXBwbGljYW50IGRvbid0IGNvbnNpZGVyIHRoZSByZXR1cm4gc3RhdHVzLgorICAgICAgICAgKiBTbyB3ZSBubyBuZWVkIHRvIHdhaXQgZm9yIHRkbHNfbWdtdF9jb21wIGZvciBzZW5kaW5nIGFjayBzdGF0dXMuCisgICAgICAgICAqLworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICIlczogdHggZG9uZSBmb3IgZnJtICV1IiwgX19mdW5jX18sIGFjdGlvbl9jb2RlKTsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICIlczogV2FpdCBmb3IgdGRsc19tZ210X2NvbXAuIFRpbWVvdXQgJXUgbXMiLCBfX2Z1bmNfXywKKyAgICAgICAgICAgIFdBSVRfVElNRV9URExTX01HTVQpOworCisgICAgcmMgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGVfdGltZW91dCgmcEFkYXB0ZXItPnRkbHNfbWdtdF9jb21wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKFdBSVRfVElNRV9URExTX01HTVQpKTsKKworICAgIGlmICgocmMgPD0gMCkgfHwgKFRSVUUgIT0gcEFkYXB0ZXItPm1nbXRUeENvbXBsZXRpb25TdGF0dXMpKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IE1nbXQgVHggQ29tcGxldGlvbiBmYWlsZWQgc3RhdHVzICVsZCBUeENvbXBsZXRpb24gJXUiLAorICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHJjLCBwQWRhcHRlci0+bWdtdFR4Q29tcGxldGlvblN0YXR1cyk7CisgICAgICAgIHBBZGFwdGVyLT5tZ210VHhDb21wbGV0aW9uU3RhdHVzID0gRkFMU0U7CisKKyAgICAgICAgaWYgKHBIZGRDdHgtPmlzTG9ncEluUHJvZ3Jlc3MpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICIlczogTE9HUCBpbiBQcm9ncmVzcy4gSWdub3JlISEhIiwgX19mdW5jX18pOworICAgICAgICAgICAgcmV0dXJuIC1FQUdBSU47CisgICAgICAgIH0KKworICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICBnb3RvIHR4X2ZhaWxlZDsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAiJXM6IE1nbXQgVHggQ29tcGxldGlvbiBzdGF0dXMgJWxkIFR4Q29tcGxldGlvbiAldSIsCisgICAgICAgICAgICAgICAgX19mdW5jX18sIHJjLCBwQWRhcHRlci0+bWdtdFR4Q29tcGxldGlvblN0YXR1cyk7CisgICAgfQorCisgICAgaWYgKG1heF9zdGFfZmFpbGVkKQorICAgIHsKKyAgICAgICAgcmV0ID0gbWF4X3N0YV9mYWlsZWQ7CisgICAgICAgIGdvdG8gdHhfZmFpbGVkOworICAgIH0KKworICAgIGlmIChTSVJfTUFDX1RETFNfU0VUVVBfUlNQID09IGFjdGlvbl9jb2RlKQorICAgIHsKKyAgICAgICAgaWYgKDAgIT0gd2xhbl9oZGRfdGRsc19zZXRfcmVzcG9uZGVyKHBBZGFwdGVyLCBwZWVyLCBUUlVFKSkgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoIkZhaWxlZCB0byBzZXQgVERMUyBy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ID09IGFjdGlvbl9jb2RlKSkKKyAgICAgICAgd2xhbl9oZGRfdGRsc19jaGVja19ibXBzKHBBZGFwdGVyKTsKKyAgICByZXR1cm4gcmV0OworfQorCisjaWYgVERMU19NR01UX1ZFUlNJT04yCitzdGF0aWMgaW50IHdsYW5faGRkX2NmZzgwMjExX3RkbHNfbWdtdChzdHJ1Y3Qgd2lwaHkgKndpcGh5LCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggKnBlZXIsIHU4IGFjdGlvbl9jb2RlLCAgdTggZGlhbG9nX3Rva2VuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTE2IHN0YXR1c19jb2RlLCB1MzIgcGVlcl9jYXBhYmlsaXR5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKmJ1Ziwgc2l6ZV90IGxlbikKKyNlbHNlICAvKiBURExTX01HTVRfVkVSU0lPTjIgKi8KKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTcsMCkpCitzdGF0aWMgaW50IHdsYW5faGRkX2NmZzgwMjExX3RkbHNfbWdtdChzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICpwZWVyLCB1OCBhY3Rpb25fY29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4IGRpYWxvZ190b2tlbiwgdTE2IHN0YXR1c19jb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTMyIHBlZXJfY2FwYWJpbGl0eSwgYm9vbCBpbml0aWF0b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqYnVmLCBzaXplX3QgbGVuKQorI2VsaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE2LDApKQorc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV90ZGxzX21nbXQoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqcGVlciwgdTggYWN0aW9uX2NvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCBkaWFsb2dfdG9rZW4sIHUxNiBzdGF0dXNfY29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUzMiBwZWVyX2NhcGFiaWxpdHksIGNvbnN0IHU4ICpidWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplX3QgbGVuKQorI2VsaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE1LDApKQorc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV90ZGxzX21nbXQoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCAqcGVlciwgdTggYWN0aW9uX2NvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCBkaWFsb2dfdG9rZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MTYgc3RhdHVzX2NvZGUsIHUzMiBwZWVyX2NhcGFiaWxpdHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqYnVmLCBzaXplX3QgbGVuKQorI2Vsc2UKK3N0YXRpYyBpbnQgd2xhbl9oZGRfY2ZnODAyMTFfdGRsc19tZ210KHN0cnVjdCB3aXBoeSAqd2lwaHksIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCAqcGVlciwgdTggYWN0aW9uX2NvZGUsICB1OCBkaWFsb2dfdG9rZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MTYgc3RhdHVzX2NvZGUsIGNvbnN0IHU4ICpidWYsIHNpemVfdCBsZW4pCisjZW5kaWYKKyNlbmRpZgoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworI2lmIFRETFNfTUdNVF9WRVJTSU9OMgorICAgIHJldCA9IF9fd2xhbl9oZGRfY2ZnODAyMTFfdGRsc19tZ210KHdpcGh5LCBkZXYsIHBlZXIsIGFjdGlvbl9jb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpYWxvZ190b2tlbiwgc3RhdHVzX2NvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVlcl9jYXBhYmlsaXR5LCBidWYsIGxlbik7CisjZWxzZSAvKiBURExTX01HTVRfVkVSU0lPTjIgKi8KKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsIDE3LCAwKSkgfHwgZGVmaW5lZChXSVRIX0JBQ0tQT1JUUykKKyAgICByZXQgPSBfX3dsYW5faGRkX2NmZzgwMjExX3RkbHNfbWdtdCh3aXBoeSwgZGV2LCBwZWVyLCBhY3Rpb25fY29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaWFsb2dfdG9rZW4sIHN0YXR1c19jb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBlZXJfY2FwYWJpbGl0eSwgaW5pdGlhdG9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZiwgbGVuKTsKKyNlbGlmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywgMTYsIDApKQorICAgIHJldCA9IF9fd2xhbl9oZGRfY2ZnODAyMTFfdGRsc19tZ210KHdpcGh5LCBkZXYsIHBlZXIsIGFjdGlvbl9jb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpYWxvZ190b2tlbiwgc3RhdHVzX2NvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVlcl9jYXBhYmlsaXR5LCBidWYsIGxlbik7CisjZWxpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsIDE1LCAwKSkKKyAgICByZXQgPSBfX3dsYW5faGRkX2NmZzgwMjExX3RkbHNfbWdtdCh3aXBoeSwgZGV2LCBwZWVyLCBhY3Rpb25fY29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaWFsb2dfdG9rZW4sIHN0YXR1c19jb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBlZXJfY2FwYWJpbGl0eSwgYnVmLCBsZW4pOworI2Vsc2UKKyAgICByZXQgPSBfX3dsYW5faGRkX2NmZzgwMjExX3RkbHNfbWdtdCh3aXBoeSwgZGV2LCBwZWVyLCBhY3Rpb25fY29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaWFsb2dfdG9rZW4sIHN0YXR1c19jb2RlLCBidWYsIGxlbik7CisjZW5kaWYKKyNlbmRpZgorICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKK2ludCB3bGFuX2hkZF90ZGxzX2V4dGN0cmxfY29uZmlnX3BlZXIoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqcGVlciwKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICpwZWVyLAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRkbHNfcmVxX3BhcmFtc190ICp0ZGxzX3BlZXJfcGFyYW1zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZmc4MDIxMV9leHR0ZGxzX2NhbGxiYWNrIGNhbGxiYWNrKQoreworCisgICAgaGRkVGRsc1BlZXJfdCAqcFRkbHNQZWVyID0gTlVMTDsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKyAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAiICVzIDogTkw4MDIxMV9URExTX1NFVFVQIGZvciAiIE1BQ19BRERSRVNTX1NUUiwKKyAgICAgICAgICAgICAgX19mdW5jX18sIE1BQ19BRERSX0FSUkFZKHBlZXIpKTsKKworICAgIGlmICggKEZBTFNFID09IHBIZGRDdHgtPmNmZ19pbmktPmZURExTRXh0ZXJuYWxDb250cm9sKSB8fAorICAgICAgICAgKEZBTFNFID09IHBIZGRDdHgtPmNmZ19pbmktPmZFbmFibGVURExTSW1wbGljaXRUcmlnZ2VyKSApIHsKKworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAiICVzIFRETFMgRXh0ZXJuYWwgY29udHJvbCAoJWQpIGFuZCBJbXBsaWNpdCBUcmlnZ2VyICglZCkgbm90IGVuYWJsZWQgIiwKKyAgICAgICAgICAgICAgX19mdW5jX18sIHBIZGRDdHgtPmNmZ19pbmktPmZURExTRXh0ZXJuYWxDb250cm9sLAorICAgICAgICAgICAgICBwSGRkQ3R4LT5jZmdfaW5pLT5mRW5hYmxlVERMU0ltcGxpY2l0VHJpZ2dlcik7CisgICAgICAgIHJldHVybiAtRU5PVFNVUFA7CisgICAgfQorCisgICAgLyogVG8gY2F0ZXIgdGhlIHJlcXVpcmVtZW50IG9mIGVzdGFibGlzaGluZyB0aGUgVERMUyBsaW5rCisgICAgICogaXJyZXNwZWN0aXZlIG9mIHRoZSBkYXRhIHRyYWZmaWMgLCBnZXQgYW4gZW50cnkgb2YgVERMUyBwZWVyLgorICAgICAqLworICAgIG11dGV4X2xvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgcFRkbHNQZWVyID0gd2xhbl9oZGRfdGRsc19nZXRfcGVlcihwQWRhcHRlciwgcGVlcik7CisgICAgaWYgKHBUZGxzUGVlciA9PSBOVUxMKSB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBwZWVyICIgTUFDX0FERFJFU1NfU1RSICIgbm90IGV4aXN0aW5nIiwKKyAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBNQUNfQUREUl9BUlJBWShwZWVyKSk7CisgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgLyogY2hlY2sgRlcgVERMUyBPZmYgQ2hhbm5lbCBjYXBhYmlsaXR5ICovCisgICAgaWYgKChUUlVFID09IHNtZV9Jc0ZlYXR1cmVTdXBwb3J0ZWRCeUZXKFRETFNfT0ZGX0NIQU5ORUwpKSAmJgorICAgICAgICAoVFJVRSA9PSBwSGRkQ3R4LT5jZmdfaW5pLT5mRW5hYmxlVERMU09mZkNoYW5uZWwpICYmCisgICAgICAgIChOVUxMICE9IHRkbHNfcGVlcl9wYXJhbXMpKQorICAgIHsKKyAgICAgICAgcFRkbHNQZWVyLT5wZWVyUGFyYW1zLmNoYW5uZWwgPSB0ZGxzX3BlZXJfcGFyYW1zLT5jaGFubmVsOworICAgICAgICBwVGRsc1BlZXItPnBlZXJQYXJhbXMuZ2xvYmFsX29wZXJhdGluZ19jbGFzcyA9CisgICAgICAgICAgICAgICAgICAgICAgICAgdGRsc19wZWVyX3BhcmFtcy0+Z2xvYmFsX29wZXJhdGluZ19jbGFzczsKKyAgICAgICAgcFRkbHNQZWVyLT5wZWVyUGFyYW1zLm1heF9sYXRlbmN5X21zID0gdGRsc19wZWVyX3BhcmFtcy0+bWF4X2xhdGVuY3lfbXM7CisgICAgICAgIHBUZGxzUGVlci0+cGVlclBhcmFtcy5taW5fYmFuZHdpZHRoX2ticHMgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGRsc19wZWVyX3BhcmFtcy0+bWluX2JhbmR3aWR0aF9rYnBzOworICAgICAgICAvKiBjaGVjayBjb25maWd1cmVkIGNoYW5uZWwgaXMgdmFsaWQsIG5vbiBkZnMgYW5kCisgICAgICAgICAqIG5vdCBjdXJyZW50IG9wZXJhdGluZyBjaGFubmVsICovCisgICAgICAgIGlmICgoc21lX0lzVGRsc09mZkNoYW5uZWxWYWxpZChXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRkbHNfcGVlcl9wYXJhbXMtPmNoYW5uZWwpKSAmJgorICAgICAgICAgICAgKHBIZGRTdGFDdHgpICYmCisgICAgICAgICAgICAodGRsc19wZWVyX3BhcmFtcy0+Y2hhbm5lbCAhPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLm9wZXJhdGlvbkNoYW5uZWwpKQorICAgICAgICB7CisgICAgICAgICAgICBwVGRsc1BlZXItPmlzT2ZmQ2hhbm5lbENvbmZpZ3VyZWQgPSBUUlVFOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcFRkbHNQZWVyLT5pc09mZkNoYW5uZWxDb25maWd1cmVkID0gRkFMU0U7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IENvbmZpZ3VyZWQgVGRscyBPZmYgQ2hhbm5lbCBpcyBub3QgdmFsaWQiLCBfX2Z1bmNfXyk7CisKKyAgICAgICAgfQorICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgIiVzOiB0ZGxzX29mZl9jaGFubmVsICVkIGlzT2ZmQ2hhbm5lbENvbmZpZ3VyZWQgJWQgIgorICAgICAgICAgICAgICAgICAgImN1cnJlbnQgb3BlcmF0aW5nIGNoYW5uZWwgJWQiLAorICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHBUZGxzUGVlci0+cGVlclBhcmFtcy5jaGFubmVsLAorICAgICAgICAgICAgICAgICAgcFRkbHNQZWVyLT5pc09mZkNoYW5uZWxDb25maWd1cmVkLAorICAgICAgICAgICAgICAgICAgKHBIZGRTdGFDdHggPyBwSGRkU3RhQ3R4LT5jb25uX2luZm8ub3BlcmF0aW9uQ2hhbm5lbCA6IDApKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IFRETFMgb2ZmIGNoYW5uZWwgRlcgY2FwYWJpbGl0eSAlZCwgIgorICAgICAgICAgICAgICAgICAgImhvc3QgY2FwYWIgJWQgb3IgSW52YWxpZCBURExTIFBlZXIgUGFyYW1zIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICBzbWVfSXNGZWF0dXJlU3VwcG9ydGVkQnlGVyhURExTX09GRl9DSEFOTkVMKSwKKyAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPmNmZ19pbmktPmZFbmFibGVURExTT2ZmQ2hhbm5lbCk7CisgICAgfQorCisgICAgaWYgKCAwICE9IHdsYW5faGRkX3RkbHNfc2V0X2ZvcmNlX3BlZXIocEFkYXB0ZXIsIHBlZXIsIFRSVUUpICkgeworCisgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIiAlcyBURExTIEFkZCBGb3JjZSBQZWVyIEZhaWxlZCIsCisgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIC8qRVhUIFRETFMqLworCisgICAgaWYgKCAwICE9IHdsYW5faGRkX3NldF9jYWxsYmFjayhwVGRsc1BlZXIsIGNhbGxiYWNrKSApIHsKKyAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIiAlcyBURExTIHNldCBjYWxsYmFjayBGYWlsZWQiLAorICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKworICAgIHJldHVybigwKTsKKworfQorCitpbnQgd2xhbl9oZGRfdGRsc19leHRjdHJsX2RlY29uZmlnX3BlZXIoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICpwZWVyCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICpwZWVyCisjZW5kaWYKKykKK3sKKworICAgIGhkZFRkbHNQZWVyX3QgKnBUZGxzUGVlcjsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgIiAlcyA6IE5MODAyMTFfVERMU19URUFSRE9XTiBmb3IgIiBNQUNfQUREUkVTU19TVFIsCisgICAgICAgICAgICAgIF9fZnVuY19fLCBNQUNfQUREUl9BUlJBWShwZWVyKSk7CisKKyAgICBpZiAoMCAhPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpKSB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJIREQgY29udGV4dCBpcyBOVUxMIikpOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBpZiAoIChGQUxTRSA9PSBwSGRkQ3R4LT5jZmdfaW5pL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yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9NQUNfVERMU19URUFSRE9XTl9VTlNQRUNfUkVBU09OKTsKKyAgICAgICAgLyogaWYgY2hhbm5lbCBzd2l0Y2ggaXMgY29uZmlndXJlZCwgcmVzZXQKKyAgICAgICAgICAgdGhlIGNoYW5uZWwgZm9yIHRoaXMgcGVlciAqLworICAgICAgICBpZiAoVFJVRSA9PSBwVGRsc1BlZXItPmlzT2ZmQ2hhbm5lbENvbmZpZ3VyZWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBUZGxzUGVlci0+cGVlclBhcmFtcy5jaGFubmVsID0gMDsKKyAgICAgICAgICAgIHBUZGxzUGVlci0+aXNPZmZDaGFubmVsQ29uZmlndXJlZCA9IEZBTFNFOworICAgICAgICB9CisgICAgfQorCisgICAgaWYgKCAwICE9IHdsYW5faGRkX3RkbHNfc2V0X2ZvcmNlX3BlZXIocEFkYXB0ZXIsIHBlZXIsIEZBTFNFKSApIHsKKyAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgiRmFpbGVkIHRvIHNldCBmb3JjZSBwZWVyIikpOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICAvKkVYVCBURExTKi8KKworICAgIGlmICggMCAhPSB3bGFuX2hkZF9zZXRfY2FsbGJhY2socFRkbHNQZWVyLCBOVUxMICkpIHsKKyAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIiAlcyBURExTIHNldCBjYWxsYmFjayBGYWlsZWQiLAorICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKworICAgIHJldHVybigwKTsKK30KK3N0YXRpYyBpbnQgX193bGFuX2hkZF9jZmc4MDIxMV90ZGxzX29wZXIoc3RydWN0IHdpcGh5ICp3aXBoeSwgc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICpwZWVyLAorI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggKnBlZXIsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBubDgwMjExX3RkbHNfb3BlcmF0aW9uIG9wZXIpCit7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gd2lwaHlfcHJpdih3aXBoeSk7CisgICAgaW50IHN0YXR1czsKKyAgICBoZGRUZGxzUGVlcl90ICpwVGRsc1BlZXI7CisKKyAgICBFTlRFUigpOworCisgICAgaWYgKCFwQWRhcHRlcikgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgiSEREIGFkcGF0ZXIgaXMgTlVMTCIpKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX0hERCwKKyAgICAgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfSEREX0NGRzgwMjExX1RETFNfT1BFUiwKKyAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsIG9wZXIpKTsKKyAgICBpZiAoIE5VTEwgPT0gcGVlciApCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIGFyZ3VtZW50cyIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgc3RhdHVzID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSBzdGF0dXMpCisgICAgeworICAgICAgICByZXR1cm4gc3RhdHVzOworICAgIH0KKworCisgICAgaWYoIEZBTFNFID09IHBIZGRDdHgtPmNmZ19pbmktPmZFbmFibGVURExTU3VwcG9ydCB8fAorICAgICAgICBGQUxTRSA9PSBzbWVfSXNGZWF0dXJlU3VwcG9ydGVkQnlGVyhURExTKSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiVERMUyBEaXNhYmxlZCBpbiBJTkkgKCVkKSBPUiBub3QgZW5hYmxlZCBpbiBGVyAoJWQpICIKKyAgICAgICAgICAgICAgICAiQ2Fubm90IHByb2Nlc3MgVERMUyBjb21tYW5kcyIsCisgICAgICAgICAgICAgICAgcEhkZEN0eC0+Y2ZnX2luaS0+ZkVuYWJsZVRETFNTdXBwb3J0LAorICAgICAgICAgICAgICAgIHNtZV9Jc0ZlYXR1cmVTdXBwb3J0ZWRCeUZXKFRETFMpKTsKKyAgICAgICAgcmV0dXJuIC1FTk9UU1VQUDsKKyAgICB9CisKKyAgICBzd2l0Y2ggKG9wZXIpIHsKKyAgICAgICAgY2FzZSBOTDgwMjExX1RETFNfRU5BQkxFX0xJTks6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1NUQVRVUyBzdGF0dXM7CisgICAgICAgICAgICAgICAgbG9uZyByZXQ7CisgICAgICAgICAgICAgICAgdENzclRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zIHRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zOworICAgICAgICAgICAgICAgIFdMQU5fU1RBRGVzY1R5cGUgICAgICAgICBzdGFEZXNjOworICAgICAgICAgICAgICAgIHRBTklfVTE2IG51bUN1cnJUZGxzUGVlcnMgPSAwOworICAgICAgICAgICAgICAgIGhkZFRkbHNQZWVyX3QgKmNvbm5QZWVyID0gTlVMTDsKKyAgICAgICAgICAgICAgICB0QU5JX1U4IHN1cHBDaGFubmVsTGVuID0gMDsKKworICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAiICVzIDogTkw4MDIxMV9URExTX0VOQUJMRV9MSU5LIGZvciAiIE1BQ19BRERSRVNTX1NUUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIE1BQ19BRERSX0FSUkFZKHBlZXIpKTsKKworICAgICAgICAgICAgICAgIHBUZGxzUGVlciA9IHdsYW5faGRkX3RkbHNfZmluZF9wZWVyKHBBZGFwdGVyLCBwZWVyLCBUUlVFKTsKKyAgICAgICAgICAgICAgICBtZW1zZXQoJnN0YURlc2MsIDAsIHNpemVvZihzdGFEZXNjKSk7CisgICAgICAgICAgICAgICAgaWYgKCBOVUxMID09IHBUZGxzUGVlciApIHsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiAiIE1BQ19BRERSRVNTX1NUUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiAob3BlciAlZCkgbm90IGV4c3RpbmcuIGlnbm9yZWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIE1BQ19BRERSX0FSUkFZKHBlZXIpLCAoaW50KW9wZXIpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6ICIgTUFDX0FERFJFU1NfU1RSICIgbGlua19zdGF0dXMgJWQgKCVzKSAiLCAidGRsc19vcGVyIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBlZXIpLCBwVGRsc1BlZXItPmxpbmtfc3RhdHVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIk5MODAyMTFfVERMU19FTkFCTEVfTElOSyIpOworCisgICAgICAgICAgICAgICAgaWYgKCFURExTX1NUQV9JTkRFWF9WQUxJRChwVGRsc1BlZXItPnN0YUlkKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogSW52YWxpZCBTdGFpb24gSW5kZXggJXUgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJFU1NfU1RSICIgZmFpbGVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBwVGRsc1BlZXItPnN0YUlkLCBNQUNfQUREUl9BUlJBWShwZWVyKSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8qIGJlZm9yZSBzdGFydGluZyB0ZGxzIGNvbm5lY3Rpb24sIHNldCB0ZGxzCisgICAgICAgICAgICAgICAgICogb2ZmIGNoYW5uZWwgZXN0YWJsaXNoZWQgc3RhdHVzIHRvIGRlZmF1bHQgdmFsdWUgKi8KKyAgICAgICAgICAgICAgICBwVGRsc1BlZXItPmlzT2ZmQ2hhbm5lbEVzdGFibGlzaGVkID0gRkFMU0U7CisgICAgICAgICAgICAgICAgLyogVERMUyBPZmYgQ2hhbm5lbCwgRGlzYWJsZSB0ZGxzIGNoYW5uZWwgc3dpdGNoLAorICAgICAgICAgICAgICAgICAgIHdoZW4gdGhlcmUgYXJlIG1vcmUgdGhhbiBvbmUgdGRscyBsaW5rICovCisgICAgICAgICAgICAgICAgbnVtQ3VyclRkbHNQZWVycyA9IHdsYW5faGRkX3RkbHNDb25uZWN0ZWRQZWVycyhwQWRhcHRlcik7CisgICAgICAgICAgICAgICAgaWYgKG51bUN1cnJUZGxzUGVlcnMgPT0gMikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qIGdldCBjb25uZWN0ZWQgcGVlciBhbmQgc2VuZCBkaXNhYmxlIHRkbHMgb2ZmIGNoYW4gKi8KKyAgICAgICAgICAgICAgICAgICAgY29ublBlZXIgPSB3bGFuX2hkZF90ZGxzX2dldF9jb25uZWN0ZWRfcGVlcihwQWRhcHRlcik7CisgICAgICAgICAgICAgICAgICAgIGlmICgoY29ublBlZXIpICYmCisgICAgICAgICAgICAgICAgICAgICAgICAoY29ublBlZXItPmlzT2ZmQ2hhbm5lbFN1cHBvcnRlZCA9PSBUUlVFKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgKGNvbm5QZWVyLT5pc09mZkNoYW5uZWxDb25maWd1cmVkID09IFRSVUUpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogTW9yZSB0aGVuIG9uZSBwZWVyIGNvbm5lY3RlZCwgRGlzYWJsZSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlRETFMgY2hhbm5lbCBzd2l0Y2giLCBfX2Z1bmNfXyk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5QZWVyLT5pc09mZkNoYW5uZWxFc3RhYmxpc2hlZCA9IEZBTFNFOworCisgICAgICAgICAgICAgICAgICAgICAgICByZXQgPSBzbWVfU2VuZFRkbHNDaGFuU3dpdGNoUmVxKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5QZWVyLT5wZWVyTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5QZWVyLT5wZWVyUGFyYW1zLmNoYW5uZWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVERMU19PRkZfQ0hBTk5FTF9CV19PRkZTRVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVERMU19DSEFOTkVMX1NXSVRDSF9ESVNBQkxFKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXQgIT0gVk9TX1NUQVRVU19TVUNDRVNTKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJGYWlsZWQgdG8gc2VuZCBURExTIHN3aXRjaCBjaGFubmVsIHJlcXVlc3QiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IE5vIFRETFMgQ29ubmVjdGVkIFBlZXIgb3IgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpc09mZkNoYW5uZWxTdXBwb3J0ZWQgJWQgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpc09mZkNoYW5uZWxDb25maWd1cmVkICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29ublBlZXIgPyAoY29ublBlZXItPmlzT2ZmQ2hhbm5lbFN1cHBvcnRlZCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogLTEpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjb25uUGVlciA/IChjb25uUGVlci0+aXNPZmZDaGFubmVsQ29uZmlndXJlZCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogLTEpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChlVERMU19MSU5LX0NPTk5FQ1RFRCAhPSBwVGRsc1BlZXItPmxpbmtfc3RhdHVzKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKElTX0FEVkFOQ0VfVERMU19FTkFCTEUpIHsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgIT0gd2xhbl9oZGRfdGRsc19nZXRfbGlua19lc3RhYmxpc2hfcGFyYW1zKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlciwgcGVlciwmdGRsc0xpbmtFc3RhYmxpc2hQYXJhbXMpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoIkZhaWxlZCB0byBnZXQgbGluayBlc3RhYmxpc2htZW50IHBhcmFtcyIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIElOSVRfQ09NUExFVElPTihwQWRhcHRlci0+dGRsc19saW5rX2VzdGFibGlzaF9yZXFfY29tcCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldCA9IHNtZV9TZW5kVGRsc0xpbmtFc3RhYmxpc2hQYXJhbXMoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwgcGVlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXQgIT0gVk9TX1NUQVRVU19TVUNDRVNTKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoIkZhaWxlZCB0byBzZW5kIGxpbmsgZXN0YWJsaXNobWVudCBwYXJhbXMiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAvKiBTZW5kIFRETFMgcGVlciBVQVBTRCBjYXBhYmlsaXRpZXMgdG8gdGhlIGZpcm13YXJlIGFuZAorICAgICAgICAgICAgICAgICAgICAgICAgICogcmVnaXN0ZXIgd2l0aCB0aGUgVEwgb24gYWZ0ZXIgdGhlIHJlc3BvbnNlIGZvciB0aGlzIG9wZXJhdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgICogaXMgcmVjZWl2ZWQgLgorICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgICAgICByZXQgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGVfdGltZW91dCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBZGFwdGVyLT50ZGxzX2xpbmtfZXN0YWJsaXNoX3JlcV9jb21wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKFdBSVRfVElNRV9URExTX0xJTktfRVNUQUJMSVNIX1JFUSkpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJldCA8PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiTGluayBFc3RhYmxpc2ggUmVxdWVzdCBGYWlsZWQgU3RhdHVzICVsZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF90ZGxzX3NldF9wZWVyX2xpbmtfc3RhdHVzKHBUZGxzUGVlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlVERMU19MSU5LX0NPTk5FQ1RFRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlVERMU19MSU5LX1NVQ0NFU1MpOworICAgICAgICAgICAgICAgICAgICBzdGFEZXNjLnVjU1RBSWQgPSBwVGRsc1BlZXItPnN0YUlkOworICAgICAgICAgICAgICAgICAgICBzdGFEZXNjLnVjUW9zRW5hYmxlZCA9IHRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zLnFvczsKKyAgICAgICAgICAgICAgICAgICAgcmV0ID0gV0xBTlRMX1VwZGF0ZVRkbHNTVEFDbGllbnQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT5wdm9zQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZzdGFEZXNjKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHJldCAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJGYWlsZWQgdG8gdXBkYXRlIFRETFMgU1RBIHBhcmFtcyIpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIC8qIE1hcmsgVERMUyBjbGllbnQgQXV0aGVudGljYXRlZCAuKi8KKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gV0xBTlRMX0NoYW5nZVNUQVN0YXRlKCBwSGRkQ3R4LT5wdm9zQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVGRsc1BlZXItPnN0YUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9TVEFfQVVUSEVOVElDQVRFRCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChWT1NfU1RBVFVTX1NVQ0NFU1MgPT0gc3RhdHVzKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAocFRkbHNQZWVyLT5pc19yZXNwb25kZXIgPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3Qgc3RhSWQgPSAodl9VOF90KXBUZGxzUGVlci0+c3RhSWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGRsc0Nvbm5JbmZvX3QgKnRkbHNJbmZvOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGRsc0luZm8gPSB3bGFuX2hkZF9nZXRfY29ubl9pbmZvKHBIZGRDdHgsIHN0YUlkKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEluaXRpYWxpemUgaW5pdGlhdG9yIHdhaXQgY2FsbGJhY2sgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfdGltZXJfaW5pdCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwVGRsc1BlZXItPmluaXRpYXRvcldhaXRUaW1lb3V0VGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVElNRVJfVFlQRV9TVywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdsYW5faGRkX3RkbHNfaW5pdGlhdG9yX3dhaXRfY2IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZGxzSW5mbyk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF90ZGxzX3RpbWVyX3Jlc3RhcnQocEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwVGRsc1BlZXItPmluaXRpYXRvcldhaXRUaW1lb3V0VGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0FJVF9USU1FX1RETFNfSU5JVElBVE9SKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBzdXNwZW5kIGluaXRpYXRvciBUWCB1bnRpbCBpdCByZWNlaXZlcyBkaXJlY3QgcGFja2V0IGZyb20gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVwb25kZXIgb3IgV0FJVF9USU1FX1RETFNfSU5JVElBVE9SIHRpbWVyIGV4cGlyZXMgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXQgPSBXTEFOVExfU3VzcGVuZERhdGFUeCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+cHZvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZzdGFJZCwgTlVMTCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJldCAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJGYWlsZWQgdG8gc3VzcGVuZCBkYXRhIHR4IikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgICgoVFJVRSA9PSBwVGRsc1BlZXItPmlzT2ZmQ2hhbm5lbFN1cHBvcnRlZCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFRSVUUgPT0gcFRkbHNQZWVyLT5pc09mZkNoYW5uZWxDb25maWd1cmVkKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VwcENoYW5uZWxMZW4gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGRsc0xpbmtFc3RhYmxpc2hQYXJhbXMuc3VwcG9ydGVkQ2hhbm5lbHNMZW47CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChzdXBwQ2hhbm5lbExlbiA+IDApICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc3VwcENoYW5uZWxMZW4gPD0gU0lSX01BQ19NQVhfU1VQUF9DSEFOTkVMUykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggc3VwcFBlZXJDaGFubmVsID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBpID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDBVOyBpIDwgc3VwcENoYW5uZWxMZW47IGkrKykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1cHBQZWVyQ2hhbm5lbCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zLnN1cHBvcnRlZENoYW5uZWxzW2ldOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVGRsc1BlZXItPmlzT2ZmQ2hhbm5lbFN1cHBvcnRlZCA9IEZBTFNFOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN1cHBQZWVyQ2hhbm5lbCA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZGxzUGVlci0+cGVlclBhcmFtcy5jaGFubmVsKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZGxzUGVlci0+aXNPZmZDaGFubmVsU3VwcG9ydGVkID0gVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRkbHNQZWVyLT5pc09mZkNoYW5uZWxTdXBwb3J0ZWQgPSBGQUxTRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFRETFMgY2hhbm5lbCBzd2l0Y2ggcmVxdWVzdCBmb3IgY2hhbm5lbCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVkIGlzT2ZmQ2hhbm5lbENvbmZpZ3VyZWQgJWQgc3VwcENoYW5uZWxMZW4gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlZCBpc09mZkNoYW5uZWxTdXBwb3J0ZWQgJWQiLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVGRsc1BlZXItPnBlZXJQYXJhbXMuY2hhbm5lbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVGRsc1BlZXItPmlzT2ZmQ2hhbm5lbENvbmZpZ3VyZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VwcENoYW5uZWxMZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRkbHNQZWVyLT5pc09mZkNoYW5uZWxTdXBwb3J0ZWQpOworCisgICAgICAgICAgICAgICAgICAgICAgICAvKiBURExTIE9mZiBDaGFubmVsLCBFbmFibGUgdGRscyBjaGFubmVsIHN3aXRjaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoZW4gdGhlaXIgaXMgb25seSBvbmUgdGRscyBsaW5rIGFuZCBpdCBzdXBwb3J0cyAqLworICAgICAgICAgICAgICAgICAgICAgICAgbnVtQ3VyclRkbHNQZWVycyA9IHdsYW5faGRkX3RkbHNDb25uZWN0ZWRQZWVycyhwQWRhcHRlcik7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG51bUN1cnJUZGxzUGVlcnMgPT0gMSkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoVFJVRSA9PSBwVGRsc1BlZXItPmlzT2ZmQ2hhbm5lbFN1cHBvcnRlZCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoVFJVRSA9PSBwVGRsc1BlZXItPmlzT2ZmQ2hhbm5lbENvbmZpZ3VyZWQpKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBTZW5kIFRETFMgY2hhbm5lbCBzd2l0Y2ggcmVxdWVzdCBmb3IgY2hhbm5lbCAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHBUZGxzUGVlci0+cGVlclBhcmFtcy5jaGFubmVsKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZGxzUGVlci0+aXNPZmZDaGFubmVsRXN0YWJsaXNoZWQgPSBUUlVFOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldCA9IHNtZV9TZW5kVGRsc0NoYW5Td2l0Y2hSZXEoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVGRsc1BlZXItPnBlZXJNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZGxzUGVlci0+cGVlclBhcmFtcy5jaGFubmVsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBURExTX09GRl9DSEFOTkVMX0JXX09GRlNFVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVERMU19DSEFOTkVMX1NXSVRDSF9FTkFCTEUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXQgIT0gVk9TX1NUQVRVU19TVUNDRVNTKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgiVERMUyBvZmZjaGFubmVsOiBGYWlsZWQgdG8gc2VuZCBURExTIHN3aXRjaCBjaGFubmVsIHJlcSIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogVERMUyBjaGFubmVsIHN3aXRjaCByZXF1ZXN0IG5vdCBzZW50IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIG51bUN1cnJUZGxzUGVlcnMgJWQgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaXNPZmZDaGFubmVsU3VwcG9ydGVkICVkICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImlzT2ZmQ2hhbm5lbENvbmZpZ3VyZWQgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgbnVtQ3VyclRkbHNQZWVycywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRkbHNQZWVyLT5pc09mZkNoYW5uZWxTdXBwb3J0ZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZGxzUGVlci0+aXNPZmZDaGFubmVsQ29uZmlndXJlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF90ZGxzX2NoZWNrX2JtcHMocEFkYXB0ZXIpOworCisgICAgICAgICAgICAgICAgICAgIC8qIFVwZGF0ZSBUTCBhYm91dCB0aGUgVUFQU0QgbWFza3MgLCB0byByb3V0ZSB0aGUgcGFja2V0cyB0byBmaXJtd2FyZSAqLworICAgICAgICAgICAgICAgICAgICBpZiAoKFRSVUUgPT0gcEhkZEN0eC0+Y2ZnX2luaS0+ZkVuYWJsZVRETFNCdWZmZXJTdGEpCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBwSGRkQ3R4LT5jZmdfaW5pLT5mVERMU1VhcHNkTWFzayApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBhYzsKKyAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQ4IHVjQWNbNF0gPSB7IFdMQU5UTF9BQ19WTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9BQ19WSSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9BQ19CSywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9BQ19CRSB9OworICAgICAgICAgICAgICAgICAgICAgICAgdWludDggdGxUaWRbNF0gPSB7IDcsIDUsIDIsIDMgfSA7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IoYWM9MDsgYWMgPCA0OyBhYysrKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IFdMQU5UTF9FbmFibGVVQVBTREZvckFDKCAoV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcikpLT5wdm9zQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZGxzUGVlci0+c3RhSWQsIHVjQWNbYWNdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGxUaWRbYWNdLCB0bFRpZFthY10sIDAsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfQklfRElSICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoIkZhaWxlZCB0byBlbmFibGUgVUFQU0QgZm9yIEFDIikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE5MODAyMTFfVERMU19ESVNBQkxFX0xJTks6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdEFOSV9VMTYgbnVtQ3VyclRkbHNQZWVycyA9IDA7CisgICAgICAgICAgICAgICAgaGRkVGRsc1BlZXJfdCAqY29ublBlZXIgPSBOVUxMOworCisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICIgJXMgOiBOTDgwMjExX1RETFNfRElTQUJMRV9MSU5LIGZvciAiIE1BQ19BRERSRVNTX1NUUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIE1BQ19BRERSX0FSUkFZKHBlZXIpKTsKKworICAgICAgICAgICAgICAgIG11dGV4X2xvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgICAgICAgICAgICAgcFRkbHNQZWVyID0gd2xhbl9oZGRfdGRsc19maW5kX3BlZXIocEFkYXB0ZXIsIHBlZXIsIEZBTFNFKTsKKworCisgICAgICAgICAgICAgICAgaWYgKCBOVUxMID09IHBUZGxzUGVlciApIHsKKyAgICAgICAgICAgICAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6ICIgTUFDX0FERFJFU1NfU1RSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiIChvcGVyICVkKSBub3QgZXhzdGluZy4gaWdub3JlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgTUFDX0FERFJfQVJSQVkocGVlciksIChpbnQpb3Blcik7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogIiBNQUNfQUREUkVTU19TVFIgIiBsaW5rX3N0YXR1cyAlZCAoJXMpICIsICJ0ZGxzX29wZXIiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocGVlciksIHBUZGxzUGVlci0+bGlua19zdGF0dXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiTkw4MDIxMV9URExTX0RJU0FCTEVfTElOSyIpOworCisgICAgICAgICAgICAgICAgaWYoVERMU19TVEFfSU5ERVhfVkFMSUQocFRkbHNQZWVyLT5zdGFJZCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBsb25nIHN0YXR1czsKKworICAgICAgICAgICAgICAgICAgICAvKiBzZXQgdGRscyBvZmYgY2hhbm5lbCBzdGF0dXMgdG8gZmFsc2UgZm9yIHRoaXMgcGVlciAqLworICAgICAgICAgICAgICAgICAgICBwVGRsc1BlZXItPmlzT2ZmQ2hhbm5lbEVzdGFibGlzaGVkID0gRkFMU0U7CisgICAgICAgICAgICAgICAgICAgIHdsYW5faGRkX3RkbHNfc2V0X3BlZXJfbGlua19zdGF0dXMocFRkbHNQZWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVRETFNfTElOS19URUFSSU5HLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBUZGxzUGVlci0+bGlua19zdGF0dXMgPT0gZVRETFNfTElOS19URUFSSU5HKT8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVURExTX0xJTktfVU5TUEVDSUZJRUQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlVERMU19MSU5LX0RST1BQRURfQllfUkVNT1RFKTsKKyAgICAgICAgICAgICAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworCisgICAgICAgICAgICAgICAgICAgIElOSVRfQ09NUExFVElPTihwQWRhcHRlci0+dGRsc19kZWxfc3RhdGlvbl9jb21wKTsKKworICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBzbWVfRGVsZXRlVGRsc1BlZXJTdGEoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwgcGVlciApOworICAgICAgICAgICAgICAgICAgICBpZiAoc3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUykgeworICAgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoIkZhaWxlZCB0byBkZWxldGUgVERMUyBwZWVyIFNUQSIpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IHdhaXRfZm9yX2NvbXBsZXRpb25faW50ZXJydXB0aWJsZV90aW1lb3V0KCZwQWRhcHRlci0+dGRsc19kZWxfc3RhdGlvbl9jb21wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcyhXQUlUX1RJTUVfVERMU19ERUxfU1RBKSk7CisKKyAgICAgICAgICAgICAgICAgICAgbXV0ZXhfbG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICAgICAgICAgICAgICAgICAgcFRkbHNQZWVyID0gd2xhbl9oZGRfdGRsc19maW5kX3BlZXIocEFkYXB0ZXIsIHBlZXIsIEZBTFNFKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCBOVUxMID09IHBUZGxzUGVlciApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogIiBNQUNfQUREUkVTU19TVFIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBwZWVyIHdhcyBmcmVlZCBpbiBvdGhlciBjb250ZXh0IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIE1BQ19BRERSX0FSUkFZKHBlZXIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgd2xhbl9oZGRfdGRsc19zZXRfcGVlcl9saW5rX3N0YXR1cyhwVGRsc1BlZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVRETFNfTElOS19JRExFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVURExTX0xJTktfVU5TUEVDSUZJRUQpOworICAgICAgICAgICAgICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1cyA8PSAwKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IERlbCBzdGF0aW9uIGZhaWxlZCBzdGF0dXMgJWxkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgc3RhdHVzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRVBFUk07CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvKiBURExTIE9mZiBDaGFubmVsLCBFbmFibGUgdGRscyBjaGFubmVsIHN3aXRjaCwKKyAgICAgICAgICAgICAgICAgICAgICAgd2hlbiB0aGVpciBpcyBvbmx5IG9uZSB0ZGxzIGxpbmsgYW5kIGl0IHN1cHBvcnRzICovCisgICAgICAgICAgICAgICAgICAgIG51bUN1cnJUZGxzUGVlcnMgPSB3bGFuX2hkZF90ZGxzQ29ubmVjdGVkUGVlcnMocEFkYXB0ZXIpOworICAgICAgICAgICAgICAgICAgICBpZiAobnVtQ3VyclRkbHNQZWVycyA9PSAxKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjQWRkciBwZWVyTWFjOworICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNoYW5uZWw7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIG11dGV4X2xvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgICAgICAgICAgICAgICAgICAgICBjb25uUGVlciA9IHdsYW5faGRkX3RkbHNfZ2V0X2Nvbm5lY3RlZF9wZWVyKHBBZGFwdGVyKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbm5QZWVyID09IE5VTEwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlcyBjb25uUGVlciBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocGVlck1hYywgY29ublBlZXItPnBlZXJNYWMsIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbCA9IGNvbm5QZWVyLT5wZWVyUGFyYW1zLmNoYW5uZWw7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogVERMUyBjaGFubmVsIHN3aXRjaCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpc09mZkNoYW5uZWxTdXBwb3J0ZWQgJWQgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaXNPZmZDaGFubmVsQ29uZmlndXJlZCAlZCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpc09mZkNoYW5uZWxFc3RhYmxpc2hlZCAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29ublBlZXIgPyBjb25uUGVlci0+aXNPZmZDaGFubmVsU3VwcG9ydGVkIDogLTEpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29ublBlZXIgPyBjb25uUGVlci0+aXNPZmZDaGFubmVsQ29uZmlndXJlZCA6IC0xKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbm5QZWVyID8gY29ublBlZXItPmlzT2ZmQ2hhbm5lbEVzdGFibGlzaGVkIDogLTEpKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjb25uUGVlcikgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29ublBlZXItPmlzT2ZmQ2hhbm5lbFN1cHBvcnRlZCA9PSBUUlVFKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjb25uUGVlci0+aXNPZmZDaGFubmVsQ29uZmlndXJlZCA9PSBUUlVFKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25uUGVlci0+aXNPZmZDaGFubmVsRXN0YWJsaXNoZWQgPSBUUlVFOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBzbWVfU2VuZFRkbHNDaGFuU3dpdGNoUmVxKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBlZXJNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRETFNfT0ZGX0NIQU5ORUxfQldfT0ZGU0VULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBURExTX0NIQU5ORUxfU1dJVENIX0VOQUJMRSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoIkZhaWxlZCB0byBzZW5kIFRETFMgc3dpdGNoIGNoYW5uZWwgcmVxIikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogVERMUyBjaGFubmVsIHN3aXRjaCByZXF1ZXN0IG5vdCBzZW50ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibnVtQ3VyclRkbHNQZWVycyAlZCAiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBudW1DdXJyVGRsc1BlZXJzKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBURExTIFBlZXIgU3RhdGlvbiBkb2Vzbid0IGV4aXN0LiIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBOTDgwMjExX1RETFNfVEVBUkRPV046CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gd2xhbl9oZGRfdGRsc19leHRjdHJsX2RlY29uZmlnX3BlZXIocEFkYXB0ZXIsIHBlZXIpOworCisgICAgICAgICAgICAgICAgaWYgKDAgIT0gc3RhdHVzKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJFcnJvciBpbiBURExTIFRlYXJkb3duIikpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3RhdHVzOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgY2FzZSBOTDgwMjExX1RETFNfU0VUVVA6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gd2xhbl9oZGRfdGRsc19leHRjdHJsX2NvbmZpZ19wZWVyKHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMKTsKKworICAgICAgICAgICAgICAgIGlmICgwICE9IHN0YXR1cykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiRXJyb3IgaW4gVERMUyBTZXR1cCIpKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIGNhc2UgTkw4MDIxMV9URExTX0RJU0NPVkVSWV9SRVE6CisgICAgICAgICAgICAvKiBXZSBkb24ndCBzdXBwb3J0IGluLWRyaXZlciBzZXR1cC90ZWFyZG93bi9kaXNjb3ZlcnkgKi8KKyAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAiJXM6IERyaXZlciBkb2Vzbid0IHN1cHBvcnQgaW4tZHJpdmVyIHNldHVwL3RlYXJkb3duL2Rpc2NvdmVyeSAiCisgICAgICAgICAgICAgICAgICxfX2Z1bmNfXyk7CisgICAgICAgICAgICByZXR1cm4gLUVOT1RTVVBQOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOiB1bnN1cHBvcnRlZCBldmVudCIsX19mdW5jX18pOworICAgICAgICAgICAgcmV0dXJuIC1FTk9UU1VQUDsKKyAgICB9CisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIDA7Cit9CisKK3N0YXRpYyBpbnQgd2xhbl9oZGRfY2ZnODAyMTFfdGRsc19vcGVyKHN0cnVjdCB3aXBoeSAqd2lwaHksIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKnBlZXIsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggKnBlZXIsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbmw4MDIxMV90ZGxzX29wZXJhdGlvbiBvcGVyKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9fd2xhbl9oZGRfY2ZnODAyMTFfdGRsc19vcGVyKHdpcGh5LCBkZXYsIHBlZXIsIG9wZXIpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKK2ludCB3bGFuX2hkZF9jZmc4MDIxMV9zZW5kX3RkbHNfZGlzY292ZXJfcmVxKHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgIC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ERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICIlczogSEREIGFkYXB0ZXIgaXMgTnVsbCIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIDsKKyAgICB9CisKKyAgICBpZiAoTlVMTCA9PSBwR3RrT2ZmbG9hZEdldEluZm9Sc3ApCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgIiVzOiBwR3RrT2ZmbG9hZEdldEluZm9Sc3AgaXMgTnVsbCIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIDsKKyAgICB9CisKKyAgICBpZiAoVk9TX1NUQVRVU19TVUNDRVNTICE9IHBHdGtPZmZsb2FkR2V0SW5mb1JzcC0+dWxTdGF0dXMpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IHdsYW4gRmFpbGVkIHRvIGdldCByZXBsYXkgY291bnRlciB2YWx1ZSIsCisgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICByZXR1cm4gOworICAgIH0KKworICAgIHBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKyAgICAvKiBVcGRhdGUgcmVwbGF5IGNvdW50ZXIgKi8KKyAgICBwSGRkU3RhQ3R4LT5ndGtPZmZsb2FkUmVxUGFyYW1zLnVsbEtleVJlcGxheUNvdW50ZXIgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwR3RrT2ZmbG9hZEdldEluZm9Sc3AtPnVsbEtleVJlcGxheUNvdW50ZXI7CisKKyAgICB7CisgICAgICAgIC8qIGNoYW5naW5nIGZyb20gbGl0dGxlIHRvIGJpZyBlbmR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9wcml2KHdpcGh5KTsKKyAgICBoZGRfc3RhdGlvbl9jdHhfdCAqcEhkZFN0YUN0eDsKKyAgICB0SGFsSGFuZGxlIGhIYWw7CisgICAgaW50IHJlc3VsdDsKKyAgICB0U2lyR3RrT2ZmbG9hZFBhcmFtcyBoZGRHdGtPZmZsb2FkUmVxUGFyYW1zOworICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKworICAgIEVOVEVSKCk7CisKKyAgICBpZiAoTlVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAiJXM6IEhERCBhZGFwdGVyIGlzIE51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRU5PREVWOworICAgIH0KKworICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9IREQsCisgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX0hERF9DRkc4MDIxMV9TRVRfUkVLRVlfREFUQSwKKyAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkpOworCisgICAgcmVzdWx0ID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSByZXN1bHQpCisgICAgeworICAgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0KKworICAgIHBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKyAgICBoSGFsID0gV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpOworICAgIGlmIChOVUxMID09IGhIYWwpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIF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N1c3BlbmRlZCkKKyAgICB7CisgICAgICAgIC8qIGlmIHdsYW4gaXMgc3VzcGVuZGVkLCBlbmFibGUgR1RLIG9mZmxvYWQgZGlyZWN0bHkgZnJvbSBoZXJlICovCisgICAgICAgIG1lbWNweSgmaGRkR3RrT2ZmbG9hZFJlcVBhcmFtcywgJnBIZGRTdGFDdHgtPmd0a09mZmxvYWRSZXFQYXJhbXMsCisgICAgICAgICAgICAgIHNpemVvZiAodFNpckd0a09mZmxvYWRQYXJhbXMpKTsKKyAgICAgICAgc3RhdHVzID0gc21lX1NldEdUS09mZmxvYWQoaEhhbCwgJmhkZEd0a09mZmxvYWRSZXFQYXJhbXMsCisgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQpOworCisgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICIlczogc21lX1NldEdUS09mZmxvYWQgZmFpbGVkLCByZXR1cm5lZCAlZCIsCisgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBzdGF0dXMpOworCisgICAgICAgICAgIC8qIE5lZWQgdG8gY2xlYXIgYW55IHRyYWNlIG9mIGtleSB2YWx1ZSBpbiB0aGUgbWVtb3J5LgorICAgICAgICAgICAgKiBUaHVzIHplcm8gb3V0IHRoZSBtZW1vcnkgZXZlbiB0aG91Z2ggaXQgaXMgbG9jYWwKKyAgICAgICAgICAgICogdmFyaWFibGUuCisgICAgICAgICAgICAqLworICAgICAgICAgICAgdm9zX21lbV96ZXJvKCZoZGRHdGtPZmZsb2FkUmVxUGFyYW1zLAorICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoaGRkR3RrT2ZmbG9hZFJlcVBhcmFtcykpOworICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgfQorICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICIlczogc21lX1NldEdUS09mZmxvYWQgc3VjY2Vzc2Z1bGwiLCBfX2Z1bmNfXyk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgIiVzOiB3bGFuIG5vdCBzdXNwZW5kZWQgR1RLT2ZmbG9hZCByZXF1ZXN0IGlzIHN0b3JlZCIsCisgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgIH0KKworICAgIC8qIE5lZWQgdG8gY2xlYXIgYW55IHRyYWNlIG9mIGtleSB2YWx1ZSBpbiB0aGUgbWVtb3J5LgorICAgICAqIFRodXMgemVybyBvdXQgdGhlIG1lbW9yeSBldmVuIHRob3VnaCBpdCBpcyBsb2NhbAorICAgICAqIHZhcmlhYmxlLgorICAgICAqLworICAgIHZvc19tZW1femVybygmaGRkR3RrT2ZmbG9hZFJlcVBhcmFtcywKKyAgICAgICAgICAgICAgICAgIHNpemVvZihoZGRHdGtPZmZsb2FkUmVxUGFyYW1zKSk7CisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIGVIQUxfU1RBVFVTX1NVQ0NFU1M7Cit9CisKK2ludCB3bGFuX2hkZF9jZmc4MDIxMV9zZXRfcmVrZXlfZGF0YShzdHJ1Y3Qgd2lwaHkgKndpcGh5LCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBjZmc4MDIxMV9ndGtfcmVrZXlfZGF0YSAqZGF0YSkKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSAgX193bGFuX2hkZF9jZmc4MDIxMV9zZXRfcmVrZXlfZGF0YSh3aXBoeSwgZGV2LCBkYXRhKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorI2VuZGlmIC8qV0xBTl9GRUFUVVJFX0dUS19PRkZMT0FEKi8KKy8qCisgKiBGVU5DVElPTjogX193bGFuX2hkZF9jZmc4MDIxMV9zZXRfbWFjX2FjbAorICogVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHRvIHNldCBhY2Nlc3MgY29udHJvbCBwb2xpY3kKKyAqLworc3RhdGljIGludCBfX3dsYW5faGRkX2NmZzgwMjExX3NldF9tYWNfYWNsKHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHN0cnVjdCBjZmc4MDIxMV9hY2xfZGF0YSAqcGFyYW1zKQoreworICAgIGludCBpOworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyID0gIFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgIGhkZF9ob3N0YXBkX3N0YXRlX3QgKnBIb3N0YXBkU3RhdGU7CisgICAgdHNhcF9Db25maWdfdCAqcENvbmZpZzsKKyAgICB2X0NPTlRFWFRfdCBwVm9zQ29udGV4dCA9IE5VTEw7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgICBpbnQgc3RhdHVzOworCisgICAgRU5URVIoKTsKKworICAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICIlczogSEREIGFkYXB0ZXI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aWVzKTsKKyAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfSERELAorICAgICAgICAgICAgICAgICAgICAgVFJBQ0VfQ09ERV9IRERfQ0ZHODAyMTFfU0VUX01BQ19BQ0wsCisgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCBwQWRhcHRlci0+ZGV2aWNlX21vZGUpKTsKKworICAgIGlmIChXTEFOX0hERF9TT0ZUQVAgPT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKQorICAgIHsKKyAgICAgICAgcENvbmZpZyA9ICZwQWRhcHRlci0+c2Vzc2lvbkN0eC5hcC5zYXBDb25maWc7CisKKyAgICAgICAgLyogZGVmYXVsdCB2YWx1ZSAqLworICAgICAgICBwQ29uZmlnLT5udW1fYWNjZXB0X21hYyA9IDA7CisgICAgICAgIHBDb25maWctPm51bV9kZW55X21hYyA9IDA7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIGFjY2VzcyBjb250cm9sIHBvbGljeQorICAgICAgICAgKiBATkw4MDIxMV9BQ0xfUE9MSUNZX0FDQ0VQVF9VTkxFU1NfTElTVEVEOiBEZW55IHN0YXRpb25zIHdoaWNoIGFyZQorICAgICAgICAgKiAgIGxpc3RlZCBpbiBob3N0YXBkLmRlbnkgZmlsZS4KKyAgICAgICAgICogQE5MODAyMTFfQUNMX1BPTElDWV9ERU5ZX1VOTEVTU19MSVNURUQ6IEFsbG93IHN0YXRpb25zIHdoaWNoIGFyZQorICAgICAgICAgKiAgIGxpc3RlZCBpbiBob3N0YXBkLmFjY2VwdCBmaWxlLgorICAgICAgICAgKi8KKyAgICAgICAgaWYgKE5MODAyMTFfQUNMX1BPTElDWV9ERU5ZX1VOTEVTU19MSVNURUQgPT0gcGFyYW1zLT5hY2xfcG9saWN5KQorICAgICAgICB7CisgICAgICAgICAgICBwQ29uZmlnLT5TYXBNYWNhZGRyX2FjbCA9IGVTQVBfREVOWV9VTkxFU1NfQUNDRVBURUQ7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoTkw4MDIxMV9BQ0xfUE9MSUNZX0FDQ0VQVF9VTkxFU1NfTElTVEVEID09IHBhcmFtcy0+YWNsX3BvbGljeSkKKyAgICAgICAgeworICAgICAgICAgICAgcENvbmZpZy0+U2FwTWFjYWRkcl9hY2wgPSBlU0FQX0FDQ0VQVF9VTkxFU1NfREVOSUVEOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICIlczpBY2wgUG9saWN5IDogJWQgaXMgbm90IHN1cHBvcnRlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBwYXJhbXMtPmFjbF9wb2xpY3kpOworICAgICAgICAgICAgcmV0dXJuIC1FTk9UU1VQUDsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChlU0FQX0RFTllfVU5MRVNTX0FDQ0VQVEVEID09IHBDb25maWctPlNhcE1hY2FkZHJfYWNsKQorICAgICAgICB7CisgICAgICAgICAgICBwQ29uZmlnLT5udW1fYWNjZXB0X21hYyA9IHBhcmFtcy0+bl9hY2xfZW50cmllczsKKyAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwYXJhbXMtPm5fYWNsX2VudHJpZXM7IGkrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgIioqIEFkZCBBQ0wgTUFDIGVudHJ5ICVpIGluIFdoaWxldExpc3QgOiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJFU1NfU1RSLCBpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwYXJhbXMtPm1hY19hZGRyc1tpXS5hZGRyKSk7CisKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnBDb25maWctPmFjY2VwdF9tYWNbaV0sIHBhcmFtcy0+bWFjX2FkZHJzW2ldLmFkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHFjbWFjYWRkcikpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGVTQVBfQUNDRVBUX1VOTEVTU19ERU5JRUQgPT0gcENvbmZpZy0+U2FwTWFjYWRkcl9hY2wpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBDb25maWctPm51bV9kZW55X21hYyA9IHBhcmFtcy0+bl9hY2xfZW50cmllczsKKyAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwYXJhbXMtPm5fYWNsX2VudHJpZXM7IGkrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgIioqIEFkZCBBQ0wgTUFDIGVudHJ5ICVpIGluIEJsYWNrTGlzdCA6IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIsIGksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBhcmFtcy0+bWFjX2FkZHJzW2ldLmFkZHIpKTsKKworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmcENvbmZpZy0+ZGVueV9tYWNbaV0sIHBhcmFtcy0+bWFjX2FkZHJzW2ldLmFkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihxY21hY2FkZHIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmIChWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gV0xBTlNBUF9TZXRNYWNBQ0wocFZvc0NvbnRleHQsIHBDb25maWcpKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBTQVAgU2V0IE1hYyBBY2wgZmFpbCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICIlczogSW52YWxpZCBkZXZpY2VfbW9kZSA9ICVzICglZCkiLAorICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgaGRkX2RldmljZV9tb2RldG9TdHJpbmcocEFkYXB0ZXItPmRldmljZV9tb2RlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV9zZXRfbWFjX2FjbChzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzdHJ1Y3QgY2ZnODAyMTFfYWNsX2RhdGEgKnBhcmFtcykKK3sKKyAgICBpbnQgcmV0OworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX193bGFuX2hkZF9jZmc4MDIxMV9zZXRfbWFjX2FjbCh3aXBoeSwgZGV2LCBwYXJhbXMpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKKyNpZmRlZiBXTEFOX05MODAyMTFfVEVTVE1PREUKKyNpZmRlZiBGRUFUVVJFX1dMQU5fTFBIQgordm9pZCB3bGFuX2hkZF9jZmc4MDIxMV9scGhiX2luZF9oYW5kbGVyCisoCisgICB2b2lkICpwQWRhcHRlciwKKyAgIHZvaWQgKmluZENvbnQKKykKK3sKKyAgIHRTaXJMUEhCSW5kICAgICAqbHBoYkluZDsKKyAgIHN0cnVjdCBza19idWZmICAqc2tiOworICAgaGRkX2NvbnRleHRfdCAgKnBIZGRDdHh0OworCisgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAiTFBIQiBpbmRpY2F0aW9uIGFycml2ZWQiKTsKKworICAgaWYgKHBBZGFwdGVyID09IE5VTEwpCisgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogcEFkYXB0ZXIgaXMgTlVMTFxuIixfX2Z1bmNfXyk7CisgICAgICAgcmV0dXJuOworICAgfQorCisgICBpZiAoTlVMTCA9PSBpbmRDb250KQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIkxQSEIgSU5ELCBpbnZhbGlkIGFyZ3VtZW50Iik7CisgICAgICByZXR1cm47CisgICB9CisKKyAgIHBIZGRDdHh0ICA9IChoZGRfY29udGV4dF90ICopcEFkYXB0ZXI7CisgICBscGhiSW5kID0gKHRTaXJMUEhCSW5kICopaW5kQ29udDsKKyAgIHNrYiA9IGNmZzgwMjExX3Rlc3Rtb2RlX2FsbG9jX2V2ZW50X3NrYigKKyAgICAgICAgICAgICAgICAgIHBIZGRDdHh0LT53aXBoeSwKKyAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTFBIQkluZCksCisgICAgICAgICAgICAgICAgICBHRlBfQVRPTUlDKTsKKyAgIGlmICghc2tiKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgIkxQSEIgdGltZW91dCwgTkwgYnVmZmVyIGFsbG9jIGZhaWwiKTsKKyAgICAgIHJldHVybjsKKyAgIH0KKworICAgaWYobmxhX3B1dF91MzIoc2tiLCBXTEFOX0hERF9UTV9BVFRSX0NNRCwgV0xBTl9IRERfVE1fQ01EX1dMQU5fSEIpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIldMQU5fSEREX1RNX0FUVFJfQ01EIHB1dCBmYWlsIik7CisgICAgICBnb3RvIG5sYV9wdXRfZmFpbHVyZTsKKyAgIH0KKyAgIGlmKG5sYV9wdXRfdTMyKHNrYiwgV0xBTl9IRERfVE1fQVRUUl9UWVBFLCBscGhiSW5kLT5wcm90b2NvbFR5cGUpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIldMQU5fSEREX1RNX0FUVFJfVFlQRSBwdXQgZmFpbCIpOworICAgICAgZ290byBubGFfcHV0X2ZhaWx1cmU7CisgICB9CisgICBpZihubGFfcHV0KHNrYiwgV0xBTl9IRERfVE1fQVRUUl9EQVRBLAorICAgICAgICAgICBzaXplb2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XJzZSh0YiwgV0xBTl9IRERfVE1fQVRUUl9NQVgsIGRhdGEsIGxlbiwgd2xhbl9oZGRfdG1fcG9saWN5KTsKKyAgICBpZiAoZXJyKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXMgVGVzdG1vZGUgSU5WIEFUVFIiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiBlcnI7CisgICAgfQorCisgICAgaWYgKCF0YltXTEFOX0hERF9UTV9BVFRSX0NNRF0pCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlcyBUZXN0bW9kZSBJTlYgQ01EIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfSERELAorICAgICAgICAgICAgICAgICAgICAgVFJBQ0VfQ09ERV9IRERfQ0ZHODAyMTFfVEVTVE1PREUsCisgICAgICAgICAgICAgICAgICAgICBOT19TRVNTSU9OLCBubGFfZ2V0X3UzMih0YltXTEFOX0hERF9UTV9BVFRSX0NNRF0pKSk7CisgICAgc3dpdGNoIChubGFfZ2V0X3UzMih0YltXTEFOX0hERF9UTV9BVFRSX0NNRF0pKQorICAgIHsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fTFBIQgorICAgICAgICAvKiBMb3cgUG93ZXIgSGVhcnRiZWF0IGNvbmZpZ3VyYXRpb24gcmVxdWVzdCAqLworICAgICAgICBjYXNlIFdMQU5fSEREX1RNX0NNRF9XTEFOX0hCOgorICAgICAgICB7CisgICAgICAgICAgICBpbnQgICBidWZfbGVuOworICAgICAgICAgICAgdm9pZCAqYnVmOworICAgICAgICAgICAgdFNpckxQSEJSZXEgKmhiX3BhcmFtcyA9IE5VTEw7CisgICAgICAgICAgICB0U2lyTFBIQlJlcSAqaGJfcGFyYW1zX3RlbXAgPSBOVUxMOworCisgICAgICAgICAgICBpZiAoIXRiW1dMQU5fSEREX1RNX0FUVFJfREFUQV0pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICIlcyBUZXN0bW9kZSBJTlYgREFUQSIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYnVmID0gbmxhX2RhdGEodGJbV0xBTl9IRERfVE1fQVRUUl9EQVRBXSk7CisgICAgICAgICAgICBidWZfbGVuID0gbmxhX2xlbih0YltXTEFOX0hERF9UTV9BVFRSX0RBVEFdKTsKKworICAgICAgICAgICAgaGJfcGFyYW1zX3RlbXAgPSh0U2lyTFBIQlJlcSAqKWJ1ZjsKKyAgICAgICAgICAgIGlmICgoaGJfcGFyYW1zX3RlbXAtPmNtZCA9PSBMUEhCX1NFVF9UQ1BfUEFSQU1TX0lORElEKSAmJgorICAgICAgICAgICAgICAgIChoYl9wYXJhbXNfdGVtcC0+cGFyYW1zLmxwaGJUY3BQYXJhbVJlcS50aW1lUGVyaW9kU2VjID09IDApKQorICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworCisgICAgICAgICAgICBoYl9wYXJhbXMgPSAodFNpckxQSEJSZXEgKil2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpckxQSEJSZXEpKTsKKyAgICAgICAgICAgIGlmIChOVUxMID09IGhiX3BhcmFtcykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzIFJlcXVlc3QgQnVmZmVyIEFsbG9jIEZhaWwiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHZvc19tZW1fY29weShoYl9wYXJhbXMsIGJ1ZiwgYnVmX2xlbik7CisgICAgICAgICAgICBzbWVTdGF0dXMgPSBzbWVfTFBIQkNvbmZpZ1JlcSgodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGJfcGFyYW1zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdsYW5faGRkX2NmZzgwMjExX2xwaGJfaW5kX2hhbmRsZXIpOworICAgICAgICAgICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gc21lU3RhdHVzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgIkxQSEIgQ29uZmlnIEZhaWwsIGRpc2FibGUiKTsKKyAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShoYl9wYXJhbXMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgICB9CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0xQSEIgKi8KKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICIlczogdW5zdXBwb3J0ZWQgZXZlbnQiLF9fZnVuY19fKTsKKyAgICAgICAgICAgIHJldHVybiAtRU9QTk9UU1VQUDsKKyAgICB9CisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIGVycjsKK30KKworc3RhdGljIGludCB3bGFuX2hkZF9jZmc4MDIxMV90ZXN0bW9kZShzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxMiwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHdpcmVsZXNzX2RldiAqd2RldiwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpkYXRhLCBpbnQgbGVuKQoreworICAgaW50IHJldDsKKworICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgIHJldCA9IF9fd2xhbl9oZGRfY2ZnODAyMTFfdGVzdG1vZGUod2lwaHksIGRhdGEsIGxlbik7CisgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgIHJldHVybiByZXQ7Cit9CisjZW5kaWYgLyogQ09ORklHX05MODAyMTFfVEVTVE1PREUgKi8KKworc3RhdGljIGludCBfX3dsYW5faGRkX2NmZzgwMjExX2R1bXBfc3VydmV5KHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBpZHgsIHN0cnVjdCBzdXJ2ZXlfaW5mbyAqc3VydmV5KQoreworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgICBoZGRfc3RhdGlvbl9jdHhfdCAqcEhkZFN0YUN0eDsKKyAgICB0SGFsSGFuZGxlIGhhbEhhbmRsZTsKKyAgICB2X1UzMl90IGNoYW5uZWwgPSAwLCBmcmVxID0gMDsgLyogS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XB0ZXIpOworCisgICAgd2xhbl9oZGRfZ2V0X3NucihwQWRhcHRlciwgJnNucik7CisgICAgd2xhbl9oZGRfZ2V0X3Jzc2kocEFkYXB0ZXIsICZyc3NpKTsKKworICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9IREQsCisgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX0hERF9DRkc4MDIxMV9EVU1QX1NVUlZFWSwKKyAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkpOworICAgIHNtZV9HZXRPcGVyYXRpb25DaGFubmVsKGhhbEhhbmRsZSwgJmNoYW5uZWwsIHBBZGFwdGVyLT5zZXNzaW9uSWQpOworICAgIGhkZF93bGFuX2dldF9mcmVxKGNoYW5uZWwsICZmcmVxKTsKKworCisgICAgZm9yIChpID0gMDsgaSA8IElFRUU4MDIxMV9OVU1fQkFORFM7IGkrKykKKyAgICB7CisgICAgICAgIGlmIChOVUxMID09IHdpcGh5LT5iYW5kc1tpXSkKKyAgICAgICAgeworICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICIlczogd2lwaHktPmJhbmRzW2ldIGlzIE5VTEwsIGkgPSAlZCIsIF9fZnVuY19fLCBpKTsKKyAgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKworICAgICAgICBmb3IgKGogPSAwOyBqIDwgd2lwaHktPmJhbmRzW2ldLT5uX2NoYW5uZWxzOyBqKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIHN0cnVjdCBpZWVlODAyMTFfc3VwcG9ydGVkX2JhbmQgKmJhbmQgPSB3aXBoeS0+YmFuZHNbaV07CisKKyAgICAgICAgICAgIGlmIChiYW5kLT5jaGFubmVsc1tqXS5jZW50ZXJfZnJlcSA9PSAodl9VMTZfdClmcmVxKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN1cnZleS0+Y2hhbm5lbCA9ICZiYW5kLT5jaGFubmVsc1tqXTsKKyAgICAgICAgICAgICAgICAvKiBUaGUgUnggQkRzIGNvbnRhaW4gU05SIHZhbHVlcyBpbiBkQiBmb3IgdGhlIHJlY2VpdmVkIGZyYW1lcworICAgICAgICAgICAgICAgICAqIHdoaWxlIHRoZSBzdXBwbGljYW50IGV4cGVjdHMgbm9pc2UuIFNvIHdlIGNhbGN1bGF0ZSBhbmQKKyAgICAgICAgICAgICAgICAgKiByZXR1cm4gdGhlIHZhbHVlIG9mIG5vaXNlIChkQm0pCisgICAgICAgICAgICAgICAgICogIFNOUiAoZEIpID0gUlNTSSAoZEJtKSAtIE5PSVNFIChkQm0pCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgc3VydmV5LT5ub2lzZSA9IHJzc2kgLSBzbnI7CisgICAgICAgICAgICAgICAgc3VydmV5LT5maWxsZWQgPSBTVVJWRVlfSU5GT19OT0lTRV9EQk07CisgICAgICAgICAgICAgICAgZmlsbGVkID0gMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICB9CisKKyAgICAgaWYgKGZpbGxlZCkKKyAgICAgICAgcEFkYXB0ZXItPnN1cnZleV9pZHggPSAxOworICAgICBlbHNlCisgICAgIHsKKyAgICAgICAgcEFkYXB0ZXItPnN1cnZleV9pZHggPSAwOworICAgICAgICByZXR1cm4gLUVOT05FVDsKKyAgICAgfQorCisgICAgIEVYSVQoKTsKKyAgICAgcmV0dXJuIDA7Cit9CisKK3N0YXRpYyBpbnQgd2xhbl9oZGRfY2ZnODAyMTFfZHVtcF9zdXJ2ZXkoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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0xBTl9IRERfSU5GUkFfU1RBVElPTiA9PSBwQWRhcHRlci0+ZGV2aWNlX21vZGUpICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKDAgIT0gd2xhbl9oZGRfY2ZnODAyMTFfdXBkYXRlX2JzcyhwSGRkQ3R4LT53aXBoeSwgcEFkYXB0ZXIpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBOTyBTQ0FOIHJlc3VsdCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBY3F1aXJlIHdha2Vsb2NrIHRvIGhhbmRsZSB0aGUgY2FzZSB3aGVyZSBBUFAncyB0cmllcyB0bworICAgICAgICAgICAgICAgICAqIHN1c3BlbmQgaW1tZWRpYXRlbHkgYWZ0ZXIgdXBkYXRpbmcgdGhlIHNjYW4gcmVzdWx0cy4gV2hpcworICAgICAgICAgICAgICAgICAqIHJlc3VsdHMgaW4gYXBwJ3MgaXMgaW4gc3VzcGVuZGVkIHN0YXRlIGFuZCBub3QgYWJsZSB0bworICAgICAgICAgICAgICAgICAqIHByb2Nlc3MgdGhlIGNvbm5lY3QgcmVxdWVzdCB0byBBUAorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGhkZF9wcmV2ZW50X3N1c3BlbmRfdGltZW91dCgyMDAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0lGSV9QT1dFUl9FVkVOVF9XQUtFTE9DS19SRVNVTUVfV0xBTik7CisgICAgICAgICAgICAgICAgY2ZnODAyMTFfc2NoZWRfc2Nhbl9yZXN1bHRzKHBIZGRDdHgtPndpcGh5KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgIiVzIDogY2ZnODAyMTEgc2NhbiByZXN1bHQgZGF0YWJhc2UgdXBkYXRlZCIsIF9fZnVuY19fKTsKKworICAgICAgICAgICAgRVhJVCgpOworICAgICAgICAgICAgcmV0dXJuIDA7CisKKyAgICAgICAgfQorICAgICAgICBzdGF0dXMgPSBoZGRfZ2V0X25leHRfYWRhcHRlciAoIHBIZGRDdHgsIHBBZGFwdGVyTm9kZSwgJnBOZXh0ICk7CisgICAgICAgIHBBZGFwdGVyTm9kZSA9IHBOZXh0OworICAgIH0KKworICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgIiVzOiBGYWlsZWQgdG8gZmluZCBBZGFwdGVyIiwgX19mdW5jX18pOworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gMDsKK30KKworaW50IHdsYW5faGRkX2NmZzgwMjExX3Jlc3VtZV93bGFuKHN0cnVjdCB3aXBoeSAqd2lwaHkpCit7CisgICAgaW50IHJldDsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX193bGFuX2hkZF9jZmc4MDIxMV9yZXN1bWVfd2xhbih3aXBoeSk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworLyoKKyAqIEZVTkNUSU9OOiBfX3dsYW5faGRkX2NmZzgwMjExX3N1c3BlbmRfd2xhbgorICogdGhpcyBpcyBjYWxsZWQgd2hlbiBjZmc4MDIxMSBkcml2ZXIgc3VzcGVuZHMKKyAqLworaW50IF9fd2xhbl9oZGRfY2ZnODAyMTFfc3VzcGVuZF93bGFuKHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBjZmc4MDIxMV93b3dsYW4gKndvdykKK3sKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gd2lwaHlfcHJpdih3aXBoeSk7CisgICAgaW50IHJldCA9IDA7CisKKyAgICBFTlRFUigpOworCisgICAgcmV0ID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSByZXQpCisgICAgeworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKworCisgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX0hERCwKKyAgICAgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfSEREX0NGRzgwMjExX1NVU1BFTkRfV0xBTiwKKyAgICAgICAgICAgICAgICAgICAgIE5PX1NFU1NJT04sIHBIZGRDdHgtPmlzV2lwaHlTdXNwZW5kZWQpKTsKKyAgICBwSGRkQ3R4LT5pc1dpcGh5U3VzcGVuZGVkID0gVFJVRTsKKworICAgIEVYSVQoKTsKKworICAgIHJldHVybiAwOworfQorCitpbnQgd2xhbl9oZGRfY2ZnODAyMTFfc3VzcGVuZF93bGFuKHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBjZmc4MDIxMV93b3dsYW4gKndvdykKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX3dsYW5faGRkX2NmZzgwMjExX3N1c3BlbmRfd2xhbih3aXBoeSwgd293KTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorLyogY2ZnODAyMTFfb3BzICovCitzdGF0aWMgc3RydWN0IGNmZzgwMjExX29wcyB3bGFuX2hkZF9jZmc4MDIxMV9vcHMgPQoreworICAgIC5hZGRfdmlydHVhbF9pbnRmID0gd2xhbl9oZGRfY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AgIEVOVEVSKCk7CisKKyAgICBwQWRhcHRlciA9IChoZGRfYWRhcHRlcl90ICopZmlsZS0+cHJpdmF0ZV9kYXRhOworICAgIGlmICgoTlVMTCA9PSBwQWRhcHRlcikgfHwgKFdMQU5fSEREX0FEQVBURVJfTUFHSUMgIT0gcEFkYXB0ZXItPm1hZ2ljKSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIGFkYXB0ZXIgb3IgYWRhcHRlciBoYXMgaW52YWxpZCBtYWdpYy4iLAorICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIGlmICgwICE9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCkpCisgICAgeworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBpZiAoIXNtZV9Jc0ZlYXR1cmVTdXBwb3J0ZWRCeUZXKFdPVykpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogV2FrZS1vbi1XaXJlbGVzcyBmZWF0dXJlIGlzIG5vdCBzdXBwb3J0ZWQgIgorICAgICAgICAgICAgICAgICAgImluIGZpcm13YXJlISIsIF9fZnVuY19fKTsKKworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBpZiAoY291bnQgPiBNQVhfVVNFUl9DT01NQU5EX1NJWkVfV09XTF9FTkFCTEUpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogQ29tbWFuZCBsZW5ndGggaXMgbGFyZ2VyIHRoYW4gJWQgYnl0ZXMuIiwKKyAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBNQVhfVVNFUl9DT01NQU5EX1NJWkVfV09XTF9FTkFCTEUpOworCisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIC8qIEdldCBjb21tYW5kIGZyb20gdXNlciAqLworICAgIGlmIChjb3B5X2Zyb21fdXNlcihjbWQsIGJ1ZiwgY291bnQpKQorICAgICAgICByZXR1cm4gLUVGQVVMVDsKKyAgICBjbWRbY291bnRdID0gJ1wwJzsKKyAgICBzcHRyID0gY21kOworCisgICAgLyogR2V0IGVuYWJsZSBvciBkaXNhYmxlIHdvdyAqLworICAgIHRva2VuID0gc3Ryc2VwKCZzcHRyLCAiICIpOworICAgIGlmICghdG9rZW4pCisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIGlmIChrc3RydG91OCh0b2tlbiwgMCwgJndvd19lbmFibGUpKQorICAgICAgICByZXR1cm4gLUVJTlZBTDsKKworICAgIC8qIERpc2FibGUgd293ICovCisgICAgaWYgKCF3b3dfZW5hYmxlKSB7CisgICAgICAgIGlmICghaGRkX2V4aXRfd293bChwQWRhcHRlciwgZVdPV0xfRVhJVF9VU0VSKSkKKyAgICAgICAgeworICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiJXM6IGhkZF9leGl0X3dvd2wgZmFpbGVkISIsIF9fZnVuY19fKTsKKworICAgICAgICAgIHJldHVybiAtRUZBVUxUOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGNvdW50OworICAgIH0KKworICAgIC8qIEdldCBlbmFibGUgb3IgZGlzYWJsZSBtYWdpYyBwYWNrZXQgbW9kZSAqLworICAgIHRva2VuID0gc3Ryc2VwKCZzcHRyLCAiICIpOworICAgIGlmICghdG9rZW4pCisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIGlmIChrc3RydG91OCh0b2tlbiwgMCwgJndvd19tcCkpCisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIGlmICh3b3dfbXAgPiAxKQorICAgICAgICB3b3dfbXAgPSAxOworCisgICAgLyogR2V0IGVuYWJsZSBvciBkaXNhYmxlIHBhdHRlcm4gYnl0ZSBtYXRjaGluZyBtb2RlICovCisgICAgdG9rZW4gPSBzdHJzZXAoJnNwdHIsICIgIik7CisgICAgaWYgKCF0b2tlbikKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgaWYgKGtzdHJ0b3U4KHRva2VuLCAwLCAmd293X3BibSkpCisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIGlmICh3b3dfcGJtID4gMSkKKyAgICAgICAgd293X3BibSA9IDE7CisKKyAgICBpZiAoIWhkZF9lbnRlcl93b3dsKHBBZGFwdGVyLCB3b3dfbXAsIHdvd19wYm0pKQorICAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogaGRkX2VudGVyX3dvd2wgZmFpbGVkISIsIF9fZnVuY19fKTsKKworICAgICAgcmV0dXJuIC1FRkFVTFQ7CisgICAgfQorICAgIEVYSVQoKTsKKyAgICByZXR1cm4gY291bnQ7Cit9CisKK3N0YXRpYyBzc2l6ZV90IHdjbnNzX3dvd2VuYWJsZV93cml0ZShzdHJ1Y3QgZmlsZSAqZmlsZSwKKyAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgX191c2VyICpidWYsIHNpemVfdCBjb3VudCwgbG9mZl90ICpwcG9zKQoreworICAgIHNzaXplX3QgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX3djbnNzX3dvd2VuYWJsZV93cml0ZShmaWxlLCBidWYsIGNvdW50LCBwcG9zKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgc3NpemVfdCBfX3djbnNzX3dvd3BhdHRlcm5fd3JpdGUoc3RydWN0IGZpbGUgKmZpbGUsCisgICAgICAgICAgICAgICBjb25zdCBjaGFyIF9fdXNlciAqYnVmLCBzaXplX3QgY291bnQsIGxvZmZfdCAqcHBvcykKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcjsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgIGNoYXIgY21kW01BWF9VU0VSX0NPTU1BTkRfU0laRV9XT1dMX1BBVFRFUk4gKyAxXTsKKyAgICBjaGFyICpzcHRyLCAqdG9rZW47CisgICAgdl9VOF90IHBhdHRlcm5faWR4ID0gMDsKKyAgICB2X1U4X3QgcGF0dGVybl9vZmZzZXQgPSAwOworICAgIGNoYXIgKnBhdHRlcm5fYnVmOworICAgIGNoYXIgKnBhdHRlcm5fbWFzazsKKworICAgIEVOVEVSKCk7CisKKyAgICBwQWRhcHRlciA9IChoZGRfYWRhcHRlcl90ICopZmlsZS0+cHJpdmF0ZV9kYXRhOworICAgIGlmICgoTlVMTCA9PSBwQWRhcHRlcikgfHwgKFdMQU5fSEREX0FEQVBURVJfTUFHSUMgIT0gcEFkYXB0ZXItPm1hZ2ljKSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgYWRhcHRlciBvciBhZGFwdGVyIGhhcyBpbnZhbGlkIG1hZ2ljLiIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworCisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgaWYgKDAgIT0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KSkKKyAgICB7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBpZiAoIXNtZV9Jc0ZlYXR1cmVTdXBwb3J0ZWRCeUZXKFdPVykpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgIiVzOiBXYWtlLW9uLVdpcmVsZXNzIGZlYXR1cmUgaXMgbm90IHN1cHBvcnRlZCAiCisgICAgICAgICAgICAgICAgICAgImluIGZpcm13YXJlISIsIF9fZnVuY19fKTsKKworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBpZiAoY291bnQgPiBNQVhfVVNFUl9DT01NQU5EX1NJWkVfV09XTF9QQVRURVJOKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICIlczogQ29tbWFuZCBsZW5ndGggaXMgbGFyZ2VyIHRoYW4gJWQgYnl0ZXMuIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgTUFYX1VTRVJfQ09NTUFORF9TSVpFX1dPV0xfUEFUVEVSTik7CisKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgLyogR2V0IGNvbW1hbmQgZnJvbSB1c2VyICovCisgICAgaWYgKGNvcHlfZnJvbV91c2VyKGNtZCwgYnVmLCBjb3VudCkpCisgICAgICAgIHJldHVybiAtRUZBVUxUOworICAgIGNtZFtjb3VudF0gPSAnXDAnOworICAgIHNwdHIgPSBjbWQ7CisKKyAgICAvKiBHZXQgcGF0dGVybiBpZHggKi8KKyAgICB0b2tlbiA9IHN0cnNlcCgmc3B0ciwgIiAiKTsKKyAgICBpZiAoIXRva2VuKQorICAgICAgICByZXR1cm4gLUVJTlZBTDsKKworICAgIGlmIChrc3RydG91OCh0b2tlbiwgMCwgJnBhdHRlcm5faWR4KSkKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisKKyAgICAvKiBHZXQgcGF0dGVybiBvZmZzZXQgKi8KKyAgICB0b2tlbiA9IHN0cnNlcCgmc3B0ciwgIiAiKTsKKworICAgIC8qIERlbGV0ZSBwYXR0ZXJuIGlmIG5vIGZ1cnRoZXIgYXJndW1lbnQgKi8KKyAgICBpZiAoIXRva2VuKSB7CisgICAgICAgIGhkZF9kZWxfd293bF9wdHJuX2RlYnVnZnMocEFkYXB0ZXIsIHBhdHRlcm5faWR4KTsKKworICAgICAgICByZXR1cm4gY291bnQ7CisgICAgfQorCisgICAgaWYgKGtzdHJ0b3U4KHRva2VuLCAwLCAmcGF0dGVybl9vZmZzZXQpKQorICAgICAgICByZXR1cm4gLUVJTlZBTDsKKworICAgIC8qIEdldCBwYXR0ZXJuICovCisgICAgdG9rZW4gPSBzdHJzZXAoJnNwdHIsICIgIik7CisgICAgaWYgKCF0b2tlbikKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisKKyAgICBwYXR0ZXJuX2J1ZiA9IHRva2VuOworCisgICAgLyogR2V0IHBhdHRlcm4gbWFzayAqLworICAgIHRva2VuID0gc3Ryc2VwKCZzcHRyLCAiICIpOworICAgIGlmICghdG9rZW4pCisgICAgICAgIHJldHVybiAtRUlOVkFMOworCisgICAgcGF0dGVybl9tYXNrID0gdG9rZW47CisgICAgcGF0dGVybl9tYXNrW3N0cmxlbihwYXR0ZXJuX21hc2spIC0gMV0gPSAnXDAnOworCisgICAgaGRkX2FkZF93b3dsX3B0cm5fZGVidWdmcyhwQWRhcHRlciwgcGF0dGVybl9pZHgsIHBhdHRlcm5fb2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0dGVybl9id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EFkYXB0ZXIgPSAoaGRkX2FkYXB0ZXJfdCAqKWZpbGUtPnByaXZhdGVfZGF0YTsKKyAgICBpZiAoKE5VTEwgPT0gcEFkYXB0ZXIpIHx8IChXTEFOX0hERF9BREFQVEVSX01BR0lDICE9IHBBZGFwdGVyLT5tYWdpYykpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIGFkYXB0ZXIgb3IgYWRhcHRlciBoYXMgaW52YWxpZCBtYWdpYy4iLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIGlmICgwICE9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCkpCisgICAgeworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBpZiAoIXNtZV9Jc0ZlYXR1cmVTdXBwb3J0ZWRCeUZXKFdMQU5fUEVSSU9ESUNfVFhfUFRSTikpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgIiVzOiBQZXJpb2RpYyBUeCBQYXR0ZXJuIE9mZmxvYWQgZmVhdHVyZSBpcyBub3Qgc3VwcG9ydGVkICIKKyAgICAgICAgICAgICAgICAgICAiaW4gZmlybXdhcmUhIiwgX19mdW5jX18pOworCisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIC8qIEdldCBjb21tYW5kIGZyb20gdXNlciAqLworICAgIGlmIChjb3VudCA8PSBNQVhfVVNFUl9DT01NQU5EX1NJWkVfRlJBTUUpCisgICAgICAgIGNtZ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geworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgIiVzOiBQYXR0ZXJuIGluZGV4ICVkIGlzIG5vdCBpbiB0aGUgcmFuZ2UgKDAgfiAlZCkuIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcGF0dGVybl9pZHgsIE1BWE5VTV9QRVJJT0RJQ19UWF9QVFJOUyAtIDEpOworCisgICAgICAgIGdvdG8gZmFpbHVyZTsKKyAgICB9CisKKyAgICAvKiBHZXQgcGF0dGVybiBkdXJhdGlvbiAqLworICAgIHRva2VuID0gc3Ryc2VwKCZzcHRyLCAiICIpOworICAgIGlmICghdG9rZW4pCisgICAgICAgIGdvdG8gZmFpbHVyZTsKKyAgICBpZiAoa3N0cnRvdTgodG9rZW4sIDAsICZwYXR0ZXJuX2R1cmF0aW9uKSkKKyAgICAgICAgZ290byBmYWlsdXJlOworCisgICAgLyogRGVsZXRlIHBhdHRlcm4gdXNpbmcgaW5kZXggaWYgZHVyYXRpb24gaXMgMCAqLworICAgIGlmICghcGF0dGVybl9kdXJhdGlvbikKKyAgICB7CisgICAgICAgIGRlbFBlcmlvZGljVHhQdHJuUGFyYW1zID0KKyAgICAgICAgICAgIHZvc19tZW1fbWFsbG9jKHNpemVvZih0U2lyRGVsUGVyaW9kaWNUeFB0cm4pKTsKKyAgICAgICAgaWYgKCFkZWxQZXJpb2RpY1R4UHRyblBhcmFtcykKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBNZW1vcnkgYWxsb2NhdGlvbiBmb3IgZGVsUGVyaW9kaWNUeFB0cm5QYXJhbXMgIgorICAgICAgICAgICAgICAgICAgICAgICJmYWlsZWQhIiwgX19mdW5jX18pOworCisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUoY21kKTsKKyAgICAgICAgICAgIHJldHVybiAtRUZBVUxUOworICAgICAgICB9CisKKyAgICAgICAgZGVsUGVyaW9kaWNUeFB0cm5QYXJhbXMtPnVjUGF0dGVybklkQml0bWFwID0gMSA8PCBwYXR0ZXJuX2lkeDsKKyAgICAgICAgdm9zX21lbV9jb3B5KGRlbFBlcmlvZGljVHhQdHJuUGFyYW1zLT5tYWNBZGRyZXNzLAorICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPm1hY0FkZHJlc3NDdXJyZW50LmJ5dGVzLCA2KTsKKworICAgICAgICAvKiBEZWxldGUgcGF0dGVybiAqLworICAgICAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzbWVfRGVsUGVyaW9kaWNUeFB0cm4ocEhkZEN0eC0+aEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbFBlcmlvZGljVHhQdHJuUGFyYW1zKSkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IHNtZV9EZWxQZXJpb2RpY1R4UHRybigpIGZhaWxlZCEiLCBfX2Z1bmNfXyk7CisKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShkZWxQZXJpb2RpY1R4UHRyblBhcmFtcyk7CisgICAgICAgICAgICBnb3RvIGZhaWx1cmU7CisgICAgICAgIH0KKworICAgICAgICB2b3NfbWVtX2ZyZWUoZGVsUGVyaW9kaWNUeFB0cm5QYXJhbXMpOworICAgICAgICB2b3NfbWVtX2ZyZWUoY21kKTsKKyAgICAgICAgcmV0dXJuIGNvdW50OworICAgIH0KKworICAgIC8qIENoZWNrIGlmIGl0J3MgaW4gY29ubmVjdGVkIHN0YXRlIG9ubHkgd2hlbiBhZGRpbmcgcGF0dGVybnMgKi8KKyAgICBpZiAoIWhkZF9jb25uSXNDb25uZWN0ZWQoV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlcikpKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICIlczogTm90IGluIENvbm5lY3RlZCBzdGF0ZSEiLCBfX2Z1bmNfXyk7CisKKyAgICAgICAgZ290byBmYWlsdXJlOworICAgIH0KKworICAgIC8qIEdldCBwYXR0ZXJuICovCisgICAgdG9rZW4gPSBzdHJzZXAoJnNwdHIsICIgIik7CisgICAgaWYgKCF0b2tlbikKKyAgICAgICAgZ290byBmYWlsdXJlOworCisgICAgcGF0dGVybl9idWYgPSB0b2tlbjsKKyAgICBwYXR0ZXJuX2J1ZltzdHJsZW4ocGF0dGVybl9idWYpIC0gMV0gPSAnXDAnOworICAgIHBhdHRlcm5fbGVuID0gc3RybGVuKHBhdHRlcm5fYnVmKTsKKworICAgIC8qIFNpbmNlIHRoZSBwYXR0ZXJuIGlzIGEgaGV4IHN0cmluZywgMiBjaGFyYWN0ZXJzIHJlcHJlc2VudCAxIGJ5dGUuICovCisgICAgaWYgKHBhdHRlcm5fbGVuICUgMikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiJXM6IE1hbGZvcm1lZCBwYXR0ZXJuISIsIF9fZnVuY19fKTsKKworICAgICAgICBnb3RvIGZhaWx1cmU7CisgICAgfQorICAgIGVsc2UKKyAgICAgICAgcGF0dGVybl9sZW4gPj49IDE7CisKKyAgICBpZiAocGF0dGVybl9sZW4gPCAxNCB8fCBwYXR0ZXJuX2xlbiA+IFBFUklPRElDX1RYX1BUUk5fTUFYX1NJWkUpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgIiVzOiBOb3QgYW4gODAyLjMgZnJhbWUhIiwgX19mdW5jX18pOworCisgICAgICAgIGdvdG8gZmFpbHVyZTsKKyAgICB9CisKKyAgICBhZGRQZXJpb2RpY1R4UHRyblBhcmFtcyA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0U2lyQWRkUGVyaW9kaWNUeFB0cm4pKTsKKyAgICBpZiAoIWFkZFBlcmlvZGljVHhQdHJuUGFyYW1zKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IE1lbW9yeSBhbGxvY2F0aW9uIGZvciBhZGRQZXJpb2RpY1R4UHRyblBhcmFtcyAiCisgICAgICAgICAgICAgICAgICAiZmFpbGVkISIsIF9fZnVuY19fKTsKKworICAgICAgICB2b3NfbWVtX2ZyZWUoY21kKTsKKyAgICAgICAgcmV0dXJuIC1FRkFVTFQ7CisgICAgfQorCisgICAgYWRkUGVyaW9kaWNUeFB0cm5QYXJhbXMtPnVjUHRybklkID0gcGF0dGVybl9pZHg7CisgICAgYWRkUGVyaW9kaWNUeFB0cm5QYXJhbXMtPnVzUHRybkludGVydmFsTXMgPSBwYXR0ZXJuX2R1cmF0aW9uICogNTAwOworICAgIGFkZFBlcmlvZGljVHhQdHJuUGFyYW1zLT51Y1B0cm5TaXplID0gcGF0dGVybl9sZW47CisgICAgdm9zX21lbV9jb3B5KGFkZFBlcmlvZGljVHhQdHJuUGFyYW1zLT5tYWNBZGRyZXNzLAorICAgICAgICAgICAgICAgICBwQWRhcHRlci0+bWFjQWRkcmVzc0N1cnJlbnQuYnl0ZXMsIDYpOworCisgICAgLyogRXh0cmFjdCB0aGUgcGF0dGVybiAqLworICAgIGZvcihpID0gMDsgaSA8IGFkZFBlcmlvZGljVHhQdHJuUGFyYW1zLT51Y1B0cm5TaXplOyBpKyspCisgICAgeworICAgICAgICBhZGRQZXJpb2RpY1R4UHRyblBhcmFtcy0+dWNQYXR0ZXJuW2ldID0KKyAgICAgICAgKGhkZF9wYXJzZV9oZXgocGF0dGVybl9idWZbMF0pIDw8IDQpICsgaGRkX3BhcnNlX2hleChwYXR0ZXJuX2J1ZlsxXSk7CisKKyAgICAgICAgLyogU2tpcCB0byBuZXh0IGJ5dGUgKi8KKyAgICAgICAgcGF0dGVybl9idWYgKz0gMjsKKyAgICB9CisKKyAgICAvKiBBZGQgcGF0dGVybiAqLworICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHNtZV9BZGRQZXJpb2RpY1R4UHRybihwSGRkQ3R4LT5oSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRQZXJpb2RpY1R4UHRyblBhcmFtcykpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgIiVzOiBzbWVfQWRkUGVyaW9kaWNUeFB0cm4oKSBmYWlsZWQhIiwgX19mdW5jX18pOworCisgICAgICAgIHZvc19tZW1fZnJlZShhZGRQZXJpb2RpY1R4UHRyblBhcmFtcyk7CisgICAgICAgIGdvdG8gZmFpbHVyZTsKKyAgICB9CisKKyAgICB2b3NfbWVtX2ZyZWUoYWRkUGVyaW9kaWNUeFB0cm5QYXJhbXMpOworICAgIHZvc19tZW1fZnJlZShjbWQpOworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gY291bnQ7CisKK2ZhaWx1cmU6CisgICAgdm9zX21lbV9mcmVlKGNtZCk7CisgICAgcmV0dXJuIC1FSU5WQUw7Cit9CisKK3N0YXRpYyBzc2l6ZV90IHdjbnNzX3BhdHRlcm5nZW5fd3JpdGUoc3RydWN0IGZ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GhkZF90bUxldmVsQWN0aW9uX3QpKTsKKworCisgICBpZiAocEhkZEN0eC0+dG1JbmZvLnRtQWN0aW9uLmVudGVySW1wcykKKyAgIHsKKyAgICAgIHN0YUFkYXBhdGVyID0gaGRkX2dldF9hZGFwdGVyKHBIZGRDdHgsIFdMQU5fSEREX0lORlJBX1NUQVRJT04pOworICAgICAgaWYgKHN0YUFkYXBhdGVyKQorICAgICAgeworICAgICAgICAgaWYgKGhkZF9jb25uSXNDb25uZWN0ZWQoV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihzdGFBZGFwYXRlcikpKQorICAgICAgICAgeworICAgICAgICAgICAgc21lX1JvYW1EaXNjb25uZWN0KHBIZGRDdHgtPmhIYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhQWRhcGF0ZXItPnNlc3Npb25JZCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ESVNDT05ORUNUX1JFQVNPTl9VTlNQRUNJRklFRCk7CisgICAgICAgICB9CisgICAgICB9CisgICB9CisKKyAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dG1JbmZvLnRtT3BlcmF0aW9uTG9jayk7CisKKyAgIHJldHVybjsKK30KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgIEBicmllZiBSZWdpc3RlciBmdW5jdGlvbgorICAgICAgICBSZWdpc3RlciBUaGVybWFsIE1pdGlnYXRpb24gTGV2ZWwgQ2hhbmdlZCBoYW5kbGUgY2FsbGJhY2sgZnVuY3Rpb24KKworICAgQHBhcmFtIGhkZF9jb250ZXh0X3QgcEhkZEN0eAorICAgICAgICBHbG9iYWwgaGRkIGNvbnRleHQKKworICAgQHJldHVybiBHZW5lcmFsIHN0YXR1cyBjb2RlCisgICAgICAgIFZPU19TVEFUVVNfU1VDQ0VTU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QUw7CisKKyAgIGxpc3RfZGVsKHBOb2RlVG9SZW1vdmUpOyAKKyAgIHBMaXN0LT5jb3VudC0tOworCisgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfQorCitWT1NfU1RBVFVTIGhkZF9saXN0X3BlZWtfZnJvbnQoIGhkZF9saXN0X3QgKnBMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZGRfbGlzdF9ub2RlX3QgKipwcE5vZGUgKQoreworICAgc3RydWN0IGxpc3RfaGVhZCAqIGxpc3RwdHI7CisgICBpZiAoIGxpc3RfZW1wdHkoICZwTGlzdC0+YW5jaG9yICkgKQorICAgeworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9FTVBUWTsKKyAgIH0KKworICAgbGlzdHB0ciA9IHBMaXN0LT5hbmNob3IubmV4dDsKKyAgICpwcE5vZGUgPSBsaXN0cHRyOworICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworVk9TX1NUQVRVUyBoZGRfbGlzdF9wZWVrX25leHQoIGhkZF9saXN0X3QgKnBMaXN0LCBoZGRfbGlzdF9ub2RlX3QgKnBOb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhkZF9saXN0X25vZGVfdCAqKnBwTm9kZSApCit7CisgICBzdHJ1Y3QgbGlzdF9oZWFkICogbGlzdHB0cjsKKyAgIGludCBmb3VuZCA9IDA7CisgICBoZGRfbGlzdF9ub2RlX3QgKnRtcDsKKyAgICAgIAorICAgaWYgKCAoIHBMaXN0ID09IE5VTEwpIHx8ICggcE5vZGUgPT0gTlVMTCkgfHwgKHBwTm9kZSA9PSBOVUxMKSkKKyAgIHsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICB9CisKKyAgIGlmICggbGlzdF9lbXB0eSgmcExpc3QtPmFuY2hvcikgKQorICAgeworICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRU1QVFk7CisgICB9CisKKyAgIC8vIHZlcmlmeSB0aGF0IHBOb2RlIGlzIGluZGVlZCBwYXJ0IG9mIGxpc3QgcExpc3QKKyAgIGxpc3RfZm9yX2VhY2godG1wLCAmcExpc3QtPmFuY2hvcikgCisgICB7CisgICAgIGlmICh0bXAgPT0gcE5vZGUpCisgICAgIHsKKyAgICAgICAgZm91bmQgPSAxOworICAgICAgICBicmVhazsKKyAgICAgfQorICAgfQorCisgICBpZiAoZm91bmQgPT0gMCkKKyAgIHsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICB9CisKKyAgIGxpc3RwdHIgPSBwTm9kZS0+bmV4dDsKKyAgIGlmIChsaXN0cHRyID09ICZwTGlzdC0+YW5jaG9yKQorICAgeworICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRU1QVFk7CisgICB9CisKKyAgICpwcE5vZGUgPSAgbGlzdHB0cjsKKworICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworVk9TX1NUQVRVUyBoZGRfc3RyaW5nX3RvX2hleCggY2hhciAqcFNyY01hYywgaW50IGxlbmd0aCwgY2hhciAqcERlc2NNYWMgKQoreworICAgaW50IGk7CisgICBpbnQgazsKKyAgIGNoYXIgdGVtcFszXSA9IHswfTsKKyAgIGludCBydjsKKworICAgLy8xOCBpcyBNQUMgQWRkcmVzcyBsZW5ndGggcGx1cyB0aGUgY29sb25zCisgICBpZiAoICFwU3JjTWFjICYmIChsZW5ndGggPiAxOCB8fCBsZW5ndGggPCAxOCkgKQorICAgeworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgfQorICAgaSA9IGsgPSAwOworICAgd2hpbGUgKCBpIDwgbGVuZ3RoICkKKyAgIHsKKyAgICAgICBtZW1jcHkodGVtcCwgcFNyY01hYytpLCAyKTsKKyAgICAgICBydiA9IGtzdHJ0b3U4KHRlbXAsIDE2LCAmcERlc2NNYWNbaysrXSk7CisgICAgICAgaWYgKHJ2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uX2ludGVycnVwdGlibGVfdGltZW91dCgKKyAgICAgICAgICAgICAgICAgJnBIZGRDdHgtPmZ1bGxfcHdyX2NvbXBfdmFyLAorICAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcyhXTEFOX1dBSVRfVElNRV9GVUxMX1BXUikpOworICAgICAgaWYgKDAgPj0gcmV0KQorICAgICAgeworICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOndhaXQgb24gZnVsbF9wd3JfY29tcF92YXIgZmFpbGVkICVsZCIsCisgICAgICAgICAgICAgICAgIF9fZnVuY19fLCByZXQpOworICAgICAgfQorICAgICAgc3RhdHVzID0gZ19mdWxsX3B3cl9zdGF0dXM7CisgICAgICBpZihnX2Z1bGxfcHdyX3N0YXR1cyAhPSBlSEFMX1NUQVRVU19TVUNDRVNTKQorICAgICAgeworICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwiJXM6IHNtZV9SZXF1ZXN0RnVsbFBvd2VyIGZhaWxlZCIsX19mdW5jX18pOworICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgIGdvdG8gZmFpbHVyZTsKKyAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZihzdGF0dXMgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICB7CisgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCIlczogc21lX1JlcXVlc3RGdWxsUG93ZXIgZmFpbGVkIC0gc3RhdHVzICVkIiwKKyAgICAgICAgIF9fZnVuY19fLCBzdGF0dXMpOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIGdvdG8gZmFpbHVyZTsKKyAgICB9CisgICAgZWxzZQorICAgICAgcEhkZEN0eC0+aGRkX3BzX3N0YXRlID0gZUhERF9TVVNQRU5EX05PTkU7CisKK2ZhaWx1cmU6CisgICAgLy9ObyBibG9ja2luZyB0byByZWR1Y2UgbG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pCisgICB7CisgICAgICAvL0Jsb2NrIG9uIGEgY29tcGxldGlvbiB2YXJpYWJsZS4gQ2FuJ3Qgd2FpdCBmb3JldmVyIHRob3VnaC4KKyAgICAgIHJldCA9IHdhaXRfZm9yX2NvbXBsZXRpb25faW50ZXJydXB0aWJsZV90aW1lb3V0KAorICAgICAgICAgICAgICAgICAgICAgJnBBZGFwdGVyLT5kaXNjb25uZWN0X2NvbXBfdmFyLAorICAgICAgICAgICAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoV0xBTl9XQUlUX1RJTUVfRElTQ09OTkVDVCkpOworICAgICAgaWYgKDAgPj0gcmV0KQorICAgICAgeworICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgRkwoIndhaXQgb24gZGlzY29ubmVjdF9jb21wX3ZhciBmYWlsZWQgJWxkIiksIHJldCk7CisgICAgICB9CisgICB9CisKKworICAgLy9Ob25lIG9mIHRoZSBzdGVwcyBzaG91bGQgZmFpbCBhZnRlciB0aGlzLiBDb250aW51ZSBldmVuIGluIGNhc2Ugb2YgZmFpbHVyZQorICAgdm9zU3RhdHVzID0gdm9zX3N0b3AoIHBIZGRDdHgtPnB2b3NDb250ZXh0ICk7CisgICBpZiggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyggdm9zU3RhdHVzICkpCisgICB7CisgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiB2b3Nfc3RvcCByZXR1cm4gZmFpbGVkICVkIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgdm9zU3RhdHVzKTsKKyAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgIFZPU19CVUcoMCk7CisgICB9CisKKyAgIHBIZGRDdHgtPmhkZF9wc19zdGF0ZSA9IGVIRERfU1VTUEVORF9ERUVQX1NMRUVQOworCisgICAvL1Jlc3RvcmUgSU1QUyBjb25maWcKKyAgIGlmKHB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gICBoZGRfYWRhcHRlcl90KiBwQWRhcHRlciA9CisgICAgICAgICAgICAgY29udGFpbmVyX29mKHdvcmssIGhkZF9hZGFwdGVyX3QsIGlwdjZOb3RpZmllcldvcmtRdWV1ZSk7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgICBpbnQgc3RhdHVzOworCisgICAgRU5URVIoKTsKKyAgICBpZiAoTlVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgIGhkZExvZyhMT0dFLCBGTCgiQWRhcHRlciBpcyBpbnZhbGlkIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIHN0YXR1cyA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gc3RhdHVzKQorICAgIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmICggVk9TX0ZBTFNFID09IHBIZGRDdHgtPnN1c19yZXNfbWNhc3RiY2FzdF9maWx0ZXJfdmFsaWQpCisgICAgeworICAgICAgICBwSGRkQ3R4LT5zdXNfcmVzX21jYXN0YmNhc3RfZmlsdGVyID0KKyAgICAgICAgICAgIHBIZGRDdHgtPmNvbmZpZ3VyZWRNY2FzdEJjYXN0RmlsdGVyOworICAgICAgICBoZGRMb2coTE9HMSwgRkwoInNhdmluZyBjb25maWd1cmVkTWNhc3RCY2FzdEZpbHRlciA9ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT5zdXNfcmVzX21jYXN0YmNhc3RfZmlsdGVyKTsKKyAgICAgICAgcEhkZEN0eC0+c3VzX3Jlc19tY2FzdGJjYXN0X2ZpbHRlcl92YWxpZCA9IFZPU19UUlVFOworICAgIH0KKworICAgIGlmICgoZUNvbm5lY3Rpb25TdGF0ZV9Bc3NvY2lhdGVkID09CisgICAgICAgICAgICAgICAgKFdMQU5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m9kZS0+cEFkYXB0ZXItPmRldiA9PSBuZGV2ICYmCisgICAgICAgICAgICAgKHBBZGFwdGVyTm9kZS0+cEFkYXB0ZXItPmRldmljZV9tb2RlID09IFdMQU5fSEREX0lORlJBX1NUQVRJT04gfHwKKyAgICAgICAgICAgICAgcEFkYXB0ZXJOb2RlLT5wQWRhcHRlci0+ZGV2aWNlX21vZGUgPT0gV0xBTl9IRERfUDJQX0NMSUVOVCkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChwSGRkQ3R4LT5jZmdfaW5pLT5uRW5hYmxlU3VzcGVuZCA9PQorICAgICAgICAgICAgICAgICAgV0xBTl9NQVBfU1VTUEVORF9UT19NQ0FTVF9CQ0FTVF9GSUxURVIpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2NoZWR1bGVfd29yaygmcEFkYXB0ZXJOb2RlLT5wQWRhcHRlci0+aXB2Nk5vdGlmaWVyV29ya1F1ZXVlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coTE9HMSwgRkwoIk5vdCBzY2hlZHVsaW5nIGlwdjYgd3EgbkVuYWJsZVN1c3BlbmQgPSAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT5jZmdfaW5pLT5uRW5hYmxlU3VzcGVuZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICB2b3Nfc3RhdHVzID0gaGRkX2dldF9uZXh0X2FkYXB0ZXIocEhkZEN0eCwgcEFkYXB0ZXJOb2RlLCAmcE5leHQpOworICAgICAgICBwQWRhcHRlck5vZGUgPSBwTmV4dDsKKyAgICB9CisgICAgRVhJVCgpOworICAgIHJldHVybiBOT1RJRllfRE9ORTsKK30KKworaW50IHdsYW5faGRkX2lwdjZfY2hhbmdlZChzdHJ1Y3Qgbm90aWZpZXJfYmxvY2sg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jb250ZXh0IGlzIE51bGwiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICAvL0dldCB0aGUgSEREIGNvbnRleHQuCisgICAgcEhkZEN0eCA9IChoZGRfY29udGV4dF90ICopdm9zX2dldF9jb250ZXh0KFZPU19NT0RVTEVfSURfSERELCBwVm9zQ29udGV4dCApOworCisgICAgaWYgKE5VTEwgPT0gcEhkZEN0eCkKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogSEREIGNvbnRleHQgaXMgTnVsbCIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmICgoV0xBTl9IRERfSU5GUkFfU1RBVElPTiA9PSBwQWRhcHRlci0+ZGV2aWNlX21vZGUpIHx8CisgICAgICAgICAgIChXTEFOX0hERF9QMlBfQ0xJRU5UID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkpCisgICAgeworICAgICAgICBpZiAoZmVuYWJsZSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKGVDb25uZWN0aW9uU3RhdGVfQXNzb2NpYXRlZCA9PQorICAgICAgICAgICAgICAgICAgICAoV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlcikpLT5jb25uX2luZm8uY29ublN0YXRlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICgocEhkZEN0eC0+Y2ZnX2luaS0+Zmhvc3RBcnBPZmZsb2FkKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICAgICAqIENvbmZpZ3VyZSB0aGUgQVJQIE9mZmxvYWQuCisgICAgICAgICAgICAgICAgICAgICAqIEV2ZW4gaWYgaXQgZmFpbHMgd2UgaGF2ZSB0byByZWNvbmZpZ3VyZSB0aGUgTUMvQkMKKyAgICAgICAgICAgICAgICAgICAgICogZmlsdGVyIGZsYWcgYXMgd2Ugd2FudCBSSVZBIG5vdCB0byBkcm9wIEJyb2FkQ2FzdAorICAgICAgICAgICAgICAgICAgICAgKiBQYWNrZXRzCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkNhbGxpbmcgQVJQIE9mZmxvYWQgd2l0aCBmbGFnOiAlZCIpLCBmZW5hYmxlKTsKKyAgICAgICAgICAgICAgICAgICAgdnN0YXR1cyA9IGhkZF9jb25mX2FycF9vZmZsb2FkKHBBZGFwdGVyLCBmZW5hYmxlKTsKKyAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+Y29uZmlndXJlZE1jYXN0QmNhc3RGaWx0ZXIgJj0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB+KEhERF9NQ0FTVEJDQVNURklMVEVSX0ZJTFRFUl9BTExfQlJPQURDQVNUKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2c3RhdHVzKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkZhaWxlZCB0byBlbmFibGUgQVJQT0ZmbG9hZEZlYXR1cmUgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2c3RhdHVzKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvL0NvbmZpZ3VyZSBHVEtfT0ZGTE9BRAorI2lmZGVmIFdMQU5fRkVBVFVSRV9HVEtfT0ZGTE9BRAorICAgICAgICAgICAgICAgIGhkZF9jb25mX2d0a19vZmZsb2FkKHBBZGFwdGVyLCBmZW5hYmxlKTsKKyNlbmRpZgorCisjaWZkZWYgV0xBTl9OU19PRkZMT0FECisgICAgICAgICAgICAgICAgaWYgKHBIZGRDdHgtPmNmZ19pbmktPmZob3N0TlNPZmZsb2FkKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgICogQ29uZmlndXJlIHRoZSBOUyBPZmZsb2FkLgorICAgICAgICAgICAgICAgICAgICAgKiBFdmVuIGlmIGl0IGZhaWxzIHdlIGhhdmUgdG8gcmVjb25maWd1cmUgdGhlIE1DL0JDIGZpbHRlciBmbGFnCisgICAgICAgICAgICAgICAgICAgICAqIGFzIHdlIHdhbnQgUklWQSBub3QgdG8gZHJvcCBNdWx0aWNhc3QgUGFja2V0cworICAgICAgICAgICAgICAgICAgICAgKi8KKworICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkNhbGxpbmcgTlMgT2ZmbG9hZCB3aXRoIGZsYWc6ICVkIiksIGZlbmFibGUpOworICAgICAgICAgICAgICAgICAgICBoZGRfY29uZl9uc19vZmZsb2FkKHBBZGFwdGVyLCBmZW5hYmxlKTsKKyAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+Y29uZmlndXJlZE1jYXN0QmNhc3RGaWx0ZXIgJj0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB+KEhERF9NQ0FTVEJDQVNURklMVEVSX0ZJTFRFUl9BTExfTVVMVElDQVNUKTsKKyAgICAgICAgICAgICAgICB9CisjZW5kaWYKKworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLy9EaXNhYmxlIEFSUE9GRkxPQUQKKyAgICAgICAgICAgIGlmIChwSGRkQ3R4LT5jZmdfaW5pLT5maG9zdEFycE9mZmxvYWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdnN0YXR1cyA9IGhkZF9jb25mX2FycF9vZmZsb2FkKHBBZGFwdGVyLCBmZW5hYmxlKTsKKyAgICAgICAgICAgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2c3RhdHVzKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICJGYWlsZWQgdG8gZGlzYWJsZSBBUlBPZmZsb2FkIEZlYXR1cmUgJWQiLCB2c3RhdHVzKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvL0Rpc2FibGUgR1RLX09GRkxPQUQKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfR1RLX09GRkxPQUQKKyAgICAgICAgICAgIGhkZF9jb25mX2d0a19vZmZsb2FkKHBBZGFwdGVyLCBmZW5hYmxlKTsKKyNlbmRpZgorCisjaWZkZWYgV0xBTl9OU19PRkZMT0FECisgICAgICAgICAgICAvL0Rpc2FibGUgTlNPRkZMT0FECisgICAgICAgICAgICBpZiAocEhkZEN0eC0+Y2ZnX2luaS0+Zmhvc3ROU09mZmxvYWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkX2NvbmZfbnNfb2ZmbG9hZChwQWRhcHRlciwgZmVuYWJsZSk7CisgICAgICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm47Cit9CisKKworI2lmZGVmIFdMQU5fTlNfT0ZGTE9BRAorLyoqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIFxicmllZiBoZGRfY29uZl9uc19vZmZsb2FkKCkgLSBDb25maWd1cmUgTlMgb2ZmbG9hZAorCisgIENhbGxlZCBkdXJpbmcgU1VTUEVORCB0byBjb25maWd1cmUgdG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b3QgPSAwOworICAgIGludCByZXQgPSAwOworICAgIGVIYWxTdGF0dXMgcmV0dXJuU3RhdHVzOworCisgICAgRU5URVIoKTsKKyAgICBoZGRMb2coTE9HMSwgRkwoIiBmZW5hYmxlID0gJWQiKSwgZmVuYWJsZSk7CisKKyAgICBpZiAoTlVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJIREQgYWRhcHRlciBpcyBOdWxsIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaGFsSGFuZGxlID0gV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpOworICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKworICAgIHJldCA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gcmV0KQorICAgIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmIChzbWVfSXNGZWF0dXJlU3VwcG9ydGVkQnlGVyhFWFRFTkRFRF9OU09GRkxPQURfU0xPVCkpCisgICAgeworICAgICAgICBzbG90X2luZGV4ID0gTlNfRVhURU5ERURfU0xPVF9JTkRFWDsKKyAgICB9CisKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sIEZMKCJzbG90X2lkZXggPSAlZCIpLCBzbG90X2luZGV4KTsKKworICAgIHNlbGZJUHY2QWRkclZhbGlkID0KKyAgICAgICAgICAgICh0QU5JX1U4ICopdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRBTklfVTgpICogc2xvdF9pbmRleCk7CisKKyAgICBpZiAoTlVMTCA9PSBzZWxmSVB2NkFkZHJWYWxpZCkKKyAgICB7CisgICAgICAgIGhkZExvZyAoVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgiRmFpbGVkIHRvIGFsbG9jYXRlIG1lbW9yeSBmb3IiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgc2VsZklQdjZBZGRyVmFsaWQiKSk7CisgICAgICAgIGdvdG8gZW5kOworICAgIH0KKworICAgIHZvc19tZW1femVybyhzZWxmSVB2NkFkZHJWYWxpZCwgc2xvdF9pbmRleCAqIHNpemVvZih0QU5JX1U4KSk7CisKKyAgICBzZWxmSVB2NkFkZHIgPSAodEFOSV9VOCAqKil2b3NfbWVtX21hbGxvYyhzaXplb2YodEFOSV9VOCAqKSAqIHNsb3RfaW5kZXgpOworCisgICAgaWYgKE5VTEwgPT0gc2VsZklQdjZBZGRyKQorICAgIHsKKyAgICAgICAgaGRkTG9nIChWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJGYWlsZWQgdG8gYWxsb2NhdGUgbWVtb3J5IGZvciIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBzZWxmSVB2NkFkZHIiKSk7CisgICAgICAgIGdvdG8gZW5kOworICAgIH0KKworICAgIHZvc19tZW1femVybyhzZWxmSVB2NkFkZHIsIHNsb3RfaW5kZXggKiBzaXplb2YodEFOSV9VOCAqKSk7CisKKyAgICBmb3IgKHNsb3QgPSAwOyBzbG90IDwgc2xvdF9pbmRleDsgc2xvdCsrKQorICAgIHsKKyAgICAgICAgc2VsZklQdjZBZGRyW3Nsb3RdID0KKyAgICAgICAgICAgKHRBTklfVTggKil2b3NfbWVtX21hbGxvYyhTSVJfTUFDX0lQVjZfQUREUl9MRU4pOworICAgICAgICBpZiAoTlVMTCA9PSBzZWxmSVB2NkFkZHJbc2xvdF0pCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyAoVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgiRmFpbGVkIHRvIGFsbG9jYXRlIG1lbW9yeSIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZm9yIHNlbGZJUHY2QWRkciIpKTsKKyAgICAgICAgICAgIGdvdG8gZW5kOworICAgICAgICB9CisgICAgICAgIHZvc19tZW1femVybyhzZWxmSVB2NkFkZHJbc2xvdF0sIFNJUl9NQUNfSVBWNl9BRERSX0xFTik7CisgICAgfQorCisgICAgaSA9IDA7CisKKyAgICBpZiAoZmVuYWJsZSkKKyAgICB7CisgICAgICAgIGluNl9kZXYgPSBfX2luNl9kZXZfZ2V0KHBBZGFwdGVyLT5kZXYpOworICAgICAgICBpZiAoTlVMTCAhPSBpbjZfZGV2KQorICAgICAgICB7CisgICAgICAgICAgICBsaXN0X2Zvcl9lYWNoKHAsICZpbjZfZGV2LT5hZGRyX2xpc3QpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGkgPj0gc2xvdF9pbmRleCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyAoVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJJUHY2IGFkZHJlc3MgbGlzdCBpcyBncmVhdGVyIHRoYW4gSVB2NiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiYWRkcmVzcyBzdXBwb3J0ZWQgYnkgZmlybXdhcmUiKSk7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyAoVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJGVyBzdXBwb3J0ZWQgSVB2NiBhZGRyZXNzID0gJWQiKSwgc2xvdF9pbmRleCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZnAgPSBsaXN0X2VudHJ5KHAsIHN0cnVjdCBpbmV0Nl9pZmFkZHIsIGlmX2xpc3QpOworICAgICAgICAgICAgICAgIHN3aXRjaChpcHY2X2FkZHJfc3JjX3Njb3BlKCZpZnAtPmFkZHIpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBJUFY2X0FERFJfU0NPUEVfTElOS0xPQ0FMOgorICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHNlbGZJUHY2QWRkcltpXSwgJmlmcC0+YWRkci5zNl9hZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoaWZwLT5hZGRyLnM2X2FkZHIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlbGZJUHY2QWRkclZhbGlkW2ldID0gU0lSX0lQVjZfQUREUl9WQUxJRDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyAoVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiRm91bmQgSVBWNl9BRERSX1NDT1BFX0xJTktMT0NBTCBBZGRyZXNzIDogJXBJNiIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGZJUHY2QWRkcltpXSk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBJUFY2X0FERFJfU0NPUEVfR0xPQkFMOgorICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHNlbGZJUHY2QWRkcltpXSwgJmlmcC0+YWRkci5zNl9hZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoaWZwLT5hZGRyLnM2X2FkZHIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlbGZJUHY2QWRkclZhbGlkW2ldID0gU0lSX0lQVjZfQUREUl9WQUxJRDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyAoVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiRm91bmQgSVBWNl9BRERSX1NDT1BFX0dMT0JBTCBBZGRyZXNzIDogJXBJNiIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGZJUHY2QWRkcltpXSk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiVGhlIFNjb3BlICVkIGlzIG5vdCBzdXBwb3J0ZWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpcHY2X2FkZHJfc3JjX3Njb3BlKCZpZnAtPmFkZHIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHNlbGZJUHY2QWRkclZhbGlkW2ldID09IFNJUl9JUFY2X0FERFJfVkFMSUQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpKys7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICB2b3NfbWVtX3plcm8oJm9mZkxvYWRSZXF1ZXN0LCBzaXplb2Yob2ZmTG9hZFJlcXVlc3QpKTsKKyAgICAgICAgICAgIGZvciAoaSA9MDsgaSA8IHNsb3RfaW5kZXg7IGkrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoc2VsZklQdjZBZGRyVmFsaWRbaV0pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvL0ZpbGxpbmcgdXAgdGhlIHJlcXVlc3Qgc3RydWN0dXJlCisgICAgICAgICAgICAgICAgICAgIC8qIEZpbGxpbmcgdGhlIHNlbGZJUHY2QWRkciB3aXRoIHNvbGljaXRlZCBhZGRyZXNzCisgICAgICAgICAgICAgICAgICAgICAqIEEgU29saWNpdGVkLU5vZGUgbXVsdGljYXN0IGFkZHJlc3MgaXMgY3JlYXRlZCBieQorICAgICAgICAgICAgICAgICAgICAgKiB0YWtpbmcgdGhlIGxhc3QgMjQgYml0cyBvZiBhIHVuaWNhc3Qgb3IgYW55Y2FzdAorICAgICAgICAgICAgICAgICAgICAgKiBhZGRyZXNzIGFuZCBhcHBlbmRpbmcgdGhlbSB0byB0aGUgcHJlZml4CisgICAgICAgICAgICAgICAgICAgICAqCisgICAgICAgICAgICAgICAgICAgICAqIEZGMDI6MDAwMDowMDAwOjAwMDA6MDAwMDowMDAxOkZGWFg6WFgKKyAgICAgICAgICAgICAgICAgICAgICoKKyAgICAgICAgICAgICAgICAgICAgICogaGVyZSBYWCBpcyB0aGUgdW5pY2FzdC9hbnljYXN0IGJpdHMKKyAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgIG9mZkxvYWRSZXF1ZXN0Lm5zT2ZmbG9hZEluZm8uc2VsZklQdjZBZGRyWzBdID0gMHhGRjsKKyAgICAgICAgICAgICAgICAgICAgb2ZmTG9hZFJlcXVlc3QubnNPZmZsb2FkSW5mby5zZWxmSVB2NkFkZHJbMV0gPSAweDAyOworICAgICAgICAgICAgICAgICAgICBvZmZMb2FkUmVxdWVzdC5uc09mZmxvYWRJbmZvLnNlbGZJUHY2QWRkclsxMV0gPSAweDAxOworICAgICAgICAgICAgICAgICAgICBvZmZMb2FkUmVxdWVzdC5uc09mZmxvYWRJbmZvLnNlbGZJUHY2QWRkclsxMl0gPSAweEZGOworICAgICAgICAgICAgICAgICAgICBvZmZMb2FkUmVxdWVzdC5uc09mZmxvYWRJbmZvLnNlbGZJUHY2QWRkclsxM10gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGZJUHY2QWRkcltpXVsxM107CisgICAgICAgICAgICAgICAgICAgIG9mZkxvYWRSZXF1ZXN0Lm5zT2ZmbG9hZEluZm8uc2VsZklQdjZBZGRyWzE0XSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZklQdjZBZGRyW2ldWzE0XTsKKyAgICAgICAgICAgICAgICAgICAgb2ZmTG9hZFJlcXVlc3QubnNPZmZsb2FkSW5mby5zZWxmSVB2NkFkZHJbMTVdID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmSVB2NkFkZHJbaV1bMTVdOworICAgICAgICAgICAgICAgICAgICBvZmZMb2FkUmVxdWVzdC5uc09mZmxvYWRJbmZvLnNsb3RJZHggPSBpOworCisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmb2ZmTG9hZFJlcXVlc3QubnNPZmZsb2FkSW5mby50YXJnZXRJUHY2QWRkclswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlbGZJUHY2QWRkcltpXSwgc2l6ZW9mKHRBTklfVTgpKlNJUl9NQUNfSVBWNl9BRERSX0xFTik7CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmb2ZmTG9hZFJlcXVlc3QubnNPZmZsb2FkSW5mby5zZWxmTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBZGFwdGVyLT5tYWNBZGRyZXNzQ3VycmVudC5ieXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRBTklfVTgpKlNJUl9NQUNfQUREUl9MRU4pOworCisgICAgICAgICAgICAgICAgICAgIG9mZkxvYWRSZXF1ZXN0Lm5zT2ZmbG9hZEluZm8udGFyZ2V0SVB2NkFkZHJWYWxpZFswXSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX0lQVjZfQUREUl9WQUxJRDsKKyAgICAgICAgICAgICAgICAgICAgb2ZmTG9hZFJlcXVlc3Qub2ZmbG9hZFR5cGUgPSAgU0lSX0lQVjZfTlNfT0ZGTE9BRDsKKyAgICAgICAgICAgICAgICAgICAgb2ZmTG9hZFJlcXVlc3QuZW5hYmxlT3JEaXNhYmxlID0gU0lSX09GRkxPQURfRU5BQkxFOworCisgICAgICAgICAgICAgICAgICAgIGhkZExvZyAoVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJjb25maWd1cmVkTWNhc3RCY2FzdEZpbHRlcjogJWQiCisgICAgICAgICAgICAgICAgICAgICAgICJOU09mZmxvYWQgU2xvdCA9ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPmNvbmZpZ3VyZWRNY2FzdEJjYXN0RmlsdGVyLCBpKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoKFZPU19UUlVFID09IHBIZGRDdHgtPnN1c19yZXNfbWNhc3RiY2FzdF9maWx0ZXJfdmFsaWQpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKEhERF9NQ0FTVEJDQVNURklMVEVSX0ZJTFRFUl9BTExfTVVMVElDQVNUID09CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPnN1c19yZXNfbWNhc3RiY2FzdF9maWx0ZXIpIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEhERF9NQ0FTVEJDQVNURklMVEVSX0ZJTFRFUl9BTExfTVVMVElDQVNUX0JST0FEQ0FTVCA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT5zdXNfcmVzX21jYXN0YmNhc3RfZmlsdGVyKSkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICghV0RBX0lTX01DQVNUX0ZMVF9FTkFCTEVfSU5fRlcgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAoV0RBX0lTX01DQVNUX0ZMVF9FTkFCTEVfSU5fRlcgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIShwSGRkQ3R4LT5jZmdfaW5pLT5mRW5hYmxlTUNBZGRyTGlzdCkpKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgb2ZmTG9hZFJlcXVlc3QuZW5hYmxlT3JEaXNhYmxlID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfT0ZGTE9BRF9OU19BTkRfTUNBU1RfRklMVEVSX0VOQUJMRTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyAoVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJTZXQgb2ZmTG9hZFJlcXVlc3Qgd2l0aCAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZMb2FkUmVxdWVzdC5lbmFibGVPckRpc2FibGUpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZvZmZMb2FkUmVxdWVzdC5wYXJhbXMuaG9zdElwdjZBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb2ZmTG9hZFJlcXVlc3QubnNPZmZsb2FkSW5mby50YXJnZXRJUHY2QWRkclswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRBTklfVTgpKlNJUl9NQUNfSVBWNl9BRERSX0xFTik7CisKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nIChWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgRkwoIlNldHRpbmcgTlNPZmZsb2FkIHdpdGggc29saWNpdGVkSXA6ICVwSTYsIgorICAgICAgICAgICAgICAgICAgICAgICAidGFyZ2V0SXA6ICVwSTYiKSwKKyAgICAgICAgICAgICAgICAgICAgb2ZmTG9hZFJlcXVlc3QubnNPZmZsb2FkSW5mby5zZWxmSVB2NkFkZHIsCisgICAgICAgICAgICAgICAgICAgIG9mZkxvYWRSZXF1ZXN0Lm5zT2ZmbG9hZEluZm8udGFyZ2V0SVB2NkFkZHJbMF0pOworCisgICAgICAgICAgICAgICAgICAgIC8vQ29uZmlndXJlIHRoZSBGaXJtd2FyZSB3aXRoIHRoaXMKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuU3RhdHVzID0gc21lX1NldEhvc3RPZmZsb2FkKGhhbEhhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsICZvZmZMb2FkUmVxdWVzdCk7CisgICAgICAgICAgICAgICAgICAgIGlmKGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gcmV0dXJuU3RhdHVzKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkZhaWxlZCB0byBlbmFibGUgSG9zdE9mZmxvYWQgZmVhdHVyZSB3aXRoIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBzdGF0dXM6ICVkIiksIHJldHVyblN0YXR1cyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV96ZXJvKCZvZmZMb2FkUmVxdWVzdCwgc2l6ZW9mKG9mZkxvYWRSZXF1ZXN0KSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgRkwoIklQdjYgZGV2IGRvZXMgbm90IGV4aXN0LiBGYWlsZWQgdG8gcmVxdWVzdCBOU09mZmxvYWQiKSk7CisgICAgICAgICAgICAgIGdvdG8gZW5kOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIC8vRGlzYWJsZSBOU09mZmxvYWQKKyAgICAgICAgdm9zX21lbV96ZXJvKCh2b2lkICopJm9mZkxvYWRSZXF1ZXN0LCBzaXplb2YodFNpckhvc3RPZmZsb2FkUmVxKSk7CisgICAgICAgIG9mZkxvYWRSZXF1ZXN0LmVuYWJsZU9yRGlzYWJsZSA9IFNJUl9PRkZMT0FEX0RJU0FCTEU7CisgICAgICAgIG9mZkxvYWRSZXF1ZXN0Lm9mZmxvYWRUeXBlID0gIFNJUl9JUFY2X05TX09GRkxPQUQ7CisKKyAgICAgICAgZm9yIChpID0gMDsgaSA8IHNsb3RfaW5kZXg7IGkrKykKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCBGTCgiRGlzYWJsZSBTbG90PSAlZCIpLCBpKTsKKyAgICAgICAgICAgIG9mZkxvYWRSZXF1ZXN0Lm5zT2ZmbG9hZEluZm8uc2xvdElkeCA9IGk7CisgICAgICAgICAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPQorICAgICAgICAgICAgICAgICBzbWVfU2V0SG9zdE9mZmxvYWQoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLAorICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCAmb2ZmTG9hZFJlcXVlc3QpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJGYWlsdXJlIHRvIGRpc2FibGUiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiAlZCBTbG90IiksIGkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorZW5kOgorICAgIHdoaWxlIChzbG90ID4gMCAmJiBzZWxmSVB2NkFkZHJbLS1zbG90XSkKKyAgICB7CisgICAgICAgdm9zX21lbV9mcmVlKHNlbGZJUHY2QWRkcltzbG90XSk7CisgICAgfQorICAgIGlmIChzZWxmSVB2NkFkZHIpCisgICAgeworICAgICAgIHZvc19tZW1fZnJlZShzZWxmSVB2NkFkZHIpOworICAgIH0KKyAgICBpZiAoc2VsZklQdjZBZGRyVmFsaWQpCisgICAgeworICAgICAgIHZvc19tZW1fZnJlZShzZWxmSVB2NkFkZHJWYWxpZCk7CisgICAgfQorICAgIEVYSVQoKTsKKyAgICByZXR1cm47Cit9CisjZW5kaWYKKwordm9pZCBfX2hkZF9pcHY0X25vdGlmaWVyX3dvcmtfcXVldWUoc3RydWN0IHdvcmtfc3RydWN0ICp3b3JrKQoreworICAgIGhkZF9hZGFwdGVyX3QqIHBBZGFwdGVyID0KKyAgICAgICAgICAgICBjb250YWluZXJfb2Yod29yaywgaGRkX2FkYXB0ZXJfdCwgaXB2NE5vdGlmaWVyV29ya1F1ZXVlKTsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgIGludCBzdGF0dXM7CisKKyAgICBFTlRFUigpOworICAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgIHsKKyAgICAgICAgaGRkTG9nKExPR0UsIEZMKCJBZGFwdGVyIGlzIGludmFsaWQiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIHN0YXR1cyA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gc3RhdHVzKQorICAgIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmICggVk9TX0ZBTFNFID09IHBIZGRDdHgtPnN1c19yZXNfbWNhc3RiY2FzdF9maWx0ZXJfdmFsaWQpCisgICAgeworICAgICAgICBwSGRkQ3R4LT5zdXNfcmVzX21jYXN0YmNhc3RfZmlsdGVyID0KKyAgICAgICAgICAgIHBIZGRDdHgtPmNvbmZpZ3VyZWRNY2FzdEJjYXN0RmlsdGVyOworICAgICAgICBoZGRMb2coTE9HMSwgRkwoInNhdmluZyBjb25maWd1cmVkTWNhc3RCY2FzdEZpbHRlciA9ICVkIiksCisgICAgICAgICAgICAgICAgICA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LT5wQWRhcHRlci0+ZGV2aWNlX21vZGUgPT0gV0xBTl9IRERfUDJQX0NMSUVOVCkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmICgocEhkZEN0eC0+Y2ZnX2luaS0+bkVuYWJsZVN1c3BlbmQgIT0KKyAgICAgICAgICAgICAgICAgIFdMQU5fTUFQX1NVU1BFTkRfVE9fTUNBU1RfQkNBU1RfRklMVEVSKQorICAgICAgICAgICAgICAgfHwgKCFwSGRkQ3R4LT5jZmdfaW5pLT5maG9zdEFycE9mZmxvYWQpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhMT0cxLCBGTCgiT2ZmbG9hZCBub3QgZW5hYmxlZCBNQ0JDPSVkLCBBUlBPZmZsb2FkPSVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT5jZmdfaW5pLT5uRW5hYmxlU3VzcGVuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPmNmZ19pbmktPmZob3N0QXJwT2ZmbG9hZCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIE5PVElGWV9ET05FOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoKGluX2RldiA9CisgICAgICAgICAgICAgICAgICBfX2luX2Rldl9nZXRfcnRubChwQWRhcHRlck5vZGUtPnBBZGFwdGVyLT5kZXYpKSAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGZvciAoaWZhcCA9ICZpbl9kZXYtPmlmYV9saXN0OyAoaWZhID0gKmlmYXApICE9IE5VTEw7CisgICAgICAgICAgICAgICAgICAgICAgIGlmYXAgPSAmaWZhLT5pZmFfbmV4dCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmICghc3RyY21wKHBBZGFwdGVyTm9kZS0+cEFkYXB0ZXItPmRldi0+bmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaWZhLT5pZmFfbGFiZWwpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsgLyogZm91bmQgKi8KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmKGlmYSAmJiBpZmEtPmlmYV9sb2NhbCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzY2hlZHVsZV93b3JrKCZwQWRhcHRlck5vZGUtPnBBZGFwdGVyLT5pcHY0Tm90aWZpZXJXb3JrUXVldWUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgdm9zX3N0YXR1cyA9IGhkZF9nZXRfbmV4dF9hZGFwdGVyKHBIZGRDdHgsIHBBZGFwdGVyTm9kZSwgJnBOZXh0KTsKKyAgICAgICAgcEFkYXB0ZXJOb2RlID0gcE5leHQ7CisgICAgfQorICAgIEVYSVQoKTsKKyAgICByZXR1cm4gTk9USUZZX0RPTkU7Cit9CisKK2ludCB3bGFuX2hkZF9pcHY0X2NoYW5nZWQoc3RydWN0IG5vdGlmaWVyX2Jsb2NrICpuYiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIGRhdGEsIHZvaWQgKmFyZykKK3sKKyAgICBpbnQgcmV0OworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX193bGFuX2hkZF9pcHY0X2NoYW5nZWQoIG5iLCBkYXRhLCBhcmcpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXR1cm4gcmV0OworfQorCisvKiotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgXGJyaWVmIGhkZF9jb25mX2FycF9vZmZsb2FkKC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KKyAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKworICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCBGTCgiIGZlbmFibGUgPSAlZCAiKSwgZmVuYWJsZSk7CisKKyAgIGlmKGZlbmFibGUpCisgICB7CisgICAgICAgaWYgKChpbl9kZXYgPSBfX2luX2Rldl9nZXRfcnRubChwQWRhcHRlci0+ZGV2KSkgIT0gTlVMTCkKKyAgICAgICB7CisgICAgICAgICAgIGZvciAoaWZhcCA9ICZpbl9kZXYtPmlmYV9saXN0OyAoaWZhID0gKmlmYXApICE9IE5VTEw7CisgICAgICAgICAgICAgICAgICAgaWZhcCA9ICZpZmEtPmlmYV9uZXh0KQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBpZiAoIXN0cmNtcChwQWRhcHRlci0+ZGV2LT5uYW1lLCBpZmEtPmlmYV9sYWJlbCkpCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgYnJlYWs7IC8qIGZvdW5kICovCisgICAgICAgICAgICAgICB9CisgICAgICAgICAgIH0KKyAgICAgICB9CisgICAgICAgaWYoaWZhICYmIGlmYS0+aWZhX2xvY2FsKQorICAgICAgIHsKKyAgICAgICAgICAgb2ZmTG9hZFJlcXVlc3Qub2ZmbG9hZFR5cGUgPSAgU0lSX0lQVjRfQVJQX1JFUExZX09GRkxPQUQ7CisgICAgICAgICAgIG9mZkxvYWRSZXF1ZXN0LmVuYWJsZU9yRGlzYWJsZSA9IFNJUl9PRkZMT0FEX0VOQUJMRTsKKworICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczogRW5hYmxlZCIsIF9fZnVuY19fKTsKKworICAgICAgICAgICBpZiAoKChIRERfTUNBU1RCQ0FTVEZJTFRFUl9GSUxURVJfQUxMX0JST0FEQ0FTVCA9PQorICAgICAgICAgICAgICAgIHBIZGRDdHgtPnN1c19yZXNfbWNhc3RiY2FzdF9maWx0ZXIpIHx8CisgICAgICAgICAgICAgICAoSEREX01DQVNUQkNBU1RGSUxURVJfRklMVEVSX0FMTF9NVUxUSUNBU1RfQlJPQURDQVNUID09CisgICAgICAgICAgICAgICAgcEhkZEN0eC0+c3VzX3Jlc19tY2FzdGJjYXN0X2ZpbHRlcikpICYmCisgICAgICAgICAgICAgICAoVk9TX1RSVUUgPT0gcEhkZEN0eC0+c3VzX3Jlc19tY2FzdGJjYXN0X2ZpbHRlcl92YWxpZCkpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIG9mZkxvYWRSZXF1ZXN0LmVuYWJsZU9yRGlzYWJsZSA9CisgICAgICAgICAgICAgICAgICAgU0lSX09GRkxPQURfQVJQX0FORF9CQ0FTVF9GSUxURVJfRU5BQkxFOworICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICJvZmZsb2FkOiBpbnNpZGUgYXJwIG9mZmxvYWQgY29uZGl0aW9uYWwgY2hlY2siKTsKKyAgICAgICAgICAgfQorCisgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIm9mZmxvYWQ6IGFycCBmaWx0ZXIgcHJvZ3JhbW1lZCA9ICVkIiwKKyAgICAgICAgICAgICAgICAgIG9mZkxvYWRSZXF1ZXN0LmVuYWJsZU9yRGlzYWJsZSk7CisKKyAgICAgICAgICAgLy9jb252ZXJ0aW5nIHUzMiB0byBJUFY0IGFkZHJlc3MKKyAgICAgICAgICAgZm9yKGkgPSAwIDsgaSA8IDQ7IGkrKykKKyAgICAgICAgICAgeworICAgICAgICAgICAgICBvZmZMb2FkUmVxdWVzdC5wYXJhbXMuaG9zdElwdjRBZGRyW2ldID0KKyAgICAgICAgICAgICAgICAgICAgICAoaWZhLT5pZmFfbG9jYWwgPj4gKGkqOCkgKSAmIDB4RkYgOworICAgICAgICAgICB9CisgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIiBFbmFibGUgU01FIEhvc3RPZmZsb2FkOiAlZC4lZC4lZC4lZCIsCisgICAgICAgICAgICAgICAgICBvZmZMb2FkUmVxdWVzdC5wYXJhbXMuaG9zdElwdjRBZGRyWzBdLAorICAgICAgICAgICAgICAgICAgb2ZmTG9hZFJlcXVlc3QucGFyYW1zLmhvc3RJcHY0QWRkclsxXSwKKyAgICAgICAgICAgICAgICAgIG9mZkxvYWRSZXF1ZXN0LnBhcmFtcy5ob3N0SXB2NEFkZHJbMl0sCisgICAgICAgICAgICAgICAgICBvZmZMb2FkUmVxdWVzdC5wYXJhbXMuaG9zdElwdjRBZGRyWzNdKTsKKworICAgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9CisgICAgICAgICAgICAgICAgICAgIHNtZV9TZXRIb3N0T2ZmbG9hZChXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsICZvZmZMb2FkUmVxdWVzdCkpCisgICAgICAgICAgeworICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IEZhaWxlZCB0byBlbmFibGUgSG9zdE9mZmxvYWQgIgorICAgICAgICAgICAgICAgICAgICAgICJmZWF0dXJlIiwgX19mdW5jX18pOworICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICAgICAgfQorICAgICAgIH0KKyAgICAgICBlbHNlCisgICAgICAgeworICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgiSVAgQWRkcmVzcyBpcyBub3QgYXNzaWduZWQiKSk7CisgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfQUdBSU47CisgICAgICAgfQorCisgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfU1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YXB0ZXJOb2RlLCAmcE5leHQgKTsKKyAgICAgICAgICAgcEFkYXB0ZXJOb2RlID0gcE5leHQ7CisgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgIH0KKyAgICAgICAvKiBBdm9pZCBtdWx0aXBsZSBlbnRlci9leGl0IEJNUFMgaW4gdGhpcyB3aGlsZSBsb29wIHVzaW5nCisgICAgICAgICogaGRkX2VudGVyX2JtcHMgZmxhZworICAgICAgICAqLworICAgICAgIGlmIChGQUxTRSA9PSBoZGRfZW50ZXJfYm1wcyAmJiAoQk1QUyA9PSBwbWNHZXRQbWNTdGF0ZShwSGRkQ3R4LT5oSGFsKSkpCisgICAgICAgeworICAgICAgICAgICAgaGRkX2VudGVyX2JtcHMgPSBUUlVFOworCisgICAgICAgICAgIC8qIElmIGRldmljZSB3YXMgYWxyZWFkeSBpbiBCTVBTLCBhbmQgZHluYW1pYyBEVElNIGlzIHNldCwKKyAgICAgICAgICAgICogZXhpdChzZXQgdGhlIGRldmljZSB0byBmdWxsIHBvd2VyKSBhbmQgZW50ZXIgQk1QUyBhZ2FpbgorICAgICAgICAgICAgKiB0byByZWZsZWN0IG5ldyBEVElNIHZhbHVlICovCisgICAgICAgICAgIHdsYW5faGRkX2VudGVyX2JtcHMocEFkYXB0ZXIsIERSSVZFUl9QT1dFUl9NT0RFX0FDVElWRSk7CisKKyAgICAgICAgICAgd2xhbl9oZGRfZW50ZXJfYm1wcyhwQWRhcHRlciwgRFJJVkVSX1BPV0VSX01PREVfQVVUTyk7CisKKyAgICAgICAgICAgcEhkZEN0eC0+aGRkX2lnbm9yZV9kdGltX2VuYWJsZWQgPSBUUlVFOworICAgICAgIH0KKyNpZmRlZiBTVVBQT1JUX0VBUkxZX1NVU1BFTkRfU1RBTkRCWV9ERUVQU0xFRVAKKyAgICAgICBpZiAocEhkZEN0eC0+Y2ZnX2luaS0+bkVuYWJsZVN1c3BlbmQgPT0gV0xBTl9NQVBfU1VTUEVORF9UT19TVEFOREJZKQorICAgICA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lIGJlZm9yZSB0aGUgY2hpcAorICAgICAgICogZW50ZXJlZCBJTVBTIGFuZCBzbyBvdXIgaGFyZHdhcmUgZmlsdGVyIHNldHRpbmdzIGNvbmZndXJlZCBieSB0aGUKKyAgICAgICAqIHJlc3VtZSByZXF1ZXN0IHdpbGwgYmUgbG9zdC4gU28gcmVjb25maWd1cmUgdGhlIGZpbHRlcnMgb24gZGV0ZWN0aW5nCisgICAgICAgKiBhIGNoYW5nZSBpbiB0aGUgcG93ZXIgc3RhdGUgb2YgdGhlIFdDTiBjaGlwLgorICAgICAgICovCisgICAgICBzcGluX3VubG9jaygmcEhkZEN0eC0+ZmlsdGVyX2xvY2spOworICAgICAgaWYgKElNUFMgIT0gbmV3U3RhdGUpCisgICAgICB7CisgICAgICAgICAgIHNwaW5fbG9jaygmcEhkZEN0eC0+ZmlsdGVyX2xvY2spOworICAgICAgICAgICBpZiAoRkFMU0UgPT0gcEhkZEN0eC0+aGRkX3dsYW5fc3VzcGVuZGVkKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3Bpbl91bmxvY2soJnBIZGRDdHgtPmZpbHRlcl9sb2NrKTsKKyAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICJOb3QgaW4gSU1QUy9CTVBTIGFuZCBzdXNwZW5kZWQgc3RhdGUiKTsKKyAgICAgICAgICAgICAgICBoZGRfY29uZl9tY2FzdGJjYXN0X2ZpbHRlcihwSGRkQ3R4LCBGQUxTRSk7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgZWxzZQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBzcGluX3VubG9jaygmcEhkZEN0eC0+ZmlsdGVyX2xvY2spOworICAgICAgICAgICB9CisgICAgICB9CisgICB9Cit9CisKK3ZvaWQgaGRkX3JlZ2lzdGVyX21jYXN0X2JjYXN0X2ZpbHRlcihoZGRfY29udGV4dF90ICpwSGRkQ3R4KQoreworICAgdl9DT05URVhUX3QgcFZvc0NvbnRleHQ7CisgICB0SGFsSGFuZGxlIHNtZUNvbnRleHQ7CisKKyAgIHBWb3NDb250ZXh0ID0gdm9zX2dldF9nbG9iYWxfY29udGV4dChWT1NfTU9EVUxFX0lEX1NZUywgTlVMTCk7CisgICBpZiAoTlVMTCA9PSBwVm9zQ29udGV4dCkKKyAgIHsKKyAgICAgIGhkZExvZyhMT0dFLCAiJXM6IEludmFsaWQgcENvbnRleHQiLCBfX2Z1bmNfXyk7CisgICAgICByZXR1cm47CisgICB9CisgICBzbWVDb250ZXh0ID0gdm9zX2dldF9jb250ZXh0KFZPU19NT0RVTEVfSURfU01FLCBwVm9zQ29udGV4dCk7CisgICBpZiAoTlVMTCA9PSBzbWVDb250ZXh0KQorICAgeworICAgICAgaGRkTG9nKExPR0UsICIlczogSW52YWxpZCBzbWVDb250ZXh0IiwgX19mdW5jX18pOworICAgICAgcmV0dXJuOworICAgfQorCisgICBzcGluX2xvY2tfaW5pdCgmcEhkZEN0eC0+ZmlsdGVyX2xvY2spOworICAgaWYgKFdMQU5fTUFQX1NVU1BFTkRfVE9fTUNBU1RfQkNBU1RfRklMVEVSID09CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPmNmZ19pbmktPm5FbmFibGVTdXNwZW5kKQorICAgeworICAgICAgcG1jUmVnaXN0ZXJEZXZpY2VTdGF0ZVVwZGF0ZUluZChzbWVDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZGRfUG93ZXJTdGF0ZUNoYW5nZWRDQiwgcEhkZEN0eCk7CisgICB9Cit9CisKK3ZvaWQgaGRkX3VucmVnaXN0ZXJfbWNhc3RfYmNhc3RfZmlsdGVyKGhkZF9jb250ZXh0X3QgKnBIZGRDdHgpCit7CisgICB2X0NPTlRFWFRfdCBwVm9zQ29udGV4dDsKKyAgIHRIYWxIYW5kbGUgc21lQ29udGV4dDs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GVyKTsKKworICAgIGlmKGZlbmFibGUpCisgICAgeworICAgICAgICBpZiAoKGVDb25uZWN0aW9uU3RhdGVfQXNzb2NpYXRlZCA9PSBwSGRkU3RhQ3R4LT5jb25uX2luZm8uY29ublN0YXRlKSAmJgorICAgICAgICAgICAoR1RLX09GRkxPQURfRU5BQkxFID09IHBIZGRTdGFDdHgtPmd0a09mZmxvYWRSZXFQYXJhbXMudWxGbGFncyApKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJmhkZEd0a09mZmxvYWRSZXFQYXJhbXMsCisgICAgICAgICAgICAgICAgICZwSGRkU3RhQ3R4LT5ndGtPZmZsb2FkUmVxUGFyYW1zLAorICAgICAgICAgICAgICAgICBzaXplb2YgKHRTaXJHdGtPZmZsb2FkUGFyYW1zKSk7CisKKyAgICAgICAgICAgIHJldCA9IHNtZV9TZXRHVEtPZmZsb2FkKFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJmhkZEd0a09mZmxvYWRSZXFQYXJhbXMsIHBBZGFwdGVyLT5zZXNzaW9uSWQpOworICAgICAgICAgICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gcmV0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IHNtZV9TZXRHVEtPZmZsb2FkIGZhaWxlZCwgcmV0dXJuZWQgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcmV0KTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgIiVzOiBzbWVfU2V0R1RLT2ZmbG9hZCBzdWNjZXNzZnVsbCIsIF9fZnVuY19fKTsKKyAgICAgICAgfQorCisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGlmICgoZUNvbm5lY3Rpb25TdGF0ZV9Bc3NvY2lhdGVkID09IHBIZGRTdGFDdHgtPmNvbm5faW5mby5jb25uU3RhdGUpICYmCisgICAgICAgICAgICAoMCA9PSAgbWVtY21wKCZwSGRkU3RhQ3R4LT5ndGtPZmZsb2FkUmVxUGFyYW1zLmJzc0lkLAorICAgICAgICAgICAgICAgICAgICAgJnBIZGRTdGFDdHgtPmNvbm5faW5mby5ic3NJZCwgV05JX0NGR19CU1NJRF9MRU4pKSAmJgorICAgICAgICAgICAgKEdUS19PRkZMT0FEX0VOQUJMRSA9PSBwSGRkU3RhQ3R4LT5ndGtPZmZsb2FkUmVxUGFyYW1zLnVsRmxhZ3MpKQorICAgICAgICB7CisKKyAgICAgICAgICAgIC8qIEhvc3QgZHJpdmVyIGhhcyBwcmV2aW91c2x5ICBvZmZsb2FkZWQgR1RLIHJla2V5ICAqLworICAgICAgICAgICAgcmV0ID0gc21lX0dldEdUS09mZmxvYWQoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF9jZmc4MDIxMV91cGRhdGVfcmVwbGF5Q291bnRlckNhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlciwgcEFkYXB0ZXItPnNlc3Npb25JZCk7CisgICAgICAgICAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSByZXQpCisKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBzbWVfR2V0R1RLT2ZmbG9hZCBmYWlsZWQsIHJldHVybmVkICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHJldCk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICIlczogc21lX0dldEdUS09mZmxvYWQgc3VjY2Vzc2Z1bCIsCisgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKworICAgICAgICAgICAgICAgIC8qIFNlbmRpbmcgR1RLIG9mZmxvYWQgZGlzc2FibGUgKi8KKyAgICAgICAgICAgICAgICBtZW1jcHkoJmhkZEd0a09mZmxvYWRSZXFQYXJhbXMsICZwSGRkU3RhQ3R4LT5ndGtPZmZsb2FkUmVxUGFyYW1zLAorICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAodFNpckd0a09mZmxvYWRQYXJhbXMpKTsKKyAgICAgICAgICAgICAgICBoZGRHdGtPZmZsb2FkUmVxUGFyYW1zLnVsRmxhZ3MgPSBHVEtfT0ZGTE9BRF9ESVNBQkxFOworICAgICAgICAgICAgICAgIHJldCA9IHNtZV9TZXRHVEtPZmZsb2FkKFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmhkZEd0a09mZmxvYWRSZXFQYXJhbXMsIHBBZGFwdGVyLT5zZXNzaW9uSWQpOworICAgICAgICAgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHJldCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICA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wgcG93ZXJSZXF1ZXN0LnVMaXN0ZW5JbnRlcnZhbCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsIGVBTklfQk9PTEVBTl9GQUxTRSk7CisKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sIAorICAgICAgICAgICAgICAgICAgICAgICAgIlN3aXRjaCB0byBEVElNJWQiLHBvd2VyUmVxdWVzdC51TGlzdGVuSW50ZXJ2YWwpOworICAgICAgICAgc21lX1NldFBvd2VyUGFyYW1zKCBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksICZwb3dlclJlcXVlc3QsIEZBTFNFKTsKKworICAgICAgICAgaWYgKEJNUFMgPT0gcG1jR2V0UG1jU3RhdGUocEhkZEN0eC0+aEhhbCkpCisgICAgICAgICB7CisgICAgICAgICAgICAgLyogcHV0IHRoZSBkZXZpY2UgaW50byBmdWxsIHBvd2VyICovCisgICAgICAgICAgICAgd2xhbl9oZGRfZW50ZXJfYm1wcyhwQWRhcHRlciwgRFJJVkVSX1BPV0VSX01PREVfQUNUSVZFKTsKKworICAgICAgICAgICAgIC8qIHB1dCB0aGUgZGV2aWNlIGJhY2sgaW50byBCTVBTICovCisgICAgICAgICAgICAgd2xhbl9oZGRfZW50ZXJfYm1wcyhwQWRhcHRlciwgRFJJVkVSX1BPV0VSX01PREVfQVVUTyk7CisKKyAgICAgICAgICAgICBwSGRkQ3R4LT5oZGRfaWdub3JlX2R0aW1fZW5hYmxlZCA9IEZBTFNFOworICAgICAgICAgfQorICAgICAgfQorCisgICAgICBoZGRfY29uZl9yZXN1bWVfaW5kKHBBZGFwdGVyKTsKKyAgICAgIHN0YXR1cyA9IGhkZF9nZXRfbmV4dF9hZGFwdGVyICggcEhkZEN0eCwgcEFkYXB0ZXJOb2RlLCAmcE5leHQgKTsKKyAgICAgIHBBZGFwdGVyTm9kZSA9IHBOZXh0OworICAgfQorCisjaW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ICAgc28gc2V0dGluZyBpdCB0byBOVUxMIGluIGhkZCBjb250ZXh0Ki8KKyAgIHBIZGRDdHgtPmhIYWwgPSAodEhhbEhhbmRsZSlOVUxMOworCisgICBpZiAoZnJlZV9yaXZhX3Bvd2VyX29uX2xvY2soIndsYW4iKSkKKyAgIHsKKyAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogZmFpbGVkIHRvIGZyZWUgcG93ZXIgb24gbG9jayIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgfQorICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwgIiVzOiBXTEFOIGRyaXZlciBzaHV0ZG93biBjb21wbGV0ZSIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLF9fZnVuY19fKTsKKyAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9CisKKworCisvKiB0aGUgSEREIGludGVyZmFjZSB0byBXTEFOIGRyaXZlciByZS1pbml0LgorICogVGhpcyBpcyBjYWxsZWQgdG8gaW5pdGlhbGl6ZS9zdGFydCBXTEFOIGRyaXZlciBhZnRlciBhIHNodXRkb3duLgorICovCitWT1NfU1RBVFVTIGhkZF93bGFuX3JlX2luaXQodm9pZCkKK3sKKyAgIFZPU19TVEFUVVMgICAgICAgdm9zU3RhdHVzOworICAgdl9DT05URVhUX3QgICAgICBwVm9zQ29udGV4dCA9IE5VTEw7CisgICBoZGRfY29udGV4dF90ICAgICpwSGRkQ3R4ID0gTlVMTDsKKyAgIGVIYWxTdGF0dXMgICAgICAgaGFsU3RhdHVzOworI2lmZGVmIEhBVkVfV0NOU1NfQ0FMX0RPV05MT0FECisgICBpbnQgICAgICAgICAgICAgIG1heF9yZXRyaWVzID0gMDsKKyNlbmRpZgorI2lmZGVmIEhBVkVfQ0JDX0RPTkUKKyAgIGludCAgICAgICAgICAgICAgbWF4X2NiY19yZXRyaW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wIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgXGZpbGUgIHdsYW5faGRkX2Z0bS5jCisKKyAgXGJyaWVmIFRoaXMgZmlsZSBjb250YWlucyB0aGUgV0xBTiBmYWN0b3J5IHRlc3QgbW9kZSBpbXBsZW1lbnRhdGlvbgorCisKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgIEVESVQgSElTVE9SWSBGT1IgRklMRQorCisKKyAgVGhpcyBzZWN0aW9uIGNvbnRhaW5zIGNvbW1lbnRzIGRlc2NyaWJpbmcgY2hhbmdlcyBtYWRlIHRvIHRoZSBtb2R1bGUuCisgIE5vdGljZSB0aGF0IGNoYW5nZXMgYXJlIGxpc3RlZCBpbiByZXZlcnNlIGNocm9ub2xvZ2ljYWwgb3JkZXIuCisKKworICAkSGVhZGVyOiQgICAkRGF0ZVRpbWU6ICQgJEF1dGhvcjogJAorCisKKyAgd2hlbiAgICAgICAgd2hvICAgIHdoYXQsIHdoZXJlLCB3aHkKKyAgLS0tLS0tLS0gICAgLS0tICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgIDA0LzIwLzExICAgIExlby9IZW5yaSAgICAgIENvbnZlcmdlbmNlIGZvciBQcmltYSBhbmQgVm9sYW5zLiBTaW5nbGUgaW1hZ2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIEZUTSBhbmQgbWlzc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FXTEFOX1RYRklSX0NGR19EUERfQllQQVNTX01BU0sgICAgIDB4OAorCit0eXBlZGVmIHN0cnVjdCB7CisgICB0QU5JX1UzMiB0YWJsZVNpemU7ICAgICAgICAgICAgICAgICAgICAgIC8qIFdob2xlIE5WIFRhYmxlIFNpemUgKi8KKyAgIHRBTklfVTMyIGNodW5rU2l6ZTsgICAgICAgICAgICAgICAgICAgICAgLyogQ3VycmVudCBDaHVuayBTaXplIDwgMksgKi8KKyAgIGVOdlRhYmxlIG52VGFibGU7CisgICB0QU5JX1U4ICB0YWJsZURhdGE7ICAgICAgICAgICAgICAgICAgICAgLyogRmlsbGVkIGJ5IGhvc3QgZHJpdmVyICovCit9IHB0dEdldE52VGFibGU7CisKK3R5cGVkZWYgc3RydWN0IHsKKyAgIHRBTklfVTMyIHRhYmxlU2l6ZTsgICAgICAgICAgICAgICAgICAgICAgLyogV2hvbGUgTlYgVGFibGUgU2l6ZSAqLworICAgdEFOSV9VMzIgY2h1bmtTaXplOyAgICAgICAgICAgICAgICAgICAgICAvKiBDdXJyZW50IENodW5rIFNpemUgPCAySyAqLworICAgZU52VGFibGUgbnZUYWJsZTsKKyAgIHRBTklfVTggIHRhYmxlRGF0YTsKK30gcHR0U2V0TnZUYWJsZTsKKworCitleHRlcm4gY29uc3Qgc0hhbE52IG52RGVmYXVsdHM7CitzdGF0aWMgaW50IHdsYW5fZnRtX3JlZ2lzdGVyX3dleHQoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIpOworc3RhdGljIGludCB3bGFuX2Z0bV9zdG9wKGhkZF9jb250ZXh0X3QgKnBIZGRDdHgpOworVk9TX1NUQVRVUyB3bGFuX3dyaXRlX3RvX2VmcyAodl9VOF90ICpwRGF0YSwgdl9VMTZfdCBkYXRhX2xlbik7CisKK3N0YXRpYyByYXRlU3RyMnJhdGVJbmRleF90IHJhdGVOYW1lX3JhdGVJbmRleF90YmxbXSA9Cit7CisgICB7IEhBTF9QSFlfUkFURV8xMUJfTE9OR18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l9TR0lfMTk1X01CUFMsICBQSFlEQkdfUFJFQU1CTEVfTUlYRUR9LAorICAgeyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV8yNjBfTUJQUywgIFBIWURCR19QUkVBTUJMRV9NSVhFRH0sCisgICB7IEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzI5Ml81X01CUFMsUEhZREJHX1BSRUFNQkxFX01JWEVEfSwKKyAgIHsgSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9TR0lfMzI1X01CUFMsICBQSFlEQkdfUFJFQU1CTEVfTUlYRUR9LAorICAgeyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV8zOTBfTUJQUywgIFBIWURCR19QUkVBTUJMRV9NSVhFRH0sCisgICB7IEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzQzM18zX01CUFMsUEhZREJHX1BSRUFNQkxFX01JWEVEfSwKKyNlbmRpZgorfTsKKworc3RhdGljIHVuc2lnbmVkIGludCB2YWxpZF9jaGFubmVsW10gPSB7MSwgMiwgMywgNCwgNSwgNiwgNywgOCwgOSwgMTAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMSwgMTIsIDEzLCAxNCwgMzYsIDQwLCA0NCwgNDgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1MiwgNTYsIDYwLCA2NCwgMTAwLCAxMDQsIDEwOCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDExMiwgMTE2LCAxMjAsIDEyNCwgMTI4LCAxMzIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMzYsIDE0MCwgMTQ5LCAxNTMsIDE1NywgMTYxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTY1LCAyMDgsIDIxMiwgMjE2LCAyNDAsIDI0NCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI0OCwgMjUyLCAwIH07CitzdGF0aWMgdW5zaWduZWQgaW50IHZhbGlkX2NoYW5uZWxfY2I0MFtdID0geyAzLCA0LCA1LCA2LCA3LCA4LCA5LCAxMCwgMTEsIDM4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDIsIDQ2LCA1MCwgNTQsIDU4LCA2MiwgMTAyLCAxMDYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMTAsIDExNCwgMTE4LCAxMjIsIDEyNiwgMTMwLCAxMzQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMzgsIDE1MSwgMTU1LCAxNTksIDE2MywgMjEwLCAyMTQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNDIsIDI0NiwgMjUwLCAwIH07CitzdGF0aWMgdW5zaWduZWQgaW50IHZhbGlkX2NoYW5uZWxfY2I4MFtdID0geyA3LCA0MiwgNDYsIDUwLCA1NCwgNTgsIDEwNiwgMTEwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTE0LCAxMTgsIDEyMiwgMTI2LCAxMzAsIDEzNCwgMTU1LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTU5LCAyNDYsIDAgfTsKKwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgICB0QU5JX0JPT0xFQU4gZnJhbWVHZW5FbmFibGVkOworICAgIHRBTklfQk9PTEVBTiB3ZlJmR2VuRW5hYmxlZDsKKyAgICB0QU5JX0JPT0xFQU4gd2ZtRW5hYmxlZDsKKyAgICBzUHR0RnJhbWVHZW5QYXJhbXMgZnJhbWVQYXJhbXM7CisgICAgdl9VMTZfdCBwb3dlck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kFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAiJXM6IE9wZW5pbmcgVk9TUyIsIF9fZnVuY19fKTsKKworICAgaWYgKE5VTEwgPT0gZ3BWb3NDb250ZXh0KQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIiVzOiBUcnlpbmcgdG8gb3BlbiBWT1NTIHdpdGhvdXQgYSBQcmVPcGVuIixfX2Z1bmNfXyk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgfQorCisgICAvKiBJbml0aWFsaXplIHRoZSBwcm9iZSBldmVudCAqLworICAgaWYgKHZvc19ldmVudF9pbml0KCZncFZvc0NvbnRleHQtPlByb2JlRXZlbnQpICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICIlczogVW5hYmxlIHRvIGluaXQgcHJvYmVFdmVudCIsX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgIH0KKworICAgaWYodm9zX2V2ZW50X2luaXQoJihncFZvc0NvbnRleHQtPndkYUNvbXBsZXRlRXZlbnQpKSAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MgKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogVW5hYmxlIHRvIGluaXQgd2RhQ29tcGxldGVFdmVudCIsX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKTsKK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zQ29udGV4dC0+cE1BQ0NvbnRleHQpLCBncFZvc0NvbnRleHQtPnBIRERDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICZtYWNPcGVuUGFybXMpOworCisgICBpZiAoZVNJUl9TVUNDRVNTICE9IHNpclN0YXR1cykKKyAgIHsKKyAgICAgLyogQ3JpdGljYWwgRXJyb3IgLi4uICBDYW5ub3QgcHJvY2VlZCBmdXJ0aGVyICovCisgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiJXM6IEZhaWxlZCB0byBvcGVuIE1BQyAlZCIsIF9fZnVuY19fLCBzaXJTdGF0dXMpOworICAgICBWT1NfQVNTRVJUKDApOworICAgICBnb3RvIGVycl9udl9jbG9zZTsKKyAgIH0KKworICAgLyogTm93IHByb2NlZWQgdG8gb3BlbiB0aGUgU01FICovCisgICB2U3RhdHVzID0gc21lX09wZW4oZ3BWb3NDb250ZXh0LT5wTUFDQ29udGV4dCk7CisgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2U3RhdHVzKSkKKyAgIHsKKyAgICAgIC8qIENyaXRpY2FsIEVycm9yIC4uLiAgQ2Fubm90IHByb2NlZWQgZnVydGhlciAqLworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogRmFpbGVkIHRvIG9wZW4gU01FICVkIiwgX19mdW5jX18sIHZTdGF0dXMpOworICAgICAgZ290byBlcnJfbWFjX2Nsb3NlOworICAgfQorICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKKworCisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICIlczogVk9TUyBzdWNjZXNzZnVsbHk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Db250ZXh0KSkKKyAgeworICAgICB2b3NTdGF0dXMgPSBXREFfc2h1dGRvd24odm9zQ29udGV4dCwgVk9TX1RSVUUpOworICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBGYWlsZWQgdG8gc2h1dGRvd24gV0RBICVkIiwgX19mdW5jX18sIHZvc1N0YXR1cyk7CisgICAgICAgIFZPU19BU1NFUlQoVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpOworICAgICB9CisKKyAgfQorICBlbHNlCisgIHsKKyAgICAgdm9zU3RhdHVzID0gV0RBX2Nsb3NlKHZvc0NvbnRleHQpOworICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAiJXM6IEZhaWxlZCB0byBjbG9zZSBXREEgJWQiLCBfX2Z1bmNfXywgdm9zU3RhdHVzKTsKKyAgICAgICAgVk9TX0FTU0VSVChWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zU3RhdHVzKSk7CisgICAgIH0KKyAgfQorCisgIHZvc19tcV9kZWluaXQoJigocFZvc0NvbnRleHRUeXBlKXZvc0NvbnRleHQpLT5mcmVlVm9zTXEpOworCisgIHZvc1N0YXR1cyA9IHZvc19ldmVudF9kZXN0cm95KCZncFZvc0NvbnRleHQtPlByb2JlRXZlbnQpOworICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICB7CisgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT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BQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgIiVzOkZ0bSBoYXMgbm90IHN0YXJ0ZWQuIFBsZWFzZSBzdGFydCB0aGUgZnRtLiAiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICB9CisKKyAgICBpZiAoc3RhcnRTdG9wICE9IDEgJiYgc3RhcnRTdG9wICE9IDApCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAiJXM6VHggdmFsdWUgaXMgaW52YWxpZCAiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICB9CisKKyAgICBpZiAoKGZ0bV9zdGF0dXMud2ZSZkdlbkVuYWJsZWQgJiYgc3RhcnRTdG9wID09IDEpIHx8CisgICAgICAgICghZnRtX3N0YXR1cy53ZlJmR2VuRW5hYmxlZCAmJiBzdGFydFN0b3AgPT0gMCkpCisgICAgeworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworICAgIH0KKworICAgIGlmIChwTXNnQnVmID09IE5VTEwpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAiJXM6cE1zZ0J1ZiBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX05PTUVNOworICAgIH0KKyAgICB2b3NfbWVtX3NldChwTXNnQnVmLCBzaXplb2YodFB0dE1zZ2J1ZmZlciksIDApOworICAgIGlmIChzdGFydFN0b3AgPT0gMSkgeworICAgICAgICB0QU5JX1UxNiBudW1TYW1wbGVzID0gMTsKKyAgICAgICAgdEFOSV9CT09MRU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V9wb3N0bXNnIGZhaWxlZCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgICAgICAgICAgZ290byBkb25lOworICAgICAgICB9CisKKyAgICAgICAgd2FpdF9mb3JfY29tcGxldGlvbl9pbnRlcnJ1cHRpYmxlX3RpbWVvdXQoJnBIZGRDdHgtPmZ0bS5mdG1fY29tcF92YXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcyhXTEFOX0ZUTV9DT01NQU5EX1RJTUVfT1VUKSk7CisgICAgICAgIGlmKHBNc2dCdWYtPm1zZ1Jlc3BvbnNlICE9IFBUVF9TVEFUVVNfU1VDQ0VTUykgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgICAgICIlczpQdHQgcmVzcG9uc2Ugc3RhdHVzIGZhaWxlZCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgICAgICB9CisgICAgfQorZG9uZToKKyAgICBpZiAoc3RhdHVzID09IFZPU19TVEFUVVNfU1VDQ0VTUykgeworICAgICAgICBpZiAoc3RhcnRTdG9wID09IDEpCisgICAgICAgICAgICBmdG1fc3RhdHVzLndmUmZHZW5FbmFibGVkID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGZ0bV9zdGF0dXMud2ZSZkdlbkVuYWJsZWQgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9CisKKworc3RhdGljIFZPU19TVEFUVVMgd2xhbl9mdG1fcHJpdl9lbmFibGVfY2hhaW4oaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsdl9VMTZfdCBja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gICAgICAgIlIwIiwKKyAgICAgICAgIlIxIiwKKyAgICAgICAgIlQwIiwKKyAgICAgICAgIlIwLFIxLFQwIgorICAgIH07CisgICAgY2hhciAqcnhbXSA9IHsKKyAgICAgICAgImRpc2FibGUiLAorICAgICAgICAiMTFiL2cvbiIsCisgICAgICAgICIxMWcvbiIsCisgICAgICAgICIxMWIiCisgICAgfTsKKyAgICBjaGFyICp0eFtdID0geworICAgICAgICAic3RvcHBlZCIsCisgICAgICAgICJzdGFydGVkIiwKKyAgICB9OworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSAoaGRkX2NvbnRleHRfdCAqKXBBZGFwdGVyLT5wSGRkQ3R4OworCisgICAgaWYocEhkZEN0eC0+ZnRtLmZ0bV9zdGF0ZSAhPSBXTEFOX0ZUTV9TVEFSVEVEKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsICIlczpGdG0gaGFzIG5vdCBzdGFydGVkLiBQbGVhc2Ugc3RhcnQgdGhlIGZ0bS4gIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICB9CisKKyAgICBsZW5SZXMgPSBzbnByaW50ZihidWYsIGxlbkJ1ZiwgIlxuIGNoYWluU2VsZWN0OiAlc1xuIHJ4bW9kZTogJXNcbiAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0eHBrdGdlbjogJXNcbiAgdHhpZnM6ICVkXG4gIHR4cmF0ZTogIiwKKyAgICAgICAgICAgICAgICAgICAgICBjaGFpbltmdG1fc3RhdHVzLmNoYWluU2VsZWN0XSwgcnhbZnRtX3N0YXR1cy5yeG1vZGVdLAorICAgICAgICAgICAgICAgICAgICAgIHR4W2Z0bV9zdGF0dXMuZnJhbWVHZW5FbmFibGVkXSwKKyAgICAgICAgICAgICAgICAgICAgICBmdG1fc3RhdHVzLmZyYW1lUGFyYW1zLmludGVyRnJhbWVTcGFjZSk7CisgICAgaWYgKChsZW5SZXMgPCAwKSB8fCAobGVuUmVzID49IGxlbkJ1ZikpCisgICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIEZMKCJmYWlsZWQgdG8gY29weSBkYXRhIGludG8gYnVmICVkIiksIGxlblJlcyk7CisgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgIH0KKworICAgIGJ1ZiArPSBsZW5SZXM7CisgICAgbGVuQnVmIC09IGxlblJlczsKKworICAgIGZvciAoaWkgPSAwOyBpaSA8IFNJWkVfT0ZfVEFCTEUocmF0ZU5hbWVfcmF0ZUluZGV4X3RibCk7IGlpKyspCisgICAgeworICAgICAgICBpZiAocmF0ZU5hbWVfcmF0ZUluZGV4X3RibFtpaV0ucmF0ZV9pbmRleCA9PSBmdG1fc3RhdHVzLmZyYW1lUGFyYW1zLnJhdGUpCisgICAgICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICBpZiAoaWkgPCBTSVpFX09GX1RBQkxFKHJhdGVOYW1lX3JhdGVJbmRleF90YmwpKQorICAgIHsKKyAgICAgICAgbGVuUmVzID0gc3RybGNweShidWYsIHJhdGVOYW1lX3JhdGVJbmRleF90YmxbaWldLnJhdGVfc3RyLCBsZW5CdWYpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBsZW5SZXMgPSBzdHJsY3B5KGJ1ZiwgImludmFsaWQiLCBsZW5CdWYpOworICAgIH0KKyAgICBpZiAoKGxlblJlcyA8IDApIHx8IChsZW5SZXMgPj0gbGVuQnVmKSkKKyAgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICBGTCgiZmFpbGVkIHRvIGNvcHkgZGF0YSBpbnRvIGJ1ZiAlZCIpLCBsZW5SZXMpOworICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICB9CisKKyAgICBidWYgKz0gbGVuUmVzOworICAgIGxlbkJ1ZiAtPSBsZW5SZXM7CisKKyAgICBsZW5SZXMgPSBzbnByaW50ZihidWYsIGxlbkJ1ZiwgIlxuICBwb3dlciBjdGwgbW9kZTogJWRcbiAgdHhwa3RjbnQ6ICVkXG4gICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInR4cGt0bGVuOiAlZFxuIiwgZnRtX3N0YXR1cy5wb3dlckN0bE1vZGUsCisgICAgICAgICAgICAgICAgICAgICAgZnRtX3N0YXR1cy5mcmFtZVBhcmFtcy5udW1UZXN0UGFja2V0cywKKyAgICAgICAgICAgICAgICAgICAgICBmdG1fc3RhdHVzLmZyYW1lUGFyYW1zLnBheWxvYWRMZW5ndGgpOworCisgICAgaWYgKChsZW5SZXMgPCAwKSB8fCAobGVuUmVzID49IGxlbkJ1ZikpCisgICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgRkwoImZhaWxlZCB0byBjb3B5IGRhdGEgaW50byBidWYgJWQiKSwgbGVuUmVzKTsKKyAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgfQorCisgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworCit2b2lkIEhFWERVTVAoY2hhciAqczAsIGNoYXIgKnMxLCBpbnQgbGVuKQoreworICAgIGludCBpID0gMCwgaiA9IDA7CisgICAgcHJpbnRrKEtFUk5fRU1FUkcgIiVzXG4gOiIsIHMwKTsKKworICAgIGlmIChsZW4gPiA4KQorICAgIHsKKyAgICAgICAgZm9yIChqID0gMDsgaiA8IGxlbi84OyBqKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIHBy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U1MgKQorICAgIHsKKyAgICAgICBpZiAoIHZTdGF0dXMgPT0gVk9TX1NUQVRVU19FX1RJTUVPVVQgKQorICAgICAgIHsKKyAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgIiVzOiBUaW1lb3V0IG9jY3VycmVkIGJlZm9yZSBXREFfTlZEb3dubG9hZF9TdGFydCBjb21wbGV0ZSIsX19mdW5jX18pOworICAgICAgIH0KKyAgICAgICBlbHNlCisgICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIiVzOiBXREFfTlZEb3dubG9hZF9TdGFydCByZXBvcnRpbmcgIG90aGVyIGVycm9yIixfX2Z1bmNfXyk7CisgICAgICAgfQorICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgV0RBX3NldE5lZWRTaHV0ZG93bihwSGRkQ3R4LT5wdm9zQ29udGV4dCk7CisgICAgICAgZ290byBlcnJfc3RhdHVzX2ZhaWx1cmU7CisgICAgfQorCisgICAgdlN0YXR1cyA9IFdEQV9zdGFydChwVm9zQ29udGV4dCk7CisgICAgaWYgKHZTdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgIHsKKyAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogRmFpbGVkIHRvIHN0YXJ0IFdEQSIsX19mdW5jX18pOworICAgICAgIGdvdG8gZXJyX3N0YXR1c19mYWlsdXJlOworICAgIH0KKworCisgICAgLyogU3RhcnQgdGhlIE1BQyAqLworICAgIHZvc19tZW1femVybygodl9QVk9JRF90KSZoYWxTdGFydFBhcmFtcywgc2l6ZW9mKH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FRSVUUpCisgICB7CisgICAgICAgLyogIFNUT1AgTUFDIG9ubHkgKi8KKyAgICAgICB2X1ZPSURfdCAqaEhhbDsKKyAgICAgICBoSGFsID0gdm9zX2dldF9jb250ZXh0KCBWT1NfTU9EVUxFX0lEX1NNRSwgcEhkZEN0eC0+cHZvc0NvbnRleHQgKTsKKyAgICAgICBpZiAoTlVMTCA9PSBoSGFsKQorICAgICAgIHsKKyAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IE5VTEwgaEhhbCIsIF9fZnVuY19fKTsKKyAgICAgICB9CisgICAgICAgZWxzZQorICAgICAgIHsKKyAgICAgICAgICAgdm9zU3RhdHVzID0gbWFjU3RvcChoSGFsLCBIQUxfU1RPUF9UWVBFX1NZU19ERUVQX1NMRUVQICk7CisgICAgICAgICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogRmFpbGVkIHRvIHN0b3AgU1lTIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgVk9TX0FTU0VSVCggVk9TX0lTX1NUQVRVU19TVUNDRVNTKCB2b3NTdGF0dXMgKSApOworICAgICAgICAgICB9CisgICAgICAgfQorCisKKyAgICAgICBXREFfc3RvcChwSGRkQ3R4LT5wdm9zQ29udGV4dCwgSEFMX1NUT1BfVFlQRV9SRl9LSUxMKTsKKworICAgIH0KKyAgIHJldHVybiBXTEFOX0ZUTV9TVUNDRVNTOworfQorCisvKiotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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saWQgZHJpdmVyIGNvbnRleHQiKTsKKyAgICAgIHJldHVybiAtRUlOVkFMOworICAgfQorCisgICBudlZlcnNpb24gPSB2b3NfbnZfZ2V0TnZWZXJzaW9uKCk7CisgICBpZiAoRV9OVl9WMiAhPSBudlZlcnNpb24pCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgIiVzIDogTm90IHZhbGlkIE5WIFZlcnNpb24gJWQiLCBfX2Z1bmNfXywgbnZWZXJzaW9uKTsKKyAgICAgIHJldHVybiAtRUlOVkFMOworICAgfQorCisgICAvKiBUZXN0IGZpcnN0IGNodW5rIG9mIE5WIHRhYmxlICovCisgICBpZiAoKE5WX01BWF9UQUJMRSA9PSBwSGRkQ3R4LT5mdG0ucHJvY2Vzc2luZ05WVGFibGUpIHx8CisgICAgICAoMCA9PSBwSGRkQ3R4LT5mdG0ucHJvY2Vzc2VkTlZUYWJsZVNpemUpKQorICAgeworICAgICAgbnZTdGF0dXMgPSB2b3NfbnZfZ2V0TlZCdWZmZXIoKHZvaWQgKiopJm52Q29udGVudHMsICZudlNpemUpOworICAgICAgaWYgKChWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gbnZTdGF0dXMpIHx8IChOVUxMID09IG52Q29udGVudHMpKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICBGTCgiRmFpbCB0byBnZXQgY2FjaGVkIE5WIHZhbHVlIFN0YXR1cyAlZCIpLCBudlN0YXR1cyk7CisgICAgICAgICByZXR1cm4gLUVJTzsKKyAgICAgIH0KKworICAgICAgc3dpdGNoIChudlRhYmxlLT5udlRhYmxlKQorICAgICAgeworICAgICAgICAgY2FzZSBOVl9UQUJMRV9SQVRFX1BPV0VSX1NFVFRJTkdTOgorICAgICAgICAgICAgcEhkZEN0eC0+ZnRtLnRhcmdldE5WVGFibGVTaXplID0gc2l6ZW9mKG52Q29udGVudHMtPnRhYmxlcy5wd3JPcHRpbXVtKTsKKyAgICAgICAgICAgIHBIZGRDdHgtPmZ0bS50YXJnZXROVlRhYmxlUG9pbnRlciA9ICh2X1U4X3QgKikmbnZDb250ZW50cy0+dGFibGVzLnB3ck9wdGltdW07CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgY2FzZSBOVl9UQUJMRV9SRUdVTEFUT1JZX0RPTUFJTlM6CisgICAgICAgICAgICBwSGRkQ3R4LT5mdG0udGFyZ2V0TlZUYWJsZVNpemUgPSBzaXplb2YobnZDb250ZW50cy0+dGFibGVzLnJlZ0RvbWFpbnMpOworICAgICAgICAgICAgcEhkZEN0eC0+ZnRtLnRhcmdldE5WVGFibGVQb2ludGVyID0gKHZfVThfdCAqKSZudkNvbnRlbnRzLT50YWJsZXMucmVnRG9tYWluczsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICBjYXNlIE5WX1RBQkxFX0RFRkFVTFRfQ09VTlRSWToKKyAgICAgICAgICAgIHBIZGRDdHgtPmZ0bS50YXJnZXROVlRhYmxlU2l6ZSA9IHNpemVvZihudkNvbnRlbnRzLT50YWJsZXMuZGVmYXVsdENvdW50cnlUYWJsZSk7CisgICAgICAgICAgICBwSGRkQ3R4LT5mdG0udGFyZ2V0TlZUYWJsZVBvaW50ZXIgPSAodl9VOF90ICopJm52Q29udGVudHMtPnRhYmxlcy5kZWZhdWx0Q291bnRyeVRhYmxlOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgIGNhc2UgTlZfVEFCTEVfVFBDX1BPV0VSX1RBQkxFOgorICAgICAgICAgICAgcEhkZEN0eC0+ZnRtLnRhcmdldE5WVGFibGVTaXplID0gc2l6ZW9mKG52Q29udGVudHMtPnRhYmxlcy5wbHV0Q2hhcmFjdGVyaXplZCk7CisgICAgICAgICAgICBwSGRkQ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lDaGFuT2Zmc2V0c1swXTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICBjYXNlIE5WX1RBQkxFX0hXX0NBTF9WQUxVRVM6CisgICAgICAgICAgICBwSGRkQ3R4LT5mdG0udGFyZ2V0TlZUYWJsZVNpemUgPSBzaXplb2YobnZDb250ZW50cy0+dGFibGVzLmh3Q2FsVmFsdWVzKTsKKyAgICAgICAgICAgIHBIZGRDdHgtPmZ0bS50YXJnZXROVlRhYmxlUG9pbnRlciA9ICh2X1U4X3QgKikmbnZDb250ZW50cy0+dGFibGVzLmh3Q2FsVmFsdWVzOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgIGNhc2UgTlZfVEFCTEVfRldfQ09ORklHOgorICAgICAgICAgICAgcEhkZEN0eC0+ZnRtLnRhcmdldE5WVGFibGVTaXplID0gc2l6ZW9mKG52Q29udGVudHMtPnRhYmxlcy5md0NvbmZpZyk7CisgICAgICAgICAgICBwSGRkQ3R4LT5mdG0udGFyZ2V0TlZUYWJsZVBvaW50ZXIgPSAodl9VOF90ICopJm52Q29udGVudHMtPnRhYmxlcy5md0NvbmZpZzsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICBjYXNlIE5WX1RBQkxFX0FOVEVOTkFfUEFUSF9MT1NTOgorICAgICAgICAgICAgcEhkZEN0eC0+ZnRtLnRhcmdldE5WVGFibGVTaXplID0gc2l6ZW9mKG52Q29udGVudHMtPnRhYmxlcy5hbnRlbm5hUGF0aExvc3MpOworICAgICAgICAgICAgcEhkZEN0eC0+ZnRtLnRhcmdldE5WVGFibGVQb2ludGVyID0gKHZfVThfdCAqKSZudkNvbnRlbnRzLT50YWJsZXMuYW50ZW5uYVBhdGhMb3NzWzBdOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgIGNhc2UgTlZfVEFCTEVfUEFDS0VUX1RZUEVfUE9XRVJfTElNSVRTOgorICAgICAgICAgICAgcEhkZEN0eC0+ZnRtLnRhcmdldE5WVGFibGVTaXplID0gc2l6ZW9mKG52Q29udGVudHMtPnRhYmxlcy5wa3RUeXBlUHdyTGltaXRzKTsKKyAgICAgICAgICAgIHBIZGRDdHgtPmZ0bS50YXJnZXROVlRhYmxlUG9pbnRlciA9ICh2X1U4X3QgKikmbnZDb250ZW50cy0+dGFibGVzLnBrdFR5cGVQd3JMaW1pdHNbMF1bMF07CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICJOb3QgVmFsaWQgTlYgVGFibGUgJWQiLCBudlRhYmxlLT5udlRhYmxlKTsKKyAgICAgICAgICAgIHJldHVybiAtRUlPOworICAgICAgICAgICAgYnJlYWs7CisgICAgICB9CisKKyAgICAgIGlmIChwSGRkQ3R4LT5mdG0udGFyZ2V0TlZUYWJsZVNpemUgIT0gbnZUYWJsZS0+dGFibGVTaXplKQorICAgICAgeworICAgICAgICAgLyogSW52YWxpZCB0YWJsZSBzaXplLCBkaXNjYXJkIGFuZCBpbml0aWFsaXplIGRhdGEgKi8KKyAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgICJJbnZhbGlkIFRhYmxlIFNpemUgJWQgZm9yIFRhYmxlICVkIgorICAgICAgICAgICAgICAgICAgICAiIGV4cGVjdGVkIHNpemUgJWQiLCBudlRhYmxlLT50YWJsZVNpemUsIG52VGFibGUtPm52VGFibGUsCisgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPmZ0bS50YXJnZXROVlRhYmxlU2l6ZSk7CisgICAgICAgICBwSGRkQ3R4LT5mdG0ucHJvY2Vzc2luZ05WVGFibGUgICAgPSBOVl9NQVhfVEFCTEU7CisgICAgICAgICBwSGRkQ3R4LT5mdG0udGFyZ2V0TlZUYWJsZVNpemUgICAgPSAwOworICAgICAgICAgcEhkZEN0eC0+ZnRtLnByb2Nlc3NlZE5WVGFibGVTaXplID0gMDsKKyAgICAgICAgIHZvc19tZW1femVybyhwSGRkQ3R4LT5mdG0udGVtcE5WVGFibGVCdWZmZXIsIE1BWF9OVl9UQUJMRV9TSVpFKTsKKyAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgfQorCisgICAgICAvKiBTZXQgQ3VycmVudCBQcm9jZXNzaW5nIE5WIHRhYmxlIHR5cGUgKi8KKyAgICAgIHBIZGRDdHgtPmZ0bS5wcm9jZXNzaW5nTlZUYWJsZSA9IG52VGFibGUtPm52VGFibGU7CisgICAgICAvKiBDb3B5IHRhcmdldCBOViB0YWJsZSB2YWx1ZSBpbnRvIHRlbXAgY29udGV4dCBidWZmZXIgKi8KKyAgICAgIHZvc19tZW1fY29weShwSGRkQ3R4LT5mdG0udGVtcE5WVGFibGVCdWZmZXIsCisgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+ZnRtLnRhcmdldE5WVGFibGVQb2ludGVyLAorICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPmZ0bS50YXJnZXROVlRhYmxlU2l6ZSk7CisKKyAgIH0KKworICAgaWYgKHBIZGRDdHgtPmZ0bS5wcm9jZXNzaW5nTlZUYWJsZSAhPSBudlRhYmxlLT5udlRhYmxlKQorICAgeworICAgICAgLyogSW52YWxpZCB0YWJsZSB0eXBlICovCisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAiSW52YWxpZCBOViBUYWJsZSwgbm93IFByb2Nlc3NpbmcgJWQsIG5vdCAlZCIsCisgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT5mdG0ucHJvY2Vzc2luZ05WVGFibGUsIG52VGFibGUtPm52VGFibGUpOworICAgICAgcEhkZEN0eC0+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ICAgICAgcEhkZEN0eC0+ZnRtLnRhcmdldE5WVGFibGVQb2ludGVyID0gKHZfVThfdCAqKSZudkNvbnRlbnRzLT50YWJsZXMuZGVmYXVsdENvdW50cnlUYWJsZTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICBjYXNlIE5WX1RBQkxFX1RQQ19QT1dFUl9UQUJMRToKKyAgICAgICAgICAgIHBIZGRDdHgtPmZ0bS50YXJnZXROVlRhYmxlU2l6ZSAgICA9IHNpemVvZihudkNvbnRlbnRzLT50YWJsZXMucGx1dENoYXJhY3Rlcml6ZWQpOworICAgICAgICAgICAgcEhkZEN0eC0+ZnRtLnRhcmdldE5WVGFibGVQb2ludGVyID0gKHZfVThfdCAqKSZudkNvbnRlbnRzLT50YWJsZXMucGx1dENoYXJhY3Rlcml6ZWRbMF07CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgY2FzZSBOVl9UQUJMRV9UUENfUERBRENfT0ZGU0VUUzoKKyAgICAgICAgICAgIHBIZGRDdHgtPmZ0bS50YXJnZXROVlRhYmxlU2l6ZSAgICA9IHNpemVvZihudkNvbnRlbnRzLT50YWJsZXMucGx1dFBkYWRjT2Zmc2V0KTsKKyAgICAgICAgICAgIHBIZGRDdHgtPmZ0bS50YXJnZXROVlRhYmxlUG9pbnRlciA9ICh2X1U4X3QgKikmbnZDb250ZW50cy0+dGFibGVzLnBsdXRQZGFkY09mZnNldFswXTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICBjYXNlIE5WX1RBQkxFX1ZJUlRVQUxfUkFURToKKyAgICAgICAgICAgIHBIZGRDdHgtPmZ0bS50YXJnZXROVlRhYmxlU2l6ZSA9IHNpemVvZihudkNvbnRlbnRzLT50YWJsZXMucHdyT3B0aW11bV92aXJ0dWFsUmF0ZSk7CisgICAgICAgICAgICBwSGRkQ3R4LT5mdG0udGFyZ2V0TlZUYWJsZVBvaW50ZXIgPSAodl9VOF90ICopJm52Q29udGVudHMtPnRhYmxlcy5wd3JPcHRpbXVtX3ZpcnR1YWxSYXRlWzBdOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgIGNhc2UgTlZfVEFCTEVfUlNTSV9DSEFOTkVMX09GRlNFVFM6CisgICAgICAgICAgICBwSGRkQ3R4LT5mdG0udGFyZ2V0TlZUYWJsZVNpemUgICAgPSBzaXplb2YobnZDb250ZW50cy0+dGFibGVzLnJzc2lDaGFuT2Zmc2V0cyk7CisgICAgICAgICAgICBwSGRkQ3R4LT5mdG0udGFyZ2V0TlZUYWJsZVBvaW50ZXIgPSAodl9VOF90ICopJm52Q29udGVudHMtPnRhYmxlcy5yc3NpQ2hhbk9mZnNldHNbMF07CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgY2FzZSBOVl9UQUJMRV9IV19DQUxfVkFMVUVTOgorICAgICAgICAgICAgcEhkZEN0eC0+ZnRtLnRhcmdldE5WVGFibGVTaXplICAgID0gc2l6ZW9mKG52Q29udGVudHMtPnRhYmxlcy5od0NhbFZhbHVlcyk7CisgICAgICAgICAgICBwSGRkQ3R4LT5mdG0udGFyZ2V0TlZUYWJsZVBvaW50ZXIgPSAodl9VOF90ICopJm52Q29udGVudHMtPnRhYmxlcy5od0NhbFZhbHVlczsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICBjYXNlIE5WX1RBQkxFX0ZXX0NPTkZJRzoKKyAgICAgICAgICAgIHBIZGRDdHgtPmZ0bS50YXJnZXROVlRhYmxlU2l6ZSAgICA9IHNpemVvZihudkNvbnRlbnRzLT50YWJsZXMuZndDb25maWcpOworICAgICAgICAgICAgcEhkZEN0eC0+ZnRtLnRhcmdldE5WVGFibGVQb2ludGVyID0gKHZfVThfdCAqKSZudkNvbnRlbnRzLT50YWJsZXMuZndDb25maWc7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgY2FzZSBOVl9UQUJMRV9BTlRFTk5BX1BBVEhfTE9TUzoKKyAgICAgICAgICAgIHBIZGRDdHgtPmZ0bS50YXJnZ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9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICBGTCgiRmFpbCB0byBnZXQgY2FjaGVkIE5WIHZhbHVlIFN0YXR1cyAlZCIpLCBudlN0YXR1cyk7CisgICAgICByZXR1cm4gLUVJTzsKKyAgIH0KKworICAgbnZWZXJzaW9uID0gdm9zX252X2dldE52VmVyc2lvbigpOworICAgaWYgKEVfTlZfVjIgIT0gbnZWZXJzaW9uKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICIlcyA6IE5vdCB2YWxpZCBOViBWZXJzaW9uICVkIiwgX19mdW5jX18sIG52VmVyc2lvbik7CisgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgIH0KKworICAgaXRlbVNpemUgPSBzaXplb2YobnZDb250ZW50cy0+dGFibGVzLnB3ck9wdGltdW0pOworICAgbWVtY3B5KCZudkNvbnRlbnRzLT50YWJsZXMucHdyT3B0aW11bSwKKyAgICAgICAgICAmbnZEZWZhdWx0c1YyLnRhYmxlcy5wd3JPcHRpbXVtLAorICAgICAgICAgIGl0ZW1TaXplKTsKKworICAgaXRlbVNpemUgPSBzaXplb2YobnZDb250ZW50cy0+dGFibGVzLnJlZ0RvbWFpbnMpOworICAgbWVtY3B5KCZudkNvbnRlbnRzLT50YWJsZXMucmVnRG9tYWlucywKKyAgICAgICAgICAmbnZEZWZhdWx0c1YyLnRhYmxlcy5yZWdEb21haW5zLAorICAgICAgICAgIGl0ZW1TaXplKTsKKworICAgaXRlbVNpemUgPSBzaXplb2YobnZDb250ZW50cy0+dGFibGVzLmRlZmF1bHRDb3VudHJ5VGFibGUpOworICAgbWVtY3B5KCZudkNvbnRlbnRzLT50YWJsZXMuZGVmYXVsdENvdW50cnlUYWJsZSwKKyAgICAgICAgICAmbnZEZWZhdWx0c1YyLnRhYmxlcy5kZWZhdWx0Q291bnRyeVRhYmxlLAorICAgICAgICAgIGl0ZW1TaXplKTsKKworICAgaXRlbVNpemUgPSBzaXplb2YobnZDb250ZW50cy0+dGFibGVzLnBsdXRDaGFyYWN0ZXJpemVkKTsKKyAgIG1lbWNweSgmbnZDb250ZW50cy0+dGFibGVzLnBsdXRDaGFyYWN0ZXJpemVkWzBdLAorICAgICAgICAgICZudkRlZmF1bHRzVjIudGFibGVzLnBsdXRDaGFyYWN0ZXJpemVkWzBdLAorICAgICAgICAgIGl0ZW1TaXplKTsKKworICAgaXRlbVNpemUgPSBzaXplb2YobnZDb250ZW50cy0+dGFibGVzLnBsdXRQZGFkY09mZnNldCk7CisgICBtZW1jcHkoJm52Q29udGVudHMtPnRhYmxlcy5wbHV0UGRhZGNPZmZzZXRbMF0sCisgICAgICAgICAgJm52RGVmYXVsdHNWMi50YWJsZXMucGx1dFBkYWRjT2Zmc2V0WzBdLAorICAgICAgICAgIGl0ZW1TaXplKTsKKworICAgaXRlbVNpemUgPSBzaXplb2YobnZDb250ZW50cy0+dGFibGVzLnB3ck9wdGltdW1fdmlydHVhbFJhdGUpOworICAgbWVtY3B5KCZudkNvbnRlbnRzLT50YWJsZXMucHdyT3B0aW11bV92aXJ0dWFsUmF0ZVswXSwKKyAgICAgICAgICAmbnZEZWZhdWx0c1YyLnRhYmxlcy5wd3JPcHRpbXVtX3ZpcnR1YWxSYXRlWzBdLAorICAgICAgICAgIGl0ZW1TaXplKTsKKworICAgaXRlbVNpemUgPSBzaXplb2YobnZDb250ZW50cy0+dGFibGVzLnJzc2lDaGFuT2Zmc2V0cyk7CisgICBtZW1jcHkoJm52Q29udGVudHMtPnRhYmxlcy5yc3NpQ2hhbk9mZnNldHNbMF0sCisgICAgICAgICAgJm52RGVmYXVsdHNWMi50YWJsZXMucnNzaUNoYW5PZmZzZXRzWzBdLAorICAgICAgICAgIGl0ZW1TaXplKTsKKworICAgaXRlbVNpemUgPSBzaXplb2Yob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KTsKKyAgIGlmIChFX05WX1YyICE9IG52VmVyc2lvbikKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAiJXMgOiBOb3QgdmFsaWQgTlYgVmVyc2lvbiAlZCIsIF9fZnVuY19fLCBudlZlcnNpb24pOworICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICB9CisKKyAgIHN3aXRjaCAobnZUYWJsZS0+bnZUYWJsZSkKKyAgIHsKKyAgICAgIGNhc2UgTlZfVEFCTEVfUkFURV9QT1dFUl9TRVRUSU5HUzoKKyAgICAgICAgIGl0ZW1TaXplID0gc2l6ZW9mKG52Q29udGVudHMtPnRhYmxlcy5wd3JPcHRpbXVtKTsKKyAgICAgICAgIG1lbWNweSgmbnZDb250ZW50cy0+dGFibGVzLnB3ck9wdGltdW0sCisgICAgICAgICAgICAgICAgJm52RGVmYXVsdHNWMi50YWJsZXMucHdyT3B0aW11bSwKKyAgICAgICAgICAgICAgICBpdGVtU2l6ZSk7CisgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBOVl9UQUJMRV9SRUdVTEFUT1JZX0RPTUFJTlM6CisgICAgICAgICBpdGVtU2l6ZSA9IHNpemVvZihudkNvbnRlbnRzLT50YWJsZXMucmVnRG9tYWlucyk7CisgICAgICAgICBtZW1jcHkoJm52Q29udGVudHMtPnRhYmxlcy5yZWdEb21haW5zLAorICAgICAgICAgICAgICAgICZudkRlZmF1bHRzVjIudGFibGVzLnJlZ0RvbWFpbnMsCisgICAgICAgICAgICAgICAgaXRlbVNpemUpOworICAgICAgICAgYnJlYWs7CisKKyAgICAgIGNhc2UgTlZfVEFCTEVfREVGQVVMVF9DT1VOVFJZOgorICAgICAgICAgaXRlbVNpemUgPSBzaXplb2YobnZDb250ZW50cy0+dGFibGVzLmRlZmF1bHRDb3VudHJ5VGFibGUpOworICAgICAgICAgbWVtY3B5KCZudkNvbnRlbnRzLT50YWJsZXMuZGVmYXVsdENvdW50cnlUYWJsZSwKKyAgICAgICAgICAgICAgICAmbnZEZWZhdWx0c1YyLnRhYmxlcy5kZWZhdWx0Q291bnRyeVRhYmxlLAorICAgICAgICAgICAgICAgIGl0ZW1TaXplKTsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIE5WX1RBQkxFX1RQQ19QT1dFUl9UQUJMRToKKyAgICAgICAgIGl0ZW1TaXplID0gc2l6ZW9mKG52Q29udGVudHMtPnRhYmxlcy5wbHV0Q2hhcmFjdGVyaXplZCk7CisgICAgICAgICBtZW1jcHkoJm52Q29udGVudHMtPnRhYmxlcy5wbHV0Q2hhcmFjdGVyaXplZFswXSwKKyAgICAgICAgICAgICAgICAmbnZEZWZhdWx0c1YyLnRhYmxlcy5wbHV0Q2hhcmFjdGVyaXplZFswXSwKKyAgICAgICAgICAgICAgICBpdGVtU2l6ZSk7CisgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBOVl9UQUJMRV9UUENfUERBRENfT0ZGU0VUUzoKKyAgICAgICAgIGl0ZW1TaXplID0gc2l6ZW9mKG52Q29udGVudHMtPnRhYmxlcy5wbHV0UGRhZGNPZmZzZXQpOworICAgICAgICAgbWVtY3B5KCZudkNvbnRlbnRzLT50YWJsZXMucGx1dFBkYWRjT2Zmc2V0WzBdLAorICAgICAgICAgICAgICAgICZudkRlZmF1bHRzVjIudGFibGVzLnBsdXRQZGFkY09mZnNldFswXSwKKyAgICAgICAgICAgICAgICBpdGVtU2l6ZSk7CisgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBOVl9UQUJMRV9WSVJUVUFMX1JBVEU6CisgICAgICAgICBpdGVtU2l6ZSA9IHNpemVvZihudkNvbnRlbnRzLT50YWJsZXMucHdyT3B0aW11bV92aXJ0dWFsUmF0ZSk7CisgICAgICAgICBtZW1jcHkoJm52Q29udGVudHMtPnRhYmxlcy5wd3JPcHRpbXVtX3ZpcnR1YWxSYXRlWzBdLAorICAgICAgICAgICAgICAgICZudkRlZmF1bHRzVjIudGFibGVzLnB3ck9wdGltdW1fdmlydHVhbFJhdGVbMF0sCisgICAgICAgICAgICAgICAgaXRlbVNpemUpOworICAgICAgICAgYnJlYWs7CisKKyAgICAgIGNhc2UgTlZfVEFCTEVfUlNTSV9DSEFOTkVMX09GRlNFVFM6CisgICAgICAgICBpdGVtU2l6ZSA9IHNpemVvZihudkNvbnRlbnRzLT50YWJsZXMucnNzaUNoYW5PZmZzZXRzKTsKKyAgICAgICAgIG1lbWNweSgmbnZDb250ZW50cy0+dGFibGVzLnJzc2lDaGFuT2Zmc2V0c1swXSwKKyAgICAgICAgICAgICAgICAmbnZEZWZhdWx0c1YyLnRhYmxlcy5yc3NpQ2hhbk9mZnNldHNbMF0sCisgICAgICAgICAgICAgICAgaXRlbVNpemUpOworICAgICAgICAgYnJlYWs7CisKKyAgICAgIGNhc2UgTlZfVEFCTEVfSFdfQ0FMX1ZBTFVFUzoKKyAgICAgICAgIGl0ZW1TaXplID0gc2l6ZW9mKG52Q29udGVudHMtPnRhYmxlcy5od0NhbFZhbHVlcyk7CisgICAgICAgICBtZW1jcHkoJm52Q29udGVudHMtPnRhYmxlcy5od0NhbFZhbHVlcywKKyAgICAgICAgICAgICAgICAmbnZEZWZhdWx0c1YyLnRhYmxlcy5od0NhbFZhbHVlcywKKyAgICAgICAgICAgICAgICBpdGVtU2l6ZSk7CisgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBOVl9UQUJMRV9GV19DT05GSUc6CisgICAgICAgICBpdGVtU2l6ZSA9IHNpemVvZihudkNvbnRlbnRzLT50YWJsZXMuZndDb25maWcpOworICAgICAgICAgbWVtY3B5KCZudkNvbnRlbnRzLT50YWJsZXMuZndDb25maWcsCisgICAgICAgICAgICAgICAgJm52RGVmYXVsdHNWMi50YWJsZXMuZndDb25maWcsCisgICAgICAgICAgICAgICAgaXRlbVNpemUpOworICAgICAgICAgYnJlYWs7CisKKyAgICAgIGNhc2UgTlZfVEFCTEVfQU5URU5OQV9QQVRIX0xPU1M6CisgICAgICAgICBpdGVtU2l6ZSA9IHNpemVvZihudkNvbnRlbnRzLT50YWJsZXMuYW50ZW5uYVBhdGhMb3NzKTsKKyAgICAgICAgIG1lbWNweSgmbnZDb250ZW50cy0+dGFibGVzLmFudGVubmFQYXRoTG9zc1swXSwKKyAgICAgICAgICAgICAgICAmbnZEZWZhdWx0c1YyLnRhYmxlcy5hbnRlbm5hUGF0aExvc3NbMF0sCisgICAgICAgICAgICAgICAgaXRlbVNpemUpOworICAgICAgICAgYnJlYWs7CisKKyAgICAgIGNhc2UgTlZfVEFCTEVfUEFDS0VUX1RZUEVfUE9XRVJfTElNSVRTOgorICAgICAgICAgaXRlbVNpemUgPSBzaXplb2YobnZDb250ZW50cy0+dGFibGVzLnBrdFR5cGVQd3JMaW1pdHMpOworICAgICAgICAgbWVtY3B5KCZudkNvbnRlbnRzLT50YWJsZXMucGt0VHlwZVB3ckxpbWl0c1swXVswXSwKKyAgICAgICAgICAgICAgICAmbnZEZWZhdWx0c1YyLnRhYmxlcy5wa3RUeXBlUHdyTGltaXRzWzBdWzBdLAorICAgICAgICAgICAgICAgIGl0ZW1TaXplKTsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBkZWZhdWx0OgorICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIk5vdCBWYWxpZCBOViBUYWJsZSAlZCIsIG52VGFibGUtPm52VGFibGUpOworICAgICAgICAgcmV0dXJuIC1FSU87CisgICAgICAgICBicmVhazsKKyAgIH0KKworICAgcmV0dXJuIDE7Cit9CisKKy8qKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIFxicmllZiB3bGFuX2hkZF9mdG1fZ2V0X252X2ZpZWxkKCkgLQorICAgICAgICAgICAgR2V0IFNwZWNpZmljIE5WIGZpZWxkCisKKyAgXHBhcmFtICAtIGZ0bUNtZCAtIFBvaW50ZXIgRlRNIENvbW1hZCBCdWZmZXIKKworICBccmV0dXJuIC0gaW50CisgICAgICAgICAgICAtMSwgUHJvY2VzcyBIb3N0IGNvbW1hbmQgZmFpbCwgdmFpbCBvdXQKKyAgICAgICAgICAgICAxLCBQcm9jZXNzIEhvc3QgY29tbWFuZCBzdWNjZXNzCisKKyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworaW50IHdsYW5faGRkX2Z0bV9nZXRfbnZfZmllbGQKKygKKyAgIHRQdHRNc2didWZmZXIgICpmdG1DbWQKKykKK3sKKyAgIHNOdkZpZWxkcyAgICAgICAgICAgbnZGaWVsZERhdGFCdWZmZXI7CisgICB0TXNnUHR0R2V0TnZGaWVsZCAgKm52RmllbGQgPSAodE1zZ1B0dEdldE52RmllbGQgKikmZnRtQ21kLT5tc2dCb2R5LkdldE52RmllbGQ7CisgICBWT1NfU1RBVFVTICAgICAgICAgIG52U3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgc0hhbE52ICAgICAgICAgICAgICpudkNvbnRlbnRzID0gTlVMTDsKKyAgIHZfU0laRV90ICAgICAgICAgICAgbnZTaXplOworCisgICBudlN0YXR1cyA9IHZvc19udl9nZXROVkJ1ZmZlcigodm9pZCAqKikmbnZDb250ZW50cywgJm52U2l6ZSk7CisgICBpZiAoKFZPU19TVEFUVVNfU1VDQ0VTUyAhPSBudlN0YXR1cykgfHwgKE5VTEwgPT0gbnZDb250ZW50cykpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIEZMKCJGYWlsIHRvIGdldCBjYWNoZWQgTlYgdmFsdWUgU3RhdHVzICVkIiksIG52U3RhdHVzKTsKKyAgICAgIHJldHVybiAtRUlPOworICAgfQorICAgbWVtY3B5KCZudkZpZWxkRGF0YUJ1ZmZlciwgJm52Q29udGVudHMtPmZpZWxkcywgc2l6ZW9mKHNOdkZpZWxkcykpOworCisgICBzd2l0Y2ggKG52RmllbGQtPm52RmllbGQpCisgICB7CisgICAgICBjYXNlIE5WX0NPTU1PTl9QUk9EVUNUX0lEOgorICAgICAgICAgbWVtY3B5KCh2b2lkICopJm52RmllbGQtPmZpZWxkRGF0YSwKKyAgICAgICAgICAgICAmbnZGaWVsZERhdGFCdWZmZXIucHJvZHVjdElkLAorICAgICAgICAgICAgIHNpemVvZihudkZpZWxkRGF0YUJ1ZmZlci5wcm9kdWN0SWQpKTsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIE5WX0NPTU1PTl9QUk9EVUNUX0JBTkRTOgorICAgICAgICAgbWVtY3B5KCh2b2lkICopJm52RmllbGQtPmZpZWxkRGF0YSwKKyAgICAgICAgICAgICAmbnZGaWVsZERhdGFCdWZmZXIucHJvZHVjdEJhbmRzLAorICAgICAgICAgICAgIHNpemVvZihudkZpZWxkRGF0YUJ1ZmZlci5wcm9kdWN0QmFuZHMpKTsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIE5WX0NPTU1PTl9OVU1fT0ZfVFhfQ0hBSU5TOgorICAgICAgICAgbWVtY3B5KCh2b2lkICopJm52RmllbGQtPmZpZWxkRGF0YSwKKyAgICAgICAgICAgICAmbnZGaWVsZERhdGFCdWZmZXIubnVtT2ZUeENoYWlucywKKyAgICAgICAgICAgICBzaXplb2YobnZGaWVsZERhdGFCdWZmZXIubnVtT2ZUeENoYWlucykpOworICAgICAgICAgYnJlYWs7CisKKyAgICAgIGNhc2UgTlZfQ09NTU9OX05VTV9PRl9SWF9DSEFJTlM6CisgICAgICAgICBtZW1jcHkoKHZvaWQgKikmbnZGaWVsZC0+ZmllbGREYXRhLAorICAgICAgICAgICAgICZudkZpZWxkRGF0YUJ1ZmZlci5udW1PZlJ4Q2hhaW5zLAorICAgICAgICAgICAgIHNpemVvZihudkZpZWxkRGF0YUJ1ZmZlci5udW1PZlJ4Q2hhaW5zKSk7CisgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBOVl9DT01NT05fTUFDX0FERFI6CisgICAgICAgICBtZW1jcHkoKHZvaWQgKikmbnZGaWVsZC0+ZmllbGREYXRhLAorICAgICAgICAgICAgICZudkZpZWxkRGF0YUJ1ZmZlci5tYWNBZGRyWzBdLAorICAgICAgICAgICAgIE5WX0ZJRUxEX01BQ19BRERSX1NJWkUpOworICAgICAgICAgYnJlYWs7CisKKyAgICAgIGNhc2UgTlZfQ09NTU9OX01GR19TRVJJQUxfTlVNQkVSOgorICAgICAgICAgbWVtY3B5KCh2b2lkICopJm52RmllbGQtPmZpZWxkRGF0YSwKKyAgICAgICAgICAgICAmbnZGaWVsZERhdGFCdWZmZXIubWZnU05bMF0sCisgICAgICAgICAgICAgTlZfRklFTERfTUZHX1NOX1NJWkUpOworICAgICAgICAgYnJlYWs7CisKKyAgICAgIGNhc2UgTlZfQ09NTU9OX1dMQU5fTlZfUkVWX0lEOgorICAgICAgICAgbWVtY3B5KCh2b2lkICopJm52RmllbGQtPmZpZWxkRGF0YSwKKyAgICAgICAgICAgICAmbnZGaWVsZERhdGFCdWZmZXIud2xhbk52UmV2SWQsCisgICAgICAgICAgICAgc2l6ZW9mKG52RmllbGREYXRhQnVmZmVyLndsYW5OdlJldklkKSk7CisgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBOVl9DT01NT05fQ09VUExFUl9UWVBFOgorICAgICAgICAgbWVtY3B5KCh2b2lkICopJm52RmllbGQtPmZpZWxkRGF0YSwKKyAgICAgICAgICAgICAgICAmbnZGaWVsZERhdGFCdWZmZXIuY291cGxlclR5cGUsCisgICAgICAgICAgICAgICAgc2l6ZW9mKG52RmllbGREYXRhQnVmZmVyLmNvdXBsZXJUeXBlKSk7CisgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBOVl9DT01NT05fTlZfVkVSU0lPTjoKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19TVEFUVVMgbnZFbWJlZGVkU3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgdl9VOF90IG52VmVyc2lvbiA9IG52RmllbGREYXRhQnVmZmVyLm52VmVyc2lvbjsKKworICAgICAgICAgICAgbnZFbWJlZGVkU3RhdHVzID0gdm9zX252X2lzRW1iZWRkZWROVigpOworCisgICAgICAgICAgICBpZiAoIG52RW1iZWRlZFN0YXR1cyA9PSBWT1NfU1RBVFVTX1NVQ0NFU1MgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIEhpZ2ggYml0IGlzIHNldCB0byBpbmRpY2F0ZSBlbWJlZGRlZCBOVi4uCisgICAgICAgICAgICAgICAgbnZWZXJzaW9uID0gbnZWZXJzaW9uIHwgTlZfRU1CRURERURfVkVSU0lPTjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbWVtY3B5KCh2b2lkICopJm52RmllbGQtPmZpZWxkRGF0YSwKKyAgICAgICAgICAgICAgICAgICAmbnZWZXJzaW9uLAorICAgICAgICAgICAgICAgICAgIHNpemVvZihudkZpZWxkRGF0YUJ1ZmZlci5udlZlcnNpb24pKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGJyZWFrOworCisgICAgICBkZWZhdWx0OgorICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIk5vdCBWYWxpZCBOViBmaWVsZCAlZCIsIG52RmllbGQtPm52RmllbGQpOworICAgICAgICAgcmV0dXJuIC1FSU87CisgICAgICAgICBicmVhazsKKyAgIH0KKworICAgcmV0dXJuIDE7Cit9CisKK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W50cywgJm52U2l6ZSk7CisgICBpZigoVk9TX1NUQVRVU19TVUNDRVNTICE9IG52U3RhdHVzKSB8fCAoTlVMTCA9PSBudkNvbnRlbnRzKSkKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgRkwoIkZhaWwgdG8gZ2V0IGNhY2hlZCBOViB2YWx1ZSBTdGF0dXMgJWQiKSwgbnZTdGF0dXMpOworICAgICAgcmV0dXJuIC1FSU87CisgICB9CisKKyAgIHN3aXRjaCAobnZGaWVsZC0+bnZGaWVsZCkKKyAgIHsKKyAgICAgIGNhc2UgTlZfQ09NTU9OX1BST0RVQ1RfSUQ6CisgICAgICAgICBtZW1jcHkoJm52Q29udGVudHMtPmZpZWxkcy5wcm9kdWN0SWQsCisgICAgICAgICAgICAgICAgJm52RmllbGQtPmZpZWxkRGF0YSwKKyAgICAgICAgICAgICAgICBzaXplb2YobnZDb250ZW50cy0+ZmllbGRzLnByb2R1Y3RJZCkpOworICAgICAgICAgYnJlYWs7CisKKyAgICAgIGNhc2UgTlZfQ09NTU9OX1BST0RVQ1RfQkFORFM6CisgICAgICAgICBtZW1jcHkoJm52Q29udGVudHMtPmZpZWxkcy5wcm9kdWN0QmFuZHMsCisgICAgICAgICAgICAgICAgJm52RmllbGQtPmZpZWxkRGF0YSwKKyAgICAgICAgICAgICAgICBzaXplb2YobnZDb250ZW50cy0+ZmllbGRzLnByb2R1Y3RCYW5kcykpOworICAgICAgICAgYnJlYWs7CisKKyAgICAgIGNhc2UgTlZfQ09NTU9OX05VTV9PRl9UWF9DSEFJTlM6CisgICAgICAgICBtZW1jcHkoJm52Q29udGVudHMtPmZpZWxkcy5udW1PZlR4Q2hhaW5zLAorICAgICAgICAgICAgICAgICZudkZpZWxkLT5maWVsZERhdGEsCisgICAgICAgICAgICAgICAgc2l6ZW9mKG52Q29udGVudHMtPmZpZWxkcy5udW1PZlR4Q2hhaW5zKSk7CisgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBOVl9DT01NT05fTlVNX09GX1JYX0NIQUlOUzoKKyAgICAgICAgIG1lbWNweSgmbnZDb250ZW50cy0+ZmllbGRzLm51bU9mUnhDaGFpbnMsCisgICAgICAgICAgICAgICAgJm52RmllbGQtPmZpZWxkRGF0YSwKKyAgICAgICAgICAgICAgICBzaXplb2YobnZDb250ZW50cy0+ZmllbGRzLm51bU9mUnhDaGFpbnMpKTsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIE5WX0NPTU1PTl9NQUNfQUREUjoKKyAgICAgICAgIC8qIElmIExhc3QgYnl0ZSBpcyBsYXJnZXIgdGhhbiAyNTIgKDB4RkMpLCByZXR1cm4gRXJyb3IsCisgICAgICAgICAgKiBTaW5jZSAzTUFDcyBzaG91bGQgYmUgZGVyaXZlZCBmcm9tIGZpcnN0IE1BQyAqLworICAgICAgICAgaWYoUVdMQU5fTUFYX01BQ19MQVNUX0JZVEVfVkFMVUUgPAorICAgICAgICAgICAgbnZGaWVsZC0+ZmllbGREYXRhLm1hY0FkZHIubWFjQWRkcjFbVk9TX01BQ19BRERSRVNTX0xFTiAtIDFdKQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIkxhc3QgQnl0ZSBvZiB0aGUgc2VlZCBNQUMgaXMgdG9vIGxhcmdlIDB4JXgiLAorICAgICAgICAgICAgICAgICAgICAgICAgbnZGaWVsZC0+ZmllbGREYXRhLm1hY0FkZHIubWFjQWRkcjFbVk9TX01BQ19BRERSRVNTX0xFTiAtIDFdKTsKKyAgICAgICAgICAgIHJldHVybiAtRUlMU0VROworICAgICAgICAgfQorCisgICAgICAgICBwTlZNYWMgPSAodl9VOF90ICopbnZDb250ZW50cy0+ZmllbGRzLm1hY0FkZHI7CisgICAgICAgICBsYXN0Qnl0ZU1BQyA9IG52RmllbGQtPmZpZWxkRGF0YS5tYWNBZGRyLm1hY0FkZHIxW1ZPU19NQUNfQUREUkVTU19MRU4gLSAxXTsKKyAgICAgICAgIGZvcihtYWNMb29wID0gMDsgbWFjTG9vcCA8IFZPU19NQVhfQ09OQ1VSUkVOQ1lfUEVSU09OQTsgbWFjTG9vcCsrKQorICAgICAgICAgeworICAgICAgICAgICAgbnZGaWVsZC0+ZmllbGREYXRhLm1hY0FkZHIubWFjQWRkcjFbVk9TX01BQ19BRERSRVNTX0xFTiAtIDFdID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFzdEJ5dGVNQUMgKyBtYWNMb29wOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBOVk1hYyArIChtYWNMb29wICogTlZfRklFTERfTUFDX0FERFJfU0laRSksCisgICAgICAgICAgICAgICAgICAgICAgICAgJm52RmllbGQtPmZpZWxkRGF0YS5tYWNBZGRyLm1hY0FkZHIxWzBdLAorICAgICAgICAgICAgICAgICAgICAgICAgIE5WX0ZJRUxEX01BQ19BRERSX1NJWkUpOworICAgICAgICAgfQorICAgICAgICAgYnJlYWs7CisKKyAgICAgIGNhc2UgTlZfQ09NTU9OX01GR19TRVJJQUxfTlVNQkVSOgorICAgICAgICAgbWVtY3B5KCZudkNvbnRlbnRzLT5maWVsZHMubWZnU05bMF0sCisgICAgICAgICAgICAgICAgJm52RmllbGQtPmZpZWxkRGF0YSwKKyAgICAgICAgICAgICBOVl9GSUVMRF9NRkdfU05fU0laRSk7CisgICAgICAgICBicmVhazsKKworICAgICBjYXNlIE5WX0NPTU1PTl9XTEFOX05WX1JFVl9JRDoKKyAgICAgICAgbWVtY3B5KCZudkNvbnRlbnRzLT5maWVsZHMud2xhbk52UmV2SWQsCisgICAgICAgICAgICAgICAmbnZGaWVsZC0+ZmllbGREYXRhLAorICAgICAgICAgICAgICAgc2l6ZW9mKG52Q29udGVudHMtPmZpZWxkcy53bGFuTnZSZXZJZCkpOworICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBOVl9DT01NT05fQ09VUExFUl9UWVBFOgorICAgICAgICAgbWVtY3B5KCZudkNvbnRlbnRzLT5maWVsZHMuY291cGxlclR5cGUsCisgICAgICAgICAgICAgICAgJm52RmllbGQtPmZpZWxkRGF0YSwKKyAgICAgICAgICAgICAgICBzaXplb2YobnZDb250ZW50cy0+ZmllbGRzLmNvdXBsZXJUeXBlKSk7CisgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBOVl9DT01NT05fTlZfVkVSU0lPTjoKKyAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICJDYW5ub3QgbW9kaWZ5IE5WIHZlcnNpb24gZmllbGQgJWQiLCBudkZpZWxkLT5udkZpZWxkKTsKKyAgICAgICAgIHJldHVybiAtRUlPOworICAgICAgICAgYnJlYWs7CisKKyAgICAgIGRlZmF1bHQ6CisgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiTm90IFZhbGlkIE5WIGZpZWxkICVkIiwgbnZGaWVsZC0+bnZGaWVsZCk7CisgICAgICAgICByZXR1cm4gLUVJTzsKKyAgICAgICAgIGJyZWFrOworICAgfQorCisgICByZXR1cm4gMTsKK30KKworLyoqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgXGJyaWVmIHdsYW5faGRkX2Z0bV9zdG9yZV9udl90YWJsZSgpIC0KKyAgICAgICAgICAgIFN0b3JlIENhY2hlZCBOViBpbmZvcm1hdGlvbiBpbnRvIEZsYXNoIE1lbW9yeSwgZmlsZQorICAgICAgICAgICAgTlYgVjIgZGVkaWNhdGVkIEFQSQorCisgIFxwYXJhbSAgLSBmdG1DbWQgLSBQb2ludGVyIEZUTSBDb21tYWQgQnVmZmVyCisKKyAgXHJldHVybiAtIGludAorICAgICAgICAgICAgLTEsIFByb2Nlc3MgSG9zdCBjb21tYW5kIGZhaWwsIHZhaWwgb3V0CisgICAgICAgICAgICAgMCwgUHJvY2VzcyBIb3N0IGNvbW1hbmQgc3VjY2VzcworCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KK2ludCB3bGFuX2hkZF9mdG1fc3RvcmVfbnZfdGFibGUKKygKKyAgIHRQdHRNc2didWZmZXIgICpmdG1DbWQKKykKK3sKKyAgIFZPU19TVEFUVVMgICAgICAgICAgIG52U3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgdl9TSVpFX3QgICAgICAgICAgICAgbnZTaXplOworICAgdE1zZ1B0dFN0b3JlTnZUYWJsZSAqbnZUYWJsZSA9ICh0TXNnUHR0U3RvcmVOdlRhYmxlICopJmZ0bUNtZC0+bXNnQm9keS5TdG9yZU52VGFibGU7CisgICB2b2lkICAgICAgICAgICAgICAgICp0YWJsZVB0ciA9IE5VTEw7CisgICB1bnNpZ25lZCBpbnQgICAgICAgICB0YWJsZVNpemUgPSAwOworICAgVk5WX1RZUEUgICAgICAgICAgICAgdGFibGVWTlZUeXBlID0gVk5WX0ZJRUxEX0lNQUdFOworICAgc0hhbE52VjIgICAgICAgICAgICAqbnZDb250ZW50cyA9IE5VTEw7CisgICBlTnZWZXJzaW9uVHlwZSAgICAgICBudlZlcnNpb247CisKKyAgIG52U3RhdHVzID0gdm9zX252X2dldE5WQnVmZmVyKCh2b2lkICoqKSZudkNvbnRlbnRzLCAmbnZTaXplKTsKKyAgIGlmKChWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gbnZTdGF0dXMpIHx8IChOVUxMID09IG52Q29udGVudHMpKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICBGTCgiRmFpbCB0byBnZXQgY2FjaGVkIE5WIHZhbHVlIFN0YXR1cyAlZCIpLCBudlN0YXR1cyk7CisgICAgICByZXR1cm4gLUVJTzsKKyAgIH0KKworICAgbnZWZXJzaW9uID0gdm9zX252X2dldE52VmVyc2lvbigpOworICAgaWYgKEVfTlZfVjIgIT0gbnZWZXJzaW9uKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICIlcyA6IE5vdCB2YWxpZCBOViBWZXJzaW9uICVkIiwgX19mdW5jX18sIG52VmVyc2lvbik7CisgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgIH0KKworICAgLyogU2V0IFBsYXRmb3JtIHR5cGUgYXMgUFJJTUEgKi8KKyAgIG52Q29udGVudHMtPmZpZWxkcy53bGFuTnZSZXZJZCA9IDI7CisKKyAgIHN3aXRjaChudlRhYmxlLT5udlRhYmxlKQorICAgeworICAgICAgY2FzZSBOVl9GSUVMRFNfSU1BR0U6CisgICAgICAgICB0YWJsZVB0ciAgICAgPSAodm9pZCAqKSZudkNvbnRlbnRzLT5maWVsZHM7CisgICAgICAgICB0YWJsZVNpemUgICAgPSBzaXplb2YobnZDb250ZW50cy0+ZmllbGRzKTsKKyAgICAgICAgIHRhYmxlVk5WVHlwZSA9IFZOVl9GSUVMRF9JTUFHRTsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIE5WX1RBQkxFX1JBVEVfUE9XRVJfU0VUVElOR1M6CisgICAgICAgICB0YWJsZVB0ciAgICAgPSAodm9pZCAqKSZudkNvbnRlbnRzLT50YWJsZXMucHdyT3B0aW11bVswXTsKKyAgICAgICAgIHRhYmxlU2l6ZSAgICA9IHNpemVvZihudkNvbnRlbnRzLT50YWJsZXMucHdyT3B0aW11bSk7CisgICAgICAgICB0YWJsZVZOVlR5cGUgPSBWTlZfUkFURV9UT19QT1dFUl9UQUJMRTsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIE5WX1RBQkxFX1JFR1VMQVRPUllfRE9NQUlOUzoKKyAgICAgICAgIHRhYmxlUHRyICAgICA9ICh2b2lkICopJm52Q29udGVudHMtPnRhYmxlcy5yZWdEb21haW5zWzBdOworICAgICAgICAgdGFibGVTaXplICAgID0gc2l6ZW9mKG52Q29udGVudHMtPnRhYmxlcy5yZWdEb21haW5zKTsKKyAgICAgICAgIHRhYmxlVk5WVHlwZSA9IFZOVl9SRUdVTEFSVE9SWV9ET01BSU5fVEFCTEU7CisgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBOVl9UQUJMRV9ERUZBVUxUX0NPVU5UUlk6CisgICAgICAgICB0YWJsZVB0ciAgICAgPSAodm9pZCAqKSZudkNvbnRlbnRzLT50YWJsZXMuZGVmYXVsdENvdW50cnlUYWJsZTsKKyAgICAgICAgIHRhYmxlU2l6ZSAgICA9IHNpemVvZihudkNvbnRlbnRzLT50YWJsZXMuZGVmYXVsdENvdW50cnlUYWJsZSk7CisgICAgICAgICB0YWJsZVZOVlR5cGUgPSBWTlZfREVGQVVMVF9MT0NBVElPTjsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIE5WX1RBQkxFX1RQQ19QT1dFUl9UQUJMRToKKyAgICAgICAgIHRhYmxlUHRyICAgICA9ICh2b2lkICopJm52Q29udGVudHMtPnRhYmxlcy5wbHV0Q2hhcmFjdGVyaXplZFswXTsKKyAgICAgICAgIHRhYmxlU2l6ZSAgICA9IHNpemVvZihudkNvbnRlbnRzLT50YWJsZXMucGx1dENoYXJhY3Rlcml6ZWQpOworICAgICAgICAgdGFibGVWTlZUeXBlID0gVk5WX1RQQ19QT1dFUl9UQUJMRTsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIE5WX1RBQkxFX1RQQ19QREFEQ19PRkZTRVRTOgorICAgICAgICAgdGFibGVQdHIgICAgID0gKHZvaWQgKikmbnZDb250ZW50cy0+dGFibGVzLnBsdXRQZGFkY09mZnNldFswXTsKKyAgICAgICAgIHRhYmxlU2l6ZSAgICA9IHNpemVvZihudkNvbnRlbnRzLT50YWJsZXMucGx1dFBkYWRjT2Zmc2V0KTsKKyAgICAgICAgIHRhYmxlVk5WVHlwZSA9IFZOVl9UUENfUERBRENfT0ZGU0VUUzsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIE5WX1RBQkxFX1ZJUlRVQUxfUkFURToKKyAgICAgICAgIHRhYmxlUHRyICAgICA9ICh2b2lkICopJm52Q29udGVudHMtPnRhYmxlcy5wd3JPcHRpbXVtX3ZpcnR1YWxSYXRlWzBdOworICAgICAgICAgdGFibGVTaXplICAgID0gc2l6ZW9mKG52Q29udGVudHMtPnRhYmxlcy5wd3JPcHRpbXVtX3ZpcnR1YWxSYXRlKTsKKyAgICAgICAgIHRhYmxlVk5WVHlwZSA9IFZOVl9UQUJMRV9WSVJUVUFMX1JBVEU7CisgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBOVl9UQUJMRV9SU1NJX0NIQU5ORUxfT0ZGU0VUUzoKKyAgICAgICAgIHRhYmxlUHRyICAgICA9ICh2b2lkICopJm52Q29udGVudHMtPnRhYmxlcy5yc3NpQ2hhbk9mZnNldHNbMF07CisgICAgICAgICB0YWJsZVNpemUgICAgPSBzaXplb2YobnZDb250ZW50cy0+dGFibGVzLnJzc2lDaGFuT2Zmc2V0cyk7CisgICAgICAgICB0YWJsZVZOVlR5cGUgPSBWTlZfUlNTSV9DSEFOTkVMX09GRlNFVFM7CisgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBOVl9UQUJMRV9IV19DQUxfVkFMVUVTOgorICAgICAgICAgdGFibGVQdHIgICAgID0gKHZvaWQgKikmbnZDb250ZW50cy0+dGFibGVzLmh3Q2FsVmFsdWVzOworICAgICAgICAgdGFibGVTaXplICAgID0gc2l6ZW9mKG52Q29udGVudHMtPnRhYmxlcy5od0NhbFZhbHVlcyk7CisgICAgICAgICB0YWJsZVZOVlR5cGUgPSBWTlZfSFdfQ0FMX1ZBTFVFUzsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIE5WX1RBQkxFX0ZXX0NPTkZJRzoKKyAgICAgICAgIHRhYmxlUHRyICAgICA9ICh2b2lkICopJm52Q29udGVudHMtPnRhYmxlcy5md0NvbmZpZzsKKyAgICAgICAgIHRhYmxlU2l6ZSAgICA9IHNpemVvZihudkNvbnRlbnRzLT50YWJsZXMuZndDb25maWcpOworICAgICAgICAgdGFibGVWTlZUeXBlID0gVk5WX0ZXX0NPTkZJRzsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIE5WX1RBQkxFX0FOVEVOTkFfUEFUSF9MT1NTOgorICAgICAgICAgdGFibGVQdHIgICAgID0gKHZvaWQgKikmbnZDb250ZW50cy0+dGFibGVzLmFudGVubmFQYXRoTG9zc1swXTsKKyAgICAgICAgIHRhYmxlU2l6ZSAgICA9IHNpemVvZihudkNvbnRlbnRzLT50YWJsZXMuYW50ZW5uYVBhdGhMb3NzKTsKKyAgICAgICAgIHRhYmxlVk5WVHlwZSA9IFZOVl9BTlRFTk5BX1BBVEhfTE9TUzsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIE5WX1RBQkxFX1BBQ0tFVF9UWVBFX1BPV0VSX0xJTUlUUzoKKyAgICAgICAgIHRhYmxlUHRyICAgICA9ICh2b2lkICopJm52Q29udGVudHMtPnRhYmxlcy5wa3RUeXBlUHdyTGltaXRzWzBdWzBdOworICAgICAgICAgdGFibGVTaXplICAgID0gc2l6ZW9mKG52Q29udGVudHMtPnRhYmxlcy5wa3RUeXBlUHdyTGltaXRzKTsKKyAgICAgICAgIHRhYmxlVk5WVHlwZSA9IFZOVl9QQUNLRVRfVFlQRV9QT1dFUl9MSU1JVFM7CisgICAgICAgICBicmVhazsKKworICAgICAgZGVmYXVsdDoKKyAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICJOb3QgU3VwcG9ydGVkIFRhYmxlIFR5cGUgJWQiLCBudlRhYmxlLT5udlRhYmxlKTsKKyAgICAgICAgIHJldHVybiAtRUlPOworICAgICAgICAgYnJlYWs7CisKKyAgIH0KKworICAgbnZTdGF0dXMgPSB2b3NfbnZfd3JpdGUodGFibGVWTlZUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFibGVQdHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0YWJsZVNpemUpOworICAgaWYoVk9TX1NUQVRVU19TVUNDRVNTICE9IG52U3RhdHVzKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIkZhaWxlZCB1cGRhdGUgbnYgaXRlbSAlZCIsIG52U3RhdHVzKTsKKyAgICAgIHJldHVybiAtRUlPOworICAgfQorCisgICByZXR1cm4gMTsKK30KKworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgXGJyaWVmIHdsYW5faGRkX2Z0bV9nZXRfbnZfYmluKCkgLQorICAgICAgICAgICAgR2V0IE5WIGJpbiByZWFkIGZyb20gRmxhc2ggTWVtb3J5LCBmaWxlCisKKyAgXHBhcmFtICAtIGZ0bUNtZCAtIFBvaW50ZXIgRlRNIENvbW1hZCBCdWZmZXIKKworICBccmV0dXJuIC0gaW50CisgICAgICAgICAgICAt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2Vzc2luZ05WVGFibGUpIHx8CisgICAgICAoMCA9PSBwSGRkQ3R4LT5mdG0ucHJvY2Vzc2VkTlZUYWJsZVNpemUpKQorICAgeworICAgICAgaWYgKCBtc2dJZCA9PSBQVFRfTVNHX0dFVF9OVl9CSU4gKQorICAgICAgeworICAgICAgICAgbnZTdGF0dXMgPSB2b3NfbnZfZ2V0TlZFbmNvZGVkQnVmZmVyKCh2b2lkICoqKSZudkNvbnRlbnRzLCAmbnZTaXplKTsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgIG52U3RhdHVzID0gdm9zX252X2dldE5WRGljdGlvbmFyeSgodm9pZCAqKikmbnZDb250ZW50cywgJm52U2l6ZSk7CisgICAgICB9CisKKyAgICAgIGlmICgoVk9TX1NUQVRVU19TVUNDRVNTICE9IG52U3RhdHVzKSB8fCAoTlVMTCA9PSBudkNvbnRlbnRzKSkKKyAgICAgIHsKKyAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICBGTCgiRmFpbCB0byBnZXQgY2FjaGVkIE5WIHZhbHVlIFN0YXR1cyAlZCIpLCBudlN0YXR1cyk7CisgICAgICAgICByZXR1cm4gLUVJTzsKKyAgICAgIH0KKworICAgICAgc3dpdGNoIChudlRhYmxlLT5udlRhYmxlKQorICAgICAgeworICAgICAgICAgY2FzZSBOVl9CSU5BUllfSU1BR0U6CisgICAgICAgICAgICBwSGRkQ3R4LT5mdG0udGFyZ2V0TlZUYWJsZVBvaW50ZXIgPSAodl9VOF90ICopbnZDb250ZW50czsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICJOb3QgVmFs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AgICAgICBob3N0U3RhdGUgPSAxOworCisgICBzd2l0Y2gocEZUTUNtZC0+bXNnSWQpCisgICB7CisgICAgICBjYXNlIFBUVF9NU0dfR0VUX05WX1RBQkxFOgorICAgICAgICAgaG9zdFN0YXRlID0gd2xhbl9oZGRfZnRtX2dldF9udl90YWJsZShwSGRkQ3R4LCBwRlRNQ21kKTsKKyAgICAgICAgIG5lZWRUb1JvdXRlSGFsID0gMDsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIFBUVF9NU0dfU0VUX05WX1RBQkxFOgorICAgICAgICAgaG9zdFN0YXRlID0gd2xhbl9oZGRfZnRtX3NldF9udl90YWJsZShwSGRkQ3R4LCBwRlRNQ21kKTsKKyAgICAgICAgIC8qIFRlbXAgTlYgT3BlcmF0aW9uIHdpbGwgYmUgaXNvbGF0ZWQgdG8gaG9zdAorICAgICAgICAgbmVlZFRvUm91dGVIYWwgPSAxOyAqLworICAgICAgICAgbmVlZFRvUm91dGVIYWwgPSAwOworICAgICAgICAgYnJlYWs7CisKKyAgICAgIGNhc2UgUFRUX01TR19CTEFOS19OVjoKKyAgICAgICAgIGhvc3RTdGF0ZSA9IHdsYW5faGRkX2Z0bV9ibGFua19udl90YWJsZShwRlRNQ21kKTsKKyAgICAgICAgIG5lZWRUb1JvdXRlSGFsID0gMTsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIFBUVF9NU0dfREVMX05WX1RBQkxFOgorICAgICAgICAgaG9zdFN0YXRlID0gd2xhbl9oZGRfZnRtX2RlbGV0ZV9udl90YWJsZShwRlRNQ21kKTsKKyAgICAgICAgIG5lZWRUb1JvdXRlSGFsID0gMTsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIFBUVF9NU0dfR0VUX05WX0ZJRUxEOgorICAgICAgICAgaG9zdFN0YXRlID0gd2xhbl9oZGRfZnRtX2dldF9udl9maWVsZChwRlRNQ21kKTsKKyAgICAgICAgIG5lZWRUb1JvdXRlSGFsID0gMDs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VG9Sb3V0ZUhhbCA9IDA7CisgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBQVFRfTVNHX0RCR19XUklURV9SRUdJU1RFUjoKKyAgICAgICAgIHdwYWxXcml0ZVJlZ2lzdGVyKHBGVE1DbWQtPm1zZ0JvZHkuRGJnV3JpdGVSZWdpc3Rlci5yZWdBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcEZUTUNtZC0+bXNnQm9keS5EYmdXcml0ZVJlZ2lzdGVyLnJlZ1ZhbHVlKTsKKyAgICAgICAgIG5lZWRUb1JvdXRlSGFsID0gMDsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIFBUVF9NU0dfREJHX1JFQURfTUVNT1JZOgorICAgICAgICAgd3BhbFJlYWREZXZpY2VNZW1vcnkocEZUTUNtZC0+bXNnQm9keS5EYmdSZWFkTWVtb3J5Lm1lbUFkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5zaWduZWQgY2hhciAqKXBGVE1DbWQtPm1zZ0JvZHkuRGJnUmVhZE1lbW9yeS5wTWVtQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEZUTUNtZC0+bXNnQm9keS5EYmdSZWFkTWVtb3J5Lm5CeXRlcyk7CisgICAgICAgICBuZWVkVG9Sb3V0ZUhhbCA9IDA7CisgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBQVFRfTVNHX0RCR19XUklURV9NRU1PUlk6CisgICAgICAgICB3cGFsV3JpdGVEZXZpY2VNZW1vcnkocEZUTUNtZC0+bXNnQm9keS5EYmdXcml0ZU1lbW9yeS5tZW1BZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBjaGFyICopcEZUTUNtZC0+bXNnQm9keS5EYmdXcml0ZU1lbW9yeS5wTWVtQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBGVE1DbWQtPm1zZ0JvZHkuRGJnV3JpdGVNZW1vcnk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ucFJlc3BvbnNlQnVmLT5mdG1fZXJyX2NvZGUgPSBXTEFOX0ZUTV9TVUNDRVNTOworICAgICAgICAgICB3bGFuX2Z0bV9zZW5kX3Jlc3BvbnNlKHBIZGRDdHgpOworICAgICAgICAgICB2b3NfbWVtX2ZyZWUodGVtcFJzcEJ1ZmZlcik7CisgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmICgwID4gaG9zdFN0YXRlKQorICAgICAgICB7CisgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIqKiogSG9zdCBDb21tYW5kIEhhbmRsZSBGYWlsICoqKiIpOworICAgICAgICAgICBwSGRkQ3R4LT5mdG0ucFJlc3BvbnNlQnVmLT5mdG1fZXJyX2NvZGUgPSBXTEFOX0ZUTV9GQUlMVVJFOworICAgICAgICAgICB3bGFuX2Z0bV9zZW5kX3Jlc3BvbnNlKHBIZGRDdHgpOworICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICAvL0hFWERVTVAoIlJlcXVlc3Q6IiwoY2hhciopcGZ0bV9kYXRhLGNtZF9sZW4pOworCisKKyAgICAgICAgLypQb3N0IHRoZSBjb21tYW5kIHRvIHRoZSBIQUwqLworICAgICAgICBpZiAod2xhbl9mdG1fcG9zdG1zZyhwZnRtX2RhdGEsIGNtZF9sZW4pICE9IFZPU19TVEFUVVNfU1VDQ0VTUykgeworCisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCIlczo6IEZUTSBjb21tYW5kIGZhaWxlZCIsX19mdW5jX18pOworICAgICAgICAgICAgcmV0dXJuOworCisgICAgICAgIH0KKyAgICAgICAgLypBZnRlciBzdWNjZXNzZnVsIHBvc3Rpbmcgb2YgbWVzc2FnZSB0aGUgY29tbWFuZCBzaG91bGQgYmUgcGVuZGluZyovCisgICAgICAgIHBIZGRDdHgtPmZ0bS5Jc0NtZFBlbmRpbmcgPSBUUl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H0KKyAgICAgICAgaWYgKE5VTEwgPT0gcE1zZ0J1ZikKKyAgICAgICAgeworICAgICAgICAgICAgcE1zZ0J1ZiA9ICh0UHR0TXNnYnVmZmVyICopdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRQdHRNc2didWZmZXIpKTsKKyAgICAgICAgICAgIGlmIChOVUxMID09IHBNc2dCdWYpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOnBNc2dCdWYgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgc3RhdHVzID0gd2xhbl9mdG1fc3RvcChwSGRkQ3R4KTsKKworICAgICAgICBpZiAoc3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgICAgIkZUTSBTdG9wIEZhaWxlZCIpOworICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgICAgICB9CisgICAgICAgIHBIZGRDdHgtPmZ0bS5mdG1fc3RhdGUgPSBXTEFOX0ZUTV9TVE9QUEVEOworICAgICAgICBpZiAocE1zZ0J1ZikKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9mcmVlKCh2X1ZPSURfdCAqIClwTXNnQnVmKTsKKyAgICAgICAgICAgIHBNc2dCdWYgPSBOVUxMOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NF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0VTUzsKKworICAgICAgICBpbmRleCsrOworICAgIH0KKworICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKK30KKworCitzdGF0aWMgdW5zaWduZWQgaW50IGdldF9wcmltYXJ5X2NoYW5uZWwodW5zaWduZWQgaW50IGNlbnRlcl9jaGFubmVsLHVuc2lnbmVkIGludCBjYikKK3sKKyAgICB1bnNpZ25lZCBpbnQgcHJpbWFyeV9jaGFubmVsID0gY2VudGVyX2NoYW5uZWw7CisKKyAgICBzd2l0Y2ggKGNiKQorICAgIHsKKyAgICAgICAgY2FzZSBQSFlfRE9VQkxFX0NIQU5ORUxfTE9XX1BSSU1BUlk6CisgICAgICAgICAgICAgICAgY2FzZSBQSFlfUVVBRFJVUExFX0NIQU5ORUxfMjBNSFpfTE9XXzQwTUhaX0NFTlRFUkVEOgorICAgICAgICAgICAgICAgIGNhc2UgUEhZX1FVQURSVVBMRV9DSEFOTkVMXzIwTUhaX0hJR0hfNDBNSFpfTE9XOgorICAgICAgICAgICAgcHJpbWFyeV9jaGFubmVsIC09IDI7CisgICAgICAgICAgICBicmVhazsKKworCisgICAgICAgIGNhc2UgUEhZX0RPVUJMRV9DSEFOTkVMX0hJR0hfUFJJTUFSWToKKyAgICAgICAgICAgICAgICBjYXNlIFBIWV9RVUFEUlVQTEVfQ0hBTk5FTF8yME1IWl9ISUdIXzQwTUhaX0NFTlRFUkVEOgorICAgICAgICAgICAgICAgIGNhc2UgUEhZX1FVQURSVVBMRV9DSEFOTkVMXzIwTUhaX0xPV180ME1IWl9ISUdIOgorICAgICAgICAgICAgICAgICAgICAgICAgcHJpbWFyeV9jaGFubmVsICs9IDI7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgUEhZX1FVQURSVVBMRV9DSEFOTkVMXzIwTUhaX0xPV180ME1IWl9MT1c6CisgICAgICAgICAgICAgICAgICAgICAgICBwcmltYXJ5X2NoYW5uZWwgLT0gNjsKKy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SArIFBUVF9IRUFERVJfTEVOR1RIOworCisgICAgcE1zZ0JvZHkgPSAmcE1zZ0J1Zi0+bXNnQm9keTsKKworICAgIHN0YXR1cyA9IHdsYW5fZnRtX3Bvc3Rtc2coKHZfVThfdCopcE1zZ0J1ZixwTXNnQnVmLT5tc2dCb2R5TGVuZ3RoKTsKKworICAgIGlmIChzdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgIiVzOndsYW5fZnRtX3Bvc3Rtc2cgZmFpbGVkIiwgX19mdW5jX18pOworICAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICAgICAgZ290byBkb25lOworICAgIH0KKyAgICByZXQgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGVfdGltZW91dCgmcEhkZEN0eC0+ZnRtLmZ0bV9jb21wX3ZhciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoV0xBTl9GVE1fQ09NTUFORF9USU1FX09VVCkpOworICAgIGlmICgwID49IHJldCApCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICBGTCgid2FpdCBvbiBmdG1fY29tcF92YXIgZmFpbGVkICVsZCIpLCByZXQpOworICAgIH0KKworICAgIGlmIChwTXNnQnVmLT5tc2dSZXNwb25zZSAhPSBQVFRfU1RBVFVTX1NVQ0NFU1MpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAiJXM6UHR0IHJlc3Bvb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XNnQm9keUxlbmd0aCk7CisKKyAgICBpZiAoc3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICIlczp3bGFuX2Z0bV9wb3N0bXNnIGZhaWxlZCIsIF9fZnVuY19fKTsKKyAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICAgIGdvdG8gZG9uZTsKKyAgICB9CisgICAgcmV0ID0gd2FpdF9mb3JfY29tcGxldGlvbl9pbnRlcnJ1cHRpYmxlX3RpbWVvdXQoJnBIZGRDdHgtPmZ0bS5mdG1fY29tcF92YXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoV0xBTl9GVE1fQ09NTUFORF9USU1FX09VVCkpOworICAgIGlmICgwID49IHJldCApCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICBGTCgid2FpdCBvbiBmdG1fY29tcF92YXIgZmFpbGVkICVsZCIpLCByZXQpOworICAgIH0KKworICAgIGlmIChwTXNnQnVmLT5tc2dSZXNwb25zZSAhPSBQVFRfU1RBVFVTX1NVQ0NFU1MpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAgIiVzOlB0dCByZXNwb25zZSBzdGF0dXMgZmFpbGVkIiwgX19mdW5jX18pOworICAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICAgICAgZ290byBkb25lOworICAgIH0KKworICAgcmV0ID0gc25wcmludGYoYnVmLCBXRV9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Zi0+bXNnQm9keUxlbmd0aCk7CisKKyAgICBpZiAoc3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICIlczp3bGFuX2Z0bV9wb3N0bXNnIGZhaWxlZCEhISEiLCBfX2Z1bmNfXyk7CisgICAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgICAgICBnb3RvIGRvbmU7CisgICAgfQorCisgICAgcmV0ID0gd2FpdF9mb3JfY29tcGxldGlvbl9pbnRlcnJ1cHRpYmxlX3RpbWVvdXQoJnBIZGRDdHgtPmZ0bS5mdG1fY29tcF92YXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoV0xBTl9GVE1fQ09NTUFORF9USU1FX09VVCkpOworICAgIGlmICgwID49IHJldCApCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICBGTCgid2FpdCBvbiBmdG1fY29tcF92YXIgZmFpbGVkICVsZCIpLCByZXQpOworICAgIH0KK2RvbmU6CisKKyAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfQorCisvKiBzZXQgcGFyYW0gc3ViLWlvY3RscyAqLworc3RhdGljIGludCBfX2l3X2Z0bV9zZXRjaGFyX2dldG5vbmUoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaW50IHJldCxzdWJfY21kOworICAgIHVuc2lnbmVkIGludCBsZW5nd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cGFyYW0pOworCisgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgIGdvdG8gT1VUOworICAgIH0KKworICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICIlczogUmVjZWl2ZWQgbGVuZ3RoICVkLCBwYXJhbWV0ZXJzOiAlcyIsIF9fZnVuY19fLCBsZW5ndGgsIHBhcmFtKTsKKworICAgIHN3aXRjaChzdWJfY21kKQorICAgIHsKKyAgICAgICBjYXNlIFdFX1NFVF9NQUNfQUREUkVTUzoKKyAgICAgICB7CisKKyAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAiU0VUIE1BQyBBRERSRVNTIik7CisKKyAgICAgICAgICBzdGF0dXMgID0gd2xhbl9mdG1fcHJpdl9zZXRfbWFjX2FkZHJlc3MocEFkYXB0ZXIscGFyYW0pOworCisgICAgICAgICAgaWYoc3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICB7CisgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAgIndsYW5fZnRtX3ByaXZfc2V0X21hY19hZGRyZXNzIEZhaWxlZCA9JWQiLHN0YXR1cyk7CisKKyAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgIH0KKworICAgICAgICAgIGJyZWFrOworICAgICAgIH0KKyAgICAgICBjYXNlIFdFX1NFVF9UWF9SQVRFOgorICAgICAgIHsKKyAgICAgICAgICAgIHN0YXR1cyAgPSB3bGFuX2Z0bV9wcml2X3NldF90eHJhdGUocEFkYXB0ZXIscGFyYW0pOworCisgICAgICAgICAgICBpZihzdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAgICAid2xhbl9mdG1fcHJpdl9zZXRfdHhyYXRlIEZhaWxlZCA9JWQiLHN0YXR1cyk7CisKKyAgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBicmVhazsKKyAgICAgICB9CisgICAgICAgZGVmYXVsdDoKKyAgICAgICB7CisgICAgICAgICAgIGhkZExvZyhMT0dFLCAiJXM6IEludmFsaWQgc3ViIGNvbW1hbmQgJWQiLF9fZnVuY19fLCBzdWJfY21kKTsKKyAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgYnJlYWs7CisgICAgICAgfQorICAgIH0KKworT1VUOgorICAgIGtmcmVlKHBhcmFtKTsKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBpd19mdG1fc2V0Y2hhcl9nZXRub25lKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgaW50IHJldDsKKworICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgIHJldCA9IF9faXdfZnRtX3NldGNoYXJfZ2V0bm9uZShkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBfX2l3X2Z0bV9zZXRpbnRfZ2V0bm9uZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9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fLCBzdGF0dXMpOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIFdFX1RYX1BLVF9HRU46CisgICAgICAgICAgICBzdGF0dXMgID0gd2xhbl9mdG1fcHJpdl9zdGFydF9zdG9wX3R4X3BrdGdlbihwQWRhcHRlcixzZXRfdmFsdWUpOworCisgICAgICAgICAgICBpZihzdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwid2xhbl9mdG1fcHJpdl9zdGFydF9zdG9wX3R4X3BrdGdlbiBGYWlsZWQgPSVkIixzdGF0dXMpOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgV0VfU0VUX1RYX0lGUzoKKyAgICAgICAgICAgIHN0YXR1cyAgPSB3bGFuX2Z0bV9wcml2X3NldF90eGlmcyhwQWRhcHRlcixzZXRfdmFsdWUpOworCisgICAgICAgICAgICBpZihzdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwid2xhbl9mdG1fcHJpdl9zZXRfdHhpZnMgRmFpbGVkID0lZCIsc3RhdHVzKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFdFX1NFVF9UWF9QS1RfQ05UOgorICAgICAgICAgICAgc3RhdHVzICA9IHdsYW5fZnRtX3ByaXZfc2V0X3R4cGt0Y250KHBBZGFwdGVyLHNldF92YWx1ZSk7CisKKyAgICAgICAgICAgIGlmKHN0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCJ3bGFuX2Z0bV9wcml2X3NldF90eHBrdGNudCBGYWlsZWQgPSVkIixzdGF0dXMpOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgV0VfU0VUX1RYX1BLVF9MRU46CisgICAgICAgICAgICBzdGF0dXMgID0gd2xhbl9mdG1fcHJpdl9zZXRfdHhwa3RsZW4ocEFkYXB0ZXIsc2V0X3ZhbHVlKTsKKworICAgICAgICAgICAgaWYoc3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsIndsYW5fZnRtX3ByaXZfc2V0X3R4cGt0bGVuIEZhaWxlZCA9JWQiLHN0YXR1cyk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBXRV9UWF9DV19SRl9HRU46CisgICAgICAgICAgICBzdGF0dXMgPSB3bGFuX2Z0bV9wcml2X2N3X3JmX2dlbihwQWRhcHRlcixzZXRfdmFsdWUpOworCisgICAgICAgICAgICBpZihzdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsIndsYW5fZnRtX3ByaXZfY3dfZ2VuIEZhaWxlZCA9JWRcbiIsc3RhdHVzKTsKKyAgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBXRV9TRVRfQ0hBTk5FTDoKKyAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzICA9IHdsYW5fZnRtX3ByaXZfc2V0X2NoYW5uZWwocEFkYXB0ZXIsc2V0X3ZhbHVlKTsKKworICAgICAgICAgICAgaWYoc3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsIndsYW5fZnRtX3ByaXZfc2V0X2NoYW5uZWwgRmFpbGVkID0lZCIsc3RhdHVzKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBjYXNlIFdFX1NFVF9UWF9QT1dFUjoKKyAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzICA9IHdsYW5fZnRtX3ByaXZfc2V0X3R4cG93ZXIocEFkYXB0ZXIsc2V0X3ZhbHVlKTsKKworICAgICAgICAgICAgaWYoc3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsIndsYW5fZnRtX3ByaXZfc2V0X3R4cG93ZXIgRmFpbGVkID0lZCIsc3RhdHVzKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBjYXNlIFdFX0NMRUFSX1JYX1BLVF9DTlQ6CisgICAgICAgIHsKKyAgICAgICAgICAgIHN0YXR1cyAgPSB3bGFuX2Z0bV9wcml2X3J4X3BrdF9jbGVhcihwQWRhcHRlcixzZXRfdmFsdWUpOworCisgICAgICAgICAgICBpZihzdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwid2xhbl9mdG1fcHJpdl9yeF9wa3RfY2xlYXIgRmFpbGVkID0lZCIsc3RhdHVzKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBjYXNlIFdFX1JYOgorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgID0gd2xhbl9mdG1fcHJpdl9yeF9tb2RlKHBBZGFwdGVyLHNldF92YWx1ZSk7CisKKyAgICAgICAgICAgIGlmKHN0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCJ3bGFuX2Z0bV9wcml2X3J4X21vZGUgRmFpbGVkID0lZCIsc3RhdHVzKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBjYXNlIFdFX0VOQUJMRV9DSEFJTjoKKyAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzICA9IHdsYW5fZnRtX3ByaXZfZW5hYmxlX2NoYWluKHBBZGFwdGVyLHNldF92YWx1ZSk7CisKKyAgICAgICAgICAgIGlmKHN0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCJ3bGFuX2Z0bV9wcml2X2VuYWJsZV9jaGFpbiBGYWlsZWQgPSVkIixzdGF0dXMpOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBXRV9TRVRfUFdSX0NOVExfTU9ERToKKyAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzICA9IHdsYW5fZnRtX3ByaXZfc2V0X3B3cl9jbnRsX21vZGUocEFkYXB0ZXIsIHNldF92YWx1ZSk7CisgICAgICAgICAgICBpZiAoc3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsICJzZXRfcHdyX2NudGxfbW9kZSBmYWlsZWQgPSAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgV0VfRU5BQkxFX0RQRDoKKyAgICAgICAgeworICAgICAgICAgICBzdGF0dXMgID0gd2xhbl9mdG1fcHJpdl9lbmFibGVfZHBkKHBBZGFwdGVyLCBzZXRfdmFsdWUpOworICAgICAgICAgICBpZiAoc3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgeworICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCAiZW5hYmxlX2RwZCBmYWlsZWQgPSAlZCIsIHN0YXR1cyk7CisgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIFdFX1NFVF9DQjoKKyAgICAgICAgeworICAgICAgICAgICBzdGF0dXMgID0gd2xhbl9mdG1fcHJpdl9zZXRfY2IocEFkYXB0ZXIsIHNldF92YWx1ZSk7CisgICAgICAgICAgIGlmIChzdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsICJzZXRfY2IgZmFpbGVkID0gJWQiLCBzdGF0dXMpOworICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICB9CisgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKExPR0UsICJJbnZhbGlkIElPQ1RMIHNldHZhbHVlIGNvbW1hbmQgJWQgdmFsdWUgJWQiLAorICAgICAgICAgICAgICAgIHN1Yl9jbWQsIHNldF92YWx1ZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IGl3X2Z0bV9zZXRpbnRfZ2V0bm9uZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X2Z0bV9zZXRpbnRfZ2V0bm9uZShkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorLyogZ2V0IHBhcmFtIHN1Yi1pb2N0bHMgKi8KK3N0YXRpYyBpbnQgX19pd19mdG1fc2V0bm9uZV9nZXRpbnQoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0c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gYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBXRV9HRVRfVFhfUE9XRVI6CisgICAgICAgIHsKKyAgICAgICAgICAgc3RhdHVzID0gd2xhbl9mdG1fcHJpdl9nZXRfdHhwb3dlcihwQWRhcHRlciwodl9VMTZfdCopdmFsdWUpOworCisgICAgICAgICAgIGlmKHN0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwid2xhbl9mdG1fcHJpdl9nZXRfdHhwb3dlciBGYWlsZWQgPSVkIixzdGF0dXMpOworICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICB9CisgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGNhc2UgV0VfR0VUX1JYX1BLVF9DTlQ6CisgICAgICAgIHsKKyAgICAgICAgICAgc3RhdHVzID0gd2xhbl9mdG1fcHJpdl9nZXRfcnhfcGt0X2NvdW50KHBBZGFwdGVyLCh2X1UxNl90Kil2YWx1ZSk7CisKKyAgICAgICAgICAgaWYoc3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgeworICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCJ3bGFuX2Z0bV9wcml2X2dldF9yeF9wa3RfY291bnQgRmFpbGVkID0lZCIsc3RhdHVzKTsKKyAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgfQorICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBkZWZhdWx0OgorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coTE9HRSwgIkludmFsaWQgSU9DVEwgZ2V0X3ZhbHVlIGNvbW1hbmQgJWQgIix2YWx1ZVswXSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IGl3X2Z0bV9zZXRub25lX2dldGludChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X2Z0bV9zZXRub25lX2dldGludChkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IF9faXdfZnRtX2dldF9jaGFyX3NldG5vbmUoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaW50IHN1Yl9jbWQgPSB3cnF1LT5kYXRhLmZsYWdzOworICAgIFZPU19TVEFUVVMgc3RhdHVzOworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgaW50IHJldCA9IDA7CisKKyAgICBFTlRFUigpOworCisgICAgcEFkYXB0ZXIgPSAobmV0ZGV2X3ByaXYoZGV2KSk7CisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIHJldCA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gcmV0KQorICAgIHsKKyAgICAgICAgcmV0dXJuIHJldDsKKyAgICB9CisgICAgc3dpdGNoKHN1Yl9jbWQpCisgICAgeworICAgICAgICBjYXNlIFdFX0dFVF9NQUNfQUREUkVTUzoKKyAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzID0gd2xhbl9mdG1fcHJpdl9nZXRfbWFjX2FkZHJlc3MocEFkYXB0ZXIsIGV4dHJhKTsKKworICAgICAgICAgICAgaWYoc3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCAid2xhbl9mdG1fcHJpdl9nZXRfbWFjX2FkZHJlc3MgZmFpbGVkID0lZCIsc3RhdHVzKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHdycXUtPmRhdGEubGVuZ3RoID0gc3RybGVuKGV4dHJhKSsxOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBXRV9HRVRfVFhfUkFURToKKyAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzID0gd2xhbl9mdG1fcHJpdl9nZXRfdHhyYXRlKHBBZGFwdGVyLCBleHRyYSk7CisKKyAgICAgICAgICAgIGlmKHN0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwgIndsYW5fZnRtX3ByaXZfZ2V0X3R4cmF0ZSBmYWlsZWQgPSVkIixzdGF0dXMpOworICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB3cnF1LT5kYXRhLmxlbmd0aCA9IHN0cmxlbihleHRyYSkrMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGNhc2UgV0VfR0VUX0ZUTV9TVEFUVVM6CisgICAgICAgIHsKKyAgICAgICAgICAgIHN0YXR1cyA9IHdsYW5fZnRtX3ByaXZfZ2V0X3N0YXR1cyhwQWRhcHRlciwgZXh0cmEpOworCisgICAgICAgICAgICBpZihzdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsICJ3bGFuX2Z0bV9wcml2X2dldF9zdGF0dXMgZmFpbGVkID0lZCIsc3RhdHVzKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgd3JxdS0+ZGF0YS5sZW5ndGggPSBzdHJsZW4oZXh0cmEpKzE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBjYXNlIFdFX0dFVF9SWF9SU1NJOgorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSB3bGFuX2Z0bV9wcml2X2dldF9yeF9yc3NpKHBBZGFwdGVyLCBleHRyYSk7CisKKyAgICAgICAgICAgIGlmKHN0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwgIndsYW5fZnRtX3ByaXZfZ2V0X3J4X3Jzc2kgZmFpbGVkID0lZCIsc3RhdHVzKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgd3JxdS0+ZGF0YS5sZW5ndGggPSBzdHJsZW4oZXh0cmEpKzE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBkZWZhdWx0OgorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coTE9HRSwgIiVzOiBJbnZhbGlkIElPQ1RMIGNvbW1hbmQgJWQiLCBfX2Z1bmNfXywgc3ViX2NtZCApOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIDA7Cit9CisKK3N0YXRpYyBpbnQgaXdfZnRtX2dldF9jaGFyX3NldG5vbmUoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaW50IHJldDsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX19pd19mdG1fZ2V0X2NoYXJfc2V0bm9uZShkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKworICAgIHJldHVybiByZXQ7Cit9CisKK1ZPU19TVEFUVVMgd2xhbl93cml0ZV90b19lZnMgKHZfVThfdCAqcERhdGEsIHZfVTE2X3QgZGF0YV9sZW4pCit7CisjaWYgZGVmaW5lZChNU01fUExBVEZPUk0pCisgICAgdEFuaUhkciAqd21zZyA9IE5VTEw7CisgICAgdl9VOF90ICpwQnVmOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSBOVUxMOworICAgIHZfQ09OVEVYVF90IHBWb3NDb250ZXh0PSBOVUxMOworCisgICAgcEJ1ZiA9ICAodl9VOF90Kil2b3NfbWVtX21hbGxvYyhzaXplb2YodEFuaUhkcikgKyBzaXplb2Yodl9VMzJfdCkrIGRhdGFfbGVuKTsKKyAgICBpZihwQnVmID09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kX21zZ190b19hcHAod21zZywgMCwKKyAgICAgICAgICAgICAgICAgICAgICBBTklfTkxfTVNHX1BVTUFDLCBwSGRkQ3R4LT5wdHRfcGlkLCAwKSA8IDApIHsKKworICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgKCJQdHQgU29ja2V0IGVycm9yIHNlbmRpbmcgbWVzc2FnZSB0byB0aGUgYXBwISEiKSk7CisgICAgICAgICAgIHZvc19tZW1fZnJlZSgodl9WT0lEX3QqKXdtc2cpOworICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICAgfQorICAgfQorICAgZWxzZSB7CisgICAgaWYoIHB0dF9zb2NrX3NlbmRfbXNnX3RvX2FwcCh3bXNnLCAwLAorICAgICAgICAgICAgICAgICAgICBBTklfTkxfTVNHX1BVTUFDLCBwSGRkQ3R4LT5mdG0ud25sLT5ubGgubmxtc2dfcGlkLCAwKSA8IDApIHsKKworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgKCJQdHQgU29ja2V0IGVycm9yIHNlbmRpbmcgbWVzc2FnZSB0byB0aGUgYXBwISEiKSk7CisgICAgICAgIHZvc19tZW1fZnJlZSgodl9WT0lEX3QqKXdtc2cpOworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgfQorICAgfQorCisgICAgdm9zX21lbV9mcmVlKCh2X1ZPSURfdCopd21zZyk7CisjZW5kaWYgLy9GVE0gYW5kIEFORFJPSUQKKworICAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9CisKKy8qICBhY3Rpb24gc3ViLWlvY3RscyAqLworc3RhdGljIGludCBfX2l3X2Z0bV9zZXRub25lX2dldG5vbmUoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaW50IHN1Yl9jbWQgPSB3cnF1LT5kYXRhLmZsYWdzOworICAgIGludCByZXQgPSAwOyAvKiBzdWNjZXNzICovCisKKyAgICBzd2l0Y2ggKHN1Yl9jbWQpCisgICAgeworICAgICAgICBjYXNlIFdFX1NFVF9OVl9ERUZBVUxUUzoKKyAgICAgICAgeworICAgICAgICAgICAgdl9VOF90ICpwdThidWYsKnBUZW1wQnVmOworICAgICAgICAgICAgdl9VMTZfdCBzaXplOworICAgICAgICAgICAgc2l6ZSA9IHNpemVvZih2X1UzMl90KSArIHNpemVvZihzSGFsTnYpOworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsIkhBTCBOViBTaXplID0lZCIsc2l6ZSk7CisgICAgICAgICAgICBwdThidWYgPSB2b3NfbWVtX21hbGxvYyhzaXplKTsKKyAgICAgICAgICAgIGlmKHB1OGJ1ZiA9PSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCAiJXM6cHU4YnVmIGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX05PTUVNOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbWVtc2V0KHB1OGJ1ZiwwLHNpemUpOworICAgICAgICAgICAgcFRlbXBCdWYgPSBwdThidWY7CisgICAgICAgICAgICBwVGVtcEJ1ZiArPSBzaXplb2Yodl9VMzJfdCk7CisgICAgICAgICAgICBtZW1jcHkocFRlbXBCdWYsJm52RGVmYXVsdHMsc2l6ZW9mKHNIYWxOdikpOworCisgICAgICAgICAgICB3bGFuX3dyaXRlX3RvX2VmcyhwdThidWYsc2l6ZSk7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocHU4YnVmKTsKKyAgICAgICAgfQorCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCIlczogdW5rbm93biBpb2N0bCAlZCIsIF9fZnVuY19fLCBzdWJfY21kKTsKKyAgICAgICAgICAgIGhkZExvZyhMT0dFLCAiSW52YWxpZCBJT0NUTCBhY3Rpb24gY29tbWFuZCAlZCAiLCBzdWJfY21kKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBpd19mdG1fc2V0bm9uZV9nZXRub25lKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9faXdfZnRtX3NldG5vbmVfZ2V0bm9uZShkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IF9faXdfZnRtX3NldF92YXJfaW50c19nZXRub25lKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgaW50IHN1Yl9jbWQgPSB3cnF1LT5kYXRhLmZsYWdzOworICAgIGludCAqdmFsdWUgPSAoaW50Kil3cnF1LT5kYXRhLnBvaW50ZXI7CisgICAgaW50IHJldCA9IDA7CisKKyAgICBFTlRFUigpOworCisgICAgaWYod3JxdS0+ZGF0YS5sZW5ndGggIT0gMikKKyAgICB7CisgICAgICAgIGhkZExvZyhMT0dFLCAiSW52YWxpZCBudW1iZXIgb2YgQXJndW1lbnRzICAlZCAiLCAgd3JxdS0+ZGF0YS5sZW5ndGgpOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgcEFkYXB0ZXIgPSAobmV0ZGV2X3ByaXYoZGV2KSk7CisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBBZGFwdGVyIGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHJldCkKKyAgICB7CisgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorICAgIHN3aXRjaCAoc3ViX2NtZCkKKyAgICB7CisgICAgICAgIGNhc2UgV0VfU0VUX1RYX1dGX0dBSU46CisgICAgICAgIHsKKyAgICAgICAgICAgIHZfUzE1X3QgZEdhaW4gPSAwOworICAgICAgICAgICAgdl9VMTZfdCByZkdhaW4gPSAwOworICAgICAgICAgICAgVk9TX1NUQVRVUyBzdGF0dXM7CisKKyAgICAgICAgICAgIGRHYWluID0gKih2X1MxNV90KikgdmFsdWUrKzsKKyAgICAgICAgICAgIHJmR2FpbiA9ICoodl9VMTZfdCopIHZhbHVlOworICAgICAgICAgICAgc3RhdHVzID0gd2xhbl9mdG1fcHJpdl9zZXRfd2ZnYWluKHBBZGFwdGVyLGRHYWluLHJmR2Fpbik7CisKKyAgICAgICAgICAgIGlmKHN0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICJ3bGFuX2Z0bV9wcml2X3NldF93ZmdhaW4gRmFpbGVkID0lZFxuIiwgc3RhdHVzKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coTE9HRSwgIkludmFsaWQgSU9DVEwgY29tbWFuZCAlZCAiLCBzdWJfY21kICk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gMDsKK30KKworCitzdGF0aWMgaW50IGl3X2Z0bV9zZXRfdmFyX2ludHNfZ2V0bm9uZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgIGludCByZXQ7CisKKyAgIGlmICghY2FwYWJsZShDQVBfTkVUX0FETUlOKSkKKyAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgIEZMKCJwZXJtaXNzaW9uIGNoZWNrIGZhaWxlZCIpKTsKKyAgICAgICAgcmV0dXJuIC1FUEVSTTsKKyAgIH0KKworICAgdm9zX3Nzcl9wcm90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W4gYmUgb25seSAxNSAqLworc3RhdGljIGNvbnN0IHN0cnVjdCBpd19wcml2X2FyZ3Mgd2VfZnRtX3ByaXZhdGVfYXJnc1tdID0geworCisgICAgLyogaGFuZGxlcnMgZm9yIG1haW4gaW9jdGwgKi8KKyAgICB7ICAgV0xBTl9GVE1fUFJJVl9TRVRfSU5UX0dFVF9OT05FLAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgMSwKKyAgICAgICAgMCwKKyAgICAgICAgIiIgfSwKKworICAgIHsgICBXRV9GVE1fT05fT0ZGLAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgMSwKKyAgICAgICAgMCwKKyAgICAgICAgImZ0bSIgfSwKKworICAgIHsgICBXRV9UWF9QS1RfR0VOLAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgMSwKKyAgICAgICAgMCwKKyAgICAgICAgInR4IiB9LAorCisgICAgeyAgIFdFX1NFVF9UWF9JRlMsCisgICAgICAgIElXX1BSSVZfVFlQRV9JTlQgfCBJV19QUklWX1NJWkVfRklYRUQgfCAxLAorICAgICAgICAwLAorICAgICAgICAic2V0X3R4aWZzIiB9LAorCisgICAgeyAgIFdFX1NFVF9UWF9QS1RfQ05ULAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgMSwKKyAgICAgICAgMCwKKyAgICAgICAgInNldF90eHBrdGNudCIgfSwKKworICAgIHsgICBXRV9TRVRfVFhfUEtUX0xFTiwKKyAgICAgICAgSVdfUFJJVl9UWVBFX0lOVCB8IElXX1BSSVZfU0laRV9GSVhFRCB8IDEsCisgICAgICAgIDAsCisgICAgICAgICJzZXRfdHhwa3RsZW4iIH0sCisKKyAgICB7ICAgV0VfU0VUX1RYX1dGX0dBSU4sCisgICAgICAgIElXX1BSSVZfVFlQRV9JTlQgfCBNQVhfRlRNX1ZBUl9BUkdTLAorICAgICAgICAwLAorICAgICAgICAic2V0X3R4X3dmX2dhaW4iIH0sCisKKyAgICB7ICAgV0VfVFhfQ1dfUkZfR0VOLAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgMSwKKyAgICAgICAgMCwKKyAgICAgICAgInR4X2N3X3JmX2dlbiIgfSwKKyAgICB7ICAgV0VfU0VUX0NIQU5ORUwsCisgICAgICAgIElXX1BSSVZfVFlQRV9JTlQgfCBJV19QUklWX1NJWkVfRklYRUQgfCAxLAorICAgICAgICAwLAorICAgICAgICAic2V0X2NoYW5uZWwiIH0sCisKKyAgICB7ICAgV0VfU0VUX1RYX1BPV0VSLAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgMSwKKyAgICAgICAgMCwKKyAgICAgICAgInNldF90eHBvd2VyIiB9LAorCisgICAgeyAgIFdFX0NMRUFSX1JYX1BLVF9DTlQsCisgICAgICAgIElXX1BSSVZfVFlQRV9JTlQgfCBJV19QUklWX1NJWkVfRklYRUQgfCAxLAorICAgICAgICAwLAorICAgICAgICAiY2xyX3J4cGt0Y250IiB9LAorCisgICAgeyAgIFdFX1JYLAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgMSwKKyAgICAgICAgMCwKKyAgICAgICAgInJ4IiB9LAorCisgICAgeyAgIFdFX0VOQUJMRV9DSEFJTiwKKyAgICAgICAgSVdfUFJJVl9UWVBFX0lOVCB8IElXX1BSSVZfU0laRV9GSVhFRCB8IDEsCisgICAgICAgIDAsCisgICAgICAgICJlbmFfY2hhaW4iIH0sCisKKyAgICB7ICAgV0VfU0VUX1BXUl9DTlRMX01PREUsCisgICAgICAgIElXX1BSSVZfVFlQRV9JTlQgfCBJV19QUklWX1NJWkVfRklYRUQgfCAxLAorICAgICAgICAwLAorICAgICAgICAicHdyX2NudGxfbW9kZSIgfSwKKworICAgIHsgICBXRV9FTkFCTEVfRFBELAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgMSwKKyAgICAgICAgMCwKKyAgICAgICAgImVuYV9kcGQiIH0sCisKKyAgICB7ICAgV0VfU0VUX0NCLAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgMSwKKyAgICAgICAgMCwKKyAgICAgICAgInNldF9jYiIgfSwKKworICAgIC8qIGhhbmRsZXJzIGZvciBtYWluIGlvY3RsICovCisgICAgeyAgIFdMQU5fRlRNX1BSSVZfU0VUX05PTkVfR0VUX0lOVCwKKyAgICAgICAgMCwKKyAgICAgICAgSVdfUFJJVl9UWVBFX0lOVCB8IElXX1BSSVZfU0laRV9GSVhFRCB8IDEsCisgICAgICAgICIiIH0sCisKKyAgICB7ICAgV0VfR0VUX0NIQU5ORUwsCisgICAgICAgIDAsCisgICAgICAgIElXX1BSSVZfVFlQRV9JTlQgfCBJV19QUklWX1NJWkVfRklYRUQgfCAxLAorICAgICAgICAiZ2V0X2NoYW5uZWwiIH0sCisKKyAgICB7ICAgV0VfR0VUX1RYX1BPV0VSLAorICAgICAgICAwLAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgMSwKKyAgICAgICAgImdldF90eHBvd2VyIiB9LAorCisgICAgeyAgIFdFX0dFVF9SWF9QS1RfQ05ULAorICAgICAgICAwLAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgMSwKKyAgICAgICAgImdldF9yeHBrdGNudCIgfSwKKworICAgIC8qIGhhbmRsZXJzIGZvciBtYWluIGlvY3RsICovCisgICAgeyAgIFdMQU5fRlRNX1BSSVZfU0VUX0NIQVJfR0VUX05PTkUsCisgICAgICAgIElXX1BSSVZfVFlQRV9DSEFSfCA1MTIsCisgICAgICAgIDAsCisgICAgICAgICIiIH0sCisKKyAgICB7ICAgV0VfU0VUX01BQ19BRERSRVNTLAorICAgICAgICBJV19QUklWX1RZUEVfQ0hBUnwgNTEyLAorICAgICAgICAwLAorICAgICAgICAic2V0X21hY19hZGRyZXNzIiB9LAorCisgICAgeyAgIFdFX1NFVF9UWF9SQVRFLAorICAgICAgICBJV19QUklWX1RZUEVfQ0hBUiB8IDUxMiwKKyAgICAgICAgMCwKKyAgICAgICAgInNldF90eHJhdGUiIH0sCisKKyAgICAvKiBoYW5kbGVycyBmb3IgbWFpbiBpb2N0bCAqLworICAgIHsgICBXTEFOX0ZUTV9QUklWX0dFVF9DSEFSX1NFVF9OT05FLAorICAgICAgICAwLAorICAgICAgICBJV19QUklWX1RZUEVfQ0hBUnwgV0VfRlRNX01BWF9TVFJfTEVOLAorICAgICAgICAiIiB9LAorCisgICAgeyAgIFdFX0dFVF9NQUNfQUREUkVTUywKKyAgICAgICAgMCwKKyAgICAgICAgSVdfUFJJVl9UWVBFX0NIQVJ8IFdFX0ZUTV9NQVhfU1RSX0xFTiwKKyAgICAgICAgImdldF9tYWNfYWRkcmVzcyIgfSwKKworICAgIHsgICBXRV9HRVRfVFhfUkFURSwKKyAgICAgICAgMCwKKyAgICAgICAgSVdfUFJJVl9UWVBFX0NIQVJ8IFdFX0ZUTV9NQVhfU1RSX0xFTiwKKyAgICAgICAgImdldF90eHJhdGUiIH0sCisKKyAgICB7ICAgV0VfR0VUX0ZUTV9TVEFUVVMsCisgICAgICAgIDAsCisgICAgICAgIElXX1BSSVZfVFlQRV9DSEFSfCBXRV9GVE1fTUFYX1NUUl9MRU4sCisgICAgICAgICJnZXRfc3RhdHVzIiB9LAorCisgICAgeyAgIFdFX0dFVF9SWF9SU1NJLAorICAgICAgICAwLAorICAgICAgICBJV19QUklWX1RZUEVfQ0hBUnwgV0VfRlRNX01BWF9TVFJfTEVOLAorICAgICAgIC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T04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1IgT1RIRVIKKyAqIFRPUlRJT1VTIEFDVElPTiwgQVJJU0lORyBPVVQgT0YgT1IgSU4gQ09OTkVDVElPTiBXSVRIIFRIRSBVU0UgT1IKKyAqIFBFUkZPUk1BTkNFIE9GIFRISVMgU09GVFdBUkUuCisgKi8KKworLyoKKyAqIFRoaXMgZmlsZSB3YXMgb3JpZ2luYWxseSBkaXN0cmlidXRlZCBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAKKyAgXGZpbGUgIHdsYW5faGRkX2hvc3RhcGQuYworICBcYnJpZWYgV0xBTiBIb3N0IERldmljZSBEcml2ZXIgaW1wbGVtZW50YXRpb24KKyAgICAgICAgICAgICAgIAorICAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gCisgICAgICAgICAgICAgICAgICAgICAgIEVESVQgSElTVE9SWSBGT1IgRklMRSAKKyAgIAorICAgCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLiAKKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4gCisgICAKKyAgJEhlYWRlc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Q0NFU1MgaWYgcGFja2V0IGlzIGVucXVldWVkIHN1Y2Nlc2Z1bGx5CisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitpbnQgaGRkX2hvc3RhcGRfaGFyZF9zdGFydF94bWl0KHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCit7CisgICAgcmV0dXJuIDA7ICAgIAorfQorCitpbnQgX19oZGRfaG9zdGFwZF9jaGFuZ2VfbXR1KHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsIGludCBuZXdfbXR1KQoreworICAgIHJldHVybiAwOworfQorCitpbnQgaGRkX2hvc3RhcGRfY2hhbmdlX210dShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBpbnQgbmV3X210dSkKK3sKKyAgICBpbnQgcmV0OworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX19oZGRfaG9zdGFwZF9jaGFuZ2VfbXR1KGRldiwgbmV3X210dSk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBoZGRfaG9zdGFwZF9kcml2ZXJfY29tbWFuZChoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGRkX3ByaXZfZGF0YV90ICpwcml2X2RhdGEpCit7CisgICB0QU5JX1U4ICpjb21tYW5kID0gTlVMTDsKKyAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgIGhkZF9zY2FuaW5mb190ICpwU2NhbkluZm8gPSBOVUxMOworICAgaW50IHJldCA9IDA7CisgICBpbnQgc3RhdHVzOworICAgLyoKKyAgICAqIE5vdGUgdGhhdCB2YWxpZCBwb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YmUgYSBzdHJpbmcgaGF2aW5nIGZvcm1hdAorICAgICAgICogU0VUX1NBUF9DSEFOTkVMX0xJU1QgPG51bSBjaGFubmVscz4gPGNoYW5uZWxzIHNlcGVyYXRlZCBieSBzcGFjZXM+CisgICAgICAgKi8KKyAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAiJXM6IFJlY2VpdmVkIENvbW1hbmQgdG8gU2V0IFByZWZlcnJlZCBDaGFubmVscyBmb3IgU0FQIiwKKyAgICAgICAgICAgICBfX2Z1bmNfXyk7CisKKyAgICAgIHJldCA9IHNhcFNldFByZWZlcnJlZENoYW5uZWwoY29tbWFuZCk7CisgICB9CisgICBlbHNlIGlmICggc3RybmNhc2VjbXAoY29tbWFuZCwgIk1JUkFDQVNUIiwgOCkgPT0gMCApCisgICB7CisgICAgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgICAgIHRBTklfVTggZmlsdGVyVHlwZSA9IDA7CisgICAgICAgdEFOSV9VOCAqdmFsdWU7CisgICAgICAgdmFsdWUgPSBjb21tYW5kICsgOTsKKworICAgICAgIC8qIENvbnZlcnQgdGhlIHZhbHVlIGZyb20gYXNjaWkgdG8gaW50ZWdlciAqLworICAgICAgIHJldCA9IGtzdHJ0b3U4KHZhbHVlLCAxMCwgJmZpbHRlclR5cGUpOworICAgICAgIGlmIChyZXQgPCAwKQorICAgICAgIHsKKyAgICAgICAgICAgLyogSWYgdGhlIGlucHV0IHZhbHVlIGlzIGdyZWF0ZXIgdGhhbiBtYXggdmFsdWUgb2YgZGF0YXR5cGUsCisgICAgICAgICAgICAqIHRoZW4gYWxzbyBrc3RydG91OCBmYWlscworICAgICAgICAgICAgKi8KKyAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICIlczoga3N0cnRvdTggZmFpbGVkIHJhbmdlICIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgZ290byBleGl0OworICAgICAgIH0KKyAgICAgICBpZiAoKGZpbHRlclR5cGUgPCBXTEFOX0hERF9EUklWRVJfTUlSQUNBU1RfQ0ZHX01JTl9WQUwgKSB8fAorICAgICAgICAgICAgICAgKGZpbHRlclR5cGUgPiBXTEFOX0hERF9EUklWRVJfTUlSQUNBU1RfQ0ZHX01BWF9WQUwpKQorICAgICAgIHsKKyAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICIlczogQWNjZXB0ZWQgVmFsdWVzIGFyZSAwIHRvIDIuIDAtRGlzYWJsZWQsIDEtU291cmNlLCIKKyAgICAgICAgICAgICAgICAgICAiIDItU2luayAiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICB9CisgICAgICAgLy9GaWx0ZXJ0eXBlIHZhbHVlIHNob3VsZCBiZSBlaXRoZXIgMC1EaXNhYmxlZCwgMS1Tb3VyY2UsIDItc2luaworICAgICAgIHBIZGRDdHgtPmRydnJfbWlyYWNhc3QgPSBmaWx0ZXJUeXBlOworICAgICAgIHBTY2FuSW5mbyA9ICAmcEhkZEN0eC0+c2Nhbl9pbmZvOworICAgICAgIGlmIChmaWx0ZXJUeXBlICYmIHBTY2FuSW5mbyAhPSBOVUxMICYmCisgICAgICAgICAgIHBIZGRDdHgtPnNjYW5faW5mby5tU2NhblBlbmRpbmcpCisgICAgICAgeworICAgICAgICAgICAvKk1pcmFjYXN0IFNlc3Npb24gc3RhcnRlZC4gQWJvcnQgU2NhbiAqLworICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICIlcywgQWJvcnRpbmcgU2NhbiBGb3IgTWlyYWNhc3QiLF9fZnVuY19fKTsKKyAgICAgICAgICBoZGRfYWJvcnRfbWFjX3NjYW4ocEhkZEN0eCwgcFNjYW5JbmZvLT5zZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfU0NBTl9BQk9SVF9ERUZBVUxUKTsKKyAgICAgICB9CisgICAgICAgaGRkX3R4X3J4X3BrdF9jbnRfc3RhdF90aW1lcl9oYW5kbGVyKHBIZGRDdHgpOworICAgICAgIHNtZV9TZXRNaXJhY2FzdE1vZGUocEhkZEN0eC0+aEhhbCwgcEhkZEN0eC0+ZHJ2cl9taXJhY2FzdCk7CisgICB9CisgICBlbHNlIGlmIChzdHJuY2FzZWNtcChjb21tYW5kLCAiRElTQUJMRV9DQV9FVkVOVCIsIDE2KSA9PSAwKQorICAgeworICAgICAgIHJldCA9IGhkZF9lbmFibGVfZGlzYWJsZV9jYV9ldmVudChwSGRkQ3R4LCBjb21tYW5kLCAxNik7CisgICB9CisKK2V4aXQ6CisgICBpZiAoY29tbWFuZCkKKyAgIHsKKyAgICAgIGtmcmVlKGNvbW1hbmQpOworICAgfQorICAgRVhJVCgpOworICAgcmV0dXJuIHJldDsKK30KKworI2lmZGVmIENPTkZJR19DT01QQVQKK3N0YXRpYyBpbnQgaGRkX2hvc3RhcGRfZHJpdmVyX2NvbXBhdF9pb2N0bChoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaWZyZXEgKmlmcikKK3sKKyAgIHN0cnVjdCB7CisgICAgICBjb21wYXRfdXB0cl90IGJ1ZjsKKyAgICAgIGludCB1c2VkX2xlbjsKKyAgICAgIGludCB0b3RhbF9sZW47CisgICB9IGNvbXBhdF9wcml2X2RhdGE7CisgICBoZGRfcHJpdl9kYXRhX3QgcHJpdl9kYXRhOworICAgaW50IHJldCA9IDA7CisKKyAgIC8qCisgICAgKiBOb3RlIHRoYXQgcEFkYXB0ZXIgYW5kIGlmciBoYXZlIGFscmVhZHkgYmVlbiB2ZXJpZmllZCBieSBjYWxsZXIsCisgICAgKiBhbmQgSEREIGNvbnRleHQgaGFzIGFsc28gYmVlbiB2YWxpZGF0ZWQKKyAgICAqLworICAgaWYgKGNvcHlfZnJvbV91c2VyKCZjb21wYXRfcHJpdl9kYXRhLCBpZnItPmlmcl9kYXRhLAorICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihjb21wYXRfcHJpdl9kYXRhKSkpIHsKKyAgICAgICByZXQgPSAtRUZBVUxUOworICAgICAgIGdvdG8gZXhpdDsKKyAgIH0KKyAgIHByaXZfZGF0YS5idWYgPSBjb21wYXRfcHRyKGNvbXBhdF9wcml2X2RhdGEuYnVmKTsKKyAgIHByaXZfZGF0YS51c2VkX2xlbiA9IGNvbXBhdF9wcml2X2RhdGEudXNlZF9sZW47CisgICBwcml2X2RhdGEudG90YWxfbGVuID0gY29tcGF0X3ByaXZfZGF0YS50b3RhbF9sZW47CisgICByZXQgPSBoZGRfaG9zdGFwZF9kcml2ZXJfY29tbWFuZChwQWRhcHRlciwgJnByaXZfZGF0YSk7CisgZXhpdDoKKyAgIHJldHVybiByZXQ7Cit9CisjZWxzZSAvKiBDT05GSUdfQ09NUEFUICovCitzdGF0aWMgaW50IGhkZF9ob3N0YXBkX2RyaXZlcl9jb21wYXRfaW9jdGwoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGlmcmVxICppZnIpCit7CisgICAvKiB3aWxsIG5ldmVyIGJlIGludm9rZWQgKi8KKyAgIHJldHVybiAwOworfQorI2VuZGlmIC8qIENPTkZJR19DT01QQVQgKi8KKworc3RhdGljIGludCBoZGRfaG9zdGFwZF9kcml2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XhpdDsKKyAgIH0KKyAgIGlmIChkZXYgIT0gcEFkYXB0ZXItPmRldikgeworICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAiJXM6IEhERCBhZGFwdGVyL2RldiBpbmNvbnNpc3RlbmN5IiwgX19mdW5jX18pOworICAgICAgcmV0ID0gLUVOT0RFVjsKKyAgICAgIGdvdG8gZXhpdDsKKyAgIH0KKworICAgaWYgKCghaWZyKSB8fCAoIWlmci0+aWZyX2RhdGEpKSB7CisgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgZ290byBleGl0OworICAgfQorCisgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgaWYgKHJldCkgeworICAgICAgcmV0ID0gLUVCVVNZOworICAgICAgZ290byBleGl0OworICAgfQorCisgICBzd2l0Y2ggKGNtZCkgeworICAgY2FzZSAoU0lPQ0RFVlBSSVZBVEUgKyAxKToKKyAgICAgIGlmIChpc19jb21wYXRfdGFzaygpKQorICAgICAgICAgcmV0ID0gaGRkX2hvc3RhcGRfZHJpdmVyX2NvbXBhdF9pb2N0bChwQWRhcHRlciwgaWZyKTsKKyAgICAgIGVsc2UKKyAgICAgICAgIHJldCA9IGhkZF9ob3N0YXBkX2RyaXZlcl9pb2N0bChwQWRhcHRlciwgaWZyKTsKKyAgICAgIGJyZWFrOworICAgZGVmYXVsdDoKKyAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogdW5rbm93biBpb2N0bCAlZCIsCisgICAgICAgICAgICAgX19mdW5jX18sIGNtZCk7CisgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgYnJlYWs7CisgICB9CisgZXhpdDoKKyAgIEVYSVQoKTsKKyAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQgaGRkX2hvc3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UsIEZMKCJpbnZhbGlkIGFkYXB0ZXI6ICVwIiksIHBIb3N0YXBkQWRhcHRlcik7CisgICAgICAgICByZXR1cm47CisgICAgfQorICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBIb3N0YXBkQWRhcHRlcik7CisgICAgaWYgKDAgIT0gKHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCkpKQorICAgIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyNpZmRlZiBESVNBQkxFX0NPTkNVUlJFTkNZX0FVVE9TQVZFCisgICAgaWYgKHZvc19jb25jdXJyZW50X29wZW5fc2Vzc2lvbnNfcnVubmluZygpKQorICAgIHsKKyAgICAgICAvKgorICAgICAgICAgICAgICBUaGlzIHRpbWVyIHJvdXRpbmUgaXMgZ29pbmcgdG8gYmUgY2FsbGVkIG9ubHkgd2hlbiBBUAorICAgICAgICAgICAgICBwZXJzb25hIGlzIHVwLgorICAgICAgICAgICAgICBJZiB0aGVyZSBhcmUgY29uY3VycmVudCBzZXNzaW9ucyBydW5uaW5nIHdlIGRvIG5vdCB3YW50CisgICAgICAgICAgICAgIHRvIHNodXQgZG93biB0aGUgQnNzLkluc3RlYWQgd2UgcnVuIHRoZSB0aW1lciBhZ2FpbiBzbworICAgICAgICAgICAgICB0aGF0IGlmIEF1dG9zYXZlIGlzIGVuYWJsZWQgbmV4dCB0aW1lIGFuZCBvdGhlciBzZXNzaW9uCisgICAgICAgICAgICAgIHdhcyBkb3duIG9ubHkgdGhlbiB3ZSBicmluZyBkb3duIEFQIAorICAgICAgICAgICAgICovCisgICAgICAgIHBIZGRBcEN0eCA9IFdMQU5fSEREX0dFVF9BUF9DVFhfUFRSKHBIb3N0YXBkQWRhcHRlcik7CisgICAgICAgIHZvc19zdGF0dXMgPSB2b3NfdGltZXJfc3RhcnQoCisgICAgICAgICAmcEhkZEFwQ3R4LT5oZGRfYXBfaW5hY3Rpdml0eV90aW1lciwgCisgICAgICAgICAoV0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AgIHB0U2FwQ29udGV4dCAgcFNhcEN0eCA9IE5VTEw7CisgICAgZUhhbFN0YXR1cyBoYWxTdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIHZfUFZPSURfdCBoSGFsID0gTlVMTDsKKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAiJXM6IFVQREFURSBCZWFjb24gUGFyYW1zIiwgX19mdW5jX18pOworCisgICAgaWYoVk9TX1NUQV9TQVBfTU9ERSA9PSB2b3NfZ2V0X2NvbnBhcmFtICggKSl7CisgICAgICAgIHBTYXBDdHggPSBWT1NfR0VUX1NBUF9DQihwVm9zQ29udGV4dCk7CisgICAgICAgIGlmICggTlVMTCA9PSBwU2FwQ3R4ICkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgU0FQIHBvaW50ZXIgZnJvbSBwdm9zR0N0eCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICAgICAgIH0KKworICAgICAgICBoSGFsID0gVk9TX0dFVF9IQUxfQ0IocFNhcEN0eC0+cHZvc0dDdHgpOworICAgICAgICBpZiAoIE5VTEwgPT0gaEhhbCApeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgSEFMIHBvaW50ZXIgZnJvbSBwdm9zR0N0eCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICAgICAgIH0KKyAgICAgIC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MgZXZlbnQgZmFpbGVkISEiKSk7CisgICAgICAgICAgICAgICAgZ290byBzdG9wYnNzOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChwSG9zdGFwZEFkYXB0ZXItPmRldmljZV9tb2RlID09IFdMQU5fSEREX1AyUF9HTykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmICgoY2ZnX3BhcmFtLT5keW5TcGxpdHNjYW4pICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCFwSGRkQ3R4LT5pc3NwbGl0c2Nhbl9lbmFibGVkKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+aXNzcGxpdHNjYW5fZW5hYmxlZCA9IFRSVUU7CisgICAgICAgICAgICAgICAgICAgICAgICBzbWVfZW5hYmxlX2Rpc2FibGVfc3BsaXRfc2NhbigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9IRERfR0VUX0hBTF9DVFgocEhvc3RhcGRBZGFwdGVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2ZnX3BhcmFtLT5uTnVtU3RhQ2hhbkNvbWJpbmVkQ29uYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2ZnX3BhcmFtLT5uTnVtUDJQQ2hhbkNvbWJpbmVkQ29uYyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBwSGRkQXBDdHgtPnVCQ1N0YUlkID0gcFNhcEV2ZW50LT5zYXBldnQuc2FwU3RhcnRCc3NDb21wbGV0ZUV2ZW50LnN0YUlkOworICAgICAgICAgICAgICAgIC8vQEBAIG5lZWQgd2VwIGxvZ2ljIGhlcmUgdG8gc2V0IHByaXZhY3kgYml0CisgICAgICAgICAgICAgICAgdm9zX3N0YXR1cyA9IGhkZF9zb2Z0YXBfUmVnaXN0ZXJfQkNfU1RBKHBIb3N0YXBkQWRhcHRlciwgcEhkZEFwQ3R4LT51UHJpdmFjeSk7CisgICAgICAgICAgICAgICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zX3N0YXR1cykpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HVywgRkwoIkZhaWxlZCB0byByZWdpc3RlciBCQyBTVEEgJWQiKSwgdm9zX3N0YXR1cyk7CisgICAgICAgICAgICAgICAgICAgIGhkZF9zdG9wX2Jzc19saW5rKHBIb3N0YXBkQWRhcHRlciwgdXNyRGF0YUZvckNhbGxiYWNrKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICgwICE9IChXTEFOX0hERF9HRVRfQ1RYKHBIb3N0YXBkQWRhcHRlcikpLT5jZmdfaW5pLT5uQVBBdXRvU2h1dE9mZikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBBUCBJbmFjdGl2aXR5IHRpbWVyIGluaXQgYW5kIHN0YXJ0CisgICAgICAgICAgICAgICAgdm9zX3N0YXR1cyA9IHZvc190aW1lcl9pbml0KCAmcEhkZEFwQ3R4LT5oZGRfYXBfaW5hY3Rpdml0eV90aW1lciwgVk9TX1RJTUVSX1RZUEVfU1csIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZGRfaG9zdGFwZF9pbmFjdGl2aXR5X3RpbWVyX2NiLCAodl9QVk9JRF90KWRldiApOworICAgICAgICAgICAgICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc19zdGF0dXMpKQorICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCBGTCgiRmFpbGVkIHRvIGluaXQgQVAgaW5hY3Rpdml0eSB0aW1lciIpKTsKKworICAgICAgICAgICAgICAgIHZvc19zdGF0dXMgPSB2b3N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RleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBIZGRBcEN0eC0+Z3JvdXBLZXkgKSApCisgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFdMQU5TQVBfU2V0S2V5U3RhIGZhaWxlZCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICBwSGRkQXBDdHgtPmdyb3VwS2V5LmtleUxlbmd0aCA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmICggcEhkZEFwQ3R4LT53ZXBLZXlbMF0ua2V5TGVuZ3RoICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpbnQgaT0wOworICAgICAgICAgICAgICAgIGZvciAoIGkgPSAwOyBpIDwgQ1NSX01BWF9OVU1fS0VZOyBpKysgKSAKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmKCBWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gIFdMQU5TQVBfU2V0S2V5U3RhKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV0xBTl9IRERfR0VUX0NUWChwSG9zdGFwZEFkYXB0ZXIpKS0+cHZvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwSGRkQXBDdHgtPndlcEtleVtpXSApICkKKyAgICAgICAgICAgICAgICAgICAgeyAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogV0xBTlNBUF9TZXRLZXlTdGEgZmFpbGVkIGlkeCAlZCIsIF9fZnVu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c0NvbXBsZXRlRXZlbnQuc3RhdHVzID8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImVTQVBfU1RBVFVTX0ZBSUxVUkUiIDogImVTQVBfU1RBVFVTX1NVQ0NFU1MiKTsKKworICAgICAgICAgICAgLy9GcmVlIHVwIENoYW5uZWwgTGlzdCBpbmNhc2UgaWYgaXQgaXMgc2V0CisgICAgICAgICAgICBzYXBDbGVhbnVwQ2hhbm5lbExpc3QoKTsKKworICAgICAgICAgICAgcEhkZEFwQ3R4LT5vcGVyYXRpbmdDaGFubmVsID0gMDsgLy9JbnZhbGlkYXRlIHRoZSBjaGFubmVsIGluZm8uCisKKyAgICAgICAgICAgIGlmIChwSG9zdGFwZEFkYXB0ZXItPmRldmljZV9tb2RlID09IFdMQU5fSEREX1AyUF9HTykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coTE9HMSwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIlAyUCBHbyBpcyBnZXR0aW5nIHJlbW92ZWQgYW5kIHdlIGFyZSB0cnlpbmcgdG8gcmUtZW5hYmxlIFRETFMiKSk7CisgICAgICAgICAgICAgICAgd2xhbl9oZGRfdGRsc19yZWVuYWJsZShwSGRkQ3R4KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZ290byBzdG9wYnNzOworICAgICAgICBjYXNlIGVTQVBfU1RBX1NFVF9LRVlfRVZFTlQ6CisgICAgICAgICAgICAvL1RPRE86IGZvcndhcmQgdGhlIG1lc3NhZ2UgdG8gaG9zdGFwZCBvbmNlIGltcGxlbWVudHRhdGlvbiBpcyBkb25lIGZvciBub3cganVzdCBwcmludAorICAgICAgICAgICAgaGRkTG9nKExPRzEsIEZMKCJTRVQgS2V5OiBjb25maWd1cmVkIHN0YXR1cyA9ICVzIikscFNhcEV2ZW50LT5zYXBldnQuc2FwU3RhdGlvblNldEtleUNvbXBsZXRlRXZlbnQuc3RhdHVzID8KKyAgICAgICAgICAgICAgICAgIC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X0dST1VQOworICAgICAgICAgICAgZWxzZSAKKyAgICAgICAgICAgICBtc2cuZmxhZ3MgPSBJV19NSUNGQUlMVVJFX1BBSVJXSVNFOworICAgICAgICAgICAgbWVtc2V0KCZ3cnF1LCAwLCBzaXplb2Yod3JxdSkpOworICAgICAgICAgICAgd3JxdS5kYXRhLmxlbmd0aCA9IHNpemVvZihtc2cpOworICAgICAgICAgICAgd2VfZXZlbnQgPSBJV0VWTUlDSEFFTE1JQ0ZBSUxVUkU7CisgICAgICAgICAgICB3ZV9jdXN0b21fZXZlbnRfZ2VuZXJpYyA9ICh2X0JZVEVfdCAqKSZtc2c7CisgICAgICAgIH0KKyAgICAgIC8qIGluZm9ybSBtaWMgZmFpbHVyZSB0byBubDgwMjExICovCisgICAgICAgIGNmZzgwMjExX21pY2hhZWxfbWljX2ZhaWx1cmUoZGV2LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2FwRXZlbnQtPnNhcGV2dC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYXBTdGF0aW9uTUlDRmFpbHVyZUV2ZW50LnN0YU1hYy5ieXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHBTYXBFdmVudC0+c2FwZXZ0LnNhcFN0YXRpb25NSUNGYWlsdXJlRXZlbnQubXVsdGljYXN0ID09IGVTQVBfVFJVRSkgPyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTkw4MDIxMV9LRVlUWVBFX0dST1VQIDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTkw4MDIxMV9LRVlUWVBFX1BBSVJXSVNFKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2FwRXZlbnQtPnNhcGV2dC5zYXBTdGF0aW9uTUlDRmFpbHVyZUV2ZW50LmtleUlkLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB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1JZUFRfVFlQRV9XRVAxMDRfU1RBVElDS0VZID09IHBIZGRBcEN0eC0+dWNFbmNyeXB0VHlwZSApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBiQXV0aFJlcXVpcmVkID0gRkFMU0U7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChiQXV0aFJlcXVpcmVkIHx8IGJXUFNTdGF0ZSA9PSBlQU5JX0JPT0xFQU5fVFJVRSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX3N0YXR1cyA9IGhkZF9zb2Z0YXBfUmVnaXN0ZXJTVEEoIHBIb3N0YXBkQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRSVUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQXBDdHgtPnVQcml2YWN5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNhcEV2ZW50LT5zYXBldnQuc2FwU3RhdGlvbkFzc29jUmVhc3NvY0NvbXBsZXRlRXZlbnQuc3RhSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2X01BQ0FERFJfdCAqKXdycXUuYWRkci5zYV9kYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNhcEV2ZW50LT5zYXBldnQuc2FwU3RhdGlvbkFzc29jUmVhc3NvY0NvbXBsZXRlRXZlbnQud21tRW5hYmxlZCk7CisKKyAgICAgICAgICAgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3Nfc3RhdHVzKSkKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKExPR1csIEZMKCJGYWlsZWQgdG8gcmVnaXN0ZXIgU1RBICVkICJNQUNfQUREUkVTU19TVFIiIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX3N0YXR1cywgTUFDX0FERFJfQVJSQVkod3JxdS5hZGRyLnNhX2RhdGEpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3Nfc3RhdHVzID0gaGRkX3NvZnRhcF9SZWdpc3RlclNUQSggcEhvc3RhcGRBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkFMU0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQXBDdHgtPnVQcml2YWN5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNhcEV2ZW50LT5zYXBldnQuc2FwU3RhdGlvbkFzc29jUmVhc3NvY0NvbXBsZXRlRXZlbnQuc3RhSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2X01BQ0FERFJfdCAqKXdycXUuYWRkci5zYV9kYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNhcEV2ZW50LT5zYXBldnQuc2FwU3RhdGlvbkFzc29jUmVhc3NvY0NvbXBsZXRlRXZlbnQud21tRW5hYmxlZCk7CisgICAgICAgICAgICAgICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zX3N0YXR1cykpCisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0dXLCBGTCgiRmFpbGVkIHRvIHJlZ2lzdGVyIFNUQSAlZCAiTUFDX0FERFJFU1NfU1RSIiIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19zdGF0dXMsIE1BQ19BRERSX0FSUkFZKHdycXUuYWRkci5zYV9kYXRhKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIFN0b3AgQVAgaW5hY3Rpdml0eSB0aW1lcgorICAgICAgICAgICAgaWYgKHBIZGRBcEN0eC0+aGRkX2FwX2luYWN0aXZpdHlfdGltZXIuc3RhdGUgPT0gVk9TX1RJTUVSX1NUQVRFX1JVTk5JTkcpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX3N0YXR1cyA9IHZvc190aW1lcl9zdG9wKCZwSGRkQXBDdHgtPmhkZF9hcF9pbmFjdGl2aXR5X3RpbWVyKTsKKyAgICAgICAgICAgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3Nfc3RhdHVzKSkKKyAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgRkwoIkZhaWxlZCB0byBzdGFydCBBUCBpbmFjdGl2aXR5IHRpbWVyIikpOworICAgICAgICAgICAgfQorI2lmZGVmIFdMQU5fT1BFTl9TT1VSQ0UKKyAgICAgICAgICAgIGlmICh3YWtlX2xvY2tfYWN0aXZlKCZwSGRkQ3R4LT5zYXBfd2FrZV9sb2NrKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHZvc193YWtlX2xvY2tfcmVsZWFzZSgmcEhkZEN0eC0+c2FwX3dha2VfbG9jaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0lGSV9QT1dFUl9FVkVOVF9XQUtFTE9DS19TQVApOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdm9zX3dha2VfbG9ja190aW1lb3V0X3JlbGVhc2UoJnBIZGRDdHgtPnNhcF93YWtlX2xvY2ssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIRERfU0FQX1dBS0VfTE9DS19EVVJBVElPTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdJRklfUE9XRVJfRVZFTlRfV0FLRUxPQ0tfU0FQKTsKKworI2VuZGlmCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigyLDYsMzgpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0cnVjdCBzdGF0aW9uX2luZm8gc3RhSW5mbzsKKyAgICAgICAgICAgICAgICB2X1UxNl90IGllc0xlbiA9ICBwU2FwRXZlbnQtPnNhcGV2dC5zYXBTdGF0aW9uQXNzb2NSZWFzc29jQ29tcGxldGVFdmVudC5pZXNMZW47CisKKyAgICAgICAgICAgICAgICBtZW1zZXQoJnN0YUluZm8sIDAsIHNpemVvZihzdGFJbmZvKSk7CisgICAgICAgICAgICAgICAgaWYgKGllc0xlbiA8PSBNQVhfQVNTT0NfSU5EX0lFX0xFTiApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzdGFJbmZvLmFzc29jX3JlcV9pZXMgPQorICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnN0IHU4ICopJnBTYXBFdmVudC0+c2FwZXZ0LnNhcFN0YXRpb25Bc3NvY1JlYXNzb2NDb21wbGV0ZUV2ZW50Lmllc1swXTsKKyAgICAgICAgICAgICAgICAgICAgc3RhSW5mby5hc3NvY19yZXFfaWVzX2xlbiA9IGllc0xlbjsKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMCwzMSkpCisgICAgICAgICAgICAgICAgICAgIHN0YUluZm8uZmlsbGVkIHw9IFNUQVRJT05fSU5GT19BU1NPQ19SRVFfSUVTOworI2VuZGlmCisgICAgICAgICAgICAgICAgICAgIGNmZzgwMjExX25ld19zdGEoZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnN0IHU4ICopJnBTYXBFdmVudC0+c2FwZXZ0LnNhcFN0YXRpb25Bc3NvY1JlYXNzb2NDb21wbGV0ZUV2ZW50LnN0YU1hYy5ieXRlc1swXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZzdGFJbmZvLCBHRlBfS0VSTkVMKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsIEZMKCIgQXNzb2MgSWUgbGVuZ3RoIGlzIHRvbyBsb25nIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgICAgIHBTY2FuSW5mbyA9ICAmcEhkZEN0eC0+c2Nhbl9pbmZvOworICAgICAgICAgICAgLy8gTGV0cyBkbyBhYm9ydCBzY2FuIHRvIGVuc3VyZSBzbW9vdGggYXV0aGVudGljYXRpb24gZm9yIGNsaWVudAorICAgICAgICAgICAgaWYgKChwU2NhbkluZm8gIT0gTlVMTCkgJiYgcFNjYW5JbmZvLT5tU2NhblBlbmRpbmcpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkX2Fib3J0X21hY19zY2FuKHBIZGRDdHgsIHBTY2FuSW5mby0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1NDQU5fQUJPUlRfREVGQVVMVCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVTQVBfU1RBX0RJU0FTU09DX0VWRU5UOgorICAgICAgICAgICAgbWVtY3B5KHdycXUuYWRkci5zYV9kYXRhLCAmcFNhcEV2ZW50LT5zYXBldnQuc2FwU3RhdGlvbkRpc2Fzc29jQ29tcGxldGVFdmVudC5zdGFNYWMsCisgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHZfTUFDQUREUl90KSk7CisgICAgICAgICAgICBoZGRMb2coTE9HMSwgIiBkaXNhc3NvY2lhdGVkICJNQUNfQUREUkVTU19TVFIsIE1BQ19BRERSX0FSUkFZKHdycXUuYWRkci5zYV9kYXRhKSk7CisgICAgICAgICAgICBpZiAocFNhcEV2ZW50LT5zYXBldnQuc2FwU3RhdGlvbkRpc2Fzc29jQ29tcGxldGVFdmVudC5yZWFzb24gPT0gZVNBUF9VU1JfSU5JVEFURURfRElTQVNTT0MpCisgICAgICAgICAgICAgICAgaGRkTG9nKExPRzEsIiBVc2VyIGluaXRpYXRlZCBkaXNhc3NvY2lhdGlvbiIpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGhkZExvZyhMT0cxLCIgTUFDIGluaXRpYXRlZCBkaXNhc3NvY2lhdGlvbiIpOworICAgICAgICAgICAgd2VfZXZlbnQgPSBJV0VWRVhQSVJFRDsKKyAgICAgICAgICAgIHZvc19zdGF0dXMgPSBoZGRfc29mdGFwX0dldFN0YUlkKHBIb3N0YXBkQWRhcHRlciwgJnBTYXBFdmVudC0+c2FwZXZ0LnNhcFN0YXRpb25EaXNhc3NvY0NvbXBsZXRlRXZlbnQuc3RhTWFjLCAmc3RhSWQpOworICAgICAgICAgICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zX3N0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJFUlJPUjogSEREIEZhaWxlZCB0byBmaW5kIHN0YSBpZCEhIikpOworICAgICAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGhkZF9zb2Z0YXBfRGVyZWdpc3RlclNUQShwSG9zdGFwZEFkYXB0ZXIsIHN0YUlkKTsKKworICAgICAgICAgICAgaWYgKDAgIT0gKFdMQU5fSEREX0dFVF9DVFgocEhvc3RhcGRBZGFwdGVyKSktPmNmZ19pbmktPm5BUEF1dG9TaHV0T2ZmKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNwaW5fbG9ja19iaCggJnBTYXBDdHgtPnN0YUluZm9fbG9jayApOworICAgICAgICAgICAgICAgIC8vIFN0YXJ0IEFQIGluYWN0aXZpdHkgdGltZXIgaWYgbm8gc3RhdGlvbnMgYXNzb2NpYXRlZCB3aXRoIGl0CisgICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IFdMQU5fTUFYX1NUQV9DT1VOVDsgaSsrKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHBTYXBDdHgtPmFTdGFJbmZvW2ldLmlzVXNlZCAmJiBpICE9IChXTEFOX0hERF9HRVRfQVBfQ1RYX1BUUihwSG9zdGFwZEFkYXB0ZXIpKS0+dUJDU3RhSWQpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJBcEFjdGl2ZSA9IFRSVUU7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzcGluX3VubG9ja19iaCggJnBTYXBDdHgtPnN0YUluZm9fbG9jayApOworCisgICAgICAgICAgICAgICAgaWYgKGJBcEFjdGl2ZSA9PSBGQUxTRSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChwSGRkQXBDdHgtPmhkZF9hcF9pbmFjdGl2aXR5X3RpbWVyLnN0YXRlID09IFZPU19USU1FUl9TVEFURV9TVE9QUEVEKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB2b3Nfc3RhdHVzID0gdm9zX3RpbWVyX3N0YXJ0KCZwSGRkQXBDdHgtPmhkZF9hcF9pbmFjdGl2aXR5X3RpbWVyLCAoV0xBTl9IRERfR0VUX0NUWChwSG9zdGFwZEFkYXB0ZXIpKS0+Y2ZnX2luaS0+bkFQQXV0b1NodXRPZmYgKiAxMDAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc19zdGF0dXMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCBGTCgiRmFpbGVkIHRvIGluaXQgQVAgaW5hY3Rpdml0eSB0aW1lciIpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICBWT1NfQVNTRVJUKHZvc190aW1lcl9nZXRDdXJyZW50U3RhdGUoJnBIZGRBcEN0eC0+aGRkX2FwX2luYWN0aXZpdHlfdGltZXIpID09IFZPU19USU1FUl9TVEFURV9TVE9QUEVEKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigyLDYsMzgpKQorICAgICAgICAgICAgY2ZnODAyMTFfZGVsX3N0YShkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnN0IHU4ICopJnBTYXBFdmVudC0+c2FwZXZ0LnNhcFN0YXRpb25EaXNhc3NvY0NvbXBsZXRlRXZlbnQuc3RhTWFjLmJ5dGVzWzBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdGUF9LRVJORUwpOworI2VuZGlmCisgICAgICAgICAgICAvL1VwZGF0ZSB0aGUgYmVhY29uIEludGVydmFsIGlmIGl0IGlzIFAyUCBHTworICAgICAgICAgICAgdm9zX3N0YXR1cyA9IGhkZF9jaGFuZ2VfbWNjX2dvX2JlYWNvbl9pbnRlcnZhbChwSG9zdGFwZEFkYXB0ZXIpOworICAgICAgICAgICAgaWYgKFZPU19TVEFUVVNfU1VDQ0VTUyAhPSB2b3Nfc3RhdHVzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCAiJXM6IGZhaWxlZCB0byB1cGRhdGUgQmVhY29uIGludGVydmFsICVkIiwKKyAgICA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HN0YUlkPSVkLCBzdGFNYWM9Ik1BQ19BRERSRVNTX1NUUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIGkrMSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBBc3NvY1N0YXNBcnJheS0+YXNzb2NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBBc3NvY1N0YXNBcnJheS0+c3RhSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwQXNzb2NTdGFzQXJyYXktPnN0YU1hYy5ieXRlcykpOworICAgICAgICAgICAgICAgICAgICAgICAgcEFzc29jU3Rhc0FycmF5Kys7ICAgICAgICAgICAgIAorICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBTYXBFdmVudC0+c2FwZXZ0LnNhcEFzc29jU3RhTGlzdEV2ZW50LnBBc3NvY1N0YXMpOy8vIFJlbGVhc2UgY2FsbGVyIGFsbG9jYXRlZCBtZW1vcnkgaGVyZQorICAgICAgICAgICAgcFNhcEV2ZW50LT5zYXBldnQuc2FwQXNzb2NTdGFMaXN0RXZlbnQucEFzc29jU3RhcyA9IE5VTEw7CisgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgICBjYXNlIGVTQVBfUkVNQUlOX0NIQU5fUkVBRFk6CisgICAgICAgICAgIGhkZF9yZW1haW5DaGFuUmVhZHlIYW5kbGVyKCBwSG9zdGFwZEFkYXB0ZXIgKTsKKyAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgY2FzZSBlU0FQX1NFTkRfQUNUSU9OX0NORjoKKyAgICAgICAgICAgaGRkX3NlbmRBY3Rpb25DbmYoIHBIb3N0YXBkQWRhcHRlciwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIGVTQVBfU1RBVFVTX1NVQ0NFU1MgPT0gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTYXBFdmVudC0+c2FwZXZ0LnNhcEFjdGlvbkNuZi5hY3Rpb25TZW5kU3VjY2VzcyApID8gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRSVUUgOiBGQUxTRSApOworICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgICBjYXNlIGVTQVBfVU5LTk9XTl9TVEFfSk9JTjoKKyAgICAgICAgICAgIHNucHJpbnRmKHVua25vd25TVEFFdmVudCwgSVdfQ1VTVE9NX01BWCwgIkpPSU5fVU5LTk9XTl9TVEEtJTAyeDolMDJ4OiUwMng6JTAyeDolMDJ4OiUwMngiLAorICAgICAgICAgICAgICAgIHBTYXBFdmVudC0+c2FwZXZ0LnNhcFVua25vd25TVEFKb2luLm1hY2FkZHIuYnl0ZXNbMF0sCisgICAgICAgICAgICAgICAgcFNhcEV2ZW50LT5zYXBldnQuc2FwVW5rbm93blNUQUpvaW4ubWFjYWRkci5ieXRlc1sxXSwKKyAgICAgICAgICAgICAgICBwU2FwRXZlbnQtPnNhcGV2dC5zYXBVbmtub3duU1RBSm9pbi5tYWNhZGRyLmJ5dGVzWzJdLAorICAgICAgICAgICAgICAgIHBTYXBFdmVudC0+c2FwZXZ0LnNhcFVua25vd25TVEFKb2luLm1hY2FkZHIuYnl0ZXNbM10sCisgICAgICAgICAgICAgICAgcFNhcEV2ZW50LT5zYXBldnQuc2FwVW5rbm93blNUQUpvaW4ubWFjYWRkci5ieXRlc1s0XSwKKyAgICAgICAgICAgICAgICBwU2FwRXZlbnQtPnNhcGV2dC5zYXBVbmtub3duU1RBSm9pbi5tYWNhZGRyLmJ5dGVzWzVdKTsKKyAgICAgICAgICAgIHdlX2V2ZW50ID0gSVdFVkNVU1RPTTsgLyogRGlzY292ZXJlZCBhIG5ldyBub2RlIChBUCBtb2RlKS4gKi8KKyAgICAgICAgICAgIHdycXUuZGF0YS5wb2ludGVyID0gdW5rbm93blNUQUV2ZW50OworICAgICAgICAgICAgd3JxdS5kYXRhLmxlbmd0aCA9IHN0cmxlbih1bmtub3duU1RBRXZlbnQpOworICAgICAgICAgICAgd2VfY3VzdG9tX2V2ZW50X2dlbmVyaWMgPSAodl9CWVRFX3QgKil1bmtub3duU1RBRXZlbnQ7CisgICAgICAgICAgICBoZGRMb2coTE9HRSwiJXMiLCB1bmtub3duU1RBRXZlbnQpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlU0FQX01BWF9BU1NPQ19FWENFRURFRDoKKyAgICAgICAgICAgIHNucHJpbnRmKG1heEFzc29jRXhjZWVkZWRFdmVudCwgSVdfQ1VTVE9NX01BWCwgIlBlZXIgJTAyeDolMDJ4OiUwMng6JTAyeDolMDJ4OiUwMnggZGVuaWVkIgorICAgICAgICAgICAgICAgICAgICAiIGFzc29jIGR1ZSB0byBNYXhpbXVtIE1vYmlsZSBIb3RzcG90IGNvbm5lY3Rpb25zIHJlYWNoZWQuIFBsZWFzZSBkaXNjb25uZWN0IgorICAgICAgICAgICAgICAgICAgICAiIG9uZSBvciBtb3JlIGRldmljZXMgdG8gZW5hYmxlIHRoZSBuZXcgZGV2aWNlIGNvbm5lY3Rpb24iLAorICAgICAgICAgICAgICAgICAgICBwU2FwRXZlbnQtPnNhcGV2dC5zYXBNYXhBc3NvY0V4Y2VlZGVkLm1hY2FkZHIuYnl0ZXNbMF0sCisgICAgICAgICAgICAgICAgICAgIHBTYXBFdmVudC0+c2FwZXZ0LnNhcE1heEFzc29jRXhjZWVkZWQubWFjYWRkci5ieXRlc1sxXSwKKyAgICAgICAgICAgICAgICAgICAgcFNhcEV2ZW50LT5zYXBldnQuc2FwTWF4QXNzb2NFeGNlZWRlZC5tYWNhZGRyLmJ5dGVzWzJdLAorICAgICAgICAgICAgICAgICAgICBwU2FwRXZlbnQtPnNhcGV2dC5zYXBNYXhBc3NvY0V4Y2VlZGVkLm1hY2FkZHIuYnl0ZXNbM10sCisgICAgICAgICAgICAgICA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gICAgICAgICAgICB2b3Nfc3RhdHVzID0gaGRkX3N0b3BfYnNzX2xpbmsocEhvc3RhcGRBZGFwdGVyLCB1c3JEYXRhRm9yQ2FsbGJhY2spOworICAgICAgICAgICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zX3N0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKExPR1csIEZMKCJoZGRfc3RvcF9ic3NfbGluayBmYWlsZWQgJWQiKSwgdm9zX3N0YXR1cyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBoZGRMb2coTE9HMSwiU0FQIG1lc3NhZ2UgaXMgbm90IGhhbmRsZWQiKTsKKyAgICAgICAgICAgIGdvdG8gc3RvcGJzczsKKyAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICAgfQorICAgIHdpcmVsZXNzX3NlbmRfZXZlbnQoZGV2LCB3ZV9ldmVudCwgJndycXUsIChjaGFyICopd2VfY3VzdG9tX2V2ZW50X2dlbmVyaWMpOworICAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7CisKK3N0b3Bic3MgOgorICAgIHsKKyAgICAgICAgdl9CWVRFX3Qgd2VfY3VzdG9tX2V2ZW50WzY0XTsKKyAgICAgICAgY2hhciAqc3RvcEJzc0V2ZW50ID0gIlNUT1AtQlNTLnJlc3BvbnNlIjsvLzE3CisgICAgICAgIGludCBldmVudF9sZW4gPSBzdHJsZW4oc3RvcEJzc0V2ZW50KTsKKworICAgICAgICBoZGRMb2coTE9HMSwgRkwoIkJTUyBzdG9wIHN0YXR1cyA9ICVzIiksCisgICAgICAgICAgICAgICBwU2FwRXZlbnQtPnNhcGV2dC5zYXBTdG9wQnNzQ29tcGxldGVFdmVudC5zdGF0dXMgPworICAgICAgICAgICAgICAgICAgICAgICAg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V1BBSUU7IAorIAorICAgIHRBTklfVTggKnBSc25JZTsgCisgICAgdEFOSV9VMTYgUlNOSWVMZW47CisgICAgCisgICAgaWYgKE5VTEwgPT0gaGFsSGFuZGxlKQorICAgIHsKKyAgICAgICAgaGRkTG9nKExPR0UsIEZMKCJFcnJvciBoYUhhbmRsZSByZXR1cm5lZCBOVUxMIikpOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgCisgICAgLy8gVmFsaWRpdHkgY2hlY2tzCisgICAgaWYgKChnZW5faWVfbGVuIDwgVk9TX01JTihET1QxMUZfSUVfUlNOX01JTl9MRU4sIERPVDExRl9JRV9XUEFfTUlOX0xFTikpIHx8ICAKKyAgICAgICAgKGdlbl9pZV9sZW4gPiBWT1NfTUFYKERPVDExRl9JRV9SU05fTUFYX0xFTiwgRE9UMTFGX0lFX1dQQV9NQVhfTEVOKSkgKSAKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgLy8gVHlwZSBjaGVjaworICAgIGlmICggZ2VuX2llWzBdID09ICBET1QxMUZfRUlEX1JTTikgCisgICAgeyAgICAgICAgIAorICAgICAgICAvLyBWYWxpZGl0eSBjaGVja3MKKyAgICAgICAgaWYgKChnZW5faWVfbGVuIDwgRE9UMTFGX0lFX1JTTl9NSU5fTEVOICkgfHwgIAorICAgICAgICAgICAgKGdlbl9pZV9sZW4gPiBET1QxMUZfSUVfUlNOX01BWF9MRU4pICkKKyAgICAgICAgeworICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgICAgICB9CisgICAgICAgIC8vIFNraXAgcGFzdCB0aGUgRUlEIGJ5dGUgYW5kIGxlbmd0aCBieXRlICAKKyAgICAgICAgcFJzbkllID0gZ2VuX2llICsgMjsgCisgICAgICAgIFJTTkllTGVuID0gZ2VuX2llX2xlbiAtIDI7IAorICAgICAgICAvLyBVbnBhY2sgdGhlIFJTTiBJRQorICAgICAgICBtZW1zZXQoJmRvdDExUlNOSUUsIDAsIHNpemVvZih0RG90MTFmSUVSU04pKTsKKyAgICAgICAgZG90MTFmVW5wYWNrSWVSU04oKHRwQW5pU2lyR2xvYmFsKSBoYWxIYW5kbGUsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSc25JZSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUlNOSWVMZW4sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICZkb3QxMVJTTklFKTsKKyAgICAgICAgLy8gQ29weSBvdXQgdGhlIGVuY3J5cHRpb24gYW5kIGF1dGhlbnRpY2F0aW9uIHR5cGVzIAorICAgICAgICBoZGRMb2coTE9HMSwgRkwoIiVzOiBwYWlyd2lzZSBjaXBoZXIgc3VpdGUgY291bnQ6ICVkIiksCisgICAgICAgICAgICAgICAgX19mdW5jX18sIGRvdDExUlNOSUUucHdpc2VfY2lwaGVyX3N1aXRlX2NvdW50ICk7CisgICAgICAgIGhkZExvZyhMT0cxLCBGTCgiJXM6IGF1dGhlbnRpY2F0aW9uIHN1aXRlIGNvdW50OiAlZCIpLAorICAgICAgICAgICAgICAgIF9fZnVuY19fLCBkb3QxMVJTTklFLmFrbV9zdWl0ZV9jb3VudCk7CisgICAgICAgIC8qSGVyZSB3ZSBoYXZlIGZvbGxvd2VkIHRoZSBhcHBsZSBiYXNlIGNvZGUsIAorICAgICAgICAgIGJ1dCBwcm9iYWJseSBJIHN1c3BlY3Qgd2UgY2FuIGRvIHNvbWV0aGluZyBkaWZmZXJlbnQqLworICAgICAgICAvL2RvdDExUlNOSUUuYWttX3N1aXRlX2NvdW50CisgICAgICAgIC8vIEp1c3QgdHJhbnNsYXRlIHRoZSBGSVJTVCBvbmUgCisgICAgICAgICpwQXV0aFR5cGUgPSAgaGRkX1RyYW5zbGF0ZVJTTlRvQ3NyQXV0aFR5cGUoZG90MTFSU05JRS5ha21fc3VpdGVzWzBdKTsgCisgICAgICAgIC8vZG90MTFSU05JRS5wd2lzZV9jaXBoZXJfc3VpdGVf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hlIEVJRCBieXRlIGFuZCBsZW5ndGggYnl0ZSAtIGFuZCBmb3VyIGJ5dGUgV2lGaSBPVUkgIAorICAgICAgICBwUnNuSWUgPSBnZW5faWUgKyAyICsgNDsgCisgICAgICAgIFJTTkllTGVuID0gZ2VuX2llX2xlbiAtICgyICsgNCk7IAorICAgICAgICAvLyBVbnBhY2sgdGhlIFdQQSBJRQorICAgICAgICBtZW1zZXQoJmRvdDExV1BBSUUsIDAsIHNpemVvZih0RG90MTFmSUVXUEEpKTsKKyAgICAgICAgZG90MTFmVW5wYWNrSWVXUEEoKHRwQW5pU2lyR2xvYmFsKSBoYWxIYW5kbGUsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSc25JZSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUlNOSWVMZW4sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICZkb3QxMVdQQUlFKTsKKyAgICAgICAgLy8gQ29weSBvdXQgdGhlIGVuY3J5cHRpb24gYW5kIGF1dGhlbnRpY2F0aW9uIHR5cGVzIAorICAgICAgICBoZGRMb2coTE9HMSwgRkwoIiVzOiBXUEEgdW5pY2FzdCBjaXBoZXIgc3VpdGUgY291bnQ6ICVkIiksCisgICAgICAgICAgICAgICAgX19mdW5jX18sIGRvdDExV1BBSUUudW5pY2FzdF9jaXBoZXJfY291bnQgKTsKKyAgICAgICAgaGRkTG9nKExPRzEsIEZMKCIlczogV1BBIGF1dGhlbnRpY2F0aW9uIHN1aXRlIGNvdW50OiAlZCIpLAorICAgICAgICAgICAgICAgIF9fZnVuY19fLCBkb3QxMVdQQUlFLmF1dGhfc3VpdGVfY291bnQpOworICAgICAgICAvL2RvdDExV1BBSUUuYXV0aF9zdWl0ZV9jb3VudAorICAgICAgICAvLyBKdXN0IHRyYW5zbGF0ZSB0aGUgRklSU1Qgb25lIAorICAgICAgICAqcEF1dGhUeXBlID0gIGhkZF9UcmFuc2xhdGVXUEFUb0NzckF1dGhUeXBlKGRvdDExV1BBS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WVuY3kgd2l0aCBvcmRlciBvZiBrSHoKKworICBccmV0dXJuIC0gY29ycmVzcG9uZGluZyBjaGFubmVsIG51bWJlci4KKyAgICAgICAgICAgIGluY2Fubm90IGZpbmQgY29ycmVjdCBjaGFubmVsIG51bWJlciwgcmV0dXJuIDAKKworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCit2X1UxNl90IGhkZF9ob3N0YXBkX2ZyZXFfdG9fY2huCisoCisgICB2X1UxNl90ICAgZnJlcQorKQoreworICAgaW50ICAgbG9vcDsKKworICAgZm9yIChsb29wID0gMDsgbG9vcCA8IE5VTV8yME1IWl9SRl9DSEFOTkVMUzsgbG9vcCsrKQorICAgeworICAgICAgaWYgKHJmQ2hhbm5lbHNbbG9vcF0udGFyZ2V0RnJlcSA9PSBmcmVxKQorICAgICAgeworICAgICAgICAgcmV0dXJuIHJmQ2hhbm5lbHNbbG9vcF0uY2hhbm5lbE51bTsKKyAgICAgIH0KKyAgIH0KKworICAgcmV0dXJuICgwKTsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBzYXBVcGRhdGVVbnNhZmVDaGFubmVsTGlzdAorCisgIERFU0NSSVBUSU9OCisgICAgRnVuY3Rpb24gIFVuZGF0ZSB1bnNhZmUgY2hhbm5lbCBsaXN0IHRhYmxlCisKKyAgREVQRU5ERU5DSUVTCisgICAgTkEuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICBwU2FwQ3R4IDogU0FQIGNvbnRleHQgcG9pbnRlciwgaW5jbHVkZSB1bnNhZmUgY2hhbm5lbCBsaXN0CisKKyAgUkVUVVJOIFZBTFVFCisgICAgTk9ORQorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIGhkZF9ob3N0YXBkX3VwZGF0ZV91bnNhZmVfY2hhbm5lbF9saXN0KGhkZF9jb250ZXh0X3QgKnBIZGRDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICB2X1UxNl90ICp1bnNhZmVDaGFubmVsTGlzdCwgdl9VMTZfdCB1bnNhZmVDaGFubmVsQ291bnQpCit7CisgICB2X1UxNl90ICAgaSwgajsKKworICAgdm9zX21lbV96ZXJvKCh2b2lkICopcEhkZEN0eC0+dW5zYWZlQ2hhbm5lbExpc3QsCisgICAgICAgICAgICAgICAgc2l6ZW9mKHBIZGRDdHgtPnVuc2FmZUNoYW5uZWxMaXN0KSk7CisgICBpZiAoMCA9PSB1bnNhZmVDaGFubmVsQ291bnQpCisgICB7CisgICAgICBwSGRkQ3R4LT51bnNhZmVDaGFubmVsQ291bnQgPSAwOworICAgfQorICAgZWxzZQorICAgeworICAgICAgaWYgKHVuc2FmZUNoYW5uZWxDb3VudCA+IE5VTV8yME1IWl9SRl9DSEFOTkVMUykKKyAgICAgIHsKKyAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgRkwoInVuc2FmZUNoYW5uZWxDb3VudCVoZCBncmVhdGVyIHRoYW4gJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHVuc2FmZUNoYW5uZWxDb3VudCwgTlVNXzIwTUhaX1JGX0NIQU5ORUxTKTsKKyAgICAgICAgICB1bnNhZmVDaGFubmVsQ291bnQgPSBOVU1fMjBNSFpfUkZfQ0hBTk5FTFM7CisgICAgICB9CisgICAgICB2b3NfbWVtX2NvcHkoKHZvaWQgKilwSGRkQ3R4LT51bnNhZmVDaGFubmVsTGlzdCwKKyAgICAgICAgICAgICAgICAgICB1bnNhZmVDaGFubmVsTGlzdCwKKyAgICAgICA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Ww7CisgICB2X1UxNl90ICAgICAgICAgICAgIGVuZENoYW5uZWw7CisgICB2X1UxNl90ICAgICAgICAgICAgIHVuc2FmZUNoYW5uZWxDb3VudCA9IDA7CisgICB2X1UxNl90ICAgICAgICAgICAgIHVuc2FmZUNoYW5uZWxMaXN0W05VTV8yME1IWl9SRl9DSEFOTkVMU107CisgICB2X0NPTlRFWFRfdCAgICAgICAgIHBWb3NDb250ZXh0OworICAgdEhkZEF2b2lkRnJlcUxpc3QgICBoZGRBdm9pZEZyZXFMaXN0OworICAgdEFOSV9VMzIgICAgICAgICAgICBpOworI2lmZGVmIFdMQU5fRkVBVFVSRV9BUF9IVDQwXzI0RworICAgcHRTYXBDb250ZXh0IHBTYXBDdHggPSBOVUxMOworICAgdEhhbEhhbmRsZSBoSGFsOworICAgdl9VOF90IGNiTW9kZTsKKyAgIFZPU19TVEFUVVMgIHZvc1N0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgIHZfVTMyX3QgZGVsYXk7CisjZW5kaWYKKworICAgLyogQmFzaWMgc2FuaXR5ICovCisgICBpZiAoKE5VTEwgPT0gcEFkYXB0ZXIpIHx8IChOVUxMID09IGluZFBhcmFtKSkKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlcyA6IEludmFsaWQgYXJndW1lbnRzIiwgX19mdW5jX18pOworICAgICAgcmV0dXJuOworICAgfQorCisgICBoZGRDdHh0ICAgICA9IChoZGRfY29udGV4dF90ICopcEFkYXB0ZXI7CisgICBjaEF2b2lkSW5kICA9ICh0U2lyQ2hBdm9pZEluZFR5cGUgKilpbmRQYXJhbTsKKyAgIHBWb3NDb250ZXh0ID0gaGRkQ3R4dC0+cHZvc0NvbnRleHQ7CisKKyAgIC8qIE1ha2UgdW5zYWZlIGNoYW5uZWwgbGlzdCAqLworICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAiJXMgOiBiYW5kIGNvdW50ICVkIiwKKyAgICAgICAgICAgICBfX2Z1bmNfXywgY2hBdm9pZEluZC0+YXZvaWRSYW5nZUNvdW50KTsKKyAgIHZvc19tZW1femVybygodm9pZCAqKXVuc2FmZUNoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgIE5VTV8yME1IWl9SRl9DSEFOTkVMUyAqIHNpemVvZih2X1UxNl90KSk7CisgICBmb3IgKHJhbmdlTG9vcCA9IDA7IHJhbmdlTG9vcCA8IGNoQXZvaWRJbmQtPmF2b2lkUmFuZ2VDb3VudDsgcmFuZ2VMb29wKyspCisgICB7CisgICAgICBzdGFydENoYW5uZWwgPSBoZGRfaG9zdGFwZF9mcmVxX3RvX2NobigKKyAgICAgICAgICAgICAgICAgICAgICBjaEF2b2lkSW5kLT5hdm9pZEZyZXFSYW5nZVtyYW5nZUxvb3BdLnN0YXJ0RnJlcSk7CisgICAgICBlbmRDaGFubmVsICAgPSBoZGRfaG9zdGFwZF9mcmVxX3RvX2NobigKKyAgICAgICAgICAgICAgICAgICAgICBjaEF2b2lkSW5kLT5hdm9pZEZyZXFSYW5nZVtyYW5nZUxvb3BdLmVuZEZyZXEpOworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAiJXMgOiBzdGFydCAlZCA6ICVkLCBlbmQgJWQgOiAlZCIsCisgICAgICAgICAgICAgICAgX19mdW5jX18sCisgICAgICAgICAgICAgICAgY2hBdm9pZEluZC0+YXZvaWRGcmVxUmFuZ2VbcmFuZ2VMb29wXS5zdGFydEZyZXEsCisgICAgICAgICAgICAgICAgc3RhcnRDaGFubmVsLAorICAgICAgICAgICAgICAgIGNoQXZvaWRJbmQtPmF2b2lkRnJlcVJhbmdlW3JhbmdlTG9vcF0uZW5kRnJlcSwKKyAgICAgICAgICAgICAgICBlbmRDaGFubmVsKTsKKyAgICAgIGZvciAoY2hhbm5lbExvb3AgPSBzdGFydENoYW5uZWw7CisgICAgICAgICAgIGNoYW5uZWxMb29wIDwgKGVuZENoYW5uZWwgKyAxKTsKKyAgICAgICAgICAgY2hhbm5lbExvb3ArKykKKyAgICAgIHsKKyAgICAgICAgIC8qIENoYW5uZWwgZHVwbGljYXRlIGNoZWNrIHJvdXRpbmUgKi8KKyAgICAgICAgIGZvciAoZHVwQ2hlY2sgPSAwOyBkdXBDaGVjayA8IHVuc2FmZUNoYW5uZWxDb3VudDsgZHVwQ2hlY2srKykKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGlmICh1bnNhZmVDaGFubmVsTGlzdFtkdXBDaGVja10gPT0gY2hhbm5lbExvb3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvKiBUaGlzIGNoYW5uZWwgaXMgZHVwbGljYXRlZCAqLworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAiJXMgOiBmb3VuZCBkdXBsaWNhdGVkIGNoYW5uZWwgJWQiLAorICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBjaGFubmVsTG9vcCk7CisgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgICAgIGlmIChkdXBDaGVjayA9PSB1bnNhZmVDaGFubmVsQ291bnQpCisgICAgICAgICB7CisgICAgICAgICAgICAgaW50IGlpOworICAgICAgICAgICAgIGZvcihpaT0wOyBpaTxOVU1fMjBNSFpfUkZfQ0hBTk5FTFM7IGlpKyspCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBpZiAoY2hhbm5lbExvb3AgPT0gc2FmZUNoYW5uZWxzW2lpXS5jaGFubmVsTnVtYmVyKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICB1bnNhZmVDaGFubmVsTGlzdFt1bnNhZmVDaGFubmVsQ291bnRdID0gY2hhbm5lbExvb3A7CisgICAgICAgICAgICAgICAgICAgICB1bnNhZmVDaGFubmVsQ291bnQrKzsKKyAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXMgOiB1bnNhZmUgY2hhbm5lbCAlZCwgY291bnQgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsTG9vcCwgdW5zYWZlQ2hhbm5lbENvdW50KTsKKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UKKyAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIERVUCwgZG8gbm90aGluZyAqLworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAiJXMgOiBkdXBsaWNhdGVkIGNoYW5uZWwgJWQiLAorICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBjaGFubmVsTG9vcCk7CisgICAgICAgICB9CisgICAgICB9CisgICB9CisgICAvKiBVcGRhdGUgdW5zYWZlIGNoYW5uZWwgY2FjaGUKKyAgICAqIFdDTiBQbGF0Zm9ybSBEcml2ZXIgY2FjaGUgKi8KKyAgIHdjbnNzX3NldF93bGFuX3Vuc2FmZV9jaGFubmVsKHVuc2FmZUNoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zYWZlQ2hhbm5lbENvdW50KTsKKworICAgLyogU3RvcmUgaW50byBsb2NhbCBjYWNoZQorICAgICogU3RhcnQgd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VUT19DSEFOTkVMX1NFTEVDVCA9PQorICAgICAgICAgICAgICAgICAgICAgcEhvc3RhcGRBZGFwdGVyLT5zZXNzaW9uQ3R4LmFwLnNhcENvbmZpZy5jaGFubmVsKQorICAgICAgICAgICAgICAgICYmIChXTEFOX0hERF9TT0ZUQVAgPT0gcEhvc3RhcGRBZGFwdGVyLT5kZXZpY2VfbW9kZSkpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIGN1cnJlbnQgb3BlcmF0aW5nIGNoYW5uZWwgaXMgdW4tc2FmZSBjaGFubmVsCisgICAgICAgICAgICAgICAgICAgKiByZXN0YXJ0IGRyaXZlciAqLworICAgICAgICAgICAgICAgICAgIGhkZF9ob3N0YXBkX3N0b3AocEhvc3RhcGRBZGFwdGVyLT5kZXYpOworICAgICAgICAgICAgICAgICAgIC8qIE9uIExFLCB0aGlzIGV2ZW50IGlzIGhhbmRsZWQgYnkgd2xhbi1zZXJ2aWNlcyB0bworICAgICAgICAgICAgICAgICAgICAqIHJlc3RhcnQgU0FQLiBPbiBhbmRyb2lkLCB0aGlzIGV2ZW50IHdvdWxkIGJlCisgICAgICAgICAgICAgICAgICAgICogaWdub3JlZC4KKyAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF9zZW5kX3N2Y19ubGlua19tc2coV0xBTl9TVkNfU0FQX1JFU1RBUlRfSU5ELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwgMCk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgIH0KKyAgICAgIH0KKyAgIH0KKworI2lmZGVmIFdMQU5fRkVBVFVSRV9BUF9IVDQwXzI0RworICAgaWYgKGhkZEN0eHQtPmNmZ19pbmktPmFwSFQ0MF8yNEdFbmFibGVkKQorICAgeworICAgICAgIHBTYXBDdHggPSBWT1NfR0VUX1NBUF9DQihwVm9zQ29udGV4dCk7CisKKyAgICAgICBpZihwU2FwQ3R4ID09IE5VTEwpCisgICAgICAgeworICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IRERfU0FQX0RBVEEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICBGTCgicHNhcEN0eCBpcyBOVUxMIikpOworICAgICAgICAgICByZXR1cm47CisgICAgICAgfQorCisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgIEZMKCJTQVAgU2Vjb25kYXJ5IGNoYW5uZWw6ICVkICIpLAorICAgICAgICAgICAgICAgcFNhcEN0eC0+c2FwX3NlY19jaGFuKTsKKworICAgICAgIC8qIHRIYWxIYW5kbGUgKi8KKyAgICAgICBoSGFsID0gVk9TX0dFVF9IQUxfQ0IocFNhcEN0eC0+cHZvc0dDdHgpOworCisgICAgICAgaWYgKE5VTEwgPT0gaEhhbCkKKyAgICAgICB7CisgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICBGTCgiSW4gaW52YWxpZCBoSGFsIikpOworICAgICAgICAgICByZXR1cm47CisgICAgICAgfQorCisgICAgICAgY2JNb2RlID0gc21lX0dldENoYW5uZWxCb25kaW5nTW9kZTI0RyhoSGFsKTsKKworICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgRkwoIlNlbGVjdGVkIENoYW5uZWwgYm9uZGluZyA6ICVkIiksIGNiTW9kZSk7CisKKyAgICAgICBpZiAoY2JNb2RlICYmIChwU2FwQ3R4LT5zYXBfc2VjX2NoYW4gPiAwKSkKKyAgICAgICB7CisgICAgICAgICAgIGludCBpOworICAgICAgICAgICBlSGFsU3RhdHVzIGhhbFN0YXR1czsKKworICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgdW5zYWZlQ2hhbm5lbENvdW50OyBpKyspCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGlmICgocFNhcEN0eC0+c2FwX3NlY19jaGFuID09IHVuc2FmZUNoYW5uZWxMaXN0W2ldKSkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAvKiBDdXJyZW50IFNBUCBTZWNvbmRhcnkgY2hhbm5lbCBpcyB1bi1zYWZlIGNoYW5uZWwgKi8KKyAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiTW92ZSBTQVAgZnJvbSBIVDQwIHRvIEhUMjAiKSk7CisKKyAgICAgICAgICAgICAgICAgICBoYWxTdGF0dXMgPSBzbWVfU2V0SFQyMDQwTW9kZShoSGFsLCBwU2FwQ3R4LT5zZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBQSFlfU0lOR0xFX0NIQU5ORUxfQ0VOVEVSRUQpOworCisgICAgICAgICAgICAgICAgICAgaWYgKGhhbFN0YXR1cyA9PSBlSEFMX1NUQVRVU19GQUlMVVJFKQorICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJGYWlsZWQgdG8gY2hhbmdlIEhUMjAvNDAgbW9kZSIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgIC8qIERpc2FibGUgQ2hhbm5lbCBCb25kaW5nIGZvciAyLjRHSHogKi8KKyAgICAgICAgICAgICAgICAgICBzbWVfVXBkYXRlQ2hhbm5lbEJvbmRpbmdNb2RlMjRHKGhIYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBQSFlfU0lOR0xFX0NIQU5ORUxfQ0VOVEVSRUQpOworICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgfQorICAgICAgIH0KKworICAgICAgIGlmICgoIXBTYXBDdHgtPm51bUhUNDBJbnRvU3RhKQorICAgICAgICAgICYmIChwSG9zdGFwZEFkYXB0ZXIpCisgICAgICAgICAgJiYgKHRlc3RfYml0KFNPRlRBUF9CU1NfU1RBUlRFRCwgJnBIb3N0YXBkQWRhcHRlci0+ZXZlbnRfZmxhZ3MpKSkKKyAgICAgICB7CisgICAgICAgICAgIC8qIGlmIFVuc2FmZSBjaGFubmVsIGlzIFplcm8gb3IgU0FQIFByaW1hcnkvU2Vjb25kYXJ5IGNoYW5uZWwKKyAgICAgICAgICAgICogYXJlIFNhZmUgdGhlbiBzdGFydCBIVDIwLzQwIHRpbWVyIHRvIE1vdmUgU0FQIGZyb20gSFQyMAorICAgICAgICAgICAgKiB0byBIVDQwLgorICAgICAgICAgICAgKi8KKyAgICAgICAgICAgaWYgKCgoIXVuc2FmZUNoYW5uZWxDb3VudCkKKyAgICAgICAgICAgICAgfHwgKCFzYXBDaGVja0hUNDBTZWNvbmRhcnlJc05vdEFsbG93ZWQocFNhcEN0eCkpKSAmJiAoIWNiTW9kZSkpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8qIFN0b3AgUHJldmlvdXMgUnVubmluZyBIVDIwLzQwIFRpbWVyICYgU3RhcnQgdGltZXIKKyAgICAgICAgICAgICAgICAgIHdpdGggKE9CU1MgVHJhbnNpdGlvbkRlbGF5RmFjdG9yICogb2JzcyBpbnRlcnZhbCkKKyAgICAgICAgICAgICAgICAgIGRlbGF5IGFmdGVyIHRpbWUgb3V0IG1vdmUgQVAgZnJvbSBIVDIwIC0+IEhUNDAKKyAgICAgICAgICAgICAgICAgIG1vZGUKKyAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgaWYgKFZPU19USU1FUl9TVEFURV9SVU5OSU5HID09IHBTYXBDdHgtPnNhcF9IVDIwNDBfdGltZXIuc3RhdGUpCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgdm9zU3RhdHVzID0gdm9zX3RpbWVyX3N0b3AoJnBTYXBDdHgtPnNhcF9IVDIwNDBfdGltZXIpOworICAgICAgICAgICAgICAgICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpCisgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiRmFpbGVkIHRvIFN0b3AgSFQyMC80MCB0aW1lciIpKTsKKyAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgZGVsYXkgPQorICAgICAgICAgICAgICAgKHBTYXBDdHgtPk9ic3NTY2FuSW50ZXJ2YWwgKiBwU2FwQ3R4LT5PYnNzVHJhbnNpdGlvbkRlbGF5RmFjdG9yKTsKKworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICBGTCgiU3RhcnQgSFQyMC80MCB0cmFuc2l0aW9uIHRpbWVyICglZCBzZWMpIiksIGRlbGF5KTsKKworICAgICAgICAgICAgICAgdm9zU3RhdHVzID0gdm9zX3RpbWVyX3N0YXJ0KCAmcFNhcEN0eC0+c2FwX0hUMjA0MF90aW1lciwKKyAgICAgICAgICAgICAgICAgICAgICAgKGRlbGF5ICogMTAwMCkpOworCisgICAgICAgICAgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJGYWlsZWQgdG8gU3RhcnQgSFQyMC80MCB0aW1lciIpKTsKKyAgICAgICAgICAgfQorICAgICAgICAgICBlbHNlCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8qIFN0b3AgSFQyMC80MCBUaW1lciAqLworICAgICAgICAgICAgICAgaWYgKFZPU19USU1FUl9TVEFURV9SVU5OSU5HID09IHBTYXBDdHgtPnNhcF9IVDIwNDBfdGltZXIuc3RhdGUpCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiU3RvcCBIVDIwLzQwIHRyYW5zaXRpb24gdGltZXIiKSk7CisgICAgICAgICAgICAgICAgICAgdm9zU3RhdHVzID0gdm9zX3RpbWVyX3N0b3AoJnBTYXBDdHgtPnNhcF9IVDIwNDBfdGltZXIpOworICAgICAgICAgICAgICAgICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpCisgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiRmFpbGVkIHRvIFN0b3AgSFQyMC80MCB0aW1lciIpKTsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgfQorICAgICAgIH0KKyAgIH0KKyNlbmRpZgorICAgcmV0dXJuOworfQorI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9DSF9BVk9JRCAqLworCitpbnQKK3N0YXRpYyBfX2l3X3NvZnRhcF9zZXRwYXJhbShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwSG9zdGFwZEFkYXB0ZXIgPSAobmV0ZGV2X3ByaXYoZGV2KSk7CisgICAgdEhhbEhhbmRsZSBoSGFsOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSBOVUxMOworICAgIGludCAqdmFsdWUgPSAoaW50ICopZXh0cmE7CisgICAgaW50IHN1Yl9jbWQgPSB2YWx1ZVswXTsKKyAgICBpbnQgc2V0X3ZhbHVlID0gdmFsdWVbMV07CisgICAgZUhhbFN0YXR1cyBzdGF0dXM7CisgICAgaW50IHJldCA9IDA7IC8qIHN1Y2Nlc3MgKi8KKyAgICB2X0NPTlRFWFRfdCBwVm9zQ29udGV4dDsKKworICAgIEVOVEVSKCk7CisKKyAgICBpZiAoTlVMTCA9PSBwSG9zdGFwZEFkYXB0ZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogaG9zdGFwZCBBZGFwdGVyIGlzIG51bGwiLAorICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEhvc3RhcGRBZGFwdGVyKTsKKyAgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHJldCkKKyAgICB7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisKKyAgICBoSGFsID0gV0xBTl9IRERfR0VUX0hBTF9DVFgocEhvc3RhcGRBZGFwdGVyKTsKKyAgICBpZiAoIWhIYWwpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogSGFsIGN0eCBpcyBudWxsIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgICAgcFZvc0NvbnRleHQgPSAoV0xBTl9IRERfR0VUX0NUWChwSG9zdGFwZEFkYXB0ZXIpKS0+cHZvc0NvbnRleHQ7CisgICAgaWYgKCFwVm9zQ29udGV4dCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBWb3MgY3R4IGlzIG51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisKKyAgICBzd2l0Y2goc3ViX2NtZCkKKyAgICB7CisKKyAgICAgICAgY2FzZSBRQ1NBUF9QQVJBTV9DTFJfQUNMOgorICAgICAgICAgICAgaWYgKCBWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gV0xBTlNBUF9DbGVhckFDTCggcFZvc0NvbnRleHQgKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU87CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFFDU0FQX1BBUkFNX0FDTF9NT0RFOgorICAgICAgICAgICAgaWYgKChlU0FQX0FMTE9XX0FMTCA8IChlU2FwTWFjQWRkckFDTClzZXRfdmFsdWUpIHx8CisgICAgICAgICAgICAgICAgKGVTQVBfQUNDRVBUX1VOTEVTU19ERU5JRUQgPiAoZVNhcE1hY0FkZHJBQ0wpc2V0X3ZhbHVlKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgRkwoIkludmFsaWQgQUNMIE1vZGUgdmFsdWUgJWQiKSwgc2V0X3ZhbHVlKTsKKyAgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFdMQU5TQVBfU2V0TW9kZShwVm9zQ29udGV4dCwgc2V0X3ZhbHVlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgUUNTQVBfUEFSQU1fU0VUX0FVVE9fQ0hBTk5FTDoKKyAgICAgICAgICAgIGlmICgoMCAhPSBzZXRfdmFsdWUpICYmICgxICE9IHNldF92YWx1ZSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsIEZMKCJJbnZhbGlkIHNldEF1dG9DaGFubmVsIHZhbHVlICVkIiksIHNldF92YWx1ZSk7CisgICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAoV0xBTl9IRERfR0VUX0NUWChwSG9zdGFwZEFkYXB0ZXIpKS0+Y2ZnX2luaS0+YXBBdXRvQ2hhbm5lbFNlbGVjdGlvbiA9IHNldF92YWx1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgUUNTQVBfUEFSQU1fTUFYX0FTU09DOgorICAgICAgICAgICAgaWYgKFdOSV9DRkdfQVNTT0NfU1RBX0xJTUlUX1NUQU1JTiA+IHNldF92YWx1ZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgRkwoIkludmFsaWQgc2V0TWF4QXNzb2MgdmFsdWUgJWQiKSwgc2V0X3ZhbHVlKTsKKyAgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChXTklfQ0ZHX0FTU09DX1NUQV9MSU1JVF9TVEFNQVggPCBzZXRfdmFsdWUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HVywgRkwoInNldE1heEFzc29jIHZhbHVlICVkIGhpZ2hlciB0aGFuIG1heCBhbGxvd2VkICVkLiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlNldHRpbmcgaXQgdG8gbWF4IGFsbG93ZWQgYW5kIGNvbnRpbnVpbmciKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0X3ZhbHVlLCBXTklfQ0ZHX0FTU09DX1NUQV9MSU1JVF9TVEFNQVgpOworICAgICAgICAgICAgICAgICAgICBzZXRfdmFsdWUgPSBXTklfQ0ZHX0FTU09DX1NUQV9MSU1JVF9TVEFNQVg7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNjbUNmZ1NldEludChoSGFsLCBXTklfQ0ZHX0FTU09DX1NUQV9MSU1JVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0X3ZhbHVlLCBOVUxMLCBlQU5JX0JPT0xFQU5fRkFMU0UpOworICAgICAgICAgICAgICAgIGlmICggc3RhdHVzICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MgKSAKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCBGTCgic2V0TWF4QXNzb2MgZmFpbHVyZSwgc3RhdHVzICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0ID0gLUVJTzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFFDU0FQX1BBUkFNX0hJREVfU1NJRDoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gc21lX0hpZGVTU0lEKGhIYWwsIHBIb3N0YXBkQWRhcHRlci0+c2Vzc2lvbklkLCBzZXRfdmFsdWUpOworICAgICAgICAgICAgICAgIGlmKGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gc3RhdHVzKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFFDU0FQX1BBUkFNX0hJREVfU1NJRCBmYWlsZWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgY2FzZSBRQ1NBUF9QQVJBTV9TRVRfTUNfUkFURToKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB0U2lyUmF0ZVVwZGF0ZUluZCAqcmF0ZVVwZGF0ZTsKKworICAgICAgICAgICAgICAgIHJhdGVVcGRhdGUgPSAodFNpclJhdGVVcGRhdGVJbmQgKikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRTaXJSYXRlVXBkYXRlSW5kKSk7CisgICAgICAgICAgICAgICAgaWYgKE5VTEwgPT0gcmF0ZVVwZGF0ZSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBTRVRfTUNfUkFURSBpbmRpY2F0aW9uIGFsbG9jIGZhaWwiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgICAgcmV0ID0gLTE7CisgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHZvc19tZW1femVybyhyYXRlVXBkYXRlLCBzaXplb2YodFNpclJhdGVVcGRhdGVJbmQgKSk7CisKKyAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICJNQyBUYXJnZXQgcmF0ZSAlZCIsIHNldF92YWx1ZSk7CisgICAgICAgICAgICAgICAgLyogSWdub3JlIHVuaWNhc3QgKi8KKyAgICAgICAgICAgICAgICByYXRlVXBkYXRlLT51Y2FzdERhdGFSYXRlID0gLTE7CisgICAgICAgICAgICAgICAgcmF0ZVVwZGF0ZS0+bWNhc3REYXRhUmF0ZTI0R0h6ID0gc2V0X3ZhbHVlOworICAgICAgICAgICAgICAgIHJhdGVVcGRhdGUtPm1jYXN0RGF0YVJhdGU1R0h6ID0gc2V0X3ZhbHVlOworICAgICAgICAgICAgICAgIHJhdGVVcGRhdGUtPm1jYXN0RGF0YVJhdGUyNEdIelR4RmxhZyA9IDA7CisgICAgICAgICAgICAgICAgcmF0ZVVwZGF0ZS0+bWNhc3REYXRhUmF0ZTVHSHpUeEZsYWcgPSAwOworICAgICAgICAgICAgICAgIHN0YXR1cyA9IHNtZV9TZW5kUmF0ZVVwZGF0ZUluZChoSGFsLCByYXRlVXBkYXRlKTsKKyAgICAgICAgICAgICAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogU0VUX01DX1JBVEUgZmFpbGVkIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocmF0ZVVwZGF0ZSk7CisgICAgICAgICAgICAgICAgICAgIHJldCA9IC0xOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgY2FzZSBRQ1NBUF9QQVJBTV9HRVRfRlJBTUVfTE9HUzoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAod2xhbl9oZGRfZ2V0X2ZyYW1lX2xvZ3MocEhvc3RhcGRBZGFwdGVyLCBzZXRfdmFsdWUpCisgICAgICAgICAgICAgICAgICAgICAgICAgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGhkZExvZyhMT0dFLCBGTCgiSW52YWxpZCBzZXRwYXJhbSBjb21tYW5kICVkIHZhbHVlICVkIiksCisgICAgICAgICAgICAgICAgICAgIHN1Yl9jbWQsIHNldF92YWx1ZSk7CisgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgRVhJVCgpOworICAgIHJldHVybiByZXQ7Cit9CisKK2ludAorc3RhdGljIGl3X3NvZnRhcF9zZXRwYXJhbShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X3NvZnRhcF9zZXRwYXJhbShkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCitpbnQKK3N0YXRpYyBfX2l3X3NvZnRhcF9nZXRwYXJhbShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwSG9zdGFwZEFkYXB0ZXI7CisgICAgdEhhbEhhbmRsZSBoSGFsOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgaW50ICp2YWx1ZSA9IChpbnQgKilleHRyYTsKKyAgICBpbnQgc3ViX2NtZCA9IHZhbHVlWzBdOworICAgIGVIYWxTdGF0dXMgc3RhdHVzOworICAgIGludCByZXQgPSAwOyAvKiBzdWNjZXNzICovCisgICAgdl9DT05URVhUX3QgcFZvc0NvbnRleHQ7CisKKyAgICBFTlRFUigpOworCisgICAgcEhvc3RhcGRBZGFwdGVyID0gKG5ldGRldl9wcml2KGRldikpOworICAgIGlmIChOVUxMID09IHBIb3N0YXBkQWRhcHRlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBBZGFwdGVyIGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwSG9zdGFwZEFkYXB0ZXIpOworICAgIHJldCA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gcmV0KQorICAgIHsKKyAgICAgICAgcmV0dXJuIHJldDsKKyAgICB9CisgICAgaEhhbCA9IFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBIb3N0YXBkQWRhcHRlcik7CisgICAgaWYgKE5VTEwgPT0gaEhhbCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBIYWwgQ29udGV4dCBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBwVm9zQ29udGV4dCA9IHBIZGRDdHgtPnB2b3NDb250ZXh0OworICAgIGlmIChOVUxMID09IHBWb3NDb250ZXh0KQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IHBWb3NDb250ZXh0IENvbnRleHQgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgc3dpdGNoIChzdWJfY21kKQorICAgIHsKKyAgICBjYXNlIFFDU0FQX1BBUkFNX01BWF9BU1NPQzoKKyAgICAgICAgc3RhdHVzID0gY2NtQ2ZnR2V0SW50KGhIYWwsIFdOSV9DRkdfQVNTT0NfU1RBX0xJTUlULCAodEFOSV9VMzIgKil2YWx1ZSk7CisgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgRkwoImZhaWxlZCB0byBnZXQgV05JX0NGR19BU1NPQ19TVEFfTElNSVQgZnJvbSBjZmcgJWQiKSxzdGF0dXMpOworICAgICAgICAgICAgcmV0ID0gLUVJTzsKKyAgICAgICAgfQorCisjaWZkZWYgV0xBTl9TT0ZUQVBfVlNUQV9GRUFUVVJFCisgICAgICAgIGlmIChwSGRkQ3R4LT5jZmdfaW5pLT5mRW5hYmxlVlNUQVN1cHBvcnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmICgqdmFsdWUgPiBWU1RBX05VTV9BU1NPQ19TVEEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKnZhbHVlID0gVlNUQV9OVU1fQVNTT0NfU1RBOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKChwSGRkQ3R4LT5oZGRBZGFwdGVycy5jb3VudCA+IFZTVEFfTlVNX1JFU1ZfU0VMRlNUQSkgJiYKKyAgICAgICAgICAgICAgICAoKnZhbHVlID4gKFZTVEFfTlVNX0FTU09DX1NUQSAtCisgICAgICAgICAgICAgICAgICAgICAgICAgIChwSGRkQ3R4LT5oZGRBZGFwdGVycy5jb3VudCAtIFZTVEFfTlVNX1JFU1ZfU0VMRlNUQSkpKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAqdmFsdWUgPSAoVlNUQV9OVU1fQVNTT0NfU1RBIC0KKyAgICAgICAgICAgICAgICAgICAgICAgICAocEhkZEN0eC0+aGRkQWRhcHRlcnMuY291bnQgLSBWU1RBX05VTV9SRVNWX1NFTEZTVEEpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisjZW5kaWYKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKCp2YWx1ZSA+IE5VTV9BU1NPQ19TVEEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKnZhbHVlID0gTlVNX0FTU09DX1NUQTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICgocEhkZEN0eC0+aGRkQWRhcHRlcnMuY291bnQgPiBOVU1fUkVTVl9TRUxGU1RBKSAmJgorICAgICAgICAgICAgICAgICgqdmFsdWUgPiAoTlVNX0FTU09DX1NUQSAtCisgICAgICAgICAgICAgICAgICAgICAgICAgIChwSGRkQ3R4LT5oZGRBZGFwdGVycy5jb3VudCAtIE5VTV9SRVNWX1NFTEZTVEEpKSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKnZhbHVlID0gKE5VTV9BU1NPQ19TVEEgLQorICAgICAgICAgICAgICAgICAgICAgICAgIChwSGRkQ3R4LT5oZGRBZGFwdGVycy5jb3VudCAtIE5VTV9SRVNWX1NFTEZTVEEpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBicmVhazsKKworICAgIGNhc2UgUUNTQVBfUEFSQU1fQ0xSX0FDTDoKKyAgICAgICAgaWYgKCBWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gV0xBTlNBUF9DbGVhckFDTCggcFZvc0NvbnRleHQgKSkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgRkwoIldMQU5TQVBfQ2xlYXJBQ0wgZmFpbGVkIikpOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTzsKKyAgICAgICAgfQorICAgICAgICAqdmFsdWUgPSAwOworICAgICAgICBicmVhazsKKworICAgIGNhc2UgUUNTQVBfUEFSQU1fR0VUX1dMQU5fREJHOgorICAgICAgICB7CisgICAgICAgICAgICB2b3NfdHJhY2VfZGlzcGxheSgpOworICAgICAgICAgICAgKnZhbHVlID0gMDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICBjYXNlIFFDU0FQX1BBUkFNX0FVVE9fQ0hBTk5FTDoKKyAgICAgICAgeworICAgICAgICAgICAgKnZhbHVlID0gKFdMQU5fSEREX0dFVF9DVFgocEhvc3RhcGRBZGFwdGVyKSktPmNmZ19pbmktPmFwQXV0b0NoYW5uZWxTZWxlY3Rpb247CisgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgIGRlZmF1bHQ6CisgICAgICAgIGhkZExvZyhMT0dFLCBGTCgiSW52YWxpZCBnZXRwYXJhbSBjb21tYW5kICVkIiksIHN1Yl9jbWQpOworICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICBicmVhazsKKworICAgIH0KKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gcmV0OworfQorCitpbnQKK3N0YXRpYyBpd19zb2Z0YXBfZ2V0cGFyYW0oc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaW50IHJldDsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX19pd19zb2Z0YXBfZ2V0cGFyYW0oZGV2LCBpbmZvLCB3cnF1LCBleHRyYSk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKy8qIFVzYWdlOgorICAgIEJMQUNLX0xJU1QgID0gMAorICAgIFdISVRFX0xJU1QgID0gMSAKKyAgICBBREQgTUFDID0gMAorICAgIFJFTU9WRSBNQUMgID0gMQorCisgICAgbWFjIGFkZHIgd2lsbCBiZSBhY2NlcHRlZCBhcyBhIDYgb2N0ZXQgbWFjIGFkZHJlc3Mgd2l0aCBlYWNoIG9jdGV0IGlucHV0dGVkIGluIGhleAorICAgIGZvciBlLmcuIDAwOjBhOmY1OjExOjIyOjMzIHdpbGwgYmUgcm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ZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEhvc3RhcGRBZGFwdGVyOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgaW50IHJldCA9IDA7CisgICAgaW50ICp2YWx1ZTsKKworICAgIEVOVEVSKCk7CisKKyAgICBwSG9zdGFwZEFkYXB0ZXIgPSAobmV0ZGV2X3ByaXYoZGV2KSk7CisgICAgaWYgKE5VTEwgPT0gcEhvc3RhcGRBZGFwdGVyKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEhvc3RhcGRBZGFwdGVyKTsKKyAgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHJldCkKKyAgICB7CisgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorCisgICAgdmFsdWUgPSAoaW50ICopZXh0cmE7CisKKyAgICAqdmFsdWUgPSAoV0xBTl9IRERfR0VUX0FQX0NUWF9QVFIocEhvc3RhcGRBZGFwdGVyKSktPm9wZXJhdGluZ0NoYW5uZWw7CisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIDA7Cit9CisKKworaW50CitzdGF0aWMgaXdfc29mdGFwX2dldGNoYW5uZWwoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9faXdfc29mdGFwX2dldGNoYW5uZWwoZGV2LCBpbmZvLCB3cnF1LCBleHRyYSk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworaW50CitzdGF0aWMgX19pd19zb2Z0YXBfc2V0X21heF90eF9wb3dlcihzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGhkZF9hZGFwdGVyX3QgKnBIb3N0YXBkQWRhcHRlcjsKKyAgICB0SGFsSGFuZGxlIGhIYWw7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgICBpbnQgKnZhbHVlID0gKGludCAqKWV4dHJhOworICAgIGludCBzZXRfdmFsdWUsIHJldCA9IDA7CisgICAgdFNpck1hY0FkZHIgYnNzaWQgPSB7MHhGRiwweEZGLDB4RkYsMHhGRiwweEZGLDB4RkZ9OworICAgIHRTaXJNYWNBZGRyIHNlbGZNYWMgPSB7MHhGRiwweEZGLDB4RkYsMHhGRiwweEZGLDB4RkZ9OworCisgICAgRU5URVIoKTsKKworICAgIHBIb3N0YXBkQWRhcHRlciA9IChuZXRkZXZfcHJpdihkZXYpKTsKKyAgICBpZiAoTlVMTCA9PSBwSG9zdGFwZEFkYXB0ZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJ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YXhUeFBvd2VyKGhIYWwsIGJzc2lkLCBzZWxmTWFjLCBzZXRfdmFsdWUpKQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiBTZXR0aW5nIG1heGltdW0gdHggcG93ZXIgZmFpbGVkIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlPOworICAgIH0KKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gMDsKK30KKworaW50CitzdGF0aWMgaXdfc29mdGFwX3NldF9tYXhfdHhfcG93ZXIoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9faXdfc29mdGFwX3NldF9tYXhfdHhfcG93ZXIoZGV2LCBpbmZvLCB3cnF1LCBleHRyYSk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworCitpbnQKK3N0YXRpYyBfX2l3X2Rpc3BsYXlfZGF0YV9wYXRoX3NuYXBzaG90KHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisKKyAgICAvKiBGdW5jdGlvbiBpbnRpdGlhdGluZyBkdW1waW5nIHN0YXRlcy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gICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9faXdfZGlzcGxheV9kYXRhX3BhdGhfc25hcHNob3QoZGV2LCBpbmZvLCB3cnF1LCBleHRyYSk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworaW50CitzdGF0aWMgX19pd19zb2Z0YXBfc2V0X3R4X3Bvd2VyKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGhkZF9hZGFwdGVyX3QgKnBIb3N0YXBkQWRhcHRlcjsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgIHZfQ09OVEVYVF90IHBWb3NDb250ZXh0OworICAgIHRIYWxIYW5kbGUgaEhhbDsKKyAgICBpbnQgKnZhbHVlID0gKGludCAqKWV4dHJhOworICAgIGludCBzZXRfdmFsdWUsIHJldCA9IDA7CisgICAgcHRTYXBDb250ZXh0ICBwU2FwQ3R4ID0gTlVMTDsKKworICAgIEVOVEVSKCk7CisKKyAgICBwSG9zdGFwZEFkYXB0ZXIgPSAobmV0ZGV2X3ByaXYoZGV2KSk7CisgICAgaWYgKE5VTEwgPT0gcEhvc3RhcGRBZGFwdGVyKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEhvc3RhcGRBZGFwdGVyKTsKKyAgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHJldCkKKyAgICB7CisgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorICAgIHBWb3NDb250ZXh0ID0gcEhkZEN0eC0+cHZvc0NvbnRleHQ7CisgICAgaWYgKE5VTEwgPT0gcFZvc0NvbnRleHQpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogVm9zIENvbnRleHQgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgaEhhbCA9IFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBIb3N0YXBkQWRhcHRlcik7CisgICAgaWYgKE5VTEwgPT0gaEhhbCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBIYWwgQ29udGV4dCBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBpZiAoTlVMTCA9PSB2YWx1ZSkKKyAgICAgICAgcmV0dXJuIC1FTk9NRU07CisKKyAgICBwU2FwQ3R4ID0gVk9TX0dFVF9TQVBfQ0IocFZvc0NvbnRleHQpOworICAgIGlmIChOVUxMID09IHBTYXBDdHgpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgU0FQIHBvaW50ZXIgZnJvbSBwdm9zR0N0eCIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICB9CisKKyAgICBzZXRfdmFsdWUgPSB2YWx1ZVswXTsKKyAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzbWVfU2V0VHhQb3dlcihoSGFsLCBwU2FwQ3R4LT5zZXNzaW9uSWQsIHNldF92YWx1ZSkpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IFNldHRpbmcgdHggcG93ZXIgZmFpbGVkIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlPOworICAgIH0KKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gMDsKK30KKworaW50CitzdGF0aWMgaXdfc29mdGFwX3NldF90eF9wb3dlcihzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9faXdfc29mdGFwX3NldF90eF9wb3dlcihkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCisvKiotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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lVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiJXM6IEhERCBhZGFwdGVyIGlzIE51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRU5PREVWOworICAgIH0KKworICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKworICAgIHN0YXR1cyA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gc3RhdHVzKQorICAgIHsKKyAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICB9CisKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlcyA6ICIsIF9fZnVuY19fKTsKKworICAgIGlmIChOVUxMID09IGlzU2V0VHJhZmZpY01vbikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICIlczogSW52YWxpZCBTQVAgcG9pbnRlciBmcm9tIGV4dHJhIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVOT01FTTsKKyAgICB9CisKKyAgICBpZiAoVFJVRSA9PSAqaXNTZXRUcmFmZmljTW9uKQorICAgIHsKKyAgICAgICAgcEhkZEN0eC0+Y2ZnX2luaS0+ZW5hYmxlVHJhZmZpY01vbml0b3I9IFRSVUU7CisgICAgICAgIGlmIChWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gaGRkX3N0YXJ0X3RyYWZmaWNNb25pdG9yKHBBZGFwdGVyKSkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERF9TT0ZUQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBmYWlsZWQgdG8gU3RhcnQgVHJhZmZpYyBNb25pdG9yIHRpbWVyICIsIF9fZnVuY19fICk7CisgICAgICAgICAgICByZXR1cm4gLUVJTzsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmIChGQUxTRSA9PSAqaXNTZXRUcmFmZmljTW9uKQorICAgIHsKKyAgICAgICAgcEhkZEN0eC0+Y2ZnX2luaS0+ZW5hYmxlVHJhZmZpY01vbml0b3I9IEZBTFNFOworICAgICAgICBpZiAoVk9TX1NUQVRVU19TVUNDRVNTICE9IGhkZF9zdG9wX3RyYWZmaWNNb25pdG9yKHBBZGFwdGVyKSkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERF9TT0ZUQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBmYWlsZWQgdG8gU3RvcCBUcmFmZmljIE1vbml0b3IgdGltZXIgIiwgX19mdW5jX18gKTsKKyAgICAgICAgICAgIHJldHVybiAtRUlPOworICAgICAgICB9CisKKyAgICB9CisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIDA7Cit9CisKK3N0YXRpYyBpbnQgaXdfc29mdGFwX3NldF90cmFmZmljbW9uaXRvcihzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaW50IHJldDsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX19pd19zb2Z0YXBfc2V0X3RyYWZmaWNtb25pdG9yKGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKKyNkZWZpbmUgSVNfQlJPQURDQVNUX01BQyh4KSAoKCh4WzBdICYgeFsxXSAmIHhbMl0gJiB4WzNdICYgeFs0XSAmIHhbNV0pID09IDB4ZmYpID8gMSA6IDApCisKK2ludAorc3RhdGljIF9faXdfc29mdGFwX2dldGFzc29jX3N0YW1hY2FkZHIoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGhkZF9hZGFwdGVyX3QgKnBIb3N0YXBkQWRhcHRlcjsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgIGhkZF9zdGF0aW9uX2luZm9fdCAqcFN0YUluZm8gPSBOVUxMOworICAgIGNoYXIgKmJ1ZjsKKyAgICBpbnQgY250ID0gMDsKKyAgICBpbnQgbGVmdDsKKyAgICBpbnQgcmV0ID0gMDsKKyAgICAvKiBtYWNsaXN0X2luZGV4IG11c3QgYmUgdTMyIHRvIG1hdGNoIHVzZXJzcGFjZSAqLworICAgIHUzMiBtYWNsaXN0X2luZGV4OworICAgIHZfQ09OVEVYVF90IHBWb3NDb250ZXh0ID0gTlVMTDsKKyAgICBwdFNhcENvbnRleHQgcFNhcEN0eCA9IE5VTEw7CisKKyAgICBFTlRFUigpOworCisgICAgcEhvc3RhcGRBZGFwdGVyID0gKG5ldGRldl9wcml2KGRldikpOworICAgIGlmIChOVUxMID09IHBIb3N0YXBkQWRhcHRlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX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fTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEhvc3RhcGRBZGFwdGVyKTsKKyAgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHJldCkKKyAgICB7CisgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorICAgIC8qIGl3cHJpdiB0b29sIG9yIGZyYW1ld29yayBjYWxscyB0aGlzIGlvY3RsIHdpdGgKKyAgICAgKiBkYXRhIHBhc3NlZCBpbiBleHRyYSAobGVzcyB0aGFuIDE2IG9jdGV0cyk7CisgICAgICovCisgICAgcGVlck1hY0FkZHIgPSAodl9VOF90ICopKGV4dHJhKTsKKworICAgIGhkZExvZyhMT0cxLCAiJXMgZGF0YSAiICBNQUNfQUREUkVTU19TVFIsCisgICAgICAgICAgIF9fZnVuY19fLCBNQUNfQUREUl9BUlJBWShwZWVyTWFjQWRkcikpOworICAgIGhkZF9zb2Z0YXBfc3RhX2Rpc2Fzc29jKHBIb3N0YXBkQWRhcHRlciwgcGVlck1hY0FkZHIpOworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gMDsKK30KKworaW50CitzdGF0aWMgaXdfc29mdGFwX2Rpc2Fzc29jX3N0YShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9faXdfc29mdGFwX2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RhdEJ1ZmZlciwgMCwgc2l6ZW9mKHN0YXRCdWZmZXIpKTsKKyAgICBXTEFOU0FQX0dldFN0YXRpc3RpY3MoKFdMQU5fSEREX0dFVF9DVFgocEhvc3RhcGRBZGFwdGVyKSktPnB2b3NDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJnN0YXRCdWZmZXIsICh2X0JPT0xfdCl3cnF1LT5kYXRhLmZsYWdzKTsKKworICAgIHBzdGF0YnVmID0ga3phbGxvYyhRQ1NBUF9NQVhfV1NDX0lFLCBHRlBfS0VSTkVMKTsKKyAgICBpZihOVUxMID09IHBzdGF0YnVmKSB7CisgICAgICAgIGhkZExvZyhMT0cxLCAidW5hYmxlIHRvIGFsbG9jYXRlIG1lbW9yeSIpOworICAgICAgICByZXR1cm4gLUVOT01FTTsKKyAgICB9CisKKyAgICBsZW4gPSBzY25wcmludGYocHN0YXRidWYsIFFDU0FQX01BWF9XU0NfSUUsCisgICAgICAgICAgICAgICAgICAgICJSVUY9JWQgUk1GPSVkIFJCRj0lZCAiCisgICAgICAgICAgICAgICAgICAgICJSVUI9JWQgUk1CPSVkIFJCQj0lZCAiCisgICAgICAgICAgICAgICAgICAgICJUVUY9JWQgVE1GPSVkIFRCRj0lZCAiCisgICAgICAgICAgICAgICAgICAgICJUVUI9JWQgVE1CPSVkIFRCQj0lZCAiLAorICAgICAgICAgICAgICAgICAgICAoaW50KXN0YXRCdWZmZXIucnhVQ0ZjbnQsIChpbnQpc3RhdEJ1ZmZlci5yeE1DRmNudCwKKyAgICAgICAgICAgICAgICAgICAgKGludClzdGF0QnVmZmVyLnJ4QkNGY250LCAoaW50KXN0YXRCdWZmZXIucnhVQ0JjbnQsCisgICAgICAgICAgICAgICAgICAgIChpbnQpc3RhdEJ1ZmZlci5yeE1DQmNudCwgKGludClzdGF0QnVmZmVyLnJ4QkNCY250LAorICAgICAgICAgICAgICAgICAgICAoaW50KXN0YXRCdWZmZXIudHhVQ0ZjbnQsIChpbnQpc3RhdEJ1ZmZlci50eE1DRmNudCwKKyAgICAgICAgICAgICAgICAgICAgKGludClzdGF0QnVmZmVyLnR4QkNGY250LCAoaW50KXN0YXRCdWZmZXIudHhVQ0JjbnQsCisgICAgICAgICAgICAgICAgICAgIChpbnQpc3RhdEJ1ZmZlci50eE1DQmNudCwgKGludClzdGF0QnVmZmVyLnR4QkNCY250KTsKKworICAgIGlmIChsZW4gPj0gUUNTQVBfTUFYX1dTQ19JRSkgeworICAgICAgICBoZGRMb2coTE9HMSwgIiVzOiBmYWlsZWQgdG8gY29weSBkYXRhIHRvIHVzZXIgYnVmZmVyIiwgX19mdW5jX18pOworICAgICAgICBrZnJlZShwc3RhdGJ1Zik7CisgICAgICAgIHJldHVybiAtRUZBVUxUOworICAgIH0KKworICAgIHN0cmxjcHkoZXh0cmEsIHBzdGF0YnVmLCBsZW4pOworICAgIHdycXUtPmRhdGEubGVuZ3RoID0gbGVuOworICAgIGtmcmVlKHBzdGF0YnVmKTsKKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gMDsKK30KKworaW50CitzdGF0aWMgaXdfc29mdGFwX2FwX3N0YXRzKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9faXdfc29mdGFwX2FwX3N0YXRzKGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQgX19pd19zb2Z0YXBfc2V0X2NoYW5uZWxfcmFuZ2Uoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwSG9zdGFwZEFkYXB0ZXI7CisgICAgdEhhbEhhbmRsZSBoSGFsOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgaW50ICp2YWx1ZSA9IChpbnQgKilleHRyYTsKKyAgICBpbnQgc3RhcnRDaGFubmVsID0gdmFsdWVbMF07CisgICAgaW50IGVuZENoYW5uZWwgPSB2YWx1ZVsxXTsKKyAgICBpbnQgYmFuZCA9IHZhbHVlWzJdOworICAgIFZPU19TVEFUVVMgc3RhdHVzOworICAgIGludCByZXQgPSAwOyAvKiBzdWNjZXNzICovCisKKyAgICBFTlRFUigpOworCisgICAgaWYgKCFjYXBhYmxlKENBUF9ORVRfQURNSU4pKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICBGTCgicGVybWlzc2lvbiBjaGVjayBmYWlsZWQiKSk7CisgICAgICAgIHJldHVybiAtRVBFUk07CisgICAgfQorCisgICAgcEhvc3RhcGRBZGFwdGVyID0gKG5ldGRldl9wcml2KGRldikpOworICAgIGlmIChOVUxMID09IHBIb3N0YXBkQWRhcHRlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEhvc3RhcGRBZGFwdGVyKTsKKyAgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHJldCkKKyAgICB7CisgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorICAgIGhIYWwgPSBXTEFOX0hERF9HRVRfSEFMX0NUWChwSG9zdGFwZEFkYXB0ZXIpOworICAgIGlmIChOVUxMID09IGhIYWwpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogSGFsIENvbnRleHQgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgc3RhdHVzID0gV0xBTlNBUF9TZXRDaGFubmVsUmFuZ2UoaEhhbCxzdGFydENoYW5uZWwsZW5kQ2hhbm5lbCxiYW5kKTsKKyAgICBpZihzdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgIHsKKyAgICAgIGhkZExvZyggTE9HRSwgRkwoIml3X3NvZnRhcF9zZXRfY2hhbm5lbF9yYW5nZTogIHN0YXJ0Q2hhbm5lbCA9ICVkLCBlbmRDaGFubmVsID0gJWQgYmFuZCA9ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRDaGFubmVsLGVuZENoYW5uZWwsIGJhbmQpOworICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICB9CisKKyAgICBwSGRkQ3R4LT5pc19keW5hbWljX2NoYW5uZWxfcmFuZ2Vfc2V0ID0gMTsKKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IGl3X3NvZnRhcF9zZXRfY2hhbm5lbF9yYW5nZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9faXdfc29mdGFwX3NldF9jaGFubmVsX3JhbmdlKGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKKworaW50IF9faXdfc29mdGFwX2dldF9jaGFubmVsX2xpc3Qoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIHZfVTMyX3QgbnVtX2NoYW5uZWxzID0gMDsKKyAgICB2X1U4X3QgaSA9IDA7CisgICAgdl9VOF90IGJhbmRTdGFydENoYW5uZWwgPSBSRl9DSEFOXzE7CisgICAgdl9VOF90IGJhbmRFbmRDaGFubmVsID0gUkZfQ0hBTl8xNjU7CisgICAgdl9VMzJfdCB0ZW1wX251bV9jaGFubmVscyA9IDA7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEhvc3RhcGRBZGFwdGVyOworICAgIHRIYWxIYW5kbGUgaEhhbDsKKyAgICB2X1JFR0RPTUFJTl90IGRvbWFpbklkQ3VycmVudFNvZnRhcDsKKyAgICB0cENoYW5uZWxMaXN0SW5mbyBjaGFubmVsX2xpc3QgPSAodHBDaGFubmVsTGlzdEluZm8pIGV4dHJhOworICAgIGVDc3JCYW5kIGN1ckJhbmQgPSBlQ1NSX0JBTkRfQUxMOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgaW50IHJldCA9IDA7CisKKyAgICBFTlRFUigpOworCisgICAgcEhvc3RhcGRBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaWYgKE5VTEwgPT0gcEhvc3RhcGRBZGFwdGVyKQorICAgIHsKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBIb3N0YXBkQWRhcHRlcik7CisgICAgcmV0ID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSByZXQpCisgICAgeworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKyAgICBoSGFsID0gV0xBTl9IRERfR0VUX0hBTF9DVFgocEhvc3RhcGRBZGFwdGVyKTsKKyAgICBpZiAoTlVMTCA9PSBoSGFsKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEhhbCBDb250ZXh0IGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHNtZV9HZXRGcmVxQmFuZChoSGFsLCAmY3VyQmFuZCkpCisgICAgeworICAgICAgICBoZGRMb2coTE9HRSxGTCgibm90IGFibGUgZ2V0IHRoZSBjdXJyZW50IGZyZXF1ZW5jeSBiYW5kIikpOworICAgICAgICByZXR1cm4gLUVJTzsKKyAgICB9CisgICAgd3JxdS0+ZGF0YS5sZW5ndGggPSBzaXplb2YodENoYW5uZWxMaXN0SW5mbyk7CisgICAgRU5URVIoKTsKKworICAgIGlmIChlQ1NSX0JBTkRfMjQgPT0gY3VyQmFuZCkKKyAgICB7CisgICAgICAgIGJhbmRTdGFydENoYW5uZWwgPSBSRl9DSEFOXzE7CisgICAgICAgIGJhbmRFbmRDaGFubmVsID0gUkZfQ0hBTl8xNDsKKyAgICB9CisgICAgZWxzZSBpZiAoZUNTUl9CQU5EXzVHID09IGN1ckJhbmQpCisgICAgeworICAgICAgICBiYW5kU3RhcnRDaGFubmVsID0gUkZfQ0hBTl8zNjsKKyAgICAgICAgYmFuZEVuZENoYW5uZWwgPSBSRl9DSEFOXzE2NTsKKyAgICB9CisKKyAgICBoZGRMb2coTE9HMSwgRkwoImN1ckJhbmQgPSAlZCwgYmFuZFN0YXJ0Q2hhbm5lbCA9ICVodSwgIgorICAgICAgICAgICAgICAgICJiYW5kRW5kQ2hhbm5lbCA9ICVodSAiKSwgY3VyQmFuZCwKKyAgICAgICAgICAgICAgICBiYW5kU3RhcnRDaGFubmVsLCBiYW5kRW5kQ2hhbm5lbCApOworCisgICAgZm9yKCBpID0gYmFuZFN0YXJ0Q2hhbm5lbDsgaSA8PSBiYW5kRW5kQ2hhbm5lbDsgaSsrICkKKyAgICB7CisgICAgICAgIGlmKCBOVl9DSEFOTkVMX0VOQUJMRSA9PSByZWdDaGFubmVsc1tpXS5lbmFibGVkICkKKyAgICAgICAgeworICAgICAgICAgICAgY2hhbm5lbF9saXN0LT5jaGFubmVsc1tudW1fY2hhbm5lbHNdID0gcmZDaGFubmVsc1tpXS5jaGFubmVsTnVtOyAKKyAgICAgICAgICAgIG51bV9jaGFubmVscysrOworICAgICAgICB9CisgICAgfQorCisgICAgLyogcmVtb3ZlIGluZG9vciBjaGFubmVscyBpZiB0aGUgZG9tYWluIGlzIEZDQywgY2hhbm5lbHMgMzYgLSA0OCAqLworCisgICAgdGVtcF9udW1fY2hhbm5lbHMgPSBudW1fY2hhbm5lbHM7CisKKyAgICBpZihlSEFMX1NUQVRVU19TVUNDRVNTICE9IHNtZV9nZXRTb2Z0QXBEb21haW4oaEhhbCwodl9SRUdET01BSU5fdCAqKSAmZG9tYWluSWRDdXJyZW50U29mdGFwKSkKKyAgICB7CisgICAgICAgIGhkZExvZyhMT0dFLEZMKCJGYWlsZWQgdG8gZ2V0IERvbWFpbiBJRCwgJWQiKSxkb21haW5JZEN1cnJlbnRTb2Z0YXApOworICAgICAgICByZXR1cm4gLUVJTzsKKyAgICB9CisKKyAgICBpZihSRUdET01BSU5fRkNDID09IGRvbWFpbklkQ3VycmVudFNvZnRhcCAmJgorICAgICAgICAgICAgIHBIZGRDdHgtPmNmZ19pbmktPmdFbmFibGVTdHJpY3RSZWd1bGF0b3J5Rm9yRkNDICkKKyAgICB7CisgICAgICAgIGZvcihpID0gMDsgaSA8IHRlbXBfbnVtX2NoYW5uZWxzOyBpKyspCisgICAgICAgIHsKKyAgICAgIAorICAgICAgICAgICBpZigoY2hhbm5lbF9saXN0LT5jaGFubmVsc1tpXSA+IDM1KSAmJiAKKyAgICAgICAgICAgICAgKGNoYW5uZWxfbGlzdC0+Y2hhbm5lbHNbaV0gPCA0OSkpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHZvc19tZW1fbW92ZSgmY2hhbm5lbF9saXN0LT5jaGFubmVsc1tpXSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmNoYW5uZWxfbGlzdC0+Y2hhbm5lbHNbaSsxXSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcF9udW1fY2hhbm5lbHMgLSAoaS0xKSk7CisgICAgICAgICAgICAgICBudW1fY2hhbm5lbHMtLTsKKyAgICAgICAgICAgICAgIHRlbXBfbnVtX2NoYW5uZWxzLS07CisgICAgICAgICAgICAgICBpLS07CisgICAgICAgICAgIH0gCisgICAgICAgIH0KKyAgICB9CisKKyAgICBoZGRMb2coTE9HMSxGTCgiIG51bWJlciBvZiBjaGFubmVscyAlZCIpLCBudW1fY2hhbm5lbHMpOworCisgICAgaWYgKG51bV9jaGFubmVscyA+IElXX01BWF9GUkVRVUVOQ0lFUykKKyAgICB7CisgICAgICAgIG51bV9jaGFubmVscyA9IElXX01BWF9GUkVRVUVOQ0lFUzsKKyAgICB9CisKKyAgICBjaGFubmVsX2xpc3QtPm51bV9jaGFubmVscyA9IG51bV9jaGFubmVsczsKKyAgICBFWElUKCk7CisKKyAgICByZXR1cm4gMDsKK30KKworaW50IGl3X3NvZnRhcF9nZXRfY2hhbm5lbF9saXN0KHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X3NvZnRhcF9nZXRfY2hhbm5lbF9saXN0KGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYworaW50IF9faXdfZ2V0X2dlbmllKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGhkZF9hZGFwdGVyX3QgKnBIb3N0YXBkQWRhcHRlcjsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgIHZfQ09OVEVYVF90IHBWb3NDb250ZXh0OworICAgIGVIYWxTdGF0dXMgc3RhdHVzOworICAgIHZfVTMyX3QgbGVuZ3RoID0gRE9UMTFGX0lFX1JTTl9NQVhfTEVOOworICAgIHZfVThfdCBnZW5JZUJ5dGVzW0RPVDExRl9JRV9SU05fTUFYX0xFTl07CisgICAgaW50IHJldCA9IDA7CisKKyAgICBFTlRFUigpOworCisgICAgcEhvc3RhcGRBZGFwdGVyID0gKG5ldGRldl9wcml2KGRldikpOworICAgIGlmIChOVUxMID09IHBIb3N0YXBkQWRhcHRlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBBZGFwdGVyIGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBIb3N0YXBkQWRhcHRlcik7CisgICAgcmV0ID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSByZXQpCisgICAgeworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKyAgICBwVm9zQ29udGV4dCA9IHBIZGRDdHgtPnB2b3NDb250ZXh0OworICAgIGlmIChOVUxMID09IHBWb3NDb250ZXh0KQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IHZvcyBjb250ZXh0IGlzIG5vdCB2YWxpZCAiLF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIGhkZExvZyhMT0cxLEZMKCJnZXRHRU5fSUUgaW9jdGwiKSk7CisgICAgLy8gQWN0dWFsbHkgcmV0cmlldmUgdGhlIFJTTiBJRSBmcm9tIENTUi4gIChXZSBwcmV2aW91c2x5IHNlbnQgaXQgZG93biBpbiB0aGUgQ1NSIFJvYW0gUHJvZmlsZS4pCisgICAgc3RhdHVzID0gV0xBTlNhcF9nZXRzdGF0aW9uSUVfaW5mb3JtYXRpb24ocFZvc0NvbnRleHQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZW5JZUJ5dGVzKTsKKyAgICBsZW5ndGggPSBWT1NfTUlOKCh1X2ludDE2X3QpIGxlbmd0aCwgRE9UMTFGX0lFX1JTTl9NQVhfTEVOKTsKKyAgICBpZiAod3JxdS0+ZGF0YS5sZW5ndGggPCBsZW5ndGggfHwKKyAgICAgICAgY29weV90b191c2VyKHdycXUtPmRhdGEucG9pbnRlciwKKyAgICAgICAgICAgICAgICAgICAgICAodl9WT0lEX3QqKWdlbkllQnl0ZXMsIGxlbmd0aCkpCisgICAgeworICAgICAgICBoZGRMb2coTE9HMSwgIiVzOiBmYWlsZWQgdG8gY29weSBkYXRhIHRvIHVzZXIgYnVmZmVyIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVGQVVMVDsKKyAgICB9CisgICAgd3JxdS0+ZGF0YS5sZW5ndGggPSBsZW5ndGg7CisgICAgCisgICAgaGRkTG9nKExPRzEsRkwoIiBSU04gSUUgb2YgJWQgYnl0ZXMgcmV0dXJuZWQiKSwgd3JxdS0+ZGF0YS5sZW5ndGggKTsKKyAgICAKKyAgIAorICAgIEVYSVQoKTsKKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljCitpbnQgaXdfZ2V0X2dlbmllKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIG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01BQ0FERFJfdCkpOworICAgIGlmIChjb3B5X3RvX3VzZXIod3JxdS0+ZGF0YS5wb2ludGVyLAorICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKikmV1BTUEJDUHJvYmVSZXFJRXMsCisgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKFdQU1BCQ1Byb2JlUmVxSUVzKSkpCisgICAgeworICAgICAgICAgaGRkTG9nKExPRzEsICIlczogZmFpbGVkIHRvIGNvcHkgZGF0YSB0byB1c2VyIGJ1ZmZlciIsIF9fZnVuY19fKTsKKyAgICAgICAgIHJldHVybiAtRUZBVUxUOworICAgIH0KKyAgICB3cnF1LT5kYXRhLmxlbmd0aCA9IDEyICsgV1BTUEJDUHJvYmVSZXFJRXMucHJvYmVSZXFJRUxlbjsKKyAgICBoZGRMb2coTE9HMSwgRkwoIk1hY2FkZHJlc3MgOiAiTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgTUFDX0FERFJfQVJSQVkoV1BTUEJDUHJvYmVSZXFJRXMubWFjYWRkcikpOworICAgIHVwKCZwSGRkQXBDdHgtPnNlbVdwc1BCQ092ZXJsYXBJbmQpOworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljCitpbnQgaXdfZ2V0X1dQU1BCQ1Byb2JlUmVxSUVzKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9faXdfZ2V0X1dQU1BCQ1Byb2JlUmVxSUVzKGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9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V4dFN0YXRlOworICAgaW50IHJldCA9IDA7CisKKyAgIEVOVEVSKCk7CisKKyAgIHBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICBpZiAoTlVMTCA9PSBwQWRhcHRlcikKKyAgIHsKKyAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBBZGFwdGVyIGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgIH0KKworICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgcmV0ID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgIGlmICgwICE9IHJldCkKKyAgIHsKKyAgICAgICByZXR1cm4gcmV0OworICAgfQorICAgcFdleHRTdGF0ZSA9IFdMQU5fSEREX0dFVF9XRVhUX1NUQVRFX1BUUihwQWRhcHRlcik7CisgICBpZiAoTlVMTCA9PSBwV2V4dFN0YXRlKQorICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IHBXZXh0U3RhdGUgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgfQorICAgc3dpdGNoKHdycXUtPnBhcmFtLmZsYWdzICYgSVdfQVVUSF9JTkRFWCkKKyAgIHsKKyAgICAgIGNhc2UgSVdfQVVUSF9US0lQX0NPVU5URVJNRUFTVVJFUzoKKyAgICAgIHsKKyAgICAgICAgIGlmKHdycXUtPnBhcmFtLnZhbHVlKSB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAiQ291bnRlciBNZWFzdXJlIHN0YXJ0ZWQgJWQiLCB3cnF1LT5wYXJhbS52YWx1ZSk7CisgICAgICAgICAgICBwV2V4dFN0YXRlLT5tVEtJUENvdW50ZXJNZWFzdXJlcyA9IFRLSVBfQ09VTlRFUl9NRUFTVVJFX1NUQVJURUQ7CisgICAgICAgICB9CisgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICJDb3VudGVyIE1lYXN1cmUgc3RvcHBlZD0lZCIsIHdycXUtPnBhcmFtLnZhbHVlKTsKKyAgICAgICAgICAgIHBXZXh0U3RhdGUtPm1US0lQQ291bnRlck1lYXN1cmVzID0gVEtJUF9DT1VOVEVSX01FQVNVUkVfU1RPUEVEOworICAgICAgICAgfQorCisgICAgICAgICBoZGRfc29mdGFwX3RraXBfbWljX2ZhaWxfY291bnRlcl9tZWFzdXJlKHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cnF1LT5wYXJhbS52YWx1ZSk7CisgICAgICB9CisgICAgICBicmVhazsKKworICAgICAgZGVmYXVsdDoKKworICAgICAgICAgaGRkTG9nKExPR1csICIlcyBjYWxsZWQgd2l0aCB1bnN1cHBvcnRlZCBhdXRoIHR5cGUgJWQiLCBfX2Z1bmNfXywgCisgICAgICAgICAgICAgICB3cnF1LT5wYXJhbS5mbGFncyAmIElXX0FVVEhfSU5ERVgpOworICAgICAgYnJlYWs7CisgICB9CisKKyAgIEVYSVQoKTsKKyAgIHJldHVybiAwOworfQorCitpbnQgaXdfc2V0X2F1dGhfaG9zdGFwKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsY2hhciAqZXh0cmEpCit7CisgICBpbnQgcmV0OworCisgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgcmV0ID0gX19pd19zZXRfYXV0aF9ob3N0YXAoZGV2LCBpbmZvLCB3cnF1LCBleHRyYSk7CisgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQgX19pd19zZXRfYXBfZW5jb2RlZXh0KHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEhvc3RhcGRBZGFwdGVyOworICAgIHZfQ09OVEVYVF90IHBWb3NDb250ZXh0OworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgaGRkX2FwX2N0eF90ICpwSGRkQXBDdHg7CisgICAgaW50IHJldHZhbCA9IDA7CisgICAgVk9TX1NUQVRVUyB2c3RhdHVzOworICAgIHN0cnVjdCBpd19lbmNvZGVfZXh0ICpleHQgPSAoc3RydWN0IGl3X2VuY29kZV9leHQqKWV4dHJhOworICAgIHZfVThfdCBncm91cG1hY2FkZHJbV05JX0NGR19CU1NJRF9MRU5dID0gezB4RkYsMHhGRiwweEZGLDB4RkYsMHhGRiwweEZGfTsKKyAgICBpbnQga2V5X2luZGV4OworICAgIHN0cnVjdCBpd19wb2ludCAqZW5jb2RpbmcgPSAmd3JxdS0+ZW5jb2Rpbmc7CisgICAgdENzclJvYW1TZXRLZXkgIHNldEtleTsKKy8vICAgIHRDc3JSb2FtUmVtb3ZlS2V5IFJlbW92ZUtleTsKKyAgICBpbnQgaTsKKworICAgIEVOVEVSKCk7CisgICAgcEhvc3RhcGRBZGFwdGVyID0gKG5ldGRldl9wcml2KGRldikpOworICAgIGlmIChOVUxMID09IHBIb3N0YXBkQWRhcHRlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBBZGFwdGVyIGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEhvc3RhcGRBZGFwdGVyKTsKKyAgICByZXR2YWwgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHJldHZhbCkKKyAgICB7CisgICAgICAgIHJldHVybiByZXR2YWw7CisgICAgfQorICAgIHBWb3NDb250ZXh0ID0gcEhkZEN0eC0+cHZvc0NvbnRleHQ7CisgICAgaWYgKE5VTEwgPT0gcFZvc0NvbnRleHQpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogcFZvc0NvbnRleHQgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgcEhkZEFwQ3R4ID0gV0xBTl9IRERfR0VUX0FQX0NUWF9QVFIocEhvc3RhcGRBZGFwdGVyKTsKKyAgICBpZiAoTlVMTCA9PSBwSGRkQXBDdHgpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogQVAgQ29udGV4dCBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIGtleV9pbmRleCA9IGVuY29kaW5nLT5mbGFncyAmIElXX0VOQ09ERV9JTkRFWDsKKworICAgIGlmKGtleV9pbmRleCA+IDApIHsKKworICAgICAgICAgLypDb252ZXJ0IGZyb20gMS1iYXNlZCB0byAwLWJhc2VkIGtleWluZyovCisgICAgICAgIGtleV9pbmRleC0tOworICAgIH0KKyAgICBpZighZXh0LT5rZXlfbGVuKSB7CisjaWYgMAorICAgICAgLypTZXQgdGhlIGVuY3J5dGlvbiB0eXBlIHRvIE5PTkUqLworI2lmIDAKKyAgICAgICBwUm9hbVByb2ZpbGUtPkVuY3J5cHRpb25UeXBlLmVuY3J5cHRpb25UeXBlWzBdID0gZUNTUl9FTkNSWVBUX1RZUEVfTk9ORTsKKyNlbmRpZgorCisgICAgICAgICBSZW1vdmVLZXkua2V5SWQgPSBrZXlfaW5kZXg7CisgICAgICAgICBpZihleHQtPmV4dF9mbGFncyAmIElXX0VOQ09ERV9FWFRfR1JPVVBfS0VZKSB7CisgICAgICAgICAgICAgIC8qS2V5IGRpcmVjdGlvbiBmb3IgZ3JvdXAgaXMgUlggb25seSovCisgICAgICAgICAgICAgdm9zX21lbV9jb3B5KFJlbW92ZUtleS5wZWVyTWFjLGdyb3VwbWFjYWRkcixXTklfQ0ZHX0JTU0lEX0xFTik7CisgICAgICAgICB9CisgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoUmVtb3ZlS2V5LnBlZXJNYWMsZXh0LT5hZGRyLnNhX2RhdGEsV05JX0NGR19CU1NJRF9MRU4pOworICAgICAgICAgfQorICAgICAgICAgc3dpdGNoKGV4dC0+YWxnKQorICAgICAgICAgeworICAgICAgICAgICBjYXNlIElXX0VOQ09ERV9BTEdfTk9ORToKKyAgICAgICAgICAgICAgUmVtb3ZlS2V5LmVuY1R5cGUgPSBlQ1NSX0VOQ1JZUFRfVFlQRV9OT05FOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgY2FzZSBJV19FTkNPREVfQUxHX1dFUDoKKyAgICAgICAgICAgICAgUmVtb3ZlS2V5LmVuY1R5cGUgPSAoZXh0LT5rZXlfbGVuPT0gNSkgPyBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVA0MDplQ1NSX0VOQ1JZUFRfVFlQRV9XRVAxMDQ7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICBjYXNlIElXX0VOQ09ERV9BTEdfVEtJUDoKKyAgICAgICAgICAgICAgUmVtb3ZlS2V5LmVuY1R5cGUgPSBlQ1NSX0VOQ1JZUFRfVFlQRV9US0lQOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgY2FzZSBJV19FTkNPREVfQUxHX0NDTVA6CisgICAgICAgICAgICAgIFJlbW92ZUtleS5lbmNUeXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfQUVTOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICBSZW1vdmVLZXkuZW5jVHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX05PTkU7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgfQorICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIiVzOiBSZW1vdmUga2V5IGNpcGhlcl9hbGc6JWQga2V5X2xlbiVkICpwRW5jcnlwdGlvblR5cGUgOiVkIiwKKyAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sKGludClleHQtPmFsZywoaW50KWV4dC0+a2V5X2xlbixSZW1vdmVLZXkuZW5jVHlwZSk7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXM6IFBlZXIgTWFjID0gIk1BQ19BRERSRVNTX1NUUiwKKyAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIE1BQ19BRERSX0FSUkFZKFJlbW92ZUtleS5wZWVyTWFjKSk7CisgICAgICAgICAgKTsKKyAgICAgICAgIHZzdGF0dXMgPSBXTEFOU0FQX0RlbEtleVN0YSggcFZvc0NvbnRleHQsICZSZW1vdmVLZXkpOworICAgICAgICAgaWYgKCB2c3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUyApCisgICAgICAgICB7CisgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJbJTRkXSBXTEFOU0FQX0RlbGV0ZUtleXNTdGEgcmV0dXJuZWQgRVJST1Igc3RhdHVzPSAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICBfX0xJTkVfXywgdnN0YXR1cyApOworICAgICAgICAgICAgIHJldHZhbCA9IC1FSU5WQUw7CisgICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgIHJldHVybiByZXR2YWw7CisKKyAgICB9CisgICAgCisgICAgdm9zX21lbV96ZXJvKCZzZXRLZXksc2l6ZW9mKHRDc3JSb2FtU2V0S2V5KSk7CisgICAKKyAgICBzZXRLZXkua2V5SWQgPSBrZXlfaW5kZXg7CisgICAgc2V0S2V5LmtleUxlbmd0aCA9IGV4dC0+a2V5X2xlbjsKKyAgIAorICAgIGlmKGV4dC0+a2V5X2xlbiA8PSBDU1JfTUFYX0tFWV9MRU4pIHsKKyAgICAgICB2b3NfbWVtX2NvcHkoJnNldEtleS5LZXlbMF0sZXh0LT5rZXksZXh0LT5rZXlfbGVuKTsKKyAgICB9ICAgCisgICAKKyAgICBpZihleHQtPmV4dF9mbGFncyAmIElXX0VOQ09ERV9FWFRfR1JPVVBfS0VZKSB7CisgICAgICAvKktleSBkaXJlY3Rpb24gZm9yIGdyb3VwIGlzIFJYIG9ubHkqLworICAgICAgIHNldEtleS5rZXlEaXJlY3Rpb24gPSBlU0lSX1JYX09OTFk7CisgICAgICAgdm9zX21lbV9jb3B5KHNldEtleS5wZWVyTWFjLGdyb3VwbWFjYWRkcixXTklfQ0ZHX0JTU0lEX0xFTik7CisgICAgfQorICAgIGVsc2UgeyAgIAorICAgICAgCisgICAgICAgc2V0S2V5LmtleURpcmVjdGlvbiA9ICBlU0lSX1RYX1JYOworICAgICAgIHZvc19tZW1fY29weShzZXRLZXkucGVlck1hYyxleHQtPmFkZHIuc2FfZGF0YSxXTklfQ0ZHX0JTU0lEX0xFTik7CisgICAgfQorICAgIGlmKGV4dC0+ZXh0X2ZsYWdzICYgSVdfRU5DT0RFX0VYVF9TRVRfVFhfS0VZKQorICAgIHsKKyAgICAgICBzZXRLZXkua2V5RGlyZWN0aW9uID0gZVNJUl9UWF9ERUZBVUxUOworICAgICAgIHZvc19tZW1fY29weShzZXRLZXkucGVlck1hYyxleHQtPmFkZHIuc2FfZGF0YSxXTklfQ0ZHX0JTU0lEX0xFTik7CisgICAgfQorIAorICAgIC8qRm9yIHN1cHBsaWNhbnQgcGFlIHJvbGUgaXMgemVybyovCisgICAgc2V0S2V5LnBhZVJvbGUgPSAwOworICAgICAgCisgICAgc3dpdGNoKGV4dC0+YWxnKQorICAgIHsgICAKKyAgICAgICBjYXNlIElXX0VOQ09ERV9BTEdfTk9ORTogICAKKyAgICAgICAgIHNldEtleS5lbmNUeXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfTk9ORTsKKyAgICAgICAgIGJyZWFrOworICAgICAgICAgCisgICAgICAgY2FzZSBJV19FTkNPREVfQUxHX1dFUDoKKyAgICAgICAgIHNldEtleS5lbmNUeXBlID0gKGV4dC0+a2V5X2xlbj09IDUpID8gZUNTUl9FTkNSWVBUX1RZUEVfV0VQNDA6ZUNTUl9FTkNSWVBUX1RZUEVfV0VQMTA0OworICAgICAgICAgcEhkZEFwQ3R4LT51UHJpdmFjeSA9IDE7CisgICAgICAgICBoZGRMb2coTE9HMSwgIiglcykgdVByaXZhY3k9JWQiLCBfX2Z1bmNfXywgcEhkZEFwQ3R4LT51UHJpdmFjeSk7CisgICAgICAgICBicmVhazsKKyAgICAgIAorICAgICAgIGNhc2UgSVdfRU5DT0RFX0FMR19US0lQOgorICAgICAgIHsKKyAgICAgICAgICB2X1U4X3QgKnBLZXkgPSAmc2V0S2V5LktleVswXTsKKyAgCisgICAgICAgICAgc2V0S2V5LmVuY1R5cGUgPSBlQ1NSX0VOQ1JZUFRfVFlQRV9US0lQOworICAKKyAgICAgICAgICB2b3NfbWVtX3plcm8ocEtleSwgQ1NSX01BWF9LRVlfTEVOKTsKKyAgCisgICAgICAgICAgLypTdXBwbGljYW50IHNlbmRzIHRoZSAzMmJ5dGVzIGtleSBpbiB0aGlzIG9yZGVyIAorICAgICAgICAgIAorICAgICAgICAgICAgICAgIHwtLS0tLS0tLS0tLS0tLXwtLS0tLS0tLS0tfC0tLS0tLS0tLS18CisgICAgICAgICAgICAgICAgfCAgIFRrMSAgICAgICAgfFRYLU1JQyAgICB8ICBSWCBNaWMgIHwgCisgICAgICAgICAgICAgICAgfC0tLS0tLS0tLS0tLS0tfC0tLS0tLS0tLS18LS0tLS0tLS0tLXwKKyAgICAgICAgICAgICAgICA8LS0tMTZieXRlcy0tLT48LS04Ynl0ZXMtLT48LS04Ynl0ZXMtLT4KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAqLworICAgICAgICAgIC8qU21lIGV4cGVjdHMgdGhlIDMyIGJ5dGVzIGtleSB0byBiZSBpbiB0aGUgYmVsb3cgb3JkZXIKKyAgCisgICAgICAgICAgICAgICAgfC0tLS0tLS0tLS0tLS0tfC0tLS0tLS0tLS18LS0tLS0tLS0tLXwKKyAgICAgICAgICAgICAgICB8ICAgVGsxICAgICAgICB8UlgtTUlDICAgIHwgIFRYIE1pYyAgfCAKKyAgICAgICAgICAgICAgICB8LS0tLS0tLS0tLS0tLS18LS0tLS0tLS0tLXwtLS0tLS0tLS0tfAorICAgICAgICAgICAgICAgIDwtLS0xNmJ5dGVzLS0tPjwtLThieXRlcy0tPjwtLThieXRlcy0tPgorICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAvKiBDb3B5IHRoZSBUZW1wb3JhbCBLZXkgMSAoVEsxKSAqLworICAgICAgICAgIHZvc19tZW1fY29weShwS2V5LGV4dC0+a2V5LDE2KTsKKyAgICAgICAgICAgCisgICAgICAgICAvKkNvcHkgdGhlIHJ4IG1pYyBmaXJzdCovCisgICAgICAgICAgdm9zX21lbV9jb3B5KCZwS2V5WzE2XSwmZXh0LT5rZXlbMjRdLDgpOyAKKyAgICAgICAgICAKKyAgICAgICAgIC8qQ29weSB0aGUgdHggbWljICovCisgICAgICAgICAgdm9zX21lbV9jb3B5KCZwS2V5WzI0XSwmZXh0LT5rZXlbMTZdLDgpOyAKKyAgCisgICAgICAgfSAgICAgCisgICAgICAgYnJlYWs7CisgICAgICAKKyAgICAgICBjYXNlIElXX0VOQ09ERV9BTEdfQ0NNUDoKKyAgICAgICAgICBzZXRLZXkuZW5jVHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX0FFUzsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgICAKKyAgICAgICBkZWZhdWx0OgorICAgICAgICAgIHNldEtleS5lbmNUeXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfTk9ORTsKKyAgICAgICAgICBicmVhazsKKyAgICB9CisgICAgICAgICAKKyAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICgiJXM6RW5jcnlwdGlvblR5cGU6JWQga2V5X2xlbjolZCwgS2V5SWQ6JWQiKSwgX19mdW5jX18sIHNldEtleS5lbmNUeXBlLCBzZXRLZXkua2V5TGVuZ3RoLAorICAgICAgICAgICAgc2V0S2V5LmtleUlkKTsKKyAgICBmb3IoaT0wOyBpPCBleHQtPmtleV9sZW47IGkrKykKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAoIiUwMngiKSwgc2V0S2V5LktleVtpXSk7ICAgIAorCisgICAgdnN0YXR1cyA9IFdMQU5TQVBfU2V0S2V5U3RhKCBwVm9zQ29udGV4dCwgJnNldEtleSk7CisgICAgaWYgKCB2c3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUyApCisgICAgeworICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiWyU0ZF0gV0xBTlNBUF9TZXRLZXlTdGEgcmV0dXJuZWQgRVJST1Igc3RhdHVzPSAlZCIsIF9fTElORV9fLCB2c3RhdHVzICk7CisgICAgICAgcmV0dmFsID0gLUVJTlZBTDsKKyAgICB9CisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIHJldHZhbDsKK30KKworc3RhdGljIGludCBpd19zZXRfYXBfZW5jb2RlZXh0KHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaW50IHJldDsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX19pd19zZXRfYXBfZW5jb2RlZXh0KGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQgX19pd19zZXRfYXBfbWxtZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyICpleHRyYSkKK3sKKyNpZiAwCisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgPSAobmV0ZGV2X3ByaXYoZGV2KSk7CisgICAgc3RydWN0IGl3X21sbWUgKm1sbWUgPSAoc3RydWN0IGl3X21sbWUgKilleHRyYTsKKyAKKyAgICBFTlRFUigpOyAgICAKKyAgIAorICAgIC8vcmVhc29uX2NvZGUgaXMgdW51c2VkLiBCeSBkZWZhdWx0IGl0IGlzIHNldCB0byBlQ1NSX0RJU0NPTk5FQ1RfUkVBU09OX1VOU1BFQ0lGSUVECisgICAgc3dpdGNoIChtbG1lLT5jbWQpIHsKKyAgICAgICAgY2FzZSBJV19NTE1FX0RJU0FTU09DOgorICAgICAgICBjYXNlIElXX01MTUVfREVBVVRIOgorICAgICAgICAgICAgaGRkTG9nKExPRzEsICJTdGF0aW9uIGRpc2Fzc29jaWF0ZSIpOyAgICAKKyAgICAgICAgICAgIGlmKCBwQWRhcHRlci0+Y29ubl9pbmZvLmNvbm5TdGF0ZSA9PSBlQ29ubmVjdGlvblN0YXRlX0Fzc29jaWF0ZWQgKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBlQ3NyUm9hbURpc2Nvbm5lY3RSZWFzb24gcmVhc29uID0gZUNTUl9ESVNDT05ORUNUX1JFQVNPTl9VTlNQRUNJRklFRDsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBpZiggbWxtZS0+cmVhc29uX2NvZGUgPT0gSEREX1JFQVNPTl9NSUNIQUVMX01JQ19GQUlMVVJFICkKKyAgICAgICAgICAgICAgICAgICAgcmVhc29uID0gZUNTUl9ESVNDT05ORUNUX1JFQVNPTl9NSUNfRVJST1I7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgc3RhdHVzID0gc21lX1JvYW1EaXNjb25uZWN0KCBwQWRhcHRlci0+aEhhbCxwQWRhcHRlci0+c2Vzc2lvbklkLCByZWFzb24pOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIC8vY2xlYXIgYWxsIHRoZSByZWFzb24gY29kZXMKKyAgICAgICAgICAgICAgICBpZiAoc3RhdHVzICE9IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwiJXMgJWQgQ29tbWFuZCBEaXNhc3NvY2lhdGUvRGVhdXRoZW50aWNhdGUgOiBjc3JSb2FtRGlzY29ubmVjdCBmYWlsdXJlIHJldHVybmVkICVkIiwgX19mdW5jX18sIChpbnQpbWxtZS0+Y21kLCAoaW50KXN0YXR1cyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgbmV0aWZfc3RvcF9xdWV1ZShkZXYpOworICAgICAgICAgICAgICAgbmV0aWZfY2Fycmllcl9vZmYoZGV2KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwiJXMgJWQgQ29tbWFuZCBEaXNhc3NvY2lhdGUvRGVhdXRoZW50aWNhdGUgY2FsbGVkIGJ1dCBzdGF0aW9uIGlzIG5vdCBpbiBhc3NvY2lhdGVkIHN0YXRlIiwgX19mdW5jX18sIChpbnQpbWxtZS0+Y21kKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGhkZExvZyhMT0dFLCIlcyAlZCBDb21tYW5kIHNob3VsZCBiZSBEaXNhc3NvY2lhdGUvRGVhdXRoZW50aWNhdGUiLCBfX2Z1bmNfXywgKGludCltbG1lLT5jbWQpOworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfS8vZW5kIG9mIHN3aXRjaAorICAgIEVYSVQoKTsKKyNlbmRpZiAgICAKKyAgICByZXR1cm4gMDsKKy8vICAgIHJldHVybiBzdGF0dXM7Cit9CisKK3N0YXRpYyBpbnQgaXdfc2V0X2FwX21sbWUoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhciAqZXh0cmEpCit7CisgICBpbnQgcmV0OworCisgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgcmV0ID0gX19pd19zZXRfYXBfbWxtZShkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBfX2l3X2dldF9hcF9ydHNfdGhyZXNob2xkKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgIGhkZF9hZGFwdGVyX3QgKnBIb3N0YXBkQWRhcHRlciA9IChuZXRkZXZfcHJpdihkZXYpKTsKKyAgIHZfVTMyX3Qgc3RhdHVzID0gMDsKKworICAgc3RhdHVzID0gaGRkX3dsYW5fZ2V0X3J0c190aHJlc2hvbGQocEhvc3RhcGRBZGFwdGVyLCB3cnF1KTsKKworICAgcmV0dXJuIHN0YXR1czsKK30KKworc3RhdGljIGludCBpd19nZXRfYXBfcnRzX3RocmVzaG9sZChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgIGludCByZXQ7CisKKyAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICByZXQgPSBfX2l3X2dldF9hcF9ydHNfdGhyZXNob2xkKGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IF9faXdfZ2V0X2FwX2ZyYWdfdGhyZXNob2xkKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGhkZF9hZGFwdGVyX3QgKnBIb3N0YXBkQWRhcHRlciA9IChuZXRkZXZfcHJpdihkZXYpKTsKKyAgICB2X1UzMl90IHN0YXR1cyA9IDA7CisKKyAgICBzdGF0dXMgPSBoZGRfd2xhbl9nZXRfZnJhZ190aHJlc2hvbGQocEhvc3RhcGRBZGFwdGVyLCB3cnF1KTsKKworICAgIHJldHVybiBzdGF0dXM7Cit9CisKK3N0YXRpYyBpbnQgaXdfZ2V0X2FwX2ZyYWdfdGhyZXNob2xkKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaW50IHJldDsKKworICAgIHZvc19zc3JfcHJ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2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgaWYgKDAgIT0gcmV0KQorICAgeworICAgICAgIHJldHVybiByZXQ7CisgICB9CisgICBwSG9zdGFwZFN0YXRlID0gV0xBTl9IRERfR0VUX0hPU1RBUF9TVEFURV9QVFIocEhvc3RhcGRBZGFwdGVyKTsKKyAgIGlmIChOVUxMID09IHBIb3N0YXBkU3RhdGUpCisgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogcEhvc3RhcGRTdGF0ZSBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICB9CisgICBoSGFsID0gV0xBTl9IRERfR0VUX0hBTF9DVFgocEhvc3RhcGRBZGFwdGVyKTsKKyAgIGlmIChOVUxMID09IGhIYWwpCisgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogSGFsIENvbnRleHQgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgfQorICAgcEhkZEFwQ3R4ID0gV0xBTl9IRERfR0VUX0FQX0NUWF9QVFIocEhvc3RhcGRBZGFwdGVyKTsKKyAgIGlmIChOVUxMID09IHBIZGRBcEN0eCkKKyAgIHsKKyAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBBUCBjb250ZXh0IGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgIH0KKyAgIGlmKHBIb3N0YXBkU3RhdGUtPmJzc1N0YXRlID09IEJTU19TVE9QICkKKyAgIHsKKyAgICAgICB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pOworICAgICAgIGlmKCBUUlVFID09IHN0YXR1cykKKyAgICAgICB7CisgICAgICAgICAgLyogU2V0IEV4cG9uZW50IHBhcmFtZXRlciBhcyA2IChNSFopIGluIHN0cnVjdCBpd19mcmVxCisgICAgICAgICAgICogaXdsaXN0ICYgaXdjb25maWcgY29tbWFuZCBzaG93cyBmcmVxdWVuY3kgaW50byBwcm9wZXIKKyAgICAgICAgICAgKiBmb3JtYXQgKDIuNDEyIEdIeiBpbnN0ZWFkIG9mIDI0Ni4yIE1IeikqLworICAgICAgICAgICBmd3JxLT5tID0gZnJlcTsKKyAgICAgICAgICAgZndycS0+ZSA9IE1IWjsKKyAgICAgICB9CisgICAgfQorCisgICAgRVhJVCgpOworICAgIHJldHVybiAwOworfQorCitzdGF0aWMgaW50IGl3X2dldF9hcF9mcmVxKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19mcmVxICpmd3JxLCBjaGFyICpleHRyYSkKK3sKKyAgIGludCByZXQ7CisKKyAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICByZXQgPSBfX2l3X2dldF9hcF9mcmVxKGRldiwgaW5mbywgZndycSwgZXh0cmEpOworICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IF9faXdfZ2V0X21vZGUoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGludCBzdGF0dXMgPSAwOworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisKKyAgICBFTlRFUigpOworCisgICAgcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgICBpZiAoTlVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBBZGFwdGVyIGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICBzdGF0dXMgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHN0YXR1cykKKyAgICB7CisgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgfQorCisgICAgd3JxdS0+bW9kZSA9IElXX01PREVfTUFTVEVSOworCisgICAgRVhJVCgpOworICAgIHJldHVybiBzdGF0dXM7Cit9CisKK3N0YXRpYyBpbnQgaXdfZ2V0X21vZGUoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaW50IHJldDsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX19pd19nZXRfbW9kZShkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IF9faXdfc29mdGFwX3NldHdwc2llKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgKmV4dHJhKQoreworICAgaGRkX2FkYXB0ZXJfdCAqcEhvc3RhcGRBZGFwdGVyOworICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgIHZfQ09OVEVYVF90IHBWb3NDb250ZXh0OworICAgaGRkX2hvc3RhcGRfc3RhdGVfdCAqcEhvc3RhcGRTdGF0ZTsKKyAgIGVIYWxTdGF0dXMgaGFsU3RhdHVzPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgdV9pbnQ4X3QgKndwc19nZW5pZTsKKyAgIHVfaW50OF90ICpmd3BzX2dlbmllOworICAgdV9pbnQ4X3QgKnBvczsKKyAgIHRwU2FwX1dQU0lFIHBTYXBfV1BTSWU7CisgICB1X2ludDhfdCBXUFNJZVR5cGU7CisgICB1X2ludDE2X3QgbGVuZ3RoOworICAgc3RydWN0IGl3X3BvaW50IHNfcHJpdl9kYXRhOworICAgaW50IHJldCA9IDA7CisKKyAgIEVOVEVSKCk7CisKKyAgIGlmICghY2FwYWJsZShDQVBfTkVUX0FETUlOKSkKKyAgIHsKKyAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgRkwoInBlcm1pc3Npb24gY2hlY2sgZmFpbGVkIikpOworICAgICAgIHJldHVybiAtRVBFUk07CisgICB9CisKKyAgIHBIb3N0YXBkQWRhcHRlciA9IChuZXRkZXZfcHJpdihkZXYpKTsKKyAgIGlmIChOVUxMID09IHBIb3N0YXBkQWRhcHRlcikKKyAgIHsKKyAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBBZGFwdGVyIGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgIH0KKyAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBIb3N0YXBkQWRhcHRlcik7CisgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgaWYgKDAgIT0gcmV0KQorICAgeworICAgICAgIHJldHVybiByZXQ7CisgICB9CisgICBwVm9zQ29udGV4dCA9IHBIZGRDdHgtPnB2b3NDb250ZXh0OworICAgaWYgKE5VTEwgPT0gcFZvc0NvbnRleHQpCisgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogSEREIGNvbnRleHQgaXMgbm90IHZhbGlkICIsX19mdW5jX18pOworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgfQorICAgLyogaGVscGVyIGZ1bmN0aW9uIHRvIGdldCBpd3JlcV9kYXRhIHdpdGggY29tcGF0IGhhbmRsaW5nLiAqLworICAgaWYgKGhkZF9wcml2X2dldF9kYXRhKCZzX3ByaXZfZGF0YSwgd3JxdSkpCisgICB7CisgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgIH0KKworICAgaWYgKChOVUxMID09IHNfcHJpdl9kYXRhLnBvaW50ZXIpIHx8IChzX3ByaXZfZGF0YS5sZW5ndGggPCBRQ1NBUF9NQVhfV1NDX0lFKSkKKyAgIHsKKyAgICAgIHJldHVybiAtRUlOVkFMOworICAgfQorCisgICB3cHNfZ2VuaWUgPSBtZW1fYWxsb2NfY29weV9mcm9tX3VzZXJfaGVscGVyKHNfcHJpdl9kYXRhLnBvaW50ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNfcHJpdl9kYXRhLmxlbmd0aCk7CisKKyAgIGlmKE5VTEwgPT0gd3BzX2dlbmllKQorICAgeworICAgICAgIGhkZExvZyhMT0cxLCAiJXM6IGZhaWxlZCB0byBhbGxvYyBtZW1vcnkgIgorICAgICAgICAgICAgICAgICAgICAiYW5kIGNvcHkgZGF0YSBmcm9tIHVzZXIgYnVmZmVyIiwgX19mdW5jX18pOworICAgICAgIHJldHVybiAtRUZBVUxUOworICAgfQorCisgICBmd3BzX2dlbmllID0gd3BzX2dlbmllOworCisgICBwU2FwX1dQU0llID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRTYXBfV1BTSUUpKTsKKyAgIGlmIChOVUxMID09IHBTYXBfV1BTSWUpIAorICAgeworICAgICAgaGRkTG9nKExPR0UsICJWT1MgdW5hYmxlIHRvIGFsbG9jYXRlIG1lbW9yeSIpOworICAgICAga2ZyZWUoZndwc19nZW5pZSk7CisgICAgICByZXR1cm4gLUVOT01FTTsKKyAgIH0KKyAgIHZvc19tZW1femVybyhwU2FwX1dQU0llLCBzaXplb2YodFNhcF9XUFNJRSkpOworIAorICAgaGRkTG9nKExPRzEsIiVzIFdQUyBJRSB0eXBlWzB4JVhdIElFWzB4JVhdLCBMRU5bJWRdIiwgX19mdW5jX18sIHdwc19nZW5pZVswXSwgd3BzX2dlbmllWzFdLCB3cHNfZ2VuaWVbMl0pOworICAgV1BTSWVUeXBlID0gd3BzX2dlbmllWzBdOworICAgaWYgKCB3cHNfZ2VuaWVbMF0gPT0gZVFDX1dQU19CRUFDT05fSUUpCisgICB7CisgICAgICBwU2FwX1dQU0llLT5zYXBXUFNJRUNvZGUgPSBlU0FQX1dQU19CRUFDT05fSUU7IAorICAgICAgd3BzX2dlbmllID0gd3BzX2dlbmllICsgMTsKKyAgICAgIHN3aXRjaCAoIHdwc19nZW5pZVswXSApIAorICAgICAgeworICAgICAgICAgY2FzZSBET1QxMUZfRUlEX1dQQTogCisgICAgICAgICAgICBpZiAod3BzX2dlbmllWzFdIDwgMiArIDQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAobWVtY21wKCZ3cHNfZ2VuaWVbMl0sICJceDAwXHg1MFx4ZjJceDA0IiwgNCkgPT0gMCkgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgaGRkTG9nIChMT0cxLCAiJXMgU2V0IFdQUyBCRUFDT04gSUUobGVuICVkKSIsX19mdW5jX18sIHdwc19nZW5pZVsxXSsyKTsKKyAgICAgICAgICAgICBwb3MgPSAmd3BzX2dlbmllWzZdOworICAgICAgICAgICAgIHdoaWxlICgoKHNpemVfdClwb3MgLSAoc2l6ZV90KSZ3cHNfZ2VuaWVbNl0pICA8ICh3cHNfZ2VuaWVbMV0gLSA0KSApCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN3aXRjaCgodV9pbnQxNl90KSgqcG9zPDw4KSB8ICoocG9zKzEpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBjYXNlIEhERF9XUFNfRUxFTV9WRVJTSU9OOgorICAgICAgICAgICAgICAgICAgICAgIHBvcyArPSA0OworICAgICAgICAgICAgICAgICAgICAgIHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU0JlYWNvbklFLlZlcnNpb24gPSAqcG9zOyAgIAorICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0cxLCAiV1BTIHZlcnNpb24gJWQiLCBwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNCZWFjb25JRS5WZXJzaW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICBwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNCZWFjb25JRS5GaWVsZFByZXNlbnQgfD0gV1BTX0JFQUNPTl9WRVJfUFJFU0VOVDsgICAKKyAgICAgICAgICAgICAgICAgICAgICBwb3MgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICBjYXNlIEhERF9XUFNfRUxFTV9XUFNfU1RBVEU6CisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9NDsKKyAgICAgICAgICAgICAgICAgICAgICBwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNCZWFjb25JRS53cHNTdGF0ZSA9ICpwb3M7CisgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKExPRzEsICJXUFMgU3RhdGUgJWQiLCBwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNCZWFjb25JRS53cHNTdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgICAgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTQmVhY29uSUUuRmllbGRQcmVzZW50IHw9IFdQU19CRUFDT05fU1RBVEVfUFJFU0VOVDsKKyAgICAgICAgICAgICAgICAgICAgICBwb3MgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICBjYXNlIEhERF9XUFNfRUxFTV9BUFNFVFVQTE9DSzoKKyAgICAgICAgICAgICAgICAgICAgICBwb3MgKz0gNDsKKyAgICAgICAgICAgICAgICAgICAgICBwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNCZWFjb25JRS5BUFNldHVwTG9ja2VkID0gKnBvczsKKyAgICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HMSwgIkFQIHNldHVwIGxvY2sgJWQiLCBwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNCZWFjb25JRS5BUFNldHVwTG9ja2VkKTsKKyAgICAgICAgICAgICAgICAgICAgICBwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNCZWFjb25JRS5GaWVsZFByZXNlbnQgfD0gV1BTX0JFQUNPTl9BUFNFVFVQTE9DS19QUkVTRU5UOworICAgICAgICAgICAgICAgICAgICAgIHBvcyArPSAxOworICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgIGNhc2UgSEREX1dQU19FTEVNX1NFTEVDVEVEUkVHSVNUUkE6CisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IDQ7CisgICAgICAgICAgICAgICAgICAgICAgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTQmVhY29uSUUuU2VsZWN0ZWRSZWdpc3RyYSA9ICpwb3M7CisgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKExPRzEsICJTZWxlY3RlZCBSZWdpc3RyYSAlZCIsIHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU0JlYWNvbklFLlNlbGVjdGVkUmVnaXN0cmEpOworICAgICAgICAgICAgICAgICAgICAgIHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU0JlYWNvbklFLkZpZWxkUHJlc2VudCB8PSBXUFNfQkVBQ09OX1NFTEVDVEVEUkVHSVNUUkFfUFJFU0VOVDsKKyAgICAgICAgICAgICAgICAgICAgICBwb3MgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICBjYXNlIEhERF9XUFNfRUxFTV9ERVZJQ0VfUEFTU1dPUkRfSUQ6CisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IDQ7CisgICAgICAgICAgICAgICAgICAgICAgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTQmVhY29uSUUuRGV2aWNlUGFzc3dvcmRJRCA9ICgqcG9zPDw4KSB8ICoocG9zKzEpOworICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0cxLCAiUGFzc3dvcmQgSUQ6ICV4IiwgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTQmVhY29uSUUuRGV2aWNlUGFzc3dvcmRJRCk7CisgICAgICAgICAgICAgICAgICAgICAgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTQmVhY29uSUUuRmllbGRQcmVzZW50IHw9IFdQU19CRUFDT05fREVWSUNFUEFTU1dPUkRJRF9QUkVTRU5UOworICAgICAgICAgICAgICAgICAgICAgIHBvcyArPSAyOyAKKyAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICBjYXNlIEhERF9XUFNfRUxFTV9SRUdJU1RSQV9DT05GX01FVEhPRFM6CisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IDQ7CisgICAgICAgICAgICAgICAgICAgICAgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTQmVhY29uSUUuU2VsZWN0ZWRSZWdpc3RyYUNmZ01ldGhvZCA9ICgqcG9zPDw4KSB8ICoocG9zKzEpOworICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0cxLCAiU2VsZWN0IFJlZ2lzdHJhIENvbmZpZyBNZXRob2RzOiAleCIsIHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU0JlYWNvbklFLlNlbGVjdGVkUmVnaXN0cmFDZmdNZXRob2QpOworICAgICAgICAgICAgICAgICAgICAgIHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU0JlYWNvbklFLkZpZWxkUHJlc2VudCB8PSBXUFNfQkVBQ09OX1NFTEVDVEVEUkVHSVNUUkFDRkdNRVRIT0RfUFJFU0VOVDsKKyAgICAgICAgICAgICAgICAgICAgICBwb3MgKz0gMjsgCisgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgY2FzZSBIRERfV1BTX0VMRU1fVVVJRF9FOgorICAgICAgICAgICAgICAgICAgICAgIHBvcyArPSAyOyAKKyAgICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSAqcG9zPDw4IHwgKihwb3MrMSk7CisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IDI7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKGxlbmd0aCA+IHNpemVvZihwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNCZWFjb25JRS5VVUlEX0UpKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTQmVhY29uSUUuVVVJRF9FLCBwb3MsIGxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgICAgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTQmVhY29uSUUuRmllbGRQcmVzZW50IHw9IFdQU19CRUFDT05fVVVJREVfUFJFU0VOVDsgCisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IGxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICBjYXNlIEhERF9XUFNfRUxFTV9SRl9CQU5EUzoKKyAgICAgICAgICAgICAgICAgICAgICBwb3MgKz0gNDsKKyAgICAgICAgICAgICAgICAgICAgICBwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNCZWFjb25JRS5SRkJhbmQgPSAqcG9zOworICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0cxLCAiUkYgYmFuZDogJWQiLCBwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNCZWFjb25JRS5SRkJhbmQpOworICAgICAgICAgICAgICAgICAgICAgIHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU0JlYWNvbklFLkZpZWxkUHJlc2VudCB8PSBXUFNfQkVBQ09OX1JGX0JBTkRTX1BSRVNFTlQ7CisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IDE7CisgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICBoZGRMb2cgKExPR1csICJVTktOT1dOIFRMViBpbiBXUFMgSUUoJXgpIiwgKCpwb3M8PDggfCAqKHBvcysxKSkpOworICAgICAgICAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfSAgCisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIHsgCisgICAgICAgICAgICAgICAgIGhkZExvZyAoTE9HRSwgIiVzIFdQUyBJRSBNaXNtYXRjaCAlWCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHdwc19nZW5pZVswXSk7CisgICAgICAgICAgICB9ICAgICAKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAKKyAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBoZGRMb2cgKExPR0UsICIlcyBTZXQgVU5LTk9XTiBJRSAlWCIsX19mdW5jX18sIHdwc19nZW5pZVswXSk7CisgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgZ290byBleGl0OworICAgICAgfQorICAgIH0gCisgICAgZWxzZSBpZiggd3BzX2dlbmllWzBdID09IGVRQ19XUFNfUFJPQkVfUlNQX0lFKQorICAgIHsKKyAgICAgIHBTYXBfV1BTSWUtPnNhcFdQU0lFQ29kZSA9IGVTQVBfV1BTX1BST0JFX1JTUF9JRTsgCisgICAgICB3cHNfZ2VuaWUgPSB3cHNfZ2VuaWUgKyAxOworICAgICAgc3dpdGNoICggd3BzX2dlbmllWzBdICkgCisgICAgICB7CisgICAgICAgICBjYXNlIERPVDExRl9FSURfV1BBOiAKKyAgICAgICAgICAgIGlmICh3cHNfZ2VuaWVbMV0gPCAyICsgNCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKG1lbWNtcCgmd3BzX2dlbmllWzJdLCAiXHgwMFx4NTBceGYyXHgwNCIsIDQpID09IDApIAorICAgICAgICAgICAgeworICAgICAgICAgICAgIGhkZExvZyAoTE9HMSwgIiVzIFNldCBXUFMgUFJPQkUgUlNQIElFKGxlbiAlZCkiLF9fZnVuY19fLCB3cHNfZ2VuaWVbMV0rMik7CisgICAgICAgICAgICAgcG9zID0gJndwc19nZW5pZVs2XTsKKyAgICAgICAgICAgICB3aGlsZSAoKChzaXplX3QpcG9zIC0gKHNpemVfdCkmd3BzX2dlbmllWzZdKSAgPCAod3BzX2dlbmllWzFdIC0gNCkgKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgc3dpdGNoKCh1X2ludDE2X3QpKCpwb3M8PDgpIHwgKihwb3MrMSkpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBjYXNlIEhERF9XUFNfRUxFTV9WRVJTSU9OOgorICAgICAgICAgICAgICAgICAgICAgIHBvcyArPSA0OworICAgICAgICAgICAgICAgICAgICAgIHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUuVmVyc2lvbiA9ICpwb3M7ICAgCisgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKExPRzEsICJXUFMgdmVyc2lvbiAlZCIsIHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUuVmVyc2lvbik7CisgICAgICAgICAgICAgICAgICAgICAgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTUHJvYmVSc3BJRS5GaWVsZFByZXNlbnQgfD0gV1BTX1BST0JSU1BfVkVSX1BSRVNFTlQ7ICAgCisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IDE7CisgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgY2FzZSBIRERfV1BTX0VMRU1fV1BTX1NUQVRFOgorICAgICAgICAgICAgICAgICAgICAgIHBvcyArPTQ7CisgICAgICAgICAgICAgICAgICAgICAgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTUHJvYmVSc3BJRS53cHNTdGF0ZSA9ICpwb3M7CisgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKExPRzEsICJXUFMgU3RhdGUgJWQiLCBwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNQcm9iZVJzcElFLndwc1N0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgICBwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNQcm9iZVJzcElFLkZpZWxkUHJlc2VudCB8PSBXUFNfUFJPQlJTUF9TVEFURV9QUkVTRU5UOworICAgICAgICAgICAgICAgICAgICAgIHBvcyArPSAxOworICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgIGNhc2UgSEREX1dQU19FTEVNX0FQU0VUVVBMT0NLOgorICAgICAgICAgICAgICAgICAgICAgIHBvcyArPSA0OworICAgICAgICAgICAgICAgICAgICAgIHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUuQVBTZXR1cExvY2tlZCA9ICpwb3M7CisgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKExPRzEsICJBUCBzZXR1cCBsb2NrICVkIiwgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTUHJvYmVSc3BJRS5BUFNldHVwTG9ja2VkKTsKKyAgICAgICAgICAgICAgICAgICAgICBwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNQcm9iZVJzcElFLkZpZWxkUHJlc2VudCB8PSBXUFNfUFJPQlJTUF9BUFNFVFVQTE9DS19QUkVTRU5UOworICAgICAgICAgICAgICAgICAgICAgIHBvcyArPSAxOworICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgIGNhc2UgSEREX1dQU19FTEVNX1NFTEVDVEVEUkVHSVNUUkE6CisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IDQ7CisgICAgICAgICAgICAgICAgICAgICAgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTUHJvYmVSc3BJRS5TZWxlY3RlZFJlZ2lzdHJhID0gKnBvczsKKyAgICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HMSwgIlNlbGVjdGVkIFJlZ2lzdHJhICVkIiwgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTUHJvYmVSc3BJRS5TZWxlY3RlZFJlZ2lzdHJhKTsKKyAgICAgICAgICAgICAgICAgICAgICBwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNQcm9iZVJzcElFLkZpZWxkUHJlc2VudCB8PSBXUFNfUFJPQlJTUF9TRUxFQ1RFRFJFR0lTVFJBX1BSRVNFTlQ7ICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgIHBvcyArPSAxOworICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgIGNhc2UgSEREX1dQU19FTEVNX0RFVklDRV9QQVNTV09SRF9JRDoKKyAgICAgICAgICAgICAgICAgICAgICBwb3MgKz0gNDsKKyAgICAgICAgICAgICAgICAgICAgICBwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNQcm9iZVJzcElFLkRldmljZVBhc3N3b3JkSUQgPSAoKnBvczw8OCkgfCAqKHBvcysxKTsKKyAgICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HMSwgIlBhc3N3b3JkIElEOiAlZCIsIHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUuRGV2aWNlUGFzc3dvcmRJRCk7CisgICAgICAgICAgICAgICAgICAgICAgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTUHJvYmVSc3BJRS5GaWVsZFByZXNlbnQgfD0gV1BTX1BST0JSU1BfREVWSUNFUEFTU1dPUkRJRF9QUkVTRU5UOworICAgICAgICAgICAgICAgICAgICAgIHBvcyArPSAyOyAKKyAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICBjYXNlIEhERF9XUFNfRUxFTV9SRUdJU1RSQV9DT05GX01FVEhPRFM6CisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IDQ7CisgICAgICAgICAgICAgICAgICAgICAgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTUHJvYmVSc3BJRS5TZWxlY3RlZFJlZ2lzdHJhQ2ZnTWV0aG9kID0gKCpwb3M8PDgpIHwgKihwb3MrMSk7CisgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKExPRzEsICJTZWxlY3QgUmVnaXN0cmEgQ29uZmlnIE1ldGhvZHM6ICV4IiwgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTUHJvYmVSc3BJRS5TZWxlY3RlZFJlZ2lzdHJhQ2ZnTWV0aG9kKTsKKyAgICAgICAgICAgICAgICAgICAgICBwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNQcm9iZVJzcElFLkZpZWxkUHJlc2VudCB8PSBXUFNfUFJPQlJTUF9TRUxFQ1RFRFJFR0lTVFJBQ0ZHTUVUSE9EX1BSRVNFTlQ7CisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IDI7IAorICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgY2FzZSBIRERfV1BTX0VMRU1fUlNQX1RZUEU6CisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IDQ7CisgICAgICAgICAgICAgICAgICAgICAgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTUHJvYmVSc3BJRS5SZXNwb25zZVR5cGUgPSAqcG9zOworICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0cxLCAiQ29uZmlnIE1ldGhvZHM6ICVkIiwgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTUHJvYmVSc3BJRS5SZXNwb25zZVR5cGUpOworICAgICAgICAgICAgICAgICAgICAgIHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUuRmllbGRQcmVzZW50IHw9IFdQU19QUk9CUlNQX1JFU1BPTlNFVFlQRV9QUkVTRU5UOworICAgICAgICAgICAgICAgICAgICAgIHBvcyArPSAxOworICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgIGNhc2UgSEREX1dQU19FTEVNX1VVSURfRToKKyAgICAgICAgICAgICAgICAgICAgICBwb3MgKz0gMjsgCisgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gKnBvczw8OCB8ICoocG9zKzEpOworICAgICAgICAgICAgICAgICAgICAgIHBvcyArPSAyOworICAgICAgICAgICAgICAgICAgICAgIGlmIChsZW5ndGggPiAoc2l6ZW9mKHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUuVVVJRF9FKSkpCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNQcm9iZVJzcElFLlVVSURfRSwgcG9zLCBsZW5ndGgpOworICAgICAgICAgICAgICAgICAgICAgIHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUuRmllbGRQcmVzZW50IHw9IFdQU19QUk9CUlNQX1VVSURFX1BSRVNFTlQ7CisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IGxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICBjYXNlIEhERF9XUFNfRUxFTV9NQU5VRkFDVFVSRVI6CisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IDI7CisgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gKnBvczw8OCB8ICoocG9zKzEpOworICAgICAgICAgICAgICAgICAgICAgIHBvcyArPSAyOworICAgICAgICAgICAgICAgICAgICAgIGlmIChsZW5ndGggPiAgKHNpemVvZihwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNQcm9iZVJzcElFLk1hbnVmYWN0dXJlLm5hbWUpKSkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTUHJvYmVSc3BJRS5NYW51ZmFjdHVyZS5udW1fbmFtZSA9IGxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTUHJvYmVSc3BJRS5NYW51ZmFjdHVyZS5uYW1lLCBwb3MsIGxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgICAgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTUHJvYmVSc3BJRS5GaWVsZFByZXNlbnQgfD0gV1BTX1BST0JSU1BfTUFOVUZBQ1RVUkVfUFJFU0VOVDsKKyAgICAgICAgICAgICAgICAgICAgICBwb3MgKz0gbGVuZ3RoOworICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworIAorICAgICAgICAgICAgICAgICAgIGNhc2UgSEREX1dQU19FTEVNX01PREVMX05BTUU6CisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IDI7CisgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gKnBvczw8OCB8ICoocG9zKzEpOworICAgICAgICAgICAgICAgICAgICAgIHBvcyArPSAyOworICAgICAgICAgICAgICAgICAgICAgIGlmIChsZW5ndGggPiAoc2l6ZW9mKHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUuTW9kZWxOYW1lLnRleHQpKSkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTUHJvYmVSc3BJRS5Nb2RlbE5hbWUubnVtX3RleHQgPSBsZW5ndGg7CisgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUuTW9kZWxOYW1lLnRleHQsIHBvcywgbGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICAgICBwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNQcm9iZVJzcElFLkZpZWxkUHJlc2VudCB8PSBXUFNfUFJPQlJTUF9NT0RFTE5BTUVfUFJFU0VOVDsKKyAgICAgICAgICAgICAgICAgICAgICBwb3MgKz0gbGVuZ3RoOworICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgIGNhc2UgSEREX1dQU19FTEVNX01PREVMX05VTToKKyAgICAgICAgICAgICAgICAgICAgICBwb3MgKz0gMjsKKyAgICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSAqcG9zPDw4IHwgKihwb3MrMSk7CisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IDI7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKGxlbmd0aCA+IChzaXplb2YocFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTUHJvYmVSc3BJRS5Nb2RlbE51bWJlci50ZXh0KSkpCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUuTW9kZWxOdW1iZXIubnVtX3RleHQgPSBsZW5ndGg7CisgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUuTW9kZWxOdW1iZXIudGV4dCwgcG9zLCBsZW5ndGgpOworICAgICAgICAgICAgICAgICAgICAgIHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUuRmllbGRQcmVzZW50IHw9IFdQU19QUk9CUlNQX01PREVMTlVNQkVSX1BSRVNFTlQ7CisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IGxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICBjYXNlIEhERF9XUFNfRUxFTV9TRVJJQUxfTlVNOgorICAgICAgICAgICAgICAgICAgICAgIHBvcyArPSAyOworICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9ICpwb3M8PDggfCAqKHBvcysxKTsKKyAgICAgICAgICAgICAgICAgICAgICBwb3MgKz0gMjsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAobGVuZ3RoID4gKHNpemVvZihwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNQcm9iZVJzcElFLlNlcmlhbE51bWJlci50ZXh0KSkpCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUuU2VyaWFsTnVtYmVyLm51bV90ZXh0ID0gbGVuZ3RoOworICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNQcm9iZVJzcElFLlNlcmlhbE51bWJlci50ZXh0LCBwb3MsIGxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgICAgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTUHJvYmVSc3BJRS5GaWVsZFByZXNlbnQgfD0gV1BTX1BST0JSU1BfU0VSSUFMTlVNQkVSX1BSRVNFTlQ7CisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IGxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICBjYXNlIEhERF9XUFNfRUxFTV9QUklNQVJZX0RFVklDRV9UWVBFOgorICAgICAgICAgICAgICAgICAgICAgIHBvcyArPSA0OworICAgICAgICAgICAgICAgICAgICAgIHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUuUHJpbWFyeURldmljZUNhdGVnb3J5ID0gKCpwb3M8PDggfCAqKHBvcysxKSk7CisgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKExPRzEsICJwcmltYXJ5IGRldiBjYXRlZ29yeTogJWQiLCBwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNQcm9iZVJzcElFLlByaW1hcnlEZXZpY2VDYXRlZ29yeSk7CisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IDI7CisgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUuUHJpbWFyeURldmljZU9VSSwgcG9zLCBIRERfV1BTX0RFVklDRV9PVUlfTEVOKTsKKyAgICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HMSwgInByaW1hcnkgZGV2IG91aTogJTAyeCwgJTAyeCwgJTAyeCwgJTAyeCIsIHBvc1swXSwgcG9zWzFdLCBwb3NbMl0sIHBvc1szXSk7CisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IDQ7CisgICAgICAgICAgICAgICAgICAgICAgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTUHJvYmVSc3BJRS5EZXZpY2VTdWJDYXRlZ29yeSA9ICgqcG9zPDw4IHwgKihwb3MrMSkpOworICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0cxLCAicHJpbWFyeSBkZXYgc3ViIGNhdGVnb3J5OiAlZCIsIHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUuRGV2aWNlU3ViQ2F0ZWdvcnkpOworICAgICAgICAgICAgICAgICAgICAgIHBvcyArPSAyOworICAgICAgICAgICAgICAgICAgICAgIHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUuRmllbGRQcmVzZW50IHw9IFdQU19QUk9CUlNQX1BSSU1BUllERVZJQ0VUWVBFX1BSRVNFTlQ7ICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgIGNhc2UgSEREX1dQU19FTEVNX0RFVklDRV9OQU1FOgorICAgICAgICAgICAgICAgICAgICAgIHBvcyArPSAyOworICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9ICpwb3M8PDggfCAqKHBvcysxKTsKKyAgICAgICAgICAgICAgICAgICAgICBwb3MgKz0gMjsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAobGVuZ3RoID4gKHNpemVvZihwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNQcm9iZVJzcElFLkRldmljZU5hbWUudGV4dCkpKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICBwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNQcm9iZVJzcElFLkRldmljZU5hbWUubnVtX3RleHQgPSBsZW5ndGg7CisgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUuRGV2aWNlTmFtZS50ZXh0LCBwb3MsIGxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IGxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICBwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNQcm9iZVJzcElFLkZpZWxkUHJlc2VudCB8PSBXUFNfUFJPQlJTUF9ERVZJQ0VOQU1FX1BSRVNFTlQ7CisgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgY2FzZSBIRERfV1BTX0VMRU1fQ09ORklHX01FVEhPRFM6CisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IDQ7CisgICAgICAgICAgICAgICAgICAgICAgcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTUHJvYmVSc3BJRS5Db25maWdNZXRob2QgPSAoKnBvczw8OCkgfCAqKHBvcysxKTsKKyAgICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HMSwgIkNvbmZpZyBNZXRob2RzOiAlZCIsIHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUuU2VsZWN0ZWRSZWdpc3RyYUNmZ01ldGhvZCk7CisgICAgICAgICAgICAgICAgICAgICAgcG9zICs9IDI7IAorICAgICAgICAgICAgICAgICAgICAgIHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUuRmllbGRQcmVzZW50IHw9IFdQU19QUk9CUlNQX0NPTkZJR01FVEhPRFNfUFJFU0VOVDsKKyAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAKKyAgICAgICAgICAgICAgICAgICBjYXNlIEhERF9XUFNfRUxFTV9SRl9CQU5EUzoKKyAgICAgICAgICAgICAgICAgICAgICBwb3MgKz0gNDsKKyAgICAgICAgICAgICAgICAgICAgICBwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNQcm9iZVJzcElFLlJGQmFuZCA9ICpwb3M7CisgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKExPRzEsICJSRiBiYW5kOiAlZCIsIHBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUuUkZCYW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICBwb3MgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgICBwU2FwX1dQU0llLT5zYXB3cHNpZS5zYXBXUFNQcm9iZVJzcElFLkZpZWxkUHJlc2VudCB8PSBXUFNfUFJPQlJTUF9SRl9CQU5EU19QUkVTRU5UOworICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICB9ICAvLyBzd2l0Y2gKKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0gCisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2cgKExPR0UsICIlcyBXUFMgSUUgTWlzbWF0Y2ggJVgiLF9fZnVuY19fLCB3cHNfZ2VuaWVbMF0pOworICAgICAgICAgfQorICAgICAgICAgCisgICAgICB9IC8vIHN3aXRjaAorICAgIH0KKyAgICBoYWxTdGF0dXMgPSBXTEFOU0FQX1NldF9XcHNJZShwVm9zQ29udGV4dCwgcFNhcF9XUFNJZSk7CisgICAgaWYgKGhhbFN0YXR1cyAhPSBlSEFMX1NUQVRVU19TVUNDRVNTKQorICAgICAgICByZXQgPSAtRUlOVkFMOworICAgIHBIb3N0YXBkU3RhdGUgPSBXTEFOX0hERF9HRVRfSE9TVEFQX1NUQVRFX1BUUihwSG9zdGFwZEFkYXB0ZXIpOworICAgIGlmKCBwSG9zdGFwZFN0YXRlLT5iQ29tbWl0ICYmIFdQU0llVHlwZSA9PSBlUUNfV1BTX1BST0JFX1JTUF9JRSkKKyAgICB7CisgICAgICAgIC8vaGRkX2FkYXB0ZXJfdCAqcEhvc3RhcGRBZGFwdGVyID0gKG5ldGRldl9wcml2KGRldikpOworICAgICAgICAvL3ZfQ09OVEVYVF90IHBWb3NDb250ZXh0ID0gcEhvc3RhcGRBZGFwdGVyLT5wdm9zQ29udGV4dDsKKyAgICAgICAgV0xBTlNBUF9VcGRhdGVfV3BzSWUgKCBwVm9zQ29udGV4dCApOworICAgIH0KKyAKK2V4aXQ6CisgICAgdm9zX21lbV9mcmVlKHBTYXBfV1BTSWUpOyAgIAorICAgIGtmcmVlKGZ3cHNfZ2VuaWUpOworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IGl3X3NvZnRhcF9zZXR3cHNpZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyICpleHRyYSkKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X3NvZnRhcF9zZXR3cHNpZShkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IF9faXdfc29mdGFwX3N0b3Bic3Moc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhciAqZXh0cmEpCit7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEhvc3RhcGRBZGFwdGVyOworICAgIFZPU19TVEFUVVMgc3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggICAgICAgICA9IE5VTEw7CisKKyAgICBFTlRFUigpOworICAgIHBIb3N0YXBkQWRhcHRlciA9IChuZXRkZXZfcHJpdihkZXYpKTsKKyAgICBpZiAoTlVMTCA9PSBwSG9zdGFwZEFkYXB0ZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBBZGFwdGVyIGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBIb3N0YXBkQWRhcHRlcik7CisgICAgc3RhdHVzID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZ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B0ZXItPmRldmljZV9tb2RlKTsKKyAgICB9CisgICAgRVhJVCgpOworICAgIHJldHVybiAoc3RhdHVzID09IFZPU19TVEFUVVNfU1VDQ0VTUykgPyAwIDogLUVCVVNZOworfQorCitzdGF0aWMgaW50IGl3X3NvZnRhcF9zdG9wYnNzKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9faXdfc29mdGFwX3N0b3Bic3MoZGV2LCBpbmZvLCB3cnF1LCBleHRyYSk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBfX2l3X3NvZnRhcF92ZXJzaW9uKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgKmV4dHJhKQoreworICAgIGhkZF9hZGFwdGVyX3QgKnBIb3N0YXBkQWRhcHRlciA9IChuZXRkZXZfcHJpdihkZXYpKTsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgIGludCByZXQgPSAwOworCisgICAgRU5URVIoKTsKKyAgICBwSG9zdGFwZEFkYXB0ZXIgPSAobmV0ZGV2X3ByaXYoZGV2KSk7CisgICAgaWYgKE5VTEwgPT0gcEhvc3RhcGRBZGFwdGVyKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogQWRhcHRlciBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwSG9zdGFwZEFkYXB0ZXIpOworICAgIHJldCA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gcmV0KQorICAgIHsKKyAgICAgICAgcmV0dXJuIHJldDsKKyAgICB9CisgICAgaGRkX3dsYW5fZ2V0X3ZlcnNpb24ocEhvc3RhcGRBZGFwdGVyLCB3cnF1LCBleHRyYSk7CisgICAgRVhJVCgpOworICAgIHJldHVybiAwOworfQorCitzdGF0aWMgaW50IGl3X3NvZnRhcF92ZXJzaW9uKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9faXdfc29mdGFwX3ZlcnNpb24oZGV2LCBpbmZvLCB3cnF1LCBleHRyYSk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworVk9TX1NUQVRVUyBoZGRfc29mdGFwX2dldF9zdGFfaW5mbyhoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwgdl9VOF90ICpwQnVmLCBpbnQgYnVmX2xlbikKK3sKKyAgICB2X1U4X3QgaTsKKyAgICBpbnQgbGVuID0gMDsKKyAgICBjb25zdCBjaGFyIHN0YV9pbmZvX2hlYWRlcltdID0gInN0YUlkIHN0YUFkZHJlc3NcbiI7CisgICAgdl9DT05URVhUX3QgcFZvc0NvbnRleHQ7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgICBwdFNhcENvbnRleHQgcFNhcEN0eCA9IE5VTEw7CisKKyAgICBFTlRFUigpOworCisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogQWRhcHRlciBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgaWYgKDAgIT0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KSkKKyAgICB7CisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICAgfQorICAgIHBWb3NDb250ZXh0ID0gcEhkZEN0eC0+cHZvc0NvbnRleHQ7CisgICAgaWYgKE5VTEwgPT0gcFZvc0NvbnRleHQpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogVk9TIGNvbnRleHQgaXMgbm90IHZhbGlkIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICAgfQorICAgIHBTYXBDdHggPSBWT1NfR0VUX1NBUF9DQihwVm9zQ29udGV4dCk7CisgICAgaWYocFNhcEN0eCA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIEZMKCJwc2FwQ3R4IGlzIE5VTEwiKSk7CisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICAgfQorCisgICAgbGVuID0gc2NucHJpbnRmKHBCdWYsIGJ1Zl9sZW4sIHN0YV9pbmZvX2hlYWRlcik7CisgICAgcEJ1ZiArPSBsZW47CisgICAgYnVmX2xlbiAtPSBsZW47CisKKyAgICBmb3IgKGkgPSAwOyBpIDwgV0xBTl9NQVhfU1RBX0NPVU5UOyBpKyspCisgICAgeworICAgICAgICBpZihwU2FwQ3R4LT5hU3RhSW5mb1tpXS5pc1VzZWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxlbiA9IHNjbnByaW50ZihwQnVmLCBidWZfbGVuLCAiJTVkIC4lMDJ4OiUwMng6JTAyeDolMDJ4OiUwMng6JTAyeFxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTYXBDdHgtPmFTdGFJbmZvW2ldLnVjU1RBSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2FwQ3R4LT5hU3RhSW5mb1tpXS5tYWNBZGRyU1RBLmJ5dGVzWzBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNhcEN0eC0+YVN0YUluZm9baV0ubWFjQWRkclNUQS5ieXRlc1sxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTYXBDdHgtPmFTdGFJbmZvW2ldLm1hY0FkZHJTVEEuYnl0ZXNbMl0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2FwQ3R4LT5hU3RhSW5mb1tpXS5tYWNBZGRyU1RBLmJ5dGVzWzNdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNhcEN0eC0+YVN0YUluZm9baV0ubWFjQWRkclNUQS5ieXRlc1s0XSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTYXBDdHgtPmFTdGFJbmZvW2ldLm1hY0FkZHJTVEEuYnl0ZXNbNV0pOworICAgICAgICAgICAgcEJ1ZiArPSBsZW47CisgICAgICAgICAgICBidWZfbGVuIC09IGxlbjsKKyAgICAgICAgfQorICAgICAgICBpZihXRV9HRVRfU1RBX0lORk9fU0laRSA+IGJ1Zl9sZW4pCisgICAgICAgIHsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorICAgIEVYSVQoKTsKKyAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfQorCitzdGF0aWMgaW50IF9faXdfc29mdGFwX2dldF9zdGFfaW5mbyhzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyICpleHRyYSkKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwSG9zdGFwZEFkYXB0ZXIgPSAobmV0ZGV2X3ByaXYoZGV2KSk7CisgICAgVk9TX1NUQVRVUyBzdGF0dXM7CisgICAgRU5URVIoKTsKKyAgICBzdGF0dXMgPSBoZGRfc29mdGFwX2dldF9zdGFfaW5mbyhwSG9zdGFwZEFkYXB0ZXIsIGV4dHJhLCBXRV9TQVBfTUFYX1NUQV9JTkZPKTsKKyAgICBpZiAoICFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkgeworICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlcyBGYWlsZWQhISEiLF9fZnVuY19fKTsKKyAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgd3JxdS0+ZGF0YS5sZW5ndGggPSBzdHJsZW4oZXh0cmEpOworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljIGludCBpd19zb2Z0YXBfZ2V0X3N0YV9pbmZvKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9faXdfc29mdGFwX2dldF9zdGFfaW5mbyhkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IF9faXdfc2V0X2FwX2dlbmllKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworCisgICAgaGRkX2FkYXB0ZXJfdCAqcEhvc3RhcGRBZGFwdGVyOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgdl9DT05URVhUX3QgcFZvc0NvbnRleHQ7CisgICAgZUhhbFN0YXR1cyBoYWxTdGF0dXM9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgdV9pbnQ4X3QgKmdlbmllID0gKHVfaW50OF90ICopZXh0cmE7CisgICAgaW50IHJldCA9IDA7CisKKyAgICBFTlRFUigpOworICAgIHBIb3N0YXBkQWRhcHRlciA9IChuZXRkZXZfcHJpdihkZXYpKTsKKyAgICBpZiAoTlVMTCA9PSBwSG9zdGFwZEFkYXB0ZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogQWRhcHRlciBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwSG9zdGFwZEFkYXB0ZXIpOworICAgIHJldCA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gcmV0KQorICAgIHsKKyAgICAgICAgcmV0dXJuIHJldDsKKyAgICB9CisgICAgcFZvc0NvbnRleHQgPSBwSGRkQ3R4LT5wdm9zQ29udGV4dDsKKyAgICBpZiAoTlVMTCA9PSBwVm9zQ29udGV4dCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBWT1MgQ29udGV4dCBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBpZighd3JxdS0+ZGF0YS5sZW5ndGgpCisgICAgeworICAgICAgICBFWElUKCk7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIHN3aXRjaCAoZ2VuaWVbMF0pCisgICAgeworICAgICAgICBjYXNlIERPVDExRl9FSURfV1BBOgorICAgICAgICBjYXNlIERPVDExRl9FSURfUlNOOgorICAgICAgICAgICAgaWYoKFdMQU5fSEREX0dFVF9BUF9DVFhfUFRSKHBIb3N0YXBkQWRhcHRlcikpLT51UHJpdmFjeSA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZF9zb2Z0YXBfRGVyZWdpc3Rlcl9CQ19TVEEocEhvc3RhcGRBZGFwdGVyKTsKKyAgICAgICAgICAgICAgICBoZGRfc29mdGFwX1JlZ2lzdGVyX0JDX1NUQShwSG9zdGFwZEFkYXB0ZXIsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgKFdMQU5fSEREX0dFVF9BUF9DVFhfUFRSKHBIb3N0YXBkQWRhcHRlcikpLT51UHJpdmFjeSA9IDE7CisgICAgICAgICAgICBoYWxTdGF0dXMgPSBXTEFOU0FQX1NldF9XUEFSU05JZXMocFZvc0NvbnRleHQsIGdlbmllLCB3cnF1LT5kYXRhLmxlbmd0aCk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgaGRkTG9nIChMT0dFLCAiJXMgU2V0IFVOS05PV04gSUUgJVgiLF9fZnVuY19fLCBnZW5pZVswXSk7CisgICAgICAgICAgICBoYWxTdGF0dXMgPSAwOworICAgIH0KKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gaGFsU3RhdHVzOworfQorCitzdGF0aWMgaW50IGl3X3NldF9hcF9nZW5pZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9faXdfc2V0X2FwX2dlbmllKGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBWT1NfU1RBVFVTICB3bGFuX2hkZF9nZXRfY2xhc3NBc3RhdHNfZm9yX3N0YXRpb24oaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsIHU4IHN0YWlkKQoreworICAgZUhhbFN0YXR1cyBoc3RhdHVzOworICAgbG9uZyBscmM7CisgICBzdHJ1Y3Qgc3RhdHNDb250ZXh0IGNvbnRleHQ7CisKKyAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgeworICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiJXM6IHBBZGFwdGVyIGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgfQorCisgICBpbml0X2NvbXBsZXRpb24oJmNvbnRleHQuY29tcGxldGlvbik7CisgICBjb250ZXh0LnBBZGFwdGVyID0gcEFkYXB0ZXI7CisgICBjb250ZXh0Lm1hZ2ljID0gU1RBVFNfQ09OVEVYVF9NQUdJQzsKKyAgIGhzdGF0dXMgPSBzbWVfR2V0U3RhdGlzdGljcyggV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfSERELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNNRV9HTE9CQUxfQ0xBU1NBX1NUQVRTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhkZF9HZXRDbGFzc0Ffc3RhdGlzdGljc0NCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsIC8vIG5vdCBwZXJpb2RpYworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZBTFNFLCAvL25vbi1jYWNoZWQgcmVzdWx0cworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YWlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZjb250ZXh0KTsKKyAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IGhzdGF0dXMpCisgICB7CisgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgIiVzOiBVbmFibGUgdG8gcmV0cmlldmUgc3RhdGlzdGljcyBmb3IgbGluayBzcGVlZCIsCisgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICB9CisgICBlbHNlCisgICB7CisgICAgICBscmMgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGVfdGltZW91dCgmY29udGV4dC5jb21wbGV0aW9uLAorICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcyhXTEFOX1dBSVRfVElNRV9TVEFUUykpOworICAgICAgaWYgKGxyYyA8PSAwKQorICAgICAgeworICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICIlczogU01FICVzIHdoaWxlIHJldHJpZXZpbmcgbGluayBzcGVlZCIsCisgICAgICAgICAgICAgIF9fZnVuY19fLCAoMCA9PSBscmMpID8gInRpbWVvdXQiIDogImludGVycnVwdCIpOworICAgICAgfQorICAgfQorCisgICAvKiBlaXRoZXIgd2UgbmV2ZXIgc2VudCBhIHJlcXVlc3QsIHdlIHNlbnQgYSByZXF1ZXN0IGFuZCByZWNlaXZlZCBhCisgICAgICByZXNwb25zZSBvciB3ZSBzZW50IGEgcmVxdWVzdCBhbmQgdGltZWQgb3V0LiAgaWYgd2UgbmV2ZXIgc2VudCBhCisgICAgICByZXF1ZXN0IG9yIGlmIHdlIHNlbnQgYSByZXF1ZXN0IGFuZCBnb3QgYSByZXNwb25zZSwgd2Ugd2FudCB0bworICAgICAgY2xlYXIgdGhlIG1hZ2ljIG91dCBvZiBwYXJhbm9pYS4gIGlmIHdlIHRpbWVkIG91dCB0aGVyZSBpcyBhCisgIC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fdCAqcEhkZEN0eDsKKyAgIGNoYXIgKnBMaW5rU3BlZWQgPSAoY2hhciopZXh0cmE7CisgICBjaGFyICpwbWFjQWRkcmVzczsKKyAgIHZfVTMyX3QgbGlua19zcGVlZDsKKyAgIHVuc2lnbmVkIHNob3J0IHN0YUlkOworICAgaW50IGxlbiA9IHNpemVvZih2X1UzMl90KSsxOworICAgdl9CWVRFX3QgbWFjQWRkcmVzc1tWT1NfTUFDX0FERFJfU0laRV07CisgICBWT1NfU1RBVFVTIHN0YXR1cyA9IFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgaW50IHJjLCB2YWxpZDsKKworICAgRU5URVIoKTsKKworICAgcEhvc3RhcGRBZGFwdGVyID0gKG5ldGRldl9wcml2KGRldikpOworICAgaWYgKE5VTEwgPT0gcEhvc3RhcGRBZGFwdGVyKQorICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgfQorICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEhvc3RhcGRBZGFwdGVyKTsKKyAgIHZhbGlkID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgIGlmICgwICE9IHZhbGlkKQorICAgeworICAgICAgIHJldHVybiB2YWxpZDsKKyAgIH0KKworICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXMgd3JxdS0+ZGF0YS5sZW5ndGg9ICVkIiwgX19mdW5jX18sIHdycXUtPmRhdGEubGVuZ3RoKTsKKworICAgaWYgKHdycXUtPmRhdGEubGVuZ3RoID49IE1BQ19BRERSRVNTX1NUUl9MRU4gLSAxKQorICAgeworICAgICAgIHBtYWNBZGRyZXNzID0ga21hbGxvYyhNQUNfQUREUkVT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IHdpbGwgYmUgcmV0dXJuZWQuCisgICAgKi8KKyAgIGlmICh3cnF1LT5kYXRhLmxlbmd0aCA8IDE3IHx8ICFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzICkpCisgICB7CisgICAgICBzdGF0dXMgPSBoZGRfc29mdGFwX0dldENvbm5lY3RlZFN0YUlkKHBIb3N0YXBkQWRhcHRlciwgKHZvaWQgKikoJnN0YUlkKSk7CisgICB9CisgICBlbHNlCisgICB7CisgICAgICBzdGF0dXMgPSBoZGRfc29mdGFwX0dldFN0YUlkKHBIb3N0YXBkQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodl9NQUNBRERSX3QgKiltYWNBZGRyZXNzLCAodm9pZCAqKSgmc3RhSWQpKTsKKyAgIH0KKworICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgIHsKKyAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJFUlJPUjogSEREIEZhaWxlZCB0byBmaW5kIHN0YSBpZCEhIikpOworICAgICAgbGlua19zcGVlZCA9IDA7CisgICB9CisgICBlbHNlCisgICB7CisgICAgICBzdGF0dXMgPSB3bGFuX2hkZF9nZXRfY2xhc3NBc3RhdHNfZm9yX3N0YXRpb24ocEhvc3RhcGRBZGFwdGVyICwgc3RhSWQpOworCisgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyhzdGF0dXMgKSkKKyAgICAgIHsKKyAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgiVW5hYmxlIHRvIHJldHJpZXZlIFNNRSBzdGF0aXN0aWNzIikpOworICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgfQorCisgICAgICBXTEFOVExfR2V0U1RBTGlua0NhcGFjaXR5KHBIZGRDdHgtPnB2b3NDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFJZCwgJmxpbmtfc3BlZWQpOworCisgICAgICBsaW5rX3NwZWVkID0gbGlua19zcGVlZCAvIDEwOworCisgICAgICBpZiAoMCA9PSBsaW5rX3NwZWVkKQorICAgICAgeworICAgICAgICAgIC8qIFRoZSBsaW5rc3BlZWQgcmV0dXJuZWQgYnkgSEFMIGlzIGluIHVuaXRzIG9mIDUwMGticHMuCisgICAgICAgICAgICogY29udmVydGluZyBpdCB0byBtYnBzLgorICAgICAgICAgICAqIFRoaXMgaXMgcmVxdWlyZWQgdG8gc3VwcG9ydCBsZWdhY3kgZmlybXdhcmUgd2hpY2ggZG9lcworICAgICAgICAgICAqIG5vdCByZXR1cm4gbGluayBjYXBhY2l0eS4KKyAgICAgICAgICAgKi8KKyAgICAgICAgICBsaW5rX3NwZWVkID0oaW50KXBIb3N0YXBkQWRhcHRlci0+aGRkX3N0YXRzLkNsYXNzQV9zdGF0LnR4X3JhdGUvMjsKKyAgICAgIH0KKyAgIH0KKworICAgd3JxdS0+ZGF0YS5sZW5ndGggPSBsZW47CisgICByYyA9IHNucHJpbnRmKHBMaW5rU3BlZWQsIGxlbiwgIiV1IiwgbGlua19zcGVlZCk7CisKKyAgIGlmICgocmMgPCAwKSB8fCAocmMgPj0gbGVuKSkKKyAgIHsKKyAgICAgIC8vIGVuY29kaW5nIG9yIGxlbmd0aCBlcnJvcj8KKyAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsRkwoICJVbmFibGUgdG8gZW5jb2RlIGxpbmsgc3BlZWQiKSk7CisgICAgICByZXR1cm4gLUVJTzsKKyAgIH0KKworICAgRVhJVCgpOworICAgcmV0dXJuIDA7Cit9CisKK2ludCBpd19nZXRfc29mdGFwX2xpbmtzcGVlZChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgIC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AgICAgLyogU0lPQ1NJV1JBTkdFICovCisgICAoaXdfaGFuZGxlcikgTlVMTCwgICAgICAgICAgIC8qIFNJT0NHSVdSQU5HRSAqLworICAgKGl3X2hhbmRsZXIpIE5VTEwsICAgICAgICAgICAvKiBTSU9DU0lXUFJJViAqLworICAgKGl3X2hhbmRsZXIpIE5VTEwsICAgICAgICAgICAvKiBTSU9DR0lXUFJJViAqLworICAgKGl3X2hhbmRsZXIpIE5VTEwsICAgICAgICAgICAvKiBTSU9DU0lXU1RBVFMgKi8KKyAgIChpd19oYW5kbGVyKSBOVUxMLCAgICAgICAgICAgLyogU0lPQ0dJV1NUQVRTICovCisgICAoaXdfaGFuZGxlcikgTlVMTCwgICAgICAgICAgIC8qIFNJT0NTSVdTUFkgKi8KKyAgIChpd19oYW5kbGVyKSBOVUxMLCAgICAgICAgICAgLyogU0lPQ0dJV1NQWSAqLworICAgKGl3X2hhbmRsZXIpIE5VTEwsICAgICAgICAgICAvKiBTSU9DU0lXVEhSU1BZICovCisgICAoaXdfaGFuZGxlcikgTlVMTCwgICAgICAgICAgIC8qIFNJT0NHSVdUSFJTUFkgKi8KKyAgIChpd19oYW5kbGVyKSBOVUxMLCAgICAgICAgICAgLyogU0lPQ1NJV0FQICovCisgICAoaXdfaGFuZGxlcikgTlVMTCwgICAgICAgICAgIC8qIFNJT0NHSVdBUCAqLworICAgKGl3X2hhbmRsZXIpIGl3X3NldF9hcF9tbG1lLCAgICAvKiBTSU9DU0lXTUxNRSAqLworICAgKGl3X2hhbmRsZXIpIE5VTEwsICAgICAgICAgICAvKiBTSU9DR0lXQVBMSVNUICovCisgICAoaXdfaGFuZGxlcikgTlVMTCwgICAgICAgICAgIC8qIFNJT0NTSVdTQ0FOICovCisgICAoaXdfaGFuZGxlcikgTlVMTCwgICAgICAgICAgIC8qIFNJT0NHSVdTQ0FOICovCisgICAoaXdfaGFuZGxlcikgTlVMTCwgICAgICAgICAgIC8qIFNJT0NTSVdFU1NJRCAqLworICAgKGl3X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lVMTDsKKworICAgIHBXbGFuSG9zdGFwZERldiA9IGFsbG9jX25ldGRldl9tcShzaXplb2YoaGRkX2FkYXB0ZXJfdCksIGlmYWNlX25hbWUsCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE3LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBORVRfTkFNRV9VTktOT1dOLAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV0aGVyX3NldHVwLCBOVU1fVFhfUVVFVUVTKTsKKyAgICBpZiAocFdsYW5Ib3N0YXBkRGV2ICE9IE5VTEwpCisgICAgeworICAgICAgICBwSG9zdGFwZEFkYXB0ZXIgPSBuZXRkZXZfcHJpdihwV2xhbkhvc3RhcGREZXYpOworCisgICAgICAgIC8vSW5pdCB0aGUgbmV0X2RldmljZSBzdHJ1Y3R1cmUKKyAgICAgICAgZXRoZXJfc2V0dXAocFdsYW5Ib3N0YXBkRGV2KTsKKworICAgICAgICAvL0luaXRpYWxpemUgdGhlIGFkYXB0ZXIgY29udGV4dCB0byB6ZXJvcy4KKyAgICAgICAgdm9zX21lbV96ZXJvKHBIb3N0YXBkQWRhcHRlciwgc2l6ZW9mKCBoZGRfYWRhcHRlcl90ICkpOworICAgICAgICBwSG9zdGFwZEFkYXB0ZXItPmRldiA9IHBXbGFuSG9zdGFwZERldjsKKyAgICAgICAgcEhvc3RhcGRBZGFwdGVyLT5wSGRkQ3R4ID0gcEhkZEN0eDsgCisgICAgICAgIHBIb3N0YXBkQWRhcHRlci0+bWFnaWMgPSBXTEFOX0hERF9BREFQVEVSX01BR0lDOworCisgICAgICAgIC8vR2V0IHRoZSBHbG9iYWwgVk9TUyBjb250ZXh0LgorICAgICAgICBwVm9zQ29udGV4dCA9IHZvc19nZXRfZ2xvYmFsX2NvbnRleHQoVk9TX01PRFVMRV9JRF9TWVMsIE5VTEwpOworICAgICAgICAvL1NhdmUgd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UxMIElNUExJRUQKKyAqIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTLiBJTiBOTyBFVkVOVCBTSEFMTCBUSEUKKyAqIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsIElORElSRUNULCBPUiBDT05TRVFVRU5USUFMCisgKiBEQU1BR0VTIE9SIEFOWSBEQU1BR0VTIFdIQVRTT0VWRVIgUkVTVUxUSU5HIEZST00gTE9TUyBPRiBVU0UsIERBVEEgT1IKKyAqIFBST0ZJVFMsIFdIRVRIRVIgSU4gQU4gQUNUSU9OIE9GIENPTlRSQUNULCBORUdMSUdFTkNFIE9SIE9USEVSCisgKiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SCisgKiBQRVJGT1JNQU5DRSBPRiBUSElTIFNPRlRXQVJFLgorICovCisKKy8qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisKKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIFxmaWxlICB3bGFuX2hkZF9tYWluLmMKKworICBcYnJpZWYgV0xBTiBIb3N0IERldmljZSBEcml2ZXIgaW1wbGVtZW50YXRpb24KKworCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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ZBVEFMLCIlczogSEREIENvbnRleHQgTnVsbCBQb2ludGVyIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBOT1RJRllfRE9ORTsKKyAgIH0KKyAgIGlmIChwSGRkQ3R4LT5pc0xvZ3BJblByb2dyZXNzKQorICAgICAgcmV0dXJuIE5PVElGWV9ET05FOworCisKKyAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIiVzOiAlcyBOZXcgTmV0IERldmljZSBTdGF0ZSA9ICVsdSIsCisgICAgICAgICAgX19mdW5jX18sIGRldi0+bmFtZSwgc3RhdGUpOworCisgICBzd2l0Y2ggKHN0YXRlKSB7CisgICBjYXNlIE5FVERFVl9SRUdJU1RFUjoKKyAgICAgICAgYnJlYWs7CisKKyAgIGNhc2UgTkVUREVWX1VOUkVHSVNURVI6CisgICAgICAgIGJyZWFrOworCisgICBjYXNlIE5FVERFVl9VUDoKKyAgICAgICAgYnJlYWs7CisKKyAgIGNhc2UgTkVUREVWX0RPV046CisgICAgICAgIGJyZWFrOworCisgICBjYXNlIE5FVERFVl9DSEFOR0U6CisgICAgICAgIGlmKFRSVUUgPT0gcEFkYXB0ZXItPmlzTGlua1VwU3ZjTmVlZGVkKQorICAgICAgICAgICBjb21wbGV0ZSgmcEFkYXB0ZXItPmxpbmt1cF9ldmVudF92YXIpOworICAgICAgICBicmVhazsKKworICAgY2FzZSBORVRERVZfR09JTkdfRE9XTjoKKyAgICAgICAgcmVzdWx0ID0gd2xhbl9oZGRfc2Nhbl9hYm9ydChwQWRhcHRlcik7CisgICAgICAgIGlmIChyZXN1bHQgPCAwKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICIlczogVGltZW91dCBvY2N1cnJlZCB3aGlsZSB3YWl0aW5nIGZvciBhYm9ydHNjYW4gJWxkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCByZXN1bHQpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICIlczogU2NhbiBBYm9ydCBTdWNjZXNzZnVsIiAsIF9fZnVuY19fKTsKKyAgICAgICAgfQorI2lmZGVmIFdMQU5fQlRBTVBfRkVBVFVSRQorICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCIlczogZGlzYWJsaW5nIEFNUCIsIF9fZnVuY19fKTsKKyAgICAgICAgc3RhdHVzID0gV0xBTkJBUF9TdG9wQW1wKCk7CisgICAgICAgIGlmKFZPU19TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMgKQorICAgICAgICB7CisgICAgICAgICAgIHBIZGRDdHgtPmlzQW1wQWxsb3dlZCA9IFZPU19UUlVFOworICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgIiVzOiBGYWlsZWQgdG8gc3RvcCBBTVAiLCBfX2Z1bmNfXyk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgIC8vYSBzdGF0ZSBtL2MgaW1wbGVtZW50YXRpb24gaW4gUEFMIGlzIFRCRCB0byBhdm9pZCB0aGlzIGRlbGF5CisgICAgICAgICAgIG1zbGVlcCg1MDApOworICAgICAgICAgICBpZiAoIHBIZGRDdHgtPmlzQW1wQWxsb3dlZCApCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBXTEFOQkFQX0RlcmVnaXN0ZXJGcm9tSENJKCk7CisgICAgICAgICAgICAgICAgcEhkZEN0eC0+aXNBbXBBbGxvd2VkID0gVk9TX0ZBTFNFOworICAgICAgICAgICB9CisgICAgICAgIH0KKyNlbmRpZiAvL1dMQU5fQlRBTVBfRkVBVFVSRQorICAgICAgICBicmVhazsKKworICAgZGVmYXVsdDoKKyAgICAgICAgYnJlYWs7CisgICB9CisKKyAgIHJldHVybiBOT1RJRllfRE9ORTsKK30KKworc3RhdGljIGludCBoZGRfbmV0ZGV2X25vdGlmaWVyX2NhbGwoc3RydWN0IG5vdGlmaWVyX2Jsb2NrICogbmIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgc3RhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKm5kZXYpCit7CisgICAgaW50IHJldDsKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9faGRkX25ldGRldl9ub3RpZmllcl9jYWxsKCBuYiwgc3RhdGUsIG5kZXYpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXR1cm4gcmV0OworfQorCitzdHJ1Y3Qgbm90aWZpZXJfYmxvY2sgaGRkX25ldGRldl9ub3RpZmllciA9IHsKKyAgIC5ub3RpZmllcl9jYWxsID0gaGRkX25ldGRldl9ub3RpZmllcl9jYWxsLAorfTsKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAqICAgRnVuY3Rpb24gZGVmaW5pdGlvbnMKKyAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCit2b2lkIGhkZF91bnJlZ2lzdGVyX21jYXN0X2JjYXN0X2ZpbHRlcihoZGRfY29udGV4dF90ICpwSGRkQ3R4KTsKK3ZvaW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bl9oZGRfdmFsaWRhdGVfY29udGV4dChoZGRfY29udGV4dF90ICpwSGRkQ3R4KQoreworCisgICAgaWYgKE5VTEwgPT0gcEhkZEN0eCB8fCBOVUxMID09IHBIZGRDdHgtPmNmZ19pbmkpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAiJXM6IEhERCBjb250ZXh0IGlzIE51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRU5PREVWOworICAgIH0KKworICAgIGlmIChwSGRkQ3R4LT5pc0xvZ3BJblByb2dyZXNzKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICIlczogTE9HUCAlcy4gSWdub3JlISEiLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgdm9zX2lzX3dsYW5faW5fYmFkU3RhdGUoVk9TX01PRFVMRV9JRF9IREQsIE5VTEwpCisgICAgICAgICAgICAgICAgICAgID8iZmFpbGVkIjoiaW4gUHJvZ3Jlc3MiKTsKKyAgICAgICAgcmV0dXJuIC1FQUdBSU47CisgICAgfQorCisgICAgaWYgKFdMQU5fSEREX0lTX0xPQURfVU5MT0FEX0lOX1BST0dSRVNTKHBIZGRDdHgpKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICIlczogVW5sb2FkaW5nL0xvYWRpbmcgaW4gUHJvZ3Jlc3MuIElnbm9yZSEhISIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FQUdBSU47CisgICAgfQorICAgIHJldHVybiAwOworfQorI2lmZGVmIENPTkZJR19FTkFCTEVfTElOVVhfUkVHCit2b2l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gaWYgKE5VTEwgPT0gY2ZnX3BhcmFtKQorICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgImNmZ19wYXJhbXMgbm90IGF2YWlsYWJsZSAhISIpOworICAgICAgIHJldHVybiA7CisgICB9CisKKyAgIHBoeU1vZGUgPSBzbWVfR2V0UGh5TW9kZShXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlcikpOworCisgICBpZiAoIXBIZGRDdHgtPmlzVkhUODBBbGxvd2VkKQorICAgeworICAgICAgIGlmICgoZUNTUl9ET1QxMV9NT0RFX0FVVE8gPT0gcGh5TW9kZSkgfHwKKyAgICAgICAgICAgKGVDU1JfRE9UMTFfTU9ERV8xMWFjID09IHBoeU1vZGUpIHx8CisgICAgICAgICAgIChlQ1NSX0RPVDExX01PREVfMTFhY19PTkxZID09IHBoeU1vZGUpKQorICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICJTZXR0aW5nIHBoeW1vZGUgdG8gMTFuISEiKTsKKyAgICAgICAgICAgc21lX1NldFBoeU1vZGUoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLCBlQ1NSX0RPVDExX01PREVfMTFuKTsKKyAgICAgICB9CisgICB9CisgICBlbHNlCisgICB7CisgICAgICAgLypOZXcgY291bnRyeSBTdXBwb3J0cyAxMWFjIGFzIHdlbGwgcmVzZXR0aW5nIHZhbHVlIGJhY2sgZnJvbSAuaW5pKi8KKyAgICAgICBzbWVfU2V0UGh5TW9kZShXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgaGRkX2NmZ194bGF0ZV90b19jc3JfcGh5X21vZGUoY2ZnX3BhcmFtLT5kb3QxMU1vZGUpKTsKKyAgICAgICByZXR1cm4gOworICAgfQorCisgICBpZiAoKGVDb25uZWN0aW9uU3RhdGVfQXNzb2NpYXRlZCA9PSBwSGRkU3RhQ3R4LT5jb25uX2luZm8uY29ublN0YXRlKSAmJgorICAgICAgICgoZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUFDX09OTFkgPT0gcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmRvdDExTW9kZSkgfHwKKyAgICAgICAgKGVDU1JfQ0ZHX0RPVDExX01PREVfMTFBQyA9PSBwSGRkU3RhQ3R4LT5jb25uX2luZm8uZG90MTFNb2RlKSkpCisgICB7CisgICAgICAgVk9TX1NUQVRVUyB2b3NTdGF0dXM7CisKKyAgICAgICAvLyBuZWVkIHRvIGlzc3VlIGEgZGlzY29ubmVjdCB0byBDU1IuCisgICAgICAgSU5JVF9DT01QTEVUSU9OKHBBZGFwdGVyLT5kaXNjb25uZWN0X2NvbXBfdmFyKTsKKyAgICAgICB2b3NTdGF0dXMgPSBzbWVfUm9hbURpc2Nvbm5lY3QoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX0RJU0NPTk5FQ1RfUkVBU09OX1VOU1BFQ0lGSUVEICk7CisKKyAgICAgICBpZiAoVk9TX1NUQVRVU19TVUNDRVNTID09IHZvc1N0YXR1cykKKyAgICAgICB7CisgICAgICAgICAgIGxvbmcgcmV0OworCisgICAgICAgICAgIHJldCA9IHdhaXRfZm9yX2NvbXBsZXRpb25faW50ZXJydXB0aWJsZV90aW1lb3V0KCZwQWRhcHRlci0+ZGlzY29ubmVjdF9jb21wX3ZhciwKKyAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcyhXTEFOX1dBSVRfVElNRV9ESVNDT05ORUNUKSk7CisgICAgICAgICAgIGlmICgwID49IHJldCkKKyAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCBGTCgiZmFpbHVyZSB3YWl0aW5nIGZvciBkaXNjb25uZWN0X2NvbXBfdmFyICVsZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXQpOworICAgICAgIH0KKworICAgfQorfQorI2Vsc2UKK3ZvaWQgaGRkX2NoZWNrYW5kdXBkYXRlX3BoeW1vZGUoIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLCBjaGFyICpjb3VudHJ5X2NvZGUpCit7CisgICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgaGRkX2NvbmZpZ190ICpjZmdfcGFyYW07CisgICAgZUNzclBoeU1vZGUgcGh5TW9kZTsKKyAgICBsb25nIHJldDsKKworICAgIGlmIChOVUxMID09IHBIZGRDdHgpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAiSEREIENvbnRleHQgaXMgbnVsbCAhISIpOworICAgICAgICByZXR1cm4gOworICAgIH0KKworICAgIGNmZ19wYXJhbSA9IHBIZGRDdHgtPmNmZ19pbmk7CisKKyAgICBpZiAoTlVMTCA9PSBjZmdfcGFyYW0pCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAiY2ZnX3BhcmFtcyBub3QgYXZhaWxhYmxlICEhIik7CisgICAgICAgIHJldHVybiA7CisgICAgfQorCisgICAgcGh5TW9kZSA9IHNtZV9HZXRQaHlNb2RlKFdMQU5fSEREX0dFVF9IQUxfQ1RY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0gcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmRvdDExTW9kZSkgfHwKKyAgICAgICAgIChlQ1NSX0NGR19ET1QxMV9NT0RFXzExQUMgPT0gcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmRvdDExTW9kZSkpKQorICAgIHsKKyAgICAgICAgVk9TX1NUQVRVUyB2b3NTdGF0dXM7CisKKyAgICAgICAgLy8gbmVlZCB0byBpc3N1ZSBhIGRpc2Nvbm5lY3QgdG8gQ1NSLgorICAgICAgICBJTklUX0NPTVBMRVRJT04ocEFkYXB0ZXItPmRpc2Nvbm5lY3RfY29tcF92YXIpOworICAgICAgICB2b3NTdGF0dXMgPSBzbWVfUm9hbURpc2Nvbm5lY3QoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfRElTQ09OTkVDVF9SRUFTT05fVU5TUEVDSUZJRUQgKTsKKworICAgICAgICBpZiAoVk9TX1NUQVRVU19TVUNDRVNTID09IHZvc1N0YXR1cykKKyAgICAgICAgeworICAgICAgICAgICAgcmV0ID0gd2FpdF9mb3JfY29tcGxldGlvbl9pbnRlcnJ1cHRpYmxlX3RpbWVvdXQoJnBBZGFwdGVyLT5kaXNjb25uZWN0X2NvbXBfdmFyLAorICAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcyhXTEFOX1dBSVRfVElNRV9ESVNDT05ORUNUKSk7CisgICAgICAgICAgICBpZiAocmV0IDw9IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICJ3YWl0IG9uIGRpc2Nvbm5lY3RfY29tcF92YXIgaXMgZmFpbGVkICVsZCIsIHJldCk7CisgICAgICAgIC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ihwSW5QdHIpKQorICAgIHsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorICAgIHBJblB0ciArPSB2YWw7CisgICAgdiA9IGtzdHJ0b3MzMihidWYsIGJhc2UsICZ0ZW1wSW50KTsKKyAgICBpZiAodiA8IDApCisgICAgeworICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisgICAgaWYgKHRlbXBJbnQgPCAwKQorICAgIHsKKyAgICAgICAgdGVtcEludCA9IDA7CisgICAgfQorICAgICpwT3V0UHRyID0gdGVtcEludDsKKworICAgIHBJblB0ciA9IHN0cm5jaHIocEluUHRyLCBzdHJsZW4ocEluUHRyKSwgU1BBQ0VfQVNDSUlfVkFMVUUpOworICAgIGlmIChOVUxMID09IHBJblB0cikKKyAgICB7CisgICAgICAgICpwTGFzdEFyZyA9IFRSVUU7CisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKyAgICB3aGlsZSAoKFNQQUNFX0FTQ0lJX1ZBTFVFICA9PSAqcEluUHRyKSAmJiAoJ1wwJyAhPSAgKnBJblB0cikpIHBJblB0cisrOworCisgICAgcmV0dXJuIHBJblB0cjsKK30KKworLyoqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgXGJyaWVmIGhkZF9leHRyYWN0X2Fzc2lnbmVkX2NoYXJfZnJvbV9zdHIoKSAtIEV4dHJhY3RzIGFzc2lnbmVkIGNoYXIgZnJvbQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5wdXQgc3RyaW5nCisKKyAgVGhpcyBmdW5jdGlvbiBleHRyYWN0cyBhc3NpZ25lZCBjaGFyYWN0ZXIgZnJvbSBzdHJpbmcgaW4gYmVsb3cgZm9ybWF0OgorICAiU1RSSU5HPUEiIDogZXh0cmFjdHMgY2hhciAnQScgZnJvbSB0aGlzIHN0cm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nIGVtcHR5IHNwYWNlcyovCisgICAgd2hpbGUgKChTUEFDRV9BU0NJSV9WQUxVRSAgPT0gKmluUHRyKSAmJiAoJ1wwJyAhPSAgKmluUHRyKSkgaW5QdHIrKzsKKworICAgIC8qbm8gYXJndW1lbnQgZm9sbG93ZWQgYnkgc3BhY2VzKi8KKyAgICBpZiAoJ1wwJyA9PSAqaW5QdHIpCisgICAgeworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICAvKmNoZWNrIGFuZCBwYXJzZSBTQ0FORlJFUSovCisgICAgaWYgKChzdHJuY21wKGluUHRyLCAiU0NBTkZSRVEiLCA4KSA9PSAwKSkKKyAgICB7CisgICAgICAgIGluUHRyID0gaGRkX2V4dHJhY3RfYXNzaWduZWRfaW50X2Zyb21fc3RyKGluUHRyLCAxMCwKKyAgICAgICAgICAgICAgICAgICAgJnRlbXAsICZsYXN0QXJnKTsKKworICAgICAgICBpZiAoMCAhPSB0ZW1wKQorICAgICAgICB7CisgICAgICAgICAgIG5TY2FuRnJlcSA9IHRlbXA7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIChOVUxMID09IGluUHRyKSB8fCAoVFJVRSA9PSBsYXN0QXJnKSkKKyAgICAgICAgeworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKmNoZWNrIGFuZCBwYXJzZSBNU0NBTiovCisgICAgaWYgKChzdHJuY21wKGluUHRyLCAiTVNDQU4iLCA1KSA9PSAwKSkKKyAgICB7CisgICAgICAgIGluUHRyID0gaGRkX2V4dHJhY3RfYXNzaWduZWRfaW50X2Zyb21fc3RyKGluUHRyLCAxMCwKKyAgICAgICAgICAgICAgICAgICAgJm5Nc2NhbiwgJmxhc3RBcmcpOworCisgICAgICAgIGlmICgwID09IG5Nc2NhbikKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICJpbnZhbGlkIE1TQ0FOPSVkIiwgbk1zY2FuKTsKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICB9CisKKyAgICAgICAgaWYgKFRSVUUgPT0gbGFzdEFyZykKKyAgICAgICAgeworICAgICAgICAgICAgZ290byBkb25lOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKE5VTEwgPT0gaW5QdHIpCisgICAgICAgIHsKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIC8qY2hlY2sgYW5kIHBhcnNlIEJFU1ROKi8KKyAgICBpZiAoKHN0cm5jbXAoaW5QdHIsICJCRVNUTiIsIDUpID09IDApKQorICAgIHsKKyAgICAgICAgaW5QdHIgPSBoZGRfZXh0cmFjdF9hc3NpZ25lZF9pbnRfZnJvbV9zdHIoaW5QdHIsIDEwLAorICAgICAgICAgICAgICAgICAgICAmdGVtcCwgJmxhc3RBcmcpOworCisgICAgICAgIGlmICgwICE9IHRlbXApCisgICAgICAgIHsKKyAgICAgICAgICAgbkJlc3ROID0gdGVtcDsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChUUlVFID09IGxhc3RBcmcpCisgICAgICAgIHsKKyAgICAgICAgICAgIGdvdG8gZG9uZTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChOVUxMID09IGluUHRyKQorICAgICAgICB7CisgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qY2hlY2sgYW5kIHBhcnNlIENIQU5ORUwqLworICAgIGlmICgoc3RybmNtcChpblB0ciwgIkNIQU5ORUwiLCA3KSA9PSAwKSkKKyAgICB7CisgICAgICAgIGluUHRyID0gaGRkX2V4dHJhY3RfYXNzaWduZWRfY2hhcl9mcm9tX3N0cihpblB0ciwgJnZhbCwgJmxhc3RBcmcpOworCisgICAgICAgIGlmICgoJ0EnID09IHZhbCkgfHwgKCdhJyA9PSB2YWwpKQorICAgICAgICB7CisgICAgICAgICAgICB1Y1JmQmFuZCA9IEhERF9TRVRfQkFUQ0hfU0NBTl81R0h6X0JBTkRfT05MWTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmICgoJ0InID09IHZhbCkgfHwgKCdiJyA9PSB2YWwpKQorICAgICAgICB7CisgICAgICAgICAgICB1Y1JmQmFuZCA9IEhERF9TRVRfQkFUQ0hfU0NBTl8yNEdIel9CQU5EX09OTFk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICB1Y1JmQmFuZCA9IEhERF9TRVRfQkFUQ0hfU0NBTl9ERUZBVUxUX0JBTkQ7CisgICAgICAgIH0KKworICAgICAgICBpZiAoVFJVRSA9PSBsYXN0QXJnKQorICAgICAgICB7CisgICAgICAgICAgICBnb3RvIGRvbmU7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoTlVMTCA9PSBpblB0cikKKyAgICAgICAgeworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKmNoZWNrIGFuZCBwYXJzZSBSVFQqLworICAgIGlmICgoc3RybmNtcChpblB0ciwgIlJUVCIsIDMpID09IDApKQorICAgIHsKKyAgICAgICAgaW5QdHIgPSBoZGRfZXh0cmFjdF9hc3NpZ25lZF9pbnRfZnJvbV9zdHIoaW5QdHIsIDEwLAorICAgICAgICAgICAgICAgICAgICAmblJ0dCwgJmxhc3RBcmcpOworICAgICAgICBpZiAoVFJVRSA9PSBsYXN0QXJnKQorICAgICAgICB7CisgICAgICAgICAgICBnb3RvIGRvbmU7CisgICAgICAgIH0KKyAgICAgICAgaWYgKE5VTEwgPT0gaW5QdHIpCisgICAgICAgIHsKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIC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XRzIHRoZQorICAgICBjb21wbGV0aW9uIGV2ZW50IG9uIHdoaWNoIGhkZF9pb2N0bCBpcyB3YWl0aW5nIG9ubHkgYWZ0ZXIgZ2V0dGluZyBjb21wbGV0ZQorICAgICBiYXRjaCBzY2FuIHJlc3BvbnNlIGRhdGEgZnJvbSBGVworCisgIFxwYXJhbSAgLSBjYWxsYmFja0NvbnRleHQgUG9pbnRlciB0byBIREQgYWRhcHRlcgorICBccGFyYW0gIC0gcFJzcCBQb2ludGVyIHRvIGdldCBiYXRjaCBzY2FuIHJlc3BvbnNlIGRhdGEgcmVjZWl2ZWQgZnJvbSBGVworCisgIFxyZXR1cm4gLSBub3RoaW5nCisKKyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworc3RhdGljIHZvaWQgaGRkX2JhdGNoX3NjYW5fcmVzdWx0X2luZF9jYWxsYmFjaworKAorICAgIHZvaWQgKmNhbGxiYWNrQ29udGV4dCwKKyAgICB2b2lkICpwUnNwCispCit7CisgICAgdl9CT09MX3QgICAgICAgICAgICAgICAgICAgICBpc0xhc3RBcDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICAgICAgIG51bUFwTWV0YUluZm87CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgICAgICBudW1OZXR3b3JrSW5TY2FuTGlzdDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICAgICAgIG51bWJlclNjYW5MaXN0OworICAgIHRBTklfVTMyICAgICAgICAgICAgICAgICAgICAgbmV4dFNjYW5MaXN0T2Zmc2V0OworICAgIHRBTklfVTMyICAgICAgICAgICAgICAgICAgICAgbmV4dEFwTWV0YUluZm9PZmZzZXQ7CisgICAgaGRkX2FkYXB0ZXJfdCogICAgICAgICAgICAgICBwQWRhcHRlcjsKKyAgICB0cFNpckJhdGNoU2Nhbkxpc3QgICAgICAgICAg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5zY2FuUmVzdWx0cyArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXh0U2Nhbkxpc3RPZmZzZXQpOworICAgICAgICBpZiAoTlVMTCA9PSBwU2Nhbkxpc3QpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAiJXM6IHBTY2FuTGlzdCBpcyAlcCIsIF9fZnVuY19fLCBwU2Nhbkxpc3QpOworICAgICAgICAgICAgaXNMYXN0QXAgPSBUUlVFOworICAgICAgICAgICBnb3RvIGRvbmU7CisgICAgICAgIH0KKyAgICAgICAgbnVtTmV0d29ya0luU2Nhbkxpc3QgPSBudW1BcE1ldGFJbmZvID0gcFNjYW5MaXN0LT5udW1OZXR3b3Jrc0luU2Nhbkxpc3Q7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgIkJhdGNoIHNjYW4gcnNwOiBudW1BcE1ldGFJbmZvICVkIHNjYW5JZCAlZCIsCisgICAgICAgICAgICBudW1BcE1ldGFJbmZvLCBwU2Nhbkxpc3QtPnNjYW5JZCk7CisKKyAgICAgICAgaWYgKCghbnVtQXBNZXRhSW5mbykgfHwgKG51bUFwTWV0YUluZm8gPiBwUmVxLT5iZXN0TmV0d29yaykpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAiJXM6IG51bUFwTWV0YUluZm8gJWQiLCBfX2Z1bmNfXywgbnVtQXBNZXRhSW5mbyk7CisgICAgICAgICAgICBpc0xhc3RBcCA9IFRSVUU7CisgICAgICAgICAgIGdvdG8gZG9uZTsKKyAgICAgICAgfQorCisgICAgICAgIC8qSW5pdGlhbGl6ZSBuZXh0IEFQIG1ldGEgaW5mbyBvZmZzZXQgZm9yIG5leHQgc2NhbiBsaXN0Ki8KKyAgICAgICAgbmV4dEFwTWV0YUluZm9PZmZzZXQgPSAwOworCisgICAgICAgIHdoaWxlIChudW1BcE1ldGFJbmZvKQorICAgICAgICB7CisgICAgICAgICAgICBwQXBNZXRhSW5mbyA9ICh0cFNpckJhdGNoU2Nhbk5ldHdvcmtJbmZvKShwU2Nhbkxpc3QtPnNjYW5MaXN0ICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5leHRBcE1ldGFJbmZvT2Zmc2V0KTsKKyAgICAgICAgICAgIGlmIChOVUxMID09IHBBcE1ldGFJbmZvKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBwQXBNZXRhSW5mbyBpcyAlcCIsIF9fZnVuY19fLCBwQXBNZXRhSW5mbyk7CisgICAgICAgICAgICAgICAgaXNMYXN0QXAgPSBUUlVFOworICAgICAgICAgICAgICAgIGdvdG8gZG9uZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8qY2FsY3VsYXRlIEFQIGFnZSovCisgICAgICAgICAgICBwQXBNZXRhSW5mby0+dGltZXN0YW1wID0KKyAgICAgICAgICAgICAgICBwQmF0Y2hTY2FuUnNwLT50aW1lc3RhbXAgLSBwQXBNZXRhSW5mby0+dGltZXN0YW1wOworCisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBic3NJZCAiTUFDX0FERFJFU1NfU1RSCisgICAgICAgICAgICAgICAgICAgICAgIiBjaCAlZCByc3NpICVkIHRpbWVzdGFtcCAlZCIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBBcE1ldGFJbmZvLT5ic3NpZCksCisgICAgICAgICAgICAgICAgICAgICAgcEFwTWV0YUluZm8tPmNoLCBwQXBNZXRhSW5mby0+cnNzaSwKKyAgICAgICAgICAgICAgICAgICAgICBwQXBNZXRhSW5mby0+dGltZXN0YW1wKTsKKworICAgICAgICAgICAgLyptYXJrIGxhc3QgQVAgaW4gYmF0Y2ggc2NhbiByZXNwb25zZSovCisgICAgICAgICAgICBpZiAoKFRSVUUgPT0gcEJhdGNoU2NhblJzcC0+aXNMYXN0UmVzdWx0KSAmJgorICAgICAgICAgICAgICAgICgxID09IG51bWJlclNjYW5MaXN0KSAmJiAoMSA9PSBudW1BcE1ldGFJbmZvKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGlzTGFzdEFwID0gVFJVRTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbXV0ZXhfbG9jaygmcEFkYXB0ZXItPmhkZF9iYXRjaF9zY2FuX2xvY2spOworICAgICAgICAgICAgLypzdG9yZSBiYXRjaCBzY2FuIHJlcHNvbnNlIGluIGhkZCBxdWV1ZSovCisgICAgICAgICAgICBoZGRfcG9wdWxhdGVfYmF0Y2hfc2Nhbl9yc3BfcXVldWUocEFkYXB0ZXIsIHBBcE1ldGFJbmZvLAorICAgICAgICAgICAgICAgIHBTY2FuTGlzdC0+c2NhbklkLCBpc0xhc3RBcCk7CisgICAgICAgICAgICBtdXRleF91bmxvY2soJnBBZGFwdGVyLT5oZGRfYmF0Y2hfc2Nhbl9sb2NrKTsKKworICAgICAgICAgICAgbmV4dEFwTWV0YUluZm9PZmZzZXQgKz0gc2l6ZW9mKHRTaXJCYXRjaFNjYW5OZXR3b3JrSW5mbyk7CisgICAgICAgICAgICBudW1BcE1ldGFJbmZvLS07CisgICAgICAgIH0KKworICAgICAgICBuZXh0U2Nhbkxpc3RPZmZzZXQgKz0g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XVlbnQgY2FsbHNzaG91bGQgcmV0dXJuIHRoZSByZW1haW5pbmcgZGF0YQorICAgICBzdGFydGluZyB3aXRoIHRoZSBuZXh0IHNjYW4gKG9wdGlvbmFsIC50cnVuY1xuLiwgLmFwY291bnQ9WFxuLiwgZXRjKS4KKyAgICAgVGhlIGZpbmFsIGJ1ZmZlciBzaG91bGQgZW5kIHdpdGggIi0tLS1cbiIqLworCisgICAvKnNhbml0eSovCisgICBpZiAoY3VyX2xlbiA+IHRvdF9sZW4pCisgICB7CisgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICIlczogaW52YWlkIGN1cl9sZW4gJWQgdG90X2xlbiAlZCIsIF9fZnVuY19fLCBjdXJfbGVuLCB0b3RfbGVuKTsKKyAgICAgICByZXR1cm4gMDsKKyAgIH0KKyAgIGVsc2UKKyAgIHsKKyAgICAgIHJlbV9sZW4gPSAodG90X2xlbiAtIGN1cl9sZW4pOworICAgfQorCisgICAvKmVuZCBzY2FuIG1hcmtlciovCisgICBpZiAocEFwTWV0YUluZm8tPkFwSW5mby5iYXRjaElkICE9IHBBZGFwdGVyLT5wcmV2X2JhdGNoX2lkKQorICAgeworICAgICAgIHRlbXBfbGVuID0gc25wcmludGYocFRlbXAsIHNpemVvZih0ZW1wKSwgIiMjIyNcbiIpOworICAgICAgIHBUZW1wICs9IHRlbXBfbGVuOworICAgICAgIHRlbXBfdG90YWxfbGVuICs9IHRlbXBfbGVuOworICAgfQorCisgICAvKmJzc2lkKi8KKyAgIHRlbXBfbGVuID0gc25wcmludGYocFRlbXAsIHNpemVvZih0ZW1wKSwKKyAgICAgICAgICAgICAgICAiYnNzaWQ9MHgleDoweCV4OjB4JXg6MHgleDoweCV4OjB4JXhcbiIsCisgICAgICAgICAgICAgICAgcEFwTWV0YUluZm8tPkFwSW5mby5ic3NpZFswXSwgcEFwTWV0YUluZm8tPkFwSW5mby5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9zY2FuX3JzcChwRGVzdCwgY3VyX2xlbiwgcmVtX2xlbiwgcEhlYWQsCisgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXIpOworICAgICAgICAgcERlc3QgKz0gbGVuOworICAgICAgICAgcERlc3QtLTsKKyAgICAgICAgIGN1cl9sZW4gKz0gbGVuOworICAgICAgICAgaWYoVFJVRSA9PSBwQWRhcHRlci0+aXNUcnVuY2F0ZWQpCisgICAgICAgICB7CisgICAgICAgICAgICAgIC8qcmVzdWx0IGlzIHRydW5jYXRlZCByZXR1cm4gcmVzdCBvZiBzY2FuIHJzcCBpbiBuZXh0IHJlcSovCisgICAgICAgICAgICAgIGN1cl9sZW4gPSByZW1fbGVuOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIH0KKyAgICAgICAgIHBQcmV2ID0gcEhlYWQ7CisgICAgICAgICBwSGVhZCA9IHBIZWFkLT5wTmV4dDsKKyAgICAgICAgIHBBZGFwdGVyLT5wQmF0Y2hTY2FuUnNwICA9IHBIZWFkOworICAgICAgICAgaWYgKFRSVUUgPT0gcFByZXYtPkFwSW5mby5pc0xhc3RBcCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgICBwQWRhcHRlci0+cHJldl9iYXRjaF9pZCA9IDA7CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICAgcEFkYXB0ZXItPnByZXZfYmF0Y2hfaWQgPSBwUHJldi0+QXBJbmZvLmJhdGNoSWQ7CisgICAgICAgICB9CisgICAgICAgICB2b3NfbWVtX2ZyZWUocFByZXYpOworICAgICAgICAgcFByZXYgPSBOVUxMOworICAgfQorCisgICByZXR1cm4gY3VyX2xlbjsKK30vKkVuZCBvZiBoZGRfcG9wdWxhdGVfdXNlcl9iYXRjaF9zY2FuX3JzcCovCisKKy8qKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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gICAgICAgICAgICAgICAgV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLCBwUmVxLAorICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwgaGRkX2JhdGNoX3NjYW5fcmVzdWx0X2luZF9jYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyKTsKKyAgICAgICAgaWYgKCBlSEFMX1NUQVRVU19TVUNDRVNTID09IGhhbFN0YXR1cyApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChUUlVFID09IHBBZGFwdGVyLT5oZGRfd2FpdF9mb3JfZ2V0X2JhdGNoX3NjYW5fcnNwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIElOSVRfQ09NUExFVElPTihwQWRhcHRlci0+aGRkX2dldF9iYXRjaF9zY2FuX3JlcV92YXIpOworICAgICAgICAgICAgICAgIHJjID0gd2FpdF9mb3JfY29tcGxldGlvbl90aW1lb3V0KAorICAgICAgICAgICAgICAgICAgICAgJnBBZGFwdGVyLT5oZGRfZ2V0X2JhdGNoX3NjYW5fcmVxX3ZhciwKKyAgICAgICAgICAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoSEREX0dFVF9CQVRDSF9TQ0FOX1JTUF9USU1FX09VVCkpOworICAgICAgICAgICAgICAgIGlmICgwID09IHJjKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICIlczogVGltZW91dCB3YWl0aW5nIHRvIGZldGNoIGJhdGNoIHNjYW4gcnNwIGZyb20gZnciLAorICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUZBVUxUOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbGVuID0gc25wcmludGYocERlc3QsIEhERF9CQVRDSF9TQ0FOX0FQX01FVEFfSU5GT19TSVpFLAorICAgICAgICAgICAgICAgICAgICAgICJzY2FuY291bnQ9JXVcbiIsIHBBZGFwdGVyLT5udW1TY2FuTGlzdCk7CisgICAgICAgICAgICBwRGVzdCArPSBsZW47CisgICAgICAgICAgICBjdXJfbGVuICs9IGxlbjsKKworICAgICAgICAgICAgbXV0ZXhfbG9jaygmcEFkYXB0ZXItPmhkZF9iYXRjaF9zY2FuX2xvY2spOworICAgICAgICAgICAgbGVuID0gaGRkX3BvcHVsYXRlX3VzZXJfYmF0Y2hfc2Nhbl9yc3AocEFkYXB0ZXIsIHBEZXN0LAorICAgICAgICAgICAgICAgICBjdXJfbGVuLCByZW1fbGVuKTsKKyAgICAgICAgICAgIG11dGV4X3VubG9jaygmcEFkYXB0ZXItPmhkZF9iYXRjaF9zY2FuX2xvY2spOworCisgICAgICAgICAgICBjb3VudCA9IDA7CisgICAgICAgICAgICBsZW4gPSAobGVuIC0gcFByaXZEYXRhLT51c2VkX2xlbik7CisgICAgICAgICAgICBwRGVzdCA9IChjb21tYW5kICsgcFByaXZEYXRhLT51c2VkX2xlbik7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiTkVXIEJBVENIIFNDQU4gUkVTVUxUOiIpOworICAgICAgICAgICAgd2hpbGUoY291bnQgPCBsZW4pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcHJpbnRrKCIlYyIsICoocERlc3QgKyBjb3VudCkpOworICAgICAgICAgICAgICAgIGNvdW50Kys7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiJXM6IGNvcHkgJWQgZGF0YSB0byB1c2VyIGJ1ZmZlciIsIF9fZnVuY19fLCBsZW4pOworICAgICAgICAgICAgaWYgKGNvcHlfdG9fdXNlcihwUHJpdkRhdGEtPmJ1ZiwgcERlc3QsIGxlbikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IGZhaWxlZCB0byBjb3B5IGRhdGEgdG8gdXNlciBidWZmZXIiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgcmV0dXJuIC1FRkFVTFQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgInNtZV9HZXRCYXRjaFNjYW5TY2FuICByZXR1cm5lZCBmYWlsdXJlIGhhbFN0YXR1cyAlZCIsCisgICAgICAgICAgICAgICAgaGFsU3RhdHVzKTsKKyAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBjb3VudCA9IDA7CisgICAgICAgIGxlbiA9IChsZW4gLSBwUHJpdkRhdGEtPnVzZWRfbGVuKTsKKyAgICAgICAgcERlc3QgPSAoY29tbWFuZCArIHBQcml2RGF0YS0+dXNlZF9sZW4pOworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAiUkVNQUlOSU5HIFRSVU5DQVRFRCBCQVRDSCBTQ0FOIFJFU1VMVDoiKTsKKyAgICAgICAgd2hpbGUoY291bnQgPCBsZW4pCisgICAgICAgIHsKKyAgICAgICAgICAgIHByaW50aygiJWMiLCAqKHBE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AgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICIlczogQmF0Y2ggc2NhbiBmZWF0dXJlIGlzIG5vdCBzdXBwb3J0ZWQgYnkgRlciLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICB9CisKKyAgICAgICAgIGxlbiA9IHNjbnByaW50ZihleHRyYSwgc2l6ZW9mKGV4dHJhKSwgIldMU19CQVRDSElOR19WRVJTSU9OICVkIiwKKyAgICAgICAgICAgICAgICAgICB2ZXJzaW9uKTsKKyAgICAgICAgIGlmIChjb3B5X3RvX3VzZXIocFByaXZkYXRhLT5idWYsICZleHRyYSwgbGVuICsgMSkpCisgICAgICAgICB7CisgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBmYWlsZWQgdG8gY29weSBkYXRhIHRvIHVzZXIgYnVmZmVyIiwgX19mdW5jX18pOworICAgICAgICAgICAgICByZXQgPSAtRUZBVUxUOworICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICB9CisgICAgICAgICByZXQgPSBIRERfQkFUQ0hfU0NBTl9WRVJTSU9OOworICAgIH0KKyAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJXTFNfQkFUQ0hJTkcgU0VUIiwgMTYpID09IDApCisgICAgeworICAgICAgICAgaW50ICAgICAgICAgICAgICAgICBzdGF0dXM7CisgICAgICAgICB0QU5JX1U4ICAgICAgICAgICAgICp2YWx1ZSA9IChjb21tYW5kICsgMTYpOworICAgICAgICAgZUhhbFN0YXR1cyAgICAgICAgICBoYWxTdGF0dXM7CisgICAgICAgICB1bnNpZ25lZCBsb25nICAgICAgIHJjOworICAgICAgICAgdFNpclNldEJhdGNoU2NhblJlcSAqcFJlcSA9ICZwQWRhcHRlci0+aGRkU2V0QmF0Y2hTY2FuUmVxOworICAgICAgICAgdFNpclNldEJhdGNoU2NhblJzcCAqcFJzcCA9ICZwQWRhcHRlci0+aGRkU2V0QmF0Y2hTY2FuUnNwOworCisgICAgICAgICBpZiAoRkFMU0UgPT0gc21lX0lzRmVhdHVyZVN1cHBvcnRlZEJ5RlcoQkFUQ0hfU0NBTikpCisgICAgICAgICB7CisgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IEJhdGNoIHNjYW4gZmVhdHVyZSBpcyBub3Qgc3VwcG9ydGVkIGJ5IEZXIiwgX19mdW5jX18pOworICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICB9CisKKyAgICAgICAgIGlmICgoV0xBTl9IRERfSU5GUkFfU1RBVElPTiAhPSBwQWRhcHRlci0+ZGV2aWNlX21vZGUpICYmCisgICAgICAgICAgICAgKFdMQU5fSEREX1AyUF9DTElFTlQgIT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKSAmJgorICAgICAgICAgICAgIChXTEFOX0hERF9QMlBfR08gIT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKSAmJgorICAgICAgICAgICAgIChXTEFOX0hERF9QMlBfREVWSUNFICE9IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkpCisgICAgICAgICB7CisgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICJSZWNlaXZlZCBXTFNfQkFUQ0hJTkcgU0VUIGNvbW1hbmQgaW4gaW52YWxpZCBtb2RlICVzICglZCkgIgorICAgICAgICAgICAgICAgICJXTFNfQkFUQ0hJTkdfU0VUIGlzIG9ubHkgYWxsb3dlZCBpbiBpbmZyYSBTVEEvUDJQIGNsaWVudCBtb2RlIiwKKyAgICAgICAgICAgICAgICAgaGRkX2RldmljZV9tb2RldG9TdHJpbmcocEFkYXB0ZXItPmRldmljZV9tb2RlKSwKKyAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPmRldmljZV9tb2RlKTsKKyAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgIH0KKworICAgICAgICAgc3RhdHVzID0gaGRkX3BhcnNlX3NldF9iYXRjaHNjYW5fY29tbWFuZCh2YWx1ZSwgcFJlcSk7CisgICAgICAgICBpZiAoc3RhdHVzKQorICAgICAgICAgeworICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiSW52YWxpZCBXTFNfQkFUQ0hJTkcgU0VUIGNvbW1hbmQiKTsKKyAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgIH0KKworCisgICAgICAgICBwQWRhcHRlci0+aGRkX3dhaXRfZm9yX3NldF9iYXRjaF9zY2FuX3JzcCA9IFRSVUU7CisgICAgICAgICBoYWxTdGF0dXMgPSBzbWVfU2V0QmF0Y2hTY2FuUmVxKFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwgcFJlcSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwgaGRkX3NldF9iYXRjaF9zY2FuX3JlcV9jYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXIpOworCisgICAgICAgICBpZiAoIGVIQUxfU1RBVFVTX1NVQ0NFU1MgPT0gaGFsU3RhdHVzICkKKyAgICAgICAgIHsKKyAgICAgICAgICAgICBjaGFyIGV4dHJhWzMyXTsKKyAgICAgICAgICAgICB0QU5JX1U4IGxlbiA9IDA7CisgICAgICAgICAgICAgdEFOSV9VOCBtU2NhbiA9IDA7CisKKyAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAic21lX1NldEJhdGNoU2NhblJlcSAgcmV0dXJuZWQgc3VjY2VzcyBoYWxTdGF0dXMgJWQiLAorICAgICAgICAgICAgICAgIGhhbFN0YXR1cyk7CisgICAgICAgICAgICAgaWYgKFRSVUUgPT0gcEFkYXB0ZXItPmhkZF93YWl0X2Zvcl9zZXRfYmF0Y2hfc2Nhbl9yc3ApCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBJTklUX0NPTVBMRVRJT04ocEFkYXB0ZXItPmhkZF9zZXRfYmF0Y2hfc2Nhbl9yZXFfdmFyKTsKKyAgICAgICAgICAgICAgICAgcmMgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX3RpbWVvdXQoCisgICAgICAgICAgICAgICAgICAgICAgJnBBZGFwdGVyLT5oZGRfc2V0X2JhdGNoX3NjYW5fcmVxX3ZhciwKKyAgICAgICAgICAgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKEhERF9TRVRfQkFUQ0hfU0NBTl9SRVFfVElNRV9PVVQpKTsKKyAgICAgICAgICAgICAgICAgaWYgKDAgPT0gcmMpCisgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICIlczogVGltZW91dCB3YWl0aW5nIGZvciBzZXQgYmF0Y2ggc2NhbiB0byBjb21wbGV0ZSIsCisgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgfQorICAgICAgICAgICAgIGlmICggIXBSc3AtPm5TY2Fuc1RvQmF0Y2ggKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIiVzOiBSZWNlaXZlZCBzZXQgYmF0Y2ggc2NhbiBmYWlsdXJlIHJlc3BvbnNlIGZyb20gRlciLAorICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAvKkFzIHBlciB0aGUgQmF0Y2ggU2NhbiBGcmFtZXdvcmsgQVBJIHdlIHNob3VsZCByZXR1cm4gdGhlIE1JTiBvZgorICAgICAgICAgICAgICAgZWl0aGVyIE1TQ0FOIG9yIHRoZSBtYXggIyBvZiBzY2FucyBmaXJtd2FyZSBjYW4gY2FjaGUqLworICAgICAgICAgICAgIG1TY2FuID0gTUlOKHBSZXEtPm51bWJlck9mU2NhbnNUb0JhdGNoICwgcFJzcC0+blNjYW5zVG9CYXRjaCk7CisKKyAgICAgICAgICAgICBwQWRhcHRlci0+YmF0Y2hTY2FuU3RhdGUgPSBlSEREX0JBVENIX1NDQU5fU1RBVEVfU1RBUlRFRDsKKworICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogcmVxdWVzdCBNU0NBTiAlZCByZXNwb25zZSBNU0NBTiAlZCByZXQgJWQiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fLCBwUmVxLT5udW1iZXJPZlNjYW5zVG9CYXRjaCwgcFJzcC0+blNjYW5zVG9CYXRjaCwgbVNjYW4pOworICAgICAgICAgICAgIGxlbiA9IHNjbnByaW50ZihleHRyYSwgc2l6ZW9mKGV4dHJhKSwgIiVkIiwgbVNjYW4pOworICAgICAgICAgICAgIGlmIChjb3B5X3RvX3VzZXIocFByaXZkYXRhLT5idWYsICZleHRyYSwgbGVuICsgMSkpCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICIlczogZmFpbGVkIHRvIGNvcHkgTVNDQU4gdmFsdWUgdG8gdXNlciBidWZmZXIiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgIHJldCA9IC1FRkFVTFQ7CisgICAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICJzbWVfU2V0QmF0Y2hTY2FuUmVxICByZXR1cm5lZCBmYWlsdXJlIGhhbFN0YXR1cyAlZCIsCisgICAgICAgICAgICAgICAgaGFsU3RhdHVzKTsKKyAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoc3RybmNtcChjb21tYW5kLCAiV0xTX0JBVENISU5HIFNUT1AiLCAxNykgPT0gMCkKKyAgICB7CisgICAgICAgICBlSGFsU3RhdHVzIGhhbFN0YXR1czsKKyAgICAgICAgIHRTaXJTdG9wQmF0Y2hTY2FuSW5kICpwSW5kID0gJnBBZGFwdGVyLT5oZGRTdG9wQmF0Y2hTY2FuSW5kOworICAgICAgICAgcEluZC0+cGFyYW0gPSAwOworCisgICAgICAgICBpZiAoRkFMU0UgPT0gc21lX0lzRmVhdHVyZVN1cHBvcnRlZEJ5RlcoQkFUQ0hfU0NBTikpCisgICAgICAgICB7CisgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IEJhdGNoIHNjYW4gZmVhdHVyZSBpcyBub3Qgc3VwcG9ydGVkIGJ5IEZXIiwgX19mdW5jX18pOworICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICB9CisKKyAgICAgICAgIGlmIChlSEREX0JBVENIX1NDQU5fU1RBVEVfU1RBUlRFRCAhPSAgcEFkYXB0ZXItPmJhdGNoU2NhblN0YXRlKQorICAgICAgICAgeworICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgICAiQmF0Y2ggc2NhbiBpcyBub3QgeWV0IGVuYWJsZWQgYmF0Y2ggc2NhbiBzdGF0ZSAlZCIsCisgICAgICAgICAgICAgICAgcEFkYXB0ZXItPmJhdGNoU2NhblN0YXRlKTsKKyAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgfQorCisgICAgICAgICBtdXRleF9sb2NrKCZwQWRhcHRlci0+aGRkX2JhdGNoX3NjYW5fbG9jayk7CisgICAgICAgICBoZGRfZGVpbml0X2JhdGNoX3NjYW4ocEFkYXB0ZXIpOworICAgICAgICAgbXV0ZXhfdW5sb2NrKCZwQWRhcHRlci0+aGRkX2JhdGNoX3NjYW5fbG9jayk7CisKKyAgICAgICAgIHBBZGFwdGVyLT5iYXRjaFNjYW5TdGF0ZSA9IGVIRERfQkFUQ0hfU0NBTl9TVEFURV9TVE9QUEVEOworCisgICAgICAgICBoYWxTdGF0dXMgPSBzbWVfU3RvcEJhdGNoU2NhbkluZChXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksIHBJbmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQpOworICAgICAgICAgaWYgKCBlSEFMX1NUQVRVU19TVUNDRVNTID09IGhhbFN0YXR1cyApCisgICAgICAgICB7CisgICAgICAgICAgICAgcmV0ID0gMDsKKyAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAic21lX1N0b3BCYXRjaFNjYW5JbmQgIHJldHVybmVkIHN1Y2Nlc3MgaGFsU3RhdHVzICVkIiwKKyAgICAgICAgICAgICAgICBoYWxTdGF0dXMpOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAic21lX1N0b3BCYXRjaFNjYW5JbmQgIHJldHVybmVkIGZhaWx1cmUgaGFsU3RhdHVzICVkIiwKKyAgICAgICAgICAgICAgICBoYWxTdGF0dXMpOworICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJXTFNfQkFUQ0hJTkcgR0VUIiwgMTYpID09IDApCisgICAgeworICAgICAgICAgIHRBTklfVTMyIHJlbWFpbl9sZW47CisKKyAgICAgICAgICBpZiAoRkFMU0UgPT0gc21lX0lzRmVhdHVyZVN1cHBvcnRlZEJ5RlcoQkFUQ0hfU0NBTikpCisgICAgICAgICAgeworICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOiBCYXRjaCBzY2FuIGZlYXR1cmUgaXMgbm90IHN1cHBvcnRlZCBieSBGVyIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgIH0KKworICAgICAgICAgIGlmIChlSEREX0JBVENIX1NDQU5fU1RBVEVfU1RBUlRFRCAhPSAgcEFkYXB0ZXItPmJhdGNoU2NhblN0YXRlKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgIkJhdGNoIHNjYW4gaXMgbm90IHlldCBlbmFibGVkIGNvdWxkIG5vdCByZXR1cm4gcmVzdWx0cyIKKyAgICAgICAgICAgICAgICAiQmF0Y2ggU2NhbiBzdGF0ZSAlZCIsCisgICAgICAgICAgICAgICAgcEFkYXB0ZXItPmJhdGNoU2NhblN0YXRlKTsKKyAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgIH0KKworICAgICAgICAgIHBQcml2ZGF0YS0+dXNlZF9sZW4gPSAxNjsKKyAgICAgICAgICByZW1haW5fbGVuID0gcFByaXZkYXRhLT50b3RhbF9sZW4gLSBwUHJpdmRhdGEtPnVzZWRfbGVuOworICAgICAgICAgIGlmIChyZW1haW5fbGVuIDwgcFByaXZkYXRhLT50b3RhbF9sZW4pCisgICAgICAgICAgeworICAgICAgICAgICAgICAvKkNsZWFyIHByZXZpb3VzIGJhdGNoIHNjYW4gcmVzcG9uc2UgZGF0YSBpZiBhbnkqLworICAgICAgICAgICAgICB2b3NfbWVtX3plcm8oKHR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G9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIEZMKCJpbnZhbGlkIGNvbnRleHQgbWFnaWM6ICUwOHgiKSwgZndTdGF0c0N0eC0+bWFnaWMpOworICAgICAgICBzcGluX3VubG9jaygmaGRkX2NvbnRleHRfbG9jayk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgcEFkYXB0ZXIgPSBmd1N0YXRzQ3R4LT5wQWRhcHRlcjsKKyAgICBpZiAoKE5VTEwgPT0gcEFkYXB0ZXIpIHx8IChXTEFOX0hERF9BREFQVEVSX01BR0lDICE9IHBBZGFwdGVyLT5tYWdpYykpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICBGTCgicEFkYXB0ZXIgcmV0dXJuZWQgaXMgTlVMTCBvciBpbnZhbGlkIikpOworICAgICAgICBzcGluX3VubG9jaygmaGRkX2NvbnRleHRfbG9jayk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgcEFkYXB0ZXItPmZ3U3RhdHNSc3AudHlwZSA9IDA7CisgICAgaWYgKChWT1NfU1RBVFVTX1NVQ0NFU1MgPT0gc3RhdHVzKSAmJiAoTlVMTCAhPSBmd1N0YXRzUmVzdWx0KSkKKyAgICB7CisgICAgICAgIHN3aXRjaCggZndTdGF0c1Jlc3VsdC0+dHlwZSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGNhc2UgRldfVUJTUF9TVEFUUzoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgbWVtY3B5KCZwQWRhcHRlci0+ZndTdGF0c1JzcCxmd1N0YXRzUmVzdWx0LHNpemVvZih0U2lyRndTdGF0c1Jlc3VsdCkpOworICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICBGTCgidWJzcF9lbnRlcl9jbnQgPSAlZCB1YnNwX2p1bXBfZGRyX2NudCA9ICVkIiksCisgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+ZndTdGF0c1JzcC5md1N0YXRzRGF0YS51YnNwU3RhdHMudWJzcF9lbnRlcl9jbnQsCisgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+ZndTdGF0c1JzcC5md1N0YXRzRGF0YS51YnNwU3RhdHMudWJzcF9qdW1wX2Rkcl9jbnQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgIEZMKCIgTm8gaGFuZGxpbmcgZm9yIHN0YXRzIHR5cGUgJWQiKSxmd1N0YXRzUmVzdWx0LT50eXBlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICB9CisgICAgY29tcGxldGUoJihmd1N0YXRzQ3R4LT5jb21wbGV0aW9uKSk7CisgICAgc3Bpbl91bmxvY2soJmhkZF9jb250ZXh0X2xvY2spOworICAgIHJldHVybjsKK30KKworc3RhdGljIGludCBoZGRfZ2V0X2R3ZWxsX3RpbWUoaGRkX2NvbmZpZ190ICpwQ2ZnLCB0QU5JX1U4ICpjb21tYW5kLCBjaGFyICpleHRyYSwgdEFOSV9VOCBuLCB0QU5JX1U4ICpsZW4pCit7CisgICAgaW50IHJldCA9IDA7CisKKyAgICBpZiAoIXBDZmcgfHwgIWNvbW1hbmQgfHwgIWV4dHJhIHx8ICFsZW4pCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgIiVzOiBhcmd1bWVudCBwYXNzc2VkIGZvciBHRVREV0VMTFRJTUUgaXMgaW5jb3JyZWN0IiwgX19mdW5jX18pOworICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKworICAgIGlmIChzdHJuY21wKGNvbW1hbmQsICJHRVREV0VMTFRJTUUgQUNUSVZFIE1BWCIsIDIzKSA9PSAwKQorICAgIHsKKyAgICAgICAgKmxlbiA9IHNjbnByaW50ZihleHRyYSwgbiwgIkdFVERXRUxMVElNRSBBQ1RJVkUgTUFYICV1XG4iLAorICAgICAgICAgICAgICAgIChpbnQpcENmZy0+bkFjdGl2ZU1heENoblRpbWUpOworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKyAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJHRVREV0VMTFRJTUUgQUNUSVZFIE1JTiIsIDIzKSA9PSAwKQorICAgIHsKKyAgICAgICAgKmxlbiA9IHNjbnByaW50ZihleHRyYSwgbiwgIkdFVERXRUxMVElNRSBBQ1RJVkUgTUlOICV1XG4iLAorICAgICAgICAgICAgICAgIChpbnQpcENmZy0+bkFjdGl2ZU1pbkNoblRpbWUpOworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKyAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJHRVREV0VMTFRJTUUgUEFTU0lWRSBNQVgiLCAyNCkgPT0gMCkKKyAgICB7CisgICAgICAgICpsZW4gPSBzY25wcmludGYoZXh0cmEsIG4sICJHRVREV0VMTFRJTUUgUEFTU0lWRSBNQVggJXVcbiIsCisgICAgICAgICAgICAgICAgKGludClwQ2ZnLT5uUGFzc2l2ZU1heENoblRpbWUpOworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKyAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJHRVREV0VMTFRJTUUgUEFTU0lWRSBNSU4iLCAyNCkgPT0gMCkKKyAgICB7CisgICAgICAgICpsZW4gPSBzY25wcmludGYoZXh0cmEsIG4sICJHRVREV0VMTFRJTUUgUEFTU0lWRSBNSU4gJXVcbiIsCisgICAgICAgICAgICAgICAgKGludClwQ2ZnLT5uUGFzc2l2ZU1pbkNoblRpbWUpOworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKyAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJHRVREV0VMTFRJTUUiLCAxMikgPT0gMCkKKyAgICB7CisgICAgICAgICpsZW4gPSBzY25wcmludGYoZXh0cmEsIG4sICJHRVREV0VMTFRJTUUgJXUgXG4iLAorICAgICAgICAgICAgICAgIChpbnQpcENmZy0+bkFjdGl2ZU1heENoblRpbWUpOworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICByZXQgPSAtRUlOVkFMOworICAgIH0KKworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQgaGRkX3NldF9kd2VsbF90aW1lKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLCB0QU5JX1U4ICpjb21tYW5kKQoreworICAgIHRIYWxIYW5kbGUgaEhhbDsKKyAgICBoZGRfY29uZmlnX3QgKnBDZmc7CisgICAgdEFOSV9VOCAqdmFsdWUgPSBjb21tYW5kOworICAgIGludCB2YWwgPSAwLCByZXQgPSAwLCB0ZW1wID0gMDsKKyAgICB0U21lQ29uZmlnUGFyYW1zIHNtZUNvbmZpZzsKKworICAgIGlmICghcEFkYXB0ZXIgfHwgIWNvbW1hbmQgfHwgIShwQ2ZnID0gKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+Y2ZnX2luaSkKKyAgICAgICAgfHwgIShoSGFsID0gKFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSkpKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgIiVzOiBhcmd1bWVudCBwYXNzZWQgZm9yIFNFVERXRUxMVElNRSBpcyBpbmNvcnJlY3QiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorCisgICAgdm9zX21lbV96ZXJvKCZzbWVDb25maWcsIHNpemVvZihzbWVDb25maWcpKTsKKyAgICBzbWVfR2V0Q29uZmlnUGFyYW0oaEhhbCwgJnNtZUNvbmZpZyk7CisKKyAgICBpZiAoc3RybmNtcChjb21tYW5kLCAiU0VURFdFTExUSU1FIEFDVElWRSBNQVgiLCAyMykgPT0gMCApCisgICAgeworICAgICAgICB2YWx1ZSA9IHZhbHVlICsgMjQ7CisgICAgICAgIHRlbXAgPSBrc3RydG91MzIodmFsdWUsIDEwLCAmdmFsKTsKKyAgICAgICAgaWYgKHRlbXAgIT0gMCB8fCB2YWwgPCBDRkdfQUNUSVZFX01BWF9DSEFOTkVMX1RJTUVfTUlOIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgdmFsID4gQ0ZHX0FDVElWRV9NQVhfQ0hBTk5FTF9USU1FX01BWCApCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAiJXM6IGFyZ3VtZW50IHBhc3NlZCBmb3IgU0VURFdFTExUSU1FIEFDVElWRSBNQVggaXMgaW5jb3JyZWN0IiwgX19mdW5jX18pOworICAgICAgICAgICAgcmV0ID0gLUVGQVVMVDsKKyAgICAgICAgICAgIHJldHVybiByZXQ7CisgICAgICAgIH0KKyAgICAgICAgcENmZy0+bkFjdGl2ZU1heENoblRpbWUgPSB2YWw7CisgICAgICAgIHNtZUNvbmZpZy5jc3JDb25maWcubkFjdGl2ZU1heENoblRpbWUgPSB2YWw7CisgICAgICAgIHNtZV9VcGRhdGVDb25maWcoaEhhbCwgJnNtZUNvbmZpZyk7CisgICAgfQorICAgIGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIlNFVERXRUxMVElNRSBBQ1RJVkUgTUlOIiwgMjMpID09IDApCisgICAgeworICAgICAgICB2YWx1ZSA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ICAgICAgIHJldCA9IC1FRkFVTFQ7CisgICAgICAgICAgICByZXR1cm4gcmV0OworICAgICAgICB9CisgICAgICAgIHBDZmctPm5QYXNzaXZlTWluQ2huVGltZSA9IHZhbDsKKyAgICAgICAgc21lQ29uZmlnLmNzckNvbmZpZy5uUGFzc2l2ZU1pbkNoblRpbWUgPSB2YWw7CisgICAgICAgIHNtZV9VcGRhdGVDb25maWcoaEhhbCwgJnNtZUNvbmZpZyk7CisgICAgfQorICAgIGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIlNFVERXRUxMVElNRSIsIDEyKSA9PSAwKQorICAgIHsKKyAgICAgICAgdmFsdWUgPSB2YWx1ZSArIDEzOworICAgICAgICB0ZW1wID0ga3N0cnRvdTMyKHZhbHVlLCAxMCwgJnZhbCk7CisgICAgICAgIGlmICh0ZW1wICE9IDAgfHwgdmFsIDwgQ0ZHX0FDVElWRV9NQVhfQ0hBTk5FTF9USU1FX01JTiB8fAorICAgICAgICAgICAgICAgICAgICAgICAgIHZhbCA+IENGR19BQ1RJVkVfTUFYX0NIQU5ORUxfVElNRV9NQVggKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgIiVzOiBhcmd1bWVudCBwYXNzZWQgZm9yIFNFVERXRUxMVElNRSBpcyBpbmNvcnJlY3QiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICByZXQgPSAtRUZBVUxUOworICAgICAgICAgICAgcmV0dXJuIHJldDsKKyAgICAgICAgfQorICAgICAgICBwQ2ZnLT5uQWN0aXZlTWF4Q2huVGltZSA9IHZhbDsKKyAgICAgICAgc21lQ29uZmlnLmNzckNvbmZpZy5uQWN0aXZlTWF4Q2huVGltZSA9IHZhbDsKKyAgICAgICAgc21lX1VwZGF0ZUNvbmZpZyhoSGFsLCAmc21lQ29uZmlnKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICB9CisKKyAgICByZXR1cm4gcmV0OworfQorc3RhdGljIGludCBoZGRfY21kX3NldEZjY0NoYW5uZWwoaGRkX2NvbnRleHRfdCAqcEhkZEN0eCwgdEFOSV9VOCAqY21kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGNtZF9sZW4pCit7CisgICAgdEFOSV9VOCAqdmFsdWU7CisgICAgdEFOSV9VOCBmY2NfY29uc3RyYWludDsKKworICAgIGVIYWxTdGF0dXMgc3RhdHVzOworICAgIGludCByZXQgPSAwOworICAgIHZhbHVlID0gIGNtZCArIGNtZF9sZW4gKyAxOworCisgICAgcmV0ID0ga3N0cnRvdTgodmFsdWUsIDEwLCAmZmNjX2NvbnN0cmFpbnQpOworICAgIGlmICgocmV0IDwgMCkgfHwgKGZjY19jb25zdHJhaW50ID4gMSkpIHsKKyAgICAgICAvKgorICAgICAgICAqICBJZiB0aGUgaW5wdXQgdmFsdWUgaXMgZ3JlYXRlciB0aGFuIG1heCB2YWx1ZSBvZiBkYXRhdHlwZSwKKyAgICAgICAgKiAgdGhlbiBhbHNvIGl0IGlzIGEgZmFpbHVyZQorICAgICAgICAqLworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAiJXM6IHZhbHVlIG91dCBvZiByYW5nZSIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgc3RhdHVzID0gc21lX2hhbmRsZVNldEZjY0NoYW5uZWwocEhkZEN0eC0+aEhhbCwgZmNjX2NvbnN0cmFpbnQpOworICAgIGlmIChzdGF0dXMgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgcmV0ID0gLUVQRVJNOworCisgICAgcmV0dXJuIHJldDsKK30KKworLyoqLS0tLS0tLS0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bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgaWYgKDAgIT0gc3RhdHVzKQorICAgeworICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgZ290byBleGl0OworICAgfQorICAgLyogQWxsb2NhdGUgKzEgZm9yICdcMCcgKi8KKyAgIGNvbW1hbmQgPSBrbWFsbG9jKHByaXZfZGF0YS50b3RhbF9sZW4gKyAxLCBHRlBfS0VSTkVMKTsKKyAgIGlmICghY29tbWFuZCkKKyAgIHsKKyAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAiJXM6IGZhaWxlZCB0byBhbGxvY2F0ZSBtZW1vcnkiLCBfX2Z1bmNfXyk7CisgICAgICAgcmV0ID0gLUVOT01FTTsKKyAgICAgICBnb3RvIGV4aXQ7CisgICB9CisKKyAgIGlmIChjb3B5X2Zyb21fdXNlcihjb21tYW5kLCBwcml2X2RhdGEuYnVmLCBwcml2X2RhdGEudG90YWxfbGVuKSkKKyAgIHsKKyAgICAgICByZXQgPSAtRUZBVUxUOworICAgICAgIGdvdG8gZXhpdDsKKyAgIH0KKworICAgLyogTWFrZSBzdXJlIHRoZSBjb21tYW5kIGlzIE5VTC10ZXJtaW5hdGVkICovCisgICBjb21tYW5kW3ByaXZfZGF0YS50b3RhbF9sZW5dID0gJ1wwJzsKKworICAgLyogYXQgb25lIHRpbWUgdGhlIGZvbGxvd2luZyBibG9jayBvZiBjb2RlIHdhcyBjb25kaXRpb25hbC4gYnJhY2VzCisgICAgKiBoYXZlIGJlZW4gcmV0YWluZWQgdG8gYXZvaWQgcmUtaW5kZW50aW5nIHRoZSBsZWdhY3kgY29kZQorICAgICovCisgICB7CisgICAgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IChoZGRfY29udGV4dF90KilwQWRhcHRlci0+cEhkZEN0eDsKKworICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgIiVzOiBSZWNlaXZlZCAlcyBjbWQgZnJvbSBXaS1GaSBHVUkqKioiLCBfX2Z1bmNfXywgY29tbWFuZCk7CisKKyAgICAgICBpZiAoc3RybmNtcChjb21tYW5kLCAiUDJQX0RFVl9BRERSIiwgMTIpID09IDAgKQorICAgICAgIHsKKyAgICAgICAgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX0hERCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX0hERF9QMlBfREVWX0FERFJfSU9DVEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwgKHVuc2lnbmVkKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqKHBIZGRDdHgtPnAycERldmljZUFkZHJlc3MuYnl0ZXMrMik8PDI0IHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwSGRkQ3R4LT5wMnBEZXZpY2VBZGRyZXNzLmJ5dGVzKzMpPDwxNiB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEhkZEN0eC0+cDJwRGV2aWNlQWRkcmVzcy5ieXRlcys0KTw8OCAgfAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBIZGRDdHgtPnAycERldmljZUFkZHJlc3MuYnl0ZXMrNSkpKSk7CisgICAgICAgICAgIGlmIChjb3B5X3RvX3VzZXIocHJpdl9kYXRhLmJ1ZiwgcEhkZEN0eC0+cDJwRGV2aWNlQWRkcmVzcy5ieXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSkpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICIlczogZmFpbGVkIHRvIGNvcHkgZGF0YSB0byB1c2VyIGJ1ZmZlciIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FRkFVTFQ7CisgICAgICAgICAgIH0KKyAgICAgICB9CisgICAgICAgZWxzZSBpZihzdHJuY21wKGNvbW1hbmQsICJTRVRCQU5EIiwgNykgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIHRBTklfVTggKnB0ciA9IGNvbW1hbmQgOworCisgICAgICAgICAgIC8qIENoYW5nZSBiYW5kIHJlcXVlc3QgcmVjZWl2ZWQgKi8KKworICAgICAgICAgICAvKiBGaXJzdCA4IGJ5dGVzIHdpbGwgaGF2ZSAiU0VUQkFORCAiIGFuZAorICAgICAgICAgICAgKiA5IGJ5dGUgd2lsbCBoYXZlIGJhbmQgc2V0dGluZyB2YWx1ZSAqLworICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAiJXM6IFNldEJhbmRDb21tYW5kIEluZm8gIGNvbW0gJXMgVUwgJWQsIFRMICVkIiwgX19mdW5jX18sIGNvbW1hbmQsIHByaXZfZGF0YS51c2VkX2xlbiwgcHJpdl9kYXRhLnRvdGFsX2xlbik7CisgICAgICAgICAgIGlmKFZPU19GVE1fTU9ERSAhPSBoZGRfZ2V0X2NvbnBhcmFtKCkpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8qIENoYW5nZSBiYW5kIHJlcXVlc3QgcmVjZWl2ZWQgKi8KKyAgICAgICAgICAgICAgIHJldCA9IGhkZF9zZXRCYW5kX2hlbHBlcihwQWRhcHRlci0+ZGV2LCBwdHIpOworICAgICAgICAgICAgICAgaWYocmV0IDwgMCkKKyAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IGZhaWxlZCB0byBzZXQgYmFuZCByZXQ9JWQiLCBfX2Z1bmNfXywgcmV0KTsKKyAgICAgICAgICAgfQorICAgICAgIH0KKyAgICAgICBlbHNlIGlmKHN0cm5jbXAoY29tbWFuZCwgIlNFVFdNTVBTIiwgOCkgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIHRBTklfVTggKnB0ciA9IGNvbW1hbmQ7CisgICAgICAgICAgIHJldCA9IGhkZF93bW1wc19oZWxwZXIocEFkYXB0ZXIsIHB0cik7CisgICAgICAgfQorCisgICAgICAgZWxzZSBpZihzdHJuY21wKGNvbW1hbmQsICJURExTU0NBTiIsIDgpID09IDApCisgICAgICAgeworICAgICAgICAgICB0QU5JX1U4ICpwdHIgID0gY29tbWFuZDsKKyAgICAgICAgICAgcmV0ID0gaGRkX3NldF90ZGxzX3NjYW5fdHlwZShwQWRhcHRlciwgcHRyKTsKKyAgICAgICB9CisKKyAgICAgICBlbHNlIGlmICggc3RybmNhc2VjbXAoY29tbWFuZCwgIkNPVU5UUlkiLCA3KSA9PSAwICkKKyAgICAgICB7CisgICAgICAgICAgIGNoYXIgKmNvdW50cnlfY29kZTsKKworICAgICAgICAgICBjb3VudHJ5X2NvZGUgPSBjb21tYW5kICsgODsKKworICAgICAgICAgICBJTklUX0NPTVBMRVRJT04ocEFkYXB0ZXItPmNoYW5nZV9jb3VudHJ5X2NvZGUpOworICAgICAgICAgICBoZGRfY2hlY2thbmR1cGRhdGVfZGZzc2V0dGluZyhwQWRhcHRlciwgY291bnRyeV9jb2RlKTsKKyNpZm5kZWYgQ09ORklHX0VOQUJMRV9MSU5VWF9SRUcKKyAgICAgICAgICAgaGRkX2NoZWNrYW5kdXBkYXRlX3BoeW1vZGUocEFkYXB0ZXIsIGNvdW50cnlfY29kZSk7CisjZW5kaWYKKyAgICAgICAgICAgcmV0ID0gKGludClzbWVfQ2hhbmdlQ291bnRyeUNvZGUocEhkZEN0eC0+aEhhbCwKKyAgICAgICAgICAgICAgICAgICh2b2lkICopKHRTbWVDaGFuZ2VDb3VudHJ5Q2FsbGJhY2spCisgICAgICAgICAgICAgICAgICAgIHdsYW5faGRkX2NoYW5nZV9jb3VudHJ5X2NvZGVfY2FsbGJhY2ssCisgICAgICAgICAgICAgICAgICAgICBjb3VudHJ5X2NvZGUsIHBBZGFwdGVyLCBwSGRkQ3R4LT5wdm9zQ29udGV4dCwgZVNJUl9UUlVFLCBlU0lSX1RSVUUpOworICAgICAgICAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyA9PSByZXQpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHJldCA9IHdhaXRfZm9yX2NvbXBsZXRpb25faW50ZXJydXB0aWJsZV90aW1lb3V0KAorICAgICAgICAgICAgICAgICAgICAgICAmcEFkYXB0ZXItPmNoYW5nZV9jb3VudHJ5X2NvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcyhXTEFOX1dBSVRfVElNRV9DT1VOVFJZKSk7CisgICAgICAgICAgICAgICBpZiAoMCA+PSByZXQpCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiBTTUUgd2hpbGUgc2V0dGluZyBjb3VudHJ5IGNvZGUgdGltZWQgb3V0ICVkIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcmV0KTsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgfQorICAgICAgICAgICBlbHNlCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICIlczogU01FIENoYW5nZSBDb3VudHJ5IGNvZGUgZmFpbCByZXQ9JWQiLCBfX2Z1bmNfXywgcmV0KTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgIH0KKworICAgICAgIH0KKyAgICAgICAvKgorICAgICAgICAgIGNvbW1hbmQgc2hvdWxkIGJlIGEgc3RyaW5nIGhhdmluZyBmb3JtYXQKKyAgICAgICAgICBTRVRfU0FQX0NIQU5ORUxfTElTVCA8bnVtIG9mIGNoYW5uZWxzPiA8dGhlIGNoYW5uZWxzIHNlcGVyYXRlZCBieSBzcGFjZXM+CisgICAgICAgKi8KKyAgICAgICBlbHNlIGlmKHN0cm5jbXAoY29tbWFuZCwgIlNFVF9TQVBfQ0hBTk5FTF9MSVNUIiwgMjApID09IDApCisgICAgICAgeworICAgICAgICAgICB0QU5JX1U4ICpwdHIgPSBjb21tYW5kOworCisgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICIgUmVjZWl2ZWQgQ29tbWFuZCB0byBTZXQgUHJlZmVycmVkIENoYW5uZWxzIGZvciBTQVAgaW4gJXMiLCBfX2Z1bmNfXyk7CisKKyAgICAgICAgICAgcmV0ID0gc2FwU2V0UHJlZmVycmVkQ2hhbm5lbChwdHIpOworICAgICAgIH0KKyAgICAgICBlbHNlIGlmKHN0cm5jbXAoY29tbWFuZCwgIlNFVFNVU1BFTkRNT0RFIiwgMTQpID09IDApCisgICAgICAgeworICAgICAgICAgICBpbnQgc3VzcGVuZCA9IDA7CisgICAgICAgICAgIHRBTklfVTggKnB0ciA9ICh0QU5JX1U4Kiljb21tYW5kICsgMTU7CisKKyAgICAgICAgICAgc3VzcGVuZCA9ICpwdHIgLSAnMCc7CisgICAgICAgICAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfSERELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX0hERF9TRVRTVVNQRU5ETU9ERV9JT0NUTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwgc3VzcGVuZCkpOworICAgICAgICAgICBoZGRfc2V0X3dsYW5fc3VzcGVuZF9tb2RlKHN1c3BlbmQpOworICAgICAgIH0KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfTkVJR0hCT1JfUk9BTUlORworICAgICAgIGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIlNFVFJPQU1UUklHR0VSIiwgMTQpID09IDApCisgICAgICAgeworICAgICAgICAgICB0QU5JX1U4ICp2YWx1ZSA9IGNvbW1hbmQ7CisgICAgICAgICAgIHRBTklfUzggcnNzaSA9IDA7CisgICAgICAgICAgIHRBTklfVTggbG9va1VwVGhyZXNob2xkID0gQ0ZHX05FSUdIQk9SX0xPT0tVUF9SU1NJX1RIUkVTSE9MRF9ERUZBVUxUOworICAgICAgICAgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisKKyAgICAgICAgICAgLyogTW92ZSBwb2ludGVyIHRvIGFoZWFkIG9mIFNFVFJPQU1UUklHR0VSPGRlbGltaXRlcj4gKi8KKyAgICAgICAgICAgdmFsdWUgPSB2YWx1ZSArIDE1OworCisgICAgICAgICAgIC8qIENvbnZlcnQgdGhlIHZhbHVlIGZyb20gYXNjaWkgdG8gaW50ZWdlciAqLworICAgICAgICAgICByZXQgPSBrc3RydG9zOCh2YWx1ZSwgMTAsICZyc3NpKTsKKyAgICAgICAgICAgaWYgKHJldCA8IDApCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8qIElmIHRoZSBpbnB1dCB2YWx1ZSBpcyBncmVhdGVyIHRoYW4gbWF4IHZhbHVlIG9mIGRhdGF0eXBlLCB0aGVuIGFsc28KKyAgICAgICAgICAgICAgICAgIGtzdHJ0b3U4IGZhaWxzICovCisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBrc3RydG91OCBmYWlsZWQgSW5wdXQgdmFsdWUgbWF5IGJlIG91dCBvZiByYW5nZVslZCAtICVkXSIsCisgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgQ0ZHX05FSUdIQk9SX0xPT0tVUF9SU1NJX1RIUkVTSE9MRF9NSU4sCisgICAgICAgICAgICAgICAgICAgICAgQ0ZHX05FSUdIQk9SX0xPT0tVUF9SU1NJX1RIUkVTSE9MRF9NQVgpOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorCisgICAgICAgICAgIGxvb2tVcFRocmVzaG9sZCA9IGFicyhyc3NpKTsKKworICAgICAgICAgICBpZiAoKGxvb2tVcFRocmVzaG9sZCA8IENGR19ORUlHSEJPUl9MT09LVVBfUlNTSV9USFJFU0hPTERfTUlOKSB8fAorICAgICAgICAgICAgICAgKGxvb2tVcFRocmVzaG9sZCA+IENGR19ORUlHSEJPUl9MT09LVVBfUlNTSV9USFJFU0hPTERfTUFYKSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICJOZWlnaGJvciBsb29rdXAgdGhyZXNob2xkIHZhbHVlICVkIGlzIG91dCBvZiByYW5nZSIKKyAgICAgICAgICAgICAgICAgICAgICAiIChNaW46ICVkIE1heDogJWQpIiwgbG9va1VwVGhyZXNob2xkLAorICAgICAgICAgICAgICAgICAgICAgIENGR19ORUlHSEJPUl9MT09LVVBfUlNTSV9USFJFU0hPTERfTUlOLAorICAgICAgICAgICAgICAgICAgICAgIENGR19ORUlHSEJPUl9MT09LVVBfUlNTSV9USFJFU0hPTERfTUFYKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKworICAgICAgICAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfSERELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfSEREX1NFVFJPQU1UUklHR0VSX0lPQ1RMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsIGxvb2tVcFRocmVzaG9sZCkpOworICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IFJlY2VpdmVkIENvbW1hbmQgdG8gU2V0IFJvYW0gdHJpZ2dlciIKKyAgICAgICAgICAgICAgICAgICAgICAiIChOZWlnaGJvciBsb29rdXAgdGhyZXNob2xkKSA9ICVkIiwgX19mdW5jX18sIGxvb2tVcFRocmVzaG9sZCk7CisKKyAgICAgICAgICAgcEhkZEN0eC0+Y2ZnX2luaS0+bk5laWdoYm9yTG9va3VwUnNzaVRocmVzaG9sZCA9IGxvb2tVcFRocmVzaG9sZDsKKyAgICAgICAgICAgc3RhdHVzID0gc21lX3NldE5laWdoYm9yTG9va3VwUnNzaVRocmVzaG9sZCgodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCksIGxvb2tVcFRocmVzaG9sZCk7CisgICAgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBGYWlsZWQgdG8gc2V0IHJvYW0gdHJpZ2dlciwgdHJ5IGFnYWluIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgcmV0ID0gLUVQRVJNOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICAgICAgLyogU2V0IFJlYXNzb2MgdGhyZXNob2xkIHRvIChsb29rdXAgcnNzaSB0aHJlc2hvbGQgKyA1IGRCbSkgKi8KKyAgICAgICAgICAgcEhkZEN0eC0+Y2ZnX2luaS0+bk5laWdoYm9yUmVhc3NvY1Jzc2lUaHJlc2hvbGQgPSBsb29rVXBUaHJlc2hvbGQgKyA1OworICAgICAgICAgICBzbWVfc2V0TmVpZ2hib3JSZWFzc29jUnNzaVRocmVzaG9sZCgodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCksIGxvb2tVcFRocmVzaG9sZCArIDUpOworICAgICAgIH0KKyAgICAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJHRVRST0FNVFJJR0dFUiIsIDE0KSA9PSAwKQorICAgICAgIHsKKyAgICAgICAgICAgdEFOSV9VOCBsb29rVXBUaHJlc2hvbGQgPSBzbWVfZ2V0TmVpZ2hib3JMb29rdXBSc3NpVGhyZXNob2xkKCh0SGFsSGFuZGxlKShwSGRkQ3R4LT5oSGFsKSk7CisgICAgICAgICAgIGludCByc3NpID0gKC0xKSAqIGxvb2tVcFRocmVzaG9sZDsKKyAgICAgICAgICAgY2hhciBleHRyYVszMl07CisgICAgICAgICAgIHRBTklfVTggbGVuID0gMDsKKyAgICAgICAgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX0hERCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX0hERF9HRVRST0FNVFJJR0dFUl9JT0NUTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCBsb29rVXBUaHJlc2hvbGQpKTsKKyAgICAgICAgICAgbGVuID0gc2NucHJpbnRmKGV4dHJhLCBzaXplb2YoZXh0cmEpLCAiJXMgJWQiLCBjb21tYW5kLCByc3NpKTsKKyAgICAgICAgICAgbGVuID0gVk9TX01JTihwcml2X2RhdGEudG90YWxfbGVuLCBsZW4gKyAxKTsKKyAgICAgICAgICAgaWYgKGNvcHlfdG9fdXNlcihwcml2X2RhdGEuYnVmLCAmZXh0cmEsIGxlbikpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogZmFpbGVkIHRvIGNvcHkgZGF0YSB0byB1c2VyIGJ1ZmZlciIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FRkFVTFQ7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKyAgICAgICB9CisgICAgICAgZWxzZSBpZiAoc3RybmNtcChjb21tYW5kLCAiU0VUUk9BTVNDQU5QRVJJT0QiLCAxNykgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIHRBTklfVTggKnZhbHVlID0gY29tbWFuZDsKKyAgICAgICAgICAgdEFOSV9VOCByb2FtU2NhblBlcmlvZCA9IDA7CisgICAgICAgICAgIHRBTklfVTE2IG5laWdoYm9yRW1wdHlTY2FuUmVmcmVzaFBlcmlvZCA9IENGR19FTVBUWV9TQ0FOX1JFRlJFU0hfUEVSSU9EX0RFRkFVTFQ7CisKKyAgICAgICAgICAgLyogaW5wdXQgcmVmcmVzaCBwZXJpb2QgaXMgaW4gdGVybXMgb2Ygc2Vjb25kcyAqLworICAgICAgICAgICAvKiBNb3ZlIHBvaW50ZXIgdG8gYWhlYWQgb2YgU0VUUk9BTVNDQU5QRVJJT0Q8ZGVsaW1pdGVyPiAqLworICAgICAgICAgICB2YWx1ZSA9IHZhbHVlICsgMTg7CisgICAgICAgICAgIC8qIENvbnZlcnQgdGhlIHZhbHVlIGZyb20gYXNjaWkgdG8gaW50ZWdlciAqLworICAgICAgICAgICByZXQgPSBrc3RydG91OCh2YWx1ZSwgMTAsICZyb2FtU2NhblBlcmlvZCk7CisgICAgICAgICAgIGlmIChyZXQgPCAwKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvKiBJZiB0aGUgaW5wdXQgdmFsdWUgaXMgZ3JlYXRlciB0aGFuIG1heCB2YWx1ZSBvZiBkYXRhdHlwZSwgdGhlbiBhbHNvCisgICAgICAgICAgICAgICAgICBrc3RydG91OCBmYWlscyAqLworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICIlczoga3N0cnRvdTggZmFpbGVkIElucHV0IHZhbHVlIG1heSBiZSBvdXQgb2YgcmFuZ2VbJWQgLSAlZF0iLAorICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICAgIChDRkdfRU1QVFlfU0NBTl9SRUZSRVNIX1BFUklPRF9NSU4vMTAwMCksCisgICAgICAgICAgICAgICAgICAgICAgKENGR19FTVBUWV9TQ0FOX1JFRlJFU0hfUEVSSU9EX01BWC8xMDAwKSk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICAgICAgaWYgKChyb2FtU2NhblBlcmlvZCA8IChDRkdfRU1QVFlfU0NBTl9SRUZSRVNIX1BFUklPRF9NSU4vMTAwMCkpIHx8CisgICAgICAgICAgICAgICAocm9hbVNjYW5QZXJpb2QgPiAoQ0ZHX0VNUFRZX1NDQU5fUkVGUkVTSF9QRVJJT0RfTUFYLzEwMDApKSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICJSb2FtIHNjYW4gcGVyaW9kIHZhbHVlICVkIGlzIG91dCBvZiByYW5nZSIKKyAgICAgICAgICAgICAgICAgICAgICAiIChNaW46ICVkIE1heDogJWQpIiwgcm9hbVNjYW5QZXJpb2QsCisgICAgICAgICAgICAgICAgICAgICAgKENGR19FTVBUWV9TQ0FOX1JFRlJFU0hfUEVSSU9EX01JTi8xMDAwKSwKKyAgICAgICAgICAgICAgICAgICAgICAoQ0ZHX0VNUFRZX1NDQU5fUkVGUkVTSF9QRVJJT0RfTUFYLzEwMDApKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX0hERCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX0hERF9TRVRST0FNU0NBTlBFUklPRF9JT0NUTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCByb2FtU2NhblBlcmlvZCkpOworICAgICAgICAgICBuZWlnaGJvckVtcHR5U2NhblJlZnJlc2hQZXJpb2QgPSByb2FtU2NhblBlcmlvZCAqIDEwMDA7CisKKyAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBSZWNlaXZlZCBDb21tYW5kIHRvIFNldCByb2FtIHNjYW4gcGVyaW9kIgorICAgICAgICAgICAgICAgICAgICAgICIgKEVtcHR5IFNjYW4gcmVmcmVzaCBwZXJpb2QpID0gJWQiLCBfX2Z1bmNfXywgcm9hbVNjYW5QZXJpb2QpOworCisgICAgICAgICAgIHBIZGRDdHgtPmNmZ19pbmktPm5FbXB0eVNjYW5SZWZyZXNoUGVyaW9kID0gbmVpZ2hib3JFbXB0eVNjYW5SZWZyZXNoUGVyaW9kOworICAgICAgICAgICBzbWVfVXBkYXRlRW1wdHlTY2FuUmVmcmVzaFBlcmlvZCgodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCksIG5laWdoYm9yRW1wdHlTY2FuUmVmcmVzaFBlcmlvZCk7CisgICAgICAgfQorICAgICAgIGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIkdFVFJPQU1TQ0FOUEVSSU9EIiwgMTcpID09IDApCisgICAgICAgeworICAgICAgICAgICB0QU5JX1UxNiBuRW1wdHlTY2FuUmVmcmVzaFBlcmlvZCA9IHNtZV9nZXRFbXB0eVNjYW5SZWZyZXNoUGVyaW9kKCh0SGFsSGFuZGxlKShwSGRkQ3R4LT5oSGFsKSk7CisgICAgICAgICAgIGNoYXIgZXh0cmFbMzJdOworICAgICAgICAgICB0QU5JX1U4IGxlbiA9IDA7CisKKyAgICAgICAgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX0hERCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX0hERF9HRVRST0FNU0NBTlBFUklPRF9JT0NUTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCBuRW1wdHlTY2FuUmVmcmVzaFBlcmlvZCkpOworICAgICAgICAgICBsZW4gPSBzY25wcmludGYoZXh0cmEsIHNpemVvZihleHRyYSksICIlcyAlZCIsCisgICAgICAgICAgICAgICAgICAgIkdFVFJPQU1TQ0FOUEVSSU9EIiwgKG5FbXB0eVNjYW5SZWZyZXNoUGVyaW9kLzEwMDApKTsKKyAgICAgICAgICAgLyogUmV0dXJuZWQgdmFsdWUgaXMgaW4gdW5pdHMgb2Ygc2Vjb25kcyAqLworICAgICAgICAgICBsZW4gPSBWT1NfTUlOKHByaXZfZGF0YS50b3RhbF9sZW4sIGxlbiArIDEpOworICAgICAgICAgICBpZiAoY29weV90b191c2VyKHByaXZfZGF0YS5idWYsICZleHRyYSwgbGVuKSkgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBmYWlsZWQgdG8gY29weSBkYXRhIHRvIHVzZXIgYnVmZmVyIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgcmV0ID0gLUVGQVVMVDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorICAgICAgIH0KKyAgICAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJTRVRST0FNU0NBTlJFRlJFU0hQRVJJT0QiLCAyNCkgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIHRBTklfVTggKnZhbHVlID0gY29tbWFuZDsKKyAgICAgICAgICAgdEFOSV9VOCByb2FtU2NhblJlZnJlc2hQZXJpb2QgPSAwOworICAgICAgICAgICB0QU5JX1UxNiBuZWlnaGJvclNjYW5SZWZyZXNoUGVyaW9kID0gQ0ZHX05FSUdIQk9SX1NDQU5fUkVTVUxUU19SRUZSRVNIX1BFUklPRF9ERUZBVUxUOworCisgICAgICAgICAgIC8qIGlucHV0IHJlZnJlc2ggcGVyaW9kIGlzIGluIHRlcm1zIG9mIHNlY29uZHMgKi8KKyAgICAgICAgICAgLyogTW92ZSBwb2ludGVyIHRvIGFoZWFkIG9mIFNFVFJPQU1TQ0FOUkVGUkVTSFBFUklPRDxkZWxpbWl0ZXI+ICovCisgICAgICAgICAgIHZhbHVlID0gdmFsdWUgKyAyNTsKKworICAgICAgICAgICAvKiBDb252ZXJ0IHRoZSB2YWx1ZSBmcm9tIGFzY2lpIHRvIGludGVnZXIgKi8KKyAgICAgICAgICAgcmV0ID0ga3N0cnRvdTgodmFsdWUsIDEwLCAmcm9hbVNjYW5SZWZyZXNoUGVyaW9kKTsKKyAgICAgICAgICAgaWYgKHJldCA8IDApCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8qIElmIHRoZSBpbnB1dCB2YWx1ZSBpcyBncmVhdGVyIHRoYW4gbWF4IHZhbHVlIG9mIGRhdGF0eXBlLCB0aGVuIGFsc28KKyAgICAgICAgICAgICAgICAgIGtzdHJ0b3U4IGZhaWxzICovCisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBrc3RydG91OCBmYWlsZWQgSW5wdXQgdmFsdWUgbWF5IGJlIG91dCBvZiByYW5nZVslZCAtICVkXSIsCisgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgKENGR19ORUlHSEJPUl9TQ0FOX1JFU1VMVFNfUkVGUkVTSF9QRVJJT0RfTUlOLzEwMDApLAorICAgICAgICAgICAgICAgICAgICAgIChDRkdfTkVJR0hCT1JfU0NBTl9SRVNVTFRTX1JFRlJFU0hfUEVSSU9EX01BWC8xMDAwKSk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICAgICAgaWYgKChyb2FtU2NhblJlZnJlc2hQZXJpb2QgPCAoQ0ZHX05FSUdIQk9SX1NDQU5fUkVTVUxUU19SRUZSRVNIX1BFUklPRF9NSU4vMTAwMCkpIHx8CisgICAgICAgICAgICAgICAocm9hbVNjYW5SZWZyZXNoUGVyaW9kID4gKENGR19ORUlHSEJPUl9TQ0FOX1JFU1VMVFNfUkVGUkVTSF9QRVJJT0RfTUFYLzEwMDApKSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICJOZWlnaGJvciBzY2FuIHJlc3VsdHMgcmVmcmVzaCBwZXJpb2QgdmFsdWUgJWQgaXMgb3V0IG9mIHJhbmdlIgorICAgICAgICAgICAgICAgICAgICAgICIgKE1pbjogJWQgTWF4OiAlZCkiLCByb2FtU2NhblJlZnJlc2hQZXJpb2QsCisgICAgICAgICAgICAgICAgICAgICAgKENGR19ORUlHSEJPUl9TQ0FOX1JFU1VMVFNfUkVGUkVTSF9QRVJJT0RfTUlOLzEwMDApLAorICAgICAgICAgICAgICAgICAgICAgIChDRkdfTkVJR0hCT1JfU0NBTl9SRVNVTFRTX1JFRlJFU0hfUEVSSU9EX01BWC8xMDAwKSk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisgICAgICAgICAgIG5laWdoYm9yU2NhblJlZnJlc2hQZXJpb2QgPSByb2FtU2NhblJlZnJlc2hQZXJpb2QgKiAxMDAwOworCisgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICIlczogUmVjZWl2ZWQgQ29tbWFuZCB0byBTZXQgcm9hbSBzY2FuIHJlZnJlc2ggcGVyaW9kIgorICAgICAgICAgICAgICAgICAgICAgICIgKFNjYW4gcmVmcmVzaCBwZXJpb2QpID0gJWQiLCBfX2Z1bmNfXywgcm9hbVNjYW5SZWZyZXNoUGVyaW9kKTsKKworICAgICAgICAgICBwSGRkQ3R4LT5jZmdfaW5pLT5uTmVpZ2hib3JSZXN1bHRzUmVmcmVzaFBlcmlvZCA9IG5laWdoYm9yU2NhblJlZnJlc2hQZXJpb2Q7CisgICAgICAgICAgIHNtZV9zZXROZWlnaGJvclNjYW5SZWZyZXNoUGVyaW9kKCh0SGFsSGFuZGxlKShwSGRkQ3R4LT5oSGFsKSwgbmVpZ2hib3JTY2FuUmVmcmVzaFBlcmlvZCk7CisgICAgICAgfQorICAgICAgIGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIkdFVFJPQU1TQ0FOUkVGUkVTSFBFUklPRCIsIDI0KSA9PSAwKQorICAgICAgIHsKKyAgICAgICAgICAgdEFOSV9VMTYgdmFsdWUgPSBzbWVfZ2V0TmVpZ2hib3JTY2FuUmVmcmVzaFBlcmlvZCgodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCkpOworICAgICAgICAgICBjaGFyIGV4dHJhWzMyXTsKKyAgICAgICAgICAgdEFOSV9VOCBsZW4gPSAwOworCisgICAgICAgICAgIGxlbiA9IHNjbnByaW50ZihleHRyYSwgc2l6ZW9mKGV4dHJhKSwgIiVzICVkIiwKKyAgICAgICAgICAgICAgICAgICAiR0VUUk9BTVNDQU5SRUZSRVNIUEVSSU9EIiwgKHZhbHVlLzEwMDApKTsKKyAgICAgICAgICAgLyogUmV0dXJuZWQgdmFsdWUgaXMgaW4gdW5pdHMgb2Ygc2Vjb25kcyAqLworICAgICAgICAgICBsZW4gPSBWT1NfTUlOKHByaXZfZGF0YS50b3RhbF9sZW4sIGxlbiArIDEpOworICAgICAgICAgICBpZiAoY29weV90b191c2VyKHByaXZfZGF0YS5idWYsICZleHRyYSwgbGVuKSkgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBmYWlsZWQgdG8gY29weSBkYXRhIHRvIHVzZXIgYnVmZmVyIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgcmV0ID0gLUVGQVVMVDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorICAgICAgIH0KKyNpZmRlZiBGRUFUVVJFX1dMQU5fTEZSCisgICAgICAgLyogU0VUUk9BTU1PREUgKi8KKyAgICAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJTRVRST0FNTU9ERSIsIFNJWkVfT0ZfU0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ZW5hYmxlICovCisJICAgZWxzZQorCSAgICAgICByb2FtTW9kZSA9IENGR19MRlJfRkVBVFVSRV9FTkFCTEVEX01JTjsgICAgLyogUm9hbSBkaXNhYmxlICovCisKKwkgICBwSGRkQ3R4LT5jZmdfaW5pLT5pc0Zhc3RSb2FtSW5pRmVhdHVyZUVuYWJsZWQgPSByb2FtTW9kZTsKKyAgICAgICAgICAgc21lX1VwZGF0ZUlzRmFzdFJvYW1JbmlGZWF0dXJlRW5hYmxlZCgodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCksIHJvYW1Nb2RlKTsKKyAgICAgICB9CisgICAgICAgLyogR0VUUk9BTU1PREUgKi8KKyAgICAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJHRVRST0FNTU9ERSIsIFNJWkVfT0ZfR0VUUk9BTU1PREUpID09IDApCisgICAgICAgeworCSAgIHRBTklfQk9PTEVBTiByb2FtTW9kZSA9IHNtZV9nZXRJc0xmckZlYXR1cmVFbmFibGVkKCh0SGFsSGFuZGxlKShwSGRkQ3R4LT5oSGFsKSk7CisJICAgY2hhciBleHRyYVszMl07CisJICAgdEFOSV9VOCBsZW4gPSAwOworCisgICAgICAgICAgIC8qCisgICAgICAgICAgICAqIHJvYW1Nb2RlIHZhbHVlIHNoYWxsIGJlIGludmVydGVkIGJlY2F1c2UgdGhlIHNlbWVudGljcyBpcyBkaWZmZXJlbnQuCisgICAgICAgICAgICAqLworICAgICAgICAgICBpZiAoQ0ZHX0xGUl9GRUFUVVJFX0VOQUJMRURfTUlOID09IHJvYW1Nb2RlKQorCSAgICAgICByb2FtTW9kZSA9IENGR19MRlJfRkVBVFVSRV9FTkFCTEVEX01BWDsKKyAgICAgICAgICAgZWxzZQorCSAgICAgICByb2FtTW9kZSA9IENGR19MRlJfRkVBVFVSRV9FTkFCTEVEX01JTjsKKworCSAgIGxlbiA9IHNjbnByaW50ZihleHRyYSwgc2l6ZW9mKGV4dHJhKSwgIiVzICVkIiwgY29tbWFuZCwgcm9hbU1vZGUpOworICAgICAgICAgICBsZW4gPSBWT1NfTUlOKHByaXZfZGF0YS50b3RhbF9sZW4sIGxlbiArIDEpOworCSAgIGlmIChjb3B5X3RvX3VzZXIocHJpdl9kYXRhLmJ1ZiwgJmV4dHJhLCBsZW4pKSB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IGZhaWxlZCB0byBjb3B5IGRhdGEgdG8gdXNlciBidWZmZXIiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICByZXQgPSAtRUZBVUxUOworICAgICAgICAgICAgICAgZ290byBleGl0OworCSAgIH0KKyAgICAgICB9CisjZW5kaWYKKyNlbmRpZgorI2lmICBkZWZpbmVkIChXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUikgfHwgZGVmaW5lZCAoRkVBVFVSRV9XTEFOX0VTRSkgfHwgZGVmaW5lZChGRUFUVVJFX1dMQU5fTEZSKQorICAgICAgIGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIlNFVFJPQU1ERUxUQSIsIDEyKSA9PSAwKQorICAgICAgIHsKKyAgICAgICAgICAgdEFOSV9VOCAqdmFsdWUgPSBjb21tYW5kOworICAgICAgICAgICB0QU5JX1U4IHJvYW1Sc3NpRGlmZiA9IENGR19ST0FNX1JTU0lfRElGRl9ERUZBVUxUOworCisgICAgICAgICAgIC8qIE1vdmUgcG9pbnRlciB0byBhaGVhZCBvZiBTRVRST0FNREVMVEE8ZGVsaW1pdGVyPiAqLworICAgICAgICAgICB2YWx1ZSA9IHZhbHVlICsgMTM7CisgICAgICAgICAgIC8qIENvbnZlcnQgdGhlIHZhbHVlIGZyb20gYXNjaWkgdG8gaW50ZWdlciAqLworICAgICAgICAgICByZXQgPSBrc3RydG91OCh2YWx1ZSwgMTAsICZyb2FtUnNzaURpZmYpOworICAgICAgICAgICBpZiAocmV0IDwgMCkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgLyogSWYgdGhlIGlucHV0IHZhbHVlIGlzIGdyZWF0ZXIgdGhhbiBtYXggdmFsdWUgb2YgZGF0YXR5cGUsIHRoZW4gYWxzbworICAgICAgICAgICAgICAgICAga3N0cnRvdTggZmFpbHMgKi8KKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IGtzdHJ0b3U4IGZhaWxlZCByYW5nZSBbJWQgLSAlZF0iLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgICBDRkdfUk9BTV9SU1NJX0RJRkZfTUlOLAorICAgICAgICAgICAgICAgICAgICAgIENGR19ST0FNX1JTU0lfRElGRl9NQVgpOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorCisgICAgICAgICAgIGlmICgocm9hbVJzc2lEaWZmIDwgQ0ZHX1JPQU1fUlNTSV9ESUZGX01JTikgfHwKKyAgICAgICAgICAgICAgIChyb2FtUnNzaURpZmYgPiBDRkdfUk9BTV9SU1NJX0RJRkZfTUFYKSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICJSb2FtIHJzc2kgZGlmZiB2YWx1ZSAlZCBpcyBvdXQgb2YgcmFuZ2UiCisgICAgICAgICAgICAgICAgICAgICAgIiAoTWluOiAlZCBNYXg6ICVkKSIsIHJvYW1Sc3NpRGlmZiwKKyAgICAgICAgICAgICAgICAgICAgICBDRkdfUk9BTV9SU1NJX0RJRkZfTUlOLAorICAgICAgICAgICAgICAgICAgICAgIENGR19ST0FNX1JTU0lfRElGRl9NQVgpOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorCisgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICIlczogUmVjZWl2ZWQgQ29tbWFuZCB0byBTZXQgcm9hbSByc3NpIGRpZmYgPSAlZCIsIF9fZnVuY19fLCByb2FtUnNzaURpZmYpOworCisgICAgICAgICAgIHBIZGRDdHgtPmNmZ19pbmktPlJvYW1Sc3NpRGlmZiA9IHJvYW1Sc3NpRGlmZjsKKyAgICAgICAgICAgc21lX1VwZGF0ZVJvYW1Sc3NpRGlmZigodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCksIHJvYW1Sc3NpRGlmZik7CisgICAgICAgfQorICAgICAgIGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIkdFVFJPQU1ERUxUQSIsIDEyKSA9PSAwKQorICAgICAgIHsKKyAgICAgICAgICAgdEFOSV9VOCByb2FtUnNzaURpZmYgPSBzbWVfZ2V0Um9hbVJzc2lEaWZmKCh0SGFsSGFuZGxlKShwSGRkQ3R4LT5oSGFsKSk7CisgICAgICAgICAgIGNoYXIgZXh0cmFbMzJdOworICAgICAgICAgICB0QU5JX1U4IGxlbiA9IDA7CisKKyAgICAgICAgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX0hERCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX0hERF9HRVRST0FNREVMVEFfSU9DVEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwgcm9hbVJzc2lEaWZmKSk7CisgICAgICAgICAgIGxlbiA9IHNjbnByaW50ZihleHRyYSwgc2l6ZW9mKGV4dHJhKSwgIiVzICVkIiwKKyAgICAgICAgICAgICAgICAgICBjb21tYW5kLCByb2FtUnNzaURpZmYpOworICAgICAgICAgICBsZW4gPSBWT1NfTUlOKHByaXZfZGF0YS50b3RhbF9sZW4sIGxlbiArIDEpOworICAgICAgICAgICBpZiAoY29weV90b191c2VyKHByaXZfZGF0YS5idWYsICZleHRyYSwgbGVuKSkgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBmYWlsZWQgdG8gY29weSBkYXRhIHRvIHVzZXIgYnVmZmVyIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgcmV0ID0gLUVGQVVMVDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorICAgICAgIH0KKyNlbmRpZgorI2lmICBkZWZpbmVkIChXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUikgfHwgZGVmaW5lZCAoRkVBVFVSRV9XTEFOX0VTRSkgfHwgZGVmaW5lZChGRUFUVVJFX1dMQU5fTEZSKQorICAgICAgIGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIkdFVEJBTkQiLCA3KSA9PSAwKQorICAgICAgIHsKKyAgICAgICAgICAgaW50IGJhbmQgPSAtMTsKKyAgICAgICAgICAgY2hhciBleHRyYVszMl07CisgICAgICAgICAgIHRBTklfVTggbGVuID0gMDsKKyAgICAgICAgICAgaGRkX2dldEJhbmRfaGVscGVyKHBIZGRDdHgsICZiYW5kKTsKKworICAgICAgICAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfSERELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfSEREX0dFVEJBTkRfSU9DVEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwgYmFuZCkpOworICAgICAgICAgICBsZW4gPSBzY25wcmludGYoZXh0cmEsIHNpemVvZihleHRyYSksICIlcyAlZCIsIGNvbW1hbmQsIGJhbmQpOworICAgICAgICAgICBsZW4gPSBWT1NfTUlOKHByaXZfZGF0YS50b3RhbF9sZW4sIGxlbiArIDEpOworICAgICAgICAgICBpZiAoY29weV90b191c2VyKHByaXZfZGF0YS5idWYsICZleHRyYSwgbGVuKSkgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBmYWlsZWQgdG8gY29weSBkYXRhIHRvIHVzZXIgYnVmZmVyIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgcmV0ID0gLUVGQVVMVDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorICAgICAgIH0KKyAgICAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJTRVRST0FNU0NBTkNIQU5ORUxTIiwgMTkpID09IDApCisgICAgICAgeworICAgICAgICAgICB0QU5JX1U4ICp2YWx1ZSA9IGNvbW1hbmQ7CisgICAgICAgICAgIHRBTklfVTggQ2hhbm5lbExpc3RbV05JX0NGR19WQUxJRF9DSEFOTkVMX0xJU1RfTEVOXSA9IHswfTsKKyAgICAgICAgICAgdEFOSV9VOCBudW1DaGFubmVscyA9IDA7CisgICAgICAgICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKworICAgICAgICAgICBzdGF0dXMgPSBoZGRfcGFyc2VfY2hhbm5lbGxpc3QodmFsdWUsIENoYW5uZWxMaXN0LCAmbnVtQ2hhbm5lbHMpOworICAgICAgICAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogRmFpbGVkIHRvIHBhcnNlIGNoYW5uZWwgbGlzdCBpbmZvcm1hdGlvbiIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKworICAgICAgICAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfSERELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfSEREX1NFVFJPQU1TQ0FOQ0hBTk5FTFNfSU9DVEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwgbnVtQ2hhbm5lbHMpKTsKKyAgICAgICAgICAgaWYgKG51bUNoYW5uZWxzID4gV05JX0NGR19WQUxJRF9DSEFOTkVMX0xJU1RfTEVOKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IG51bWJlciBvZiBjaGFubmVscyAoJWQpIHN1cHBvcnRlZCBleGNlZWRlZCBtYXggKCVkKSIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgIG51bUNoYW5uZWxzLCBXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU4pOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorICAgICAgICAgICBzdGF0dXMgPSBzbWVfQ2hhbmdlUm9hbVNjYW5DaGFubmVsTGlzdCgodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCksIENoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1DaGFubmVscyk7CisgICAgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBGYWlsZWQgdG8gdXBkYXRlIGNoYW5uZWwgbGlzdCBpbmZvcm1hdGlvbiIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKyAgICAgICB9CisgICAgICAgZWxzZSBpZiAoc3RybmNtcChjb21tYW5kLCAiR0VUUk9BTVNDQU5DSEFOTkVMUyIsIDE5KSA9PSAwKQorICAgICAgIHsKKyAgICAgICAgICAgdEFOSV9VOCBDaGFubmVsTGlzdFtXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU5dID0gezB9OworICAgICAgICAgICB0QU5JX1U4IG51bUNoYW5uZWxzID0gMDsKKyAgICAgICAgICAgdEFOSV9VOCBqID0gMDsKKyAgICAgICAgICAgY2hhciBleHRyYVsxMjhdID0gezB9OworICAgICAgICAgICBpbnQgbGVuOworCisgICAgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHNtZV9nZXRSb2FtU2NhbkNoYW5uZWxMaXN0KCAodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2hhbm5lbExpc3QsICZudW1DaGFubmVscyApKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAiJXM6IGZhaWxlZCB0byBnZXQgcm9hbSBzY2FuIGNoYW5uZWwgbGlzdCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FRkFVTFQ7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX0hERCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX0hERF9HRVRST0FNU0NBTkNIQU5ORUxTX0lPQ1RMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsIG51bUNoYW5uZWxzKSk7CisgICAgICAgICAgIC8qIG91dHB1dCBjaGFubmVsIGxpc3QgaXMgb2YgdGhlIGZvcm1hdAorICAgICAgICAgICBbTnVtYmVyIG9mIHJvYW0gc2NhbiBjaGFubmVsc11bQ2hhbm5lbDFdW0NoYW5uZWwyXS4uLiAqLworICAgICAgICAgICAvKiBjb3B5IHRoZSBudW1iZXIgb2YgY2hhbm5lbHMgaW4gdGhlIDB0aCBpbmRleCAqLworICAgICAgICAgICBsZW4gPSBzY25wcmludGYoZXh0cmEsIHNpemVvZihleHRyYSksICIlcyAlZCIsIGNvbW1hbmQsIG51bUNoYW5uZWxzKTsKKyAgICAgICAgICAgZm9yIChqID0gMDsgKGogPCBudW1DaGFubmVscyk7IGorKykKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgbGVuICs9IHNjbnByaW50ZihleHRyYSArIGxlbiwgc2l6ZW9mKGV4dHJhKSAtIGxlbiwgIiAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgIENoYW5uZWxMaXN0W2pdKTsKKyAgICAgICAgICAgfQorCisgICAgICAgICAgIGxlbiA9IFZPU19NSU4ocHJpdl9kYXRhLnRvdGFsX2xlbiwgbGVuICsgMSk7CisgICAgICAgICAgIGlmIChjb3B5X3RvX3VzZXIocHJpdl9kYXRhLmJ1ZiwgJmV4dHJhLCBsZW4pKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IGZhaWxlZCB0byBjb3B5IGRhdGEgdG8gdXNlciBidWZmZXIiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICByZXQgPSAtRUZBVUxUOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisgICAgICAgfQorICAgICAgIGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIkdFVENDWE1PREUiLCAxMCkgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIHRBTklfQk9PTEVBTiBlc2VNb2RlID0gc21lX2dldElzRXNlRmVhdHVyZUVuYWJsZWQoKHRIYWxIYW5kbGUpKHBIZGRDdHgtPmhIYWwpKTsKKyAgICAgICAgICAgY2hhciBleHRyYVszMl07CisgICAgICAgICAgIHRBTklfVTggbGVuID0gMDsKKworICAgICAgICAgICAvKiBDaGVjayBpZiB0aGUgZmVhdHVyZXMgT0tDL0VTRS8xMVIgYXJlIHN1cHBvcnRlZCBzaW11bHRhbmVvdXNseSwKKyAgICAgICAgICAgICAgdGhlbiB0aGlzIG9wZXJhdGlvbiBpcyBub3QgcGVybWl0dGVkIChyZXR1cm4gRkFJTFVSRSkgKi8KKyAgICAgICAgICAgaWYgKGVzZU1vZGUgJiYKKyAgICAgICAgICAgICAgIGhkZF9pc19va2NfbW9kZV9lbmFibGVkKHBIZGRDdHgpICYmCisgICAgICAgICAgICAgICBzbWVfZ2V0SXNGdEZlYXR1cmVFbmFibGVkKCh0SGFsSGFuZGxlKShwSGRkQ3R4LT5oSGFsKSkpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgIiVzOiBPS0MvRVNFLzExUiBhcmUgc3VwcG9ydGVkIHNpbXVsdGFuZW91c2x5IgorICAgICAgICAgICAgICAgICAgIiBoZW5jZSB0aGlzIG9wZXJhdGlvbiBpcyBub3QgcGVybWl0dGVkISIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FUEVSTTsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorCisgICAgICAgICAgIGxlbiA9IHNjbnByaW50ZihleHRyYSwgc2l6ZW9mKGV4dHJhKSwgIiVzICVkIiwKKyAgICAgICAgICAgICAgICAgICAiR0VUQ0NYTU9ERSIsIGVzZU1vZGUpOworICAgICAgICAgICBsZW4gPSBWT1NfTUlOKHByaXZfZGF0YS50b3RhbF9sZW4sIGxlbiArIDEpOworICAgICAgICAgICBpZiAoY29weV90b191c2VyKHByaXZfZGF0YS5idWYsICZleHRyYSwgbGVuKSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBmYWlsZWQgdG8gY29weSBkYXRhIHRvIHVzZXIgYnVmZmVyIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgcmV0ID0gLUVGQVVMVDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorICAgICAgIH0KKyAgICAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJHRVRPS0NNT0RFIiwgMTApID09IDApCisgICAgICAgeworICAgICAgICAgICB0QU5JX0JPT0xFQU4gb2tjTW9kZSA9IGhkZF9pc19va2NfbW9kZV9lbmFibGVkKHBIZGRDdHgpOworICAgICAgICAgICBjaGFyIGV4dHJhWzMyXTsKKyAgICAgICAgICAgdEFOSV9VOCBsZW4gPSAwOworCisgICAgICAgICAgIC8qIENoZWNrIGlmIHRoZSBmZWF0dXJlcyBPS0MvRVNFLzExUiBhcmUgc3VwcG9ydGVkIHNpbXVsdGFuZW91c2x5LAorICAgICAgICAgICAgICB0aGVuIHRoaXMgb3BlcmF0aW9uIGlzIG5vdCBwZXJtaXR0ZWQgKHJldHVybiBGQUlMVVJFKSAqLworICAgICAgICAgICBpZiAob2tjTW9kZSAmJgorICAgICAgICAgICAgICAgc21lX2dldElzRXNlRmVhdHVyZUVuYWJsZWQoKHRIYWxIYW5kbGUpKHBIZGRDdHgtPmhIYWwpKSAmJgorICAgICAgICAgICAgICAgc21lX2dldElzRnRGZWF0dXJlRW5hYmxlZCgodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCkpKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgICAgICIlczogT0tDL0VTRS8xMVIgYXJlIHN1cHBvcnRlZCBzaW11bHRhbmVvdXNseSIKKyAgICAgICAgICAgICAgICAgICIgaGVuY2UgdGhpcyBvcGVyYXRpb24gaXMgbm90IHBlcm1pdHRlZCEiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICByZXQgPSAtRVBFUk07CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKworICAgICAgICAgICBsZW4gPSBzY25wcmludGYoZXh0cmEsIHNpemVvZihleHRyYSksICIlcyAlZCIsCisgICAgICAgICAgICAgICAgICAgIkdFVE9LQ01PREUiLCBva2NNb2RlKTsKKyAgICAgICAgICAgbGVuID0gVk9TX01JTihwcml2X2RhdGEudG90YWxfbGVuLCBsZW4gKyAxKTsKKyAgICAgICAgICAgaWYgKGNvcHlfdG9fdXNlcihwcml2X2RhdGEuYnVmLCAmZXh0cmEsIGxlbikpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogZmFpbGVkIHRvIGNvcHkgZGF0YSB0byB1c2VyIGJ1ZmZlciIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FRkFVTFQ7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKyAgICAgICB9CisgICAgICAgZWxzZSBpZiAoc3RybmNtcChjb21tYW5kLCAiR0VURkFTVFJPQU0iLCAxMSkgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIHRBTklfQk9PTEVBTiBsZnJNb2RlID0gc21lX2dldElzTGZyRmVhdHVyZUVuYWJsZWQoKHRIYWxIYW5kbGUpKHBIZGRDdHgtPmhIYWwpKTsKKyAgICAgICAgICAgY2hhciBleHRyYVszMl07CisgICAgICAgICAgIHRBTklfVTggbGVuID0gMDsKKworICAgICAgICAgICBsZW4gPSBzY25wcmludGYoZXh0cmEsIHNpemVvZihleHRyYSksICIlcyAlZCIsCisgICAgICAgICAgICAgICAgICAgIkdFVEZBU1RST0FNIiwgbGZyTW9kZSk7CisgICAgICAgICAgIGxlbiA9IFZPU19NSU4ocHJpdl9kYXRhLnRvdGFsX2xlbiwgbGVuICsgMSk7CisgICAgICAgICAgIGlmIChjb3B5X3RvX3VzZXIocHJpdl9kYXRhLmJ1ZiwgJmV4dHJhLCBsZW4pKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IGZhaWxlZCB0byBjb3B5IGRhdGEgdG8gdXNlciBidWZmZXIiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICByZXQgPSAtRUZBVUxUOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisgICAgICAgfQorICAgICAgIGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIkdFVEZBU1RUUkFOU0lUSU9OIiwgMTcpID09IDApCisgICAgICAgeworICAgICAgICAgICB0QU5JX0JPT0xFQU4gZnQgPSBzbWVfZ2V0SXNGdEZlYXR1cmVFbmFibGVkKCh0SGFsSGFuZGxlKShwSGRkQ3R4LT5oSGFsKSk7CisgICAgICAgICAgIGNoYXIgZXh0cmFbMzJdOworICAgICAgICAgICB0QU5JX1U4IGxlbiA9IDA7CisKKyAgICAgICAgICAgbGVuID0gc2NucHJpbnRmKGV4dHJhLCBzaXplb2YoZXh0cmEpLCAiJXMgJWQiLAorICAgICAgICAgICAgICAgICAgICJHRVRGQVNUVFJBTlNJVElPTiIsIGZ0KTsKKyAgICAgICAgICAgbGVuID0gVk9TX01JTihwcml2X2RhdGEudG90YWxfbGVuLCBsZW4gKyAxKTsKKyAgICAgICAgICAgaWYgKGNvcHlfdG9fdXNlcihwcml2X2RhdGEuYnVmLCAmZXh0cmEsIGxlbikpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogZmFpbGVkIHRvIGNvcHkgZGF0YSB0byB1c2VyIGJ1ZmZlciIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FRkFVTFQ7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKyAgICAgICB9CisgICAgICAgZWxzZSBpZiAoc3RybmNtcChjb21tYW5kLCAiU0VUUk9BTVNDQU5DSEFOTkVMTUlOVElNRSIsIDI1KSA9PSAwKQorICAgICAgIHsKKyAgICAgICAgICAgdEFOSV9VOCAqdmFsdWUgPSBjb21tYW5kOworICAgICAgICAgICB0QU5JX1U4IG1pblRpbWUgPSBDRkdfTkVJR0hCT1JfU0NBTl9NSU5fQ0hBTl9USU1FX0RFRkFVTFQ7CisKKyAgICAgICAgICAgLyogTW92ZSBwb2ludGVyIHRvIGFoZWFkIG9mIFNFVFJPQU1TQ0FOQ0hBTk5FTE1JTlRJTUU8ZGVsaW1pdGVyPiAqLworICAgICAgICAgICB2YWx1ZSA9IHZhbHVlICsgMjY7CisgICAgICAgICAgIC8qIENvbnZlcnQgdGhlIHZhbHVlIGZyb20gYXNjaWkgdG8gaW50ZWdlciAqLworICAgICAgICAgICByZXQgPSBrc3RydG91OCh2YWx1ZSwgMTAsICZtaW5UaW1lKTsKKyAgICAgICAgICAgaWYgKHJldCA8IDApCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8qIElmIHRoZSBpbnB1dCB2YWx1ZSBpcyBncmVhdGVyIHRoYW4gbWF4IHZhbHVlIG9mIGRhdGF0eXBlLCB0aGVuIGFsc28KKyAgICAgICAgICAgICAgICAgIGtzdHJ0b3U4IGZhaWxzICovCisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBrc3RydG91OCBmYWlsZWQgcmFuZ2UgWyVkIC0gJWRdIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgQ0ZHX05FSUdIQk9SX1NDQU5fTUlOX0NIQU5fVElNRV9NSU4sCisgICAgICAgICAgICAgICAgICAgICAgQ0ZHX05FSUdIQk9SX1NDQU5fTUlOX0NIQU5fVElNRV9NQVgpOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorICAgICAgICAgICBpZiAoKG1pblRpbWUgPCBDRkdfTkVJR0hCT1JfU0NBTl9NSU5fQ0hBTl9USU1FX01JTikgfHwKKyAgICAgICAgICAgICAgIChtaW5UaW1lID4gQ0ZHX05FSUdIQk9SX1NDQU5fTUlOX0NIQU5fVElNRV9NQVgpKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgInNjYW4gbWluIGNoYW5uZWwgdGltZSB2YWx1ZSAlZCBpcyBvdXQgb2YgcmFuZ2UiCisgICAgICAgICAgICAgICAgICAgICAgIiAoTWluOiAlZCBNYXg6ICVkKSIsIG1pblRpbWUsCisgICAgICAgICAgICAgICAgICAgICAgQ0ZHX05FSUdIQk9SX1NDQU5fTUlOX0NIQU5fVElNRV9NSU4sCisgICAgICAgICAgICAgICAgICAgICAgQ0ZHX05FSUdIQk9SX1NDQU5fTUlOX0NIQU5fVElNRV9NQVgpOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorCisgICAgICAgICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9IREQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVFJBQ0VfQ09ERV9IRERfU0VUUk9BTVNDQU5DSEFOTkVMTUlOVElNRV9JT0NUTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCBtaW5UaW1lKSk7CisgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICIlczogUmVjZWl2ZWQgQ29tbWFuZCB0byBjaGFuZ2UgY2hhbm5lbCBtaW4gdGltZSA9ICVkIiwgX19mdW5jX18sIG1pblRpbWUpOworCisgICAgICAgICAgIHBIZGRDdHgtPmNmZ19pbmktPm5OZWlnaGJvclNjYW5NaW5DaGFuVGltZSA9IG1pblRpbWU7CisgICAgICAgICAgIHNtZV9zZXROZWlnaGJvclNjYW5NaW5DaGFuVGltZSgodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCksIG1pblRpbWUpOworICAgICAgIH0KKyAgICAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJTRU5EQUNUSU9ORlJBTUUiLCAxNSkgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIHRBTklfVTggKnZhbHVlID0gY29tbWFuZDsKKyAgICAgICAgICAgdEFOSV9VOCBjaGFubmVsID0gMDsKKyAgICAgICAgICAgdEFOSV9VOCBkd2VsbFRpbWUgPSAwOworICAgICAgICAgICB0QU5JX1U4IGJ1ZkxlbiA9IDA7CisgICAgICAgICAgIHRBTklfVTggKmJ1ZiA9IE5VTEw7CisgICAgICAgICAgIHRTaXJNYWNBZGRyIHRhcmdldEFwQnNzaWQ7CisgICAgICAgICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgc3RydWN0IGllZWU4MDIxMV9jaGFubmVsIGNoYW47CisgICAgICAgICAgIHRBTklfVTggZmluYWxMZW4gPSAwOworICAgICAgICAgICB0QU5JX1U4ICpmaW5hbEJ1ZiA9IE5VTEw7CisgICAgICAgICAgIHRBTklfVTggdGVtcCA9IDA7CisgICAgICAgICAgIHU2NCBjb29raWU7CisgICAgICAgICAgIGhkZF9zdGF0aW9uX2N0eF90ICpwSGRkU3RhQ3R4ID0gTlVMTDsKKyAgICAgICAgICAgcEhkZFN0YUN0eCA9IFdMQU5fSEREX0dFVF9TVEFUSU9OX0NUWF9QVFIocEFkYXB0ZXIpOworCisgICAgICAgICAgIC8qIGlmIG5vdCBhc3NvY2lhdGVkLCBubyBuZWVkIHRvIHNlbmQgYWN0aW9uIGZyYW1lICovCisgICAgICAgICAgIGlmIChlQ29ubmVjdGlvblN0YXRlX0Fzc29jaWF0ZWQgIT0gcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmNvbm5TdGF0ZSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIiVzOk5vdCBhc3NvY2lhdGVkISIsX19mdW5jX18pOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorCisgICAgICAgICAgIHN0YXR1cyA9IGhkZF9wYXJzZV9zZW5kX2FjdGlvbl9mcmFtZV9kYXRhKHZhbHVlLCB0YXJnZXRBcEJzc2lkLCAmY2hhbm5lbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmR3ZWxsVGltZSwgJmJ1ZiwgJmJ1Zkxlbik7CisgICAgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBGYWlsZWQgdG8gcGFyc2Ugc2VuZCBhY3Rpb24gZnJhbWUgZGF0YSIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKworICAgICAgICAgICAvKiBpZiB0aGUgdGFyZ2V0IGJzc2lkIGlzIGRpZmZlcmVudCBmcm9tIGN1cnJlbnRseSBhc3NvY2lhdGVkIEFQLAorICAgICAgICAgICAgICB0aGVuIG5vIG5lZWQgdG8gc2VuZCBhY3Rpb24gZnJhbWUgKi8KKyAgICAgICAgICAgaWYgKFZPU19UUlVFICE9IHZvc19tZW1fY29tcGFyZSh0YXJnZXRBcEJzc2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5ic3NJZCwgc2l6ZW9mKHRTaXJNYWNBZGRyKSkpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczpTVEEgaXMgbm90IGFzc29jaWF0ZWQgdG8gdGhpcyBBUCEiLF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUoYnVmKTsKKyAgICAgICAgICAgICAgIGJ1ZiA9IE5VTEw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKworICAgICAgICAgICAvKiBpZiB0aGUgY2hhbm5lbCBudW1iZXIgaXMgZGlmZmVyZW50IGZyb20gb3BlcmF0aW5nIGNoYW5uZWwgdGhlbgorICAgICAgICAgICAgICBubyBuZWVkIHRvIHNlbmQgYWN0aW9uIGZyYW1lICovCisgICAgICAgICAgIGlmIChjaGFubmVsICE9IHBIZGRTdGFDdHgtPmNvbm5faW5mby5vcGVyYXRpb25DaGFubmVsKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICIlczogY2hhbm5lbCglZCkgaXMgZGlmZmVyZW50IGZyb20gb3BlcmF0aW5nIGNoYW5uZWwoJWQpIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgY2hhbm5lbCwgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLm9wZXJhdGlvbkNoYW5uZWwpOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShidWYpOworICAgICAgICAgICAgICAgYnVmID0gTlVMTDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorICAgICAgICAgICBjaGFuLmNlbnRlcl9mcmVxID0gc21lX0NoblRvRnJlcShjaGFubmVsKTsKKworICAgICAgICAgICBmaW5hbExlbiA9IGJ1ZkxlbiArIDI0OworICAgICAgICAgICBmaW5hbEJ1ZiA9IHZvc19tZW1fbWFsbG9jKGZpbmFsTGVuKTsKKyAgICAgICAgICAgaWYgKE5VTEwgPT0gZmluYWxCdWYpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6bWVtb3J5IGFsbG9jYXRpb24gZmFpbGVkIixfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICByZXQgPSAtRU5PTUVNOworICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKGJ1Zik7CisgICAgICAgICAgICAgICBidWYgPSBOVUxMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisgICAgICAgICAgIHZvc19tZW1femVybyhmaW5hbEJ1ZiwgZmluYWxMZW4pOworCisgICAgICAgICAgIC8qIEZpbGwgc3VidHlwZSAqLworICAgICAgICAgICB0ZW1wID0gU0lSX01BQ19NR01UX0FDVElPTiA8PCA0OworICAgICAgICAgICB2b3NfbWVtX2NvcHkoZmluYWxCdWYgKyAwLCAmdGVtcCwgc2l6ZW9mKHRlbXApKTsKKworICAgICAgICAgICAvKiBGaWxsIHR5cGUgKi8KKyAgICAgICAgICAgdGVtcCA9IFNJUl9NQUNfTUdNVF9GUkFNRTsKKyAgICAgICAgICAgdm9zX21lbV9jb3B5KGZpbmFsQnVmICsgMiwgJnRlbXAsIHNpemVvZih0ZW1wKSk7CisKKyAgICAgICAgICAgLyogRmlsbCBkZXN0aW5hdGlvbiBhZGRyZXNzIChic3NpZCBvZiB0aGUgQVApICovCisgICAgICAgICAgIHZvc19tZW1fY29weShmaW5hbEJ1ZiArIDQsIHRhcmdldEFwQnNzaWQsIHNpemVvZih0YXJnZXRBcEJzc2lkKSk7CisKKyAgICAgICAgICAgLyogRmlsbCBzb3VyY2UgYWRkcmVzcyAoU1RBIG1hYyBhZGRyZXNzKSAqLworICAgICAgICAgICB2b3NfbWVtX2NvcHkoZmluYWxCdWYgKyAxMCwgcEFkYXB0ZXItPm1hY0FkZHJlc3NDdXJyZW50LmJ5dGVzLCBzaXplb2YocEFkYXB0ZXItPm1hY0FkZHJlc3NDdXJyZW50LmJ5dGVzKSk7CisKKyAgICAgICAgICAgLyogRmlsbCBCU1NJRCAoQVAgbWFjIGFkZHJlc3MpICovCisgICAgICAgICAgIHZvc19tZW1fY29weShmaW5hbEJ1ZiArIDE2LCB0YXJnZXRBcEJzc2lkLCBzaXplb2YodGFyZ2V0QXBCc3NpZCkpOworCisgICAgICAgICAgIC8qIEZpbGwgcmVjZWl2ZWQgYnVmZmVyIGZyb20gMjR0aCBhZGRyZXNzICovCisgICAgICAgICAgIHZvc19tZW1fY29weShmaW5hbEJ1ZiArIDI0LCBidWYsIGJ1Zkxlbik7CisKKyAgICAgICAgICAgLyogZG9uZSB3aXRoIHRoZSBwYXJzZWQgYnVmZmVyICovCisgICAgICAgICAgIHZvc19tZW1fZnJlZShidWYpOworICAgICAgICAgICBidWYgPSBOVUxMOworCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE0LDApKQorICAgICAgICAgICBwYXJhbXMuY2hhbiA9ICZjaGFuOworICAgICAgICAgICBwYXJhbXMub2ZmY2hhbiA9IDA7CisgICAgICAgICAgIHBhcmFtcy53YWl0ID0gZHdlbGxUaW1lOworICAgICAgICAgICBwYXJhbXMuYnVmID0gZmluYWxCdWY7CisgICAgICAgICAgIHBhcmFtcy5sZW4gPSBmaW5hbExlbjsKKyAgICAgICAgICAgcGFyYW1zLm5vX2NjayA9IDE7CisgICAgICAgICAgIHBhcmFtcy5kb250X3dhaXRfZm9yX2FjayA9IDE7CisgICAgICAgICAgIHJldCA9IHdsYW5faGRkX21nbXRfdHgoTlVMTCwgJnBBZGFwdGVyLT53ZGV2LCAmcGFyYW1zLCAmY29va2llKTsKKyNlbHNlCisgICAgICAgICAgIHdsYW5faGRkX21nbXRfdHgoIE5VTEwsCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDYsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICYocEFkYXB0ZXItPndkZXYpLAorI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPmRldiwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAmY2hhbiwgMCwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFIDwgS0VSTkVMX1ZFUlNJT04oMyw4LDApKQorICAgICAgICAgICAgICAgICAgICAgICBOTDgwMjExX0NIQU5fSFQyMCwgMSwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICBkd2VsbFRpbWUsIGZpbmFsQnVmLCBmaW5hbExlbiwgIDEsCisgICAgICAgICAgICAgICAgICAgICAgIDEsICZjb29raWUgKTsKKyNlbmRpZiAvKiBMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxNCwwKSovCisgICAgICAgICAgIHZvc19tZW1fZnJlZShmaW5hbEJ1Zik7CisgICAgICAgfQorICAgICAgIGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIkdFVFJPQU1TQ0FOQ0hBTk5FTE1JTlRJTUUiLCAyNSkgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIHRBTklfVTE2IHZhbCA9IHNtZV9nZXROZWlnaGJvclNjYW5NaW5DaGFuVGltZSgodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCkpOworICAgICAgICAgICBjaGFyIGV4dHJhWzMyXTsKKyAgICAgICAgICAgdEFOSV9VOCBsZW4gPSAwOworCisgICAgICAgICAgIC8qIHZhbHVlIGlzIGludGVybXMgb2YgbXNlYyAqLworICAgICAgICAgICBsZW4gPSBzY25wcmludGYoZXh0cmEsIHNpemVvZihleHRyYSksICIlcyAlZCIsCisgICAgICAgICAgICAgICAgICAgIkdFVFJPQU1TQ0FOQ0hBTk5FTE1JTlRJTUUiLCB2YWwpOworICAgICAgICAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfSERELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfSEREX0dFVFJPQU1TQ0FOQ0hBTk5FTE1JTlRJTUVfSU9DVEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwgdmFsKSk7CisgICAgICAgICAgIGxlbiA9IFZPU19NSU4ocHJpdl9kYXRhLnRvdGFsX2xlbiwgbGVuICsgMSk7CisgICAgICAgICAgIGlmIChjb3B5X3RvX3VzZXIocHJpdl9kYXRhLmJ1ZiwgJmV4dHJhLCBsZW4pKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IGZhaWxlZCB0byBjb3B5IGRhdGEgdG8gdXNlciBidWZmZXIiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICByZXQgPSAtRUZBVUxUOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisgICAgICAgfQorICAgICAgIGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIlNFVFNDQU5DSEFOTkVMVElNRSIsIDE4KSA9PSAwKQorICAgICAgIHsKKyAgICAgICAgICAgdEFOSV9VOCAqdmFsdWUgPSBjb21tYW5kOworICAgICAgICAgICB0QU5JX1UxNiBtYXhUaW1lID0gQ0ZHX05FSUdIQk9SX1NDQU5fTUFYX0NIQU5fVElNRV9ERUZBVUxUOworCisgICAgICAgICAgIC8qIE1vdmUgcG9pbnRlciB0byBhaGVhZCBvZiBTRVRTQ0FOQ0hBTk5FTFRJTUU8ZGVsaW1pdGVyPiAqLworICAgICAgICAgICB2YWx1ZSA9IHZhbHVlICsgMTk7CisgICAgICAgICAgIC8qIENvbnZlcnQgdGhlIHZhbHVlIGZyb20gYXNjaWkgdG8gaW50ZWdlciAqLworICAgICAgICAgICByZXQgPSBrc3RydG91MTYodmFsdWUsIDEwLCAmbWF4VGltZSk7CisgICAgICAgICAgIGlmIChyZXQgPCAwKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvKiBJZiB0aGUgaW5wdXQgdmFsdWUgaXMgZ3JlYXRlciB0aGFuIG1heCB2YWx1ZSBvZiBkYXRhdHlwZSwgdGhlbiBhbHNvCisgICAgICAgICAgICAgICAgICBrc3RydG91MTYgZmFpbHMgKi8KKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IGtzdHJ0b3UxNiBmYWlsZWQgcmFuZ2UgWyVkIC0gJWRdIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgQ0ZHX05FSUdIQk9SX1NDQU5fTUFYX0NIQU5fVElNRV9NSU4sCisgICAgICAgICAgICAgICAgICAgICAgQ0ZHX05FSUdIQk9SX1NDQU5fTUFYX0NIQU5fVElNRV9NQVgpOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorCisgICAgICAgICAgIGlmICgobWF4VGltZSA8IENGR19ORUlHSEJPUl9TQ0FOX01BWF9DSEFOX1RJTUVfTUlOKSB8fAorICAgICAgICAgICAgICAgKG1heFRpbWUgPiBDRkdfTkVJR0hCT1JfU0NBTl9NQVhfQ0hBTl9USU1FX01BWCkpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAibGZyIG1vZGUgdmFsdWUgJWQgaXMgb3V0IG9mIHJhbmdlIgorICAgICAgICAgICAgICAgICAgICAgICIgKE1pbjogJWQgTWF4OiAlZCkiLCBtYXhUaW1lLAorICAgICAgICAgICAgICAgICAgICAgIENGR19ORUlHSEJPUl9TQ0FOX01BWF9DSEFOX1RJTUVfTUlOLAorICAgICAgICAgICAgICAgICAgICAgIENGR19ORUlHSEJPUl9TQ0FOX01BWF9DSEFOX1RJTUVfTUFYKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKworICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IFJlY2VpdmVkIENvbW1hbmQgdG8gY2hhbmdlIGNoYW5uZWwgbWF4IHRpbWUgPSAlZCIsIF9fZnVuY19fLCBtYXhUaW1lKTsKKworICAgICAgICAgICBwSGRkQ3R4LT5jZmdfaW5pLT5uTmVpZ2hib3JTY2FuTWF4Q2hhblRpbWUgPSBtYXhUaW1lOworICAgICAgICAgICBzbWVfc2V0TmVpZ2hib3JTY2FuTWF4Q2hhblRpbWUoKHRIYWxIYW5kbGUpKHBIZGRDdHgtPmhIYWwpLCBtYXhUaW1lKTsKKyAgICAgICB9CisgICAgICAgZWxzZSBpZiAoc3RybmNtcChjb21tYW5kLCAiR0VUU0NBTkNIQU5ORUxUSU1FIiwgMTgpID09IDApCisgICAgICAgeworICAgICAgICAgICB0QU5JX1UxNiB2YWwgPSBzbWVfZ2V0TmVpZ2hib3JTY2FuTWF4Q2hhblRpbWUoKHRIYWxIYW5kbGUpKHBIZGRDdHgtPmhIYWwpKTsKKyAgICAgICAgICAgY2hhciBleHRyYVszMl07CisgICAgICAgICAgIHRBTklfVTggbGVuID0gMDsKKworICAgICAgICAgICAvKiB2YWx1ZSBpcyBpbnRlcm1zIG9mIG1zZWMgKi8KKyAgICAgICAgICAgbGVuID0gc2NucHJpbnRmKGV4dHJhLCBzaXplb2YoZXh0cmEpLCAiJXMgJWQiLAorICAgICAgICAgICAgICAgICAgICJHRVRTQ0FOQ0hBTk5FTFRJTUUiLCB2YWwpOworICAgICAgICAgICBsZW4gPSBWT1NfTUlOKHByaXZfZGF0YS50b3RhbF9sZW4sIGxlbiArIDEpOworICAgICAgICAgICBpZiAoY29weV90b191c2VyKHByaXZfZGF0YS5idWYsICZleHRyYSwgbGVuKSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBmYWlsZWQgdG8gY29weSBkYXRhIHRvIHVzZXIgYnVmZmVyIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgcmV0ID0gLUVGQVVMVDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorICAgICAgIH0KKyAgICAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJTRVRTQ0FOSE9NRVRJTUUiLCAxNSkgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIHRBTklfVTggKnZhbHVlID0gY29tbWFuZDsKKyAgICAgICAgICAgdEFOSV9VMTYgdmFsID0gQ0ZHX05FSUdIQk9SX1NDQU5fVElNRVJfUEVSSU9EX0RFRkFVTFQ7CisKKyAgICAgICAgICAgLyogTW92ZSBwb2ludGVyIHRvIGFoZWFkIG9mIFNFVFNDQU5IT01FVElNRTxkZWxpbWl0ZXI+ICovCisgICAgICAgICAgIHZhbHVlID0gdmFsdWUgKyAxNjsKKyAgICAgICAgICAgLyogQ29udmVydCB0aGUgdmFsdWUgZnJvbSBhc2NpaSB0byBpbnRlZ2VyICovCisgICAgICAgICAgIHJldCA9IGtzdHJ0b3UxNih2YWx1ZSwgMTAsICZ2YWwpOworICAgICAgICAgICBpZiAocmV0IDwgMCkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgLyogSWYgdGhlIGlucHV0IHZhbHVlIGlzIGdyZWF0ZXIgdGhhbiBtYXggdmFsdWUgb2YgZGF0YXR5cGUsIHRoZW4gYWxzbworICAgICAgICAgICAgICAgICAga3N0cnRvdTE2IGZhaWxzICovCisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBrc3RydG91MTYgZmFpbGVkIHJhbmdlIFslZCAtICVkXSIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICAgIENGR19ORUlHSEJPUl9TQ0FOX1RJTUVSX1BFUklPRF9NSU4sCisgICAgICAgICAgICAgICAgICAgICAgQ0ZHX05FSUdIQk9SX1NDQU5fVElNRVJfUEVSSU9EX01BWCk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICAgICAgaWYgKCh2YWwgPCBDRkdfTkVJR0hCT1JfU0NBTl9USU1FUl9QRVJJT0RfTUlOKSB8fAorICAgICAgICAgICAgICAgKHZhbCA+IENGR19ORUlHSEJPUl9TQ0FOX1RJTUVSX1BFUklPRF9NQVgpKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgInNjYW4gaG9tZSB0aW1lIHZhbHVlICVkIGlzIG91dCBvZiByYW5nZSIKKyAgICAgICAgICAgICAgICAgICAgICAiIChNaW46ICVkIE1heDogJWQpIiwgdmFsLAorICAgICAgICAgICAgICAgICAgICAgIENGR19ORUlHSEJPUl9TQ0FOX1RJTUVSX1BFUklPRF9NSU4sCisgICAgICAgICAgICAgICAgICAgICAgQ0ZHX05FSUdIQk9SX1NDQU5fVElNRVJfUEVSSU9EX01BWCk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBSZWNlaXZlZCBDb21tYW5kIHRvIGNoYW5nZSBzY2FuIGhvbWUgdGltZSA9ICVkIiwgX19mdW5jX18sIHZhbCk7CisKKyAgICAgICAgICAgcEhkZEN0eC0+Y2ZnX2luaS0+bk5laWdoYm9yU2NhblBlcmlvZCA9IHZhbDsKKyAgICAgICAgICAgc21lX3NldE5laWdoYm9yU2NhblBlcmlvZCgodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCksIHZhbCk7CisgICAgICAgfQorICAgICAgIGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIkdFVFNDQU5IT01FVElNRSIsIDE1KSA9PSAwKQorICAgICAgIHsKKyAgICAgICAgICAgdEFOSV9VMTYgdmFsID0gc21lX2dldE5laWdoYm9yU2NhblBlcmlvZCgodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCkpOworICAgICAgICAgICBjaGFyIGV4dHJhWzMyXTsKKyAgICAgICAgICAgdEFOSV9VOCBsZW4gPSAwOworCisgICAgICAgICAgIC8qIHZhbHVlIGlzIGludGVybXMgb2YgbXNlYyAqLworICAgICAgICAgICBsZW4gPSBzY25wcmludGYoZXh0cmEsIHNpemVvZihleHRyYSksICIlcyAlZCIsCisgICAgICAgICAgICAgICAgICAgIkdFVFNDQU5IT01FVElNRSIsIHZhbCk7CisgICAgICAgICAgIGxlbiA9IFZPU19NSU4ocHJpdl9kYXRhLnRvdGFsX2xlbiwgbGVuICsgMSk7CisgICAgICAgICAgIGlmIChjb3B5X3RvX3VzZXIocHJpdl9kYXRhLmJ1ZiwgJmV4dHJhLCBsZW4pKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IGZhaWxlZCB0byBjb3B5IGRhdGEgdG8gdXNlciBidWZmZXIiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICByZXQgPSAtRUZBVUxUOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisgICAgICAgfQorICAgICAgIGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIlNFVFJPQU1JTlRSQUJBTkQiLCAxNikgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIHRBTklfVTggKnZhbHVlID0gY29tbWFuZDsKKyAgICAgICAgICAgdEFOSV9VOCB2YWwgPSBDRkdfUk9BTV9JTlRSQV9CQU5EX0RFRkFVTFQ7CisKKyAgICAgICAgICAgLyogTW92ZSBwb2ludGVyIHRvIGFoZWFkIG9mIFNFVFJPQU1JTlRSQUJBTkQ8ZGVsaW1pdGVyPiAqLworICAgICAgICAgICB2YWx1ZSA9IHZhbHVlICsgMTc7CisgICAgICAgICAgIC8qIENvbnZlcnQgdGhlIHZhbHVlIGZyb20gYXNjaWkgdG8gaW50ZWdlciAqLworICAgICAgICAgICByZXQgPSBrc3RydG91OCh2YWx1ZSwgMTAsICZ2YWwpOworICAgICAgICAgICBpZiAocmV0IDwgMCkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgLyogSWYgdGhlIGlucHV0IHZhbHVlIGlzIGdyZWF0ZXIgdGhhbiBtYXggdmFsdWUgb2YgZGF0YXR5cGUsIHRoZW4gYWxzbworICAgICAgICAgICAgICAgICAga3N0cnRvdTggZmFpbHMgKi8KKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IGtzdHJ0b3U4IGZhaWxlZCByYW5nZSBbJWQgLSAlZF0iLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgICBDRkdfUk9BTV9JTlRSQV9CQU5EX01JTiwKKyAgICAgICAgICAgICAgICAgICAgICBDRkdfUk9BTV9JTlRSQV9CQU5EX01BWCk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICAgICAgaWYgKCh2YWwgPCBDRkdfUk9BTV9JTlRSQV9CQU5EX01JTikgfHwKKyAgICAgICAgICAgICAgICh2YWwgPiBDRkdfUk9BTV9JTlRSQV9CQU5EX01BWCkpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiaW50cmEgYmFuZCBtb2RlIHZhbHVlICVkIGlzIG91dCBvZiByYW5nZSIKKyAgICAgICAgICAgICAgICAgICAgICAiIChNaW46ICVkIE1heDogJWQpIiwgdmFsLAorICAgICAgICAgICAgICAgICAgICAgIENGR19ST0FNX0lOVFJBX0JBTkRfTUlOLAorICAgICAgICAgICAgICAgICAgICAgIENGR19ST0FNX0lOVFJBX0JBTkRfTUFYKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBSZWNlaXZlZCBDb21tYW5kIHRvIGNoYW5nZSBpbnRyYSBiYW5kID0gJWQiLCBfX2Z1bmNfXywgdmFsKTsKKworICAgICAgICAgICBwSGRkQ3R4LT5jZmdfaW5pLT5uUm9hbUludHJhQmFuZCA9IHZhbDsKKyAgICAgICAgICAgc21lX3NldFJvYW1JbnRyYUJhbmQoKHRIYWxIYW5kbGUpKHBIZGRDdHgtPmhIYWwpLCB2YWwpOworICAgICAgIH0KKyAgICAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJHRVRST0FNSU5UUkFCQU5EIiwgMTYpID09IDApCisgICAgICAgeworICAgICAgICAgICB0QU5JX1UxNiB2YWwgPSBzbWVfZ2V0Um9hbUludHJhQmFuZCgodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCkpOworICAgICAgICAgICBjaGFyIGV4dHJhWzMyXTsKKyAgICAgICAgICAgdEFOSV9VOCBsZW4gPSAwOworCisgICAgICAgICAgIC8qIHZhbHVlIGlzIGludGVybXMgb2YgbXNlYyAqLworICAgICAgICAgICBsZW4gPSBzY25wcmludGYoZXh0cmEsIHNpemVvZihleHRyYSksICIlcyAlZCIsCisgICAgICAgICAgICAgICAgICAgIkdFVFJPQU1JTlRSQUJBTkQiLCB2YWwpOworICAgICAgICAgICBsZW4gPSBWT1NfTUlOKHByaXZfZGF0YS50b3RhbF9sZW4sIGxlbiArIDEpOworICAgICAgICAgICBpZiAoY29weV90b191c2VyKHByaXZfZGF0YS5idWYsICZleHRyYSwgbGVuKSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBmYWlsZWQgdG8gY29weSBkYXRhIHRvIHVzZXIgYnVmZmVyIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgcmV0ID0gLUVGQVVMVDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorICAgICAgIH0KKyAgICAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJTRVRTQ0FOTlBST0JFUyIsIDE0KSA9PSAwKQorICAgICAgIHsKKyAgICAgICAgICAgdEFOSV9VOCAqdmFsdWUgPSBjb21tYW5kOworICAgICAgICAgICB0QU5JX1U4IG5Qcm9iZXMgPSBDRkdfUk9BTV9TQ0FOX05fUFJPQkVTX0RFRkFVTFQ7CisKKyAgICAgICAgICAgLyogTW92ZSBwb2ludGVyIHRvIGFoZWFkIG9mIFNFVFNDQU5OUFJPQkVTPGRlbGltaXRlcj4gKi8KKyAgICAgICAgICAgdmFsdWUgPSB2YWx1ZSArIDE1OworICAgICAgICAgICAvKiBDb252ZXJ0IHRoZSB2YWx1ZSBmcm9tIGFzY2lpIHRvIGludGVnZXIgKi8KKyAgICAgICAgICAgcmV0ID0ga3N0cnRvdTgodmFsdWUsIDEwLCAmblByb2Jlcyk7CisgICAgICAgICAgIGlmIChyZXQgPCAwKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvKiBJZiB0aGUgaW5wdXQgdmFsdWUgaXMgZ3JlYXRlciB0aGFuIG1heCB2YWx1ZSBvZiBkYXRhdHlwZSwgdGhlbiBhbHNvCisgICAgICAgICAgICAgICAgICBrc3RydG91OCBmYWlscyAqLworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICIlczoga3N0cnRvdTggZmFpbGVkIHJhbmdlIFslZCAtICVkXSIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICAgIENGR19ST0FNX1NDQU5fTl9QUk9CRVNfTUlOLAorICAgICAgICAgICAgICAgICAgICAgIENGR19ST0FNX1NDQU5fTl9QUk9CRVNfTUFYKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKworICAgICAgICAgICBpZiAoKG5Qcm9iZXMgPCBDRkdfUk9BTV9TQ0FOX05fUFJPQkVTX01JTikgfHwKKyAgICAgICAgICAgICAgIChuUHJvYmVzID4gQ0ZHX1JPQU1fU0NBTl9OX1BST0JFU19NQVgpKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgIk5Qcm9iZXMgdmFsdWUgJWQgaXMgb3V0IG9mIHJhbmdlIgorICAgICAgICAgICAgICAgICAgICAgICIgKE1pbjogJWQgTWF4OiAlZCkiLCBuUHJvYmVzLAorICAgICAgICAgICAgICAgICAgICAgIENGR19ST0FNX1NDQU5fTl9QUk9CRVNfTUlOLAorICAgICAgICAgICAgICAgICAgICAgIENGR19ST0FNX1NDQU5fTl9QUk9CRVNfTUFYKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKworICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IFJlY2VpdmVkIENvbW1hbmQgdG8gU2V0IG5Qcm9iZXMgPSAlZCIsIF9fZnVuY19fLCBuUHJvYmVzKTsKKworICAgICAgICAgICBwSGRkQ3R4LT5jZmdfaW5pLT5uUHJvYmVzID0gblByb2JlczsKKyAgICAgICAgICAgc21lX1VwZGF0ZVJvYW1TY2FuTlByb2JlcygodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCksIG5Qcm9iZXMpOworICAgICAgIH0KKyAgICAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJHRVRTQ0FOTlBST0JFUyIsIDE0KSA9PSAwKQorICAgICAgIHsKKyAgICAgICAgICAgdEFOSV9VOCB2YWwgPSBzbWVfZ2V0Um9hbVNjYW5OUHJvYmVzKCh0SGFsSGFuZGxlKShwSGRkQ3R4LT5oSGFsKSk7CisgICAgICAgICAgIGNoYXIgZXh0cmFbMzJdOworICAgICAgICAgICB0QU5JX1U4IGxlbiA9IDA7CisKKyAgICAgICAgICAgbGVuID0gc2NucHJpbnRmKGV4dHJhLCBzaXplb2YoZXh0cmEpLCAiJXMgJWQiLCBjb21tYW5kLCB2YWwpOworICAgICAgICAgICBsZW4gPSBWT1NfTUlOKHByaXZfZGF0YS50b3RhbF9sZW4sIGxlbiArIDEpOworICAgICAgICAgICBpZiAoY29weV90b191c2VyKHByaXZfZGF0YS5idWYsICZleHRyYSwgbGVuKSkgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBmYWlsZWQgdG8gY29weSBkYXRhIHRvIHVzZXIgYnVmZmVyIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgcmV0ID0gLUVGQVVMVDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorICAgICAgIH0KKyAgICAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJTRVRTQ0FOSE9NRUFXQVlUSU1FIiwgMTkpID09IDApCisgICAgICAgeworICAgICAgICAgICB0QU5JX1U4ICp2YWx1ZSA9IGNvbW1hbmQ7CisgICAgICAgICAgIHRBTklfVTE2IGhvbWVBd2F5VGltZSA9IENGR19ST0FNX1NDQU5fSE9NRV9BV0FZX1RJTUVfREVGQVVMVDsKKworICAgICAgICAgICAvKiBNb3ZlIHBvaW50ZXIgdG8gYWhlYWQgb2YgU0VUU0NBTkhPTUVBV0FZVElNRTxkZWxpbWl0ZXI+ICovCisgICAgICAgICAgIC8qIGlucHV0IHZhbHVlIGlzIGluIHVuaXRzIG9mIG1zZWMgKi8KKyAgICAgICAgICAgdmFsdWUgPSB2YWx1ZSArIDIwOworICAgICAgICAgICAvKiBDb252ZXJ0IHRoZSB2YWx1ZSBmcm9tIGFzY2lpIHRvIGludGVnZXIgKi8KKyAgICAgICAgICAgcmV0ID0ga3N0cnRvdTE2KHZhbHVlLCAxMCwgJmhvbWVBd2F5VGltZSk7CisgICAgICAgICAgIGlmIChyZXQgPCAwKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvKiBJZiB0aGUgaW5wdXQgdmFsdWUgaXMgZ3JlYXRlciB0aGFuIG1heCB2YWx1ZSBvZiBkYXRhdHlwZSwgdGhlbiBhbHNvCisgICAgICAgICAgICAgICAgICBrc3RydG91OCBmYWlscyAqLworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICIlczoga3N0cnRvdTggZmFpbGVkIHJhbmdlIFslZCAtICVkXSIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICAgIENGR19ST0FNX1NDQU5fSE9NRV9BV0FZX1RJTUVfTUlOLAorICAgICAgICAgICAgICAgICAgICAgIENGR19ST0FNX1NDQU5fSE9NRV9BV0FZX1RJTUVfTUFYKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKworICAgICAgICAgICBpZiAoKGhvbWVBd2F5VGltZSA8IENGR19ST0FNX1NDQU5fSE9NRV9BV0FZX1RJTUVfTUlOKSB8fAorICAgICAgICAgICAgICAgKGhvbWVBd2F5VGltZSA+IENGR19ST0FNX1NDQU5fSE9NRV9BV0FZX1RJTUVfTUFYKSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICJob21lQXdheVRpbWUgdmFsdWUgJWQgaXMgb3V0IG9mIHJhbmdlIgorICAgICAgICAgICAgICAgICAgICAgICIgKE1pbjogJWQgTWF4OiAlZCkiLCBob21lQXdheVRpbWUsCisgICAgICAgICAgICAgICAgICAgICAgQ0ZHX1JPQU1fU0NBTl9IT01FX0FXQVlfVElNRV9NSU4sCisgICAgICAgICAgICAgICAgICAgICAgQ0ZHX1JPQU1fU0NBTl9IT01FX0FXQVlfVElNRV9NQVgpOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorCisgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICIlczogUmVjZWl2ZWQgQ29tbWFuZCB0byBTZXQgc2NhbiBhd2F5IHRpbWUgPSAlZCIsIF9fZnVuY19fLCBob21lQXdheVRpbWUpOworICAgICAgICAgICBpZiAocEhkZEN0eC0+Y2ZnX2luaS0+blJvYW1TY2FuSG9tZUF3YXlUaW1lICE9IGhvbWVBd2F5VGltZSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgcEhkZEN0eC0+Y2ZnX2luaS0+blJvYW1TY2FuSG9tZUF3YXlUaW1lID0gaG9tZUF3YXlUaW1lOworICAgICAgICAgICAgICAgc21lX1VwZGF0ZVJvYW1TY2FuSG9tZUF3YXlUaW1lKCh0SGFsSGFuZGxlKShwSGRkQ3R4LT5oSGFsKSwgaG9tZUF3YXlUaW1lLCBlQU5JX0JPT0xFQU5fVFJVRSk7CisgICAgICAgICAgIH0KKyAgICAgICB9CisgICAgICAgZWxzZSBpZiAoc3RybmNtcChjb21tYW5kLCAiR0VUU0NBTkhPTUVBV0FZVElNRSIsIDE5KSA9PSAwKQorICAgICAgIHsKKyAgICAgICAgICAgdEFOSV9VMTYgdmFsID0gc21lX2dldFJvYW1TY2FuSG9tZUF3YXlUaW1lKCh0SGFsSGFuZGxlKShwSGRkQ3R4LT5oSGFsKSk7CisgICAgICAgICAgIGNoYXIgZXh0cmFbMzJdOworICAgICAgICAgICB0QU5JX1U4IGxlbiA9IDA7CisKKyAgICAgICAgICAgbGVuID0gc2NucHJpbnRmKGV4dHJhLCBzaXplb2YoZXh0cmEpLCAiJXMgJWQiLCBjb21tYW5kLCB2YWwpOworICAgICAgICAgICBsZW4gPSBWT1NfTUlOKHByaXZfZGF0YS50b3RhbF9sZW4sIGxlbiArIDEpOworICAgICAgICAgICBpZiAoY29weV90b191c2VyKHByaXZfZGF0YS5idWYsICZleHRyYSwgbGVuKSkgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBmYWlsZWQgdG8gY29weSBkYXRhIHRvIHVzZXIgYnVmZmVyIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgcmV0ID0gLUVGQVVMVDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorICAgICAgIH0KKyAgICAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJSRUFTU09DIiwgNykgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIHRBTklfVTggKnZhbHVlID0gY29tbWFuZDsKKyAgICAgICAgICAgdEFOSV9VOCBjaGFubmVsID0gMDsKKyAgICAgICAgICAgdFNpck1hY0FkZHIgdGFyZ2V0QXBCc3NpZDsKKyAgICAgICAgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworI2lmZGVmIFdMQU5fRkVBVFVSRV9ST0FNX1NDQU5fT0ZGTE9BRAorICAgICAgICAgICB0Q3NySGFuZG9mZlJlcXVlc3QgaGFuZG9mZkluZm87CisjZW5kaWYKKyAgICAgICAgICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHggPSBOVUxMOworICAgICAgICAgICBwSGRkU3RhQ3R4ID0gV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlcik7CisKKyAgICAgICAgICAgLyogaWYgbm90IGFzc29jaWF0ZWQsIG5vIG5lZWQgdG8gcHJvY2VlZCB3aXRoIHJlYXNzb2MgKi8KKyAgICAgICAgICAgaWYgKGVDb25uZWN0aW9uU3RhdGVfQXNzb2NpYXRlZCAhPSBwSGRkU3RhQ3R4LT5jb25uX2luZm8uY29ublN0YXRlKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXM6Tm90IGFzc29jaWF0ZWQhIixfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICAgICAgc3RhdHVzID0gaGRkX3BhcnNlX3JlYXNzb2NfY29tbWFuZF9kYXRhKHZhbHVlLCB0YXJnZXRBcEJzc2lkLCAmY2hhbm5lbCk7CisgICAgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBGYWlsZWQgdG8gcGFyc2UgcmVhc3NvYyBjb21tYW5kIGRhdGEiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICAgICAgLyogaWYgdGhlIHRhcmdldCBic3NpZCBpcyBzYW1lIGFzIGN1cnJlbnRseSBhc3NvY2lhdGVkIEFQLAorICAgICAgICAgICAgICB0aGVuIG5vIG5lZWQgdG8gcHJvY2VlZCB3aXRoIHJlYXNzb2MgKi8KKyAgICAgICAgICAgaWYgKFZPU19UUlVFID09IHZvc19tZW1fY29tcGFyZSh0YXJnZXRBcEJzc2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5ic3NJZCwgc2l6ZW9mKHRTaXJNYWNBZGRyKSkpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczpSZWFzc29jIEJTU0lEIGlzIHNhbWUgYXMgY3VycmVudGx5IGFzc29jaWF0ZWQgQVAgYnNzaWQiLF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKworICAgICAgICAgICAvKiBDaGVjayBjaGFubmVsIG51bWJlciBpcyBhIHZhbGlkIGNoYW5uZWwgbnVtYmVyICovCisgICAgICAgICAgIGlmKFZPU19TVEFUVVNfU1VDQ0VTUyAhPQorICAgICAgICAgICAgICAgICAgICAgICAgIHdsYW5faGRkX3ZhbGlkYXRlX29wZXJhdGlvbl9jaGFubmVsKHBBZGFwdGVyLCBjaGFubmVsKSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgQ2hhbm5lbCBbJWRdIiwgX19mdW5jX18sIGNoYW5uZWwpOworICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgICAgIH0KKworICAgICAgICAgICAvKiBQcm9jZWVkIHdpdGggcmVhc3NvYyAqLworI2lmZGVmIFdMQU5fRkVBVFVSRV9ST0FNX1NDQU5fT0ZGTE9BRAorICAgICAgICAgICBoYW5kb2ZmSW5mby5jaGFubmVsID0gY2hhbm5lbDsKKyAgICAgICAgICAgdm9zX21lbV9jb3B5KGhhbmRvZmZJbmZvLmJzc2lkLCB0YXJnZXRBcEJzc2lkLCBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgICAgc21lX0hhbmRvZmZSZXF1ZXN0KHBIZGRDdHgtPmhIYWwsICZoYW5kb2ZmSW5mbyk7CisjZW5kaWYKKyAgICAgICB9CisgICAgICAgZWxzZSBpZiAoc3RybmNtcChjb21tYW5kLCAiU0VUV0VTTU9ERSIsIDEwKSA9PSAwKQorICAgICAgIHsKKyAgICAgICAgICAgdEFOSV9VOCAqdmFsdWUgPSBjb21tYW5kOworICAgICAgICAgICB0QU5JX0JPT0xFQU4gd2VzTW9kZSA9IENGR19FTkFCTEVfV0VTX01PREVfTkFNRV9ERUZBVUxUOworCisgICAgICAgICAgIC8qIE1vdmUgcG9pbnRlciB0byBhaGVhZCBvZiBTRVRXRVNNT0RFPGRlbGltaXRlcj4gKi8KKyAgICAgICAgICAgdmFsdWUgPSB2YWx1ZSArIDExOworICAgICAgICAgICAvKiBDb252ZXJ0IHRoZSB2YWx1ZSBmcm9tIGFzY2lpIHRvIGludGVnZXIgKi8KKyAgICAgICAgICAgcmV0ID0ga3N0cnRvdTgodmFsdWUsIDEwLCAmd2VzTW9kZSk7CisgICAgICAgICAgIGlmIChyZXQgPCAwKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvKiBJZiB0aGUgaW5wdXQgdmFsdWUgaXMgZ3JlYXRlciB0aGFuIG1heCB2YWx1ZSBvZiBkYXRhdHlwZSwgdGhlbiBhbHNvCisgICAgICAgICAgICAgICAgICBrc3RydG91OCBmYWlscyAqLworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICIlczoga3N0cnRvdTggZmFpbGVkIHJhbmdlIFslZCAtICVkXSIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICAgIENGR19FTkFCTEVfV0VTX01PREVfTkFNRV9NSU4sCisgICAgICAgICAgICAgICAgICAgICAgQ0ZHX0VOQUJMRV9XRVNfTU9ERV9OQU1FX01BWCk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICAgICAgaWYgKCh3ZXNNb2RlIDwgQ0ZHX0VOQUJMRV9XRVNfTU9ERV9OQU1FX01JTikgfHwKKyAgICAgICAgICAgICAgICh3ZXNNb2RlID4gQ0ZHX0VOQUJMRV9XRVNfTU9ERV9OQU1FX01BWCkpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiV0VTIE1vZGUgdmFsdWUgJWQgaXMgb3V0IG9mIHJhbmdlIgorICAgICAgICAgICAgICAgICAgICAgICIgKE1pbjogJWQgTWF4OiAlZCkiLCB3ZXNNb2RlLAorICAgICAgICAgICAgICAgICAgICAgIENGR19FTkFCTEVfV0VTX01PREVfTkFNRV9NSU4sCisgICAgICAgICAgICAgICAgICAgICAgQ0ZHX0VOQUJMRV9XRVNfTU9ERV9OQU1FX01BWCk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICIlczogUmVjZWl2ZWQgQ29tbWFuZCB0byBTZXQgV0VTIE1vZGUgcnNzaSBkaWZmID0gJWQiLCBfX2Z1bmNfXywgd2VzTW9kZSk7CisKKyAgICAgICAgICAgcEhkZEN0eC0+Y2ZnX2luaS0+aXNXRVNNb2RlRW5hYmxlZCA9IHdlc01vZGU7CisgICAgICAgICAgIHNtZV9VcGRhdGVXRVNNb2RlKCh0SGFsSGFuZGxlKShwSGRkQ3R4LT5oSGFsKSwgd2VzTW9kZSk7CisgICAgICAgfQorICAgICAgIGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIkdFVFdFU01PREUiLCAxMCkgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIHRBTklfQk9PTEVBTiB3ZXNNb2RlID0gc21lX0dldFdFU01vZGUoKHRIYWxIYW5kbGUpKHBIZGRDdHgtPmhIYWwpKTsKKyAgICAgICAgICAgY2hhciBleHRyYVszMl07CisgICAgICAgICAgIHRBTklfVTggbGVuID0gMDsKKworICAgICAgICAgICBsZW4gPSBzY25wcmludGYoZXh0cmEsIHNpemVvZihleHRyYSksICIlcyAlZCIsIGNvbW1hbmQsIHdlc01vZGUpOworICAgICAgICAgICBsZW4gPSBWT1NfTUlOKHByaXZfZGF0YS50b3RhbF9sZW4sIGxlbiArIDEpOworICAgICAgICAgICBpZiAoY29weV90b191c2VyKHByaXZfZGF0YS5idWYsICZleHRyYSwgbGVuKSkgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBmYWlsZWQgdG8gY29weSBkYXRhIHRvIHVzZXIgYnVmZmVyIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgcmV0ID0gLUVGQVVMVDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorICAgICAgIH0KKyNlbmRpZiAvKiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUiB8fCBGRUFUVVJFX1dMQU5fRVNFIHx8IEZFQVRVUkVfV0xBTl9MRlIgKi8KKyNpZmRlZiBGRUFUVVJFX1dMQU5fTEZSCisgICAgICAgZWxzZSBpZiAoc3RybmNtcChjb21tYW5kLCAiU0VURkFTVFJPQU0iLCAxMSkgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIHRBTklfVTggKnZhbHVlID0gY29tbWFuZDsKKyAgICAgICAgICAgdEFOSV9VOCBsZnJNb2RlID0gQ0ZHX0xGUl9GRUFUVVJFX0VOQUJMRURfREVGQVVMVDsKKworICAgICAgICAgICAvKiBNb3ZlIHBvaW50ZXIgdG8gYWhlYWQgb2YgU0VURkFTVFJPQU08ZGVsaW1pdGVyPiAqLworICAgICAgICAgICB2YWx1ZSA9IHZhbHVlICsgMTI7CisgICAgICAgICAgIC8qIENvbnZlcnQgdGhlIHZhbHVlIGZyb20gYXNjaWkgdG8gaW50ZWdlciAqLworICAgICAgICAgICByZXQgPSBrc3RydG91OCh2YWx1ZSwgMTAsICZsZnJNb2RlKTsKKyAgICAgICAgICAgaWYgKHJldCA8IDApCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8qIElmIHRoZSBpbnB1dCB2YWx1ZSBpcyBncmVhdGVyIHRoYW4gbWF4IHZhbHVlIG9mIGRhdGF0eXBlLCB0aGVuIGFsc28KKyAgICAgICAgICAgICAgICAgIGtzdHJ0b3U4IGZhaWxzICovCisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBrc3RydG91OCBmYWlsZWQgcmFuZ2UgWyVkIC0gJWRdIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgQ0ZHX0xGUl9GRUFUVVJFX0VOQUJMRURfTUlOLAorICAgICAgICAgICAgICAgICAgICAgIENGR19MRlJfRkVBVFVSRV9FTkFCTEVEX01BWCk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICAgICAgaWYgKChsZnJNb2RlIDwgQ0ZHX0xGUl9GRUFUVVJFX0VOQUJMRURfTUlOKSB8fAorICAgICAgICAgICAgICAgKGxmck1vZGUgPiBDRkdfTEZSX0ZFQVRVUkVfRU5BQkxFRF9NQVgpKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgImxmciBtb2RlIHZhbHVlICVkIGlzIG91dCBvZiByYW5nZSIKKyAgICAgICAgICAgICAgICAgICAgICAiIChNaW46ICVkIE1heDogJWQpIiwgbGZyTW9kZSwKKyAgICAgICAgICAgICAgICAgICAgICBDRkdfTEZSX0ZFQVRVUkVfRU5BQkxFRF9NSU4sCisgICAgICAgICAgICAgICAgICAgICAgQ0ZHX0xGUl9GRUFUVVJFX0VOQUJMRURfTUFYKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKworICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IFJlY2VpdmVkIENvbW1hbmQgdG8gY2hhbmdlIGxmciBtb2RlID0gJWQiLCBfX2Z1bmNfXywgbGZyTW9kZSk7CisKKyAgICAgICAgICAgcEhkZEN0eC0+Y2ZnX2luaS0+aXNGYXN0Um9hbUluaUZlYXR1cmVFbmFibGVkID0gbGZyTW9kZTsKKyAgICAgICAgICAgc21lX1VwZGF0ZUlzRmFzdFJvYW1JbmlGZWF0dXJlRW5hYmxlZCgodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCksIGxmck1vZGUpOworICAgICAgIH0KKyNlbmRpZgorI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCisgICAgICAgZWxzZSBpZiAoc3RybmNtcChjb21tYW5kLCAiU0VURkFTVFRSQU5TSVRJT04iLCAxNykgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIHRBTklfVTggKnZhbHVlID0gY29tbWFuZDsKKyAgICAgICAgICAgdEFOSV9VOCBmdCA9IENGR19GQVNUX1RSQU5TSVRJT05fRU5BQkxFRF9OQU1FX0RFRkFVTFQ7CisKKyAgICAgICAgICAgLyogTW92ZSBwb2ludGVyIHRvIGFoZWFkIG9mIFNFVEZBU1RST0FNPGRlbGltaXRlcj4gKi8KKyAgICAgICAgICAgdmFsdWUgPSB2YWx1ZSArIDE4OworICAgICAgICAgICAvKiBDb252ZXJ0IHRoZSB2YWx1ZSBmcm9tIGFzY2lpIHRvIGludGVnZXIgKi8KKyAgICAgICAgICAgcmV0ID0ga3N0cnRvdTgodmFsdWUsIDEwLCAmZnQpOworICAgICAgICAgICBpZiAocmV0IDwgMCkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgLyogSWYgdGhlIGlucHV0IHZhbHVlIGlzIGdyZWF0ZXIgdGhhbiBtYXggdmFsdWUgb2YgZGF0YXR5cGUsIHRoZW4gYWxzbworICAgICAgICAgICAgICAgICAga3N0cnRvdTggZmFpbHMgKi8KKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IGtzdHJ0b3U4IGZhaWxlZCByYW5nZSBbJWQgLSAlZF0iLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgICBDRkdfRkFTVF9UUkFOU0lUSU9OX0VOQUJMRURfTkFNRV9NSU4sCisgICAgICAgICAgICAgICAgICAgICAgQ0ZHX0ZBU1RfVFJBTlNJVElPTl9FTkFCTEVEX05BTUVfTUFYKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKworICAgICAgICAgICBpZiAoKGZ0IDwgQ0ZHX0ZBU1RfVFJBTlNJVElPTl9FTkFCTEVEX05BTUVfTUlOKSB8fAorICAgICAgICAgICAgICAgKGZ0ID4gQ0ZHX0ZBU1RfVFJBTlNJVElPTl9FTkFCTEVEX05BTUVfTUFYKSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICJmdCBtb2RlIHZhbHVlICVkIGlzIG91dCBvZiByYW5nZSIKKyAgICAgICAgICAgICAgICAgICAgICAiIChNaW46ICVkIE1heDogJWQpIiwgZnQsCisgICAgICAgICAgICAgICAgICAgICAgQ0ZHX0ZBU1RfVFJBTlNJVElPTl9FTkFCTEVEX05BTUVfTUlOLAorICAgICAgICAgICAgICAgICAgICAgIENGR19GQVNUX1RSQU5TSVRJT05fRU5BQkxFRF9OQU1FX01BWCk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBSZWNlaXZlZCBDb21tYW5kIHRvIGNoYW5nZSBmdCBtb2RlID0gJWQiLCBfX2Z1bmNfXywgZnQpOworCisgICAgICAgICAgIHBIZGRDdHgtPmNmZ19pbmktPmlzRmFzdFRyYW5zaXRpb25FbmFibGVkID0gZnQ7CisgICAgICAgICAgIHNtZV9VcGRhdGVGYXN0VHJhbnNpdGlvbkVuYWJsZWQoKHRIYWxIYW5kbGUpKHBIZGRDdHgtPmhIYWwpLCBmdCk7CisgICAgICAgfQorICAgICAgIGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIlNFVERGU1NDQU5NT0RFIiwgMTQpID09IDApCisgICAgICAgeworICAgICAgICAgICB0QU5JX1U4ICp2YWx1ZSA9IGNvbW1hbmQ7CisgICAgICAgICAgIHRBTklfVTggZGZzU2Nhbk1vZGUgPSBERlNfQ0hOTF9TQ0FOX0VOQUJMRURfTk9STUFMOworCisgICAgICAgICAgIC8qIE1vdmUgcG9pbnRlciB0byBhaGVhZCBvZiBTRVRERlNTQ0FOTU9ERTxkZWxpbWl0ZXI+ICovCisgICAgICAgICAgIHZhbHVlID0gdmFsdWUgKyAxNTsKKyAgICAgICAgICAgLyogQ29udmVydCB0aGUgdmFsdWUgZnJvbSBhc2NpaSB0byBpbnRlZ2VyICovCisgICAgICAgICAgIHJldCA9IGtzdHJ0b3U4KHZhbHVlLCAxMCwgJmRmc1NjYW5Nb2RlKTsKKyAgICAgICAgICAgaWYgKHJldCA8IDApCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8qIElmIHRoZSBpbnB1dCB2YWx1ZSBpcyBncmVhdGVyIHRoYW4gbWF4IHZhbHVlIG9mCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YXR5cGUsIHRoZW4gYWxzbyBrc3RydG91OCBmYWlscworICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICIlczoga3N0cnRvdTggZmFpbGVkIHJhbmdlIFslZCAtICVkXSIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICAgIENGR19FTkFCTEVfREZTX0NITkxfU0NBTl9NSU4sCisgICAgICAgICAgICAgICAgICAgICAgQ0ZHX0VOQUJMRV9ERlNfQ0hOTF9TQ0FOX01BWCk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICAgICAgaWYgKChkZnNTY2FuTW9kZSA8IENGR19FTkFCTEVfREZTX0NITkxfU0NBTl9NSU4pIHx8CisgICAgICAgICAgICAgICAoZGZzU2Nhbk1vZGUgPiBDRkdfRU5BQkxFX0RGU19DSE5MX1NDQU5fTUFYKSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICJkZnNTY2FuTW9kZSB2YWx1ZSAlZCBpcyBvdXQgb2YgcmFuZ2UiCisgICAgICAgICAgICAgICAgICAgICAgIiAoTWluOiAlZCBNYXg6ICVkKSIsIGRmc1NjYW5Nb2RlLAorICAgICAgICAgICAgICAgICAgICAgIENGR19FTkFCTEVfREZTX0NITkxfU0NBTl9NSU4sCisgICAgICAgICAgICAgICAgICAgICAgQ0ZHX0VOQUJMRV9ERlNfQ0hOTF9TQ0FOX01BWCk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICIlczogUmVjZWl2ZWQgQ29tbWFuZCB0byBTZXQgREZTIFNjYW4gTW9kZSA9ICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgZGZzU2Nhbk1vZGUpOworCisgICAgICAgICAgIHJldCA9IHdsYW5faGRkX2hhbmRsZV9kZnNfY2hhbl9zY2FuKHBIZGRDdHgsIGRmc1NjYW5Nb2RlKTsKKyAgICAgICB9CisgICAgICAgZWxzZSBpZiAoc3RybmNtcChjb21tYW5kLCAiR0VUREZTU0NBTk1PREUiLCAxNCkgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIHRBTklfVTggZGZzU2Nhbk1vZGUgPSBzbWVfR2V0REZTU2Nhbk1vZGUocEhkZEN0eC0+aEhhbCk7CisgICAgICAgICAgIGNoYXIgZXh0cmFbMzJdOworICAgICAgICAgICB0QU5JX1U4IGxlbiA9IDA7CisKKyAgICAgICAgICAgbGVuID0gc2NucHJpbnRmKGV4dHJhLCBzaXplb2YoZXh0cmEpLCAiJXMgJWQiLCBjb21tYW5kLCBkZnNTY2FuTW9kZSk7CisgICAgICAgICAgIGxlbiA9IFZPU19NSU4ocHJpdl9kYXRhLnRvdGFsX2xlbiwgbGVuICsgMSk7CisgICAgICAgICAgIGlmIChjb3B5X3RvX3VzZXIocHJpdl9kYXRhLmJ1ZiwgJmV4dHJhLCBsZW4pKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IGZhaWxlZCB0byBjb3B5IGRhdGEgdG8gdXNlciBidWZmZXIiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICByZXQgPSAtRUZBVUxUOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisgICAgICAgfQorICAgICAgIGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIkZBU1RSRUFTU09DIiwgMTEpID09IDApCisgICAgICAgeworICAgICAgICAgICB0QU5JX1U4ICp2YWx1ZSA9IGNvbW1hbmQ7CisgICAgICAgICAgIHRBTklfVTggY2hhbm5lbCA9IDA7CisgICAgICAgICAgIHRTaXJNYWNBZGRyIHRhcmdldEFwQnNzaWQ7CisgICAgICAgICAgIHRBTklfVTggdHJpZ2dlciA9IDA7CisgICAgICA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19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEZhaWxlZCB0byBwYXJzZSByZWFzc29jIGNvbW1hbmQgZGF0YSIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKworICAgICAgICAgICAvKiBpZiB0aGUgdGFyZ2V0IGJzc2lkIGlzIHNhbWUgYXMgY3VycmVudGx5IGFzc29jaWF0ZWQgQVAsCisgICAgICAgICAgICAgIGlzc3VlIHJlYXNzb2MgdG8gc2FtZSBBUCAqLworICAgICAgICAgICBpZiAoVk9TX1RSVUUgPT0gdm9zX21lbV9jb21wYXJlKHRhcmdldEFwQnNzaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmJzc0lkLCBzaXplb2YodFNpck1hY0FkZHIpKSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6MTFyIFJlYXNzb2MgQlNTSUQgaXMgc2FtZSBhcyBjdXJyZW50bHkgYXNzb2NpYXRlZCBBUCBic3NpZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICAgICAgc21lX0dldE1vZGlmeVByb2ZpbGVGaWVsZHMoaEhhbCwgcEFkYXB0ZXItPnNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZtb2RQcm9maWxlRmllbGRzKTsKKyAgICAgICAgICAgICAgIHNtZV9Sb2FtUmVhc3NvYyhoSGFsLCBwQWRhcHRlci0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsIG1vZFByb2ZpbGVGaWVsZHMsICZyb2FtSWQsIDEpOworICAgICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgICAgIH0KKworICAgICAgICAgICAvKiBDaGVjayBjaGFubmVsIG51bWJlciBpcyBhIHZhbGlkIGNoYW5uZWwgbnVtYmVyICovCisgICAgICAgICAgIGlmKFZPU19TVEFUVVNfU1VDQ0VTUyAhPQorICAgICAgICAgICAgICAgICAgICAgICAgIHdsYW5faGRkX3ZhbGlkYXRlX29wZXJhdGlvbl9jaGFubmVsKHBBZGFwdGVyLCBjaGFubmVsKSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgQ2hhbm5lbCAgWyVkXSIsIF9fZnVuY19fLCBjaGFubmVsKTsKKyAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICB9CisKKyAgICAgICAgICAgdHJpZ2dlciA9IGVTTUVfUk9BTV9UUklHR0VSX1NDQU47CisKKyAgICAgICAgICAgLyogUHJvY2VlZCB3aXRoIHNjYW4vcm9hbSAqLworICAgICAgICAgICBzbWVJc3N1ZUZhc3RSb2FtTmVpZ2hib3JBUEV2ZW50KFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdGFyZ2V0QXBCc3NpZFswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodFNtZUZhc3RSb2FtVHJpZ2dlcikodHJpZ2dlciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbCk7CisgICAgICAgfQorI2VuZGlmCisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRQorICAgICAgIGVsc2UgaWYgKHN0cm5jbX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bGltaXRlcj4gKi8KKyAgICAgICAgICAgdmFsdWUgPSB2YWx1ZSArIDExOworICAgICAgICAgICAvKiBDb252ZXJ0IHRoZSB2YWx1ZSBmcm9tIGFzY2lpIHRvIGludGVnZXIgKi8KKyAgICAgICAgICAgcmV0ID0ga3N0cnRvdTgodmFsdWUsIDEwLCAmZXNlTW9kZSk7CisgICAgICAgICAgIGlmIChyZXQgPCAwKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvKiBJZiB0aGUgaW5wdXQgdmFsdWUgaXMgZ3JlYXRlciB0aGFuIG1heCB2YWx1ZSBvZiBkYXRhdHlwZSwgdGhlbiBhbHNvCisgICAgICAgICAgICAgICAgICBrc3RydG91OCBmYWlscyAqLworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICIlczoga3N0cnRvdTggZmFpbGVkIHJhbmdlIFslZCAtICVkXSIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICAgIENGR19FU0VfRkVBVFVSRV9FTkFCTEVEX01JTiwKKyAgICAgICAgICAgICAgICAgICAgICBDRkdfRVNFX0ZFQVRVUkVfRU5BQkxFRF9NQVgpOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorICAgICAgICAgICBpZiAoKGVzZU1vZGUgPCBDRkdfRVNFX0ZFQVRVUkVfRU5BQkxFRF9NSU4pIHx8CisgICAgICAgICAgICAgICAoZXNlTW9kZSA+IENGR19FU0VfRkVBVFVSRV9FTkFCTEVEX01BWCkpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiRXNlIG1vZGUgdmFsdWUgJWQgaXMgb3V0IG9mIHJhbmdlIgorICAgICAgICAgICAgICAgICAgICAgICIgKE1pbjogJWQgTWF4OiAlZCkiLCBlc2VNb2RlLAorICAgICAgICAgICAgICAgICAgICAgIENGR19FU0VfRkVBVFVSRV9FTkFCTEVEX01JTiwKKyAgICAgICAgICAgICAgICAgICAgICBDRkdfRVNFX0ZFQVRVUkVfRU5BQkxFRF9NQVgpOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IFJlY2VpdmVkIENvbW1hbmQgdG8gY2hhbmdlIGVzZSBtb2RlID0gJWQiLCBfX2Z1bmNfXywgZXNlTW9kZSk7CisKKyAgICAgICAgICAgcEhkZEN0eC0+Y2ZnX2luaS0+aXNFc2VJbmlGZWF0dXJlRW5hYmxlZCA9IGVzZU1vZGU7CisgICAgICAgICAgIHNtZV9VcGRhdGVJc0VzZUZlYXR1cmVFbmFibGVkKCh0SGFsSGFuZGxlKShwSGRkQ3R4LT5oSGFsKSwgZXNlTW9kZSk7CisgICAgICAgfQorI2VuZGlmCisgICAgICAgZWxzZSBpZiAoc3RybmNtcChjb21tYW5kLCAiU0VUUk9BTVNDQU5DT05UUk9MIiwgMTgpID09IDApCisgICAgICAgeworICAgICAgICAgICB0QU5JX1U4ICp2YWx1ZSA9IGNvbW1hbmQ7CisgICAgICAgICAgIHRBTklfQk9PTEVBTiByb2FtU2NhbkNvbnRyb2wgPSAwOworCisgICAgICAgICAgIC8qIE1vdmUgcG9pbnRlciB0byBhaGVhZCBvZiBTRVRST0FNU0NBTkNPTlRST0w8ZGVsaW1pdGVyPiAqLworICAgICAgICAgICB2YWx1ZSA9IHZhbHVlICsgMTk7CisgICAgICAgICAgIC8qIENvbnZlcnQgdGhlIHZhbHVlIGZyb20gYXNjaWkgdG8gaW50ZWdlciAqLworICAgICAgICAgICByZXQgPSBrc3RydG91OCh2YWx1ZSwgMTAsICZyb2FtU2NhbkNvbnRyb2wpOworICAgICAgICAgICBpZiAocmV0IDwgMCkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgLyogSWYgdGhlIGlucHV0IHZhbHVlIGlzIGdyZWF0ZXIgdGhhbiBtYXggdmFsdWUgb2YgZGF0YXR5cGUsIHRoZW4gYWxzbworICAgICAgICAgICAgICAgICAga3N0cnRvdTggZmFpbHMgKi8KKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IGtzdHJ0b3U4IGZhaWxlZCAiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICAgICAgaWYgKDAgIT0gcm9hbVNjYW5Db250cm9sKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgInJvYW0gc2NhbiBjb250cm9sIGludmFsaWQgdmFsdWUgPSAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgcm9hbVNjYW5Db250cm9sKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBSZWNlaXZlZCBDb21tYW5kIHRvIFNldCByb2FtIHNjYW4gY29udHJvbCA9ICVkIiwgX19mdW5jX18sIHJvYW1TY2FuQ29udHJvbCk7CisKKyAgICAgICAgICAgc21lX1NldFJvYW1TY2FuQ29udHJvbCgodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCksIHJvYW1TY2FuQ29udHJvbCk7CisgICAgICAgfQorI2lmZGVmIEZFQVRVUkVfV0xBTl9PS0MKKyAgICAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJTRVRPS0NNT0RFIiwgMTApID09IDApCisgICAgICAgeworICAgICAgICAgICB0QU5JX1U4ICp2YWx1ZSA9IGNvbW1hbmQ7CisgICAgICAgICAgIHRBTklfVTggb2tjTW9kZSA9IENGR19PS0NfRkVBVFVSRV9FTkFCTEVEX0RFRkFVTFQ7CisKKyAgICAgICAgICAgLyogQ2hlY2sgaWYgdGhlIGZlYXR1cmVzIE9LQy9FU0UvMTFSIGFyZSBzdXBwb3J0ZWQgc2ltdWx0YW5lb3VzbHksCisgICAgICAgICAgICAgIHRoZW4gdGhpcyBvcGVyYXRpb24gaXMgbm90IHBlcm1pdHRlZCAocmV0dXJuIEZBSUxVUkUpICovCisgICAgICAgICAgIGlmIChzbWVfZ2V0SXNFc2VGZWF0dXJlRW5hYmxlZCgodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCkpICYmCisgICAgICAgICAgICAgICBoZGRfaXNfb2tjX21vZGVfZW5hYmxlZChwSGRkQ3R4KSAmJgorICAgICAgICAgICAgICAgc21lX2dldElzRnRGZWF0dXJlRW5hYmxlZCgodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCkpKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgICAgICIlczogT0tDL0VTRS8xMVIgYXJlIHN1cHBvcnRlZCBzaW11bHRhbmVvdXNseSIKKyAgICAgICAgICAgICAgICAgICIgaGVuY2UgdGhpcyBvcGVyYXRpb24gaXMgbm90IHBlcm1pdHRlZCEiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICByZXQgPSAtRVBFUk07CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKworICAgICAgICAgICAvKiBNb3ZlIHBvaW50ZXIgdG8gYWhlYWQgb2YgU0VUT0tDTU9ERTxkZWxpbWl0ZXI+ICovCisgICAgICAgICAgIHZhbHVlID0gdmFsdWUgKyAxMTsKKyAgICAgICAgICAgLyogQ29udmVydCB0aGUgdmFsdWUgZnJvbSBhc2NpaSB0byBpbnRlZ2VyICovCisgICAgICAgICAgIHJldCA9IGtzdHJ0b3U4KHZhbHVlLCAxMCwgJm9rY01vZGUpOworICAgICAgICAgICBpZiAocmV0IDwgMCkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgLyogSWYgdGhlIGlucHV0IHZhbHVlIGlzIGdyZWF0ZXIgdGhhbiBtYXggdmFsdWUgb2YgZGF0YXR5cGUsIHRoZW4gYWxzbworICAgICAgICAgICAgICAgICAga3N0cnRvdTggZmFpbHMgKi8KKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IGtzdHJ0b3U4IGZhaWxlZCByYW5nZSBbJWQgLSAlZF0iLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgICBDRkdfT0tDX0ZFQVRVUkVfRU5BQkxFRF9NSU4sCisgICAgICAgICAgICAgICAgICAgICAgQ0ZHX09LQ19GRUFUVVJFX0VOQUJMRURfTUFYKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKworICAgICAgICAgICBpZiAoKG9rY01vZGUgPCBDRkdfT0tDX0ZFQVRVUkVfRU5BQkxFRF9NSU4pIHx8CisgICAgICAgICAgICAgICAob2tjTW9kZSA+IENGR19PS0NfRkVBVFVSRV9FTkFCTEVEX01BWCkpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiT2tjIG1vZGUgdmFsdWUgJWQgaXMgb3V0IG9mIHJhbmdlIgorICAgICAgICAgICAgICAgICAgICAgICIgKE1pbjogJWQgTWF4OiAlZCkiLCBva2NNb2RlLAorICAgICAgICAgICAgICAgICAgICAgIENGR19PS0NfRkVBVFVSRV9FTkFCTEVEX01JTiwKKyAgICAgICAgICAgICAgICAgICAgICBDRkdfT0tDX0ZFQVRVUkVfRU5BQkxFRF9NQVgpOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorCisgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICIlczogUmVjZWl2ZWQgQ29tbWFuZCB0byBjaGFuZ2Ugb2tjIG1vZGUgPSAlZCIsIF9fZnVuY19fLCBva2NNb2RlKTsKKworICAgICAgICAgICBwSGRkQ3R4LT5jZmdfaW5pLT5pc09rY0luaUZlYXR1cmVFbmFibGVkID0gb2tjTW9kZTsKKyAgICAgICB9CisjZW5kaWYgIC8qIEZFQVRVUkVfV0xBTl9PS0MgKi8KKyAgICAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJHRVRST0FNU0NBTkNPTlRST0wiLCAxOCkgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIHRBTklfQk9PTEVBTiByb2FtU2NhbkNvbnRyb2wgPSBzbWVfR2V0Um9hbVNjYW5Db250cm9sKCh0SGFsSGFuZGxlKShwSGRkQ3R4LT5oSGFsKSk7CisgICAgICAgICAgIGNoYXIgZXh0cmFbMzJdOworICAgICAgICAgICB0QU5JX1U4IGxlbiA9IDA7CisKKyAgICAgICAgICAgbGVuID0gc2NucHJpbnRmKGV4dHJhLCBzaXplb2YoZXh0cmEpLCAiJXMgJWQiLAorICAgICAgICAgICAgICAgICAgIGNvbW1hbmQsIHJvYW1TY2FuQ29udHJvbCk7CisgICAgICAgICAgIGxlbiA9IFZPU19NSU4ocHJpdl9kYXRhLnRvdGFsX2xlbiwgbGVuICsgMSk7CisgICAgICAgICAgIGlmIChjb3B5X3RvX3VzZXIocHJpdl9kYXRhLmJ1ZiwgJmV4dHJhLCBsZW4pKSB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IGZhaWxlZCB0byBjb3B5IGRhdGEgdG8gdXNlciBidWZmZXIiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICByZXQgPSAtRUZBVUxUOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisgICAgICAgfQorI2lmZGVmIFdMQU5fRkVBVFVSRV9QQUNLRVRfRklMVEVSSU5HCisgICAgICAgZWxzZSBpZiAoc3RybmNtcChjb21tYW5kLCAiRU5BQkxFX1BLVEZJTFRFUl9JUFY2IiwgMjEpID09IDApCisgICAgICAgeworICAgICAgICAgICB0QU5JX1U4IGZpbHRlclR5cGUgPSAwOworICAgICAgICAgICB0QU5JX1U4ICp2YWx1ZSA9IGNvbW1hbmQ7CisKKyAgICAgICAgICAgLyogTW92ZSBwb2ludGVyIHRvIGFoZWFkIG9mIEVOQUJMRV9QS1RGSUxURVJfSVBWNjxkZWxpbWl0ZXI+ICovCisgICAgICAgICAgIHZhbHVlID0gdmFsdWUgKyAyMjsKKworICAgICAgICAgICAvKiBDb252ZXJ0IHRoZSB2YWx1ZSBmcm9tIGFzY2lpIHRvIGludGVnZXIgKi8KKyAgICAgICAgICAgcmV0ID0ga3N0cnRvdTgodmFsdWUsIDEwLCAmZmlsdGVyVHlwZSk7CisgICAgICAgICAgIGlmIChyZXQgPCAwKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvKiBJZiB0aGUgaW5wdXQgdmFsdWUgaXMgZ3JlYXRlciB0aGFuIG1heCB2YWx1ZSBvZiBkYXRhdHlwZSwKKyAgICAgICAgICAgICAgICAqIHRoZW4gYWxzbyBrc3RydG91OCBmYWlscworICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBrc3RydG91OCBmYWlsZWQgcmFuZ2UgIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorCisgICAgICAgICAgIGlmIChmaWx0ZXJUeXBlICE9IDAgJiYgZmlsdGVyVHlwZSAhPSAxKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBBY2NlcHRlZCBWYWx1ZXMgYXJlIDAgYW5kIDEgIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorICAgICAgICAgICB3bGFuX2hkZF9zZXRJUHY2RmlsdGVyKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpLCBmaWx0ZXJUeXBlLAorICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQpOworICAgICAgIH0KKyNlbmRpZgorICAgICAgIGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIkJUQ09FWE1PREUiLCAxMCkgPT0gMCApCisgICAgICAgeworICAgICAgICAgICBjaGFyICpkaGNwUGhhc2U7CisgICAgICAgICAgIGludCByZXQ7CisKKyAgICAgICAgICAgZGhjcFBoYXNlID0gY29tbWFuZCArIDExOworICAgICAgICAgICBpZiAoJzEnID09ICpkaGNwUGhhc2UpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJzZW5kIERIQ1AgU1RBUlQgaW5kaWNhdGlvbiIpKTsKKworICAgICAgICAgICAgICAgcEhkZEN0eC0+YnRDb2V4TW9kZVNldCA9IFRSVUU7CisKKyAgICAgICAgICAgICAgIHJldCA9IHdsYW5faGRkX3NjYW5fYWJvcnQocEFkYXB0ZXIpOworICAgICAgICAgICAgICAgaWYgKHJldCA8IDApCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgRkwoImZhaWxlZCB0byBhYm9ydCBleGlzdGluZyBzY2FuICVkIiksIHJldCk7CisgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgIHNtZV9ESENQU3RhcnRJbmQocEhkZEN0eC0+aEhhbCwgcEFkYXB0ZXItPmRldmljZV9tb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkKTsKKyAgICAgICAgICAgfQorICAgICAgICAgICBlbHNlIGlmICgnMicgPT0gKmRoY3BQaGFzZSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgRkwoInNlbmQgREhDUCBTVE9QIGluZGljYXRpb24iKSk7CisKKyAgICAgICAgICAgICAgIHBIZGRDdHgtPmJ0Q29leE1vZGVTZXQgPSBGQUxTRTsKKworICAgICAgICAgICAgICAgc21lX0RIQ1BTdG9wSW5kKHBIZGRDdHgtPmhIYWwsIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkKTsKKyAgICAgICAgICAgfQorICAgICAgIH0KKyAgICAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJTQ0FOLUFDVElWRSIsIDExKSA9PSAwKQorICAgICAgIHsKKyAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIm1ha2luZyBkZWZhdWx0IHNjYW4gdG8gQUNUSVZFIikpOworICAgICAgICAgICBwSGRkQ3R4LT5zY2FuX2luZm8uc2Nhbl9tb2RlID0gZVNJUl9BQ1RJVkVfU0NBTjsKKyAgICAgICB9CisgICAgICAgZWxzZSBpZiAoc3RybmNtcChjb21tYW5kLCAiU0NBTi1QQVNTSVZFIiwgMTIpID09IDApCisgICAgICAgeworICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgibWFraW5nIGRlZmF1bHQgc2NhbiB0byBQQVNTSVZFIikpOworICAgICAgICAgICBwSGRkQ3R4LT5zY2FuX2luZm8uc2Nhbl9tb2RlID0gZVNJUl9QQVNTSVZFX1NDQU47CisgICAgICAgfQorICAgICAgIGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIkdFVERXRUxMVElNRSIsIDEyKSA9PSAwKQorICAgICAgIHsKKyAgICAgICAgICAgaGRkX2NvbmZpZ190ICpwQ2ZnID0gKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+Y2ZnX2luaTsKKyAgICAgICAgICAgY2hhciBleHRyYVszMl07CisgICAgICAgICAgIHRBTklfVTggbGVuID0gMDsKKworICAgICAgICAgICBtZW1zZXQoZXh0cmEsIDAsIHNpemVvZihleHRyYSkpOworICAgICAgICAgICByZXQgPSBoZGRfZ2V0X2R3ZWxsX3RpbWUocENmZywgY29tbWFuZCwgZXh0cmEsIHNpemVvZihleHRyYSksICZsZW4pOworICAgICAgICAgICBsZW4gPSBWT1NfTUlOKHByaXZfZGF0YS50b3RhbF9sZW4sIGxlbiArIDEpOworICAgICAgICAgICBpZiAocmV0ICE9IDAgfHwgY29weV90b191c2VyKHByaXZfZGF0YS5idWYsICZleHRyYSwgbGVuICsgMSkpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogZmFpbGVkIHRvIGNvcHkgZGF0YSB0byB1c2VyIGJ1ZmZlciIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FRkFVTFQ7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgcmV0ID0gbGVuOworICAgICAgIH0KKyAgICAgICBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJTRVREV0VMTFRJTUUiLCAxMikgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIHJldCA9IGhkZF9zZXRfZHdlbGxfdGltZShwQWRhcHRlciwgY29tbWFuZCk7CisgICAgICAgfQorICAgICAgIGVsc2UgaWYgKCBzdHJuY2FzZWNtcChjb21tYW5kLCAiTUlSQUNBU1QiLCA4KSA9PSAwICkKKyAgICAgICB7CisgICAgICAgICAgIHRBTklfVTggZmlsdGVyVHlwZSA9IDA7CisgICAgICAgICAgIHRBTklfVTggKnZhbHVlOworICAgICAgICAgICB2YWx1ZSA9IGNvbW1hbmQgKyA5OworCisgICAgICAgICAgIC8qIENvbnZlcnQgdGhlIHZhbHVlIGZyb20gYXNjaWkgdG8gaW50ZWdlciAqLworICAgICAgICAgICByZXQgPSBrc3RydG91OCh2YWx1ZSwgMTAsICZmaWx0ZXJUeXBlKTsKKyAgICAgICAgICAgaWYgKHJldCA8IDApCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8qIElmIHRoZSBpbnB1dCB2YWx1ZSBpcyBncmVhdGVyIHRoYW4gbWF4IHZhbHVlIG9mIGRhdGF0eXBlLAorICAgICAgICAgICAgICAgICogdGhlbiBhbHNvIGtzdHJ0b3U4IGZhaWxzCisgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBrc3RydG91OCBmYWlsZWQgcmFuZ2UgIiwgX19mdW5jX18pOworICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgaWYgKChmaWx0ZXJUeXBlIDwgV0xBTl9IRERfRFJJVkVSX01JUkFDQVNUX0NGR19NSU5fVkFMICkgfHwKKyAgICAgICAgICAgICAgIChmaWx0ZXJUeXBlID4gV0xBTl9IRERfRFJJVkVSX01JUkFDQVNUX0NGR19NQVhfVkFMKSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICIlczogQWNjZXB0ZWQgVmFsdWVzIGFyZSAwIHRvIDIuIDAtRGlzYWJsZWQsIDEtU291cmNlLCIKKyAgICAgICAgICAgICAgICAgICAgICAiIDItU2luayAiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisgICAgICAgICAgIC8vRmlsdGVydHlwZSB2YWx1ZSBzaG91bGQgYmUgZWl0aGVyIDAtRGlzYWJsZWQsIDEtU291cmNlLCAyLXNpbmsKKyAgICAgICAgICAgcEhkZEN0eC0+ZHJ2cl9taXJhY2FzdCA9IGZpbHRlclR5cGU7CisgICAgICAgICAgIHBTY2FuSW5mbyA9ICAmcEhkZEN0eC0+c2Nhbl9pbmZvOworICAgICAgICAgICBpZiAoZmlsdGVyVHlwZSAmJiBwU2NhbkluZm8gIT0gTlVMTCAmJgorICAgICAgICAgICAgICAgcEhkZEN0eC0+c2Nhbl9pbmZvLm1TY2FuUGVuZGluZykKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAvKk1pcmFjYXN0IFNlc3Npb24gc3RhcnRlZC4gQWJvcnQgU2NhbiAqLworICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgIiVzLCBBYm9ydGluZyBTY2FuIEZvciBNaXJhY2FzdCIsX19mdW5jX18pOworICAgICAgICAgICAgICBoZGRfYWJvcnRfbWFjX3NjYW4ocEhkZEN0eCwgcFNjYW5JbmZvLT5zZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1NDQU5fQUJPUlRfREVGQVVMVCk7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgaGRkX3R4X3J4X3BrdF9jbnRfc3RhdF90aW1lcl9oYW5kbGVyKHBIZGRDdHgpOworICAgICAgICAgICBzbWVfU2V0TWlyYWNhc3RNb2RlKHBIZGRDdHgtPmhIYWwsIHBIZGRDdHgtPmRydnJfbWlyYWNhc3QpOworICAgICAgICB9CisgICAgICAgZWxzZSBpZiAoc3RybmNtcChjb21tYW5kLCAiU0VUTUNSQVRFIiwgOSkgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIHRBTklfVTggKnZhbHVlID0gY29tbWFuZDsKKyAgICAgICAgICAgaW50ICAgICAgdGFyZ2V0UmF0ZTsKKyAgICAgICAgICAgdFNpclJhdGVVcGRhdGVJbmQgKnJhdGVVcGRhdGU7CisgICAgICAgICAgIGVIYWxTdGF0dXMgc3RhdHVzOworCisgICAgICAgICAgIC8qIE9ubHkgdmFsaWQgZm9yIFNBUCBtb2RlICovCisgICAgICAgICAgIGlmIChXTEFOX0hERF9TT0ZUQVAgIT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogU0FQIG1vZGUgaXMgbm90IHJ1bm5pbmciLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICByZXQgPSAtRUZBVUxUOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICAgICAgLyogTW92ZSBwb2ludGVyIHRvIGFoZWFkIG9mIFNFVE1DUkFURTxkZWxpbWl0ZXI+ICovCisgICAgICAgICAgIC8qIGlucHV0IHZhbHVlIGlzIGluIHVuaXRzIG9mIGh1bmRyZWQga2JwcyAqLworICAgICAgICAgICB2YWx1ZSA9IHZhbHVlICsgMTA7CisgICAgICAgICAgIC8qIENvbnZlcnQgdGhlIHZhbHVlIGZyb20gYXNjaWkgdG8gaW50ZWdlciwgZGVjaW1hbCBiYXNlICovCisgICAgICAgICAgIHJldCA9IGtzdHJ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bm5lbHMgPSAwOworICAgICAgICAgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisKKyAgICAgICAgICAgc3RhdHVzID0gaGRkX3BhcnNlX2NoYW5uZWxsaXN0KHZhbHVlLCBDaGFubmVsTGlzdCwgJm51bUNoYW5uZWxzKTsKKyAgICAgICAgICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gc3RhdHVzKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEZhaWxlZCB0byBwYXJzZSBjaGFubmVsIGxpc3QgaW5mb3JtYXRpb24iLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICAgICAgaWYgKG51bUNoYW5uZWxzID4gV05JX0NGR19WQUxJRF9DSEFOTkVMX0xJU1RfTEVOKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IG51bWJlciBvZiBjaGFubmVscyAoJWQpIHN1cHBvcnRlZCBleGNlZWRlZCBtYXggKCVkKSIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgIG51bUNoYW5uZWxzLCBXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU4pOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorICAgICAgICAgICBzdGF0dXMgPSBzbWVfU2V0RXNlUm9hbVNjYW5DaGFubmVsTGlzdCgodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1DaGFubmVscyk7CisgICAgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBGYWlsZWQgdG8gdXBkYXRlIGNoYW5uZWwgbGlzdCBpbmZvcm1hdGlvbiIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKyAgICAgICB9CisgICAgICAgZWxzZSBpZiAoc3RybmNtcChjb21tYW5kLCAiR0VUVFNNU1RBVFMiLCAxMSkgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIHRBTklfVTggICAgICAgICAgICAqdmFsdWUgPSBjb21tYW5kOworICAgICAgICAgICBjaGFyICAgICAgICAgICAgICAgIGV4dHJhWzEyOF0gPSB7MH07CisgICAgICAgICAgIGludCAgICAgICAgICAgICAgICAgbGVuID0gMDsKKyAgICAgICAgICAgdEFOSV9VOCAgICAgICAgICAgICB0aWQgPSAwOworICAgICAgICAgICBoZGRfc3RhdGlvbl9jdHhfdCAgKnBIZGRTdGFDdHggPSBOVUxMOworICAgICAgICAgICB0QW5pVHJhZlN0cm1NZXRyaWNzIHRzbU1ldHJpY3M7CisgICAgICAgICAgIHBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKworICAgICAgICAgICAvKiBpZiBub3QgYXNzb2NpYXRlZCwgcmV0dXJuIGVycm9yICovCisgICAgICAgICAgIGlmIChlQ29ubmVjdGlvblN0YXRlX0Fzc29jaWF0ZWQgIT0gcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmNvbm5TdGF0ZSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczpOb3QgYXNzb2NpYXRlZCEiLF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKworICAgICAgICAgICAvKiBNb3ZlIHBvaW50ZXIgdG8gYWhlYWQgb2YgR0VUVFNNU1RBVFM8ZGVsaW1pdGVyPiAqLworICAgICAgICAgICB2YWx1ZSA9IHZhbHVlICsgMTI7CisgICAgICAgICAgIC8qIENvbnZlcnQgdGhlIHZhbHVlIGZyb20gYXNjaWkgdG8gaW50ZWdlciAqLworICAgICAgICAgICByZXQgPSBrc3RydG91OCh2YWx1ZSwgMTAsICZ0aWQpOworICAgICAgICAgICBpZiAocmV0IDwgMCkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgLyogSWYgdGhlIGlucHV0IHZhbHVlIGlzIGdyZWF0ZXIgdGhhbiBtYXggdmFsdWUgb2YgZGF0YXR5cGUsIHRoZW4gYWxzbworICAgICAgICAgICAgICAgICAga3N0cnRvdTggZmFpbHMgKi8KKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IGtzdHJ0b3U4IGZhaWxlZCByYW5nZSBbJWQgLSAlZF0iLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgICBUSURfTUlOX1ZBTFVFLAorICAgICAgICAgICAgICAgICAgICAgIFRJRF9NQVhfVkFMVUUpOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorCisgICAgICAgICAgIGlmICgodGlkIDwgVElEX01JTl9WQUxVRSkgfHwgKHRpZCA+IFRJRF9NQVhfVkFMVUUpKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgInRpZCB2YWx1ZSAlZCBpcyBvdXQgb2YgcmFuZ2UiCisgICAgICAgICAgICAgICAgICAgICAgIiAoTWluOiAlZCBNYXg6ICVkKSIsIHRpZCwKKyAgICAgICAgICAgICAgICAgICAgICBUSURfTUlOX1ZBTFVFLAorICAgICAgICAgICAgICAgICAgICAgIFRJRF9NQVhfVkFMVUUpOworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorCisgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICIlczogUmVjZWl2ZWQgQ29tbWFuZCB0byBnZXQgdHNtIHN0YXRzIHRpZCA9ICVkIiwgX19mdW5jX18sIHRpZCk7CisKKyAgICAgICAgICAgaWYgKFZPU19TVEFUVVNfU1VDQ0VTUyAhPSBoZGRfZ2V0X3RzbV9zdGF0cyhwQWRhcHRlciwgdGlkLCAmdHNtTWV0cmljcykpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogZmFpbGVkIHRvIGdldCB0c20gc3RhdHMiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICByZXQgPSAtRUZBVUxUOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICJVcGxpbmtQa3RRdWV1ZURseSglZClcbiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIlVwbGlua1BrdFF1ZXVlRGx5SGlzdFswXSglZClcbiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIlVwbGlua1BrdFF1ZXVlRGx5SGlzdFsxXSglZClcbiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIlVwbGlua1BrdFF1ZXVlRGx5SGlzdFsyXSglZClcbiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIlVwbGlua1BrdFF1ZXVlRGx5SGlzdFszXSglZClcbiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIlVwbGlua1BrdFR4RGx5KCV1KVxuIgorICAgICAgICAgICAgICAgICAgICAgICAgICAiVXBsaW5rUGt0TG9zcyglZClcbiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIlVwbGlua1BrdENvdW50KCVkKVxuIgorICAgICAgICAgICAgICAgICAgICAgICAgICAiUm9hbWluZ0NvdW50KCVkKVxuIgorICAgICAgICAgICAgICAgICAgICAgICAgICAiUm9hbWluZ0RseSglZCkiLCB0c21NZXRyaWNzLlVwbGlua1BrdFF1ZXVlRGx5LAorICAgICAgICAgICAgICAgICAgICAgICAgICB0c21NZXRyaWNzLlVwbGlua1BrdFF1ZXVlRGx5SGlzdFswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdHNtTWV0cmljcy5VcGxpbmtQa3RRdWV1ZURseUhpc3RbMV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRzbU1ldHJpY3MuVXBsaW5rUGt0UXVldWVEbHlIaXN0WzJdLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0c21NZXRyaWNzLlVwbGlua1BrdFF1ZXVlRGx5SGlzdFszXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdHNtTWV0cmljcy5VcGxpbmtQa3RUeERseSwgdHNtTWV0cmljcy5VcGxpbmtQa3RMb3NzLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0c21NZXRyaWNzLlVwbGlua1BrdENvdW50LCB0c21NZXRyaWNzLlJvYW1pbmdDb3VudCwgdHNtTWV0cmljcy5Sb2FtaW5nRGx5KTsKKworICAgICAgICAgICAvKiBPdXRwdXQgVFNNIHN0YXRzIGlzIG9mIHRoZSBmb3JtYXQKKyAgICAgICAgICAgICAgICAgICBHRVRUU01TVEFUUyBbUGt0UXVldWVEbHldIFtQa3RRdWV1ZURseUhpc3RbMF1dOltQa3RRdWV1ZURseUhpc3RbMV1dIC4uLltSb2FtaW5nRGx5XQorICAgICAgICAgICAgICAgICAgIGVnLiwgR0VUVFNNU1RBVFMgMTAgMTowOjA6MTYxIDIwIDEgMTcgOCAzOTgwMCAqLworICAgICAgICAgICBsZW4gPSBzY25wcmludGYoZXh0cmEsIHNpemVvZihleHRyYSksICIlcyAlZCAlZDolZDolZDolZCAldSAlZCAlZCAlZCAlZCIsIGNvbW1hbmQsCisgICAgICAgICAgICAgICAgICB0c21NZXRyaWNzLlVwbGlua1BrdFF1ZXVlRGx5LCB0c21NZXRyaWNzLlVwbGlua1BrdFF1ZXVlRGx5SGlzdFswXSwKKyAgICAgICAgICAgICAgICAgIHRzbU1ldHJpY3MuVXBsaW5rUGt0UXVldWVEbHlIaXN0WzFdLCB0c21NZXRyaWNzLlVwbGlua1BrdFF1ZXVlRGx5SGlzdFsyXSwKKyAgICAgICAgICAgICAgICAgIHRzbU1ldHJpY3MuVXBsaW5rUGt0UXVldWVEbHlIaXN0WzNdLCB0c21NZXRyaWNzLlVwbGlua1BrdFR4RGx5LAorICAgICAgICAgICAgICAgICAgdHNtTWV0cmljcy5VcGxpbmtQa3RMb3NzLCB0c21NZXRyaWNzLlVwbGlua1BrdENvdW50LCB0c21NZXRyaWNzLlJvYW1pbmdDb3VudCwKKyAgICAgICAgICAgICAgICAgIHRzbU1ldHJpY3MuUm9hbWluZ0RseSk7CisKKyAgICAgICAgICAgbGVuID0gVk9TX01JTihwcml2X2RhdGEudG90YWxfbGVuLCBsZW4gKyAxKTsKKyAgICAgICAgICAgaWYgKGNvcHlfdG9fdXNlcihwcml2X2RhdGEuYnVmLCAmZXh0cmEsIGxlbikpIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogZmFpbGVkIHRvIGNvcHkgZGF0YSB0byB1c2VyIGJ1ZmZlciIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FRkFVTFQ7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKyAgICAgICB9CisgICAgICAgZWxzZSBpZiAoc3RybmNtcChjb21tYW5kLCAiU0VUQ0NLTUlFIiwgOSkgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIHRBTklfVTggKnZhbHVlID0gY29tbWFuZDsKKyAgICAgICAgICAgdEFOSV9VOCAqY2NrbUllID0gTlVMTDsKKyAgICAgICAgICAgdEFOSV9VOCBjY2ttSWVMZW4gPSAwOworICAgICAgICAgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisKKyAgICAgICAgICAgc3RhdHVzID0gaGRkX3BhcnNlX2dldF9jY2ttX2llKHZhbHVlLCAmY2NrbUllLCAmY2NrbUllTGVuKTsKKyAgICAgICAgICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gc3RhdHVzKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEZhaWxlZCB0byBwYXJzZSBjY2ttIGllIGRhdGEiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICAgICAgaWYgKGNja21JZUxlbiA+IERPVDExRl9JRV9SU05fTUFYX0xFTikKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBDQ0tNIEllIGlucHV0IGxlbmd0aCBpcyBtb3JlIHRoYW4gbWF4WyVkXSIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgRE9UMTFGX0lFX1JTTl9NQVhfTEVOKTsKKyAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShjY2ttSWUpOworICAgICAgICAgICAgICAgY2NrbUllID0gTlVMTDsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgc21lX1NldENDS01JZSgodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCksIHBBZGFwdGVyLT5zZXNzaW9uSWQsIGNja21JZSwgY2NrbUllTGVuKTsKKyAgICAgICAgICAgdm9zX21lbV9mcmVlKGNja21JZSk7CisgICAgICAgICAgIGNja21JZSA9IE5VTEw7CisgICAgICAgfQorICAgICAgIGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIkNDWEJFQUNPTlJFUSIsIDEyKSA9PSAwKQorICAgICAgIHsKKyAgICAgICAgICAgdEFOSV9VOCAqdmFsdWUgPSBjb21tYW5kOworICAgICAgICAgICB0Q3NyRXNlQmVhY29uUmVxIGVzZUJjblJlcTsKKyAgICAgICAgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworCisgICAgICAgICAgIHN0YXR1cyA9IGhkZF9wYXJzZV9lc2VfYmVhY29uX3JlcSh2YWx1ZSwgJmVzZUJjblJlcSk7CisgICAgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBGYWlsZWQgdG8gcGFyc2UgZXNlIGJlYWNvbiByZXEiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisgICAgICAgICAgIGlmICghaGRkX2Nvbm5Jc0Nvbm5lY3RlZChXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKSkpIHsKKyAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgRkwoIk5vdCBhc3NvY2lhdGVkIikpOworICAgICAgICAgICAgICAgaGRkX2luZGljYXRlRXNlQmNuUmVwb3J0Tm9SZXN1bHRzIChwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNlQmNuUmVxLmJjblJlcVswXS5tZWFzdXJlbWVudFRva2VuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAyLCAgLy9CSVQoMSkgc2V0IGZvciBtZWFzdXJlbWVudCBkb25lCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApOyAgICAvLyBubyBCU1MKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorCisgICAgICAgICAgIHN0YXR1cyA9IHNtZ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ICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICBGTCgiR0VUQkNOTUlTU1JBVEU6IFNUQSBpcyBub3QgaW4gY29ubmVjdGVkIHN0YXRlIikpOworICAgICAgICAgICAgICAgcmV0ID0gLTE7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKworICAgICAgICAgICBpbml0X2NvbXBsZXRpb24oJihnZXRCY25NaXNzUmF0ZUN0eC5jb21wbGV0aW9uKSk7CisgICAgICAgICAgIGdldEJjbk1pc3NSYXRlQ3R4Lm1hZ2ljID0gQkNOX01JU1NfUkFURV9DT05URVhUX01BR0lDOworCisgICAgICAgICAgIHN0YXR1cyA9IHNtZV9nZXRCY25NaXNzUmF0ZSgodEhhbEhhbmRsZSkocEhkZEN0eC0+aEhhbCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilnZXRCY25NaXNzUmF0ZUNCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKikoJmdldEJjbk1pc3NSYXRlQ3R4KSk7CisgICAgICAgICAgIGlmKCBlSEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICBGTCgiR0VUQkNOTUlTU1JBVEU6IGZhaWwgdG8gcG9zdCBXREEgY21kIikpOworICAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICAgICAgd2FpdFJldCA9IHdhaXRfZm9yX2NvbXBsZXRpb25faW50ZXJydXB0aWJsZV90aW1lb3V0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAoJmdldEJjbk1pc3NSYXRlQ3R4LmNvbXBsZXRpb24sIEJDTl9NSVNTX1JBVEVfVElNRSk7CisgICAgICAgICAgIGlmKHdhaXRSZXQgPD0gMCkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiZmFpbGVkIHRvIHdhaXQgb24gYmNuTWlzc1JhdGVDb21wICVkIiksIHJldCk7CisKKyAgICAgICAgICAgICAgIC8vTWFrZSBtYWdpYyBudW1iZXIgdG8gemVybyBzbyB0aGF0IGNhbGxiYWNrIGlzIG5vdCBjYWxsZWQuCisgICAgICAgICAgICAgICBzcGluX2xvY2soJmhkZF9jb250ZXh0X2xvY2spOworICAgICAgICAgICAgICAgZ2V0QmNuTWlzc1JhdGVDdHgubWFnaWMgPSAweDA7CisgICAgICAgICAgICAgICBzcGluX3VubG9jaygmaGRkX2NvbnRleHRfbG9jayk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgRkwoIkdFVEJDTk1JU1NSQVRFOiBiY25NaXNzUmF0ZTogJWQiKSwgZ2Jjbk1pc3NSYXRlKTsKKworICAgICAgICAgICBsZW4gPSBzbnByaW50ZihidWYsIHNpemVvZihidWYpLCAiR0VUQkNOTUlTU1JBVEUgJWQiLCBnYmNuTWlzc1JhdGUpOworICAgICAgICAgICBpZiAoY29weV90b191c2VyKHByaXZfZGF0YS5idWYsICZidWYsIGxlbiArIDEpKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgIiVzOiBmYWlsZWQgdG8gY29weSBkYXRhIHRvIHVzZXIgYnVmZmVyIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgcmV0ID0gLUVGQVVMVDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorICAgICAgICAgICByZXQgPSBsZW47CisgICAgICAgfQorI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgICAgICAgZWxzZSBpZiAoc3RybmNtcChjb21tYW5kLCAiVERMU1NFQ09OREFSWUNIQU5ORUxPRkZTRVQiLCAyNikgPT0gMCkgeworICAgICAgICAgICB0QU5JX1U4ICp2YWx1ZSA9IGNvbW1hbmQ7CisgICAgICAgICAgIGludCBzZXRfdmFsdWU7CisgICAgICAgICAgIC8qIE1vdmUgcG9pbnRlciB0byBhaGVhZCBvZiBURExTT0ZGQ0gqLworICAgICAgICAgICB2YWx1ZSArPSAyNjsKKyAgICAgICAgICAgaWYgKCEoc3NjYW5mKHZhbHVlLCAiJWQiLCAmc2V0X3ZhbHVlKSkpIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIk5vIGlucHV0IGlkZW50aWZpZWQiKSk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICIlczogVGRscyBvZmZjaGFubmVsIG9mZnNldDolZCIsCisgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgc2V0X3ZhbHVlKTsKKyAgICAgICAgICAgcmV0ID0gaXdfc2V0X3RkbHNzZWNvZmZjaGFubmVsb2Zmc2V0KHBIZGRDdHgsIHNldF92YWx1ZSk7CisgICAgICAgICAgIGlmIChyZXQgPCAwKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICB9IGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIlRETFNPRkZDSEFOTkVMTU9ERSIsIDE4KSA9PSAwKSB7CisgICAgICAgICAgIHRBTklfVTggKnZhbHVlID0gY29tbWFuZDsKKyAgICAgICAgICAgaW50IHNldF92YWx1ZTsKKyAgICAgICAgICAgLyogTW92ZSBwb2ludGVyIHRvIGFoZWFkIG9mIHRkbHNvZmZjaG5tb2RlKi8KKyAgICAgICAgICAgdmFsdWUgKz0gMTg7CisgICAgICAgICAgIHJldCA9IHNzY2FuZih2YWx1ZSwgIiVkIiwgJnNldF92YWx1ZSk7CisgICAgICAgICAgIGlmIChyZXQgIT0gMSkgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiTm8gaW5wdXQgaWRlbnRpZmllZCIpKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICIlczogVGRscyBvZmZjaGFubmVsIG1vZGU6JWQiLAorICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHNldF92YWx1ZSk7CisgICAgICAgICAgIHJldCA9IGl3X3NldF90ZGxzb2ZmY2hhbm5lbG1vZGUocEFkYXB0ZXIsIHNldF92YWx1ZSk7CisgICAgICAgICAgIGlmIChyZXQgPCAwKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisgICAgICAgfSBlbHNlIGlmIChzdHJuY21wKGNvbW1hbmQsICJURExTT0ZGQ0hBTk5FTCIsIDE0KSA9PSAwKSB7CisgICAgICAgICAgIHRBTklfVTggKnZhbHVlID0gY29tbWFuZDsKKyAgICAgICAgICAgaW50IHNldF92YWx1ZTsKKyAgICAgICAgICAgLyogTW92ZSBwb2ludGVyIHRvIGFoZWFkIG9mIFRETFNPRkZDSCovCisgICAgICAgICAgIHZhbHVlICs9IDE0OworICAgICAgICAgICByZXQgPSBzc2NhbmYodmFsdWUsICIlZCIsICZzZXRfdmFsdWUpOworICAgICAgICAgICBpZiAocmV0ICE9IDEpIHsKKyAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAiV3JvbmcgdmFsdWUgaXMgZ2l2ZW4gZm9yIGhkZF9zZXRfdGRsc19vZmZjaGFubmVsIik7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisKKyAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICIlczogVGRscyBvZmZjaGFubmVsIG51bTogJWQiLAorICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHNldF92YWx1ZSk7CisgICAgICAgICAgIHJldCA9IGl3X3NldF90ZGxzb2ZmY2hhbm5lbChwSGRkQ3R4LCBzZXRfdmFsdWUpOworICAgICAgICAgICBpZiAocmV0IDwgMCkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgfQorICAgICAgIH0KKyNlbmRpZgorICAgICAgIGVsc2UgaWYgKHN0cm5jbXAoY29tbWFuZCwgIkdFVEZXU1RBVFMiLCAxMCkgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIGVIYWxTdGF0dXMgc3RhdHVzOworICAgICAgICAgICBjaGFyICpidWYgPSBOVUxMOworICAgICAgICAgICBjaGFyIGxlbjsKKyAgICAgICAgICAgbG9uZyB3YWl0UmV0OworICAgICAgICAgICBmd1N0YXRzQ29udGV4dF90IGZ3U3RhdHNDdHg7CisgICAgICAgICAgIHRTaXJGd1N0YXRzUmVzdWx0ICpmd1N0YXRzUnNwID0gJihwQWRhcHRlci0+ZndTdGF0c1JzcCk7CisgICAgICAgICAgIHRBTklfVTggKnB0ciA9IGNvbW1hbmQ7CisgICAgICAgICAgIGludCBzdGF0cyA9ICoocHRyICsgMTEpIC0gJzAnOworCisgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgRkwoInN0YXRzID0gJWQgIiksc3RhdHMpOworICAgICAgICAgICBpZiAoIUlTX0ZFQVRVUkVfRldfU1RBVFNfRU5BQkxFKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICBGTCgiR2V0IEZpcm13YXJlIHN0YXRzIGZlYXR1cmUgbm90IHN1cHBvcnRlZCIpKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKworICAgICAgICAgICBpZiAoRldfU1RBVFNfTUFYIDw9IHN0YXRzIHx8IDAgPj0gc3RhdHMpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgIEZMKCIgc3RhdHMgJWQgbm90IHN1cHBvcnRlZCIpLHN0YXRzKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKworICAgICAgICAgICBpbml0X2NvbXBsZXRpb24oJihmd1N0YXRzQ3R4LmNvbXBsZXRpb24pKTsKKyAgICAgICAgICAgZndTdGF0c0N0eC5tYWdpYyA9IEZXX1NUQVRTX0NPTlRFWFRfTUFHSUM7CisgICAgICAgICAgIGZ3U3RhdHNDdHgucEFkYXB0ZXIgPSBwQWRhcHRlcjsKKyAgICAgICAgICAgZndTdGF0c1JzcC0+dHlwZSA9IDA7CisgICAgICAgICAgIHN0YXR1cyA9IHNtZV9HZXRGd1N0YXRzKCAodEhhbEhhbmRsZSlwSGRkQ3R4LT5oSGFsLCBzdGF0cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmZ3U3RhdHNDdHgsIGhkZF9GV1N0YXRpc0NCKTsKKyAgICAgICAgICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gc3RhdHVzKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICBGTCgiIGZhaWwgdG8gcG9zdCBXREEgY21kIHN0YXR1cyA9ICVkIiksIHN0YXR1cyk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisgICAgICAgICAgIHdhaXRSZXQgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX3RpbWVvdXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCYoZndTdGF0c0N0eC5jb21wbGV0aW9uKSwgRldfU1RBVEVfV0FJVF9USU1FKTsKKyAgICAgICAgICAgaWYgKHdhaXRSZXQgPD0gMCkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJmYWlsZWQgdG8gd2FpdCBvbiBHd3RGd3N0YXRzIikpOworICAgICAgICAgICAgICAgLy9NYWtlIG1hZ2ljIG51bWJlciB0byB6ZXJvIHNvIHRoYXQgY2FsbGJhY2sgaXMgbm90IGV4ZWN1dGVkLgorICAgICAgICAgICAgICAgc3Bpbl9sb2NrKCZoZGRfY29udGV4dF9sb2NrKTsKKyAgICAgICAgICAgICAgIGZ3U3RhdHNDdHgubWFnaWMgPSAweDA7CisgICAgICAgICAgICAgICBzcGluX3VubG9jaygmaGRkX2NvbnRleHRfbG9jayk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICB9CisgICAgICAgICAgIGlmIChmd1N0YXRzUnNwLT50eXBlKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBidWYgPSBrbWFsbG9jKEZXX1NUQVRFX1JTUF9MRU4sIEdGUF9LRVJORUwpOworICAgICAgICAgICAgICAgaWYgKCFidWYpCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCIgZmFpbGVkIHRvIGFsbG9jYXRlIG1lbW9yeSIpKTsKKyAgICAgICAgICAgICAgICAgcmV0ID0gLUVOT01FTTsKKyAgICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgc3dpdGNoKCBmd1N0YXRzUnNwLT50eXBlICkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBjYXNlIEZXX1VCU1BfU1RBVFM6CisgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgbGVuID0gc25wcmludGYoYnVmLCBGV19TVEFURV9SU1BfTEVOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkdFVEZXU1RBVFM6IHVic3BfZW50ZXJfY250ICVkIHVic3BfanVtcF9kZHJfY250ICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ3U3RhdHNSc3AtPmZ3U3RhdHNEYXRhLnVic3BTdGF0cy51YnNwX2VudGVyX2NudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ3U3RhdHNSc3AtPmZ3U3RhdHNEYXRhLnVic3BTdGF0cy51YnNwX2p1bXBfZGRyX2NudCk7CisgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoICJObyBoYW5kbGluZyBmb3Igc3RhdHMgdHlwZSAlZCIpLGZ3U3RhdHNSc3AtPnR5cGUpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0ID0gLUVGQVVMVDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGtmcmVlKGJ1Zik7CisgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgaWYgKGNvcHlfdG9fdXNlcihwcml2X2RhdGEuYnVmLCBidWYsIGxlbiArIDEpKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgRkwoIiBmYWlsZWQgdG8gY29weSBkYXRhIHRvIHVzZXIgYnVmZmVyIikpOworICAgICAgICAgICAgICAgICAgIHJldCA9IC1FRkFVTFQ7CisgICAgICAgICAgICAgICAgICAga2ZyZWUoYnVmKTsKKyAgICAgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICByZXQgPSBsZW47CisgICAgICAgICAgICAgICBrZnJlZShidWYpOworICAgICAgICAgICB9CisgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICBGTCgiZmFpbGVkIHRvIGZldGNoIHRoZSBzdGF0cyIpKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FRkFVTFQ7CisgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgIH0KKworICAgICAgIH0KKyAgICAgICBlbHNlIGlmIChzdHJuY2FzZWNtcChjb21tYW5kLCAiU0VUX0ZDQ19DSEFOTkVMIiwgMTUpID09IDApCisgICAgICAgeworICAgICAgICAgIC8qCisgICAgICAgICAgICogdGhpcyBjb21tYW5kIHdsZCBiZSBjYWxsZWQgYnkgdXNlci1zcGFjZSB3aGVuIGl0IGRldGVjdHMgV0xBTgorICAgICAgICAgICAqIE9OIGFmdGVyIGFpcnBsYW5lIG1vZGUgaXMgc2V0LiBXaGVuIEFQTSBpcyBzZXQsIFdMQU4gdHVybnMgb2ZmLgorICAgICAgICAgICAqIEJ1dCBpdCBjYW4gYmUgdHVybmVkIGJhY2sgb24uIE90aGVyd2lzZTsgd2hlbiBBUE0gaXMgdHVybmVkIGJhY2sKKyAgICAgICAgICAgKiBvZmYsIFdMQU4gd2xkIHR1cm4gYmFjayBvbi4gU28gYXQgdGhhdCBwb2ludCB0aGUgY29tbWFuZCBpcworICAgICAgICAgICAqIGV4cGVjdGVkIHRvIGNvbWUgZG93bi4gMCBtZWFucyBkaXNhYmxlLCAxIG1lYW5zIGVuYWJsZS4gVGhlCisgICAgICAgICAgICogY29uc3RyYWludCBpcyByZW1vdmVkIHdoZW4gcGFyYW1ldGVyIDEgaXMgc2V0IG9yIGRpZmZlcmVudAorICAgICAgICAgICAqIGNvdW50cnkgY29kZSBpcyBzZXQKKyAgICAgICAgICAgKi8KKyAgICAgICAgICAgcmV0ID0gaGRkX2NtZF9zZXRGY2NDaGFubmVsKHBIZGRDdHgsIGNvbW1hbmQsIDE1KTsKKyAgICAgICB9CisgICAgICAgZWxzZSBpZiAoc3RybmNhc2VjbXAoY29tbWFuZCwgIkRJU0FCTEVfQ0FfRVZFTlQiLCAxNikgPT0gMCkKKyAgICAgICB7CisgICAgICAgICAgIHJldCA9IGhkZF9lbmFibGVfZGlzYWJsZV9jYV9ldmVudChwSGRkQ3R4LCBjb21tYW5kLCAxNik7CisgICAgICAgfQorICAgICAgIGVsc2UgeworICAgICAgICAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfSERELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfSEREX1VOU1VQUE9SVEVEX0lPQ1RMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsIDApKTsKKyAgICAgICAgICAgaGRkTG9nKCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwgRkwoIlVuc3VwcG9ydGVkIEdVSSBjb21tYW5kICVzIiksCisgICAgICAgICAgICAgICAgICAgY29tbWFuZCk7CisgICAgICAgfQorICAgfQorZXhpdDoKKyAgIEVYSVQoKTsKKyAgIGlmIChjb21tYW5kKQorICAgeworICAgICAgIGtmcmVlKGNvbW1hbmQpOworICAgfQorICAgcmV0dXJuIHJldDsKK30KKworI2lmZGVmIENPTkZJR19DT01QQVQKK3N0YXRpYyBpbnQgaGRkX2RyaXZlcl9jb21wYXRfaW9jdGwoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsIHN0cnVjdCBpZnJlcSAqaWZyKQoreworICAgc3RydWN0IHsKKyAgICAgIGNvbXBhdF91cHRyX3QgYnVmOworICAgICAgaW50IHVzZWRfbGVuOworICAgICAgaW50IHRvdGFsX2xlbjsKKyAgIH0gY29tcGF0X3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XB0ZXIsIHN0cnVjdCBpZnJlcSAqaWZyKQoreworICAgaGRkX3ByaXZfZGF0YV90IHByaXZfZGF0YTsKKyAgIGludCByZXQgPSAwOworCisgICAvKgorICAgICogTm90ZSB0aGF0IHBBZGFwdGVyIGFuZCBpZnIgaGF2ZSBhbHJlYWR5IGJlZW4gdmVyaWZpZWQgYnkgY2FsbGVyLAorICAgICogYW5kIEhERCBjb250ZXh0IGhhcyBhbHNvIGJlZW4gdmFsaWRhdGVkCisgICAgKi8KKyAgIGlmIChjb3B5X2Zyb21fdXNlcigmcHJpdl9kYXRhLCBpZnItPmlmcl9kYXRhLCBzaXplb2YocHJpdl9kYXRhKSkpIHsKKyAgICAgICByZXQgPSAtRUZBVUxUOworICAgfSBlbHNlIHsKKyAgICAgIHJldCA9IGhkZF9kcml2ZXJfY29tbWFuZChwQWRhcHRlciwgJnByaXZfZGF0YSk7CisgICB9CisgICByZXR1cm4gcmV0OworfQorCitpbnQgX19oZGRfaW9jdGwoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgc3RydWN0IGlmcmVxICppZnIsIGludCBjbWQpCit7CisgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcjsKKyAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICBpbnQgcmV0OworCisgICBFTlRFUigpOworCisgICBwQWRhcHRlciA9IFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgIiVzOiBIREQgYWRhcHRlciBjb250ZXh0IGlzIE51bGwiLCBfX2Z1bmNfXyk7CisgICAgICByZXQgPSAtRU5PREVWOworICAgICAgZ290byBleGl0OworICAgfQorICAgaWYgKGRldiAhPSBwQWRhcHRlci0+ZGV2KSB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICIlczogSEREIGFkYXB0ZXIvZGV2IGluY29uc2lzdGVuY3kiLCBfX2Z1bmNfXyk7CisgICAgICByZXQgPSAtRU5PREVWOworICAgICAgZ290byBleGl0OworICAgfQorCisgICBpZiAoKCFpZnIpIHx8ICghaWZyLT5pZnJfZGF0YSkpIHsKKyAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICBnb3RvIGV4aXQ7CisgICB9CisKKyAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgIHJldCA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICBpZiAocmV0KSB7CisgICAgICByZXQgPSAtRUJVU1k7CisgICAgICBnb3RvIGV4aXQ7CisgICB9CisKKyAgIHN3aXRjaCAoY21kKSB7CisgICBjYXNlIChTSU9DREVWUFJJVkFURSArIDEpOgorICAgICAgaWYgKGlzX2NvbXBhdF90YXNrKCkpCisgICAgICAgICByZXQgPSBoZGRfZHJpdmVyX2NvbXBhdF9pb2N0bChwQWRhcHRlciwgaWZyKTsKKyAgICAgIGVsc2UKKyAgICAgICAgIHJldCA9IGhkZF9kcml2ZXJfaW9jdGwocEFkYXB0ZXIsIGlmcik7CisgICAgICBicmVhazsKKyAgIGRlZmF1bHQ6CisgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IHVua25vd24gaW9jdGwgJWQiLAorICAgICAgICAgICAgIF9fZnVuY19fLCBjbWQpOworICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgIGJyZWFrOworICAgfQorIGV4aXQ6CisgICBFWElUKCk7CisgICByZXR1cm4gcmV0OworfQorCitpbnQgaGRkX2lvY3RsKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsIHN0cnVjdCBpZnJlcSAqaWZyLCBpbnQgY21kK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orICAgIHsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIC8qbm8gc3BhY2UgYWZ0ZXIgdGhlIGNvbW1hbmQqLworICAgIGVsc2UgaWYgKFNQQUNFX0FTQ0lJX1ZBTFVFICE9ICppblB0cikKKyAgICB7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIC8qcmVtb3ZpbmcgZW1wdHkgc3BhY2VzKi8KKyAgICB3aGlsZSAoKFNQQUNFX0FTQ0lJX1ZBTFVFICA9PSAqaW5QdHIpICYmICgnXDAnICE9ICAqaW5QdHIpKSBpblB0cisrOworCisgICAgLypubyBhcmd1bWVudCBmb2xsb3dlZCBieSBzcGFjZXMqLworICAgIGlmICgnXDAnID09ICppblB0cikgcmV0dXJuIC1FSU5WQUw7CisKKyAgICAvKmdldHRpbmcgdGhlIGZpcnN0IGFyZ3VtZW50IGllIG1lYXN1cmVtZW50IHRva2VuKi8KKyAgICB2ID0gc3NjYW5mKGluUHRyLCAiJTMxcyAiLCBidWYpOworICAgIGlmICgxICE9IHYpIHJldHVybiAtRUlOVkFMOworCisgICAgdiA9IGtzdHJ0b3MzMihidWYsIDEwLCAmdGVtcEludCk7CisgICAgaWYgKCB2IDwgMCkgcmV0dXJuIC1FSU5WQUw7CisKKyAgICBwRXNlQmNuUmVxLT5udW1CY25SZXFJZSA9IHRlbXBJbnQ7CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgIk51bWJlciBvZiBCY24gUmVxIEllIGZpZWxkcyglZCkiLCBwRXNlQmNuUmVxLT5udW1CY25SZXFJZSk7CisKKyAgICBmb3IgKGogPSAwOyBqIDwgKHBFc2VCY25SZXEtPm51bUJjblJlcUllKTsgaisrKQorICAgIHsKKyAgICAgICAgZm9yIChpID0gMDsgaSA8IDQ7IGkrKykKKyAgICAgICAgeworICAgICAgICAgICAgLyppblB0ciBwb2ludGluZyB0byB0aGUgYmVnaW5uaW5nIG9mIGZpcnN0IHNwYWNlIGFmdGVyIG51bWJlciBvZiBpZSBmaWVsZHMqLworICAgICAgICAgICAgaW5QdHIgPSBzdHJwYnJrKCBpblB0ciwgIiAiICk7CisgICAgICAgICAgICAvKm5vIGllIGRhdGEgYWZ0ZXIgdGhlIG51bWJlciBvZiBpZSBmaWVsZHMgYXJndW1lbnQqLworICAgICAgICAgICAgaWYgKE5VTEwgPT0gaW5QdHIpIHJldHVybiAtRUlOVkFMOworCisgICAgICAgICAgICAvKnJlbW92aW5nIGVtcHR5IHNwYWNlKi8KKyAgICAgICAgICAgIHdoaWxlICgoU1BBQ0VfQVNDSUlfVkFMVUUgPT0gKmluUHRyKSAmJiAoJ1wwJyAhPSAqaW5QdHIpKSBpblB0cisrOworCisgICAgICAgICAgICAvKm5vIGllIGRhdGEgYWZ0ZXIgdGhlIG51bWJlciBvZiBpZSBmaWVsZHMgYXJndW1lbnQgYW5kIHNwYWNlcyovCisgICAgICAgICAgICBpZiAoICdcMCcgPT0gKmluUHRyICkgcmV0dXJuIC1FSU5WQUw7CisKKyAgICAgICAgICAgIHYgPSBzc2NhbmYoaW5QdHIsICIlMzFzICIsIGJ1Zik7CisgICAgICAgICAgICBpZiAoMSAhPSB2KSByZXR1cm4gLUVJTlZBTDsKKworICAgICAgICAgICAgdiA9IGtzdHJ0b3MzMihidWYsIDEwLCAmdGVtcEludCk7CisgICAgICAgICAgICBpZiAodiA8IDApIHJldHVybiAtRUlOVkFMOworCisgICAgICAgICAgICBzd2l0Y2ggKGkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2FzZSAwOiAgLyogTWVhc3VyZW1lbnQgdG9rZW4gKi8KKyAgICAgICAgICAgICAgICBpZiAodGVtcEludCA8PSAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJJbnZhbGlkIE1lYXN1cmVtZW50IFRva2VuKCVkKSIsIHRlbXBJbnQpOworICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwRXNlQmNuUmVxLT5iY25SZXFbal0ubWVhc3VyZW1lbnRUb2tlbiA9IHRlbXBJbnQ7CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIDE6ICAvKiBDaGFubmVsIG51bWJlciAqLworICAgICAgICAgICAgICAgIGlmICgodGVtcEludCA8PSAwKSB8fAorICAgICAgICAgICAgICAgICAgICAodGVtcEludCA+IFdOSV9DRkdfQ1VSUkVOVF9DSEFOTkVMX1NUQU1BWCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkludmFsaWQgQ2hhbm5lbCBOdW1iZXIoJWQpIiwgdGVtcEludCk7CisgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHBFc2VCY25SZXEtPmJjblJlcVtqXS5jaGFubmVsID0gdGVtcEludDsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgMjogIC8qIFNjYW4gbW9kZSAqLworICAgICAgICAgICAgICAgIGlmICgodGVtcEludCA8IGVTSVJfUEFTU0lWRV9TQ0FOKSB8fCAodGVtcEludCA+IGVTSVJfQkVBQ09OX1RBQkxFKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiSW52YWxpZCBTY2FuIE1vZGUoJWQpIEV4cGVjdGVkezB8MXwyfSIsIHRlbXBJbnQpOworICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwRXNlQmNuUmVxLT5iY25SZXFbal0uc2Nhbk1vZGU9IHRlbXBJbnQ7CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIDM6ICAvKiBNZWFzdXJlbWVudCBkdXJhdGlvbiAqLworICAgICAgICAgICAgICAgIGlmICgoKHRlbXBJbnQgPD0gMCkgJiYgKHBFc2VCY25SZXEtPmJjblJlcVtqXS5zY2FuTW9kZSAhPSBlU0lSX0JFQUNPTl9UQUJMRSkpIHx8CisgICAgICAgICAgICAgICAgICAgICgodGVtcEludCA8IDApICYmIChwRXNlQmNuUmVxLT5iY25SZXFbal0uc2Nhbk1vZGUgPT0gZVNJUl9CRUFDT05fVEFCTEUpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiSW52YWxpZCBNZWFzdXJlbWVudCBEdXJhdGlvbiglZCkiLCB0ZW1wSW50KTsKKyAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcEVzZUJjblJlcS0+YmNuUmVxW2pdLm1lYXN1cmVtZW50RHVyYXRpb24gPSB0ZW1wSW50OworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgZm9yIChqID0gMDsgaiA8IHBFc2VCY25SZXEtPm51bUJjblJlcUllOyBqKyspCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAiSW5kZXgoJWQpIE1lYXN1cmVtZW50IFRva2VuKCV1KUNoYW5uZWwoJXUpIFNjYW4gTW9kZSgldSkgTWVhc3VyZW1lbnQgRHVyYXRpb24oJXUpXG4iLAorICAgICAgICAgICAgICAgICAgIGosCisgICAgICAgICAgICAgICAgICAgcEVzZUJjblJlcS0+YmNuUmVxW2pdLm1lYXN1cmVtZW50VG9rZW4sCisgICAgICAgICAgICAgICAgICAgcEVzZUJjblJlcS0+YmNuUmVxW2pdLmNoYW5uZWwsCisgICAgICAgICAgICAgICAgICAgcEVzZUJjblJlcS0+YmNuUmVxW2pdLnNjYW5Nb2RlLAorICAgICAgICAgICAgICAgICAgIHBFc2VCY25SZXEtPmJjblJlcVtqXS5tZWFzdXJlbWVudER1cmF0aW9uKTsKKyAgICB9CisKKyAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfQorCitzdGF0aWMgdm9pZCBoZGRfR2V0VHNtU3RhdHNDQiggdEFuaVRyYWZTdHJtTWV0cmljcyB0c21NZXRyaWNzLCBjb25zdCB0QU5JX1UzMiBzdGFJZCwgdm9pZCAqcENvbnRleHQgKQoreworICAgc3RydWN0IHN0YXRzQ29udGV4dCAqcFN0YXRzQ29udGV4dCA9IE5VTEw7CisgICBoZGRfYWRhcHRlcl90ICAgICAgICpwQWRhcHRlciA9IE5VTEw7CisKKyAgIGlmIChOVUxMID09IHBDb250ZXh0KQorICAgeworICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAiJXM6IEJhZCBwYXJhbSwgcENvbnRleHQgWyVwXSIsCisgICAgICAgICAgICAgX19mdW5jX18sIHBDb250ZXh0KTsKKyAgICAgIHJldHVybjsKKyAgIH0KKworICAgLyogdGhlcmUgaXMgYS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F0cyAqLworICAgaHN0YXR1cyA9IHNtZV9HZXRUc21TdGF0cyhwSGRkQ3R4LT5oSGFsLCBoZGRfR2V0VHNtU3RhdHNDQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkU3RhQ3R4LT5jb25uX2luZm8uc3RhSWRbIDAgXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkU3RhQ3R4LT5jb25uX2luZm8uYnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgJmNvbnRleHQsIHBIZGRDdHgtPnB2b3NDb250ZXh0LCB0aWQpOworCisgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSBoc3RhdHVzKQorICAgeworICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiBVbmFibGUgdG8gcmV0cmlldmUgc3RhdGlzdGljcyIsCisgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgdnN0YXR1cyA9IFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgIH0KKyAgIGVsc2UKKyAgIHsKKyAgICAgIC8qIHJlcXVlc3Qgd2FzIHNlbnQgLS0gd2FpdCBmb3IgdGhlIHJlc3BvbnNlICovCisgICAgICBscmMgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGVfdGltZW91dCgmY29udGV4dC5jb21wbGV0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcyhXTEFOX1dBSVRfVElNRV9TVEFUUykpOworICAgICAgaWYgKGxyYyA8PSAwKQorICAgICAgeworICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IFNNRSAlcyB3aGlsZSByZXRyaWV2aW5nIHN0YXRpc3RpY3MiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fLCAoMCA9PSBscmMpID8gInRpbWVvdXQiIDogImludGVycnVwdCIpOworICAg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cmxlbihpblB0ciksIFNQQUNFX0FTQ0lJX1ZBTFVFKTsKKyAgICAvKm5vIGFyZ3VtZW50IGFmdGVyIHRoZSBjb21tYW5kKi8KKyAgICBpZiAoTlVMTCA9PSBpblB0cikgcmV0dXJuIC1FSU5WQUw7CisgICAgLypyZW1vdmluZyBlbXB0eSBzcGFjZXMqLworICAgIHdoaWxlICgoU1BBQ0VfQVNDSUlfVkFMVUUgID09ICppblB0cikgJiYgKCdcMCcgIT0gICppblB0cikgKSBpblB0cisrOworCisgICAgLypubyBhcmd1bWVudCBmb2xsb3dlZCBieSBzcGFjZXMqLworICAgIGlmICgnXDAnID09ICppblB0cikKKyAgICB7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIC8qZ2V0dGluZyB0aGUgbmV4dCBhcmd1bWVudCBpZSB0aGUgZHdlbGwgdGltZSAqLworICAgIHYgPSBzc2NhbmYoaW5QdHIsICIlMzFzICIsIHRlbXBCdWYpOworICAgIGlmICgxICE9IHYpIHJldHVybiAtRUlOVkFMOworCisgICAgdiA9IGtzdHJ0b3MzMih0ZW1wQnVmLCAxMCwgJnRlbXBJbnQpOworICAgIGlmICggdiA8IDAgfHwgdGVtcEludCA8IDApIHJldHVybiAtRUlOVkFMOworCisgICAgKnBEd2VsbFRpbWUgPSB0ZW1wSW50OworCisgICAgLyogcG9pbnQgdG8gdGhlIG5leHQgYXJndW1lbnQgKi8KKyAgICBpblB0ciA9IHN0cm5jaHIoaW5QdHIsIHN0cmxlbihpblB0ciksIFNQQUNFX0FTQ0lJX1ZBTFVFKTsKKyAgICAvKm5vIGFyZ3VtZW50IGFmdGVyIHRoZSBjb21tYW5kKi8KKyAgICBpZiAoTlVMTCA9PSBpblB0cikgcmV0dXJuIC1FSU5WQUw7CisgICAgLypyZW1vdmluZyBlbXB0eSBzcGFjZXMqLworICAgIHdoaWxlICgoU1BBQ0VfQVNDSUlfVkFMVUUgID09ICppblB0cikgJiYgKCdcMCcgIT0gICppblB0cik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CBieSBzcGFjZXMqLworICAgIGlmICgnXDAnID09ICppblB0cikKKyAgICB7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIC8qZ2V0dGluZyB0aGUgZmlyc3QgYXJndW1lbnQgaWUgdGhlIG51bWJlciBvZiBjaGFubmVscyovCisgICAgdiA9IHNzY2FuZihpblB0ciwgIiUzMXMgIiwgYnVmKTsKKyAgICBpZiAoMSAhPSB2KSByZXR1cm4gLUVJTlZBTDsKKworICAgIHYgPSBrc3RydG9zMzIoYnVmLCAxMCwgJnRlbXBJbnQpOworICAgIGlmICgodiA8IDApIHx8CisgICAgICAgICh0ZW1wSW50IDw9IDApIHx8CisgICAgICAgICh0ZW1wSW50ID4gV05JX0NGR19WQUxJRF9DSEFOTkVMX0xJU1RfTEVOKSkKKyAgICB7CisgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgKnBOdW1DaGFubmVscyA9IHRlbXBJbnQ7CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgIk51bWJlciBvZiBjaGFubmVscyBhcmU6ICVkIiwgKnBOdW1DaGFubmVscyk7CisKKyAgICBmb3IgKGogPSAwOyBqIDwgKCpwTnVtQ2hhbm5lbHMpOyBqKyspCisgICAgeworICAgICAgICAvKmluUHRyIHBvaW50aW5nIHRvIHRoZSBiZWdpbm5pbmcgb2YgZmlyc3Qgc3BhY2UgYWZ0ZXIgbnVtYmVyIG9mIGNoYW5uZWxzKi8KKyAgICAgICAgaW5QdHIgPSBzdHJwYnJrKCBpblB0ciwgIiAiICk7CisgICAgICAgIC8qbm8gY2hhbm5lbCBsaXN0IGFmdGVyIHRoZSBudW1iZXIgb2YgY2hhbm5lbHMgYXJndW1lbnQqLworICAgICAgICBpZiAoTlVMTCA9PSBpblB0cikKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKDAgIT0gaikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAqcE51bUNoYW5uZWxzID0gajsKKyAgICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLypyZW1vdmluZyBlbXB0eSBzcGFjZSovCisgICAgICAgIHdoaWxlICgoU1BBQ0VfQVNDSUlfVkFMVUUgPT0gKmluUHRyKSAmJiAoJ1wwJyAhPSAqaW5QdHIpKSBpblB0cisrOworCisgICAgICAgIC8qbm8gY2hhbm5lbCBsaXN0IGFmdGVyIHRoZSBudW1iZXIgb2YgY2hhbm5lbHMgYXJndW1lbnQgYW5kIHNwYWNlcyovCisgICAgICAgIGlmICggJ1wwJyA9PSAqaW5QdHIgKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoMCAhPSBqKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICpwTnVtQ2hhbm5lbHMgPSBqOworICAgICAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICB2ID0gc3NjYW5mKGluUHRyLCAiJTMxcyAiLCBidWYpOworICAgICAgICBpZiAoMSAhPSB2KSByZXR1cm4gLUVJTlZBTDsKKworICAgICAgICB2ID0ga3N0cnRvczMyKGJ1ZiwgMTAsICZ0ZW1wSW50KTsKKyAgICAgICAgaWYgKCh2IDwgMCkgfHwKKyAgICAgICAgICAgICh0ZW1wSW50IDw9IDApIHx8CisgICAgICAgICAgICAodGVtcEludCA+IFdOSV9DRkdfQ1VSUkVOVF9DSEFOTkV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3NpZFs1XSA9IGhkZF9wYXJzZV9oZXgobWFjQWRkcmVzc1sxNV0pIDw8IDQgfCBoZGRfcGFyc2VfaGV4KG1hY0FkZHJlc3NbMTZdKTsKKworICAgIC8qIHBvaW50IHRvIHRoZSBuZXh0IGFyZ3VtZW50ICovCisgICAgaW5QdHIgPSBzdHJuY2hyKGluUHRyLCBzdHJsZW4oaW5QdHIpLCBTUEFDRV9BU0NJSV9WQUxVRSk7CisgICAgLypubyBhcmd1bWVudCBhZnRlciB0aGUgY29tbWFuZCovCisgICAgaWYgKE5VTEwgPT0gaW5QdHIpIHJldHVybiAtRUlOVkFMOworCisgICAgLypyZW1vdmluZyBlbXB0eSBzcGFjZXMqLworICAgIHdoaWxlICgoU1BBQ0VfQVNDSUlfVkFMVUUgID09ICppblB0cikgJiYgKCdcMCcgIT0gICppblB0cikgKSBpblB0cisrOworCisgICAgLypubyBhcmd1bWVudCBmb2xsb3dlZCBieSBzcGFjZXMqLworICAgIGlmICgnXDAnID09ICppblB0cikKKyAgICB7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIC8qZ2V0dGluZyB0aGUgbmV4dCBhcmd1bWVudCBpZSB0aGUgY2hhbm5lbCBudW1iZXIgKi8KKyAgICB2ID0gc3NjYW5mKGluUHRyLCAiJTMxcyAiLCB0ZW1wQnVmKTsKKyAgICBpZiAoMSAhPSB2KSByZXR1cm4gLUVJTlZBTDsKKworICAgIHYgPSBrc3RydG9zMzIodGVtcEJ1ZiwgMTAsICZ0ZW1wSW50KTsKKyAgICBpZiAoKHYgPCAwKSB8fAorICAgICAgICAodGVtcEludCA8IDApIHx8CisgICAgICAgICh0ZW1wSW50ID4gV05JX0NGR19DVVJSRU5UX0NIQU5ORUxfU1RBTUFYKSkKKyAgICB7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgICpwQ2hhbm5lbCA9IHRlbXBJbnQ7CisgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0V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5JX1U4ICB0ZW1wQnl0ZSA9IDA7CisKKyAgICBpblB0ciA9IHN0cm5jaHIocFZhbHVlLCBzdHJsZW4ocFZhbHVlKSwgU1BBQ0VfQVNDSUlfVkFMVUUpOworICAgIC8qbm8gYXJndW1lbnQgYWZ0ZXIgdGhlIGNvbW1hbmQqLworICAgIGlmIChOVUxMID09IGluUHRyKQorICAgIHsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgLypubyBzcGFjZSBhZnRlciB0aGUgY29tbWFuZCovCisgICAgZWxzZSBpZiAoU1BBQ0VfQVNDSUlfVkFMVUUgIT0gKmluUHRyKQorICAgIHsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgLypyZW1vdmluZyBlbXB0eSBzcGFjZXMqLworICAgIHdoaWxlICgoU1BBQ0VfQVNDSUlfVkFMVUUgID09ICppblB0cikgJiYgKCdcMCcgIT0gICppblB0cikgKSBpblB0cisrOworCisgICAgLypubyBhcmd1bWVudCBmb2xsb3dlZCBieSBzcGFjZXMqLworICAgIGlmICgnXDAnID09ICppblB0cikKKyAgICB7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIC8qIGZpbmQgdGhlIGxlbmd0aCBvZiBkYXRhICovCisgICAgZGF0YUVuZCA9IGluUHRyOworICAgIHdoaWxlKCgnXDAnICE9ICAqZGF0YUVuZCkgKQorICAgIHsKKyAgICAgICAgZGF0YUVuZCsrOworICAgICAgICArKygqcENja21JZUxlbik7CisgICAgfQorICAgIGlmICggKnBDY2ttSWVMZW4gPD0gMCkgIHJldHVybiAtRUlOVkFMOworCisgICAgLyogQWxsb2NhdGUgdGhlIG51bWJlciBvZiBieXRlcyBiYXNlZCBvbiB0aGUgbnVtYmVyIG9mIGlucHV0IGNoYXJhY3RlcnMKKyAgICAgICB3aGV0aGVyIGl0IGlzIGV2ZW4gb3Igb2RkLgorICAgICAgIGlmIHRoZSBudW1iZXIgb2YgaW5w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uZCBhIHNlcGFyYXRvciBjb2xvbiA6IGFwcGVhcnMgaW4gdGhlIGlucHV0IHN0cmluZyBvbmx5IGFmdGVyCisgIGFuIGV2ZW4gbnVtYmVyIG9mIGhleCBkaWdpdHMuCisKKyAgXHBhcmFtICAtIHBNYWNBZGRyIHBvaW50ZXIgdG8gdGhlIGlucHV0IE1BQyBhZGRyZXNzCisgIFxyZXR1cm4gLSAxIGZvciB2YWxpZCBhbmQgMCBmb3IgaW52YWxpZAorCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKwordl9CT09MX3QgaGRkX2lzX3ZhbGlkX21hY19hZGRyZXNzKGNvbnN0IHRBTklfVTggKnBNYWNBZGRyKQoreworICAgIGludCB4ZGlnaXQgPSAwOworICAgIGludCBzZXBhcmF0b3IgPSAwOworICAgIHdoaWxlICgqcE1hY0FkZHIpCisgICAgeworICAgICAgICBpZiAoaXN4ZGlnaXQoKnBNYWNBZGRyKSkKKyAgICAgICAgeworICAgICAgICAgICAgeGRpZ2l0Kys7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoJzonID09ICpwTWFjQWRkcikKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKDAgPT0geGRpZ2l0IHx8ICgoeGRpZ2l0IC8gMikgLSAxKSAhPSBzZXBhcmF0b3IpCisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICsrc2VwYXJhdG9yOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgc2VwYXJhdG9yID0gLTE7CisgICAgICAgICAgICAvKiBJbnZhbGlkIE1BQyBmb3VuZCAqLworICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIH0KKyAgICAgICAgKytwTWFjQWRkcjsKKyAgICB9CisgICAgcmV0dXJuICh4ZGlnaXQgPT0gMTIgJ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WMiLCBfX2Z1bmNfXyk7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICAgIGlmIChOVUxMID09IHBIZGRDdHgpCisgICAgICB7CisgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICIlczogTlVMTCBwSGRkQ3R4IiwgX19mdW5jX18pOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisKKyAgICAgIGlmIChkZXYgIT0gcEFkYXB0ZXItPmRldikKKyAgICAgIHsKKyAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIGRldmljZSByZWZlcmVuY2UiLCBfX2Z1bmNfXyk7CisgICAgICAgICAvKiB3ZSBoYXZlbid0IHZhbGlkYXRlZCBhbGwgY2FzZXMgc28gbGV0IHRoaXMgZ28gZm9yIG5vdyAqLworICAgICAgfQorI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgICAgICBtdXRleF9sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworI2VuZGlmCisgICAgICBoZGRfZGVpbml0X2FkYXB0ZXIocEhkZEN0eCwgcEFkYXB0ZXIsIFRSVUUpOworI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisjZW5kaWYKKworICAgICAgLyogYWZ0ZXIgdW5pbml0IG91ciBhZGFwdGVyIHN0cnVjdHVyZSB3aWxsIG5vIGxvbmdlciBiZSB2YWxpZCAqLworICAgICAgcEFkYXB0ZXItPmRldiA9IE5VTEw7CisgICAgICBwQWRhcHRlci0+bWFnaWMgPSAwOworICAgfSB3aGlsZSAoMCk7CisKKyAgIEVYSVQoKTsKK30KKworLyoqLS0tLS0tLS0tLS0tLS0tL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GVyX2luaXQoKSBmYWlsZWQgd2l0aCBzdGF0dXMgY29kZSAlMDhkIFt4JTA4eF0iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cywgc3RhdHVzICk7CisgICAgICBnb3RvIGVycm9yX3dtbV9pbml0OworICAgfQorCisgICBzZXRfYml0KFdNTV9JTklUX0RPTkUsICZwQWRhcHRlci0+ZXZlbnRfZmxhZ3MpOworCisgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworCitlcnJvcl93bW1faW5pdDoKKyAgIGNsZWFyX2JpdChJTklUX1RYX1JYX1NVQ0NFU1MsICZwQWRhcHRlci0+ZXZlbnRfZmxhZ3MpOworICAgaGRkX2RlaW5pdF90eF9yeChwQWRhcHRlcik7CitlcnJvcl9pbml0X3R4cng6CisgICBoZGRfVW5yZWdpc3RlcldleHQocFdsYW5EZXYpOworZXJyb3JfcmVnaXN0ZXJfd2V4dDoKKyAgIGlmICh0ZXN0X2JpdChTTUVfU0VTU0lPTl9PUEVORUQsICZwQWRhcHRlci0+ZXZlbnRfZmxhZ3MpKQorICAgeworICAgICAgSU5JVF9DT01QTEVUSU9OKHBBZGFwdGVyLT5zZXNzaW9uX2Nsb3NlX2NvbXBfdmFyKTsKKyAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTID09IHNtZV9DbG9zZVNlc3Npb24ocEhkZEN0eC0+aEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsIFZPU19UUlVFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGRkX3NtZUNsb3NlU2Vzc2lvbkNhbGxiYWNrLCBwQWRhcHRlcikpCisgICAgICB7CisgICAgICAgICB1bnNpZ25lZCBsb25nIHJjOworCisgICAgICAgICAvL0Jsb2NrIG9uIGEgY29tcGxldGlvbiB2YXJpYWJsZS4gQ2FuJ3Qgd2FpdCBmb3JldmVyIHRob3VnaC4K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fUDJQX0NMSUVOVDoKKyAgICAgIGNhc2UgV0xBTl9IRERfUDJQX0RFVklDRToKKyAgICAgIHsKKyAgICAgICAgIGlmKHRlc3RfYml0KElOSVRfVFhfUlhfU1VDQ0VTUywgJnBBZGFwdGVyLT5ldmVudF9mbGFncykpCisgICAgICAgICB7CisgICAgICAgICAgICBoZGRfZGVpbml0X3R4X3J4KCBwQWRhcHRlciApOworICAgICAgICAgICAgY2xlYXJfYml0KElOSVRfVFhfUlhfU1VDQ0VTUywgJnBBZGFwdGVyLT5ldmVudF9mbGFncyk7CisgICAgICAgICB9CisKKyAgICAgICAgIGlmKHRlc3RfYml0KFdNTV9JTklUX0RPTkUsICZwQWRhcHRlci0+ZXZlbnRfZmxhZ3MpKQorICAgICAgICAgeworICAgICAgICAgICAgaGRkX3dtbV9hZGFwdGVyX2Nsb3NlKCBwQWRhcHRlciApOworICAgICAgICAgICAgY2xlYXJfYml0KFdNTV9JTklUX0RPTkUsICZwQWRhcHRlci0+ZXZlbnRfZmxhZ3MpOworICAgICAgICAgfQorCisgICAgICAgICBoZGRfY2xlYW51cF9hY3Rpb25mcmFtZShwSGRkQ3R4LCBwQWRhcHRlcik7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKworICAgICAgY2FzZSBXTEFOX0hERF9TT0ZUQVA6CisgICAgICBjYXNlIFdMQU5fSEREX1AyUF9HTzoKKyAgICAgIHsKKworICAgICAgICAgaWYgKHRlc3RfYml0KFdNTV9JTklUX0RPTkUsICZwQWRhcHRlci0+ZXZlbnRfZmxhZ3MpKQorICAgICAgICAgeworICAgICAgICAgICAgaGRkX3dtbV9hZGFwdGVyX2Nsb3NlKCBwQWRhcHRlciApOworICAgICAgICAgICAgY2xlYXJfYml0KFdNTV9JTklUX0RPTkUsICZwQWRhcHRlci0+ZXZlbnRfZmxhZ3MpOworICAgICAgICAgfQorCisgICAgICAgICBoZGRfY2xlYW51cF9hY3Rpb25mcmFtZShwSGRkQ3R4LCBwQWRhcHRlcik7CisK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hYmxlTW9kdWxhdGVkRFRJTTsKKyAgICAgICAgICAgICAgIHBvd2VyUmVxdWVzdC51TGlzdGVuSW50ZXJ2YWwgPSBwSGRkQ3R4LT5oZGRfYWN0dWFsX0xJX3ZhbHVlOworICAgICAgICAgICB9CisgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgcG93ZXJSZXF1ZXN0LnVMaXN0ZW5JbnRlcnZhbCA9IHBIZGRDdHgtPmNmZ19pbmktPmVuYWJsZUR5bmFtaWNEVElNOworICAgICAgICAgICB9CisKKyAgICAgICAgICAgLyogVXBkYXRlIGlnbm9yZURUSU0gYW5kIExpc3RlZEludGVydmFsIGluIENGRyB0byByZW1haW4gYXQgdGhlIERUSU0KKyAgICAgICAgICAgICogc3BlY2lmaWVkIGR1cmluZyBFbnRlci9FeGl0IEJNUFMgd2hlbiBMQ0Qgb2ZmKi8KKyAgICAgICAgICAgIGNjbUNmZ1NldEludChwSGRkQ3R4LT5oSGFsLCBXTklfQ0ZHX0lHTk9SRV9EVElNLCBwb3dlclJlcXVlc3QudUlnbm9yZURUSU0sCisgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsIGVBTklfQk9PTEVBTl9GQUxTRSk7CisgICAgICAgICAgICBjY21DZmdTZXRJbnQocEhkZEN0eC0+aEhhbCwgV05JX0NGR19MSVNURU5fSU5URVJWQUwsIHBvd2VyUmVxdWVzdC51TGlzdGVuSW50ZXJ2YWwsCisgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsIGVBTklfQk9PTEVBTl9GQUxTRSk7CisKKyAgICAgICAgICAgLyogc3dpdGNoIHRvIHRoZSBEVElNIHNwZWNpZmllZCBpbiBjZmcuaW5pICovCisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICJTd2l0Y2ggdG8gRFRJTSAlZCBMaXN0ZW4gaW50ZXJ2YWwg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WF9QVFIocEFkYXB0ZXIpKSkKKyAgICAgICAgICB7CisgICAgICAgICAgICAgZGlzYWJsZUJtcHMgPSBUUlVFOworICAgICAgICAgIH0KKworICAgICAgICAgIHBBZGFwdGVyID0gaGRkX2dldF9hZGFwdGVyKHBIZGRDdHgsIFdMQU5fSEREX1AyUF9DTElFTlQpOworICAgICAgICAgIGlmKChOVUxMICE9IHBBZGFwdGVyKSYmCisgICAgICAgICAgICAgIGhkZF9jb25uSXNDb25uZWN0ZWQoIFdMQU5fSEREX0dFVF9TVEFUSU9OX0NUWF9QVFIocEFkYXB0ZXIpKSkKKyAgICAgICAgICB7CisgICAgICAgICAgICAgZGlzYWJsZUJtcHMgPSBUUlVFOworICAgICAgICAgIH0KKworICAgICAgICAgIC8vRXhpdCBib3RoIEJtcHMgYW5kIEltcHMgaW5jYXNlIG9mIEdvL1NBUCBNb2RlCisgICAgICAgICAgaWYoKFdMQU5fSEREX1NPRlRBUCA9PSBzZXNzaW9uX3R5cGUpIHx8CisgICAgICAgICAgICAgIChXTEFOX0hERF9QMlBfR08gPT0gc2Vzc2lvbl90eXBlKSkKKyAgICAgICAgICB7CisgICAgICAgICAgICAgZGlzYWJsZUJtcHMgPSBUUlVFOworICAgICAgICAgICAgIGRpc2FibGVJbXBzID0gVFJVRTsKKyAgICAgICAgICB9CisKKyAgICAgICAgICBpZihUUlVFID09IGRpc2FibGVJbXBzKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICBpZiAocEhkZEN0eC0+Y2ZnX2luaS0+ZklzSW1wc0VuYWJsZWQpCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtZV9EaXNhYmxlUG93ZXJTYXZlIChwSGRkQ3R4LT5oSGFsLCBlUE1DX0lETEVfTU9ERV9QT1dFUl9TQVZFKTsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgfQorCisgICAgICAgICAgaWYoVFJVRSA9PSBkaXNhYmxlQm1wcykKKyAgICAgICAgICB7CisgICAgICAgICAgICAgaWYocEhkZEN0eC0+Y2ZnX2luaS0+ZklzQm1wc0VuYWJsZWQpCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBoYWxTdGF0dXMgPSBzbWVfRGlzYWJsZVBvd2VyU2F2ZShwSGRkQ3R4LT5oSGFsLCBlUE1DX0JFQUNPTl9NT0RFX1BPV0VSX1NBVkUpOworCisgICAgICAgICAgICAgICAgIGlmKGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gaGFsU3RhdHVzKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCIlczogRmFpbCB0byBEaXNhYmxlIFBvd2VyIFNhdmUiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgIGlmKHBIZGRDdHgtPmNmZ19pbmktPmZJc0F1dG9CbXBzVGltZXJFbmFibGVkKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIGhhbFN0YXR1cyA9IHNtZV9TdG9wQXV0b0JtcHNUaW1lcihwSGRkQ3R4LT5oSGFsKTsKKworICAgICAgICAgICAgICAgICBpZihlSEFMX1NUQVRVU19TVUNDRVNTICE9IGhhbFN0YXR1cykKKyAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiJXM6IEZhaWwgdG8gU3RvcCBBdXRvIEJtcHMgVGltZXIiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKworICAgICAgICAgIGlmKChUUlVFID09IGRpc2FibGVCbXBzKSB8fAorICAgICAgICAgICAgICAoVFJVRSA9PSBkaXNhYmxlSW1wcykpCisgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBOb3csIGdldCB0aGUgY2hpcCBpbnRvIEZ1bGwgUG93ZXIgbm93ICovCisgICAgICAgICAgICAgIElOSVRfQ09NUExFVElPTihwSGRkQ3R4LT5mdWxsX3B3cl9jb21wX3Zhcik7CisgICAgICAgICAgICAgIGhhbFN0YXR1cyA9IHNtZV9SZXF1ZXN0RnVsbFBvd2VyKHBIZGRDdHgtPmhIYWwsIGhkZF9mdWxsX3B3cl9jYmssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgsIGVTTUVfRlVMTF9QV1JfTkVFREVEX0JZX0hERCk7CisKKyAgICAgICAgICAgICAgaWYoaGFsU3RhdHVzICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgaWYoaGFsU3RhdHVzID09IGVIQUxfU1RBVFVTX1BNQ19QRU5ESU5HKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGxvbmcgcmV0OworICAgICAgICAgICAgICAgICAgICAvL0Jsb2NrIG9uIGEgY29tcGxldGlvbiB2YXJpYWJsZS4gQ2FuJ3Qgd2FpdCBmb3JldmVyIHRob3VnaAorICAgICAgICAgICAgICAgICAgICByZXQgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGVfdGltZW91dCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBIZGRDdHgtPmZ1bGxfcHdyX2NvbXBfdmFyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcygxMDAwKSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChyZXQgPD0gMCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IHdhaXQgb24gZnVsbF9wd3JfY29tcF92YXIgZmFpbGVkICVsZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHJldCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIiVzOiBSZXF1ZXN0IGZvciBGdWxsIFBvd2VyIGZhaWxlZCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgIH0KKworICAgICAgICAgIGJyZWFrOworICAgfQorICAgcmV0dXJuIHN0YXR1czsKK30KKwordm9pZCBoZGRfbW9uUG9zdE1zZ0NiKHRBTklfVTMyICptYWdpYywgc3RydWN0IGNvbXBsZXRpb24gKmNtcFZhcikKK3sKKyAgICBpZiAobWFnaWMgPT0gTlVMTCB8fCBjbXBWYXIgPT0gTlVMTCkgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIF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RmFpbCB0byBFeGl0IEJNUFMKKyAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIiVzOiBGYWlsIHRvIEV4aXQgQk1QUyIsIF9fZnVuY19fKTsKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICByZXR1cm4gTlVMTDsKKyAgIH0KKworICAgc3dpdGNoKHNlc3Npb25fdHlwZSkKKyAgIHsKKyAgICAgIGNhc2UgV0xBTl9IRERfSU5GUkFfU1RBVElPTjoKKyAgICAgIGNhc2UgV0xBTl9IRERfUDJQX0NMSUVOVDoKKyAgICAgIGNhc2UgV0xBTl9IRERfUDJQX0RFVklDRToKKyAgICAgIHsKKyAgICAgICAgIHBBZGFwdGVyID0gaGRkX2FsbG9jX3N0YXRpb25fYWRhcHRlciggcEhkZEN0eCwgbWFjQWRkciwgaWZhY2VfbmFtZSApOworCisgICAgICAgICBpZiggTlVMTCA9PSBwQWRhcHRlciApCisgICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICBGTCgiZmFpbGVkIHRvIGFsbG9jYXRlIGFkYXB0ZXIgZm9yIHNlc3Npb24gJWQiKSwgc2Vzc2lvbl90eXBlKTsKKyAgICAgICAgICAgIHJldHVybiBOVUxMOworICAgICAgICAgfQorCisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICAgICAgIC8qIEEgTXV0ZXggTG9jayBpcyBpbnRyb2R1Y2VkIHdoaWxlIGNoYW5naW5nL2luaXRpYWxpemluZyB0aGUgbW9kZSB0bworICAgICAgICAgICogcHJvdGVjdCB0aGUgY29uY3VycmVudCBhY2Nlc3MgZm9yIHRoZSBBZGFwdGVycyBieSBURExTIG1vZHVsZS4KKyAgICAgICAgICAqLworICAgICAgICAgIG11dGV4X2xvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisjZW5kaWYKKworICAgICAgICAgcEFkYXB0ZXItPndkZXYuaWZ0eXBlID0gKHNlc3Npb25fdHlwZSA9PSBXTEFOX0hERF9QMlBfQ0xJRU5UKSA/CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTkw4MDIxMV9JRlRZUEVfUDJQX0NMSUVOVDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOTDgwMjExX0lGVFlQRV9TVEFUSU9OOworCisgICAgICAgICBwQWRhcHRlci0+ZGV2aWNlX21vZGUgPSBzZXNzaW9uX3R5cGU7CisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyNlbmRpZgorCisgICAgICAgICBoZGRfaW5pdGlhbGl6ZV9hZGFwdGVyX2NvbW1vbihwQWRhcHRlcik7CisgICAgICAgICBzdGF0dXMgPSBoZGRfaW5pdF9zdGF0aW9uX21vZGUoIHBBZGFwdGVyICk7CisgICAgICAgICBpZiggVk9TX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cyApCisgICAgICAgICAgICBnb3RvIGVycl9mcmVlX25ldGRldjsKKworICAgICAgICAgc3RhdHVzID0gaGRkX3JlZ2lzdGVyX2ludGVyZmFjZSggcEFkYXB0ZXIsIHJ0bmxfaGVsZCApOworICAgICAgICAgaWYoIFZPU19TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMgKQorICAgICAgICAgeworI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgICAgICAgICAgICBtdXRleF9sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworI2VuZGlmCisgICAgICAgICAgICBoZGRfZGVpbml0X2FkYXB0ZXIocEhkZEN0eCwgcEFkYXB0ZXIsIHJ0bmxfaGVsZCk7CisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICAgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyNlbmRpZgorICAgICAgICAgICAgZ290byBlc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ICovCisgICAgICAgICAgICAgdm9zX2luaXRfZGVsYXllZF93b3JrKCZwQWRhcHRlci0+cm9jX3dvcmssCisgICAgICAgICAgICAgICAgICAgICBoZGRfcDJwX3JvY193b3JrX3F1ZXVlKTsKKyAgICAgICAgIH0KKworICAgICAgICAgYnJlYWs7CisgICAgICB9CisKKyAgICAgIGNhc2UgV0xBTl9IRERfUDJQX0dPOgorICAgICAgY2FzZSBXTEFOX0hERF9TT0ZUQVA6CisgICAgICB7CisgICAgICAgICBwQWRhcHRlciA9IGhkZF93bGFuX2NyZWF0ZV9hcF9kZXYoIHBIZGRDdHgsIG1hY0FkZHIsICh0QU5JX1U4ICopaWZhY2VfbmFtZSApOworICAgICAgICAgaWYoIE5VTEwgPT0gcEFkYXB0ZXIgKQorICAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgRkwoImZhaWxlZCB0byBhbGxvY2F0ZSBhZGFwdGVyIGZvciBzZXNzaW9uICVkIiksIHNlc3Npb25fdHlwZSk7CisgICAgICAgICAgICByZXR1cm4gTlVMTDsKKyAgICAgICAgIH0KKworICAgICAgICAgcEFkYXB0ZXItPndkZXYuaWZ0eXBlID0gKHNlc3Npb25fdHlwZSA9PSBXTEFOX0hERF9TT0ZUQVApID8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOTDgwMjExX0lGVFlQRV9BUDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOTDgwMjExX0lGVFlQRV9QMlBfR087CisgICAgICAgICBwQWRhcHRlci0+ZGV2aWNlX21vZGUgPSBzZXNzaW9uX3R5cGU7CisKKyAgICAgICAgIGhkZF9pbml0aWFsaXplX2FkYXB0ZXJfY29tbW9uKHBBZGFwdGVyKTsKKyAgICAgICAgIHN0YXR1cyA9IGhkZF9pbml0X2FwX21vZGUocEFkYXB0ZXIpOworICAgICAgICAgaWYoIFZPU19TVEFUVVNfU1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UDJQX0dPID09IHNlc3Npb25fdHlwZSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgICAvKiBJbml0aWFsaXplIHRoZSB3b3JrIHF1ZXVlIHRvCisgICAgICAgICAgICAgICogZGVmZXIgdGhlIGJhY2sgdG8gYmFjayBSb0MgcmVxdWVzdCAqLworICAgICAgICAgICAgIElOSVRfREVMQVlFRF9XT1JLKCZwQWRhcHRlci0+cm9jX3dvcmssCisgICAgICAgICAgICAgICAgICAgICBoZGRfcDJwX3JvY193b3JrX3F1ZXVlKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXTEFOX0hERF9NT05JVE9SOgorICAgICAgeworICAgICAgICAgcEFkYXB0ZXIgPSBoZGRfYWxsb2Nfc3RhdGlvbl9hZGFwdGVyKCBwSGRkQ3R4LCBtYWNBZGRyLCBpZmFjZV9uYW1lICk7CisgICAgICAgICBpZiggTlVMTCA9PSBwQWRhcHRlciApCisgICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICBGTCgiZmFpbGVkIHRvIGFsbG9jYXRlIGFkYXB0ZXIgZm9yIHNlc3Npb24gJWQiKSwgc2Vzc2lvbl90eXBlKTsKKyAgICAgICAgICAgIHJldHVybiBOVUxMOworICAgICAgICAgfQorCisgICAgICAgICAvLyBSZWdpc3RlciB3aXJlbGVzcyBleHRlbnNpb25zCisgICAgICAgICBpZiggVk9TX1NUQVRVU19TVUNDRVNTICE9ICAoc3RhdHVzID0gaGRkX3JlZ2lzdGVyX3dleHQocEFkYXB0ZXItPmRldikpKQorICAgICAgICAgeworICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICJoZGRfcmVnaXN0ZXJfd2V4dCgpIGZhaWxlZCB3aXRoIHN0YXR1cyBjb2RlICUwOGQgW3glMDh4XSIsCisg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AgdGhlIEludGVyZmFjZSBUWCBxdWV1ZS4KKyAgICAgICAgIG5ldGlmX3R4X2Rpc2FibGUocEFkYXB0ZXItPmRldik7CisgICAgICAgICBuZXRpZl9jYXJyaWVyX29mZihwQWRhcHRlci0+ZGV2KTsKKyAgICAgIH0KKyAgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBXTEFOX0hERF9GVE06CisgICAgICB7CisgICAgICAgICBwQWRhcHRlciA9IGhkZF9hbGxvY19zdGF0aW9uX2FkYXB0ZXIoIHBIZGRDdHgsIG1hY0FkZHIsIGlmYWNlX25hbWUgKTsKKworICAgICAgICAgaWYoIE5VTEwgPT0gcEFkYXB0ZXIgKQorICAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgRkwoImZhaWxlZCB0byBhbGxvY2F0ZSBhZGFwdGVyIGZvciBzZXNzaW9uICVkIiksIHNlc3Npb25fdHlwZSk7CisgICAgICAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgICAgICB9CisKKyAgICAgICAgIC8qIEFzc2lnbiBOTDgwMjExX0lGVFlQRV9TVEFUSU9OIGFzIGludGVyZmFjZSB0eXBlIHRvIHJlc29sdmUgS2VybmVsIFdhcm5pbmcKKyAgICAgICAgICAqIG1lc3NhZ2Ugd2hpbGUgbG9hZGluZyBkcml2ZXIgaW4gRlRNIG1vZGUuICovCisgICAgICAgICBwQWRhcHRlci0+d2Rldi5pZnR5cGUgPSBOTDgwMjExX0lGVFlQRV9TVEFUSU9OOworICAgICAgICAgcEFkYXB0ZXItPmRldmljZV9tb2RlID0gc2Vzc2lvbl90eXBlOworICAgICAgICAgc3RhdHVzID0gaGRkX3JlZ2lzdGVyX2ludGVyZmFjZSggcEFkYXB0ZXIsIHJ0bmxfaGVsZCApOworCisgICAgICAgICBoZGRfaW5pdGlhbGl6ZV9hZGFwdGVyX2NvbW1vbihwQWRhcHRlcik7CisgICAgICAgICBoZGRfaW5pdF90eF9yeCggcEFkYXB0ZXIgKTsKKworICAgICAgICAgLy9TdG9wIHRoZSBJbnRlcmZhY2UgVFggcXVldWUuCisgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sIEZMKCJEaXNhYmxpbmcgcXVldWVzIikpOworICAgICAgICAgbmV0aWZfdHhfZGlzYWJsZShwQWRhcHRlci0+ZGV2KTsKKyAgICAgICAgIG5ldGlmX2NhcnJpZXJfb2ZmKHBBZGFwdGVyLT5kZXYpOworICAgICAgfQorICAgICAgICAgYnJlYWs7CisgICAgICBkZWZhdWx0OgorICAgICAgeworICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwiJXMgSW52YWxpZCBzZXNzaW9uIHR5cGUgJWQiLAorICAgICAgICAgICBfX2Z1bmNfXywgc2Vzc2lvbl90eXBlKTsKKyAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICByZXR1cm4gTlVMTDsKKyAgICAgIH0KKyAgIH0KKworICAgaWYoIFZPU19TVEFUVVNfU1VDQ0VTUyA9PSBzdGF0dXMgKQorICAgeworICAgICAgLy9BZGQgaXQgdG8gdGhlIGhkZCdzIHNlc3Npb24gbGlzdC4KKyAgICAgIHBIZGRBZGFwdGVyTm9kZSA9IHZvc19tZW1fbWFsbG9jKCBzaXplb2YoIGhkZF9hZGFwdGVyX2xpc3Rfbm9kZV90ICkgKTsKKyAgICAgIGlmKCBOVUxMID09IHBIZGRBZGFwdGVyTm9kZSApCisgICAgICB7CisgICAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX0VfTk9NRU07CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICBwSGRkQWRhcHRlck5vZGUtPnBBZGFwdGVyID0gcEFkYXB0ZXI7CisgICAgICAgICBzdGF0dXMgPSBoZGRfYWRkX2FkYXB0ZXJfYmFjayAoIHBIZGRDdHgsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQWRhcHRlck5vZGUgKTsKKyAgICAgIH0KKyAgIH0KKworICAgaWYoIFZPU19TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMgKQorICAgeworICAgICAgaWYoIE5VTEwgIT0gcEFkYXB0ZXIgKQorICAgICAgeworICAgICAgICAgaGRkX2NsZWFudXBfYWRhcHRlciggcEhkZEN0eCwgcEFkYXB0ZXIsIHJ0bmxfaGVsZCApOworICAgICAgICAgcEFkYXB0ZXIgPSBOVUxMOyAgIAorICAgICAgfQorICAgICAgaWYoIE5VTEwgIT0gcEhkZEFkYXB0ZXJOb2RlICkKKyAgICAgIHsKKyAgICAgICAgIHZvc19tZW1fZnJlZSggcEhkZEFkYXB0ZXJOb2RlICk7CisgICAgICB9CisKKyAgICAgIGdvdG8gcmVzdW1lX2JtcHM7CisgICB9CisKKyAgIGlmKFZPU19TVEFUVVNfU1VDQ0VTUyA9PSBzdGF0dXMpCisgICB7CisgICAgICB3bGFuX2hkZF9zZXRfY29uY3VycmVuY3lfbW9kZShwSGRkQ3R4LCBzZXNzaW9uX3R5cGUpOworCisgICAgICAvL0luaXRpYWxpemUgdGhlIFdvV0wgc2VydmljZQorICAgICAgaWYoIWhkZF9pbml0X3dvd2wocEFkYXB0ZXIpKQorICAgICAgeworICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsIiVzOiBoZGRfaW5pdF93b3dsIGZhaWxlZCIsX19mdW5jX18pOworICAgICAgICAgIGdvdG8gZXJyX2ZyZWVfbmV0ZGV2OworICAgICAgfQorICAgfQorICAgcmV0dXJuIHBBZGFwdGVyOworCitlcnJfZnJlZV9uZXRkZXY6CisgICBmcmVlX25ldGRldihwQWRhcHRlci0+ZGV2KTsKKyAgIHdsYW5faGRkX3JlbGVhc2VfaW50Zl9hZGRyKCBwSGRkQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5tYWNBZGRyZXNzQ3V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KQorICAgIHsKKyAgICAgICAgaGRkTG9nKExPR0UsCisgICAgICAgICAgICJDb3VsZCBub3QgcGFzcyBvbiBXTklfQ0ZHX1BST0JFX1JTUF9BREROSUVfREFUQTIgdG8gQ0NNIik7CisgICAgfQorCisgICAgaWYgKCBlSEFMX1NUQVRVU19GQUlMVVJFID09IGNjbUNmZ1NldFN0cigoV0xBTl9IRERfR0VUX0NUWChwSG9zdGFwZEFkYXB0ZXIpKS0+aEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX1BST0JFX1JTUF9BREROSUVfREFUQTMsICh0QU5JX1U4KilhZGRJRSwgMCwgTlVMTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQU5JX0JPT0xFQU5fRkFMU0UpICkKKyAgICB7CisgICAgICAgIGhkZExvZyhMT0dFLAorICAgICAgICAgICAiQ291bGQgbm90IHBhc3Mgb24gV05JX0NGR19QUk9CRV9SU1BfQURETklFX0RBVEEzIHRvIENDTSIpOworICAgIH0KK30KKworVk9TX1NUQVRVUyBoZGRfc3RvcF9hZGFwdGVyKCBoZGRfY29udGV4dF90ICpwSGRkQ3R4LCBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgdl9CT09MX3QgYkNsb3NlU2Vzc2lvbiApCit7CisgICBlSGFsU3RhdHVzIGhhbFN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICBoZGRfd2V4dF9zdGF0ZV90ICpwV2V4dFN0YXRlID0gV0xBTl9IRERfR0VUX1dFWFRfU1RBVEVfUFRSKHBBZGFwdGVyKTsKKyAgIGhkZF9zY2FuaW5mb190ICpwU2NhbkluZm8gPSBOVUxMOworICAgdW5pb24gaXdyZXFfZGF0YSB3cnF1OworICAgdl9VOF90IHJldHJ5ID0gMDsKKyAgIGxvbmcgcmV0OworICAgVk9TX1NUQVRVUyBzdGF0dXM7CisKKyAgIGlmIChwSGRkQ3R4LT5pc0xvZ3BJblByb2dyZXNzKSB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOkxPR1AgaW4gUHJvZ3Jlc3MuIElnbm9yZSEhISIsX19mdW5jX18pOworICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgIH0KKworICAgRU5URVIoKTsKKworICAgcFNjYW5JbmZvID0gICZwSGRkQ3R4LT5zY2FuX2luZm87CisgICBzd2l0Y2gocEFkYXB0ZXItPmRldmljZV9tb2RlKQorICAgeworICAgICAgY2FzZSBXTEFOX0hERF9JQlNTOgorICAgICAgICAgIGlmICggVk9TX1RSVUUgPT0gYkNsb3NlU2Vzc2lvbiApCisgICAgICAgICAgeworICAgICAgICAgICAgICBzdGF0dXMgPSBoZGRfc3RhX2lkX2hhc2hfZGV0YWNoKHBBZGFwdGVyKTsKKyAgICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICBGTCgic3RhIGlkIGhhc2ggZGV0YWNoIGZhaWxlZCIpKTsKKyAgICAgICAgICB9CisKKyAgICAgIGNhc2UgV0xBTl9IRERfSU5GUkFfU1RBVElPTjoKKyAgICAgIGNhc2UgV0xBTl9IRERfUDJQX0NMSUVOVDoKKyAgICAgIGNhc2UgV0xBTl9IRERfUDJQX0RFVklDRToKKyAgICAgIHsKKyAgICAgICAgIGhkZF9zdGF0aW9uX2N0eF90ICpwc3RhdGlvbiA9IFdMQU5fSEREX0dFVF9TVEFUSU9OX0NUWF9QVFIocEFkYXB0ZXIpOworI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgICAgICAgICBtdXRleF9sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgICAgICAgd2xhbl9oZGRfdGRsc19leGl0KHBBZGFwdGVyLCBUUlVFKTsKKyAgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyNlbmRpZgorICAgICAgICAgaWYoIGhkZF9jb25uSXNDb25uZWN0ZWQocHN0YXRpb24pIHx8CisgICAgICAgICAgICAgKHBzdGF0aW9uLT5jb25uX2luZm8uY29ublN0YXRlID09IGVDb25uZWN0aW9uU3RhdGVfQ29ubmVjdGluZykgKQorICAgICAgICAgeworICAgICAgICAgICAgaWYgKHBXZXh0U3RhdGUtPnJvYW1Qcm9maWxlLkJTU1R5cGUgPT0gZUNTUl9CU1NfVFlQRV9TVEFSVF9JQlNTKQorICAgICAgICAgICAgICAgIGhhbFN0YXR1cyA9IHNtZV9Sb2FtRGlzY29ubmVjdChwSGRkQ3R4LT5oSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfRElTQ09OTkVDVF9SRUFTT05fSUJTU19MRUFWRSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgaGFsU3RhdHVzID0gc21lX1JvYW1EaXNjb25uZWN0KHBIZGRDdHgtPmhIYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX0RJU0NPTk5FQ1RfUkVBU09OX1VOU1BFQ0lGSUVEKTsKKyAgICAgICAgICAgIC8vc3VjY2VzcyBpbXBsaWVzIGRpc2Nvbm5lY3QgY29tbWFuZCBnb3QgcXVldWVkIHVwIHN1Y2Nlc3NmdWxseQorICAgICAgICAgICAgaWYoaGFsU3RhdHVzID09IGVIQUxfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICByZXQgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGVfdGltZW91dCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBZGFwdGVyLT5kaXNjb25uZWN0X2NvbXBfdmFyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcyhXTEFOX1dBSVRfVElNRV9ESVNDT05ORUNUKSk7CisgICAgICAgICAgICAgICBpZiAocmV0IDw9IDApCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiB3YWl0IG9uIGRpc2Nvbm5lY3RfY29tcF92YXIgZmFpbGVkICVsZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcmV0KTsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIiVzOiBmYWlsZWQgdG8gcG9zdCBkaXNjb25uZWN0IGV2ZW50IHRvIFNNRSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbWVtc2V0KCZ3cnF1LCAnXDAnLCBzaXplb2Yod3JxdSkpOworICAgICAgICAgICAgd3JxdS5hcF9hZGRyLnNhX2ZhbWlseSA9IEFSUEhSRF9FVEhFUjsKKyAgICAgICAgICAgIG1lbXNldCh3cnF1LmFwX2FkZHIuc2FfZGF0YSwnXDAnLEVUSF9BTEVOKTsKKyAgICAgICAgICAgIHdpcmVsZXNzX3NlbmRfZXZlbnQocEFkYXB0ZXItPmRldiwgU0lPQ0dJV0FQLCAmd3JxdSwgTlVMTCk7CisgICAgICAgICB9CisgICAgICAgICBlbHNlIGlmKHBzdGF0aW9uLT5jb25uX2luZm8uY29ublN0YXRlID09CisgICAgICAgICAgICAgICAgICAgIGVDb25uZWN0aW9uU3RhdGVfRGlzY29ubmVjdGluZykKKyAgICAgICAgIHsKKyAgICAgICAgICAgICByZXQgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGVfdGltZW91dCgKKyAgICAgICAgICAgICAgICAgICAmcEFkYXB0ZXItPmRpc2Nvbm5lY3RfY29tcF92YXIsCisgICAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcyhXTEFOX1dBSVRfVElNRV9ESVNDT05ORUNUKSk7CisgICAgICAgICAgICAgaWYgKHJldCA8PSAwKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgRkwoIndhaXQgb24gZGlzY29ubmVjdF9jb21wX3ZhciBmYWlsZWQgJWxkIiksIHJldCk7CisgICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICAgICAgZWxzZSBpZihwU2NhbkluZm8gIT0gTlVMTCAmJiBwSGRkQ3R4LT5zY2FuX2luZm8ubVNjYW5QZW5kaW5nKQorICAgICAgICAgeworICAgICAgICAgICAgaGRkX2Fib3J0X21hY19zY2FuKHBIZGRDdHgsIHBTY2FuSW5mby0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfU0NBTl9BQk9SVF9ERUZBVUxUKTsKKyAgICAgICAgIH0KKyAgICAgICBpZiAoKHBBZGFwdGVyLT5kZXZpY2VfbW9kZSAhPSBXTEFOX0hERF9JTkZSQV9TVEFUSU9OKSAmJgorICAgICAgICAgICAgICAgICAgIChwQWRhcHRlci0+ZGV2aWNlX21vZGUgIT0gV0xBTl9IRERfSUJTUykpCisgICAgICAgeworICAgICAgICAgIHdoaWxlIChwQWRhcHRlci0+aXNfcm9jX2lucHJvZ3Jlc3MpCisgICAgICAgICAgeworICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFJPQyBpbiBwcm9ncmVzcyBmb3Igc2Vzc2lvbiAlZCEhISIsCisgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHBBZGFwdGVyLT5zZXNzaW9uSWQpOworICAgICAgICAgICAgICAvLyB3YWl0aW5nIGZvciBST0MgdG8gZXhwaXJlCisgICAgICAgICAgICAgICBtc2xlZXAoNTAwKTsKKyAgICAgICAgICAgICAgLyogSW4gR08gcHJlc2VudCBjYXNlICwgaWYgcmV0cnkgZXhjZWVkcyAzLAorICAgICAgICAgICAgICAgICBpdCBtZWFucyBzb21ldGhpbmcgd2VudCB3cm9uZy4gKi8KKyAgICAgICAgICAgICAgIGlmICggcmV0cnkrKyA+IE1BWF9XQUlUX0ZPUl9ST0NfQ09NUExFVElPTiApCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFJPQyBjb21wbGV0aW9uIGlzIG5vdCByZWNlaXZlZC4hISEiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPQorICAgICAgICAgICAgICAgICAgICAgIHNtZV9DYW5jZWxSZW1haW5PbkNoYW5uZWwoIFdMQU5fSEREX0dFVF9IQUxfQ1RYKCBwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQgKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiRmFpbGVkIHRvIENhbmNlbCBSZW1haW4gb24gQ2hhbm5lbCIpKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHdhaXRfZm9yX2NvbXBsZXRpb25faW50ZXJydXB0aWJsZV90aW1lb3V0KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBZGFwdGVyLT5jYW5jZWxfcmVtX29uX2NoYW5fdmFyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcyhXQUlUX0NBTkNFTF9SRU1fQ0hBTikpOworICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgdm9zX2ZsdXNoX2RlbGF5ZWRfd29yaygmcEFkYXB0ZXItPnJvY193b3JrKTsKKyAgICAgICB9CisjaWZkZWYgV0xBTl9OU19PRkZMT0FECisgICAgICAgICB2b3NfZmx1c2hfd29yaygmcEFkYXB0ZXItPmlwdjZOb3RpZmllcldvcmtRdWV1ZSk7CisjZW5kaWYKKworICAgICAgICAgdm9zX2ZsdXNoX3dvcmsoJnBBZGFwdGVyLT5pcHY0Tm90aWZpZXJXb3JrUXVldWUpOworCisgICAgICAgICAvKiBJdCBpcyBwb3NzaWJsZSB0aGF0IHRoZSBjYWxsZXIgb2YgdGhpcyBmdW5jdGlvbiBkb2VzIG5vdAorICAgICAgICAgICogd2lzaCB0byBjbG9zZSB0aGUgc2Vzc2lvbgorICAgICAgICAgICovCisgICAgICAgICBpZiAoVk9TX1RSVUUgPT0gYkNsb3NlU2Vzc2lvbiAmJgorICAgICAgICAgICAgICB0ZXN0X2JpdChTTUVfU0VTU0lPTl9PUEVORUQsICZwQWRhcHRlci0+ZXZlbnRfZmxhZ3MpKQorICAgICAgICAgeworICAgICAgICAgICAgSU5JVF9DT01QTEVUSU9OKHBBZGFwdGVyLT5zZXNzaW9uX2Nsb3NlX2NvbXBfdmFyKTsKKyAgICAgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTID09CisgICAgICAgICAgICAgICAgICBzbWVfQ2xvc2VTZXNzaW9uKHBIZGRDdHgtPmhIYWwsIHBBZGFwdGVyLT5zZXNzaW9uSWQsIFZPU19GQUxTRSwKKyAgICAgICAgICAgICAgICAgICAgIGhkZF9zbWVDbG9zZVNlc3Npb25DYWxsYmFjaywgcEFkYXB0ZXIpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyByZXQ7CisKKyAgICAgICAgICAgICAgIC8vQmxvY2sgb24gYSBjb21wbGV0aW9uIHZhcmlhYmxlLiBDYW4ndCB3YWl0IGZvcmV2ZXIgdGhvdWdoLgorICAgICAgICAgICAgICAgcmV0ID0gd2FpdF9mb3JfY29tcGxldGlvbl90aW1lb3V0KAorICAgICAgICAgICAgICAgICAgICAgJnBBZGFwdGVyLT5zZXNzaW9uX2Nsb3NlX2NvbXBfdmFyLAorICAgICAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcyhXTEFOX1dBSVRfVElNRV9TRVNTSU9OT1BFTkNMT1NFKSk7CisgICAgICAgICAgICAgICBpZiAoIDAgPj0gcmV0KQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsICIlczogZmFpbHVyZSB3YWl0aW5nIGZvciBzZXNzaW9uX2Nsb3NlX2NvbXBfdmFyICVsZCIsCisgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcmV0KTsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIFdMQU5fSEREX1NPRlRBUDoKKyAgICAgIGNhc2UgV0xBTl9IRERfUDJQX0dPOgorICAgICAgICAgIGlmICggVk9TX1RSVUUgPT0gYkNsb3NlU2Vzc2lvbiApCisgICAgICAgICAgeworICAgICAgICAgICAgICBzdGF0dXMgPSBoZGRfc3RhX2lkX2hhc2hfZGV0YWNoKHBBZGFwdGVyKTsKKyAgICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICBGTCgic3RhIGlkIGhhc2ggZGV0YWNoIGZhaWxlZCIpKTsKKyAgICAgICAgICB9CisKKyAgICAgICAgIC8vQW55IHNvZnRhcCBzcGVjaWZpYyBjbGVhbnVwIGhlcmUuLi4KKyAgICAgICAgIGlmIChwQWRhcHRlci0+ZGV2aWNlX21vZGUgPT0gV0xBTl9IRERfUDJQX0dPKSB7CisgICAgICAgICAgICB3aGlsZSAocEFkYXB0ZXItPmlzX3JvY19pbnByb2dyZXNzKSB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFJPQyBpbiBwcm9ncmVzcyBmb3Igc2Vzc2lvbiAlZCEhISIsCisgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHBBZGFwdGVyLT5zZXNzaW9uSWQpOworICAgICAgICAgICAgICAgbXNsZWVwKDUwMCk7CisgICAgICAgICAgICAgICBpZiAoIHJldHJ5KysgPiBNQVhfV0FJVF9GT1JfUk9DX0NPTVBMRVRJT04gKSB7CisgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFJPQyBjb21wbGV0aW9uIGlzIG5vdCByZWNlaXZlZC4hISEiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgICBXTEFOU0FQX0NhbmNlbFJlbWFpbk9uQ2hhbm5lbCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcikpLT5wdm9zQ29udGV4dCk7CisgICAgICAgICAgICAgICAgICB3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGVfdGltZW91dCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwQWRhcHRlci0+Y2FuY2VsX3JlbV9vbl9jaGFuX3ZhciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoV0FJVF9DQU5DRUxfUkVNX0NIQU4pKTsKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICB2b3NfZmx1c2hfZGVsYXllZF93b3JrKCZwQWRhcHRlci0+cm9jX3dvcmspOworICAgICAgICAgfQorICAgICAgICAgbXV0ZXhfbG9jaygmcEhkZEN0eC0+c2FwX2xvY2spOworICAgICAgICAgaWYgKHRlc3RfYml0KFNPRlRBUF9CU1NfU1RBUlRFRCwgJnBBZGFwdGVyLT5ldmVudF9mbGFncykpIAorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1NUQVRVUyBzdGF0dXM7CisgICAgICAgICAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisKKyAgICAgICAgICAgIC8vU3RvcCBCc3MuCisgICAgICAgICAgICBzdGF0dXMgPSBXTEFOU0FQX1N0b3BCc3MocEhkZEN0eC0+cHZvc0NvbnRleHQpOworICAgICAgICAgICAgaWYgKFZPU19JU19TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgaGRkX2hvc3RhcGRfc3RhdGVfdCAqcEhvc3RhcGRTdGF0ZSA9IAorICAgICAgICAgICAgICAgICAgV0xBTl9IRERfR0VUX0hPU1RBUF9TVEFURV9QVFIocEFkYXB0ZXIpOworCisgICAgICAgICAgICAgICBzdGF0dXMgPSB2b3Nfd2FpdF9zaW5nbGVfZXZlbnQoJnBIb3N0YXBkU3RhdGUtPnZvc0V2ZW50LCAxMDAwMCk7CisgICAKKyAgICAgICAgICAgICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIiVzOiBmYWlsdXJlIHdhaXRpbmcgZm9yIFdMQU5TQVBfU3RvcEJzcyAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHN0YXR1cyk7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIiVzOiBmYWlsdXJlIGluIFdMQU5TQVBfU3RvcEJzcyIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGNsZWFyX2JpdChTT0ZUQVBfQlNTX1NUQVJURUQsICZwQWRhcHRlci0+ZXZlbnRfZmxhZ3MpOworICAgICAgICAgICAgd2xhbl9oZGRfZGVjcl9hY3RpdmVfc2Vzc2lvbihwSGRkQ3R4LCBwQWRhcHRlci0+ZGV2aWNlX21vZGUpOworCisgICAgICAgICAgICBpZiAoZUhBTF9TVEFUVVNfRkFJTFVSRSA9PQorICAgICAgICAgICAgICAgIGNjbUNmZ1NldEludChwSGRkQ3R4LT5oSGFsLCBXTklfQ0ZHX1BST0JFX1JTUF9CQ05fQURETklFX0ZMQUcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsIE5VTEwsIGVBTklfQk9PTEVBTl9GQUxTRSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IEZhaWxlZCB0byBzZXQgV05JX0NGR19QUk9CRV9SU1BfQkNOX0FERE5JRV9GTEFHIiwKKyAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICggZUhBTF9TVEFUVVNfRkFJTFVSRSA9PSBjY21DZmdTZXRJbnQoKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+aEhhbCwKKyAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfQVNTT0NfUlNQX0FERE5JRV9GTEFHLCAwLCBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgZUFOSV9CT09MRUFOX0ZBTFNFKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICJDb3VsZCBub3QgcGFzcyBvbiBXTklfQ0ZHX0FTU09DX1JTUF9BREROSUVfRkxBRyB0byBDQ00iKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gUmVzZXQgV05JX0NGR19QUk9CRV9SU1AgRmxhZ3MKKyAgICAgICAgICAgIHdsYW5faGRkX3Jlc2V0X3Byb2JfcnNwaWVzKHBBZGFwdGVyKTsKKyAgICAgICAgICAgIGtmcmVlKHBBZGFwdGVyLT5zZXNzaW9uQ3R4LmFwLmJlYWNvbik7CisgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbkN0eC5hcC5iZWFjb24gPSBOVUxMOworICAgICAgICAgfQorICAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT5zYXBfbG9jayk7CisgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBXTEFOX0hERF9N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9DTElFTlQ6CisgICAgICAgICBjYXNlIFdMQU5fSEREX1AyUF9ERVZJQ0U6CisKKyAgICAgICAgICAgIGNvbm5TdGF0ZSA9IChXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKSktPmNvbm5faW5mby5jb25uU3RhdGU7CisKKyAgICAgICAgICAgIGhkZF9pbml0X3N0YXRpb25fbW9kZShwQWRhcHRlcik7CisKKyAgICAgICAgICAgIC8qIE9wZW4gdGhlIGdhdGVzIGZvciBIREQgdG8gcmVjZWl2ZSBXZXh0IGNvbW1hbmRzICovCisgICAgICAgICAgICBwQWRhcHRlci0+aXNMaW5rVXBTdmNOZWVkZWQgPSBGQUxTRTsgCisgICAgICAgICAgICBwSGRkQ3R4LT5zY2FuX2luZm8ubVNjYW5QZW5kaW5nID0gRkFMU0U7CisgICAgICAgICAgICBwSGRkQ3R4LT5zY2FuX2luZm8ud2FpdFNjYW5SZXN1bHQgPSBGQUxTRTsKKworICAgICAgICAgICAgLy9UcmlnZ2VyIHRoZSBpbml0aWFsIHNjYW4KKyAgICAgICAgICAgIGlmICghcEhkZEN0eC0+aXNMb2dwSW5Qcm9ncmVzcykKKyAgICAgICAgICAgICAgICBoZGRfd2xhbl9pbml0aWFsX3NjYW4ocEFkYXB0ZXIpOworCisgICAgICAgICAgICAvL0luZGljYXRlIGRpc2Nvbm5lY3QgZXZlbnQgdG8gc3VwcGxpY2FudCBpZiBhc3NvY2lhdGVkIHByZXZpb3VzbHkKKyAgICAgICAgICAgIGlmIChlQ29ubmVjdGlvblN0YXRlX0Fzc29jaWF0ZWQgPT0gY29ublN0YXRlIHx8CisgICAgICAgICAgICAgICAgZUNvbm5lY3Rpb25TdGF0ZV9JYnNzQ29ubmVjdGVkID09IGNvbm5TdGF0ZSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhIHdycXU7CisgICAgICAgICAgICAgICBtZW1zZXQoJndycXUsICdcMCcsIHNpemVvZih3cnF1KSk7CisgICAgICAgICAgICAgICB3cnF1LmFwX2FkZHIuc2FfZmFtaWx5ID0gQVJQSFJEX0VUSEVSOworICAgICAgICAgICAgICAgbWVtc2V0KHdycXUuYXBfYWRkci5zYV9kYXRhLCdcMCcsRVRIX0FMRU4pOworICAgICAgICAgICAgICAgd2lyZWxlc3Nfc2VuZF9ldmVudChwQWRhcHRlci0+ZGV2LCBTSU9DR0lXQVAsICZ3cnF1LCBOVUxMKTsKKyAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uQ3R4LnN0YXRpb24uaGRkX1JlYXNzb2NTY2VuYXJpbyA9IFZPU19GQUxTRTsKKworICAgICAgICAgICAgICAgLyogaW5kaWNhdGUgZGlzY29ubmVjdGVkIGV2ZW50IHRvIG5sODAyMTEgKi8KKyAgICAgICAgICAgICAgIGNmZzgwMjExX2Rpc2Nvbm5lY3RlZChwQWRhcHRlci0+ZGV2LCBXTEFOX1JFQVNPTl9VTlNQRUNJRklFRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLCAwLCBHRlBfS0VSTkVMKTsgCisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChlQ29ubmVjdGlvblN0YXRlX0Nvbm5lY3RpbmcgPT0gY29ublN0YXRlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgKiBJbmRpY2F0ZSBjb25uZWN0IGZhaWx1cmUgdG8gc3VwcGxpY2FudCBpZiB3ZSB3ZXJlIGluIHRoZQorICAgICAgICAgICAgICAgKiBwcm9jZXNzIG9mIGNvbm5lY3RpbmcKKyAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICBjZmc4MDIxMV9jb25uZWN0X3Jlc3VsdChwQWRhcHRlci0+ZGV2LCBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwgMCwgTlVMTCwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5fU1RBVFVTX0FTU09DX0RFTklFRF9VTlNQRUMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHRlBfS0VSTkVMKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICBjYXNlIFdMQU5fSEREX1NPRlRBUDoKKyAgICAgICAgICAgIC8qIHNvZnRBUCBjYW4gaGFuZGxlIFNTUiAqLworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgIGNhc2UgV0xBTl9IRERfUDJQX0dPOgorICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzIFtTU1JdIHNlbmQgc3RvcCBhcCB0byBzdXBwbGljYW50IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgICBjZmc4MDIxMV9hcF9zdG9wcGVkKHBBZGFwdGVyLT5kZXYsIEdGUF9LRVJORUwpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgIGNhc2UgV0xBTl9IRERfTU9OSVRPUjoKKyAgICAgICAgICAgIC8qIG1vbml0b3IgaW50ZXJmYWNlIHN0YXJ0ICovCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBicmVhazsKKyAgICAgIH0KKworICAgICAgc3RhdHVzID0gaGRkX2dldF9uZXh0X2FkYXB0ZXIgKCBwSGRkQ3R4LCBwQWRhcHRlck5vZGUsICZwTmV4dCApOworICAgICAgcEFkYXB0ZXJOb2RlID0gcE5leHQ7CisgICB9CisKKyAgIEVYSVQoKTsKKworICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworVk9TX1NUQVRVUyBoZGRfcmVjb25uZWN0X2FsbF9hZGFwdGVycyggaGRkX2NvbnRleHRfdCAqc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Q3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhkZF9hZGFwdGVyX2xpc3Rfbm9kZV90KiogcHBBZGFwdGVyTm9kZSkKK3sKKyAgICBWT1NfU1RBVFVTIHN0YXR1czsKKyAgICBzcGluX2xvY2tfYmgoJnBIZGRDdHgtPmhkZEFkYXB0ZXJzLmxvY2spOworICAgIHN0YXR1cyA9ICBoZGRfbGlzdF9wZWVrX2Zyb250ICggJnBIZGRDdHgtPmhkZEFkYXB0ZXJzLAorICAgICAgICAgICAgICAgICAgIChoZGRfbGlzdF9ub2RlX3QqKikgcHBBZGFwdGVyTm9kZSApOworICAgIHNwaW5fdW5sb2NrX2JoKCZwSGRkQ3R4LT5oZGRBZGFwdGVycy5sb2NrKTsKKyAgICByZXR1cm4gc3RhdHVzOworfQorCitWT1NfU1RBVFVTIGhkZF9nZXRfbmV4dF9hZGFwdGVyKCBoZGRfY29udGV4dF90ICpwSGRkQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGRkX2FkYXB0ZXJfbGlzdF9ub2RlX3QqIHBBZGFwdGVyTm9kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhkZF9hZGFwdGVyX2xpc3Rfbm9kZV90KiogcE5leHRBZGFwdGVyTm9kZSkKK3sKKyAgICBWT1NfU1RBVFVTIHN0YXR1czsKKyAgICBzcGluX2xvY2tfYmgoJnBIZGRDdHgtPmhkZEFkYXB0ZXJzLmxvY2spOworICAgIHN0YXR1cyA9IGhkZF9saXN0X3BlZWtfbmV4dCAoICZwSGRkQ3R4LT5oZGRBZGFwdGVycywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaGRkX2xpc3Rfbm9kZV90KikgcEFkYXB0ZXJOb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChoZGRfbGlzdF9ub2RlX3QqKilwTmV4dEFkYXB0ZXJOb2RlICk7CisKKyAgICBzcGluX3VubG9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orICAtIHNrYiAtIFBvaW50ZXIgdG8gT1MgcGFja2V0IChza19idWZmKS4KKyAgXHJldHVybiAtIHN1Y2Nlc3MvZmFpbAorCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KK3N0YXRpYyB2b2lkIF9faGRkX3NldF9tdWx0aWNhc3RfbGlzdChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQoreworICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXI7CisgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgaW50IG1jX2NvdW50OworICAgaW50IGkgPSAwLCByZXQgPSAwOworICAgc3RydWN0IG5ldGRldl9od19hZGRyICpoYTsKKworICAgRU5URVIoKTsKKworICAgcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgeworICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICIlczogQWRhcHRlciBjb250ZXh0IGlzIE51bGwiLCBfX2Z1bmNfXyk7CisgICAgICByZXR1cm47CisgICB9CisgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgaWYgKDAgIT0gcmV0KQorICAgeworICAgICAgIHJldHVybjsKKyAgIH0KKyAgIGlmIChkZXYtPmZsYWdzICYgSUZGX0FMTE1VTFRJKQorICAgeworICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgIiVzOiBhbGxvdyBhbGwgbXVsdGljYXN0IGZyYW1lcyIsIF9fZnVuY19fKTsKKyAgICAgIHBBZGFwdGVyLT5tY19hZGRyX2xpc3QubWNfY250ID0gMDsKKyAgIH0KKyAgIGVsc2UKKyAgIHsKKyAgICAgIG1jX2NvdW50ID0gbmV0ZGV2X21jX2NvdW50KGRldik7CisgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAiJXM6IG1jX2NvdW50ID0gJXUiLCBfX2Z1bmNfXywgbWNfY291bnQpOworICAgICAgaWYgKG1jX2NvdW50ID4gV0xBTl9IRERfTUFYX01DX0FERFJfTElTVCkKKyAgICAgIHsKKyAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICIlczogTm8gZnJlZSBmaWx0ZXIgYXZhaWxhYmxlOyBhbGxvdyBhbGwgbXVsdGljYXN0IGZyYW1lcyIsIF9fZnVuY19fKTsKKyAgICAgICAgIHBBZGFwdGVyLT5tY19hZGRyX2xpc3QubWNfY250ID0gMDsKKyAgICAgICAgIHJldHVybjsKKyAgICAgIH0KKworICAgICAgcEFkYXB0ZXItPm1jX2FkZHJfbGlzdC5tY19jbnQgPSBtY19jb3VudDsKKworICAgICAgbmV0ZGV2X2Zvcl9lYWNoX21jX2FkZHIoaGEsIGRldikgeworICAgICAgICAgaWYgKGkgPT0gbWNfY291bnQpCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIG1lbXNldCgmKHBBZGFwdGVyLT5tY19hZGRyX2xpc3QuYWRkcltpXVswXSksIDAsIEVUSF9BTEVOKTsKKyAgICAgICAgIG1lbWNweSgmKHBBZGFwdGVyLT5tY19hZGRyX2xpc3QuYWRkcltpXVswXSksIGhhLT5hZGRyLCBFVEhfQUxFTik7CisgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczogbWxpc3RbJWRdID0gIk1BQ19BRERSRVNTX1NUUiwKKyAgICAgICAgICAgICAgIF9fZnVuY19fLCBpLAorICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEFkYXB0ZXItP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KyAgICAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF9tb25fcG9zdE1zZygmbWFnaWMsICZjbXBWYXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNb25DdHgsIGhkZF9tb25Qb3N0TXNnQ2IpKSB7CisgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJmYWlsZWQgdG8gcG9zdCBNT04gTU9ERSBSRVEiKSk7CisgICAgICAgICAgICAgcE1vbkN0eC0+c3RhdGUgPSBNT05fTU9ERV9TVEFSVDsKKyAgICAgICAgICAgICBtYWdpYyA9IDA7CisgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIHJldCA9IHdhaXRfZm9yX2NvbXBsZXRpb25fdGltZW91dCgmY21wVmFyLCBNT05fTU9ERV9NU0dfVElNRU9VVCk7CisgICAgICAgIG1hZ2ljID0gMDsKKyAgICAgICAgaWYgKHJldCA8PSAwICkgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgIEZMKCJ0aW1lb3V0IG9uIG1vbml0b3IgbW9kZSBjb21wbGV0aW9uICVsZCIpLCByZXQpOworICAgICAgICB9CisgICAgfQorCisgICBoZGRfVW5yZWdpc3RlcldleHQocEFkYXB0ZXItPmRldik7CisKKyAgIHZvc19tb25fc3RvcCggcFZvc0NvbnRleHQgKTsKKworICAgdm9zU3RhdHVzID0gdm9zX3NjaGVkX2Nsb3NlKCBwVm9zQ29udGV4dCApOworICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zU3RhdHVzKSkgICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MR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hY2Ugc3RhdHVzIGFzICJkb3duIiBmb3Igb3V0c2lkZSB3b3JsZCAqLworICAgICAgICAgICAgbmV0aWZfY2Fycmllcl9vZmYocEFkYXB0ZXItPmRldik7CisKKyAgICAgICAgICAgIC8qIERlSW5pdCB0aGUgYWRhcHRlci4gVGhpcyBlbnN1cmVzIHRoYXQgYWxsIGRhdGEgcGFja2V0cworICAgICAgICAgICAgICogYXJlIGZyZWVkLgorICAgICAgICAgICAgICovCisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICAgICAgICAgIG11dGV4X2xvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisjZW5kaWYKKyAgICAgICAgICAgIGhkZF9kZWluaXRfYWRhcHRlcihwSGRkQ3R4LCBwQWRhcHRlciwgRkFMU0UpOworI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgICAgICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisjZW5kaWYKKworICAgICAgICAgICAgaWYgKFdMQU5fSEREX0lORlJBX1NUQVRJT04gPT0gIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSB8fAorICAgICAgICAgICAgICAgIFdMQU5fSEREX1AyUF9DTElFTlQgPT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHdsYW5faGRkX2NmZzgwMjExX2RlcmVnaXN0ZXJfZnJhbWVzKHBBZGFwdGVyKTsKKyAgICAgICAgICAgICAgICBoZGRfVW5yZWdpc3RlcldleHQocEFkYXB0ZXItPmRldik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgIH0KKyAgICAgICAgIHZvc1N0YXR1cyA9IGhkZF9nZXRfbmV4dF9hZGFwdGVyICggcEhkZEN0eCwgcEFkYXB0ZXJOb2RlLCAmcE5leHQgKTsKKyAgICAgICAgIHBBZGFwdGVyTm9kZSA9IHBOZXh0OworICAgICAgfQorCisgICAgICAgLy9QdXJnZSBhbGwg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BhcmUgYWJvdXQgdG8gUmVxdWVzdCBGdWxsIFBvd2VyLCBhbmQgc2luY2UgdGhhdCBpcworICAgICAgLy8gc3luY2hyb25pemVkLCB0aGUgZXhwZWN0YXRpb24gaXMgdGhhdCBieSB0aGUgdGltZSBSZXF1ZXN0IEZ1bGwKKyAgICAgIC8vIFBvd2VyIGhhcyBjb21wbGV0ZWQgYWxsIHNjYW5zIHdpbGwgYmUgY2FuY2VsbGVkLgorICAgICAgaWYgKHBIZGRDdHgtPnNjYW5faW5mby5tU2NhblBlbmRpbmcpCisgICAgICB7CisgICAgICAgICAgaWYoTlVMTCAhPSBwQWRhcHRlcikKKyAgICAgICAgICB7CisgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICBGTCgiYWJvcnQgc2NhbiBtb2RlOiAlZCBzZXNzaW9uSWQ6ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCk7CisgICAgICAgICAgfQorICAgICAgICAgIGhkZF9hYm9ydF9tYWNfc2NhbihwSGRkQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT5zY2FuX2luZm8uc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1NDQU5fQUJPUlRfREVGQVVMVCk7CisgICAgICB9CisgICB9CisgICBlbHNlCisgICB7CisgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sIiVzOiBGVE0gTU9ERSIsX19mdW5jX18pOworICAgICAgaWYgKHBIZGRDdHgtPmZ0bS5mdG1fc3RhdGUgPT0gV0xBTl9GVE1fU1RBUlRJTkcpCisgICAgICB7CisgICAgICAgICBJTklUX0NPTVBMRVRJT04ocEhkZEN0eC0+ZnRtLnN0YXJ0Q21wVmFyKTsKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICIlczogaW4gbWlkZGxlIG9mIEZUTSBTVEFSVCIsIF9fZnVuY19fKTsKKyAgICAgICAgIGxyYyA9IHdhaXRfZm9yX2NvbXBsZXRpb25fdGltZW91dCgmcEhkZEN0eC0+ZnRtLnN0YXJ0Q21wVmFyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcygyMDAwMCkpOworICAgICAgICAgaWYoIWxyYykKKyAgICAgICAgIHsKKyAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICIlczogdGltZWRvdXQgb24gZnRtU3RhcnRDbXBWYXIgZmF0YWwgZXJyb3IiLCBfX2Z1bmNfXyk7CisgICAgICAgICB9CisgICAgICB9CisgICAgICB3bGFuX2hkZF9mdG1fY2xvc2UocEhkZEN0eCk7CisgICAgICBnb3RvIGZyZWVfaGRkX2N0eDsKKyAgIH0KKworICAgLyogRGVSZWdpc3RlciB3aXRoIHBsYXRmb3JtIGRyaXZlciBhcyBjbGllbnQgZm9yIFN1c3BlbmQvUmVzdW1lICovCisgICB2b3NTdGF0dXMgPSBoZGREZXJlZ2lzdGVyUG1PcHMocEhkZEN0eCk7CisgICBpZiAoICFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIHZvc1N0YXR1cyApICkKKyAgIHsKKyAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsIiVzOiBoZGREZXJlZ2lzdGVyUG1PcHMgZmFpbGVkIixfX2Z1bmNfXyk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgfQorCisgICB2b3NTdGF0dXMgPSBoZGREZXZUbVVucmVnaXN0ZXJOb3RpZnlDYWxsYm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RnJvbU5WW21hY0xvb3BdKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIm5vdCB2YWxpZCBNQUMgZnJvbSBOViBmb3IgJWQiLCBtYWNMb29wKTsKKyAgICAgICAgICAgIC8qIFRoaXMgTUFDIGlzIG5vdCB2YWxpZCwgc2tpcCBpdAorICAgICAgICAgICAgICogVGhpcyBNQUMgd2lsbCBiZSBnb3QgZnJvbSBpbmkgZmlsZSAqLworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCh2X1U4X3QgKikmcEhkZEN0eC0+Y2ZnX2luaS0+aW50Zk1hY0FkZHJbbWFjTG9vcF0uYnl0ZXNbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgKHZfVThfdCAqKSZtYWNGcm9tTlZbbWFjTG9vcF0uYnl0ZXNbMF0sCisgICAgICAgICAgICAgICAgICAgVk9TX01BQ19BRERSX1NJWkUpOworICAgICAgICAgfQorICAgICAgfQorICAgfQorICAgZWxzZQorICAgeworICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIk5WIElURU0sIE1BQyBOb3QgdmFsaWQiKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgIH0KKworCisgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfQorCisvKiotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICBcYnJpZWYgaGRkX3Bvc3Rfdm9zc19zdGFydF9jb25maWcoKSAtIEhERCBwb3N0IHZvc3Mgc3RhcnQgY29uZmlnIGhlbHBlcgorCisgIFxwYXJhbSAgLSBwQWRhcHRlciAtIFBvaW50ZXIgdG8gdGhlIEhERAorCisgIFxyZXR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Npb25UeXBlIHZlcnNpb25SZXBvcnRlZDsKKyAgIHRTaXJWZXJzaW9uU3RyaW5nIHZlcnNpb25TdHJpbmc7CisgICB0QU5JX1U4IGZ3RmVhdENhcHNNc2dTdXBwb3J0ZWQgPSAwOworICAgVk9TX1NUQVRVUyB2c3RhdHVzOworCisgICBtZW1zZXQoJnZlcnNpb25Db21waWxlZCwgMCwgc2l6ZW9mKHZlcnNpb25Db21waWxlZCkpOworICAgbWVtc2V0KCZ2ZXJzaW9uUmVwb3J0ZWQsIDAsIHNpemVvZih2ZXJzaW9uUmVwb3J0ZWQpKTsKKworICAgLyogcmV0cmlldmUgYW5kIGRpc3BsYXkgV0NOU1MgdmVyc2lvbiBpbmZvcm1hdGlvbiAqLworICAgZG8geworCisgICAgICB2c3RhdHVzID0gc21lX0dldFdjbnNzV2xhbkNvbXBpbGVkVmVyc2lvbihwSGRkQ3R4LT5oSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnZlcnNpb25Db21waWxlZCk7CisgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2c3RhdHVzKSkKKyAgICAgIHsKKyAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgIiVzOiB1bmFibGUgdG8gcmV0cmlldmUgV0NOU1MgV0xBTiBjb21waWxlZCB2ZXJzaW9uIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKworICAgICAgdnN0YXR1cyA9IHNtZV9HZXRXY25zc1dsYW5SZXBvcnRlZFZlcnNpb24ocEhkZEN0eC0+aEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ2ZXJzaW9uUmVwb3J0ZWQpOworICAgICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1ModnN0YXR1cykpCisgICAgICB7CisgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICIlczogdW5hYmxlIHRvIHJldHJpZXZlIFdDTlNTIFdMQU4gcmVwb3J0ZWQgdmVyc2lvbiIsCisgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisKKyAgICAgIGlmICgodmVyc2lvbkNvbXBpbGVkLm1ham9yICE9IHZlcnNpb25SZXBvcnRlZC5tYWpvcikgfHwKKyAgICAgICAgICAodmVyc2lvbkNvbXBpbGVkLm1pbm9yICE9IHZlcnNpb25SZXBvcnRlZC5taW5vcikgfHwKKyAgICAgICAgICAodmVyc2lvbkNvbXBpbGVkLnZlcnNpb24gIT0gdmVyc2lvblJlcG9ydGVkLnZlcnNpb24pIHx8CisgICAgICAgICAgKHZlcnNpb25Db21waWxlZC5yZXZpc2lvbiAhPSB2ZXJzaW9uUmVwb3J0ZWQucmV2aXNpb24pKQorICAgICAgeworICAgICAgICAgcHJfZXJyKCIlczogV0NOU1MgV0xBTiBWZXJzaW9uICV1LiV1LiV1LiV1LCAiCisgICAgICAgICAgICAgICAgIkhvc3QgZXhwZWN0ZWQgJXUuJXUuJXUuJXVcbiIsCisgICAgICAgICAgICAgICAgV0xBTl9NT0RVTEVfTkFNRSwKKyAgICAgICAgICAgICAgICAoaW50KXZlcnNpb25SZXBvcnRlZC5tYWpvciwKKyAgICAgICAgICAgICAgICAoaW50KXZlcnNpb25SZXBvcnRlZC5taW5vciwKKyAgICAgICAgICAgICAgICAoaW50KXZlcnNpb25SZXBvcnRlZC52ZXJzaW9uLAorICAgICAgICAgICAgICAgIChpbnQpdmVyc2lvblJlcG9ydGVkLnJldmlzaW9uLAorICAgICAgICAgICAgICAgIChpbnQpdmVyc2lvbkNvbXBpbGVkLm1ham9yLAorICAgICAgICAgICAgICAgIChpbnQpdmVyc2lvbkNvbXBpbGVkLm1pbm9yLAorICAgICAgICAgICAgICAgIChpbnQpdmVyc2lvbkNvbXBpbGVkLnZlcnNpb24sCisgICAgICAgICAgICAgICAgKGludCl2ZXJzaW9uQ29tcGlsZWQucmV2aXNpb24pOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgcHJfaW5mbygiJXM6IFdDTlNTIFdMQU4gdmVyc2lvbiAldS4ldS4ldS4ldVxuIiwKKyAgICAgICAgICAgICAgICAgV0xBTl9NT0RVTEVfTkFNRSwKKyAgICAgICAgICAgICAgICAgKGludCl2ZXJzaW9uUmVwb3J0ZWQubWFqb3IsCisgICAgICAgICAgICAgICAgIChpbnQpdmVyc2lvblJlcG9ydGVkLm1pbm9yLAorICAgICAgICAgICAgICAgICAoaW50KXZlcnNpb25SZXBvcnRlZC52ZXJzaW9uLAorICAgICAgICAgICAgICAgICAoaW50KXZlcnNpb25SZXBvcnRlZC5yZXZpc2lvbik7CisgICAgICB9CisKKyAgICAgIHZzdGF0dXMgPSBzbWVfR2V0V2Nuc3NTb2Z0d2FyZVZlcnNpb24ocEhkZEN0eC0+aEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmVyc2lvblN0cmluZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHZlcnNpb25TdHJpbmcpKTsKKyAgICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZzdGF0dXMpKQorICAgICAgeworICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAiJXM6IHVuYWJsZSB0byByZXRyaWV2ZSBXQ05TUyBzb2Z0d2FyZSB2ZXJzaW9uIHN0cmluZyIsCisgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisKKyAgICAgIHByX2luZm8oIiVzOiBXQ05TUyBzb2Z0d2FyZSB2ZXJzaW9uICVzXG4iLAorICAgICAgICAgICAgICBXTEFOX01PRFVMRV9OQU1FLCB2ZXJzaW9uU3RyaW5nKTsKKworICAgICAgdnN0YXR1cyA9IHNtZV9HZXRXY25zc0hhcmR3YXJlVmVyc2lvbihwSGRkQ3R4LT5oSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJzaW9uU3RyaW5nLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodmVyc2lvblN0cmluZykpOworICAgICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1ModnN0YXR1cykpCisgICAgICB7CisgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICIlczogdW5hYmxlIHRvIHJldHJpZXZlIFdDTlNTIGhhcmR3YXJlIHZlcnNpb24gc3RyaW5nIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKworICAgICAgcHJfaW5mbygiJXM6IFdDTlNTIGhhcmR3YXJlIHZlcnNpb24gJXNcbiIsCisgICAgICAgICAgICAgIFdMQU5fTU9EVUxFX05BTUUsIHZlcnNpb25TdHJpbmcpOworCisgICAgICAvKiAxLkNoZWNrIGlmIEZXIHZlcnNpb24gaXMgZ3JlYXRlciB0aGFuIDAuMS4xLjAuIE9ubHkgdGhlbiBzZW5kIGhvc3QtRlcgY2FwYWJpbGl0eSBleGNoYW5nZSBtZXNzYWdlIAorICAgICAgICAgMi5Ib3N0LUZXIGNhcGFiaWxpdHkgZXhjaGFuZ2UgbWVzc2FnZSAgaXMgb25seSBwcmVzZW50IG9uIHJpdmEgMS4xIHNvIAorICAgICAgICAgICAgc2VuZCB0aGUgbWVzc2FnZSBvbmx5IGlmIGl0IHRoZSByaXZhIGlzIDEuMQorICAgICAgICAgICAgbWlub3IgbnVtYmVycyBmb3IgZGlmZmVyZW50IHJpdmEgYnJhbmNoZX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fQorCisgICAgICAgICBzbWVfZmVhdHVyZUNhcHNFeGNoYW5nZShwSGRkQ3R4LT5oSGFsKTsKKyAgICAgIH0KKworICAgfSB3aGlsZSAoMCk7CisKK30KK3ZvaWQgd2xhbl9oZGRfc2VuZF9zdmNfbmxpbmtfbXNnKGludCB0eXBlLCB2b2lkICpkYXRhLCBpbnQgbGVuKQoreworICAgICAgIHN0cnVjdCBza19idWZmICpza2I7CisgICAgICAgc3RydWN0IG5sbXNnaGRyICpubGg7CisgICAgICAgdEFuaU1zZ0hkciAqYW5pX2hkcjsKKyAgICAgICBpbnQgZmxhZ3MgPSBHRlBfS0VSTkVMOworICAgICAgIHZvaWQgKm5sX2RhdGEgPSBOVUxMOworCisgICAgICAgaWYgKGluX2ludGVycnVwdCgpIHx8IGlycXNfZGlzYWJsZWQoKSB8fCBpbl9hdG9taWMoKSkKKyAgICAgICAgICAgZmxhZ3MgPSBHRlBfQVRPTUlDOworCisgICAgICAgc2tiID0gYWxsb2Nfc2tiKE5MTVNHX1NQQUNFKFdMQU5fTkxfTUFYX1BBWUxPQUQpLCBmbGFncyk7CisKKyAgICAgICBpZihza2IgPT0gTlVMTCkgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBhbGxvY19za2IgZmFpbGVkIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgIH0KKworICAgICAgIG5saCA9IChzdHJ1Y3Qgbmxtc2doZHIgKilza2ItPmRhdGE7CisgICAgICAgbmxoLT5ubG1zZ19waWQgPSAwOyAgLyogZnJvbSBrZXJuZWwgKi8KKyAgICAgICBubGgtPm5sbXNnX2ZsYWdzID0gMDsKKyAgICAgICBubGgtPm5sbXNnX3NlcSA9IDA7CisgICAgICAgbmxoLT5ubG1zZ190eXBlID0gV0xBTl9OTF9NU0dfU1ZDOworCisgICAgICAgYW5pX2hkciA9IE5MTVNHX0RBVEEobmxoKTsKKyAgICAgICBhbmlfaGRyLT50eXBlID0gdHlwZTsKKworICAgICAgIHN3aXRjaCh0eXBlKSB7CisgICAgICAgICAgICAgICBjYXNlIFdMQU5fU1ZDX1NBUF9SRVNUQVJUX0lORDoKKyAgICAgICAgICAgICAgICAgICAgICAgYW5pX2hkci0+bGVuZ3RoID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgbmxoLT5ubG1zZ19sZW4gPSBOTE1TR19MRU5HVEgoKHNpemVvZih0QW5pTXNnSGRyKSkpOworICAgICAgICAgICAgICAgICAgICAgICBza2JfcHV0KHNrYiwgTkxNU0dfU1BBQ0Uoc2l6ZW9mKHRBbmlNc2dIZHIpKSk7CisgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgY2FzZSBXTEFOX01TR19SUFNfRU5BQkxFX0lORDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuaV9oZHItPmxlbmd0aCA9IGxlbjsKKyAgICAgICAgICAgICAgICAgICAgICAgIG5saC0+bmxtc2dfbGVuID0gTkxNU0dfTEVOR1RIKChzaXplb2YodEFuaU1zZ0hkcikgKyBsZW4pKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG5sX2RhdGEgPSAoY2hhciAqKWFuaV9oZHIgKyBzaXplb2YodEFuaU1zZ0hkcik7CisgICAgICAgICAgICAgICAgICAgICAgICBtZW1jcHkobmxfZGF0YSwgZGF0YSwgbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNrYl9wdXQoc2tiLCBOTE1TR19TUEFDRShzaXplb2YodEFuaU1zZ0hkcikgKyBsZW4pKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRU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0cyA1R2h6IiwgX19mdW5jX18pOworICAgICAgcmV0dXJuIHRydWU7CisgICB9CisgICBlbHNlCisgICB7CisgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczogSGFyZHdhcmUgZG9lc24ndCBzdXBwb3J0cyA1R2h6IiwKKyAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgcmV0dXJuIGZhbHNlOworICAgfQorfQorCisvKiotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICBcYnJpZWYgaGRkX2dlbmVyYXRlX2lmYWNlX21hY19hZGRyX2F1dG8oKSAtIEhERCBNYWMgSW50ZXJmYWNlIEF1dG8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZW5lcmF0ZSBmdW5jdGlvbgorCisgIFRoaXMgaXMgZ2VuZXJhdGUgdGhlIHJhbmRvbSBtYWMgYWRkcmVzcyBmb3IgV0xBTiBpbnRlcmZhY2UKKworICBccGFyYW0gIC0gcEhkZEN0eCAgLSBQb2ludGVyIHRvIEhERCBjb250ZXh0CisgICAgICAgICAgICBpZHggICAgICAtIFN0YXJ0IGludGVyZmFjZSBpbmRleCB0byBnZXQgYXV0bworICAgICAgICAgICAgICAgICAgICAgICBnZW5lcmF0ZWQgbWFjIGFkZHIuCisgICAgICAgICAgICBtYWNfYWRkciAtIE1hYyBhZGRyZXNzCisKKyAgXHJldHVybiAtICAwIGZvciBzdWNjZXNzLCA8IDAgZm9yIGZhaWx1cmUKKworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisKK3N0YXRpYyBpbnQgaGRkX2dlbmVyYXRlX2lmYWNlX21hY19hZGRyX2F1dG8oaGRkX2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2dldF9nbG9iYWxfY29udGV4dChWT1NfTU9EVUxFX0lEX1NZUywgTlVMTCk7CisKKyAgICBpZiAoTlVMTCA9PSBwVm9zQ29udGV4dCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIiVzOiBUcnlpbmcgdG8gb3BlbiBWT1NTIHdpdGhvdXQgYSBQcmVPcGVuIiwgX19mdW5jX18pOworICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgfQorCisgICBzdGF0dXMgPSB2b3NfbnZfb3BlbigpOworICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgIHsKKyAgICAgICAvKiBOViBtb2R1bGUgY2Fubm90IGJlIGluaXRpYWxpemVkICovCisgICAgICAgaGRkTG9nKCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgIiVzOiB2b3NfbnZfb3BlbiBmYWlsZWQiLCBfX2Z1bmNfXyk7CisgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgfQorCisgICBzdGF0dXMgPSB2b3NfaW5pdF93aXBoeV9mcm9tX252X2JpbigpOworICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgIHsKKyAgICAgICAvKiBOViBtb2R1bGUgY2Fubm90IGJlIGluaXRpYWxpemVkICovCisgICAgICAgaGRkTG9nKCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAiJXM6IHZvc19pbml0X3dpcGh5IGZhaWxlZCIsIF9fZnVuY19fKTsKKyAgICAgICBnb3RvIGVycl92b3NfbnZfY2xvc2U7CisgICB9CisKKyAgIHN0YXR1cyA9IHZvc19vcGVuKCAm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AgICAqLworICAgaWYgKDEgPT0gcEhkZEN0eC0+Y2ZnX2luaS0+ZkVuYWJsZVNOUk1vbml0b3JpbmcpCisgICB7CisgICAgICAvKiBUaGUgbG9nIGxldmVsIGlzIGRlbGliZXJhdGVseSBzZXQgdG8gV0FSTiBhcyBvdmVycmlkaW5nCisgICAgICAgKiBudGhCZWFjb25GaWx0ZXIgdG8gMSB3aWxsIGluY3JlYXNlIHBvd2VyIGNvc3VtcHRpb24gYW5kIHRoaXMKKyAgICAgICAqIG1pZ2h0IGp1c3QgcHJvdmUgaGVscGZ1bCB0byBkZXRlY3QgdGhlIHBvd2VyIGlzc3VlLgorICAgICAgICovCisgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgIiVzOiBTZXR0aW5nIHBIZGRDdHgtPmNmZ19pbmktPm50aEJlYWNvbkZpbHRlciA9IDEiLCBfX2Z1bmNfXyk7CisgICAgICBwSGRkQ3R4LT5jZmdfaW5pLT5udGhCZWFjb25GaWx0ZXIgPSAxOworICAgfQorICAgLyoKKyAgICAqIGNmZzgwMjExOiBJbml0aWFsaXphdGlvbiAgLi4uCisgICAgKi8KKyAgIGlmIChWT1NfRlRNX01PREUgIT0gaGRkX2dldF9jb25wYXJhbSgpKQorICAgeworICAgICAgaWYgKDAgPCB3bGFuX2hkZF9jZmc4MDIxMV9pbml0KGRldiwgd2lwaHksIHBIZGRDdHgtPmNmZ19pbmkpKQorICAgICAgeworICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgIiVzOiB3bGFuX2hkZF9jZmc4MDIxMV9pbml0IHJldHVybiBmYWlsdXJlIiwgX19mdW5jX18pOworICAgICAgICAgZ290byBlcnJfY29uZmlnOworICAgICAgfQorICAgfQorCisgICAvLyBVcGRhdGUgVk9TIHRyYWNlIGxldmVscyBiYXNlZCB1cG9uIHRoZSBjZmcuaW5pCisgICBoZGRfdm9zX3RyYWNlX2VuYWJsZShWT1NfTU9EVUxFX0lEX0JBUCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPmNmZ19pbmktPnZvc1RyYWNlRW5hYmxlQkFQKTsKKyAgIGhkZF92b3NfdHJhY2VfZW5hYmxlKFZPU19NT0RVTEVfSURfVEwsCisgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT5jZmdfaW5pLT52b3NUcmFjZUVuYWJsZVRMKTsKKyAgIGhkZF92b3NfdHJhY2VfZW5hYmxlKFZPU19NT0RVTEVfSURfV0RJLAorICAgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+Y2ZnX2luaS0+dm9zVHJhY2VFbmFibGVXREkpOworICAgaGRkX3Zvc190cmFjZV9lbmFibGUoVk9TX01PRFVMRV9JRF9IREQsCisgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT5jZmdfaW5pLT52b3NUcmFjZUVuYWJsZUhERCk7CisgICBoZGRfdm9zX3RyYWNlX2VuYWJsZShWT1NfTU9EVUxFX0lEX1NNRSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPmNmZ19pbmktPnZvc1RyYWNlRW5hYmxlU01FKTsKKyAgIGhkZF92b3NfdHJhY2VfZW5hYmxlKFZPU19NT0RVTEVfSURfUEUsCisgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT5jZmdfaW5pLT52b3NUcmFjZUVuYWJsZVBFKTsKKyAgIGhkZF92b3NfdHJhY2VfZW5hYmxlKFZPU19NT0RVTEVfSURfUE1DLAorICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPmNmZ19pbmktPnZvc1RyYWNlRW5hYmxlUE1DKTsKKyAgIGhkZF92b3NfdHJhY2VfZW5hYmxlKFZPU19NT0RVTEVfSURfV0RBLAorICAgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+Y2ZnX2luaS0+dm9zVHJhY2VFbmFibGVXREEpOworICAgaG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gdXBvbiB0aGUgZGV2aWNlIHNlcmlhbCBudW1iZXIgKi8KKworICAgICAgc3RhdGljIGNvbnN0IHZfTUFDQUREUl90IGRlZmF1bHRfYWRkcmVzcyA9CisgICAgICAgICB7ezB4MDAsIDB4MEEsIDB4RjUsIDB4ODksIDB4ODksIDB4RkZ9fTsKKworICAgICAgaWYgKDAgPT0gbWVtY21wKCZkZWZhdWx0X2FkZHJlc3MsICZwSGRkQ3R4LT5jZmdfaW5pLT5pbnRmTWFjQWRkclswXSwKKyAgICAgICAgICAgICAgICAgICBzaXplb2YoZGVmYXVsdF9hZGRyZXNzKSkpCisgICAgICB7CisgICAgICAgICAvKiBjZmcuaW5pIGhhcyB0aGUgZGVmYXVsdCBhZGRyZXNzLCBpbnZva2UgYXV0b2dlbiBsb2dpYyAqLworCisgICAgICAgICAvKiBIZXJlLCBwYXNzaW5nIEFyZzIgYXMgMCBiZWNhdXNlIHdlIHdhbnQgdG8gY2hhbmdlIHRoZQorICAgICAgICAgICAgbGFzdCAzIGJ5dGVzIChtZWFucyBub24gT1VJIGJ5dGVzKSBvZiBhbGwgdGhlIGludGVyZmFjZXMKKyAgICAgICAgICAgIG1hYyBhZGRyLgorICAgICAgICAgICovCisgICAgICAgICBpZiAoMCAhPSBoZGRfZ2VuZXJhdGVfaWZhY2VfbWFjX2FkZHJfYXV0byhwSGRkQ3R4LCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdF9hZGRyZXNzKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgIiVzOiBGYWlsZWQgdG8gZ2VuZXJhdGUgd2xhbiBpbnRlcmZhY2UgbWFjIGFkZHIgIgorICAgICAgICAgICAgICAgICAgICJ1c2luZyBNQUMgZnJvbSBpbmkgZmlsZSAiIE1BQ19BRERSRVNTX1NUUiw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gb2YgdGhlIGRldmljZSdzCisgICAgICAgICAgICAgICAgICogcHJpbWFyeSBNQUMgYWRkcmVzcyB3aXRoIHRoZSBsb2NhbGx5IGFkbWluaXN0ZXJlZCBiaXQgc2V0LgorICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgcEhkZEN0eC0+cDJwRGV2aWNlQWRkcmVzcy5ieXRlc1swXSB8PSAweDAyOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgIHRBTklfVTgqIHAycF9kZXZfYWRkciA9IHdsYW5faGRkX2dldF9pbnRmX2FkZHIocEhkZEN0eCk7CisgICAgICAgICAgICAgaWYgKHAycF9kZXZfYWRkciAhPSBOVUxMKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwSGRkQ3R4LT5wMnBEZXZpY2VBZGRyZXNzLmJ5dGVzWzBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwMnBfZGV2X2FkZHIsIFZPU19NQUNfQUREUl9TSVpFKTsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBGYWlsZWQgdG8gYWxsb2NhdGUgbWFjX2FkZHJlc3MgZm9yIHAycF9kZXZpY2UiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICAgICBnb3RvIGVycl9jbG9zZV9hZGFwdGVyOworICAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKworICAgICAgICAgcFAycEFkYXB0ZXIgPSBoZGRfb3Blbl9hZGFwdGVyKCBwSGRkQ3R4LCBXTEFOX0hERF9QMlBfREVWSUNFLCAicDJwJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBIZGRDdHgtPnAycERldmljZUFkZHJlc3MuYnl0ZXNbMF0sIEZBTFNFICk7CisgICAgICAgICBpZiAoIE5VTEwgPT0gcFAycEFkYXB0ZXIgKQorICAgICAgICAgeworICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgIiVzOiBGYWlsZWQgdG8gZG8gaGRkX29wZW5fYWRhcHRlciBmb3IgUDJQIERldmljZSBJbnRlcmZhY2UiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgICAgICBnb3RvIGVycl9jbG9zZV9hZGFwdGVyOworICAgICAgICAgfQorICAgICB9CisgICB9CisKKyAgIGlmKCBwQWRhcHRlciA9PSBOVUxMICkKKyAgIHsKKyAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogaGRkX29wZW5fYWRhcHRlciBmYWlsZWQiLCBfX2Z1bmNfXyk7CisgICAgICBnb3RvIGVycl9jbG9zZV9hZGFwdGVyOworICAgfQorCisgICBpZiAoY291bnRyeV9jb2RlKQorICAgeworICAgICAgZUhhbFN0YXR1cyByZXQ7CisgICAgICBJTklUX0NPTVBMRVRJT04ocEFkYXB0ZXItPmNoYW5nZV9jb3VudHJ5X2NvZGUpOworICAgICAgaGRkX2NoZWNrYW5kdXBkYXRlX2Rmc3NldHRpbmcocEFkYXB0ZXIsIGNvdW50cnlfY29kZSk7CisjaWZuZGVmIENPTkZJR19FTkFCTEVfTElOVVhfUkVHCisgICAgICBoZGRfY2hlY2thbmR1cGRhdGVfcGh5bW9kZShwQWRhcHRlciwgY291bnRyeV9jb2RlKTsKKyNlbmRpZgorICAgICAgcmV0ID0gc21lX0NoYW5nZUNvdW50cnlDb2RlKHBIZGRDdHgtPmhIYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKikodFNtZUNoYW5nZUNvdW50cnlDYWxsYmFjaykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF9jaGFuZ2VfY291bnRyeV9jb2RlX2NhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50cnlfY29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlciwgcEhkZEN0eC0+cHZvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9UUlVFLCBlU0lSX1RSVUUpOworICAgICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgPT0gcmV0KQorICAgICAgeworICAgICAgICAgcmV0ID0gd2FpdF9mb3JfY29tcGxldGlvbl9pbnRlcnJ1cHRpYmxlX3RpbWVvdXQoCisgICAgICAgICAgICAgICAgICAgICAgICZwQWRhcHRlci0+Y2hhbmdlX2NvdW50cnlfY29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcyhXTEFOX1dBSVRfVElNRV9DT1VOVFJZKSk7CisKKyAgICAgICAgIGlmICgwID49IHJldCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IFNNRSB3aGlsZSBzZXR0aW5nIGNvdW50cnkgY29kZSB0aW1lZCBvdXQiLCBfX2Z1bmNfXyk7CisgICAgICAgICB9CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgIiVzOiBTTUUgQ2hhbmdlIENvdW50cnkgY29kZSBmcm9tIG1vZHVsZSBwYXJhbSBmYWlsIHJldD0lZCIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHJldCk7CisgICAgICB9Cisg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3QxMSBtb2RlICovCisgICBzbWVfU2V0RGVmRG90MTFNb2RlKHBIZGRDdHgtPmhIYWwpOworCisjaWZuZGVmIENPTkZJR19FTkFCTEVfTElOVVhfUkVHCisgICAvKnVwZGF0aW5nIHdpcGh5IHNvIHRoYXQgcmVndWxhdG9yeSB1c2VyIGhpbnRzIGNhbiBiZSBwcm9jZXNzZWQqLworICAgaWYgKHdpcGh5KQorICAgeworICAgICAgIHJlZ3VsYXRvcnlfaGludCh3aXBoeSwgIjAwIik7CisgICB9CisjZW5kaWYKKyAgIC8vIEluaXRpYWxpemUgdGhlIHJlc3RhcnQgbG9naWMKKyAgIHdsYW5faGRkX3Jlc3RhcnRfaW5pdChwSGRkQ3R4KTsKKworICAgLy9SZWdpc3RlciB0aGUgdHJhZmZpYyBtb25pdG9yIHRpbWVyIG5vdworICAgaWYgKCBwSGRkQ3R4LT5jZmdfaW5pLT5keW5TcGxpdHNjYW4pCisgICB7CisgICAgICAgdm9zX3RpbWVyX2luaXQoJnBIZGRDdHgtPnR4X3J4X3RyYWZmaWNUbXIsCisgICAgICAgICAgICAgICAgICAgICBWT1NfVElNRVJfVFlQRV9TVywKKyAgICAgICAgICAgICAgICAgICAgIGhkZF90eF9yeF9wa3RfY250X3N0YXRfdGltZXJfaGFuZGxlciwKKyAgICAgICAgICAgICAgICAgICAgICh2b2lkICopcEhkZEN0eCk7CisgICB9CisgICB3bGFuX2hkZF9jZmc4MDIxMV9uYW5faW5pdChwSGRkQ3R4KTsKKworI2lmZGVmIFdMQU5fRkVBVFVSRV9FWFRTQ0FOCisgICAgc21lX0VYVFNjYW5SZWdpc3RlckNhbGxiYWNrKHBIZGRDdHgtPmhIYWwsCisgICAgICAgICAgICB3bGFuX2hkZF9jZmc4MDIxMV9leHRzY2FuX2NhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eCk7CisjZW5kaWYgLyogV0xBTl9GRUFUVVJFX0VYVFNDQU4gKi8KKworI2lmZGVmIF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JnBWb3NDb250ZXh0KTsKKworICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgIHsKKyAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsIiVzOiBGYWlsZWQgdG8gcHJlT3BlbiBWT1NTIiwgX19mdW5jX18pOworICAgICAgICAgcmV0X3N0YXR1cyA9IC0xOworICAgICAgICAgYnJlYWs7CisgICB9CisKKyAgIGhkZFRyYWNlSW5pdCgpOworI2lmbmRlZiBNT0RVTEUKKyAgICAgIC8qIEZvciBzdGF0aWNhbGx5IGxpbmtlZCBkcml2ZXIsIGNhbGwgaGRkX3NldF9jb25wYXJhbSB0byB1cGRhdGUgY3Vycl9jb25fbW9kZQorICAgICAgICovCisgICAgICBoZGRfc2V0X2NvbnBhcmFtKCh2X1VJTlRfdCljb25fbW9kZSk7CisjZW5kaWYKKworICAgICAgLy8gQ2FsbCBvdXIgbWFpbiBpbml0IGZ1bmN0aW9uCisgICAgICBpZiAoaGRkX3dsYW5fc3RhcnR1cChkZXYpKQorICAgICAgeworICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwiJXM6IFdMQU4gRHJpdmVyIEluaXRpYWxpemF0aW9uIGZhaWxlZCIsCisgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgdm9zX3ByZUNsb3NlKCAmcFZvc0NvbnRleHQgKTsKKyAgICAgICAgIHJldF9zdGF0dXMgPSAtMTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorCisgICB9IHdoaWxlICgwKTsKKworICAgaWYgKDAgIT0gcmV0X3N0YXR1cykKKyAgIHsKKyNpZmRlZiBUSU1FUl9NQU5BR0VSCisgICAgICB2b3NfdGltZXJfZXhpdCgpOworI2VuZGlmCisjaWZkZWYgTUVNT1JZX0RFQlVHCisgICAgICB2b3NfbWVtX2V4aXQoKTsKKyNlbmRpZgorICAgICAgdm9zX3dha2VfbG9ja19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gIGVsc2UKKyAgIHsKKyAgICAgIC8qIFdlIHdhaXQgZm9yIGFjdGl2ZSBlbnRyeSB0aHJlYWRzIHRvIGV4aXQgZnJvbSBkcml2ZXIKKyAgICAgICAqIGJ5IHdhaXRpbmcgdW50aWwgcnRubF9sb2NrIGlzIGF2YWlsYWJsZS4KKyAgICAgICAqLworICAgICAgcnRubF9sb2NrKCk7CisgICAgICBydG5sX3VubG9jaygpOworCisgICAgICBJTklUX0NPTVBMRVRJT04ocEhkZEN0eC0+c3NyX2NvbXBfdmFyKTsKKyAgICAgIGlmICgocEhkZEN0eC0+aXNMb2dwSW5Qcm9ncmVzcykgJiYgKEZBTFNFID09CisgICAgICAgICAgICAgICAgICB2b3NfaXNfd2xhbl9pbl9iYWRTdGF0ZShWT1NfTU9EVUxFX0lEX0hERCwgTlVMTCkpKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICIlczpTU1IgIGluIFByb2dyZXNzOyBibG9jayBybW1vZCAhISEiLCBfX2Z1bmNfXyk7CisgICAgICAgICByYyA9IHdhaXRfZm9yX2NvbXBsZXRpb25fdGltZW91dCgmcEhkZEN0eC0+c3NyX2NvbXBfdmFyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcygzMDAwMCkpOworICAgICAgICAgaWYoIXJjKQorICAgICAgICAgeworICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgIiVzOlNTUiB0aW1lZG91dCwgZmF0YWwgZXJyb3IiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgIFZPU19CVUcoMCk7CisgICAgICAgICB9CisgICAgICB9CisKKyAgICAgIHBIZGRDdHgtPmlzTG9hZFVubG9hZEluUHJvZ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VBUFNECisgICAgICAgICAgICAgICAgICAmJiAgcG1jU3RhdGUgIT0gU1RPUFBFRCAmJiBwbWNTdGF0ZSAhPSBTVEFOREJZICYmCisgICAgICAgICAgICAgICAgICAgICAgcG1jU3RhdGUgIT0gV09XTCkpIHx8CisgICAgICAgICAgICAgICAgIChlQU5JX0JPT0xFQU5fVFJVRSA9PSBzY2FuUnNwUGVuZGluZykgfHwKKyAgICAgICAgICAgICAgICAgKGVBTklfQk9PTEVBTl9UUlVFID09IGluTWlkZGxlT2ZSb2FtaW5nKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZihwbWNTdGF0ZSA9PSBGVUxMX1BPV0VSICYmCisgICAgICAgICAgICAgICAgICAgc21lX0lzQ29leFNjb0luZGljYXRpb25TZXQocEhkZEN0eC0+aEhhbCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAgICAgKiBXaGVuIFNDTyBpbmRpY2F0aW9uIGNvbWVzIGZyb20gQ29leCBtb2R1bGUgLCBob3N0IHdpbGwKKyAgICAgICAgICAgICAgICAgICAgICogZW50ZXIgaW4gdG8gZnVsbCBwb3dlciBtb2RlLCBidXQgdGhpcyBzaG91bGQgbm90IHByZXZlbnQKKyAgICAgICAgICAgICAgICAgICAgICogYXBwcyBwcm9jZXNzb3IgcG93ZXIgY29sbGFwc2UuCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HMSwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIkFsbG93IGFwcHMgcG93ZXIgY29sbGFwc2UiCisgICAgICAgICAgICAgICAgICAgICAgICAgICJldmVuIHdoZW4gc2NvIGluZGljYXRpb24gaXMgc2V0IikpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gVFJVRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaGRkTG9nKCBMT0dFLCAiJXM6IGRvIG5vdC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gsIHRWT1NfQ09OX01PREUgbW9kZSkKK3sKKyAgIHN3aXRjaChtb2RlKQorICAgeworICAgICAgIGNhc2UgVk9TX1NUQV9NT0RFOgorICAgICAgIGNhc2UgVk9TX1AyUF9DTElFTlRfTU9ERToKKyAgICAgICBjYXNlIFZPU19QMlBfR09fTU9ERToKKyAgICAgICBjYXNlIFZPU19TVEFfU0FQX01PREU6CisgICAgICAgICAgICBwSGRkQ3R4LT5jb25jdXJyZW5jeV9tb2RlIHw9ICgxIDw8IG1vZGUpOworICAgICAgICAgICAgcEhkZEN0eC0+bm9fb2Zfb3Blbl9zZXNzaW9uc1ttb2RlXSsrOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGJyZWFrOworICAgfQorICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCBGTCgiY29uY3VycmVuY3lfbW9kZSA9IDB4JXggIgorICAgICAgICAgICJOdW1iZXIgb2Ygb3BlbiBzZXNzaW9ucyBmb3IgbW9kZSAlZCA9ICVkIiksCisgICAgICAgICAgIHBIZGRDdHgtPmNvbmN1cnJlbmN5X21vZGUsIG1vZGUsCisgICAgICAgICAgIHBIZGRDdHgtPm5vX29mX29wZW5fc2Vzc2lvbnNbbW9kZV0pOworfQorCisKK3ZvaWQgd2xhbl9oZGRfY2xlYXJfY29uY3VycmVuY3lfbW9kZShoZGRfY29udGV4dF90ICpwSGRkQ3R4LCB0Vk9TX0NPTl9NT0RFIG1vZGUpCit7CisgICBzd2l0Y2gobW9kZSkKKyAgIHsKKyAgICAgICBjYXNlIFZPU19TVEFfTU9ERToKKyAgICAgICBjYXNlIFZPU19QMlBfQ0xJRU5UX01PREU6CisgICAgICAgY2FzZSBWT1NfUDJQX0dPX01PREU6CisgICAgICAgY2FzZSBWT1NfU1RBX1NBUF9NT0RFOgorICAgICAgICAgICAgcEhkZEN0eC0+bm9fb2Zfb3Blbl9zZXNzaW9uc1ttb2RlXS0tOworICAgIC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KyAgICAgICAgaWYgKGFib3J0U2NhblN0YXR1cyA9PSBlU0lSX0FCT1JUX0FDVElWRV9TQ0FOX0xJU1RfTk9UX0VNUFRZKQorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGVfdGltZW91dCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICZwU2NhbkluZm8tPmFib3J0c2Nhbl9ldmVudF92YXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKDUwMDApKTsKKyAgICAgICAgICAgIGlmICgwID49IHN0YXR1cykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogVGltZW91dCBvciBJbnRlcnJ1cHQgb2NjdXJyZWQgd2hpbGUgd2FpdGluZyBmb3IgYWJvcnQiCisgICAgICAgICAgICAgICAgICAic2Nhbiwgc3RhdHVzLSAlbGQiLCBfX2Z1bmNfXywgc3RhdHVzKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVUSU1FRE9VVDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChhYm9ydFNjYW5TdGF0dXMgPT0gZVNJUl9BQk9SVF9TQ0FOX0ZBSUxVUkUpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgIEZMKCJoZGRfYWJvcnRfbWFjX3NjYW4gZmFpbGVkIikpOworICAgICAgICAgICAgcmV0dXJuIC1WT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gMDsKK30KKworLyoqCisgKiBoZGRf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ZF9nZXRfYWRhcHRlcl9ieV9zbWVfc2Vzc2lvbl9pZChoZGRfY3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVfaW5kLT5zZXNzaW9uSWQpOworCisgICBpZiAoKE5VTEwgIT0gYWRhcHRlcikgJiYKKyAgICAgICAgKFdMQU5fSEREX0FEQVBURVJfTUFHSUMgPT0gYWRhcHRlci0+bWFnaWMpKQorICAgICAgX19oZGRfaW5kaWNhdGVfbWdtdF9mcmFtZShhZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZV9pbmQtPmZyYW1lTGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZV9pbmQtPmZyYW1lQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZV9pbmQtPmZyYW1lVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVfaW5kLT5yeENoYW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyYW1lX2luZC0+cnhSc3NpKTsKKyAgICByZXR1cm47CisKK30KKworVk9TX1NUQVRVUyB3bGFuX2hkZF9jYW5jZWxfcmVtYWluX29uX2NoYW5uZWwoaGRkX2NvbnRleHRfdCAqcEhkZEN0eCkKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcjsKKyAgICBoZGRfYWRhcHRlcl9saXN0X25vZGVfdCAqcEFkYXB0ZXJOb2RlID0gTlVMTCwgKnBOZXh0ID0gTlVMTDsKKyAgICBWT1NfU1RBVFVTIHZvc1N0YXR1czsKKworICAgIHZvc1N0YXR1cyA9IGhkZF9nZXRfZnJvbnRfYWRhcHRlciAoIHBIZGRDdHgsICZwQWRhcHRlck5vZGUgKTsKKyAgICB3aGlsZSAoTlVMTCAhPSBwQWRhcHRlck5vZGUgJiYgVk9TX1NUQVRVU19FX0VNUFRZICE9IHZvc1N0YXR1cykKKyAgICB7CisgICAgICAgIHBBZGFwdGVyID0gcEFkYXB0ZXJOb2RlLT5wQWRhcHRlcjsKKyAgICAgICAgaWYgKE5VTEwgIT0gcEFkYXB0ZXIpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChXTEFOX0hERF9QMlBfREVWSUNFID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSB8fAorICAgICAgICAgICAgICAgIFdMQU5fSEREX1AyUF9DTElFTlQgPT0gcEFkYXB0ZXItPmRldmljZV9tb2RlIHx8CisgICAgICAgICAgICAgICAgV0xBTl9IRERfUDJQX0dPID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coTE9HMSwgRkwoImFib3J0IFJPQyBkZXZpY2VNb2RlOiAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPmRldmljZV9tb2RlKTsKKyAgICAgICAgICAgICAgICBpZiAoVk9TX1NUQVRVU19TVUNDRVNTICE9CisgICAgICAgICAgICAgICAgICAgICAgIHdsYW5faGRkX2NhbmNlbF9leGlzdGluZ19yZW1haW5fb25fY2hhbm5lbChwQWRhcHRlcikpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgRkwoImZhaWxlZCB0byBhYm9ydCBST0MiKSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgdm9zU3RhdHVzID0gaGRkX2dldF9uZXh0X2FkYXB0ZXIgKCBwSGRkQ3R4LCBwQWRhcHRlck5vZGUsICZwTmV4dCApOworICAgICAgICBwQWRhcHRlck5vZGUgPSBwTmV4dDsKKyAgICB9CisgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworaGRkX3JlbWFpbl9vbl9jaGFu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fib3J0X21hY19zY2FuKHBIZGRDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT5zY2FuX2luZm8uc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9TQ0FOX0FCT1JUX0RFRkFVTFQpOworICAgIH0KKworICAgIGlmICghZGZzU2Nhbk1vZGUpCisgICAgeworICAgICAgICB2b3NTdGF0dXMgPSBoZGRfZ2V0X2Zyb250X2FkYXB0ZXIoIHBIZGRDdHgsICZwQWRhcHRlck5vZGUpOworICAgICAgICB3aGlsZSAoKE5VTEwgIT0gcEFkYXB0ZXJOb2RlKSAmJgorICAgICAgICAgICAgICAgKFZPU19TVEFUVVNfU1VDQ0VTUyA9PSB2b3NTdGF0dXMpKQorICAgICAgICB7CisgICAgICAgICAgICBwQWRhcHRlciA9IHBBZGFwdGVyTm9kZS0+cEFkYXB0ZXI7CisKKyAgICAgICAgICAgIGlmIChXTEFOX0hERF9JTkZSQV9TVEFUSU9OID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwSGRkU3RhQ3R4ID0gV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlcik7CisKKyAgICAgICAgICAgICAgICBpZighcEhkZFN0YUN0eCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsIEZMKCJIREQgU1RBIGNvbnRleHQgaXMgTnVsbCIpKTsKKyAgICAgICAgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvKiBpZiBTVEEgaXMgYWxyZWFkeSBjb25uZWN0ZWQgb24gREZTIGNoYW5uZWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc2Nvbm5lY3QgaW1tZWRpYXRlbHkqLworICAgICAgICAgICAgICAgIGlmIChoZGRfY29ubklzQ29ubmVjdGVkKHBIZGRTdGFDdHgpICYmCisgICAgICAgICAgICAgICAgICAgIChOVl9DSEFOTkVMX0RGUyA9PQorICAgICAgICAgICAgICAgICAgICAgdm9zX252X2dldENoYW5uZWxFbmFibGVkU3RhdGUoCisgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLm9wZXJhdGlvbkNoYW5uZWwpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IHNtZV9Sb2FtRGlzY29ubmVjdChwSGRkQ3R4LT5oSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX0RJU0NPTk5FQ1RfUkVBU09OX1VOU1BFQ0lGSUVEKTsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKExPRzEsIEZMKCJDbGllbnQgY29ubmVjdGVkIG9uIERGUyBjaGFubmVsICVkLCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJzbWVfUm9hbURpc2Nvbm5lY3QgcmV0dXJuZWQgd2l0aCBzdGF0dXM6ICVkIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgImZvciBzZXNzaW9uaWQ6ICVkIiksIHBIZGRTdGFDdHgtPmNvbm5faW5mby4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcGVyYXRpb25DaGFubmVsLCBzdGF0dXMsIHBBZGFwdGVyLT5zZXNzaW9uSWQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdm9zU3RhdHVzID0gaGRkX2dldF9uZXh0X2FkYXB0ZXIocEhkZEN0eCwgcEFkYXB0ZXJOb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwTmV4dCk7CisgICAgICAgICAgICBw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GFzaC5pZHhfYml0czsKKworICAgIC8qIGZyZWUgYWxsIHN0YXRpb24gaW5mbyovCisgICAgZm9yIChpID0gMDsgaSA8IGhhc2hfZWxlbTsgaSsrKSB7CisgICAgICAgIGhkZF9saXN0X3NpemUoJnBBZGFwdGVyLT5zdGFfaWRfaGFzaC5iaW5zW2ldLCAmc2l6ZSk7CisgICAgICAgIGlmIChzaXplICE9IDApIHsKKyAgICAgICAgICAgIFZPU19TVEFUVVMgc3RhdHVzOworICAgICAgICAgICAgaGRkX3N0YWlkX2hhc2hfbm9kZV90ICpzdGFfaW5mb19ub2RlID0gTlVMTDsKKyAgICAgICAgICAgIGhkZF9zdGFpZF9oYXNoX25vZGVfdCAqbmV4dF9ub2RlID0gTlVMTDsKKyAgICAgICAgICAgIHN0YXR1cyA9IGhkZF9saXN0X3BlZWtfZnJvbnQgKCAmcEFkYXB0ZXItPnN0YV9pZF9oYXNoLmJpbnNbaV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGhkZF9saXN0X25vZGVfdCoqKSAmc3RhX2luZm9fbm9kZSApOworCisgICAgICAgICAgICB3aGlsZSAoIE5VTEwgIT0gc3RhX2luZm9fbm9kZSAmJiBWT1NfU1RBVFVTX1NVQ0NFU1MgPT0gc3RhdHVzICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBoZGRfbGlzdF9yZW1vdmVfbm9kZSggJnBBZGFwdGVyLT5zdGFfaWRfaGFzaC5iaW5zW2ldLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmc3RhX2luZm9fbm9kZS0+bm9kZSk7CisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHN0YV9pbmZvX25vZGUpOworCisgICAgICAgICAgICAgICAgc3RhdHVzID0gaGRkX2xpc3RfcGVla19uZXh0ICgmcEFkYXB0ZXItPnN0YV9pZF9oYXNoLmJpbnNbaV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChoZGRfbGlzdF9ub2RlX3QqKXN0YV9pbmZvX25vZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChoZGRfbGlzdF9ub2RlX3QqKikmbmV4dF9ub2RlKTsKKyAgICAgICAgICAgICAgICBzdGFfaW5mb19ub2RlID0gbmV4dF9ub2RlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgdm9zX21lbV9mcmVlKHBBZGFwdGVyLT5zdGFfaWRfaGFzaC5iaW5zKTsKKyAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAiJXM6IFN0YXRpb24gSUQgSGFzaCBkZXRhY2hlZCBmb3Igc2Vzc2lvbiBpZCAlZCIsCisgICAgICAgICAgICAgIF9fZnVuY19fLCBwQWRhcHRlci0+c2Vzc2lvbklkKTsKKyAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfQorCisvKioKKyAqIGhkZF9zdGFfaWRfaGFzaF9jYWxjdWxhdGVfaW5kZXgoKSAtIGRlcml2ZSBpbmRleCBmcm9tIG1hY2FkZHIKKyAqIEBwQWRhcHRlcjogYWRhcHRlciBoYW5kbGUKKyAqIEBtYWNfYWRkcl9pbjogaW5wdXQgbWFjIGFkZHJlc3MKKyAqCisgKiBSZXR1cm46IGluZGV4IGRlcml2ZWQgZnJvbSBtYWMgYWRkcmVzcworICovCitpbnQgaGRkX3N0YV9pZF9oYXNoX2NhbGN1bGF0ZV9pbmRleChoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X01BQ0FERFJfdCAqbWFjX2FkZHJfaW4pCit7CisgICAgdWludDE2IGluZGV4OworICAgIHN0cnVjdCBoZGRfYWxpZ25fbWFjX2FkZHJfdCAqIG1hY19hZGRyID0K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kFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBtYWxsb2MgZmFpbGVkIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX05PTUVNOworICAgIH0KKworICAgIHN0YV9pbmZvX25vZGUtPnN0YV9pZCA9IHN0YV9pZDsKKyAgICB2b3NfbWVtX2NvcHkoJnN0YV9pbmZvX25vZGUtPm1hY19hZGRyLCBtYWNfYWRkciwgc2l6ZW9mKHZfTUFDQUREUl90KSk7CisKKyAgICBzcGluX2xvY2tfYmgoICZwQWRhcHRlci0+c3RhX2hhc2hfbG9jayk7CisgICAgaWYgKHBBZGFwdGVyLT5pc19zdGFfaWRfaGFzaF9pbml0aWFsaXplZCAhPSBWT1NfVFJVRSkgeworICAgICAgICBzcGluX3VubG9ja19iaCggJnBBZGFwdGVyLT5zdGFfaGFzaF9sb2NrKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHN0YV9pbmZvX25vZGUpOworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgIiVzOiBoYXNoIGlzIG5vdCBpbml0aWFsaXplZCBmb3Igc2Vzc2lvbiBpZCAlZCIsCisgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcEFkYXB0ZXItPnNlc3Npb25JZCk7CisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICB9CisKKyAgICBoZGRfbGlzdF9pbnNlcnRfYmFjayAoICZwQWRhcHRlci0+c3RhX2lkX2hhc2guYmluc1tpbmRleF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAoaGRkX2xpc3Rfbm9kZV90Kikgc3RhX2luZm9fbm9kZSApOworICAgIHNwaW5fdW5sb2NrX2JoKCAmcEFkYXB0ZXItPnN0YV9oYXNo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3Npb25JZCk7CisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICB9CisKKyAgICBpbmRleCA9IGhkZF9zdGFfaWRfaGFzaF9jYWxjdWxhdGVfaW5kZXgocEFkYXB0ZXIsIG1hY19hZGRyKTsKKyAgICBzdGF0dXMgPSBoZGRfbGlzdF9wZWVrX2Zyb250ICggJnBBZGFwdGVyLT5zdGFfaWRfaGFzaC5iaW5zW2luZGV4XSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGhkZF9saXN0X25vZGVfdCoqKSAmc3RhX2luZm9fbm9kZSApOworCisgICAgd2hpbGUgKCBOVUxMICE9IHN0YV9pbmZvX25vZGUgJiYgVk9TX1NUQVRVU19TVUNDRVNTID09IHN0YXR1cyApCisgICAgeworICAgICAgICBpZiAoc3RhX2luZm9fbm9kZS0+c3RhX2lkID09IHN0YV9pZCkgeworICAgICAgICAgICAgc3RhdHVzID0gaGRkX2xpc3RfcmVtb3ZlX25vZGUoICZwQWRhcHRlci0+c3RhX2lkX2hhc2guYmluc1tpbmRleF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmc3RhX2luZm9fbm9kZS0+bm9kZSk7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUoc3RhX2luZm9fbm9kZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBzdGF0dXMgPSBoZGRfbGlzdF9wZWVrX25leHQgKCZwQWRhcHRlci0+c3RhX2lkX2hhc2guYmluc1tpbmRleF0sCisgICAgICAgICAgICAgICAgKGhkZF9saXN0X25vZGVfdCopc3RhX2luZm9fbm9kZSwgKGhkZF9saXN0X25vZGVfdCoqKSZuZXh0X25vZGUpOworICAgICAgICBzdGFfaW5mb19ub2RlID0gbmV4dF9ub2RlOworICAgIH0KKyAgICBzcGluX3VubG9ja19iaCggJnBBZGFwdGVyLT5zdGFfaGFzaF9sb2NrKTsKKyAgICByZXR1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REX1dMQU5fSU5WQUxJRF9TVEFfSUQ7CisgICAgfQorCisgICAgaW5kZXggPSBoZGRfc3RhX2lkX2hhc2hfY2FsY3VsYXRlX2luZGV4KHBBZGFwdGVyLCBtYWNfYWRkcl9pbik7CisgICAgc3RhdHVzID0gaGRkX2xpc3RfcGVla19mcm9udCAoICZwQWRhcHRlci0+c3RhX2lkX2hhc2guYmluc1tpbmRleF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChoZGRfbGlzdF9ub2RlX3QqKikgJnN0YV9pbmZvX25vZGUgKTsKKworICAgIHdoaWxlICggTlVMTCAhPSBzdGFfaW5mb19ub2RlICYmIFZPU19TVEFUVVNfU1VDQ0VTUyA9PSBzdGF0dXMgKQorICAgIHsKKyAgICAgICAgaWYgKHZvc19tZW1fY29tcGFyZSgmc3RhX2luZm9fbm9kZS0+bWFjX2FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFjX2FkZHJfaW4sIHNpemVvZih2X01BQ0FERFJfdCkpKSB7CisgICAgICAgICAgICBpc19mb3VuZCA9IDE7CisgICAgICAgICAgICBzdGFfaWQgPSBzdGFfaW5mb19ub2RlLT5zdGFfaWQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBzdGF0dXMgPSBoZGRfbGlzdF9wZWVrX25leHQgKCZwQWRhcHRlci0+c3RhX2lkX2hhc2guYmluc1tpbmRleF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGhkZF9saXN0X25vZGVfdCopc3RhX2luZm9fbm9kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaGRkX2xpc3Rfbm9kZV90KiopJm5leHRfbm9kZSk7CisgICAgICAgIHN0YV9pbmZvX25vZGUgPSBuZXh0X25vZGU7CisgICAgfQorICAgIHNwaW5fdW5sb2NrX2JoKCAmcEFkYXB0ZXItPnN0YV9oYXNoX2xvY2spOworICAgIHJldHVybiBzdGFfaWQ7Cit9CisKK3ZvaWQgaGRkX2luaXRpYWxpemVfYWRhcHRlcl9jb21tb24oaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIpCit7CisgICAgICAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IHBBZGFwdGVyIGlzIE5VTEwgIiwgX19mdW5jX18pOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGluaXRfY29tcGxldGlvbigmcEFkYXB0ZXItPnNlc3Npb25fb3Blbl9jb21wX3Zhcik7CisgICAgICAgIGluaXRfY29tcGxldGlvbigmcEFkYXB0ZXItPnNlc3Npb25fY2xvc2VfY29tcF92YXIpOworICAgICAgICBpbml0X2NvbXBsZXRpb24oJnBBZGFwdGVyLT5kaXNjb25uZWN0X2NvbXBfdmFyKTsKKyAgICAgICAgaW5pdF9jb21wbGV0aW9uKCZwQWRhcHRlci0+bGlua3VwX2V2ZW50X3Zhcik7CisgICAgICAgIGluaXRfY29tcGxldGlvbigmcEFkYXB0ZXItPmNhbmNlbF9yZW1fb25fY2hhbl92YXIpOworICAgICAgICBpbml0X2NvbXBsZXRpb24oJnBBZGFwdGVyLT5yZW1fb25fY2hhbl9yZWFkeV9ldmVudCk7CisgICAgICAgIGluaXRfY29tcGxldGlvbigmcEFkYXB0ZXItPnBub19jb21wX3Zhcik7CisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigyLDYsMzgpKQorICAgICAgICBpbml0X2NvbXBsZXRpb24oJnBBZGFwdGVyLT5vZmZjaGFubmVsX3R4X2V2ZW50KTsKKyNlbmRpZgorICAgICAgICBpbml0X2NvbXBsZXRpb24oJnBBZGFwdGVyLT50eF9hY3Rpb25fY25mX2V2ZW50KTsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworICAgICAgICBpbml0X2NvbXBs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9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmZGVmIEZFQVRVUkVfT0VNX0RBVEFfU1VQUE9SVAorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09IAorICAgIFxmaWxlIHdsYW5faGRkX29lbWRhdGEuYworICAKKyAgICBcYnJpZWYgTGludXggV2lyZWxlc3MgRXh0ZW5zaW9ucyBmb3Igb2VtIGRhdGEgcmVxL3JzcAorICAKKyAgICAkSWQ6IHdsYW5faGRkX29lbWRhdGEuYyx2IDEuMzQgMjAxMC8wNC8xNSAwMTo0OToyMyAtLSBWSU5BWQorICAKKyAgICBDb3B5cmlnaHQgKEMpIFF1YWxjb21tIEluYy4KKyAgICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworI2luY2x1ZGUgPGxpbnV4L3ZlcnNpb24uaD4KKyNpbmNsdWRlIDxsaW51eC9tb2R1bGUuaD4KKyNpbmNsdWRlIDxsaW51eC9rZXJuZWwuaD4KKyNpbmNsdWRlIDxsaW51eC9pbml0Lmg+CisjaW5jbHVkZSA8bGludXgvd2lyZWxlc3MuaD4KKyNpbmNsdWRlIDx3bGFuX2hkZF9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gICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsCisgICAgICAgIGNoYXIgKmV4dHJhKQoreworICAgIGludCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmMgPSAwOworICAgIGVIYWxTdGF0dXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzOworICAgIHN0cnVjdCBpd19vZW1fZGF0YV9yc3AqICAgICAgICAgICAgICAgcEhkZE9lbURhdGFSc3A7CisgICAgdE9lbURhdGFSc3AqICAgICAgICAgICAgICAgICAgICAgICAgICBwU21lT2VtRGF0YVJzcDsKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcjsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworCisgICAgRU5URVIoKTsKKyAgICBwQWRhcHRlciA9IChuZXRkZXZfcHJpdihkZXYpKTsKKyAgICBpZiAoTlVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBBZGFwdGVyIGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICByYyA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gcmMpCisgICAgeworICAgICAgICByZXR1cm4gcmM7CisgICAgfQorICAgIGRvCisgICAgeworICAgICAgICAvL2dldCB0aGUgb2VtIGRhdGEgcmVzcG9uc2UgZnJvbSBzbWUKKyAgICAgICAgc3RhdHVzID0gc21lX2dldE9lbURhdGFSc3AoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLCAmcFNtZU9lbURhdGFSc3ApOworICAgICAgICBpZiAoc3RhdHVzICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyhMT0dFLCAiJXM6IGZhaWxlZCBpbiBzbWVfZ2V0T2VtRGF0YVJzcCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHJjID0gLUVJTzsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKHBTbWVPZW1EYXRhUnNwICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcEhkZE9lbURhdGFSc3AgPSAoc3RydWN0IGl3X29lbV9kYXRhX3JzcCopKGV4dHJhKTsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocEhkZE9lbURhdGFSc3AtPm9lbURhdGFSc3AsIHBTbWVPZW1EYXRhUnNwLT5vZW1EYXRhUnNwLCBPRU1fREFUQV9SU1BfU0laRSk7IAorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCAiJXM6IHBTbWVPZW1EYXRhUnNwID0gTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICByYyA9IC1FSU87CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9IHdoaWxlKDApOworCisgICAgRVhJVCgpOworICAgIHJldHVybiByYzsKK30KKworaW50IGl3X2dldF9vZW1fZGF0YV9yc3AoCisgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsCisgICAgICAgIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7C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FfcmVxKAorICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LAorICAgICAgICBjaGFyICpleHRyYSkKK3sKKyAgICBpbnQgcmMgPSAwOworICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICBzdHJ1Y3QgaXdfb2VtX2RhdGFfcmVxICpwT2VtRGF0YVJlcSA9IE5VTEw7CisgICAgdE9lbURhdGFSZXFDb25maWcgb2VtRGF0YVJlcUNvbmZpZzsKKyAgICB0QU5JX1UzMiBvZW1EYXRhUmVxSUQgPSAwOworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgaGRkX3dleHRfc3RhdGVfdCAqcHdleHRCdWY7CisKKyAgICBFTlRFUigpOworCisgICAgaWYgKCFjYXBhYmxlKENBUF9ORVRfQURNSU4pKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICBGTCgicGVybWlzc2lvbiBjaGVjayBmYWlsZWQiKSk7CisgICAgICAgIHJldHVybiAtRVBFUk07CisgICAgfQorCisgICAgcEFkYXB0ZXIgPSAobmV0ZGV2X3ByaXYoZGV2KSk7CisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgcmMgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHJjKQorICAgIHsKKyAgICAgICAgcmV0dXJuIHJjOworICAgIH0KKworICAgIHB3ZXh0QnVmID0gV0xBTl9IRERfR0VUX1dFWFRfU1RBVEVfUFRSKHBBZGFwdGVyKTsKKyAgICBpZiAoTlVMTCA9PSBwd2V4dEJ1ZikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBwd2V4dEJ1ZiBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIGlmIChwSGRkQ3R4LT5pc1Bub0VuYWJsZSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgIEZMKCJwbm8gc2NhbiBpbiBwcm9ncmVzcyIpKTsKKyAgICAgICAgcmV0dXJuIC1FQlVTWTsKKyAgICB9CisKKyAgICBkbworICAgIHsKKyAgICAgICAgaWYgKE5VTEwgIT0gd3JxdS0+ZGF0YS5wb2ludGVyKQorICAgICAgICB7CisgICAgICAgICAgICBwT2VtRGF0YVJlcSA9IChzdHJ1Y3QgaXdfb2VtX2RhdGFfcmVxICopd3JxdS0+ZGF0YS5wb2ludGVyOworICAgICAgICB9CisKKyAgICAgICAgaWYgKHBPZW1EYXRhUmVxID09IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyhMT0dFLCAiaW4gJXMgb2VtRGF0YVJlcSA9PSBOVUxMIiwgX19mdW5jX18pOworICAgICAgICAgICAgcmMgPSAtRUlPOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICB2b3NfbWVtX3plcm8oJm9lbURhdGFSZXFDb25maWcsIHNpemVvZih0T2VtRGF0YVJlcUNvbmZpZykpOworCisgICAgICAgIGlmIChjb3B5X2Zyb21fdXNlcigoJm9lbURhdGFSZXFDb25maWcpLT5vZW1EYXRhUmVxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcE9lbURhdGFSZXEtPm9lbURhdGFSZXEsIE9FTV9EQVRBX1JFUV9TSVpFKSkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBjb3B5X2Zyb21fdXNlcigpIGZhaWxlZCEiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICByYyA9IC1FRkFVTFQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIHN0YXR1cyA9IHNtZV9PZW1EYXRhUmVxKFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9lbURhdGFSZXFDb25maWcsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9lbURhdGFSZXFJRCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmaGRkX09lbURhdGFSZXFDYWxsYmFjaywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXYpOworICAgICAgICBpZiAoc3RhdHVzICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICIlczogc21lX09lbURhdGFSZXEgc3RhdHVzICVkIiwgX19mdW5jX18sIHN0YXR1cyk7CisgICAgICAgICAgICByYyA9IC1FRkFVTFQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIAorICAgICAgICBwd2V4dEJ1Zi0+b2VtRGF0YVJlcUlEID0gb2VtRGF0YVJlcUlEOworICAgICAgICBwd2V4dEJ1Zi0+b2VtRGF0YVJlcUluUHJvZ3Jlc3MgPSBUUlVFOworCisgICAgfSB3aGlsZSgwKTsKKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gcmM7Cit9CisKK2ludCBpd19zZXRfb2VtX2RhdGFfcmVxKAorICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LAorICAgICAgICBjaGFyICpleHRyYSkKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X3NldF9vZW1fZGF0YV9yZXEoZGV2LCBpbmZvLCB3cnF1LCBleHRyYSk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworI2VuZGlmCmRpZmYgLS1naXQgYS93bGFuL3ByaW1hL0NPUkUvSEREL3NyYy93bGFuX2hkZF9wMnAuYyBiL3dsYW4vcHJpbWEvQ09SRS9IREQvc3JjL3dsYW5faGRkX3AycC5jCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjYxNWRhNzAKLS0tIC9kZXYvbnVsbAorKysgYi93bGFuL3ByaW1hL0NPUkUvSEREL3NyYy93bGFuX2hkZF9wMn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NULCBORUdMSUdFTkNFIE9SIE9USEVSCisgKiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SCisgKiBQRVJGT1JNQU5DRSBPRiBUSElTIFNPRlRXQVJFLgorICovCisKKy8qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBcZmlsZSAgd2xhbl9oZGRfcDJwLmMKKworICBcYnJpZWYgV0xBTiBIb3N0IERldmljZSBEcml2ZXIgaW1wbGVtZW50YXRpb24gZm9yIFAyUCBjb21tYW5kcyBpbnRlcmZhY2UKKworCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKyNpbmNsdWRlIDx3bGFuX2hkZF9pbmNsdWRlcy5oPgorI2luY2x1ZGUgPHdsYW5faGRkX2hvc3RhcGQuaD4KKyNpbmNsdWRlIDxuZXQvY2ZnODAyMTEuaD4KKyNpbmNsdWRlICJzbWVfQXBpLmgiCisjaW5jbHVkZSAic21lX1Fvc0FwaS5oIgorI2luY2x1ZGUgIndsYW5faGRkX3AycC5oIgorI2luY2x1ZGUgInNhcEFwaS5oIgorI2luY2x1ZGUgIndsYW5faGRkX21haW4uaCIKKyNpbmNsdWRlICJ2b3NfdHJhY2UuaCIKKyNpbmNsdWRlIDxsaW51eC9uZXRkZXZpY2UuaD4KKyNpbmNsdWRlID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ICAgICAgICAgICAgICAiUDJQIEludml0YXRpb24gUmVxdWVzdCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlAyUCBJbnZpdGF0aW9uIFJlc3BvbnNlIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRGV2aWNlIERpc2NvdmVyYWJpbGl0eSBSZXF1ZXN0IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRGV2aWNlIERpc2NvdmVyYWJpbGl0eSBSZXNwb25zZSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlByb3Zpc2lvbiBEaXNjb3ZlcnkgUmVxdWVzdCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlByb3Zpc2lvbiBEaXNjb3ZlcnkgUmVzcG9uc2UifTsKKworLyogV2Ugbm8gbmVlZCB0byBwcm90ZWN0IHRoaXMgdmFyaWFibGUgc2luY2UKKyAqIHRoZXJlIGlzIG5vIGNoYW5jZSBvZiByYWNlIHRvIGNvbmRpdGlvbgorICogYW5kIGFsc28gbm90IG1ha2UgYW55IGNvbXBsaWNhdGluZyB0aGUgY29kZQorICoganVzdCBmb3IgZGVidWdnaW5nIGxvZworICovCit0UDJQQ29ubmVjdGlvblN0YXR1cyBnbG9iYWxQMlBDb25uZWN0aW9uU3RhdHVzID0gUDJQX05PVF9BQ1RJVkU7CisKKyNlbmRpZgorI2RlZmluZSBNQVhfVERMU19BQ1RJT05fRlJBTUVfVFlQRSAxMQorY29uc3QgY2hhciAqdGRsc19hY3Rpb25fZnJhbWVfdHlwZVtdID0geyJURExTIFNldHVwIFJlcXVlc3QiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJURExTIFNldHVwIFJlc3BvbnNlIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVERMUyBTZXR1cCBDb25maXJtIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVERMUyBUZWFyZG93biIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlRETFMgUGVlciBUcmFmZmljIEluZGljYXRpb24iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJURExTIENoYW5uZWwgU3dpdGNoIFJlcXVlc3QiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJURExTIENoYW5uZWwgU3dpdGNoIFJlc3BvbnNlIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVERMUyBQZWVyIFBTTSBSZXF1ZXN0IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVERMUyBQZWVyIFBTTSBSZXNwb25zZSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlRETFMgUGVlciBUcmFmZmljIFJlc3BvbnNlIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVERMUyBEaXNjb3ZlcnkgUmVxdWVzdCIgfTsKKworZXh0ZXJuIHN0cnVjdCBuZXRfZGV2aWNlX29wcyBuZXRfb3BzX3N0cnVjdDsKKworc3RhdGljIGludCBoZGRfd2xhbl9hZGRfcnhfcmFkaW90YXBfaGRyKCBzdHJ1Y3Qgc2tfYnVmZiAqc2tiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgcnRhcF9sZW4sIGludCBmbGFnICk7CisKK3N0YXRpYyB2b2lkIGhkZF93bGFuX3R4X2NvbXBsZXRlKCBoZGRfYWRhcHRlcl90KiBwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZGRfY2ZnODAyMTFfc3RhdGVfdCogY2ZnU3RhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9CT09MRUFOIGFjdGlvblNlbmRTdWNjZXNzICk7CisKK3N0YXRpYyB2b2lkIGhkZF9zZW5kTWdtdEZyYW1lT3Zlck1vbml0b3JJZmFjZSggaGRkX2FkYXB0ZXJfdCAqcE1vbkFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5GcmFtZUxlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCogcGJGcmFtZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggZnJhbWVUeXBlICk7CisKK3N0YXRpYyB2X0JPT0xfdCBoZGRfcDJwX2lzX2FjdGlvbl90eXBlX3JzcCggY29uc3QgdTggKmJ1ZiApCit7CisgICAgdEFjdGlvbkZybVR5cGUgYWN0aW9uRnJtVHlwZTsKKyAgICBjb25zdCB1OCAqb3VpUHRyOworCisgICAgaWYgKCBidWZbV0xBTl9IRERfUFVCTElDX0FDVElPTl9GUkFNRV9DQVRFR09SWV9PRkZTRVRdICE9CisgICAgICAgICAgICAgICBXTEFOX0hERF9QVUJMSUNfQUNUSU9OX0ZSQU1FICkgeworICAgICAgICByZXR1cm4gVk9TX0ZBTFNFOworICAgIH0KKworICAgIGlmICggYnVmW1dMQU5fSEREX1BVQkxJQ19BQ1RJT05fRlJBTUVfQUNUSU9OX09GRlNFVF0gIT0KKyAgICAgICAgICAgICAgIFdMQU5fSEREX1ZFTkRPUl9TUEVDSUZJQ19BQ1RJT04gKSB7CisgICAgICAgIHJldHVybiBWT1NfRkFMU0U7CisgICAgfQorCisgICAgb3VpUHRyID0gJmJ1ZltXTEFOX0hERF9QVUJMSUNfQUNUSU9OX0ZSQU1FX09VSV9PRkZTRVRdOworCisgICAgaWYgKCBXUEFfR0VUX0JFMjQob3VpUHRyKSAhPSBXTEFOX0hERF9XRkFfT1VJICkgeworICAgICAgICByZXR1cm4gVk9TX0ZBT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c3RvcCgmcFJlbWFpbkNoYW5DdHgtPmhkZF9yZW1haW5fb25fY2hhbl90aW1lcik7CisgICAgdm9zX3RpbWVyX2Rlc3Ryb3koJnBSZW1haW5DaGFuQ3R4LT5oZGRfcmVtYWluX29uX2NoYW5fdGltZXIpOworICAgIGlmICggUkVNQUlOX09OX0NIQU5ORUxfUkVRVUVTVCA9PSBwUmVtYWluQ2hhbkN0eC0+cmVtX29uX2NoYW5fcmVxdWVzdCApCisgICAgeworICAgICAgICBpZiggY2ZnU3RhdGUtPmJ1ZiApCisgICAgICAgIHsKKyAgICAgICAgICAgaGRkTG9nKCBMT0cxLAorICAgICAgICAgICAgICAgICAgICIlczogV2UgbmVlZCB0byByZWNlaXZlIHlldCBhbiBhY2sgZnJvbSBvbmUgb2YgdHggcGFja2V0IiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgIH0KKyAgICAgICAgY2ZnODAyMTFfcmVtYWluX29uX2NoYW5uZWxfZXhwaXJlZCgKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsNiwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSZW1haW5DaGFuQ3R4LT5kZXYtPmllZWU4MDIxMV9wdHIsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJlbWFpbkNoYW5DdHgtPmRldiwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJlbWFpbkNoYW5DdHgtPmNvb2tpZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwUmVtYWluQ2hhbkN0eC0+Y2hhbiwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFIDwgS0VSTkVMX1ZFUlNJT04oMyw4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJlbWFpbkNoYW5DdHgtPmNoYW5fdHlwZSwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR0ZQX0tFUk5FTCk7CisgICAgICAgIHBBZGFwdGVyLT5sYXN0Um9jVHMgPSB2b3NfdGltZXJfZ2V0X3N5c3RlbV90aW1lKCk7CisgICAgfQorCisgICAgcmVxX3R5cGUgPSBwUmVtYWluQ2hhbkN0eC0+cmVtX29uX2NoYW5fcmVxdWVzdDsKKyAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnJvY19sb2NrKTsKKworICAgIGlmICggKCBXTEFOX0hERF9JTkZSQV9TVEFUSU9OID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSApIHx8CisgICAgICAgICAoIFdMQU5fSEREX1AyUF9DTElFTlQgPT0gcEFkYXB0ZXItPmRldmljZV9tb2RlICkgfHwKKyAgICAgICAgICggV0xBTl9IRERfUDJQX0RFVklDRSA9PSBwQWRhcHRlci0+ZGV2aWNlX21vZGUgKQorICAgICAgICkKKyAgICB7CisgICAgICAgIHRBTklfVTggc2Vzc2lvbklkID0gcEFkYXB0ZXItPnNlc3Npb25JZDsKKyAgICAgICAgaWYoIFJFTUFJTl9PTl9DSEFOTkVMX1JFUVVFU1QgPT0gcmVxX3R5cGUgKQorICAgICAgICB7CisgICAgICAgICAgICBzbWVfRGVyZWdpc3Rlck1nbXRGcmFtZSgKKyAgICAgICAgICAgICAgICAgICAgICAgaEhhbCwgc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgIChTSVJfTUFDX01HTVRfRlJBTUUgPDwgMikgfCAoIFNJUl9NQUNfTUdNVF9QUk9CRV9SRVEgPDwgNCksCisgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsIDAgKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmIChXTEFOX0hERF9QMlBfR08gPT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKQorICAgIHsKKyAgICAgICAgV0xBTlNBUF9EZVJlZ2lzdGVyTWdtdEZyYW1lKAorICAgICAgICAgICAgICAgIChXTEFOX0hERF9HRVR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KSIsCisgICAgICAgICAgICAgICAgICAgIHBSZW1haW5DaGFuQ3R4LT5jb29raWUpOworCisgICAgICAgICAgICB2b3NfdGltZXJfc3RvcCgmcFJlbWFpbkNoYW5DdHgtPmhkZF9yZW1haW5fb25fY2hhbl90aW1lcik7CisgICAgICAgIH0KKyAgICAgICAgLyogV2FpdCB0aWxsIHJlbWFpbiBvbiBjaGFubmVsIHJlYWR5IGluZGljYXRpb24gYmVmb3JlIGlzc3VpbmcgY2FuY2VsCisgICAgICAgICAqIHJlbWFpbiBvbiBjaGFubmVsIHJlcXVlc3QsIG90aGVyd2lzZSBpZiByZW1haW4gb24gY2hhbm5lbCBub3QKKyAgICAgICAgICogcmVjZWl2ZWQgYW5kIGlmIHRoZSBkcml2ZXIgaXNzdWVzIGNhbmNlbCByZW1haW4gb24gY2hhbm5lbCB0aGVuIGxpbQorICAgICAgICAgKiB3aWxsIGJlIGluIHVua25vd24gc3RhdGUuCisgICAgICAgICAqLworICAgICAgICBpZiAocFJlbWFpbkNoYW5DdHgtPmhkZF9yZW1haW5fb25fY2hhbl9jYW5jZWxfaW5fcHJvZ3Jlc3MgIT0gVFJVRSkKKyAgICAgICAgeworICAgICAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT5yb2NfbG9jayk7CisgICAgICAgICAgICBzdGF0dXMgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGVfdGltZW91dCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEFkYXB0ZXItPnJlbV9vbl9jaGFuX3JlYWR5X2V2ZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoV0FJVF9SRU1fQ0hBTl9SRUFEWSkpOworICAgICAgICAgICAgaWYgKDAgPj0gc3RhdHVzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG11dGV4X2xvY2soJnBIZGRDdHgtPnJvY19sb2NrKTsKKyAgICAgICAgICAgICAgICBwUmVtYWluQ2hhbkN0eCA9IGNmZ1N0YXRlLT5yZW1haW5fb25fY2hhbl9jdHg7CisgICAgICAgICAgICAgICAgaWYgKHBSZW1haW5DaGFuQ3R4KQorICAgICAgICAgICAgICAgICAgICBwUmVtYWluQ2hhbkN0eC0+aXNfcGVuZGluZ19yb2NfY2FuY2VsbGVkID0gVFJVRTsKKyAgICAgICAgICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnJvY19sb2NrKTsKKyAgICAgICAgICAgICAgICBoZGRMb2coIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IHRpbWVvdXQgd2FpdGluZyBmb3IgcmVtYWluIG9uIGNoYW5uZWwiCisgICAgICAgICAgICAgICAgICAgICAgICAiIHJlYWR5IGluZGljYXRpb24gJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHN0YXR1cyk7CisgICAgICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtdXRleF9sb2NrKCZwSGRkQ3R4LT5yb2NfbG9jayk7CisgICAgICAgICAgICBwUmVtYWluQ2hhbkN0eCA9IGNmZ1N0YXRlLT5yZW1haW5fb25fY2hhbl9jdHg7CisgICAgICAgICAgICBpZiAoTlVMTCA9PSBwUmVtYWluQ2hhbkN0eCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnJvY19sb2NrKTsKKyAgICAgICAgICAgICAgICBoZGRMb2coIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICAiJXMtJWQ6IHBSZW1haW5DaGFuQ3R4IGlzIE5VTEwiLAorICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBDaGVjayBhZ2FpbiBpZiBjYW5jZWwgcmVtYWluIG9uIGNoYW5uZWwgaXMgc3RhcnRlZC4KKyAgICAgICAgICAgICAqIElmIGl0cyBzdGFydGVkIHdhaXQgZm9yIGl0cyBjb21wbGV0aW9uYSBhbmQgcmV0dXJuLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBpZiAoVFJVRSA9PSBwUmVtYWluQ2hhbkN0eC0+aGRkX3JlbWFpbl9vbl9jaGFuX2NhbmNlbF9pbl9wcm9ncmVzcykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnJvY19sb2NrKTsKKyAgICAgICAgICAgICAgICBoZGRMb2coIExPRzEsCisgICAgICAgICAgICAgICAgICAgICAgIlJPQyB0aW1lciBjYW5jZWxsYXRpb24gaW4gcHJvZ3Jlc3MsIgorICAgICAgICAgICAgICAgICAgICAgICIgd2FpdCBmb3IgY29tcGxldGlvbiIpOworICAgICAgICAgICAgICAgIHN0YXR1cyA9IHdhaXRfZm9yX2NvbXBsZXRpb25faW50ZXJydXB0aWJsZV90aW1lb3V0KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwQWRhcHRlci0+Y2FuY2VsX3JlbV9vbl9jaGFuX3ZhciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKFdBSVRfQ0FOQ0VMX1JFTV9DSEFOKSk7CisgICAgICAgICAgICAgICAgaWYgKDAgPj0gc3RhdHVzKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6d2FpdCBvbiBjYW5jZWxfcmVtX29uX2NoYW5fdmFyIGZhaWxlZCAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgc3RhdHVzKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHBSZW1haW5DaGFuQ3R4LT5oZGRfcmVtYWluX29uX2NoYW5fY2FuY2VsX2luX3Byb2dyZXNzID0gVFJVRTsKKyAgICAgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+cm9jX2xvY2spOworICAgICAgICAgICAgSU5JVF9DT01QTEVUSU9OKHBBZGFwdGVyLT5jYW5jZWxfcmVtX29uX2NoYW5fdmFyKTsKKworICAgICAgICAgICAgLyogSXNzdWUgYWJvcnQgcmVtYWluIG9uIGNoYW4gcmVxdWVzdCB0byBzbWUuCisgICAgICAgICAgICAgKiBUaGUgcmVtYWluIG9uIGNoYW5uZWwgY2FsbGJhY2sgd2lsbCBtYWtlIHN1cmUgdGhlIHJlbWFpbl9vbl9jaGFuCisgICAgICAgICAgICAgKiBleHBpcmVkIGV2ZW50IGlzIHNlbnQuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmICggKCBXTEFOX0hERF9JTkZSQV9TVEFUSU9OID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSApIHx8CisgICAgICAgICAgICAgICAgICAgKCBXTEFOX0hERF9QMlBfQ0xJRU5UID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSApIHx8CisgICAgICAgICAgICAgICAgICAgKCBXTEFOX0hERF9QMlBfREVWSUNFID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSApKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9CisgICAgICAgICAgICAgICAgICAgIHNtZV9DYW5jZWxSZW1haW5PbkNoYW5uZWwoIFdMQU5fSEREX0dFVF9IQUxfQ1RYKCBwQWRhcHRlciApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkICkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkZhaWxlZCB0byBDYW5jZWwgUmVtYWluIG9uIENoYW5uZWwiKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoV0xBTl9IRERfUDJQX0dPID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgV0xBTlNBUF9DYW5jZWxSZW1haW5PbkNoYW5uZWwoCisgICAgICAgICAgICAgICAgICAgICAgICAgKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+cHZvc0NvbnRleHQpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBzdGF0dXMgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGVfdGltZW91dCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwQWRhcHRlci0+Y2FuY2VsX3JlbV9vbl9jaGFuX3ZhciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoV0FJVF9DQU5DRUxfUkVNX0NIQU4pKTsKKyAgICAgICAgICAgIGlmICgwID49IHN0YXR1cykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICIlczogdGltZW91dCB3YWl0aW5nIGZvciBjYW5jZWwgcmVtYWluIG9uIGNoYW5uZWwiCisgICAgICAgICAgICAgICAgICAgICAgICAgIiByZWFkeSBpbmRpY2F0aW9uICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHN0YXR1cyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBoZGRfYWxsb3dfc3VzcGVuZChXSUZJX1BPV0VSX0VWRU5UX1dBS0VMT0NLX1JPQyk7CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICAgIGhkZExvZyggTE9HMSwKKyAgICAgICAgICAgICAgICAgICAgICAiUk9DIHRpbWVyIGNhbmNlbGxhdGlvbiBpbiBwcm9ncmVzcywiCisgICAgICAgICAgICAgICAgICAgICAgIiB3YWl0IGZvciBjb21wbGV0aW9uIik7CisgICAgICAgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+cm9jX2xvY2spOworICAgICAgICAgICAgICBzdGF0dXMgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGVfdGltZW91dCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEFkYXB0ZXItPmNhbmNlbF9yZW1fb25fY2hhbl92YXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcyhXQUlUX0NBTkNFTF9SRU1fQ0hBTikpOworICAgICAgICAgICAgICBpZiAoMCA+PSBzdGF0dXMpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGhkZExvZyggTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOndhaXQgb24gY2FuY2VsX3JlbV9vbl9jaGFuX3ZhciBmYWlsZWQgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHN0YXR1cyk7CisgICAgICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgcmV0dXJuIFZPU19TV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0+cm9jX2xvY2spOworICAgICAgICBoZGRMb2coIExPR0UsCisgICAgICAgICAgICAgICAgIiVzLSVkOiBwUmVtYWluQ2hhbkN0eCBpcyBOVUxMIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18pOworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKyAgICByZXF1ZXN0X3R5cGUgPSBwUmVtYWluQ2hhbkN0eC0+cmVtX29uX2NoYW5fcmVxdWVzdDsKKyAgICAvKiBJbml0aWFsaXplIFJlbWFpbiBvbiBjaGFuIHRpbWVyICovCisgICAgc3RhdHVzID0gdm9zX3RpbWVyX2luaXQoJnBSZW1haW5DaGFuQ3R4LT5oZGRfcmVtYWluX29uX2NoYW5fdGltZXIsCisgICAgICAgICAgICBWT1NfVElNRVJfVFlQRV9TVywKKyAgICAgICAgICAgIHdsYW5faGRkX3JlbWFpbl9vbl9jaGFuX3RpbWVvdXQsCisgICAgICAgICAgICBwQWRhcHRlcik7CisgICAgaWYgKHN0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIEZMKCJOb3QgYWJsZSB0byBpbml0YWxpemUgcmVtYWluX29uX2NoYW4gdGltZXIiKSk7CisgICAgICAgIGNmZ1N0YXRlLT5yZW1haW5fb25fY2hhbl9jdHggPSBOVUxMOworICAgICAgICB2b3NfbWVtX2ZyZWUocFJlbWFpbkNoYW5DdHgpOworICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnJvY19sb2NrKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgZHVyYXRpb24gPSBwUmVtYWluQ2hhbkN0eC0+ZHVyYXRpb247CisgICAgaHdfdmFsdWUgPSBwUmVtYWluQ2hhbkN0eC0+Y2hhbi5od192YWx1ZTsKKyAgICBtdXRleF91bmxvY2soJnBIZGRDdHg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luIG9uIGNoYW5uZWwuCisgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHNtZV9SZW1haW5PbkNoYW5uZWwoCisgICAgICAgICAgICAgICAgV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLCBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgaHdfdmFsdWUsIGR1cmF0aW9uLAorICAgICAgICAgICAgICAgIHdsYW5faGRkX3JlbWFpbl9vbl9jaGFubmVsX2NhbGxiYWNrLCBwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAodEFOSV9VOCkocmVxdWVzdF90eXBlID09IFJFTUFJTl9PTl9DSEFOTkVMX1JFUVVFU1QpPyBUUlVFOkZBTFNFKSkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICBGTCgiIFJlbWFpbk9uQ2hhbm5lbCByZXR1cm5lZCBmYWlsIikpOworCisgICAgICAgICAgICBtdXRleF9sb2NrKCZwSGRkQ3R4LT5yb2NfbG9jayk7CisgICAgICAgICAgICBjZmdTdGF0ZS0+cmVtYWluX29uX2NoYW5fY3R4ID0gTlVMTDsKKyAgICAgICAgICAgIHZvc190aW1lcl9kZXN0cm95KCZwUmVtYWluQ2hhbkN0eC0+aGRkX3JlbWFpbl9vbl9jaGFuX3RpbWVyKTsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZSAocFJlbWFpbkNoYW5DdHgpOworICAgICAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT5yb2NfbG9jayk7CisgICAgICAgICAgICBoZGRfYWxsb3dfc3VzcGVuZChXSUZJX1BPV0VSX0VWRU5UX1dBS0VMT0NLX1JPQyk7CisgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgfQorCisgICAgICAgIGlmKCBSRU1BSU5fT05fQ0hBTk5FTF9SRVFVRVNUID09IHJlcXVlc3RfdHlwZSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYoIGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gc21lX1JlZ2lzdGVyTWdtdEZyYW1lKAorICAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLAorICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkLCAoU0lSX01BQ19NR01UX0ZSQU1FIDw8IDIpIHwKKyAgICAgICAgICAgICAgICAgICAgICAgIChTSVJfTUFDX01HTVRfUFJPQkVfUkVRIDw8IDQpLCBOVUxMLCAwICkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgICAgInNtZV9SZWdpc3Rlck1nbXRGcmFtZSByZXR1cm5lZCBmYWlsIik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgIH0KKyAgICBlbHNlIGlmIChXTEFOX0hERF9QMlBfR08gPT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKQorICAgIHsKKyAgICAgICAgLy9jYWxsIHNtZSBBUEkgdG8gc3RhcnQgcmVtYWluIG9uIGNoYW5uZWwuCisgICAgICAgIGlmIChWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gV0xBTlNBUF9SZW1haW5PbkNoYW5uZWwoCisgICAgICAgICAgICAgICAgICAgIChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPnB2b3NDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICBod192YWx1ZSwgZHVyYXRpb24sCisgICAgICAgICAgICAgICAgICAgIHdsYW5faGRkX3JlbWFpbl9vbl9jaGFubmVsX2NhbGxiYWNrLCBwQWRhcHRlciApKQorCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIiVzOiBXTEFOU0FQX1JlbWFpbk9uQ2hhbm5lbCByZXR1cm5lZCBmYWlsIiwgX19mdW5jX18pOworICAgICAgICAgICAgbXV0ZXhfbG9jaygmcEhkZEN0eC0+cm9jX2xvY2spOworICAgICAgICAgICAgY2ZnU3RhdGUtPnJlbWFpbl9vbl9jaGFuX2N0eCA9IE5VTEw7CisgICAgICAgICAgICB2b3NfdGltZXJfZGVzdHJveSgmcFJlbWFpbkNoYW5DdHgtPmhkZF9yZW1haW5fb25fY2hhbl90aW1lcik7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUgKHBSZW1haW5DaGFuQ3R4KTsKKyAgICAgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+cm9jX2xvY2spOworICAgICAgICAgICAgaGRkX2FsbG93X3N1c3BlbmQoV0lGSV9QT1dFUl9FVkVOVF9XQUtFTE9DS19ST0MpOworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgIH0KKworCisgICAgICAgIGlmIChWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gV0xBTlNBUF9SZWdpc3Rlck1nbXRGcmFtZSgKKyAgICAgICAgICAgICAgICAgICAgKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+cHZvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgIChTSVJfTUFDX01HTVRfRlJBTUUgPDwgMikgfCAoIFNJUl9NQUNfTUdNVF9QUk9CRV9SRVEgPDwgNCksCisgICAgICAgICAgICAgICAgICAgIE5VTEwsIDAgKSkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiJXM6IFdMQU5TQVBfUmVnaXN0ZXJNZ210RnJhbWUgcmV0dXJuZWQgZmFpbCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIFdMQU5TQVBfQ2FuY2VsUmVtYWluT25DaGFubmVsKAorICAgICAgICAgICAgICAgICAgICAoV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcikpLT5wdm9zQ29udGV4dCk7CisgICAgICAgICAgICBoZGRfYWxsb3dfc3VzcGVuZChXSUZJX1BPV0VSX0VWRU5UX1dBS0VMT0NLX1JPQyk7CisgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgfQorCisgICAgfQorCisgICAgcEFkYXB0ZXItPmlzX3JvY19pbnByb2dyZXNzID0gVFJVRTsKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIDA7Cit9CisKKworc3RhdGljIGludCB3bGFuX2hkZF9yZXF1ZXN0X3JlbWFpbl9vbl9jaGFubmVsKCBzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaWVlZTgwMjExX2NoYW5uZWwgKmNoYW4sCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA8IEtFUk5FTF9WRVJTSU9OKDMsOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBubDgwMjExX2NoYW5uZWxfdHlwZSBjaGFubmVsX3R5cGUsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50IGR1cmF0aW9uLCB1NjQgKmNvb2tpZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtX29uX2NoYW5uZWxfcmVxdWVzdF90eXBlX3QgcmVxdWVzdF90eXBlICkKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciA9IFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgIGhkZF9yZW1haW5fb25fY2hhbl9jdHhfdCAqcFJlbWFpbkNoYW5DdHg7CisgICAgaGRkX2NmZzgwMjExX3N0YXRlX3QgKmNmZ1N0YXRlID0gV0xBTl9IRERfR0VUX0NGR19TVEFURV9QVFIoIHBBZGFwdGVyICk7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IE5VTEw7CisgICAgVk9TX1NUQVRVUyBjaGVja1JlYWR5SW5kOworICAgIGhkZF9hZGFwdGVyX3QgKnBTdGFBZGFwdGVyOworICAgIGludCBzdGF0dXMgPSAwOworCisgICAgRU5URVIoKTsKKyAgICBpZiAoTlVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiJXM6IEhERCBhZGFwdGVyIGlzIE51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRU5PREVWOworICAgIH0KKworICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKCBwQWRhcHRlciApOworICAgIHN0YXR1cyA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gc3RhdHVzKQorICAgIHsKKyAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICB9CisKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczogZGV2aWNlX21vZGUgPSAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyxwQWRhcHRlci0+ZGV2aWNlX21vZGUpOworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPCBLRVJORUxfVkVSU0lPTigzLDgsMCkpCisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAiY2hhbihod192YWwpMHgleCBjaGFuKGNlbnRlcmZyZXEpICVkIGNoYW4gdHlwZSAweCV4LCBkdXIgJWQsIgorICAgICAgICAgICAiIHJlcXVlc3QgdHlwZSAlZCwgY29va2llICVsbHUiLAorICAgICAgICAgICBjaGFuLT5od192YWx1ZSwgY2hhbi0+Y2VudGVyX2ZyZXEsIGNoYW5uZWxfdHlwZSwgZHVyYXRpb24sCisgICAgICAgICAgIHJlcXVlc3RfdHlwZSwgKmNvb2tpZSk7CisjZWxzZQorICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAiY2hhbihod192YWwpMHgleCBjaGFuKGNlbnRlcmZyZXEpICVkLCBkdXJhdGlvbiAlZCIKKyAgICAgICAgICAgICIgcmV1ZXN0IHR5cGUgJWQsIGNvb2tpZSAlbGx1IiwgY2hhbi0+aHdfdmFsdWUsIGNoYW4tPmNlbnRlcl9mcmVxLAorICAgICAgICAgICAgZHVyYXRpb24sIHJlcXVlc3RfdHlwZSwgKmNvb2tpZSApOworI2VuZGlmCisgICAgLy9DYW5jZWwgZXhpc3RpbmcgcmVtYWluIE9uIENoYW5uZWwgaWYgYW55CisgICAgY2hlY2tSZWFkeUluZCA9IHdsYW5faGRkX2NhbmNlbF9leGlzdGluZ19yZW1haW5fb25fY2hhbm5lbChwQWRhcHRlcik7CisgICAgaWYgKFZPU19TVEFUVVNfU1VDQ0VTUyAhPSBjaGVja1JlYWR5SW5kKQorICAgIHsKKyAgICAgICBoZGRMb2coIExPR0UsIEZMKCJDYW5jZWwgUm9jIGluIHByb2dyZXNzIikpOworICAgICAgIHJldHVybiAtRUJVU1k7CisgICAgfQorCisgICAgLyogV2hlbiBQMlAtR08gYW5kIGlmIHdlIGFyZSB0cnlpbmcgdG8gdW5sb2FkIHRoZSBkcml2ZXIgdGhlbgorICAgICAqIHdsYW4gZHJpdmVyIGlzIGtlZXAgb24gcmVjZWl2aW5nIHRoZSByZW1haW4gb24gY2hhbm5lbCBjb21tYW5kCisgICAgICogYW5kIHdoaWNoIGlzIHJlc3VsdGluZyBpbiBjcmFzaC4gU28gbm90IGFsbG93aW5nIGFueSByZW1haW4gb24KKyAgICAgKiBjaGFubmVsIHJlcXVldHMgd2hlbiBMb2FkL1VubG9hZCBpcyBpbiBwcm9ncmVzcyovCisgICAgaWYoaGRkX2lzQ29ubmVjdGlvbkluUHJvZ3Jlc3MoKGhkZF9jb250ZXh0X3QgKilwQWRhcHRlci0+cEhkZEN0eCkpCisgICAgeworICAgICAgICBoZGRMb2coIExPR0UsCisgICAgICAgICAgICAgICAiJXM6IENvbm5lY3Rpb24gaXMgaW4gcHJvZ3Jlc3MiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUJVU1k7CisgICAgfQorCisgICAgbXV0ZXhfbG9jaygmcEhkZEN0eC0+cm9jX2xvY2spOworCisgICAgcFJlbWFpbkNoYW5DdHggPSB2b3NfbWVtX21hbGxvYyggc2l6ZW9mKGhkZF9yZW1haW5fb25fY2hhbl9jdHhfdCkgKTsKKyAgICBpZiggTlVMTCA9PSBwUmVtYWluQ2hhbkN0eCApCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICIlczogTm90IGFibGUgdG8gYWxsb2NhdGUgbWVtb3J5IGZvciBDaGFubmVsIGNvbnRleHQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+cm9jX2xvY2spOworICAgICAgICByZXR1cm4gLUVOT01FTTsKKyAgICB9CisKKyAgICB2b3NfbWVtX3plcm8ocFJlbWFpbkNoYW5DdHgsIHNpemVvZiAoaGRkX3JlbWFpbl9vbl9jaGFuX2N0eF90KSk7CisgICAgdm9zX21lbV9jb3B5KCAmcFJlbWFpbkNoYW5DdHgtPmNoYW4sIGNoYW4sCisgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHN0cnVjdCBpZWVlODAyMTFfY2hhbm5lbCkgKTsKKworI2lmIChM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AgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPmNmZ19pbmktPmdQMlBMaXN0ZW5EZWZlckludGVydmFsLCBwQWRhcHRlcik7CisgICAgICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnJvY19sb2NrKTsKKyAgICBzdGF0dXMgPSB3bGFuX2hkZF9wMnBfc3RhcnRfcmVtYWluX29uX2NoYW5uZWwocEFkYXB0ZXIpOworCisgICAgRVhJVCgpOworICAgIHJldHVybiBzdGF0dXM7Cit9CisKK2ludCBfX3dsYW5faGRkX2NmZzgwMjExX3JlbWFpbl9vbl9jaGFubmVsKCBzdHJ1Y3Qgd2lwaHkgKndpcGh5LAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMyw2LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgd2lyZWxlc3NfZGV2ICp3ZGV2LAorI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaWVlZTgwMjExX2NoYW5uZWwgKmNoYW4sCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA8IEtFUk5FTF9WRVJTSU9OKDMsOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBubDgwMjExX2NoYW5uZWxfdHlwZSBjaGFubmVsX3R5cGUsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50IGR1cmF0aW9uLCB1NjQgKmNvb2tpZSApCit7CisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDYsMCkpCisgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiA9IHdkZXYtPm5ldGRldjsKKyNlbmRpZgorICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgaW50IHJldCA9IDA7CisKKyAgICBFTlRFUigpOworICAgIHBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogQWRhcHRlciBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgcmV0ID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSByZXQpCisgICAgeworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKworICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9IREQsCisgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX0hERF9SRU1BSU5fT05fQ0hBTk5FTCwKKyAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsIFJFTUFJTl9PTl9DSEFOTkVMX1JFUVVFU1QpKTsKKyAgICByZXQgPSB3bGFuX2hkZF9yZXF1ZXN0X3JlbWFpbl9vbl9jaGFubmVsKHdpcGh5LCBkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbiwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFIDwgS0VSTkVMX1ZFUlNJT04oMyw4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxfdHlwZSwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGR1cmF0aW9uLCBjb29raWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVNQUlOX09OX0NIQU5ORUxfUkVRVUVTVCk7CisgICAgRVhJVCgpOworICAgIHJldHVybiByZXQ7Cit9CisKK2ludCB3bGFuX2hkZF9jZmc4MDIxMV9yZW1haW5fb25fY2hhbm5lbCggc3RydWN0IHdpcGh5ICp3aXBoeSwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsNiwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHdpcmVsZXNzX2RldiAqd2RldiwKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGllZWU4MDIxMV9jaGFubmVsICpjaGFuLAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPCBLRVJORUxfVkVSU0lPTigzLDgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbmw4MDIxMV9jaGFubmVsX3R5cGUgY2hhbm5lbF90eXBlLAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludCBkdXJhdGlvbiwgdTY0ICpjb29raWUgKQoreworICAgaW50IHJldDsKKworICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgIHJldCA9IF9fd2xhbl9oZGRfY2ZnODAyMTFfcmVtYWluX29uX2NoYW5uZWwod2lwaHksCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDYsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkZXYsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXYsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbiwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFIDwgS0VSTkVMX1ZFUlNJT04oMyw4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsX3R5cGUsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHVyYXRpb24sIGNvb2tpZSk7CisgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgIHJldHVybiByZXQ7Cit9CisKKwordm9pZCBoZGRfcmVtYWluQ2hhblJlYWR5SGFuZGxlciggaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgKQoreworICAgIGhkZF9jZmc4MDIxMV9zdGF0ZV90ICpjZmdTdGF0ZSA9IE5VTEw7CisgICAgaGRkX3JlbWFpbl9vbl9jaGFuX2N0eF90KiBwUmVtYWluQ2hhbkN0eCA9IE5VTEw7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgICBWT1NfU1RBVFVTIHN0YXR1czsKKyAgICBpZiAoTlVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgaGRkTG9nKExPR0UsIEZMKCJwQWRhcHRlciBpcyBOVUxMIikpOworICAgICAgIHJldHVybjsKKyAgICB9CisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIGlmIChOVUxMID09IHBIZGRDdHgpCisgICAgeworICAgICAgICBoZGRMb2coTE9HRSwgRkwoInBIZGRDdHggaXMgTlVMTCIpKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBjZmd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MDIxMV9yZWFkeV9vbl9jaGFubmVsKAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMyw2LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5kZXYtPmllZWU4MDIxMV9wdHIsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5kZXYsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodWludHB0cl90KXBSZW1haW5DaGFuQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwUmVtYWluQ2hhbkN0eC0+Y2hhbiwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFIDwgS0VSTkVMX1ZFUlNJT04oMyw4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSZW1haW5DaGFuQ3R4LT5jaGFuX3R5cGUsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUmVtYWluQ2hhbkN0eC0+ZHVyYXRpb24sIEdGUF9LRVJORUwgKTsKKyAgICAgICAgfQorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMiw2LDM4KSkKKyAgICAgICAgZWxzZSBpZiggT0ZGX0NIQU5ORUxfQUNUSU9OX1RYID09IHBSZW1haW5DaGFuQ3R4LT5yZW1fb25fY2hhbl9yZXF1ZXN0KQorICAgICAgICB7CisgICAgICAgICAgICBjb21wbGV0ZSgmcEFkYXB0ZXItPm9mZmNoYW5uZWxfdHhfZXZlbnQpOworICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgLy8gQ2hlY2sgZm9yIGNhY2hlZCBhY3Rpb24gZnJhbWUKKyAgICAgICAgaWYgKCBwUmVtYWluQ2hhbkN0eC0+YWN0aW9uX3BrdF9idWZmLmZyYW1lX2xlbmd0aCAhPSAwICkKKyAgICAgICAgeworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxOCwwKSkKKyAgICAgICAgICAgIGNmZzgwMjExX3J4X21nbXQocEFkYXB0ZXItPmRldi0+aWVlZTgwMjExX3B0ciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJlbWFpbkNoYW5DdHgtPmFjdGlvbl9wa3RfYnVmZi5mcmVxLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUmVtYWluQ2hhbkN0eC0+YWN0aW9uX3BrdF9idWZmLmZyYW1lX3B0ciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJlbWFpbkNoYW5DdHgtPmFjdGlvbl9wa3RfYnVmZi5mcmFtZV9sZW5ndGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5MODAyMTFfUlhNR01UX0ZMQUdfQU5TV0VSRUQpOworI2VsaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDEyLDApKQorICAgICAgICAgICAgY2ZnODAyMTFfcnhfbWdtdChwQWRhcHRlci0+ZGV2LT5pZWVlODAyMTFfcHRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUmVtYWluQ2hhbkN0eC0+YWN0aW9uX3BrdF9idWZmLmZyZXEsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSZW1haW5DaGFuQ3R4LT5hY3Rpb25fcGt0X2J1ZmYuZnJhbWVfcHRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUmVtYWluQ2hhbkN0eC0+YWN0aW9uX3BrdF9idWZmLmZyYW1lX2xlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTkw4MDIxMV9SWE1HTVRfRkxBR19BTlNXRVJFRCwgR0ZQX0FUT01JQyk7CisjZWxpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsNiwwKSkKKyAgICAgICAgICAgIGNmZzgwMjExX3J4X21nbXQoIHBBZGFwdGVyLT5kZXYtPmllZWU4MDIxMV9wdHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUmVtYWluQ2hhbkN0eC0+YWN0aW9uX3BrdF9idWZmLmZyZXEsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUmVtYWluQ2hhbkN0eC0+YWN0aW9uX3BrdF9idWZmLmZyYW1lX3B0ciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSZW1haW5DaGFuQ3R4LT5hY3Rpb25fcGt0X2J1ZmYuZnJhbWVfbGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR0ZQX0FUT01JQyApOworI2VsaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDQsMCkpCisgICAgICAgICAgICBjZmc4MDIxMV9yeF9tZ210KCBwQWRhcHRlci0+ZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJlbWFpbkNoYW5DdHgtPmFjdGlvbl9wa3RfYnVmZi5mcmVxLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJlbWFpbkNoYW5DdHgtPmFjdGlvbl9wa3RfYnVmZi5mcmFtZV9wdHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUmVtYWluQ2hhbkN0eC0+YWN0aW9uX3BrdF9idWZmLmZyYW1lX2xlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdGUF9BVE9NSUMgKTsKKyNlbHNlCisgICAgICAgICAgICBjZmc4MDIxMV9yeF9tZ210KCBwQWRhcHRlci0+ZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJlbWFpbkNoYW5DdHgtPmFjdGlvbl9wa3RfYnVmZi5mcmVxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJlbWFpbkNoYW5DdHgtPmFjdGlv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5jZSBwUmVtYWluQ2hhbkN0eC0+aXNfcGVuZGluZ19yb2NfY2FuY2VsbGVkIGlzCisgICAgICAgICAgICAgKiBzZXQsIGl0IG1lYW5zIENhbmNlbCBSZWFtYWluIG9uIGNoYW5uZWwgY29tbWFuZCBpcworICAgICAgICAgICAgICogcGVuZGluZyBiZWNhdXNlIHJlbWFpbiBvbiBjaGFubmVsIGV2ZW50IHdhcyBub3QKKyAgICAgICAgICAgICAqIHJlYWR5IHdoZW4gY2FuY2VsIFJPQyAgd2FzIGlzc3VlZC5TbyBpc3N1ZQorICAgICAgICAgICAgICogY2FuY2VsIFJPQyBub3cuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHdsYW5faGRkX2NhbmNlbF9leGlzdGluZ19yZW1haW5fb25fY2hhbm5lbChwQWRhcHRlcik7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnJvY19sb2NrKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnJvY19sb2NrKTsKKyAgICAgICAgaGRkTG9nKCBMT0dXLCAiJXM6IE5vIFBlbmRpbmcgUmVtYWluIG9uIGNoYW5uZWwgUmVxdWVzdCIsIF9fZnVuY19fKTsKKyAgICB9CisgICAgcmV0dXJuOworfQorCitpbnQgX193bGFuX2hkZF9jZmc4MDIxMV9jYW5jZWxfcmVtYWluX29uX2NoYW5uZWwoIHN0cnVjdCB3aXBoeSAqd2lwaHksCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDYsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgd2lyZWxlc3NfZGV2ICp3ZGV2LAorI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU2NCBjb29raWUgKQoreworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMyw2LDApKQorICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgPSB3ZGV2LT5uZXRkZXY7CisjZW5kaWYKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciA9IFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgIGhkZF9jZmc4MDIxMV9zdGF0ZV90ICpjZmdTdGF0ZSA9IFdMQU5fSEREX0dFVF9DRkdfU1RBVEVfUFRSKCBwQWRhcHRlciApOworICAgIGhkZF9yZW1haW5fb25fY2hhbl9jdHhfdCAqcFJlbWFpbkNoYW5DdHggPSBOVUxMOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKCBwQWRhcHRlciApOworICAgIGludCBzdGF0dXM7CisgICAgdTY0IGNvb2tpZV9kdW1teTsKKworICAgIEVOVEVSKCk7CisgICAgY29va2llX2R1bW15ID0gY29va2llIDw8IDMyOworICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9IREQsCisgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX0hERF9DRkc4MDIxMV9DQU5DRUxfUkVNQUlOX09OX0NIQU5ORUwsCisgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCBjb29raWVfZHVtbXkpKTsKKyAgICBoZGRMb2coIExPRzEsICJDYW5jZWwgcmVtYWluIG9uIGNoYW5uZWwgcmVxIik7CisKKyAgICBzdGF0dXMgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworCisgICAgaWYgKDAgIT0gc3RhdHVzKQorICA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tYWluIG9uIGNoYW5uZWwgcmVxdWVzdCAqLworICAgICAgIHN0YXR1cyA9IHdhaXRfZm9yX2NvbXBsZXRpb25faW50ZXJydXB0aWJsZV90aW1lb3V0KCZwQWRhcHRlci0+cmVtX29uX2NoYW5fcmVhZHlfZXZlbnQsCisgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKFdBSVRfUkVNX0NIQU5fUkVBRFkpKTsKKyAgICAgICBpZiAoMCA+PSBzdGF0dXMpCisgICAgICAgeworICAgICAgICAgICBoZGRMb2coIExPR0UsCisgICAgICAgICAgICAgICAgICAgIiVzOiB0aW1lb3V0IHdhaXRpbmcgZm9yIHJlbWFpbiBvbiBjaGFubmVsIHJlYWR5IGluZGljYXRpb24gJWQiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBzdGF0dXMpOworICAgICAgICAgICBtdXRleF9sb2NrKCZwSGRkQ3R4LT5yb2NfbG9jayk7CisgICAgICAgICAgIGlmIChjZmdTdGF0ZS0+cmVtYWluX29uX2NoYW5fY3R4KQorICAgICAgICAgICAgICAgY2ZnU3RhdGUtPnJlbWFpbl9vbl9jaGFuX2N0eC0+aXNfcGVuZGluZ19yb2NfY2FuY2VsbGVkID0gVFJVRTsKKyAgICAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT5yb2NfbG9jayk7CisKKyAgICAgICAgICAgcmV0dXJuIDA7CisKKyAgICAgICB9CisgICAgICAgIG11dGV4X2xvY2soJnBIZGRDdHgtPnJvY19sb2NrKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgaGRkTG9nKCBMT0cxLCBGTCgiQ2FuY2VsIFJPQyBldmVudCBpcyBhbHJlYWR5IHBlbmRpbmcsICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAid2FpdGluZyBmb3IgcmVhZHkgb24gY2hhbm5lbCBpbmRpY2F0aW9uLiIpICk7CisgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+cm9jX2xvY2spOworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisgICAgaWYgKE5VTEwgIT0gY2ZnU3RhdGUtPnJlbWFpbl9vbl9jaGFuX2N0eCkKKyAgICB7CisgICAgICAgIHZvc190aW1lcl9zdG9wKCZjZmdTdGF0ZS0+cmVtYWluX29uX2NoYW5fY3R4LT5oZGRfcmVtYWluX29uX2NoYW5fdGltZXIpOworICAgICAgICBpZiAoVFJVRSA9PSBwUmVtYWluQ2hhbkN0eC0+aGRkX3JlbWFpbl9vbl9jaGFuX2NhbmNlbF9pbl9wcm9ncmVzcykKKyAgICAgICAgeworICAgICAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT5yb2NfbG9jayk7CisgICAgICAgICAgICBoZGRMb2coIExPRzEsCisgICAgICAgICAgICAgICAgICAgIEZMKCJST0MgdGltZXIgY2FuY2VsbGF0aW9uIGluIHByb2dyZXNzLCIKKyAgICAgICAgICAgICAgICAgICAgICAgIiB3YWl0IGZvciBjb21wbGV0aW9uIikpOworICAgICAgICAgICAgc3RhdHVzID0gd2FpdF9mb3JfY29tcGxldGlvbl9pbnRlcnJ1cHRpYmxlX3RpbWVvdXQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEFkYXB0ZXItPmNhbmNlbF9yZW1fb25fY2hhbl92YXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKFdBSVRfQ0FOQ0VMX1JFTV9DSEFOKSk7CisgICAgICAgICAgICBpZiAoMCA+PSBzdGF0dXMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgIiVzOndhaXQgb24gY2FuY2VsX3JlbV9vbl9jaGFuX3ZhciBmYWlsZWQgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHN0YXR1cyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgICBwUmVtYWluQ2hhbkN0eC0+aGRkX3JlbWFpbl9vbl9jaGFuX2NhbmNlbF9pbl9wcm9ncmVzcyA9IFRSVUU7CisgICAgfQorICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+cm9jX2xvY2spOworICAgIElOSVRfQ09NUExFVElPTihwQWRhcHRlci0+Y2FuY2VsX3JlbV9vbl9jaGFuX3Zhcik7CisgICAgLyogSXNzdWUgYWJvcnQgcmVtYWluIG9uIGNoYW4gcmVxdWVzdCB0byBzbWUuCisgICAgICogVGhlIHJlbWFpbiBvbiBjaGFubmVsIGNhbGxiYWNrIHdpbGwgbWFrZSBzdXJlIHRoZSByZW1haW5fb25fY2hhbgorICAgICAqIGV4cGlyZWQgZXZlbnQgaXMgc2VudC4KKyAgICAgKi8KKyAgICBpZiAoICggV0xBTl9IRERfSU5GUkFfU1RBVElPTiA9PSBwQWRhcHRlci0+ZGV2aWNlX21vZGUgKSB8fAorICAgICAgICAgKCBXTEFOX0hERF9QMlBfQ0xJRU5UID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSApIHx8CisgICAgICAgICAoIFdMQU5fSEREX1AyUF9ERVZJQ0UgPT0gcEFkYXB0ZXItPmRldmljZV9tb2RlICkpCisgICAgeworICAgICAgICB0QU5JX1U4IHNlc3Npb25JZCA9IHBBZGFwdGVyLT5zZXNzaW9uSWQ7CisgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9CisgICAgICAgICAgICAgICAgc21lX0NhbmNlbFJlbWFpbk9uQ2hhbm5lbCggV0xBTl9IRERfR0VUX0hBTF9DVFgoIHBBZGFwdGVyICksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkICkpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgRkwoIkZhaWxlZCB0byBDYW5jZWwgUmVtYWluIG9uIENoYW5uZWwiKSk7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoV0xBTl9IRERfUDJQX0dPID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkKKyAgICB7CisgICAgICAgIFdMQU5TQVBfQ2FuY2VsUmVtYWluT25DaGFubmVsKAorICAgICAgICAgICAgICAgIChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPnB2b3NDb250ZXh0KTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IEludmFsaWQgZGV2aWNlX21vZGUgPSAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSk7CisgICAgICAgcmV0dXJuIC1FSU87CisgICAgfQorICAgIHN0YXR1cyA9IHdhaXRfZm9yX2NvbXBsZXRpb25faW50ZXJydXB0aWJsZV90aW1lb3V0KCZwQWRhcHRlci0+Y2FuY2VsX3JlbV9vbl9jaGFuX3ZhciwKKyAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoV0FJVF9DQU5DRUxfUkVNX0NIQU4pKTsKKyAgICBpZiAoMCA+PSBzdGF0dXMpCisgICAgeworICAgICAgICBoZGRMb2coIExPR0UsCisgICAgICAgICAgICAgICIlczp3YWl0IG9uIGNhbmNlbF9yZW1fb25fY2hhbl92YXIgZmFpbGVkICVkIiwgX19mdW5jX18sIHN0YXR1cyk7CisgICAgfQorICAgIGhkZF9hbGxvd19zdXNwZW5kKFdJRklfUE9XRVJfRVZFTlRfV0FLRUxPQ0tfUk9DKTsKKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gMDsKK30KKworaW50IHdsYW5faGRkX2NmZzgwMjExX2NhbmNlbF9yZW1haW5fb25fY2hhbm5lbCggc3RydWN0IHdpcGh5ICp3aXBoeSwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsNiwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXJlbGVzc19kZXYgKndkZXYsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTY0IGNvb2tpZSApCit7CisgICAgaW50IHJldDsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX193bGFuX2hkZF9jZmc4MDIxMV9jYW5jZWxfcmVtYWluX29uX2NoYW5uZWwod2lwaHksCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDYsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2RldiwKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGV2LAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29va2llKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCisKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsNiwwKSkKK2ludCBfX3dsYW5faGRkX21nbXRfdHgoIHN0cnVjdCB3aXBoeSAqd2lwaHksIHN0cnVjdCB3aXJlbGVzc19kZXYgKndkZXYsCisgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaWVlZTgwMjExX2NoYW5uZWwgKmNoYW4sIGJvb2wgb2ZmY2hhbiwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFIDwgS0VSTkVMX1ZFUlNJT04oMyw4LDApKQorICAgICAgICAgICAgICAgICAgICAgZW51bSBubDgwMjExX2NoYW5uZWxfdHlwZSBjaGFubmVsX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICBib29sIGNoYW5uZWxfdHlwZV92YWxpZCwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50IHdhaXQsCisgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqYnVmLCBzaXplX3QgbGVuLCAgYm9vbCBub19jY2ssCisgICAgICAgICAgICAgICAgICAgICBib29sIGRvbnRfd2FpdF9mb3JfYWNrLCB1NjQgKmNvb2tpZSApCisjZWxpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMywwKSkKK2ludCBfX3dsYW5faGRkX21nbXRfdHgoIHN0cnVjdCB3aXBoeSAqd2lwaHksIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaWVlZTgwMjExX2NoYW5uZWwgKmNoYW4sIGJvb2wgb2ZmY2hhbiwKKyAgICAgICAgICAgICAgICAgICAgIGVudW0gbmw4MDIxMV9jaGFubmVsX3R5cGUgY2hhbm5lbF90eXBlLAorICAgICAgICAgICAgICAgICAgICAgYm9vbCBjaGFubmVsX3R5cGVfdmFsaWQsIHVuc2lnbmVkIGludCB3YWl0LAorICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKmJ1Ziwgc2l6ZV90IGxlbiwgIGJvb2wgbm9fY2NrLAorICAgICAgICAgICAgICAgICAgICAgYm9vbCBkb250X3dhaXRfZm9yX2FjaywgdTY0ICpjb29raWUgKQorI2VsaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigyLDYsMzgpKQoraW50IF9fd2xhbl9oZGRfbWdtdF90eCggc3RydWN0IHdpcGh5ICp3aXBoeSwgc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpZWVlODAyMTFfY2hhbm5lbCAqY2hhbiwgYm9vbCBvZmZjaGFuLAorICAgICAgICAgICAgICAgICAgICAgZW51bSBubDgwMjExX2NoYW5uZWxfdHlwZSBjaGFubmVsX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICBib29sIGNoYW5uZWxfdHlwZV92YWxpZCwgdW5zaWduZWQgaW50IHdhaXQsCisgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqYnVmLCBzaXplX3QgbGVuLCB1NjQgKmNvb2tpZSApCisjZWxzZQoraW50IF9fd2xhbl9oZGRfbWdtdF90eCggc3RydWN0IHdpcGh5ICp3aXBoeSwgc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpZWVlODAyMTFfY2hhbm5lbCAqY2hhbiwKKyAgICAgICAgICAgICAgICAgICAgIGVudW0gbmw4MDIxMV9jaGFubmVsX3R5cGUgY2hhbm5lbF90eXBlLAorICAgICAgICAgICAgICAgICAgICAgYm9vbCBjaGFubmVsX3R5cGVfdmFsaWQsCisgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqYnVmLCBzaXplX3QgbGVuLCB1NjQgKmNvb2tpZSApCisjZW5kaWYgLy9MSU5VWF9WRVJTSU9OX0NPREUKK3sKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsNiwwKSkKKyAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ID0gd2Rldi0+bmV0ZGV2OworI2VuZGlmCisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoIGRldiApO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ZGUgPSAlZCB0eXBlOiAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSwgdHlwZSk7CisKKworICAgIGlmICgodHlwZSA9PSBTSVJfTUFDX01HTVRfRlJBTUUpICYmCisgICAgICAgICAgICAoc3ViVHlwZSA9PSBTSVJfTUFDX01HTVRfQUNUSU9OKSAmJgorICAgICAgICAgICAgKGJ1ZltXTEFOX0hERF9QVUJMSUNfQUNUSU9OX0ZSQU1FX09GRlNFVF0gPT0gV0xBTl9IRERfUFVCTElDX0FDVElPTl9GUkFNRSkpCisgICAgeworICAgICAgICBhY3Rpb25Gcm1UeXBlID0gYnVmW1dMQU5fSEREX1BVQkxJQ19BQ1RJT05fRlJBTUVfVFlQRV9PRkZTRVRdOworI2lmZGVmIFdMQU5fRkVBVFVSRV9QMlBfREVCVUcKKyAgICAgICAgaWYoYWN0aW9uRnJtVHlwZSA+PSBNQVhfUDJQX0FDVElPTl9GUkFNRV9UWVBFKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJbUDJQXSB1bmtub3duWyVkXSAtLS0+IE9UQSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGlvbkZybVR5cGUpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiW1AyUF0gJXMgLS0tPiBPVEEiLAorICAgICAgICAgICAgcDJwX2FjdGlvbl9mcmFtZV90eXBlW2FjdGlvbkZybVR5cGVdKTsKKyAgICAgICAgICAgIGlmKCAoYWN0aW9uRnJtVHlwZSA9PSBXTEFOX0hERF9QUk9WX0RJU19SRVEpICYmCisgICAgICAgICAgICAgICAgKGdsb2JhbFAyUENvbm5lY3Rpb25TdGF0dXMgPT0gUDJQX05PVF9BQ1RJVkUpICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgZ2xvYmFsUDJQQ29ubmVjdGlvblN0YXR1cyA9IFAyUF9HT19ORUdfUFJPQ0VTUzsKKyAgICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsIltQMlAgU3RhdGVdSW5hY3RpdmUgc3RhdGUgdG8gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJHTyBuZWdvdGlhdGlvbiBwcm9ncmVzcyBzdGF0ZSIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiggKGFjdGlvbkZybVR5cGUgPT0gV0xBTl9IRERfR09fTkVHX0NORikgJiYKKyAgICAgICAgICAgICAgICAoZ2xvYmFsUDJQQ29ubmVjdGlvblN0YXR1cyA9PSBQMlBfR09fTkVHX1BST0NFU1MpICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgZ2xvYmFsUDJQQ29ubmVjdGlvblN0YXR1cyA9IFAyUF9HT19ORUdfQ09NUExFVEVEOworICAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwiW1AyUCBTdGF0ZV1HTyBuZWdvIHByb2dyZXNzIHRvIEdPIG5lZ28iCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgY29tcGxldGVkIHN0YXRlIik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyNlbmRpZgorICAgIH0KKworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywzLDApKQorICAgIG5vYWNrID0gZG9udF93YWl0X2Zvcl9hY2s7CisjZW5kaWYKKworCisgICAgLy9JZiB0aGUgd2FpdCBpcyBjb21pbmcgYXMgMCB3aXRoIG9mZiBjaGFubmVsIHNldAorICAgIC8vdGhlbiBzZXQgdGhlIHdhaXQgdG8gMjAwIG1zCisgICAgaWYgKG9mZmNoYW4gJiYgIXdhaXQpCisgICAgeworICAgICAgICB3YWl0ID0gQUNUSU9OX0ZSQU1FX0RFRkFVTFRfV0FJVDsKKyAgICAgICAgbXV0ZXhfbG9jaygmcEhkZEN0eC0+cm9jX2xvY2spOworICAgICAgICBwUmVtYWluQ2hhbkN0eCA9IGNmZ1N0YXRlLT5yZW1haW5fb25fY2hhbl9jdHg7CisgICAgICAgIGlmIChwUmVtYWluQ2hhbkN0eCkKKyAgICAgICAgeworICAgICAgICAgICAgdEFOSV9VMzIgY3VycmVudF90aW1lID0gdm9zX3RpbWVyX2dldF9zeXN0ZW1fdGltZSgpOworICAgICAgICAgICAgaW50IHJlbWFpbmluZ19yb2NfdGltZSA9ICgoaW50KSBwUmVtYWluQ2hhbkN0eC0+ZHVyYXRpb24gLQorICAgICAgICAgICAgICAgICAgICAoY3VycmVudF90aW1lIC0gcEFkYXB0ZXItPnN0YXJ0Um9jVHMpKTsKKyAgICAgICAgICAgIGlmICggcmVtYWluaW5nX3JvY190aW1lID4gQUNUSU9OX0ZSQU1FX0RFRkFVTFRfV0FJVCkKKyAgICAgICAgICAgICAgICB3YWl0ID0gcmVtYWluaW5nX3JvY190aW1lOworICAgICAgICB9CisgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+cm9jX2xvY2spOworICAgIH0KKworICAgIC8vQ2FsbCBzbWUgQVBJIHRvIHNlbmQgb3V0IGEgYWN0aW9uIGZyYW1lLgorICAgIC8vIE9SIGNhbiB3ZSBzZW5kIGl0IGRpcmVjdGx5IHRocm91Z2ggZGF0YSBwYXRoPz8KKyAgICAvLyBBZnRlciB0eCBjb21wbGV0aW9uIHNlbmQgdHggc3RhdHVzIGJhY2suCisgICAgaWYgKCAoIFdMQU5fSEREX1NPRlRBUCA9PSBwQWRhcHRlci0+ZGV2aWNlX21vZGUgKSB8fAorICAgICAgICAgKCBXTEFOX0hERF9QMlBfR08gPT0gcEFkYXB0ZXItPmRldmljZV9tb2RlICkKKyAgICAgICApCisgICAgeworICAgICAgICBpZiAodHlwZSA9PSBTSVJfTUFDX01HTVRfRlJBTUUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChzdWJUeXBlID09IFNJUl9NQUNfTUdNVF9QUk9CRV9SU1ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogRHJvcCBQcm9iZSByZXNwb25zZSByZWNpZXZlZCBmcm9tIHN1cHBsaWNhbnQsIGFzIGZvciBHTyBhbmQKKyAgICAgICAgICAgICAgICAgICBTQVAgUEUgaXRzZWxmIHNlbmRzIHByb2JlIHJlc3BvbnNlCisgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBnb3RvIGVycl9yZW1fY2hhbm5lbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKChzdWJUeXBlID09IFNJUl9NQUNfTUdNVF9ESVNBU1NPQykgfHwKKyAgICAgICAgICAgICAgICAgICAgKHN1YlR5cGUgPT0gU0lSX01BQ19NR01UX0RFQVVUSCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogRHVyaW5nIEVBUCBmYWlsdXJlIG9yIFAyUCBHcm91cCBSZW1vdmUgc3VwcGxpY2FudAorICAgICAgICAgICAgICAgICAqIGlzIHNlbmRpbmcgZGVsX3N0YXRpb24gY29tbWFuZCB0byBkcml2ZXIuIEZyb20KKyAgICAgICAgICAgICAgICAgKiBkZWxfc3RhdGlvbiBmdW5jdGlvbiwgRHJpdmVyIHdpbGwgc2VuZCBkZWF1dGggZnJhbWUgdG8KKyAgICAgICAgICAgICAgICAgKiBwMnAgY2xpZW50LiBObyBuZWVkIHRvIHNlbmQgZGlzYXNzb2MgZnJhbWUgZnJvbSBoZXJlLgorICAgICAgICAgICAgICAgICAqIHNvIERyb3AgdGhlIGZyYW1lIGhlcmUgYW5kIHNlbmQgdHggaW5kaWNhdGlvbiBiYWNrIHRvCisgICAgICAgICAgICAgICAgICogc3VwcGxpY2FudC4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICB0QU5JX1U4IGRzdE1hY1tFVEhfQUxFTl0gPSB7MH07CisgICAgICAgICAgICAgICAgbWVtY3B5KCZkc3RNYWMsICZidWZbV0xBTl9IRERfODAyMTFfRlJNX0RBX09GRlNFVF0sIEVUSF9BTEVOKTsKKyAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IERlYXV0aC9EaXNhc3NvYyByZWNlaXZlZCBmb3IgU1RBOiIKKyAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSRVNTX1NUUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkoZHN0TWFjKSk7CisgICAgICAgICAgICAgICAgZ290byBlcnJfcmVtX2NoYW5uZWw7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBpZiggTlVMTCAhPSBjZmdTdGF0ZS0+YnVmICkKKyAgICB7CisgICAgICAgIGlmICggIW5vYWNrICkKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKCBMT0dFLCAiKCVzKTpQcmV2aW91cyBQMlAgQWN0aW9uIGZyYW1lIHBhY2tldCBwZW5kaW5nIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICAgaGRkX2NsZWFudXBfYWN0aW9uZnJhbWUocEFkYXB0ZXItPnBIZGRDdHgsIHBBZGFwdGVyKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyggTE9HRSwgIiglcyk6UGVuZGluZyBBY3Rpb24gZnJhbWUgcGFja2V0IHJldHVybiBFQlVTWSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHJldHVybiAtRUJVU1k7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBpZiggc3ViVHlwZSA9PSBTSVJfTUFDX01HTVRfQUNUS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9DIHRpbWUgaXMgZXh0ZW5kZWQuIEZvciBmcmFtZXMgd2hlcmUgd2UgYXJlCisgICAgICAgICAgICAgICAgKiBleHBlY3RpbmcgcmVzcG9uc2UgZnJvbSBwZWVyICwgaXRzIGV4dGVuZGVkIGJ5CisgICAgICAgICAgICAgICAgKiA1MDAgbXNlYyB0byBtYWtlIFJPQyB3YWl0IHRpbWUgYXMgMSBzZWMgYW5kCisgICAgICAgICAgICAgICAgKiBpbiBvdGhlciBjYXNlcyBpdHMgZXh0ZW5kZWQgYnkgMzAwIG1zZWMgdG8gbWFrZQorICAgICAgICAgICAgICAgICogdG90YWwgUk9DIHdhaXQgYXMgNTAwIG1zZWMuCisgICAgICAgICAgICAgICAgKiBUT0RPOiBGVyBuZWVkcyB0byBmaXggYXMgd2h5IDE1IHJldHJ5IGlzIHRha2luZworICAgICAgICAgICAgICAgICogICAgICAgc3VjaCBsb25nIHRpbWUuCisgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBpZiAoIGFjdGlvbkZybVR5cGUgPT0gV0xBTl9IRERfSU5WSVRBVElPTl9SRVEgfHwKKyAgICAgICAgICAgICAgICAgICAgIGFjdGlvbkZybVR5cGUgPT0gV0xBTl9IRERfR09fTkVHX1JFUSB8fAorICAgICAgICAgICAgICAgICAgICAgYWN0aW9uRnJtVHlwZSA9PSBXTEFOX0hERF9HT19ORUdfUkVTUCApCisgICAgICAgICAgICAgICAgICAgd2FpdCA9IHdhaXQgKyBBQ1RJT05fRlJBTUVfUlNQX1dBSVQ7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoIGFjdGlvbkZybVR5cGUgPT0gV0xBTl9IRERfR09fTkVHX0NORiB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICBhY3Rpb25Gcm1UeXBlID09IFdMQU5fSEREX0lOVklUQVRJT05fUkVTUCApCisgICAgICAgICAgICAgICAgICAgd2FpdCA9IHdhaXQgKyBBQ1RJT05fRlJBTUVfQUNLX1dBSVQ7CisgICAgICAgICAgICAgICAgdm9zX3RpbWVyX3N0b3AoCisgICAgICAgICAgICAgICAgICAgICAgJnBSZW1haW5DaGFuQ3R4LT5oZGRfcmVtYWluX29uX2NoYW5fdGltZXIpOworICAgICAgICAgICAgICAgIHN0YXR1cyA9IHZvc190aW1lcl9zdGFydCgKKyAgICAgICAgICAgICAgICAgICAgICAgJnBSZW1haW5DaGFuQ3R4LT5oZGRfcmVtYWluX29uX2NoYW5fdGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgIHdhaXQpOworCisgICAgICAgICAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT5yb2NfbG9jayk7CisKKyAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgImFjdGlvbiBmcmFtZTogZXh0ZW5kaW5nIHRoZSB3YWl0IHRpbWUgJXUiLAorICAgICAgICAgICAgICAgICAgIHdhaXQpOworCisgICAgICAgICAgICAgICAgaWYgKCBzdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyggTE9HRSwgIlJlbWFpbiBvbiBDaGFubmVsIHRpbWVyIHN0YXJ0IGZhaWxlZCIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBnb3RvIHNlbmRfZnJhbWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKCBUUlVFID09CisgICAgICAgICAgICAgICAgICAgICBwUmVtYWluQ2hhbkN0eC0+aGRkX3JlbWFpbl9vbl9jaGFuX2NhbmNlbF9pbl9wcm9ncmVzcyApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnJvY19sb2NrKTsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgImFjdGlvbiBmcmFtZSB0eDogd2FpdGluZyBmb3IgY29tcGxldGlvbiBvZiBST0MgIik7CisKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gd2FpdF9mb3JfY29tcGxldGlvbl9pbnRlcnJ1cHRpYmxlX3RpbWVvdXQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEFkYXB0ZXItPmNhbmNlbF9yZW1fb25fY2hhbl92YXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKFdBSVRfQ0FOQ0VMX1JFTV9DSEFOKSk7CisgICAgICAgICAgICAgICAgICAgIGlmICgwID49IHN0YXR1cykKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczp3YWl0IG9uIGNhbmNlbF9yZW1fb25fY2hhbl92YXIgZmFpbGVkICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHN0YXR1cyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZ290byBieXBhc3NfbG9jazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT5yb2NfbG9jayk7CitieXBhc3NfbG9jazoKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgImFjdGlvbiBmcmFtZTogUmVxdWVzdCBST0MgZm9yIHdhaXQgdGltZSAldSIsIHdhaXQpOworICAgICAgICBJTklUX0NPTVBMRVRJT04ocEFkYXB0ZXItPm9mZmNoYW5uZWxfdHhfZXZlbnQpOworICAgICAgICBzdGF0dXMgPSB3bGFuX2hkZF9yZXF1ZXN0X3JlbWFpbl9vbl9jaGFubmVsKHdpcGh5LCBkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbiwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFIDwgS0VSTkVMX1ZFUlNJT04oMyw4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxfdHlwZSwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdhaXQsIGNvb2tpZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXFfdHlwZSk7CisKKyAgICAgICAgaWYoMCAhPSBzdGF0dXMpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKCAoLUVCVVNZID09IHN0YXR1cykgJiYKKyAgICAgICAgICAgICAgICAoY2ZnU3RhdGUtPmN1cnJlbnRfZnJlcSA9PSBjaGFuLT5jZW50ZXJfZnJlcSkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGdvdG8gc2VuZF9mcmFtZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGdvdG8gZXJyX3JlbV9jaGFubmVsOworICAgICAgICB9CisgICAgICAgIC8qIFdhaXQgZm9yIGRyaXZlciB0byBiZSByZWFkeSBvbiB0aGUgcmVxdWVzdGVkIGNoYW5uZWwgKi8KKyAgICAgICAgc3RhdHVzID0gd2FpdF9mb3JfY29tcGxldGlvbl9pbnRlcnJ1cHRpYmxlX3RpbWVvdXQoCisgICAgICAgICAgICAgICAgICAgICAmcEFkYXB0ZXItPm9mZmNoYW5uZWxfdHhfZXZlbnQsCisgICAgICAgICAgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKFdBSVRfQ0hBTkdFX0NIQU5ORUxfRk9SX09GRkNIQU5ORUxfVFgpKTsKKyAgICAgICAgaWYoMCA+PSBzdGF0dXMpCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyggTE9HRSwgIndhaXQgb24gb2ZmY2hhbm5lbF90eF9ldmVudCBmYWlsZWQgJWQiLCBzdGF0dXMpOworICAgICAgICAgICAgZ290byBlcnJfcmVtX2NoYW5uZWw7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoIG9mZmNoYW4gKQorICAgIHsKKyAgICAgICAgLyogQ2hlY2sgYmVmb3JlIHNlbmRpbmcgYWN0aW9uIGZyYW1lCisgICAgICAgICAgIHdoZXRoZXIgd2UgYWxyZWFkeSByZW1haW4gb24gY2hhbm5lbCAqLworICAgICAgICBpZihOVUxMID09IGNmZ1N0YXRlLT5yZW1haW5fb25fY2hhbl9jdHgpCisgICAgICAgIHsKKyAgICAgICAgICAgIGdvdG8gZXJyX3JlbV9jaGFubmVsOworICAgICAgICB9CisgICAgfQorICAgIHNlbmRfZnJhbWU6CisjZW5kaWYKKworICAgIGlmKCFub2FjaykKKyAgICB7CisgICAgICAgIGNmZ1N0YXRlLT5idWYgPSB2b3NfbWVtX21hbGxvYyggbGVuICk7IC8vYnVmOworICAgICAgICBpZiggY2ZnU3RhdGUtPmJ1ZiA9PSBOVUxMICkKKyAgICAgICAgICAgIHJldHVybiAtRU5PTUVNOworCisgICAgICAgIGNmZ1N0YXRlLT5sZW4gPSBsZW47CisKKyAgICAgICAgdm9zX21lbV9jb3B5KCBjZmdTdGF0ZS0+YnVmLCBidWYsIGxlbik7CisKKyAgICAgICAgbXV0ZXhfbG9jaygmcEhkZEN0eC0+cm9jX2xvY2spOworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMiw2LDM4KSkKKyAgICAgICAgaWYoIGNmZ1N0YXRlLT5yZW1haW5fb25fY2hhbl9jdHggKQorICAgICAgICB7CisgICAgICAgICAgICBjZmdTdGF0ZS0+YWN0aW9uX2Nvb2tpZSA9IGNmZ1N0YXRlLT5yZW1haW5fb25fY2hhb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FlQRV9PRkZTRVRdOworICAgICAgICAgICAgaGRkTG9nKExPRzEsICJUeCBBY3Rpb24gRnJhbWUgJXUuIiwgYWN0aW9uRnJtVHlwZSk7CisgICAgICAgICAgICBpZiAoYWN0aW9uRnJtVHlwZSA9PSBXTEFOX0hERF9QUk9WX0RJU19SRVEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2ZnU3RhdGUtPmFjdGlvbkZybVN0YXRlID0gSEREX1BEX1JFUV9BQ0tfUEVORElORzsKKyAgICAgICAgICAgICAgICBoZGRMb2coTE9HMSwgIiVzOiBIRERfUERfUkVRX0FDS19QRU5ESU5HLiIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKGFjdGlvbkZybVR5cGUgPT0gV0xBTl9IRERfR09fTkVHX1JFUSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjZmdTdGF0ZS0+YWN0aW9uRnJtU3RhdGUgPSBIRERfR09fTkVHX1JFUV9BQ0tfUEVORElORzsKKyAgICAgICAgICAgICAgICBoZGRMb2coTE9HMSwgIiVzOiBIRERfR09fTkVHX1JFUV9BQ0tfUEVORElORy4iLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPQorICAgICAgICAgICAgICAgc21lX3NlbmRBY3Rpb24oIFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uSWQsIGJ1ZiwgbGVuLCB3YWl0LCBub2FjaykpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICIlczogc21lX3NlbmRBY3Rpb24gcmV0dXJuZWQgZmFpbCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIGdvdG8gZXJyOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYgKFdMQU5fSEREX1AyUF9HTyA9PSBwQWRhcHRlci0+ZGV2aWNlX21vZGUpCisgICAgIHsKKyAgICAgICAgaWYoIFZPU19TVEFUVVNfU1VDQ0VTUyAhPQorICAgICAgICAgICAgIFdMQU5TQVBfU2VuZEFjdGlvbiggKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+cHZvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmLCBsZW4sIDAgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIiVzOiBXTEFOU0FQX1NlbmRBY3Rpb24gcmV0dXJuZWQgZmFpbCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIGdvdG8gZXJyOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIDA7CitlcnI6CisgICAgaWYoIW5vYWNrKQorICAgIHsKKyAgICAgICBoZGRfc2VuZEFjdGlvbkNuZiggcEFkYXB0ZXIsIEZBTFNFICk7CisgICAgfQorICAgIHJldHVybiAwOworZXJyX3JlbV9jaGFubmVsOgorICAgICpjb29raWUgPSAodWludHB0cl90KWNmZ1N0YXRlOworICAgIGNmZzgwMjExX21nbXRfdHhfc3RhdHVzKAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMyw2LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5kZXYtPmllZWU4MDIxMV9wdHIsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5kZXYsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAqY29va2ll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AgICAgICAgICAgICAgICAgICAgc3RydWN0IGllZWU4MDIxMV9jaGFubmVsICpjaGFuLAorICAgICAgICAgICAgICAgICAgICAgZW51bSBubDgwMjExX2NoYW5uZWxfdHlwZSBjaGFubmVsX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICBib29sIGNoYW5uZWxfdHlwZV92YWxpZCwKKyAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICpidWYsIHNpemVfdCBsZW4sIHU2NCAqY29va2llICkKKyNlbmRpZiAvL0xJTlVYX1ZFUlNJT05fQ09ERQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxNCwwKSkKKyAgICByZXQgPSAgX193bGFuX2hkZF9tZ210X3R4KHdpcGh5LCB3ZGV2LCBwYXJhbXMtPmNoYW4sIHBhcmFtcy0+b2ZmY2hhbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy0+d2FpdCwgcGFyYW1zLT5idWYsIHBhcmFtcy0+bGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLT5ub19jY2ssIHBhcmFtcy0+ZG9udF93YWl0X2Zvcl9hY2ssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb29raWUpOworI2VsaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDYsMCkpCisgICAgcmV0ID0gIF9fd2xhbl9oZGRfbWdtdF90eCh3aXBoeSwgd2RldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW4sIG9mZmNoYW4sCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA8IEtFUk5FTF9WRVJTSU9OKDMsOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxfdHlwZV92YWxpZCwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2FpdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZiwgbGVuLCBub19jY2ssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb250X3dhaXRfZm9yX2FjaywgY29va2llKTsKKyNlbGlmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywzLDApKQorICAgIHJldCA9IF9fd2xhbl9oZGRfbWdtdF90eCh3aXBoeSwgZGV2LCBjaGFuLCBvZmZjaGFuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsX3R5cGUsIGNoYW5uZWxfdHlwZV92YWxpZCwgd2FpdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmLCBsZW4sICBub19jY2ssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvbnRfd2FpdF9mb3JfYWNrLCBjb29raWUpOworI2VsaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigyLDYsMzgpKQorICAgIHJldCA9IF9fd2xhbl9oZGRfbWdtdF90eCh3aXBoeSwgZGV2LCBjaGFuLCBvZmZjaGFuLAorICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbF90eXBlLCBjaGFubmVsX3R5cGVfdmFsaWQsIHdhaXQsCisgICAgICAgICAgICAgICAgICAgICBidWYsIGxlbiwgY29va2llKTsKKyNlbHNlCisgICAgcmV0ID0gX193bGFuX2hkZF9tZ210X3R4KHdpcGh5LCBkZXYsIGNoYW4sIGNoYW5uZWxfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbF90eXBlX3ZhbGlkLCBidWYsIGxlbiwgY29va2llKTsKKyNlbmRpZiAvL0xJTlVYX1ZFUlNJT05fQ09ERQorICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDIsNiwzOCkpCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDYsMCkpCitpbnQgX193bGFuX2hkZF9jZmc4MDIxMV9tZ210X3R4X2NhbmNlbF93YWl0KHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgd2lyZWxlc3NfZGV2ICp3ZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTY0IGNvb2tpZSkKK3sKKyAgICB1NjQgY29va2llX2R1bW15OworICAgIGNvb2tpZV9kdW1teSA9IGNvb2tpZSA8PCAzMjsKKyAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfSERELAorICAgICAgICAgICAgICAgICAgICAgVFJBQ0VfQ09ERV9IRERfTUdNVF9UWF9DQU5DRUxfV0FJVCwgTk9fU0VTU0lPTiwgY29va2llX2R1bW15KSk7CisgICAgcmV0dXJuIHdsYW5faGRkX2NmZzgwMjExX2NhbmNlbF9yZW1haW5fb25fY2hhbm5lbCggd2lwaHksIHdkZXYsIGNvb2tpZSApOworfQorI2Vsc2UKK2ludCBfX3dsYW5faGRkX2NmZzgwMjExX21nbXRfdHhfY2FuY2VsX3dhaXQoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1NjQgY29va2llKQoreworICAgIHU2NCBjb29raWVfZHVtbXk7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgPSBXT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F9fZnVuY19fKTsKKyAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgcGFyYW0rKzsKKyAgICByZXQgPSBzc2NhbmYocGFyYW0sICIlZCAlZCAlZCIsICZjb3VudCwgJnN0YXJ0X3RpbWUsICZkdXJhdGlvbik7CisgICAgaWYgKHJldCA8IDMpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiJXM6IFAyUF9TRVQgR08gTm9BOiBmYWlsIHRvIHJlYWQgcGFyYW0gIgorICAgICAgICAgICAgICAgImNvdW50PSVkIGR1cmF0aW9uPSVkIGludGVydmFsPSVkICIsCisgICAgICAgICAgICAgICAgX19mdW5jX18sIGNvdW50LCBzdGFydF90aW1lLCBkdXJhdGlvbik7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICIlczogUDJQX1NFVCBHTyBOb0E6IGNvdW50PSVkIGR1cmF0aW9uPSVkIGludGVydmFsPSVkIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgY291bnQsIHN0YXJ0X3RpbWUsIGR1cmF0aW9uKTsKKyAgICBkdXJhdGlvbiA9IE1TX1RPX01VUyhkdXJhdGlvbik7CisgICAgLyogUFMgU2VsZWN0aW9uCisgICAgICogUGVyaW9kaWMgTm9BICgyKQorICAgICAqIFNpbmdsZSBOT0EgICAoNCkKKyAgICAgKi8KKyAgICBOb0Eub3BwX3BzID0gMDsKKyAgICBOb0EuY3RXaW5kb3cgPSAwOworICAgIGlmIChjb3VudCA9PSAxKQorICAgIHsKKyAgICAgICAgTm9BLmR1cmF0aW9uID0gMDsKKyAgICAgICAgTm9BLnNpbmdsZV9ub2FfZHVyYXRpb24gPSBkdXJhdGlvbjsKKyAgICAgICAgTm9BLnBzU2VsZWN0aW9uID0gUDJQX1BPV0VSX1NBVkVfVFlQRV9TSU5HTEVfTk9BOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBOb0EuZHVyYXRpb24gPSBkdXJhdGlvbjsKKyAgICAgICAgTm9BLnNpbmdsZV9ub2FfZHVyYXRpb24gPSAwOworICAgICAgICBOb0EucHNTZWxlY3Rpb24gPSBQMlBfUE9XRVJfU0FWRV9UWVBFX1BFUklPRElDX05PQTsKKyAgICB9CisgICAgTm9BLmludGVydmFsID0gTVNfVE9fTVVTKDEwMCk7CisgICAgTm9BLmNvdW50ID0gY291bnQ7CisgICAgTm9BLnNlc3Npb25pZCA9IHBBZGFwdGVyLT5zZXNzaW9uSWQ7CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAiJXM6IFAyUF9QU19BVFRSOm9wcFBTICVkIGN0V2luZG93ICVkIGR1cmF0aW9uICVkICIKKyAgICAgICAgICAgICAgICAiaW50ZXJ2YWwgJWQgY291bnQgJWQgc2luZ2xlIG5vYSBkdXJhdGlvbiAlZCAiCisgICAgICAgICAgICAgICAgIlBzU2VsZWN0aW9uICV4IiwgX19mdW5jX18sIE5vQS5vcHBfcHMsCisgICAgICAgICAgICAgICAgTm9BLmN0V2luZG93LCBOb0EuZHVyYXRpb24sIE5vQS5pbnRlcnZhbCwgCisgICAgICAgICAgICAgICAgTm9BLmNvdW50LCBOb0Euc2luZ2xlX25vYV9kdXJhdGlvbiwKKyAgICAgICAgICAgICAgICBOb0EucHNTZWxlY3Rpb24pOworCisgICAgc21lX3AycFNldFBzKGhIYWwsICZOb0EpOworICAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qKgorICogaGRkX3NldFAycE9wcHMKKyAqCisgKkZVTkNUSU9OOgorICogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZn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cHBzCisgICAgICogV2hlbiB1c2VyIHdhbnQgdG8gc2V0IGN0V2luZG93IGR1cmluZyB0aGF0IHRpbWUgb3RoZXIgcGFyYW1ldGVycworICAgICAqIHZhbHVlcyBhcmUgY29taW5nIGZyb20gd3BhX3N1cHBsaWNhbnQgYXMgLTEuCisgICAgICogRXhhbXBsZSA6IFVzZXIgd2FudCB0byBzZXQgY3RXaW5kb3cgd2l0aCAzMCB0aGVuIHdwYV9jbGkgY29tbWFuZCA6CisgICAgICogUDJQX1NFVCBjdHdpbmRvdyAzMAorICAgICAqIENvbW1hbmQgUmVjZWl2ZWQgYXQgaGRkX2hvc3RhcGRfaW9jdGwgaXMgYXMgYmVsb3c6CisgICAgICogUDJQX1NFVF9QUyAtMSAtMSAzMCAobGVnYWN5X3BzID0gLTEsIG9wcF9wcyA9IC0xLCBjdHdpbmRvdyA9IDMwKQorICAgICAqLworICAgIGlmIChjdHdpbmRvdyAhPSAtMSkKKyAgICB7CisKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgIk9wcG9ydHVuaXN0aWMgUG93ZXIgU2F2ZSBpcyAlcyIsCisgICAgICAgICAgICAgICAgICAgIChUUlVFID09IHBBZGFwdGVyLT5vcHMpID8gIkVuYWJsZSIgOiAiRGlzYWJsZSIgKTsKKworICAgICAgICBpZiAoY3R3aW5kb3cgIT0gcEFkYXB0ZXItPmN0dykKKyAgICAgICAgeworICAgICAgICAgICAgcEFkYXB0ZXItPmN0dyA9IGN0d2luZG93OworCisgICAgICAgICAgICBpZihwQWRhcHRlci0+b3BzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIE5vQS5vcHBfcHMgPSBwQWRhcHRlci0+b3BzOworICAgICAgICAgICAgICAgIE5vQS5jdFdpbmRvdyA9IHBBZGFwdGVyLT5jdHc7CisgICAgICAgICAgICAgICAgTm9BLmR1cmF0aW9uID0gMDsKKyAgICAgICAgICAgICAgICBOb0Euc2luZ2xlX25vYV9kdXJhdGlvbiA9IDA7CisgICAgICAgICAgICAgICAgTm9BLmludGVydmFsID0gMDsKKyAgICAgICAgICAgICAgICBOb0EuY291bnQgPSAwOworICAgICAgICAgICAgICAgIE5vQS5wc1NlbGVjdGlvbiA9IFAyUF9QT1dFUl9TQVZFX1RZUEVfT1BQT1JUVU5JU1RJQzsKKyAgICAgICAgICAgICAgICBOb0Euc2Vzc2lvbmlkID0gcEFkYXB0ZXItPnNlc3Npb25JZDsKKworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogUDJQX1BTX0FUVFI6b3BwUFMgJWQgY3RXaW5kb3cgJWQgZHVyYXRpb24gJWQgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpbnRlcnZhbCAlZCBjb3VudCAlZCBzaW5nbGUgbm9hIGR1cmF0aW9uICVkICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiUHNTZWxlY3Rpb24gJXgiLCBfX2Z1bmNfXywgTm9BLm9wcF9wcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBOb0EuY3RXaW5kb3csIE5vQS5kdXJhdGlvbiwgTm9BLmludGVydmFsLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBOb0EuY291bnQsIE5vQS5zaW5nbGVfbm9hX2R1cmF0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5vQS5wc1NlbGVjdGlvbik7CisKKyAgICAgICAgICAgICAgIHNtZV9wMnBTZXRQcyhoSGFsLCAmTm9BKTsKKyAgICAgICAgICAgfQorICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorICAgIH0KKworICAgIGlmIChvcHBfcHMgIT0gLTEpCisgICAgeworICAgICAgICBwQWRhcHRlci0+b3BzID0gb3BwX3BzOworCisgICAgICAgIGlmICgob3BwX3BzICE9IC0xKSAmJiAocEFkYXB0ZXItPmN0dykpCisgICAgICAgIHsKKyAgICAgICAgICAgIE5vQS5vcHBfcHMgPSBvcHBfcHM7CisgICAgICAgICAgICBOb0EuY3RXaW5kb3cgPSBwQWRhcHRlci0+Y3R3OworICAgICAgICAgICAgTm9BLmR1cmF0aW9uID0gMDsKKyAgICAgICAgICAgIE5vQS5zaW5nbGVfbm9hX2R1cmF0aW9uID0gMDsKKyAgICAgICAgICAgIE5vQS5pbnRlcnZhbCA9IDA7CisgICAgICAgICAgICBOb0EuY291bnQgPSAwOworICAgICAgICAgICAgTm9BLnBzU2VsZWN0aW9uID0gUDJQX1BPV0VSX1NBVkVfVFlQRV9PUFBPUlRVTklTVElDOworICAgICAgICAgICAgTm9BLnNlc3Npb25pZCA9IHBBZGFwdGVyLT5zZXNzaW9uSWQ7CisKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBQMlBfUFNfQVRUUjpvcHBQUyAlZCBjdFdpbmRvdyAlZCBkdXJhdGlvbiAlZCAiCisgICAgICAgICAgICAgICAgICAgICAgICAiaW50ZXJ2YWwgJWQgY291bnQgJWQgc2luZ2xlIG5vYSBkdXJhdGlvbiAlZCAiCisgICAgICAgICAgICAgICAgICAgICAgICAiUHNTZWxlY3Rpb24gJXgiLCBfX2Z1bmNfXywgTm9BLm9wcF9wcywKKyAgICAgICAgICAgICAgICAgICAgICAgIE5vQS5jdFdpbmRvdywgTm9BLmR1cmF0aW9uLCBOb0EuaW50ZXJ2YWwsIAorICAgICAgICAgICAgICAgICAgICAgICAgTm9BLmNvdW50LCBOb0Euc2luZ2xlX25vYV9kdXJhdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgIE5vQS5wc1NlbGVjdGlvbik7CisKKyAgICAgICAgICAgc21lX3Ayc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wZSB0eXBlICkKK3sKKyAgICB0QU5JX1U4IHNlc3Npb25UeXBlOworCisgICAgc3dpdGNoKCB0eXBlICkKKyAgICB7CisgICAgICAgIGNhc2UgTkw4MDIxMV9JRlRZUEVfQVA6CisgICAgICAgICAgICBzZXNzaW9uVHlwZSA9IFdMQU5fSEREX1NPRlRBUDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE5MODAyMTFfSUZUWVBFX1AyUF9HTzoKKyAgICAgICAgICAgIHNlc3Npb25UeXBlID0gV0xBTl9IRERfUDJQX0dPOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTkw4MDIxMV9JRlRZUEVfUDJQX0NMSUVOVDoKKyAgICAgICAgICAgIHNlc3Npb25UeXBlID0gV0xBTl9IRERfUDJQX0NMSUVOVDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE5MODAyMTFfSUZUWVBFX1NUQVRJT046CisgICAgICAgICAgICBzZXNzaW9uVHlwZSA9IFdMQU5fSEREX0lORlJBX1NUQVRJT047CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBOTDgwMjExX0lGVFlQRV9NT05JVE9SOgorICAgICAgICAgICAgc2Vzc2lvblR5cGUgPSBXTEFOX0hERF9NT05JVE9SOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBzZXNzaW9uVHlwZSA9IFdMQU5fSEREX0lORlJBX1NUQVRJT047CisgICAgICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICByZXR1cm4gc2Vzc2lvblR5cGU7Cit9CisKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsNywwKSkKK3N0cnVjdCB3aXJlbGVzc19kZXYqIF9fd2xhbl9oZGRfYWRkX3ZpcnR1YWxfaW50ZigKKyAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aXBoeSAqd2lwaHksIGNvbnN0IGNoYXIgKm5hbWUsCisgICAgICAgICAgICAgICAgICBlbnVtIG5sODAyMTFfaWZ0eXBlIHR5cGUsCisgICAgICAgICAgICAgICAgICB1MzIgKmZsYWdzLCBzdHJ1Y3QgdmlmX3BhcmFtcyAqcGFyYW1zICkKKyNlbGlmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMyw2LDApKQorc3RydWN0IHdpcmVsZXNzX2RldiogX193bGFuX2hkZF9hZGRfdmlydHVhbF9pbnRmKAorICAgICAgICAgICAgICAgICAgc3RydWN0IHdpcGh5ICp3aXBoeSwgY2hhciAqbmFtZSwgZW51bSBubDgwMjExX2lmdHlwZSB0eXBlLAorICAgICAgICAgICAgICAgICAgdTMyICpmbGFncywgc3RydWN0IHZpZl9wYXJhbXMgKnBhcmFtcyApCisjZWxpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDIsNiwzOCkpCitzdHJ1Y3QgbmV0X2RldmljZSogX193bGFuX2hkZF9hZGRfdmlydHVhbF9pbnRmKAorICAgICAgICAgICAgICAgICAgc3RydWN0IHdpcGh5ICp3aXBoeSwgY2hhciAqbmFtZSwgZW51bSBubDgwMjExX2lmdHlwZSB0eXBlLAorICAgICAgICAgICAgICAgICAgdTMyICpmbGFncywgc3RydWN0IHZpZl9wYXJhbXMgKnBhcmFtcyApCisjZWxzZQoraW50IF9fd2xhbl9oZGRfYWRkX3ZpcnR1YWxfaW50Ziggc3RydWN0IHdpcGh5ICp3aXBoeSwgY2hhciAqbmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG5sODAyMTFfaWZ0eXBlIHR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTMyICpmbGFncywgc3RydWN0IHZpZl9wYXJhbXMgKnBhcmFtcyApCisjZW5kaWYKK3sKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gKGhkZF9jb250ZXh0X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ZGRyZXNzIG11c3QgYmUKKyAgICAgICAgICAgICAqIGRpZmZlcmVudCBmcm9tIHRoZSBQMlAgRGV2aWNlIEFkZHJlc3MuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHZfTUFDQUREUl90IHAycERldmljZUFkZHJlc3MgPSBwSGRkQ3R4LT5wMnBEZXZpY2VBZGRyZXNzOworICAgICAgICAgICAgcDJwRGV2aWNlQWRkcmVzcy5ieXRlc1s0XSBePSAweDgwOworICAgICAgICAgICAgcEFkYXB0ZXIgPSBoZGRfb3Blbl9hZGFwdGVyKCBwSGRkQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF9nZXRfc2Vzc2lvbl90eXBlKHR5cGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lLCBwMnBEZXZpY2VBZGRyZXNzLmJ5dGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJVRSApOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgIHBBZGFwdGVyID0gaGRkX29wZW5fYWRhcHRlciggcEhkZEN0eCwgd2xhbl9oZGRfZ2V0X3Nlc3Npb25fdHlwZSh0eXBlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZSwgd2xhbl9oZGRfZ2V0X2ludGZfYWRkcihwSGRkQ3R4KSwgVk9TX1RSVUUgKTsKKyAgICB9CisKKyAgICBpZiggTlVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIiVzOiBoZGRfb3Blbl9hZGFwdGVyIGZhaWxlZCIsX19mdW5jX18pOworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMiw2LDM4KSkKKyAgICAgICAgcmV0dXJuIEVSUl9QVFIoLUVJTlZBTCk7CisjZWxzZQorIC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ySWZhY2UoIGhkZF9hZGFwdGVyX3QgKnBNb25BZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5GcmFtZUxlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4KiBwYkZyYW1lcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGZyYW1lVHlwZSApCit7CisgICAgLy9JbmRpY2F0ZSBhIEZyYW1lIG92ZXIgTW9uaXRvciBJbnRmLgorICAgIGludCByeHN0YXQ7CisgICAgc3RydWN0IHNrX2J1ZmYgKnNrYiA9IE5VTEw7CisgICAgaW50IG5lZWRlZF9oZWFkcm9vbSA9IDA7CisgICAgaW50IGZsYWcgPSBIRERfUlhfRkxBR19JVl9TVFJJUFBFRCB8IEhERF9SWF9GTEFHX0RFQ1JZUFRFRCB8CisgICAgICAgICAgICAgICBIRERfUlhfRkxBR19NTUlDX1NUUklQUEVEOworI2lmZGVmIFdMQU5fT1BFTl9TT1VSQ0UKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfSE9MRF9SWF9XQUtFTE9DSworICAgIGhkZF9jb250ZXh0X3QqIHBIZGRDdHggPSAoaGRkX2NvbnRleHRfdCopKHBNb25BZGFwdGVyLT5wSGRkQ3R4KTsKKyNlbmRpZgorI2VuZGlmCisgICAgaGRkTG9nKCBMT0cxLCBGTCgiSW5kaWNhdGUgRnJhbWUgb3ZlciBNb25pdG9yIEludGYiKSk7CisKKyAgICBpZiAoTlVMTCA9PSBwYkZyYW1lcykKKyAgICB7CisgICAgICAgIGhkZExvZyhMT0dFLCBGTCgiTlVMTCBmcmFtZSBwb2ludGVyIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgLyogcm9vbSBmb3IgdGhlIHJhZGlvdGFwIGhlYWRlciBiYXNlZCBvbiBkcml2ZXIgZmVhdHVyZXMKKyAgICAgKiAxIEJ5dGUgZm9yIFJBRElPIFRBUCBGbGFnLCAxIEJ5dGUgcGFkZGluZyBhbmQgMiBCeXRlIGZvcgorICAgICAqIFJYIGZsYWdzLgorICAgICAqICovCisgICAgIG5lZWRlZF9oZWFkcm9vbSA9IHNpemVvZihzdHJ1Y3QgaWVlZTgwMjExX3JhZGlvdGFwX2hlYWRlcikgKyA0OworCisgICAgIC8vYWxsb2Mgc2tiICBoZXJlCisgICAgIHNrYiA9IGFsbG9jX3NrYihWUEtUX1NJWkVfQlVGRkVSLCBHRlBfQVRPTUlDKTsKKyAgICAgaWYgKHVubGlrZWx5KE5VTEwgPT0gc2tiKSkKKyAgICAgeworICAgICAgICAgaGRkTG9nKCBMT0dXLCBGTCgiVW5hYmxlIHRvIGFsbG9jYXRlIHNrYiIpKTsKKyAgICAgICAgIHJldHVybjsKKyAgICAgfQorICAgICBza2JfcmVzZXJ2ZShza2IsIFZQS1RfU0laRV9CVUZGRVIpOworICAgICBpZiAodW5saWtlbHkoc2tiX2hlYWRyb29tKHNrYikgPCBuRnJhbWVMZW5ndGgpKQorICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAiSEREIFslZF06IEluc3VmZmljaWVudCBoZWFkcm9vbSwgIgorICAgICAgICAgICAgICAgICAgICJoZWFkWyVwXSwgZGF0YVslcF0sIHJlcVslZF0iLAorICAgICAgICAgICAgICAgICAgIF9fTElORV9fLCBza2ItPmhlYWQsIHNrYi0+ZGF0YSwgbkZyYW1lTGVuZ3RoKTsKKyAgICAgICAgIGtmcmVlX3NrYihza2IpOworICAgICAgICAgcmV0dXJuIDsKKyAgICAgfQorICAgICAvLyBhY3R1YWxseSBwdXNoIHRoZSBkYXRhCisgICAgIG1lbWNweShza2JfcHVzaChza2IsIG5GcmFtZUxlbmd0aCksIHBiRnJhbWVzLCBuRnJhbWVMZW5ndGgpOworICAgICAvKiBwcmVwZW5kIHJhZGlvdGFwIGluZm9ybWF0aW9uICovCisgICAgIGlmKCAwICE9IGhkZF93bGFuX2FkZF9yeF9yYWRpb3RhcF9oZHIoIHNrYiwgbmVlZGVkX2hlYWRyb29tLCBmbGFnICkgKQorICAgICB7CisgICAgICAgICBoZGRMb2coIExPR0UsIEZMKCJOb3QgQWJsZSBBZGQgUmFkaW8gVGFwIikpOworICAgICAgICAgLy9mcmVlIHNrYgorICAgICAgICAga2ZyZWVfc2tiKHNrYik7CisgICAgICAgICByZXR1cm4gOworICAgICB9CisKKyAgICAgc2tiX3Jlc2V0X21hY19oZWFkZXIoIHNrYiApOworICAgICBza2ItPmRldiA9IHBNb25BZGFwdGVyLT5kZXY7CisgICAgIHNrYi0+cHJvdG9jb2wgPSBldGhfdHlwZV90cmFucyggc2tiLCBza2ItPmRldiApOworICAgICBza2ItPmlwX3N1bW1lZCA9IENIRUNLU1VNX05PTkU7CisjaWZkZWYgV0xBTl9PUEVOX1NPVVJDRQorI2lmZGVmIFdMQU5fRkVBVFVSRV9IT0xEX1JYX1dBS0VMT0NLCisgICAgIHZvc193YWtlX2xvY2tfdGltZW91dF9yZWxlYXNlKCZwSGRkQ3R4LT5yeF93YWtlX2xvY2ssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhERF9XQUtFX0xPQ0tfRFVSQVRJT04sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdJRklfUE9XRVJfRVZFTlRfV0FLRUxPQ0tfSE9MRF9SWCk7CisjZW5kaWYKKyNlbmRpZgorICAgICByeHN0YXQgPSBuZXRpZl9yeF9uaShza2IpOworICAgICBpZiggTkVUX1JYX1NVQ0NFU1MgPT0gcnhzdGF0ICkKKyAgICAgeworICAgICAgICAgaGRkTG9nKCBMT0cxLCBGTCgiU3VjY2VzcyIpKTsKKyAgICAgfQorICAgICBlbHNlCisgICAgICAgICBoZGRMb2coIExPR0UsIEZMKCJGYWlsZWQgJWQiKSwgcnhzdGF0KTsKKworICAgICByZXR1cm4gOworfQorCit2b2lkIF9faGRkX2luZGljYXRlX21nbXRfZnJhbWUoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkZyYW1lTGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTgqIHBiRnJhbWVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggZnJhbWVUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIHJ4Q2hhbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1M4IHJ4UnNzaSkKK3sKKyAgICB0QU5JX1UxNiBmcmVxOworICAgIHRBTklfVTE2IGV4dGVuZF90aW1lOworICAgIHRBTklfVTggdHlwZSA9IDA7CisgICAgdEFOSV9VOCBzdWJUeXBlID0gMDsKKyAgICB0QWN0aW9uRnJtVHlwZSBhY3Rpb25Gcm1UeXBlOworICAgIGhkZF9jZmc4MDIxMV9zdGF0ZV90ICpjZmdTdGF0ZSA9IE5VTEw7CisgICAgaGRkX3NjYW5pbmZvX3QgKnBTY2FuSW5mbyA9IE5VTEw7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IE5VTEw7CisgICAgVk9TX1NUQVRVUyBzdGF0dXM7CisgICAgaGRkX3JlbWFpbl9vbl9jaGFuX2N0eF90KiBwUmVtYWluQ2hhbkN0eCA9IE5VTEw7CisKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sIEZMKCJGcmFtZSBUeXBlID0gJWQgRnJhbWUgTGVuZ3RoID0gJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgIGZyYW1lVHlwZSwgbkZyYW1lTGVuZ3RoKTsKKworICAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgIHsKKyAgICAgICAgaGRkTG9nKExPR0UsIEZMKCJwQWRhcHRlciBpcyBOVUxMIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaWYgKDAgPT0gbkZyYW1lTGVuZ3RoKQorICAgIHsKKyAgICAgICAgaGRkTG9nKExPR0UsIEZMKCJGcmFtZSBMZW5ndGggaXMgSW52YWxpZCBaRVJPIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaWYgKE5VTEwgPT0gcGJGcmFtZXMpCisgICAgeworICAgICAgICBoZGRMb2coTE9HRSwgRkwoInBiRnJhbWVzIGlzIE5VTEwiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICB0eXBlID0gV0xBTl9IRERfR0VUX1RZUEVfRlJNX0ZDKHBiRnJhbWVzWzBdKTsKKyAgICBzdWJUeXBlID0gV0xBTl9IRERfR0VUX1NVQlRZUEVfRlJNX0ZDKHBiRnJhbWVzWzBdKTsKKworICAgIC8qIEdldCBwQWRhcHRlciBmcm9tIERlc3RpbmF0aW9uIG1hYyBhZGRyZXNzIG9mIHRoZSBmcmFtZSAqLworICAgIGlmICgodHlwZSA9PSBTSVJfTUFDX01HTVRfRlJBTUUpICYmCisgICAgICAgICAgICAoc3ViVHlwZSAhPSBTSVJfTUFDX01HTVRfUFJPQkVfUkVRKSkKKyAgICB7CisgICAgICAgICBwQWRhcHRlciA9IGhkZF9nZXRfYWRhcHRlcl9ieV9tYWNhZGRyKCBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcGJGcmFtZXNbV0xBTl9IRERfODAyMTFfRlJNX0RBX09GRlNFVF0pOworICAgICAgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgICAgICB7CisgICAgICAgICAgICAgLyogVW5kZXIgYXNzdW10aW9uIHRoYXQgd2UgZG9uJ3QgcmVjZWl2ZSBhbnkgYWN0aW9uIGZyYW1lCisgICAgICAgICAgICAgICogd2l0aCBCQ1NUIGFzIGRlc3RpbmF0aW9uIHdlIGRyb3BwaW5nIGFjdGlvbiBmcmFtZQorICAgICAgICAgICAgICAqLworICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsInBBZGFwdGVyIGZvciBhY3Rpb24gZnJhbWUgaXMgTlVMTCBNYWNhZGRyID0gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSRVNTX1NUUiAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkoJnBiRnJhbWVzW1dMQU5fSEREXzgwMjExX0ZSTV9EQV9PRkZTRVRdKSk7CisgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwgIiVzOiBGcmFtZSBUeXBlID0gJWQgRnJhbWUgTGVuZ3RoID0gJWQiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIHN1YlR5cGUgPSAlZCIsX19mdW5jX18sZnJhbWVUeXBlLG5GcmFtZUxlbmd0aCxzdWJUeXBlKTsKKyAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICB9CisgICAgfQorCisKKyAgICBpZiAoTlVMTCA9PSBwQWRhcHRlci0+ZGV2KQorICAgIHsKKyAgICAgICAgaGRkTG9nKCBMT0dFLCBGTCgicEFkYXB0ZXItPmRldiBpcyBOVUxMIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaWYgKFdMQU5fSEREX0FEQVBURVJfTUFHSUMgIT0gcEFkYXB0ZXItPm1hZ2ljKQorICAgIHsKKyAgICAgICAgaGRkTG9nKCBMT0dFLCBGTCgicEFkYXB0ZXIgaGFzIGludmFsaWQgbWFnaWMiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgaWYgKE5VTEwgPT0gcEhkZEN0eCkKKyAgICB7CisgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCIlczogSEREIENvbnRleHQgTnVsbCBQb2ludGVyIiwgX19mdW5jX18pOworICAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmICgoV0xBTl9IRERfU09GVEFQID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkgfHwKKyAgICAgICAgKFdMQU5fSEREX1AyUF9HTyA9PSBwQWRhcHRlci0+ZGV2aWNlX21vZGUgKSkKKyAgICB7CisgICAgICAgIGhkZF9hZGFwdGVyX3QgKnBNb25BZGFwdGVyID0KKyAgICAgICAgICAgIGhkZF9nZXRfbW9uX2FkYXB0ZXIoIFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpICk7CisKKyAgICAgICAgaWYgKE5VTEwgIT0gcE1vbkFkYXB0ZXIpCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyggTE9HMSwgRkwoIkluZGljYXRlIEZyYW1lIG92ZXIgTW9uaXRvciBJbnRlcmZhY2UiKSk7CisgICAgICAgICAgICBoZGRfc2VuZE1nbXRGcmFtZU92ZXJNb25pdG9ySWZhY2UoIHBNb25BZGFwdGVyLCBuRnJhbWVMZW5ndGgsCisgICAgICAgICAgICAgICAgICAgIHBiRnJhbWVzLCBmcmFtZVR5cGUpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgfQorCisgICAgLy9DaGFubmVsIGluZGljYXRlZCBtYXkgYmUgd3JvbmcuIFRPRE8KKyAgICAvL0luZGljYXRlIGFuIGFjdGlvbiBmcmFtZS4KKyAgICBpZiggcnhDaGFuIDw9IE1BWF9OT19PRl8yXzRfQ0hBTk5FTFMgKQorICAgIHsKKyAgICAgICAgZnJlcSA9IGllZWU4MDIxMV9jaGFubmVsX3RvX2ZyZXF1ZW5jeSggcnhDaGFuLAorICAgICAgICAgICAgICAgIElFRUU4MDIxMV9CQU5EXzJHSFopOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBmcmVxID0gaWVlZTgwMjExX2No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ICBpZihhY3Rpb25Gcm1UeXBlID49IE1BWF9QMlBfQUNUSU9OX0ZSQU1FX1RZUEUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJbUDJQXSB1bmtub3duWyVkXSA8LS0tIE9UQSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aW9uRnJtVHlwZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIltQMlBdICVzIDwtLS0gT1RBIiwKKyAgICAgICAgICAgICAgICAgICAgcDJwX2FjdGlvbl9mcmFtZV90eXBlW2FjdGlvbkZybVR5cGVdKTsKKyAgICAgICAgICAgICAgICAgICAgaWYoIChhY3Rpb25Gcm1UeXBlID09IFdMQU5fSEREX1BST1ZfRElTX1JFUSkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIChnbG9iYWxQMlBDb25uZWN0aW9uU3RhdHVzID09IFAyUF9OT1RfQUNUSVZFKSApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICBnbG9iYWxQMlBDb25uZWN0aW9uU3RhdHVzID0gUDJQX0dPX05FR19QUk9DRVNTOworICAgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCJbUDJQIFN0YXRlXUluYWN0aXZlIHN0YXRlIHRvICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJHTyBuZWdvdGlhdGlvbiBwcm9ncmVzcyBzdGF0ZSIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoIChhY3Rpb25Gcm1UeXBlID09IFdMQU5fSEREX0dPX05FR19DTkYpICYmCisgICAgICAgICAgICAgICAgICAgICAgICAoZ2xvYmFsUDJQQ29ubmVjdGlvblN0YXR1cyA9PSBQMlBfR09fTkVHX1BST0NFU1MpICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgIGdsb2JhbFAyUENvbm5lY3Rpb25TdGF0dXMgPSBQMlBfR09fTkVHX0NPTVBMRVRFRDsKKyAgICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsIltQMlAgU3RhdGVdR08gbmVnb3RpYXRpb24gcHJvZ3Jlc3MgdG8gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiR08gbmVnb3RpYXRpb24gY29tcGxldGVkIHN0YXRlIik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiggKGFjdGlvbkZybVR5cGUgPT0gV0xBTl9IRERfSU5WSVRBVElPTl9SRVEpICYmCisgICAgICAgICAgICAgICAgICAgICAgICAoZ2xvYmFsUDJQQ29ubmVjdGlvblN0YXR1cyA9PSBQMlBfTk9UX0FDVElWRSkgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgZ2xvYmFsUDJQQ29ubmVjdGlvblN0YXR1cyA9IFAyUF9HT19ORUdfQ09NUExFVEVEOworICAgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCJbUDJQIFN0YXRlXUluYWN0aXZlIHN0YXRlIHRvIEdPIG5lZ290aWF0aW9uIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgY29tcGxldGVkIHN0YXRlIEF1dG9ub21vdXMgR08gZm9ybWF0aW9uIik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgICAgICBtdXRleF9sb2NrKCZwSGRkQ3R4LT5yb2NfbG9jayk7CisgICAgICAgICAgICAgcFJlbWFpbkNoYW5DdHggPSBjZmdTdGF0ZS0+cmVtYWluX29uX2NoYW5fY3R4OworCisgICAgICAgICAgICAgaWYgKHBSZW1haW5DaGFuQ3R4ICE9IE5VTEwgJiYgVk9TX1RJTUVSX1NUQVRFX1JVTk5JTkcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHZvc190aW1lcl9nZXRDdXJyZW50U3RhdGUoJnBSZW1haW5DaGFuQ3R4LT5oZGRfcmVtYWluX29uX2NoYW5fdGltZXIpKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgaWYgKCBhY3Rpb25Gcm1UeXBlID09IFdMQU5fSEREX0dPX05FR19SRVEgfHwKKyAgICAgICAgICAgICAgICAgICAgICBhY3Rpb25Gcm1UeXBlID09IFdMQU5fSEREX0dPX05FR19SRVNQIHx8CisgICAgICAgICAgICAgICAgICAgICAgYWN0aW9uRnJtVHlwZSA9PSBXTEFOX0hERF9JTlZJVEFUSU9OX1JFUSB8fAorICAgICAgICAgICAgICAgICAgICAgIGFjdGlvbkZybVR5cGUgPT0gV0xBTl9IRERfREVWX0RJU19SRVEgfHwKKyAgICAgICAgICAgICAgICAgICAgICBhY3Rpb25Gcm1UeXBlID09IFdMQU5fSEREX1BST1ZfRElTX1JFUSApCisgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBoZGRMb2coIExPRzEsICJFeHRlbmQgUm9DIHRpbWVyIG9uIHJlY2VwdGlvbiBvZiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgQWN0aW9uIEZyYW1lIik7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKChhY3Rpb25Gcm1UeXBlID09IFdMQU5fSEREX0dPX05FR19SRVEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGFjdGlvbkZybVR5cGUgPT0gV0xBTl9IRERfR09fTkVHX1JFU1ApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0ZW5kX3RpbWUgPSAyICogQUNUSU9OX0ZSQU1FX0RFRkFVTFRfV0FJVDsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRlbmRfdGltZSA9IEFDVElPTl9GUkFNRV9ERUZBVUxUX1dBSVQ7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbXBsZXRpb25fZG9uZSgmcEFkYXB0ZXItPnJlbV9vbl9jaGFuX3JlYWR5X2V2ZW50KSkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc190aW1lcl9zdG9wKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBSZW1haW5DaGFuQ3R4LT5oZGRfcmVtYWluX29uX2NoYW5fdGltZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSB2b3NfdGltZXJfc3RhcnQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBSZW1haW5DaGFuQ3R4LT5oZGRfcmVtYWluX29uX2NoYW5fdGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0ZW5kX3RpbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKCBMT0dFLCAiUk9DIHRpbWVyIHN0YXJ0IGZhaWxlZCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBCdWZmZXIgUGFja2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwUmVtYWluQ2hhbkN0eC0+YWN0aW9uX3BrdF9idWZmLmZyYW1lX2xlbmd0aCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUmVtYWluQ2hhbkN0eC0+YWN0aW9uX3BrdF9idWZmLmZyYW1lX2xlbmd0aCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuRnJhbWVMZW5ndGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUmVtYWluQ2hhbkN0eC0+YWN0aW9uX3BrdF9idWZmLmZyZXEgPSBmcmVxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJlbWFpbkNoYW5DdHgtPmFjdGlvbl9wa3RfYnVmZi5mcmFtZV9wdHIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gdm9zX21lbV9tYWxsb2MobkZyYW1lTGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUmVtYWluQ2hhbkN0eC0+YWN0aW9uX3BrdF9idWZmLmZyYW1lX3B0ciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYkZyYW1lcywgbkZyYW1lTGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyggTE9HRSwiJXM6IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQWN0aW9uIFBrdCBDYWNoZWQgc3VjY2Vzc2Z1bGx5ICEhISIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyggTE9HRSwiJXM6IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRnJhbWVzIGFyZSBwZW5kaW5nLiBkcm9wcGluZyBmcmFtZSAhISEiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT5yb2NfbG9jayk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICB9CisgICAgICAgICAgICAgaWYgKHBSZW1haW5DaGFuQ3R4ICE9IE5VTEwgJiYKKyAgICAgICAgICAgICAgICAgIFZPU19USU1FUl9TVEFURV9SVU5OSU5HICE9IHZvc190aW1lcl9nZXRDdXJyZW50U3RhdGUoCisgICAgICAgICAgICAgICAgICAgICAgJmNmZ1N0YXRlLT5yZW1haW5fb25fY2hhbl9jdHgtPmhkZF9yZW1haW5fb25fY2hhbl90aW1lcikpCisgICAgICAgICAgICAgICAgIGhkZExvZyggTE9HMSwgIiVzOiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAiUmN2ZCBhY3Rpb24gZnJhbWUgYWZ0ZXIgdGltZXIgZXhwaXJlZCAiLCBfX2Z1bmNfXyk7CisKKyAgICAgICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnJvY19sb2NrKTsKKworICAgICAgICAgICAgIGlmICgoKGFjdGlvbkZybVR5cGUgPT0gV0xBTl9IRERfUFJPVl9ESVNfUkVTUCkgJiYKKyAgICAgICAgICAgICAgICAgICAoY2ZnU3RhdGUtPmFjdGlvbkZybVN0YXRlID09IEhERF9QRF9SRVFfQUNLX1BFTkRJTkcpKSB8fAorICAgICAgICAgICAgICAgICAgKChhY3Rpb25Gcm1UeXBlID09IFdMQU5fSEREX0dPX05FR19SRVNQKSAmJgorICAgICAgICAgICAgICAgICAgIChjZmdTdGF0ZS0+YWN0aW9uRnJtU3RhdGUgPT0gSEREX0dPX05FR19SRVFfQUNLX1BFTkRJTkcpKSkKKyAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIGhkZExvZyhMT0cxLCAiJXM6IEFDS19QRU5ESU5HIGFuZCBCdXQgcmVjZWl2ZWQgUkVTUCBmb3IgQWN0aW9uIGZyYW1lICIsCisgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICAgICAgICBoZGRfc2VuZEFjdGlvbkNuZihwQWRhcHRlciwgVFJVRSk7CisgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgICAgICAgICAgICBlbHNlIGlmKHBiRnJhbWVzW1dMQU5fSEREX1BVQkxJQ19BQ1RJT05fRlJBTUVfT0ZGU0VUKzFdID09IFdMQU5fSEREX1BVQkxJQ19BQ1RJT05fVERMU19ESVNDX1JFU1ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdTggKm1hYyA9ICZwYkZyYW1lc1tXTEFOX0hERF84MDIxMV9GUk1fREFfT0ZGU0VUKzZdOworICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywiW1RETFNdIFRETFMgRGlzY292ZXJ5IFJlc3BvbnNlLCIgTUFDX0FERFJFU1NfU1RSICIgUlNTSVslZF0gPC0tLSBPVEEiLAorICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShtYWMpLHJ4UnNzaSk7CisKKyAgICAgICAgICAgICAgICB3bGFuX2hkZF90ZGxzX3NldF9yc3NpKHBBZGFwdGVyLCBtYWMsIHJ4UnNzaSk7CisgICAgICAgICAgICAgICAgd2xhbl9oZGRfdGRsc19yZWN2X2Rpc2NvdmVyeV9yZXNwKHBBZGFwdGVyLCBtYWMpOworICAgICAgICAgICAgfQorI2VuZGlmCisgICAgICAgIH0KKworICAgICAgICAgcFNjYW5JbmZvID0gICZwSGRkQ3R4LT5zY2FuX2luZm87CisgICAgICAgICBpZiAoKHBTY2FuSW5mbyAhPSBOVUxMKSAmJiAocEhkZEN0eC0+c2Nhbl9pbmZvLm1TY2FuUGVuZGluZykpCisgICAgICAgICB7CisgICAgICAgICAgICAgaGRkTG9nKExPR0UsIkFjdGlvbiBmcmFtZSByZWNlaXZlZCB3aGVuIFNjYW5uaW5nIGlzIGluIgorICAgICAgICAgICAgICAgICAgICAgICAgICAiIHByb2dyZXNzLiBBYm9ydCBTY2FuLiIpOworICAgICAgICAgICAgIGhkZF9hYm9ydF9tYWNfc2NhbihwQWRhcHRlci0+cEhkZEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjYW5JbmZvLT5zZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfU0NBTl9BQk9SVF9ERUZBVUxUKTsKKyAgICAgICAgIH0KKworICAgICAgICBpZihwYkZyYW1lc1tXTEFOX0hERF9QVUJMSUNfQUNUSU9OX0ZSQU1FX09GRlNFVF0gPT0gV0xBTl9IRERfVERMU19BQ1RJT05fRlJBTUUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGFjdGlvbkZybVR5cGUgPSBwYkZyYW1lc1tXTEFOX0hERF9QVUJMSUNfQUNUSU9OX0ZSQU1FX09GRlNFVCsxXTsKKyAgICAgICAgICAgIGlmKGFjdGlvbkZybVR5cGUgPj0gTUFYX1RETFNfQUNUSU9OX0ZSQU1FX1RZUEUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCJbVERMU10gQWN0aW9uIHR5cGVbJWRdIDwtLS0gT1RBIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGlvbkZybVR5cGUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywiW1RETFNdICVzIDwtLS0gT1RBIiwKKyAgICAgICAgICAgICAgICAgICAgdGRsc19hY3Rpb25fZnJhbWVfdHlwZVthY3Rpb25Gcm1UeXBlXSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZigocGJGcmFtZXNbV0xBTl9IRERfUFVCTElDX0FDVElPTl9GUkFNRV9PRkZTRVRdID09IFdMQU5fSEREX1FPU19BQ1RJT05fRlJBTUUpJiYKKyAgICAgICAgICAgICAocGJGcmFtZXNbV0xBTl9IRERfUFVCTElDX0FDVElPTl9GUkFNRV9PRkZTRVQrMV0gPT0gV0xBTl9IRERfUU9TX01BUF9DT05GSUdVUkUpICkKKyAgICAgICAgeworICAgICAgICAgICAgc21lX1VwZGF0ZURTQ1B0b1VQTWFwcGluZyhwSGRkQ3R4LT5oSGFsLAorICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5oZGRXbW1Ec2NwVG9VcE1hcCwgcEFkYXB0ZXItPnNlc3Npb25JZCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvL0luZGljYXRlIEZyYW1lIE92ZXIgTm9ybWFsIEludGVyZmFjZQorICAgIGhkZExvZyggTE9HMSwgRkwoIkluZGljYXRlIEZyYW1lIG92ZXIgTkw4MDIxMSBJbnRlcmZhY2UiKSk7CisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE4LDApKQorICAgIGNmZzgwMjExX3J4X21nbXQocEFkYXB0ZXItPmRldi0+aWVlZTgwMjExX3B0ciwgZnJlcSwgMCwgcGJGcmFtZXMsCisgICAgICAgICAgICAgICAgICAgICBuRnJhbWVMZW5ndGgsIE5MODAyMTFfUlhNR01UX0ZMQUdfQU5TV0VSRUQpOworI2VsaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDEyLDApKQorICAgIGNmZzgwMjExX3J4X21nbXQocEFkYXB0ZXItPmRldi0+aWVlZTgwMjExX3B0ciwgZnJlcSwgMCwgcGJGcmFtZXMsCisgICAgICAgICAgICAgICAgICAgICBuRnJhbWVMZW5ndGgsIE5MODAyMTFfUlhNR01UX0ZMQUdfQU5TV0VSRUQsIEdGUF9BVE9NSUMpOworI2VsaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDYsMCkpCisgICAgY2ZnODAyMTFfcnhfbWdtdCggcEFkYXB0ZXItPmRldi0+aWVlZTgwMjExX3B0ciwgZnJlcSwgMCwKKyAgICAgICAgICAgICAgICAgICAgICBwYkZyYW1lcywgbkZyYW1lTGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgIEdGUF9BVE9NSUMgKTsKKyNlbGlmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMyw0LDApKQorICAgIGNmZzgwMjExX3J4X21nbXQoIHBBZGFwdGVyLT5kZXYsIGZyZXEsIDAsCisgICAgICAgICAgICAgICAgICAgICAgcGJGcmFtZXMsIG5GcmFtZUxlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICBHRlBfQVRPTUlDICk7CisjZWxzZQorICAgIGNmZzgwMjExX3J4X21nbXQoIHBBZGFwdGVyLT5kZXYsIGZyZXEsCisgICAgICAgICAgICAgICAgICAgICAgcGJGcmFtZXMsIG5GcmFtZUxlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICBHRlBfQVRPTUlDICk7CisjZW5kaWYgLy9MSU5VWF9WRVJTSU9OX0NPREUKK30KKworLyoKKyAqIGllZWU4MDIxMV9hZGRfcnhfcmFkaW90YXBfaGVhZGVyIC0gYWRkIHJhZGlvdGFwIGhlYWRlcgorICovCitzdGF0aWMgaW50IGhkZF93bGFuX2FkZF9yeF9yYWRpb3RhcF9oZHIgKAorICAgICAgICAgICAgIHN0cnVjdCBza19idWZmICpza2IsIGludCBydGFwX2xlbiwgaW50IGZsYWcgKQoreworICAgIHU4IHJ0YXBfdGVtcFsyMF0gPSB7MH07CisgICAgc3RydWN0IGllZWU4MDIxMV9yYWRpb3RhcF9oZWFkZXIgKnJ0aGRyOworICAgIHVuc2lnbmVkIGNoYXIgKnBvczsKKyAgICB1MTYgcnhfZmxhZ3MgPSAwOworCisgICAgcnRoZHIgPSAoc3RydWN0IGllZWU4MDIxMV9yYWRpb3RhcF9oZWFkZXIgKikoJnJ0YXBfdGVtcFswXSk7CisKKyAgICAvKiByYWRpb3RhcCBoZWFkZXIsIHNldCBhbHdheXMgcHJlc2VudCBmbGFncyAqLworICAgIHJ0aGRyLT5pdF9wcmVzZW50ID0gY3B1X3RvX2xlMzIoKDEgPDwgSUVFRTgwMjExX1JBRElPVEFQX0ZMQUdTKSAgIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgxIDw8IElFRUU4MDIxMV9SQURJT1RBUF9SWF9GTEFHUykpOworICAgIHJ0aGRyLT5pdF9sZW4gPSBjcHVfdG9fbGUxNihydGFwX2xlbik7CisKKyAgICBwb3MgPSAodW5zaWduZWQgY2hhciAqKSAocnRoZHIgKyAxKTsKKworICAgIC8qIHRoZSBvcmRlciBvZiB0aGUgZm9sbG93aW5nIGZpZWxkcyBpcyBpbXBvcnRhbnQgKi8KKworICAgIC8qIElFRUU4MDIxMV9SQURJT1RBUF9GTEFHUyAqLworICAgICpwb3MgPSAwOworICAgIHBvcysrOworCisgICAgLyogSUVFRTgwMjExX1JBRElPVEFQX1JYX0ZMQUdTOiBMZW5ndGggMiBCeXRlcyAqLworICAgIC8qIGVuc3VyZSAyIGJ5dGUgYWxpZ25tZW50IGZvciB0aGUgMiBieXRlIGZpZWxkIGFzIHJlcXVpcmVkICovCisgICAgaWYgKChwb3MgLSAodTggKilydGhkcikgJiAxKQorICAgICAgICBwb3MrKzsKKyAgICBwdXRfdW5hbGlnbmVkX2xlMTYocnhfZmx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GFwX2hlYWRlciopIHNrYl9wdXNoKCBza2IsIHJ0SGRyTGVuICk7CisKKyAgICBtZW1zZXQoIHJ0aGRyLCAwLCBydEhkckxlbiApOworICAgIHJ0aGRyLT5pdF9sZW4gPSBjcHVfdG9fbGUxNiggcnRIZHJMZW4gKTsKKyAgICBydGhkci0+aXRfcHJlc2VudCA9IGNwdV90b19sZTMyKCgxIDw8IElFRUU4MDIxMV9SQURJT1RBUF9UWF9GTEFHUykgfAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDEgPDwgSUVFRTgwMjExX1JBRElPVEFQX0RBVEFfUkVUUklFUykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKKworICAgIHBvcyA9ICh1bnNpZ25lZCBjaGFyICopKCBydGhkcisxICk7CisKKyAgICAvLyBGaWxsIFRYIGZsYWdzCisgICAgKnBvcyA9IGFjdGlvblNlbmRTdWNjZXNzOworICAgIHBvcyArPSAyOworCisgICAgLy8gRmlsbCByZXRyeSBjb3VudAorICAgICpwb3MgPSAwOworICAgIHBvcysrOworCisgICAgc2tiX3NldF9tYWNfaGVhZGVyKCBza2IsIDAgKTsKKyAgICBza2ItPmlwX3N1bW1lZCA9IENIRUNLU1VNX05PTkU7CisgICAgc2tiLT5wa3RfdHlwZSAgPSBQQUNLRVRfT1RIRVJIT1NUOworICAgIHNrYi0+cHJvdG9jb2wgID0gaHRvbnMoRVRIX1BfODAyXzIpOworICAgIG1lbXNldCggc2tiLT5jYiwgMCwgc2l6ZW9mKCBza2ItPmNiICkgKTsKKyNpZmRlZiBXTEFOX09QRU5fU09VUkNFCisjaWZkZWYgV0xBTl9GRUFUVVJFX0hPTERfUlhfV0FLRUxPQ0sKKyAgICB2b3Nfd2FrZV9sb2NrX3RpbWVvdXRfcmVsZWFzZSgmcEhkZEN0eC0+cnhfd2FrZV9sb2NrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhERF9XQUtFX0xPQ0tfRFVS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SIEFOWSBTUEVDSUFMLCBESVJFQ1QsIElORElSRUNULCBPUiBDT05TRVFVRU5USUFMCisgKiBEQU1BR0VTIE9SIEFOWSBEQU1BR0VTIFdIQVRTT0VWRVIgUkVTVUxUSU5HIEZST00gTE9TUyBPRiBVU0UsIERBVEEgT1IKKyAqIFBST0ZJVFMsIFdIRVRIRVIgSU4gQU4gQUNUSU9OIE9GIENPTlRSQUNULCBORUdMSUdFTkNFIE9SIE9USEVSCisgKiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SCisgKiBQRVJGT1JNQU5DRSBPRiBUSElTIFNPRlRXQVJFLgorICovCisKKy8qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBcZmlsZSAgd2xhbl9oZGRfc2Nhbi5jCisKKyAgXGJyaWVmIFdMQU4gSG9zdCBEZXZpY2UgRHJpdmVyIGltcGxlbWVudGF0aW9uCisKKworICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29t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FjdCB0aGUgV1BBIGFuZC9vciBSU04gSUVzICovCitzdGF0aWMgZUhhbFN0YXR1cyBoZGRfR2V0V1BBUlNOSUVzKCB2X1U4X3QgKmllRmllbGRzLCB2X1UxNl90IGllX2xlbmd0aCwgY2hhciAqKmxhc3RfZXZlbnQsIGNoYXIgKipjdXJyZW50X2V2ZW50LCBoZGRfc2Nhbl9pbmZvX3QgKnBzY2FuSW5mbyApCit7CisgICAgdl9VOF90IGVpZCwgZWxlbiwgKmVsZW1lbnQ7CisgICAgdl9VMTZfdCB0aWVfbGVuZ3RoPTA7CisKKyAgICBFTlRFUigpOworCisgICAgZWxlbWVudCA9IGllRmllbGRzOworICAgIHRpZV9sZW5ndGggPSBpZV9sZW5ndGg7CisKKyAgICB3aGlsZSggdGllX2xlbmd0aCA+IDIgJiYgZWxlbWVudCAhPSBOVUxMICkKKyAgICB7CisgICAgICAgIGVpZCA9IGVsZW1lbnRbMF07CisgICAgICAgIGVsZW4gPSBlbGVtZW50WzFdOworCisgICAgICAgIC8qSWYgZWxlbWVudCBsZW5ndGggaXMgZ3JlYXRlciB0aGFuIHRvdGFsIHJlbWFpbmluZyBpZSBsZW5ndGgsCisgICAgICAgICAqYnJlYWsgdGhlIGxvb3AqLworICAgICAgICBpZiAoKGVsZW4rMikgPiB0aWVfbGVuZ3RoKQorICAgICAgICAgICBicmVhazsKKworICAgICAgICBzd2l0Y2goZWlkKQorICAgICAgICB7CisgICAgICAgICAgICBjYXNlIERPVDExRl9FSURfV1BBOgorICAgICAgICAgICAgY2FzZSBET1QxMUZfRUlEX1JTTjoKKyNpZmRlZiBGRUFUVVJFX1dMQU5fV0FQSQorICAgICAgICAgICAgY2FzZSBET1QxMUZfRUlEX1dBUEk6CisjZW5kaWYKKyAgICAgICAgICAgICAgICBpZihoZGRfQWRkSXdTdHJlYW1FdmVudCggSVdFVkdFTklFLCAgZWxlbisyLCAoY2hhciopZWxlbWVudCwgcHNjYW5JbmZvLCBsYXN0X2V2ZW50LCBjdX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ICAgICAgICAgICAgIHNpemVvZiAoZGVzY3JpcHRvci0+YnNzSWQpKTsKKyAgIGN1cnJlbnRfZXZlbnQgPSBpd2Vfc3RyZWFtX2FkZF9ldmVudChzY2FuSW5mby0+aW5mbyxjdXJyZW50X2V2ZW50LCBlbmQsCisgICAgICAgICAgICAgICAgICAgJmV2ZW50LCBJV19FVl9BRERSX0xFTik7CisKKyAgIGlmIChsYXN0X2V2ZW50ID09IGN1cnJlbnRfZXZlbnQpCisgICB7CisgICAgICAvKiBubyBzcGFjZSB0byBhZGQgZXZlbnQgKi8KKyAgICAgIC8qIEVycm9yIGNvZGUgbWF5IGJlIEUyQklHICovCisgICAgICAgaGRkTG9nKExPR0UsICJoZGRfSW5kaWNhdGVTY2FuUmVzdWx0OiBubyBzcGFjZSBmb3IgU0lPQ0dJV0FQICIpOworICAgICAgIHJldHVybiAtRTJCSUc7CisgICB9CisKKyAgIGxhc3RfZXZlbnQgPSBjdXJyZW50X2V2ZW50OworICAgdm9zX21lbV96ZXJvKCZldmVudCwgc2l6ZW9mIChzdHJ1Y3QgaXdfZXZlbnQpKTsKKworIC8qIFByb3RvY29sIE5hbWUgKi8KKyAgIGV2ZW50LmNtZCA9IFNJT0NHSVdOQU1FOworCisgICBzd2l0Y2ggKGRlc2NyaXB0b3ItPm53VHlwZSkKKyAgIHsKKyAgIGNhc2UgZVNJUl8xMUFfTldfVFlQRToKKyAgICAgICBtb2Rlc3RyID0gImEiOworICAgICAgIGJyZWFrOworICAgY2FzZSBlU0lSXzExQl9OV19UWVBFOgorICAgICAgIG1vZGVzdHIgPSAiYiI7CisgICAgICAgYnJlYWs7CisgICBjYXNlIGVTSVJfMTFHX05XX1RZUEU6CisgICAgICAgbW9kZXN0ciA9ICJnIjsKKyAgICAgICBicmVhazsKKyAgIGNhc2UgZVNJUl8xMU5fTldfVFlQRToKKyAgICAgICBtb2Rlc3RyID0gIm4iOworICAgICAgIGJyZWFrOworICAgZGVmYXVsdDoKKyAgICAgICBoZGRMb2coIExPR1csICIlczogVW5rbm93biBuZXR3b3JrIHR5cGUgWyVkXSIsCisgICAgICAgICAgICAgIF9fZnVuY19fLCBkZXNjcmlwdG9yLT5ud1R5cGUpOworICAgICAgIG1vZGVzdHIgPSAiPyI7CisgICAgICAgYnJlYWs7CisgICB9CisgICBzbnByaW50ZihldmVudC51Lm5hbWUsIElGTkFNU0laLCAiSUVFRSA4MDIuMTElcyIsIG1vZGVzdHIpOworICAgY3VycmVudF9ldmVudCA9IGl3ZV9zdHJlYW1fYWRkX2V2ZW50KHNjYW5JbmZvLT5pbmZvLGN1cnJlbnRfZXZlbnQsIGVuZCwKKyAgICAgICAgICAgICAgICAgICAmZXZlbnQsIElXX0VWX0NIQVJfTEVOKTsKKworICAgaWYgKGxhc3RfZXZlbnQgPT0gY3VycmVudF9ldmVudCkKKyAgIHsgLyogbm8gc3BhY2UgdG8gYWRkIGV2ZW50ICovCisgICAgICAgaGRkTG9nKCBMT0dFLCAiaGRkX0luZGljYXRlU2NhblJlc3VsdDogbm8gc3BhY2UgZm9yIFNJT0NHSVdOQU1FIik7CisgICAgICAvKiBFcnJvciBjb2RlLCBtYXkgYmUgRTJCSUcgKi8KKyAgICAgICByZXR1cm4gLUUyQklHOworICAgfQorCisgICBsYXN0X2V2ZW50ID0gY3VycmVudF9ldmVudDsKKyAgIHZvc19tZW1femVybyggJmV2ZW50LCBzaXplb2YgKHN0cnVjdCBpd19ldmVudCkpOworCisgICAvKkZyZXEqLworICAgZXZlbnQuY21kID0gU0lPQ0dJV0ZSRVE7CisKKyAgIGV2ZW50LnUuZnJlcS5tID0gZGVzY3JpcHRvci0+Y2hhbm5lbElkOworICAgZXZlbnQudS5mcmVxLmUgPSAwOworICAgZXZlbnQudS5mcmVxLmkgPSAwOworICAgY3VycmVudF9ldmVudCA9IGl3ZV9zdHJlYW1fYWRkX2V2ZW50KHNjYW5JbmZvLT5pbmZvLGN1cnJlbnRfZXZlbnQsIGVuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZXZlbnQsIElXX0VWX0ZSRVFfTEVOKTsKKworICAgaWYgKGxhc3RfZXZlbnQgPT0gY3VycmVudF9ldmVudCkKKyAgIHsgLyogbm8gc3BhY2UgdG8gYWRkIGV2ZW50ICovCisgICAgICAgaGRkTG9nKCBMT0dFLCAiaGRkX0luZGljYXRlU2NhblJlc3VsdDogbm8gc3BhY2UgZm9yIFNJT0NHSVdGUkVRIik7CisgICAgICAgcmV0dXJuIC1FMkJJRzsKKyAgIH0KKworICAgbGFzdF9ldmVudCA9IGN1cnJlbnRfZXZlbnQ7CisgICB2b3NfbWVtX3plcm8oICZldmVudCwgc2l6ZW9mIChzdHJ1Y3QgaXdfZXZlbnQpKTsKKworICAgLyogQlNTIE1vZGUgKi8KKyAgIGV2ZW50LmNtZCA9IFNJT0NHSVdNT0RFOworCisgICBjYXBhYmlsaXR5SW5mbyA9IGRlc2NyaXB0b3ItPmNhcGFiaWxpdHlJbmZvOworCisgICBpZiAoU0lSX01BQ19HRVRfRVNTKGNhcGFiaWxpdHlJbmZvKSkKKyAgIHsKKyAgICAgICBldmVudC51Lm1vZGUgPSBJV19NT0RFX0lORlJBOworICAgfQorICAgZWxzZSBpZiAoU0lSX01BQ19HRVRfSUJTUyhjYXBhYmlsaXR5SW5mbykpCisgICB7CisgICAgICAgZXZlbnQudS5tb2RlID0gSVdfTU9ERV9BREhPQzsKKyAgIH0KKyAgIGVsc2UKKyAgIHsKKyAgICAgICAvKiBuZWl0aGVyIEVTUyBvciBJQlNTICovCisgICAgICAgZXZlbnQudS5tb2RlID0gSVdfTU9ERV9BVVRPOworICAgfQorCisgICBjdXJyZW50X2V2ZW50ID0gaXdlX3N0cmVhbV9hZGRfZXZlbnQoc2NhbkluZm8tPmluZm8sY3VycmVudF9ldmVudCwgZW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZldmVudCwgSVdfRVZfVUlOVF9MRU4pOworCisgICBpZiAobGFzdF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ICAgICBkb3QxMWZVbnBhY2tCZWFjb25JRXMgKCh0cEFuaVNpckdsb2JhbCkKKyAgICAgICAgICAgaEhhbCwgKHRBTklfVTggKikgZGVzY3JpcHRvci0+aWVGaWVsZHMsIGllX2xlbmd0aCwgICZkb3QxMUJlYWNvbklFcyk7CisKKyAgICAgICBwRG90MTFTU0lEID0gJmRvdDExQmVhY29uSUVzLlNTSUQ7CisKKworICAgICAgIGlmIChwRG90MTFTU0lELT5wcmVzZW50ICkgeworICAgICAgICAgIGxhc3RfZXZlbnQgPSBjdXJyZW50X2V2ZW50OworICAgICAgICAgIHZvc19tZW1femVybyAoJmV2ZW50LCBzaXplb2YgKHN0cnVjdCBpd19ldmVudCkpOworCisgICAgICAgICAgZXZlbnQuY21kID0gU0lPQ0dJV0VTU0lEOworICAgICAgICAgIGV2ZW50LnUuZGF0YS5mbGFncyA9IDE7CisgICAgICAgICAgZXZlbnQudS5kYXRhLmxlbmd0aCA9IHNjYW5fcmVzdWx0LT5zc0lkLmxlbmd0aDsKKyAgICAgICAgICBjdXJyZW50X2V2ZW50ID0gaXdlX3N0cmVhbV9hZGRfcG9pbnQgKHNjYW5JbmZvLT5pbmZvLGN1cnJlbnRfZXZlbnQsIGVuZCwKKyAgICAgICAgICAgICAgICAgICZldmVudCwgKGNoYXIgKilzY2FuX3Jlc3VsdC0+c3NJZC5zc0lkKTsKKworICAgICAgICAgIGlmKGxhc3RfZXZlbnQgPT0gY3VycmVudF9ldmVudCkKKyAgICAgICAgICB7IC8qIG5vIHNwYWNlIHRvIGFkZCBldmVudCAqLworICAgICAgICAgICAgIGhkZExvZyggTE9HRSwgImhkZF9JbmRpY2F0ZVNjYW5SZXN1bHQ6IG5vIHNwYWNlIGZvciBTSU9DR0lXRVNTSUQiKTsKKyAgICAgICAgICAgICByZXR1cm4gLUUyQklHOworICAgICAgICAgIH0KKyAgICAgICB9CisKKyAgICAgIGlmKCBoZGRfR2V0V1BBUlNOSUVzKCAoIHRBTklfVTggKikgZGVzY3JpcHRvci0+aWVGaWVsZHMsIGllX2xlbmd0aCwgJmxhc3RfZXZlbnQsICZjdXJyZW50X2V2ZW50LCBzY2FuSW5mbyApICA8IDAgICAgKQorICAgICAgeworICAgICAgICAgIGhkZExvZyggTE9HRSwgImhkZF9JbmRpY2F0ZVNjYW5SZXN1bHQ6IG5vIHNwYWNlIGZvciBTSU9DR0lXRVNTSUQiKTsKKyAgICAgICAgICByZXR1cm4gLUUyQklHOworICAgICAgfQorCisgICAgICBsYXN0X2V2ZW50ID0gY3VycmVudF9ldmVudDsKKyAgICAgIGN1cnJlbnRfcGFkID0gY3VycmVudF9ldmVudCArIElXX0VWX0xDUF9MRU47CisgICAgICB2b3NfbWVtX3plcm8oICZldmVudCwgc2l6ZW9mIChzdHJ1Y3QgaXdfZXZlbnQpKTsKKworICAgICAgLypSYXRlcyovCisgICAgICBldmVudC5jbWQgPSBTSU9DR0lXUkFURTsKKworCisgICAgICBwRG90MTFTdXBwUmF0ZXMgPSAmZG90MTFCZWFjb25JRXMuU3VwcFJhdGVzOworCisgICAgICBpZiAocERvdDExU3VwcFJhdGVzLT5wcmVzZW50ICkKKyAgICAgIHsKKyAgICAgICAgICBpbnQgaTsKKworICAgICAgICAgIG51bUJhc2ljUmF0ZXMgPSBwRG90MTFTdXBwUmF0ZXMtPm51bV9yYXRlczsKKyAgICAgICAgICBmb3IgKGk9MDsgaTxwRG90MTFTdXBwUmF0ZXMtPm51bV9yYXRlczsgaSsrKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKDAgIT0gKHBEb3QxMVN1cHBSYXRlcy0+cmF0ZXNbaV0gJiAweDdGKSkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgZXZlbnQudS5iaXRyYXRlLnZhbHVlID0gaGRkX1RyYW5zbGF0ZUFCR1JhdGVUb01icHNSYXRlICgKKyAgICAgICAgICAgICAgICAgICAgICAmcERvdDExU3VwcFJhdGVzLT5yYXRlc1tpXSk7CisKKyAgICAgICAgICAgICAgICAgIGN1cnJlbnRfcGFkID0gaXdlX3N0cmVhbV9hZGRfdmFsdWUgKHNjYW5JbmZvLT5pbmZvLGN1cnJlbnRfZXZlbnQsCisgICAgICAgICAgICAgICAgICAgICAgY3VycmVudF9wYWQsIGVuZCwgJmV2ZW50LCBJV19FVl9QQVJBTV9MRU4pOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorCisgICAgICB9CisKKyAgICAgIHBEb3QxMUV4dFN1cHBSYXRlcyA9ICZkb3QxMUJlYWNvbklFcy5FeHRTdXBwUmF0ZXM7CisKKyAgICAgIGlmIChwRG90MTFFeHRTdXBwUmF0ZXMtPnByZXNlbnQgKQorICAgICAgeworICAgICAgICAgIGludCBpLG5vX29mX3JhdGVzOworICAgICAgICAgIG1heE51bVJhdGVzID0gbnVtQmFzaWNSYXRlcyArIHBEb3QxMUV4dFN1cHBSYXRlcy0+bnVtX3JhdGVzOworCisgICAgICAgICAgLyogQ2hlY2sgdG8gbWFrZSBzdXJlIHRoZSB0b3RhbCBudW1iZXIgb2YgcmF0ZXMKKyAgICAgICAgICAgICAgIGRvZXNuJ3QgZXhjZWVkIElXX01BWF9CSVRSQVRFUyAqLworCisgICAgICAgICAgbWF4TnVtUmF0ZXMgPSBWT1NfTUlOKG1heE51bVJhdGVzICwgSVdfTUFYX0JJVFJBVEVTKTsKKworICAgICAgICAgIGlmKChtYXhOdW1SYXRlcyAtIG51bUJhc2ljUmF0ZXMpID4gTUFYX1JBVEVTKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICBub19vZl9yYXRlcyA9IE1BWF9SQVRFUzsKKyAgICAgICAgICAgICBoZGRMb2coIExPR1csICJBY2Nlc3NpbmcgYXJyYXkgb3V0IG9mIGJvdW5kIHRoYXQgYXJyYXkgaXMgcERvdDExRXh0U3VwcFJhdGVzLT5yYXRlcyAiKTsKKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIG5vX29mX3JhdGVzID0gbWF4TnVtUmF0ZXMgLSBudW1CYXNpY1JhdGVzOworICAgICAgICAgIH0KKyAgICAgICAgICBmb3IgKCBpPTA7IGk8IG5vX29mX3JhdGVzIDsgaSsrICkKKyAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmICgwICE9IChwRG90MTFFeHRTdXBwUmF0ZXMtPnJhdGVzW2ldICYgMHg3RikpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGV2ZW50LnUuYml0cmF0ZS52YWx1ZSA9IGhkZF9UcmFuc2xhdGVBQkdSYXRlVG9NYnBzUmF0ZSAoCisgICAgICAgICAgICAgICAgICAgICAgJnBEb3QxMUV4dFN1cHBSYXRlcy0+cmF0ZXNbaV0pOworCisgICAgICAgICAgICAgICAgICBjdXJyZW50X3BhZCA9IGl3ZV9zdHJlYW1fYWRkX3ZhbHVlIChzY2FuSW5mby0+aW5mbyxjdXJyZW50X2V2ZW50LAorICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfcGFkLCBlbmQsICZldmVudCwgSVdfRVZfUEFSQU1fTEVOKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgIH0KKworCisgICAgICBpZiAoKGN1cnJlbnRfcGFkIC0gY3VycmVudF9ldmVudCkgPj0gSVdfRVZfTENQX0xFTikKKyAgICAgIHsKKyAgICAgICAgICBjdXJyZW50X2V2ZW50ID0gY3VycmVudF9wYWQ7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICAgaWYgKGxhc3RfZXZlbnQgPT0gY3VycmVudF9ldmVudCkKKyAgICAgICAgICB7IC8qIG5vIHNwYWNlIHRvIGFkZCBldmVudCAqLworICAgICAgICAgICAgICBoZGRMb2coIExPR0UsICJoZGRfSW5kaWNhdGVTY2FuUmVzdWx0OiBubyBzcGFjZSBmb3IgU0lPQ0dJV1JBVEUiKTsKKyAgICAgICAgICAgICAgcmV0dXJuIC1FMkJJRzsKKyAgICAgICAgICB9CisgICAgICB9CisKKyAgICAgIGxhc3RfZXZlbnQgPSBjdXJyZW50X2V2ZW50OworICAgICAgdm9zX21lbV96ZXJvICgmZXZlbnQsIHNpemVvZiAoc3RydWN0IGl3X2V2ZW50KSk7CisKKworICAgICAgZXZlbnQuY21kID0gU0lPQ0dJV0VOQ09ERTsKKworICAgICAgaWYgKFNJUl9NQUNfR0VUX1BSSVZBQ1koY2FwYWJpbGl0eUluZm8pKQorICAgICAgeworICAgICAgICAgZXZlbnQudS5kYXRhLmZsYWdzID0gSVdfRU5DT0RFX0VOQUJMRUQgfCBJV19FTkNPREVfTk9LRVk7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICBldmVudC51LmRhdGEuZmxhZ3MgPSBJV19FTkNPREVfRElTQUJMRUQ7CisgICAgICB9CisgICAgICBldmVudC51LmRhdGEubGVuZ3RoID0gMDsKKworICAgICAgY3VycmVudF9ldmVudCA9IGl3ZV9zdHJlYW1fYWRkX3BvaW50KHNjYW5JbmZvLT5pbmZvLGN1cnJlbnRfZXZlbnQsIGVuZCwgJmV2ZW50LCAoY2hhciAqKXBEb3QxMVNTSUQtPnNzaWQpOworCisKKyAgICAgIGlmKGxhc3RfZXZlbnQgPT0gY3VycmVudF9ldmVudCkKKyAgICAgIHsgLyogbm8gc3BhY2UgdG8gYWRkIGV2ZW50CisgICAgICAgICAgICAgICBFcnJvciBjb2RlLCBtYXkgYmUgRTJCSUcgKi8KKyAgICAgICAgICBoZGRMb2coIExPR0UsICJoZGRfSW5kaWNhdGVTY2FuUmVzdWx0OiBubyBzcGFjZSBmb3IgU0lPQ0dJV0VOQ09ERSIpOworICAgICAgICAgIHJldHVybiAtRTJCSUc7CisgICAgICB9CisgICB9CisKKyAgIGxhc3RfZXZlbnQgPSBjdXJyZW50X2V2ZW50OworICAgdm9zX21lbV96ZXJvKCAmZXZlbnQsIHNpemVvZiAoc3RydWN0IGl3X2V2ZW50KSk7CisKKyAgICAvKlJTU0kqLworICAgZXZlbnQuY21kID0gSVdFVlFVQUw7CisgICBldmVudC51LnF1YWwucXVhbCA9IGRlc2NyaXB0b3ItPnJzc2k7CisgICBldmVudC51LnF1YWwubm9pc2UgPSBkZXNjcmlwdG9yLT5zaW5yOworCisgICAvKlRvIGtlZXAgdGhlIHJzc2kgaWNvbiBvZiB0aGUgY29ubmVjdGVkIEFQIGluIHRoZSBzY2FuIHdpbmRvdworICAgICphbmQgdGhlIHJzc2kgaWNvbiBvZiB0aGUgd2lyZWxlc3MgbmV0d29ya3MgaW4gc3luYyAqLyAgIAorICAgaWYgKCggZUNvbm5lY3Rpb25TdGF0ZV9Bc3NvY2lhdGVkID09IAorICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbkN0eC5zdGF0aW9uLmNvbm5faW5mby5jb25uU3RhdGUgKSAmJgorICAgICAgICAgICAgICAoIFZPU19UUlVFID09IHZvc19tZW1fY29tcGFyZShkZXNjcmlwdG9yLT5ic3NJZCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uQ3R4LnN0YXRpb24uY29ubl9pbmZvLmJzc0lkLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19CU1NJRF9MRU4pKSkKKyAgIHsKKyAgICAgIGV2ZW50LnUucXVhbC5sZXZlbCA9IHBBZGFwdGVyLT5yc3NpOworICAgfQorICAgZWxzZQorICAgeworICAgICAgZXZlbnQudS5xdWFsLmxldmVsID0gVk9TX01JTiAoKGRlc2NyaXB0b3ItPnJzc2kgKyBkZXNjcmlwdG9yLT5zaW5yKSwgMCk7CisgICB9CisgICAKKyAgIGV2ZW50LnUucXVhbC51cGRhdGVkID0gSVdfUVVBTF9BTExfVVBEQVRFRDsKKworICAgY3VycmVudF9ldmVudCA9IGl3ZV9zdHJlYW1fYWRkX2V2ZW50KHNjYW5JbmZvLT5pbmZvLGN1cnJlbnRfZXZlbnQsCisgICAgICAgZW5kLCAmZXZlbnQsIElXX0VWX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YXkgaGF2ZSBhbHJlYWR5IGJlZW4gZGVzdHJveWVkLCBzbworICAgICAgIGRvIHNvbWUgcXVpY2sgc2FuaXR5IGJlZm9yZSBwcm9jZWVkaW5nICovCisgICAgaWYgKHBBZGFwdGVyLT5kZXYgIT0gZGV2KQorICAgIHsKKyAgICAgICBoZGRMb2coTE9HVywgIiVzOiBkZXZpY2UgbWlzbWF0Y2ggJXAgdnMgJXAiLAorICAgICAgICAgICAgICAgX19mdW5jX18sIHBBZGFwdGVyLT5kZXYsIGRldik7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIH0KKworICAgIC8qIENoZWNrIHRoZSBzY2FuSWQgKi8KKyAgICBpZiAocEhkZEN0eC0+c2Nhbl9pbmZvLnNjYW5JZCAhPSBzY2FuSWQpCisgICAgeworICAgICAgICBoZGRMb2coTE9HVywgIiVzIGNhbGxlZCB3aXRoIG1pc21hdGNoZWQgc2NhbklkIHBIZGRDdHgtPnNjYW5faW5mby5zY2FuSWQgPSAlZCAiCisgICAgICAgICAgICAgICAic2NhbklkID0gJWQgIiwgX19mdW5jX18sIChpbnQpIHBIZGRDdHgtPnNjYW5faW5mby5zY2FuSWQsCisgICAgICAgICAgICAgICAgKGludCkgc2NhbklkKTsKKyAgICB9CisKKyAgICAvKiBTY2FuIGlzIG5vIGxvbmdlciBwZW5kaW5nICovCisgICAgcEhkZEN0eC0+c2Nhbl9pbmZvLm1TY2FuUGVuZGluZyA9IFZPU19GQUxTRTsKKworICAgIC8vIG5vdGlmeSBhbnkgYXBwbGljYXRpb25zIHRoYXQgbWF5IGJlIGludGVyZXN0ZWQKKyAgICBtZW1zZXQoJndycXUsICdcMCcsIHNpemVvZih3cnF1KSk7CisgICAgd2VfZXZlbnQgPSBTSU9DR0lXU0NBTjsKKyAgICBtc2cgPSBOVUxMOworICAgIHdpcmVsZXNzX3NlbmRfZXZlbnQoZGV2LCB3ZV9ldmVudCwgJndycXUsIG1zZyk7CisKKyAgICBF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0FOID09IHBIZGRDdHgtPnNjYW5faW5mby5zY2FuX21vZGUpKQorICAgICAgIHsKKyAgICAgICAgICAgc2NhblJlcXVlc3Quc2NhblR5cGUgPSBlU0lSX0FDVElWRV9TQ0FOOworICAgICAgIH0KKyAgICAgICBlbHNlCisgICAgICAgeworICAgICAgICAgICBzY2FuUmVxdWVzdC5zY2FuVHlwZSA9IGVTSVJfUEFTU0lWRV9TQ0FOOworICAgICAgIH0KKworICAgICAgIC8qIHNldCBic3NpZCB1c2luZyBzb2NrYWRkciBmcm9tIGl3X3NjYW5fcmVxICovCisgICAgICAgdm9zX21lbV9jb3B5KHNjYW5SZXF1ZXN0LmJzc2lkLAorICAgICAgICAgICAgICAgICAgICAgICAmc2NhblJlcS0+YnNzaWQuc2FfZGF0YSwgc2l6ZW9mKHNjYW5SZXF1ZXN0LmJzc2lkKSApOworCisgICAgICBpZiAod3JxdS0+ZGF0YS5mbGFncyAmIElXX1NDQU5fVEhJU19FU1NJRCkgIHsKKworICAgICAgICAgIGlmKHNjYW5SZXEtPmVzc2lkX2xlbiAgJiYKKyAgICAgICAgICAgICAgIChzY2FuUmVxLT5lc3NpZF9sZW4gPD0gU0lSX01BQ19NQVhfU1NJRF9MRU5HVEgpKSB7CisgICAgICAgICAgICAgIHNjYW5SZXF1ZXN0LlNTSURzLm51bU9mU1NJRHMgPSAxOworICAgICAgICAgICAgICBzY2FuUmVxdWVzdC5TU0lEcy5TU0lETGlzdCA9KCB0Q3NyU1NJREluZm8gKil2b3NfbWVtX21hbGxvYyhzaXplb2YodENzclNTSURJbmZvKSk7CisgICAgICAgICAgICAgIGlmKHNjYW5SZXF1ZXN0LlNTSURzLlNTSURMaXN0KSB7CisgICAgICAgICAgICAgICAgIHNjYW5SZXF1ZXN0LlNTSURzLlNTSURMaXN0LT5TU0lELmxlbmd0aCA9ICAgICAgICAgICAgIHNjYW5SZXEtPmVzc2lkX2xlbjsKKyAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHNjYW5SZXF1ZXN0LlNTSURzLlNTSURMaXN0LT4gIFNTSUQuc3NJZCxzY2FuUmVxLT5lc3NpZCxzY2FuUmVxLT5lc3NpZF9sZW4pOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNjYW5SZXF1ZXN0LlNTSURzLm51bU9mU1NJRHMgPSAwOworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiBVbmFibGUgdG8gYWxsb2NhdGUgbWVtb3J5IixfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKExPR0UsIEZMKCJJbnZhbGlkIGVzc2lkIGxlbmd0aCA6ICVkIiksIHNjYW5SZXEtPmVzc2lkX2xlbik7CisgICAgICAgICAgfQorICAgICAgfQorCisgICAgICAgLyogc2V0IG1pbiBhbmQgbWF4IGNoYW5uZWwgdGltZSAqLworICAgICAgIHNjYW5SZXF1ZXN0Lm1pbkNoblRpbWUgPSBzY2FuUmVxLT5taW5fY2hhbm5lbF90aW1lOworICAgICAgIHNjYW5SZXF1ZXN0Lm1heENoblRpbWUgPSBzY2FuUmVxLT5tYXhfY2hhbm5lbF90aW1lOworCisgICB9CisgICBlbHNlCisgICB7CisgICAgICAgaWYocEhkZEN0eC0+c2Nhbl9pbmZvLnNjYW5fbW9kZSA9PSBlU0lSX0FDVElWRV9TQ0FOKSB7CisgICAgICAgICAgIC8qIHNldCB0aGUgc2NhbiB0eXBlIHRvIGFjdGl2ZSAqLworICAgICAgICAgICBzY2FuUmVxdWVzdC5zY2FuVHlwZSA9IGVTSVJfQUNUSVZFX1NDQU47CisgICAgICAgfSBlbHNlIHsKKyAgICAg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MX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgfQorCisgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgaWYgKDAgIT0gcmV0KQorICAgeworICAgICAgIHJldHVybiByZXQ7CisgICB9CisgICBoSGFsID0gV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpOworICAgaWYgKE5VTEwgPT0gaEhhbCkKKyAgIHsKKyAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBIYWwgQ29udGV4dCBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICB9CisKKyAgIGlmIChUUlVFID09IHBIZGRDdHgtPnNjYW5faW5mby5tU2NhblBlbmRpbmcpCisgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsICIlczptU2NhblBlbmRpbmcgaXMgVFJVRSAhISEiLF9fZnVuY19fKTsKKyAgICAgICByZXR1cm4gLUVBR0FJTjsKKyAgIH0KKyAgIHNjYW5JbmZvLmRldiA9IGRldjsKKyAgIHNjYW5JbmZvLnN0YXJ0ID0gZXh0cmE7CisgICBzY2FuSW5mby5pbmZvID0gaW5mbzsKKworICAgaWYgKDAgPT0gd3JxdS0+ZGF0YS5sZW5ndGgpCisgICB7CisgICAgICAgc2NhbkluZm8uZW5kID0gZXh0cmEgKyBJV19TQ0FOX01BWF9EQVRBOworICAgfQorICAgZWxzZQorICAgeworICAgICAgIHNjYW5JbmZvLmVuZCA9IGV4dHJhICsgd3JxdS0+ZGF0YS5sZW5ndGg7CisgICB9CisKKyAgIHN0YXR1cyA9IHNtZV9TY2FuR2V0UmVzdWx0KGhIYWwscEFkYXB0ZXItPnNlc3Npb25JZCxOVUxMLCZwUmVzdWx0KTsKKworICAgaWYgKE5VTEwgPT0gcFJlc3VsdCkKKyAgIHsKKyAgICAgICAvLyBubyBzY2FuIHJlc3VsdHMKKyAgICAgICBoZGRMb2coTE9HMSwiX19pd19nZXRfc2NhbjogTlVMTCBTY2FuIFJlc3VsdCAiKTsKKyAgICAgICByZXR1cm4gMDsKKyAgIH0KKworICAgcFNjYW5SZXN1bHQgPSBzbWVfU2NhblJlc3VsdEdldEZpcnN0KGhIYWwsIHBSZXN1bHQpOworCisgICB3aGlsZSAocFNjYW5SZXN1bHQpCisgICB7CisgICAgICAgc3RhdHVzID0gaGRkX0luZGljYXRlU2NhblJlc3VsdCgmc2NhbkluZm8sIHBTY2FuUmVzdWx0KTsKKyAgICAgICBpZiAoMCAhPSBzdGF0dXMpCisgICAgICAgeworICAgICAgICAgICBicmVhazsKKyAgICAgICB9CisgICAgICAgaSsrOworICAgICAgIHBTY2FuUmVzdWx0ID0gc21lX1NjYW5SZXN1bHRHZXROZXh0KGhIYWwsIHBSZXN1bHQpOworICAgfQorCisgICBzbWVfU2NhblJlc3VsdFB1cmdlKGhIYWwsIHBSZXN1bHQpOworCisgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXM6IGV4aXQgdG90YWwgJWQgQlNTIHJlcG9ydGVkICEhISIsX19mdW5jX18sIGkpOworICAgRVhJVCgpOworICAgcmV0dXJuIHN0YXR1czsKK30KKworaW50IGl3X2dldF9zY2FuKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp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FuX3BlbmRpbmdfb3B0aW9uX2Upc3RyX3B0clsrK2ldOworICAgICAgICAgICAgKytpOworICAgICAgICB9CisgICAgICAgIHBIZGRDdHgtPnNjYW5faW5mby5zY2FuX3BlbmRpbmdfb3B0aW9uID0gc2NhblBlbmRpbmdPcHRpb247CisKKyAgICAgICAgaWYocEhkZEN0eC0+c2Nhbl9pbmZvLm1TY2FuUGVuZGluZyA9PSBUUlVFKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coTE9HMSwiJXM6IG1TY2FuUGVuZGluZyBpcyBUUlVFIixfX2Z1bmNfXyk7CisgICAgICAgICAgICAvKiBJZiBhbnkgc2NhbiBpcyBwZW5kaW5nLCBqdXN0IGdpdmV1cCB0aGlzIHNjYW4gcmVxdWVzdCAqLworICAgICAgICAgICAgaWYoV0VYVF9TQ0FOX1BFTkRJTkdfR0lWRVVQID09IHNjYW5QZW5kaW5nT3B0aW9uKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBIZGRDdHgtPnNjYW5faW5mby53YWl0U2NhblJlc3VsdCA9IEZBTFNFOworICAgICAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOyAKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8qIElmIGFueSBzY2FuIHBlbmRpbmcsIHdhaXQgdGlsbCBmaW5pc2ggY3VycmVudCBzY2FuLAorICAgICAgICAgICAgICAgYW5kIHRyeSB0aGlzIHNjYW4gcmVxdWVzdCB3aGVuIHByZXZpb3VzIHNjYW4gZmluaXNoICovCisgICAgICAgICAgICBlbHNlIGlmKFdFWFRfU0NBTl9QRU5ESU5HX0RFTEFZID09IHNjYW5QZW5kaW5nT3B0aW9uKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBIZGRDdHgtPnNjYW5faW5mby53YWl0U2NhblJlc3VsdCA9IFRSVUU7CisgICAgICAgICAgICAgICAgdm9zX2V2ZW50X3Jlc2V0KCZwSGRkQ3R4LT5zY2FuX2luZm8uc2Nhbl9maW5pc2hlZF9ldmVudCk7CisgICAgICAgICAgICAgICAgaWYodm9zX3dhaXRfc2luZ2xlX2V2ZW50KCZwSGRkQ3R4LT5zY2FuX2luZm8uc2Nhbl9maW5pc2hlZF9ldmVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdFWFRfQ1NDQU5fU0NBTl9ET05FX1dBSVRfVElNRSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HMSwiJXM6IFByZXZpb3VzIFNDQU4gZG9lcyBub3QgZmluaXNoZWQgb24gdGltZSIsX19mdW5jX18pOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfU1VDQ0VTUzsgCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgLyogUGlnZ3liYWNrIHByZXZpb3VzIHNjYW4gcmVzdWx0ICovCisgICAgICAgICAgICBlbHNlIGlmKFdFWFRfU0NBTl9QRU5ESU5HX1BJR0dZQkFDSyA9PSBzY2FuUGVuZGluZ09wdGlvbikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwSGRkQ3R4LT5zY2FuX2luZm8ud2FpdFNjYW5SZXN1bHQgPSBUUlVFOworICAgICAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOyAKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBwSGRkQ3R4LT5zY2FuX2luZm8ud2FpdFNjYW5SZXN1bHQgPSBGQUxTRTsKKworICAgICAgICAvKiBDaGVjayBmb3Igc2NhbiBJRSAqLworICAgICAgICB3aGlsZSggV0VYVF9DU0NBTl9TU0lEX1NFQ1RJT04gPT0gc3RyX3B0cltpXSApIAorICAgICAgICB7CisgICAgICAgICAgICAvKiBzc2lkX2xlbiAqLworICAgICAgICAgICAgaWYoc3RyX3B0clsrK2ldICE9IFdFWFRfQ1NDQU5fQ0hBTk5FTF9TRUNUSU9OKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiB0b3RhbCBudW1iZXIgb2Ygc3NpZCdzICovCisgICAgICAgICAgICAgICAgbnVtX3NzaWQrKzsKKyAgICAgICAgICAgICAgICAvKiBpbmNyZW1lbnQgbGVuZ3RoIGZpbGVkICovCisgICAgICAgICAgICAgICAgaSArPSBzdHJfcHRyW2ldICsgMTsKKyAgICAgICAgICAgIH0gIAorICAgICAgICAgICAgLyogaSBzaG91bGQgYmUgc2F2ZWQgYW5kIGl0IHdpbGwgYmUgcG9pbnRpbmcgdG8gJ0MnICovCisgICAgICAgIH0KKworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXM6IG51bVNzaWQgJWQgISEhIixfX2Z1bmNfXywgbnVtX3NzaWQpOworICAgICAgICBpZiggbnVtX3NzaWQgKSAKKyAgICAgICAgeworICAgICAgICAgICAgLyogVG8gYmUgZml4ZWQgaW4gU01FIGFuZCBQRTogb3ZlcnJpZGUgdGhlIG51bWJlciBvZiBzc2lkIHdpdGggMSwKKyAgICAgICAgICAgICogYXMgU01FIGFuZCBQRSBkb2VzIG5vdCBoYW5kbGUgbXVsdGlwbGUgU1NJRCBpbiBzY2FuIHJlcXVlc3QKKyAgICAgICAgICAgICogKi8KKyAgICAgICAgICBzY2FuUmVxdWVzdC5TU0lEcy5udW1PZlNTSURzID0gbnVtX3NzaWQ7CisgICAgICAgICAgLyogQWxsb2NhdGUgbnVtX3NzaWQgdENzclNTSURJbmZvIHN0cnVjdHVyZSAqLworICAgICAgICAgIFNzaWRJbmZvID0gc2NhblJlcXVlc3QuU1NJRHMuU1NJRExpc3QgPSggdENzclNTSURJbmZvICopdm9zX21lbV9tYWxsb2MobnVtX3NzaWQqc2l6ZW9mKHRDc3JTU0lESW5mbykpOworICAgICAgICAgIGlmKE5VTEwgPT0gc2NhblJlcXVlc3QuU1NJRHMuU1NJRExpc3QpIHsKKyAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAibWVtb3J5IGFsbG9jIGZhaWxlZCBTU0lESW5mbyBidWZmZXIiKTsKKyAgICAgICAgICAgICByZXR1cm4gLUVOT01FTTsKKyAgICAgICAgICB9CisKKyAgICAgICAgICAvKiBjb3B5IGFsbCB0aGUgc3NpZCdzIGFuZCB0aGVpciBsZW5ndGggKi8KKyAgICAgICAgICBzc2lkX3N0YXJ0ID0gV0VYVF9DU0NBTl9IRUFERVJfU0laRSArIDE7Lyogc2tpcHBpbmcgJ1MnICovCisgICAgICAgICAgZm9yKGogPSAwOyBqIDwgbnVtX3NzaWQ7IGorKykgeworICAgICAgICAgICAgIGlmKCBTSVJfTUFDX01BWF9TU0lEX0xFTkdUSCA8IHN0cl9wdHJbc3NpZF9zdGFydF0peworICAgICAgICAgICAgICAgIHNjYW5SZXF1ZXN0LlNTSURzLm51bU9mU1NJRHMgLT0gMTsKKyAgICAgICAgICAgICB9IGVsc2V7CisgICAgICAgICAgICAgICAgLyogZ2V0IHRoZSBzc2lkIGxlbmd0aCAqLworICAgICAgICAgICAgICAgIFNzaWRJbmZvLT5TU0lELmxlbmd0aCA9IHN0cl9wdHJbc3NpZF9zdGFydCsrXTsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoU3NpZEluZm8tPlNTSUQuc3NJZCwgJnN0cl9wdHJbc3NpZF9zdGFydF0sIFNzaWRJbmZvLT5TU0lELmxlbmd0aCk7CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICJTU0lEIG51bWJlciAlZDogICVzIiwgaiwgU3NpZEluZm8tPlNTSUQuc3NJZCk7CisgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8qIHNraXBwaW5nIGxlbmd0aCAqLworICAgICAgICAgICAgIHNzaWRfc3RhcnQgKz0gc3RyX3B0cltzc2lkX3N0YXJ0IC0gMV0gKyAxOworICAgICAgICAgICAgIC8qIFN0b3JlIG5leHQgc3NpZCBpbmZvICovCisgICAgICAgICAgICAgU3NpZEluZm8rKzsKKyAgICAgICAgICB9CisgICAgICAgfQorCisgICAgICAgIC8qIENoZWNrIGZvciBDaGFubmVsIElFICovCisgICAgICAgIGlmICggV0VYVF9DU0NBTl9DSEFOTkVMX1NFQ1RJT04gPT0gc3RyX3B0cltpXSkgCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKCBzdHJfcHRyWysraV0gPT0gMCApIAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHMgPSAwOworICAgICAgICAgICAgICAgIHNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0ID0gTlVMTDsKKyAgICAgICAgICAgICAgICBpKys7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIHsKKworICAgICAgICAgICAgICAgIC8qIGluY3JlbWVudCB0aGUgY291bnRlciAqLworICAgICAgICAgICAgICAgIHNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHMgPSBzdHJfcHRyW2krK107CisgICAgICAgICAgICAgICAgLyogc3RvcmUgdGVtcCBjaGFubmVsIGxpc3QgKi8KKyAgICAgICAgICAgICAgICAvKiBTTUUgZXhwZWN0cyAxIGJ5dGUgY2hhbm5lbCBjb250ZW50ICovCisgICAgICAgICAgICAgICAgc2NhblJlcXVlc3QuQ2hhbm5lbEluZm8uQ2hhbm5lbExpc3QgPSB2b3NfbWVtX21hbGxvYyhzY2FuUmVxdWVzdC5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzICogc2l6ZW9mKHZfVThfdCkpOworICAgICAgICAgICAgICAgIGlmKE5VTEwgPT0gc2NhblJlcXVlc3QuQ2hhbm5lbEluZm8uQ2hhbm5lbExpc3QpIAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsICJtZW1vcnkgYWxsb2MgZmFpbGVkIGZvciBjaGFubmVsIGxpc3QgY3JlYXRpb24iKTsKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gLUVOT01FTTsKKyAgICAgICAgICAgICAgICAgICAgZ290byBleGl0X3BvaW50OworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGZvcihjaGFubmVsSWR4ID0gMDsgY2hhbm5lbElkeCA8IHNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHM7IGNoYW5uZWxJZHgrKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgLyogU0NBTiByZXF1ZXN0IGZyb20gdXBwZXIgbGF5ZXIgaGFzIDIgYnl0ZXMgY2hhbm5lbCAqLworICAgICAgICAgICAgICAgICAgIHNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0W2NoYW5uZWxJZHhdID0gKHZfVThfdClzdHJfcHRyW2ldOworICAgICAgICAgICAgICAgICAgIGkgKz0gc2l6ZW9mKHZfVTE2X3QpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8qIFNldCBkZWZhdWx0ICovCisgICAgICAgIHNjYW5SZXF1ZXN0LnNjYW5UeXBlID0gZVNJUl9BQ1RJVkVfU0NBTjsKKyAgICAgICAgc2NhblJlcXVlc3QubWluQ2huVGltZSA9IDA7CisgICAgICAgIHNjYW5SZXF1ZXN0Lm1heENoblRpbWUgPSAwOworCisgICAgICAgIC8qIE5vdyBpIGlzIHBvaW50aW5nIHRvIHBhc3NpdmUgZHdlbGwgZHdlbGwgdGltZSAqLworICAgICAgICAvKiAnUCcsbWluIGR3ZWxsIHRpbWUsIG1heCBkd2VsbCB0aW1lICovCisgICAgICAgIC8qIG5leHQgdHdvIG9mZnNldHMgY29udGFpbiBtaW4gYW5kIG1heCBjaGFubmVsIHRpbWUgKi8KKyAgICAgICAgaWYoIFdFWFRfQ1NDQU5fUEFTVl9EV0VMTF9TRUNUSU9OID09IChzdHJfcHRyW2ldKSApIAorICAgICAgICB7CisgICAgICAgICAgICAvKiBObyBTU0lEIHNwZWNpZmllZCwgbnVtX3NzaWQgPT0gMCwgdGhlbiBzdGFydCBwYWFzaXZlIHNjYW4gKi8KKyAgICAgICAgICAgIGlmICghbnVtX3NzaWQgfHwgKGVTSVJfUEFTU0lWRV9TQ0FOID09IHBIZGRDdHgtPnNjYW5faW5mby5zY2FuX21vZGUpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNjYW5SZXF1ZXN0LnNjYW5UeXBlID0gZVNJUl9QQVNTSVZFX1NDQU47CisgICAgICAgICAgICAgICAgc2NhblJlcXVlc3QubWluQ2huVGltZSA9ICh2X1U4X3Qpc3RyX3B0clsrK2ldOy8vc2NhblJlcS0+bWluX2NoYW5uZWxfdGltZTsKKyAgICAgICAgICAgICAgICBzY2FuUmVxdWVzdC5tYXhDaG5UaW1lID0gKHZfVThfdClzdHJfcHRyWysraV07Ly9zY2FuUmVxLT5tYXhfY2hhbm5lbF90aW1lOworICAgICAgICAgICAgICAgIGkrKzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpICs9IDM7CisgICAgICAgICAgICB9ICAgIAorICAgICAgICB9ICAgCisKKyAgICAgICAgLyogSCBpbmRpY2F0ZXMgYWN0aXZlIGNoYW5uZWwgdGltZSAqLworICAgICAgICBpZiggV0VYVF9DU0NBTl9IT01FX0RXRUxMX1NFQ1RJT04gPT0gKHN0cl9wdHJbaV0pICkgCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChudW1fc3NpZCB8fCAoZVNJUl9BQ1RJVkVfU0NBTiA9PSBwSGRkQ3R4LT5zY2FuX2luZm8uc2Nhbl9tb2RlKSk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0QnVmLT5nZW5JRS5hZGRJRWRhdGEsIAorICAgICAgICAgICAgICAgIHB3ZXh0QnVmLT5nZW5JRS5sZW5ndGggKTsKKyAgICAgICAgICAgIHBIZGRDdHgtPnNjYW5faW5mby5zY2FuQWRkSUUubGVuZ3RoID0gcHdleHRCdWYtPmdlbklFLmxlbmd0aDsKKyAgICAgICAgICAgIGlmIChTSVJfTUFDX01BWF9JRV9MRU5HVEggID49ICBwd2V4dEJ1Zi0+Z2VuSUUubGVuZ3RoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG1lbWNweSggcHdleHRCdWYtPnJvYW1Qcm9maWxlLmFkZElFU2NhbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPnNjYW5faW5mby5zY2FuQWRkSUUuYWRkSUVkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+c2Nhbl9pbmZvLnNjYW5BZGRJRS5sZW5ndGgpOworICAgICAgICAgICAgICAgIHB3ZXh0QnVmLT5yb2FtUHJvZmlsZS5uQWRkSUVTY2FuTGVuZ3RoID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT5zY2FuX2luZm8uc2NhbkFkZElFLmxlbmd0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAiSW52YWxpZCBTY2FuSUUsIExlbmd0aCBpcyAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHB3ZXh0QnVmLT5nZW5JRS5sZW5ndGgpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKiBjbGVhciBwcmV2aW91cyBnZW5JRSBhZnRlciB1c2UgaXQgKi8KKyAgICAgICAgICAgIG1lbXN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gZXhpdF9wb2ludDsKKyAgICAgICAgfQorCisgICAgICAgIHBIZGRDdHgtPnNjYW5faW5mby5zY2FuSWQgPSBzY2FuSWQ7CisgICAgICAgIHBIZGRDdHgtPnNjYW5faW5mby5zZXNzaW9uSWQgPSBwQWRhcHRlci0+c2Vzc2lvbklkOworCisgICAgfSAvL2VuZCBvZiBkYXRhLT5wb2ludGVyCisgICAgZWxzZSB7CisgICAgICAgIHN0YXR1cyA9IC0xOworICAgIH0KKworZXhpdF9wb2ludDoKKworICAgIC8qIGZyZWUgc3NpZGxpc3QgKi8KKyAgICBpZiAoc2NhblJlcXVlc3QuU1NJRHMuU1NJRExpc3QpIAorICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKHNjYW5SZXF1ZXN0LlNTSURzLlNTSURMaXN0KTsKKyAgICB9CisgICAgLyogZnJlZSB0aGUgY2hhbm5lbCBsaXN0ICovCisgICAgaWYoc2NhblJlcXVlc3QuQ2hhbm5lbEluZm8uQ2hhbm5lbExpc3QpCisgICAgeworICAgICAgICB2b3NfbWVtX2ZyZWUoKHZvaWQqKXNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0KTsKKyAgICB9CisKKyAgICBFWElUKCk7CisgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIiVzOiBleGl0ICEhISIsX19mdW5jX18pOworICAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qIEFib3J0IGFueSBNQUMgc2NhbiBpZiBpbiBwcm9ncmVzcyAqLwordFNpckFib3J0U2NhblN0YXR1cyBoZGRfYWJvcnRfbWFjX3NjYW4oaGRkX2NvbnRleHRfdCogcEhkZEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNzckFib3J0UmVhc29uIHJlYX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09GVFdBUkUgSU5DTFVESU5HIEFMTCBJTVBMSUVECisgKiBXQVJSQU5USUVTIE9GIE1FUkNIQU5UQUJJTElUWSBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFCisgKiBBVVRIT1IgQkUgTElBQkxFIEZPUiBBTlkgU1BFQ0lBTCwgRElSRUNULCBJTkRJUkVDVCwgT1IgQ09OU0VRVUVOVElBTAorICogREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NIExPU1MgT0YgVVNFLCBEQVRBIE9SCisgKiBQUk9GSVRTLCBXSEVUSEVSIElOIEFOIEFDVElPTiBPRiBDT05UUkFDVCwgTkVHTElHRU5DRSBPUiBPVEhFUgorICogVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIAorICBcZmlsZSAgd2xhbl9oZGRfc29mdGFwX3R4X3J4LmMKKyAgCisgIFxicmllZiBMaW51eCBIREQgVHgvUlggQVBJcworICAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKi0tLS0tLS0tLS0tLS0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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfc29mdGFwX3RyYWZmaWNfbW9uaXRvcl90aW1lb3V0X2hhbmRsZXIoKSAtCisgICAgICAgICBTQVAvUDJQIEdPIHRyYWZmaW4gbW9uaXRvciB0aW1lb3V0IGhhbmRsZXIgZnVuY3Rpb24KKyAgICAgICAgIElmIG5vIHRyYWZmaWMgZHVyaW5nIHByb2dyYW1tZWQgdGltZSwgdHJpZ2dlciBzdXNwYW5kIG1vZGUKKworICBAcGFyYW0gcFVzckRhdGEgOiBbaW5dIHBvaW50ZXIgdG8gaGRkIGNvbnRleHQKKyAgQHJldHVybiAgICAgICAgIDogTk9ORQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBoZGRfc29mdGFwX3RyYWZmaWNfbW9uaXRvcl90aW1lb3V0X2hhbmRsZXIoIHZvaWQgKnBVc3JEYXRhICkKK3sKKyAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSAoaGRkX2NvbnRleHRfdCAqKXBVc3JEYXRhOworICAgdl9USU1FX3QgICAgICAgY3VycmVudFRTOworCisgICBFTlRFUigpOworICAgaWYgKDAgIT0gKHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCkpKQorICAgeworICAgICAgIHJldHVybjsKKyAgIH0KKworICAgY3VycmVudFRTID0gdm9zX3RpbWVyX2dldF9zeXN0ZW1fdGltZSgpOworICAgaWYgKHBIZGRDdHgtPmNmZ19pbmktPnRyYWZmaWNJZGxlVGltZW91dCA8CisgICAgICAgKGN1cnJlbnRUUyAtIHBIZGRDdHgtPnRyYWZmaWNfbW9uaXRvci5sYXN0RnJhbWVUcykpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSEREX1NBUF9EQVRBLCBWT1NfVFJBQ0VfTEVW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HZvc190aW1lcl9pbml0KCZwSGRkQ3R4LT50cmFmZmljX21vbml0b3IudHJhZmZpY1RpbWVyLAorICAgICAgICAgICAgICAgICAgICAgIFZPU19USU1FUl9UWVBFX1NXLAorICAgICAgICAgICAgICAgICAgICAgIGhkZF9zb2Z0YXBfdHJhZmZpY19tb25pdG9yX3RpbWVvdXRfaGFuZGxlciwKKyAgICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4KTsKKyAgICAgICAgdm9zX2xvY2tfaW5pdCgmcEhkZEN0eC0+dHJhZmZpY19tb25pdG9yLnRyYWZmaWNMb2NrKTsKKyAgICAgICAgcEhkZEN0eC0+dHJhZmZpY19tb25pdG9yLmlzSW5pdGlhbGl6ZWQgPSAxOworICAgICAgICBwSGRkQ3R4LT50cmFmZmljX21vbml0b3IubGFzdEZyYW1lVHMgICA9IDA7CisgICAgICAgIC8qIFN0YXJ0IHRyYWZmaWMgbW9uaXRvciB0aW1lciBoZXJlCisgICAgICAgICAqIElmIG5vIEFQIGFzc29jLCBpbW1lZGlhdGx5IGdvIGludG8gc3VzcGVuZCAqLworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSEREX1NBUF9EQVRBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICIlcyAgU3RhcnQgVHJhZmZpYyBNb25pdG9yIFRpbWVyIiwgX19mdW5jX18pOworICAgICAgICB2b3NfdGltZXJfc3RhcnQoJnBIZGRDdHgtPnRyYWZmaWNfbW9uaXRvci50cmFmZmljVGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+Y2ZnX2luaS0+dHJhZmZpY0lkbGVUaW1lb3V0KTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERF9TQVBfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAiJXMgIFRyYWZmaWMgTW9uaXRvciBpcyBub3QgRW5hYmxlIGluIGluaSBmaWxlIiwgX19mdW5jX18pOworICAgIH0KKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gc3RhdHVzOworfQorCitWT1NfU1RBVFVTIGhkZF9zdG9wX3RyYWZmaWNNb25pdG9yKCBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciApCit7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIFZPU19TVEFUVVMgc3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworCisgICAgRU5URVIoKTsKKyAgICBzdGF0dXMgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgtRU5PREVWID09IHN0YXR1cykKKyAgICB7CisgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgfQorCisgICAgaWYgKHBIZGRDdHgtPnRyYWZmaWNfbW9uaXRvci5pc0luaXRpYWxpemVkKQorICAgIHsKKyAgICAgICAgaWYgKFZPU19USU1FUl9TVEFURV9TVE9QUEVEICE9CisgICAgICAgICAgICB2b3NfdGltZXJfZ2V0Q3VycmVudFN0YXRlKCZwSGRkQ3R4LT50cmFmZmljX21vbml0b3IudHJhZmZpY1RpbWVyKSkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERF9TQVBfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgIiVzICBTdG9wIFRyYWZmaWMgTW9uaXRvciBUaW1lciIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHZvc190aW1lcl9zdG9wKCZwSGRkQ3R4LT50cmFmZmljX21vbml0b3IudHJhZmZpY1RpbWVyKTsKKyAgICAgICAgfQorICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSEREX1NBUF9EQVRBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICIlcyAgRGVzdHJveSBUcmFmZmljIE1vbml0b3IgVGltZXIiLCBfX2Z1bmNfXyk7CisgICAgICAgIHZvc190aW1lcl9kZXN0cm95KCZwSGRkQ3R4LT50cmFmZmljX21vbml0b3IudHJhZmZpY1RpbWVyKTsKKyAgICAgICAgdm9zX2xvY2tfZGVzdHJveSgmcEhkZEN0eC0+dHJhZmZpY19tb25pdG9yLnRyYWZmaWNMb2NrKTsKKyAgICAgICAgcEhkZEN0eC0+dHJhZmZpY19tb25pdG9yLmlzSW5pdGlhbGl6ZWQgPSAwOworICAgIH0KKyAgICBFWElUKCk7CisgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3NvZnRhcF9mbHVzaF90eF9xdWV1ZXMoKSAtIFV0aWxpdHkgZnVuY3Rpb24gdG8gZmx1c2ggdGhlIFRYIHF1ZXVlcworCisgIEBwYXJhbSBwQWRhcHRlciA6IFtpbl0gcG9pbnRlciB0byBhZGFwdGVyIGNvbnRleHQgIAorICBAcmV0dXJuICAgICAgICAgOiBWT1NfU1RBVFVTX0VfRkFJTFVSRSBpZiBhbnkgZXJyb3JzIGVuY291bnRlcmVkIAorICAgICAgICAgICAgICAgICAgOiBWT1NfU1RBVFVTX1NVQ0NFU1Mgb3RoZXJ3aXNlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitzdGF0aWMgVk9TX1NUQVRVUyBoZGRfc29mdGFwX2ZsdXNoX3R4X3F1ZXVlcyggaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgKQoreworICAgVk9TX1NUQVRVUyBzdGF0dXMgP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FJbmZvW1NUQUlkXS52b3NMb3dSZXNvdXJjZSA9IFZPU19GQUxTRTsKKyAgIH0KKworICAgc3Bpbl91bmxvY2tfYmgoICZwU2FwQ3R4LT5zdGFJbmZvX2xvY2sgKTsKKworICAgcmV0dXJuIHN0YXR1czsKK30KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3NvZnRhcF9oYXJkX3N0YXJ0X3htaXQoKSAtIEZ1bmN0aW9uIHJlZ2lzdGVyZWQgd2l0aCB0aGUgTGludXggT1MgZm9yIAorICB0cmFuc21pdHRpbmcgcGFja2V0cy4gVGhlcmUgYXJlIDIgdmVyc2lvbnMgb2YgdGhpcyBmdW5jdGlvbi4gT25lIHRoYXQgdXNlcworICBsb2NrZWQgcXVldWUgYW5kIG90aGVyIHRoYXQgdXNlcyBsb2NrbGVzcyBxdWV1ZXMuIEJvdGggaGF2ZSBiZWVuIHJldGFpbmVkIHRvCisgIGRvIHNvbWUgcGVyZm9ybWFuY2UgdGVzdGluZworCisgIEBwYXJhbSBza2IgICAgICA6IFtpbl0gIHBvaW50ZXIgdG8gT1MgcGFja2V0IChza19idWZmKQorICBAcGFyYW0gZGV2ICAgICAgOiBbaW5dIHBvaW50ZXIgdG8gTGlicmEgbmV0d29yayBkZXZpY2UKKyAgCisgIEByZXR1cm4gICAgICAgICA6IE5FVF9YTUlUX0RST1AgaWYgcGFja2V0cyBhcmUgZHJvcHBlZAorICAgICAgICAgICAgICAgICAgOiBORVRfWE1JVF9TVUNDRVNTIGlmIHBhY2tldCBpcyBlbnF1ZXVlZCBzdWNjZXNmdWxseQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworaW50IGhkZF9zb2Z0YXBfaGFyZF9zdGFydF94bWl0KHN0cnVjdCBza19idWZmICpza2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dWV1ZVthY10ubG9jayk7CisgICAgICAgICAvKiBGcmVlIHRoZSBza2Igb25seSBpZiB3ZSBhcmUgYWJsZSB0byByZW1vdmUgaXQgZnJvbSB0aGUgbGlzdC4KKyAgICAgICAgICAqIElmIHdlIGFyZSBub3QgYWJsZSB0byByZXRyaWV2ZSBpdCBmcm9tIHRoZSBsaXN0IGl0IG1lYW5zIHRoYXQKKyAgICAgICAgICAqIHRoZSBza2Igd2FzIHB1bGxlZCBieSBUWCBUaHJlYWQgYW5kIGlzIHVzZSBzbyB3ZSBzaG91bGQgbm90IGZyZWUKKyAgICAgICAgICAqIGl0IGhlcmUKKyAgICAgICAgICAqLworICAgICAgICAgaWYgKFZPU19JU19TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgeworICAgICAgICAgICAgcGt0Tm9kZSA9IGxpc3RfZW50cnkoYW5jaG9yLCBza2JfbGlzdF9ub2RlX3QsIGFuY2hvcik7CisgICAgICAgICAgICBza2IxID0gcGt0Tm9kZS0+c2tiOworICAgICAgICAgICAga2ZyZWVfc2tiKHNrYjEpOworICAgICAgICAgfQorICAgICAgICAgKytwQWRhcHRlci0+c3RhdHMudHhfZHJvcHBlZDsKKyAgICAgICAgICsrcEFkYXB0ZXItPmhkZF9zdGF0cy5oZGRUeFJ4U3RhdHMudHhYbWl0RHJvcHBlZDsKKyAgICAgICAgICsrcEFkYXB0ZXItPmhkZF9zdGF0cy5oZGRUeFJ4U3RhdHMudHhYbWl0RHJvcHBlZEFDW2FjXTsKKyAgICAgICAgIGdvdG8geG1pdF9kb25lOworICAgICAgfQorICAgfQorICAgZGV2LT50cmFuc19zdGFydCA9IGppZmZpZXM7CisKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IRERfU0FQX0RBVEEsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICAgIiVzOiBleGl0IiwgX19mdW5jX18pOworCit4bWl0X2RvbmU6CisgICBzcGluX3VubG9ja19iaCggJnBTYXBDdHgtPnN0YUluZm9fbG9jayApOworICAgcmV0dXJuIG9zX3N0YXR1czsKK30KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3NvZnRhcF9zdGFfMl9zdGFfeG1pdCBUaGlzIGZ1bmN0aW9uIGZvciBUcmFuc21pdHRpbmcgdGhlIGZyYW1lcyB3aGVuIHRoZSB0cmFmZmljIGlzIGJldHdlZW4gdHdvIHN0YXRpb25zLgorCisgIEBwYXJhbSBza2IgICAgICA6IFtpbl0gcG9pbnRlciB0byBwYWNrZXQgKHNrX2J1ZmYpCisgIEBwYXJhbSBkZXYgICAgICA6IFtpbl0gcG9pbnRlciB0byBMaWJyYSBuZXR3b3JrIGRldmljZQorICBAcGFyYW0gU1RBSWQgICAgOiBbaW5dIFN0YXRpb24gSWQgb2YgRGVzdGluYXRpb24gU3RhdGlvbgorICBAcGFyYW0gdXAgICAgICAgOiBbaW5dIFVzZXIgUHJpb3JpdHkgCisgIAorICBAcmV0dXJuICAgICAgICAgOiBORVRfWE1JVF9EUk9QIGlmIHBhY2tldHMgYXJlIGRyb3BwZWQKKyAgICAgICAgICAgICAgICAgIDogTkVUX1hNSVRfU1VDQ0VTUyBpZiBwYWNrZXQgaXMgZW5xdWV1ZWQgc3VjY2VzZnVsbHkKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgaGRkX3NvZnRhcF9zdGFfMl9zdGFfeG1pdChzdHJ1Y3Qgc2tfYnVmZiAqc2tiLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90IFNU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hcHRlci0+aGRkX3N0YXRzLmhkZFR4UnhTdGF0cy50eFhtaXREcm9wcGVkOworICAgICAgICAgKytwQWRhcHRlci0+aGRkX3N0YXRzLmhkZFR4UnhTdGF0cy50eFhtaXREcm9wcGVkQUNbYWNdOworICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICAgICBnb3RvIHhtaXRfZW5kOworICAgICAgfQorICAgfQorCisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSEREX1NBUF9EQVRBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19MT1csICIlczogZXhpdCIsIF9fZnVuY19fKTsKKworeG1pdF9lbmQ6CisgICBzcGluX3VubG9ja19iaCggJnBTYXBDdHgtPnN0YUluZm9fbG9jayApOworICAgcmV0dXJuIHN0YXR1czsKK30KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgX19oZGRfc29mdGFwX3R4X3RpbWVvdXQoKSAtIEZ1bmN0aW9uIGNhbGxlZCBieSBPUyBpZiB0aGVyZSBpcyBhbnkKKyAgdGltZW91dCBkdXJpbmcgdHJhbnNtaXNzaW9uLiBTaW5jZSBIREQgc2ltcGx5IGVucXVldWVzIHBhY2tldAorICBhbmQgcmV0dXJucyBjb250cm9sIHRvIE9TIHJpZ2h0IGF3YXksIHRoaXMgd291bGQgbmV2ZXIgYmUgaW52b2tlZAorCisgIEBwYXJhbSBkZXYgOiBbaW5dIHBvaW50ZXIgdG8gTGlicmEgbmV0d29yayBkZXZpY2UKKyAgQHJldHVybiAgICA6IE5vbmUKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgX19oZGRfc29mdGFwX3R4X3RpbWVvdXQoc3RydWN0IG5ldF9kZXZpY2UgKmRldikKK3sKKyAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyID0gIFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgc3RydWN0IG5ldGRldl9xdWV1ZSAqdHhxOworICAgaW50IGkgPSAwOworICAgaW50IHN0YXR1cyA9IDA7CisgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworCisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSEREX1NBUF9EQVRBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAiJXM6IFRyYW5zbWlzc2lvbiB0aW1lb3V0IG9jY3VycmVkIiwgX19mdW5jX18pOworCisgICBpZiAoIE5VTEwgPT0gcEFkYXB0ZXIgKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERF9TQVBfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICBGTCgicEFkYXB0ZXIgaXMgTlVMTCIpKTsKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICByZXR1cm47CisgICB9CisKKyAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgIHN0YXR1cyA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICBpZiAoc3RhdHVzICE9IDApCisgICB7CisgICAgICAgcmV0dXJuOworICAgfQorCisgICArK3BBZGFwdGVyLT5oZGRfc3RhdHMuaGRkVHhSeFN0YXRzLnR4VGltZW91dENvdW50OworCisgICBmb3IgKGkgPSAwOyBpIDwgTlVNX1RYX1FVRVVFUzsgaSsrKQorICAgeworICAgICAgdHhxID0gbmV0ZGV2X2dldF90eF9xdWV1ZShkZXYsIGkpOworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERF9TQVBfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICJRdWV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m9tIERhdGEgc3RhbGwgSXNzdWUgU1NSIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICBXTEFOVExfRmF0YWxFcnJvcigpOworICAgICAgcmV0dXJuOworICAgfQorCisgICAvKiBJZiBUeCBzdGFsbGVkIGZvciBhIGxvbmcgdGltZSB0aGVuICpoZGRfdHhfdGltZW91dCogaXMgY2FsbGVkCisgICAgKiBldmVyeSA1c2VjLiBUaGUgVEwgZGVidWcgc3BpdHMgb3V0IGEgbG90IG9mIGluZm9ybWF0aW9uIG9uIHRoZQorICAgICogc2VyaWFsIGNvbnNvbGUsIGlmIGl0IGlzIGNhbGxlZCBldmVyeSB0aW1lICpoZGRfdHhfdGltZW91dCogaXMKKyAgICAqIGNhbGxlZCB0aGVuIHdlIG1heSBnZXQgYSB3YXRjaGRvZyBiaXRlIG9uIHRoZSBBcHBsaWNhdGlvbgorICAgICogcHJvY2Vzc29yLCBzbyByYXRlbGltaXQgdGhlIFRMIGRlYnVnIGxvZ3MuCisgICAgKi8KKyAgIGlmIChfX3JhdGVsaW1pdCgmaGRkX3NvZnRhcF90eF90aW1lb3V0X3JzKSkKKyAgIHsKKyAgICAgIGhkZF93bW1fdHhfc25hcHNob3QocEFkYXB0ZXIpOworICAgICAgV0xBTlRMX1RMRGVidWdNZXNzYWdlKFdMQU5UTF9ERUJVR19UWF9TTkFQU0hPVCk7CisgICB9CisKK30gCisKK3ZvaWQgaGRkX3NvZnRhcF90eF90aW1lb3V0KHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCit7CisgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgX19oZGRfc29mdGFwX3R4X3RpbWVvdXQoZGV2KTsKKyAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKyAgIHJldHVybjsKK30KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgX19oZGRfc29mdGFwX3N0YXRzKCkgLSBGdW5jdGlvbiByZWdpc3RlcmVkIHdpdGggdGhlIExpbnV4IE9TIGZvcgorICBkZXZpY2UgVFgvUlggc3RhdGlzdGljCisKKyAgQHBhcmFtIGRldiAgICAgIDogW2luXSBwb2ludGVyIHRvIExpYnJhIG5ldHdvcmsgZGV2aWNlCisgIAorICBAcmV0dXJuICAgICAgICAgOiBwb2ludGVyIHRvIG5ldF9kZXZpY2Vfc3RhdHMgc3RydWN0dXJlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitzdHJ1Y3QgbmV0X2RldmljZV9zdGF0cyogX19oZGRfc29mdGFwX3N0YXRzKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCit7CisgICBoZGRfYWRhcHRlcl90KiBwcml2ID0gbmV0ZGV2X3ByaXYoZGV2KTsKKyAgIHJldHVybiAmcHJpdi0+c3RhdHM7Cit9CisKK3N0cnVjdCBuZXRfZGV2aWNlX3N0YXRzKiBoZGRfc29mdGFwX3N0YXRzKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCit7CisgICBzdHJ1Y3QgbmV0X2RldmljZV9zdGF0cyAqcHJpdl9zdGF0czsKKyAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICBwcml2X3N0YXRzID0gX19oZGRfc29mdGFwX3N0YXRzKGRldik7CisgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgIHJldHVybiBwcml2X3N0YXRzOworfQorCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfc29mdGFwX2luaXRfdHhfcngoKSAtIEluaXQgZnVuY3Rpb24gdG8gaW5pdGlhbGl6ZSBUeC9SWAorICBtb2R1bGVzIGluIEhERAorCisgIEBwYXJhbSBwQWRhcHRlciA6IFtpbl0gcG9pbnRlciB0byBhZGFwdGVyIGNvbnRleHQgIAorICBAcmV0dXJuICAgICAgICAgOiBWT1NfU1RBVFVTX0VfRkFJTFVSRSBpZiBhbnkgZXJyb3JzIGVuY291bnRlcmVkIAorICAgICAgICAgICAgICAgICAgOiBWT1NfU1RBVFVTX1NVQ0NFU1Mgb3RoZXJ3aXNlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIGhkZF9zb2Z0YXBfaW5pdF90eF9yeCggaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgKQoreworICAgVk9TX1NUQVRVUyBzdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICB2X1NJTlRfdCBpID0gLTE7CisgICB2X1NJWkVfdCBzaXplID0gMDsKKworICAgdl9VOF90IFNUQUlkID0gMDsKKyAgIHZfQ09OVEVYVF90IHBWb3NDb250ZXh0ID0gKCBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPnB2b3NDb250ZXh0OworICAgcHRTYXBDb250ZXh0IHBTYXBDdHggPSBOVUxMOworCisgICB2X1U4X3QgcEFDV2VpZ2h0c1tdID0geworICAgICAgICAgICAgICAgICAgICAgICAgICAgSEREX1NPRlRBUF9CS19XRUlHSFRfREVGQVVMVCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICBIRERfU09GVEFQX0JFX1dFSUdIVF9ERUZBVUxULCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIEhERF9TT0ZUQVBfVklfV0VJR0hUX0RFRkFVTFQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgSEREX1NPRlRBUF9WT19XRUlHSFRfREVGQVVMVAorICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICBwU2FwQ3R4ID0gVk9TX0dFVF9TQVBfQ0IocFZv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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfc29mdGFwX2RlaW5pdF90eF9yeCgpIC0gRGVpbml0IGZ1bmN0aW9uIHRvIGNsZWFuIHVwIFR4L1JYCisgIG1vZHVsZXMgaW4gSERECisKKyAgQHBhcmFtIHBBZGFwdGVyIDogW2luXSBwb2ludGVyIHRvIGFkYXB0ZXIgY29udGV4dCAgCisgIEByZXR1cm4gICAgICAgICA6IFZPU19TVEFUVVNfRV9GQUlMVVJFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQgCisgICAgICAgICAgICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgaGRkX3NvZnRhcF9kZWluaXRfdHhfcngoIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyICkKK3sKKyAgIFZPU19TVEFUVVMgc3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworCisgICBpZiAoVk9TX1NUQVRVU19TVUNDRVNTICE9IGhkZF9zdG9wX3RyYWZmaWNNb25pdG9yKHBBZGFwdGVyKSkKKyAgIHsKKyAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSEREX1NBUF9EQVRBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogRmFpbCB0byBTdG9wIFRyYWZmaWMgTW9uaXRvIHRpbWVyIiwgX19mdW5jX18gKTsKKyAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICBzdGF0dXMgPSBoZGRfc29mdGFwX2ZsdXNoX3R4X3F1ZXVlcyhwQWRhcHRlcik7CisKKyAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF9zb2Z0YXBfZmx1c2hfdHhfcXVldWVzX3N0YSgpIC0gVXRpbGl0eSBmdW5jdGlvbiB0byBmbHVzaCB0aGUgVFggcXVldWVzIG9mIGEgc3RhdGlvbgorCisgIEBwYXJhbSBwQWRhcHRlciA6IFtpbl0gcG9pbnRlciB0byBhZGFwdGVyIGNvbnRleHQKKyAgQHBhcmFtIFNUQUlkICAgIDogW2luXSBTdGF0aW9uIElEIHRvIGRlaW5pdCAKKyAgQHJldHVybiAgICAgICAgIDogVk9TX1NUQVRVU19FX0ZBSUxVUkUgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZCAKKyAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworc3RhdGljIFZPU19TVEFUVVMgaGRkX3NvZnRhcF9mbHVzaF90eF9xdWV1ZXNfc3RhKCBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwgdl9VOF90IFNUQUlkICkKK3sKKyAgIHZfVThfdCBpID0gLTE7CisKKyAgIGhkZF9saXN0X25vZGVfdCAqYW5jaG9yID0gTlVMTDsKKworICAgc2tiX2xpc3Rfbm9kZV90ICpwa3ROb2RlID0gTlVMTDsKKyAgIHN0cnVjdCBza19idWZmICpza2IgPSBOVUxMOworCisgICB2X0NPTlRFWFRfdCBwVm9zQ29udGV4dCA9ICggV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcikpLT5wdm9zQ29udGV4dDsKKyAgIHB0U2FwQ29udGV4dCBwU2FwQ3R4ID0gTlVMTDsKKyAgIHBTYXBDdHggPSBWT1NfR0VUX1NBUF9DQihwVm9zQ29udGV4dCk7CisgICBpZihwU2FwQ3R4ID09IE5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DsKKyAgICAgICAgICAgICsrcEFkYXB0ZXItPmhkZF9zdGF0cy5oZGRUeFJ4U3RhdHMudHhGbHVzaGVkQUNbaV07CisgICAgICAgICAgICBrZnJlZV9za2Ioc2tiKTsKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgfQorCisgICAgICAgICAvL2N1cnJlbnQgbGlzdCBpcyBlbXB0eQorICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBzcGluX3VubG9ja19iaCgmcFNhcEN0eC0+YVN0YUluZm9bU1RBSWRdLndtbV90eF9xdWV1ZVtpXS5sb2NrKTsKKyAgIH0KKworICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3NvZnRhcF9pbml0X3R4X3J4X3N0YSgpIC0gSW5pdCBmdW5jdGlvbiB0byBpbml0aWFsaXplIGEgc3RhdGlvbiBpbiBUeC9SWAorICBtb2R1bGVzIGluIEhERAorCisgIEBwYXJhbSBwQWRhcHRlciA6IFtpbl0gcG9pbnRlciB0byBhZGFwdGVyIGNvbnRleHQKKyAgQHBhcmFtIFNUQUlkICAgIDogW2luXSBTdGF0aW9uIElEIHRvIGRlaW5pdAorICBAcGFyYW0gcG1hY0FkZHJTVEEgIDogW2luXSBwb2ludGVyIHRvIHRoZSBNQUMgYWRkcmVzcyBvZiB0aGUgc3RhdGlvbiAgCisgIEByZXR1cm4gICAgICAgICA6IFZPU19TVEFUVVNfRV9GQUlMVVJFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQgCisgICAgICAgICAgICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8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U19TVFIpLCBTVEFJZCwKKyAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwbWFjQWRkclNUQS0+Ynl0ZXMpKTsKKworICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3NvZnRhcF9kZWluaXRfdHhfcnhfc3RhKCkgLSBEZWluaXQgZnVuY3Rpb24gdG8gY2xlYW4gdXAgYSBzdGF0aW9pbiBpbiBUeC9SWAorICBtb2R1bGVzIGluIEhERAorCisgIEBwYXJhbSBwQWRhcHRlciA6IFtpbl0gcG9pbnRlciB0byBhZGFwdGVyIGNvbnRleHQKKyAgQHBhcmFtIFNUQUlkICAgIDogW2luXSBTdGF0aW9uIElEIHRvIGRlaW5pdCAKKyAgQHJldHVybiAgICAgICAgIDogVk9TX1NUQVRVU19FX0ZBSUxVUkUgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZCAKKyAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBoZGRfc29mdGFwX2RlaW5pdF90eF9yeF9zdGEgKCBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwgdl9VOF90IFNUQUlkICkKK3sKKyAgIFZPU19TVEFUVVMgc3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgdl9VOF90IGFjOworICAgLyoqVHJhY2sgd2hldGhlciBPUyBUWCBxdWV1ZSBoYXMgYmVlbiBkaXNhYmxlZC4qLworICAgdl9CT09MX3QgdHhTdXNwZW5kZWRbTlVNX1RYX1FVRVVFU107CisgICB2X1U4X3QgdGxBQzsKKyAgIGhkZF9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VbaV0sCisgICAgICAgICAgICAgICAgICAgIEhERF9UWF9RVUVVRV9NQVhfTEVOKTsKKyAgIH0KKworICAgaWYgKEJTU19TVEFSVCA9PSBwSG9zdGFwZFN0YXRlLT5ic3NTdGF0ZSkKKyAgIHsKKyAgICAgIGZvciAoYWMgPSBIRERfTElOVVhfQUNfVk87IGFjIDw9IEhERF9MSU5VWF9BQ19CSzsgYWMrKykKKyAgICAgIHsKKyAgICAgICAgIGlmICh0eFN1c3BlbmRlZFthY10pCisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSEREX1NBUF9EQVRBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBUWCBxdWV1ZSByZS1lbmFibGVkIiwgX19mdW5jX18pOworICAgICAgICAgICAgbmV0aWZfd2FrZV9zdWJxdWV1ZShwQWRhcHRlci0+ZGV2LCBhYyk7CisgICAgICAgICB9CisgICAgICB9CisgICB9CisKKyAgIHNwaW5fdW5sb2NrX2JoKCAmcFNhcEN0eC0+c3RhSW5mb19sb2NrICk7CisgICByZXR1cm4gc3RhdHVzOworfQorCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfc29mdGFwX2Rpc2Nvbm5lY3RfdHhfcngoKSAtIERpc2Nvbm5lY3QgZnVuY3Rpb24gdG8gY2xlYW4gdXAgVHgvUlgKKyAgbW9kdWxlcyBpbiBIREQKKworICBAcGFyYW0gcEFkYXB0ZXIgOiBbaW5dIHBvaW50ZXIgdG8gYWRhcHRlciBjb250ZXh0ICAKKyAgQHJldHVybiAgICAgICAgIDogVk9TX1NUQVRVU19FX0ZBSUxVUkUgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZCAKKyAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBoZGRfc29mdGFwX2Rpc2Nvbm5lY3RfdHhfcngoIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyICkKK3sKKyAgIHJldHVybiBoZGRfc29mdGFwX2ZsdXNoX3R4X3F1ZXVlcyhwQWRhcHRlcik7Cit9CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF9zb2Z0YXBfdHhfY29tcGxldGVfY2JrKCkgLSBDYWxsYmFjayBmdW5jdGlvbiBpbnZva2VkIGJ5IFRMCisgIHRvIGluZGljYXRlIHRoYXQgYSBwYWNrZXQgaGFzIGJlZW4gdHJhbnNtaXR0ZWQgYWNyb3NzIHRoZSBidXMKKyAgc3VjY2VzZnVsbHkuIE9TIHBhY2tldCByZXNvdXJjZXMgY2FuIGJlIHJlbGVhc2VkIGFmdGVyIHRoaXMgY2JrLgorCisgIEBwYXJhbSB2b3NDb250ZXh0ICAgOiBbaW5dIHBvaW50ZXIgdG8gVk9TIGNvbnRleHQgICAKKyAgQHBhcmFtIHBWb3NQYWNrZXQgICA6IFtpbl0gcG9pbnRlciB0byBWT1MgcGFja2V0IChjb250YWluaW5nIHNrYikgCisgIEBwYXJhbSB2b3NTdGF0dXNJbiAgOiBbaW5dIHN0YXR1cyBvZiB0aGUgdHJhbnNtaXNzaW9uIAorCisgIEByZXR1cm4gICAgICAgICAgICAgOiBWT1NfU1RBVFVTX0VfRkFJTFVSRSBpZiBhbnkgZXJyb3JzIGVuY291bnRlcmVkIAorICAgICAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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JBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogQ291bGQgbm90IHJldHVybiBWT1MgcGFja2V0IHRvIHRoZSBwb29sIiwgX19mdW5jX18pOworICAgfQorCisgICByZXR1cm4gc3RhdHVzOworfQorCisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF9zb2Z0YXBfdHhfZmV0Y2hfcGFja2V0X2NiaygpIC0gQ2FsbGJhY2sgZnVuY3Rpb24gaW52b2tlZCBieSBUTCB0byAKKyAgZmV0Y2ggYSBwYWNrZXQgZm9yIHRyYW5zbWlzc2lvbi4KKworICBAcGFyYW0gdm9zQ29udGV4dCAgIDogW2luXSBwb2ludGVyIHRvIFZPUyBjb250ZXh0ICAKKyAgQHBhcmFtIHN0YUlkICAgICAgICA6IFtpbl0gU3RhdGlvbiBmb3Igd2hpY2ggVEwgaXMgcmVxdWVzdGluZyBhIHBrdAorICBAcGFyYW0gYWMgICAgICAgICAgIDogW2luXSBhY2Nlc3MgY2F0ZWdvcnkgcmVxdWVzdGVkIGJ5IFRMCisgIEBwYXJhbSBwVm9zUGFja2V0ICAgOiBbb3V0XSBwb2ludGVyIHRvIFZPUyBwYWNrZXQgcGFja2V0IHBvaW50ZXIKKyAgQHBhcmFtIHBQa3RNZXRhSW5mbyA6IFtvdXRdIHBvaW50ZXIgdG8gbWV0YSBpbmZvIGZvciB0aGUgcGt0IAorICAKKyAgQHJldHVybiAgICAgICAgICAgICA6IFZPU19TVEFUVVNfRV9FTVBUWSBpZiBubyBwYWNrZXRzIHRvIHRyYW5zbWl0CisgICAgICAgICAgICAgICAgICAgICAgOiBWT1NfU1RBVFVTX0VfRkFJTFVSRSBpZiBhbnkgZXJyb3JzIGVuY291bnRlcmVkIAorICAgICAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBoZGRfc29mdGFwX3R4X2ZldGNoX3BhY2tldF9jYmsoIHZfVk9JRF90ICp2b3NDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwU3RhSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfQUNFbnVtVHlwZSAgYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfcGt0X3QgKipwcFZvc1BhY2tldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9NZXRhSW5mb1R5cGUgKnBQa3RNZXRhSW5mbyApCit7CisgICBWT1NfU1RBVFVTIHN0YXR1cyA9IFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgPSBOVUxMOworICAgaGRkX2xpc3Rfbm9kZV90ICphbmNob3IgPSBOVUxMOworICAgc2tiX2xpc3Rfbm9kZV90ICpwa3ROb2RlID0gTlVMTDsKKyAgIHN0cnVjdCBza19idWZmICpza2IgPSBOVUxMOworICAgdm9zX3BrdF90ICpwVm9zUGFja2V0ID0gTlVMTDsKKyAgIHZfTUFDQUREUl90KiBwRGVzdE1hY0FkZHJlc3MgPSBOVUxMOworICAgdl9USU1FX3QgdGltZXN0YW1wOworICAgdl9TSVpFX3Qgc2l6ZSA9IDA7CisgICB2X1U4X3QgU1RBSWQgPSBXTEFOX01BWF9TVEFfQ09VTlQ7ICAgCisgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gTlVMTDsKKyAgIHZfVThfdCBwcm90b190eXBlID0gMDsKKyAgIHZfQ09OVEVYVF90IHBWb3NDb250ZXh0ID0gTlVMTDsKKyAgIHB0U2FwQ29udGV4dCBwU2FwQ3R4ID0gTlVMTDsKKyAgIC8vU2FuaXR5IGNoZWNrIG9uIGlucHV0cworICAgaWYgKCAoIE5VTEwgPT0gdm9zQ29udGV4dCApIHx8IAorICAgICAgICAoIE5VTEwgPT0gcFN0YUlkICkgfHwgCisgICAgICAgICggTlVMTCA9PSBwcFZvc1BhY2tldCApIHx8CisgICAgICAgICggTlVMTCA9PSBwUGt0TWV0YUluZm8gKSApCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSEREX1NBUF9EQVRBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogTnVsbCBQYXJhbXMgYmVpbmcgcGFzc2VkIiwgX19mdW5jX18pOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgfQorICAgIAorICAgLy9HZXQgdGhlIEhERCBjb250ZXh0LgorICAgcEhkZEN0eCA9IChoZGRfY29udGV4dF90ICopdm9zX2dldF9jb250ZXh0KCBWT1NfTU9EVUxFX0lEX0hERCwgdm9zQ29udGV4dCApOworICAgaWYgKCBOVUxMID09IHBIZGRDdHggKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERF9TQVBfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IEhERCBhZGFwdGVyIGNvbnRleHQgaXMgTnVsbCIsIF9fZnVuY19fKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgIH0KKworICAgU1RBSWQgPSAqcFN0YUlkOworICAgaWYgKFNUQUlkID49IFdMQU5fTUFYX1NUQV9DT1VOVCkKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IRERfU0FQX0RBVEEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIFNUQUl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BwSGRkQ3R4LT5jZmdfaW5pLT5lbmFibGVUcmFmZmljTW9uaXRvciApCisgICB7CisgICAgICBwSGRkQ3R4LT50cmFmZmljX21vbml0b3IubGFzdEZyYW1lVHMgPSB2b3NfdGltZXJfZ2V0X3N5c3RlbV90aW1lKCk7CisgICAgICBpZiAoICFhdG9taWNfcmVhZCgmcEhkZEN0eC0+dHJhZmZpY19tb25pdG9yLmlzQWN0aXZlTW9kZSkgKQorICAgICAgeworICAgICAgICAgdm9zX2xvY2tfYWNxdWlyZSgmcEhkZEN0eC0+dHJhZmZpY19tb25pdG9yLnRyYWZmaWNMb2NrKTsKKyAgICAgICAgIC8qIEl0IHdhcyBJRExFIG1vZGUsCisgICAgICAgICAgKiB0aGlzIGlzIG5ldyBzdGF0ZSwgdGhlbiBzd2l0Y2ggbW9kZSBmcm9tIHN1c3BlbmQgdG8gcmVzdW1lICovCisgICAgICAgICBpZiAoICFhdG9taWNfcmVhZCgmcEhkZEN0eC0+dHJhZmZpY19tb25pdG9yLmlzQWN0aXZlTW9kZSkgKQorICAgICAgICAgeworICAgICAgICAgICAgaGRkX3NldF93bGFuX3N1c3BlbmRfbW9kZSgwKTsKKyAgICAgICAgICAgIHZvc190aW1lcl9zdGFydCgmcEhkZEN0eC0+dHJhZmZpY19tb25pdG9yLnRyYWZmaWNUaW1lciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT5jZmdfaW5pLT50cmFmZmljSWRsZVRpbWVvdXQpOworICAgICAgICAgICAgYXRvbWljX3NldCgmcEhkZEN0eC0+dHJhZmZpY19tb25pdG9yLmlzQWN0aXZlTW9kZSwgMSk7CisgICAgICAgICB9CisgICAgICAgICB2b3NfbG9ja19yZWxlYXNlKCZwSGRkQ3R4LT50cmFmZmljX21vbml0b3IudHJhZmZpY0xvY2spOworICAgICAgfQorICAgfQorCisgICArK3BBZGFwdGVyLT5oZGRfc3RhdHMuaGRkVHhSeFN0YXRzLnR4RmV0Y2hlZDsKKworIC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HJ5KGFuY2hvciwgc2tiX2xpc3Rfbm9kZV90LCBhbmNob3IpOworICAgICAgc2tiID0gcGt0Tm9kZS0+c2tiOworICAgfQorICAgZWxzZQorICAgeworICAgICAgKytwQWRhcHRlci0+aGRkX3N0YXRzLmhkZFR4UnhTdGF0cy50eEZldGNoRGVxdWV1ZUVycm9yOworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERF9TQVBfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IEVycm9yIGluIGRlLXF1ZXVpbmcgc2tiIGZyb20gVHggcXVldWUgc3RhdHVzID0gJWQiLAorICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgc3RhdHVzICk7CisgICAgICB2b3NfcGt0X3JldHVybl9wYWNrZXQocFZvc1BhY2tldCk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICB9CisKKyAgIC8vQXR0YWNoIHNrYiB0byBWT1MgcGFja2V0LgorICAgc3RhdHVzID0gdm9zX3BrdF9zZXRfb3NfcGFja2V0KCBwVm9zUGFja2V0LCBza2IgKTsKKyAgIGlmIChzdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERF9TQVBfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IEVycm9yIGF0dGFjaGluZyBza2IiLCBfX2Z1bmNfXyk7CisgICAgICB2b3NfcGt0X3JldHVybl9wYWNrZXQocFZvc1BhY2tldCk7CisgICAgICArK3BBZGFwdGVyLT5zdGF0cy50eF9kcm9wcGVkOworICAgICAgKytwQWRhcHRlci0+aGRkX3N0YXRzLmhkZFR4UnhTdGF0cy50eEZldGNoRGVxdWV1ZUVycm9yOworICAgICAga2ZyZWVfc2tiKHNrYik7CisgICAgICByZXR1cm4gVk9TX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GFJbmZvLT5iTW9yZVBhY2tldHMgPSAwOworICAgfQorCisgICBwUGt0TWV0YUluZm8tPnVjSXNFYXBvbCA9IDA7CisKKyAgIGlmKHBTYXBDdHgtPmFTdGFJbmZvW1NUQUlkXS50bFNUQVN0YXRlICE9IFdMQU5UTF9TVEFfQVVUSEVOVElDQVRFRCkKKyAgIHsKKyAgICAgIGlmIChUUlVFID09IGhkZF9Jc0VBUE9MUGFja2V0KCBwVm9zUGFja2V0ICkpCisgICAgICB7CisgICAgICAgICBwUGt0TWV0YUluZm8tPnVjSXNFYXBvbCA9IDE7CisgICAgICAgICB3bGFuX2hkZF9sb2dfZWFwb2woc2tiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdJRklfRVZFTlRfRFJJVkVSX0VBUE9MX0ZSQU1FX1RSQU5TTUlUX1JFUVVFU1RFRCk7CisgICAgICB9CisgICB9CisKKyAgIGlmICgoTlVMTCAhPSBwSGRkQ3R4KSAmJgorICAgICAgIChwSGRkQ3R4LT5jZmdfaW5pLT5nRW5hYmxlRGVidWdMb2cpKQorICAgeworICAgICAgcHJvdG9fdHlwZSA9IHZvc19wa3RfZ2V0X3Byb3RvX3R5cGUoc2tiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+Y2ZnX2luaS0+Z0VuYWJsZURlYnVnTG9nKTsKKyAgICAgIGlmIChWT1NfUEtUX1BST1RPX1RZUEVfRUFQT0wgJiBwcm90b190eXBlKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAiU0FQIFRYIEVBUE9MIik7CisgICAgICB9CisgICAgICBlbHNlIGlmIChWT1NfUEtUX1BST1RPX1RZUEVfREhDUCAmIHByb3RvX3R5cGUpCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIF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09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3NvZnRhcF90eF9sb3dfcmVzb3VyY2VfY2JrKCkgLSBDYWxsYmFjayBmdW5jdGlvbiBpbnZva2VkIGluIHRoZSAKKyAgY2FzZSB3aGVyZSBWT1MgcGFja2V0cyBhcmUgbm90IGF2YWlsYWJsZSBhdCB0aGUgdGltZSBvZiB0aGUgY2FsbCB0byBnZXQgCisgIHBhY2tldHMuIFRoaXMgY2FsbGJhY2sgZnVuY3Rpb24gaXMgaW52b2tlZCBieSBWT1Mgd2hlbiBwYWNrZXRzIGFyZSAKKyAgYXZhaWxhYmxlLgorCisgIEBwYXJhbSBwVm9zUGFja2V0IDogW2luXSAgcG9pbnRlciB0byBWT1MgcGFja2V0IAorICBAcGFyYW0gdXNlckRhdGEgICA6IFtpbl0gIG9wYXF1ZSB1c2VyIGRhdGEgdGhhdCB3YXMgcGFzc2VkIGluaXRpYWxseSAKKyAgCisgIEByZXR1cm4gICAgICAgICAgIDogVk9TX1NUQVRVU19FX0ZBSUxVUkUgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZCwgCisgICAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIGhkZF9zb2Z0YXBfdHhfbG93X3Jlc291cmNlX2Niayggdm9zX3BrdF90ICpwVm9zUGFja2V0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVk9JRF90ICp1c2VyRGF0YSApCit7CisgICBWT1NfU1RBVFVTIHN0YXR1czsKKyAgIHZfU0lOVF90IGkgPSAwOworICAgdl9TSVpFX3Qgc2l6ZSA9IDA7CisgICBoZGRfYWRhcHRlcl90KiBwQWRhcHRlciA9IChoZGRfYWRhcHRlcl90ICopdXNlckRhdGE7Cis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LT5wdm9zQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTVEFJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV0xBTlRMX0FDRW51bVR5cGUpaSApOworICAgICAgICAgICAgICAgaWYoICFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IRERfU0FQX0RBVEEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBGYWlsdXJlIGluIGluZGljYXRpbmcgcGt0IHRvIFRMIGZvciBhYz0lZCIsIF9fZnVuY19fLGkpOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICAgfQorICAgfSAKKyAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9CisKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3NvZnRhcF9yeF9wYWNrZXRfY2JrKCkgLSBSZWNlaXZlIGNhbGxiYWNrIHJlZ2lzdGVyZWQgd2l0aCBUTC4KKyAgVEwgd2lsbCBjYWxsIHRoaXMgdG8gbm90aWZ5IHRoZSBIREQgd2hlbiBvbmUgb3IgbW9yZSBwYWNrZXRzIHdlcmUKKyAgcmVjZWl2ZWQgZm9yIGEgcmVnaXN0ZXJlZCBTVEEuCisKKyAgQHBhcmFtIHZvc0NvbnRleHQgICAgICA6IFtpbl0gcG9pbnRlciB0byBWT1MgY29udGV4dCAgCisgIEBwYXJhbSBwVm9zUGFja2V0Q2hhaW4gOiBbaW5dIHBvaW50ZXIgdG8gVk9TIHBhY2tldCBjaGFpbgorICBAcGFyYW0gc3RhSWQgICAgICAgICAgIDogW2luXSBTdGF0aW9uIElkIChBZHJlc3MgMSBJbmRleCkKKyAgQHBhcmFtIHBSeE1ldGFJbmZvICAgICA6IFtpbl0gcG9pbnRlciB0byBtZXRhIGluZm8gZm9yIHRoZSByZWNlaXZlZCBwa3QocykuCisKKyAgQHJldHVybiAgICAgICAgICAgICAgICA6IFZPU19TVEFUVVNfRV9GQUlMVVJFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQsIAorICAgICAgICAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBoZGRfc29mdGFwX3J4X3BhY2tldF9jYmsoIHZfVk9JRF90ICp2b3NDb250ZXh0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19wa3RfdCAqcFZvc1BhY2tldENoYWluLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90IHN0YUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX1J4TWV0YUluZm9UeXBlKiBwUnhNZXRhSW5mbyApCit7CisgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciA9IE5VTEw7CisgICBWT1NfU1RBVFVTIHN0YXR1cyA9IFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgaW50IHJ4c3RhdDsKKyAgIHN0cnVjdCBza19idWZmICpza2IgPSBOVUxMOworICAgdm9zX3BrdF90KiBwVm9zUGFja2V0OworICAgdm9zX3BrdF90KiBwTmV4dFZvc1BhY2tldDsgICAKKyAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSBOVUxMOyAgIAorICAgdl9VOF90IHByb3RvX3R5cGU7CisKKyAgIC8vU2FuaXR5IGNoZWNrIG9uIGlucHV0cworICAgaWYgKCAoIE5VTEwgPT0gdm9zQ29udGV4dCApIHx8IAorICAgICAgICAoIE5VTEwgPT0gcFZvc1BhY2tldENoYWluICkgfHwKKyAgICAgICAgKCBOVUxMID09IHBSeE1ldGFJbmZvICkgKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERF9TQVBfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IE51bGwgcGFyYW1zIGJlaW5nIHBhc3NlZCIsIF9fZnVuY19fKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgIH0KKyAgIAorICAgcEhkZEN0eCA9IChoZGRfY29udGV4dF90ICopdm9zX2dldF9jb250ZXh0KCBWT1NfTU9EVUxFX0lEX0hERCwgdm9zQ29udGV4dCApOworICAgaWYgKCBOVUxMID09IHBIZGRDdHggKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERF9TQVBfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IEhERCBhZGFwdGVyIGNvbnRleHQgaXMgTnVsbCIsIF9fZnVuY19fKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgIH0KKworICAgcEFkYXB0ZXIgPSBwSGRkQ3R4LT5zdGFfdG9fYWRhcHRlcltzdGFJZF07CisgICBpZiggKE5VTEwgPT0gcEFkYXB0ZXIpIHx8IChXTEFOX0hERF9BREFQVEVSX01BR0lDICE9IHBBZGFwdGVyLT5tYWdpYykgKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSEREX1NBUF9EQVRBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgIiVzOiBpbnZhbGlkIGFkYXB0ZXIgb3IgYWRhcHRlciBoYXMgaW52YWxpZCBtYWdpYyIsX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgIH0KKworICAgLyogTW9uaXRvciB0cmFmZmljICovCisgICBpZiAoIHBIZGRDdHgtPmNmZ19pbmktPmVuYWJsZVRyYWZmaWNNb25pdG9yICkKKyAgIHsKKyAgICAgIHBIZGRDdHgtPnRyYWZmaWNfbW9uaXRvci5sYXN0RnJhbWVUcyA9IHZvc190aW1lcl9nZXRfc3lzdGVtX3RpbWUoKTsKKyAgICAgIGlmICggIWF0b21pY19yZWFkKCZwSGRkQ3R4LT50cmFmZmljX21vbml0b3IuaXNBY3RpdmVNb2RlKSApCisgICAgICB7CisgICAgICAgICB2b3NfbG9ja19hY3F1aXJlKCZwSGRkQ3R4LT50cmFmZmljX21vbml0b3IudHJhZmZpY0xvY2spOworICAgICAgICAgLyogSXQgd2FzIElETEUgbW9kZSwKKyAgICAgICAgICAqIHRoaXMgaXMgbmV3IHN0YXRlLCB0aGVuIHN3aXRjaCBtb2RlIGZyb20gc3VzcGVuZCB0byByZXN1bWUgKi8KKyAgICAgICAgIGlmICggIWF0b21pY19yZWFkKCZwSGRkQ3R4LT50cmFmZmljX21vbml0b3IuaXNBY3RpdmVNb2RlKSApCisgICAgICAgICB7CisgICAgICAgICAgICBoZGRfc2V0X3dsYW5fc3VzcGVuZF9tb2RlKDApOworICAgICAgICAgICAgdm9zX3RpbWVyX3N0YXJ0KCZwSGRkQ3R4LT50cmFmZmljX21vbml0b3IudHJhZmZpY1RpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPmNmZ19pbmktPnRyYWZmaWNJZGxlVGltZW91dCk7CisgICAgICAgICAgICBhdG9taWNfc2V0KCZwSGRkQ3R4LT50cmFmZmljX21vbml0b3IuaXNBY3RpdmVNb2RlLCAxKTsKKyAgICAgICAgIH0KKyAgICAgICAgIHZvc19sb2NrX3JlbGVhc2UoJnBIZGRDdHgtPnRyYWZm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fQorICAgICAgKytwQWRhcHRlci0+aGRkX3N0YXRzLmhkZFR4UnhTdGF0cy5yeFBhY2tldHM7CisgICAgICArK3BBZGFwdGVyLT5zdGF0cy5yeF9wYWNrZXRzOworICAgICAgcEFkYXB0ZXItPnN0YXRzLnJ4X2J5dGVzICs9IHNrYi0+bGVuOworCisgICAgICBpZiAocEhkZEN0eC0+Y2ZnX2luaS0+Z0VuYWJsZURlYnVnTG9nKQorICAgICAgeworICAgICAgICAgcHJvdG9fdHlwZSA9IHZvc19wa3RfZ2V0X3Byb3RvX3R5cGUoc2tiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+Y2ZnX2luaS0+Z0VuYWJsZURlYnVnTG9nKTsKKyAgICAgICAgIGlmIChWT1NfUEtUX1BST1RPX1RZUEVfRUFQT0wgJiBwcm90b190eXBlKQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAiU0FQIFJYIEVBUE9MIik7CisgICAgICAgICB9CisgICAgICAgICBlbHNlIGlmIChWT1NfUEtUX1BST1RPX1RZUEVfREhDUCAmIHByb3RvX3R5cGUpCisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICJTQVAgUlggREhDUCIpOworICAgICAgICAgfQorICAgICAgICAgZWxzZSBpZiAoVk9TX1BLVF9QUk9UT19UWVBFX0FSUCAmIHByb3RvX3R5cGUpCisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICJTQVAgUlggQVJQIik7CisgICAgICAgICB9CisgICAgICB9CisKKyAgICAgIGlmIChXTEFOX1JYX0JDTUNfU1RBX0lEID09IHBSeE1ldGFJbmZvLT51Y0Rlc1NUQUlkKQorICAgICAgeworICAgICAgICAgLy9NQy9CQyBwYWNrZXRzLiBEdXBsaWNhdGUgYSBjb3B5IG9mIHBhY2tldAorICAgICAgICAgc3RydWN0IHNrX2J1ZmYgKnBTa2JDb3B5OworICAgICAgICAgaGRkX2FwX2N0eF90ICpwSGRkQXBDdHg7CisKKyAgICAgICAgIHBIZGRBcEN0eCA9IFdMQU5fSEREX0dFVF9BUF9DVFhfUFRSKHBBZGFwdGVyKTsKKyAgICAgICAgIGlmICghKHBIZGRBcEN0eC0+YXBEaXNhYmxlSW50cmFCc3NGd2QpKQorICAgICAgICAgeworICAgICAgICAgICAgIHBTa2JDb3B5ID0gc2tiX2NvcHkoc2tiLCBHRlBfQVRPTUlDKTsKKyAgICAgICAgICAgICBpZiAocFNrYkNvcHkpCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgaGRkX3NvZnRhcF9zdGFfMl9zdGFfeG1pdChwU2tiQ29weSwgcFNrYkNvcHktPmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZEFwQ3R4LT51QkNTdGFJZCwgKHBSeE1ldGFJbmZvLT51Y1VQKSk7CisgICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERF9TQVBfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICIlczogc2tiIGFsbG9jYXRpb24gZmFpbHMiLCBfX2Z1bmNfXyk7CisgICAgICAgICB9CisgCisKKyAgICAgIH0gLy8oV0xBTl9SWF9CQ01DX1NUQV9JRCA9PSBzdGFJZCkKKworICAgICAgaWYgKChXTEFOX1JYX0JDTUNfU1RBX0lEID09IHBSeE1ldGFJbmZvLT51Y0R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LT5oZGRfc3RhdHMuaGRkVHhSeFN0YXRzLnJ4RGVsaXZlcmVkOworICAgICAgICAgICAgKytwQWRhcHRlci0+aGRkX3N0YXRzLmhkZFR4UnhTdGF0cy5wa3RfcnhfY291bnQ7CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICArK3BBZGFwdGVyLT5oZGRfc3RhdHMuaGRkVHhSeFN0YXRzLnJ4UmVmdXNlZDsKKyAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIGVsc2UgaWYgKChXTEFOX0hERF9HRVRfQVBfQ1RYX1BUUihwQWRhcHRlcikpLT5hcERpc2FibGVJbnRyYUJzc0Z3ZCkKKyAgICAgIHsKKyAgICAgICAga2ZyZWVfc2tiKHNrYik7ICAgCisgICAgICB9IAorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgLy9sb29wYmFjayB0cmFmZmljCisgICAgICAgIHN0YXR1cyA9IGhkZF9zb2Z0YXBfc3RhXzJfc3RhX3htaXQoc2tiLCBza2ItPmRldiwKKyAgICAgICAgICAgICAgICAgcFJ4TWV0YUluZm8tPnVjRGVzU1RBSWQsIChwUnhNZXRhSW5mby0+dWNVUCkpOworICAgICAgfQorCisgICAgICAvLyBub3cgcHJvY2VzcyB0aGUgbmV4dCBwYWNrZXQgaW4gdGhlIGNoYWluCisgICAgICBwVm9zUGFja2V0ID0gcE5leHRWb3NQYWNrZXQ7CisKKyAgIH0gd2hpbGUgKHBWb3NQYWNrZXQpOworCisgICAvL1JldHVybiB0aGUgZW50aXJlIFZPUyBwYWNrZXQgY2hhaW4gdG8gdGhlIHJlc291cmNlIHBvb2wKKyAgIHN0YXR1cyA9IHZvc19wa3RfcmV0dXJuX3BhY2tldCggcFZvc1BhY2tldENoYWluICk7CisgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSkKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IRERfU0FQX0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ywgdm9zU3RhdHVzICk7CisgICAgICAgIHJldHVybiggdm9zU3RhdHVzICk7CisgICAgfQorICAgIAorICAgIHBIZGRDdHgtPnN0YV90b19hZGFwdGVyW3N0YUlkXSA9IE5VTEw7CisKKyAgICByZXR1cm4oIHZvc1N0YXR1cyApOworfQorCitWT1NfU1RBVFVTIGhkZF9zb2Z0YXBfUmVnaXN0ZXJTVEEoIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9CT09MX3QgZkF1dGhSZXF1aXJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfQk9PTF90IGZQcml2YWN5Qml0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90IHN0YUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90IHVjYXN0U2lnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90IGJjYXN0U2lnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9NQUNBRERSX3QgKnBQZWVyTWFjQWRkcmVzcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfQk9PTF90IGZXbW1FbmFibGVkICkKK3sKKyAgIFZPU19TVEFUVVMgdm9zU3RhdHVzID0gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICBXTEFOX1NUQURlc2NUeXBlIHN0YURlc2MgPSB7MH07ICAgCisgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gcEFkYXB0ZXItPnBIZGRDdHg7CisgICBoZGRfYWRhcHRlcl90ICpwbW9uQWRhcHRlciA9IE5VTEw7CisKKyAgIHZfQ09OVEVYVF90IHBWb3NDb250ZXh0ID0gKCBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPnB2b3NDb250ZXh0OworICAg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xBTlRMX1NUQV9BVVRIRU5USUNBVEVEOworCisgICBzdGFEZXNjLnVjSXNSZXBsYXlDaGVja1ZhbGlkID0gVk9TX0ZBTFNFOworCisgICAvLyBSZWdpc3RlciB0aGUgU3RhdGlvbiB3aXRoIFRMLi4uICAgICAgCisgICB2b3NTdGF0dXMgPSBXTEFOVExfUmVnaXN0ZXJTVEFDbGllbnQoIChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPnB2b3NDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZGRfc29mdGFwX3J4X3BhY2tldF9jYmssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhkZF9zb2Z0YXBfdHhfY29tcGxldGVfY2JrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZGRfc29mdGFwX3R4X2ZldGNoX3BhY2tldF9jYmssICZzdGFEZXNjLCAwICk7CisgICAKKyAgIGlmICggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyggdm9zU3RhdHVzICkgKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERF9TQVBfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiU09GVEFQIFdMQU5UTF9SZWdpc3RlclNUQUNsaWVudCgpIGZhaWxlZCB0byByZWdpc3Rlci4gIFN0YXR1cz0gJWQgWzB4JTA4WF0iLAorICAgICAgICAgICAgICAgICB2b3NTdGF0dXMsIHZvc1N0YXR1cyApOworICAgICAgcmV0dXJuIHZvc1N0YXR1czsgICAgICAKKyAgIH0KKworICAgLy9UaW1lciB2YWx1ZSBzaG91bGQgYmUgaW4gbWlsbGlzZWNvbmRzCisgICBpZiAoIHBIZGRDdHgtPmNmZ19pbmktPmR5blNwbGl0c2NhbiAmJgorICAgICAgKCBWT1NfVElNRVJfU1RBVEVfUlVOTklORyAhPQorICAgICAg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ERBTUFHRVMgT1IgQU5ZIERBTUFHRVMgV0hBVFNPRVZFUiBSRVNVTFRJTkcgRlJPTSBMT1NTIE9GIFVTRSwgREFUQSBPUgorICogUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1IgT1RIRVIKKyAqIFRPUlRJT1VTIEFDVElPTiwgQVJJU0lORyBPVVQgT0YgT1IgSU4gQ09OTkVDVElPTiBXSVRIIFRIRSBVU0UgT1IKKyAqIFBFUkZPUk1BTkNFIE9GIFRISVMgU09GVFdBUkUuCisgKi8KKworLyoKKyAqIFRoaXMgZmlsZSB3YXMgb3JpZ2luYWxseSBkaXN0cmlidXRlZCBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIFxmaWxlICB3bGFuX2hkZF90ZGxzLmMKKworICBcYnJpZWYgV0xBTiBIb3N0IERldmljZSBEcml2ZXIgaW1wbGVtZW50YXRpb24gZm9yIFRETFMKKworICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisjaW5jbHVkZSA8d2xhbl9oZGRfaW5jbHVkZXMuaD4KKyNpbmNsdWRlIDx3bGFuX2hkZF9ob3N0YXBkLmg+CisjaW5jbHVkZSA8bmV0L2NmZzgwMjExLmg+CisjaW5jbHVkZSA8bGludXgvbmV0ZGV2aWNlLmg+CisjaW5jbHVkZSA8bGludXgvc2tidWZmLmg+CisjaW5jbHVkZSA8bGludXgvbGlzdC5oPgorI2luY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gICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICptYWMKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggKm1hYworI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApCit7CisgICAgaW50IGk7CisgICAgdTgga2V5ID0gMDsKKworICAgIGZvciAoaSA9IDA7IGkgPCA2OyBpKyspCisgICAgICAga2V5IF49IG1hY1tpXTsKKworICAgIHJldHVybiBrZXk7Cit9CisKKy8qKgorICogd2xhbl9oZGRfdGRsc19kaXNhYmxlX29mZmNoYW5fYW5kX3RlYXJkb3duX2xpbmtzIC0gRGlzYWJsZSBvZmZjaGFubmVsCisgKiBhbmQgdGVhcmRvd24gVERMUyBsaW5rcworICogQGhkZEN0eCA6IHBvaW50ZXIgdG8gaGRkIGNvbnRleHQKKyAqCisgKiBSZXR1cm46IE5vbmUKKyAqLwordm9pZCB3bGFuX2hkZF90ZGxzX2Rpc2FibGVfb2ZmY2hhbl9hbmRfdGVhcmRvd25fbGlua3MoaGRkX2NvbnRleHRfdCAqaGRkY3R4KQoreworICAgIHUxNiBjb25uZWN0ZWRfdGRsc19wZWVycyA9IDA7CisgICAgdTggc3RhSWR4OworICAgIGhkZFRkbHNQZWVyX3QgKmN1cnJfcGVlciA9IE5VTEw7CisgICAgaGRkX2FkYXB0ZXJfdCAqYWRhcHRlciA9IE5VTEw7CisgICAgYm9vbCB0ZGxzX3VubG9jayA9IEZBTFNFOworCisgICAgaWYgKGVURExTX1NVUFBPUlRfTk9UX0VOQUJMRUQgPT0gaGRkY3R4LT50ZGxzX21vZGUpIHsKKyAgICAgICAgaGRkTG9nKExPRzEsIEZMKCJURExTIG1vZGUgaXMgZGlzYWJsZWQgT1Igbm90IGVuYWJsZWQgaW4gRlciKSk7CisgICAgICAgIHJldHVybiA7CisgICAgfQorCisgICAgYWRhcHRlciA9IGhkZF9nZXRfYWRhcHRlcihoZGRjdHgsIFdMQU5fSEREX0lORlJBX1NUQVRJT04pOworCisgICAgaWYgKGFkYXB0ZXIgPT0gTlVMTCkgeworICAgICAgICBoZGRMb2coTE9HRSwgRkwoIlN0YXRpb24gQWRhcHRlciBOb3QgRm91bmQiKSk7CisgICAgICAgIGdvdG8gZG9uZTsKKyAgICB9CisKKyAgICBjb25uZWN0ZWRfdGRsc19wZWVycyA9IHdsYW5faGRkX3RkbHNDb25uZWN0ZWRQZWVycyhhZGFwdGVyKTsKKyAgICBpZiAoIWNvbm5lY3RlZF90ZGxzX3BlZXJzKSB7CisgICAgICAgIGhkZExvZyhMT0cxLCBGTCgiTm8gVERMUyBjb25uZWN0ZWQgcGVlcnMgdG8gZGVsZXRlIFRETFMgcGVlcnMiKSk7CisgICAgICAgIGdvdG8gZG9uZTsKKyAgICB9CisKKyAgICAvKiBURExTIGlzIG5vdCBzdXBwb3J0ZWQgaW4gY2FzZSBvZiBjb25jdXJyZW5jeQorICAgICAqIERpc2FibGUgVERMUyBPZmZjaGFubmVsIHRvIGF2b2lkIG1vcmUgdGhhbiB0d28gY29uY3VycmVudCBjaGFubmVscy4KKyAgICAgKi8KKyAgICBpZiAoY29ubmVjdGVkX3RkbHNfcGVlcnMgPT0gMSkgeworICAgICAgICB0U2lyTWFjQWRkciBwZWVyX21hYzsKKyAgICAgICAgaW50MzJfdCBjaGFubmVsOworCisgICAgICAgIG11dGV4X2xvY2soJmhkZGN0eC0+dGRsc19sb2NrKTsKKyAgICAgICAgY3Vycl9wZWVyID0gd2xhbl9oZGRfdGRsc19nZXRfY29ubmVjdGVkX3BlZXIoYWRhcHRlcik7CisgICAgICAgIGlmIChjdXJyX3BlZXIgJiYgKGN1cnJfcGVlci0+aXNPZmZDaGFubmVsQ29uZmlndXJlZCA9PSBUUlVFKSkgeworICAgICAgICAgICAgaGRkTG9nKExPRzEsIEZMKCIlczogQ29uY3VycmVuY3kgZGV0ZWN0ZWQsIERpc2FibGUgIgorICAgICAgICAgICAgICAgICAgICAgICAgIlRETFMgY2hhbm5lbCBzd2l0Y2giKSwgX19mdW5jX18pOworICAgICAgICAgICAgY3Vycl9wZWVyLT5pc09mZkNoYW5uZWxFc3RhYmxpc2hlZCA9IEZBTFNFOworICAgICAgICAgICAgY2hhbm5lbCA9IGN1cnJfcGVlci0+cGVlclBhcmFtcy5jaGFubmVsOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBlZXJfbWFjLCBjdXJyX3BlZXItPnBlZXJNYWMsIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICAgICAgbXV0ZXhfdW5sb2NrKCZoZGRjdHgtPnRkbHNfbG9jayk7CisKKyAgICAgICAgICAgIHNtZV9TZW5kVGRsc0NoYW5Td2l0Y2hSZXEoV0xBTl9IRERfR0VUX0hBTF9DVFgoYWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgIGFkYXB0ZXItPnNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgcGVlcl9tYWMsCisgICAgICAgICAgICAgICAgICAgIGNoYW5uZWwsCisgICAgICAgICAgICAgICAgICAgIFRETFNfT0ZGX0NIQU5ORUxfQldfT0ZGU0VULAorICAgICAgICAgICAgICAgICAgICBURExTX0NIQU5ORUxfU1dJVENIX0RJU0FCTEUpOworICAgICAgICAgICAgdGRsc191bmxvY2sgPSBUUlVFOworICAgICAgICB9CisgICAgICAgIGlmICh0ZGxzX3VubG9jayA9PSBGQUxTRSkKKyAgICAgICAgICAgIG11dGV4X3VubG9jaygmaGRkY3R4LT50ZGxzX2xvY2spOworICAgIH0KKworICAgIC8qIFNlbmQgTXNnIHRvIFBFIGZvciBzZW5kaW5nIGRlYXV0aCBhbmQgZGVsZXRpbmcgYWxsIHRoZSBURExTIHBlZXJzICovCisgICAgc21lX0RlbGV0ZUFsbFRETFNQZWVycyhoZGRjdHgtPmhIYWwsIGFkYXB0ZXItPnNlc3Npb25JZCk7CisKKyAgICAvKiBBcyBtZW50aW9uZWQgYWJvdmUgVERMUyBpcyBub3Qgc3VwcG9ydGVkIGluIGNhc2Ug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AgOworICAgICAgICBoZGRjdHgtPnRkbHNDb25uSW5mb1tzdGFJZHhdLnNlc3Npb25JZCA9IDI1NTsKKyAgICAgICAgdm9zX21lbV96ZXJvKCZoZGRjdHgtPnRkbHNDb25uSW5mb1tzdGFJZHhdLnBlZXJNYWMsCisgICAgICAgICAgICAgICAgIHNpemVvZih2X01BQ0FERFJfdCkpIDsKKyAgICAgICAgd2xhbl9oZGRfdGRsc19jaGVja19ibXBzKGFkYXB0ZXIpOworCisgICAgICAgIGhkZExvZyhMT0cxLCBGTCgiaW5kaWNhdGUgVERMUyB0ZWFyZG93biAoc3RhSWQgJWQpIiksCisgICAgICAgICAgICAgICAgY3Vycl9wZWVyLT5zdGFJZCk7CisKKyAgICAgICAgLyogSW5kaWNhdGUgdGVhcmRvd24gdG8gc3VwcGxpY2FudCAqLworICAgICAgICB3bGFuX2hkZF90ZGxzX2luZGljYXRlX3RlYXJkb3duKAorICAgICAgICAgICAgICAgIGN1cnJfcGVlci0+cEhkZFRkbHNDdHgtPnBBZGFwdGVyLAorICAgICAgICAgICAgICAgIGN1cnJfcGVlciwKKyAgICAgICAgICAgICAgICBlU0lSX01BQ19URExTX1RFQVJET1dOX1VOU1BFQ19SRUFTT04pOworICAgIH0KKworZG9uZToKKyAgICB3bGFuX2hkZF90ZGxzX3NldF9tb2RlKGhkZGN0eCwgZVRETFNfU1VQUE9SVF9ESVNBQkxFRCwgRkFMU0UpOworICAgIGhkZExvZyhMT0cxLCBGTCgiVERMUyBTdXBwb3J0IERpc2FibGVkIikpOworfQorCisvKioKKyAqIGhkZF90ZGxzX25vdGlmeV9tb2RlX2NoYW5nZSAtIE5vdGlmeSBtb2RlIGNoYW5nZQorICogQGFkYXB0ZXI6IHBvaW50ZXIgdG8gaGRkIGFkYXB0ZXIKKyAqIEBoZGRDdHggOiBwb2ludGVyIHRvIGhkZCBjb250ZXh0CisgKgorICogUmV0dXJuOiBOb25lCisgKi8KK3ZvaWQgaGRkX3RkbHNfbm90aWZ5X21vZGVfY2hhbmdlKGhkZF9hZGFwdGVyX3QgKmFkYXB0ZXIsIGhkZF9jb250ZXh0X3QgKmhkZGN0eCkKK3sKKyAgICAgICAgd2xhbl9oZGRfdGRsc19kaXNhYmxlX29mZmNoYW5fYW5kX3RlYXJkb3duX2xpbmtzKGhkZGN0eCk7Cit9CisKK3N0YXRpYyB2X1ZPSURfdCB3bGFuX2hkZF90ZGxzX3N0YXJ0X3BlZXJfZGlzY292ZXJfdGltZXIodGRsc0N0eF90ICpwSGRkVGRsc0N0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9CT09MRUFOIG11dGV4TG9jaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBkaXNjb3ZlcnlFeHBpcnkpCit7CisgICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHg7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKworICAgIEVOVEVSKCk7CisKKyAgICBpZiAoKE5VTEwgPT0gcEhkZFRkbHNDdHgpIHx8IChOVUxMID09IHBIZGRUZGxzQ3R4LT5wQWRhcHRlcikgKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICBGTCgiIHBIZGRUZGxzQ3R4IG9yIHBBZGFwdGVyIHBvaW50cyB0byBOVUxMIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgoIHBIZGRUZGxzQ3R4LT5wQWRhcHRlciApOworCisgICAgaWYoMCAhPSAod2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KSkpCisgICAgeworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaWYgKCBtdXRleExvY2sgKQor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BwSGRkVGRsc0N0eC0+ZGlzY292ZXJ5X3BlZXJfY250ID0gd2xhbl9oZGRfZ2V0X3RkbHNfZGlzY292ZXJ5X3BlZXJfY250KHBIZGRUZGxzQ3R4KTsKKworICAgIGZvciAoaSA9IDA7IGkgPCAyNTY7IGkrKykgeworICAgICAgICBoZWFkID0gJnBIZGRUZGxzQ3R4LT5wZWVyX2xpc3RbaV07CisKKyAgICAgICAgbGlzdF9mb3JfZWFjaCAocG9zLCBoZWFkKSB7CisgICAgICAgICAgICBjdXJyX3BlZXIgPSBsaXN0X2VudHJ5IChwb3MsIGhkZFRkbHNQZWVyX3QsIG5vZGUpOworCisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgIiVkICIgTUFDX0FERFJFU1NfU1RSICIgJWQgJWQsICVkICVkICVkICVkIiwgaSwKKyAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkoY3Vycl9wZWVyLT5wZWVyTWFjKSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vycl9wZWVyLT5kaXNjb3ZlcnlfcHJvY2Vzc2VkLAorICAgICAgICAgICAgICAgICAgICAgICBkaXNjb3Zlcl9yZXFfc2VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vycl9wZWVyLT50ZGxzX3N1cHBvcnQsCisgICAgICAgICAgICAgICAgICAgICAgIGN1cnJfcGVlci0+bGlua19zdGF0dXMsCisgICAgICAgICAgICAgICAgICAgICAgIGN1cnJfcGVlci0+ZGlzY292ZXJ5X2F0dGVtcHQsCisgICAgICAgICAgICAgICAgICAgICAgIHBIZGRUZGxzQ3R4LT50aHJlc2hvbGRfY29uZmlnLmRpc2NvdmVyeV90cmllc19uKTsKKworICAgICAgICAgICAgaWYgKGRpc2NvdmVyX3JlcV9zZW50IDwgVERMU19NQVhfRElTQ09WRVJfUkVRU19QRVJfVElNRVIpIHsKKyAgICAgICAgICAgICAgICBpZiAoIWN1cnJfcGVlci0+ZGlzY292ZXJ5X3Byb2Nlc3NlZCkgeworCisgICAgICAgICAgICAgICAgICAgIGN1cnJfcGVlci0+ZGlzY292ZXJ5X3Byb2Nlc3NlZCA9IDE7CisgICAgICAgICAgICAgICAgICAgIGRpc2NvdmVyX3JlcV9zZW50Kys7CisgICAgICAgICAgICAgICAgICAgIHBIZGRUZGxzQ3R4LT5kaXNjb3ZlcnlfcGVlcl9jbnQtLTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoKGVURExTX0NBUF9VTktOT1dOID09IGN1cnJfcGVlci0+dGRsc19zdXBwb3J0KSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgKGVURExTX0xJTktfSURMRSA9PSBjdXJyX3BlZXItPmxpbmtfc3RhdHVzKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgIChjdXJyX3BlZXItPnR4X3BrdCA+PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkVGRsc0N0eC0+dGhyZXNob2xkX2NvbmZpZy50eF9wYWNrZXRfbikpIHsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJfcGVlci0+ZGlzY292ZXJ5X2F0dGVtcHQgPAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRUZGxzQ3R4LT50aHJlc2hvbGRfY29uZmlnLmRpc2NvdmVyeV90cmllc19uKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2ZnODAyMTFfdGRsc19vcGVyX3JlcXVlc3QoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRUZGxzQ3R4LT5wQWRhcHRlci0+ZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyX3BlZXItPnBlZXJNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5MODAyMTFfVERMU19ESVNDT1ZFUllfUkVRLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGQUxTRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR0ZQX0tFUk5FTCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vycl9wZWVyLT5kaXNjb3ZlcnlfYXR0ZW1wdCsrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IE1heGltdW0gRGlzY292ZXJ5IHJldHJpZXMgcmVhY2hlZCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJfcGVlci0+dGRsc19zdXBwb3J0ID0gZVRETFNfQ0FQX05PVF9TVVBQT1JURUQ7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGdvdG8gZXhpdF9sb29wOworICAgICAgICB9CisgICAgfQorZXhpdF9sb29wOgorCisgICAgaWYgKDAgIT0gcEhkZFRkbHNDdHgtPmRpc2NvdmVyeV9wZWVyX2NudCkgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICJkaXNjb3ZlcnlfcGVlcl9jbnQgaXMgJWQgLCBTdGFydGluZyBTVUJfRElTQ09WRVJZX1RJTUVSIiwKKyAgICAgICAgICAgICAgICAg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AgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgIEVYSVQoKTsKKyAgICByZXR1cm47Cit9CisjZW5kaWYKKworc3RhdGljIHZfVk9JRF90IHdsYW5faGRkX3RkbHNfdXBkYXRlX3BlZXJfY2IoIHZfUFZPSURfdCB1c2VyRGF0YSApCit7CisgICAgaW50IGk7CisgICAgc3RydWN0IGxpc3RfaGVhZCAqaGVhZDsKKyAgICBzdHJ1Y3QgbGlzdF9oZWFkICpwb3M7CisgICAgaGRkVGRsc1BlZXJfdCAqY3Vycl9wZWVyOworICAgIHRkbHNDdHhfdCAqcEhkZFRkbHNDdHg7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgICB2X0NPTlRFWFRfdCBwVm9zQ29udGV4dDsKKworICAgIEVOVEVSKCk7CisgICAgcFZvc0NvbnRleHQgPSB2b3NfZ2V0X2dsb2JhbF9jb250ZXh0KFZPU19NT0RVTEVfSURfSERELCBOVUxMKTsKKyAgICBpZiAoTlVMTCA9PSBwVm9zQ29udGV4dCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgRkwoInBWb3NDb250ZXh0IHBvaW50cyB0byBOVUxMIikpOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIHBIZGRDdHggPSB2b3NfZ2V0X2NvbnRleHQoVk9TX01PRFVMRV9JRF9IREQsIHBWb3NDb250ZXh0KTsKKyAgICBpZiAoMCAhPSAod2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KSkpCisgICAgeworICAgICAgICByZXR1cm47CisgICAgfQorICAgIG11dGV4X2xvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgcEhkZFRkbHNDdHggPSAodGRsc0N0eF90ICopdXNlckRhdGE7CisgICAgaWYgKDAgIT0gKHdsYW5faGRkX3ZhbGlkYXRlX3RkbHNfY29udGV4dChwSGRkQ3R4LCBwSGRkVGRsc0N0eCkpKQorICAgIHsKKyAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgRkwoIkludmFsaWQgcEhkZFRkbHNDdHggY29udGV4dCIpKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBmb3IgKGkgPSAwOyBpIDwgMjU2OyBpKyspIHsKKyAgICAgICAgaGVhZCA9ICZwSGRkVGRsc0N0eC0+cGVlcl9saXN0W2ldOworCisgICAgICAgIGxpc3RfZm9yX2VhY2ggKHBvcywgaGVhZCkgeworICAgICAgICAgICAgY3Vycl9wZWVyID0gbGlzdF9lbnRyeSAocG9zLCBoZGRUZGxzUGVlcl90LCBub2RlKTsKKworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICIlczogIiBNQUNfQUREUkVTU19TVFIgIiBsaW5rX3N0YXR1cyAlZCIKKyAgICAgICAgICAgICAgICAgICAgICAgIiB0ZGxzX3N1cHBvcnQgJWQiLCBfX2Z1bmNfXywgTUFDX0FERFJfQVJSQVkoY3Vycl9wZWVyLT5wZWVyTWFjKSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vycl9wZWVyLT5saW5rX3N0YXR1cywgY3Vycl9wZWVyLT50ZGxzX3N1cHBvcnQpOworCisgICAgICAgICAgICBpZiAoZVRETFNfQ0FQX1NVUFBPUlRFRCA9PSBjdXJyX3BlZXItPnRkbHNfc3VwcG9ydCkgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAidHggJWQsIHJ4ICVkICh0aHIucGt0ICVkL2lkbGUgJWQpLCByc3NpICVkICh0aHIudHJpZyAlZC9oeXMgJWQvdGVhciAlZCkiLAorICAgICAgICAgICAgICAgICAgICAgICBjdXJyX3BlZXItPnR4X3BrdCwgY3Vycl9wZWVyLT5yeF9wa3QsCisgICAgICAgICAgICAgICAgICAgICAgICBwSGRkVGRsc0N0eC0+dGhyZXNob2xkX2NvbmZpZy50eF9wYWNrZXRfbiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRUZGxzQ3R4LT50aHJlc2hvbGRfY29uZmlnLmlkbGVfcGFja2V0X24sCisgICAgICAgICAgICAgICAgICAgICAgICBjdXJyX3BlZXItPnJzc2ksCisgICAgICAgICAgICAgICAgICAgICAgICBwSGRkVGRsc0N0eC0+dGhyZXNob2xkX2NvbmZpZy5yc3NpX3RyaWdnZXJfdGhyZXNob2xkLAorICAgICAgICAgICAgICAgICAgICAgICAgcEhkZFRkbHNDdHgtPnRocmVzaG9sZF9jb25maWcucnNzaV9oeXN0ZXJlc2lzLAorICAgICAgICAgICAgICAgICAgICAgICAgcEhkZFRkbHNDdHgtPnRocmVzaG9sZF9jb25maWcucnNzaV90ZWFyZG93bl90aHJlc2hvbGQpOworCisgICAgICAgICAgICAgICAgaWYgKChlVERMU19MSU5LX0lETEUgPT0gY3Vycl9wZWVyLT5saW5rX3N0YXR1cykgfHwKKyAgICAgICAgICAgICAgICAgICAgKGVURExTX0xJTktfRElTQ09WRVJJTkcgPT0gY3Vycl9wZWVyLT5saW5rX3N0YXR1cykpeworCisgICAgICAgICAgICAgICAgICAgIGlmIChwSGRkQ3R4LT5jZmdfaW5pLT5mVERMU0V4dGVybmFsQ29udHJvbCAmJgorICAgICAgICAgICAgICAgICAgICAgICAgKEZBTFNFID09IGN1cnJfcGVlci0+aXNGb3JjZWRQZWVyKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZ290byBuZXh0X3BlZXI7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoY3Vycl9wZWVyLT50eF9wa3QgPj0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkVGRsc0N0eC0+dGhyZXNob2xkX2NvbmZpZy50eF9wYWNrZXRfbikgeworCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoSEREX01BWF9OVU1fVERMU19TVEEgPiB3bGFuX2hkZF90ZGxzQ29ubmVjdGVkUGVlcnMocEhkZFRkbHNDdHgtPnBBZGFwdGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlRwdXQgdHJpZ2dlciBURExTIHByZS1zZXR1cCIpOworI2lmZGVmIENPTkZJR19URExTX0lNUExJQ0lUCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZFRkbHNDdHgtPmN1cnJfY2FuZGlkYXRlID0gY3Vycl9wZWVyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdsYW5faGRkX3RkbHNfaW1wbGljaXRfc2VuZF9kaXNjb3ZlcnlfcmVxdWVzdChwSGRkVGRsc0N0eCk7CisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBNYXhpbXVtIHBlZXIgY29ubmVjdGVkIGFscmVhZHkhICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHdsYW5faGRkX3RkbHNDb25uZWN0ZWRQZWVycyhwSGRkVGRsc0N0eC0+cEFkYXB0ZXIpICk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIG5leHRfcGVlcjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlICBpZiAoZVRETFNfTElOS19DT05ORUNURUQgPT0gY3Vycl9wZWVyLT5saW5rX3N0YXR1cykgeworICAgICAgICAgICAgICAgICAgICBpZiAoKHRBTklfUzMyKWN1cnJfcGVlci0+cnNzaSA8CisgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9TMzIpcEhkZFRkbHNDdHgtPnRocmVzaG9sZF9jb25maWcucnNzaV90ZWFyZG93bl90aHJlc2hvbGQpIHsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJUZWFyIGRvd24gLSBsb3cgUlNTSTogIiBNQUNfQUREUkVTU19TVFIgIiEiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKGN1cnJfcGVlci0+cGVlck1hYykpOworI2lmZGVmIENPTkZJR19URExTX0lNUExJQ0lUCisgICAgICAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF90ZGxzX2luZGljYXRlX3RlYXJkb3duKHBIZGRUZGxzQ3R4LT5wQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vycl9wZWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX01BQ19URExTX1RFQVJET1dOX1VOU1BFQ19SRUFTT04pOworI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIG5leHRfcGVlcjsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIC8qIE9ubHkgdGVhcmRvd24gYmFzZWQgb24gbm9uIHplcm8gaWRsZSBwYWNrZXQgdGhyZXNob2xkLCB0byBhZGRyZXNzIGEgdXNlCisgICAgICAgICAgICAgICAgICAgICAqIGNhc2Ugd2hlcmUgdGhpcyB0aHJlc2hvbGQgZG9lcyBub3QgZ2V0IGNvbnNpZGVyIGZvciBURUFSIERPV04uCisgICAgICAgICAgICAgICAgICAgICAqLworCisgICAgICAgICAgICAgICAgICAgIGlmICgoIDAgIT0gcEhkZFRkbHNDdHgtPnRocmVzaG9sZF9jb25maWcuaWRsZV9wYWNrZXRfbiApICYmCisgICAgICAgICAgICAgICAgICAgICAgICAoKGN1cnJfcGVlci0+dHhfcGt0IDwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkVGRsc0N0eC0+dGhyZXNob2xkX2NvbmZpZy5pZGxlX3BhY2tldF9uKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgKGN1cnJfcGVlci0+cnhfcGt0IDwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkVGRsc0N0eC0+dGhyZXNob2xkX2NvbmZpZy5pZGxlX3BhY2tldF9uKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChWT1NfVElNRVJfU1RBVEVfUlVOTklORyAhPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfdGltZXJfZ2V0Q3VycmVudFN0YXRlKCZjdXJyX3BlZXItPnBlZXJJZGxlVGltZXIpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJUeC9SeCBJZGxlIHRpbWVyIHN0YXJ0OiAiIE1BQ19BRERSRVNTX1NUUiAiISIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShjdXJyX3BlZXItPnBlZXJNYWMpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF90ZGxzX3RpbWVyX3Jlc3RhcnQocEhkZFRkbHNDdHgtPnBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmY3Vycl9wZWVyLT5wZWVySWRsZVRpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkVGRsc0N0eC0+dGhyZXNob2xkX2NvbmZpZy5pZGxlX3RpbWVvdXRfdCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoVk9TX1RJTUVSX1NUQVRFX1JVTk5JTkcgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX3RpbWVyX2dldEN1cnJlbnRTdGF0ZSgmY3Vycl9wZWVyLT5wZWVySWRsZVRpbWVyKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVHgvUnggSWRsZSB0aW1lciBzdG9wOiAiIE1BQ19BRERSRVNTX1NUUiAiISIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShjdXJyX3BlZXItPnBlZXJNYWMpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfdGltZXJfc3RvcCggJmN1cnJfcGVlci0+cGVlcklkbGVUaW1lcik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworLy8gICAgICAgICAgICAgICAgICAgIGlmIChjdXJyX3BlZXItPnJzc2kgPAorLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBIZGRUZGxzQ3R4LT50aHJlc2hvbGRfY29uZmlnLnJzc2lfaHlzdGVyZXNpcyArCisvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZFRkbHNDdHgtPmFwX3Jzc2kpKSB7CisvLworLy8jaWZkZWYgQ09ORklHX1RETFNfSU1QTElDSVQKKy8vICAgICAgICAgICAgICAgICAgICAgICAgY2ZnODAyMTFfdGRsc19vcGVyX3JlcXVlc3QocEhkZFRkbHNDdHgtPmRldiwKKy8vICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vycl9wZWVyLT5wZWVyTWFjLAorLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOTDgwMjExX1RETFNfVEVBUkRPV04sIEZBTFNFLAorLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHRlBfS0VSTkVMKTsKKy8vI2VuZGlmCisvLyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSBpZiAoZVRETFNfQ0FQX1VOS05PV04gPT0gY3Vycl9wZWVyLT50ZGxzX3N1cHBvcnQpIHsKKworICAgICAgICAgICAgICAgIGlmIChwSGRkQ3R4LT5jZmdfaW5pLT5mVERMU0V4dGVybmFsQ29udHJvbCAmJgorICAgICAgICAgICAgICAgICAgICAoRkFMU0UgPT0gY3Vycl9wZWVyLT5pc0ZvcmNlZFBlZXIpKSB7CisgICAgICAgICAgICAgICAgICAgIGdvdG8gbmV4dF9wZWVyOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIVRETFNfSVNfQ09OTkVDVEVEKGN1cnJfcGVlcikpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJfcGVlci0+dHhfcGt0ID49CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZFRkbHNDdHgtPnRocmVzaG9sZF9jb25maWcudHhfcGFja2V0X24pIHsKKworICAgICAgICAgICAgICAgICAgICAgICAgLyogSWdub3JlIGRpc2NvdmVyeSBhdHRlbXB0IGlmIEV4dGVybmFsIENvbnRyb2wgaXMgZW5hYmxlZCwgdGhhdAorICAgICAgICAgICAgICAgICAgICAgICAgICogaXMsIHBlZXIgaXMgZm9yY2VkLiBJbiB0aGF0IGNhc2UsIGNvbnRpbnVlIGRpc2NvdmVyeSBhdHRlbXB0CisgICAgICAgICAgICAgICAgICAgICAgICAgKiByZWdhcmRsZXNzIGF0dGVtcHQgY291bnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJfcGVlci0+aXNGb3JjZWRQZWVyIHx8IGN1cnJfcGVlci0+ZGlzY292ZXJ5X2F0dGVtcHQrKyA8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkVGRsc0N0eC0+dGhyZXNob2xkX2NvbmZpZy5kaXNjb3ZlcnlfdHJpZXNfbikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlRETFMgVU5LTk9XTiBkaXNjb3ZlciAiKTsKKyNpZmRlZiBDT05GSUdfVERMU19JTVBMSUNJVAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRUZGxzQ3R4LT5jdXJyX2NhbmRpZGF0ZSA9IGN1cnJfcGVlcjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF90ZGxzX2ltcGxpY2l0X3NlbmRfZGlzY292ZXJ5X3JlcXVlc3QocEhkZFRkbHNDdHgpOworI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vycl9wZWVyLT50ZGxzX3N1cHBvcnQgPSBlVERMU19DQVBfTk9UX1NVUFBPUlRFRDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF90ZGxzX3NldF9wZWVyX2xpbmtfc3RhdHVzKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJfcGVlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlVERMU19MSU5LX0lETEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVRETFNfTElOS19OT1RfU1VQUE9SVEVEKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCituZXh0X3BlZXI6CisgICAgICAgICAgICBjdXJyX3BlZXItPnR4X3BrdCA9IDA7CisgICAgICAgICAgICBjdXJyX3BlZXItPnJ4X3BrdCA9IDA7CisgICAgICAgIH0KKyAgICB9CisKKyAgICB3bGFuX2hkZF90ZGxzX3RpbWVyX3Jlc3RhcnQocEhkZFRkbHNDdHgtPnBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEhkZFRkbHNDdHgtPnBlZXJVcGRhdGVUaW1lciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZFRkbHNDdHgtPnRocmVzaG9sZF9jb25maWcudHhfcGVyaW9kX3QpOworICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICBFWElUKCk7Cit9CisKK3N0YXRpYyB2X1ZPSURfdCB3bGFuX2hkZF90ZGxzX2lkbGVfY2IoIHZfUFZPSURfdCB1c2VyRGF0YSApCit7CisjaWZkZWYgQ09ORklHX1RETFNfSU1QTElDSVQKKyAgICBoZGRUZGxzUGVlcl90ICpjdXJyX3BlZXI7CisgICAgdGRsc0N0eF90ICpwSGRkVGRsc0N0eDsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgIHZfQ09OVEVYVF90IHBWb3NDb250ZXh0OworCisgICAgRU5URVIoKTsKKworICAgIHBWb3NDb250ZXh0ID0gdm9zX2dldF9nbG9iYWxfY29udGV4dChWT1NfTU9EVUxFX0lEX0hERCwgTlVMTCk7CisgICAgaWYgKE5VTEwgPT0gcFZvc0NvbnRleHQpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIEZMKCJwVm9zQ29udGV4dCBwb2ludHMgdG8gTlVMTCIpKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBwSGRkQ3R4ID0gdm9zX2dldF9jb250ZXh0KFZPU19NT0RVTEVfSURfSERELCBwVm9zQ29udGV4dCk7CisgICAgaWYgKDAgIT0gKHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCkpKQorICAgIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIG11dGV4X2xvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisKKyAgICBjdXJyX3BlZXIgPSAoaGRkVGRsc1BlZXJfdCAqKXVzZXJEYXRhOworICAgIGlmIChOVUxMID09IGN1cnJfcGVlcikKKyAgICB7CisgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgRkwoIkludmFsaWQgdGRscyBpZGxlIHRpbWVyIGV4cGlyZWQiKSk7CisgICAgICByZXR1cm47CisgICAgfQorCisgICAgcEhkZFRkbHNDdHggPSBjdXJyX3BlZXItPnBIZGRUZGxzQ3R4OworICAgIGlmICgwICE9ICh3bGFuX2hkZF92YWxpZGF0ZV90ZGxzX2NvbnRleHQocEhkZEN0eCwgcEhkZFRkbHNDdHgpKSkKKyAgICB7CisgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICBGTCgiSW52YWxpZCBwSGRkVGRsc0N0eCBjb250ZXh0IikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgIiVzOiBUeC9SeCBJZGxlICIgTUFDX0FERFJFU1NfU1RSICIgdHhfcGt0OiAlZCwgcnhfcGt0OiAlZCwgaWRsZV9wYWNrZXRfbjogJWQiLAorICAgICAgICAgICAgICBfX2Z1bmNfXywgTUFDX0FERFJfQVJSQVkoY3Vycl9wZWVyLT5wZWVyTWFjKSwKKyAgICAgICAgICAgICAgY3Vycl9wZWVyLT50eF9wa3QsCisgICAgICAgICAgICAgIGN1cnJfcGVlci0+cnhfcGt0LAorICAgICAgICAgICAgICBjdXJyX3BlZXItPnBIZGRUZGxzQ3R4LT50aHJlc2hvbGRfY29uZmlnLmlkbGVfcGFja2V0X24pOworCisgICAgLyogQ2hlY2sgdHgv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ICAgICAgd2xhbl9oZGRfdGRsc19pbmRpY2F0ZV90ZWFyZG93bihjdXJyX3BlZXItPnBIZGRUZGxzQ3R4LT5wQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vycl9wZWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX01BQ19URExTX1RFQVJET1dOX1VOU1BFQ19SRUFTT04pOworICAgIH0KKyAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgRVhJVCgpOworI2VuZGlmCit9CisKK3N0YXRpYyB2X1ZPSURfdCB3bGFuX2hkZF90ZGxzX2Rpc2NvdmVyeV90aW1lb3V0X3BlZXJfY2Iodl9QVk9JRF90IHVzZXJEYXRhKQoreworICAgIGludCBpOworICAgIHN0cnVjdCBsaXN0X2hlYWQgKmhlYWQ7CisgICAgaGRkVGRsc1BlZXJfdCAqdG1wOworICAgIHN0cnVjdCBsaXN0X2hlYWQgKnBvcywgKnE7CisgICAgdGRsc0N0eF90ICpwSGRkVGRsc0N0eDsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgIHZfQ09OVEVYVF90IHBWb3NDb250ZXh0OworCisgICAgRU5URVIoKTsKKyAgICBwVm9zQ29udGV4dCA9IHZvc19nZXRfZ2xvYmFsX2NvbnRleHQoVk9TX01PRFVMRV9JRF9IREQsIE5VTEwpOworICAgIGlmIChOVUxMID09IHBWb3NDb250ZXh0KQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICBGTCgicFZvc0NvbnRleHQgcG9pbnRzIHRvIE5VTEwiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBwSGRkQ3R4ID0gdm9zX2dldF9jb250ZXh0KFZPU19NT0RVTEVfSURfSERELCBwVm9zQ29udGV4dCk7CisgICAgaWYgKDAgIT0gKHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCkpKQorICAgIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIG11dGV4X2xvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisKKyAgICBwSGRkVGRsc0N0eCA9ICh0ZGxzQ3R4X3QgKil1c2VyRGF0YTsKKyAgICBpZiAoMCAhPSAod2xhbl9oZGRfdmFsaWRhdGVfdGRsc19jb250ZXh0KHBIZGRDdHgsIHBIZGRUZGxzQ3R4KSkpCisgICAgeworICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgRkwoIkludmFsaWQgcEhkZFRkbHNDdHggY29udGV4dCIpKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGZvciAoaSA9IDA7IGkgPCAyNTY7IGkrKykgeworICAgICAgICBoZWFkID0gJnBIZGRUZGxzQ3R4LT5wZWVyX2xpc3RbaV07CisgICAgICAgIGxpc3RfZm9yX2VhY2hfc2FmZSAocG9zLCBxLCBoZWFkKSB7CisgICAgICAgICAgICB0bXAgPSBsaXN0X2VudHJ5KHBvcywgaGRkVGRsc1BlZXJfdCwgbm9kZSk7CisgICAgICAgICAgICBpZiAoZVRETFNfTElOS19ESVNDT1ZFUklORyA9PSB0bXAtPmxpbmtfc3RhdHVzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiAiIE1BQ19BRERSRVNTX1NUUiAiIHRvIGlkbGUgc3RhdGUiLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHRtcC0+cGVlck1hYykpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgd2xhbl9oZGRfdGRsc19zZXRfcGVlcl9saW5rX3N0YXR1cygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlVERMU19MSU5LX0lETEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVURExTX0xJTktfTk9UX1NVUFBPUlRFRCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwSGRkVGRsc0N0eC0+ZGlzY292ZXJ5X3NlbnRfY250ID0gMDsKKyAgICB3bGFuX2hkZF90ZGxzX2NoZWNrX3Bvd2VyX3NhdmVfcHJvaGliaXRlZChwSGRkVGRsc0N0eC0+cEFkYXB0ZXIpOworCisgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworCisgICAgd2xhbl9oZGRfdGRsc19jaGVja19ibXBzKHBIZGRUZGxzQ3R4LT5wQWRhcHRlcik7CisgICAgRVhJVCgpOworICAgIHJldHVybjsKK30KKwordl9WT0lEX3Qgd2xhbl9oZGRfdGRsc19pbml0aWF0b3Jfd2FpdF9jYiggdl9QVk9JRF90IHVzZXJEYXRhICkKK3sKKyAgICB0ZGxzQ29ubkluZm9fdCAqdGRsc0luZm8gPSAodGRsc0Nvbm5JbmZvX3QgKikgdXNlckRhdGE7CisgICAgdGRsc0N0eF90ICAgKnBIZGRUZGxzQ3R4OworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSBOVUxMOworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyID0gTlVMTDsKKyAgICB2X0NPTlRFWFRfdCBwVm9zQ29udGV4dCA9IHZvc19nZXRfZ2xvYmFsX2NvbnRleHQoVk9TX01PRFVMRV9JRF9IREQsIE5VTEwpOworICAgIGhkZFRkbHNQZWVyX3QgKmN1cnJfcGVlciA9IE5VTEw7CisKKyAgICBFTlRFUigpOworCisgICAgaWYgKCF0ZGxzSW5mby0+c3RhSWQpCisgICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICBGTCgicGVlciAoc3RhaWR4ICV1KSBkb2Vzbid0IGV4aXN0cyIpLCB0ZGxzSW5mby0+c3RhSWQpOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIGlmICghcFZvc0NvbnRleHQpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICBGTCgicFZvc0NvbnRleHQgaXMgTlVMTCIpKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHBIZGRDdHggPSB2b3NfZ2V0X2NvbnRleHQoIFZPU19NT0RVTEVfSURfSERELCBwVm9zQ29udGV4dCk7CisgICAgaWYgKCFwSGRkQ3R4KQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgRkwoInBIZGRDdHggaXMgTlVMTCIpKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHBBZGFwdGVyID0gaGRkX2dldF9hZGFwdGVyX2J5X3NtZV9zZXNzaW9uX2lkKHBIZGRDdHgsIHRkbHNJbmZvLT5zZXNzaW9uSWQpOworCisgICAgaWYgKCFwQWRhcHRlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIEZMKCJwQWRhcHRlciBpcyBOVUxMIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgbXV0ZXhfbG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICBjdXJyX3BlZXIgPSB3bGFuX2hkZF90ZGxzX2ZpbmRfcGVlcihwQWRhcHRlciwKKyAgICAgICAgICAgICh1OCAqKSAmdGRsc0luZm8tPnBlZXJNYWMuYnl0ZXNbMF0sIEZBTFNFKTsKKyAgICBpZiAoY3Vycl9wZWVyID09IE5VTEwpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICBGTCgicGVlciBkb2Vzbid0IGV4aXN0cyIpKTsKKyAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIHBIZGRUZGxzQ3R4ID0gY3Vycl9wZWVyLT5wSGRkVGRsc0N0eDsKKworICAgIGlmICggTlVMTCA9PSBwSGRkVGRsc0N0eCApCisgICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgIEZMKCJwSGRkVGRsc0N0eCBpcyBOVUxMIikpOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIGlmICgwICE9ICh3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KAorICAgICAgICAgICAgICBXTEFOX0hERF9HRVRfQ1RYKHBIZGRUZGxzQ3R4LT5wQWRhcHRlcikpKSkKKyAgICB7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgV0xBTlRMX1Jlc3VtZURhdGFUeCggKFdMQU5fSEREX0dFVF9DVFgocEhkZFRkbHNDdHgtPnBBZGFwdGVyKSktPnB2b3NDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZfVThfdCAqKSZjdXJyX3BlZXItPnN0YUlkKTsKKyAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgRVhJVCgpOworfQorCitzdGF0aWMgdm9pZCB3bGFuX2hkZF90ZGxzX2ZyZWVfbGlzdCh0ZGxzQ3R4X3QgKnBIZGRUZGxzQ3R4KQoreworICAgIGludCBpOworICAgIHN0cnVjdCBsaXN0X2hlYWQgKmhlYWQ7CisgICAgaGRkVGRsc1BlZXJfdCAqdG1wOworICAgIHN0cnVjdCBsaXN0X2hlYWQgKnBvcywgKnE7CisKKyAgICBpZiAoTlVMTCA9PSBwSGRkVGRsc0N0eCkKKyAgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgRkwoInBIZGRUZGxzQ3R4IGlzIE5VTEwiKSk7CisgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGZvciAoaSA9IDA7IGkgPCAyNTY7IGkrKykgeworICAgICAgICBoZWFkID0gJnBIZGRUZGxzQ3R4LT5wZWVyX2xpc3RbaV07CisgICAgICAgIGxpc3RfZm9yX2VhY2hfc2FmZSAocG9zLCBxLCBoZWFkKSB7CisgICAgICAgICAgICB0bXAgPSBsaXN0X2VudHJ5KHBvcywgaGRkVGRsc1BlZXJfdCwgbm9kZSk7CisgICAgICAgICAgICBsaXN0X2RlbChwb3MpOworICAgICAgICAgICAgdm9zX21lbV9mcmVlKHRtcCk7CisgICAgICAgICAgICB0bXAgPSBOVUxMOworICAgICAgICB9CisgICAgfQorfQorCitzdGF0aWMgdm9pZCB3bGFuX2hkZF90ZGxzX3NjaGVkdWxlX3NjYW4oc3RydWN0IHdvcmtfc3RydWN0ICp3b3JrKQoreworICAgIHRkbHNfc2Nhbl9jb250ZXh0X3QgKnNjYW5fY3R4ID0KKyAgICAgICAgICBjb250YWluZXJfb2Yod29yaywgdGRsc19zY2FuX2NvbnRleHRfdCwgdGRsc19zY2FuX3dvcmsud29yayk7CisKKyAgICBpZiAoTlVMTCA9PSBzY2FuX2N0eCkKKyAgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIEZMKCJzY2FuX2N0eCBpcyBOVUxMIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaWYgKHVubGlrZWx5KFRETFNfQ1RYX01BR0lDICE9IHNjYW5fY3R4LT5tYWdpYykpCisgICAgICAgIHJldHVybjsKKworICAgIHNjYW5fY3R4LT5hdHRlbXB0Kys7CisKKyAgICB3bGFuX2hkZF9jZmc4MDIxMV9zY2FuKHNjYW5fY3R4LT53aXBoeSwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFIDwgS0VSTkVMX1ZFUlNJT04oMyw2LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Nhbl9jdHgtPmRldiwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Nhbl9jdHgtPnNjYW5fcmVxdWVzdCk7Cit9CisKK3ZvaWQgd2xhbl9oZGRfdGRsc19idENvZXhfY2Iodm9pZCAqZGF0YSwgaW50IGluZFR5cGUpCit7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXI7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgICB1MTYgY29ubmVjdGVkVGRsc1BlZXJzOworICAgIHRkbHNDdHhfdCAqcEhkZFRkbHNDdHg7CisgICAgaGRkVGRsc1BlZXJfdCAqY3VyclBlZXI7CisKKyAgICBFTlRFUigpOworICAgIGlmICgoTlVMTCA9PSBkYXRhKSB8fCAoaW5kVHlwZSA8IDApKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICBGTCgiSW52YWxpZCBhcmd1bWVudHMiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBwSGRkQ3R4ICAgICA9IChoZGRfY29udGV4dF90ICopZGF0YTsKKyAgICBpZiAoMCAhPSAod2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KSkpCisgICAgeworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgLyogaWYgdGRscyBpcyBub3QgZW5hYmxlZCwgdGhlbiBjb250aW51ZSBidENvZXggKi8KKyAgICBpZiAoZVRETFNfU1VQUE9SVF9OT1RfRU5BQkxFRCA9PSBwSGRkQ3R4LT50ZGxzX21vZGUpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgRkwoInRkbHMgaXMgbm90IGVuYWJsZWQiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICAvKiBnZXQgcEFkYXB0ZXIgY29udGV4dCwgZG8gd2UgbmVlZCBXTEFOX0hERF9QMlBfQ0xJRU5UICovCisgICAgcEFkYXB0ZXIgPSBoZGRfZ2V0X2FkYXB0ZXIocEhkZEN0eCwgV0xBTl9IRERfSU5GUkFfU1RBVElPTik7CisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIEZMKCJwQWRhcHRlciBpcyBub3QgdmFsaWQiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBwSGRkVGRsc0N0eCA9IFdMQU5fSEREX0dFVF9URExTX0NUWF9QVFIocEFkYXB0ZXIpOworICAgIGlmIChOVUxMID09IHBIZGRUZGxzQ3R4KQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICBGTCgicEhkZFRkbHNDdHggaXMgbm90IHZhbGlkIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgIiVzOiBCdENvZXggbm90aWZpY2F0aW9uIHR5cGUgJWQiLCBfX2Z1bmNfXywgaW5kVHlwZSk7CisgICAvKiBCdENvZXggbm90aWZpY2F0aW9uIHR5cGUgZW5hYmxlZCwgRGlzYWJsZSBURExTICovCisgICBpZiAoaW5kVHlwZSA9PSBTSVJfQ09FWF9JTkRfVFlQRV9URExTX0RJU0FCTEUpCisgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICBGTCgiQnRDb2V4IG5vdGlmaWNhdGlvbiwgRGlzYWJsZSBURExTIikpOworCisgICAgICAgIC8qIHRkbHMgaXMgaW4gcHJvZ3Jlc3MgKi8KKyAgICAgICAgY3VyclBlZXIgPSB3bGFuX2hkZF90ZGxzX2lzX3Byb2dyZXNzKHBIZGRDdHgsIE5VTEwsIDAsIFRSVUUpOworICAgICAgICBpZiAoTlVMTCAhPSBjdXJyUGVlcikKKyAgICAgICAgeworICAgICAgICAgICAgd2xhbl9oZGRfdGRsc19zZXRfcGVlcl9saW5rX3N0YXR1cyAoY3VyclBlZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlVERMU19MSU5LX0lETEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlVERMU19MSU5LX1VOU1BFQ0lGSUVEKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qIHdoaWxlIHRkbHMgaXMgdXAgKi8KKyAgICAgICAgaWYgKGVURExTX1NVUFBPUlRfRU5BQkxFRCA9PSBwSGRkQ3R4LT50ZGxzX21vZGUgfHwKKyAgICAgICAgICAgIGVURExTX1NVUFBPUlRfRVhQTElDSVRfVFJJR0dFUl9PTkxZID09IHBIZGRDdHgtPnRkbHNfbW9kZSkKKyAgICAgICAgeworICAgICAgICAgICAgY29ubmVjdGVkVGRsc1BlZXJzID0gd2xhbl9oZGRfdGRsc0Nvbm5lY3RlZFBlZXJzKHBBZGFwdGVyKTsKKyAgICAgICAgICAgIC8qIGRpc2FibGUgaW1wbGljaXQgdHJpZ2dlciBsb2dpYyAmIHRkbHMgb3BlcmF0b2luICovCisgICAgICAgICAgICB3bGFuX2hkZF90ZGxzX3NldF9tb2RlKHBIZGRDdHgsIGVURExTX1NVUFBPUlRfRElTQUJMRUQsIEZBTFNFKTsKKyAgICAgICAgICAgIHBIZGRDdHgtPmlzX3RkbHNfYnRjX2VuYWJsZWQgPSBGQUxTRTsKKworICAgICAgICAgICAgLyogdGVhcmRvd24gdGhlIHBlZXJzIG9uIHRoZSBidGNvZXggKi8KKyAgICAgICAgICAgIGlmIChjb25uZWN0ZWRUZGxzUGVlcnMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICB0QU5JX1U4IHN0YUlkeDsKKyAgICAgICAgICAgICAgIGhkZFRkbHNQZWVyX3QgKmN1cnJfcGVlcjsKKworICAgICAgICAgICAgICAgZm9yIChzdGFJZHggPSAwOyBzdGFJZHggPCBIRERfTUFYX05VTV9URExTX1NUQTsgc3RhSWR4KyspCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChwSGRkQ3R4LT50ZGxzQ29ubkluZm9bc3RhSWR4XS5zdGFJZCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIiVzOiBpbmRpY2F0ZSBURExTIHRlYXJkb3duIChzdGFJZCAlZCkiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyxwSGRkQ3R4LT50ZGxzQ29ubkluZm9bc3RhSWR4XS5zdGFJZCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICNpZmRlZiBDT05GSUdfVERMU19JTVBMSUNJVAorICAgICAgICAgICAgICAgICAgICAgICAgY3Vycl9wZWVyID0gd2xhbl9oZGRfdGRsc19maW5kX2FsbF9wZWVyKHBIZGRDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPnRkbHNDb25uSW5mb1tzdGFJZHhdLnBlZXJNYWMuYnl0ZXMpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYoY3Vycl9wZWVyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF90ZGxzX2luZGljYXRlX3RlYXJkb3duKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyX3BlZXItPnBIZGRUZGxzQ3R4LT5wQWRhcHRlciwgY3Vycl9wZWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX01BQ19URExTX1RFQVJET1dOX1VOU1BFQ19SRUFTT04pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgI2VuZGlmCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgfQorICAgLyogQnRDb2V4IG5vdGlmaWNhdGlvbiB0eXBlIGVuYWJsZWQsIEVuYWJsZSBURExTICovCisgICBlbHNlIGlmIChpbmRUeXBlID09IFNJUl9DT0VYX0lORF9UWVBFX1RETFNfRU5BQkxFKQorICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgRkwoIkJ0Q29leCBub3RpZmljYXRpb24sIEVuYWJsZSBURExTIikpOworICAgICAgICAvKiBpZiB0ZGxzIHdhcyBlbmFibGVkIGJlZm9yZSBidENvZXgsIHJlLWVuYWJsZSB0ZGxzIG1vZGUgKi8KKyAgICAgICAgaWYgKGVURExTX1NVUFBPUlRfRU5BQkxFRCA9PSBwSGRkQ3R4LT50ZGxzX21vZGVfbGFzdCB8fAorICAgICAgICAgICAgZVRETFNfU1VQUE9SVF9FWFBMSUNJVF9UUklHR0VSX09OTFkgPT0gcEhkZEN0eC0+dGRsc19tb2RlX2xhc3QpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgKCIlczogcmV2ZXJ0IHRkbHMgbW9kZSAlZCIpLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT50ZGxzX21vZGVfbGFzdCk7CisgICAgICAgICAgICBwSGRkQ3R4LT5pc190ZGxzX2J0Y19lbmFibGVkID0gVFJVRTsKKyAgICAgICAgICAgIHdsYW5faGRkX3RkbHNfc2V0X21vZGUocEhkZEN0eCwgcEhkZEN0eC0+dGRsc19tb2RlX2xhc3QsIEZBTFNFKTsKKyAgICAgICAgfQorICAgfQorICAgRVhJVCgpOworICAgcmV0dXJuOworfQorCisvKiBpbml0aWFsaXplIFRETFMgZ2xvYmFsIGNvbnRleHQgKi8KK3ZvaWQgIHdsYW5faGRkX3RkbHNfaW5pdChoZGRfY29udGV4dF90ICpwSGRkQ3R4ICkKK3sKKyAgICB2X1U4X3Qgc3RhSWR4OworICAgIGVIYWxTdGF0dXMgc3RhdHVzOworCisgICAgcEhkZEN0eC0+Y29ubmVjdGVkX3BlZXJfY291bnQgPSAwOworCisgICAgcEhkZEN0eC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FNTdXBwb3J0KSAmJgorICAgICAgICAoVFJVRSA9PSBzbWVfSXNGZWF0dXJlU3VwcG9ydGVkQnlGVyhURExTKSkpCisgICAgeworICAgICAgICBpZiAoRkFMU0UgPT0gcEhkZEN0eC0+Y2ZnX2luaS0+ZkVuYWJsZVRETFNJbXBsaWNpdFRyaWdnZXIpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBIZGRDdHgtPnRkbHNfbW9kZSA9IGVURExTX1NVUFBPUlRfRVhQTElDSVRfVFJJR0dFUl9PTkxZOworICAgICAgICAgICAgaGRkTG9nKExPR0UsIEZMKCJURExTIEltcGxpY2l0IHRyaWdnZXIgbm90IGVuYWJsZWQhIikpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIHBIZGRDdHgtPnRkbHNfbW9kZSA9IGVURExTX1NVUFBPUlRfRU5BQkxFRDsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgaGRkTG9nKExPR0UsCisgICAgICAgICAgICAgICBGTCgiVERMUyBub3QgZW5hYmxlZCAoJWQpIG9yIEZXIGRvZXNuJ3Qgc3VwcG9ydCAoJWQpIiksCisgICAgICAgICAgICAgICBwSGRkQ3R4LT5jZmdfaW5pLT5mRW5hYmxlVERMU1N1cHBvcnQsCisgICAgICAgICAgICAgICBzbWVfSXNGZWF0dXJlU3VwcG9ydGVkQnlGVyhURExTKSk7CisgICAgICAgIHBIZGRDdHgtPnRkbHNfbW9kZSA9IGVURExTX1NVUFBPUlRfTk9UX0VOQUJMRUQ7CisgICAgfQorfQorCitpbnQgd2xhbl9oZGRfc3RhX3RkbHNfaW5pdChoZGRfYWRhcHRlcl90ICpwQWRhcHRlcikKK3sKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWCggcEFkYXB0ZXIgKTsKKyAgICB0ZGxzQ3R4X3QgKnBIZGRUZGxzQ3R4OworICAgIGludCBpOworICAgIGlmIChOVUxMID09IHBI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9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzIG1hbGxvYyBmYWlsZWQhIiwgX19mdW5jX18pOworICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25DdHguc3RhdGlvbi5wSGRkVGRsc0N0eCA9IE5VTEw7CisgICAgICAgICAgICByZXR1cm4gLUVOT01FTTsKKyAgICAgICAgfQorICAgICAgICAvKiBpbml0aWFsaXplIFRETFMgcEFkYXRlciBjb250ZXh0ICovCisgICAgICAgIHZvc19tZW1femVybyhwSGRkVGRsc0N0eCwgc2l6ZW9mKHRkbHNDdHhfdCkpOworI2lmZGVmIFRETFNfVVNFX1NFUEFSQVRFX0RJU0NPVkVSWV9USU1FUgorICAgICAgICB2b3NfdGltZXJfaW5pdCgmcEhkZFRkbHNDdHgtPnBlZXJEaXNjb3ZlclRpbWVyLAorICAgICAgICAgICAgICAgIFZPU19USU1FUl9UWVBFX1NXLAorICAgICAgICAgICAgICAgIHdsYW5faGRkX3RkbHNfZGlzY292ZXJfcGVlcl9jYiwKKyAgICAgICAgICAgICAgICBwSGRkVGRsc0N0eCk7CisjZW5kaWYKKworICAgICAgICB2b3NfdGltZXJfaW5pdCgmcEhkZFRkbHNDdHgtPnBlZXJVcGRhdGVUaW1lciwKKyAgICAgICAgICAgICAgICBWT1NfVElNRVJfVFlQRV9TVywKKyAgICAgICAgICAgICAgICB3bGFuX2hkZF90ZGxzX3VwZGF0ZV9wZWVyX2NiLAorICAgICAgICAgICAgICAgIHBIZGRUZGxzQ3R4KTsKKyAgICAgICAgdm9zX3RpbWVyX2luaXQoJnBIZGRUZGxzQ3R4LT5wZWVyRGlzY292ZXJ5VGltZW91dFRpbWVyLAorICAgICAgICAgICAgICAgIFZPU19USU1FUl9UWVBFX1NXLAorICAgICAgICAgICAgICAgIHdsYW5faGRkX3RkbHNfZGlzY292ZXJ5X3RpbWVvdXRfcGVlcl9jYiwKKyAgICAgICAgICAgICAgICBwSGRkVGRsc0N0eCk7CisKKyAgICAgICA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ldyBtYWMgYWRkcmVzcworKi8KK2hkZFRkbHNQZWVyX3QgKndsYW5faGRkX3RkbHNfZ2V0X3BlZXIoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqbWFjCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCAqbWFjCisjZW5kaWYKKyAgICAgICAgICApCit7CisgICAgc3RydWN0IGxpc3RfaGVhZCAqaGVhZDsKKyAgICBoZGRUZGxzUGVlcl90ICpwZWVyOworICAgIHU4IGtleTsKKyAgICB0ZGxzQ3R4X3QgKnBIZGRUZGxzQ3R4OworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisKKworICAgIGlmICghcEFkYXB0ZXIpIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoIkhERCBhZHBhdGVyIGlzIE5VTEwiKSk7CisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICBpZiAoMCAhPSAod2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KSkpCisgICAgeworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisKKyAgICAvKiBpZiBhbHJlYWR5IHRoZXJlLCBqdXN0IHVwZGF0ZSAqLworICAgIHBlZXIgPSB3bGFuX2hkZF90ZGxzX2ZpbmRfcGVlcihwQWRhcHRlciwgbWFjLCBGQUxTRSk7CisgICAgaWYgKHBlZXIgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIHJldHVybiBwZWVyOworICAgIH0KKworICAgIC8qIG5vdCBmb3VuZCwgYWxsb2NhdGUgYW5kIGFkZCB0aGUgbGlzdCAqLworICAgIHBlZXIgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YoaGRkVGRsc1BlZXJfdCkpOworICAgIGlmIChOVUxMID09IHBlZXIpIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzIHBlZXIgbWFsbG9jIGZhaWxlZCEiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICAgIHBIZGRUZGxzQ3R4ID0gV0xBTl9IRERfR0VUX1RETFNfQ1RYX1BUUihwQWRhcHRlcik7CisKKyAgICBpZiAoTlVMTCA9PSBwSGRkVGRsc0N0eCkKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZShwZWVyKTsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgRkwoInBIZGRUZGxzQ3R4IGlzIE5VTEwiKSk7CisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICAgIGtleSA9IHdsYW5faGRkX3RkbHNfaGFzaF9rZXkobWFjKTsKKyAgICBoZWFkID0gJnBIZGRUZGxzQ3R4LT5wZWVyX2xpc3Rba2V5XTsKKworICAgIHZvc19tZW1femVybyhwZWVyLCBzaXplb2YoaGRkVGRsc1BlZXJfdCkpOworICAgIHZvc19tZW1fY29weShwZWVyLT5wZWVyTWFjLCBtYWMsIHNpemVvZihwZWVyLT5wZWVyTWFjKSk7CisgICAgcGVlci0+cEhkZFRkbHNDdHggPSBwSGRkVGRsc0N0eDsKKworICAgIHZvc190aW1lcl9pbml0KCZwZWVyLT5wZWVySWRsZVRpbWVyLAorICAgICAgICAgICAgICAgICAgICBWT1NfVElNRVJfVFlQRV9TVywKKyAgICAgICAgICAgICAgICAgICAgd2xhbl9oZGRfdGRsc19pZGxlX2NiLAorICAgICAgICAgICAgICAgICAgICBwZWVyKTsKKyAgICBsaXN0X2FkZF90YWlsKCZwZWVyLT5ub2RlLCBoZWFkKTsKKworICAgIHJldHVybiBwZWVyOworfQorCitpbnQgd2xhbl9oZGRfdGRsc19zZXRfY2FwKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTgqIG1hYywKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4KiBtYWMsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFRETFNDYXBUeXBlIGNhcCkKK3sKKyAgICBoZGRUZGxzUGVlcl90ICpjdXJyX3BlZXI7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworCisgICAgaWYgKDAgIT0gKHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCkpKQorICAgICAgICByZXR1cm4gLUVJTlZBTDsKKworICAgIG11dGV4X2xvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgY3Vycl9wZWVyID0gd2xhbl9oZGRfdGRsc19nZXRfcGVlcihwQWRhcHRlciwgbWFjKTsKKyAgICBpZiAoY3Vycl9wZWVyID09IE5VTEwpCisgICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IGN1cnJfcGVlciBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisKKyAgICBjdXJyX3BlZXItPnRkbHNfc3VwcG9ydCA9IGNhcDsKKworICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICByZXR1cm4gMDsKK30KKwordm9pZCB3bGFuX2hkZF90ZGxzX3NldF9wZWVyX2xpbmtfc3RhdHVzKGhkZFRkbHNQZWVyX3QgKmN1cnJfcGVlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0VERMU0xpbmtTdGF0dXMgc3RhdHVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRURExTTGlua1JlYXNvbiByZWFzb24pCit7CisgICAgLypFWFQgVERMUyovCisgICAgdEFOSV9TMzIgc3RhdGUgPSAwOworICAgIHRBTklfUzMyIHJlcyA9IDA7CisgICAgLypFWFQgVERMUyovCisgICAgaWYgKGN1cnJfcGVlciA9PSBOVUxMKQorICAgIHsKKyAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBjdXJyX3BlZXIgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfV0FSTiwgInRkbHMgc2V0IHBlZXIgIiBNQUNfQUREUkVTU19TVFIgIiBsaW5rIHN0YXR1cyB0byAldSIsCisgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShjdXJyX3BlZXItPnBlZXJNYWMpLCBzdGF0dXMpOworCisgICAgY3Vycl9wZWVyLT5saW5rX3N0YXR1cyA9IHN0YXR1czsKKworICAgIC8qRVhUIFRETFMqLworICAgIGlmIChjdXJyX3BlZXItPmlzRm9yY2VkUGVlciAmJiBjdXJyX3BlZXItPnN0YXRlX2NoYW5nZV9ub3RpZmljYXRpb24pCisgICAgeworICAgICAgICAvKnNhdmUgdGhlIHJlYXNvbiBmb3IgYW55IGZ1cnRoZXIgcXVlcnkqLworICAgICAgICBjdXJyX3BlZXItPnJlYXNvbiA9IHJlYXNvbjsKKyAgICAgICAgd2xhbl9oZGRfdGRsc19nZXRfd2lmaV9oYWxfc3RhdGUoY3Vycl9wZWVyLCAmc3RhdGUsICZyZXMpOworCisgICAgICAgIChjdXJyX3BlZXItPnN0YXRlX2NoYW5nZV9ub3RpZmljYXRpb24pKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vycl9wZWVyLT5wZWVyTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyX3BlZXItPnBIZGRUZGxzQ3R4LT5wQWRhcHRlcik7CisKKyAgICB9CisgICAgLypFWFQgVERMUyovCisKK30KKwordm9pZCB3bGFuX2hkZF90ZGxzX3NldF9saW5rX3N0YXR1cyhoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICptYWMsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCAqbWFjLAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRURExTTGlua1N0YXR1cyBsaW5rU3RhdHVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0VERMU0xpbmtSZWFzb24gcmVhc29uKQoreworCisgICAgLypFWFQgVERMUyovCisgICAgdEFOSV9TMzIgc3RhdGUgPSAwOworICAgIHRBTklfUzMyIHJlcyA9IDA7CisgICAgLypFWFQgVERMUyovCisgICAgaGRkVGRsc1BlZXJfdCAqY3Vycl9wZWVyOworCisgICAgY3Vycl9wZWVyID0gd2xhbl9oZGRfdGRsc19maW5kX3BlZXIocEFkYXB0ZXIsIG1hYywgVFJVRSk7CisgICAgaWYgKGN1cnJfcGVlciA9PSBOVUxMKQorICAgIHsKKyAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBjdXJyX3BlZXIgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGN1cnJfcGVlci0+bGlua19zdGF0dXM9IGxpbmtTdGF0dXM7CisKKyAgICAvKkVYVCBURExTKi8KKworICAgIGlmIChjdXJyX3BlZXItPmlzRm9yY2VkUGVlciAmJiBjdXJyX3BlZXItPnN0YXRlX2NoYW5nZV9ub3RpZmljYXRpb24pCisgICAgeworICAgICAgICAvKnNhdmUgdGhlIHJlYXNvbiBmb3IgYW55IGZ1cnRoZXIgcXVlcnkqLworICAgICAgICBjdXJyX3BlZXItPnJlYXNvbiA9IHJlYXNvbjsKKyAgICAgICAgd2xhbl9oZGRfdGRsc19nZXRfd2lmaV9oYWxfc3RhdGUoY3Vycl9wZWVyLCAmc3RhdGUsICZyZXMpOworCisgICAgICAgICgqY3Vycl9wZWVyLT5zdGF0ZV9jaGFuZ2Vfbm90aWZpY2F0aW9uKShtYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJfcGVlci0+cEhkZFRkbHNDdHgtPnBBZGFwdGVyKTsKKworICAgIH0KKyAgICAvKkVYVCBURExTKi8KKyAgICByZXR1cm47Cit9CisKK2ludCB3bGFuX2hkZF90ZGxzX3JlY3ZfZGlzY292ZXJ5X3Jlc3AoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsIHU4ICptYWMpCit7CisgICAgaGRkVGRsc1BlZXJfdCAqY3Vycl9wZWVyOworICAgIHRkbHNDdHhfdCAqcEhkZFRkbHNDdHggPSBXTEFOX0hERF9HRVRfVERMU19DVFhfUFRSKHBBZGFwdGVyKTsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworCisgICAgRU5URVIoKTsKKworICAgIGlmICggTlVMTCA9PSBwSGRkVGRsc0N0eCApCisgICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICBGTCgicEhkZFRkbHNDdHggaXMgTlVMTCBkZXZpY2UgbW9kZSA9ICVkIiksIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSk7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisKKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwSGRkVGRsc0N0eC0+cEFkYXB0ZXIpOworCisgICAgaWYoMCAhPSAod2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KSkpCisgICAgeworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisKKyAgICBtdXRleF9sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgIGN1cnJfcGVlciA9IHdsYW5faGRkX3RkbHNfZ2V0X3BlZXIocEFkYXB0ZXIsIG1hYyk7CisKKyAgICBpZiAoTlVMTCA9PSBjdXJyX3BlZXIpCisgICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICBGTCgiY3Vycl9wZWVyIGlzIE5VTEwiKSk7CisgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKyAgICBtdXRleF91bmxvY2soJnBI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HNvIG1ldCBiZWZvcmUgc2V0dGluZyB1cCBURExTIGxpbmsqLworICAgICAgICBpZiAoKHRBTklfUzMyKSBjdXJyX3BlZXItPnJzc2kgPiAodEFOSV9TMzIpIHBIZGRUZGxzQ3R4LT50aHJlc2hvbGRfY29uZmlnLnJzc2lfdHJpZ2dlcl90aHJlc2hvbGQpCisgICAgICAgIHsKKyAgICAgICAgICAgIHdsYW5faGRkX3RkbHNfc2V0X3BlZXJfbGlua19zdGF0dXMoY3Vycl9wZWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlVERMU19MSU5LX0RJU0NPVkVSRUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVURExTX0xJTktfU1VDQ0VTUyk7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICJSc3NpIFRocmVzaG9sZCBtZXQ6ICJNQUNfQUREUkVTU19TVFIiIHJzc2kgPSAlZCB0aHJlc2hvbGQ9ICVkIiAsCisgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkoY3Vycl9wZWVyLT5wZWVyTWFjKSwgY3Vycl9wZWVyLT5yc3NpLAorICAgICAgICAgICAgIHBIZGRUZGxzQ3R4LT50aHJlc2hvbGRfY29uZmlnLnJzc2lfdHJpZ2dlcl90aHJlc2hvbGQpOworICAgICAgICAgICAgY2ZnODAyMTFfdGRsc19vcGVyX3JlcXVlc3QocEFkYXB0ZXItPmRldiwgY3Vycl9wZWVyLT5wZWVyTWFjLCBOTDgwMjExX1RETFNfU0VUVVAsIEZBTFNFLCBHRlBfS0VSTkVMKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgIlJzc2kgVGhyZXNob2xkIG5vdCBtZXQ6ICJNQUNfQUREUkVTU19TVFIiIHJzc2kgPSAlZCB0aHJlc2hvbGQgPSAlZCAiLAorICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkoY3Vycl9wZWVyLT5wZWVyTWFjKSwgY3Vycl9wZWVyLT5yc3NpLAorICAgICAgICAgICAgcEhkZFRkbHNDdHgtPnRocmVzaG9sZF9jb25maWcucnNzaV90cmlnZ2VyX3RocmVzaG9sZCk7CisKKyAgICAgICAgICAgIC8qIGlmIFJTU0kgdGhyZXNob2xkIGlzIG5vdCBtZXQgdGhlbiBhbGxvdyBmdXJ0aGVyIGRpc2NvdmVyeQorICAgICAgICAgICAgICogYXR0ZW1wdHMgYnkgZGVjcmVtZW50aW5nIGNvdW50IGZvciB0aGUgbGFzdCBhdHRlbXB0CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmIChjdXJyX3BlZXItPmRpc2NvdmVyeV9hdHRlbXB0KQorICAgICAgICAgICAgICAgIGN1cnJfcGVlci0+ZGlzY292ZXJ5X2F0dGVtcHQtLTsKKworICAgICAgICAgICAgd2xhbl9oZGRfdGRsc19zZXRfcGVlcl9saW5rX3N0YXR1cyhjdXJyX3BlZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVURExTX0xJTktfSURMRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVRETFNfTElOS19VTlNQRUNJRklFRCk7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgd2xhbl9oZGRfdGRsc19jaGVja19ibXBzKHBBZGFwdGVyKTsKKyAgICB9CisKKyAgICBjdXJyX3BlZXItPnRkbHNfc3VwcG9ydCA9IGVURExTX0NBUF9TVVBQT1JURUQ7CisgICAgRVhJVCgpOworICAgIHJldHVybiAwOworfQorCitpbnQgd2xhbl9oZGRfdGRsc19zZXRfcGVlcl9jYXBzKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKm1hYywKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICptYWMsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdENzclN0YVBhcmFtcyAqU3RhUGFyYW1zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX0JPT0xFQU4gaXNCdWZTdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfQk9PTEVBTiBpc09mZkNoYW5uZWxTdXBwb3J0ZWQpCit7CisgICAgaGRkVGRsc1BlZXJfdCAqY3Vycl9wZWVyOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKworICAgIGlmICgwICE9ICh3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpKSkKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisKKyAgICBtdXRleF9sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgIGN1cnJfcGVlciA9IHdsYW5faGRkX3RkbHNfZ2V0X3BlZXIocEFkYXB0ZXIsIG1hYyk7CisgICAgaWYgKGN1cnJfcGVlciA9PSBOVUxMKQorICAgIHsKKyAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBjdXJyX3BlZXIgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgICAgICByZ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EN0eC0+dGRsc19sb2NrKTsKKyAgICByZXR1cm4gMDsKK30KKworaW50IHdsYW5faGRkX3RkbHNfZ2V0X2xpbmtfZXN0YWJsaXNoX3BhcmFtcyhoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICptYWMsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCAqbWFjLAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRDc3JUZGxzTGlua0VzdGFibGlzaFBhcmFtcyogdGRsc0xpbmtFc3RhYmxpc2hQYXJhbXMpCit7CisgICAgaGRkVGRsc1BlZXJfdCAqY3Vycl9wZWVyOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKworICAgIGlmICgwICE9ICh3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpKSkKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisKKyAgICBtdXRleF9sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgIGN1cnJfcGVlciA9IHdsYW5faGRkX3RkbHNfZ2V0X3BlZXIocEFkYXB0ZXIsIG1hYyk7CisgICAgaWYgKGN1cnJfcGVlciA9PSBOVUxMKQorICAgIHsKKyAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBjdXJyX3BlZXIgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2sp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N1cHBvcnRlZF9vcGVyX2NsYXNzZXNfbGVuKTsKKworICAgIHRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zLT5zdXBwb3J0ZWRPcGVyQ2xhc3Nlc0xlbiA9CisgICAgICAgICAgICAgICAgIGN1cnJfcGVlci0+c3VwcG9ydGVkX29wZXJfY2xhc3Nlc19sZW47CisgICAgdGRsc0xpbmtFc3RhYmxpc2hQYXJhbXMtPnFvcyA9IGN1cnJfcGVlci0+cW9zOworCisgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgIHJldHVybiAwOworfQorCitpbnQgd2xhbl9oZGRfdGRsc19zZXRfcnNzaShoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqbWFjLAorI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICptYWMsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfUzggcnhSc3NpKQoreworICAgIGhkZFRkbHNQZWVyX3QgKmN1cnJfcGVlcjsKKworICAgIGN1cnJfcGVlciA9IHdsYW5faGRkX3RkbHNfZmluZF9wZWVyKHBBZGFwdGVyLCBtYWMsIFRSVUUpOworICAgIGlmIChjdXJyX3BlZXIgPT0gTlVMTCkKKyAgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogY3Vycl9wZWVyIGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisKKyAgICBjdXJyX3BlZXItPnJzc2kgPSByeFJzc2k7CisKKyAgICByZXR1cm4gMDsKK30KKworaW50IHdsYW5faGRkX3RkbHNfc2V0X3Jlc3BvbmRlcihoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICptYWMsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCAqbWFjLAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggcmVzcG9uZGVyKQoreworICAgIGhkZFRkbHNQZWVyX3QgKmN1cnJfcGVlcjsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisKKyAgICBpZiAoMCAhPSAod2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KSkpCisgICAgICAgIHJldHVybiAtRUlOVkFMOworCisgICAgbXV0ZXhfbG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICBjdXJyX3BlZXIgPSB3bGFuX2hkZF90ZGxzX2dldF9wZWVyKHBBZGFwdGVyLCBtYWMpOworICAgIGlmIChjdXJyX3BlZXIgPT0gTlVMTCkKKyAgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogY3Vycl9wZWVyIGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKworICAgIGN1cnJfcGVlci0+aXNfcmVzcG9uZGVyID0gcmVzcG9uZGVyOworCisgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgIHJldHVybiAwOworfQorCitpbnQgd2xhbl9oZGRfdGRsc19nZXRfcmVzcG9uZGVyKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLCB1OCAqbWFjKQoreworICAgIGhkZFRkbHNQZWVyX3QgKmN1cnJfcGVlcjsKKworICAgIGN1cnJfcGVlciA9IHdsYW5faGRkX3RkbHNfZmluZF9wZWVyKHBBZGFwdGVyLCBtYWMsIFRSVUUpOworICAgIGlmIChjdXJyX3BlZXIgPT0gTlVMTCkKKyAgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogY3Vycl9wZWVyIGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisKKyAgICByZXR1cm4gKGN1cnJfcGVlci0+aXNfcmVzcG9uZGVyKTsKK30KKworaW50IHdsYW5faGRkX3RkbHNfc2V0X3NpZ25hdHVyZShoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICptYWMsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCAqbWFjLAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggdVNpZ25hdHVyZSkKK3sKKyAgICBoZGRUZGxzUGVlcl90ICpjdXJyX3BlZXI7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworCisgICAgaWYgKDAgIT0gKHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCkpKQorICAgICAgICByZXR1cm4gLUVJTlZBTDsKKworICAgIG11dGV4X2xvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgY3Vycl9wZWVyID0gd2xhbl9oZGRfdGRsc19nZXRfcGVlcihwQWRhcHRlciwgbWFjKTsKKyAgICBpZiAoY3Vycl9wZWVyID09IE5VTEwpCisgICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IGN1cnJfcGVlciBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisKKyAgICBjdXJyX3BlZXItPnNpZ25hdHVyZSA9IHVTaWduYXR1cmU7CisKKyAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgcmV0dXJuIDA7Cit9CisKKwordm9pZCB3bGFuX2hkZF90ZGxzX2V4dHJhY3RfZGEoc3RydWN0IHNrX2J1ZmYgKnNrYiwgdTggKm1hYykKK3sKKyAgICBtZW1jcHkobWFjLCBza2ItPmRhdGEsIDYpOworfQorCit2b2lkIHdsYW5faGRkX3RkbHNfZXh0cmFjdF9zYShzdHJ1Y3Qgc2tfYnVmZiAqc2tiLCB1OCAqbWFjKQoreworICAgIG1lbWNweShtYWMsIHNrYi0+ZGF0YSs2LCA2KTsKK30KKworaW50IHdsYW5faGRkX3RkbHNfaW5jcmVtZW50X3BrdF9jb3VudChoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICptYWMsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCAqbWFjLAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4IHR4KQoreworICAgIGhkZFRkbHNQZWVyX3QgKmN1cnJfcGVlcjsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisKKyAgICBpZiAoMCAhPSAod2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KSkpCisgICAgICAgIHJldHVybiAtRUlOVkFMOworCisgICAgaWYgKGVURExTX1NVUFBPUlRfRU5BQkxFRCAhPSBwSGRkQ3R4LT50ZGxzX21vZGUpCisgICAgICAgIHJldHVybiAtMTsKKworICAgIG11dGV4X2xvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgY3Vycl9wZWVyID0gd2xhbl9oZGRfdGRsc19nZXRfcGVlcihwQWRhcHRlciwgbWFjKTsKKyAgICBpZiAoY3Vycl9wZWVyID09IE5VTEwpCisgICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgIEZMKCJjdXJyX3BlZXIgaXMgTlVMTCIpKTsKKyAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgICAgaWYgKHR4KQorICAgICAgICBjdXJyX3BlZXItPnR4X3BrdCsrOworICAgIGVsc2UKKyAgICAgICAgY3Vycl9wZWVyLT5yeF9wa3QrKzsKKworICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljIGludCB3bGFuX2hkZF90ZGxzX2NoZWNrX2NvbmZpZyh0ZGxzX2NvbmZpZ19wYXJhbXNfdCAqY29uZmlnKQoreworICAgIGlmIChjb25maWctPnRkbHMgPiAyKQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzIGludmFsaWQ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geworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgiVERMUyBub3QgZW5hYmxlZCEiKSk7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisKKyAgICBpZiAod2xhbl9oZGRfdGRsc19jaGVja19jb25maWcoY29uZmlnKSAhPSAwKQorICAgIHsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKworICAgIC8qIGNvbmZpZy0+dGRscyBpcyBtYXBwZWQgdG8gMC0+MSwgMS0+MiwgMi0+MyAqLworICAgIHJlcV90ZGxzX21vZGUgPSBjb25maWctPnRkbHMgKyAxOworICAgIGlmIChwSGRkQ3R4LT50ZGxzX21vZGUgPT0gcmVxX3RkbHNfbW9kZSkKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlcyBhbHJlYWR5IGluIG1vZGUgJWQiLCBfX2Z1bmNfXywgY29uZmlnLT50ZGxzKTsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKworICAgIC8qIGNvcHkgdGhlIGNvbmZpZ3VyYXRpb24gb25seSB3aGVuIGdpdmVuIHRkbHMgbW9kZSBpcyBpbXBsaWNpdCB0cmlnZ2VyIGVuYWJsZSAqLworICAgIGlmIChlVERMU19TVVBQT1JUX0VOQUJMRUQgPT0gcmVxX3RkbHNfbW9kZSkKKyAgICB7CisgICAgICAgIG1lbWNweSgmcEhkZFRkbHNDdHgtPnRocmVzaG9sZF9jb25maWcsIGNvbmZpZywgc2l6ZW9mKHRkbHNfY29uZmlnX3BhcmFtc190KSk7CisgICAgfQorCisgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAiaXcgc2V0IHRkbHMgcGFyYW1zOiAlZCAlZCAlZCAlZCAlZCAlZCAlZCAlZCAlZCAlZCIsCisgICAgICAgICAgICBjb25maWctPnRkbHMsCisgICAgICAgICAgICBjb25maWctPnR4X3BlcmlvZF90LAorICAgICAgICAgICAgY29uZmlnLT50eF9wYWNrZXRfbiwKKyAgICAgICAgICAgIGNvbmZpZy0+ZGlzY292ZXJ5X3BlcmlvZF90LAorICAgICAgICAgICAgY29uZmlnLT5kaXNjb3ZlcnlfdHJpZXNfbiwKKyAgICAgICAgICAgIGNvbmZpZy0+aWRsZV90aW1lb3V0X3QsCisgICAgICAgICAgICBjb25maWctPmlkbGVfcGFja2V0X24sCisgICAgICAgICAgICBjb25maWctPnJzc2lfaHlzdGVyZXNpcywKKyAgICAgICAgICAgIGNvbmZpZy0+cnNzaV90cmlnZ2VyX3RocmVzaG9sZCwKKyAgICAgICAgICAgIGNvbmZpZy0+cnNzaV90ZWFyZG93bl90aHJlc2hvbGQpOworCisgICAgd2xhbl9oZGRfdGRsc19zZXRfbW9kZShwSGRkQ3R4LCByZXFfdGRsc19tb2RlLCBUUlVFKTsKKworICAgIHJldHVybiAwOworfQorCitpbnQgd2xhbl9oZGRfdGRsc19zZXRfc3RhX2lkKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKm1hYywKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICptYWMsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggc3RhSWQpCit7CisgICAgaGRkVGRsc1BlZXJfdCAqY3Vycl9wZWVyOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKworICAgIGlmICgwICE9ICh3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpKSkKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisKKyAgICBtdXRleF9sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgIGN1cnJfcGVlciA9IHdsYW5faGRkX3RkbHNfZ2V0X3BlZXIocEFkYXB0ZXIsIG1hYyk7CisgICAgaWYgKGN1cnJfcGVlciA9PSBOVUxMKQorICAgIHsKKyAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBjdXJyX3BlZXIgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgICAgY3Vycl9wZWVyLT5zdGFJZCA9IHN0YUlkOworCisgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgIHJldHVybiAwOworfQorCitpbnQgd2xhbl9oZGRfdGRsc19zZXRfZm9yY2VfcGVlcihoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqbWFjLAorI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICptYWMsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfQk9PTEVBTiBmb3JjZVBlZXIpCit7CisgICAgLyogTk9URToKKyAgICAgKiBIb2xkIG11dGV4IHRkbHNfbG9jayBiZWZvcmUgY2FsbGluZyB0aGlzIGZ1bmN0aW9uCisgICAgICovCisgICAgaGRkVGRsc1BlZXJfdCAqY3Vycl9wZWVyOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKworICAgIGlmICgoTlVMTCA9PSBwSGRkQ3R4KSkgcmV0dXJuIC0xOworCisgICAgY3Vycl9wZWVyID0gd2xhbl9oZGRfdGRsc19maW5kX3BlZXIocEFkYXB0ZXIsIG1hYywgRkFMU0UpOworICAgIGlmIChjdXJyX3BlZXIgPT0gTlVMTCkKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICBjdXJyX3BlZXItPmlzRm9yY2VkUGVlciA9IGZvcmNlUGVlcjsKKworICAgIHJldHVybiAwOworZXJyb3I6CisgICAgcmV0dXJuIC0xOworfQorCisvKiBpZiBwZWVyTWFjIGlzIGZvdW5kLCB0aGVuIGl0IHJldHVybnMgcG9pbnRlciB0byBoZGRUZGxzUGVlcl90CisgICBvdGhlcndpc2UsIGl0IHJldHVybnMgTlVMTAorKi8KK2hkZFRkbHNQZWVyX3QgKndsYW5faGRkX3RkbHNfZmluZF9wZWVyKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICptYWMsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggKm1hYywKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9CT09MRUFOIG11dGV4TG9jaykKK3sKKyAgICB1OCBrZXk7CisgICAgc3RydWN0IGxpc3RfaGVhZCAqcG9zOworICAgIHN0cnVjdCBsaXN0X2hlYWQgKmhlYWQ7CisgICAgaGRkVGRsc1BlZXJfdCAqY3Vycl9wZWVyOworICAgIHRkbHNDdHhfdCAqcEhkZFRkbHNDdHg7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworCisgICAgaWYoMCAhPSAod2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KSkpCisgICAgeworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisKKyAgICBpZiAoIG11dGV4TG9jayApCisgICAgeworICAgICAgIG11dGV4X2xvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgfQorICAgIHBIZGRUZGxzQ3R4ID0gV0xBTl9IRERfR0VUX1RETFNfQ1RYX1BUUihwQWRhcHRlcik7CisgICAgaWYgKE5VTEwgPT0gcEhkZFRkbHNDdHgpCisgICAgeworICAgICAgICBpZiAoIG11dGV4TG9jayApCisgICAgICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICAgIGtleSA9IHdsYW5faGRkX3RkbHNfaGFzaF9rZXkobWFjKTsKKworICAgIGhlYWQgPSAmcEhkZFRkbHNDdHgtPnBlZXJfbGlzdFtrZXldOworCisgICAgbGlzdF9mb3JfZWFjaChwb3MsIGhlYWQpIHsKKyAgICAgICAgY3Vycl9wZWVyID0gbGlzdF9lbnRyeSAocG9zLCBoZGRUZGxzUGVlcl90LCBub2RlKTsKKyAgICAgICAgaWYgKCFtZW1jbXAobWFjLCBjdXJyX3BlZXItPnBlZXJNYWMsIDYpKSB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICJmaW5kVGRsc1BlZXI6IGZvdW5kIHN0YUlkICVkIiwgY3Vycl9wZWVyLT5zdGFJZCk7CisgICAgICAgICAgICBpZiAoIG11dGV4TG9jayApCisgICAgICAgICAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgICAgICAgICAgcmV0dXJuIGN1cnJfcGVlcjsKKyAgICAgICAgfQorICAgIH0KKyAgICBpZiAoIG11dGV4TG9jayApCisgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKworICAgIHJldHVybiBOVUxMOworfQorCitoZGRUZGxzUGVlcl90ICp3bGFuX2hkZF90ZGxzX2ZpbmRfYWxsX3BlZXIoaGRkX2NvbnRleHRfdCAqcEhkZEN0eCwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdTggKm1hYworI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCAqbWFjCisjZW5kaWYKKykKK3sKKyAgICBoZGRfYWRhcHRlcl9saXN0X25vZGVfdCAqcEFkYXB0ZXJOb2RlID0gTlVMTCwgKnBOZXh0ID0gTlVMTDsKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciA9IE5VTEw7CisgICAgdGRsc0N0eF90ICpwSGRkVGRsc0N0eCA9IE5VTEw7CisgICAgaGRkVGRsc1BlZXJfdCAqY3Vycl9wZWVyPSBOVUxMOworICAgIFZPU19TVEFUVVMgc3RhdHVzID0gMDsKKworICAgIG11dGV4X2xvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgc3RhdHVzID0gaGRkX2dldF9mcm9udF9hZGFwdGVyICggcEhkZEN0eCwgJnBBZGFwdGVyTm9kZSApOworICAgIHdoaWxlICggTlVMTCAhPSBwQWRhcHRlck5vZGUgJiYgVk9TX1NUQVRVU19TVUNDRVNTID09IHN0YXR1cyApCisgICAgeworICAgICAgICBwQWRhcHRlciA9IHBBZGFwdGVyTm9kZS0+cEFkYXB0ZXI7CisKKyAgICAgICAgcEhkZFRkbHNDdHggPSBXTEFOX0hERF9HRVRfVERMU19DVFhfUFRSKHBBZGFwdGVyKTsKKyAgICAgICAgaWYgKE5VTEwgIT0gcEhkZFRkbHNDdHgpCisgICAgICAgIHsKKyAgICAgICAgICAgIGN1cnJfcGVlciA9IHdsYW5faGRkX3RkbHNfZmluZF9wZWVyKHBBZGFwdGVyLCBtYWMsIEZBTFNFKTsKKyAgICAgICAgICAgIGlmIChjdXJyX3BlZXIpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgICAgICAgICAgICAgIHJldHVybiBjdXJyX3BlZXI7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgc3RhdHVzID0gaGRkX2dldF9uZXh0X2FkYXB0ZXIgKCBwSGRkQ3R4LCBwQWRhcHRlck5vZGUsICZwTmV4dCApOworICAgICAgICBwQWRhcHRlck5vZGUgPSBwTmV4dDsKKyAgICB9CisgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgIHJldHVybiBjdXJyX3BlZXI7Cit9CisKKworaW50IHdsYW5faGRkX3RkbHNfcmVzZXRfcGVlcihoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICptYWMKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICptYWMKKyNlbmRpZgorKQoreworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgaGRkVGRsc1BlZXJfdCAqY3Vycl9wZWVyOworCisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgoIHBBZGFwdGVyICk7CisKKyAgICBpZiAoMCAhPSAod2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KSkpCisgICAgICAgIHJldHVybiAtRUlOVkFMOworCisgICAgbXV0ZXhfbG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICBjdXJyX3BlZXIgPSB3bGFuX2hkZF90ZGxzX2dldF9wZWVyKHBBZGFwdGVyLCBtYWMpOworICAgIGlmIChjdXJyX3BlZXIgPT0gTlVMTCkKKyAgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogY3Vycl9wZWVyIGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKworICAgIHdsYW5faGRkX3RkbHNfc2V0X3BlZXJfbGlua19zdGF0dXMoY3Vycl9wZWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVRETFNfTElOS19JRExFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVRETFNfTElOS19VTlNQRUNJRklFRCk7CisgICAgY3Vycl9wZWVyLT5zdGFJZCA9IDA7CisKKyAgICAvKiBUaHJvdWdocHV0IE1vbml0b3Igc2hhbGwgZGlzYWJsZSB0aGUgc3BsaXQgc2NhbiB3aGVuCisgICAgICogVERMUyBzY2FuIGNvZXhpc3RhbmNlIGlzIGRpc2FibGVkLkF0IHRoaXMgcG9pbnQgb2YgdGltZQorICAgICAqIHNpbmNlIFRETFMgc2NhbiBjb2V4aXN0YW5jZSBpcyBub3QgbWVldGluZyB0aGUgY3JpdGVyaWEKKyAgICAgKiB0byBiZSBvcGVyYXRpb25hbCwgZXhwbGljaXRseSBtYWtlIGl0IGZhbHNlIHRvIGVuYWJsZQorICAgICAqIHRocm91Z2hwdXQgbW9uaXRvciB0YWtlcyB0aGUgY29udHJvbCBvZiBzcGxpdCBzY2FuLgorICAgICAqLworICAgIGlmIChwSGRkQ3R4LT5pc1RkbHNTY2FuQ29leGlzdGVuY2UgPT0gVFJVRSkKKyAgICB7CisgICAgICAgIHBIZGRDdHgtPmlzV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gICAgICBsaXN0X2Zvcl9lYWNoX3NhZmUgKHBvcywgcSwgaGVhZCkgeworICAgICAgICAgICAgdG1wID0gbGlzdF9lbnRyeShwb3MsIGhkZFRkbHNQZWVyX3QsIG5vZGUpOworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAiJXMsICVkLCAiIE1BQ19BRERSRVNTX1NUUiwgX19mdW5jX18sIGksCisgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkodG1wLT5wZWVyTWFjKSk7CisgICAgICAgICAgICBkaXNjb3ZlcnlfcGVlcl9jbnQrKzsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gZGlzY292ZXJ5X3BlZXJfY250OworfQorCit0QU5JX1UxNiB3bGFuX2hkZF90ZGxzQ29ubmVjdGVkUGVlcnMoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIpCit7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IE5VTEw7CisKKyAgICBpZiAoKE5VTEwgPT0gcEFkYXB0ZXIpIHx8IChXTEFOX0hERF9BREFQVEVSX01BR0lDICE9IHBBZGFwdGVyLT5tYWdpYykpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIEZMKCJpbnZhbGlkIHBBZGFwdGVyOiAlcCIpLCBwQWRhcHRlcik7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisKKyAgICBFTlRFUigpOworICAgIGlmKDAgIT0gKHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCkpKQorICAgIHsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorICAg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JyX3BlZXIgJiYgKGN1cnJfcGVlci0+bGlua19zdGF0dXMgPT0gZVRETFNfTElOS19DT05ORUNURUQpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogIiBNQUNfQUREUkVTU19TVFIgIiBlVERMU19MSU5LX0NPTk5FQ1RFRCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgTUFDX0FERFJfQVJSQVkoY3Vycl9wZWVyLT5wZWVyTWFjKSk7CisgICAgICAgICAgICAgICByZXR1cm4gY3Vycl9wZWVyOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgRVhJVCgpOworICAgIHJldHVybiBOVUxMOworfQorCitpbnQgd2xhbl9oZGRfdGRsc19nZXRfYWxsX3BlZXJzKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLCBjaGFyICpidWYsIGludCBidWZsZW4pCit7CisgICAgaW50IGk7CisgICAgaW50IGxlbiwgaW5pdF9sZW47CisgICAgc3RydWN0IGxpc3RfaGVhZCAqaGVhZDsKKyAgICBzdHJ1Y3QgbGlzdF9oZWFkICpwb3M7CisgICAgaGRkVGRsc1BlZXJfdCAqY3Vycl9wZWVyOworICAgIHRkbHNDdHhfdCAqcEhkZFRkbHNDdHg7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworCisgICAgRU5URVIoKTsKKyAgICBpZigwICE9ICh3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpKSkKKyAgICB7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIGluaXRfbGVuID0gYnVmbGVuOworICAgIGxlbiA9IHNjbnByaW50ZihidWYsIGJ1ZmxlbiwgIlxuJS0xOHMlLTNzJS00cyUtM3MlLTVzXG4iLAorICAgICAgICAgICAgIk1BQyIsICJJZCIsICJjYXAiLCAidXAiLCAiUlNTSSIpOworICAgIGJ1ZiArPSBsZW47CisgICAgYnVmbGVuIC09IGxlbjsKKyAgICAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1NjcgKi8KKyAgICBsZW4gPSBzY25wcmludGYoYnVmLCBidWZsZW4sICItLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cbiIpOworICAgIGJ1ZiArPSBsZW47CisgICAgYnVmbGVuIC09IGxlbjsKKworICAgIG11dGV4X2xvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgcEhkZFRkbHNDdHggPSBXTEFOX0hERF9HRVRfVERMU19DVFhfUFRSKHBBZGFwdGVyKTsKKyAgICBpZiAoTlVMTCA9PSBwSGRkVGRsc0N0eCkgeworICAgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisgICAgICAgIGxlbiA9IHNjbnByaW50ZihidWYsIGJ1ZmxlbiwgIlRETFMgbm90IGVuYWJsZWRcbiIpOworICAgICAgICByZXR1cm4gbGVuOworICAgIH0KKyAgICBmb3IgKGkgPSAwOyBpIDwgMjU2OyBpKyspIHsKKyAgICAgICAgaGVhZCA9ICZwSGRkVGRsc0N0eC0+cGVlcl9saXN0W2ldOworCisgICAgICAgIGxpc3RfZm9yX2VhY2gocG9zLCBoZWFkKSB7CisgICAgICAgICAgICBjdXJyX3BlZXI9IGxpc3RfZW50cnkgKHBvcywgaGRkVGRsc1BlZXJfdCwgbm9kZSk7CisKKyAgICAgICAgICAgIGlmIChidWZsZW4gPCAzMisxKQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgbGVuID0gc2NucHJpbnRmKGJ1ZiwgYnVmbGVuLAorICAgICAgICAgICAgICAgIE1BQ19BRERSRVNTX1NUUiIlM2QlNHMlM3MlNWRcbiIsCisgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkoY3Vycl9wZWVyLT5wZWVyTWFjKSwKKyAgICAgICAgICAgICAgICBjdXJyX3BlZXItPnN0YUlkLAorICAgICAgICAgICAgICAgIChjdXJyX3BlZXItPnRkbHNfc3VwcG9ydCA9PSBlVERMU19DQVBfU1VQUE9SVEVEKSA/ICJZIjoiTiIsCisgICAgICAgICAgICAgICAgVERMU19JU19DT05ORUNURUQoY3Vycl9wZWVyKSA/ICJZIjoiTiIsCisgICAgICAgICAgICAgICAgY3Vycl9wZWVyLT5yc3NpKTsKKyAgICAgICAgICAgIGJ1ZiArPSBsZW47CisgICAgICAgICAgICBidWZsZW4gLT0gbGVuOworICAgICAgICB9CisgICAgfQorICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gaW5pdF9sZW4tYnVmbGVuOworfQorCit2b2lkIHdsYW5faGRkX3RkbHNfY29ubmVjdGlvbl9jYWxsYmFjayhoZGRfYWRhcHRlcl90ICpwQWRhcHRlcikKK3sKKyAgICB0ZGxzQ3R4X3QgKnBIZGRUZGxzQ3R4OworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKworICAgIGlmICgoTlVMTCA9PSBwSGRkQ3R4KSkKKyAgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgIEZMKCJwSGRkQ3R4IG9yICBwSGRkVGRsc0N0eCBwb2ludHMgdG8gTlVMTCIpKTsKKyAgICAgICByZXR1cm47CisgICAgfQorCisgICAgbXV0ZXhfbG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKworICAgIGlmICgwICE9IHdsYW5faGRkX3N0YV90ZGxzX2lu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dW5sb2NrKCZwSGRkQ3R4LT50ZGxzX2xvY2spOworICAgICAgICBpZiAoRkFMU0UgPT0gc21lX0lzUG1jQm1wcyhXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlcikpKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBObyBURExTIHBlZXIgY29ubmVjdGVkL2Rpc2NvdmVyeSBzZW50LiBFbmFibGUgQk1QUyIsCisgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgICAgIGhkZF9lbmFibGVfYm1wc19pbXBzKHBIZGRDdHgpOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICAgICAgaWYgKFRSVUUgPT0gc21lX0lzUG1jQm1wcyhXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlcikpKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBURExTIHBlZXIgY29ubmVjdGVkLiBEaXNhYmxlIEJNUFMiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICBoZGRfZGlzYWJsZV9ibXBzX2ltcHMocEhkZEN0eCwgV0xBTl9IRERfSU5GUkFfU1RBVElPTik7CisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuOworfQorCit1OCB3bGFuX2hkZF90ZGxzX2lzX3BlZXJfcHJvZ3Jlc3MoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsIHU4ICptYWMpCit7CisgICAgaGRkVGRsc1BlZXJfdCAqY3Vycl9wZWVyOworCisgICAgY3Vyc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GNvbnN0IHU4ICptYWMsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICptYWMsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCBza2lwX3NlbGYpCit7CisgICAgaW50IGk7CisgICAgc3RydWN0IGxpc3RfaGVhZCAqaGVhZDsKKyAgICBoZGRUZGxzUGVlcl90ICpjdXJyX3BlZXI7CisgICAgc3RydWN0IGxpc3RfaGVhZCAqcG9zOworICAgIHRkbHNDdHhfdCAqcEhkZFRkbHNDdHggPSBXTEFOX0hERF9HRVRfVERMU19DVFhfUFRSKHBBZGFwdGVyKTs7CisKKyAgICBpZiAoTlVMTCA9PSBwSGRkVGRsc0N0eCkKKyAgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgRkwoInBIZGRUZGxzQ3R4IGlzIE5VTEwiKSk7CisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICAgIGZvciAoaSA9IDA7IGkgPCAyNTY7IGkrKykgeworICAgICAgICBoZWFkID0gJnBIZGRUZGxzQ3R4LT5wZWVyX2xpc3RbaV07CisgICAgICAgIGxpc3RfZm9yX2VhY2gocG9zLCBoZWFkKSB7CisgICAgICAgICAgICBjdXJyX3BlZXIgPSBsaXN0X2VudHJ5IChwb3MsIGhkZFRkbHNQZWVyX3QsIG5vZGUpOworICAgICAgICAgICAgaWYgKHNraXBfc2VsZiAmJiBtYWMgJiYgIW1lbWNtcChtYWMsIGN1cnJfcGVlci0+cGVlck1hYywgNikpIHsKKyAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoZVRETFNfTElOS19DT05ORUNUSU5HID09IGN1cnJfcGVlci0+bGlua19zdGF0dXMpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IiBNQUNfQUREUkVTU19TVFIgIiBlVERMU19MSU5LX0NPTk5FQ1RJTkciLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBNQUNfQUREUl9BUlJBWShjdXJyX3BlZXItPnBlZXJNYWMpKTsKKyAgICAgICAgICAgICAgICAgIHJldHVybiBjdXJyX3BlZXI7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIHJldHVybiBOVUxMOworfQorCitoZGRUZGxzUGVlcl90ICp3bGFuX2hkZF90ZGxzX2lzX3Byb2dyZXNzKGhkZF9jb250ZXh0X3QgKnBIZGRDdHgsCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqbWFjLAorI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggKm1hYywKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCBza2lwX3NlbGYsIHRBTklfQk9PTEVBTiBtdXRleExvY2spCit7CisgICAgaGRkX2FkYXB0ZXJfbGlzdF9ub2RlX3QgKnBBZGFwdGVyTm9kZSA9IE5VTEwsICpwTmV4dCA9IE5VTEw7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgPSBOVUxMOworICAgIHRkbHNDdHhfdCAqcEhkZFRkbHNDdHggPSBOVUxMOworICAgIGhkZFRkbHNQZWVyX3QgKmN1cnJfcGVlcj0gTlVMTDsKKyAgICBWT1NfU1RBVFVTIHN0YXR1cyA9IDA7CisKKyAgICBpZiAobXV0ZXhMb2NrKQorICAgIHsKKyAgICAgICAgbXV0ZXhfbG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICB9CisgICAgc3RhdHVzID0gaGRkX2dldF9mcm9udF9hZGFwdGVyICggcEhkZEN0eCwgJnBBZGFwdGVyTm9kZSApOworICAgIHdoaWxlICggTlVMTCAhPSBwQWRhcHRlck5vZGUgJiYgVk9TX1NUQVRVU19TVUNDRVNTID09IHN0YXR1cyApCisgICAgeworICAgICAgICBwQWRhcHRlciA9IHBBZGFwdGVyTm9kZS0+cEFkYXB0ZXI7CisKKyAgICAgICAgcEhkZFRkbHNDdHggPSBXTEFOX0hERF9HRVRfVERMU19DVFhfUFRSKHBBZGFwdGVyKTsKKyAgICAgICAgaWYgKE5VTEwgIT0gcEhkZFRkbHNDdHgpCisgICAgICAgIHsKKyAgICAgICAgICAgIGN1cnJfcGVlciA9IHdsYW5faGRkX3RkbHNfZmluZF9wcm9ncmVzc19wZWVyKHBBZGFwdGVyLCBtYWMsIHNraXBfc2VsZik7CisgICAgICAgICAgICBpZiAoY3Vycl9wZWVyKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChtdXRleExvY2spCisgICAgICAgICAgICAgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gY3Vycl9wZWVyOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHN0YXR1cyA9IGhkZF9nZXRfbmV4dF9hZGFwdGVyICggcEhkZEN0eCwgcEFkYXB0ZXJOb2RlLCAmcE5leHQgKTsKKyAgICAgICAgcEFkYXB0ZXJOb2RlID0gcE5leHQ7CisgICAgfQorICAgIGlmIChtdXRleExvY2spCisgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICBy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ck5vZGUgPSBOVUxMLCAqcE5leHQgPSBOVUxMOworICAgIFZPU19TVEFUVVMgc3RhdHVzOworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyOworICAgIHRkbHNDdHhfdCAqcEhkZFRkbHNDdHg7CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICIlcyBtb2RlICVkIiwgX19mdW5jX18sIChpbnQpdGRsc19tb2RlKTsKKworICAgIGlmKDAgIT0gKHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCkpKQorICAgIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIG11dGV4X2xvY2soJnBIZGRDdHgtPnRkbHNfbG9jayk7CisKKyAgICBpZiAocEhkZEN0eC0+dGRsc19tb2RlID09IHRkbHNfbW9kZSkKKyAgICB7CisgICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXMgYWxyZWFkeSBpbiBtb2RlICVkIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludCl0ZGxzX21vZGUpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgc3RhdHVzID0gaGRkX2dldF9mcm9udF9hZGFwdGVyICggcEhkZEN0eCwgJnBBZGFwdGVyTm9kZSApOworCisgICAgd2hpbGUgKCBOVUxMICE9IHBBZGFwdGVyTm9kZSAmJiBWT1NfU1RBVFVTX1NVQ0NFU1MgPT0gc3RhdHVzICkKKyAgICB7CisgICAgICAgcEFkYXB0ZXIgPSBwQWRhcHRlck5vZGUtPnBBZGFwdGVyOworICAgICAgIHBIZGRUZGxzQ3R4ID0gV0xBTl9IRERfR0VUX1RETFNfQ1RYX1BUUihwQWRhcHRlcik7CisgICAgICAgaWYg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SU9OKTsKKyAgICB9CisKKyAgICAvKiBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCBpbiBtdXRleF9sb2NrICovCisgICAgdGVtcF9wZWVyID0gd2xhbl9oZGRfdGRsc19pc19wcm9ncmVzcyhwSGRkQ3R4LCBOVUxMLCAwLCBGQUxTRSk7CisgICAgaWYgKE5VTEwgIT0gdGVtcF9wZWVyKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAiJXM6ICIgTUFDX0FERFJFU1NfU1RSICIgb25nb2luZy4gcHJlX3NldHVwIGlnbm9yZWQiLAorICAgICAgICAgICAgICAgICAgX19mdW5jX18sIE1BQ19BRERSX0FSUkFZKHRlbXBfcGVlci0+cGVlck1hYykpOworICAgICAgICBnb3RvIGRvbmU7CisgICAgfQorCisgICAgaWYgKGVURExTX0NBUF9VTktOT1dOICE9IGN1cnJfcGVlci0+dGRsc19zdXBwb3J0KQorICAgICAgICB3bGFuX2hkZF90ZGxzX3NldF9wZWVyX2xpbmtfc3RhdHVzKGN1cnJfcGVlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlVERMU19MSU5LX0RJU0NPVkVSSU5HLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVURExTX0xJTktfU1VDQ0VTUyk7CisKKyAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAiJXM6IEltcGxpY2l0IFRETFMsIFNlbmQgRGlzY292ZXJ5IHJlcXVlc3QgZXZlbnQiLCBfX2Z1bmNfXyk7CisKKyAgICBjZmc4MDIxMV90ZGxzX29wZXJfcmVxdWVzdChwSGRkVGRsc0N0eC0+cEFkYXB0ZXItPmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vycl9wZWVyLT5wZWVyTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOTDgwMjExX1RETFNfRElTQ09WRVJZX1JFUSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkFMU0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdGUF9LRVJORUwpOworICAgIHBIZGRUZGxzQ3R4LT5kaXNjb3Zlcnlfc2VudF9jbnQrKzsKKworICAgIHdsYW5faGRkX3RkbHNfY2hlY2tfcG93ZXJfc2F2ZV9wcm9oaWJpdGVkKHBIZGRUZGxzQ3R4LT5wQWRhcHRlcik7CisKKyAgICB3bGFuX2hkZF90ZGxzX3RpbWVyX3Jlc3RhcnQocEhkZFRkbHNDdHgtPnBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEhkZFRkbHNDdHgtPnBlZXJEaXNjb3ZlcnlUaW1lb3V0VGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRUZGxzQ3R4LT50aHJlc2hvbGRfY29uZmlnLnR4X3BlcmlvZF90IC0gVERMU19ESVNDT1ZFUllfVElNRU9VVF9CRUZPUkVfVVBEQVRFKTsKKworICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICIlczogZGlzY292ZXJ5IGNvdW50ICV1IHRpbWVvdXQgJXUgbXNlYyIsCisgICAgICAgICAgICAgIF9fZnVuY19fLCBwSGRkVGRsc0N0eC0+ZGlzY292ZXJ5X3NlbnRfY250LAorICAgICAgICAgICAgICBwSGRkVGRsc0N0eC0+dGhyZXNob2xkX2NvbmZpZy50eF9wZXJpb2RfdCAtIFRETFNfRElTQ09WRVJZX1RJTUVPVVRfQkVGT1JFX1VQREFURSk7CisKK2RvbmU6CisgICAgcEhkZFRkbHNDdHgtPmN1cnJfY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gICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGNmZzgwMjExX3NjYW5fcmVxdWVzdCAqcmVxdWVzdCkKK3sKKyAgICB0ZGxzX3NjYW5fY29udGV4dF90ICpzY2FuX2N0eDsKKworICAgIEVOVEVSKCk7CisgICAgaWYoMCAhPSAod2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KSkpCisgICAgeworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisKKyAgICBzY2FuX2N0eCA9ICZwSGRkQ3R4LT50ZGxzX3NjYW5fY3R4dDsKKworICAgIHNjYW5fY3R4LT53aXBoeSA9IHdpcGh5OworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPCBLRVJORUxfVkVSU0lPTigzLDYsMCkpCisgICAgc2Nhbl9jdHgtPmRldiA9IGRldjsKKyNlbmRpZgorCisgICAgc2Nhbl9jdHgtPnNjYW5fcmVxdWVzdCA9IHJlcXVlc3Q7CisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIDA7Cit9CisKK3N0YXRpYyB2b2lkIHdsYW5faGRkX3RkbHNfc2Nhbl9pbml0X3dvcmsoaGRkX2NvbnRleHRfdCAqcEhkZEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHdpcGh5ICp3aXBoeSwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFIDwgS0VSTkVMX1ZFUlNJT04oMyw2LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBjZmc4MDIxMV9zY2FuX3JlcXVlc3QgKnJlcXVlc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZGVsYXkpCit7CisgICAgaWYgKFRETFNfQ1RYX01BR0lDICE9IHBIZGRDdHgtPnRkbHNfc2Nh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FVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAiJXM6ICIgTUFDX0FERFJFU1NfU1RSICIuIHNjYW4gcmVqZWN0ZWQgJWQuIGZvcmNlIGl0IHRvIGlkbGUiLAorICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgTUFDX0FERFJfQVJSQVkgKGN1cnJfcGVlci0+cGVlck1hYyksIHBIZGRDdHgtPnRkbHNfc2Nhbl9jdHh0LnJlamVjdCk7CisKKyAgICAgICAgICAgIHdsYW5faGRkX3RkbHNfc2V0X3BlZXJfbGlua19zdGF0dXMgKGN1cnJfcGVlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVURExTX0xJTktfSURMRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVURExTX0xJTktfVU5TUEVDSUZJRUQpOworICAgICAgICAgICAgcmV0dXJuIDE7CisgICAgICAgIH0KKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAiJXM6IHRkbHMgaW4gcHJvZ3Jlc3MuIHNjYW4gcmVqZWN0ZWQgJWQiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fLCBwSGRkQ3R4LT50ZGxzX3NjYW5fY3R4dC5yZWplY3QpOworICAgICAgICByZXR1cm4gLUVCVVNZOworICAgIH0KKworICAgIC8qIHRkbHMgdGVhcmRvd24gaXMgb25nb2luZyAqLworICAgIGlmIChlVERMU19TVVBQT1JUX0RJU0FCTEVEID09IHBIZGRDdHgtPnRkbHNfbW9kZSkKKyAgICB7CisgICAgICAgIGNvbm5lY3RlZFRkbHNQZWVycyA9IHdsYW5faGRkX3RkbHNDb25uZWN0ZWRQZWVycyhwQWRhcHRlcik7CisgICAgICAgIGlmIChjb25uZWN0ZWRUZGxzUGVlcnMgJiYgKHBIZGRDdHgtPnRkbHNfc2Nhbl9jdHh0LmF0dGVtcHQgPCBURExTX01BWF9TQ0FOX1NDSEVEVUxFKSkKKyAgICAgICAgeworICAgICAgICAgICAgZGVsYXkgPSAodW5zaWduZWQgbG9uZykoVERMU19ERUxBWV9TQ0FOX1BFUl9DT05ORUNUSU9OKmNvbm5lY3RlZFRkbHNQZWVycyk7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAiJXM6IHRkbHMgZGlzYWJsZWQsIGJ1dCBzdGlsbCBjb25uZWN0ZWRfcGVlcnMgJWQgYXR0ZW1wdCAlZC4gc2NoZWR1bGUgc2NhbiAlbHUgbXNlYyIsCisgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBjb25uZWN0ZWRUZGxzUGVlcnMsIHBIZGRDdHgtPnRkbHNfc2Nhbl9jdHh0LmF0dGVtcHQsIGRlbGF5KTsKKworICAgICAgICAgICAgd2xhbl9oZGRfdGRsc19zY2FuX2luaXRfd29yayAocEhkZEN0eCwgd2lwaHksCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA8IEtFUk5FTF9WRVJTSU9OKDMsNiwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRldiwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoZGVsYXkpKTsKKyAgICAgICAgICAgIC8qIHNjYW4gc2hvdWxkIG5vdCBjb250aW51ZSAqLworICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIH0KKyAgICAgICAgLyogbm8gY29ubmVjdGVkIHBlZXIgb3IgbWF4IHJldHJ5IHJlYWNoZWQsIHNjY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ICovCisgICAgZWxzZSBpZiAoZVRETFNfU1VQUE9SVF9FTkFCTEVEID09IHBIZGRDdHgtPnRkbHNfbW9kZSB8fAorICAgICAgICBlVERMU19TVVBQT1JUX0VYUExJQ0lUX1RSSUdHRVJfT05MWSA9PSBwSGRkQ3R4LT50ZGxzX21vZGUpCisgICAgeworICAgICAgICBjb25uZWN0ZWRUZGxzUGVlcnMgPSB3bGFuX2hkZF90ZGxzQ29ubmVjdGVkUGVlcnMocEFkYXB0ZXIpOworCisgICAgICAgIC8qIGNoZWNrIHRoZSBURExTIGxpbmsgYW5kIFNjYW4gY29leGlzdGFuY2UgQ2FwYWJpbGl0eSAqLworICAgICAgICBpZiAoIChUUlVFID09IHBIZGRDdHgtPmNmZ19pbmktPmZFbmFibGVURExTU2NhbkNvZXhTdXBwb3J0KSAmJgorICAgICAgICAgICAgIChUUlVFID09IHNtZV9Jc0ZlYXR1cmVTdXBwb3J0ZWRCeUZXKFRETFNfU0NBTl9DT0VYSVNURU5DRSkpICYmCisgICAgICAgICAgICAgKGNvbm5lY3RlZFRkbHNQZWVycyA9PSAxKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIGdldCBjb25uZWN0ZWQgcGVlciBpbmZvcm1hdGlvbiAqLworICAgICAgICAgICAgY29ubmVjdGVkX3BlZXIgPSB3bGFuX2hkZF90ZGxzX2dldF9jb25uZWN0ZWRfcGVlcihwQWRhcHRlcik7CisgICAgICAgICAgICBpZiAoTlVMTCA9PSBjb25uZWN0ZWRfcGVlcikgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgY29ubmVjdGVkX3BlZXIsIENvbnRpbnVlIFNjYW5uaW5nIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgIC8qIHNjYW4gc2hvdWxkIGNvbnRpbnVlICovCisgICAgICAgICAgICAgICAgcmV0dXJuIDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICgiJXM6IFRETFMgU2NhbiBDby1leGlzdCBzdXBwb3J0ZWQgY29ubmVjdGVkVGRsc1BlZXJzID0lZCBidWZmZXJzdGEgPSVkIiksCisgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLGNvbm5lY3RlZFRkbHNQZWVycyxjb25uZWN0ZWRfcGVlci0+aXNCdWZTdGEpOworCisgICAgICAgICAgICBpZiAoY29ubmVjdGVkX3BlZXItPmlzQnVmU3RhKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBwSGRkQ3R4LT5pc1RkbHNTY2FuQ29leGlzdGVuY2UgPSBUUlVFOworICAgICAgICAgICAgICAgICBpZiAoKGNmZ19wYXJhbS0+ZHluU3BsaXRzY2FuKSAmJiAoIXBIZGRDdHgtPmlzc3BsaXRzY2FuX2VuYWJsZWQpKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT5pc3NwbGl0c2Nhbl9lbmFibGVkID0gVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtZV9lbmFibGVfZGlzYWJsZV9zcGxpdF9zY2FuKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNmZ19wYXJhbS0+bk51bVN0YUNoYW5Db21iaW5lZENvbmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNmZ19wYXJhbS0+bk51bVAyUENoYW5Db21iaW5lZENvbmMpOworICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAoIiVzOiVkIFRETFMgU2NhbiBDby1leGlzdCBzdXBwb3J0ZWQgc3BsaXRzY2FuX2VuYWJsZWQgPSVkICIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywgcEhkZEN0eC0+aXNzcGxpdHNjYW5fZW5hYmxlZCk7CisgICAgICAgICAgICAgICAgIHJldHVybiAxOworICAgICAgICAgICAgfQorCisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvKiBUaHJvdWdocHV0IE1vbml0b3Igc2hhbGwgZGlzYWJsZSB0aGUgc3BsaXQgc2NhbiB3aGVuCisgICAgICAgICAgICAgKiBURExTIHNjYW4gY29leGlzdGFuY2UgaXMgZGlzYWJsZWQuQXQgdGhpcyBwb2ludCBvZiB0aW1lCisgICAgICAgICAgICAgKiBzaW5jZSBURExTIHNjYW4gY29leGlzdGFuY2UgaXMgbm90IG1lZXRpbmcgdGhlIGNyaXRlcmlhCisgICAgICAgICAgICAgKiB0byBiZSBvcGVyYXRpb25hbCwgZXhwbGljaXRseSBtYWtlIGl0IGZhbHNlIHRvIGVuYWJsZQorICAgICAgICAgICAgICogdGhyb3VnaHB1dCBtb25pdG9yIHRha2VzIHRoZSBjb250cm9sIG9mIHNwbGl0IHNjYW4uCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHBIZGRDdHgtPmlzVGRsc1NjYW5Db2V4aXN0ZW5jZSA9IEZBTFNFOworICAgICAgICB9CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAoIiVzOiBURExTIFNjYW4gQ28tZXhpc3Qgbm90IHN1cHBvcnRlZCBjb25uZWN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N0ZWRUZGxzUGVlcnMpCisgICAgICAgIHsKKyAgICAgICAgICAgIHRBTklfVTggc3RhSWR4OworICAgICAgICAgICAgaGRkVGRsc1BlZXJfdCAqY3Vycl9wZWVyOworCisgICAgICAgICAgICBmb3IgKHN0YUlkeCA9IDA7IHN0YUlkeCA8IEhERF9NQVhfTlVNX1RETFNfU1RBOyBzdGFJZHgrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAocEhkZEN0eC0+dGRsc0Nvbm5JbmZvW3N0YUlkeF0uc3RhSWQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIiVzOiBpbmRpY2F0ZSBURExTIHRlYXJkb3duIChzdGFJZCAlZCkiKSwgX19mdW5jX18sIHBIZGRDdHgtPnRkbHNDb25uSW5mb1tzdGFJZHhdLnN0YUlkKSA7CisKKyNpZmRlZiBDT05GSUdfVERMU19JTVBMSUNJVAorICAgICAgICAgICAgICAgICAgICBjdXJyX3BlZXIgPSB3bGFuX2hkZF90ZGxzX2ZpbmRfYWxsX3BlZXIocEhkZEN0eCwgcEhkZEN0eC0+dGRsc0Nvbm5JbmZvW3N0YUlkeF0ucGVlck1hYy5ieXRlcyk7CisgICAgICAgICAgICAgICAgICAgIGlmKGN1cnJfcGVlcikKKyAgICAgICAgICAgICAgICAgICAgICAgIHdsYW5faGRkX3RkbHNfaW5kaWNhdGVfdGVhcmRvd24oY3Vycl9wZWVyLT5wSGRkVGRsc0N0eC0+cEFkYXB0ZXIsIGN1cnJfcGVlciwgZVNJUl9NQUNfVERMU19URUFSRE9XTl9VTlNQRUNfUkVBU09OKTsKKyNlbmRpZgorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8qIHNjaGVkdWxlIHNjYW4gKi8KKyAgICAgICAgICAgIGRlbGF5ID0gKHVuc2lnbmVkIGxvbmcpKFRETFNfREVMQVlfU0NBTl9QRVJfQ09OTkVDVElPTipjb25uZWN0ZWRUZGxzUGVlcnMpOworCisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAiJXM6IHRkbHMgZW5hYmxlZCAobW9kZSAlZCksIGNvbm5lY3RlZF9wZWVycyAlZC4gc2NoZWR1bGUgc2NhbiAlbHUgbXNlYyIsCisgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBwSGRkQ3R4LT50ZGxzX21vZGUsIHdsYW5faGRkX3RkbHNDb25uZWN0ZWRQZWVycyhwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgIGRlbGF5KTsKKworICAgICAgICAgICAgd2xhbl9oZGRfdGRsc19zY2FuX2luaXRfd29yayAocEhkZEN0eCwgd2lwaHksCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA8IEtFUk5FTF9WRVJTSU9OKDMsNiwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRldiwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoZGVsYXkpKTsKKyAgICAgICAgICAgIC8qIHNjYW4gc2hvdWxkIG5vdCBjb250aW51ZSAqLworICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIH0KKyAgICAgICAgLyogbm8gY29ubmVjdGVkIHBlZXIsIHNjYW4gY29udGludWUgKi8KKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAiJXM6I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UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICBGTCgicEhkZFN0YUN0eCBpcyBOVUxMIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgLyogQ2hlY2sgd2hldGhlciBkcml2ZXIgbG9hZCB1bmxvYWQgaXMgaW4gcHJvZ3Jlc3MgKi8KKyAgICBpZih2b3NfaXNfbG9hZF91bmxvYWRfaW5fcHJvZ3Jlc3MoIFZPU19NT0RVTEVfSURfVk9TUywgTlVMTCkpCisgICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IERyaXZlciBsb2FkL3VubG9hZCBpcyBpbiBwcm9ncmVzcy4iLCBfX2Z1bmNfXyk7CisgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmIChoZGRfY29ubklzQ29ubmVjdGVkKHBIZGRTdGFDdHgpKQorICAgIHsKKyAgICAgICAgdm9zX3RpbWVyX3N0b3AodGltZXIpOworICAgICAgICB2b3NfdGltZXJfc3RhcnQodGltZXIsIGV4cGlyYXRpb25UaW1lKTsKKyAgICB9Cit9Cit2b2lkIHdsYW5faGRkX3RkbHNfaW5kaWNhdGVfdGVhcmRvd24oaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGRkVGRsc1BlZXJfdCAqY3Vycl9wZWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTE2IHJlYXNvbikKK3sKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworCisgICAgaWYgKChOVUxMID09IHBBZGFwdGVyIHx8IFdMQU5fSEREX0FEQVBURVJfTUFHSUMgIT0gcEFkYXB0ZXItPm1hZ2ljKSB8fAorIC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hdHVzKGN1cnJfcGVlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVURExTX0xJTktfVEVBUklORywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVURExTX0xJTktfVU5TUEVDSUZJRUQpOworICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICBGTCgiU2V0dGluZyBOTDgwMjExX1RETFNfVEVBUkRPV04sIHJlYXNvbiAlZCIpLCByZWFzb24pOworICAgIGNmZzgwMjExX3RkbHNfb3Blcl9yZXF1ZXN0KHBBZGFwdGVyLT5kZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vycl9wZWVyLT5wZWVyTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5MODAyMTFfVERMU19URUFSRE9XTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWFzb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR0ZQX0tFUk5FTCk7Cit9CisKKworLypFWFQgVERMUyovCitpbnQgd2xhbl9oZGRfc2V0X2NhbGxiYWNrKGhkZFRkbHNQZWVyX3QgKmN1cnJfcGVlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjZmc4MDIxMV9leHR0ZGxzX2NhbGxiYWNrIGNhbGxiYWNrKQoreworICAgIC8qIE5PVEU6CisgICAgICogSG9sZCBtdXRleCB0ZGxzX2xvY2sgYmVmb3JlIGNhbGxpbmcgdGhpcyBmdW5jdGlvbgorICAgICAqLworCisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgICBoZGRfYWRhcHRlcl90ICAgKnBBZGFwdGVyOworCisgICAgaWYgKCFjdXJyX3BlZXIpIHJldHVybiAtMTsKKworICAgIHBBZGFwdGVyID0gY3Vycl9wZWVyLT5wSGRkVGRsc0N0eC0+cEFkYXB0ZXI7CisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIGlmICgoTlVMTCA9PSBwSGRkQ3R4KSkgcmV0dXJuIC0xOworCisgICAgY3Vycl9wZWVyLT5zdGF0ZV9jaGFuZ2Vfbm90aWZpY2F0aW9uID0gY2FsbGJhY2s7CisKKyAgICByZXR1cm4gMDsKK30KKwordm9pZCB3bGFuX2hkZF90ZGxzX2dldF93aWZpX2hhbF9zdGF0ZShoZGRUZGxzUGVlcl90ICpjdXJyX3BlZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfUzMyICpzdGF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9TMzIgKnJlYXNvbikKK3sKKyAgICAqcmVhc29uID0gY3Vycl9wZWVyLT5yZWFzb247CisKKyAgICBzd2l0Y2goY3Vycl9wZWVyLT5saW5rX3N0YXR1cykKKyAgICB7CisgICAgICAgIGNhc2UgZVRETFNfTElOS19JRExFOgorICAgICAgICBjYXNlIGVURExTX0xJTktfRElTQ09WRVJFRDoKKyAgICAgICAgICAgICpzdGF0ZSA9IFdJRklfVERMU19FTkFCTEVEOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZVRETFNfTElOS19ESVNDT1ZFUklORzoKKyAgICAgICAgY2FzZSBlVERMU19MSU5LX0NPTk5FQ1RJTkc6CisgICAgICAgICAgICAqc3RhdGUgPSBXSUZJX1RETFNfVFJZSU5HOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZVRETFNfTElOS19DT05ORUNURUQ6CisgICAgICAgICAgICBpZiAoVFJVRSA9PSBjdXJyX3BlZXItPmlzT2ZmQ2hhbm5lbEVzdGFibGlzaGVkKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICpzdGF0ZSA9IFdJRklfVERMU19FU1RBQkxJU0hFRF9PRkZfQ0hBTk5FTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAqc3RhdGUgPSBXSUZJX1RETFNfRVNUQUJMSVNIRUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlVERMU19MSU5LX1RFQVJJTkc6CisgICAgICAgICAgICAqc3RhdGUgPSBXSUZJX1RETFNfRFJPUFBFRDsKKyAgICAgICAgICAgIGJyZWFrOworICAgIH0KKworfQorCitpbnQgd2xhbl9oZGRfdGRsc19nZXRfc3RhdHVzKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdEFOSV9VOCogbWFjLAorI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCogbWFjLAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfUzMyICpzdGF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9TMzIgKnJlYXNvbikKK3sKKworICAgIGhkZFRkbHNQZWVyX3QgKmN1cnJfcGVlcjsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgY3Vycl9wZWVyID0gd2xhbl9oZGRfdGRsc19maW5kX3BlZXIocEFkYXB0ZXIsIG1hYywgVFJVRSk7CisgICAgaWYgKGN1cnJfcGVlciA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIEZMKCJjdXJyX3BlZXIgaXMgTlVMTCIpKTsKKworICAgICAgICAqc3RhdGUgPSBXSUZJX1RETFNfRElTQUJMRUQ7CisgICAgICAgICpyZWFzb24gPSBlVERMU19MSU5LX1VOU1BFQ0lGSUVEOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBpZiAocEhkZEN0eC0+Y2ZnX2luaS0+ZlRETFNFeHRlcm5hbENvbnRyb2wgJiYKKyAgICAgICAgICAgKEZBTFNFID09IGN1cnJfcGVlci0+aXNGb3JjZWRQZWVyKSkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgRkwoImN1cnJfcGVlciBpcyBub3QgRm9yY2VkIikpOworICAgICAgICAgICAgKnN0YXRlID0gV0lGSV9URExTX0RJU0FCTEVEOworICAgICAgICAgICAgKnJlYXNvbiA9IGVURExTX0xJTktfVU5TUEVDSUZJRUQ7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICB3bGFuX2hkZF90ZGxzX2dldF93aWZpX2hhbF9zdGF0ZShjdXJyX3BlZXIsIHN0YXRlLCByZWFzb24pOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiAoMCk7Cit9CisKK2ludCBoZGRfc2V0X3RkbHNfc2Nhbl90eXBlKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnB0cikKK3sKKyAgICBpbnQgdGRsc19zY2FuX3R5cGU7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgICBpZiAoTlVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBwQWRhcHRlciBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDs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1IsCisgICAgICAgICAgICAgICAgICBGTCgiVERMUyBjb250ZXh0IGlzIE5VTEwiKSk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBzdGF0dXMgPSBoZGRfZ2V0X2Zyb250X2FkYXB0ZXIocEhkZEN0eCwgJnBBZGFwdGVyTm9kZSk7CisgICAgd2hpbGUgKE5VTEwgIT0gcEFkYXB0ZXJOb2RlICYmIFZPU19TVEFUVVNfU1VDQ0VTUyA9PSBzdGF0dXMpCisgICAgeworICAgICAgICBwQWRhcHRlciA9IHBBZGFwdGVyTm9kZS0+cEFkYXB0ZXI7CisgICAgICAgIGlmIChOVUxMICE9IHBBZGFwdGVyKQorICAgICAgICB7CisgICAgICAgICAgIGlmIChwSGRkVGRsc0N0eCA9PSBwQWRhcHRlci0+c2Vzc2lvbkN0eC5zdGF0aW9uLnBIZGRUZGxzQ3R4ICYmCisgICAgICAgICAgICAgIChOVUxMICE9IHBIZGRUZGxzQ3R4LT5wQWRhcHRlcikgJiYKKyAgICAgICAgICAgICAgKFdMQU5fSEREX0FEQVBURVJfTUFHSUMgPT0gcEhkZFRkbHNDdHgtPnBBZGFwdGVyLT5tYWdpYykpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGZvdW5kID0gMTsKKyAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgc3RhdHVzID0gaGRkX2dldF9uZXh0X2FkYXB0ZXIgKHBIZGRDdHgsIHBBZGFwdGVyTm9kZSwgJnBOZXh0KTsKKyAgICAgICAgcEFkYXB0ZXJOb2RlID0gcE5leHQ7CisgICAgfQorICAgIGlmIChmb3VuZCA9PSAxKQorICAgIHsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAg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5faW5mbyhoZGRfY29udGV4dF90ICpwSGRkQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBpZHgpCit7CisgICAgdEFOSV9VOCBzdGFJZHg7CisKKyAgICAvKiBjaGVjayBpZiB0aGVyZSBpcyBhdmFpbGFibGUgaW5kZXggZm9yIHRoaXMgbmV3IFRETFMgU1RBICovCisgICAgZm9yICggc3RhSWR4ID0gMDsgc3RhSWR4IDwgSEREX01BWF9OVU1fVERMU19TVEE7IHN0YUlkeCsrICkKKyAgICB7CisgICAgICAgIGlmIChpZHggPT0gcEhkZEN0eC0+dGRsc0Nvbm5JbmZvW3N0YUlkeF0uc3RhSWQgKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coTE9HMSwgRkwoInRkbHMgcGVlciB3aXRoIHN0YUlkeCAldSBleGlzdHMiKSwgaWR4ICk7CisgICAgICAgICAgICByZXR1cm4gKCZwSGRkQ3R4LT50ZGxzQ29ubkluZm9bc3RhSWR4XSk7CisgICAgICAgIH0KKyAgICB9CisgICAgaGRkTG9nKExPR0UsIEZMKCJ0ZGxzIHBlZXIgd2l0aCBzdGFJZHggJXUgbm90IGV4aXN0cyIpLCBpZHggKTsKKyAgICByZXR1cm4gTlVMTDsKK30KKworLyoqCisgKiB3bGFuX2hkZF90ZGxzX3JlZW5hYmxlKCkgLSBSZS1FbmFibGUgVERMUworICogQGhkZGN0eDogcG9pbnRlciB0byBoZGQgY29udGV4dAorICoKKyAqIEZ1bmN0aW9uIHJlLWVuYWJsZSdzIFRETFMgd2hpY2ggbWlnaHQgYmUgZGlzYWJsZWQgZHVyaW5nIGNvbmN1cnJlbmN5CisgKgorICogUmV0dXJuOiBOb25lCisgKi8KK3ZvaWQgd2xhbl9oZGRfdGRsc19yZWVuYWJsZShoZGRfY29udGV4dF90ICpwSGRkQ3R4KQoreworICAgIGlmICgoVFJVRSAhPSBwSGRkQ3R4LT5jZmdfaW5pLT5mRW5hYmxlVERMU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gICAgICAgICAgICAgICAgICAgICAgICZzdGFJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBWb3NQYWNrZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBrdE1ldGFJbmZvICk7CisgIGlmIChzdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTICYmIHN0YXR1cyAhPSBWT1NfU1RBVFVTX0VfRU1QVFkpCisgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IRERfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogVGVzdCBGQUlMIGhkZF90eF9mZXRjaF9wYWNrZXRfY2JrIiwgX19mdW5jX18pOworICBlbHNlCisgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IRERfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogVGVzdCBQQVNTIGhkZF90eF9mZXRjaF9wYWNrZXRfY2JrIiwgX19mdW5jX18pOworCisgIHN0YXR1cyA9IGhkZF90eF9jb21wbGV0ZV9jYmsocEFkYXB0ZXItPnB2b3NDb250ZXh0LCAmZHVtbXlQYWNrZXQsIFZPU19TVEFUVVNfU1VDQ0VTUyk7CisgIGlmIChzdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSEREX0RBVEEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IFRlc3QgRkFJTCBoZGRfdHhfY29tcGxldGVfY2JrIiwgX19mdW5jX18pOworICBlbHNlCisgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IRERfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICA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F9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IFRlc3QgUEFTUyBoZGRfcnhfcGFja2V0X2NiayIsIF9fZnVuY19fKTsKKworfQorI2VuZGlmCisKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX2ZsdXNoX3R4X3F1ZXVlcygpIC0gVXRpbGl0eSBmdW5jdGlvbiB0byBmbHVzaCB0aGUgVFggcXVldWVzCisKKyAgQHBhcmFtIHBBZGFwdGVyIDogW2luXSBwb2ludGVyIHRvIGFkYXB0ZXIgY29udGV4dCAgCisgIEByZXR1cm4gICAgICAgICA6IFZPU19TVEFUVVNfRV9GQUlMVVJFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQgCisgICAgICAgICAgICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3N0YXRpYyBWT1NfU1RBVFVTIGhkZF9mbHVzaF90eF9xdWV1ZXMoIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyICkKK3sKKyAgIFZPU19TVEFUVVMgc3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgdl9TSU5UX3QgaSA9IC0xOworICAgaGRkX2xpc3Rfbm9kZV90ICphbmNob3IgPSBOVUxMOworICAgc2tiX2xpc3Rfbm9kZV90ICpwa3ROb2RlID0gTlVMTDsKKyAgIHN0cnVjdCBza19idWZmICpza2IgPSBOVUxMOworCisgICBwQWRhcHRlci0+aXNWb3NMb3dSZXNvdXJjZSA9IFZPU19GQUxTRTsKKworICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX0hERCwgVFJBQ0VfQ09ERV9IRERfRkxVU0hfVFhfUVVFVUVTLAorICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCAwKSk7CisKKyAgIHdoaWxlICgrK2kgIT0gTlVNX1RYX1FVRVVFUykgCisgICB7CisgICAgICAvL0ZyZWUgdXAgYW55IHBhY2tldHMgaW4gdGhlIFR4IHF1ZXVlCisgICAgICBzcGluX2xvY2tfYmgoJnBBZGFwdGVyLT53bW1fdHhfcXVldWVbaV0ubG9jayk7CisgICAgICB3aGlsZSAodHJ1ZSkgCisgICAgICB7CisgICAgICAgICBzdGF0dXMgPSBoZGRfbGlzdF9yZW1vdmVfZnJvbnQoICZwQWRhcHRlci0+d21tX3R4X3F1ZXVlW2ldLCAmYW5jaG9yICk7CisgICAgICAgICBpZihWT1NfU1RBVFVTX0VfRU1QVFkgIT0gc3RhdHVzKQorICAgICAgICAgeworICAgICAgICAgICAgcGt0Tm9kZSA9IGxpc3RfZW50cnkoYW5jaG9yLCBza2JfbGlzdF9ub2RlX3QsIGFuY2hvcik7CisgICAgICAgICAgICBza2IgPSBwa3ROb2RlLT5za2I7CisgICAgICAgICAgICAvL1RPRE8KKyAgICAgICAgICAgIC8vKytwQWRhcHRlci0+c3RhdHMudHhfZHJvcHBlZDsgCisgICAgICAgICAgICArK3BBZGFwdGVyLT5oZGRfc3RhdHMuaGRkVHhSeFN0YXRzLnR4Rmx1c2hlZDsKKyAgICAgICAgICAgICsrcEFkYXB0ZXItPmhkZF9zdGF0cy5oZGRUeFJ4U3RhdHMudHhGbHVzaGVkQUNbaV07CisgICAgICAgICAgICBrZnJlZV9za2Ioc2tiKTsKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgfQorICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBzcGluX3VubG9ja19iaCgmcEFkYXB0ZXItPndtbV90eF9xdWV1ZVtpXS5sb2NrKTsKKyAgICAgIC8vIGJhY2twcmVzc3VyZSBpcyBubyBsb25nZXIgaW4gZWZmZWN0CisgICAgICBwQWRhcHRlci0+aXNUeFN1c3BlbmRlZFtpXSA9IFZPU19GQUxTRTsKKyAgIH0KKworICAgcmV0dXJuIHN0YXR1czsKK30KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX2ZsdXNoX2lic3NfdHhfcXVldWVzKCkgLSBVdGlsaXR5IGZ1bmN0aW9uIHRvIGZsdXNoIHRoZSBUWCBxdWV1ZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW4gSUJTUyBtb2RlCisKKyAgQHBhcmFtIHBBZGFwdGVyIDogW2luXSBwb2ludGVyIHRvIGFkYXB0ZXIgY29udGV4dAorICAgICAgICAgICAgICAgICAgOiBbaW5dIFN0YWlvbiBJZAorICBAcmV0dXJuICAgICAgICAgOiBWT1NfU1RBVFVTX0VfRkFJTFVSRSBpZiBhbnkgZXJyb3JzIGVuY291bnRlcmVkCisgICAgICAgICAgICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgaGRkX2ZsdXNoX2lic3NfdHhfcXVldWVzKCBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwgdl9VOF90IFNUQUlkKQoreworICAgdl9VOF90IGk7CisgICBoZGRfbGlzdF9ub2RlX3QgKmFuY2hvciA9IE5VTEw7CisgICBza2JfbGlzdF9ub2RlX3QgKnBrdE5vZGUgPSBOVUxMOworICAgc3RydWN0IHNrX2J1ZmYgKnNrYiA9IE5VTEw7CisgICBoZGRfc3RhdGlvbl9jdHhfdCAqcEhkZFN0YUN0eCA9ICZwQWRhcHRlci0+c2Vzc2lvbkN0eC5zdGF0aW9uOworICAgaGRkX2lic3NfcGVlcl9pbmZvX3QgKnBQZWVySW5mbyA9ICZwSGRkU3RhQ3R4LT5pYnNzX3BlZXJfaW5mbzsKKworICAgZm9yIChpID0gMDsgaSA8IE5VTV9UWF9RVUVVRVM7IGkgKyspCisgICB7CisgICAgICBzcGluX2xvY2tfYmgoJnBQZWVySW5mby0+aWJzc1N0YUluZm9bU1RBSWRdLndtbV90eF9xdWV1ZVtpXS5sb2NrKTsKKyAgICAgIHdoaWxlICh0cnVlKQorICAgICAgeworICAgICAgICAgaWYgKFZPU19TVEFUVVNfRV9FTVBUWSAhPQorICAgICAgICAgICAgICBoZGRfbGlzdF9yZW1vdmVfZnJvbnQoJnBQZWVySW5mby0+aWJzc1N0YUluZm9bU1RBSWRdLndtbV90eF9xdWV1ZVtpXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZhbmNob3IpKQorICAgICAgICAgeworICAgICAgICAgICAgLy9JZiBzdWNjZXNzIHRoZW4gd2UgZ290IGEgdmFsaWQgcGFja2V0IGZyb20gc29tZSBBQworICAgICAgICAgICAgcGt0Tm9kZSA9IGxpc3RfZW50cnkoYW5jaG9yLCBza2JfbGlzdF9ub2RlX3QsIGFuY2hvcik7CisgICAgICAgICAgICBza2IgPSBwa3ROb2RlLT5za2I7CisgICAgICAgICAgICArK3BBZGFwdGVyLT5zdGF0cy50eF9kcm9wcGVkOworICAgICAgICAgICAgKytwQWRhcHRlci0+aGRkX3N0YXRzLmhkZFR4UnhTdGF0cy50eEZsdXNoZWQ7CisgICAgICAgICAgICArK3BBZGFwdGVyLT5oZGRfc3RhdHMuaGRkVHhSeFN0YXRzLnR4Rmx1c2hlZEFDW2ldOworICAgICAgICAgICAga2ZyZWVfc2tiKHNrYik7CisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgIH0KKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgc3Bpbl91bmxvY2tfYmgoJnBQZWVySW5mby0+aWJzc1N0YUluZm9bU1RBSWRdLndtbV90eF9xdWV1ZVtpXS5sb2NrKTsKKyA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dG8gQWxsb2NhdGUgbWVtb3J5IiwgX19mdW5jX18pOworICAgICAgZ290byBmYWlsOworICAgfQorCisgICBjZmdTdGF0ZS0+bGVuID0gc2tiLT5sZW47CisKKyAgIHZvc19tZW1fY29weSggY2ZnU3RhdGUtPmJ1Ziwgc2tiLT5kYXRhLCBza2ItPmxlbik7CisKKyAgIGNmZ1N0YXRlLT5za2IgPSBza2I7IC8vYnVmOworICAgY2ZnU3RhdGUtPmFjdGlvbl9jb29raWUgPSAodWludHB0cl90KWNmZ1N0YXRlLT5idWY7CisKKyAgIGhkciA9IChzdHJ1Y3QgaWVlZTgwMjExX2hkciAqKXNrYi0+ZGF0YTsKKyAgIGlmKCAoaGRyLT5mcmFtZV9jb250cm9sICYgSEREX0ZSQU1FX1RZUEVfTUFTSykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IEhERF9GUkFNRV9UWVBFX01HTVQgKQorICAgeworICAgICAgIGlmKCAoaGRyLT5mcmFtZV9jb250cm9sICYgSEREX0ZSQU1FX1NVQlRZUEVfTUFTSykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IEhERF9GUkFNRV9TVUJUWVBFX0RFQVVUSCApCisgICAgICAgeworICAgICAgICAgIHN0cnVjdCB0YWdDc3JEZWxTdGFQYXJhbXMgZGVsU3RhUGFyYW1zOworCisgICAgICAgICAgV0xBTlNBUF9Qb3B1bGF0ZURlbFN0YVBhcmFtcyhoZHItPmFkZHIxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfTUFDX0RFQVVUSF9MRUFWSU5HX0JTU19SRUFTT04sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoU0lSX01BQ19NR01UX0RFQVVUSCA+PiA0KSwgJmRlbFN0YVBhcmFtcyk7CisKKyAgICAgICAgICBoZGRfc29mdGFwX3N0YV9kZWF1dGgocEFkYXB0ZXIsICZkZWxTdGFQYXJhbXMpOworICAgICAgICAgIGdvdG8gbWdtdF9oYW5kbGVkOworICAgICAgIH0KKyAgICAgICBlbHNlIGlmKCAoaGRyLT5mcmFtZV9jb250cm9sICYgSEREX0ZSQU1FX1NVQlRZUEVfTUFTSykgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IEhERF9GUkFNRV9TVUJUWVBFX0RJU0FTU09DICkKKyAgICAgICB7CisgICAgICAgICAgaGRkX3NvZnRhcF9zdGFfZGlzYXNzb2MoIHBBZGFwdGVyLCBoZHItPmFkZHIxICk7IAorICAgICAgICAgIGdvdG8gbWdtdF9oYW5kbGVkOworICAgICAgIH0KKyAgIH0KKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IRERfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAiJXM6IFNlbmRpbmcgYWN0aW9uIGZyYW1lIHRvIFNBUCB0byBUWCwgTGVuICVkIiwgX19mdW5jX18sIHNrYi0+bGVuKTsKKworICAgaWYgKFZPU19TVEFUVVNfU1VDQ0VTUyAhPSAKKyAgICAgIFdMQU5TQVBfU2VuZEFjdGlvbiggKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+cHZvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBza2ItPmRhdGEsIHNrYi0+bGVuLCAwKSApCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSEREX0RBVEEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAiJXM6IFdMQU5TQVBfU2VuZEFjdGlvbiByZXR1cm5lZCBmYWlsIiwgX19mdW5jX18pOworICAgICAgaGRkX3NlbmRBY3Rpb25DbmYoIHBBZGFwdGVyLCBGQUxTRSApOworICAgfQorICAgRVhJVCgpOworICAgcmV0dXJuOworCittZ210X2hhbmRsZWQ6CisgICBFWElUKCk7CisgICBoZGRfc2VuZEFjdGlvbkNuZiggcEFkYXB0ZXIsIFRSVUUgKTsKKyAgIHJldHVybjsKK2ZhaWw6CisgICBrZnJlZV9za2IocEFkYXB0ZXItPnNrYl90b190eCk7CisgICBwQWRhcHRlci0+c2tiX3RvX3R4ID0gTlVMTDsKKyAgIHJldHVybjsKK30KKwordm9pZCBfX2hkZF9tb25fdHhfd29ya19xdWV1ZShzdHJ1Y3Qgd29ya19zdHJ1Y3QgKndvcmspCit7CisgICBoZGRfYWRhcHRlcl90KiBwQWRhcHRlciA9IGNvbnRhaW5lcl9vZih3b3JrLCBoZGRfYWRhcHRlcl90LCBtb25UeFdvcmtRdWV1ZSk7CisgICBoZGRfbW9uX3R4X21nbXRfcGt0KHBBZGFwdGVyKTsKK30KKwordm9pZCBoZGRfbW9uX3R4X3dvcmtfcXVldWUoc3RydWN0IHdvcmtfc3RydWN0ICp3b3JrKQoreworICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgIF9faGRkX21vbl90eF93b3JrX3F1ZXVlKHdvcmspOworICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworfQorCitpbnQgaGRkX21vbl9oYXJkX3N0YXJ0X3htaXQoc3RydWN0IHNrX2J1ZmYgKnNrYiwgc3RydWN0IG5ldF9kZXZpY2UgKmRldikKK3sKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IRERfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAiJXM6IFBhY2tldCBSY3ZkIGF0IE1vbml0b3IgaW50ZXJmYWNlLCIKKyAgICAgICAgICAgICAiIERyb3BwaW5nIHRoZSBwYWNrZXQiLF9fZnVuY19fKTsKKyAgIGtmcmVlX3NrYihza2IpOworICAgcmV0dXJuIE5FVERFVl9UWF9PSzsKK30KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX2RoY3BfcGt0X2luZm8oKSAtCisgICAgICAgICAgICAgICBGdW5jdGlvbiB0byBsb2cgREhDUCBwa3QgaW5mbworCisgIEBwYXJhbSBza2IgICAgICA6IFtpbl0gIHBvaW50ZXIgdG8gT1MgcGFja2V0IChza19idWZmKQorICBAcmV0dXJuICAgICAgICAgOiBOb25lCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKK3ZvaWQgaGRkX2RoY3BfcGt0X2luZm8oc3RydWN0IHNrX2J1ZmYgKnNrYikKK3sKKyAgICAvKiBwb3J0IG5vIDY3ICgweDQzKSBvciA2OCAoMHg0NCkgKi8KKworICAgIGlmICgqKCh1OCopc2tiLT5kYXRhICsgQk9PVFBfTVNHX09GRlNFVCkgPT0gQk9PVFBfUkVRVUVTVF9NU0cpCisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgRkwoIlJlcXVlc3QiKSk7CisgICAgZWxzZSBpZiAoKigodTgqKXNrYi0+ZGF0YSArIEJPT1RQX01TR19PRkZTRVQpID09IEJPT1RQX1JFU1BPTlNFX01TRykKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCBGTCgiUmVzcG9uc2UiKSk7CisgICAgZWxzZQorICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sIEZMKCJESENQIGludmFsaWQiKSk7CisKKyAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICBGTCgiREhDUCBEZXN0IEFkZHI6ICVwTSBTcmMgQWRkciAlcE0gIgorICAgICAgICAgICAgICAgICIgc291cmNlIHBvcnQgOiAlZCwgZGVzdCBwb3J0IDogJWQiKSwKKyAgICAgICAgICAgIHNrYi0+ZGF0YSwgKHNrYi0+ZGF0YSArIDYpLAorICAgICAgICAgICAgbnRvaHMoKigodTE2KikoKHU4Kilza2ItPmRhdGEgKyBVRFBfU1JDX1BPUlRfT0ZGU0VUKSkpLAorICAgICAgICAgICAgbnRvaHMoKigodTE2KikoKHU4Kilza2ItPmRhdGEgKyBVRFBfREVTVF9QT1JUX09GRlNFVCkpKSk7CisKKyAgICBpZiAoKHNrYi0+ZGF0YVtESENQX09QVElPTjUzX09GRlNFVF0gPT0gREhDUF9PUFRJT041MykgJiYKKyAgICAgICAgKHNrYi0+ZGF0YVtESENQX09QVElPTjUzX0xFTkdUSF9PRkZTRVRdID09IERIQ1BfT1BUSU9ONTNfTEVOR1RIKSkgeworCisgICAgICAgIHN3aXRjaCAoc2tiLT5kYXRhW0RIQ1BfT1BUSU9ONTNfU1RBVFVTX09GRlNFVF0pIHsKKyAgICAgICAgY2FzZSBESENQRElTQ09WRVI6CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sRkwoIkRIQ1AgRElTQ09WRVIiKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBESENQUkVRVUVTVDoKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTyxGTCgiREhDUCBSRVFVRVNUIikpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgREhDUE9GRkVSOgorICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLEZMKCJESENQIE9GRkVSIikpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgREhDUEFDSzoKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTyxGTCgiREhDUCBBQ0siKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBESENQTkFLOgorICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLEZMKCJESENQIE5BQ0siKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBESENQUkVMRUFTRToKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTyxGTCgiREhDUCBSRUxFQVNFIikpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgREhDUElORk9STToKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTyxGTCgiREhDUCBJTkZPUk0iKSk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAiJXM6IERIQ1AgTm90IERlZmluZWQgT1BUSU9ONTMgOiAlZCIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICBza2ItPmRhdGFbREhDUF9PUFRJT041M19TVEFUVVNfT0ZGU0VUXSk7CisgICAgICAgIH0KKyAgICB9Cit9CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF9kdW1wX2RoY3BfcGt0KCkgLQorICAgICAgICAgICAgICAgRnVuY3Rpb24gdG8gZHVtcCBESENQIHBhY2tldHMgaW4gVFggYW5kIFJYIHBhdGguCisKKyAgQHBhcmFtIHNrYiAgICAgIDogW2luXSAgcG9pbnRlciB0byBPUyBwYWNrZXQgKHNrX2J1ZmYpCisgIEBwYXJhbSBwYXRoICAgICA6IFtpbl0gIGJvb2wgaW5kaWNhdGluZyBUWC9SWCBwYXRoCisgIEByZXR1cm4gICAgICAgICA6IE5vbmUKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgaGRkX2R1bXBfZGhjcF9wa3Qoc3RydWN0IHNrX2J1ZmYgKnNrYiwgaW50IHBhdGgpCit7CisKKyAgICBpZiAoKG50b2hzKCooKHUxNiopKCh1OCopc2tiLT5kYXRhICsgRVRIX1RZUEVfT0ZGU0VUKSkpCisgICAgICAgICAgICAgICAgPT0gRVRIX1RZUEVfSVBfUEtUKSB8fAorICAgICAgICAgICAgKG50b2hzKCooKHU4Kilza2ItPmRhdGEgKyBQUk9UT0NPTF9PRkZTRVQpKSA9PSBVRFBfUFJPVE9DT0wpKSB7CisKKyAgICAgICAgLyogSVAgcHJvdG9jb2wgMTIgYnl0ZXMgb2YgbWFjIGFkZHJlc3NlcyBpbiA4MDIuMyBoZWFkZXIgKi8KKyAgICAgICAgaWYgKCBudG9ocygqKCh1MTYqKSgodTgqKXNrYi0+ZGF0YSArIFVEUF9ERVNUX1BPUlRfT0ZGU0VUKSkpID09CisgICAgICAgICAgICAgICAgQk9PVFBfU0VSVkVSX1BPUlQgIHx8CisgICAgICAgICAgICAgICAgbnRvaHMoKigodTE2KikoKHU4Kilza2ItPmRhdGEgKyBVRFBfREVTVF9QT1JUX09GRlNFVCkpKSA9PQorICAgICAgICAgICAgICAgIEJPT1RQX0NMSUVOVF9QT1JUICB8fAorICAgICAgICAgICAgICAgIG50b2hzKCooKHUxNiopKCh1OCopc2tiLT5kYXRhICsgVURQX1NSQ19QT1JUX09GRlNFVCkpKSA9PQorICAgICAgICAgICAgICAgIEJPT1RQX1NFUlZFUl9QT1JUICB8fAorICAgICAgICAgICAgICAgIG50b2hzKCooKHUxNiopKCh1OCopc2tiLT5kYXRhICsgVURQX1NSQ19QT1JUX09GRlNFVCkpKSA9PQorICAgICAgICAgICAgICAgIEJPT1RQX0NMSUVOVF9QT1JUICkgeworCisgICAgICAgICAgICBpZiAocGF0aCA9PSBUWF9QQVRIKSB7CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCBGTCgiREhDUCBUWCBQQVRIIikpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sIEZMKCJESENQIFJYIFBBVEgiKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGhkZF9kaGNwX3BrdF9pbmZvKHNrYik7CisgICAgICAgIH0KKyAgICB9Cit9CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgIEBicmllZiBoZGRfaWJzc19oYXJkX3N0YXJ0X3htaXQoKSAtIEZ1bmN0aW9uIHJlZ2lzdGVyZWQgd2l0aCB0aGUgTGludXggT1MgZm9yCisgICB0cmFuc21pdHRpbmcgcGFja2V0cyBpbiBjYXNlIG9mIElCU1MuIFRoZXJlIGFyZSAyIHZlcnNpb25zIG9mIHRoaXMgZnVuY3Rpb24uCisgICBPbmUgdGhhdCB1c2VzIGxvY2tlZCBxdWV1ZSBhbmQgb3RoZXIgdGhhdCB1c2VzIGxvY2tsZXNzIHF1ZXVlcy4gQm90aCBoYXZlIGJlZW4KKyAgIHJldGFpbmVkIHRvIGRvIHNvbWUgcGVyZm9ybWFuY2UgdGVzdGluZworCisgICBAcGFyYW0gc2tiICAgICAgOiBbaW5dICBwb2ludGVyIHRvIE9TIHBhY2tldCAoc2tfYnVmZikKKyAgIEBwYXJhbSBkZXYgICAgICA6IFtpbl0gcG9pbnRlciB0byBuZXR3b3JrIGRldmljZQorCisgICBAcmV0dXJuICAgICAgICAgOiBORVRfWE1JVF9EUk9QIGlmIHBhY2tldHMgYXJlIGRyb3BwZWQKKyAgICAgICAgICAgICAgICAgICA6IE5FVF9YTUlUX1NVQ0NFU1MgaWYgcGFja2V0IGlzIGVucXVldWVkIHN1Y2Nlc2Z1bGx5CisgICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworIGludCBoZGRfaWJzc19oYXJkX3N0YXJ0X3htaXQoc3RydWN0IHNrX2J1ZmYgKnNrYiwgc3RydWN0IG5ldF9kZX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b2NrX2JoKCZwUGVlckluZm8tPmlic3NTdGFJbmZvW1NUQUlkXS53bW1fdHhfcXVldWVbYWNdLmxvY2spOworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgICAgICAiJXM6IFRYIHF1ZXVlIGZ1bGwgZm9yIEFDPSVkIERpc2FibGUgT1MgVFggcXVldWUiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBhYyApOworICAgICAgICAgcmV0dXJuIE5FVERFVl9UWF9CVVNZOworICAgICB9CisKKyAgICAgLyogSWYgMy80dGggb2YgdGhlIG1heCBxdWV1ZSBzaXplIGlzIHVzZWQgdGhlbiBlbmFibGUgdGhlIGZsYWcuCisgICAgICAqIFRoaXMgZmxhZyBpbmRpY2F0ZXMgdG8gcGxhY2UgdGhlIERIQ1AgcGFja2V0cyBpbiBWT0lDRSBBQyBxdWV1ZS4qLworICAgIGlmIChXTEFOVExfQUNfQkUgPT0gYWMpCisgICAgeworICAgICAgIGlmIChwUGVlckluZm8tPmlic3NTdGFJbmZvW1NUQUlkXS53bW1fdHhfcXVldWVbYWNdLmNvdW50ID49IEhERF9UWF9RVUVVRV9MT1dfV0FURVJfTUFSSykKKyAgICAgICB7CisgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICAgICIlczogVFggcXVldWUgZm9yIEJlc3QgRWZmb3J0IEFDIGlzIDMvNHRoIGZ1bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgIHBBZGFwdGVyLT5pc1Zvc0xvd1Jlc291cmNlID0gVk9TX1RSVUU7CisgICAgICAgfQorICAgICAgIGVsc2UKKyAgICAgICB7CisgICAgICAgICAgIHBBZGFwdGVyLT5pc1Zvc0xvd1Jlc291cmNlID0gVk9TX0ZBTFNFOworICAgICAgIH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1cykpCisgICAgICAgICAgeworICAgICAgICAgICAgIHBrdE5vZGUgPSBsaXN0X2VudHJ5KGFuY2hvciwgc2tiX2xpc3Rfbm9kZV90LCBhbmNob3IpOworICAgICAgICAgICAgIHNrYjEgPSBwa3ROb2RlLT5za2I7CisgICAgICAgICAgICAga2ZyZWVfc2tiKHNrYjEpOworICAgICAgICAgIH0KKyAgICAgICAgICArK3BBZGFwdGVyLT5zdGF0cy50eF9kcm9wcGVkOworICAgICAgICAgICsrcEFkYXB0ZXItPmhkZF9zdGF0cy5oZGRUeFJ4U3RhdHMudHhYbWl0RHJvcHBlZDsKKyAgICAgICAgICArK3BBZGFwdGVyLT5oZGRfc3RhdHMuaGRkVHhSeFN0YXRzLnR4WG1pdERyb3BwZWRBQ1thY107CisgICAgICAgICAgcmV0dXJuIE5FVERFVl9UWF9PSzsKKyAgICAgICB9CisgICAgfQorCisgICAgZGV2LT50cmFuc19zdGFydCA9IGppZmZpZXM7CisKKyAgICByZXR1cm4gTkVUREVWX1RYX09LOworIH0KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX2hhcmRfc3RhcnRfeG1pdCgpIC0gRnVuY3Rpb24gcmVnaXN0ZXJlZCB3aXRoIHRoZSBMaW51eCBPUyBmb3IKKyAgdHJhbnNtaXR0aW5nIHBhY2tldHMuIFRoZXJlIGFyZSAyIHZlcnNpb25zIG9mIHRoaXMgZnVuY3Rpb24uIE9uZSB0aGF0IHVzZXMKKyAgbG9ja2VkIHF1ZXVlIGFuZCBvdGhlciB0aGF0IHVzZXMgbG9ja2xlc3MgcXVldWVzLiBCb3RoIGhhdmUgYmVlbiByZXRhaW5lZCB0bworICBkbyBzb21lIHBlcmZvcm1hbmNlIHRlc3RpbmcKKworICBAcGFyYW0gc2tiICAgICAgOiBbaW5dICBwb2ludGVyIHRvIE9TIHBhY2tldCAoc2tfYnV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nVmZiAqc2tiMTsKKworICAgaWYgKE5VTEwgPT0gcEhkZEN0eCkgeworICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IRERfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzIEhERCBjb250ZXh0IGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICAgcmV0dXJuIE5FVERFVl9UWF9CVVNZOworICAgfQorCisgICArK3BBZGFwdGVyLT5oZGRfc3RhdHMuaGRkVHhSeFN0YXRzLnR4WG1pdENhbGxlZDsKKworICAgaWYgKHVubGlrZWx5KG5ldGlmX3N1YnF1ZXVlX3N0b3BwZWQoZGV2LCBza2IpKSkgeworICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IRERfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzIGlzIGNhbGxlZCB3aGVuIG5ldGlmIFRYICVkIGlzIGRpc2FibGVkIiwKKyAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBza2ItPnF1ZXVlX21hcHBpbmcpOworICAgICAgIHJldHVybiBORVRERVZfVFhfQlVTWTsKKyAgIH0KKworICAgLy9HZXQgVEwgUSBpbmRleCBjb3JyZXNwb25kaW5nIHRvIFFkaXNjIHF1ZXVlIGluZGV4L0FDLgorICAgcWlkID0gaGRkX1FkaXNjQWNUb1RsQUNbc2tiLT5xdWV1ZV9tYXBwaW5nXTsKKyAgIGFjICA9IHFpZDsKKworICAgaWYgKHFpZCA9PSBXTEFOVExfQUNfSElHSF9QUklPKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAiJXMgSXQgbXVzdCBiZSBhIEVhcG9sL1dhcGkvREhDUCBwYWNrZXQgZGV2aWNlX21vZGU6JWQiLAorICAgICAgICAgICAgICAgIF9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mxhZy4KKyAgICAqIFRoaXMgZmxhZyBpbmRpY2F0ZXMgdG8gcGxhY2UgdGhlIERIQ1AgcGFja2V0cyBpbiBWT0lDRSBBQyBxdWV1ZS4qLworICAgaWYgKFdMQU5UTF9BQ19CRSA9PSBxaWQpCisgICB7CisgICAgICBpZiAocEFkYXB0ZXItPndtbV90eF9xdWV1ZVtxaWRdLmNvdW50ID49IEhERF9UWF9RVUVVRV9MT1dfV0FURVJfTUFSSykKKyAgICAgIHsKKyAgICAgICAgICBwQWRhcHRlci0+aXNWb3NMb3dSZXNvdXJjZSA9IFZPU19UUlVFOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgIHBBZGFwdGVyLT5pc1Zvc0xvd1Jlc291cmNlID0gVk9TX0ZBTFNFOworICAgICAgfQorICAgfQorCisgICBzcGluX3VubG9jaygmcEFkYXB0ZXItPndtbV90eF9xdWV1ZVtxaWRdLmxvY2spOworCisgICBpZiAoKCBOVUxMICE9IHBIZGRDdHggKSAmJgorICAgICAgKHBIZGRDdHgtPmNmZ19pbmktPmdFbmFibGVEZWJ1Z0xvZyAmIFZPU19QS1RfUFJPVE9fVFlQRV9ESENQKSkKKyAgIHsKKyAgICAgICBoZGRfZHVtcF9kaGNwX3BrdChza2IsIFRYX1BBVEgpOworICAgfQorCisgICBpZiAoVk9TX1RSVUUgPT0gdHhTdXNwZW5kZWQpCisgICB7CisgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERF9EQVRBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICIlczogVFggcXVldWUgZnVsbCBmb3IgUUlkPSVkIERpc2FibGUgT1MgVFggcXVldWUiLAorICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHFpZCApOworICAgICAgcmV0dXJuIE5FVERFVl9UWF9CVVNZOworICAgfQorCisgICAvL1VzZSB0aGUgc2tiLT5jYiBmaWVsZCB0byBob2xkIHRoZSBsaXN0IG5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0ZXItPmhkZF9zdGF0cy5oZGRUeFJ4U3RhdHMudHhYbWl0RHJvcHBlZDsKKyAgICAgICAgICsrcEFkYXB0ZXItPmhkZF9zdGF0cy5oZGRUeFJ4U3RhdHMudHhYbWl0RHJvcHBlZEFDW3FpZF07CisgICAgICAgICByZXR1cm4gTkVUREVWX1RYX09LOworICAgICAgfQorICAgfQorCisgICBkZXYtPnRyYW5zX3N0YXJ0ID0gamlmZmllczsKKworICAgcmV0dXJuIE5FVERFVl9UWF9PSzsKK30KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX0lic3NfR2V0U3RhSWQoKSAtIEdldCB0aGUgU3RhdGlvbklEIHVzaW5nIHRoZSBQZWVyIE1hYyBhZGRyZXNzCisKKyAgQHBhcmFtIHBIZGRTdGFDdHggOiBbaW5dIHBvaW50ZXIgdG8gSEREIFN0YXRpb24gQ29udGV4dAorICBwTWFjQWRkcmVzcyBbaW5dICBwb2ludGVyIHRvIFBlZXIgTWFjIGFkZHJlc3MKKyAgc3RhSUQgW291dF0gIHBvaW50ZXIgdG8gU3RhdGlvbiBJbmRleAorICBAcmV0dXJuICAgIDogVk9TX1NUQVRVU19TVUNDRVNTL1ZPU19TVEFUVVNfRV9GQUlMVVJFCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKK1ZPU19TVEFUVVMgaGRkX0lic3NfR2V0U3RhSWQoaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHgsIHZfTUFDQUREUl90ICpwTWFjQWRkcmVzcywgdl9VOF90ICpzdGFJZCkKK3sKKyAgICB2X1U4X3QgaWR4OworCisgICAgZm9yIChpZHggPSAwOyBpZHggPCBIRERfTUFYX05VTV9JQlNTX1NUQTsgaWR4KyspCisgICAgeworICAgICAgICBpZiAodm9zX21lbV9jb21wYXJlKCZwSGRkU3RhQ3R4LT5jb25uX2luZm8ucGVlck1hY0FkZHJlc3NbIGlkeCBdLAorICAgICAgICAgICAgICAgIHBNYWNBZGRyZXNzLCBzaXplb2Yodl9NQUNBRERSX3QpKSkKKyAgICAgICAgeworICAgICAgICAgICAgKnN0YUlkID0gcEhkZFN0YUN0eC0+Y29ubl9pbmZvLnN0YUlkW2lkeF07CisgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworfQorCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBfX2hkZF90eF90aW1lb3V0KCkgLSBGdW5jdGlvbiBoYW5kbGVzIHRpbWVvdXQgZHVyaW5nIHRyYW5zbWlzc2lvbi4KKworICBAcGFyYW0gZGV2IDogW2luXSBwb2ludGVyIHRvIG5ldHdvcmsgZGV2aWNlCisgIEByZXR1cm4gICAgOiBOb25lCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIF9faGRkX3R4X3RpbWVvdXQoc3RydWN0IG5ldF9kZXZpY2UgKmRldikKK3sKKyAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyID0gIFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgIHN0cnVjdCBuZXRkZXZfcXVldWUgKnR4cTsKKyAgIGhkZF9yZW1haW5fb25fY2hhbl9jdHhfdCAqcFJlbWFpbkNoYW5DdHg7CisgICBpbnQgaSA9IDA7CisgICBpbnQgc3RhdHVzID0gMDsKKyAgIHZfVUxPTkdfdCBkaWZmX2luX2ppZmZpZXMgPSAwOworICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHggPSBOVUxMOworCisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSEREX0RBVEEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICIlczogVHJhbnNtaXNzaW9uIHRpbWVvdXQgb2NjdXJyZWQgamlmZmllcyAlbHUgZGV2LT50cmFuc19zdGFydCAlbHUiLAorICAgICAgICBfX2Z1bmNfXyxqaWZmaWVzLGRldi0+dHJhbnNfc3RhcnQpOworCisgICBpZiAoIE5VTEwgPT0gcEFkYXB0ZXIgKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERF9EQVRBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgIEZMKCJwQWRhcHRlciBpcyBOVUxMIikpOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybjsKKyAgIH0KKworICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgc3RhdHVzID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgIGlmIChzdGF0dXMgIT0wICkKKyAgIHsKKyAgICAgICByZXR1cm47CisgICB9CisKKyAgIHBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKyAgIGlmICggTlVMTCA9PSBwSGRkU3RhQ3R4ICkKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IRERfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICBGTCgicEhkZFN0YUN0eCBpcyBOVUxMIikpOworICAgICAgcmV0dXJuOworICAgfQorCisgICArK3BBZGFwdGVyLT5oZGRfc3RhdHMuaGRkVHhSeFN0YXRzLnR4VGltZW91dENvdW50OworCisgICAvL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kWzJdLAorICAgICAgICAgICAgICBwQWRhcHRlci0+aXNUeFN1c3BlbmRlZFszXSk7CisKKyAgIGZvciAoaSA9IDA7IGkgPCBkZXYtPm51bV90eF9xdWV1ZXM7IGkrKykKKyAgIHsKKyAgICAgIHR4cSA9IG5ldGRldl9nZXRfdHhfcXVldWUoZGV2LCBpKTsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IRERfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICJRdWV1ZSVkIHN0YXR1czogJWQgdHhxLT50cmFuc19zdGFydCAlbHUiLAorICAgICAgICAgICAgICAgICBpLCBuZXRpZl90eF9xdWV1ZV9zdG9wcGVkKHR4cSksdHhxLT50cmFuc19zdGFydCk7CisgICB9CisKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IRERfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAiY2FycmllciBzdGF0ZTogJWQiLCBuZXRpZl9jYXJyaWVyX29rKGRldikpOworCisgICAvKiBjb250aW51b3VzVHhUaW1lb3V0Q291bnQgd2lsbCBiZSByZXNldCB3aGVuZXZlciBUTCBmZXRjaGVzIHBhY2tldAorICAgICogZnJvbSBIREQKKyAgICAqLworICAgKytwQWRhcHRlci0+aGRkX3N0YXRzLmhkZFR4UnhTdGF0cy5jb250aW51b3VzVHhUaW1lb3V0Q291bnQ7CisKKyAgIGRpZmZfaW5famlmZmllcyA9IGppZmZpZXMgLSBwQWRhcHRlci0+aGRkX3N0YXRzLmhkZFR4UnhTdGF0cy5qaWZmaWVzTGFzdFR4VGltZU91dDsKKyAgIGlmKChwQWRhcHRlci0+aGRkX3N0YXRzLmhkZFR4UnhTdGF0cy5jb250aW51b3VzVHhUaW1lb3V0Q291bnQgPiAxKSYmCisgICAgICgoZGlmZl9pbl9qaWZmaWVzKSA+IChIRERfVFhfVElNRU9VVCAqIDIgKSkKKyAgICAgK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RFVMRV9JRF9IRERfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgRkwoIlRoaXMgaXMgZmFsc2UgYWxhcm0gc28gcmVzZXR0aW5nIHRoZSBjb250aW51b3VzVHhUaW1lb3V0Q291bnQiKSk7CisgICB9CisKKyAgIC8vdXBkYXRlIGxhc3QgamlmZmllcyBhZnRlciB0aGUgY2hlY2sKKyAgIHBBZGFwdGVyLT5oZGRfc3RhdHMuaGRkVHhSeFN0YXRzLmppZmZpZXNMYXN0VHhUaW1lT3V0ID0gamlmZmllczsKKworICAgaWYgKCFwSGRkU3RhQ3R4LT5jb25uX2luZm8udUlzQXV0aGVudGljYXRlZCkgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSEREX0RBVEEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgIEZMKCJUTCBpcyBub3QgaW4gYXV0aGVudGljYXRlZCBzdGF0ZSBzbyBza2lwcGluZyBTU1IiKSk7CisgICAgICBwQWRhcHRlci0+aGRkX3N0YXRzLmhkZFR4UnhTdGF0cy5jb250aW51b3VzVHhUaW1lb3V0Q291bnQgPSAwOworICAgICAgZ290byBwcmludF9sb2c7CisgICB9CisgICBpZiAocEFkYXB0ZXItPmhkZF9zdGF0cy5oZGRUeFJ4U3RhdHMuY29udGludW91c1R4VGltZW91dENvdW50ID09CisgICAgICAgICAgSEREX1RYX1NUQUxMX0tJQ0tEWEVfVEhSRVNIT0xEKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSEREX1NBUF9EQVRBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOiBSZXF1ZXN0IEtpY2sgRFhFIGZvciByZWNvdmVyeSIsX19mdW5jX18pOworICAgICAgV0xBTlRMX1RMRGVidWdNZXNzYWdlKFdMQU5UTF9ERUJVR19LSUNLRFhFKTsKKyAgIH0KKyA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c3RhdHMuaGRkVHhSeFN0YXRzLmNvbnRpbnVvdXNUeFRpbWVvdXRDb3VudCA+CisgICAgICAgICAgSEREX1RYX1NUQUxMX1NTUl9USFJFU0hPTERfSElHSCkKKyAgICAgIHsKKyAgICAgICAgICAvLyBEcml2ZXIgY291bGQgbm90IHJlY292ZXIsIGlzc3VlIFNTUgorICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERF9EQVRBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICIlczogQ2Fubm90IHJlY292ZXIgZnJvbSBEYXRhIHN0YWxsIElzc3VlIFNTUiIsCisgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgIFdMQU5UTF9GYXRhbEVycm9yKCk7CisgICAgICAgICAgcmV0dXJuOworICAgICAgfQorICAgfQorCitwcmludF9sb2c6CisgICAvKiBJZiBUeCBzdGFsbGVkIGZvciBhIGxvbmcgdGltZSB0aGVuICpoZGRfdHhfdGltZW91dCogaXMgY2FsbGVkCisgICAgKiBldmVyeSA1c2VjLiBUaGUgVEwgZGVidWcgc3BpdHMgb3V0IGEgbG90IG9mIGluZm9ybWF0aW9uIG9uIHRoZQorICAgICogc2VyaWFsIGNvbnNvbGUsIGlmIGl0IGlzIGNhbGxlZCBldmVyeSB0aW1lICpoZGRfdHhfdGltZW91dCogaXMKKyAgICAqIGNhbGxlZCB0aGVuIHdlIG1heSBnZXQgYSB3YXRjaGRvZyBiaXRlIG9uIHRoZSBBcHBsaWNhdGlvbgorICAgICogcHJvY2Vzc29yLCBzbyByYXRlbGltaXQgdGhlIFRMIGRlYnVnIGxvZ3MuCisgICAgKi8KKyAgIGlmIChfX3JhdGVsaW1pdCgmaGRkX3R4X3RpbWVvdXRfcnMpKQorICAgeworICAgICAgaGRkX3dtbV90eF9zbmFwc2hvdChwQWRhcHRlcik7CisgICAgICBXTEFOVExfVExEZWJ1Z01lc3NhZ2UoV0xBTlRMX0RFQlVHX1RYX1NOQVBTSE9UKTsKKyAgIH0KKworfQorCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfdHhfdGltZW91dCgpIC0gRnVuY3Rpb24gY2FsbGVkIGJ5IE9TIGlmIHRoZXJlIGlzIGFueQorICB0aW1lb3V0IGR1cmluZyB0cmFuc21pc3Npb24uIFNpbmNlIEhERCBzaW1wbHkgZW5xdWV1ZXMgcGFja2V0CisgIGFuZCByZXR1cm5zIGNvbnRyb2wgdG8gT1MgcmlnaHQgYXdheSwgdGhpcyB3b3VsZCBuZXZlciBiZSBpbnZva2VkCisKKyAgQHBhcmFtIGRldiA6IFtpbl0gcG9pbnRlciB0byBuZXR3b3JrIGRldmljZQorICBAcmV0dXJuICAgIDogTm9uZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBoZGRfdHhfdGltZW91dChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQoreworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgX19oZGRfdHhfdGltZW91dChkZXYpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKK30KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgX19oZGRfc3RhdHMoKSAtIEZ1bmN0aW9uIHJlZ2lzdGVyZWQgd2l0aCB0aGUgTGludXggT1MgZm9yCisgIGRldmljZSBUWC9SWCBzdGF0aXN0aWMKKworICBAcGFyYW0gZGV2ICAgICAgOiBbaW5dIHBvaW50ZXIgdG8gTGlicmEgbmV0d29yayBkZXZpY2UKKyAgCisgIEByZXR1cm4gICAgICAgICA6IHBvaW50ZXIgdG8gbmV0X2RldmljZV9zdGF0cyBzdHJ1Y3R1cmUKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3N0cnVjdCBuZXRfZGV2aWNlX3N0YXRzKiBfX2hkZF9zdGF0cyhzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQoreworICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgPSAgV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisKKyAgIGlmICggTlVMTCA9PSBwQWRhcHRlciApCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSEREX0RBVEEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgRkwoInBBZGFwdGVyIGlzIE5VTEwiKSk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuIE5VTEw7CisgICB9CisgICAKKyAgIHJldHVybiAmcEFkYXB0ZXItPnN0YXRzOworfQorCitzdHJ1Y3QgbmV0X2RldmljZV9zdGF0cyogaGRkX3N0YXRzKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCit7CisgICAgc3RydWN0IG5ldF9kZXZpY2Vfc3RhdHMqIGRldl9zdGF0czsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgZGV2X3N0YXRzID0gX19oZGRfc3RhdHMoZGV2KTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gZGV2X3N0YXRzOworfQorCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfaWJzc19pbml0X3R4X3J4KCkgLSBJbml0IGZ1bmN0aW9uIHRvIGluaXRpYWxpemUgVHgvUlgKKyAgbW9kdWxlcyBpbiBIREQKKworICBAcGFyYW0gcEFkYXB0ZXIgOiBbaW5dIHBvaW50ZXIgdG8gYWRhcHRlciBjb250ZXh0CisgIEByZXR1cm4gICAgICAgICA6IFZPU19TVEFUVVNfRV9GQUlMVVJFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQKKyAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBoZGRfaWJzc19pbml0X3R4X3J4KCBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciApCit7CisgICB2X1U4X3QgaTsKKyAgIHZfVThfdCBTVEFJZCA9IDA7CisgICBoZGRfc3RhdGlvbl9jdHhfdCAqcEhkZFN0YUN0eCA9ICZwQWRhcHRlci0+c2Vzc2lvbkN0eC5zdGF0aW9uOworICAgaGRkX2lic3NfcGVlcl9pbmZvX3QgKnBQZWVySW5mbyA9ICZwSGRkU3RhQ3R4LT5pYnNzX3BlZXJfaW5mbzsKKyAgIHZfVThfdCBwQUNXZWlnaHRzW10gPSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICBIRERfU09GVEFQX0JLX1dFSUdIVF9ERUZBVUxULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgSEREX1NPRlRBUF9CRV9XRUlHSFRfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIEhERF9TT0ZUQVBfVklfV0VJR0hUX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBIRERfU09GVEFQX1ZPX1dFSUdIVF9ERUZBVUxUCisgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgcEFkYXB0ZXItPmlzVm9zT3V0T2ZSZXNvdXJjZSA9IFZPU19GQUxTRTsKKyAgIHBBZGFwdGVyLT5pc1Zvc0xvd1Jlc291cmNlID0gVk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VF9DVFgocEFkYXB0ZXIpKS0+cHZvc0NvbnRleHQsIHBBQ1dlaWdodHMpOworfQorCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfaWJzc19kZWluaXRfdHhfcngoKSAtIERlaW5pdCBmdW5jdGlvbiB0byBjbGVhbiB1cCBUeC9SWAorICBtb2R1bGVzIGluIEhERAorCisgIEBwYXJhbSBwQWRhcHRlciA6IFtpbl0gcG9pbnRlciB0byBhZGFwdGVyIGNvbnRleHQuLgorICBAcmV0dXJuICAgICAgICAgOiBWT1NfU1RBVFVTX0VfRkFJTFVSRSBpZiBhbnkgZXJyb3JzIGVuY291bnRlcmVkLgorICAgICAgICAgICAgICAgICAgOiBWT1NfU1RBVFVTX1NVQ0NFU1Mgb3RoZXJ3aXNlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIGhkZF9pYnNzX2RlaW5pdF90eF9yeCggaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgKQoreworICAgVk9TX1NUQVRVUyBzdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICB2X1U4X3QgU1RBSWQgPSAwOworICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHggPSAmcEFkYXB0ZXItPnNlc3Npb25DdHguc3RhdGlvbjsKKyAgIGhkZF9pYnNzX3BlZXJfaW5mb190ICogcFBlZXJJbmZvID0gJnBIZGRTdGFDdHgtPmlic3NfcGVlcl9pbmZvOworICAgaGRkX2xpc3Rfbm9kZV90ICphbmNob3IgPSBOVUxMOworICAgc2tiX2xpc3Rfbm9kZV90ICpwa3ROb2RlID0gTlVMTDsKKyAgIHN0cnVjdCBza19idWZmICpza2IgPSBOVUxMOworICAgdl9TSU5UX3QgaSA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HMudHhGbHVzaGVkQUNbaV07CisgICAgICAgICAgICAgICBrZnJlZV9za2Ioc2tiKTsKKyAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvL2N1cnJlbnQgbGlzdCBpcyBlbXB0eQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisgICAgICAgICBwUGVlckluZm8tPmlic3NTdGFJbmZvW1NUQUlkXS50eFN1c3BlbmRlZFtpXSA9IFZPU19GQUxTRTsKKyAgICAgICAgIHNwaW5fdW5sb2NrX2JoKCZwUGVlckluZm8tPmlic3NTdGFJbmZvW1NUQUlkXS53bW1fdHhfcXVldWVbaV0ubG9jayk7CisgICAgICB9CisgICB9CisgICBwQWRhcHRlci0+aXNWb3NMb3dSZXNvdXJjZSA9IFZPU19GQUxTRTsKKworICAgcmV0dXJuIHN0YXR1czsKK30KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX2luaXRfdHhfcngoKSAtIEluaXQgZnVuY3Rpb24gdG8gaW5pdGlhbGl6ZSBUeC9SWAorICBtb2R1bGVzIGluIEhERAorCisgIEBwYXJhbSBwQWRhcHRlciA6IFtpbl0gcG9pbnRlciB0byBhZGFwdGVyIGNvbnRleHQgIAorICBAcmV0dXJuICAgICAgICAgOiBWT1NfU1RBVFVTX0VfRkFJTFVSRSBpZiBhbnkgZXJyb3JzIGVuY291bnRlcmVkIAorICAgICAgICAgICAgICAgICAgOiBWT1NfU1RBVFVTX1NVQ0NFU1Mgb3RoZXJ3aXNlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIGhkZF9pbml0X3R4X3J4KCBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciApCit7CisgICBWT1NfU1RBV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GVyIDogW2luXSBwb2ludGVyIHRvIGFkYXB0ZXIgY29udGV4dCAgCisgIEByZXR1cm4gICAgICAgICA6IFZPU19TVEFUVVNfRV9GQUlMVVJFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQgCisgICAgICAgICAgICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgaGRkX2RlaW5pdF90eF9yeCggaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgKQoreworICAgVk9TX1NUQVRVUyBzdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICB2X1NJTlRfdCBpID0gLTE7CisKKyAgIGlmICggTlVMTCA9PSBwQWRhcHRlciApCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSEREX0RBVEEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgRkwoInBBZGFwdGVyIGlzIE5VTEwiKSk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgfQorCisgICBzdGF0dXMgPSBoZGRfZmx1c2hfdHhfcXVldWVzKHBBZGFwdGVyKTsKKyAgIGlmIChWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gc3RhdHVzKQorICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IRERfREFUQSwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgRkwoImZhaWxlZCB0byBmbHVzaCB0eCBxdWV1ZXMiKSk7CisKKyAgIHdoaWxlICgrK2kgIT0gTlVNX1RYX1FVRVVFUykgCisgICB7CisgICAgICAvL0ZyZWUgdXAgYWN0dWFsIGxpc3QgZWxlbWVudHMgaW4gdGhlIFR4IHF1ZXVlCisgICAgICBoZGRfbGlzdF9kZXN0cm95KCAmcEFkYXB0ZXItPndtbV90eF9xdWV1ZVtpXSApOworICAgfQorCisgICByZXR1cm4gc3RhdHVzOworfQorCisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF9kaXNjb25uZWN0X3R4X3J4KCkgLSBEaXNjb25uZWN0IGZ1bmN0aW9uIHRvIGNsZWFuIHVwIFR4L1JYCisgIG1vZHVsZXMgaW4gSERECisKKyAgQHBhcmFtIHBBZGFwdGVyIDogW2luXSBwb2ludGVyIHRvIGFkYXB0ZXIgY29udGV4dCAgCisgIEByZXR1cm4gICAgICAgICA6IFZPU19TVEFUVVNfRV9GQUlMVVJFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQgCisgICAgICAgICAgICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgaGRkX2Rpc2Nvbm5lY3RfdHhfcngoIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyICkKK3sKKyAgIHJldHVybiBoZGRfZmx1c2hfdHhfcXVldWVzKHBBZGFwdGVyKTsKK30KKworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfSXNFQVBPTFBhY2tldCgpIC0gQ2hlY2tzIHRoZSBwYWNrZXQgaXMgRUFQT0wgb3Igbm90LgorCisgIEBwYXJhbSBwVm9zUGFja2V0IDogW2luXSBwb2ludGVyIHRvIHZvcyBwYWNrZXQgIAorICBAcmV0dXJuICAgICAgICAgOiBWT1NfVFJVRSBpZiB0aGUgcGFja2V0IGlzIEVBUE9MIAorICAgICAgICAgICAgICAgICAgOiBWT1NfRkFMU0Ugb3RoZXJ3aXNlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKK3ZfQk9PTF90IGhkZF9Jc0VBUE9MUGFja2V0KCB2b3NfcGt0X3QgKnBWb3NQYWNrZXQgKQoreworICAgIFZPU19TVEFUVVMgdm9zU3RhdHVzICA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgICB2X0JPT0xfdCAgIGZFQVBPTCAgICAgPSBWT1NfRkFMU0U7IAorICAgIHZvaWQgICAgICAgKnBCdWZmZXIgICA9IE5VTEw7CisKKyAgICAKKyAgICB2b3NTdGF0dXMgPSB2b3NfcGt0X3BlZWtfZGF0YSggcFZvc1BhY2tldCwgKHZfU0laRV90KUhERF9FVEhFUlRZUEVfODAyXzFfWF9GUkFNRV9PRkZTRVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICZwQnVmZmVyLCBIRERfRVRIRVJUWVBFXzgwMl8xX1hfU0laRSApOworICAgIGlmICggVk9TX0lTX1NUQVRVU19TVUNDRVNTKCB2b3NTdGF0dXMgKSApCisgICAgeworICAgICAgIGlmICggcEJ1ZmZlciAmJiAqKHVuc2lnbmVkIHNob3J0KilwQnVmZmVyID09CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19jcHVfdG9fYmUxNihIRERfRVRIRVJUWVBFXzgwMl8xX1gpICkKKyAgICAgICB7CisgICAgICAgICAgZkVBUE9MID0gVk9TX1RSVUU7CisgICAgICAgfQorICAgIH0gIAorICAgIAorICAgcmV0dXJuIGZFQVBPTDsKK30KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX0lzQVJQKCkgLSBDaGVja3MgdGhlIHBhY2tldCBpcyBBUlAgb3Igbm90LgorCisgIEBwYXJhbSBwVm9zUGFja2V0IDogW2luXSBwb2ludGVyIHRvIHZvcyBwYWNrZXQKKyAgQHJldHVybiAgICAgICAgIDogVk9TX1RSVUUgaWYgdGhlIHBhY2tldCBpcyBBUlAKKyAgICAgICAgICAgICAgICAgIDogVk9TX0ZBTFNFIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCit2X0JPT0xfdCBoZGRfSXNBUlAoIHZvc19wa3RfdCAqcFZvc1BhY2tldCApCit7CisgICAgVk9TX1NUQVRVUyB2b3NTdGF0dXMgID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgIHZfQk9PTF90ICAgZklzQVJQICAgICA9IFZPU19GQUxTRTsKKyAgICB2b2lkICAgICAgICpwQnVmZmVyICAgPSBOVUxMOworCisKKyAgICB2b3NTdGF0dXMgPSB2b3NfcGt0X3BlZWtfZGF0YSggcFZvc1BhY2tldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICh2X1NJWkVfdClIRERfRVRIRVJUWVBFXzgwMl8xX1hfRlJBTUVfT0ZGU0VULAorICAgICAgICAgICAgICAgICAgICAgICAgICAmcEJ1ZmZlciwgSEREX0VUSEVSVFlQRV84MDJfMV9YX1NJWkUgKTsKKyAgICBpZiAoIFZPU19JU19TVEFUVVNfU1VDQ0VTUyggdm9zU3RhdHVzICkgKQorICAgIHsKKyAgICAgICBpZiAoIHBCdWZmZXIgJiYgKih1bnNpZ25lZCBzaG9ydCopcEJ1ZmZlciA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX2NwdV90b19iZTE2KEhERF9FVEhFUlRZUEVfQVJQKSApCisgICAgICAgeworICAgICAgICAgIGZJc0FSUCA9IFZPU19UUlVFOworICAgICAgIH0KKyAgICB9CisKKyAgIHJldHVybiBmSXNBUlA7Cit9CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fV0FQSSAvLyBOZWVkIHRvIHVwZGF0ZSB0aGlzIGZ1bmN0aW9uCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfSXNXQUlQYWNrZXQoKSAtIENoZWNrcyB0aGUgcGFja2V0IGlzIFdBSSBvciBub3QuCisKKyAgQHBhcmFtIHBWb3NQYWNrZXQgOiBbaW5dIHBvaW50ZXIgdG8gdm9zIHBhY2tldAorICBAcmV0dXJuICAgICAgICAgOiBWT1NfVFJVRSBpZiB0aGUgcGFja2V0IGlzIFdBSQorICAgICAgICAgICAgICAgICAgOiBWT1NfRkFMU0Ugb3RoZXJ3aXNlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKK3ZfQk9PTF90IGhkZF9Jc1dBSVBhY2tldCggdm9zX3BrdF90ICpwVm9zUGFja2V0ICkKK3sKKyAgICBWT1NfU1RBVFVTIHZvc1N0YXR1cyAgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICAgdl9CT09MX3QgICBmSXNXQUkgICAgID0gVk9TX0ZBTFNFOworICAgIHZvaWQgICAgICAgKnBCdWZmZXIgICA9IE5VTEw7CisKKyAgICAvLyBOZWVkIHRvIHVwZGF0ZSB0aGlzIGZ1bmN0aW9uCisgICAgdm9zU3RhdHVzID0gdm9zX3BrdF9wZWVrX2RhdGEoIHBWb3NQYWNrZXQsICh2X1NJWkVfdClIRERfRVRIRVJUWVBFXzgwMl8xX1hfRlJBTUVfT0ZGU0VULAorICAgICAgICAgICAgICAgICAgICAgICAgICAmcEJ1ZmZlciwgSEREX0VUSEVSVFlQRV84MDJfMV9YX1NJWkUgKTsKKworICAgIGlmIChWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIHZvc1N0YXR1cyApICkKKyAgICB7CisgICAgICAgaWYgKCBwQnVmZmVyICYmICoodW5zaWduZWQgc2hvcnQqKXBCdWZmZXIgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfY3B1X3RvX2JlMTYoSEREX0VUSEVSVFlQRV9XQUkpICkKKyAgICAgICB7CisgICAgICAgICAgZklzV0FJID0gVk9TX1RSVUU7CisgICAgICAgfQorICAgIH0KKworICAgcmV0dXJuIGZJc1dBSTsKK30KKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fV0FQSSAqLworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfdHhfY29tcGxldGVfY2JrKCkgLSBDYWxsYmFjayBmdW5jdGlvbiBpbnZva2VkIGJ5IFRMCisgIHRvIGluZGljYXRlIHRoYXQgYSBwYWNrZXQgaGFzIGJlZW4gdHJhbnNtaXR0ZWQgYWNyb3NzIHRoZSBTRElPIGJ1cworICBzdWNjZXNmdWxseS4gT1MgcGFja2V0IHJlc291cmNlcyBjYW4gYmUgcmVsZWFzZWQgYWZ0ZXIgdGhpcyBjYmsuCisKKyAgQHBhcmFtIHZvc0NvbnRleHQgICA6IFtpbl0gcG9pbnRlciB0byBWT1MgY29udGV4dCAgIAorICBAcGFyYW0gcFZvc1BhY2tldCAgIDogW2luXSBwb2ludGVyIHRvIFZPUyBwYWNrZXQgKGNvbnRhaW5pbmcgc2tiKSAKKyAgQHBhcmFtIHZvc1N0YXR1c0luICA6IFtpbl0gc3RhdHVzIG9mIHRoZSB0cmFuc21pc3Npb24gCisKKyAgQHJldHVybiAgICAgICAgICAgICA6IFZPU19TVEFUVVNfRV9GQUlMVVJFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQgCisgICAgICAgICAgICAgICAgICAgICAgOiBWT1NfU1RBVFVTX1NVQ0NFU1Mgb3RoZXJ3aXNlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIGhkZF90eF9jb21wbGV0ZV9jYmsoIHZfVk9JRF90ICp2b3NDb250ZXh0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX3BrdF90ICpwVm9zUGFja2V0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1NUQVRVUyB2b3NTdGF0dXNJbiApCit7CisgICBWT1NfU1RBVFVTIHN0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyID0gTlVMTDsgICAKKyAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSBOVUxMOworICAgdm9pZCogcE9zUGt0ID0gTlVMTDsKKyAgIAorICAgaWYoICggTlVMTCA9PSB2b3NDb250ZXh0ICkgfHwgKCBOVUxMID09IHBWb3NQYWNrZXQgKSAgKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERF9EQVRBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICIlczogTnVsbCBwYXJhbXMgYmVpbmcgcGFzc2VkIiwgX19mdW5jX18pOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOyAKKyAgIH0KKworICAgLy9SZXR1cm4gdGhlIHNrYiB0byB0aGUgT1MKKyAgIHN0YXR1cyA9IHZvc19wa3RfZ2V0X29zX3BhY2tldCggcFZvc1BhY2tldCwgJnBPc1BrdCwgVk9TX1RSVUUgKTsKKyAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSkKKyAgIHsKKyAgICAgIC8vVGhpcyBpcyBiYWQgYnV0IHN0aWxsIHRyeSB0byBmcmVlIHRoZSBWT1NTIHJlc291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B0byB0cmFuc21pdAorICAgICAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19FX0ZBSUxVUkUgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZAorICAgICAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIG90aGVyd2lzZQorID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIGhkZF9pYnNzX3R4X2ZldGNoX3BhY2tldF9jYmsoIHZfVk9JRF90ICp2b3NDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwU3RhSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfQUNFbnVtVHlwZSAgYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfcGt0X3QgKipwcFZvc1BhY2tldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9NZXRhSW5mb1R5cGUgKnBQa3RNZXRhSW5mbyApCit7CisgICBWT1NfU1RBVFVTIHN0YXR1cyA9IFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgPSBOVUxMOworICAgaGRkX2xpc3Rfbm9kZV90ICphbmNob3IgPSBOVUxMOworICAgc2tiX2xpc3Rfbm9kZV90ICpwa3ROb2RlID0gTlVMTDsKKyAgIHN0cnVjdCBza19idWZmICpza2IgPSBOVUxMOworICAgdm9zX3BrdF90ICpwVm9zUGFja2V0ID0gTlVMTDsKKyAgIHZfTUFDQUREUl90KiBwRGVzdE1hY0FkZHJlc3MgPSBOVUxMOworICAgdl9USU1FX3QgdGltZXN0YW1wOworICAgdl9TSVpFX3Qgc2l6ZSA9IDA7CisgICB2X1U4X3QgU1RBSWQgPSBXTEFOX01BWF9TVEFfQ09V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iLCBfX2Z1bmNfXywgYWMpOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgfQorCisgICArK3BBZGFwdGVyLT5oZGRfc3RhdHMuaGRkVHhSeFN0YXRzLnR4RmV0Y2hlZEFDW2FjXTsKKworICAgLy9HZXQgdGhlIHZvcyBwYWNrZXQgYmVmb3JlIHNvIHRoYXQgd2UgYXJlIHByZXBhcmUgZm9yIFZPUyBsb3cgcmVzZXVyY2UgY29uZGl0aW9uCisgICAvL1RoaXMgc2ltcGxpZmllcyB0aGUgbG9ja2luZyBhbmQgdW5sb2NraW5nIG9mIFR4IHF1ZXVlCisgICBzdGF0dXMgPSB2b3NfcGt0X3dyYXBfZGF0YV9wYWNrZXQoICZwVm9zUGFja2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfUEtUX1RZUEVfVFhfODAyXzNfREFUQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwgLy9PUyBQa3QgaXMgbm90IGJlaW5nIHBhc3NlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZGRfdHhfbG93X3Jlc291cmNlX2NiaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXIgKTsKKworICAgaWYgKChzdGF0dXMgPT0gVk9TX1NUQVRVU19FX0FMUkVBRFkpIHx8IChzdGF0dXMgPT0gVk9TX1NUQVRVU19FX1JFU09VUkNFUykpCisgICB7CisgICAgICAvL1JlbWVtYmVyIFZPUyBpcyBpbiBhIGxvdyByZXNvdXJjZSBzaXR1YXRpb24KKyAgICAgIHBBZGFwdGVyLT5pc1Zvc091dE9mUmVzb3VyY2UgPSBWT1NfVFJVRTsKKyAgICAgICsrcEFkYXB0ZXItPmhkZF9zdGF0cy5oZGRUeFJ4U3RhdHMudHhGZXRjaExvd1Jlc291cmNlczsKKyAgICAgIFZPU19UUkFDRSggVk9TX01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gKHN0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSEREX0RBVEEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBFcnJvciBhdHRhY2hpbmcgc2tiIiwgX19mdW5jX18pOworICAgICAgdm9zX3BrdF9yZXR1cm5fcGFja2V0KHBWb3NQYWNrZXQpOworICAgICAgKytwQWRhcHRlci0+c3RhdHMudHhfZHJvcHBlZDsKKyAgICAgICsrcEFkYXB0ZXItPmhkZF9zdGF0cy5oZGRUeFJ4U3RhdHMudHhGZXRjaERlcXVldWVFcnJvcjsKKyAgICAgIGtmcmVlX3NrYihza2IpOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgfQorCisgICAvL1JldHVybiBWT1MgcGFja2V0IHRvIFRMOworICAgKnBwVm9zUGFja2V0ID0gcFZvc1BhY2tldDsKKworICAgLy9GaWxsIG91dCB0aGUgbWV0YSBpbmZvcm1hdGlvbiBuZWVkZWQgYnkgVEwKKyAgIHZvc19wa3RfZ2V0X3RpbWVzdGFtcCggcFZvc1BhY2tldCwgJnRpbWVzdGFtcCApOworICAgcFBrdE1ldGFJbmZvLT51c1RpbWVTdGFtcCA9ICh2X1UxNl90KXRpbWVzdGFtcDsKKyAgIGlmICggMSA8IHNpemUgKQorICAgeworICAgICAgIHBQa3RNZXRhSW5mby0+Yk1vcmVQYWNrZXRzID0gMTsgLy9IREQgaGFzIG1vcmUgcGFja2V0cyB0byBzZW5kCisgICB9CisgICBlbHNlCisgICB7CisgICAgICAgcFBrdE1ldGFJbmZvLT5iTW9yZVBhY2tldHMgPSAwOworICAgfQorCisgICBpZihwQWRhcHRlci0+c2Vzc2lvbkN0eC5zdGF0aW9uLmNvbm5faW5mby51SXNBdXRoZW50aWNhdGVkID09IFZPU19UUlVFKQorICAgICAgcFBrdE1ldGFJbmZvLT51Y0lzRWFwb2wgPSAwOworICAgZWxzZQorICAgICAgcFBrdE1ldGFJbmZvLT51Y0lzRWFwb2wgPSBoZGRfSXNFQVBPTFBhY2tldCggcFZvc1BhY2tldCApID8gMSA6IDA7CisKKyAgIGlmICgoTlVMTCAhPSBwSGRkQ3R4KSAmJgorICAgICAgIChwSGRkQ3R4LT5jZmdfaW5pLT5nRW5hYmxlRGVidWdMb2cpKQorICAgeworICAgICAgcHJvdG9fdHlwZSA9IHZvc19wa3RfZ2V0X3Byb3RvX3R5cGUoc2tiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+Y2ZnX2luaS0+Z0VuYWJsZURlYnVnTG9nKTsKKyAgICAgIGlmIChWT1NfUEtUX1BST1RPX1RZUEVfRUFQT0wgJiBwcm90b190eXBlKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAiSUJTUyBTVEEgVFggRUFQT0wiKTsKKyAgICAgIH0KKyAgICAgIGVsc2UgaWYgKFZPU19QS1RfUFJPVE9fVFlQRV9ESENQICYgcHJvdG9fdHlwZSkKKyAgICAgIHsKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgIklCU1MgU1RBIFRYIERIQ1AiKTsKKyAgICAgIH0KKyAgICAgIGVsc2UgaWYgKFZPU19QS1RfUFJPVE9fVFlQRV9BUlAgJiBwcm90b190eXBlKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAiSUJTUyBTVEEgVFggQVJQIik7CisgICAgICB9CisgICB9CisKKyAgIHZvc19wa3RfZ2V0X3BhY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2V0ICAgOiBbb3V0XSBwb2ludGVyIHRvIFZPUyBwYWNrZXQgcGFja2V0IHBvaW50ZXIKKyAgQHBhcmFtIHBQa3RNZXRhSW5mbyA6IFtvdXRdIHBvaW50ZXIgdG8gbWV0YSBpbmZvIGZvciB0aGUgcGt0IAorICAKKyAgQHJldHVybiAgICAgICAgICAgICA6IFZPU19TVEFUVVNfRV9FTVBUWSBpZiBubyBwYWNrZXRzIHRvIHRyYW5zbWl0CisgICAgICAgICAgICAgICAgICAgICAgOiBWT1NfU1RBVFVTX0VfRkFJTFVSRSBpZiBhbnkgZXJyb3JzIGVuY291bnRlcmVkIAorICAgICAgICAgICAgICAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBoZGRfdHhfZmV0Y2hfcGFja2V0X2Niayggdl9WT0lEX3QgKnZvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBTdGFJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9BQ0VudW1UeXBlICBhYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19wa3RfdCAqKnBwVm9zUGFja2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX01ldGFJbmZvVHlwZSAqcFBrdE1ldGFJbmZvICkKK3sKKyAgIFZPU19TVEFUVVMgc3RhdHVzID0gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciA9IE5VTEw7CisgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gTlVMTDsKKyAgIGhkZF9saXN0X25vZGVfdCAqYW5jaG9yID0gTlVMTDsKKyAgIHNrY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ICAgeworICAgICAgICAgKytwQWRhcHRlci0+aGRkX3N0YXRzLmhkZFR4UnhTdGF0cy50eEZldGNoRW1wdHk7CisjaWZkZWYgSEREX1dNTV9ERUJVRworICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERF9EQVRBLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgICIlczogbm8gcGFja2V0cyBwZW5kaW5nIiwgX19mdW5jX18pOworI2VuZGlmIC8vIEhERF9XTU1fREVCVUcKKyAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICAgIH0KKyAgIH0KKworICAgLy9HZXQgdGhlIHZvcyBwYWNrZXQuIEkgZG9uJ3Qgd2FudCB0byBkZXF1ZXVlIGFuZCBlbnF1ZXVlIGFnYWluIGlmIHdlIGFyZSBvdXQgb2YgVk9TIHJlc291cmNlcyAKKyAgIC8vVGhpcyBzaW1wbGlmaWVzIHRoZSBsb2NraW5nIGFuZCB1bmxvY2tpbmcgb2YgVHggcXVldWUKKyAgIHN0YXR1cyA9IHZvc19wa3Rfd3JhcF9kYXRhX3BhY2tldCggJnBWb3NQYWNrZXQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfUEtUX1RZUEVfVFhfODAyXzNfREFUQSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsIC8vT1MgUGt0IGlzIG5vdCBiZWluZyBwYXNzZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGRkX3R4X2xvd19yZXNvdXJjZV9jYmssIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlciApOworCisgICBpZiAoc3RhdHVzID09IFZPU19TVEFUVVNfRV9BTFJFQURZIHx8IHN0YXR1cyA9PSBWT1NfU1RBVFVTX0VfUkVTT1VSQ0VTKQorICAgeworICAgICAgLy9SZ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vZGUpCisgICAgeworICAgICAgICBoZGRfc3RhdGlvbl9jdHhfdCAqcEhkZFN0YUN0eCA9ICZwQWRhcHRlci0+c2Vzc2lvbkN0eC5zdGF0aW9uOworICAgICAgICB1OCBtYWNbNl07CisKKyAgICAgICAgd2xhbl9oZGRfdGRsc19leHRyYWN0X2RhKHNrYiwgbWFjKTsKKworICAgICAgICBpZiAodm9zX2lzX21hY2FkZHJfZ3JvdXAoKHZfTUFDQUREUl90ICopbWFjKSkgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERF9EQVRBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19NRUQsCisgICAgICAgICAgICAgICAgICAgICAgImJyb2FkY2FzdCBwYWNrZXQsIG5vdCBhZGRpbmcgdG8gcGVlciBsaXN0Iik7CisgICAgICAgIH0gZWxzZSBpZiAobWVtY21wKHBIZGRTdGFDdHgtPmNvbm5faW5mby5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWMsIDYpICE9IDApIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IRERfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fTUVELAorICAgICAgICAgICAgICAgICAgICAgICJleHRyYWN0IG1hYzogIiBNQUNfQUREUkVTU19TVFIsCisgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkobWFjKSApOworCisgICAgICAgICAgICB3bGFuX2hkZF90ZGxzX2luY3JlbWVudF9wa3RfY291bnQocEFkYXB0ZXIsIG1hYywgMSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSEREX0RBVEEsIFZPU19UUkFDRV9MRVZFTF9JTkZPX01FRCwKKyAgICAgICAgICAgICAgICAgICAgICAgInBhY2tldCBkYSBpcyBic3NpZCwgbm90IGFkZGluZyB0byBwZWVyIGxpc3QiKTsKKyAgICAgIC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ljZV9tb2RlKSkKKyAgIHsKKyAgICAgIGlmKG11dGV4X2xvY2tfaW50ZXJydXB0aWJsZSgmcEhkZEN0eC0+dG1JbmZvLnRtT3BlcmF0aW9uTG9jaykpCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSEREX0RBVEEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIiVzOiBUbSBMb2NrIGZhaWwiLCBfX2Z1bmNfXyk7CisgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICB9CisgICAgICBpZihXTEFOX0hERF9UTV9MRVZFTF8xIDwgcEhkZEN0eC0+dG1JbmZvLmN1cnJlbnRUbUxldmVsKQorICAgICAgeworICAgICAgICAgaWYoMCA9PSBwSGRkQ3R4LT50bUluZm8udHhGcmFtZUNvdW50KQorICAgICAgICAgeworICAgICAgICAgICAgLyogSnVzdCByZWNvdmVyZWQgZnJvbSBzbGVlcCB0aW1lb3V0ICovCisgICAgICAgICAgICBwSGRkQ3R4LT50bUluZm8ubGFzdE9wZW5UcyA9IHRpbWVzdGFtcDsKKyAgICAgICAgIH0KKworICAgICAgICAgaWYoKFZPU19GQUxTRSA9PSBwSGRkQ3R4LT50bUluZm8ucUJsb2NrZWQpICYmCisgICAgICAgICAgICAoKHRpbWVzdGFtcCAtIHBIZGRDdHgtPnRtSW5mby5sYXN0T3BlblRzKSA+IChwSGRkQ3R4LT50bUluZm8udG1BY3Rpb24udHhPcGVyYXRpb25EdXJhdGlvbiAvIDEwKSkgJiYKKyAgICAgICAgICAgIChwSGRkQ3R4LT50bUluZm8udHhGcmFtZUNvdW50ID49IHBIZGRDdHgtPnRtSW5mby50bUFjdGlvbi50eEJsb2NrRnJhbWVDb3VudFRocmVzaG9sZCkpCisgICAgICAgICB7CisgICAgICAgICAgICAvKiBEdXJpbmcgVFggb3BlbiBkdXJhdGlvbiwgVFggZnJhbWUgY291bn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gdGhhbiB0aHJlc2hvbGQKKyAgICAgICAgICAgICAqIFJlc2V0IGNvdW50IGFuZCB0aW1lc3RhbXAgdG8gcHJlcGFyZSBuZXh0IGN5Y2xlICovCisgICAgICAgICAgICBwSGRkQ3R4LT50bUluZm8ubGFzdE9wZW5UcyA9IHRpbWVzdGFtcDsKKyAgICAgICAgICAgIHBIZGRDdHgtPnRtSW5mby50eEZyYW1lQ291bnQgPSAwOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgLyogRG8gTm90aGluZyAqLworICAgICAgICAgfQorICAgICAgICAgcEhkZEN0eC0+dG1JbmZvLnR4RnJhbWVDb3VudCsrOworICAgICAgfQorICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT50bUluZm8udG1PcGVyYXRpb25Mb2NrKTsKKyAgIH0KKworCisjaWZkZWYgSEREX1dNTV9ERUJVRworICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERF9EQVRBLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsIiVzOiBWYWxpZCBWT1MgUEtUIHJldHVybmVkIHRvIFRMIiwgX19mdW5jX18pOworI2VuZGlmIC8vIEhERF9XTU1fREVCVUcKKworICAgcmV0dXJuIHN0YXR1czsKK30KKworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfdHhfbG93X3Jlc291cmNlX2NiaygpIC0gQ2FsbGJhY2sgZnVuY3Rpb24gaW52b2tlZCBpbiB0aGUgCisgIGNhc2Ugd2hlcmUgVk9TIHBhY2tldHMgYXJlIG5vdCBhdmFpbGFibGUgYXQgdGhlIHRpbWUgb2YgdGhlIGNhbGwgdG8gZ2V0IAorICBwYWNrZXRzLiBUaGlzIGNhbGxiYWNrIGZ1bmN0aW9uIGlzIGludm9rZWQgYnkgVk9TIHdoZW4gcGFja2V0cyBhcmUgCisgIGF2YWlsYWJsZS4KKworICBAcGFyYW0gcFZvc1BhY2tldCA6IFtpbl0gIHBvaW50ZXIgdG8gVk9TIHBhY2tldCAKKyAgQHBhcmFtIHVzZXJEYXRhICAgOiBbaW5dICBvcGFxdWUgdXNlciBkYXRhIHRoYXQgd2FzIHBhc3NlZCBpbml0aWFsbHkgCisgIAorICBAcmV0dXJuICAgICAgICAgICA6IFZPU19TVEFUVVNfRV9GQUlMVVJFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQsIAorICAgICAgICAgICAgICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBoZGRfdHhfbG93X3Jlc291cmNlX2Niayggdm9zX3BrdF90ICpwVm9zUGFja2V0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVk9JRF90ICp1c2VyRGF0YSApCit7CisgICBWT1NfU1RBVFVTIHN0YXR1czsKKyAgIHZfU0lOVF90IGkgPSAwOworICAgdl9TSVpFX3Qgc2l6ZSA9IDA7CisgICBoZGRfYWRhcHRlcl90KiBwQWRhcHRlciA9IChoZGRfYWRhcHRlcl90ICopdXNlckRhdGE7CisgICAKKyAgIGlmIChOVUxMID09IHBBZGFwdGVyIHx8IFdMQU5fSEREX0FEQVBURVJfTUFHSUMgIT0gcEFkYXB0ZXItPm1hZ2ljKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSEREX0RBVEEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgRkwoIkludmFsaWQgYWRhcHRlciAlcCIpLCBwQWRhcHRlcik7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICB9CisKKyAgIC8vUmV0dX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NfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERF9EQVRBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEZhaWx1cmUgaW4gaW5kaWNhdGluZyBwa3QgdG8gVEwgZm9yIGFjPSVkIiwgX19mdW5jX18sIGkpOworICAgICAgICAgfQorICAgICAgfQorICAgfQorCisgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfQorCitzdGF0aWMgdm9pZCBoZGRfbW9uX2FkZF9yeF9yYWRpb3RhcF9oZHIgKHN0cnVjdCBza19idWZmICpza2IsCisgICAgICAgICAgICAgaW50IHJ0YXBfbGVuLCAgdl9QVk9JRF90ICBwUnhQYWNrZXQsIGhkZF9tb25fY3R4X3QgKnBNb25DdHgpCit7CisgICAgdTggcnRhcF90ZW1wWzIwXSA9IHswfTsKKyAgICBzdHJ1Y3QgaWVlZTgwMjExX3JhZGlvdGFwX2hlYWRlciAqcnRoZHI7CisgICAgdW5zaWduZWQgY2hhciAqcG9zOworICAgIHUxNiByeF9mbGFncyA9IDA7CisgICAgdTE2IHJhdGVJZHg7CisgICAgczggICAgICAgIGN1cnJlbnRSU1NJLCBjdXJyZW50UlNTSTAsIGN1cnJlbnRSU1NJMTsKKworICAgIHJhdGVJZHggPSBXREFfR0VUX1JYX01BQ19SQVRFX0lEWChwUnhQYWNrZXQpOworICAgIGlmKCByYXRlSWR4ID49IDIxMCAmJiByYXRlSWR4IDw9IDIxNykKKyAgICAgICByYXRlSWR4LT0yMDI7CisgICAgaWYoIHJhdGVJZHggPj0gMjE4ICYmIHJhdGVJZHggPD0gMjI1ICkKKyAgICAgICByYXRlSWR4LT0yMTA7CisKKyAgICBpZihyYXRlSWR4ID4gKHNpemVvZihnUmF0ZWZyb21JZHgpLyBzaXplb2YoaW50KSkpIHsKKyAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSEREX0RBVEEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogaW52YWxpZCByYXRlSWR4ICVkIG1ha2UgaXQgMCIsIF9fZnVuY19fLCByYXRlSWR4KTsKKyAgICAgICByYXRlSWR4ID0gMDsKKyAgICB9CisgICAgY3VycmVudFJTU0kwID0gV0RBX0dFVFJTU0kwKHBSeFBhY2tldCkgLSAxMDA7CisgICAgY3VycmVudFJTU0kxID0gV0RBX0dFVFJTU0kxKHBSeFBhY2tldCkgLSAxMDA7CisgICAgY3VycmVudFJTU0kgID0gKGN1cnJlbnRSU1NJMCA+IGN1cnJlbnRSU1NJMSkgPyBjdXJyZW50UlNTSTAgOiBjdXJyZW50UlNTSTE7CisKKyAgICBydGhkciA9IChzdHJ1Y3QgaWVlZTgwMjExX3JhZGlvdGFwX2hlYWRlciAqKSgmcnRhcF90ZW1wWzBdKTsKKworICAgIC8qIHJhZGlvdGFwIGhlYWRlciwgc2V0IGFsd2F5cyBwcmVzZW50IGZsYWdzICovCisgICAgcnRoZHItPml0X3ByZXNlbnQgPSBjcHVfdG9fbGUzMigoMSA8PCBJRUVFODAyMTFfUkFESU9UQVBfRkxBR1MpICAgfAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDEgPDwgSUVFRTgwMjExX1JBRElPVEFQX0NIQU5ORUwpIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgxIDw8IElFRUU4MDIxMV9SQURJT1RBUF9SWF9GTEFHUykpOworICAgIHJ0aGRyLT5pdF9sZW4gPSBjcHVfdG9fbGUxNihydGFwX2xlbik7CisKKyAgICBwb3MgPSAodW5zaWduZWQgY2hhciAqKSAocnRoZHIgKyAxKTsKKworICAgIC8qIElFRUU4MDIxMV9SQURJT1RBUF9GTEFHUyAqLworICAgICpwb3MgPSAwOworICAgIHBvcysrOworCisgICAgLyogSUVFRTgwMjExX1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k9TX01PRFVMRV9JRF9IRERfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogRmFpbHVyZSBleHRyYWN0aW5nIHNrYiBmcm9tIHZvcyBwa3QiLCBfX2Z1bmNfXyk7CisgICAgICAgIHZvc19wa3RfcmV0dXJuX3BhY2tldCggcFZvc1BhY2tldCApOworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgfQorCisgICAgaWYoIWNvbnZlcnNpb24pCisgICAgeworICAgICAgICAgcE1vbkN0eCA9IFdMQU5fSEREX0dFVF9NT05JVE9SX0NUWF9QVFIocEFkYXB0ZXIpOworICAgICAgICAgbmVlZGVkX2hlYWRyb29tID0gc2l6ZW9mKHN0cnVjdCBpZWVlODAyMTFfcmFkaW90YXBfaGVhZGVyKSArIDEwOworICAgICAgICAgaGRkX21vbl9hZGRfcnhfcmFkaW90YXBfaGRyKCBza2IsIG5lZWRlZF9oZWFkcm9vbSwgcHZCREhlYWRlciwgcE1vbkN0eCApOworICAgIH0KKworICAgIHNrYl9yZXNldF9tYWNfaGVhZGVyKCBza2IgKTsKKyAgICBza2ItPmRldiA9IHBBZGFwdGVyLT5kZXY7CisgICAgc2tiLT5wa3RfdHlwZSA9IFBBQ0tFVF9PVEhFUkhPU1Q7CisgICAgc2tiLT5wcm90b2NvbCA9IGh0b25zKEVUSF9QXzgwMl8yKTsKKyAgICBza2ItPmlwX3N1bW1lZCA9IENIRUNLU1VNX05PTkU7CisgICAgKytwQWRhcHRlci0+aGRkX3N0YXRzLmhkZFR4UnhTdGF0cy5yeFBhY2tldHM7CisgICAgKytwQWRhcHRlci0+c3RhdHMucnhfcGFja2V0czsKKyAgICBwQWRhcHRlci0+c3RhdHMucnhfYnl0ZXMgKz0gc2tiLT5sZW47CisKKyAgICByeHN0YXQgPSBuZXRpZl9yeF9uaShza2IpOworICAgIGlmIChORVRfUlhfU1VDQ0VTUy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BbaW5dIHBvaW50ZXIgdG8gVk9TIHBhY2tldCBjaGFpbgorICBAcGFyYW0gc3RhSWQgICAgICAgICAgIDogW2luXSBTdGF0aW9uIElkCisgIEBwYXJhbSBwUnhNZXRhSW5mbyAgICAgOiBbaW5dIHBvaW50ZXIgdG8gbWV0YSBpbmZvIGZvciB0aGUgcmVjZWl2ZWQgcGt0KHMpIAorCisgIEByZXR1cm4gICAgICAgICAgICAgICAgOiBWT1NfU1RBVFVTX0VfRkFJTFVSRSBpZiBhbnkgZXJyb3JzIGVuY291bnRlcmVkLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBvdGhlcndpc2UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgaGRkX3J4X3BhY2tldF9jYmsoIHZfVk9JRF90ICp2b3NDb250ZXh0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19wa3RfdCAqcFZvc1BhY2tldENoYWluLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90IHN0YUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX1J4TWV0YUluZm9UeXBlKiBwUnhNZXRhSW5mbyApCit7CisgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciA9IE5VTEw7CisgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gTlVMTDsKKyAgIFZPU19TVEFUVVMgc3RhdHVzID0gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICBpbnQgcnhzdGF0OworICAgc3RydWN0IHNrX2J1ZmYgKnNrYiA9IE5VTEw7CisgICB2b3NfcGt0X3QqIHBWb3NQYWNrZXQ7CisgICB2b3NfcGt0X3QqIHBOZXh0Vm9zUGFja2V0OworICAgdl9VOF90IHByb3RvX3R5cGU7CisKKyAgIC8vU2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UxVUkU7CisgICAgICB9CisKKyAgICAgIC8vIEV4dHJhY3QgdGhlIE9TIHBhY2tldCAoc2tiKS4KKyAgICAgIHN0YXR1cyA9IHZvc19wa3RfZ2V0X29zX3BhY2tldCggcFZvc1BhY2tldCwgKHZfVk9JRF90ICoqKSZza2IsIFZPU19GQUxTRSApOworICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkpCisgICAgICB7CisgICAgICAgICArK3BBZGFwdGVyLT5oZGRfc3RhdHMuaGRkVHhSeFN0YXRzLnJ4RHJvcHBlZDsKKyAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IRERfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEZhaWx1cmUgZXh0cmFjdGluZyBza2IgZnJvbSB2b3MgcGt0IiwgX19mdW5jX18pOworICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgICAgfQorCisgICAgICBpZiAoVFJVRSA9PSBoZGRfSXNFQVBPTFBhY2tldCggcFZvc1BhY2tldCApKQorICAgICAgICAgIHdsYW5faGRkX2xvZ19lYXBvbChza2IsIFdJRklfRVZFTlRfRFJJVkVSX0VBUE9MX0ZSQU1FX1JFQ0VJVkVEKTsKKworICAgICAgcFZvc1BhY2tldC0+cFNrYiA9IE5VTEw7CisKKyAgICAgIGlmIChXTEFOX0hERF9BREFQVEVSX01BR0lDICE9IHBBZGFwdGVyLT5tYWdpYykKKyAgICAgIHsKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERF9EQVRBLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICJNYWdpYyBjb29raWUoJXgpIGZvciBhZGFwdGVyIHNhbml0eSB2ZXJpZmljYXRpb24gaXMgaW52YWxpZCIsIHBBZGFwdGVyLT5tYWdpYyk7CisgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgIH0KKworI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgICAgaWYgKChlVERMU19TVVBQT1JUX0VOQUJMRUQgPT0gcEhkZEN0eC0+dGRsc19tb2RlKSAmJgorICAgICAgICAgMCAhPSBwSGRkQ3R4LT5jb25uZWN0ZWRfcGVlcl9jb3VudCkKKyAgICB7CisgICAgICAgIGhkZF9zdGF0aW9uX2N0eF90ICpwSGRkU3RhQ3R4ID0gJnBBZGFwdGVyLT5zZXNzaW9uQ3R4LnN0YXRpb247CisgICAgICAgIHU4IG1hY1s2XTsKKworICAgICAgICBtZW1jcHkobWFjLCBza2ItPmRhdGErNiwgNik7CisKKyAgICAgICAgaWYgKHZvc19pc19tYWNhZGRyX2dyb3VwKCh2X01BQ0FERFJfdCAqKW1hYykpIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IRERfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fTUVELAorICAgICAgICAgICAgICAgICAgICAgICJyeCBicm9hZGNhc3QgcGFja2V0LCBub3QgYWRkaW5nIHRvIHBlZXIgbGlzdCIpOworICAgICAgICB9IGVsc2UgaWYgKChtZW1jbXAocEhkZFN0YUN0eC0+Y29ubl9pbmZvLmJzc0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hYywgNikgIT0gMCkgJiYgKHBSeE1ldGFJbmZvLT5pc1N0YVRkbHMpKSB7CisgICAgICAgICAgICB3bGFuX2hkZF90ZGxzX3VwZGF0ZV9yeF9wa3RfY250X25fcnNzaShwQWRhcHRlciwgbWFjLAorICAgICAgICAgICAgICAgICAgICBwUnhNZXRhSW5mby0+cnNzaUF2Zyk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSEREX0RBVEEsIFZPU19UUkFDRV9MRVZFTF9JTkZPX01FRCwKKyAgICAgICAgICAgICAgICAgICAgICAgInJ4IHBhY2tldCBzYSBpcyBic3NpZCwgbm90IGFkZGluZyB0byBwZWVyIGxpc3QiKTsKKyAgICAgICAgfQorICAgIH0KKyNlbmRpZgorICAgICAgaWYgKHBIZGRDdHgtPmNmZ19pbmktPmdFbmFibGVEZWJ1Z0xvZykKKyAgICAgIHsKKyAgICAgICAgIHByb3RvX3R5cGUgPSB2b3NfcGt0X2dldF9wcm90b190eXBlKHNrYiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPmNmZ19pbmktPmdFbmFibGVEZWJ1Z0xvZyk7CisgICAgICAgICBpZiAoVk9TX1BLVF9QUk9UT19UWVBFX0VBUE9MICYgcHJvdG9fdHlwZSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgIlNUQSBSWCBFQVBPTCIpOworICAgICAgICAgfQorICAgICAgICAgZWxzZSBpZiAoVk9TX1BLVF9QUk9UT19UWVBFX0RIQ1AgJiBwcm90b190eXBlKQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAiU1RBIFJYIERIQ1AiKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UgaWYgKFZPU19QS1RfUFJPVE9fVFlQRV9BUlAgJiBwcm90b190eXBlKQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAiU1RBIFJYIEFSUCIpOworICAgICAgICAgfQorICAgICAgfQorCisgICAgICBpZiAocEhkZEN0eC0+Y2ZnX2luaS0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nhzdGF0KQorICAgICAgeworICAgICAgICAgKytwQWRhcHRlci0+aGRkX3N0YXRzLmhkZFR4UnhTdGF0cy5yeERlbGl2ZXJlZDsKKyAgICAgICAgICsrcEFkYXB0ZXItPmhkZF9zdGF0cy5oZGRUeFJ4U3RhdHMucGt0X3J4X2NvdW50OworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgKytwQWRhcHRlci0+aGRkX3N0YXRzLmhkZFR4UnhTdGF0cy5yeFJlZnVzZWQ7CisgICAgICB9CisgICAgICAvLyBub3cgcHJvY2VzcyB0aGUgbmV4dCBwYWNrZXQgaW4gdGhlIGNoYWluCisgICAgICBwVm9zUGFja2V0ID0gcE5leHRWb3NQYWNrZXQ7CisKKyAgIH0gd2hpbGUgKHBWb3NQYWNrZXQpOworCisgICAvL1JldHVybiB0aGUgZW50aXJlIFZPUyBwYWNrZXQgY2hhaW4gdG8gdGhlIHJlc291cmNlIHBvb2wKKyAgIHN0YXR1cyA9IHZvc19wa3RfcmV0dXJuX3BhY2tldCggcFZvc1BhY2tldENoYWluICk7CisgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSkKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IRERfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCIlczogRmFpbHVyZSByZXR1cm5pbmcgdm9zIHBrdCIsIF9fZnVuY19fKTsKKyAgIH0KKyAgIAorICAgcEFkYXB0ZXItPmRldi0+bGFzdF9yeCA9IGppZmZpZXM7CisKKyAgIHJldHVybiBzdGF0dXM7ICAgCit9CisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfdHhfcnhfcGt0X2NudF9zdGF0X3RpbWVyX2hhbmRsZXIoKSAtCisgICAgICAgICAgICAgICBFbmFibGUvRGlzYWJsZSBzcGxpdCBzY2FuIGJhc2VkIG9uIFRYIGFuZCBSWCB0cmFmZmljLgorICBAcGFyYW0gSGRkQ29udGV4dCAgICAgIDogW2luXSBwb2ludGVyIHRvIEhkZCBjb250ZXh0CisgIEByZXR1cm4gICAgICAgICAgICAgICAgOiBOb25lCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIGhkZF90eF9yeF9wa3RfY250X3N0YXRfdGltZXJfaGFuZGxlciggdm9pZCAqcGhkZGN0eCkKK3sKKyAgICBoZGRfYWRhcHRlcl9saXN0X25vZGVfdCAqcEFkYXB0ZXJOb2RlID0gTlVMTCwgKnBOZXh0ID0gTlVMTDsKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciA9IE5VTEw7CisgICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHggPSBOVUxMOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSAoaGRkX2NvbnRleHRfdCAqKXBoZGRjdHg7CisgICAgaGRkX2NvbmZpZ190ICAqY2ZnX3BhcmFtID0gcEhkZEN0eC0+Y2ZnX2luaTsKKyAgICBWT1NfU1RBVFVTIHN0YXR1czsKKyAgICB2X1U4X3Qgc3RhSWQgPSAwOworICAgIHZfVThfdCBmY29ubmVjdGVkID0gMDsKKworICAgIEVOVEVSKCk7CisgICAgaWYgKDAgIT0gKHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCkpKQorICAgIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBpZiAoIWNmZ19wYXJhbS0+ZHluU3BsaXRzY2FuKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERF9EQVRBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAiJXM6IEVycm9yIDogRHluYW1pYyBzcGxpdCBzY2FuIGlzIG5vdCBFbmFibGVkIDogJWQiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fLCBwSGRkQ3R4LT5jZmdfaW5pLT5keW5TcGxpdHNjYW4pOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgc3RhdHVzID0gaGRkX2dldF9mcm9udF9hZGFwdGVyICggcEhkZEN0eCwgJnBBZGFwdGVyTm9kZSApOworICAgIHdoaWxlICggTlVMTCAhPSBwQWRhcHRlck5vZGUgJiYgVk9TX1NUQVRVU19TVUNDRVNTID09IHN0YXR1cyApCisgICAgeworICAgICAgICBwQWRhcHRlciA9IHBBZGFwdGVyTm9kZS0+cEFkYXB0ZXI7CisKKyAgICAgICAgaWYgKChOVUxMICE9IHBBZGFwdGVyKSAmJiAoV0xBTl9IRERfQURBUFRFUl9NQUdJQyA9PSBwQWRhcHRlci0+bWFnaWMpKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSEREX0RBVEEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAiJXM6IEFkYXB0ZXIgd2l0aCBkZXZpY2UgbW9kZSAlZCBleGlzdHMiLAorICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcEFkYXB0ZXItPmRldmljZV9tb2RlKTsKKworICAgICAgICAgICAgaWYgKChXTEFOX0hERF9JTkZSQV9TVEFUSU9OID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkgfHwKKyAgICAgICAgICAgICAgICAgICAgKFdMQU5fSEREX1AyUF9DTElFTlQgPT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwSGRkU3RhQ3R4ID0gV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlcik7CisgICAgICAgICAgICAgICAgaWYgKChlQ29ubmVjdGlvblN0YXRlX0Fzc29jaWF0ZWQgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5jb25uU3RhdGUpICYmCisgICAgICAgICAgICAgICAgICAgIChWT1NfVFJVRSA9PSBwSGRkU3RhQ3R4LT5jb25uX2luZm8udUlzQXV0aGVudGljYXRlZCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBmY29ubmVjdGVkID0gVFJVRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmICgoV0xBTl9IRERfU09GVEFQID09IHBBZGFwdGVyLT5kZXZpY2VfbW9kZSkgfHwKKyAgICAgICAgICAgICAgICAgICAgIChXTEFOX0hERF9QMlBfR08gPT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2X0NPTlRFWFRfdCBwVm9zQ29udGV4dCA9ICggV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcikpLT5wdm9zQ29udGV4dDsKKyAgICAgICAgICAgICAgICBwdFNhcENvbnRleHQgcFNhcEN0eCA9IFZPU19HRVRfU0FQX0NCKHBWb3NDb250ZXh0KTsKKyAgICAgICAgICAgICAgICBpZihwU2FwQ3R4ID09IE5VTEwpeworICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IRERfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgicHNhcEN0eCBpcyBOVUxMIikpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGZvciAoc3RhSWQgPSAwOyBzdGFJZCA8IFdMQU5fTUFYX1NUQV9DT1VOVDsgc3RhSWQrKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmICgocFNhcEN0eC0+YVN0YUluZm9bc3RhSWRdLmlzVXNlZCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIChXTEFOVExfU1RBX0FVVEhFTlRJQ0FURUQgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTYXBDdHgtPmFTdGFJbmZvW3N0YUlkXS50bFNUQVN0YXRlKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZmNvbm5lY3RlZCA9IFRSVUU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoIGZjb25uZWN0ZWQgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IRERfREFUQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IE9uZSBvZiB0aGUgaW50ZXJmYWNlIGlzIGNvbm5lY3RlZCBjaGVjayBmb3Igc2NhbiIsCisgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERF9EQVRBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBwa3RfdHhfY291bnQ6ICVkLCBwa3RfcnhfY291bnQ6ICVkICIKKyAgICAgICAgICAgICAgICAgICAgICAgIm1pcmFjYXN0ID0gJWQiLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5oZGRfc3RhdHMuaGRkVHhSeFN0YXRzLnBrdF90eF9jb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5oZGRfc3RhdHMuaGRkVHhSeFN0YXRzLnBrdF9yeF9jb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPmRydnJfbWlyYWNhc3QpOworCisgICAgICAgICAgICAgICAgdm9zX3RpbWVyX3N0YXJ0KCZwSGRkQ3R4LT50eF9yeF90cmFmZmljVG1yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2ZnX3BhcmFtLT50cmFmZmljTW50clRtckZvclNwbGl0U2Nhbik7CisgICAgICAgICAgICAgICAgLy9DaGVjayBmb3IgdGhlIHByZXZpb3VzIHN0YXRpc3RpY3MgY291bnQKKyAgICAgICAgICAgICAgICBpZiAoKHBBZGFwdGVyLT5oZGRfc3RhdHMuaGRkVHhSeFN0YXRzLnBrdF90eF9jb3VudCA+CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZmdfcGFyYW0tPnR4UnhUaHJlc2hvbGRGb3JTcGxpdFNjYW4pIHx8CisgICAgICAgICAgICAgICAgICAgIChwQWRhcHRlci0+aGRkX3N0YXRzLmhkZFR4UnhTdGF0cy5wa3RfcnhfY291bnQgPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2ZnX3BhcmFtLT50eFJ4VGhyZXNob2xkRm9yU3BsaXRTY2FuKSB8fAorICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT5kcnZyX21pcmFjYXN0IHx8CisgICAgICAgICAgICAgICAgICAgIChXTEFOX0hERF9QMlBfR08gPT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5oZGRfc3RhdHMuaGRkVHhSeFN0YXRzLnBrdF90eF9jb3VudCA9IDA7CisgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5oZGRfc3RhdHMuaGRkVHhSeFN0YXRzLnBrdF9yeF9jb3VudCA9IDA7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFwSGRkQ3R4LT5pc3NwbGl0c2Nhbl9lbmFibGVkKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT5pc3NwbGl0c2Nhbl9lbmFibGVkID0gVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNtZV9lbmFibGVfZGlzYWJsZV9zcGxpdF9zY2FuKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNmZ19wYXJhbS0+bk51bVN0YUNoYW5Db21iaW5lZENvbmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNmZ19wYXJhbS0+bk51bVAyUENoYW5Db21iaW5lZENvbmMpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPmhkZF9zdGF0cy5oZGRUeFJ4U3RhdHMucGt0X3R4X2NvdW50ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPmhkZF9zdGF0cy5oZGRUeFJ4U3RhdHMucGt0X3J4X2NvdW50ID0gMDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZmNvbm5lY3RlZCA9IEZBTFNFOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHN0YXR1cyA9IGhkZF9nZXRfbmV4dF9hZGFwdGVyKCBwSGRkQ3R4LCBwQWRhcHRlck5vZGUsICZwTmV4dCk7CisgICAgICAgIHBBZGFwdGVyTm9kZSA9IHBOZXh0OworICAgIH0KKworICAgIC8qIElmIFRETFNTY2FuQ29leGlzdGVuY2UgaXMgZW5hYmxlZCwgdGhlbiB0aGUgVERMUyBtb2R1bGUgc2hhbGwgdGFrZSBjYX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leV9pbmZvID0gKHVpbnQxNl90KSgqKHVpbnQxNl90ICopCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc2tiLT5kYXRhICsgSEREX0VBUE9MX0tFWV9JTkZPX09GRlNFVCkpOworICAgIC8qIFRoaXMgdGVsbHMgaWYgRUFQT0wgcGFja2V0IGlzIGluIFJYIG9yIFRYCisgICAgICogZGlyZWN0aW9uLgorICAgICAqLworICAgICBlYXBvbF9wYXJhbXMtPmV2ZW50X3N1Yl90eXBlID0gZXZlbnRfdHlwZTsKKworICAgIC8qIFRoaXMgdGVsbHMgdGhlIHJhdGUgYXQgd2hpY2ggRUFQT0wgcGFja2V0CisgICAgICogaXMgc2VuZCBvciByZWNlaXZlZC4KKyAgICAgKi8KKyAgICAgLy9UT0RPIGZpbGwgZGF0YSByYXRlIGZvciByeCBwYWNrZXQuCisgICAgIGVhcG9sX3BhcmFtcy0+ZWFwb2xfcmF0ZSA9IDA7LyogQXMgb2Ygbm93LCB6ZXJvICovCisKKyAgICAgdm9zX21lbV9jb3B5KGVhcG9sX3BhcmFtcy0+ZGVzdF9hZGRyLAorICAgICAgICAgICAgICAgICAoc2tiLT5kYXRhICsgSEREX0VBUE9MX0RFU1RfTUFDX09GRlNFVCksCisgICAgICAgICAgICAgICAgICBzaXplb2YoZWFwb2xfcGFyYW1zLT5kZXN0X2FkZHIpKTsKKyAgICAgdm9zX21lbV9jb3B5KGVhcG9sX3BhcmFtcy0+c3JjX2FkZHIsCisgICAgICAgICAgICAgICAgIChza2ItPmRhdGEgKyBIRERfRUFQT0xfU1JDX01BQ19PRkZTRVQpLAorICAgICAgICAgICAgICAgICAgc2l6ZW9mKGVhcG9sX3BhcmFtcy0+c3JjX2FkZHIpKTsKKyAgICAgcmV0dXJuOworfQorLyoKKyAqIHdsYW5faGRkX2V2ZW50X2VhcG9sX2xvZygpIC0gRnVuY3Rpb24gdG8gbG9nIEVBUE9MIGV2ZW50cworICogQGVhcG9sX3BhcmFtczogICAgU3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AgICAgICAxMQorI2RlZmluZSBXTEFOX1NUQVRTX1RYX0JZVEVfQ05UICAgICAgICAxMgorCisjZGVmaW5lIFdMQU5fU1RBVFNfUlhfQllURV9DTlQgICAgICAgIDEzCisjZGVmaW5lIFdMQU5fU1RBVFNfUlhfUkFURSAgICAgICAgICAgIDE0CisjZGVmaW5lIFdMQU5fU1RBVFNfVFhfUkFURSAgICAgICAgICAgIDE1CisKKyNkZWZpbmUgV0xBTl9TVEFUU19SWF9VQ19CWVRFX0NOVCAgICAgMTYKKyNkZWZpbmUgV0xBTl9TVEFUU19SWF9NQ19CWVRFX0NOVCAgICAgMTcKKyNkZWZpbmUgV0xBTl9TVEFUU19SWF9CQ19CWVRFX0NOVCAgICAgMTgKKyNkZWZpbmUgV0xBTl9TVEFUU19UWF9VQ19CWVRFX0NOVCAgICAgMTkKKyNkZWZpbmUgV0xBTl9TVEFUU19UWF9NQ19CWVRFX0NOVCAgICAgMjAKKyNkZWZpbmUgV0xBTl9TVEFUU19UWF9CQ19CWVRFX0NOVCAgICAgMjEKKworI2RlZmluZSBGSUxMX1RMVihfX3AsIF9fdHlwZSwgX19zaXplLCBfX3ZhbCwgX190bGVuKSBkbyB7ICAgICAgICAgICBcCisgICAgICAgIGlmICgoX190bGVuICsgX19zaXplICsgMikgPCBXRV9NQVhfU1RSX0xFTikgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgKl9fcCsrID0gX190eXBlOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAqX19wKysgPSBfX3NpemU7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgIG1lbWNweShfX3AsIF9fdmFsLCBfX3NpemUpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgX19wICs9IF9fc2l6ZTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICBfX3RsZW4gKz0gX19zaXplICsgMjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICBlbHNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJGSUxMX1RMViBGYWlsZWQhISEiKTsgIFwKKyAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIH0gd2hpbGUoMCk7CisKKyNkZWZpbmUgVkVSU0lPTl9WQUxVRV9NQVhfTEVOIDMyCisKKyNkZWZpbmUgVFhfUEVSX1RSQUNLSU5HX0RFRkFVTFRfUkFUSU8gICAgICAgICAgICAgNQorI2RlZmluZSBUWF9QRVJfVFJBQ0tJTkdfTUFYX1JBVElPICAgICAgICAgICAgICAgIDEwCisjZGVmaW5lIFRYX1BFUl9UUkFDS0lOR19ERUZBVUxUX1dBVEVSTUFSSyAgICAgICAgIDUKKworI2RlZmluZSBXTEFOX0FEQVBURVIgMAorI2RlZmluZSBQMlBfQURBUFRFUiAgMQorCisjZGVmaW5lIFRYX1BXUl9NSU4gIDYKKyNkZWZpbmUgVFhfUFdSX01BWCAyMgorI2RlZmluZSBUWF9QV1JfREVGIDUwCisKKy8qCisgKiBXaGVuIHN1cHBsaWNhbnQgc2VuZHMgU0VUQkFORCBpb2N0bCBpdCBxdWVyaWVzIGZvciBjaGFubmVscyBmcm9tCisgKi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24oaEhhbCwgd2Nuc3NfSFdfdmVyc2lvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHdjbnNzX0hXX3ZlcnNpb24pKTsKKyAgICBpZiAoVk9TX0lTX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgeworICAgICAgICBwSFd2ZXJzaW9uID0gd2Nuc3NfSFdfdmVyc2lvbjsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgcEhXdmVyc2lvbiA9ICJVbmtub3duIjsKKyAgICB9CisKKyAgICBzdGF0dXMgPSB3Y25zc19nZXRfaXJpc19uYW1lKGlyaXNfbmFtZSk7CisKKyAgICBpZiAoIXN0YXR1cykgeworICAgICAgICBwSVJJU3ZlcnNpb24gPSBpcmlzX25hbWU7CisgICAgfSBlbHNlIHsKKyAgICAgICAgcElSSVN2ZXJzaW9uID0gIlVua25vd24iOworICAgIH0KKworICAgIHdycXUtPmRhdGEubGVuZ3RoID0gc2NucHJpbnRmKGV4dHJhLCBXRV9NQVhfU1RSX0xFTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJIb3N0IFNXOiVzLCBGVzolcywgSFc6JXMsIElSSVNfSFc6JXMiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUVdMQU5fVkVSU0lPTlNUUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTV3ZlcnNpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSFd2ZXJzaW9uLCBwSVJJU3ZlcnNpb24pOworCisgICAgcmV0dXJuOworfQorCitpbnQgaGRkX3dsYW5fZ2V0X3J0c190aHJlc2hvbGQoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsIHVuaW9uIGl3cmVxX2RhdGEgKndycXUpCit7CisgICAgdEhhbEhhbmRsZSBoSGFsOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgdl9VMzJfdCB0aHJlc2hvbGQgPSAwOworICAgIGludCByZXQgPSAwOworCisgICAgRU5URVIoKTsKKyAgICBpZiAoTlVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBBZGFwdGVyIGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIHJldCA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gcmV0KQorICAgIHsKKyAgICAgICAgcmV0dXJuIHJldDsKKyAgICB9CisKKyAgICBoSGFsID0gV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpOworICAgIGlmIChOVUxMID09IGhIYWwpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogSGFsIENvbnRleHQgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBpZiAoIGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0KKyAgICAgICAgICAgICAgICAgICAgIGNjbUNmZ0dldEludChoSGFsLCBXTklfQ0ZHX1JUU19USFJFU0hPTEQsICZ0aHJlc2hvbGQpICkKKyAgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgICAgICAgICBGTCgiZmFpbGVkIHRvIGdldCBpbmkgcGFyYW1ldGVyLCBXTklfQ0ZHX1JUU19USFJFU0hPTEQiKSk7CisgICAgICAgcmV0dXJuIC1FSU87CisgICAgfQorICAgIHdycXUtPnJ0cy52YWx1ZSA9IHRocmVzaG9sZDsKKworICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIlJ0cy1UaHJlc2hvbGQ9JWQhISIpLCB3cnF1LT5ydHMudmFsdWUpOworCisgICAgRVhJVCgpOworCisgICAgcmV0dXJuIDA7Cit9CisKK2ludCBoZGRfd2xhbl9nZXRfZnJhZ190aHJlc2hvbGQoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsIHVuaW9uIGl3cmVxX2RhdGEgKndycXUpCit7CisgICAgdEhhbEhhbmRsZSBoSGFsOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgdl9VMzJfdCB0aHJlc2hvbGQgPSAwLCBzdGF0dXMgPSAwOworCisgICAgRU5URVIoKTsKKworICAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgc3RhdHVzID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSBzdGF0dXMpCisgICAgeworICAgICAgICByZXR1cm4gc3RhdHVzOworICAgIH0KKworICAgIGhIYWwgPSBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlcik7CisgICAgaWYgKE5VTEwgPT0gaEhhbCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBIYWwgQ29udGV4dCBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIGlmICggY2NtQ2ZnR2V0SW50KGhIYWwsIFdOSV9DRkdfRlJBR01FTlRBVElPTl9USFJFU0hPTEQsICZ0aHJlc2hvbGQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBlSEFMX1NUQVRVU19TVUNDRVNTICkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICAgICAgRkwoImZhaWxlZCB0byBnZXQgaW5pIHBhcmFtZXRlciwgV05JX0NGR19GUkFHTUVOVEFUSU9OX1RIUkVTSE9MRCIpKTsKKyAgICAgICAgcmV0dXJuIC1FSU87CisgICAgfQorICAgIHdycXUtPmZyYWcudmFsdWUgPSB0aHJlc2hvbGQ7CisKKyAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgiRnJhZy1UaHJlc2hvbGQ9JWQhISIpLCB3cnF1LT5mcmFnLnZhbHVlKTsKKworICAgIEVYSVQoKTsKKworICAgIHJldHVybiAwOworfQorCitpbnQgaGRkX3dsYW5fZ2V0X2ZyZXEodl9VMzJfdCBjaGFubmVsLCB2X1UzMl90ICpwZnJlcSkKK3sKKyAgICBpbnQgaTsKKyAgICBpZiAoY2hhbm5lbCA+IDApCisgICAgeworICAgICAgICBmb3IgKGk9MDsgaSA8IEZSRVFfQ0hBTl9NQVBfVEFCTEVfU0laRTsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoY2hhbm5lbCA9PSBmcmVxX2NoYW5fbWFwW2ldLmNoYW4pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKnBmcmVxID0gZnJlcV9jaGFuX21hcFtpXS5mcmVxOworICAgICAgICAgICAgICAgIHJldHVybiAxOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCJJbnZhbGlkIGNoYW5uZWwgbm89JWQhISIpLCBjaGFubmVsKTsKKyAgICByZXR1cm4gLUVJTlZBTDsKK30KKworc3RhdGljIHZfQk9PTF90CitoZGRfSXNBdXRoVHlwZVJTTiggdEhhbEhhbmRsZSBoYWxIYW5kbGUsIGVDc3JBdXRoVHlwZSBhdXRoVHlwZSkKK3sKKyAgICB2X0JPT0xfdCByc25UeXBlID0gVk9TX0ZBTFNFOworICAgIC8vIGlzIHRoZSBhdXRoVHlwZSBzdXBwb3J0ZWQ/CisgICAgc3dpdGNoIChhdXRoVHlwZSkKKyAgICB7CisgICAgICAgIGNhc2UgZUNTUl9BVVRIX1RZUEVfTk9ORTogICAgLy9uZXZlciB1c2VkCisgICAgICAgICAgICByc25UeXBlID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIC8vIE1BQyBsYXllciBhdXRoZW50aWNhdGlvbiB0eXBlcworICAgICAgICBjYXNlIGVDU1JfQVVUSF9UWVBFX09QRU5fU1lTVEVNOgorICAgICAgICAgICAgcnNuVHlwZSA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVDU1JfQVVUSF9UWVBFX1NIQVJFRF9LRVk6CisgICAgICAgICAgICByc25UeXBlID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgYn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VfUlNOXzgwMjFYX1NIQTI1NjoKKyNlbmRpZgorICAgICAgICAgICAgcnNuVHlwZSA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIC8vY2FzZSBlQ1NSX0FVVEhfVFlQRV9GQUlMRUQ6CisgICAgICAgIGNhc2UgZUNTUl9BVVRIX1RZUEVfVU5LTk9XTjoKKyAgICAgICAgICAgIHJzblR5cGUgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGhkZExvZyhMT0dFLCBGTCgiJXMgY2FsbGVkIHdpdGggdW5rbm93biBhdXRoVHlwZSAtIGRlZmF1bHQgdG8gT3BlbiwgTm9uZSIpLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHJzblR5cGUgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgICAgICBicmVhazsKKyAgICB9CisgICAgaGRkTG9nKExPR0UsIEZMKCIlcyBjYWxsZWQgd2l0aCBhdXRoVHlwZTogJWQsIHJldHVybmVkOiAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIGF1dGhUeXBlLCByc25UeXBlKTsKKyAgICByZXR1cm4gcnNuVHlwZTsKK30KKworc3RhdGljIHZvaWQgaGRkX0dldFJzc2lDQiggdl9TN190IHJzc2ksIHRBTklfVTMyIHN0YUlkLCB2b2lkICpwQ29udGV4dCApCit7CisgICBzdHJ1Y3Qgc3RhdHNDb250ZXh0ICpwU3RhdHNDb250ZXh0OworICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXI7CisKKyAgIGlmIChpb2N0bF9kZWJ1ZykKKyAgIHsKKyAgICAgIHByX2luZm8oIiVzOiByc3NpIFslZF0gU1RBIFslZF0gcENvbnRleHQgWyVwXVxuIiwKKyAgICAgICAgICAgIC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bnJDQih0QU5JX1M4IHNuciwgdEFOSV9VMzIgc3RhSWQsIHZvaWQgKnBDb250ZXh0KQoreworICAgc3RydWN0IHN0YXRzQ29udGV4dCAqcFN0YXRzQ29udGV4dDsKKyAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyOworCisgICBpZiAoaW9jdGxfZGVidWcpCisgICB7CisgICAgICBwcl9pbmZvKCIlczogc25yIFslZF0gU1RBIFslZF0gcENvbnRleHQgWyVwXVxuIiwKKyAgICAgICAgICAgICAgX19mdW5jX18sIChpbnQpc25yLCAoaW50KXN0YUlkLCBwQ29udGV4dCk7CisgICB9CisKKyAgIGlmIChOVUxMID09IHBDb250ZXh0KQorICAgeworICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAiJXM6IEJhZCBwYXJhbSwgcENvbnRleHQgWyVwXSIsCisgICAgICAgICAgICAgX19mdW5jX18sIHBDb250ZXh0KTsKKyAgICAgIHJldHVybjsKKyAgIH0KKworICAgcFN0YXRzQ29udGV4dCA9IHBDb250ZXh0OworICAgcEFkYXB0ZXIgICAgICA9IHBTdGF0c0NvbnRleHQtPnBBZGFwdGVyOworCisgICAvKiB0aGVyZSBpcyBhIHJhY2UgY29uZGl0aW9uIHRoYXQgZXhpc3RzIGJldHdlZW4gdGhpcyBjYWxsYmFjaworICAgICAgZnVuY3Rpb24gYW5kIHRoZSBjYWxsZXIgc2luY2UgdGhlIGNhbGxlciBjb3VsZCB0aW1lIG91dCBlaXRoZXIKKyAgICAgIGJlZm9yZSBvciB3aGlsZSB0aGlzIGNvZGUgaXMgZXhlY3V0aW5nLiAgd2UgdXNlIGEgc3BpbmxvY2sgdG8KKyAgICAgIHNlcmlhbGl6ZSB0aGVzZSBhY3Rpb25zICovCisgICBzcGluX2xvY2soJmhkZF9jb250ZXh0X2xvY2spOworCisgICBpZiAoKE5VTEwgPT0gcEFkYXB0ZXIpIHx8IChTTlJfQ09OVEVYVF9NQUdJQyAhPSBwU3RhdHNDb250ZXh0LT5tYWdpYykpCisgICB7CisgICAgICAvKiB0aGUgY2FsbGVyIHByZXN1bWFibHkgdGltZWQgb3V0IHNvIHRoZXJlIGlzIG5vdGhpbmcgd2UgY2FuIGRvICovCisgICAgICBzcGluX3VubG9jaygmaGRkX2NvbnRleHRfbG9jayk7CisgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIGNvbnRleHQsIHBBZGFwdGVyIFslcF0gbWFnaWMgWyUwOHhdIiwKKyAgICAgICAgICAgICAgX19mdW5jX18sIHBBZGFwdGVyLCBwU3RhdHNDb250ZXh0LT5tYWdpYyk7CisgICAgICBpZiAoaW9jdGxfZGVidWcpCisgICAgICB7CisgICAgICAgICBwcl9pbmZvKCIlczogSW52YWxpZCBjb250ZXh0LCBwQWRhcHRlciBbJXBdIG1hZ2ljIFslMDh4XVxuIiwKKyAgICAgICAgICAgICAgICAgX19mdW5jX18sIHBBZGFwdGVyLCBwU3RhdHNDb250ZXh0LT5tYWdpYyk7CisgICAgICB9CisgICAgICByZXR1cm47CisgICB9CisKKyAgIC8qIGNvbnRleHQgaXMgdmFsaWQgc28gY2FsbGVyIGlzIHN0aWxsIHdhaXRpbmcgKi8KKworICAgLyogcGFyYW5vaWE6IGludmFsaWRhdGUgdGhlIG1hZ2ljICovCisgICBwU3RhdHNDb250ZXh0LT5tYWdpYyA9IDA7CisKKyAgIC8qIGNvcHkgb3ZlciB0aGUgc25yICovCisgICBwQWRhcHRlci0+c25yID0gc25yOworCisgICAvKiBub3RpZnkgdGhlIGNhbGxlciAqLworICAgY29tcGxldGUoJnBTdGF0c0NvbnRleHQtPmNvbXBsZXRpb24pOworCisgICAvKiBzZXJpYWxpemF0aW9uIGlzIGNvbXBsZXRlICovCisgICBzcGluX3VubG9jaygmaGRkX2NvbnRleHRfbG9jayk7Cit9CisKK1ZPU19TVEFUVVMgd2xhbl9oZGRfZ2V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AgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczpOb3QgYXNzb2NpYXRlZCwgcnNzaSBvbiBEaXNjb25uZWN0IDogJWQiLAorICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcEFkYXB0ZXItPnJzc2lfb25fZGlzY29ubmVjdCk7CisgICAgICAgKnJzc2lfdmFsdWUgPSBwQWRhcHRlci0+cnNzaV9vbl9kaXNjb25uZWN0OworICAgICAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICB9CisKKyAgIGlmIChWT1NfVFJVRSA9PSBwSGRkU3RhQ3R4LT5oZGRfUmVhc3NvY1NjZW5hcmlvKQorICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICIlczogUm9hbWluZyBpbiBwcm9ncmVzcywgaGVuY2UgcmV0dXJuIGxhc3QgY2FjaGVkIFJTU0kiLCBfX2Z1bmNfXyk7CisgICAgICAgKnJzc2lfdmFsdWUgPSBwQWRhcHRlci0+cnNzaTsKKyAgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworICAgfQorCisgICBpbml0X2NvbXBsZXRpb24oJmNvbnRleHQuY29tcGxldGlvbik7CisgICBjb250ZXh0LnBBZGFwdGVyID0gcEFkYXB0ZXI7CisgICBjb250ZXh0Lm1hZ2ljID0gUlNTSV9DT05URVhUX01BR0lDOworCisgICBoc3RhdHVzID0gc21lX0dldFJzc2kocEhkZEN0eC0+aEhhbCwgaGRkX0dldFJzc2lDQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkU3RhQ3R4LT5jb25uX2luZm8uc3RhSWRbIDAgXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkU3RhQ3R4LT5jb25uX2luZm8uYnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgJmNvbnRleHQsIHBIZGRDdHgtPnB2b3NDb250ZXh0KTsKKyAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IGhzdGF0dXMpCisgICB7CisgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiJXM6IFVuYWJsZSB0byByZXRyaWV2ZSBSU1NJIiwKKyAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgIC8qIHdlJ2xsIHJldHVybmVkIGEgY2FjaGVkIHZhbHVlIGJlbG93ICovCisgICB9CisgICBlbHNlCisgICB7CisgICAgICAgLyogcmVxdWVzdCB3YXMgc2VudCAtLSB3YWl0IGZvciB0aGUgcmVzcG9uc2UgKi8KKyAgICAgICBscmMgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGVfdGltZW91dCgmY29udGV4dC5jb21wbGV0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcyhXTEFOX1dBSVRfVElNRV9TVEFUUykpOworICAgICAgIGlmIChscmMgPD0gMCkKKyAgICAgICB7CisgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiBTTUUgJXMgd2hpbGUgcmV0cmlldmluZyBSU1NJIiwKKyAgICAgICAgICAgICAgICAgX19mdW5jX18sICgwID09IGxyYykgPyAidGltZW91dCIgOiAiaW50ZXJydXB0Iik7CisgICAgICAgICAgLyogd2UnbGwgbm93IHJldHVybmVkIGEgY2FjaGVkIHZhbHVlIGJlbG93ICovCisgICAgICAgfQorICAgfQorCisgICAvKiBlaXRoZXIgd2UgbmV2ZXIgc2VudCBhIHJlcXVlc3QsIHdlIHNlbnQgYSByZXF1ZXN0IGFuZCByZWNlaXZlZCBhCisgICAgICByZXNwb25zZSBvciB3ZSBzZW50IGEgcmVxdWVzdCBhbmQgdGltZWQgb3V0LiAgaWYgd2UgbmV2ZXIgc2VudCBhCisgICAgICByZXF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mY29udGV4dC5jb21wbGV0aW9uKTsKKyAgIGNvbnRleHQucEFkYXB0ZXIgPSBwQWRhcHRlcjsKKyAgIGNvbnRleHQubWFnaWMgPSBTTlJfQ09OVEVYVF9NQUdJQzsKKworICAgaHN0YXR1cyA9IHNtZV9HZXRTbnIocEhkZEN0eC0+aEhhbCwgaGRkX0dldFNuckNCLAorICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5zdGFJZFsgMCBdLAorICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAmY29udGV4dCk7CisgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSBoc3RhdHVzKQorICAgeworICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIiVzOiBVbmFibGUgdG8gcmV0cmlldmUgUlNTSSIsCisgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAvKiB3ZSdsbCByZXR1cm5lZCBhIGNhY2hlZCB2YWx1ZSBiZWxvdyAqLworICAgfQorICAgZWxzZQorICAgeworICAgICAgIC8qIHJlcXVlc3Qgd2FzIHNlbnQgLS0gd2FpdCBmb3IgdGhlIHJlc3BvbnNlICovCisgICAgICAgbHJjID0gd2FpdF9mb3JfY29tcGxldGlvbl9pbnRlcnJ1cHRpYmxlX3RpbWVvdXQoJmNvbnRleHQuY29tcGxldGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoV0xBTl9XQUlUX1RJTUVfU1RBVFMpKTsKKyAgICAgICBpZiAobHJjIDw9IDApCisgICAgICAgeworICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogU01FICVzIHdoaWxlIHJldHJpZXZpbmcgU05SIiwKKyAgICAgICAgICAgICAgICAgX19mdW5jX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gY3VycmVudGx5IGV4ZWN1dGluZyAqLworICAgc3Bpbl9sb2NrKCZoZGRfY29udGV4dF9sb2NrKTsKKyAgIGNvbnRleHQubWFnaWMgPSAwOworICAgc3Bpbl91bmxvY2soJmhkZF9jb250ZXh0X2xvY2spOworCisgICAqc25yID0gcEFkYXB0ZXItPnNucjsKKworICAgRVhJVCgpOworICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIgfHwgZGVmaW5lZCBGRUFUVVJFX1dMQU5fRVNFIHx8IGRlZmluZWQoRkVBVFVSRV9XTEFOX0xGUikKKworc3RhdGljIHZvaWQgaGRkX0dldFJvYW1Sc3NpQ0IoIHZfUzdfdCByc3NpLCB0QU5JX1UzMiBzdGFJZCwgdm9pZCAqcENvbnRleHQgKQoreworICAgc3RydWN0IHN0YXRzQ29udGV4dCAqcFN0YXRzQ29udGV4dDsKKyAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyOworICAgaWYgKGlvY3RsX2RlYnVnKQorICAgeworICAgICAgcHJfaW5mbygiJXM6IHJzc2kgWyVkXSBTVEEgWyVkXSBwQ29udGV4dCBbJXBdXG4iLAorICAgICAgICAgICAgICBfX2Z1bmNfXywgKGludClyc3NpLCAoaW50KXN0YUlkLCBwQ29udGV4dCk7CisgICB9CisKKyAgIGlmIChOVUxMID09IHBDb250ZXh0KQorICAgeworICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAiJXM6IEJhZCBwYXJhbSwgcENvbnRleHQgWyVwXSIsCisgICAgICAgICAgICAgX19mdW5jX18sIHBDb250ZXh0KTsKKyAgICAgIHJldHVybjsKKyAgIH0KKworICAgcFN0YXRzQ29udGV4dCA9IHBDb250ZXh0OworICAgcEFkYXB0ZXIgICAgICA9IHBTdGF0c0NvbnRleHQtPnBBZGFwdGVyOworCisgICAvKiB0aGVyZSBpcyBhIHJhY2UgY29uZGl0aW9uIHRoYXQgZXhpc3RzIGJldHdlZW4gdGhpcyBjYWxsYmFjaworICAgICAgZnVuY3Rpb24gYW5kIHRoZSBjYWxsZXIgc2luY2UgdGhlIGNhbGxlciBjb3VsZCB0aW1lIG91dCBlaXRoZXIKKyAgICAgIGJlZm9yZSBvciB3aGlsZSB0aGlzIGNvZGUgaXMgZXhlY3V0aW5nLiAgd2UgdXNlIGEgc3BpbmxvY2sgdG8KKyAgICAgIHNlcmlhbGl6ZSB0aGVzZSBhY3Rpb25zICovCisgICBzcGluX2xvY2soJmhkZF9jb250ZXh0X2xvY2spOworCisgICBpZiAoKE5VTEwgPT0gcEFkYXB0ZXIpIHx8IChSU1NJX0NPTlRFWFRfTUFHSUMgIT0gcFN0YXRzQ29udGV4dC0+bWFnaWMpKQorICAgeworICAgICAgLyogdGhlIGNhbGxlciBwcmVzdW1hYmx5IHRpbWVkIG91dCBzbyB0aGVyZSBpcyBub3RoaW5nIHdlIGNhbiBkbyAqLworICAgICAgc3Bpbl91bmxvY2soJmhkZF9jb250ZXh0X2xvY2spOworICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICIlczogSW52YWxpZCBjb250ZXh0LCBwQWRhcHRlciBbJXBdIG1hZ2ljIFslMDh4XSIsCisgICAgICAgICAgICAgIF9fZnVuY19fLCBwQWRhcHRlciwgcFN0YXRzQ29udGV4dC0+bWFnaWMpOworICAgICAgaWYgKGlvY3RsX2RlYnVnKQorICAgICAgeworICAgICAgICAgcHJfaW5mbygiJXM6IEludmFsaWQgY29udGV4dCwgcEFkYXB0ZXIgWyVwXSBtYWdpYyBbJTA4eF1cbiIsCisgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBwQWRhcHRlciwgcFN0YXRzQ29udGV4dC0+bWFnaWMpOworICAgICAgfQorICAgICAgcmV0dXJuOworICAgfQorCisgICAvKiBjb250ZXh0IGlzIHZhbGlkIHNvIG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Modm9zX3N0YXR1cykpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IHZvc19ldmVudF9zZXQgZmFpbGVkIiwgX19mdW5jX18pOworICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KK30KKwordm9pZCBjY21DZmdTZXRDYWxsYmFjayh0SGFsSGFuZGxlIGhhbEhhbmRsZSwgdEFOSV9TMzIgcmVzdWx0KQoreworICAgdl9DT05URVhUX3QgcFZvc0NvbnRleHQ7CisgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgVk9TX1NUQVRVUyBoZGRfcmVjb25uZWN0X2FsbF9hZGFwdGVycyggaGRkX2NvbnRleHRfdCAqcEhkZEN0eCApOworI2lmIDAKKyAgIGhkZF93ZXh0X3N0YXRlX3QgKnBXZXh0U3RhdGU7CisgICB2X1UzMl90IHJvYW1JZDsKKyNlbmRpZgorCisgICBFTlRFUigpOworCisgICBwVm9zQ29udGV4dCA9IHZvc19nZXRfZ2xvYmFsX2NvbnRleHQoVk9TX01PRFVMRV9JRF9TWVMsTlVMTCk7CisKKyAgIHBIZGRDdHggPSAoaGRkX2NvbnRleHRfdCopIHZvc19nZXRfY29udGV4dChWT1NfTU9EVUxFX0lEX0hERCxwVm9zQ29udGV4dCk7CisgICBpZiAoTlVMTCA9PSBwSGRkQ3R4KQorICAgeworICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiBJbnZhbGlkIHBIZGRDdHgiLCBfX2Z1bmNfXyk7CisgICAgICByZXR1cm47CisgICB9CisjaWYgMAorICAgcFdleHRTdGF0ZSA9IHBBZGFwdGVyLT5wV2V4dFN0YXRlOworI2VuZGlmCisKKyAgIGlmIChXTklfQ0ZHX05FRURfUkVTVEFSVCA9P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GxldGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKEhERF9GSU5JU0hfVUxBX1RJTUVfT1VUKSk7CisgICAgICAgIGlmIChyYyA8PSAwKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICBGTCgiZmFpbHVyZSB3YWl0IG9uIFVMQSB0byBjb21wbGV0ZSAlbGQiKSwgcmMpOworICAgICAgICAgICAgLyogd2UnbGwgc3RpbGwgZmFsbCB0aHJvdWdoIGFuZCByZXR1cm4gc3VjY2VzcyBzaW5jZSB0aGUKKyAgICAgICAgICAgICAqIGNvbm5lY3Rpb24gbWF5IHN0aWxsIGdldCBlc3RhYmxpc2hlZCBidXQgaXMganVzdCB0YWtpbmcKKyAgICAgICAgICAgICAqIHRvbyBsb25nIGZvciB1cyB0byB3YWl0ICovCisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKwordl9VOF90KiB3bGFuX2hkZF9nZXRfdmVuZG9yX291aV9pZV9wdHIodl9VOF90ICpvdWksIHZfVThfdCBvdWlfc2l6ZSwgdl9VOF90ICppZSwgaW50IGllX2xlbikKK3sKKworICAgIGludCBsZWZ0ID0gaWVfbGVuOworICAgIHZfVThfdCAqcHRyID0gaWU7CisgICAgdl9VOF90IGVsZW1faWQsZWxlbV9sZW47CisgICAgdl9VOF90IGVpZCA9IDB4REQ7CisKKyAgICBpZiAoIE5VTEwgPT0gaWUgfHwgMCA9PSBpZV9sZW4gKQorICAgICAgIHJldHVybiBOVUxMOworCisgICAgd2hpbGUobGVmdCA+PSAyKQorICAgIHsKKyAgICAgICAgZWxlbV9pZCAgPSBwdHJbMF07CisgICAgICAgIGVsZW1fbGVuID0gcHRyWzFdOworICAgICAgICBsZWZ0IC09IDI7CisgICAgICAgIGlmKGVsZW1fbGVuID4gbGVmdCkKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICBGTCgiKioqKkludmFsaWQgSUVzIGVpZCA9ICVkIGVsZW1fbGVuPSVkIGxlZnQ9JWQqKioqKiIpLAorICAgICAgICAgICAgICAgICAgICBlaWQsZWxlbV9sZW4sbGVmdCk7CisgICAgICAgICAgICByZXR1cm4gTlVMTDsKKyAgICAgICAgfQorICAgICAgICBpZiAoZWxlbV9pZCA9PSBlaWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKG1lbWNtcCggJnB0clsyXSwgb3VpLCBvdWlfc2l6ZSk9PTApCisgICAgICAgICAgICAgICAgcmV0dXJuIHB0cjsKKyAgICAgICAgfQorCisgICAgICAgIGxlZnQgLT0gZWxlbV9sZW47CisgICAgICAgIHB0ciArPSAoZWxlbV9sZW4gKyAyKTsKKyAgICB9CisgICAgcmV0dXJuIE5VTEw7Cit9CisKK3N0YXRpYyBpbnQgX19pd19zZXRfY29tbWl0KHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXI7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgICBpbnQgcmV0ID0gMDsKKworICAgIEVOVEVSKCk7CisKKyAgICBwQWRhcHRlciAgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgICBpZiAoTlVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiJXM6IHBBZGFwdGVyIGlzIE5VTExcbiIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHJldCkKKyAgICB7CisgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorCisgICAgLyogRG8gbm90aGluZyBmb3Igbm93ICovCisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBpd19zZXRfY29tbWl0KHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaW50IHJldDsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX19pd19zZXRfY29tbWl0KGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQgX19pd19nZXRfbmFtZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICBjaGFyICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcjsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgIGludCByZXQgPSAwOworCisgICAgRU5URVIoKTsKKyAgICBwQWRhcHRlciAgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgICBpZiAoTlVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiJXM6IHBBZGFwdGVyIGlzIE5VTExcbiIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHJldCkKKyAgICB7CisgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorICAgIHN0cmxjcHkod3JxdSwgIlFjb206ODAyLjExbiIsIElGTkFNU0laKTsKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBpd19nZXRfbmFtZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICBjaGFyICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X2dldF9uYW1lKGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQgX19pd19zZXRfbW9kZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaGRkX3dleHRfc3RhdGVfdCAgICAgICAgICpwV2V4dFN0YXRlOworICAgIGhkZF9hZGFwdGVyX3QgICAgICAgICAgICAqcEFkYXB0ZXI7CisgICAgaGRkX2NvbnRleHRfdCAgICAgICAgICAgICpwSGRkQ3R4OworICAgIHRDc3JSb2FtUHJvZmlsZSAgICAgICAgICAqcFJvYW1Qcm9maWxlOworICAgIGVDc3JSb2FtQnNzVHlwZSAgICAgICAgICBMYXN0QlNTVHlwZTsKKyAgICBlTWliX2RvdDExRGVzaXJlZEJzc1R5cGUgY29ubmVjdGVkQnNzVHlwZTsKKyAgICBoZGRfY29uZmlnX3QgICAgICAgICAgICAgKnBDb25maWc7CisgICAgc3RydWN0IHdpcmVsZXNzX2RldiAgICAgICp3ZGV2OworICAgIGludCAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSAwOworCisgICAgRU5URVIoKTsKKworICAgIHBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgY29udGV4dCwgcEFkYXB0ZXIiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgc3RhdHVzID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSBzdGF0dXMpCisgICAgeworICAgICAgICByZXR1cm4gc3RhdHVzOworICAgIH0KKworICAgIHBXZXh0U3RhdGUgPSBXTEFOX0hERF9HRVRfV0VYVF9TVEFURV9QVFIocEFkYXB0ZXIpOwor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CU1NUeXBlICkgKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfU1RBVFVTIHZvc1N0YXR1czsKKyAgICAgICAgICAgIC8vIG5lZWQgdG8gaXNzdWUgYSBkaXNjb25uZWN0IHRvIENTUi4KKyAgICAgICAgICAgIElOSVRfQ09NUExFVElPTihwQWRhcHRlci0+ZGlzY29ubmVjdF9jb21wX3Zhcik7CisgICAgICAgICAgICB2b3NTdGF0dXMgPSBzbWVfUm9hbURpc2Nvbm5lY3QoIFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX0RJU0NPTk5FQ1RfUkVBU09OX0lCU1NfTEVBVkUgKTsKKyAgICAgICAgICAgIGlmKFZPU19TVEFUVVNfU1VDQ0VTUyA9PSB2b3NTdGF0dXMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIGxvbmcgcmV0OworICAgICAgICAgICAgICAgICByZXQgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGVfdGltZW91dCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBZGFwdGVyLT5kaXNjb25uZWN0X2NvbXBfdmFyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcyhXTEFOX1dBSVRfVElNRV9ESVNDT05ORUNUKSk7CisgICAgICAgICAgICAgICAgIGlmIChyZXQgPD0gMCkKKyAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoImZhaWxlZCB3YWl0IG9uIGRpc2Nvbm5lY3RfY29tcF92YXIgJWxkIiksIHJldCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIDA7Cit9CisKK3N0YXRpYyBpbnQgaXdfc2V0X21vZGUoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaW50IHJldDsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX19pd19zZXRfbW9kZShkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IF9faXdfZ2V0X21vZGUoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsCisgICAgICAgICAgICAgICAgICAgICAgICAgY2hhciAqZXh0cmEpCit7CisKKyAgICBoZGRfd2V4dF9zdGF0ZV90ICpwV2V4dFN0YXRlOworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgaW50IHJldCA9IDA7CisKKyAgICBFTlRFUigpOworCisgICAgcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgICBpZiAoTlVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgICIlczogSW52YWxpZCBjb250ZXh0LCBwQWRhcHRlciIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIHJldCA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gcmV0KQorICAgIHsKKyAgICAgICAgcmV0dXJuIHJldDsKKyAgICB9CisgICAgcFdleHRTdGF0ZSA9IFdMQU5fSEREX0dFVF9XRVhUX1NUQVRFX1BUUihwQWRhcHRlcik7CisgICAgaWYgKHBXZXh0U3RhdGUgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIGhkZExvZyhMT0dFLCAiJXMgRVJST1I6IERhdGEgU3RvcmFnZSBDb3JydXB0aW9uIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBzd2l0Y2ggKHBXZXh0U3RhdGUtPnJvYW1Qcm9maWxlLkJTU1R5cGUpCisgICAgeworICAgIGNhc2UgZUNTUl9CU1NfVFlQRV9JTkZSQVNUUlVDVFVSRToKKyAgICAgICAgaGRkTG9nKExPRzEsICIlcyByZXR1cm5zIElXX01PREVfSU5GUkEiLCBfX2Z1bmNfXyk7CisgICAgICAgIHdycXUtPm1vZGUgPSBJV19NT0RFX0lORlJBOworICAgICAgICBicmVhazsKKyAgICBjYXNlIGVDU1JfQlNTX1RZUEVfSUJTUzoKKyAgICBjYXNlIGVDU1JfQlNTX1RZUEVfU1RBUlRfSUJTUzoKKyAgICAgICAgaGRkTG9nKExPRzEsICIlcyByZXR1cm5zIElXX01PREVfQURIT0MiLCBfX2Z1bmNfXyk7CisgICAgICAgIHdycXUtPm1vZGUgPSBJV19NT0RFX0FESE9DOworICAgICAgICBicmVhazsKKyAgICBjYXNlIGVDU1JfQlNTX1RZUEVfQU5ZOgorICAgICAgICBoZGRMb2coTE9HMSwgIiVzIHJldHVybnMgSVdfTU9ERV9BVVRPIiwgX19mdW5jX18pOworICAgICAgICB3cnF1LT5tb2RlID0gSVdfTU9ERV9BVVRPOworICAgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgICBoZGRMb2coTE9HMSwgIiVzIHJldHVybnMgQVBNT0RFX1VOS05PV04iLCBfX2Z1bmNfXyk7CisgICAgICAgIGJyZWFrOworICAgIH0KKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljIGludCBpd19nZXRfbW9kZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LAorICAgICAgICAgICAgICAgICAgICAgICBjaGFyICpleHRyYSkKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X2dldF9tb2RlKGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQgX19pd19zZXRfZnJlcShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgdl9VMzJfdCBudW1DaGFucyA9IDA7CisgICAgdl9VOF90IHZhbGlkQ2hhbltXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU5dOworICAgIHZfVTMyX3QgaW5keCA9IDA7CisgICAgdl9VMzJfdCBzdGF0dXMgPSAwOworCisgICAgaGRkX3dleHRfc3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F9QVFIocEFkYXB0ZXIpOworICAgIGlmIChOVUxMID09IHBIZGRTdGFDdHgpCisgICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6U1RBIGNvbnRleHQgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIHBXZXh0U3RhdGUgPSBXTEFOX0hERF9HRVRfV0VYVF9TVEFURV9QVFIocEFkYXB0ZXIpOworICAgIGlmIChOVUxMID09IHBXZXh0U3RhdGUpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogcFdleHRTdGF0ZSBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIHBSb2FtUHJvZmlsZSA9ICZwV2V4dFN0YXRlLT5yb2FtUHJvZmlsZTsKKworICAgIGhkZExvZyhMT0cxLCJzZXRDSEFOTkVMIGlvY3RsIik7CisKKyAgICAvKiBMaW5rIGlzIHVwIHRoZW4gcmV0dXJuIGNhbnQgc2V0IGNoYW5uZWwqLworICAgIGlmKGVDb25uZWN0aW9uU3RhdGVfSWJzc0Nvbm5lY3RlZCA9PSBwSGRkU3RhQ3R4LT5jb25uX2luZm8uY29ublN0YXRlIHx8CisgICAgICAgZUNvbm5lY3Rpb25TdGF0ZV9Bc3NvY2lhdGVkID09IHBIZGRTdGFDdHgtPmNvbm5faW5mby5jb25uU3RhdGUpCisgICAgeworICAgICAgICBoZGRMb2coIExPR0UsICJJQlNTIEFzc29jaWF0ZWQiKTsKKyAgICAgICAgcmV0dXJuIC1FT1BOT1RTVVBQOworICAgIH0KKworICAgIC8qIFNldHRpbmdzIGJ5IEZyZXF1ZW5jeSBhcyBpbnB1dCAqLworICAgIGlmKCh3cnF1LT5mcmVxLmUgPT0gMSkgJiYgKHdycXUtPmZyZXEubSA+PSAodEFOSV9VMzIpMi40MTJlOCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAod3JxdS0+ZnJlcS5tIDw9ICh0QU5JX1UzMik1LjgyNWU4KSkKKyAgICB7CisgICAgICAgIHRBTklfVTMyIGZyZXEgPSB3cnF1LT5mcmVxLm0gLyAxMDAwMDA7CisKKyAgICAgICAgd2hpbGUgKChpbmR4IDwgIEZSRVFfQ0hBTl9NQVBfVEFCTEVfU0laRSkgJiYgKGZyZXEgIT0gZnJlcV9jaGFuX21hcFtpbmR4XS5mcmVxKSkKKyAgICAgICAgICAgIGluZHgrKzsKKyAgICAgICAgaWYgKGluZHggPj0gRlJFUV9DSEFOX01BUF9UQUJMRV9TSVpFKQorICAgICAgICB7CisgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgfQorICAgICAgICB3cnF1LT5mcmVxLmUgPSAwOworICAgICAgICB3cnF1LT5mcmVxLm0gPSBmcmVxX2NoYW5fbWFwW2luZHhdLmNoYW47CisKKyAgICB9CisKKyAgICBpZiAod3JxdS0+ZnJlcS5lID09IDApCisgICAgeworICAgICAgICBpZigod3JxdS0+ZnJlcS5tIDwgV05JX0NGR19DVVJSRU5UX0NIQU5ORUxfU1RBTUlOKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgKHdycXUtPmZyZXEubSA+IFdOSV9DRkdfQ1VSUkVOVF9DSEFOTkVMX1NUQU1BWCkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyhMT0cxLCIlczogQ2hhbm5lbCBbJWRdIGlzIG91dHNpZGUgdmFsaWQgcmFuZ2UgZnJvbSAlZCB0byAlZCIsCisgICAgICAgICAgICAgICAgX19mdW5jX18sIHdycXUtPmZyZXEubSwgV05JX0NGR19DVVJSRU5UX0NIQU5ORUxfU1RBTUlOLAorICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX0NVUlJFTlRfQ0hBTk5FTF9TVEFNQVgpOworICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICB9CisKKyAgICAgICAgbnVtQ2hhbnMgPSBXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU47CisKKyAgICAgICAgaWYgKGNjbUNmZ0dldFN0cihoSGFsLCBXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVCwKKyAgICAgICAgICAgICAgICB2YWxpZENoYW4sICZudW1DaGFucykgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUyl7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgRkwoImZhaWxlZCB0byBnZXQgaW5pIHBhcmFtZXRlciwgV05JX0NGR19WQUxJRF9DSEFOTkVMX0xJU1QiKSk7CisgICAgICAgICAgICByZXR1cm4gLUVJTzsKKyAgICAgICAgfQorCisgICAgICAgIGZvciAoaW5keCA9IDA7IGluZHggPCBudW1DaGFuczsgaW5keCsrKSB7CisgICAgICAgICAgICBpZiAod3JxdS0+ZnJlcS5tID09IHZhbGlkQ2hhbltpbmR4XSl7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZXsKKworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBpZihpbmR4ID49IG51bUNoYW5zKQorICAgIHsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgLyogU2V0IHRoZSBPcGVyYXRpb25hbCBDaGFubmVsICovCisgICAgbnVtQ2hhbnMgPSBwUm9hbVByb2ZpbGUtPkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHMgPSAxOworICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5vcGVyYXRpb25DaGFubmVsID0g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AgICAgIGlmKCBUUlVFID09IHN0YXR1cyApCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8qIFNldCBFeHBvbmVudCBwYXJhbWV0ZXIgYXMgNiAoTUhaKSBpbiBzdHJ1Y3QgaXdfZnJlcQorICAgICAgICAgICAgICAgICogaXdsaXN0ICYgaXdjb25maWcgY29tbWFuZCBzaG93cyBmcmVxdWVuY3kgaW50byBwcm9wZXIKKyAgICAgICAgICAgICAgICAqIGZvcm1hdCAoMi40MTIgR0h6IGluc3RlYWQgb2YgMjQ2LjIgTUh6KSovCisgICAgICAgICAgICAgICBmd3JxLT5tID0gZnJlcTsKKyAgICAgICAgICAgICAgIGZ3cnEtPmUgPSBNSFo7CisgICAgICAgICAgIH0KKyAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgLyogU2V0IEV4cG9uZW50IHBhcmFtZXRlciBhcyA2IChNSFopIGluIHN0cnVjdCBpd19mcmVxCisgICAgICAgICogaXdsaXN0ICYgaXdjb25maWcgY29tbWFuZCBzaG93cyBmcmVxdWVuY3kgaW50byBwcm9wZXIKKyAgICAgICAgKiBmb3JtYXQgKDIuNDEyIEdIeiBpbnN0ZWFkIG9mIDI0Ni4yIE1IeikqLworICAgICAgIGZ3cnEtPm0gPSAwOworICAgICAgIGZ3cnEtPmUgPSBNSFo7CisgICAgfQorCisgICAgRVhJVCgpOworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQgaXdfZ2V0X2ZyZXEoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X2ZyZXEgKmZ3cnEsIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9faXdfZ2V0X2ZyZXEoZGV2LCBpbmZvLCBmd3JxLCBleHRyYSk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBfX2l3X2dldF90eF9wb3dlcihzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKworICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXI7CisgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHg7CisgICBpbnQgcmV0ID0gMDsKKworICAgRU5URVIoKTsKKworICAgcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgfQorICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgcmV0ID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgIGlmICgwICE9IHJldCkKKyAgIHsKKyAgICAgICByZXR1cm4gcmV0OworICAgfQorCisgICBwSGRkU3RhQ3R4ID0gV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlcik7CisgICBpZiAoTlVMTCA9PSBwSGRkU3RhQ3R4KQorICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IFNUQSBDb250ZXh0IGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgIH0KKworICAgaWYoZUNvbm5lY3Rpb25TdGF0ZV9Bc3NvY2lhdGVkICE9IHBIZGRTdGFDdHgtPmNvbm5faW5mby5jb25uU3RhdGUpCisgICB7CisgICAgICB3cnF1LT50eHBvd2VyLnZhbHVlID0gMDsKKyAgICAgIHJldHVybiAwOworICAgfQorICAgd2xhbl9oZGRfZ2V0X2NsYXNzQXN0YXRzKHBBZGFwdGVyKTsKKyAgIHdycXUtPnR4cG93ZXIudmFsdWUgPSBwQWRhcHRlci0+aGRkX3N0YXRzLkNsYXNzQV9zdGF0Lm1heF9wd3I7CisKKyAgIEVYSVQoKTsKKyAgIHJldHVybiAwOworfQorCitzdGF0aWMgaW50IGl3X2dldF90eF9wb3dlcihzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9faXdfZ2V0X3R4X3Bvd2VyKGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQgX19pd19zZXRfdHhfcG93ZXIoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXI7CisgICAgdEhhbEhhbmRsZSBoSGFsOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgaW50IHJldCA9IDA7CisKKyAgICBFTlRFUigpOworICAgIHBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogQWRhcHRlciBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHJldCkKKyAgICB7CisgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorCisgICAgaEhhbCA9IFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKTsKKyAgICBpZiAoTlVMTCA9PSBoSGFsKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEhhbCBDb250ZXh0IGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIGlmICggY2NtQ2ZnU2V0SW50KGhIYWwsIFdOSV9DRkdfQ1VSUkVOVF9UWF9QT1dFUl9MRVZFTCwgd3JxdS0+dHhwb3dlci52YWx1ZSwgY2NtQ2ZnU2V0Q2FsbGJhY2ssIGVBTklfQk9PTEVBTl9UUlVFKSAhPSBlSEFMX1NUQVRVU19TVUNDRVNTICkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIEZMKCJmYWlsZWQgdG8gc2V0IGluaSBwYXJhbWV0ZXIsIFdOSV9DRkdfQ1VSUkVOVF9UWF9QT1dFUl9MRVZFTCIpKTsKKyAgICAgICAgcmV0dXJuIC1FSU87CisgICAgfQorCisgICAgRVhJVCgpOworCisgICAgcmV0dXJuIDA7Cit9CisKK3N0YXRpYyBpbnQgaXdfc2V0X3R4X3Bvd2VyKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaW50IHJldDsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX19pd19zZXRfdHhfcG93ZXIoZGV2LCBpbmZvLCB3cnF1LCBleHRyYSk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBfX2l3X2dldF9iaXRyYXRlKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgIFZPU19TVEFUVVMgdm9zX3N0YXR1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ChlQ29ubmVjdGlvblN0YXRlX0Fzc29jaWF0ZWQgIT0gcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmNvbm5TdGF0ZSkgeworICAgICAgICB3cnF1LT5iaXRyYXRlLnZhbHVlID0gMDsKKyAgIH0KKyAgIGVsc2UKKyAgIHsKKyAgICAgIHN0YXR1cyA9IHNtZV9HZXRTdGF0aXN0aWNzKCBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksIGVDU1JfSERELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNNRV9TVU1NQVJZX1NUQVRTICAgICAgIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTTUVfR0xPQkFMX0NMQVNTQV9TVEFUUyB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU01FX0dMT0JBTF9DTEFTU0JfU1RBVFMgfAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNNRV9HTE9CQUxfQ0xBU1NDX1NUQVRTIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTTUVfR0xPQkFMX0NMQVNTRF9TVEFUUyB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU01FX1BFUl9TVEFfU1RBVFMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGRkX1N0YXRpc3RpY3NDQiwgMCwgRkFMU0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLnN0YUlkWzBdLCBwQWRhcHRlciApOworCisgICAgICBpZihlSEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgIHsKKyAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOiBVbmFibGUgdG8gcmV0cmlldmUgc3RhdGlzdGljcyIsCisgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgIH0KKworICAgICAgcFdleHRTdGF0ZSA9IFdMQU5fSEREX0dFVF9XRVhUX1NUQVRFX1BUUihwQWRhcHRlcik7CisgICAgICBpZiAoTlVMTCA9PSBwV2V4dFN0YXRlKQorICAgICAgeworICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiJXM6IHBXZXh0U3RhdGUgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgfQorCisgICAgICB2b3Nfc3RhdHVzID0gdm9zX3dhaXRfc2luZ2xlX2V2ZW50KCZwV2V4dFN0YXRlLT52b3NldmVudCwgV0xBTl9XQUlUX1RJTUVfU1RBVFMpOworCisgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3Nfc3RhdHVzKSkKKyAgICAgIHsKKyAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOiBTTUUgdGltZW91dCB3aGlsZSByZXRyaWV2aW5nIHN0YXRpc3RpY3MiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICAgIH0KKworICAgICAgd3JxdS0+Yml0cmF0ZS52YWx1ZSA9IHBBZGFwdGVyLT5oZGRfc3RhdHMuQ2xhc3NBX3N0YXQudHhfcmF0ZSo1MDAqMTAwMDsKKyAgIH0KKworICAgRVhJVCgpOworCisgICByZXR1cm4gdm9zX3N0YXR1czsKK30KKworc3RhdGljIGludCBpd19nZXRfYml0cmF0ZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgIC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TsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgaWYgKGVDb25uZWN0aW9uU3RhdGVfQXNzb2NpYXRlZCAhPSBwSGRkU3RhQ3R4LT5jb25uX2luZm8uY29ublN0YXRlKQorICAgIHsKKyAgICAgICAgcmV0dXJuIC1FTlhJTyA7CisgICAgfQorCisgICAgcmF0ZSA9IHdycXUtPmJpdHJhdGUudmFsdWU7CisKKyAgICBpZiAocmF0ZSA9PSAtMSkKKyAgICB7CisgICAgICAgIHJhdGUgPSBXTklfQ0ZHX0ZJWEVEX1JBVEVfQVVUTzsKKyAgICAgICAgdmFsaWRfcmF0ZSA9IFRSVUU7CisgICAgfQorICAgIGVsc2UgaWYgKGNjbUNmZ0dldEludChXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX0RPVDExX01PREUsICZhY3RpdmVfcGh5X21vZGUpID09IGVIQUxfU1RBVFVTX1NVQ0NFU1MpCisgICAgeworICAgICAgICBpZiAoYWN0aXZlX3BoeV9tb2RlID09IFdOSV9DRkdfRE9UMTFfTU9ERV8xMUEgfHwgYWN0aXZlX3BoeV9tb2RlID09IFdOSV9DRkdfRE9UMTFfTU9ERV8xMUcKKyAgICAgICAgICAgIHx8IGFjdGl2ZV9waHlfbW9kZSA9PSBXTklfQ0ZHX0RPVDExX01PREVfMTFCKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoKGNjbUNmZ0dldFN0cihXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX1NVUFBPUlRFRF9SQVRFU18xMUEsCisgICAgICAgICAgICAgICAgICAgICAgICBzdXBwX3JhdGVzLCAmYV9sZW4pID09IGVIQUxfU1RBVFVTX1NVQ0NFU1MpICYmCisgICAgICAgICAgICAgICAgKGNjbUNmZ0dldFN0cihXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX1NVUFBPUlRFRF9SQVRFU18xMUIsCisgICAgICAgICAgICAgICAgICAgICAgICBzdXBwX3JhdGVzLCAmYl9sZW4pID09IGVIQUxfU1RBVFVTX1NVQ0NFU1MpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCAoYl9sZW4gKyBhX2xlbik7ICsraSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qIHN1cHBvcnRlZCByYXRlcyByZXR1cm5lZCBpcyBkb3VibGUgdGhlIGFjdHVhbCByYXRlIHNvIHdlIGRpdmlkZSBpdCBieSAyICovCisgICAgICAgICAgICAgICAgICAgIGlmICgoc3VwcF9yYXRlc1tpXSYweDdGKS8yID09IHJhdGUpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbGlkX3JhdGUgPSBUUlVFOworICAgICAgICAgICAgICAgICAgICAgICAgcmF0ZSA9IGkgKyBXTklfQ0ZHX0ZJWEVEX1JBVEVfMU1CUFM7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBpZiAodmFsaWRfcmF0ZSAhPSBUUlVFKQorICAgIHsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIGlmIChjY21DZmdTZXRJbnQoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLAorICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19GSVhFRF9SQVRFLCByYXRlLAorICAgICAgICAgICAgICAgICAgICAgY2NtQ2ZnU2V0Q2FsbGJhY2ssZUFOSV9CT09MRUFOX0ZBTFNFKSAhPSBlSEFMX1NUQVRVU19TVUNDRVNTKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgRkwoImZhaWxlZCB0byBzZXQgaW5pIHBhcmFtZXRlciwgV05JX0NGR19GSVhFRF9SQVRFIikpOworICAgICAgICByZXR1cm4gLUVJTzsKKyAgICB9CisKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIDA7Cit9CisKK3N0YXRpYyBpbnQgaXdfc2V0X2JpdHJhdGUoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhciAqZXh0cmEpCit7CisgICAgaW50IHJldDsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX19pd19zZXRfYml0cmF0ZShkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IF9faXdfc2V0X2dlbmllKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgKmV4dHJhKQoreworICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXI7CisgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgaGRkX3dleHRfc3RhdGVfdCAqcFdleHRTdGF0ZTsKKyAgIHVfaW50OF90ICpnZW5pZSA9IE5VTEw7CisgICB1X2ludDhfdCAqYmFzZV9nZW5pZSA9IE5VTEw7CisgICB2X1UxNl90IHJlbUxlbjsKKyAgIGludCByZXQgPSAwOworCisgICBFTlRFUigpOworCisgICBwQWRhcHRlciA9IFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogQWRhcHRlciBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICB9CisKKyAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgIHJldCA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICBpZiAoMCAhPSByZXQpCisgICB7CisgICAgICAgcmV0dXJuIHJldDsKKyAgIH0KKworICAgcFdleHRTdGF0ZSA9IFdMQU5fSEREX0dFVF9XRVhUX1NUQVRFX1BUUihwQWRhcHRlcik7CisgICBpZiAoTlVMTCA9PSBwV2V4dFN0YXRlKQorICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IHBXZXh0U3RhdGUgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgfQorCisgICBpZiAoIXdycXUtPmRhdGEubGVuZ3RoKSB7CisgICAgICAgaGRkX2NsZWFyUm9hbVByb2ZpbGVJZShwQWRhcHRlcik7CisgICAgICAgRVhJVCgpOworICAgICAgIHJldHVybiAwOworICAgfQorCisgICBiYXNlX2dlbmllID0gbWVtX2FsbG9jX2NvcHlfZnJvbV91c2VyX2hlbHBlcih3cnF1LT5kYXRhLnBvaW50ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cnF1LT5kYXRhLmxlbmd0aCk7CisgICBpZiAoTlVMTCA9PSBiYXNlX2dlbmllKQorICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAibWVtX2FsbG9jX2NvcHlfZnJvbV91c2VyX2hlbHBlciBmYWlsIik7CisgICAgICAgcmV0dXJuIC1FTk9NRU07CisgICB9CisKKyAgIGdlbmllID0gYmFzZV9nZW5pZTsKKworICAgcmVtTGVuID0gd3JxdS0+ZGF0YS5sZW5ndGg7CisKKyAgIGhkZExvZyhMT0cxLCJpd19zZXRfZ2VuaWUgaW9jdGwgSUVbMHglWF0sIExFTlslZF0iLCBnZW5pZVswXSwgZ2VuaWVbMV0pOworCisgICAvKiBjbGVhciBhbnkgcHJldmlvdXMgZ2VuSUUgYmVmb3JlIHRoaXMgY2FsbCAqLworICAgbWVtc2V0KCAmcFdleHRTdGF0ZS0+Z2VuSUUsIDAsIHNpemVvZihwV2V4dFN0YXRlLT5nZW5JRSkgKTsKKworICAgd2hpbGUgKHJlbUxlbiA+PSAyKQorICAgeworICAgICAgICB2X1UxNl90IGVMZW4gPSAwOworICAgICAgICB2X1U4X3QgZWxlbWVudElkOworICAgICAgICBlbGVtZW50SWQgPSAqZ2VuaWUrKzsKKyAgICAgICAgZUxlbiAgPSAqZ2VuaWUrKzsKKyAgICAgICAgcmVtTGVuIC09IDI7CisKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXM6IElFWzB4JVhdLCBMRU5bJWRdIiwKKyAgICAgICAgICAgIF9fZnVuY19fLCBlbGVtZW50SWQsIGVMZW4pOworCisgICAgICAgIHN3aXRjaCAoIGVsZW1lbnRJZCApCisgICAgICAgICB7CisgICAgICAgICAgICBjYXNlIElFX0VJRF9WRU5ET1I6CisgICAgICAgICAgICAgICAgaWYgKChJRV9MRU5fU0laRStJRV9FSURfU0laRStJRV9WRU5ET1JfT1VJX1NJWkUpID4gZUxlbikgLyogc2hvdWxkIGhhdmUgYXQgbGVhc3QgT1VJICovCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgICAgICBnb3RvIGV4aXQ7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKDAgPT0gbWVtY21wKCZnZW5pZVswXSwgIlx4MDBceDUwXHhmMlx4MDQiLCA0KSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHZfVTE2X3QgY3VyR2VuSUVMZW4gPSBwV2V4dFN0YXRlLT5nZW5JRS5sZW5ndGg7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyAoVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlcyBTZXQgV1BTIE9VSSglMDJ4ICUwMnggJTAyeCAlMDJ4KSBJRShsZW4gJWQpIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgZ2VuaWVbMF0sIGdlbmllWzFdLCBnZW5pZVsyXSwgZ2VuaWVbM10sIGVMZW4gKyAyKTsKKworICAgICAgICAgICAgICAgICAgICBpZiggU0lSX01BQ19NQVhfSUVfTEVOR1RIIDwgKHBXZXh0U3RhdGUtPmdlbklFLmxlbmd0aCArIGVMZW4pICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCAiQ2Fubm90IGFjY29tbW9kYXRlIGdlbklFLiAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTmVlZCBiaWdnZXIgYnVmZmVyIHNwYWNlIik7CisgICAgICAgICAgICAgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvLyBzYXZlIHRvIEFkZGl0aW9uYWwgSUUgOyBpdCBzaG91bGQgYmUgYWNjdW11bGF0ZWQgdG8gaGFuZGxlIFdQUyBJRSArIG90aGVyIElFCisgICAgICAgICAgICAgICAgICAgIG1lbWNweSggcFdleHRTdGF0ZS0+Z2VuSUUuYWRkSUVkYXRhICsgY3VyR2VuSUVMZW4sIGdlbmllIC0gMiwgZUxlbiArIDIpOworICAgICAgICAgICAgICAgICAgICBwV2V4dFN0YXRlLT5nZW5JRS5sZW5ndGggKz0gZUxlbiArIDI7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKDAgPT0gbWVtY21wKCZnZW5pZVswXSwgIlx4MDBceDUwXHhmMiIsIDMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nIChWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIiVzIFNldCBXUEEgSUUgKGxlbiAlZCkiLF9fZnVuY19fLCBlTGVuICsgMik7CisgICAgICAgICAgICAgICAgICAgIGlmICgoZUxlbiArIDIpID4gKHNpemVvZihwV2V4dFN0YXRlLT5XUEFSU05JRSkpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsICJDYW5ub3QgYWNjb21tb2RhdGUgZ2VuSUUuICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOZWVkIGJpZ2dlciBidWZmZXIgc3BhY2UiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG1lbXNldCggcFdleHRTdGF0ZS0+V1BBUlNOSUUsIDAsIE1BWF9XUEFfUlNOX0lFX0xFTiApOworICAgICAgICAgICAgICAgICAgICBtZW1jcHkoIHBXZXh0U3RhdGUtPldQQVJTTklFLCBnZW5pZSAtIDIsIChlTGVuICsgMikpOworICAgICAgICAgICAgICAgICAgICBwV2V4dFN0YXRlLT5yb2FtUHJvZmlsZS5wV1BBUmVxSUUgPSBwV2V4dFN0YXRlLT5XUEFSU05JRTsKKyAgICAgICAgICAgICAgICAgICAgcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUubldQQVJlcUlFTGVuZ3RoID0gZUxlbiArIDI7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgLyogYW55IHZlbmRvcklkIGV4Y2VwdCBXUEEgSUUgc2hvdWxkIGJlIGFjY3VtdWxhdGVkIHRvIGdlbklFICovCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB2X1UxNl90IGN1ckdlbklFTGVuID0gcFdleHRTdGF0ZS0+Z2VuSUUubGVuZ3RoOworICAgICAgICAgICAgICAgICAgICBoZGRMb2cgKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXMgU2V0IE9VSSglMDJ4ICUwMnggJTAyeCAlMDJ4KSBJRShsZW4gJWQpIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgZ2VuaWVbMF0sIGdlbmllWzFdLCBnZW5pZVsyXSwgZ2VuaWVbM10sIGVMZW4gKyAyKTsKKworICAgICAgICAgICAgICAgICAgICBpZiggU0lSX01BQ19NQVhfSUVfTEVOR1RIIDwgKHBXZXh0U3RhdGUtPmdlbklFLmxlbmd0aCArIGVMZW4pICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCAiQ2Fubm90IGFjY29tbW9kYXRlIGdlbklFLiAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTmVlZCBiaWdnZXIgYnVmZmVyIHNwYWNlIik7CisgICAgICAgICAgICAgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgICAgICAgICAgICAgIHJldCA9IC1FTk9NRU07CisgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZXhpdDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvLyBzYXZlIHRvIEFkZGl0aW9uYWwgSUUgOyBpdCBzaG91bGQgYmUgYWNjdW11bGF0ZWQgdG8gaGFuZGxlIFdQUyBJRSArIG90aGVyIElFCisgICAgICAgICAgICAgICAgICAgIG1lbWNweSggcFdleHRTdGF0ZS0+Z2VuSUUuYWRkSUVkYXRhICsgY3VyR2VuSUVMZW4sIGdlbmllIC0gMiwgZUxlbiArIDIpOworICAgICAgICAgICAgICAgICAgICBwV2V4dFN0YXRlLT5nZW5JRS5sZW5ndGggKz0gZUxlbiArIDI7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIGNhc2UgRE9UMTFGX0VJRF9SU046CisgICAgICAgICAgICAgICAgaGRkTG9nIChMT0cxLCAiJXMgU2V0IFJTTiBJRSAobGVuICVkKSIsX19mdW5jX18sIGVMZW4rMik7CisgICAgICAgICAgICAgICAgaWYgKChlTGVuICsgMikgPiAoc2l6ZW9mKHBXZXh0U3RhdGUtPldQQVJTTklFKSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCAiQ2Fubm90IGFjY29tbW9kYXRlIGdlbklFLiAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOZWVkIGJpZ2dlciBidWZmZXIgc3BhY2UiKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgICAgICAgICAgICAgZ290byBleGl0OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtZW1zZXQoIHBXZXh0U3RhdGUtPldQQVJTTklFLCAwLCBNQVhfV1BBX1JTTl9JRV9MRU4gKTsKKyAgICAgICAgICAgICAgICBtZW1jcHkoIHBXZXh0U3RhdGUtPldQQVJTTklFLCBnZW5pZSAtIDIsIChlTGVuICsgMikpOworICAgICAgICAgICAgICAgIHBXZXh0U3RhdGUtPnJvYW1Qcm9maWxlLnBSU05SZXFJRSA9IHBXZXh0U3RhdGUtPldQQVJTTklFOworICAgICAgICAgICAgICAgIHBXZXh0U3RhdGUtPnJvYW1Qcm9maWxlLm5SU05SZXFJRUxlbmd0aCA9IGVMZW4gKyAyOworICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBoZGRMb2cgKExPR0UsICIlcyBTZXQgVU5LTk9XTiBJRSAlWCIsX19mdW5jX18sIGVsZW1lbnRJZCk7CisgICAgICAgICAgICAgICAgZ290byBleGl0OworICAgIH0KKyAgICAgICAgZ2VuaWUgKz0gZUxlbjsKKyAgICAgICAgcmVtTGVuIC09IGVMZW47CisgICAgfQorCitleGl0OgorICAgIEVYSVQoKTsKKyAgICBrZnJlZShiYXNlX2dlbmllKTsKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IGl3X3NldF9nZW5pZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsCisgICAgICAgICAgICAgICAgICAgICAgICBjaGFyICpleHRyYSkKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X3NldF9nZW5pZShkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IF9faXdfZ2V0X2dlbmllKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgKmV4dHJhKQoreworICAgIGhkZF93ZXh0X3N0YXRlX3QgKnBXZXh0U3RhdGU7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcjsKKyAgICBoZGRfc3RhdGlvbl9jdHhfdCAqcEhkZFN0YUN0eDsKKyAgICBlSGFsU3RhdHVzIHN0YXR1czsKKyAgICB2X1UzMl90IGxlbmd0aCA9IERPVDExRl9JRV9SU05fTUFYX0xFTjsKKyAgICB2X1U4X3QgZ2VuSWVCeXRlc1tET1QxMUZfSUVfUlNOX01BWF9MRU5dOworCisgICAgRU5URVIoKTsKKworICAgIHBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogQWRhcHRlciBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgc3RhdHVzID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSBzdGF0dXMpCisgICAgeworICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgfQorCisgICAgcFdleHRTdGF0ZSA9IFdMQU5fSEREX0dFVF9XRVhUX1NUQVRFX1BUUihwQWRhcHRlcik7CisgICAgaWYgKE5VTEwgPT0gcFdleHRTdGF0ZSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBwV2V4dFN0YXRlIGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgcEhkZFN0YUN0eCA9IFdMQU5fSEREX0dFVF9TVEFUSU9OX0NUWF9QVFIocEFkYXB0ZXIpOworICAgIGlmIChOVUxMID09IHBIZGRTdGFDdHgpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogU1RBIENvbnRleHQgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBpZiggcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmNvbm5TdGF0ZSA9PSBlQ29ubmVjdGlvblN0YXRlX05vdENvbm5lY3RlZCkKKyAgICB7CisgICAgICAgIHJldHVybiAtRU5YSU87CisgICAgfQorCisgICAgLy8gUmV0dXJuIHNvbWV0aGluZyBPTkxZIGlmIHdlIGFyZSBhc3NvY2lhdGVkIHdpdGggYW4gUlNOIG9yIFdQQSBuZXR3b3JrCisgICAgaWYgKCBWT1NfVFJVRSAhPSBoZGRfSXNBdXRoVHlwZVJTTihXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwV2V4dFN0YXRlLT5yb2FtUHJvZmlsZS5uZWdvdGlhdGVkQXV0aFR5cGUpKQorICAgIHsKKyAgICAgICAgcmV0dXJuIC1FTlhJTzsKKyAgICB9CisKKyAgICAvLyBBY3R1YWxseSByZXRyaWV2ZSB0aGUgUlNOIElFIGZyb20gQ1NSLiAgKFdlIHByZXZpb3VzbHkgc2VudCBpdCBkb3duIGluIHRoZSBDU1IgUm9hbSBQcm9maWxlLikKKyAgICBzdGF0dXMgPSBjc3JSb2FtR2V0V3BhUnNuUmVxSUUoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZW5JZUJ5dGVzKTsKKyAgICBsZW5ndGggPSBWT1NfTUlOKCh1X2ludDE2X3QpIGxlbmd0aCwgRE9UMTFGX0lFX1JTTl9NQVhfTEVOKTsKKyAgICBpZiAod3JxdS0+ZGF0YS5sZW5ndGggPCBsZW5ndGgpCisgICAgeworICAgICAgICBoZGRMb2coTE9HMSwgIiVzOiBmYWlsZWQgdG8gY29weSBkYXRhIHRvIHVzZXIgYnVmZmVyIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVGQVVMVDsKKyAgICB9CisgICAgdm9zX21lbV9jb3B5KCBleHRyYSwgKHZfVk9JRF90KilnZW5JZUJ5dGVzLCBsZW5ndGgpOworICAgIHdycXUtPmRhdGEubGVuZ3RoID0gbGVuZ3RoOworCisgICAgaGRkTG9nKExPRzEsIiVzOiBSU04gSUUgb2YgJWQgYnl0ZXMgcmV0dXJuZWQiLCBfX2Z1bmNfXywgd3JxdS0+ZGF0YS5sZW5ndGggKTsKKworICAgIEVYSVQoKTsKKworICAgIHJldHVybiAwOworfQorCitzdGF0aWMgaW50IGl3X2dldF9nZW5pZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsCisgICAgICAgICAgICAgICAgICAgICAgICBjaGFyICpleHRyYSkKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X2dldF9nZW5pZShkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCisKK3N0YXRpYyBpbnQgX19pd19nZXRfZW5jb2RlKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3BvaW50ICpkd3JxLCBjaGFyICpleHRyYSkKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcjsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgIGhkZF93ZXh0X3N0YXRlX3QgKnBXZXh0U3RhdGU7CisgICAgdENzclJvYW1Qcm9maWxlICpwUm9hbVByb2ZpbGU7CisgICAgaW50IGtleUlkLCBpLCByZXQgPSAwOworICAgIGVDc3JBdXRoVHlwZSBhdXRoVHlwZSA9IGVDU1JfQVVUSF9UWVBFX05PTkU7CisKKyAgICBFTlRFUigpOworICAgIHBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogQWRhcHRlciBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHJldCkKKyAgICB7CisgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorICAgIHBXZXh0U3RhdGUgPSBXTEFOX0hERF9HRVRfV0VYVF9TVEFURV9QVFIocEFkYXB0ZXIpOworICAgIGlmIChOVUxMID09IHBXZXh0U3RhdGUpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogcFdleHRTdGF0ZSBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIHBSb2FtUHJvZmlsZSAgPSAmKHBXZXh0U3RhdGUtPnJvYW1Qcm9maWxlKTsKKyAgICBrZXlJZCA9IHBSb2FtUHJvZmlsZS0+S2V5cy5kZWZhdWx0SW5kZXg7CisKKyAgICBpZihrZXlJZCA8IDAgfHwga2V5SWQgPj0gTUFYX1dFUF9LRVlTKQorICAgIHsKKyAgICAgICAgaGRkTG9nKExPRzEsIiVzOiBJbnZhbGlkIGtleUlkIDogJWQiLF9fZnVuY19fLGtleUlkKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgaWYocFJvYW1Qcm9maWxlLT5LZXlzLktleUxlbmd0aFtrZXlJZF0gPiAwKQorICAgIHsKKyAgICAgICAgZHdycS0+ZmxhZ3MgfD0gSVdfRU5DT0RFX0VOQUJMRUQ7CisgICAgICAgIGR3cnEtPmxlbmd0aCA9IHBSb2FtUHJvZmlsZS0+S2V5cy5LZXlMZW5ndGhba2V5SWRdOworICAgICAgICB2b3NfbWVtX2NvcHkoZXh0cmEsJihwUm9hbVByb2ZpbGUtPktleXMuS2V5TWF0ZXJpYWxba2V5SWRdWzBdKSxwUm9hbVByb2ZpbGUtPktleXMuS2V5TGVuZ3RoW2tleUlkXSk7CisKKyAgICAgICAgZHdycS0+ZmxhZ3MgfD0gKGtleUlkICsgMSk7CisKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgZHdycS0+ZmxhZ3MgfD0gSVdfRU5DT0RFX0RJU0FCTEVEOworICAgIH0KKworICAgIGZvcihpPTA7IGkgPCBNQVhfV0VQX0tFWVM7IGkrKykKKyAgICB7CisgICAgICAgIGlmKHBSb2FtUHJvZmlsZS0+S2V5cy5LZXlNYXRlcmlhbFtpXSA9PSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgICAgaWYoTUFYX1dFUF9LRVlTID09IGkpCisgICAgeworICAgICAgICBkd3JxLT5mbGFncyB8PSBJV19FTkNPREVfTk9LRVk7CisgICAgfQorCisgICAgYXV0aFR5cGUgPSAoKGhkZF9zdGF0aW9uX2N0eF90KilXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKSktPmNvbm5faW5mby5hdXRoVHlwZTsKKworICAgIGlmKGVDU1JfQVVUSF9UWVBFX09QRU5fU1lTVEVNID09IGF1dGhUeXBlKQorICAgIHsKKyAgICAgICAgZHdycS0+ZmxhZ3MgfD0gSVdfRU5DT0RFX09QRU47CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGR3cnEtPmZsYWdzIHw9IElXX0VOQ09ERV9SRVNUUklDVEVEOworICAgIH0KKyAgICBFWElUKCk7CisgICAgcmV0dXJuIDA7Cit9CisKK3N0YXRpYyBpbnQgaXdfZ2V0X2VuY29kZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3BvaW50ICpkd3JxLCBjaGFyICpleHRyYSkKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X2dldF9lbmNvZGUoZGV2LCBpbmZvLCBkd3JxLCBleHRyYSk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworI2RlZmluZSBQQUVfUk9MRV9BVVRIRU5USUNBVE9SIDEgLy8gPTEgZm9yIGF1dGhlbnRpY2F0b3IsCisjZGVmaW5lIFBBRV9ST0xFX1NVUFBMSUNBTlQgMCAvLyA9MCBmb3Igc3VwcGxpY2FudAorCisKKy8qCisgKiBUaGlzIGZ1bmN0aW9uIHNlbmRzIGEgc2luZ2xlICdrZXknIHRvIExJTSBhdCBhbGwgdGltZS4KKyAqLworCitzdGF0aWMgaW50IF9faXdfZ2V0X3J0c190aHJlc2hvbGQoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgIHZfVTMyX3Qgc3RhdHVzID0gMDsKKworICAgc3RhdHVzID0gaGRkX3dsYW5fZ2V0X3J0c190aHJlc2hvbGQocEFkYXB0ZXIsd3JxdSk7CisKKyAgIHJldHVybiBzdGF0dXM7Cit9CisKK3N0YXRpYyBpbnQgaXdfZ2V0X3J0c190aHJlc2hvbGQoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICBpbnQgcmV0OworCisgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgcmV0ID0gX19pd19nZXRfcnRzX3RocmVzaG9sZChkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBfX2l3X3NldF9ydHNfdGhyZXNob2xkKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcjsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgIHRIYWxIYW5kbGUgaEhhbDsKKyAgICBpbnQgcmV0ID0gMDsKKworICAgIEVOVEVSKCk7CisKKyAgICBwQWRhcHRlciA9IFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgcmV0ID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSByZXQpCisgICAgeworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKworICAgIGhIYWwgPSBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlcik7CisgICAgaWYgKE5VTEwgPT0gaEhhbCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBIYWwgQ29udGV4dCBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIGlmICggd3JxdS0+cnRzLnZhbHVlIDwgV05JX0NGR19SVFNfVEhSRVNIT0xEX1NUQU1JTiB8fCB3cnF1LT5ydHMudmFsdWUgPiBXTklfQ0ZHX1JUU19USFJFU0hPTERfU1RBTUFYICkKKyAgICB7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIGlmICggY2NtQ2ZnU2V0SW50KGhIYWwsIFdOSV9DRkdfUlRTX1RIUkVTSE9MRCwgd3JxdS0+cnRzLnZhbHVlLCBjY21DZmdTZXRDYWxsYmFjaywgZUFOSV9CT09MRUFOX1RSVUUpICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MgKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgRkwoImZhaWxlZCB0byBzZXQgaW5pIHBhcmFtZXRlciwgV05JX0NGR19SVFNfVEhSRVNIT0xEIikpOworICAgICAgICByZXR1cm4gLUVJTzsKKyAgICB9CisKKyAgICBFWElUKCk7CisKKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljIGludCBpd19zZXRfcnRzX3RocmVzaG9sZChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X3NldF9ydHNfdGhyZXNob2xkKGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQgX19pd19nZXRfZnJhZ190aHJlc2hvbGQoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgICB2X1UzMl90IHN0YXR1cyA9IDA7CisKKyAgICBzdGF0dXMgPSBoZGRfd2xhbl9nZXRfZnJhZ190aHJlc2hvbGQocEFkYXB0ZXIsd3JxdSk7CisKKyAgICByZXR1cm4gc3RhdHVzOworfQorCitzdGF0aWMgaW50IGl3X2dldF9mcmFnX3RocmVzaG9sZChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9faXdfZ2V0X2ZyYWdfdGhyZXNob2xkKGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQgX19pd19zZXRfZnJhZ190aHJlc2hvbGQoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcjsKKyAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICB0SGFsSGFuZGxlIGhIYWw7CisgICBpbnQgcmV0ID0gMDsKKworICAgRU5URVIoKTsKKyAgIHBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICBpZiAoTlVMT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QVRVU19TVUNDRVNTICkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIEZMKCJmYWlsZWQgdG8gc2V0IGluaSBwYXJhbWV0ZXIsIFdOSV9DRkdfRlJBR01FTlRBVElPTl9USFJFU0hPTEQiKSk7CisgICAgICAgIHJldHVybiAtRUlPOworICAgIH0KKworICAgRVhJVCgpOworCisgICByZXR1cm4gMDsKK30KKworc3RhdGljIGludCBpd19zZXRfZnJhZ190aHJlc2hvbGQoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgIGludCByZXQ7CisKKyAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICByZXQgPSBfX2l3X3NldF9mcmFnX3RocmVzaG9sZChkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBfX2l3X2dldF9wb3dlcl9tb2RlKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXI7CisgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgaW50IHJldCA9IDA7CisKKyAgIEVOVEVSKCk7CisgICBwQWRhcHRlciA9IFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogQWRhcHRlciBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICB9CisgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgaWYgKDAgIT0gcmV0KQorICAgeworICAgICAgIHJldHVybiByZXQ7CisgICB9CisKKyAgIEVYSVQoKTsKKyAgIHJldHVybiAtRU9QTk9UU1VQUDsKK30KKworc3RhdGljIGludCBpd19nZXRfcG93ZXJfbW9kZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgIGludCByZXQ7CisKKyAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICByZXQgPSBfX2l3X2dldF9wb3dlcl9tb2RlKGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICByZXR1cm4gcmV0OworfQorc3RhdGljIGludCBfX2l3X3NldF9wb3dlcl9tb2RlKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgaW50IHJldCA9IDA7CisKKyAgICBFTlRFUigpOworICAgIHBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogQWRhcHRlciBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgcmV0ID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSByZXQpCisgICAgeworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gLUVPUE5PVFNVUFA7Cit9CisKK3N0YXRpYyBpbnQgaXdfc2V0X3Bvd2VyX21vZGUoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICBpbnQgcmV0OworCisgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgcmV0ID0gX19pd19zZXRfcG93ZXJfbW9kZShkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBfX2l3X2dldF9yYW5nZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyOworICAgdEhhbEhhbmRsZSBoSGFsOworICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgIGludCByZXQgPSAwOworICAgc3RydWN0IGl3X3JhbmdlICpyYW5nZSA9IChzdHJ1Y3QgaXdfcmFuZ2UgKikgZXh0cmE7CisKKyAgIHZfVThfdCBjaGFubmVsc1tXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU5dOworCisgICB2X1UzMl90IG51bV9jaGFubmVscyA9IHNpemVvZihjaGFubmVscyk7CisgICB2X1U4X3Qgc3VwcF9yYXRlc1tXTklfQ0ZHX1NVUFBPUlRFRF9SQVRFU18xMUFfTEVOXTsKKyAgIHZfVTMyX3QgYV9sZW47CisgICB2X1UzMl90IGJfbGVuOworICAgdl9VMzJfdCBhY3RpdmVfcGh5X21vZGUgPSAwOworICAgdl9VOF90IGluZGV4ID0gMCwgaTsKKworICAgRU5URVIoKTsKKworICAgcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBwQWRhcHRlciBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgcmV0dXJuIC1FSU5WQ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TFHKQorICAgICAgeworICAgICAgICAgLypHZXQgdGhlIHN1cHBvcnRlZCByYXRlcyBmb3IgMTFHIGJhbmQqLworICAgICAgICAgYV9sZW4gPSBXTklfQ0ZHX1NVUFBPUlRFRF9SQVRFU18xMUFfTEVOOworICAgICAgICAgaWYgKGNjbUNmZ0dldFN0cihoSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX1NVUFBPUlRFRF9SQVRFU18xMUEsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHN1cHBfcmF0ZXMsICZhX2xlbikgPT0gZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChhX2xlbiA+IFdOSV9DRkdfU1VQUE9SVEVEX1JBVEVTXzExQV9MRU4pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBhX2xlbiA9IFdOSV9DRkdfU1VQUE9SVEVEX1JBVEVTXzExQV9MRU47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgYV9sZW47IGkrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHJhbmdlLT5iaXRyYXRlW2ldID0gKChzdXBwX3JhdGVzW2ldICYgMHg3RikgLyAyKSAqIDEwMDAwMDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByYW5nZS0+bnVtX2JpdHJhdGVzID0gYV9sZW47CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICByZXR1cm4gLUVJTzsKKyAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIGVsc2UgaWYgKGFjdGl2ZV9waHlfbW9kZSA9PSBXTklfQ0ZHX0RPVDExX01PREVfMTFCKQorICAgICAgeworICAgICAgICAgLypHZXQgdGhlIHN1cHBvcnRlZCByYXRlcyBmb3IgMTFCIGJhbmQqLworICAgICAgICAgYl9sZW4gPSBXTklfQ0ZHX1NVUFBPUlRFRF9SQVRFU18xMUJfTEVOOworICAgICAgICAgaWYgKGNjbUNmZ0dldFN0cihoSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX1NVUFBPUlRFRF9SQVRFU18xMUIsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHN1cHBfcmF0ZXMsICZiX2xlbikgPT0gZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChiX2xlbiA+IFdOSV9DRkdfU1VQUE9SVEVEX1JBVEVTXzExQl9MRU4pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBiX2xlbiA9IFdOSV9DRkdfU1VQUE9SVEVEX1JBVEVTXzExQl9MRU47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgYl9sZW47IGkrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHJhbmdlLT5iaXRyYXRlW2ldID0gKChzdXBwX3JhdGVzW2ldICYgMHg3RikgLyAyKSAqIDEwMDAwMDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByYW5nZS0+bnVtX2JpdHJhdGVzID0gYl9sZW47CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICByZXR1cm4gLUVJTzsKKyAgICAgICAgIH0KKyAgICAgIH0KKyAgIH0KKworICAgcmFuZ2UtPm1heF9ydHMgPSBXTklfQ0ZHX1JUU19USFJFU0hPTERfU1RBTUFYOworICAgcmFuZ2UtPm1pbl9mcmFnID0gV05JX0NGR19GUkFHTUVOVEFUSU9OX1RIUkVTSE9MRF9TVEFNSU47CisgICByYW5nZS0+bWF4X2ZyYWcgPSBXTklfQ0ZHX0ZSQUdNRU5UQVRJT05fVEhSRVNIT0xEX1NUQU1BWDsKKworICAgcmFuZ2UtPmVuY29kaW5nX3NpemVbMF0gPSA1OworICAgcmFuZ2UtPmVuY29kaW5nX3NpemVbMV0gPSAxMzsKKyAgIHJhbmdl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bnRleHQpOworICAgICAgIHJldHVybjsKKyAgIH0KKworICAgcFN0YXRzQ29udGV4dCA9IChzdHJ1Y3Qgc3RhdHNDb250ZXh0ICopcENvbnRleHQ7CisKKyAgIC8qIHRoZXJlIGlzIGEgcmFjZSBjb25kaXRpb24gdGhhdCBleGlzdHMgYmV0d2VlbiB0aGlzIGNhbGxiYWNrCisgICAgICBmdW5jdGlvbiBhbmQgdGhlIGNhbGxlciBzaW5jZSB0aGUgY2FsbGVyIGNvdWxkIHRpbWUgb3V0IGVpdGhlcgorICAgICAgYmVmb3JlIG9yIHdoaWxlIHRoaXMgY29kZSBpcyBleGVjdXRpbmcuICB3ZSB1c2UgYSBzcGlubG9jayB0bworICAgICAgc2VyaWFsaXplIHRoZXNlIGFjdGlvbnMgKi8KKyAgIHNwaW5fbG9jaygmaGRkX2NvbnRleHRfbG9jayk7CisKKyAgIGlmIChQT1dFUl9DT05URVhUX01BR0lDICE9IHBTdGF0c0NvbnRleHQtPm1hZ2ljKQorICAgeworICAgICAgIC8qIHRoZSBjYWxsZXIgcHJlc3VtYWJseSB0aW1lZCBvdXQgc28gdGhlcmUgaXMgbm90aGluZyB3ZSBjYW4gZG8gKi8KKyAgICAgICBzcGluX3VubG9jaygmaGRkX2NvbnRleHRfbG9jayk7CisgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAiJXM6IEludmFsaWQgY29udGV4dCwgbWFnaWMgWyUwOHhdIiwKKyAgICAgICAgICAgICAgX19mdW5jX18sIHBTdGF0c0NvbnRleHQtPm1hZ2ljKTsKKworICAgICAgIGlmIChpb2N0bF9kZWJ1ZykKKyAgICAgICB7CisgICAgICAgICAgIHByX2luZm8oIiVzOiBJbnZhbGlkIGNvbnRleHQsIG1hZ2ljIFslMDh4XVxuIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcFN0YXRzQ29udGV4dC0+bWFnaWMpOworICAgICAgIH0KKyAgICAgICByZXR1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cuICB3ZSB1c2UgYSBzcGlubG9jayB0bworICAgICAgc2VyaWFsaXplIHRoZXNlIGFjdGlvbnMgKi8KKyAgIHNwaW5fbG9jaygmaGRkX2NvbnRleHRfbG9jayk7CisKKyAgIGlmICgoTlVMTCA9PSBwQWRhcHRlcikgfHwgKFNUQVRTX0NPTlRFWFRfTUFHSUMgIT0gcFN0YXRzQ29udGV4dC0+bWFnaWMpKQorICAgeworICAgICAgLyogdGhlIGNhbGxlciBwcmVzdW1hYmx5IHRpbWVkIG91dCBzbyB0aGVyZSBpcyBub3RoaW5nIHdlIGNhbiBkbyAqLworICAgICAgc3Bpbl91bmxvY2soJmhkZF9jb250ZXh0X2xvY2spOworICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICIlczogSW52YWxpZCBjb250ZXh0LCBwQWRhcHRlciBbJXBdIG1hZ2ljIFslMDh4XSIsCisgICAgICAgICAgICAgIF9fZnVuY19fLCBwQWRhcHRlciwgcFN0YXRzQ29udGV4dC0+bWFnaWMpOworICAgICAgaWYgKGlvY3RsX2RlYnVnKQorICAgICAgeworICAgICAgICAgcHJfaW5mbygiJXM6IEludmFsaWQgY29udGV4dCwgcEFkYXB0ZXIgWyVwXSBtYWdpYyBbJTA4eF1cbiIsCisgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBwQWRhcHRlciwgcFN0YXRzQ29udGV4dC0+bWFnaWMpOworICAgICAgfQorICAgICAgcmV0dXJuOworICAgfQorCisgICAvKiBjb250ZXh0IGlzIHZhbGlkIHNvIGNhbGxlciBpcyBzdGlsbCB3YWl0aW5nICovCisKKyAgIC8qIHBhcmFub2lhOiBpbnZhbGlkYXRlIHRoZSBtYWdpYyAqLworICAgcFN0YXRzQ29udGV4dC0+bWFnaWMgPSAwOworCisgICAvKiBjb3B5IG92ZXIgdGhlIHN0YXRzLiBkbyBzbyBhcyBhIHN0cnVjdCBjb3B5ICovCisgICBwQWRhcHRlci0+aGRkX3N0Y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vbnRleHQuY29tcGxldGlvbik7CisgICBjb250ZXh0LnBBZGFwdGVyID0gcEFkYXB0ZXI7CisgICBjb250ZXh0Lm1hZ2ljID0gU1RBVFNfQ09OVEVYVF9NQUdJQzsKKyAgIC8qIHF1ZXJ5IG9ubHkgZm9yIENsYXNzIEEgc3RhdGlzdGljcyAod2hpY2ggaW5jbHVkZSBsaW5rIHNwZWVkKSAqLworICAgaHN0YXR1cyA9IHNtZV9HZXRTdGF0aXN0aWNzKCBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9IREQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU01FX0dMT0JBTF9DTEFTU0FfU1RBVFMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGRkX0dldENsYXNzQV9zdGF0aXN0aWNzQ0IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgLy8gbm90IHBlcmlvZGljCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkFMU0UsIC8vbm9uLWNhY2hlZCByZXN1bHRzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLnN0YUlkWzBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZjb250ZXh0KTsKKyAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IGhzdGF0dXMpCisgICB7CisgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICIlczogVW5hYmxlIHRvIHJldHJpZXZlIENsYXNzIEEgc3RhdGlzdGljcyIsCisgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgLyogd2UnbGwgcmV0dXJuZWQgYSBjYWNoZWQgdmFsdWUgYmVsb3cgKi8KKyAgIH0KKyAgIGVsc2UKKyAgIHsKKyAgICAgICAvKiByZXF1ZXN0IHdhcyBzZW50IC0tIHdhaXQgZm9yIHRoZSByZXNwb25zZSAqLworICAgICAgIGxyYyA9IHdhaXRfZm9yX2NvbXBsZXRpb25faW50ZXJydXB0aWJsZV90aW1lb3V0KCZjb250ZXh0LmNvbXBsZXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKFdMQU5fV0FJVF9USU1FX1NUQVRTKSk7CisgICAgICAgaWYgKGxyYyA8PSAwKQorICAgICAgIHsKKyAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IFNNRSAlcyB3aGlsZSByZXRyaWV2aW5nIENsYXNzIEEgc3RhdGlzdGljcyIsCisgICAgICAgICAgICAgICAgIF9fZnVuY19fLCAoMCA9PSBscmMpID8gInRpbWVvdXQiIDogImludGVycnVwdCIpOworICAgICAgfQorICAgfQorCisgICAvKiBlaXRoZXIgd2UgbmV2ZXIgc2VudCBhIHJlcXVlc3QsIHdlIHNlbnQgYSByZXF1ZXN0IGFuZCByZWNlaXZlZCBhCisgICAgICByZXNwb25zZSBvciB3ZSBzZW50IGEgcmVxdWVzdCBhbmQgdGltZWQgb3V0LiAgaWYgd2UgbmV2ZXIgc2VudCBhCisgICAgICByZXF1ZXN0IG9yIGlmIHdlIHNlbnQgYSByZXF1ZXN0IGFuZCBnb3QgYSByZXNwb25zZSwgd2Ugd2FudCB0bworICAgICAgY2xlYXIgdGhlIG1hZ2ljIG91dCBvZiBwYXJhbm9pYS4gIGlmIHdlIHRpbWVkIG91dCB0aGVyZSBpcyBhCisgICAgICByYWNlIGNvbmRpdGlvbiBzdWNoIHRoYXQgdGhlIGNhbGxiYWNrIGZ1bmN0aW9uIGNvdWxkIGJlCisgICAgICBleGVjdXRpbmcgYXQgdGhlIHNhbWUgdGltZSB3ZSBhcmUuIG9mIHByaW1hcnkgY29uY2VybiBpcyB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VJZX1NUQVRTIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTTUVfR0xPQkFMX0NMQVNTQV9TVEFUUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZGRfZ2V0X3N0YXRpb25fc3RhdGlzdGljc0NCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsIC8vIG5vdCBwZXJpb2RpYworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZBTFNFLCAvL25vbi1jYWNoZWQgcmVzdWx0cworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5zdGFJZFswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmY29udGV4dCk7CisgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSBoc3RhdHVzKQorICAgeworICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAiJXM6IFVuYWJsZSB0byByZXRyaWV2ZSBzdGF0aXN0aWNzIiwKKyAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAvKiB3ZSdsbCByZXR1cm4gd2l0aCBjYWNoZWQgdmFsdWVzICovCisgICB9CisgICBlbHNlCisgICB7CisgICAgICAvKiByZXF1ZXN0IHdhcyBzZW50IC0tIHdhaXQgZm9yIHRoZSByZXNwb25zZSAqLworICAgICAgbHJjID0gd2FpdF9mb3JfY29tcGxldGlvbl9pbnRlcnJ1cHRpYmxlX3RpbWVvdXQoJmNvbnRleHQuY29tcGxldGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoV0xBTl9XQUlUX1RJTUVfU1RBVFMpKTsKKworICAgICAgaWYgKGxyYyA8PSAwKQorICAgICAgeworICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6I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klWX1BUUihkZXYpOworICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogQWRhcHRlciBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICB9CisKKyAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgIHZhbGlkID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgIGlmICgwICE9IHZhbGlkKQorICAgeworICAgICAgIHJldHVybiB2YWxpZDsKKyAgIH0KKyAgIHBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKyAgIGlmIChOVUxMID09IHBIZGRTdGFDdHgpCisgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogU1RBIENvbnRleHQgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgfQorICAgaWYgKGVDb25uZWN0aW9uU3RhdGVfQXNzb2NpYXRlZCAhPSBwSGRkU3RhQ3R4LT5jb25uX2luZm8uY29ublN0YXRlKQorICAgeworICAgICAgLyogd2UgYXJlIG5vdCBjb25uZWN0ZWQgc28gd2UgZG9uJ3QgaGF2ZSBhIGNsYXNzQXN0YXRzICovCisgICAgICBsaW5rX3NwZWVkID0gMDsKKyAgIH0KKyAgIGVsc2UKKyAgIHsKKyAgICAgICBzdGF0dXMgPSB3bGFuX2hkZF9nZXRfY2xhc3NBc3RhdHMocEFkYXB0ZXIpOworCisgICAgICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzICkpCisgICAgICAgeworICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgiVW5hYmxlIHRvIHJldHJpZXZlIFNNRSBzdGF0aXN0aWNzIikpOworICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICB9CisKKyAgICAgICAvKiBVbml0IG9mIGxpbmsgY2FwYWNpdHkgaXMgb2J0YWluZWQgZnJvbSB0aGUgVEwgQVBJIGlzIE1icHNYMTAgICovCisgICAgICAgV0xBTlRMX0dldFNUQUxpbmtDYXBhY2l0eShXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKS0+cHZvc0NvbnRleHQsCisgICAgICAgICAgKFdMQU5fSEREX0dFVF9TVEFUSU9OX0NUWF9QVFIocEFkYXB0ZXIpKS0+Y29ubl9pbmZvLnN0YUlkWzBdLAorICAgICAgICAgICZsaW5rX3NwZWVkKTsKKworICAgICAgIGxpbmtfc3BlZWQgPSBsaW5rX3NwZWVkIC8gMTA7CisKKyAgICAgICBpZiAoMCA9PSBsaW5rX3NwZWVkKQorICAgICAgIHsKKyAgICAgICAgICAgLyogVGhlIGxpbmtzcGVlZCByZXR1cm5lZCBieSBIQUwgaXMgaW4gdW5pdHMgb2YgNTAwa2Jwcy4KKyAgICAgICAgICAgICogY29udmVydGluZyBpdCB0byBtYnBzLgorICAgICAgICAgICAgKiBUaGlzIGlzIHJlcXVpcmVkIHRvIHN1cHBvcnQgbGVnYWN5IGZpcm13YXJlIHdoaWNoIGRvZXMKKyAgICAgICAgICAgICogbm90IHJldHVybiBsaW5rIGNhcGFjaXR5LgorICAgICAgICAgICAgKi8KKyAgICAgICAgICAgbGlua19zcGVlZCA9IHBBZGFwdGVyLT5oZGRfc3RhdHMuQ2xhc3NBX3N0YXQudHhfcmF0ZS8yOworICAgICAgIH0KKworICAgfQorCisgICB3cnF1LT5kYXRhLmxlbmd0aCA9IGxlbjsKKyAgIC8vIHJldHVybiB0aGUgbGlua3NwZWVkIGluIHRoZSBmb3JtYXQgcmVxdWlyZWQgYnkgdGhlIFdpRmkgRnJhbWV3b3JrCisgICByYyA9IHNucHJpbnRmKHBMaW5rU3BlZWQsIGxlbiwgIiV1IiwgbGlua19zcGVlZCk7CisgICBpZiAoKHJjIDwgMCkgfHwgKHJjID49IGxlbikpCisgICB7CisgICAgICAgLy8gZW5jb2Rpbmcgb3IgbGVuZ3RoIGVycm9yPworICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsRkwoIlVuYWJsZSB0byBlbmNvZGUgbGluayBzcGVlZCIpKTsKKyAgICAgICByZXR1cm4gLUVJTzsKKyAgIH0KKworICAgRVhJVCgpOworICAvKiBhIHZhbHVlIGlzIGJlaW5nIHN1Y2Nlc3NmdWxseSByZXR1cm5lZCAqLworICAgcmV0dXJuIHJjOworfQorCisvKgorICogSGVscGVyIGZ1bmN0aW9uIHRvIHJldHVybiBjb3JyZWN0IHZhbHVlIGZvciBXTEFOX0dFVF9MSU5LX1NQRUVECisgKgorICovCitzdGF0aWMgaW50IF9faXdfZ2V0X2xpbmtzcGVlZF9wcml2KHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICBpbnQgcmM7CisKKyAgIHJjID0gaXdfZ2V0X2xpbmtzcGVlZChkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKworICAgaWYgKHJjIDwgMCkKKyAgICAgICByZXR1cm4gcmM7CisKKyAgIC8qIGEgdmFsdWUgaXMgYmVpbmcgc3VjY2Vzc2Z1bGx5IHJldHVybmVkICovCisgICByZXR1cm4gMDsKK30KKworc3RhdGljIGludCBpd19nZXRfbGlua3NwZWVkX3ByaXYoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgIGludCByZXQ7CisKKyAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICByZXQgPSBfX2l3X2dldF9saW5rc3BlZWRfcHJpdihkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgcmV0dXJuIHJldDsKK30KKworLyoKKyAqIFN1cHBvcnQgZm9yIHRoZSBSU1NJICYgUlNTSS1BUFBST1ggcHJpdmF0ZSBjb21tYW5kcworICogUGVyIHRoZSBXaUZpIGZyYW1ld29yayB0aGUgcmVzcG9uc2UgbXVzdCBiZSBvZiB0aGUgZm9ybQorICogICAgICAgICAiPHNzaWQ+IHJzc2kgPHh4PiIKKyAqIHVubGVzcyB3ZSBhcmUgbm90IGFzc29jaWF0ZWQsIGluIHdoaWNoIGNhc2UgdGhlIHJlc3BvbnNlIGlzCisgKiAgICAgICAgICJPSyIKKyAqLworc3RhdGljIGludCBpd19nZXRfcnNzaShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICBjaGFyICpjbWQgPSBleHRyYTsKKyAgIGludCBsZW4gPSB3cnF1LT5kYXRhLmxlbmd0aDsKKyAgIHZfUzdfdCB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IHRoZSBzc2lkIGluIHRoZSBmb3JtYXQgcmVxdWlyZWQgYnkKKyAgICAgICAgICAgICB0aGUgV2lGSSBGcmFtZXdvcmsgKi8KKyAgICAgICAgICByYyA9IHNjbnByaW50ZigmY21kW3NzaWRsZW5dLCBsZW4gLSBzc2lkbGVuLCAiIHJzc2kgJWQiLCBzN1Jzc2kpOworICAgICAgICAgIHJjICs9IHNzaWRsZW47CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICAgcmMgPSAtMTsKKyAgICAgIH0KKyAgIH0KKworICAgLyogdmVyaWZ5IHRoYXQgd2Ugd3JvdGUgYSB2YWxpZCByZXNwb25zZSAqLworICAgaWYgKChyYyA8IDApIHx8IChyYyA+PSBsZW4pKQorICAgeworICAgICAgLy8gZW5jb2Rpbmcgb3IgbGVuZ3RoIGVycm9yPworICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAiJXM6IFVuYWJsZSB0byBlbmNvZGUgUlNTSSwgZ290IFslc10iLAorICAgICAgICAgICAgIF9fZnVuY19fLCBjbWQpOworICAgICAgcmV0dXJuIC1FSU87CisgICB9CisKKyAgIC8qIGEgdmFsdWUgaXMgYmVpbmcgc3VjY2Vzc2Z1bGx5IHJldHVybmVkICovCisgICByZXR1cm4gcmM7Cit9CisKKy8qCisgKiBTdXBwb3J0IGZvciBTb2Z0QVAgY2hhbm5lbCByYW5nZSBwcml2YXRlIGNvbW1hbmQKKyAqLworc3RhdGljIGludCBpd19zb2Z0YXBfc2V0X2NoYW5uZWxfcmFuZ2UoIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0Q2hhbm5lbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZW5kQ2hhbm5lbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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VyICAgIDogJXggIgorICAgICAgICAgICAgIm1hY0hlYWRlci0+ZnJhbWVDdHJsLnR5cGUgICAgICAgOiAleCAiCisgICAgICAgICAgICAibWFjSGVhZGVyLT5mcmFtZUN0cmwuc3ViVHlwZSAgICA6ICV4ICIKKyAgICAgICAgICAgICJtYWNIZWFkZXItPmZyYW1lQ3RybC50b0RTICAgICAgIDogJXggIgorICAgICAgICAgICAgIm1hY0hlYWRlci0+ZnJhbWVDdHJsLmZyb21EUyAgICAgOiAleCAiCisgICAgICAgICAgICAibWFjSGVhZGVyLT5mcmFtZUN0cmwubW9yZUZyYWcgICA6ICV4ICIKKyAgICAgICAgICAgICJtYWNIZWFkZXItPmZyYW1lQ3RybC5yZXRyeSAgICAgIDogJXggIgorICAgICAgICAgICAgIm1hY0hlYWRlci0+ZnJhbWVDdHJsLnBvd2VyTWdtdCAgOiAleCAiCisgICAgICAgICAgICAibWFjSGVhZGVyLT5mcmFtZUN0cmwuTW9yZURhdGEgICA6ICV4ICIKKyAgICAgICAgICAgICJtYWNIZWFkZXItPmZyYW1lQ3RybC53ZXAgICAgICAgIDogJXggIgorICAgICAgICAgICAgIm1hY0hlYWRlci0+ZnJhbWVDdHJsLm9yZGVyICAgICAgOiAleCAiCisgICAgICAgICAgICAsIG1hY0hlYWRlci0+ZnJhbWVDdHJsLnByb3RWZXIKKyAgICAgICAgICAgICwgbWFjSGVhZGVyLT5mcmFtZUN0cmwudHlwZQorICAgICAgICAgICAgLCBtYWNIZWFkZXItPmZyYW1lQ3RybC5zdWJUeXBlCisgICAgICAgICAgICAsIG1hY0hlYWRlci0+ZnJhbWVDdHJsLnRvRFMKKyAgICAgICAgICAgICwgbWFjSGVhZGVyLT5mcmFtZUN0cmwuZnJvbURTCisgICAgICAgICAgICAsIG1hY0hlYWRlci0+ZnJhbWVDdHJsLm1vcmVGcmFnCisgICAgICAgICAgICAsIG1hY0hlYWRlci0+ZnJhbWVDdHJsLnJldHJ5CisgICAgICAgICAgICAsIG1hY0h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YVF9NQUdJQzsKKworICAgaWYgKERSSVZFUl9QT1dFUl9NT0RFX0FDVElWRSA9PSBtb2RlKQorICAgeworICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiJXM6V2xhbiBkcml2ZXIgRW50ZXJpbmcgIgorICAgICAgICAgICAgICAgIkZ1bGwgUG93ZXIiLCBfX2Z1bmNfXyk7CisgICAgICAgc3RhdHVzID0gc21lX1JlcXVlc3RGdWxsUG93ZXIoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLAorICAgICAgICAgICAgICAgICAgICAgICBpd19wb3dlcl9jYWxsYmFja19mbiwgJmNvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgIGVTTUVfRlVMTF9QV1JfTkVFREVEX0JZX0hERCk7CisgICAgICAgLy8gRW50ZXIgRnVsbCBwb3dlciBjb21tYW5kIHJlY2VpdmVkIGZyb20gR1VJIHRoaXMgbWVhbnMgd2UgYXJlIGRpc2Nvbm5lY3RlZAorICAgICAgIC8vIFNldCBQTUMgcmVtYWluSW5Qb3dlckFjdGl2ZVRpbGxESENQIGZsYWcgdG8gZGlzYWJsZSBhdXRvIEJNUFMgZW50cnkgYnkgUE1DCisgICAgICAgc21lX1NldERIQ1BUaWxsUG93ZXJBY3RpdmVGbGFnKHBIZGRDdHgtPmhIYWwsIFRSVUUpOworICAgICAgIGlmIChlSEFMX1NUQVRVU19QTUNfUEVORElORyA9PSBzdGF0dXMpCisgICAgICAgeworICAgICAgICAgICAvKiByZXF1ZXN0IHdhcyBzZW50IC0tIHdhaXQgZm9yIHRoZSByZXNwb25zZSAqLworICAgICAgICAgICBpbnQgbHJjID0gd2FpdF9mb3JfY29tcGxldGlvbl9pbnRlcnJ1cHRpYmxlX3RpbWVvdXQoCisgICAgICAgICAgICAgICAgICAgJmNvbnRleHQuY29tcGxldGlvbiwKKyAgICAgICAgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKFdMQU5fV0FJV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gICAgICAgKi8KKyAgICAgICBpZiAoKGVDb25uZWN0aW9uU3RhdGVfQXNzb2NpYXRlZCAgPT0gcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmNvbm5TdGF0ZSkgJiYKKyAgICAgICAgICAgKFZPU19GQUxTRSA9PSBwSGRkU3RhQ3R4LT5jb25uX2luZm8udUlzQXV0aGVudGljYXRlZCkpCisgICAgICAgeworICAgICAgICAgICBoZGRMb2coTE9HRSwKKyAgICAgICAgICAgICAgRkwoIlN0YXRpb24gaXMgYXNzb2NpYXRlZCBidXQsIHN0aWxsIG5vdCBBdXRoZW50aWNhdGVkIGlnbm9yZSAiCisgICAgICAgICAgICAgICAicG93ZXIgc2F2ZSBtb2RlIikpOworICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0FHQUlOOworICAgICAgIH0KKworICAgICAgIGlmIChwSGRkQ3R4LT5jZmdfaW5pLT5mSXNCbXBzRW5hYmxlZCkKKyAgICAgICB7CisgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiJXM6V2xhbiBkcml2ZXIgRW50ZXJpbmcgQm1wcyAiLAorICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICAvLyBFbnRlciBCTVBTIGNvbW1hbmQgcmVjZWl2ZWQgZnJvbSBHVUkgdGhpcyBtZWFucyBESENQIGlzIGNvbXBsZXRlZAorICAgICAgICAgICAvLyBDbGVhciBQTUMgcmVtYWluSW5Qb3dlckFjdGl2ZVRpbGxESENQIGZsYWcgdG8gZW5hYmxlIGF1dG8gQk1QUyBlbnRyeQorICAgICAgICAgICBzbWVfU2V0REhDUFRpbGxQb3dlckFjdGl2ZUZsYWcoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLAorICAgICAgICAgICAgICAgICAgICBGQUxTRSk7CisgICAgICAgICAgIHN0YXR1cyA9IHNtZV9SZXF1ZXN0Qm1wcyhXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBpd19wb3dlcl9jYWxsYmFja19mbiwgJmNvbnRleHQpOworICAgICAgICAgICBpZiAoZUhBTF9TVEFUVVNfUE1DX1BFTkRJTkcgPT0gc3RhdHVzKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvKiByZXF1ZXN0IHdhcyBzZW50IC0tIHdhaXQgZm9yIHRoZSByZXNwb25zZSAqLworICAgICAgICAgICAgICAgaW50IGxyYyA9IHdhaXRfZm9yX2NvbXBsZXRpb25faW50ZXJydXB0aWJsZV90aW1lb3V0KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJmNvbnRleHQuY29tcGxldGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoV0xBTl9XQUlUX1RJTUVfUE9XRVIpKTsKKyAgICAgICAgICAgICAgIGlmIChscmMgPD0gMCkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFNNRSAlcyB3aGlsZSByZXF1ZXN0aW5nIEJNUFMiLAorICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgKDAgPT0gbHJjKSA/ICJ0aW1lb3V0IiA6ICJpbnRlcnJ1cHQiKTsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgfQorICAgICAgIH0KKyAgICAgICBlbHNlCisgICAgICAgeworICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIkJNUFMgaXMgbm90ICIKKyAgICAgICAgICAgICAgICAgICAiZW5hYmxlZCBpbiB0aGUgY2ZnIik7CisgICAgICAgfQorICAgfQorCisgICAvKiBlaXRoZXIgd2UgbmV2ZXIgc2VudCBhIHJlcXVlc3QsIHdlIHNlbnQgYSByZXF1ZXN0IGF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aGFuZ2VfY291bnRyeV9jb2RlKTsKKworICAgIHJldHVybiBOVUxMOworfQorCitzdGF0aWMgaW50IF9faXdfc2V0X3ByaXYoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXI7CisgICAgY2hhciAqY21kID0gTlVMTDsKKyAgICBpbnQgY21kX2xlbiA9IHdycXUtPmRhdGEubGVuZ3RoOworICAgIGludCByYyA9IDAsIHJldCA9IDA7CisgICAgVk9TX1NUQVRVUyB2b3Nfc3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworCisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKworICAgIEVOVEVSKCk7CisKKyAgICBwQWRhcHRlciA9IFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAibWVtX2FsbG9jX2NvcHlfZnJvbV91c2VyX2hlbHBlciBmYWlsIik7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgcmMgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHJjKQorICAgIHsKKyAgICAgICAgcmV0dXJuIHJjOworICAgIH0KKworICAgIGNtZCA9IG1lbV9hbGxvY19jb3B5X2Zyb21fdXNlcl9oZWxwZXIod3JxdS0+ZGF0YS5wb2ludGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JxdS0+ZGF0YS5sZW5ndGgpOworICAgIGlmIChOVUxMID09IGNtZCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIm1lbV9hbGxvY19jb3B5X2Zyb21fdXNlcl9oZWxwZXIgZmFpbCIpOworICAgICAgICByZXR1cm4gLUVOT01FTTsKKyAgICB9CisKKyAgICBpZiAoaW9jdGxfZGVidWcpCisgICAgeworICAgICAgIHByX2luZm8oIiVzOiByZXEgWyVzXSBsZW4gWyVkXVxuIiwgX19mdW5jX18sIGNtZCwgY21kX2xlbik7CisgICAgfQorCisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPX01FRCwKKyAgICAgICAgICAgIiVzOiAqKipSZWNlaXZlZCAlcyBjbWQgZnJvbSBXaS1GaSBHVUkqKioiLCBfX2Z1bmNfXywgY21kKTsKKworICAgIGlmIChzdHJuY21wKGNtZCwgIkNTQ0FOIiwgNSkgPT0gMCApCisgICAgeworICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IGl3X3NldF9jc2NhbihkZXYsIGluZm8sIHdycXUsIGNtZCkpIHsKKyAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAiJXM6IEVycm9yIGluIGl3X3NldF9zY2FuISIsIF9fZnVuY19fKTsKKyAgICAgICAgICByYyA9IC1FSU5WQUw7CisgICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmKCBzdHJjYXNlY21wKGNtZCwgInN0YXJ0IikgPT0gMCApIHsKKworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIlN0YXJ0IGNvbW1hbmQiKTsKKyAgICAgICAgLypFeGl0IGZyb20gRGVlcCBzbGVlcCBvciBzdGFuZGJ5IGlmIHdlIGdldCB0aGUgZHJpdmVyIFNUQVJUIGNtZCBmcm9tIGFuZHJvaWQgR1VJKi8KKworICAgICAgICB2b3Nfc3RhdHVzID0gd2xhbl9oZGRfZXhpdF9sb3dwb3dlcihwSGRkQ3R4LCBwQWRhcHRlcik7CisgICAgICAgIGlmICh2b3Nfc3RhdHVzID09IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSB3cnF1OworICAgICAgICAgICAgY2hhciBidWZbMTBdOworCisgICAgICAgICAgICBtZW1zZXQoJndycXUsIDAsIHNpemVvZih3cnF1KSk7CisgICAgICAgICAgICB3cnF1LmRhdGEubGVuZ3RoID0gc3RybGNweShidWYsICJTVEFSVCIsIHNpemVvZihidWYpKTsKKyAgICAgICAgICAgIHdpcmVsZXNzX3NlbmRfZXZlbnQocEFkYXB0ZXItPmRldiwgSVdFVkNVU1RPTSwgJndycXUsIGJ1Zik7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IFNUQVJUIENNRCBTdGF0dXMgJWQiLCBfX2Z1bmNfXywgdm9zX3N0YXR1cyk7CisgICAgICAgICAgICByYyA9IC1FSU87CisgICAgICAgIH0KKyAgICAgICAgZ290byBkb25lOworICAgIH0KKyAgICBlbHNlIGlmKCBzdHJjYXNlY21wKGNtZCwgInN0b3AiKSA9PSAwICkKKyAgICB7CisgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgd3JxdTsKKyAgICAgICAgY2hhciBidWZbMTBdOworCisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiU3RvcCBjb21tYW5kIik7CisKKyAgICAgICAgd2xhbl9oZGRfZW50ZX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c2l2ZSIpKTsKKyAgICAgICAgcEhkZEN0eC0+c2Nhbl9pbmZvLnNjYW5fbW9kZSA9IGVTSVJfUEFTU0lWRV9TQ0FOOworICAgICAgICByZXQgPSBzbnByaW50ZihjbWQsIGNtZF9sZW4sICJPSyIpOworICAgIH0KKyAgICBlbHNlIGlmKCBzdHJjYXNlY21wKGNtZCwgInNjYW4tbW9kZSIpID09IDAgKQorICAgIHsKKyAgICAgICAgcmV0ID0gc25wcmludGYoY21kLCBjbWRfbGVuLCAiU2Nhbk1vZGUgPSAldSIsIHBIZGRDdHgtPnNjYW5faW5mby5zY2FuX21vZGUpOworICAgIH0KKyAgICBlbHNlIGlmKCBzdHJjYXNlY21wKGNtZCwgImxpbmtzcGVlZCIpID09IDAgKQorICAgIHsKKyAgICAgICAgcmV0ID0gaXdfZ2V0X2xpbmtzcGVlZChkZXYsIGluZm8sIHdycXUsIGNtZCk7CisgICAgfQorICAgIGVsc2UgaWYoIHN0cm5jYXNlY21wKGNtZCwgIkNPVU5UUlkiLCA3KSA9PSAwICkgeworICAgICAgICBjaGFyICpjb3VudHJ5X2NvZGU7CisgICAgICAgIGxvbmcgbHJjOworICAgICAgICBlSGFsU3RhdHVzIGVIYWxfc3RhdHVzOworCisgICAgICAgIGNvdW50cnlfY29kZSA9ICBjbWQgKyA4OworCisgICAgICAgIGluaXRfY29tcGxldGlvbigmcEFkYXB0ZXItPmNoYW5nZV9jb3VudHJ5X2NvZGUpOworCisgICAgICAgIGVIYWxfc3RhdHVzID0gc21lX0NoYW5nZUNvdW50cnlDb2RlKHBIZGRDdHgtPmhIYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopKHRTbWVDaGFuZ2VDb3VudHJ5Q2FsbGJhY2spd2xhbl9oZGRfY2hhbmdlX2NvdW50cnlfY29kZV9jYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY291bnRyeV9jb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+cHZvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfVFJVRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9UUlVFKTsKKworICAgICAgICAvKiBXYWl0IGZvciBjb21wbGV0aW9uICovCisgICAgICAgIGxyYyA9IHdhaXRfZm9yX2NvbXBsZXRpb25faW50ZXJydXB0aWJsZV90aW1lb3V0KCZwQWRhcHRlci0+Y2hhbmdlX2NvdW50cnlfY29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoV0xBTl9XQUlUX1RJTUVfU1RBVFMpKTsKKworICAgICAgICBpZiAobHJjIDw9IDApCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIiVzOiBTTUUgJXMgd2hpbGUgc2V0dGluZyBjb3VudHJ5IGNvZGUgIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgIlRpbWVkIG91dCIpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gZUhhbF9zdGF0dXMpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICIlczogU01FIENoYW5nZSBDb3VudHJ5IGNvZGUgZmFpbCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIGtmcmVlKGNtZCk7CisgICAgICAgICAgICByZXR1cm4gLUVJTzsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmKCBzdHJuY2FzZWNtcChjbWQsICJyc3NpIiwgNCkgPT0gMCApCisgICAgeworICAgICAgICByZXQgPSBpd19nZXRfcnNzaShkZXYsIGluZm8sIHdycXUsIGNtZCk7CisgICAgfQorICAgIGVsc2UgaWYoIHN0cm5jYXNlY21wKGNtZCwgInBvd2VybW9kZSIsIDkpID09IDAgKSB7CisgICAgICAgIGludCBtb2RlOworICAgICAgICBjaGFyICpwdHI7CisKKyAgICAgICAgaWYgKDkgPCBjbWRfbGVuKQorICAgICAgICB7CisgICAgICAgICAgICBwdHIgPSAoY2hhciopKGNtZCArIDkpOworCisgICAgICAgIH1lbHNleworICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJDTUQgTEVOR1RIICVkIGlzIG5vdCBjb3JyZWN0IixjbWRfbGVuKTsKKyAgICAgICAgICAgICAga2ZyZWUoY21kKTsKKyAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgIH0KKworICAgICAgICBpZiAoMSAhPSBzc2NhbmYocHRyLCIlZCIsJm1vZGUpKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAicG93ZXJtb2RlIGlucHV0ICVzIGlzIG5vdCBjb3JyZWN0IixwdHIpOworICAgICAgICAgICAga2ZyZWUoY21kKTsKKyAgICAgICAgICAgIHJldHVybiAtRUlPOworICAgICAgICB9CisKKyAgICAgICAgd2xhbl9oZGRfZW50ZXJfYm1wcyhwQWRhcHRlciwgbW9kZSk7CisgICAgICAgIC8qVE9ETzpTZXQgdGhlIHBvd2VyIG1vZGUqLworICAgIH0KKyAgICBlbHNlIGlmIChzdHJuY2FzZWNtcChjbWQsICJnZX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F9JTkZPLCAicG5vc2V0dXAiKTsKKyAgICAgICAgLypUT0RPOiBzdXBwb3J0IHBub3NldHVwKi8KKyAgICB9CisgICAgZWxzZSBpZiggc3RybmNhc2VjbXAoY21kLCAicG5vZm9yY2UiLCA4KSA9PSAwICkgeworICAgICAgICBoZGRMb2coIFZPU19UUkFDRV9MRVZFTF9JTkZPLCAicG5vZm9yY2UiKTsKKyAgICAgICAgLypUT0RPOiBzdXBwb3J0IHBub2ZvcmNlKi8KKyAgICB9CisgICAgZWxzZSBpZiggc3RybmNhc2VjbXAoY21kLCAicG5vIiwzKSA9PSAwICkgeworCisgICAgICAgIGhkZExvZyggVk9TX1RSQUNFX0xFVkVMX0lORk8sICJwbm8iKTsKKyAgICAgICAgdm9zX3N0YXR1cyA9IGl3X3NldF9wbm8oZGV2LCBpbmZvLCB3cnF1LCBjbWQsIDMpOworICAgICAgICBrZnJlZShjbWQpOworICAgICAgICByZXR1cm4gKHZvc19zdGF0dXMgPT0gVk9TX1NUQVRVU19TVUNDRVNTKSA/IDAgOiAtRUlOVkFMOworICAgIH0KKyAgICBlbHNlIGlmKCBzdHJuY2FzZWNtcChjbWQsICJyc3NpZmlsdGVyIiwxMCkgPT0gMCApIHsKKyAgICAgICAgaGRkTG9nKCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgInJzc2lmaWx0ZXIiKTsKKyAgICAgICAgdm9zX3N0YXR1cyA9IGl3X3NldF9yc3NpX2ZpbHRlcihkZXYsIGluZm8sIHdycXUsIGNtZCwgMTApOworICAgICAgICBrZnJlZShjbWQpOworICAgICAgICByZXR1cm4gKHZvc19zdGF0dXMgPT0gVk9TX1NUQVRVU19TVUNDRVNTKSA/IDAgOiAtRUlOVkFMOworICAgIH0KKyNlbmRpZiAvKkZFQVRVUkVfV0xBTl9TQ0FOX1BOTyovCisgICAgZWxzZSBpZiggc3RybmNhc2VjbXAoY21kLCAicG93ZXJwYXJhbXMiLDExKSA9PSAwICkgeworICAgICAgaGRkTG9nKCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgInBvd2VycGFyYW1zIik7CisgICAgICB2b3Nfc3RhdHVzID0gaXdfc2V0X3Bvd2VyX3BhcmFtcyhkZXYsIGluZm8sIHdycXUsIGNtZCwgMTEpOworICAgICAga2ZyZWUoY21kKTsKKyAgICAgIHJldHVybiAodm9zX3N0YXR1cyA9PSBWT1NfU1RBVFVTX1NVQ0NFU1MpID8gMCA6IC1FSU5WQUw7CisgICAgfQorICAgIGVsc2UgaWYoIDAgPT0gc3RybmNhc2VjbXAoY21kLCAiQ09ORklHLVRYLVRSQUNLSU5HIiwgMTgpICkgeworICAgICAgICB0U2lyVHhQZXJUcmFja2luZ1BhcmFtIHRUeFBlclRyYWNraW5nUGFyYW07CisgICAgICAgIGNoYXIgKnB0cjsKKworICAgICAgICBpZiAoMTggPCBjbWRfbGVuKQorICAgICAgICB7CisgICAgICAgICAgIHB0ciA9IChjaGFyKikoY21kICsgMTgpOworICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICJDTUQgTEVOR1RIICVkIGlzIG5vdCBjb3JyZWN0IixjbWRfbGVuKTsKKyAgICAgICAgICAgICAgIGtmcmVlKGNtZCk7CisgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgfQorCisgICAgICAgIGlmICg0ICE9IHNzY2FuZihwdHIsIiVoaHUgJWhodSAlaGh1ICV1IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICYodFR4UGVyVHJhY2tpbmdQYXJhbS51Y1R4UGVyVHJhY2tpbmdFbmFibGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgJih0VHhQZXJUcmFja2luZ1BhcmFtLnVjVHhQZXJUcmFja2luZ1BlcmlvZCksCisgICAgICAgICAgICAgICAgICAgICAgICAmKHRUeFBlclRyYWNraW5nUGFyYW0udWNUeFBlclRyYWNraW5nUmF0aW8pLAorICAgICAgICAgICAgICAgICAgICAgICAgJih0VHhQZXJUcmFja2luZ1BhcmFtLnVUeFBlclRyYWNraW5nV2F0ZXJtYXJrKSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICJDT05GSUctVFgtVFJBQ0tJTkcgJXMgaW5wdXQgaXMgbm90IGNvcnJlY3QiLHB0cik7CisgICAgICAgICAgICAgICAgICAgICAga2ZyZWUoY21kKTsKKyAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVJTzsKKyAgICAgICAgfQorCisgICAgICAgIC8vIHBhcmFtZXRlcnMgY2hlY2tpbmcKKyAgICAgICAgLy8gcGVyaW9kIGhhcyB0byBiZSBsYXJnZXIgdGhhbiAwCisgICAgICAgIGlmICgwID09IHRUeFBlclRyYWNraW5nUGFyYW0udWNUeFBlclRyYWNraW5nUGVyaW9kKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9XQVJOLCAiUGVyaW9kIGlucHV0IGlzIG5vdCBjb3JyZWN0Iik7CisgICAgICAgICAgICBrZnJlZShjbWQpOworICAgICAgICAgICAgcmV0dXJuIC1FSU87CisgICAgICAgIH0KKworICAgICAgICAvLyB1c2UgZGVmYXVsdCB2YWx1ZSA1IGlzIHRoZSBpbnB1dCBpcyBub3QgcmVhc29uYWJsZS4gaW4gdW5pdCBvZiAxMCUKKyAgICAgICAgaWYgKCh0VHhQZXJUcmFja2luZ1BhcmFtLnVjVHhQZXJUcmFja2luZ1JhdGlvID4gVFhfUEVSX1RSQUNLSU5HX01BWF9SQVRJTykgfHwgKDAgPT0gdFR4UGVyVHJhY2tpbmdQYXJhbS51Y1R4UGVyVHJhY2tpbmdSYXRpbykpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sICJSYXRpbyBpbnB1dCBpcyBub3QgZ29vZC4gdXNlIGRlZmF1bHQgNSIpOworICAgICAgICAgICAgdFR4UGVyVHJhY2tpbmdQYXJhbS51Y1R4UGVyVHJhY2tpbmdSYXRpbyA9IFRYX1BFUl9UUkFDS0lOR19ERUZBVUxUX1JBVElPOworICAgICAgICB9CisKKyAgICAgICAgLy8gZGVmYXVsdCBpcyA1CisgICAgICAgIGlmICgwID09IHRUeFBlclRyYWNraW5nUGFyYW0udVR4UGVyVHJhY2tpbmdXYXRlcm1hcmspCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sICJUeCBQYWNrZXQgbnVtYmVyIGlucHV0IGlzIG5vdCBnb29kLiB1c2UgZGVmYXVsdCA1Iik7CisgICAgICAgICAgICB0VHhQZXJUcmFja2luZ1BhcmFtLnVUeFBlclRyYWNraW5nV2F0ZXJtYXJrID0gVFhfUEVSX1RSQUNLSU5HX0RFRkFVTFRfV0FURVJNQVJLOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0KKyAgICAgICAgICAgIHNtZV9TZXRUeFBlclRyYWNraW5nKHBIZGRDdHgtPmhIYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZGRfdHhfcGVyX2hpdF9jYiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKilwQWRhcHRlciwgJnRUeFBlclRyYWNraW5nUGFyYW0pKSB7CisgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sICJTZXQgVHggUEVSIFRyYWNraW5nIEZhaWxlZCEiKTsKKyAgICAgICAgICAgIHJjID0gLUVJTzsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIHsKKyAgICAgICAgaGRkTG9nKCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwgIiVzOiBVbnN1cHBvcnRlZCBHVUkgY29tbWFuZCAlcyIsCisgICAgICAgICAgICAgICAgX19mdW5jX18sIGNtZCk7CisgICAgfQorZG9uZToKKyAgICAvKiBtYW55IG9mIHRoZSBjb21tYW5kcyB3cml0ZSBpbmZvcm1hdGlvbiBiYWNrIGludG8gdGhlIGNvbW1hbmQKKyAgICAgICBzdHJpbmcgdXNpbmcgc25wcmludGYoKS4gIGNoZWNrIHRoZSByZXR1cm4gdmFsdWUgaGVyZSBpbiBvbmUKKyAgICAgICBwbGFjZSAqLworICAgIGlmICgocmV0IDwgMCkgfHwgKHJldCA+PSBjbWRfbGVuKSkKKyAgICB7CisgICAgICAgLyogdGhlcmUgd2FzIGFuIGVuY29kaW5nIGVycm9yIG9yIG92ZXJmbG93ICovCisgICAgICAgcmMgPSAtRUlOVkFMOworICAgIH0KKyAgICBlbHNlIGlmIChyZXQgPiAwKQorICAgIHsKKyAgICAgICBpZiAoY29weV90b191c2VyKHdycXUtPmRhdGEucG9pbnRlciwgY21kLCByZXQpKQorICAgICAgIHsKKyAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IGZhaWxlZCB0byBjb3B5IGRhdGEgdG8gdXNlciBidWZmZXIiLCBfX2Z1bmNfXyk7CisgICAgICAgICAga2ZyZWUoY21kKTsKKyAgICAgICAgICByZXR1cm4gLUVGQVVMVDsKKyAgICAgICB9CisgICAgICAgd3JxdS0+ZGF0YS5sZW5ndGggPSByZXQ7CisgICAgfQorCisgICAgaWYgKGlvY3RsX2RlYnVnKQorICAgIHsKKyAgICAgICBwcl9pbmZvKCIlczogcnNwIFslc10gbGVuIFslZF0gc3RhdHVzICVkXG4iLAorICAgICAgICAgICAgICAgX19mdW5jX18sIGNtZCwgd3JxdS0+ZGF0YS5sZW5ndGgsIHJjKTsKKyAgICB9CisgICAga2ZyZWUoY21kKTsKKyAgICBFWElUKCk7CisgICAgcmV0dXJuIHJjOworfQorCitzdGF0aWMgaW50IGl3X3NldF9wcml2KHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgaW50IHJldDsKKyAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICByZXQgPSBfX2l3X3NldF9wcml2KGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IF9faXdfc2V0X25pY2soc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcjsKKyAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICBpbnQgcmV0ID0gMDsKKworICAgRU5URVIoKTsKKworICAgcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgfQorCisgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgaWYgKDAgIT0gcmV0KQorICAgeworICAgICAgIHJldHVybiByZXQ7CisgICB9CisgICBFWElUKCk7CisgICByZXR1cm4gMDsKK30KKworc3RhdGljIGludCBpd19zZXRfbmljayhzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgIGludCByZXQ7CisKKyAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICByZXQgPSBfX2l3X3NldF9uaWNrKGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IF9faXdfZ2V0X25pY2soc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcjsKKyAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICBpbnQgcmV0ID0gMDsKKworICAgRU5URVIoKTsKKworICAgcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgfQorCisgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgaWYgKDAgIT0gcmV0KQorICAgeworICAgICAgIHJldHVybiByZXQ7CisgICB9CisgICBFWElUKCk7CisgICByZXR1cm4gMDsKK30KKworc3RhdGljIGludCBpd19nZXRfbmljayhzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgIGludCByZXQ7CisKKyAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICByZXQgPSBfX2l3X2dldF9uaWNrKGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgc3RydWN0IGl3X3N0YXRpc3RpY3MgKiBfX2dldF93aXJlbGVzc19zdGF0cyhzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQoreworICAgRU5URVIoKTsKKyAgIHJldHVybiBOVUxMOworfQorCitzdGF0aWMgc3RydWN0IGl3X3N0YXRpc3RpY3MgKmdldF93aXJlbGVzc19zdGF0cyhzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQoreworCisgICAgICAgc3RydWN0IGl3X3N0YXRpc3RpY3MgKnN0YXRzOworCisgICAgICAgdm9zX3Nzcl9w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AgICAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgfQorCisgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICBzdGF0dXMgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgaWYgKDAgIT0gc3RhdHVzKQorICAgeworICAgICAgIHJldHVybiBzdGF0dXM7CisgICB9CisgICBwV2V4dFN0YXRlID0gV0xBTl9IRERfR0VUX1dFWFRfU1RBVEVfUFRSKHBBZGFwdGVyKTsKKyAgIGlmIChOVUxMID09IHBXZXh0U3RhdGUpCisgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogIHBXZXh0U3RhdGUgaXMgTlVMTCAiLF9fZnVuY19fKTsKKyAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgIH0KKyAgIHBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKyAgIGlmIChOVUxMID09IHBIZGRTdGFDdHgpCisgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogU1RBIENvbnRleHQgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgfQorCisgICBrZXlJZCA9IGVuY29kZXJxLT5mbGFncyAmIElXX0VOQ09ERV9JTkRFWDsKKworICAgaWYoa2V5SWQpCisgICB7CisgICAgICAgaWYoa2V5SWQgPiBNQVhfV0VQX0tFWVMpCisgICAgICAgeworICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICB9CisKKyAgICAgICBmS2V5UHJlc2VudCA9ID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EVfTk9ORTsKKyAgICAgICBwSGRkU3RhQ3R4LT5jb25uX2luZm8ubWNFbmNyeXB0aW9uVHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX05PTkU7CisKKyAgICAgICBpZihlQ29ubmVjdGlvblN0YXRlX0Fzc29jaWF0ZWQgPT0gcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmNvbm5TdGF0ZSkKKyAgICAgICB7CisgICAgICAgICAgIElOSVRfQ09NUExFVElPTihwQWRhcHRlci0+ZGlzY29ubmVjdF9jb21wX3Zhcik7CisgICAgICAgICAgIHN0YXR1cyA9IHNtZV9Sb2FtRGlzY29ubmVjdCggV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLCBwQWRhcHRlci0+c2Vzc2lvbklkLCBlQ1NSX0RJU0NPTk5FQ1RfUkVBU09OX1VOU1BFQ0lGSUVEICk7CisgICAgICAgICAgIGlmKGVIQUxfU1RBVFVTX1NVQ0NFU1MgPT0gc3RhdHVzKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIGxvbmcgcmV0OworICAgICAgICAgICAgICAgICByZXQgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGVfdGltZW91dCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBZGFwdGVyLT5kaXNjb25uZWN0X2NvbXBfdmFyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcyhXTEFOX1dBSVRfVElNRV9ESVNDT05ORUNUKSk7CisgICAgICAgICAgICAgICAgaWYgKHJldCA8PSAwKQorICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiZmFpbGVkIHdhaXQgb24gZGlzY29ubmVjdF9jb21wX3ZhciAlbGQiKSwgcmV0KTsKKyAgICAgICAgICAgfQorIC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3RhdGUtPmF1dGhLZXlNZ210KSAmJiAoZUNTUl9BVVRIX1RZUEVfT1BFTl9TWVNURU0gPT0gcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmF1dGhUeXBlKSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgZW5jcnlwdGlvblR5cGUgPSBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVA0MDsKKyAgICAgICAgICAgfQorICAgICAgICAgICBlbHNlCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGVuY3J5cHRpb25UeXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfV0VQNDBfU1RBVElDS0VZOworICAgICAgICAgICB9CisgICAgICAgfQorICAgICAgIGVsc2UgaWYoMTMgPT0ga2V5X2xlbmd0aCkKKyAgICAgICB7CisgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIiVzOkNhbGwgd2l0aCBXRVAxMDQsa2V5X2xlbjolZCIsX19mdW5jX18sa2V5X2xlbmd0aCk7CisKKyAgICAgICAgICAgaWYoKElXX0FVVEhfS0VZX01HTVRfODAyXzFYID09IHBXZXh0U3RhdGUtPmF1dGhLZXlNZ210KSAmJiAoZUNTUl9BVVRIX1RZUEVfT1BFTl9TWVNURU0gPT0gcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmF1dGhUeXBlKSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgZW5jcnlwdGlvblR5cGUgPSBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVAxMDQ7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgZWxzZQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBlbmNyeXB0aW9uVHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX1dFUDEwNF9TVEFUSUNLRVk7CisgICAgICAgICAgIH0KKyAgICAgICB9CisgICAgICAgZWxzZQorICAgICAgIHsKKyAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9XQVJOLCA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nBXZXh0U3RhdGUtPnJvYW1Qcm9maWxlLktleXMuS2V5TWF0ZXJpYWxba2V5SWRdWzBdLGV4dHJhLGtleV9sZW5ndGgpOworCisgICAgICAgICAgcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGUuS2V5cy5LZXlMZW5ndGhba2V5SWRdID0gKHZfVThfdClrZXlfbGVuZ3RoOworICAgICAgICAgIHBXZXh0U3RhdGUtPnJvYW1Qcm9maWxlLktleXMuZGVmYXVsdEluZGV4ID0gKHZfVThfdClrZXlJZDsKKworICAgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgICAgfQorICAgfQorICAgRVhJVCgpOworICAgcmV0dXJuIDA7Cit9CisKK3N0YXRpYyBpbnQgaXdfc2V0X2VuY29kZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSxjaGFyICpleHRyYSkKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X3NldF9lbmNvZGUoZGV2LCBpbmZvLCB3cnF1LCBleHRyYSk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBfX2l3X2dldF9lbmNvZGVleHQoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcG9pbnQgKmR3cnEsCisgICAgICAgICAgICAgICBjaGFyICpleHRyYSkKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcjsKKyAgICBoZGRfd2V4dF9zdGF0ZV90ICAqcFdle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kFMOworICAgIH0KKyAgICBwUm9hbVByb2ZpbGUgPSAmKHBXZXh0U3RhdGUtPnJvYW1Qcm9maWxlKTsKKworICAgIGtleUlkID0gcFJvYW1Qcm9maWxlLT5LZXlzLmRlZmF1bHRJbmRleDsKKworICAgIGlmKGtleUlkIDwgMCB8fCBrZXlJZCA+PSBNQVhfV0VQX0tFWVMpCisgICAgeworICAgICAgICBoZGRMb2coTE9HMSwiJXM6IEludmFsaWQga2V5SWQgOiAlZCIsX19mdW5jX18sa2V5SWQpOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBpZihwUm9hbVByb2ZpbGUtPktleXMuS2V5TGVuZ3RoW2tleUlkXSA+IDApCisgICAgeworICAgICAgICBkd3JxLT5mbGFncyB8PSBJV19FTkNPREVfRU5BQkxFRDsKKyAgICAgICAgZHdycS0+bGVuZ3RoID0gcFJvYW1Qcm9maWxlLT5LZXlzLktleUxlbmd0aFtrZXlJZF07CisgICAgICAgIHZvc19tZW1fY29weShleHRyYSwgJihwUm9hbVByb2ZpbGUtPktleXMuS2V5TWF0ZXJpYWxba2V5SWRdWzBdKSwKKyAgICAgICAgICAgICAgICAgICAgIHBSb2FtUHJvZmlsZS0+S2V5cy5LZXlMZW5ndGhba2V5SWRdKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgZHdycS0+ZmxhZ3MgfD0gSVdfRU5DT0RFX0RJU0FCTEVEOworICAgIH0KKworICAgIGZvcihpPTA7IGkgPCBNQVhfV0VQX0tFWVM7IGkrKykKKyAgICB7CisgICAgICAgIGlmKHBSb2FtUHJvZmlsZS0+S2V5cy5LZXlNYXRlcmlhbFtpXSA9PSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgICAgaWYoTUFYX1dFUF9LRVlTID09IGkpCisgICAgeworICAgICAgICBkd3JxLT5mbGFncyB8PSBJV19FTkNPREVfTk9LRVk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGR3cnEtPmZsYWdzIHw9IElXX0VOQ09ERV9FTkFCTEVEOworICAgIH0KKworICAgIGVuY3J5cHRpb25UeXBlID0gcFJvYW1Qcm9maWxlLT5FbmNyeXB0aW9uVHlwZS5lbmNyeXB0aW9uVHlwZVswXTsKKworICAgIGlmKGVDU1JfRU5DUllQVF9UWVBFX05PTkUgPT0gZW5jcnlwdGlvblR5cGUpCisgICAgeworICAgICAgICBkd3JxLT5mbGFncyB8PSBJV19FTkNPREVfRElTQUJMRUQ7CisgICAgfQorCisgICAgYXV0aFR5cGUgPSAoV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlcikpLT5jb25uX2luZm8uYXV0aFR5cGU7CisKKyAgICBpZihJV19BVVRIX0FMR19PUEVOX1NZU1RFTSA9PSBhdXRoVHlwZSkKKyAgICB7CisgICAgICAgIGR3cnEtPmZsYWdzIHw9IElXX0VOQ09ERV9PUEVOOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBkd3JxLT5mbGFncyB8PSBJV19FTkNPREVfUkVTVFJJQ1RFRDsKKyAgICB9CisgICAgRVhJVCgpOworICAgIHJldHVybiAwOworCit9CisKK3N0YXRpYyBpbnQgaXdfZ2V0X2VuY29kZWV4dChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgIHN0cnVjdCBpd19wb2ludCAqZHdycSwKKyAgICAgICAgICAgICAgIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X2dldF9lbmNvZGVleHQoZGV2LCBpbmZvLCBkd3JxLCBleHRyYS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KyAgICBpZiAoTlVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBBZGFwdGVyIGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICBzdGF0dXMgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHN0YXR1cykKKyAgICB7CisgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgfQorICAgIHBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKyAgICBpZiAoTlVMTCA9PSBwSGRkU3RhQ3R4KQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IFNUQSBDb250ZXh0IGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIHBXZXh0U3RhdGUgPSBXTEFOX0hERF9HRVRfV0VYVF9TVEFURV9QVFIocEFkYXB0ZXIpOworICAgIGlmIChOVUxMID09IHBXZXh0U3RhdGUpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogcFdleHRTdGF0ZSBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBwUm9hbVByb2ZpbGUgPSAmcFdleHRTdGF0ZS0+cm9hbVByb2ZpbGU7CisgICAga2V5X2luZGV4ID0gZW5jb2RpbmctPmZsYWdzICYgSVdfRU5DT0RFX0lOREVYOworCisgICAgaWYoa2V5X2luZGV4ID4gMCkgeworCisgICAgICAgICAvKkNvbnZlcnQgZnJvbSAxLWJhc2VkIHRvIDAtYmFzZWQga2V5aW5nKi8KKyAgICAgICAga2V5X2luZGV4LS07CisgICAgfQorICAgIGlmKCFleHQtPmtleV9sZW4pIHsKKworICAgICAgLypTZXQgdGhlIGVuY3J5dGlvbiB0eXBlIHRvIE5PTkUqLworICAgICAgIHBSb2FtUHJvZmlsZS0+RW5jcnlwdGlvblR5cGUuZW5jcnlwdGlvblR5cGVbMF0gPSBlQ1NSX0VOQ1JZUFRfVFlQRV9OT05FOworICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgfQorCisgICAgaWYoZUNvbm5lY3Rpb25TdGF0ZV9Ob3RDb25uZWN0ZWQgPT0gcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmNvbm5TdGF0ZSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoSVdfRU5DT0RFX0FMR19XRVAgPT0gZXh0LT5hbGcpKQorICAgIHsKKyAgICAgICBpZihJV19BVVRIX0tFWV9NR01UXzgwMl8xWCA9PSBwV2V4dFN0YXRlLT5hdXRoS2V5TWdtdCkgeworCisgICAgICAgICAgVk9TX1RSQUNFIChWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKCJJbnZhbGlkIENvbmZpZ3VyYXRpb246JXMiKSxfX2Z1bmNfXyk7CisgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgfQorICAgICAgIGVsc2UgeworICAgICAgICAgLypTdGF0aWMgd2VwLCB1cGRhdGUgdGhlIHJvYW0gcHJvZmlsZSB3aXRoIHRoZSBrZXlzICovCisgICAgICAgICAgaWYoZXh0LT5rZXkgJiYgKGV4dC0+a2V5X2xlbiA8PSBlQ1NSX1NFQ1VSSVRZX1dFUF9LRVlTSVpFX01BWF9CWVRFUykgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleV9pbmRleCA8IENTUl9NQVhfTlVNX0tFWSkgeworICAgICAgICAgICAgIHZvc19tZW1fY29weSgmcFJvYW1Qcm9maWxlLT5LZXlzLktleU1hdGVyaWFsW2tleV9pbmRleF1bMF0sZXh0LT5rZXksZXh0LT5rZXlfbGVuKTsKKyAgICAgICAgICAgICBwUm9hbVByb2ZpbGUtPktleXMuS2V5TGVuZ3RoW2tleV9pbmRleF0gPSAodl9VOF90KWV4dC0+a2V5X2xlbjsKKworICAgICAgICAgICAgIGlmKGV4dC0+ZXh0X2ZsYWdzICYgSVdfRU5DT0RFX0VYVF9TRVRfVFhfS0VZKQorICAgICAgICAgICAgICAgIHBSb2FtUHJvZmlsZS0+S2V5cy5kZWZhdWx0SW5kZXggPSAodl9VOF90KWtleV9pbmRleDsKKworICAgICAgICAgIH0KKyAgICAgICB9CisgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICB9CisKKyAgICB2b3NfbWVtX3plcm8oJnNldEtleSxzaXplb2YodENzclJvYW1TZXRLZXkpKTsKKworICAgIHNldEtleS5rZXlJZCA9IGtleV9pbmRleDsKKyAgICBzZXRLZXkua2V5TGVuZ3RoID0gZXh0LT5rZXlfbGVuOworCisgICAgaWYoZXh0LT5rZXlfbGVuIDw9IENTUl9NQVhfS0VZX0xFTikgeworICAgICAgIHZvc19tZW1fY29weSgmc2V0S2V5LktleVswXSxleHQtPmtleSxleHQtPmtleV9sZW4pOworICAgIH0KKworICAgIGlmKGV4dC0+ZXh0X2ZsYWdzICYgSVdfRU5DT0RFX0VYVF9HUk9VUF9LRVkpIHsKKyAgICAgIC8qS2V5IGRpcmVjdGlvbiBmb3IgZ3JvdXAgaXMgUlggb25seSovCisgICAgICAgc2V0S2V5LmtleURpcmVjdGlvbiA9IGVTSVJfUlhfT05MWTsKKyAgICAgICB2b3NfbWVtX2NvcHkoc2V0S2V5LnBlZXJNYWMsZ3JvdXBtYWNhZGRyLFdOSV9DRkdfQlNTSURfTEVOKTsKKyAgICB9CisgICAgZWxzZSB7CisKKyAgICAgICBzZXRLZXkua2V5RGlyZWN0aW9uID0gIGVTSVJfVFhfUlg7CisgICAgICAgdm9zX21lbV9jb3B5KHNldEtleS5wZWVyTWFjLGV4dC0+YWRkci5zYV9kYXRhLFdOSV9DRkdfQlNTSURfTEVOKTsKKyAgICB9CisKKyAgICAvKkZvciBzdXBwbGljYW50IHBhZSByb2xlIGlzIHplcm8qLworICAgIHNldEtleS5wYWVSb2xlID0gMDsKKworICAgIHN3aXRjaChleHQtPmFsZykKKyAgICB7CisgICAgICAgY2FzZSBJV19FTkNPREVfQUxHX05PTkU6CisgICAgICAgICBzZXRLZXkuZW5jVHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX05PTkU7CisgICAgICAgICBicmVhazsKKworICAgICAgIGNhc2UgSVdfRU5DT0RFX0FMR19XRVA6CisgICAgICAgICBzZXRLZXkuZW5jVHlwZSA9IChleHQtPmtleV9sZW49PSA1KSA/IGVDU1JfRU5DUllQVF9UWVBFX1dFUDQwOmVDU1JfRU5DUllQVF9UWVBFX1dFUDEwNDsKKyAgICAgICAgIGJyZWFrOworCisgICAgICAgY2FzZSBJV19FTkNPREVfQUxHX1RLSVA6CisgICAgICAgeworICAgICAgICAgIHZfVThfdCAqcEtleSA9ICZzZXRLZXkuS2V5WzBdOworCisgICAgICAgICAgc2V0S2V5LmVuY1R5cGUgPSBlQ1NSX0VOQ1JZUFRfVFlQRV9US0lQOworCisgICAgICAgICAgdm9zX21lbV96ZXJvKHBLZXksIENTUl9NQVhfS0VZX0xFTik7CisKKyAgICAgICAgICAvKlN1cHBsaWNhbnQgc2VuZHMgdGhlIDMyYnl0ZXMga2V5IGluIHRoaXMgb3JkZXIKKworICAgICAgICAgICAgICAgIHwtLS0tLS0tLS0tLS0tLXwtLS0tLS0tLS0tfC0tLS0tLS0tLS18CisgICAgICAgICAgICAgICAgfCAgIFRrMSAgICAgICAgfFRYLU1JQyAgICB8ICBSWCBNaWMgIHwKKyAgICAgICAgICAgICAgICB8LS0tLS0tLS0tLS0tLS18LS0tLS0tLS0tLXwtLS0tLS0tLS0tfAorICAgICAgICAgICAgICAgIDwtLS0xNmJ5dGVzLS0tPjwtLThieXRlcy0tPjwtLThieXRlcy0tPgorCisgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAvKlNtZSBleHBlY3RzIHRoZSAzMiBieXRlcyBrZXkgdG8gYmUgaW4gdGhlIGJlbG93IG9yZGVyCisKKyAgICAgICAgICAgICAgICB8LS0tLS0tLS0tLS0tLS18LS0tLS0tLS0tLXwtLS0tLS0tLS0tfAorICAgICAgICAgICAgICAgIHwgICBUazEgICAgICAgIHxSWC1NSUMgICAgfCAgVFggTWljICB8CisgICAgICAgICAgICAgICAgfC0tLS0tLS0tLS0tLS0tfC0tLS0tLS0tLS18LS0tLS0tLS0tLXwKKyAgICAgICAgICAgICAgICA8LS0tMTZieXRlcy0tLT48LS04Ynl0ZXMtLT48LS04Ynl0ZXMtLT4KKyAgICAgICAgICAgICAgICovCisgICAgICAgICAgLyogQ29weSB0aGUgVGVtcG9yYWwgS2V5IDEgKFRLMSkgKi8KKyAgICAgICAgICB2b3NfbWVtX2NvcHkocEtleSxleHQtPmtleSwxNik7CisKKyAgICAgICAgIC8qQ29weSB0aGUgcnggbWljIGZpcnN0Ki8KKyAgICAgICAgICB2b3NfbWVtX2NvcHkoJnBLZXlbMTZdLCZleHQtPmtleVsyNF0sOCk7CisKKyAgICAgICAgIC8qQ29weSB0aGUgdHggbWljICovCisgICAgICAgICAgdm9zX21lbV9jb3B5KCZwS2V5WzI0XSwmZXh0LT5rZXlbMTZdLDgpOworCisgICAgICAgfQorICAgICAgIGJyZWFrO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F9SRVRSWV9MSU1JVCwgd3JxdS0+cmV0cnkudmFsdWUsIGNjbUNmZ1NldENhbGxiYWNrLCBlQU5JX0JPT0xFQU5fVFJVRSkgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUyApCisgICAgICAgICAgeworICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIEZMKCJmYWlsZWQgdG8gc2V0IGluaSBwYXJhbWV0ZXIsIFdOSV9DRkdfU0hPUlRfUkVUUllfTElNSVQiKSk7CisgICAgICAgICAgICAgcmV0dXJuIC1FSU87CisgICAgICAgICAgfQorICAgICAgIH0KKyAgIH0KKyAgIGVsc2UKKyAgIHsKKyAgICAgICByZXR1cm4gLUVPUE5PVFNVUFA7CisgICB9CisKKyAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sICgiU2V0IFJldHJ5LUxpbWl0PSVkISEiKSx3cnF1LT5yZXRyeS52YWx1ZSk7CisKKyAgIEVYSVQoKTsKKworICAgcmV0dXJuIDA7CisKK30KKworc3RhdGljIGludCBpd19zZXRfcmV0cnkoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgIGludCByZXQ7CisKKyAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICByZXQgPSBfX2l3X3NldF9yZXRyeShkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBfX2l3X2dldF9yZXRyeShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXI7CisgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgdEhhbEhhbmRsZSBoSGFsOworICAgdl9VMzJfdCByZXRyeSA9IDA7CisgICBpbnQgcmV0ID0gMDsKKworICAgRU5URVIoKTsKKworICAgcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgfQorCisgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgaWYgKDAgIT0gcmV0KQorICAgeworICAgICAgIHJldHVybiByZXQ7CisgICB9CisKKyAgIGhIYWwgPSBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlcik7CisgICBpZiAoTlVMTCA9PSBoSGFsKQorICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IEhhbCBDb250ZXh0IGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgIH0KKworICAgaWYo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x1ZSA9IHJldHJ5OworICAgfQorICAgZWxzZSB7CisgICAgICByZXR1cm4gLUVPUE5PVFNVUFA7CisgICB9CisKKyAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sICgiUmV0cnktTGltaXQ9JWQhISIpLHJldHJ5KTsKKworICAgRVhJVCgpOworCisgICByZXR1cm4gMDsKK30KKworc3RhdGljIGludCBpd19nZXRfcmV0cnkoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgIGludCByZXQ7CisKKyAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICByZXQgPSBfX2l3X2dldF9yZXRyeShkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBfX2l3X3NldF9tbG1lKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsCisgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgKmV4dHJhKQoreworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHg7CisgICAgc3RydWN0IGl3X21sbWUgKm1sbWUgPSAoc3RydWN0IGl3X21sbWUgKilleHRyYTsKKyAgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgaW50IHJldCA9IDA7CisKKyAgICBFTlRFUigpOworICAgIHBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6QWRhcHRlciBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgcmV0ID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSByZXQpCisgICAgeworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKyAgICBwSGRkU3RhQ3R4ID0gV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlcik7CisgICAgaWYgKE5VTEwgPT0gcEhkZFN0YUN0eCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczpTVEEgY29udGV4dCBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIC8vcmVhc29uX2NvZGUgaXMgdW51c2VkLiBCeSBkZWZhdWx0IGl0IGlzIHNldCB0byBlQ1NSX0RJU0NPTk5FQ1RfUkVBU09OX1VOU1BFQ0lGSUVECisgICAgc3dpdGNoIChtbG1lLT5jbWQpIHsKKyAgICAgICAgY2FzZSBJV19NTE1FX0RJU0FTU09DOgorICAgICAgICBjYXNlIElXX01MTUVfREVBVVRIOgorCisgICAgICAgICAgICBpZiggcEhkZFN0YUN0eC0+Y29ubl9pbmZvLmNvbm5TdGF0ZSA9PSBlQ29ubmVjdGlvblN0YXRlX0Fzc29jaWF0ZWQgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGVDc3JSb2FtRGlzY29ubmVjdFJlYXNvbiByZWFzb24gPSBlQ1NSX0RJU0NPTk5FQ1RfUkVBU09OX1VOU1BFQ0lGSUVEOworCisgICAgICAgICAgICAgICAgaWYoIG1sbWUtPnJlYXNvbl9jb2RlID09IEhERF9SRUFTT05fTUlDSEFFTF9NSUNfRkFJTFVSRSApCisgICAgICAgICAgICAgICAgICAgIHJlYXNvbiA9IGVDU1JfRElTQ09OTkVDVF9SRUFTT05fTUlDX0VSUk9SOworCisgICAgICAgICAgICAgICAgSU5JVF9DT01QTEVUSU9OKHBBZGFwdGVyLT5kaXNjb25uZWN0X2NvbXBfdmFyKTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBzbWVfUm9hbURpc2Nvbm5lY3QoIFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwgcEFkYXB0ZXItPnNlc3Npb25JZCxyZWFzb24pOworCisgICAgICAgICAgICAgICAgaWYoZUhBTF9TVEFUVVNfU1VDQ0VTUyA9PSBzdGF0dXMpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBsb25nIHJldDsKKyAgICAgICAgICAgICAgICAgICAgcmV0ID0gd2FpdF9mb3JfY29tcGxldGlvbl9pbnRlcnJ1cHRpYmxlX3RpbWVvdXQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwQWRhcHRlci0+ZGlzY29ubmVjdF9jb21wX3ZhciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoV0xBTl9XQUlUX1RJTUVfRElTQ09OTkVDVCkpOworICAgICAgICAgICAgICAgICAgICBpZiAocmV0IDw9IDApCisgICAgICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJmYWlsZWQgd2FpdCBvbiBkaXNjb25uZWN0X2NvbXBfdmFyICVsZCIpLCByZXQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCIlcyAlZCBDb21tYW5kIERpc2Fzc29jaWF0ZS9EZWF1dGhlbnRpY2F0ZSA6IGNzclJvYW1EaXNjb25uZWN0IGZhaWx1cmUgcmV0dXJuZWQgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgKGludCltbG1lLT5jbWQsIChpbnQpc3RhdHVzICk7CisKKyAgICAgICAgICAgICAgICAvKiBSZXNldHRpbmcgYXV0aEtleU1nbXQgKi8KKyAgICAgICAgICAgICAgICAoV0xBTl9IRERfR0VUX1dFWFRfU1RBVEVfUFRSKHBBZGFwdGVyKSktPmF1dGhLZXlNZ210ID0gMDsKKworICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgRkwoIkRpc2FibGluZyBxdWV1ZXMiKSk7CisgICAgICAgICAgICAgICAgbmV0aWZfdHhfZGlzYWJsZShkZXYpOworICAgICAgICAgICAgICAgIG5ldGlmX2NhcnJpZXJfb2ZmKGRldik7CisKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwiJXMgJWQgQ29tbWFuZCBEaXNhc3NvY2lhdGUvRGVhdXRoZW50aWNhdGUgY2FsbGVkIGJ1dCBzdGF0aW9uIGlzIG5vdCBpbiBhc3NvY2lhdGVkIHN0YXRlIiwgX19mdW5jX18sIChpbnQpbWxtZS0+Y21kICk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGhkZExvZyhMT0dFLCIlcyAlZCBDb21tYW5kIHNob3VsZCBiZSBEaXNhc3NvY2lhdGUvRGVhdXRoZW50aWNhdGUiLCBfX2Z1bmNfXywgKGludCltbG1lLT5jbWQgKTsKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0vL2VuZCBvZiBzd2l0Y2gKKworICAgIEVYSVQoKTsKKworICAgIHJldHVybiBzdGF0dXM7CisKK30KKworc3RhdGljIGludCBpd19zZXRfbWxtZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LAorICAgICAgICAgICAgICAgICAgICAgICBjaGFyICpleHRyYSkKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X3NldF9tbG1lKGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKKy8qIHNldCBwYXJhbSBzdWItaW9jdGxzICovCitzdGF0aWMgaW50IF9faXdfc2V0aW50X2dldG5vbmUoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyOworICAgIHRIYWxIYW5kbGUgaEhhbDsKKyAgICBoZGRfd2V4dF9zdGF0ZV90ICAqcFdleHRTdGF0ZTsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgIGhkZF9tb25fY3R4X3QgKnBNb25DdHggPSBOVUxMOworICAgIGludCAqdmFsdWUgPSAoaW50ICopZXh0cmE7CisgICAgaW50IHN1Yl9jbWQgPSB2YWx1ZVswXTsKKyAgICBpbnQgc2V0X3ZhbHVlID0gdmFsdWVbMV07CisgICAgaW50IHJldCA9IDA7IC8qIHN1Y2Nlc3MgKi8KKyAgICBpbnQgZW5hYmxlX3BibSwgZW5hYmxlX21wOworI2lmZGVmIENPTkZJR19IQVNfRUFSTFlTVVNQRU5ECisgICAgdl9VOF90IG5FbmFibGVTdXNwZW5kT2xkOworI2VuZGlmCisKKyAgICBFTlRFUigpOworICAgIHBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogQWRhcHRlciBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgcmV0ID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSByZXQpCisgICAgeworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKworICAgIGlmICggVk9TX01PTklUT1JfTU9ERSAhPSBoZGRfZ2V0X2NvbnBhcmFtKCkpCisgICAgeworICAgICAgLyogSW4gbW9uaXRvciBtb2RlIGhIYWwgaXMgTlVMTCAqLworICAgICAgaEhhbCA9IFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKTsKKyAgICAgIGlmIChOVUxMID09IGhIYWwpCisgICAgICB7CisgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogSGFsIENvbnRleHQgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgfQorICAgICAgcFdleHRTdGF0ZSA9IFdMQU5fSEREX0dFVF9XRVhUX1NUQVRFX1BUUihwQWRhcHRlcik7CisgICAgICBpZiAoTlVMTCA9PSBwV2V4dFN0YXRlKQorICAgICAgeworICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiJXM6IHBXZXh0U3RhdGUgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgfQorCisgICAgICBJTklUX0NPTVBMRVRJT04ocFdleHRTdGF0ZS0+Y29tcGxldGlvbl92YXIpOworICAgIH0KKyAgICBzd2l0Y2goc3ViX2NtZCkKKyAgICB7CisgICAgICAgIGNhc2UgV0VfU0VUXzExRF9TVEFURToKKyAgICAgICAgeworICAgICAgICAgICAgdFNtZUNvbmZpZ1BhcmFtcyBzbWVDb25maWc7CisgICAgICAgICAgICBtZW1zZXQoJnNtZUNvbmZpZywgMHgwMCwgc2l6ZW9mKHNtZUNvbmZpZykpOworCisgICAgICAgICAgICBpZigoRU5BQkxFXzExRCA9PSBzZXRfdmFsdWUpIHx8IChESVNBQkxFXzExRCA9PSBzZXRfdmFsdWUpKSB7CisKKyAgICAgICAgICAgICAgICBzbWVfR2V0Q29uZmlnUGFyYW0oaEhhbCwmc21lQ29uZmlnKTsKKyAgICAgICAgICAgICAgICBzbWVDb25maWcuY3NyQ29uZmlnLklzMTFkU3VwcG9ydEVuYWJsZWQgPSAodl9CT09MX3Qpc2V0X3ZhbHVlOworCisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgKCIxMUQgc3RhdGU9JWQhISIpLHNtZUNvbmZpZy5jc3JDb25maWcuSXMxMWRTdXBwb3J0RW5hYmxlZCk7CisKKyAgICAgICAgICAgICAgICBzbWVfVXBkYXRlQ29uZmlnKGhIYWwsJnNtZUNvbmZpZyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIFdFX1dPV0w6CisgICAgICAgIHsKKyAgICAgICAgICAgc3dpdGNoIChzZXRfdmFsdWUpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY2FzZSAweDAwOgorICAgICAgICAgICAgICAgICBoZGRfZXhpdF93b3dsKHBBZGFwdGVyLCBlV09XTF9FWElUX1VTRVIpOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSAweDAxOgorICAgICAgICAgICAgICBjYXNlIDB4MDI6CisgICAgICAgICAgICAgIGNhc2UgMHgwMzoKKyAgICAgICAgICAgICAgICAgZW5hYmxlX21wID0gIChzZXRfdmFsdWUgJiAweDAxKSA/IDEgOiAwOworICAgICAgICAgICAgICAgICBlbmFibGVfcGJtID0gKHNldF92YWx1ZSAmIDB4MDIpID8gMSA6IDA7CisgICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCAibWFnaWMgcGFja2V0ID8gPSAlcyBwYXR0ZXJuIGJ5dGUgbWF0Y2hpbmcgPyA9ICVzIiwKKyAgICAgICAgICAgICAgICAgICAgIChlbmFibGVfbXAgPyAiWUVTIjoiTk8iKSwgKGVuYWJsZV9wYm0gPyAiWUVTIjoiTk8iKSk7CisgICAgICAgICAgICAgICAgIGhkZF9lbnRlcl93b3dsKHBBZGFwdGVyLCBlbmFibGVfbXAsIGVuYWJsZV9wYm0pOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsICJJbnZhbGlkIGFyZyAgJWQgaW4gV0VfV09XTCBJT0NUTCIsIHNldF92YWx1ZSk7CisgICAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICB9CisKKyAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBXRV9TRVRfUE9XRVI6CisgICAgICAgIHsKKyAgICAgICAgICAgc3dpdGNoIChzZXRfdmFsdWUpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY2FzZSAgMDogLy9GdWxsIFBvd2VyCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgc3RydWN0IHN0YXRzQ29udGV4dCBjb250ZXh0OworICAgICAgICAgICAgICAgICBlSGFsU3RhdHVzIHN0YXR1czsKKworICAgICAgICAgICAgICAgICBpbml0X2NvbXBsZXRpb24oJmNvbnRleHQuY29tcGxldGlvbik7CisKKyAgICAgICAgICAgICAgICAgY29udGV4dC5wQWRhcHRlciA9IHBBZGFwdGVyOworICAgICAgICAgICAgICAgICBjb250ZXh0Lm1hZ2ljID0gUE9XRVJfQ09OVEVYVF9NQUdJQzsKKworICAgICAgICAgICAgICAgICBzdGF0dXMgPSBzbWVfUmVxdWVzdEZ1bGxQb3dlcihXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpd19wb3dlcl9jYWxsYmFja19mbiwgJmNvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU01FX0ZVTExfUFdSX05FRURFRF9CWV9IREQpOworICAgICAgICAgICAgICAgICBpZiAoZUhBTF9TVEFUVVNfUE1DX1BFTkRJTkcgPT0gc3RhdHVzKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGludCBscmMgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGVfdGltZW91dCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmY29udGV4dC5jb21wbGV0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoV0xBTl9XQUlUX1RJTUVfUE9XRVIpKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAobHJjIDw9IDApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogU01FICVzIHdoaWxlIHJlcXVlc3RpbmcgZnVsbHBvd2VyIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCAoMCA9PSBscmMpID8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0aW1lb3V0IiA6ICJpbnRlcnJ1cHQiKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgIC8qIGVpdGhlciB3ZSBoYXZlIGEgcmVzcG9uc2Ugb3Igd2UgdGltZWQgb3V0LiAgaWYgd2UgdGltZWQKKyAgICAgICAgICAgICAgICAgICAgb3V0IHRoZXJlIGlzIGEgcmFjZSBjb25kaXRpb24gc3VjaCB0aGF0IHRoZSBjYWxsYmFjaworICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBjb3VsZCBiZSBleGVjdXRpbmcgYXQgdGhlIHNhbWUgdGltZSB3ZSBhcmUuIG9mCisgICAgICAgICAgICAgICAgICAgIHByaW1hcnkgY29uY2VybiBpcyBpZiB0aGUgY2FsbGJhY2sgZnVuY3Rpb24gaGFkIGFscmVhZHkKKyAgICAgICAgICAgICAgICAgICAgdmVyaWZpZWQgdGhlICJtYWdpYyIgYnV0IGhhZCBub3QgeWV0IHNldCB0aGUgY29tcGxldGlvbgorICAgICAgICAgICAgICAgICAgICB2YXJpYWJsZSB3aGVuIGEgdGltZW91dCBvY2N1cnJlZC4gd2Ugc2VyaWFsaXplIHRoZXNlCisgICAgICAgICAgICAgICAgICAgIGFjdGl2aXRpZXMgYnkgaW52YWxpZGF0aW5nIHRoZSBtYWdpYyB3aGlsZSBob2xkaW5nIGEKKyAgICAgICAgICAgICAgICAgICAgc2hhcmVkIHNwaW5sb2NrIHdoaWNoIHdpbGwgY2F1c2UgdXMgdG8gYmxvY2sgaWYgdGhlCisgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrIGlzIGN1cnJlbnRseSBleGVjdXRpbmcgKi8KKyAgICAgICAgICAgICAgICAgc3Bpbl9sb2NrKCZoZGRfY29udGV4dF9sb2NrKTsKKyAgICAgICAgICAgICAgICAgY29udGV4dC5tYWdpYyA9IDA7CisgICAgICAgICAgICAgICAgIHNwaW5fdW5sb2NrKCZoZGRfY29udGV4dF9sb2NrKTsKKworICAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIml3cHJpdiBGdWxsIFBvd2VyIGNvbXBsZXRlZCIpOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBjYXNlICAxOiAvL0VuYWJsZSBCTVBTCisgICAgICAgICAgICAgICAgIHNtZV9FbmFibGVQb3dlclNhdmUoaEhhbCwgZVBNQ19CRUFDT05fTU9ERV9QT1dFUl9TQVZFKTsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgIDI6IC8vRGlzYWJsZSBCTVBTCisgICAgICAgICAgICAgICAgIHNtZV9EaXNhYmxlUG93ZXJTYXZlKGhIYWwsIGVQTUNfQkVBQ09OX01PREVfUE9XRVJfU0FWRSk7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlICAzOiAvL1JlcXVlc3QgQm1wcworICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIHN0cnVjdCBzdGF0c0NvbnRleHQgY29udGV4dDsKKyAgICAgICAgICAgICAgICAgZUhhbFN0YXR1cyBzdGF0dXM7CisKKyAgICAgICAgICAgICAgICAgaW5pdF9jb21wbGV0aW9uKCZjb250ZXh0LmNvbXBsZXRpb24pOworCisgICAgICAgICAgICAgICAgIGNvbnRleHQucEFkYXB0ZXIgPSBwQWRhcHRlcjsKKyAgICAgICAgICAgICAgICAgY29udGV4dC5tYWdpYyA9IFBPV0VSX0NPTlRFWFRfTUFHSUM7CisKKyAgICAgICAgICAgICAgICAgc3RhdHVzID0gc21lX1JlcXVlc3RCbXBzKFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGl3X3Bvd2VyX2NhbGxiYWNrX2ZuLCAmY29udGV4dCk7CisgICAgICAgICAgICAgICAgIGlmIChlSEFMX1NUQVRVU19QTUNfUEVORElORyA9PSBzdGF0dXMpCisgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaW50IGxyYyA9IHdhaXRfZm9yX2NvbXBsZXRpb25faW50ZXJydXB0aWJsZV90aW1lb3V0KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZjb250ZXh0LmNvbXBsZXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNlY3NfdG9famlmZmllcyhXTEFOX1dBSVRfVElNRV9QT1dFUikpOworICAgICAgICAgICAgICAgICAgICBpZiAobHJjIDw9IDApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogU01FICVzIHdoaWxlIHJlcXVlc3RpbmcgQk1QUyIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgKDAgPT0gbHJjKSA/ICJ0aW1lb3V0IiA6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaW50ZXJydXB0Iik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAvKiBlaXRoZXIgd2UgaGF2ZSBhIHJlc3BvbnNlIG9yIHdlIHRpbWVkIG91dC4gIGlmIHdlCisgICAgICAgICAgICAgICAgICAgIHRpbWVkIG91dCB0aGVyZSBpcyBhIHJhY2UgY29uZGl0aW9uIHN1Y2ggdGhhdCB0aGUKKyAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2sgZnVuY3Rpb24gY291bGQgYmUgZXhlY3V0aW5nIGF0IHRoZSBzYW1lCisgICAgICAgICAgICAgICAgICAgIHRpbWUgd2UgYXJlLiBvZiBwcmltYXJ5IGNvbmNlcm4gaXMgaWYgdGhlIGNhbGxiYWNrCisgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGhhZCBhbHJlYWR5IHZlcmlmaWVkIHRoZSAibWFnaWMiIGJ1dCBoYWQKKyAgICAgICAgICAgICAgICAgICAgbm90IHlldCBzZXQgdGhlIGNvbXBsZXRpb24gdmFyaWFibGUgd2hlbiBhIHRpbWVvdXQKKyAgICAgICAgICAgICAgICAgICAgb2NjdXJyZWQuIHdlIHNlcmlhbGl6ZSB0aGVzZSBhY3Rpdml0aWVzIGJ5CisgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGluZyB0aGUgbWFnaWMgd2hpbGUgaG9sZGluZyBhIHNoYXJlZAorICAgICAgICAgICAgICAgICAgICBzcGlubG9jayB3aGljaCB3aWxsIGNhdXNlIHVzIHRvIGJsb2NrIGlmIHRoZQorICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayBpcyBjdXJyZW50bHkgZXhlY3V0aW5nICovCisgICAgICAgICAgICAgICAgIHNwaW5fbG9jaygmaGRkX2NvbnRleHRfbG9jayk7CisgICAgICAgICAgICAgICAgIGNvbnRleHQubWFnaWMgPSAwOworICAgICAgICAgICAgICAgICBzcGluX3VubG9jaygmaGRkX2NvbnRleHRfbG9jayk7CisKKyAgICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsICJpd3ByaXYgUmVxdWVzdCBCTVBTIGNvbXBsZXRlZCIpOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBjYXNlICA0OiAvL0VuYWJsZSBJTVBTCisgICAgICAgICAgICAgICAgIHNtZV9FbmFibGVQb3dlclNhdmUoaEhhbCwgZVBNQ19JRExFX01PREVfUE9XRVJfU0FWRSk7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlICA1OiAvL0Rpc2FibGUgSU1QUworICAgICAgICAgICAgICAgICBzbWVfRGlzYWJsZVBvd2VyU2F2ZShoSGFsLCBlUE1DX0lETEVfTU9ERV9QT1dFUl9TQVZFKTsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgIDY6IC8vRW5hYmxlIFN0YW5kYnkKKyAgICAgICAgICAgICAgICAgc21lX0VuYWJsZVBvd2VyU2F2ZShoSGFsLCBlUE1DX1NUQU5EQllfTU9ERV9QT1dFUl9TQVZFKTsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgIDc6IC8vRGlzYWJsZSBTdGFuZGJ5CisgICAgICAgICAgICAgICAgIHNtZV9EaXNhYmxlUG93ZXJTYXZlKGhIYWwsIGVQTUNfU1RBTkRCWV9NT0RFX1BPV0VSX1NBVkUpOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSAgODogLy9SZXF1ZXN0IFN0YW5kYnkKKyNpZmRlZiBDT05GSUdfSEFTX0VBUkxZU1VTUEVORAorI2VuZGlmCisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlICA5OiAvL1N0YXJ0IEF1dG8gQm1wcyBUaW1lcgorICAgICAgICAgICAgICAgICBzbWVfU3RhcnRBdXRvQm1wc1RpbWVyKGhIYWwpOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSAgMTA6Ly9TdG9wIEF1dG8gQk1QUyBUaW1lcgorICAgICAgICAgICAgICAgICBzbWVfU3RvcEF1dG9CbXBzVGltZXIoaEhhbCk7CisgICAgICAgICAgICAgICAgIGJyZWFrOworI2lmZGVmIENPTkZJR19IQVNfRUFSTFlTVVNQRU5ECisgICAgICAgICAgICAgIGNhc2UgIDExOi8vc3VzcGVuZCB0byBzdGFuZGJ5CisjaWZkZWYgQ09ORklHX0hBU19FQVJMWVNVU1BFTkQKKyAgICAgICAgICAgICAgICAgbkVuYWJsZVN1c3BlbmRPbGQgPSAoV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcikpLT5jZmdfaW5pLT5uRW5hYmxlU3VzcGVuZDsKKyAgICAgICAgICAgICAgICAgKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+Y2ZnX2luaS0+bkVuYWJsZVN1c3BlbmQgPSAxOworICAgICAgICAgICAgICAgICAoV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcikpLT5jZmdfaW5pLT5uRW5hYmxlU3VzcGVuZCA9IG5FbmFibGVTdXNwZW5kT2xkOworI2VuZGlmCisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlICAxMjovL3N1c3BlbmQgdG8gZGVlcCBzbGVlcAorI2lmZGVmIENPTkZJR19IQVNfRUFSTFlTVVNQRU5ECisgICAgICAgICAgICAgICAgIG5FbmFibGVTdXNwZW5kT2xkID0gKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+Y2ZnX2luaS0+bkVuYWJsZVN1c3BlbmQ7CisgICAgICAgICAgICAgICAgIChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPmNmZ19pbmktPm5FbmFibGVTdXNwZW5kID0gMjsKKyAgICAgICAgICAgICAgICAgKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+Y2ZnX2luaS0+bkVuYWJsZVN1c3BlbmQgPSBuRW5hYmxlU3VzcGVuZE9sZDsKKyNlbmRpZgorICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSAgMTM6Ly9yZXN1bWUgZnJvbSBzdXNwZW5kCisjaWZkZWYgQ09ORklHX0hBU19FQVJMWVNVU1BFTkQKKyNlbmRpZgorICAgICAgICAgICAgICAgICBicmVhazsKKyNlbmRpZgorICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIkludmFsaWQgYXJnICAlZCBpbiBXRV9TRVRfUE9XRVIgSU9DVEwiLCBzZXRfdmFsdWUpOworICAgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgfQorICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgV0VfU0VUX01BWF9BU1NPQzoKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKChXTklfQ0ZHX0FTU09DX1NUQV9MSU1JVF9TVEFNSU4gPiBzZXRfdmFsdWUpIHx8CisgICAgICAgICAgICAgICAgKFdOSV9DRkdfQVNTT0NfU1RBX0xJTUlUX1NUQU1BWCA8IHNldF92YWx1ZSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKCBjY21DZmdTZXRJbnQoaEhhbCwgV05JX0NGR19BU1NPQ19TVEFfTElNSVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldF92YWx1ZSwgTlVMTCwgZUFOSV9CT09MRUFOX0ZBTFNFKQorICAgICAgICAgICAgICAgICAgICAgICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgRkwoImZhaWxlZCB0byBzZXQgaW5pIHBhcmFtZXRlciwgV05JX0NGR19BU1NPQ19TVEFfTElNSVQiKSk7CisgICAgICAgICAgICAgICAgcmV0ID0gLUVJTzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBXRV9TRVRfU0FQX0FVVE9fQ0hBTk5FTF9TRUxFQ1RJT046CisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKCAwID09IHNldF92YWx1ZSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+Y2ZnX2luaS0+YXBBdXRvQ2hhbm5lbFNlbGVjdGlvbiA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmICggMSA9PSBzZXRfdmFsdWUgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPmNmZ19pbmktPmFwQXV0b0NoYW5uZWxTZWxlY3Rpb24gPSAxOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIkludmFsaWQgYXJnICAlZCBpbiBXRV9TRVRfU0FQX0FVVE9fQ0hBTk5FTF9TRUxFQ1RJT04gSU9DVEwiLCBzZXRfdmFsdWUpOworICAgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisKKyAgICAgICAgY2FzZSAgV0VfU0VUX0RBVEFfSU5BQ1RJVklUWV9UTzoKKyAgICAgICAgeworICAgICAgICAgICBpZiAgKChzZXRfdmFsdWUgPCBDRkdfREFUQV9JTkFDVElWSVRZX1RJTUVPVVRfTUlOKSB8fAorICAgICAgICAgICAgICAgIChzZXRfdmFsdWUgPiBDRkdfREFUQV9JTkFDVElWSVRZX1RJTUVPVVRfTUFYKSB8fAorICAgICAgICAgICAgICAgIChjY21DZmdTZXRJbnQoKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+aEhhbCwKKyAgICAgICAgICAgICAgICAgICAgV05JX0NGR19QU19EQVRBX0lOQUNUSVZJVFlfVElNRU9VVCwKKyAgICAgICAgICAgICAgICAgICAgc2V0X3ZhbHVlLAorICAgICAgICAgICAgICAgICAgICBOVUxMLCBlQU5JX0JPT0xFQU5fRkFMU0UpPT1lSEFMX1NUQVRVU19GQUlMVVJFKSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsIkZhaWx1cmU6IENvdWxkIG5vdCBwYXNzIG9uICIKKyAgICAgICAgICAgICAgICAiV05JX0NGR19QU19EQVRBX0lOQUNUSVZJVFlfVElNRU9VVCBjb25maWd1cmF0aW9uIGluZm8gIgorICAgICAgICAgICAgICAgICJ0byBDQ00iKTsKKyAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBXRV9TRVRfTUFYX1RYX1BPV0VSOgorICAgICAgICB7CisgICAgICAgICAgIHRTaXJNYWNBZGRyIGJzc2lkID0gezB4RkYsMHhGRiwweEZGLDB4RkYsMHhGRiwweEZGfTsKKyAgICAgICAgICAgdFNpck1hY0FkZHIgc2VsZk1hYyA9IHsweEZGLDB4RkYsMHhGRiwweEZGLDB4RkYsMHhGRn07CisKKyAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXM6IFNldHRpbmcgbWF4aW11bSB0eCBwb3dlciAlZCBkQm0iLAorICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHNldF92YWx1ZSk7CisgICAgICAgICAgIGlmKCBzbWVfU2V0TWF4VHhQb3dlcihoSGFsLCBic3NpZCwgc2VsZk1hYywgc2V0X3ZhbHVlKSAhPQorICAgICAgICAgICAgICAgZUhBTF9TVEFUVVNfU1VDQ0VTUyApCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiBTZXR0aW5nIG1heGltdW0gdHggcG93ZXIgZmFpbGVkIiwKKyAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICAgICByZXR1cm4gLUVJTzsKKyAgICAgICAgICAgfQorCisgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGNhc2UgV0VfU0VUX01BWF9UWF9QT1dFUl8yXzQ6CisgICAgICAgIHsKKyAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgIiVzOiBTZXR0aW5nIG1heGltdW0gdHggcG93ZXIgJWQgZEJtIGZvciAyLjQgR0h6IGJhbmQiLAorICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHNldF92YWx1ZSk7CisgICAgICAgICAgIGlmIChzbWVfU2V0TWF4VHhQb3dlclBlckJhbmQoZUNTUl9CQU5EXzI0LCBzZXRfdmFsdWUpICE9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgeworICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgIiVzOiBTZXR0aW5nIG1heGltdW0gdHggcG93ZXIgZmFpbGVkIGZvciAyLjQgR0h6IGJhbmQiLAorICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICAgICByZXR1cm4gLUVJTzsKKyAgICAgICAgICAgfQorCisgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGNhc2UgV0VfU0VUX01BWF9UWF9QT1dFUl81XzA6CisgICAgICAgIHsKKyAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgIiVzOiBTZXR0aW5nIG1heGltdW0gdHggcG93ZXIgJWQgZEJtIGZvciA1LjAgR0h6IGJhbmQiLAorICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHNldF92YWx1ZSk7CisgICAgICAgICAgIGlmIChzbWVfU2V0TWF4VHhQb3dlclBlckJhbmQoZUNTUl9CQU5EXzVHLCBzZXRfdmFsdWUpICE9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgeworICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgIiVzOiBTZXR0aW5nIG1heGltdW0gdHggcG93ZXIgZmFpbGVkIGZvciA1LjAgR0h6IGJhbmQiLAorICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICAgICByZXR1cm4gLUVJTzsKKyAgICAgICAgICAgfQorCisgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGNhc2UgV0VfU0VUX0hJR0hFUl9EVElNX1RSQU5TSVRJT046CisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKCEoKHNldF92YWx1ZSA9PSBlQU5JX0JPT0xFQU5fRkFMU0UpIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgIChzZXRfdmFsdWUgPT0gZUFOSV9CT09MRUFOX1RSVUUpKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIkR5bmFtaWMgRFRJTSBJbmNvcnJlY3QgZGF0YTolZCIsIHNldF92YWx1ZSk7CisgICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZihwQWRhcHRlci0+aGlnaGVyRHRpbVRyYW5zaXRpb24gIT0gc2V0X3ZhbHVlKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPmhpZ2hlckR0aW1UcmFuc2l0aW9uID0gc2V0X3ZhbHVlOworICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HMSwgIiVzOiBoaWdoZXJEdGltVHJhbnNpdGlvbiBzZXQgdG8gOiVkIiwgX19mdW5jX18sIHBBZGFwdGVyLT5oaWdoZXJEdGltVHJhbnNpdGlvbik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBXRV9TRVRfVE1fTEVWRUw6CisgICAgICAgIHsKKyAgICAgICAgICAgaGRkX2NvbnRleHRfdCAqaGRkQ3R4dCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sICJTZXQgVGhlcm1hbCBNaXRpZ2F0aW9uIExldmVsICVkIiwgKGludClzZXRfdmFsdWUpOworICAgICAgICAgICBoZGREZXZUbUxldmVsQ2hhbmdlZEhhbmRsZXIoaGRkQ3R4dC0+cGFyZW50X2Rldiwgc2V0X3ZhbHVlKTsKKworICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgV0VfRU5BQkxFX1NUUklDVF9GQ0NfUkVHOgorICAgICAgICB7CisgICAgICAgICAgIGhkZF9jb250ZXh0X3QgKmhkZEN0eHQgPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICAgICAgICAgc3RydWN0IHdpcGh5ICp3aXBoeSA9IE5VTEw7CisgICAgICAgICAgIGxvbmcgbHJjOworICAgICAgICAgICBpbnQgc3RhdHVzOworCisgICAgICAgICAgIHdpcGh5ID0gaGRkQ3R4dC0+d2lwaHk7CisgICAgICAgICAgIGlmKHdpcGh5ID09IE5VTEwpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIiVzOiB3aXBoeSBpcyBOVUxMICIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICB9CisgICAgICAgICAgIGluaXRfY29tcGxldGlvbigmaGRkQ3R4dC0+d2lwaHlfY2hhbm5lbF91cGRhdGVfZXZlbnQpOworCisgICAgICAgICAgIGhkZEN0eHQtPm5FbmFibGVTdHJpY3RSZWd1bGF0b3J5Rm9yRkNDID0gc2V0X3ZhbHVlOworCisgICAgICAgICAgIHN0YXR1cyA9IHJlZ3VsYXRvcnlfaGludCh3aXBoeSwgIjAwIik7CisgICAgICAgICAgIGlmKHN0YXR1cyA8IDApCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIiVzOiBGYWlsdXJlIGluIHNldHRpbmcgcmVndWxhdG9yeSBydWxlICIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICB9CisKKyAgICAgICAgICAgLyogV2FpdCBmb3IgY29tcGxldGlvbiAqLworICAgICAgICAgICBscmMgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGVfdGltZW91dCgmaGRkQ3R4dC0+d2lwaHlfY2hhbm5lbF91cGRhdGVfZXZlbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKFdMQU5fV0FJVF9USU1FX0NIQU5ORUxfVVBEQVRFKSk7CisgICAgICAgICAgIGlmIChscmMgPD0gMCkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiJXM6IFNNRSAlcyB3aGlsZSBzZXR0aW5nIHN0cmljdCBGQ0MgcmVndWxhdG9yeSBydWxlICIsCisgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sICgwID09IGxyYykgPyAiVGltZW91dCIgOiAiSW50ZXJydXB0Iik7CisgICAgICAgICAgICAgICByZXR1cm4gKDAgPT0gbHJjKSA/IC1FVElNRURPVVQgOiAtRUlOVFI7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLCIlczogU1VDQ0VTUyBpbiBzZXR0aW5nIHN0cmljdCBGQ0MgcmVndWxhdG9yeSBydWxlIiwgX19mdW5jX18pOworCisgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGNhc2UgV0VfU0VUX0RFQlVHX0xPRzoKKyAgICAgICAgeworICAgICAgICAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgICAgICAgIHBIZGRDdHgtPmNmZ19pbmktPmdFbmFibGVEZWJ1Z0xvZyA9IHNldF92YWx1ZTsKKyAgICAgICAgICAgc21lX1VwZGF0ZUNvbm5lY3REZWJ1ZyhwSGRkQ3R4LT5oSGFsLCBzZXRfdmFsdWUpOworICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgICAgICAgIGNhc2UgV0VfU0VUX1RETFNfT0ZGX0NIQU46CisgICAgICAgIHsKKyAgICAgICAgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXM6IFRkbHMgb2ZmY2hhbm5lbCBudW0gJWQiLAorICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHNldF92YWx1ZSk7CisgICAgICAgICAgIHJldCA9IGl3X3NldF90ZGxzb2ZmY2hhbm5lbChwSGRkQ3R4LCBzZXRfdmFsdWUpOworICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBjYXNlIFdFX1NFVF9URExTX1NFQ19PRkZfQ0hBTl9PRkZTRVQ6CisgICAgICAgIHsKKyAgICAgICAgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXM6IFRkbHMgc2VjIG9mZmNoYW4gb2Zmc2V0ICVkIiwKKyAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBzZXRfdmFsdWUpOworICAgICAgICAgICByZXQgPSBpd19zZXRfdGRsc3NlY29mZmNoYW5uZWxvZmZzZXQocEhkZEN0eCwgc2V0X3ZhbHVlKTsKKyAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBXRV9TRVRfVERMU19PRkZfQ0hBTl9NT0RFOgorICAgICAgICB7CisgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczogVGRscyBvZmZjaGFubmVsIG1vZGUgJWQiLAorICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHNldF92YWx1ZSk7CisgICAgICAgICAgIHJldCA9IGl3X3NldF90ZGxzb2ZmY2hhbm5lbG1vZGUocEFkYXB0ZXIsIHNldF92YWx1ZSk7CisgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgY2FzZSBXRV9TRVRfU0NBTl9CQU5EX1BSRUZFUkVOQ0U6CisgICAgICAgIHsKKyAgICAgICAgICAgIHRTbWVDb25maWdQYXJhbXMgc21lQ29uZmlnOworICAgICAgICAgICAgbWVtc2V0KCZzbWVDb25maWcsIDB4MDAsIHNpemVvZihzbWVDb25maWcpKTsKKyAgICAgICAgICAgIGlmKHBBZGFwdGVyLT5kZXZpY2VfbW9kZSAhPSBXTEFOX0hERF9JTkZSQV9TVEFUSU9OKSB7CisgICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGhkZExvZyhMT0cxLCAiV0VfU0VUX0JBTkRfUFJFRkVSUkVOQ0UgdmFsICVkICIsIHNldF92YWx1ZSk7CisKKyAgICAgICAgICAgIGlmIChlQ1NSX0JBTkRfQUxMID09IHNldF92YWx1ZSB8fAorICAgICAgICAgICAgICAgICAgICBlQ1NSX0JBTkRfMjQgPT0gc2V0X3ZhbHVlIHx8IGVDU1JfQkFORF81RyA9PSBzZXRfdmFsdWUpIHsKKyAgICAgICAgICAgICAgICBzbWVfR2V0Q29uZmlnUGFyYW0oaEhhbCwgJnNtZUNvbmZpZyk7CisgICAgICAgICAgICAgICAgc21lQ29uZmlnLmNzckNvbmZpZy5zY2FuQmFuZFByZWZlcmVuY2UgPSBzZXRfdmFsdWU7CisKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgInNldCBiYW5kIHNjYW4gcHJlZmVyZW5jZSA9ICVkXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgc21lQ29uZmlnLmNzckNvbmZpZy5zY2FuQmFuZFByZWZlcmVuY2UpOworCisgICAgICAgICAgICAgICAgc21lX1VwZGF0ZUNvbmZpZyhoSGFsLCAmc21lQ29uZmlnKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICAvKiBUaGUgV0VfU0VUX01JUkFDQVNUX1ZFTkRPUl9DT05GSUcgSU9DVEwgc2hvdWxkIGJlIHNldCBiZWZvcmUgdGhlCisgICAgICAgICAqIGNvbm5lY3Rpb24gaGFwcGVucyBzbyB0aGF0IHRoZSBwYXJhbXMgY2FuIHRha2UgZWZmZWN0IGR1cmluZworICAgICAgICAgKiBhc3NvY2lhdGlvbi4gQWxzbyB0aGlzIHNob3VsZCBub3QgYmUgdXNlZCBpbiBTVEErcDJwIGNvbmN1cnJlbmN5CisgICAgICAgICAqIGFzIHRoZSBwYXJhbSB3aWxsIGFsc28gZWZmZWN0IHRoZSBTVEEgbW9kZS4KKyAgICAgICAgICovCisgICAgICAgIGNhc2UgV0VfU0VUX01JUkFDQVNUX1ZFTkRPUl9DT05GSUc6CisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKworICAgICAgICAgICAgaGRkTG9nKExPRzEsIEZMKAorICAgICAgICAgICAgICJTZXQgTWlyYWNhc3QgdmVuZG9yIHR1bmluZyAlZCIpLCBzZXRfdmFsdWUpOworCisgICAgICAgICAgICBpZiAoMSA9PSBzZXRfdmFsdWUgfHwgMCA9PSBzZXRfdmFsdWUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gc21lX1NldE1pcmFjYXN0VmVuZG9yQ29uZmlnKHBIZGRDdHgtPmhIYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+Y2ZnX2luaS0+bnVtQnVmZkFkdmVydCwgc2V0X3ZhbHVlKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyggTE9HRSwgRkwoInNldCB2ZW5kb3IgbWlyYWNhc3QgY29uZmlnIGZhaWxlZCIpKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0ID0gLUVJTzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsCisgICAgICAgICAgICAgICAgIEZMKCJJbnZhbGlkIHZhbHVlICVkIGluIFdFX1NFVF9NSVJBQ0FTVF9WRU5ET1JfQ09ORklHIElPQ1RMIiksIHNldF92YWx1ZSk7CisgICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBXRV9HRVRfRlJBTUVfTE9HOgorICAgICAgICB7CisgICAgICAgICAgICBpZiAod2xhbl9oZGRfZ2V0X2ZyYW1lX2xvZ3MocEFkYXB0ZXIsIHNldF92YWx1ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmV0ID0gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBXRV9TRVRfVERMU18yMDQwX0JTU19DT0VYSVNURU5DRToKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IFRETFNfMjA0MF9CU1NfQ09FWElTVEVOQ0UgJWQiLCBfX2Z1bmNfXywgc2V0X3ZhbHVlKTsKKyAgICAgICAgICAgIGlmIChzZXRfdmFsdWUgPT0gMCB8fCBzZXRfdmFsdWUgPT0gMSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzbWVfU2V0VGRsczIwNDBCU1NDb2V4aXN0ZW5jZShXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0X3ZhbHVlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICAvKiBCaXQgbWFzayB2YWx1ZSB0byBlbmFibGUgUlRTL0NUUyBmb3IgZGlmZmVyZW50IG1vZGVzCisgICAgICAgICAqIGZvciAyLjQgR0h6LCBIVDIwIC0gMHgwMDAxLCBmb3IgMi40IEdIeiwgSFQ0MCAtIDB4MDAwMgorICAgICAgICAgKiBmb3IgMi40IEdIeiwgVkhUMjAgLSAweDAwMDQsIGZvciAyLjQgR0h6LCBWSFQ0MCAtIDB4MDAwOAorICAgICAgICAgKiBmb3IgNSBHSHosIEhUMjAgLSAweDAxMDAsIGZvciA1IEdIeiwgSFQ0MCAtIDB4MDIwMAorICAgICAgICAgKiBmb3IgNSBHSHosIFZIVDIwIC0gMHgwNDAwLCBmb3IgNSBHSHosIFZIVDQwIC0gMHgwODAwCisgICAgICAgICAqIGZvciA1IEdIeiwgVkhUODAgLSAweDEwMDAKKyAgICAgICAgICovCisgICAgICAgIGNhc2UgV0VfU0VUX1JUU19DVFNfSFRWSFQ6CisgICAgICAgIHsKKworICAgICAgICAgICBoZGRMb2coIExPRzEsIEZMKCJXRV9TRVRfUlRTX0NUU19IVFZIVCBzZXQgdmFsdWUgJWQiKSwgc2V0X3ZhbHVlKTsKKworICAgICAgICAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPQorICAgICAgICAgICAgICAgICAgICAgICAgc21lX1NldFJ0c0N0c0h0Vmh0KCBwSGRkQ3R4LT5oSGFsLCBzZXRfdmFsdWUpKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKCBMT0dFLCBGTCgic2V0IFdFX1NFVF9SVFNfQ1RTX0hUVkhUIGZhaWxlZCIpKTsKKyAgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICB9CisgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGNhc2UgV0VfU0VUX01PTklUT1JfU1RBVEU6CisgICAgICAgIHsKKyAgICAgICAgICAgdl9VMzJfdCBtYWdpYyA9IDA7CisgICAgICAgICAgIHN0cnVjdCBjb21wbGV0aW9uIGNtcFZhcjsKKyAgICAgICAgICAgbG9uZyB3YWl0UmV0ID0gMDsKKyAgICAgICAgICAgdFZPU19DT05fTU9ERSBtb2RlID0gaGRkX2dldF9jb25wYXJhbSgpOworCisgICAgICAgICAgIGlmKCBWT1NfTU9OSVRPUl9NT0RFICE9IG1vZGUpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCAiaW52YWxpZCBtb2RlICVkIiwgbW9kZSk7CisgICAgICAgICAgICAgICByZXQgPSAtRUlPOworICAgICAgICAgICB9CisKKyAgICAgICAgICAgcE1vbkN0eCA9ICBXTEFOX0hERF9HRVRfTU9OSVRPUl9DVFhfUFRSKHBBZGFwdGVyKTsKKyAgICAgICAgICAgaWYoIHBNb25DdHggPT0gTlVMTCApCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIk1vbml0b3IgQ29udGV4dCBOVUxMIik7CisgICAgICAgICAgICAgcmV0ID0gLUVJTzsKKyAgICAgICAgICAgfQorICAgICAgICAgICBpZiAocE1vbkN0eC0+c3RhdGUgPT0gc2V0X3ZhbHVlKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJhbHJlYWR5IGluIHNhbWUgbW9kZSBjdXJyX21vZGU6JWQgcmVxX21vZGU6ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNb25DdHgtPnN0YXRlLCBzZXRfdmFsdWUpOworICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgcE1vbkN0eC0+c3RhdGUgPSBzZXRfdmFsdWU7CisgICAgICAgICAgIG1hZ2ljID0gTU9OX01PREVfTVNHX01BR0lDOworICAgICAgICAgICBpbml0X2NvbXBsZXRpb24oJmNtcFZhcik7CisgICAgICAgICAgIGlmIChWT1NfU1RBVFVTX1NVQ0NFU1MgIT0KKyAgICAgICAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF9tb25fcG9zdE1zZygmbWFnaWMsICZjbXBWYXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNb25DdHgsIGhkZF9tb25Qb3N0TXNnQ2IpKSB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJmYWlsZWQgdG8gcG9zdCBNT04gTU9ERSBSRVEiKSk7CisgICAgICAgICAgICAgICAgcE1vbkN0eC0+c3RhdGUgPSAocE1vbkN0eC0+c3RhdGU9PU1PTl9NT0RFX1NUQVJUKT8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTU9OX01PREVfU1RPUCA6IE1PTl9NT0RFX1NUQVJUOworICAgICAgICAgICAgICAgIG1hZ2ljID0gMDsKKyAgICAgICAgICAgICAgICByZXQgPSAtRUlPOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICB9CisgICAgICAgICAgIHdhaXRSZXQgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX3RpbWVvdXQoJmNtcFZhciwgTU9OX01PREVfTVNHX1RJTUVPVVQpOworICAgICAgICAgICBtYWdpYyA9IDA7CisgICAgICAgICAgIGlmICh3YWl0UmV0IDw9IDAgKXsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICBGTCgiZmFpbGVkIHRvIHdhaXQgb24gbW9uaXRvciBtb2RlIGNvbXBsZXRpb24gJWxkIiksCisgICAgICAgICAgICAgICAgICAgICAgICB3YWl0UmV0KTsKKyAgICAgICAgICAgfQorICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBjYXNlIFdFX1NFVF9QUk9YSU1JVFlfRU5BQkxFOgorICAgICAgICB7CisgICAgICAgICAgICBzSHdDYWxWYWx1ZXMgaHdDYWxWYWx1ZXM7CisgICAgICAgICAgICB1aW50MTYgaHdDYWxUeFBvd2VyOworICAgICAgICAgICAgdWludDggdHhQd3IgPSBUWF9QV1JfREVGOworCisgICAgICAgICAgICBoZGRMb2coTE9HMSwgRkwoIldFX1NFVF9QUk9YSU1JVFlfRU5BQkxFOiAlZCIpLCBzZXRfdmFsdWUpOworCisgICAgICAgICAgICBpZiAoVFJVRSA9PSBzZXRfdmFsdWUpIHsKKyAgICAgICAgICAgICAgICBpZih2b3NfbnZfcmVhZCggVk5WX0hXX0NBTF9WQUxVRVMsICZod0NhbFZhbHVlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwgc2l6ZW9mKHNId0NhbFZhbHVlcykgKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gVk9TX1NUQVRVU19TVUNDRVNTKSB7CisgICAgICAgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBod0NhbFR4UG93ZXIgPSAodWludDE2KShod0NhbFZhbHVlcy5jYWxEYXRhLmh3UGFyYW03ID4+IDE2KTsKKworICAgICAgICAgICAgICAgIGhkZExvZyhMT0cxLCBGTCgiaHdDYWxUeFBvd2VyOiV4IG52X2RhdGE6JXgiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGh3Q2FsVHhQb3dlciwgaHdDYWxWYWx1ZXMuY2FsRGF0YS5od1BhcmFtNyk7CisKKyAgICAgICAgICAgICAgICB0eFB3ciA9IChpbnQ4KShod0NhbFR4UG93ZXIgJiAweDAwRkYpOworICAgICAgICAgICAgICAgIHR4UHdyID0gdHhQd3IvMTA7CisgICAgICAgICAgICAgICAgaWYgKHR4UHdyIDwgVFhfUFdSX01JTikKKyAgICAgICAgICAgICAgICAgICAgdHhQd3IgPSBUWF9QV1JfTUlOOworICAgICAgICAgICAgICAgIGlmICh0eFB3ciA+IFRYX1BXUl9NQVgpCisgICAgICAgICAgICAgICAgICAgIHR4UHdyID0gVFhfUFdSX01BWDsKKworICAgICAgICAgICAgICAgIGlmIChzbWVfU2V0TWF4VHhQb3dlclBlckJhbmQoZUNTUl9CQU5EXzI0LCB0eFB3cikgIT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlSEFMX1NUQVRVU19TVUNDRVNTKSB7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgRkwoIlNldHRpbmcgdHggcG93ZXIgZmFpbGVkIGZvciAyLjRHSHogYmFuZCAlZCIpLCB0eFB3cik7CisgICAgICAgICAgICAgICAgICAgIHJldCA9IC1FSU87CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgdHhQd3IgPSAoaW50OCkoKGh3Q2FsVHhQb3dlciA+PiA4KSAmIDB4MDBGRik7CisgICAgICAgICAgICAgICAgdHhQd3IgLz0gMTA7CisgICAgICAgICAgICAgICAgaWYgKHR4UHdyIDwgVFhfUFdSX01JTikKKyAgICAgICAgICAgICAgICAgICAgdHhQd3IgPSBUWF9QV1JfTUlOOworICAgICAgICAgICAgICAgIGlmICh0eFB3ciA+IFRYX1BXUl9NQVgpCisgICAgICAgICAgICAgICAgICAgIHR4UHdyID0gVFhfUFdSX01BWDsKKworICAgICAgICAgICAgICAgIGlmIChzbWVfU2V0TWF4VHhQb3dlclBlckJhbmQoZUNTUl9CQU5EXzVHLCB0eFB3cikgIT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlSEFMX1NUQVRVU19TVUNDRVNTKSB7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgRkwoInNldHRpbmcgdHggcG93ZXIgZmFpbGVkIGZvciA1R0h6IGJhbmQgJWQiKSwgdHhQd3IpOworICAgICAgICAgICAgICAgICAgICByZXQgPSAtRUlPOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYoRkFMU0UgPT0gc2V0X3ZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYgKHNtZV9TZXRNYXhUeFBvd2VyUGVyQmFuZChlQ1NSX0JBTkRfMjQsIHR4UHdyKSAhPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVIQUxfU1RBVFVTX1NVQ0NFU1MpIHsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICBGTCgiU2V0dGluZyB0eCBwb3dlciBmYWlsZWQgZm9yIDIuNEdIeiBiYW5kICVkIiksIHR4UHdyKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0ID0gLUVJTzsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoc21lX1NldE1heFR4UG93ZXJQZXJCYW5kKGVDU1JfQkFORF81RywgdHhQd3IpICE9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUhBTF9TVEFUVVNfU1VDQ0VTUykgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgIEZMKCJzZXR0aW5nIHR4IHBvd2VyIGZhaWxlZCBmb3IgNUdIeiBiYW5kICVkIiksIHR4UHdyKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0ID0gLUVJTzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKExPR0UsICJJbnZhbGlkIElPQ1RMIHNldHZhbHVlIGNvbW1hbmQgJWQgdmFsdWUgJWQiLAorICAgICAgICAgICAgICAgIHN1Yl9jbWQsIHNldF92YWx1ZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgICBFWElUKCk7CisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBpd19zZXRpbnRfZ2V0bm9uZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X3NldGludF9nZXRub25lKGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiAwOworfQorLyogc2V0IHBhcmFtIHN1Yi1pb2N0bHMgKi8KK3N0YXRpYyBpbnQgX19pd19zZXRjaGFyX2dldG5vbmUoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgVk9TX1NUQVRVUyB2c3RhdHVzOworICAgIGludCBzdWJfY21kOworICAgIGludCByZXQgPSAwOyAvKiBzdWNjZXNzICovCisgICAgY2hhciAqcEJ1ZmZlciA9IE5VTEw7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXI7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfVk9XSUZJCisgICAgaGRkX2NvbmZpZ190ICAqcENvbmZpZzsKKyNlbmRpZiAvKiBXTEFOX0ZFQVRVUkVfVk9XSUZJICovCisgICAgc3RydWN0IGl3X3BvaW50IHNfcHJpdl9kYXRhOworICAgIHRTaXJwa3Q4MDIxMSAqcGt0OworCisgICAgRU5URVIoKTsKKworICAgIGlmICghY2FwYWJsZShDQVBfTkVUX0FETUlOKSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgRkwoInBlcm1pc3Npb24gY2hlY2sgZmFpbGVkIikpOworICAgICAgICByZXR1cm4gLUVQRVJNOworICAgIH0KKworICAgIHBBZGFwdGVyID0gKG5ldGRldl9wcml2KGRldikpOworICAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgcmV0ID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSByZXQpCisgICAgeworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfVk9XSUZJCisgICAgcENvbmZpZyA9IHBIZGRDdHgtPmNmZ19pbmk7CisjZW5kaWYKKyAgICAvKiBoZWxwZXIgZnVuY3Rpb24gdG8gZ2V0IGl3cmVxX2RhdGEgd2l0aCBjb21wYXQgaGFuZGxpbmcuICovCisgICAgaWYgKGhkZF9wcml2X2dldF9kYXRhKCZzX3ByaXZfZGF0YSwgd3JxdSkpCisgICAgeworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIC8qIG1ha2Ugc3VyZSBhbGwgcGFyYW1zIGFyZSBjb3JyZWN0bHkgcGFzc2VkIHRvIGZ1bmN0aW9uICovCisgICAgaWYgKChOVUxMID09IHNfcHJpdl9kYXRhLnBvaW50ZXIpIHx8ICgwID09IHNfcHJpdl9kYXRhLmxlbmd0aCkpCisgICAgeworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIHN1Yl9jbWQgPSBzX3ByaXZfZGF0YS5mbGFnczsKKworICAgIC8qIE9ERCBudW1iZXIgaXMgdXNlZCBmb3Igc2V0LCBjb3B5IGRhdGEgdXNpbmcgY29weV9mcm9tX3VzZXIgKi8KKyAgICBwQnVmZmVyID0gbWVtX2FsbG9jX2NvcHlfZnJvbV91c2VyX2hlbHBlcihzX3ByaXZfZGF0YS5wb2ludGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzX3ByaXZfZGF0YS5sZW5ndGgpOworICAgIGlmIChOVUxMID09IHBCdWZmZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICJtZW1fYWxsb2NfY29weV9mcm9tX3VzZXJfaGVscGVyIGZhaWwiKTsKKyAgICAgICAgcmV0dXJuIC1FTk9NRU07CisgICAgfQorCisgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgIiVzOiBSZWNlaXZlZCBsZW5ndGggJWQiLCBfX2Z1bmNfXywgc19wcml2X2RhdGEubGVuZ3RoKTsKKyAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAiJXM6IFJlY2VpdmVkIGRhdGEgJXMiLCBfX2Z1bmNfXywgcEJ1ZmZlcik7CisKKyAgICBzd2l0Y2goc3ViX2NtZCkKKyAgICB7CisgICAgICAgY2FzZSBXRV9XT1dMX0FERF9QVFJOOgorICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sICJBRERfUFRSTiIpOworICAgICAgICAgIGhkZF9hZGRfd293bF9wdHJuKHBBZGFwdGVyLCBwQnVmZmVyKTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICBjYXNlIFdFX1dPV0xfREVMX1BUUk46CisgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIkRFTF9QVFJOIik7CisgICAgICAgICAgaGRkX2RlbF93b3dsX3B0cm4ocEFkYXB0ZXIsIHBCdWZmZXIpOworICAgICAgICAgIGJyZWFrOworI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX1ZPV0lGSQorICAgICAgIGNhc2UgV0VfTkVJR0hCT1JfUkVQT1JUX1JFUVVFU1Q6CisgICAgICAgICAgeworICAgICAgICAgICAgIHRScm1OZWlnaGJvclJlcSBuZWlnaGJvclJlcTsKKyAgICAgICAgICAgICB0UnJtTmVpZ2hib3JSc3BDYWxsYmFja0luZm8gY2FsbGJhY2tJbmZvOworCisgICAgICAgICAgICAgaWYgKHBDb25maWctPmZScm1FbmFibGUpCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sICJOZWlnaGJvciBSZXF1ZXN0Iik7CisgICAgICAgICAgICAgICAgbmVpZ2hib3JSZXEubm9fc3NpZCA9IChzX3ByaXZfZGF0YS5sZW5ndGggLSAxKSA/IGZhbHNlIDogdHJ1ZSA7CisgICAgICAgICAgICAgICAgaWYoICFuZWlnaGJvclJlcS5ub19zc2lkICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgbmVpZ2hib3JSZXEuc3NpZC5sZW5ndGggPSAoc19wcml2X2RhdGEubGVuZ3RoIC0gMSkgPiAzMiA/IDMyIDogKHNfcHJpdl9kYXRhLmxlbmd0aCAtIDEpIDsKKyAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoIG5laWdoYm9yUmVxLnNzaWQuc3NJZCwgcEJ1ZmZlciwgbmVpZ2hib3JSZXEuc3NpZC5sZW5ndGggKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBjYWxsYmFja0luZm8ubmVpZ2hib3JSc3BDYWxsYmFjayA9IE5VTEw7CisgICAgICAgICAgICAgICAgY2FsbGJhY2tJbmZvLm5laWdoYm9yUnNwQ2FsbGJhY2tDb250ZXh0ID0gTlVMTDsKKyAgICAgICAgICAgICAgICBjYWxsYmFja0luZm8udGltZW91dCA9IDUwMDA7ICAgLy81IHNlY29uZHMKKyAgICAgICAgICAgICAgICBzbWVfTmVpZ2hib3JSZXBvcnRSZXF1ZXN0KCAgV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLCBwQWRhcHRlci0+c2Vzc2lvbklkLCAmbmVpZ2hib3JSZXEsICZjYWxsYmFja0luZm8gKTsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIiVzOiBJZ25vcmluZyBuZWlnaGJvciByZXF1ZXN0IGFzIFJSTSBpcyBub3QgZW5hYmxlZCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgICAgYnJlYWs7CisjZW5kaWYKKyAgICAgICBjYXNlIFdFX1NFVF9BUF9XUFNfSUU6CisgICAgICAgICAgaGRkTG9nKCBMT0dFLCAiUmVjZWl2ZWQgV0VfU0VUX0FQX1dQU19JRSIgKTsKKyAgICAgICAgICBzbWVfdXBkYXRlUDJwSWUoIFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwgcEJ1ZmZlciwgc19wcml2X2RhdGEubGVuZ3RoICk7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgY2FzZSBXRV9TRVRfQ09ORklHOgorICAgICAgICAgIHZzdGF0dXMgPSBoZGRfZXhlY3V0ZV9jb25maWdfY29tbWFuZChwSGRkQ3R4LCBwQnVmZmVyKTsKKyAgICAgICAgICBpZiAoVk9TX1NUQVRVU19TVUNDRVNTICE9IHZzdGF0dXMpCisgICAgICAgICAgeworICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgfQorICAgICAgICAgIGJyZWFrOworICAgICAgIGNhc2UgV0VfU0VUX0VOQ1JZUFRfTVNHOgorICAgICAgICAgIHBrdCA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0U2lycGt0ODAyMTEpKTsKKyAgICAgICAgICBpZiAoTlVMTCA9PSBwa3QpCisgICAgICAgICAgeworICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICIlczogdm9zX21lbV9hbGxvYyBmYWlsZWQiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgIHJldCA9IC1FTk9NRU07CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIH0KKworICAgICAgICAgIG1lbXNldChwa3QsIDAsIHNpemVvZih0U2lycGt0ODAyMTEpKTsKKworICAgICAgICAgIGlmIChGQUxTRSA9PSBzbWVfSXNGZWF0dXJlU3VwcG9ydGVkQnlGVyhESVNBKSkgeworICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgIEZMKCJGaXJtd2FyZSBpcyBub3QgRElTQSBjYXBhYmxlIikpOworICAgICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocGt0KTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgfQorCisgICAgICAgICAgcGFyc2VfQnVmZmVyZm9ycGt0KHBrdCwgcEJ1ZmZlciwgd3JxdS0+ZGF0YS5sZW5ndGgpOworCisgICAgICAgICAgcmV0ID0gc21lX0VuY3J5cHRtc2dzZW5kKHBIZGRDdHgtPmhIYWwsICh1OCAqKXBrdCwKKyAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lycGt0ODAyMTEpLCBoZGRfZW5jcnlwdF9tc2dfY2IpOworICAgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHJldCkgeworICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgIEZMKCJTRU5ERW5jcnlwdE1TRzogZmFpbCB0byBwb3N0IFdEQSBjbWQiKSk7CisgICAgICAgICAgICAgIHJldCA9IC1FSU5WQUw7CisgICAgICAgICAgfQorICAgICAgICAgIHZvc19tZW1fZnJlZShwa3QpOworCisgICAgICAgICAgYnJlYWs7CisKKyAgICAgICBkZWZhdWx0OgorICAgICAgIHsKKyAgICAgICAgICAgaGRkTG9nKExPR0UsICIlczogSW52YWxpZCBzdWIgY29tbWFuZCAlZCIsX19mdW5jX18sIHN1Yl9jbWQpOworICAgICAgICAgICByZXQgPSAtRUlOVkFMOworICAgICAgICAgICBicmVhazsKKyAgICAgICB9CisgICAgfQorICAgIGtmcmVlKHBCdWZmZXIpOworCisgICAgRVhJVCgpOworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQgaXdfc2V0Y2hhcl9nZXRub25lKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaW50IHJldDsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX19pd19zZXRjaGFyX2dldG5vbmUoZGV2LCBpbmZvLCB3cnF1LCBleHRyYSk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworLyogZ2V0IHBhcmFtIHN1Yi1pb2N0bHMgKi8KK3N0YXRpYyBpbnQgX19pd19zZXRub25lX2dldGludChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXI7CisgICAgdEhhbEhhbmRsZSBoSGFsOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgaW50ICp2YWx1ZSA9IChpbnQgKilleHRyYTsKKyAgICBpbnQgcmV0ID0gMDsgLyogc3VjY2VzcyAqLworICAgIHRTbWVDb25maWdQYXJhbXMgc21lQ29uZmlnOworCisgICAgRU5URVIoKTsKKworICAgIHBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogQWRhcHRlciBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgcmV0ID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSByZXQpCisgICAgeworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKyAgICBoSGFsID0gV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpOworICAgIGlmIChOVUxMID09IGhIYWwpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogSGFsIENvbnRleHQgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBzd2l0Y2ggKHZhbHVlWzBdKQorICAgIHsKKyAgICAgICAgY2FzZSBXRV9HRVRfMTFEX1NUQVRFOgorICAgICAgICB7CisgICAgICAgICAgIHRTbWVDb25maWdQYXJhbXMgc21lQ29uZmlnOworICAgICAgICAgICBzbWVfR2V0Q29uZmlnUGFyYW0oaEhhbCwmc21lQ29uZmlnKTsKKworICAgICAgICAgICAqdmFsdWUgPSBzbWVDb25maWcuY3NyQ29uZmlnLklzMTFkU3VwcG9ydEVuYWJsZWQ7CisKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sICgiMTFEIHN0YXRlPSVkISEiKSwqdmFsdWUpOworCisgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBXRV9JQlNTX1NUQVRVUzoKKyAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIioqKipSZXR1cm4gSUJTUyBTdGF0dXMqKioqKiIpOworICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFdFX1BNQ19TVEFURToKKyAgICAgICAgeworICAgICAgICAgICAgICp2YWx1ZSA9IHBtY0dldFBtY1N0YXRlKGhIYWwpOworICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sICgiUE1DIHN0YXRlPSVkISEiKSwqdmFsdWUpOworICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGNhc2UgV0VfR0VUX1dMQU5fREJHOgorICAgICAgICB7CisgICAgICAgICAgIHZvc190cmFjZV9kaXNwbGF5KCk7CisgICAgICAgICAgICp2YWx1ZSA9IDA7CisgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGNhc2UgV0VfR0VUX01BWF9BU1NPQzoKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKGNjbUNmZ0dldEludChoSGFsLCBXTklfQ0ZHX0FTU09DX1NUQV9MSU1JVCwgKHRBTklfVTMyICopdmFsdWUpICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgICAgICAgICBGTCgiZmFpbGVkIHRvIGdldCBpbmkgcGFyYW1ldGVyLCBXTklfQ0ZHX0FTU09DX1NUQV9MSU1JVCIpKTsKKyAgICAgICAgICAgICAgICByZXQgPSAtRUlPOworICAgICAgICAgICAgfQorI2lmZGVmIFdMQU5fU09GVEFQX1ZTVEFfRkVBVFVSRQorICAgICAgICAgICAgaWYgKHBIZGRDdHgtPmNmZ19pbmktPmZFbmFibGVWU1RBU3VwcG9ydCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoKnZhbHVlID4gVlNUQV9OVU1fQVNTT0NfU1RBKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgKnZhbHVlID0gVlNUQV9OVU1fQVNTT0NfU1RBOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoKHBIZGRDdHgtPmhkZEFkYXB0ZXJzLmNvdW50ID4gVlNUQV9OVU1fUkVTVl9TRUxGU1RBKSAmJgorICAgICAgICAgICAgICAgICAgICAoKnZhbHVlID4gKFZTVEFfTlVNX0FTU09DX1NUQSAtCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwSGRkQ3R4LT5oZGRBZGFwdGVycy5jb3VudCAtIFZTVEFfTlVNX1JFU1ZfU0VMRlNUQSkpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICp2YWx1ZSA9IChWU1RBX05VTV9BU1NPQ19TVEEgLQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocEhkZEN0eC0+aGRkQWRhcHRlcnMuY291bnQgLSBWU1RBX05VTV9SRVNWX1NFTEZTVEEpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisjZW5kaWYKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoKnZhbHVlID4gTlVNX0FTU09DX1NUQSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICp2YWx1ZSA9IE5VTV9BU1NPQ19TVEE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICgocEhkZEN0eC0+aGRkQWRhcHRlcnMuY291bnQgPiBOVU1fUkVTVl9TRUxGU1RBKSAmJgorICAgICAgICAgICAgICAgICAgICAoKnZhbHVlID4gKE5VTV9BU1NPQ19TVEEgLQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBIZGRDdHgtPmhkZEFkYXB0ZXJzLmNvdW50IC0gTlVNX1JFU1ZfU0VMRlNUQSkpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICp2YWx1ZSA9IChOVU1fQVNTT0NfU1RBIC0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBIZGRDdHgtPmhkZEFkYXB0ZXJzLmNvdW50IC0gTlVNX1JFU1ZfU0VMRlNUQSkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBXRV9HRVRfV0RJX0RCRzoKKyAgICAgICAgeworICAgICAgICAgICB3cGFsVHJhY2VEaXNwbGF5KCk7CisgICAgICAgICAgICp2YWx1ZSA9IDA7CisgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBXRV9HRVRfU0FQX0FVVE9fQ0hBTk5FTF9TRUxFQ1RJT046CisgICAgICAgIHsKKyAgICAgICAgICAgICp2YWx1ZSA9IChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPmNmZ19pbmktPmFwQXV0b0NoYW5uZWxTZWxlY3Rpb247CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBjYXNlIFdFX0dFVF9DT05DVVJSRU5DWV9NT0RFOgorICAgICAgICB7CisgICAgICAgICAgICp2YWx1ZSA9IGhkZF9nZXRfY29uY3VycmVuY3lfbW9kZSAoICk7CisKKyAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgKCJjb25jdXJyZW5jeSBtb2RlPSVkIiksKnZhbHVlKTsKKyAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIFdFX0dFVF9TQ0FOX0JBTkRfUFJFRkVSRU5DRToKKyAgICAgICAgeworICAgICAgICAgICAgc21lX0dldENvbmZpZ1BhcmFtKGhIYWwsICZzbWVDb25maWcpOworICAgICAgICAgICAgKnZhbHVlID0gc21lQ29uZmlnLmNzckNvbmZpZy5zY2FuQmFuZFByZWZlcmVuY2U7CisKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgInNjYW5CYW5kUHJlZmVyZW5jZSA9ICVkXG4iLCAqdmFsdWUpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBkZWZhdWx0OgorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coTE9HRSwgIkludmFsaWQgSU9DVEwgZ2V0X3ZhbHVlIGNvbW1hbmQgJWQgIix2YWx1ZVswXSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgICBFWElUKCk7CisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBpd19zZXRub25lX2dldGludChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X3NldG5vbmVfZ2V0aW50KGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7CisKK30KKy8qIHNldCBwYXJhbSBzdWItaW9jdGxzICovCitpbnQgX19pd19zZXRfdGhyZWVfaW50c19nZXRub25lKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgaW50ICp2YWx1ZSA9IChpbnQgKilleHRyYTsKKyAgICBpbnQgc3ViX2NtZCA9IHZhbHVlWzBdOworICAgIGludCByZXQgPSAwOworCisgICAgRU5URVIoKTsKKworICAgIGlmICghY2FwYWJsZShDQVBfTkVUX0FETUlOKSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgRkwoInBlcm1pc3Npb24gY2hlY2sgZmFpbGVkIikpOworICAgICAgICByZXR1cm4gLUVQRVJNOworICAgIH0KKworICAgIHBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogQWRhcHRlciBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgcmV0ID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSByZXQpCisgICAgeworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKyAgICBzd2l0Y2goc3ViX2NtZCkKKyAgICB7CisgICAgICAgIGNhc2UgV0VfU0VUX1dMQU5fREJHOgorICAgICAgICB7CisgICAgICAgICAgICB2b3NfdHJhY2Vfc2V0VmFsdWUoIHZhbHVlWzFdLCB2YWx1ZVsyXSwgdmFsdWVbM10pOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBXRV9TRVRfV0RJX0RCRzoKKyAgICAgICAgeworICAgICAgICAgICAgd3BhbFRyYWNlU2V0TGV2ZWwoIHZhbHVlWzFdLCB2YWx1ZVsyXSwgdmFsdWVbM10pOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBXRV9TRVRfU0FQX0NIQU5ORUxTOgorICAgICAgICB7CisgICAgICAgICAgICByZXQgPSBpd19zb2Z0YXBfc2V0X2NoYW5uZWxfcmFuZ2UoIGRldiwgdmFsdWVbMV0sIHZhbHVlWzJdLCB2YWx1ZVszXSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyhMT0dFLCAiJXM6IEludmFsaWQgSU9DVEwgY29tbWFuZCAlZCIsIF9fZnVuY19fLCBzdWJfY21kICk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgICBFWElUKCk7CisgICAgcmV0dXJuIHJldDsKK30KKworaW50IGl3X3NldF90aHJlZV9pbnRzX2dldG5vbmUoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X3NldF90aHJlZV9pbnRzX2dldG5vbmUoZGV2LCBpbmZvLCB3cnF1LCBleHRyYSk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBfX2l3X2dldF9jaGFyX3NldG5vbmUoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcjsKKyAgICBpbnQgc3ViX2NtZCA9IHdycXUtPmRhdGEuZmxhZ3M7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgICBpbnQgcmV0ID0gMDsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisgICAgaGRkX3dleHRfc3RhdGVfdCAqcFdleHRTdGF0ZTsKKyNlbmRpZgorCisgICAgRU5URVIoKTsKKyAgICBwQWRhcHRlciA9IFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgIGlmIChwQWRhcHRlciA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICIlczogcEFkYXB0ZXIgaXMgTlVMTCEiLCBfX2Z1bmNfXyk7CisgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIHJldCA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gcmV0KQorICAgIHsKKyAgICAgICAgcmV0dXJuIHJldDsKKyAgICB9CisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgIHBXZXh0U3RhdGUgPSBXTEFOX0hERF9HRVRfV0VYVF9TVEFURV9QVFIocEFkYXB0ZXIpOworICAgIGlmIChOVUxMID09IHBXZXh0U3RhdGUpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogcFdleHRTdGF0ZSBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyNlbmRpZgorCisgICAgc3dpdGNoKHN1Yl9jbWQpCisgICAgeworICAgICAgICBjYXNlIFdFX1dMQU5fVkVSU0lPTjoKKyAgICAgICAgeworICAgICAgICAgICAgaGRkX3dsYW5fZ2V0X3ZlcnNpb24ocEFkYXB0ZXIsIHdycXUsIGV4dHJhKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBXRV9HRVRfU1RBVFM6CisgICAgICAgIHsKKyAgICAgICAgICAgIHRIYWxIYW5kbGUgaEhhbCA9IE5VTEw7CisgICAgICAgICAgICB0cEFuaVNpckdsb2JhbCBwTWFjID0gTlVMTDsKKyAgICAgICAgICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICAgICAgICAgIGhkZF90eF9yeF9zdGF0c190ICpwU3RhdHMgPSAmcEFkYXB0ZXItPmhkZF9zdGF0cy5oZGRUeFJ4U3RhdHM7CisgICAgICAgICAgICBoZGRfY2hpcF9yZXNldF9zdGF0c190ICpwUmVzZXRTdGF0cyA9ICZwSGRkQ3R4LT5oZGRDaGlwUmVzZXRTdGF0czsKKworCisgICAgICAgICAgICBzbnByaW50ZihleHRyYSwgV0VfTUFYX1NUUl9MRU4sCisgICAgICAgICAgICAgICAgICAgICAiXG5UcmFuc21pdCIKKyAgICAgICAgICAgICAgICAgICAgICJcbmNhbGxlZCAldSwgZHJvcHBlZCAldSwgYmFja3ByZXNzdXJlZCAldSwgcXVldWVkICV1IgorICAgICAgICAgICAgICAgICAgICAgIlxuICAgICAgZHJvcHBlZCBCSyAldSwgQkUgJXUsIFZJICV1LCBWTyAldSIKKyAgICAgICAgICAgICAgICAgICAgICJcbiAgIGNsYXNzaWZpZWQgQksgJXUsIEJFICV1LCBWSSAldSwgVk8gJXUiCisgICAgICAgICAgICAgICAgICAgICAiXG5iYWNrcHJlc3N1cmVkIEJLICV1LCBCRSAldSwgVkkgJXUsIFZPICV1IgorICAgICAgICAgICAgICAgICAgICAgIlxuICAgICAgIHF1ZXVlZCBCSyAldSwgQkUgJXUsIFZJICV1LCBWTyAldSIKKyAgICAgICAgICAgICAgICAgICAgICJcbmZldGNoZWQgJXUsIGVtcHR5ICV1LCBsb3dyZXMgJXUsIGRlcWVyciAldSIKKyAgICAgICAgICAgICAgICAgICAgICJcbmRlcXVldWVkICV1LCBkZXByZXNzdXJlZCAldSwgZGVxdWUtZGVwcmVzc3VyZWQgJXUsIGNvbXBsZXRlZCAldSwgZmx1c2hlZCAldSIKKyAgICAgICAgICAgICAgICAgICAgICJcbiAgICAgIGZldGNoZWQgQksgJXUsIEJFICV1LCBWSSAldSwgVk8gJXUiCisgICAgICAgICAgICAgICAgICAgICAiXG4gICAgIGRlcXVldWVkIEJLICV1LCBCRSAldSwgVkkgJXUsIFZPICV1IgorICAgICAgICAgICAgICAgICAgICAgIlxuICBkZXByZXNzdXJlZCBCSyAldSwgQkUgJXUsIFZJICV1LCBWTyAldSIKKyAgICAgICAgICAgICAgICAgICAgICJcbkRlcXVlIGRlcHJlc3N1cmVkIEJLICV1LCBCRSAldSwgVkkgJXUsIFZPICV1IgorICAgICAgICAgICAgICAgICAgICAgIlxuICAgICAgZmx1c2hlZCBCSyAldSwgQkUgJXUsIFZJICV1LCBWTyAldSIKKyAgICAgICAgICAgICAgICAgICAgICJcblxuUmVjZWl2ZSIKKyAgICAgICAgICAgICAgICAgICAgICJcbmNoYWlucyAldSwgcGFja2V0cyAldSwgZHJvcHBlZCAldSwgZGVsaXZlcmVkICV1LCByZWZ1c2VkICV1IgorICAgICAgICAgICAgICAgICAgICAgIlxuXG5SZXNldHNTdGF0cyIKKyAgICAgICAgICAgICAgICAgICAgICJcbiBUb3RhbExvZ3AgJXUgQ21kNTMgJXUgTXV0ZXhSZWFkICV1ICBNSUYtRXJyb3IgJXUgRlctSGVhcnRiZWF0ICV1IE90aGVycyAldSIKKyAgICAgICAgICAgICAgICAgICAgICJcbiIsCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4WG1pdENhbGxlZCwKKyAgICAgICAgICAgICAgICAgICAgIHBTdGF0cy0+dHhYbWl0RHJvcHBlZCwKKyAgICAgICAgICAgICAgICAgICAgIHBTdGF0cy0+dHhYbWl0QmFja1ByZXNzdXJlZCwKKyAgICAgICAgICAgICAgICAgICAgIHBTdGF0cy0+dHhYbWl0UXVldWVkLAorCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4WG1pdERyb3BwZWRBQ1tXTEFOVExfQUNfQktdLAorICAgICAgICAgICAgICAgICAgICAgcFN0YXRzLT50eFhtaXREcm9wcGVkQUNbV0xBTlRMX0FDX0JFXSwKKyAgICAgICAgICAgICAgICAgICAgIHBTdGF0cy0+dHhYbWl0RHJvcHBlZEFDW1dMQU5UTF9BQ19WSV0sCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4WG1pdERyb3BwZWRBQ1tXTEFOVExfQUNfVk9dLAorCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4WG1pdENsYXNzaWZpZWRBQ1tXTEFOVExfQUNfQktdLAorICAgICAgICAgICAgICAgICAgICAgcFN0YXRzLT50eFhtaXRDbGFzc2lmaWVkQUNbV0xBTlRMX0FDX0JFXSwKKyAgICAgICAgICAgICAgICAgICAgIHBTdGF0cy0+dHhYbWl0Q2xhc3NpZmllZEFDW1dMQU5UTF9BQ19WSV0sCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4WG1pdENsYXNzaWZpZWRBQ1tXTEFOVExfQUNfVk9dLAorCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4WG1pdEJhY2tQcmVzc3VyZWRBQ1tXTEFOVExfQUNfQktdLAorICAgICAgICAgICAgICAgICAgICAgcFN0YXRzLT50eFhtaXRCYWNrUHJlc3N1cmVkQUNbV0xBTlRMX0FDX0JFXSwKKyAgICAgICAgICAgICAgICAgICAgIHBTdGF0cy0+dHhYbWl0QmFja1ByZXNzdXJlZEFDW1dMQU5UTF9BQ19WSV0sCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4WG1pdEJhY2tQcmVzc3VyZWRBQ1tXTEFOVExfQUNfVk9dLAorCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4WG1pdFF1ZXVlZEFDW1dMQU5UTF9BQ19CS10sCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4WG1pdFF1ZXVlZEFDW1dMQU5UTF9BQ19CRV0sCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4WG1pdFF1ZXVlZEFDW1dMQU5UTF9BQ19WSV0sCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4WG1pdFF1ZXVlZEFDW1dMQU5UTF9BQ19WT10sCisKKyAgICAgICAgICAgICAgICAgICAgIHBTdGF0cy0+dHhGZXRjaGVkLAorICAgICAgICAgICAgICAgICAgICAgcFN0YXRzLT50eEZldGNoRW1wdHksCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4RmV0Y2hMb3dSZXNvdXJjZXMsCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4RmV0Y2hEZXF1ZXVlRXJyb3IsCisKKyAgICAgICAgICAgICAgICAgICAgIHBTdGF0cy0+dHhGZXRjaERlcXVldWVkLAorICAgICAgICAgICAgICAgICAgICAgcFN0YXRzLT50eEZldGNoRGVQcmVzc3VyZWQsCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4RGVxdWVEZVByZXNzdXJlZCwKKyAgICAgICAgICAgICAgICAgICAgIHBTdGF0cy0+dHhDb21wbGV0ZWQsCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4Rmx1c2hlZCwKKworICAgICAgICAgICAgICAgICAgICAgcFN0YXRzLT50eEZldGNoZWRBQ1tXTEFOVExfQUNfQktdLAorICAgICAgICAgICAgICAgICAgICAgcFN0YXRzLT50eEZldGNoZWRBQ1tXTEFOVExfQUNfQkVdLAorICAgICAgICAgICAgICAgICAgICAgcFN0YXRzLT50eEZldGNoZWRBQ1tXTEFOVExfQUNfVkldLAorICAgICAgICAgICAgICAgICAgICAgcFN0YXRzLT50eEZldGNoZWRBQ1tXTEFOVExfQUNfVk9dLAorCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4RmV0Y2hEZXF1ZXVlZEFDW1dMQU5UTF9BQ19CS10sCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4RmV0Y2hEZXF1ZXVlZEFDW1dMQU5UTF9BQ19CRV0sCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4RmV0Y2hEZXF1ZXVlZEFDW1dMQU5UTF9BQ19WSV0sCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4RmV0Y2hEZXF1ZXVlZEFDW1dMQU5UTF9BQ19WT10sCisKKyAgICAgICAgICAgICAgICAgICAgIHBTdGF0cy0+dHhGZXRjaERlUHJlc3N1cmVkQUNbV0xBTlRMX0FDX0JLXSwKKyAgICAgICAgICAgICAgICAgICAgIHBTdGF0cy0+dHhGZXRjaERlUHJlc3N1cmVkQUNbV0xBTlRMX0FDX0JFXSwKKyAgICAgICAgICAgICAgICAgICAgIHBTdGF0cy0+dHhGZXRjaERlUHJlc3N1cmVkQUNbV0xBTlRMX0FDX1ZJXSwKKyAgICAgICAgICAgICAgICAgICAgIHBTdGF0cy0+dHhGZXRjaERlUHJlc3N1cmVkQUNbV0xBTlRMX0FDX1ZPXSwKKworICAgICAgICAgICAgICAgICAgICAgcFN0YXRzLT50eERlcXVlRGVQcmVzc3VyZWRBQ1tXTEFOVExfQUNfQktdLAorICAgICAgICAgICAgICAgICAgICAgcFN0YXRzLT50eERlcXVlRGVQcmVzc3VyZWRBQ1tXTEFOVExfQUNfQkVdLAorICAgICAgICAgICAgICAgICAgICAgcFN0YXRzLT50eERlcXVlRGVQcmVzc3VyZWRBQ1tXTEFOVExfQUNfVkldLAorICAgICAgICAgICAgICAgICAgICAgcFN0YXRzLT50eERlcXVlRGVQcmVzc3VyZWRBQ1tXTEFOVExfQUNfVk9dLAorCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4Rmx1c2hlZEFDW1dMQU5UTF9BQ19CS10sCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4Rmx1c2hlZEFDW1dMQU5UTF9BQ19CRV0sCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4Rmx1c2hlZEFDW1dMQU5UTF9BQ19WSV0sCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnR4Rmx1c2hlZEFDW1dMQU5UTF9BQ19WT10sCisKKyAgICAgICAgICAgICAgICAgICAgIHBTdGF0cy0+cnhDaGFpbnMsCisgICAgICAgICAgICAgICAgICAgICBwU3RhdHMtPnJ4UGFja2V0cywKKyAgICAgICAgICAgICAgICAgICAgIHBTdGF0cy0+cnhEcm9wcGVkLAorICAgICAgICAgICAgICAgICAgICAgcFN0YXRzLT5yeERlbGl2ZXJlZCwKKyAgICAgICAgICAgICAgICAgICAgIHBTdGF0cy0+cnhSZWZ1c2VkLAorCisgICAgICAgICAgICAgICAgICAgICBwUmVzZXRTdGF0cy0+dG90YWxMb2dwUmVzZXRzLAorICAgICAgICAgICAgICAgICAgICAgcFJlc2V0U3RhdHMtPnRvdGFsQ01ENTNGYWlsdXJlcywKKyAgICAgICAgICAgICAgICAgICAgIHBSZXNldFN0YXRzLT50b3RhbE11dGV4UmVhZEZhaWx1cmVzLAorICAgICAgICAgICAgICAgICAgICAgcFJlc2V0U3RhdHMtPnRvdGFsTUlGRXJyb3JGYWlsdXJlcywKKyAgICAgICAgICAgICAgICAgICAgIHBSZXNldFN0YXRzLT50b3RhbEZXSGVhcmJlYXRGYWlsdXJlcywKKyAgICAgICAgICAgICAgICAgICAgIHBSZXNldFN0YXRzLT50b3RhbFVua25vd25FeGNlcHRpb25zCisgICAgICAgICAgICAgICAgICAgICApOworICAgICAgICAgICAgd3JxdS0+ZGF0YS5sZW5ndGggPSBzdHJsZW4oZXh0cmEpOworCisgICAgICAgICAgICBoSGFsID0gV0xBTl9IRERfR0VUX0hBTF9DVFgoIHBBZGFwdGVyICk7CisKKyAgICAgICAgICAgIGlmIChoSGFsKQorICAgICAgICAgICAgICAgIHBNYWMgPSBQTUFDX1NUUlVDVCggaEhhbCApOworCisgICAgICAgICAgICBpZiAocE1hYyAmJiAod3JxdS0+ZGF0YS5sZW5ndGggPCBXRV9NQVhfU1RSX0xFTikpIHsKKyAgICAgICAgICAgICAgICBfX3UzMiBwbW1TdGF0c0xlbmd0aCA9IFdFX01BWF9TVFJfTEVOIC0gd3JxdS0+ZGF0YS5sZW5ndGg7CisgICAgICAgICAgICAgICAgc25wcmludGYoZXh0cmErd3JxdS0+ZGF0YS5sZW5ndGgsIHBtbVN0YXRzTGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgICAgIlxuIEJNUFMgc2xlZXBjbnQgJWxsZCwgQk1QUyBhd2FrZWNudCAlbGxkIgorICAgICAgICAgICAgICAgICAgICAgICAgIlxuIEJNUFMgc2xlZXByZXFmYWlsY250ICVsbGQsIEJNUFMgd2FrZXVwcmVxZmFpbGNudCAlbGxkIgorICAgICAgICAgICAgICAgICAgICAgICAgIlxuIElNUFMgc2xlZXBjbnQgJWxsZCwgSU1QUyBhd2FrZWNudCAlbGxkIgorICAgICAgICAgICAgICAgICAgICAgICAgIlxuIElNUFMgc2xlZXByZXFmYWlsY250ICVsbGQsIElNUFMgd2FrZXVwcmVxZmFpbGNudCAlbGxkLCBJTVBTIGxhc3RlcnIgJWxsZCIKKyAgICAgICAgICAgICAgICAgICAgICAgICJcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5wbW0uQm1wc2NudFNsZWVwLAorICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+cG1tLkJtcHNjbnRBd2FrZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnBtbS5CbXBzU2xlZVJlcUZhaWxDbnQsCisgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5wbW0uQm1wc1dha2V1cFJlcUZhaWxDbnQsCisgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5wbW0uSW1wc0NudFNsZWVwLAorICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+cG1tLkltcHNDbnRBd2FrZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnBtbS5JbXBzU2xlZXBFcnJDbnQsCisgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5wbW0uSW1wc1dha2V1cEVyckNudCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnBtbS5JbXBzTGFzdEVycgorICAgICAgICAgICAgICAgICAgICAgICAgKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgd3JxdS0+ZGF0YS5sZW5ndGggPSBzdHJsZW4oZXh0cmEpKzE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisvKiBUaGUgY2FzZSBwcmludHMgdGhlIGN1cnJlbnQgc3RhdGUgb2YgdGhlIEhERCwgU01FLCBDU1IsIFBFLCBUTAorICAgKml0IGNhbiBiZSBleHRlbmRlZCBmb3IgV0RJIEdsb2JhbCBTdGF0ZSBhcyB3ZWxsLgorICAgKkFuZCBjdXJyZW50bHkgaXQgb25seSBjaGVja3MgUDJQX0NMSUVOVCBhZGFwdGVyLgorICAgKlAyUF9ERVZJQ0UgYW5kIFAyUF9HTyBoYXZlIG5vdCBiZWVuIGFkZGVkIGFzIG9mIG5vdy4KKyovCisgICAgICAgIGNhc2UgV0VfR0VUX1NUQVRFUzoKKyAgICAgICAgeworICAgICAgICAgICAgaW50IGJ1ZiA9IDAsIGxlbiA9IDA7CisgICAgICAgICAgICBpbnQgYWRhcHRlcl9udW0gPSAwOworICAgICAgICAgICAgaW50IGNvdW50ID0gMCwgY2hlY2sgPSAxOworCisgICAgICAgICAgICB0QU5JX1UxNiB0bFN0YXRlOworICAgICAgICAgICAgdEhhbEhhbmRsZSBoSGFsID0gTlVMTDsKKyAgICAgICAgICAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBOVUxMOworICAgICAgICAgICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHggPSBOVUxMOworCisgICAgICAgICAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWCggcEFkYXB0ZXIgKTsKKyAgICAgICAgICAgIGhkZF9hZGFwdGVyX3QgKnVzZUFkYXB0ZXIgPSBOVUxMOworCisgICAgICAgICAgICAvKiBQcmludCB3bGFuMCBvciBwMnAwIHN0YXRlcyBiYXNlZCBvbiB0aGUgYWRhcHRlcl9udW0KKyAgICAgICAgICAgICAgKmJ5IHVzaW5nIHRoZSBjb3JyZWN0IGFkYXB0ZXIKKyAgICAgICAgICAgICovCisgICAgICAgICAgICB3aGlsZSAoIGFkYXB0ZXJfbnVtIDwgMiApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKCBXTEFOX0FEQVBURVIgPT0gYWRhcHRlcl9udW0gKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdXNlQWRhcHRlciA9IHBBZGFwdGVyOworICAgICAgICAgICAgICAgICAgICBidWYgPSBzY25wcmludGYoZXh0cmEgKyBsZW4sIFdFX01BWF9TVFJfTEVOIC0gbGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJcblxuIHdsYW4wIFN0YXRlczotIik7CisgICAgICAgICAgICAgICAgICAgIGxlbiArPSBidWY7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKCBQMlBfQURBUFRFUiA9PSBhZGFwdGVyX251bSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBidWYgPSBzY25wcmludGYoZXh0cmEgKyBsZW4sIFdFX01BWF9TVFJfTEVOIC0gbGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJcblxuIHAycDAgU3RhdGVzOi0iKTsKKyAgICAgICAgICAgICAgICAgICAgbGVuICs9IGJ1ZjsKKworICAgICAgICAgICAgICAgICAgICBpZiggIXBIZGRDdHggKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBidWYgPSBzY25wcmludGYoZXh0cmEgKyBsZW4sIFdFX01BWF9TVFJfTEVOIC0gbGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiXG4gcEhkZEN0eCBpcyBOVUxMIik7CisgICAgICAgICAgICAgICAgICAgICAgICBsZW4gKz0gYnVmOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvKlByaW50aW5nIHAycDAgc3RhdGVzIG9ubHkgaW4gdGhlIGNhc2Ugd2hlbiB0aGUgZGV2aWNlIGlzCisgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJlZCBhcyBhIHAycF9jbGllbnQqLworICAgICAgICAgICAgICAgICAgICB1c2VBZGFwdGVyID0gaGRkX2dldF9hZGFwdGVyKHBIZGRDdHgsIFdMQU5fSEREX1AyUF9DTElFTlQpOworICAgICAgICAgICAgICAgICAgICBpZiAoICF1c2VBZGFwdGVyICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgYnVmID0gc2NucHJpbnRmKGV4dHJhICsgbGVuLCBXRV9NQVhfU1RSX0xFTiAtIGxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlxuIERldmljZSBub3QgY29uZmlndXJlZCBhcyBQMlBfQ0xJRU5ULiIpOworICAgICAgICAgICAgICAgICAgICAgICAgbGVuICs9IGJ1ZjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaEhhbCA9IFdMQU5fSEREX0dFVF9IQUxfQ1RYKCB1c2VBZGFwdGVyICk7CisgICAgICAgICAgICAgICAgaWYgKCFoSGFsKSB7CisgICAgICAgICAgICAgICAgICAgIGJ1ZiA9IHNjbnByaW50ZihleHRyYSArIGxlbiwgV0VfTUFYX1NUUl9MRU4gLSBsZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiXG4gcE1hYyBpcyBOVUxMIik7CisgICAgICAgICAgICAgICAgICAgIGxlbiArPSBidWY7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwTWFjID0gUE1BQ19TVFJVQ1QoIGhIYWwgKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBNYWMpIHsKKyAgICAgICAgICAgICAgICAgICAgYnVmID0gc2NucHJpbnRmKGV4dHJhICsgbGVuLCBXRV9NQVhfU1RSX0xFTiAtIGxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJcbiBwTWFjIGlzIE5VTEwiKTsKKyAgICAgICAgICAgICAgICAgICAgbGVuICs9IGJ1ZjsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHBIZGRTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKCB1c2VBZGFwdGVyICk7CisgICAgICAgICAgICAgICAgaWYoICFwSGRkU3RhQ3R4ICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGJ1ZiA9IHNjbnByaW50ZihleHRyYSArIGxlbiwgIFdFX01BWF9TVFJfTEVOIC0gbGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJcbiBwSGRkU3RhQ3R4IGlzIE5VTEwiKTsKKyAgICAgICAgICAgICAgICAgICAgbGVuICs9IGJ1ZjsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgdGxTdGF0ZSA9IHNtZUdldFRMU1RBU3RhdGUoaEhhbCwgcEhkZFN0YUN0eC0+Y29ubl9pbmZvLnN0YUlkWzBdKTsKKworICAgICAgICAgICAgICAgIGJ1ZiA9IHNjbnByaW50ZihleHRyYSArIGxlbiwgV0VfTUFYX1NUUl9MRU4gLSBsZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAiXG4gSEREIENvbm4gU3RhdGUgLSAlcyAiCisgICAgICAgICAgICAgICAgICAgICAgICAiXG4gXG4gU01FIFN0YXRlOiIKKyAgICAgICAgICAgICAgICAgICAgICAgICJcbiBOZWlnaGJvdXIgUm9hbSBTdGF0ZSAtICVzIgorICAgICAgICAgICAgICAgICAgICAgICAgIlxuIENTUiBTdGF0ZSAtICVzIgorICAgICAgICAgICAgICAgICAgICAgICAgIlxuIENTUiBTdWJzdGF0ZSAtICVzIgorICAgICAgICAgICAgICAgICAgICAgICAgIlxuIFxuIFRMIFNUQSAlZCBTdGF0ZTogJXMiLAorICAgICAgICAgICAgICAgICAgICAgICAgbWFjVHJhY2VHZXRIRERXbGFuQ29ublN0YXRlKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkU3RhQ3R4LT5jb25uX2luZm8uY29ublN0YXRlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1hY1RyYWNlR2V0TmVpZ2hib3VyUm9hbVN0YXRlKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5yb2FtLm5laWdoYm9yUm9hbUluZm8ubmVpZ2hib3JSb2FtU3RhdGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgbWFjVHJhY2VHZXRjc3JSb2FtU3RhdGUoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0uY3VyU3RhdGVbdXNlQWRhcHRlci0+c2Vzc2lvbklkXSksCisgICAgICAgICAgICAgICAgICAgICAgICBtYWNUcmFjZUdldGNzclJvYW1TdWJTdGF0ZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+cm9hbS5jdXJTdWJTdGF0ZVt1c2VBZGFwdGVyLT5zZXNzaW9uSWRdKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBIZGRTdGFDdHgtPmNvbm5faW5mby5zdGFJZFswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1hY1RyYWNlR2V0VExTdGF0ZSh0bFN0YXRlKQorICAgICAgICAgICAgICAgICAgICAgICAgKTsKKyAgICAgICAgICAgICAgICBsZW4gKz0gYnVmOworICAgICAgICAgICAgICAgIGFkYXB0ZXJfbnVtKys7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChwTWFjKSB7CisgICAgICAgICAgICAgICAgLyogUHJpbnRpbmcgTGltIFN0YXRlIHN0YXJ0aW5nIHdpdGggZ2xvYmFsIGxpbSBzdGF0ZXMgKi8KKyAgICAgICAgICAgICAgICBidWYgPSBzY25wcmludGYoZXh0cmEgKyBsZW4sIFdFX01BWF9TVFJfTEVOIC0gbGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgIlxuIFxuIExJTSBTVEFURVM6LSIKKyAgICAgICAgICAgICAgICAgICAgICAgICJcbiBHbG9iYWwgU21lIFN0YXRlIC0gJXMgIlwKKyAgICAgICAgICAgICAgICAgICAgICAgICJcbiBHbG9iYWwgbWxtIFN0YXRlIC0gJXMgIlwKKyAgICAgICAgICAgICAgICAgICAgICAgICJcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICBtYWNUcmFjZUdldExpbVNtZVN0YXRlKHBNYWMtPmxpbS5nTGltU21lU3RhdGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgbWFjVHJhY2VHZXRMaW1NbG1TdGF0ZShwTWFjLT5saW0uZ0xpbU1sbVN0YXRlKQorICAgICAgICAgICAgICAgICAgICAgICAgKTsKKyAgICAgICAgICAgICAgICBsZW4gKz0gYnVmOworCisgICAgICAgICAgICAgICAgLypwcmludGluZyB0aGUgUEUgU21lIGFuZCBNbG0gc3RhdGVzIGZvciB2YWxpZCBsaW0gc2Vzc2lvbnMqLworICAgICAgICAgICAgICAgIHdoaWxlICggY2hlY2sgPCAzICYmIGNvdW50IDwgcE1hYy0+bGltLm1heEJzc0lkKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCBwTWFjLT5saW0uZ3BTZXNzaW9uW2NvdW50XS52YWxpZCApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZiA9IHNjbnByaW50ZihleHRyYSArIGxlbiwgV0VfTUFYX1NUUl9MRU4gLSBsZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAiXG4gTGltIFZhbGlkIFNlc3Npb24gJWQ6LSIKKyAgICAgICAgICAgICAgICAgICAgICAgICJcbiBQRSBTbWUgU3RhdGUgLSAlcyAiCisgICAgICAgICAgICAgICAgICAgICAgICAiXG4gUEUgTWxtIFN0YXRlIC0gJXMgIgorICAgICAgICAgICAgICAgICAgICAgICAgIlxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgbWFjVHJhY2VHZXRMaW1TbWVTdGF0ZShwTWFjLT5saW0uZ3BTZXNzaW9uW2NvdW50XS5saW1TbWVTdGF0ZSksCisgICAgICAgICAgICAgICAgICAgICAgICBtYWNUcmFjZUdldExpbU1sbVN0YXRlKHBNYWMtPmxpbS5ncFNlc3Npb25bY291bnRdLmxpbU1sbVN0YXRlKQorICAgICAgICAgICAgICAgICAgICAgICAgKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgbGVuICs9IGJ1ZjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrKys7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgY291bnQrKzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHdycXUtPmRhdGEubGVuZ3RoID0gc3RybGVuKGV4dHJhKSsxOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIFdFX0dFVF9DRkc6CisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZF9jZmdfZ2V0X2NvbmZpZyhXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSwgZXh0cmEsIFdFX01BWF9TVFJfTEVOKTsKKyAgICAgICAgICAgIHdycXUtPmRhdGEubGVuZ3RoID0gc3RybGVuKGV4dHJhKSsxOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgICAgICBjYXNlIFdFX0dFVF9SU1NJOgorICAgICAgICB7CisgICAgICAgICAgICB2X1M3X3QgczdSc3NpID0gMDsKKyAgICAgICAgICAgIHdsYW5faGRkX2dldF9zdGF0aW9uX3N0YXRzKHBBZGFwdGVyKTsKKyAgICAgICAgICAgIHdsYW5faGRkX2dldF9yc3NpKHBBZGFwdGVyLCAmczdSc3NpKTsKKyAgICAgICAgICAgIHNucHJpbnRmKGV4dHJhLCBXRV9NQVhfU1RSX0xFTiwgInJzc2k9JWQiLHM3UnNzaSk7CisgICAgICAgICAgICB3cnF1LT5kYXRhLmxlbmd0aCA9IHN0cmxlbihleHRyYSkrMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisjZW5kaWYKKworI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIgfHwgZGVmaW5lZCBGRUFUVVJFX1dMQU5fRVNFIHx8IGRlZmluZWQoRkVBVFVSRV9XTEFOX0xGUikKKyAgICAgICAgY2FzZSBXRV9HRVRfUk9BTV9SU1NJOgorICAgICAgICB7CisgICAgICAgICAgICB2X1M3X3QgczdSc3NpID0gMDsKKyAgICAgICAgICAgIHdsYW5faGRkX2dldF9yb2FtX3Jzc2kocEFkYXB0ZXIsICZzN1Jzc2kpOworICAgICAgICAgICAgc25wcmludGYoZXh0cmEsIFdFX01BWF9TVFJfTEVOLCAicnNzaT0lZCIsIHM3UnNzaSk7CisgICAgICAgICAgICB3cnF1LT5kYXRhLmxlbmd0aCA9IHN0cmxlbihleHRyYSkrMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgY2FzZSBXRV9HRVRfV01NX1NUQVRVUzoKKyAgICAgICAgeworICAgICAgICAgICAgc25wcmludGYoZXh0cmEsIFdFX01BWF9TVFJfTEVOLAorICAgICAgICAgICAgICAgICAgICAiXG5EaXI6IDA9dXAsIDE9ZG93biwgMz1ib3RoXG4iCisgICAgICAgICAgICAgICAgICAgICJ8LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfFxuIgorICAgICAgICAgICAgICAgICAgICAifEFDIHwgQUNNIHxBZG1pdHRlZHwgRGlyIHxcbiIKKyAgICAgICAgICAgICAgICAgICAgInwtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS18XG4iCisgICAgICAgICAgICAgICAgICAgICJ8Vk8gfCAgJWQgIHwgICUzcyAgIHwgICVkICB8XG4iCisgICAgICAgICAgICAgICAgICAgICJ8VkkgfCAgJWQgIHwgICUzcyAgIHwgICVkICB8XG4iCisgICAgICAgICAgICAgICAgICAgICJ8QkUgfCAgJWQgIHwgICUzcyAgIHwgICVkICB8XG4iCisgICAgICAgICAgICAgICAgICAgICJ8QksgfCAgJWQgIHwgICUzcyAgIHwgICVkICB8XG4iCisgICAgICAgICAgICAgICAgICAgICJ8LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfFxuIiwKKyAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPmhkZFdtbVN0YXR1cy53bW1BY1N0YXR1c1tXTEFOVExfQUNfVk9dLndtbUFjQWNjZXNzUmVxdWlyZWQsCisgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5oZGRXbW1TdGF0dXMud21tQWNTdGF0dXNbV0xBTlRMX0FDX1ZPXS53bW1BY0FjY2Vzc0FsbG93ZWQ/IllFUyI6Ik5PIiwKKyAgICAgICAgICAgICAgICAgICAgcEFkYXB0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Vzc0FsbG93ZWQ/IllFUyI6Ik5PIiwKKyAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPmhkZFdtbVN0YXR1cy53bW1BY1N0YXR1c1tXTEFOVExfQUNfQktdLndtbUFjVHNwZWNJbmZvLnRzX2luZm8uZGlyZWN0aW9uKTsKKworCisgICAgICAgICAgICB3cnF1LT5kYXRhLmxlbmd0aCA9IHN0cmxlbihleHRyYSkrMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGNhc2UgV0VfR0VUX0NIQU5ORUxfTElTVDoKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1NUQVRVUyBzdGF0dXM7CisgICAgICAgICAgICB2X1U4X3QgaSwgbGVuOworICAgICAgICAgICAgY2hhciogYnVmIDsKKyAgICAgICAgICAgIHRBTklfVTggcEJ1ZltDT1VOVFJZX0NPREVfTEVOXTsKKyAgICAgICAgICAgIHRBTklfVTggdUJ1ZkxlbiA9IENPVU5UUllfQ09ERV9MRU47CisgICAgICAgICAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWCggcEFkYXB0ZXIgKTsKKyAgICAgICAgICAgIHRDaGFubmVsTGlzdEluZm8gY2hhbm5lbF9saXN0OworCisgICAgICAgICAgICBtZW1zZXQoJmNoYW5uZWxfbGlzdCwgMCwgc2l6ZW9mKGNoYW5uZWxfbGlzdCkpOworICAgICAgICAgICAgc3RhdHVzID0gaXdfc29mdGFwX2dldF9jaGFubmVsX2xpc3QoZGV2LCBpbmZvLCB3cnF1LCAoY2hhciAqKSZjaGFubmVsX2xpc3QpOworICAgICAgICAgICAgaWYgKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzIEdldENoYW5uZWxMaXN0IEZhaWxlZCEhISIsX19mdW5jX18pOworICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnVmID0gZXh0cmE7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogTWF4aW11bSBjaGFubmVscyA9IFdOSV9DRkdfVkFMSURfQ0hBTk5FTF9MSVNUX0xFTi4gTWF4aW11bSBidWZmZXIKKyAgICAgICAgICAgICAqIG5lZWRlZCA9IDUgKiBudW1iZXIgb2YgY2hhbm5lbHMuIENoZWNrIGlmc3VmZmljaWVudAorICAgICAgICAgICAgICogYnVmZmVyIGlzIGF2YWlsYWJsZSBhbmQgdGhlbiBwcm9jZWVkIHRvIGZpbGwgdGhlIGJ1ZmZlci4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgaWYoV0VfTUFYX1NUUl9MRU4gPCAoNSAqIFdOSV9DRkdfVkFMSURfQ0hBTk5FTF9MSVNUX0xFTikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICIlcyBJbnN1ZmZpY2llbnQgQnVmZmVyIHRvIHBvcHVsYXRlIGNoYW5uZWwgbGlzdCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbGVuID0gc2NucHJpbnRmKGJ1ZiwgV0VfTUFYX1NUUl9MRU4sICIldSAiLAorICAgICAgICAgICAgICAgICAgICBjaGFubmVsX2xpc3QubnVtX2NoYW5uZWxzKTsKKyAgICAgICAgICAgIGlmKCBlSEFMX1NUQVRVU19TVUNDRVNTID09ICBzbWVfR2V0Q291bnRyeUNvZGUocEhkZEN0eC0+aEhhbCwgcEJ1ZiwgJnVCdWZMZW4pKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvL1ByaW50aW5nIENvdW50cnkgY29kZSBpbiBnZXRDaGFubmVsTGlzdAorICAgICAgICAgICAgICAgZm9yKGk9IDA7IGkgPCBDT1VOVFJZX0NPREVfTEVOOyBpKyspCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgbGVuICs9IHNjbnByaW50ZihidWYgKyBsZW4sIFdFX01BWF9TVFJfTEVOIC0gbGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJWMgIiwgcEJ1ZltpXSk7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmb3IoaSA9IDAgOyBpIDwgY2hhbm5lbF9saXN0Lm51bV9jaGFubmVsczsgaSsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxlbiArPSBzY25wcmludGYoYnVmICsgbGVuLCBXRV9NQVhfU1RSX0xFTiAtIGxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXUgIiwgY2hhbm5lbF9saXN0LmNoYW5uZWxzW2ldKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHdycXUtPmRhdGEubGVuZ3RoID0gc3RybGVuKGV4dHJhKSsxOworCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgICAgICAgIGNhc2UgV0VfR0VUX1RETFNfUEVFUlM6CisgICAgICAgIHsKKyAgICAgICAgICAgIHdycXUtPmRhdGEubGVuZ3RoID0gd2xhbl9oZGRfdGRsc19nZXRfYWxsX3BlZXJzKHBBZGFwdGVyLCBleHRyYSwgV0VfTUFYX1NUUl9MRU4pKzE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorI2VuZGlmCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgICAgIGNhc2UgV0VfR0VUXzExV19JTkZPOgorICAgICAgIHsKKyAgICAgICAgICAgaGRkTG9nKExPR0UsICJXRV9HRVRfMTFXX0VOQUJMRUQgPSAlZCIsICB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xOworICAgICAgICAgICBicmVhazsKKyAgICAgICB9CisjZW5kaWYKKyAgICAgICAgY2FzZSBXRV9HRVRfU05SOgorICAgICAgICB7CisgICAgICAgICAgICB2X1M3X3QgczdzbnIgPSAwOworICAgICAgICAgICAgaW50IHN0YXR1cyA9IDA7CisgICAgICAgICAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgICAgICAgICAgaGRkX3N0YXRpb25fY3R4X3QgKnBIZGRTdGFDdHg7CisKKyAgICAgICAgICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgICAgICAgICBpZiAoMCAhPSBzdGF0dXMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcEhkZFN0YUN0eCA9IFdMQU5fSEREX0dFVF9TVEFUSU9OX0NUWF9QVFIocEFkYXB0ZXIpOworCisgICAgICAgICAgICBpZiAoMCA9PSBwSGRkQ3R4LT5jZmdfaW5pLT5mRW5hYmxlU05STW9uaXRvcmluZyB8fAorICAgICAgICAgICAgICAgIGVDb25uZWN0aW9uU3RhdGVfQXNzb2NpYXRlZCAhPSBwSGRkU3RhQ3R4LT5jb25uX2luZm8uY29ublN0YXRlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCAiJXM6IGdldFNOUiBmYWlsZWQ6IEVuYWJsZSBTTlIgTW9uaXRvcmluZy0lZCwiCisgICAgICAgICAgICAgICAgICAgICAgICIgQ29ubmVjdGlvblN0YXRlLSVkIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPmNmZ19pbmktPmZFbmFibGVTTlJNb25pdG9yaW5nLAorICAgICAgICAgICAgICAgICAgICAgICBwSGRkU3RhQ3R4LT5jb25uX2luZm8uY29ublN0YXRlKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVOT05FVDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyp1cGRhdGUgdGhlIHN0YXRzIGluIFRMKi8KKyAgICAgICAgICAgIHdsYW5faGRkX2dldF9zdGF0aW9uX3N0YXRzKHBBZGFwdGVyKTsKKyAgICAgICAgICAgIHdsYW5faGRkX2dldF9zbnIocEFkYXB0ZXIsICZzN3Nucik7CisgICAgICAgICAgICBzbnByaW50ZihleHRyYSwgV0VfTUFYX1NUUl9MRU4sICJzbnI9JWQiLHM3c25yKTsKKyAgICAgICAgICAgIHdycXUtPmRhdGEubGVuZ3RoID0gc3RybGVuKGV4dHJhKSArIDE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyhMT0dFLCAiJXM6IEludmFsaWQgSU9DVEwgY29tbWFuZCAlZCIsIF9fZnVuY19fLCBzdWJfY21kICk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgICBFWElUKCk7CisgICAgcmV0dXJuIDA7Cit9CisKK3N0YXRpYyBpbnQgaXdfZ2V0X2NoYXJfc2V0bm9uZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaW50IHJldDsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX19pd19nZXRfY2hhcl9zZXRub25lKGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKKy8qICBhY3Rpb24gc3ViLWlvY3RscyAqLworc3RhdGljIGludCBfX2l3X3NldG5vbmVfZ2V0bm9uZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcjsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgIGludCBzdWJfY21kOworICAgIGludCByZXQgPSAwOyAvKiBzdWNjZXNzICovCisgICAgc3RydWN0IGl3X3BvaW50IHNfcHJpdl9kYXRhOworCisgICAgRU5URVIoKTsKKworICAgIHBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogQWRhcHRlciBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKyAgICBwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisgICAgcmV0ID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgICBpZiAoMCAhPSByZXQpCisgICAgeworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKyAgICAvKiBoZWxwZXIgZnVuY3Rpb24gdG8gZ2V0IGl3cmVxX2RhdGEgd2l0aCBjb21wYXQgaGFuZGxpbmcuICovCisgICAgaWYgKGhkZF9wcml2X2dldF9kYX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CisgICAgICAgICAgaWYoIHBBZGFwdGVyX3RvX3N0b3AgKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICJBZGFwdGVyIHdpdGggbmFtZSBzb2Z0YXAuMCBhbHJlYWR5ICIKKyAgICAgICAgICAgICAgICAgICAgICAgImV4aXN0LCBpZ25vcmluZyB0aGUgcmVxdWVzdC5cblJlbW92ZSB0aGUgIgorICAgICAgICAgICAgICAgICAgICAgICAiYWRhcHRlciBhbmQgdHJ5IGFnYWluXG4iKTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgfQorICAgICAgICAgIHByX2luZm8oIkluaXQgQVAgdHJpZ2dlclxuIik7CisgICAgICAgICAgaGRkX29wZW5fYWRhcHRlciggV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlciksIFdMQU5fSEREX1NPRlRBUCwgInNvZnRhcC4lZCIsCisgICAgICAgICAgICAgICAgIHdsYW5faGRkX2dldF9pbnRmX2FkZHIoIFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpICksVFJVRSk7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBXRV9TVE9QX0FQOgorICAgICAgICB7CisgICAgICAgICAgIC8qRklYIE1FOiBOZWVkIHRvIGJlIHJldmlzaXRlZCBpZiBtdWx0aXBsZSBTQVBzIHRvIGJlIHN1cHBvcnRlZCAqLworICAgICAgICAgICAvKiBBcyBTb2Z0IEFQIG1vZGUgaGFzIGJlZW4gY2hhbmdlZCB0byBTVEEgYWxyZWFkeSB3aXRoIGtpbGxpbmcgb2YgSG9zdGFwZCwKKyAgICAgICAgICAgICogdGhpcyBpcyBhIGRlYWQgY29kZSBhbmQgbmVlZCB0byBmaW5kIHRoZSBhZHBhdGVyIGJ5IG5hbWUgcmF0aGVyIHRoYW4gbW9kZSAqLworICAgICAgICAgICBoZGRfYWRhcHRlcl90KiBwQWRhcHRlcl90b19zdG9wID0KKyAgICAgICAgICAgICAgICBoZGRfZ2V0X2FkYXB0ZXJfYnlfbmFtZShXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSwgInNvZnRhcC4wIik7CisgICAgICAgICAgIGlmKCBwQWRhcHRlcl90b19zdG9wICkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworCisgICAgICAgICAgICAgICBwcl9pbmZvKCJTdG9wcGluZyBBUCBtb2RlXG4iKTsKKworICAgICAgICAgICAgICAgaWYgKFRSVUUgPT0gc21lX0lzUG1jQm1wcyhXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlcikpKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgLyogRVhJVCBCTVBTIGFzIGZ3IGNhbm5vdCBoYW5kbGUgREVMX1NUQSB3aGVuIGl0cyBpbiBCTVBTICovCisgICAgICAgICAgICAgICAgICB3bGFuX2hkZF9lbnRlcl9ibXBzKHBBZGFwdGVyLCBEUklWRVJfUE9XRVJfTU9ERV9BQ1RJVkUpOworICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAvKk1ha2Ugc3VyZSB0aGF0IHBBZGFwdGVyIGNsZWFuZWQgcHJvcGVybHkqLworICAgICAgICAgICAgICAgaGRkX3N0b3BfYWRhcHRlciggcEhkZEN0eCwgcEFkYXB0ZXJfdG9fc3RvcCwgVk9TX1RSVUUgKTsKKyAgICAgICAgICAgICAgIGhkZF9kZWluaXRfYWRhcHRlciggcEhkZEN0eCwgcEFkYXB0ZXJfdG9fc3RvcCwgVFJVRSk7CisgICAgICAgICAgICAgICBtZW1zZXQoJnBBZGFwdGVyX3RvX3N0b3AtPnNlc3Npb25DdHgsIDAsIHNpemVvZihwQWRhcHRlcl90b19zdG9wLT5zZXNzaW9uQ3R4KSk7CisKKyAgICAgICAgICAgICAgIHdsYW5faGRkX3JlbGVhc2VfaW50Zl9hZGRyKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpLAorICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlcl90b19zdG9wLT5tYWNBZGRyZXNzQ3VycmVudC5ieXRlcyk7CisgICAgICAgICAgICAgICBoZGRfY2xvc2VfYWRhcHRlcihXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSwgcEFkYXB0ZXJfdG9fc3RvcCwKKyAgICAgICAgICAgICAgICAgICAgICAgVFJVRSk7CisKKyAgICAgICAgICAgICAgIGlmIChGQUxTRSA9PSBzbWVfSXNQbWNCbXBzKFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSkpCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBwdXQgdGhlIGRldmljZSBiYWNrIGludG8gQk1QUyAqLworICAgICAgICAgICAgICAgICAgd2xhbl9oZGRfZW50ZXJfYm1wcyhwQWRhcHRlciwgRFJJVkVSX1BPV0VSX01PREVfQVVUTyk7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgIH0KKyAgICAgICAgICAgZWxzZQorICAgICAgICAgICB7CisgICAgICAgICAgICAgIHByaW50ayhLRVJOX0VSUiJTQVAgYWRhcHRlciBub3QgZm91bmQgdG8gc3RvcCBpdCFcbiIpOworICAgICAgICAgICB9CisKKyAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyNpZmRlZiBXTEFOX0JUQU1QX0ZFQVRVUkUKKyAgICAgICAgY2FzZSBXRV9FTkFCTEVfQU1QOgorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCIlczogZW5hYmxpbmcgQU1QIiwgX19mdW5jX18pOworICAgICAgICAgICAgV0xBTkJBUF9SZWdpc3RlcldpdGhIQ0kocEFkYXB0ZXIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBXRV9ESVNBQkxFX0FNUDoKKyAgICAgICAgeworICAgICAgICAgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgoIHBBZGFwdGVyICk7CisgICAgICAgICAgICBWT1NfU1RBVFVTIHN0YXR1czsKKworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywiJXM6IGRpc2FibGluZyBBTVAiLCBfX2Z1bmNfXyk7CisKKyAgICAgICAgICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKCBwQWRhcHRlciApOworICAgICAgICAgICAgc3RhdHVzID0gV0xBTkJBUF9TdG9wQW1wKCk7CisgICAgICAgICAgICBpZihWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gc3RhdHVzICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHBIZGRDdHgtPmlzQW1wQWxsb3dlZCA9IFZPU19UUlVFOworICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IEZhaWxlZCB0byBzdG9wIEFNUCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8vYSBzdGF0ZSBtL2MgaW1wbGVtZW50YXRpb24gaW4gUEFMIGlzIFRCRCB0byBhdm9pZCB0aGlzIGRlbGF5CisgICAgICAgICAgICAgICBtc2xlZXAoNTAwKTsKKyAgICAgICAgICAgICAgIHBIZGRDdHgtPmlzQW1wQWxsb3dlZCA9IFZPU19GQUxTRTsKKyAgICAgICAgICAgICAgIFdMQU5CQVBfRGVyZWdpc3RlckZyb21IQ0koKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyNlbmRpZgorICAgICAgICBjYXNlIFdFX0VOQUJMRV9EWEVfU1RBTExfREVURUNUOgorICAgICAgICB7CisgICAgICAgICAgICB0SGFsSGFuZGxlIGhIYWwgPSBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlcik7CisgICAgICAgICAgICBzbWVfdHJhbnNwb3J0RGVidWcoaEhhbCwgVk9TX0ZBTFNFLCBWT1NfVFJVRSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBjYXNlIFdFX0RJU1BMQVlfRFhFX1NOQVBfU0hPVDoKKyAgICAgICAgeworICAgICAgICAgICAgdEhhbEhhbmRsZSBoSGFsID0gV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpOworICAgICAgICAgICAgc21lX3RyYW5zcG9ydERlYnVnKGhIYWwsIFZPU19UUlVFLCBWT1NfRkFMU0UpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBXRV9ESVNQTEFZX0RBVEFQQVRIX1NOQVBfU0hPVDoKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKExPR0UsICIlczogY2FsbGVkICVkIixfX2Z1bmNfXywgc3ViX2NtZCk7CisgICAgICAgICAgICBoZGRfd21tX3R4X3NuYXBzaG90KHBBZGFwdGVyKTsKKyAgICAgICAgICAgIFdMQU5UTF9UTERlYnVnTWVzc2FnZShXTEFOVExfREVCVUdfVFhfU05BUFNIT1QpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlICBXRV9TRVRfUkVBU1NPQ19UUklHR0VSOgorICAgICAgICB7CisgICAgICAgICAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciA9IFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgICAgICAgICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9IFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKTsKKyAgICAgICAgICAgIHZfVTMyX3Qgcm9hbUlkID0gMDsKKyAgICAgICAgICAgIHRDc3JSb2FtTW9kaWZ5UHJvZmlsZUZpZWxkcyBtb2RQcm9maWxlRmllbGRzOworICAgICAgICAgICAgc21lX0dldE1vZGlmeVByb2ZpbGVGaWVsZHMocE1hYywgcEFkYXB0ZXItPnNlc3Npb25JZCwgJm1vZFByb2ZpbGVGaWVsZHMpOworICAgICAgICAgICAgc21lX1JvYW1SZWFzc29jKHBNYWMsIHBBZGFwdGVyLT5zZXNzaW9uSWQsIE5VTEwsIG1vZFByb2ZpbGVGaWVsZHMsICZyb2FtSWQsIDEpOworICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIFdFX1NUT1BfT0JTU19TQ0FOOgorICAgICAgICB7CisgICAgICAgICAgICAvKiAxLk9CU1MgU2NhbiBpcyBtYW5kYXRvcnkgd2hpbGUgb3BlcmF0aW5nIGluIDIuNEdIegorICAgICAgICAgICAgICAgMi5PQlNTIHNjYW4gaXMgc3RvcHBlZCBieSBGaXJtd2FyZSBkdXJpbmcgdGhlIGRpc2Fzc29jaWF0aW9uCisgICAgICAgICAgICAgICAzLk9CU1Mgc3RvcCBjb21hbW5kIGlzIGFkZGVkIGZvciBkZWJ1Z2dpbmcgcHVycG9zZSovCisgICAgICAgICAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciA9IFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgICAgICAgICAgdHBBbmlTaXJHbG9iYWwgcE1hYzsKKworICAgICAgICAgICAgaWYgKHBBZGFwdGVyID09IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiIHBBZGFwdGVyIGlzIE5VTEwgIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwTWFjID0gV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpOworICAgICAgICAgICAgaWYgKHBNYWMgPT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIgcE1hYyBpcyBOVUxMICIpOworICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc21lX0hUNDBTdG9wT0JTU1NjYW4ocE1hYywgcEFkYXB0ZXItPnNlc3Npb25JZCk7CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgV0VfRFVNUF9ST0FNX1RJTUVSX0xPRzoKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX2R1bXBfcm9hbV90aW1lX2xvZ19zZXJ2aWNlKCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgV0VfUkVTRVRfUk9BTV9USU1FUl9MT0c6CisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19yZXNldF9yb2FtX3RpbWVyX2xvZygpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBXRV9HRVRfRldfTE9HUzoKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX2ZhdGFsX2V2ZW50X2xvZ3NfcmVxKFdMQU5fTE9HX1RZUEVfTk9OX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICAgV0xBTl9MT0dfSU5ESUNBVE9SX0lPQ1RMLAorICAgICAgICAgICAgICAgICAgICAgV0xBTl9MT0dfUkVBU09OX0NPREVfVU5VU0VELAorICAgICAgICAgICAgICAgICAgICAgVFJVRSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBkZWZhdWx0OgorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coTE9HRSwgIiVzOiB1bmtub3duIGlvY3RsICVkIiwgX19mdW5jX18sIHN1Yl9jbWQpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisgICAgRVhJVCgpOworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQgaXdfc2V0bm9uZV9nZXRub25lKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaW50IHJldDsKKworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgcmV0ID0gX19pd19zZXRub25lX2dldG5vbmUoZGV2LCBpbmZvLCB3cnF1LCBleHRyYSk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKwordm9pZCBoZGRfd21tX3R4X3NuYXBzaG90KGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyKQoreworICAgIC8qCisgICAgICogRnVuY3Rpb24gdG8gZGlzcGxheSBIREQgV01NIGluZm9ybWF0aW9uCisgICAgICogZm9yIFR4IFF1ZXVlcy4KKyAgICAgKiBQcmludHMgZ2xvYmFsYSBhcyB3ZWxsIGFzIHBlciBjbGllbnQgZGVwZW5kaW5nCisgICAgICogd2hldGhlciB0aGUgY2xpZW50cyBhcmUgcmVnaXN0ZXJlZCBvciBub3QuCisgICAgICovCisgICAgaW50IGkgPSAwLCBqID0gMDsKKyAgICB2X0NPTlRFWFRfdCBwVm9zQ29udGV4dCA9ICggV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcikpLT5wdm9zQ29udGV4dDsKKyAgICBwdFNhcENvbnRleHQgcFNhcEN0eCA9IFZPU19HRVRfU0FQX0NCKHBWb3NDb250ZXh0KTsKKyAgICBoZGRfc3RhdGlvbl9jdHhfdCAqcEhkZFN0YUN0eCA9IFdMQU5fSEREX0dFVF9TVEFUSU9OX0NUWF9QVFIocEFkYXB0ZXIpOworICAgIGhkZF9pYnNzX3BlZXJfaW5mb190ICpwUGVlckluZm87CisgICAgdl9TSVpFX3QgdHhfcXVldWVfY291bnRbTlVNX1RYX1FVRVVFU107CisKKyAgICBmb3IgKCBpPTA7IGk8IE5VTV9UWF9RVUVVRVM7IGkrKykKKyAgICB7CisgICAgICAgIHNwaW5fbG9ja19iaCgmcEFkYXB0ZXItPndtbV90eF9xdWV1ZVtpXS5sb2NrKTsKKyAgICAgICAgdHhfcXVldWVfY291bnRbaV0gPSBwQWRhcHRlci0+d21tX3R4X3F1ZXVlW2ldLmNvdW50OworICAgICAgICBzcGluX3VubG9ja19iaCgmcEFkYXB0ZXItPndtbV90eF9xdWV1ZVtpXS5sb2NrKTsKKyAgICB9CisKKyAgICBmb3IgKCBpPTA7IGk8IE5VTV9UWF9RVUVVRVM7IGkrKykgeworICAgICAgICBpZiAodHhfcXVldWVfY291bnRbaV0pIHsKKyAgICAgICAgICAgIGhkZExvZyhMT0dFLCAiSEREIFdNTSBUeFF1ZXVlIEluZm8gRm9yIEFDOiAlZCBDb3VudDogJWQiLAorICAgICAgICAgICAgICAgaSwgdHhfcXVldWVfY291bnRbaV0pOworICAgICAgICB9CisgICAgfQorCisgICAgaWYocFNhcEN0eCA9PSBOVUxMKXsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICBGTCgicHNhcEN0eCBpcyBOVUxMIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgc3Bpbl9sb2NrX2JoKCZwU2FwQ3R4LT5zdGFJbmZvX2xvY2spOworICAgIGZvcihpID0wOyBpPFdMQU5fTUFYX1NUQV9DT1VOVDsgaSsrKQorICAgIHsKKyAgICAgICAgaWYocFNhcEN0eC0+YVN0YUluZm9baV0uaXNVc2VkKQorICAgICAgICB7CisgICAgICAgICAgICAgaGRkTG9nKExPR0UsICIqKioqKipTVEFJbmRleDogJWQqKioqKioqKioiLCBpKTsKKyAgICAgICAgICAgICBmb3IgKCBqPTA7IGo8IE5VTV9UWF9RVUVVRVM7IGorKykKKyAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoIHBTYXBDdHgtPmFTdGFJbmZvW2ldLndtbV90eF9xdWV1ZVtqXS5jb3VudCApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIHNwaW5fbG9ja19iaCgmcFNhcEN0eC0+YVN0YUluZm9baV0ud21tX3R4X3F1ZXVlW2pdLmxvY2spOworICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCAiSEREIFR4UXVldWUgSW5mbyBGb3IgQUM6ICVkIENvdW50OiAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgaiwgcFNhcEN0eC0+YVN0YUluZm9baV0ud21tX3R4X3F1ZXVlW2pdLmNvdW50KTsKKyAgICAgICAgICAgICAgICAgIHNwaW5fdW5sb2NrX2JoKCZwU2FwQ3R4LT5hU3RhSW5mb1tpXS53bW1fdHhfcXVldWVbal0ubG9jayk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBzcGluX3VubG9ja19iaCgmcFNhcEN0eC0+c3RhSW5mb19sb2NrKTsKKworICAgIGlmKHBIZGRTdGFDdHggPT0gTlVMTCl7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgRkwoInBIZGRTdGFDdHggaXMgTlVMTCIpKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHBQZWVySW5mbyA9ICZwSGRkU3RhQ3R4LT5pYnNzX3BlZXJfaW5mbzsKKyAgICBpZihwUGVlckluZm8gPT0gTlVMTCl7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgRkwoInBwZWVyaW5mbyBpcyBOVUxMIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgZm9yKGkgPTA7IGk8IEhERF9NQVhfTlVNX0lCU1NfU1RBOyBpKyspCisgICB7CisgICAgICAgIGlmKHBQZWVySW5mby0+aWJzc1N0YUluZm9baV0uaXNVc2VkKQorICAgICAgICB7CisgICAgICAgICAgICAgaGRkTG9nKExPR0UsICIqKioqKipJQlNTIFNUQUluZGV4OiAlZCoqKioqKioqKiIsIGkpOworICAgICAgICAgICAgIGZvciAoIGo9MDsgajwgTlVNX1RYX1FVRVVFUzsgaisrKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzcGluX2xvY2tfYmgoJnBQZWVySW5mby0+aWJzc1N0YUluZm9baV0ud21tX3R4X3F1ZXVlW2pdLmxvY2spOworICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCAiSEREIFR4UXVldWUgSW5mbyBGb3IgQUM6ICVkIENvdW50OiAlZCBQcmV2QWRyZXNzOiVwLCBOZXh0QWRkcmVzczolcCIsCisgICAgICAgICAgICAgICAgICAgICAgIGosIHBQZWVySW5mby0+aWJzc1N0YUluZm9baV0ud21tX3R4X3F1ZXVlW2pdLmNvdW50LAorICAgICAgICAgICAgICAgICAgICAgICBwUGVlckluZm8tPmlic3NTdGFJbmZvW2ldLndtbV90eF9xdWV1ZVtqXS5hbmNob3IucHJldiwKKyAgICAgICAgICAgICAgICAgICAgICAgcFBlZXJJbmZvLT5pYnNzU3RhSW5mb1tpXS53bW1fdHhfcXVldWVbal0uYW5jaG9yLm5leHQpOworICAgICAgICAgICAgICAgIHNwaW5fdW5sb2NrX2JoKCZwUGVlckluZm8tPmlic3NTdGFJbmZvW2ldLndtbV90eF9xdWV1ZVtqXS5sb2NrKTsKKyAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKworfQorc3RhdGljIGludCBfX2l3X3NldF92YXJfaW50c19nZXRub25lKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcjsKKyAgICB0SGFsSGFuZGxlIGhIYWw7CisgICAgaW50IHN1Yl9jbWQ7CisgICAgaW50ICphcHBzX2FyZ3MgPSAoaW50ICopIGV4dHJhOworICAgIGhkZF9zdGF0aW9uX2N0eF90ICpwU3RhQ3R4ID0gTlVMTCA7CisgICAgaGRkX21vbl9jdHhfdCAqcE1vbkN0eCA9IE5VTEw7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IE5VTEw7CisgICAgaGRkX2FwX2N0eF90ICAqcEFQQ3R4ID0gTlVMTDsKKyAgICB2X0NPTlRFWFRfdCBwVm9zQ29udGV4dDsKKyAgICBpbnQgY21kID0gMDsKKyAgICBpbnQgc3RhSWQgPSAwOworICAgIGludCByZXQgPSAwOworCisgICAgRU5URVIoKTsKKyAgICBpZiAoZXh0cmEgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBOVUxMIGV4dHJhIGJ1ZmZlciBwb2ludGVyIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgICBpZiAoTlVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBBZGFwdGVyIGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIHBWb3NDb250ZXh0ID0gKCBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPnB2b3NDb250ZXh0OworICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHJldCkKKyAgICB7CisgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorICAgIGlmKCBWT1NfTU9OSVRPUl9NT0RFICE9IGhkZF9nZXRfY29ucGFyYW0oKSkKKyAgICB7CisgICAgICBoSGFsID0gV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpOworICAgICAgaWYgKE5VTEwgPT0gaEhhbCkKKyAgICAgIHsKKyAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIiVzOiBIYWwgQ29udGV4dCBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICB9CisgICAgfQorICAgIHN1Yl9jbWQgPSB3cnF1LT5kYXRhLmZsYWdzOworCisgICAgaGRkTG9nKExPRzEsICIlczogUmVjZWl2ZWQgbGVuZ3RoICVkIiwgX19mdW5jX18sIHdycXUtPmRhdGEubGVuZ3RoKTsKKworCisgICAgaWYoKCBzdWJfY21kID09IFdFX01DQ19DT05GSUdfQ1JFREVOVElBTCApIHx8CisgICAgICAgIChzdWJfY21kID09IFdFX01DQ19DT05GSUdfUEFSQU1TICkpCisgICAgeworICAgICAgICBpZigoIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSA9PSBXTEFOX0hERF9JTkZSQV9TVEFUSU9OICl8fAorICAgICAgICAgICAoIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSA9PSBXTEFOX0hERF9QMlBfQ0xJRU5UICkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBTdGFDdHggPSBXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKTsKKyAgICAgICAgICAgIHN0YUlkID0gcFN0YUN0eC0+Y29ubl9pbmZvLnN0YUlkWzBdOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKCggcEFkYXB0ZXItPmRldmljZV9tb2RlID09IFdMQU5fSEREX1AyUF9HTyApIHx8CisgICAgICAgICAgICAgICAgICggcEFkYXB0ZXItPmRldmljZV9tb2RlID09IFdMQU5fSEREX1NPRlRBUCApKQorICAgICAgICB7CisgICAgICAgICAgICBwQVBDdHggPSBXTEFOX0hERF9HRVRfQVBfQ1RYX1BUUihwQWRhcHRlcik7CisgICAgICAgICAgICBzdGFJZCA9IHBBUEN0eC0+dUJDU3RhSWQ7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coTE9HRSwgIiVzOiBEZXZpY2UgbW9kZSAlZCBub3QgcmVjb2duaXNlZCIsIF9fRlVOQ1RJT05fXywgcEFkYXB0ZXItPmRldmljZV9tb2RlKTsKKyAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9CisgICAgfQorCisgICAgc3dpdGNoIChzdWJfY21kKQorICAgIHsKKyAgICAgICAgY2FzZSBXRV9MT0dfRFVNUF9DTUQ6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGFwcHNfYXJnc1swXSA9PSAyNikgeworICAgICAgICAgICAgICAgICAgICBpZiAoIXBIZGRDdHgtPmNmZ19pbmktPmNyYXNoX2luamVjdF9lbmFibGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIkNyYXNoIEluamVjdCBpbmkgZGlzYWJsZWQsIElnbm9yZSBDcmFzaCBJbmplY3QiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGhkZExvZyhMT0cxLCAiJXM6IExPR19EVU1QICVkIGFyZzEgJWQgYXJnMiAlZCBhcmczICVkIGFyZzQgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIGFwcHNfYXJnc1swXSwgYXBwc19hcmdzWzFdLCBhcHBzX2FyZ3NbMl0sCisgICAgICAgICAgICAgICAgICAgICAgICBhcHBzX2FyZ3NbM10sIGFwcHNfYXJnc1s0XSk7CisKKyAgICAgICAgICAgICAgICBsb2dQcmludGYoaEhhbCwgYXBwc19hcmdzWzBdLCBhcHBzX2FyZ3NbMV0sIGFwcHNfYXJnc1syXSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGFwcHNfYXJnc1szXSwgYXBwc19hcmdzWzRdKTsKKworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBXRV9QMlBfTk9BX0NNRDoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwMnBfYXBwX3NldFAycFBzX3QgcDJwTm9BOworCisgICAgICAgICAgICAgICAgaWYgKHBBZGFwdGVyLT5kZXZpY2VfbW9kZSAhPSBXTEFOX0hERF9QMlBfR08pIHsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICBGTCgiU2V0dGluZyBOb0EgaXMgbm90IGFsbG93ZWQgaW4gRGV2aWNlIG1vZGU6JWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5kZXZpY2VfbW9kZSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHAycE5vQS5vcHBfcHMgPSBhcHBzX2FyZ3NbMF07CisgICAgICAgICAgICAgICAgcDJwTm9BLmN0V2luZG93ID0gYXBwc19hcmdzWzFdOworICAgICAgICAgICAgICAgIHAycE5vQS5kdXJhdGlvbiA9IGFwcHNfYXJnc1syXTsKKyAgICAgICAgICAgICAgICBwMnBOb0EuaW50ZXJ2YWwgID0gYXBwc19hcmdzWzNdOworICAgICAgICAgICAgICAgIHAycE5vQS5jb3VudCA9IGFwcHNfYXJnc1s0XTsKKyAgICAgICAgICAgICAgICBwMnBOb0Euc2luZ2xlX25vYV9kdXJhdGlvbiA9IGFwcHNfYXJnc1s1XTsKKyAgICAgICAgICAgICAgICBwMnBOb0EucHNTZWxlY3Rpb24gPSBhcHBzX2FyZ3NbNl07CisKKyAgICAgICAgICAgICAgICBoZGRMb2coTE9HMSwgIiVzOiBQMlBfTk9BX0FUVFI6b3BwUFMgJWQgY3RXaW5kb3cgJWQgZHVyYXRpb24gJWQgIgorICAgICAgICAgICAgICAgICAgICAgICAiaW50ZXJ2YWwgJWQgY291bnQgJWQgc2luZ2xlIG5vYSBkdXJhdGlvbiAlZCBQc1NlbGVjdGlvbiAleCIsCisgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBhcHBzX2FyZ3NbMF0sIGFwcHNfYXJnc1sxXSwgYXBwc19hcmdzWzJdLAorICAgICAgICAgICAgICAgICAgICAgICBhcHBzX2FyZ3NbM10sIGFwcHNfYXJnc1s0XSwgYXBwc19hcmdzWzVdLCBhcHBzX2FyZ3NbNl0pOworCisgICAgICAgICAgICAgICAgaGRkX3NldFAycFBzKGRldiwgJnAycE5vQSk7CisKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgV0VfTVRSQUNFX1NFTEVDVElWRV9NT0RVTEVfTE9HX0VOQUJMRV9DTUQ6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKExPRzEsICIlczogU0VMRUNUSVZFX01PRFVMRV9MT0cgJWQgYXJnMSAlZCBhcmcyIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBhcHBzX2FyZ3NbMF0sIGFwcHNfYXJnc1sxXSk7CisgICAgICAgICAgICAgICAgdm9zVHJhY2VFbmFibGUoYXBwc19hcmdzWzBdLCBhcHBzX2FyZ3NbMV0pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBXRV9NVFJBQ0VfRFVNUF9DTUQ6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKExPRzEsICIlczogTVRSQUNFX0RVTVAgY29kZSAlZCBzZXNzaW9uICVkIGNvdW50ICVkICIKKyAgICAgICAgICAgICAgICAgICAgICAgImJpdG1hc2tfb2ZfbW9kdWxlICVkICIsCisgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgYXBwc19hcmdzWzBdLCBhcHBzX2FyZ3NbMV0sIGFwcHNfYXJnc1syXSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGFwcHNfYXJnc1szXSk7CisgICAgICAgICAgICAgICAgdm9zVHJhY2VEdW1wQWxsKCh2b2lkKiloSGFsICwgYXBwc19hcmdzWzBdLCBhcHBzX2FyZ3NbMV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcHNfYXJnc1syXSwgYXBwc19hcmdzWzNdKTsKKworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBXRV9NQ0NfQ09ORklHX0NSRURFTlRJQUwgOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNtZCA9IDI4NzsgLy9Db21tYW5kIHNob3VsZCBiZSB1cGRhdGVkIGlmIHRoZXJlIGlzIGFueSBjaGFuZ2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGluIHRoZSBSaXZhIGR1bXAgY29tbWFuZAorICAgICAgICAgICAgICAgIGlmKChhcHBzX2FyZ3NbMF0gPj0gNDAgKSAmJiAoYXBwc19hcmdzWzBdIDw9IDE2MCApKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbG9nUHJpbnRmKGhIYWwsIGNtZCwgc3RhSWQsIGFwcHNfYXJnc1swXSwgYXBwc19hcmdzWzFdLCBhcHBzX2FyZ3NbMl0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsICIlcyA6IEVudGVyIHZhbGlkIE1jY0NyZWRlbnRpYWwgdmFsdWUgYmV0d2VlbiBNSU4gOjQwIGFuZCBNQVg6MTYwIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBXRV9NQ0NfQ09ORklHX1BBUkFNUyA6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY21kID0gMjg4OyAvL2NvbW1hbmQgU2hvdWxkIGJlIHVwZGF0ZWQgaWYgdGhlcmUgaXMgYW55IGNoYW5nZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW4gdGhlIFJpdmEgZHVtcCBjb21tYW5kCisgICAgICAgICAgICAgICAgIGhkZF92YWxpZGF0ZV9tY2NfY29uZmlnKHBBZGFwdGVyLCBzdGFJZCwgYXBwc19hcmdzWzBdLCBhcHBzX2FyZ3NbMV0sYXBwc19hcmdzWzJdKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworICAgICAgICBjYXNlIFdFX1RETFNfQ09ORklHX1BBUkFNUyA6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdGRsc19jb25maWdfcGFyYW1zX3QgdGRsc1BhcmFtczsKKworICAgICAgICAgICAgICAgIHRkbHNQYXJhbXMudGRscyAgICAgICAgICAgICAgICAgICAgPSBhcHBzX2FyZ3NbMF07CisgICAgICAgICAgICAgICAgdGRsc1BhcmFtcy50eF9wZXJpb2RfdCAgICAgICAgICAgICA9IGFwcHNfYXJnc1sxXTsKKyAgICAgICAgICAgICAgICB0ZGxzUGFyYW1zLnR4X3BhY2tldF9uICAgICAgICAgICAgID0gYXBwc19hcmdzWzJdOworICAgICAgICAgICAgICAgIHRkbHNQYXJhbXMuZGlzY292ZXJ5X3BlcmlvZF90ICAgICAgPSBhcHBzX2FyZ3NbM107CisgICAgICAgICAgICAgICAgdGRsc1BhcmFtcy5kaXNjb3ZlcnlfdHJpZXNfbiAgICAgICA9IGFwcHNfYXJnc1s0XTsKKyAgICAgICAgICAgICAgICB0ZGxzUGFyYW1zLmlkbGVfdGltZW91dF90ICAgICAgICAgID0gYXBwc19hcmdzWzVdOworICAgICAgICAgICAgICAgIHRkbHNQYXJhbXMuaWRsZV9wYWNrZXRfbiAgICAgICAgICAgPSBhcHBzX2FyZ3NbNl07CisgICAgICAgICAgICAgICAgdGRsc1BhcmFtcy5yc3NpX2h5c3RlcmVzaXMgICAgICAgICA9IGFwcHNfYXJnc1s3XTsKKyAgICAgICAgICAgICAgICB0ZGxzUGFyYW1zLnJzc2lfdHJpZ2dlcl90aHJlc2hvbGQgID0gYXBwc19hcmdzWzhdOworICAgICAgICAgICAgICAgIHRkbHNQYXJhbXMucnNzaV90ZWFyZG93bl90aHJlc2hvbGQgPSBhcHBzX2FyZ3NbOV07CisKKyAgICAgICAgICAgICAgICB3bGFuX2hkZF90ZGxzX3NldF9wYXJhbXMoZGV2LCAmdGRsc1BhcmFtcyk7CisgICAgICAgICAgICB9CisgICAgICAgIGJyZWFrOworI2VuZGlmCisgICAgICAgIGNhc2UgV0VfQ09ORklHVVJFX01PTklUT1JfTU9ERToKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgdl9VMzJfdCBtYWdpYyA9IDA7CisgICAgICAgICAgICAgICBzdHJ1Y3QgY29tcGxldGlvbiBjbXBWYXI7CisgICAgICAgICAgICAgICBsb25nIHdhaXRSZXQgPSAwOworCisgICAgICAgICAgICAgICBwTW9uQ3R4ID0gIFdMQU5fSEREX0dFVF9NT05JVE9SX0NUWF9QVFIocEFkYXB0ZXIpOworICAgICAgICAgICAgICAgaWYoIHBNb25DdHggPT0gTlVMTCApCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCAiTW9uaXRvciBDb250ZXh0IE5VTEwiKTsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICBoZGRMb2coTE9HMSwgIiVzOiBNb25pdG9yIE1PZGUgQ29uZmlndXJhdGlvbjogQ2hObz0lZCBDaEJXPSVkIENSQ0NoZWNrPSVkIHR5cGU9JWQgQ29udmVyc2lvbkJpdD0lZCIsCisgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgYXBwc19hcmdzWzBdLCBhcHBzX2FyZ3NbMV0sIGFwcHNfYXJnc1syXSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGFwcHNfYXJnc1szXSwgYXBwc19hcmdzWzRdKTsKKyAgICAgICAgICAgICAgIC8qIElucHV0IFZhbGlkYXRpb24gcGFydCBvZiBGVyAqLworICAgICAgICAgICAgICAgcE1vbkN0eC0+Q2hhbm5lbE5vID0gYXBwc19hcmdzWzBdOworICAgICAgICAgICAgICAgcE1vbkN0eC0+Q2hhbm5lbEJXID0gYXBwc19hcmdzWzFdOworICAgICAgICAgICAgICAgcE1vbkN0eC0+Y3JjQ2hlY2tFbmFibGVkID0gYXBwc19hcmdzWzJdOworICAgICAgICAgICAgICAgd2xhbl9oZGRfbW9uX3NldF90eXBlc3VidHlwZSggcE1vbkN0eCxhcHBzX2FyZ3NbM10pOworICAgICAgICAgICAgICAgcE1vbkN0eC0+aXM4MDIxMXRvODAzQ29uUmVxID0gYXBwc19hcmdzWzRdOworICAgICAgICAgICAgICAgV0xBTlRMX1NldElzQ29udmVyc2lvblJlcShwVm9zQ29udGV4dCxhcHBzX2FyZ3NbNF0pOworICAgICAgICAgICAgICAgaWYoIHBNb25DdHgtPmlzODAyMTF0bzgwM0NvblJlcSApCisgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5kZXYtPnR5cGUgPSBBUlBIUkRfRVRIRVI7CisgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5kZXYtPnR5cGUgPSBBUlBIUkRfSUVFRTgwMjExX1JBRElPVEFQOworICAgICAgICAgICAgICAgaWYoIChhcHBzX2FyZ3NbM10hPSAxMDAgJiYgYXBwc19hcmdzWzNdIT0gMCkgJiYgYXBwc19hcmdzWzRdICkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCAiJXM6IEZpbHRlcmluZyBkYXRhIHBhY2tldHMgYXMgbWFuYWdlbWVudCBhbmQgY29udHJvbCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAiIGNhbm5vdCBiZSBjb252ZXJ0ZWQgdG8gODAyLjMgIixfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgICBwTW9uQ3R4LT50eXBlU3VidHlwZUJpdG1hcCA9IDB4RkZGRjAwMDAwMDAwOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgaWYgKE1PTl9NT0RFX1NUQVJUID09IHBNb25DdHgtPnN0YXRlKSB7CisgICAgICAgICAgICAgICAgICAgIG1hZ2ljID0gTU9OX01PREVfTVNHX01BR0lDOworICAgICAgICAgICAgICAgICAgICBpbml0X2NvbXBsZXRpb24oJmNtcFZhcik7CisgICAgICAgICAgICAgICAgICAgIGlmIChWT1NfU1RBVFVTX1NVQ0NFU1MgIT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB3bGFuX2hkZF9tb25fcG9zdE1zZygmbWFnaWMsICZjbXBWYXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNb25DdHgsIGhkZF9tb25Qb3N0TXNnQ2IpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJmYWlsZWQgdG8gcG9zdCBNT04gTU9ERSBSRVEiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtYWdpYyA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICByZXQgPSAtRUlPOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgd2FpdFJldCA9IHdhaXRfZm9yX2NvbXBsZXRpb25fdGltZW91dCgmY21wVmFyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1PTl9NT0RFX01TR19USU1FT1VUKTsKKyAgICAgICAgICAgICAgICAgICAgbWFnaWMgPSAwOworICAgICAgICAgICAgICAgICAgICBpZiAod2FpdFJldCA8PSAwICkgeworICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoImZhaWxlZCB0byB3YWl0IG9uIG1vbml0b3IgbW9kZSBjb21wbGV0aW9uICVsZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3YWl0UmV0KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgfQorICAgICAgICAgICB9CisgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFdFX1NFVF9NT05JVE9SX01PREVfRklMVEVSOgorICAgICAgICAgICB7CisgICAgICAgICAgICAgICB2X1UzMl90IG1hZ2ljID0gMDsKKyAgICAgICAgICAgICAgIHN0cnVjdCBjb21wbGV0aW9uIGNtcFZhcjsKKyAgICAgICAgICAgICAgIGxvbmcgd2FpdFJldCA9IDA7CisKKyAgICAgICAgICAgICAgIHBNb25DdHggPSAgV0xBTl9IRERfR0VUX01PTklUT1JfQ1RYX1BUUihwQWRhcHRlcik7CisgICAgICAgICAgICAgICBpZiggcE1vbkN0eCA9PSBOVUxMICkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCAiTW9uaXRvciBDb250ZXh0IE5VTEwiKTsKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgLyogSW5wdXQgVmFsaWRhdGlvbiBQYXJ0IG9mIEZXICovCisgICAgICAgICAgICAgICBwTW9uQ3R4LT5udW1PZk1hY0ZpbHRlcnM9MTsKKyAgICAgICAgICAgICAgIHBNb25DdHgtPm1tRmlsdGVyc1swXS5tYWNBZGRyLmJ5dGVzWzBdPWFwcHNfYXJnc1swXTsKKyAgICAgICAgICAgICAgIHBNb25DdHgtPm1tRmlsdGVyc1swXS5tYWNBZGRyLmJ5dGVzWzFdPWFwcHNfYXJnc1sxXTsKKyAgICAgICAgICAgICAgIHBNb25DdHgtPm1tRmlsdGVyc1swXS5tYWNBZGRyLmJ5dGVzWzJdPWFwcHNfYXJnc1syXTsKKyAgICAgICAgICAgICAgIHBNb25DdH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KCZtYWdpYywgJmNtcFZhciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1vbkN0eCwgaGRkX21vblBvc3RNc2dDYikpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoImZhaWxlZCB0byBwb3N0IE1PTiBNT0RFIFJFUSIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1hZ2ljID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldCA9IC1FSU87CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB3YWl0UmV0ID0gd2FpdF9mb3JfY29tcGxldGlvbl90aW1lb3V0KCZjbXBWYXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTU9OX01PREVfTVNHX1RJTUVPVVQpOworICAgICAgICAgICAgICAgICAgICBtYWdpYyA9IDA7CisgICAgICAgICAgICAgICAgICAgIGlmICh3YWl0UmV0IDw9IDAgKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiZmFpbGVkIHRvIHdhaXQgb24gbW9uaXRvciBtb2RlIGNvbXBsZXRpb24gJWxkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdhaXRSZXQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgIH0KKyAgICAgICAgIGJyZWFrOworCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsICIlczogSW52YWxpZCBJT0NUTCBjb21tYW5kICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHN1Yl9jbWQgKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgIH0KKyAgICBFWElUKCk7CisgICAgcmV0dXJuIDA7Cit9CisKK3N0YXRpYyBpbnQgaXdfaGRkX3NldF92YXJfaW50c19nZXRub25lKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICAgaW50IHJldDsKKyAgICB1bmlvbiBpd3JlcV9kYXRhIHVfcHJpdl93cnF1OworICAgIGludCBhcHBzX2FyZ3NbTUFYX1ZBUl9BUkdTXSA9IHswfTsKKyAgICBpbnQgbnVtX2FyZ3M7CisKKyAgICBpZiAoIWNhcGFibGUoQ0FQX05FVF9BRE1JTikpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIEZMKCJwZXJtaXNzaW9uIGNoZWNrIGZhaWxlZCIpKTsKKyAgICAgICAgcmV0dXJuIC1FUEVSTTsKKyAgICB9CisKKyAgICAvKiBoZWxwZXIgZnVuY3Rpb24gdG8gZ2V0IGl3cmVxX2RhdGEgd2l0aCBjb21wYXQgaGFuZGxpbmcuICovCisgICAgaWYgKGhkZF9wcml2X2dldF9kYXRhKCZ1X3ByaXZfd3JxdS5kYXRhLCB3cnF1KSkKKyAgICB7CisgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgaWYgKE5VTEwgPT0gdV9wcml2X3dycXUuZGF0YS5wb2ludGVyKQorICAgIHsKKyAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBOVUxMIGRhdGEgcG9pbnRlciIsIF9fZnVuY19fKTsKKyAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBudW1fYXJncyA9IHVfcHJpdl93cnF1LmRhdGEubGVuZ3RoOworICAgIGlmIChudW1fYXJncyA+IE1BWF9WQVJfQVJHUykKKyAgICB7CisgICAgICAgbnVtX2FyZ3MgPSBNQVhfVkFSX0FSR1M7CisgICAgfQorCisgICAgaWYgKGNvcHlfZnJvbV91c2VyKGFwcHNfYXJncywgdV9wcml2X3dycXUuZGF0YS5wb2ludGVyLAorICAgICAgICAgICAgICAgICAgICAgICAoc2l6ZW9mKGludCkpICogbnVtX2FyZ3MpKQorICAgIHsKKyAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBmYWlsZWQgdG8gY29weSBkYXRhIGZyb20gdXNlciBidWZmZXIiLCBfX2Z1bmNfXyk7CisgICAgICAgcmV0dXJuIC1FRkFVTFQ7CisgICAgfQorCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X3NldF92YXJfaW50c19nZXRub25lKGRldiwgaW5mbywgJnVfcHJpdl93cnF1LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNoYXIgKikmYXBwc19hcmdzKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCitpbnQgaXdfc2V0X3Zhcl9pbnRzX2dldG5vbmUoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X3NldF92YXJfaW50c19nZXRub25lKGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQgX19pd19hZGRfdHNwZWMoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcjsKKyAgIGhkZF9zdGF0aW9uX2N0eF90ICpwSGRkU3RhQ3R4OworICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgIGhkZF93bGFuX3dtbV9zdGF0dXNfZSAqcFN0YXR1cyA9IChoZGRfd2xhbl93bW1fc3RhdHVzX2UgKilleHRyYTsKKyAgIGludCBwYXJhbXNbSEREX1dMQU5fV01NX1BBUkFNX0NPVU5UXTsKKyAgIHNtZV9Rb3NXbW1Uc3BlY0luZm8gdFNwZWM7CisgICB2X1UzMl90IGhhbmRsZTsKKyAgIHN0cnVjdCBpd19wb2ludCBzX3ByaXZfZGF0YTsKKyAgIGludCByZXQgPSAwOworCisgICBFTlRFUigpOworICAgcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgIGlmIChOVUxMID09I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XTsKKworICAgLy8gdmFsaWRhdGUgdGhlIGRpcmVjdGlvbgorICAgc3dpdGNoIChwYXJhbXNbSEREX1dMQU5fV01NX1BBUkFNX0RJUkVDVElPTl0pCisgICB7CisgICBjYXNlIEhERF9XTEFOX1dNTV9ESVJFQ1RJT05fVVBTVFJFQU06CisgICAgICB0U3BlYy50c19pbmZvLmRpcmVjdGlvbiA9IFNNRV9RT1NfV01NX1RTX0RJUl9VUExJTks7CisgICAgICBicmVhazsKKworICAgY2FzZSBIRERfV0xBTl9XTU1fRElSRUNUSU9OX0RPV05TVFJFQU06CisgICAgICB0U3BlYy50c19pbmZvLmRpcmVjdGlvbiA9IFNNRV9RT1NfV01NX1RTX0RJUl9ET1dOTElOSzsKKyAgICAgIGJyZWFrOworCisgICBjYXNlIEhERF9XTEFOX1dNTV9ESVJFQ1RJT05fQklESVJFQ1RJT05BTDoKKyAgICAgIHRTcGVjLnRzX2luZm8uZGlyZWN0aW9uID0gU01FX1FPU19XTU1fVFNfRElSX0JPVEg7CisgICAgICBicmVhazsKKworICAgZGVmYXVsdDoKKyAgICAgIC8vIHVua25vd24KKyAgICAgICpwU3RhdHVzID0gSEREX1dMQU5fV01NX1NUQVRVU19TRVRVUF9GQUlMRURfQkFEX1BBUkFNOworICAgICAgcmV0dXJuIDA7CisgICB9CisKKyAgIHRTcGVjLnRzX2luZm8ucHNiID0gcGFyYW1zW0hERF9XTEFOX1dNTV9QQVJBTV9BUFNEXTsKKworICAgLy8gdmFsaWRhdGUgdGhlIHVzZXIgcHJpb3JpdHkKKyAgIGlmIChwYXJhbXNbSEREX1dMQU5fV01NX1BBUkFNX1VTRVJfUFJJT1JJVFldID49IFNNRV9RT1NfV01NX1VQX01BWCkKKyAgIHsKKyAgICAgIC8vIG91dCBvZiByYW5nZQorICAgICAgKnBTdGF0dXMgPSBIRERfV0xBTl9XTU1fU1RBVFVTX1NFVFVQX0ZBSUxFRF9CQURfUEFSQU07CisgICAgICByZXR1cm4gMDsKKyAgIH0K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BuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgdW5pb24gaXdyZXFfZGF0YSAqd3JxdSwgY2hhciAqZXh0cmEpCit7CisgICBpbnQgcmV0OworCisgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgcmV0ID0gX19pd19kZWxfdHNwZWMoZGV2LCBpbmZvLCB3cnF1LCBleHRyYSk7CisgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgIHJldHVybiByZXQ7Cit9CisKKworc3RhdGljIGludCBfX2l3X2dldF90c3BlYyhzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyOworICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgIGludCAqcGFyYW1zID0gKGludCAqKWV4dHJhOworICAgaGRkX3dsYW5fd21tX3N0YXR1c19lICpwU3RhdHVzID0gKGhkZF93bGFuX3dtbV9zdGF0dXNfZSAqKWV4dHJhOworICAgdl9VMzJfdCBoYW5kbGU7CisgICBpbnQgcmV0ID0gMDsKKworICAgRU5URVIoKTsKKworICAgLy8gYWx0aG91Z2ggd2UgYXJlIGRlZmluZWQgdG8gYmUgYSAiZ2V0IiBpb2N0bCwgdGhlIHBhcmFtcyB3ZSByZXF1aXJlCisgICAvLyB3aWxsIGZpdCBpbiB0aGUgaXdyZXFfZGF0YSwgdGhlcmVmb3JlIHVubGlrZSBpd19hZGRfdHNwZWMoKSB0aGVyZQorICAgLy8gaXMgbm8gbmVlZCB0byBjb3B5IHRoZSBwYXJhbXMgZnJvbSB1c2VyIHNwYWNlCisgICBwQWRhcHRlciA9IFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogQWRhcHRlciBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICB9CisKKyAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgIHJldCA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICBpZiAoMCAhPSByZXQpCisgICB7CisgICAgICAgcmV0dXJuIHJldDsKKyAgIH0KKyAgIC8vIHZhbGlkYXRlIHRoZSBoYW5kbGUKKyAgIGhhbmRsZSA9IHBhcmFtc1tIRERfV0xBTl9XTU1fUEFSQU1fSEFORExFXTsKKyAgIGlmIChIRERfV01NX0hBTkRMRV9JTVBMSUNJVCA9PSBoYW5kbGUpCisgICB7CisgICAgICAvLyB0aGF0IG9uZSBpcyByZXNlcnZlZAorICAgICAgKnBTdGF0dXMgPSBIRERfV0xBTl9XTU1fU1RBVFVTX1NFVFVQX0ZBSUxFRF9CQURfUEFSQU07CisgICAgICByZXR1cm4gMDsKKyAgIH0KKworICAgKnBTdGF0dXMgPSBoZGRfd21tX2NoZWNrdHMocEFkYXB0ZXIsIGhhbmRsZSk7CisgICBFWElUKCk7CisgICByZXR1cm4gMDsKK30KKworc3RhdGljIGludCBpd19nZXRfdHNwZWMoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd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hkZEN0eCk7CisgICAgaWYgKDAgIT0gcmV0X3ZhbCkKKyAgICB7CisgICAgICAgIHJldHVybiByZXRfdmFsOworICAgIH0KKyAgICBoSGFsID0gV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpOworICAgIGlmIChOVUxMID09IGhIYWwpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogSGFsIENvbnRleHQgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgaWYgKEhERF9NVUxUSUNBU1RfRklMVEVSX0xJU1QgPT0gcFJlcXVlc3QtPm1jYXN0QmNhc3RGaWx0ZXJTZXR0aW5nKQorICAgIHsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfUEFDS0VUX0ZJTFRFUklORworCisgICAgICAgIG1jX2FkZHJfbGlzdF9wdHIgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpclJjdkZsdE1jQWRkckxpc3QpKTsKKyAgICAgICAgaWYgKE5VTEwgPT0gbWNfYWRkcl9saXN0X3B0cikKKyAgICAgICAgeworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiJXM6IHZvc19tZW1fYWxsb2MgZmFpbGVkIiwgX19mdW5jX18pOworICAgICAgICAgICAgcmV0dXJuIC1FTk9NRU07CisgICAgICAgIH0KKworICAgICAgICBtY19hZGRyX2xpc3RfcHRyLT51bE11bHRpY2FzdEFkZHJDbnQgPSBwUmVxdWVzdC0+bWNhc3RfYWRkcl9jbnQ7CisKKyAgICAgICAgaWYgKG1jX2FkZHJfbGlzdF9wdHItPnVsTXVsdGljYXN0QWRkckNudCA+IEhERF9NQVhfTlVNX01VTFRJQ0FTVF9BRERSRVNTKQorICAgICAgICAgICAgbWNfYWRkcl9saXN0X3B0ci0+dWxNdWx0aWNhc3RBZGRyQ250ID0gSEREX01BWF9OVU1fTVVMVElDQVNUX0FERFJFU1M7CisKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICIlcyBNQyBBZGRyIExpc3QgQ250ICVkIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICBtY19hZGRyX2xpc3RfcHRyLT51bE11bHRpY2FzdEFkZHJDbnQpOworCisgICAgICAgIGZvciAoaWR4ID0gMDsgaWR4IDwgbWNfYWRkcl9saXN0X3B0ci0+dWxNdWx0aWNhc3RBZGRyQ250OyBpZHgrKykKKyAgICAgICAgeworICAgICAgICAgICAgbWVtY3B5KCZtY19hZGRyX2xpc3RfcHRyLT5tdWx0aWNhc3RBZGRyW2lkeF0sCisgICAgICAgICAgICAgICAgICAgcFJlcXVlc3QtPm11bHRpY2FzdEFkZHJbaWR4XSwgSEREX1dMQU5fTUFDX0FERFJfTEVOKTsKKworICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICIlcyBNQyBBZGRyIGZvciBJZHggJWQgPSJNQUNfQUREUkVTU19TVFIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgIGlkeCwgTUFDX0FERFJfQVJSQVkobWNfYWRkcl9saXN0X3B0ci0+bXVsdGljYXN0QWRkcltpZHhdKSk7CisgICAgICAgIH0KKworICAgICAgICByZXRfdmFsID0gc21lXzgwMjNNdWx0aWNhc3RMaXN0KGhIYWwsIHBBZGFwdGVyLT5zZXNzaW9uSWQsIG1jX2FkZHJfbGlzdF9wdHIpOworICAgICAgICB2b3NfbWVtX2ZyZWUobWNfYWRkcl9saXN0X3B0cik7CisgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHJldF92YWwpCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogRmFpbHVyZSB0byBTZXQgTUMgQWRkcmVzcyBMaXN0IiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgfQorI2VuZGlmIC8vV0xBTl9GRUFUVVJFX1BBQ0tFVF9GSUxURVJJTkcKKyAgICB9CisgICAgZWxzZQorICAgIHsKKworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICIlczogU2V0IE1DIEJDIEZpbHRlciBDb25maWcgcmVxdWVzdDogJWQgc3VzcGVuZCAlZCIsCisgICAgICAgICAgICAgICBfX2Z1bmNfXywgcFJlcXVlc3QtPm1jYXN0QmNhc3RGaWx0ZXJTZXR0aW5nLAorICAgICAgICAgICAgICAgcEhkZEN0eC0+aGRkX3dsYW5fc3VzcGVuZGVkKTsKKworICAgICAgICBwSGRkQ3R4LT5jb25maWd1cmVkTWNhc3RCY2FzdEZpbHRlciA9IHBSZXF1ZXN0LT5tY2FzdEJjYXN0RmlsdGVyU2V0dGluZzsKKworICAgICAgICBpZiAocEhkZEN0eC0+aGRkX3dsYW5fc3VzcGVuZGVkKQorICAgICAgICB7CisgICAgICAgICAgICB3bGFuUnhwRmlsdGVyUGFyYW0gPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpcldsYW5TZXRSeHBGaWx0ZXJzKSk7CisgICAgICAgICAgICBpZiAoTlVMTCA9PSB3bGFuUnhwRmlsdGVyUGFyYW0pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiB2b3NfbWVtX2FsbG9jIGZhaWxlZCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgd2xhblJ4cEZpbHRlclBhcmFtLT5jb25maWd1cmVkTWNzdEJjc3RGaWx0ZXJTZXR0aW5nID0KKyAgICAgICAgICAgICAgICBwUmVxdWVzdC0+bWNhc3RCY2FzdEZpbHRlclNldHRpbmc7CisgICAgICAgICAgICB3bGFuUnhwRmlsdGVyUGFyYW0tPnNldE1jc3RCY3N0RmlsdGVyID0gVFJVRTsKKworICAgICAgICAgICAgaGRkX2NvbmZfaG9zdG9mZmxvYWQocEFkYXB0ZXIsIFRSVUUpOworICAgICAgICAgICAgd2xhblJ4cEZpbHRlclBhcmFtLT5jb25maWd1cmVkTWNzdEJjc3RGaWx0ZXJTZXR0aW5nID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+Y29uZmlndXJlZE1jYXN0QmNhc3RGaWx0ZXI7CisKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIiVzOk1DL0JDIGNoYW5nZWQgUmVxICVkIFNldCAlZCBFbiAlZCIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+Y29uZmlndXJlZE1jYXN0QmNhc3RGaWx0ZXIsCisgICAgICAgICAgICAgICAgICAgd2xhblJ4cEZpbHRlclBhcmFtLT5jb25maWd1cmVkTWNzdEJjc3RGaWx0ZXJTZXR0aW5nLAorICAgICAgICAgICAgICAgICAgIHdsYW5SeHBGaWx0ZXJQYXJhbS0+c2V0TWNzdEJjc3RGaWx0ZXIpOworCisgICAgICAgICAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPQorICAgICAgICAgICAgICAgICAgICBzbWVfQ29uZmlndXJlUnhwRmlsdGVyKFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3bGFuUnhwRmlsdGVyUGFyYW0pKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICIlczogRmFpbHVyZSB0byBleGVjdXRlIHNldCBIVyBNQy9CQyBGaWx0ZXIgcmVxdWVzdCIsCisgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUod2xhblJ4cEZpbHRlclBhcmFtKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKFZPU19UUlVFID09IHBIZGRDdHgtPnN1c19yZXNfbWNhc3RiY2FzdF9maWx0ZXJfdmFsaWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcEhkZEN0eC0+c3VzX3Jlc19tY2FzdGJjYXN0X2ZpbHRlciA9CisgICAgICAgICAgICAgICAgICAgICAgICAgcFJlcXVlc3QtPm1jYXN0QmNhc3RGaWx0ZXJTZXR0aW5nOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgRVhJVCgpOworICAgIHJldHVybiAwOworfQorCitzdGF0aWMgaW50IGl3X3NldF9keW5hbWljX21jYmNfZmlsdGVyKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9faXdfc2V0X2R5bmFtaWNfbWNiY19maWx0ZXIoZGV2LCBpbmZvLCB3cnF1LCBleHRyYSk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBfX2l3X2NsZWFyX2R5bmFtaWNfbWNiY19maWx0ZXIoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcjsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgIHRwU2lyV2xhblNldFJ4cEZpbHRlcnMgd2xhblJ4cEZpbHRlclBhcmFtOworICAgIGludCByZXQgPSAwOworCisgICAgRU5URVIoKTsKKworICAgIGlmICghY2FwYWJsZShDQVBfTkVUX0FETUlOKSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgRkwoInBlcm1pc3Npb24gY2hlY2sgZmFpbGVkIikpOworICAgICAgICByZXR1cm4gLUVQRVJNOworICAgIH0KKworICAgIHBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogQWRhcHRlciBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0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WNzdEJjc3RGaWx0ZXJTZXR0aW5nID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT5jb25maWd1cmVkTWNhc3RCY2FzdEZpbHRlcjsKKworICAgICAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPQorICAgICAgICAgICAgICAgICAgc21lX0NvbmZpZ3VyZVJ4cEZpbHRlcihXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdsYW5SeHBGaWx0ZXJQYXJhbSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgIiVzOiBGYWlsdXJlIHRvIGV4ZWN1dGUgc2V0IEhXIE1DL0JDIEZpbHRlciByZXF1ZXN0IiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUod2xhblJ4cEZpbHRlclBhcmFtKTsKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICB9CisKKyAgICAgICAgaWYgKFZPU19UUlVFID09IHBIZGRDdHgtPnN1c19yZXNfbWNhc3RiY2FzdF9maWx0ZXJfdmFsaWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBIZGRDdHgtPnN1c19yZXNfbWNhc3RiY2FzdF9maWx0ZXIgPQorICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+Y2ZnX2luaS0+bWNhc3RCY2FzdEZpbHRlclNldHRpbmc7CisgICAgICAgIH0KKworICAgIH0KKyAgICBFWElUKCk7CisgICAgcmV0dXJuIDA7Cit9CisKKworc3RhdGljIGludCBpd19jbGVhcl9keW5hbWljX21jYmNfZmlsdGVyKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X2NsZWFyX2R5bmFtaWNfbWNiY19maWx0ZXIoZGV2LCBpbmZvLCB3cnF1LCBleHRyYSk7CisgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBfX2l3X3NldF9ob3N0X29mZmxvYWQoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcjsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworICAgIHRwSG9zdE9mZmxvYWRSZXF1ZXN0IHBSZXF1ZXN0ID0gKHRwSG9zdE9mZmxvYWRSZXF1ZXN0KSBleHRyYTsKKyAgICB0U2lySG9zdE9mZmxvYWRSZXEgb2ZmbG9hZFJlcXVlc3Q7CisgICAgaW50IHJldCA9IDA7CisKKyAgICBFTlRFUigpOworCisgICAgcEFkYXB0ZXIgPSBXTEFOX0hERF9HRVRfUFJJVl9QVFIoZGV2KTsKKyAgICBpZiAoTlVMTCA9PSBwQWRhcHRlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBBZGFwdGVyIGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHJldCkKKyAgICB7CisgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorCisgICAgLyogRGVidWcgZGlzcGxheSBvZiByZXF1ZXN0IGNvbXBvbmVudHMuICovCisgICAgc3dpdGNoIChwUmVxdWVzdC0+b2ZmbG9hZFR5cGUpCisgICAgeworICAgICAgICBjYXNlIFdMQU5fSVBWNF9BUlBfUkVQTFlfT0ZGTE9BRDoKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfV0FSTiwgIiVzOiBIb3N0IG9mZmxvYWQgcmVxdWVzdDogQVJQIHJlcGx5IiwgX19mdW5jX18pOworICAgICAgICAgICAgc3dpdGNoIChwUmVxdWVzdC0+ZW5hYmxlT3JEaXNhYmxlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNhc2UgV0xBTl9PRkZMT0FEX0RJU0FCTEU6CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfV0FSTiwgIiAgIGRpc2FibGUiKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBXTEFOX09GRkxPQURfQVJQX0FORF9CQ19GSUxURVJfRU5BQkxFOgorICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX1dBUk4sICIgICBCQyBGaWx0ZXJpbmcgZW5hYmxlIik7CisgICAgICAgICAgICAgICAgY2FzZSBXTEFOX09GRkxPQURfRU5BQkxFOgorICAgICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX1dBUk4sICIgICBBUlAgb2ZmbG9hZCBlbmFibGUiKTsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9XQVJOLCAiICAgSVAgYWRkcmVzczogJWQuJWQuJWQuJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSZXF1ZXN0LT5wYXJhbXMuaG9zdElwdjRBZGRyWzBdLCBwUmVxdWVzdC0+cGFyYW1zLmhvc3RJcHY0QWRkclsxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUmVxdWVzdC0+cGFyYW1zLmhvc3RJcHY0QWRkclsyXSwgcFJlcXVlc3QtPnBhcmFtcy5ob3N0SXB2NEFkZHJbM10pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICBjYXNlIFdMQU5fSVBWNl9ORUlHSEJPUl9ESVNDT1ZFUllfT0ZGTE9BRDoKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICIlczogSG9zdCBvZmZsb2FkIHJlcXVlc3Q6IG5laWdoYm9yIGRpc2NvdmVyeSIsCisgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgIHN3aXRjaCAocFJlcXVlc3QtPmVuYWJsZU9yRGlzYWJsZSkKKyAgICAgICAgeworICAgICAgICBjYXNlIFdMQU5fT0ZGTE9BRF9ESVNBQkxFOgorICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICIgICBkaXNhYmxlIik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBXTEFOX09GRkxPQURfRU5BQkxFOgorICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICIgICBlbmFibGUiKTsKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiICAgSVAgYWRkcmVzczogJXg6JXg6JXg6JXg6JXg6JXg6JXg6JXgiLAorICAgICAgICAgICAgICAgICAgICoodl9VMTZfdCAqKShwUmVxdWVzdC0+cGFyYW1zLmhvc3RJcHY2QWRkciksCisgICAgICAgICAgICAgICAgICAgKih2X1UxNl90ICopKHBSZXF1ZXN0LT5wYXJhbXMuaG9zdElwdjZBZGRyICsgMiksCisgICAgICAgICAgICAgICAgICAgKih2X1UxNl90ICopKHBSZXF1ZXN0LT5wYXJhbXMuaG9zdElwdjZBZGRyICsgNCksCisgICAgICAgICAgICAgICAgICAgKih2X1UxNl90ICopKHBSZXF1ZXN0LT5wYXJhbXMuaG9zdElwdjZBZGRyICsgNiksCisgICAgICAgICAgICAgICAgICAgKih2X1UxNl90ICopKHBSZXF1ZXN0LT5wYXJhbXMuaG9zdElwdjZBZGRyICsgOCksCisgICAgICAgICAgICAgICAgICAgKih2X1UxNl90ICopKHBSZXF1ZXN0LT5wYXJhbXMuaG9zdElwdjZBZGRyICsgMTApLAorICAgICAgICAgICAgICAgICAgICoodl9VMTZfdCAqKShwUmVxdWVzdC0+cGFyYW1zLmhvc3RJcHY2QWRkciArIDEyKSwKKyAgICAgICAgICAgICAgICAgICAqKHZfVTE2X3QgKikocFJlcXVlc3QtPnBhcmFtcy5ob3N0SXB2NkFkZHIgKyAxNCkpOworICAgICAgICB9CisgICAgfQorCisgICAgLyogRXhlY3V0ZSBvZmZsb2FkIHJlcXVlc3QuIFRoZSByZWFzb24gdGhhdCB3ZSBjYW4gY29weSB0aGUgcmVxdWVzdCBpbmZvcm1hdGlvbgorICAgICAgIGZyb20gdGhlIGlvY3RsIHN0cnVjdHVyZSB0byB0aGUgU01FIHN0cnVjdHVyZSBpcyB0aGF0IHRoZXkgYXJlIGxhaWQgb3V0CisgICAgICAgZXhhY3RseSB0aGUgc2FtZS4gIE90aGVyd2lzZSwgZWFjaCBwaWVjZSBvZiBpbmZvcm1hdGlvbiB3b3VsZCBoYXZlIHRvIGJlCisgICAgICAgY29waWVkIGluZGl2aWR1YWxseS4gKi8KKyAgICBtZW1jcHkoJm9mZmxvYWRSZXF1ZXN0LCBwUmVxdWVzdCwgd3JxdS0+ZGF0YS5sZW5ndGgpOworICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHNtZV9TZXRIb3N0T2ZmbG9hZChXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwgJm9mZmxvYWRSZXF1ZXN0KSkKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogRmFpbHVyZSB0byBleGVjdXRlIGhvc3Qgb2ZmbG9hZCByZXF1ZXN0IiwKKyAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgRVhJVCgpOworICAgIHJldHVybiAwOworfQorCitzdGF0aWMgaW50IGl3X3NldF9ob3N0X29mZmxvYWQoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9faXdfc2V0X2hvc3Rfb2ZmbG9hZChkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IF9faXdfc2V0X2tlZXBhbGl2ZV9wYXJhbXMoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgdHBLZWVwQWxpdmVSZXF1ZXN0IHBSZXF1ZXN0ID0gKHRwS2VlcEFsaXZlUmVxdWVzdCkgZXh0cmE7CisgICAgdFNpcktlZXBBbGl2ZVJlcSBrZWVwYWxpdmVSZXF1ZXN0OworICAgIGludCByZXQgPSAwOworCisgICAgRU5URVIoKTsKKyAgICBwQWRhcHRlciA9IFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIHJldCA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gcmV0KQorICAgIHsKKyAgICAgICAgcmV0dXJuIHJldDsKKyAgICB9CisgICAgLyogRGVidWcgZGlzcGxheSBvZiByZXF1ZXN0IGNvbXBvbmVudHMuICovCisgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAiJXM6IFNldCBLZWVwIEFsaXZlIFJlcXVlc3QgOiBUaW1lUGVyaW9kICVkIHNpemUgJXp1IiwKKyAgICAgICAgICAgX19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REQgQ29udGV4dCBQYXNzZWQiKSk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIGlmIChwSGRkQ3R4LT5pc0xvZ3BJblByb2dyZXNzKQorICAgIHsKKyAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6TE9HUCBpbiBQcm9ncmVzcy4gSWdub3JlISEhIiwgX19mdW5jX18pOworICAgICAgIHJldHVybiAtRUJVU1k7CisgICAgfQorCisgICAgaWYgKHBIZGRDdHgtPmNmZ19pbmktPmRpc2FibGVQYWNrZXRGaWx0ZXIpCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogUGFja2V0IEZpbHRlcmluZyBEaXNhYmxlZC4gUmV0dXJuaW5nICIsCisgICAgICAgICAgICAgICAgX19mdW5jX18gKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorCisgICAgc3dpdGNoIChmaWx0ZXJUeXBlKQorICAgIHsKKyAgICAgICAgLyogRm9yIHNldHRpbmcgSVBWNiBNQyBhbmQgVUMgRmlsdGVyIHdlIG5lZWQgdG8gY29uZmlndXJlCisgICAgICAgICAqIDIgZmlsdGVycywgb25lIGZvciBNQyBhbmQgb25lIGZvciBVQy4KKyAgICAgICAgICogVGhlIEZpbHRlciBJRCBzaG91bGRuJ3QgYmUgc3dhcHBlZCwgd2hpY2ggcmVzdWx0cyBpbiBtYWtpbmcKKyAgICAgICAgICogVUMgRmlsdGVyIGluZWZmZWN0aXZlLgorICAgICAgICAgKiBXZSBoYXZlIEhhcmRjb2RlIGFsbCB0aGUgdmFsdWVzCisgICAgICAgICAqCisgICAgICAgICAqIFJlYXNvbiBmb3IgYSBzZXBlcmF0ZSBVQyBmaWx0ZXIgaXMgYmVjYXVzZSwgZHJpdmVyIG5lZWQgdG8KKyAgICAgICAgICogc3BlY2lmeSB0aGUgRlcgdGhhdCB0aGUgc3BlY2lmaWMgZmlsdGVyIGlzIGZvciB1bmljYXN0CisgICAgICAgICAqIG90aGVyd2lzZSBGVyB3aWxsIG5vdCBwYXNzIHRoZSB1bmljYXN0IGZyYW1lcyBieSBkZWZhdWx0CisgICAgICAgICAqIHRocm91Z2ggdGhlIGZpbHRlci4gVGhpcyBpcyByZXF1aXJlZCB0byBhdm9pZCBhbnkgcGVyZm9ybWFuY2UKKyAgICAgICAgICogaGl0cyB3aGVuIG5vIHVuaWNhc3QgZmlsdGVyIGlzIHNldCBhbmQgb25seSBNQy9CQyBhcmUgc2V0LgorICAgICAgICAgKiBUaGUgd2F5IGRyaXZlciBpbmZvcm1zIGhvc3QgaXMgYnkgdXNpbmcgdGhlIE1BQyBwcm90b2NvbAorICAgICAgICAgKiBsYXllciwgQ01QIGZsYWcgc2V0IHRvIE1BWCwgQ01QIERhdGEgc2V0IHRvIDEuCisgICAgICAgICAqLworCisgICAgY2FzZSBIRERfRklMVEVSX0lQVjZfTUNfVUM6CisgICAgICAgIC8qIFNldHRpbmcgSVBWNiBNQyBGaWx0ZXIgYmVsb3cKKyAgICAgICAgICovCisgICAgICAgIHBhY2tldEZpbHRlclNldFJlcS5maWx0ZXJUeXBlID0gSEREX1JDVl9GSUxURVJfU0VUOworICAgICAgICBwYWNrZXRGaWx0ZXJTZXRSZXEuZmlsdGVySWQgPSBIRERfRklMVEVSX0lEX0lQVjZfTUM7CisgICAgICAgIHBhY2tldEZpbHRlclNldFJlcS5udW1GaWVsZFBhcmFtcyA9IDI7CisgICAgICAgIHBhY2tldEZpbHRlclNldFJlcS5wYXJhbXNEYXRhWzBdLnByb3RvY29sTGF5ZXIgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIRERfRklMVEVSX1BST1RPX1RZUEVfTUFDOworICAgICAgICBwYWNrZXRGaWx0ZXJTZXRSZXEucGFyYW1zRGF0YVswXS5jbXBGbGFnID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEREX0ZJTFRFUl9DTVBfVFlQRV9OT1RfRVFVQUw7CisgICAgICAgIHBhY2tldEZpbHRlclNldFJlcS5wYXJhbXNEYXRhWzBdLmRhdGFPZmZzZXQgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOX0hERF84MDIxMV9GUk1fREFfT0ZGU0VUOworICAgICAgICBwYWNrZXRGaWx0ZXJTZXRSZXEucGFyYW1zRGF0YVswXS5kYXRhTGVuZ3RoID0gMTsKKyAgICAgICAgcGFja2V0RmlsdGVyU2V0UmVxLnBhcmFtc0RhdGFbMF0uY29tcGFyZURhdGFbMF0gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIRERfSVBWNl9NQ19DTVBfREFUQTsKKworICAgICAgICBwYWNrZXRGaWx0ZXJTZXRSZXEucGFyYW1zRGF0YVsxXS5wcm90b2NvbExheWVyID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEREX0ZJTFRFUl9QUk9UT19UWVBFX0FSUDsKKyAgICAgICAgcGFja2V0RmlsdGVyU2V0UmVxLnBhcmFtc0RhdGFbMV0uY21wRmxhZyA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhERF9GSUxURVJfQ01QX1RZUEVfTk9UX0VRVUFMOworICAgICAgICBwYWNrZXRGaWx0ZXJTZXRSZXEucGFyYW1zRGF0YVsxXS5kYXRhT2Zmc2V0ID0gRVRIX0FMRU47CisgICAgICAgIHBhY2tldEZpbHRlclNldFJlcS5wYXJhbXNEYXRhWzFdLmRhdGFMZW5ndGggPSAyOworICAgICAgICBwYWNrZXRGaWx0ZXJTZXRSZXEucGFyYW1zRGF0YVsxXS5jb21wYXJlRGF0YVswXSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhERF9JUFY2X0NNUF9EQVRBXzA7CisgICAgICAgIHBhY2tldEZpbHRlclNldFJlcS5wYXJhbXNEYXRhWzFdLmNvbXBhcmVEYXRhWzFdID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEREX0lQVjZfQ01QX0RBVEFfMTsKKworCisgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHNtZV9SZWNlaXZlRmlsdGVyU2V0RmlsdGVyKHBIZGRDdHgtPmhIYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcGFja2V0RmlsdGVyU2V0UmVxLCBzZXNzaW9uSWQpKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiJXM6IEZhaWx1cmUgdG8gZXhlY3V0ZSBTZXQgSVB2NiBNdWxpY2FzdCBGaWx0ZXIiLAorICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgfQorCisgICAgICAgIG1lbXNldCggJnBhY2tldEZpbHRlclNldFJlcSwgMCwgc2l6ZW9mKHRTaXJSY3ZQa3RGaWx0ZXJDZmdUeXBlKSk7CisKKyAgICAgICAgLyoKKyAgICAgICAgICogU2V0dGluZyBJUFY2IFVDIEZpbHRlciBiZWxvdworICAgICAgICAgKi8KKyAgICAgICAgcGFja2V0RmlsdGVyU2V0UmVxLmZpbHRlclR5cGUgPSBIRERfUkNWX0ZJTFRFUl9TRVQ7CisgICAgICAgIHBhY2tldEZpbHRlclNldFJlcS5maWx0ZXJJZCA9IEhERF9GSUxURVJfSURfSVBWNl9VQzsKKyAgICAgICAgcGFja2V0RmlsdGVyU2V0UmVxLm51bUZpZWxkUGFyYW1zID0gMjsKKyAgICAgICAgcGFja2V0RmlsdGVyU2V0UmVxLnBhcmFtc0RhdGFbMF0ucHJvdG9jb2xMYXllciA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhERF9GSUxURVJfUFJPVE9fVFlQRV9NQUM7CisgICAgICAgIHBhY2tldEZpbHRlclNldFJlcS5wYXJhbXNEYXRhWzBdLmNtcEZsYWcgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIRERfRklMVEVSX0NNUF9UWVBFX01BWDsKKyAgICAgICAgcGFja2V0RmlsdGVyU2V0UmVxLnBhcmFtc0RhdGFbMF0uZGF0YU9mZnNldCA9IDA7CisgICAgICAgIHBhY2tldEZpbHRlclNldFJlcS5wYXJhbXNEYXRhWzBdLmRhdGFMZW5ndGggPSAxOworICAgICAgICBwYWNrZXRGaWx0ZXJTZXRSZXEucGFyYW1zRGF0YVswXS5jb21wYXJlRGF0YVswXSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhERF9JUFY2X1VDX0NNUF9EQVRBOworCisgICAgICAgIHBhY2tldEZpbHRlclNldFJlcS5wYXJhbXNEYXRhWzFdLnByb3RvY29sTGF5ZXIgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIRERfRklMVEVSX1BST1RPX1RZUEVfQVJQOworICAgICAgICBwYWNrZXRGaWx0ZXJTZXRSZXEucGFyYW1zRGF0YVsxXS5jbXBGbGFnID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEREX0ZJTFRFUl9DTVBfVFlQRV9OT1RfRVFVQUw7CisgICAgICAgIHBhY2tldEZpbHRlclNldFJlcS5wYXJhbXNEYXRhWzFdLmRhdGFPZmZzZXQgPSBFVEhfQUxFTjsKKyAgICAgICAgcGFja2V0RmlsdGVyU2V0UmVxLnBhcmFtc0RhdGFbMV0uZGF0YUxlbmd0aCA9IDI7CisgICAgICAgIHBhY2tldEZpbHRlclNldFJlcS5wYXJhbXNEYXRhWzFdLmNvbXBhcmVEYXRhWzBdID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEREX0lQVjZfQ01QX0RBVEFfMDsKKyAgICAgICAgcGFja2V0RmlsdGVyU2V0UmVxLnBhcmFtc0RhdGFbMV0uY29tcGFyZURhdGFbMV0gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIRERfSVBWNl9DTVBfREFUQV8xOworCisgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHNtZV9SZWNlaXZlRmlsdGVyU2V0RmlsdGVyKHBIZGRDdHgtPmhIYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcGFja2V0RmlsdGVyU2V0UmVxLCBzZXNzaW9uSWQpKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiJXM6IEZhaWx1cmUgdG8gZXhlY3V0ZSBTZXQgSVB2NiBVbmljYXN0IEZpbHRlciIsCisgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICB9CisKKyAgICAgICAgYnJlYWs7CisKKyAgICBjYXNlIEhERF9GSUxURVJfSVBWNl9NQzoKKyAgICAgICAgLyoKKyAgICAgICAgICogSVBWNiBVQyBGaWx0ZXIgbWlnaHQgYmUgYWxyZWFkeSBzZXQsCisgICAgICAgICAqIGNsZWFyIHRoZSBVQyBGaWx0ZXIuIEFzIHRoZSBGaWx0ZXIKKyAgICAgICAgICogSURzIGFyZSBzdGF0aWMsIHdlIGNhbiBkaXJlY3RseSBjbGVhciBpdC4KKyAgICAgICAgICovCisgICAgICAgIHBhY2tldEZpbHRlclNldFJlcS5maWx0ZXJUeXBlID0gSEREX1JDVl9GSUxURVJfU0VUOworICAgICAgICBwYWNrZXRGaWx0ZXJDbHJSZXEuZmlsdGVySWQgPSBIRERfRklMVEVSX0lEX0lQVjZfVUM7CisgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHNtZV9SZWNlaXZlRmlsdGVyQ2xlYXJGaWx0ZXIocEhkZEN0eC0+aEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwYWNrZXRGaWx0ZXJDbHJSZXEsIHNlc3Npb25JZCkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICIlczogRmFpbHVyZSB0byBleGVjdXRlIENsZWFyIElQdjYgVW5pY2FzdCBGaWx0ZXIiLAorICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgfQorCisgICAgICAgIC8qCisgICAgICAgICAqIFNldHRpbmcgSVBWNiBNQyBGaWx0ZXIgYmVsb3cKKyAgICAgICAgICovCisgICAgICAgIHBhY2tldEZpbHRlclNldFJlcS5maWx0ZXJJZCA9IEhERF9GSUxURVJfSURfSVBWNl9NQzsKKyAgICAgICAgcGFja2V0RmlsdGVyU2V0UmVxLm51bUZpZWxkUGFyYW1zID0gMjsKKyAgICAgICAgcGFja2V0RmlsdGVyU2V0UmVxLnBhcmFtc0RhdGFbMF0ucHJvdG9jb2xMYXllciA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhERF9GSUxURVJfUFJPVE9fVFlQRV9NQUM7CisgICAgICAgIHBhY2tldEZpbHRlclNldFJlcS5wYXJhbXNEYXRhWzBdLmNtcEZsYWcgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIRERfRklMVEVSX0NNUF9UWVBFX05PVF9FUVVBTDsKKyAgICAgICAgcGFja2V0RmlsdGVyU2V0UmVxLnBhcmFtc0RhdGFbMF0uZGF0YU9mZnNldCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5fSEREXzgwMjExX0ZSTV9EQV9PRkZTRVQ7CisgICAgICAgIHBhY2tldEZpbHRlclNldFJlcS5wYXJhbXNEYXRhWzBdLmRhdGFMZW5ndGggPSAxOworICAgICAgICBwYWNrZXRGaWx0ZXJTZXRSZXEucGFyYW1zRGF0YVswXS5jb21wYXJlRGF0YVswXSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhERF9JUFY2X01DX0NNUF9EQVRBOworCisgICAgICAgIHBhY2tldEZpbHRlclNldFJlcS5wYXJhbXNEYXRhWzFdLnByb3RvY29sTGF5ZXIgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIRERfRklMVEVSX1BST1RPX1RZUEVfQVJQOworICAgICAgICBwYWNrZXRGaWx0ZXJTZXRSZXEucGFyYW1zRGF0YVsxXS5jbXBGbGFnID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEREX0ZJTFRFUl9DTVBfVFlQRV9OT1RfRVFVQUw7CisgICAgICAgIHBhY2tldEZpbHRlclNldFJlcS5wYXJhbXNEYXRhWzFdLmRhdGFPZmZzZXQgPSBFVEhfQUxFTjsKKyAgICAgICAgcGFja2V0RmlsdGVyU2V0UmVxLnBhcmFtc0RhdGFbMV0uZGF0YUxlbmd0aCA9IDI7CisgICAgICAgIHBhY2tldEZpbHRlclNldFJlcS5wYXJhbXNEYXRhWzFdLmNvbXBhcmVEYXRhWzBdID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEREX0lQVjZfQ01QX0RBVEFfMDsKKyAgICAgICAgcGFja2V0RmlsdGVyU2V0UmVxLnBhcmFtc0RhdGFbMV0uY29tcGFyZURhdGFbMV0gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIRERfSVBWNl9DTVBfREFUQV8xOworCisKKyAgICAgICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gc21lX1JlY2VpdmVGaWx0ZXJTZXRGaWx0ZXIocEhkZEN0eC0+aEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwYWNrZXRGaWx0ZXJTZXRSZXEsIHNlc3Npb25JZCkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICIlczogRmFpbHVyZSB0byBleGVjdXRlIFNldCBJUHY2IE11bHRpY2FzdCBGaWx0ZXIiLAorICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKworICAgIGRlZmF1bHQgOgorICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAiJXM6IFBhY2tldCBGaWx0ZXIgUmVxdWVzdDogSW52YWxpZCIsCisgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgcmV0dXJuIDA7Cit9CisKK3ZvaWQgd2xhbl9oZGRfc2V0X21jX2FkZHJfbGlzdChoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwgdl9VOF90IHNldCkKK3sKKyAgICB2X1U4X3QgaTsKKyAgICB0cFNpclJjdkZsdE1jQWRkckxpc3QgcE11bHRpY2FzdEFkZHJzID0gTlVMTDsKKyAgICB0SGFsSGFuZGxlIGhIYWwgPSBOVUxMOworICAgIGhkZF9jb250ZXh0X3QqIHBIZGRDdHggPSAoaGRkX2NvbnRleHRfdCopcEFkYXB0ZXItPnBIZGRDdHg7CisKKyAgICBpZiAoTlVMTCA9PSBwSGRkQ3R4KQorICAgIHsKKyAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoIkhERCBDVFggaXMgTlVMTCIpKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGhIYWwgPSBwSGRkQ3R4LT5oSGFsOworCisgICAgaWYgKE5VTEwgPT0gaEhhbCkKKyAgICB7CisgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJIQUwgSGFuZGxlIGlzIE5VTEwiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICAvKiBDaGVjayBpZiBJTkkgaXMgZW5hYmxlZCBvciBub3QsIG90aGVyIHdpc2UganVzdCByZXR1cm4KKyAgICAgKi8KKyAgICBpZiAocEhkZEN0eC0+Y2ZnX2luaS0+ZkVuYWJsZU1DQWRkckxpc3QpCisgICAgeworICAgICAgICBwTXVsdGljYXN0QWRkcnMgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpclJjdkZsdE1jQWRkckxpc3QpKTsKKyAgICAgICAgaWYgKE5VTEwgPT0gcE11bHRpY2FzdEFkZHJzKQorICAgICAgICB7CisgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgiQ291bGQgbm90IGFsbG9jYXRlIE1lbW9yeSIpKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChzZXQpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIEZvbGxvd2luZyBwcmUtY29uZGl0aW9ucyBzaG91bGQgYmUgc2F0aXNmaWVkIGJlZm9yZSB3ZWkKKyAgICAgICAgICAgICAqIGNvbmZpZ3VyZSB0aGUgTUMgYWRkcmVzcyBsaXN0LgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBpZiAoKChwQWRhcHRlci0+ZGV2aWNlX21vZGUgPT0gV0xBTl9IRERfSU5GUkFfU1RBVElPTikgfHwKKyAgICAgICAgICAgICAgIChwQWRhcHRlci0+ZGV2aWNlX21vZGUgPT0gV0xBTl9IRERfUDJQX0NMSUVOVCkpCisgICAgICAgICAgICAgICAmJiBwQWRhcHRlci0+bWNfYWRkcl9saXN0Lm1jX2NudAorICAgICAgICAgICAgICAgJiYgKGVDb25uZWN0aW9uU3RhdGVfQXNzb2NpYXRlZCA9PQorICAgICAgICAgICAgICAgKFdMQU5fSEREX0dFVF9TVEFUSU9OX0NUWF9QVFIocEFkYXB0ZXIpKS0+Y29ubl9pbmZvLmNvbm5TdGF0ZSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcE11bHRpY2FzdEFkZHJzLT51bE11bHRpY2FzdEFkZHJDbnQgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPm1jX2FkZHJfbGlzdC5tY19jbnQ7CisgICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHBBZGFwdGVyLT5tY19hZGRyX2xpc3QubWNfY250OyBpKyspCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBtZW1jcHkocE11bHRpY2FzdEFkZHJzLT5tdWx0aWNhc3RBZGRyW2ldLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5tY19hZGRyX2xpc3QuYWRkcltpXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YocEFkYXB0ZXItPm1jX2FkZHJfbGlzdC5hZGRyW2ldKSk7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVzIG11bHRpY2FzdCBmaWx0ZXI6IGFkZHIgPSIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHNldCA/ICJzZXR0aW5nIiA6ICJjbGVhcmluZyIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocE11bHRpY2FzdEFkZHJzLT5tdWx0aWNhc3RBZGRyW2ldKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8qIFNldCBtdWx0aWNhc3QgZmlsdGVyICovCisgICAgICAgICAgICAgICAgc21lXzgwMjNNdWx0aWNhc3RMaXN0KGhIYWwsIHBBZGFwdGVyLT5zZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNdWx0aWNhc3RBZGRycyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvKiBOZWVkIHRvIGNsZWFyIG9ubHkgaWYgaXQgd2FzIHByZXZpb3VzbHkgY29uZmlndXJlZAorICAgICAgICAgICAgICovCisgICAgICAgICAgICBpZiAocEFkYXB0ZXItPm1jX2FkZHJfbGlzdC5pc0ZpbHRlckFwcGxpZWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcE11bHRpY2FzdEFkZHJzLT51bE11bHRpY2FzdEFkZHJDbnQgPSAwOworICAgICAgICAgICAgICAgIHNtZV84MDIzTXVsdGljYXN0TGlzdChoSGFsLCBwQWRhcHRlci0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTXVsdGljYXN0QWRkcnMpOworICAgICAgICAgICAgfQorCisgICAgICAgIH0KKyAgICAgICAgcEFkYXB0ZXItPm1jX2FkZHJfbGlzdC5pc0ZpbHRlckFwcGxpZWQgPSBzZXQgPyBUUlVFIDogRkFMU0U7CisgICAgICAgIHZvc19tZW1fZnJlZShwTXVsdGljYXN0QWRkcnMpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgRkwoImdNQ0FkZHJMaXN0RW5hYmxlIGlzIG5vdCBlbmFibGVkIGluIElOSSIpKTsKKyAgICB9CisgICAgcmV0dXJuOworfQorCitzdGF0aWMgaW50IF9faXdfc2V0X3BhY2tldF9maWx0ZXJfcGFyYW1zKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgdHBQYWNrZXRGaWx0ZXJDZmcgcFJlcXVlc3QgPSBOVUxMOworICAgIGludCByZXQgPSAwOworICAgIHN0cnVjdCBpd19wb2ludCBzX3ByaXZfZGF0YTsKKworICAgIEVOVEVSKCk7CisKKyAgICBpZiAoIWNhcGFibGUoQ0FQX05FVF9BRE1JTikpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIEZMKCJwZXJtaXNzaW9uIGNoZWNrIGZhaWxlZCIpKTsKKyAgICAgICAgcmV0dXJuIC1FUEVSTTsKKyAgICB9CisKKyAgICBwQWRhcHRlciA9IFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIHJldCA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gcmV0KQorICAgIHsKKyAgICAgICAgcmV0dXJuIHJldDsKKyAgICB9CisgICAgaWYgKGhkZF9wcml2X2dldF9kYXRhKCZzX3ByaXZfZGF0YSwgd3JxdSkpCisgICAgeworICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIGlmICgoTlVMTCA9PSBzX3ByaXZfZGF0YS5wb2ludGVyKSB8fCAoMCA9PSBzX3ByaXZfZGF0YS5sZW5ndGgpKQorICAgIHsKKyAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICAvKiBPREQgbnVtYmVyIGlzIHVzZWQgZm9yIHNldCwgY29weSBkYXRhIHVzaW5nIGNvcHlfZnJvbV91c2VyICovCisgICAgcFJlcXVlc3QgPSBtZW1fYWxsb2NfY29weV9mcm9tX3VzZXJfaGVscGVyKHNfcHJpdl9kYXRhLnBvaW50ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNfcHJpdl9kYXRhLmxlbmd0aCk7CisgICAgaWYgKE5VTEwgPT0gcFJlcXVlc3QpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICJtZW1fYWxsb2NfY29weV9mcm9tX3VzZXJfaGVscGVyIGZhaWwiKTsKKyAgICAgICAgcmV0dXJuIC1FTk9NRU07CisgICAgfQorCisgICAgcmV0ID0gd2xhbl9oZGRfc2V0X2ZpbHRlcihXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSwgcFJlcXVlc3QsIHBBZGFwdGVyLT5zZXNzaW9uSWQpOworICAgIGtmcmVlKHBSZXF1ZXN0KTsKKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMg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ICB8CisgICAgICAgICAgICAgICAgICAgICAgIFNNRV9HTE9CQUxfQ0xBU1NBX1NUQVRTIHwKKyAgICAgICAgICAgICAgICAgICAgICAgU01FX0dMT0JBTF9DTEFTU0JfU1RBVFMgfAorICAgICAgICAgICAgICAgICAgICAgICBTTUVfR0xPQkFMX0NMQVNTQ19TVEFUUyB8CisgICAgICAgICAgICAgICAgICAgICAgIFNNRV9HTE9CQUxfQ0xBU1NEX1NUQVRTIHwKKyAgICAgICAgICAgICAgICAgICAgICAgU01FX1BFUl9TVEFfU1RBVFMsCisgICAgICAgICAgICAgICAgICAgICAgIGhkZF9TdGF0aXN0aWNzQ0IsIDAsIEZBTFNFLAorICAgICAgICAgICAgICAgICAgICAgICAoV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlcikpLT5jb25uX2luZm8uc3RhSWRbMF0sIHBBZGFwdGVyICk7CisKKyAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpCisgICAgeworICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICIlczogVW5hYmxlIHRvIHJldHJpZXZlIFNNRSBzdGF0aXN0aWNzIiwKKyAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICBwV2V4dFN0YXRlID0gV0xBTl9IRERfR0VUX1dFWFRfU1RBVEVfUFRSKHBBZGFwdGVyKTsKKyAgICBpZiAoTlVMTCA9PSBwV2V4dFN0YXRlKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IHBXZXh0U3RhdGUgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisKKyAgICB2b3Nfc3RhdHVzID0gdm9zX3dhaXRfc2luZ2xlX2V2ZW50KCZwV2V4dFN0YXRlLT52b3NldmVudCwgV0xBTl9XQUlUX1RJTUVfU1RBVFMpOworICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc19zdGF0dXMpKQorICAgIHsKKyAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAiJXM6IFNNRSB0aW1lb3V0IHdoaWxlIHJldHJpZXZpbmcgc3RhdGlzdGljcyIsCisgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAvKlJlbW92ZSB0aGUgU01FIHN0YXRpc3RpY3MgbGlzdCBieSBwYXNzaW5nIE5VTEwgaW4gY2FsbGJhY2sgYXJndW1lbnQqLworICAgICAgIHN0YXR1cyA9IHNtZV9HZXRTdGF0aXN0aWNzKCBwSGRkQ3R4LT5oSGFsLCBlQ1NSX0hERCwKKyAgICAgICAgICAgICAgICAgICAgICAgU01FX1NVTU1BUllfU1RBVFMgICAgICB8CisgICAgICAgICAgICAgICAgICAgICAgIFNNRV9HTE9CQUxfQ0xBU1NBX1NUQVRTIHwKKyAgICAgICAgICAgICAgICAgICAgICAgU01FX0dMT0JBTF9DTEFTU0JfU1RBVFMgfAorICAgICAgICAgICAgICAgICAgICAgICBTTUVfR0xPQkFMX0NMQVNTQ19TVEFUUyB8CisgICAgICAgICAgICAgICAgICAgICAgIFNNRV9HTE9CQUxfQ0xBU1NEX1NUQVRTIHwKKyAgICAgICAgICAgICAgICAgICAgICAgU01FX1BFUl9TVEFfU1RBVFMsCisgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsIDAsIEZBTFNFLAorICAgICAgICAgICAgICAgICAgICAgICAoV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlcikpLT5jb25uX2luZm8uc3RhSWRbMF0sIHBBZGFwdGVyICk7CisKKyAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgRklMTF9UTFYocCwgKHRBTklfVTgpV0xBTl9TVEFUU19SRVRSWV9DTlQsCisgICAgICAgICAgICAgICh0QU5JX1U4KSBzaXplb2YgKHBTdGF0cy0+cmV0cnlfY250KSwKKyAgICAgICAgICAgICAgKGNoYXIqKSAmKHBTdGF0cy0+cmV0cnlfY250WzBdKSwKKyAgICAgICAgICAgICAgdGxlbik7CisKKyAgICBGSUxMX1RMVihwLCAodEFOSV9VOClXTEFOX1NUQVRTX01VTF9SRVRSWV9DTlQsCisgICAgICAgICAgICAgICh0QU5JX1U4KSBzaXplb2YgKHBTdGF0cy0+bXVsdGlwbGVfcmV0cnlfY250KSwKKyAgICAgICAgICAgICAgKGNoYXIqKSAmKHBTdGF0cy0+bXVsdGlwbGVfcmV0cnlfY250WzBdKSwKKyAgICAgICAgICAgICAgdGxlbik7CisKKyAgICBGSUxMX1RMVihwLCAodEFOSV9VOClXTEFOX1NUQVRTX1RYX0ZSTV9DTlQsCisgICAgICAgICAgICAgICh0QU5JX1U4KSBzaXplb2YgKHBTdGF0cy0+dHhfZnJtX2NudCksCisgICAgICAgICAgICAgIChjaGFyKikgJihwU3RhdHMtPnR4X2ZybV9jbnRbMF0pLAorICAgICAgICAgICAgICB0bGVuKTsKKworICAgIEZJTExfVExWKHAsICh0QU5JX1U4KVdMQU5fU1RBVFNfUlhfRlJNX0NOVCwKKyAgICAgICAgICAgICAgKHRBTklfVTgpIHNpemVvZiAocFN0YXRzLT5yeF9mcm1fY250KSwKKyAgICAgICAgICAgICAgKGNoYXIqKSAmKHBTdGF0cy0+cnhfZnJtX2NudCksCisgICAgICAgICAgICAgIHRsZW4pOworCisgICAgRklMTF9UTFYocCwgKHRBTklfVTgpV0xBTl9TVEFUU19GUk1fRFVQX0NOVCwKKyAgICAgICAgICAgICAgKHRBTklfVTgpIHNpemVvZiAocFN0YXRzLT5mcm1fZHVwX2NudCksCisgICAgICAgICAgICAgIChjaGFyKikgJihwU3RhdHMtPmZybV9kdXBfY250KSwKKyAgICAgICAgICAgICAgdGxlbik7CisKKyAgICBGSUxMX1RMVihwLCAodEFOSV9VOClXTEFOX1NUQVRTX0ZBSUxfQ05ULAorICAgICAgICAgICAgICAodEFOSV9VOCkgc2l6ZW9mIChwU3RhdHMtPmZhaWxfY250KSwKKyAgICAgICAgICAgICAgKGNoYXIqKSAmKHBTdGF0cy0+ZmFpbF9jbnRbMF0pLAorICAgICAgICAgICAgICB0bGVuKTsKKworICAgIEZJTExfVExWKHAsICh0QU5JX1U4KVdMQU5fU1RBVFNfUlRTX0ZBSUxfQ05ULAorICAgICAgICAgICAgICAodEFOSV9VOCkgc2l6ZW9mIChwU3RhdHMtPnJ0c19mYWlsX2NudCksCisgICAgICAgICAgICAgIChjaGFyKikgJihwU3RhdHMtPnJ0c19mYWlsX2NudCksCisgICAgICAgICAgICAgIHRsZW4pOworCisgICAgRklMTF9UTFYocCwgKHRBTklfVTgpV0xBTl9TVEFUU19BQ0tfRkFJTF9DTlQsCisgICAgICAgICAgICAgICh0QU5JX1U4KSBzaXplb2YgKHBTdGF0cy0+YWNrX2ZhaWxfY250KSwKKyAgICAgICAgICAgICAgKGNoYXIqKSAmKHBTdGF0cy0+YWNrX2ZhaWxfY250KSwKKyAgICAgICAgICAgICAgdGxlbik7CisKKyAgICBGSUxMX1RMVihwLCAodEFOSV9VOClXTEFOX1NUQVRTX1JUU19TVUNfQ05ULAorICAgICAgICAgICAgICAodEFOSV9VOCkgc2l6ZW9mIChwU3RhdHMtPnJ0c19zdWNjX2NudCksCisgICAgICAgICAgICAgIChjaGFyKikgJihwU3RhdHMtPnJ0c19zdWNjX2NudCksCisgICAgICAgICAgICAgIHRsZW4pOworCisgICAgRklMTF9UTFYocCwgKHRBTklfVTgpV0xBTl9TVEFUU19SWF9ESVNDQVJEX0NOVCwKKyAgICAgICAgICAgICAgKHRBTklfVTgpIHNpemVvZiAocFN0YXRzLT5yeF9kaXNjYXJkX2NudCksCisgICAgICAgICAgICAgIChjaGFyKikgJihwU3RhdHMtPnJ4X2Rpc2NhcmRfY250KSwKKyAgICAgICAgICAgICAgdGxlbik7CisKKyAgICBGSUxMX1RMVihwLCAodEFOSV9VOClXTEFOX1NUQVRTX1JYX0VSUk9SX0NOVCwKKyAgICAgICAgICAgICAgKHRBTklfVTgpIHNpemVvZiAocFN0YXRzLT5yeF9lcnJvcl9jbnQpLAorICAgICAgICAgICAgICAoY2hhciopICYocFN0YXRzLT5yeF9lcnJvcl9jbnQpLAorICAgICAgICAgICAgICB0bGVuKTsKKworICAgIEZJTExfVExWKHAsICh0QU5JX1U4KVdMQU5fU1RBVFNfVFhfQllURV9DTlQsCisgICAgICAgICAgICAgICh0QU5JX1U4KSBzaXplb2YgKGRTdGF0cy0+dHhfdWNfYnl0ZV9jbnRbMF0pLAorICAgICAgICAgICAgICAoY2hhciopICYoZFN0YXRzLT50eF91Y19ieXRlX2NudFswXSksCisgICAgICAgICAgICAgIHRsZW4pOworCisgICAgRklMTF9UTFYocCwgKHRBTklfVTgpV0xBTl9TVEFUU19SWF9CWVRFX0NOVCwKKyAgICAgICAgICAgICAgKHRBTklfVTgpIHNpemVvZiAoZFN0YXRzLT5yeF9ieXRlX2NudCksCisgICAgICAgICAgICAgIChjaGFyKikgJihkU3RhdHMtPnJ4X2J5dGVfY250KSwKKyAgICAgICAgICAgICAgdGxlbik7CisKKyAgICBGSUxMX1RMVihwLCAodEFOSV9VOClXTEFOX1NUQVRTX1JYX1JBVEUsCisgICAgICAgICAgICAgICh0QU5JX1U4KSBzaXplb2YgKGRTdGF0cy0+cnhfcmF0ZSksCisgICAgICAgICAgICAgIChjaGFyKikgJihkU3RhdHMtPnJ4X3JhdGUpLAorICAgICAgICAgICAgICB0bGVuKTsKKworICAgIC8qIFRyYW5zbWl0IHJhdGUsIGluIHVuaXRzIG9mIDUwMCBrYml0L3NlYyAqLworICAgIEZJTExfVExWKHAsICh0QU5JX1U4KVdMQU5fU1RBVFNfVFhfUkFURSwKKyAgICAgICAgICAgICAgKHRBTklfVTgpIHNpemVvZiAoYVN0YXRzLT50eF9yYXRlKSwKKyAgICAgICAgICAgICAgKGNoYXIqKSAmKGFTdGF0cy0+dHhfcmF0ZSksCisgICAgICAgICAgICAgIHRsZW4pOworCisgICAgRklMTF9UTFYocCwgKHRBTklfVTgpV0xBTl9TVEFUU19SWF9VQ19CWVRFX0NOVCwKKyAgICAgICAgICAgICAgKHRBTklfVTgpIHNpemVvZiAoZFN0YXRzLT5yeF91Y19ieXRlX2NudFswXSksCisgICAgICAgICAgICAgIChjaGFyKikgJihkU3RhdHMtPnJ4X3VjX2J5dGVfY250WzBdKSwKKyAgICAgICAgICAgICAgdGxlbik7CisgICAgRklMTF9UTFYocCwgKHRBTklfVTgpV0xBTl9TVEFUU19SWF9NQ19CWVRFX0NOVCwKKyAgICAgICAgICAgICAgKHRBTklfVTgpIHNpemVvZiAoZFN0YXRzLT5yeF9tY19ieXRlX2NudCksCisgICAgICAgICAgICAgIChjaGFyKikgJihkU3RhdHMtPnJ4X21jX2J5dGVfY250KSwKKyAgICAgICAgICAgICAgdGxlbik7CisgICAgRklMTF9UTFYocCwgKHRBTklfVTgpV0xBTl9TVEFUU19SWF9CQ19CWVRFX0NOVCwKKyAgICAgICAgICAgICAgKHRBTklfVTgpIHNpemVvZiAoZFN0YXRzLT5yeF9iY19ieXRlX2NudCksCisgICAgICAgICAgICAgIChjaGFyKikgJihkU3RhdHMtPnJ4X2JjX2J5dGVfY250KSwKKyAgICAgICAgICAgICAgdGxlbik7CisgICAgRklMTF9UTFYocCwgKHRBTklfVTgpV0xBTl9TVEFUU19UWF9VQ19CWVRFX0NOVCwKKyAgICAgICAgICAgICAgKHRBTklfVTgpIHNpemVvZiAoZFN0YXRzLT50eF91Y19ieXRlX2NudFswXSksCisgICAgICAgICAgICAgIChjaGFyKikgJihkU3RhdHMtPnR4X3VjX2J5dGVfY250WzBdKSwKKyAgICAgICAgICAgICAgdGxlbik7CisgICAgRklMTF9UTFYocCwgKHRBTklfVTgpV0xBTl9TVEFUU19UWF9NQ19CWVRFX0NOVCwKKyAgICAgICAgICAgICAgKHRBTklfVTgpIHNpemVvZiAoZFN0YXRzLT50eF9tY19ieXRlX2NudCksCisgICAgICAgICAgICAgIChjaGFyKikgJihkU3RhdHMtPnR4X21jX2J5dGVfY250KSwKKyAgICAgICAgICAgICAgdGxlbik7CisgICAgRklMTF9UTFYocCwgKHRBTklfVTgpV0xBTl9TVEFUU19UWF9CQ19CWVRFX0NOVCwKKyAgICAgICAgICAgICAgKHRBTklfVTgpIHNpemVvZiAoZFN0YXRzLT50eF9iY19ieXRlX2NudCksCisgICAgICAgICAgICAgIChjaGFyKikgJihkU3RhdHMtPnR4X2JjX2J5dGVfY250KSwKKyAgICAgICAgICAgICAgdGxlbik7CisKKyAgICB3cnF1LT5kYXRhLmxlbmd0aCA9IHRsZW47CisKKyAgfQorCisgIEVYSVQoKTsKKworICByZXR1cm4gMDsKK30KKworc3RhdGljIGludCBpd19nZXRfc3RhdGlzdGljcyhzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgIGludCByZXQ7CisKKyAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICByZXQgPSBfX2l3X2dldF9zdGF0aXN0aWNzKGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworCisgICByZXR1cm4gcmV0OworfQorI2lmZGVmIEZFQVRVUkVfV0xBTl9TQ0FOX1BOTworCisvKk1heCBMZW4gZm9yIFBOTyBub3RpZmljYXRpb24qLworI2RlZmluZSBNQVhfUE5PX05PVElGWV9MRU4gMTAwCit2b2lkIGZvdW5kX3ByZWZfbmV0d29ya19jYiAodm9p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IGlzIG5vdCB2YWxpZCAlcyIscHRyKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgfQorCisgIGlmICggMCA9PSBwbm9SZXF1ZXN0LmVuYWJsZSApCisgIHsKKyAgICAvKkRpc2FibGUgUE5PKi8KKyAgICBtZW1zZXQoJnBub1JlcXVlc3QsIDAsIHNpemVvZihwbm9SZXF1ZXN0KSk7CisgICAgc3RhdHVzID0gc21lX1NldFByZWZlcnJlZE5ldHdvcmtMaXN0KFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBub1JlcXVlc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvdW5kX3ByZWZfbmV0d29ya19jYiwgcEFkYXB0ZXIpOworICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAiJXM6IGZhaWxlZCB0byBkaXNhYmxlIFBOTyIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgIH0KKyAgICBwSGRkQ3R4LT5pc1Bub0VuYWJsZSA9IEZBTFNFOworICAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgIH0KKworICBpZiAoVFJVRSA9PSBwSGRkQ3R4LT5pc1Bub0VuYWJsZSkKKyAgeworICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgRkwoImFscmVhZHkgUE5PIGlzIGVuYWJsZWQiKSk7C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bm90IHZhbGlkICVzIixwdHIpOworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgfQorCisgICAgaWYgKCggMCA9PSBwbm9SZXF1ZXN0LmFOZXR3b3Jrc1tpXS5zc0lkLmxlbmd0aCApIHx8CisgICAgICAgICggcG5vUmVxdWVzdC5hTmV0d29ya3NbaV0uc3NJZC5sZW5ndGggPiAzMiApICkKKyAgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiU1NJRCBMZW4gJWQgaXMgbm90IGNvcnJlY3QgZm9yIG5ldHdvcmsgJWQiLAorICAgICAgICAgICAgICAgIHBub1JlcXVlc3QuYU5ldHdvcmtzW2ldLnNzSWQubGVuZ3RoLCBpKTsKKyAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorCisgICAgLypBZHZhbmNlIHRvIFNTSUQqLworICAgIHB0ciArPSBuT2Zmc2V0OworCisgICAgbWVtY3B5KHBub1JlcXVlc3QuYU5ldHdvcmtzW2ldLnNzSWQuc3NJZCwgcHRyLAorICAgICAgICAgICBwbm9SZXF1ZXN0LmFOZXR3b3Jrc1tpXS5zc0lkLmxlbmd0aCk7CisgICAgcHRyICs9IHBub1JlcXVlc3QuYU5ldHdvcmtzW2ldLnNzSWQubGVuZ3RoOworCisgICAgdWNQYXJhbXMgPSBzc2NhbmYocHRyLCIldSAldSAlaGh1ICVuIiwKKyAgICAgICAgICAgICAgICAgICAgICAmKHBub1JlcXVlc3QuYU5ldHdvcmtzW2ldLmF1dGhlbnRpY2F0aW9uKSwKKyAgICAgICAgICAgICAgICAgICAgICAmKHBub1JlcXVlc3QuYU5ldHdvcmtzW2ldLmVuY3J5cHRpb24pLAorICAgICAgICAgICAgICAgICAgICAgICYocG5vUmVxdWVzdC5hTmV0d29ya3NbaV0udWNDaGFubmVsQ291bnQpLAorICAgICAgICAgICAgICAgICAgICAgICZuT2Zmc2V0KTsKKworICAgIGlmICggMyAhPSB1Y1BhcmFtcyApCisgICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgICAiSW5jb3JyZWN0IGNtZCAlcyIscHRyKTsKKyAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorCisgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgIlBOTyBsZW4gJWQgc3NpZCAweCUwOHglMDh4JTA4eCUwOHglMDh4JTA4eCUwOHglMDh4IgorICAgICAgICAgICAgICAiYXV0aCAlZCBlbmNyeSAlZCBjaGFubmVsIGNvdW50ICVkIG9mZnNldCAlZCIsCisgICAgICAgICAgICAgIHBub1JlcXVlc3QuYU5ldHdvcmtzW2ldLnNzSWQubGVuZ3RoLAorICAgICAgICAgICAgICAqKCh2X1UzMl90ICopICZwbm9SZXF1ZXN0LmFOZXR3b3Jrc1tpXS5zc0lkLnNzSWRbMF0pLAorICAgICAgICAgICAgICAqKCh2X1UzMl90ICopICZwbm9SZXF1ZXN0LmFOZXR3b3Jrc1tpXS5zc0lkLnNzSWRbNF0pLAorICAgICAgICAgICAgICAqKCh2X1UzMl90ICopICZwbm9SZXF1ZXN0LmFOZXR3b3Jrc1tpXS5zc0lkLnNzSWRbOF0pLAorICAgICAgICAgICAgICAqKCh2X1UzMl90ICopICZwbm9SZXF1ZXN0LmFOZXR3b3Jrc1tpXS5zc0lkLnNzSWRbMTJdKSwKKyAgICAgICAgICAgICAgKigodl9VMzJfdCAqKSAmcG5vUmVxdWVzdC5hTmV0d29ya3NbaV0uc3NJZC5zc0lkWzE2XSksCisgICAgICAgICAgICAgICooKHZfVTMyX3QgKikgJnBub1JlcXVlc3QuYU5ldHdvcmtzW2ldLnNzSWQuc3NJZFsyMF0pLAorICAgICAgICAg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ldHdvcmtzW2ldLmFDaGFubmVsc1tqXSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmbk9mZnNldCkpCisgICAgICAgICAgICB7ICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIlBOTyBuZXR3b3JrIGNoYW5uZWwgaW5wdXQgaXMgbm90IHZhbGlkICVzIixwdHIpOworICAgICAgICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLypBZHZhbmNlIHRvIG5leHQgY2hhbm5lbCBudW1iZXIqLworICAgICAgICAgICAgcHRyICs9IG5PZmZzZXQ7CisgICAgICB9CisgICAgfQorCisgICAgaWYgKDEgIT0gc3NjYW5mKHB0ciwiJXUgJW4iLAorICAgICAgICAgICAgICAgICAgICAmKHBub1JlcXVlc3QuYU5ldHdvcmtzW2ldLmJjYXN0TmV0d1R5cGUpLAorICAgICAgICAgICAgICAgICAgICAmbk9mZnNldCkpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICJQTk8gYnJvYWRjYXN0IG5ldHdvcmsgdHlwZSBpbnB1dCBpcyBub3QgdmFsaWQgJXMiLHB0cik7CisgICAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorCisgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICJQTk8gYmNhc3ROZXR3VHlwZSAlZCBvZmZzZXQgJWQiLAorICAgICAgICAgICAgcG5vUmVxdWVzdC5hTmV0d29ya3NbaV0uYmNhc3ROZXR3VHlwZSwKKyAgICAgICAgICAgIG5PZmZzZXQgKTsKKworICAgIC8qQWR2YW5jZSB0byByc3NpIFRocmVzaG9sZCovCisgICAgcHRyICs9IG5PZmZzZXQ7CisKKyAgICBpZiAoMSAhPSBzc2NhbmYocHRyLCIlaGh1ICVuIiwKKyAgICAgICAgICAgICAgICAgICAgJihwbm9SZXF1ZXN0LmFOZXR3b3Jrc1tpXS5yc3NpVGhyZXNob2xkKSwKKyAgICAgICAgICAgICAgICAgICAgJm5PZmZzZXQpKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiUE5PIHJzc2kgdGhyZXNob2xkIGlucHV0IGlzIG5vdCB2YWxpZCAlcyIscHRyKTsKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICB9CisKKyAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgIlBOTyByc3NpICVkIG9mZnNldCAlZCIsCisgICAgICAgICAgICBwbm9SZXF1ZXN0LmFOZXR3b3Jrc1tpXS5yc3NpVGhyZXNob2xkLAorICAgICAgICAgICAgbk9mZnNldCApOworICAgIC8qQWR2YW5jZSB0byBuZXh0IG5ldHdvcmsqLworICAgIHB0ciArPSBuT2Zmc2V0OworICB9LypGb3IgdWNOZXR3b3JrQ291bnQqLworCisgIHVjUGFyYW1zID0gc3NjYW5mKHB0ciwiJWhodSAlbiIsCisgICAgICAgICAgICAgICAgICAgICYocG5vUmVxdWVzdC5zY2FuVGltZXJzLnVjU2NhblRpbWVyc0NvdW50KSwKKyAgICAgICAgICAgICAgICAgICAgJm5PZmZzZXQpOworCisgIC8qUmVhZCB0aGUgc2NhbiB0aW1lcnMqLworICBpZiAoKCAxID09IHVjUGFyYW1zICkgJiYgKCBwbm9SZXF1ZXN0LnNjYW5UaW1lcnMudWNTY2FuVGltZXJzQ291bnQgPiAwICkpCisgIHsKKyAgICAgcHRyICs9IG5PZm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NJWkUpOworICAgICAgZ290byBlcnJvcjsKKyAgfQorCisgIHZvc19tZW1femVybyhwbm9SZXF1ZXN0LnAyNEdQcm9iZVRlbXBsYXRlLCBTSVJfUE5PX01BWF9QQl9SRVFfU0laRSk7CisgIHZvc19tZW1femVybyhwbm9SZXF1ZXN0LnA1R1Byb2JlVGVtcGxhdGUsIFNJUl9QTk9fTUFYX1BCX1JFUV9TSVpFKTsKKworICBzdGF0dXMgPSBzbWVfU2V0UHJlZmVycmVkTmV0d29ya0xpc3QoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLCAmcG5vUmVxdWVzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXItPnNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm91bmRfcHJlZl9uZXR3b3JrX2NiLCBwQWRhcHRlcik7CisgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTID09IHN0YXR1cykKKyAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICIlczogUE5PIGVuYWJsZWQiLCBfX2Z1bmNfXyk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworICB9CitlcnJvcjoKKyAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IEZhaWxlZCB0byBlbmFibGUgUE5PIiwgX19mdW5jX18pOworICAgIHBIZGRDdHgtPmlzUG5vRW5hYmxlID0gRkFMU0U7CisgICAgaWYgKHBub1JlcXVlc3QuYU5ldHdvcmtzKQorICAgICAgICB2b3NfbWVtX2ZyZWUocG5vUmVxdWVzdC5hTmV0d29ya3MpOworICAgIGlmIChwbm9SZXF1ZXN0LnAyNEdQcm9iZVRlbXBsYXRlKQorICA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pdihzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyOworICAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICAgaW50IHJldCA9IDA7CisgICAgVk9TX1NUQVRVUyBzdGF0dXM7CisKKyAgICBFTlRFUigpOworICAgIHBBZGFwdGVyID0gV0xBTl9IRERfR0VUX1BSSVZfUFRSKGRldik7CisgICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogQWRhcHRlciBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIHBIZGRDdHggPSBXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKTsKKyAgICByZXQgPSB3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpOworICAgIGlmICgwICE9IHJldCkKKyAgICB7CisgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorCisKKyAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICJTZXQgUE5PIFByaXZhdGUiKTsKKworICAgIHN0YXR1cyA9IGl3X3NldF9wbm8oZGV2LGluZm8sd3JxdSxleHRyYSwwKTsKKworICAgIEVYSVQoKTsKKyAgICByZXR1cm4gc3RhdHVzOworfQorCitzdGF0aWMgaW50IGl3X3NldF9wbm9fcHJpdihzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9faXdfc2V0X3Bub19wcml2KGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisjZW5kaWYgLypGRUFUVVJFX1dMQU5fU0NBTl9QTk8qLworCisvL0NvbW1vbiBmdW5jdGlvbiB0byBTZXRCYW5kCitpbnQgaGRkX3NldEJhbmQoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgdTggdWlfYmFuZCkKK3sKKyAgICBoZGRfYWRhcHRlcl90ICpwQWRhcHRlcjsKKyAgICB0SGFsSGFuZGxlIGhIYWw7CisgICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKyAgICBoZGRfc2NhbmluZm9fdCAqcFNjYW5JbmZvID0gTlVMTDsKKyAgICBlQ3NyQmFuZCBiYW5kOworICAgIGludCB3YWl0X3Jlc3VsdDsKKyAgICBlQ3NyQmFuZCBjdXJyQmFuZCA9IGVDU1JfQkFORF9NQVg7CisgICAgZUNzckJhbmQgY29ubmVjdGVkQmFuZDsKKyAgICB0cEFuaVNpckdsb2JhbCBwTWFjOworICAgIGludCByZXR2YWwgPSBTRU5EX0NIQU5ORUxfQ0hBTkdFX0VWRU5UOworCisgICAgRU5URVIoKTsKKyAgICBwQWRhcHRlciA9IFdMQU5fSEREX0dFVF9QUklWX1BUUihkZXYpOworICAgIGlmIChOVUxMID09IHBBZGFwdGVyKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEFkYXB0ZXIgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICB9CisgICAgcEhkZEN0eCA9IFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpOworICAgIHJldHZhbCA9IHdsYW5faGRkX3ZhbGlkYXRlX2NvbnRleHQocEhkZEN0eCk7CisgICAgaWYgKDAgIT0gcmV0dmFsKQorICAgIHsKKyAgICAgICAgcmV0dXJuIHJldHZhbDsKKyAgICB9CisgICAgaEhhbCA9IFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKTsKKyAgICBpZiAoTlVMTCA9PSBoSGFsKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEhhbCBDb250ZXh0IGlzIE5VTEwiLF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgfQorICAgIHBNYWMgPSBQTUFDX1NUUlVDVChoSGFsKTsKKworICAgIHN3aXRjaCh1aV9iYW5kKQorICAgIHsKKyAgICAgICAgY2FzZSBXTEFOX0hERF9VSV9CQU5EX0FVVE86CisgICAgICAgICAgICAgYmFuZCA9IGVDU1JfQkFORF9BTEw7CisgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdMQU5fSEREX1VJX0JBTkRfNV9HSFo6CisgICAgICAgICAgICBiYW5kID0gZUNTUl9CQU5EXzVHOworICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBXTEFOX0hERF9VSV9CQU5EXzJfNF9HSFo6CisgICAgICAgICAgICBiYW5kID0gZUNTUl9CQU5EXzI0OworICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGJhbmQgPSBl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YW5kQ2FwYWJpbGl0eSk7CisgICAgICAgICByZXR1cm4gLUVJTzsKKyAgICB9CisKKyAgICBpZiAoYmFuZCA9PSBlQ1NSX0JBTkRfQUxMKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgRkwoIkF1dG8gQmFuZCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgInJlY2VpdmVkLiBTZXR0aW5nIGJhbmQgc2FtZSBhcyBpbmkgdmFsdWUgJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT5jZmdfaW5pLT5uQmFuZENhcGFiaWxpdHkpOworICAgICAgICBiYW5kID0gcEhkZEN0eC0+Y2ZnX2luaS0+bkJhbmRDYXBhYmlsaXR5OworICAgIH0KKworICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHNtZV9HZXRGcmVxQmFuZChoSGFsLCAmY3VyckJhbmQpKQorICAgIHsKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICIlczogRmFpbGVkIHRvIGdldCBjdXJyZW50IGJhbmQgY29uZmlnIiwKKyAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgcmV0dXJuIC1FSU87CisgICAgfQorCisgICAgaWYgKGN1cnJCYW5kICE9IGJhbmQpCisgICAgeworICAgICAgICBpZiAoIGJhbmQgPT0gZUNTUl9CQU5EXzVHICkKKyAgICAgICAgeworICAgICAgICAgICAgLyogUmV0dXJuIGZhaWx1cmUgaWYgY3VycmVudCBjb3VudHJ5IGNvZGUgaXMgd29ybGQgcmVndWxhdG9yeSBkb21haW4qLworICAgICAgICAgICAgaWYoIChwTWFjLT5zY2FuLmNvdW50cnlDb2RlQ3VycmVudFswXSA9PSAnMCcgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnNjYW4uY291bnRyeUNvZGVDdXJyZW50WzFdID09ICcwJykgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBmYWlsZWQgdG8gc2V0IHRoZSBiYW5kIHZhbHVlIHRvICV1IGFzIGNvdW50cnkgY29kZSBpcyAwMCIsCisgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgYmFuZCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIC1FQUdBSU47CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvKiBDaGFuZ2UgYmFuZCByZXF1ZXN0IHJlY2VpdmVkLgorICAgICAgICAgKiBBYm9ydCBwZW5kaW5nIHNjYW4gcmVxdWVzdHMsIGZsdXNoIHRoZSBleGlzdGluZyBzY2FuIHJlc3VsdHMsCisgICAgICAgICAqIGFuZCBjaGFuZ2UgdGhlIGJhbmQgY2FwYWJpbGl0eQorICAgICAgICAgKi8KKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAiJXM6IEN1cnJlbnQgYmFuZCB2YWx1ZSA9ICV1LCBuZXcgc2V0dGluZyAldSAiLAorICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgY3VyckJhbmQsIGJhbmQpOworCisgICAgICAgIC8qIFdlIG5lZWQgdG8gY2hhbmdlIHRoZSBiYW5kIGFuZCBmbHVzaCB0aGUgc2NhbiByZXN1bHRzIGhlcmUgaXRzZWxmCisgICAgICAgICAqIGFzIHdlIG1heSBnZXQgdGltZW91dCBmb3IgZGlzY29ubmVjdGlvbiBpbiB3aGljaCB3ZSB3aWxsIHJldHVybgorICAgICAgICAgKiB3aXRoIG91dCBkb2luZyBhbnkgb2YgdGhlc2UKKyAgICAgICAgICovCisgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHNtZV9TZXRGcmVxQmFuZChoSGFsLCAoZUNzckJhbmQpYmFuZCkpCisgICAgICAgIHsKKyAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAgICIlczogZmFpbGVkIHRvIHNldCB0aGUgYmFuZCB2YWx1ZSB0byAldSAiLAorICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIGJhbmQpOworICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICB9CisgICAgICAgIGlmKGN1cnJCYW5kID09IGVDU1JfQkFORF8yNCB8fCBjdXJyQmFuZCA9PSBlQ1NSX0JBTkRfNUcpCisgICAgICAgIHsKKyAgICAgICAgICAgICB0QU5JX1U4IGN1cnJfY291bnRyeVtXTklfQ0ZHX0NPVU5UUllfQ09ERV9MRU5dOworICAgICAgICAgICAgIGN1cnJfY291bnRyeVswXT1wTWFjLT5zY2FuLmNvdW50cnlDb2RlQ3VycmVudFswXTsKKyAgICAgICAgICAgICBjdXJyX2NvdW50cnlbMV09cE1hYy0+c2Nhbi5jb3VudHJ5Q29kZUN1cnJlbnRbMV07CisgICAgICAgICAgICAgSU5JVF9DT01QTEVUSU9OKHBIZGRDdHgtPmxpbnV4X3JlZ19yZXEpOworICAgICAgICAgICAgIC8qIEFzIGN1cnJ1bnQgYmFuZCBpcyBhbHJlYWR5IHNldCB0byAyLjRHaHovNUdoeiB3ZSBkb250IGhhdmUgYWxsIGNoYW5uZWwKKyAgICAgICAgICAgICAgKiBpbmZvcm1hdGlvbiBhdmFpbGFibGUgaW4gTlYgc28gdG8gZ2V0IHRoZSBjaGFubmVsIGluZm9ybWF0aW9uIGZyb20ga2VybmVsCisgICAgICAgICAgICAgICogd2UgbmVlZCB0byBzZW5kIHJlZ3VsYXRvcnkgaGludCBmb3IgdGhlIGN1cnJ1bnQgY291bnRyeQorICAgICAgICAgICAgICAqIEFuZCB0byBzZXQgdGhlIHNhbWUgY291bnRyeSBhZ2FpbiB3ZSBuZWVkIHRvIHNldCB0aGUgZHVtbXkgY291bnRyeQorICAgICAgICAgICAgICAqIGZpcnN0IGFuZCB0aGVuIHRoZSBhY3R1YWwgY291bnRyeS4KKyAgICAgICAgICAgICAgKi8KKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsOSwwKSkKKyAgICAgICAgICAgICByZWd1bGF0b3J5X2hpbnRfdXNlcigiMDAiLCBOTDgwMjExX1VTRVJfUkVHX0hJTlRfVVNFUik7CisjZWxzZQorICAgICAgICAgICAgIHJlZ3VsYXRvcnlfaGludF91c2VyKCIwMCIpOworI2VuZGlmCisgICAgICAgICAgICAgd2FpdF9yZXN1bHQgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGVfdGltZW91dCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEhkZEN0eC0+bGludXhfcmVnX3JlcSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKExJTlVYX1JFR19XQUlUX1RJTUUpKTsKKworICAgICAgICAgICAgIC8qIGlmIHRoZSBjb3VudHJ5IGluZm9ybWF0aW9uIGRvZXMgbm90IGV4aXN0IHdpdGggdGhlIGtlcm5lbCwKKyAgICAgICAgICAgICAgIHRoZW4gdGhlIGRyaXZlciBjYWxsYmFjayB3b3VsZCBub3QgYmUgY2FsbGVkICovCisKKyAgICAgICAgICAgICBpZiAod2FpdF9yZXN1bHQgPj0gMCkKKyAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJydW50aW1lIGNvdW50cnkgY29kZSBpcyBmb3VuZCBpbiBrZXJuZWwgZGIiKTsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgInJ1bnRpbWUgY291bnRyeSBjb2RlIGlzIG5vdCBmb3VuZCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIgaW4ga2VybmVsIGRiIik7CisgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5mRW5mb3JjZUNvdW50cnlDb2RlID0gZUFOSV9CT09MRUFOX1RSVUU7CisKKyAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAqIFVwZGF0ZSAxMWRjb3VudHJ5IGFuZCBjdXJyZW50IGNvdW50cnkgaGVyZSBhcyB0aGUgaGludAorICAgICAgICAgICAgICAqIHdpdGggMDAgcmVzdWx0cyBpbiAxMWQgYW5kIGN1cnJlbnQgY291bnRyeSB3aXRoIDAwCisgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBNYWMtPnNjYW4uY291bnRyeUNvZGUxMWQsIGN1cnJfY291bnRyeSwKKyAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX0NPVU5UUllfQ09ERV9MRU4pOworICAgICAgICAgICAgIHZvc19tZW1fY29weShwTWFjLT5zY2FuLmNvdW50cnlDb2RlQ3VycmVudCwgY3Vycl9jb3VudHJ5LAorICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfQ09VTlRSWV9DT0RFX0xFTik7CisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDksMCkpCisgICAgICAgICAgICAgcmVndWxhdG9yeV9oaW50X3VzZXIoY3Vycl9jb3VudHJ5LCBOTDgwMjExX1VTRVJfUkVHX0hJTlRfVVNFUik7CisjZWxzZQorICAgICAgICAgICAgIHJlZ3VsYXRvcnlfaGludF91c2VyKGN1cnJfY291bnRyeSk7CisjZW5kaWYKKyAgICAgICAgICAgICB3YWl0X3Jlc3VsdCA9IHdhaXRfZm9yX2NvbXBsZXRpb25faW50ZXJydXB0aWJsZV90aW1lb3V0KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwSGRkQ3R4LT5saW51eF9yZWdfcmVxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoTElOVVhfUkVHX1dBSVRfVElNRSkpOworCisgICAgICAgICAgICAgLyogaWYgdGhlIGNvdW50cnkgaW5mb3JtYXRpb24gZG9lcyBub3QgZXhpc3Qgd2l0aCB0aGUga2VybmVsLAorICAgICAgICAgICAgICAgdGhlbiB0aGUgZHJpdmVyIGNhbGxiYWNrIHdvdWxkIG5vdCBiZSBjYWxsZWQgKi8KKyAgICAgICAgICAgICBpZiAod2FpdF9yZXN1bHQgPj0gMCkKKyAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJydW50aW1lIGNvdW50cnkgY29kZSBpcyBmb3VuZCBpbiBrZXJuZWwgZGIiKTsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgInJ1bnRpbWUgY291bnRyeSBjb2RlIGlzIG5vdCBmb3VuZCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIgaW4ga2VybmVsIGRiIik7CisgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgcmV0dmFsID0gRE9fTk9UX1NFTkRfQ0hBTk5FTF9DSEFOR0VfRVZFTlQ7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisjaWZkZWYgQ09ORklHX0VOQUJMRV9MSU5VWF9SRUcKKyAgICAgICAgICAgdm9zX3VwZGF0ZV9udl90YWJsZV9mcm9tX3dpcGh5X2JhbmQoKHZvaWQgKilwSGRkQ3R4LAorICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilwSGRkQ3R4LT53aXBoeSwgKGVDc3JCYW5kKWJhbmQpOworI2Vsc2UKKyAgICAgICAgICAgd2xhbl9oZGRfY2ZnODAyMTFfdXBkYXRlX2JhbmQoIHBIZGRDdHgtPndpcGh5LCAoZUNzckJhbmQpYmFuZCApOworI2VuZGlmCisKKyAgICAgICAgfQorICAgICAgICBwU2NhbkluZm8gPSAgJnBIZGRDdHgtPnNjYW5faW5mbzsKKyAgICAgICAgaWYgKChwU2NhbkluZm8gIT0gTlVMTCkgJiYgcEhkZEN0eC0+c2Nhbl9pbmZvLm1TY2FuUGVuZGluZykKKyAgICAgICAgeworICAgICAgICAgICAgIGhkZF9hYm9ydF9tYWNfc2NhbihwSGRkQ3R4LCBwU2NhbkluZm8tPnNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9TQ0FOX0FCT1JUX0RVRV9UT19CQU5EX0NIQU5HRSk7CisgICAgICAgIH0KKyAgICAgICAgc21lX0ZpbHRlclNjYW5SZXN1bHRzKGhIYWwsIHBBZGFwdGVyLT5zZXNzaW9uSWQpOworCisgICAgICAgIGlmIChiYW5kICE9IGVDU1JfQkFORF9BTEwgJiYKKyAgICAgICAgICAgIGhkZF9jb25uSXNDb25uZWN0ZWQoV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlcikpICYmCisgICAgICAgICAgICAoY29ubmVjdGVkQmFuZCAhPSBiYW5kKSkKKyAgICAgICAgeworICAgICAgICAgICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgICBsb25nIGxyYzsKKworICAgICAgICAgICAgIC8qIFNUQSBhbHJlYWR5IGNvbm5lY3RlZCBvbiBjdXJyZW50IGJhbmQsIFNvIGlzc3VlIGRpc2Nvbm5lY3QgZmlyc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAqIHRoZW4gY2hhbmdlIHRoZSBiYW5kKi8KKworICAgICAgICAgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICIlcyBTVEEgY29ubmVjdGVkIGluIGJhbmQgJXUsIENoYW5naW5nIGJhbmQgdG8gJXUsIElzc3VpbmcgRGlzY29ubmVjdC4iCisgICAgICAgICAgICAgICAgICAgICAgICwgX19mdW5jX18sIGNzckdldEN1cnJlbnRCYW5kKGhIYWwpLCBiYW5kKTsKKworICAgICAgICAgICAgIElOSVRfQ09NUExFVElPTihwQWRhcHRlci0+ZGlzY29ubmVjdF9jb21wX3Zhcik7CisKKyAgICAgICAgICAgICBzdGF0dXMgPSBzbWVfUm9hbURpc2Nvbm5lY3QoIFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwKKyAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLCBlQ1NSX0RJU0NPTk5FQ1RfUkVBU09OX1VOU1BFQ0lGSUVEKTsKKworICAgICAgICAgICAgIGlmICggZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICIlcyBjc3JSb2FtRGlzY29ubmVjdCBmYWlsdXJlLCByZXR1cm5lZCAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgKGludClzdGF0dXMgKTsKKyAgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgbHJjID0gd2FpdF9mb3JfY29tcGxldGlvbl9pbnRlcnJ1cHRpYmxlX3RpbWVvdXQoCisgICAgICAgICAgICAgICAgICAgICAmcEFkYXB0ZXItPmRpc2Nvbm5lY3RfY29tcF92YXIsCisgICAgICAgICAgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKFdMQU5fV0FJVF9USU1FX0RJU0NPTk5FQ1QpKTsKKworICAgICAgICAgICAgIGlmIChscmMgPD0gMCkgeworCisgICAgICAgICAgICAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiJXM6ICVzIHdoaWxlIHdhaXRpbmcgZm9yIGNzclJvYW1EaXNjb25uZWN0ICIsCisgICAgICAgICAgICAgICAgIF9fZnVuY19fLCAoMCA9PSBscmMpID8gIlRpbWVvdXQiIDogIkludGVycnVwdCIpOworCisgICAgICAgICAgICAgICAgcmV0dXJuICgwID09IGxyYykgPyAtRVRJTUVET1VUIDogLUVJTlRSOworICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBFWElUKCk7CisgICAgaWYgKFRSVUUgPT0gcEhkZEN0eC0+aXNTZXRCYW5kQnlOTCkKKyAgICAgICAgcmV0dXJuIDA7CisgICAgZWxzZQorICAgICAgICByZXR1cm4gcmV0dmFsOworfQorCitpbnQgaGRkX3NldEJhbmRfaGVscGVyKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsIGNvbnN0IGNoYXIgKmNvbW1hbmQpCit7CisgICAgdTggYmFuZDsKKworICAgIC8qY29udmVydCB0aGUgYmFuZCB2YWx1ZSBmcm9tIGFzY2lpIHRvIGludGVnZXIqLworICAgIGJhbmQgPSBjb21tYW5kW1dMQU5fSEREX1VJX1NFVF9CQU5EX1ZBTFVFX09GRlNFVF0gLSAnMCc7CisKKyAgICByZXR1cm4gaGRkX3NldEJhbmQoZGV2LCBiYW5kKTsKKworfQorCitzdGF0aWMgaW50IF9faXdfc2V0X2JhbmRfY29uZmlnKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGludCAqdmFsdWUgPSAoaW50ICopZXh0cmE7CisKKyAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXM6ICIsIF9fZnVuY19fKTsKKworICAgIGlmICghY2FwYWJsZShDQVBfTkVUX0FETUlOKSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgRkwoInBlcm1pc3Npb24gY2hlY2sgZmFpbGVkIikpOworICAgICAgICByZXR1cm4gLUVQRVJNOworICAgIH0KKworICAgIHJldHVybiBoZGRfc2V0QmFuZChkZXYsIHZhbHVlWzBdKTsKK30KKworc3RhdGljIGludCBpd19zZXRfYmFuZF9jb25maWcoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlvbiBpd3JlcV9kYXRhICp3cnF1LCBjaGFyICpleHRyYSkKK3sKKyAgICBpbnQgcmV0OworCisgICAgdm9zX3Nzcl9wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXQgPSBfX2l3X3NldF9iYW5kX2NvbmZpZyhkZXYsIGluZm8sIHdycXUsIGV4dHJhKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7CisKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IF9faXdfc2V0X3Bvd2VyX3BhcmFtc19wcml2KHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpd19yZXF1ZXN0X2luZm8gKmluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICBpbnQgcmV0OworICBjaGFyICpwdHI7CisKKyAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAiU2V0IHBvd2VyIHBhcmFtcyBQcml2YXRlIik7CisKKyAgaWYgKCFjYXBhYmxlKENBUF9ORVRfQURNSU4pKQorICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICBGTCgicGVybWlzc2lvbiBjaGVjayBmYWlsZWQiKSk7CisgICAgICByZXR1cm4gLUVQRVJNOworICB9CisKKyAgLyogT0REIG51bWJlciBpcyB1c2VkIGZvciBzZXQsIGNvcHkgZGF0YSB1c2luZyBjb3B5X2Zyb21fdXNlciAqLworICBwdHIgPSBtZW1fYWxsb2NfY29weV9mcm9tX3VzZXJfaGVscGVyKHdycXUtPmRhdGEucG9pbnRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdycXUtPmRhdGEubGVuZ3RoKTsKKyAgaWYgKE5VTEwgPT0gcHRyKQorICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAibWVtX2FsbG9jX2NvcHlfZnJvbV91c2VyX2hlbHBlciBmYWlsIik7CisgICAgICByZXR1cm4gLUVOT01FTTsKKyAgfQorCisgIHJldCA9IGl3X3NldF9wb3dlcl9wYXJhbXMoZGV2LCBpbmZvLCB3cnF1LCBwdHIsIDApOworICBrZnJlZShwdHIpOworICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IGl3X3NldF9wb3dlcl9wYXJhbXNfcHJpdihzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGl3X3JlcXVlc3RfaW5mbyAqaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhKQoreworICAgIGludCByZXQ7CisKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIHJldCA9IF9faXdfc2V0X3Bvd2VyX3BhcmFtc19wcml2KGRldiwgaW5mbywgd3JxdSwgZXh0cmEpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKworICAgIHJldHVybiByZXQ7Cit9CisKKy8qc3RyaW5nIGJhc2VkIGlucHV0Ki8KK1ZPU19TVEFUVVMgaXdfc2V0X3Bvd2VyX3BhcmFtcyhzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBzdHJ1Y3QgaXdfcmVxdWVzdF9pbmZvICppbmZvLAorICAgICAgICAgICAgICAgICAgICAgIHVuaW9uIGl3cmVxX2RhdGEgKndycXUsIGNoYXIgKmV4dHJhLCBpbnQgbk9mZnNldCkKK3sKKyAgaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXI7CisgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgIHRTaXJTZXRQb3dlclBhcmFtc1JlcSBwb3dlclJlcXV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gICAgIiVzOiBObyBURExTIENvbm5lY3RlZCBQZWVyIiwgX19mdW5jX18pOworICAgICAgICAgICByZXR1cm4gLTE7CisgICAgICAgfQorICAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+dGRsc19sb2NrKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgIiVzOiBURExTIENvbm5lY3Rpb24gbm90IHN1cHBvcnRlZCIsIF9fZnVuY19fKTsKKyAgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgKCIlczogVERMUyBDaGFubmVsIFN3aXRjaCBpbiBzd21vZGU9JWQiKSwKKyAgICAgICAgICAgICAgIF9fZnVuY19fLCBvZmZjaGFubW9kZSk7CisKKyAgICBzd2l0Y2ggKG9mZmNoYW5tb2RlKQorICAgIHsKKyAgICAgICBjYXNlIDE6LypFbmFibGUqLworICAgICAgIGNhc2UgMjovKkRpc2FibGUqLworICAgICAgIHsKKyAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICIlczogY2hhbmdlIHRkbHMgb2ZmIGNoYW5uZWwgbW9kZSAlZCB0ZGxzX29mZl9jaGFubmVsICVkIG9mZmNoYW5vZmZzZXQgJWQgIiwKKyAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBvZmZjaGFubW9kZSwgdGRsc09mZkNoLCB0ZGxzT2ZmQ2hCd09mZnNldCk7CisgICAgICAgICAgIGlmIChUUlVFID09IHBIZGRDdHgtPmNmZ19pbmktPmZFbmFibGVURExTT2ZmQ2hhbm5lbCkKKyAgICAgICAgICAgeworCisgICAgICAgICAgICAgICBzbWVfU2VuZFRkbHNDaGFuU3dpdGNoUmVxKFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsIGNvbm5QZWVyLT5wZWVyTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGRsc09mZkNoLCB0ZGxzT2ZmQ2hCd09mZnNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZmNoYW5tb2RlKTsKKyAgICAgICAgICAgfQorICAgICAgICAgICBlbHNlCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICIlczogVERMUyBPZmYgQ2hhbm5lbCBub3Qgc3VwcG9ydGVkIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICAgICB9CisgICAgICAgICAgIGJyZWFrOworICAgICAgIH0KKyAgICAgICBjYXNlIDM6CisgICAgICAgeworICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgIiVzOiBjaGFuZ2UgdGRscyBvZmYgY2hhbm5lbCBtb2RlICVkIFJFSlJFUSAzIHRkbHNfb2ZmX2NoYW5uZWwgJWQgb2ZmY2hhbm9mZnNldCAlZCAiLAorICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIG9mZmNoYW5tb2RlLCB0ZGxzT2ZmQ2gsIHRkbHNPZmZDaEJ3T2Zmc2V0KTsKKworICAgICAgICAgICBicmVhazsKKyAgICAgICB9CisgICAgICAgY2FzZSA0OgorICAgICAgIHsKK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1NUQVRFLAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgMSwKKyAgICAgICAgMCwKKyAgICAgICAgInNldDExRHN0YXRlIiB9LAorCisgICAgeyAgIFdFX1dPV0wsCisgICAgICAgIElXX1BSSVZfVFlQRV9JTlQgfCBJV19QUklWX1NJWkVfRklYRUQgfCAxLAorICAgICAgICAwLAorICAgICAgICAid293bCIgfSwKKworICAgIHsgICBXRV9TRVRfUE9XRVIsCisgICAgICAgIElXX1BSSVZfVFlQRV9JTlQgfCBJV19QUklWX1NJWkVfRklYRUQgfCAxLAorICAgICAgICAwLAorICAgICAgICAic2V0UG93ZXIiIH0sCisKKyAgICB7ICAgV0VfU0VUX01BWF9BU1NPQywKKyAgICAgICAgSVdfUFJJVl9UWVBFX0lOVCB8IElXX1BSSVZfU0laRV9GSVhFRCB8IDEsCisgICAgICAgIDAsCisgICAgICAgICJzZXRNYXhBc3NvYyIgfSwKKworICAgIHsgICBXRV9TRVRfU0FQX0FVVE9fQ0hBTk5FTF9TRUxFQ1RJT04sCisgICAgICAgIElXX1BSSVZfVFlQRV9JTlQgfCBJV19QUklWX1NJWkVfRklYRUQgfCAxLAorICAgICAgICAwLAorICAgICAgICAic2V0QXV0b0NoYW5uZWwiIH0sCisKKyAgICB7ICAgV0VfU0VUX0RBVEFfSU5BQ1RJVklUWV9UTywKKyAgICAgICAgSVdfUFJJVl9UWVBFX0lOVCB8IElXX1BSSVZfU0laRV9GSVhFRCB8IDEsCisgICAgICAgIDAsCisgICAgICAgICJpbmFjdGl2aXR5VE8iIH0sCisKKyAgICB7ICAgV0VfU0VUX01BWF9UWF9QT1dFUiwKKyAgICAgICAgSVdfUFJJVl9UWVBFX0lOVCB8IElXX1BSSVZfU0laRV9GSVhFRCB8IDEsCisgICAgICAgIDAsCisgICAgICAgInNldE1heFR4UG93ZXIiIH0sCisKKyAgICB7ICAgV0VfU0VUX01BWF9UWF9QT1dFUl8yXzQsC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ICJzZXRUbUxldmVsIiB9LAorCisgICAgeyAgIFdFX0VOQUJMRV9TVFJJQ1RfRkNDX1JFRywKKyAgICAgICAgSVdfUFJJVl9UWVBFX0lOVCB8IElXX1BSSVZfU0laRV9GSVhFRCB8IDEsCisgICAgICAgIDAsCisgICAgICAgICJzZXRTdHJpY3RGQ0NyZWciIH0sCisKKyAgICB7ICAgV0VfU0VUX0RFQlVHX0xPRywKKyAgICAgICAgSVdfUFJJVl9UWVBFX0lOVCB8IElXX1BSSVZfU0laRV9GSVhFRCB8IDEsCisgICAgICAgIDAsICJzZXREYmdMdmwiIH0sCisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICB7CisgICAgICAgIFdFX1NFVF9URExTX09GRl9DSEFOLAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgMSwKKyAgICAgICAgMCwKKyAgICAgICAgInRkbHNvZmZjaGFuIiB9LAorICAgIHsKKyAgICAgICAgV0VfU0VUX1RETFNfU0VDX09GRl9DSEFOX09GRlNFVCwKKyAgICAgICAgSVdfUFJJVl9UWVBFX0lOVCB8IElXX1BSSVZfU0laRV9GSVhFRCB8IDEsCisgICAgICAgIDAsCisgICAgICAgICJ0ZGxzZWNjaG5vZmZzdCIgfSwKKyAgICB7CisgICAgICAgIFdFX1NFVF9URExTX09GRl9DSEFOX01PREUsCisgICAgICAgIElXX1BSSVZfVFlQRV9JTlQgfCBJV19QUklWX1NJWkVfRklYRUQgfCAxLAorICAgICAgICAwLAorICAgICAgICAidGRsc29mZmNobm1vZGUiIH0sCisjZW5kaWYKKworICAgIHsgICBXRV9TRVRfU0NBTl9CQU5EX1BSRUZFUkVOQ0UsCisgICAgICAgIElXX1BSSVZfVFlQRV9JTlQgfCBJV19QUklWX1NJWkVfRklYRUQgfCAxLAorICAgICAgICAwLCAic2V0X3NjYW5fcHJlZiIgfSwKKyAgICB7CisgICAgICAgIFdFX0dFVF9GUkFNRV9MT0csCisgICAgICAgIElXX1BSSVZfVFlQRV9JTlQgfCBJV19QUklWX1NJWkVfRklYRUQgfCAxLAorICAgICAgICAwLAorICAgICAgICAiZ2V0RnJhbWVMb2dzIiB9LAorCisgICAgeyAgIFdFX1NFVF9NSVJBQ0FTVF9WRU5ET1JfQ09ORklHLAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgMSwKKyAgICAgICAgMCwgInNldE1pcmFjc3RDb25mIiB9LAorCisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICB7CisgICAgICAgIFdFX1NFVF9URExTXzIwNDBfQlNTX0NPRVhJU1RFTkNFLAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgMSwKKyAgICAgICAgMCwKKyAgICAgICAgInRkbHNfMjA0MGJzc2NveCIgfSwKKyNlbmRpZgorICAgIHsgICBXRV9TRVRfUlRTX0NUU19IVFZIVCwKKyAgICAgICAgSVdfUFJJVl9UWVBFX0lOVCB8IElXX1BSSVZfU0laRV9GSVhFRCB8IDEsCisgICAgICAgIDAsICJzZXRSdHNDdHNIdFZodCIgfSwKKworICAgIHsgICBXRV9TRVRfUFJPWElNSVRZX0VOQUJMRSwKKyAgICAgICAgSVdfUFJJVl9UWVBFX0lOVCB8IElXX1BSSVZfU0laRV9GSVhFRCB8IDEsCisgICAgICAgIDAsICJzZXRQcm94aW1pdHkiIH0sCisgICAgLyogaGFuZGxlcnMgZm9yIG1haW4gaW9jdGwgKi8KKyAgICB7ICAgV0xBTl9QUklWX1NFVF9OT05FX0dFVF9JTlQsCisgICAgICAgIDAsCisgICAgICAgIElXX1BSSVZfVFlQRV9JTlQgfCBJV19QUklWX1NJWkVfRklYRUQgfCAxLAorICAgICAgICAiIiB9LAorCisgICAgLyogaGFuZGxlcnMgZm9yIHN1Yi1pb2N0bCAqLworICAgIHsgICBXRV9HRVRfMTFEX1NUQVRFLAorICAgICAgICAwLAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgMSwKKyAgICAgICAgImdldDExRHN0YXRlIiB9LAorCisgICAgeyAgIFdFX0lCU1NfU1RBVFVTLAorICAgICAgICAwLAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgMSwKKyAgICAgICAgImdldEFkaG9jU3RhdHVzIiB9LAorCisgICAgeyAgIFdFX1BNQ19TVEFURSwKKyAgICAgICAgMCwKKyAgICAgICAgSVdfUFJJVl9UWVBFX0lOVCB8IElXX1BSSVZfU0laRV9GSVhFRCB8IDEsCisgICAgICAgICJwbWNTdGF0ZSIgfSwKKworICAgIHsgICBXRV9HRVRfV0xBTl9EQkcsCisgICAgICAgIDAsCisgICAgICAgIElXX1BSSVZfVFlQRV9JTlQgfCBJV19QUklWX1NJWkVfRklYRUQgfCAxLAorICAgICAgICAiZ2V0d2xhbmRiZyIgfSwKKworICAgIHsgICBXRV9HRVRfTUFYX0FTU09DLAorICAgICAgICAwLAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgMSwKKyAgICAgICAgImdldE1heEFzc29jIiB9LAorCisgICAgeyAgIFdFX0dFVF9XRElfREJHLAorICAgICAgICAwLAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgMSwKKyAgICAgICAgImdldHdkaWRiZyIgfSwKKworICAgIHsgICBXRV9HRVRfU0FQX0FVVE9fQ0hBTk5FTF9TRUxFQ1RJT04sCisgICAgICAgIDAsCisgICAgICAgIElXX1BSSVZfVFlQRV9JTlQgfCBJV19QUklWX1NJWkVfRklYRUQgfCAxLAorICAgICAgICAiZ2V0QXV0b0NoYW5uZWwiIH0sCisKKyAgICB7ICAgV0VfR0VUX0NPTkNVUlJFTkNZX01PREUsCisgICAgICAgID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AgICAgICAgInNldF9hcF93cHNfaWUiIH0sCisKKyAgICB7ICAgV0VfU0VUX0NPTkZJRywKKyAgICAgICAgSVdfUFJJVl9UWVBFX0NIQVJ8IDUxMiwKKyAgICAgICAgMCwKKyAgICAgICAgInNldENvbmZpZyIgfSwKKworICAgIHsgICBXRV9TRVRfRU5DUllQVF9NU0csCisgICAgICAgIElXX1BSSVZfVFlQRV9DSEFSfCA1MTIsCisgICAgICAgIDAsCisgICAgICAgICJlbmNyeXB0TXNnIiB9LAorCisKKyAgICAvKiBoYW5kbGVycyBmb3IgbWFpbiBpb2N0bCAqLworICAgIHsgICBXTEFOX1BSSVZfU0VUX1RIUkVFX0lOVF9HRVRfTk9ORSwKKyAgICAgICAgSVdfUFJJVl9UWVBFX0lOVCB8IElXX1BSSVZfU0laRV9GSVhFRCB8IDMsCisgICAgICAgIDAsCisgICAgICAgICIiIH0sCisKKyAgICAvKiBoYW5kbGVycyBmb3Igc3ViLWlvY3RsICovCisgICAgeyAgIFdFX1NFVF9XTEFOX0RCRywKKyAgICAgICAgSVdfUFJJVl9UWVBFX0lOVCB8IElXX1BSSVZfU0laRV9GSVhFRCB8IDMsCisgICAgICAgIDAsCisgICAgICAgICJzZXR3bGFuZGJnIiB9LAorCisgICAgeyAgIFdFX1NFVF9XRElfREJHLAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgMywKKyAgICAgICAgMCwKKyAgICAgICAgInNldHdkaWRiZyIgfSwKKworICAgIHsgICBXRV9TRVRfU0FQX0NIQU5ORUxTLAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgMywKKyAgICAgICAgMCwKKyAgICAgICAgInNldHNhcGNoYW5uZWxzIiB9LAorCisgICAgLyogaGFuZGxlcnMgZm9yIG1haW4gaW9jdGwgKi8KKyAgICB7ICAgV0xBTl9QUklWX0dFVF9DSEFSX1NFVF9OT05FLAorICAg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JnZXRSb2FtUlNTSSIgfSwKKyNlbmRpZgorICAgIHsgICBXRV9HRVRfV01NX1NUQVRVUywKKyAgICAgICAgMCwKKyAgICAgICAgSVdfUFJJVl9UWVBFX0NIQVJ8IFdFX01BWF9TVFJfTEVOLAorICAgICAgICAiZ2V0V21tU3RhdHVzIiB9LAorICAgIHsKKyAgICAgICAgV0VfR0VUX0NIQU5ORUxfTElTVCwKKyAgICAgICAgMCwKKyAgICAgICAgSVdfUFJJVl9UWVBFX0NIQVJ8IFdFX01BWF9TVFJfTEVOLAorICAgICAgICAiZ2V0Q2hhbm5lbExpc3QiIH0sCisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICB7CisgICAgICAgIFdFX0dFVF9URExTX1BFRVJTLAorICAgICAgICAwLAorICAgICAgICBJV19QUklWX1RZUEVfQ0hBUnwgV0VfTUFYX1NUUl9MRU4sCisgICAgICAgICJnZXRUZGxzUGVlcnMiIH0sCisjZW5kaWYKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisgICAgeworICAgICAgICBXRV9HRVRfMTFXX0lORk8sCisgICAgICAgIDAsCisgICAgICAgIElXX1BSSVZfVFlQRV9DSEFSfCBXRV9NQVhfU1RSX0xFTiwKKyAgICAgICAgImdldFBNRkluZm8iIH0sCisjZW5kaWYKKyAgICB7ICAgV0VfR0VUX1NOUiwKKyAgICAgICAgMCwKKyAgICAgICAgSVdfUFJJVl9UWVBFX0NIQVJ8IFdFX01BWF9TVFJfTEVOLAorICAgICAgICAiZ2V0U05SIiB9LAorCisgICAgLyogaGFuZGxlcnMgZm9yIG1haW4gaW9jdGwgKi8KKyAgICB7ICAgV0xBTl9QUklWX1NFVF9OT05FX0dFVF9OT05FLAorICAgICAgICAwLAorICAgICAgICAwLAorICAgICAgICAiIiB9LAorCisgICAgLyogaGFuZGxlcnMgZm9yIHN1Yi1pb2N0bCAqLworICAgIHsgICBXRV9DTEVBUl9TVEFUUywKKyAgICAgICAgMCwKKyAgICAgICAgMCwKKyAgICAgICAgImNsZWFyU3RhdHMiIH0sCisgICAgeyAgIFdFX0lOSVRfQVAsCisgICAgICAgIDAsCisgICAgICAgIDAsCisgICAgICAgICJpbml0QVAiIH0sCisgICAgeyAgIFdFX1NUT1BfQVAsCisgICAgICAgIDAsCisgICAgICAgIDAsCisgICAgICAgICJleGl0QVAiIH0sCisjaWZkZWYgV0xBTl9CVEFNUF9GRUFUVVJFCisgICAgeyAgIFdFX0VOQUJMRV9BTVAsCisgICAgICAgIDAsCisgICAgICAgIDAsCisgICAgICAgICJlbmFibGVBTVAiIH0sCisgICAgeyAgIFdFX0RJU0FCTEVfQU1QLAorICAgICAgICAwLAorICAgICAgICAwLAorICAgICAgICAiZGlzYWJsZUFNUCIgfSwKKyNlbmRpZiAvKiBXTEFOX0JUQU1QX0ZFQVRVUkUgKi8KKyAgICB7ICAgV0VfRU5BQkxFX0RYRV9TVEFMTF9ERVRFQ1QsCisgICAgICAgIDAsCisgICAgICAgIDAsCisgICAgICAgICJkeGVTdGFsbERldGVjdCIgfSwKKyAgICB7ICAgV0VfRElTUExBWV9EWEVfU05BUF9TSE9ULAorICAgICAgICAwLAorICAgICAgICAwLAorICAgICAgICAiZHhlU25hcHNob3QiIH0sCisgICAgeyAgIFdFX0RJU1BMQVlfREFUQVBBVEhfU05BUF9TSE9ULAorICAgICAgICAwLAorICAgICAgICAwLAorICAgICAgICAiZGF0YVNuYXBzaG90In0sCisgICAgeworICAgICAgICBXRV9TRVRfUkVBU1NPQ19UUklHR0VSLAorICAgICAgICAwLAorICAgICAgICAwLAorICAgICAgICAicmVhc3NvYyIgfSwKKyAgICB7CisgICAgICAgIFdFX1NUT1BfT0JTU19TQ0FOLAorICAgICAgICAwLAorICAgICAgICAwLAorICAgICAgICAic3RvcE9CU1NTY2FuIiB9LAorICAgIHsKKyAgICAgICAgV0VfRFVNUF9ST0FNX1RJTUVSX0xPRywKKyAgICAgICAgMCwKKyAgICAgICAgMCwKKyAgICAgICAgImR1bXBSb2FtRGVsYXkiIH0sCisgICAgeworICAgICAgICBXRV9SRVNFVF9ST0FNX1RJTUVSX0xPRywKKyAgICAgICAgMCwKKyAgICAgICAgMCwKKyAgICAgICAgInJlc2V0Um9hbURlbGF5IiB9LAorICAgIHsKKyAgICAgICAgV0VfR0VUX0ZXX0xPR1MsCisgICAgICAgIDAsCisgICAgICAgIDAsCisgICAgICAgICJnZXRGd0xvZ3MiIH0sCisgICAgLyogaGFuZGxlcnMgZm9yIG1haW4gaW9jdGwgKi8KKyAgICB7ICAgV0xBTl9QUklWX1NFVF9WQVJfSU5UX0dFVF9OT05FLAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgTUFYX1ZBUl9BUkdTLAorICAgICAgICAwLAorICAgICAgICAiIiB9LAorCisKKworICAgIC8qIGhhbmRsZXJzIGZvciBzdWItaW9jdGwgKi8KKyAgICB7ICAgV0VfTE9HX0RVTVBfQ01ELAorICAgICAgICBJV19QUklWX1RZUEVfSU5UIHwgTUFYX1ZBUl9BUkdTLAorICAgICAgICAwLAorICAgICAgICAiZHVtcCIgfSwKKworICAgIC8qIGhhbmRsZXJzIGZvciBzdWItaW9jdGwgKi8KKyAgICB7ICAgV0VfTVRSQUNFX1NFTEVDVElWRV9NT0RVTEVfTE9HX0VOQUJMRV9DTUQsCisgICAgICAgIElXX1BSSVZfVFlQRV9JTlQgfCBNQVhfVkFSX0FSR1MsCisgICAgICAgIDAsCisgICAgICAgICJzZXRkdW1wbG9nIiB9LAorCisgICAgeyAgIFdFX01UUkFDRV9EVU1QX0NNRCwKKyAgICAgICAgSVdfUFJJVl9UWVBFX0lOVCB8IE1BWF9WQVJfQVJHUywKKyAgICAgICAgMCwKKyAgICAgICAgImR1bXBsb2ciIH0sCisKKyAgICAvKiBoYW5kbGVycyBmb3Igc3ViIGlvY3RsICovCisgICB7CisgICAgICAgV0VfTUNDX0NPTkZJR19DUkVERU5USUFMLAorICAgICAgIElXX1BSSVZfVFlQRV9JTlQgfCBNQVhfVkFSX0FSR1MsCisgICAgICAgMCwKKyAgICAgICAic2V0TWNjQ3JkbmwiIH0sCisKKyAgICAvKiBoYW5kbGVycyBmb3Igc3ViIGlvY3RsICovCisgICB7CisgICAgICAgV0VfTUNDX0NPTkZJR19QQVJBTVMsCisgICAgICAgSVdfUFJJVl9UWVBFX0lOVCB8IE1BWF9WQVJfQVJHUywKKyAgICAgICAwLAorICAgICAgICJzZXRNY2NDb25maWciIH0sCisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworICAgIC8qIGhhbmRsZXJzIGZvciBzdWIgaW9jdGwgKi8KKyAgIHsKKyAgICAgICBXRV9URExTX0NPTkZJR19QQVJBTVMsCisgICAgICAgSVdfUFJJVl9UWVBFX0lOVCB8IE1BWF9WQVJfQVJHUywKKyAgICAgICAwLAorICAgICAgICJzZXRUZGxzQ29uZmlnIiB9LAorI2VuZGlmCisKKyAgIHsKKyAgICAgICBXRV9DT05GSUdVUkVfTU9OSVRPUl9NT0RFLAorICAgICAgIElXX1BSSVZfVFlQRV9JTlQgfCBNQVhfVkFSX0FSR1MsCisgICAgICAgMCwKKyAgICAgICAiTW9uaXRvck1vZGVDb25mIiB9LAorCisgICB7CisgICAgICAgV0VfU0VUX01PTklUT1JfTU9ERV9GSUxURVIsCisgICAgICAgSVdfUFJJVl9UWVBFX0lOVCB8IE1BWF9WQVJfQVJHUywKKyAgICAgICAwLAorICAgICAgICJNb25pdG9yRmlsdGVyIiB9LAorCisgICAgLyogaGFuZGxlcnMgZm9yIG1haW4gaW9jdGwgKi8KKyAgICB7ICAgV0xBTl9QUklWX0FERF9UU1BFQywKKyAgICAgICAgSVdfUFJJVl9UWVBFX0lOVCB8IElXX1BSSVZfU0laRV9GSVhFRCB8IEhERF9XTEFOX1dNTV9QQVJBTV9DT1VOVCwKKyAgICAgICAgSVdfUFJJVl9UWVBFX0lOVCB8IElXX1BSSVZfU0laRV9GSVhFRCB8IDEsCisgICAgICAgICJhZGRUc3BlYyIgfSwKKworICAgIC8q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iAxIE1BWCA6IDEwCisgICAgICogQml0IDMgOiBSWF9EUkFJTl9USU1FICAgICAgICAgTUlOIDogMSBNQVggOiAxMAorICAgICAqIEJpdCA0IDogQ0hBTk5FTF9TV0lUQ0hfVElNRSAgIE1JTiA6IDEgTUFYIDogMjAKKyAgICAgKiBCaXQgNSA6IE1JTl9DSEFOTkVMX1RJTUUgICAgICBNSU4gOiA1IE1BWCA6IDIwCisgICAgICogQml0IDYgOiBQQVJLX0JFRk9SRV9UQlRUICAgICAgTUlOIDogMSBNQVggOiAgNQorICAgICAqIEJpdCA3IDogTUlOX0FGVEVSX0RUSU0gICAgICAgIE1JTiA6IDUgTUFYIDogMTUKKyAgICAgKiBCaXQgOCA6IFRPT19DTE9TRV9NQVJHSU4gICAgICBNSU4gOiAxIE1BWCA6ICAzCisgICAgICogQml0IDkgOiBSZXNlcnZlZAorICAgICAqLworICAgIHN3aXRjaCAoYXJnMSkKKyAgICB7CisgICAgICAgIC8vVXBkYXRlIE1DQyBTQ0hFRFVMRV9USU1FX1NMSUNFIHBhcmFtZXRlcgorICAgICAgICBjYXNlIE1DQ19TQ0hFRFVMRV9USU1FX1NMSUNFX0NGR19QQVJBTSA6CisgICAgICAgICAgICBpZiggcEhkZEN0eC0+Y2ZnX2luaS0+Y29uZmlnTWNjUGFyYW0gJiAweDAwMDEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoKGFyZzIgPj0gNSkgJiYgKGFyZzIgPD0gMjApKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbG9nUHJpbnRmKGhIYWwsIGNtZCwgc3RhSWQsIGFyZzEsIGFyZzIsIGFyZzMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIiVzIDogRW50ZXIgYSB2YWxpZCBNQ0MgY29uZmlndXJhdGlvbiB2YWx1ZSIsX19GVU5DVElPTl9fKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgLy9VcGRhdGUgTUNDIE1BWF9OVUxMX1NFTkRfVElNRSBwYXJhbWV0ZXIKKyAgICAgICAgY2FzZSBNQ0NfTUFYX05VTExfU0VORF9USU1FX0NGR19QQVJBTSA6CisgICAgICAgICAgICBpZiggcEhkZEN0eC0+Y2ZnX2luaS0+Y29uZmlnTWNjUGFyYW0gJiAweDAwMDIpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoKGFyZzIgPj0gMSkgJiYgKGFyZzIgPD0gMTApKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbG9nUHJpbnRmKGhIYWwsIGNtZCwgc3RhSWQsIGFyZzEsIGFyZzIsIGFyZzMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIiVzIDogRW50ZXIgYSB2YWxpZCBNQ0MgY29uZmlndXJhdGlvbiB2YWx1ZSIsX19GVU5DVElPTl9fKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgLy9VcGRhdGUgTUNDIFRYX0VBUkxZX1NUT1BfVElNRSBwYXJhbWV0ZXIKKyAgICAgICAgY2FzZSBNQ0NfVFhfRUFSTFlfU1RPUF9USU1FX0NGR19QQVJBTSA6CisgICAgICAgICAgICBpZiggcEhkZEN0eC0+Y2ZnX2luaS0+Y29uZmlnTWNjUGFyYW0gJiAweDAwMDQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoKGFyZzIgPj0gMSkgJiYgKGFyZzIgPD0gMTApKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbG9nUHJpbnRmKGhIYWwsIGNtZCwgc3RhSWQsIGFyZzEsIGFyZzIsIGFyZzMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIiVzIDogRW50ZXIgYSB2YWxpZCBNQ0MgY29uZmlndXJhdGlvbiB2YWx1ZSIsX19GVU5DVElPTl9fKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgLy9VcGRhdGUgTUNDIFJYX0RSQUlOX1RJTUUgcGFyYW1ldGVyCisgICAgICAgIGNhc2UgTUNDX1JYX0RSQUlOX1RJTUVfQ0ZHX1BBUkFNIDoKKyAgICAgICAgICAgIGlmKCBwSGRkQ3R4LT5jZmdfaW5pLT5jb25maWdNY2NQYXJhbSAmIDB4MDAwOCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZigoYXJnMiA+PSAxKSAmJiAoYXJnMiA8PSAxMCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBsb2dQcmludGYoaEhhbCwgY21kLCBzdGFJZCwgYXJnMSwgYXJnMiwgYXJnMyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCAiJXMgOiBFbnRlciBhIHZhbGlkIE1DQyBjb25maWd1cmF0aW9uIHZhbHVlIixfX0ZVTkNUSU9OX18pOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIGJyZWFrOworCisgICAgICAgIC8vVXBkYXRlIE1DQyBDSEFOTkVMX1NXSVRDSF9USU1FIHBhcmFtZXRlcgorICAgICAgICBjYXNlIE1DQ19DSEFOTkVMX1NXSVRDSF9USU1FX0NGR19QQVJBTSA6CisgICAgICAgICAgICBpZiggcEhkZEN0eC0+Y2ZnX2luaS0+Y29uZmlnTWNjUGFyYW0gJiAweDAwMTApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoKGFyZzIgPj0gMSkgJiYgKGFyZzIgPD0gMjApKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbG9nUHJpbnRmKGhIYWwsIGNtZCwgc3RhSWQsIGFyZzEsIGFyZzIsIGFyZzMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIiVzIDogRW50ZXIgYSB2YWxpZCBNQ0MgY29uZmlndXJhdGlvbiB2YWx1ZSIsX19GVU5DVElPTl9fKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgLy9VcGRhdGUgTUNDIE1JTl9DSEFOTkVMX1RJTUUgcGFyYW1ldGVyCisgICAgICAgIGNhc2UgTUNDX01JTl9DSEFOTkVMX1RJTUVfQ0ZHX1BBUkFNIDoKKyAgICAgICAgICAgIGlmKCBwSGRkQ3R4LT5jZmdfaW5pLT5jb25maWdNY2NQYXJhbSAmIDB4MDAyMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZigoYXJnMiA+PSA1KSAmJiAoYXJnMiA8PSAyMCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBsb2dQcmludGYoaEhhbCwgY21kLCBzdGFJZCwgYXJnMSwgYXJnMiwgYXJnMyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCAiJXMgOiBFbnRlciBhIHZhbGlkIE1DQyBjb25maWd1cmF0aW9uIHZhbHVlIixfX0ZVTkNUSU9OX18pOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICAvL1VwZGF0ZSBNQ0MgUEFSS19CRUZPUkVfVEJUVCBwYXJhbWV0ZXIKKyAgICAgICAgY2FzZSBNQ0NfUEFSS19CRUZPUkVfVEJUVF9DRkdfUEFSQU0gOgorICAgICAgICAgICAgaWYoIHBIZGRDdHgtPmNmZ19pbmktPmNvbmZpZ01jY1BhcmFtICYgMHgwMDQwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKChhcmcyID49IDEpICYmIChhcmcyIDw9IDUpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbG9nUHJpbnRmKGhIYWwsIGNtZCwgc3RhSWQsIGFyZzEsIGFyZzIsIGFyZzMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBoZGRMb2coTE9HRSwgIiVzIDogRW50ZXIgYSB2YWxpZCBNQ0MgY29uZmlndXJhdGlvbiB2YWx1ZSIsX19GVU5DVElPTl9fKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgLy9VcGRhdGUgTUNDIE1JTl9BRlRFUl9EVElNIHBhcmFtZXRlcgorICAgICAgICBjYXNlIE1DQ19NSU5fQUZURVJfRFRJTV9DRkdfUEFSQU0gOgorICAgICAgICAgICAgaWYoIHBIZGRDdHgtPmNmZ19pbmktPmNvbmZpZ01jY1BhcmFtICYgMHgwMDgwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKChhcmcyID49IDUpICYmIChhcmcyIDw9IDE1KSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGxvZ1ByaW50ZihoSGFsLCBjbWQsIHN0YUlkLCBhcmcxLCBhcmcyLCBhcmczKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaGRkTG9nKExPR0UsICIlcyA6IEVudGVyIGEgdmFsaWQgTUNDIGNvbmZpZ3VyYXRpb24gdmFsdWUiLF9fRlVOQ1RJT05fXyk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIC8vVXBkYXRlIE1DQyBUT09fQ0xPU0VfTUFSR0lOIHBhcmFtZXRlcgorICAgICAgICBjYXNlIE1DQ19UT09fQ0xPU0VfTUFSR0lOX0NGR19QQVJBTSA6CisgICAgICAgICAgICBpZiggcEhkZEN0eC0+Y2ZnX2luaS0+Y29uZmlnTWNjUGFyYW0gJiAweDAxMDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoKGFyZzIgPj0gMSkgJiYgKGFyZzIgPD0gMykpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBsb2dQcmludGYoaEhhbCwgY21kLCBzdGFJZCwgYXJnMSwgYXJnMiwgYXJnMyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGhkZExvZyhMT0dFLCAiJXMgOiBFbnRlciBhIHZhbGlkIE1DQyBjb25maWd1cmF0aW9uIHZhbHVlIixfX0ZVTkNUSU9OX18pOworICAgIC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WT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgIiVzOiBVLUFQU0QgaXMgbm90IGVuYWJsZWQiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgIHJldHVybjsKKyAgIH0KKworICAgLy8gZXZlcnl0aGluZyBpcyBpbiBwbGFjZSB0byBub3RpZnkgVEwKKyAgIHN0YXR1cyA9IFdMQU5UTF9FbmFibGVVQVBTREZvckFDKChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPnB2b3NDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFdMQU5fSEREX0dFVF9TVEFUSU9OX0NUWF9QVFIocEFkYXB0ZXIpKS0+Y29ubl9pbmZvLnN0YUlkWzBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWNUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFjLT53bW1BY1RzcGVjSW5mby50c19pbmZvLnRpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBYy0+d21tQWNUc3BlY0luZm8udHNfaW5mby51cCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlcnZpY2VfaW50ZXJ2YWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdXNwZW5zaW9uX2ludGVydmFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlyZWN0aW9uKTsKKworICAgaWYgKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogRmFpbGVkIHRvIGVuYWJsZSBVLUFQU0QgZm9yIEFDPSVkIiwKKyAgICAg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VhazsKKyAgICAgICAgIGNhc2UgV0xBTlRMX0FDX1ZJOgorICAgICAgICAgICAgc2VydmljZV9pbnRlcnZhbCA9IChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPmNmZ19pbmktPkluZnJhVWFwc2RWaVNydkludHY7CisgICAgICAgICAgICBzdXNwZW5zaW9uX2ludGVydmFsID0gKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+Y2ZnX2luaS0+SW5mcmFVYXBzZFZpU3VzcEludHY7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIGNhc2UgV0xBTlRMX0FDX0JFOgorICAgICAgICAgICAgc2VydmljZV9pbnRlcnZhbCA9IChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPmNmZ19pbmktPkluZnJhVWFwc2RCZVNydkludHY7CisgICAgICAgICAgICBzdXNwZW5zaW9uX2ludGVydmFsID0gKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+Y2ZnX2luaS0+SW5mcmFVYXBzZEJlU3VzcEludHY7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIGNhc2UgV0xBTlRMX0FDX0JLOgorICAgICAgICAgICAgc2VydmljZV9pbnRlcnZhbCA9IChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPmNmZ19pbmktPkluZnJhVWFwc2RCa1NydkludHY7CisgICAgICAgICAgICBzdXNwZW5zaW9uX2ludGVydmFsID0gKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+Y2ZnX2luaS0+SW5mcmFVYXBzZEJrU3VzcEludHY7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIEFDICVkIiwgX19mdW5jX18sIGFjVHlwZSApOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgfQorCisgICAgICAgICBzdGF0dXMgPSBXTEFOVExfRW5hYmxlVUFQU0RGb3JBQygoV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcikpLT5wdm9zQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgIChXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKSktPmNvbm5faW5mby5zdGFJZFswXSwKKyAgICAgICAgICAgICAgICAgICBhY1R5cGUsCisgICAgICAgICAgICAgICAgICAgcEFjLT53bW1BY1RzcGVjSW5mby50c19pbmZvLnRpZCwKKyAgICAgICAgICAgICAgICAgICBwQWMtPndtbUFjVHNwZWNJbmZvLnRzX2luZm8udXAsCisgICAgICAgICAgICAgICAgICAgc2VydmljZV9pbnRlcnZhbCwKKyAgICAgICAgICAgICAgICAgICBzdXNwZW5zaW9uX2ludGVydmFsLAorICAgICAgICAgICAgICAgICAgIHBBYy0+d21tQWNUc3BlY0luZm8udHNfaW5mby5kaXJlY3Rpb24pOworCisgICAgICAgICBpZiAoICFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIiVzOiBGYWlsZWQgdG8gdXBkYXRlIFUtQVBTRCBwYXJhbXMgZm9yIEFDPSVkIiwKKyAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIGFjVHlwZSApOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgLy8gVEwgbm8gbG9uZ2VyIGhhcyB2YWxpZCBVQVBTRCBpbmZvCisgICAgICAgICAgICBwQWMtPndtbUFjVWFwc2RJbmZvVmFsaWQgPSBWT1NfRkFMU0U7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICIlczogVXBkYXRlZCBVQVBTRCBwYXJhbXMgaW4gVEwgZm9yIEFDPSVkIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICBhY1R5cGUpOworICAgICAgICAgfQorICAgICAgfQorICAgfQorfQorCisjZW5kaWYKKworLyoqCisgIEBicmllZiBoZGRfd21tX2ZyZWVfY29udGV4dCgpIC0gZnVuY3Rpb24gd2hpY2ggZnJlZXMgYSBRb1MgY29udGV4dAorCisgIEBwYXJhbSBwUW9zQ29udGV4dCA6IFtpbl0gdGhlIHBvaW50ZXIgdGhlIFFvUyBpbnN0YW5jZSBjb250cm9sIGJsb2NrCisKKyAgQHJldHVybgorICBOb25lCisqLworc3RhdGljIHZvaWQgaGRkX3dtbV9mcmVlX2NvbnRleHQgKGhkZF93bW1fcW9zX2NvbnRleHRfdCogcFFvc0NvbnRleHQpCit7CisgICB2X0NPTlRFWFRfdCBwVm9zQ29udGV4dCA9IHZvc19nZXRfZ2xvYmFsX2NvbnRleHQoIFZPU19NT0RVTEVfSURfSERELCBOVUxMICk7CisgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworCisgICBpZiAoTlVMTCA9PSBwVm9zQ29udGV4dCkKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIEZMKCJwVm9zQ29udGV4dCBpcyBOVUxMIikpOworICAgICAgcmV0dXJuOworICAgfQorCisgICBwSGRkQ3R4ID0gdm9zX2dldF9jb250ZXh0KCBWT1NfTU9EVUxFX0lEX0hERCwgcFZvc0NvbnRleHQpOworICAgaWYgKE5VTEwgPT0gcEhkZEN0eCkKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIEZMKCJIZGRDdHggaXMgTlVMTCIpKTsKKyAgICAgIHJldHVybjsKKyAgIH0KKworICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAgIiVzOiBFbnRlcmVkLCBjb250ZXh0ICVwIiwKKyAgICAgICAgICAgICBfX2Z1bmNfXywgcFFvc0NvbnRleHQpOworCisgICAvLyB0YWtlIHRoZSB3bW1Mb2NrIHNpbmNlIHdlJ3JlIG1hbmlwdWxhdGluZyB0aGUgY29udGV4dCBsaXN0CisgICBtdXRleF9sb2NrKCZwSGRkQ3R4LT53bW1Mb2NrKTsKKworICAgaWYgKHVubGlrZWx5KChOVUxMID09IHBRb3NDb250ZXh0KSB8fAorICAgICAgICAgICAgICAgIChIRERfV01NX0NUWF9NQUdJQyAhPSBwUW9zQ29udGV4dC0+bWFnaWMpKSkKKyAgIHsKKyAgICAgIC8vIG11c3QgaGF2ZSBiZWVuIGZyZWVkIGluIGFub3RoZXIgdGhyZWFkCisgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPndtbUxvY2spOworICAgICAgcmV0dXJuOworICAgfQorCisgICAvLyBtYWtlIHN1cmUgbm9ib2R5IHRoaW5rcyB0aGlzIGlzIGEgdmFsaWQgY29udGV4dAorICAgcFFvc0NvbnRleHQtPm1hZ2ljID0gMDsKKworICAgLy8gdW5saW5rIHRoZSBjb250ZXh0CisgICBsaXN0X2RlbCgmcFFvc0NvbnRleHQtPm5vZGUpOworCisgICAvLyBkb25lIG1hbmlwdWxhdGluZyB0aGUgbGlzdAorICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT53bW1Mb2NrKTsKKworICAgLy8gcmVjbGFpbSBtZW1vcnkKKyAgIGtmcmVlKHBRb3NDb250ZXh0KTsKKworfQorCisjaWZuZGVmIFdMQU5fTURNX0NPREVfUkVEVUNUSU9OX09QVAorLyoqCisgIEBicmllZiBoZGRfd21tX25vdGlmeV9hcHAoKSAtIGZ1bmN0aW9uIHdoaWNoIG5vdGlmaWVzIGFuIGFwcGxpY2F0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5nZXMgaW4gc3RhdGUgb2YgaXQgZmxvdworCisgIEBwYXJhbSBwUW9zQ29udGV4dCA6IFtpbl0gdGhlIHBvaW50ZXIgdGhlIFFvUyBpbnN0YW5jZSBjb250cm9sIGJsb2NrCisKKyAgQHJldHVybgorICBOb25lCisqLworI2RlZmluZSBNQVhfTk9USUZZX0xFTiA1MAorc3RhdGljIHZvaWQgaGRkX3dtbV9ub3RpZnlfYXBwIChoZGRfd21tX3Fvc19jb250ZXh0X3QqIHBRb3NDb250ZXh0KQoreworICAgaGRkX2FkYXB0ZXJfdCogcEFkYXB0ZXI7CisgICB1bmlvbiBpd3JlcV9kYXRhIHdycXU7CisgICBjaGFyIGJ1ZltNQVhfTk9USUZZX0xFTisxXTsKKyAgIHZfQ09OVEVYVF90IHBWb3NDb250ZXh0ID0gdm9zX2dldF9nbG9iYWxfY29udGV4dCggVk9TX01PRFVMRV9JRF9IREQsIE5VTEwgKTsKKyAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisKKyAgIGlmIChOVUxMID09IHBWb3NDb250ZXh0KQorICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgRkwoInBWb3NDb250ZXh0IGlzIE5VTEwiKSk7CisgICAgICAgICByZXR1cm47CisgICB9CisKKyAgIHBIZGRDdHggPSB2b3NfZ2V0X2NvbnRleHQoIFZPU19NT0RVTEVfSURfSERELCBwVm9zQ29udGV4dCk7CisgICBpZiAoTlVMTCA9PSBwSGRkQ3R4KQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgRkwoIkhkZEN0eCBpcyBOVUxMIikpOworICAgICAgcmV0dXJuOworICAgfQorCisgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICAiJXM6IEVudGVyZWQsIGNvbnRleHQgJXAiLAorICAgICAgICAgICAgIF9fZnVuY19fLCBwUW9zQ29udGV4dCk7CisKKyAgIG11dGV4X2xvY2soJnBIZGRDdHgtPndtbUxvY2spOworICAgaWYgKHVubGlrZWx5KChOVUxMID09IHBRb3NDb250ZXh0KSB8fAorICAgICAgICAgICAgICAgIChIRERfV01NX0NUWF9NQUdJQyAhPSBwUW9zQ29udGV4dC0+bWFnaWMpKSkKKyAgIHsKKyAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+d21tTG9jayk7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgUW9TIENvbnRleHQiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgIHJldHVybjsKKyAgIH0KKyAgIC8vIGdldCBwb2ludGVyIHRvIHRoZSBhZGFwdGVyCisgICBwQWRhcHRlciA9IHBRb3NDb250ZXh0LT5wQWRhcHRlcjsKKyAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+d21tTG9jayk7CisKKyAgIC8vIGNyZWF0ZSB0aGUgZXZlbnQKKyAgIG1lbXNldCgmd3JxdSwgMCwgc2l6ZW9mKHdycXUpKTsKKyAgIG1lbXNldChidWYsIDAsIHNpemVvZihidWYpKTsKKworICAgc25wcmludGYoYnVmLCBNQVhfTk9USUZZX0xFTiwgIlFDT006IFRTIGNoYW5nZVsldTogJXVdIiwKKyAgICAgICAgICAgICh1bnNp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0hERCwgcFZvc0NvbnRleHQpOworICAgIGlmICgwICE9ICh3bGFuX2hkZF92YWxpZGF0ZV9jb250ZXh0KHBIZGRDdHgpKSkKKyAgICB7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBtdXRleF9sb2NrKCZwSGRkQ3R4LT53bW1Mb2NrKTsKKyAgICBpZiAodW5saWtlbHkoKE5VTEwgPT0gcFFvc0NvbnRleHQpIHx8CisgICAgICAgICAgICAgICAgKEhERF9XTU1fQ1RYX01BR0lDICE9IHBRb3NDb250ZXh0LT5tYWdpYykpKQorICAgIHsKKyAgICAgICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT53bW1Mb2NrKTsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgUW9TIENvbnRleHQiLAorICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+d21tTG9jayk7CisKKyAgICBhY1R5cGUgPSBwUW9zQ29udGV4dC0+YWNUeXBlOworICAgIHBBZGFwdGVyID0gcFFvc0NvbnRleHQtPnBBZGFwdGVyOworICAgIGlmICgoTlVMTCA9PSBwQWRhcHRlcikgfHwgKFdMQU5fSEREX0FEQVBURVJfTUFHSUMgIT0gcEFkYXB0ZXItPm1hZ2ljKSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgRkwoImludmFsaWQgcEFkYXB0ZXI6ICVwIiksIHBBZGFwdGVyKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHBBYyA9ICZwQWRhcHRlci0+aGRkV21tU3RhdHVzLndtbUFjU3RhdHVzW2FjVHlwZV07CisKKyAg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0ZSA9PSBWT1NfVElNRVJfU1RBVEVfU1RPUFBFRCkKKyAgICAgICAgeworICAgICAgICAgICAgLy8gUmVzdGFydCB0aGUgdGltZXIKKyAgICAgICAgICAgIHZvc19zdGF0dXMgPSB2b3NfdGltZXJfc3RhcnQoJnBBYy0+d21tSW5hY3Rpdml0eVRpbWVyLCBwQWMtPndtbUluYWN0aXZpdHlUaW1lKTsKKyAgICAgICAgICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc19zdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJSZXN0YXJ0aW5nIGluYWN0aXZpdHkgdGltZXIgZmFpbGVkIG9uIEFDICVkIiksIGFjVHlwZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfQVNTRVJUKHZvc190aW1lcl9nZXRDdXJyZW50U3RhdGUoCisgICAgICAgICAgICAgICAgICAgICAgICAmcEFjLT53bW1JbmFjdGl2aXR5VGltZXIpID09IFZPU19USU1FUl9TVEFURV9TVE9QUEVEKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEVYSVQoKTsKKyAgICByZXR1cm47Cit9CisKKworLyoqCisgIEBicmllZiBoZGRfd21tX2VuYWJsZV9pbmFjdGl2aXR5X3RpbWVyKCkgLSBmdW5jdGlvbiB0byBlbmFibGUgdGhlCisgIHRyYWZmaWMgaW5hY3Rpdml0eSB0aW1lciBmb3IgdGhlIGdpdmVuIEFDLCBpZiB0aGUgaW5hY3Rpdml0eV9pbnRlcnZhbAorICBzcGVjaWZpZWQgaW4gdGhlIEFERFRTIHBhcmFtZXRlcnMgaXMgbm9uLXplcm8KKworICBAcGFyYW0gcFFvc0NvbnRleHQgICA6IFtpbl0gcG9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gICAgICAgICAgICAgICAgICAgICAgdm9pZCAqIGhkZEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbWVfUW9zV21tVHNwZWNJbmZvKiBwQ3VycmVudFFvc0luZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21lX1Fvc1N0YXR1c1R5cGUgc21lU3RhdHVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgcW9zRmxvd0lkKQoreworICAgaGRkX3dtbV9xb3NfY29udGV4dF90KiBwUW9zQ29udGV4dCA9IGhkZEN0eDsKKyAgIGhkZF9hZGFwdGVyX3QqIHBBZGFwdGVyOworICAgV0xBTlRMX0FDRW51bVR5cGUgYWNUeXBlOworICAgaGRkX3dtbV9hY19zdGF0dXNfdCAqcEFjOworICAgVk9TX1NUQVRVUyBzdGF0dXM7CisgICB2X0NPTlRFWFRfdCBwVm9zQ29udGV4dCA9IHZvc19nZXRfZ2xvYmFsX2NvbnRleHQoIFZPU19NT0RVTEVfSURfSERELCBOVUxMICk7CisgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworCisgICBpZiAoTlVMTCA9PSBwVm9zQ29udGV4dCkKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIEZMKCJwVm9zQ29udGV4dCBpcyBOVUxMIikpOworICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICB9CisKKyAgIHBIZGRDdHggPSB2b3NfZ2V0X2NvbnRleHQoIFZPU19NT0RVTEVfSURfSERELCBwVm9zQ29udGV4dCk7CisgICBpZiAoTlVMTCA9PSBwSGRkQ3R4KQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgRkwoIkhkZEN0eCBpcyBOVUxMIikpOworICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICB9CisKKworICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAgIiVzOiBFbnRlcmVkLCBjb250ZXh0ICVwIiwKKyAgICAgICAgICAgICBfX2Z1bmNfXywgcFFvc0NvbnRleHQpOworCisgICBtdXRleF9sb2NrKCZwSGRkQ3R4LT53bW1Mb2NrKTsKKyAgIGlmICh1bmxpa2VseSgoTlVMTCA9PSBwUW9zQ29udGV4dCkgfHwKKyAgICAgICAgICAgICAgICAoSEREX1dNTV9DVFhfTUFHSUMgIT0gcFFvc0NvbnRleHQtPm1hZ2ljKSkpCisgICB7CisgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPndtbUxvY2spOworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIFFvUyBDb250ZXh0IiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgIH0KKyAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+d21tTG9jayk7CisKKyAgIHBBZGFwdGVyID0gcFFvc0NvbnRleHQtPnBBZGFwdGVyOworICAgYWNUeXBlID0gcFFvc0NvbnRleHQtPmFjVHlwZTsKKyAgIHBBYyA9ICZwQWRhcHRlci0+aGRkV21tU3RhdHVzLndtbUFjU3RhdHVzW2FjVHlwZV07CisKKyAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgICIlczogc3RhdHVzICVkIGZsb3dpZCAlZCBpbmZvICVwIiwKKyAgICAgICAgICAgICBfX2Z1bmNfXywgc21lU3RhdHVzLCBxb3NGbG93SWQsIHBDdXJyZW50UW9zSW5mbyk7CisKKyAgIHN3aXRjaCAoc21lU3RhdHVzKQorICAgeworCisgICBjYXNlIFNNRV9RT1NfU1RBVFVTX1NFVFVQX1NVQ0NFU1NfSU5EOgorICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAgICAgIiVzOiBTZXR1cCBpcyBjb21wbGV0ZSIsCisgICAgICAgICAgICAgICAgX19mdW5jX18pOworCisgICAgICAvLyB0aGVyZSB3aWxsIGFsd2F5cyBiZSBhIFRTUEVDIHJldHVybmVkIHdpdGggdGhpcyBzdGF0dXMsIGV2ZW4gaWYKKyAgICAgIC8vIGEgVFNQRUMgaXMgbm90IGV4Y2hhbmdlZCBPVEEKKyAgICAgIGlmIChwQ3VycmVudFFvc0luZm8pCisgICAgICB7CisgICAgICAgICBwQWMtPndtbUFjVHNwZWNWYWxpZCA9IFZPU19UUlVFOworICAgICAgICAgbWVtY3B5KCZwQWMtPndtbUFjVHNwZWNJbmZvLAorICAgICAgICAgICAgICAgIHBDdXJyZW50UW9zSW5mbywKKyAgICAgICAgICAgICAgICBzaXplb2YocEFjLT53bW1BY1RzcGVjSW5mbykpOworICAgICAgfQorCisgICAgICBpZiAoSEREX1dNTV9IQU5ETEVfSU1QTElDSVQgPT0gcFFvc0NvbnRleHQtPmhhbmRsZSkKKyAgICAgIHsKKworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAiJXM6IEltcGxpY2l0IFFvcywgbm90aWZ5aW5nIFRMIGZvciBUTCBBQyAlZCIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIGFjVHlwZSk7CisKKyAgICAgICAgIC8vIHRoaXMgd2FzIHRyaWdnZXJlZCBieSBpbXBsaWNpdCBRb1Mgc28gd2Uga25vdyBwYWNrZXRzIGFyZSBwZW5kaW5nCisgICAgICAgICAvLyB1cGRhdGUgc3RhdGUKKyAgICAgICAgIHBBYy0+d21tQWNBY2Nlc3NBbGxvd2VkID0gVk9TX1RSVUU7CisgICAgICAgICBwQWMtPndtbUFjQWNjZXNzR3JhbnRlZCA9IFZPU19UUlVFOworICAgICAgICAgcEFjLT53bW1BY0FjY2Vzc1BlbmRpbmcgPSBWT1NfRkFMU0U7CisKKyAgICAgICAgIC8vIG5vdGlmeSBUTCB0aGF0IHBhY2tldHMgYXJlIHBlbmRpbmcKKyAgICAgICAgIHN0YXR1cyA9IFdMQU5UTF9TVEFQa3RQZW5kaW5nKCAoV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcikpLT5wdm9zQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlcikpLT5jb25uX2luZm8uc3RhSWRbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWNUeXBlICk7CisKKyAgICAgICAgIGlmICggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEZhaWxlZCB0byBzaWduYWwgVEwgZm9yIEFDPSVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIGFjVHlwZSApOworICAgICAgICAgfQorICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgIC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h0KTsKKworICAgICAgYnJlYWs7CisKKyAgIGNhc2UgU01FX1FPU19TVEFUVVNfU0VUVVBfU1VDQ0VTU19BUFNEX1NFVF9BTFJFQURZOgorICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAiJXM6IFNldHVwIGlzIGNvbXBsZXRlIChVLUFQU0Qgc2V0IHByZXZpb3VzbHkpIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisKKyAgICAgIGlmIChIRERfV01NX0hBTkRMRV9JTVBMSUNJVCA9PSBwUW9zQ29udGV4dC0+aGFuZGxlKQorICAgICAgeworCisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICIlczogSW1wbGljaXQgUW9zLCBub3RpZnlpbmcgVEwiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKworICAgICAgICAgLy8gdGhpcyB3YXMgdHJpZ2dlcmVkIGJ5IGltcGxpY2l0IFFvUyBzbyB3ZSBrbm93IHBhY2tldHMgYXJlIHBlbmRpbmcKKyAgICAgICAgIC8vIHVwZGF0ZSBzdGF0ZQorICAgICAgICAgcEFjLT53bW1BY0FjY2Vzc0FsbG93ZWQgPSBWT1NfVFJVRTsKKyAgICAgICAgIHBBYy0+d21tQWNBY2Nlc3NHcmFudGVkID0gVk9TX1RSVUU7CisgICAgICAgICBwQWMtPndtbUFjQWNjZXNzUGVuZGluZyA9IFZPU19GQUxTRTsKKworICAgICAgICAgLy8gbm90aWZ5IFRMIHRoYXQgcGFja2V0cyBhcmUgcGVuZGluZworICAgICAgICAgc3RhdHVzID0gV0xBTlRMX1NUQVBrdFBlbmRpbmcoIChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPnB2b3NDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKSktPmNvbm5faW5mby5zdGFJZFswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY1R5cGUgKTsKKworICAgICAgICAgaWYgKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICIlczogRmFpbGVkIHRvIHNpZ25hbCBUTCBmb3IgQUM9JWQiLAorICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgYWNUeXBlICk7CisgICAgICAgICB9CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICIlczogRXhwbGljaXQgUW9zLCBub3RpZnlpbmcgdXNlcnNwYWNlIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisKKyAgICAgICAgIC8vIHRoaXMgd2FzIHRyaWdnZXJlZCBieSBhbiBhcHBsaWNhdGlvbgorICAgICAgICAgcFFvc0NvbnRleHQtPmxhc3RTdGF0dXMgPSBIRERfV0xBTl9XTU1fU1RBVFVTX1NFVFVQX1NVQ0NFU1NfTk9fQUNNX1VBUFNEX0VYSVNUSU5HOworICAgICAgICAgaGRkX3dtbV9ub3RpZnlfYXBwKHBRb3NDb250ZXh0KTsKKyAgICAgIH0KKworICAgICAgYnJlYWs7CisKKyAgIGNhc2UgU01FX1FPU19TVEFUVVNfU0VUVVBfRkFJTFVSRV9SU1A6CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IFNldHVwIGZhaWxlZCIsCisgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgLy8gUW9TIHNldHVwIGZhaWxlZAorCisgICAgICBpZiAoSEREX1dNTV9IQU5ETEVfSU1QTElDSVQgPT0gcFFvc0NvbnRleHQtPmhhbmRsZSkKKyAgICAgIHsKKworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAiJXM6IEltcGxpY2l0IFFvcywgbm90aWZ5aW5nIFRMIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisKKyAgICAgICAgIC8vIHdlIG5vdGUgdGhlIGZhaWx1cmUsIGJ1dCB3ZSBhbHNvIG1hcmsgYWNjZXNzIGFzIGFsbG93ZWQgc28gdGhhdAorICAgICAgICAgLy8gdGhlIHBhY2tldHMgd2lsbCBmbG93LiAgTm90ZSB0aGF0IHRoZSBNQUMgd2lsbCAiZG8gdGhlIHJpZ2h0IHRoaW5nIgorICAgICAgICAgcEFjLT53bW1BY0FjY2Vzc1BlbmRpbmcgPSBWT1NfRkFMU0U7CisgICAgICAgICBwQWMtPndtbUFjQWNjZXNzRmFpbGVkID0gVk9TX1RSVUU7CisgICAgICAgICBwQWMtPndtbUFjQWNjZXNzQWxsb3dlZCA9IFZPU19UUlVFOworCisgICAgICAgICAvLyB0aGlzIHdhcyB0cmlnZ2VyZWQgYnkgaW1wbGljaXQgUW9TIHNvIHdlIGtub3cgcGFja2V0cyBhcmUgcGVuZGluZworICAgICAgICAgc3RhdHVzID0gV0xBTlRMX1NUQVBrdFBlbmRpbmcoIChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPnB2b3NDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKSktPmNvbm5faW5mby5zdGFJZFswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY1R5cGUgKTsKKworICAgICAgICAgaWYgKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICIlczogRmFpbGVkIHRvIHNpZ25hbCBUTCBmb3IgQUM9JWQiLAorICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgYWNUeXBlICk7CisgICAgICAgICB9CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICIlczogRXhwbGljaXQgUW9zLCBub3RpZnlpbmcgdXNlcnNwYWNlIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisKKyAgICAgICAgIC8vIHRoaXMgd2FzIHRyaWdnZXJlZCBieSBhbiBhcHBsaWNhdGlvbgorICAgICAgICAgcFFvc0NvbnRleHQtPmxhc3RTdGF0dXMgPSBIRERfV0xBTl9XTU1fU1RBVFVTX1NFVFVQX0ZBSUxFRDsKKyAgICAgICAgIGhkZF93bW1fbm90aWZ5X2FwcChwUW9zQ29udGV4dCk7CisgICAgICB9CisKKyAgICAgIC8qIFNldHRpbmcgdXAgUW9TIEZhaWxlZCwgUW9TIGNvbnRleHQgY2FuIGJlIHJlbGVhc2VkLgorICAgICAgICogU01FIGlzIHJlbGVhc2luZyB0aGlzIGZsb3cgaW5mb3JtYXRpb24gYW5kIGlmIEhERCBkb2VuJ3QgcmVsZWFzZSB0aGlzIGNvbnRleHQsCisgICAgICAgKiBuZXh0IHRpbWUgaWYgYXBwbGljYXRpb24gdXNlcyB0aGUgc2FtZSBoYW5kbGUgdG8gc2V0LXVwIFFvUywgSEREIChhcyBpdCBoYXMKKyAgICAgICAqIFFvUyBjb250ZXh0IGZvciB0aGlzIGhhbmRsZSkgd2lsbCBpc3N1ZSBNb2RpZnkgUW9TIHJlcXVlc3QgdG8gU01FIGJ1dCBTTUUgd2lsbAorICAgICAgICogcmVqZWN0IGFzIG5vIGl0IGhhcyBubyBpbmZvcm1hdGlvbiBmb3IgdGhpcyBmbG93LgorICAgICAgICovCisgICAgICBoZGRfd21tX2ZyZWVfY29udGV4dChwUW9zQ29udGV4dCk7CisgICAgICBicmVhazsKKworICAgY2FzZSBTTUVfUU9TX1NUQVRVU19TRVRVUF9JTlZBTElEX1BBUkFNU19SU1A6CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IFNldHVwIEludmFsaWQgUGFyYW1zLCBub3RpZnkgVEwiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgIC8vIFFvUyBzZXR1cCBmYWlsZWQKKworICAgICAgaWYgKEhERF9XTU1fSEFORExFX0lNUExJQ0lUID09IHBRb3NDb250ZXh0LT5oYW5kbGUpCisgICAgICB7CisKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgIiVzOiBJbXBsaWNpdCBRb3MsIG5vdGlmeWluZyBUTCIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworCisgICAgICAgICAvLyB3ZSBub3RlIHRoZSBmYWlsdXJlLCBidXQgd2UgYWxzbyBtYXJrIGFjY2VzcyBhcyBhbGxvd2VkIHNvIHRoYXQKKyAgICAgICAgIC8vIHRoZSBwYWNrZXRzIHdpbGwgZmxvdy4gIE5vdGUgdGhhdCB0aGUgTUFDIHdpbGwgImRvIHRoZSByaWdodCB0aGluZyIKKyAgICAgICAgIHBBYy0+d21tQWNBY2Nlc3NQZW5kaW5nID0gVk9TX0ZBTFNFOworICAgICAgICAgcEFjLT53bW1BY0FjY2Vzc0ZhaWxlZCA9IFZPU19UUlVFOworICAgICAgICAgcEFjLT53bW1BY0FjY2Vzc0FsbG93ZWQgPSBWT1NfVFJVRTsKKworICAgICAgICAgLy8gdGhpcyB3YXMgdHJpZ2dlcmVkIGJ5IGltcGxpY2l0IFFvUyBzbyB3ZSBrbm93IHBhY2tldHMgYXJlIHBlbmRpbmcKKyAgICAgICAgIHN0YXR1cyA9IFdMQU5UTF9TVEFQa3RQZW5kaW5nKCAoV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcikpLT5wdm9zQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlcikpLT5jb25uX2luZm8uc3RhSWRbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWNUeXBlICk7CisKKyAgICAgICAgIGlmICggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEZhaWxlZCB0byBzaWduYWwgVEwgZm9yIEFDPSVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIGFjVHlwZSApOworICAgICAgICAgfQorICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAiJXM6IEV4cGxpY2l0IFFvcywgbm90aWZ5aW5nIHVzZXJzcGFjZSIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworCisgICAgICAgICAvLyB0aGlzIHdhcyB0cmlnZ2VyZWQgYnkgYW4gYXBwbGljYXRpb24KKyAgICAgICAgIHBRb3NDb250ZXh0LT5sYXN0U3RhdHVzID0gSEREX1dMQU5fV01NX1NUQVRVU19TRVRVUF9GQUlMRURfQkFEX1BBUkFNOworICAgICAgICAgaGRkX3dtbV9ub3RpZnlfYXBwKHBRb3NDb250ZXh0KTsKKyAgICAgIH0KKyAgICAgIGJyZWFrOworCisgICBjYXNlIFNNRV9RT1NfU1RBVFVTX1NFVFVQX05PVF9RT1NfQVBfUlNQOgorICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IFNldHVwIGZhaWxlZCwgbm90IGEgUW9TIEFQIiwKKyAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgaWYgKCFIRERfV01NX0hBTkRMRV9JTVBMSUNJVCA9PSBwUW9zQ29udGV4dC0+aGFuZGxlKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAiJXM6IEV4cGxpY2l0IFFvcywgbm90aWZ5aW5nIHVzZXJzcGFjZSIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworCisgICAgICAgICAvLyB0aGlzIHdhcyB0cmlnZ2VyZWQgYnkgYW4gYXBwbGljYXRpb24KKyAgICAgICAgIHBRb3NDb250ZXh0LT5sYXN0U3RhdHVzID0gSEREX1dMQU5fV01NX1NUQVRVU19TRVRVUF9GQUlMRURfTk9fV01NOworICAgICAgICAgaGRkX3dtbV9ub3RpZnlfYXBwKHBRb3NDb250ZXh0KTsKKyAgICAgIH0KKyAgICAgIGJyZWFrOworCisgICBjYXNlIFNNRV9RT1NfU1RBVFVTX1NFVFVQX1JFUV9QRU5ESU5HX1JTUDoKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgIiVzOiBTZXR1cCBwZW5kaW5nIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAvLyBub3QgYSBjYWxsYmFjayBzdGF0dXMgLS0gaWdub3JlIGlmIHdlIGdldCBpdAorICAgICAgYnJlYWs7CisKKyAgIGNhc2UgU01FX1FPU19TVEFUVVNfU0VUVVBfTU9ESUZJRURfSU5EOgorICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAiJXM6IFNldHVwIG1vZGlmaWVkIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICBpZiAocEN1cnJlbnRRb3NJbmZvKQorICAgICAgeworICAgICAgICAgLy8gdXBkYXRlIHRoZSBUU1BFQworICAgICAgICAgcEFjLT53bW1BY1RzcGVjVmFsaWQgPSBWT1NfVFJVRTsKKyAgICAgICAgIG1lbWNweSgmcEFjLT53bW1BY1RzcGVjSW5mbywKKyAgICAgICAgICAgICAgICBwQ3VycmVudFFvc0luZm8sCisgICAgICAgICAgICAgICAgc2l6ZW9mKHBBYy0+d21tQWNUc3BlY0luZm8pKTsKKworICAgICAgICAgaWYgKEhERF9XTU1fSEFORExFX0lNUExJQ0lUICE9IHBRb3NDb250ZXh0LT5oYW5kbGUpCisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICIlczogRXhwbGljaXQgUW9zLCBub3RpZnlpbmcgdXNlcnNwYWNlIiwKKyAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisKKyAgICAgICAgICAgIC8vIHRoaXMgd2FzIHRyaWdnZXJlZCBieSBhbiBhcHBsaWNhdGlvbgorICAgICAgICAgICAgcFFvc0NvbnRleHQtPmxhc3RTdGF0dXMgPSBIRERfV0xBTl9XTU1fU1RBVFVTX01PRElGSUVEOworICAgICAgICAgICAgaGRkX3dtbV9ub3RpZnlfYXBwKHBRb3NDb250ZXh0KTsKKyAgICAgICAgIH0KKworICAgICAgICAgLy8gbmVlZCB0byB0ZWxsIFRMIHRvIHVwZGF0ZSBpdHMgVUFQU0QgaGFuZGxpbmcKKyAgICAgICAgIGhkZF93bW1fZW5hYmxlX3RsX3VhcHNkKHBRb3NDb250ZXh0KTsKKyAgICAgIH0KKyAgICAgIGJyZWFrOworCisgICBjYXNlIFNNRV9RT1NfU1RBVFVTX1NFVFVQX1NVQ0NFU1NfTk9fQUNNX05PX0FQU0RfUlNQOgorICAgICAgaWYgKEhERF9XTU1fSEFORExFX0lNUExJQ0lUID09IHBRb3NDb250ZXh0LT5oYW5kbGUpCisgICAgICB7CisKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgIiVzOiBJbXBsaWNpdCBRb3MsIG5vdGlmeWluZyBUTCIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworCisgICAgICAgICAvLyB0aGlzIHdhcyB0cmlnZ2VyZWQgYnkgaW1wbGljaXQgUW9TIHNvIHdlIGtub3cgcGFja2V0cyBhcmUgcGVuZGluZworICAgICAgICAgcEFjLT53bW1BY0FjY2Vzc1BlbmRpbmcgPSBWT1NfRkFMU0U7CisgICAgICAgICBwQWMtPndtbUFjQWNjZXNzR3JhbnRlZCA9IFZPU19UUlVFOworICAgICAgICAgcEFjLT53bW1BY0FjY2Vzc0FsbG93ZWQgPSBWT1NfVFJVRTsKKworICAgICAgICAgLy8gbm90aWZ5IFRMIHRoYXQgcGFja2V0cyBhcmUgcGVuZGluZworICAgICAgICAgc3RhdHVzID0gV0xBTlRMX1NUQVBrdFBlbmRpbmcoIChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPnB2b3NDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKSktPmNvbm5faW5mby5zdGFJZFswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY1R5cGUgKTsKKworICAgICAgICAgaWYgKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICIlczogRmFpbGVkIHRvIHNpZ25hbCBUTCBmb3IgQUM9JWQiLAorICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgYWNUeXBlICk7CisgICAgICAgICB9CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICIlczogRXhwbGljaXQgUW9zLCBub3RpZnlpbmcgdXNlcnNwYWNlIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisKKyAgICAgICAgIC8vIHRoaXMgd2FzIHRyaWdnZXJlZCBieSBhbiBhcHBsaWNhdGlvbgorICAgICAgICAgcFFvc0NvbnRleHQtPmxhc3RTdGF0dXMgPSBIRERfV0xBTl9XTU1fU1RBVFVTX1NFVFVQX1NVQ0NFU1NfTk9fQUNNX05PX1VBUFNEOworICAgICAgICAgaGRkX3dt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ciCisgICAgICAgICBwQWMtPndtbUFjQWNjZXNzR3JhbnRlZCA9IFZPU19UUlVFOworICAgICAgICAgcEFjLT53bW1BY0FjY2Vzc0FsbG93ZWQgPSBWT1NfVFJVRTsKKyAgICAgICAgIHBBYy0+d21tQWNBY2Nlc3NGYWlsZWQgPSBWT1NfRkFMU0U7CisgICAgICAgICBwQWMtPndtbUFjQWNjZXNzUGVuZGluZyA9IFZPU19GQUxTRTsKKworICAgICAgICAgLy8gdGhpcyB3YXMgdHJpZ2dlcmVkIGJ5IGltcGxpY2l0IFFvUyBzbyB3ZSBrbm93IHBhY2tldHMgYXJlIHBlbmRpbmcKKyAgICAgICAgIHN0YXR1cyA9IFdMQU5UTF9TVEFQa3RQZW5kaW5nKCAoV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcikpLT5wdm9zQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlcikpLT5jb25uX2luZm8uc3RhSWRbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWNUeXBlICk7CisKKyAgICAgICAgIGlmICggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEZhaWxlZCB0byBzaWduYWwgVEwgZm9yIEFDPSVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIGFjVHlwZSApOworICAgICAgICAgfQorICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAiJXM6I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ZQorICAgICAgICAgbWVtY3B5KCZwQWMtPndtbUFjVHNwZWNJbmZvLAorICAgICAgICAgICAgICAgIHBDdXJyZW50UW9zSW5mbywKKyAgICAgICAgICAgICAgICBzaXplb2YocEFjLT53bW1BY1RzcGVjSW5mbykpOworCisgICAgICAgICAvLyBuZWVkIHRvIHRlbGwgVEwgdG8gdXBkYXRlIGl0cyBVQVBTRCBoYW5kbGluZworICAgICAgICAgaGRkX3dtbV9lbmFibGVfdGxfdWFwc2QocFFvc0NvbnRleHQpOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAiJXM6IGxhc3QgZmxvdyIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworCisgICAgICAgICAvLyB0aGlzIGlzIHRoZSBsYXN0IGZsb3cgYWN0aXZlIGZvciB0aGlzIEFDIHNvIHVwZGF0ZSB0aGUgQUMgc3RhdGUKKyAgICAgICAgIHBBYy0+d21tQWNUc3BlY1ZhbGlkID0gVk9TX0ZBTFNFOworCisgICAgICAgICAvLyBuZWVkIHRvIHRlbGwgVEwgdG8gdXBkYXRlIGl0cyBVQVBTRCBoYW5kbGluZworICAgICAgICAgaGRkX3dtbV9kaXNhYmxlX3RsX3VhcHNkKHBRb3NDb250ZXh0KTsKKyAgICAgIH0KKworICAgICAgaWYgKEhERF9XTU1fSEFORExFX0lNUExJQ0lUICE9IHBRb3NDb250ZXh0LT5oYW5kbGUpCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICIlczogRXhwbGljaXQgUW9zLCBub3RpZnlpbmcgdXNlcnNwYWNlIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisKKyAgICAgICAgIC8vIHRoaXMgd2FzIHRyaWdnZXJlZCBieSBhbiBhcHBsaWNhdGlvbgorICAgICAgICAgcFFvc0NvbnRleHQtPmxhc3RTdGF0dXMgPSBIRERfV0xBTl9XTU1fU1RBVFVTX1JFTEVBU0VfU1VDQ0VTUzsKKyAgICAgICAgIGhkZF93bW1fbm90aWZ5X2FwcChwUW9zQ29udGV4dCk7CisgICAgICB9CisKKyAgICAgIC8vIHdlIGFyZSBkb25lIHdpdGggdGhpcyBmbG93CisgICAgICBoZGRfd21tX2ZyZWVfY29udGV4dChwUW9zQ29udGV4dCk7CisgICAgICBicmVhazsKKworICAgY2FzZSBTTUVfUU9TX1NUQVRVU19SRUxFQVNFX0ZBSUxVUkVfUlNQOgorICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAiJXM6IFJlbGVhc2UgZmFpbHVyZSIsCisgICAgICAgICAgICAgICAgX19mdW5jX18pOworCisgICAgICAvLyB3ZSBkb24ndCBuZWVkIHRvIHVwZGF0ZSBvdXIgc3RhdGUgb3IgVEwgc2luY2Ugbm90aGluZyBoYXMgY2hhbmdlZAorICAgICAgaWYgKEhERF9XTU1fSEFORExFX0lNUExJQ0lUICE9IHBRb3NDb250ZXh0LT5oYW5kbGUpCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICIlczogRXhwbGljaXQgUW9zLCBub3RpZnlpbmcgdXNlcnNwYWNlIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisKKyAgICAgICAgIC8vIHRoaXMgd2FzIHRyaWdnZXJlZCBieSBhbiBhcHBsaWNhdGlvbgorICAgICAgICAgcFFvc0NvbnRleHQtPmxhc3RTdGF0dXMgPSBIRERfV0xBTl9XTU1fU1RBVFVTX1JFTEVBU0VfRkFJTEVEOworICAgICAgICAgaGRkX3dtbV9ub3RpZnlfYXBwKHBRb3NDb250ZXh0KTsKKyAgICAgIH0KKworICAgICAgYnJlYWs7CisKKyAgIGNhc2UgU01FX1FPU19TVEFUVVNfUkVMRUFTRV9RT1NfTE9TVF9JTkQ6CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICIlczogUU9TIExvc3QgaW5kaWNhdGlvbiByZWNlaXZlZCIsCisgICAgICAgICAgICAgICAgX19mdW5jX18pOworCisgICAgICAvLyBjdXJyZW50IFRTUEVDIGlzIG5vIGxvbmdlciB2YWxpZAorICAgICAgcEFjLT53bW1BY1RzcGVjVmFsaWQgPSBWT1NfRkFMU0U7CisKKyAgICAgIC8vIG5lZWQgdG8gdGVsbCBUTCB0byB1cGRhdGUgaXRzIFVBUFNEIGhhbmRsaW5nCisgICAgICBoZGRfd21tX2Rpc2FibGVfdGxfdWFwc2QocFFvc0NvbnRleHQpOworCisgICAgICBpZiAoSEREX1dNTV9IQU5ETEVfSU1QTElDSVQgPT0gcFFvc0NvbnRleHQtPmhhbmRsZSkKKyAgICAgIHsKKyAgICAgICAgIC8vIHdlIG5vIGxvbmdlciBoYXZlIGltcGxpY2l0IGFjY2VzcyBncmFudGVkCisgICAgICAgICBwQWMtPndtbUFjQWNjZXNzR3JhbnRlZCA9IFZPU19GQUxTRTsKKyAgICAgICAgIHBBYy0+d21tQWNBY2Nlc3NGYWlsZWQgPSBWT1NfRkFMU0U7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICAgICAgICAiJXM6IEV4cGxpY2l0IFFvcywgbm90aWZ5aW5nIHVzZXJzcGFjZSIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworCisgICAgICAgICAvLyB0aGlzIHdhcyB0cmlnZ2VyZWQgYnkgYW4gYXBwbGljYXRpb24KKyAgICAgICAgIHBRb3NDb250ZXh0LT5sYXN0U3RhdHVzID0gSEREX1dMQU5fV01NX1NUQVRVU19MT1NUOworICAgICAgICAgaGRkX3dtbV9ub3RpZnlfYXBwKHBRb3NDb250ZXh0KTsKKyAgICAgIH0KKworICAgICAgLy8gd2UgYXJlIGRvbmUgd2l0aCB0aGlzIGZsb3cKKyAgICAgIGhkZF93bW1fZnJlZV9jb250ZXh0KHBRb3NDb250ZXh0KTsKKyAgICAgIGJyZWFrOworCisgICBjYXNlIFNNRV9RT1NfU1RBVFVTX1JFTEVBU0VfUkVRX1BFTkRJTkdfUlNQOgorICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAgICAgIiVzOiBSZWxlYXNlIHBlbmRpbmciLAorICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgIC8vIG5vdCBhIGNhbGxiYWNrIHN0YXR1cyAtLSBpZ25vcmUgaWYgd2UgZ2V0IGl0CisgICAgICBicmVhazsKKworICAgY2FzZSBTTUVfUU9TX1NUQVRVU19SRUxFQVNFX0lOVkFMSURfUEFSQU1TX1JTUDoKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogUmVsZWFzZSBJbnZhbGlkIFBhcmFtcyIsCisgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgaWYgKEhERF9XTU1fSEFORExFX0lNUExJQ0lUICE9IHBRb3NDb250ZXh0LT5oYW5kbGUpCisgICAgICB7CisgICAgICAgICAvLyB0aGlzIHdhcyB0cmlnZ2VyZWQgYnkgYW4gYXBwbGljYXRpb24KKyAgICAgICAgIHBRb3NDb250ZXh0LT5sYXN0U3RhdHVzID0gSEREX1dMQU5fV01NX1NUQVRVU19SRUxFQVNFX0ZBSUxFRF9CQURfUEFSQU07CisgICAgICAgICBoZGRfd21tX25vdGlmeV9hcHAocFFvc0NvbnRleHQpOworICAgICAgfQorICAgICAgYnJlYWs7CisKKyAgIGNhc2UgU01FX1FPU19TVEFUVVNfTU9ESUZZX1NFVFVQX1NVQ0NFU1NfSU5EOgorICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAgICAgIiVzOiBNb2RpZmljYXRpb24gaXMgY29tcGxldGUsIG5vdGlmeSBUTCIsCisgICAgICAgICAgICAgICAgX19mdW5jX18pOworCisgICAgICAvLyB0aGVyZSB3aWxsIGFsd2F5cyBiZSBhIFRTUEVDIHJldHVybmVkIHdpdGggdGhpcyBzdGF0dXMsIGV2ZW4gaWYKKyAgICAgIC8vIGEgVFNQRUMgaXMgbm90IGV4Y2hhbmdlZCBPVEEKKyAgICAgIGlmIChwQ3VycmVudFFvc0luZm8pCisgICAgICB7CisgICAgICAgICBwQWMtPndtbUFjVHNwZWNWYWxpZCA9IFZPU19UUlVFOworICAgICAgICAgbWVtY3B5KCZwQWMtPndtbUFjVHNwZWNJbmZvLAorICAgICAgICAgICAgICAgIHBDdXJyZW50UW9zSW5mbywKKyAgICAgICAgICAgICAgICBzaXplb2YocEFjLT53bW1BY1RzcGVjSW5mbykpOworICAgICAgfQorCisgICAgICBpZiAoSEREX1dNTV9IQU5ETEVfSU1QTElDSVQgIT0gcFFvc0NvbnRleHQtPmhhbmRsZSkKKyAgICAgIHsKKyAgICAgICAgIC8vIHRoaXMgd2FzIHRyaWdnZXJlZCBieSBhbiBhcHBsaWNhdGlvbgorICAgICAgICAgcFFvc0NvbnRleHQtPmxhc3RTdGF0dXMgPSBIRERfV0xBTl9XTU1fU1RBVFVTX01PRElGWV9TVUNDRVNTOworICAgICAgICAgaGRkX3d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l9XTU1fU1RBVFVTX01PRElGWV9GQUlMRUQ7CisgICAgICAgICBoZGRfd21tX25vdGlmeV9hcHAocFFvc0NvbnRleHQpOworICAgICAgfQorICAgICAgYnJlYWs7CisKKyAgIGNhc2UgU01FX1FPU19TVEFUVVNfTU9ESUZZX1NFVFVQX1BFTkRJTkdfUlNQOgorICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAgICAgIiVzOiBtb2RpZmljYXRpb24gcGVuZGluZyIsCisgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgLy8gbm90IGEgY2FsbGJhY2sgc3RhdHVzIC0tIGlnbm9yZSBpZiB3ZSBnZXQgaXQKKyAgICAgIGJyZWFrOworCisgICBjYXNlIFNNRV9RT1NfU1RBVFVTX01PRElGWV9TRVRVUF9TVUNDRVNTX05PX0FDTV9OT19BUFNEX1JTUDoKKyAgICAgIC8vIHRoZSBmbG93IG1vZGlmaWNhdGlvbiB3YXMgc3VjY2Vzc2Z1bCBidXQgbm8gUW9TIGNoYW5nZXMgcmVxdWlyZWQKKworICAgICAgaWYgKEhERF9XTU1fSEFORExFX0lNUExJQ0lUICE9IHBRb3NDb250ZXh0LT5oYW5kbGUpCisgICAgICB7CisgICAgICAgICAvLyB0aGlzIHdhcyB0cmlnZ2VyZWQgYnkgYW4gYXBwbGljYXRpb24KKyAgICAgICAgIHBRb3NDb250ZXh0LT5sYXN0U3RhdHVzID0gSEREX1dMQU5fV01NX1NUQVRVU19NT0RJRllfU1VDQ0VTU19OT19BQ01fTk9fVUFQU0Q7CisgICAgICAgICBoZGRfd21tX25vdGlmeV9hcHAocFFvc0NvbnRleHQpOworICAgICAgfQorICAgICAgYnJlYWs7CisKKyAgIGNhc2UgU01FX1FPU19TVEFUVVNfTU9ESUZZX1NFVFVQX0lOVkFMSURfUEFSQU1TX1JTUDoKKyAgICAgIC8vIGludmFsaWQgcGFyYW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VFVTX1NVQ0NFU1M7Cit9CisjZW5kaWYKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfd21tcHNfaGVscGVyKCkgLSBGdW5jdGlvbiB0byBzZXQgdWFwc2QgcHNiIGR5bmFtaWNhbGx5CisKKyAgQHBhcmFtIHBBZGFwdGVyICAgICA6IFtpbl0gcG9pbnRlciB0byBhZGFwdGVyIHN0cnVjdHVyZQorCisgIEBwYXJhbSBwdHIgICAgICAgICAgOiBbaW5dIHBvaW50ZXIgdG8gY29tbWFuZCBidWZmZXIKKworICBAcmV0dXJuICAgICAgICAgICAgIDogWmVybyBvbiBzdWNjZXNzLCBhcHByb3ByaWF0ZSBlcnJvciBvbiBmYWlsdXJlLgorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitpbnQgaGRkX3dtbXBzX2hlbHBlcihoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwgdEFOSV9VOCAqcHRyKQoreworICAgaWYgKE5VTEwgPT0gcEFkYXB0ZXIpCisgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogcEFkYXB0ZXIgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgIH0KKyAgIGlmIChOVUxMID09IHB0cikKKyAgIHsKKyAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBwdHIgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgIH0KKyAgIC8qIGNvbnZlcnQgQVNDSUkgdG8gaW50ZWdlciAqLworICAgcEFkYXB0ZXItPmNvbmZpZ3VyZWRQc2IgPSBwdHJbOV0gLSAnMCc7CisgICBwQWRhcHRlci0+cHNiQ2hhbmdlZCA9IEhERF9QU0JfQ0hBTkdFRDsKKworICAgcmV0dXJuIDA7Cit9CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF93bW1fZG9faW1wbGljaXRfcW9zKCkgLSBGdW5jdGlvbiB3aGljaCB3aWxsIGF0dGVtcHQgdG8gc2V0dXAKKyAgUW9TIGZvciBhbnkgQUMgcmVxdWlyaW5nIGl0CisKKyAgQHBhcmFtIHdvcmsgICAgIDogW2luXSAgcG9pbnRlciB0byB3b3JrIHN0cnVjdHVyZQorCisgIEByZXR1cm4gICAgICAgICA6IHZvaWQKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3N0YXRpYyB2b2lkIF9faGRkX3dtbV9kb19pbXBsaWNpdF9xb3Moc3RydWN0IHdvcmtfc3RydWN0ICp3b3JrKQoreworICAgaGRkX3dtbV9xb3NfY29udGV4dF90KiBwUW9zQ29udGV4dCA9CisgICAgICBjb250YWluZXJfb2Yod29yaywgaGRkX3dtbV9xb3NfY29udGV4dF90LCB3bW1BY1NldHVwSW1wbGljaXRRb3MpOworICAgaGRkX2FkYXB0ZXJfdCogcEFkYXB0ZXI7CisgICBXTEFOVExfQUNFbnVtVHlwZSBhY1R5cGU7CisgICBoZGRfd21tX2FjX3N0YXR1c190ICpwQWM7CisjaWZuZGVmIFdMQU5fTURNX0NPREVfUkVEVUNUSU9OX09QVAorICAgVk9TX1NUQVRVUyBzdGF0dXM7CisgICBzbWVfUW9zU3RhdHVzVHlwZSBzbWVTdGF0dXM7CisjZW5kaWYKKyAgIHNtZV9Rb3NXbW1Uc3BlY0luZm8gcW9zSW5mbzsKKyAgIHZfQ09OVEVYVF90IHBWb3NDb250ZXh0ID0gdm9zX2dldF9nbG9iYWxfY29udGV4dCggVk9TX01PRFVMRV9JRF9IREQsIE5VTEwgKTsKKyAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisgICBpbnQgcmV0ID0gMDsKKworICAgaWYgKE5VTEwgPT0gcFZvc0NvbnRleHQpCisgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICBGTCgicFZvc0NvbnRleHQgaXMgTlVMTCIpKTsKKyAgICAgICAgIHJldHVybjsKKyAgIH0KKworICAgcEhkZEN0eCA9IHZvc19nZXRfY29udGV4dCggVk9TX01PRFVMRV9JRF9IREQsIHBWb3NDb250ZXh0KTsKKworICAgcmV0ID0gd2xhbl9oZGRfdmFsaWRhdGVfY29udGV4dChwSGRkQ3R4KTsKKyAgIGlmICgwICE9IHJldCkKKyAgIHsKKyAgICAgICBoZGRMb2coTE9HRSwgRkwoIkhERCBjb250ZXh0IGlzIGludmFsaWQiKSk7CisgICAgICAgcmV0dXJuOworICAgfQorCisgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICAiJXM6IEVudGVyZWQsIGNvbnRleHQgJXAiLAorICAgICAgICAgICAgIF9fZnVuY19fLCBwUW9zQ29udGV4dCk7CisKKyAgIG11dGV4X2xvY2soJnBIZGRDdHgtPndtbUxvY2spOworICAgaWYgKHVubGlrZWx5KEhERF9XTU1fQ1RYX01BR0lDICE9IHBRb3NDb250ZXh0LT5tYWdpYykpCisgICB7CisgICAgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPndtbUxvY2spOworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIFFvUyBDb250ZXh0IiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICByZXR1cm47CisgICB9CisgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPndtbUxvY2spOworCisgICBwQWRhcHRlciA9IHBRb3NDb250ZXh0LT5wQWRhcHRlcjsKKyAgIGFjVHlwZSA9IHBRb3NDb250ZXh0LT5hY1R5cGU7CisgICBwQWMgPSAmcEFkYXB0ZXItPmhkZFdtbVN0YXR1cy53bW1BY1N0YXR1c1thY1R5cGVdOworCisgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICAiJXM6IHBBZGFwdGVyICVwIGFjVHlwZSAlZCIsCisgICAgICAgICAgICAgX19mdW5jX18sIHBBZGFwdGVyLCBhY1R5cGUpOworCisgICBpZiAoIXBBYy0+d21tQWNBY2Nlc3NOZWVkZWQpCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IEFDICVkIGRvZXNuJ3QgbmVlZCBzZXJ2aWNlIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgYWNUeXBlKTsKKyAgICAgIHBRb3NDb250ZXh0LT5tYWdpYyA9IDA7CisgICAgICBrZnJlZShwUW9zQ29udGV4dCk7CisgICAgICByZXR1cm47CisgICB9CisKKyAgIHBBYy0+d21tQWNBY2Nlc3NQZW5kaW5nID0gVk9TX1RSVUU7CisgICBwQWMtPndtbUFjQWNjZXNzTmVlZGVkID0gVk9TX0ZBTFNFOworCisgICBtZW1zZXQoJnFvc0luZm8sIDAsIHNpemVvZihxb3NJbmZvKSk7CisKKyAgIHFvc0luZm8udHNfaW5mby5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gICAgICAgcW9zSW5mby50c19pbmZvLmFja19wb2xpY3kgPSBTTUVfUU9TX1dNTV9UU19BQ0tfUE9MSUNZX0hUX0lNTUVESUFURV9CTE9DS19BQ0s7CisgICAgICAgYnJlYWs7CisKKyAgICAgZGVmYXVsdDoKKyAgICAgICAvLyB1bmtub3duCisgICAgICAgcW9zSW5mby50c19pbmZvLmFja19wb2xpY3kgPSBTTUVfUU9TX1dNTV9UU19BQ0tfUE9MSUNZX05PUk1BTF9BQ0s7CisgICB9CisKKyAgIGlmKHFvc0luZm8udHNfaW5mby5hY2tfcG9saWN5ID09IFNNRV9RT1NfV01NX1RTX0FDS19QT0xJQ1lfSFRfSU1NRURJQVRFX0JMT0NLX0FDSykKKyAgIHsKKyAgICAgaWYoIXNtZV9Rb3NJc1RTSW5mb0Fja1BvbGljeVZhbGlkKCh0cEFuaVNpckdsb2JhbClXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlciksICZxb3NJbmZvLCBwQWRhcHRlci0+c2Vzc2lvbklkKSkKKyAgICAgeworICAgICAgIHFvc0luZm8udHNfaW5mby5hY2tfcG9saWN5ID0gU01FX1FPU19XTU1fVFNfQUNLX1BPTElDWV9OT1JNQUxfQUNLOworICAgICB9CisgICB9CisKKyAgIG11dGV4X2xvY2soJnBIZGRDdHgtPndtbUxvY2spOworICAgbGlzdF9hZGQoJnBRb3NDb250ZXh0LT5ub2RlLCAmcEFkYXB0ZXItPmhkZFdtbVN0YXR1cy53bW1Db250ZXh0TGlzdCk7CisgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPndtbUxvY2spOworCisjaWZuZGVmIFdMQU5fTURNX0NPREVfUkVEVUNUSU9OX09QVAorICAgc21lU3RhdHVzID0gc21lX1Fvc1NldHVwUmVxKFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlci0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZxb3NJbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhkZF93bW1fc21lX2NhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBRb3NDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHFvc0luZm8udHNfaW5mby51cCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFFvc0NvbnRleHQtPnFvc0Zsb3dJZCk7CisKKyAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgIiVzOiBzbWVfUW9zU2V0dXBSZXEgcmV0dXJuZWQgJWQgZmxvd2lkICVkIiwKKyAgICAgICAgICAgICBfX2Z1bmNfXywgc21lU3RhdHVzLCBwUW9zQ29udGV4dC0+cW9zRmxvd0lkKTsKKworICAgLy8gbmVlZCB0byBjaGVjayB0aGUgcmV0dXJuIHZhbHVlcyBhbmQgYWN0IGFwcHJvcHJpYXRlbHkKKyAgIHN3aXRjaCAoc21lU3RhdHVzKQorICAgeworICAgY2FzZSBTTUVfUU9TX1NUQVRVU19TRVRVUF9SRVFfUEVORElOR19SU1A6CisgICBjYXNlIFNNRV9RT1NfU1RBVFVTX1NFVFVQX1NVQ0NFU1NfSU5EX0FQU0RfUEVORElORzoKKyAgICAgIC8vIHNldHVwIGlzIHBlbmRpbmcsIHNvIG5vIG1vcmUgd29yayB0byBkbyBub3cuCisgICAgICAvLyBhbGwgZnVydGhlciB3b3JrIHdpbGwgYmUgZG9uZSBpbiBoZGRfd21tX3NtZV9jYWxsYmFjaygpCisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICAgICAiJXM6IFNldHVwIGlzIHBlbmRpbmcsIG5vIGZ1cnRoZXIgd29yayIsCisgICAgICAgICAgICAg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VywKKyAgICAgICAgICAgICAgICAiJXM6IFNldHVwIGlzIGNvbXBsZXRlLCBub3RpZnkgVEwiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKworICAgICAgcEFjLT53bW1BY0FjY2Vzc0FsbG93ZWQgPSBWT1NfVFJVRTsKKyAgICAgIHBBYy0+d21tQWNBY2Nlc3NHcmFudGVkID0gVk9TX1RSVUU7CisgICAgICBwQWMtPndtbUFjQWNjZXNzUGVuZGluZyA9IFZPU19GQUxTRTsKKworICAgICAgc3RhdHVzID0gV0xBTlRMX1NUQVBrdFBlbmRpbmcoIChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPnB2b3NDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKSktPmNvbm5faW5mby5zdGFJZFswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY1R5cGUgKTsKKworICAgICAgaWYgKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICIlczogRmFpbGVkIHRvIHNpZ25hbCBUTCBmb3IgQUM9JWQiLAorICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgYWNUeXBlICk7CisgICAgICB9CisKKyAgICAgIGJyZWFrOworCisKKyAgIGRlZmF1bHQ6CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogdW5leHBlY3RlZCBTTUUgU3RhdHVzPSVkIiwKKyAgICAgICAgICAgICAgICAgX19mdW5jX18sIHNtZVN0YXR1cyApOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgIH0KKyNlbmRpZgorCit9CisKK3N0YXRpYyB2b2lkIGhkZF93bW1fZG9faW1wbGljaXRfcW9zKHN0cnVjdCB3b3JrX3N0cnVjdCAqd29yaykKK3sKKyAgICB2b3Nfc3NyX3Byb3RlY3QoX19mdW5jX18pOworICAgIF9faGRkX3dtbV9kb19pbXBsaWNpdF9xb3MoIHdvcmsgKTsKKyAgICB2b3Nfc3NyX3VucHJvdGVjdChfX2Z1bmNfXyk7Cit9CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF93bW1faW5pdCgpIC0gRnVuY3Rpb24gd2hpY2ggd2lsbCBpbml0aWFsaXplIHRoZSBXTU0gY29uZmlndWF0aW9uCisgIGFuZCBzdGF0dXMgdG8gYW4gaW5pdGlhbCBzdGF0ZS4gIFRoZSBjb25maWd1cmF0aW9uIGNhbiBsYXRlciBiZSBvdmVyd3JpdHRlbgorICB2aWEgYXBwbGljYXRpb24gQVBJcworCisgIEBwYXJhbSBwQWRhcHRlciA6IFtpbl0gIHBvaW50ZXIgdG8gQWRhcHRlciBjb250ZXh0CisKKyAgQHJldHVybiAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIGlmIHN1Y2Nlc3NmdWwKKyAgICAgICAgICAgICAgICAgIDogb3RoZXIgdmFsdWVzIGlmIGZhaWx1cmUKKworICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBoZGRfd21tX2luaXQgKCBoZGRfYWRhcHRlcl90ICpwQWRhcHRlciApCit7CisgICBzbWVfUW9zV21tVXBUeXBlKiBoZGRXbW1Ec2NwVG9VcE1hcCA9IHBBZGFwdGVyLT5oZGRXbW1Ec2NwVG9VcE1hcDsKKyAgIHZfVThfdCB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+d21tQWNVYXBzZEluZm9WYWxpZCA9IFZPU19GQUxTRTsKKyAgIH0KKyAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF93bW1fY2xvc2UoKSAtIEZ1bmN0aW9uIHdoaWNoIHdpbGwgcGVyZm9ybSBhbnkgbmVjZXNzYXJ5IHdvcmsgdG8KKyAgdG8gY2xlYW4gdXAgdGhlIFdNTSBmdW5jdGlvbmFsaXR5IHByaW9yIHRvIHRoZSBrZXJuZWwgbW9kdWxlIHVubG9hZAorCisgIEBwYXJhbSBwQWRhcHRlciA6IFtpbl0gIHBvaW50ZXIgdG8gYWRhcHRlciBjb250ZXh0CisKKyAgQHJldHVybiAgICAgICAgIDogVk9TX1NUQVRVU19TVUNDRVNTIGlmIHN1Y2Nzc2Z1bAorICAgICAgICAgICAgICAgICAgOiBvdGhlciB2YWx1ZXMgaWYgZmFpbHVyZQorCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIGhkZF93bW1fYWRhcHRlcl9jbG9zZSAoIGhkZF9hZGFwdGVyX3QqIHBBZGFwdGVyICkKK3sKKyAgIGhkZF93bW1fcW9zX2NvbnRleHRfdCogcFFvc0NvbnRleHQ7CisgICB2X0NPTlRFWFRfdCBwVm9zQ29udGV4dCA9IHZvc19nZXRfZ2xvYmFsX2NvbnRleHQoIFZPU19NT0RVTEVfSURfSERELCBOVUxMICk7CisgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4OworCisgICBpZiAoTlVMTCA9PSBwVm9zQ29udGV4dCkKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVM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pZiAocFFvc0NvbnRleHQtPmhhbmRsZSA9PSBIRERfV01NX0hBTkRMRV9JTVBMSUNJVAorICAgICAgICYmIHBRb3NDb250ZXh0LT5tYWdpYyA9PSBIRERfV01NX0NUWF9NQUdJQykKKyAgIHsKKworICAgICAgdm9zX2ZsdXNoX3dvcmsoJnBRb3NDb250ZXh0LT53bW1BY1NldHVwSW1wbGljaXRRb3MpOworICAgfQorICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT53bW1Mb2NrKTsKKworICAgICAgaGRkX3dtbV9mcmVlX2NvbnRleHQocFFvc0NvbnRleHQpOworICAgfQorCisgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfQorCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfaXNfZGhjcF9wYWNrZXQoKSAtIEZ1bmN0aW9uIHdoaWNoIHdpbGwgY2hlY2sgT1MgcGFja2V0IGZvcgorICBESENQIHBhY2tldAorCisgIEBwYXJhbSBza2IgICAgICA6IFtpbl0gIHBvaW50ZXIgdG8gT1MgcGFja2V0IChza19idWZmKQorICBAcmV0dXJuICAgICAgICAgOiBWT1NfVFJVRSBpZiB0aGUgT1MgcGFja2V0IGlzIERIQ1AgcGFja2V0CisgICAgICAgICAgICAgICAgICA6IG90aGVyd2lzZSBWT1NfRkFMU0UKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZfQk9PTF90IGhkZF9pc19kaGNwX3BhY2tldChzdHJ1Y3Qgc2tfYnVmZiAqc2tiKQoreworICAgaWYgKCooKHUxNiopKCh1OCopc2tiLT5kYXRhKzM0KSkgPT0gREhDUF9TT1VSQ0VfUE9SVCB8fAorICAgICAgICooKHUxNiopKCh1OCopc2tiLT5kYXRhKzM0KSkgPT0gREhDUF9ERVNUSU5BVElPTl9QT1JUKQorICAgICAgcmV0dXJuIFZPU19UUlVFOworCisgICByZXR1cm4gVk9TX0ZBTFNFOworfQorCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfc2tiX2lzX2VhcG9sX29yX3dhaV9wYWNrZXQoKSAtIEZ1bmN0aW9uIHdoaWNoIHdpbGwgY2hlY2sgT1MgcGFja2V0CisgIGZvciBFYXBvbC9XYXBpIHBhY2tldAorCisgIEBwYXJhbSBza2IgICAgICA6IFtpbl0gIHBvaW50ZXIgdG8gT1MgcGFja2V0IChza19idWZmKQorICBAcmV0dXJuICAgICAgICAgOiBWT1NfVFJVRSBpZiB0aGUgT1MgcGFja2V0IGlzIGFuIEVhcG9sIG9yIGEgV2FwaSBwYWNrZXQKKyAgICAgICAgICAgICAgICAgIDogb3RoZXJ3aXNlIFZPU19GQUxTRQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordl9CT09MX3QgaGRkX3NrYl9pc19lYXBvbF9vcl93YWlfcGFja2V0KHN0cnVjdCBza19idWZmICpza2IpCit7CisgICAgaWYgKCgqKCh1MTYqKSgodTgqKXNrYi0+ZGF0YStIRERfRVRIRVJUWVBFXzgwMl8xX1hfRlJBTUVfT0ZGU0VUKSkKKyAgICAgICAgID09IHZvc19jcHVfdG9fYmUxNihIRERfRVRIRVJUWVBFXzgwMl8xX1gpKQorI2lmZGVmIEZFQVRVUkVfV0xBTl9XQVBJCisgICAgICAgICB8fCAoKigodTE2KikoKHU4Kilza2ItPmRhdGErSEREX0VUSEVSVFlQRV84MDJfMV9YX0ZSQU1FX09GRlNFVCkpCisgICAgICAgICA9PSB2b3NfY3B1X3RvX2JlMTYoSEREX0VUSEVSVFlQRV9XQUkpKQorI2VuZGlmCisgICAgICAgKQorICAgICAgIHJldHVybiBWT1NfVFJVRTsKKworICAgIHJldHVybiBWT1NfRkFMU0U7Cit9CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF93bW1fY2xhc3NpZnlfcGt0KCkgLSBGdW5jdGlvbiB3aGljaCB3aWxsIGNsYXNzaWZ5IGFuIE9TIHBhY2tldAorICBpbnRvIGEgV01NIEFDIGJhc2VkIG9uIGVpdGhlciA4MDIuMVEgb3IgRFNDUAorCisgIEBwYXJhbSBwQWRhcHRlciA6IFtpbl0gIHBvaW50ZXIgdG8gYWRhcHRlciBjb250ZXh0CisgIEBwYXJhbSBza2IgICAgICA6IFtpbl0gIHBvaW50ZXIgdG8gT1MgcGFja2V0IChza19idWZmKQorICBAcGFyYW0gcEFjVHlwZSAgOiBbb3V0XSBwb2ludGVyIHRvIFdNTSBBQyB0eXBlIG9mIE9TIHBhY2tldAorCisgIEByZXR1cm4gICAgICAgICA6IE5vbmUKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZfVk9JRF90IGhkZF93bW1fY2xhc3NpZnlfcGt0ICggaGRkX2FkYXB0ZXJfdCogcEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBza19idWZmICpza2IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9BQ0VudW1UeXBlKiBwQWNUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbWVfUW9zV21tVXBUeXBlICpwVXNlclByaSkKK3sKKyAgIHVuc2lnbmVkIGNoYXIgKiBwUGt0OworICAgdW5pb24gZ2VuZXJpY19ldGhoZHIgKnBIZHI7CisgICBzdHJ1Y3QgaXBoZHIgKnBJcEhkcjsKK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ICAgICAgICAgcElwSGRyID0gKHN0cnVjdCBpcGhkciAqKSZwUGt0W3NpemVvZihwSGRyLT5ldGhfSUkpXTsKKyAgICAgICAgIHRvcyA9IHBJcEhkci0+dG9zOworI2lmZGVmIEhERF9XTU1fREVCVUcKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgICAgICAgICIlczogRXRoZXJuZXQgSUkgSVAgUGFja2V0LCB0b3MgaXMgJWQiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCB0b3MpOworI2VuZGlmIC8vIEhERF9XTU1fREVCVUcKKworICAgICAgfQorICAgICAgZWxzZSBpZiAoKG50b2hzKHBIZHItPmV0aF9JSS5oX3Byb3RvKSA8IFdMQU5fTUlOX1BST1RPKSAmJgorICAgICAgICAgICAgICAgKHBIZHItPmV0aF84MDIzLmhfc25hcC5kc2FwID09IFdMQU5fU05BUF9EU0FQKSAmJgorICAgICAgICAgICAgICAgKHBIZHItPmV0aF84MDIzLmhfc25hcC5zc2FwID09IFdMQU5fU05BUF9TU0FQKSAmJgorICAgICAgICAgICAgICAgKHBIZHItPmV0aF84MDIzLmhfc25hcC5jdHJsID09IFdMQU5fU05BUF9DVFJMKSAmJgorICAgICAgICAgICAgICAgKHBIZHItPmV0aF84MDIzLmhfcHJvdG8gPT0gaHRvbnMoRVRIX1BfSVApKSkKKyAgICAgIHsKKyAgICAgICAgIC8vIGNhc2UgMjogODAyLjMgTExDL1NOQVAgSVAgcGFja2V0CisgICAgICAgICBwSXBIZHIgPSAoc3RydWN0IGlwaGRyICopJnBQa3Rbc2l6ZW9mKHBIZHItPmV0aF84MDIzKV07CisgICAgICAgICB0b3MgPSBwSXBIZHItPnRvczsKKyNpZmRlZiBIRERfV01NX0RFQlVHCisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICAgICAgICAiJXM6IDgwMi4zIExMQy9TTkFQIElQIFBhY2tldCwgdG9zIGlzICVkIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgdG9zKTsKKyNlbmRpZiAvLyBIRERfV01NX0RFQlVHCisgICAgICB9CisgICAgICBlbHNlIGlmIChwSGRyLT5ldGhfSUkuaF9wcm90byA9PSBodG9ucyhFVEhfUF84MDIxUSkpCisgICAgICB7CisgICAgICAgICAvLyBWTEFOIHRhZ2dlZAorCisgICAgICAgICBpZiAocEhkci0+ZXRoX0lJdi5oX3ZsYW5fZW5jYXBzdWxhdGVkX3Byb3RvID09IGh0b25zKEVUSF9QX0lQKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIC8vIGNhc2UgMzogRXRoZXJuZXQgSUkgdmxhbi10YWdnZWQgSVAgcGFja2V0CisgICAgICAgICAgICBwSXBIZHIgPSAoc3RydWN0IGlwaGRyICopJnBQa3Rbc2l6ZW9mKHBIZHItPmV0aF9JSXYpXTsKKyAgICAgICAgICAgIHRvcyA9IHBJcEhkci0+dG9zOworI2lmZGVmIEhERF9XTU1fREVCVUcKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgICAgICAgICAgICIlczogRXRoZXJuZXQgSUkgVkxBTiB0YWdnZWQgSVAgUGFja2V0LCB0b3MgaXMgJWQiLAorICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCB0b3MpOworI2VuZGlmIC8vIEhERF9XTU1fREVCVUcKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UgaWYgKChudG9ocyhwSGRyLT5ldGhfSUl2Lmhfdmxhbl9lbmNhcHN1bGF0ZWRfcHJvdG8pIDwgV0xBTl9NSU5fUFJPVE8pICYmCisgICAgICAgICAgICAgICAgICAocEhkci0+ZXRoXzgwMjN2Lmhfc25hcC5kc2FwID09IFdMQU5fU05BUF9EU0FQKSAmJgorICAgICAgICAgICAgICAgICAgKHBIZHItPmV0aF84MDIzdi5oX3NuYXAuc3NhcCA9PSBXTEFOX1NOQVBfU1NBUCkgJiYKKyAgICAgICAgICAgICAgICAgIChwSGRyLT5ldGhfODAyM3YuaF9zbmFwLmN0cmwgPT0gV0xBTl9TTkFQX0NUUkwpICYmCisgICAgICAgICAgICAgICAgICAocEhkci0+ZXRoXzgwMjN2LmhfcHJvdG8gPT0gaHRvbnMoRVRIX1BfSVApKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIC8vIGNhc2UgNDogODAyLjMgTExDL1NOQVAgdmxhbi10YWdnZWQgSVAgcGFja2V0CisgICAgICAgICAgICBwSXBIZHIgPSAoc3RydWN0IGlwaGRyICopJnBQa3Rbc2l6ZW9mKHBIZHItPmV0aF84MDIzdildOworICAgICAgICAgICAgdG9zID0gcElwSGRyLT50b3M7CisjaWZkZWYgSEREX1dNTV9ERUJVRworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiA4MDIuMyBMTEMvU05BUCBWTEFOIHRhZ2dlZCBJUCBQYWNrZXQsIHRvcyBpcyAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHRvcyk7CisjZW5kaWYgLy8gSEREX1dNTV9ERUJVRworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgLy8gZGVmYXVsdAorI2lmZGVmIEhERF9XTU1fREVCVUcKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBWTEFOIHRhZ2dlZCBVbmhhbmRsZWQgUHJvdG9jb2wsIHVzaW5nIGRlZmF1bHQgdG9zIiwKKyAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisjZW5kaWYgLy8gSEREX1dNTV9ERUJVRworICAgICAgICAgICAgdG9zID0gMDsKKyAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgICB2X0JPT0xfdCB0b2dnbGVBcnBCRFJhdGVzID0KKyAgICAgICAgICAgICAgICAgICAgICAgIChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPmNmZ19pbmktPnRvZ2dsZUFycEJEUmF0ZXM7CisgICAgICAgICAgLy8gZGVmYXVsdAorI2lmZGVmIEhERF9XTU1fREVCVUcKKyAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgIiVzOiBVbmhhbmRsZWQgUHJvdG9jb2wsIHVzaW5nIGRlZmF1bHQgdG9zIiwKKyAgICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyNlbmRpZiAvLyBIRERfV01NX0RFQlVHCisgICAgICAgICAgLy9HaXZlIHRoZSBoaWdoZXN0IHByaW9yaXR5IHRvIDgwMi4xeCBwYWNrZXQKKyAgICAgICAgICBpZiAocEhkci0+ZXRoX0lJLmhfcHJvdG8gPT0gaHRvbnMoSEREX0VUSEVSVFlQRV84MDJfMV9YKSkKKyAgICAgICAgICAgICAgdG9zID0gMHhDMDsKKyAgICAgICAgICBlbHNlIGlmICh0b2dnbGVBcnBCRFJhdGVzICYmCisgICAgICAgICAgICAgICAgICAgcEhkci0+ZXRoX0lJLmhfcHJvdG8gPT0gaHRvbnMoSEREX0VUSEVSVFlQRV9BUlApKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdG9zID0gVElEMzsKKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB0b3MgPSAwOworICAgICAgfQorCisgICAgICBkc2NwID0gKHRvcz4+MikgJiAweDNmOworICAgICAgdXNlclByaSA9IHBBZGFwdGVyLT5oZGRXbW1Ec2NwVG9VcE1hcFtkc2NwXTsKKworI2lmZGVmIEhERF9XTU1fREVCVUcKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgIiVzOiB0b3MgaXMgJWQsIGRzY3AgaXMgJWQsIHVwIGlzICVkIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgdG9zLCBkc2NwLCB1c2VyUHJpKTsKKyNlbmRpZiAvLyBIRERfV01NX0RFQlVHCisKKyAgIH0KKyAgIGVsc2UgaWYgKEhERF9XTU1fQ0xBU1NJRklDQVRJT05fODAyXzFRID09IChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPmNmZ19pbmktPlBrdENsYXNzaWZpY2F0aW9uQmFzaXMpCisgICB7CisgICAgICBpZiAocEhkci0+ZXRoX0lJdi5oX3ZsYW5fcHJvdG8gPT0gaHRvbnMoRVRIX1BfODAyMVEpKQorICAgICAgeworICAgICAgICAgLy8gVkxBTiB0YWdnZWQKKyAgICAgICAgIHVzZXJQcmkgPSAobnRvaHMocEhkci0+ZXRoX0lJdi5oX3ZsYW5fVENJKT4+MTMpICYgMHg3OworI2lmZGVmIEhERF9XTU1fREVCVUcKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgIiVzOiBUYWdnZWQgZnJhbWUsIFVQIGlzICVkIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgdXNlclByaSk7CisjZW5kaWYgLy8gSEREX1dNTV9ERUJVRworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgIC8vIG5vdCBWTEFOIHRhZ2dlZCwgdXNlIGRlZmF1bHQKKyNpZmRlZiBIRERfV01NX0RFQlVHCisgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgICAgICIlczogVW50YWdnZWQgZnJhbWUsIHVzaW5nIGRlZmF1bHQgVVAiLAorICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworI2VuZGlmIC8vIEhERF9XTU1fREVCVUcKKyAgICAgICAgICAvL0dpdmUgdGhlIGhpZ2hlc3QgcHJpb3JpdHkgdG8gODAyLjF4IHBhY2tldAorICAgICAgICAgIGlmIChwSGRyLT5ldGhfSUkuaF9wcm90byA9PSBodG9ucyhIRERfRVRIRVJUWVBFXzgwMl8xX1gpKQorICAgICAgICAgICAgICB1c2VyUHJpID0gU01FX1FPU19XTU1fVVBfVk87CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB1c2VyUHJpID0gU01FX1FPU19XTU1fVVBfQkU7CisgICAgICB9CisgICB9CisgICBlbHNlCisgICB7CisgICAgICAvLyBkZWZhdWx0CisjaWZkZWYgSEREX1dNTV9ERUJVRworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOiBVbmtub3duIGNsYXNzaWZpY2F0aW9uIHNjaGVtZSwgdXNpbmcgZGVmYXVsdCBVUCIsCisgICAgICAgICAgICAgICAgX19mdW5jX18pOworI2VuZGlmIC8vIEhERF9XTU1fREVCVUcKKyAgICAgIHVzZXJQcmkgPSBTTUVfUU9TX1dNTV9VUF9CRTsKKyAgIH0KKworICAgYWNUeXBlID0gaGRkV21tVXBUb0FjTWFwW3VzZXJQcmldOworCisjaWZkZWYgSEREX1dNTV9ERUJVRworICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAiJXM6IFVQIGlzICVkLCBBQyBpcyAlZCIsCisgICAgICAgICAgICAgX19mdW5jX18sIHVzZXJQcmksIGFjVHlwZSk7CisjZW5kaWYgLy8gSEREX1dNTV9ERUJVRworCisgICAqcFVzZXJQcmkgPSB1c2VyUHJpOworICAgKnBBY1R5cGUgPSBhY1R5cGU7CisKKyAgIHJldHVybjsKK30KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX2hvc3RhcGRfc2VsZWN0X3F1dWV1ZSgpIC0gRnVuY3Rpb24gd2hpY2ggd2lsbCBjbGFzc2lmeSB0aGUgcGFja2V0CisgICAgICAgICBhY2NvcmRpbmcgdG8gbGludXggcWRpc2MgZXhwZWN0YXRpb24uCisKKworICBAcGFyYW0gZGV2ICAgICAgOiBbaW5dICBwb2ludGVyIHRvIG5ldF9kZXZpY2Ugc3RydWN0dXJlCisgIEBwYXJhbSBza2IgICAgICA6IFtpbl0gIHBvaW50ZXIgdG8gb3MgcGFja2V0CisKKyAgQHJldHVybiAgICAgICAgIDogUWRpc2MgcXVldWUgaW5kZXgKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZfVTE2X3QgaGRkX2hvc3RhcGRfc2VsZWN0X3F1ZXVlKHN0cnVjdCBuZXRfZGV2aWNlICogZGV2LCBzdHJ1Y3Qgc2tfYnVmZiAqc2tiCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDEzLDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLCB2b2lkICphY2NlbF9wcml2CisjZW5kaWYKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTQsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAsIHNlbGVjdF9xdW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cmlvcml0eV07CisgICBlbHNlCisgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgIiVzOiB1cD0lZCBpcyBnb2luZyBiZXlvbmQgbWF4IHZhbHVlIiwgX19mdW5jX18sIHVwKTsKKyAgICAgIHF1ZXVlSW5kZXggPSBoZGRMaW51eFVwVG9BY01hcFtTTUVfUU9TX1dNTV9VUF9CRV07CisgICB9CisKKyAgIHJldHVybiBxdWV1ZUluZGV4OworfQorCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfd21tX3NlbGVjdF9xdXVldWUoKSAtIEZ1bmN0aW9uIHdoaWNoIHdpbGwgY2xhc3NpZnkgdGhlIHBhY2tldAorICAgICAgICAgYWNjb3JkaW5nIHRvIGxpbnV4IHFkaXNjIGV4cGVjdGF0aW9uLgorCisKKyAgQHBhcmFtIGRldiAgICAgIDogW2luXSAgcG9pbnRlciB0byBuZXRfZGV2aWNlIHN0cnVjdHVyZQorICBAcGFyYW0gc2tiICAgICAgOiBbaW5dICBwb2ludGVyIHRvIG9zIHBhY2tldAorCisgIEByZXR1cm4gICAgICAgICA6IFFkaXNjIHF1ZXVlIGluZGV4CisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2X1UxNl90IGhkZF93bW1fc2VsZWN0X3F1ZXVlKHN0cnVjdCBuZXRfZGV2aWNlICogZGV2LCBzdHJ1Y3Qgc2tfYnVmZiAqc2tiKQoreworICAgV0xBTlRMX0FDRW51bVR5cGUgYWM7CisgICBzbWVfUW9zV21tVXBUeXBlIHVwID0gU01FX1FPU19XTU1fVVBfQkU7CisgICB2X1VTSE9SVF90IHF1ZXVlSW5kZXg7CisgIC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ByaSBhcyBWTyIsIF9fZnVuY19fKTsKKyAgICAgIHVwID0gU01FX1FPU19XTU1fVVBfVk87CisgICAgICBhYyA9IGhkZFdtbVVwVG9BY01hcFt1cF07CisgICB9CisKK2RvbmU6CisgICBza2ItPnByaW9yaXR5ID0gdXA7CisgICBpZihza2ItPnByaW9yaXR5IDwgU01FX1FPU19XTU1fVVBfTUFYKQorICAgICAgICAgcXVldWVJbmRleCA9IGhkZExpbnV4VXBUb0FjTWFwW3NrYi0+cHJpb3JpdHldOworICAgZWxzZQorICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICIlczogdXA9JWQgaXMgZ29pbmcgYmV5b25kIG1heCB2YWx1ZSIsIF9fZnVuY19fLCB1cCk7CisgICAgICBxdWV1ZUluZGV4ID0gaGRkTGludXhVcFRvQWNNYXBbU01FX1FPU19XTU1fVVBfQkVdOworICAgfQorCisgICBpZiAoKFdMQU5fSEREX0lCU1MgIT0gcEFkYXB0ZXItPmRldmljZV9tb2RlKSAmJgorICAgICAgIChoZGRfaXNfZGhjcF9wYWNrZXQoc2tiKSB8fAorICAgICAgICBoZGRfc2tiX2lzX2VhcG9sX29yX3dhaV9wYWNrZXQoc2tiKSkpCisgICB7CisgICAgICAgLyogSWYgdGhlIHBhY2tldCBpcyBhIERIQ1AgcGFja2V0IG9yIGEgRWFwb2wgcGFja2V0IG9yCisgICAgICAgICogYSBXYXBpIHBhY2tldCwgdGhlbiBxdWV1ZSBpdCB0byB0aGUgbmV3IHF1ZXVlIGZvcgorICAgICAgICAqIFNUQSBpbnRlcmZhY2VzIGFsb25lLgorICAgICAgICAqLworICAgICAgIHF1ZXVlSW5kZXggPSBXTEFOVExfQUNfSElHSF9QUklPOworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgICAgICAiJXM6IHVwPSVkIFFJbmRleDolZCIsIF9fZnVuY19fLCB1cCwgcXVldWVJbmRleCk7CisgICB9CisKKyAgIHJldHVybiBxdWV1ZUluZGV4OworfQorCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3dtbV9hY3F1aXJlX2FjY2Vzc19yZXF1aXJlZCgpIC0gRnVuY3Rpb24gd2hpY2ggd2lsbCBkZXRlcm1pbmUKKyAgYWNxdWlyZSBhZG1pdHRhbmNlIGZvciBhIFdNTSBBQyBpcyByZXF1aXJlZCBvciBub3QgYmFzZWQgb24gcHNiIGNvbmZpZ3VyYXRpb24KKyAgZG9uZSBpbiBmcmFtZXdvcmsKKworICBAcGFyYW0gcEFkYXB0ZXIgOiBbaW5dICBwb2ludGVyIHRvIGFkYXB0ZXIgc3RydWN0dXJlCisKKyAgQHBhcmFtIGFjVHlwZSAgOiBbaW5dICBXTU0gQUMgdHlwZSBvZiBPUyBwYWNrZXQKKworICBAcmV0dXJuICAgICAgICA6IHZvaWQKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgaGRkX3dtbV9hY3F1aXJlX2FjY2Vzc19yZXF1aXJlZChoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfQUNFbnVtVHlwZSBhY1R5cGUpCit7CisvKiBFYWNoIGJpdCBpbiB0aGUgTFNCIG5pYmJsZSBpbmRpY2F0ZXMgMSBBQy4KKyAqIENsZWFyaW5nIHRoZSBwYXJ0aWN1bGFyIGJpdCBpbiBMU0IgbmliYmxlIHRvIGluZGljYXRlCisgKiBhY2Nlc3MgcmVxdWlyZWQKKyAqLworICAgc3dpdGNoKGFjVHlwZSkK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dNTSBBQworCisgIEBwYXJhbSBwQWRhcHRlciA6IFtpbl0gIHBvaW50ZXIgdG8gYWRhcHRlciBjb250ZXh0CisgIEBwYXJhbSBhY1R5cGUgICA6IFtpbl0gIFdNTSBBQyB0eXBlIG9mIE9TIHBhY2tldAorICBAcGFyYW0gcEdyYW50ZWQgOiBbb3V0XSBwb2ludGVyIHRvIGJvb2xlYW4gZmxhZyB3aGVuIGluZGljYXRlcyBpZiBhY2Nlc3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaGFzIGJlZW4gZ3JhbnRlZCBvciBub3QKKworICBAcmV0dXJuICAgICAgICAgOiBWT1NfU1RBVFVTX1NVQ0NFU1MgaWYgc3VjY3NzZnVsCisgICAgICAgICAgICAgICAgICA6IG90aGVyIHZhbHVlcyBpZiBmYWlsdXJlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIGhkZF93bW1fYWNxdWlyZV9hY2Nlc3MoIGhkZF9hZGFwdGVyX3QqIHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfQUNFbnVtVHlwZSBhY1R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfQk9PTF90ICogcEdyYW50ZWQgKQoreworICAgaGRkX3dtbV9xb3NfY29udGV4dF90ICpwUW9zQ29udGV4dDsKKworICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAgIiVzOiBFbnRlcmVkIGZvciBBQyAlZCIsIF9fZnVuY19fLCBhY1R5cGUpOworCisgICBpZiAoIWhkZF93bW1faXNfYWN0aXZlKHBBZGFwdGVyKSB8fCAhKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+Y2ZnX2luaS0+YkltcGxpY2l0UW9z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W2luXSAgdHlwZSBvZiBCU1MKKworICBAcmV0dXJuICAgICAgICAgOiBWT1NfU1RBVFVTX1NVQ0NFU1MgaWYgc3VjY3NzZnVsCisgICAgICAgICAgICAgICAgICA6IG90aGVyIHZhbHVlcyBpZiBmYWlsdXJlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIGhkZF93bW1fYXNzb2MoIGhkZF9hZGFwdGVyX3QqIHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0Q3NyUm9hbUluZm8gKnBSb2FtSW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZUNzclJvYW1Cc3NUeXBlIGVCc3NUeXBlICkKK3sKKyAgIHRBTklfVTggdWFwc2RNYXNrOworICAgVk9TX1NUQVRVUyBzdGF0dXM7CisgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcik7CisKKyAgIC8vIHdoZW4gd2UgYXNzb2NpYXRlIHdlIG5lZWQgdG8gbm90aWZ5IFRMIGlmIGl0IG5lZWRzIHRvIGVuYWJsZQorICAgLy8gVUFQU0QgZm9yIGFueSBhY2Nlc3MgY2F0ZWdvcmllcworCisgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICAiJXM6IEVudGVyZWQiLCBfX2Z1bmNfXyk7CisKKyAgIGlmIChwUm9hbUluZm8tPmZSZWFzc29jUmVxKQorICAgeworICAgICAgLy8gd2hlbiB3ZSByZWFzc29jaWF0ZSB3ZSBzaG91bGQgY29udGludWUgdG8gdXNlIHdoYXRldmVyCisgICAgICAvLyBwYXJhbWV0ZXJzIHdlcmUgcHJldmlvdXNseSBlc3RhYmxpc2hlZC4gIGlmIHdlIGFyZQorICAgICAgLy8gcmV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OX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKSktPmNvbm5faW5mby5zdGFJZFswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfQUNfVk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA3LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPmNmZ19pbmktPkluZnJhVWFwc2RWb1NydkludHYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+Y2ZnX2luaS0+SW5mcmFVYXBzZFZvU3VzcEludHYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX0JJX0RJUiApOworCisgICAgICBWT1NfQVNTRVJUKCBWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApKTsKKyAgIH0KKworICAgaWYgKHVhcHNkTWFzayAmIEhERF9BQ19WSSkKKyAgIHsKKyAgICAgIHN0YXR1cyA9IFdMQU5UTF9FbmFibGVVQVBTREZvckFDKCAoV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcikpLT5wdm9zQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV0xBTl9IRERfR0VUX1NUQVRJT05fQ1RYX1BUUihwQWRhcHRlcikpLT5jb25uX2luZm8uc3RhSWRbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX0FDX1ZJLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcikpLT5jZmdfaW5pLT5JbmZyYVVhcHNkVmlTcnZJbnR2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPmNmZ19pbmktPkluZnJhVWFwc2RWaVN1c3BJbnR2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9CSV9ESVIgKTsKKworICAgICAgVk9TX0FTU0VSVCggVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSk7CisgICB9CisKKyAgIGlmICh1YXBzZE1hc2sgJiBIRERfQUNfQkspCisgICB7CisgICAgICBzdGF0dXMgPSBXTEFOVExfRW5hYmxlVUFQU0RGb3JBQyggKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+cHZvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFdMQU5fSEREX0dFVF9TVEFUSU9OX0NUWF9QVFIocEFkYXB0ZXIpKS0+Y29ubl9pbmZvLnN0YUlkWzBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9BQ19CSywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+Y2ZnX2luaS0+SW5mcmFVYXBzZEJrU3J2SW50diwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcikpLT5jZmdfaW5pLT5JbmZyYVVhcHNkQmtTdXNwSW50diwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfQklfRElSICk7CisKKyAgICAgIFZPU19BU1NFUlQoIFZPU19JU19TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkpOworICAgfQorCisgICBpZiAodWFwc2RNYXNrICYgSEREX0FDX0JFKQorICAgeworICAgICAgc3RhdHVzID0gV0xBTlRMX0VuYWJsZVVBUFNERm9yQUMoIChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPnB2b3NDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXTEFOX0hERF9HRVRfU1RBVElPTl9DVFhfUFRSKHBBZGFwdGVyKSktPmNvbm5faW5mby5zdGFJZFswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfQUNfQkUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPmNmZ19pbmktPkluZnJhVWFwc2RCZVNydkludHYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFdMQU5fSEREX0dFVF9DVFgocEFkYXB0ZXIpKS0+Y2ZnX2luaS0+SW5mcmFVYXBzZEJlU3VzcEludHYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX0JJX0RJUiApOworCisgICAgICBWT1NfQVNTRVJUKCBWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApKTsKKyAgIH0KKworICAgc3RhdHVzID0gc21lX1VwZGF0ZURTQ1B0b1VQTWFwcGluZyhwSGRkQ3R4LT5oSGFsLAorICAgICAgIHBBZGFwdGVyLT5oZGRXbW1Ec2NwVG9VcE1hcCwgcEFkYXB0ZXItPnNlc3Npb25JZCk7CisKKyAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSkKKyAgIHsKKyAgICAgICBoZGRfd21tX2luaXQoIHBBZGFwdGVyICk7CisgICB9CisKKyAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgICIlczogRXhpdGluZyIsIF9fZnVuY19fKTsKKworICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworCisKK3N0YXRpYyBjb25zdCB2X1U4X3QgYWNtTWFza0JpdFtXTEFOVExfTUFYX0FDXSA9CisgICB7CisgICAgICAweDQsIC8qIFdMQU5UTF9BQ19CSyAqLworICAgICAgMHg4LCAvKiBXTEFOVExfQUNfQkUgKi8KKyAgICAgIDB4MiwgLyogV0xBTlRMX0FDX1ZJICovCisgICAgICAweDEgIC8qIFdMQU5UTF9BQ19WTyAqLworICAgfTsKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3dtbV9jb25uZWN0KCkgLSBGdW5jdGlvbiB3aGljaCB3aWxsIGhhbmRsZSB0aGUgaG91c2VrZWVwaW5nCisgIHJlcXVpcmVkIGJ5IFdNTSB3aGVuIGEgY29ubmVjdGlvbiBpcyBlc3RhYmxpc2hlZAorCisgIEBwYXJhbSBwQWRhcHRlciA6IFtpbl0gIHBvaW50ZXIgdG8gYWRhcHRlciBjb250ZXh0CisgIEBwYXJhbSBwUm9hbUluZm86IFtpbl0gIHBvaW50ZXIgdG8gcm9hbSBpbmZvcm1hdGlvbgorICBAcGFyYW0gZUJzc1R5cGUgOiBbaW5dICB0eXBlIG9mIEJTUworCisgIEByZXR1cm4gICAgICAgICA6IFZPU19TVEFUVVNfU1VDQ0VTUyBpZiBzdWNjc3NmdWwKKyAgICAgICAgICAgICAgICAgIDogb3RoZXIgdmFsdWVzIGlmIGZhaWx1cmUKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgaGRkX3dtbV9jb25uZWN0KCBoZGRfYWRhcHRlcl90KiBwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Q3NyUm9hbUluZm8gKnBSb2FtSW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ3NyUm9hbUJzc1R5cGUgZUJzc1R5cGUgKQoreworICAgaW50IGFjOworICAgdl9CT09MX3QgcWFwOworICAgdl9CT09MX3QgcW9zQ29ubmVjdGlvbjsKKyAgIHZfVThfdCBhY21NYXNrOworCisgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICAiJXM6IEVudGVyZWQiLCBfX2Z1bmNfXyk7CisKKyAgIGlmICgoZUNTUl9CU1NfVFlQRV9JTkZSQVNUUlVDVFVSRSA9PSBlQnNzVHlwZSkgJiYKKyAgICAgICBwUm9hbUluZm8gJiYKKyAgICAgICBwUm9hbUluZm8tPnUucENvbm5lY3RlZFByb2ZpbGUpCisgICB7CisgICAgICBxYXAgPSBwUm9hbUluZm8tPnUucENvbm5lY3RlZFByb2ZpbGUtPnFhcDsKKyAgICAgIHFvc0Nvbm5lY3Rpb24gPSBwUm9hbUluZm8tPnUucENvbm5lY3RlZFByb2ZpbGUtPnFvc0Nvbm5lY3Rpb247CisgICAgICBhY21NYXNrID0gcFJvYW1JbmZvLT51LnBDb25uZWN0ZWRQcm9maWxlLT5hY21fbWFzazsKKyAgIH0KKyAgIGVsc2UKKyAgIHsKKyAgICAgIC8qIFRPRE86IGlmIGEgbm9uLXFvcyBJQlNTIHBlZXIgam9pbnMgdGhlIGdyb3VwIG1ha2UgcWFwIGFuZCBxb3NDb25uZWN0aW9uIGZhbHNlLgorICAgICAgICovCisgICAgICBxYXAgPSBWT1NfVFJVRTsKKyAgICAgIHFvc0Nvbm5lY3Rpb24gPSBWT1NfVFJVRTsKKyAgICAgIGFjbU1hc2sgPSAweDA7CisgICB9CisKKyAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgICIlczogcWFwIGlzICVkLCBxb3NDb25uZWN0aW9uIGlzICVkLCBhY21NYXNrIGlzIDB4JXgiLAorICAgICAgICAgICAgIF9fZnVuY19fLCBxYXAsIHFvc0Nvbm5lY3Rpb24sIGFjbU1hc2spOworCisgICBwQWRhcHRlci0+aGRkV21tU3RhdHVzLndtbVFhcCA9IHFhcDsKKyAgIHBBZGFwdGVyLT5oZGRXbW1TdGF0dXMud21tUW9zQ29ubmVjdGlvbiA9IHFvc0Nvbm5lY3Rpb247CisKKyAgIGZvciAoYWMgPSAwOyBhYyA8IFdMQU5UTF9NQVhfQUM7IGFjKyspCisgICB7CisgICAgICBpZiAocWFwICYmCisgICAgICAgICAgcW9zQ29ubmVjdGlvbiAmJgorICAgICAgICAgIChhY21NYXNrICYgYWNtTWFza0JpdFthY10pKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAgICAgICAgIiVzOiBhYyAlZCBvbiIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIGFjKTsKKworICAgICAgICAgLy8gYWRtaXNzaW9uIGlzIHJlcXVpcmVkCisgICAgICAgICBwQWRhcHRlci0+aGRkV21tU3RhdHVzLndtbUFjU3RhdHVzW2FjXS53bW1BY0FjY2Vzc1JlcXVpcmVkID0gVk9TX1RSVUU7CisgICAgICAgICAvL01hcmsgd21tQWNBY2Nlc3NBbGxvd2VkIGFzIFRydWUgaWYgaW1wbGljaXQgUW9zIGlzIGRpc2FibGVkIGFzIHRoZXJlCisgICAgICAgICAvL2lzIG5vIG5lZWQgdG8gaG9sZCBwYWNrZXRzIGluIHF1ZXVlIGR1cmluZyBoZGRfdHhfZmV0Y2hfcGFja2V0X2NiaworICAgICAgICAgaWYgKCEoV0xBTl9IRERfR0VUX0NUWChwQWRhcHRlcikpLT5jZmdfaW5pLT5iSW1wbGljaXRRb3NFbmFibGVkKQorICAgICAgICAgICAgICBwQWRhcHRlci0+aGRkV21tU3RhdHVzLndtbUFjU3RhdHVzW2FjXS53bW1BY0FjY2Vzc0FsbG93ZWQgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSVUU7CisgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHBBZGFwdGVyLT5oZGRXbW1TdGF0dXMud21tQWNTdGF0dXNbYWNdLndtbUFjQWNjZXNzQWxsb3dlZCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19GQUxTRTsKKyAgICAgICAgIHBBZGFwdGVyLT5oZGRXbW1TdGF0dXMud21tQWNTdGF0dXNbYWNdLndtbUFjQWNjZXNzR3JhbnRlZCA9IFZPU19GQUxTRTsKKworICAgICAgICAgLyogTWFraW5nIFRTUEVDIGludmFsaWQgaGVyZSBzbyBkb3duZ3JhZGluZyBjYW4gYmUgaGFwcGVuIHdoaWxlIHJvYW1pbmcKKyAgICAgICAgICAqIEl0IGlzIGV4cGVjdGVkIHRoaXMgd2lsbCBiZSBTRVQgaW4gaGRkX3dtbV9zbWVfY2FsbGJhY2ssb25jZSBzbWUgaXMKKyAgICAgICAgICAqIGRvbmUgd2l0aCB0aGUgQWRkVHNwZWMuSGVyZSB3ZSBhdm9pZCAxMXIgYW5kIGNjeCBiYXNlZCBhc3NvY2lhdGlvbi4KKyAgICAgICAgICAgIFRoaXMgY2hhbmdlIGlzIGRvbmUgb25seSB3aGVuIHJlYXNzb2MgdG8gZGlmZmVyZW50IEFQLgorICAgICAgICAgICovCisgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICBGTCggImZSZWFzc29jUmVxID0gJWQiCisjaWYgZGVmaW5lZCAoRkVBVFVSRV9XTEFOX0VTRSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgImlzRVNFQXNzb2MgPSAlZCIKKyNlbmRpZgorI2lmIGRlZmluZWQgKFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAiaXMxMXJBc3NvYyA9ICVkIgorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICApLAorICAgICAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT5mUmVhc3NvY1JlcQorI2lmIGRlZmluZWQgKEZFQVRVUkVfV0xBTl9FU0UpCisgICAgICAgICAgICAgICAgICAgICAgICAscFJvYW1JbmZvLT5pc0VTRUFzc29jCisjZW5kaWYKKyNpZiBkZWZpbmVkIChXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUikKKyAgICAgICAgICAgICAgICAgICAgICAgICxwUm9hbUluZm8tPmlzMTFyQXNzb2MKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgKTsKKworICAgICAgICAgaWYgKCAhcFJvYW1JbmZvLT5mUmVhc3NvY1JlcQorI2lmIGRlZmluZWQgKFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSKQorICAgICAgICAgICAgJiYKKyAgICAgICAgICAgICFwUm9hbUluZm8tPmlzMTFyQXNzb2MKKyNlbmRpZgorI2lmIGRlZmluZWQgKEZFQVRVUkVfV0xBTl9FU0UpCisgICAgICAgICAgICAmJgorICAgICAgICAgICAgIXBSb2FtSW5mby0+aXNFU0VBc3NvYworI2VuZGlmCisgICAgICAgICAgICApCisgICAgICAgICB7CisgICAgICAgICAgICBwQWRhcHRlci0+aGRkV21tU3RhdHVzLndtbUFjU3RhdHVzW2FjXS53bW1BY1RzcGVjVmFsaWQgPSBWT1NfRkFMU0U7CisgICAgICAgICB9CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICAgICAgICAiJXM6IGFjICVkIG9mZiIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIGFjKTsKKyAgICAgICAgIC8vIGFkbWlzc2lvbiBpcyBub3QgcmVxdWlyZWQgc28gYWNjZXNzIGlzIGFsbG93ZWQKKyAgICAgICAgIHBBZGFwdGVyLT5oZGRXbW1TdGF0dXMud21tQWNTdGF0dXNbYWNdLndtbUFjQWNjZXNzUmVxdWlyZWQgPSBWT1NfRkFMU0U7CisgICAgICAgICBwQWRhcHRlci0+aGRkV21tU3RhdHVzLndtbUFjU3RhdHVzW2FjXS53bW1BY0FjY2Vzc0FsbG93ZWQgPSBWT1NfVFJVRTsKKyAgICAgIH0KKworICAgfQorCisgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICAiJXM6IEV4aXRpbmciLCBfX2Z1bmNfXyk7CisKKyAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9CisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF93bW1fZ2V0X3VhcHNkX21hc2soKSAtIEZ1bmN0aW9uIHdoaWNoIHdpbGwgY2FsY3VsYXRlIHRoZQorICBpbml0aWFsIHZhbHVlIG9mIHR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ZhbAorICAgICAgaWYoIChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPmNmZ19pbmktPkluZnJhVWFwc2RWb1NydkludHYgPT0gMCApCisgICAgICB7CisgICAgICAgICB1YXBzZE1hc2sgJj0gfkhERF9BQ19WTzsKKyAgICAgIH0KKworICAgICAgaWYoIChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPmNmZ19pbmktPkluZnJhVWFwc2RWaVNydkludHYgPT0gMCApCisgICAgICB7CisgICAgICAgICB1YXBzZE1hc2sgJj0gfkhERF9BQ19WSTsKKyAgICAgIH0KKworICAgICAgaWYoIChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPmNmZ19pbmktPkluZnJhVWFwc2RCa1NydkludHYgPT0gMCApCisgICAgICB7CisgICAgICAgICB1YXBzZE1hc2sgJj0gfkhERF9BQ19CSzsKKyAgICAgIH0KKworICAgICAgaWYoIChXTEFOX0hERF9HRVRfQ1RYKHBBZGFwdGVyKSktPmNmZ19pbmktPkluZnJhVWFwc2RCZVNydkludHYgPT0gMCApCisgICAgICB7CisgICAgICAgICB1YXBzZE1hc2sgJj0gfkhERF9BQ19CRTsKKyAgICAgIH0KKyAgIH0KKworICAgLy8gcmV0dXJuIGNhbGN1bGF0ZWQgbWFzaworICAgKnBVYXBzZE1hc2sgPSB1YXBzZE1hc2s7CisgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfQorCisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF93bW1faXNfYWN0aXZlKCkgLSBGdW5jdGlvbiB3aGljaCB3aWxsIGRldGVybWluZSBpZiBXTU0gaXMKKyAgYWN0aXZlIG9uIHRoZSBjdXJyZW50IGNvbm5lY3Rpb24KKworICBAcGFyYW0gcEFkYXB0ZXIgIDogW2luXSAgcG9pbnRlciB0byBhZGFwdGVyIGNvbnRleHQKKworICBAcmV0dXJuICAgICAgICAgOiBWT1NfVFJVRSBpZiBXTU0gaXMgZW5hYmxlZAorICAgICAgICAgICAgICAgICAgOiBWT1NfRkFMU0UgaWYgV01NIGlzIG5vdCBlbmFibGVkCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2X0JPT0xfdCBoZGRfd21tX2lzX2FjdGl2ZSggaGRkX2FkYXB0ZXJfdCogcEFkYXB0ZXIgKQoreworICAgaWYgKCghcEFkYXB0ZXItPmhkZFdtbVN0YXR1cy53bW1Rb3NDb25uZWN0aW9uKSB8fAorICAgICAgICghcEFkYXB0ZXItPmhkZFdtbVN0YXR1cy53bW1RYXApKQorICAgeworICAgICAgcmV0dXJuIFZPU19GQUxTRTsKKyAgIH0KKyAgIGVsc2UKKyAgIHsKKyAgICAgIHJldHVybiBWT1NfVFJVRTsKKyAgIH0KK30KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX3dtbV9hZGR0cygpIC0gRnVuY3Rpb24gd2hpY2ggd2lsbCBhZGQgYSB0cmFmZmljIHNwZWMgYXQgdGhlCisgIHJlcXVlc3Qgb2YgYW4gYXBwbGljYXRpb24KKworICBAcGFyYW0gcEFkYXB0ZXIgIDogW2luXSAgcG9pbnRlciB0byBhZGFwdGVyIGNvbnRleHQKKyAgQHBhcmFtIGhhbmRsZSAgICA6IFtpbl0gIGhhbmRsZSB0byB1bmlxdWVseSBpZGVudGlmeSBhIFRTCisgIEBwYXJhbSBwVHNwZWMgICAgOiBbaW5dICBwb2ludGVyIHRvIHRoZSB0cmFmZmljIHNwZWMKKworICBAcmV0dXJuICAgICAgICAgIDogSEREX1dMQU5fV01NX1NUQVRVU18qCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitoZGRfd2xhbl93bW1fc3RhdHVzX2UgaGRkX3dtbV9hZGR0cyggaGRkX2FkYXB0ZXJfdCogcEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBoYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21lX1Fvc1dtbVRzcGVjSW5mbyogcFRzcGVjICkKK3sKKyAgIGhkZF93bW1fcW9zX2NvbnRleHRfdCAqcFFvc0NvbnRleHQ7CisgICBoZGRfd2xhbl93bW1fc3RhdHVzX2Ugc3RhdHVzID0gSEREX1dMQU5fV01NX1NUQVRVU19TRVRVUF9TVUNDRVNTIDsKKyNpZm5kZWYgV0xBTl9NRE1fQ09ERV9SRURVQ1RJT05fT1BUCisgICBzbWVfUW9zU3RhdHVzVHlwZSBzbWVTdGF0dXM7CisjZW5kaWYKKyAgIHZfQk9PTF90IGZvdW5kID0gVk9TX0ZBTFNFOworICAgdl9DT05URVhUX3QgcFZvc0NvbnRleHQgPSB2b3NfZ2V0X2dsb2JhbF9jb250ZXh0KCBWT1NfTU9EVUxFX0lEX0hERCwgTlVMTCApOworICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eDsKKworICAgaWYgKE5VTEwgPT0gcFZvc0NvbnRleHQpCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICBGTCgicFZvc0NvbnRleHQgaXMgTlVMTCIpKTsKKyAgICAgIHJldHVybiBIRERfV0xBTl9XTU1fU1RBVFVTX1NFVFVQX0ZBSUxFRDsKKyAgIH0KKworICAgcEhkZEN0eCA9IHZvc19nZXRfY29udGV4dCggVk9TX01PRFVMRV9JRF9IREQsIHBWb3NDb250ZXh0KTsKKyAgIGlmIChOVUxMID09IHBIZGRDdHgpCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICBGTCgiSGRkQ3R4IGlzIE5VTEwiKSk7CisgICAgICByZXR1cm4gSEREX1dMQU5fV01NX1NUQVRVU19TRVRVUF9GQUlMRUQ7CisgICB9CisKKyAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgICIlczogRW50ZXJlZCB3aXRoIGhhbmRsZSAweCV4IiwgX19mdW5jX18sIGhhbmRsZSk7CisKKyAgIC8vIHNlZSBpZiBhIGNvbnRleHQgYWxyZWFkeSBleGlzdHMgd2l0aCB0aGUgZ2l2ZW4gaGFuZGxlCisgICBtdXRleF9sb2NrKCZwSGRkQ3R4LT53bW1Mb2NrKTsKKyAgIGxpc3RfZm9yX2VhY2hfZW50cnkocFFvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICZwQWRhcHRlci0+aGRkV21tU3RhdHVzLndtbUNvbnRleHRMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICBub2RlKQorICAgeworICAgICAgaWYgKHBRb3NDb250ZXh0LT5oYW5kbGUgPT0gaGFuZGxlKQorICAgICAgeworICAgICAgICAgZm91bmQgPSBWT1NfVFJVRTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgfQorICAgbXV0ZXhfdW5sb2NrKCZwSGRkQ3R4LT53bW1Mb2NrKTsKKyAgIGlmIChmb3VuZCkKKyAgIHsKKyAgICAgIC8vIHJlY29yZCB3aXRoIHRoYXQgaGFuZGxlIGFscmVhZHkgZXhpc3RzCisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IFJlY29yZCBhbHJlYWR5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0VYSVNUSU5HOworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNNRV9RT1NfU1RBVFVTX01PRElGWV9TRVRVUF9JTlZBTElEX1BBUkFNU19SU1A6CisgICAgICAgICAgc3RhdHVzID0gSEREX1dMQU5fV01NX1NUQVRVU19NT0RJRllfRkFJTEVEX0JBRF9QQVJBTTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTTUVfUU9TX1NUQVRVU19NT0RJRllfU0VUVVBfRkFJTFVSRV9SU1A6CisgICAgICAgICAgc3RhdHVzID0gSEREX1dMQU5fV01NX1NUQVRVU19NT0RJRllfRkFJTEVEOworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNNRV9RT1NfU1RBVFVTX1NFVFVQX05PVF9RT1NfQVBfUlNQOgorICAgICAgICAgIHN0YXR1cyA9IEhERF9XTEFOX1dNTV9TVEFUVVNfU0VUVVBfRkFJTEVEX05PX1dNTTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAvLyB3ZSBkaWRuJ3QgZ2V0IGJhY2sgb25lIG9mIHRoZSBTTUVfUU9TX1NUQVRVU19NT0RJRllfKiBzdGF0dXMgY29kZXMKKyAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAiJXM6IHVuZXhwZWN0ZWQgU01FIFN0YXR1cz0lZCIsIF9fZnVuY19fLCBzbWVTdGF0dXMgKTsKKyAgICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICAgIHJldHVybiBIRERfV0xBTl9XTU1fU1RBVFVTX01PRElGWV9GQUlMRUQ7CisgICAgICB9CisKKyAgICAgIG11dGV4X2xvY2soJnBIZGRDdHgtPndtbUxvY2spOworICAgICAgaWYgKHBRb3NDb250ZXh0LT5tYWdpYyA9PSBIRERfV01NX0NUWF9NQUdJQykKKyAgICAgIHsKKyAgICAgICAgICBwUW9zQ29udGV4dC0+bGFzdFN0YXR1cyA9IHN0YXR1czsKKyAgICAgIH0KKyAgICAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+d21tTG9jayk7CisgICAgICByZXR1cm4gc3RhdHVzOworICAgfQorCisgICBwUW9zQ29udGV4dCA9IGttYWxsb2Moc2l6ZW9mKCpwUW9zQ29udGV4dCksIEdGUF9LRVJORUwpOworICAgaWYgKE5VTEwgPT0gcFFvc0NvbnRleHQpCisgICB7CisgICAgICAvLyBubyBtZW1vcnkgZm9yIFFvUyBjb250ZXh0LiAgTm90aGluZyB3ZSBjYW4gZG8KKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogVW5hYmxlIHRvIGFsbG9jYXRlIFFvUyBjb250ZXh0IiwgX19mdW5jX18pOworICAgICAgcmV0dXJuIEhERF9XTEFOX1dNTV9TVEFUVVNfSU5URVJOQUxfRkFJTFVSRTsKKyAgIH0KKworICAgLy8gd2UgYXNzdW1lIHRoZSB0c3BlYyBoYXMgYWxyZWFkeSBiZWVuIHZhbGlkYXRlZCBieSB0aGUgY2FsbGVyCisKKyAgIHBRb3NDb250ZXh0LT5oYW5kbGUgPSBoYW5kbGU7CisgICBpZiAocFRzcGVjLT50c19pbmZvLnVwIDwgSEREX1dNTV9VUF9UT19BQ19NQVBfU0laRSkKKyAgICAgIHBRb3NDb250ZXh0LT5hY1R5cGUgPSBoZGRXbW1VcFRvQWNNYXBbcFRzcGVjLT50c19pbmZvLnVwXTsKKyAgIGVsc2UgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOiB0c19pbmZvLnVwICglZCkgbGFyZ2VyIHRoYW4gbWF4IHZhbHVlICglZCksICIKKyAgICAgICAgICAgICAgICAidXNlIGRlZmF1bHQgYWNUeXBlICglZCkiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fLCBwVHNwZWMtPnRzX2luZm8udXAsCisgICAgICAgICAgICAgICAgSEREX1dNTV9VUF9UT19BQ19NQVBfU0laRSAtIDEsIGhkZFdtbVVwVG9BY01hcFswXSk7CisgICAgICBwUW9zQ29udGV4dC0+YWNUeXBlID0gaGRkV21tVXBUb0FjTWFwWzBdOworICAgfQorCisgICBwUW9zQ29udGV4dC0+cEFkYXB0ZXIgPSBwQWRhcHRlcjsKKyAgIHBRb3NDb250ZXh0LT5xb3NGbG93SWQgPSAwOworCisgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICIlczogU2V0dGluZyB1cCBRb1MsIGNvbnRleHQgJXAiLAorICAgICAgICAgICAgIF9fZnVuY19fLCBwUW9zQ29udGV4dCk7CisKKyAgIG11dGV4X2xvY2soJnBIZGRDdHgtPndtbUxvY2spOworICAgcFFvc0NvbnRleHQtPm1hZ2ljID0gSEREX1dNTV9DVFhfTUFHSUM7CisgICBsaXN0X2FkZCgmcFFvc0NvbnRleHQtPm5vZGUsICZwQWRhcHRlci0+aGRkV21tU3RhdHVzLndtbUNvbnRleHRMaXN0KTsKKyAgIG11dGV4X3VubG9jaygmcEhkZEN0eC0+d21tTG9jayk7CisKKyNpZm5kZWYgV0xBTl9NRE1fQ09ERV9SRURVQ1RJT05fT1BUCisgICBzbWVTdGF0dXMgPSBzbWVfUW9zU2V0dXBSZXEoV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLT5zZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRzcGVjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhkZF93bW1fc21lX2NhbGxiYWNrLAorICAg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ERELCBXTU1fVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogdW5leHBlY3RlZCBTTUUgU3RhdHVzPSVkIiwgX19mdW5jX18sIHNtZVN0YXR1cyApOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBIRERfV0xBTl9XTU1fU1RBVFVTX1NFVFVQX0ZBSUxFRDsKKyAgIH0KKyNlbmRpZgorCisgICAvLyB3ZSB3ZXJlIHN1Y2Nlc3NmdWwsIHNhdmUgdGhlIHN0YXR1cworICAgbXV0ZXhfbG9jaygmcEhkZEN0eC0+d21tTG9jayk7CisgICBpZiAocFFvc0NvbnRleHQtPm1hZ2ljID09IEhERF9XTU1fQ1RYX01BR0lDKQorICAgeworICAgICAgICAgcFFvc0NvbnRleHQtPmxhc3RTdGF0dXMgPSBzdGF0dXM7CisgICB9CisgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPndtbUxvY2spOworCisgICByZXR1cm4gc3RhdHVzOworfQorCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfd21tX2RlbHRzKCkgLSBGdW5jdGlvbiB3aGljaCB3aWxsIGRlbGV0ZSBhIHRyYWZmaWMgc3BlYyBhdCB0aGUKKyAgcmVxdWVzdCBvZiBhbiBhcHBsaWNhdGlvbgorCisgIEBwYXJhbSBwQWRhcHRlciAgOiBbaW5dICBwb2ludGVyIHRvIGFkYXB0ZXIgY29udGV4dAorICBAcGFyYW0gaGFuZGxlICAgIDogW2luXSAgaGFuZGxlIHRvIHVuaXF1ZWx5IGlkZW50aWZ5IGEgVFMKKworICBAcmV0dXJuICAgICAgICAgIDogSEREX1dMQU5fV01NX1NUQVRVU18qCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitoZGRfd2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X0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIEZMKCJIZGRDdHggaXMgTlVMTCIpKTsKKyAgICAgIHJldHVybiBIRERfV0xBTl9XTU1fU1RBVFVTX1JFTEVBU0VfRkFJTEVEOworICAgfQorCisgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICAiJXM6IEVudGVyZWQgd2l0aCBoYW5kbGUgMHgleCIsIF9fZnVuY19fLCBoYW5kbGUpOworCisgICAvLyBsb2NhdGUgdGhlIGNvbnRleHQgd2l0aCB0aGUgZ2l2ZW4gaGFuZGxlCisgICBtdXRleF9sb2NrKCZwSGRkQ3R4LT53bW1Mb2NrKTsKKyAgIGxpc3RfZm9yX2VhY2hfZW50cnkocFFvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICZwQWRhcHRlci0+aGRkV21tU3RhdHVzLndtbUNvbnRleHRMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICBub2RlKQorICAgeworICAgICAgaWYgKHBRb3NDb250ZXh0LT5oYW5kbGUgPT0gaGFuZGxlKQorICAgICAgeworICAgICAgICAgZm91bmQgPSBWT1NfVFJVRTsKKyAgICAgICAgIGFjVHlwZSA9IHBRb3NDb250ZXh0LT5hY1R5cGU7CisgICAgICAgICBxb3NGbG93SWQgPSBwUW9zQ29udGV4dC0+cW9zRmxvd0lkOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICB9CisgICBtdXRleF91bmxvY2soJnBIZGRDdHgtPndtbUxvY2spOworCisgICBpZiAoVk9TX0ZBTFNFID09IGZvdW5kKQorICAgeworICAgICAgLy8gd2UgZGlkbid0IGZpbmQgdGhlIGhhbmRsZQorICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAgICAg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N0aW9uIHdoaWNoIHdpbGwgcmV0dXJuIHRoZSBzdGF0dXMgb2YgYSB0cmFmZmljCisgIHNwZWMgYXQgdGhlIHJlcXVlc3Qgb2YgYW4gYXBwbGljYXRpb24KKworICBAcGFyYW0gcEFkYXB0ZXIgIDogW2luXSAgcG9pbnRlciB0byBhZGFwdGVyIGNvbnRleHQKKyAgQHBhcmFtIGhhbmRsZSAgICA6IFtpbl0gIGhhbmRsZSB0byB1bmlxdWVseSBpZGVudGlmeSBhIFRTCisKKyAgQHJldHVybiAgICAgICAgICA6IEhERF9XTEFOX1dNTV9TVEFUVVNfKgorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworaGRkX3dsYW5fd21tX3N0YXR1c19lIGhkZF93bW1fY2hlY2t0cyggaGRkX2FkYXB0ZXJfdCogcEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IGhhbmRsZSApCit7CisgICBoZGRfd21tX3Fvc19jb250ZXh0X3QgKnBRb3NDb250ZXh0OworICAgaGRkX3dsYW5fd21tX3N0YXR1c19lIHN0YXR1cyA9IEhERF9XTEFOX1dNTV9TVEFUVVNfTE9TVDsKKyAgIHZfQ09OVEVYVF90IHBWb3NDb250ZXh0ID0gdm9zX2dldF9nbG9iYWxfY29udGV4dCggVk9TX01PRFVMRV9JRF9IREQsIE5VTEwgKTsKKyAgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHg7CisKKyAgIGlmIChOVUxMID09IHBWb3NDb250ZXh0KQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBXTU1fVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgRkwoInBWb3NDb250ZXh0IGlzIE5VTEwiKSk7CisgICAgICByZXR1cm4gSEREX1dMQU5fV01NX1NUQVRVU19MT1NUOworICAgfQorCisgICBwSGRkQ3R4ID0gdm9zX2dldF9jb250ZXh0KCBWT1NfTU9EVUxFX0lEX0hERCwgcFZvc0NvbnRleHQpOworICAgaWYgKE5VTEwgPT0gcEhkZEN0eCkKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIEZMKCJIZGRDdHggaXMgTlVMTCIpKTsKKyAgICAgIHJldHVybiBIRERfV0xBTl9XTU1fU1RBVFVTX0xPU1Q7CisgICB9CisKKyAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgV01NX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgICIlczogRW50ZXJlZCB3aXRoIGhhbmRsZSAweCV4IiwgX19mdW5jX18sIGhhbmRsZSk7CisKKyAgIC8vIGxvY2F0ZSB0aGUgY29udGV4dCB3aXRoIHRoZSBnaXZlbiBoYW5kbGUKKyAgIG11dGV4X2xvY2soJnBIZGRDdHgtPndtbUxvY2spOworICAgbGlzdF9mb3JfZWFjaF9lbnRyeShwUW9zQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgJnBBZGFwdGVyLT5oZGRXbW1TdGF0dXMud21tQ29udGV4dExpc3QsCisgICAgICAgICAgICAgICAgICAgICAgIG5vZGUpCisgICB7CisgICAgICBpZiAocFFvc0NvbnRleHQtPmhhbmRsZSA9PSBoYW5kbGUpCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFdNTV9UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICAgICAgICAiJXM6IGZvdW5kIGhhbmRsZSAweCV4LCBjb250ZXh0ICVwIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgaGFuZGxlLCBwUW9zQ29udGV4dCk7CisKKyAgICAgICAgIHN0YXR1cyA9IHBRb3NDb250ZXh0LT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oVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXM6IFBhdHRlcm46ICIsIF9fZnVuY19fKTsKKyAgZm9yKGkgPSAwOyBpIDwgcHRybi0+dWNQYXR0ZXJuU2l6ZTsgaSsrKQorICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCIgJTAyWCIsIHB0cm4tPnVjUGF0dGVybltpXSk7CisgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczogUGF0dGVybk1hc2s6ICIsIF9fZnVuY19fKTsKKyAgZm9yKGkgPSAwOyBpPHB0cm4tPnVjUGF0dGVybk1hc2tTaXplOyBpKyspCisgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sIiUwMlgiLCBwdHJuLT51Y1BhdHRlcm5NYXNrW2ldKTsKK30KKworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfYWRkX3dvd2xfcHRybigpIC0gRnVuY3Rpb24gd2hpY2ggd2lsbCBhZGQgdGhlIFdvV0wgcGF0dGVybiB0byBiZQorICB1c2VkIHdoZW4gUEJNIGZpbHRlcmluZyBpcyBlbmFibGVkCisKKyAgQHBhcmFtIHB0cm4gOiBbaW5dICBwb2ludGVyIHRvIHRoZSBwYXR0ZXJuIHN0cmluZyB0byBiZSBhZGRlZAorCisgIEByZXR1cm4gICAgIDogRkFMU0UgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZAorICAgICAgICAgICAgICA6IFRSVUUgb3RoZXJ3aXNlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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AgIiVzOiBNYWxmb3JtZWQgcGF0dGVybiBzdHJpbmcuIFNraXAhIiwgX19mdW5jX18pOworICAgICAgcHRybiArPSBsZW47IAorICAgICAgZ290byBuZXh0X3B0cm47CisgICAgfQorCisgICAgLy8gRXh0cmFjdCB0aGUgcGF0dGVybiBzaXplCisgICAgbG9jYWxQYXR0ZXJuLnVjUGF0dGVyblNpemUgPSAKKyAgICAgICggaGRkX3BhcnNlX2hleCggcHRyblswXSApICogMHgxMCApICsgaGRkX3BhcnNlX2hleCggcHRyblsxXSApOworCisgICAgLy8gRXh0cmFjdCB0aGUgcGF0dGVybiBtYXNrIHNpemUKKyAgICBsb2NhbFBhdHRlcm4udWNQYXR0ZXJuTWFza1NpemUgPSAKKyAgICAgICggaGRkX3BhcnNlX2hleCggcHRyblszXSApICogMHgxMCApICsgaGRkX3BhcnNlX2hleCggcHRybls0XSApOworCisgICAgaWYobG9jYWxQYXR0ZXJuLnVjUGF0dGVyblNpemUgPiBTSVJfV09XTF9CQ0FTVF9QQVRURVJOX01BWF9TSVpFIHx8CisgICAgICAgbG9jYWxQYXR0ZXJuLnVjUGF0dGVybk1hc2tTaXplID4gV09XTF9QVFJOX01BU0tfTUFYX1NJWkUpCisgICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAiJXM6IEludmFsaWQgbGVuZ3RoIHNwZWNpZmllZC4gU2tpcCEiLCBfX2Z1bmNfXyk7CisgICAgICBwdHJuICs9IGxlbjsgCisgICAgICBnb3RvIG5leHRfcHRybjsKKyAgICB9CisKKyAgICAvL2NvbXB1dGUgdGhlIG9mZnNldCBvZiB0b2tlbml6ZXIgYWZ0ZXIgdGhlIHBhdHRlcm4KKyAgICBvZmZzZXQgPSA1ICsgMipsb2NhbFBhdHRlcm4udWNQYXR0ZXJuU2l6ZSArIDE7CisgICAgaWYob2Zmc2V0ID49IGxlbiB8fCBwd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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGJyaWVmIGhkZF9kZWxfd293bF9wdHJuKCkgLSBGdW5jdGlvbiB3aGljaCB3aWxsIHJlbW92ZSBhIFdvV0wgcGF0dGVybgorCisgIEBwYXJhbSBwdHJuIDogW2luXSAgcG9pbnRlciB0byB0aGUgcGF0dGVybiBzdHJpbmcgdG8gYmUgcmVtb3ZlZAorCisgIEByZXR1cm4gICAgIDogRkFMU0UgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZAorICAgICAgICAgICAgICA6IFRSVUUgb3RoZXJ3aXNlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2X0JPT0xfdCBoZGRfZGVsX3dvd2xfcHRybiAoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsIGNvbnN0IGNoYXIgKiBwdHJuKSAKK3sKKyAgdFNpcldvd2xEZWxCY2FzdFB0cm4gZGVsUGF0dGVybjsKKyAgdW5zaWduZWQgY2hhciBpZDsKKyAgdEhhbEhhbmRsZSBoSGFsID0gV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpOworICB2X0JPT0xfdCBwYXR0ZXJuRm91bmQgPSBWT1NfRkFMU0U7CisgIGVIYWxTdGF0dXMgaGFsU3RhdHVzOworICB2X1U4X3Qgc2Vzc2lvbklkID0gcEFkYXB0ZXItPnNlc3Npb25JZDsKKworICAvLyBEZXRlY3QgcGF0dGVybgorICBmb3IgKGlkPTA7IGlkPFdPV0xfTUFYX1BUUk5TX0FMTE9XRUQgJiYgZ19oZGRfd293bF9wdHJuc1tpZF0gIT0gTlVMTDsgaWQrKykKKyAgeworICAgIGlmKCFzdHJjbXAocHRybiwgZ19oZGRfd293bF9wdHJuc1tpZF0pKQorICAgIHsKKyAgICAgIHBhdHRlcm5Gb3VuZCA9IFZPU19UUlVFOworICAgICAgYnJlYWs7CisgICAgfQorICB9CisKKyAgLy8gSWYgcGF0dGVybiBwcmVzZW50LCByZW1vdmUgaXQgZnJvbSBkb3duc3RyZWFtCisgIGlmKHBhdHRlcm5Gb3VuZCkKKyAgeworICAgIGRlbFBhdHRlcm4udWNQYXR0ZXJuSWQgPSBpZDsKKyAgICBoYWxTdGF0dXMgPSBzbWVfV293bERlbEJjYXN0UGF0dGVybiggaEhhbCwgJmRlbFBhdHRlcm4sIHNlc3Npb25JZCApOworICAgIGlmICggSEFMX1NUQVRVU19TVUNDRVNTKCBoYWxTdGF0dXMgKSApCisgICAgeworICAgICAgLy8gUmVtb3ZlIGZyb20gbG9jYWwgc3RvcmFnZSBhcyB3ZWxsCisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICJEZWxldGVkIHBhdHRlcm4gd2l0aCBpZCAlZCBbJXNdIiwgaWQsIGdfaGRkX3dvd2xfcHRybnNbaWRdKTsKKworICAgICAga2ZyZWUoZ19oZGRfd293bF9wdHJuc1tpZF0pOworICAgICAgZ19oZGRfd293bF9wdHJuc1tpZF0gPSBOVUxMOworICAgICAgcmV0dXJuIFZPU19UUlVFOworICAgIH0KKyAgfQorICByZXR1cm4gVk9TX0ZBTFNFOworfQorCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfYWRkX3dvd2xfcHRybl9kZWJ1Z2ZzKCkgLSBGdW5jdGlvbiB3aGljaCB3aWxsIGFkZCBhIFdvVyBwYXR0ZXJuCisgIHNlbnQgZnJvbSBkZWJ1Z2ZzIGludGVyZmFjZQorCisgIEBwYXJhbSBwQWRhcHRlciAgICAgICA6IFtpbl0gcG9pbnRlciB0byB0aGUgYWRhcHRlcgorICAgICAgICAgcGF0dGVybl9pZHggICAgOiBbaW5dIGluZGV4IG9mIHRoZSBwYXR0ZXJuIHRvIGJlIGFkZGVkCisgICAgICAgICBwYXR0ZXJuX29mZnNldCA6IFtpbl0gb2Zmc2V0IG9mIHRoZSBwYXR0ZXJuIGluIHRoZSBmcmFtZSBwYXlsb2FkCisgICAgICAgICBwYXR0ZXJuX2J1ZiAgICA6IFtpbl0gcG9pbnRlciB0byB0aGUgcGF0dGVybiBoZXggc3RyaW5nIHRvIGJlIGFkZGVkCisgICAgICAgICBwYXR0ZXJuX21hc2sgICA6IFtpbl0gcG9pbnRlciB0byB0aGUgcGF0dGVybiBtYXNrIGhleCBzdHJpbmcKKworICBAcmV0dXJuICAgICAgICAgICAgICAgOiBGQUxTRSBpZiBhbnkgZXJyb3JzIGVuY291bnRlcmVkCisgICAgICAgICAgICAgICAgICAgICAgICA6IFRSVUUgb3RoZXJ3aXNlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2X0JPT0xfdCBoZGRfYWRkX3dvd2xfcHRybl9kZWJ1Z2ZzKGhkZF9hZGFwdGVyX3QgKnBBZGFwdGVyLCB2X1U4X3QgcGF0dGVybl9pZHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCBwYXR0ZXJuX29mZnNldCwgY2hhciAqcGF0dGVybl9idWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgKnBhdHRlcm5fbWFzaykKK3sKKyAgdFNpcldvd2xBZGRCY2FzdFB0cm4gbG9jYWxQYXR0ZXJuOworICBlSGFsU3RhdHVzIGhhbFN0YXR1czsKKyAgdEhhbEhhbmRsZSBoSGFsID0gV0xBTl9IRERfR0VUX0hBTF9DVFgocEFkYXB0ZXIpOworICB2X1U4X3Qgc2Vzc2lvbklkID0gcEFkYXB0ZXItPnNlc3Npb25JZDsKKyAgdl9VMTZf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6ZTsgaSsrKQorICB7CisgICAgbG9jYWxQYXR0ZXJuLnVjUGF0dGVybk1hc2tbaV0gPQorICAgICAgKGhkZF9wYXJzZV9oZXgocGF0dGVybl9tYXNrWzBdKSA8PCA0KSArIGhkZF9wYXJzZV9oZXgocGF0dGVybl9tYXNrWzFdKTsKKworICAgIC8qIFNraXAgdG8gbmV4dCBieXRlICovCisgICAgcGF0dGVybl9tYXNrICs9IDI7CisgIH0KKworICAvKiBSZWdpc3RlciB0aGUgcGF0dGVybiBkb3duc3RyZWFtICovCisgIGhhbFN0YXR1cyA9IHNtZV9Xb3dsQWRkQmNhc3RQYXR0ZXJuKGhIYWwsICZsb2NhbFBhdHRlcm4sIHNlc3Npb25JZCk7CisKKyAgaWYgKCFIQUxfU1RBVFVTX1NVQ0NFU1MoaGFsU3RhdHVzKSkKKyAgeworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICIlczogc21lX1dvd2xBZGRCY2FzdFBhdHRlcm4gZmFpbGVkIHdpdGggZXJyb3IgY29kZSAoJWQpLiIsCisgICAgICAgICAgICAgICBfX2Z1bmNfXywgaGFsU3RhdHVzKTsKKworICAgIHJldHVybiBWT1NfRkFMU0U7CisgIH0KKworICAvKiBBbGwgaXMgZ29vZC4gKi8KKyAgaWYgKCFnX2hkZF93b3dsX3B0cm5zX2RlYnVnZnNbcGF0dGVybl9pZHhdKQorICB7CisgICAgZ19oZGRfd293bF9wdHJuc19kZWJ1Z2ZzW3BhdHRlcm5faWR4XSA9IDE7CisgICAgZ19oZGRfd293bF9wdHJuc19jb3VudCsrOworICB9CisKKyAgZHVtcF9oZGRfd293bF9wdHJuKCZsb2NhbFBhdHRlcm4pOworCisgIHJldHVybiBWT1NfVFJVRTsKK30KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX2RlbF93b3dsX3B0cm5fZGVidWdmcygpIC0gRnVuY3Rpb24gd2hpY2ggd2lsbCByZW1vdmUgYSBXb1cgcGF0dGVybgorICBzZW50IGZyb20gZGVidWdmcyBpbnRlcmZhY2UKKworICBAcGFyYW0gcEFkYXB0ZXIgICAgOiBbaW5dIHBvaW50ZXIgdG8gdGhlIGFkYXB0ZXIKKyAgICAgICAgIHBhdHRlcm5faWR4IDogW2luXSBpbmRleCBvZiB0aGUgcGF0dGVybiB0byBiZSByZW1vdmVkCisKKyAgQHJldHVybiAgICAgICAgICAgIDogRkFMU0UgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZAorICAgICAgICAgICAgICAgICAgICAgOiBUUlVFIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordl9CT09MX3QgaGRkX2RlbF93b3dsX3B0cm5fZGVidWdmcyhoZGRfYWRhcHRlcl90ICpwQWRhcHRlciwgdl9VOF90IHBhdHRlcm5faWR4KQoreworICB0U2lyV293bERlbEJjYXN0UHRybiBkZWxQYXR0ZXJuOworICB0SGFsSGFuZGxlIGhIYWwgPSBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlcik7CisgIGVIYWxTdGF0dXMgaGFsU3RhdHVzOworICB2X1U4X3Qgc2Vzc2lvbklkID0gcEFkYXB0ZXItPnNlc3Npb25JZDsKKworICBpZiAocGF0dGVybl9pZHggPiAoV09XTF9NQVhfUFRSTlNfQUxMT1dFRCAtIDEpKQorICB7CisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIiVzOiBXb1cgcGF0dGVybiBpbmRleCAlZCBpcyBub3QgaW4gdGhlIHJhbmdlICgwIH4gJWQpLiIsCisgICAgICAgICAgICAgICBfX2Z1bmNfXywgcGF0dGVybl9pZHgsIFdPV0xfTUFYX1BUUk5TX0FMTE9XRUQgLSAxKTsKKworICAgIHJldHVybiBWT1NfRkFMU0U7CisgIH0KKworICBpZiAoIWdfaGRkX3dvd2xfcHRybnNfZGVidWdmc1twYXR0ZXJuX2lkeF0pCisgIHsKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiJXM6IFdvVyBwYXR0ZXJuICVkIGlzIG5vdCBpbiB0aGUgdGFibGUuIiwKKyAgICAgICAgICAgICAgIF9fZnVuY19fLCBwYXR0ZXJuX2lkeCk7CisKKyAgICByZXR1cm4gVk9TX0ZBTFNFOworICB9CisKKyAgZGVsUGF0dGVybi51Y1BhdHRlcm5JZCA9IHBhdHRlcm5faWR4OworICBoYWxTdGF0dXMgPSBzbWVfV293bERlbEJjYXN0UGF0dGVybihoSGFsLCAmZGVsUGF0dGVybiwgc2Vzc2lvbklkKTsKKworICBpZiAoIUhBTF9TVEFUVVNfU1VDQ0VTUyhoYWxTdGF0dXMpKQorICB7CisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIiVzOiBzbWVfV293bERlbEJjYXN0UGF0dGVybiBmYWlsZWQgd2l0aCBlcnJvciBjb2RlICglZCkuIiwKKyAgICAgICAgICAgICAgIF9fZnVuY19fLCBoYWxTdGF0dXMpOworCisgICAgcmV0dXJuIFZPU19GQUxTRTsKKyAgfQorCisgIGdfaGRkX3dvd2xfcHRybnNfZGVidWdmc1twYXR0ZXJuX2lkeF0gPSAwOworICBnX2hkZF93b3dsX3B0cm5zX2NvdW50LS07CisKKyAgcmV0dXJuIFZPU19UUlVFOworfQorCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfZW50ZXJfd293bCgpIC0gRnVuY3Rpb24gd2hpY2ggd2lsbCBlbmFibGUgV29XTC4gQXRsZWFzdCBvbmUKKyAgb2YgTVAgYW5kIFBCTSBtdXN0IGJlIGVuYWJsZWQKKworICBAcGFyYW0gZW5hYmxlX21wICA6IFtpbl0gV2hldGhlciB0byBlbmFibGUgbWFnaWMgcGFja2V0IFdvV0wgbW9kZQorICBAcGFyYW0gZW5hYmxlX3BibSA6IFtpbl0gV2hldGhlciB0byBlbmFibGUgcGF0dGVybiBieXRlIG1hdGNoaW5nIFdvV0wgbW9kZQorCisgIEByZXR1cm4gICAgICAgICAgIDogRkFMU0UgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZAorICAgICAgICAgICAgICAgICAgICA6IFRSVUUgb3RoZXJ3aXNlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2X0JPT0xfdCBoZGRfZW50ZXJfd293bCAoaGRkX2FkYXB0ZXJfdCAqcEFkYXB0ZXIsIHZfQk9PTF90IGVuYWJsZV9tcCwgdl9CT09MX3QgZW5hYmxlX3BibSkKK3sKKyAgdFNpclNtZVdvd2xFbnRlclBhcmFtcyB3b3dQYXJhbXM7CisgIGVIYWxTdGF0dXMgaGFsU3RhdHVzOworICB0SGFsSGFuZGxlIGhIYWwgPSBXTEFOX0hERF9HRVRfSEFMX0NUWChwQWRhcHRlcik7CisKKyAgdm9zX21lbV96ZXJvKCAmd293UGFyYW1zLCBzaXplb2YoIHRTaXJTbWVXb3dsRW50ZXJQYXJhbXMgKSApOworCisgIHdvd1BhcmFtcy51Y1BhdHRlcm5GaWx0ZXJpbmdFbmFibGUgPSBlbmFibGVfcGJtOworICB3b3dQYXJhbXMudWNNYWdpY1BrdEVuYWJsZSA9IGVuYWJsZV9tcDsKKyAgaWYoZW5hYmxlX21wKQorICB7CisgICAgdm9zX2NvcHlfbWFjYWRkciggKHZfTUFDQUREUl90ICopJih3b3dQYXJhbXMubWFnaWNQdHJuKSwKKyAgICAgICAgICAgICAgICAgICAgJihwQWRhcHRlci0+bWFjQWRkcmVzc0N1cnJlbnQpICk7CisgIH0KKworI2lmZGVmIFdMQU5fV0FLRVVQX0VWRU5UUworICB3b3dQYXJhbXMudWNXb1dFQVBJRFJlcXVlc3RFbmFibGUgPSBWT1NfVFJVRTsKKyAgd293UGFyYW1zLnVjV29XRUFQT0w0V2F5RW5hYmxlID0gVk9TX1RSVUU7CisgIHdvd1BhcmFtcy51Y1dvd05ldFNjYW5PZmZsb2FkTWF0Y2ggPSBWT1NfVFJVRTsKKyAgd293UGFyYW1zLnVjV293R1RLUmVrZXlFcnJvciA9IFZPU19UUlVFOworICB3b3dQYXJhbXMudWNXb1dCU1NDb25uTG9zcyA9IFZPU19UUlVFOworI2VuZGlmIC8vIFdMQU5fV0FLRVVQX0VWRU5UUworCisgIC8vIFJlcXVlc3QgdG8gcHV0IExpYnJhIGludG8gV29XTAorICBoYWxTdGF0dXMgPSBzbWVfRW50ZXJXb3dsKCBoSGFsLCBoZGRfd293bF9jYWxsYmFjaywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLAorI2lmZGVmIFdMQU5fV0FLRVVQX0VWRU5UUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZGRfd293bF93YWtlSW5kaWNhdGlvbl9jYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXIsCisjZW5kaWYgLy8gV0xBTl9XQUtFVVBfRVZFTlRTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ3b3dQYXJhbXMsIHBBZGFwdGVyLT5zZXNzaW9uSWQpOworCisgIGlmICggIUhBTF9TVEFUVVNfU1VDQ0VTUyggaGFsU3RhdHVzICkgKQorICB7CisgICAgaWYgKCBlSEFMX1NUQVRVU19QTUNfUEVORElORyAhPSBoYWxTdGF0dXMgKQorICAgIHsKKyAgICAgIC8vIFdlIGZhaWxlZCB0byBlbnRlciBXb1dMCisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICJzbWVfRW50ZXJXb3dsIGZhaWxlZCB3aXRoIGVycm9yIGNvZGUgKCVkKSIsIGhhbFN0YXR1cyApOworICAgICAgcmV0dXJuIFZPU19GQUxTRTsKKyAgICB9CisgIH0KKyAgcmV0dXJuIFZPU19UUlVFOworfQorCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBicmllZiBoZGRfZXhpdF93b3dsKCkgLSBGdW5jdGlvbiB3aGljaCB3aWxsIGRpc2FibGUgV29XTAorCisgIEBwYXJhbSB3b3dsRXhpdFNyYzogVG8ga25vdyBpcyB3b3dsIGV4aXRpbmcgYmVjYXVzZSBvZiB3YWtldXAgcGt0IG9yIHVzZXIKKyAgICAgICAgICAgICAgICAgICAgICBleHBsaWNpdGx5IGRpc2FibGluZyBXb1dMCisgIEByZXR1cm4gICAgICAgICAgIDogRkFMU0UgaWYgYW55IGVycm9ycyBlbmNvdW50ZXJlZAorICAgICAgICAgICAgICAgICAgICA6IFRSVUUgb3RoZXJ3aXNlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2X0JPT0xfdCBoZGRfZXhpdF93b3dsIChoZGRfYWRhcHRlcl90KnBBZGFwdGVyLCB0V293bEV4aXRTb3VyY2Ugd293bEV4aXRTcmMpCit7CisgIHRIYWxIYW5kbGUgaEhhbCA9IFdMQU5fSEREX0dFVF9IQUxfQ1RYKHBBZGFwdGVyKTsKKyAgZUhhbFN0YXR1cyBoYWxTdGF0dXM7CisKKyAgaGFsU3RhdHVzID0gc21lX0V4aXRXb3dsKCBoSGFsLCB3b3dsRXhpdFNyYyApOworICBpZiAoICFIQUxfU1RBVFVTX1NVQ0NFU1MoIGhhbFN0YXR1cyApICkKKyAgeworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICJzbWVfRXhpdFdvd2wgZmFpbGVkIHdpdGggZXJyb3IgY29kZSAoJWQpIiwgaGFsU3RhdHVzICk7CisgICAgcmV0dXJuIFZPU19GQUxTRTsKKyAgfQorCisgIHJldHVybiBWT1NfVFJVRTsKK30KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAYnJpZWYgaGRkX2luaXRfd293bCgpIC0gSW5pdCBmdW5jdGlvbiB3aGljaCB3aWxsIGluaXRpYWxpemUgdGhlIFdvV0wgbW9kdWxlCisgIGFuZCBwZXJmb3JtIGFueSByZXF1aXJlZCBpbnRpYWwgY29uZmlndXJhdGlvbiAKKworICBAcmV0dXJuICAgICAgICAgICA6IEZBTFNFIGlmIGFueSBlcnJvcnMgZW5jb3VudGVyZWQKKyAgICAgICAgICAgICAgICAgICAgOiBUUlVFIG90aGVyd2lzZQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordl9CT09MX3QgaGRkX2luaXRfd293bCAoaGRkX2FkYXB0ZXJfdCpwQWRhcHRlcikgCit7CisgIGhkZF9jb250ZXh0X3QgKnBIZGRDdHggPSBOVUxMOworICBwSGRkQ3R4ID0gcEFkYXB0ZXItPnBIZGRDdHg7CisKKyAgbWVtc2V0KGdfaGRkX3dvd2xfcHRybnMsIDAsIHNpemVvZihnX2hkZF93b3dsX3B0cm5zKSk7CisKKyAgLy9BZGQgYW55IHN0YXRpY2FsbHkgY29uZmlndXJlZCBwYXR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gICAgICAgICAgICAgICAgICBfX2F0dHJpYnV0ZV9fKChhbGlnbmVkKDIpKSkKKyNkZWZpbmUgX19hbmlfYXR0cl9hbGlnbmVkXzQgICAgICAgICAgICAgICAgICAgIF9fYXR0cmlidXRlX18oKGFsaWduZWQoNCkpKQorI2RlZmluZSBfX2FuaV9hdHRyX2FsaWduZWRfOCAgICAgICAgICAgICAgICAgICAgX19hdHRyaWJ1dGVfXygoYWxpZ25lZCg4KSkpCisjZGVmaW5lIF9fYW5pX2F0dHJfYWxpZ25lZF8xNiAgICAgICAgICAgICAgICAgICBfX2F0dHJpYnV0ZV9fKChhbGlnbmVkKDE2KSkpCisjZGVmaW5lIF9fYW5pX2F0dHJfYWxpZ25lZF8zMiAgICAgICAgICAgICAgICAgICBfX2F0dHJpYnV0ZV9fKChhbGlnbmVkKDMyKSkpCisjZWxpZiBkZWZpbmVkKEFOSV9DT01QSUxFUl9UWVBFX1JWQ1QpCisvKiBOb3RoaW5nIGRlZmluZWQgc28gZmFyICovCisjZGVmaW5lIF9fYW5pX2F0dHJfcGFja2VkCisjZGVmaW5lIF9fYW5pX2F0dHJfcHJlX3BhY2tlZCAgICAgICAgICAgICAgICAgICBfX3BhY2tlZAorI2RlZmluZSBfX2FuaV9hdHRyX2FsaWduZWRfMiAgICAgICAgICAgICAgICAgICAgX19hbGlnbigyKQorI2RlZmluZSBfX2FuaV9hdHRyX2FsaWduZWRfNCAgICAgICAgICAgICAgICAgICAgX19hbGlnbig0KQorI2RlZmluZSBfX2FuaV9hdHRyX2FsaWduZWRfOCAgICAgICAgICAgICAgICAgICAgX19hbGlnbig4KQorI2RlZmluZSBfX2FuaV9hdHRyX2FsaWduZWRfMTYgICAgICAgICAgICAgICAgICAgX19hbGlnbigxNikKKyNkZWZpbmUgX19hbmlfYXR0cl9hbGlnbmVkXzMyICAgICAgICAgICAgICAgICAgIF9fYWxpZ24oMzIpCisjZWxzZQorI2Vycm9yICJVbmtub3duIGNvbXBpbGVyIgorI2VuZGlm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W5lIEFOSV9EQkdfR1JQX0lORk9fVFlQRV9SSFAgICAgICAgMHgwMDAwMDAwOAorI2RlZmluZSBBTklfREJHX0dSUF9JTkZPX1RZUEVfUkZQICAgICAgIDB4MDAwMDAwMTAKKyNkZWZpbmUgQU5JX0RCR19HUlBfSU5GT19UWVBFX1NUQSAgICAgICAweDAwMDAwMDIwCisjZGVmaW5lIEFOSV9EQkdfR1JQX0lORk9fVFlQRV9GUEhZICAgICAgMHgwMDAwMDA0MAorI2RlZmluZSBBTklfREJHX0dSUF9JTkZPX1RZUEVfRlBIWV9GSUZPIDB4MDAwMDAwODAKKyNkZWZpbmUgQU5JX0RCR19HUlBfSU5GT19UWVBFX1JQSFkgICAgICAweDAwMDAwMTAwCisjZGVmaW5lIEFOSV9EQkdfR1JQX0lORk9fVFlQRV9IQ0YgICAgICAgMHgwMDAwMDIwMAorI2RlZmluZSBBTklfREJHX0dSUF9JTkZPX1RZUEVfU1AgICAgICAgIDB4MDAwMDA0MDAKKyNkZWZpbmUgQU5JX0RCR19HUlBfSU5GT19UWVBFX0NQICAgICAgICAweDAwMDAwODAwCisKKworI2RlZmluZSBBTklfREJHX0dSUF9JTkZPX1RZUEVfQUxMICAgICAgIChBTklfREJHX0dSUF9JTkZPX1RZUEVfTUlTQyB8ICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFOSV9EQkdfR1JQX0lORk9fVFlQRV9CTVUgfCAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFOSV9EQkdfR1JQX0lORk9fVFlQRV9URlAgfCAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFOSV9EQkdfR1JQX0lORk9fVFlQRV9SSFAgfCAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFOSV9EQkdfR1JQX0lORk9fVFlQRV9SRlAgfCAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFOSV9EQkdfR1JQX0lORk9fVFlQRV9TVEEgfCAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFOSV9EQkdfR1JQX0lORk9fVFlQRV9GUEhZfCAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFOSV9EQkdfR1JQX0lORk9fVFlQRV9GUEhZX0ZJRk8gfCAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFOSV9EQkdfR1JQX0lORk9fVFlQRV9SUEhZIHwgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFOSV9EQkdfR1JQX0lORk9fVFlQRV9IQ0YgfCAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFOSV9EQkdfR1JQX0lORk9fVFlQRV9TUCkKKworCisKK3R5cGVkZWYgc3RydWN0IHNBTklfREJHX01JU0NfSU5GTyB7CisKKyAgICB1bnNpZ25lZCBsb25nIHN5c01vZGU7CisgICAgdW5zaWduZWQgbG9uZyBzeXNJbnRyTWFzazsKKyAgICB1bnNpZ25lZCBsb25nIGludHJNYXNrOworICAgIHVuc2lnbmVkIGxvbmcgcGh5SW50ck1hc2s7CisgICAgdW5zaWduZWQgbG9uZyBpbnRyU3RhdHVzWzMyXTsKKyAgICB1bnNpZ25lZCBsb25nIHBoeUludHJTdGF0dXNbMTZdOworICAgIHVuc2lnbmVkIGxvbmcgZW9mU29mRXhjZXB0aW9uUmVzZXRzOyAgCisgICAgdW5zaWduZWQgbG9uZyBibXVFeGNlcHRpb25SZXNldHM7ICAgICAgCisgICAgdW5zaWduZWQgbG9uZyBsb3dQZHVFeGNlcHRpb25SZXNldHM7ICAKKyAgICB1bnNpZ25lZCBsb25nIHVzZXJUcmlnZ2VyZWRSZXNldHM7CisgICAgdW5zaWduZWQgbG9uZyBsb2dQRXhjZXB0aW9uUmVzZXRzOwor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duZWQgbG9uZyB3ZXBfZGt5M193MDsKKyAgICB1bnNpZ25lZCBsb25nIHdlcF9ka3kzX3cxOworICAgIHVuc2lnbmVkIGxvbmcgd2VwX2RlZmF1bHRfcmMzOworCit9IHRBTklfREJHX1NQX0lORk87CisKK3R5cGVkZWYgc3RydWN0IHNBTklfREJHX0NQX0lORk8geworCisgICAgdW5zaWduZWQgbG9uZyBjcF9jb250cm9sOworICAgIHVuc2lnbmVkIGxvbmcgQ29tcHJlc3Npb25fRXhwYW5zaW9uX0NudDsKKyAgICB1bnNpZ25lZCBsb25nIENvbXByZXNzaW9uX05VTV9wa3RzOworCisgICAgdW5zaWduZWQgbG9uZyBEZWNvbXByZXNzaW9uX05VTV9wa3RzOworICAgIHVuc2lnbmVkIGxvbmcgQ29tcHJlc3Npb25fNTBwX05VTV9wa3RzOworICAgIHVuc2lnbmVkIGxvbmcgQ1BfRXJyb3Jfc3RhdHVzOworCisgICAgdW5zaWduZWQgbG9uZyBDcF9tYXhpbXVtX3BrdF9sZW47CisgCit9IHRBTklfREJHX0NQX0lORk87CisKKwordHlwZWRlZiBzdHJ1Y3Qgc0FOSV9EQkdfU1RBX1RYX1dRX0lORk8geworCisgICAgdW5zaWduZWQgbG9uZyB0eFdxQWRkcjsKKyAgICB1bnNpZ25lZCBsb25nIHR4V3FEdW1wWzRdOworCisgICAgdW5zaWduZWQgbG9uZyB0cHRyOworICAgIHVuc2lnbmVkIGxvbmcgaHB0cjsKKyAgICB1bnNpZ25lZCBsb25nIGFwdHI7CisgICAgdW5zaWduZWQgbG9uZyBhX3Rwa3RzOworICAgIHVuc2lnbmVkIGxvbmcgaF90cGt0czsKKyAgICB1bnNpZ25lZCBsb25nIGZyYWc7CisgICAgdW5zaWduZWQgbG9uZyBieXRlczsKKyAgICB1bnNpZ25lZCBsb25nIGFjazsKKyAgICB1bnNpZ25lZCBsb25nIHZhbGlkOworCit9IHRBTklfREJHX1NUQV9UWF9XUV9JTkZPOworCisKKwordHlwZWRlZiBz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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKgorICovCisKKyNpZm5kZWYgX0FOSVBBUkFNX0gKKyNkZWZpbmUgX0FOSVBBUkFNX0gKKworI2luY2x1ZGUgImhhbFR5cGVzLmgiCisKKy8qKgorICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKKyAqICBNQUMgcGFyYW1ldGVyIHN0cnVjdHVyZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICBUaGlzIHN0cnVjdHVyZSBpcyB0aGUgb25seSBpbnRlcmZhY2UgcGFzc2VkIGJldHdlZW4gdGhlIE1BQyBGVyBhbmQgdGhlICoKKyAqICBob3N0IGRyaXZlci4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICBIb3N0LXRvLU1BQyBwYXJhbWV0ZXJzOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICA9PT09PT09PT09PT09PT09PT09PT09PSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICByYWRpb0lkOiAgICAgICAgIHJhZGlvIElEICgxIG9yIDIpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICBwUGFja2V0QnVmQWxsb2M6IGZ1bmN0aW9uIHBvaW50ZXIgZm9yIFNLQnVmZmVyIGFsbG9jYXRpb24gICAgICAgICAgICAgICoKKyAqICBwUGFja2V0QnVmRnJlZSA6IGZ1bmN0aW9uIHBvaW50ZXIgZm9yIFNLQnVmZmVyIGZyZWUgICAgICAgICAgICAgICAgICAgICoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICovCit0eXBlZGVmIHN0cnVjdCAKK3sKKyAgICAvLyBIREQgdG8gTUFDIHBhcmFtZXRlcnMKKyAgICBpbnQgICAgICAgICAgICAgcmFkaW9JZDsKKworICAgIHZvaWQgICAgICAgICAgKCpwUGFja2V0QnVmQWxsb2MpKHVuc2lnbmVkIHNob3J0IHNpemUsIHZvaWQgKipwcEJ1ZiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqKnBwU2tiLCB2b2lkICpkZXYpOworICAgIHZvaWQgICAgICAgICAgKCpwUGFja2V0QnVmRnJlZSkodm9pZCogcEJ1Ziwgdm9pZCAqcFNrYik7CisKKyAgICBpbnQgcnhfdGFza2xldDsKKworICAgIC8vIGJsb2NrIHRhYmxlIGFsbG9jYXRlZCBieSBIREQKKyAgICB2b2lkICogYmxvY2tfdGFibGU7CisKKyAgICB0SGFsSGFuZGxlIGhIYWxIYW5kbGU7CisKK30gdEFuaU1hY1BhcmFtOworCisKKyNpZmRlZiBBTklfQVBfU0RLCisjZGVmaW5lIE5VTV9SQURJTyAxCisjZWxzZQorI2RlZmluZSBOVU1fUkFESU8gMgorI2VuZGlmCisKKworI2VuZGlmIC8qIF9BTklQQVJBTV9IICovCisKKwpkaWZmIC0tZ2l0IGEvd2xhbi9wcmltYS9DT1JFL01BQy9pbmMvYW5pU3lzdGVtRGVmcy5oIGIvd2xhbi9wcmltYS9DT1JFL01BQy9pbmMvYW5pU3lzdGVtRGVmcy5oCm5ldyBmaWxlIG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RTaXJRb3MsICp0cFNpclFvczsKKworLy8vIERlZmluaXRpb24gZm9yIEVuY3J5cHRpb24gS2V5cwordHlwZWRlZiBzdHJ1Y3Qgc1NpcktleXMKK3sKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAga2V5SWQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgIHVuaWNhc3Q7ICAgICAvLyAwIGZvciBtdWx0aWNhc3QKKyAgICB0QW5pS2V5RGlyZWN0aW9uICAgIGtleURpcmVjdGlvbjsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAga2V5UnNjW1dMQU5fTUFYX0tFWV9SU0NfTEVOXTsgICAvLyBVc2FnZSBpcyB1bmtub3duCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgIHBhZVJvbGU7ICAgICAvLyA9MSBmb3IgYXV0aGVudGljYXRvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyA9MCBmb3Igc3VwcGxpY2FudAorICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgICBrZXlMZW5ndGg7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgIGtleVtTSVJfTUFDX01BWF9LRVlfTEVOR1RIXTsKK30gdFNpcktleXMsICp0cFNpcktleXM7CisKKy8vLyBEZWZpbml0aW9uIGZvciBLZXlpbmcgbWF0ZXJpYWwKK3R5cGVkZWYgc3RydWN0IHNTaXJLZXlNYXRlcmlhbAoreworICAgIHRBTklfVTE2ICAgICAgICAgbGVuZ3RoOyAgICAvLyBUaGlzIGlzIHRoZSBsZW5ndGggb2YgYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBkYXRhIHRoYXQgZm9sbG93cworICAgIHRBbmlFZFR5cGUgIGVkVHlwZTsgICAgLy8gRW5jcnlwdGlvbi9EZWNyeXB0aW9uIHR5cGUKKyAgICB0QU5JX1U4ICAgICAgICAgIG51bUtleXM7CisgICAgdFNpcktleXMgICAga2V5WzFdOworfSB0U2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3MgZm9yIGR1bXAgY29tbWFuZHMuCisKK0F1dGhvcjogICAgU2FudG9zaCBNYW5kaWdhbmFsCitEYXRlOiAgICAgIDA0LzA2LzIwMDgKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisKKyNpZm5kZWYgX19MT0dEVU1QX0hfXworI2RlZmluZSBfX0xPR0RVTVBfSF9fCisKKyNkZWZpbmUgTUFYX0RVTVBfQ01EICAgICAgICAgICAgOTk5CisjZGVmaW5lIE1BWF9EVU1QX1RBQkxFX0VOVFJZICAgIDEwCisKK3R5cGVkZWYgY2hhciAqICgqdHBGdW5jKSh0cEFuaVNpckdsb2JhbCwgdEFOSV9VMzIsIHRBTklfVTMyLCB0QU5JX1UzMiwgdEFOSV9VMzIsIGNoYXIgKik7CisKK3R5cGVkZWYgc3RydWN0IHNEdW1wRnVuY0VudHJ5ICB7CisgICAgdEFOSV9VMzIgICAgaWQ7CisgICAgY2hhciAgICAgICAqZGVzY3JpcHRpb247CisgICAgdHBGdW5jICAgICAgZnVuYzsKK30gdER1bXBGdW5jRW50cnk7CisKK3R5cGVkZWYgc3RydWN0IHNEdW1wTW9kdWxlRW50cnkgIHsKKyAgICB0QU5JX1UzMiAgICBtaW5kdW1waWQ7CisgICAgdEFOSV9VMzIgICAgbWF4ZHVtcGlkOworICAgIHRBTklfVTMyICAgIG5JdGVtczsKKyAgICB0RHVtcEZ1bmNFbnRyeSAgICAgKmR1bXBUYWJsZTsKK30gdER1bXBNb2R1bGVFbnRyeTsKKwordHlwZWRlZiBzdHJ1Y3Qgc1JlZ0xpc3QgeworICAgIHRBTklfVTMyICAgIGFkZHI7CisgICAgY2hhciAgICAgICAqbmFtZTsKK30gdExvZ2RSZWdMaXN0OworCitpbnQgbG9nX3NwcmludGYodHBBbmlTaXJHbG9iYWwgcE1hYywgY2hhciAqcEJ1ZiwgY2hhciAqZm10LCAuLi4gKTsKKworY2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AgICAgICAgICAgICAvLyBub3QgcmVzcG9uZCBiZWZvcmUgbmV4dCB0ZXN0IHBhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlzIHNlbnQKKyAgICBlU0lSX1NNRV9MSU5LX1RFU1RfQ09NUExFVEUsICAgICAgICAvLyBHaXZlbiBpbiBMSU5LX1RFU1RfSU5EIGF0IHRoZSBlbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBvZiBsaW5rIHRlc3QKKyAgICBlU0lSX1NNRV9MSU5LX1RFU1RfSU5WQUxJRF9TVEFURSwgICAvLyBHaXZlbiBpbiBMSU5LX1RFU1RfU1RBUlRfUlNQCisgICAgZVNJUl9TTUVfTElOS19URVNUX1RFUk1JTkFURSwgICAgICAgLy8gR2l2ZW4gaW4gTElOS19URVNUX1NUQVJUX1JTUAorICAgIGVTSVJfU01FX0xJTktfVEVTVF9JTlZBTElEX0FERFJFU1MsIC8vIEdpdmVuIGluIExJTktfVEVTVF9TVE9QX1JTUAorICAgIGVTSVJfU01FX1BPTEFSSVNfUkVTRVQsICAgICAgICAgICAgIC8vIEdpdmVuIGluIFNNRV9TVE9QX0JTU19SRVEKKyAgICBlU0lSX1NNRV9TRVRDT05URVhUX0ZBSUxFRCwgICAgICAgICAvLyBHaXZlbiBpbiBTTUVfU0VUQ09OVEVYVF9SRVEgd2hlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHVuYWJsZSB0byBwbHVtYiBkb3duIGtleXMKKyAgICBlU0lSX1NNRV9CU1NfUkVTVEFSVCwgICAgICAgICAgICAgICAvLyBHaXZlbiBpbiBTTUVfU1RPUF9CU1NfUkVRCisKKyAgICBlU0lSX1NNRV9NT1JFX1NDQU5fUkVTVUxUU19GT0xMT1csICAvLyBHaXZlbiBpbiBTTUVfU0NBTl9SU1AgbWVzc2FnZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoYXQgbW9yZSBTTUVfU0NBTl9SU1AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBtZXNzYWdlcyBhcmUgZm9sbG93aW5nLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNNRV9TQ0FOX1JTUCBtZXNzYWdlIHdpdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBlU0lSX1NNRV9TVUNDRVNTIHN0YXR1cworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvZGUgaXMgdGhlIGxhc3Qgb25lLgorICAgIGVTSVJfU01FX0lOVkFMSURfQVNTT0NfUlNQX1JYRUQsICAgIC8vIFNlbnQgaW4gU01FX0pPSU4vUkVBU1NPQ19SU1AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBtZXNzYWdlcyB1cG9uIHJlY2VpdmluZworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGludmFsaWQgUmUvQXNzb2MgUnNwIGZyYW1lLgorICAgIGVTSVJfU01FX01JQ19DT1VOVEVSX01FQVNVUkVTLCAgICAgIC8vIFNUT1AgQlNTIHRyaWdnZXJlZCBieSBNSUMgZmFpbHVyZXM6IE1BQyBzb2Z0d2FyZSB0byBkaXNhc3NvYyBhbGwgc3RhdGlvbnMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB3aXRoIE1JQ19GQUlMVVJFIHJlYXNvbiBjb2RlIGFuZCBwZXJmb3JtIHRoZSBzdG9wIGJzcyBvcGVyYXRpb24KKyAgICBlU0lSX1NNRV9BRERUU19SU1BfVElNRU9VVCwgICAgICAgICAvLyBkaWRuJ3QgZ2V0IHJlc3BvbnNlIGZyb20gcGVlciB3aXRoaW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLy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TVAgU3VwcG9ydAorICAgIHRTaXJNYWNBZGRyICAgICAgICAgICAgIGJzc0lkOyAgICAgICAgICAgLy9BZGRlZCBmb3IgQlQtQU1QIFN1cHBvcnQKKyAgICB0U2lyTWFjQWRkciAgICAgICAgICAgICBzZWxmTWFjQWRkcjsgICAgIC8vQWRkZWQgZm9yIEJULUFNUCBTdXBwb3J0CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgYmVhY29uSW50ZXJ2YWw7ICAvL0FkZGVkIGZvciBCVC1BTVAgU3VwcG9ydAorICAgIHRBTklfVTggICAgICAgICAgICAgICAgIGRvdDExbW9kZTsKKyAgICB0U2lyQnNzVHlwZSAgICAgICAgICAgICBic3NUeXBlOworICAgIHRTaXJNYWNTU2lkICAgICAgICAgICAgIHNzSWQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgY2hhbm5lbElkOworICAgIGVQaHlDaGFuQm9uZFN0YXRlICAgICAgIGNiTW9kZTsKKyAgICAKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICBwcml2YWN5OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgIGFwVWFwc2RFbmFibGU7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgc3NpZEhpZGRlbjsKKyAgICB0QU5JX0JPT0xFQU4gICAgICAgICAgICBmd2RXUFNQQkNQcm9iZVJlcTsKKyAgICB0QU5JX0JPT0xFQU4gICAgICAgICAgICBwcm90RW5hYmxlZDsKKyAgICB0QU5JX0JPT0xFQU4gICAgICAgICAgICBvYnNzUHJvdEVuYWJsZWQ7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgaHRfY2FwYWI7CisgICAgdEFuaUF1dGhUeXBlICAgICAgICAgICAgYXV0aFR5cGU7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgZHRpbVBlcmlvZDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICB3cHNfc3RhdGU7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgaXNDb2FsZXNpbmdJbklCU1NBbGxvd2VkOyAvL0NvYWxlc2luZyBvbi9vZmYga25vYgorICAgIHRWT1NfQ09OX01PREUgICAgICAgICAgIGJzc1BlcnNvbmE7CisKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICB0eExkcGNJbmlGZWF0dXJlRW5hYmxlZDsKKworICAgIHRTaXJSU05pZSAgICAgICAgICAgICAgIHJzbklFOyAgICAgICAgICAgICAvLyBSU04gSUUgdG8gYmUgc2VudCBpbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBCZWFjb24gYW5kIFByb2JlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJlc3BvbnNlIGZyYW1lcworICAgIHRTaXJOd1R5cGUgICAgICAgICAgICAgIG53VHlwZTsgICAgICAgICAgICAvLyBJbmRpY2F0ZXMgMTFhL2IvZworICAgIHRTaXJNYWNSYXRlU2V0ICAgICAgICAgIG9wZXJhdGlvbmFsUmF0ZVNldDsvLyBIYXMgMTFhIG9yIDExYiByYXRlcworICAgIHRTaXJNYWNSYXRlU2V0ICAgICAgICAgIGV4dGVuZGVkUmF0ZVNldDsgICAgLy8gSGFzIDExZyByYXRlcworCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgIHRBTklfQk9PTEVBTiAgICAgICAgICAgIHBtZkNhcGFibGU7CisgICAgdEFOSV9CT09MRUFOICAgICAgICAgICAgcG1mUmVxdWlyZWQ7CisjZW5kaWYKKworI2lmZGVmIFdMQU5fRkVBVFVSRV9BUF9IVDQwXzI0RworICAgIHRBTklfQk9PTEVBTiAgICAgICAgICAgIGFwSFQ0MF8yNEdFbmFibGVkOworI2VuZGlmCit9IHRTaXJTbWVTdGFydEJzc1JlcSwgKnRwU2lyU21lU3RhcnRCc3NSZXE7CisKKyNkZWZpbmUgR0VUX0lFX0xFTl9JTl9CU1MobGVuSW5Cc3MpICggbGVuSW5Cc3MgKyBzaXplb2YobGVuSW5Cc3MpIC0gXAorICAgICAgICAgICAgICAoKHVpbnRwdHJfdClPRkZTRVRfT0YoIHRTaXJCc3NEZXNjcmlwdGlvbiwgaWVGaWVsZHMpKSkKKworI2RlZmluZSBXU0NJRV9QUk9CRV9SU1BfTEVOICgzMTcgKyAyKQorCit0eXBlZGVmIHN0cnVjdCBzU2lyQnNzRGVzY3JpcHRpb24KK3sKKyAgICAvL29mZnNldCBvZiB0aGUgaWVGaWVsZHMgZnJvbSBic3NJZC4KKyAgICB0QU5JX1UxNiAgICAgICAgICAgICBsZW5ndGg7CisgICAgdFNpck1hY0FkZHIgICAgICAgICAgYnNzSWQ7CisgICAgdl9USU1FX3QgICAgICAgICAgICAgc2NhblN5c1RpbWVNc2VjOworICAgIHRBTklfVTMyICAgICAgICAgICAgIHRpbWVTdGFtcFsyXTsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICBiZWFjb25JbnRlcnZhbDsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICBjYXBhYmlsaXR5SW5mbzsKKyAgICB0U2lyTndUeXBlICAgICAgICAgICBud1R5cGU7IC8vIEluZGljYXRlcyAxMWEvYi9nCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgYW5pSW5kaWNhdG9yOworICAgIHRBTklfUzggICAgICAgICAgICAgIHJzc2k7CisgICAgdEFOSV9TOCAgICAgICAgICAgICAgc2lucjsKKyAgICAvL2NoYW5uZWxJZCB3aGF0IHBlZXIgc2VudCBpbiBiZWFjb24vcHJvYmVyc3AuCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgY2hhbm5lbElkOworICAgIC8vY2hhbm5lbElkIG9uIHdoaWNoIHdlIGFyZSBwYXJrZWQgYXQuCisgICAgLy91c2VkIG9ubHkgaW4gc2NhbiBjYXNlLgorICAgIHRBTklfVTggICAgICAgICAgICAgIGNoYW5uZWxJZFNlbGY7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgc1NpckJzc0Rlc2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ICAgdFNpckJhY2tncm91bmRTY2FuTW9kZSAgIG1vZGU7Cit9IHRTaXJTbWVCYWNrZ3JvdW5kU2Nhbk1vZGVSZXEsICp0cFNpclNtZUJhY2tncm91bmRTY2FuTW9kZVJlcTsKKworLy8vIEJhY2tncm91bmQgU2NhbiBTdGF0aXNpY3MKK3R5cGVkZWYgc3RydWN0IHNTaXJCYWNrZ3JvdW5kU2NhbkluZm8geworICAgIHRBTklfVTMyICAgICAgICBudW1PZlNjYW5TdWNjZXNzOworICAgIHRBTklfVTMyICAgICAgICBudW1PZlNjYW5GYWlsdXJlOworICAgIHRBTklfVTMyICAgICAgICByZXNlcnZlZDsKK30gdFNpckJhY2tncm91bmRTY2FuSW5mbywgKnRwU2lyQmFja2dyb3VuZFNjYW5JbmZvOworCisjZGVmaW5lIFNJUl9CQUNLR1JPVU5EX1NDQU5fSU5GT19TSVpFICAgICAgICAoMyAqIHNpemVvZih0QU5JX1UzMikpCisKKy8vLyBEZWZpbml0aW9uIGZvciBBdXRoZW50aWNhdGlvbiByZXF1ZXN0Cit0eXBlZGVmIHN0cnVjdCBzU2lyU21lQXV0aFJlcQoreworICAgIHRBTklfVTE2ICAgICAgICAgICBtZXNzYWdlVHlwZTsgLy8gZVdOSV9TTUVfQVVUSF9SRVEKKyAgICB0QU5JX1UxNiAgICAgICAgICAgbGVuZ3RoOworICAgIHRBTklfVTggICAgICAgICAgICBzZXNzaW9uSWQ7ICAgICAgICAvLyBTZXNzaW9uIElECisgICAgdEFOSV9VMTYgICAgICAgICAgIHRyYW5zYWN0aW9uSWQ7ICAgIC8vIFRyYW5zYWN0aW9uIElEIGZvciBjbWQKKyAgICB0U2lyTWFjQWRkciAgICAgICAgYnNzSWQ7ICAgICAgICAgICAgLy8gU2VsZiBCU1NJRAorICAgIHRTaXJNYWNBZGRyICAgICAgICBwZWVyTWFjQWRkcjsKKyAgICB0QW5pQXV0aFR5cGUgICAgICAgYXV0aFR5cGU7CisgICAgdEFOSV9VOCAgICAgICAg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BzZWxmIE1hYyBhZGRyZXNzCisgICAgdFNpckJzc1R5cGUgICAgICAgICBic3N0eXBlOyAgICAgICAgICAgICAgICAvLyBhZGQgbmV3IHR5cGUgZm9yIEJUIC1BTVAgU1RBIGFuZCBBUCBNb2R1bGVzCisgICAgdEFOSV9VOCAgICAgICAgICAgICBkb3QxMW1vZGU7ICAgICAgICAgICAgICAvLyB0byBzdXBwb3J0IEJULUFNUCAgICAgCisgICAgdFZPU19DT05fTU9ERSAgICAgICBzdGFQZXJzb25hOyAgICAgICAgICAgICAvL1BlcnNvbmEKKyAgICB0QU5JX0JPT0xFQU4gICAgICAgIGJPU0VOQXNzb2NpYXRpb247ICAgICAgIC8vSFMyLjAKKyAgICBlUGh5Q2hhbkJvbmRTdGF0ZSAgIGNiTW9kZTsgICAgICAgICAgICAgICAgIC8vIFBhc3MgQ0IgbW9kZSB2YWx1ZSBpbiBKb2luLgorCisgICAgLypUaGlzIGNvbnRhaW5zIHRoZSBVQVBTRCBGbGFnIGZvciBhbGwgNCBBQworICAgICAqIEIwOiBBQ19WTyBVQVBTRCBGTEFHCisgICAgICogQjE6IEFDX1ZJIFVBUFNEIEZMQUcKKyAgICAgKiBCMjogQUNfQksgVUFQU0QgRkxBRworICAgICAqIEIzOiBBQ19CRSBVQVNQRCBGTEFHCisgICAgICovCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgdWFwc2RQZXJBY0JpdG1hc2s7CisKKyAgICB0U2lyTWFjUmF0ZVNldCAgICAgIG9wZXJhdGlvbmFsUmF0ZVNldDsvLyBIYXMgMTFhIG9yIDExYiByYXRlcworICAgIHRTaXJNYWNSYXRlU2V0ICAgICAgZXh0ZW5kZWRSYXRlU2V0OyAgICAvLyBIYXMgMTFnIHJhdGVzCisgICAgdEFOSV9VMTYgICAgICAgICAgICByYXRlQml0TWFwOworICAgIHRTaXJSU05pZSAgICAgICAgICAgcnNuSUU7ICAgICAgICAgICAgICAgICAgLy8gUlNOIElFIHRvIGJlIHNlbnQgaW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIChSZSkgQXNzb2NpYXRpb24gUmVxdWVzdAorI2lmZGVmIEZFQVRVUkVfV0xBTl9FU0UKKyAgICB0U2lyQ0NLTWllICAgICAgICAgIGNja21JRTsgICAgICAgICAgICAgLy8gQ0NNSyBJRSB0byBiZSBpbmNsdWRlZCBhcyBoYW5kbGVyIGZvciBqb2luIGFuZCByZWFzc29jIGlzIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgc2FtZS4gVGhlIGpvaW4gd2lsbCBuZXZlciBjYXJyeSBjY2ttLCBidXQgd2lsbCBiZSBzZXQgdG8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gMC4gCisjZW5kaWYKKworICAgIHRTaXJBZGRpZSAgICAgICAgICAgYWRkSUVTY2FuOyAgICAgICAgICAgICAgLy8gQWRkaXRpb25hbCBJRSB0byBiZSBzZW50IGluCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAodW5pY2FzdCkgUHJvYmUgUmVxdWVzdCBhdCB0aGUgdGltZSBvZiBqb2luCisKKyAgICB0U2lyQWRkaWUgICAgICAgICAgIGFkZElFQXNzb2M7ICAgICAgICAgICAgIC8vIEFkZGl0aW9uYWwgSUUgdG8gYmUgc2VudCBpbiAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIChSZSkgQXNzb2NpYXRpb24gUmVxdWVzdAorCisgICAgdEFuaUVkVHlwZSAgICAgICAgICBVQ0VuY3J5cHRpb25UeXBlOworCisgICAgdEFuaUVkVHlwZSAgICAgICAgICBNQ0VuY3J5cHRpb25UeXBlOworCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgIHRBbmlFZFR5cGUgICAgICAgICAgTWdtdEVuY3J5cHRpb25UeXBlOworI2VuZGlmCisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUgorICAgIHRBbmlCb29sICAgICAgICAgICAgaXMxMVJjb25uZWN0aW9uOworI2VuZGlmCisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRQorICAgIHRBbmlCb29sICAgICAgICAgICAgaXNFU0VGZWF0dXJlSW5pRW5hYmxlZDsKKyAgICB0QW5pQm9vbCAgICAgICAgICAgIGlzRVNFY29ubmVjdGlvbjsKKyAgICB0RVNFVHNwZWNJbmZvICAgICAgIGVzZVRzcGVjSW5mbzsKKyNlbmRpZgorICAgIAorI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIgfHwgZGVmaW5lZCBGRUFUVVJFX1dMQU5fRVNFIHx8IGRlZmluZWQoRkVBVFVSRV9XTEFOX0xGUikKKyAgICB0QW5pQm9vbCAgICAgICAgICAgIGlzRmFzdFRyYW5zaXRpb25FbmFibGVkOworI2VuZGlmCisjaWZkZWYgRkVBVFVSRV9XTEFOX0xGUgorICAgIHRBbmlCb29sICAgICAgICAgICAgaXNGYXN0Um9hbUluaUZlYXR1cmVFbmFibGVkOworI2VuZGlmCisKKyAgICB0QU5JX1U4ICAgICAgICAgICAgIHR4TGRwY0luaUZlYXR1cmVFbmFibGVkOworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisgICAgdEFOSV9VOCAgICAgICAgICAgICB0eEJGSW5pRmVhdHVyZUVuYWJsZWQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICB0eEJGQ3NuVmFsdWU7CisgICAgdEFOSV9VOCAgICAgICAgICAgICB0eE11QmZvcm1lZTsKKyNlbmRpZgorICAgIHRBTklfVTggICAgICAgICAgICAgaXNBbXNkdVN1cHBvcnRJbkFNUERVOworICAgIHRBbmlCb29sICAgICAgICAgICAgaXNXTUVlbmFibGVkOworICAgIHRBbmlCb29sICAgICAgICAgICAgaXNRb3NFbmFibGVkOworICAgIHRBbmlUaXRhbkNCTmVpZ2hib3JJbmZvIGNiTmVpZ2hib3JzOworICAgIHRBbmlCb29sICAgICAgICAgICAgc3BlY3RydW1NZ3RJbmRpY2F0b3I7CisgICAgdFNpck1hY1Bvd2VyQ2FwSW5mbyBwb3dlckNhcDsKKyAgICB0U2lyU3VwQ2hubCAgICAgICAgIHN1cHBvcnRlZENoYW5uZWxzOworICAgIHRTaXJCc3NEZXNjcmlwdGlvbiAgYnNzRGVzY3JpcHRpb247CisKK30gdFNpclNtZUpvaW5SZXEsICp0cFNpclNtZUpvaW5SZXE7CisKKy8vLyBEZWZpbml0aW9uIGZvciByZXBvbnNlIG1lc3NhZ2UgdG8gcHJldmlvdXNseSBpc3N1ZWQgam9pbiByZXF1ZXN0CisvLy8gTUFDIC0tLT4KK3R5cGVkZWYgc3RydWN0IHNTaXJTbWVKb2luUnNwCit7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgbWVzc2FnZVR5cGU7IC8vIGVXTklfU01FX0pPSU5fUlNQCisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgbGVuZ3RoOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgIHNlc3Npb25JZDsgICAgICAgICAvLyBTZXNzaW9uIElECisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgdHJhbnNhY3Rpb25JZDsgICAgIC8vIFRyYW5zYWN0aW9uIElEIGZvciBjbWQKKyAgICB0U2lyUmVzdWx0Q29kZXMgICAgc3RhdHVzQ29kZTsKKyAgICB0QW5pQXV0aFR5cGUgICAgICAgYXV0aFR5cGU7CisgICAgdEFOSV9VMTYgICAgICAgIHByb3RTdGF0dXNDb2RlOyAvL0l0IGhvbGRzIHJlYXNvbkNvZGUgd2hlbiBqb2luIGZhaWxzIGR1ZSB0byBkZWF1dGgvZGlzYXNzb2MgZnJhbWUuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL090aGVyd2lzZSBpdCBob2xkcyBzdGF0dXMgY29kZS4KKyAgICB0QU5JX1UxNiAgICAgICAgYWlkOworICAgIHRBTklfVTMyICAgICAgICBiZWFjb25MZW5ndGg7CisgICAgdEFOSV9VMzIgICAgICAgIGFzc29jUmVxTGVuZ3RoOworICAgIHRBTklfVTMyICAgICAgICBhc3NvY1JzcExlbmd0aDsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUgorICAgIHRBTklfVTMyICAgICAgICBwYXJzZWRSaWNSc3BMZW47CisjZW5kaWYKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICAgdEFOSV9VMzIgICAgICAgIHRzcGVjSWVMZW47CisjZW5kaWYKKyAgICB0QU5JX1UzMiAgICAgICAgc3RhSWQ7Ly9TdGF0aW9uIElEIGZvciBwZWVyCisKKyAgICAvKlRoZSBEUFUgc2lnbmF0dXJlcyB3aWxsIGJlIHNlbnQgZXZlbnR1YWxseSB0byBUTCB0byBoZWxwIGl0IGRldGVybWluZSB0aGUgCisgICAgICBhc3NvY2lhdGlvbiB0byB3aGljaCBhIHBhY2tldCBiZWxvbmdzIHRvKi8KKyAgICAvKlVuaWNhc3QgRFBVIHNpZ25hdHVyZSovCisgICAgdEFOSV9VOCAgICAgICAgICAgIHVjYXN0U2lnOworCisgICAgLypCcm9hZGNhc3QgRFBVIHNpZ25hdHVyZSovCisgICAgdEFOSV9VOCAgICAgICAgICAgIGJjYXN0U2lnOworCisgICAgLyp0byByZXBvcnQgTUFYIGxpbmstc3BlZWQgcG9wdWxhdGUgcmF0ZS1mbGFncyBmcm9tIEFTU09DIFJTUCBmcmFtZSovCisgICAgdEFOSV9VMzIgICAgICAgICAgIG1heFJhdGVGbGFnczsKKworICAgIHRBTklfVTggICAgICAgICBmcmFtZXNbIDEgXTsKK30gdFNpclNtZUpvaW5Sc3AsICp0cFNpclNtZUpvaW5Sc3A7CisKKy8vLyBEZWZpbml0aW9uIGZvciBBdXRoZW50aWNhdGlvbiBpbmRpY2F0aW9uIGZyb20gcGVlcgordHlwZWRlZiBzdH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RyICAgICAgICAgIHBlZXJNYWNBZGRyOworICAgIHRBTklfVTE2ICAgICAgICAgICAgIGFpZDsKKyAgICB0U2lyTWFjQWRkciAgICAgICAgICBhbHRlcm5hdGVCc3NJZDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICBhbHRlcm5hdGVDaGFubmVsSWQ7Cit9IHRTaXJTbWVBc3NvY0NuZiwgKnRwU2lyU21lQXNzb2NDbmY7CisKKy8vLyBEZWZpbml0aW9uIGZvciBSZWFzc29jaWF0aW9uIGluZGljYXRpb24gZnJvbSBwZWVyCit0eXBlZGVmIHN0cnVjdCBzU2lyU21lUmVhc3NvY0luZAoreworICAgIHRBTklfVTE2ICAgICAgICAgICAgbWVzc2FnZVR5cGU7IC8vIGVXTklfU01FX1JFQVNTT0NfSU5ECisgICAgdEFOSV9VMTYgICAgICAgICAgICBsZW5ndGg7CisgICAgdEFOSV9VOCAgICAgICAgICAgICBzZXNzaW9uSWQ7ICAgICAgICAgLy8gU2Vzc2lvbiBJRAorICAgIHRTaXJNYWNBZGRyICAgICAgICAgcGVlck1hY0FkZHI7CisgICAgdFNpck1hY0FkZHIgICAgICAgICBvbGRNYWNBZGRyOworICAgIHRBTklfVTE2ICAgICAgICAgICAgYWlkOworICAgIHRTaXJNYWNBZGRyICAgICAgICAgYnNzSWQ7ICAgICAgICAgICAvLyBTZWxmIEJTU0lECisgICAgdEFOSV9VMTYgICAgICAgICAgICBzdGFJZDsgICAgICAgICAgIC8vIFN0YXRpb24gSUQgZm9yIHBlZXIKKyAgICB0QW5pQXV0aFR5cGUgICAgICAgIGF1dGhUeXBlOworICAgIHRBbmlTU0lEICAgICAgICAgICAgc3NJZDsgICAvLyBTU0lEIHVzZWQgYnkgU1RBIHRvIHJlYXNzb2NpYXRlCisgICAgdFNpclJTTmllICAgICAgICAgICByc25JRTsgIC8vIFJTTiBJRSByZWNlaXZlZCBmcm9tIHBlZXIKKworICAgIHRTaXJBZGRpZSAgICAgICAgICAgYWRkSUU7ICAvL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gICAgICAgICAgICAgICAgICBsZW5ndGg7CisgICAgdFNpclJlc3VsdENvZGVzICAgICAgc3RhdHVzQ29kZTsKKyAgICB0U2lyTWFjQWRkciAgICAgICAgICBic3NJZDsgICAgICAgICAgICAgLy8gU2VsZiBCU1NJRAorICAgIHRTaXJNYWNBZGRyICAgICAgICAgIHBlZXJNYWNBZGRyOworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgICAgYWlkOworICAgIHRTaXJNYWNBZGRyICAgICAgICAgIGFsdGVybmF0ZUJzc0lkOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgYWx0ZXJuYXRlQ2hhbm5lbElkOworfSB0U2lyU21lUmVhc3NvY0NuZiwgKnRwU2lyU21lUmVhc3NvY0NuZjsKKworCisvLy8gRW51bSBkZWZpbml0aW9uIGZvciAgV2lyZWxlc3MgbWVkaXVtIHN0YXR1cyBjaGFuZ2UgY29kZXMKK3R5cGVkZWYgZW51bSBlU2lyU21lU3RhdHVzQ2hhbmdlQ29kZQoreworICAgIGVTSVJfU01FX0RFQVVUSF9GUk9NX1BFRVIsCisgICAgZVNJUl9TTUVfRElTQVNTT0NfRlJPTV9QRUVSLAorICAgIGVTSVJfU01FX0xPU1RfTElOS19XSVRIX1BFRVIsCisgICAgZVNJUl9TTUVfQ0hBTk5FTF9TV0lUQ0gsCisgICAgZVNJUl9TTUVfSk9JTkVEX05FV19CU1MsCisgICAgZVNJUl9TTUVfTEVBVklOR19CU1MsCisgICAgZVNJUl9TTUVfSUJTU19BQ1RJVkUsCisgICAgZVNJUl9TTUVfSUJTU19JTkFDVElWRSwKKyAgICBlU0lSX1NNRV9JQlNTX1BFRVJfREVQQVJURUQsCisgICAgZVNJUl9TTUVfUkFEQVJfREVURUNURUQsCisgICAgZVNJUl9TTUVfSUJTU19ORVdfUEVFUiwKKyAgICBlU0lSX1NNRV9BUF9DQVBTX0NIQU5HRUQsCisgICAgZVNJUl9TTUVfQkFDS0dST1VORF9TQ0FOX0ZBSUwsCisg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NRV9ERUFVVEhfRlJPTV9QRUVSICAgICAgICBSZWFzb24gY29kZSByZWNlaXZlZCBpbiBERUFVVEggZnJhbWUKKyAqIGVTSVJfU01FX0RJU0FTU09DX0ZST01fUEVFUiAgICAgIFJlYXNvbiBjb2RlIHJlY2VpdmVkIGluIERJU0FTU09DIGZyYW1lCisgKiBlU0lSX1NNRV9MT1NUX0xJTktfV0lUSF9QRUVSICAgICBOb25lCisgKiBlU0lSX1NNRV9DSEFOTkVMX1NXSVRDSCAgICAgICAgICBOZXcgY2hhbm5lbCBudW1iZXIKKyAqIGVTSVJfU01FX0pPSU5FRF9ORVdfQlNTICAgICAgICAgIEJTU0lELCBTU0lEIGFuZCBjaGFubmVsIG51bWJlcgorICogZVNJUl9TTUVfTEVBVklOR19CU1MgICAgICAgICAgICAgTm9uZQorICogZVNJUl9TTUVfSUJTU19BQ1RJVkUgICAgICAgICAgICAgSW5kaWNhdGVzIHRoYXQgYW5vdGhlciBTVEEgam9pbmVkCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJQlNTIGFwYXJ0IGZyb20gdGhpcyBTVEEgdGhhdAorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRlZCBJQlNTCisgKiBlU0lSX1NNRV9JQlNTX0lOQUNUSVZFICAgICAgICAgICBJbmRpY2F0ZXMgdGhhdCBvbmx5IHRoaXMgU1RBIGlzIGxlZnQKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluIElCU1MKKyAqIGVTSVJfU01FX1JBREFSX0RFVEVDVEVEICAgICAgICAgIEluZGljYXRlcyB0aGF0IHJhZGFyIGlzIGRldGVjdGVkCisgKiBlU0lSX1NNRV9JQlNTX05FV19QRUVSICAgICAgICAgICBJbmRpY2F0ZXMgdGhhdCBhIG5ldyBwZWVyIGlzIGRldGVjdGVkCisgKiBlU0lSX1NNRV9BUF9DQVBTX0NIQU5HRUQgICAgICAgICBJbmRpY2F0ZXMgdGhhdCBjYXBhYmlsaXRpZXMgb2YgdGhlIEFQCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGF0IFNUQSBpcyBjdXJyZW50bHkgYXNzb2NpYXRlZCB3aXRoCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYXZlIGNoYW5nZWQuCisgKiBlU0lSX1NNRV9CQUNLR1JPVU5EX1NDQU5fRkFJTCAgICBJbmRpY2F0ZXMgYmFja2dyb3VuZCBzY2FuIGZhaWx1cmUKKyAqLworCisvLy8gRGVmaW5pdGlvbiBmb3IgV2lyZWxlc3MgbWVkaXVtIHN0YXR1cyBjaGFuZ2Ugbm90aWZpY2F0aW9uCit0eXBlZGVmIHN0cnVjdCBzU2lyU21lV21TdGF0dXNDaGFuZ2VOdGYKK3sKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2VUeXBlOyAvLyBlV05JX1NNRV9XTV9TVEFUVVNfQ0hBTkdFX05URgorICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkOyAgICAgICAgIC8vIFNlc3Npb24gSUQKKyAgICB0U2lyU21lU3RhdHVzQ2hhbmdlQ29kZSBzdGF0dXNDaGFuZ2VDb2RlOworICAgIHRTaXJNYWNBZGRyICAgICAgICAgICAgIGJzc0lkOyAgICAgICAgICAgICAvLyBTZWxmIEJTU0lECisgICAgdW5pb24KKyAgICB7CisgICAgICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgICBkZUF1dGhSZWFzb25Db2RlOyAvLyBlU0lSX1NNRV9ERUFVVEhfRlJPTV9QRUVSCisgICAgICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgICBkaXNhc3NvY1JlYXNvbkNvZGU7IC8vIGVTSVJfU01FX0RJU0FTU09DX0ZST01fUEVFUgorICAgICAgICAvLyBub25lIGZvciBlU0lSX1NNRV9MT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E2ICAgICAgICAgICAgbWVzc2FnZVR5cGU7IC8vIGVXTklfU01FX0RJU0FTU09DX1JFUQorICAgIHRBTklfVTE2ICAgICAgICAgICAgbGVuZ3RoOworICAgIHRBTklfVTggICAgICAgICAgICAgc2Vzc2lvbklkOyAgICAgICAgIC8vIFNlc3Npb24gSUQKKyAgICB0QU5JX1UxNiAgICAgICAgICAgIHRyYW5zYWN0aW9uSWQ7ICAgICAvLyBUcmFuc2FjdGlvbiBJRCBmb3IgY21kCisgICAgdFNpck1hY0FkZHIgICAgICAgICBic3NJZDsgICAgICAgICAgICAgLy8gUGVlciBCU1NJRAorICAgIHRTaXJNYWNBZGRyIHBlZXJNYWNBZGRyOworICAgIHRBTklfVTE2ICAgICAgICAgcmVhc29uQ29kZTsKKyAgICB0QU5JX1U4ICAgICAgICAgIGRvTm90U2VuZE92ZXJUaGVBaXI7ICAvL1RoaXMgZmxhZyB0ZWxscyBMSU0gd2hldGhlciB0byBzZW5kIHRoZSBkaXNhc3NvYyBPVEEgb3Igbm90CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9UaGlzIHdpbGwgYmUgc2V0IGluIHdoaWxlIGhhbmRpbmcgb2ZmIGZyb20gb25lIEFQIHRvIG90aGVyCit9CitfX2FuaV9hdHRyX3BhY2tlZAordFNpclNtZURpc2Fzc29jUmVxLCAqdHBTaXJTbWVEaXNhc3NvY1JlcTsKKworLy8vIERlZmluaXRpb24gZm9yIFRraXAgY291bnRlcm1lYXN1cmVzIHJlcXVlc3QKK3R5cGVkZWYgX19hbmlfYXR0cl9wcmVfcGFja2VkIHN0cnVjdCBzU2lyU21lVGtpcENudHJNZWFzUmVxCit7CisgICAgdEFOSV9VMTYgICAgICAgICAgICBtZXNzYWdlVHlwZTsgICAgLy8gZVdOSV9TTUVfRElTQVNTT0NfUkVRCisgICAgdEFOSV9VMTYgICAgICAgICAgICBsZW5ndGg7CisgICAgdEFOSV9VOCAgICAgICAgICAgICBzZXNza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ICAgdFNpck1hY0FkZHIgICAgICAgICBic3NJZDsgICAgICAgICAgICAKKyAgICB0U2lyTWFjQWRkciAgICAgICAgIHBlZXJNYWNBZGRyOworICAgIHRBbmlTdGFTdGF0U3RydWN0ICBwZXJTdGFTdGF0czsgLy8gU1RBIHN0YXRzCisgICAgdEFOSV9VMTYgICAgICAgICAgICBzdGFJZDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgIHJlYXNvbkNvZGU7Cit9IHRTaXJTbWVEaXNhc3NvY0luZCwgKnRwU2lyU21lRGlzYXNzb2NJbmQ7CisKKy8vLyBEZWZpbml0aW9uIGZvciBEaXNhc3NvY2lhdGlvbiBjb25maXJtCisvLy8gTUFDIC0tLT4KK3R5cGVkZWYgc3RydWN0IHNTaXJTbWVEaXNhc3NvY0NuZgoreworICAgIHRBTklfVTE2ICAgICAgICAgICAgbWVzc2FnZVR5cGU7IC8vIGVXTklfU01FX0RJU0FTU09DX0NORgorICAgIHRBTklfVTE2ICAgICAgICAgICAgbGVuZ3RoOworICAgIHRTaXJSZXN1bHRDb2RlcyAgICAgc3RhdHVzQ29kZTsKKyAgICB0U2lyTWFjQWRkciAgICAgICAgIGJzc0lkOyAgICAgICAgICAgIAorICAgIHRTaXJNYWNBZGRyICAgICAgICAgcGVlck1hY0FkZHI7Cit9IHRTaXJTbWVEaXNhc3NvY0NuZiwgKnRwU2lyU21lRGlzYXNzb2NDbmY7CisKKy8vLyBEZWZpbml0aW9uIGZvciBEZWF1dGhldGljYXRpb24gcmVxdWVzdAordHlwZWRlZiBzdHJ1Y3Qgc1NpclNtZURlYXV0aFJlcQoreworICAgIHRBTklfVTE2ICAgICAgICAgICAgbWVzc2FnZVR5cGU7ICAgLy8gZVdOSV9TTUVfREVBVVRIX1JFUQorICAgIHRBTklfVTE2ICAgICAgICAgICAgbGVuZ3RoOworICAgIHRBTklfVTggICAgICAgICAgICAgc2Vzc2lvbklkOyAgICAgLy8gU2Vzc2lvbiBJRAorICAgIHRBTklfVTE2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Gg7CisgICAgdEFOSV9VOCAgICAgICAgICAgIHNlc3Npb25JZDsgICAgICAgLy9BZGRlZCBmb3IgQlQtQU1QCisgICAgdEFOSV9VMTYgICAgICAgICAgICB0cmFuc2FjdGlvbklkOyAgLy9BZGRlZCBmb3IgQlQtQU1QCisgICAgdFNpclJlc3VsdENvZGVzICAgICBzdGF0dXNDb2RlOworICAgIHRTaXJNYWNBZGRyICAgICAgICAgYnNzSWQ7Ly8gQVAgQlNTSUQKKyAgICB0U2lyTWFjQWRkciAgICAgICAgIHBlZXJNYWNBZGRyOworCisgICAgdEFOSV9VMTYgICAgICAgICAgICBzdGFJZDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgIHJlYXNvbkNvZGU7Cit9IHRTaXJTbWVEZWF1dGhJbmQsICp0cFNpclNtZURlYXV0aEluZDsKKworLy8vIERlZmluaXRpb24gZm9yIERlYXV0aGVudGljYXRpb24gY29uZmlybQorLy8vIE1BQyAtLS0+Cit0eXBlZGVmIHN0cnVjdCBzU2lyU21lRGVhdXRoQ25mCit7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgbWVzc2FnZVR5cGU7IC8vIGVXTklfU01FX0RFQVVUSF9DTkYKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgICBsZW5ndGg7CisgICAgdFNpclJlc3VsdENvZGVzICAgICBzdGF0dXNDb2RlOworICAgIHRTaXJNYWNBZGRyICAgICAgICAgYnNzSWQ7ICAgICAgICAgICAgIC8vIEFQIEJTU0lECisgICAgdFNpck1hY0FkZHIgICAgICAgIHBlZXJNYWNBZGRyOworfSB0U2lyU21lRGVhdXRoQ25mLCAqdHBTaXJTbWVEZWF1dGhDbmY7CisKKy8vLyBEZWZpbml0aW9uIGZvciBzdG9wIEJTUyByZXF1ZXN0IG1lc3NhZ2UKK3R5cGVkZWYgc3RydWN0IHNTaXJTbWVTdG9wQnNzUmVxCit7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgbWVzc2FnZVR5cGU7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2ICAgICAgICAgICB0cmFuc2FjdGlvbklkOyAvL1RyYW5zYWN0aW9uIElEIGZvciBjbWQKKyAgICB0U2lyTWFjQWRkciAgICAgICAgcGVlck1hY0FkZHI7CisgICAgdFNpck1hY0FkZHIgICAgICAgIGJzc0lkOyAgICAgIC8vIEJTU0lECisgICAgLy8gVEJEIEZvbGxvd2luZyBRT1MgZmllbGRzIHRvIGJlIHVuY29tbWVudGVkCisgICAgLy90QW5pQm9vbCAgICAgICAgICAgcW9zSW5mb1ByZXNlbnQ7CisgICAgLy90U2lyUW9zICAgICAgICAgICAgcW9zOworICAgIHRTaXJLZXlNYXRlcmlhbCAgICBrZXlNYXRlcmlhbDsKK30gdFNpclNtZVNldENvbnRleHRSZXEsICp0cFNpclNtZVNldENvbnRleHRSZXE7CisKKy8vLyBEZWZpbml0aW9uIGZvciBTZXQgQ29udGV4dCByZXNwb25zZQorLy8vIE1BQyAtLS0+Cit0eXBlZGVmIHN0cnVjdCBzU2lyU21lU2V0Q29udGV4dFJzcAoreworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgIG1lc3NhZ2VUeXBlOyAvLyBlV05JX1NNRV9TRVRfQ09OVEVYVF9SU1AKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgICBsZW5ndGg7CisgICAgdEFOSV9VOCAgICAgICAgICAgICBzZXNzaW9uSWQ7ICAgICAgICAgLy8gU2Vzc2lvbiBJRAorICAgIHRBTklfVTE2ICAgICAgICAgICAgdHJhbnNhY3Rpb25JZDsgICAgIC8vIFRyYW5zYWN0aW9uIElEIGZvciBjbWQKKyAgICB0U2lyUmVzdWx0Q29kZXMgICAgIHN0YXR1c0NvZGU7CisgICAgdFNpck1hY0FkZHIgICAgICAgICAgICAgcGVlck1hY0FkZHI7Cit9IHRTaXJTbWVTZXRDb250ZXh0UnNwLCAqdHBTaXJTbWVTZXRDb250ZXh0UnNwOworCisvLy8gRGVmaW5pdGlvbiBmb3IgUmVtb3ZlIEtleSBDb250ZXh0IHJlcXVlc3QKKy8vLyAtLS0+IE1BQwordHlwZWRlZiBzdHJ1Y3Qgc1NpclNtZVJlbW92ZUtleVJlcQoreworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgIG1lc3NhZ2VUeXBlOyAgICAvLyBlV05JX1NNRV9SRU1PVkVfS0VZX1JFUQorICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgIGxlbmd0aDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgIHNlc3Npb25JZDsgICAgICAgICAvLyBTZXNzaW9uIElECisgICAgdEFOSV9VMTYgICAgICAgICAgICB0cmFuc2FjdGlvbklkOyAgICAgLy8gVHJhbnNhY3Rpb24gSUQgZm9yIGNtZAorICAgIHRTaXJNYWNBZGRyICAgICAgICAgYnNzSWQ7ICAgICAgICAgICAgIC8vIEJTU0lECisgICAgdFNpck1hY0FkZHIgICAgICAgICAgICAgcGVlck1hY0FkZHI7CisgICAgdEFOSV9VOCAgICBlZFR5cGU7CisgICAgdEFOSV9VOCAgICB3ZXBUeXBlOworICAgIHRBTklfVTggICAga2V5SWQ7CisgICAgdEFOSV9CT09MRUFOIHVuaWNhc3Q7Cit9IHRTaXJTbWVSZW1vdmVLZXlSZXEsICp0cFNpclNtZVJlbW92ZUtleVJlcTsKKworLy8vIERlZmluaXRpb24gZm9yIFJlbW92ZSBLZXkgQ29udGV4dCByZXNwb25zZQorLy8vIE1BQyAtLS0+Cit0eXBlZGVmIHN0cnVjdCBzU2lyU21lUmVtb3ZlS2V5UnNwCit7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgbWVzc2FnZVR5cGU7IC8vIGVXTklfU01FX1JFTU9WRV9LRVlfUlNQCisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgbGVuZ3RoOworICAgIHRBTklfVTggICAgICAgICAgICAgc2Vzc2lvbklkOyAgICAgICAgIC8vIFNlc3Npb24gSUQKKyAgICB0QU5JX1UxNiAgICAgICAgICAgIHRyYW5zYWN0aW9uSWQ7ICAgICAvL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0LCBpbmNsdWRlcyB0aGUgcFN0YXRzQnVmIGxlbmd0aCB0b28KKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkOworICAgIHRBTklfVTMyICAgICAgICAgICAgICAgIHJjOyAgICAgICAgIC8vc3VjY2Vzcy9mYWlsdXJlCisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgc3RhSWQ7ICAvLyBQZXIgU1RBIHN0YXRzIHJlcXVlc3QgbXVzdCBjb250YWluIHZhbGlkCisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgc3RhdHNNYXNrOyAgLy8gY2F0ZWdvcmllcyBvZiBzdGF0cyByZXF1ZXN0ZWQuIGxvb2sgYXQgZVBFU3RhdHNNYXNrCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgIC8vdm9pZCAgICAgICAgICAgICAgICAgICpwU3RhdHNCdWY7CisgICAgVGhlIFN0YXRzIGJ1ZmZlciBzdGFydHMgaGVyZSBhbmQgY2FuIGJlIGFuIGFnZ3JlZ2F0ZSBvZiBtb3JlIHRoYW4gb25lIHN0YXRpc3RpY3MgCisgICAgc3RydWN0dXJlIGRlcGVuZGluZyBvbiBzdGF0c01hc2suVGhlIHZvaWQgcG9pbnRlciAicFN0YXRzQnVmIiBpcyBjb21tZW50ZWQgb3V0IAorICAgIGludGVudGlvbmFsbHkgYW5kIHRoZSBzcmMgY29kZSB0aGF0IHVzZXMgdGhpcyBzdHJ1Y3R1cmUgc2hvdWxkIHRha2UgdGhhdCBpbnRvIGFjY291bnQuIAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCit9IHRBbmlHZXRQRVN0YXRzUnNwLCAqdHBBbmlHZXRQRVN0YXRzUnNwOworCit0eXBlZGVmIHN0cnVjdCBzQW5pR2V0UnNzaVJlcQoreworICAgIC8vIENvbW1vbiBmb3IgYWxsIHR5cGVzIGFyZSByZXF1ZXN0cworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgIG1zZ1R5cGU7ICAgIC8vIG1lc3NhZ2UgdHlwZSBpcyBzYW1lIGFzIHRoZSByZXF1ZXN0IHR5cGUKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgICBtc2dMZW47ICAvLyBsZW5ndGggb2YgdGhlIGVudGlyZSByZXF1ZXN0CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgc2Vzc2lvbklkOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgIHN0YUlkOyAgCisgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgKnJzc2lDYWxsYmFjazsKKyAgICB2b2lkICAgICAgICAgICAgICAgICAgICAqcERldkNvbnRleHQ7IC8vZGV2aWNlIGNvbnRleHQKKyAgICB2b2lkICAgICAgICAgICAgICAgICAgICAqcFZvc0NvbnRleHQ7IC8vdm9zcyBjb250ZXh0CisgICAgCit9IHRBbmlHZXRSc3NpUmVxLCAqdHBBbmlHZXRSc3NpUmVxOworCit0eXBlZGVmIHN0cnVjdCBzQW5pR2V0U25yUmVxCit7CisgICAgLy8gQ29tbW9uIGZvciBhbGwgdHlwZXMgYXJlIHJlcXVlc3RzCisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgbXNnVHlwZTsgICAgLy8gbWVzc2FnZSB0eXBlIGlzIHNhbWUgYXMgdGhlIHJlcXVlc3QgdHlwZQorICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgIG1zZ0xlbjsgIC8vIGxlbmd0aCBvZiB0aGUgZW50aXJlIHJlcXVlc3QKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICBzZXNzaW9uSWQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgc3Rh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jb3VudGVyLgorICAgIHRBTklfVTMyIHR4X2J5dGVfY250OyAgICAgICAgICAvL1RoZSBzdW0gb2YgdGhlIHRyYW5zbWl0LWRpcmVjdGVkIGJ5dGUgY291bnQsIHRyYW5zbWl0LW11bHRpY2FzdCBieXRlIGNvdW50IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2FuZCB0cmFuc21pdC1icm9hZGNhc3QgYnl0ZSBjb3VudC4gSEFMIHdpbGwgc3VtIFRQRSBVQy9NQy9CQ0FTVCBnbG9iYWwgY291bnRlcnMgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdG8gcHJvdmlkZSB0aGlzLgorI2lmIDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgIC8vcHJvdmlkaW5nIHRoZSBmb2xsb3dpbmcgc3RhdHMsIGluIGNhc2Ugb2Ygd3JhcCBhcm91bmQgZm9yIHR4X2J5dGVfY250ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICB0QU5JX1UzMiB0eF91bmljYXN0X2xvd2VyX2J5dGVfY250OworICAgIHRBTklfVTMyIHR4X3VuaWNhc3RfdXBwZXJfYnl0ZV9jbnQ7CisgICAgdEFOSV9VMzIgdHhfbXVsdGljYXN0X2xvd2VyX2J5dGVfY250OworICAgIHRBTklfVTMyIHR4X211bHRpY2FzdF91cHBlcl9ieXRlX2NudDsKKyAgICB0QU5JX1UzMiB0eF9icm9hZGNhc3RfbG93ZXJfYnl0ZV9jbnQ7CisgICAgdEFOSV9VMzIgdHhfYnJvYWRjYXN0X3VwcGVyX2J5dGVfY250OworI2VuZGlmCisKK310QW5pU3VtbWFyeVN0YXRzSW5mbywgKnRwQW5pU3VtbWFyeVN0YXRzSW5mbzsKKwordHlwZWRlZiBlbnVtIGVUeFJhdGVJbmZvCit7CisgICBlSEFMX1RYX1JBVEVfTEVHQUNZID0gMHgxLCAgICAvKiBMZWdhY3kgcmF0ZXMgKi8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IHByZXZpb3VzIGRlbGltaXRlciBoYXMgYmVlbiAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZGVjb2RlZCBjb3JyZWN0bHkKKworfXRBbmlHbG9iYWxDbGFzc0NTdGF0c0luZm8sICp0cEFuaUdsb2JhbENsYXNzQ1N0YXRzSW5mbzsKKwordHlwZWRlZiBzdHJ1Y3Qgc0FuaVBlclN0YVN0YXRzSW5mbworeworICAgIHRBTklfVTMyIHR4X2ZyYWdfY250WzRdOyAgICAgICAvL1RoZSBudW1iZXIgb2YgTVBEVSBmcmFtZXMgdGhhdCB0aGUgODAyLjExIHN0YXRpb24gdHJhbnNtaXR0ZWQgYW5kIGFja25vd2xlZGdlZCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3Rocm91Z2ggYSByZWNlaXZlZCA4MDIuMTEgQUNLIGZyYW1lCisgICAgdEFOSV9VMzIgdHhfYW1wZHVfY250OyAgICAgICAgIC8vVGhpcyBjb3VudGVyIHNoYWxsIGJlIGluY3JlbWVudGVkIHdoZW4gYW4gQS1NUERVIGlzIHRyYW5zbWl0dGVkIAorICAgIHRBTklfVTMyIHR4X21wZHVfaW5fYW1wZHVfY250OyAvL1RoaXMgY291bnRlciBzaGFsbCBpbmNyZW1lbnQgYnkgdGhlIG51bWJlciBvZiBNUERVcyBpbiB0aGUgQU1QRFUgd2hlbiBhbiBBLU1QRFUgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9pcyB0cmFuc21pdHRlZAorCit9dEFuaVBlclN0YVN0YXRzSW5mbywgKnRwQW5pUGVyU3RhU3RhdHNJbmZvOworCisvKioqKioqKioqKioqKioqKioqKioqKlBFIFN0YXRpc3RpY3MgZW5kKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworCisKK3R5cGVkZWYgc3RydWN0IHNTaXJSU1NJVGhyZXNob2xkcworeworI2lmZGVmIEFOSV9CSUdfQllURV9FTkRJQU4KKyAgICB0QU5JX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mVzaG9sZHMsICp0cFNpclJTU0lUaHJlc2hvbGRzOworCit0eXBlZGVmIHN0cnVjdCBzU2lyUlNTSU5vdGlmaWNhdGlvbgoreworI2lmZGVmIEFOSV9CSUdfQllURV9FTkRJQU4KKyAgICB0QU5JX1UzMiAgICAgICAgICAgICBiUnNzaVRocmVzMVBvc0Nyb3NzIDogMTsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICBiUnNzaVRocmVzMU5lZ0Nyb3NzIDogMTsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICBiUnNzaVRocmVzMlBvc0Nyb3NzIDogMTsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICBiUnNzaVRocmVzMk5lZ0Nyb3NzIDogMTsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICBiUnNzaVRocmVzM1Bvc0Nyb3NzIDogMTsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICBiUnNzaVRocmVzM05lZ0Nyb3NzIDogMTsKKyAgICB2X1M3X3QgICAgICAgICAgICAgICBhdmdSc3NpICAgICAgICAgICAgIDogODsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICBiUmVzZXJ2ZWQgICAgICAgICAgIDogMTg7CisjZWxzZQorICAgIHRBTklfVTMyICAgICAgICAgICAgIGJSZXNlcnZlZCAgICAgICAgICAgOiAxODsKKyAgICB2X1M3X3QgICAgICAgICAgICAgICBhdmdSc3NpICAgICAgICAgICAgIDogODsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICBiUnNzaVRocmVzM05lZ0Nyb3NzIDogMTsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICBiUnNzaVRocmVzM1Bvc0Nyb3NzIDogMTsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICBiUnNzaVRocmVzMk5lZ0Nyb3NzIDogMTsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICBiUnNzaVRocmVzMlBvc0Nyb3NzIDogMTsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICBiUnNzaVRocmVzMU5lZ0Nyb3NzIDogMTsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICBiUnNzaVRocmVzMVBvc0Nyb3NzIDogMTsKKyNlbmRpZgorICAgIAorfXRTaXJSU1NJTm90aWZpY2F0aW9uLCAqdHBTaXJSU1NJTm90aWZpY2F0aW9uOworCisKK3R5cGVkZWYgc3RydWN0IHNTaXJQMlBOb2FTdGFydAoreworICAgdEFOSV9VMzIgICAgICBzdGF0dXM7CisgICB0QU5JX1UzMiAgICAgIGJzc0lkeDsKK30gdFNpclAyUE5vYVN0YXJ0LCAqdHBTaXJQMlBOb2FTdGFydDsKKwordHlwZWRlZiBzdHJ1Y3Qgc1NpclRkbHNJbmQKK3sKKyAgIHRBTklfVTE2ICAgICAgc3RhdHVzOworICAgdEFOSV9VMTYgICAgICBhc3NvY0lkOworICAgdEFOSV9VMTYgICAgICBzdGFJZHg7CisgICB0QU5JX1UxNiAgICAgIHJlYXNvbkNvZGU7Cit9IHRTaXJUZGxzSW5kLCAqdHBTaXJUZGxzSW5kOworCit0eXBlZGVmIHN0cnVjdCBzU2lyUDJQTm9hQXR0cgoreworI2lmZGVmIEFOSV9CSUdfQllURV9FTkRJQU4KKyAgIHRBTklfVTMyICAgICAgaW5kZXggOjg7CisgICB0QU5JX1UzMiAgICAgIG9wcFBzRmxhZyA6MTsKKyAgIHRBTklfVTMyICAgICAgY3RXaW4gICAgIDo3OworICAgdEFOSV9VMzIgICAgICByc3ZkMTogMTY7CisjZWxzZQorICAgdEFOSV9VMzIgICAgICByc3ZkMTogMTY7CisgICB0QU5JX1UzMiAgICAgIGN0V2luICAgICA6NzsKKyAgIHRBTklfVTMyICAgICAgb3BwUHNGbGFnIDoxOworICAgdEFOSV9VMzIgICAgICBpbmRleCA6ODsKKyNlbmRpZgorCisjaWZkZWYgQU5JX0JJR19CWVRFX0VORElBTgorICAgdEFOSV9VMzIgICAgICAgdU5vYTFJbnRlcnZhbENudDo4OworICAgdEFOSV9VMzIgICAgIC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gICAgICAgIHRTaXJNYWNUY2xhc1BhcmFtODAyMWRxICAgdDgwMjFkcTsKKyAgICB9X19hbmlfYXR0cl9wYWNrZWQgdGNsYXNQYXJhbXM7Cit9IF9fYW5pX2F0dHJfcGFja2VkIHRTaXJUY2xhc0luZm87CisKKworI2lmIGRlZmluZWQoRkVBVFVSRV9XTEFOX0VTRSkgfHwgZGVmaW5lZChGRUFUVVJFX1dMQU5fRVNFX1VQTE9BRCkKKyNkZWZpbmUgVFNSU18xMUFHX1JBVEVfNk1CUFMgICAweEMKKyNkZWZpbmUgVFNSU18xMUJfUkFURV81XzVNQlBTICAweEIKKwordHlwZWRlZiBzdHJ1Y3Qgc1Npck1hY0VTRVRTUlNJRQoreworICAgIHRBTklfVTggICAgICB0c2lkOworICAgIHRBTklfVTggICAgICByYXRlc1s4XTsKK30gdFNpck1hY0VTRVRTUlNJRTsKKwordHlwZWRlZiBzdHJ1Y3Qgc1Npck1hY0VTRVRTTUlFCit7CisgICAgdEFOSV9VOCAgICAgIHRzaWQ7CisgICAgdEFOSV9VOCAgICAgIHN0YXRlOworICAgIHRBTklfVTE2ICAgICBtc210X2ludGVydmFsOworfSB0U2lyTWFjRVNFVFNNSUU7CisKK3R5cGVkZWYgc3RydWN0IHNUU01TdGF0cworeworICAgIHRBTklfVTggICAgICAgICAgIHRpZDsKKyAgICB0U2lyTWFjQWRkciAgICAgICBic3NJZDsKKyAgICB0VHJhZlN0cm1NZXRyaWNzICB0c21NZXRyaWNzOworfSB0VFNNU3RhdHMsICp0cFRTTVN0YXRzOworCit0eXBlZGVmIHN0cnVjdCBzRXNlVFNNQ29udGV4dAoreworICAgdEFOSV9VOCAgICAgICAgICAgdGlkOworICAgdFNpck1hY0VTRVRTTUlFICAgdHNtSW5mbzsKKyAgIHRUcmFmU3RybU1ldHJpY3MgIHRzbU1ldHJpY3M7Cit9IHRFc2VUU01Db250ZXh0LCAqdHBFc2VUU01Db250ZXh0OworCit0eXBlZGVmIHN0cnVjdCBzRXNl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wU2lyQWRkdHNSZXFJbmZvOworCit0eXBlZGVmIHN0cnVjdCBzU2lyQWRkdHNSc3BJbmZvCit7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgZGlhbG9nVG9rZW47CisgICAgdFNpck1hY1N0YXR1c0NvZGVzIHN0YXR1czsKKyAgICB0U2lyTWFjVHNEZWxheUlFICAgZGVsYXk7CisKKyAgICB0U2lyTWFjVHNwZWNJRSAgICAgdHNwZWM7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgbnVtVGNsYXM7IC8vIG51bWJlciBvZiBUY2xhcyBlbGVtZW50cworICAgIHRTaXJUY2xhc0luZm8gICAgICB0Y2xhc0luZm9bU0lSX01BQ19UQ0xBU0lFX01BWE5VTV07CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgdGNsYXNQcm9jOworICAgIHRTaXJNYWNTY2hlZHVsZUlFICBzY2hlZHVsZTsKKyNpZiBkZWZpbmVkKEZFQVRVUkVfV0xBTl9FU0UpIHx8IGRlZmluZWQoRkVBVFVSRV9XTEFOX0VTRV9VUExPQUQpCisgICAgdFNpck1hY0VTRVRTTUlFICAgIHRzbUlFOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgIHRzbVByZXNlbnQ6MTsKKyNlbmRpZgorICAgIHRBTklfVTggICAgICAgICAgICAgICAgIHdtZVRzcGVjUHJlc2VudDoxOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgIHdzbVRzcGVjUHJlc2VudDoxOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgIGxsZVRzcGVjUHJlc2VudDoxOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgIHRjbGFzUHJvY1ByZXNlbnQ6MTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICBzY2hlZHVsZVByZXNlbnQ6MTsKK30gdFNpckFkZHRzUnNwSW5mbywgKnRwU2lyQWRkdHNSc3BJbmZvOworCit0eXBlZGVmIHN0cnVjdCBzU2lyRGVsdHNSZXFJbmZvCit7CisgICAgdFNpck1hY1RTSW5mbyAgICAgIHRzaW5mbzsKKyAgICB0U2lyTWFjVHNwZWNJRSAgICAgdHNwZWM7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgd21lVHNwZWNQcmVzZW50OjE7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgd3NtVHNwZWNQcmVzZW50OjE7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgbGxlVHNwZWNQcmVzZW50OjE7Cit9IHRTaXJEZWx0c1JlcUluZm8sICp0cFNpckRlbHRzUmVxSW5mbzsKKworLy8vIEFkZCBhIHRzcGVjIGFzIGRlZmluZWQKK3R5cGVkZWYgc3RydWN0IHNTaXJBZGR0c1JlcQoreworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgIG1lc3NhZ2VUeXBlOyAvLyBlV05JX1NNRV9BRERUU19SRVEKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgICBsZW5ndGg7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgc2Vzc2lvbklkOyAgLy9TZXNzaW9uIElECisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgdHJhbnNhY3Rpb25JZDsKKyAgICB0U2lyTWFjQWRkciAgICAgICAgICAgICBic3NJZDsgICAgICAvL0JTU0lECisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgdGltZW91dDsgLy8gaW4gbXMKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICByc3BSZXFkOworICAgIHRTaXJBZGR0c1JlcUluZm8gICAgICAgIHJlcTsKK30gdFNpckFkZHRzUmVxLCAqdHBTaXJBZGR0c1JlcTsKKwordHlwZWRlZiBzdHJ1Y3Qgc1NpckFkZHRzUnNwCit7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgbWVzc2FnZVR5cGU7IC8vIGVXTklfU01FX0FERFRTX1JTUAorICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgIGxlbmd0aDsKKyAgICB0QU5JX1U4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nRwU2lyQWdnclFvc1JlcUluZm87CisKK3R5cGVkZWYgc3RydWN0IHNTaXJBZ2dyUW9zUmVxCit7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgbWVzc2FnZVR5cGU7IC8vIGVXTklfU01FX0FERFRTX1JFUQorICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgIGxlbmd0aDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICBzZXNzaW9uSWQ7ICAvL1Nlc3Npb24gSUQKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgICB0cmFuc2FjdGlvbklkOworICAgIHRTaXJNYWNBZGRyICAgICAgICAgICAgIGJzc0lkOyAgICAgIC8vQlNTSUQKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICB0aW1lb3V0OyAvLyBpbiBtcworICAgIHRBTklfVTggICAgICAgICAgICAgICAgIHJzcFJlcWQ7CisgICAgdFNpckFnZ3JRb3NSZXFJbmZvICAgICAgYWdnckluZm87Cit9dFNpckFnZ3JRb3NSZXEsICp0cFNpckFnZ3JRb3NSZXE7CisKK3R5cGVkZWYgc3RydWN0IHNTaXJBZ2dyUW9zUnNwSW5mbworeworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgIHRzcGVjSWR4OworICAgIHRTaXJBZGR0c1JzcEluZm8gICAgICAgIGFnZ3JSc3BbU0lSX1FPU19OVU1fQUNfTUFYXTsKK30gdFNpckFnZ3JRb3NSc3BJbmZvLCAqdHBTaXJBZ2dyUW9zUnNwSW5mbzsKKwordHlwZWRlZiBzdHJ1Y3Qgc1NpckFnZ3JRb3NSc3AKK3sKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgICBtZXNzYWdlVHlwZTsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgICBsZW5ndGg7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgc2Vzc2lvbklkOworICAgIHRTaXJBZ2dyUW9zUnNwSW5mbyAgICAgIGFnZ3JJbmZvOworfSB0U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maW5lIExGUl9TRU5TSVRJVklUWV9USFJfNV81TUJQUyAgICAgICAgICAgLTg2CisjZGVmaW5lIExGUl9MT09LVVBfVEhSXzVfNU1CUFMgICAgICAgICAgICAgICAgLTc3CisjZGVmaW5lIExGUl9TRU5TSVRJVklUWV9USFJfMTFNQlBTICAgICAgICAgICAgLTg1CisjZGVmaW5lIExGUl9MT09LVVBfVEhSXzExTUJQUyAgICAgICAgICAgICAgICAgLTc2CisjZGVmaW5lIExGUl9TRU5TSVRJVklUWV9USFJfNk1CUFNfMkcgICAgICAgICAgLTgzCisjZGVmaW5lIExGUl9MT09LVVBfVEhSXzZNQlBTXzJHICAgICAgICAgICAgICAgLTc4CisjZGVmaW5lIExGUl9TRU5TSVRJVklUWV9USFJfNk1CUFNfNUcgICAgICAgICAgLTgzCisjZGVmaW5lIExGUl9MT09LVVBfVEhSXzZNQlBTXzVHICAgICAgICAgICAgICAgLTc4CisjZGVmaW5lIExGUl9TRU5TSVRJVklUWV9USFJfMTJNQlBTXzJHICAgICAgICAgLTgzCisjZGVmaW5lIExGUl9MT09LVVBfVEhSXzEyTUJQU18yRyAgICAgICAgICAgICAgLTc4CisjZGVmaW5lIExGUl9TRU5TSVRJVklUWV9USFJfMTJNQlBTXzVHICAgICAgICAgLTgxCisjZGVmaW5lIExGUl9MT09LVVBfVEhSXzEyTUJQU181RyAgICAgICAgICAgICAgLTc2CisjZGVmaW5lIExGUl9TRU5TSVRJVklUWV9USFJfMjRNQlBTXzJHICAgICAgICAgLTgxCisjZGVmaW5lIExGUl9MT09LVVBfVEhSXzI0TUJQU18yRyAgICAgICAgICAgICAgLTc2CisjZGVmaW5lIExGUl9TRU5TSVRJVklUWV9USFJfMjRNQlBTXzVHICAgICAgICAgLTc5CisjZGVmaW5lIExGUl9MT09LVVBfVEhSXzI0TUJQU181RyAgICAgICAgICAgICAgLTc0CisjZGVmaW5lIExGUl9TRU5TSVRJVklUWV9USFJfREVGQVVMVCAgICAgICAgICAgICAwCisjZGVma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0luaXRDYkNvbnRleHQsIFZPU19TVEFUVVMgc3RhdHVzKTsKK3R5cGVkZWYgdm9pZCAoICp0R2V0RnJhbWVMb2dDYWxsYmFjaykgKHZvaWQgKnBDb250ZXh0KTsKKwordHlwZWRlZiBzdHJ1Y3Qgc0FuaUdldEZyYW1lTG9nUmVxCit7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICBtc2dUeXBlOworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgbXNnTGVuOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgZ2V0RnJhbWVMb2dDbWRGbGFnOworfSB0QW5pR2V0RnJhbWVMb2dSZXEsICAgICAgKnRwQW5pR2V0RnJhbWVMb2dSZXE7CisKKy8qKgorICogc3RydWN0IHNfYW5pX3NldF90eF9tYXhfcHdyIC0gUmVxIHBhcmFtcyB0byBzZXQgbWF4IHR4IHBvd2VyCisgKiBAYnNzaWQ6IGJzc2lkIHRvIHNldCB0aGUgcG93ZXIgY2FwIGZvcgorICogQHNlbGZfbWFjX2FkZHI6c2VsZiBtYWMgYWRkcmVzcworICogQHBvd2VyOiBwb3dlciB0byBzZXQgaW4gZEIKKyAqLworc3RydWN0IHNfYW5pX3NldF90eF9tYXhfcHdyCit7CisgICAgdFNpck1hY0FkZHIgICBic3NpZDsKKyAgICB0U2lyTWFjQWRkciAgIHNlbGZfc3RhX21hY19hZGRyOworICAgIHRQb3dlcmRCbSAgICAgcG93ZXI7Cit9OworCisKKwordHlwZWRlZiBzdHJ1Y3Qgc1NpckZXTG9nZ2luZ0luaXRQYXJhbQoreworICAgIHRBTklfVTggICAgICAgICAgICAgICAgZW5hYmxlRmxhZzsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgIGZyYW1lVHlwZTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgIGZyYW1lU2l6ZTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgIGJ1ZmZlck1vZGU7CisgICAgdEFOSV9VOCAgICAgICAgICAgIC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klfVTggICAgICAgICAgICAgc2Vzc2lvbklkOyAgICAgLy8gU2Vzc2lvbiBJRAorICAgIHRBTklfVTE2ICAgICAgICAgICAgdHJhbnNhY3Rpb25JZDsgLy8gVHJhbnNhY3Rpb24gSUQgZm9yIGNtZAorICAgIHRTaXJNYWNBZGRyICAgICAgICAgYnNzaWQ7ICAgICAgICAgLy8gRm9yIG11bHRpLXNlc3Npb24sIGZvciBQRSB0byBsb2NhdGUgcGVTZXNzaW9uIElECisgICAgZVRkbHNBZGRPcGVyICAgICAgICB0ZGxzQWRkT3BlcjsKKyAgICB0U2lyTWFjQWRkciAgICAgICAgIHBlZXJNYWM7CisgICAgdEFOSV9VMTYgICAgICAgICAgICBjYXBhYmlsaXR5OworICAgIHRBTklfVTggICAgICAgICAgICAgZXh0bl9jYXBhYmlsaXR5W1NJUl9NQUNfTUFYX0VYVE5fQ0FQXTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgIHN1cHBvcnRlZF9yYXRlc19sZW5ndGg7CisgICAgdEFOSV9VOCAgICAgICAgICAgICBzdXBwb3J0ZWRfcmF0ZXNbU0lSX01BQ19NQVhfU1VQUF9SQVRFU107CisgICAgdEFOSV9VOCAgICAgICAgICAgICBodGNhcF9wcmVzZW50OworICAgIHRTaXJIVENhcCAgICAgICAgICAgaHRDYXA7CisgICAgdEFOSV9VOCAgICAgICAgICAgICB2aHRjYXBfcHJlc2VudDsKKyAgICB0U2lyVkhUQ2FwICAgICAgICAgIHZodENhcDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgIHVhcHNkX3F1ZXVlczsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgIG1heF9zcDsKK30gdFNpclRkbHNBZGRTdGFSZXEsICp0cFNpclNtZVRkbHNBZGRTdGFSZXEgOworCisvKiBURExTIFJlc3BvbnNlIHN0cnVjdCBQRS0tPlNNRSAqLwordHlwZWRlZiBzdHJ1Y3Qgc1NpclRkbHNBZGRTdGFSc3AKK3sKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgIG1lc3NhZ2VUeXBlOworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgbGVuZ3RoOworICAgIHRTaXJSZXN1bHRDb2RlcyAgICAgICAgc3RhdHVzQ29kZTsKKyAgICB0U2lyTWFjQWRkciAgICAgICAgICAgIHBlZXJNYWM7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICBzZXNzaW9uSWQ7ICAgICAvLyBTZXNzaW9uIElECisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICBzdGFJZCA7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICBzdGFUeXBlIDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgIHVjYXN0U2lnOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgYmNhc3RTaWc7CisgICAgZVRkbHNBZGRPcGVyICAgICAgICAgICB0ZGxzQWRkT3BlcjsKK30gdFNpclRkbHNBZGRTdGFSc3AgOworCisvKiBURExTIFJlcXVlc3Qgc3RydWN0IFNNRS0tPlBFICovCit0eXBlZGVmIHN0cnVjdAoreworICAgIHRBTklfVTE2ICAgICAgICAgICAgbWVzc2FnZVR5cGU7ICAgLy8gZVdOSV9TTUVfVERMU19MSU5LX0VTVEFCTElTSF9SRVEKKyAgICB0QU5JX1UxNiAgICAgICAgICAgIGxlbmd0aDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgIHNlc3Npb25JZDsgICAgIC8vIFNlc3Npb24gSUQKKyAgICB0QU5JX1UxNiAgICAgICAgICAgIHRyYW5zYWN0aW9uSWQ7IC8vIFRyYW5zYWN0aW9uIElEIGZvciBjbWQKKyAgICB0QU5JX1U4ICAgICAgICAgICAgIHVhcHNkUXVldWVzOyAgIC8vIFBlZXIncyB1YXBzZCBRdWV1ZXMgSW5mb3JtYXRpb24KKyAgICB0QU5JX1U4ICAgICAgICAgICAgIG1heFNwOyAgICAgICAgIC8vIFBlZXIncyBTdXBwb3J0ZWQgTWF4aW11bSBTZXJ2aWNlIFBlcm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gbWVzc2FnZVR5cGU7CisgICB0QU5JX1UxNiAgICAgICAgICAgICAgIGxlbmd0aDsKKyAgIHRBTklfVTggICAgICAgICAgICAgICAgc2Vzc2lvbklkOyAgICAgLy8gU2Vzc2lvbiBJRAorICAgdFNpclJlc3VsdENvZGVzICAgICAgICBzdGF0dXNDb2RlOworICAgdFNpck1hY0FkZHIgICAgICAgICAgICBwZWVyTWFjOworICAgdEFOSV9VMTYgICAgICAgICAgICAgICBzdGFJZDsKK30gdFNpclRkbHNEZWxTdGFSc3AsICp0cFNpclRkbHNEZWxTdGFSc3A7CisvKiBURExTIERlbGV0ZSBJbmRpY2F0aW9uIHN0cnVjdCBQRS0tPlNNRSAqLwordHlwZWRlZiBzdHJ1Y3Qgc1NpclRkbHNEZWxTdGFJbmQKK3sKKyAgIHRBTklfVTE2ICAgICAgICAgICAgICAgbWVzc2FnZVR5cGU7CisgICB0QU5JX1UxNiAgICAgICAgICAgICAgIGxlbmd0aDsKKyAgIHRBTklfVTggICAgICAgICAgICAgICAgc2Vzc2lvbklkOyAgICAgLy8gU2Vzc2lvbiBJRAorICAgdFNpck1hY0FkZHIgICAgICAgICAgICBwZWVyTWFjOworICAgdEFOSV9VMTYgICAgICAgICAgICAgICBzdGFJZDsKKyAgIHRBTklfVTE2ICAgICAgICAgICAgICAgcmVhc29uQ29kZTsKK30gdFNpclRkbHNEZWxTdGFJbmQsICp0cFNpclRkbHNEZWxTdGFJbmQ7Cit0eXBlZGVmIHN0cnVjdCBzU2lyVGRsc0RlbEFsbFBlZXJJbmQKK3sKKyAgIHRBTklfVTE2ICAgICAgICAgICAgICAgbWVzc2FnZVR5cGU7CisgICB0QU5JX1UxNiAgICAgICAgICAgICAgIGxlbmd0aDsKKyAgIHRBTklfVTggICAgICAgICAgICAgICAgc2Vzc2lvbklkOyAgICAgLy8gU2Vzc2lvbiBJRAorfSB0U2lyVGRsc0RlbEFsbFBlZXJJbmQsICp0cFNpclRkbHNEZWxBbGxQZWVySW5kOwordHlw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NzaSAqLworICAgIHRBTklfVTggIHJmQmFuZDsgICAgICAgICAgICAgICAvKiBiYW5kIHRvIHNjYW4gOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIC0+Ym90aCBCYW5kLCAxLT4yLjRHaHogT25seQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmQgMi0+IDVHSHogT25seSAqLworICAgIHRBTklfVTMyIHJ0dDsgICAgICAgICAgICAgICAgICAvKiBzZXQgaWYgcmVxdWlyZWQgdG8gZG8gUlRUIGl0IGlzIG5vdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdXBwb3J0ZWQgaW4gY3VycmVudCB2ZXJzaW9uICovCit9IHRTaXJTZXRCYXRjaFNjYW5SZXEsICp0cFNpclNldEJhdGNoU2NhblJlcTsKKworCisvLyBTdG9wIGJhdGNoIHNjYW4gcmVxdWVzdCB0byBGVwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgICB0QU5JX1UzMiBwYXJhbTsKK30gdFNpclN0b3BCYXRjaFNjYW5JbmQsICp0cFNpclN0b3BCYXRjaFNjYW5JbmQ7CisKKy8vIFRyaWdnZXIgYmF0Y2ggc2NhbiByZXN1bHQgaW5kaWNhdGlvbiB0byBGVwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgICB0QU5JX1UzMiBwYXJhbTsKK30gdFNpclRyaWdnZXJCYXRjaFNjYW5SZXN1bHRJbmQsICp0cFNpclRyaWdnZXJCYXRjaFNjYW5SZXN1bHRJbmQ7CisKKy8vIEJhdGNoIHNjYW4gcmVzdWx0IGluZGljYXRpb24gZnJvbSBGVwordHlwZWRlZiBQQUNLRURfUFJFIHN0cnVjdCBQQUNLRURfUE9TVAoreworICAgIHRBTklfVTggICBic3NpZFs2XTsgICAgIC8qIEJTU0lEICovCisgICAgdEFOSV9VOCAgIHNzaWRbMzNdOyAgICAgLyogU1NJRCAqLworICAgIHRBTklfVTggICBjaDsgICAgICAgIC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5JX1UzMiAgICAgICAgICAgICAgICAgY2FwYWJpbGl0aWVzOworICAgIC8vIG51bGwgdGVybWluYXRlZCBTU0lECisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgIHNzaWRbMzNdOworICAgIC8vIGJzc2lkCisgICAgdFNpck1hY0FkZHIgICAgICAgICAgICAgIGJzc2lkOworICAgIC8vIGNvdW50cnkgc3RyaW5nIGFkdmVydGlzZWQgYnkgQVAKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgYXBDb3VudHJ5U3RyW1dOSV9DRkdfQ09VTlRSWV9DT0RFX0xFTl07CisgICAgLy8gY291bnRyeSBzdHJpbmcgZm9yIHRoaXMgYXNzb2NpYXRpb24KKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgY291bnRyeVN0cltXTklfQ0ZHX0NPVU5UUllfQ09ERV9MRU5dOworfSB0U2lyV2lmaUludGVyZmFjZUluZm8sICp0cFNpcldpZmlJbnRlcmZhY2VJbmZvOworCisvKiBjaGFubmVsIGluZm9ybWF0aW9uICovCit0eXBlZGVmIFBBQ0tFRF9QUkUgc3RydWN0IFBBQ0tFRF9QT1NUCit7CisgICAgLy8gY2hhbm5lbCB3aWR0aCAoMjAsIDQwLCA4MCwgODArODAsIDE2MCkKKyAgICB0U2lyV2lmaUNoYW5uZWxXaWR0aCAgICAgIHdpZHRoOworICAgIC8vIHByaW1hcnkgMjAgTUh6IGNoYW5uZWwKKyAgICB0U2lyV2lmaUNoYW5uZWwgICAgICAgICAgIGNlbnRlckZyZXE7CisgICAgLy8gY2VudGVyIGZyZXF1ZW5jeSAoTUh6KSBmaXJzdCBzZWdtZW50CisgICAgdFNpcldpZmlDaGFubmVsICAgICAgICAgICBjZW50ZXJGcmVxMDsKKyAgICAvLyBjZW50ZXIgZnJlcXVlbmN5IChNSHopIHNlY29uZCBzZWdtZW50CisgICAgdFNpcldpZmlDaGFubmVsICAgICAgICAgICBjZW50ZXJGcmVxMTsKK30gdFNpcldpZmlDaG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dHMgbnVtYmVyIGFjY3J1aW5nIG92ZXIgdGltZSkKKyAgICAgKi8KKyAgICB0QU5JX1UzMiAgICAgICAgb25UaW1lTmJkOworICAgIC8qIG1zZWNzIHRoZSByYWRpbyBpcyBhd2FrZSBkdWUgdG8gRVhUU2NhbgorICAgICAqICgzMiBiaXRzIG51bWJlciBhY2NydWluZyBvdmVyIHRpbWUpCisgICAgICovCisgICAgdEFOSV9VMzIgICAgICAgIG9uVGltZUVYVFNjYW47CisgICAgLyogbXNlY3MgdGhlIHJhZGlvIGlzIGF3YWtlIGR1ZSB0byByb2FtP3NjYW4KKyAgICAgKiAoMzIgYml0cyBudW1iZXIgYWNjcnVpbmcgb3ZlciB0aW1lKQorICAgICAqLworICAgIHRBTklfVTMyICAgICAgICBvblRpbWVSb2FtU2NhbjsKKyAgICAvKiBtc2VjcyB0aGUgcmFkaW8gaXMgYXdha2UgZHVlIHRvIFBOTyBzY2FuCisgICAgICogKDMyIGJpdHMgbnVtYmVyIGFjY3J1aW5nIG92ZXIgdGltZSkKKyAgICAgKi8KKyAgICB0QU5JX1UzMiAgICAgICAgb25UaW1lUG5vU2NhbjsKKyAgICAvKiBtc2VjcyB0aGUgcmFkaW8gaXMgYXdha2UgZHVlIHRvIEhTMi4wIHNjYW5zIGFuZCBHQVMgZXhjaGFuZ2UKKyAgICAgKiAoMzIgYml0cyBudW1iZXIgYWNjcnVpbmcgb3ZlciB0aW1lKQorICAgICAqLworICAgIHRBTklfVTMyICAgICAgICBvblRpbWVIczIwOworICAgIC8vIG51bWJlciBvZiBjaGFubmVscworICAgIHRBTklfVTMyICAgICAgICBudW1DaGFubmVsczsKKyAgICAvLyBjaGFubmVsIHN0YXRpc3RpY3MgdFNpcldpZmlDaGFubmVsU3RhdHMKKyAgICB0U2lyV2lmaUNoYW5uZWxTdGF0cyBjaGFubmVsc1sxXTsKK30gdFNpcldpZmlSYWRpb1N0YXQsICp0cFNpcldpZmlSYWRpb1N0YXQ7CisKKy8qIHBlciByYXR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U1VMVF9JTkQgKi8KKwordHlwZWRlZiBQQUNLRURfUFJFIHN0cnVjdCBQQUNLRURfUE9TVAoreworICAgIHRBTklfVTMyICAgICAgICAgICAgIHJlcXVlc3RJZDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICBudW1PZkFwczsgICAgIC8vIG51bWJlcnMgb2YgQVBzCisKKyAgICAvKgorICAgICAqIDAgZm9yIGxhc3QgZnJhZ21lbnQKKyAgICAgKiAxIHN0aWxsIG1vcmUgZnJhZ21lbnQocykgY29taW5nCisgICAgICovCisgICAgdEFOSV9CT09MRUFOICAgICAgICAgbW9yZURhdGE7CisgICAgdFNpcldpZmlTY2FuUmVzdWx0ICAgIGFwWzFdOworfSB0U2lyV2lmaVNjYW5SZXN1bHRFdmVudCwgKnRwU2lyV2lmaVNjYW5SZXN1bHRFdmVudDsKKwordHlwZWRlZiBQQUNLRURfUFJFIHN0cnVjdCBQQUNLRURfUE9TVAoreworICAgIHRBTklfVTggICAgICAgZWxlbUlkOyAgICAgICAvLyBFbGVtZW50IElkZW50aWZpZXIKKyAgICB0QU5JX1U4ICAgICAgIGllTGVuZ3RoOyAgICAgLy8gbGVuZ3RoIG9mIElFIGRhdGEKKyAgICB0QU5JX1U4ICAgICAgICpJRXM7ICAgICAgICAgLy8gSUVzCit9IHRTaXJJbmZvcm1hdGlvbkVsZW1lbnQsICp0cFNpckluZm9ybWF0aW9uRWxlbWVudDsKKworLyogUmVwb3J0ZWQgd2hlbiBlYWNoIHByb2JlIHJlc3BvbnNlIGlzIHJlY2VpdmVkLCBpZiByZXBvcnRFdmVudHMKKyogIGVuYWJsZWQgaW4gdFNpcldpZmlTY2FuQ21kUmVxUGFyYW1zICovCit0eXBlZGVmIHN0cnVjdAoreworICAgIHRBTklfVTMyICAgICAgICAgICAgICAgcmVxdWVzdElkOworCisgICAgLyoKKyAgICAgKiAwIGZvciBsYXN0IGZyYWdtZW50CisgICAgICogMSBzdGlsbCBtb3JlIGZyYWdtZW50KHMpIGNvb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BhcmFtczsKKwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgcmVxdWVzdElkOworICAgIHRBTklfVTggICAgICAgICAgICAgICBzZXNzaW9uSWQ7CisKKyAgICAvKiBudW1iZXIgb2Ygc2FtcGxlcyBmb3IgYXZlcmFnaW5nIFJTU0kgKi8KKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgcnNzaVNhbXBsZVNpemU7CisKKyAgICAvKiBudW1iZXIgb2YgbWlzc2VkIHNhbXBsZXMgdG8gY29uZmlybSBBUCBsb3NzICovCisgICAgdEFOSV9VMzIgICAgICAgICAgICAgIGxvc3RBcFNhbXBsZVNpemU7CisKKyAgICAvKiBudW1iZXIgb2YgQVBzIGJyZWFjaGluZyB0aHJlc2hvbGQgcmVxdWlyZWQgZm9yIGZpcm13YXJlCisgICAgICogdG8gZ2VuZXJhdGUgZXZlbnQKKyAgICAgKi8KKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgbWluQnJlYWNoaW5nOworCisgICAgdEFOSV9VMzIgICAgICAgICAgICAgIG51bUFwOworICAgIHRTaXJBUFRocmVzaG9sZFBhcmFtICBhcFtXTEFOX0VYVFNDQU5fTUFYX1NJR05JRklDQU5UX0NIQU5HRV9BUFNdOworfSB0U2lyRVhUU2NhblNldFNpZ25pZmljYW50Q2hhbmdlUmVxUGFyYW1zLAorICp0cFNpckVYVFNjYW5TZXRTaWduaWZpY2FudENoYW5nZVJlcVBhcmFtczsKKwordHlwZWRlZiBQQUNLRURfUFJFIHN0cnVjdCBQQUNLRURfUE9TVAoreworICAgIHRBTklfVTMyICAgICAgICByZXF1ZXN0SWQ7CisgICAgdEFOSV9VMzIgICAgICAgIHN0YXR1czsKK30gdFNpckVYVFNjYW5TZXRTaWduaWZpY2FudENoYW5nZVJzcFBhcmFtcywKKyAgKnRwU2lyRVhUU2NhblNldFNpZ25pZmljYW50Q2hhbmdlUnNwUGFyYW1zOworCisvKi0tLS0tLS0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AgICAgICAgKGRvdDExTW9kZSA9PSBXTklfQ0ZHX0RPVDExX01PREVfVEFVUlVTKSB8fCBcCisgICAgICAgICAgKGRvdDExTW9kZSA9PSBXTklfQ0ZHX0RPVDExX01PREVfMTFHKSB8fCBcCisgICAgICAgICAgKGRvdDExTW9kZSA9PSBXTklfQ0ZHX0RPVDExX01PREVfMTFOKSB8fCBcCisgICAgICAgICAgKGRvdDExTW9kZSA9PSBXTklfQ0ZHX0RPVDExX01PREVfQUxMKSkgPyBUUlVFOiBGQUxTRSkKKworCisgICAgICAgIC8qCisgICAgICAgICogV2hlbiBUYXVydXMgY2FwYWJpbGl0aWVzIGNhbiBiZSB0dXJuZWQgb24gYmFzZWQgb24gdGhlIAorICAgICAgICAqIFByb3ByaWV0YXJ5IEV4dGVuc2lvbnMgQ0ZHLCB0aGVuIHRoaXMgbWFjcm8gY2FuIGJlIHVzZWQuCisgICAgICAgICogSGVyZSBUYXVydXMgY2FwYWJpbGl0aWVzIGNhbiBiZSB0dXJuZWQgb24gZm9yIDExTi9Ob25seSBtb2RlIGFsc28uCisgICAgICAgICovCisjZGVmaW5lIElTX0RPVDExX01PREVfVEFVUlVTX0FMTE9XRUQoZG90MTFNb2RlKSBcCisgICAgICAgICgoKGRvdDExTW9kZSA9PSBXTklfQ0ZHX0RPVDExX01PREVfVEFVUlVTKSB8fCBcCisgICAgICAgICAgKGRvdDExTW9kZSA9PSBXTklfQ0ZHX0RPVDExX01PREVfMTFOKSB8fCBcCisgICAgICAgICAgKGRvdDExTW9kZSA9PSBXTklfQ0ZHX0RPVDExX01PREVfQUxMKSkgPyBUUlVFOiBGQUxTRSkKKworCisKKyNkZWZpbmUgSVNfRE9UMTFfTU9ERV9QT0xBUklTKGRvdDExTW9kZSkgICBJU19ET1QxMV9NT0RFX1BST1BSSUVUQVJZKGRvdDExTW9kZSkKKworI2RlZmluZSBJU19ET1QxMV9NT0RFXzExQihkb3QxMU1vZGUpICBcCisgICAgICAgICAgICAoKGRvdDExTW9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3I7CisKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICBwcm9wUmF0ZXNQcmVzZW50OjE7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgYXBOYW1lUHJlc2VudDoxOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgIGxvYWRCYWxhbmNlSW5mb1ByZXNlbnQ6MTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICB2ZXJzaW9uUHJlc2VudDoxOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgIGVkY2FQYXJhbVByZXNlbnQ6MTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICBjYXBhYmlsaXR5UHJlc2VudDoxOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgIHRpdGFuUHJlc2VudDoxOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgIHRhdXJ1c1ByZXNlbnQ6MTsgIAorICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgIHByb3BDaGFubmVsU3dpdGNoUHJlc2VudDoxOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgIHF1aWV0QnNzUHJlc2VudDoxOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgIHRyaWdnZXJTdGFTY2FuUHJlc2VudDoxOyAgICAgICAgICAgICAgICAKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICByc3ZkOjU7CisKKworICAgIHRTaXJNYWNQcm9wUmF0ZVNldCAgICBwcm9wUmF0ZXM7CisgICAgdEFuaUFwTmFtZSAgICAgICAgICAgIGFwTmFtZTsgICAgICAgICAgIC8vIHVzZWQgaW4gYmVhY29uL3Byb2JlIG9ubHkKKyAgICB0U2lyQWx0ZXJuYXRlUmFkaW9JbmZvICBhbHRlcm5hdGVSYWRpbzsgLy8gdXNlZCBpbiBhc3NvYyByZXNwb25zZSBvbmx5CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgIGNhcGFiaWxpdHk7ICAgICA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AgICAgICAgMgorI2RlZmluZSBTSVJfTUFDX1NQUlREX0NITkxTX0VJRCAgICAgICAgMzYKKyNkZWZpbmUgU0lSX01BQ19TUFJURF9DSE5MU19FSURfTUlOICAgICAgICAyCisjZGVmaW5lIFNJUl9NQUNfU1BSVERfQ0hOTFNfRUlEX01BWCAgICAgICAgMjU0CisjZGVmaW5lIFNJUl9NQUNfQ0hOTF9TV0lUQ0hfQU5OX0VJRCAgICAzNworI2RlZmluZSBTSVJfTUFDX0NITkxfU1dJVENIX0FOTl9FSURfTUlOICAgIDMKKyNkZWZpbmUgU0lSX01BQ19DSE5MX1NXSVRDSF9BTk5fRUlEX01BWCAgICAzCisjZGVmaW5lIFNJUl9NQUNfTUVBU19SRVFfRUlEICAgICAgICAgICAzOAorI2RlZmluZSBTSVJfTUFDX01FQVNfUkVRX0VJRF9NSU4gICAgICAgICAgIDMKKyNkZWZpbmUgU0lSX01BQ19NRUFTX1JFUV9FSURfTUFYICAgICAgICAgICAyNTUKKyNkZWZpbmUgU0lSX01BQ19NRUFTX1JQVF9FSUQgICAgICAgICAgIDM5CisjZGVmaW5lIFNJUl9NQUNfTUVBU19SUFRfRUlEX01JTiAgICAgICAgICAgMworI2RlZmluZSBTSVJfTUFDX01FQVNfUlBUX0VJRF9NQVggICAgICAgICAgIDI1NQorI2RlZmluZSBTSVJfTUFDX1FVSUVUX0VJRCAgICAgICAgICAgICAgNDAKKyNkZWZpbmUgU0lSX01BQ19RVUlFVF9FSURfTUlOICAgICAgICAgICAgICA2CisjZGVmaW5lIFNJUl9NQUNfUVVJRVRfRUlEX01BWCAgICAgICAgICAgICAgNgorI2RlZmluZSBTSVJfTUFDX0lCU1NfREZTX0VJRCAgICAgICAgICAgNDEKKyNkZWZpbmUgU0lSX01BQ19JQlNTX0RGU19FSURfTUlOICAgICAgICAgICA3CisjZGVmaW5lIFNJUl9NQUNfSUJTU19ERlNfRUlEX01BWCAgICAgICAgICAgMjU1CisjZGVmaW5lIFNJUl9NQUNfRV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LgorI2RlZmluZSBTSVJfTUFDX0NMRUFSX0NBUEFCSUxJVFkodTE2dmFsdWUsIGJpdG5hbWUpIFwKKyAgKCh1MTZ2YWx1ZSkgJj0gKH4oU0lSX01BQ19TRVRfIyNiaXRuYW1lKDApKSkpCisKKyNkZWZpbmUgSVNfV0VTX01PREVfRU5BQkxFRCh4KSBcCisgICAgICAgICAgICAgICAgICAgICgoeCktPnJvYW0uY29uZmlnUGFyYW0uaXNXRVNNb2RlRW5hYmxlZCkKKworI2RlZmluZSBCQV9SRUNJUElFTlQgICAgICAgMQorI2RlZmluZSBCQV9JTklUSUFUT1IgICAgICAgMgorI2RlZmluZSBCQV9CT1RIX0RJUkVDVElPTlMgMworCisvLy8gU3RhdHVzIENvZGUgKHByZXNlbnQgaW4gTWFuYWdlbWVudCByZXNwb25zZSBmcmFtZXMpIGVudW0KKwordHlwZWRlZiBlbnVtIGVTaXJNYWNTdGF0dXNDb2RlcworeworICAgIGVTSVJfTUFDX1NVQ0NFU1NfU1RBVFVTICAgICAgICAgICAgICAgICAgICAgICA9IDAsIC8vUmVzZXJ2ZWQKKyAgICBlU0lSX01BQ19VTlNQRUNfRkFJTFVSRV9TVEFUVVMgICAgICAgICAgICAgICAgPSAxLCAvL1Vuc3BlY2lmaWVkIHJlYXNvbgorICAgIC8vIDgwMi4xMSByZXNlcnZlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDItOQorICAgIC8qCisgICAgV01NIHN0YXR1cyBjb2RlcyhzdGFuZGFyZCAxLjEgdGFibGUgOSkKKyAgICAgIFRhYmxlIDkgQUREVFMgUmVzcG9uc2UgU3RhdHVzIENvZGVzCisgICAgICBWYWx1ZSBPcGVyYXRpb24KKyAgICAgIDAgQWRtaXNzaW9uIGFjY2VwdGVkCisgICAgICAxIEludmFsaWQgcGFyYW1ldGVycworICAgICAgMiBSZXNlcnZlZAorICAgICAgMyBSZWZ1c2VkCisgICAgICA0LTI1NSBSZXNlcnZlZAorICAgICovCisgICAgZVNJ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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vb3B0aW9uCisgICAgZVNJUl9NQUNfUEJDQ19OT1RfU1VQUE9SVEVEX1NUQVRVUyAgICAgICAgICAgID0gMjAsIC8vQXNzb2NpYXRpb24gZGVuaWVkIGR1ZSB0byByZXF1ZXN0aW5nIHN0YXRpb24gbm90IHN1cHBvcnRpbmcgdGhlIFBCQ0MgbW9kdWxhdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL29wdGlvbgorICAgIGVTSVJfTUFDX0NIQU5ORUxfQUdJTElUWV9OT1RfU1VQUE9SVEVEX1NUQVRVUyA9IDIxLCAvL0Fzc29jaWF0aW9uIGRlbmllZCBkdWUgdG8gcmVxdWVzdGluZyBzdGF0aW9uIG5vdCBzdXBwb3J0aW5nIHRoZSBDaGFubmVsIEFnaWxpdHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9vcHRpb24KKyAgICBlU0lSX01BQ19TUEVDVFJVTV9NR01UX1JFUURfU1RBVFVTICAgICAgICAgICAgPSAyMiwgLy9Bc3NvY2lhdGlvbiByZXF1ZXN0IHJlamVjdGVkIGJlY2F1c2UgU3BlY3RydW0gTWFuYWdlbWVudCBjYXBhYmlsaXR5IGlzIHJlcXVpcmVkCisgICAgZVNJUl9NQUNfUFdSX0NBUEFCSUxJVFlfQkFEX1NUQVRVUyAgICAgICAgICAgID0gMjMsIC8vQXNzb2NpYXRpb24gcmVxdWVzdCByZWplY3RlZCBiZWNhdXNlIHRoZSBpbmZvcm1hdGlvbiBpbiB0aGUgUG93ZXIgQ2FwYWJpbGl0eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2VsZW1lbnQgaXMgdW5hY2NlcHRhYmxlCisgICAgZVNJUl9NQUNfU1BSVERfQ0hBTk5FTFNfQkFEX1NUQVRVUyAgICAgICAgICAgID0gMjQsIC8vQXNzb2NpYXRpb24gcmVxdWVzdCByZWplY3RlZCBiZWNhdXNlIHRoZSBpbmZvcm1hdGlvbiBpbiB0aGUgU3VwcG9ydGVkIENoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZWxlbWVudCBpcyB1bmFjY2VwdGFibGUKKyAgICBlU0lSX01BQ19TSE9SVF9TTE9UX05PVF9TVVBPUlRFRF9TVEFUVVMgICAgICAgPSAyNSwgLy9Bc3NvY2lhdGlvbiBkZW5pZWQgZHVlIHRvIHJlcXVlc3Rpbmcgc3RhdGlvbiBub3Qgc3VwcG9ydGluZyB0aGUgU2hvcnQgU2xvdCBUaW1lCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vb3B0aW9uCisgICAgZVNJUl9NQUNfRFNTU19PRkRNX05PVF9TVVBQT1JURURfU1RBVFVTICAgICAgID0gMjYsIC8vQXNzb2NpYXRpb24gZGVuaWVkIGR1ZSB0byByZXF1ZXN0aW5nIHN0YXRpb24gbm90IHN1cHBvcnRpbmcgdGhlIERTU1MtT0ZETSBvcHRpb24KKyAgICAvLyByZXNlcnZlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNy0yOQorICAgIGVTSVJfTUFDX1RSWV9BR0FJTl9MQVRFUiAgICAgICAgICAgICAgICAgICAgICA9IDMwLCAvL0Fzc29jaWF0aW9uIHJlcXVlc3QgcmVqZWN0ZWQgdGVtcG9yYXJpbHksIHRyeSBhZ2FpbiBsYXRlcgorICAgIC8vIHJlc2VydmVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMxCisgICAgZVNJUl9NQUNfUU9TX1VOU1BFQ0lGSUVEX0ZBSUxVUkVfU1RBVFVTICAgICAgID0gMzIsIC8vVW5zcGVjaWZpZWQsIFFvUy1yZWxhdGVkIGZhaWx1cmUKKyAgICBlU0lSX01BQ19RQVBfTk9fQkFORFdJRFRIX1NUQVRVUyAgICAgICAgICAgICAgPSAzMywgLy9Bc3NvY2lhdGlvbiBkZW5pZWQgYmVjYXVzZSBRb1MgQVAgaGFzIGluc3VmZmljaWVudCBiYW5kd2lkdGggdG8gaGFuZGxlIGFub3RoZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9Rb1MgU1RBCisgICAgZVNJUl9NQUNfWFNfRlJBTUVfTE9TU19TVEFUVVMgICAgICAgICAgICAgICAgID0gMzQsIC8vQXNzb2NpYXRpb24gZGVuaWVkIGR1ZSB0byBleGNlc3NpdmUgZnJhbWUgbG9zcyByYXRlcyBhbmQvb3IgcG9vciBjb25kaXRpb25zIG9uIGN1ci0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9yZW50IG9wZXJhdGluZyBjaGFubmVsCisgICAgZVNJUl9NQUNfU1RBX1FPU19OT1RfU1VQUE9SVEVEX1NUQVRVUyAgICAgICAgID0gMzUsIC8vQXNzb2NpYXRpb24gKHdpdGggUW9TIEJTUykgZGVuaWVkIGJlY2F1c2UgdGhlIHJlcXVlc3RpbmcgU1RBIGRvZXMgbm90IHN1cHBvcnQgdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vUW9TIGZhY2lsaXR5CisgICAgZVNJUl9NQUNfU1RBX0JMS19BQ0tfTk9UX1NVUFBPUlRFRF9TVEFUVVMgICAgID0gMzYsIC8vUmVzZXJ2ZWQKKyAgICBlU0lSX01BQ19SRVFfREVDTElORURfU1RBVFVTICAgICAgICAgICAgICAgICAgPSAzNywgLy9UaGUgcmVxdWVzdCBoYXMgYmVlbiBkZWNsaW5lZAorICAgIGVTSVJfTUFDX0lOVkFMSURfUEFSQU1fU1RBVFVTICAgICA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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9zZXR1cCBpcyByZXF1aXJlZAorICAgIGVTSVJfTUFDX1BFRVJfVElNRURPVVRfUkVBU09OICAgICAgICAgICAgICAgICAgICA9IDM5LCAvL1JlcXVlc3RlZCBmcm9tIHBlZXIgU1RBIGR1ZSB0byB0aW1lb3V0CisgICAgZVNJUl9NQUNfQ0lQSEVSX05PVF9TVVBQT1JURURfUkVBU09OICAgICAgICAgICAgID0gNDUsICAvL1BlZXIgU1RBIGRvZXMgbm90IHN1cHBvcnQgdGhlIHJlcXVlc3RlZCBjaXBoZXIgc3VpdGUKKyAgICBlU0lSX01BQ19ESVNBU1NPQ19EVUVfVE9fRlRIQU5ET0ZGX1JFQVNPTiAgICAgICAgPSA0NiwgLy9GVCByZWFzb24KKyAgICAvL3Jlc2VydmVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0NyAtIDY1NTM1LgorICAgIGVTSVJfQkVBQ09OX01JU1NFRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IDY1NTM0LCAvL1dlIGludmVudGVkIHRoaXMgdG8gdGVsbCBiZWFjb24gbWlzc2VkIGNhc2UKK30gdFNpck1hY1JlYXNvbkNvZGVzOworCisKK3R5cGVkZWYgZW51bSBlU2lyTWFjQ2hhbm5lbFR5cGUKK3sKKyAgICBlU0lSX01BQ18xMUFfQkFORCwKKyAgICBlU0lSX01BQ18xMUJfQkFORCwKKyAgICBlU0lSX01BQ19VTktOT1dOX0JBTkQKK30gdFNpck1hY0NoYW5uZWxUeXBlOworCisvLyBCQSBJbml0aWF0b3Igdi9zIFJlY2lwaWVudAordHlwZWRlZiBlbnVtIGVCQURpcmVjdGlvbgoreworICBlQkFfUkVDSVBJRU5ULAorICBlQkFfSU5JVElBVE9SCit9IHRCQURpcmVjdGlvbjsKKworLy8gQS1NUERVL0JBIEVuYWJsZS9EaXNhYmxlIGluIFR4L1J4IGRpcmVjdGlvbgordH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ZGRyZXNzIE1BQyBkYXRhIGhlYWRlciBmb3JtYXQgKDMwLzMyIGJ5dGVzKQordHlwZWRlZiBfX2FuaV9hdHRyX3ByZV9wYWNrZWQgc3RydWN0IHNTaXJNYWNEYXRhSGRyNGEKK3sKKyAgICB0U2lyTWFjRnJhbWVDdGwgZmM7CisgICAgdEFOSV9VOCAgICAgICAgICAgZHVyYXRpb25MbzsKKyAgICB0QU5JX1U4ICAgICAgICAgICBkdXJhdGlvbkhpOworICAgIHRBTklfVTggICAgICAgICAgIGFkZHIxWzZdOworICAgIHRBTklfVTggICAgICAgICAgIGFkZHIyWzZdOworICAgIHRBTklfVTggICAgICAgICAgIGFkZHIzWzZdOworICAgIHRTaXJNYWNTZXFDdGwgICBzZXFDb250cm9sOworICAgIHRBTklfVTggICAgICAgICAgIGFkZHI0WzZdOworICAgIHRTaXJNYWNRb3NDdGwgICBxb3NDb250cm9sOworfSBfX2FuaV9hdHRyX3BhY2tlZCB0U2lyTWFjRGF0YUhkcjRhLCAqdHBTaXJNYWNEYXRhSGRyNGE7CisKKy8vLyBNYW5hZ2VtZW50IGhlYWRlciBmb3JtYXQKK3R5cGVkZWYgX19hbmlfYXR0cl9wcmVfcGFja2VkIHN0cnVjdCBzU2lyTWFjTWdtdEhkcgoreworICAgIHRTaXJNYWNGcmFtZUN0bCBmYzsKKyAgICB0QU5JX1U4ICAgICAgICAgICBkdXJhdGlvbkxvOworICAgIHRBTklfVTggICAgICAgICAgIGR1cmF0aW9uSGk7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgZGFbNl07CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgc2FbNl07CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgYnNzSWRbNl07CisgICAgdFNpck1hY1NlcUN0bCAgIHNlcUNvbnRyb2w7Cit9IF9fYW5pX2F0dHJfcGFja2VkIHRTaXJNYWNNZ210SGRyLCAqdHBTaXJNYWNNZ210SGRyOworCisvLy8gUFMtcG9sbCBoZWFkZXIgZm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sKKwordHlwZWRlZiBfX2FuaV9hdHRyX3ByZV9wYWNrZWQgc3RydWN0IHNTaXJNYWNSUk1FbmFibGVkQ2FwCit7CisjaWZuZGVmIEFOSV9MSVRUTEVfQklUX0VORElBTgorICAgIHRBTklfVTggICAgICAgICAgICAgICAgcmVzZXJ2ZWQ6IDY7CisgICAgdEFOSV9VOCAgICAgIEFudGVubmFJbmZvcm1hdGlvbjogMTsKKyAgICB0QU5JX1U4ICAgICAgIEJTU0F2YWlsQWRtaXNzaW9uOiAxOworICAgIHRBTklfVTggICAgICAgQnNzQXZnQWNjZXNzRGVsYXk6IDE7CisgICAgdEFOSV9VOCAgICAgICAgIFJTTklNZWFzdXJlbWVudDogMTsKKyAgICB0QU5JX1U4ICAgICAgICAgUkNQSU1lYXN1cmVtZW50OiAxOworICAgIHRBTklfVTggICAgICAgTmVpZ2hib3JUU0ZPZmZzZXQ6IDE7CisgICAgdEFOSV9VOCBNZWFzdXJlbWVudFBpbG90RW5hYmxlZDogMTsKKyAgICB0QU5JX1U4ICAgICAgICBNZWFzdXJlbWVudFBpbG90OiAzOworICAgIHRBTklfVTggICAgICBub25PcGVyYXRpbkNoYW5NYXg6IDM7CisgICAgdEFOSV9VOCAgICAgICAgb3BlcmF0aW5nQ2hhbk1heDogMzsKKyAgICB0QU5JX1U4ICAgICAgICAgICBSUk1NSUJFbmFibGVkOiAxOworICAgIHRBTklfVTggICAgICAgICAgICBBUENoYW5SZXBvcnQ6IDE7CisgICAgdEFOSV9VOCAgICAgICAgICAgIHRyaWdnZXJlZFRDTTogMTsKKyAgICB0QU5JX1U4ICAgICAgICAgICBUQ01DYXBhYmlsaXR5OiAxOworICAgIHRBTklfVTggICAgICAgICAgICAgIExDSUF6aW11dGg6IDE7CisgICAgdEFOSV9VOCAgICAgICAgICBMQ0lNZWFzdXJlbWVudDogMTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICBzdGF0aXN0aWNzOiAxOworICAgIHRBTklfVTggICAgICAgICAgTm9pc2VIaXN0b2dyYW06IDE7CisgICAgdEFOSV9VOCAgICAgICAgICAgICBDaGFubmVsTG9hZDogMTsKKyAgICB0QU5JX1U4ICAgICAgICBGcmFtZU1lYXN1cmVtZW50OiAxOworICAgIHRBTklfVTggICAgICAgICAgIEJlYWNvblJlcENvbmQ6IDE7CisgICAgdEFOSV9VOCAgICAgICAgICAgICBCZWFjb25UYWJsZTogMTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgQmVhY29uQWN0aXZlOiAxOworICAgIHRBTklfVTggICAgICAgICAgIEJlYWNvblBhc3NpdmU6IDE7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICByZXBlYXRlZDogMTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgIHBhcmFsbGVsOiAxOworICAgIHRBTklfVTggICAgICAgICAgICAgTmVpZ2hib3JScHQ6IDE7CisgICAgdEFOSV9VOCAgICAgICAgIExpbmtNZWFzdXJlbWVudDogMTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICBwcmVzZW50OworI2Vsc2UKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICBwcmVzZW50OworICAgIHRBTklfVTggICAgICAgICBMaW5rTWVhc3VyZW1lbnQ6IDE7CisgICAgdEFOSV9VOCAgICAgICAgICAgICBOZWlnaGJvclJwdDogMTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgIHBhcmFsbGVsOiAxOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgcmVwZWF0ZWQ6IDE7CisgICAgdEFOSV9VOCAgICAgICAgICAgQmVhY29uUGFzc2l2ZTogMTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgQmVhY29uQWN0aXZlOiAxOworICAgIHRBTklfVTggICAgICAgICAgICAgQmVhY29uVGFibGU6IDE7CisgICAgdEFOSV9VOCAgICAgICAgICAgQmVhY29uUmVwQ29uZDogMTsKKyAgICB0QU5JX1U4ICAgICAgICBGcmFtZU1lYXN1cmVtZW50OiAxOworICAgIHRBTklfVTggICAgICAgICAgICAgQ2hhbm5lbExvYWQ6IDE7CisgICAgdEFOSV9VOCAgICAgICAgICBOb2lzZUhpc3RvZ3JhbTogMTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICBzdGF0aXN0aWNzOiAxOworICAgIHRBTklfVTggICAgICAgICAgTENJTWVhc3VyZW1lbnQ6IDE7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgTENJQXppbXV0aDogMTsKKyAgICB0QU5JX1U4ICAgICAgICAgICBUQ01DYXBhYmlsaXR5OiAxOworICAgIHRBTklfVTggICAgICAgICAgICB0cmlnZ2VyZWRUQ006IDE7CisgICAgdEFOSV9VOCAgICAgICAgICAgIEFQQ2hhblJlcG9ydDogMTsKKyAgICB0QU5JX1U4ICAgICAgICAgICBSUk1NSUJFbmFibGVkOiAxOworICAgIHRBTklfVTggICAgICAgIG9wZXJhdGluZ0NoYW5NYXg6IDM7CisgICAgdEFOSV9VOCAgICAgIG5vbk9wZXJhdGluQ2hhbk1heDogMzsKKyAgICB0QU5JX1U4ICAgICAgICBNZWFzdXJlbWVudFBpbG90OiAzOworICAgIHRBTklfVTggTWVhc3VyZW1lbnRQaWxvdEVuYWJsZWQ6IDE7CisgICAgdEFOSV9VOCAgICAgICBOZWlnaGJvclRTRk9mZnNldDogMTsKKyAgICB0QU5JX1U4ICAgICAgICAgUkNQSU1lYXN1cmVtZW50OiAxOworICAgIHRBTklfVTggICAgICAgICBSU05JTWVhc3VyZW1lbnQ6IDE7CisgICAgdEFOSV9VOCAgICAgICBCc3NBdmdBY2Nlc3NEZWxheTogMTsKKyAgICB0QU5JX1U4ICAgICAgIEJTU0F2YWlsQWRtaXNzaW9uOiAxOworICAgIHRBTklfVTggICAgICBBbnRlbm5hSW5mb3JtYXRpb246IDE7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICByZXNlcnZlZDogNjsKKyNlbmRpZgorfSB0U2lyTWFjUlJNRW5hYmxlZENhcCwgKnRwU2lyTWF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fcGFja2VkIHRTaXJNYWNFZGNhUGFyYW1SZWNvcmQ7CisKK3R5cGVkZWYgX19hbmlfYXR0cl9wcmVfcGFja2VkIHN0cnVjdCBzU2lyTWFjUW9zSW5mbworeworI2lmbmRlZiBBTklfTElUVExFX0JJVF9FTkRJQU4KKyAgICB0QU5JX1U4ICB1YXBzZCAgIDogMTsKKyAgICB0QU5JX1U4ICB0eG9wcmVxIDogMTsKKyAgICB0QU5JX1U4ICBxcmVxICAgIDogMTsKKyAgICB0QU5JX1U4ICBxYWNrICAgIDogMTsKKyAgICB0QU5JX1U4ICBjb3VudCAgIDogNDsKKyNlbHNlCisgICAgdEFOSV9VOCAgY291bnQgICA6IDQ7CisgICAgdEFOSV9VOCAgcWFjayAgICA6IDE7CisgICAgdEFOSV9VOCAgcXJlcSAgICA6IDE7CisgICAgdEFOSV9VOCAgdHhvcHJlcSA6IDE7CisgICAgdEFOSV9VOCAgdWFwc2QgICA6IDE7CisjZW5kaWYKK30gX19hbmlfYXR0cl9wYWNrZWQgdFNpck1hY1Fvc0luZm87CisKKwordHlwZWRlZiBfX2FuaV9hdHRyX3ByZV9wYWNrZWQgc3RydWN0IHNTaXJNYWNRb3NJbmZvU3RhdGlvbgoreworI2lmZGVmIEFOSV9MSVRUTEVfQklUX0VORElBTgorICAgIHRBTklfVTggYWN2b191YXBzZDoxOworICAgIHRBTklfVTggYWN2aV91YXBzZDoxOworICAgIHRBTklfVTggYWNia191YXBzZDoxOworICAgIHRBTklfVTggYWNiZV91YXBzZDoxOworICAgIHRBTklfVTggcWFjazoxOworICAgIHRBTklfVTggbWF4U3BMZW46MjsKKyAgICB0QU5JX1U4IG1vcmVEYXRhQWNrOjE7CisjZWxzZQorICAgIHRBTklfVTggbW9yZURhdGFBY2s6MTsKKyAgICB0QU5JX1U4IG1heFNwTGVuOjI7CisgICAgdEFOSV9VOCBxYWNrOjE7CisgICAgdEFOSV9VOCBhY2JlX3VhcHNkOjE7CisgICAgdEFOSV9VOCBhY2JrX3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7CisjaWZuZGVmIEFOSV9MSVRUTEVfQklUX0VORElBTgorICAgIHRBTklfVTggICAgICAgIGJ1cnN0U2l6ZURlZm4gOiAxOworICAgIHRBTklfVTggICAgICAgIHJlc2VydmVkIDo3OworI2Vsc2UKKyAgICB0QU5JX1U4ICAgICAgICByZXNlcnZlZCA6NzsKKyAgICB0QU5JX1U4ICAgICAgICBidXJzdFNpemVEZWZuIDogMTsKKyNlbmRpZgorCisjaWZuZGVmIEFOSV9MSVRUTEVfQklUX0VORElBTgorICAgIHRBTklfVTE2ICAgICAgIGFja1BvbGljeSA6IDI7CisgICAgdEFOSV9VMTYgICAgICAgdXNlclByaW8gOiAzOworICAgIHRBTklfVTE2ICAgICAgIHBzYiA6IDE7CisgICAgdEFOSV9VMTYgICAgICAgYWdncmVnYXRpb24gOiAxOworICAgIHRBTklfVTE2ICAgICAgIGFjY2Vzc1BvbGljeSA6IDI7CisgICAgdEFOSV9VMTYgICAgICAgZGlyZWN0aW9uIDogMjsKKyAgICB0QU5JX1UxNiAgICAgICB0c2lkIDogNDsKKyAgICB0QU5JX1UxNiAgICAgICB0cmFmZmljVHlwZSA6IDE7CisjZWxzZQorICAgIHRBTklfVTE2ICAgICAgIHRyYWZmaWNUeXBlIDogMTsKKyAgICB0QU5JX1UxNiAgICAgICB0c2lkIDogNDsKKyAgICB0QU5JX1UxNiAgICAgICBkaXJlY3Rpb24gOiAyOworICAgIHRBTklfVTE2ICAgICAgIGFjY2Vzc1BvbGljeSA6IDI7CisgICAgdEFOSV9VMTYgICAgICAgYWdncmVnYXRpb24gOiAxOworICAgIHRBTklfVTE2ICAgICAgIHBzYiA6IDE7CisgICAgdEFOSV9VMTYgICAgICAgdXNlclByaW8gOiAzOworICAgIHRBTklfVTE2ICAgICAgIGFja1BvbGljeSA6IDI7CisjZW5kaWYKK30gX19hbmlfYXR0cl9wYWNrZWQgdFNpck1hY1RTSW5mb1RmYzsKKwordHlwZWRlZiBfX2FuaV9hdHRyX3ByZV9wYWNrZ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bFszXTsKK30gX19hbmlfYXR0cl9wYWNrZWQgdFNpck1hY1RjbGFzUGFyYW1JUHY2OworCisjZGVmaW5lIFNJUl9NQUNfVENMQVNfUEFSQU1fODAyMURRX01JTiAgMgordHlwZWRlZiAgX19hbmlfYXR0cl9wcmVfcGFja2VkIHN0cnVjdCBzU2lyTWFjVGNsYXNQYXJhbTgwMjFkcQoreworICAgIHRBTklfVTE2ICAgICAgICAgICAgdGFnOworfSBfX2FuaV9hdHRyX3BhY2tlZCB0U2lyTWFjVGNsYXNQYXJhbTgwMjFkcTsKKwordHlwZWRlZiBfX2FuaV9hdHRyX3ByZV9wYWNrZWQgc3RydWN0IHNTaXJNYWNUY2xhc0lFCit7CisgICAgdEFOSV9VOCAgICAgICAgICAgICB0eXBlOworICAgIHRBTklfVTggICAgICAgICAgICAgbGVuZ3RoOworICAgIHRBTklfVTggICAgICAgICAgICAgdXNlclByaW87CisgICAgdEFOSV9VOCAgICAgICAgICAgICBjbGFzc2lmaWVyVHlwZTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgIGNsYXNzaWZpZXJNYXNrOworfSBfX2FuaV9hdHRyX3BhY2tlZCB0U2lyTWFjVGNsYXNJRTsKKwordHlwZWRlZiBfX2FuaV9hdHRyX3ByZV9wYWNrZWQgc3RydWN0IHNTaXJNYWNUc0RlbGF5SUUKK3sKKyAgICB0QU5JX1U4ICAgICAgICAgICAgIHR5cGU7CisgICAgdEFOSV9VOCAgICAgICAgICAgICBsZW5ndGg7CisgICAgdEFOSV9VMzIgICAgICAgICAgICBkZWxheTsKK30gX19hbmlfYXR0cl9wYWNrZWQgdFNpck1hY1RzRGVsYXlJRTsKKwordHlwZWRlZiBfX2FuaV9hdHRyX3ByZV9wYWNrZWQgc3RydWN0IHNTaXJNYWNUY2xhc1Byb2NJRQoreworICAgIHRBTklfVTggICAgICAgICAgICAgdHlwZTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgIGxlbmd0aDsKKyAgICB0QU5JX1U4ICAg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ICAgICAgIHNwZWNJbnRlcnZhbDsKK30gX19hbmlfYXR0cl9wYWNrZWQgdFNpck1hY1NjaGVkdWxlSUU7CisKK3R5cGVkZWYgX19hbmlfYXR0cl9wcmVfcGFja2VkIHN0cnVjdCBzU2lyTWFjUW9zQ2FwYWJpbGl0eUlFCit7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgIHR5cGU7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgIGxlbmd0aDsKKyAgICB0U2lyTWFjUW9zSW5mbyAgICAgIHFvc0luZm87Cit9IF9fYW5pX2F0dHJfcGFja2VkIHRTaXJNYWNRb3NDYXBhYmlsaXR5SUU7CisKK3R5cGVkZWYgX19hbmlfYXR0cl9wcmVfcGFja2VkIHN0cnVjdCBzU2lyTWFjUW9zQ2FwYWJpbGl0eVN0YUlFCit7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgIHR5cGU7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgIGxlbmd0aDsKKyAgICB0U2lyTWFjUW9zSW5mb1N0YXRpb24gICAgcW9zSW5mbzsKK30gX19hbmlfYXR0cl9wYWNrZWQgdFNpck1hY1Fvc0NhcGFiaWxpdHlTdGFJRTsKKworCisjZGVmaW5lICBBRERUUwordHlwZWRlZiBfX2FuaV9hdHRyX3ByZV9wYWNrZWQgc3RydWN0IHNTaXJNYWNRb3NBY3Rpb25JRQoreworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICB0eXBlOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICBsZW5ndGg7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgIHFvc0FjdGlvbjsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgcW9zQm9keVsxXTsKK30gX19hbmlfYXR0cl9wYWNrZWQgdFNpck1hY1Fvc0FjdGlvbklFOworCit0eXBlZGVmIHRBTklfVTMyIHRTaXJNYWNUaW1lU3RhbXBbMl07CisKK3R5cGVkZWYgdEFOSV9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jQ291bnRyeSAgICBjb3VudHJ5OworfSBfX2FuaV9hdHRyX3BhY2tlZCB0U2lyTWFjQ291bnRyeUlFOworCit0eXBlZGVmIF9fYW5pX2F0dHJfcHJlX3BhY2tlZCBzdHJ1Y3Qgc1Npck1hY05vbkVycFByZXNlbnRJRQoreworICAgIHRBTklfVTggICAgICAgICAgICAgICAgdHlwZTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgIGxlbmd0aDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgIGVycDsKK30gX19hbmlfYXR0cl9wYWNrZWQgdFNpck1hY05vbkVycFByZXNlbnRJRTsKKwordHlwZWRlZiBfX2FuaV9hdHRyX3ByZV9wYWNrZWQgc3RydWN0IHNTaXJNYWNXcGFJRQoreworICAgIHRBTklfVTggICAgICAgICAgICAgICAgdHlwZTsKKyAgICB0U2lyTWFjV3BhSW5mbyAgICB3cGE7Cit9IF9fYW5pX2F0dHJfcGFja2VkIHRTaXJNYWNXcGFJRTsKKwordHlwZWRlZiAgc3RydWN0IHNTaXJNYWNQb3dlckNhcGFiaWxpdHlJRQoreworICAgIHRBTklfVTggICAgICAgIHR5cGU7CisgICAgdEFOSV9VOCAgICAgICAgbGVuZ3RoOworICAgIHRBTklfVTggICAgICAgIG1pblR4UG93ZXI7CisgICAgdEFOSV9VOCAgICAgICAgbWF4VHhQb3dlcjsKK30gdFNpck1hY1Bvd2VyQ2FwYWJpbGl0eUlFOworCit0eXBlZGVmICBzdHJ1Y3Qgc1Npck1hY1N1cHBvcnRlZENoYW5uZWxJRQoreworICAgIHRBTklfVTggICAgICAgIHR5cGU7CisgICAgdEFOSV9VOCAgICAgICAgbGVuZ3RoOworICAgIHRBTklfVTggICAgICAgIHN1cHBvcnRlZENoYW5uZWxzWzk2XTsKK30gdFNpck1hY1N1cHBvcnRlZENoYW5uZWxJRTsKKwordHlwZWRlZiAgc3RydWN0IHNTaXJNYWNNZWFzUmVxRmllbGQKK3sKKyAgICB0QU5JX1U4ICAgICAgICBjaGFubmVsTnVtYmVyOworICAgIHRBTklfVTggICAgICAgIG1lYXNTdGFydFRpbWVbOF07CisgICAgdEFOSV9VMTYgICAgICAgbWVhc0R1cmF0aW9uOworfSB0U2lyTWFjTWVhc1JlcUZpZWxkLCAqdHBTaXJNYWNNZWFzUmVxRmllbGQ7CisKK3R5cGVkZWYgIHN0cnVjdCBzU2lyTWFjTWVhc1JlcUlFCit7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgIHR5cGU7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgIGxlbmd0aDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgbWVhc1Rva2VuOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICBtZWFzUmVxTW9kZTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgbWVhc1R5cGU7CisgICAgdFNpck1hY01lYXNSZXFGaWVsZCAgICBtZWFzUmVxRmllbGQ7Cit9IHRTaXJNYWNNZWFzUmVxSUUsICp0cFNpck1hY01lYXNSZXFJRTsKKworLy8gQmFzaWMgTWVhc3VyZW1lbnQgUmVwb3J0Cit0eXBlZGVmICBzdHJ1Y3Qgc1Npck1hY0Jhc2ljUmVwb3J0Cit7CisgICAgdEFOSV9VOCAgICAgICAgY2hhbm5lbE51bWJlcjsKKyAgICB0QU5JX1U4ICAgICAgICBtZWFzU3RhcnRUaW1lWzhdOworICAgIHRBTklfVTE2ICAgICAgIG1lYXNEdXJhdGlvbjsKKyAgICB0QU5JX1U4ICAgICAgICBtYXBGaWVsZDsKK30gdFNpck1hY0Jhc2ljUmVwb3J0LCAqdHBTaXJNYWNCYXNpY1JlcG9ydDsKKwordHlwZWRlZiAgc3RydWN0IHNTaXJNYWNCYXNpY1JlcG9ydElFCit7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgICAgdHlwZTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgICBsZW5ndGg7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgICAgbWVhc1Rva2VuOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgIG1lYXNSZXBvcnRNb2RlOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgIG1lYXNUeXBlOworICAgIHRTaXJNYWNCYXNpY1JlcG9ydCAgICAgICBiYXNpY1JlcG9ydDsKK30gdFNpck1hY0Jhc2ljUmVwb3J0SUUsICp0cFNpck1hY0Jhc2ljUmVwb3J0SUU7CisKKy8vIENDQSBNZWFzdXJlbWVudCBSZXBvcnQKK3R5cGVkZWYgIHN0cnVjdCBzU2lyTWFjQ2NhUmVwb3J0Cit7CisgICAgdEFOSV9VOCAgICAgICAgY2hhbm5lbE51bWJlcjsKKyAgICB0QU5JX1U4ICAgICAgICBtZWFzU3RhcnRUaW1lWzhdOworICAgIHRBTklfVTE2ICAgICAgIG1lYXNEdXJhdGlvbjsKKyAgICB0QU5JX1U4ICAgICAgICBjY2FCdXN5RnJhY3Rpb247Cit9IHRTaXJNYWNDY2FSZXBvcnQsICp0cFNpck1hY0NjYVJlcG9ydDsKKwordHlwZWRlZiAgc3RydWN0IHNTaXJNYWNDY2FSZXBvcnRJRQoreworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgIHR5cGU7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgIG1lYXNUb2tlbjsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgICBtZWFzUmVwb3J0TW9kZTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgICBtZWFzVHlwZTsKKyAgICB0U2lyTWFjQ2NhUmVwb3J0ICAgICAgICAgY2NhUmVwb3J0OworfSB0U2lyTWFjQ2NhUmVwb3J0SUUsICp0cFNpck1hY0NjYVJlcG9ydElFOworCisvLyBSUEkgSGlzdG9ncmFtIE1lYXN1cmVtZW50IFJlcG9ydAordHlwZWRlZiAgc3RydWN0IHNTaXJNYWNScGlSZXBvcnQKK3sKKyAgICB0QU5JX1U4ICAgICAgICBjaGFubmVsTnVtYmVyOworICAgIHRBTklfVTggICAgICAgIG1lYXNTdGFydFRpbWVbOF07CisgICAgdEFOSV9VMTYgICAgICAgbWVhc0R1cmF0aW9uOworICAgIHRBTklfVTggICAgICAgIHJwaURlbnNpdHlbOF07Cit9IHRTaXJNYWNScGlSZXBvcnQsICp0cFNpck1hY1JwaVJlcG9ydDsKKwordHlwZWRlZiAgc3RydWN0IHNTaXJNYWNScGlSZXBvcnRJRQoreworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgIHR5cGU7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgIG1lYXNUb2tlbjsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgICBtZWFzUmVwb3J0TW9kZTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgICBtZWFzVHlwZTsKKyAgICB0U2lyTWFjUnBpUmVwb3J0ICAgICBycGlSZXBvcnQ7Cit9IHRTaXJNYWNScGlSZXBvcnRJRSwgKnRwU2lyTWFjUnBpUmVwb3J0SUU7CisKKyNkZWZpbmUgU0lSX01BQ19NQVhfU1VQUF9SQVRFUyAgICAgICAgICAgIDMyCisKKyNkZWZpbmUgU0lSX01BQ19NQVhfU1VQUF9DSEFOTkVMUyAgICAgICAgICAgIDEwMAorI2RlZmluZSBTSVJfTUFDX01BWF9TVVBQX09QRVJfQ0xBU1NFUyAgICAgICAgMzIKKworI2RlZmluZSBTSVJfTUFDX01BWF9FWFROX0NBUCAgICAgICAgICAgICAgIDgKKworLy8gVkhUIENhcGFiaWxpdGllcyBJbmZvCit0eXBlZGVmIF9fYW5pX2F0dHJfcHJlX3BhY2tlZCBzdHJ1Y3Qgc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AgICAgMQorI2RlZmluZSBNSU1PX1BPV0VSX1NBVkVfTkEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMgorI2RlZmluZSBOT19MSU1JVF9PTl9NSU1PX1NFUSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMworI2RlZmluZSBERVZJQ0VfSVNfQUJMRV9UT19SQ1ZFX1BQRFVfV0lUSF9HRl9QUkVBTUJMRSAgICAgICAgMQorI2RlZmluZSBERVZJQ0VfTk9UX0FCTEVfVE9fUkNWRV9QUERVX1dJVEhfR0ZfUFJFQU1CTEUgICAgICAgMAorI2RlZmluZSBTVVBQT1JUX1NIT1JUX0dJX0ZPUl8yMF9NSFogICAgICAgICAgICAgICAgICAgICAgICAgMQorI2RlZmluZSBOT1RfU1VQUE9SVF9TSE9SVF9HSV9GT1JfMjBfTUhaICAgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBTVVBQT1JUX1NIT1JUX0dJX0ZPUl80MF9NSFogICAgICAgICAgICAgICAgICAgICAgICAgMQorI2RlZmluZSBOT1RfU1VQUE9SVF9TSE9SVF9HSV9GT1JfNDBfTUhaICAgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBUUkFOU01JVFRFUl9TVVBQT1JUX1NUQkMgICAgICAgICAgICAgICAgICAgICAgICAgICAgMQorI2RlZmluZSBUUkFOU01JVFRFUl9OT1RfU1VQUE9SVF9TVEJDICAgICAgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBSWF9OT1RfU1VQUE9SVF9TVEJDICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBSWF9TVVBQT1JUX1NUQkNfT05FX1NQQVRJQUxfU1RSRUFNICAgICAgICAgICAgICAgICAgMQorI2RlZmluZSBSWF9TVVBQT1JUX1NUQkNfT05FX0FORF9UV09fU1BBVElBTF9TVFJFQU0gICAgICAgICAgMgorI2RlZmluZSBSWF9TVVBQT1JUX1NUQkNfT05FX1RXT19USFJFRV9TUEFUSUFMX1NUUkVBTSAgICAgICAgMworI2RlZmluZSBTVVBQT1JUX0RFTEFZRURfQkEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMQorI2RlZmluZSBOT1RfU1VQUE9SVF9ERUxBWUVEX0JBICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBSRUNFSVZFUl9NQVhfQV9NU0RVX1NJWkVfNzkzNSAgICAgICAgICAgICAgICAgICAgICAgMQorI2RlZmluZSBSRUNFSVZFUl9NQVhfQV9NU0RVX1NJWkVfMzgzOSAgICAgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBCU1NfT1JfREVWSUNFX0FMTE9XX1VTRV9EU1NTX0NDSyAgICAgICAgICAgICAgICAgICAgMQorI2RlZmluZSBCU1NfT1JfREVWSUNFX05PVF9BTExPV19VU0VfRFNTU19DQ0sgICAgICAgICAgICAgICAgMAorI2RlZmluZSBCU1NfT1JfREVWSUNFX1NVUFBPUlRfVVNFX1BTTVAgICAgICAgICAgICAgICAgICAgICAgMQorI2RlZmluZSBCU1NfT1JfREVWSUNFX05PVF9TVVBQT1JUX1VTRV9QU01QICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBCU1NfT1JfREVWSUNFX1NVUFBPUlRfVVNFX1NUQkNfQ09OVFJPTF9GUkFNRSAgICAgICAgMQorI2RlZmluZSBCU1NfT1JfREVWSUNFX05PVF9TVVBQT1JUX1VTRV9TVEJDX0NPTlRST0xfRlJBTUUgICAgMAorI2RlZmluZSBTVVBQT1JUX0xfU0lHX1RYT1BfUFJPVEVDVElPTiAgICAgICAgICAgICAgICAgICAgICAgMQorI2RlZmluZSBOT1RfU1VQUE9SVF9MX1NJR19UWE9QX1BST1RFQ1RJT04gICAgICAgICAgICAgICAgICAgMAorCisvLyBUeXBlZGVmIGZvciBIVCBQYXJhbWV0ZXJzIEluZm8gRmllbGQKKyNkZWZpbmUgTUFYX1JYX0FNUERVX0ZBQ1RPUl8wICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgTUFYX1JYX0FNUERVX0ZBQ1RPUl8xICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEKKyNkZWZpbmUgTUFYX1JYX0FNUERVX0ZBQ1RPUl8yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIKKyNkZWZpbmUgTUFYX1JYX0FNUERVX0ZBQ1RPUl8zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMKKyNkZWZpbmUgTVBEVV9ERU5TSVRZX05PX1JFU1RSSUNUSU9OICAgICAgICAgICAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgTVBEVV9ERU5TSVRZX09ORV9FSUdIVEhfVVNFQ09ORCAgICAgICAgICAgICAgICAgICAgIDEKKyNkZWZpbmUgTVBEVV9ERU5TSVRZX09ORV9GT1VSVEhfVVNFQ09ORCAgICAgICAgICAgICAgICAgICAgIDIKKyNkZWZpbmUgTVBEVV9ERU5TSVRZX09ORV9IQUxGX1VTRUNPTkQgICAgICAgICAgICAgICAgICAgICAgIDMKKyNkZWZpbmUgTVBEVV9ERU5TSVRZX09ORV9VU0VDT05EICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQKKyNkZWZpbmUgTVBEVV9ERU5TSVRZX1RXT19VU0VDT05EICAgICAgICAgICAgICAgICAgICAgICAgICAgIDUKKyNkZWZpbmUgTVBEVV9ERU5TSVRZX0ZPVVJfVVNFQ09ORCAgICAgICAgICAgICAgICAgICAgICAgICAgIDYKKyNkZWZpbmUgTVBEVV9ERU5TSVRZX0VJR0hUX1VTRUNPTkQgICAgICAgICAgICAgICAgICAgICAgICAgIDcKKyNlbmRpZgorCisvLyBTdXBwb3J0ZWQgTUNTIHNldAorI2RlZmluZSBTSVpFX09GX1NVUFBPUlRFRF9NQ1NfU0VUICAgICAgICAgICAgICAgICAgICAgICAgICAxNgorI2RlZmluZSBTSVpFX09GX0JBU0lDX01DU19TRVQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNgorI2RlZmluZSBWQUxJRF9NQ1NfU0laRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA3NyAvLzAtNzYKKyNkZWZpbmUgTUNTX1JYX0hJR0hFU1RfU1VQUE9SVEVEX1JBVEVfQllURV9PRkZTRVQgICAgICAgICAgMTAKKy8vIFRoaXMgaXMgbm90IGNsZWFyLCBDb3VudCA4IGJhc2VkIGZyb20gTlYgc3VwcG9ydGVkIE1DUyBjb3VudCAgICAKKyNkZWZpbmUgVkFMSURfTUFYX01DU19JTkRFWCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOAorCisjaWYgMAorLy8gVHlwZWRlZiBFeHRlbmRlZCBIVCBDYXBhYmlsaXR5IEluZm8gRmllbGQKKyNkZWZpbmUgU1VQUE9SVF9QQ08gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxCisjZGVmaW5lIE5PVF9TVVBQT1JUX1BDTyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBUUkFOU0lUSU9OX1RJTUVfMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgU1RBX0RPRVNfTk9UX1BST1ZJREVfTUNTX0ZFRURCQUNLICAgICAgICAgICAgICAgICAgICAgICAwCisjZGVmaW5lIFJFU0VSVkVfVkFMVUVfRk9SX1NUQV9NQ1NfRkVFREJBQ0sgICAgICAgICAgICAgICAgICAgICAgMQorI2RlZmluZSBTVEFfUFJPVklERV9VTlNPTElDSVRFRF9NQ1NfRkVFREJBQ0sgICAgICAgICAgICAgICAgICAgIDIKKyNkZWZpbmUgU1RBX1BST1ZJREVfT05fTVJRX0FORF9VTlNPTElDSVRFRF9NQ1NfRkVFREJBQ0sgICAgICAgICAzCisKKy8vIFR5cGVkZWYgVHJhbnNtaXQgQmVhbWZvcm1pbmcgQ2FwYWJpbGl0eQorI2RlZmluZSBUWF9CRUFNRk9STUlOR19DQVBBQkxFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEKKyNkZWZpbmUgVFhfQkVBTUZPUk1JTkdfSU5DQVBBQkxFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwCisjZGVmaW5lIENBUEFCTEVfUkVDRUlWRV9TVEFHR0VSRURfU09VTkRJTkcgICAgICAgICAgICAgICAgICAgICAgMQorI2RlZmluZSBOT1RfQ0FQQUJMRV9SRUNFSVZFX1NUQUdHRVJFRF9TT1VORElORyAgICAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgQ0FQQUJMRV9UUkFOU01JVF9TVEFHR0VSRURfU09VTkRJTkcgICAgICAgICAgICAgICAgICAgICAxCisjZGVmaW5lIE5PVF9DQVBBQkxFX1RSQU5TTUlUX1NUQUdHRVJFRF9TT1VORElORyAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBDQVBBQkxFX1JFQ0VJVkVfWkxGICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEKKyNkZWZpbmUgTk9UX0NBUEFCTEVfUkVDRUlWRV9aTEYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwCisjZGVmaW5lIENBUEFCTEVfVFJBTlNNSVRfWkxGICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMQorI2RlZmluZSBOT1RfQ0FQQUJMRV9UUkFOU01JVF9aTEYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgQ0FQQUJMRV9JTVBMSUNJVF9UWEJGICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxCisjZGVmaW5lIE5PVF9DQVBBQkxFX0lNUExJQ0lUX1RYQkYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBJTkNBUEFCTEVfQ0FMSUJSQVRJT04gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgTElNSVRFRF9DQUxJQlJBVElPTl9DQU5OT1RfSU5JVElBVEUgICAgICAgICAgICAgICAgICAgICAxCisjZGVmaW5lIExJTUlURURfQ0FMSUJSQVRJT05fQ0FOX0lOSVRJQVRFICAgICAgICAgICAgICAgICAgICAgICAgMgorI2RlZmluZSBGVUxMVF9DQVBBQkxFX0NBTElCUkFUSU9OICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMKKyNkZWZpbmUgQ0FQQUJMRV9FWFBMSUNJVF9DU0lfVFhCRiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxCisjZGVmaW5lIElOQ0FQQUJMRV9FWFBMSUNJVF9DU0lfVFhCRiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBDQVBBQkxFX0VYUExJQ0lUX1VOQ09NUFJFU1NFRF9TVEVFUklOR19NQVRSSVggICAgICAgICAgIDEKKyNkZWZpbmUgSU5DQVBBQkxFX0VYUExJQ0lUX1VOQ09NUFJFU1NFRF9TVEVFUklOR19NQVRSSVggICAgICAgICAwCisjZGVmaW5lIElOQ0FQQUJMRV9FWFBMSUNJVF9CRkNJX0ZFRURCQUNLICAgICAgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBDQVBBQkxFX1VOU09MSUNJVEVEX0JGQ0lfRkVFREJBQ0sgICAgICAgICAgICAgICAgICAgICAgIDEKKyNkZWZpbmUgQ0FQQUJMRV9JTU1FRElBVEVfQkZDSV9GRUVEQkFDSyAgICAgICAgICAgICAgICAgICAgICAgICAyCisjZGVmaW5lIENBUEFCTEVfQUdHUkVHQVRFX0JGQ0lfRkVFREJBQ0sgICAgICAgICAgICAgICAgICAgICAgICAgNAorI2RlZmluZSBJTkNBUEFCTEVfRVhQTElDSVRfVU5DT01QUkVTU0VEX1NURUVSSU5HX01BVFJJWF9GRUVEQkFDIDAKKyNkZWZpbmUgQ0FQQUJMRV9VTlNPTElDSVRFRF9VTkNPTVBSRVNTRURfU1RFRVJJTkdfTUFUUklYICAgICAgICAxCisjZGVmaW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TRURfVFhfQVMgICAgICAgICAgMAorI2RlZmluZSBDQVBBQkxFX0VYUExJQ0lUX0NTSV9GRUVEQkFDSyAgICAgICAgICAgICAgICAgICAgICAgICAgIDEKKyNkZWZpbmUgSU5DQVBBQkxFX0VYUExJQ0lUX0NTSV9GRUVEQkFDSyAgICAgICAgICAgICAgICAgICAgICAgICAwCisjZGVmaW5lIENBUEFCTEVfQU5URU5OQV9JTkRJQ0VTX0ZFRURCQUNLX0JBU0VEX1RYX0FTICAgICAgICAgICAgMQorI2RlZmluZSBJTkNBUEFCTEVfQU5URU5OQV9JTkRJQ0VTX0ZFRURCQUNLX0JBU0VEX1RYX0FTICAgICAgICAgIDAKKyNkZWZpbmUgQ0FQQUJMRV9SWF9BUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxCisjZGVmaW5lIElOQ0FQQUJMRV9SWF9BUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBDQVBBQkxFX1RSQU5TTUlUX1NPVU5ESU5HX1BQRFUgICAgICAgICAgICAgICAgICAgICAgICAgIDEKKyNkZWZpbmUgSU5DQVBBQkxFX1RSQU5TTUlUX1NPVU5ESU5HX1BQRFUgICAgICAgICAgICAgICAgICAgICAgICAwCisKKy8vIFR5cGVkZWYgQWRkaXRpb25hbCBIVCBJbmZvbWF0aW9uIEVsZW1lbnRzCisjZGVmaW5lIENPTlRST0xfQ0hBTk5FTF8xICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMQorCisjZGVmaW5lIE9GRlNFVF9OT19FWFRFTlNJT05fQ0hBTk5FTF9JU19QUkVTRU5UICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBPRkZTRVRfRVhURU5TSU9OX0NIQU5ORUxfQUJPVkVfQ09OVFJPTF9DSEFOTkVMICAgICAgICAgIDEKKyNkZWZpbmUgT0ZGU0VUX0VYVEVOU0lPTl9DSEFOTkVMX0JFTE9XX0NPTlRST0xfQ0hBTk5FTCAgICAgICAgICAzCisjZGVmaW5lIFVTRV8yMF9NSFpfQ09OVFJPTF9DSEFOTkVMICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBVU0VfQU5ZX1NVUFBPUlRFRF9DSEFOTkVMX1dJRFRIICAgICAgICAgICAgICAgICAgICAgICAgIDEKKyNkZWZpbmUgVVNFX1JJRlNfTU9ERV9QUk9ISUJJVEVEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwCisjZGVmaW5lIFVTRV9SSUZTX01PREVfUEVSTUlUVEVEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMQorI2RlZmluZSBDT05UUk9MTEVEX0FDQ0VTU19OT1RfT05MWV9QU01QICAgICAgICAgICAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgQ09OVFJPTExFRF9BQ0NFU1NfT05MWV9QU01QICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxCisjZGVmaW5lIFNFUlZJQ0VfSU5URVJWQUxfR1JBTlVMQVJJVFlfNU1TICAgICAgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBTRVJWSUNFX0lOVEVSVkFMX0dSQU5VTEFSSVRZXzEwTVMgICAgICAgICAgICAgICAgICAgICAgIDEKKyNkZWZpbmUgU0VSVklDRV9JTlRFUlZBTF9HUkFOVUxBUklUWV8xNU1TICAgICAgICAgICAgICAgICAgICAgICAyCisjZGVmaW5lIFNFUlZJQ0VfSU5URVJWQUxfR1JBTlVMQVJJVFlfMjBNUyAgICAgICAgICAgICAgICAgICAgICAgMworI2RlZmluZSBTRVJWSUNFX0lOVEVSVkFMX0dSQU5VTEFSSVRZXzI1TVMgICAgICAgICAgICAgICAgICAgICAgIDQKKyNkZWZpbmUgU0VSVklDRV9JTlRFUlZBTF9HUkFOVUxBUklUWV8zME1TICAgICAgICAgICAgICAgICAgICAgICA1CisjZGVmaW5lIFNFUlZJQ0VfSU5URVJWQUxfR1JBTlVMQVJJVFlfMzVNUyAgICAgICAgICAgICAgICAgICAgICAgNgorI2RlZmluZSBTRVJWSUNFX0lOVEVSVkFMX0dSQU5VTEFSSVRZXzQwTVMgICAgICAgICAgICAgICAgICAgICAgIDcKKworI2RlZmluZSBPUEVSQVRJT05fTU9ERV9QVVJFX05PX1BST1RFQ1RJT04gICAgICAgICAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgT1BFUkFUSU9OX01PREVfT1BUSU9OQUxfUFJPVEVDVElPTiAgICAgICAgICAgICAgICAgICAgICAxCisjZGVmaW5lIE9QRVJBVElPTl9NT0RFX05PX0xFR0FDWV9TVEFfNDBNSFpfUFJPVEVDVEVEICAgICAgICAgICAgMgorI2RlZmluZSBPUEVSQVRJT05fTU9ERV9NSVhFRF9QUk9URUNUSU9OICAgICAgICAgICAgICAgICAgICAgICAgIDMKKworI2RlZmluZSBEVUFMX0NUU19QUk9URUNUSU9OX0lTX1VTRUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEKKyNkZWZpbmUgUkVHVUxBUl9SVFNfQ1RTX0lTX1VTRUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwCisjZGVmaW5lIFNFQ09OREFSWV9CRUFDT04gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMQorI2RlZmluZSBQUklNQVJZX0JFQUNPTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgTFNJR19UWE9QX1BST1RFQ1RJT05fRlVMTF9TVVBQT1JUICAgICAgICAgICAgICAgICAgICAgICAxCisjZGVmaW5lIExTSUdfVFhPUF9QUk9URUNUSU9OX05PVF9GVUxMX1NVUFBPUlQgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBQQ09fSVNfQUNUSVZBVEVEX0lOX0JTUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEKKyNkZWZpbmUgUENPX0lTX05PVF9BQ1RJVkFURURfSU5fQlNTICAgICAgICAg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VOCAgICAgICAgICAgICAgICAgICAgZHN0TUFDWzZdOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgIHNyY01BQ1s2XTsKK30gX19hbmlfYXR0cl9wYWNrZWQgdFNpck1hY1Fvc0RscFRkbkFGOworCisKKworCisvLworLy8vIENvbW1vbiBoZWFkZXIgZm9yIGFsbCBBTkkgcHJvcHJpZXRhcnkgYWN0aW9uIGZyYW1lcwordHlwZWRlZiBfX2FuaV9hdHRyX3ByZV9wYWNrZWQgc3RydWN0IHNTaXJNYWNBbmlBY3Rpb25GcmFtZQoreworICAgIHRTaXJNYWNBY3Rpb25GcmFtZUhkciBhZkhkcjsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICBhbmlPdWlbM107IC8vIDAwIDBBIEY1CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgdHlwZTsgICAgICAvLyAwIC0gcmVxdWVzdDsgMSAtIHJlcG9ydDsgMiAtIHNucgorfSBfX2FuaV9hdHRyX3BhY2tlZCB0U2lyTWFjQW5pQWN0aW9uRnJhbWUsICp0cFNpck1hY0FuaUFjdGlvbkZyYW1lOworCisKK3R5cGVkZWYgX19hbmlfYXR0cl9wcmVfcGFja2VkIHN0cnVjdCBzU2lyTWFjTGlua1Rlc3RSZXFEYXRhCit7CisgICAgdFNpck1hY0FuaUFjdGlvbkZyYW1lIGhkcjsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICBmcmFtZVN0YXR1czsgLy8gYml0MCAtIGZpcnN0IGZyYW1lCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBiaXQxIC0gbGFzdCBmcmFtZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlmIGJvdGggYml0MC8xIGFyZSBvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGludGVybWVkaWF0ZSBmcmFtZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYml0Mi03IC0gcmVzZXJ2ZWQKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICByYXRlOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgIHJhbmRvbURhdGFbU0lSX01BQ19NQVhfUkFORE9NX0xFTkdUSF07Cit9IF9fYW5pX2F0dHJfcGFja2VkIHRTaXJNYWNMaW5rVGVzdFJlcURhdGEsICp0cFNpck1hY0xpbmtUZXN0UmVxRGF0YTsKKworLy8vIFNOUiByZXBvcnQgc3BlY2lmaWMgZmllbGRzCit0eXBlZGVmIF9fYW5pX2F0dHJfcHJlX3BhY2tlZCBzdHJ1Y3Qgc1Npck1hY1NuclJlcG9ydAoreworICAgIHRTaXJNYWNBbmlBY3Rpb25GcmFtZSBoZHI7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgICAgbnVtU2FtcGxlczsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICAgICBzbnI7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgICAgc25yQ29tcDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICAgICBzcTsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICAgICByc3NpOworfSBfX2FuaV9hdHRyX3BhY2tlZCB0U2lyTWFjU25yUmVwb3J0LCAqdHBTaXJNYWNTbnJSZXBvcnQ7CisKK3R5cGVkZWYgX19hbmlfYXR0cl9wcmVfcGFja2VkIHN0cnVjdCBzU2lyTWFjU3RhQ2JMZWdhY3lCc3NEZXRlY3QKK3sKKyAgICB0U2lyTWFjQW5pQWN0aW9uRnJhbWUgaGRyOworICAgIHRBTklfVTggICAgICAgICAgICAgICBjaGFubmVsTnVtOworICAgIHRBTklfVTggICAgICAgICAgICAgICBudW1MZWdhY3lCc3NpZDsKKyAgICAvKiBCZWxvdyBpcyBkZWNsYXJlZCBhcyBhIHBsYWNlIGhvbGRlci4gIERvbid0IGFkZCBhbnl0aGluZyBhZnR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ICAgICAgICAgICAgICgoKHRBTklfVTgpeCk9PVNJUl9NQUNfUkFURV8xOCl8fCBcCisgICAgICAgICAgICAgICAgICAgICAgICgoKHRBTklfVTgpeCk9PVNJUl9NQUNfUkFURV8yNCl8fCBcCisgICAgICAgICAgICAgICAgICAgICAgICgoKHRBTklfVTgpeCk9PVNJUl9NQUNfUkFURV8zNil8fCBcCisgICAgICAgICAgICAgICAgICAgICAgICgoKHRBTklfVTgpeCk9PVNJUl9NQUNfUkFURV80OCl8fCBcCisgICAgICAgICAgICAgICAgICAgICAgICgoKHRBTklfVTgpeCk9PVNJUl9NQUNfUkFURV81NCkpCisKKyNkZWZpbmUgc2lySXNCcmF0ZSh4KSAoKCgodEFOSV9VOCl4KT09U0lSX01BQ19SQVRFXzEpICB8fCBcCisgICAgICAgICAgICAgICAgICAgICAgICgoKHRBTklfVTgpeCk9PVNJUl9NQUNfUkFURV8yKSAgfHwgXAorICAgICAgICAgICAgICAgICAgICAgICAoKCh0QU5JX1U4KXgpPT1TSVJfTUFDX1JBVEVfNV81KXx8IFwKKyAgICAgICAgICAgICAgICAgICAgICAgKCgodEFOSV9VOCl4KT09U0lSX01BQ19SQVRFXzExKSkKKworI2RlZmluZSBzaXJJc0dyYXRlKHgpICgoKCh0QU5JX1U4KXgpPT1TSVJfTUFDX1JBVEVfMSkgIHx8IFwKKyAgICAgICAgICAgICAgICAgICAgICAgKCgodEFOSV9VOCl4KT09U0lSX01BQ19SQVRFXzIpICB8fCBcCisgICAgICAgICAgICAgICAgICAgICAgICgoKHRBTklfVTgpeCk9PVNJUl9NQUNfUkFURV81XzUpfHwgXAorICAgICAgICAgICAgICAgICAgICAgICAoKCh0QU5JX1U4KXgpPT1TSVJfTUFDX1JBVEVfMTEpIHx8IFwKKyAgICAgICAgICAgICAgICAgICAgICAgKCgodEFOSV9VOCl4KT09U0lSX01BQ19SQVRFXzYpICB8fCBcCisgICAgICAgICAgICAgICAgICAgICAgICgoKHRBTklfVTgpeCk9PVNJUl9NQUNfUkFURV85KSAgfHwgXAorICAgICAgICAgICAgICAgICAgICAgICAoKCh0QU5JX1U4KXgpPT1TSVJfTUFDX1JBVEVfMTIpIHx8IFwKKyAgICAgICAgICAgICAgICAgICAgICAgKCgodEFOSV9VOCl4KT09U0lSX01BQ19SQVRFXzE4KSB8fCBcCisgICAgICAgICAgICAgICAgICAgICAgICgoKHRBTklfVTgpeCk9PVNJUl9NQUNfUkFURV8yNCkgfHwgXAorICAgICAgICAgICAgICAgICAgICAgICAoKCh0QU5JX1U4KXgpPT1TSVJfTUFDX1JBVEVfMzYpIHx8IFwKKyAgICAgICAgICAgICAgICAgICAgICAgKCgodEFOSV9VOCl4KT09U0lSX01BQ19SQVRFXzQ4KSB8fCBcCisgICAgICAgICAgICAgICAgICAgICAgICgoKHRBTklfVTgpeCk9PVNJUl9NQUNfUkFURV81NCkpCisKKyNkZWZpbmUgc2lySXNQcm9wcmF0ZSh4KSAoKCgodEFOSV9VOCl4KT09U0lSX01BQ19SQVRFXzcyKSB8fCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICgoKHRBTklfVTgpeCk9PVNJUl9NQUNfUkFURV85NikgfHwgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAoKCh0QU5JX1U4KXgpPT1TSVJfTUFDX1JBVEVfMTA4KSkKKworI2RlZmluZSBzaXJJc0VuaGFuY2VkUmF0ZSh4KSBcCisgICAgICAgICAgICAgICAgICAgICAgICAgKCgoeCk9PVNJUl9NQUNfUkFURV80MikgIHx8IFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKCh4KT09U0lSX01BQ19SQVRFXzg0KSAgfHwgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAoKHgpPT1TSVJfTUFDX1JBVEVfMTI2KSB8fCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICgoeCk9PVNJUl9NQUNfUkFURV8xNDQpIHx8IFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKCh4KT09U0lSX01BQ19SQVRFXzE2O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hpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworLyoKKyAqIFRoaXMgZmlsZSBzaXJUeXBlcy5oIGNvbnRhaW5zIHRoZSBjb21tb24gdHlwZXMKKyAqCisgKiBBdXRob3I6ICAgIFYuIEsuIEthbmRhcnBhCisgKiBEYXRlOiAgICAgIDA0LzEyLzIwMDIKKyAqIEhpc3Rvcnk6LQorICogRGF0ZSAgICAgICBNb2RpZmllZCBieSAgICAgICAgICAgICAgICAgTW9kaWZpY2F0aW9uIEluZm9ybWF0aW9uCisgKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICovCisKKyNpZm5kZWYgX19TSVJfVFlQRVNfSAorI2RlZmluZSBfX1NJUl9UWVBFU19ICisKKyNpbmNsdWRlICJoYWxUeXBlcy5oIgorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogICAgIFNJUklVUyBFUlJPUiBDb2RlcyAvIFJldHVybiBDb2RlcyAgICAgICAgICAqCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworLy8vIFJldHVybiBzdGF0dXMgdHlwZQordHlwZWRlZiBlbnVtIGVTaXJSZXRTdGF0dXMKK3sKKyAgICBlU0lSX1NVQ0NFU1MsCisg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AgICAgICAgICAgICAgICAgICAgICovCisKKy8qICAgVGhlIGZvbGxvd2luZ3MgYXJlIHdvcmQgaW5kaWNlcyBzdGFydGluZyBmcm9tIHRoZSBtZXNzYWdlIGJvZHkgICAgKi8KKworLyogICBXTklfQ0ZHX3h4eHhfeHh4eF94eHh4OiAgICAgICAgIGluZGV4IG9mIHBhcmFtZXRlciAgICAgICAgICAgICAgICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICBXTklfQ0ZHX3h4eHhfeHh4eF9OVU06ICAgICAgICAgIG51bWJlciBvZiBwYXJhbWV0ZXJzIGluIG1lc3NhZ2UgICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICBXTklfQ0ZHX3h4eHhfeHh4eF9MRU46ICAgICAgICAgIGJ5dGUgbGVuZ3RoIG9mIG1lc3NhZ2UgaW5jbHVkaW5nICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1CIGhlYWRlciAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICBXTklfQ0ZHX3h4eHhfeHh4eF9QQVJUSUFMX0xFTjogIGJ5dGUgbGVuZ3RoIG9mIG1lc3NhZ2UgaW5jbHVkaW5nICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtZXRlcnMgYW5kIE1CIGhlYWRlciBidXQgICAgICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4Y2x1ZGluZyB2YXJpYWJsZSBkYXRhIGxlbmd0aCAgICAqLworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworCisvLyBQYXJhbWV0ZXIgdXBkYXRlIGluZGljYXRpb24KKyNkZWZpbmUgV05JX0NGR19QQVJBTV9VUERBVEVfSU5EX1BJRCAgIDAKKworI2RlZmluZSBXTklfQ0ZHX1BBUkFNX1VQREFURV9JTkRfTlVNICAgMQorI2RlZmluZSBXTklfQ0ZHX1BBUkFNX1VQREFURV9JTkRfTEVOICAgKFdOSV9DRkdfTUJfSERSX0xFTiArIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXTklfQ0ZHX1BBUkFNX1VQREFURV9JTkRfTlVNIDw8IDIpKQorCisvLyBDb25maWd1cmF0aW9uIGRvd25sb2FkIHJlcXVlc3QKKyNkZWZpbmUgV05JX0NGR19ETkxEX1JFUV9OVU0gICAgICAgICAgIDAKKyNkZWZpbmUgV05JX0NGR19ETkxEX1JFUV9MRU4gICAgICAgICAgIFdOSV9DRkdfTUJfSERSX0xFTgorCisvLyBDb25maWd1cmF0aW9uIGRvd25sb2FkIGNvbmZpcm0KKyNkZWZpbmUgV05JX0NGR19ETkxEX0NORl9SRVMgICAgICAgICAgIDAKKworI2RlZmluZSBXTklfQ0ZHX0ROTERfQ05GX05VTSAgICAgICAgICAgMQorI2RlZmluZSBXTklfQ0ZHX0ROTERfQ05GX0xFTiAgICAgICAgICAgKFdOSV9DRkdfTUJfSERSX0xFTiArIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXTklfQ0ZHX0ROTERfQ05GX05VTSA8PCAyKSkKKy8vIEdldCByZXNwb25zZQorI2RlZmluZSBXTklfQ0ZHX0dFVF9SU1BfUkVTICAgICAgICAgICAgMAorI2RlZmluZSBXTklfQ0ZHX0dFVF9SU1BfUElEICAgICAgICAgICAgMQorI2RlZmluZSBXTklfQ0ZHX0dFVF9SU1BfUExFTiAgICAgICAgICAgMgorCisjZGVmaW5lIFdOSV9DRkdfR0VUX1JTUF9OVU0gICAgICAgICAgICAzCisjZGVmaW5lIFdOSV9DRkdfR0VUX1JTUF9QQVJUSUFMX0xFTiAgICAoV05JX0NGR19NQl9IRFJfTEVOICsgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFdOSV9DRkdfR0VUX1JTUF9OVU0gPDwgMikpCisvLyBTZXQgY29uZmlybQorI2RlZmluZSBXTklfQ0ZHX1NFVF9DTkZfUkVTICAgICAgICAgICAgMAorI2RlZmluZSBXTklfQ0ZHX1NFVF9DTkZfUElEICAgICAgICAgICAgMQorCisjZGVmaW5lIFdOSV9DRkdfU0VUX0NORl9OVU0gICAgICAgICAgICAyCisjZGVmaW5lIFdOSV9DRkdfU0VUX0NORl9MRU4gICAgICAgICAgICAoV05JX0NGR19NQl9IRFJfTEVOICsgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFdOSV9DRkdfU0VUX0NORl9OVU0gPDwgMikpCisvLyBHZXQgYXR0cmlidXRlIHJlc3BvbnNlCisjZGVmaW5lIFdOSV9DRkdfR0VUX0FUVFJJQl9SU1BfUkVTICAgICAwCisjZGVmaW5lIFdOSV9DRkdfR0VUX0FUVFJJQl9SU1BfUElEICAgICAxCisjZGVmaW5lIFdOSV9DRkdfR0VUX0FUVFJJQl9SU1BfVFlQRSAgICAyCisjZGVmaW5lIFdOSV9DRkdfR0VUX0FUVFJJQl9SU1BfUExFTiAgICAzCisjZGVmaW5lIFdOSV9DRkdfR0VUX0FUVFJJQl9SU1BfUlcgICAgICA0CisKKyNkZWZpbmUgV05JX0NGR19HRVRfQVRUUklCX1JTUF9OVU0gICAgIDUKKyNkZWZpbmUgV05JX0NGR19HRVRfQVRUUklCX1JTUF9MRU4gICAgIChXTklfQ0ZHX01CX0hEUl9MRU4gKyBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV05JX0NGR19HRVRfQVRUUklCX1JTUF9OVU0gPDwgMikpCisKKy8vIEF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NfRU5EICAgICA1CisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKy8qIEhERCB0byBDRkcgbWVzc2FnZSB0eXBlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyNkZWZpbmUgV05JX0NGR19ETkxEX1JTUCAgICAgICAgICAgICAgIChXTklfQ0ZHX01TR19UWVBFU19CRUdJTiB8IDB4ODApCisjZGVmaW5lIFdOSV9DRkdfR0VUX1JFUSAgICAgICAgICAgICAgICAoV05JX0NGR19NU0dfVFlQRVNfQkVHSU4gfCAweDgxKQorI2RlZmluZSBXTklfQ0ZHX1NFVF9SRVEgICAgICAgICAgICAgICAgKFdOSV9DRkdfTVNHX1RZUEVTX0JFR0lOIHwgMHg4MikKKyNkZWZpbmUgV05JX0NGR19TRVRfUkVRX05PX1JTUCAgICAgICAgIChXTklfQ0ZHX01TR19UWVBFU19CRUdJTiB8IDB4ODMpIC8vTm8gUlNQIGZvciB0aGlzIHNldAorCisvLyBTaGFsbCBiZSByZW1vdmVkIGFmdGVyIHN0YXRzIGludGVncmF0aW9uCisKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworLyogSEREIHRvIENGRyBtZXNzYWdlIHBhcmFtdGVyIGluZGljZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICBUaGUgZm9sbG93aW5ncyBhcmUgd29yZCBpbmRpY2VzIHN0YXJ0aW5nIGZyb20gdGhlIG1lc3NhZ2UgYm9keSAgICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICBXTklfQ0ZHX3h4eHhfeHh4eF94eHh4OiAgICAgICAgIGluZGV4IG9mIHBhcmFtZXRlciAgICAgICAgICAgICAgICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICBXTklfQ0ZHX3h4eHhfeHh4eF9OVU06ICAgICAgICAgIG51bWJlciBvZiBwYXJhbWV0ZXJzIGluIG1lc3NhZ2UgICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICBXTklfQ0ZHX3h4eHhfeHh4eF9MRU46ICAgICAgICAgIGJ5dGUgbGVuZ3RoIG9mIG1lc3NhZ2UgaW5jbHVkaW5nICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1CIGhlYWRlciAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICBXTklfQ0ZHX3h4eHhfeHh4eF9QQVJUSUFMX0xFTjogIGJ5dGUgbGVuZ3RoIG9mIG1lc3NhZ2UgaW5jbHVkaW5nICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtZXRlcnMgYW5kIE1CIGhlYWRlciBidXQgICAgICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4Y2x1ZGluZyB2YXJpYWJsZSBkYXRhIGxlbmd0aCAgICAqLworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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wKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXTklfQ0ZHX0FERF9HUlBfQUREUl9SRVFfTlVNIDw8IDIpKQorLy8gRGVsZXRlIGdyb3VwIGFkZHJlc3MgcmVxdWVzdAorI2RlZmluZSBXTklfQ0ZHX0RFTF9HUlBfQUREUl9SRVFfTUFDX0FERFIgICAgMAorCisjZGVmaW5lIFdOSV9DRkdfREVMX0dSUF9BRERSX1JFUV9OVU0gICAxCisjZGVmaW5lIFdOSV9DRkdfREVMX0dSUF9BRERSX1JFUV9MRU4gICAoV05JX0NGR19NQl9IRFJfTEVOICsgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFdOSV9DRkdfREVMX0dSUF9BRERSX1JFUV9OVU0gPDwgMikpCisqLworCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKy8qIENGRyByZXR1cm4gdmFsdWVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyNkZWZpbmUgV05JX0NGR19TVUNDRVNTICAgICAgICAgICAgIDEKKyNkZWZpbmUgV05JX0NGR19OT1RfUkVBRFkgICAgICAgICAgIDIKKyNkZWZpbmUgV05JX0NGR19JTlZBTElEX1BJRCAgICAgICAgIDMKKyNkZWZpbmUgV05JX0NGR19JTlZBTElEX0xFTiAgICAgICAgIDQKKyNkZWZpbmUgV05JX0NGR19ST19QQVJBTSAgICAgICAgICAgIDUKKyNkZWZpbmUgV05JX0NGR19XT19QQVJBTSAgICAgICAgICAgIDYKKyNkZWZpbmUgV05JX0NGR19JTlZBTElEX1NUQUlEICAgICAgIDc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ICAgICAgICAgICAgICAgIDMKKyNkZWZpbmUgV05JX1NUQVRfTVVMVElfQ05UICAgICAgICAgICAgICAgICA0CisjZGVmaW5lIFdOSV9TVEFUX0RVUExfRlJBR19DTlQgICAgICAgICAgICAgNQorI2RlZmluZSBXTklfU1RBVF9UT1RBTF9CWVRFX0NOVCAgICAgICAgICAgIDYKKyNkZWZpbmUgV05JX1NUQVRfUEtUX0RST1BfQ05UICAgICAgICAgICAgICA3CisjZGVmaW5lIFdOSV9TVEFUX1BLVDY0X0NOVCAgICAgICAgICAgICAgICAgOAorI2RlZmluZSBXTklfU1RBVF9QS1QxMjdfQ05UICAgICAgICAgICAgICAgIDkKKyNkZWZpbmUgV05JX1NUQVRfUEtUMjU1X0NOVCAgICAgICAgICAgICAgIDEwCisjZGVmaW5lIFdOSV9TVEFUX1BLVDUxMV9DTlQgICAgICAgICAgICAgICAxMQorI2RlZmluZSBXTklfU1RBVF9QS1QxMDIzX0NOVCAgICAgICAgICAgICAgMTIKKyNkZWZpbmUgV05JX1NUQVRfUEtUMTUxOF9DTlQgICAgICAgICAgICAgIDEzIAorI2RlZmluZSBXTklfU1RBVF9QS1QyMDQ3X0NOVCAgICAgICAgICAgICAgMTQKKyNkZWZpbmUgV05JX1NUQVRfUEtUNDA5NV9DTlQgICAgICAgICAgICAgIDE1CisjZGVmaW5lIFdOSV9TVEFUX0ZSQUdfQ05UICAgICAgICAgICAgICAgICAxNgorI2RlZmluZSBXTklfU1RBVF9GQ1NfQ05UICAgICAgICAgICAgICAgICAgMTcKKyNkZWZpbmUgV05JX1NUQVRfQlNTSURfTUlTU19DTlQgICAgICAgICAgIDE4CisjZGVmaW5lIFdOSV9TVEFUX1BEVV9FUlJfQ05UICAgICAgICAgICAgICAxOQorI2RlZmluZSBXTklfU1RBVF9EU1RfTUlTU19DTlQgICAgICAgICAgICAgMjAKKyNkZWZpbmUgV05JX1NUQVRfRFJPUF9DTlQgICAgICAgICAgICAgICAgIDIxCisjZGVmaW5lIFdOSV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zIgbGVuZ3RoLCBpbnQgbm90aWZ5TW9kKQoreworICAgIHRBTklfVTggICAgICAgKnBEc3QsICpwRHN0RW5kOworICAgIHRBTklfVTMyICAgICAgaW5kZXgsIHBhcmFtTGVuLCBjb250cm9sLCBtYXNrOworICAgIHRTaXJSZXRTdGF0dXMgIHJldFZhbDsKKworICAgIGlmIChjZmdJZCA+PSBDRkdfUEFSQU1fTUFYX05VTSkKKyAgICB7CisgICAgICAgIFBFTE9HRShjZmdMb2cocE1hYywgTE9HRSwgRkwoIkludmFsaWQgY2ZnIGlkICVkIiksIGNmZ0lkKTspCisgICAgICAgIHJldHVybiBlU0lSX0NGR19JTlZBTElEX0lEOworICAgIH0KKyAgICBpZiAoIXBNYWMtPmNmZy5nQ2ZnRW50cnkpCisgICAgeworICAgICAgICBQRUxPR0UoY2ZnTG9nKHBNYWMsIExPR0UsIEZMKCJnQ2ZnRW50cnkgaXMgTlVMTCIpKTspCisgICAgICAgIHJldHVybiBlU0lSX0NGR19JTlZBTElEX0lEOworICAgIH0KKworICAgIGNvbnRyb2wgID0gcE1hYy0+Y2ZnLmdDZmdFbnRyeVtjZmdJZF0uY29udHJvbDsKKyAgICBpbmRleCAgICA9IGNvbnRyb2wgJiBDRkdfQlVGX0lORFhfTUFTSzsKKyAgICByZXRWYWwgICA9IGVTSVJfU1VDQ0VTUzsKKworICAgIC8vIENoZWNrIGlmIHBhcmFtZXRlciBpcyB2YWxpZAorICAgIGlmICgoY29udHJvbCAmIENGR19DVExfVkFMSUQpID09IDApCisgICAgeworICAgICAgICBQRUxPR0UoY2ZnTG9nKHBNYWMsIExPR0UsIEZMKCJJbnZhbGlkIGNmZyBpZCAlZCIpLCBjZmdJZCk7KQorICAgICAgICByZXRWYWwgPSBlU0lSX0NGR19JTlZBTElEX0lEOworICAgIH0KKyAgICBlbHNlIGlmIChpbmRleCA+PSBDRkdfU1RBX1NCVUZfTUFYX1NJWkUpCisgICAgeworICAgICAgICBQRUxPR0UoY2ZnTG9nKHBNYWMsIExPR0UsIEZMKCJJbnZhbGlkIFNidWYgaW5kZXggJWQgKG1heCBzaXplICVkKSIpLAorICAgICAgICAgICAgICAgaW5kZXgsIENGR19TVEFfU0JVRl9NQVhfU0laRSk7KQorICAgICAgICByZXRWYWwgPSBlU0lSX0NGR19JTlZBTElEX0lEOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAgICAgcERzdCA9ICZwTWFjLT5jZmcuZ0NmZ1NCdWZbaW5kZXhdOworICAgICAgICAgICAgcGFyYW1MZW4gPSAqcERzdCsrOworICAgICAgICAgICAgaWYgKGxlbmd0aCA+IHBhcmFtTGVuKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFBFTE9HRShjZmdMb2cocE1hYywgTE9HRSwgRkwoIkludmFsaWQgbGVuZ3RoICVkICg+JWQpIGNmZyBpZCAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICBsZW5ndGgsIHBhcmFtTGVuLCBjZmdJZCk7KQorICAgICAgICAgICAgICAgIHJldFZhbCA9IGVTSVJfQ0ZHX0lOVkFMSURfTEVOOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICpwRHN0KysgPSAodEFOSV9VOClsZW5ndGg7CisgICAgICAgICAgICAgICAgcERzdEVuZCA9IHBEc3QgKyBsZW5ndGg7CisgICAgICAgICAgICAgICAgd2hpbGUgKHBEc3QgPCBwRHN0RW5kKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgKnBEc3QrKyA9ICpwU3RyKys7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYobm90aWZ5TW9kKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gVXBkYXRlIGhhcmR3YXJlIGlmIG5lY2Vzc2FyeQorICAgICAgICAgICAgICAgICAgICBtYXNrID0gY29udHJvbCAmIENGR19DVExfTlRGX01BU0s7CisgICAgICAgICAgICAgICAgICAgIGlmICgobWFzayAmIENGR19DVExfTlRGX0hXKSAhPSAwKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBQRUxPR0UoY2ZnTG9nKHBNYWMsIExPR0UsIEZMKCJDRkcgTm90aWZ5IEhXIG5vdCBzdXBwb3J0ZWQhISEiKSk7KQorICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLy8gTm90aWZ5IG90aGVyIG1vZHVsZXMgaWYgbmVjZXNzYXJ5CisgICAgICAgICAgICAgICAgICAgIGlmICggKG1hc2sgJiBDRkdfQ1RMX05URl9NQVNLKSAhPSAwKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBOb3RpZnkocE1hYywgY2ZnSWQsIG1hc2spOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgIH0KKworICAgIHJldHVybiAocmV0VmFsKTsKKworfSAvKioqIGVuZCBjZmdTZXRTdHJOb3RpZnkoKSAqKiovCisKKy8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorLyoqCisgKiB3bGFuX2NmZ0dldFN0cigpCisgKgorICogRlVOQ1RJT046CisgKiBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCB0byBnZXQgYSBzdHJpbmcgcGFyYW1ldGVyLgorICoKKyAqIExPR0lDOgorICoKKyAqIEFTU1VNUFRJT05TOgorICogLSBIb3N0IFJXIHBlcm1pc3Npb24gc2hvdWxkIGJlIGNoZWNrZWQgcHJpb3IgdG8gY2FsbGluZyB0aGlzCisgKiAgIGZ1bmN0aW9uLgorICoKKyAqIE5PVEU6CisgKgorICogQHBhcmFtIGNmZ0lkOiAgICAgMTYtYml0IENGRyBwYXJhbWV0ZXIgSUQKKyA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nR2V0U3RyKHBNYWMsIGNmZ0lkLCBwQ291bnRyeUluZm8sICZjZmdMZW5ndGgpICE9IGVTSVJfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZShwQ291bnRyeUluZm8pOworICAgICAgICBwQ291bnRyeUluZm8gPSBOVUxMOworICAgICAgICAgICAgCisgICAgICAgIGNmZ0xvZyhwTWFjLCBMT0dQLCBGTCgiRmFpbGVkIHRvIHJldHJpZXZlIDExZCBjb25maWd1cmF0aW9uIHBhcmFtZXRlcnMgd2hpbGUgcmV0cmlldmluZyAxMWQgdHVwbGVzIikpOworICAgICAgICBnb3RvIGVycm9yOworICAgIH0KKyAgICAvKiBJZGVudGlmeSB0aGUgY2hhbm5lbCBhbmQgbWF4dHhwb3dlciAqLworICAgIHdoaWxlKGNvdW50IDw9IChjZmdMZW5ndGggLSAoc2l6ZW9mKHRTaXJNYWNDaGFuSW5mbykpKSkKKyAgICB7CisgICAgICAgIHRBTklfVTggICAgZmlyc3RDaGFubmVsLCBtYXhDaGFubmVsczsKKworICAgICAgICBmaXJzdENoYW5uZWwgPSBwQ291bnRyeUluZm9bY291bnQrK107CisgICAgICAgIG1heENoYW5uZWxzID0gcENvdW50cnlJbmZvW2NvdW50KytdOworICAgICAgICBtYXhUeFB3ciA9IHBDb3VudHJ5SW5mb1tjb3VudCsrXTsKKworICAgICAgICBpZigoY2hhbm5lbCA+PSBmaXJzdENoYW5uZWwpICYmIAorICAgICAgICAgICAgKGNoYW5uZWwgPCAoZmlyc3RDaGFubmVsICsgbWF4Q2hhbm5lbHMpKSkKKyAgICAgICAgeworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisKK2Vycm9yOgorICAgIGlmIChOVUxMICE9IHBDb3VudHJ5SW5mbykKKyAgICAgICAgdm9zX21lbV9mcmVlKHBDb3VudHJ5SW5mbyk7CisgICAgICAgCisgICAgcmV0dXJuIG1heFR4UHdyOworfQorCisKKy8qKi0tLS0tLS0tL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IC8vIEVTUyBiaXQKKyAgICBlbHNlIGlmIChsaW1HZXRTeXN0ZW1Sb2xlKHNlc3Npb25FbnRyeSkgPT0gZUxJTV9QMlBfREVWSUNFX1JPTEUgKQorICAgIHsKKyAgICAgICAgcENhcEluZm8tPmVzcyA9IDA7CisgICAgICAgIHBDYXBJbmZvLT5pYnNzID0gMDsKKyAgICB9CisgICAgZWxzZQorICAgICAgICBjZmdMb2cocE1hYywgTE9HUCwgRkwoImNhbid0IGdldCBjYXBhYmlsaXR5LCByb2xlIGlzIFVOS05PV04hISIpKTsKKworCisgICAgaWYoc3lzdGVtUm9sZSA9PSBlTElNX0FQX1JPTEUpCisgICAgeworICAgICAgICB2YWwgPSBzZXNzaW9uRW50cnktPnByaXZhY3k7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIC8vIFBSSVZBQ1kgYml0CisgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX1BSSVZBQ1lfRU5BQkxFRCwgJnZhbCkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICBjZmdMb2cocE1hYywgTE9HUCwgRkwoImNmZyBnZXQgV05JX0NGR19QUklWQUNZX0VOQUJMRUQgZmFpbGVkIikpOworICAgICAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICAgICAgfQorICAgIH0KKyAgICBpZiAodmFsKQorICAgICAgICBwQ2FwSW5mby0+cHJpdmFjeSA9IDE7CisKKyAgICAvLyBTaG9ydCBwcmVhbWJsZSBiaXQKKyAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19TSE9SVF9QUkVBTUJMRSwgJnZhbCkgIT0gZVNJUl9TVUNDRVNTKQorICAgIHsKKyAgICAgICAgY2ZnTG9nKHBNYWMsIExPR1AsIEZMKCJjZmcgZ2V0IFdOSV9DRkdfU0hPUlRfUFJFQU1CTEUgZmFpbGVkIikpOworICAgICAgICByZXR1cm4gZV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BQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SCisgKiBQRVJGT1JNQU5DRSBPRiBUSElTIFNPRlRXQVJFLgorICovCisKKy8qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIAorICBcZmlsZSAgY2ZnRGVidWcuYworICAKKyAgXGJyaWVmIGltcGxlbWVudGF0aW9uIGZvciBsb2cgRGVidWcgcmVsYXRlZCBBUElzCisKKyAgXGF1dGhvciBTdW5pdCBCaGF0aWEKKyAgCisgIAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisjaW5jbHVkZSAiY2ZnRGVidWcuaCIKKwordm9pZCBjZmdMb2codHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMzIgbG9nbGV2ZWwsIGNvbnN0IGNoYXIgKnBTdHJpbmcsLi4uKSAKK3sKKyNpZmRlZiBXTEFOX0RFQlVHCisgICAgLy8gVmVyaWZ5IGFnYWluc3QgY3VycmVudCBsb2cgbGV2ZWwKKyAgICBpZiAobG9nbGV2ZWwgPiBwTWFjLT51dGlscy5nTG9nRGJnTGV2ZWxbTE9HX0lOREVYX0ZPUl9NT0RVTEUoIFNJUl9DRkdfTU9EVUxFX0lEICldKQorICAgICAgICByZXR1cm47CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgdmFfbGlzdCBtYX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LgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisvKgorICoKKyAqIFRoaXMgaXMgdGhlIHByaXZhdGUgaGVhZGVyIGZpbGUgZm9yIENGRyBtb2R1bGUuCisgKgorICogQXV0aG9yOiAgICAgICAgS2V2aW4gTmd1eWVuCisgKiBEYXRlOiAgICAgICAgMDMvMjAvMDIKKyAqIEhpc3Rvcnk6LQorICogMDMvMjAvMDIgICAgICAgIENyZWF0ZWQuCisgKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICoKKyAqLworCisjaWZuZGVmIF9fQ0ZHREVGX0gKKyNkZWZpbmUgX19DRkdERUZfSAorCisvKgorICogQ0ZHIENvbnRyb2wgRmxhZyBkZWZpbml0aW9ucworICovCisjZGVmaW5lIENGR19DVExfVkFMSUQgICAgICAgICAweDAwMDEwMDAwCisjZGVmaW5lIENGR19DVExfUkUgICAgICAgICAgICAweDAwMDIwMDAwCisjZGVmaW5lIENGR19DVExfV0UgICAgICAgICAgICAweDAwMDQwMDAwCisjZGVmaW5lIENGR19DVExfSU5UICAgICAgICAgICAweDAwMDgwMDAwCisjZGVmaW5lIENGR19DVExfU0FWRSAgICAgICAgICAweDAwMTAwMDAwCisjZGVmaW5lIENGR19DVExfUkVTVEFSVCAgICAgICAweDAwMjAwMDAwCisjZGVmaW5lIENGR19DVExfUkVMT0FEICAgICAgICAweDAwNDAwMDAwCisjZGVmaW5lIENGR19DVExfTlRGX1BIWSAgICAgICAweDAwODAwMDAwCisjZGVmaW5lIENGR19DVExfTlRGX01BQyAgICAgICAweDAxMDAwMDAwCisjZGVmaW5lIENGR19DVExfTlRGX0xPRyAgICAgICAweDAyMDAwMDAwCisjZGVmaW5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bnNpZ25lZCBjaGFyICopIkVEQ0FfQU5JX0FDVkkiLAorICAgICh1bnNpZ25lZCBjaGFyICopIkVEQ0FfQU5JX0FDVk8iLAorICAgICh1bnNpZ25lZCBjaGFyICopIkVEQ0FfV01FX0FDQktfTE9DQUwiLAorICAgICh1bnNpZ25lZCBjaGFyICopIkVEQ0FfV01FX0FDQkVfTE9DQUwiLAorICAgICh1bnNpZ25lZCBjaGFyICopIkVEQ0FfV01FX0FDVklfTE9DQUwiLAorICAgICh1bnNpZ25lZCBjaGFyICopIkVEQ0FfV01FX0FDVk9fTE9DQUwiLAorICAgICh1bnNpZ25lZCBjaGFyICopIkVEQ0FfV01FX0FDQksiLAorICAgICh1bnNpZ25lZCBjaGFyICopIkVEQ0FfV01FX0FDQkUiLAorICAgICh1bnNpZ25lZCBjaGFyICopIkVEQ0FfV01FX0FDVkkiLAorICAgICh1bnNpZ25lZCBjaGFyICopIkVEQ0FfV01FX0FDVk8iLAorICAgICh1bnNpZ25lZCBjaGFyICopIkVEQ0FfVElUX0RFTU9fQUNCS19MT0NBTCIsCisgICAgKHVuc2lnbmVkIGNoYXIgKikiRURDQV9USVRfREVNT19BQ0JFX0xPQ0FMIiwKKyAgICAodW5zaWduZWQgY2hhciAqKSJFRENBX1RJVF9ERU1PX0FDVklfTE9DQUwiLAorICAgICh1bnNpZ25lZCBjaGFyICopIkVEQ0FfVElUX0RFTU9fQUNWT19MT0NBTCIsCisgICAgKHVuc2lnbmVkIGNoYXIgKikiRURDQV9USVRfREVNT19BQ0JLIiwKKyAgICAodW5zaWduZWQgY2hhciAqKSJFRENBX1RJVF9ERU1PX0FDQkUiLAorICAgICh1bnNpZ25lZCBjaGFyICopIkVEQ0FfVElUX0RFTU9fQUNWSSIsCisgICAgKHVuc2lnbmVkIGNoYXIgKikiRURDQV9USVRfREVNT19BQ1ZPIiwKKyAgICAodW5zaWduZWQgY2hhciAqKSJSREVUX0ZMQUciLAorICAgICh1bnNpZ25lZCBjaGFyICopIlJBREF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BVVRPX0JTU0lEIiwKKyAgICAodW5zaWduZWQgY2hhciAqKSJQUk9CRV9SRVFfQURETklFX0ZMQUciLAorICAgICh1bnNpZ25lZCBjaGFyICopIlBST0JFX1JFUV9BREROSUVfREFUQSIsCisgICAgKHVuc2lnbmVkIGNoYXIgKikiUFJPQkVfUlNQX0FERE5JRV9GTEFHIiwKKyAgICAodW5zaWduZWQgY2hhciAqKSJQUk9CRV9SU1BfQURETklFX0RBVEExIiwKKyAgICAodW5zaWduZWQgY2hhciAqKSJQUk9CRV9SU1BfQURETklFX0RBVEEyIiwKKyAgICAodW5zaWduZWQgY2hhciAqKSJQUk9CRV9SU1BfQURETklFX0RBVEEzIiwKKyAgICAodW5zaWduZWQgY2hhciAqKSJBU1NPQ19SU1BfQURETklFX0ZMQUciLAorICAgICh1bnNpZ25lZCBjaGFyICopIkFTU09DX1JTUF9BREROSUVfREFUQSIsCisgICAgKHVuc2lnbmVkIGNoYXIgKikiUFJPQkVfUkVRX0FERE5QMlBJRV9GTEFHIiwKKyAgICAodW5zaWduZWQgY2hhciAqKSJQUk9CRV9SRVFfQURETlAyUElFX0RBVEEiLAorICAgICh1bnNpZ25lZCBjaGFyICopIlBST0JFX1JTUF9CQ05fQURETklFX0ZMQUciLAorICAgICh1bnNpZ25lZCBjaGFyICopIlBST0JFX1JTUF9CQ05fQURETklFX0RBVEEiLAorICAgICh1bnNpZ25lZCBjaGFyICopIldQU19FTkFCTEUiLAorICAgICh1bnNpZ25lZCBjaGFyICopIldQU19TVEFURSIsCisgICAgKHVuc2lnbmVkIGNoYXIgKikiV1BTX1BST0JFX1JFUV9GTEFHIiwKKyAgICAodW5zaWduZWQgY2hhciAqKSJXUFNfVkVSU0lPTiIsCisgICAgKHVuc2lnbmVkIGNoYXIgKikiV1BTX1JFUVVFU1RfVFlQRSIsCisgICAgKHVuc2lnbmVkIGNoYXIgKikiV1BTX0NGR19NRVRIT0QiLAorICAgICh1bnNpZ25lZCBjaGFyICopIldQU19VVUlEIiw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hPSBleHBMZW4pCisgICAgeworICAgICAgICBQRUxPR0UoY2ZnTG9nKHBNYWMsIExPR0UsIEZMKCI8Q0ZHPiBETkxEX1JTUCBpbnZhbGlkIGxlbmd0aCAlZCAoZXhwICVkKSIpLAorICAgICAgICAgICAgICAgbGVuZ3RoLCBleHBMZW4pOykKKyAgICAgICAgcmV0VmFsID0gV05JX0NGR19JTlZBTElEX0xFTjsKKyAgICAgICAgZ290byBlbmQ7CisgICAgfQorCisKKyAgICBpZiAocEhkci0+Y29udHJvbFNpemUgIT0gQ0ZHX1BBUkFNX01BWF9OVU0pCisgICAgeworICAgICAgICBQRUxPR0UoY2ZnTG9nKHBNYWMsIExPR0UsIEZMKCI8Q0ZHPiBUb3RhbCBwYXJhbWV0ZXIgY291bnQgbWlzbWF0Y2giKSk7KQorICAgICAgICByZXRWYWwgPSBXTklfQ0ZHX0lOVkFMSURfTEVOOworICAgICAgICBnb3RvIGVuZDsKKyAgICB9CisKKyAgICBpZiAocEhkci0+aUJ1ZlNpemUgIT0gcE1hYy0+Y2ZnLmdDZmdNYXhJQnVmU2l6ZSkKKyAgICB7CisgICAgICAgIFBFTE9HRShjZmdMb2cocE1hYywgTE9HRSwgRkwoIjxDRkc+IEludGVnZXIgcGFyYW1ldGVyIGNvdW50IG1pc21hdGNoIikpOykKKyAgICAgICAgcmV0VmFsID0gV05JX0NGR19JTlZBTElEX0xFTjsKKyAgICAgICAgZ290byBlbmQ7CisgICAgfQorCisgICAgLy8gQ29weSBjb250cm9sIGFycmF5CisgICAgcERzdCA9ICh0QU5JX1UzMiopcE1hYy0+Y2ZnLmdDZmdFbnRyeTsKKyAgICBwRHN0RW5kID0gcERzdCArIENGR19QQVJBTV9NQVhfTlVNOworICAgIHBTcmMgPSBwUGFyYW07CisgICAgd2hpbGUgKHBEc3QgPCBwRHN0RW5kKQorICAgIHsKKyAgICAgICAgKnBEc3QrKyA9ICpwU3JjKys7CisgICAgfQorICAgIC8vIENvcHkgZGVmYXVsdCB2YWx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ydDsKKyAgICB9CisKKyAgICAvLyBJbml0aWFsaXplIHN0cmluZyBkZWZhdWx0cworICAgIHN0clNpemUgPSBwSGRyLT5zQnVmU2l6ZTsKKyAgICB3aGlsZSAoc3RyU2l6ZSkKKyAgICB7CisgICAgICAgIHRBTklfVTMyIHBhcmFtSWQsIHBhcmFtTGVuLCBwYXJhbUxlbkNlaWw0OworCisgICAgICAgIGlmIChzdHJTaXplIDwgNCkKKyAgICAgICAgeworICAgICAgICAgICAgUEVMT0dFKGNmZ0xvZyhwTWFjLCBMT0dFLCBGTCgiRXJyb3IgcGFyc2luZyBzdHIgZGVmYXVsdHMsIHJlbSAlZCBieXRlcyIpLCBzdHJTaXplKTspCisgICAgICAgICAgICByZXRWYWwgPSBXTklfQ0ZHX0lOVkFMSURfTEVOOworICAgICAgICAgICAgZ290byBlbmQ7CisgICAgICAgIH0KKyAgICAgICAgcGFyYW1JZCA9ICpwU3JjID4+IDE2OworICAgICAgICBwYXJhbUxlbiA9ICpwU3JjICYgMHhmZjsKKyAgICAgICAgcFNyYysrOworICAgICAgICBzdHJTaXplIC09IDQ7CisKKyAgICAgICAgcGFyYW1MZW5DZWlsNCA9ICgocGFyYW1MZW4gKyAzKSA+PiAyKTsKKyAgICAgICAgaWYgKHN0clNpemUgPCBwYXJhbUxlbkNlaWw0IDw8IDIpCisgICAgICAgIHsKKyAgICAgICAgICAgIFBFTE9HRShjZmdMb2cocE1hYywgTE9HRSwgRkwoIkVycm9yIHBhcnNpbmcgc3RyIGRlZmF1bHRzLCByZW0gJWQgYnl0ZXMiKSwgc3RyU2l6ZSk7KQorICAgICAgICAgICAgUEVMT0dFKGNmZ0xvZyhwTWFjLCBMT0dFLCBGTCgicGFyYW0gaWQgJWQgbGVuICVkIGJ5dGVzIiksIHBhcmFtSWQsIHBhcmFtTGVuKTspCisgICAgICAgICAgICByZXRWYWwgPSBXTklfQ0ZHX0lOVkFMSURfTEVOOworICAgICAgICAgICAgZ290byBlbmQ7CisgICAgICAgIH0KKyAgICAgICAgZm9yIChqPTA7IGogPCBwYXJhbUxlbkNlaWw0OyBqKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIHBTdHJbNCpqXSA9ICh0QU5JX1U4KSAoKnBTcmMgPj4gMjQpICYgMHhmZjsKKyAgICAgICAgICAgIHBTdHJbNCpqKzFdID0gKHRBTklfVTgpICgqcFNyYyA+PiAxNikgJiAweGZmOworICAgICAgICAgICAgcFN0cls0KmorMl0gPSAodEFOSV9VOCkgKCpwU3JjID4+IDgpICYgMHhmZjsKKyAgICAgICAgICAgIHBTdHJbNCpqKzNdID0gKHRBTklfVTgpICgqcFNyYykgJiAweGZmOworCisgICAgICAgICAgICBwU3JjKys7CisgICAgICAgICAgICBzdHJTaXplIC09IDQ7CisgICAgICAgIH0KKworICAgICAgICBQRUxPRzEoY2ZnTG9nKHBNYWMsIExPRzEsIEZMKCJzZXQgc3RyIGlkICVkIGxlbiAlZCIpLCBwYXJhbUlkLCBwYXJhbUxlbik7KQorCisgICAgICAgIGlmIChjZmdTZXRTdHIocE1hYywgKHRBTklfVTE2KSBwYXJhbUlkLCBwU3RyLCBwYXJhbUxlbikgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICBQRUxPR0UoY2ZnTG9nKHBNYWMsIExPR0UsIEZMKCJFcnJvciBzZXR0aW5nIHN0ciBkZWZhdWx0IHBhcmFtICVkIGxlbiAlZCIpLCBwYXJhbUlkLCBwYXJhbUxlbik7KQorICAgICAgICAgICAgcmV0VmFsID0gV05JX0NGR19JTlZBTElEX0xFTjsKKyAgICAgICAgICAgIGdvdG8gZW5kOworICAgICAgICB9CisgICAgfQorCisgICAgLy8gU2V0IHRoZSBkZWZhdWx0IGxvZyBsZXZlbCBiYXNlZCBvbiBjb25maWcKKyAgICB3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0xPR19MRVZFTCwgJmxvZ0xldmVsKTsKKyAgICBmb3IgKGkgPSAwOyBpIDwgTE9HX0VO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AgICAgICAgICAgIHBWYWx1ZSAgID0gMDsKKyAgICAgICAgICAgIHZhbHVlTGVuID0gMDsKKworICAgICAgICAgICAgUEVMT0cxKGNmZ0xvZyhwTWFjLCBMT0cxLCBGTCgiQ2ZnIGdldCBwYXJhbSAlZCIpLCBjZmdJZCk7KQorCisgICAgICAgICAgICAvLyBDaGVjayBmb3IgdmFsaWQgcGFyYW1ldGVyIElELCBldGMuLi4KKyAgICAgICAgICAgIGlmIChDaGVja1BhcmFtKHBNYWMsIGNmZ0lkLCBDRkdfQ1RMX1JFLCBXTklfQ0ZHX1dPX1BBUkFNLCAmcmVzdWx0KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoKHBNYWMtPmNmZy5nQ2ZnRW50cnlbY2ZnSWRdLmNvbnRyb2wgJiBDRkdfQ1RMX0lOVCkgIT0gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vIEdldCBpbnRlZ2VyIHBhcmFtZXRlcgorICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAod2xhbl9jZmdHZXRJbnQocE1hYywgY2ZnSWQsICZ2YWx1ZSkgPT0gZVNJUl9TVUNDRVNTID8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfU1VDQ0VTUyA6IFdOSV9DRkdfT1RIRVJfRVJST1IpOworICAgICAgICAgICAgICAgICAgICBwVmFsdWUgICA9ICZ2YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgdmFsdWVMZW4gPSBzaXplb2YodEFOSV9VMzIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvLyBHZXQgc3RyaW5nIHBhcmFtZXRlcgorICAgICAgICAgICAgICAgICAgICB2YWx1ZUxlbiA9IHNpemVvZihwTWFjLT5jZmcuZ1NCdWZmZXIpOworICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAod2xhbl9jZmdHZXRTdHIocE1hYywgY2ZnSWQsIHBNYWMtPmNmZy5nU0J1ZmZlciwgJnZhbHVlTGVuKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gZVNJUl9TVUNDRVNTID8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfU1VDQ0VTUyA6IFdOSV9DRkdfT1RIRVJfRVJST1IpOworICAgICAgICAgICAgICAgICAgICBwVmFsdWUgPSAodEFOSV9VMzIqKXBNYWMtPmNmZy5nU0J1ZmZlcjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgUEVMT0dFKGNmZ0xvZyhwTWFjLCBMT0dFLCBGTCgiQ2hlY2sgcGFyYW0gZmFpbGVkLCBwYXJhbSAlZCIpLCBjZmdJZCk7KQorICAgICAgICAgICAgICAgIHJlc3VsdCA9IFdOSV9DRkdfSU5WQUxJRF9MRU47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIFNlbmQgcmVzcG9uc2UgbWVzc2FnZSB0byBob3N0CisgICAgICAgICAgICBwYXJhbUxpc3RbV05JX0NGR19HRVRfUlNQX1JFU10gID0gcmVzdWx0OworICAgICAgICAgICAgcGFyYW1MaXN0W1dOSV9DRkdfR0VUX1JTUF9QSURdICA9IGNmZ0lkOworICAgICAgICAgICAgcGFyYW1MaXN0W1dOSV9DRkdfR0VUX1JTUF9QTEVOXSA9IHZhbHVlTGVuOworCisgICAgICAgICAgICAvLyBXZSBuZWVkIHRvIHJvdW5kIHVwIGJ1ZmZlciBsZW5ndGggdG8gd29yZC1pbmNyZW1lbnQKKyAgICAgICAgICAgIHZhbHVlTGVuID0gKCgodmFsdWVMZW4gKyAzKSA+PiAyKSA8PCAyKTsKKyAgICAgICAgICAgIGNmZ1NlbmRIb3N0TXNnKHBNYWMsIFdOSV9DRkdfR0VUX1JTUCwKKy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CisgICAgICAgICAgICAgICAgLy8gUHJvY2VzcyBpbnRlZ2VyIHBhcmFtZXRlcgorICAgICAgICAgICAgICAgIGlmICgocE1hYy0+Y2ZnLmdDZmdFbnRyeVtjZmdJZF0uY29udHJvbCAmIENGR19DVExfSU5UKSAhPSAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gU2V0IFZBTFVFCisgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZUxlbiAhPSBzaXplb2YodEFOSV9VMzIpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBQRUxPR0UoY2ZnTG9nKHBNYWMsIExPR0UsIEZMKCJJbnZhbGlkIHZhbHVlIGxlbmd0aCAlZCBpbiBzZXQgcGFyYW0gJWQgKHRvdCAlZCkiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZUxlbiwgY2ZnSWQsIGxlbmd0aCk7KQorICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gV05JX0NGR19JTlZBTElEX0xFTjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gKnBQYXJhbTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFBFTE9HMShjZmdMb2cocE1hYywgTE9HVywgRkwoIkNmZyBzZXQgaW50ICVkIGxlbiAlZCglZCkgdmFsICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2ZnSWQsIHZhbHVlTGVuLCB2YWx1ZUxlblJvdW5kZWRVcDQsIHZhbHVlKTspCisgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAoY2ZnU2V0SW50KHBNYWMsIGNmZ0lkLCB2YWx1ZSkgPT0gZVNJUl9TVUNDRVNTID8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX1NVQ0NFU1MgOiBXTklfQ0ZHX09USEVSX0VSUk9SKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHQgPT0gV05JX0NGR19TVUNDRVNTKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjZmdOZWVkUmVzdGFydChwTWFjLCBjZmdJZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBXTklfQ0ZHX05FRURfUkVTVEFSVCA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNmZ05lZWRSZWxvYWQocE1hYywgY2ZnSWQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IFdOSV9DRkdfTkVFRF9SRUxPQUQgOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLy8gUHJvY2VzcyBzdHJpbmcgcGFyYW1ldGVyCisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlTGVuUm91bmRlZFVwNCA+IGxlbmd0aCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgUEVMT0dFKGNmZ0xvZyhwTWFjLCBMT0dFLCBGTCgiSW52YWxpZCBzdHJpbmcgbGVuZ3RoICVkIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpbiBzZXQgcGFyYW0gJWQgKHRvdCAlZCkiKSwgdmFsdWVMZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2ZnSWQsIGxlbmd0aCk7KQorICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gV05JX0NGR19JTlZBTElEX0xFTjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIEdldFN0clZhbHVlKCh0QU5JX1U4KilwUGFyYW0sIHBNYWMtPmNmZy5nU0J1ZmZlciwgdmFsdWVMZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgUEVMT0cxKGNmZ0xvZyhwTWFjLCBMT0dXLCBGTCgiQ2ZnIHNldCBzdHIgJWQgbGVuICVkKCVkKSBieXRlcyIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNmZ0lkLCB2YWx1ZUxlbiwgdmFsdWVMZW5Sb3VuZGVkVXA0KTspCisgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAoY2ZnU2V0U3RyKHBNYWMsIGNmZ0lkLCBwTWFjLT5jZmcuZ1NCdWZmZXIsIHZhbHVlTGVuKSA9PSBlU0lSX1NVQ0NFU1MgPworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfU1VDQ0VTUyA6IFdOSV9DRkdfT1RIRVJfRVJST1IpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCA9PSBXTklfQ0ZHX1NVQ0NFU1MpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNmZ05lZWRSZXN0YXJ0KHBNYWMsIGNmZ0lkKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IFdOSV9DRkdfTkVFRF9SRVNUQVJUIDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2ZnTmVlZFJlbG9hZChwTWFjLCBjZmdJZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gV05JX0NGR19ORUVEX1JFTE9BRCA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQRUxPR0UoY2ZnTG9nKHBNYWMsIExPR0UsIEZMKCJDaGVjayBwYXJhbSBmYWlsZWQsIHBhcmFtICVkIiksIGNmZ0lkKTspCisgICAgICAgICAgICAgICAgcmVzdWx0ID0gV05JX0NGR19JTlZBTElEX0xFTjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGZSc3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogU2VuZCBjb25maXJtIG1lc3NhZ2UgdG8gaG9zdCAqLworICAgICAgICAgICAgICAgIHBhcmFtTGlzdFtXTklfQ0ZHX1NFVF9DTkZfUkVTXSA9IHJlc3VsdDsKKyAgICAgICAgICAgICAgICBwYXJhbUxpc3RbV05JX0NGR19TRVRfQ05GX1BJRF0gPSBjZmdJZDsKKyAgICAgICAgICAgICAgICBjZmdTZW5kSG9zdE1zZyhwTWFjLCBXTklfQ0ZHX1NFVF9DTkYsIFdOSV9DRkdfU0VUX0NORl9MRU4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19TRVRfQ05GX05VTSwgcGFyYW1MaXN0LCAwLCAwK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OgorICoKKyAqIE5PVEU6CisgKgorICogQHBhcmFtIHBNYWM6IFBvaW50ZXIgdG8gTWFjIFN0cnVjdHVyZQorICoKKyAqIEByZXR1cm4gTm9uZQorICoKKyAqLworCit2b2lkCitwcm9jZXNzQ2ZnRG93bmxvYWRSZXEodHBBbmlTaXJHbG9iYWwgcE1hYykKK3sKKyAgICB0QU5JX1MzMiAgICBpOworICAgIHRBTklfVTMyICAgIGluZGV4OworICAgIHRBTklfVTggICAgICpwRHN0VGVzdCwgKnBTcmNUZXN0OworICAgIHRBTklfVTggICAgIGxlbjsKKyAgICB0QW5pU2lyQ2ZnU3RhdGljU3RyaW5nICpwU3RyQ2ZnOworICAgIHRBTklfVTMyICAgIGJ1ZlN0YXJ0LCBidWZFbmQ7CisgICAgdEFOSV9VMzIgICAgbG9nTGV2ZWwsIHJldFZhbDsKKyAgICB0QU5JX1UzMiBpQ291bnQgPSAwOworICAgIHRBTklfVTMyIHNDb3VudCA9IDA7CisKKworICAgIGZvciAoaT0wOyBpPENGR19QQVJBTV9NQVhfTlVNIDtpKyspCisgICAgeworICAgICAgICBpZiAoKGNmZ1N0YXRpY1tpXS5jb250cm9sICYgQ0ZHX0NUTF9WQUxJRCkgIT0gMCkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKCEoY2ZnU3RhdGljW2ldLmNvbnRyb2wgJiBDRkdfQ1RMX0lOVCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFN0ckNmZyA9ICh0QW5pU2lyQ2ZnU3RhdGljU3RyaW5nICopY2ZnU3RhdGljW2ldLnBTdHJEYXRhOworICAgICAgICAgICAgICAgIGlmIChwU3RyQ2ZnID09IE5VTEwpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBQRUxPR0UoY2ZnTG9nKHBNYWMsIExPR0UsIEZMKCJwU3RyQ2ZnIGlzIE5VTEwgZm9yIENmaWdJRCA6ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBpKTspCisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpbmRleCA9IHNDb3VudCAmIENGR19CVUZfSU5EWF9NQVNLOworICAgICAgICAgICAgICAgIHNDb3VudCArPSBwU3RyQ2ZnLT5tYXhMZW4gKyAxICsgMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpbmRleCA9IGlDb3VudCAmIENGR19CVUZfSU5EWF9NQVNLOworICAgICAgICAgICAgICAgIGlDb3VudCsrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgaW5kZXggPSAwOworICAgICAgICB9CisgICAgICAgIHBNYWMtPmNmZy5nQ2ZnRW50cnlbaV0uY29udHJvbCA9IGNmZ1N0YXRpY1tpXS5jb250cm9sIHwgaW5kZXg7CisgICAgfQorCisgICAgLypGaWxsIHRoZSBTQlVGIHdpaCBtYXhMZW5ndGgqLworICAgICBidWZFbmQgPSBwTWFjLT5jZmcuZ0NmZ01heFNCdWZTaXplOworICAgIGZvciAoaSA9IENGR19QQVJBTV9NQVhfTlVNIC0gMTsgaSA+PSAwOyBpLS0pCisgICAgeworICAgICAgICBpZiAoKHBNYWMtPmNmZy5nQ2ZnRW50cnlbaV0uY29udHJvbCAmIENGR19DVExfSU5UKSAhPSAwKQorICAgICAgICAgICAgY29udGludWU7CisKKyAgICAgICAgaWYgKChwTWFjLT5jZmcuZ0NmZ0VudHJ5W2ldLmNvbnRyb2wgJiBDRkdfQ1RMX1ZBTElEKSA9PSAwKQorICAgICAgICAgICAgY29udGludWU7CisKKyAgICAgICAgYnVmU3RhcnQgPSBwTWFjLT5jZmcuZ0NmZ0VudHJ5W2ldLmNvbnRyb2wgJiBDRkdfQlVGX0lORFhfTUFTSzsKKyAgICAgICAgcE1hYy0+Y2ZnLmdDZmdTQnVmW2J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RSkKKyAgICAgICAgICAgICAgICBjb250aW51ZTsKKworICAgICAgICAgICAgcERzdFRlc3QgPSAmcE1hYy0+Y2ZnLmdDZmdTQnVmW2luZGV4XTsKKyAgICAgICAgICAgIHBTdHJDZmcgPSAodEFuaVNpckNmZ1N0YXRpY1N0cmluZyAqKWNmZ1N0YXRpY1tpXS5wU3RyRGF0YTsKKyAgICAgICAgICAgIHBTcmNUZXN0ID0gcFN0ckNmZy0+ZGF0YTsKKyAgICAgICAgICAgIGlmICgocERzdFRlc3QgPT0gTlVMTCkgfHwgKHBTdHJDZmcgPT0gTlVMTCkgfHwgKHBTcmNUZXN0ID09IE5VTEwpKQorICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgbWF4U2F2ZWRMZW4gPSAqcERzdFRlc3Q7CisgICAgICAgICAgICBsZW4gPSBwU3RyQ2ZnLT5sZW5ndGg7CisgICAgICAgICAgICBpZiAobGVuID4gbWF4U2F2ZWRMZW4pCisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAqcERzdFRlc3QrKyA9IHBTdHJDZmctPm1heExlbjsKKyAgICAgICAgICAgICpwRHN0VGVzdCsrID0gbGVuOworICAgICAgICAgICAgd2hpbGUobGVuKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICpwRHN0VGVzdCsrID0gKnBTcmNUZXN0Kys7CisgICAgICAgICAgICAgICAgbGVuLS07CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvLyBTZXQgdGhlIGRlZmF1bHQgbG9nIGxldmVsIGJhc2VkIG9uIGNvbmZpZworICAgIHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfTE9HX0xFVkVMLCAmbG9nTGV2ZWwpOworICAgIGZvciAoaSA9IDA7IGkgPCBMT0dfRU5UUllfTlVNOyBpKyspCisgICAgICAgIHBNYWMtPnV0aWxzLmdMb2dFdnRMZXZlbFtpXSA9IHBNYWMtPnV0aWxzLmdMb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VyIHRoYW4gMCEiKSk7KQorICAgICAgICByZXR1cm47CisgICAgfQorICAgIGlmICgoZGF0YUxlbiA+IDApICYmIChOVUxMID09IHBEYXRhKSkKKyAgICB7CisgICAgICAgIFBFTE9HRShjZmdMb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICBGTCgicERhdGEgTlVMTCB3aGVuIGRhdGFMZW4gZ3JlYXRlciB0aGFuIDAhIikpOykKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIC8vIEFsbG9jYXRlIG1lc3NhZ2UgYnVmZmVyCisgICAgcE1zZyA9IHZvc19tZW1fbWFsbG9jKG1zZ0xlbik7CisgICAgaWYgKCBOVUxMID09IHBNc2cgKQorICAgIHsKKyAgICAgICAgUEVMT0dFKGNmZ0xvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgIEZMKCJNZW1vcnkgYWxsb2NhdGlvbiBmYWlsdXJlISIpKTspCisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICAvLyBGaWxsIGluIG1lc3NhZ2UgZGV0YWlscworICAgIG1taE1zZy50eXBlID0gbXNnVHlwZTsKKyAgICBtbWhNc2cuYm9keXB0ciA9IHBNc2c7CisgICAgbW1oTXNnLmJvZHl2YWwgPSAwOworICAgICgodFNpck1iTXNnKilwTXNnKS0+dHlwZSAgID0gbXNnVHlwZTsKKyAgICAoKHRTaXJNYk1zZyopcE1zZyktPm1zZ0xlbiA9ICh0QU5JX1UxNiltc2dMZW47CisKKyAgICBzd2l0Y2ggKG1zZ1R5cGUpCisgICAgeworICAgICAgICBjYXNlIFdOSV9DRkdfR0VUX1JTUDoKKyAgICAgICAgY2FzZSBXTklfQ0ZHX1BBUkFNX1VQREFURV9JTkQ6CisgICAgICAgIGNhc2UgV05JX0NGR19ETkxEX1JFUToKKyAgICAgICAgY2FzZSBXTklfQ0ZHX0ROTERfQ05GOgorICAgICAgICBjYXNlIFdOSV9DRkdfU0VUX0NORjoKKyAgICAgICAgICAgIC8vIEZpbGwgaW4gcGFyYW1ldGVycworICAgICAgICAgICAgcE1zZysrOworICAgICAgICAgICAgaWYgKE5VTEwgIT0gcFBhcmFtTGlzdCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwRW5kICA9IHBNc2cgKyBwYXJhbU51bTsKKyAgICAgICAgICAgICAgICB3aGlsZSAocE1zZyA8IHBFbmQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAqcE1zZysrID0gKnBQYXJhbUxpc3QrKzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBDb3B5IGRhdGEgaWYgdGhlcmUgaXMgYW55CisgICAgICAgICAgICBpZiAoTlVMTCAhPSBwRGF0YSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwRW5kID0gcE1zZyArIChkYXRhTGVuID4+IDIpOworICAgICAgICAgICAgICAgIHdoaWxlIChwTXNnIDwgcEVuZCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICpwTXNnKysgPSAqcERhdGErKzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICBQRUxPR0UoY2ZnTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIlVua25vd24gbXNnICVkISIpLCAoaW50KSBtc2dUeXBlKTspCisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUoIHBNc2cpOworICAgICAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIC8vIFNoaXAgaXQKKyAgICBNVFJBQ0UobWFjVHJhY2VNc2dUeChwTWFjLCBOT19TRVNTSU9OLCBtbWhNc2cudHlwZSkpOworICAgIFN5c1Byb2Nlc3NNbWhNc2cocE1hYywgJm1taE1zZyk7CisKK30gLyoqKiBlbmQgY2ZnU2VuZEhvc3RNc2coKSAqK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4TGVuICAgIHNlbUluZHgKKyogICAgIFtTVEEgZmxhZ3NdICAgICAgdmFsaWQgICAgUlcgICAgUC9OUCAgICBSRVNUQVJUL1JFTE9BRAorKiAgICAgW1NUQV9OVEZdICAgICAgICBub3RpZmljYXRpb25fbWFzaworKiAgICAgW1NUQSB2YWx1ZXNdICAgICBtaW4gICAgbWF4ICAgIHZhbHVlICBbZm9yIGludGVnZXJdCisqICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCBieXRlMSBieXRlMiAuLi4gW2ZvciBzdHJpbmddCisqICAgICBbQVAgZmxhZ3NdICAgICAgIHZhbGlkICAgIFJXL1JPL1dPICAgIFAvTlAgICAgUkVTVEFSVC9SRUxPQUQKKyogICAgIFtBUF9OVEZdICAgICAgICAgbm90aWZpY2F0aW9uX21hc2sKKyogICAgIFtBUCB2YWx1ZXNdICAgICAgbWluICAgIG1heCAgICB2YWx1ZSAgW2ZvciBpbnRlZ2VyXQorKiAgICAgICAgICAgICAgICAgICAgICBsZW5ndGggYnl0ZTEgYnl0ZTIgLi4uIFtmb3Igc3RyaW5nXQorKgorKiBwYXJhbWV0ZXJfbmFtZToKKyogICAgICAgICBUaGlzIHdpbGwgYmUgdXNlZCBhcyB0aGUgYmFzZSBuYW1lIGZvciBDIG1hY3JvIGRlZmluaXRpb24uCisqICAgICAgICAgVGhlcmVmb3JlLCBDIHN5bnRheCBydWxlIG11c3QgYmUgb2JzZXJ2ZWQuCisqCisqIHR5cGU6CisqICAgICAgICBTcGVjaWZpZXMgcGFyYW1ldGVyIHR5cGUKKyogICAgICAgICAgICBTIC0gdmFyaWFibGUtbGVuZ3RoIHN0cmluZworKiAgICAgICAgICAgIEkgLSBpbnRlZ2VyCisqCisqIG1heExlbjoKKyogICAgICAgIFNwZWNpZmllcyBtYXhpbXVtIHBhcmFtZXRlciBsZW5ndGggaW4gYnl0ZXMuCisqCisqIHNlbUluZHg6CisqICAgICAgICBTcGVjaWZpZXMgc2VtYXBob3JlIGluZGV4IHRv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S0tLQorKiAgICAgICAgVGFibGUgY2FuIGJlIGdlbmVyYXRlZCB1c2luZyBrZXl3b3JkcyAnI1RBQkxFJyBhbmQgJyNFTkQnIGFzIGJlbG93OgorKgorKiAgICAgICAgI1RBQkxFICB0YWJsZV9uYW1lICAgbnVtYmVyX29mX3JvdworKiAgICAgICAgV05JX0NGR194eHh4CisqICAgICAgICAuLi4uLi4uCisqICAgICAgICAuLi4uLi4uCisqICAgICAgICAjRU5ECisqCisqICAgICAgICBUaGUgQ0ZHIHV0aWxpdHkgd2lsbCBnZW5lcmF0ZSB0aGUgZm9sbG93aW5nIG91dHB1dDoKKyogICAgICAgIFdOSV9DRkdfdGFibGVfeHh4X0lEICAgIHh4eAorKiAgICAgICAgV05JX0NGR190YWJsZV94eHhfUk9XICAgbnVtYmVyX29mX3Jvd3MKKyogICAgICAgIFdOSV9DRkdfdGFibGVfeHh4X0NPTCAgIG51bWJlcl9vZl9jb2x1bW5zCisqCisqICAgICAgICBUaGVzZSB3aWxsIGJlIGZvbGxvd2VkIGJ5IHRoZSBwYXJhbWV0ZXIgZGVmaW5pdGlvbiBmb3IgZWFjaCBlbnRyeSBpbgorKiAgICAgICAgdGhlIHRhYmxlLiAgVGFibGUgaXMgb3JnYW5pemVkIGluIGNvbHVtbi1tYWpvciBvcmRlci4KKyoKKyogICAgICAgICNFTlRSWV9WQUxVRVMgMQorKiAgICAgICAgMCAgICA0ICAgIDEKKyogICAgICAgIDAgICAgMCAgICAwCisqICAgICAgICAjRU5UUllfVkFMVUVTIDIKKyogICAgICAgIDAgICAgNCAgICAyCisqICAgICAgICAwICAgIDAgICAgMAorKiAgICAgICAgI0VOVFJZX1ZBTFVFUyAzCisqICAgICAgICAwICAgIDQgICAgMworKiAgICAgICAgMCAgICAwICAgIDAKKyogICAgICAgICNFTlRSWV9WQUxVRVMgNAorKiAgICAgICAgMCAgICA0ICAgIDQKKyogICAgICAgIDAgICAgMCAgICAwCisqCisqCisqIEVOVU1FUkFUSU9OCisqIC0tLS0tLS0tLS0tCisqICAgICAgICBFbnVtZXJhdGlvbnMgY2FuIGJlIGRlZmluZSB1c2luZyBrZXl3b3JkICcjRU5VTScKKyoKKyogICAgICAgICNFTlVNIHh4eCAgIHZhbAorKgorKiAgICAgICAgVGhlIGNmZyB1dGlsaXR5IHdpbGwgZ2VuZXJhdGUgdGhlIGZvbGxvd2luZyBvdXRwdXQgaW4gdGhlIGhlYWRlciBmaWxlCisqICAgICAgICAjZGVmaW5lIHBhcmFtbmFtZV94eHggICAgdmFsCisqCisKKworKgorKiBTdGF0aW9uIElEIChjaGFuZ2luZyByZXF1aXJlcyByZXN0YXJ0KQorKgorCitXTklfQ0ZHX1NUQV9JRCAgICBTICAgIDYgICAgMQorViAgICBSVyAgICBOUCBSRUxPQUQKK0hBTAorNiAgICAweDIyIDB4MjIgMHg0NCAweDQ0IDB4MzMgMHgzMworViAgICBSVyAgICBOUCBSRUxPQUQKK0hBTAorNiAgICAweDIyIDB4MjIgMHgxMSAweDExIDB4MzMgMHgzMworCisqCisqIENGIFBvbGxhYmxlCisqCisKK1dOSV9DRkdfQ0ZfUE9MTEFCTEUgICAgSSAgICA0ICAgIDEKK05WICAgIFJPICAgIE5QIFJFU1RBUlQKK05PTkUKKzAgICAgMCAgICAwCitWICAgIFJPICAgIE5QIFJFU1RBUlQKK05PTkUKKzAgICAgMSAgICAwCisKKyoKKyogQ0ZQIFBlcmlvZAorKgorCitXTklfQ0ZHX0NGUF9QRVJJT0QgICAgSSAgICA0ICAgIDEKK1YgICAgUk8gICAgTlAKK05PTkUKKzAgICAgMjU1ICAgMQorViAgICBSVyAgICBOUAorU0NICiswICAgIDI1NSAgIDEKKworKgorKiBDRlAgTWF4IER1cmF0aW9uCisqCisKK1dOSV9DRkdfQ0ZQX01BWF9EVVJBVElPTiAgICBJICAgIDQgICAgMQorViAgICBSTyAgIE5QCitOT05FCiswICAgIDY1NTM1ICAgIDMwMDAwCitWICAgIFJXICAgTlAKK0hBTAorMCAgICA2NTUzNSAgICAzMDAwMAorCisqCisqIFNTSUQgKGNoYW5naW5nIHJlcXVpcmVzIHJlc3RhcnQpCisqCisKK1dOSV9DRkdfU1NJRCAgICBTICAgIDMyICAgIDEKK1YgICAgUlcgICAgTlAgUkVTVEFSVAorTk9ORQorMTAgICAgMSAyIDMgNCA1IDYgNyA4IDkgMAorViAgICBSVyAgICBOUCBSRVNUQVJUCitOT05FCisxMCAgICAxIDIgMyA0IDUgNiA3IDggOSAwCisKKyoKKyogQmVhY29uIFBlcmlvZAorKiBDYW4ndCBiZSBjaGFuZ2VkIG9uIFNUQSBpbiBpbmZyYXN0cnVjdHVyZSwgaWdub3JlIG5vdGlmaWNhdGlvbiBhdCBTQ0gKKyoKKworV05JX0NGR19CRUFDT05fSU5URVJWQUwgICAgSSAgICA0ICAgIDIKK1YgICAgUlcgICAgTlAKK1NDSAorMCAgICA2NTUzNSAgICAxMDAKK1YgICAgUlcgICAgTlAKK1NDSAorMCAgICA2NTUzNSAgICAxMDAKKworKgorKiBEVElNIFBlcmlvZAorKgorCitXTklfQ0ZHX0RUSU1fUEVSSU9EICAgICAgICBJICAgIDQgICAgMgorViAgICBSTyAgICBOUAorTk9ORQorMCAgICA2NTUzNSAgICAxCitWICAgIFJXICAgIE5QCitTQ0gKKzAgICAgNjU1MzUgICAgMQorCisKKyoKKyogV0VQIEtleSBMZW5ndGggKDUgb3IgMTMgYnl0ZXMpCisqCisKK1dOSV9DRkdfV0VQX0tFWV9MRU5HVEggICAgSSAgICA0ICAgIDUKK1YgICAgUlcgICAgTlAgUkVTVEFSVAorTk9ORQorNSAgICAxMyAgICA1CitWICAgIFJXICAgIE5QIFJFU1RBUlQKK05PTkUKKzUgICAgMTMgICAgNQorCisjRU5VTSA1ICAgIDUKKyNFTlVNIDEzICAgMTMKKworKgorKiBEZWZhdWx0IEtleSBUYWJsZQorKgorCisjVEFCTEUgICAgV05JX0NGR19XRVBfREVGQVVMVF9LRVlfVEFCTEUgICAgNAorCitXTklfQ0ZHX1dFUF9ERUZBVUxUX0tFWSAgICBTICAgIDEzICAgIDQKK1YgICAgV08gICAgTlAgUkVTVEFSVAorTk9ORQorMAorViAgICBXTyAgICBOUCBSRVNUQVJUCitOT05FCiswCisKKyNFTkQKKworKgorKiBXRVAgRGVmYXVsdCBLZXkgaWQKKyoKKworV05JX0NGR19XRVBfREVGQVVMVF9LRVlJRCAgICBJICAgIDQgICAgNQorViAgICBSVyAgICBOUAorTElNCiswICAgIDMgICAgMAorViAgICBSVyAgICBOUAorTElNCiswICAgIDMgICAgMAorCisjRU5VTSAwICAgIDAKKyNFTlVNIDEgICAgMQorI0VOVU0gMiAgICAyCisjRU5VTSAzICAgIDMKKworKgorKiBFeGNsdWRlIHVuZW5jcnlwdGVkIGZyYW1lcyAoV0VQKQorKgorCitXTklfQ0ZHX0VYQ0xVREVfVU5FTkNSWVBURUQgICAgSSAgICA0ICAgIDUKK1YgICAgUlcgICAgTlAKK0xJTQorMCAgICAxICAgIDAKK1YgICAgUlcgICAgTlAKK0xJTQorMCAgICAxICAgIDAKKworKgorKiBSVFMgVGhyZXNob2xkCisqCisKK1dOSV9DRkdfUlRTX1RIUkVTSE9MRCAgICBJICAgIDQgICAgNgorViAgICBSVyAgICBOUAorSEFMCiswICAgIDIzNDcgICAgMjM0NworViAgICBSVyAgICBOUAorSEFMCiswICAgIDIzNDcgICAgMjM0NworCisqCisqIFNob3J0IFJldHJ5IExpbWl0CisqCisKK1dOSV9DRkdfU0hPUlRfUkVUUllfTElNSVQgICAgSSAgICA0ICAgIDYKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAyNTUgICA2CitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMjU1ICAgNgorCisqCisqIExvbmcgUmV0cnkgTGltaXQKKyoKKworV05JX0NGR19MT05HX1JFVFJZX0xJTUlUICAgIEkgICAgNCAgICA2CitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMjU1ICAgNgorViAgICBSVyAgICBOUAorSEFMCiswICAgIDI1NSAgIDYKKworCisqCisqIEZyYWdtZW50YXRpb24gVGhyZXNob2xkCisqCisKK1dOSV9DRkdfRlJBR01FTlRBVElPTl9USFJFU0hPTEQgICAgSSAgICA0ICAgIDYKK1YgICAgUlcgICAgTlAKK0hBTAorMjU2ICAgIDgwMDAgICAgODAwMAorViAgICBSVyAgICBOUAorSEFMCisyNTYgICAgODAwMCAgICA4MDAwCisKKworKgorKiBNaW5pbXVtIENoYW5uZWwgVGltZSAoVFUpCisqCisKK1dOSV9DRkdfQUNUSVZFX01JTklNVU1fQ0hBTk5FTF9USU1FICAgIEkgICAgNCAgICA5CitWICAgIFJXICAgIE5QCitOT05FCiswICAgIDY1NTM1ICAyMAorViAgICBSVyAgICBOUAorTk9ORQorMCAgICA2NTUzNSAgMjAKKworKgorKiBNYXhpbXVtIENoYW5uZWwgVGltZSAoVFUpCisqCisKK1dOSV9DRkdfQUNUSVZFX01BWElNVU1fQ0hBTk5FTF9USU1FICAgIEkgICAgNCAgICA5CitWICAgIFJXICAgIE5QCitOT05FCiswICAgIDY1NTM1ICAgIDQwCitWICAgIFJXICAgIE5QCitOT05FCiswICAgIDY1NTM1ICAgIDQwCisqCisqIE1pbmltdW0gQ2hhbm5lbCBUaW1lIChUVSkKKyoKKworV05JX0NGR19QQVNTSVZFX01JTklNVU1fQ0hBTk5FTF9USU1FICAgIEkgICAgNCAgICA5CitWICAgIFJXICAgIE5QCitOT05FCiswICAgIDY1NTM1ICA2MAorViAgICBSVyAgICBOUAorTk9ORQorMCAgICA2NTUzNSAgNjAKKworKgorKiBNYXhpbXVtIENoYW5uZWwgVGltZSAoVFUpCisqCisKK1dOSV9DRkdfUEFTU0lWRV9NQVhJTVVNX0NIQU5ORUxfVElNRSAgICBJICAgIDQgICAgOQorViAgICBSVyAgICBOUAorTk9ORQorMCAgICA2NTUzNSAgICAxMTAKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgICAgNjU1MzUgICAgMTEwCisKKyoKKyogSm9pbiBGYWlsdXJlIFRpbWVvdXQgKFRVKQorKgorCitXTklfQ0ZHX0pPSU5fRkFJTFVSRV9USU1FT1VUICAgIEkgICAgNCAgICA3CitWICAgIFJXICAgIE5QCitOT05FCiswICAgIDY1NTM1ICAgIDMwMDAKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgICAgNjU1MzUgICAgMzAwMAorCisqCisqIEF1dGhlbnRpY2F0ZSBGYWlsdXJlIFRpbWVvdXQgKFRVKQorKgorCitXTklfQ0ZHX0FVVEhFTlRJQ0FURV9GQUlMVVJFX1RJTUVPVVQgICAgSSAgICA0ICAgIDcKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgICAgNjU1MzUgICAgMTAwMAorViAgICBSVyAgICBOUAorTk9ORQorMCAgICA2NTUzNSAgICAxMDAwCisKKyoKKyogQXV0aGVudGljYXRlIFJlc3BvbnNlIFRpbWVvdXQgKFRVKQorKgorCitXTklfQ0ZHX0FVVEhFTlRJQ0FURV9SU1BfVElNRU9VVCAgICBJICAgIDQgICAgNworViAgICBSVyAgICBOUAorTk9ORQorMCAgICA2NTUzNSAgICAxMDAwCitWICAgIFJXICAgIE5QCitOT05FCiswICAgIDY1NTM1ICAgIDEwMDAKKworKgorKiBBc3NvY2F0aW9uIEZhaWx1cmUgVGltZW91dCAoVFUpCisqCisKK1dOSV9DRkdfQVNTT0NJQVRJT05fRkFJTFVSRV9USU1FT1VUICAgIEkgICAgNCAgICA4CitWICAgIFJXICAgIE5QCitMSU0KKzAgICAgNjU1MzUgMjAwMAorViAgICBSVyAgICBOUAorTElNCiswICAgIDY1NTM1IDMwMDAKKworKgorKiBSZWFzc29jaWF0aW9uIEZhaWx1cmUgVGltZW91dCAoVFUpCisqCisKK1dOSV9DRkdfUkVBU1NPQ0lBVElPTl9GQUlMVVJFX1RJTUVPVVQgICAgSSAgICA0ICAgIDcKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgICAgNjU1MzUgICAgMTAwMAorViAgICBSVyAgICBOUAorTk9ORQorMCAgICA2NTUzNSAgICAzMDAwCisKKworKgorKiBSQSBwZXJpb2RpY2l0eSBUaW1lb3V0IChUVSkKKyoKKworV05JX0NGR19SQV9QRVJJT0RJQ0lUWV9USU1FT1VUX0lOX1BTICAgIEkgICAgNCAgICA3CitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgNjU1MzUgICAgMTAwMAorTlYgICAgUlcgICAgTlAKK05PTkUKKzAgICAgMCAgICAwCisKKyoKKyogQmVhY29uIEZpbHRlciBFbmFibGUvRGlzYWJsZSAoVFUpCisqCisKK1dOSV9DRkdfUFNfRU5BQkxFX0JDTl9GSUxURVIgICAgSSAgICA0ICAgIDcKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAxICAgIDEKK05WICAgIFJXICAgIE5QCitOT05FCiswICAgIDEgICAgMQorCisqCisqIEhlYXJ0IEJlYXQgRW5hYmxlL0Rpc2FibGUgKFRVKQorKgorCitXTklfQ0ZHX1BTX0VOQUJMRV9IRUFSVF9CRUFUICAgIEkgICAgNCAgICA3CitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMSAgICAxCitOViAgICBSVyAgICBOUAorTk9ORQorMCAgICAxICAgIDEKKworKgorKiBSU1NJIE1vbml0b3IgRW5hYmxlL0Rpc2FibGUgKFRVKQorKgorCitXTklfQ0ZHX1BTX0VOQUJMRV9SU1NJX01PTklUT1IgICAgSSAgICA0ICAgIDcKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAxICAgIDAKK05WICAgIFJXICAgIE5QCitOT05FCiswICAgIDEgICAgMAorCisKKyoKKyogUFMgRGF0YSBJbkFjdGl2aXR5IFRpbWVvdXQgKFRVKQorKgorCitXTklfQ0ZHX1BTX0RBVEFfSU5BQ1RJVklUWV9USU1FT1VUICAgIEkgICAgNCAgICA3CitWICAgIFJXICAgIE5QCitIQUwKKzEgICAgMjU1ICAgIDIwCitOViAgICBSVyAgICBOUAorTk9ORQorMSAgICAyNTUgICAgMjAKKworCisqCisqIFJGIFNldHRsaW5nIFRpbWUgQ2xrIChJbiBVUykKKyoKKworV05JX0NGR19SRl9TRVRUTElOR19USU1FX0NMSyBJICAgIDQgICAgNworViAgICBSVyAgICBOUAorSEFMCiswICAgIDYwMDAwICAgIDE1MDAKK05WICAgIFJXICAgIE5QCitOT05FCiswICAgIDYwMDAwICAgIDE1MDAKKworKgorKiBTdXBwb3J0ZWQgUmF0ZSBTZXQgZm9yIDExYgorKgorCitXTklfQ0ZHX1NVUFBPUlRFRF9SQVRFU18xMUIgICAgUyAgICA0ICAgIDIKK1YgICAgUk8gICAgTlAKK05PTkUKKzQgICAgIDIgNCAxMSAyMgorViAgICBSTyAgICBOUAorTk9ORQorNCAgICAgMiA0IDExIDIyCisKKyoKKyogU3VwcG9ydGVkIFJhdGUgU2V0IGZvciAxMWEKKyoKKworV05JX0NGR19TVVBQT1JURURfUkFURVNfMTFBICAgIFMgICAgOCAgICA3CitWICAgIFJPICAgIE5QCitOT05FCis4ICAgIDEyIDE4IDI0IDM2IDQ4IDcyIDk2IDEwOAorViAgICBSTyAgICBOUAorTk9ORQorOCAgICAxMiAxOCAyNCAzNiA0OCA3MiA5NiAxMDgKKworCisqCisqIFBIWSBNb2RlCisqCisKK1dOSV9DRkdfUEhZX01PREUgICAgSSAgICA0ICAgIDkKK1YgICAgUlcgICAgTlAgUkVTVEFSVAorTk9ORQorMCAgICAzICAgIDAKK1YgICAgUlcgICAgTlAgUkVTVEFSVAorTk9ORQorMCAgICAzICAgIDAKKworI0VOVU0gIDExQSAgMAorI0VOVU0gIDExQiAgMQorI0VOVU0gIDExRyAgMgorI0VOVU0gIE5PTkUgMworCisKKyoKKypUaGUgRG90MTEgbW9kZSBjYW4gY2hhbmdlIGR5bmFtaWNhbGx5IG9uIFNUQQorKgorV05JX0NGR19ET1QxMV9NT0RFICAgICBJICAgICA0ICAgICA5CitWICAgIFJXICAgIE5QIFJFU1RBUlQKK0xJTQorMCAgICAxMSAgICAwCitWICAgIFJXICAgIE5QIFJFU1RBUlQKK0xJTQorMCAgICAxMSAgICAwCisKKyNFTlVNICBBTEwgICAgICAgICAgIDAKKyNFTlVNICAxMUEgICAgICAgICAgIDEKKyNFTlVNICAxMUIgICAgICAgICAgIDIKKyNFTlVNICAxMUcgICAgICAgICAgIDMKKyNFTlVNICAxMU4gICAgICAgICAgIDQKKyNFTlVNICBQT0xBUklTICAgICAgIDUKKyNFTlVNICBUSVRBTiAgICAgICAgIDYKKyNFTlVNICBUQVVSVVMgICAgICAgIDcKKyNFTlVNICAxMUdfT05MWSAgICAgIDgKKyNFTlVNICAxMU5fT05MWSAgICAgIDkKKyNFTlVNICAxMUFDICAgICAgICAgIDEwCisjRU5VTSAgMTFBQ19PTkxZICAgICAxMQorCisKKworCisKKworKgorKiBPcGVyYXRpb25hbCBSYXRlIFNldCAoZ29lcyBpbiBiZWFjb24sIHByb2JlIHJzcCBhbmQgYXNzb2MgcmVxKQorKgorCitXTklfQ0ZHX09QRVJBVElPTkFMX1JBVEVfU0VUICAgIFMgICAgMTIgICAgMgorViAgICBSVyAgICBOUCBSRVNUQVJUCitOT05FCiswCitWICAgIFJXICAgIE5QIFJFU1RBUlQKK05PTkUKKzQgICAgIDB4ODIgMHg4NCAxMSAyMgorKiA4ICAgIDB4OGMgMTggMjQgMzYgNDggNzIgOTYgMTA4CisKKyoKKyogRXh0ZW5kZWQgT3BlcmF0aW9uYWwgUmF0ZSBTZXQgKGdvZXMgaW4gYmVhY29uLCBhc3NvYyByZXEpCisqIHJlcXVpcmVkIGZvciAxMWcKKyoKKworV05JX0NGR19FWFRFTkRFRF9PUEVSQVRJT05BTF9SQVRFX1NFVCAgICBTICAgIDggICAgNworViAgICBSVyAgICBOUCBSRVNUQVJUCitOT05FCiswCitWICAgIFJXICAgIE5QIFJFU1RBUlQKK05PTkUKKzAKKworKgorKiBQcm9wcmlldGFyeSBPcGVyYXRpb25hbCBSYXRlIFNldAorKgorCitXTklfQ0ZHX1BST1BSSUVUQVJZX09QRVJBVElPTkFMX1JBVEVfU0VUICAgIFMgICA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DQ4IDUyIDU2IDYwIDY0IDEgNiAxMSAzNCAzOCA0MiA0NiAyIDMgNCA1IDcgOCA5IDEwIDEyIDEzIDE0IDEwMCAxMDQgMTA4IDExMiAxMTYgMTIwIDEyNCAxMjggMTMyIDEzNiAxNDAgMTQ5IDE1MSAxNTMgMTU1IDE1NyAxNTkgMTYxIDUwIDU0IDU4IDYyIDI0MCAyNDIgMjQ0IDI0NiAyNDggMjUwIDI1MgorCisqCisqIEN1cnJlbnQgQ2hhbm5lbAorKgorCitXTklfQ0ZHX0NVUlJFTlRfQ0hBTk5FTCAgICBJICAgIDQgICAgOQorViAgICBSTyAgICBOUAorTk9ORQorMCAgICAxNjUgICAgMQorViAgICBSTyAgICBOUAorTk9ORQorMCAgICAxNjUgICAgMQorCisKKyoKKyogRm9yIDExYSBvciBwdXJlIDExZywgdXNlIDZNYnBzKHJhdGVpbmRleCAxMSkKKyogYXMgdGhlIGRlZmF1bHQgYmVhY29uUmF0ZUluZGV4IGFuZAorKiBub25CZWFjb25SYXRlSW5kZXguCisqCitXTklfQ0ZHX0RFRkFVTFRfUkFURV9JTkRFWF81R0haICAgIEkgICAgNCAgICA5CitWICAgIFJXICAgIE5QCitOT05FCiswICAgIDExICAgIDUKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgICAgMTEgICAgNQorCisqCisqIEZvciAxMWIvZywgdXNlIDFNYnBzIAorKiBhcyB0aGUgZGVmYXVsdCBiZWFjb25SYXRlSW5kZXggYW5kCisqIG5vbkJlYWNvblJhdGVJbmRleC4KKyoKK1dOSV9DRkdfREVGQVVMVF9SQVRFX0lOREVYXzI0R0haICAgIEkgICAgNCAgICA5CitWICAgIFJXICAgIE5QCitOT05FCiswICAgIDMxICAgIDEKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgICAgMzEgICAgMQorCisKKyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIFJhdGUgYWRhcHRhdGlvbiB0eXBlCisqCisKK1dOSV9DRkdfUkFURV9BREFQVEFUSU9OX1RZUEUgIEkgICA0ICAgMAorViAgICBSVyAgICBOUAorU0NICiswICAgIDIgICAgIDEKK1YgICAgUlcgICAgTlAKK1NDSAorMCAgICAyICAgICAxCisKKyNFTlVNIEZJWEVEIDAKKyNFTlVNIEFVVE8gIDEKKyNFTlVNIFNOUl9CQVNFRCAyCisKKyoKKyogUmF0ZSBhZGFwdGF0aW9uIGZpeGVkIHJhdGUKKyogVXNlZCB0byBkZXRlcm1pbmUgdGhlIHJhdGUgZm9yIGFsbCBwZWVyIHN0YXRpb25zCisqCisqCisKK1dOSV9DRkdfRklYRURfUkFURSAgSSAgIDQgICAwCitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgNDQgICAgIDAKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICA0NCAgICAgMAorCisjRU5VTSBBVVRPIAkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAKKworI0VOVU0gMU1CUFMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxCisjRU5VTSAyTUJQUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIKKyNFTlVNIDVfNU1CUFMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMworI0VOVU0gMTFNQlBTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0CisKKyNFTlVNIDZNQlBTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNQorI0VOVU0gOU1CUFMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA2CisjRU5VTSAxMk1CUFMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDcKKyNFTlVNIDE4TUJQUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOAorI0VOVU0gMjRNQlBTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA5CisjRU5VTSAzNk1CUFMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwCisjRU5VTSA0OE1CUFMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDExCisjRU5VTSA1NE1CUFMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyCisKKyNFTlVNIDZfNU1CUFNfTUNTMF8yME1IWl9TSU1PCSAgICAgICAgICAgIDEzCisjRU5VTSAxM01CUFNfTUNTMV8yME1IWl9TSU1PICAgICAgICAgICAgICAgIDE0CisjRU5VTSAxOV81TUJQU19NQ1MyXzIwTUhaX1NJTU8gICAgICAgICAgICAgIDE1CisjRU5VTSAyNk1CUFNfTUNTM18yME1IWl9TSU1PICAgICAgICAgICAgICAgIDE2CisjRU5VTSAzOU1CUFNfTUNTNF8yME1IWl9TSU1PICAgICAgICAgICAgICAgIDE3CisjRU5VTSA1Mk1CUFNfTUNTNV8yME1IWl9TSU1PICAgICAgICAgICAgICAgIDE4CisjRU5VTSA1OF81TUJQU19NQ1M2XzIwTUhaX1NJTU8gICAgICAgICAgICAgIDE5CisjRU5VTSA2NU1CUFNfTUNTN18yME1IWl9TSU1PICAgICAgICAgICAgICAgIDIwCisKKyNFTlVNIDdfMk1CUFNfTUNTMF8yME1IWl9TSU1PX1NHSSAgICAgICAgICAgMjEKKyNFTlVNIDE0XzRNQlBTX01DUzFfMjBNSFpfU0lNT19TR0kgICAgICAgICAgMjIKKyNFTlVNIDIxXzdNQlBTX01DUzJfMjBNSFpfU0lNT19TR0kgICAgICAgICAgMjMKKyNFTlVNIDI4XzlNQlBTX01DUzNfMjBNSFpfU0lNT19TR0kgICAgICAgICAgMjQKKyNFTlVNIDQzXzNNQlBTX01DUzRfMjBNSFpfU0lNT19TR0kgICAgICAgICAgMjUKKyNFTlVNIDU3XzhNQlBTX01DUzVfMjBNSFpfU0lNT19TR0kgICAgICAgICAgMjYKKyNFTlVNIDY1TUJQU19NQ1M2XzIwTUhaX1NJTU9fU0dJICAgICAgICAgICAgMjcKKyNFTlVNIDcyXzJNQlBTX01DUzdfMjBNSFpfU0lNT19TR0kgICAgICAgICAgMjgKKworI0VOVU0gMF8yNU1CUFNfU0xSXzIwTUhaX1NJTU8gICAgICAgICAgICAgICAyOQorI0VOVU0gMF81TUJQU19TTFJfMjBNSFpfU0lNTyAgICAgICAgICAgICAgICAzMAorCisjRU5VTSA2OF8yNU1CUFNfUUNfUFJPUF8yME1IWl9TSU1PICAgICAgICAgIDMxCisjRU5VTSA1NE1CUFNfTUNTM180ME1IWl9TSU1PICAgICAgICAgICAgICAgIDMyCisjRU5VTSA4MU1CUFNfTUNTNF80ME1IWl9TSU1PICAgICAgICAgICAgICAgIDMzCisjRU5VTSAxMDhNQlBTX01DUzVfNDBNSFpfU0lNTyAgICAgICAgICAgICAgIDM0CisjRU5VTSAxMjFfNU1CUFNfTUNTNl80ME1IWl9TSU1PICAgICAgICAgICAgIDM1CisjRU5VTSAxMzVNQlBTX01DUzdfNDBNSFpfU0lNTyAgICAgICAgICAgICAgIDM2CisjRU5VTSAxNU1CUFNfTUNTMF80ME1IWl9TSU1PX1NHSSAgICAgICAgICAgIDM3CisjRU5VTSAzME1CUFNfTUNTMV80ME1IWl9TSU1PX1NHSSAgICAgICAgICAgIDM4CisjRU5VTSA0NU1CUFNfTUNTMl80ME1IWl9TSU1PX1NHSSAgICAgICAgICAgIDM5CisjRU5VTSA2ME1CUFNfTUNTM180ME1IWl9TSU1PX1NHSSAgICAgICAgICAgIDQwCisjRU5VTSA5ME1CUFNfTUNTNF80ME1IWl9TSU1PX1NHSSAgICAgICAgICAgIDQxCisjRU5VTSAxMjBNQlBTX01DUzVfNDBNSFpfU0lNT19TR0kgICAgICAgICAgIDQyCisjRU5VTSAxMzVNQlBTX01DUzZfNDBNSFpfU0lNT19TR0kgICAgICAgICAgIDQzCisjRU5VTSAxNTBNQlBTX01DUzdfNDBNSFpfU0lNT19TR0kgICAgICAgICAgIDQ0CisKKyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIEJyb2FkY2FzdC9tdXRs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aXRobQorKgorCitXTklfQ0ZHX1JFVFJZUkFURV9QT0xJQ1kgIEkgICA0ICAgMAorViAgICBSVyAgICBOUAorSEFMCiswICAgIDI1NSAgICAgNAorViAgICBSVyAgICBOUAorSEFMCiswICAgIDI1NSAgICAgNAorCisjRU5VTSBNSU5fU1VQUE9SVEVEIDAKKyNFTlVNIFBSSU1BUlkgICAgICAgMQorI0VOVU0gUkVTRVJWRUQgICAgICAyCisjRU5VTSBDTE9TRVNUICAgICAgIDMKKyNFTlVNIEFVVE9TRUxFQ1QgICAgNAorI0VOVU0gTUFYICAgICAgICAgICA1CisKKyoKKyogdGhlIGZvbGxvd2luZyB0d28gQ0ZHJ3MgYXJlCisqIHVzZWQgb25seSBpZiB0aGUgcmV0cnlyYXRlIHBvbGljeSA9PSAyCisqIFRoZXNlIHNob3VsZCBiZSBzZXQgdG8gb25lIG9mIHRoZSB2YWx1ZXMgdXNlZAorKiBmb3IgY29uZmlndXJpbmcgZml4ZWQgcmF0ZXMgKHNlZSBlbnVtZXJhdGVkIHJhdGVzKQorKgorCitXTklfQ0ZHX1JFVFJZUkFURV9TRUNPTkRBUlkgIEkgICA0ICAgMAorViAgICBSVyAgICBOUAorSEFMCiswICAgIDI1NSAgICAgMAorViAgICBSVyAgICBOUAorSEFMCiswICAgIDI1NSAgICAgMAorCitXTklfQ0ZHX1JFVFJZUkFURV9URVJUSUFSWSAgSSAgIDQgICAwCitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMjU1ICAgICAwCitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMjU1ICAgICAwCisKKyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIEF1dG9tYXRpYyBQb3dlciBTYXZlIERlbGl2ZXJ5IGNhcGFiaWxpdHkKKyoKKworV05JX0NGR19BUFNEX0VOQUJMRUQgSSAgIDQgICAwCitWICAgIFJXICAgIE5QCitOT05FCiswICAgIDEgICAgIDAKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgICAgMSAgICAgMAorCisqCisqIFNoYXJlZCBrZXkgYXV0aGVudGljYXRpb24gc3VwcG9ydGVkCisqCisKK1dOSV9DRkdfU0hBUkVEX0tFWV9BVVRIX0VOQUJMRSAgICBJICAgNCAgIDgKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgICAgMSAgICAxCitWICAgIFJXICAgIE5QCitOT05FCiswICAgIDEgICAgMQorCisqCisqIE9wZW4gc3lzdGVtIGF1dGhlbnRpY2F0aW9uIHN1cHBvcnRlZAorKgorCitXTklfQ0ZHX09QRU5fU1lTVEVNX0FVVEhfRU5BQkxFICAgIEkgICA0ICAgOAorViAgICBSVyAgICBOUAorTk9ORQorMCAgICAxICAgIDEKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgICAgMSAgICAxCisKKyoKKyogQXV0aGVudGljYXRpb24gVHlwZSAoY2hhbmdlIHJlcXVpcmVzIHJlc3RhcnQpCisqCisKK1dOSV9DRkdfQVVUSEVOVElDQVRJT05fVFlQRSAgICBJICAgIDQgICAgOAorViAgICBSVyAgICBOUCBSRVNUQVJUCitOT05FCiswICAgIDY1NTM1ICAgIDAKK1YgICAgUlcgICAgTlAgUkVTVEFSVAorTk9ORQorMCAgICA2NTUzNSAgICAwCisKKyoKKyogQ0YgUG9sbCBSZXF1ZXN0IChjaGFuZ2UgcmVxdWlyZXMgcmVzdGFydCkKKyoKKworV05JX0NGR19DRl9QT0xMX1JFUVVFU1QgICAgSSAgICA0ICAgIDgKK05WICAgIFJXICAgIE5QIFJFU1RBUlQKK05PTkUKKzAgICAgMSAgICAwCitWICAgIFJXICAgIE5QIFJFU1RBUlQKK05PTkUKKzAgICAgMSAgICAwCisKKyoKKyogUHJpdmFjeSBFbmFibGVkIChjaGFuZ2UgcmVxdWlyZXMgcmVzdGFydCkKKyoKKworV05JX0NGR19QUklWQUNZX0VOQUJMRUQgICAgSSAgICA0ICAgIDgKK1YgICAgUlcgICAgTlAgUkVTVEF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VNUQVJUCitOT05FCiswICAgIDEgICAgMAorViAgICBSVyAgICBOUCAgICBSRVNUQVJUCitOT05FCiswICAgIDEgICAgMAorCisKKyoKKyogUU9TIEVuYWJsZWQgKGNoYW5nZSByZXF1aXJlcyByZXN0YXJ0KQorKgorCitXTklfQ0ZHX1FPU19FTkFCTEVEICAgIEkgICAgNCAgICA4CitWICAgIFJXICAgIE5QIFJFU1RBUlQKK05PTkUKKzAgICAgMSAgICAwCitWICAgIFJXICAgIE5QIFJFU1RBUlQKK05PTkUKKzAgICAgMSAgICAwCisKKyoKKyogSENGIEVuYWJsZWQgKGNoYW5nZSByZXF1aXJlcyByZXN0YXJ0KQorKgorCitXTklfQ0ZHX0hDRl9FTkFCTEVEICAgICBJICAgIDQgICAgOAorViAgICBSVyAgICBOUCBSRVNUQVJUCitOT05FCiswICAgIDEgICAgMAorViAgICBSVyAgICBOUCBSRVNUQVJUCitOT05FCiswICAgIDEgICAgMAorCisqCisqIFJTTiAoMTFpL1dQQSkgRW5hYmxlZAorKgorCitXTklfQ0ZHX1JTTl9FTkFCTEVEICAgICBJICAgIDQgICAgOAorViAgICBSVyAgICBOUCBSRVNUQVJUCitOT05FCiswICAgIDEgICAgMAorViAgICBSVyAgICBOUCBSRVNUQVJUCitOT05FCiswICAgIDEgICAgMAorCisqCisqIEJhY2tncm91bmQgc2Nhbm5pbmcgcGVyaW9kaWNpdHkgKGtpbG8gdXNlYykKKyoKKworV05JX0NGR19CQUNLR1JPVU5EX1NDQU5fUEVSSU9EICAgIEkgICAgNCAgICA4CitWICAgIFJXICAgIE5QCitMSU0KKzAgICAgMTgwMDAwICAgIDUwMDAKK1YgICAgUlcgICAgTlAKK0xJTQorMCAgICAxODAwMCAgICA1MDAwCisKKyoKKyogTWF4IG51bWJlciBvZiBQcmVhdXRoZW50aWNhdGlvbgorKgorCitXTklfQ0ZHX01BWF9OVU1fUFJFX0FVVEggICAgSSAgICA0ICAgIDgKK1YgICAgUlcgICAgTlAgIFJFU1RBUlQKK05PTkUKKzAgICAgMjU2ICAgIDY0CitWICAgIFJXICAgIE5QICBSRVNUQVJUCitOT05FCiswICAgIDI1NiAgICA2NAorCisqCisqIFByZWF1dGhlbnRpY2F0aW9uIENsZWFudXAgVGltZW91dCAoa2lsbyB1c2VjKQorKgorCitXTklfQ0ZHX1BSRUFVVEhfQ0xOVVBfVElNRU9VVCAgICBJICAgIDQgICAgOAorTlYgICAgWFggICAgTlAKK05PTkUKKzAgICAgIDAgICAgIDAKK1YgICAgUlcgICAgTlAKK0xJTQorMCAgICAxMjAwMDAgICAgMzAwMDAKKworKgorKiBSZWxlYXNlIEFJRCBUaW1lb3V0CisqCisKK1dOSV9DRkdfUkVMRUFTRV9BSURfVElNRU9VVCAgICBJICAgIDQgICAgOAorTlYgICAgWFggICAgTlAKK05PTkUKKzAgICAgMCAgICAwCitWICAgIFJXICAgIE5QCitMSU0KKzAgICAgMTAwMDAwICAgIDEwMDAKKyoKKyogSGVhcnRiZWF0IFRocmVzaG9sZAorKgorCitXTklfQ0ZHX0hFQVJUX0JFQVRfVEhSRVNIT0xEICAgIEkgICAgNCAgICA4CitWICAgIFJXICAgIE5QCitMSU0KKzAgICAgNjU1MzUgICAgNDAKK05WICAgIFJXICAgIE5QCitOT05FCiswICAgIDY1NTM1ICAgIDQwCisKKyoKKyogUHJvYmUgcmVzcG9uc2Ugd2FpdCB0aW1lIG91dCBhZnRlciBoZWFydGJlYXQgZmFpbHVyZQorKgorCitXTklfQ0ZHX1BST0JFX0FGVEVSX0hCX0ZBSUxfVElNRU9VVCAgICBJICAgIDQgICAgOAorViAgICBSVyAgICBOUAorTk9ORQorMTAgICAgMTAwMDAgICAgNDAKK1YgICAgUlcgICAgTlAKK05PTkUKKzEwICAgIDEwMDAwICAgIDQwCisKKyoKKyogTWFudWZhY3R1cmVyIE9VSSAoZnJvbSBlZXByb20pCisqCisKK1dOSV9DRkdfTUFOVUZBQ1RVUkVSX09VSSAgICBTICAgIDMgICAgOAorViAgICBSTyAgICBOUAorTk9ORQorMyAgICAweDAgMHhhIDB4ZjUKK1YgICAgUk8gICAgTlAKK05PTkUKKzMgICAgMHgwIDB4YSAweGY1CisKKyoKKyogTWFudWZhY3R1cmUgTmFtZSAoZnJvbSBlZXByb20pCisqCisKK1dOSV9DRkdfTUFOVUZBQ1RVUkVSX05BTUUgICAgUyAgICA2NSAgICA4CitWICAgIFJPICAgIE5QCitOT05FCis4ICAgIDB4NTEgMHg3NSAweDYxIDB4NmMgMHg2MyAweDZmIDB4NkQgMHg2RAorViAgICBSTyAgICBOUAorTk9ORQorOCAgICAweDUxIDB4NzUgMHg2MSAweDZjIDB4NjMgMHg2ZiAweDZEIDB4NkQKKworKgorKiBNb2RlbCBOdW1iZXIgKGZyb20gZWVwcm9tKQorKgorCitXTklfQ0ZHX01PREVMX05VTUJFUiAgICBTICAgIDMzICAgIDgKK1YgICAgUk8gICAgTlAKK05PTkUKKzYgICAgMHg0ZCAweDRlIDB4MzEgMHgzMiAweDMzIDB4MzQKK1YgICAgUk8gICAgTlAKK05PTkUKKzYgICAgMHg0ZCAweDRlIDB4MzEgMHgzMiAweDMzIDB4MzQKKworCisKKyoKKyogTW9kZWwgTmFtZSAoZnJvbSBlZXByb20pCisqIFdGUjQwMzEKKyoKKworV05JX0NGR19NT0RFTF9OQU1FICAgIFMgICAgMzMgICAgOAorViAgICBSTyAgICBOUAorTk9ORQorNyAgICAweDU3IDB4NDYgMHg1MiAweDM0IDB4MzAgMHgzMyAweDMxCitWICAgIFJPICAgIE5QCitOT05FCis3ICAgIDB4NTcgMHg0NiAweDUyIDB4MzQgMHgzMCAweDMzIDB4MzEKKworCisKKworKgorKiBNYW51ZmFjdHVyZSBQcm9kdWN0IE5hbWUgKGZyb20gZWVwcm9tKQorKgorCitXTklfQ0ZHX01BTlVGQUNUVVJFUl9QUk9EVUNUX05BTUUgICAgUyAgICAzMyAgICA4CitWICAgIFJPICAgIE5QCitOT05FCis2ICAgIDB4MzEgMHgzMSAweDZlIDB4MkQgMHg0MSAweDUwCitWICAgIFJPICAgIE5QCitOT05FCis2ICAgIDB4MzEgMHgzMSAweDZlIDB4MkQgMHg0MSAweDUwCisKKworKgorKiBNYW51ZmFjdHVyZSBQcm9kdWN0IFZlcnNpb24gKGZyb20gZWVwcm9tKQorKgorCitXTklfQ0ZHX01BTlVGQUNUVVJFUl9QUk9EVUNUX1ZFUlNJT04gICAgUyAgICAzMyAgICA4CitWICAgIFJPICAgIE5QCitOT05FCis2ICAgIDB4NTMgMHg0ZSAweDMxIDB4MzIgMHgzMyAweDM0IAorViAgICBSTyAgICBOUAorTk9ORQorNiAgICAweDUzIDB4NGUgMHgzMSAweDMyIDB4MzMgMHgzNCAKKworKgorKiBNdWx0aSBEb21haW4gQ2FwYWJpbGl0eSAoMTFkKSBFbmFibGUKKyoKKworV05JX0NGR18xMURfRU5BQkxFRCAgICBJICAgIDQgICAgOQorViAgICBSVyAgICBOUCAgUkVTVEFSVAorTk9ORQorMCAgICAxICAgIDEKK1YgICAgUlcgICAgTlAgIFJFU1RBUlQKK05PTkUKKzAgICAgMSAgICAwCisKKyoKKyogcGVyIGNoYW5uZWwgTWF4IHBvd2VyIHRyYW5zbWl0ICAoaW4gZEJtKQorKiB0aGlzIHBhcmFtZXRlciBjb3JyZXNwb25kIHRvIHRoZSBNQVhfQ09VTlRSWV9FSUQKKyogdGFibGUgb2YgKENoYW5uZWwgTnVtYmVyL251bSBjaGFubmVsL21heCB0eCBwb3dlcikKKyoKKyogVGhlcmUgaXMgb25lIHRhYmxlIGZvciA1R0h6IGNoYW5uZWxzIGFuZCBvbmUgdGFibGUgZm9yIDIuNEdIeiBjaGFubmVscworKgorCitXTklfQ0ZHX01BWF9UWF9QT1dFUl8yXzQgICAgUyAgICAxMjggICAgOAorViAgICBSVyAgICBOUAorTk9ORQorMyAgIDEgMTQgMjAKK1YgICAgUlcgICAgTlAKK05PTkUKKzMgICAxIDE0IDIwCisKK1dOSV9DRkdfTUFYX1RYX1BPV0VSXzUgICAgUyAgICAxMjggICAgOAorViAgICBSVyAgICBOUAorTk9ORQorMyAzNiAxMjYgMjAKK1YgICAgUlcgICAgTlAKK05PTkUKKzMgMzYgMTI2IDIwCisKKyoKKyogQ2VsbCBzaXplIGNvbmZpZ3VyYXRpb25zLiBUaGVzZSBhcmUgY2FubmVkIGNvbmZpZ3VyYXRpb25zIGZvciBhIHNwZWNpZmllZAorKiBjZWxsIHNpemUuCisqCitXTklfQ0ZHX05FVFdPUktfREVOU0lUWSAgICBJICAgIDQgICAgOQorViAgICBSVyAgICBOUAorSEFMCiswICAgIDMgICAgMworViAgICBSVyAgICBOUAorSEFMCiswICAgIDMgICAgMAorCisjRU5VTSBMT1cgICAgICAwCisjRU5VTSBNRURJVU0gICAxCisjRU5VTSBISUdIICAgICAyCisjRU5VTSBBREFQVElWRSAzCisKKworKgorKiBBZGFwdGl2ZSBUaHJlc2hvbGQgQWxnb3JpdGhtCisqCitXTklfQ0ZHX0FEQVBUSVZFX1RIUkVTSE9MRF9BTEdPUklUSE0gICAgSSAgICA0ICAgIDkKK1YgICAgUlcgICAgTlAKK0hBTAorMSAgICAyICAgIDIKK1YgICAgUlcgICAgTlAKK0hBTAorMSAgICAyICAgIDIKKworI0VOVU0gQ0FSUklFUiAgICAgIDEKKyNFTlVNIENPUlJFTEFUSU9OICAyCisKKworCisqCisqIEN1cnJlbnQgVFggQW50ZW5uYQorKgorCitXTklfQ0ZHX0NVUlJFTlRfVFhfQU5URU5OQSAgICBJICAgIDQgICAgOQorViAgICBSVyAgICBOUAorSEFMCisxICAgIDEgICAgMQorViAgICBSVyAgICBOUAorSEFMCisxICAgIDIgICAgMgorCisqCisqIEN1cnJlbnQgUlggQW50ZW5uYQorKgorCitXTklfQ0ZHX0NVUlJFTlRfUlhfQU5URU5OQSAgICBJICAgIDQgICAgOQorViAgICBSVyAgICBOUAorSEFMCisxICAgIDIgICAgMgorViAgICBSVyAgICBOUAorSEFMCisxICAgIDMgICAgMworCisqCisqIEN1cnJlbnQgVFggU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vdGggdHggYW5kIHJjdi4gY2hhaW4gMSBpcyByY3Ygb25seS4gY2hhaW4gMiBpcyB0dXJuZWQgb2ZmKQorKiAweDAxMSAtICAyeDIgKGNoYWluIDAsMSBhcmUgdXNlZCBmb3IgYm90aCB0eCBhbmQgcmN2KQorKiAweDMxMSAtICAyeDMgKGNoYWluIDAsMSBhcmUgdXNlZCBmb3IgYm90aCB0eCBhbmQgcmN2LiBjaGFpbiAyIGlzIGZvciByY3Ygb25seSkKKyogMHgzMzMgLSAgYWxsIDMgY2hhaW5zIGFyZSBzZXQgdG8gUlgKKyoKKworV05JX0NGR19QT1dFUl9TVEFURV9QRVJfQ0hBSU4gICAgSSAgICA0ICAgIDkKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAweGZmZmYgICAgMHgzMTEKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAweGZmZmYgICAgMHgzMTEKKworI0VOVU0gT0ZGICAgICAgICAgICAgICAgMAorI0VOVU0gT04gICAgICAgICAgICAgICAgMQorI0VOVU0gVFggICAgICAgICAgICAgICAgMgorI0VOVU0gUlggICAgICAgICAgICAgICAgMworI0VOVU0gTUFTSyAgICAgICAgICAgICAgMHhmCisjRU5VTSBDSEFJTl8wX09GRlNFVCAgICAwCisjRU5VTSBDSEFJTl8xX09GRlNFVCAgICA0IAorI0VOVU0gQ0hBSU5fMl9PRkZTRVQgICAgOCAKKworCisqCisqIFBhcmFtZXRlciB0byBpbmRpY2F0ZSBvciBub3QgbmV3IEJTUyBmb3VuZAorKgorCitXTklfQ0ZHX05FV19CU1NfRk9VTkRfSU5EICAgICAgICAgSSAgICA0ICAgIDkKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgICAgMSAgICAwCitWICAgUlcgICAgTlAKK05PTkUKKzAgICAgMSAgICAwCisKKyoKKyogUHJvcHJpZXRhcnkgQU5JIGZlYXR1cmVzIGVuYWJsZS9kaXNhYmxlCisqCisKK1dOSV9DRkdfUFJPUFJJRVRBUllfQU5JX0ZFQVRVUkVTX0VOQUJMRUQgICAgSSAgICA0ICAgIDEyCitWICAgIFJXICAgIE5QIFJFU1RBUlQKK05PTkUKKzAgICAgMSAgICAwCitWICAgIFJXICAgIE5QIFJFU1RBUlQKK05PTkUKKzAgICAgMSAgICAwCisKKworKgorKiBRdWFsY29tbSBQcm9wIFJhdGVzIGFyZSBkaXNhYmxlZCBieSBkZWZhdWx0CisqCitXTklfQ0ZHX1BST1BSSUVUQVJZX1JBVEVTX0VOQUJMRUQgICAgSSAgICA0ICAgIDEyCitWICAgIFJXICAgIE5QIFJFU1RBUlQKK05PTkUKKzAgICAgMSAgICAwCitWICAgIFJXICAgIE5QIFJFU1RBUlQKK05PTkUKKzAgICAgMSAgICAwCisKKworKgorKiBBUCBub2RlIE5hbWUKKyoKKworV05JX0NGR19BUF9OT0RFX05BTUUgICAgUyAgICAzMiAgICA4CitOViAgICBSTyAgICBOUAorTk9ORQorMAorViAgICBSVyAgICBOUCBSRVNUQVJUCitOT05FCiswCisKKyoKKyogQ291bnRyeSBjb2RlIChmcm9tIEVFUFJPTSkKKyoKKworV05JX0NGR19DT1VOVFJZX0NPREUgICAgUyAgICAzICAgIDgKK1YgICAgUlcgICAgTlAKK05PTkUKKzAKK1YgICAgUlcgICAgTlAKK05PTkUKKzMgMHgxMSAweDIyIDB4MzMKKworKgorKiBTcGVjdHJ1bSBNYW5hZ2VtZW50ICgxMWgpIGVuYWJsZS9kaXNhYmxlCisqCisKK1dOSV9DRkdfMTFIX0VOQUJMRUQgICAgSSAgICA0ICAgIDEyCitWICAgIFJXICAgIE5QIFJFU1RBUlQKK05PTkUKKzAgICAgMSAgICAxCitWICAgIFJXICAgIE5QIFJFU1RBUlQKK05PTkUKKzAgICAgMSAgICAxCisKKworKgorKiBXYWl0IGZvciBDTkYgVGltZW91dC4gQ05GIGluY2x1ZGUgKFJFKUFTU09DLCBESVNBU1NPQywgQVVUSCwgREVBVVRILAorKiBEVU1NWSBwYWNrZXQKKyoKKworV05JX0NGR19X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VU0gUklGUyA2CisjRU5VTSBPQlNTIDcKKyNFTlVNIE9MQkNfRlJPTV9sbEEgOAorI0VOVU0gT0xCQ19GUk9NX2xsQiA5CisjRU5VTSBPTEJDX0ZST01fbGxHIDEwCisjRU5VTSBPTEJDX0hUMjAgMTEKKyNFTlVNIE9MQkNfTk9OX0dGIDEyCisjRU5VTSBPTEJDX0xTSUdfVFhPUCAxMworI0VOVU0gT0xCQ19SSUZTIDE0CisjRU5VTSBPTEJDX09CU1MgMTUKKworCisqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogMTFHIFByb3RlY3Rpb24gRW5hYmxlIEFsd2F5cworKiBWYWxpZCBvbmx5IGlmIHByb3RlY3Rpb24gaXMgZW5hYmxlZAorKiBmb3JjZXMgdXNlcyBvZiBwcm90ZWN0aW9uIHJlZ2FyZGxlc3Mgb2YgbGVnYWN5IHN0YXRpb25zCisqCisKK1dOSV9DRkdfMTFHX1BST1RFQ1RJT05fQUxXQVlTICAgIEkgICAgNCAgICA5CitWICAgIFJXICAgIE5QICBSRVNUQVJUCitOT05FCiswICAgIDEgICAgMAorViAgICBSVyAgICBOUCAgUkVTVEFSVAorTk9ORQorMCAgICAxICAgIDAKKworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqIEZvcmNlIHByb3RlY3Rpb24KKyogMCA6ICBkaXNhYmxlIHByb3RlY3Rpb24KKyogMSA6ICBDVFMKKyogMiA6ICBSVFMgYnkgdGhyZXNob2xkICh0aHJlc2hvbGQgbm9uemVybykKKyogMyA6ICBkdWFsIENUUyAobm90IHN1cHBvcnRlZCByaWdodCBub3cpCisqIDQgOiAgUlRTICh0aHJlc2hvbGQgMCkKKyogNSA6ICBhdXRvCisKK1dOSV9DRkdfRk9SQ0VfUE9MSUNZX1BST1RFQ1RJT04gICAgSSAgICA0ICAgIDkgCitWICAgIFJXICAgIE5QICBSRVNUQVJUIAorSEFMCiswICAgIDUgICAgNSAKK1YgICAgUlcgICAgTlAgIFJFU1RBUlQgCitIQUwKKzAgICAgNSAgICA1CisKKyNFTlVNIERJU0FCTEUgICAgICAgICAgICAgICAgMAorI0VOVU0gQ1RTICAgICAgICAgICAgICAgICAgICAxCisjRU5VTSBSVFMgICAgICAgICAgICAgICAgICAgIDIKKyNFTlVNIERVQUxfQ1RTICAgICAgICAgICAgICAgMworI0VOVU0gUlRTX0FMV0FZUyAgICAgICAgICAgICA0CisjRU5VTSBBVVRPICAgICAgICAgICAgICAgICAgIDUKKworCisKKworCisKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqIDExRyBTaG9ydCBQcmVhbWJsZSBFbmFibGUKKyoKKworV05JX0NGR18xMUdfU0hPUlRfUFJFQU1CTEVfRU5BQkxFRCAgICBJICAgIDQgICAgOQorViAgICBSVyAgICBOUCAgUkVTVEFSVAorTk9ORQorMCAgICAxICAgIDAKK1YgICAgUlcgICAgTlAgIFJFU1RBUlQKK05PTkUKKzAgICAgMSAgICAwCisKKyoKKyogMTFHIFNob3J0IFNsb3QgVGltZSBFbmFibGUgKGNoYW5nZSByZXF1aXJlcyByZXN0YXJ0KQorKiBUaGlzIGlzIHRoZSBhZG1pbiBzdGF0ZSBvZiBzaG9ydCBzbG90IHN1cHBvcnQuCisKK1dOSV9DRkdfMTFHX1NIT1JUX1NMT1RfVElNRV9FTkFCTEVEICAgIEkgICAgNCAgICA5CitWICAgIFJXICAgIE5QICBSRVNUQVJUCitOT05FCiswICAgIDEgICAgMQorViAgICBSVyAgICBOUCAgUkVTVEFSVAorTk9ORQorMCAgICAxICAgIDEKKworKgorKiBDYWxpYnJhdGlvbiBwZXJpb2RpY2l0eSAobWludXRlcykKKyoKKworV05JX0NGR19DQUxfUEVSSU9EICAgIEkgICAgNCAgICAxMgorViAgICBSVyAgICBOUAorSEFMCisyICAgIDEwICAgIDUKK1YgICAgUlcgICAgTlAKK0hBTAorMiAgICAxMCAgICA1CisKKyoKKyogU3RhdGlzdGljcyBjb2xsZWN0aW9uIHBlcmlvZGljaXR5IChzZWNvbmRzKQorKgorCitXTklfQ0ZHX1NUQVRTX1BFUklPRCAgICBJICAgIDQgICAgMTIKK1YgICAgUlcgICAgTlAKK0hBTAorMSAgICAxMCAgICAxMAorViAgICBSVyAgICBOUAorSEFMCisxICAgIDEwICAgIDEwCisKKyoKKyogQ2FsaWJyYXRpb24gb24vb2ZmIGNvbnRyb2wKKyoKKworV05JX0NGR19DQUxfQ09OVFJPTCAgICBJICAgIDQgICAgMTIKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAxICAgIDAKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAxICAgIDAKKworI0VOVU0gQ0FMX09OICAwCisjRU5VTSBDQUxfT0ZGIDEKKworCisqCisqIFBhcmFtZXRlciB0byBhbGxvdyAxMWcgb25seSBTVEFzIHdoaWxlIG9wZXJhdGluZyBpbiAxMWcgbW9kZQorKgorCitXTklfQ0ZHXzExR19PTkxZX1BPTElDWSAgICBJICAgIDQgICAgMTIKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgICAgMSAgICAgMAorViAgICBSVyAgICBOUAorTk9ORQorMCAgICAxICAgICAwCisKKyoKKyogUGFja2V0IENsYXNzaWZpY2F0aW9uCisqIFRoaXMgZmxhZyBpcyBhIGJpdG1hc2sgdXNlZCB0byBpbmRpY2F0ZSB3aGljaAorKiBmcmFtZSBjbGFzc2lmaWVyIHRvIGJlIGVuYWJsZWQ6CisqICAgIGIwOiBEU0NQCisqICAgIGIxOiA4MDIuMVAKKyoKKworV05JX0NGR19QQUNLRVRfQ0xBU1NJRklDQVRJT04gICAgSSAgICA0ICAgIDEyCitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMyAgICAwCitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMyAgICAwCisKKyNFTlVNICBESVNBQkxFRCAgMAorI0VOVU0gIERTQ1AgICAgICAxCisjRU5VTSAgODAyMVAgICAgIDIKKyN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xdWlyZXMgcmVzdGFydCkKKyogVGFrZXMgZWZmZWN0IG9ubHkgaWYgV01FIGlzIGFsc28gZW5hYmxlZAorKgorCitXTklfQ0ZHX1dTTV9FTkFCTEVEICAgIEkgICAgNCAgICA4CitWICAgIFJXICAgIE5QCitOT05FCiswICAgIDEgICAgIDAKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgICAgMSAgICAgMAorCisqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogUHJvcHJpZXRhcnkgSUUgY2FwYWJpbGl0eSBlbmFibGUKKyogYml0IG1hcHBlZDoKKyogIDA6SENGICAgIDE6MTFlUW9zICAgICAyOldNRSAgICAgIDM6V1NNICA0OkVYVF9SQVRFUworKiAgNTpFWFRSQVRFX1NUT1AKKyogIDY6VGl0YW4gZGV2aWNlICAgICAgICAgIDc6VGF1cnVzIERldmljZQorKiAxMzpFRENBICAxNDpMT0FESU5GTyAgMTU6VkVSU0lPTgorKgorCitXTklfQ0ZHX1BST1BfQ0FQQUJJTElUWSAgICBJICAgIDQgICAgOAorViAgICBSVyAgICBOUAorTk9ORQorMCAgICAweGZmZmYgICAgIDB4ZTBiZgorViAgICBSVyAgICBOUAorTk9ORQorMCAgICAweGZmZmYgICAgIDB4YzBhOQorCisjRU5VTSBIQ0YgICAgICAgICAgMAorI0VOVU0gMTFFUU9TICAgICAgIDEKKyNFTlVNIFdNRSAgICAgICAgICAyCisjRU5VTSBXU00gICAgICAgICAgMworI0VOVU0gRVhUUkFURVMgICAgIDQKKyNFTlVNIEVYVFJBVEVfU1RPUCA1CisjRU5VTSBUSVRBTiAgICAgICAgNgorI0VOVU0gVEFVUlVTICAgICAgNworI0VOVU0gRURDQVBBUkFNUyAgIDEzCisjRU5VTSBMT0FESU5GTyAgICAgMTQKKyNFTlVNIFZFUlNJT04gICAgICAxNQorI0VOVU0gTUFYQklUT0ZGU0VUIDE1CisKKyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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ICAyMDAgICAwIDggIDAgMjU1ICAyMDAKK1YgICBSVyAgTlAgUkVTVEFSVAorTk9ORQorMTcgICAwIDIgICAwIDggIDAgMjU1ICAyMDAgICAwIDggIDAgMjU1ICAyMDAgICAwIDggIDAgMjU1ICAyMDAKKworKgorKiBQcm9maWxlIDIoVGl0YW4gRGVtbykgcGFyYW1ldGVycyBBQ19WTyBCcm9hZGNhc3QKKyogQUNNLCBBSUZTTiwgW0NXbWluLCBDV21heCwgVHhPcF0tMTFBLzExQi8xMUcKKyoKKworV05JX0NGR19FRENBX1RJVF9ERU1PX0FDVk8gICBTICAgMjAgIDgKK1YgICBSVyAgTlAgUkVTVEFSVAorTk9ORQorMTcgICAwIDIgICAwIDggIDAgMjU1ICAyMDAgICAwIDggIDAgMjU1ICAyMDAgICAwIDggIDAgMjU1ICAyMDAKK1YgICBSVyAgTlAgUkVTVEFSVAorTk9ORQorMTcgICAwIDIgICAwIDggIDAgMjU1ICAyMDAgICAwIDggIDAgMjU1ICAyMDAgICAwIDggIDAgMjU1ICAyMDAKKworKgorKiBSYWRhciBkZXRlY3RvciBmbGFnIGVuYWJsZS9kaXNhYmxlCisqCisKK1dOSV9DRkdfUkRFVF9GTEFHICAgSSAgIDQgICA5CitWICAgIFJXICAgIE5QCitOT05FCiswICAgIDEgICAgMAorViAgICBSVyAgICBOUAorTk9ORQorMCAgICAxICAgIDAKKworI0VOVU0gRU5BQkxFICAxCisjRU5VTSBESVNBQkxFIDAKKworV05JX0NGR19SQURBUl9DSEFOTkVMX0xJU1QgICAgUyAgICAyMCAgICA4CitWICAgIFJXICAgIE5QIFJFU1RBUlQKK05PTkUKKzE1ICAgNTIgNTYgNjAgNjQgMTAwIDEwNCAxMDggMTEyIDExNiAxMjAgMTI0IDEyOCAxMzIgMTM2IDE0MAorViAgICBSVyAgICBOUCBSRVNUQVJUCitOT05FCisxNSAgIDUyIDU2IDYwIDY0IDEwMCAxMDQgMTA4IDExMiAxMTYgMTIwIDEyNCAxMjggMTMyIDEzNiAxNDAKKworKgorKiBMb2NhbCBQb3dlciBDb25zdHJhaW50IChkQm0pCisqCisKK1dOSV9DRkdfTE9DQUxfUE9XRVJfQ09OU1RSQUlOVCAgICBJICAgIDQgICAgMTIKK1YgICAgUlcgICAgTlAgUkVTVEFSVAorTk9ORQorMCAgICAyNTUgICAgMAorViAgICBSVyAgICBOUCBSRVNUQVJUCitOT05FCiswICAgIDI1NSAgICAwCisKKyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIEFkbWlzc2lvbiBDb250cm9sIFBvbGljeQorKiB1c2VkIGZvciBhZG1pdHRpbmcgdHNwZWMncyB3aGVuIGVpdGhlciBlZGNhIG9yIGhjY2EgYXJlIGluIHVzZQorKgorCitXTklfQ0ZHX0FETUlUX1BPTElDWSAgSSAgIDQgICA4CitWICBSVyAgTlAgIFJFU1RBUlQKK05PTkUKKzAgIDIgICAwCitWICBSVyAgTlAKK1NDSAorMCAgMiAgIDAKKworI0VOVU0gIEFETUlUX0FMTCAgIDAKKyNFTlVNICBSRUpFQ1RfQUxMICAxCisjRU5VTSAgQldfRkFDVE9SICAgMgorCisqCisqIE92ZXJzdWJzY3JpcHRpb24gZmFjdG9yIGZvciBhZG1pc3Npb24gY29udHJvbAorKiB2YWxpZCBvbmx5IHdoZW4gYWRtaXQgcG9saWN5IGlzIHNldCB0byBCV19GQUNUT1IKKyogdW5pdHMgYXJlIGluIHRlcm1zIG9mIDEvMTB0aCBvZiBhdmFpbGFibGUgYmFuZHdpZHRoCisqCisKK1dOSV9DRkdfQURNSVRfQldGQUNUT1IgIEkgICA0ICAgOAorViAgUlcgIE5QICBSRVNUQVJUCitOT05FCiswICAxMDAgICAyMAorViAgUlcgIE5QCitTQ0gKKzAgIDEwMCAgIDIwCisKKyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIE51bWJlciBvZiAiY29uc2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MDAwMDAKK1YgICAgUk8gICBOUCAgICAgIFJFU1RBUlQKK0xJTQorMCAgICAweGZmZmZmZmZmICAgIDB4MDAwMDAwMDAKKworKgorKiA2LiBBbnRlbm5hIFNlbGVjdGlvbiBDYXBhYmlsaXRpZXM6IDEgYnl0ZSBzaXplCisqCitXTklfQ0ZHX0FTX0NBUCAgICBJICAgIDQgICAgNworViAgICBSVyAgIFAgICAgICBSRVNUQVJUCitMSU0KKzAgICAgMHhmZiAgICAweDAwCitWICAgIFJXICAgUCAgICAgIFJFU1RBUlQKK0xJTQorMCAgICAweGZmICAgIDB4MDAKKworI0VOVU0gQU5URU5OQV9TRUxFQ1RJT04gICAgICAgICAgICAwCisjRU5VTSBFWFBMSUNJVF9DU0lfRkVFREJBQ0tfVFggICAgIDEKKyNFTlVNIEFOVEVOTkFfSU5ESUNFU19GRUVEQkFDS19UWCAgMgorI0VOVU0gRVhQTElDSVRfQ1NJX0ZFRURCQUNLICAgICAgICAzCisjRU5VTSBBTlRFTk5BX0lORElDRVNfRkVFREJBQ0sgICAgIDQKKyNFTlVNIFJYX0FTICAgICAgICAgICAgICAgICAgICAgICAgNQorI0VOVU0gVFhfU09VTkRJTkdfUFBEVVMgICAgICAgICAgICA2CisjRU5VTSBSRVNFUlZFRCAgICAgICAgICAgICAgICAgICAgIDcKKworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogIEJlYWNvbiAgSFQgKEhpZ2ggVGhyb3VnaCkgSW5mbyBJRQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIDMuIEhUIEluZm8gRmllbGQxOiAxIGJ5dGUgc2l6ZS4KKyoKKyogU2Vjb25kYXJ5IENoYW5uZWwgT2Zmc2V0IGlzIHNldCB0byAzIChEb3duKSBieSBkZWZhdWx0IGFuZCB3aWxsCisqICAgICAgICAgICAgICAgICAgICAgICAgICAgYmUgdXBkYXRlZCBkeW5hbWlj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NCAgICAxMAorViAgICBSVyAgICBQCitMSU0KKzAgICAgMHhmZmZmICAgIDB4MDAKK1YgICAgUlcgICAgUAorTElNCiswICAgIDB4ZmZmZiAgICAweDAwCisKKyNFTlVNIE9QX01PREUgICAgICAgICAgICAgICAgICAgICAgICAgIDAKKyNFTlVNIE5PTl9HRl9ERVZJQ0VTX1BSRVNFTlQgIDIKKyNFTlVNIFJFU0VSVkVEICAgICAgICAgICAgICAgICAgICAgICAgIDMKKworKgorKiA1LiBIVCBJbmZvIEZpZWxkMzogMiBieXRlcworKgorKiBmZWRjIGJhOTggNzY1NCAzMjEwCisqIDAwMDAgMDAwMCAwMDAwIDAwMDAKKyoKKyogTFNJRyBUWE9QIEZ1bGwgUHJvdGVjdGlvbiB3aWxsIGJlIHplcm8gdG8gYmVnaW4gd2l0aCBhbmQKKyogdXBkYXRlZCBkeW5hbWljYWxseS4KKyogRXZlcnl0aGluZyBlbHNlIGlzIG5vdCBzdXBwb3J0ZWQgYXQgdGhpcyBtb21lbnQuCisqCitXTklfQ0ZHX0hUX0lORk9fRklFTEQzICAgIEkgICAgNCAgICAxMAorViAgICBSVyAgICBQCitMSU0KKzAgICAgMHhmZmZmICAgIDB4MDAwMAorViAgICBSVyAgICBQCitMSU0KKzAgICAgMHhmZmZmICAgIDB4MDAwMAorCisjRU5VTSBCQVNJQ19TVEJDX01DUyAgICAgICAgICAgICAgICAgICAgICAwCisjRU5VTSBEVUFMX1NUQkNfUFJPVEVDVElPTiAgICAgICAgICAgICAgICA3CisjRU5VTSBTRUNPTkRBUllfQkVBQ09OICAgICAgICAgICAgICAgICAgICA4CisjRU5VTSBMU0lHX1RYT1BfUFJPVEVDVElPTl9GVUxMX1NVUFBPUlQgICA5CisjRU5VTSBQQ09fQUNUSVZFICAgICAgICAgICAgICAgICAgICAgICAgIDEwCisjRU5VTSBQQ09fUEhBU0UgICAgICAgICAgICAgICAgICAgICAgICAgIDExCisjRU5VTSBSRVNFUlZFRCAgICAgICAgICAgICAgICA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yoKKyogTWF4aW11bSBBTVBEVSBMZW5ndGgKKyogQnkgZGVmYXVsdCBzZXQgdG8gemVybyBmb3IgMzg5NSBvY3RldHMKKyoKK1dOSV9DRkdfVkhUX01BWF9NUERVX0xFTkdUSCAgSSAgICA0ICAgIDE5CitWICAgIFJXICAgIE5QICAgIAorTElNCiswICAgIDIgICAgMAorViAgICBSVyAgICBOUCAgICAKK0xJTQorMCAgICAyICAgIDAKKworKgorKiBTdXBwb3J0ZWQgQ2hhbm5lbCBXaWR0aCBTZXQKKyogQnkgZGVmYXVsdCBzZXQgdG8gemVybyBmb3IgCisqIFNUQXMgZG9lcyBub3Qgc3VwcG9ydCBlaXRoZXIgMTYwIG9yIDgwKzgwTUh6CisqCitXTklfQ0ZHX1ZIVF9TVVBQT1JURURfQ0hBTl9XSURUSF9TRVQgIEkgICAgNCAgICAxOQorViAgICBSVyAgICBOUCAgICAKK0xJTQorMCAgICAwICAgIDAKK1YgICAgUlcgICAgTlAgICAgCitMSU0KKzAgICAgMCAgICAwCisKKyoKKyogTERQQyBDb2RpbmcgQ2FwYWJpbGl0eQorKiBSaXZhL1Byb250byBzdXBwb3J0cywgZGVmYXVsdCBzZXQgdG8gMQorKgorV05JX0NGR19WSFRfTERQQ19DT0RJTkdfQ0FQICBJICAgIDQgICAgMTkKK1YgICAgUlcgICAgTlAgICAgCitMSU0KKzAgICAgMSAgICAwCitWICAgIFJXICAgIE5QICAgIAorTElNCiswICAgIDEgICAgMAorCisqCisqIFNob3J0IEdJIGZvciA4ME1IegorKiBSaXZhL1Byb250byBzdXBwb3J0cywgZGVmYXVsdCBzZXQgdG8gMQorKgorV05JX0NGR19WSFRfU0hPUlRfR0lfODBNSFogIEkgICAgNCAgICAxOQorViAgICBSVyAgICBOUCAgICAKK0xJTQorMCAgICAxICAgIDEKK1YgICAgUlcgICAgTlAgICAgCitMSU0KKzAgICAgMSAgICAxCisKKyoKKyogU2hvcnQgR0kgZm9yIDE2ME1IeiBhbmQgODArODBNSHoKKyogUml2YS9Qcm9udG8gZG9lcyBub3Qgc3VwcG9ydHMsIGRlZmF1bHQgc2V0IHRvIDAKKyoKK1dOSV9DRkdfVkhUX1NIT1JUX0dJXzE2MF9BTkRfODBfUExVU184ME1IWiAgSSAgICA0ICAgIDE5CitWICAgIFJXICAgIE5QICAgIAorTElNCiswICAgIDEgICAgMAorViAgICBSVyAgICBOUCAgICAKK0xJTQorMCAgICAxICAgIDAKKworKgorKiBTdXBwb3J0IGZvciBUcmFuc21pc3Npb24gb2YgMngxIFNUQkMKKyogUml2YS9Qcm9udG8gZG9lcyBub3Qgc3VwcG9ydHMsIGRlZmF1bHQgc2V0IHRvIDAKKyoKK1dOSV9DRkdfVkhUX1RYU1RCQyAgSSAgICA0ICAgIDE5CitWICAgIFJXICAgIE5QICAgIAorTElNCiswICAgIDEgICAgMAorViAgICBSVyAgICBOUCAgICAKK0xJTQorMCAgICAxICAgIDAKKworKgorKiBTdXBwb3J0IGZvciBSZWNlcHRpb24gb2YgUFBEVXMgdXNpbmcgU1RCQworKiBSaXZhL1Byb250byBzdXBwb3J0cywgZGVmYXVsdCBzZXQgdG8gMQorKgorV05JX0NGR19WSFRfUlhTVEJDICBJICAgIDQgICAgMTkKK1YgICAgUlcgICAgTlAgICAgCitMSU0KKzAgICAgMSAgICAxCitWICAgIFJXICAgIE5QICAgIAorTElNCiswICAgIDEgICAgMQorCisqCisqIFN1cHBvcnQgZm9yIE9wZXJhdGluZyBhcyBTVSBCZWFtZm9ybWVyCisqIFJpdmEvUHJvbnRvIGRvZXMgbm90IHN1cHBvcnRzLCBkZWZhdWx0IHNldCB0byAwCisqCitXTklfQ0ZHX1ZIVF9TVV9CRUFNRk9STUVSX0NBUCAgSSAgICA0ICAgIDE5CitWICAgIFJXICAgIE5QICAgIAorTElNCiswICAgIDEgICAgMAorViAgICBSVyAgICBOUCAgICAKK0xJTQorMCAgICAxICAgIDAKKworKgorKiBTdXBwb3J0IGZvciBPcGVyYXRpbmcgYXMgU1UgQmVh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gc3VwcG9ydCwgZGVmYXVsdCBzZXQgdG8gMAorKgorV05JX0NGR19WSFRfTVVfQkVBTUZPUk1FUl9DQVAgIEkgICAgNCAgICAxOQorViAgICBSVyAgICBOUCAgICAKK0xJTQorMCAgICAxICAgIDAKK1YgICAgUlcgICAgTlAgICAgCitMSU0KKzAgICAgMSAgICAwCisKKyoKKyogTVUgQmVhbWZvcm1lZSBDYXBhYmxlCisqIFJpdmEgZG9lcyBub3Qgc3VwcG9ydCBidXQgcHJvbnRvIHN1cHBvcnRzLCBkZWZhdWx0IHNldCB0byAwCisqCitXTklfQ0ZHX1ZIVF9NVV9CRUFNRk9STUVFX0NBUCAgSSAgICA0ICAgIDE5CitWICAgIFJXICAgIE5QICAgIAorTElNCiswICAgIDEgICAgMAorViAgICBSVyAgICBOUCAgICAKK0xJTQorMCAgICAxICAgIDAKKworKgorKiBWSFQgVFhPUCBQUworKiBSaXZhIGRvZXMgbm90IHN1cHBvcnQgYnV0IHByb250byBzdXBwb3J0cywgZGVmYXVsdCBzZXQgdG8gMAorKgorV05JX0NGR19WSFRfVFhPUF9QUyAgSSAgICA0ICAgIDE5CitWICAgIFJXICAgIE5QICAgIAorTElNCiswICAgIDEgICAgMAorViAgICBSVyAgICBOUCAgICAKK0xJTQorMCAgICAxICAgIDAKKworKgorKiArSFRDLVZIVCBDYXBhYmxlCisqIFJpdmEgZG9lcyBub3Qgc3VwcG9ydCBidXQgcHJvbnRvIHN1cHBvcnRzLCBkZWZhdWx0IHNldCB0byAwCisqCitXTklfQ0ZHX1ZIVF9IVENfVkhUQ19DQVAgIEkgICAgNCAgICAxOQorViAgICBSVyAgICBOUCAgICAKK0xJTQorMCAgICAxICAgIDAKK1YgICAgUlcgICAgTlAgICAgCitMSU0KKzAgICAgMSAgICAwCisKKyoKKyogTWF4aW11bSBBTVBEVSBMZW5ndGggZXhwb25lbnQgcmFuZ2UgMC03CisqIDJeKDEzK01heCBBTVBEVSBMZW5ndGgpLTEsIGRlZmF1bHQgc2V0IHRvIDAKKyoKK1dOSV9DRkdfVkhUX0FNUERVX0xFTl9FWFBPTkVOVCAgSSAgICA0ICAgIDE5CitWICAgIFJXICAgIE5QICAgIAorTElNCiswICAgIDcgICAgMworViAgICBSVyAgICBOUCAgICAKK0xJTQorMCAgICA3ICAgIDMKKworKgorKiBWSFQgTGluayBBZGFwdGF0aW9uIENhcGFibGUKKyogUml2YSBkb2VzIG5vdCBzdXBwb3J0IGJ1dCBwcm9udG8gc3VwcG9ydHMsIGRlZmF1bHQgc2V0IHRvIDAKKyoKK1dOSV9DRkdfVkhUX0xJTktfQURBUFRBVElPTl9DQVAgIEkgICAgNCAgICAxOQorViAgICBSVyAgICBOUCAgICAKK0xJTQorMCAgICAzICAgIDAKK1YgICAgUlcgICAgTlAgICAgCitMSU0KKzAgICAgMyAgICAwCisKKyoKKyogVkhUIFJ4IEFudGVubmEgUGF0dGVybiBDb25zaXN0ZW5jeQorKgorV05JX0NGR19WSFRfUlhfQU5UX1BBVFRFUk4gIEkgICAgNCAgICAxOQorViAgICBSVyAgICBOUCAgICAKK0xJTQorMCAgICAxICAgIDEKK1YgICAgUlcgICAgTlAgICAgCitMSU0KKzAgICAgMSAgICAxCisKKyoKKyogVkhUIFR4IEFudGVubmEgUGF0dGVybiBDb25zaXN0ZW5jeQorKgorV05JX0NGR19WSFRfVFhfQU5UX1BBVFRFUk4gIEkgICAgNCAgICAxOQorViAgICBSVyAgICBOUCAgICAKK0xJTQorMCAgICAxICAgIDEKK1YgICAgUlcgICAgTlAgICAgCitMSU0KKzAgICAgMSAgICAxCisKKyoKKyogUnhNQ1MgTWFwIGlzIDE2IGJpdHMsIFRoZSAyYml0IE1heCBNQ1MgZm9yIG4gU1MgZmllbGQuCisqIEluZGljYXRlcyB0aGUgbWF4aW11bSBNQ1MgdGhhdCBjYW4gYmUgcmVjZWl2ZWQgZm9yIGVhY2gKKyogbnVtYmVyIG9mIHNwYWNpYWwgc3RyZWFtcy4gUml2YSBzdXBwb3J0cyBNQ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QgdG8gemVybyBmb3IgMjAvNDBNSHouCisqIHNldCB0byAxIGZvciA4ME1Iei4gMi0+MTYwTWh6LCAzLT44MCs4ME1IegorKgorV05JX0NGR19WSFRfQ0hBTk5FTF9XSURUSCAgSSAgICA0ICAgIDE5CitWICAgIFJXICAgIE5QICAgIAorTElNCiswICAgIDMgICAgMAorViAgICBSVyAgICBOUCAgICAKK0xJTQorMCAgICAzICAgIDAKKworI0VOVU0gMjBfNDBNSFogICAgICAgMAorI0VOVU0gODBNSFogICAgICAgICAgMQorI0VOVU0gMTYwTUhaICAgICAgICAgMgorI0VOVU0gODBfUExVU184ME1IWiAgMworKgorKiBDaGFubmVsIGNlbnRlciBmcmVxIFNlZzEgCisqCitXTklfQ0ZHX1ZIVF9DSEFOTkVMX0NFTlRFUl9GUkVRX1NFR01FTlQxICBJICAgIDQgICAgMTkKK1YgICAgUlcgICAgTlAgICAgCitMSU0KKzAgICAgMjU2ICAgMCAKK1YgICAgUlcgICAgTlAgICAgCitMSU0KKzAgICAgMjU2ICAgMAorCisqCisqIENoYW5uZWwgY2VudGVyIGZyZXEgU2VnMiBmb3IgODArODAgTWh6CisqCitXTklfQ0ZHX1ZIVF9DSEFOTkVMX0NFTlRFUl9GUkVRX1NFR01FTlQyICBJICAgIDQgICAgMTkKK1YgICAgUlcgICAgTlAgICAgCitMSU0KKzAgICAgMCAgICAgMCAKK1YgICAgUlcgICAgTlAgICAgCitMSU0KKzAgICAgMCAgICAgMAorCisqCisqIEJhc2ljIE1DUyBTZXQKKyoKK1dOSV9DRkdfVkhUX0JBU0lDX01DU19TRVQgIEkgICAgNCAgICAxOQorViAgICBSVyAgICBOUCAgICAKK0xJTQorMCAgICAweEZGRkYgICAgMHhGRkZFCitWICAgIFJXICAgIE5QICAgIAorTElNCiswICAgIDB4RkZGRiAgICAweEZGRkUKKworKgorKiBNVS1NSU1PIENhcGFibGUgU1RBIENvdW50CisqCitXTklfQ0ZHX1ZIVF9NVV9NSU1PX0NBUF9TVEFfQ09VTlQgIEkgICAgNCAgICAxOQorViAgICBSVyAgICBOUCAgICAKK0xJTQorMCAgICAgNCAgICAwIAorViAgICBSVyAgICBOUCAgICAKK0xJTQorMCAgICAgNCAgICAgMAorCisqCisqIFNwYXRpYWwgU3RyZWFtIFVuZGVyLVV0aWxpemF0aW9uCisqCitXTklfQ0ZHX1ZIVF9TU19VTkRFUl9VVElMICBJICAgIDQgICAgMTkKK1YgICAgUlcgICAgTlAgICAgCitMSU0KKzAgICAgIDAgICAgMCAKK1YgICAgUlcgICAgTlAgICAgCitMSU0KKzAgICAgIDAgICAgIDAKKworKgorKiBGb3J0eSBNSFogVXRpbGl6YXRpb24KKyoKK1dOSV9DRkdfVkhUXzQwTUhaX1VUSUxJWkFUSU9OICBJICAgIDQgICAgMTkKK1YgICAgUlcgICAgTlAgICAgCitMSU0KKzAgICAgIDAgICAgMCAKK1YgICAgUlcgICAgTlAgICAgCitMSU0KKzAgICAgIDAgICAgIDAKKworKgorKiBFaWdodHkgTUh6IFV0aWxpemF0aW9uCisqCitXTklfQ0ZHX1ZIVF84ME1IWl9VVElMSVpBVElPTiAgSSAgICA0ICAgIDE5CitWICAgIFJXICAgIE5QICAgIAorTElNCiswICAgICAwICAgIDAgCitWICAgIFJXICAgIE5QICAgIAorTElNCiswICAgICAwICAgICAwCisKKyoKKyogSHVuZHJlZCBTaXh0eSBNSHogVXRpbGl6YXRpb24KKyoKK1dOSV9DRkdfVkhUXzE2ME1IWl9VVElMSVpBVElPTiAgSSAgICA0ICAgIDE5CitWICAgIFJXICAgIE5QICAgIAorTElNCiswICAgICAwICAgIDAgCitWICAgIFJXICAgIE5QICAgIAorTElNCiswICAgICAwICAgICAwCisKKyoKKyogTWF4aW11bSBBTVNEVSBsZW5ndGgKKyogVXNlciBjYW4gc2V0IGl0IHRvIGVpdGhlciAzODM5IG9yIDc5MzUgYnl0ZXMuIAorKgorV05JX0NGR19NQVhfQU1TRFVfTEVOR1RIICAgIEkgICAgNCAgICA3CitWICAgIFJXICAgIE5QICAgIFJFU1RBUlQKK0xJTQorMCAgICAxICAgIDAKK1YgICAgUlcgICAgTlAgICAgUkVTVEFSVAorTElNCiswICAgIDEgICAgMAorCisjRU5VTSBTSE9SVF8zODM5X0JZVEVTICAgMAorI0VOVU0gTE9OR183OTM1X19CWVRFUyAgIDEKKworCisqCisqIE1pbmltdW0gTVBEVSBTdGFydCBTcGFjaW5nCisqIERldGVybWluZXMgdGhlIG1pbmltdW0gdGltZSBiZXR3ZWVuIHRoZSBzdGFydCBvZiBhZGphY2VudCBNUERVcyB3aXRoaW4gYW4gQU1QRFUuCisqIFNldCB0byAwIGZvciBubyByZXN0cmljdGlvbgorKiBTZXQgdG8gMSBmb3IgMS80IHMKKyogU2V0IHRvIDIgZm9yIDEvMiBzCisqIFNldCB0byAzIGZvciAxIHMKKyogU2V0IHRvIDQgZm9yIDIgcworKiBTZXQgdG8gNSBmb3IgNCBzCisqIFNldCB0byA2IGZvciA4IHMKKyogU2V0IHRvIDcgZm9yIDE2IHMKKyogZGVmYXVsdCBpcyBzZXQgdG8gMAorV05JX0NGR19NUERVX0RFTlNJVFkgICAgSSAgICA0ICAgIDcKK1YgICAgUlcgICAgTlAgICAgUkVTVEFSVAorTElNCiswICAgIDcgICAgMAorViAgICBSVyAgICBOUCAgICBSRVNUQVJUCitMSU0KKzAgICAgNyAgICAwCisKKyoKKyogTlVNIEJVRkZFUlMgQURWRVJUSVNFRAorKiBEZWZpbmVzIG51bWJlciBvZiBidWZmZXJzIGFkdmVydGlzZWQgaW4gQUREQkEKKyoKK1dOSV9DRkdfTlVNX0JVRkZfQURWRVJUICBJICAgIDQgICAgNworViAgICBSVyAgICBOUCAgICAKK0xJTQorMCAgICAxMjggICAgNjQKK1YgICAgUlcgICAgTlAgICAgCitMSU0KKzAgICAgMTI4ICAgIDY0CisKKyoKKyogTWF4aW11bSBSeCBBTVBEVSBGYWN0b3IKKyogSW5kaWNhdGVzIHRoZSBtYXhpbXVtIGxlbmd0aCBvZiB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UCitMSU0KKzAgICAgMSAgICAxCisKKworI0VOVU0gRU5BQkxFICAgIDEKKyNFTlVNIERJU0FCTEUgICAwCisKKworKgorKiBSSUZTIHN1cHBvcnQgb24gVFggU2lkZQorKiBvbiBSWCBzaWRlIGl0IGlzIGFsd2F5cyBzdXBwb3J0ZWQsIGl0IGlzIG1hbmRhdG9yeQorKgorV05JX0NGR19SSUZTX0VOQUJMRUQgICBJICAgNCAgIDcKK1YgICAgUlcgICAgTlAgUkVTVEFSVAorTk9ORQorMCAgICAxICAgIDEKK1YgICAgUlcgICAgTlAgUkVTVEFSVAorTk9ORQorMCAgICAxICAgIDEKKworI0VOVU0gRU5BQkxFICAxCisjRU5VTSBESVNBQkxFIDAKKworCisqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKgorKiBQb3dlciBTYXZlIENvbmZpZ3VyYXRpb24KKyoKK1dOSV9DRkdfTUFYX1BTX1BPTEwgICAgSSAgICA0ICAgIDUKK1YgICAgUlcgICAgTlAKK0xJTQorMCAgICAgMjU1ICAgICAwCitOViAgICBSVyAgICBOUAorTElNCiswICAgICAyNTUgICAgIDAKKworCitXTklfQ0ZHX05VTV9CRUFDT05fUEVSX1JTU0lfQVZFUkFHRSAgICBJICAgIDQgICAgNQorViAgICBSVyAgICBOUAorTElNCisxICAgIDIwICAgIDIwCitOViAgICBSVyAgICBOUAorTElNCisxICAgIDIwICAgIDIwCisKKworKgorKiBQZXJpb2QgZm9yIHdoaWNoIEZpcm13YXJlIHdpbGwgY29sbGVjdCB0aGUgCisqIFJTU0kgc3RhdHMuIEl0cyBpbiB1bml0cyBvZiBiZWFjb24gaW50ZXJ2YWwuIAorKiBSc3NpIEZpbHRlciBwZXJpb2Qgc2hvdWxkIGFsd2F5cyBiZSA+PQorKiB0aGUgbnVtX2JlYWNvbl9wZXJfcnNzaV9hdmVyYWdlLgorKgorV05JX0NGR19SU1NJX0ZJTFRFUl9QRVJJT0QgICAgSSAgICA0ICAgIDUKK1YgICAgUlcgICAgTlAKK0xJTQorMCAgICAyNTUgICAgNQorTlYgICAgUlcgICAgTlAKK0xJTQorMCAgICAyNTUgICAgNQorCisKK1dOSV9DRkdfTUlOX1JTU0lfVEhSRVNIT0xEICAgIEkgICAgNCAgICA1CitWICAgIFJXICAgIE5QCitMSU0KKzAgICAgMTAgICAgMTAKK05WICAgIFJXICAgIE5QCitMSU0KKzAgICAgMTAgICAgMTAKKworCitXTklfQ0ZHX05USF9CRUFDT05fRklMVEVSICAgIEkgICAgNCAgICA1CitWICAgIFJXICAgIE5QCitMSU0KKzAgICAgMjU1ICAgMTAKK05WICAgIFJXICAgIE5QCitMSU0KKzAgICAgMjU1ICAgIDEwCisKKworV05JX0NGR19CUk9BRENBU1RfRlJBTUVfRklMVEVSX0VOQUJMRSAgICBJICAgIDQgICAgNQorViAgICBSVyAgICBOUAorTElNCiswICAgIDEgICAgMAorTlYgICAgUlcgICAgTlAKK0xJTQorMCAgICAxICAgIDAKKworCitXTklfQ0ZHX1NDQU5fSU5fUE9XRVJTQVZFICAgIEkgICAgNCAgICA1CitWICAgIFJXICAgIE5QCitMSU0KKzAgICAgMSAgICAxCitWICAgIFJXICAgIE5QCitMSU0KKzAgICAgMSAgICAxCisKKworKgorKiBJZ25vcmUgRFRJTSBzdXBwb3J0IC0gSWYgZGlzYWJsZWQodmFsdWU9MCksIEhBTCB3aWxsIAorKiB0cnkgdG8gYWxpZ24gdGhlIExpc3RlbiBJbnRlcnZhbCB0byB0aGUgRFRJTSAKKyogcGVyaW9kIGFuZCB0aGUgZm9sbG93aW5nIHJ1bGVzIHdpbGwgYmUgYXBwbGllZDoKKyogMSkgSWYgTEk9RFRJTSwgdGhlbiBzZXQgTEk9RFRJTQorKiAyKSBJZiBMSTxEVElNLCB0aGVuIGFsaWduIExJIHRvIERUSU0KKyogMykgSWYgTEk+RFRJTSwgdGhlbiBzZXQgTEk9RFRJTSAKKyoKK1dOSV9DRkdfSUdOT1JFX0RUSU0gICAgSSAgICA0ICAgIDUKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgICAgMSAgICAwCitWICAgIFJXICAgIE5QCitOT05FCiswICAgIDEgICAgMAorCisqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKgorKiBXb1dMQU4gQ29uZmlndXJhdGlvbiAgVGhlIGZvbGxvd2luZyBjb25maWd1cmF0aW9ucyAKKyogYXJlIHZhbGlkIG9ubHkgd2hlbiBtYWdpY1BrdEVuYWJsZSA9IDEuIAorKgorV05JX0NGR19XT1dMQU5fVUNBU1RfUEFUVEVSTl9GSUxURVJfRU5BQkxFICAgIEkgICAgNCAgICA1CitWICAgIFJXICAgIE5QCitOT05FCiswICAgICAxICAgICAxCitOViAgICBSVyAgICBOUAorTk9ORQorMCAgICAgMSAgICAgMAorCisKK1dOSV9DRkdfV09XTEFOX0NIQU5ORUxfU1dJVENIX0VOQUJMRSAgICBJICAgIDQgICAgNQorViAgICBSVyAgICBOUAorTk9ORQorMCAgICAgMSAgICAgMQorTlYgICAgUlcgICAgTlAKK05PTkUKKzAgICAgIDEgICAgIDAKKworCitXTklfQ0ZHX1dPV0xBTl9ERUFVVEhfRU5BQkxFICAgIEkgICAgNCAgICA1CitWICAgIFJXICAgIE5QCitOT05FCiswICAgICAxICAgICAxCitOViAgICBSVyAgICBOUAorTk9ORQorMCAgICAgMSAgICAgMAorCisKK1dOSV9DRkdfV09XTEFOX0RJU0FTU09DX0VOQUJMRSAgICBJICAgIDQgICAgNQorViAgICBSVyAgICBOUAorTk9ORQorMCAgICAgMSAgICAgMQorTlYgICAgUlcgICAgTlAKK05PTkUKKzAgICAgIDEgICAgIDAKKworCitXTklfQ0ZHX1dPV0xBTl9NQVhfTUlTU0VEX0JFQUNPTiAgIEkgICAgNCAgICA1CitWICAgIFJXICAgIE5QCitOT05FCiswICAgIDY1NTM1ICAgIDQwCitOViAgICBSVyAgICBOUAorTk9ORQorMCA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aWRlCisqCitXTklfQ0ZHX0JBX1RIUkVTSE9MRF9ISUdIICAgICBJICAgIDQgICAgNworViAgICBSVyAgICBOUCAgIFJFU1RBUlQKK0hBTAorMCAgICAweGZmZmYgICAgMHg4MAorViAgICBSVyAgICBOUAorSEFMCiswICAgIDB4ZmZmZiAgICAweDgwCisKKworKgorKiBNQVggQkEgQnVmZmVycyB0byBiZSBhbGxvY2F0ZWQuCisqIFRoaXMgY291bnQgaXMgc3lzdGVtIHdpZGUuCisqIDE2IGJpdCB3aWRlCisqCitXTklfQ0ZHX01BWF9CQV9CVUZGRVJTICAgICBJICAgIDQgICAgNworViAgICBSVyAgICBOUCAgIFJFU1RBUlQKK0hBTAorMCAgICAyNTYwICAgIDI1NjAKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAyNTYwICAgIDI1NjAKKworCisqCisqIE1BWCBCQSBTZXNzaW9ucy4KKyogVGhpcyBjb3VudCBpcyBzeXN0ZW0gd2lkZS4KKyogMTYgYml0IHdpZGUKKyoKK1dOSV9DRkdfTUFYX0JBX1NFU1NJT05TICAgICBJICAgIDQgICAgNworViAgICBSVyAgICBOUCAgIFJFU1RBUlQKK0hBTAorMCAgICA2NCAgICA0MAorViAgICBSVyAgICBOUAorSEFMCiswICAgIDY0ICAgIDQwCisKKworKgorKiBCQSBzZXR1cCBiYXNlZCBvbiBUcmFmZmljCisqCitXTklfQ0ZHX0JBX0FVVE9fU0VUVVAgICAgIEkgICAgNCAgICA3CitWICAgIFJXICAgIE5QICAgUkVTVEFSVAorSEFMCiswICAgIDEgICAgMQorViAgICBSVyAgICBOUCAgUkVTVEFSVAorSEFMCiswICAgIDEgICAgMQorCisjRU5VTSBFTkFCTEUgIDEKKyNFTlVNIERJU0FCTEUgMAorCisqCisqIERlY2xpbmUgYW4gQUREQkEgUmVxdWVzdAorKgorV05JX0NGR19BRERCQV9SRVFfREVDTElORSAgICAgSSAgICA0ICAgIDcKK1YgICAgUlcgICAgTlAgICBSRVNUQVJUCitMS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CitXTklfQ0ZHX01BWF9NRURJVU1fVElNRSAgICBJICAgIDQgICAgOAorViAgICBSVyAgICBOUAorSEFMCiswICAgIDY1NTM1ICAgIDIwNDgKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICA2NTUzNSAgICAyMDQ4CisKKworKgorKiBNYXhpbXVtIG51bWJlciBvZiBNUERVcyBpbiBzaW5nbGUgQS1NUERVLiAKKyoKK1dOSV9DRkdfTUFYX01QRFVTX0lOX0FNUERVICAgIEkgICAgNCAgICA4CitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgNjU1MzUgICAgNjQKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICA2NTUzNSAgICA2NAorCisKKyoKKyogQXV0byBCU1NJRCAtIFdoZW4gc2V0LCBCU1NJRCBpcyBnZW5lcmF0ZWQgYXV0b21hdGljYWxseSBpbiBJQlNTLCBlbHNlIEJTU0lEIGluIGNmZyB3aWxsIGJlIHVzZWQuCisqCisKK1dOSV9DRkdfSUJTU19BVVRPX0JTU0lEICAgICAgSSAgICA0ICAgMAorViAgICBSVyAgICBOUAorTk9ORQorMCAgICAxICAgICAxCitOViAgIFJXICAgIE5QCitOT05FCiswICAgIDEgICAgIDEKKworKgorKiBJbmNsdWRlIEFkZGl0aW9uYWwgSUVzIGluIHByb2JlIHJlcXVlc3QuCisqCitXTklfQ0ZHX1BST0JFX1JFUV9BREROSUVfRkxBRyAgICBJICAgIDQgICAgMAorViAgICBSVyAgICBOUAorTk9ORQorMCAxIDAKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgMSAwCisKKyoKKyogSW5jbHVkZSBBZGRpdGlvbmFsIElFIGluIHByb2JlIHJlcXVlc3QuCisqCitXTklfQ0ZHX1BST0JFX1JFUV9BREROSUVfREFUQSAgICBTICAgICAyNTUgICAgMAorViAgICBSVyAgICBOUAorTk9ORQorMCAwCitWICAgIFJXICAgIE5QCitOT05FCiswIDAKKworKgorKiBJbmNsdWRlIEFkZGl0aW9uYWwgSUVzIGluIHByb2JlIHJlc3BvbnNlLgorKgorV05JX0NGR19QUk9CRV9SU1BfQURETklFX0ZMQUcgICAgSSAgICA0ICAgIDAKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgMSAwCitWICAgIFJXICAgIE5QCitOT05FCiswIDEgMAorCisqCisqIEluY2x1ZGUgQWRkaXRpb25hbCBJRSBpbiBwcm9iZSByZXNwb25zZS4KKyoKK1dOSV9DRkdfUFJPQkVfUlNQX0FERE5JRV9EQVRBMSAgICBTICAgICAyNTUgICAgMAorViAgICBSVyAgICBOUAorTk9ORQorMCAwCitWICAgIFJXICAgIE5QCitOT05FCiswIDAKKworKgorKiBJbmNsdWRlIEFkZGl0aW9uYWwgSUUgaW4gcHJvYmUgcmVzcG9uc2UuCisqCitXTklfQ0ZHX1BST0JFX1JTUF9BREROSUVfREFUQTIgICAgUyAgICAgMjU1ICAgIDAKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgMAorViAgICBSVyAgICBOUAorTk9ORQorMCAwCisKKyoKKyogSW5jbHVkZSBBZGRpdGlvbmFsIElFIGluIHByb2JlIHJlc3BvbnNlLgorKgorV05JX0NGR19QUk9CRV9SU1BfQURETklFX0RBVEEzICAgIFMgICAgIDI1NSAgICAwCitWICAgIFJXICAgIE5QCitOT05FCiswIDAKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgMAorCisqCisqIEluY2x1ZGUgQWRkaXRpb25hbCBJRXMgaW4gYXNzb2MgcmVzcG9uc2UuCisqCitXTklfQ0ZHX0FTU09DX1JTUF9BREROSUVfRkxBRyAgICBJICAgIDQgICAgMAorViAgICBSVyAgICBOUAorTk9ORQorMCAxIDAKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgMSAwCisKKyoKKyogSW5jbHVkZSBBZGRpdGlvbmFsIElFIGluIGFzc29jIHJlc3BvbnNlLgorKgorV05JX0NGR19BU1NPQ19SU1BfQURETklFX0RBVEEgICAgUyAgICAgMjU1ICAgIDAKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgMAorViAgICBSVyAgICBOUAorTk9ORQorMCAwCisKKyoKKyogSW5jbHVkZSBBZGRpdGlvbmFsIFAyUCBJRXMgaW4gcHJvYmUgcmVxdWVzdC4KKyoKK1dOSV9DRkdfUFJPQkVfUkVRX0FERE5QMlBJRV9GTEFHICAgIEkgICAgNCAgICAwCitWICAgIFJXICAgIE5QCitOT05FCiswIDEgMAorViAgICBSVyAgICBOUAorTk9ORQorMCAxIDAKKworKgorKiBJbmNsdWRlIEFkZGl0aW9uYWwgUDJQIElFIGluIHByb2JlIHJlcXVlc3QuCisqCitXTklfQ0ZHX1BST0JFX1JFUV9BREROUDJQSUVfREFUQSAgICBTICAgICAyNTUgICAgMAorViAgICBSVyAgICBOUAorTk9ORQorMCAwCitWICAgIFJXICAgIE5QCitOT05FCiswIDAKKworCisqCisqIEluY2x1ZGUgQWRkaXRpb25hbCBJRXMgaW4gcHJvYmUgcmVzcG9uc2UvYmVhY29uLgorKgorV05JX0NGR19QUk9CRV9SU1BfQkNOX0FERE5JRV9GTEFHICAgIEkgICAgNCAgICAwCitWICAgIFJXICAgIE5QCitMSU0KKzAgMSAwCitWICAgIFJXICAgIE5QCitMSU0KKzAgMSAwCisKKworKgorKiBJbmNsdWRlIEFkZGl0aW9uYWwgSUVzIGluIHByb2JlIHJlc3BvbnNlL2JlYWNvbi4KKyoKK1dOSV9DRkdfUFJPQkVfUlNQX0JDTl9BREROSUVfREFUQSAgICBTICAgIDI1NSAgICAwCitWICAgIFJXICAgIE5QCitMSU0KKzAgMAorViAgICBSVyAgICBOUAorTElNCiswIDAKKworCisqCisqIHdwc0FwRW5hYmxlIGFuZCB3cHNTdGFFbmFibGUgaXMgc3BlY2lmaWVkIGluIGhlcmUKKyogd3BzQXBFbmFibGUgaXMgYml0ICMwIGFuZCB3cHNTdGFFbmFibGUgaXMgYml0ICMxCisqCitXTklfQ0ZHX1dQU19FTkFCTEUgIEkgICA0ICAgNworViAgICBSVyAgICAgTlAKK0xJTQorMCAgICAwe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ICBOUAorTElNCis2ICAgIDB4YSAweGIgMHhjIDB4ZCAweGUgMHhmIAorViAgICBSVyAgICBOUAorTElNCis2ICAgIDB4YSAweGIgMHhjIDB4ZCAweGUgMHhmIAorCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogVGhlIGZvbGxvd2luZyBjZmdzIGNvbnRhaW5zIHRoZSBwcmltYXJ5IHR5cGUgb2YgdGhlIGRldmljZS4gSXRzIGZvcm1hdAorKiBmb2xsb3dzOgorKgorKiAgMCAxIDIgMworKiAgMCAxIDIgMyA0IDUgNiA3IDggOSAwIDEgMiAzIDQgNSA2IDcgOCA5IDAgMSAyIDMgNCA1IDYgNyA4IDkgMCAxCisqICArLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKworKiAgfCBBdHRyaWJ1dGUgSUQgICAgICAgICAgICAgICAgICAgfCBMZW5ndGggICAgICAgICAgICAgICAgICAgICAgIHwKKyogICstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rCisqICB8IENhdGVnb3J5IElEICAgICAgICAgICAgICAgICAgICB8IE9VSSAoMS0yKSAgICAgICAgICAgICAgICAgICAgfAorKiAgKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSsKKyogIHwgT1VJICgzLTQpICAgICAgICAgICAgICAgICAgICAgIHwgU3ViIENhdGVnb3J5IElEICAgICAgICAgICAgICB8CisqICArLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKworKgorKiBWZW5kb3Itc3BlY2lmaWMgc3ViLWNhdGVnb3JpZXMgIGFyZSBkZXNpZ25hdGVkIGJ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ICAgIE1lZGlhIENlbnRlciAgICAgICAgICAgICAzCisqICBJbnB1dCBEZXZpY2UgICAgICAgICAgMgorKiAgUHJpbnRlcnMsIFNjYW5uZXJzLCAgICAgICAgICAgICBQcmludGVyICAgICAgICAgICAgICAgICAgMQorKiAgRmF4ZXMgYW5kIENvcGllcnMgICAgIDMgICAgICAgICBTY2FubmVyICAgICAgICAgICAgICAgICAgMgorKiAgQ2FtZXJhICAgICAgICAgICAgICAgIDQgICAgICAgICBEaWdpdGFsIFN0aWxsIENhbWVyYSAgICAgMQorKiAgU3RvcmFnZSAgICAgICAgICAgICAgIDUgICAgICAgICBOQVMgICAgICAgICAgICAgICAgICAgICAgMQorKiAgTmV0d29yayAgICAgICAgICAgICAgICAgICAgICAgICBBUCAgICAgICAgICAgICAgICAgICAgICAgMQorKiAgSW5mcmFzdHJ1Y3R1cmUgICAgICAgIDYgICAgICAgICBSb3V0ZXIgICAgICAgICAgICAgICAgICAgMgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTd2l0Y2ggICAgICAgICAgICAgICAgICAgMworKiAgRGlzcGxheXMgICAgICAgICAgICAgIDcgICAgICAgICBUZWxldmlzaW9uICAgICAgICAgICAgICAgMQorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbGVjdHJvbmljIFBpY3R1cmUgRnJhbWUgMgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQcm9qZWN0b3IgICAgICAgICAgICAgICAgMworKiAgTXVsdGltZWRpYSBEZXZpY2VzICAgIDggICAgICAgICBEQVIgICAgICAgICAgICAgICAgICAgICAgMQorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQVlIgICAgICAgICAgICAgICAgICAgICAgMgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQ1ggICAgICAgICAgICAgICAgICAgICAgMworKiAgR2FtaW5nIERldmljZXMgICAgICAgIDkgICAgICAgICBYYm94ICAgICAgICAgICAgICAgICAgICAgMQorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBYYm94MzYwICAgICAgICAgICAgICAgICAgMgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQbGF5c3RhdGlvbiAgICAgICAgICAgICAgMworKiAgVGVsZXBob25lICAgICAgICAgICAgIDEwICAgICAgICBXaW5kb3dzIE1vYmlsZSAgICAgICAgICAgMQorKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisKKyogUU5FLVRPRE86IFJlbmFtZSB0aGVpciBjZmcgZnJvbSAnV05JX0NGR19QUklNX0RFVklDRV9DQVRFR09SWScKK1dOSV9DRkdfV1BTX1BSSU1BUllfREVWSUNFX0NBVEVHT1JZICBJICAgNCAgIDcKK1YgICAgUlcgICAgIE5QCitMSU0KKzAgICAgMHhmZmZmICAgMQorViAgICBSVyAgICAgTlAKK0xJTQorMCAgICAweGZmZmYgICA2CisKKyogUU5FLVRPRE86IFJlbmFtZSB0aGVpciBjZmcgZnJvbSAnV05JX0NGR19QUklNX0RFVklDRV9PVUknCitXTklfQ0ZHX1dQU19QSU1BUllfREVWSUNFX09VSSAgSSAgIDQgICA3CitWICAgIFJXICAgICBOUAorTElNCiswICAgIDB4ZmZmZmZmZmYgICAweDAwNTBmMjA0IAorViAgICBSVyAgICAgTlAKK0xJTQorMCAgICAweGZmZmZmZmZmICAgMHgwMDUwZjIwNAorCisqIFFORS1UT0RPOiBSZW5hbWUgdGhlaXIgY2ZnIGZyb20gJ1dOSV9DRkdfUFJJTV9ERVZJQ0VfU1VCX0NBVEVHT1JZJworV05JX0NGR19XUFNfREVWSUNFX1NVQl9DQVRFR09SWSAgSSAgIDQgICA3CitWICAgIFJXICAgICBOUAorTElNCiswICAgIDB4ZmZmZiAgIDEKK1YgICAgUlcgICAgIE5QCitMSU0KKzAgICAgMHhmZmZmICAgMQorCisqIEFzc29jaWF0aW9uIFN0YXRlCisqCisKKyogVGhlIEFzc29jaWF0aW9uIFN0YXRlIGNvbXBvbmVudCBzaG93cyB0aGUgY29uZmlndXJhdGlvbiBhbmQgcHJldmlvdXMKKyogYXNzb2NpYXRpb24gc3RhdGUgb2YgdGhlIHdpcmVsZXNzIHN0YXRpb24gd2hlbiBzZW5kaW5nIGEgRGlzY292ZXJ5CisqIHJlcXVlc3QuCisqCisqIEFzc29jaWF0aW9uIFN0YXRlICAgIERlc2NyaXB0aW9uCisqIDAgICAgICAgICAgICAgICAgICAgIE5vdCBBc3NvY2lhdGVkCisqIDEgICAgICAgICAgICAgICAgICAgIENvbm5lY3Rpb24gU3VjY2VzcworKiAyICAgICAgICAgICAgICAgICAgICBDb25maWd1cmF0aW9uIEZhaWx1cmUKKyogMyAgICAgICAgICAgICAgICAgICAgQXNzb2NpYXRpb24gRmFpbHVyZQorKiA0ICAgICAgICAgICAgICAgICAgICBJUCBGYWlsdXJlCisKK1dOSV9DRkdfV1BTX0FTU09DSUFUSU9OX1NUQVRFICBJICAgNCAgIDcKK1YgICAgUlcgICAgIE5QCitMSU0KKzAgICAgMHhmZmZmICAgMAorViAgICBSVyAgICAgTlAKK0xJTQorMCAgICAweGZmZmYgICAwCisKKyogQ29uZmlndXJhdGlvbiBFcnJvcgorKgorKiBUaGUgIENvbmZpZ3VyYXRpb24gIEVycm9yICBjb21wb25lbnQgICBzaG93cyAgdGhlICByZXN1bHQgIG9mICB0aGUgIGRldmljZQorKiBhdHRlbXB0aW5nIHRvIGNvbmZpZ3VyZSBpdHNlbGYgYW5kIHRvIGFzc29jaWF0ZSB3aXRoIHRoZSBXTEFOLgorKgorKiAgQ29uZmlndXJhdGlvbiBFcnJvciAgRGVzY3JpcHRpb24KKyogICAwICAgICAgICAgICAgICAgICAgIE5vIEVycm9yCisqICAgMSAgICAgICAgICAgICAgICAgICBPT0IgSW50ZXJmYWNlIFJlYWQgRXJyb3IKKyogICAyICAgICAgICAgICAgICAgICAgIERlY3J5cHRpb24gQ1JDIEZhaWx1cmUKKyogICAzICAgICAgICAgICAgICAgICAgIDIuNCBjaGFubmVsIG5vdCBzdXBwb3J0ZWQKKyogICA0ICAgICAgICAgICAgICAgICAgIDUuMCBjaGFubmVsIG5vdCBzdXBwb3J0ZWQKKyogICA1ICAgICAgICAgICAgICAgICAgIFNpZ25hbCB0b28gd2VhaworKiAgIDYgICAgICAgICAgICAgICAgICAgTmV0d29yayBhdXRoIGZhaWx1cmUKKyogICA3ICAgICAgICAgICAgICAgICAgIE5ldHdvcmsgYXNzb2NpYXRpb24gZmFpbHVyZQorKiAgIDggICAgICAgICAgICAgICAgICAgTm8gREhDUCByZXNwb25zZQorKiAgIDkgICAgICAgICAgICAgICAgICAgRmFpbGVkIERIQ1AgY29uZmlnCisqICAxMCAgICAgICAgICAgICAgICAgICBJUCBhZGRyZXNzIGNvbmZsaWN0CisqICAxMSAgICAgICAgICAgICAgICAgICBDb3VsZG50IGNvbm5lY3QgdG8gUmVnaXN0cmFyCisqICAxMiAgICAgICAgICAgICAgICAgICBNdWx0aXBsZSBQQkMgc2Vzc2lvbnMgZGV0ZWN0ZWQKKyogIDEzICAgICAgICAgICAgICAgICAgIFJvZ3VlIGFjdGl2aXR5IHN1c3BlY3RlZAorKiAgMTQgICAgICAgICAgICAgICAgICAgRGV2aWNlIGJ1c3kKKyogIDE1ICAgICAgICAgICAgICAgICAgIFNldHVwIGxvY2tlZAorKiAgMTYgICAgICAgICAgICAgICAgICAgTWVzc2FnZSBUaW1lb3V0CisqICAxNyAgICAgICAgICAgICAgICAgICBSZWdpc3RyYXRpb24gU2Vzc2lvbiBUaW1lb3V0CisqICAxOCAgICAgICAgICAgICAgICAgICBEZXZpY2UgUGFzc3dvcmQgQXV0aCBGYWlsdXJlCisqCisqIFRoZSBEZXZpY2UgYnVzeSBlcnJvciBpcyByZXR1cm5lZCBpZiB0aGUgc2VuZGluZyBkZXZpY2UgaXMgdW5hYmxlIHRvCisqIHJlc3BvbmQgdG8gdGhlIHJlcXVl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AgICBOUAorSEFMCiswICAgIDEyOCAgICAxMjgKKworKgorKiBPbiBjaGlwIHJlb2RlcmluZyBwb2xsaW5nIHRocmVzaG9sZAorKgorCitXTklfQ0ZHX1JQRV9QT0xMSU5HX1RIUkVTSE9MRCAgICBJICAgIDQgICAgMgorViAgICBSVyAgICBOUAorSEFMCiswICAgIDY1NTM1ICAgIDEwCitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgNjU1MzUgICAgMTAKKworKgorKiBPbiBjaGlwIHJlb2RlcmluZyBhZ2luZyB0aHJlc2hvbGQgZm9yIEFDMAorKgorCitXTklfQ0ZHX1JQRV9BR0lOR19USFJFU0hPTERfRk9SX0FDMF9SRUcgICAgSSAgICA0ICAgIDIKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICA2NTUzNSAgICAzMAorViAgICBSVyAgICBOUAorSEFMCiswICAgIDY1NTM1ICAgIDMwCisKKyoKKyogT24gY2hpcCByZW9kZXJpbmcgYWdpbmcgdGhyZXNob2xkIGZvciBBQzEKKyoKKworV05JX0NGR19SUEVfQUdJTkdfVEhSRVNIT0xEX0ZPUl9BQzFfUkVHICAgIEkgICAgNCAgICAyCitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgNjU1MzUgICAgMzAKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICA2NTUzNSAgICAzMAorCisqCisqIE9uIGNoaXAgcmVvZGVyaW5nIGFnaW5nIHRocmVzaG9sZCBmb3IgQUMyCisqCisKK1dOSV9DRkdfUlBFX0FHSU5HX1RIUkVTSE9MRF9GT1JfQUMyX1JFRyAgICBJICAgIDQgICAgMgorViAgICBSVyAgICBOUAorSEFMCiswICAgIDY1NTM1ICAgIDMwCitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgNjU1MzUgICAgMzAKKworKgorKiBPbiBjaGlwIHJlb2RlcmluZyBhZ2luZyB0aHJlc2hvbGQgZm9yIEFDMworKgorCitXTklfQ0ZHX1JQRV9BR0lOR19USFJFU0hPTERfRk9SX0FDM19SRUcgICAgSSAgICA0ICAgIDIKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICA2NTUzNSAgICAzMAorViAgICBSVyAgICBOUAorSEFMCiswICAgIDY1NTM1ICAgIDMwCisKKyoKKyogTnVtYmVyIG9mIE9uLUNoaXAgcmVvcmRlciBzZXNzaW9ucworKgorCitXTklfQ0ZHX05PX09GX09OQ0hJUF9SRU9SREVSX1NFU1NJT05TICAgIEkgICAgNCAgICAyCitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMiAgICAxCitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMiAgICAxCisKKworKgorKiBTaW5nbGUgUkMgZm9yIGFsbCBUSUQgCisqCisKK1dOSV9DRkdfU0lOR0xFX1RJRF9SQyAgICBJICAgIDQgICAgNworViAgICBSVyAgICBOUAorTk9ORQorMCAgICAxICAgIDEKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgICAgMSAgICAxCisKKyoKKyogUlJNIEVuYWJsZWQgCisqCisKK1dOSV9DRkdfUlJNX0VOQUJMRUQgICAgSSAgICA0ICAgIDgKK1YgICAgUlcgICAgTlAgCitOT05FCiswICAgIDEgICAgMAorViAgICBSVyAgICBOUCAKK05PTkUKKzAgICAgMSAgICAwCisKKyoKKyogUlJNIG1lYXN1cmVtZW50IG1heCBkdXJhdGlvbi4gU2VjdGlvbiAxMS4xMC4zIDgwMi4xMWstMjAwOC4KKyogTWF4IER1cmF0aW9uIHJlcHJlc2VudGVkIGFzIG1heER1cmF0aW9uIGluVFVzID0gMl4oKldOSV9DRkdfUlJNX0lOX0NIQU5fTUFYIC0gNCkgKiBiY25JbnR2bAorKiBPcGVyYXRpbmcgY2hhbm5lbCBtYXggbWVhc3VyZW1lbnQgZHVyYXRpb24uCisqCisKK1dOSV9DRkdfUlJNX09QRVJBVElOR19DSEFOX01BWCAgICBJICAgIDQgICAgOAorViAgICBSVyAgICBOUCAKK05PTkUKKzAgICAgOCAgICAwCitWICAgIFJXICAgIE5QIAorTk9ORQorMCAgICA4ICAgIDAKKworKgorKiBOb24tT3BlcmF0aW5nIGNoYW5uZWwgbWF4IG1lYXN1cmVtZW50IGR1cmF0aW9uLgorKgorCitXTklfQ0ZHX1JSTV9OT05fT1BFUkFUSU5HX0NIQU5fTUFYICAgIEkgICAgNCAgICA4CitWICAgIFJXICAgIE5QIAorTk9ORQorMCAgICA4ICAgIDAKK1YgICAgUlcgICAgTlAgCitOT05FCiswICAgIDggICAgMAorICAgCisqCisqIFRYIHBvd2VyIGNvbnRyb2wgZmVhdHVyZQorKgorCitXTklfQ0ZHX1RYX1BXUl9DVFJMX0VOQUJMRSAgICBJICAgNCAgIDgKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgICAgMSAgICAxCitWICAgIFJXICAgIE5QCitOT05FCiswICAgIDEgICAgMQorCisqCisqICBNQ0FTVCBCQ0FTVCBmaWx0ZXIgU2V0dGluZworKiAgMDogTm8gZmlsdGVyLCAxOiBCbG9jayBNY2FzdCwgMjogQmxvY2sgQmNhc3QsIDM6IEJsb2NrIE1jYXN0IGFuZCBCY2FzdAorKgorCitXTklfQ0ZHX01DQVNUX0JDQVNUX0ZJTFRFUl9TRVRUSU5HICAgIEkgICAgNCAgICA3CitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMyAgICAwCitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMyAgICAwCisKKyoKKyogIEJUQyBESENQIE5vIG9mIEJ0IHNsb3RzIHRvIGJsb2NrIAorKgorV05JX0NGR19CVENfREhDUF9CVF9TTE9UU19UT19CTE9DSyAgICBJICAgIDQgICAgNworViAgICBSVyAgICBOUAorSEFMCiswICAgIDB4RkYgICAgIDAKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAweEZGICAgICAwCisKKyoKKyogIENvbmZpZyBwYXJhbWV0ZXIgdG8gRW5hYmxlL0Rpc2FibGUgRHluYW1pYyBQUy1Qb2xsIG1lY2hhbmlzbSAKKyogIDA6IERpc2FibGUsIHg6IEZXIHdpbGwgc2VuZCB4IG51bWJlciBvZiBOVUxMIGZyYW1lcyBiZWZvcmUgc3dpdGNoaW5nIHRvIFBTLVBvbGwgbWV4aGFuaXNtCisqCitXTklfQ0ZHX0RZTkFNSUNfUFNfUE9MTF9WQUxVRSAgICBJICAgIDQgICAgNworViAgICBSVyAgICBOUAorSEFMCiswICAgIDB4RkYgICAgMAorViAgICBSVyAgICBOUAorSEFMCiswICAgIDB4RkYgICAgMAorCisqCisqIFBTIERhdGEgSW5BY3Rpdml0eSBUaW1lb3V0IChUVSkKKyoKKworV05JX0NGR19QU19OVUxMREFUQV9BUF9SRVNQX1RJTUVPVVQgICAgSSAgICA0ICAgIDcKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICA4MCAgICAwCitOViAgICBSVyAgICBOUAorTk9ORQorMCAgICA4MCAgICAwCisKKyoKKyogIENvbmZpZyBwYXJhbWV0ZXIgdG8gRW5hYmxlL0Rpc2FibGUgVGVsZXNjb3BpYyBCY24gV2FrZXVwcyAKKyogIDA6IERpc2FibGUsIDE6IEVuYWJsZQorKgorCitXTklfQ0ZHX1RFTEVfQkNOX1dBS0VVUF9FTiAgICBJICAgIDQgICAgNworViAgICBSVyAgICBOUAorSEFMCiswICAgIDEgICAgMAorViAgICBSVyAgICBOUAorSEFMCiswICAgIDEgICAgMAorCisKKyoKKyogIENvbmZpZyBwYXJhbWV0ZXIgZm9yIFRyYW5zaWVudCBMSSAKKyogIDA6IERpc2FibGUsIHg6IFRyYW5zaWVudCBMSQorKgorCitXTklfQ0ZHX1RFTEVfQkNOX1RSQU5TX0xJICAgIEkgICAgNCAgICA3CitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgNyAgICAzCitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgNyAgICAzCisKKyoKKyogIENvbmZpZyBwYXJhbWV0ZXIgZm9yIElkbGUgYmNucyBmb3IgVHJhbnNpZW50IExJIAorKiAgeDogTnVtIElkbGUgYmNucyBiZWZvcmUgc3dpdGNoIHRvIHRyYW5zIExJCisqCisKK1dOSV9DRkdfVEVMRV9CQ05fVFJBTlNfTElfSURMRV9CQ05TICAgIEkgICAgNCAgICA3CitWICAgIFJXICAgIE5QCitIQUwKKzUgICAgMjU1ICAgIDEwCitWICAgIFJXICAgIE5QCitIQUwKKzUgICAgMjU1ICAgIDEwCisKKyoKKyogIENvbmZpZyBwYXJhbWV0ZXIgZm9yIE1heCBMSSAKKyogIDA6IERpc2FibGUsIHg6IE1heCBMSQorKgorCitXTklfQ0ZHX1RFTEVfQkNOX01BWF9MSSAgICBJICAgIDQgICAgNworViAgICBSVyAgICBOUAorSEFMCiswICAgIDcgICAgNQorViAgICBSVyAgICBOUAorSEFMCiswICAgIDcgICAgNQorCisqCisqICBDb25maWcgcGFyYW1ldGVyIGZvciBJZGxlIGJjbnMgZm9yIG1heCBMSSAKKyogIHg6IE51bSBJZGxlIGJjbnMgYmVmb3JlIHN3aXRjaCB0byBtYXggTEkKKyoKKworV05JX0NGR19URUxFX0JDTl9NQVhfTElfSURMRV9CQ05TICAgIEkgICAgNCAgICA3CitWICAgIFJXICAgIE5QCitIQUwKKzUgICAgMjU1ICAgIDE1CitWICAgIFJXICAgIE5QCitIQUwKKzUgICAgMjU1ICAgIDE1CisKKyoKKyogIEJUQyBESENQIE5vIG9mIEJ0IHN1YiBpbnRlcnZhbCBkdXJpbmcgREhDUCAKKyoKK1dOSV9DRkdfQlRDX0EyRFBfREhDUF9CVF9TVUJfSU5URVJWQUxTICAgIEkgICAgNCAgICA3CitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMHhGRiAgICAgNworViAgICBSVyAgICBOUAorSEFMCiswICAgIDB4RkYgICAgIDcKKworKiAKKyogSW5mcmEgU1RBIG1vZGUgS2VlcCBhbGl2ZSBwZXJpb2QgKGluIHNlY3MpIGZvciAKKyogc2VuZGluZyBrZWVwIGFsaXZlIChRb3MpTnVsbCBmcmFtZXMgdG8gdGhlIEFQLgorKiAwID0gZGlzYWJsZWQuIFJlY29tb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SAgICAgMAorViAgICBSVyAgICBOUAorTk9ORQorMCAgICAxICAgICAwCisKKyoKKyogTUNDIEFkYXB0aXZlIFNjaGVkdWxlciB3aWxsIGJlIGVuYWJsZWQgaWYgdmFsdWUgaXMgc2V0IHRvIDEKKyogCisqCisqCitXTklfQ0ZHX0VOQUJMRV9NQ0NfQURBUFRJVkVfU0NIRUQgIEkgICA0ICAgMAorViAgICBSVyAgICBOUAorTk9ORQorMCAgICAxICAgICAwCitWICAgIFJXICAgIE5QCitOT05FCiswICAgIDEgICAgIDAKKyoKKypEaXNhYmxlIExEUEMgaW4gU1RBIG1vZGUgd2hlbiBBUCBpcyBUWEJGIGNhcGFibGUKKyoKKyoKKyoKK1dOSV9DRkdfRElTQUJMRV9MRFBDX1dJVEhfVFhCRl9BUCAgSSAgIDQgICAwCitWICAgIFJXICAgIE5QCitOT05FCiswICAgIDEgICAgIDAKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgICAgMSAgICAgMAorCisqCisqIEFQIExpbmsgTW9uaXRvciBUaW1lb3V0IChUVSkKKyoKK1dOSV9DRkdfQVBfTElOS19NT05JVE9SX1RJTUVPVVQgICAgSSAgICA0ICAgIDcKK1YgICAgUlcgICAgTlAKK0hBTAorMSAgICAyNTUgICAgMworViAgICBSVyAgICBOUAorSEFMCisxICAgIDI1NSAgICAzCisKKyoKKypURExTIFN0YXRpb24ncyBVQVBTRCBNQVNLIENvbmZpZ3VyYXRpb24KKyoKKyoKKyoKK1dOSV9DRkdfVERMU19RT1NfV01NX1VBUFNEX01BU0sgIEkgICA0ICAgNworViAgICBSVyAgICBOUAorTElNCiswICAgIDE1ICAgIDAKK1YgICAgUlcgICAgTlAKK0xJTQorMCAgICAxNSAgIDAKKyoKKypURExTIFN0YXRpb25zIEJ1ZmZlciBTVEEgQ2FwYWJpbGl0eQorKgorKgorKgorV05JX0NGR19URExTX0JVRl9TVEFfRU5BQkxFRCAgSSAgIDQgICA3CitWICAgIFJXICAgIE5QCitMSU0KKzAgICAgMSAgICAwCitWICAgIFJXICAgIE5QCitMSU0KKzAgICAgMSAgICAwCisqVERMUyBTdGF0aW9ucyBQVUFQU0QgSW5hY3Rpdml0eSBUaW1lcgorKgorKgorKgorV05JX0NGR19URExTX1BVQVBTRF9JTkFDVF9USU1FICBJICAgNCAgIDcKK1YgICAgUlcgICAgTlAKK0xJTQorMCAgICAxMCAgICAwCitWICAgIFJXICAgIE5QCitMSU0KKzAgICAgMTAgICAgMAorKlRETFMgU3RhdGlvbnMgUFVBUFNEIFJYIEZyYW1lIFRocmVzaG9sZAorKgorKgorKgorV05JX0NGR19URExTX1JYX0ZSQU1FX1RIUkVTSE9MRCAgSSAgIDQgICA3CitWICAgIFJXICAgIE5QCitMSU0KKzEwICAgMjAgICAgMTAKK1YgICAgUlcgICAgTlAKK0xJTQorMTAgICAyMCAgICAxMAorKgorKk1DQyBFTkFCTEUvRElTQUJMRSBBREFQVElWRSBSWCBEcmFpbiBmZWF0dXJlCisqCisqCisqCitXTklfQ0ZHX0VOQUJMRV9BREFQVF9SWF9EUkFJTiBJICAgNCAgIDcKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAxICAgIDEKK05WICAgIFJXICAgIE5QCitIQUwKKzAgICAgMSAgICAxCisqCisqIEZsZXhDb25uZWN0IFBvd2VyIEZhY3RvcgorKiBEZWZhdWx0IGlzIHNldCB0byAwIChkaXNhYmxlKQorKgorKgorV05JX0NGR19GTEVYX0NPTk5FQ1RfUE9XRVJfRkFDVE9SICBJICAgNCAgIDAKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgICAgOSAgICAgMAorViAgICBSVyAgICBOUAorTk9ORQorMCAgICA5ICAgICAwCisKKyoKKyogQW50ZW5uYSBEaXZlcnNpdHkKKyoKKyogMCA9IGRpc2FibGVkCisqIDEgPSBBbnQgMQorKiAyID0gQW50IDIKKyogMyA9IEFkYXB0aXZlCisqCitXTklfQ0ZHX0FOVEVOTkFfRElWRVNJVFkgICAgSSAgICA0ICAgIDcKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAzICAgIDAKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAzICAgIDAKKworKiBHTyBMaW5rIE1vbml0b3IgVGltZW91dCAoVFUpCisqCitXTklfQ0ZHX0dPX0xJTktfTU9OSVRPUl9USU1FT1VUICAgIEkgICAgNCAgICA3CitWICAgIFJXICAgIE5QCitIQUwKKzMgICA1MCAgICAxMAorViAgICBSVyAgICBOUAorSEFMCiszICAgNTAgICAgMTAKKyoKKyoKKworKiBBVEggRW5hYmxlL0Rpc2FibGUKKyoKK1dOSV9DRkdfQVRIX0RJU0FCTEUJSSAgICA0ICAgIDcKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgICAxICAgIDAKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgICAxICAgIDAKKyogQlRDIEFjdGl2ZSBXTEFOIExlbgorKgorV05JX0NGR19CVENfQUNUSVZFX1dMQU5fTEVOICAgIEkgICAgNCAgICA3CitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMjUwMDAwICAgIDYwMDAwCitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMjUwMDAwICAgIDYwMDAwCisqCisqCisKKyogQlRDIEFjdGl2ZSBCVCBMZW4KKyoKK1dOSV9DRkdfQlRDX0FDVElWRV9CVF9MRU4gICAgSSAgICA0ICAgIDcKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAyNTAwMDAgICAgOTAwMDAKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAyNTAwMDAgICAgOTAwMDAKKyoKKyoKKworKiBCVEMgU0FQIEFjdGl2ZSBXTEFOIExlbgorKgorV05JX0NGR19CVENfU0FQX0FDVElWRV9XTEFOX0xFTiAgICBJICAgIDQgICAgNworViAgICBSVyAgICBOUAorSEFMCiswICAgIDI1MDAwMCAgICAzMDAwMAorViAgICBSVyAgICBOUAorSEFMCiswICAgIDI1MDAwMCAgICAzMDAwMAorKgorKgorCisqIEJUQyBTQVAgQWN0aXZlI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CAgICAxMDAgICAgMAorKgorKgorCisqIERlYnVnIHAycCByZW1haW4gb24gY2hhbm5lbAorKgorV05JX0NGR19ERUJVR19QMlBfUkVNQUlOX09OX0NIQU5ORUwgICAgSSAgICA0ICAgIDcKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgICAgMSAgICAwCitWICAgIFJXICAgIE5QCitOT05FCiswICAgIDEgICAgMAorCisqIEJUQyBDVFMyUyBkdXJpbmcgU0NPCisqCitXTklfQ0ZHX0JUQ19DVFMyU19EVVJJTkdfU0NPICAgIEkgICAgNCAgICA3CitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMSAgICAgMAorViAgICBSVyAgICBOUAorSEFMCiswICAgIDEgICAgIDAKKyoKKyoKKworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiBGZWF0dXJlOiAgIENoYW5uZWwgQm9uZGluZyAyLjRHCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisKK1dOSV9DRkdfQ0hBTk5FTF9CT05ESU5HXzI0RyAgICBJICAgIDQgICAgMTIKK1YgICAgUlcgICAgTlAgICAgUkVTVEFSVAorTElNCiswICAgIDEgICAgIDAKK1YgICAgUlcgICAgTlAgICAgUkVTVEFSVAorTElNCiswICAgIDEgICAgIDAKKworKgorKiAgT0JTUyBQQVNTSVZFIENoYW5uZWwgVGltZSAoVFUpCisqCisKK1dOSV9DRkdfT0JTU19IVDQwX1NDQU5fUEFTU0lWRV9EV0VMTF9USU1FICAgIEkgICAgNCAgICA5CitWICAgIFJXICAgIE5QCitOT05FCis1ICAgIDEwMDAgICAgMjAKK1YgICAgUlcgICAgTlAKK05PTkUKKzUgICAgMTAwMCAgICAyMAorCisqCisqICBPQlNTIEFDVElWRSBDaGFubmVsIFRpbWUgKFRVKQorKgorCitXTklfQ0ZHX09CU1NfSFQ0MF9TQ0FOX0FDVElWRV9EV0VMTF9USU1FICAgIEkgICAgNCAgICA5CitWICAgIFJXICAgIE5QCitOT05FCisxMCAgICAxMDAwICAgIDEwCitWICAgIFJXICAgIE5QCitOT05FCisxMCAgICAxMDAwICAgIDEwCisKKyoKKyogIE9CU1MgU0NBTiBXSURUSCBUUklHR0VSIEludGVydmFsIChUVSkKKyoKKworV05JX0NGR19PQlNTX0hUNDBfU0NBTl9XSURUSF9UUklHR0VSX0lOVEVSVkFMICAgIEkgICAgNCAgICA5CitWICAgIFJXICAgIE5QCitOT05FCisxMCAgICA5MDAgICAgMjAwCitWICAgIFJXICAgIE5QCitOT05FCisxMCAgICA5MDAgICAgMjAwCisKKyoKKyogIE9CU1MgU0NBTiBwYXNzaXZlIHRvdGFsIHBlciBjaGFuZW5sIChUVSkKKyoKKworV05JX0NGR19PQlNTX0hUNDBfU0NBTl9QQVNTSVZFX1RPVEFMX1BFUl9DSEFOTkVMICAgIEkgICAgNCAgICA5CitWICAgIFJXICAgIE5QCitOT05FCisyMDAgICAgMTAwMDAgICAgMjAwCitWICAgIFJXICAgIE5QCitOT05FCisyMDAgICAgMTAwMDAgICAgMjAwCisKKyoKKyogIE9CU1MgU0NBTiBhY3RpdmUgdG90YWwgcGVyIENoYW5uZWwgKFRVKQorKgorCitXTklfQ0ZHX09CU1NfSFQ0MF9TQ0FOX0FDVElWRV9UT1RBTF9QRVJfQ0hBTk5FTCAgICBJICAgIDQgICAgOQorViAgICBSVyAgICBOUAorTk9ORQorMjAgICAgMTAwMDAgICAgMjAKK1YgICAgUlcgICAgTlAKK05PTkUKKzIwICAgIDEwMDAwICAgIDIwCisKKyoKKyogIE9CU1MgV2lkdGggQ2hhbm5lbCBUcmFuc2l0aW9uIERlbGF5IEZhY3RvcgorKgorCitXTklfQ0ZHX09CU1NfSFQ0MF9XSURUSF9DSEFOTkVMX1RSQU5TSVRJT05fREVMQVlfRkFDVE9SICBJICAgIDQgICAgOQorViAgICBSVyAgICBOUAorTk9ORQorNSAgICAxMDAgICAgNQorViAgICBSVyAgICBOUAorTk9ORQorNSAgICAxMDAgICAgNQorCisqCisqICBPQlNTIFNDQU4gQWN0aXZpdHkgVGhyZXNob2xkKFRVKQorKgorCitXTklfQ0ZHX09CU1NfSFQ0MF9TQ0FOX0FDVElWSVRZX1RIUkVTSE9MRCAgICBJICAgIDQgICAgOQorViAgICBSVyAgICBOUAorTk9ORQorMCAgICAxMDAgICAgMjUKK1YgICAgUlcgICAgTlAKK05PTkUKKzAgICAgMTAwICAgIDI1CisKKyoKKyogVERMUyBPZmYgQ2hhbm5lbCBJbXBsZW1lbnRhdGlvbgorKgorV05JX0NGR19URExTX09GRl9DSEFOTkVMX0VOQUJMRUQgSSA0IDcKK1YgICAgUlcgICAgTlAKK0xJTQorMCAgICAxICAgICAwCitWICAgIFJXICAgIE5QCitMSU0KKzAgICAgMSAgICAgMAorCisqCisqIFBNRiBTQSBRdWVyeSBNYXhpbXVtIFJldHJpZXMKKyoKKworV05JX0NGR19QTUZfU0FfUVVFUllfTUFYX1JFVFJJRVMgICAgSSAgICA0ICAgIDEKK1YgICAgUlcgICBOUCBSRVNUQVJUCitOT05FCiswICAgIDIwICAgNQorViAgICBSVyAgIE5QIFJFU1RBUlQKK05PTkUKKzAgICAgMjAgICA1CisKKyoKKyogUE1GIFNBIFF1ZXJ5IFJldHJ5IEludGVydmFsIChpbiBUVXMpCisqCisKK1dOSV9DRkdfUE1GX1NBX1FVRVJZX1JFVFJZX0lOVEVSVkFMICAgIEkgICAgNCAgICAxCitWICAgIFJXICAgTlAgUkVTVEFSVAorTk9ORQorMTAgICAgMjAwMCAyMDAKK1YgICAgUlcgICBOUCBSRVNUQVJUCitOT05FCisxMCAgICAyMDAwIDIwMAorCisqIFJBIGZpbHRlciBlbmFibGUvZGlzYWJsZQorKgorV05JX0NGR19SQV9GSUxURVJfRU5BQkxFICAgIEkgICAgNCAgICA3CitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMSAgICAgMAorViAgICBSVyAgICBOUAorSEFMCiswICAgIDEgICAgIDAKKyoKKyoKKworKiBSQSBmaWx0ZXIgcmF0ZSBpbnRlcnZhbAorKgorV05JX0NGR19SQV9SQVRFX0xJTUlUX0lOVEVSVkFMICAgIEkgICAgNCAgICA3CitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgNjAgICAgIDYwCitWICAgIFJXICAgICBOUAorSEFMCiswICAgIDYwICAgICA2MAorCisqIEJUQyBGYXRhbCBISUQgc25pZmYgYmxvY2sKKyoKK1dOSV9DRkdfQlRDX0ZBVEFMX0hJRF9OU05JRkZfQkxLX0dVSURBTkNFICAgIEkgICAgNCAgICA3CitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMiAgICAyCitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMiAgICAyCisqCisqCisKKyogQlRDIENyaXRpY2FsIEhJRCBzbmlmZiBibG9jaworKgorV05JX0NGR19CVENfQ1JJVElDQUxfSElEX05TTklGRl9CTEtfR1VJREFOQ0UgICAgSSAgICA0ICAgIDcKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAxICAgIDEKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAxICAgIDEKKyoKKyoKKworKiBCVEMgRFlOIEEyRFAgdHggUSB0aHJlc2hvbGQKKyoKK1dOSV9DRkdfQlRDX0RZTl9BMkRQX1RYX1FVRVVFX1RIT0xEICAgIEkgICAgNCAgICA3CitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMSAgICAwCitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMSAgICAwCisqCisqCisKKyogQlRDIERZTiBPUFAgdHggUSB0aHJlc2hvbGQKKyoKK1dOSV9DRkdfQlRDX0RZTl9PUFBfVFhfUVVFVUVfVEhPTEQgICAgSSAgICA0ICAgIDcKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAzICAgIDEKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAzICAgIDEKKyoKKyoKKworKgorKlRETFMgV01NIE1vZGUKKyoKKyoKK1dOSV9DRkdfVERMU19XTU1fTU9ERV9FTkFCTEVEICAgSSAgIDQgICA3CitWICAgIFJXICAgIE5QCitMSU0KKzAgICAgMSAgICAwCitWICAgIFJXICAgIE5QCitMSU0KKzAgICAgMSAgICAwCisKK1dOSV9DRkdfTUFYX1VBUFNEX0NPTlNFQ19TUCAgICBJICAgIDQgICAgNworViAgICBSVyAgICBOUAorSEFMCiswICAgIDEwMCAgICAgMTAKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAxMDAgICAgIDEwCisqCisqCisKK1dOSV9DRkdfTUFYX1VBUFNEX0NPTlNFQ19SWF9DTlQgICAgSSAgICA0ICAgIDcKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAxMDAgICAgIDEwCitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMTAwICAgICAxMAorKgorKgorCitXTklfQ0ZHX01BWF9VQVBTRF9DT05TRUNfVFhfQ05UICAgIEkgICAgNCAgICA3CitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMTAwICAgICAxMAorViAgICBSVyAgICBOUAorSEFMCiswICAgIDEwMCAgICAgMTAKKyoKKyoKKworV05JX0NGR19NQVhfVUFQU0RfQ09OU0VDX1RYX0NOVF9NRUFTX1dJTkRPVyAgICBJICAgIDQgICAgNworViAgICBSVyAgICBOUAorSEFMCiswICAgIDEwMCAgICAgMTAKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAxMDAgICAgIDEwCisqCisqCisKK1dOSV9DRkdfTUFYX1VBUFNEX0NPTlNFQ19SWF9DTlRfTUVBU19XSU5ET1cgICAgSSAgICA0ICAgIDcKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAxMDAgICAgIDEwCitWICAgIFJXICAgIE5QCitIQUwKKzAgICAgMTAwICAgICAxMAorKgorKgorCitXTklfQ0ZHX01BWF9QU1BPTExfSU5fV01NX1VBUFNEX1BTX01PREUgICAgSSAgICA0ICAgIDcKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAyNTUgICAgIDAKK1YgICAgUlcgICAgTlAKK0hBTAorMCAgICAyNTUgICAgID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gICAgICAgICAgICAgLy8gYmUgc3BlY2lmaWVkIG9uIHRoZSBjb21tYW5kIGxpbmUuCisKKy8vIERlZmluZSBzb21lIG1uZW1vbmljIGNvbnN0YW50czsgdGhlc2UgYXJlIGp1c3QgZm9yIG91ciB1c2Ugd2l0aCB0aGUgZnJhbWVzCisvLyBmaWxlcyB3ZSdyZSBjb21waWxpbmcuICBJT1csIHRoZXkgd29uJ3QgcmVzdWx0IGluIGFueSBDIGNvZGUgYmVpbmcKKy8vIGVtaXR0ZWQuCisKK2NvbnN0IEVJRF9TU0lEICAgICAgICAgICAgICAgICAgICAgICA9ICAgMDsKK2NvbnN0IEVJRF9TVVBQX1JBVEVTICAgICAgICAgICAgICAgICA9ICAgMTsKK2NvbnN0IEVJRF9GSF9QQVJBTV9TRVQgICAgICAgICAgICAgICA9ICAgMjsKK2NvbnN0IEVJRF9EU19QQVJBTV9TRVQgICAgICAgICAgICAgICA9ICAgMzsKK2NvbnN0IEVJRF9DRl9QQVJBTV9TRVQgICAgICAgICAgICAgICA9ICAgNDsKK2NvbnN0IEVJRF9USU0gICAgICAgICAgICAgICAgICAgICAgICA9ICAgNTsKK2NvbnN0IEVJRF9JQlNTX1BBUkFNX1NFVCAgICAgICAgICAgICA9ICAgNjsKK2NvbnN0IEVJRF9DT1VOVFJZICAgICAgICAgICAgICAgICAgICA9ICAgNzsKK2NvbnN0IEVJRF9GSF9QQVRURVJOICAgICAgICAgICAgICAgICA9ICAgODsKK2NvbnN0IEVJRF9GSF9QQVRUX1RBQkxFICAgICAgICAgICAgICA9ICAgOTsKK2NvbnN0IEVJRF9SRVFVRVNUICAgICAgICAgICAgICAgICAgICA9ICAxMDsKK2NvbnN0IEVJRF9RQlNTX0xPQUQgICAgICAgICAgICAgICAgICA9ICAxMTsKK2NvbnN0IEVJRF9FRENBX1BBUkFNX1NFVCAgICAgICAgICAgICA9ICAxMjsKK2NvbnN0IEVJRF9UU1BFQyAgICAgICAgICAgICAgICAgICAgICA9ICAxMzsKK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8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLworLy8gICAgICAgICAgICAgICAgICBXaS1GaSBQcm90ZWN0ZWQgU2V0dXAgVExWIElkZW50aWZpZXJzICAgICAgICAgICAgICAgICAgLy8KKy8vICAgICAgICAgICAgICAgICAgV1NDIFZlcnNpb24gMi4wLjAgVGFibGUgMjggICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vCisvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLworLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KKy8vICAgICAgICAgICAgICAgICAgV2ktRmkgU2ltcGxlIENvbmZpZ3VyYXRpb24gVExWIElkZW50aWZpZXJzICAgICAgICAgICAgIC8vCisvLyBXRkEgVmVuZG9yIEV4dGVuc2lvbiBTdWJlbGVtZW50cyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLworLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KK2NvbnN0IFRMVl9WRVJTSU9OMiAgICAgICAgICAgICAgICAgICAgICAgICAgPSAwOworY29uc3QgVExWX0FVVEhPUklaRURfTUFDICAgICAgICAgICAgICAgICAgICA9IDE7Citjb25zdCBUTFZfTkVUV09SS19LRVlfU0hBUkVBQkxFICAgICAgICAgICAgID0gMjsKK2NvbnN0IFRMVl9SRVFVRVNUX1RPX0VOUk9MTCAgICAgICAgICAgICAgICAgPSAzOworY29uc3QgVExWX1NFVFRJTkdTX0RFTEFZX1RJTUUgICAgICAgICAgICAgICA9IDQ7CisKK2NvbnN0IFRMVl9WRVJTSU9OICAgICAgICAgICAgICAgICAgICAgICAgICAgPSAweDEwNEE7Citjb25zdCBUTFZfV0lfRklfU0lNUExFX0NPTkZJR19TVEFURSAgICAgICAgID0gMHgxMDQ0OworY29uc3QgVExWX0FQX1NFVFVQX0xPQ0tFRCAgICAgICAgICAgICAgICAgICA9IDB4MTA1NzsKK2NvbnN0IFRMVl9TRUxFQ1RFRF9SRUdJU1RSQVJfQ09ORklHX01FVEhPRFMgPSAweDEwNTM7Citjb25zdCBUTFZfREVWSUNFX1BBU1NXT1JEX0lEICAgICAgICAgICAgICAgID0gMHgxMDEyOworY29uc3QgVExWX1VVSURfRSAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IDB4MTA0NzsKK2NvbnN0IFRMVl9VVUlEX1IgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSAweDEwNDg7Citjb25zdCBUTFZfUkZfQkFORFMgICAgICAgICAgICAgICAgICAgICAgICAgID0gMHgxMDNDOworY29uc3QgVExWX1JFUVVFU1RfVFlQRSAgICAgICAgICAgICAgICAgICAgICA9IDB4MTAzQTsKK2NvbnN0IFRMVl9SRVNQT05TRV9UWVBFICAgICAgICAgICAgICAgICAgICAgPSAweDEwM0I7Citjb25zdCBUTFZfQ09ORklHX01FVEhPRFMgICAgICAgICAgICAgICAgICAgID0gMHgxMDA4OworY29uc3QgVExWX1BSSU1BUllfREVWSUNFX1RZUEUgICAgICAgICAgICAgICA9IDB4MTA1NDsKK2NvbnN0IFRMVl9BU1NPQ0lBVElPTl9TVEFURSAgICAgICAgICAgICAgICAgPSAweDEwMDI7Citjb25zdCBUTFZfQ09ORklHVVJBVElPTl9FUlJPUiAgICAgICAgICAgICAgID0gMHgxMDA5OworY29uc3QgVExWX01BTlVGQUNUVVJFUiAgICAgICAgICAgICAgICAgICAgICA9IDB4MTAyMTsKK2NvbnN0IFRMVl9NT0RFTF9OQU1FICAgICAgICAgICAgICAgICAgICAgICAgPSAweDEwMjM7Citjb25zdCBUTFZfTU9ERUxfTlVNQkVSICAgICAgICAgICAgICAgICAgICAgID0gMHgxMDI0OworY29uc3QgVExWX1NFUklBTF9OVU1CRVIgICAgICAgICAgICAgICAgICAgICA9IDB4MTA0MjsKK2NvbnN0IFRMVl9ERVZJQ0VfTkFNRSAgICAgICAgICAgICAgICAgICAgICAgPSAweDEwMTE7Citjb25zdCBUTFZfU0VMRUNURURfUkVHSVNUUkFSICAgICAgICAgICAgICAgID0gMHgxMDQxOworY29uc3QgVExWX1ZFTkRPUl9FWFRFTlNJT04gICAgICAgICAgICAgICAgICA9IDB4MTA0OTsKK2NvbnN0IFRMVl9SRVFVRVNURURfREVWSUNFX1RZUEUgICAgICAgICAgICAgPSAweDEwNkE7CisKKy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisvLyAgICAgICAgICAgICAgICAgIFdpLUZpIERpcmVjdC9QMlAgVExWIElkZW50aWZpZXJzICAgICAgICAgICAgICAgICAgICAgICAvLworLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KK2NvbnN0IFRMVl9QMlBfU1RBVFVTICAgICAgICAgICAgICAgICAgICAgICAgID0gICAwOworY29uc3QgVExWX01JTk9SX1JFQVNPTl9DT0RFICAgICAgICAgICAgICAgICAgPSAgIDE7Citjb25zdCBUTFZfUDJQX0NBUEFCSUxJVFkgICAgICAgICAgICAgICAgICAgICA9ICAgMjsKK2NvbnN0IFRMVl9QMlBfREVWSUNFX0lEICAgICAgICAgICAgICAgICAgICAgID0gICAzOworY29uc3QgVExWX1AyUF9HUk9VUF9PV05FUl9JTlRFTlQgICAgICAgICAgICAgPSAgIDQ7Citjb25zdCBUTFZfQ09ORklHVVJBVElPTl9USU1FT1VUICAgICAgICAgICAgICA9ICAgNTsKK2NvbnN0IFRMVl9MSVNURU5fQ0hBTk5FTCAgICAgICAgICAgICAgICAgICAgID0gICA2OworY29uc3QgVExWX1AyUF9HUk9VUF9CU1NJRCAgICAgICAgICAgICAgICAgICAgPSAgIDc7Citjb25zdCBUTFZfRVhURU5ERURfTElTVEVOX1RJTUlORyAgICAgICAgICAgICA9ICAgODsKK2NvbnN0IFRMVl9JTlRFTkRFRF9QMlBfSU5URVJGQUNFX0FERFJFU1MgICAgID0gICA5OworY29uc3QgVExWX1AyUF9NQU5BR0VBQklMSVRZICAgICAgICAgICAgICAgICAgPSAgMTA7Citjb25zdCBUTFZfQ0hBTk5FTF9MSVNUICAgICAgICAgICAgICAgICAgICAgICA9ICAxMTsKK2NvbnN0IFRMVl9OT1RJQ0VfT0ZfQUJTRU5DRSAgICAgICAgICAgICAgICAgID0gIDEyOworY29uc3QgVExWX1AyUF9ERVZJQ0VfSU5GTyAgICAgICAgICAgICAgICAgICAgPSAgMTM7Citjb25zdCBUTFZfUDJQX0dST1VQX0lORk8gICAgICAgICAgICAgICAgICAgICA9ICAxNDsKK2NvbnN0IFRMVl9QMlBfR1JPVVBfSUQgICAgICAgICAgICAgICAgICAgICAgID0gIDE1OworY29uc3QgVExWX1AyUF9JTlRFUkZBQ0UgICAgICAgICAgICAgICAgICAgICAgPSAgMTY7Citjb25zdCBUTFZfT1BFUkFUSU5HX0NIQU5ORUwgICAgICAgICAgICAgICAgICA9ICAxNzsKK2NvbnN0IFRMVl9JTlZJVEFUSU9OX0ZMQUdTICAgICAgICAgICAgICAgICAgID0gIDE4OworY29uc3QgVExWX1AyUF9WRU5ET1JfU1BFQ0lGSUMgICAgICAgICAgICAgICAgPSAyMjE7CisKKy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisvLyBGaXhlZCBGaWVsZHMKKworRkYgQXV0aEFsZ28gKDIpICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQy5mLiBTZWMuIDcuMy4xLjEKK3sKKyAgICBhbGdvLCAyOworfQorCitGRiBBdXRoU2VxTm8gKDIpICAgICAgICAgICAgICAgICAgICAgICAgICAvLyA3LjMuMS4yCit7CisgICAgbm8sIDI7Cit9CisKK0ZGIEJlYWNvbkludGVydmFsICgyKSAgICAgICAgICAgICAgICAgICAgIC8vIDcuMy4xLjMKK3sKKyAgICBpbnRlcnZhbCwgMjsKK30KKworRkYgQ2FwYWJpbGl0aWVzICgyKSAgICAgICAgICAgICAgICAgICAgICAgLy8gNy4zLjEuNAoreworICAgIHsKKyAgICAgICAgZXNzOiAgICAgICAgICAgIDE7CisgICAgICAgIGlic3M6ICAgICAgICAgICAxOworICAgICAgICBjZlBvbGxhYmxlOiAgICAgMTsKKyAgICAgICAgY2ZQb2xsUmVxOiAgICAgIDE7CisgICAgICAgIHByaXZhY3k6ICAgICAgICAxOworICAgICAgICBzaG9ydFByZWFtYmxlOiAgMTsKKyAgICAgICAgcGJjYzogICAgICAgICAgIDE7CisgICAgICAgIGNoYW5uZWxBZ2lsaXR5OiAxOworICAgICAgICBzcGVjdHJ1bU1ndDogICAgMTsKKyAgICAgICAgcW9zOiAgICAgICAgICAgIDE7CisgICAgICAgIHNob3J0U2xvdFRpbWU6ICAxOworICAgICAgICBhcHNkOiAgICAgICAgICAgMTsKKyAgICAgICAgcnJtOiAgICAgICAgICAgIDE7CisgICAgICAgIGRzc3NPZmRtOiAgICAgICAxOworICAgICAgICBkZWxheWVkQkE6ICAgICAgMTsKKyAgICAgICAgaW1tZWRpYXRlQkE6ICAgIDE7CisgICAgfQorfQorCitGRiBDdXJyZW50QVBBZGRyZXNzKDYpICAgICAgICAgICAgICAgICAgICAvLyA3LjMuMS41Cit7CisgICAgbWFjWzZdOworfQorCitGRiBMaXN0ZW5JbnRlcnZhbCAoMikgICAgICAgICAgICAgICAgICAgICAvLyA3LjMuMS42Cit7CisgICAgaW50ZXJ2YWwsIDI7Cit9CisKK0ZGIFJlYXNvbiAoMikgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDcuMy4xLjcKK3sKKyAgICBjb2RlLCAyOworfQorCitGRiBBSUQgKDIpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyA3LjMuMS44Cit7CisgICAgYXNzb2NpZCwgMjsKK30KKworRkYgU3RhdHVzICgyKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gNy4zLjEuOQoreworICAgIHN0YXR1cywgMjsKK30KKworRkYgVGltZVN0YW1wICg4KSAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gNy4zLjEuMTAKK3sKKyAgICB0aW1lc3RhbXAsIDg7Cit9CisKK0ZGIENhdGVnb3J5ICgxKSAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDcuMy4xLjExCit7CisgICAgY2F0ZWdvcnksIDE7Cit9CisKK0ZGIEFjdGlvbiAoMSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDcuMy4xLjExCit7CisgICAgYWN0aW9uLCAxOworfQorCitGRiBUcmFuc2FjdGlvbklkICgyKSAgICAgICAgICAgICAgICAgICAgICAvLyA3LjMuMS4xMQoreworICAgIHRyYW5zSWRbMl07Cit9CisKK0ZGIERpYWxvZ1Rva2VuICgxKSAgICAgICAgICAgICAgICAgICAgICAgIC8vIDcuMy4xLjEyCit7CisgICAgdG9rZW4sIDE7Cit9CisKK0ZGIFN0YXR1c0NvZGUgKDEpICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdNTSBTcGVjIDIuMi4xMAoreworICAgIHN0YXR1c0NvZGUsIDE7Cit9CisKK0ZGIE9wZXJhdGluZ01vZGUgKDEpCit7CisgICB7CisgICAgLy9PcGVyYXRpbmcgTW9kZSBmaWVsZAorICAgIGNoYW5XaWR0aDogICAgMjsKKyAgICByZXNlcnZlZDogICAgIDI7CisgICAgcnhOU1M6ICAgICAgICAzOworICAgIHJ4TlNTVHlwZTogICAgMTsKKyAgICB9Cit9CitGRiBBZGRCQVBhcmFtZXRlclNldCAoMikgICAgICAgICAgICAgICAgICAgICAvLyA3LjMuMS4xNAoreworICAgIHsKKyAgICAgICAgYW1zZHVTdXBwb3J0ZWQ6ICAgIDE7CisgICAgICAgIHBvbGljeTogICAgICAxOworICAgICAgICB0aWQ6ICAgICAgICAgNDsKKyAgICAgICAgYnVmZmVyU2l6ZTogMTA7CisgICAgfQorfQorCitGRiBCQVRpbWVvdXQgKDIpICAgICAgICAgICAgICAgICAgICAgICAgICAvLyA3LjMuMS4xNQoreworICAgIHRpbWVvdXQsIDI7Cit9CisKK0ZGIEJBU3RhcnRpbmdTZXF1ZW5jZUNvbnRyb2wgKDIpICAgICAgICAgICAgICAgICAgLy8gNy4yLjEuNworeworICAgIHsKKyAgICAgICAgZnJhZ051bWJlcjogNDsKKyAgICAgICAgc3NuOiAgICAgICAxMjsKKyAgICB9Cit9CisKK0ZGIERlbEJBUGFyYW1ldGVyU2V0ICgyKSAgICAgICAgICAgICAgICAgICAgIC8vIDcuMy4xLjE2Cit7CisgICAgeworICAgICAgICByZXNlcnZlZDogICAxMTsKKyAgICAgICAgaW5pdGlhdG9yOiAgIDE7CisgICAgICAgIHRpZDogICAgICAgICA0OworICAgIH0KK30KKworRkYgU01Qb3dlck1vZGVTZXQgKDEpCQkJCS8vNy4zLjEuMjUKK3sKKyAgICB7CisgICAgICAgIFBvd2VyU2F2ZV9FbjogMTsKKyAgICAgICAgTW9kZTogMTsKKyAgICAgICAgcmVzZXJ2ZWQ6IDY7CisgICAgIH0KK30KKworRkYgVFNJbmZvICgzKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gNy4zLjIuMzAKK3sKKyAgICB7CisgICAgICAgIHRyYWZmaWNfdHlwZTogICAgMTsKKyAgICAgICAgdHNpZDogICAgICAgICAgICA0OworICAgICAgICBkaXJlY3Rpb246ICAgICAgIDI7CisgICAgICAgIGFjY2Vzc19wb2xpY3k6ICAgMjsKKyAgICAgICAgYWdncmVnYXRpb246ICAgICAxOworICAgICAgICBwc2I6ICAgICAgICAgICAgIDE7CisgICAgICAgIHVzZXJfcHJpb3JpdHk6ICAgMzsKKyAgICAgICAgdHNpbmZvX2Fja19wb2w6ICAyOworICAgICAgICBzY2hlZHVsZTogICAgICAgIDE7CisgICAgICAgIHVudXNlZDogICAgICAgICAxNTsKKyAgICB9Cit9CisKK0ZGIE51bU9mUmVwZXRpdGlvbnMgKDIpCit7CisgICAgIHJlcGV0aXRpb25zLCAyOworfQorCitGRiBUeFBvd2VyICgxKQoreworICAgICB0eFBvd2VyLCAxOworfQorCitGRiBNYXhUeFBvd2VyICgxKQoreworICAgICBtYXhUeFBvd2VyLCAxOworfQorRkYgVFBDRWxlSUQgKDEpCit7CisgICAgIFRQQ0lkLCAxOworfQorRkYgVFBDRWxlTGVuICgxKQoreworICAgICBUUENMZW4sIDE7Cit9CitGRiBMaW5rTWFyZ2luICgxKQoreworICAgICBsaW5rTWFyZ2luLCAxOworfQorRkYgUnhBbnRlbm5hSWQgKDEpCit7CisgICAgIGFudGVubmFJZCwgMTsKK30KK0ZGIFR4QW50ZW5uYUlkICgxKQoreworICAgICBhbnRlbm5hSWQsIDE7Cit9CitGRiBSQ1BJICgxKQoreworICAgICByY3BpLCAxOworfQorRkYgUlNOSSAoMSkKK3sKKyAgICAgcnNuaSwgMTsKK30KKworRkYgUDJQT1VJICg0KQoreworICAgICBvdWksIDQ7Cit9CisKK0ZGIFAyUE9VSVN1YlR5cGUgKDEpCit7CisgICAgb3VpU3VidHlwZSwgMTsKK30KKworRkYgVmh0TWVtYmVyc2hpcFN0YXR1c0FycmF5KDgpICAgICAgICAgICAgICAgICAgICAvLyA4LjQuMS41MQoreworICAgIG1lbWJlcnNoaXBTdGF0dXNBcnJheVs4XTsKK30KKworRkYgVmh0VXNlclBvc2l0aW9uQXJyYXkoMTYpICAgICAgICAgICAgICAgICAgICAvLyA4LjQuMS41MgoreworICAgI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3QuCisgKgorIFxjb2RlCisKKyAgQXNzb2NpYXRpb24gU3RhdGUgICAgRGVzY3JpcHRpb24KKyAgMCAgICAgICAgICAgICAgICAgICAgTm90IEFzc29jaWF0ZWQKKyAgMSAgICAgICAgICAgICAgICAgICAgQ29ubmVjdGlvbiBTdWNjZXNzCisgIDIgICAgICAgICAgICAgICAgICAgIENvbmZpZ3VyYXRpb24gRmFpbHVyZQorICAzICAgICAgICAgICAgICAgICAgICBBc3NvY2lhdGlvbiBGYWlsdXJlCisgIDQgICAgICAgICAgICAgICAgICAgIElQIEZhaWx1cmUKKworIFxlbmRjb2RlCisgKgorICoKKyAqLworCitUTFYgQXNzb2NpYXRpb25TdGF0ZSAoIFRMVl9BU1NPQ0lBVElPTl9TVEFURSApICggMiA6IDIgKSBNU0IKK3sKKyAgICBzdGF0ZSwgMjsKK30KKworLyoqCisgKiBcYnJpZWYgQ29uZmlndXJhdGlvbiBFcnJvcgorICoKKyAqCisgKiBUaGUgIENvbmZpZ3VyYXRpb24gIEVycm9yICBjb21wb25lbnQgICBzaG93cyAgdGhlICByZXN1bHQgIG9mICB0aGUgIGRldmljZQorICogYXR0ZW1wdGluZyB0byBjb25maWd1cmUgaXRzZWxmIGFuZCB0byBhc3NvY2lhdGUgd2l0aCB0aGUgV0xBTi4KKyAqCisgXGNvZGUKKworICAgQ29uZmlndXJhdGlvbiBFcnJvciAgRGVzY3JpcHRpb24KKyAgICAwICAgICAgICAgICAgICAgICAgIE5vIEVycm9yCisgICAgMSAgICAgICAgICAgICAgICAgICBPT0IgSW50ZXJmYWNlIFJlYWQgRXJyb3IKKyAgICAyICAgICAgICAgICAgICAgICAgIERlY3J5cHRpb24gQ1JDIEZhaWx1cmUKKyAgICAzICAgICAgICAgICAgICAgICAgIDIuNCBjaGFubmVsIG5vdCBzdXBwb3J0ZWQKKyAgICA0ICAgICAgICAgICAgICAgICAgIDUuMCBjaGFubmVsIG5vdCBzdXBwb3J0ZWQKKyAgICA1ICAgICAgICAgICAgICAgICAgIFNpZ25hbCB0b28gd2VhaworICAgIDYgICAgICAgICAgICAgICAgICAgTmV0d29yayBhdXRoIGZhaWx1cmUKKyAgICA3ICAgICAgICAgICAgICAgICAgIE5ldHdvcmsgYXNzb2NpYXRpb24gZmFpbHVyZQorICAgIDggICAgICAgICAgICAgICAgICAgTm8gREhDUCByZXNwb25zZQorICAgIDkgICAgICAgICAgICAgICAgICAgRmFpbGVkIERIQ1AgY29uZmlnCisgICAxMCAgICAgICAgICAgICAgICAgICBJUCBhZGRyZXNzIGNvbmZsaWN0CisgICAxMSAgICAgICAgICAgICAgICAgICBDb3VsZG4ndCBjb25uZWN0IHRvIFJlZ2lzdHJhcgorICAgMTIgICAgICAgICAgICAgICAgICAgTXVsdGlwbGUgUEJDIHNlc3Npb25zIGRldGVjdGVkCisgICAxMyAgICAgICAgICAgICAgICAgICBSb2d1ZSBhY3Rpdml0eSBzdXNwZWN0ZWQKKyAgIDE0ICAgICAgICAgICAgICAgICAgIERldmljZSBidXN5CisgICAxNSAgICAgICAgICAgICAgICAgICBTZXR1cCBsb2NrZWQKKyAgIDE2ICAgICAgICAgICAgICAgICAgIE1lc3NhZ2UgVGltZW91dAorICAgMTcgICAgICAgICAgICAgICAgICAgUmVnaXN0cmF0aW9uIFNlc3Npb24gVGltZW91dAorICAgMTggICAgICAgICAgICAgICAgICAgRGV2aWNlIFBhc3N3b3JkIEF1dGggRmFpbHVyZQorCisgXGVuZGNvZGUKKyAqCisgKiBUaGUgIERldmljZSBidXN5ICBlcnJvciBpcyAgcmV0dXJuZWQgaWYgIHRoZSBzZW5kaW5nICBkZXZpY2UgaXMgIHVuYWJsZSB0bworICogcmVzcG9uZCAgdG8gIHRoZSAgcmVxdWVzdCAgZHVlICB0byAgc29tZSAgaW50ZXJuYWwgIGNvbmZsaWN0ICBvciAgcmVzb3VyY2UKKyAqIGNvbnRlbnRpb24gaXNzdWUuIEZvciBleGFtcGxlLCBpZiBhIGRldmljZSBpcyBvbmx5IGNhcGFib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gICAgICAgICBSZWdpc3RyYXItc3BlY2lmaWVkCisgICAweDAwMDYgLSAweDAwMEYgIFJlc2VydmVkCisKKyBcZW5kY29kZQorICoKKyAqCisgKi8KKworVExWIERldmljZVBhc3N3b3JkSUQgKCBUTFZfREVWSUNFX1BBU1NXT1JEX0lEICkgKCAyIDogMiApIE1TQgoreworICAgIGlkLCAyOworfQorCisKKy8qKgorICogXGJyaWVmIFByaW1hcnkgRGV2aWNlIFR5cGUKKyAqCisgKgorICogVGhpcyBhdHRyaWJ1dGUgY29udGFpbnMgdGhlIHByaW1hcnkgdHlwZSBvZiB0aGUgZGV2aWNlLiBJdHMgZm9ybWF0CisgKiBmb2xsb3dzOgorICoKKyBcY29kZQorCisgICAwIDEgMiAzCisgICAwIDEgMiAzIDQgNSA2IDcgOCA5IDAgMSAyIDMgNCA1IDYgNyA4IDkgMCAxIDIgMyA0IDUgNiA3IDggOSAwIDEKKyAgICstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rCisgICB8IEF0dHJpYnV0ZSBJRCAgICAgICAgICAgICAgICAgICB8IExlbmd0aCAgICAgICAgICAgICAgICAgICAgICAgfAorICAgKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSsKKyAgIHwgQ2F0ZWdvcnkgSUQgICAgICAgICAgICAgICAgICAgIHwgT1VJICgxLTIpICAgICAgICAgICAgICAgICAgICB8CisgICArLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKworICAgfCBPVUkgKDMtNCkgICAgICAgICAgICAgICAgICAgICAgfCBTdWIgQ2F0ZWdvcnkgSUQgICAgICAgICAgICAgIHwKKyAgICstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLS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DEgICAgICAgICBQQyAgICAgICAgICAgICAgICAgICAgICAgMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTZXJ2ZXIgICAgICAgICAgICAgICAgICAgMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNZWRpYSBDZW50ZXIgICAgICAgICAgICAgMworICAgSW5wdXQgRGV2aWNlICAgICAgICAgIDIKKyAgIFByaW50ZXJzLCBTY2FubmVycywgICAgICAgICAgICAgUHJpbnRlciAgICAgICAgICAgICAgICAgIDEKKyAgIEZheGVzIGFuZCBDb3BpZXJzICAgICAzICAgICAgICAgU2Nhbm5lciAgICAgICAgICAgICAgICAgIDIKKyAgIENhbWVyYSAgICAgICAgICAgICAgICA0ICAgICAgICAgRGlnaXRhbCBTdGlsbCBDYW1lcmEgICAgIDEKKyAgIFN0b3JhZ2UgICAgICAgICAgICAgICA1ICAgICAgICAgTkFTICAgICAgICAgICAgICAgICAgICAgIDEKKyAgIE5ldHdvcmsgICAgICAgICAgICAgICAgICAgICAgICAgQVAgICAgICAgICAgICAgICAgICAgICAgIDEKKyAgIEluZnJhc3RydWN0dXJlICAgICAgICA2ICAgICAgICAgUm91dGVyICAgICAgICAgICAgICAgICAgIDIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3dpdGNoICAgICAgICAgICAgICAgICAgIDMKKyAgIERpc3BsYXlzICAgICAgICAgICAgICA3ICAgICAgICAgVGVsZXZpc2lvbiAgICAgICAgICAgICAgIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRWxlY3Ryb25pYyBQaWN0dXJlIEZyYW1lIDIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUHJvamVjdG9yICAgICAgICAgICAgICAgIDMKKyAgIE11bHRpbWVkaWEgRGV2aWNlcyAgICA4ICAgICAgICAgREFSICAgICAgICAgICAgICAgICAgICAgIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUFZSICAgICAgICAgICAgICAgICAgICAgIDIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUNYICAgICAgICAgICAgICAgICAgICAgIDMKKyAgIEdhbWluZyBEZXZpY2VzICAgICAgICA5ICAgICAgICAgWGJveCAgICAgICAgICAgICAgICAgICAgIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWGJveDM2MCAgICAgICAgICAgICAgICAgIDIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGxheXN0YXRpb24gICAgICAgICAgICAgIDMKKyAgIFRlbGVwaG9uZSAgICAgICAgICAgICAxMCAgICAgICAgV2luZG93cyBNb2JpbGUgICAgICAgICAgIDEKKworIFxlbmRjb2RlCisgKgorICoKKyAqLworCitUTFYgUHJpbWFyeURldmljZVR5cGUgKCBUTFZfUFJJTUFSWV9ERVZJQ0VfVFlQRSApICggMiA6IDIgKSBNU0IKK3sKKyAgICBwcmltYXJ5X2NhdGVnb3J5LCAyOworICAgIG91aVsgNCBdOworICAgIHN1Yl9jYXRlZ29yeSwgMjsKK30KKworCisvKioKKyAqIFxicmllZiBSZXF1ZXN0IFR5cGUKKyAqCisgKgorICogVGhlIFJlcXVlc3QgIFR5cGUgY29tcG9uZW50ICBzcGVjaWZpZXMgdGhlIG1vZGUgIGluIHdoaWNoIHRoZSAgZGV2aWNlIHdpbGwKKyAqIG9wZXJhdGUgaW4gZm9yICB0aGlzIHNldHVwIGV4Y2hhbmdlLiBJZiB0aGUgZGV2aWNlIGlzICBhbiBFbnJvbGxlZSwgaXQgbWF5CisgKiBzZW5kIG9ubHkgIGRpc2NvdmVyeSBtZXNzYWdlcyAgb3IgaXQgbWF5ICBhbHNvIHJlcXVlc3QgdGhhdCAgdGhlIFJlZ2lzdHJhcgorICogcHJvY2VlZCB3aXRoIG9wZW5pbmcgYSBkYXRhICBjb25uZWN0aW9uLiBUaGlzIHByb3RvY29sIGFsbG93cyBFbnJvbGxlZXMgdG8KKyAqI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GxlZSwgSW5mbyBvbmx5CisgMHgwMSAgICAgICAgICAgICAgICAgICAgICBFbnJvbGxlZSwgb3BlbiA4MDIuMVgKKyAweDAyICAgICAgICAgICAgICAgICAgICAgIFJlZ2lzdHJhcgorIDB4MDMgICAgICAgICAgICAgICAgICAgICAgQVAKKworXGVuZGNvZGUKKyAqCisgKgorICovCisKK1RMViBSZXNwb25zZVR5cGUgKCBUTFZfUkVTUE9OU0VfVFlQRSAgKSAoIDIgOiAyICkgTVNCCit7CisgICAgcmVzVHlwZSwgMTsKK30KKworCisvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KKy8vICAgICAgICAgICAgICAgICAgICAgICBXaUZpIERpcmVjdC9QMlAgVExWcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLworLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisKKy8qKgorICogXGJyaWVmIFAyUCBTdGF0dXMgQXR0cmlidXRlCisgKi8KKworVExWIFAyUFN0YXR1cyAoIFRMVl9QMlBfU1RBVFVTICkgKCAxIDogMiApIExTQgoreworICAgIHN0YXR1cywgMTsKK30KKworCisvKioKKyAqIFxicmllZiBNaW5vciBSZWFzb24gQ29kZSBBdHRyaWJ1dGUKKyAqLworCitUTFYgTWlub3JSZWFzb25Db2RlICggVExWX01JTk9SX1JFQVNPTl9DT0RFICkgKCAxIDogMiApIExTQgoreworICAgIG1pbm9yUmVhc29uQ29kZSwgMTsKK30KKworCisvKioKKyAqIFxicmllZiBQMlAgQ2FwYWJpbGl0eSBBdHRyaWJ1dGUKKyAqLworCitUTFYgUDJQQ2FwYWJpbGl0eSAoIFRMVl9QMlBfQ0FQQUJJTElUWSApICggMSA6IDIgKSBMU0IKK3sKKyAgICBkZXZpY2VDYXBhYmlsaXR5LCAxOworICAgIGdyb3VwQ2FwYWJpbGl0eSwgMTsKK30KKworCisvKioKKyAqIFxicmllZiBQMlAgRGV2aWNlIElkIEF0dHJpYnV0ZQorICovCisKK1RMViBQMlBEZXZpY2VJZCAoIFRMVl9QMlBfREVWSUNFX0lEICkgKCAxIDogMiApIExTQgoreworICAgIFAyUERldmljZUFkZHJlc3NbNl07Cit9CisKKworLyoqCisgKiBcYnJpZWYgR3JvdXAgT3duZXIgSW50ZW50IEF0dHJpYnV0ZQorICovCisKK1RMViBHT0ludGVudCAoIFRMVl9QMlBfR1JPVVBfT1dORVJfSU5URU5UICkgKCAxIDogMiApIExTQgoreworICAgIEdPSW50ZW50LCAxOworfQorCisKKy8qKgorICogXGJyaWVmIENvbmZpZ3VyYXRpb24gVGltZW91dCBBdHRyaWJ1dGUKKyAqLworCitUTFYgQ29uZmlndXJhdGlvblRpbWVvdXQgKCBUTFZfQ09ORklHVVJBVElPTl9USU1FT1VUICkgKCAxIDogMiApIExTQgoreworICAgIEdPQ29uZmlnVGltZW91dCwgMTsKKyAgICBDTENvbmZpZ1RpbWVvdXQsIDE7Cit9CisKKworLyoqCisgKiBcYnJpZWYgTGlzdGVuIENoYW5uZWwgQXR0cmlidXRlCisgKi8KKworVExWIExpc3RlbkNoYW5uZWwgKCBUTFZfTElTVEVOX0NIQU5ORUwgKSAoIDEgOiAyICkgTFNCCit7CisgICAgY291bnRyeVN0cmluZ1szXTsKKyAgICByZWd1bGF0b3J5Q2xhc3MsIDE7CisgICAgY2hhbm5lbCwgICAgICAgICAxOworfQorCisKKy8qKgorICogXGJyaWVmIFAyUCBHcm91cCBCU1NJRCBBdHRyaWJ1dGUKKyAqLworCitUTFYgUDJQR3JvdXBCc3NpZCAoIFRMVl9QMlBfR1JPVVBfQlNTSUQgKSAoIDEgOiAyICkgTFNCCit7CisgICAgUDJQR3JvdXBCc3NpZFs2XTsKK30KKworCisvKioKKyAqIFxicmllZiBFeHRlbmRlZCBMaXN0ZW4gQXR0cmlidXRlCisgKi8KKworVExWIEV4dGVuZGVkTGlzdGVuVGltaW5nICggVExWX0VYVEVOREVEX0xJU1RFTl9USU1JTkcgKSAoIDEgOiAyICkgTFNCCit7CisgICAgYXZhaWxpYmlsaXR5UGVyaW9kLCAyOworICAgIGF2YWlsaWJpbGl0eUludGVydmFsLCAyOworfQorCisKKy8qKgorICogXGJyaWVmIEludGVuZGVkIFAyUCBJbnRlcmZhY2UgQWRkcmVzcyBBdHRyaWJ1dGUKKyAqLworCitUTFYgSW50ZW5kZWRQMlBJbnRlcmZhY2VBZGRyZXNzICggVExWX0lOVEVOREVEX1AyUF9JTlRFUkZBQ0VfQUREUkVTUyApICggMSA6IDIgKSBMU0IKK3sKKyAgICBQMlBJbnRlcmZhY2VBZGRyZXNzWzZdOworfQorCisKKy8qKgorICogXGJyaWVmIFAyUCBNYW5hZ2VhYmlsaXR5IEF0dHJpYnV0ZQorICovCisKK1RMViBQMlBNYW5hZ2VhYmlsaXR5ICggVExWX1AyUF9NQU5BR0VBQklMSVRZICkgKCAxIDogMiApIExTQgoreworICAgIG1hbmFnZWFiaWxpdHksIDE7Cit9CisKKworLyoqCisgKiBcYnJpZWYgQ2hhbm5lbExpc3QgQXR0cmlidXRlCisgKi8KKworVExWIENoYW5uZWxMaXN0ICggVExWX0NIQU5ORUxfTElTVCApICggMSA6IDIgKSBMU0IKK3sKKyAgICBjb3VudHJ5U3RyaW5nWzNdOworICAgIGNoYW5uZWxMaXN0WzAuLjI1MV07Cit9CisKKworLyoqCisgKiBcYnJpZWYgTm90aWNlIG9mIEFic2VuY2UKKyAqLworCitUTFYgTm90aWNlT2ZBYnNlbmNlICggVExWX05PVElDRV9PRl9BQlNFTkNFICkgKCAxIDogMiApIExTQgoreworICAgIGluZGV4LCAxOworICAgIENUU1dpbmRvd09wcFBTLCAxOworICAgIE5vQURlc2NbMC4uMzZdOworfQorCisvKioKKyAqIFxicmllZiBQMlAgRGV2aWNlIEluZm8gQXR0cmlidXRlCisgKi8KKworVExWIFAyUERldmljZUluZm8gKCBUTFZfUDJQX0RFVklDRV9JTkZPICkgKCAxIDogMiApIExTQgoreworICAgIFAyUERldmljZUFkZHJlc3NbNl07CisgICAgY29uZmlnTWV0aG9kLCAyICwgRkxJUEJZVEVPUkRFUjsKKyAgICBwcmltYXJ5RGV2aWNlVHlwZVs4XTsKKyAgICBNQU5EQVRPUllUTFYgRGV2aWNlTmFtZTsKK30KKworCisvKioKKyAqIFxicmllZiBQMlAgR3JvdXAgSW5mbyBBdHRyaWJ1dGUKKyAqLworCitUTFYgUDJQR3JvdXBJbmZvICggVExWX1AyUF9HUk9VUF9JTkZPICkgKCAxIDogMiApIExTQgoreworICAgIFAyUENsaWVudEluZm9EZXNjWzAuLjEwMjRdOworfQorCisKKy8qKgorICogXGJyaWVmIFAyUCBHcm91cCBJZCBBdHRyaWJ1dGUKKyAqLworCitUTFYgUDJQR3JvdXBJZCAoIFRMVl9QMlBfR1JPVVBfSUQgKSAoIDEgOiAyICkgTFNCCit7CisgICAgZGV2aWNlQWRkcmVzc1s2XTsKKyAgICBzc2lkWzAuLjMyXTsKK30KKworCisvKioKKyAqIFxicmllZiBQMlAgSW50ZXJmYWNlIEF0dHJpYnV0ZQorICovCisKK1RMViBQMlBJbnRlcmZhY2UgKCBUTFZfUDJQX0lOVEVSRkFDRSApICggMSA6IDIgKSBMU0IKK3sKKyAgICBQMlBEZXZpY2VBZGRyZXNzWzZdOworfQorCisKKy8qKgorICogXGJyaWVmIE9wZXJhdGluZyBDaGFubmVsIEF0dHJpYnV0ZQorICovCisKK1RMViBPcGVyYXRpbmdDaGFubmVsICggVExWX09QRVJBVElOR19DSEFOTkVMICkgKCAxIDogMiApIExTQgoreworICAgIGNvdW50cnlTdHJpbmdbM107CisgICAgcmVndWxhdG9yeUNsYXNzLCAxOworICAgIGNoYW5uZWwsICAgICAgICAgMTsKK30KKworCisvKioKKyAqIFxicmllZiBJbnZpdGF0aW9uIEZsYWdzIEF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IGhvcF9zZXQsICAgICAxOworICAgIGhvcF9wYXR0ZXJuLCAxOworICAgIGhvcF9pbmRleCwgICAxOworfQorCitJRSBEU1BhcmFtcyAoRUlEX0RTX1BBUkFNX1NFVCkgICAgICAgICAgICAvLyA3LjMuMi40Cit7CisgICAgY3Vycl9jaGFubmVsLCAxOworfQorCitJRSBDRlBhcmFtcyAoRUlEX0NGX1BBUkFNX1NFVCkgICAgICAgICAgICAvLyA3LjMuMi41Cit7CisgICAgY2ZwX2NvdW50LCAgICAgICAgMTsKKyAgICBjZnBfcGVyaW9kLCAgICAgICAxOworICAgIGNmcF9tYXhkdXJhdGlvbiwgIDI7CisgICAgY2ZwX2R1cnJlbWFpbmluZywgMjsKK30KKworSUUgVElNIChFSURfVElNKSAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gNy4zLjIuNgoreworICAgIGR0aW1fY291bnQsICAgIDE7CisgICAgZHRpbV9wZXJpb2QsICAgMTsKKyAgICBibXBjdGwsICAgICAgICAxOworICAgIHZibXBbMS4uMjUxXTsKK30KKworSUUgSUJTU1BhcmFtcyAoRUlEX0lCU1NfUEFSQU1fU0VUKSAgICAgICAgLy8gNy4zLjIuNworeworICAgIGF0aW0sIDI7Cit9CisKK0lFIENoYWxsZW5nZVRleHQgKEVJRF9DSEFMTEVOR0VfVEVYVCkgICAgIC8vIDcuMy4yLjgKK3sKKyAgICB0ZXh0WzEuLjI1M107Cit9CisKK0lFIFJlcXVlc3RlZEluZm8gKEVJRF9SRVFVRVNUKSAgICAgICAgICAgIC8vIDcuMy4yLjEyCit7CisgICAgcmVxdWVzdGVkX2VpZHNbMC4uMjU1XTsKK30KKworSUUgQ291bnRyeSAoRUlEX0NPVU5UUlkpICAgICAgICAgICAgICAgICAgLy8gNy4zLjIuOQoreworICAgIGNvdW50cnlbM107CisgICAgT1BUSU9OQUwgdHJpcGxldHNbM11bMC4uODRdOworfQorCitJRSBGSFBhcmFtcyAoRUlEX0ZIX1BBVFRFUk4pICAgICAgICAgICAgICAvLyA3LjMuMi4xMAoreworICAgIHJhZGl4LCAxOworICAgIG5jaGFubmVscywgMTsKK30KKworSUUgRkhQYXR0VGFibGUgKEVJRF9GSF9QQVRUX1RBQkxFKSAgICAgICAgLy8gNy4zLjIuMTEKK3sKKyAgICBmbGFnLCAgICAxOworICAgIG5zZXRzLCAgIDE7CisgICAgbW9kdWx1cywgMTsKKyAgICBvZmZzZXQsICAxOworICAgIHJhbmR0YWJsZVswLi4yNTFdOworfQorCitJRSBFUlBJbmZvIChFSURfRVJQX0lORk8pICAgICAgICAgICAgICAgICAvLyA3LjMuMi4xMworeworICAgIHsKKyAgICAgICAgbm9uX2VycF9wcmVzZW50IDogMTsKKyAgICAgICAgdXNlX3Byb3Q6ICAgICAgICAgMTsKKyAgICAgICAgYmFya2VyX3ByZWFtYmxlOiAgMTsKKyAgICAgICAgdW51c2VkOiAgICAgICAgICAgNTsKKyAgICB9Cit9CisKK0lFIEV4dFN1cHBSYXRlcyAoRUlEX0VYVF9TVVBQX1JBVEVTKSAgICAgIC8vIDcuMy4yLjE0Cit7CisgICAgcmF0ZXNbMS4uU0lSX01BQ19NQVhfTlVNQkVSX09GX1JBVEVTXTsKK30KKworSUUgUG93ZXJDb25zdHJhaW50cyAoRUlEX1BPV0VSX0NPTlNUUkFJTlRTKSAvLyA3LjMuMi4xNQoreworICAgIGxvY2FsUG93ZXJDb25zdHJhaW50cywgMTsKK30KKworSUUgUG93ZXJDYXBzIChFSURfUE9XRVJfQ0FQQUJJTElUWSkgICAgICAgLy8gNy4zLjIuMTYKK3sKKyAgICBtaW5UeFBvd2VyLCAxOworICAgIG1heFR4UG93ZXIsIDE7Cit9CisKK0lFIFRQQ1JlcXVlc3QgKEVJRF9UUENfUkVRVUVTVCkgICAgICAgICAgIC8vIDcuMy4yLjE3Cit7IH0KKworSUUgVFBDUmVwb3J0IChFSURfVFBDX1JFUE9SVCkgICAgICAgICAgICAgLy8gNy4zLjIuMTgKK3sKKyAgICB0eF9wb3dlciwg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IGJpdGZpZWxkIHdob3NlIGZvcm1hdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBkZXBlbmRzIG9uIHdoZXRoZXIgdGhpcyBpcyBmcm9tIGFuIEFQCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9yIGEgU1RBLCBpbmZvcm1hdGlvbiB3aGljaCBJJ20gbm90CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN1cmUgd2UgaGF2ZSBhdCBwYXJzZSB0aW1lLi4uCisgICAgcmVzZXJ2ZWQsIDE7CisgICAgeworICAgICAgICBhY2JlX2FpZnNuOiA0OworICAgICAgICBhY2JlX2FjbTogICAxOworICAgICAgICBhY2JlX2FjaTogICAyOworICAgICAgICB1bnVzZWQxOiAgICAxOworICAgIH0KKyAgICB7CisgICAgICAgIGFjYmVfYWN3bWluOiA0OworICAgICAgICBhY2JlX2Fjd21heDogNDsKKyAgICB9CisgICAgYWNiZV90eG9wbGltaXQsIDI7CisgICAgeworICAgICAgICBhY2JrX2FpZnNuOiA0OworICAgICAgICBhY2JrX2FjbTogICAxOworICAgICAgICBhY2JrX2FjaTogICAyOworICAgICAgICB1bnVzZWQyOiAgICAxOworICAgIH0KKyAgICB7CisgICAgICAgIGFjYmtfYWN3bWluOiA0OworICAgICAgICBhY2JrX2Fjd21heDogNDsKKyAgICB9CisgICAgYWNia190eG9wbGltaXQsIDI7CisgICAgeworICAgICAgICBhY3ZpX2FpZnNuOiA0OworICAgICAgICBhY3ZpX2FjbTogICAxOworICAgICAgICBhY3ZpX2FjaTogICAyOworICAgICAgICB1bnVzZWQzOiAgICAxOworICAgIH0KKyAgICB7CisgICAgICAgIGFjdmlfYWN3bWluOiA0OworICAgICAgICBhY3ZpX2Fjd21heDogNDsKKyAgICB9CisgICAgYWN2aV90eG9wbGltaXQsIDI7CisgICAgeworICAgICAgICBhY3ZvX2FpZnNuOiA0OworICAgICAgICBhY3ZvX2FjbTogICAxOworICAgICAgICBhY3ZvX2FjaTogICAyOworICAgICAgICB1bnVzZWQ0OiAgICAxOworICAgIH0KKyAgICB7CisgICAgICAgIGFjdm9fYWN3bWluOiA0OworICAgICAgICBhY3ZvX2Fjd21heDogNDsKKyAgICB9CisgICAgYWN2b190eG9wbGltaXQsIDI7Cit9CisKK0lFIFRTUEVDIChFSURfVFNQRUMpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyA3LjMuMi4zMAoreworCisgICAgLy8gVFMgSW5mbworICAgIHsKKyAgICAgICAgdHJhZmZpY190eXBlOiAgICAxOworICAgICAgICB0c2lkOiAgICAgICAgICAgIDQ7CisgICAgICAgIGRpcmVjdGlvbjogICAgICAgMjsKKyAgICAgICAgYWNjZXNzX3BvbGljeTogICAyOworICAgICAgICBhZ2dyZWdhdGlvbjogICAgIDE7CisgICAgICAgIHBzYjogICAgICAgICAgICAgMTsKKyAgICAgICAgdXNlcl9wcmlvcml0eTogICAzOworICAgICAgICB0c2luZm9fYWNrX3BvbDogIDI7CisgICAgfQorICAgIHsKKyAgICAgICAgc2NoZWR1bGU6ICAgICAgICAxOworICAgICAgICB1bnVzZWQ6ICAgICAgICAgIDc7CisgICAgfQorCisgICAgLy8gTm9taW5hbCBNU0RVIFNpemUKKyAgICB7CisgICAgICAgIHNpemU6ICAxNTsKKyAgICAgICAgZml4ZWQ6IDE7CisgICAgfQorCisgICAgbWF4X21zZHVfc2l6ZSwgICAgICAgIDI7CisgICAgbWluX3NlcnZpY2VfaW50LCAgICAgIDQ7CisgICAgbWF4X3NlcnZpY2VfaW50LCAgICAgIDQ7CisgICAgaW5hY3Rpdml0eV9pbnQsICAgICAgIDQ7CisgICAgc3VzcGVuc2lvbl9pbnQsICAgICAgIDQ7CisgICAgc2VydmljZV9zdGFydF90aW1lLCAgIDQ7CisgICAgbWluX2RhdGFfcmF0ZSwgICAgICAgIDQ7CisgICAgbWVhbl9kYXRhX3JhdGUsICAgICAgIDQ7CisgICAgcGVha19kYXRhX3JhdGUsICAgICAgIDQ7CisgICAgYnVyc3Rfc2l6ZSwgICAgICAgICAgIDQ7CisgICAgZGVsYXlfYm91bmQsICAgICAgICAgIDQ7CisgICAgbWluX3BoeV9yYXRlLCAgICAgICAgIDQ7CisgICAgc3VycGx1c19id19hbGxvd2FuY2UsIDI7CisgICAgbWVkaXVtX3RpbWUsICAgICAgICAgIDI7CisKK30gLy8gRW5kIElFIFRTUEVDLgorCitJRSBUQ0xBUyAoRUlEX1RDTEFTKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gNy4zLjIuMzEKK3sKKyAgICB1c2VyX3ByaW9yaXR5LCAxOworICAgIGNsYXNzaWZpZXJfdHlwZSwgMTsKKyAgICBjbGFzc2lmaWVyX21hc2ssIDE7CisgICAgVU5JT04gaW5mbyAoRElTQ1JJTUlOQVRPUiBjbGFzc2lmaWVyX3R5cGUpCisgICAgeworICAgICAgICBFdGhQYXJhbXMgKGNsYXNzaWZpZXJfdHlwZSBJUyAwKQorICAgICAgICB7CisgICAgICAgICAgICBzb3VyY2VbNl07CisgICAgICAgICAgICBkZXN0WzZdOworICAgICAgICAgICAgdHlwZSwgMjsKKyAgICAgICAgfQorICAgICAgICBJcFBhcmFtcyAoY2xhc3NpZmllcl90eXBlIElTIDEpCisgICAgICAgIHsKKyAgICAgICAgICAgIHZlcnNpb24sIDE7CisgICAgICAgICAgICBVTklPTiBwYXJhbXMgKERJU0NSSU1JTkFUT1IgdmVyc2lvbikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBJcFY0UGFyYW1zICh2ZXJzaW9uIElTIDQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzb3VyY2VbNF07CisgICAgICAgICAgICAgICAgICAgIGRlc3RbNF07CisgICAgICAgICAgICAgICAgICAgIHNyY19wb3J0LCAyOworICAgICAgICAgICAgICAgICAgICBkZXN0X3BvcnQsIDI7CisgICAgICAgICAgICAgICAgICAgIERTQ1AsIDE7CisgICAgICAgICAgICAgICAgICAgIHByb3RvLCAxOworICAgICAgICAgICAgICAgICAgICByZXNlcnZlZCwgMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgSXBWNlBhcmFtcyAodmVyc2lvbiBJUyA2KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc291cmNlWzE2XTsKKyAgICAgICAgICAgICAgICAgICAgZGVzdFsxNl07CisgICAgICAgICAgICAgICAgICAgIHNyY19wb3J0LCAyOworICAgICAgICAgICAgICAgICAgICBkZXN0X3BvcnQsIDI7CisgICAgICAgICAgICAgICAgICAgIGZsb3dfbGFiZWxbM107CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfQorICAgICAgICBQYXJhbXM4MDIxZHEgKGNsYXNzaWZpZXJfdHlwZSBJUyAyKQorICAgICAgICB7CisgICAgICAgICAgICB0YWdfdHlwZSwgMjsKKyAgICAgICAgfQorICAgIH07Cit9IC8vIEVuZCBJRSBUQ0xBU1MKKworY29uc3QgRUlEX1JSTV9CRUFDT05fUkVQT1JUSU5HICAgICA9IDE7Citjb25zdCBFSURfUlJNX0JDTl9SRVBPUlRJTkdfREVUQUlMID0gMjsKKworSUUgQmVhY29uUmVwb3J0aW5nIChFSURfUlJNX0JFQUNPTl9SRVBPUlRJTkcpCit7CisgICAgIHJlcG9ydGluZ0NvbmRpdGlvbiwgMTsKKyAgICAgdGhyZXNob2xkLCAgICAgICAgICAxOworfQorCitJRSBCY25SZXBvcnRpbmdEZXRhaWwgKEVJRF9SUk1fQkNOX1JFUE9SVElOR19ERVRBSUwpCit7CisgICAgIHJlcG9ydGluZ0RldGFpbCwgMTsKK30KKworSUUgQVBDaGFubmVsUmVwb3J0IChFSURfQVBfQ0hBTl9SRVBPUlQpCit7CisgICAgIHJlZ3VsYXRvcnlDbGFzcywgMTsKKyAgICAgY2hhbm5lbExpc3RbMC4uNTBdOworfQorCitJRSBNZWFzdXJlbWVudFJlcXVlc3QgKEVJRF9NRUFTX1JFUVVFU1QpICAvLyA3LjMuMi4yMQoreworICAgIG1lYXN1cmVtZW50X3Rva2VuLCAxOworCisgICAgLy8gTWVhc3VyZW1lbnQgUmVxdWVzdCBNb2RlCisgICAgeworICAgICAgICBwYXJhbGxlbDogICAgICAgICAgMTsKKyAgICAgICAgZW5hYmxlOiAgICAgICAgICAgIDE7CisgICAgICAgIHJlcXVlc3Q6ICAgICAgICAgICAxOworICAgICAgICByZXBvcnQ6ICAgICAgICAgICAgMTsKKyAgICAgICAgZHVyYXRpb25NYW5kYXRvcnk6IDE7CisgICAgICAgIHVudXNlZDogICAgICAgICAgICAzOworICAgIH0KKworICAgIG1lYXN1cmVtZW50X3R5cGUsIDE7CisgICAgVU5JT04gbWVhc3VyZW1lbnRfcmVxdWVzdCAoRElTQ1JJTUlOQVRPUiBtZWFzdXJlbWVudF90eXBlKQorICAgIHsKKyAgICAgICBCYXNpYyAobWVhc3VyZW1lbnRfdHlwZSBJUyAwKQorICAgICAgIHsKKyAgICAgICAgICAgY2hhbm5lbF9ubywgICAgICAgMTsKKyAgICAgICAgICAgbWVhc19zdGFydF90aW1lWzhdOworICAgICAgICAgICBtZWFzX2R1cmF0aW9uLCAgICAyOworICAgICAgIH0KKyAgICAgICBDQ0EgKG1lYXN1cmVtZW50X3R5cGUgSVMgMSkKKyAgICAgICB7CisgICAgICAgICAgIGNoYW5uZWxfbm8sICAgICAgIDE7CisgICAgICAgICAgIG1lYXNfc3RhcnRfdGltZVs4XTsKKyAgICAgICAgICAgbWVhc19kdXJhdGlvbiwgICAgMjsKKyAgICAgICB9CisgICAgICAgUlBJSGlzdG9ncmFtIChtZWFzdXJlbWVudF90eXBlIElTIDIpCisgICAgICAgeworICAgICAgICAgICBjaGFubmVsX25vLCAgICAgICAxOworICAgICAgICAgICBtZWFzX3N0YXJ0X3RpbWVbOF07CisgICAgICAgICAgIG1lYXNfZHVyYXRpb24sICAgIDI7CisgICAgICAgfQorICAgICAgIEJlYWNvbiAobWVhc3VyZW1lbnRfdHlwZSBJUyA1KQorICAgICAgIHsKKyAgICAgICAgICByZWdDbGFzcywgICAgICAgICAgMTsKKyAgICAgICAgICBjaGFubmVsLCAgICAgICAgICAgMTsKKyAgICAgICAgICByYW5kb21pemF0aW9uLCAgICAgMjsKKyAgICAgICAgICBtZWFzX2R1cmF0aW9uLCAgICAgMjsKKyAgICAgICAgICBtZWFzX21vZGUsICAgICAgICAgMTsKKyAgICAgICAgICBCU1NJRFs2XTsKKyAgICAgICAgICBPUFRJRSBTU0lEOworICAgICAgICAgIE9QVElFIEJlYWNvblJlcG9ydGluZzsKKyAgICAgICAgICBPUFRJRSBCY25SZXBvcnRpbmdEZXRhaWw7CisgICAgICAgICAgT1BUSUUgUmVxdWVzdGVkSW5mbzsKKyAgICAgICAgICBPUFRJRSBBUENoYW5uZWxSZXBvcnRbMC4uMl07CisgICAgICAgICAgLy9PUFRJT05BTCB2ZW5kb3Jfc3BlY2lmaWNbMS4uMjM5XTsKKyAgICAgICB9CisKKyAgICB9OworfQorCitjb25zdCBFSURfQkNOX1JFUE9SVF9GUkFNRV9CT0RZICAgID0gMTsKK0lFIEJlYWNvblJlcG9ydEZybUJvZHkgKEVJRF9CQ05fUkVQT1JUX0ZSQU1FX0JPRFkpCit7CisgICAgIHJlcG9ydGVkRmllbGRzWzAuLjIyNF07Cit9CisKK0lFIE1lYXN1cmVtZW50UmVwb3J0IChFSURfTUVBU19SRVBPUlQpICAgIC8vIDcuMy4yLjIyCit7CisgICAgdG9rZW4sIDE7CisgICAgLy8gTWVhc3VyZW1lbnQgUmVwb3J0IE1vZGUKKyAgICB7CisgICAgICAgIGxhdGU6ICAgICAgMTsKKyAgICAgICAgaW5jYXBhYmxlOiAxOworICAgICAgICByZWZ1c2VkOiAgIDE7CisgICAgICAgIHVudXNlZDogICAgNTsKKyAgICB9CisgICAgdHlwZSwgMTsKKyAgICBPUFRJT05BTCBVTklPTiByZXBvcnQgKERJU0NSSU1JTkFUT1IgdHlwZSkKKyAgICB7CisgICAgICAgIEJhc2ljICh0eXBlIElTIDApICAgICAgICAgICAgICAgICAvLyA3LjMuMi4yMi4xCisgICAgICAgIHsKKyAgICAgICAgICAgIGNoYW5uZWwsICAgICAgICAgMTsKKyAgICAgICAgICAgIG1lYXNfc3RhcnRfdGltZSwgODsKKyAgICAgICAgICAgIG1lYXNfZHVyYXRpb24sICAgMjsKKyAgICAgICAgICAgIC8vIE1hcAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGJzczogICAgICAgICAgIDE7CisgICAgICAgICAgICAgICAgb2ZkbV9wcmVhbWJsZTogMTsKKyAgICAgICAgICAgICAgICB1bmlkX3NpZ25hbDogICAxOworICAgICAgICAgICAgICAgIHJhZGVyOiAgICAgICAgIDE7CisgICAgICAgICAgICAgICAgdW5tZWFzdXJlZDogICAgMTsKKyAgICAgICAgICAgICAgICB1bnVzZWQ6ICAgICAgICAzOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIENDQSAodHlwZSBJUyAxKQorICAgICAgICB7CisgICAgICAgICAgICBjaGFubmVsLCAgICAgICAgICAgMTsKKyAgICAgICAgICAgIG1lYXNfc3RhcnRfdGltZSwgICA4OworICAgICAgICAgICAgbWVhc19kdXJhdGlvbiwgICAgIDI7CisgICAgICAgICAgICBjY2FfYnVzeV9mcmFjdGlvbiwgMTsKKyAgICAgICAgfQorICAgICAgICBSUElIaXN0b2dyYW0gKHR5cGUgSVMgMikKKyAgICAgICAgeworICAgICAgICAgICAgY2hhbm5lbCwgICAgICAgICAxOworICAgICAgICAgICAgbWVhc19zdGFydF90aW1lLCA4OworICAgICAgICAgICAgbWVhc19kdXJhdGlvbiwgICAyOworICAgICAgICAgICAgcnBpMF9kZW5zaXR5LCAgICAxOworICAgICAgICAgICAgcnBpMV9kZW5zaXR5LCAgICAxOworICAgICAgICAgICAgcnBpMl9kZW5zaXR5LCAgICAxOworICAgICAgICAgICAgcnBpM19kZW5zaXR5LCAgICAxOworICAgICAgICAgICAgcnBpNF9kZW5zaXR5LCAgICAxOworICAgICAgICAgICAgcnBpNV9kZW5zaXR5LCAgICAxOworICAgICAgICAgICAgcnBpNl9kZW5zaXR5LCAgICAxOworICAgICAgICAgICAgcnBpN19kZW5zaXR5LCAgICAxOworICAgICAgICB9CisgICAgICAgQmVhY29uICh0eXBlIElTIDUpCisgICAgICAgeworICAgICAgICAgICByZWdDbGFzcywgICAgICAgICAgICAgICAxOworICAgICAgICAgICBjaGFubmVsLCAgICAgICAgICAgICAgICAxOworICAgICAgICAgICBtZWFzX3N0YXJ0X3RpbWUsICAgICAgICA4OworICAgICAgICAgICBtZWFzX2R1cmF0aW9uLCAgICAgICAgICAyOworICAgICAgICAgICAvLyByZXBvcnRlZF9mcmFtZV9pbmZvLAorICAgICAgICAgICB7CisgICAgICAgICAgICAgIGNvbmRlbnNlZF9QSFk6ICAgICAgICA3OworICAgICAgICAgICAgICByZXBvcnRlZF9mcmFtZV90eXBlOiAxOworICAgICAgICAgICB9CisgICAgICAgICAgIFJDUEksICAgICAgICAgICAgICAgICAgIDE7CisgICAgICAgICAgIFJTTkksICAgICAgICAgICAgICAgICAgIDE7CisgICAgICAgICAgIEJTU0lEWzZdOworICAgICAgICAgICBhbnRlbm5hX2lkLCAgICAgICAgICAgICAgIDE7CisgICAgICAgICAgIHBhcmVudF9UU0YsICAgICAgICAgICAgICA0OworICAgICAgICAgICBPUFRJRSBCZWFjb25SZXBvcnRGcm1Cb2R5OworICAgICAgICAgICAvL0lFIHZlbmRvcl9zcGVjaWZpYworICAgICB9CisgICAgfTsKK30KKworSUUgVFNEZWxheSAoRUlEX1RTX0RFTEFZKSAgICAgICAgICAgICAgICAgLy8gNy4zLjIuMzIKK3sKKyAgICBkZWxheSwgNDsKK30KKworSUUgVENMQVNTUFJPQyAoRUlEX1RDTEFTU19QUk9DKSAgICAgICAgICAgLy8gNy4zLjIuMzMKK3sKKyAgICBwcm9jZXNzaW5nLCAxOworfQorCitJRSBTY2hlZHVsZSAoRUlEX1NDSEVEVUxFKSAgICAgICAgICAgICAgICAvLyA3LjMuMi4zNAoreworICAgIHsKKyAgICAgICAgYWdncmVnYXRpb246IDE7CisgICAgICAgIHRzaWQ6ICAgICAgICA0OworICAgICAgICBkaXJlY3Rpb246ICAgMjsKKyAgICAgICAgcmVzZXJ2ZWQ6ICAgIDk7CisgICAgfQorICAgIHNlcnZpY2Vfc3RhcnRfdGltZSwgNDsKKyAgICBzZXJ2aWNlX2ludGVydmFsLCAgIDQ7CisgICAgbWF4X3NlcnZpY2VfZHVyLCAgICAyOworICAgIHNwZWNfaW50ZXJ2YWwsICAgICAgMjsKK30KKworSUUgUU9TQ2Fwc0FwIChFSURfUU9TX0NBUEFCSUxJVFkpICAgICAgICAgICAvLyA3LjMuMi4zNQoreworICAgIHsKKyAgICAgICAgY291bnQ6ICAgNDsKKyAgICAgICAgcWFjazogICAgMTsKKyAgICAgICAgcXJlcTogICAgMTsKKyAgICAgICAgdHhvcHJlcTogMTsKKyAgICAgICAgcmVzZXJ2ZWQ6IDE7CisgICAgfQorfQorCitJRSBRT1NDYXBzU3RhdGlvbiAoRUlEX1FPU19DQVBBQklMSVRZKSAgICAgICAgICAgLy8gNy4zLjIuMzUKK3sKKyAgICB7CisgICAgICAgIGFjdm9fdWFwc2Q6ICAgIDE7CisgICAgICAgIGFjdmlfdWFwc2Q6ICAgIDE7CisgICAgICAgIGFjYmtfdWFwc2Q6ICAgIDE7CisgICAgICAgIGFjYmVfdWFwc2Q6ICAgIDE7CisgICAgICAgIHFhY2s6ICAgICAgICAgIDE7CisgICAgICAgIG1heF9zcF9sZW5ndGg6IDI7CisgICAgICAgIG1vcmVfZGF0YV9hY2s6IDE7CisgICAgfQorfQorCitJRSBMaW5rSWRlbnRpZmllciAoRUlEX0xJTktfSURFTlRJRklFUikgICAgICAgICAgLy8gNy4zLjIuNjIKK3sKKyAgICBic3NpZFs2XTsKKyAgICBJbml0U3RhQWRkcls2XTsKKyAgICBSZXNwU3RhQWRkcls2XTsKK30KKworSU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NsYXJlZCBvcHRpb25hbCBhcyBwZXIgYnVncyAxNTIzNCwgMTQ3NTUsICYgMTQ5OTEuCisgICAgT1BUSU9OQUwgY2FwcywgMjsKK30KKworSUUgV1BBT3BhcXVlIChFSURfVkVORE9SX1NQRUNJRklDKSBPVUkgKDB4MDAsIDB4NTAsIDB4RjIsIDB4MDEpCit7CisgICAgZGF0YVsgMi4uMjQ5IF07Cit9CisKK0lFIFdNTUluZm9TdGF0aW9uIChFSURfVkVORE9SX1NQRUNJRklDKSBPVUkoMHgwMCwgMHg1MCwgMHhGMiwgMHgwMiwgMHgwMCkKK3sKKyAgICAvLyBUaGlzIElFIGNvbnRhaW5zIHRoZSBRb1MgSW5mbyBmaWVsZCB3aGVuIHNlbnQgZnJvbSBXTU0gU3RhdGlvbgorICAgIHZlcnNpb24sIDE7CisgICAgeworICAgICAgICBhY3ZvX3VhcHNkOiAgICAxOworICAgICAgICBhY3ZpX3VhcHNkOiAgICAxOworICAgICAgICBhY2JrX3VhcHNkOiAgICAxOworICAgICAgICBhY2JlX3VhcHNkOiAgICAxOworICAgICAgICByZXNlcnZlZDE6ICAgICAxOworICAgICAgICBtYXhfc3BfbGVuZ3RoOiAyOworICAgICAgICByZXNlcnZlZDI6ICAgICAxOworICAgIH0KK30KKworSUUgV01NSW5mb0FwIChFSURfVkVORE9SX1NQRUNJRklDKSBPVUkoMHgwMCwgMHg1MCwgMHhGMiwgMHgwMiwgMHgwMCkKK3sKKyAgICAvLyBUaGlzIElFIGNvbnRhaW5zIHRoZSBRb1MgSW5mbyBmaWVsZCB3aGVuIHNlbnQgZnJvbSBXTU0gQVAKKyAgICB2ZXJzaW9uLCAxOworICAgIHsKKyAgICAgICAgcGFyYW1fc2V0X2NvdW50OiA0OworICAgICAgICByZXNlcnZlZDogICAgICAgIDM7CisgICAgICAgIHVhcHNkOiAgICAgICAgICAgMTsKKyAgICB9Cit9CisKKworSUUgV01NUGFyYW1zIChFSURfVkVORE9SX1NQRUNJRklDKSBPVUkoMHgwMCwgMHg1MCwgMHhGMiwgMHgwMiwgMHgwMSkKK3sKKyAgICB2ZXJzaW9uLCAxIE1VU1RCRSAxOworICAgIHFvc0luZm8sIDE7ICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVG9EbzogVGhpcyBpcyBhY3R1YWxseSBhCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBiaXRmaWVsZCwgYnV0IGl0J3MgZm9ybWF0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB2YXJpZXMgZGVwZW5kaW5nIG9uIHdoZXRoZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBzZW5kZXIgaXMgYSBTVEEgb3IgQVAuLi4KKyAgICByZXNlcnZlZDIsIDE7CisgICAgeworICAgICAgICBhY2JlX2FpZnNuOiA0OworICAgICAgICBhY2JlX2FjbTogMTsKKyAgICAgICAgYWNiZV9hY2k6IDI7CisgICAgICAgIHVudXNlZDE6IDE7CisgICAgfQorICAgIHsKKyAgICAgICAgYWNiZV9hY3dtaW46IDQ7CisgICAgICAgIGFjYmVfYWN3bWF4OiA0OworICAgIH0KKyAgICBhY2JlX3R4b3BsaW1pdCwgMjsKKyAgICB7CisgICAgICAgIGFjYmtfYWlmc246IDQ7CisgICAgICAgIGFjYmtfYWNtOiAxOworICAgICAgICBhY2JrX2FjaTogMjsKKyAgICAgICAgdW51c2VkMjogMTsKKyAgICB9CisgICAgeworICAgICAgICBhY2JrX2Fjd21pbjogNDsKKyAgICAgICAgYWNia19hY3dtYXg6IDQ7CisgICAgfQorICAgIGFjYmtfdHhvcGxpbWl0LCAyOworICAgIHsKKyAgICAgICAgYWN2aV9haWZzbjogNDsKKyAgICAgICAgYWN2aV9hY206IDE7CisgICAgICAgIGFjdmlfYWNpOiAyOworICAgICAgICB1bnVzZWQzOiAxOworICAgIH0KKyAgICB7CisgICAgICAgIGFjdmlfYWN3bWluOiA0OworICAgICAgICBhY3ZpX2Fjd21heDogNDsKKyAgICB9CisgICAgYWN2aV90eG9wbGltaXQsIDI7CisgICAgeworICAgICAgICBhY3ZvX2FpZnNuOiA0OworICAgICAgICBhY3ZvX2FjbTogMTsKKyAgICAgICAgYWN2b19hY2k6IDI7CisgICAgICAgIHVudXNlZDQ6IDE7CisgICAgfQorICAgIHsKKyAgICAgICAgYWN2b19hY3dtaW46IDQ7CisgICAgICAgIGFjdm9fYWN3bWF4OiA0OworICAgIH0KKyAgICBhY3ZvX3R4b3BsaW1pdCwgMjsKK30KKworSUUgV01NVFNQRUMgKEVJRF9WRU5ET1JfU1BFQ0lGSUMpIE9VSSAoMHgwMCwgMHg1MCwgMHhmMiwgMHgwMiwgMHgwMikKK3sKKyAgICB2ZXJzaW9uLCAxIE1VU1RCRSAxOworCisgICAgLy8gVFMgSW5mbworICAgIHsKKyAgICAgICAgdHJhZmZpY190eXBlOiAgICAxOworICAgICAgICB0c2lkOiAgICAgICAgICAgIDQ7CisgICAgICAgIGRpcmVjdGlvbjogICAgICAgMjsKKyAgICAgICAgYWNjZXNzX3BvbGljeTogICAyOworICAgICAgICBhZ2dyZWdhdGlvbjogICAgIDE7CisgICAgICAgIHBzYjogICAgICAgICAgICAgMTsKKyAgICAgICAgdXNlcl9wcmlvcml0eTogICAzOworICAgICAgICB0c2luZm9fYWNrX3BvbDogIDI7CisgICAgfQorICAgIHsKKyAgICAgICB0c2luZm9fcnN2ZDogICAgICA3OworICAgICAgIGJ1cnN0X3NpemVfZGVmbjogIDE7CisgICAgfQorCisgICAgLy8gTm9taW5hbCBNU0RVIFNpemUKKyAgICB7CisgICAgICAgIHNpemU6ICAxNTsKKyAgICAgICAgZml4ZWQ6IDE7CisgICAgfQorCisgICAgbWF4X21zZHVfc2l6ZSwgICAgICAgIDI7CisgICAgbWluX3NlcnZpY2VfaW50LCAgICAgIDQ7CisgICAgbWF4X3NlcnZpY2VfaW50LCAgICAgIDQ7CisgICAgaW5hY3Rpdml0eV9pbnQsICAgICAgIDQ7CisgICAgc3VzcGVuc2lvbl9pbnQsICAgICAgIDQ7CisgICAgc2VydmljZV9zdGFydF90aW1lLCAgIDQ7CisgICAgbWluX2RhdGFfcmF0ZSwgICAgICAgIDQ7CisgICAgbWVhbl9kYXRhX3JhdGUsICAgICAgIDQ7CisgICAgcGVha19kYXRhX3JhdGUsICAgICAgIDQ7CisgICAgYnVyc3Rfc2l6ZSwgICAgICAgICAgIDQ7CisgICAgZGVsYXlfYm91bmQsICAgICAgICAgIDQ7CisgICAgbWluX3BoeV9yYXRlLCAgICAgICAgIDQ7CisgICAgc3VycGx1c19id19hbGxvd2FuY2UsIDI7CisgICAgbWVkaXVtX3RpbWUsICAgICAgICAgIDI7CisKK30gLy8gRW5kIElFIFdNTVRTcGVjLgorCitJRSBXTU1DYXBzIChFSURfVkVORE9SX1NQRUNJRklDKSBPVUkgKDB4MDAsIDB4NTAsIDB4RjIsIDB4MDIsIDB4MDUpCit7CisgICAgdmVyc2lvbiwgMSBNVVNUQkUgMTsKKyAgICB7CisgICAgICAgIHJlc2VydmVkOiAgICAgIDQ7CisgICAgICAgIHFhY2s6ICAgICAgICAgIDE7CisgICAgICAgIHF1ZXVlX3JlcXVlc3Q6IDE7CisgICAgICAgIHR4b3BfcmVxdWVzdDogIDE7CisgICAgICAgIG1vcmVfYWNrOiAgICAgIDE7CisgICAgfQorfQorCitJRSBXTU1UQ0xBUyAoRUlEX1ZFTkRPUl9TUEVDSUZJQykgT1VJICgweDAwLCAweDUwLCAweEYyLCAweDAyLCAweDA2KQoreworICAgIHZlcnNpb24sIDEgTVVTVEJFIDE7CisKKyAgICB1c2VyX3ByaW9yaXR5LCAxOworICAgIGNsYXNzaWZpZXJfdHlwZSwgMTsKKyAgICBjbGFzc2lmaWVyX21hc2ssIDE7CisgICAgVU5JT04gaW5mbyAoRElTQ1JJTUlOQVRPUiBjbGFzc2lmaWVyX3R5cGUpCisgICAgeworICAgICAgICBFdGhQYXJhbXMgKGNsYXNzaWZpZXJfdHlwZSBJUyAwKQorICAgICAgICB7CisgICAgICAgICAgICBzb3VyY2VbNl07CisgICAgICAgICAgICBkZXN0WzZdOworICAgICAgICAgICAgdHlwZSwgMjsKKyAgICAgICAgfQorICAgICAgICBJcFBhcmFtcyAoY2xhc3NpZmllcl90eXBlIElTIDEpCisgICAgICAgIHsKKyAgICAgICAgICAgIHZlcnNpb24sIDE7CisgICAgICAgICAgICBVTklPTiBwYXJhbXMgKERJU0NSSU1JTkFUT1IgdmVyc2lvbikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBJcFY0UGFyYW1zICh2ZXJzaW9uIElTIDQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzb3VyY2VbNF07CisgICAgICAgICAgICAgICAgICAgIGRlc3RbNF07CisgICAgICAgICAgICAgICAgICAgIHNyY19wb3J0LCAyOworICAgICAgICAgICAgICAgICAgICBkZXN0X3BvcnQsIDI7CisgICAgICAgICAgICAgICAgICAgIERTQ1AsIDE7CisgICAgICAgICAgICAgICAgICAgIHByb3RvLCAxOworICAgICAgICAgICAgICAgICAgICByZXNlcnZlZCwgMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgSXBWNlBhcmFtcyAodmVyc2lvbiBJUyA2KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc291cmNlWzE2XTsKKyAgICAgICAgICAgICAgICAgICAgZGVzdFsxNl07CisgICAgICAgICAgICAgICAgICAgIHNyY19wb3J0LCAyOworICAgICAgICAgICAgICAgICAgICBkZXN0X3BvcnQsIDI7CisgICAgICAgICAgICAgICAgICAgIGZsb3dfbGFiZWxbM107CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfQorICAgICAgICBQYXJhbXM4MDIxZHEgKGNsYXNzaWZpZXJfdHlwZSBJUyAyKQorICAgICAgICB7CisgICAgICAgICAgICB0YWdfdHlwZSwgMjsKKy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DB4OTYsIDB4MDcpCit7CisgICAgdHNpZCwgICAgICAgICAgIDE7CisgICAgc3RhdGUsICAgICAgICAgIDE7CisgICAgbXNtdF9pbnRlcnZhbCwgIDI7Cit9CisKK0lFIEVTRVRyYWZTdHJtUmF0ZVNldCAoRUlEX1ZFTkRPUl9TUEVDSUZJQykgT1VJICgweDAwLCAweDQwLCAweDk2LCAweDA4KQoreworICAgIHRzaWQsICAgICAgICAgMTsKKyAgICB0c3JhdGVzWzAuLjhdOworfQorCitJRSBFU0VWZXJzaW9uIChFSURfVkVORE9SX1NQRUNJRklDKSBPVUkgKDB4MDAsIDB4NDAsIDB4OTYsIDB4MDMpCit7CisgICAgdmVyc2lvbiwgICAgICAgICAgIDE7Cit9CisKK0lFIEVTRVR4bWl0UG93ZXIgKEVJRF9FU0VfU1BFQ0lGSUMpIE9VSSAoMHgwMCwgMHg0MCwgMHg5NiwgMHgwMCkKK3sKKyAgICBwb3dlcl9saW1pdCwgICAgMTsKKyAgICByZXNlcnZlZCwgICAgICAgMTsKK30KKworSUUgRVNFQ2NrbU9wYXF1ZSAoRUlEX0VTRV9DQ0tNX1NQRUNJRklDKSBPVUkgKDB4MDAsIDB4NDAsIDB4OTYsIDB4MDApCit7CisgICAgZGF0YVsgNi4uMjAgXTsKK30KKworSUUgUlJNRW5hYmxlZENhcCAoRUlEX1JSTV9FTkFCTEVEX0NBUFMpCit7CisgICAgIC8vQ2FwYWJpbGl0eSBiaXRtYXAKKyAgICAgeworICAgICAgICAgIExpbmtNZWFzdXJlbWVudDogICAgICAgICAxOworICAgICAgICAgIE5laWdoYm9yUnB0OiAgICAgICAgICAgICAxOworICAgICAgICAgIHBhcmFsbGVsOiAgICAgICAgICAgICAgICAxOworICAgICAgICAgIHJlcGVhdGVkOiAgICAgICAgICAgICAgICAxOworICAgICAgICAgIEJlYWNvblBhc3NpdmU6ICAgICAgICAgICAxOworICAgICAgICAgIEJlYWNvbkFjdGl2ZTogICAgICAgICAgICAxOworICAgICAgICAgIEJlYWNvblRhYmxlOiAgICAgICAgICAgICAxOworICAgICAgICAgIEJlYWNvblJlcENvbmQ6ICAgICAgICAgICAxOworICAgICB9CisgICAgIHsKKyAgICAgICAgICBGcmFtZU1lYXN1cmVtZW50OiAgICAgICAgMTsKKyAgICAgICAgICBDaGFubmVsTG9hZDogICAgICAgICAgICAgMTsKKyAgICAgICAgICBOb2lzZUhpc3RvZ3JhbTogICAgICAgICAgMTsKKyAgICAgICAgICBzdGF0aXN0aWNzOiAgICAgICAgICAgICAgMTsKKyAgICAgICAgICBMQ0lNZWFzdXJlbWVudDogICAgICAgICAgMTsKKyAgICAgICAgICBMQ0lBemltdXRoOiAgICAgICAgICAgICAgMTsKKyAgICAgICAgICBUQ01DYXBhYmlsaXR5OiAgICAgICAgICAgMTsKKyAgICAgICAgICB0cmlnZ2VyZWRUQ006ICAgICAgICAgICAgMTsKKyAgICAgfQorICAgICB7CisgICAgICAgICAgQVBDaGFuUmVwb3J0OiAgICAgICAgICAgIDE7CisgICAgICAgICAgUlJNTUlCRW5hYmxlZDogICAgICAgICAgIDE7CisgICAgICAgICAgb3BlcmF0aW5nQ2hhbk1heDogICAgICAgIDM7CisgICAgICAgICAgbm9uT3BlcmF0aW5DaGFuTWF4OiAgICAgIDM7CisgICAgIH0KKyAgICAgeworICAgICAgICAgIE1lYXN1cmVtZW50UGlsb3Q6ICAgICAgICAzOworICAgICAgICAgIE1lYXN1cmVtZW50UGlsb3RFbmFibGVkOiAxOworICAgICAgICAgIE5laWdoYm9yVFNGT2Zmc2V0OiAgICAgICAxOworICAgICAgICAgIFJDUElNZWFzdXJlbWVudDogICAgICAgICAxOworICAgICAgICAgIFJTTklNZWFzdXJlbWVudDogICAgICAgICAxOworICAgICAgICAgIEJzc0F2Z0FjY2Vzc0RlbGF5OiAgICAgICAxOworICAgICB9CisgICAgIHsKKyAgICAgICAgICBCU1NBdmFpbEFkbWlzc2lvbjogICAgICAgMTsKKyAgICAgICAgICBBbnRlbm5hSW5mb3JtY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mb3J0eU1IekludG9sZXJhbnQ6ICAgICAgMTsKKyAgICAgICAgdHdlbnR5TUh6QnNzV2lkdGhSZXE6ICAgIDE7CisgICAgICAgIG9ic3NTY2FuRXhlbXB0aW9uUmVxOiAgICAxOworICAgICAgICBvYnNzU2NhbkV4ZW1wdGlvbkdyYW50OiAgMTsKKyAgICAgICAgdW51c2VkOiAgICAgICAgICAgICAgICAgIDM7CisgICAgfQorfQorCitJRSBIVDIwNDBCU1NJbnRvbGVyYW50UmVwb3J0IChFSURfMjBfNDBfQlNTX0lOVE9MRVJBTlRfUkVQT1JUKQoreworICAgICBvcGVyYXRpbmdDbGFzcywgMTsKKyAgICAgY2hhbm5lbExpc3RbMC4uNTBdOworfQorCitjb25zdCBFSURfUlJNX05CUl9SUFRfVFNGICAgICAgICAgICAgICA9ICAgIDE7Citjb25zdCBFSURfUlJNX05CUl9DRF9DT1VOVFJZICAgICAgICAgICA9ICAgIDI7Citjb25zdCBFSURfUlJNX05CUl9NU01UX1BJTE9UX1RYX0lORk8gICA9ICAgNjY7CisKK0lFIE5laWdoYm9yUmVwb3J0IChFSURfTkVJR0hCT1JfUkVQT1JUKQoreworICAgICBic3NpZFs2XTsKKyAgICAgLy9Cc3NpZCBJbmZvCisgICAgIHsKKyAgICAgICAgICBBUFJlYWNoYWJpbGl0eTogMjsKKyAgICAgICAgICBTZWN1cml0eTogICAgICAgMTsKKyAgICAgICAgICBLZXlTY29wZTogICAgICAgMTsKKyAgICAgICAgICAvL0NhcGFiaWxpdGllcworICAgICAgICAgIFNwZWNNZ210Q2FwOiAgICAxOworICAgICAgICAgIFFvc0NhcDogICAgICAgICAxOworICAgICAgICAgIGFwc2Q6ICAgICAgICAgICAxOworICAgICAgICAgIHJybTogICAgICAgICAgICAxOworICAgICB9CisgICAgIC8vQ2FwYWJpbGl0aWVzIGNvbnRkLgorICAgICB7CisgICAgICAgICAgRGVsYXllZEJBOiAgICAgIDE7CisgICAgICAgICAgSW1tQkE6ICAgICAgICAgIDE7CisgICAgIC8vQ2FwYWJpbGl0aWVzIGVuZC4KKyAgICAgICAgICBNb2JpbGl0eURvbWFpbjogMTsKKyAgICAgICAgICByZXNlcnZlZDogICAgICAgNTsKKyAgICAgfQorCisgICAgICAgICAgcmVzZXJ2ZWQxLCAgICAgIDI7IC8vcGFydCBvZiBCU1NJRCBJbmZvLgorCisgICAgIHJlZ3VsYXRvcnlDbGFzcywgMTsKKyAgICAgY2hhbm5lbCwgICAgICAgICAxOworICAgICBQaHlUeXBlLCAgICAgICAgIDE7CisgICAgIE9QVElFIElFIFRTRkluZm8gKEVJRF9SUk1fTkJSX1JQVF9UU0YpCisgICAgIHsKKyAgICAgICAgICBUc2ZPZmZzZXQsIDI7CisgICAgICAgICAgQmVhY29uSW50dmwsIDI7CisgICAgIH0KKyAgICAgT1BUSUUgSUUgQ29uZGVuc2VkQ291bnRyeVN0ciAoRUlEX1JSTV9OQlJfQ0RfQ09VTlRSWSkKKyAgICAgeworICAgICAgICAgIGNvdW50cnlTdHJbMl07CisgICAgIH0KKyAgICAgT1BUSUUgSUUgTWVhc3VyZW1lbnRQaWxvdDsgLy8gKEVJRF9SUk1fTkJSX01TTVRfUElMT1RfVFhfSU5GTykKKy8vICAgICB7CisvLyAgICAgICAgICBtZWFzdXJlbWVudFBpbG90LCAxOworLy8gICAgICAgICAgdmVuZG9yU3BlY2lmaWNbMC4uMjU1XTsgLy9TaG91bGQgYmUgYW4gSUUuIEJ1dCBjdXJyZW50bHkgb25seSBvbmUgbGV2ZWwgb2YgbmVzdGluZyBhbGxvd2VkLiBDYW4gaWdub3JlIGZvciBub3cuCisvLyAgICAgfQorICAgICBPUFRJRSBJRSBSUk1FbmFibGVkQ2FwOworICAgICBPUFRJRSBJRSBNdWx0aUJzc2lkOworICAgICAvL0lnbm9yaW5nIHZlbmRvciBzcGVjaWZpYy4KK30KKworSUUgUkNQSUlFIChFSURfUkNQSSkKK3sKKyAgICAgcmNwaSwgMTsKK30KKworSUUgUlNOSUlFIChFSURfUlNOSSkKK3sKKyAgICAgcnNuaSwgMTsKK30KKworSUUgV0ZBVFBDIChFSURfVkVORE9SX1NQRUNJRklDKSBPVUkgKDB4MDAsIDB4NTAsIDB4RjIsIDB4MDgsIDB4MDApCit7CisgICAgIHR4UG93ZXIsIDE7CisgICAgIGxpbmtNYXJnaW4sIDE7Cit9CisKK0lFIE1vYmlsaXR5RG9tYWluIChFSURfRlRfTU9CSUxJVFlfRE9NQUlOKQoreworICAgTURJRCwgMjsKKyAgIC8vRlQgQ2FwYWJpbGl0eSBhbmQgcG9saWN5CisgICB7CisgICAgICBvdmVyRFNDYXA6ICAgICAgICAgMTsKKyAgICAgIHJlc291cmNlUmVxQ2FwOiAgICAxOworICAgICAgcmVzZXJ2ZWQ6ICAgICAgICAgIDY7CisgICB9Cit9Citjb25zdCBTVUJfRUlEX0ZUX1IxS0hfSUQgPSAxOworY29uc3QgU1VCX0VJRF9GVF9HVEsgICAgID0gMjsKK2NvbnN0IFNVQl9FSURfRlRfUjBLSF9JRCA9IDM7Citjb25zdCBTVUJfRUlEX0ZUX0lHVEsgICAgPSA0OworSUUgRlRJbmZvIChFSURfRlRfSU5GTykKK3sKKyAgIC8vIE1pY0NvbnRyb2wsIDI7CisgICB7CisgICAgICByZXNlcnZlZDogODsKKyAgICAgIElFQ291bnQ6ICA4OworICAgfQorICAgTUlDWzE2XTsKKyAgIEFub25jZVszMl07CisgICBTbm9uY2VbMzJdOworCisgICBPUFRJRSBJRSBSMUtIX0lEIChTVUJfRUlEX0ZUX1IxS0hfSUQpCisgICB7CisgICAgICBQTUtfUjFfSURbNl07CisgICB9CisKKyAgIE9QVElFIElFIEdUSyAoU1VCX0VJRF9GVF9HVEspCisgICB7CisgICAgICAvL0tleSBJbmZvCisgICAgICB7CisgICAgICAgICBrZXlJZDogMjsKKyAgICAgICAgIHJlc2VydmVkOiAxNDsKKyAgICAgIH0KKyAgICAgIGtleUxlbmd0aCwgMTsKKyAgICAgIFJTQ1s4XTsKKyAgICAgIGtleVs1Li4zMl07CisgICB9CisKKyAgIE9QVElFIElFIFIwS0hfSUQgKFNVQl9FSURfRlRfUjBLSF9JRCkKKyAgIHsKKyAgICAgIFBNS19SMF9JRFsxLi40OF07CisgICB9CisKKyAgIE9QVElFIElFIElHVEsgKFNVQl9FSURfRlRfSUdUSykKKyAgIHsKKyAgICAgIC8vS2V5IEluZm8KKyAgICAgIGtleUlEWzJdOworICAgICAgSVBOWzZdOworICAgICAga2V5TGVuZ3RoLCAxOworICAgICAga2V5WzI0XTsKKyAgIH0KK30KKworSUUgVGltZW91dEludGVydmFsIChFSURfVElNRU9VVF9JTlRFUlZBTCkKK3sKKyAgIHRpbWVvdXRUeXBlLCAxOworICAgdGltZW91dFZhbHVlLCA0OworfQorCisvL1RPRE86IG5lZWQgdG8gZGVmaW5lIHRoaXMgcHJvcGVybHkuCitJRSBSSUNEYXRhIChFSURfRlRfUklDX0RBVEEpCit7CisgICBJZGVudGlmaWVyLCAxOworICAgcmVzb3VyY2VEZXNjQ291bnQsIDE7CisgICBzdGF0dXNDb2RlLCAyOworfQorCitJRSBSSUNEZXNjcmlwdG9yIChFSURfRlRfUklDX0RFU0NSSVBUT1IpCit7CisgICByZXNvdXJjZVR5cGUsIDE7CisgICB2YXJpYWJsZURhdGFbMC4uMjU1XTsgLy9CbG9jayBhY2sgcGFyYW0gc2V0Li4uVE9ETzoKK30KKworSUUgV3NjSUVPcGFxdWUgKEVJRF9WRU5ET1JfU1BFQ0lGSUMpIE9VSSAoIDB4MDAsIDB4NTAsIDB4RjIsIDB4MDQgKQoreworICAgIGRhdGFbIDIuLjI0OSBdOworfQorCitJRSBQMlBJRU9wYXF1ZSAoRUlEX1ZFTkRPUl9TUEVDSUZJQykgT1VJICggMHg1MCwgMHg2RiwgMHg5QSwgMHgwOSApCit7CisgICAgZGF0YVsgMi4uMjQ5IF07Cit9CisKK0lFIFdGRElFT3BhcXVlIChFSURfVkVORE9SX1NQRUNJRklDKSBPVUkgKCAweDUwLCAweDZG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Ml07CisgICAgfQorCisgICAgT1BUSUUgSUUgQVBOYW1lIChTSVJfTUFDX1BST1BfQVBfTkFNRV9UWVBFKQorICAgIHsKKyAgICAgICAgbmFtZVsxLi4zMl07CisgICAgfQorCisgICAgT1BUSUUgSUUgSENGIChTSVJfTUFDX1BST1BfSENGX1RZUEUpCisgICAgeworICAgICAgICBlbmFibGVkLCAxOworICAgIH0KKworICAgIE9QVElFIElFIFdEUyAoU0lSX01BQ19QUk9QX1dEU19UWVBFKQorICAgIHsKKyAgICAgICAgd2RzRGF0YVswLi5BTklfV0RTX0lORk9fTUFYX0xFTkdUSF07CisgICAgfQorCisgICAgT1BUSUUgSUUgQlBJbmRpY2F0b3IgKFNJUl9NQUNfUFJPUF9CUF9JTkRfVFlQRSkKKyAgICB7CisgICAgICAgIGluZGljYXRvciwgMTsKKyAgICAgICAgdHlwZSwgMTsKKyAgICB9CisKKworICAgIC8vIEluIFByb2dyZXNzOiBJIHRoaW5rIFNJUl9NQUNfUFJPUF9ORUlHSEJPUl9CU1NfVFlQRSBpcyBnb2luZyB0byBuZWVkIGEKKyAgICAvLyBjdXN0b20gcGFyc2VyLi4uCisKKworICAgIE9QVElFIElFIExvYWRJbmZvIChTSVJfTUFDX1BST1BfTE9BRF9JTkZPX1RZUEUpIE1TQgorICAgIHsKKyAgICAgICAgbnVtX3N0YXMsIDI7CisgICAgICAgIGNoYW5uZWxfdXRpbCwgMjsKKyAgICB9CisKKyAgICBPUFRJRSBJRSBMb2FkQmFsYW5jZSAoU0lSX01BQ19QUk9QX0xPQURfQkFMQU5DRV9UWVBFKQorICAgIHsKKyAgICAgICAgYnNzaWRbNl07CisgICAgICAgIGNoYW5uZWwsIDE7CisgICAgfQorCisgICAgT1BUSUUgSUUgUHJvcEFzc29jVHlwZSAoU0lSX01BQ19QUk9QX0FTU09DX1RZUEUpCisgICAgeworICAgICAgICB0eXBlLCAxOworICAgIH0KKworICAgIE9QVElFIElFIExMQXR0ciAoU0lSX01BQ19QUk9QX0xMX0FUVFJfVFlQRSkgTVNCCisgICAgeworICAgICAgICBkZWZlcl90aHJlc2hvbGQsIDQ7CisgICAgfQorCisgICAgT1BUSUUgSUUgUHJvcENhcGFiaWxpdHkgKFNJUl9NQUNfUFJPUF9DQVBBQklMSVRZKQorICAgIHsKKyAgICAgICAgY2FwYWJpbGl0eSwgMjsKKyAgICB9CisKKyAgICBPUFRJRSBJRSBWZXJzaW9uIChTSVJfTUFDX1BST1BfVkVSU0lPTikKKyAgICB7CisgICAgICAgIGNoaXBfcmV2LCA0OworICAgICAgICBjYXJkX3R5cGUsIDE7CisgICAgICAgIGJ1aWxkX3ZlcnNpb25bMC4uMjBdOworICAgIH0KKworICAgIE9QVElFIElFIFByb3BFRENBUGFyYW1zIChTSVJfTUFDX1BST1BfRURDQVBBUkFNUykKKyAgICB7CisgICAgICAgIHFvcywgMTsgICAgICAgICAgICAgICAgIC8vIFRvRG86IFRoaXMgaXMgYSBiaXRmaWVsZCB3aG9zZSBmb3JtYXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZGVwZW5kcyBvbiB3aGV0aGVyIHRoaXMgaXMgZnJvbSBhbiBBUAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBvciBhIFNUQSwgaW5mb3JtYXRpb24gd2hpY2ggSSdtIG5vdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzdXJlIHdlIGhhdmUgYXQgcGFyc2UgdGltZS4uLgorICAgICAgICByZXNlcnZlZCwgMTsKKworICAgICAgICAvLyBCZXN0IEVmZm9ydAorICAgICAgICB7CisgICAgICAgICAgICBhY2JlX2FpZnNuOiA0OworICAgICAgICAgICAgYWNiZV9hY206ICAgMTsKKyAgICAgICAgICAgIGFjYmVfYWNpOiAgIDI7CisgICAgICAgICAgICB1bnVzZWQxOiAgICAxOworICAgICAgICB9CisgICAgICAgIHsKKyAgICAgICAgICAgIGFjYmVfbWluOiA0OworICAgICAgICAgICAgYWNiZV9tYXg6IDQ7CisgICAgICAgIH0KKyAgICAgICAgYWNiZV90eG9wbGltaXQsIDI7CisKKyAgICAgICAgLy8gQmFja2dyb3VuZAorICAgICAgICB7CisgICAgICAgICAgICBhY2JrX2FpZnNuOiA0OworICAgICAgICAgICAgYWNia19hY206ICAgMTsKKyAgICAgICAgICAgIGFjYmtfYWNpOiAgIDI7CisgICAgICAgICAgICB1bnVzZWQyOiAgICAxOworICAgICAgICB9CisgICAgICAgIHsKKyAgICAgICAgICAgIGFjYmtfbWluOiA0OworICAgICAgICAgICAgYWNia19tYXg6IDQ7CisgICAgICAgIH0KKyAgICAgICAgYWNia190eG9wbGltaXQsIDI7CisKKyAgICAgICAgLy8gVmlkZW8KKyAgICAgICAgeworICAgICAgICAgICAgYWN2aV9haWZzbjogNDsKKyAgICAgICAgICAgIGFjdmlfYWNtOiAxOworICAgICAgICAgICAgYWN2aV9hY2k6IDI7CisgICAgICAgICAgICB1bnVzZWQzOiAgICAxOworICAgICAgICB9CisgICAgICAgIHsKKyAgICAgICAgICAgIGFjdmlfbWluOiA0OworICAgICAgICAgICAgYWN2aV9tYXg6IDQ7CisgICAgICAgIH0KKyAgICAgICAgYWN2aV90eG9wbGltaXQsIDI7CisKKyAgICAgICAgLy8gVm9pY2UKKyAgICAgICAgeworICAgICAgICAgICAgYWN2b19haWZzbjogNDsKKyAgICAgICAgICAgIGFjdm9fYWNtOiAxOworICAgICAgICAgICAgYWN2b19hY2k6IDI7CisgICAgICAgICAgICB1bnVzZWQ0OiAgICAxOworICAgICAgICB9CisgICAgICAgIHsKKyAgICAgICAgICAgIGFjdm9fbWluOiA0OworICAgICAgICAgICAgYWN2b19tYXg6IDQ7CisgICAgICAgIH0KKyAgICAgICAgYWN2b190eG9wbGltaXQsIDI7CisKKyAgICB9IC8vIEVuZCBJRSBQcm9wRURDQVBhcmFtcy4KKworICAgIC8qKgorICAgICAqIFxpZSBUaXRhbgorICAgICAqCisgICAgICogXGJyaWVmIFByb3ByaWV0YXJ5IE5leHQgR2VuZXJhdGlvbiAoVElUQU4pIElFIHN0cnVjdHVyZQorICAgICAqCisgICAgICoKKyAgICAgKiBCYXNlZCBvbiB0aGUgc2V0dGluZyBvZiB0aGUgIlRpdGFuIiBwcm9wcmlldGFyeSBiaXQgaW4gdGhlCisgICAgICogdFNpclByb3BJRVN0cnVjdC5jYXBhYmlsaXR5IGZpZWxkIChiaXQgIzYpLCB0aGlzIElFIHdpbGwgYmUgc2VudAorICAgICAqIGFwcHJvcHJpYXRlbHkgdG8gYWxsIHRoZSBBTklwZWVycyBpbiB0aGUgZm9sbG93aW5nIG1hbmFnZW1lbnQgZnJhbWVzIC0KKyAgICAgKgorICAgICAqIC0gQmVhY29ucworICAgICAqIC0gQXNzb2MgUmVxL1JzcAorICAgICAqIC0gUmVhc3NvYyBSZXEvUnNwCisgICAgICogLSBQcm9iZSBSZXEvUnNwCisgICAgICoKKyAgICAgKi8KKworICAgIE9QVElFIElFIFRpdGFuIChTSVJfTUFDX1BST1BfVElUQU4pCisgICAgeworICAgICAgICBjb25jYXRfdGNpZF9iaXRtYXAsIDE7CisgICAgICAgIGNvbXByZXNzaW9uX3RjaWRfYml0bWFwLCAxOworCisgICAgICAgIC8vIElkZW50aWZpZXMgdGhlIE9QRVJBVElPTkFMIHN0YXRlIG9mIENoYW5uZWwgQm9uZGluZworICAgICAgICAvLyBUaGlzIGluZm8gaXMgZW5jb2RlZCBhcyBhIGJpdG1hcCBhcyBmb2xsb3dzOgorICAgICAgICAvLworICAgICAgICAvLyAgICAgYjcgICAgYjYgICBiNSAgYjQgIGIzICBiMiAgYjEgIGIwCisgICAgICAgIC8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAgIC8vIHxDQ0FfQ0IgfENDQSB8SUNFIHwgQVV8Q1N8VS9EfCBPIHwgQSB8CisgICAgICAgIC8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisg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DEwIHdpbGwgdXNlIEFDMSwgc28gdXNlIG9mIEFDIGlzCisgICAgICAgIC8vIG92ZXJsb2FkZWQuICBUaGlzIGlzIGRvbmUgdG8gcmVkdWNlIHRoZSBzaXplIG9mIElFIGluIHRoZSBiZWFjb25zLgorICAgICAgICB7CisgICAgICAgICAgICBiYUJ1ZmZlclNpemU6IDEyOworICAgICAgICAgICAgcnN2ZDogICAgICAgICAgNDsKKyAgICAgICAgfQorICAgIH0KKworfSAvLyBFbmQgSUUgQWlyZ28uCisKK0lFIFZIVENhcHMgKEVJRF9WSFRfQ0FQQUJJTElUSUVTKQoreworICAgIC8vVkhUIENhcGFiaWxpdHkgSW5mbworICAgIHsKKyAgICAgICAgbWF4TVBEVUxlbjogICAgICAgICAgICAgICAyOworICAgICAgICBzdXBwb3J0ZWRDaGFubmVsV2lkdGhTZXQ6IDI7CisgICAgICAgIGxkcGNDb2RpbmdDYXA6ICAgICAgICAgICAgMTsKKyAgICAgICAgc2hvcnRHSTgwTUh6OiAgICAgICAgICAgICAxOworICAgICAgICBzaG9ydEdJMTYwYW5kODBwbHVzODBNSHo6IDE7CisgICAgICAgIHR4U1RCQzogICAgICAgICAgICAgICAgICAgMTsKKyAgICAgICAgcnhTVEJDOiAgICAgICAgICAgICAgICAgICAzOworICAgICAgICBzdUJlYW1Gb3JtZXJDYXA6ICAgICAgICAgIDE7CisgICAgICAgIHN1QmVhbWZvcm1lZUNhcDogICAgICAgICAgMTsKKyAgICAgICAgY3Nub2ZCZWFtZm9ybWVyQW50U3VwOiAgICAzOworICAgICAgICBudW1Tb3VuZGluZ0RpbTogICAgICAgICAgIDM7CisgICAgICAgIG11QmVhbWZvcm1lckNhcDogICAgICAgICAgMTsKKyAgICAgICAgbXVCZWFtZm9ybWVlQ2FwOiAgICAgICAgICAxOworICAgICAgICB2aHRUWE9QUFM6ICAgICAgICAgICAgICAgIDE7CisgICAgICAgIGh0Y1ZIVENhcDogICAgICAgICAgICAgICAgMTsKKyAgICAgICAgbWF4QU1QRFVMZW5FeHA6ICAgICAgICAgICAzOworICAgICAgICB2aHRMaW5rQWRhcHRDYXA6ICAgICAgICAgIDI7CisgICAgICAgIHJ4QW50UGF0dGVybjogICAgICAgICAgICAgMTsKKyAgICAgICAgdHhBbnRQYXR0ZXJuOiAgICAgICAgICAgICAxOworICAgICAgICByZXNlcnZlZDE6ICAgICAgICAgICAgICAgIDI7CisgICAgfQorICAgIHJ4TUNTTWFwLCAgICAgICAgICAgICAgICAgICAgIDI7CisgICAgeworICAgICAgICAgcnhIaWdoU3VwRGF0YVJhdGU6ICAgICAgIDEzOworICAgICAgICAgcmVzZXJ2ZWQyOiAgICAgICAgICAgICAgIDM7CisgICAgfQorICAgIHR4TUNTTWFwLCAgICAgICAgICAgICAgICAgICAgIDI7CisgICAgeworICAgICAgICB0eFN1cERhdGFSYXRlOiAgICAgICAgICAgIDEzOworICAgICAgICByZXNlcnZlZDM6ICAgICAgICAgICAgICAgIDM7CisgICAgfQorfQorCitJRSBWSFRPcGVyYXRpb24gKEVJRF9WSFRfT1BFUkFUSU9OX0VMRU1FTlQpCit7CisgICAgY2hhbldpZHRoLCAgICAgICAgICAgMTsKKyAgICBjaGFuQ2VudGVyRnJlcVNlZzEsICAxOworICAgIGNoYW5DZW50ZXJGcmVxU2VnMiwgIDE7CisgICAgYmFzaWNNQ1NTZXQsICAgICAgICAgMjsKK30KKworSUUgVkhURXh0QnNzTG9hZCAoRUlEX1ZIVF9FWFRfQlNTX0xPQUQpCit7CisgICAgbXVNSU1PQ2FwU3RhQ291bnQsICAgIDE7CisgICAgc3NVbmRlclV0aWwsICAgICAgICAgIDE7CisgICAgRm9ydHlNSHpVdGlsLCAgICAgICAgIDE7CisgICAgRWlnaHR5TUh6VXRpbCwgICAgICAgIDE7CisgICAgT25lU2l4dHlNSHpVdGlsLCAgICAgIDE7Cit9CisKK0lFIEFJRCAoRUlEX0FJRCkKK3sKKyAgICBhc3NvY0lkLCAgICAgICAgICAgICAgMjsKK30KKworSUUgV2lkZXJCV0NoYW5Td2l0Y2hBbm4gKEVJRF9XSURFUl9CV19DSEFOTkVMX1NXSVRDSF9BTk4pCit7CisgICBuZXdDaGFuV2lkdGgsICAgICAgICAgIDE7CisgICBuZXdDZW50ZXJDaGFuRnJlcTAsICAgIDE7CisgICBuZXdDZW50ZXJDaGFuRnJlcTEsICAgIDE7Cit9CisKK0lFIEV4dENhcCAoRUlEX0VYVF9DQVApCit7CisgICAgeworICAgICAgICBic3NDb2V4aXN0TWdtdFN1cHBvcnQ6ICAgICAgICAgIDE7CisgICAgICAgIHJlc2VydmVkMTogICAgICAgICAgICAgICAgICAgICAgMTsKKyAgICAgICAgZXh0Q2hhblN3aXRjaDogICAgICAgICAgICAgICAgICAxOworICAgICAgICByZXNlcnZlZDI6ICAgICAgICAgICAgICAgICAgICAgIDE7CisgICAgICAgIHBzbXBDYXA6ICAgICAgICAgICAgICAgICAgICAgICAgMTsKKyAgICAgICAgcmVzZXJ2ZWQzOiAgICAgICAgICAgICAgICAgICAgICAxOworICAgICAgICBzcHNtcENhcDogICAgICAgICAgICAgICAgICAgICAgIDE7CisgICAgICAgIGV2ZW50OiAgICAgICAgICAgICAgICAgICAgICAgICAgMTsKKyAgICAgICAgZGlhZ25vc3RpY3M6ICAgICAgICAgICAgICAgICAgICAxOworICAgICAgICBtdWx0aURpYWdub3N0aWNzOiAgICAgICAgICAgICAgIDE7CisgICAgICAgIGxvY1RyYWNraW5nOiAgICAgICAgICAgICAgICAgICAgMTsKKyAgICAgICAgRk1TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAxOworICAgICAgICBwcm94eUFSUFNlcnZpY2U6ICAgICAgICAgICAgICAgIDE7CisgICAgICAgIGNvTG9jSW50ZlJlcG9ydGluZzogICAgICAgICAgICAgMTsKKyAgICAgICAgY2l2aWNMb2M6ICAgICAgICAgICAgICAgICAgICAgICAxOworICAgICAgICBnZW9zcGF0aWFsTG9jOiAgICAgICAgICAgICAgICAgIDE7CisgICAgICAgIFRGUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgMTsKKyAgICAgICAgd25tU2xlZXBNb2RlOiAgICAgICAgICAgICAgICAgICAxOworICAgICAgICB0aW1Ccm9hZGNhc3Q6ICAgICAgICAgICAgICAgICAgIDE7CisgICAgICAgIGJzc1RyYW5zaXRpb246ICAgICAgICAgICAgICAgICAgMTsKKyAgICAgICAgcW9zVHJhZmZpY0NhcDogICAgICAgICAgICAgICAgICAxOworICAgICAgICBhY1N0YUNudDogICAgICAgICAgICAgICAgICAgICAgIDE7CisgICAgICAgIG11bHRpQlNTSUQ6ICAgICAgICAgICAgICAgICAgICAgMTsKKyAgICAgICAgdGltaW5nTWVhczogICAgICAgICAgICAgICAgICAgICAxOworICAgICAgICBjaGFuVXNhZ2U6ICAgICAgICAgICAgICAgICAgICAgIDE7CisgICAgICAgIHNzaWRMaXN0OiAgICAgICAgICAgICAgICAgICAgICAgMTsKKyAgICAgICAgRE1TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAxOworICAgICAgICBVVENUU0ZPZmZzZXQ6ICAgICAgICAgICAgICAgICAgIDE7CisgICAgICAgIFRETFNQZWVyVUFQU0RCdWZmZXJTVEE6ICAgICAgICAgMTsKKyAgICAgICAgVERMU1BlZXJQU01TdXBwOiAgICAgICAgICAgICAgICAxOworICAgICAgICBURExTQ2hhbm5lbFN3aXRjaGluZzogICAgICAgICAgIDE7CisgICAgICAgIGludGVyd29ya2luZ1NlcnZpY2U6ICAgICAgICAgICAgMTsKKyAgICB9CisgICAgeworICAgICAgICBxb3NNYXA6ICAgICAgICAgICAgICAgICAgICAgICAgIDE7CisgICAgICAgIEVCUjogICAgICAgICAgICAgICAgICAgICAgICAgICAgMTsKKyAgICAgICAgc3NwbkludGVyZmFjZTogICAgICAgICAgICAgICAgICAxOworICAgICAgICByZXNlcnZlZDQ6ICAgICAgICAgICAgICAgICAgICAgIDE7CisgICAgICAgIG1zZ0NGQ2FwOiAgICAgICAgICAgICAgICAgICAgICAgMTsKKyAgICAgICAgVERMU1N1cHBvcnQ6ICAgICAgICAgICAgICAgICAgICAxOworICAgICAgICBURExTUHJvaGliaXRlZDogICAgICAgICAgICAgICAgIDE7CisgICAgICAgIFRETFNDaGFuU3dpdFByb2hpYml0ZWQ6ICAgICAgICAgMTsKKyAgICAgICAgcmVqZWN0VW5hZG1pdHRlZFRyYWZmaWM6ICAgICAgICAxOworICAgICAgICBzZXJ2aWNlSW50ZXJ2YWxHcmFudWxhcml0eTogICAgIDM7CisgICAgICAgIGlkZW50aWZpZXJMb2M6ICAgICAgICAgICAgICAgICAgMTsKKyAgICAgICAgdWFwc2RDb2V4aXN0ZW5jZTogICAgICAgICAgICAgICAxOworICAgICAgICB3bm1Ob3RpZmljYXRpb246ICAgICAgICAgICAgICAgIDE7CisgICAgICAgIHJlc2VydmVkNTogICAgICAgICAgICAgICAgICAgICAgMTsKKyAgICB9CisgICAgeworICAgICAgICBVVEY4U1NJRDogICAgICAgICAgICAgICAgICAgICAgIDE7CisgICAgICAgIHJlc2VydmVkNjogICAgICAgICAgICAgICAgICAgICAgMTI7CisgICAgICAgIFRETFNXaWRlckJXOiAgICAgICAgICAgICAgICAgICAgMTsKKyAgICAgICAgb3Blck1vZGVOb3RpZmljYXRpb246ICAgICAgICAgICAxOworICAgICAgICByZXNlcnZlZDc6ICAgICAgICAgICAgICAgICAgICAgIDE7CisgICAgfQorfQorCitJRSBIVENhcHMgKEVJRF9IVF9DQVBBQklMSVRJRVMpCit7CisgICAgLy8gSFQgQ2FwYWJpbGl0eSBJbmZvCisgICAgeworICAgICAgICBhZHZDb2RpbmdDYXA6ICAgICAgICAgICAgIDE7CisgICAgICAgIHN1cHBvcnRlZENoYW5uZWxXaWR0aFNldDogMTsKKyAgICAgICAgbWltb1Bvd2VyU2F2ZTogICAgICAgICAgICAyOworICAgICAgICBncmVlbkZpZWxkOiAgICAgICAgICAgICAgIDE7CisgICAgICAgIHNob3J0R0kyME1IejogICAgICAgICAgICAgMTsKKyAgICAgICAgc2hvcnRHSTQwTUh6OiAgICAgICAgICAgICAxOworICAgICAgICB0eFNUQkM6ICAgICAgICAgICAgICAgICAgIDE7CisgICAgICAgIHJ4U1RCQzogICAgICAgICAgICAgICAgICAgMjsKKyAgICAgICAgZGVsYXllZEJBOiAgICAgICAgICAgICAgICAxOworICAgICAgICBtYXhpbWFsQU1TRFVzaXplOiAgICAgICAgIDE7CisgICAgICAgIGRzc3NDY2tNb2RlNDBNSHo6ICAgICAgICAgMTsKKyAgICAgICAgcHNtcDogICAgICAgICAgICAgICAgICAgICAxOworICAgICAgICBzdGJjQ29udHJvbEZyYW1lOiAgICAgICAgIDE7CisgICAgICAgIGxzaWdUWE9QUHJvdGVjdGlvbjogICAgICAgMTsKKyAgICB9CisgICAgLy8gSFQgUGFyYW1ldGVycyBJbmZvOworICAgIHsKKyAgICAgICAgbWF4UnhBTVBEVUZhY3RvcjogMjsKKyAgICAgICAgbXBkdURlbnNpdHk6ICAgICAgMzsKKyAgICAgICAgcmVzZXJ2ZWQxOiAgICAgICAgMzsKKyAgICB9CisKKyAgICBzdXBwb3J0ZWRNQ1NTZXRbIEhUX01BWF9TVVBQT1JURURfTUNTX1NFVCBdOworCisgICAgLy8gRXh0ZW5kZWQgSFQgQ2FwYWJpbGl0eSBJbmZvCisgICAgeworICAgICAgICBwY286ICAgICAgICAgICAgMTsKKyAgICAgICAgdHJhbnNpdGlvblRpbWU6IDI7CisgICAgICAgIHJlc2VydmVkMjogICAgICA1OworICAgICAgICBtY3NGZWVkYmFjazogICAgMjsKKyAgICAgICAgcmVzZXJ2ZWQzOiAgICAgIDY7CisgICAgfQorICAgIC8vIFRYQkYgQ2FwYWJpbGl0eSBJbmZvCisgICAgeworICAgICAgICB0eEJGOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE7CisgICAgICAgIHJ4U3RhZ2dlcmVkU291bmRpbmc6ICAgICAgICAgICAgICAgICAgICAgICAgMTsKKyAgICAgICAgdHhTdGFnZ2VyZWRTb3VuZGluZzogICAgICAgICAgICAgICAgICAgICAgICAxOworICAgICAgICByeFpMRjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE7CisgICAgICAgIHR4WkxGOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTsKKyAgICAgICAgaW1wbGljaXRUeEJGOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxOworICAgICAgICBjYWxpYnJhdGlvbjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI7CisgICAgICAgIGV4cGxpY2l0Q1NJVHhCRjogICAgICAgICAgICAgICAgICAgICAgICAgICAgMTsKKyAgICAgICAgZXhwbGljaXRVbmNvbXByZXNzZWRTdGVlcmluZ01hdHJpeDogICAgICAgICAxOworICAgICAgICBleHBsaWNpdEJGQ1NJRmVlZGJhY2s6ICAgICAgICAgICAgICAgICAgICAgIDM7CisgICAgICAgIGV4cGxpY2l0VW5jb21wcmVzc2VkU3RlZXJpbmdNYXRyaXhGZWVkYmFjazogMzsKKyAgICAgICAgZXhwbGljaXRDb21wcmVzc2VkU3RlZXJpbmdNYXRyaXhGZWVkYmFjazogICAzOworICAgICAgICBjc2lOdW1CRkFudGVubmFlOiAgICAgICAgICAgICAgICAgICAgICAgICAgIDI7CisgICAgICAgIHVuY29tcHJlc3NlZFN0ZWVyaW5nTWF0cml4QkZBbnRlbm5hZTogICAgICAgMjsKKyAgICAgICAgY29tcHJlc3NlZFN0ZWVyaW5nTWF0cml4QkZBbnRlbm5hZTogICAgICAgICAyOworICAgICAgICByZXNlcnZlZDQ6ICAgICAgICAgICA3OworICAgIH0KKyAgICAvLyBBUyBDYXBhYmlsaXR5IEluZm8KKyAgICB7CisgICAgICAgIGFudGVubmFTZWxlY3Rpb246ICAgICAgICAgMTsKKyAgICAgICAgZXhwbGljaXRDU0lGZWVkYmFja1R4OiAgICAxOworICAgICAgICBhbnRlbm5hSW5kaWNlc0ZlZWRiYWNrVHg6IDE7CisgICAgICAgIGV4cGxpY2l0Q1NJRmVlZGJhY2s6ICAgICAgMTsKKyAgICAgICAgYW50ZW5uYUluZGljZXNGZWVkYmFjazogICAxOworICAgICAgICByeEFTOiAgICAgICAgICAgICAgICAgICAgIDE7CisgICAgICAgIHR4U291bmRpbmdQUERVczogICAgICAgICAgMTsKKyAgICAgICAgcmVzZXJ2ZWQ1OiAgICAgICAgICAgICAgICAxOworICAgIH0KKyAgICAvL1RPRE86IHRha2UgaXQgb3V0IHdoZW4gZ2VuZXJpYyBmaXggdG8gcmVtb3ZlIGV4dHJhIGJ5dGVzIGluIElFIGlzIGF2YWlsYWJsZS4KKyAgICAvL1RoaXMgaXMgcmVxdWlyZWQgdG8gaW50ZXJvcCB3aXRoIERsaW5rIEFQIHdoaWNoIGlzIHNlbmRpbmcgMiBieXRlcyBleHRyYSBpbiBIVEluZm8gSUUuCisgICAgcnN2ZFswLi4zMl07CisKK30gLy8gRW5kIElFIEhUQ2Fwcy4KKworSUUgSFRJbmZvIChFSURfSFRfSU5GTykKK3sKKyAgICBwcmltYXJ5Q2hhbm5lbCwgMTsKKworICAgIC8vIGFodEluZm9GaWVsZDEKKyAgICB7CisgICAgICAgIHNlY29uZGFyeUNoYW5uZWxPZmZzZXQ6ICAgICAyOworICAgICAgICByZWNvbW1lbmRlZFR4V2lkdGhTZXQ6ICAgICAgMTsKKyAgICAgICAgcmlmc01vZGU6ICAgICAgICAgICAgICAgICAgIDE7CisgICAgICAgIGNvbnRyb2xsZWRBY2Nlc3NPbmx5OiAgICAgICAxOworICAgICAgICBzZXJ2aWNlSW50ZXJ2YWxHcmFudWxhcml0eTogMzsKKyAgICB9CisKKyAgICAvLyBhaHRJbmZvRmllbGQyCisKKworICAgIC8vIGFodEluZm9GaWVsZDIKKyAgICB7CisgICAgICAgIG9wTW9kZTogICAgICAgICAgICAgIDI7CisgICAgICAgIG5vbkdGRGV2aWNlc1ByZXNlbnQ6IDE7CisgICAgICAgIHRyYW5zbWl0QnVyc3RMaW1pdDogMTsKKyAgICAgICAgb2Jzc05vbkhUU3RhUHJlc2VudDoxOworICAgICAgICByZXNlcnZlZDogICAgICAgICAgIDExOworICAgIH0KKworCisgICAgLy8gYWh0SW5mb0ZpZWxkMworICAgIHsKKyAgICAgICAgYmFzaWNTVEJDTUNTOiAgICAgICAgICAgICAgICAgIDc7CisgICAgICAgIGR1YWxDVFNQcm90ZWN0aW9uOiAgICAgICAgICAgICAxOworICAgICAgICBzZWNvbmRhcnlCZWFjb246ICAgICAgICAgICAgICAgMTsKKyAgICAgICAgbHNpZ1RYT1BQcm90ZWN0aW9uRnVsbFN1cHBvcnQ6IDE7CisgICAgICAgIHBjb0FjdGl2ZTogICAgICAgICAgICAgICAgICAgICAxOworICAgICAgICBwY29QaGFzZTogICAgICAgICAgICAgICAgICAgICAgMTsKKyAgICAgICAgcmVzZXJ2ZWQyOiAgICAgICAgICAgICAgICAgICAgIDQ7CisgICAgfQorCisgICAgYmFzaWNNQ1NTZXRbIEhUX01BWF9TVVBQT1JURURfTUNTX1NFVCBdOworCisgICAgLy9UT0RPOiB0YWtlIGl0IG91dCB3aGVuIGdlbmVyaWMgZml4IHRvIHJlbW92ZSBleHRyYSBieXRlcyBpbiBJRSBpcyBhdmFpbGFibGUuCisgICAgLy9UaGlzIGlzIHJlcXVpcmVkIHRvIGludGVyb3Agd2l0aCBEbGluayBBUCB3aGljaCBpcyBzZW5kaW5nIDIgYnl0ZXMgZXh0cmEgaW4gSFRJbmZvIElFLgorICAgIHJzdmRbMC4uMzJdOworCit9IC8vIEVuZCBJRSBIVEluZm8uCisKKworSUUgT3BlcmF0aW5nTW9kZSAoRUlEX09QRVJBVElOR19NT0RFKQoreworICAgIHsgLy9PcGVyYXRpbmcgTW9kZSBmaWVsZAorICAgICAgICBjaGFuV2lkdGg6ICAgIDI7CisgICAgICAgIHJlc2VydmVkOiAgICAgMjsKKyAgICAgICAgcnhOU1M6ICAgICAgICAzOworICAgICAgICByeE5TU1R5cGU6ICAgIDE7CisgICAgfQorfQorCitJRSBRb3NNYXBTZXQgKEVJRF9RT1NfTUFQX1NFVCkKK3sKKyAgICBkc2NwX2V4Y2VwdGlvbnNbMC4uNjBdOworfQorCitDT05UQUlORVJJRSBSSUNEYXRhRGVzYworeworICBNQU5ESUUgUklDRGF0YTsKKyAgT1BUSUUgIFJJQ0Rlc2NyaXB0b3I7CisgIE9QVElFICBUU1BFQzsKKyAgT1BUSUUgIFRDTEFTWzAuLjJdOworICBPUFRJRSAgVENMQVNTUFJPQzsKKyAgT1BUSUUgIFRTRGVsYXk7CisgIE9QVElFICBTY2hlZHVsZTsKKyAgT1BUSUUgIFdNTVRTUEVDOworICBPUFRJRSAgV01NVENMQVNbMC4uMl07CisgIE9QVElFICBXTU1UQ0xBU1BST0M7CisgIE9QVElFICBXTU1UU0RlbGF5OworICBPUFRJRSAgV01NU2NoZWR1bGU7Cit9CisKKy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTVVMVElJRXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLworLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KKworTVVMVElJRSBXU0MgKCBFSURfVkVORE9SX1NQRUNJRklDICkgT1VJKCAweDAwLCAweDUwLCAweEYyLCAweDA0ICkKK3sKKyAgICBNQU5EQVRPUllUTFYgVmVyc2lvbjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTXVzdCBiZSAweDEwCisgICAgT1BUSU9OQUxUTFYgIFdQU1N0YXRlOworICAgIE9QVElPTkFMVExWICBBUFNldHVwTG9ja2VkOworICAgIE9QVElPTkFMVExWICBTZWxlY3RlZFJlZ2lzdHJhckNvbmZpZ01ldGhvZHM7CisgICAgT1BUSU9OQUxUTFYgIFVVSURfRTsKKyAgICBPUFRJT05BTFRMViAgVVVJRF9SOworICAgIE9QVElPTkFMVExWICBSRkJhbmRzOworICAgIE9QVElPTkFMVExWICBTZWxlY3RlZFJlZ2lzdHJhcjsKKyAgICBPUFRJT05BTFRMViAgQ29uZmlnTWV0aG9kczsKKyAgICBPUFRJT05BTFRMViAgQXNzb2NpYXRpb25TdGF0ZTsKKyAgICBPUFRJT05BTFRMViAgQ29uZmlndXJhdGlvbkVycm9yOworICAgIE9QVElPTkFMVExWICBNYW51ZmFjdHVyZXI7CisgICAgT1BUSU9OQUxUTFYgIE1vZGVsTmFtZTsKKyAgICBPUFRJT05BTFRMViAgTW9kZWxOdW1iZXI7CisgICAgT1BUSU9OQUxUTFYgIFNlcmlhbE51bWJlcjsKKyAgICBPUFRJT05BTFRMViAgRGV2aWNlTmFtZTsKKyAgICBPUFRJT05BTFRMViAgRGV2aWNlUGFzc3dvcmRJRDsKKyAgICBPUFRJT05BTFRMViAgUHJpbWFyeURldmljZVR5cGU7CisgICAgT1BUSU9OQUxUTFYgIFJlcXVlc3RUeXBlOworICAgIE9QVElPTkFMVExWICBSZXNwb25zZVR5cGU7CisgICAgT1BUSU9OQUxUTFYgIFZlbmRvckV4dGVuc2lvbjsKKyAgICBPUFRJT05BTFRMViAgUmVxdWVzdERldmljZVR5cGU7Cit9CisKK01VTFRJSUUgV3NjQmVhY29uICggRUlEX1ZFTkRPUl9TUEVDSUZJQyApIE9VSSggMHgwMCwgMHg1MCwgMHhGMiwgMHgwNCApCit7CisgICAgTUFOREFUT1JZVExWIFZlcnNpb247ICAgICAgICAgICAgICAgICAgICAgICAgLy8gMHgxMCA9IHZlcnNpb24gMS4wLCAweDExCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gPSB2ZXJzaW9uIDEuMSwgZXRjLgorICAgIE1BTkRBVE9SWVRMViBXUFNTdGF0ZTsgICAgICAgICAgICAgICAgICAgICAgIC8vIDEgPSB1bmNvbmZpZ3VyZWQsIDIgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvbmZpZ3VyZWQKKyAgICBPUFRJT05BTFRMViAgQVBTZXR1cExvY2tlZDsgICAgICAgICAgICAgICAgICAvLyBNdXN0IGJlIGluY2x1ZGVkIGlmIHZhbHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaXMgVFJVRQorICAgIE9QVElPTkFMVExWICBTZWxlY3RlZFJlZ2lzdHJhcjsgICAgICAgICAgICAgIC8vIEJPT0w6IGluZGljYXRlcyBpZiB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB1c2VyIGhhcyByZWNlbnRseQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFjdGl2YXRlZCBhIFJlZ2lzdHJhciB0bworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFkZCBhbiBFbnJvbGxlZS4KKyAgICBPUFRJT05BTFRMViAgRGV2aWNlUGFzc3dvcmRJRDsgICAgICAgICAgICAgICAvLyBEZXZpY2UgUGFzc3dvcmQgSUQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpbmRpY2F0ZXMgdGhlIG1ldGhvZCBvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlkZW50aWZpZXMgdGhlIHNwZWNpZmljCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcGFzc3dvcmQgdGhhdCB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzZWxlY3RlZCBSZWdpc3RyYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpbnRlbmRzIHRvIHVzZS4KKyAgICBPUFRJT05BTFRMViAgU2VsZWN0ZWRSZWdpc3RyYXJDb25maWdNZXRob2RzOyAvLyBUaGlzIGF0dHJpYnV0ZSBjb250YWlucworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBjb25maWcgbWV0aG9kcyBhY3RpdmUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBvbiB0aGUgc2VsZWN0ZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBSZWdpc3RyYXIuCisgICAgT1BUSU9OQUxUTFYgIFVVSURfRTsgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhlIEFQJ3MgVVVJRCBpcyBwcm92aWRlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9ubHkgd2hlbiB0aGUgQVAgaXMgYQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGR1YWwtYmFuZCBBUCBpbiBwdXNoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYnV0dG9uIG1vZGUgYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW5kaWNhdGluZyBwdXNoIGJ1dHRvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1vZGUgb24gYm90aCByYWRpb3MKKyAgICBPUFRJT05BTFRMViAgUkZCYW5kczsgICAgICAgICAgICAgICAgICAgICAgICAvLyBJbmRpY2F0ZXMgYWxsIFJGIGJhbmRzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYXZhaWxhYmxlIG9uIHRoZSBBUC4gQQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGR1YWwtYmFuZCBBUCBtdXN0IHByb3ZpZGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGF0dHJpYnV0ZS4KKyAgICAvLyBXU0MgMi4wCisgICAgT1BUSU9OQUxUTFYgIFZlbmRvckV4dGVuc2lvbjsgICAgICAgICAgICAgICAgLy8gVmVyc2lvbjIgYW5kIEF1dGhvcml6ZWRNQUNzCisKK30gLy8gRW5kIE11bHRpLUlFIFdzY0JlYWNvbi4KKworTVVMVElJRSBXc2NBc3NvY1JlcSAoIEVJRF9WRU5ET1JfU1BFQ0lGSUMgKSBPVUkoIDB4MDAsIDB4NTAsIDB4RjIsIDB4MDQgKQoreworICAgIE1BTkRBVE9SWVRMViBWZXJzaW9uOyAgICAgICAgICAgICAgICAgICAgICAgIC8vIDB4MTAgPSB2ZXJzaW9uIDEuMCwgMHgxMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vID0gdmVyc2lvbiAxLjEsIGV0Yy4KKyAgICBNQU5EQVRPUllUTFYgUmVxdWVzdFR5cGU7ICAgICAgICAgICAgICAgICAgICAvLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vCisgICAgLy8gV1NDIDIuMAorICAgIE9QVElPTkFMVExWICBWZW5kb3JFeHRlbnNpb247ICAgICAgICAgICAgICAgIC8vIFZlcnNpb24yCisKK30gLy8gRW5kIE11bHRpLUlFIFdzY0Fzc29jUmVxLgorCisKK01VTFRJSUUgV3NjQXNzb2NSZXMgKCBFSURfVkVORE9SX1NQRUNJRklDICkgT1VJKCAweDAwLCAweDUwLCAweEYyLCAweDA0ICkKK3sKKyAgICBNQU5EQVRPUllUTFYgVmVyc2lvbjsgICAgICAgICAgICAgICAgICAgICAgICAvLyAweDEwID0gdmVyc2lvbiAxLjAsIDB4MTEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyA9IHZlcnNpb24gMS4xLCBldGMuCisgICAgTUFOREFUT1JZVExWIFJlc3BvbnNlVHlwZTsgICAgICAgICAgICAgICAgICAgLy8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLworICAgIC8vIFdTQyAyLjAKKyAgICBPUFRJT05BTFRMViAgVmVuZG9yRXh0ZW5zaW9uOyAgICAgICAgICAgICAgICAvLyBWZXJzaW9uMgorCit9IC8vIEVuZCBNdWx0aS1JRSBXc2NBc3NvY1Jlcy4KKworTVVMVElJRSBXc2NSZWFzc29jUmVzICggMjIxICkgT1VJKCAweDAwLCAweDUwLCAweEYyLCAweDA0ICkKK3sKKyAgICBNQU5EQVRPUllUTFYgVmVyc2lvbjsgICAgICAgICAgICAgICAgICAgICAgICAvLyAweDEwID0gdmVyc2lvbiAxLjAsIDB4MTEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyA9IHZlcnNpb24gMS4xLCBldGMuCisgICAgTUFOREFUT1JZVExWIFJlc3BvbnNlVHlwZTsgICAgICAgICAgICAgICAgICAgLy8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLworICAgIC8vIFdTQyAyLjAKKyAgICBPUFRJT05BTFRMViAgVmVuZG9yRXh0ZW5zaW9uOyAgICAgICAgICAgICAgICAvLyBWZXJzaW9uMgorCit9IC8vIEVuZCBNdWx0aS1JRSBXc2NSZWFzc29jUmVzCisKK01VTFRJSUUgV3NjUHJvYmVSZXEgKCBFSURfVkVORE9SX1NQRUNJRklDICkgT1VJKCAweDAwLCAweDUwLCAweEYyLCAweDA0ICkKK3sKKyAgICBNQU5EQVRPUllUTFYgVmVyc2lvbjsgICAgICAgICAgICAgICAgICAgICAgICAvLyAweDEwID0gdmVyc2lvbiAxLjAsIDB4MTEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyA9IHZlcnNpb24gMS4xLCBldGMuCisgICAgTUFOREFUT1JZVExWIFJlcXVlc3RUeXBlOyAgICAgICAgICAgICAgICAgICAgLy8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLworICAgIE1BTkRBVE9SWVRMViBDb25maWdNZXRob2RzOyAgICAgICAgICAgICAgICAgIC8vIENvbmZpZ3VyYXRpb24gbWV0aG9kcyB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBFbnJvbGxlZSBvciBSZWdpc3RyYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzdXBwb3J0cworICAgIE1BTkRBVE9SWVRMViBVVUlEX0U7ICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHVuaXF1ZSBHVUlEIGdlbmVyYXRlZCBieQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBFbnJvbGxlZS4KKyAgICBNQU5EQVRPUllUTFYgUHJpbWFyeURldmljZVR5cGU7CisgICAgTUFOREFUT1JZVExWIFJGQmFuZHM7ICAgICAgICAgICAgICAgICAgICAgICAgLy8gU3BlY2lmaWMgUkYgYmFuZHMgdXNlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZvciB0aGlzIG1lc3NhZ2UKKyAgICBNQU5EQVRPUllUTFYgQXNzb2NpYXRpb25TdGF0ZTsgICAgICAgICAgICAgICAvLyBDb25maWd1cmF0aW9uIGFuZCBwcmV2aW91cworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFzc29jaWF0aW9uIHN0YXRlCisgICAgTUFOREFUT1JZVExWIENvbmZpZ3VyYXRpb25FcnJvcjsKKyAgICBNQU5EQVRPUllUTFYgRGV2aWNlUGFzc3dvcmRJRDsKKworICAgIC8vIFdTQyAyLjAKKyAgICBPUFRJT05BTFRMViAgTWFudWZhY3R1cmVyOyAgICAgICAgICAgICAgICAgICAvLyBNdXN0IGJlIGluY2x1ZGVkIGluIHZlciAyLjAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBvciBoaWdoZXIuCisgICAgT1BUSU9OQUxUTFYgIE1vZGVsTmFtZTsgICAgICAgICAgICAgICAgICAgICAgLy8gTXVzdCBiZSBpbmNsdWRlZCBpbiB2ZXIgMi4wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gb3IgaGlnaGVyLgorICAgIE9QVElPTkFMVExWICBNb2RlbE51bWJlcjsgICAgICAgICAgICAgICAgICAgIC8vIE11c3QgYmUgaW5jbHVkZWQgaW4gdmVyIDIuMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9yIGhpZ2hlci4KKyAgICBPUFRJT05BTFRMViAgRGV2aWNlTmFtZTsgICAgICAgICAgICAgICAgICAgICAvLyBNdXN0IGJlIGluY2x1ZGVkIGluIHZlciAyLjAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBvciBoaWdoZXIuCisgICAgT1BUSU9OQUxUTFYgIFZlbmRvckV4dGVuc2lvbjsgICAgICAgICAgICAgICAgLy8gVmVyc2lvbjIgYW5kIFJlcXVlc3RUb0VudHJvbGwKKworICAgIE9QVElPTkFMVExWICBSZXF1ZXN0RGV2aWNlVHlwZTsgICAgICAgICAgICAgIC8vIFdoZW4gYSBkZXZpY2UgcmVjZWl2ZXMgYSBQcm9iZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJlcXVlc3QgY29udGFpbmluZyB0aGlzIHR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSXQgd2lsbCBvbmx5IHJlcG9uc2UgaWYgUHJpbWFyeQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9yIFNlY29uZGFyeSBEZXZpY2UgVHlwZSBtYXRjaGVzLgorCit9IC8vIEVuZCBNdWx0aS1JRSBXc2NQcm9iZVJlcS4KKworTVVMVElJRSBXc2NQcm9iZVJlcyAoIEVJRF9WRU5ET1JfU1BFQ0lGSUMgKSBPVUkoIDB4MDAsIDB4NTAsIDB4RjIsIDB4MDQgKQoreworICAgIE1BTkRBVE9SWVRMViBWZXJzaW9uOyAgICAgICAgICAgICAgICAgICAgICAgIC8vIDB4MTAgPSB2ZXJzaW9uIDEuMCwgMHgxMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vID0gdmVyc2lvbiAxLjEsIGV0Yy4KKyAgICBNQU5EQVRPUllUTFYgV1BTU3RhdGU7ICAgICAgICAgICAgICAgICAgICAgICAvLyAxID0gdW5jb25maWd1cmVkLCAyID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBjb25maWd1cmVkCisgICAgT1BUSU9OQUxUTFYgIEFQU2V0dXBMb2NrZWQ7ICAgICAgICAgICAgICAgICAgLy8gTXVzdCBiZSBpbmNsdWRlZCBpZiB2YWx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlzIFRSVUUKKyAgICBPUFRJT05BTFRMViAgU2VsZWN0ZWRSZWdpc3RyYXI7ICAgICAgICAgICAgICAvLyBCT09MOiBpbmRpY2F0ZXMgaWYgdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdXNlciBoYXMgcmVjZW50bHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhY3RpdmF0ZWQgYSBSZWdpc3RyYXIgdG8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhZGQgYW4gRW5yb2xsZWUuCisgICAgT1BUSU9OQUxUTFYgIERldmljZVBhc3N3b3JkSUQ7ICAgICAgICAgICAgICAgLy8gRGV2aWNlIFBhc3N3b3JkIElECisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW5kaWNhdGVzIHRoZSBtZXRob2Qgb3IKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpZGVudGlmaWVzIHRoZSBzcGVjaWZpYworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHBhc3N3b3JkIHRoYXQgdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2VsZWN0ZWQgUmVnaXN0cmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW50ZW5kcyB0byB1c2UuCisgICAgT1BUSU9OQUxUTFYgIFNlbGVjdGVkUmVnaXN0cmFyQ29uZmlnTWV0aG9kczsgLy8gVGhpcyBhdHRyaWJ1dGUgY29udGFpbnMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgY29uZmlnIG1ldGhvZHMgYWN0aXZlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gb24gdGhlIHNlbGVjdGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gUmVnaXN0cmFyLgorICAgIE1BTkRBVE9SWVRMViBSZXNwb25zZVR5cGU7CisgICAgTUFOREFUT1JZVExWIFVVSURfRTsgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdW5pcXVlIGlkZW50aWZpZXIgb2YgQVAKKyAgICBNQU5EQVRPUllUTFYgTWFudWZhY3R1cmVyOworICAgIE1BTkRBVE9SWVRMViBNb2RlbE5hbWU7CisgICAgTUFOREFUT1JZVExWIE1vZGVsTnVtYmVyOworICAgIE1BTkRBVE9SWVRMViBTZXJpYWxOdW1iZXI7CisgICAgTUFOREFUT1JZVExWIFByaW1hcnlEZXZpY2VUeXBlOworICAgIE1BTkRBVE9SWVRMViBEZXZpY2VOYW1lOyAgICAgICAgICAgICAgICAgICAgIC8vIFVzZXItZnJpZW5kbHkgZGVzY3JpcHRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBvZiBkZXZpY2UKKyAgICBNQU5EQVRPUllUTFYgQ29uZmlnTWV0aG9kczsgICAgICAgICAgICAgICAgICAvLyBDb25maWcgTWV0aG9kcyBjb3JyZXNwb25kcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRvIHRoZSBtZXRob2RzIHRoZSBBUAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN1cHBvcnRzIGFzIGFuIEVucm9sbGVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZm9yIGFkZGluZyBleHRlcm5hbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJlZ2lzdHJhcnMuCisgICAgT1BUSU9OQUxUTFYgUkZCYW5kczsgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSW5kaWNhdGVzIGFsbCBSRiBiYW5kcworICAgICAgICAgICA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VzcG9uc2UpIG9yIG1hbmRhdG9yeSBmaWVsZHMKKy8vIG1pc3NpbmcgKGlmIHdlIHRob3VnaHQgd2Ugd2VyZSBwYXJzaW5nIGEgUHJvYmUgUmVzcG9uc2UsIGFuZCBpbiBmYWN0IGhhZAorLy8gZGF0YSBmcm9tIGEgQmVhY29uKS4KKworLy8gSSBjcmVhdGVkIHRoaXMgTVVMVElJRSB0byBzdHVmZiBpbnRvIHRoZSBCZWFjb25JRXMgZnJhbWVzIHRvIGF2b2lkIHRoaXMuCisvLyBJdCdzIGludGVuZGVkIHRvIGJlIHVzZWQgb24gdW5wYWNrIG9ubHksIGFuZCB0byBkbyBzbyBpbiBhIHZlcnkgZm9yZ2l2aW5nCisvLyB3YXkuCisKK01VTFRJSUUgV3NjQmVhY29uUHJvYmVSZXMgKCBFSURfVkVORE9SX1NQRUNJRklDICkgT1VJKCAweDAwLCAweDUwLCAweEYyLCAweDA0ICkKK3sKKyAgICBPUFRJT05BTFRMViBWZXJzaW9uOyAgICAgICAgICAgICAgICAgICAgICAgIC8vIDB4MTAgPSB2ZXJzaW9uIDEuMCwgMHgxMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vID0gdmVyc2lvbiAxLjEsIGV0Yy4KKyAgICBPUFRJT05BTFRMViBXUFNTdGF0ZTsgICAgICAgICAgICAgICAgICAgICAgIC8vIDEgPSB1bmNvbmZpZ3VyZWQsIDIgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvbmZpZ3VyZWQKKyAgICBPUFRJT05BTFRMViAgQVBTZXR1cExvY2tlZDsgICAgICAgICAgICAgICAgICAvLyBNdXN0IGJlIGluY2x1ZGVkIGlmIHZhbHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaXMgVFJVRQorICAgIE9QVElPTkFMVExWICBTZWxlY3RlZFJlZ2lzdHJhcjsgICAgICAgICAgICAgIC8vIEJPT0w6IGluZGljYXRlcyBpZiB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB1c2VyIGhhcyByZWNlbnRseQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFjdGl2YXRlZCBhIFJlZ2lzdHJhciB0bworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFkZCBhbiBFbnJvbGxlZS4KKyAgICBPUFRJT05BTFRMViAgRGV2aWNlUGFzc3dvcmRJRDsgICAgICAgICAgICAgICAvLyBEZXZpY2UgUGFzc3dvcmQgSUQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpbmRpY2F0ZXMgdGhlIG1ldGhvZCBvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlkZW50aWZpZXMgdGhlIHNwZWNpZmljCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcGFzc3dvcmQgdGhhdCB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzZWxlY3RlZCBSZWdpc3RyYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpbnRlbmRzIHRvIHVzZS4KKyAgICBPUFRJT05BTFRMViAgU2VsZWN0ZWRSZWdpc3RyYXJDb25maWdNZXRob2RzOyAvLyBUaGlzIGF0dHJpYnV0ZSBjb250YWlucworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBjb25maWcgbWV0aG9kcyBhY3RpdmUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBvbiB0aGUgc2VsZWN0ZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBSZWdpc3RyYXIuCisgICAgT1BUSU9OQUxUTFYgUmVzcG9uc2VUeXBlOworICAgIE9QVElPTkFMVExWIFVVSURfRTsgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdW5pcXVlIGlkZW50aWZpZXIgb2YgQVAKKyAgICBPUFRJT05BTFRMViBNYW51ZmFjdHVyZXI7CisgICAgT1BUSU9OQUxUTFYgTW9kZWxOYW1lOworICAgIE9QVElPTkFMVExWIE1vZGVsTnVtYmVyOworICAgIE9QVElPTkFMVExWIFNlcmlhbE51bWJlcjsKKyAgICBPUFRJT05BTFRMViBQcmltYXJ5RGV2aWNlVHlwZTsKKyAgICBPUFRJT05BTFRMViBEZXZpY2VOYW1lOyAgICAgICAgICAgICAgICAgICAgIC8vIFVzZXItZnJpZW5kbHkgZGVzY3JpcHRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBvZiBkZXZpY2UKKyAgICBPUFRJT05BTFRMViBDb25maWdNZXRob2RzOyAgICAgICAgICAgICAgICAgIC8vIENvbmZpZyBNZXRob2RzIGNvcnJlc3BvbmRzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdG8gdGhlIG1ldGhvZHMgdGhlIEFQCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc3VwcG9ydHMgYXMgYW4gRW5yb2xsZWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmb3IgYWRkaW5nIGV4dGVybmFsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gUmVnaXN0cmFycy4KKyAgICBPUFRJT05BTFRMViBSRkJhbmRzOyAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJbmRpY2F0ZXMgYWxsIFJGIGJhbmRzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYXZhaWxhYmxlIG9uIHRoZSBBUC4gQQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGR1YWwtYmFuZCBBUCBtdXN0IHByb3ZpZGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGF0dHJpYnV0ZS4KKyAgICAvLyBXU0MgMi4wCisgICAgT1BUSU9OQUxUTFYgIFZlbmRvckV4dGVuc2lvbjsgICAgICAgICAgICAgICAgLy8gVmVyc2lvbjIgYW5kIEF1dGhvcml6ZWRNQUNzCisKK30gLy8gV3NjUHJvYmVSZXMuCisvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLworLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJSUVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8KKy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisKK01VTFRJSUUgUDJQQmVhY29uICggRUlEX1ZFTkRPUl9TUEVDSUZJQyApIE9VSSggMHg1MCwgMHg2RiwgMHg5QSwgMHgwOSApCit7CisgICAgTUFOREFUT1JZVExWIFAyUENhcGFiaWxpdHk7ICAgICAgICAgICAgICAgICAgLy8gQ29udGFpbnMgUDJQIERldmljZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFuZCBQMlAgR3JvdXAgQ2FwYWJpbGl0eQorICAgIE1BTkRBVE9SWVRMViBQMlBEZXZpY2VJZDsgICAgICAgICAgICAgICAgICAgIC8vIENvbnRhaW5zIFAyUCBEZXZpY2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBBZGRyZXNzCisgICAgT1BUSU9OQUxUTFYgIE5vdGljZU9mQWJzZW5jZTsgICAgICAgICAgICAgICAgLy8gSW5kaWNhdGVzIE5vdGljZSBvZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEFic2VuY2Ugc2NoZWR1bGUgYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQ1QgV2luZG93CisKK30gLy8gRW5kIFAyUEJlYWNvbgorCisKK01VTFRJSUUgUDJQQXNzb2NSZXEgKCBFSURfVkVORE9SX1NQRUNJRklDICkgT1VJKCAweDUwLCAweDZGLCAweDlBLCAweDA5ICkKK3sKKyAgICBNQU5EQVRPUllUTFYgUDJQQ2FwYWJpbGl0eTsgICAgICAgICAgICAgICAgICAvLyBDb250YWlucyBQMlAgRGV2aWNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYW5kIFAyUCBHcm91cCBDYXBhYmlsaXR5CisgICAgT1BUSU9OQUxUTFYgIEV4dGVuZGVkTGlzdGVuVGltaW5nOworICAgIE1BTkRBVE9SWVRMViBQMlBEZXZpY2VJbmZvOworCit9IC8vIEVuZCBQMlBBc3NvY1JlcQorCisKK01VTFRJSUUgUDJQQXNzb2NSZXMgKCBFSURfVkVORE9SX1NQRUNJRklDICkgT1VJKCAweDUwLCAweDZGLCAweDlBLCAweDA5ICkKK3sKKyAgICBNQU5EQVRPUllUTFYgUDJQU3RhdHVzOworICAgIE9QVElPTkFMVExWICBFeHRlbmRlZExpc3RlblRpbWluZzsKKworfSAvLyBFbmQgUDJQQXNzb2NSZXMKKworCitNVUxUSUlFIFAyUFByb2JlUmVxICggRUlEX1ZFTk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ljZUluZm87CisgICBNQU5EQVRPUllUTFYgUDJQR3JvdXBJZDsKK30KKworTVVMVElJRSBQMlBXU0NQcm92aXNpb25EaXNjb3ZlcnlSZXMgKCBFSURfVkVORE9SX1NQRUNJRklDICkgT1VJKCAweDAwLCAweDUwLCAweEYyLCAweDA0ICkKK3sKKyAgIE1BTkRBVE9SWVRMViBDb25maWdNZXRob2RzOworfQorCisKK01VTFRJSUUgUDJQTm90aWNlT2ZBYnNlbmNlICggRUlEX1ZFTkRPUl9TUEVDSUZJQyApIE9VSSggMHg1MCwgMHg2RiwgMHg5QSwgMHgwOSApCit7CisgICBNQU5EQVRPUllUTFYgTm90aWNlT2ZBYnNlbmNlOworfQorCisKK01VTFRJSUUgUDJQUHJlc2VuY2VSZXNwb25zZSAoIEVJRF9WRU5ET1JfU1BFQ0lGSUMgKSBPVUkoIDB4NTAsIDB4NkYsIDB4OUEsIDB4MDkgKQoreworICAgTUFOREFUT1JZVExWIFAyUFN0YXR1czsKKyAgIE1BTkRBVE9SWVRMViBOb3RpY2VPZkFic2VuY2U7Cit9CisKKworLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KKy8vIEZyYW1lcworCitGUkFNRSBCZWFjb24gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBDLmYuIFNlYy4gNy4yLjMuMQoreworICAgIEZGICAgICBUaW1lU3RhbXA7CisgICAgRkYgICAgIEJlYWNvbkludGVydmFsOworICAgIEZGICAgICBDYXBhYmlsaXRpZXM7CisgICAgTUFORElFIFNTSUQ7CisgICAgTUFORElFIFN1cHBSYXRlczsKKyAgICBPUFRJRSAgRkhQYXJhbVNldDsKKyAgICBPUFRJRSAgRFNQYXJhbXM7CisgICAgT1BUSUUgIENGUGFyYW1zOworICAgIE9QVElFICBJQlNTUGFyYW1zOworICAgIE9QVElFICBUSU07CisgICAgT1BUSUUgIENvdW50cnk7CisgICAgT1BUSUUgIEZIUGFyYW1zOworICAgIE9QVElFICBGSFBhdHRUYWJsZTsKKyAgICBPUFRJRSAgUG93ZXJDb25zdHJhaW50czsKKyAgICBPUFRJRSAgQ2hhblN3aXRjaEFubjsKKyAgICBPUFRJRSAgUXVpZXQ7CisgICAgT1BUSUUgIFRQQ1JlcG9ydDsKKyAgICBPUFRJRSAgRVJQSW5mbzsKKyAgICBPUFRJRSAgRXh0U3VwcFJhdGVzOworICAgIE9QVElFICBSU047CisgICAgT1BUSUUgIFFCU1NMb2FkOworICAgIE9QVElFICBFRENBUGFyYW1TZXQ7CisgICAgT1BUSUUgIFFPU0NhcHNBcDsKKyAgICBPUFRJRSAgQVBDaGFubmVsUmVwb3J0OworICAgIE9QVElFICBSUk1FbmFibGVkQ2FwOworICAgIE9QVElFICBNb2JpbGl0eURvbWFpbjsKKyAgICBPUFRJRSAgV1BBOworICAgIE9QVElFICBIVENhcHM7CisgICAgT1BUSUUgIEhUSW5mbzsKKyAgICBPUFRJRSAgRXh0Q2hhblN3aXRjaEFubjsKKyAgICBPUFRJRSAgV01NSW5mb0FwOworICAgIE9QVElFICBXTU1QYXJhbXM7CisgICAgT1BUSUUgIFdNTUNhcHM7CisgICAgT1BUSUUgIFdBUEk7CisgICAgT1BUSUUgIEVTRVJhZE1nbXRDYXA7CisgICAgT1BUSUUgIEVTRVRyYWZTdHJtTWV0OworICAgIE9QVElFICBFU0VUeG1pdFBvd2VyOworCisgICAgT1BUSUUgIEFpcmdvOworICAgIE9QVElFICBXc2NCZWFjb247CisgICAgT1BUSUUgIFAyUEJlYWNvbjsKKyAgICBPUFRJRSAgVkhUQ2FwczsKKyAgICBPUFRJRSAgVkhUT3BlcmF0aW9uOworICAgIE9QVElFICBWSFRFeHRCc3NMb2FkOworICAgIE9QVElFICBFeHRDYXA7CisgICAgT1BUSUUgIE9wZXJhdGluZ01vZGU7CisgICAgT1BUSUUgIFdpZGVyQldDaGFuU3dpdGNoQW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ICAgIE9QVElFICBQMlBCZWFjb25Qcm9iZVJlczsKKyAgICBPUFRJRSAgVkhUQ2FwczsKKyAgICBPUFRJRSAgVkhUT3BlcmF0aW9uOworICAgIE9QVElFICBWSFRFeHRCc3NMb2FkOworICAgIE9QVElFICBFeHRDYXA7CisgICAgT1BUSUUgIE9wZXJhdGluZ01vZGU7CisgICAgT1BUSUUgIFdpZGVyQldDaGFuU3dpdGNoQW5uOworICAgIE9QVElFICBPQlNTU2NhblBhcmFtZXRlcnM7CisKK30gLy8gRW5kIGZyYW1lIEJlYWNvbklFcy4KKworRlJBTUUgRGlzYXNzb2NpYXRpb24gICAgICAgICAgICAgICAgICAgICAgLy8gNy4zLjMuMworeworICAgIEZGICAgIFJlYXNvbjsKKyAgICBPUFRJRSBQMlBEaXNBc3NvYzsKK30KKworRlJBTUUgQXNzb2NSZXF1ZXN0ICAgICAgICAgICAgICAgICAgICAgICAgLy8gNy4yLjMuNAoreworICAgIEZGICAgICBDYXBhYmlsaXRpZXM7CisgICAgRkYgICAgIExpc3RlbkludGVydmFsOworICAgIE1BTkRJRSBTU0lEOworICAgIE1BTkRJRSBTdXBwUmF0ZXM7CisgICAgT1BUSUUgIEV4dFN1cHBSYXRlczsKKyAgICBPUFRJRSAgUG93ZXJDYXBzOworICAgIE9QVElFICBTdXBwQ2hhbm5lbHM7CisgICAgT1BUSUUgIFJTTk9wYXF1ZTsKKyAgICBPUFRJRSAgUU9TQ2Fwc1N0YXRpb247CisgICAgT1BUSUUgIFJSTUVuYWJsZWRDYXA7CisgICAgT1BUSUUgIE1vYmlsaXR5RG9tYWluOworICAgIE9QVElFICBXUEFPcGFxdWU7CisgICAgT1BUSUUgIEhUQ2FwczsKKyAgICBPUFRJRSAgV01NQ2FwczsKKyAgICBPUFRJRSAgV01NSW5mb1N0YXRpb247CisgICAgT1BUSUUgIEFpcmdvOworICAgIE9QVElFICBXc2NJRU9wYXF1ZTsKKyAgICBPUFRJRSAgV0FQSU9wYXF1ZTsKKyAgICBPUFRJRSAgRVNFUmFkTWdtdENhcDsKKyAgICBPUFRJRSAgRVNFVmVyc2lvbjsKKyAgICBPUFRJRSAgUDJQSUVPcGFxdWU7CisgICAgT1BUSUUgIFdGRElFT3BhcXVlOworICAgIE9QVElFICBWSFRDYXBzOworICAgIE9QVElFICBFeHRDYXA7CisgICAgT1BUSUUgIE9wZXJhdGluZ01vZGU7CisgICAgT1BUSUUgIFFvc01hcFNldDsKK30gLy8gRW5kIGZyYW1lIEFzc29jUmVxdWVzdC4KKworRlJBTUUgQXNzb2NSZXNwb25zZSAgICAgICAgICAgICAgICAgICAgICAgLy8gNy4yLjMuNQoreworICAgIEZGICAgICBDYXBhYmlsaXRpZXM7CisgICAgRkYgICAgIFN0YXR1czsKKyAgICBGRiAgICAgQUlEOworICAgIE1BTkRJRSBTdXBwUmF0ZXM7CisgICAgT1BUSUUgIEV4dFN1cHBSYXRlczsKKyAgICBPUFRJRSAgRURDQVBhcmFtU2V0OworICAgIE9QVElFICBSQ1BJSUU7CisgICAgT1BUSUUgIFJTTklJRTsKKyAgICBPUFRJRSAgUlJNRW5hYmxlZENhcDsKKyAgICBPUFRJRSAgTW9iaWxpdHlEb21haW47CisgICAgT1BUSUUgIEZUSW5mbzsKKyAgICBPUFRJRSAgUklDRGF0YURlc2NbMl07CisgICAgT1BUSUUgIFdQQTsKKyAgICBPUFRJRSAgVGltZW91dEludGVydmFsOworICAgIE9QVElFICBIVENhcHM7CisgICAgT1BUSUUgIEhUSW5mbzsKKyAgICBPUFRJRSAgV01NUGFyYW1zOworICAgIE9QVElFICBXTU1DYXBzOworICAgIE9QVElFICBFU0VSYWRNZ210Q2FwOworICAgIE9QVElFICBFU0VUcmFmU3RybU1ldDsKKyAgICBPUFRJRSAgRVNFVHhtaXRQb3dlcjsKKyAgICBPUFRJRSAgV01NVFNQRUNbMC4uNF07CisgICAgT1BUSUUgIEFpcmdvOworICAgIE9QVElFICBXc2NBc3NvY1JlczsKKyAgICBPUFRJRSAgUDJQQXNzb2NSZXM7CisgICAgT1BUSUUgIFZIVENhcHM7CisgICAgT1BUSUUgIFZIVE9wZXJhdGlvbjsKKyAgICBPUFRJRSAgRXh0Q2FwOworICAgIE9QVElFICBPQlNTU2NhblBhcmFtZXRlcnM7CisgICAgT1BUSUUgIFFvc01hcFNldDsKK30gLy8gRW5kIGZyYW1lIEFzc29jUmVzcG9uc2UuCisKK0ZSQU1FIFJlQXNzb2NSZXF1ZXN0ICAgICAgICAgICAgICAgICAgICAgIC8vIDcuMi4zLjYKK3sKKyAgICBGRiAgICAgQ2FwYWJpbGl0aWVzOworICAgIEZGICAgICBMaXN0ZW5JbnRlcnZhbDsKKyAgICBGRiAgICAgQ3VycmVudEFQQWRkcmVzczsKKyAgICBNQU5ESUUgU1NJRDsKKyAgICBNQU5ESUUgU3VwcFJhdGVzOworICAgIE9QVElFICBFeHRTdXBwUmF0ZXM7CisgICAgT1BUSUUgIFBvd2VyQ2FwczsKKyAgICBPUFRJRSAgU3VwcENoYW5uZWxzOworICAgIE9QVElFICBSU05PcGFxdWU7CisgICAgT1BUSUUgIFFPU0NhcHNTdGF0aW9uOworICAgIE9QVElFICBSUk1FbmFibGVkQ2FwOworICAgIE9QVElFICBNb2JpbGl0eURvbWFpbjsKKyAgICBPUFRJRSAgRlRJbmZvOworICAgIE9QVElFICBSSUNEYXRhRGVzY1syXTsKKyAgICBPUFRJRSAgV1BBT3BhcXVlOworICAgIE9QVElFICBIVENhcHM7CisgICAgT1BUSUUgIFdNTUNhcHM7CisgICAgT1BUSUUgIFdNTUluZm9TdGF0aW9uOworICAgIE9QVElFICBBaXJnbzsKKyAgICBPUFRJRSAgV3NjSUVPcGFxdWU7CisgICAgT1BUSUUgIFdBUElPcGFxdWU7CisgICAgT1BUSUUgIEVTRVJhZE1nbXRDYXA7CisgICAgT1BUSUUgIEVTRVZlcnNpb247CisgICAgT1BUSUUgIEVTRUNja21PcGFxdWU7CisgICAgT1BUSUUgIFdNTVRTUEVDWzAuLjRdOworICAgIE9QVElFICBFU0VUcmFmU3RybVJhdGVTZXQ7CisgICAgT1BUSUUgIFAyUElFT3BhcXVlOworICAgIE9QVElFICBXRkRJRU9wYXF1ZTsKKyAgICBPUFRJRSAgVkhUQ2FwczsKKyAgICBPUFRJRSAgRXh0Q2FwOworICAgIE9QVElFICBPcGVyYXRpbmdNb2RlOworICAgIE9QVElFICBRb3NNYXBTZXQ7Cit9IC8vIEVuZCBmcmFtZSBSZUFzc29jUmVxdWVzdC4KKworRlJBTUUgUmVBc3NvY1Jlc3BvbnNlICAgICAgICAgICAgICAgICAgICAgLy8gNy4yLjMuNworeworICAgIEZGICAgICBDYXBhYmlsaXRpZXM7CisgICAgRkYgICAgIFN0YXR1czsKKyAgICBGRiAgICAgQUlEOworICAgIE1BTkRJRSBTdXBwUmF0ZXM7CisgICAgT1BUSUUgIEV4dFN1cHBSYXRlczsKKyAgICBPUFRJRSAgRURDQVBhcmFtU2V0OworICAgIE9QVElFICBSQ1BJSUU7CisgICAgT1BUSUUgIFJTTklJRTsKKyAgICBPUFRJRSAgUlJNRW5hYmxlZENhcDsKKyAgICBPUFRJRSAgUlNOT3BhcXVlOworICAgIE9QVElFICBNb2JpbGl0eURvbWFpbjsKKyAgICBPUFRJRSAgRlRJbmZvOworICAgIE9QVElFICBSSUNEYXRhRGVzY1syXTsKKyAgICBPUFRJRSAgV1BBOworICAgIE9QVElFICBUaW1lb3V0SW50ZXJ2YWw7CisgICAgT1BUSUUgIEhUQ2FwczsKKyAgICBPUFRJRSAgSFRJbmZvOworICAgIE9QVElFICBXTU1QYXJhbXM7CisgICAgT1BUSUUgIEVTRVJhZE1nbXRDYXA7CisgICAgT1BUSUUgIEVTRVRyYWZTdHJtTWV0OworICAgIE9QVElFICBFU0VUeG1pdFBvd2VyOworICAgIE9QVElFICBXTU1UU1BFQ1swLi40XTsKKyAgICBPUFRJRSAgRVNFVHJhZlN0cm1SYXRlU2V0OworICAgIE9QVElFICBBaXJnbzsKKyAgICBPUFRJRSAgV3N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GF0dFRhYmxlOworICAgIE9QVElFICBQb3dlckNvbnN0cmFpbnRzOworICAgIE9QVElFICBDaGFuU3dpdGNoQW5uOworICAgIE9QVElFICBRdWlldDsKKyAgICBPUFRJRSAgVFBDUmVwb3J0OworICAgIE9QVElFICBFUlBJbmZvOworICAgIE9QVElFICBFeHRTdXBwUmF0ZXM7CisgICAgT1BUSUUgIFJTTk9wYXF1ZTsKKyAgICBPUFRJRSAgUUJTU0xvYWQ7CisgICAgT1BUSUUgIEVEQ0FQYXJhbVNldDsKKyAgICBPUFRJRSAgUlJNRW5hYmxlZENhcDsKKyAgICBPUFRJRSAgQVBDaGFubmVsUmVwb3J0OworICAgIE9QVElFICBNb2JpbGl0eURvbWFpbjsKKyAgICBPUFRJRSAgV1BBOworICAgIE9QVElFICBIVENhcHM7CisgICAgT1BUSUUgIEhUSW5mbzsKKyAgICBPUFRJRSAgRXh0Q2hhblN3aXRjaEFubjsKKyAgICBPUFRJRSAgV01NSW5mb0FwOworICAgIE9QVElFICBXTU1QYXJhbXM7CisgICAgT1BUSUUgIFdNTUNhcHM7CisgICAgT1BUSUUgIFdBUEk7CisgICAgT1BUSUUgIEVTRVJhZE1nbXRDYXA7CisgICAgT1BUSUUgIEVTRVRyYWZTdHJtTWV0OworICAgIE9QVElFICBFU0VUeG1pdFBvd2VyOworCisgICAgT1BUSUUgIEFpcmdvOworICAgIE9QVElFICBXc2NQcm9iZVJlczsKKyAgICBPUFRJRSAgUDJQUHJvYmVSZXM7CisKKyAgICBPUFRJRSAgVkhUQ2FwczsKKyAgICBPUFRJRSAgVkhUT3BlcmF0aW9uOworICAgIE9QVElFICBWSFRFeHRCc3NMb2FkOworICAgIE9QVElFICBFeHRDYXA7CisgICAgT1BUSUUgIE9CU1NTY2FuUGFyYW1ldGVyczsKK30gLy8gRW5kIGZyYW1lIFByb2JlUmVzcG9uc2UuCisKK0ZSQU1FIEF1dGhlbnRpY2F0aW9uICAgICAgICAgICAgICAgICAgICAgIC8vIDcuMi4zLjEwCit7CisgICAgRkYgICAgQXV0aEFsZ287CisgICAgRkYgICAgQXV0aFNlcU5vOworICAgIEZGICAgIFN0YXR1czsKKyAgICBPUFRJRSBDaGFsbGVuZ2VUZXh0OworICAgIE9QVElFICBSU05PcGFxdWU7CisgICAgT1BUSUUgIE1vYmlsaXR5RG9tYWluOworICAgIE9QVElFICBGVEluZm87CisgICAgT1BUSUUgIFRpbWVvdXRJbnRlcnZhbDsKKyAgICBPUFRJRSAgUklDRGF0YURlc2NbMl07Cit9IC8vIEVuZCBmcmFtZSBBdXRoLgorCitGUkFNRSBEZUF1dGggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyA3LjIuMy4xMQoreworICAgIEZGICAgIFJlYXNvbjsKKyAgICBPUFRJRSBQMlBEZUF1dGg7Cit9CisKK0ZSQU1FIEFkZFRTUmVxdWVzdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIDcuNC4yLjEKK3sKKworICAgIEZGICAgICBDYXRlZ29yeTsKKyAgICBGRiAgICAgQWN0aW9uOworICAgIEZGICAgICBEaWFsb2dUb2tlbjsKKyAgICBNQU5ESUUgVFNQRUM7CisgICAgT1BUSUUgIFRDTEFTWzAuLjJdOworICAgIE9QVElFICBUQ0xBU1NQUk9DOworCisgICAgLy8gVGhlc2UgSUVzIGFyZW4ndCBpbiB0aGUgc3BlYywgYnV0IG91ciBleHRhbnQgY29kZSAqd2lsbCogcGFyc2UgdGhlbSBpZgorICAgIC8vIHRoZXkncmUgcHJlc2VudC4gIEkgaW5jbHVkZWQgdGhlbSB0byBwcmVzZXJ2ZSB0aGF0IGNhcGFiaWxpdHkKKworICAgIE9QVElFICBXTU1UU1BFQzsKKyAgICBPUFRJRSAgV01NVENMQVNbMC4uMl07CisgICAgT1BUSUUgIFdNTVRDTEFTUFJPQzsKKyAgICBPUFRJRSAgRVNFVHJhZlN0cm1SYXRlU2V0OworCit9IC8vIEVuZCBmcmFtZSBBZGRUU1JlcXVlc3QuCisKK0ZSQU1FIFd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gICBDYXRlZ29yeTsKKyAgICBGRiAgICAgQWN0aW9uOworICAgIEZGICAgICBEaWFsb2dUb2tlbjsKKyAgICBGRiAgICAgU3RhdHVzQ29kZTsKKyAgICBPUFRJRSAgV01NVFNQRUM7CisgICAgT1BUSUUgIEVTRVRyYWZTdHJtTWV0OworCit9IC8vIEVuZCBmcmFtZSBXTU1BZGRUU1Jlc3BvbnNlLgorCitGUkFNRSBEZWxUUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyA3LjQuMi4zCit7CisgICAgRkYgICAgIENhdGVnb3J5OworICAgIEZGICAgICBBY3Rpb247CisgICAgRkYgICAgIFRTSW5mbzsKKyAgICBGRiAgICAgUmVhc29uOworfQorCitGUkFNRSBXTU1EZWxUUworeworICAgIEZGICAgICBDYXRlZ29yeTsKKyAgICBGRiAgICAgQWN0aW9uOworICAgIEZGICAgICBEaWFsb2dUb2tlbjsKKyAgICBGRiAgICAgU3RhdHVzQ29kZTsKKyAgICBNQU5ESUUgV01NVFNQRUM7Cit9CisKK0ZSQU1FIFRQQ1JlcXVlc3QKK3sKKyAgICBGRiAgICAgQ2F0ZWdvcnk7CisgICAgRkYgICAgIEFjdGlvbjsKKyAgICBGRiAgICAgRGlhbG9nVG9rZW47CisgICAgTUFORElFIFRQQ1JlcXVlc3Q7Cit9CisKK0ZSQU1FIFRQQ1JlcG9ydAoreworICAgIEZGICAgICBDYXRlZ29yeTsKKyAgICBGRiAgICAgQWN0aW9uOworICAgIEZGICAgICBEaWFsb2dUb2tlbjsKKyAgICBNQU5ESUUgVFBDUmVwb3J0OworfQorCitGUkFNRSBDaGFubmVsU3dpdGNoCit7CisgICAgRkYgICAgIENhdGVnb3J5OworICAgIEZGICAgICBBY3Rpb247CisgICAgTUFORElFIENoYW5Td2l0Y2hBbm47CisgICAgT1BUSUUgIEV4dENoYW5Td2l0Y2hBbm47CisgICAgT1BUSUUgIFdpZGVyQldDaGFuU3dpdGNoQW5uOworfQorCitGUkFNRSBNZWFzdXJlbWVudFJlcXVlc3QKK3sKKyAgICBGRiAgICAgQ2F0ZWdvcnk7CisgICAgRkYgICAgIEFjdGlvbjsKKyAgICBGRiAgICAgRGlhbG9nVG9rZW47CisgICAgTUFORElFIE1lYXN1cmVtZW50UmVxdWVzdFsxLi40XTsKK30KKworRlJBTUUgTWVhc3VyZW1lbnRSZXBvcnQKK3sKKyAgICBGRiAgICAgQ2F0ZWdvcnk7CisgICAgRkYgICAgIEFjdGlvbjsKKyAgICBGRiAgICAgRGlhbG9nVG9rZW47CisgICAgTUFORElFIE1lYXN1cmVtZW50UmVwb3J0OworfQorCitGUkFNRSBBZGRCQVJlcQoreworICAgIEZGICAgIENhdGVnb3J5OworICAgIEZGICAgIEFjdGlvbjsKKyAgICBGRiAgICBEaWFsb2dUb2tlbjsKKyAgICBGRiAgICBBZGRCQVBhcmFtZXRlclNldDsKKyAgICBGRiAgICBCQVRpbWVvdXQ7CisgICAgRkYgICAgQkFTdGFydGluZ1NlcXVlbmNlQ29udHJvbDsKK30KKworRlJBTUUgQWRkQkFSc3AKK3sKKyAgICBGRiAgICBDYXRlZ29yeTsKKyAgICBGRiAgICBBY3Rpb247CisgICAgRkYgICAgRGlhbG9nVG9rZW47CisgICAgRkYgICAgU3RhdHVzOworICAgIEZGICAgIEFkZEJBUGFyYW1ldGVyU2V0OworICAgIEZGICAgIEJBVGltZW91dDsKK30KKworRlJBTUUgRGVsQkFJbmQKK3sKKyAgICBGRiAgICBDYXRlZ29yeTsKKyAgICBGRiAgICBBY3Rpb247CisgICAgRkYgICAgRGVsQkFQYXJhbWV0ZXJTZXQ7CisgICAgRkYgICAgUmVhc29uOworfQorCitGUkFNRSBTTVBvd2VyU2F2ZQoreworICAgIEZGICAgIENhdGVnb3J5OworICAgIEZGICAgIEFjdGlvbjsKKyAgICBGRiAgICBTTVBvd2VyTW9kZVNldDsKK30KKworRlJBTUUgUmFkaW9NZWFzdXJlbWVudFJlcXVlc3QKK3sKKyAgIEZGICAgIENhdGVnb3J5OworICAgRkYgICAgQWN0aW9uOworICAgRkYgICAgRGlhbG9nVG9rZW47CisgICBGRiAgICBOdW1PZlJlcGV0aXRpb25zOworICAgLy9NZWFzdXJlbWVudCBSZXF1ZXN0IElFLgorICAgTUFORElFIE1lYXN1cmVtZW50UmVxdWVzdFsxLi4yXTsKK30KKworRlJBTUUgUmFkaW9NZWFzdXJlbWVudFJlcG9ydAoreworICAgRkYgICBDYXRlZ29yeTsKKyAgIEZGICAgQWN0aW9uOworICAgRkYgICBEaWFsb2dUb2tlbjsKKyAgIC8vTWVhc3VyZW1lbnQgUmVwb3J0IGVsZW1lbnRzLgorICAgTUFORElFIE1lYXN1cmVtZW50UmVwb3J0WzEuLjRdOworfQorCitGUkFNRSBMaW5rTWVhc3VyZW1lbnRSZXF1ZXN0Cit7CisgICBGRiAgIENhdGVnb3J5OworICAgRkYgICBBY3Rpb247CisgICBGRiAgIERpYWxvZ1Rva2VuOworICAgRkYgICBUeFBvd2VyOworICAgRkYgICBNYXhUeFBvd2VyOworICAgLy9PcHRpb25hbCBTdWIgSWVzCit9CisKK0ZSQU1FIExpbmtNZWFzdXJlbWVudFJlcG9ydAoreworICAgRkYgICBDYXRlZ29yeTsKKyAgIEZGICAgQWN0aW9uOworICAgRkYgICBEaWFsb2dUb2tlbjsKKyAgIEZGICAgVFBDRWxlSUQ7CisgICBGRiAgIFRQQ0VsZUxlbjsKKyAgIEZGICAgVHhQb3dlcjsKKyAgIEZGICAgTGlua01hcmdpbjsKKyAgIEZGICAgUnhBbnRlbm5hSWQ7CisgICBGRiAgIFR4QW50ZW5uYUlkOworICAgRkYgICBSQ1BJOworICAgRkYgICBSU05JOworICAgLy9PcHRpb25hbCBWZW5kb3Igc3BlY2lmaWMgSUVzIC4uLiBpZ25vcmluZworfQorCitGUkFNRSBOZWlnaGJvclJlcG9ydFJlcXVlc3QKK3sKKyAgIEZGICAgICBDYXRlZ29yeTsKKyAgIEZGICAgICBBY3Rpb247CisgICBGRiAgICAgRGlhbG9nVG9rZW47CisgICBPUFRJRSAgU1NJRDsKKyAgIC8vT3B0aW9uYWwgdmVuZG9yIHNwZWNpZmljIElFLi4uaWdub3JpbmcuCit9CisKK0ZSQU1FIE5laWdoYm9yUmVwb3J0UmVzcG9uc2UKK3sKKyAgIEZGICAgICBDYXRlZ29yeTsKKyAgIEZGICAgICBBY3Rpb247CisgICBGRiAgICAgRGlhbG9nVG9rZW47CisgICBPUFRJRSAgTmVpZ2hib3JSZXBvcnRbMS4uNF07Cit9CisKK0ZSQU1FIEdPTmVnUmVxCit7CisgICBGRiAgICAgIENhdGVnb3J5OworICAgRkYgICAgICBBY3Rpb247CisgICBGRiAgICAgIFAyUE9VSTsKKyAgIEZGICAgICAgUDJQT1VJU3ViVHlwZTsKKyAgIEZGICAgICAgRGlhbG9nVG9rZW47CisgICBNQU5ESUUgIFAyUEdPTmVnV1BTOworICAgTUFORElFICBQMlBHT05lZ1JlcTsKK30KKworRlJBTUUgR09OZWdSZXMKK3sKKyAgIEZGICAgICAgQ2F0ZWdvcnk7CisgICBGRiAgICAgIEFjdGlvbjsKKyAgIEZGICAgICAgUDJQT1VJOworICAgRkYgICAgICBQMlBPVUlTdWJUeXBlOworICAgRkYgICAgICBEaWFsb2dUb2tlbjsKKyAgIE1BTkRJRSAgUDJQR09OZWdXUFM7CisgICBNQU5ESUUgIFAyUEdPTmVnUmVzOworfQorCisKK0ZSQU1FIEdPTmVnQ25mCit7CisgICBGRiAgICAgIENhdGVnb3J5OworICAgRkYgICAgICBBY3Rpb247CisgICBGRiAgICAgIFAyUE9VSTsKKyAgIEZGICAgICAgUDJQT1VJU3ViVHlwZTsKKyAgIEZGICAgICAgRGlhbG9nVG9rZW47CisgICBNQU5ESUUgIFAyUEdPTmVnQ25mOworfQorCisKK0ZSQU1FIEludml0YXRpb25SZXEKK3sKKyAgIEZGICAgICAgQ2F0ZWdvcnk7CisgICBGRiAgICAgIEFjdGlvbjsKKyAgIEZGICAgICAgUDJQT1VJOworICAgRkYgICAgICBQMlBPVUlTdWJUeXBlOworICAgRkYgICAgICBEaWFsb2dUb2tlbjsKKyAgIE1BTkRJRSAgUDJQSW52aXRhdGlvblJlcTsKK30KKworCitGUkFNRSBJbnZpdGF0aW9uUmVzCit7CisgICBGRiAgICAgIENhdGVnb3J5OworICAgRkYgICAgICBBY3Rpb247CisgICBGRiAgICAgIFAyUE9VSTsKKyAgIEZGICAgICAgUDJQT1VJU3ViVHlwZTsKKyAgIEZGICAgICAgRGlhbG9nVG9rZW47CisgICBNQU5ESUUgIFAyUEludml0YXRpb25SZXM7Cit9CisKKworRlJBTUUgRGV2aWNlRGlzY292ZXJhYmlsaXR5UmVxCit7CisgICBGRiAgICAgIENhdGVnb3J5OworICAgRkYgICAgICBBY3Rpb247CisgICBGRiAgICAgIFAyUE9VSTsKKyAgIEZGICAgICAgUDJQT1VJU3ViVHlwZTsKKyAgIEZGICAgICAgRGlhbG9nVG9rZW47CisgICBNQU5ESUUgIFAyUERldmljZURpc2NvdmVyYWJpbGl0eVJlcTsKK30KKworCitGUkFNRSBEZXZpY2VEaXNjb3ZlcmFiaWxpdHlSZXMKK3sKKyAgIEZGICAgICAgQ2F0ZWdvcnk7CisgICBGRiAgICAgIEFjdGlvbjsKKyAgIEZGICAgICAgUDJQT1VJOworICAgRkYgICAgICBQMlBPVUlTdWJUeXBlOworICAgRkYgICAgICBEaWFsb2dUb2tlbjsKKyAgIE1BTkRJRSAgUDJQRGV2aWNlRGlzY292ZXJhYmlsaXR5UmVzOworfQorCisKKworRlJBTUUgUHJvdmlzaW9uRGlzY292ZXJ5UmVxCit7CisgICBGRiAgICAgIENhdGVnb3J5OworICAgRkYgICAgICBBY3Rpb247CisgICBGRiAgICAgIFAyUE9VSTsKKyAgIEZGICAgICAgUDJQT1VJU3ViVHlwZTsKKyAgIEZGICAgICAgRGlhbG9nVG9rZW47CisgICBNQU5ESUUgIFAyUFByb3Zpc2lvbkRpc2NvdmVyeVJlcTsKK30KKworCitGUkFNRSBQcm92aXNpb25EaXNjb3ZlcnlSZXMKK3sKKyAgIEZGICAgICAgQ2F0ZWdvcnk7CisgICBGRiAgICAgIEFjdGlvbjsKKyAgIEZGICAgICAgUDJQT1VJOworICAgRkYgICAgICBQMlBPVUlTdWJUeXBlOworICAgRkYgICAgICBEaWFsb2dUb2tlbjsKKyAgIE1BTkRJRSAgUDJQV1NDUHJvdmlzaW9uRGlzY292ZXJ5UmVzOworfQorCisKK0ZSQU1FIE5vdGljZU9mQWJzCit7CisgICBGRiAgICAgIENhdGVnb3J5OworICAgRkYgICAgICBQMlBPVUk7CisgICBGRiAgICAgIFAyUE9VSVN1YlR5cGU7CisgICBGRiAgICAgIERpYWxvZ1Rva2VuOworICAgTUFORElFICBQMlBOb3RpY2VPZkFic2VuY2U7Cit9CisKKworRlJBTUUgUHJlc2VuY2VSZXEKK3sKKyAgIEZGICAgICAgQ2F0ZWdvcnk7CisgICBGRiAgICAgIFAyUE9VSTsKKyAgIEZGICAgICAgUDJQT1VJU3ViVHlwZTsKKyAgIEZGICAgICAgRGlhbG9nVG9rZW47CisgICBNQU5ESUUgIFAyUE5vdGljZU9mQWJzZW5jZTsKK30KKworCitGUkFNRSBQcmVzZW5jZVJlcworeworICAgRkYgICAgICBDYXRlZ29yeTsKKyAgIEZGICAgICAgUDJQT1VJOworICAgRkYgICAgICBQMlBPVUlTdWJUeXBlOworICAgRkYgICAgICBEaWFsb2dUb2tlbjsKKyAgIE1BTkRJRSAgUDJQUHJlc2VuY2VSZXNwb25zZTsKK30KKworCitGUkFNRSBHT0Rpc2NvdmVyYWJpbGl0eVJlcQoreworICAgRkYgICAgICBDYXRlZ29yeTsKKyAgIEZGICAgICAgUDJQT1VJOworICAgRkYgICAgICBQMlBPVUlTdWJUeXBlOworICAgRkYgICAgICBEaWFsb2dUb2tlbjsKK30KKworRlJBTUUgT3BlcmF0aW5nTW9kZQoreworICAgIEZGICAgICAgICBDYXRlZ29yeTsKKyAgICBGRiAgICAgICAgQWN0aW9uOworICAgIC8vT3BlcmF0aW5nIE1vZGUgZmllbGQKKyAgICBGRiAgICAgICAgT3BlcmF0aW5nTW9kZTsKK30KKworRlJBTUUgVERMU0Rpc1JlcQoreworICAgIEZGICAgICBDYXRlZ29yeTsKKyAgICBGRiAgICAgQWN0aW9uOworICAgIEZGICAgICBEaWFsb2dUb2tlbjsKKyAgICBNQU5ESUUgTGlua0lkZW50aWZpZXI7Cit9CisKK0ZSQU1FIFRETFNEaXNSc3AKK3sKKyAgICBGRiAgICAgQ2F0ZWdvcnk7CisgICAgRkYgICAgIEFjdGlvbjsKKyAgICBGRiAgICAgRGlhbG9nVG9rZW47CisgICAgRkYgICAgIENhcGFiaWxpdGllczsKKyAgICBNQU5ESUUgU3VwcFJhdGVzOworICAgIE9QVElFICBFeHRTdXBwUmF0ZXM7CisgICAgT1BUSUUgIFN1cHBDaGFubmVsczsKKyAgICBPUFRJRSAgU3VwcE9wZXJhdGluZ0NsYXNzZXM7CisgICAgT1BUSUUgIFJTTjsKKyAgICBPUFRJRSAgRXh0Q2FwOworICAgIE9QVElFICBGVEluZm87CisgICAgT1BUSUUgIFRpbWVvdXRJbnRlcnZhbDsKKyAgICBPUFRJRSAgUklDRGF0YTsKKyAgICBPUFRJRSAgSFRDYXBzOworICAgIE9QVElFICBIVDIwNDBCU1NDb2V4aXN0ZW5jZTsKKyAgICBNQU5ESUUgTGlua0lkZW50aWZpZXI7CisgICAgT1BUSUUgIFZIVENhcHM7Cit9CisKK0ZSQU1FIFRETFNTZXR1cFJlcQoreworICAgIEZGICAgICBDYXRlZ29yeTsKKyAgICBGRiAgICAgQWN0aW9uOworICAgIEZGICAgICBEaWFsb2dUb2tlbjsKKyAgICBGRiAgICAgQ2FwYWJpbGl0aWVzOworICAgIE1BTkRJRSBTdXBwUmF0ZXM7CisgICAgT1BUSUUgIENvdW50cnk7CisgICAgT1BUSUUgIEV4dFN1cHBSYXRlczsKKyAgICBPUFRJRSAgU3VwcENoYW5uZWxzOworICAgIE9QVElFICBSU047CisgICAgT1BUSUUgIEV4dENhcDsKKyAgICBPUFRJRSAgU3VwcE9wZXJhdGluZ0NsYXNzZXM7CisgICAgT1BUSUUgIFFPU0NhcHNTdGF0aW9uOworICAgIE9QVElFICBGVEluZm87CisgICAgT1BUSUUgIFRpbWVvdXRJbnRlcnZhbDsKKyAgICBPUFRJRSAgUklDRGF0YTsKKyAgICBPUFRJRSAgSFRDYXBzOworICAgIE9QVElFICBIVDIwNDBCU1NDb2V4aXN0ZW5jZTsKKyAgICBNQU5ESUUgTGlua0lkZW50aWZpZXI7CisgICAgT1BUSUUgIFdNTUluZm9TdGF0aW9uOworICAgIE9QVElFICBBSUQ7CisgICAgT1BUSUUgIFZIVENhcHM7Cit9CisKK0ZSQU1FIFRETFNTZXR1cFJzcAoreworICAgIEZGICAgICBDYXRlZ29yeTsKKyAgICBGRiAgICAgQWN0aW9uOworICAgIEZGICAgICBTdGF0dXM7CisgICAgRkYgICAgIERpYWxvZ1Rva2VuOworICAgIEZGICAgICBDYXBhYmlsaXRpZXMgOworICAgIE9QVElFICBTdXBwUmF0ZXM7CisgICAgT1BUSUUgIENvdW50cnk7CisgICAgT1BUSUUgIEV4dFN1cHBSYXRlczsKKyAgICBPUFRJRSAgU3VwcENoYW5uZWxzOworICAgIE9QVElFICBSU047CisgICAgT1BUSUUgIEV4dENhcDsKKyAgICBPUFRJRSAgU3VwcE9wZXJhdGluZ0NsYXNzZXM7CisgICAgT1BUSUUgIFFPU0NhcHNTdGF0aW9uOworICAgIE9QVElFICBGVEluZm87CisgICAgT1BUSUUgIFRpbWVvdXRJbnRlcnZhbDsKKyAgICBPUFRJRSAgUklDRGF0YTsKKyAgICBPUFRJRSAgSFRDYXBzOworICAgIE9QVElFICBIVDIwNDBCU1NDb2V4aXN0ZW5jZTsKKyAgICBPUFRJRSAgTGlua0lkZW50aWZpZXI7CisgICAgT1BUSUUgIFdNTUluZm9TdGF0aW9uOworICAgIE9QVElFICBBSUQ7CisgICAgT1BUSUUgIFZIVENhcHM7CisgICAgT1BUSUUgIE9wZXJhdGluZ01vZGU7Cit9CisKK0ZSQU1FIFRETFNTZXR1cENuZgoreworICAgIEZGICAgICBDYXRlZ29yeTsKKyAgICBGRiAgICAgQWN0aW9uOworICAgIEZGICAgICBTdGF0dXM7CisgICAgRkYgICAgIERpYWxvZ1Rva2VuOworICAgIE9QVElFICBSU047CisgICAgT1BUSUUgIEVEQ0FQYXJhbVNldDsKKyAgICBPUFRJRSAgRlRJbmZvOworICAgIE9QVElFICBUaW1lb3V0SW50ZXJ2YWw7CisgICAgT1BUSUUgIEhUSW5mbzsKKyAgICBPUFRJRSAgSFQyMDQwQlNTQ29leGlzdGVuY2U7CisgICAgT1BUSUUgIExpbmtJZGVudGlmaWVyOworICAgIE9QVElFICBXTU1QYXJhbXM7CisgICAgT1BUSUUgIFZIVE9wZXJhdGlvbjsKKyAgICBPUFRJRSAgT3BlcmF0aW5nTW9kZTsKK30KK0ZSQU1FIFRETFNUZWFyZG93bgoreworICAgIEZGICAgICBDYXRlZ29yeTsKKyAgICBGRiAgICAgQWN0aW9uOworICAgIEZGICAgICBSZWFzb247CisgICAgT1BUSUUgIEZUSW5mbzsKKyAgICBNQU5ESUUgTGlua0lkZW50aWZpZXI7Cit9CisKK0ZSQU1FIFRETFNQZWVyVHJhZmZpY0luZAoreworICAgIEZGICAgICBDYXRlZ29yeTsKKyAgICBGRiAgICAgQWN0aW9uOworICAgIEZGICAgICBEaWFsb2dUb2tlbjsKKyAgICBNQU5ESUUgTGlua0lkZW50aWZpZXI7CisgICAgT1BUSUUgIFBUSUNvbnRyb2w7CisgICAgTUFORElFIFBVQnVmZmVyU3RhdHVzOworfQorCitGUkFNRSBURExTUGVlclRyYWZmaWNSc3AKK3sKKyAgICBGRiAgICAgQ2F0ZWdvcnk7CisgICAgRkYgICAgIEFjdGlvbjsKKyAgICBGRiAgICAgRGlhbG9nVG9rZW47CisgICAgTUFORElFIExpbmtJZGVudGlmaWVyOworfQorCitGUkFNRSBTYVF1ZXJ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UgX19wb2xGaWxlX2hfXworCisKKworICAgCisvLyBGaWxlIGZvcm1hdAorLy8KKy8vICBieXRlIDAgICAgICAgIDEgICAgICAgIDIgICAgICAgMworLy8KKy8vICstLS0tLS0tLS0rLS0tLS0tLS0tKy0tLS0tLS0tKy0tLS0tLS0rICAgICAgICAgICAgICAgICAgICAgICAgPC0tLS0rCisvLyB8IE1ham9yICAgfCBNaW5vciAgIHwgICAgICAgIHwgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorLy8gfCBWZXJzaW9uIHwgVmVyc2lvbiB8IFN1ZmZpeCB8IEJ1aWxkIHwgICBGaWxlVmVyc2lvbiAgICAgICAgICAgICAgIHwKKy8vICstLS0tLS0tLS0rLS0tLS0tLS0tKy0tLS0tLS0tKy0tLS0tLS0rICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8CisvLyB8IE1ham9yICAgfCBNaW5vciAgIHwgICAgICAgIHwgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorLy8gfCBWZXJzaW9uIHwgVmVyc2lvbiB8IFN1ZmZpeCB8IEJ1aWxkIHwgICBId0NhcGFiaWxpdGllcyAgICAgICAgICAgIHwgdFBvbEZpbGVIZWFkZXIKKy8vICstLS0tLS0tLS0rLS0tLS0tLS0tKy0tLS0tLS0tKy0tLS0tLS0rICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8CisvLyB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorLy8gfCBGaWxlTGVuZ3RoICAgICAgICAgICAgICAgICAgICAgICAgIHwgICBGaWxlTGVuZ3RoICAgICAgICAgICAgICAgIHwKKy8vICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8CisvLyB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorLy8gfCBOdW1iZXIgb2YgRGlyZWN0b3J5IEVudHJpZXMgICAgICAgIHwgICBOdW1EaXJlY3RvcnlFbnRyaWVzICAgICAgIHwKKy8vICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rICAgICAgICAgICAgICAgICAgICAgICAgPC0tLS0rCisvLyB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorLy8gfCBEaXJlY3RvcnkgRW50cnkgMSBUeXBlICAgICAgICAgICAgIHwgICBEaXJFbnRyeVR5cGUgICAgICAgICAgICAgIHwKKy8vICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8CisvLyB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCB0UG9sRmlsZURpckVudHJ5IDEKKy8vIHwgRGlyZWN0b3J5IEVudHJ5IDEgRmlsZSBPZmZzZXQgICAgICB8ICAgRGlyRW50cnlGaWxlT2Zmc2V0ICAgICAgICB8CisvLyArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorLy8gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKKy8vIHwgRGlyZWN0b3J5IEVudHJ5IDEgTGVuZ3RoICAgICAgICAgICB8ICAgRGlyRW50cnlMZW5ndGggICAgICAgICAgICB8CisvLyArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKyAgICAgICAgICAgICAgICAgICAgICAgIDwtLS0tKworLy8gfCAgICAgICAgICAgIC4gLiAuICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAuIC4gLiAKKy8vICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rICAgICAgICAgICAgICAgICAgICAgICAgPC0tLS0rCisvLyB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorLy8gfCBEaXJlY3RvcnkgRW50cnkgbiBUeXBlICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKKy8vICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8CisvLyB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCB0cG9sRmlsZURpckVudHJ5IG4KKy8vIHwgRGlyZWN0b3J5IEVudHJ5IG4gRmlsZSBPZmZzZXQgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8CisvLyArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorLy8gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKKy8vIHwgRGlyZWN0b3J5IEVudHJ5IG4gTGVuZ3RoICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8CisvLyArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKyAgICAgICAgICAgICAgICAgICAgICAgIDwtLS0tKworLy8gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKKy8vIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8CisvLyB8IEZpbGUgZGF0YSBkZXNjcmliZWQgYnkgICAgICAgICAgICAgfAorLy8gfCBkaXJlY3RvcnkgZW50cnkgMSAgICAgICAgICAgICAgICAgIHwKKy8vIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8CisvLyB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorLy8gKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKKy8vIHwgICAgICAgICAgICAuIC4gLiAgICAgICAgICAgICAgICAgICB8CisvLyArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKworLy8gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKKy8vIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8CisvLyB8IEZpbGUgZGF0YSBkZXNjcmliZWQgYnkgICAgICAgICAgICAgfAorLy8gfCBkaXJlY3RvcnkgZW50cnkgbiAgICAgICAgICAgICAgICAgIHwKKy8vIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8CisvLyB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorLy8gKy0tLS0tLS0tLSstLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLSsKKy8vIHwgICAgICAgICAgICAgICAgICAgfAorLy8gfCBGaWxlIENoZWNrc3VtICAgICB8CisvLyArLS0tLS0tLS0tKy0tLS0tLS0tLSsKKy8vCisvLworLy8gICAgICAgICAKKy8vCisKKworI3ByYWdtYSBwYWNrKCBwdXNoICkKKyNwcmFnbWEgcGFjayggMSApCisKK3R5cGVkZWYgc3RydWN0IHNQb2xGaWxlVmVyc2lvbiB7CisKKyAgdW5zaWduZWQgY2hhciAgTWFqb3JWZXJzaW9uOworICB1bnNpZ25lZCBjaGFyICBNaW5vclZlcnNpb247CisgIHVuc2lnbmVkIGNoYXIgIFN1ZmZpeDsKKyAgdW5zaWduZWQgY2hhciAgQnVpbGQ7CisKK30gdFBvbEZpbGVWZX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ICB0QU5JX1UxNiBpbmRleCA9IGhhc2hGdW5jdGlvbihwTWFjLCBzdGFBZGRyLCBwRHBoSGFzaFRhYmxlLT5zaXplKTsKKworICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiYXNzb2NJZCAlZCBpbmRleCAlZCBTVEEgYWRkciIpLAorICAgICAgICAgICBhc3NvY0lkLCBpbmRleCk7CisgICAgZHBoUHJpbnRNYWNBZGRyKHBNYWMsIHN0YUFkZHIsIExPRzEpOworCisgICAgaWYgKGFzc29jSWQgPj0gcERwaEhhc2hUYWJsZS0+c2l6ZSkKKyAgICB7CisgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoImludmFsaWQgU1RBIGlkICVkIiksIGFzc29jSWQpOykKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorCisgICAgaWYgKHBEcGhIYXNoVGFibGUtPnBEcGhOb2RlQXJyYXlbYXNzb2NJZF0uYWRkZWQpCisgICAgeworICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJhbHJlYWR5IGFkZGVkIFNUQSAlZCIpLCBhc3NvY0lkKTspCisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICAgIGZvciAocHRyID0gcERwaEhhc2hUYWJsZS0+cEhhc2hUYWJsZVtpbmRleF07IHB0cjsgcHRyID0gcHRyLT5uZXh0KQorICAgIHsKKyAgICAgICAgaWYgKHB0ciA9PSBwdHItPm5leHQpCisgICAgICAgIHsKKyAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkluZmluaXRlIExvb3AiKSk7KQorICAgICAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgICAgIH0KKworICAgICAgICBpZiAoZHBoQ29tcGFyZU1hY0FkZHIoc3RhQWRkciwgcHRyLT5zdGFBZGRyKSB8fCBwdHItPmFzc29jSWQ9PSBhc3NvY0lkKQorICAgICAgICAgICAgYnJlYWs7CisgICAgfQorC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MjAwICkKKyNkZWZpbmUgRE9UMTFGX1VOS05PV05fVExWUyAgICAgICAgICAoIDB4MDAwMDA0MDAgKQorI2RlZmluZSBET1QxMUZfTEFTVF9UTFZfVE9PX0xPTkcgICAgICggMHgwMDAwMDgwMCApCisjZGVmaW5lIERPVDExRl9JTlRFUk5BTF9FUlJPUiAgICAgICAgKCAweDEwMDAwMDAxICkKKyNkZWZpbmUgRE9UMTFGX01JU1NJTkdfRklYRURfRklFTEQgICAoIDB4MTAwMDAwMDIgKQorI2RlZmluZSBET1QxMUZfQkFEX0lOUFVUX0JVRkZFUiAgICAgICggMHgxMDAwMDAwMyApCisjZGVmaW5lIERPVDExRl9CQURfT1VUUFVUX0JVRkZFUiAgICAgKCAweDEwMDAwMDA0ICkKKyNkZWZpbmUgRE9UMTFGX0JVRkZFUl9PVkVSRkxPVyAgICAgICAoIDB4MTAwMDAwMDUgKQorI2RlZmluZSBET1QxMUZfTUFOREFUT1JZX1RMVl9NSVNTSU5HICggMHgwMDAwMTAwMCApCisjZGVmaW5lIERPVDExRl9GQUlMRUQoY29kZSkgICAgICAgICAgKCAoY29kZSkgJiAweDEwMDAwMDAwICkKKyNkZWZpbmUgRE9UMTFGX1dBUk5FRChjb2RlKSAgICAgICAgICAoICggKCAwID09IChjb2RlKSApICYgMHgxMDAwMDAwMCApICYmIGNvZGUpCisjZGVmaW5lIERPVDExRl9TVUNDRUVERUQoY29kZSkgICAgICAgKCAoY29kZSkgPT0gMCApCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIEZpeGVkIEZpZWxkcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBzdHJ1Y3Qgc0RvdDExZkZmQUlE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G9sbFJlcTogMTsKKyAgICB0QU5JX1UxNiAgICAgICAgIHByaXZhY3k6IDE7CisgICAgdEFOSV9VMTYgICBzaG9ydFByZWFtYmxlOiAxOworICAgIHRBTklfVTE2ICAgICAgICAgICAgcGJjYzogMTsKKyAgICB0QU5JX1UxNiAgY2hhbm5lbEFnaWxpdHk6IDE7CisgICAgdEFOSV9VMTYgICAgIHNwZWN0cnVtTWd0OiAxOworICAgIHRBTklfVTE2ICAgICAgICAgICAgIHFvczogMTsKKyAgICB0QU5JX1UxNiAgIHNob3J0U2xvdFRpbWU6IDE7CisgICAgdEFOSV9VMTYgICAgICAgICAgICBhcHNkOiAxOworICAgIHRBTklfVTE2ICAgICAgICAgICAgIHJybTogMTsKKyAgICB0QU5JX1UxNiAgICAgICAgZHNzc09mZG06IDE7CisgICAgdEFOSV9VMTYgICAgICAgZGVsYXllZEJBOiAxOworICAgIHRBTklfVTE2ICAgICBpbW1lZGlhdGVCQTogMTsKK30gdERvdDExZkZmQ2FwYWJpbGl0aWVzOworCisjZGVmaW5lIERPVDExRl9GRl9DQVBBQklMSVRJRVNfTEVOICggMiApCisKK3ZvaWQgZG90MTFmVW5wYWNrRmZDYXBhYmlsaXRpZXModHBBbmlTaXJHbG9iYWwsIHRBTklfVTgqLCB0RG90MTFmRmZDYXBhYmlsaXRpZXMqKTsKKwordm9pZCBkb3QxMWZQYWNrRmZDYXBhYmlsaXRpZXModHBBbmlTaXJHbG9iYWwsIHREb3QxMWZGZkNhcGFiaWxpdGllcyosIHRBTklfVTgqKTsKKworI2RlZmluZSBDQVBBQklMSVRJRVNfRVNTX09GRlNFVCAgICAgICAgICAgIDAKKyNkZWZpbmUgQ0FQQUJJTElUSUVTX0VTU19XSURUSCAgICAgICAgICAgICAxCisjZGVmaW5lIENBUEFCSUxJVElFU19JQlNTX09GRlNFVCAgICAgICAgICAgMQorI2RlZmluZSBDQVBBQklMSVRJRVNfSUJTU19XSURUSCAgICAgICAgICAgIDEKKyNkZWZpbmUgQ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Sh0cEFuaVNpckdsb2JhbCwgdERvdDExZkZmVmh0VXNlclBvc2l0aW9uQXJyYXkqLCB0QU5JX1U4Kik7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFRMVnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLy8gSUQgMSAoMHgwMDAxKQordHlwZWRlZiBzdHJ1Y3Qgc0RvdDExZlRMVkF1dGhvcml6ZWRNQUNzIHsKKyAgICB0QU5JX1U4ICAgICAgcHJlc2VudDsKKyAgICB0QU5JX1U4ICAgICAgbWFjWzZdOworfSB0RG90MTFmVExWQXV0aG9yaXplZE1BQ3M7CisKKyNkZWZpbmUgRE9UMTFGX1RMVl9BVVRIT1JJWkVETUFDUyAoIDEgKQorCisvLyBOLkIuIFRoZXNlICNkZWZpbmVzIGRvICpub3QqIGluY2x1ZGUgdGhlIElEICYgbGVuZ3RoCisjZGVmaW5lIERPVDExRl9UTFZfQVVUSE9SSVpFRE1BQ1NfTUlOX0xFTiAoIDYgKQorCisjZGVmaW5lIERPVDExRl9UTFZfQVVUSE9SSVpFRE1BQ1NfTUFYX0xFTiAoIDYgKQorCisjaWZkZWYgX19jcGx1c3BsdXMKK2V4dGVybiAiQyIgeworI2VuZGlmIC8qIEMrKyAqLwordEFOSV9VMzIgZG90MTFmVW5wYWNrVGx2QXV0aG9yaXplZE1BQ3ModHBBbmlTaXJHbG9iYWwsIHRBTklfVTgqLHRBTklfVTE2LCB0RG90MTFmVExWQXV0aG9yaXplZE1BQ3MqKTsKKwordEFOSV9VMzIgZG90MTFmUGFja1RsdkF1dGhvcml6ZWRNQUNzKHRwQW5pU2lyR2xvYmFsLCB0RG90MTFmVExWQXV0aG9y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VkZWYgc3RydWN0IHNEb3QxMWZUTFZDb25maWd1cmF0aW9uRXJyb3IgeworICAgIHRBTklfVTggICAgICBwcmVzZW50OworICAgIHRBTklfVTE2ICAgICBlcnJvcjsKK30gdERvdDExZlRMVkNvbmZpZ3VyYXRpb25FcnJvcjsKKworI2RlZmluZSBET1QxMUZfVExWX0NPTkZJR1VSQVRJT05FUlJPUiAoIDQxMDUgKQorCisvLyBOLkIuIFRoZXNlICNkZWZpbmVzIGRvICpub3QqIGluY2x1ZGUgdGhlIElEICYgbGVuZ3RoCisjZGVmaW5lIERPVDExRl9UTFZfQ09ORklHVVJBVElPTkVSUk9SX01JTl9MRU4gKCA0ICkKKworI2RlZmluZSBET1QxMUZfVExWX0NPTkZJR1VSQVRJT05FUlJPUl9NQVhfTEVOICggNCApCisKKyNpZmRlZiBfX2NwbHVzcGx1cworZXh0ZXJuICJDIiB7CisjZW5kaWYgLyogQysrICovCit0QU5JX1UzMiBkb3QxMWZVbnBhY2tUbHZDb25maWd1cmF0aW9uRXJyb3IodHBBbmlTaXJHbG9iYWwsIHRBTklfVTgqLHRBTklfVTE2LCB0RG90MTFmVExWQ29uZmlndXJhdGlvbkVycm9yKik7CisKK3RBTklfVTMyIGRvdDExZlBhY2tUbHZDb25maWd1cmF0aW9uRXJyb3IodHBBbmlTaXJHbG9iYWwsIHREb3QxMWZUTFZDb25maWd1cmF0aW9uRXJyb3IqLCB0QU5JX1U4KiwgdEFOSV9VMzIsIHRBTklfVTMyKik7CisKK3RBTklfVTMyIGRvdDExZkdldFBhY2tlZFRsdkNvbmZpZ3VyYXRpb25FcnJvcih0cEFuaVNpckdsb2JhbCwgdERvdDExZlRMVkNvbmZpZ3VyYXRpb25FcnJvciosIHRBTklfVTMyKik7CisKKyNpZmRlZiBfX2NwbHVzcGx1cworfTsgLyogRW5kIGV4dGVybiAiQyIuICovCisjZW5kaWYgLyogQysrICovCisvLyBJRCA1ICgweDAwMDUpCit0eXBlZGVmIHN0cnVjdCBzRG90MT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OCAgICAgIG51bV90ZXh0OworICAgIHRBTklfVTggICAgICB0ZXh0WzMyXTsKK30gdERvdDExZlRMVk1vZGVsTnVtYmVyOworCisjZGVmaW5lIERPVDExRl9UTFZfTU9ERUxOVU1CRVIgKCA0MTMyICkKKworLy8gTi5CLiBUaGVzZSAjZGVmaW5lcyBkbyAqbm90KiBpbmNsdWRlIHRoZSBJRCAmIGxlbmd0aAorI2RlZmluZSBET1QxMUZfVExWX01PREVMTlVNQkVSX01JTl9MRU4gKCAyICkKKworI2RlZmluZSBET1QxMUZfVExWX01PREVMTlVNQkVSX01BWF9MRU4gKCAzNCApCisKKyNpZmRlZiBfX2NwbHVzcGx1cworZXh0ZXJuICJDIiB7CisjZW5kaWYgLyogQysrICovCit0QU5JX1UzMiBkb3QxMWZVbnBhY2tUbHZNb2RlbE51bWJlcih0cEFuaVNpckdsb2JhbCwgdEFOSV9VOCosdEFOSV9VMTYsIHREb3QxMWZUTFZNb2RlbE51bWJlciopOworCit0QU5JX1UzMiBkb3QxMWZQYWNrVGx2TW9kZWxOdW1iZXIodHBBbmlTaXJHbG9iYWwsIHREb3QxMWZUTFZNb2RlbE51bWJlciosIHRBTklfVTgqLCB0QU5JX1UzMiwgdEFOSV9VMzIqKTsKKwordEFOSV9VMzIgZG90MTFmR2V0UGFja2VkVGx2TW9kZWxOdW1iZXIodHBBbmlTaXJHbG9iYWwsIHREb3QxMWZUTFZNb2RlbE51bWJlciosIHRBTklfVTMyKik7CisKKyNpZmRlZiBfX2NwbHVzcGx1cworfTsgLyogRW5kIGV4dGVybiAiQyIuICovCisjZW5kaWYgLyogQysrICovCisvLyBJRCAxMiAoMHgwMDBjKQordHlwZWRlZiBzdHJ1Y3Qgc0RvdDExZlRMVk5vdGljZU9mQWJzZW5jZSB7CisgICAgdEFOSV9VOCAgICAgIHByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgIGluZGV4OworICAgIHRBTklfVTggICAgICBDVFNXaW5kb3dPcHBQUzsKKyAgICB0QU5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SV9VOCAgICAgIFAyUENsaWVudEluZm9EZXNjWzEwMjRdOworfSB0RG90MTFmVExWUDJQR3JvdXBJbmZvOworCisjZGVmaW5lIERPVDExRl9UTFZfUDJQR1JPVVBJTkZPICggMTQgKQorCisvLyBOLkIuIFRoZXNlICNkZWZpbmVzIGRvICpub3QqIGluY2x1ZGUgdGhlIElEICYgbGVuZ3RoCisjZGVmaW5lIERPVDExRl9UTFZfUDJQR1JPVVBJTkZPX01JTl9MRU4gKCAxICkKKworI2RlZmluZSBET1QxMUZfVExWX1AyUEdST1VQSU5GT19NQVhfTEVOICggMTAyNSApCisKKyNpZmRlZiBfX2NwbHVzcGx1cworZXh0ZXJuICJDIiB7CisjZW5kaWYgLyogQysrICovCit0QU5JX1UzMiBkb3QxMWZVbnBhY2tUbHZQMlBHcm91cEluZm8odHBBbmlTaXJHbG9iYWwsIHRBTklfVTgqLHRBTklfVTE2LCB0RG90MTFmVExWUDJQR3JvdXBJbmZvKik7CisKK3RBTklfVTMyIGRvdDExZlBhY2tUbHZQMlBHcm91cEluZm8odHBBbmlTaXJHbG9iYWwsIHREb3QxMWZUTFZQMlBHcm91cEluZm8qLCB0QU5JX1U4KiwgdEFOSV9VMzIsIHRBTklfVTMyKik7CisKK3RBTklfVTMyIGRvdDExZkdldFBhY2tlZFRsdlAyUEdyb3VwSW5mbyh0cEFuaVNpckdsb2JhbCwgdERvdDExZlRMVlAyUEdyb3VwSW5mbyosIHRBTklfVTMyKik7CisKKyNpZmRlZiBfX2NwbHVzcGx1cworfTsgLyogRW5kIGV4dGVybiAiQyIuICovCisjZW5kaWYgLyogQysrICovCisvLyBJRCAwICgweDAwMDApCit0eXBlZGVmIHN0cnVjdCBzRG90MTFmVExWUDJQU3RhdHVzIHsKKyAgICB0QU5JX1U4ICAgICAgcHJlc2VudDsKKyAgICB0QU5JX1U4ICAgICAgc3RhdHVzOworfSB0RG90MTFmVExWUDJQU3RhdHVzOworCisjZGVmaW5lIERPVDExRl9UTFZfUDJQU1R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kbyAqbm90KiBpbmNsdWRlIHRoZSBJRCAmIGxlbmd0aAorI2RlZmluZSBET1QxMUZfVExWX1JGQkFORFNfTUlOX0xFTiAoIDMgKQorCisjZGVmaW5lIERPVDExRl9UTFZfUkZCQU5EU19NQVhfTEVOICggMyApCisKKyNpZmRlZiBfX2NwbHVzcGx1cworZXh0ZXJuICJDIiB7CisjZW5kaWYgLyogQysrICovCit0QU5JX1UzMiBkb3QxMWZVbnBhY2tUbHZSRkJhbmRzKHRwQW5pU2lyR2xvYmFsLCB0QU5JX1U4Kix0QU5JX1UxNiwgdERvdDExZlRMVlJGQmFuZHMqKTsKKwordEFOSV9VMzIgZG90MTFmUGFja1RsdlJGQmFuZHModHBBbmlTaXJHbG9iYWwsIHREb3QxMWZUTFZSRkJhbmRzKiwgdEFOSV9VOCosIHRBTklfVTMyLCB0QU5JX1UzMiopOworCit0QU5JX1UzMiBkb3QxMWZHZXRQYWNrZWRUbHZSRkJhbmRzKHRwQW5pU2lyR2xvYmFsLCB0RG90MTFmVExWUkZCYW5kcyosIHRBTklfVTMyKik7CisKKyNpZmRlZiBfX2NwbHVzcGx1cworfTsgLyogRW5kIGV4dGVybiAiQyIuICovCisjZW5kaWYgLyogQysrICovCisvLyBJRCA0MjAyICgweDEwNmEpCit0eXBlZGVmIHN0cnVjdCBzRG90MTFmVExWUmVxdWVzdERldmljZVR5cGUgeworICAgIHRBTklfVTggICAgICBwcmVzZW50OworICAgIHRBTklfVTE2ICAgICBwcmltYXJ5X2NhdGVnb3J5OworICAgIHRBTklfVTggICAgICBvdWlbNF07CisgICAgdEFOSV9VMTYgICAgIHN1Yl9jYXRlZ29yeTsKK30gdERvdDExZlRMVlJlcXVlc3REZXZpY2VUeXBlOworCisjZGVmaW5lIERPVDExRl9UTFZfUkVRVUVTVERFVklDRVRZUEUgKCA0MjAyICkKKworLy8gTi5CLiBUaGVzZSAjZGVmaW5lcyBkbyAqbm90KiBpbmNsdWRlIHRoZSBJRCAmIGxlbmd0aAorI2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MlBNYW5hZ2VhYmlsaXR5KiwgdEFOSV9VOCosIHRBTklfVTMyLCB0QU5JX1UzMiopOworCit0QU5JX1UzMiBkb3QxMWZHZXRQYWNrZWRUbHZQMlBNYW5hZ2VhYmlsaXR5KHRwQW5pU2lyR2xvYmFsLCB0RG90MTFmVExWUDJQTWFuYWdlYWJpbGl0eSosIHRBTklfVTMyKik7CisKKyNpZmRlZiBfX2NwbHVzcGx1cworfTsgLyogRW5kIGV4dGVybiAiQyIuICovCisjZW5kaWYgLyogQysrICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBJbmZvcm1hdGlvbiBFbGVtZW50cyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8vIEVJRCAxICgweDAxKQordHlwZWRlZiBzdHJ1Y3Qgc0RvdDExZklFQVBOYW1lIHsKKyAgICB0QU5JX1U4ICAgICAgcHJlc2VudDsKKyAgICB0QU5JX1U4ICAgICAgbnVtX25hbWU7CisgICAgdEFOSV9VOCAgICAgIG5hbWVbMzJdOworfSB0RG90MTFmSUVBUE5hbWU7CisKKyNkZWZpbmUgRE9UMTFGX0VJRF9BUE5BTUUgKCAxICkKKworLy8gTi5CLiBUaGVzZSAjZGVmaW5lcyBkbyAqbm90KiBpbmNsdWRlIHRoZSBFSUQgJiBsZW5ndGgKKyNkZWZpbmUgRE9UMTFGX0lFX0FQTkFNRV9NSU5fTEVOICggMSApCisKKyNkZWZpbmUgRE9UMTFGX0lFX0FQTkFNRV9NQVhfTEVOICggMzIgKQorCisjaWZkZWYgX19jcGx1c3BsdXMKK2V4dGVybiAiQyIgeworI2VuZGlmIC8qIEMrKyAqLwordEFOSV9VMzIgZG90MTFmVW5wYWNrSWVBUE5hbWUodHBBbml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bGl0eSh0cEFuaVNpckdsb2JhbCwgdEFOSV9VOCosdEFOSV9VOCwgdERvdDExZklFUHJvcENhcGFiaWxpdHkqKTsKKwordEFOSV9VMzIgZG90MTFmUGFja0llUHJvcENhcGFiaWxpdHkodHBBbmlTaXJHbG9iYWwsIHREb3QxMWZJRVByb3BDYXBhYmlsaXR5KiwgdEFOSV9VOCosIHRBTklfVTMyLCB0QU5JX1UzMiopOworCit0QU5JX1UzMiBkb3QxMWZHZXRQYWNrZWRJRVByb3BDYXBhYmlsaXR5KHRwQW5pU2lyR2xvYmFsLCB0RG90MTFmSUVQcm9wQ2FwYWJpbGl0eSosIHRBTklfVTMyKik7CisKKyNpZmRlZiBfX2NwbHVzcGx1cworfTsgLyogRW5kIGV4dGVybiAiQyIuICovCisjZW5kaWYgLyogQysrICovCisvLyBFSUQgMTUgKDB4MGYpCit0eXBlZGVmIHN0cnVjdCBzRG90MTFmSUVQcm9wQ2hhbm5Td2l0Y2hBbm4geworICAgIHRBTklfVTggICAgICBwcmVzZW50OworICAgIHRBTklfVTggICAgICBtb2RlOworICAgIHRBTklfVTggICAgICBwcmltYXJ5X2NoYW5uZWw7CisgICAgdEFOSV9VOCAgICAgIHN1Yl9iYW5kOworICAgIHRBTklfVTggICAgICBjaGFubmVsX3N3aXRjaF9jb3VudDsKK30gdERvdDExZklFUHJvcENoYW5uU3dpdGNoQW5uOworCisjZGVmaW5lIERPVDExRl9FSURfUFJPUENIQU5OU1dJVENIQU5OICggMTUgKQorCisvLyBOLkIuIFRoZXNlICNkZWZpbmVzIGRvICpub3QqIGluY2x1ZGUgdGhlIEVJRCAmIGxlbmd0aAorI2RlZmluZSBET1QxMUZfSUVfUFJPUENIQU5OU1dJVENIQU5OX01JTl9MRU4gKCA0ICkKKworI2RlZmluZSBET1QxMUZfSUVfUFJPUENIQU5OU1dJVENIQU5OX01BWF9MRU4gKCA0ICkKKworI2lmZGVmIF9fY3BsdXNwbHVzCitleHRlcm4gIkMiIHsKKyNlbmRpZ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IGFjYmtfYWNtOiAxOworICAgIHRBTklfVTggICAgICAgICBhY2JrX2FjaTogMjsKKyAgICB0QU5JX1U4ICAgICAgICAgIHVudXNlZDI6IDE7CisgICAgdEFOSV9VOCAgICAgICAgIGFjYmtfbWluOiA0OworICAgIHRBTklfVTggICAgICAgICBhY2JrX21heDogNDsKKyAgICB0QU5JX1UxNiAgICAgYWNia190eG9wbGltaXQ7CisgICAgdEFOSV9VOCAgICAgICBhY3ZpX2FpZnNuOiA0OworICAgIHRBTklfVTggICAgICAgICBhY3ZpX2FjbTogMTsKKyAgICB0QU5JX1U4ICAgICAgICAgYWN2aV9hY2k6IDI7CisgICAgdEFOSV9VOCAgICAgICAgICB1bnVzZWQzOiAxOworICAgIHRBTklfVTggICAgICAgICBhY3ZpX21pbjogNDsKKyAgICB0QU5JX1U4ICAgICAgICAgYWN2aV9tYXg6IDQ7CisgICAgdEFOSV9VMTYgICAgIGFjdmlfdHhvcGxpbWl0OworICAgIHRBTklfVTggICAgICAgYWN2b19haWZzbjogNDsKKyAgICB0QU5JX1U4ICAgICAgICAgYWN2b19hY206IDE7CisgICAgdEFOSV9VOCAgICAgICAgIGFjdm9fYWNpOiAyOworICAgIHRBTklfVTggICAgICAgICAgdW51c2VkNDogMTsKKyAgICB0QU5JX1U4ICAgICAgICAgYWN2b19taW46IDQ7CisgICAgdEFOSV9VOCAgICAgICAgIGFjdm9fbWF4OiA0OworICAgIHRBTklfVTE2ICAgICBhY3ZvX3R4b3BsaW1pdDsKK30gdERvdDExZklFUHJvcEVEQ0FQYXJhbXM7CisKKyNkZWZpbmUgRE9UMTFGX0VJRF9QUk9QRURDQVBBUkFNUyAoIDEyICkKKworLy8gTi5CLiBUaGVzZSAjZGVmaW5lcyBkbyAqbm90KiBpbmNsdWRlIHRoZSBFSUQgJiBsZW5ndGgKKyNkZWZpbmUgRE9UMTFGX0lFX1BST1BFRENBUEFSQU1TX01JTl9MRU4gKCAxOCApCisKKyNkZWZpbmUgRE9UMTFGX0lF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gIHRBTklfVTggICAgICBwcmVzZW50OworICAgIHRBTklfVTggICAgICByZXBvcnRpbmdDb25kaXRpb247CisgICAgdEFOSV9VOCAgICAgIHRocmVzaG9sZDsKK30gdERvdDExZklFQmVhY29uUmVwb3J0aW5nOworCisjZGVmaW5lIERPVDExRl9FSURfQkVBQ09OUkVQT1JUSU5HICggMSApCisKKy8vIE4uQi4gVGhlc2UgI2RlZmluZXMgZG8gKm5vdCogaW5jbHVkZSB0aGUgRUlEICYgbGVuZ3RoCisjZGVmaW5lIERPVDExRl9JRV9CRUFDT05SRVBPUlRJTkdfTUlOX0xFTiAoIDIgKQorCisjZGVmaW5lIERPVDExRl9JRV9CRUFDT05SRVBPUlRJTkdfTUFYX0xFTiAoIDIgKQorCisjaWZkZWYgX19jcGx1c3BsdXMKK2V4dGVybiAiQyIgeworI2VuZGlmIC8qIEMrKyAqLwordEFOSV9VMzIgZG90MTFmVW5wYWNrSWVCZWFjb25SZXBvcnRpbmcodHBBbmlTaXJHbG9iYWwsIHRBTklfVTgqLHRBTklfVTgsIHREb3QxMWZJRUJlYWNvblJlcG9ydGluZyopOworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVCZWFjb25SZXBvcnRpbmcodHBBbmlTaXJHbG9iYWwsIHREb3QxMWZJRUJlYWNvblJlcG9ydGluZyosIHRBTklfVTgqLCB0QU5JX1UzMiwgdEFOSV9VMzIqKTsKKwordEFOSV9VMzIgZG90MTFmR2V0UGFja2VkSUVCZWFjb25SZXBvcnRpbmcodHBBbmlTaXJHbG9iYWwsIHREb3QxMWZJRUJlYWNvblJlcG9ydGluZyosIHRBTklfVTMyKik7CisKKyNpZmRlZiBfX2NwbHVzcGx1cworfTsgLyogRW5kIGV4dGVybiAiQyIuICovCisjZW5kaWYgLyogQysrICovCisvLyBFSUQgNjYgKDB4NDIpCit0eXBlZGVmIHN0cnVjdCBzRG90MTFmSUVNZWFzdXJlbWVudFBpbG90IHsKKyAgICB0QU5JX1U4ICAgICAgcHJlc2V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VzZW50OworICAgIHRBTklfVTggIExpbmtNZWFzdXJlbWVudDogMTsKKyAgICB0QU5JX1U4ICAgICAgTmVpZ2hib3JScHQ6IDE7CisgICAgdEFOSV9VOCAgICAgICAgIHBhcmFsbGVsOiAxOworICAgIHRBTklfVTggICAgICAgICByZXBlYXRlZDogMTsKKyAgICB0QU5JX1U4ICAgIEJlYWNvblBhc3NpdmU6IDE7CisgICAgdEFOSV9VOCAgICAgQmVhY29uQWN0aXZlOiAxOworICAgIHRBTklfVTggICAgICBCZWFjb25UYWJsZTogMTsKKyAgICB0QU5JX1U4ICAgIEJlYWNvblJlcENvbmQ6IDE7CisgICAgdEFOSV9VOCBGcmFtZU1lYXN1cmVtZW50OiAxOworICAgIHRBTklfVTggICAgICBDaGFubmVsTG9hZDogMTsKKyAgICB0QU5JX1U4ICAgTm9pc2VIaXN0b2dyYW06IDE7CisgICAgdEFOSV9VOCAgICAgICBzdGF0aXN0aWNzOiAxOworICAgIHRBTklfVTggICBMQ0lNZWFzdXJlbWVudDogMTsKKyAgICB0QU5JX1U4ICAgICAgIExDSUF6aW11dGg6IDE7CisgICAgdEFOSV9VOCAgICBUQ01DYXBhYmlsaXR5OiAxOworICAgIHRBTklfVTggICAgIHRyaWdnZXJlZFRDTTogMTsKKyAgICB0QU5JX1U4ICAgICBBUENoYW5SZXBvcnQ6IDE7CisgICAgdEFOSV9VOCAgICBSUk1NSUJFbmFibGVkOiAxOworICAgIHRBTklfVTggb3BlcmF0aW5nQ2hhbk1heDogMzsKKyAgICB0QU5JX1U4IG5vbk9wZXJhdGluQ2hhbk1heDogMzsKKyAgICB0QU5JX1U4IE1lYXN1cmVtZW50UGlsb3Q6IDM7CisgICAgdEFOSV9VOCBNZWFzdXJlbWVudFBpbG90RW5hYmxlZDogMTsKKyAgICB0QU5JX1U4IE5laWdoYm9yVFNGT2Zmc2V0OiAxOworICAgIHRBTklfVTggIFJDUElNZWFzdXJlbWVudDogMTsKKyAgICB0QU5JX1U4ICBSU05JTWV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3R5cGVkZWYgc3RydWN0IHNEb3QxMWZJRVRDTEFTIHsKKyAgICB0QU5JX1U4ICAgICAgcHJlc2VudDsKKyAgICB0QU5JX1U4ICAgICAgdXNlcl9wcmlvcml0eTsKKyAgICB0QU5JX1U4ICAgICAgY2xhc3NpZmllcl90eXBlOworICAgIHRBTklfVTggICAgICBjbGFzc2lmaWVyX21hc2s7CisgICAgdW5pb24KKyAgICB7CisgICAgICAgIHN0cnVjdAorICAgICAgICB7CisgICAgICAgICAgICB0QU5JX1U4IHNvdXJjZVs2XTsKKyAgICAgICAgICAgIHRBTklfVTggZGVzdFs2XTsKKyAgICAgICAgICAgIHRBTklfVTE2IHR5cGU7CisgICAgICAgIH0gRXRoUGFyYW1zOyAvKiBjbGFzc2lmaWVyX3R5cGUgPSAwICovCisgICAgICAgIHN0cnVjdAorICAgICAgICB7CisgICAgICAgICAgICB0QU5JX1U4IHZlcnNpb247CisgICAgICAgICAgICB1bmlvbgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0cnVjdAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBzb3VyY2VbNF07CisgICAgICAgICAgICAgICAgICAgIHRBTklfVTggZGVzdFs0XTsKKyAgICAgICAgICAgICAgICAgICAgdEFOSV9VMTYgc3JjX3BvcnQ7CisgICAgICAgICAgICAgICAgICAgIHRBTklfVTE2IGRlc3RfcG9ydDsKKyAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBEU0NQOworICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IHByb3RvOworICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IHJlc2VydmVkOworICAgICAgICAgICAgICAgIH0gSXBWNFBhcmFtczsgLyogdmVyc2lvbiA9IDQgKi8KKyAgICAgICAgICAgICAgICBzdHJ1Y3QKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHRBTklfVTggc291cmNlWzE2XTsKKyAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBkZXN0WzE2XTsKKyAgICAgICAgICAgICAgICAgICAgdEFOSV9VMTYgc3JjX3BvcnQ7CisgICAgICAgICAgICAgICAgICAgIHRBTklfVTE2IGRlc3RfcG9ydDsKKyAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBmbG93X2xhYmVsWzNdOworICAgICAgICAgICAgICAgIH0gSXBWNlBhcmFtczsgLyogdmVyc2lvbiA9IDYgKi8KKyAgICAgICAgICAgIH0gcGFyYW1zOworICAgICAgICB9IElwUGFyYW1zOyAvKiBjbGFzc2lmaWVyX3R5cGUgPSAxICovCisgICAgICAgIHN0cnVjdAorICAgICAgICB7CisgICAgICAgICAgICB0QU5JX1UxNiB0YWdfdHlwZTsKKyAgICAgICAgfSBQYXJhbXM4MDIxZHE7IC8qIGNsYXNzaWZpZXJfdHlwZSA9IDIgKi8KKyAgICB9IGluZm87Cit9IHREb3QxMWZJRVRDTEFTOworCisjZGVmaW5lIERPVDExRl9FSURfVENMQVMgKCAxNCApCisKKy8vIE4uQi4gVGhlc2UgI2RlZmluZXMgZG8gKm5vdCogaW5jbHVkZSB0aGUgRUlEICYgbGVuZ3RoCisjZGVmaW5lIERPVDExRl9JRV9UQ0xBU19NSU5fTEVOICggNSApCisKKyNkZWZpbmUgRE9UMTFGX0lFX1RDTEFTX01BWF9MRU4gKCA0MyApCisKKyNpZmRlZiBfX2NwbHVzcGx1cworZXh0ZXJuICJDIiB7CisjZW5kaWYgLyogQysrICovCit0QU5JX1UzMiBkb3QxMWZVbnBhY2tJZVRDTEFTKHRwQW5pU2lyR2xvYmFsLCB0QU5JX1U4Kix0QU5JX1U4LCB0RG90MTFmSUVUQ0xBUyopOworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVUQ0xBUyh0cEFuaVNpckdsb2JhbCwgdERvdDExZklFVENMQVMqLCB0QU5JX1U4KiwgdEFOSV9VMzIsIHRBTklfVTMyKik7CisKK3RBTklfVTMyIGRvdDExZkdldFBhY2tlZElFVEN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9VMTYgICAgICAgICAgICAgdHNpZDogNDsKKyAgICB0QU5JX1UxNiAgICAgICAgZGlyZWN0aW9uOiAyOworICAgIHRBTklfVTE2ICAgIGFjY2Vzc19wb2xpY3k6IDI7CisgICAgdEFOSV9VMTYgICAgICBhZ2dyZWdhdGlvbjogMTsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgcHNiOiAxOworICAgIHRBTklfVTE2ICAgIHVzZXJfcHJpb3JpdHk6IDM7CisgICAgdEFOSV9VMTYgICB0c2luZm9fYWNrX3BvbDogMjsKKyAgICB0QU5JX1U4ICAgICAgICAgc2NoZWR1bGU6IDE7CisgICAgdEFOSV9VOCAgICAgICAgICAgdW51c2VkOiA3OworICAgIHRBTklfVTE2ICAgICAgICAgICAgIHNpemU6IDE1OworICAgIHRBTklfVTE2ICAgICAgICAgICAgZml4ZWQ6IDE7CisgICAgdEFOSV9VMTYgICAgIG1heF9tc2R1X3NpemU7CisgICAgdEFOSV9VMzIgICAgIG1pbl9zZXJ2aWNlX2ludDsKKyAgICB0QU5JX1UzMiAgICAgbWF4X3NlcnZpY2VfaW50OworICAgIHRBTklfVTMyICAgICBpbmFjdGl2aXR5X2ludDsKKyAgICB0QU5JX1UzMiAgICAgc3VzcGVuc2lvbl9pbnQ7CisgICAgdEFOSV9VMzIgICAgIHNlcnZpY2Vfc3RhcnRfdGltZTsKKyAgICB0QU5JX1UzMiAgICAgbWluX2RhdGFfcmF0ZTsKKyAgICB0QU5JX1UzMiAgICAgbWVhbl9kYXRhX3JhdGU7CisgICAgdEFOSV9VMzIgICAgIHBlYWtfZGF0YV9yYXRlOworICAgIHRBTklfVTMyICAgICBidXJzdF9zaXplOworICAgIHRBTklfVTMyICAgICBkZWxheV9ib3VuZDsKKyAgICB0QU5JX1UzMiAgICAgbWluX3BoeV9yYXRlOworICAgIHRBTklfVTE2ICAgICBzdXJwbHVzX2J3X2FsbG93YW5jZTsKKyAgICB0QU5JX1UxNiAgICAgbWVkaXVtX3RpbWU7C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IxICgweGRkKSB7T1VJIDB4MDAsIDB4NTAsIDB4ZjIsIDB4MDIsIDB4MDZ9Cit0eXBlZGVmIHN0cnVjdCBzRG90MTFmSUVXTU1UQ0xBUyB7CisgICAgdEFOSV9VOCAgICAgIHByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgIHZlcnNpb24gLyogTXVzdCBiZSAxISAqLzsKKyAgICB0QU5JX1U4ICAgICAgdXNlcl9wcmlvcml0eTsKKyAgICB0QU5JX1U4ICAgICAgY2xhc3NpZmllcl90eXBlOworICAgIHRBTklfVTggICAgICBjbGFzc2lmaWVyX21hc2s7CisgICAgdW5pb24KKyAgICB7CisgICAgICAgIHN0cnVjdAorICAgICAgICB7CisgICAgICAgICAgICB0QU5JX1U4IHNvdXJjZVs2XTsKKyAgICAgICAgICAgIHRBTklfVTggZGVzdFs2XTsKKyAgICAgICAgICAgIHRBTklfVTE2IHR5cGU7CisgICAgICAgIH0gRXRoUGFyYW1zOyAvKiBjbGFzc2lmaWVyX3R5cGUgPSAwICovCisgICAgICAgIHN0cnVjdAorICAgICAgICB7CisgICAgICAgICAgICB0QU5JX1U4IHZlcnNpb247CisgICAgICAgICAgICB1bmlvbgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0cnVjdAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBzb3VyY2VbNF07CisgICAgICAgICAgICAgICAgICAgIHRBTklfVTggZGVzdFs0XTsKKyAgICAgICAgICAgICAgICAgICAgdEFOSV9VMTYgc3JjX3BvcnQ7CisgICAgICAgICAgICAgICAgICAgIHRBTklfVTE2IGRlc3RfcG9ydDsKKyAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBEU0NQOworICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IHByb3RvOworICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IHJlc2VydmVkOworICAgICAgICAgICAgICAgIH0gSXBWNFBhcmFtczsgLyogdmVyc2lvbiA9IDQgKi8KKyAgICAgICAgICAgICAgICBzdHJ1Y3QKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHRBTklfVTggc291cmNlWzE2XTsKKyAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBkZXN0WzE2XTsKKyAgICAgICAgICAgICAgICAgICAgdEFOSV9VMTYgc3JjX3BvcnQ7CisgICAgICAgICAgICAgICAgICAgIHRBTklfVTE2IGRlc3RfcG9ydDsKKyAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBmbG93X2xhYmVsWzNdOworICAgICAgICAgICAgICAgIH0gSXBWNlBhcmFtczsgLyogdmVyc2lvbiA9IDYgKi8KKyAgICAgICAgICAgIH0gcGFyYW1zOworICAgICAgICB9IElwUGFyYW1zOyAvKiBjbGFzc2lmaWVyX3R5cGUgPSAxICovCisgICAgICAgIHN0cnVjdAorICAgICAgICB7CisgICAgICAgICAgICB0QU5JX1UxNiB0YWdfdHlwZTsKKyAgICAgICAgfSBQYXJhbXM4MDIxZHE7IC8qIGNsYXNzaWZpZXJfdHlwZSA9IDIgKi8KKyAgICB9IGluZm87Cit9IHREb3QxMWZJRVdNTVRDTEFTOworCisjZGVmaW5lIERPVDExRl9FSURfV01NVENMQVMgKCAyMjEgKQorCisvLyBOLkIuIFRoZXNlICNkZWZpbmVzIGRvICpub3QqIGluY2x1ZGUgdGhlIEVJRCAmIGxlbmd0aAorI2RlZmluZSBET1QxMUZfSUVfV01NVENMQVNfTUlOX0xFTiAoIDExICkKKworI2RlZmluZSBET1QxMUZfSUVfV01NVENMQVNfTUFYX0xFTiAoIDQ5ICkKKworI2lmZGVmIF9fY3BsdXNwbHVzCitleHRlcm4gIkMiIHsKKyNlbmRpZiAvKiBDKysgKi8KK3RBTklfVTMyIGRvdDExZlVucGFja0llV01NVENMQVModHBBbmlTaXJHbG9iYWwsIHRBTklfVTgqLHRBTklfVTgsIHREb3QxMWZJRVdNTVRDTEFTKik7CisKK3RBTklfVTMyIGRvdDExZl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BbmlTaXJHbG9iYWwsIHREb3QxMWZJRVdNTVRTRGVsYXkqLCB0QU5JX1U4KiwgdEFOSV9VMzIsIHRBTklfVTMyKik7CisKK3RBTklfVTMyIGRvdDExZkdldFBhY2tlZElFV01NVFNEZWxheSh0cEFuaVNpckdsb2JhbCwgdERvdDExZklFV01NVFNEZWxheSosIHRBTklfVTMyKik7CisKKyNpZmRlZiBfX2NwbHVzcGx1cworfTsgLyogRW5kIGV4dGVybiAiQyIuICovCisjZW5kaWYgLyogQysrICovCisvLyBFSUQgMjIxICgweGRkKSB7T1VJIDB4MDAsIDB4NTAsIDB4ZjIsIDB4MDIsIDB4MDJ9Cit0eXBlZGVmIHN0cnVjdCBzRG90MTFmSUVXTU1UU1BFQyB7CisgICAgdEFOSV9VOCAgICAgIHByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgIHZlcnNpb24gLyogTXVzdCBiZSAxISAqLzsKKyAgICB0QU5JX1UxNiAgICAgdHJhZmZpY190eXBlOiAxOworICAgIHRBTklfVTE2ICAgICAgICAgICAgIHRzaWQ6IDQ7CisgICAgdEFOSV9VMTYgICAgICAgIGRpcmVjdGlvbjogMjsKKyAgICB0QU5JX1UxNiAgICBhY2Nlc3NfcG9saWN5OiAyOworICAgIHRBTklfVTE2ICAgICAgYWdncmVnYXRpb246IDE7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgIHBzYjogMTsKKyAgICB0QU5JX1UxNiAgICB1c2VyX3ByaW9yaXR5OiAzOworICAgIHRBTklfVTE2ICAgdHNpbmZvX2Fja19wb2w6IDI7CisgICAgdEFOSV9VOCAgICAgIHRzaW5mb19yc3ZkOiA3OworICAgIHRBTklfVTggIGJ1cnN0X3NpemVfZGVmbjogMTsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICBzaXplOiAxNTsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgIGZpeGVkOiAxOworICAgIHRBTklfVTE2ICAgICBtYXhfbXNkdV9zaXplOworICAgIHRBTklfVTMy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lcm4gIkMiLiAqLworI2VuZGlmIC8qIEMrKyAqLworLy8gRUlEIDIyMSAoMHhkZCkge09VSSAweDAwLCAweDBhLCAweGY1fQordHlwZWRlZiBzdHJ1Y3Qgc0RvdDExZklFQWlyZ28geworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICBwcmVzZW50OworICAgIHREb3QxMWZJRVByb3BTdXBwUmF0ZXMgICAgICBQcm9wU3VwcFJhdGVzOworICAgIHREb3QxMWZJRUFQTmFtZSAgICAgICAgICAgICBBUE5hbWU7CisgICAgdERvdDExZklFSENGICAgICAgICAgICAgICAgIEhDRjsKKyAgICB0RG90MTFmSUVXRFMgICAgICAgICAgICAgICAgV0RTOworICAgIHREb3QxMWZJRUJQSW5kaWNhdG9yICAgICAgICBCUEluZGljYXRvcjsKKyAgICB0RG90MTFmSUVMb2FkSW5mbyAgICAgICAgICAgTG9hZEluZm87CisgICAgdERvdDExZklFTG9hZEJhbGFuY2UgICAgICAgIExvYWRCYWxhbmNlOworICAgIHREb3QxMWZJRVByb3BBc3NvY1R5cGUgICAgICBQcm9wQXNzb2NUeXBlOworICAgIHREb3QxMWZJRUxMQXR0ciAgICAgICAgICAgICBMTEF0dHI7CisgICAgdERvdDExZklFUHJvcENhcGFiaWxpdHkgICAgIFByb3BDYXBhYmlsaXR5OworICAgIHREb3QxMWZJRVZlcnNpb24gICAgICAgICAgICBWZXJzaW9uOworICAgIHREb3QxMWZJRVByb3BFRENBUGFyYW1zICAgICBQcm9wRURDQVBhcmFtczsKKyAgICB0RG90MTFmSUVUaXRhbiAgICAgICAgICAgICAgVGl0YW47CisgICAgdERvdDExZklFUHJvcENoYW5uU3dpdGNoQW5uIFByb3BDaGFublN3aXRjaEFubjsKKyAgICB0RG90MTFmSUVQcm9wUXVpZXRCU1MgICAgICAgUHJvcFF1aWV0QlNTOworICAgIHREb3QxMWZJRVRyaWdnZXJTdGFCZ1NjYW4gICBUcmlnZ2VyU3RhQmdTY2FuOworICAgIHREb3QxMWZJR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GlmIC8qIEMrKyAqLwordEFOSV9VMzIgZG90MTFmVW5wYWNrSWVEU1BhcmFtcyh0cEFuaVNpckdsb2JhbCwgdEFOSV9VOCosdEFOSV9VOCwgdERvdDExZklFRFNQYXJhbXMqKTsKKwordEFOSV9VMzIgZG90MTFmUGFja0llRFNQYXJhbXModHBBbmlTaXJHbG9iYWwsIHREb3QxMWZJRURTUGFyYW1zKiwgdEFOSV9VOCosIHRBTklfVTMyLCB0QU5JX1UzMiopOworCit0QU5JX1UzMiBkb3QxMWZHZXRQYWNrZWRJRURTUGFyYW1zKHRwQW5pU2lyR2xvYmFsLCB0RG90MTFmSUVEU1BhcmFtcyosIHRBTklfVTMyKik7CisKKyNpZmRlZiBfX2NwbHVzcGx1cworfTsgLyogRW5kIGV4dGVybiAiQyIuICovCisjZW5kaWYgLyogQysrICovCisvLyBFSUQgMTIgKDB4MGMpCit0eXBlZGVmIHN0cnVjdCBzRG90MTFmSUVFRENBUGFyYW1TZXQgeworICAgIHRBTklfVTggICAgICBwcmVzZW50OworICAgIHRBTklfVTggICAgICBxb3M7CisgICAgdEFOSV9VOCAgICAgIHJlc2VydmVkOworICAgIHRBTklfVTggICAgICAgYWNiZV9haWZzbjogNDsKKyAgICB0QU5JX1U4ICAgICAgICAgYWNiZV9hY206IDE7CisgICAgdEFOSV9VOCAgICAgICAgIGFjYmVfYWNpOiAyOworICAgIHRBTklfVTggICAgICAgICAgdW51c2VkMTogMTsKKyAgICB0QU5JX1U4ICAgICAgYWNiZV9hY3dtaW46IDQ7CisgICAgdEFOSV9VOCAgICAgIGFjYmVfYWN3bWF4OiA0OworICAgIHRBTklfVTE2ICAgICBhY2JlX3R4b3BsaW1pdDsKKyAgICB0QU5JX1U4ICAgICAgIGFjYmtfYWlmc246IDQ7CisgICAgdEFOSV9VOCAgICAgICAgIGFjYmtfYWNtOiAxOworICAgIHRBTklfVTggICAgICAgICBhY2JrX2FjaTogMjsKKyAgICB0QU5JX1U4ICAgICAgICAgIHVudXNlZDI6IDE7CisgICAgdEFOSV9VOCAgICAgIGFjYmtfYWN3bWluOiA0OworICAgIHRBTklfVTggICAgICBhY2JrX2Fjd21heDogNDsKKyAgICB0QU5JX1UxNiAgICAgYWNia190eG9wbGltaXQ7CisgICAgdEFOSV9VOCAgICAgICBhY3ZpX2FpZnNuOiA0OworICAgIHRBTklfVTggICAgICAgICBhY3ZpX2FjbTogMTsKKyAgICB0QU5JX1U4ICAgICAgICAgYWN2aV9hY2k6IDI7CisgICAgdEFOSV9VOCAgICAgICAgICB1bnVzZWQzOiAxOworICAgIHRBTklfVTggICAgICBhY3ZpX2Fjd21pbjogNDsKKyAgICB0QU5JX1U4ICAgICAgYWN2aV9hY3dtYXg6IDQ7CisgICAgdEFOSV9VMTYgICAgIGFjdmlfdHhvcGxpbWl0OworICAgIHRBTklfVTggICAgICAgYWN2b19haWZzbjogNDsKKyAgICB0QU5JX1U4ICAgICAgICAgYWN2b19hY206IDE7CisgICAgdEFOSV9VOCAgICAgICAgIGFjdm9fYWNpOiAyOworICAgIHRBTklfVTggICAgICAgICAgdW51c2VkNDogMTsKKyAgICB0QU5JX1U4ICAgICAgYWN2b19hY3dtaW46IDQ7CisgICAgdEFOSV9VOCAgICAgIGFjdm9fYWN3bWF4OiA0OworICAgIHRBTklfVTE2ICAgICBhY3ZvX3R4b3BsaW1pdDsKK30gdERvdDExZklFRURDQVBhcmFtU2V0OworCisjZGVmaW5lIERPVDExRl9FSURfRURDQVBBUkFNU0VUICggMTIgKQorCisvLyBOLkIuIFRoZXNlICNkZWZpbmVzIGRvICpub3QqIGluY2x1ZGUgdGhlIEVJRCAmIGxlbmd0aAorI2RlZmluZSBET1QxMUZfSUVfRURDQVBBUkFNU0VUX01JTl9MRU4gKCAxOCApCisKKyNkZWZpbmUgRE9UMTFGX0lFX0VEQ0FQQVJBTVNFVF9NQVhfTEVOICggMTggKQorCisjaWZkZWYgX19jcGx1c3BsdXMKK2V4dGVybiAiQyIgeworI2VuZGlmIC8qIEMrKyAq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KyAgICB0QU5JX1UzMiAgICAgIGxvY1RyYWNraW5nOiAxOworICAgIHRBTklfVTMyICAgICAgICAgICAgICBGTVM6IDE7CisgICAgdEFOSV9VMzIgIHByb3h5QVJQU2VydmljZTogMTsKKyAgICB0QU5JX1UzMiBjb0xvY0ludGZSZXBvcnRpbmc6IDE7CisgICAgdEFOSV9VMzIgICAgICAgICBjaXZpY0xvYzogMTsKKyAgICB0QU5JX1UzMiAgICBnZW9zcGF0aWFsTG9jOiAxOworICAgIHRBTklfVTMyICAgICAgICAgICAgICBURlM6IDE7CisgICAgdEFOSV9VMzIgICAgIHdubVNsZWVwTW9kZTogMTsKKyAgICB0QU5JX1UzMiAgICAgdGltQnJvYWRjYXN0OiAxOworICAgIHRBTklfVTMyICAgIGJzc1RyYW5zaXRpb246IDE7CisgICAgdEFOSV9VMzIgICAgcW9zVHJhZmZpY0NhcDogMTsKKyAgICB0QU5JX1UzMiAgICAgICAgIGFjU3RhQ250OiAxOworICAgIHRBTklfVTMyICAgICAgIG11bHRpQlNTSUQ6IDE7CisgICAgdEFOSV9VMzIgICAgICAgdGltaW5nTWVhczogMTsKKyAgICB0QU5JX1UzMiAgICAgICAgY2hhblVzYWdlOiAxOworICAgIHRBTklfVTMyICAgICAgICAgc3NpZExpc3Q6IDE7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgIERNUzogMTsKKyAgICB0QU5JX1UzMiAgICAgVVRDVFNGT2Zmc2V0OiAxOworICAgIHRBTklfVTMyIFRETFNQZWVyVUFQU0RCdWZmZXJTVEE6IDE7CisgICAgdEFOSV9VMzIgIFRETFNQZWVyUFNNU3VwcDogMTsKKyAgICB0QU5JX1UzMiBURExTQ2hhbm5lbFN3aXRjaGluZzogMTsKKyAgICB0QU5JX1UzMiBpbnRlcndvcmtpbmdTZXJ2aWNlOiAxOworICAgIHRBTklfVTE2ICAgICAgICAgICBxb3NNYXA6IDE7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgIEVCUjogMTsKKyAgICB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IgZG90MTFmUGFja0llRkhQYXR0VGFibGUodHBBbmlTaXJHbG9iYWwsIHREb3QxMWZJRUZIUGF0dFRhYmxlKiwgdEFOSV9VOCosIHRBTklfVTMyLCB0QU5JX1UzMiopOworCit0QU5JX1UzMiBkb3QxMWZHZXRQYWNrZWRJRUZIUGF0dFRhYmxlKHRwQW5pU2lyR2xvYmFsLCB0RG90MTFmSUVGSFBhdHRUYWJsZSosIHRBTklfVTMyKik7CisKKyNpZmRlZiBfX2NwbHVzcGx1cworfTsgLyogRW5kIGV4dGVybiAiQyIuICovCisjZW5kaWYgLyogQysrICovCisvLyBFSUQgNTUgKDB4MzcpCit0eXBlZGVmIHN0cnVjdCBzRG90MTFmSUVGVEluZm8geworICAgIHRBTklfVTggICAgICAgICAgcHJlc2VudDsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICByZXNlcnZlZDogODsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgSUVDb3VudDogODsKKyAgICB0QU5JX1U4ICAgICAgICAgIE1JQ1sxNl07CisgICAgdEFOSV9VOCAgICAgICAgICBBbm9uY2VbMzJdOworICAgIHRBTklfVTggICAgICAgICAgU25vbmNlWzMyXTsKKyAgICB0RG90MTFmSUVSMUtIX0lEIFIxS0hfSUQ7CisgICAgdERvdDExZklFR1RLICAgICBHVEs7CisgICAgdERvdDExZklFUjBLSF9JRCBSMEtIX0lEOworICAgIHREb3QxMWZJRUlHVEsgICAgSUdUSzsKK30gdERvdDExZklFRlRJbmZvOworCisjZGVmaW5lIERPVDExRl9FSURfRlRJTkZPICggNTUgKQorCisvLyBOLkIuIFRoZXNlICNkZWZpbmVzIGRvICpub3QqIGluY2x1ZGUgdGhlIEVJRCAmIGxlbmd0aAorI2RlZmluZSBET1QxMUZfSUVfRlRJTkZPX01JTl9MRU4gKCA4MiApCisKKyNkZWZpbmUgRE9UMTFGX0lFX0ZUSU5GT19NQVhfTEVOICggMjIwICkKKworI2lmZGVmIF9fY3BsdXNwbHVzCitleHRlc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hcDogMTsKKyAgICB0QU5JX1UxNiBzdXBwb3J0ZWRDaGFubmVsV2lkdGhTZXQ6IDE7CisgICAgdEFOSV9VMTYgICAgbWltb1Bvd2VyU2F2ZTogMjsKKyAgICB0QU5JX1UxNiAgICAgICBncmVlbkZpZWxkOiAxOworICAgIHRBTklfVTE2ICAgICBzaG9ydEdJMjBNSHo6IDE7CisgICAgdEFOSV9VMTYgICAgIHNob3J0R0k0ME1IejogMTsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgdHhTVEJDOiAxOworICAgIHRBTklfVTE2ICAgICAgICAgICByeFNUQkM6IDI7CisgICAgdEFOSV9VMTYgICAgICAgIGRlbGF5ZWRCQTogMTsKKyAgICB0QU5JX1UxNiBtYXhpbWFsQU1TRFVzaXplOiAxOworICAgIHRBTklfVTE2IGRzc3NDY2tNb2RlNDBNSHo6IDE7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgcHNtcDogMTsKKyAgICB0QU5JX1UxNiBzdGJjQ29udHJvbEZyYW1lOiAxOworICAgIHRBTklfVTE2IGxzaWdUWE9QUHJvdGVjdGlvbjogMTsKKyAgICB0QU5JX1U4IG1heFJ4QU1QRFVGYWN0b3I6IDI7CisgICAgdEFOSV9VOCAgICAgIG1wZHVEZW5zaXR5OiAzOworICAgIHRBTklfVTggICAgICAgIHJlc2VydmVkMTogMzsKKyAgICB0QU5JX1U4ICAgICAgc3VwcG9ydGVkTUNTU2V0WzE2XTsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgcGNvOiAxOworICAgIHRBTklfVTE2ICAgdHJhbnNpdGlvblRpbWU6IDI7CisgICAgdEFOSV9VMTYgICAgICAgIHJlc2VydmVkMjogNTsKKyAgICB0QU5JX1UxNiAgICAgIG1jc0ZlZWRiYWNrOiAyOworICAgIHRBTklfVTE2ICAgICAgICByZXNlcnZlZDM6IDY7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgdHhCRjogMTsKKyAgICB0QU5JX1UzMiByeFN0YWdnZX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yNlbmRpZiAvKiBDKysgKi8KK3RBTklfVTMyIGRvdDExZlVucGFja0llTGlua0lkZW50aWZpZXIodHBBbmlTaXJHbG9iYWwsIHRBTklfVTgqLHRBTklfVTgsIHREb3QxMWZJRUxpbmtJZGVudGlmaWVyKik7CisKK3RBTklfVTMyIGRvdDExZlBhY2tJZUxpbmtJZGVudGlmaWVyKHRwQW5pU2lyR2xvYmFsLCB0RG90MTFmSUVMaW5rSWRlbnRpZmllciosIHRBTklfVTgqLCB0QU5JX1UzMiwgdEFOSV9VMzIqKTsKKwordEFOSV9VMzIgZG90MTFmR2V0UGFja2VkSUVMaW5rSWRlbnRpZmllcih0cEFuaVNpckdsb2JhbCwgdERvdDExZklFTGlua0lkZW50aWZpZXIqLCB0QU5JX1UzMiopOworCisjaWZkZWYgX19jcGx1c3BsdXMKK307IC8qIEVuZCBleHRlcm4gIkMiLiAqLworI2VuZGlmIC8qIEMrKyAqLworLy8gRUlEIDM5ICgweDI3KQordHlwZWRlZiBzdHJ1Y3Qgc0RvdDExZklFTWVhc3VyZW1lbnRSZXBvcnQgeworICAgIHRBTklfVTggICAgICBwcmVzZW50OworICAgIHRBTklfVTggICAgICB0b2tlbjsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgIGxhdGU6IDE7CisgICAgdEFOSV9VOCAgICAgICAgaW5jYXBhYmxlOiAxOworICAgIHRBTklfVTggICAgICAgICAgcmVmdXNlZDogMTsKKyAgICB0QU5JX1U4ICAgICAgICAgICB1bnVzZWQ6IDU7CisgICAgdEFOSV9VOCAgICAgIHR5cGU7CisgICAgdW5pb24KKyAgICB7CisgICAgICAgIHN0cnVjdAorICAgICAgICB7CisgICAgICAgICAgICB0QU5JX1U4IGNoYW5uZWw7CisgICAgICAgICAgICB0RE9UMTFGX1U2NCBtZWFzX3N0YXJ0X3RpbWU7CisgICAgICAgICAgICB0QU5JX1UxNiBtZWFzX2R1cmF0aW9uOworICAgICAgICAgICAgdEFOSV9VOCAgICAgICAgICAgIGJzczogMTsKKyAgICAgICAgICAgIHRBTklfVTggIG9mZG1fcHJlYW1ibGU6IDE7CisgICAgICAgICAgICB0QU5JX1U4ICAgIHVuaWRfc2lnbmFsOiAxOworICAgICAgICAgICAgdEFOSV9VOCAgICAgICAgICByYWRlcjogMTsKKyAgICAgICAgICAgIHRBTklfVTggICAgIHVubWVhc3VyZWQ6IDE7CisgICAgICAgICAgICB0QU5JX1U4ICAgICAgICAgdW51c2VkOiAzOworICAgICAgICB9IEJhc2ljOyAvKiB0eXBlID0gMCAqLworICAgICAgICBzdHJ1Y3QKKyAgICAgICAgeworICAgICAgICAgICAgdEFOSV9VOCBjaGFubmVsOworICAgICAgICAgICAgdERPVDExRl9VNjQgbWVhc19zdGFydF90aW1lOworICAgICAgICAgICAgdEFOSV9VMTYgbWVhc19kdXJhdGlvbjsKKyAgICAgICAgICAgIHRBTklfVTggY2NhX2J1c3lfZnJhY3Rpb247CisgICAgICAgIH0gQ0NBOyAvKiB0eXBlID0gMSAqLworICAgICAgICBzdHJ1Y3QKKyAgICAgICAgeworICAgICAgICAgICAgdEFOSV9VOCBjaGFubmVsOworICAgICAgICAgICAgdERPVDExRl9VNjQgbWVhc19zdGFydF90aW1lOworICAgICAgICAgICAgdEFOSV9VMTYgbWVhc19kdXJhdGlvbjsKKyAgICAgICAgICAgIHRBTklfVTggcnBpMF9kZW5zaXR5OworICAgICAgICAgICAgdEFOSV9VOCBycGkxX2RlbnNpdHk7CisgICAgICAgICAgICB0QU5JX1U4IHJwaTJfZGVuc2l0eTsKKyAgICAgICAgICAgIHRBTklfVTggcnBpM19kZW5zaXR5OworICAgICAgICAgICAgdEFOSV9VOCBycGk0X2RlbnNpdHk7CisgICAgICAgICAgICB0QU5JX1U4IHJwaTVfZGVuc2l0eTsKKyAgICAgICAgICAgIHRBTklfVTggcnBpNl9kZW5zaXR5OworICAgICAgICAgICAgdEFOSV9VOCBycGk3X2RlbnNpdHk7CisgICAgICAgIH0gUlBJSGlzdG9ncmFtOyAvKiB0eXBlID0gMiAqLworICAgICAgICBzdHJ1Y3QKKyAgICAgICAgeworICAgICAgICAgICAgdEFOSV9VOCByZWdDbGFzczsKKyAgICAgICAgICAgIHRBTklfVTggY2hhbm5lbDsKKyAgICAgICAgICAgIHRET1QxMUZfVTY0IG1lYXNfc3RhcnRfdGltZTsKKyAgICAgICAgICAgIHRBTklfVTE2IG1lYXNfZHVyYXRpb247CisgICAgICAgICAgICB0QU5JX1U4ICAgICAgICBjb25kZW5zZWRfUEhZOiA3OworICAgICAgICAgICAgdEFOSV9VOCAgcmVwb3J0ZWRfZnJhbWVfdHlwZTogMTsKKyAgICAgICAgICAgIHRBTklfVTggUkNQSTsKKyAgICAgICAgICAgIHRBTklfVTggUlNOSTsKKyAgICAgICAgICAgIHRBTklfVTggQlNTSURbNl07CisgICAgICAgICAgICB0QU5JX1U4IGFudGVubmFfaWQ7CisgICAgICAgICAgICB0QU5JX1UzMiBwYXJlbnRfVFNGOworICAgIHREb3QxMWZJRUJlYWNvblJlcG9ydEZybUJvZHkgQmVhY29uUmVwb3J0RnJtQm9keTsKKyAgICAgICAgfSBCZWFjb247IC8qIHR5cGUgPSA1ICovCisgICAgfSByZXBvcnQ7Cit9IHREb3QxMWZJRU1lYXN1cmVtZW50UmVwb3J0OworCisjZGVmaW5lIERPVDExRl9FSURfTUVBU1VSRU1FTlRSRVBPUlQgKCAzOSApCisKKy8vIE4uQi4gVGhlc2UgI2RlZmluZXMgZG8gKm5vdCogaW5jbHVkZSB0aGUgRUlEICYgbGVuZ3RoCisjZGVmaW5lIERPVDExRl9JRV9NRUFTVVJFTUVOVFJFUE9SVF9NSU5fTEVOICggMyApCisKKyNkZWZpbmUgRE9UMTFGX0lFX01FQVNVUkVNRU5UUkVQT1JUX01BWF9MRU4gKCAyOSApCisKKyNpZmRlZiBfX2NwbHVzcGx1cworZXh0ZXJuICJDIiB7CisjZW5kaWYgLyogQysrICovCit0QU5JX1UzMiBkb3QxMWZVbnBhY2tJZU1lYXN1cmVtZW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W1lWzhdOworICAgICAgICAgICAgdEFOSV9VMTYgbWVhc19kdXJhdGlvbjsKKyAgICAgICAgfSBCYXNpYzsgLyogbWVhc3VyZW1lbnRfdHlwZSA9IDAgKi8KKyAgICAgICAgc3RydWN0CisgICAgICAgIHsKKyAgICAgICAgICAgIHRBTklfVTggY2hhbm5lbF9ubzsKKyAgICAgICAgICAgIHRBTklfVTggbWVhc19zdGFydF90aW1lWzhdOworICAgICAgICAgICAgdEFOSV9VMTYgbWVhc19kdXJhdGlvbjsKKyAgICAgICAgfSBDQ0E7IC8qIG1lYXN1cmVtZW50X3R5cGUgPSAxICovCisgICAgICAgIHN0cnVjdAorICAgICAgICB7CisgICAgICAgICAgICB0QU5JX1U4IGNoYW5uZWxfbm87CisgICAgICAgICAgICB0QU5JX1U4IG1lYXNfc3RhcnRfdGltZVs4XTsKKyAgICAgICAgICAgIHRBTklfVTE2IG1lYXNfZHVyYXRpb247CisgICAgICAgIH0gUlBJSGlzdG9ncmFtOyAvKiBtZWFzdXJlbWVudF90eXBlID0gMiAqLworICAgICAgICBzdHJ1Y3QKKyAgICAgICAgeworICAgICAgICAgICAgdEFOSV9VOCByZWdDbGFzczsKKyAgICAgICAgICAgIHRBTklfVTggY2hhbm5lbDsKKyAgICAgICAgICAgIHRBTklfVTE2IHJhbmRvbWl6YXRpb247CisgICAgICAgICAgICB0QU5JX1UxNiBtZWFzX2R1cmF0aW9uOworICAgICAgICAgICAgdEFOSV9VOCBtZWFzX21vZGU7CisgICAgICAgICAgICB0QU5JX1U4IEJTU0lEWzZdOworICAgIHREb3QxMWZJRVNTSUQgU1NJRDsKKyAgICB0RG90MTFmSUVCZWFjb25SZXBvcnRpbmcgQmVhY29uUmVwb3J0aW5nOworICAgIHREb3QxMWZJRUJjblJlcG9ydGluZ0RldGFpbCBCY25SZXBvcnRpbmdEZXRhaWw7CisgICAgdERvdDExZklFUmVxdWVzdGVkSW5mbyBSZXF1ZXN0ZWRJbmZvOworICAgIHRBTklfVTE2IG51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Kik7CisKKyNpZmRlZiBfX2NwbHVzcGx1cworfTsgLyogRW5kIGV4dGVybiAiQyIuICovCisjZW5kaWYgLyogQysrICovCisvLyBFSUQgNTIgKDB4MzQpCit0eXBlZGVmIHN0cnVjdCBzRG90MTFmSUVOZWlnaGJvclJlcG9ydCB7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgICBwcmVzZW50OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgYnNzaWRbNl07CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICBBUFJlYWNoYWJpbGl0eTogMjsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgICAgIFNlY3VyaXR5OiAxOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgICAgS2V5U2NvcGU6IDE7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgICBTcGVjTWdtdENhcDogMTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgICAgICAgUW9zQ2FwOiAxOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwc2Q6IDE7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJybTogMTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgICAgRGVsYXllZEJBOiAxOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgICAgICAgSW1tQkE6IDE7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICBNb2JpbGl0eURvbWFpbjogMTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgICAgIHJlc2VydmVkOiA1OworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgICAgICAgcmVzZXJ2ZWQxOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgcmVndWxhdG9yeUNsYXNzOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbDsKKyAgICB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Kik7CisKKyNpZmRlZiBfX2NwbHVzcGx1cworfTsgLyogRW5kIGV4dGVybiAiQyIuICovCisjZW5kaWYgLyogQysrICovCisvLyBFSUQgMzMgKDB4MjEpCit0eXBlZGVmIHN0cnVjdCBzRG90MTFmSUVQb3dlckNhcHMgeworICAgIHRBTklfVTggICAgICBwcmVzZW50OworICAgIHRBTklfVTggICAgICBtaW5UeFBvd2VyOworICAgIHRBTklfVTggICAgICBtYXhUeFBvd2VyOworfSB0RG90MTFmSUVQb3dlckNhcHM7CisKKyNkZWZpbmUgRE9UMTFGX0VJRF9QT1dFUkNBUFMgKCAzMyApCisKKy8vIE4uQi4gVGhlc2UgI2RlZmluZXMgZG8gKm5vdCogaW5jbHVkZSB0aGUgRUlEICYgbGVuZ3RoCisjZGVmaW5lIERPVDExRl9JRV9QT1dFUkNBUFNfTUlOX0xFTiAoIDIgKQorCisjZGVmaW5lIERPVDExRl9JRV9QT1dFUkNBUFNfTUFYX0xFTiAoIDIgKQorCisjaWZkZWYgX19jcGx1c3BsdXMKK2V4dGVybiAiQyIgeworI2VuZGlmIC8qIEMrKyAqLwordEFOSV9VMzIgZG90MTFmVW5wYWNrSWVQb3dlckNhcHModHBBbmlTaXJHbG9iYWwsIHRBTklfVTgqLHRBTklfVTgsIHREb3QxMWZJRVBvd2VyQ2FwcyopOworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVQb3dlckNhcHModHBBbmlTaXJHbG9iYWwsIHREb3QxMWZJRVBvd2VyQ2FwcyosIHRBTklfVTgqLCB0QU5JX1UzMiwgdEFOSV9VMzIqKTsKKwordEFOSV9VMzIgZG90MTFmR2V0UGFja2VkSUVQb3dlckNhcHModHBBbmlTaXJHbG9iYWwsIHREb3QxMWZJRVBvd2VyQ2FwcyosIHRBTklfVTMyKik7CisKKyNpZmRlZiBfX2NwbHVzcGx1cworfTsgLyogRW5kIGV4dGVybiAiQyIuICovCisjZW5kaWYgLyogQysrICovCisvLyBFSUQgMzIgKDB4MjApCit0eXB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U5JX1UxNiAgICAgICAgICAgICAgIG51bV9UQ0xBUzsKKyAgICB0RG90MTFmSUVUQ0xBUyAgICAgICAgIFRDTEFTWzJdOworICAgIHREb3QxMWZJRVRDTEFTU1BST0MgICAgVENMQVNTUFJPQzsKKyAgICB0RG90MTFmSUVUU0RlbGF5ICAgICAgIFRTRGVsYXk7CisgICAgdERvdDExZklFU2NoZWR1bGUgICAgICBTY2hlZHVsZTsKKyAgICB0RG90MTFmSUVXTU1UU1BFQyAgICAgIFdNTVRTUEVDOworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgbnVtX1dNTVRDTEFTOworICAgIHREb3QxMWZJRVdNTVRDTEFTICAgICAgV01NVENMQVNbMl07CisgICAgdERvdDExZklFV01NVENMQVNQUk9DICBXTU1UQ0xBU1BST0M7CisgICAgdERvdDExZklFV01NVFNEZWxheSAgICBXTU1UU0RlbGF5OworICAgIHREb3QxMWZJRVdNTVNjaGVkdWxlICAgV01NU2NoZWR1bGU7Cit9IHREb3QxMWZJRVJJQ0RhdGFEZXNjOworCisjZGVmaW5lIERPVDExRl9FSURfUklDREFUQURFU0MgKCA1NyApCisKKy8vIE4uQi4gVGhlc2UgI2RlZmluZXMgZG8gKm5vdCogaW5jbHVkZSB0aGUgRUlEICYgbGVuZ3RoCisjZGVmaW5lIERPVDExRl9JRV9SSUNEQVRBREVTQ19NSU5fTEVOICggMCApCisKKyNkZWZpbmUgRE9UMTFGX0lFX1JJQ0RBVEFERVNDX01BWF9MRU4gKCA1NDggKQorCisjaWZkZWYgX19jcGx1c3BsdXMKK2V4dGVybiAiQyIgeworI2VuZGlmIC8qIEMrKyAqLwordEFOSV9VMzIgZG90MTFmVW5wYWNrSWVSSUNEYXRhRGVzYyh0cEFuaVNpckdsb2JhbCwgdEFOSV9VOCosdEFOSV9VOCwgdERvdDExZklFUklDRGF0YURlc2MqKTsKKwordEFOSV9VMzIgZG90MTFmUGFja0llUklDRGF0YURlc2ModHBBbmlTaXJHbG9iYWwsIHREb3QxMWZJRVJJQ0RhdGFEZXNjKiwgdEFOSV9VOCosIHRBTklfVTMyLCB0QU5JX1UzMiopOworCit0QU5JX1UzMiBkb3QxMWZHZXRQYWNrZWRJRVJJQ0RhdGFEZXNjKHRwQW5pU2lyR2xvYmFsLCB0RG90MTFmSUVSSUNEYXRhRGVzYyosIHRBTklfVTMyKik7CisKKyNpZmRlZiBfX2NwbHVzcGx1cworfTsgLyogRW5kIGV4dGVybiAiQyIuICovCisjZW5kaWYgLyogQysrICovCisvLyBFSUQgNDggKDB4MzApCit0eXBlZGVmIHN0cnVjdCBzRG90MTFmSUVSU04geworICAgIHRBTklfVTggICAgICBwcmVzZW50OworICAgIHRBTklfVTE2ICAgICB2ZXJzaW9uIC8qIE11c3QgYmUgMSEgKi87CisgICAgdEFOSV9VOCAgICAgIGdwX2NpcGhlcl9zdWl0ZVs0XTsKKyAgICB0QU5JX1UxNiAgICAgcHdpc2VfY2lwaGVyX3N1aXRlX2NvdW50OworICAgIHRBTklfVTggICAgICBwd2lzZV9jaXBoZXJfc3VpdGVzWzRdWzRdOworICAgIHRBTklfVTE2ICAgICBha21fc3VpdGVfY291bnQ7CisgICAgdEFOSV9VOCAgICAgIGFrbV9zdWl0ZXNbNF1bNF07CisgICAgdEFOSV9VOCAgICAgIFJTTl9DYXBbMl07CisgICAgdEFOSV9VMTYgICAgIHBta2lkX2NvdW50OworICAgIHRBTklfVTggICAgICBwbWtpZFs0XVsxNl07CisgICAgdEFOSV9VOCAgICAgIGdwX21nbXRfY2lwaGVyX3N1aXRlWzRdOworfSB0RG90MTFmSUVSU047CisKKyNkZWZpbmUgRE9UMTFGX0VJRF9SU04gKCA0OCApCisKKy8vIE4uQi4gVGhlc2UgI2RlZmluZXMgZG8gKm5vdCogaW5jbHVkZSB0aGUgRUlEICYgbGVuZ3RoCisjZGVmaW5lIERPVDExRl9JRV9SU05fTUlOX0xFTiAoIDYgKQorCisjZGVmaW5lIERPVDExRl9JRV9SU05fTUFYX0xFTiAoIDExN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ZG90MTFmR2V0UGFja2VkSUVTdXBwT3BlcmF0aW5nQ2xhc3Nlcyh0cEFuaVNpckdsb2JhbCwgdERvdDExZklFU3VwcE9wZXJhdGluZ0NsYXNzZXMqLCB0QU5JX1UzMiopOworCisjaWZkZWYgX19jcGx1c3BsdXMKK307IC8qIEVuZCBleHRlcm4gIkMiLiAqLworI2VuZGlmIC8qIEMrKyAqLworLy8gRUlEIDEgKDB4MDEpCit0eXBlZGVmIHN0cnVjdCBzRG90MTFmSUVTdXBwUmF0ZXMgeworICAgIHRBTklfVTggICAgICBwcmVzZW50OworICAgIHRBTklfVTggICAgICBudW1fcmF0ZXM7CisgICAgdEFOSV9VOCAgICAgIHJhdGVzWzEyXTsKK30gdERvdDExZklFU3VwcFJhdGVzOworCisjZGVmaW5lIERPVDExRl9FSURfU1VQUFJBVEVTICggMSApCisKKy8vIE4uQi4gVGhlc2UgI2RlZmluZXMgZG8gKm5vdCogaW5jbHVkZSB0aGUgRUlEICYgbGVuZ3RoCisjZGVmaW5lIERPVDExRl9JRV9TVVBQUkFURVNfTUlOX0xFTiAoIDAgKQorCisjZGVmaW5lIERPVDExRl9JRV9TVVBQUkFURVNfTUFYX0xFTiAoIDEyICkKKworI2RlZmluZSBET1QxMUZfSVNfQkdfUkFURShfeCkgICgoKF94KSA9PSAwMikgfHwgXAorICAgICAgICAgICAgICAgICAgICAgICgoX3gpID09IDA0KSB8fCBcCisgICAgICAgICAgICAgICAgICAgICAgKChfeCkgPT0gMTEpIHx8IFwKKyAgICAgICAgICAgICAgICAgICAgICAoKF94KSA9PSAyMikgfHwgXAorICAgICAgICAgICAgICAgICAgICAgICgoX3gpID09IDEyKSB8fCBcCisgICAgICAgICAgICAgICAgICAgICAgKChfeCkgPT0gMTgpIHx8IFwKKyAgICAgICAgICAgICAgICAgICAgICAoKF94KSA9PSAyNCkgfHwgXAorICAgICAgICAgICAgICAgICAgICAgICgoX3gpID09IDM2KSB8fCBcCisgICAgICAgICAgICAgICAgICAgICAgKChfeCkgPT0gNDgpIHx8IFwKKyAgICAgICAgICAgICAgICAgICAgICAoKF94KSA9PSA3MikgfHwgXAorICAgICAgICAgICAgICAgICAgICAgICgoX3gpID09IDk2KSB8fCBcCisgICAgICAgICAgICAgICAgICAgICAgKChfeCkgPT0gMTA4KSkgIAorCisjaWZkZWYgX19jcGx1c3BsdXMKK2V4dGVybiAiQyIgeworI2VuZGlmIC8qIEMrKyAqLwordEFOSV9VMzIgZG90MTFmVW5wYWNrSWVTdXBwUmF0ZXModHBBbmlTaXJHbG9iYWwsIHRBTklfVTgqLHRBTklfVTgsIHREb3QxMWZJRVN1cHBSYXRlcyopOworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVTdXBwUmF0ZXModHBBbmlTaXJHbG9iYWwsIHREb3QxMWZJRVN1cHBSYXRlcyosIHRBTklfVTgqLCB0QU5JX1UzMiwgdEFOSV9VMzIqKTsKKwordEFOSV9VMzIgZG90MTFmR2V0UGFja2VkSUVTdXBwUmF0ZXModHBBbmlTaXJHbG9iYWwsIHREb3QxMWZJRVN1cHBSYXRlcyosIHRBTklfVTMyKik7CisKKyNpZmRlZiBfX2NwbHVzcGx1cworfTsgLyogRW5kIGV4dGVybiAiQyIuICovCisjZW5kaWYgLyogQysrICovCisvLyBFSUQgNSAoMHgwNSkKK3R5cGVkZWYgc3RydWN0IHNEb3QxMWZJRVRJTSB7CisgICAgdEFOSV9VOCAgICAgIHByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgIGR0aW1fY291bnQ7CisgICAgdEFOSV9VOCAgICAgIGR0aW1fcGVyaW9kOworICAgIHRBTklfVTggICAgICBibXBjdGw7CisgICAgdEFOSV9VOCAgICAgIG51bV92Ym1wOworICAgIHRBTklfVTggICAgICB2Ym1wWzI1MV07Cit9IHREb3QxMWZJRVRJTTsKKworI2RlZmluZSBET1QxMUZfRUlEX1RJTSAoIDUgKQorCisvLyBOLkIuIFRoZXNlICNkZWZpbmVzIGRvICpub3QqIGluY2x1ZGUgdGh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yAgICB0QU5JX1U4ICAgICAgIGFjYmVfYWlmc246IDQ7CisgICAgdEFOSV9VOCAgICAgICAgIGFjYmVfYWNtOiAxOworICAgIHRBTklfVTggICAgICAgICBhY2JlX2FjaTogMjsKKyAgICB0QU5JX1U4ICAgICAgICAgIHVudXNlZDE6IDE7CisgICAgdEFOSV9VOCAgICAgIGFjYmVfYWN3bWluOiA0OworICAgIHRBTklfVTggICAgICBhY2JlX2Fjd21heDogNDsKKyAgICB0QU5JX1UxNiAgICAgYWNiZV90eG9wbGltaXQ7CisgICAgdEFOSV9VOCAgICAgICBhY2JrX2FpZnNuOiA0OworICAgIHRBTklfVTggICAgICAgICBhY2JrX2FjbTogMTsKKyAgICB0QU5JX1U4ICAgICAgICAgYWNia19hY2k6IDI7CisgICAgdEFOSV9VOCAgICAgICAgICB1bnVzZWQyOiAxOworICAgIHRBTklfVTggICAgICBhY2JrX2Fjd21pbjogNDsKKyAgICB0QU5JX1U4ICAgICAgYWNia19hY3dtYXg6IDQ7CisgICAgdEFOSV9VMTYgICAgIGFjYmtfdHhvcGxpbWl0OworICAgIHRBTklfVTggICAgICAgYWN2aV9haWZzbjogNDsKKyAgICB0QU5JX1U4ICAgICAgICAgYWN2aV9hY206IDE7CisgICAgdEFOSV9VOCAgICAgICAgIGFjdmlfYWNpOiAyOworICAgIHRBTklfVTggICAgICAgICAgdW51c2VkMzogMTsKKyAgICB0QU5JX1U4ICAgICAgYWN2aV9hY3dtaW46IDQ7CisgICAgdEFOSV9VOCAgICAgIGFjdmlfYWN3bWF4OiA0OworICAgIHRBTklfVTE2ICAgICBhY3ZpX3R4b3BsaW1pdDsKKyAgICB0QU5JX1U4ICAgICAgIGFjdm9fYWlmc246IDQ7CisgICAgdEFOSV9VOCAgICAgICAgIGFjdm9fYWNtOiAxOworICAgIHRBTklfVTggICAgICAgICBhY3ZvX2FjaTogMjsKKyAgICB0QU5JX1U4ICAgICAgICAgIHVudXNlZDQ6IDE7CisgICAgdEFOSV9VOCAgICAg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ioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBGcmFtZXMKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIHN0cnVjdCBzRG90MTFmQWRkQkFSZXF7CisgICAgdERvdDExZkZmQ2F0ZWdvcnkgICAgICAgICAgICAgICAgICBDYXRlZ29yeTsKKyAgICB0RG90MTFmRmZBY3Rpb24gICAgICAgICAgICAgICAgICAgIEFjdGlvbjsKKyAgICB0RG90MTFmRmZEaWFsb2dUb2tlbiAgICAgICAgICAgICAgIERpYWxvZ1Rva2VuOworICAgIHREb3QxMWZGZkFkZEJBUGFyYW1ldGVyU2V0ICAgICAgICAgQWRkQkFQYXJhbWV0ZXJTZXQ7CisgICAgdERvdDExZkZmQkFUaW1lb3V0ICAgICAgICAgICAgICAgICBCQVRpbWVvdXQ7CisgICAgdERvdDExZkZmQkFTdGFydGluZ1NlcXVlbmNlQ29udHJvbCBCQVN0YXJ0aW5nU2VxdWVuY2VDb250cm9sOworfSB0RG90MTFmQWRkQkFSZXE7CisKKyNkZWZpbmUgRE9UMTFGX0FEREJBUkVRICggMSApCisKKyNpZmRlZiBfX2NwbHVzcGx1cworZXh0ZXJuICJDIiB7CisjZW5kaWYgLyogQysrICovCisKK3RBTklfVTMyIGRvdDExZlVucGFja0FkZEJBUmVxKHRwQW5pU2lyR2xvYmFsIHBDdHgsIHRBTklfVTggKnBCdWYsIHRBTklfVTMyIG5CdWYsIHREb3QxMWZBZGRCQVJlcSAqcEZybSk7Cit0QU5JX1UzMiBkb3QxMWZQYWNrQWRkQkFSZXEodHBBbmlTaXJHbG9iYWwgcEN0eCwgdERvdDExZkFkZEJBUmVxICpwRnJtLCB0QU5JX1U4ICpwQnVmLCB0QU5JX1UzMiBuQnVmLCB0QU5JX1UzMiAqcG5Db25zdW1lZCk7Cit0QU5JX1UzMiBkb3QxMWZHZXRQYWNrZWRBZGRCQVJlcV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xMWZBZGRCQVJzcCAqcEZybSwgdEFOSV9VMzIgKnBuTmVlZGVkKTsKKworI2lmZGVmIF9fY3BsdXNwbHVzCit9IC8qIEVuZCBleHRlcm4gIkMiLiAqLworI2VuZGlmIC8qIEMrKyAqLworCit0eXBlZGVmIHN0cnVjdCBzRG90MTFmQWRkVFNSZXF1ZXN0eworICAgIHREb3QxMWZGZkNhdGVnb3J5ICAgICAgICAgICBDYXRlZ29yeTsKKyAgICB0RG90MTFmRmZBY3Rpb24gICAgICAgICAgICAgQWN0aW9uOworICAgIHREb3QxMWZGZkRpYWxvZ1Rva2VuICAgICAgICBEaWFsb2dUb2tlbjsKKyAgICB0RG90MTFmSUVUU1BFQyAgICAgICAgICAgICAgVFNQRUM7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgICAgIG51bV9UQ0xBUzsKKyAgICB0RG90MTFmSUVUQ0xBUyAgICAgICAgICAgICAgVENMQVNbMl07CisgICAgdERvdDExZklFVENMQVNTUFJPQyAgICAgICAgIFRDTEFTU1BST0M7CisgICAgdERvdDExZklFV01NVFNQRUMgICAgICAgICAgIFdNTVRTUEVDOworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgICAgICBudW1fV01NVENMQVM7CisgICAgdERvdDExZklFV01NVENMQVMgICAgICAgICAgIFdNTVRDTEFTWzJdOworICAgIHREb3QxMWZJRVdNTVRDTEFTUFJPQyAgICAgICBXTU1UQ0xBU1BST0M7CisgICAgdERvdDExZklFRVNFVHJhZlN0cm1SYXRlU2V0IEVTRVRyYWZTdHJtUmF0ZVNldDsKK30gdERvdDExZkFkZFRTUmVxdWVzdDsKKworI2RlZmluZSBET1QxMUZfQUREVFNSRVFVRVNUICggMyApCisKKyNpZmRlZiBfX2NwbHVzcGx1cworZXh0ZXJuICJDIiB7CisjZW5kaWYgLyogQysrICovCisKK3RBTklfVTMyIGRvdDExZlVucGFja0FkZFRTUmVxdWVzdCh0cEFuaVNpckdsb2JhbCBwQ3R4LCB0QU5JX1U4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MWZGZkNhcGFiaWxpdGllcyAgICAgICBDYXBhYmlsaXRpZXM7CisgICAgdERvdDExZkZmU3RhdHVzICAgICAgICAgICAgIFN0YXR1czsKKyAgICB0RG90MTFmRmZBSUQgICAgICAgICAgICAgICAgQUlEOworICAgIHREb3QxMWZJRVN1cHBSYXRlcyAgICAgICAgICBTdXBwUmF0ZXM7CisgICAgdERvdDExZklFRXh0U3VwcFJhdGVzICAgICAgIEV4dFN1cHBSYXRlczsKKyAgICB0RG90MTFmSUVFRENBUGFyYW1TZXQgICAgICAgRURDQVBhcmFtU2V0OworICAgIHREb3QxMWZJRVJDUElJRSAgICAgICAgICAgICBSQ1BJSUU7CisgICAgdERvdDExZklFUlNOSUlFICAgICAgICAgICAgIFJTTklJRTsKKyAgICB0RG90MTFmSUVSUk1FbmFibGVkQ2FwICAgICAgUlJNRW5hYmxlZENhcDsKKyAgICB0RG90MTFmSUVNb2JpbGl0eURvbWFpbiAgICAgTW9iaWxpdHlEb21haW47CisgICAgdERvdDExZklFRlRJbmZvICAgICAgICAgICAgIEZUSW5mbzsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgICAgICAgbnVtX1JJQ0RhdGFEZXNjOworICAgIHREb3QxMWZJRVJJQ0RhdGFEZXNjICAgICAgICBSSUNEYXRhRGVzY1syXTsKKyAgICB0RG90MTFmSUVXUEEgICAgICAgICAgICAgICAgV1BBOworICAgIHREb3QxMWZJRVRpbWVvdXRJbnRlcnZhbCAgICBUaW1lb3V0SW50ZXJ2YWw7CisgICAgdERvdDExZklFSFRDYXBzICAgICAgICAgICAgIEhUQ2FwczsKKyAgICB0RG90MTFmSUVIVEluZm8gICAgICAgICAgICAgSFRJbmZvOworICAgIHREb3QxMWZJRVdNTVBhcmFtcyAgICAgICAgICBXTU1QYXJhbXM7CisgICAgdERvdDExZklFV01NQ2FwcyAgICAgICAgICAgIFdNTUNhcHM7CisgICAgdERvdDExZklFRVNFUmFkTWdtdENhcCAgICAgIEVTRVJhZE1nbXRDYXA7CisgICAgdERvdDExZklFRVNFVHJhZlN0cm1NZXQgICAgIEVTRVRyYWZTdHJtTWV0OworICAgIHREb3QxMWZJRUVTRVR4bWl0UG93ZXIgICAgICBFU0VUeG1pdFBvd2VyOworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgICAgICBudW1fV01NVFNQRUM7CisgICAgdERvdDExZklFV01NVFNQRUMgICAgICAgICAgIFdNTVRTUEVDWzRdOworICAgIHREb3QxMWZJRUFpcmdvICAgICAgICAgICAgICBBaXJnbzsKKyAgICB0RG90MTFmSUVXc2NBc3NvY1JlcyAgICAgICAgV3NjQXNzb2NSZXM7CisgICAgdERvdDExZklFUDJQQXNzb2NSZXMgICAgICAgIFAyUEFzc29jUmVzOworICAgIHREb3QxMWZJRVZIVENhcHMgICAgICAgICAgICBWSFRDYXBzOworICAgIHREb3QxMWZJRVZIVE9wZXJhdGlvbiAgICAgICBWSFRPcGVyYXRpb247CisgICAgdERvdDExZklFRXh0Q2FwICAgICAgICAgICAgIEV4dENhcDsKKyAgICB0RG90MTFmSUVPQlNTU2NhblBhcmFtZXRlcnMgT0JTU1NjYW5QYXJhbWV0ZXJzOworICAgIHREb3QxMWZJRVFvc01hcFNldCAgICAgICAgICBRb3NNYXBTZXQ7Cit9IHREb3QxMWZBc3NvY1Jlc3BvbnNlOworCisjZGVmaW5lIERPVDExRl9BU1NPQ1JFU1BPTlNFICggNiApCisKKyNpZmRlZiBfX2NwbHVzcGx1cworZXh0ZXJuICJDIiB7CisjZW5kaWYgLyogQysrICovCisKK3RBTklfVTMyIGRvdDExZlVucGFja0Fzc29jUmVzcG9uc2UodHBBbmlTaXJHbG9iYWwgcEN0eCwgdEFOSV9VOCAqcEJ1ZiwgdEFOSV9VMzIgbkJ1ZiwgdERvdDExZkFzc29jUmVzcG9uc2UgKnBGcm0pOwordEFOSV9VMzIgZG90MTFmUGFja0Fzc29jUmVzcG9uc2UodHBBbmlTaXJHbG9iYWwgcEN0eCwgdERvdDExZkFzc29jUmVzcG9uc2UgKnBGcm0sIHRBTklfVTggKnBCdWYsIHRBTklfVTMyIG5CdWYsIHRBTklfVTMyICpwbkNvbnN1bWVkKTsKK3RBTklfVTMyIGRvdDExZkdldFBhY2tlZEFzc29jUmVzcG9uc2VTaXplKHRwQW5pU2lyR2xvYmFsIHBDdHgsIHREb3QxMWZBc3NvY1Jlc3BvbnNlICpwRnJtLCB0QU5JX1UzMiAqcG5OZWVkZWQpOworCisjaWZkZWYgX19jcGx1c3BsdXMKK30gLyogRW5kIGV4dGVybiAiQyIuICovCisjZW5kaWYgLyogQysrICovCisKK3R5cGVkZWYgc3RydWN0IHNEb3QxMWZBdXRoZW50aWNhdGlvbnsKKyAgICB0RG90MTFmRmZBdXRoQWxnbyAgICAgICAgQXV0aEFsZ287CisgICAgdERvdDExZkZmQXV0aFNlcU5vICAgICAgIEF1dGhTZXFObzsKKyAgICB0RG90MTFmRmZTdGF0dXMgICAgICAgICAgU3RhdHVzOworICAgIHREb3QxMWZJRUNoYWxsZW5nZVRleHQgICBDaGFsbGVuZ2VUZXh0OworICAgIHREb3QxMWZJRVJTTk9wYXF1ZSAgICAgICBSU05PcGFxdWU7CisgICAgdERvdDExZklFTW9iaWxpdHlEb21haW4gIE1vYmlsaXR5RG9tYWluOworICAgIHREb3QxMWZJRUZUSW5mbyAgICAgICAgICBGVEluZm87CisgICAgdERvdDExZklFVGltZW91dEludGVydmFsIFRpbWVvdXRJbnRlcnZhbDsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgICAgbnVtX1JJQ0RhdGFEZXNjOworICAgIHREb3QxMWZJRVJJQ0RhdGFEZXNjICAgICBSSUNEYXRhRGVzY1syXTsKK30gdERvdDExZkF1dGhlbnRpY2F0aW9uOworCisjZGVmaW5lIERPVDExRl9BVVRIRU5USUNBVElPTiAoIDcgKQorCisjaWZkZWYgX19jcGx1c3BsdXMKK2V4dGVybiAiQyIgeworI2VuZGlmIC8qIEMrKyAqLworCit0QU5JX1UzMiBkb3QxMWZ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SUVJQlNTUGFyYW1zICAgICAgICAgICBJQlNTUGFyYW1zOworICAgIHREb3QxMWZJRVRJTSAgICAgICAgICAgICAgICAgIFRJTTsKKyAgICB0RG90MTFmSUVDb3VudHJ5ICAgICAgICAgICAgICBDb3VudHJ5OworICAgIHREb3QxMWZJRUZIUGFyYW1zICAgICAgICAgICAgIEZIUGFyYW1zOworICAgIHREb3QxMWZJRUZIUGF0dFRhYmxlICAgICAgICAgIEZIUGF0dFRhYmxlOworICAgIHREb3QxMWZJRVBvd2VyQ29uc3RyYWludHMgICAgIFBvd2VyQ29uc3RyYWludHM7CisgICAgdERvdDExZklFQ2hhblN3aXRjaEFubiAgICAgICAgQ2hhblN3aXRjaEFubjsKKyAgICB0RG90MTFmSUVRdWlldCAgICAgICAgICAgICAgICBRdWlldDsKKyAgICB0RG90MTFmSUVUUENSZXBvcnQgICAgICAgICAgICBUUENSZXBvcnQ7CisgICAgdERvdDExZklFRVJQSW5mbyAgICAgICAgICAgICAgRVJQSW5mbzsKKyAgICB0RG90MTFmSUVFeHRTdXBwUmF0ZXMgICAgICAgICBFeHRTdXBwUmF0ZXM7CisgICAgdERvdDExZklFUlNOICAgICAgICAgICAgICAgICAgUlNOOworICAgIHREb3QxMWZJRVFCU1NMb2FkICAgICAgICAgICAgIFFCU1NMb2FkOworICAgIHREb3QxMWZJRUVEQ0FQYXJhbVNldCAgICAgICAgIEVEQ0FQYXJhbVNldDsKKyAgICB0RG90MTFmSUVRT1NDYXBzQXAgICAgICAgICAgICBRT1NDYXBzQXA7CisgICAgdERvdDExZklFQVBDaGFubmVsUmVwb3J0ICAgICAgQVBDaGFubmVsUmVwb3J0OworICAgIHREb3QxMWZJRVJSTUVuYWJsZWRDYXAgICAgICAgIFJSTUVuYWJsZWRDYXA7CisgICAgdERvdDExZklFTW9iaWxpdHlEb21haW4gICAgICAgTW9iaWxpdHlEb21haW47CisgICAgdERvdDExZklFV1BBICAgICAgICAgICAgICAgICAgV1BBOworICAgIHREb3QxMWZJRUhUQ2FwcyAgICAgICAgICAgICAgIEhUQ2FwczsKKyAgICB0RG90MTFmSUVIVEluZm8gICAgICAgICAgICAgICBIVEluZm87CisgICAgdERvdDExZklFRXh0Q2hhblN3aXRjaEFubiAgICAgRXh0Q2hhblN3aXRjaEFubjsKKyAgICB0RG90MTFmSUVXTU1JbmZvQXAgICAgICAgICAgICBXTU1JbmZvQXA7CisgICAgdERvdDExZklFV01NUGFyYW1zICAgICAgICAgICAgV01NUGFyYW1zOworICAgIHREb3QxMWZJRVdNTUNhcHMgICAgICAgICAgICAgIFdNTUNhcHM7CisgICAgdERvdDExZklFV0FQSSAgICAgICAgICAgICAgICAgV0FQSTsKKyAgICB0RG90MTFmSUVFU0VSYWRNZ210Q2FwICAgICAgICBFU0VSYWRNZ210Q2FwOworICAgIHREb3QxMWZJRUVTRVRyYWZTdHJtTWV0ICAgICAgIEVTRVRyYWZTdHJtTWV0OworICAgIHREb3QxMWZJRUVTRVR4bWl0UG93ZXIgICAgICAgIEVTRVR4bWl0UG93ZXI7CisgICAgdERvdDExZklFQWlyZ28gICAgICAgICAgICAgICAgQWlyZ287CisgICAgdERvdDExZklFV3NjQmVhY29uICAgICAgICAgICAgV3NjQmVhY29uOworICAgIHREb3QxMWZJRVAyUEJlYWNvbiAgICAgICAgICAgIFAyUEJlYWNvbjsKKyAgICB0RG90MTFmSUVWSFRDYXBzICAgICAgICAgICAgICBWSFRDYXBzOworICAgIHREb3QxMWZJRVZIVE9wZXJhdGlvbiAgICAgICAgIFZIVE9wZXJhdGlvbjsKKyAgICB0RG90MTFmSUVWSFRFeHRCc3NMb2FkICAgICAgICBWSFRFeHRCc3NMb2FkOworICAgIHREb3QxMWZJRUV4dENhcCAgICAgICAgICAgICAgIEV4dENhcDsKKyAgICB0RG90MTFmSUVPcGVyYXRpbmdNb2RlICAgICAgICBPcGVyYXRpbmdNb2RlOworICAgIHREb3QxMWZJRVdpZGVyQldDaGFuU3dpdGNoQW5uIFdpZGVyQldDaGFuU3dp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gICAgICAgICAgICAgIEVSUEluZm87CisgICAgdERvdDExZklFRXh0U3VwcFJhdGVzICAgICAgICAgRXh0U3VwcFJhdGVzOworICAgIHREb3QxMWZJRVJTTk9wYXF1ZSAgICAgICAgICAgIFJTTk9wYXF1ZTsKKyAgICB0RG90MTFmSUVFRENBUGFyYW1TZXQgICAgICAgICBFRENBUGFyYW1TZXQ7CisgICAgdERvdDExZklFQVBDaGFubmVsUmVwb3J0ICAgICAgQVBDaGFubmVsUmVwb3J0OworICAgIHREb3QxMWZJRVJSTUVuYWJsZWRDYXAgICAgICAgIFJSTUVuYWJsZWRDYXA7CisgICAgdERvdDExZklFTW9iaWxpdHlEb21haW4gICAgICAgTW9iaWxpdHlEb21haW47CisgICAgdERvdDExZklFV1BBICAgICAgICAgICAgICAgICAgV1BBOworICAgIHREb3QxMWZJRUhUQ2FwcyAgICAgICAgICAgICAgIEhUQ2FwczsKKyAgICB0RG90MTFmSUVIVEluZm8gICAgICAgICAgICAgICBIVEluZm87CisgICAgdERvdDExZklFRXh0Q2hhblN3aXRjaEFubiAgICAgRXh0Q2hhblN3aXRjaEFubjsKKyAgICB0RG90MTFmSUVXTU1JbmZvQXAgICAgICAgICAgICBXTU1JbmZvQXA7CisgICAgdERvdDExZklFV01NUGFyYW1zICAgICAgICAgICAgV01NUGFyYW1zOworICAgIHREb3QxMWZJRVdNTUNhcHMgICAgICAgICAgICAgIFdNTUNhcHM7CisgICAgdERvdDExZklFQWlyZ28gICAgICAgICAgICAgICAgQWlyZ287CisgICAgdERvdDExZklFV3NjQmVhY29uICAgICAgICAgICAgV3NjQmVhY29uOworICAgIHREb3QxMWZJRVdBUEkgICAgICAgICAgICAgICAgIFdBUEk7CisgICAgdERvdDExZklFRVNFUmFkTWdtdENhcCAgICAgICAgRVNFUmFkTWdtdENhcDsKKyAgICB0RG90MTFmSUVFU0VUcmFmU3RybU1ldCAgICAgICBFU0VUcmFmU3RybU1ldDsKKyAgICB0RG90MTFmSUVFU0VUeG1pdFB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B0QU5JX1UzMiAqcG5OZWVkZWQpOworCisjaWZkZWYgX19jcGx1c3BsdXMKK30gLyogRW5kIGV4dGVybiAiQyIuICovCisjZW5kaWYgLyogQysrICovCisKK3R5cGVkZWYgc3RydWN0IHNEb3QxMWZCZWFjb25JRXN7CisgICAgdERvdDExZklFU1NJRCAgICAgICAgICAgICAgICAgU1NJRDsKKyAgICB0RG90MTFmSUVTdXBwUmF0ZXMgICAgICAgICAgICBTdXBwUmF0ZXM7CisgICAgdERvdDExZklFRkhQYXJhbVNldCAgICAgICAgICAgRkhQYXJhbVNldDsKKyAgICB0RG90MTFmSUVEU1BhcmFtcyAgICAgICAgICAgICBEU1BhcmFtczsKKyAgICB0RG90MTFmSUVDRlBhcmFtcyAgICAgICAgICAgICBDRlBhcmFtczsKKyAgICB0RG90MTFmSUVJQlNTUGFyYW1zICAgICAgICAgICBJQlNTUGFyYW1zOworICAgIHREb3QxMWZJRVRJTSAgICAgICAgICAgICAgICAgIFRJTTsKKyAgICB0RG90MTFmSUVDb3VudHJ5ICAgICAgICAgICAgICBDb3VudHJ5OworICAgIHREb3QxMWZJRUZIUGFyYW1zICAgICAgICAgICAgIEZIUGFyYW1zOworICAgIHREb3QxMWZJRUZIUGF0dFRhYmxlICAgICAgICAgIEZIUGF0dFRhYmxlOworICAgIHREb3QxMWZJRVBvd2VyQ29uc3RyYWludHMgICAgIFBvd2VyQ29uc3RyYWludHM7CisgICAgdERvdDExZklFQ2hhblN3aXRjaEFubiAgICAgICAgQ2hhblN3aXRjaEFubjsKKyAgICB0RG90MTFmSUVRdWlldCAgICAgICAgICAgICAgICBRdWlldDsKKyAgICB0RG90MTFmSUVUUENSZXBvcnQgICAgICAgICAgICBUUENSZXBvcnQ7CisgICAgdERvdDExZklFRVJQSW5mbyAgICAgICAgICAgICAgRVJQSW5mbzsKKyAgICB0RG90MTFmSUVFeHRTdXBwUmF0ZXMgICAgICAgICBFeHRTdXBwUmF0ZXM7CisgICAgdERvdDExZklFUlNOICAgICAgICAgICAgICAgICAgUlNOOworICAgIHREb3QxMWZJRVFCU1NMb2FkICAgICAgICAgICAgIFFCU1NMb2FkOworICAgIHREb3QxMWZJRUVEQ0FQYXJhbVNldCAgICAgICAgIEVEQ0FQYXJhbVNldDsKKyAgICB0RG90MTFmSUVRT1NDYXBzQXAgICAgICAgICAgICBRT1NDYXBzQXA7CisgICAgdERvdDExZklFQVBDaGFubmVsUmVwb3J0ICAgICAgQVBDaGFubmVsUmVwb3J0OworICAgIHREb3QxMWZJRVJSTUVuYWJsZWRDYXAgICAgICAgIFJSTUVuYWJsZWRDYXA7CisgICAgdERvdDExZklFTW9iaWxpdHlEb21haW4gICAgICAgTW9iaWxpdHlEb21haW47CisgICAgdERvdDExZklFV1BBICAgICAgICAgICAgICAgICAgV1BBOworICAgIHREb3QxMWZJRUhUQ2FwcyAgICAgICAgICAgICAgIEhUQ2FwczsKKyAgICB0RG90MTFmSUVIVEluZm8gICAgICAgICAgICAgICBIVEluZm87CisgICAgdERvdDExZklFRXh0Q2hhblN3aXRjaEFubiAgICAgRXh0Q2hhblN3aXRjaEFubjsKKyAgICB0RG90MTFmSUVXTU1JbmZvQXAgICAgICAgICAgICBXTU1JbmZvQXA7CisgICAgdERvdDExZklFV01NUGFyYW1zICAgICAgICAgICAgV01NUGFyYW1zOworICAgIHREb3QxMWZJRVdNTUNhcHMgICAgICAgICAgICAgIFdNTUNhcHM7CisgICAgdERvdDExZklFV0FQSSAgICAgICAgICAgICAgICAgV0FQSTsKKyAgICB0RG90MTFmSUVFU0VWZXJzaW9uICAgICAgICAgICBFU0VWZXJzaW9uOworICAgIHREb3QxMWZJRUVTRVJhZE1nbXRDYXAgICAgICAgIEVTRVJhZE1nbXRDYXA7CisgICAgdERvdDExZklFRVNFVHJhZlN0cm1NZXQgICAgICAgRVNFVHJhZlN0cm1NZXQ7CisgICAgdERvdDExZklFRVNFVHhtaXRQb3dlciAgICAgICAgRVNFVHhtaXRQb3dlcjsKKyAgICB0RG90MTFmSUV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ZU1hbmFnZW1lbnRBY3Rpb25GcmFtZSAqcEZybSwgdEFOSV9VMzIgKnBuTmVlZGVkKTsKKworI2lmZGVmIF9fY3BsdXNwbHVzCit9IC8qIEVuZCBleHRlcm4gIkMiLiAqLworI2VuZGlmIC8qIEMrKyAqLworCit0eXBlZGVmIHN0cnVjdCBzRG90MTFmSW52aXRhdGlvblJlcXsKKyAgICB0RG90MTFmRmZDYXRlZ29yeSAgICAgICAgIENhdGVnb3J5OworICAgIHREb3QxMWZGZkFjdGlvbiAgICAgICAgICAgQWN0aW9uOworICAgIHREb3QxMWZGZlAyUE9VSSAgICAgICAgICAgUDJQT1VJOworICAgIHREb3QxMWZGZlAyUE9VSVN1YlR5cGUgICAgUDJQT1VJU3ViVHlwZTsKKyAgICB0RG90MTFmRmZEaWFsb2dUb2tlbiAgICAgIERpYWxvZ1Rva2VuOworICAgIHREb3QxMWZJRVAyUEludml0YXRpb25SZXEgUDJQSW52aXRhdGlvblJlcTsKK30gdERvdDExZkludml0YXRpb25SZXE7CisKKyNkZWZpbmUgRE9UMTFGX0lOVklUQVRJT05SRVEgKCAyNCApCisKKyNpZmRlZiBfX2NwbHVzcGx1cworZXh0ZXJuICJDIiB7CisjZW5kaWYgLyogQysrICovCisKK3RBTklfVTMyIGRvdDExZlVucGFja0ludml0YXRpb25SZXEodHBBbmlTaXJHbG9iYWwgcEN0eCwgdEFOSV9VOCAqcEJ1ZiwgdEFOSV9VMzIgbkJ1ZiwgdERvdDExZkludml0YXRpb25SZXEgKnBGcm0pOwordEFOSV9VMzIgZG90MTFmUGFja0ludml0YXRpb25SZXEodHBBbmlTaXJHbG9iYWwgcEN0eCwgdERvdDExZkludml0YXRpb25SZXEgKnBGcm0sIHRBTklfVTggKnBCdWYsIHRBTklfVTMyIG5CdWYsIHRBTklfVTMyICpwbkNvbnN1bWVkKTsKK3RBTklfVTMyIGRvdDExZkdldFBhY2tlZEludml0YXRpb25SZXFTaXplKHRwQW5pU2lyR2xvYmFsIHBDdHg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yYW1zOworICAgIHREb3QxMWZJRUlCU1NQYXJhbXMgICAgICAgICBJQlNTUGFyYW1zOworICAgIHREb3QxMWZJRUNvdW50cnkgICAgICAgICAgICBDb3VudHJ5OworICAgIHREb3QxMWZJRUZIUGFyYW1zICAgICAgICAgICBGSFBhcmFtczsKKyAgICB0RG90MTFmSUVGSFBhdHRUYWJsZSAgICAgICAgRkhQYXR0VGFibGU7CisgICAgdERvdDExZklFUG93ZXJDb25zdHJhaW50cyAgIFBvd2VyQ29uc3RyYWludHM7CisgICAgdERvdDExZklFQ2hhblN3aXRjaEFubiAgICAgIENoYW5Td2l0Y2hBbm47CisgICAgdERvdDExZklFUXVpZXQgICAgICAgICAgICAgIFF1aWV0OworICAgIHREb3QxMWZJRVRQQ1JlcG9ydCAgICAgICAgICBUUENSZXBvcnQ7CisgICAgdERvdDExZklFRVJQSW5mbyAgICAgICAgICAgIEVSUEluZm87CisgICAgdERvdDExZklFRXh0U3VwcFJhdGVzICAgICAgIEV4dFN1cHBSYXRlczsKKyAgICB0RG90MTFmSUVSU05PcGFxdWUgICAgICAgICAgUlNOT3BhcXVlOworICAgIHREb3QxMWZJRVFCU1NMb2FkICAgICAgICAgICBRQlNTTG9hZDsKKyAgICB0RG90MTFmSUVFRENBUGFyYW1TZXQgICAgICAgRURDQVBhcmFtU2V0OworICAgIHREb3QxMWZJRVJSTUVuYWJsZWRDYXAgICAgICBSUk1FbmFibGVkQ2FwOworICAgIHREb3QxMWZJRUFQQ2hhbm5lbFJlcG9ydCAgICBBUENoYW5uZWxSZXBvcnQ7CisgICAgdERvdDExZklFTW9iaWxpdHlEb21haW4gICAgIE1vYmlsaXR5RG9tYWluOworICAgIHREb3QxMWZJRVdQQSAgICAgICAgICAgICAgICBXUEE7CisgICAgdERvdDExZklFSFRDYXBzICAgICAgICAgICAgIEhUQ2FwczsKKyAgICB0RG90MTFmSUVIVEluZm8gICAgICAgICAgICAgSFRJbmZvOworICAgIHREb3QxMWZJRUV4dENoYW5Td2l0Y2hBbm4gICBFeHRDaGFuU3dpdGNoQW5uOworICAgIHREb3QxMWZJRVdNTUluZm9BcCAgICAgICAgICBXTU1JbmZvQXA7CisgICAgdERvdDExZklFV01NUGFyYW1zICAgICAgICAgIFdNTVBhcmFtczsKKyAgICB0RG90MTFmSUVXTU1DYXBzICAgICAgICAgICAgV01NQ2FwczsKKyAgICB0RG90MTFmSUVXQVBJICAgICAgICAgICAgICAgV0FQSTsKKyAgICB0RG90MTFmSUVFU0VSYWRNZ210Q2FwICAgICAgRVNFUmFkTWdtdENhcDsKKyAgICB0RG90MTFmSUVFU0VUcmFmU3RybU1ldCAgICAgRVNFVHJhZlN0cm1NZXQ7CisgICAgdERvdDExZklFRVNFVHhtaXRQb3dlciAgICAgIEVTRVR4bWl0UG93ZXI7CisgICAgdERvdDExZklFQWlyZ28gICAgICAgICAgICAgIEFpcmdvOworICAgIHREb3QxMWZJRVdzY1Byb2JlUmVzICAgICAgICBXc2NQcm9iZVJlczsKKyAgICB0RG90MTFmSUVQMlBQcm9iZVJlcyAgICAgICAgUDJQUHJvYmVSZXM7CisgICAgdERvdDExZklFVkhUQ2FwcyAgICAgICAgICAgIFZIVENhcHM7CisgICAgdERvdDExZklFVkhUT3BlcmF0aW9uICAgICAgIFZIVE9wZXJhdGlvbjsKKyAgICB0RG90MTFmSUVWSFRFeHRCc3NMb2FkICAgICAgVkhURXh0QnNzTG9hZDsKKyAgICB0RG90MTFmSUVFeHRDYXAgICAgICAgICAgICAgRXh0Q2FwOworICAgIHREb3QxMWZJRU9CU1NTY2FuUGFyYW1ldGVycyBPQlNTU2NhblBhcmFtZXRlcnM7Cit9IHREb3QxMWZQcm9iZVJlc3BvbnNlOworCisjZGVmaW5lIERPVDExRl9QUk9CRVJFU1BPTlNFICggMzcgKQorCisjaWZkZWYgX19jcGx1c3BsdXMKK2V4dGVybiAiQyIgeworI2VuZGlmIC8qIEMrKyAqLworCit0QU5JX1UzMiBkb3QxMWZVbnBhY2tQcm9iZVJlc3Bv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HVzCit9IC8qIEVuZCBleHRlcm4gIkMiLiAqLworI2VuZGlmIC8qIEMrKyAqLworCit0eXBlZGVmIHN0cnVjdCBzRG90MTFmUmVBc3NvY1JlcXVlc3R7CisgICAgdERvdDExZkZmQ2FwYWJpbGl0aWVzICAgICAgIENhcGFiaWxpdGllczsKKyAgICB0RG90MTFmRmZMaXN0ZW5JbnRlcnZhbCAgICAgTGlzdGVuSW50ZXJ2YWw7CisgICAgdERvdDExZkZmQ3VycmVudEFQQWRkcmVzcyAgIEN1cnJlbnRBUEFkZHJlc3M7CisgICAgdERvdDExZklFU1NJRCAgICAgICAgICAgICAgIFNTSUQ7CisgICAgdERvdDExZklFU3VwcFJhdGVzICAgICAgICAgIFN1cHBSYXRlczsKKyAgICB0RG90MTFmSUVFeHRTdXBwUmF0ZXMgICAgICAgRXh0U3VwcFJhdGVzOworICAgIHREb3QxMWZJRVBvd2VyQ2FwcyAgICAgICAgICBQb3dlckNhcHM7CisgICAgdERvdDExZklFU3VwcENoYW5uZWxzICAgICAgIFN1cHBDaGFubmVsczsKKyAgICB0RG90MTFmSUVSU05PcGFxdWUgICAgICAgICAgUlNOT3BhcXVlOworICAgIHREb3QxMWZJRVFPU0NhcHNTdGF0aW9uICAgICBRT1NDYXBzU3RhdGlvbjsKKyAgICB0RG90MTFmSUVSUk1FbmFibGVkQ2FwICAgICAgUlJNRW5hYmxlZENhcDsKKyAgICB0RG90MTFmSUVNb2JpbGl0eURvbWFpbiAgICAgTW9iaWxpdHlEb21haW47CisgICAgdERvdDExZklFRlRJbmZvICAgICAgICAgICAgIEZUSW5mbzsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgICAgICAgbnVtX1JJQ0RhdGFEZXNjOworICAgIHREb3QxMWZJRVJJQ0RhdGFEZXNjICAgICAgICBSSUNEYXRhRGVzY1syXTsKKyAgICB0RG90MTFmSUVXUEFPcGFxdWUgICAgICAgICAgV1BBT3BhcXVlOworICAgIHREb3QxMWZJRUhUQ2FwcyAgICAgICAgICAgICBIVENhcHM7CisgICAgdERvdDExZklFV01NQ2FwcyAgICAgICAgICAgIFdNTUNhcHM7CisgICAgdERvdDExZklFV01NSW5mb1N0YXRpb24gICAgIFdNTUluZm9TdGF0aW9uOworICAgIHREb3QxMWZJRUFpcmdvICAgICAgICAgICAgICBBaXJnbzsKKyAgICB0RG90MTFmSUVXc2NJRU9wYXF1ZSAgICAgICAgV3NjSUVPcGFxdWU7CisgICAgdERvdDExZklFV0FQSU9wYXF1ZSAgICAgICAgIFdBUElPcGFxdWU7CisgICAgdERvdDExZklFRVNFUmFkTWdtdENhcCAgICAgIEVTRVJhZE1nbXRDYXA7CisgICAgdERvdDExZklFRVNFVmVyc2lvbiAgICAgICAgIEVTRVZlcnNpb247CisgICAgdERvdDExZklFRVNFQ2NrbU9wYXF1ZSAgICAgIEVTRUNja21PcGFxdWU7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgICAgIG51bV9XTU1UU1BFQzsKKyAgICB0RG90MTFmSUVXTU1UU1BFQyAgICAgICAgICAgV01NVFNQRUNbNF07CisgICAgdERvdDExZklFRVNFVHJhZlN0cm1SYXRlU2V0IEVTRVRyYWZTdHJtUmF0ZVNldDsKKyAgICB0RG90MTFmSUVQMlBJRU9wYXF1ZSAgICAgICAgUDJQSUVPcGFxdWU7CisgICAgdERvdDExZklFV0ZESUVPcGFxdWUgICAgICAgIFdGRElFT3BhcXVlOworICAgIHREb3QxMWZJRVZIVENhcHMgICAgICAgICAgICBWSFRDYXBzOworICAgIHREb3QxMWZJRUV4dENhcCAgICAgICAgICAgICBFeHRDYXA7CisgICAgdERvdDExZklFT3BlcmF0aW5nTW9kZSAgICAgIE9wZXJhdGluZ01vZGU7CisgICAgdERvdDExZklFUW9zTWFwU2V0ICAgICAgICAgIFFvc01hcFNldDsKK30gdERvdDExZlJlQXNzb2NSZXF1ZXN0OworCisjZGVmaW5lIERPVDExRl9SRUFTU09DUkVRVUVTVCAoIDQzICkKKworI2lmZGVmIF9fY3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ICAgUkNQSUlFOworICAgIHREb3QxMWZJRVJTTklJRSAgICAgICAgICAgICBSU05JSUU7CisgICAgdERvdDExZklFUlJNRW5hYmxlZENhcCAgICAgIFJSTUVuYWJsZWRDYXA7CisgICAgdERvdDExZklFUlNOT3BhcXVlICAgICAgICAgIFJTTk9wYXF1ZTsKKyAgICB0RG90MTFmSUVNb2JpbGl0eURvbWFpbiAgICAgTW9iaWxpdHlEb21haW47CisgICAgdERvdDExZklFRlRJbmZvICAgICAgICAgICAgIEZUSW5mbzsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgICAgICAgbnVtX1JJQ0RhdGFEZXNjOworICAgIHREb3QxMWZJRVJJQ0RhdGFEZXNjICAgICAgICBSSUNEYXRhRGVzY1syXTsKKyAgICB0RG90MTFmSUVXUEEgICAgICAgICAgICAgICAgV1BBOworICAgIHREb3QxMWZJRVRpbWVvdXRJbnRlcnZhbCAgICBUaW1lb3V0SW50ZXJ2YWw7CisgICAgdERvdDExZklFSFRDYXBzICAgICAgICAgICAgIEhUQ2FwczsKKyAgICB0RG90MTFmSUVIVEluZm8gICAgICAgICAgICAgSFRJbmZvOworICAgIHREb3QxMWZJRVdNTVBhcmFtcyAgICAgICAgICBXTU1QYXJhbXM7CisgICAgdERvdDExZklFRVNFUmFkTWdtdENhcCAgICAgIEVTRVJhZE1nbXRDYXA7CisgICAgdERvdDExZklFRVNFVHJhZlN0cm1NZXQgICAgIEVTRVRyYWZTdHJtTWV0OworICAgIHREb3QxMWZJRUVTRVR4bWl0UG93ZXIgICAgICBFU0VUeG1pdFBvd2VyOworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgICAgICBudW1fV01NVFNQRUM7CisgICAgdERvdDExZklFV01NVFNQRUMgICAgICAgICAgIFdNTVRTUEVDWzRdOworICAgIHREb3QxMWZJRUVTRVRyYWZTdHJtUmF0ZVNldCBFU0VUcmFmU3RybVJhdGVTZXQ7CisgICAgdERvdDExZklFQWlyZ28gICAgICAgICAgICAgIEFpc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RETFNQZWVyVHJhZmZpY1JzcCAqcEZybSwgdEFOSV9VMzIgKnBuTmVlZGVkKTsKKworI2lmZGVmIF9fY3BsdXNwbHVzCit9IC8qIEVuZCBleHRlcm4gIkMiLiAqLworI2VuZGlmIC8qIEMrKyAqLworCit0eXBlZGVmIHN0cnVjdCBzRG90MTFmVERMU1NldHVwQ25meworICAgIHREb3QxMWZGZkNhdGVnb3J5ICAgICAgICAgICAgIENhdGVnb3J5OworICAgIHREb3QxMWZGZkFjdGlvbiAgICAgICAgICAgICAgIEFjdGlvbjsKKyAgICB0RG90MTFmRmZTdGF0dXMgICAgICAgICAgICAgICBTdGF0dXM7CisgICAgdERvdDExZkZmRGlhbG9nVG9rZW4gICAgICAgICAgRGlhbG9nVG9rZW47CisgICAgdERvdDExZklFUlNOICAgICAgICAgICAgICAgICAgUlNOOworICAgIHREb3QxMWZJRUVEQ0FQYXJhbVNldCAgICAgICAgIEVEQ0FQYXJhbVNldDsKKyAgICB0RG90MTFmSUVGVEluZm8gICAgICAgICAgICAgICBGVEluZm87CisgICAgdERvdDExZklFVGltZW91dEludGVydmFsICAgICAgVGltZW91dEludGVydmFsOworICAgIHREb3QxMWZJRUhUSW5mbyAgICAgICAgICAgICAgIEhUSW5mbzsKKyAgICB0RG90MTFmSUVIVDIwNDBCU1NDb2V4aXN0ZW5jZSBIVDIwNDBCU1NDb2V4aXN0ZW5jZTsKKyAgICB0RG90MTFmSUVMaW5rSWRlbnRpZmllciAgICAgICBMaW5rSWRlbnRpZmllcjsKKyAgICB0RG90MTFmSUVXTU1QYXJhbXMgICAgICAgICAgICBXTU1QYXJhbXM7CisgICAgdERvdDExZklFVkhUT3BlcmF0aW9uICAgICAgICAgVkhUT3BlcmF0aW9uOworICAgIHREb3QxMWZJRU9wZXJhdGluZ01vZGUgICAgICAgIE9wZXJhdGluZ01vZGU7Cit9IHREb3QxMWZURExTU2V0dXBDbmY7CisKKyNkZWZpbmUgRE9UMTFGX1RETFNTRVRVUENORiAoIDUy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FN1cHBSYXRlczsKKyAgICB0RG90MTFmSUVTdXBwQ2hhbm5lbHMgICAgICAgICBTdXBwQ2hhbm5lbHM7CisgICAgdERvdDExZklFUlNOICAgICAgICAgICAgICAgICAgUlNOOworICAgIHREb3QxMWZJRUV4dENhcCAgICAgICAgICAgICAgIEV4dENhcDsKKyAgICB0RG90MTFmSUVTdXBwT3BlcmF0aW5nQ2xhc3NlcyBTdXBwT3BlcmF0aW5nQ2xhc3NlczsKKyAgICB0RG90MTFmSUVRT1NDYXBzU3RhdGlvbiAgICAgICBRT1NDYXBzU3RhdGlvbjsKKyAgICB0RG90MTFmSUVGVEluZm8gICAgICAgICAgICAgICBGVEluZm87CisgICAgdERvdDExZklFVGltZW91dEludGVydmFsICAgICAgVGltZW91dEludGVydmFsOworICAgIHREb3QxMWZJRVJJQ0RhdGEgICAgICAgICAgICAgIFJJQ0RhdGE7CisgICAgdERvdDExZklFSFRDYXBzICAgICAgICAgICAgICAgSFRDYXBzOworICAgIHREb3QxMWZJRUhUMjA0MEJTU0NvZXhpc3RlbmNlIEhUMjA0MEJTU0NvZXhpc3RlbmNlOworICAgIHREb3QxMWZJRUxpbmtJZGVudGlmaWVyICAgICAgIExpbmtJZGVudGlmaWVyOworICAgIHREb3QxMWZJRVdNTUluZm9TdGF0aW9uICAgICAgIFdNTUluZm9TdGF0aW9uOworICAgIHREb3QxMWZJRUFJRCAgICAgICAgICAgICAgICAgIEFJRDsKKyAgICB0RG90MTFmSUVWSFRDYXBzICAgICAgICAgICAgICBWSFRDYXBzOworfSB0RG90MTFmVERMU1NldHVwUmVxOworCisjZGVmaW5lIERPVDExRl9URExTU0VUVVBSRVEgKCA1MyApCisKKyNpZmRlZiBfX2NwbHVzcGx1cworZXh0ZXJuICJDIiB7CisjZW5kaWYgLyogQysrICovCisKK3RBTklfVTMyIGRvdDExZlVucGFja1RETFNTZXR1cFJlcSh0cEFuaVNpckdsb2JhbCBwQ3R4LCB0QU5JX1U4ICpwQnVmLCB0QU5JX1UzMiBuQnVmLCB0RG90MTFmVERMU1NldHVwUmVxICpwRnJtKTsKK3RBTklfVTMyIGRvdDExZlBhY2tURExTU2V0dXBSZXEodHBBbmlTaXJHbG9iYWwgcEN0eCwgdERvdDExZlRETFNTZXR1cFJlcSAqcEZybSwgdEFOSV9VOCAqcEJ1ZiwgdEFOSV9VMzIgbkJ1ZiwgdEFOSV9VMzIgKnBuQ29uc3VtZWQpOwordEFOSV9VMzIgZG90MTFmR2V0UGFja2VkVERMU1NldHVwUmVxU2l6ZSh0cEFuaVNpckdsb2JhbCBwQ3R4LCB0RG90MTFmVERMU1NldHVwUmVxICpwRnJtLCB0QU5JX1UzMiAqcG5OZWVkZWQpOworCisjaWZkZWYgX19jcGx1c3BsdXMKK30gLyogRW5kIGV4dGVybiAiQyIuICovCisjZW5kaWYgLyogQysrICovCisKK3R5cGVkZWYgc3RydWN0IHNEb3QxMWZURExTU2V0dXBSc3B7CisgICAgdERvdDExZkZmQ2F0ZWdvcnkgICAgICAgICAgICAgQ2F0ZWdvcnk7CisgICAgdERvdDExZkZmQWN0aW9uICAgICAgICAgICAgICAgQWN0aW9uOworICAgIHREb3QxMWZGZlN0YXR1cyAgICAgICAgICAgICAgIFN0YXR1czsKKyAgICB0RG90MTFmRmZEaWFsb2dUb2tlbiAgICAgICAgICBEaWFsb2dUb2tlbjsKKyAgICB0RG90MTFmRmZDYXBhYmlsaXRpZXMgICAgICAgICBDYXBhYmlsaXRpZXM7CisgICAgdERvdDExZklFU3VwcFJhdGVzICAgICAgICAgICAgU3VwcFJhdGVzOworICAgIHREb3QxMWZJRUNvdW50cnkgICAgICAgICAgICAgIENvdW50cnk7CisgICAgdERvdDExZklFRXh0U3VwcFJhdGVzICAgICAgICAgRXh0U3VwcFJhdGVzOworICAgIHREb3QxMWZJRVN1cHBDaGFubmVscyAgICAgICAgIFN1cHBDaGFubmVsczsKKyAgICB0RG90MTFmSUVSU04gICAgICAgICAgICAgICAgICBSU047CisgICAgdERvdDExZklFRXh0Q2FwICAgICAgICAgICAgICAgRXh0Q2FwOworICAgIHREb3QxMWZJRVN1cHBPcGVyYXRpbmdDbGFzc2VzIFN1cHBPcGVyYXRpbmdDbGFzc2VzOworICAgIHREb3QxMWZJRVFPU0NhcHNTdGF0aW9uICAgICAgIFFPU0NhcHNTdGF0aW9uOworICAgIHREb3QxMWZJRUZUSW5mbyAgICAgICAgICAgICAgIEZUSW5mbzsKKyAgICB0RG90MTFmSUVUaW1lb3V0SW50ZXJ2YWwgICAgICBUaW1lb3V0SW50ZXJ2YWw7CisgICAgdERvdDExZklFUklDRGF0YSAgICAgICAgICAgICAgUklDRGF0YTsKKyAgICB0RG90MTFmSUVIVENhcHMgICAgICAgICAgICAgICBIVENhcHM7CisgICAgdERvdDExZklFSFQyMDQwQlNTQ29leGlzdGVuY2UgSFQyMDQwQlNTQ29leGlzdGVuY2U7CisgICAgdERvdDExZklFTGlua0lkZW50aWZpZXIgICAgICAgTGlua0lkZW50aWZpZXI7CisgICAgdERvdDExZklFV01NSW5mb1N0YXRpb24gICAgICAgV01NSW5mb1N0YXRpb247CisgICAgdERvdDExZklFQUlEICAgICAgICAgICAgICAgICAgQUlEOworICAgIHREb3QxMWZJRVZIVENhcHMgICAgICAgICAgICAgIFZIVENhcHM7CisgICAgdERvdDExZklFT3BlcmF0aW5nTW9kZSAgICAgICAgT3BlcmF0aW5nTW9kZTsKK30gdERvdDExZlRETFNTZXR1cFJzcDsKKworI2RlZmluZSBET1QxMUZfVERMU1NFVFVQUlNQICggNTQgKQorCisjaWZkZWYgX19jcGx1c3BsdXMKK2V4dGVybiAiQyIgeworI2VuZGlmIC8qIEMrKyAqLworCit0QU5JX1UzMiBkb3QxMWZVbnBhY2tURExTU2V0dXBSc3AodHBBbmlTaXJHbG9iYWwgcEN0eCwgdEFOSV9VOCAqcEJ1ZiwgdEFOSV9VMzIgbkJ1ZiwgdERvdDExZlRETFNTZXR1cFJzcCAqcEZybSk7Cit0QU5JX1UzMiBkb3QxMWZQYWNrVERMU1NldHVwUnNwKHRwQW5pU2lyR2xvYmFsIHBDdHgsIHREb3QxMWZURExTU2V0dXBSc3AgKnBGcm0sIHRBTklfVTggKnBCdWYsIHRBTklfVTMyIG5CdWYsIHRBTklfVTMyICpwbkNvbnN1bWVkKTsKK3RBTklfVTMyIGRvdDExZkdldFBhY2tlZFRETFNTZXR1cFJzcFNpemUodHBBbmlTaXJHbG9iYWwgcEN0eCwgdERvdDExZlRETFNTZXR1cFJzcCAqcEZybSwgdEFOSV9VMzIgKnBuTmVlZGVkKTsKKworI2lmZGVmIF9fY3BsdXNwbHVzCit9IC8qIEVuZCBleHRlcm4gIkMiLiAqLworI2VuZGlmIC8qIEMrKyAqLworCit0eXBlZGVmIHN0cnVjdCBzRG90MTFmVERMU1RlYXJkb3dueworICAgIHREb3QxMWZGZkNhdGVnb3J5ICAgICAgIENhdGVnb3J5OworICAgIHREb3QxMWZGZkFjdGlvbiAgICAgICAgIEFjdGlvbjsKKyAgICB0RG90MTFmRmZSZWFzb24gICAgICAgICBSZWFzb247CisgICAgdERvdDExZklFRlRJbmZvICAgICAgICAgRlRJbmZvOworICAgIHREb3QxMWZJRUxpbmtJZGVudGlmaWVyIExpbmtJZGVudGlmaWVyOworfSB0RG90MTFmVERMU1RlYXJkb3duOworCisjZGVmaW5lIERPVDExRl9URExTVEVBUkRPV04gKCA1NSApCisKKyNpZmRlZiBfX2NwbHVzcGx1cworZXh0ZXJuICJDIiB7CisjZW5kaWYgLyogQysrICovCisKK3RBTklfVTMyIGRvdDExZlVucGFja1RETFNUZWFyZG93bih0cEFuaVNpckdsb2JhbCBwQ3R4LCB0QU5JX1U4ICpwQnVmLCB0QU5JX1UzMiBuQnVmLCB0RG90MTFmVERMU1RlYXJkb3duICpwRnJtKTsKK3RBTklfVTMyIGRvdDExZlBhY2tURExTVGVhcmRvd24odHBBbmlTaXJHbG9iYWwgcEN0eCwgdERvdDExZlRETFNUZWFyZG93biAqcEZybSwgdEFOSV9VOCAqcEJ1Ziw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F9TVEFfSEFTSF9JTkRFWF9QRUVSICAgMQorCisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisvL0RQSCBQTUYgU0EgUXVlcnkgc3RhdGUgZm9yIHN0YXRpb24KKworI2RlZmluZSBEUEhfU0FfUVVFUllfTk9UX0lOX1BST0dSRVNTICAgICAgMQorCisjZGVmaW5lIERQSF9TQV9RVUVSWV9JTl9QUk9HUkVTUyAgICAgICAgICAyCisKKyNkZWZpbmUgRFBIX1NBX1FVRVJZX1RJTUVEX09VVCAgICAgICAgICAgIDMKKyNlbmRpZgorCisKK3R5cGVkZWYgc3RydWN0IHNEcGhSYXRlQmFzZWRDdHIKKworeworCisgICAgdEFOSV9VMzIgaGk7CisKKyAgICB0QU5JX1UzMiBsbzsKKworfSB0RHBoUmF0ZUJhc2VkQ3RyOworCisKK3R5cGVkZWYgc3RydWN0IHNEcGhQaHlSYXRlcworCit7CisKKyAgICB0QU5JX1U4IGRhdGFSYXRlWDI7CisKKyAgICB0QU5JX1U4IGFja1JhdGVYMjsKKworICAgIHRBTklfVTggcnRzUmF0ZVgyOworCit9IHREcGhQaHlSYXRlczsKKworCit0eXBlZGVmIHN0cnVjdCBzRHBoSUZTVmFsdWVzCisKK3sKKworICAgIHRBTklfVTggc2lmczsKKworICAgIHRBTklfVTggcGlmczsKKworICAgIHRBTklfVTggZGlmczsKKworICAgIHRBTklfVTggcHJlYW1ibGU7CisKK30gdERwaElGU1ZhbHVlczsKKworCit0eXBlZGVmIHN0cnVjdCBzRHBoUW9zUGFyYW1zCisKK3sKKworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgYWRkdHNQcmVzZW50OworCisgICAgdFNpckFkZHRzUmVxSW5mbyAgICAgICBhZGR0czsKKworICAgIHRTaXJNYWNRb3NDYXBhYmlsaXR5U3RhSUUgY2FwYWJpbGl0eTsKKworfSB0RHBoUW9zUGFyYW1zOworCisKKy8vLyBRdWV1ZSBhdHRyaWJ1dGUgc3RydWN0dXJlCisKK3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VTggICB0aXRhblBlZXI6MTsgICAgICAgICAgICAgICAgLy8gZmxhZyB0byBpbmRpY2F0ZSBpZiBpdHMgYSB0aXRhbiBwZWVyICAgIAorCisgICAgdEFOSV9VOCAgZkFuaUNvdW50OjE7CisKKyAgICB0QU5JX1U4ICAgcm1mRW5hYmxlZDoxOworCisKKyAgICAvLy8gRnJhZ21lbnRhdGlvbiBzaXplCisKKyAgICB0QU5JX1UxNiAgIGZyYWdTaXplOworCisKKyAgICAvLy8gTElNIHN0YXRlCisKKyAgICB0TGltTWxtU3RhQ29udGV4dCBtbG1TdGFDb250ZXh0OworCisKKyAgICAvLy8gTnVtYmVyIG9mIFRpbSB0byB3YWl0IGlmIHRoZSBTVEEgZG9lc24ndCByZXNwb25kIC8gZmV0Y2ggZGF0YQorCisgICAgdEFOSV9VOCAgdGltV2FpdENvdW50OworCisKKyAgICAvLy8gTnVtYmVyIG9mIFN1Y2Nlc3NmdWxsIE1QRFUncyBiZWluZyBzZW50CisKKyAgICB0QU5JX1UzMiAgICBjdXJUeE1wZHVDbnQ7CisKKworCisKKyAgICAvLy8gbnVtYmVyIG9mIGNvbnNlY3V0aXZlIFRJTXMgc2VudCB3aXRob3V0IHJlc3BvbnNlCisKKyAgICB0QU5JX1U4ICBudW1UaW1TZW50OworCisKKyAgICAvLyBxb3MgcGFyYW1ldGVyIGluZm8KKworICAgIHREcGhRb3NQYXJhbXMgIHFvczsKKworCisgICAgLy8gc3RhdGlvbiB2ZXJzaW9uIGluZm8gLSB2YWxpZCBvbmx5IGlmIHZlcnNpb25QcmVzZW50IGlzIHNldAorCisgICAgdFNpck1hY1Byb3BWZXJzaW9uIHZlcnNpb247CisKKyAgICAvLyBzdGF0aW9uIHByb3ByaWV0YXJ5IGNhcGFiaWxpdHkKKworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgIHByb3BDYXBhYmlsaXR5OworCisKKyNpZmRlZiBQTE1fV0RTCisKKyAgICB0QU5JX1U4ICB3ZHNJbmRleDsKKworICAgIHRBTklfVTggIHdkc1BlZXJCZWFjb25TZWVuOworCisjZW5kaWYKKworCisgICAvL1RhdXJ1cyBjYXBhYmlsaXRpZXMKKworICAgdEFOSV9VMTYgYmFQb2xpY3lGbGFnOyAgICAgICAgICAgICAgICAgLy9CQSBQb2xpY3kgZm9yIGVhY2ggVElELiAKKworCisgICAgLyoKKworICAgICogQWxsIHRoZSBsZWdhY3kgYW5kIGFpcmdvIHN1cHBvcnRlZCByYXRlcy4KKworICAgICovCisKKyAgICB0U2lyU3VwcG9ydGVkUmF0ZXMgc3VwcG9ydGVkUmF0ZXM7CisKKworICAgIHRBTklfVTggaHRHcmVlbmZpZWxkOjE7CisKKyAgICB0QU5JX1U4IGh0U2hvcnRHSTQwTWh6OjE7CisKKyAgICB0QU5JX1U4IGh0U2hvcnRHSTIwTWh6OjE7CisKKyAgICAvLyBEU1NTL0NDSyBhdCA0MCBNSHo6IEVuYWJsZWQgMSBvciBEaXNhYmxlZAorCisgICAgdEFOSV9VOCBodERzc3NDY2tSYXRlNDBNSHpTdXBwb3J0OjE7CisKKyAgICAvLyBMLVNJRyBUWE9QIFByb3RlY3Rpb24gdXNlZCBvbmx5IGlmIHBlZXIgc3VwcG9ydCBhdmFpbGFibGUKKworICAgIHRBTklfVTggaHRMc2lnVFhPUFByb3RlY3Rpb246MTsKKworICAgIC8vIEEtTVBEVSBEZW5zaXR5CisKKyAgICAvLyAwMDAgLSBObyByZXN0cmljdGlvbgorCisgICAgLy8gMDAxIC0gMS84IHVzZWMKKworICAgIC8vIDAxMCAtIDEvNCB1c2VjCisKKyAgICAvLyAwMTEgLSAxLzIgdXNlYworCisgICAgLy8gMTAwIC0gMSB1c2VjCisKKyAgICAvLyAxMDEgLSAyIHVzZWMKKworICAgIC8vIDExMCAtIDQgdXNlYworCisgICAgLy8gMTExIC0gOCB1c2VjCisKKyAgICAvLworCisgICAgdEFOSV9VOCBodEFNcGR1RGVuc2l0eTozOworCisKKworCisgICAgLy9TZXQgdG8gMCBm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VN0YW1wICAgICAgICAgIHRpbWVTdGFtcDsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgICAgIGJlYWNvbkludGVydmFsOworICAgIHRTaXJNYWNDYXBhYmlsaXR5SW5mbyAgICAgY2FwYWJpbGl0eUluZm87CisKKyAgICB0U2lyTWFjU1NpZCAgICAgICAgICAgICAgIHNzSWQ7CisgICAgdFNpck1hY1JhdGVTZXQgICAgICAgICAgICBzdXBwb3J0ZWRSYXRlczsKKyAgICB0U2lyTWFjUmF0ZVNldCAgICAgICAgICAgIGV4dGVuZGVkUmF0ZXM7CisgICAgdFNpck1hY0NoYW5OdW0gICAgICAgICAgICBjaGFubmVsTnVtYmVyOworICAgIHRTaXJNYWNDZlBhcmFtU2V0ICAgICAgICAgY2ZQYXJhbVNldDsKKyAgICB0U2lyTWFjVGltICAgICAgICAgICAgICAgIHRpbTsKKyAgICB0U2lyTWFjRWRjYVBhcmFtU2V0SUUgICAgIGVkY2FQYXJhbXM7CisgICAgdFNpck1hY1Fvc0NhcGFiaWxpdHlJRSAgICBxb3NDYXBhYmlsaXR5OworCisgICAgdFNpckNvdW50cnlJbmZvcm1hdGlvbiAgICBjb3VudHJ5SW5mb1BhcmFtOworICAgIHRTaXJNYWNXcGFJbmZvICAgICAgICAgICAgd3BhOworICAgIHRTaXJNYWNSc25JbmZvICAgICAgICAgICAgcnNuOworCisgICAgdFNpck1hY0VycEluZm8gICAgICAgICAgICBlcnBJRUluZm87CisKKyAgICB0U2lyUHJvcElFU3RydWN0ICAgICAgICAgIHByb3BJRWluZm87CisgICAgdERvdDExZklFUG93ZXJDb25zdHJhaW50cyBsb2NhbFBvd2VyQ29uc3RyYWludDsKKyAgICB0RG90MTFmSUVUUENSZXBvcnQgICAgICAgIHRwY1JlcG9ydDsKKyAgICB0RG90MTFmSUVDaGFuU3dpdGNoQW5uICAgIGNoYW5uZWxTd2l0Y2hJRTsKKyAgICB0RG90MTFmSUVFeHRDaGFuU3dpdGNoQW5uIGV4dENoYW5uZWxTd2l0Y2hJRTsKKyAgICB0U2lyTWFjQWRkciAgICAgICAgICAgICAgIGJzc2lkOworICAgIHREb3QxMWZJRVF1aWV0ICAgICAgICAgICAgcXVpZXRJRTsKKyAgICB0RG90MTFmSUVIVENhcHMgICAgICAgICAgIEhUQ2FwczsKKyAgICB0RG90MTFmSUVIVEluZm8gICAgICAgICAgIEhUSW5mbzsKKyAgICB0RG90MTFmSUVQMlBQcm9iZVJlcyAgICAgIFAyUFByb2JlUmVzOworI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICBtZGllW1NJUl9NRElFX1NJWkVdOworI2VuZGlmCisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRQorICAgIHREb3QxMWZJRUVTRVR4bWl0UG93ZXIgICAgZXNlVHhQd3I7CisgICAgdERvdDExZklFUUJTU0xvYWQgICAgICAgICBRQlNTTG9hZDsKKyNlbmRpZgorICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgc3NpZFByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICBzdXBwUmF0ZXNQcmVzZW50OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgZXh0ZW5kZWRSYXRlc1ByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICBjZlByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICBkc1BhcmFtc1ByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICB0aW1QcmVzZW50OworCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICBlZGNhUHJlc2VudDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgIHFvc0NhcGFiaWxpdHlQcmVzZW50OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgd21lRWRjYVByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICB3bWVJbmZvUHJlc2VudDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgIHdzbUNhcGFibGVQcmVzZW50OworCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICBjb3VudHJ5SW5mb1ByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICB3cGFQcmVzZW50OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgcnNuUHJlc2VudDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgIGVycFByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICBjaGFubmVsU3dpdGNoUHJlc2VudDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgIGV4dENoYW5uZWxTd2l0Y2hQcmVzZW50OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgcXVpZXRJRVByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICB0cGNSZXBvcnRQcmVzZW50OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgcG93ZXJDb25zdHJhaW50UHJlc2VudDsKKworI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICBtZGllUHJlc2VudDsKKyNlbmRpZgorCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExQUMKKyAgICB0RG90MTFmSUVWSFRDYXBzICAgICAgICAgIFZIVENhcHM7CisgICAgdERvdDExZklFVkhUT3BlcmF0aW9uICAgICBWSFRPcGVyYXRpb247CisgICAgdERvdDExZklFVkhURXh0QnNzTG9hZCAgICBWSFRFeHRCc3NMb2FkOworICAgIHREb3QxMWZJRUV4dENhcCAgICAgICAgICAgRXh0Q2FwOworICAgIHREb3QxMWZJRU9wZXJhdGluZ01vZGUgICAgT3BlcmF0aW5nTW9kZTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgIFdpZGVyQldDaGFuU3dpdGNoQW5uUHJlc2VudDsKKyAgICB0RG90MTFmSUVXaWRlckJXQ2hhblN3aXRjaEFubiBXaWRlckJXQ2hhblN3aXRjaEFubjsKKyNlbmRpZgorICAgIHREb3QxMWZJRU9CU1NTY2FuUGFyYW1ldGVycyBPQlNTU2NhblBhcmFtZXRlcnM7Cit9IHRTaXJQcm9iZVJlc3BCZWFjb24sICp0cFNpclByb2JlUmVzcEJlYWNvbjsKKworLy8gcHJvYmUgUmVxdWVzdCBzdHJ1Y3R1cmUKK3R5cGVkZWYgc3RydWN0IHNTaXJQcm9iZVJlcQoreworICAgIHRTaXJNYWNTU2lkICAgICAgICAgICAgICAgc3NJZDsKKyAgICB0U2lyTWFjUmF0ZVNldCAgICAgICAgICAgIHN1cHBvcnRlZFJhdGVzOworICAgIHRTaXJNYWNSYXRlU2V0ICAgICAgICAgICAgZXh0ZW5kZWRSYXRlczsKKyAgICB0RG90MTFmSUVXc2NQcm9iZVJlcSAgICAgIHByb2JlUmVxV3NjSWVJbmZvOworICAgIHREb3QxMWZJRUhUQ2FwcyAgICAgICAgICAgSFRDYXBzOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgc3NpZFByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICBzdXBwUmF0ZXNQcmVzZW50OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgZXh0ZW5kZWRSYXRlc1ByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICB3c2NJZVByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICBwMnBJZVByZXNlbnQ7CisjaWZkZWYgV0xBTl9GRUFUVVJFXzExQUMKKyAgICB0RG90MTFmSUVWSFRDYXBzICAgICAgICAgIFZIVENhcHM7CisjZW5kaWYKKworCit9IHRTaXJQcm9iZVJlcSwgKnRwU2lyUHJvYmVSZXE7CisKKy8vLyBBc3NvY2lhdGlvbiBSZXF1ZXN0IHN0cnVjdHVyZSAob25lIGRheSB0byBiZSByZXBsYWNlZCBieQorLy8vIHREb3QxMWZBc3NvY1JlcXVlc3QpCit0eXBlZGVmIHN0cnVjdCBzU2lyQXNzb2NSZXEKK3sKKworICAgIHRTaXJNYWNDYXBhYmlsaXR5SW5mbyAgICAgY2FwYWJpbGl0eUluZm87CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgICBsaXN0ZW5JbnRlcnZhbDsKKyAgICB0U2lyTWFjQWRkciAgICAgICAgICAgICAgIGN1cnJlbnRBcEFkZHI7IC8qIG9ubHkgaW4gcmVhc3NvYyBmcmFtZXMgKi8KKyAgICB0U2lyTWFjU1NpZCAgICAgICAgICAgICAgIHNzSWQ7CisgICAgdFNpck1hY1JhdGVTZXQgICAgICAgICAgICBzdXBwb3J0ZWRSYXRlczsKKyAgICB0U2lyTWFjUmF0ZVNldCAgICAgICAgICAgIGV4dGVuZGVkUmF0ZXM7CisKKyAgICB0U2lyQWRkdHNSZXFJbmZvICAgICAgICAgIGFkZHRzUmVxOworICAgIHRTaXJNYWNRb3NDYXBhYmlsaXR5U3RhSUUgcW9zQ2FwYWJpbGl0eTsKKworICAgIHRTaXJNYWNXcGFJbmZvICAgICAgICAgICAgd3BhOworICAgIHRTaXJNYWNSc25JbmZvICAgICAgICAgICAgcnNuOworICAgIHRTaXJBZGRpZSAgICAgICAgICAgICAgICAgYWRkSUU7CisgICAgCisgICAgdFNpclByb3BJRVN0cnVjdCAgICAgICAgICBwcm9wSUVpbmZvOworICAgIHRTaXJNYWNQb3dlckNhcGFiaWxpdHlJRSAgcG93ZXJDYXBhYmlsaXR5OworICAgIHRTaXJNYWNTdXBwb3J0ZWRDaGFubmVsSUUgc3VwcG9ydGVkQ2hhbm5lbHM7CisgICAgdERvdDExZklFSFRDYXBzICAgSFRDYXBzOworICAgIHREb3QxMWZJRVdNTUluZm9TdGF0aW9uICAgV01NSW5mb1N0YXRpb247CisgICAgLy8vIFRoaXMgaXMgc2V0IGlmIHRoZSBmcmFtZSBpcyBhIHJlYXNzb2MgcmVxdWVzdDoKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgIHJlYXNzb2NSZXF1ZXN0OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgc3NpZFByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICBzdXBwUmF0ZXNQcmVzZW50OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgZXh0ZW5kZWRSYXRlc1ByZXNlbnQ7CisKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgIHdtZUluZm9QcmVzZW50OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgcW9zQ2FwYWJpbGl0eVByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICBhZGR0c1ByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICB3c21DYXBhYmxlUHJlc2VudDsKKworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgd3BhUHJlc2VudDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgIHJzblByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICBhZGRJRVByZXNlbnQ7CisKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgIHBvd2VyQ2FwYWJpbGl0eVByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICBzdXBwb3J0ZWRDaGFubmVsc1ByZXNlbnQ7CisgICAgLy8ga2VlaW5nIGNvcHkgb2YgYXNzb2N0aW9uIHJlcXVlc3QgcmVjZWl2ZWQsIHRoaXMgaXMgCisgICAgLy8gcmVxdWlyZWQgZm9yIGluZGljYXRpbmcgdGhlIGZyYW1lIHRvIHVwcGVyIGxheWVycworICAgIHRBTklfVTMyICAgICAgICAgICAgICAgICAgYXNzb2NSZXFGcmFtZUxlbmd0aDsKKyAgICB0QU5JX1U4KiAgICAgICAgICAgICAgICAgIGFzc29jUmVxRnJhbWU7CisjaWZkZWYgV0xBTl9GRUFUVVJFXzExQUMKKyAgICB0RG90MTFmSUVWSFRDYXBzICAgICAgICAgIFZIVENhcHM7CisgICAgdERvdDExZklFT3BlcmF0aW5nTW9kZSAgICBvcGVyTW9kZTsKKyNlbmRpZgorfSB0U2lyQXNzb2NSZXEsICp0cFNpckFzc29jUmVxOworCisKKy8vLyBBc3NvY2lhdGlvbiBSZXNwb25zZSBzdHJ1Y3R1cmUgKG9uZSBkYXkgdG8gYmUgcmVwbGFjZWQgYnkKKy8vLyB0RG90MTFmQXNzb2NSZXF1ZXN0KQordHlwZWRlZiBzdHJ1Y3Qgc1NpckFzc29jUnNwCit7CisKKyAgICB0U2lyTWFjQ2FwYWJpbGl0eUluZm8gICAgIGNhcGFiaWxpdHlJbmZvOworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgICAgYWlkOworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgICAgc3RhdHVzQ29kZTsKKyAgICB0U2lyTWFjUmF0ZVNldCAgICAgICAgICAgIHN1cHBvcnRlZFJhdGVzOworICAgIHRTaXJNYWNSYXRlU2V0ICAgICAgICAgICAgZXh0ZW5kZWRSYXRlczsKKyAgICB0U2lyUHJvcElFU3RydWN0ICAgICAgICAgIHByb3BJRWluZm87CisgICAgdFNpck1hY0VkY2FQYXJhbVNldElFICAgICBlZGNhOworICAgIHRTaXJBZGR0c1JzcEluZm8gICAgICAgICAgYWRkdHNSc3A7CisgICAgdERvdDExZklFSFRDYXBzICAgSFRDYXBzOworICAgIHREb3QxMWZJRUhUSW5mbyAgICAgICAgICAgSFRJbmZvOworI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIKKyAgICB0RG90MTFmSUVGVEluZm8gICAgICAgICAgIEZUSW5mbzsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgIG1kaWVbU0lSX01ESUVfU0laRV07CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICBudW1fUklDRGF0YTsgCisgICAgdERvdDExZklFUklDRGF0YURlc2MgICAgICBSSUNEYXRhWzJdOworI2VuZGlmCisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICBudW1fdHNwZWNzOworICAgIHREb3QxMWZJRVdNTVRTUEVDICAgICAgICAgVFNQRUNJbmZvW1NJUl9FU0VfTUFYX1RTUEVDX0lFU107CisgICAgdFNpck1hY0VTRVRTTUlFICAgICAgICAgICB0c21JRTsKKyNlbmRpZgorCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICBzdXBwUmF0ZXNQcmVzZW50OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgZXh0ZW5kZWRSYXRlc1ByZXNlbnQ7CisKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgIGVkY2FQcmVzZW50OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgd21lRWRjYVByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICBhZGR0c1ByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICB3c21DYXBhYmxlUHJlc2VudDsKKyNpZiBkZWZpbmVkIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICBmdGluZm9QcmVzZW50OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgbWRpZVByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICByaWNQcmVzZW50OworI2VuZGlmCisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRQorICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgdHNwZWNQcmVzZW50OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgdHNtUHJlc2VudDsKKyNlbmRpZiAgICAKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgIHREb3QxMWZJRVZIVENhcHMg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YXJhbXNQcmVzZW50OworICAgIHRBTklfVTggICAgICAgICAgICAgICBjZlByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgIGlic3NQYXJhbVByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgIHRpbVByZXNlbnQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgIHJybVByZXNlbnQ7Cit9IHRTaXJFc2VCY25SZXBvcnRNYW5kYXRvcnlJZSwgKnRwU2lyRXNlQmNuUmVwb3J0TWFuZGF0b3J5SWU7CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0VTRV9VUExPQUQgKi8KKwordEFOSV9VOAorc2lySXNQcm9wQ2FwYWJpbGl0eUVuYWJsZWQoc3RydWN0IHNBbmlTaXJHbG9iYWwgKnBNYWMsIHRBTklfVTMyIGJpdG51bSk7CisKK3RTaXJSZXRTdGF0dXMKK3NpckdldENmZ1Byb3BDYXBzKHN0cnVjdCBzQW5pU2lyR2xvYmFsICosIHRBTklfVTE2ICopOworCit2b2lkIGRvdDExZkxvZyh0cEFuaVNpckdsb2JhbCBwTWFjLCBpbnQgblNldiwgY29uc3QgY2hhciAqbHBzekZvcm1hdCwgLi4uKTsKKworI2RlZmluZSBDRkdfR0VUX0lOVChuU3RhdHVzLCBwTWFjLCBuSXRlbSwgY2ZnICkgIGRvIHsgICAgICAgICAgICAgICAgXAorICAgICAgICAoblN0YXR1cykgPSB3bGFuX2NmZ0dldEludCggKHBNYWMpLCAobkl0ZW0pLCAmIChjZmcpICk7ICAgICAgXAorICAgICAgICBpZiAoIGVTSVJfU1VDQ0VTUyAhPSAoblN0YXR1cykgKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgZG90MTFmTG9nKCAocE1hYyksIExPR1AsIEZMKCJGYWlsZWQgdG8gcmV0cmlldmUgIiAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICNuSXRlbSAiIGZyb20gQ0ZHICglZCkuIiksIFwKKyAgICAgICAgICAgICAgICAgICAgICAgKG5TdGF0dXMpICk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgIHJldHVybiBuU3RhdHVzOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICB9IHdoaWxlICgwKQorCisjZGVmaW5lIENGR19HRVRfSU5UX05PX1NUQVRVUyhuU3RhdHVzLCBwTWFjLCBuSXRlbSwgY2ZnICkgZG8geyAgICAgICBcCisgICAgICAgIChuU3RhdHVzKSA9IHdsYW5fY2ZnR2V0SW50KCAocE1hYyksIChuSXRlbSksICYgKGNmZykgKTsgICAgICBcCisgICAgICAgIGlmICggZVNJUl9TVUNDRVNTICE9IChuU3RhdHVzKSApICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICBkb3QxMWZMb2coIChwTWFjKSwgTE9HUCwgRkwoIkZhaWxlZCB0byByZXRyaWV2ZSAiICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI25JdGVtICIgZnJvbSBDRkcgKCVkKS4iKSwgXAorICAgICAgICAgICAgICAgICAgICAgICAoblN0YXR1cykgKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgcmV0dXJuOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIH0gd2hpbGUgKDApCisKKyNkZWZpbmUgQ0ZHX0dFVF9TVFIoblN0YXR1cywgcE1hYywgbkl0ZW0sIGNmZywgbkNmZywgbk1heENmZykgZG8geyAgICAgIFwKKyAgICAgICAgKG5DZmcpID0gKG5NYXhDZmcpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgKG5TdGF0dXMpID0gd2xhbl9jZmdHZXRTdHIoIChwTWFjKSwgKG5JdGVtKSwgKGNmZyksICYgKG5DZmcpICk7IFwKKyAgICAgICAgaWYgKCBlU0lSX1NVQ0NFU1MgIT0gKG5TdGF0dXMpICkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgIGRvdDExZkxvZyggKHBNYWMpLCBMT0dQLCBGTCgiRmFpbGVkIHRvIHJldHJpZXZlICIgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjbkl0ZW0gIiBmcm9tIENGRyAoJWQpLiIpLCAgICBcCisgICAgICAgICAgICAgICAgICAgICAgIChuU3RhdHVzKSApOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICByZXR1cm4gblN0YXR1czsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgIH0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgfSB3aGlsZSAoMCkKKworI2RlZmluZSBDRkdfR0VUX1NUUl9OT19TVEFUVVMoblN0YXR1cywgcE1hYywgbkl0ZW0sIGNmZywgbkNmZywgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbk1heENmZykgZG8geyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAobkNmZykgPSAobk1heENmZyk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAoblN0YXR1cykgPSB3bGFuX2NmZ0dldFN0ciggKHBNYWMpLCAobkl0ZW0pLCAoY2ZnKSwgJiAobkNmZykgKTsgXAorICAgICAgICBpZiAoIGVTSVJfU1VDQ0VTUyAhPSAoblN0YXR1cykgKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgZG90MTFmTG9nKCAocE1hYyksIExPR1AsIEZMKCJGYWlsZWQgdG8gcmV0cmlldmUgIiAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICNuSXRlbSAiIGZyb20gQ0ZHICglZCkuIiksICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgKG5TdGF0dXMpICk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgIHJldHVybjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICB9IHdoaWxlICgwKQorCit2b2lkIHN3YXBCaXRGaWVsZDE2KHRBTklfVTE2IGluLCB0QU5JX1UxNiAqb3V0KTsKKworLy8gQ3VycmVudGx5IGltcGxlbWVudGVkIGFzICJzaGltcyIgYmV0d2VlbiBjYWxsZXJzICYgdGhlIG5ldyBmcmFtZXNjLQorLy8gZ2VuZXJhdGVkIGNvZGU6CisKK3RTaXJSZXRTdGF0dXMKK3NpckNvbnZlcnRQcm9iZVJlcUZyYW1lMlN0cnVjdChzdHJ1Y3Qgc0FuaVNpckdsb2JhbCAqcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpmcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBsZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJQcm9iZVJlcSBwcm9iZSk7CisKK3RTaXJSZXRTdGF0dXMKK3NpckNvbnZlcnRQcm9iZUZyYW1lMlN0cnVjdChzdHJ1Y3Qgc0FuaVNpckdsb2JhbCAqcE1hYywgdEFOSV9VOCAqZnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyUHJvYmVSZXNwQmVhY29uIHByb2JlKTsKKwordFNpclJldFN0YXR1cworc2lyQ29udmVydEFzc29jUmVxRnJhbWUyU3RydWN0KHN0cnVjdCBzQW5pU2lyR2xvYmFsICpwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKiBmcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBsZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJBc3NvY1JlcSBhc3NvYyk7CisKK3RTaXJSZXRTdGF0dXMKK3NpckNvbnZlcnRBc3NvY1Jlc3BGcmFtZTJTdHJ1Y3Qoc3RydWN0IHNBbmlTaXJHbG9iYWwgKnBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKiBmcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFNpckFzc29jUnNwIGFzc29jKTsKKwordFNpclJldFN0YXR1cworc2lyQ29udmVydFJlYXNzb2NSZXFGcmFtZTJTdHJ1Y3Qoc3RydWN0IHNBbmlTaXJHbG9iYWwgKnBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICogZnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBsZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFNpckFzc29jUmVxIGFzc29jKTsKKwordFNpclJldFN0YXR1cworc2lyUGFyc2VCZWFjb25JRShzdHJ1Y3Qgc0FuaVNpckdsb2JhbCAqcE1hYywKKyAgICAgICAgICAgICAgICAgdHBTaXJQcm9iZVJlc3BCZWFjb24gICBwQmVhY29uU3RydWN0LAorICAgICAgICAgICAgICAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAqcFBheWxvYWQsCisgICAgICAgICAgICAgICAgIHRBTklfVTMyICAgICAgICAgICAgICAgICAgICBwYXlsb2FkTGVuZ3RoKTsKKworI2lmIGRlZmluZWQoRkVBVFVSRV9XTEFOX0VTRV9VUExPQUQpCit0U2lyUmV0U3RhdHVzCitzaXJGaWxsQmVhY29uTWFuZGF0b3J5SUVmb3JFc2VCY25SZXBvcnQodHBBbmlTaXJHbG9iYWwgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICAgICAgICAgICpwUGF5bG9hZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0QU5JX1UzMiAgICBwYXlsb2FkTGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggICAgICAgICAqKm91dEllQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICAgICAgICAgKnBPdXRJZUxlbik7CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0VTRV9VUExPQUQgKi8KKwordFNpclJldFN0YXR1cworc2lyQ29udmVydEJlYWNvbkZyYW1lMlN0cnVjdChzdHJ1Y3Qgc0FuaVNpckdsb2JhbCAqcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJlYWNvbkZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFNpclByb2JlUmVzcEJlYWNvbiBwQmVhY29uU3RydWN0KTsKKwordFNpclJldFN0YXR1cworc2lyQ29udmVydEF1dGhGcmFtZTJTdHJ1Y3Qoc3RydWN0IHNBbmlTaXJHbG9iYWwgKnBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICogZnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBsZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFNpck1hY0F1dGhGcmFtZUJvZHkgYXV0aCk7CisKK3RTaXJSZXRTdGF0dXMKK3NpckNvbnZlcnRBZGR0c1JlcTJTdHJ1Y3Qoc3RydWN0IHNBbmlTaXJHbG9iYWwgKnBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKmZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBsZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJBZGR0c1JlcUluZm8gKmFkZFRzKTsKKwordFNpclJldFN0YXR1cworc2lyQ29udmVydEFkZHRzUnNwMlN0cnVjdChzdHJ1Y3Qgc0FuaVNpckdsb2JhbCAqcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqZnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIGxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpckFkZHRzUnNwSW5mbyAqYWRkdHMpOworCit0U2lyUmV0U3RhdHVzCitzaXJDb252ZXJ0RGVsdHNSZXEyU3RydWN0KHN0cnVjdCBzQW5pU2lyR2xvYmFsICpwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpmcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyRGVsdHNSZXFJbmZvICpkZWxUcyk7Cit0U2lyUmV0U3RhdHVzCitzaXJDb252ZXJ0UW9zTWFwQ29uZmlndXJlRnJhbWUyU3RydWN0KHRwQW5pU2lyR2xvYmFsICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggICAgICAgICAgICAgICAqcEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAgICAgICAgICAgICAgIG5GcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpclFvc01hcFNldCAgICAgICpwUW9zTWFwU2V0KTsKKworI2lmZGVmIEFOSV9TVVBQT1JUXzExSAordFNpclJldFN0YXR1cworc2lyQ29udmVydFRwY1JlcUZyYW1lMlN0cnVjdChzdHJ1Y3Qgc0FuaVNpckdsb2JhbCAqLCB0QU5JX1U4ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyTWFjVHBjUmVxQWN0aW9uRnJhbWUsIHRBTklfVTMyKTsKKwordFNpclJldFN0YXR1cworc2lyQ29udmVydE1lYXNSZXFGcmFtZTJTdHJ1Y3Qoc3RydWN0IHNBbmlTaXJHbG9iYWwgKiwgdEFOSV9VOCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJNYWNNZWFzUmVxQWN0aW9uRnJhbWUsIHRBTklfVTMyKTsKKyNlbmRpZgorCisKKy8qKgorICogXGJyaWVmIFBvcHVsYXRlZCBhIHREb3QxMWZGZkNhcGFiaWxpdGllcworICoKKyAqIFxzYSBQb3B1bGF0ZWREb3QxMWZDYXBhYmlsaXRpZXMyCisgKgorICoKKyAqIFxwYXJhbSBwTWFjIFBvaW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isgKgorICoKKyAqLworCitzdHJ1Y3Qgc0RwaEhhc2hOb2RlOworCit0U2lyUmV0U3RhdHVzCitQb3B1bGF0ZURvdDExZkNhcGFiaWxpdGllczIodHBBbmlTaXJHbG9iYWwgICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZGZkNhcGFiaWxpdGllcyAqcERvdDExZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qgc0RwaEhhc2hOb2RlICAgKnBTdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gICAgICAgICAgICBwc2Vzc2lvbkVudHJ5KTsKKworLy8vIFBvcHVsYXRlIGEgdERvdDExZklFQ2hhblN3aXRjaEFubgordm9pZAorUG9wdWxhdGVEb3QxMWZDaGFuU3dpdGNoQW5uKHRwQW5pU2lyR2xvYmFsICAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFQ2hhblN3aXRjaEFubiAqcERvdDExZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KTsKKworLy8vIFBvcHVsYXRlIGEgdERvdDExZklFQ2hhblN3aXRjaEFubgordm9pZAorUG9wdWxhdGVEb3QxMWZFeHRDaGFuU3dpdGNoQW5uKHRwQW5pU2lyR2xvYmFsICAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUV4dENoYW5Td2l0Y2hBbm4gKnBEb3QxMWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpOworCisvLy8gUG9wdWxhdGUgYSB0RG90MTFmSUVDb3VudHJ5Cit0U2lyUmV0U3RhdHVzCitQb3B1bGF0ZURvdDExZkNvdW50cnkodHBBbmlTaXJHbG9iYWwgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVDb3VudHJ5ICpwRG90MTFmLCAgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSk7CisKKy8vLyBQb3B1bGF0ZWQgYSBQb3B1bGF0ZURvdDExZkRTUGFyYW1zCit0U2lyUmV0U3RhdHVzCitQb3B1bGF0ZURvdDExZkRTUGFyYW1zKHRwQW5pU2lyR2xvYmFsICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVEU1BhcmFtcyAqcERvdDExZiwgdEFOSV9VOCBjaGFubmVsLAorICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KTsKKworCisvLy8gUG9wdWxhdGVkIGEgdERvdDExZklFRURDQVBhcmFtU2V0Cit2b2lkCitQb3B1bGF0ZURvdDExZkVEQ0FQYXJhbVNldCh0cEFuaVNpckdsb2JhbCAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVFRENBUGFyYW1TZXQgKnBEb3QxMWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KTsKKwordFNpclJldFN0YXR1cworUG9wdWxhdGVEb3QxMWZFUlBJbmZvKHRwQW5pU2lyR2xvYmFsICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFRVJQSW5mbyAqcERvdDExZiwgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSk7CisKK3RTaXJSZXRTdGF0dXMKK1BvcHVsYXRlRG90MTFmRXh0U3VwcFJhdGVzKHRwQW5pU2lyR2xvYmFsICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggIG5DaGFubmVsTnVtLCB0RG90MTFmSUVFeHRTdXBwUmF0ZXMgKnBEb3QxMWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KTsKKworI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX1ZPV0lGSQordFNpclJldFN0YXR1cyAKK1BvcHVsYXRlRG90MTFmQmVhY29uUmVwb3J0KHRwQW5pU2lyR2xvYmFsICAgICAgIHBNYWMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFTWVhc3VyZW1lbnRSZXBvcnQgKnBEb3QxMWYsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY0JlYWNvblJlcG9ydCAqcEJlYWNvblJlcG9ydCApOworI2VuZGlmCisKKy8qKgorICogXGJyaWVmIFBvcHVsYXRlIGEgdERvdDExZklFRXh0U3VwcFJhdGVzCisgKgorICoKKyAqIFxwYXJhbSBwTWFjIFBvaW50ZXIgdG8gdGhlIGdsb2JhbCBNQUMgZGF0YXN0cnVjdHVyZQorICoKKyAqIFxwYXJhbSBuQ2hhbm5lbE51bSBDaGFubmVsIG9uIHdoaWNoIHRoZSBlbmNsb3NpbmcgZnJhbWUgd2lsbCBiZSBnb2luZyBvdXQKKyAqCisgKiBccGFyYW0gcERvdDExZiBBZGRyZXNzIG9mIGEgdERvdDExZklFRXh0U3VwcFJhdGVzIHN0cnVjdCB0byBiZSBmaWxsZWQgaW4uCisgKgorICoKKyAqIFRoaXMgbWV0aG9kIGlzIGEgTk9QIGlmIHRoZSBjaGFubmVsIGlzIGdyZWF0ZXIgdGhhbiAxNC4KKyAqCisgKgorICovCisKK3RTaXJSZXRTdGF0dXMKK1BvcHVsYXRlRG90MTFmRXh0U3VwcFJhdGVzMSh0cEFuaVNpckdsb2JhbCAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgIG5DaGFubmVsTnVtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUV4dFN1cHBSYXRlcyAqcERvdDExZik7CisKK3RTaXJSZXRTdGF0dXMKK1BvcHVsYXRlRG90MTFmSENGKHRwQW5pU2lyR2xvYmFsICBwTWFjLAorICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgICAgICAgIGNhcEVuYWJsZSwKKyAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUhDRiAgICpwRG90MTFmKTsKKwordFNpclJldFN0YXR1cworUG9wdWxhdGVEb3QxMWZIVENhcHModHBBbmlTaXJHbG9iYWwgICAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiAgICAgIHBzZXNzaW9uRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVIVENhcHMgKnBEb3QxMWYpOworCit0U2lyUmV0U3RhdHVzCitQb3B1bGF0ZURvdDExZkhUSW5mbyh0cEFuaVNpckdsb2JhbCAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVIVEluZm8gKnBEb3QxMWYsCisgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiAgICAgIHBzZXNzaW9uRW50cnkpOworCisjaWZkZWYgV0xBTl9GRUFUVVJFX0FQX0hUNDBfMjRHCit0U2lyUmV0U3RhdHVzCitQb3B1bGF0ZURvdDExZk9CU1NTY2FuUGFyYW1ldGVycyh0cEFuaVNpckdsb2JhbCAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVPQlNTU2NhblBhcmFtZXRlcnMgKnBEb3QxMWYsCisgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiAgICAgIHBzZXNzaW9uRW50cnkpOworI2VuZGlmCisKK3ZvaWQgUG9wdWxhdGVEb3QxMWZJQlNTUGFyYW1zKHRwQW5pU2lyR2xvYmFsICBwTWFjLAorICAgICAgIHREb3QxMWZJRUlCU1NQYXJhbXMgKnBEb3QxMWYsIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpOworCisjaWZkZWYgQU5JX1NVUFBPUlRfMTFICit0U2lyUmV0U3RhdHVzCitQb3B1bGF0ZURvdDExZk1lYXN1cmVtZW50UmVwb3J0MCh0cEFuaVNpckdsb2JhbCAgICAgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyTWFjTWVhc1JlcUFjdGlvbkZyYW1lICBwUmVxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFTWVhc3VyZW1lbnRSZXBvcnQgKnBEb3QxMWYpOworCisvLy8gUG9wdWxhdGUgYSB0RG90MTFmSUVNZWFzdXJlbWVudFJlcG9ydCB3aGVuIHRoZSByZXBvcnQgdHlwZSBpcyBDQ0EKK3RTaXJSZXRTdGF0dXMKK1BvcHVsYXRlRG90MTFmTWVhc3VyZW1lbnRSZXBvcnQxKHRwQW5pU2lyR2xvYmFsICAgICAgICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJNYWNNZWFzUmVxQWN0aW9uRnJhbWUgIHBSZXEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVNZWFzdXJlbWVudFJlcG9ydCAqcERvdDExZik7CisKKy8vLyBQb3B1bGF0ZSBhIHREb3QxMWZJRU1lYXN1cmVtZW50UmVwb3J0IHdoZW4gdGhlIHJlcG9ydCB0eXBlIGlzIFJQSSBIaXN0Cit0U2lyUmV0U3RhdHVzCitQb3B1bGF0ZURvdDExZk1lYXN1cmVtZW50UmVwb3J0Mih0cEFuaVNpckdsb2JhbCAgICAgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyTWFjTWVhc1JlcUFjdGlvbkZyYW1lICBwUmVxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFTWVhc3VyZW1lbnRSZXBvcnQgKnBEb3QxMWYpOworI2VuZGlmICAvL0FOSV9TVVBQT1JUXzExSAorCisvLy8gUG9wdWxhdGUgYSB0RG90MTFmSUVQb3dlckNhcHMKK3ZvaWQKK1BvcHVsYXRlRG90MTFmUG93ZXJDYXBzKHRwQW5pU2lyR2xvYmFsICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUG93ZXJDYXBzICpwQ2FwcywKKyAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggbkFzc29jVHlwZSx0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KTsKKworLy8vIFBvcHVsYXRlIGEgdERvdDExZklFUG93ZXJDb25zdHJhaW50cwordFNpclJldFN0YXR1cworUG9wdWxhdGVEb3QxMWZQb3dlckNvbnN0cmFpbnRzKHRwQW5pU2lyR2xvYmFsICAgICAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUG93ZXJDb25zdHJhaW50cyAqcERvdDExZik7CisKK3RTaXJSZXRTdGF0dXMKK1BvcHVsYXRlRG90MTFmUHJvcENhcGFiaWxpdHkodHBBbmlTaXJHbG9iYWwgICAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICAgICAgICAgICAgICAgICAgICAgIGNhcEVuYWJsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUHJvcENhcGFiaWxpdHkgKnBEb3QxMWYpOworCit2b2lkCitQb3B1bGF0ZURvdDExZlByb3BDaGFublN3aXRjaEFubih0cEFuaVNpckdsb2JhbCAgICAgICAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICAgICAgICAgICAgY2FwRW5hYmxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUHJvcENoYW5uU3dpdGNoQW5uICpwRG90MTFmKTsKKwordm9pZAorUG9wdWxhdGVEb3QxMWZQcm9wRURDQVBhcmFtcyh0cEFuaVNpckdsb2JhbCAgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgICAgICAgY2FwcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUHJvcEVEQ0FQYXJhbXMgKnBEb3QxMWYpOworCit0U2lyUmV0U3RhdHVzCitQb3B1bGF0ZURvdDExZlByb3BTdXBwUmF0ZXModHBBbmlTaXJHbG9iYWwgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICAgICAgIGNhcEVuYWJsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVQcm9wU3VwcFJhdGVzICpwRG90MTFmKTsKKwordm9pZAorUG9wdWxhdGVEb3QxMWZRT1NDYXBzQXAodHBBbmlTaXJHbG9iYWwgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUU9TQ2Fwc0FwICpwRG90MTFmLCB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KTsKKwordm9pZAorUG9wdWxhdGVEb3QxMWZRT1NDYXBzU3RhdGlvbih0cEFuaVNpckdsb2JhbCAgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUU9TQ2Fwc1N0YXRpb24gKnBEb3QxMWYpOworCit0U2lyUmV0U3RhdHVzIAorUG9wdWxhdGVEb3QxMWZSU04odHBBbmlTaXJHbG9iYWwgIHBNYWMsCisgICAgICAgICAgICAgICAgICB0cFNpclJTTmllICAgICAgcFJzbkllLAorICAgICAgICAgICAgICAgICAgdERvdDExZklFUlNOICAgKnBEb3QxMWYpOworCit0U2lyUmV0U3RhdHVzCitQb3B1bGF0ZURvdDExZlJTTk9wYXF1ZSggdHBBbmlTaXJHbG9iYWwgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgdHBTaXJSU05pZSAgICAgIHBSc25JZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVSU05PcGFxdWUgKnBEb3QxMWYgKTsKKworI2lmIGRlZmluZWQoRkVBVFVSRV9XTEFOX1dBUEkpCisKK3RTaXJSZXRTdGF0dXMKK1BvcHVsYXRlRG90MTFmV0FQSSh0cEFuaVNpckdsb2JhbCAgcE1hYywKKyAgICAgICAgICAgICAgICAgIHRwU2lyUlNOaWUgICAgICBwUnNuSWUsCisgICAgICAgICAgICAgICAgICB0RG90MTFmSUVXQVBJICAgKnBEb3QxMWYpOworCit0U2lyUmV0U3RhdHVzIFBvcHVsYXRlRG90MTFmV0FQSU9wYXF1ZSggdHBBbmlTaXJHbG9iYWwgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJSU05pZSAgICAgICAgICBwUnNuSWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVXQVBJT3BhcXVlICpwRG90MTFmICk7CisKKyNlbmRpZiAvL2RlZmluZWQoRkVBVFVSRV9XTEFOX1dBUEkpCisKKy8vLyBQb3B1bGF0ZSBhIHREb3QxMWZJRVNTSUQgZ2l2ZW4gYSB0U2lyTWFjU1NpZAordm9pZAorUG9wdWxhdGVEb3QxMWZTU0lEKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgdFNpck1hY1NTaWQgICAqcEludGVybmFsLAorICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVNTSUQgKnBEb3QxMWYpOworCisvLy8gUG9wdWxhdGUgYSB0RG90MTFmSUVTU0lEIGZyb20gQ0ZHCit0U2lyUmV0U3RhdHVzCitQb3B1bGF0ZURvdDExZlNTSUQyKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVNTSUQgKnBEb3QxMWYpOworCisKKy8qKgorICogXGJyaWVmIFBv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b3J0KHRwQW5pU2lyR2xvYmFsICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFVFBDUmVwb3J0ICpwRG90MTFmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KTsKKworLy8vIFBvcHVsYXRlIGEgdERvdDExRmZUU0luZm8KK3ZvaWQgUG9wdWxhdGVEb3QxMWZUU0luZm8odFNpck1hY1RTSW5mbyAgICpwSW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkZmVFNJbmZvICpwRG90MTFmKTsKKworCit2b2lkIFBvcHVsYXRlRG90MTFmV01NKHRwQW5pU2lyR2xvYmFsICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFV01NSW5mb0FwICAqcEluZm8sCisgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdNTVBhcmFtcyAqcFBhcmFtcywKKyAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFV01NQ2FwcyAgICpwQ2FwcywKKyAgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gICAgICAgIHBzZXNzaW9uRW50cnkpOworCit2b2lkIFBvcHVsYXRlRG90MTFmV01NQ2Fwcyh0RG90MTFmSUVXTU1DYXBzICpwQ2Fwcyk7CisKKyNpZiBkZWZpbmVkKEZFQVRVUkVfV0xBTl9FU0UpCisvLyBGaWxsIHRoZSBFU0UgdmVyc2lvbiBJRQordm9pZCBQb3B1bGF0ZURvdDExZkVTRVZlcnNpb24odERvdDExZklFRVNFVmVyc2lvbiAqcEVTRVZlcnNpb24pOworLy8gRmlsbCB0aGUgUmFkaW8gTWFuYWdlbWVudCBDYXBhYmlsaXR5Cit2b2lkIFBvcHVsYXRlRG90MTFmRVNFUmFkTWdtdENhcCh0RG90MTFmSUVFU0VSYWRNZ210Q2FwICpwRVNFUmFkTWdtdENhcCk7CisvLyBGaWxsIHRoZSBDQ0tNIElFCit0U2lyUmV0U3RhdHVzIFBvcHVsYXRlRG90MTFmRVNFQ2NrbU9wYXF1ZSggdHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFNpckNDS01pZSAgICBwQ0NLTWllLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUVTRUNja21PcGFxdWUgKnBEb3QxMWYgKTsKKwordm9pZCBQb3B1bGF0ZURvdDExVFNSU0lFKHRwQW5pU2lyR2xvYmFsICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNFU0VUU1JTSUUgICAgICpwT2xkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUVTRVRyYWZTdHJtUmF0ZVNldCAgKnBEb3QxMWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCByYXRlX2xlbmd0aCk7Cit2b2lkIFBvcHVsYXRlRG90MTFmUmVBc3NvY1RzcGVjKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHREb3QxMWZSZUFzc29jUmVxdWVzdCAqcFJlYXNzb2MsIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpOworI2VuZGlmCisKK3ZvaWQgUG9wdWxhdGVEb3QxMWZXTU1JbmZvQXAodHBBbmlTaXJHbG9iYWwgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVXTU1JbmZvQXAgKnBJbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KTsKKwordm9pZCBQb3B1bGF0ZURvdDExZldNTUluZm9TdGF0aW9uKHRwQW5pU2lyR2xvYmFsICAgICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdNTUluZm9TdGF0aW9uICpwSW5mbyk7CisKK3ZvaWQgUG9wdWxhdGVEb3QxMWZXTU1QYXJhbXModHBBbmlTaXJHbG9iYWwgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVXTU1QYXJhbXMgKnBQYXJhbXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uICAgICAgICBwc2Vzc2lvbkVudHJ5KTsKKworLyoqCisgKiBcYnJpZWYgUG9wdWxhdGUgYSB0RG90MTFmSUVXTU1TY2hlZHVsZQorICoKKyAqIFxzYSBQb3B1bGF0ZWREb3QxMWZTY2hlZHVsZQorICoKKyAqCisgKiBccGFyYW0gcFNjaGVkdWxlIEFkZHJlc3Mgb2YgYSB0U2lyTWFjU2NoZWR1bGVJRSBzdHJ1Y3QKKyAqCisgKiBccGFyYW0gcERvdDExZiBBZGRyZXNzIG9mIGEgdERvdDExZklFV01NU2NoZWR1bGUgdG8gYmUgZmlsbGVkIGluCisgKgorICoKKyAqLworCit2b2lkCitQb3B1bGF0ZURvdDExZldNTVNjaGVkdWxlKHRTaXJNYWNTY2hlZHVsZUlFICAgICpwU2NoZWR1bGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdNTVNjaGVkdWxlICpwRG90MTFmKTsKKwordFNpclJldFN0YXR1cworUG9wdWxhdGVEb3QxMWZXUEEodHBBbmlTaXJHbG9iYWwgIHBNYWMsCisgICAgICAgICAgICAgICAgICB0cFNpclJTTmllICAgICAgcFJzbkllLAorICAgICAgICAgICAgICAgICAgdERvdDExZklFV1BBICAgKnBEb3QxMWYpOworCit0U2lyUmV0U3RhdHVzCitQb3B1bGF0ZURvdDExZldQQU9wYXF1ZSggdHBBbmlTaXJHbG9iYWwgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyUlNOaWUgICAgICAgICAgcFJzbkllLAorICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdQQU9wYXF1ZSAqcERvdDExZiApOworCit2b2lkCitQb3B1bGF0ZURvdDExZlRTUEVDKHRTaXJNYWNUc3BlY0lFICAqcE9sZCwKKyAgICAgICAgICAgICAgICAgICAgdERvdDExZklFVFNQRUMgICpwRG90MTFmKTsKKwordm9pZAorUG9wdWxhdGVEb3QxMWZXTU1UU1BFQyh0U2lyTWFjVHNwZWNJRSAgICAgKnBPbGQsCisgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdNTVRTUEVDICAqcERvdDExZik7CisKK3RTaXJSZXRTdGF0dXMKK1BvcHVsYXRlRG90MTFmVENMQVModHBBbmlTaXJHbG9iYWwgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgIHRTaXJUY2xhc0luZm8gICpwT2xkLAorICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVUQ0xBUyAqcERvdDExZik7CisKK3RTaXJSZXRTdGF0dXMKK1BvcHVsYXRlRG90MTFmV01NVENMQVModHBBbmlTaXJHbG9iYWwgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgIHRTaXJUY2xhc0luZm8gICAgICpwT2xkLAorICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVXTU1UQ0xBUyAqcERvdDExZik7CisKKwordFNpclJldFN0YXR1cyBQb3B1bGF0ZURvdDExZldzYyh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVXc2NCZWFjb24gKnBEb3QxMWYpOworCit0U2lyUmV0U3RhdHVzIFBvcHVsYXRlRG90MTFmV3NjUmVnaXN0cmFySW5mbyh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFV3NjQmVhY29uICpwRG90MTFmKTsKKwordFNpclJldFN0YXR1cyBEZVBvcHVsYXRlRG90MTFmV3NjUmVnaXN0cmFySW5mbyh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVXc2NCZWFjb24gKnBEb3QxMWYpOworCit0U2lyUmV0U3RhdHVzIFBvcHVsYXRlRG90MTFmUHJvYmVSZXNXUFNJRXModHBBbmlTaXJHbG9iYWwgcE1hYywgdERvdDExZklFV3NjUHJvYmVSZXMgKnBEb3QxMWYsIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpOwordFNpclJldFN0YXR1cyBQb3B1bGF0ZURvdDExZkFzc29jUmVzV1BTSUVzKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHREb3QxMWZJRVdzY0Fzc29jUmVzICpwRG90MTFmLCB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KTsKK3RTaXJSZXRTdGF0dXMgUG9wdWxhdGVEb3QxMWZCZWFjb25XUFNJRXModHBBbmlTaXJHbG9iYWwgcE1hYywgdERvdDExZklFV3NjQmVhY29uICpwRG90MTFmLCB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KTsKKwordFNpclJldFN0YXR1cyBQb3B1bGF0ZURvdDExZldzY0luUHJvYmVSZXModHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdzY1Byb2JlUmVzICpwRG90MTFmKTsKKwordFNpclJldFN0YXR1cyBQb3B1bGF0ZURvdDExZldzY1JlZ2lzdHJhckluZm9JblByb2JlUmVzKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFV3NjUHJvYmVSZXMgKnBEb3QxMWYpOworCit0U2lyUmV0U3RhdHVzIERlUG9wdWxhdGVEb3QxMWZXc2NSZWdpc3RyYXJJbmZvSW5Qcm9iZVJlcyh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFV3NjUHJvYmVSZXMgKnBEb3QxMWYpOworCisKK3RTaXJSZXRTdGF0dXMgUG9wdWxhdGVEb3QxMWZBc3NvY1Jlc1dzY0lFKHRwQW5pU2lyR2xvYmFsIHBNYWMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFV3NjQXNzb2NSZXMgKnBEb3QxMWYsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJBc3NvY1JlcSBwUmN2ZEFzc29jUmVxKTsKKwordFNpclJldFN0YXR1cyBQb3B1bGF0ZURvdDExQXNzb2NSZXNQMlBJRSh0cEFuaVNpckdsb2JhbCBwTWFjLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVAyUEFzc29jUmVzICpwRG90MTFmLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyQXNzb2NSZXEgcFJjdmRBc3NvY1JlcSk7CisKK3RTaXJSZXRTdGF0dXMgUG9wdWxhdGVEb3QxMWZXc2NJbkFzc29jUmVzKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVXc2NBc3NvY1JlcyAqcERvdDExZik7CisKKworI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX1ZPV0lGSQordFNpclJldFN0YXR1cyBQb3B1bGF0ZURvdDExZldGQVRQQyggdHBBbmlTaXJHbG9iYWwgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVXRkFUUEMgKnBEb3QxMWYsIHRBTklfVTggdHhQb3dlciwgdEFOSV9VOCBsaW5rTWFyZ2luICk7CisKK3RTaXJSZXRTdGF0dXMgUG9wdWxhdGVEb3QxMWZSUk1JZSggdHBBbmlTaXJHbG9iYWwgcE1hYywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVJSTUVuYWJsZWRDYXAgKnBEb3QxMWYsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiAgICBwc2Vzc2lvbkVudHJ5ICk7CisjZW5kaWYKKworI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIKK3ZvaWQgUG9wdWxhdGVNRElFKCB0cEFuaVNpckdsb2JhbCAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVNb2JpbGl0eURvbWFpbiAqcERvdDExZiwgdEFOSV9VOCBtZGllW10gKTsKK3ZvaWQgUG9wdWxhdGVGVEluZm8oIHRwQW5pU2lyR2xvYmFsICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUZUSW5mbyAgICAgKnBEb3QxMWYgKTsKKyNlbmRpZgorCit2b2lkIFBvcHVsYXRlRG90MTFmQXNzb2NSc3BSYXRlcyAoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHREb3QxMWZJRVN1cHBSYXRlcyAqcFN1cHAsIAorICAgICAgdERvdDExZklFRXh0U3VwcFJhdGVzICpwRXh0LCB0QU5JX1UxNiAqXzExYlJhdGVzLCB0QU5JX1UxNiAqXzExYVJhdGVzICk7CisKK2ludCBGaW5kSUVMb2NhdGlvbiggdHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyUlNOaWUgcFJzbkllLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBFSUQpOworI2VuZGlmCisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQwordFNpclJldFN0YXR1cworUG9wdWxhdGVEb3QxMWZWSFRDYXBzKHRwQW5pU2lyR2xvYmFsICBwTWFjLCB0RG90MTFmSUVWSFRDYXBzICpwRG90MTFmLAorICAgICAgICAgIHRBTklfVTggbkNoYW5uZWxOdW0sIHRBbmlCb29sIGlzUHJvYmVSc3BBc3NvY1JzcEJlYWNvbik7CisKK3RTaXJSZXRTdGF0dXMKK1BvcHVsYXRlRG90MTFmVkhUT3BlcmF0aW9uKHRwQW5pU2lyR2xvYmFsICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFVkhUT3BlcmF0aW9uICAqcERvdDExZiwgdEFOSV9VOCBuQ2hhbm5lbE51bSk7CisKK3RTaXJSZXRTdGF0dXMKK1BvcHVsYXRlRG90MTFmVkhURXh0QnNzTG9hZCh0cEFuaVNpckdsb2JhbCAgcE1hYywgdERvdDExZklFVkhURXh0QnNzTG9hZCAgICpwRG90MTFmKTsKKwordFNpclJldFN0YXR1cworUG9wdWxhdGVEb3QxMWZFeHRDYXAodHBBbmlTaXJHbG9iYWwgcE1hYywgdERvdDExZklFRXh0Q2FwICogcERvdDExZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0UEVTZXNzaW9uICpzZXNzaW9uRW50cnkpOworCit0U2lyUmV0U3RhdHVzCitQb3B1bGF0ZURvdDExZk9wZXJhdGluZ01vZGUodHBBbmlTaXJHbG9iYWwgcE1hYywgdERvdDExZklFT3BlcmF0aW5nTW9kZSAqcERvdDExZiwgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSApOworCit2b2lkCitQb3B1bGF0ZURvdDExZldpZGVyQldDaGFuU3dpdGNoQW5uKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdpZGVyQldDaGFuU3dpdGNoQW5uICpwRG90MTFmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KTsKKyNlbmRpZgorCit2b2lkIFBvcHVsYXRlRG90MTFmVGltZW91dEludGVydmFsKCB0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFVGltZW91dEludGVydmFsICpwRG90MTFmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCB0eXBlLCB0QU5JX1UzMiB2YWx1ZSApOworCit0U2lyUmV0U3RhdHVzIFZhbGlkYXRlQW5kUmVjdGlmeUlFcyh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcE1nbXRGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5GcmFtZUJ5dGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKm5NaXNzaW5nUnNuQnl0ZXMpOwpkaWZmIC0tZ2l0IGEvd2xhbi9wcmltYS9DT1JFL01BQy9zcmMvaW5jbHVkZS9waHlHbG9iYWwuaCBiL3dsYW4vcHJpbWEvQ09SRS9NQUMvc3JjL2luY2x1ZGUvcGh5R2xvYmFsLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNTg1OWUxZQotLS0gL2Rldi9udWxsCisrKyBiL3dsYW4vcHJpbWEvQ09SRS9NQUMvc3JjL2luY2x1ZGUvcGh5R2xvYmFsLmgKQEAgLTAsMCArMSwxMDUgQEAKKy8qCisgKiBDb3B5cmlnaHQgKGMpIDIwMTItMjAxMyBUaGUgTGludXggRm91bmRhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KKyAqCisgKiBQcmV2aW91c2x5IGxpY2Vuc2VkIHVuZGVyIHRoZSBJU0MgbGljZW5zZSBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKgorICoKKyAq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ZSAgICAgICAgICAgIE1vZGlmaWVkIGJ5ICAgIE1vZGlmaWNhdGlvbiBJbmZvcm1hdGlvbgorICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAqLworCisjaWZuZGVmIF9fU0lSQ09NTU9OX0gKKyNkZWZpbmUgX19TSVJDT01NT05fSAorCisjaW5jbHVkZSAic2lyQXBpLmgiCisjaW5jbHVkZSAic2lyUGFyYW1zLmgiCisjaW5jbHVkZSAiVm9zc1dyYXBwZXIuaCIKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAgICAgICBTSVJJVVMgU1lTVEVNIEVYVEVSTkFMIEdMT0JBTFMgICAgICAgICAgKgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKKy8vIEFsbCB0aGUgZm9sbG93aW5nIGFyZSByZXNvdXJjZSBkZWZpbml0aW9ucworCisjZW5kaWYgLyogX19TSVJDT01NT05fSCAqLwpkaWZmIC0tZ2l0IGEvd2xhbi9wcmltYS9DT1JFL01BQy9zcmMvaW5jbHVkZS9zaXJEZWJ1Zy5oIGIvd2xhbi9wcmltYS9DT1JFL01BQy9zcmMvaW5jbHVkZS9zaXJEZWJ1Zy5oCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjNmYzE1ZGYKLS0tIC9kZXYvbnVsbAorKysgYi93bGFuL3ByaW1hL0NPUkUvTUFDL3NyYy9pbmNsdWRlL3NpckRlYnVnLmgKQEAgLTAsMCArMSwxMzcgQEAKKy8qCisgKiBDb3B5cmlnaHQgKGMpIDIwMTItMj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1BTICAgICAgICA9IDQzLAorICAgTUFDX1NQT09GRURfU0NBTiAgICAgID0gNDQsCisgICBCTVVfRVJST1JfR0VORVJJQ19SRUNPVkVSWSA9IDQ1LAorICAgRElTQSAgICAgICAgICAgICAgICAgID0gNDYsCisgICBGV19TVEFUUyAgICAgICAgICAgICAgPSA0NywKKyAgIFdQU19QUkJSU1BfVE1QTCAgICAgICA9IDQ4LAorICAgQkNOX0lFX0ZMVF9ERUxUQSAgICAgID0gNDksCisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgIFRETFNfT0ZGX0NIQU5ORUwgICAgICA9IDUxLAorI2VuZGlmCisgICBNR01UX0ZSQU1FX0xPR0dJTkcgICAgPSA1MywKKyAgIEVOSEFOQ0VEX1RYQkRfQ09NUExFVElPTiA9IDU0LAorICAgTE9HR0lOR19FTkhBTkNFTUVOVCAgID0gNTUsCisgICAvL01BWF9GRUFUVVJFX1NVUFBPUlRFRCA9IDEyOAorfSBwbGFjZUhvbGRlckluQ2FwQml0bWFwOworCit0eXBlZGVmIGVudW0gZVNyaUxpbmtTdGF0ZSB7CisgICAgZVNJUl9MSU5LX0lETEVfU1RBVEUgICAgICAgID0gMCwKKyAgICBlU0lSX0xJTktfUFJFQVNTT0NfU1RBVEUgICAgPSAxLAorICAgIGVTSVJfTElOS19QT1NUQVNTT0NfU1RBVEUgICA9IDIsCisgICAgZVNJUl9MSU5LX0FQX1NUQVRFICAgICAgICAgID0gMywKKyAgICBlU0lSX0xJTktfSUJTU19TVEFURSAgICAgICAgPSA0LAorICAgIC8vIEJULUFNUCBDYXNlCisgICAgZVNJUl9MSU5LX0JUQU1QX1BSRUFTU09DX1NUQVRFICA9IDUsCisgICAgZVNJUl9MSU5LX0JUQU1QX1BPU1RBU1NPQ19TVEFURSAgPSA2LAorICAgIGVTSVJfTElOS19CVEFNUF9BUF9TVEFURSAgPSA3LAorICAgIGVTSVJfTElOS19CVEFNUF9TVEFfU1RBVEUgID0gOCwKKworICAgIC8vI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BNZXNzYWdlIFF1ZXVlCisKKyNkZWZpbmUgU1lTX1NDSF9NU0dfU0laRSAgICAgICAgU1lTX01TR19TSVpFCisKKy8vLyBQTU0gTWVzc2FnZSBRdWV1ZQorCisjZGVmaW5lIFNZU19QTU1fTVNHX1NJWkUgICAgICAgIFNZU19NU0dfU0laRQorCisvLy8gVFggTWVzc2FnZSBRdWV1ZQorCisjZGVmaW5lIFNZU19UWF9NU0dfU0laRSAgICAgICAgIChzaXplb2Yodm9pZCAqKS80KSAgLy8gTWVzc2FnZSBwb2ludGVyIHNpemUKKworLy8vIFJYIE1lc3NhZ2UgUXVldWUKKworI2RlZmluZSBTWVNfUlhfTVNHX1NJWkUgICAgICAgICAoc2l6ZW9mKHZvaWQgKikvNCkgIC8vIE1lc3NhZ2UgcG9pbnRlciBzaXplCisKKy8vLyBQVFQgIE1lc3NhZ2UgUXVldWUKKyNkZWZpbmUgU1lTX05JTV9QVFRfTVNHX1NJWkUgICAgU1lTX01TR19TSVpFICAvLyBNZXNzYWdlIHBvaW50ZXIgc2l6ZQorCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAgICAgICAgQmxvY2sgcG9vbCBjb25maWd1cmF0aW9uICAgICAgICAgKgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisvLyBUaGUgZm9sbG93aW5nIHZhbHVlcyBzcGVjaWZ5IHRoZSBudW1iZXIgb2YgYmxvY2tzIHRvIGJlIGNyZWF0ZWQKKy8vIGZvciBlYWNoIGJsb2NrIHBvb2wgc2l6ZS4KKworI2RlZmluZSBTSVJfQlVGX0JMS18zMl9OVU0gICAgICAgICAgIDY0CisjZGVmaW5lIFNJUl9CVUZfQkxLXzY0X05VTSAgICAgICAgICAgMTI4CisjZGVmaW5lIFNJUl9CVUZfQkxLXzk2X05VTSAgICAgICAgICAgMTYKKyNkZWZpbmUgU0lSX0JVRl9CTEtfMTI4X05VTSAgICAgICAgICAxMjgKKyNkZWZpbmUgU0lSX0JVRl9CTEtfMTYwX05VTSAgICAgICAgICA4CisjZGVmaW5lIFNJUl9CVUZfQkxLXzE5Ml9OVU0gICAgICAgICAgMAorI2RlZmluZSBTSVJfQlVGX0JMS18yMjRfTlVNICAgICAgICAgIDAKKyNkZWZpbmUgU0lSX0JVRl9CTEtfMjU2X05VTSAgICAgICAgICAxMjgKKyNkZWZpbmUgU0lSX0JVRl9CTEtfNTEyX05VTSAgICAgICAgICAwCisjZGVmaW5lIFNJUl9CVUZfQkxLXzc2OF9OVU0gICAgICAgICAgMAorI2RlZmluZSBTSVJfQlVGX0JMS18xMDI0X05VTSAgICAgICAgIDIKKyNkZWZpbmUgU0lSX0JVRl9CTEtfMTI4MF9OVU0gICAgICAgICAwCisjZGVmaW5lIFNJUl9CVUZfQkxLXzE1MzZfTlVNICAgICAgICAgMgorI2RlZmluZSBTSVJfQlVGX0JMS18xNzkyX05VTSAgICAgICAgIDAKKyNkZWZpbmUgU0lSX0JVRl9CTEtfMjA0OF9OVU0gICAgICAgICAyCisjZGVmaW5lIFNJUl9CVUZfQkxLXzIzMDRfTlVNICAgICAgICAgMAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogICAgICAgICBTSVJJVVMgTUVTU0FHRSBUWVBFUyAgICAgICAgICAgICAgICAqCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCisvKgorICogVGhlIGZvbGxvd2luZyBtZXNzYWdlIHR5cGVzIGhhdmUgYm91bmRzIGRlZmluZW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gICAgIC8vZm9yIElkbGUgbW9kZSBwb3dlciBzYXZlCisjZGVmaW5lIFNJUl9QTU1fTVNHX1RZUEVTX0VORCAgICAgICAgICAoU0lSX1BNTV9NU0dfVFlQRVNfQkVHSU4rMHhGRikKKworLy8gTU5UIG1lc3NhZ2UgdHlwZXMKKyNkZWZpbmUgU0lSX01OVF9NU0dfVFlQRVNfQkVHSU4gICAgICAgIChTSVJfTU5UX01PRFVMRV9JRCA8PCA4KQorI2RlZmluZSBTSVJfTU5UX1JFTEVBU0VfQkQgICAgICAgICAgICAgKFNJUl9NTlRfTVNHX1RZUEVTX0JFR0lOICsgMCkKKyNkZWZpbmUgU0lSX01OVF9NU0dfVFlQRVNfRU5EICAgICAgICAgIChTSVJfTU5UX01TR19UWVBFU19CRUdJTiArIDB4RkYpCisKKy8vIERWVCBtZXNzYWdlIHR5cGVzCisjZGVmaW5lIFNJUl9EVlRfTVNHX1RZUEVTX0JFR0lOICAgICAgICAoU0lSX0RWVF9NT0RVTEVfSUQgPDwgOCkKKyNkZWZpbmUgU0lSX0RWVF9JVENfTVNHX1RZUEVTX0JFR0lOICAgIChTSVJfRFZUX01TR19UWVBFU19CRUdJTisweDBGKQorI2RlZmluZSBTSVJfRFZUX01TR19UWVBFU19FTkQgICAgICAgICAgKFNJUl9EVlRfSVRDX01TR19UWVBFU19CRUdJTisweEZGRikKKworCisvL1BUVCBtZXNzYWdlIHR5cGVzCisjZGVmaW5lIFNJUl9QVFRfTVNHX1RZUEVTX0JFR0lOICAgICAgICAgICAgMHgzMDAwCisjZGVmaW5lIFNJUl9QVFRfTVNHX1RZUEVTX0VORCAgICAgICAgICAgICAgMHgzMzAwCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAgICAgICAgIEVWRU5UIFRZUEUgRGVmaW50aW9ucyAgICAgICAgICAgICAgKgorICogICAgICA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Q1RJT046CisgKiBJdCByZWFkcyBhIDE2IGJpdCBudW1iZXIgZnJvbSB0aGUgYnl0ZSBhcnJheSBpbiBOT04tbmV0d29yayBieXRlIG9yZGVyCisgKiBpLmUuIHRoZSBsZWFzdCBzaWduaWZpY2FudCBieXRlIGZpcnN0CisgKgorICogTE9HSUM6CisgKgorICogQVNTVU1QVElPTlM6CisgKiBOb25lLgorICoKKyAqIE5PVEU6CisgKgorICogQHBhcmFtICBwdHIgYWRkcmVzcyBvZiAgYnl0ZSBhcnJheQorICogQHJldHVybiAxNiBiaXQgdmFsdWUKKyAqLworCitzdGF0aWMgaW5saW5lIHRBTklfVTE2CitzaXJSZWFkVTE2KHRBTklfVTggKnB0cikKK3sKKyAgICByZXR1cm4oKCpwdHIpIHwKKyAgICAgICAgICAgKCoocHRyKzEpIDw8IDgpKTsKK30KKworLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorLyoqCisgKiBzaXJSZWFkVTMyCisgKgorICogRlVOQ1RJT046CisgKiBJdCByZWFkcyBhIDMyIGJpdCBudW1iZXIgZnJvbSB0aGUgYnl0ZSBhcnJheSBpbiBOT04tbmV0d29yayBieXRlIG9yZGVyCisgKiBpLmUuIHRoZSBsZWFzdCBzaWduaWZpY2FudCBieXRlIGZpcnN0CisgKgorICogTE9HSUM6CisgKgorICogQVNTVU1QVElPTlM6CisgKiBOb25lLgorICoKKyAqIE5PVEU6CisgKgorICogQHBhcmFtICBwdHIgYWRkcmVzcyBvZiAgYnl0ZSBhcnJheQorICogQHJldHVybiAzMiBiaXQgdmFsdWUKKyAqLworCitzdGF0aWMgaW5saW5lIHRBTklfVTMyCitzaXJSZWFkVTMyKHRBTklfVTggKnB0cikKK3sKKyAgICByZXR1cm4oKCoocHRyKSkgfAorICAgICAgICAgICAoKihwdHIrMSkgPDwgOCkgfAorICAgICAgICAgICAoKihwdHIrMikgPDwgMTYpIHwKKyAgICAgICAgICAgKCoocHRyKzMpIDw8IDI0KSk7Cit9CisKKy8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisvLy8gQ29weSBhIE1BQyBhZGRyZXNzIGZyb20gJ2Zyb20nIHRvICd0bycKK3N0YXRpYyBpbmxpbmUgdm9pZAorc2lyQ29weU1hY0FkZHIodEFOSV9VOCB0b1tdLCB0QU5JX1U4IGZyb21bXSkKK3sKKyNpZiBkZWZpbmVkKCBfWDg2XyApCisgICAgdEFOSV9VMzIgYWxpZ24gPSAoMHgzICYgKCh0QU5JX1UzMikgdG8gfCAodEFOSV9VMzIpIGZyb20gKSk7CisgICAgaWYoIGFsaWduID09MCl7CisgICAgICAgKigodEFOSV9VMTYgKikgJih0b1s0XSkpID0gKigodEFOSV9VMTYgKikgJihmcm9tWzRdKSk7CisgICAgICAgKigodEFOSV9VMzIgKikgdG8pID0gKigodEFOSV9VMzIgKikgZnJvbSk7CisgICAgfWVsc2UgaWYgKGFsaWduID09IDIpeworICAgICAgICAqKCh0QU5JX1UxNiAqKSAmdG9bNF0pID0gKigodEFOSV9VMTYgKikgJmZyb21bNF0pOworICAgICAgICAqKCh0QU5JX1UxNiAqKSAmdG9bMl0pID0gKigodEFOSV9VMTYgKikgJmZyb21bMl0pOworICAgICAgICAqKCh0QU5JX1UxNiAqKSAmdG9bMF0pID0gKigodEFOSV9VMTYgKikgJmZyb21bMF0pOworICAgIH1lbHNleworICAgICAgIHRvWzVdID0gZnJvbVs1XTsKKyAgICAgICB0b1s0XSA9IGZyb21bNF07CisgICAgICAgdG9bM10gPSBmcm9tWzNdOworICAgICAgIHRvWzJdID0gZnJvbVsyXTsKKyAgICAgICB0b1sxXSA9IGZyb21bMV07CisgICAgICAgdG9bMF0gPSBmcm9tWzBdOworICAgIH0KKyNlbHNlCisgICAgICAgdG9bMF0gPSBmcm9tWzBdOworICAgICAgIHRvWzFdID0gZnJvbVsxXTsKKyAgICAgICB0b1syXSA9IGZyb21bMl07CisgICAgICAgdG9bM10gPSBmcm9tWzNdOworICAgICAgIHRvWzRdID0gZnJvbVs0XTsKKyAgICAgICB0b1s1XSA9IGZyb21bNV07CisjZW5kaWYKK30KKworc3RhdGljIGlubGluZSB0QU5JX1U4CitzaXJDb21wYXJlTWFjQWRkcih0QU5JX1U4IGFkZHIxW10sIHRBTklfVTggYWRkcjJbXSkKK3sKKyNpZiBkZWZpbmVkKCBfWDg2XyApCisgICAgdEFOSV9VMzIgYWxpZ24gPSAoMHgzICYgKCh0QU5JX1UzMikgYWRkcjEgfCAodEFOSV9VMzIpIGFkZHIyICkpOworCisgICAgaWYoIGFsaWduID09MCl7CisgICAgICAgIHJldHVybiAoKCooKHRBTklfVTE2ICopICYoYWRkcjFbNF0pKSA9PSAqKCh0QU5JX1UxNiAqKSAmKGFkZHIyWzRdKSkpJiYKKyAgICAgICAgICAgICAgICAoKigodEFOSV9VMzIgKikgYWRkcjEpID09ICooKHRBTklfVTMyICopIGFkZHIyKSkpOworICAgIH1lbHNlIGlmKGFsaWduID09IDIpeworICAgICAgICByZXR1cm4gKCgqKCh0QU5JX1UxNiAqKSAmYWRkcjFbNF0pID09ICooKHRBTklfVTE2ICopICZhZGRyMls0XSkpICYmCisgICAgICAgICAgICAoKigodEFOSV9VMTYgKikgJmFkZHIxWzJdKSA9PSAqKCh0QU5JX1UxNiAqKSAmYWRkcjJbMl0pKSAmJgorICAgICAgICAgICAgKCooKHRBTklfVTE2ICopICZhZGRyMVswXSkgPT0gKigodEFOSV9VMTYgKikgJmFkZHIyWzBdKSkpOworICAgIH1lbHNleworICAgICAgICByZXR1cm4gKCAoYWRkcjFbNV09PWFkZHIyWzVdKSYmCisgICAgICAgICAgICAoYWRkcjFbNF09PWFkZHIyWzRdKSYmCisgICAgICAgICAgICAoYWRkcjFbM109PWFkZHIyWzNdKSYmCisgICAgICAgICAgICAoYWRkcjFbMl09PWFkZHIyWzJdKSYmCisgICAgICAgICAgICAoYWRkcjFbMV09PWFkZHIyWzFdKSYmCisgICAgICAgICAgICAoYWRkcjFbMF09PWFkZHIyWzBdKSk7CisgICAgfQorI2Vsc2UKKyAgICAgICAgIHJldHVybiAoIChhZGRyMVswXT09YWRkcjJbMF0pJiYKKyAgICAgICAgICAgIChhZGRyMVsxXT09YWRkcjJbMV0pJiYKKyAgICAgICAgICAgIChhZGRyMVsyXT09YWRkcjJbMl0pJiYKKyAgICAgICAgICAgIChhZGRyMVszXT09YWRkcjJbM10pJiYKKyAgICAgICAgICAgIChhZGRyMVs0XT09YWRkcjJbNF0pJiYKKyAgICAgICAgICAgIChhZGRyMVs1XT09YWRkcjJbNV0pKTsKKyNlbmRpZgorfQorCisKKy8qCisqIGNvbnZlcnRzIHRBTklfVTE2IENXIHZhbHVlIHRvIDQgYml0IHZhbHVlIHRvIGJlIGluc2VydGVkIGluIElFCisqLworc3RhdGljIGlubGluZSB0QU5JX1U4IGNvbnZlcnRDVyh0QU5JX1UxNiBjdykKK3sKKyAgICB0QU5JX1U4IHZhbCA9IDA7CisgICAgd2hpbGUgKGN3ID4gMCkKKyAgICAgICAgeworICAgICAgICAgICAgdmFsKys7CisgICAgICAgICAgICBjdyA+Pj0gMTsKKyAgICAgICAgfQorICAgIGlmICh2YWwgPiAxNSkKKyAgICAgICAgcmV0dXJuIDB4RjsKKyAgICByZXR1cm4gdmFsOworfQorCisvKiBUaGUgdXNlciBwcmlvcml0eSB0byBBQyBtYXBwaW5nIGlzIHN1Y2g6CisgKiAgIFVQKDEsIDIpIC0tLT4gQUNfQksoMSkKKyAqICAgVVAoMCwgMykgLS0tPiBBQ19CRSgwKQorICogICBVUCg0LCA1KSAtLS0+IEFDX1ZJKDIpCisgKiAgIFVQKDYsIDcpIC0tLT4gQUNfVk8oMykKKyAqLworI2RlZmluZSBXTEFOX1VQX1RPX0FDX01BUCAgICAgICAgICAgIDB4MzMyMjAxMTA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udHJvbEFkZFRTKAorICAgIHRwQW5pU2lyR2xvYmFsICAgICAgICAgIHBNYWMsCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgICpwQWRkciwKKyAgICB0U2lyQWRkdHNSZXFJbmZvICAgICAgICphZGR0cywKKyAgICB0U2lyTWFjUW9zQ2FwYWJpbGl0eVN0YUlFICpxb3MsCisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgICAgICBhc3NvY0lkLAorICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgIGFsbG9jLAorICAgIHRTaXJNYWNTY2hlZHVsZUlFICAgICAgKnBTY2gsCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAqcFRzcGVjSWR4ICwvL2luZGV4IHRvIHRoZSBsaW0gdHNwZWMgdGFibGUuCisgICAgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeQorICAgICk7CisKK3N0YXRpYyBpbmxpbmUgdFNpclJldFN0YXR1cworbGltQWRtaXRDb250cm9sQWRkU3RhKAorICAgIHRwQW5pU2lyR2xvYmFsICBwTWFjLAorICAgIHRBTklfVTggICAgICAgICAgICAgKnN0YUFkZHIsCisgICAgdEFOSV9VOCAgICAgICAgICAgIGFsbG9jKQoreyByZXR1cm4gZVNJUl9TVUNDRVNTO30KKworZXh0ZXJuIHRTaXJSZXRTdGF0dXMKK2xpbUFkbWl0Q29udHJvbERlbGV0ZVN0YSgKKyAgICB0cEFuaVNpckdsb2JhbCAgcE1hYywKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICBhc3NvY0lkKTsKKworZXh0ZXJuIHRTaXJSZXRTdGF0dXMKK2xpbUFkbWl0Q29udHJvbERlbGV0ZVRTKAorICAgIHRwQW5pU2lyR2xvYmFsICAgIHBNYWMsCisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICBhc3NvY0lkLAorICAgIHRTaXJNYWNUU0luZm8gICAgKnRzaW5mbywKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgKnRzU3Rhd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FMsIFdIRVRIRVIgSU4gQU4gQUNUSU9OIE9GIENPTlRSQUNULCBORUdMSUdFTkNFIE9SIE9USEVSCisgKiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SCisgKiBQRVJGT1JNQU5DRSBPRiBUSElTIFNPRlRXQVJFLgorICovCisKKy8qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisjaWYgZGVmaW5lZCBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUgorLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAKKyAgIE1hY3JvcyBhbmQgRnVuY3Rpb24gcHJvdG90eXBlcyBGVCBhbmQgODAyLjExUiBwdXJwb3NlcworICAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworI2lmbmRlZiBfX0xJTUZUX0hfXworI2RlZmluZSBfX0xJTUZUX0hfXworCisKKyNpbmNsdWRlIDxwYWxUeXBlcy5oPgorI2luY2x1ZGUgPGxpbUdsb2JhbC5oPgorI2luY2x1ZGUgPGFuaUdsb2JhbC5oPgorI2luY2x1ZGUgPGxpbURlYnVnLmg+CisjaW5jbHVkZSA8bGltU2VyRGVzVXRpbHMuaD4KKworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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TsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgIGZTZWVuOjE7CisgICAgdEFOSV9VOCAgICAgICAgICAgICBmRnJlZToxOworICAgIHRBTklfVTggICAgICAgICAgICAgcnN2ZDo1OworICAgIFRYX1RJTUVSICAgICAgICAgICAgdGltZXI7CisgICAgdEFOSV9VMTYgICAgICAgICAgICBzZXFObzsKKyAgICB2X1RJTUVfdCAgICAgICAgICAgIHRpbWVzdGFtcDsKK310TGltUHJlQXV0aE5vZGUsICp0cExpbVByZUF1dGhOb2RlOworCisvLyBQcmUtYXV0aGVudGljYXRpb24gdGFibGUgZGVmaW5pdGlvbgordHlwZWRlZiBzdHJ1Y3QgdExpbVByZUF1dGhUYWJsZQoreworICAgIHRBTklfVTMyICAgICAgICBudW1FbnRyeTsKKyAgICB0cExpbVByZUF1dGhOb2RlIHBUYWJsZTsKK310TGltUHJlQXV0aFRhYmxlLCAqdHBMaW1QcmVBdXRoVGFibGU7CisKKy8vLyBQZXIgU1RBIGNvbnRleHQgc3RydWN0dXJlIGRlZmluaXRpb24KK3R5cGVkZWYgc3RydWN0IHNMaW1NbG1TdGFDb250ZXh0Cit7CisgICAgdExpbU1sbVN0YXRlcyAgICAgICAgICAgbWxtU3RhdGU7CisgICAgdEFuaUF1dGhUeXBlICAgICAgICAgICAgYXV0aFR5cGU7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgbGlzdGVuSW50ZXJ2YWw7CisgICAgdFNpck1hY0NhcGFiaWxpdHlJbmZvICAgY2FwYWJpbGl0eUluZm87CisgICAgdFNpck1hY1Byb3BSYXRlU2V0ICAgICAgcHJvcFJhdGVTZXQ7CisgICAgdFNpck1hY1JlYXNvbkNvZGVzICAgICAgZGlzYXNzb2NSZWFzb247CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgY2xlYW51cFRyaWdnZXI7CisKKyAgICB0U2lyUmVzdWx0Q29kZXMgcmVzdWx0Q29kZTsKKyAgICB0QU5JX1UxNiBwcm90U3RhdHV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9ydFBhcmFtcywgKnRwTGltTm9TaG9ydFBhcmFtczsKKwordHlwZWRlZiBzdHJ1Y3Qgc0xpbU5vU2hvcnRTbG90UGFyYW1zCit7CisgICAgdEFOSV9VOCAgICAgICAgICAgbnVtTm9uU2hvcnRTbG90U3RhOworICAgIHRDYWNoZVBhcmFtcyAgICAgIHN0YU5vU2hvcnRTbG90Q2FjaGVbTElNX1BST1RfU1RBX0NBQ0hFX1NJWkVdOworfSB0TGltTm9TaG9ydFNsb3RQYXJhbXMsICp0cExpbU5vU2hvcnRTbG90UGFyYW1zOworCisKK3R5cGVkZWYgc3RydWN0IHRMaW1JYnNzUGVlck5vZGUgdExpbUlic3NQZWVyTm9kZTsKK3N0cnVjdCB0TGltSWJzc1BlZXJOb2RlCit7CisgICAgdExpbUlic3NQZWVyTm9kZSAgICAgICAgICpuZXh0OworICAgIHRTaXJNYWNBZGRyICAgICAgICAgICAgICBwZWVyTWFjQWRkcjsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgICBhbmlJbmRpY2F0b3I6MTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgICBleHRlbmRlZFJhdGVzUHJlc2VudDoxOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgIGVkY2FQcmVzZW50OjE7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgICAgd21lRWRjYVByZXNlbnQ6MTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgICB3bWVJbmZvUHJlc2VudDoxOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgIGh0Q2FwYWJsZToxOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgIHZodENhcGFibGU6MTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgICByc3ZkOjE7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgICAgaHRTZWNvbmRhcnlDaGFubmVsT2Zmc2V0OworICAgIHRT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JFU1VMVElORyBGUk9NIExPU1MgT0YgVVNFLCBEQVRBIE9SCisgKiBQUk9GSVRTLCBXSEVUSEVSIElOIEFOIEFDVElPTiBPRiBDT05UUkFDVCwgTkVHTElHRU5DRSBPUiBPVEhFUgorICogVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmICFkZWZpbmVkKCBfX0xJTV9TRVNTSU9OX0ggKQorI2RlZmluZSBfX0xJTV9TRVNTSU9OX0gKKworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgXGZpbGUgIGxpbVNlc3Npb24uaAorCisgIFxicmllZiBwcm90b3R5cGUgZm9yIGxpbSBTZXNzaW9uIHJlbGF0ZWQgQVBJcworCisgIFxhdXRob3IgU3VuaXQgQmhhdGlhCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBJbmNsdWRlIEZpbGVzCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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ICAgZkxzaWdUWE9QUHJvdGVjdGlvbkZ1bGxTdXBwb3J0OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgIGdIVE9ic3NNb2RlOyAKK310QmVhY29uUGFyYW1zLCAqdHBCZWFjb25QYXJhbXM7CisKK3R5cGVkZWYgc3RydWN0IHNQRVNlc3Npb24gICAgICAgICAgIC8vIEFkZGVkIHRvIFN1cHBvcnQgQlQtQU1QCit7CisgICAgLyogVG8gY2hlY2sgc2Vzc2lvbiB0YWJsZSBpcyBpbiB1c2Ugb3IgZnJlZSovCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgYXZhaWxhYmxlOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgIHBlU2Vzc2lvbklkOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgIHNtZVNlc3Npb25JZDsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgICB0cmFuc2FjdGlvbklkOworCisgICAgLy9JbiBBUCByb2xlOiBCU1NJRCBhbmQgc2VsZk1hY0FkZHIgd2lsbCBiZSB0aGUgc2FtZS4KKyAgICAvL0luIFNUQSByb2xlOiB0aGV5IHdpbGwgYmUgZGlmZmVyZW50CisgICAgdFNpck1hY0FkZHIgICAgICAgICAgICAgYnNzSWQ7CisgICAgdFNpck1hY0FkZHIgICAgICAgICAgICAgc2VsZk1hY0FkZHI7CisgICAgdFNpck1hY1NTaWQgICAgICAgICAgICAgc3NJZDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICBic3NJZHg7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgdmFsaWQ7CisgICAgdExpbU1sbVN0YXRlcyAgICAgICAgICAgbGltTWxtU3RhdGU7ICAgICAgICAgICAgLy9NTE0gU3RhdGUKKyAgICB0TGltTWxtU3RhdGVzICAgICAgICAgICBsaW1QcmV2TWxtU3RhdGU7ICAgICAgICAvL1ByZXZpb3VzIE1MTSBTdGF0ZQorICAgIHRMaW1TbWVTdGF0ZXMgICAgICAgICAgIGxpbVNtZVN0YXRlOyAgICAgICAgICAgIC8vU01FIFN0YXRlCisgICAgdExpbVNtZVN0YXRlcyAgICAgICAgICAgbGltUHJldlNtZVN0YXRlOyAgICAgICAgLy9QcmV2aW91cyBTTUUgU3RhdGUKKyAgICB0TGltU3lzdGVtUm9sZSAgICAgICAgICBsaW1TeXN0ZW1Sb2xlOworICAgIHRTaXJCc3NUeXBlICAgICAgICAgICAgIGJzc1R5cGU7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgb3Blck1vZGU7ICAgICAgICAgICAgICAgLy8gQVAgLSAwOyBTVEEgLSAxIDsgCisgICAgdFNpck53VHlwZSAgICAgICAgICAgICAgbndUeXBlOworICAgIHRwU2lyU21lU3RhcnRCc3NSZXEgICAgIHBMaW1TdGFydEJzc1JlcTsgICAgICAgIC8vaGFuZGxlIHRvIHNtZXN0YXJ0IGJzcyByZXEKKyAgICB0QU5JX0JPT0xFQU4gICAgICAgICAgICBiT1NFTkFzc29jaWF0aW9uOyAgICAgICAvL2hhbmRsZSB0byBPU0VOIGFzc29jIHJlcQorICAgIHRwU2lyU21lSm9pblJlcSAgICAgICAgIHBMaW1Kb2luUmVxOyAgICAgICAgICAgIC8vIGhhbmRsZSB0byBzbWUgam9pbiByZXEKKyAgICB0cFNpclNtZUpvaW5SZXEgICAgICAgICBwTGltUmVBc3NvY1JlcTsgICAgICAgICAvL2hhbmRsZSB0byBzbWUgcmVhc3NvYyByZXEKKyAgICB0cExpbU1sbUpvaW5SZXEgICAgICAgICBwTGltTWxtSm9pblJlcTsgICAgICAgICAvL2hhbmRsZSB0byBNTE0gam9pbiBSZXEKKyNpZiAgZGVmaW5lZCAoV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIpIHx8IGRlZmluZWQgKEZFQVRVUkVfV0xBTl9FU0UpIHx8IGRlZmluZWQoRkVBVFVSRV9XTEFOX0xGUikKKyAgICB2b2lkICAgICAgICAgICAgICAgICAgICAqcExpbU1sbVJlYXNzb2NSZXR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ICAgICAgICAgIGxpbUlic3NBY3RpdmU7ICAgICAgICAgIC8vVE8gU1VQUE9SVCBDT05DVVJSRU5DWQorCisgICAgLyogVGhlc2UgZ2xvYmFsIHZhcmliYWxlcyBtb3ZlZCB0byBzZXNzaW9uIFRhYmxlIHRvIHN1cHBvcnQgQlQtQU1QIDogT2N0IDl0aCByZXZpZXcgKi8KKyAgICB0QW5pQXV0aFR5cGUgICAgICAgICAgICBsaW1DdXJyZW50QXV0aFR5cGU7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgbGltQ3VycmVudEJzc0NhcHM7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgbGltQ3VycmVudEJzc1Fvc0NhcHM7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgbGltQ3VycmVudEJzc1Byb3BDYXA7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgbGltU2VudENhcHNDaGFuZ2VOdGY7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgbGltQUlEOworCisgICAgLyogUGFyYW1ldGVycyAgRm9yIFJlYXNzb2NpYXRpb24gKi8KKyAgICB0U2lyTWFjQWRkciAgICAgICAgICAgICBsaW1SZUFzc29jYnNzSWQ7CisgICAgdFNpck1hY0NoYW5OdW0gICAgICAgICAgbGltUmVhc3NvY0NoYW5uZWxJZDsKKyAgICAvKiBDQiBwYXJhbWF0ZXJzIHJlcXVpcmVkL2R1cGxpY2F0ZWQgZm9yIFJlYXNzb2Mgc2luY2UgcmUtYXNzb2MgbWFudGFpbnMgaXRzIG93biBwYXJhbXMgaW4gbGltICovCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgcmVBc3NvY0h0U3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgIHJlQXNzb2NIdFJlY29tbWVuZGVkVHhXaWR0aFNldDsKKyAgICBlUGh5Q2hhbkJvbmRTdGF0ZSAgICAgICByZUFzc29jSHRTZWNvbmRhcnlDaGFubmVsT2Zmc2V0OworICAgIHRTaXJNYWNTU2lkICAgICAgICAgICAgIGxpbVJlYXNzb2NTU0lEOworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgIGxpbVJlYXNzb2NCc3NDYXBzOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgIGxpbVJlYXNzb2NCc3NRb3NDYXBzOworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgIGxpbVJlYXNzb2NCc3NQcm9wQ2FwOworCisgICAgLy8gQXNzb2Mgb3IgUmVBc3NvYyBSZXNwb25zZSBEYXRhL0ZyYW1lCisgICAgdm9pZCAgICAgICAgICAgICAgICAgICAqbGltQXNzb2NSZXNwb25zZURhdGE7CisgICAgCisKKworICAgIC8qKiBCU1MgVGFibGUgcGFyYW1ldGVycyAqKi8KKworCisgICAgLyoKKyAgICAqIHN0YUlkOiAgU3RhcnQgQlNTOiB0aGlzIGlzIHRoZSAgU3RhIElkIGZvciB0aGUgQlNTLgorICAgICAgICAgICAgICAgICBKb2luOiB0aGlzIGlzIHRoZSBzZWxmU3RhSWQKKyAgICAgIEluIGJvdGggY2FzZXMgYWJvdmUsIHRoZSBwZWVyIFNUQSBJRCB3bGwgYmUgc3RvcmVkIGluIGRwaCBoYXNoIHRhYmxlLgorICAgICovCisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgc3RhSWQ7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgc3RhdHlwZUZvckJzczsgICAgICAgICAgLy90byBrbm93IHNlc3Npb24gaXMgZm9yIFBFRVIgb3IgU0VMRgorICAgIHRBTklfVTggICAgICAgICAgICAgICAgIHNob3J0U2xvdFRpbWVTdXBwb3J0ZWQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgZHRpbVBlcmlvZDsKKyAgICB0U2lyTWFjUmF0ZVNldCAgICAgICByYXRlU2V0OworICAgIHRTaXJNYWNSYXRlU2V0ICAgICAgIGV4dFJhdGVTZXQ7CisgICAgdFNpck1hY0hUT3BlcmF0aW5nTW9kZSAgaHRPcGVyTW9kZTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICBjdXJyZW50T3BlckNoYW5uZWw7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgY3VycmVudFJlcUNoYW5uZWw7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgTGltUnhlZEJlYWNvbkNudER1cmluZ0hCOworICAgIAorICAgIC8vVGltZSBzdGFtcCBvZiB0aGUgbGFzdCBiZWFjb24gcmVjZWl2ZWQgZnJvbSB0aGUgQlNTIHRvIHdoaWNoIFNUQSBpcyBjb25uZWN0ZWQuCisgICAgdEFOSV9VNjQgICAgICAgICAgICAgICAgbGFzdEJlYWNvblRpbWVTdGFtcDsKKyAgICAvL1JYIEJlYWNvbiBjb3VudCBmb3IgdGhlIGN1cnJlbnQgQlNTIHRvIHdoaWNoIFNUQSBpcyBjb25uZWN0ZWQuCisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgY3VycmVudEJzc0JlYWNvbkNudDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICBsYXN0QmVhY29uRHRpbUNvdW50OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgIGxhc3RCZWFjb25EdGltUGVyaW9kOworCisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgYmNuTGVuOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICpiZWFjb247ICAgICAgICAgICAgICAgIC8vVXNlZCB0byBzdG9yZSBsYXN0IGJlYWNvbiAvIHByb2JlIHJlc3BvbnNlIGJlZm9yZSBhc3NvYy4KKworICAgIHRBTklfVTMyICAgICAgICAgICAgICAgIGFzc29jUmVxTGVuOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICphc3NvY1JlcTsgICAgICAgICAgICAgIC8vVXNlZCB0byBzdG9yZSBhc3NvY2lhdGlvbiByZXF1ZXN0IGZyYW1lIHNlbnQgb3V0IHdoaWxlIGFzc29jaWF0aW5nLgorCisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgYXNzb2NSc3BMZW47CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgKmFzc29jUnNwOyAgICAgICAgICAgICAgLy9Vc2VkIHRvIHN0b3JlIGFzc29jaWF0aW9uIHJlc3BvbnNlIHJlY2VpdmVkIHdoaWxlIGFzc29jaWF0aW5nCisgICAgdEFuaVNpckRwaCAgICAgICAgICAgICAgZHBoOworICAgIHZvaWQgKiAgICAgICAgICAgICAgICAgICpwYXJzZWRBc3NvY1JlcTsgICAgICAgIC8vVXNlZCB0byBzdG9yZSBwYXJzZWQgYXNzb2MgcmVxIGZyb20gdmFyaW91cyByZXF1ZXN0aW5nIHN0YXRpb24KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUiAgICAKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICBSSUNEYXRhTGVuOyAgICAgICAgICAgICAvL1VzZWQgdG8gc3RvcmUgdGhlIFJpYyBkYXRhIHJlY2VpdmVkIGluIHRoZSBhc3NvYyByZXNwb25zZQorICAgIHRBTklfVTggICAgICAgICAgICAgICAgICpyaWNEYXRhOworI2VuZGlmCisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRQorICAgIHRBTklfVTMyICAgICAgICAgICAgICAgIHRzcGVjTGVuOyAgICAgICAgICAgICAgIC8vVXNlZCB0byBzdG9yZSB0aGUgVFNQRUMgSUVzIHJlY2VpdmVkIGluIHRoZSBhc3NvYyByZXNwb25zZQorICAgIHRBTklfVTggICAgICAgICAgICAgICAgICp0c3BlY0llczsKKyNlbmRpZgorICAgIHRBTklfVTMyICAgICAgICAgICAgICAgIGVuY3J5cHRUeXBlOworCisgICAgdEFOSV9CT09MRUFOICAgICAgICAgICAgYlRraXBDbnRyTWVhc0FjdGl2ZTsgICAgLy8gVXNlZCB0byBrZWVwIHJlY29yZCBvZiBUS0lQIGNvdW50ZXIgbWVhc3VyZXMgc3RhcnQvc3RvcAorCisgICA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AgICAgICAgICAgICBhcFVhcHNkRW5hYmxlOworICAgIHRTaXJXUFNQQkNTZXNzaW9uICAgICAgICpwQVBXUFNQQkNTZXNzaW9uOworICAgIHRBTklfVTMyICAgICAgICAgICAgICAgIERlZlByb2JlUnNwSWVCaXRtYXBbOF07CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgcHJveHlQcm9iZVJzcEVuOworICAgIHREb3QxMWZQcm9iZVJlc3BvbnNlICAgIHByb2JlUmVzcEZyYW1lOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgIHNzaWRIaWRkZW47CisgICAgdEFOSV9CT09MRUFOICAgICAgICAgICAgZndkV1BTUEJDUHJvYmVSZXE7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgd3BzX3N0YXRlOworCisgICAgdEFOSV9VOCAgICAgICAgICAgIGxpbVFvc0VuYWJsZWQ6MTsgLy8xMUUKKyAgICB0QU5JX1U4ICAgICAgICAgICAgbGltV21lRW5hYmxlZDoxOyAvL1dNRQorICAgIHRBTklfVTggICAgICAgICAgICBsaW1Xc21FbmFibGVkOjE7IC8vV1NNCisgICAgdEFOSV9VOCAgICAgICAgICAgIGxpbUhjZkVuYWJsZWQ6MTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgbGltMTFkRW5hYmxlZDoxOworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMVcKKyAgICB0QU5JX1U4ICAgICAgICAgICAgbGltUm1mRW5hYmxlZDoxOyAvLzExVworI2VuZGlmCisgICAgdEFOSV9VMzIgICAgICAgICAgIGxpbTExaEVuYWJsZTsKKworICAgIHRQb3dlcmRCbSAgbWF4VHhQb3dlcjsgICAvL01JTiAoUmVndWxhdG9yeSBhbmQgbG9jYWwgcG93ZXIgY29uc3RyYWludCkKKyAgICB0Vk9TX0NPTl9NT0RFICAgICAgcGVQZXJzb25hOworI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX1ZPV0lGSQorICAgIHRQb3dlcmRCbSAgdHhNZ210UG93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gICB0TGltT3BlcmF0aW5nTW9kZUluZm8gIGdMaW1PcGVyYXRpbmdNb2RlOworICAgIHRMaW1XaWRlckJXQ2hhbm5lbFN3aXRjaEluZm8gIGdMaW1XaWRlckJXQ2hhbm5lbFN3aXRjaDsKKyAgICB0QU5JX1U4ICAgIHZodENhcGFiaWxpdHlQcmVzZW50SW5CZWFjb247CisgICAgdEFOSV9VOCAgICBhcENlbnRlckNoYW47CisgICAgdEFOSV9VOCAgICBhcENoYW5XaWR0aDsKKyAgICB0QU5JX1U4ICAgIHR4QkZJbmlGZWF0dXJlRW5hYmxlZDsKKyAgICB0QU5JX1U4ICAgIHR4TXVCZm9ybWVlOworI2VuZGlmCisgICAgdEFOSV9VOCAgICAgICAgICAgIHNwZWN0cnVtTWd0RW5hYmxlZDsKKyAgICAvKiAqKioqKioqKioqKioqKioqKioqKioxMUggcmVsYXRlZCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworICAgIC8vdEFOSV9VMzIgICAgICAgICAgIGdMaW0xMWhFbmFibGU7CisgICAgdExpbVNwZWNNZ210SW5mbyAgIGdMaW1TcGVjTWdtdDsKKyAgICAvLyBDQiBQcmltYXJ5L1NlY29uZGFyeSBDaGFubmVsIFN3aXRjaCBJbmZvCisgICAgdExpbUNoYW5uZWxTd2l0Y2hJbmZvICBnTGltQ2hhbm5lbFN3aXRjaDsKKyAgICAvKiAqKioqKioqKioqKioqKioqKioqKipFbmQgMTFIIHJlbGF0ZWQqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworICAgIC8qRmxhZyB0byBUcmFjayBTdGF0dXMvSW5kaWNhdGUgSEJGYWlsdXJlIG9uIHRoaXMgc2Vzc2lvbiAqLworICAgIHRBTklfQk9PTEVBTiBMaW1IQkZhaWx1cmVTdGF0dXM7CisgICAgdEFOSV9VMzIgICAgICAgICAgIGdMaW1QaHlNb2RlOworICAgIHRBTklfVTggICAgICAgICAgICBhbXNkdVN1cHBvcnRlZEluQkE7CisgICAgdEFOSV9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IAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKiAkSGVhZGVyJCAqLworCisjaWZuZGVmIF9fUlJNX0FQSV9IX18KKyNkZWZpbmUgX19SUk1fQVBJX0hfXworCisjZGVmaW5lIFJSTV9NSU5fVFhfUFdSX0NBUCAgICAxMworI2RlZmluZSBSUk1fTUFYX1RYX1BXUl9DQVAgICAgMTkKKworI2RlZmluZSBSUk1fQkNOX1JQVF9OT19CU1NfSU5GTyAgICAwCisjZGVmaW5lIFJSTV9CQ05fUlBUX01JTl9SUFQgICAgICAgIDEKKwordEFOSV9VOCBycm1HZXRNaW5PZk1heFR4UG93ZXIodHBBbmlTaXJHbG9iYWwgcE1hYywgdFBvd2VyZEJtIHJlZ01heCwgdFBvd2VyZEJtIGFwVHhQb3dlcik7CisKK2V4dGVybiB0U2lyUmV0U3RhdHVzIHJybUluaXRpYWxpemUodHBBbmlTaXJHbG9iYWwgcE1hYyk7CisKK2V4dGVybiB0U2lyUmV0U3RhdHVzIHJybUNsZWFudXAodHBBbmlTaXJHbG9iYWwgcE1hYyk7CisKKworZXh0ZXJuIHRTaXJSZXRTdGF0dXMgcnJtUHJvY2Vzc0xpbmtNZWFzdXJlbWVudFJlcXVlc3QoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBSeFBhY2tldEluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkxpbmtNZWFzdXJlbWVudFJlcXVlc3QgKnBMaW5rUmVxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uIHBTZXNzaW9uRW50cnkgKTsKKworZXh0ZXJuIHRTaXJSZXRTdGF0dXMgcnJtUHJvY2Vzc1JhZGlvTWVhc3VyZW1lbnRSZXF1ZXN0KCB0cEFuaVNpckdsb2JhbCBwTWFjLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjQWRkciBwZWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZSYWRpb01lYXN1cmVtZW50UmVxdWVzdCAqcFJSTVJlcSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwU2Vzc2lvbkVudHJ5ICk7CisKK2V4dGVybiB0U2lyUmV0U3RhdHVzIHJybVByb2Nlc3NOZWlnaGJvclJlcG9ydFJlc3BvbnNlKCB0cEFuaVNpckdsb2JhbCBwTWFjLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmTmVpZ2hib3JSZXBvcnRSZXNwb25zZSAqcE5laWdoYm9yUmVwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uIHBTZXNzaW9uRW50cnkgKTsKKworZXh0ZXJuIHZvaWQgcnJtUHJvY2Vzc01lc3NhZ2UodHBBbmlTaXJHbG9iYWwgcE1hYywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJNc2dRIHBNc2cpOworCitleHRlcm4gdFNpclJldFN0YXR1cyBycm1TZW5kU2V0TWF4VHhQb3dlclJlcSAoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRQb3dlcmRCbSB0eFBvd2VyLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwU2Vzc2lvbkVudHJ5ICk7CisKK2V4dGVybiB0UG93ZXJkQm0gcnJtR2V0TWdtdFR4UG93ZXIgKCB0cEFuaVNpckdsb2JhbCBwTWFjLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwU2Vzc2lvbkVudHJ5ICk7CisKK2V4dGVybiB2b2lkIHJybUNhY2hlTWdtdFR4UG93ZXIgKCB0cEFuaVNpckdsb2JhbCBwTWFjLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0UG93ZXJkQm0gdHhQb3dlciwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gcFNlc3Npb25FbnRyeSApOworCitleHRlcm4gdHBSUk1DYXBzIHJybUdldENhcGFiaWxpdGllcyAoIHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gcFNlc3Npb25FbnRyeSApOworCitleHRlcm4gdm9pZCBycm1VcGRhdGVDb25maWcgKCB0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uIHBTZXNzaW9uRW50cnkgKTsKKworZXh0ZXJuIHZvaWQgcnJtR2V0U3RhcnRUU0YgKCB0cEFuaVNpckdsb2JhbCBwTWFjLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcFN0YXJ0VFNGICk7CisKK2V4dGVybiB2b2lkIHJybVVwZGF0ZVN0YXJ0VFNGICggdHBBbmlTaXJHbG9iYWwgcE1hYywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgc3RhcnRUU0ZbMl0gKTsKKworZXh0ZXJuIHRTaXJSZXRTdGF0dXMgcnJtU2V0TWF4VHhQb3dlclJzcCAoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyTXNnUSBsaW1Nc2dRICk7CisKK2V4dGVybiB0U2lyUmV0U3RhdHVzCitycm1Qcm9jZXNzTmVpZ2hib3JSZXBvcnRSZXEoIHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgIC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PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBcZmlsZSAgcnJtR2xvYmFsLmgKKworICBcYnJpZWYgRGVmaW5pdGlvbnMgZm9yIFNNRSBBUElzCisKKworICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCit0eXBlZGVmIGVudW0gZVJybVJldFN0YXR1cworeworICAgIGVSUk1fU1VDQ0VTUywKKyAgICBlUlJNX0lOQ0FQQUJMRSwKKyAgICBlUlJNX1JFRlVTRUQsCisgICAgZVJSTV9GQUlMVVJFCit9IHRScm1SZXRTdGF0dXM7CisKK3R5cGVkZWYgZW51bSBlUnJtTXNnUmVxU291cmNlCit7CisgICAgZVJSTV9NU0dfU09VUkNFX0xFR0FDWV9FU0UgID0gMSwgLyogbGVnYWN5IGVzZSAqLworICAgIGVSUk1fTVNHX1NPVVJDRV8xMUsgICAgICAgICA9IDIsIC8qIDExayAqLworICAgIGVSUk1fTVNHX1NPVVJDRV9FU0VfVVBMT0FEICA9IDMgIC8qIGVzZSB1cGxvYWQgYXBwcm9hY2ggKi8KK30gdFJybU1zZ1JlcVNvdXJjZTsKKwordHlwZWRlZiBzdHJ1Y3Qgc1NpckNoYW5uZWxJbmZvCit7CisgICB0QU5JX1U4IHJlZ3VsYXRvcnlDbGFzczsKKyAgIHRBTklfVTggY2hhbm5lbE51bTsKK30gdFNpckNoYW5uZWxJbmZvLCAqIHRwU2lyQ2hhbm5lbEluZm87CisKK3R5cGVkZWYgc3RydWN0IHNTaXJCZWFjb25SZXBvcnRSZXFJbmQKK3sKKyAgIHRBTklfVTE2ICAgICBtZXNzYWdlVHlwZTsgLy8gZVdOSV9TTUVfQkVBQ09OX1JFUE9SVF9SRVFfSU5ECisgICB0QU5JX1UxNiAgICAgbGVuZ3RoOworICAgdFNpck1hY0FkZHIgIGJzc0lkOworICAgdEFOSV9VMTYgICAgIG1lYXN1cmVtZW50RHVyYXRpb25bU0l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FjaGFibGU6MjsgIC8vc2VlIElFRUUgODAyLjExayBUYWJsZSA3LTQzYQorICAgICAgICAgICAgICAgIHRBTklfVTMyICAgICAgZlNhbWVTZWN1cml0eU1vZGU6MTsKKyAgICAgICAgICAgICAgICB0QU5JX1UzMiAgICAgIGZTYW1lQXV0aGVudGljYXRvcjoxOworICAgICAgICAgICAgICAgIHRBTklfVTMyICAgICAgZkNhcFNwZWN0cnVtTWVhc3VyZW1lbnQ6MTsgLy9zZWUgSUVFRSA4MDIuMTFrIFRhYmxlIDctOTVkCisgICAgICAgICAgICAgICAgdEFOSV9VMzIgICAgICBmQ2FwUW9zOjE7IAorICAgICAgICAgICAgICAgIHRBTklfVTMyICAgICAgZkNhcEFwc2Q6MTsgCisgICAgICAgICAgICAgICAgdEFOSV9VMzIgICAgICBmQ2FwUmFkaW9NZWFzdXJlbWVudDoxOyAKKyAgICAgICAgICAgICAgICB0QU5JX1UzMiAgICAgIGZDYXBEZWxheWVkQmxvY2tBY2s6MTsgCisgICAgICAgICAgICAgICAgdEFOSV9VMzIgICAgICBmQ2FwSW1tZWRpYXRlQmxvY2tBY2s6MTsKKyAgICAgICAgICAgICAgICB0QU5JX1UzMiAgICAgIGZNb2JpbGl0eURvbWFpbjoxOworICAgICAgICAgICAgICAgIHRBTklfVTMyICAgICAgcmVzZXJ2ZWQ6MjE7IAorICAgICAgICAgfSBycm1JbmZvOworICAgICAgICAgc3RydWN0IF9lc2VJbmZvIHsKKyAgICAgICAgICAgICAgICB0QU5JX1UzMiAgICAgIGNoYW5uZWxCYW5kOjg7CisgICAgICAgICAgICAgICAgdEFOSV9VMzIgICAgICBtaW5SZWN2U2lnUG93ZXI6ODsKKyAgICAgICAgICAgICAgICB0QU5JX1UzMiAgICAgIGFwVHhQb3dlcjo4OworICAgICAgICAgICAgICAgIHRBTklfVTMyICAgICAgcm9hbUh5c3RlcmVzaXM6ODsKKyAgICAgICAgICAgICAgICB0QU5JX1UzMiAgICAgIGFkYXB0U2NhblRocmV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hOb2RlIHBTdGEgPSBkcGhHZXRIYXNoRW50cnkocE1hYywgcFRzcGVjSW5mby0+YXNzb2NJZCwgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUpOworICAgICAgICAgICAgaWYgKHBTdGEgPT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBtYXliZSB3ZSBzaG91bGQgZGVsZXRlIHRoZSB0c3BlYz8/CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJUc3BlYyAlZCAoYXNzb2NJZCAlZCk6IGRwaE5vZGUgbm90IGZvdW5kIiksCisgICAgICAgICAgICAgICAgICAgICAgIGN0c3BlYywgcFRzcGVjSW5mby0+YXNzb2NJZCk7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvL0ZJWE1FOiBuZWVkIHRvIHRha2UgY2FyZSBvZiB0YXVydXNQZWVyLCB0aXRhblBlZXIsIDExbnBlZXIgdG9vLgorICAgICAgICAgICAgKnBCdyArPSBMSU1fU1RBX0JXX0FESlVTVChwU3RhLT5hbmlQZWVyLCBwaHlNb2RlLCBwVHNwZWNJbmZvLT50c3BlYy5tZWFuRGF0YVJhdGUpOworICAgICAgICB9CisgICAgfQorfQorCisvKiogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorXGZuIGxpbUdldEF2YWlsYWJsZUJ3CitcYnJpZWYgYmFzZWQgb24gdGhlIHBoeSBtb2RlIGFuZCB0aGUgYndfZmFjdG9yLCBkZXRlcm1pbmUgdGhlIHRvdGFsIGJhbmR3aWR0aCB0aGF0CisgICAgICAgY2FuIGJlIHN1cHBvcnRlZAorXHBhcmFtICAgdHBBbmlTaXJHbG9iYWwgcE1hYworXHBhcmFtICAgICAgIHRBTklfVTMyICAgICAgICAgICAgICAqcE1heEJ3CitccGFyYW0gICAgICAgdEFOSV9VMzIgICAgICAgICAgICAgICpwTWluQncKK1xwYXJhbSAgICAgICB0QU5JX1UzMiAgICAgICAgICAgICAgIHBoeU1vZGUKK1xwYXJhbSAgICAgICB0QU5JX1UzMiAgICAgICAgICAgICAgIGJ3X2ZhY3RvcgorXHJldHVybiBlU2lyUmV0U3RhdHVzIC0gc3RhdHVzCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworCitzdGF0aWMgdm9pZAorbGltR2V0QXZhaWxhYmxlQncoCisgICAgdHBBbmlTaXJHbG9iYWwgICAgcE1hYywKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgKnBNYXhCdywKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgKnBNaW5CdywKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgIHBoeU1vZGUsCisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICBid19mYWN0b3IpCit7CisgICAgc3dpdGNoIChwaHlNb2RlKQorICAgIHsKKyAgICAgICAgY2FzZSBXTklfQ0ZHX1BIWV9NT0RFXzExQjoKKyAgICAgICAgICAgICpwTWF4QncgPSBMSU1fVE9UQUxfQldfMTFCOworICAgICAgICAgICAgKnBNaW5CdyA9IExJTV9NSU5fQldfMTFCOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBXTklfQ0ZHX1BIWV9NT0RFXzExQToKKyAgICAgICAgICAgICpwTWF4QncgPSBMSU1fVE9UQUxfQldfMTFBOworICAgICAgICAgICAgKnBNaW5CdyA9IExJTV9NSU5fQldfMTFBOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBXTklfQ0ZHX1BIWV9NT0RFXzExRzoKKyAgICAgICAgY2FzZSBXTklfQ0ZHX1BIWV9NT0RFX05PTkU6CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAqcE1heEJ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AgICAgaWYoZVNJUl9TVUNDRVNTID09IGxpbUZpbmRUc3BlYyhwTWFjLCBhc3NvY0lkLCAmcFRzcGVjLT50c2luZm8sIHBUc3BlY0xpc3QsIHBwSW5mbykpCisgICAgICB7CisgICAgICAgICAgICAvL3VwZGF0ZSB0aGlzIGVudHJ5LgorICAgICAgICAgICAgbGltTG9nKHBNYWMsIEFETUlUX0NPTlRST0xfTE9HTEVWRUwsIEZMKCJ1cGRhdGluZyBUU1BFQyB0YWJsZSBlbnRyeSA9ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAoKnBwSW5mbyktPmlkeCk7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICAgLyogV2UgZGlkbid0IGZpbmQgb25lIHRvIHVwZGF0ZS4gU28gZmluZCBhIGZyZWUgc2xvdCBpbiB0aGUgCisgICAgICAgICAgICogTElNIFRTUEVDIGxpc3QgYW5kIGFkZCB0aGlzIG5ldyBlbnRyeQorICAgICAgICAgICAqLyAKKyAgICAgICAgICB0QU5JX1U4IGN0c3BlYyA9IDA7CisgICAgICAgICAgZm9yIChjdHNwZWMgPSAwICwgcFRzcGVjTGlzdCA9ICZwTWFjLT5saW0udHNwZWNJbmZvWzBdOyBjdHNwZWMgPCBMSU1fTlVNX1RTUEVDX01BWDsgY3RzcGVjKyssIHBUc3BlY0xpc3QrKykKKyAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmICghIHBUc3BlY0xpc3QtPmludXNlKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIkZvdW5kIGZyZWUgc2xvdCBpbiBUU1BFQyBsaXN0LiBBZGQgdG8gVFNQRUMgdGFibGUgZW50cnkgJWQiKSwgY3RzcGVjKTsKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorCisgICAgICAgICAgaWYgKGN0c3BlYyA+PSBMSU1fTlVNX1RTUE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tLS0tLS0tLS0tLSovCisKK3RTaXJSZXRTdGF0dXMgbGltQWRtaXRDb250cm9sQWRkVFMoCisgICAgdHBBbmlTaXJHbG9iYWwgICAgICAgICAgcE1hYywKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgKnBBZGRyLAorICAgIHRTaXJBZGR0c1JlcUluZm8gICAgICAgKnBBZGR0cywKKyAgICB0U2lyTWFjUW9zQ2FwYWJpbGl0eVN0YUlFICpwUW9zLAorICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgICAgICAgYXNzb2NJZCwgLy8gYXNzb2NJZCwgdmFsaWQgb25seSBpZiBhbGxvYz09dHJ1ZQorICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgIGFsbG9jLCAvLyB0cnVlPT5hbGxvY2F0ZSBidyBmb3IgdGhpcyB0c3BlYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZWxzZSBkZXRlcm1pbmUgb25seSBpZiBzcGFjZSBpcyBhdmFpbGFibGUKKyAgICB0U2lyTWFjU2NoZWR1bGVJRSAgICAgICpwU2NoLAorICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgKnBUc3BlY0lkeCwgLy9pbmRleCB0byB0aGUgbGltIHRzcGVjIHRhYmxlLgorICAgIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkKKyAgICApCit7CisgICAgdHBMaW1Uc3BlY0luZm8gcFRzcGVjSW5mbzsKKyAgICB0U2lyUmV0U3RhdHVzICByZXR2YWw7CisgICAgdEFOSV9VMzIgICAgICAgICAgICBzdmNJbnRlcnZhbDsKKyAgICAodm9pZCkgcFFvczsKKworICAgIC8vIFRCRDogbW9kaWZ5IHRzcGVjIGFzIG5lZWRlZAorICAgIC8vIEVEQ0E6IG5lZWQgdG8gZmlsbCBpbiB0aGUgbWVkaXVtIHRpbWUgYW5kIHRoZSBtaW5pbXVtIHBoeSByYXRlCisgICAgLy8gdG8gYmUgY29uc2lzdGVudCB3aXRo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ICAgYXNzb2NJZAorXHBhcmFtICAgICAgIHRTaXJNYWNUU0luZm8gICAgKnBUc0luZm8KK1xwYXJhbSAgICAgICB0QU5JX1U4ICAgICAgICAgICAgICAgKnBUc1N0YXR1cworXHBhcmFtICAgICAgIHRBTklfVTggICAgICAgICAgICAgKnB0c3BlY0lkeAorXHJldHVybiBlU2lyUmV0U3RhdHVzIC0gc3RhdHVzCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworCit0U2lyUmV0U3RhdHVzCitsaW1BZG1pdENvbnRyb2xEZWxldGVUUygKKyAgICB0cEFuaVNpckdsb2JhbCAgICBwTWFjLAorICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgYXNzb2NJZCwKKyAgICB0U2lyTWFjVFNJbmZvICAgICpwVHNJbmZvLAorICAgIHRBTklfVTggICAgICAgICAgICAgICAqcFRzU3RhdHVzLAorICAgIHRBTklfVTggICAgICAgICAgICAgKnB0c3BlY0lkeCkKK3sKKyAgICB0cExpbVRzcGVjSW5mbyBwVHNwZWNJbmZvID0gTlVMTDsKKworICAgIGlmIChwVHNTdGF0dXMgIT0gTlVMTCkKKyAgICAgICAgKnBUc1N0YXR1cyA9IDA7CisKKyAgICBpZiAobGltRmluZFRzcGVjKHBNYWMsIGFzc29jSWQsIHBUc0luZm8sICZwTWFjLT5saW0udHNwZWNJbmZvWzBdLCAmcFRzcGVjSW5mbykgPT0gZVNJUl9TVUNDRVNTKQorICAgIHsKKyAgICAgICAgaWYocFRzcGVjSW5mbyAhPSBOVUxMKSAgICAKKyAgICAgICAgeworICAgICAgICAgIGxpbUxvZyhwTWFjLCBBRE1JVF9DT05UUk9MX0xPR0xFVkVMLCBGTCgiVHNwZWMgZW50cnkgJWQgZm91bmQiKSwgcFRzcGVjSW5mby0+aWR4KTsKKyAgICAgICAgCisgICAgICAgICAgKnB0c3BlY0lkeCA9IHBUc3BlY0lu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QorI2VuZGlmIC8vVE8gU1VQUE9SVCBCVC1BTVAKKyAgICAgICAgc2lyQ29weU1hY0FkZHIocGVlck1hY0FkZHIscHNlc3Npb25FbnRyeS0+YnNzSWQpOworCisgICAgICAgIC8vIDA5MDgwMzogQWRkIHRoZSBTTUUgU2Vzc2lvbiBJRCAgICAgICAgCisgICAgICAgIGxpbVNlbmREZWx0c1JlcUFjdGlvbkZyYW1lKHBNYWMsIHBlZXJNYWNBZGRyLCByc3BSZXFkLCAmcEFkZFRzUnNwTXNnLT50c3BlYy50c2luZm8sICZwQWRkVHNSc3BNc2ctPnRzcGVjLAorICAgICAgICAgICAgICAgIC8vcHNlc3Npb25FbnRyeS0+c21lU2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5KTsKKworICAgICAgICAvLyBEZWxldGUgVFNQRUMKKyAgICAgICAgLy8gMDkwODAzOiBQdWxsIHRoZSBoYXNoIHRhYmxlIGZyb20gdGhlIHNlc3Npb24gICAgICAgIAorICAgICAgICBwU3RhID0gZHBoTG9va3VwQXNzb2NJZChwTWFjLCBwQWRkVHNSc3BNc2ctPnN0YUlkeCwgJmFzc29jSWQsIAorICAgICAgICAgICAgICAgICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsgICAgCisgICAgICAgIGlmIChwU3RhICE9IE5VTEwpCisgICAgICAgICAgICBsaW1BZG1pdENvbnRyb2xEZWxldGVUUyhwTWFjLCBhc3NvY0lkLCAmcEFkZFRzUnNwTXNnLT50c3BlYy50c2luZm8sIE5VTEwsICh0QU5JX1U4ICopJnBBZGRUc1JzcE1zZy0+dHNwZWNJZHgpOworCisgICAgICAgIC8vIFNlbmQgU01FX0FERFRTX1JTUAorICAgICAgICAvLyAwOTA4MDM6IFVzZSB0aGUgc21lc2Vzc2lvbklkIGFuZCBzbWV0cmFuc2FjdGlvbklkIGZyb20gdGhlIFBFIHNlc3Npb24gY29udGV4dAorICAgICAgICBsaW1T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ZXEpOworICAgICAgICBwTWFjLT5saW0uZ3BMaW1NbG1TZXRLZXlzUmVxID0gTlVMTDsKKyAgICB9CisKKyAgICAjaWYgMAorICAgIGlmIChwTWFjLT5saW0uZ3BMaW1Kb2luUmVxICE9IE5VTEwpCisgICAgeworICAgICAgICB2b3NfbWVtX2ZyZWUocE1hYy0+bGltLmdwTGltSm9pblJlcSk7CisgICAgICAgIHBNYWMtPmxpbS5ncExpbUpvaW5SZXEgPSBOVUxMOworICAgIH0KKyAgICAjZW5kaWYKKworICAgIGlmIChwTWFjLT5saW0uZ3BMaW1NbG1BdXRoUmVxICE9IE5VTEwpCisgICAgeworICAgICAgICB2b3NfbWVtX2ZyZWUocE1hYy0+bGltLmdwTGltTWxtQXV0aFJlcSk7CisgICAgICAgIHBNYWMtPmxpbS5ncExpbU1sbUF1dGhSZXEgPSBOVUxMOworICAgIH0KKworI2lmIDAKKyAgICBpZiAocE1hYy0+bGltLmdwTGltTWxtSm9pblJlcSAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBNYWMtPmxpbS5ncExpbU1sbUpvaW5SZXEpOworICAgICAgICBwTWFjLT5saW0uZ3BMaW1NbG1Kb2luUmVxID0gTlVMTDsKKyAgICB9CisjZW5kaWYKKworICAgICNpZiAwCisgICAgaWYgKHBNYWMtPmxpbS5ncExpbVJlYXNzb2NSZXEgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZShwTWFjLT5saW0uZ3BMaW1SZWFzc29jUmVxKTsKKyAgICAgICAgcE1hYy0+bGltLmdwTGltUmVhc3NvY1JlcSA9IE5VTEw7CisgICAgfQorICAgICNlbmRpZgorCisgICAgaWYgKHBNYWMtPmxpbS5ncExpbU1sbVJlbW92ZUtleVJlcSAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBNYWMtPmxpbS5ncExpbU1sbVJlbW92ZUtleVJlcSk7CisgICAgICAgIHBNYWMtPmxpbS5ncExpbU1sbVJlbW92ZUtleVJlcSA9IE5VTEw7CisgICAgfQorCisgICAgaWYgKHBNYWMtPmxpbS5ncERlZmRTbWVNc2dGb3JOT0EgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZShwTWFjLT5saW0uZ3BEZWZkU21lTXNnRm9yTk9BKTsKKyAgICAgICAgcE1hYy0+bGltLmdwRGVmZFNtZU1zZ0Zvck5PQSA9IE5VTEw7CisgICAgfQorCisgICAgaWYgKHBNYWMtPmxpbS5ncExpbU1sbVNjYW5SZXEgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZShwTWFjLT5saW0uZ3BMaW1NbG1TY2FuUmVxKTsKKyAgICAgICAgcE1hYy0+bGltLmdwTGltTWxtU2NhblJlcSA9IE5VTEw7CisgICAgfQorCisjaWYgMAorICAgIGlmKE5VTEwgIT0gcE1hYy0+bGltLmJlYWNvbikKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZSgodm9pZCopIHBNYWMtPmxpbS5iZWFjb24pOworICAgICAgICBwTWFjLT5saW0uYmVhY29uID0gTlVMTDsKKyAgICAgfQorI2VuZGlmCisgICAgI2lmIDAKKyAgICBpZihOVUxMICE9IHBNYWMtPmxpbS5hc3NvY1JlcSkKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZSgodm9pZCopIHBNYWMtPmxpbS5hc3NvY1JlcSk7CisgICAgICAgIHBNYWMtPmxpbS5hc3NvY1JlcT0gTlVMTDsKKyAgICAgfQorICAgICNlbmRpZgorCisjaWYgMAorICAgIGlmKE5VTEwgIT0gcE1hYy0+bGltLmFzc29jUnNwKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKCh2b2lkKikgcE1hYy0+bGltLmFzc29jUnNwKTsKKyAgICAgICAgcE1hYy0+bGltLmFzc29jUnNwPSBOVUxMOworICAgICB9CisjZW5kaWYKKyAgICAvLyBOb3csIGZpbmFsbHkgcmVzZXQgdGh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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCit2X1ZPSURfdCBwZUZyZWVNc2coIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRTaXJNc2dRKiBwTXNnKQoreyAgCisgICAgaWYgKHBNc2cgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIGlmIChOVUxMICE9IHBNc2ctPmJvZHlwdHIpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChTSVJfQkJfWFBPUlRfTUdNVF9NU0cgPT0gcE1zZy0+dHlwZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfcGt0X3JldHVybl9wYWNrZXQoKHZvc19wa3RfdCAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZSgodl9WT0lEX3QqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHBNc2ctPmJvZHlwdHIgPSAwOworICAgICAgICBwTXNnLT5ib2R5dmFsID0gMDsKKyAgICAgICAgcE1zZy0+dHlwZSA9IDA7CisgICAgfQorICAgIHJldHVybjsKK30KKworCisvKioKKyAqIFRoZSBmdW5jdGlvbiBjaGVja3MgaWYgYSBwYXJ0aWN1bGFyIHRpbWVyIHNob3VsZCBiZSBhbGxvd2VkCisgKiBpbnRvIExJTSB3aGlsZSBkZXZpY2UgaXMgc2xlZXBpbmcKKyAqLwordEFOSV9VOCBsaW1Jc1RpbWVyQWxsb3dlZEluUG93ZXJTYXZlU3RhdGUodHBBbmlTaXJHbG9iYWwgcE1hYywgdFNpck1zZ1EgKnBNc2cpCit7CisgICAgdEFOSV9VOCByZXRTdGF0dXMgPSBUUlVFOworCisgICAgaWYoIWxpbUlzU3lzdGVtSW5BY3RpdmVTdGF0ZShwTWFjKSkKKyAgICB7CisgICAgICAgI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2VyLXNhdmUgbW9kZQorICAgICAgICAgICAgICogbWlnaHQgbmVlZCB0byBibG9jayBpbiB0aGUgZnV0dXJlIGlmIHdlIGRlY2lkZSB0byBpbXBsZW1lbnQKKyAgICAgICAgICAgICAqIHNwZWN0cnVtIG1hbmFnZW1lbnQKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgY2FzZSBTSVJfTElNX1FVSUVUX0JTU19USU1FT1VUOgorCisgICAgICAgICAgICAvKiBTYWZlIHRvIGFsbG93IHRoaXMgdGltZXJtZXNzYWdlLCB0cmlnZ2VycyBiYWNrZ3JvdW5kIHNjYW4KKyAgICAgICAgICAgICAqIHdoaWNoIGlzIGJsb2NrZWQgaW4gc2xlZXAgbW9kZQorICAgICAgICAgICAgICovCisgICAgICAgICAgICBjYXNlIFNJUl9MSU1fQ0hBTk5FTF9TQ0FOX1RJTUVPVVQ6CisKKyAgICAgICAgICAgIC8qIFNhZmUgdG8gYWxsb3cgdGhpcyB0aW1lciwgc2luY2UsIHdoaWxlIGluIElNUFMgdGhpcyB0aW1lciB3aWxsIG5vdAorICAgICAgICAgICAgICogYmUgc3RhcnRlZC4gSW4gY2FzZSBvZiBCTVBTIHNsZWVwLCBTb2Z0TUFDIGhhbmRsZXMgdGhlIGhlYXJ0LWJlYXQKKyAgICAgICAgICAgICAqIHdoZW4gaGVhcnQtYmVhdCBjb250cm9sIGlzIGhhbmRsZWQgYmFjayB0byBQRSwgZGV2aWNlIHdvdWxkIGhhdmUKKyAgICAgICAgICAgICAqIGFscmVhZHkgd29rZW4tdXAgZHVlIHRvIEVYSVRfQk1QU19JTkQgbWVzYWdlIGZyb20gU29mdE1BQworICAgICAgICAgICAgICovCisgICAgICAgICAgICBjYXNlIFNJUl9MSU1fSEVBUlRfQkVBVF9USU1FT1VUOgorICAgICAgICAgICAgY2FzZSBTSVJfTElNX1BST0JFX0hCX0ZBSUxVUkVfVElNRU9VVDoKKworICAgICAgICAgICAgLyogU2FmZSB0byBhbGxvdywgUEUgaXMgbm90IGhhbmRsaW5nIHRoaXMgbWVzc2FnZSBhcyBvZiBub3cuIE1heSBuZWVkCisgICAgICAgICAgICAgKiB0byBibG9jayBpdCwgYmFzaWNhbGx5LCBmcmVlIHRoZSBidWZmZXIgYW5kIHJlc3RhcnQgdGhlIHRpbWVyCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGNhc2UgU0lSX0xJTV9SRUFTU09DX0ZBSUxfVElNRU9VVDoKKyAgICAgICAgICAgIGNhc2UgU0lSX0xJTV9KT0lOX0ZBSUxfVElNRU9VVDoKKyAgICAgICAgICAgIGNhc2UgU0lSX0xJTV9QRVJJT0RJQ19KT0lOX1BST0JFX1JFUV9USU1FT1VUOgorICAgICAgICAgICAgY2FzZSBTSVJfTElNX0FTU09DX0ZBSUxfVElNRU9VVDoKKyAgICAgICAgICAgIGNhc2UgU0lSX0xJTV9BVVRIX0ZBSUxfVElNRU9VVDoKKyAgICAgICAgICAgIGNhc2UgU0lSX0xJTV9BRERUU19SU1BfVElNRU9VVDoKKyAgICAgICAgICAgIGNhc2UgU0lSX0xJTV9BVVRIX1JFVFJZX1RJTUVPVVQ6CisgICAgICAgICAgICAgICAgcmV0U3RhdHVzID0gVFJVRTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgLyogYnkgZGVmYXVsdCBhbGxvdyByZXN0IG9mIG1lc3NhZ2VzICovCisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHJldFN0YXR1cyA9IFRSVUU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIHJldFN0YXR1czsKKworfQorCisKKworLyoqCisgKiBsaW1Qb3N0TXNnQXBpKCkKKyAqCisgKkZVTkNUSU9OOgorICogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZnJvbSBvdGhlciB0aHJlYWQgd2hpbGUgcG9zdGluZyBhCisgKiBtZXNzYWdlIHRvIExJTSBtZ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pwUnhQYWNrZXRJbmZvOworCisgICAgcFZvc1BrdCA9ICh2b3NfcGt0X3QgKil2b3NCdWZmOworICAgIGlmIChOVUxMID09IHBWb3NQa3QpCisgICAgeworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgfQorCisgICAgcE1hYyA9ICh0cEFuaVNpckdsb2JhbCl2b3NfZ2V0X2NvbnRleHQoVk9TX01PRFVMRV9JRF9QRSwgcHZvc0dDdHgpOworICAgIGlmIChOVUxMID09IHBNYWMpCisgICAgeworICAgICAgICAvLyBjYW5ub3QgbG9nIGEgZmFpbHVyZSB3aXRob3V0IGEgdmFsaWQgcE1hYworICAgICAgICB2b3NfcGt0X3JldHVybl9wYWNrZXQocFZvc1BrdCk7CisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICB9CisKKyAgICB2b3NTdGF0dXMgPSBXREFfRFNfUGVla1J4UGFja2V0SW5mbyggcFZvc1BrdCwgKHZvaWQgKikmcFJ4UGFja2V0SW5mbywgVk9TX0ZBTFNFICk7CisKKyAgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpCisgICAgeworICAgICAgICB2b3NfcGt0X3JldHVybl9wYWNrZXQocFZvc1BrdCk7CisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICB9CisKKworICAgIC8vCisgICAgLy8gIFRoZSBNUERVIGhlYWRlciBpcyBub3cgcHJlc2VudCBhdCBhIGNlcnRhaW4gIm9mZnNldCIgaW4KKyAgICAvLyB0aGUgQkQgYW5kIGlzIHNwZWNpZmllZCBpbiB0aGUgQkQgaXRzZWxmCisgICAgLy8KKyAgICBtSGRyID0gV0RBX0dFVF9SWF9NQUNfSEVBREVSKHBSeFBhY2tldEluZm8pOworICAgIGlmKG1IZHItPmZjLnR5cGUgPT0gU0lSX01BQ19NR01UX0ZSQU1FKSAKKyAgICB7CisgICAgUEVMT0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3lzQmJ0UGVuZGluZ01nbXRDb3VudCA+ICh2b3NfcGt0X2dldF9udW1fb2ZfcnhfcmF3X3BrdHMoKS80KSApCisgICAgeworICAgICAgICB2b3Nfc3Bpbl9sb2NrX3JlbGVhc2UoICZwTWFjLT5zeXMubG9jayApOworICAgICAgICAvLyBkcm9wIGFsbCBtYW5hZ2VtZW50IHBhY2tldHMKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dXLAorICAgICAgICAgICAgICAgIEZMICggIk1hbmFnZW1lbnQgcXVldWUgMS80dGggZnVsbCwgZHJvcHBpbmcgbWFuYWdlbWVudCBwYWNrZXRzIiApKTsKKyAgICAgICAgdm9zX3BrdF9yZXR1cm5fcGFja2V0KHBWb3NQa3QpOworICAgICAgICByZXR1cm4gIFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgICB9CisKKyAgICBpZiggcE1hYy0+c3lzLmdTeXNCYnRQZW5kaW5nTWdtdENvdW50ID4gKCB2b3NfcGt0X2dldF9udW1fb2ZfcnhfcmF3X3BrdHMoKS80CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBSU1JWRF9NR01UX1JYX1BBQ0tFVFMgKSkKKyAgICB7CisgICAgICAgIC8vIGRyb3AgYWxsIHByb2JlcmVxLCBwcm9iZXJlc3AgYW5kIGJlYWNvbnMKKyAgICAgICAgaWYoIG1IZHItPmZjLnN1YlR5cGUgPT0gU0lSX01BQ19NR01UX0JFQUNPTiB8fCAgbUhkci0+ZmMuc3ViVHlwZSA9PQorICAgICAgICAgICAgU0lSX01BQ19NR01UX1BST0JFX1JFUSB8fCAgbUhkci0+ZmMuc3ViVHlwZSA9PSBTSVJfTUFDX01HTVRfUFJPQkVfUlNQICkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX3NwaW5fbG9ja19yZWxlYXNlKCAmcE1hYy0+c3lzLmxvY2sgKTsKKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HVywKKyAgICAgICAgICAgICAgICAgICAgRkwgKCAiRHJvcHBpbmcgcHJvYmUgcmVxLCBwcm9iZSByZXNwIG9yIGJlYWNvbiIgKSk7CisgICAgICAgICAgICB2b3NfcGt0X3JldHVybl9wYWNrZXQocFZvc1BrdCk7CisgICAgICAgICAgICByZXR1cm4gIFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgfQorICAgIH0KKyAgICBwTWFjLT5zeXMuZ1N5c0JidFBlbmRpbmdNZ210Q291bnQrKzsKKyAgICB2b3Nfc3Bpbl9sb2NrX3JlbGVhc2UoICZwTWFjLT5zeXMubG9jayApOworCisgICAgaWYoIGVTSVJfU1VDQ0VTUyAhPSBzeXNCYnRQcm9jZXNzTWVzc2FnZUNvcmUoIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZtc2csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1IZHItPmZjLnR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1IZHItPmZjLnN1YlR5cGUgKSkKKyAgICB7CisgICAgICAgIHZvc19wa3RfcmV0dXJuX3BhY2tldChwVm9zUGt0KTsKKworICAgICAgICAvKiBEZWNyZW1lbnQgZ1N5c0JidFBlbmRpbmdNZ210Q291bnQgaWYgcGFja2V0CisgICAgICAgICAqIGlzIGRyb3BwZWQgYmVmb3JlIHBvc3RpbmcgdG8gTElNCisgICAgICAgICAqLworICAgICAgICBsaW1EZWNyZW1lbnRQZW5kaW5nTWdtdENvdW50KHBNYWMpOworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csCisgICAgICAgICAgICAgICAgRkwgKCAic3lzQmJ0UHJvY2Vzc01lc3NhZ2VDb3JlIGZhaWxlZCB0byBwcm9jZXNzIFNJUl9CQl9YUE9SVF9NR01UX01TRyIgKSk7CisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0Vf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WMtPmxpbS5wcm90U3RhT3ZlcmxhcENhY2hlW2ldLmFjdGl2ZSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKHZvc19tZW1fY29tcGFyZSggcE1hYy0+bGltLnByb3RTdGFPdmVybGFwQ2FjaGVbaV0uYWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuOyB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgaWYgKGkgPT0gTElNX1BST1RfU1RBX09WRVJMQVBfQ0FDSEVfU0laRSkKKyAgICB7CisgICAgICAgIFBFTE9HMShsaW1Mb2cocE1hYywgTE9HVywgRkwoIk92ZXJsYXAgY2FjaGUgaXMgZnVsbCIpKTspCisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHZvc19tZW1fY29weShwTWFjLT5saW0ucHJvdFN0YU92ZXJsYXBDYWNoZVtpXS5hZGRyLAorICAgICAgICAgICAgICAgICAgICAgYnNzSWQsCisgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgcE1hYy0+bGltLnByb3RTdGFPdmVybGFwQ2FjaGVbaV0uYWN0aXZlID0gdHJ1ZTsKKworICAgICAgICBwU3RhUGFyYW1zLT5udW1TdGErKzsKKyAgICB9Cit9CisKKworLyoqCisgKiBsaW1IYW5kbGVJQlNTY29hbGVzY2luZygpCisgKgorICpGVU5DVElPTjoKKyAqIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIHVwb24gcmVjZWl2aW5nIEJlYWNvbi9Qcm9iZSBSZXNwb25zZQorICogd2hpbGUgb3BlcmF0aW5nIGluIElCU1MgbW9kZS4KKyAqCisgKkxPR0lDOgorICoKKyAqQVNTVU1QVElPTlM6CisgKgorICpOT1RFOg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cikgKQorICAgICAgICAvKiBSZWNlaXZlZCBTU0lEIGRvZXMgbm90IG1hdGNoID0+IElnbm9yZSByZWNlaXZlZCBCZWFjb24gZnJhbWUuICovCisgICAgICAgIHJldENvZGUgPSAgZVNJUl9MSU1fSUdOT1JFX0JFQUNPTjsKKyAgICBlbHNlCisgICAgeworICAgICAgICB0QU5JX1UzMiBpZUxlbjsKKyAgICAgICAgdEFOSV9VMTYgdHNmTGF0ZXI7CisgICAgICAgIHRBTklfVTggKnBJRXM7CisgICAgICAgIGllTGVuICAgID0gV0RBX0dFVF9SWF9QQVlMT0FEX0xFTihwUnhQYWNrZXRJbmZvKTsKKyAgICAgICAgdHNmTGF0ZXIgPSBXREFfR0VUX1JYX1RTRl9MQVRFUihwUnhQYWNrZXRJbmZvKTsKKyAgICAgICAgcElFcyA9IFdEQV9HRVRfUlhfTVBEVV9EQVRBKHBSeFBhY2tldEluZm8pOworICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIkJFRk9SRSBDb2FsZXNjaW5nIHRzZkxhdGVyIHZhbCA6JWQiKSwgdHNmTGF0ZXIpOworICAgICAgICByZXRDb2RlICA9IGxpbUlic3NDb2FsZXNjZShwTWFjLCBwSGRyLCBwQmVhY29uLCBwSUVzLCBpZUxlbiwgdHNmTGF0ZXIscHNlc3Npb25FbnRyeSk7CisgICAgfQorICAgIHJldHVybiByZXRDb2RlOworfSAvKioqIGVuZCBsaW1IYW5kbGVJQlNTY29hbGVzY2luZygpICoqKi8KKwordEFuaUJvb2wgbGltRW5jVHlwZU1hdGNoZWQodHBBbmlTaXJHbG9iYWwgcE1hYywgdHBTY2hCZWFjb25TdHJ1Y3QgIHBCZWFjb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uICAgIHBTZXNzaW9uKQoreworICAgIGlmICghcEJlYWNvbiB8fCAhcFNlc3Npb24pCisgICAgICAgIHJldHVybiBlU0lSX0ZBTFNFOworCisgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICBGTCgiQmVhY29uL1Byb2JlOjogUHJpdmFjeSA6JWQgV1BBIFByZXNlbnQ6JWQgUlNOIFByZXNlbnQ6ICVkIiksCisgICAgICAgICAgICAgICAgICBwQmVhY29uLT5jYXBhYmlsaXR5SW5mby5wcml2YWN5LCBwQmVhY29uLT53cGFQcmVzZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJlYWNvbi0+cnNuUHJlc2VudCk7CisgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICBGTCgicFNlc3Npb246OiBQcml2YWN5IDolZCBFbmN5cHRpb25UeXBlOiAlZCIpLAorICAgICAgICAgICAgICAgICAgU0lSX01BQ19HRVRfUFJJVkFDWShwU2Vzc2lvbi0+bGltQ3VycmVudEJzc0NhcHMpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+ZW5jcnlwdFR5cGUpOworCisgICAgLyogVGhpcyBpcyBoYW5kbGVkIGJ5IHNlbmRpbmcgcHJvYmUgcmVxIGR1ZSB0byBJT1QgaXNzdWVzIHNvIHJldHVybiBUUlVFCisgICAgICovCisgICAgaWYgKCAocEJlYWNvbi0+Y2FwYWJpbGl0eUluZm8ucHJpdmFjeSkgIT0KKyAgICAgICAgICAgICAgU0lSX01BQ19HRVRfUFJJVkFDWShwU2Vzc2lvbi0+bGltQ3VycmVudEJzc0NhcHMpKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJSZXR1cm4gZm9yIFByaXZhY3kgYml0IG1pc3MgbWF0Y2gsIEFzICIKKyAgICAgICAgICAgICAiZm9yIHRoaXMgZHJpdmVyIG5lZWQgdG8gc2VuZCB0aGUgcHJvYmUgcmVxdWVzdCB0byBoYW5kbGUiCisgICAgICAgICAgICAgIiBJT1QgaXNzdWVzICIpKTsKKyAgICAgICAgcmV0dXJuIGVTSVJfVFJVRTsKKyAgICB9CisKKyAgICAvKk9wZW4qLworICAgIGlmKCAocEJlYWNvbi0+Y2FwYWJpbGl0eUluZm8ucHJpdmFjeSA9PSAwKSAmJgorICAgICAgICAgICAocFNlc3Npb24tPmVuY3J5cHRUeXBlID09IGVTSVJfRURfTk9ORSkpCisgICAgICAgIHJldHVybiBlU0lSX1RSVUU7CisKKyAgICAvKiBXRVAgKi8KKyAgICBpZiAoIChwQmVhY29uLT5jYXBhYmlsaXR5SW5mby5wcml2YWN5ID09IDEpICYmIChwQmVhY29uLT53cGFQcmVzZW50ID09IDApICYmCisgICAgICAgICAgICAocEJlYWNvbi0+cnNuUHJlc2VudCA9PSAwKSAmJgorICAgICAgICAgICAgKCAoIHBTZXNzaW9uLT5lbmNyeXB0VHlwZSA9PSBlU0lSX0VEX1dFUDQwICkgfHwKKyAgICAgICAgICAgICAgKCBwU2Vzc2lvbi0+ZW5jcnlwdFR5cGUgPT0gZVNJUl9FRF9XRVAxMDQgKQorI2lmZGVmIEZFQVRVUkVfV0xBTl9XQVBJCisgICAgICAgICAgICAgIHx8ICggcFNlc3Npb24tPmVuY3J5cHRUeXBlID09IGVTSVJfRURfV1BJICkKKyNlbmRpZgorICAgICAgICAgICAgICkpCisgICAgICAgIHJldHVybiBlU0lSX1RSVUU7CisKKyAgICAvKiBXUEEgT1IgUlNOKi8KKyAgICBpZiAoIChwQmVhY29uLT5jYXBhYmlsaXR5SW5mby5wcml2YWN5ID09IDEpICYmCisgICAgICAgICAgICggKHBCZWFjb24tPndwYVByZXNlbnQgPT0gMSkgfHwKKyAgICAgICAgICAgICAoIHBCZWFjb24tPnJzblByZXNlbnQgPT0gMSkpICYmCisgICAgICAgICAgICAoIChwU2Vzc2lvbi0+ZW5jcnlwdFR5cGUgPT0gZVNJUl9FRF9US0lQKSB8fAorICAgICAgICAgICAgICAgIChwU2Vzc2lvbi0+ZW5jcnlwdFR5cGUgPT0gZVNJUl9FRF9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FNFID09IHNlY3VyaXR5Q2Fwc01hdGNoZWQpCisgICAgICAgICAgKSApICkKKyAgICB7CisgICAgICAgIGlmICggZmFsc2UgPT0gcHNlc3Npb25FbnRyeS0+ZldhaXRGb3JQcm9iZVJzcCApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIElmIEJlYWNvbiBjYXBhYmlsaXRpZXMgaXMgbm90IG1hdGNoaW5nIHdpdGggdGhlIGN1cnJlbnQgY2FwYWJpbGl0eSwKKyAgICAgICAgICAgICAqIHRoZW4gc2VuZCB1bmljYXN0IHByb2JlIHJlcXVlc3QgdG8gQVAgYW5kIHRha2UgZGVjaXNpb24gYWZ0ZXIKKyAgICAgICAgICAgICAqIHJlY2VpdmluZyBwcm9iZSByZXNwb25zZSAqLworICAgICAgICAgICAgaWYgKCB0cnVlID09IHBzZXNzaW9uRW50cnktPmZJZ25vcmVDYXBzQ2hhbmdlICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgRkwoIklnbm9yaW5nIHRoZSBDYXBhYmlsaXR5IGNoYW5nZSBhcyBpdCBpcyBmYWxzZSBhbGFybSIpKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5mV2FpdEZvclByb2JlUnNwID0gdHJ1ZTsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiQVAgY2FwYWJpbGl0aWVzIGFyZSBub3QgbWF0Y2hpbmcsIgorICAgICAgICAgICAgICAgICAgICJzZW5kaW5nIGRpcmVjdGVkIHByb2JlIHJlcXVlc3QuLiAiKSk7CisgICAgICAgICAgICBzdGF0dXMgPSBsaW1TZW5kUHJvYmVSZXFNZ210RnJhbWUocE1hYywgJnBzZXNzaW9uRW50cnktPnNzSWQsIHBzZXNzaW9uRW50cnktPmJzc0lkLAorICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwscHNlc3Npb25FbnRyeS0+c2VsZk1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmRvdDExbW9kZSwgMCwgTlVMTCk7CisKKyAgICAgICAgICAgIGlmICggZVNJUl9TVUNDRVNTICE9IHN0YXR1cyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoInNlbmQgUHJvYmVSZXEgZmFpbGVkIikpOworICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+ZldhaXRGb3JQcm9iZVJzcCA9IGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIC8qKgorICAgICAgICAgKiBCU1MgY2FwYWJpbGl0aWVzIGhhdmUgY2hhbmdlZC4KKyAgICAgICAgICogSW5mb3JtIFJvYW1pbmcuCisgICAgICAgICAqLworICAgICAgICBsZW4gPSBzaXplb2YodFNpck1hY0NhcGFiaWxpdHlJbmZvKSArCisgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikgKyBzaXplb2YodEFOSV9VOCkgKworICAgICAgICAgICAgICAzICogc2l6ZW9mKHRBTklfVTgpICsgLy8gcmVzZXJ2ZWQgZmllbGRzCisgICAgICAgICAgICAgIHBCZWFjb24tPnNzSWQubGVuZ3RoICsgMTsKKworICAgICAgICB2b3NfbWVtX2NvcHkoYXBOZXdDYXBzLmJzc0lkLAorICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+YnNzSWQsCisgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgaWYgKG5ld0NoYW5uZWwgIT0gcHNlc3Npb25FbnRyeS0+Y3VycmVudE9wZXJDaGFubmVsKQorICAgICAgICB7CisgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJDaGFub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9PSAwKSAmJgorICAgICAgICAgICAgICAgIChwQmVhY29uLT5yc25QcmVzZW50IHx8IHBCZWFjb24tPndwYVByZXNlbnQpKQorICAgICAgICB7CisgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJCU1MgQ2FwcyAoUHJpdmFjeSkgYml0IDAgaW4gYmVhY29uLCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBidXQgV1BBIG9yIFJTTiBJRSBwcmVzZW50LCBJZ25vcmUgQmVhY29uISIpKTspCisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgICAgYXBOZXdDYXBzLmNoYW5uZWxJZCA9IHBzZXNzaW9uRW50cnktPmN1cnJlbnRPcGVyQ2hhbm5lbDsKKyAgICAgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4ICopICZhcE5ld0NhcHMuc3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopICZwQmVhY29uLT5zc0lkLAorICAgICAgICAgICAgICAgICAgICAgIHBCZWFjb24tPnNzSWQubGVuZ3RoICsgMSk7CisKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+Zklnbm9yZUNhcHNDaGFuZ2UgPSBmYWxzZTsKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+ZldhaXRGb3JQcm9iZVJzcCA9IGZhbHNlOworICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TZW50Q2Fwc0NoYW5nZU50ZiA9IHRydWU7CisgICAgICAgIGxpbVNlbmRTbWVXbVN0YXR1c0NoYW5nZU50ZihwTWFjLCBlU0lSX1NNRV9BUF9DQVBTX0NIQU5HRUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VMzIgKikgJmFwTmV3Q2FwcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlbiwgcHNlc3Npb25FbnRyeS0+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W5jZSBiZXR3ZWVuIHRoZSBlYXJsaWVyIGltcGxlbWVudGF0aW9uIGFuZCB0aGUgbmV3IG9uZSBpcyBvbmx5IENhc2U0LgorICAgIC8qCisgICAgICAgICAgICAgICAgICAgICAgICBFUlAgSUUgUHJlc2VudCAgfCAgIHVzZVByb3RlY3Rpb24gICB8ICAgc2hvcnRTbG90ICAgPSAgIFFDIFNUQSBTaG9ydCBTbG90CisgICAgICAgQ2FzZTEgICAgICAgIDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgICAgICAgICAgICAgICAgICAgIDEgICAgICAgICAgICAgICAgICAgICAgIDEgICAgICAgICAgIC8vQVAgc2hvdWxkIG5vdCBhZHZlcnRpc2UgdGhpcyBjb21iaW5hdGlvbi4gCisgICAgICAgQ2FzZTIgICAgICAgIDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAgICAgICAgICAgICAgIDAKKyAgICAgICBDYXNlMyAgICAgICAgMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgICAgICAgICAgICAgICAgICAgMQorICAgICAgIENhc2U0ICAgICAgICAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgICAgICAgICAgICAgICAwCisgICAgICAgQ2FzZTUgICAgICAgIDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgICAgICAgICAgICAgICAgICAgIDEgICAgICAgICAgICAgICAgICAgICAgIDEKKyAgICAgICBDYXNlNiAgICAgICAgMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgICAgICAgICAgICAgICAgMAorICAgICAgIENhc2U3ICAgICAgICAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgICAgICAgICAgICAgICAxICAgICAgICAgICAgICAgICAgICAgICAxCisgICAgICAgQ2FzZTggICAgICAgIDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAgICAgICAgICAgICAgIDAKKyAgICAqLworICAgIG5TaG9ydFNsb3QgPSBTSVJfTUFDX0dFVF9TSE9SVF9TTE9UX1RJTUUoYXBOZXdDYXBzLmNhcGFiaWxpdHlJbmZvKTsKKworICAgIGlmIChuU2hvcnRTbG90ICE9IHBzZXNzaW9uRW50cnktPnNob3J0U2xvdFRpbWVTdXBwb3J0ZWQpCisgICAgeworICAgICAgICAvLyBTaG9ydCBzbG90IHRpbWUgY2FwYWJpbGl0eSBvZiBBUCBoYXMgY2hhbmdlZC4gQWRvcHQgdG8gaXQuCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiU2hvcnRzbG90IGNhcGFiaWxpdHkgb2YgQVAgY2hhbmdlZDogJWQiKSwgIG5TaG9ydFNsb3QpOworICAgICAgICAoKHRwU2lyTWFjQ2FwYWJpbGl0eUluZm8pJnBzZXNzaW9uRW50cnktPmxpbUN1cnJlbnRCc3NDYXBzKS0+c2hvcnRTbG90VGltZSA9ICh0QU5JX1UxNiluU2hvcnRTbG90OworICAgICAgICBwc2Vzc2lvbkVudHJ5LT5zaG9ydFNsb3RUaW1lU3VwcG9ydGVkID0gblNob3J0U2xvdDsKKyAgICAgICAgcEJlYWNvblBhcmFtcy0+ZlNob3J0U2xvdFRpbWUgPSAodEFOSV9VOCkgblNob3J0U2xvdDsKKyAgICAgICAgcEJlYWNvblBhcmFtcy0+cGFyYW1DaGFuZ2VCaXRtYXAgfD0gUEFSQU1fU0hPUlRfU0xPVF9USU1FX0NIQU5HRUQ7CisgICAgfQorICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7Cit9CisKKworCisKKworCisKKy8qKiAtLS0tLS0tLS0tLS0tLS0tLS0t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aW9uIHBzZXNzaW9uRW50cnksIHRBTklfVTggKnBSeFBhY2tldEluZm8pCit7CisgICAgdHBTaXJTbWVMb3N0TGlua1BhcmFtc0luZCBwU21lTG9zdExpbmtQYXJhbXM7CisgICAgdFNpck1zZ1EgICAgbW1oTXNnOworICAgIGlmIChOVUxMID09IHBSeFBhY2tldEluZm8pCisgICAgeworICAgICAgICByZXR1cm47CisgICAgfQorICAgIHBTbWVMb3N0TGlua1BhcmFtcyA9CisgICAgKHRwU2lyU21lTG9zdExpbmtQYXJhbXNJbmQpdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRTaXJTbWVMb3N0TGlua1BhcmFtc0luZCkpOworCisgICAgaWYgKHBTbWVMb3N0TGlua1BhcmFtcyA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgRkwoInBTbWVMb3N0TGlua1BhcmFtcyBpcyBOVUxMIikpOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIHZvc19tZW1fc2V0KHBTbWVMb3N0TGlua1BhcmFtcywgc2l6ZW9mKHRTaXJTbWVMb3N0TGlua1BhcmFtc0luZCksIDApOworICAgIHBTbWVMb3N0TGlua1BhcmFtcy0+bWVzc2FnZVR5cGUgPSBlV05JX1NNRV9MT1NUX0xJTktfUEFSQU1TX0lORDsKKyAgICBwU21lTG9zdExpbmtQYXJhbXMtPmxlbmd0aCA9IHNpemVvZih0U2lyU21lTG9zdExpbmtQYXJhbXNJbmQpOworICAgIHBTbWVMb3N0TGlua1BhcmFtcy0+c2Vzc2lvbklkID0gcHNlc3Npb25FbnRyeS0+c21lU2Vzc2lvbklkOworICAgIHBTbWVMb3N0TGlua1BhcmFtcy0+aW5mby5ic3NJZHggPSBwc2Vzc2lvbkVudHJ5LT5ic3NJZHg7CisKKyAgICAvKgorICAgICAqIFNpbmNlIEZXIGFkZHMgMTAwIHRvIFJTU0ksIGhlcmUgYWxzbyB3ZSBhcmUgYWRkaW5nIDEwMCBzbyB0aGF0CisgICAgICogSEREIGhhcyBjb21tb24gbG9naWMgdG8gc3VidHJhY3QgMTAwIGZyb20gUlNTSSByZWNlaXZlZAorICAgICAqLworICAgIHBTbWVMb3N0TGlua1BhcmFtcy0+aW5mby5yc3NpID0gV0RBX0dFVF9SWF9SU1NJX0RCKHBSeFBhY2tldEluZm8pICsgMTAwOworICAgIHZvc19tZW1fY29weShwU21lTG9zdExpbmtQYXJhbXMtPmluZm8uc2VsZk1hY0FkZHIsCisgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnNlbGZNYWNBZGRyLAorICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICBwU21lTG9zdExpbmtQYXJhbXMtPmluZm8ubGFzdERhdGFSYXRlID0gMDsKKyAgICBwU21lTG9zdExpbmtQYXJhbXMtPmluZm8ubGlua0ZsQ250ID0gMDsKKyAgICBwU21lTG9zdExpbmtQYXJhbXMtPmluZm8ubGlua0ZsVHggPSAwOworICAgIHBTbWVMb3N0TGlua1BhcmFtcy0+aW5mby5yc3ZkMSA9IDA7CisgICAgcFNtZUxvc3RMaW5rUGFyYW1zLT5pbmZvLnJzdmQyID0gMDsKKworICAgIG1taE1zZy50eXBlID0gZVdOSV9TTUVfTE9TVF9MSU5LX1BBUkFNU19JTkQ7CisgICAgbW1oTXNnLmJvZHlwdHIgPSBwU21lTG9zdExpbmtQYXJhbXM7CisgICAgbW1oTXNnLmJvZHl2YWwgPSAwOworICAgIGxpbVN5c1Byb2Nlc3NNbWhNc2dBcGkocE1hYywgJm1taE1zZywgZVBST1QpOworfQorCisvKiogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgXGJyaWVmIGxpbVByb2Nlc3NMb3N0TGlua1BhcmFtc0luZCgpIC0gaGFuZGxlcyBsb3N0IGxpbmsgcGFyYW1zIGluZGljYXRpb24K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3QgZXhpc3QgZm9yIGJkc3NJZHggOiAlZCIpLAorICAgICAgICAgICAgICAgcExvc3RMSW5rUGFyYW1zSW5kLT5pbmZvLmJzc0lkeCk7CisKKyAgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgcFNtZUxvc3RMaW5rUGFyYW1zSW5kID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRTaXJTbWVMb3N0TGlua1BhcmFtc0luZCkpOworICAgIGlmIChwU21lTG9zdExpbmtQYXJhbXNJbmQgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgRkwoIm1lbW9yeSBhbGxvY2F0ZSBmYWlsZWQgZm9yIGVXTklfU01FX0xPU1RfTElOS19QQVJBTURfSU5EIikpOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIHBTbWVMb3N0TGlua1BhcmFtc0luZC0+bWVzc2FnZVR5cGUgPSBlV05JX1NNRV9MT1NUX0xJTktfUEFSQU1TX0lORDsKKyAgICBwU21lTG9zdExpbmtQYXJhbXNJbmQtPmxlbmd0aCA9IHNpemVvZih0U2lyU21lTG9zdExpbmtQYXJhbXNJbmQpOworICAgIHBTbWVMb3N0TGlua1BhcmFtc0luZC0+c2Vzc2lvbklkID0gcHNlc3Npb25FbnRyeS0+c21lU2Vzc2lvbklkOworICAgIHBTbWVMb3N0TGlua1BhcmFtc0luZC0+aW5mby5ic3NJZHggPSBwTG9zdExJbmtQYXJhbXNJbmQtPmluZm8uYnNzSWR4OworICAgIHBTbWVMb3N0TGlua1BhcmFtc0luZC0+aW5mby5yc3NpID0gcExvc3RMSW5rUGFyYW1zSW5kLT5pbmZvLnJzc2k7CisgICAgdm9zX21lbV9jb3B5KHBTbWVMb3N0TGlua1BhcmFtc0luZC0+aW5mby5zZWxmTWFjQWRkciwKKyAgICAgICAgICAgICAgICBwTG9zdExJbmtQYXJhbXNJbmQtPmluZm8uc2VsZk1hY0FkZHIsCisgICAgICAgICA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MT0dQLAorICAgICAgICAgICAgICAgRkwoIm1lbW9yeSBhbGxvY2F0ZSBmYWlsZWQgZm9yIGVXTklfU01FX01JQ19GQUlMVVJFX0lORCIpKTsKKyAgICAgICByZXR1cm47CisgICAgfQorCisgICAgcFNpclNtZU1pY0ZhaWx1cmVJbmQtPm1lc3NhZ2VUeXBlID0gZVdOSV9TTUVfTUlDX0ZBSUxVUkVfSU5EOworICAgIHBTaXJTbWVNaWNGYWlsdXJlSW5kLT5sZW5ndGggPSBzaXplb2YocFNpclNtZU1pY0ZhaWx1cmVJbmQpOworICAgIHBTaXJTbWVNaWNGYWlsdXJlSW5kLT5zZXNzaW9uSWQgPSBwc2Vzc2lvbkVudHJ5LT5zbWVTZXNzaW9uSWQ7CisKKyAgICB2b3NfbWVtX2NvcHkocFNpclNtZU1pY0ZhaWx1cmVJbmQtPmJzc0lkLAorICAgICAgICAgICAgICAgICBwU2lyTWljRmFpbHVyZUluZC0+YnNzSWQsCisgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworCisgICAgdm9zX21lbV9jb3B5KHBTaXJTbWVNaWNGYWlsdXJlSW5kLT5pbmZvLnNyY01hY0FkZHIsCisgICAgICAgICAgICAgICAgIHBTaXJNaWNGYWlsdXJlSW5kLT5pbmZvLnNyY01hY0FkZHIsCisgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworCisgICAgdm9zX21lbV9jb3B5KHBTaXJTbWVNaWNGYWlsdXJlSW5kLT5pbmZvLnRhTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgcFNpck1pY0ZhaWx1cmVJbmQtPmluZm8udGFNYWNBZGRyLAorICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKworICAgIHZvc19tZW1fY29weShwU2lyU21lTWljRmFpbHVyZUluZC0+aW5mby5kc3RNYWNBZGRyLAorICAgICAgICAgICAgICAgICBwU2lyTWljRmFpbHVyZUluZC0+aW5mby5kc3RNYWNBZGRyLAorICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKworICAgIHZvc19tZW1fY29weShwU2lyU21lTWljRmFpbHVyZUluZC0+aW5mby5yeE1hY0FkZHIsCisgICAgICAgICAgICAgICAgIHBTaXJNaWNGYWlsdXJlSW5kLT5pbmZvLnJ4TWFjQWRkciwKKyAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisKKyAgICBwU2lyU21lTWljRmFpbHVyZUluZC0+aW5mby5tdWx0aWNhc3QgPSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNpck1pY0ZhaWx1cmVJbmQtPmluZm8ubXVsdGljYXN0OworCisgICAgcFNpclNtZU1pY0ZhaWx1cmVJbmQtPmluZm8ua2V5SWQ9IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTaXJNaWNGYWlsdXJlSW5kLT5pbmZvLmtleUlkOworCisgICAgcFNpclNtZU1pY0ZhaWx1cmVJbmQtPmluZm8uSVYxPSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2lyTWljRmFpbHVyZUluZC0+aW5mby5JVjE7CisKKyAgICB2b3NfbWVtX2NvcHkocFNpclNtZU1pY0ZhaWx1cmVJbmQtPmluZm8uVFNDLAorICAgICAgICAgICAgICAgICBwU2lyTWljRmFpbHVyZUluZC0+aW5mby5UU0MsU0lSX0NJUEhFUl9TRVFfQ1RSX1NJWkUpOworCisgICAgbW1oTXNnLnR5cGUgPSBlV05JX1NNRV9NSUNfRkFJTFVSRV9JTkQ7CisgICAgbW1oTXNnLmJvZHlwdHIgPSBwU2lyU21lTWljRmFpbHVyZUluZDsKKyAgICBtbWhNc2cuYm9keXZhbCA9IDA7CisgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfVFhfU01FX01TRywgc2Vzc2lvbklkLCBtbWhNc2cudHlwZSkpOworICAgIGxpbVN5c1Byb2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KyAgICBwTWFjSGRyID0gV0RBX0dFVF9SWF9NQUNfSEVBREVSKHBSeFBhY2tldEluZm8pOworICAgIHBzZXNzaW9uRW50cnkgPSBwZUZpbmRTZXNzaW9uQnlCc3NpZChwTWFjLHBNYWNIZHItPmJzc0lkLCZzZXNzaW9uSWQpOworICAgIGlmICghcHNlc3Npb25FbnRyeSkKKyAgICB7CisgICAgICAgIFBFTE9HMShzeXNMb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgIEZMKCJzZXNzaW9uIGRvZXMgbm90IGV4aXN0IGZvciBnaXZlbiBTVEEgWyVwTV0iKSwKKyAgICAgICAgICAgICAgICAgIHBNYWNIZHItPnNhKTspOworICAgICAgICByZXR1cm4gVFJVRTsKKyAgICB9CisKKyAgICBsb2NrX3N0YXR1cyA9ICBwZV9BY3F1aXJlR2xvYmFsTG9jaygmcE1hYy0+bGltKTsKKyAgICBpZiAobG9ja19zdGF0dXMgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgicGVfQWNxdWlyZUdsb2JhbExvY2sgZXJyb3IiKSk7CisgICAgICAgIHJldHVybiBUUlVFOworICAgIH0KKworICAgIHBTdGFEcyA9IGRwaExvb2t1cEhhc2hFbnRyeShwTWFjLCBwTWFjSGRyLT5zYSwgJmFpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcHNlc3Npb25FbnRyeS0+ZHBoLmRwaEhhc2hUYWJsZSk7CisgICAgaWYgKCFwU3RhRHMpCisgICAgeworICAgICAgICBQRUxPRzEoc3lzTG9nKHBNYWMsIExPRzEsRkwoInBTdGFEcyBpcyBOVUxMIikpOyk7CisgICAgICAgIHJldCA9IFRSVUU7CisgICAgICAgIGdvdG8gZW5kOworICAgIH0KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisgICAgaWYgKHBzZXNzaW9uRW50cnktPmxpbVJtZkVuYWJsZWQpCisgICAgeworICAgICAgICBpZiAoKFdEQV9HRVRfUlhfRFBVX0ZFRURCQUNLKHBSeFBhY2tldEluZm8pICYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEUFVfRkVFREJBQ0tfVU5QUk9URUNURURfRVJST1IpKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBJdCBtYXkgYmUgcG9zc2libGUgdGhhdCBkZWF1dGgvZGlhc3NvYyBmcmFtZXMgZnJvbSBhIHNwb29meQorICAgICAgICAgICAgICogQVAgaXMgcmVjZWl2ZWQuIFNvIGlmIGFsbCBmdXJ0aGVyIGRlYXV0aC9kaWFzc29jIGZybWFlcyBhcmUKKyAgICAgICAgICAgICAqIGRyb3BwZWQsIHRoZW4gaXQgbWF5IHJlc3VsdCBpbiBsb3NzaW5nIGRlYXV0aC9kaWFzc29jIGZyYW1lcworICAgICAgICAgICAgICogZnJvbSBnZW51aW5lIEFQLiBTbyBwcm9jZXNzIGFsbCBkZWF1dGgvZGlhc3NvYyBmcmFtZXMgd2l0aAorICAgICAgICAgICAgICogYSB0aW1lIGRpZmZlcmVuY2Ugb2YgMSBzZWMuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmICh2b3NfdGltZXJfZ2V0X3N5c3RlbV90aW1lKCkgLSBwU3RhRHMtPmxhc3RfdW5wcm90X2RlYXV0aF9kaXNhc3NvYyA8IDEwMDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmV0ID0gVFJVRTsKKyAgICAgICAgICAgICAgICBnb3RvIGVuZDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBTdGFEcy0+bGFzdF91bnByb3RfZGVhdXRoX2Rpc2Fzc29jID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc190aW1lcl9nZXRfc3lzdGVtX3RpbWUoKTsKKyAgICAgICAgfQorLyogUE1GIGVuYWJlZCwgTWFuYWdlbWVudCBmcmFtZXMgYXJlIHByb3RlY3RlZCAqLworICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChwU3RhRHMtPnByb2N0X2RlYXVoX2Rpc2Fzc29jX2NudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByZXQgPSBUUlVFOworICAgICAgICAgICAgICAgIGdvdG8gZW5kOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHBTdGFEcy0+cHJvY3RfZGVhdWhfZGlzYXNzb2NfY250Kys7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorI2VuZGlmCisvKiBQTUYgZGlzYWJsZWQgKi8KKyAgICB7CisgICAgICAgIGlmIChwU3RhRHMtPmlzRGlzYXNzb2NEZWF1dGhJblByb2dyZXNzKQorICAgICAgICB7CisgICAgICAgICAgICByZXQgPSBUUlVFOworICAgICAgICAgICAgZ290byBlbmQ7CisgICAgICAgIH0KKyAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHBTdGFEcy0+aXNEaXNhc3NvY0RlYXV0aEluUHJvZ3Jlc3MrKzsKKyAgICB9CisKK2VuZDoKKyAgICBwZV9SZWxlYXNlR2xvYmFsTG9jaygmcE1hYy0+bGltKTsKKyAgICByZXR1cm4gcmV0OworfQorLyoqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgIFxicmllZiBsaW1Jc1BrdENhbmRpZGF0ZUZvckRyb3AoKSAtIGRlY2lkZXMgd2hldGhlciB0byBkcm9wIHRoZSBmcmFtZSBvciBub3QKKworICBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCBiZWZvcmUgZW5xdWV1aW5nIHRoZSBmcmFtZSB0byBQRSBxdWV1ZSBmb3IgZnVydGhlciBwcm9jZXNzaW5nLgorICBUaGlzIHByZXZlbnRzIHVubmVjZXNzYXJ5IGZyYW1lcyBnZXR0aW5nIGludG8gUEUgUXVldWUgY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lcyBub3Qgc3VwcG9ydCBpdAorI2lmIDAKKyAgICAgICAgLy8gQVAgZG9lcyBub3Qgc3VwcG9ydCBzaG9ydCBwcmVhbWFibGUKKyAgICAgICAgcmV0dXJuIGZhbHNlOworI2VuZGlmCisgICAgfQorCisKKyAgICBsaW1Mb2cocE1hYywgTE9HMSwgIlFvUyBpbiBBc3NvY1JlcTogJWQsIGxvY2FsIGNhcGFicyBxb3M6ICVkIiwKKyAgICAgICAgICAgICAgcEFzc29jUmVxLT5jYXBhYmlsaXR5SW5mby5xb3MsCisgICAgICAgICAgICAgIHBMb2NhbENhcGFicy0+cW9zKTsKKworICAgIC8vIENvbXBhcmUgUW9TIGNhcGFiaWxpdHkKKyAgICBpZiAocEFzc29jUmVxLT5jYXBhYmlsaXR5SW5mby5xb3MgJiYKKyAgICAgICAgKHBBc3NvY1JlcS0+Y2FwYWJpbGl0eUluZm8ucW9zICE9IHBMb2NhbENhcGFicy0+cW9zKSkKKyAgICB7CisgICAgICAgIC8qVGVtcG9yYXJ5IGhhY2sgZm9yIFVQRiB0byBza2lwIDExZSBjYXBhYmlsaXR5IGNoZWNrIGluIG9yZGVyIHRvIGludGVyb3Agd2l0aCAKKyAgICAgICAgICBDU1IgLSBwcm9wZXIgZml4IG5lZWRzIHRvIGJlIHB1dCBpbiBwbGFjZSovCisgICAgICAgIGlmICggMCAhPSB2b3NfZ2V0X3NraXBfMTFlX2NoZWNrKCkpCisgICAgICAgIHsKKyAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlJlY2VpdmVkIHVubWF0Y2hlZCBRT1MgYnV0IGNmZyB0byBzdXBwcmVzcyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgLSBjb250aW51aW5nIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAvLyBBUCBkb2VzIG5vdCBzdXBwb3J0IFFvUyBjYXBhYmls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worICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorICAgICNlbmRpZiAvL1RPIFNVUFBPUlQgQlQtQU1QCisKKyAgICAvKiBDb3B5IG9wZXJhdGlvbmFsIHJhdGUgc2V0IGZyb20gc2Vzc2lvbiBFbnRyeSAqLworICAgIHZvc19tZW1fY29weShwUmF0ZVNldC0+cmF0ZSwgKHBzZXNzaW9uRW50cnktPnJhdGVTZXQucmF0ZSksCisgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnJhdGVTZXQubnVtUmF0ZXMpOworICAgIAorICAgIHBSYXRlU2V0LT5udW1SYXRlcyA9IHBzZXNzaW9uRW50cnktPnJhdGVTZXQubnVtUmF0ZXM7CisKKyAgICAvLyBFeHRyYWN0IEJTUyBiYXNpYyByYXRlc2V0IGZyb20gb3BlcmF0aW9uYWwgcmF0ZXNldAorICAgIGZvciAoaSA9IDAsIGogPSAwOyAoKGkgPCBwUmF0ZVNldC0+bnVtUmF0ZXMpICYmIChpIDwgU0lSX01BQ19SQVRFU0VUX0VJRF9NQVgpKSA7IGkrKykKKyAgICB7CisgICAgICAgIGlmICgocFJhdGVTZXQtPnJhdGVbaV0gJiAweDgwKSA9PSAweDgwKQorICAgICAgICB7CisgICAgICAgICAgICAvLyBtc2IgaXMgc2V0LCBzbyB0aGlzIGlzIGEgYmFzaWMgcmF0ZQorICAgICAgICAgICAgYmFzaWNSYXRlLnJhdGVbaisrXSA9IHBSYXRlU2V0LT5yYXRlW2ldOworICAgICAgICB9CisgICAgfQorCisgICAgLyoKKyAgICAgKiBGb3IgZWFjaCBCU1MgYmFzaWMgcmF0ZSwgZmluZCBpZiBpdCBpcyBwcmVzZW50IGluIHRoZQorICAgICAqIHJlY2VpdmVkIHJhdGVzZXQuCisgICAgICovCisgICAgZm9yIChrID0gMDsgayA8IGo7IGsrKykKKyAgICB7CisgICAgICAgIG1hdGNoID0gMDsKKyAgICAgICAgZm9yIChpID0gMDsgKChpIDwgcnhSYXRlU2V0Lm51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XJfc3VpdGVbaV0sCisgICAgICAgICAgICByeFJTTkllLmdwX2NpcGhlcl9zdWl0ZVtpXSk7CisgICAgICAgICAgICByZXR1cm4gZVNJUl9NQUNfSU5WQUxJRF9HUk9VUF9DSVBIRVJfU1RBVFVTOworICAgICAgICB9CisgICAgfQorCisgICAgLyoKKyAgICAgKiBGb3IgZWFjaCBQYWlyd2lzZSBjaXBoZXIgc3VpdGUgY2hlY2sgd2hldGhlciB3ZSBzdXBwb3J0CisgICAgICogcmVjZWl2ZWQgcGFpcndpc2UKKyAgICAgKi8KKyAgICBtYXRjaCA9IDA7CisgICAgZm9yIChpID0gMDsgaSA8IHJ4UlNOSWUucHdpc2VfY2lwaGVyX3N1aXRlX2NvdW50OyBpKyspCisgICAgeworICAgICAgICBmb3IoaiA9IDA7IGogPCBwUlNOSWUtPnB3aXNlX2NpcGhlcl9zdWl0ZV9jb3VudDsgaisrKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAodm9zX21lbV9jb21wYXJlKCZyeFJTTkllLnB3aXNlX2NpcGhlcl9zdWl0ZXNbaV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwUlNOSWUtPnB3aXNlX2NpcGhlcl9zdWl0ZXNbal0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihwUlNOSWUtPnB3aXNlX2NpcGhlcl9zdWl0ZXNbal0pKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBtYXRjaCA9IDE7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoKHN0YUlzSFQpIAorI2lmZGVmIEFOSV9MSVRUTEVfQllURV9FTkRJQU4KKyAgICAgICAgICAgICYmKCAocnhSU05JZS5wd2lzZV9jaXBoZXJfc3VpdGVzW2ldWzNdICYgU0VDVVJJVFlfU1VJVEVfVFlQRV9NQVNLKSA9PSBTRUNVUklUWV9TVUlURV9UWVBFX0NDTV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XRlIGNoZWNrIHdoZXRoZXIgd2Ugc3VwcG9ydAorICAgICAqIHJlY2VpdmVkIHBhaXJ3aXNlCisgICAgICovCisgICAgbWF0Y2ggPSAwOworICAgIGZvciAoaSA9IDA7IGkgPCByeFdQQUllLnVuaWNhc3RfY2lwaGVyX2NvdW50OyBpKyspCisgICAgeworICAgICAgICBmb3IoaiA9IDA7IGogPCBwV1BBSWUtPnVuaWNhc3RfY2lwaGVyX2NvdW50OyBqKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmICh2b3NfbWVtX2NvbXBhcmUocnhXUEFJZS51bmljYXN0X2NpcGhlcnNbaV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFdQQUllLT51bmljYXN0X2NpcGhlcnNbal0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbWF0Y2ggPSAxOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKChzdGFJc0hUKSAKKyNpZmRlZiBBTklfTElUVExFX0JZVEVfRU5ESUFOCisgICAgICAgICAgICAmJiggKHJ4V1BBSWUudW5pY2FzdF9jaXBoZXJzW2ldWzNdICYgU0VDVVJJVFlfU1VJVEVfVFlQRV9NQVNLKSA9PSBTRUNVUklUWV9TVUlURV9UWVBFX0NDTVApKQorI2Vsc2UKKyAgICAgICAgICAgICYmKCAocnhXUEFJZS51bmljYXN0X2NpcGhlcnNbaV1bMF0gJiBTRUNVUklUWV9TVUlURV9UWVBFX01BU0spID09IFNFQ1VSSVRZX1NVSVRFX1RZUEVfQ0NNUCkpCisjZW5kaWYgICAgICAgICAgICAKKyAgICAgICAgeworICAgICAgICAgICAgIG9ubHlOb25IdENpcGhlcj0wOworICAgICAgICB9CisKKyAgICB9CisKKyAgICBpZiAoKCFtYXRjaCkgfHwgKChzdGFJc0hUKSAmJiBvbmx5Tm9uSHRDaXBo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UCA9IEZBTFNFOworICAgIGlmIChwTWFjLT5saW0uZ0xpbUFkZHRzU2VudCkKKyAgICB7CisgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RJTUVSX0RFQUNUSVZBVEUsIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLCBlTElNX0FERFRTX1JTUF9USU1FUikpOworICAgICAgICB0eF90aW1lcl9kZWFjdGl2YXRlKCZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1BZGR0c1JzcFRpbWVyKTsKKyAgICB9CisKKyAgICBpZiAocFN0YURzLT5tbG1TdGFDb250ZXh0Lm1sbVN0YXRlID09IGVMSU1fTUxNX1dUX0FTU09DX0NORl9TVEFURSkKKyAgICB7CisgICAgICAgIGxpbURlYWN0aXZhdGVBbmRDaGFuZ2VQZXJTdGFJZFRpbWVyKHBNYWMsIGVMSU1fQ05GX1dBSVRfVElNRVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPmFzc29jSWQpOworCisgICAgICAgIGlmICghcFN0YURzLT5tbG1TdGFDb250ZXh0LnVwZGF0ZUNvbnRleHQpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlcmUgaXMgbm8gY29udGV4dCBhdCBQb2xhcmlzIHRvIGRlbGV0ZS4KKyAgICAgICAgICAgICAqIFJlbGVhc2Ugb3VyIGFzc2lnbmVkIEFJRCBiYWNrIHRvIHRoZSBmcmVlIHBvb2wKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgaWYgKChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQVBfUk9MRSkgfHwgCisgICAgICAgICAgICAgICAgKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9CVF9BTVBfQVBfUk9MRSkpCisgICAgICAgICAgICB7ICAgIAorICAgICAgICAgICAgICA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AgICAgICAvLyBTZXQgQlNTSUQgYXQgQ0ZHIHRvIG51bGwKKyAgICAgICAgdFNpck1hY0FkZHIgbnVsbEFkZHIgPSB7MHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH07CisgICAgICAgICNpZiAwCisgICAgICAgIGlmIChjZmdTZXRTdHIocE1hYywgV05JX0NGR19CU1NJRCwgKHRBTklfVTggKikgJm51bGxBZGRyLAorICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgLy8vIENvdWxkIG5vdCB1cGRhdGUgQlNTSUQgYXQgQ0ZHLiBMb2cgZXJyb3IuCisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoImNvdWxkIG5vdCB1cGRhdGUgQlNTSUQgYXQgQ0ZHIikpOworCisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgI2VuZGlmLy9UTyBTVVBQT1JUIEJULUFNUAorICAgICAgICAKKyAgICAgICAgc2lyQ29weU1hY0FkZHIobnVsbEFkZHIscHNlc3Npb25FbnRyeS0+YnNzSWQpOworCisgICAgICAgIC8vIEZyZWUgdXAgYnVmZmVyIGFsbG9jYXRlZCBmb3IgSm9pblJlcSBoZWxkIGJ5CisgICAgICAgIC8vIE1MTSBzdGF0ZSBtYWNoaW5lCisgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5wTGltTWxtSm9pblJlcSkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBzZXNzaW9uRW50cnktPnBMaW1NbG1Kb2luUmVxKTsKKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBMaW1NbG1Kb2luUmVxID0gTlVMTDsKKyAgICAgICAgfQorCisgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbUFJRCA9IDA7CisKKworICAgIH0KKworICAgIGlmICgobWxtU3RhQ29udGV4dC5jbGVhbnVwVHJpZ2dlciA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlTElNX0hPU1RfRElTQVNTT0MpIHx8CisgICAgICAgIChtbG1TdGFDb250ZXh0LmNsZWFudXBUcmlnZ2VyID09CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVMSU1fTElOS19NT05JVE9SSU5HX0RJU0FTU09DKSB8fAorICAgICAgICAobWxtU3RhQ29udGV4dC5jbGVhbnVwVHJpZ2dlciA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlTElNX1BST01JU0NVT1VTX01PREVfRElTQVNTT0MpKQorICAgIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIEhvc3Qgb3IgTE1NIGRyaXZlbiBEaXNhc3NvY2lhdGlvbi4KKyAgICAgICAgICogSXNzdWUgRGlzYXNzb2MgQ29uZmlybSB0byBTTUUuCisgICAgICAgICAqLworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csIEZMKCJMaW0gUG9zdGluZyBESVNBU1NPQ19DTkYgdG8gU21lLlRyaWdnZXI6ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1sbVN0YUNvbnRleHQuY2xlYW51cFRyaWdnZXIpOworCisKKyAgICAgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4ICopICZtbG1EaXNhc3NvY0NuZi5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopIHN0YURzQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgbWxtRGlzYXNzb2NDbmYucmVzdWx0Q29kZSA9IHN0YXR1c0NvZGU7CisgICAgICAgIG1sbURpc2Fzc29jQ25mLmRpc2Fzc29jVHJpZ2dlciA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1sbVN0YUNvbnRleHQuY2xlYW51cFRyaWdnZXI7CisgICAgICAgIC8qIFVwZGF0ZSBQRSBzZXNzaW9uIElkKi8KKyAgICAgICAgbWxtRGlzYXNzb2NDbmYuc2Vzc2lvbklkID0gcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQ7CisKKyAgICAgICAgbGltUG9zdFNtZU1lc3NhZ2UocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgTElNX01MTV9ESVNBU1NPQ19DTkYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1UzMiAqKSAmbWxtRGlzYXNzb2NDbmYpOworICAgIH0KKyAgICBlbHNlIGlmICgobWxtU3RhQ29udGV4dC5jbGVhbnVwVHJpZ2dlciA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVMSU1fSE9TVF9ERUFVVEgpIHx8CisgICAgICAgICAgICAgKG1sbVN0YUNvbnRleHQuY2xlYW51cFRyaWdnZXIgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlTElNX0xJTktfTU9OSVRPUklOR19ERUFVVEgpKQorICAgIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIEhvc3Qgb3IgTE1NIGRyaXZlbiBEZWF1dGhlbnRpY2F0aW9uLgorICAgICAgICAgKiBJc3N1ZSBEZWF1dGggQ29uZmlybSB0byBTTUUuCisgICAgICAgICAqLworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csIEZMKCJMaW0gUG9zdGluZyBERUFVVEhfQ05GIHRvIFNtZS5UcmlnZ2VyOiAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtbG1TdGFDb250ZXh0LmNsZWFudXBUcmlnZ2VyKTsKKyAgICAgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4ICopICZtbG1EZWF1dGhDbmYucGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSBzdGFEc0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgIG1sbURlYXV0aENuZi5yZXN1bHRDb2RlICAgID0gc3RhdHVzQ29kZTsKKyAgICAgICAgbWxtRGVhdXRoQ25mLmRlYXV0aFRyaWdnZXIgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtbG1TdGFDb250ZXh0LmNsZWFudXBUcmlnZ2VyOworICAgICAgICAvKiBQRSBzZXNzaW9uIElkICovCisgICAgICAgIG1sbURlYXV0aENuZi5zZXNzaW9uSWQgPSBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZDsKKworICAgICAgICBsaW1Qb3N0U21lTWVzc2FnZShwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICBMSU1fTUxNX0RFQVVUSF9DTkYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1UzMiAqKSAmbWxtRGVhdXRoQ25mKTsKKyAgICB9CisgICAgZWxzZSBpZiAoKG1sbVN0YUNvbnRleHQuY2xlYW51cFRyaWdnZXIgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVMSU1fUEVFUl9FTlRJVFlfRElTQVNTT0MpIHx8CisgICAgICAgICAgICAgKG1sbVN0YUNvbnRleHQuY2xlYW51cFRyaWdnZXIgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlTElNX1BFRVJfRU5USVRZX0RFQVVUSCkpCisgICAgeworICAgICAgICAvKioKKyAgICAgICAgICogUmVjZWl2ZWQgRGlzYXNzb2NpYXRpb24vRGVhdXRoZW50aWNhdGlvbiBmcm9tIHBlZXIuCisgICAgICAgICAqIElzc3VlIFB1cmdlIEluZCB0byBTTUUuCisgICAgICAgICAqLworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csIEZMKCJMaW0gUG9zdGluZyBQVVJHRV9TVEFfSU5EIHRvIFNtZS5UcmlnZ2VyOiAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWxtU3RhQ29udGV4dC5jbGVhbnVwVHJpZ2dlcikgOworICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKikgJm1sbVB1cmdlU3RhSW5kLnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTggKikgc3RhRHNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgIG1sbVB1cmdlU3RhSW5kLnJlYXNvbkNvZGUgICA9ICh0QU5JX1U4KSBtbG1TdGFDb250ZXh0LmRpc2Fzc29jUmVhc29uOworICAgICAgICBtbG1QdXJnZVN0YUluZC5haWQgICAgICAgICAgPSBzdGFEc0Fzc29jSWQ7CisgICAgICAgIG1sbVB1cmdlU3RhSW5kLnB1cmdlVHJpZ2dlciA9IG1sbVN0YUNvbnRleHQuY2xlYW51cFRyaWdnZXI7CisgICAgICAgIG1sbVB1cmdlU3RhSW5kLnNlc3Npb25JZCA9IHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkOworCisgICAgICAgIGxpbVBvc3RTbWVNZXNzYWdlKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgIExJTV9NTE1fUFVSR0VfU1RBX0lORCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTMyICopICZtbG1QdXJnZVN0YUluZCk7CisgICAgfQorICAgIGVsc2UgaWYobWxtU3RhQ29udGV4dC5jbGVhbnVwVHJpZ2dlciA9PSBlTElNX0pPSU5fRkFJTFVSRSkKKyAgICB7CisgICAgICAgIC8vUEUgc2V0dXAgdGhlIHBlZXIgZW50cnkgaW4gSFcgdXBmcm9udCwgcmlnaHQgYWZ0ZXIgam9pbiBpcyBjb21wbGV0ZWQuCisgICAgICAgIC8vSWYgdGhlcmUgaXMgYSBmYWlsdXJlIGR1cmluZyByZXN0IG9mIHRoZSBhc3NvYyBzZXF1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AgICAgICAgICAgKG1sbVN0YUNvbnRleHQucmVzdWx0Q29kZSA9PSBlU0lSX1NNRV9GVF9SRUFTU09DX0ZBSUxVUkUpIHx8CisgICAgICAgICAgIChtbG1TdGFDb250ZXh0LnJlc3VsdENvZGUgPT0gZVNJUl9TTUVfUkVBU1NPQ19USU1FT1VUX1JFU1VMVF9DT0RFKSB8fAorICAgICAgICAgICAobWxtU3RhQ29udGV4dC5yZXN1bHRDb2RlID09IGVTSVJfU01FX0pPSU5fREVBVVRIX0ZST01fQVBfRFVSSU5HX0FERF9TVEEKKyAgICAgICAgICAgICYmIHRlbXBMaW1TbWVTdGF0ZSA9PSBlTElNX1NNRV9XVF9SRUFTU09DX1NUQVRFKQorICAgICAgICAgICkKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0cxLCBGTCgiTGltIFBvc3RpbmcgZVdOSV9TTUVfUkVBU1NPQ19SU1AgdG8gU01FIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAicmVzdWx0Q29kZTogJWQsIHN0YXR1c0NvZGU6ICVkLCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInNlc3Npb25JZDogJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1sbVN0YUNvbnRleHQucmVzdWx0Q29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1sbVN0YUNvbnRleHQucHJvdFN0YXR1c0NvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCk7CisgICAgICAgICAgICBpZihtbG1TdGFDb250ZXh0LnJlc3VsdENvZGUgIT0gZVNJUl9TTUVfU1VDQ0VTUyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcGVEZWxldGVTZXNzaW9uKHBNYWMsIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnkgPSBOVUxMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbGltU2VuZFNtZUpvaW5SZWFzc29jUnNwKHBNYWMsIGVXTklfU01FX1JFQVNTT0NfUlNQLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1sbVN0YUNvbnRleHQucmVzdWx0Q29kZSwgbWxtU3RhQ29udGV4dC5wcm90U3RhdHVzQ29kZSwgcHNlc3Npb25FbnRyeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbWVzZXNzaW9uSWQsIHNtZXRyYW5zYWN0aW9uSWQpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBzZXNzaW9uRW50cnktPnBMaW1Kb2luUmVxKTsKKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBMaW1Kb2luUmVxID0gTlVMTDsKKworICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0cxLCBGTCgiTGltIFBvc3RpbmcgZVdOSV9TTUVfSk9JTl9SU1AgdG8gU01FLiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInJlc3VsdENvZGU6ICVkLHN0YXR1c0NvZGU6ICVkLCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInNlc3Npb25JZDogJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1sbVN0YUNvbnRleHQucmVzdWx0Q29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1sbVN0YUNvbnRleHQucHJvdFN0YXR1c0NvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCk7CisgICAgICAgICAgICBpZihtbG1TdGFDb250ZXh0LnJlc3VsdENvZGUgIT0gZVNJUl9TTUVfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKy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dGhOb2RlICpwQXV0aE5vZGU7CisKKyAgICAgICAgcEF1dGhOb2RlID0gbGltQWNxdWlyZUZyZWVQcmVBdXRoTm9kZShwTWFjLCAmcE1hYy0+bGltLmdMaW1QcmVBdXRoVGltZXJUYWJsZSk7CisKKyAgICAgICAgaWYgKHBBdXRoTm9kZSkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4ICopIHBBdXRoTm9kZS0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBlZXJBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgICAgIHBBdXRoTm9kZS0+ZlRpbWVyU3RhcnRlZCA9IDA7CisgICAgICAgICAgICBwQXV0aE5vZGUtPm1sbVN0YXRlID0gZUxJTV9NTE1fQVVUSEVOVElDQVRFRF9TVEFURTsKKyAgICAgICAgICAgIHBBdXRoTm9kZS0+YXV0aFR5cGUgPSAodEFuaUF1dGhUeXBlKSBhdXRoVHlwZTsKKyAgICAgICAgICAgIHBBdXRoTm9kZS0+dGltZXN0YW1wID0gdm9zX3RpbWVyX2dldF9zeXN0ZW1fdGlja3MoKTsKKyAgICAgICAgICAgIGxpbUFkZFByZUF1dGhOb2RlKHBNYWMsIHBBdXRoTm9kZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBpZiAoZGVsZXRlU3RhID09IHRydWUpCisgICAgeworICAgICAgICBwU3RhRHMgPSBkcGhHZXRIYXNoRW50cnkocE1hYywgc3RhSWQsICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsKKworICAgICAgICBpZiAocFN0YURzID09IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICAgICAgICAgIEZMKCJObyBTVEEgY29udGV4dCwgeWV0IHJlamVjdGluZyBBc3NvY2lhdGlvbiIpKTsKKworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFBvbGFyaXMgaGFzIHN0YXRlIGZvciB0aGlzIFNUQS4KKyAgICAgICAgICogVHJpZ2dlciBjbGVhbnVwLgorICAgICAgICAgKi8KKyAgICAgICAgcFN0YURzLT5tbG1TdGFDb250ZXh0LmNsZWFudXBUcmlnZ2VyID0gZUxJTV9SRUFTU09DX1JFSkVDVDsKKworICAgICAgICAvLyBSZWNlaXZlIHBhdGggY2xlYW51cAorICAgICAgICBsaW1DbGVhbnVwUnhQYXRoKHBNYWMsIHBTdGFEcywgcHNlc3Npb25FbnRyeSk7CisgICAKKyAgICAgICAgLy8gU2VuZCBSZS9Bc3NvY2lhdGlvbiBSZXNwb25zZSB3aXRoCisgICAgICAgIC8vIHN0YXR1cyBjb2RlIHRvIHJlcXVlc3RpbmcgU1RBLgorICAgICAgICBsaW1TZW5kQXNzb2NSc3BNZ210RnJhbWUocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJDb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBlZXJBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ViVHlwZSwgMCxwc2Vzc2lvbkVudHJ5KTsKKworICAgICAgICBpZiAoIHBzZXNzaW9uRW50cnktPnBhcnNlZEFzc29jUmVxW3BTdGFEcy0+YXNzb2NJZF0gIT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgICAgLy8gQXNzb2N0aW9uIGNvbmZpcm1hdGlvbiBpcyBjb21wbGV0ZSwgZnJlZSB0aGUgY29weSBvZiBhc3NvY2lhdGlvbiByZXF1ZXN0IGZyYW1lCisgICAgICAgICAgICBpZiAoICgodHBTaXJBc3NvY1JlcSkocHNlc3Npb25FbnRyeS0+cGFyc2VkQXNzb2NSZXFbcFN0YURzLT5hc3NvY0lkXSkpLT5hc3NvY1JlcUZyYW1lKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUoKCh0cFNpckFzc29jUmVxKShwc2Vzc2lvbkVudHJ5LT5wYXJzZWRBc3NvY1JlcVtwU3RhRHMtPmFzc29jSWRdKSktPmFzc29jUmVxRnJhbWUpOworICAgICAgICAgICAgICAgICgodHBTaXJBc3NvY1JlcSkocHNlc3Npb25FbnRyeS0+cGFyc2VkQXNzb2NSZXFbcFN0YURzLT5hc3NvY0lkXSkpLT5hc3NvY1JlcUZyYW1lID0gTlVMTDsKKyAgICAgICAgICAgIH0gICAgICAgICAgICAKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwc2Vzc2lvbkVudHJ5LT5wYXJzZWRBc3NvY1JlcVtwU3RhRHMtPmFzc29jSWRdKTsKKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBhcnNlZEFzc29jUmVxW3BTdGFEcy0+YXNzb2NJZF0gPSBOVUxMOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGxpbVNlbmRBc3NvY1JzcE1nbXRGcmFtZShwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9NQUNfTUFYX0FTU09DX1NUQV9SRUFDSEVEX1NUQVRVUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZWVyQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1YlR5cGUsIDAscHNlc3Npb25FbnRyeSk7CisgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgRkwoInJlY2VpdmVkIFJlL0Fzc29jIHJlcSB3aGVuIG1heCBhc3NvY2lhdGVkIFNUQXMgcmVhY2hlZCBmcm9tICIpKTsKKyAgICAgICA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VkLiBBZGRyIGlzICIpLAorICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltSHQyMFBhcmFtcy5udW1TdGEpOworICAgIGxpbVByaW50TWFjQWRkcihwTWFjLCBwU3RhRHMtPnN0YUFkZHIsIExPRzEpOykKKyAgICBpZiAocHNlc3Npb25FbnRyeS0+Z0xpbUh0MjBQYXJhbXMubnVtU3RhID4gMCkKKyAgICB7CisgICAgICAgIGZvciAoaT0wOyBpPExJTV9QUk9UX1NUQV9DQUNIRV9TSVpFOyBpKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5wcm90U3RhQ2FjaGVbaV0uYWN0aXZlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICh2b3NfbWVtX2NvbXBhcmUocHNlc3Npb25FbnRyeS0+cHJvdFN0YUNhY2hlW2ldLmFkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPnN0YUFkZHIsIHNpemVvZih0U2lyTWFjQWRkcikpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbUh0MjBQYXJhbXMubnVtU3RhLS07CisgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnByb3RTdGFDYWNoZVtpXS5hY3RpdmUgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgaWYgKHBzZXNzaW9uRW50cnktPmdMaW1IdDIwUGFyYW1zLm51bVN0YSA9PSAwKQorICAgIHsKKyAgICAgICAgLy8gZGlzYWJsZSBwcm90ZWN0aW9uCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiTm8gMTFCIFNUQSBleGlzdHMsIFBFU2Vzc2lvbklEICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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VTEwgPT0gcFN0YURzKQorICAgICAgcmV0dXJuOworCisgICAgbGltR2V0UmZCYW5kKHBNYWMsICZyZkJhbmQsIHBzZXNzaW9uRW50cnkpOworICAgIGlmKFNJUl9CQU5EXzVfR0haID09IHJmQmFuZCkKKyAgICB7CisgICAgICAgIC8vd2UgYXJlIEhULiBpZiB3ZSBhcmUgMTFBLCB0aGVuIHByb3RlY3Rpb24gaXMgbm90IHJlcXVpcmVkLgorICAgICAgICBpZih0cnVlID09IHBzZXNzaW9uRW50cnktPmh0Q2FwYWJpbGl0eSkKKyAgICAgICAgeworICAgICAgICAgICAgLy93ZSBhcmUgSFQgYW5kIDExQSBzdGF0aW9uIGlzIGxlYXZpbmcuCisgICAgICAgICAgICAvL3Byb3RlY3Rpb24gY29uc2lkZXJhdGlvbiByZXF1aXJlZC4KKyAgICAgICAgICAgIC8vSFQgc3RhdGlvbiBsZWF2aW5nID09PiB0aGlzIGNhc2UgaXMgY29tbW9ubHkgaGFuZGxlZCBiZXR3ZWVuIGJvdGggdGhlIGJhbmRzIGJlbG93LgorICAgICAgICAgICAgaWYoKHBzZXNzaW9uRW50cnktPmJlYWNvblBhcmFtcy5sbGFDb2V4aXN0KSAmJiAKKyAgICAgICAgICAgICAgKGZhbHNlID09IHBTdGFEcy0+bWxtU3RhQ29udGV4dC5odENhcGFiaWxpdHkpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFBFTE9HMShsaW1Mb2cocE1hYywgTE9HMSwgRkwoIiglZCkgQSAxMUEgU1RBIGlzIGRpc2Fzc29jaWF0ZWQuIEFkZHIgaXMgIiksCisgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW0xMWFQYXJhbXMubnVtU3RhKTsKKyAgICAgICAgICAgICAgICBsaW1QcmludE1hY0FkZHIocE1hYywgcFN0YURzLT5zdGFBZGRyLCBMT0cxKTspCisgICAgICAgICAgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPmdMaW0xMWFQYXJhbXMubnVtU3RhID4gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGZvciAoaT0wOyBpPExJTV9QUk9UX1NUQV9DQUNIRV9TSVpFOyBpKyspCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5wcm90U3RhQ2FjaGVbaV0uYWN0aXZlKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2b3NfbWVtX2NvbXBhcmUoIHBzZXNzaW9uRW50cnktPnByb3RTdGFDYWNoZVtpXS5hZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5zdGFBZGRyLCBzaXplb2YodFNpck1hY0FkZHIpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW0xMWFQYXJhbXMubnVtU3RhLS07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnByb3RTdGFDYWNoZVtpXS5hY3RpdmUgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+Z0xpbTExYVBhcmFtcy5udW1TdGEgPT0gMCkgCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvLyBkaXNhYmxlIHByb3RlY3Rpb24KKyAgICAgICAgICAgICAgICAgICAgICBsaW1FbmFibGUxMWFQcm90ZWN0aW9uKHBNYWMsIGZhbHNlLCBmYWxzZSwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZihTSVJfQkFORF8yXzRfR0haID09IHJmQmFuZCkKKyAgICB7CisgICAgICAgIGxpbUdldFBoeU1vZGUocE1hYywgJnBoeU1vZGUsIHBzZXNzaW9uRW50cnkpOworCisgICAgICAgIGVycEVuYWJsZWQgPSBwU3RhRHMtPmVycEVuYWJsZWQ7CisgICAgICAgIC8vd2UgYXJlIEhUIG9yIDExRyBhbmQgMTFCIHN0YXRpb24gaXMgZ2V0dGluZyBkZWxldGVkLgorICAgICAgICBpZiAoKChwaHlNb2RlID09IFdOSV9DRkdfUEhZX01PREVfMTFHKSB8fAorICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5odENhcGFiaWxpdHkpICYmCisgICAgICAgICAgICAgIChlcnBFbmFibGVkID09IGVIQUxfQ0xFQVIpKQorICAgICAgICB7CisgICAgICAgICAgICBQRUxPRzEobGltTG9nKHBNYWMsIExPRzEsIEZMKCIoJWQpIEEgbGVnYWN5IFNUQSBpcyBkaXNhc3NvY2lhdGVkLiBBZGRyIGlzICIpLAorICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW0xMWJQYXJhbXMubnVtU3RhKTsKKyAgICAgICAgICAgIGxpbVByaW50TWFjQWRkcihwTWFjLCBwU3RhRHMtPnN0YUFkZHIsIExPRzEpOykKKyAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5nTGltMTFiUGFyYW1zLm51bVN0YSA+IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZm9yIChpPTA7IGk8TElNX1BST1RfU1RBX0NBQ0hFX1NJWkU7IGkrKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5wcm90U3RhQ2FjaGVbaV0uYWN0aXZlKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodm9zX21lbV9jb21wYXJlKCBwc2Vzc2lvbkVudHJ5LT5wcm90U3RhQ2FjaGVbaV0uYWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5zdGFBZGRyLCBzaXplb2YodFNpck1hY0FkZHIpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltMTFiUGFyYW1zLm51bVN0YS0tOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnByb3RTdGFDYWNoZVtpXS5hY3RpdmUgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPmdMaW0xMWJQYXJhbXMubnVtU3RhID09IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gZGlzYWJsZSBwcm90ZWN0aW9uCisgICAgICAgICAgICAgICAgbGltRW5hYmxlMTFnUHJvdGVjdGlvbihwTWFjLCBmYWxzZSwgZmFsc2UsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgLy8obm9uLTExQiBzdGF0aW9uIGlzIGxlYXZpbmcpIG9yICh3ZSBhcmUgbm90IDExRyBvciBIVCBBUCkKKyAgICAgICAgZWxzZSBpZihwc2Vzc2lvbkVudHJ5LT5odENhcGFiaWxpdHkpCisgICAgICAgIHsgLy93ZSBhcmUgSFQgQVAgYW5kIG5vbi0xMUIgc3RhdGlvbiBpcyBsZWF2aW5nLgorCisgICAgICAgICAgICAvLzExZyBzdGF0aW9uIGlzIGxlYXZpbmcgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmKCFwU3RhRHMtPm1sbVN0YUNvbnRleHQuaHRDYXBhYmlsaXR5KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFBFTE9HMShsaW1Mb2cocE1hYywgTE9HMSwgRkwoIiglZCkgQSAxMWcgU1RBIGlzIGRpc2Fzc29jaWF0ZWQuIEFkZHIgaXMgIiksCisgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW0xMWJQYXJhbXMubnVtU3RhKTsKKyAgICAgICAgICAgICAgICBsaW1QcmludE1hY0FkZHIocE1hYywgcFN0YURzLT5zdGFBZGRyLCBMT0cxKTspCisgICAgICAgICAgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPmdMaW0xMWdQYXJhbXMubnVtU3RhID4gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGZvciAoaT0wOyBpPExJTV9QUk9UX1NUQV9DQUNIRV9TSVpFOyBpKyspCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5wcm90U3RhQ2FjaGVbaV0uYWN0aXZlKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2b3NfbWVtX2NvbXBhcmUoIHBzZXNzaW9uRW50cnktPnByb3RTdGFDYWNoZVtpXS5hZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5zdGFBZGRyLCBzaXplb2YodFNpck1hY0FkZHIpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW0xMWdQYXJhbXMubnVtU3RhLS07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnByb3RTdGFDYWNoZVtpXS5hY3RpdmUgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPmdMaW0xMWdQYXJhbXMubnVtU3RhID09IDApIAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gZGlzYWJsZSBwcm90ZWN0aW9uCisgICAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRQcm90ZWN0aW9uRnJvbTExZyhwTWFjLCBmYWxzZSwgZmFsc2UsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9ICAgICAgICAgICAgICAKKyAgICAgICAgfQorICAgIH0KKworICAgIC8vTFNJRyBUWE9QIG5vdCBzdXBwb3J0aW5nIHN0YWl0b24gbGVhdmluZy4gYXBwbGllcyB0byAyLjQgYXMgd2VsbCBhcyA1IEdIWi4KKyAgICBpZigodHJ1ZSA9PSBwc2Vzc2lvbkVudHJ5LT5odENhcGFiaWxpdHkpICYmCisgICAgICAgICh0cnVlID09IHBTdGFEcy0+bWxtU3RhQ29udGV4dC5odENhcGFiaWxpdHkpKQorICAgIHsKKyAgICAgICAgLy9IVCBub24tR0YgbGVhdmluZworICAgICAgICBpZighcFN0YURzLT5odEdyZWVuZmllbGQpCisgICAgICAgIHsKKyAgICAgICAgICAgIFBFTE9HMShsaW1Mb2cocE1hYywgTE9HMSwgRkwoIiglZCkgQSBub24tR0YgU1RBIGlzIGRpc2Fzc29jaWF0ZWQuIEFkZHIgaXMgIiksCisgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbU5vbkdmUGFyYW1zLm51bVN0YSk7CisgICAgICAgICAgICBsaW1QcmludE1hY0FkZHIocE1hYywgcFN0YURzLT5zdGFBZGRyLCBMT0cxKTspCisgICAgICAgICAgICBpZiAocHNlc3Npb25FbnRyeS0+Z0xpbU5vbkdmUGFyYW1zLm51bVN0YSA+IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZm9yIChpPTA7IGk8TElNX1BST1RfU1RBX0NBQ0hFX1NJWkU7IGkrKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5wcm90U3RhQ2FjaGVbaV0uYWN0aXZlKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodm9zX21lbV9jb21wYXJlKCBwc2Vzc2lvbkVudHJ5LT5wcm90U3RhQ2FjaGVbaV0uYWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5zdGFBZGRyLCBzaXplb2YodFNpck1hY0FkZHIpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltTm9uR2ZQYXJhbXMubnVtU3RhLS07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cHJvdFN0YUNhY2hlW2ldLmFjdGl2ZSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAocHNlc3Npb25FbnRyeS0+Z0xpbU5vbkdmUGFyYW1zLm51bVN0YSA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIGRpc2FibGUgcHJvdGVjdGlvbgorICAgICAgICAgICAgICAgIGxpbUVuYWJsZUhU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gICAgICAgICAgICAgICAgZm9yIChpPTA7IGk8TElNX1BST1RfU1RBX0NBQ0hFX1NJWkU7IGkrKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5wcm90U3RhQ2FjaGVbaV0uYWN0aXZlKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodm9zX21lbV9jb21wYXJlKCBwc2Vzc2lvbkVudHJ5LT5wcm90U3RhQ2FjaGVbaV0uYWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5zdGFBZGRyLCBzaXplb2YodFNpck1hY0FkZHIpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltTHNpZ1R4b3BQYXJhbXMubnVtU3RhLS07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cHJvdFN0YUNhY2hlW2ldLmFjdGl2ZSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAocHNlc3Npb25FbnRyeS0+Z0xpbUxzaWdUeG9wUGFyYW1zLm51bVN0YSA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIGRpc2FibGUgcHJvdGVjdGlvbgorICAgICAgICAgICAgICAgIGxpbUVuYWJsZUhUTHNpZ1R4b3BQcm90ZWN0aW9uKHBNYWMsIHRydWUsIGZhbHNlLCBwQmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgfQorICAgICAgICB9ICAgIAorICAgIH0KK30KKworCisKKy8qKiAtLS0tLS0tLS0tL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9HMSk7KQorICAgICAgaWYgKHBzZXNzaW9uRW50cnktPmdMaW1Ob1Nob3J0UGFyYW1zLm51bU5vblNob3J0UHJlYW1ibGVTdGEgPiAwKQorICAgICAgeworICAgICAgICAgIGZvciAoaT0wOyBpPExJTV9QUk9UX1NUQV9DQUNIRV9TSVpFOyBpKyspCisgICAgICAgICAgeworICAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5nTGltTm9TaG9ydFBhcmFtcy5zdGFOb1Nob3J0Q2FjaGVbaV0uYWN0aXZlKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAodm9zX21lbV9jb21wYXJlKCBwc2Vzc2lvbkVudHJ5LT5nTGltTm9TaG9ydFBhcmFtcy5zdGFOb1Nob3J0Q2FjaGVbaV0uYWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5zdGFBZGRyLCBzaXplb2YodFNpck1hY0FkZHIpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW1Ob1Nob3J0UGFyYW1zLm51bU5vblNob3J0UHJlYW1ibGVTdGEtLTsKKyAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbU5vU2hvcnRQYXJhbXMuc3RhTm9TaG9ydENhY2hlW2ldLmFjdGl2ZSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgIH0KKworICAgICAgaWYgKHBzZXNzaW9uRW50cnktPmdMaW1Ob1Nob3J0UGFyYW1zLm51bU5vblNob3J0UHJlYW1ibGVTdGEgPT0gMCkKKyAgICAgIHsKKyAgICAgICAgIC8vIGVuYWJsZSBzaG9ydCBwcmVhbWJsZQorICAgICAgICAgLy9yZXNldCB0aGUgY2FjaGUKKyAgICAgICAgIHZvc19tZW1fc2V0K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gICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW1Ob1Nob3J0U2xvdFBhcmFtcy5zdGFOb1Nob3J0U2xvdENhY2hlW2ldLmFjdGl2ZSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgIH0KKyAgICAgICBlbHNlCisgICAgICAgeworICAgICAgICAgICBpZiAocE1hYy0+bGltLmdMaW1Ob1Nob3J0U2xvdFBhcmFtcy5udW1Ob25TaG9ydFNsb3RTdGE+IDApCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICBmb3IgKGk9MDsgaTxMSU1fUFJPVF9TVEFfQ0FDSEVfU0laRTsgaSsrKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGlmIChwTWFjLT5saW0uZ0xpbU5vU2hvcnRTbG90UGFyYW1zLnN0YU5vU2hvcnRTbG90Q2FjaGVbaV0uYWN0aXZlKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKHZvc19tZW1fY29tcGFyZShwTWFjLT5saW0uZ0xpbU5vU2hvcnRTbG90UGFyYW1zLnN0YU5vU2hvcnRTbG90Q2FjaGVbaV0uYWRkciwKKyAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPnN0YUFkZHIsIHNpemVvZih0U2lyTWFjQWRkcikpKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltTm9TaG9ydFNsb3RQYXJhbXMubnVtTm9uU2hvcnRTbG90U3RhLS07CisgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1Ob1Nob3J0U2xvdFBhcmFtcy5zdGFOb1Nob3J0U2xvdENhY2hlW2ldLmFjdGl2ZSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgIH0KKyAgICAgICAgICAgfQorICAgICAgICAgfQorCisgICAgICB3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHXzExR19TSE9SVF9TTE9UX1RJTUVfRU5BQkxFRCwgJnZhbCk7CisKKyAgICAgIGlmICggKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFICkgJiYKKyAgICAgICAgICh2YWwgJiYgcHNlc3Npb25FbnRyeS0+Z0xpbU5vU2hvcnRTbG90UGFyYW1zLm51bU5vblNob3J0U2xvdFN0YSA9PSAwKSkKKyAgICAgIHsKKyAgICAgICAgIC8vIGVuYWJsZSBzaG9ydCBzbG90IHRpbWUKKyAgICAgICAgIC8vcmVzZXQgdGhlIGNhY2hlCisgICAgICAgICB2b3NfbWVtX3NldCgodEFOSV9VOCAqKSZwc2Vzc2lvbkVudHJ5LT5nTGltTm9TaG9ydFNsb3RQYXJhbXMsCisgICAgICAgICAgICAgICAgICAgICBzaXplb2YodExpbU5vU2hvcnRTbG90UGFyYW1zKSwgMCk7CisgICAgICAgICAvLyBpbiBjYXNlIG9mIEFQIHNldCBTSE9SVF9TTE9UX1RJTUUgdG8gZW5hYmxlCisgICAgICAgICBpZiAocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0FQX1JPTEUpCisgICAgICAgICB7CisgICAgICAgICAgICBwQmVhY29uUGFyYW1zLT5mU2hvcnRTbG90VGltZSA9IHRydWU7CisgICAgICAgICAgICBwQmVhY29uUGFyYW1zLT5wYXJhbUNoYW5nZUJpdG1hcCB8PSBQQVJBTV9TSE9SVF9TTE9UX1RJTUVfQ0hBTkdFRDsKKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnNob3J0U2xvdFRpbWVTdXBwb3J0ZWQgPSB0cnVlOworICAgICAgICAgfQorICAgICAgfQorICAgICAgZWxzZSAKKyAgICAgIHsKKyAgICAgICA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gICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVZIVENhcHMgKnBQZWVyVkhUQ2FwcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KQoreworICAgIHRBTklfVTMyIHZhbDsKKyAgICB0QU5JX1UzMiBzZWxmU3RhRG90MTFNb2RlPTA7CisgICAgd2xhbl9jZmdHZXRJbnQocE1hYyxXTklfQ0ZHX0RPVDExX01PREUsJnNlbGZTdGFEb3QxMU1vZGUpOworCisvLyAgICBpZihJU19ET1QxMV9NT0RFX1ZIVChwc2Vzc2lvbkVudHJ5LT5kb3QxMW1vZGUpKQorICAgIGlmIChJU19ET1QxMV9NT0RFX1ZIVChzZWxmU3RhRG90MTFNb2RlKSkKKyAgICB7CisgICAgICAgIGlmICggd2xhbl9jZmdHZXRJbnQoIHBNYWMsV05JX0NGR19WSFRfUlhfTUNTX01BUCwmdmFsKSAhPSAKKyAgICAgICAgICAgIGVTSVJfU1VDQ0VTUyApCisgICAgICAgIHsKKyAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBWSFQgUlggTUNTIE1BUCIpKTspCisgICAgICAgICAgICBnb3RvIGVycm9yOworICAgICAgICB9CisgICAgICAgIHBSYXRlcy0+dmh0UnhNQ1NNYXAgPSAodEFOSV9VMTYpdmFsOworICAgIAorICAgICAgICBpZiAoIHdsYW5fY2ZnR2V0SW50KCBwTWFjLFdOSV9DRkdfVkhUX1RYX01DU19NQVAsJnZhbCApICE9IAorICAgICAgICAgICAgZVNJUl9TVUNDRVNTICkKKyAgICAgICAgeworICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IHJldHJpZXZlIFZIVCBUWCBNQ1MgTUFQIikpOykKKyAgICAgICAgICAgIGdvdG8gZXJyb3I7CisgICAgICAgIH0KK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0dXJuIGVTSVJfU1VDQ0VTUyBvciBlU0lSX0ZBSUxVUkUKKyAqCisgKi8KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQwordFNpclJldFN0YXR1cworbGltUG9wdWxhdGVPd25SYXRlU2V0KHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgdHBTaXJTdXBwb3J0ZWRSYXRlcyBwUmF0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCogcFN1cHBvcnRlZE1DU1NldCwKKyAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGJhc2ljT25seSwKKyAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5LAorICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVZIVENhcHMgKnBWSFRDYXBzKQorI2Vsc2UKK3RTaXJSZXRTdGF0dXMKK2xpbVBvcHVsYXRlT3duUmF0ZVNldCh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgIHRwU2lyU3VwcG9ydGVkUmF0ZXMgcFJhdGVzLAorICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTgqIHBTdXBwb3J0ZWRNQ1NTZXQsCisgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBiYXNpY09ubHksCisgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSkKKyNlbmRpZgorCit7CisgICAgdFNpck1hY1JhdGVTZXQgICAgICAgICAgdGVtcFJhdGVTZXQ7CisgICAgdFNpck1hY1JhdGVTZXQgICAgICAgICAgdGVtcFJhdGVTZXQyOworICAgIHRBTklfVTMyICAgICAgICAgICAgICAgIGksaix2YWwsbWluLGlzQXJhdGU7CisgICAgdEFOSV9VMzIgcGh5TW9kZSA9IDA7CisgICAgdEFOSV9VMzIgc2VsZlN0YURvdDExTW9kZT0wOworCisgICAgaXNBcmF0ZSA9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dGVTZXQyLm51bVJhdGVzOworCisgICAgLyoqCisgICAgICogU29ydCByYXRlcyBpbiB0ZW1wUmF0ZVNldCAodGhleSBhcmUgbGlrZWx5IHRvIGJlIGFscmVhZHkgc29ydGVkKQorICAgICAqIHB1dCB0aGUgcmVzdWx0IGluIHBTdXBwb3J0ZWRSYXRlcworICAgICAqLworICAgIHsKKyAgICAgICAgdEFOSV9VOCBhUmF0ZUluZGV4ID0gMDsKKyAgICAgICAgdEFOSV9VOCBiUmF0ZUluZGV4ID0gMDsKKworICAgICAgICB2b3NfbWVtX3NldCgodEFOSV9VOCAqKSBwUmF0ZXMsIHNpemVvZih0U2lyU3VwcG9ydGVkUmF0ZXMpLCAwKTsKKyAgICAgICAgZm9yKGkgPSAwO2kgPCB0ZW1wUmF0ZVNldC5udW1SYXRlczsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICBtaW4gPSAwOworICAgICAgICAgICAgdmFsID0gMHhmZjsKKyAgICAgICAgICAgIGlzQXJhdGUgPSAwOworICAgICAgICAgICAgZm9yKGogPSAwOyAoaiA8IHRlbXBSYXRlU2V0Lm51bVJhdGVzKSAmJiAoaiA8IFNJUl9NQUNfUkFURVNFVF9FSURfTUFYKTsgaisrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICgodEFOSV9VMzIpICh0ZW1wUmF0ZVNldC5yYXRlW2pdICYgMHg3ZikgPCB2YWwpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgdmFsID0gdGVtcFJhdGVTZXQucmF0ZVtqXSAmIDB4N2Y7CisgICAgICAgICAgICAgICAgICAgICBtaW4gPSBqOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHNpcklzQXJhdGUodGVtcFJhdGVTZXQucmF0ZVttaW5dICYgMHg3ZikpCisgICAgICAgICAgICAgICAgaXNBcmF0ZSA9IDE7CisKKyAgICAvKgorICAgICogSEFMIG5lZWRzIHRvIGtub3cgd2hldGhlciB0aGUgcmF0ZSBpcyBiYXNpYyByYXRlIG9yIG5vdCwgYXMgaXQgbmVlZHMgdG8gCisgICAgKiB1cGRhdGUgdGhlIHJlc3BvbnNlIHJhdGUgdGFibGUgYWNjb3JkaW5nbHkuIGUuZy4gaWYgb25lIG9mIHRoZSAxMWEgcmF0ZXMgaXMKKyAgICAqIGJhc2ljIHJhdGUsIHRoZW4gdGhhdCByYXRlIGNhbiBiZSB1c2VkIGZvciBzZW5kaW5nIGNvbnRyb2wgZnJhbWVzLgorICAgICogSEFMIHVwZGF0ZXMgdGhlIHJlc3BvbnNlIHJhdGUgdGFibGUgd2hlbmV2ZXIgYmFzaWMgcmF0ZSBzZXQgaXMgY2hhbmdlZC4KKyAgICAqLworICAgICAgICAgICAgaWYgKGJhc2ljT25seSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAodGVtcFJhdGVTZXQucmF0ZVttaW5dICYgMHg4MCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChpc0FyYXRlKQorICAgICAgICAgICAgICAgICAgICAgICAgcFJhdGVzLT5sbGFSYXRlc1thUmF0ZUluZGV4KytdID0gdGVtcFJhdGVTZXQucmF0ZVttaW5dOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICBwUmF0ZXMtPmxsYlJhdGVzW2JSYXRlSW5kZXgrK10gPSB0ZW1wUmF0ZVNldC5yYXRlW21pbl07CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChpc0FyYXRlKQorICAgICAgICAgICAgICAgICAgICBwUmF0ZXMtPmxsYVJhdGVzW2FSYXRlSW5kZXgrK10gPSB0ZW1wUmF0ZVNldC5yYXRlW21pbl07CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICBwUmF0ZXMtPmxsYlJhdGVzW2JSYXRlSW5kZXgrK10gPSB0ZW1wUmF0ZVNldC5yYXRlW21pbl07CisgICAgICAgICAgICB9CisgICAgICAgICAgICB0ZW1wUmF0ZVNldC5yYXRlW21pbl0gPSAweGZmOworICAgICAgICB9CisKKyAgICB9CisKKworICAgIC8vaWYoSVNfRE9UMTFfTU9ERV9IVChwc2Vzc2lvbkVudHJ5LT5kb3QxMW1vZGUpKQorICAgIGlmIChJU19ET1QxMV9NT0RFX0hUKHNlbGZTdGFEb3QxMU1vZGUpKQorICAgIHsKKyAgICAgICAgdmFsID0gU0laRV9PRl9TVVBQT1JURURfTUNTX1NFVDsKKyAgICAgICAgaWYgKHdsYW5fY2ZnR2V0U3RyKHBNYWMsIFdOSV9DRkdfU1VQUE9SVEVEX01DU19TRVQsCisgICAgICAgICAgICAgICAgICAgICAgcFJhdGVzLT5zdXBwb3J0ZWRNQ1NTZXQsCisgICAgICAgICAgICAgICAgICAgICAgJnZhbCkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICAvLy8gQ291bGQgbm90IGdldCByYXRlc2V0IGZyb20gQ0ZHLiBMb2cgZXJyb3IuCisgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgc3VwcG9ydGVkTUNTU2V0IikpOykKKyAgICAgICAgICAgIGdvdG8gZXJyb3I7CisgICAgICAgIH0KKworCisgICAgICAgIC8vaWYgc3VwcG9ydGVkIE1DUyBTZXQgb2YgdGhlIHBlZXIgaXMgcGFzc2VkIGluLCB0aGVuIGRvIHRoZSBpbnRlcnNlY3Rpb24KKyAgICAgICAgLy9lbHNlIHVzZSB0aGUgTUNTIHNldCBmcm9tIGxvY2FsIENGRy4KKworICAgICAgICBpZihwU3VwcG9ydGVkTUNTU2V0ICE9IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIGZvcihpPTA7IGk8U0lSX01BQ19NQVhfU1VQUE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WxzZQordFNpclJldFN0YXR1cworbGltUG9wdWxhdGVQZWVyUmF0ZVNldCh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgIHRwU2lyU3VwcG9ydGVkUmF0ZXMgcFJhdGVzLAorICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTgqIHBTdXBwb3J0ZWRNQ1NTZXQsCisgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBiYXNpY09ubHksCisgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSkKKyNlbmRpZgoreworICAgIHRTaXJNYWNSYXRlU2V0ICAgICAgICAgIHRlbXBSYXRlU2V0OworICAgIHRTaXJNYWNSYXRlU2V0ICAgICAgICAgIHRlbXBSYXRlU2V0MjsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICAgICAgIGksaix2YWwsbWluLGlzQXJhdGU7CisgICAgaXNBcmF0ZSA9IDA7CisKKyAgICAvKiBjb3B5IG9wZXJhdGlvbmFsIHJhdGUgc2V0IGZyb20gcHNlc3Npb25FbnRyeSAqLworICAgIGlmICggcHNlc3Npb25FbnRyeS0+cmF0ZVNldC5udW1SYXRlcyA8PSBTSVJfTUFDX1JBVEVTRVRfRUlEX01BWCApCisgICAgeworICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKil0ZW1wUmF0ZVNldC5yYXRlLAorICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTgqKShwc2Vzc2lvbkVudHJ5LT5yYXRlU2V0LnJhdGUpLAorICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cmF0ZVNldC5udW1SYXRlcyk7CisgICAgICAgIHRlbXBSYXRlU2V0Lm51bVJhdGVzID0gcHNlc3Npb25FbnRyeS0+cmF0ZVNldC5udW1SYXRlczsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJtb3JlIHRoYW4gU0lSX01BQ19SQVRFU0VUX0VJRF9NQVggcmF0ZXNcbiIpKTsKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICB9CisgICAgaWYgKChwc2Vzc2lvbkVudHJ5LT5kb3QxMW1vZGUgPT0gV05JX0NGR19ET1QxMV9NT0RFXzExRykgfHwKKyAgICAgICAgKHBzZXNzaW9uRW50cnktPmRvdDExbW9kZSA9PSBXTklfQ0ZHX0RPVDExX01PREVfMTFBKSB8fAorICAgICAgICAocHNlc3Npb25FbnRyeS0+ZG90MTFtb2RlID09IFdOSV9DRkdfRE9UMTFfTU9ERV8xMU4pKQorICAgIHsKKworICAgICAgICBpZiAocHNlc3Npb25FbnRyeS0+ZXh0UmF0ZVNldC5udW1SYXRlcyA8PSBTSVJfTUFDX1JBVEVTRVRfRUlEX01BWCkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4ICopdGVtcFJhdGVTZXQyLnJhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTgqKShwc2Vzc2lvbkVudHJ5LT5leHRSYXRlU2V0LnJhdGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmV4dFJhdGVTZXQubnVtUmF0ZXMpOworICAgICAgICAgICAgdGVtcFJhdGVTZXQyLm51bVJhdGVzID0gcHNlc3Npb25FbnRyeS0+ZXh0UmF0ZVNldC5udW1SYXRlczsKKyAgICAgICAgfQorICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJwc2Vzc2lvbkVudHJ5LT5leHRSYXRlU2V0Lm51bVJhdGVzIG1vcmUgdGhhbiBTSVJfTUFDX1JBVEVTRVRfRUlEX01BWCByYXRlc1xuIikpOworICAgICAgICAgICBnb3RvIGVycm9yOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICAgICAgdGVtcFJhdGVTZXQyLm51bVJhdGVzID0gMDsKKyA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AweGZmOworICAgICAgICAgICAgaXNBcmF0ZSA9IDA7CisgICAgICAgICAgICBmb3IoaiA9IDA7IChqIDwgdGVtcFJhdGVTZXQubnVtUmF0ZXMpICYmIChqIDwgU0lSX01BQ19SQVRFU0VUX0VJRF9NQVgpOyBqKyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKCh0QU5JX1UzMikgKHRlbXBSYXRlU2V0LnJhdGVbal0gJiAweDdmKSA8IHZhbCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICB2YWwgPSB0ZW1wUmF0ZVNldC5yYXRlW2pdICYgMHg3ZjsKKyAgICAgICAgICAgICAgICAgICAgIG1pbiA9IGo7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHNpcklzQXJhdGUodGVtcFJhdGVTZXQucmF0ZVttaW5dICYgMHg3ZikpCisgICAgICAgICAgICAgICAgaXNBcmF0ZSA9IDE7CisgICAgLyoKKyAgICAqIEhBTCBuZWVkcyB0byBrbm93IHdoZXRoZXIgdGhlIHJhdGUgaXMgYmFzaWMgcmF0ZSBvciBub3QsIGFzIGl0IG5lZWRzIHRvCisgICAgKiB1cGRhdGUgdGhlIHJlc3BvbnNlIHJhdGUgdGFibGUgYWNjb3JkaW5nbHkuIGUuZy4gaWYgb25lIG9mIHRoZSAxMWEgcmF0ZXMgaXMKKyAgICAqIGJhc2ljIHJhdGUsIHRoZW4gdGhhdCByYXRlIGNhbiBiZSB1c2VkIGZvciBzZW5kaW5nIGNvbnRyb2wgZnJhbWVzLgorICAgICogSEFMIHVwZGF0ZXMgdGhlIHJlc3BvbnNlIHJhdGUgdGFibGUgd2hlbmV2ZXIgYmFzaWMgcmF0ZSBzZXQgaXMgY2hhbmdlZC4KKyAgICAqLworICAgICAgICAgICAgaWYgKGJhc2ljT25seSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAodGVtcFJhdGVTZXQucmF0ZVttaW5dICYgMHg4MCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChpc0FyYXRlKQorICAgICAgICAgICAgICAgICAgICAgICAgcFJhdGVzLT5sbGFSYXRlc1thUmF0ZUluZGV4KytdID0gdGVtcFJhdGVTZXQucmF0ZVttaW5dOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICBwUmF0ZXMtPmxsYlJhdGVzW2JSYXRlSW5kZXgrK10gPSB0ZW1wUmF0ZVNldC5yYXRlW21pbl07CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChpc0FyYXRlKQorICAgICAgICAgICAgICAgICAgICBwUmF0ZXMtPmxsYVJhdGVzW2FSYXRlSW5kZXgrK10gPSB0ZW1wUmF0ZVNldC5yYXRlW21pbl07CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICBwUmF0ZXMtPmxsYlJhdGVzW2JSYXRlSW5kZXgrK10gPSB0ZW1wUmF0ZVNldC5yYXRlW21pbl07CisgICAgICAgICAgICB9CisgICAgICAgICAgICB0ZW1wUmF0ZVNldC5yYXRlW21pbl0gPSAweGZmOworICAgICAgICB9CisgICAgfQorCisKKyAgICBpZiAoSVNfRE9UMTFfTU9ERV9IVChwc2Vzc2lvbkVudHJ5LT5kb3QxMW1vZGUpKQorICAgIHsKKyAgICAgICAgdmFsID0gU0laRV9PRl9TVVBQT1JURURfTUNTX1NFVDsKKyAgICAgICAgaWYgKHdsYW5fY2ZnR2V0U3RyKHBNYWMsIFdOSV9DRkdfU1VQUE9SVEVEX01DU19TRVQsCisgICAgICAgICAgICAgICAgICAgICAgcFJhdGVzLT5zdXBwb3J0ZWRNQ1NTZXQsCisgICAgICAgICAgICAgICAgICAgICAgJnZhbCkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAg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XRlcyBpbiB0aGUKKyAqIGFzc29jaWF0aW9uIHJlcXVlc3Qgc3RydWN0dXJlCisgKgorICogQHBhcmFtOiBwTWFjICAgICAgICAgLSBQb2ludGVyIHRvIEdsb2JhbCBNQUMgc3RydWN0dXJlCisgKiAgICAgICAgIHBTdGFEcyAgICAgICAtIFBvaW50ZXIgdG8gRFBIIG5vZGUKKyAqICAgICAgICAgcE9wZXJSYXRlU2V0IC0gUG9pbnRlciB0byBwZWVyJ3Mgc3VwcG9ydGVkIHJhdGVzZXQKKyAqICAgICAgICAgcEV4dFJhdGVTZXQgIC0gUG9pbnRlciB0byBwZWVyJ3MgZXh0ZW5kZWQgcmF0ZXNldAorICoKKyAqIEByZXR1cm46ICBlU0lSX1NVQ0NFU1Mgb3IgZVNJUl9GQUlMVVJFCisgKi8KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQwordFNpclJldFN0YXR1cworbGltUG9wdWxhdGVNYXRjaGluZ1JhdGVTZXQodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwRHBoSGFzaE5vZGUgcFN0YURzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY1JhdGVTZXQgKnBPcGVyUmF0ZVNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNSYXRlU2V0ICpwRXh0UmF0ZVNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTgqIHBTdXBwb3J0ZWRNQ1NTZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjUHJvcFJhdGVTZXQgKnBBbmlMZWdSYXRlU2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gIHBzZXNzaW9uRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVWSFRDYXBzICpwVkhUQ2FwcykKKworI2Vsc2UKK3RTaXJSZXRTdGF0dXMKK2xpbVBvcHVsYXRlTWF0Y2hpbmdSYXRlU2V0KHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0cERwaEhhc2hOb2RlIHBTdGFEcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNSYXRlU2V0ICpwT3BlclJhdGVTZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjUmF0ZVNldCAqcEV4dFJhdGVTZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4KiBwU3VwcG9ydGVkTUNTU2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY1Byb3BSYXRlU2V0ICpwQW5pTGVnUmF0ZVNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uICBwc2Vzc2lvbkVudHJ5KQorI2VuZGlmCit7CisgICB0U2lyTWFjUmF0ZVNldCAgICAgICAgICB0ZW1wUmF0ZVNldDsKKyAgIHRTaXJNYWNSYXRlU2V0ICAgICAgICAgIHRlbXBSYXRlU2V0MjsKKyAgIHRBTklfVTMyICAgICAgICAgICAgICAgIGksaix2YWwsbWluLGlzQXJhdGU7CisgICB0QU5JX1UzMiBwaHlNb2RlOworICAgdEFOSV9VOCBtY3NTZXRbU0laRV9PRl9TVVBQT1JURURfTUNTX1NFVF07CisKKyAgIGlzQXJhdGU9MDsKKworICAgLy8gbGltR2V0UGh5TW9kZShwTWFjLCAmcGh5TW9kZSk7CisgICBsaW1HZXRQaHlNb2RlKHBNYWMsICZwaHlNb2RlLCBwc2Vzc2lvbkVudHJ5KTsKKworICAgLy8gZ2V0IG93biByYXRlIHNldAorICAgLy8gdmFsID0gV05JX0NGR19PUEVSQVRJT05BTF9SQVRFX1NFVF9MRU47CisgICAjaWYgMAorICAgIGlmICh3bGFuX2NmZ0dldFN0cihwTWFjLCBXTklfQ0ZHX09QRVJBVElPTkFMX1JBVEVfU0VULAorICAgICAgIC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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wUmF0ZVNldDIucmF0ZVtpXTsKKworICAgIHRlbXBSYXRlU2V0Lm51bVJhdGVzICs9IHRlbXBSYXRlU2V0Mi5udW1SYXRlczsKKworICAgIC8qKgorICAgICAqIFNvcnQgcmF0ZXMgaW4gdGVtcFJhdGVTZXQgKHRoZXkgYXJlIGxpa2VseSB0byBiZSBhbHJlYWR5IHNvcnRlZCkKKyAgICAgKiBwdXQgdGhlIHJlc3VsdCBpbiB0ZW1wUmF0ZVNldDIKKyAgICAgKi8KKyAgICB0ZW1wUmF0ZVNldDIubnVtUmF0ZXMgPSAwOworCisgICAgZm9yKGkgPSAwO2kgPCB0ZW1wUmF0ZVNldC5udW1SYXRlczsgaSsrKQorICAgIHsKKyAgICAgICAgbWluID0gMDsKKyAgICAgICAgdmFsID0gMHhmZjsKKworICAgICAgICBmb3IoaiA9IDA7aiA8IHRlbXBSYXRlU2V0Lm51bVJhdGVzOyBqKyspCisgICAgICAgICAgICBpZiAoKHRBTklfVTMyKSAodGVtcFJhdGVTZXQucmF0ZVtqXSAmIDB4N2YpIDwgdmFsKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZhbCA9IHRlbXBSYXRlU2V0LnJhdGVbal0gJiAweDdmOworICAgICAgICAgICAgICAgIG1pbiA9IGo7CisgICAgICAgICAgICB9CisKKyAgICAgICAgdGVtcFJhdGVTZXQyLnJhdGVbdGVtcFJhdGVTZXQyLm51bVJhdGVzKytdID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wUmF0ZVNldC5yYXRlW21pbl07CisgICAgICAgIHRlbXBSYXRlU2V0LnJhdGVbbWluXSA9IDB4ZmY7CisgICAgfQorCisKKyAgICAvKioKKyAgICAgKiBDb3B5IHJlY2VpdmVkIHJhdGVzIGluIHRlbXBSYXRlU2V0LCB0aGUgcGFyc2VyIGhhcyBlbnN1cmVkCisgICAgICogdW5pY2l0eSBvZiB0aGUgcmF0ZXMgc28gdGhlcmUgY2Fubm90IGJlIG1vcmUgdGhhbiAxMgorICAgICAqLworICAgIGZvcihpID0gMDsgKGkgPCBwT3BlclJhdGVTZXQtPm51bVJhdGVzICYmIGkgPCBTSVJfTUFDX1JBVEVTRVRfRUlEX01BWCkgOyBpKyspCisgICAgeworICAgICAgICB0ZW1wUmF0ZVNldC5yYXRlW2ldID0gcE9wZXJSYXRlU2V0LT5yYXRlW2ldOworICAgIH0KKworICAgIHRlbXBSYXRlU2V0Lm51bVJhdGVzID0gcE9wZXJSYXRlU2V0LT5udW1SYXRlczsKKworICAgIGlmIChwRXh0UmF0ZVNldC0+bnVtUmF0ZXMpCisgICAgeworICAgICAgaWYoKHRlbXBSYXRlU2V0Lm51bVJhdGVzICsgcEV4dFJhdGVTZXQtPm51bVJhdGVzKSA+IDEyICkKKyAgICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0cxLAorICAgICAgICAgICAgIlN1bSBvZiBTVVBQT1JURUQgYW5kIEVYVEVOREVEIFJhdGUgU2V0ICglMWQpIGV4Y2VlZHMgMTIhIiwKKyAgICAgICAgICAgIHRlbXBSYXRlU2V0Lm51bVJhdGVzICsgcEV4dFJhdGVTZXQtPm51bVJhdGVzICk7CisKKyAgICAgICAgaWYoIHRlbXBSYXRlU2V0Lm51bVJhdGVzIDwgMTIgKQorICAgICAgICB7CisgICAgICAgICBpbnQgZm91bmQgPSAwOworICAgICAgICAgaW50IHRhaWwgPSB0ZW1wUmF0ZVNldC5udW1SYXRlczsKKworICAgICAgICAgIGZvciggaSA9IDA7IChpIDwgcEV4dFJhdGVTZXQtPm51bVJhdGVzICYmIGkgPCBTSVJfTUFDX1JBVEVTRVRfRUlEX01BWCk7IGkrKyApCisgICAgICAgICAgeworICAgICAgICAgICAgZm91bmQgPSAwOworICAgICAgICAgICAgZm9yKCBqID0gMDsgaiA8ICh0QU5JX1UzMikgdGFpbDsgaisrICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYoKHRlbXBSYXRlU2V0LnJhdGVbal0gJiAweDdGKSA9PQorICAgICAgICAgICAgICAgICAgKHBFeHRSYXRlU2V0LT5yYXRlW2ldICYgMHg3RikpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBmb3VuZCA9IDE7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYoICFmb3VuZCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHRlbXBSYXRlU2V0LnJhdGVbdGVtcFJhdGVTZXQubnVtUmF0ZXMrK10gPQorICAgICAgICAgICAgICAgIHBFeHRSYXRlU2V0LT5yYXRlW2ldOworCisgICAgICAgICAgICAgIGlmKCB0ZW1wUmF0ZVNldC5udW1SYXRlcyA+PSAxMiApCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICJSZWx5aW5nIG9ubHkgb24gdGhlIFNVUFBPUlRFRCBSYXRlIFNldCBJRS4uLiIgKTsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgZm9yKGogPSAwOyAoKGogPCBwRXh0UmF0ZVNldC0+bnVtUmF0ZXMpICYmIChqIDwgU0lSX01BQ19SQVRFU0VUX0VJRF9NQVgpICYmICgoaStqKSA8IFNJUl9NQUNfUkFURVNFVF9FSURfTUFYKSk7IGorKykKKyAgICAgICAgICAgIHRlbXBSYXRlU2V0LnJhdGVbaStqXSA9IHBFeHRSYXRlU2V0LT5yYXRlW2pdOworCisgICAgICAgIHRlbXBSYXRlU2V0Lm51bVJhdGVzICs9IHBFeHRSYXRlU2V0LT5udW1SYXRlczsKKyAgICAgIH0KKyAgICB9CisKKyAgICB7CisgICAgICAgIHRwU2lyU3VwcG9ydGVkUmF0ZXMgIHJhdGVzID0gJnBTdGFEcy0+c3VwcG9ydGVkUmF0ZXM7CisgICAgICAgIHRBTklfVTggYVJhdGVJbmRleCA9IDA7CisgICAgICAgIHRBTklfVTggYlJhdGVJbmRleCA9IDA7CisgICAgICAgIHZvc19tZW1fc2V0KCh0QU5JX1U4ICopIHJhdGVzLCBzaXplb2YodFNpclN1cHBvcnRlZFJhdGVzKSwgMCk7CisgICAgICAgIGZvcihpID0gMDsoaSA8IHRlbXBSYXRlU2V0Mi5udW1SYXRlcyAmJiBpIDwgU0lSX01BQ19SQVRFU0VUX0VJRF9NQVggKTsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICBmb3IoaiA9IDA7KGogPCB0ZW1wUmF0ZVNldC5udW1SYXRlcyAmJiBqIDwgU0lSX01BQ19SQVRFU0VUX0VJRF9NQVgpOyBqKyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKCh0ZW1wUmF0ZVNldDIucmF0ZVtpXSAmIDB4N0YpID09CisgICAgICAgICAgICAgICAgICAgICh0ZW1wUmF0ZVNldC5yYXRlW2pdICYgMHg3RikpCisgICAgICAgICAgICAgICAgeyAKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNpcklzQXJhdGUodGVtcFJhdGVTZXQyLnJhdGVbaV0gJiAweDdmKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaXNBcmF0ZT0xOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFSYXRlSW5kZXggPCBTSVJfTlVNXzExQV9SQVRFUykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByYXRlcy0+bGxhUmF0ZXNbYVJhdGVJbmRleCsrXSA9IHRlbXBSYXRlU2V0Mi5yYXRlW2ldOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGJSYXRlSW5kZXggPCBTSVJfTlVNXzExQl9SQVRFUykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByYXRlcy0+bGxiUmF0ZXNbYlJhdGVJbmRleCsrXSA9IHRlbXBSYXRlU2V0Mi5yYXRlW2ldOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisKKyAgICAgICAgLy9Ob3cgYWRkIHRoZSBQb2xhcmlzIHJhdGVzIG9ubHkgd2hlbiBQcm9wcmlldGFyeSByYXRlcyBhcmUgZW5hYmxlZC4KKyAgICAgICAgdmFsID0gMDsKKyAgICAgICAgaWYod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19QUk9QUklFVEFSWV9SQVRFU19FTkFCTEVELCAmdmFsKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiY291bGQgbm90IHJldHJpZXZlIHByb3AgcmF0ZSBlbmFibGVkIGZsYWcgZnJvbSBDRkciKSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZih2YWwpCisgICAgICAgIHsKKyAgICAgICAgICAgIGZvcihpPTA7IGk8cEFuaUxlZ1JhdGVTZXQtPm51bVByb3BSYXRlczsgaSsrKQorICAgICAgICAgICAgICAgIHJhdGVzLT5hbmlMZWdhY3lSYXRlc1tpXSA9IHBBbmlMZWdSYXRlU2V0LT5wcm9wUmF0ZVtpXTsKKyAgICAgICAgfQorCisgICAgfQorCisKKyAgICAvL2NvbXB1dGUgdGhlIG1hdGNoaW5nIE1DUyByYXRlIHNldCwgaWYgcGVlciBpcyAxMW4gY2FwYWJsZSBhbmQgc2VsZiBtb2RlIGlzIDExbgorI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgICAgaWYocFN0YURzLT5tbG1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byAxIHRoZW4gd2Ugd2lsbCB0ZWxsIFBlZXIgdGhhdCB3ZSBzdXBwb3J0IDQwTWh6IHNob3J0IEdJCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmIChIQUxfU1RBVFVTX1NVQ0NFU1MoY2NtQ2ZnR2V0SW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwTWFjLCBXTklfQ0ZHX1NIT1JUX0dJXzIwTUhaLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmc2hvcnRHaTIwTWh6U3VwcG9ydCkpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChWT1NfVFJVRSA9PSBzaG9ydEdpMjBNaHpTdXBwb3J0KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEFkZFN0YVBhcmFtcy0+ZlNob3J0R0kyME1oeiA9CisgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfU0hPUlRfR0lfMjBNSFpfU1RBTUFYOworICAgICAgICAgICAgICAgICAgICAvL3BBZGRTdGFQYXJhbXMtPmZTaG9ydEdJMjBNaHogPQorICAgICAgICAgICAgICAgICAgICAvL2xpbUdldEhUQ2FwYWJpbGl0eShwTWFjLCBlSFRfU0hPUlRfR0lfMjBNSFosCisgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwQWRkU3RhUGFyYW1zLT5mU2hvcnRHSTIwTWh6ID0gVk9TX0ZBTFNFOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgc2hvcnRHSSAyME1oeiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJDRkcsc2V0dGluZyB2YWx1ZSB0byBkZWZhdWx0IikpOykKKyAgICAgICAgICAgICAgICBwQWRkU3RhUGFyYW1zLT5mU2hvcnRHSTIwTWh6ID0gV05JX0NGR19TSE9SVF9HSV8yME1IWl9TVEFERUY7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiBXZSB3aWxsIHJlYWQgdGhlIGdTaG9ydEdJNDBNaHogZnJvbSBpbmkgZmlsZSwgYW5kIGlmIGl0IGlzIHNldAorICAgICAgICAgICAgICogdG8gMSB0aGVuIHdlIHdpbGwgdGVsbCBQZWVyIHRoYXQgd2Ugc3VwcG9ydCA0ME1oeiBzaG9ydCBHSQorICAgICAgICAgICAgICovCisgICAgICAgICAgICBpZiAoSEFMX1NUQVRVU19TVUNDRVNTKGNjbUNmZ0dldEludAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocE1hYywgV05JX0NGR19TSE9SVF9HSV80ME1IWiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnNob3J0R2k0ME1oelN1cHBvcnQpKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoVk9TX1RSVUUgPT0gc2hvcnRHaTQwTWh6U3VwcG9ydCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBBZGRTdGFQYXJhbXMtPmZTaG9ydEdJNDBNaHogPQorICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX1NIT1JUX0dJXzQwTUhaX1NUQU1BWDsKKyAgICAgICAgICAgICAgICAgICAgLy9wQWRkU3RhUGFyYW1zLT5mU2hvcnRHSTQwTWh6ID0KKyAgICAgICAgICAgICAgICAgICAgLy9saW1HZXRIVENhcGFiaWxpdHkocE1hYywgZUhUX1NIT1JUX0dJXzQwTUhaLAorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBBZGRTdGFQYXJhbXMtPmZTaG9ydEdJNDBNaHogPSBWT1NfRkFMU0U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBzaG9ydEdJIDQwTWh6IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkNGRyxzZXR0aW5nIHZhbHVlIHRvIGRlZmF1bHQiKSk7KQorICAgICAgICAgICAgICAgIHBBZGRTdGFQYXJhbXMtPmZTaG9ydEdJNDBNaHogPSBXTklfQ0ZHX1NIT1JUX0dJXzQwTUhaX1NUQURFRjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiIGdyZWVuRmllbGRDYXBhYmxlOiAlZCBtYXhBbXBkdURlbnNpdHkgPSAlZCAiCisgICAgICAgICAgICAibWF4QW1wZHVTaXplID0gJWQiKSwgcEFkZFN0YVBhcmFtcy0+Z3JlZW5GaWVsZENhcGFibGUsCisgICAgICAgICAgICBwQWRkU3RhUGFyYW1zLT5tYXhBbXBkdURlbnNpdHksIHBBZGRTdGFQYXJhbXMtPm1heEFtcGR1U2l6ZSk7CisKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiZkRzc3NDY2tNb2RlNDBNaHo6ICVkIGZTaG9ydEdJMjBNaHo6ICVkICIKKyAgICAgICAgICAgICJmU2hvcnRHSTQwTWh6OiAlZCBsc2lnVHhvcFByb3RlY3Rpb246ICVkI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IGNvbnRleHQgaW4gU0lSX0xJTV9DTkZfV0FJVF9USU1FT1VULiIpKTspCisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBzd2l0Y2ggKHBTdGFEcy0+bWxtU3RhQ29udGV4dC5tbG1TdGF0ZSkgeworICAgICAgICBjYXNlIGVMSU1fTUxNX1dUX0FTU09DX0NORl9TVEFURToKKyAgICAgICAgICAgIFBFTE9HVyhsaW1Mb2cocE1hYywgTE9HVywgRkwoIkRpZCBub3QgcmVjZWl2ZSBBc3NvYyBDbmYgaW4gZUxJTV9NTE1fV1RfQVNTT0NfQ05GX1NUQVRFIHN0YSBBc3NvYyBpZCAlZCIpLCBwU3RhRHMtPmFzc29jSWQpOykKKyAgICAgICAgICAgIGxpbVByaW50TWFjQWRkcihwTWFjLCBwU3RhRHMtPnN0YUFkZHIsIExPR1cpOworCisgICAgICAgICAgICBpZiAoIChzeXN0ZW1Sb2xlID09IGVMSU1fQVBfUk9MRSl8fCAoc3lzdGVtUm9sZSA9PSBlTElNX0JUX0FNUF9BUF9ST0xFKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltUmVqZWN0QXNzb2NpYXRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPnN0YUFkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5tbG1TdGFDb250ZXh0LnN1YlR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPm1sbVN0YUNvbnRleHQuYXV0aFR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5hc3NvY0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRydWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRTaXJSZXN1bHRDb2RlcykgZVNJUl9NQUNfVU5TUEVDX0ZBSUxVUkVfU1RBVFVTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiUmVjZWl2ZWQgQ05GX1dBSVRfVElNRU9VVCBpbiBzdGF0ZSAlZCIpLAorICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+bWxtU3RhQ29udGV4dC5tbG1TdGF0ZSk7CisgICAgfQorfQorCisKKy8qKgorICogbGltRGVsZXRlRHBoSGFzaEVudHJ5KCkKKyAqCisgKkZVTkNUSU9OOgorICogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgd2hlbmV2ZXIgd2UgbmVlZCB0byBkZWxldGUKKyAqIHRoZSBkcGggaGFzaCBlbnRyeQorICoKKyAqTE9HSUM6CisgKgorICpBU1NVTVBUSU9OUzoKKyAqCisgKk5PVEU6CisgKgorICogQHBhcmFtICBwTWFjICAgICAgUG9pbnRlciB0byBHbG9iYWwgTUFDIHN0cnVjdHVyZQorICogQHBhcmFtICB0QU5JX1UxNiAgICAgICBzdGFJZAorICogQHJldHVybiBOb25lCisgKi8KKwordm9pZAorbGltRGVsZXRlRHBoSGFzaEVudHJ5KHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRTaXJNYWNBZGRyIHN0YUFkZHIsIHRBTklfVTE2IHN0YUlkLHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpCit7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgIGFpZDsKKyAgICB0cERwaEhhc2hOb2RlICAgIHBTdGFEczsKKyAgICB0VXBkYXRlQmVhY29uUGFyYW1zIGJlYWNvblBhcmFtczsgICAgCisgICAgdExpbVN5c3RlbVJvbGUgc3lzdGVtUm9sZTsKKworICAgIHZvc19tZW1femVybygmYmVhY29uUGFyYW1zLCBzaXplb2Y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ChlTElNX1NUQV9JTl9JQlNTX1JPTEUgPT0gcHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFICl7CisgICAgICAgICAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+Z0xpbVByb3RlY3Rpb25Db250cm9sICE9IFdOSV9DRkdfRk9SQ0VfUE9MSUNZX1BST1RFQ1RJT05fRElTQUJMRSl7CisgICAgICAgICAgICAgICAgbGltRGVjaWRlQXBQcm90ZWN0aW9uT25EZWxldGUocE1hYywgcFN0YURzLCAmYmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYoZUxJTV9TVEFfSU5fSUJTU19ST0xFID09IHN5c3RlbVJvbGUpCisgICAgICAgICAgICAgICAgbGltSWJzc0RlY2lkZVByb3RlY3Rpb25PbkRlbGV0ZShwTWFjLCBwU3RhRHMsICZiZWFjb25QYXJhbXMsIHBzZXNzaW9uRW50cnkpOworCisgICAgICAgICAgICBsaW1EZWNpZGVTaG9ydFByZWFtYmxlKHBNYWMsIHBTdGFEcywgJmJlYWNvblBhcmFtcywgcHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICBsaW1EZWNpZGVTaG9ydFNsb3QocE1hYywgcFN0YURzLCAmYmVhY29uUGFyYW1zLCBwc2Vzc2lvbkVudHJ5KTsKKworICAgICAgICAgICAgLy9TZW5kIG1lc3NhZ2UgdG8gSEFMIGFib3V0IGJlYWNvbiBwYXJhbWV0ZXIgY2hhbmdlLgorICAgICAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgicGFyYW0gYml0bWFwID0gJWQgIiksIGJlYWNvblBhcmFtcy5wYXJhbUNoYW5nZUJpdG1hcCk7KQorICAgICAgICAgICAgaW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1wdGluZyB0byBqb2luLCBqb2luIHN1Y2Nlc3MgaXMgc2VudCB0byBTTUUuCisgKgorICpBU1NVTVBUSU9OUzoKKyAqCisgKk5PVEU6CisgKgorICogQHBhcmFtICBwTWFjICAgICAgUG9pbnRlciB0byBHbG9iYWwgTUFDIHN0cnVjdHVyZQorICogQHBhcmFtICBwQlBSICAgICAgUG9pbnRlciB0byByZWNlaXZlZCBCZWFjb24vUHJvYmUgUmVzcG9uc2UKKyAqIEBwYXJhbSAgcEhkciAgICAgIFBvaW50ZXIgdG8gcmVjZWl2ZWQgQmVhY29uL1Byb2JlIFJlc3BvbnNlCisgKiAgICAgICAgICAgICAgICAgICBNQUMgaGVhZGVyCisgKiBAcmV0dXJuIE5vbmUKKyAqLworCit2b2lkCitsaW1DaGVja0FuZEFubm91bmNlSm9pblN1Y2Nlc3ModHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyUHJvYmVSZXNwQmVhY29uICpwQlBSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyTWFjTWdtdEhkciBwSGRyLHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpCit7CisgICAgdFNpck1hY1NTaWQgICAgICAgICAgY3VycmVudFNTSUQ7CisgICAgdExpbU1sbUpvaW5DbmYgICAgICAgbWxtSm9pbkNuZjsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICB2YWwgPSAwOworICAgIHRBTklfVTMyICAgICAgICAgICAgICpub2ExRHVyYXRpb25Gcm9tQmNuID0gTlVMTDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAqbm9hMkR1cmF0aW9uRnJvbUJjbiA9IE5VTEw7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgbm9hOworICAgIHRBTklfVTMyICAgICAgICAgICAgIFRvdGFsTnVtX05vQURlc2MgPSAwOworCisgICAgdm9zX21lbV9jb3B5KGN1cnJlbnRTU0lELnNzSWQsCisgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnNzSWQuc3NJZCwKKyAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+c3NJZC5sZW5ndGgpOworICAgCisgICAgY3VycmVudFNTSUQubGVuZ3RoID0gKHRBTklfVTgpcHNlc3Npb25FbnRyeS0+c3NJZC5sZW5ndGggOworCisgICAgaWYgKAorICAgICAgICAvKiBDaGVjayBmb3IgU1NJRCBvbmx5IGluIHByb2JlIHJlc3BvbnNlLiBCZWFjb25zIG1heSBub3QgY2FycnkKKyAgICAgICAgICAgU1NJRCBpbmZvcm1hdGlvbiBpbiBoaWRkZW4gU1NJRCBjYXNlICovCisgICAgICAgICggKFNJUl9NQUNfTUdNVF9GUkFNRSAgPT0gcEhkci0+ZmMudHlwZSkgJiYKKyAgICAgICAgICAoU0lSX01BQ19NR01UX1BST0JFX1JTUCA9PSBwSGRyLT5mYy5zdWJUeXBlKSApICYmCisgICAgICAgIGN1cnJlbnRTU0lELmxlbmd0aCAmJgorICAgICAgICAoIXZvc19tZW1fY29tcGFyZSgodEFOSV9VOCAqKSAmcEJQUi0+c3NJZCwKKyAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSAmY3VycmVudFNTSUQsCisgICAgICAgICAgICAgICAgICAgKHRBTklfVTgpICgxICsgY3VycmVudFNTSUQubGVuZ3RoKSkgKSkKKyAgICB7CisgICAgICAgIC8qKgorICAgICAgICAgKiBSZWNlaXZlZCBTU0lEIGRvZXMgbm90IG1hdGNoIHdpdGggdGhlIG9uZSB3ZSd2ZS4KKyAgICAgICAgICogSWdub3JlIHJlY2VpdmVkIEJlYWNvbiBmcmFtZQorICAgICAgICAgKi8KKyAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJTU0lEIHJlY2VpdmVkIGluIEJlYWNvbiBkb2VzIG5vdCBtYXRjaCIpKTsKKyNpZmRlZiBXTEFOX0RFQlVHICAgICAgICAgICAgCisgICAgICAgIHBNYWMtPmxpbS5n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ShwQlBSLT5QMlBQcm9iZVJlcy5Ob3RpY2VPZkFic2VuY2UuTm9BRGVzYyArIDEpOworCisgICAgICAgIGlmKHBCUFItPlAyUFByb2JlUmVzLk5vdGljZU9mQWJzZW5jZS5udW1fTm9BRGVzYykKKyAgICAgICAgICAgIFRvdGFsTnVtX05vQURlc2MgPSBwQlBSLT5QMlBQcm9iZVJlcy5Ob3RpY2VPZkFic2VuY2UubnVtX05vQURlc2MvU0laRV9PRl9OT0FfREVTQ1JJUFRPUjsKKworICAgICAgICBub2EgPSAqbm9hMUR1cmF0aW9uRnJvbUJjbjsKKworICAgICAgICBpZihUb3RhbE51bV9Ob0FEZXNjID4gMSkKKyAgICAgICAgeworICAgICAgICAgICAgbm9hMkR1cmF0aW9uRnJvbUJjbiA9ICh0QU5JX1UzMiopKHBCUFItPlAyUFByb2JlUmVzLk5vdGljZU9mQWJzZW5jZS5Ob0FEZXNjICsgU0laRV9PRl9OT0FfREVTQ1JJUFRPUiArIDEpOworICAgICAgICAgICAgbm9hICs9ICpub2EyRHVyYXRpb25Gcm9tQmNuOworICAgICAgICB9CisKKyAgICAgICAgLypJZiBNQVggTm9hIGV4Y2VlZHMgMyBzZWNzIHdlIHdpbGwgY29uc2lkZXIgb25seSAzIHNlY3MgdG8gCisgICAgICAgICogYXZvaWQgYXJiaXRhcnkgdmFsdWVzIGluIG5vYSBkdXJhdGlvbiBmaWVsZAorICAgICAgICAqLworICAgICAgICBub2EgPSBub2EgPiAgTUFYX05PQV9QRVJJT0RfSU5fTUlDUk9TRUNTID8gTUFYX05PQV9QRVJJT0RfSU5fTUlDUk9TRUNTIDogbm9hOworICAgICAgICBub2EgPSBub2EvMTAwMDsgLy9Db252ZXJ0IHRvIG1zCisKKyAgICAgICAgaWYoIHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfQVVUSEVOVElDQVRFX0ZBSUxVUkVfVElNRU9VVCwmdmFsKSA9PSBlU0lSX1NVQ0NFU1MgKQorICAgICAgICB7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aWdUWE9QUHJvdGVjdGlvbkZ1bGxTdXBwb3J0LAorICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+ZlJJRlNNb2RlKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHBBZGRCc3NQYXJhbXMtPmN1cnJlbnRPcGVyQ2hhbm5lbCA9IGJzc0Rlc2NyaXB0aW9uLT5jaGFubmVsSWQ7CisgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJjdXJyZW50T3BlckNoYW5uZWwgJWQiKSwKKyAgICBwQWRkQnNzUGFyYW1zLT5jdXJyZW50T3BlckNoYW5uZWwpOworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisgICAgaWYgKHBzZXNzaW9uRW50cnktPnZodENhcGFiaWxpdHkgJiYgKCBwQXNzb2NSc3AtPlZIVENhcHMucHJlc2VudCApKQorICAgIHsKKyAgICAgICAgcEFkZEJzc1BhcmFtcy0+dmh0Q2FwYWJsZSA9IHBBc3NvY1JzcC0+VkhUQ2Fwcy5wcmVzZW50OworICAgICAgICBwQWRkQnNzUGFyYW1zLT52aHRUeENoYW5uZWxXaWR0aFNldCA9IHBBc3NvY1JzcC0+VkhUT3BlcmF0aW9uLmNoYW5XaWR0aDsgCisgICAgICAgIHBBZGRCc3NQYXJhbXMtPmN1cnJlbnRFeHRDaGFubmVsID0gbGltR2V0MTFBQ1BoeUNCU3RhdGUgKCBwTWFjLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPmN1cnJlbnRPcGVyQ2hhbm5lbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPmN1cnJlbnRFeHRDaGFubmVsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc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29uSW50ZXJ2YWw7CisKKyAgICAgICAgLyogRmlsbCBBc3NvYyBpZCBmcm9tIHRoZSBkcGggdGFibGUgKi8KKyAgICAgICAgcFN0YURzID0gZHBoTG9va3VwSGFzaEVudHJ5KHBNYWMsIHBBZGRCc3NQYXJhbXMtPnN0YUNvbnRleHQuYnNzSWQsIAorICAgICAgICAgICAgICAgICZwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LmFzc29jSWQsICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsKKyAgICAgICAgaWYgKHBTdGFEcyA9PSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJDb3VsZG4ndCBnZXQgYXNzb2MgaWQgZm9yICIKKyAgICAgICAgICAgICAgICAgICAgICAgIk1BQyBBRERSOiAiIE1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBBZGRCc3NQYXJhbXMtPnN0YUNvbnRleHQuc3RhTWFjKSk7KQorICAgICAgICB9CisgICAgICAgIHBBZGRCc3NQYXJhbXMtPnN0YUNvbnRleHQudUFQU0QgPSAwOworICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0Lm1heFNQTGVuID0gMDsKKyAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC5zaG9ydFByZWFtYmxlU3VwcG9ydGVkID0KKyAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+YmVhY29uUGFyYW1zLmZTaG9ydFByZWFtYmxlOworICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LnVwZGF0ZVN0YSA9IHVwZGF0ZUVudHJ5OworCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiU3RhQ29udGV4dDogIk1BQ19BRERSRVNTX1NUUgorICAgICAgICAiIHNob3J0UHJlYW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tPnN0YUNvbnRleHQubHNpZ1R4b3BQcm90ZWN0aW9uKTsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgICAgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPnZodENhcGFiaWxpdHkgJiYKKyAgICAgICAgICAgICAgICBJU19CU1NfVkhUX0NBUEFCTEUocEJlYWNvblN0cnVjdC0+VkhUQ2FwcykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC52aHRDYXBhYmxlID0gMTsKKyAgICAgICAgICAgICAgICBpZiAoKHBBc3NvY1JzcC0+VkhUQ2Fwcy5zdUJlYW1Gb3JtZXJDYXAgfHwKKyAgICAgICAgICAgICAgICAgICAgIHBBc3NvY1JzcC0+VkhUQ2Fwcy5tdUJlYW1mb3JtZXJDYXApICYmCisgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT50eEJGSW5pRmVhdHVyZUVuYWJsZWQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LnZodFR4QkZDYXBhYmxlID0gMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHBBc3NvY1JzcC0+VkhUQ2Fwcy5tdUJlYW1mb3JtZXJDYXAgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnR4TXVCZm9ybWVlICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPnN0YUNvbnRleHQudmh0VHhNVUJmb3JtZWVDYXBhYmxlID0gMTsKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsRkwoIkVuYWJsaW5nIE1VQmZvcm1lZUNhcGFibGUgZm9yIHBlZXIiKSk7CisgICAgICAgICAgICAgICAgICAgIC8qIERvbnQgYWxsb3cgYW55IG90aGVyIE11QmYgc2Vzc2lvbiBhcyBjb25jdXJyZW5jeQorICAgICAgICAgICAgICAgICAgICAgKiBpcyBub3Qgc3VwcG9ydGVkCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBwTWFjLT5pc011QmZzZXNzaW9uZXhpc3QgPSBUUlVFOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyNlbmRpZgorICAgICAgICAgICAgaWYoIChwQXNzb2NSc3AtPkhUQ2Fwcy5zdXBwb3J0ZWRDaGFubmVsV2lkdGhTZXQpICYmCisgICAgICAgICAgICAgICAgKGNoYW5XaWR0aFN1cHApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LnR4Q2hhbm5lbFdpZHRoU2V0ID0gKCB0QU5JX1U4IClwQXNzb2NSc3AtPkhUSW5mby5yZWNvbW1lbmRlZFR4V2lkdGhTZXQ7CisjaWZkZWYgV0xBTl9GRUFUVVJFXzExQUMKKyAgICAgICAgICAgICAgICBpZiAocEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC52aHRDYXBhYmxlKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC52aHRUeENoYW5uZWxXaWR0aFNldCA9IHBBc3NvY1JzcC0+VkhUT3BlcmF0aW9uLmNoYW5XaWR0aDsgLy9wTWFjLT5saW0uYXBDaGFuV2lkdGg7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLEZMKCJTdGFDb250ZXh0IHZodENhcGFibGUgJWQgIgorICAgICAgICAgICAgICAgICJ2aHRUeENoYW5uZWxXaWR0aFNldDogJWQgdmh0VHhCRkNhcGFibGU6ICVkIiksCisgICAgICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV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Rzc3NDY2tNb2RlNDBNaHogPSAodEFOSV9VOClwQXNzb2NSc3AtPkhUQ2Fwcy5kc3NzQ2NrTW9kZTQwTUh6OworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIFdlIHdpbGwgY2hlY2sgZ1Nob3J0R0kyME1oeiBhbmQgZ1Nob3J0R0k0ME1oeiBmcm9tIGluaSBmaWxlLgorICAgICAgICAgICAgICogaWYgdGhleSBhcmUgc2V0IHRoZW4gd2Ugd2lsbCB1c2Ugd2hhdCBldmVyIEFzc29jIHJlc3BvbnNlIGNvbWluZworICAgICAgICAgICAgICogZnJvbSBBUCBzdXBwb3J0cy4gSWYgdGhlc2UgdmFsdWVzIGFyZSBzZXQgYXMgMCBpbiBpbmkgZmlsZSB0aGVuCisgICAgICAgICAgICAgKiB3ZSB3aWxsIGhhcmRjb2RlIHRoaXMgdmFsdWVzIHRvIDAuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmIChIQUxfU1RBVFVTX1NVQ0NFU1MoY2NtQ2ZnR2V0SW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwTWFjLCBXTklfQ0ZHX1NIT1JUX0dJXzIwTUhaLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmc2hvcnRHaTIwTWh6U3VwcG9ydCkpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChWT1NfVFJVRSA9PSBzaG9ydEdpMjBNaHpTdXBwb3J0KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC5mU2hvcnRHSTIwTWh6ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTgpcEFzc29jUnNwLT5IVENhcHMuc2hvcnRHSTIwTUh6OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LmZTaG9ydEdJMjBNaHogPSBWT1NfRkFMU0U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBzaG9ydEdJIDIwTWh6IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkNGRyxzZXR0aW5nIHZhbHVlIHRvIGRlZmF1bHQiKSk7KQorICAgICAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPnN0YUNvbnRleHQuZlNob3J0R0kyME1oeiA9CisgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfU0hPUlRfR0lfMjBNSFpfU1RBREVGOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoSEFMX1NUQVRVU19TVUNDRVNTKGNjbUNmZ0dldEludAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocE1hYywgV05JX0NGR19TSE9SVF9HSV80ME1IWiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnNob3J0R2k0ME1oelN1cHBvcnQpKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoVk9TX1RSVUUgPT0gc2hvcnRHaTQwTWh6U3VwcG9ydCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPnN0YUNvbnRleHQuZlNob3J0R0k0ME1oeiA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4KXBBc3NvY1JzcC0+SFRDYXBzLnNob3J0R0k0ME1IejsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC5mU2hvcnRHSTQwTWh6ID0gVk9TX0ZBTFNFOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgc2hvcnRHSSA0ME1oeiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJDRkcsc2V0dGluZyB2YWx1ZSB0byBkZWZhdWx0IikpOykKKyAgICAgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LmZTaG9ydEdJNDBNaHogPQorICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX1NIT1JUX0dJXzQwTUhaX1NUQURFRjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC5tYXhBbXBkdVNpemU9IHBBc3NvY1JzcC0+SFRDYXBzLm1heFJ4QU1QRFVGYWN0b3I7CisgICAgICAgICAgICBpZiggcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC52aHRUeEJGQ2FwYWJsZSAmJiBwTWFjLT5saW0uZGlzYWJsZUxEUENXaXRoVHhiZkFQICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0Lmh0TGRwY0NhcGFibGUgPSAwOworICAgICAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPnN0YUNvbnRleHQudmh0TGRwY0NhcGFibGUgPSAwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPnN0YUNvbnRleHQuaHRMZHBjQ2FwYWJsZSA9ICh0QU5JX1U4KXBBc3NvY1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yZTsKKyAgICB9CisgICAgCisgICAgdm9zX21lbV9zZXQoKHRBTklfVTggKikgcEFkZEJzc1BhcmFtcywgc2l6ZW9mKCB0QWRkQnNzUGFyYW1zICksIDApOworCisKKyAgICBsaW1FeHRyYWN0QXBDYXBhYmlsaXRpZXMoIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTggKikgYnNzRGVzY3JpcHRpb24tPmllRmllbGRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbUdldElFbGVuRnJvbUJzc0Rlc2NyaXB0aW9uKCBic3NEZXNjcmlwdGlvbiApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCZWFjb25TdHJ1Y3QgKTsKKworICAgIGlmKHBNYWMtPmxpbS5nTGltUHJvdGVjdGlvbkNvbnRyb2wgIT0gV05JX0NGR19GT1JDRV9QT0xJQ1lfUFJPVEVDVElPTl9ESVNBQkxFKQorICAgICAgICBsaW1EZWNpZGVTdGFQcm90ZWN0aW9uT25Bc3NvYyhwTWFjLCBwQmVhY29uU3RydWN0LCBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgdm9zX21lbV9jb3B5KHBBZGRCc3NQYXJhbXMtPmJzc0lkLCBic3NEZXNjcmlwdGlvbi0+YnNzSWQsCisgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKworICAgIC8vIEZpbGwgaW4gdEFkZEJzc1BhcmFtcyBzZWxmTWFjQWRkcgorICAgIHZvc19tZW1fY29weShwQWRkQnNzUGFyYW1zLT5zZWxmTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+c2VsZk1hY0FkZHIsCisgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgic2Vzc2lvbmlkOiAlZCB1cGRhdGVFbnRyeSA9ICVkIGxpbXN5c3RlbXJvbGUgPSAlZCA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dmh0Q2FwYWJpbGl0eSAmJgorICAgICAgICBJU19CU1NfVkhUX0NBUEFCTEUocEJlYWNvblN0cnVjdC0+VkhUQ2FwcykpCisgICAgeworICAgICAgICBwQWRkQnNzUGFyYW1zLT52aHRDYXBhYmxlID0gcEJlYWNvblN0cnVjdC0+VkhUQ2Fwcy5wcmVzZW50OworICAgICAgICBwQWRkQnNzUGFyYW1zLT52aHRUeENoYW5uZWxXaWR0aFNldCA9IHBCZWFjb25TdHJ1Y3QtPlZIVE9wZXJhdGlvbi5jaGFuV2lkdGg7IAorICAgICAgICBwQWRkQnNzUGFyYW1zLT5jdXJyZW50RXh0Q2hhbm5lbCA9IGxpbUdldDExQUNQaHlDQlN0YXRlICggcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPmN1cnJlbnRPcGVyQ2hhbm5lbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPmN1cnJlbnRFeHRDaGFubmVsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+YXBDZW50ZXJDaGFuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSk7CisgICAgfQorICAgIGVsc2UgCisgICAgeworICAgICAgICBwQWRkQnNzUGFyYW1zLT52aHRDYXBhYmxlID0gMDsKKyAgICB9CisgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJ2aHRDYXBhYmxlICVkIHZodFR4Q2hhbm5lbFdpZHRoU2V0ICVkICIKKyAgICAiY3VycmVudEV4dENoYW5uZWwgJWQiKSxwQWRkQnNzUGFyYW1zLT52aHRDY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wKKyAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPnN0YUNvbnRleHQuaHRDYXBhYmxlLAorICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC5ncmVlbkZpZWxkQ2FwYWJsZSwKKyAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPnN0YUNvbnRleHQubHNpZ1R4b3BQcm90ZWN0aW9uKTsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgICAgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPnZodENhcGFiaWxpdHkgJiYKKyAgICAgICAgICAgICAgICBJU19CU1NfVkhUX0NBUEFCTEUocEJlYWNvblN0cnVjdC0+VkhUQ2FwcykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC52aHRDYXBhYmxlID0gMTsKKyAgICAgICAgICAgICAgICBpZiAoKHBCZWFjb25TdHJ1Y3QtPlZIVENhcHMuc3VCZWFtRm9ybWVyQ2FwIHx8CisgICAgICAgICAgICAgICAgICAgICBwQmVhY29uU3RydWN0LT5WSFRDYXBzLm11QmVhbWZvcm1lckNhcCkgJiYKKyAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnR4QkZJbmlGZWF0dXJlRW5hYmxlZCApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LnZodFR4QkZDYXBhYmxlID0gMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHBCZWFjb25TdHJ1Y3QtPlZIVENhcHMubXVCZWFtZm9ybWVyQ2FwICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT50eE11QmZvcm1lZSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LnZodFR4TVVCZm9ybWVlQ2FwYWJsZSA9IDE7CisgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLEZMKCJFbmFibGluZyBNVUJmb3JtZWVDYXBhYmxlIGZvciBwZWVyIikpOworICAgICAgICAgICAgICAgICAgICAvKiBEb250IGFsbG93IGFueSBvdGhlciBNdUJmIHNlc3Npb24gYXMgY29uY3VycmVuY3kKKyAgICAgICAgICAgICAgICAgICAgICogaXMgbm90IHN1cHBvcnRlZAorICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgcE1hYy0+aXNNdUJmc2Vzc2lvbmV4aXN0ID0gVFJVRTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIH0KKyNlbmRpZgorICAgICAgICAgICAgaWYoIChwQmVhY29uU3RydWN0LT5IVENhcHMuc3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0KSAmJgorICAgICAgICAgICAgICAgIChjaGFuV2lkdGhTdXBwKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC50eENoYW5uZWxXaWR0aFNldCA9ICggdEFOSV9VOCApcEJlYWNvblN0cnVjdC0+SFRJbmZvLnJlY29tbWVuZGVkVHhXaWR0aFNldDsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgICAgICAgICAgICAgIGlmIChwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LnZodENhcGFibGUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LnZodFR4Q2hhbm5lbFdpZHRoU2V0ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQmVhY29uU3RydWN0LT5WSFRPcGVyYXRpb24uY2hhbldpZHRoOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSxGTCgiU3RhQ29udGV4dCB2aHRDYXBhYmxlICVkICIKKyAgICAgICAgICAgICAgICAidmh0VHhDaGFubmVsV2lkdGhTZXQ6ICVkIHZodFR4QkZDYXBhYmxlOiAlZCIpLAorICAgICAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPnN0YUNvbnRleHQudmh0Q2FwYWJsZSwKKyAgICAgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LnZodFR4Q2hhbm5lbFdpZHRoU2V0LAorICAgICAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPnN0YUNvbnRleHQudmh0VHhCRkNhcGFibGUpOworI2VuZGlmCisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC50eENoYW5uZWxXaWR0aFNldCA9IFdOSV9DRkdfQ0hBTk5FTF9CT05ESU5HX01PREVfRElTQUJMRTsKKyAgICAgICAgICAgIH0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC5taW1vUFMgICAgICAgICAgICAgPSAodFNpck1hY0hUTUlNT1Bvd2VyU2F2ZVN0YXRlKXBCZWFjb25TdHJ1Y3QtPkhUQ2Fwcy5taW1vUG93ZXJTYXZlOworICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC5kZWxCQVN1cHBvcnQgICAgICAgPSAoIHRBTklfVTggKSBwQmVhY29uU3RydWN0LT5IVENhcHMuZGVsYXllZEJBOworICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC5tYXhBbXNkdVNpemUgICAgICAgPSAoIHRBTklfVTggKSBwQmVhY29uU3RydWN0LT5IVENhcHMubWF4aW1hbEFNU0RVc2l6ZTsKKyAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPnN0YUNvbnRleHQubWF4QW1wZHVEZW5zaXR5ICAgID0gICAgICAgICAgICAgcEJlYWNvblN0cnVjdC0+SFRDYXBzLm1wZHVEZW5zaXR5OworICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC5mRHNzc0Nja01vZGU0ME1oeiA9ICh0QU5JX1U4KXBCZWFjb25TdHJ1Y3QtPkhUQ2Fwcy5kc3NzQ2NrTW9kZTQwTUh6OworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIFdlIHdpbGwgY2hlY2sgZ1Nob3J0R0kyME1oeiBhbmQgZ1Nob3J0R0k0ME1oeiBmcm9tIGluaSBmaWxlLgorICAgICAgICAgICAgICogaWYgdGhleSBhcmUgc2V0IHRoZW4gd2Ugd2lsbCB1c2Ugd2hhdCBldmVyIEJlYWNvbiBjb21pbmcgZnJvbSBBUAorICAgICAgICAgICAgICogc3VwcG9ydHMuIElmIHRoZXNlIHZhbHVlcyBhcmUgc2V0IGFzIDAgaW4gaW5pIGZpbGUgdGhlbgorICAgICAgICAgICAgICogd2Ugd2lsbCBoYXJkY29kZSB0aGlzIHZhbHVlcyB0byAwLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBpZiAoSEFMX1NUQVRVU19TVUNDRVNTKGNjbUNmZ0dldEludAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocE1hYywgV05JX0NGR19TSE9SVF9HSV8yME1IWiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnNob3J0R2kyME1oelN1cHBvcnQpKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoVk9TX1RSVUUgPT0gc2hvcnRHaTIwTWh6U3VwcG9ydCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPnN0YUNvbnRleHQuZlNob3J0R0kyME1oeiA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTgpcEJlYWNvblN0cnVjdC0+SFRDYXBzLnNob3J0R0kyME1IejsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC5mU2hvcnRHSTIwTWh6ID0gVk9TX0ZBTFNFOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgc2hvcnRHSSAyME1oeiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJDRkcsc2V0dGluZyB2YWx1ZSB0byBkZWZhdWx0IikpOykKKyAgICAgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LmZTaG9ydEdJMjBNaHogPQorICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX1NIT1JUX0dJXzIwTUhaX1NUQURFRjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKEhBTF9TVEFUVVNfU1VDQ0VTUyhjY21DZmdHZXRJbnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBNYWMsIFdOSV9DRkdfU0hPUlRfR0lfNDBNSFosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZzaG9ydEdpNDBNaHpTdXBwb3J0KSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKFZPU19UUlVFID09IHNob3J0R2k0ME1oelN1cHBvcnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LmZTaG9ydEdJNDBNaHogPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4KXBCZWFjb25TdHJ1Y3QtPkhUQ2Fwcy5zaG9ydEdJNDBNSHo7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPnN0YUNvbnRleHQuZlNob3J0R0k0ME1oeiA9IFZPU19GQUxTRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IHJldHJpZXZlIHNob3J0R0kgNDBNaHoiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQ0ZHLHNldHRpbmcgdmFsdWUgdG8gZGVmYXVsdCIpKTspCisgICAgICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC5mU2hvcnRHSTQwTWh6ID0KKyAgICAgICAgICAgICAgICAgICAgV05JX0NGR19TSE9SVF9HSV80ME1IWl9TVEFERUY7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPnN0YUNvbnRleHQubWF4QW1wZHVTaXplPSBwQmVhY29uU3RydWN0LT5IVENhcHMubWF4UnhBTVBEVUZhY3RvcjsKKyAgICAgICAgICAgIGlmKCBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LnZodFR4QkZDYXBhYmxlICYmIHBNYWMtPmxpbS5kaXNhYmxlTERQQ1dpdGhUeGJmQVAgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPnN0YUNvbnRleHQuaHRMZHBjQ2FwYWJsZSA9IDA7CisgICAgICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC52aHRMZHBjQ2FwYWJsZSA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC5odExkcGNDYXBhYmxlID0gKHRBTklfVTgpcEJlYWNvblN0cnVjdC0+SFRDYXBzLmFkdkNvZGluZ0NhcDsKKyAgICAgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LnZodExkcGNDYXBhYmxlID0gKHRBTklfVTgpcEJlYWNvblN0cnVjdC0+VkhUQ2Fwcy5sZHBjQ29kaW5nQ2FwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBpZiggcEJlYWNvblN0cnVjdC0+SFRJbmZvLnByZXNlbnQgKQorICAgICAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPnN0YUNvbnRleHQucmlmc01vZGUgPSBwQmVhY29uU3RydWN0LT5IVEluZm8ucmlmc01vZGU7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlN0YUNvbnRleHQgdHhDaGFubmVsV2lkdGhTZXQ6ICVkIG1pbW9QUzogJWQiCisgICAgICAgICAgICAiIGRlbEJBU3VwcG9ydDogJWQgbWF4QW1zZHVTaXplOiAlZCIpLAorICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC50eENoYW5uZWxXaWR0aFNldCwKKyAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPnN0YUNvbnRleHQubWltb1BTLAorICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC5kZWxCQVN1cHBvcnQsCisgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0Lm1heEFtc2R1U2l6ZSk7CisKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgibWF4QW1wZHVEZW5zaXR5OiA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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCitcZm4gbGltR2V0U3RhUmF0ZU1vZGUKK1xicmllZiBHZXRzIHRoZSBTdGF0aW9uIFJhdGUgTW9kZS4KK1xwYXJhbSAgICAgdEFOSV9VOCBkb3QxMU1vZGUKK1xyZXR1cm4gbm9uZQorICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KK3RTdGFSYXRlTW9kZSBsaW1HZXRTdGFSYXRlTW9kZSh0QU5JX1U4IGRvdDExTW9kZSkKK3sKKyAgICBzd2l0Y2goZG90MTFNb2RlKQorICAgICAgICB7CisgICAgICAgICAgICBjYXNlIFdOSV9DRkdfRE9UMTFfTU9ERV8xMUE6CisgICAgICAgICAgICAgICAgcmV0dXJuIGVTVEFfMTFhOworICAgICAgICAgICAgY2FzZSBXTklfQ0ZHX0RPVDExX01PREVfMTFCOgorICAgICAgICAgICAgICAgIHJldHVybiBlU1RBXzExYjsKKyAgICAgICAgICAgIGNhc2UgV05JX0NGR19ET1QxMV9NT0RFXzExRzoKKyAgICAgICAgICAgICAgICByZXR1cm4gZVNUQV8xMWJnOworICAgICAgICAgICAgY2FzZSBXTklfQ0ZHX0RPVDExX01PREVfMTFOOgorICAgICAgICAgICAgICAgIHJldHVybiBlU1RBXzExbjsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgICAgICAgICAgY2FzZSBXTklfQ0ZHX0RPVDExX01PREVfMTFBQzoKKyAgICAgICAgICAgICAgICByZXR1cm4gZVNUQV8xMWFjOworI2VuZGlmCisgICAgICAgICAgICBjYXNlIFdOSV9DRkdfRE9UMTFfTU9ERV9BTEw6CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHJldHVybiBlU1RBXzExbjsgICAgICAgICAgIAorICAgICAgICAgICAgCisgICAgICAgIH0KK30KKworLyoqIC0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m9yLgorICAgICAgICAqKi8KKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICBGTCgiY291bGQgbm90IHJldHJpZXZlIEFVVEhfUlNQIHRpbWVvdXQgdmFsdWUiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBjZmdWYWx1ZSA9IFNZU19NU19UT19USUNLUyhjZmdWYWx1ZSk7CisgICAgZm9yKGF1dGhOb2RlSWR4PTA7IGF1dGhOb2RlSWR4PHBQcmVBdXRoVGltZXJUYWJsZS0+bnVtRW50cnk7IGF1dGhOb2RlSWR4KyssIHBBdXRoTm9kZSsrKQorICAgIHsKKyAgICAgICAgaWYgKHR4X3RpbWVyX2NyZWF0ZSgmcEF1dGhOb2RlLT50aW1lciwKKyAgICAgICAgICAgICAgICAgICAgICAgICJBVVRIIFJFU1BPTlNFIFRJTUVPVVQiLAorICAgICAgICAgICAgICAgICAgICAgICAgbGltQXV0aFJlc3BvbnNlVGltZXJIYW5kbGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgYXV0aE5vZGVJZHgsCisgICAgICAgICAgICAgICAgICAgICAgICBjZmdWYWx1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIDAsCisgICAgICAgICAgICAgICAgICAgICAgICBUWF9OT19BQ1RJVkFURSkgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgLy8gQ2Fubm90IGNyZWF0ZSB0aW1lci4gIExvZyBlcnJvci4KKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiQ2Fubm90IGNyZWF0ZSBBdXRoIFJzcCB0aW1lciBvZiBJbmRleCA6JWQuIiksIGF1dGhOb2RlSWR4KTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBwQXV0aE5vZGUtPmF1dGhOb2RlSWR4ID0gKHRBTklfVTgpYXV0aE5vZGVJZHg7CisgICAgICAgIHBBdXRoTm9kZS0+ZkZyZ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jbHVkZSAibGltVHlwZXMuaCIKKworCit0QU5JX1U4ICAgICAgICAgbGltQ21wU1NpZCh0cEFuaVNpckdsb2JhbCwgdFNpck1hY1NTaWQgKix0cFBFU2Vzc2lvbik7Cit0QU5JX1U4ICAgICAgICAgbGltQ29tcGFyZUNhcGFiaWxpdGllcyh0cEFuaVNpckdsb2JhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJBc3NvY1JlcSAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY0NhcGFiaWxpdHlJbmZvICosdHBQRVNlc3Npb24pOwordEFOSV9VOCAgICAgICAgIGxpbUNoZWNrUnhCYXNpY1JhdGVzKHRwQW5pU2lyR2xvYmFsLCB0U2lyTWFjUmF0ZVNldCx0cFBFU2Vzc2lvbik7Cit0QU5JX1U4ICAgICAgICAgbGltQ2hlY2tSeFJTTkllTWF0Y2godHBBbmlTaXJHbG9iYWwsIHREb3QxMWZJRVJTTiwgdHBQRVNlc3Npb24sIHRBTklfVTgsIHRBTklfQk9PTEVBTiAqKTsKK3RBTklfVTggICAgICAgICBsaW1DaGVja1J4V1BBSWVNYXRjaCh0cEFuaVNpckdsb2JhbCwgdERvdDExZklFV1BBLCB0cFBFU2Vzc2lvbiwgdEFOSV9VOCk7Cit0QU5JX1U4ICAgICAgICAgbGltQ2hlY2tNQ1NTZXQodHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VOCogc3VwcG9ydGVkTUNTU2V0KTsKK3ZvaWQgICAgICAgICAgICBsaW1Qb3N0RHVtbXlUb1RtUmluZyh0cEFuaVNpckdsb2JhbCwgdHBEcGhIYXNoTm9kZSk7Cit2b2lkICAgICAgICAgICAgbGltUG9zdFBhY2tldFRvVGRSaW5nKHRwQW5pU2lyR2xvYmFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cERwaEhhc2hOb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4KTsKK3RTaXJSZXRTdGF0dXMgICBsaW1DbGVhbnVwUnhQYXRoKHRwQW5pU2lyR2xvYmFsLCB0cERwaEhhc2hOb2RlLHRwUEVTZXNzaW9uKTsKK3ZvaWQgICAgICAgICAgICBsaW1SZWplY3RBc3NvY2lhdGlvbih0cEFuaVNpckdsb2JhbCAsIHRTaXJNYWNBZGRyLCB0QU5JX1U4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggLCB0QW5pQXV0aFR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMTYsIHRBTklfVTgsIHRTaXJSZXN1bHRDb2RlcywgdHBQRVNlc3Npb24pOworCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExQUMKK3RTaXJSZXRTdGF0dXMgbGltUG9wdWxhdGVQZWVyUmF0ZVNldCh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFNpclN1cHBvcnRlZFJhdGVzIHBSYXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCogcFN1cHBvcnRlZE1DU1NldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBiYXNpY09ubHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVZIVENhcHMgKnBWSFRDYXBzKTsKKyNlbHNlCit0U2lyUmV0U3RhdHVzIGxpbVBvcHVsYXRlUGVlclJhdGVTZXQodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFNpclN1cHBvcnRlZFJhdGVzIHBSYXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4KiBwU3VwcG9ydGVkTUNTU2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggYmFzaWNPbmx5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpOworI2VuZGlmCisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQwordFNpclJldFN0YXR1cyBsaW1Qb3B1bGF0ZU93blJhdGVTZXQodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJTdXBwb3J0ZWRSYXRlcyBwUmF0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTgqIHBTdXBwb3J0ZWRNQ1NTZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggYmFzaWNPbmx5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVWSFRDYXBzICpwVkhUQ2Fwcyk7CisKKyNlbHNlCit0U2lyUmV0U3RhdHVzIGxpbVBvcHVsYXRlT3duUmF0ZVNldCh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyU3VwcG9ydGVkUmF0ZXMgcFJhdGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTgqIHBTdXBwb3J0ZWRNQ1NTZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBiYXNpY09ubHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSk7CisjZW5kaWYKKworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCit0U2lyUmV0U3RhdHVzCitsaW1Qb3B1bGF0ZU1hdGNoaW5nUmF0ZVNldCh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBEcGhIYXNoTm9kZSBwU3RhRHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjUmF0ZVNldCAqcE9wZXJSYXRlU2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY1JhdGVTZXQgKnBFeHRSYXRlU2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCogcFN1cHBvcnRlZE1DU1NldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNQcm9wUmF0ZVNldCAqcEFuaUxlZ1JhdGVTZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiAgcHNlc3Npb25FbnRyeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVZIVENhcHMgKnBWSFRDYXBzKTsKKyNlbHNlCit0U2lyUmV0U3RhdHVzICAgbGltUG9wdWxhdGVNYXRjaGluZ1JhdGVTZXQodHBBbmlTaXJHbG9iYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBEcGhIYXNoTm9kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjUmF0ZVNldCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNSYXRlU2V0ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCogcFN1cHBvcnRlZE1DU1NldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjUHJvcFJhdGVTZXQgKiwgdHBQRVNlc3Npb24pOworCisKKyNlbmRpZgordFNpclJldFN0YXR1cyAgIGxpbUFkZFN0YSh0cEFuaVNpckdsb2JhbCwgdHBEcGhIYXNoTm9kZSwgdEFOSV9VOCwgdHBQRVNlc3Npb24pOwordFNpclJldFN0YXR1cyAgIGxpbURlbEJzcyh0cEFuaVNpckdsb2JhbCwgdHBEcGhIYXNoTm9kZSwgdEFOSV9VMTYsIHRwUEVTZXNzaW9uKTsKK3RTaXJSZXRTdGF0dXMgICBsaW1EZWxTdGEodHBBbmlTaXJHbG9iYWwsIHRwRHBoSGFzaE5vZGUsIHRBTklfQk9PTEVBTiwgdHBQRVNlc3Npb24pOworI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCit0U2lyUmV0U3RhdHVzICAgbGltQWRkRlRTdGFTZWxmKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTE2IGFzc29jSWQsCisgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpOworI2VuZGlmIC8qIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSICovCit0U2lyUmV0U3RhdHVzICAgbGltQWRkU3RhU2VsZih0cEFuaVNpckdsb2JhbCwgdEFOSV9VMTYsIHRBTklfVTgsIHRwUEVTZXNzaW9uKTsKK3RTdGFSYXRlTW9kZSBsaW1HZXRTdGFSYXRlTW9kZSh0QU5JX1U4IGRvdDExTW9kZSk7CisKKwordm9pZCAgICAgICAgICAgIGxpbVRlYXJkb3duSW5mcmFCc3ModHBBbmlTaXJHbG9iYWwsdHBQRVNlc3Npb24pOwordm9pZCAgICAgICAgICAgIGxpbVJlc3RvcmVQcmVSZWFzc29jU3RhdGUodHBBbmlTaXJHbG9iYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyUmVzdWx0Q29kZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UxNix0cFBFU2Vzc2lvbik7IAordm9pZCAgICAgICAgICAgIGxpbVBvc3RSZWFzc29jRmFpbHVyZSh0cEFuaVNpckdsb2JhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpclJlc3VsdENvZGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UxNix0cFBFU2Vzc2lvbik7CitlQW5pQm9vbGVhbiAgICAgbGltSXNSZWFzc29jSW5Qcm9ncmVzcyh0cEFuaVNpckdsb2JhbCx0cFBFU2Vzc2lvbik7Cit2b2lkCitsaW1TZW5kRGVsU3RhQ25mKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRTaXJNYWNBZGRyIHN0YURzQWRkciwKKyAgICAgICB0QU5JX1UxNiBzdGFEc0Fzc29jSWQsIHRMaW1NbG1TdGFDb250ZXh0IG1sbVN0YUNvbnRleHQsIHRTaXJSZXN1bHRDb2RlcyBzdGF0dXNDb2RlLHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpOworCit2b2lkICAgICAgICAgICAgbGltSGFuZGxlQ25mV2FpdFRpbWVvdXQodHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMTYgc3RhSWQpOwordm9pZCAgICAgICAgICAgIGxpbURlbGV0ZURwaEhhc2hFbnRyeSh0cEFuaVNpckdsb2JhbCwgdFNpck1hY0FkZHIsIHRBTklfVTE2LHRwUEVTZXNzaW9uKTsKK3ZvaWQgICAgICAgICAgICBsaW1DaGVja0FuZEFubm91bmNlSm9pblN1Y2Nlc3ModHBBbmlTaXJHbG9iYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJQcm9iZVJlc3BCZWFjb24gKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJNYWNNZ210SGRyLHRwUEVTZXNzaW9uKTsKK3ZvaWQgbGltVXBkYXRlUmVBc3NvY0dsb2JhbHModHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyQXNzb2NSc3AgcEFzc29jUnNwLHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpOworCit2b2lkIGxpbVVwZGF0ZUFzc29jU3RhRGF0YXModHBBbmlTaXJHbG9iYWwgcE1hYywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwRHBoSGFzaE5vZGUgcFN0YURzLHRwU2lyQXNzb2NSc3AgcEFzc29jUnNwLHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpOwordm9pZAorbGltRmlsbFN1cHBvcnRlZFJhdGVzSW5mbygKKyAgICB0cEFuaVNpckdsb2JhbCAgICAgICAgICBwTWFjLAorICAgIHRwRHBoSGFzaE5vZGUgICAgICAgICAgIHBTdGEsCisgICAgdHBTaXJTdXBwb3J0ZWRSYXRlcyAgIHBSYXRlcywKKyAgICB0cFBFU2Vzc2lvbiAgICAgICAgICAgcHNlc3Npb25FbnRyeSk7CisKK3RTaXJSZXRTdGF0dXMgbGltU3RhU2VuZEFkZEJzcyh0cEFuaVNpckdsb2JhbCBwTWFjLCB0cFNpckFzc29jUnNwIHBBc3NvY1JzcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2NoQmVhY29uU3RydWN0IHBCZWFjb25Td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RVUVOVElBTAorICogREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NIExPU1MgT0YgVVNFLCBEQVRBIE9SCisgKiBQUk9GSVRTLCBXSEVUSEVSIElOIEFOIEFDVElPTiBPRiBDT05UUkFDVCwgTkVHTElHRU5DRSBPUiBPVEhFUgorICogVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIAorICBcYnJpZWYgaW1wbGVtZW50YXRpb24gZm9yIFBFIDExciBWb1dpRmkgRlQgUHJvdG9jb2wKKyAgCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qICRIZWFkZXIkICovCisKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBJbmNsdWRlIEZpbGVzCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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E9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogRlRJRXMgZm9yIEF1dGggUmVxIFNlcSAxIGlzIGFic2VudCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7KQorICAgICAgICAgICAgZ290byBwcmVhdXRoX2ZhaWw7CisgICAgICAgIH0KKyAgICB9CisgICAgaWYgKHN0YXR1cyAhPSBlSEFMX1NUQVRVU19TVUNDRVNTKSAKKyAgICB7CisgICAgICAgIFBFTE9HRShsaW1Mb2coIHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICIlczogQ2hhbmdlIGNoYW5uZWwgbm90IHN1Y2Nlc3NmdWwgZm9yIEZUIHByZS1hdXRoIiwKKyAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOykKKyAgICAgICAgZ290byBwcmVhdXRoX2ZhaWw7CisgICAgfQorICAgIHBNYWMtPmZ0LmZ0UEVDb250ZXh0LnBzYXZlZHNlc3Npb25FbnRyeSA9IHBzZXNzaW9uRW50cnk7CisKKyNpZiBkZWZpbmVkIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSX0RFQlVHCisgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJFbnRlcmVkIHdhaXQgYXV0aDIgc3RhdGUgZm9yIEZUIgorICAgICAgICAgICAiIChvbGQgc2Vzc2lvbiAlcCkiKSwKKyAgICAgICAgICAgcE1hYy0+ZnQuZnRQRUNvbnRleHQucHNhdmVkc2Vzc2lvbkVudHJ5KTsKKyNlbmRpZgorCisKKyAgICBpZiAocHNlc3Npb25FbnRyeS0+aXMxMVJjb25uZWN0aW9uKQorICAgIHsKKyAgICAgICAgLy8gTm93IHdlIGFyZSBvbiB0aGUgcmlnaHQgY2hhbm5lbCBhbmQgbmVlZCB0byBzZW5kIG91dCBBdXRoMSBhbmQgCisgICAgICAgIC8vIHJlY2VpdmUgQXV0aDIuCisgICAgICAgIGF1dGhGcmFtZS5hdXRoQWxnb051bW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BhcmFtcy0+dmh0VHhDaGFubmVsV2lkdGhTZXQgPSBwQmVhY29uU3RydWN0LT5WSFRPcGVyYXRpb24uY2hhbldpZHRoOworICAgICAgICBwQWRkQnNzUGFyYW1zLT5jdXJyZW50RXh0Q2hhbm5lbCA9IGxpbUdldDExQUNQaHlDQlN0YXRlICggcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPmN1cnJlbnRPcGVyQ2hhbm5lbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPmN1cnJlbnRFeHRDaGFubmVsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGZ0U2Vzc2lvbkVudHJ5LT5hcENlbnRlckNoYW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZnRTZXNzaW9uRW50cnkpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBwQWRkQnNzUGFyYW1zLT52aHRDYXBhYmxlID0gMDsKKyAgICB9CisjZW5kaWYKKworI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVJfREVCVUcKKyAgICBsaW1Mb2coIHBNYWMsIExPRzEsIEZMKCAiU0lSX0hBTF9BRERfQlNTX1JFUSB3aXRoIGNoYW5uZWwgPSAlZC4uLiIgKSwKKyAgICAgICAgcEFkZEJzc1BhcmFtcy0+Y3VycmVudE9wZXJDaGFubmVsKTsKKyNlbmRpZgorCisKKyAgICAvLyBQb3B1bGF0ZSB0aGUgU1RBLXJlbGF0ZWQgcGFyYW1ldGVycyBoZXJlCisgICAgLy8gTm90ZSB0aGF0IHRoZSBTVEEgaGVyZSByZWZl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EJlYWNvblN0cnVjdC0+SFRDYXBzLnByZXNlbnQgKSkKKyAgICAgICAgeworICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC51czMyTWF4QW1wZHVEdXJhdGlvbiA9IDA7CisgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0Lmh0Q2FwYWJsZSA9IDE7CisgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LmdyZWVuRmllbGRDYXBhYmxlICA9ICggdEFOSV9VOCApIHBCZWFjb25TdHJ1Y3QtPkhUQ2Fwcy5ncmVlbkZpZWxkOworICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC5sc2lnVHhvcFByb3RlY3Rpb24gPSAoIHRBTklfVTggKSBwQmVhY29uU3RydWN0LT5IVENhcHMubHNpZ1RYT1BQcm90ZWN0aW9uOworICAgICAgICAgICAgaWYoIChwQmVhY29uU3RydWN0LT5IVENhcHMuc3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0KSAmJgorICAgICAgICAgICAgICAgIChjaGFuV2lkdGhTdXBwKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC50eENoYW5uZWxXaWR0aFNldCA9ICggdEFOSV9VOCApcEJlYWNvblN0cnVjdC0+SFRJbmZvLnJlY29tbWVuZGVkVHhXaWR0aFNldDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LnR4Q2hhbm5lbFdpZHRoU2V0ID0gV05JX0NGR19DSEFOTkVMX0JPTkRJTkdfTU9ERV9ESVNBQkxFOworICAgICAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExQUMKKyAgICAgICAgICAgIGlmIChwZnRTZXNzaW9uRW50cnktPnZodENhcGFiaWxpdHkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIElTX0JTU19WSFRfQ0FQQUJMRShwQmVhY29uU3RydWN0LT5WSFRDYXBzKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LnZodENhcGFibGUgPSAxOworICAgICAgICAgICAgICAgIGlmICgocEJlYWNvblN0cnVjdC0+VkhUQ2Fwcy5zdUJlYW1Gb3JtZXJDYXAgfHwKKyAgICAgICAgICAgICAgICAgICAgIHBCZWFjb25TdHJ1Y3QtPlZIVENhcHMubXVCZWFtZm9ybWVyQ2FwKSAmJgorICAgICAgICAgICAgICAgICAgICAgcGZ0U2Vzc2lvbkVudHJ5LT50eEJGSW5pRmVhdHVyZUVuYWJsZWQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LnZodFR4QkZDYXBhYmxlID0gMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHBCZWFjb25TdHJ1Y3QtPlZIVENhcHMubXVCZWFtZm9ybWVyQ2FwICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZnRTZXNzaW9uRW50cnktPnR4TXVCZm9ybWVlICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPnN0YUNvbnRleHQudmh0VHhNVUJmb3JtZWVDYXBhYmxlID0gMTsKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJFbmFibGluZyBNVUJmb3JtZWUgZm9yIHBlZXIiKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorI2VuZGlmCisgICAgICAgICAgICBpZiggKHBCZWFjb25TdHJ1Y3QtPkhUQ2Fwcy5zdXBwb3J0ZWRDaGFubmVsV2lkdGhTZXQpICYmCisgICAgICAgICAgICAgICAgKGNoYW5XaWR0aFN1cHApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LnR4Q2hhbm5lbFdpZHRoU2V0ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICggdEFOSV9VOCApcEJlYWNvblN0cnVjdC0+SFRJbmZvLnJlY29tbWVuZGVkVHhXaWR0aFNldDsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgICAgICAgICAgICAgIGlmIChwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LnZodENhcGFibGUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LnZodFR4Q2hhbm5lbFdpZHRoU2V0ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQmVhY29uU3RydWN0LT5WSFRPcGVyYXRpb24uY2hhbldpZHRoOworICAgICAgICAgICAgICAgIH0KKyNlbmRpZgorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBBZGRCc3NQYXJhbXMtPnN0YUNvbnRleHQudHhDaGFubmVsV2lkdGhTZXQgPSBXTklfQ0ZHX0NIQU5ORUxfQk9ORElOR19NT0RFX0RJU0FCTEU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0Lm1pbW9QUyAgICAgICAgICAgICA9ICh0U2lyTWFjSFRNSU1PUG93ZXJTYXZlU3RhdGUpcEJlYWNvblN0cnVjdC0+SFRDYXBzLm1pbW9Qb3dlclNhdmU7CisgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LmRlbEJBU3VwcG9ydCAgICAgICA9ICggdEFOSV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ZnRTZXNzaW9uRW50cnktPmxpbVdtZUVuYWJsZWQgJiYgcEJlYWNvblN0cnVjdC0+d21lRWRjYVByZXNlbnQpIHx8CisgICAgICAgICAgICAgICAgKHBmdFNlc3Npb25FbnRyeS0+bGltUW9zRW5hYmxlZCAmJiBwQmVhY29uU3RydWN0LT5lZGNhUHJlc2VudCkpCisgICAgICAgICAgICBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LndtbUVuYWJsZWQgPSAxOworICAgICAgICBlbHNlIAorICAgICAgICAgICAgcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC53bW1FbmFibGVkID0gMDsKKworICAgICAgICAvL1VwZGF0ZSB0aGUgcmF0ZXMKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgICAgICBsaW1Qb3B1bGF0ZVBlZXJSYXRlU2V0KHBNYWMsICZwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LnN1cHBvcnRlZFJhdGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQmVhY29uU3RydWN0LT5IVENhcHMuc3VwcG9ydGVkTUNTU2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSxwZnRTZXNzaW9uRW50cnksJnBCZWFjb25TdHJ1Y3QtPlZIVENhcHMpOworI2Vsc2UKKyAgICAgICAgbGltUG9wdWxhdGVQZWVyUmF0ZVNldChwTWFjLCAmcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC5zdXBwb3J0ZWRSYXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiZWFjb25TdHJ1Y3QuSFRDYXBzLnN1cHBvcnRlZE1DU1NldCwgZmFsc2UscGZ0U2Vzc2lvbkVudHJ5KTsKKyNlbmRpZgorICAgICAgICBpZiAocGZ0U2Vzc2lvbkVudHJ5LT5odENhcGFiaWxpdHkpCisgICAgICAgIHsKKyAgICAgICAgICAgcEFkZEJzc1BhcmFt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dDExbW9kZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwQmVhY29uU3RydWN0LT5IVENhcHMucHJlc2VudCk7CisjaWZkZWYgV0xBTl9GRUFUVVJFXzExQUMKKyAgICBpZiAoSVNfQlNTX1ZIVF9DQVBBQkxFKHBCZWFjb25TdHJ1Y3QtPlZIVENhcHMpCisgICAgICAgICAgICAgICAgICAgICYmIHBCZWFjb25TdHJ1Y3QtPlZIVE9wZXJhdGlvbi5wcmVzZW50KQorICAgIHsKKyAgICAgICBwZnRTZXNzaW9uRW50cnktPnZodENhcGFiaWxpdHlQcmVzZW50SW5CZWFjb24gPSAxOworICAgICAgIHBmdFNlc3Npb25FbnRyeS0+YXBDZW50ZXJDaGFuID0gcEJlYWNvblN0cnVjdC0+VkhUT3BlcmF0aW9uLmNoYW5DZW50ZXJGcmVxU2VnMTsKKyAgICAgICBwZnRTZXNzaW9uRW50cnktPmFwQ2hhbldpZHRoID0gcEJlYWNvblN0cnVjdC0+VkhUT3BlcmF0aW9uLmNoYW5XaWR0aDsKKworICAgICAgIHBmdFNlc3Npb25FbnRyeS0+dHhCRkluaUZlYXR1cmVFbmFibGVkID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+cm9hbS5jb25maWdQYXJhbS50eEJGRW5hYmxlOworCisgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJ0eEJGSW5pRmVhdHVyZUVuYWJsZWQ9JWQiKSwKKyAgICAgICAgICAgICAgICBwZnRTZXNzaW9uRW50cnktPnR4QkZJbmlGZWF0dXJlRW5hYmxlZCk7CisKKyAgICAgICBpZiAocGZ0U2Vzc2lvbkVudHJ5LT50eEJGSW5pRmVhdHVyZUVuYWJsZWQpCisgICAgICAgeworICAgICAgICAgICBpZiAoY2ZnU2V0SW50KHBNYWMsIFdOSV9DRkdfVkhUX1NVX0JFQU1GT1JNRUVfQ0FQLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZnRTZXNzaW9uRW50cnktPnR4QkZJbmlGZWF0dXJlRW5hYmxlZCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IHNldCAgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIldOSV9DRkdfVkhUX1NVX0JFQU1GT1JNRUVfQ0FQIGF0IENGRyIpKTsKKyAgICAgICAgICAgfQorICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoInR4QkZDc25WYWx1ZT0lZCIpLAorICAgICAgICAgICAgICAgICAgICBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLnR4QkZDc25WYWx1ZSk7CisKKyAgICAgICAgICAgaWYgKGNmZ1NldEludChwTWFjLCBXTklfQ0ZHX1ZIVF9DU05fQkVBTUZPUk1FRV9BTlRfU1VQUE9SVEVELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0udHhCRkNzblZhbHVlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJjb3VsZCBub3Qgc2V0ICIKKyAgICAgICAgICAgICAgICAgICAgIldOSV9DRkdfVkhUX0NTTl9CRUFNRk9STUVFX0FOVF9TVVBQT1JURUQgYXQgQ0ZHIikpOworICAgICAgICAgICB9CisKKyAgICAgICAgICAgaWYgKElTX01VTUlNT19CRk9STUVFX0NBUEFCTEUpCisgICAgICAgICAgICAgICBwZnRTZXNzaW9uRW50cnktPnR4TXVCZm9ybWVlID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+cm9hbS5jb25maWdQYXJhbS50eE11QmZvcm1lZTsKKyAgICAgICAgfQorCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgidHhNdUJmb3JtZWUgPSAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGZ0U2Vzc2lvbkVudHJ5LT50eE11QmZvcm1lZSk7CisKKyAgICAgICAgaWYgKGNmZ1NldEludChwTWFjLCBXTklfQ0ZHX1ZIVF9NVV9CRUFNRk9STUVFX0NBUCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBmdFNlc3Npb25FbnRyeS0+dHhNdUJmb3JtZWUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IHNldCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIldOSV9DRkdfVkhUX01VX0JFQU1GT1JNRUVfQ0FQIGF0IENGRyIpKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgIHBmdFNlc3Npb25FbnRyeS0+dmh0Q2FwYWJpbGl0eVByZXNlbnRJbkJlYWNvbiA9IDA7CisgICAgfQorI2VuZGlmCisgICAgLy8gU2VsZiBNYWMKKyAgICBzaXJDb3B5TWFjQWRkcihwZnRTZXNzaW9uRW50cnktPnNlbGZNYWNBZGRyLCBwc2Vzc2lvbkVudHJ5LT5zZWxmTWFjQWRkcik7CisgICAgc2lyQ29weU1hY0FkZHIocGZ0U2Vzc2lvbkVudHJ5LT5saW1SZUFzc29jYnNzSWQsIHBic3NEZXNjcmlwdGlvbi0+YnNzSWQpOworI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJ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KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcmljX2llcywgdEFOSV9VMzIgKmllTGVuZ3RoKQoreworICAgIC8qIEJsb2NrQUNLICsgUklDIGlzIG5vdCBzdXBwb3J0ZWQgbm93LCBUT0RPIGxhdGVyIHRvIHN1cHBvcnQgdGhpcyAqLworI2lmIDAKKyAgICB0RG90MTFmSUVSSUNEYXRhRGVzYyByaWNJZTsKKyAgICB0RG90MTFmRmZCQVN0YXJ0aW5nU2VxdWVuY2VDb250cm9sIGJhU3NuQ29udHJvbDsKKyAgICB0RG90MTFmRmZBZGRCQVBhcmFtZXRlclNldCBiYVBhcmFtU2V0OworICAgIHREb3QxMWZGZkJBVGltZW91dCAgYmFUaW1lb3V0OworCisgICAgdm9zX21lbV96ZXJvKCZyaWNJZSwgc2l6ZW9mKHREb3QxMWZJRVJJQ0RhdGFEZXNjKSk7CisgICAgdm9zX21lbV96ZXJvKCZiYVNzbkNvbnRyb2wsIHNpemVvZih0RG90MTFmRmZCQVN0YXJ0aW5nU2VxdWVuY2VDb250cm9sKSk7CisgICAgdm9zX21lbV96ZXJvKCZiYVBhcmFtU2V0LCBzaXplb2YodERvdDExZkZmQWRkQkFQYXJhbWV0ZXJTZXQpKTsKKyAgICB2b3NfbWVtX3plcm8oJmJhVGltZW91dCwgc2l6ZW9mKHREb3QxMWZGZkJBVGltZW91dCkpOworCisgICAgcmljSWUucHJlc2VudCA9IDE7CisgICAgcmljSWUuUklDRGF0YS5wcmVzZW50ID0gMTsKKyAgICByaWNJZS5SSUNEYXRhLnJlc291cmNlRGVzY0NvdW50ID0gMTsKKyAgICByaWNJZS5SSUNEYXRhLklkZW50aWZpZXIgPSBMSU1fRlRfUklDX0JBX0RJQUxPR19UT0tFTl9USURfMCArIHRpZDsKKyAgICByaWNJZS5SSUNEZXNjcmlwdG9yLnByZXNlbnQgPSAxOworICAgIHJpY0llLlJJQ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ktPmRwaC5kcGhIYXNoVGFibGUpOworICAgIGlmKCBOVUxMID09IHBTdGEgKQorICAgIHsKKyAgICAgICAgUEVMT0dFKGxpbUxvZyggcE1hYywgTE9HRSwKKyAgICAgICAgICAgIEZMKCAiU1RBIGNvbnRleHQgbm90IGZvdW5kIGZvciBzYXZlZCBzZXNzaW9uJ3MgQlNTSUQgIiBNQUNfQUREUkVTU19TVFIgKSwKKyAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBNYWMtPmZ0LmZ0UEVDb250ZXh0LnBGVFByZUF1dGhSZXEtPmN1cnJic3NJZCkpOykKKyAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICB9CisKKyAgICBmb3IgKHRpZCA9IDA7IHRpZCA8IFNUQUNGR19NQVhfVEM7IHRpZCsrKQorICAgIHsKKyAgICAgICAgaWYgKHBTdGEtPnRjQ2ZnW3RpZF0uZlVzZUJBVHgpCisgICAgICAgIHsKKyAgICAgICAgICAgIHN0YXR1cyA9IGxpbUNyZWF0ZVJJQ0Jsb2NrQWNrSUUocE1hYywgdGlkLCAmcFN0YS0+dGNDZmdbdGlkXSwgcmljX2llcyArIG9mZnNldCwgJmllTGVuZ3RoKTsKKyAgICAgICAgICAgIGlmIChlU0lSX1NVQ0NFU1MgPT0gc3RhdHVzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIFRPRE8gUklDCisgICAgICAgICAgICAgICAgaWYgKCBpZUxlbmd0aCA+IE1BWF9GVElFX1NJWkUgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWVMZW5ndGggPSAwOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3RhdHVzOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBvZmZzZXQgKz0gaWVMZW5ndGg7CisgICAgICAgICAgICAgICAgKnJpY19pZXNfbGVuZ3RoICs9IGllTGVuZ3RoOworICAgICAgICAgICAgICAgIG51bUJBKys7Cisg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C5mdFBFQ29udGV4dC5wQWRkQnNzUmVxKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJwQWRkQnNzUmVxIGlzIE5VTEwiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgcE1sbVJlYXNzb2NSZXEgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodExpbU1sbVJlYXNzb2NSZXEpKTsKKyAgICBpZiAoTlVMTCA9PSBwTWxtUmVhc3NvY1JlcSkKKyAgICB7CisgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoImNhbGwgdG8gQWxsb2NhdGVNZW1vcnkgZmFpbGVkIGZvciBtbG1SZWFzc29jUmVxIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgdm9zX21lbV9jb3B5KHBNbG1SZWFzc29jUmVxLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+YnNzSWQsCisgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworCisgICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfUkVBU1NPQ0lBVElPTl9GQUlMVVJFX1RJTUVPVVQsCisgICAgICAgICAgICAgICAgICAodEFOSV9VMzIgKikgJnBNbG1SZWFzc29jUmVxLT5yZWFzc29jRmFpbHVyZVRpbWVvdXQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBlU0lSX1NVQ0NFU1MpCisgICAgeworICAgICAgICAvKioKKyAgICAgICAgICogQ291bGQgbm90IGdldCBSZWFzc29jRmFpbHVyZVRpbWVvdXQgdmFsdWUKKyAgICAgICAgICogZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgICovCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IHJldHJpZXZlIFJlYXNzb2NGYWlsdXJlVGltZW91dCB2YWx1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cSk7CisgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmICh0ZWxlQmNuRW4pCisgICAgeworICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX1RFTEVfQkNOX01BWF9MSSwgJnZhbCkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgIHsKKyAgICAgICAgICAvKioKKyAgICAgICAgICAgICogQ291bGQgbm90IGdldCBMaXN0ZW5JbnRlcnZhbCB2YWx1ZQorICAgICAgICAgICAgKiBmcm9tIENGRy4gTG9nIGVycm9yLgorICAgICAgICAgICovCisgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgTGlzdGVuSW50ZXJ2YWwiKSk7CisgICAgICAgICAgdm9zX21lbV9mcmVlKHBNbG1SZWFzc29jUmVxKTsKKyAgICAgICAgICByZXR1cm47CisgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfTElTVEVOX0lOVEVSVkFMLCAmdmFsKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICB7CisgICAgICAgICAvKioKKyAgICAgICAgICAgICogQ291bGQgbm90IGdldCBMaXN0ZW5JbnRlcnZhbCB2YWx1ZQorICAgICAgICAgICAgKiBmcm9tIENGRy4gTG9nIGVycm9yLgorICAgICAgICAgICAgKi8KKyAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IHJldHJpZXZlIExpc3RlbkludGVydmFsIikpOworICAgICAgICAgdm9zX21lbV9mcmVlKHBNbG1SZWFzc29jUmVxKTsKKyAgICAgICAgIHJldHVybjsKKyAgICAgIH0KKyAgICB9CisgICAgaWYgKGxpbVNldExpbmtTdGF0ZShwTWFjLCBlU0lSX0xJTktfUFJFQVNTT0NfU1RBVEUsIHBzZXNzaW9uRW50cnktPmJzc0lkLAorICAgICAgICAgICAgIC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bGl2ZXJ5IGVuYWJsZWQgQUMgaWYgdGhlIFBTQiBzdWJmaWVsZCBpcyBzZXQgdG8gMSAKKyAgICAgICAgICAgICAqIGluIHRoZSBkb3dubGluayBkaXJlY3Rpb24uCisgICAgICAgICAgICAgKiBBbiBBQyBpcyB0cmlnZ2VyIGFuZCBkZWxpdmVyeSBlbmFibGVkIEFDIGlmIHRoZSBQU0Igc3ViZmllbGQgIAorICAgICAgICAgICAgICogaXMgc2V0IHRvIDEgaW4gdGhlIGJpLWRpcmVjdGlvbiBmaWVsZC4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgaWYgKHBUc3BlYy0+dHNpbmZvLnRyYWZmaWMucHNiID09IDEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltU2V0VHNwZWNVYXBzZE1hc2socE1hYywgJnBUc3BlYy0+dHNpbmZvLCBTRVRfVUFQU0RfTUFTSyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7IAorICAgICAgICAgICAgICAgIGxpbVNldFRzcGVjVWFwc2RNYXNrKHBNYWMsICZwVHNwZWMtPnRzaW5mbywgQ0xFQVJfVUFQU0RfTUFTSyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBBRERUUyBzdWNjZXNzLCBzbyBBQyBpcyBub3cgYWRtaXR0ZWQuIFdlIHNoYWxsIG5vdyB1c2UgdGhlIGRlZmF1bHQKKyAgICAgICAgICAgICAqIEVEQ0EgcGFyYW1ldGVycyBhcyBhZHZlcnRpc2VkIGJ5IEFQIGFuZCBzZW5kIHRoZSB1cGRhdGVkIEVEQ0EgcGFyYW1zCisgICAgICAgICAgICAgKiB0byBIQUwuIAorICAgICAgICAgICAgICovCisgICAgICAgICAgICBhYyA9IHVwVG9BYyhwVHNwZWMtPnRzaW5mby50cmFmZmljLnVzZXJQcmlvKTsKKyAgICAgICAgICAgIGlmKHBUc3BlYy0+dHNpbmZvLnRyYWZmaWMuZGlyZWN0aW9uID09IFNJUl9NQUNfRElSRUNUSU9OX1VQTElOSykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0FjQWRtaXRNYXNrW1NJUl9NQUNfRElSRUNUSU9OX1VQTElOS10gfD0gKDEgPDwgYWMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZihwVHNwZWMtPnRzaW5mby50cmFmZmljLmRpcmVjdGlvbiA9PSBTSVJfTUFDX0RJUkVDVElPTl9ETkxJTkspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdBY0FkbWl0TWFza1tTSVJfTUFDX0RJUkVDVElPTl9ETkxJTktdIHw9ICgxIDw8IGFjKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYocFRzcGVjLT50c2luZm8udHJhZmZpYy5kaXJlY3Rpb24gPT0gU0lSX01BQ19ESVJFQ1RJT05fQklESVIpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdBY0FkbWl0TWFza1tTSVJfTUFDX0RJUkVDVElPTl9VUExJTktdIHw9ICgxIDw8IGFjKTsKKyAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0FjQWRtaXRNYXNrW1NJUl9NQUNfRElSRUNUSU9OX0ROTElOS10gfD0gKDEgPDwgYWMpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBsaW1TZXRBY3RpdmVFZGNhUGFyYW1zKHBNYWMsIHBzZXNzaW9uRW50cnktPmdMaW1FZGNhUGFyYW1zLCBwc2Vzc2lvbkVudHJ5KTsKKworICAgICAgICAgICAgaWYgKHBTdGEtPmFuaVBlZXIgPT0gZUFOSV9CT09MRUFOX1RSVUUpIAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbVNlbmRFZGNhUGFyYW1zKHBNYWMsIHBzZXNzaW9uRW50cnktPmdMaW1FZGNhUGFyYW1zQWN0aXZlLCBwU3RhLT5ic3NJZC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0dSX1FPU19SRVE7CisgICAgbXNnLmJvZHlwdHIgPSBwQWdnckFkZFRzUGFyYW07CisgICAgbXNnLmJvZHl2YWwgPSAwOworCisgICAgLyogV2UgbmVlZCB0byBkZWZlciBhbnkgaW5jb21pbmcgbWVzc2FnZXMgdW50aWwgd2UgZ2V0IGEKKyAgICAgKiBXREFfQUdHUl9RT1NfUlNQIGZyb20gSEFMLgorICAgICAqLworICAgIFNFVF9MSU1fUFJPQ0VTU19ERUZEX01FU0dTKHBNYWMsIGZhbHNlKTsKKyAgICBNVFJBQ0UobWFjVHJhY2VNc2dUeChwTWFjLCBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwgbXNnLnR5cGUpKTsKKworICAgIGlmKGVTSVJfU1VDQ0VTUyAhPSB3ZGFQb3N0Q3RybE1zZyhwTWFjLCAmbXNnKSkKKyAgICB7CisgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgid2RhUG9zdEN0cmxNc2coKSBmYWlsZWQiKSk7KQorICAgICAgIFNFVF9MSU1fUFJPQ0VTU19ERUZEX01FU0dTKHBNYWMsIHRydWUpOworICAgICAgIHZvc19tZW1fZnJlZShwQWdnckFkZFRzUGFyYW0pOworICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorCisgICAgcmV0dXJuIGVTSVJfU1VDQ0VTUzsKK30KKwordm9pZAorbGltRlRTZW5kQWdnclFvc1JzcCh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4IHJzcFJlcWQsCisgICAgICAgICAgICAgICAgICAgIHRwQWdnckFkZFRzUGFyYW1zIGFnZ3JRb3NSc3AsIHRBTklfVTggc21lc2Vzc2lvbklkKQoreworICAgIHRwU2lyQWdnclFvc1JzcCAgcnNwOworICAgIGludCBpID0gMDsKKworICAgIGlmICghIHJzcFJlcWQpCisgICAgeworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgcnNwID0gdm9zX21lbV9tYWxsb2Moc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LAorICAgICAgICAgICAgICAgICAgICAmYWRkVHNQYXJhbS50c3BlYy50c2luZm8sCisgICAgICAgICAgICAgICAgICAgICZhZGRUc1BhcmFtLnRzcGVjLCBwc2Vzc2lvbkVudHJ5KTsKKworICAgICAgICAgICAgcFN0YSA9IGRwaExvb2t1cEFzc29jSWQocE1hYywgYWRkVHNQYXJhbS5zdGFJZHgsICZhc3NvY0lkLAorICAgICAgICAgICAgICAgICAgICAmcHNlc3Npb25FbnRyeS0+ZHBoLmRwaEhhc2hUYWJsZSk7CisgICAgICAgICAgICBpZiAocFN0YSAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUFkbWl0Q29udHJvbERlbGV0ZVRTKHBNYWMsIGFzc29jSWQsICZhZGRUc1BhcmFtLnRzcGVjLnRzaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsICh0QU5JX1U4ICopJmFkZFRzUGFyYW0udHNwZWNJZHgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyogU2VuZCB0aGUgQWdnciBRb1MgcmVzcG9uc2UgdG8gU01FICovCisKKyAgICBsaW1GVFNlbmRBZ2dyUW9zUnNwKHBNYWMsIHJzcFJlcWQsIHBBZ2dyUW9zUnNwTXNnLAorICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+c21lU2Vzc2lvbklkKTsKKyAgICBpZiggcEFnZ3JRb3NSc3BNc2cgIT0gTlVMTCApCisgICAgeworICAgICAgICB2b3NfbWVtX2ZyZWUocEFnZ3JRb3NSc3BNc2cpOworICAgIH0KKyAgICByZXR1cm47Cit9CisKKyNlbmRpZiAvKiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUiAqLwpkaWZmIC0tZ2l0IGEvd2xhbi9wcmltYS9DT1JFL01BQy9zcmMvcGUvbGltL2xpbUlic3NQZWVyTWdtdC5jIGIvd2xhbi9wcmltYS9DT1JFL01BQy9zcmMvcGUvbGltL2xpbUlic3NQZW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RlKQoreworI2lmZGVmIEFOSV9TSVJfSUJTU19QRUVSX0NBQ0hJTkcKKyAgICB0QU5JX1UzMiBudW1JYnNzUGVlcnMgPSAoMiAqIHBNYWMtPmxpbS5tYXhTdGF0aW9uKTsKKworICAgIGlmIChwTWFjLT5saW0uZ0xpbU51bUlic3NQZWVycyA+PSBudW1JYnNzUGVlcnMpCisgICAgeworICAgICAgICAvKioKKyAgICAgICAgICogUmVhY2hlZCBtYXggbnVtYmVyIG9mIHBlZXJzIHRvIGJlIG1haW50YWluZWQuCisgICAgICAgICAqIERlbGV0ZSBsYXN0IGVudHJ5ICYgYWRkIG5ldyBlbnRyeSBhdCB0aGUgYmVnaW5uaW5nLgorICAgICAgICAgKi8KKyAgICAgICAgdExpbUlic3NQZWVyTm9kZSAqcFRlbXAsICpwUHJldjsKKyAgICAgICAgcFRlbXAgPSBwUHJldiA9IHBNYWMtPmxpbS5nTGltSWJzc1BlZXJMaXN0OworICAgICAgICB3aGlsZSAocFRlbXAtPm5leHQgIT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgICAgcFByZXYgPSBwVGVtcDsKKyAgICAgICAgICAgIHBUZW1wID0gcFRlbXAtPm5leHQ7CisgICAgICAgIH0KKyAgICAgICAgaWYocFRlbXAtPmJlYWNvbikKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBUZW1wLT5iZWFjb24pOworICAgICAgICB9CisKKyAgICAgICAgdm9zX21lbV9mcmVlKHBUZW1wKTsKKyAgICAgICAgcFByZXYtPm5leHQgPSBOVUxMOworICAgIH0KKyAgICBlbHNlCisjZW5kaWYKKyAgICAgICAgcE1hYy0+bGltLmdMaW1OdW1JYnNzUGVlcnMrKzsKKworICAgIHBQZWVyTm9kZS0+bmV4dCA9IHBNYWMtPmxpbS5nTGltSWJzc1BlZXJMaXN0OworICAgIHBNYWMtPmxpbS5nTGltSWJzc1BlZXJMaXN0ID0gcFBlZXJOb2RlOworCisgICAgcmV0dXJuIGVTSVJ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nByZXNlbnQ7CisKKyAgICAgICAgLy8gQ29sbGVjdCBWSFQgY2FwYWJpbGl0aWVzIGZyb20gYmVhY29uCisgICAgICAgIHZvc19tZW1fY29weSgodEFOSV9VOCAqKSAmcFBlZXItPlZIVENhcHMsCisgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSAmcEJlYWNvbi0+VkhUQ2FwcywKKyAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0RG90MTFmSUVWSFRDYXBzKSk7CisgICAgfQorI2VuZGlmCisgICAgcFBlZXItPmVycEllUHJlc2VudCA9IHBCZWFjb24tPmVycFByZXNlbnQ7CisKKyAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKikgJnBQZWVyLT5zdXBwb3J0ZWRSYXRlcywKKyAgICAgICAgICAgICAgICAgKHRBTklfVTggKikgJnBCZWFjb24tPnN1cHBvcnRlZFJhdGVzLAorICAgICAgICAgICAgICAgICBwQmVhY29uLT5zdXBwb3J0ZWRSYXRlcy5udW1SYXRlcyArIDEpOworICAgIGlmIChwUGVlci0+ZXh0ZW5kZWRSYXRlc1ByZXNlbnQpCisgICAgICAgIHZvc19tZW1fY29weSgodEFOSV9VOCAqKSAmcFBlZXItPmV4dGVuZGVkUmF0ZXMsCisgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSAmcEJlYWNvbi0+ZXh0ZW5kZWRSYXRlcywKKyAgICAgICAgICAgICAgICAgICAgIHBCZWFjb24tPmV4dGVuZGVkUmF0ZXMubnVtUmF0ZXMgKyAxKTsKKyAgICBlbHNlCisgICAgICAgIHBQZWVyLT5leHRlbmRlZFJhdGVzLm51bVJhdGVzID0gMDsKKworICAgIC8vIFRCRCBjb3B5IEVEQ0EgcGFyYW1ldGVycworICAgIC8vIHBQZWVyLT5lZGNhUGFyYW1zOworCisgICAgcFBlZXItPm5leHQgPSBOVUxMOworfSAvKioqIGVuZCBpYnNzX3BlZXJfY29sbGVjdCgpICoqKi8KKworLy8gaGFuZGxlIGNoY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5CisgICAgaWYgKHBQZWVyTm9kZS0+Y2FwYWJpbGl0eUluZm8ucW9zICYmIChwc2Vzc2lvbkVudHJ5LT5saW1Rb3NFbmFibGVkKSAmJiBwUGVlck5vZGUtPmVkY2FQcmVzZW50KQorICAgIHsKKyAgICAgICAgcFN0YURzLT5xb3NNb2RlICAgID0gMTsKKyAgICAgICAgcFN0YURzLT53bWVFbmFibGVkID0gMDsKKyAgICAgICAgaWYgKCEgcFN0YURzLT5sbGVFbmFibGVkKQorICAgICAgICB7CisgICAgICAgICAgICBwU3RhRHMtPmxsZUVuYWJsZWQgPSAxOworICAgICAgICAgICAgLy9kcGhTZXRBQ00ocE1hYywgcFN0YURzKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm47CisgICAgfQorICAgIC8vIHBlZXIgaXMgbm90IDExZSBjYXBhYmxlIG5vdyBidXQgd2FzIDExZSBlbmFibGVkIGVhcmxpZXIKKyAgICBlbHNlIGlmIChwU3RhRHMtPmxsZUVuYWJsZWQpCisgICAgeworICAgICAgICBwU3RhRHMtPnFvc01vZGUgICAgICA9IDA7CisgICAgICAgIHBTdGFEcy0+bGxlRW5hYmxlZCAgID0gMDsKKyAgICB9CisKKyAgICAvLyBwZWVyIGlzIHdtZSBjYXBhYmxlIGJ1dCBpcyBub3Qgd21lIGVuYWJsZWQgeWV0CisgICAgaWYgKHBQZWVyTm9kZS0+d21lSW5mb1ByZXNlbnQgJiYgIHBzZXNzaW9uRW50cnktPmxpbVdtZUVuYWJsZWQpCisgICAgeworICAgICAgICBwU3RhRHMtPnFvc01vZGUgICAgPSAxOworICAgICAgICBwU3RhRHMtPmxsZUVuYWJsZWQgPSAwOworICAgICAgICBpZiAoISBwU3RhRHMtPndtZUVuYWJsZWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBTdGFEcy0+d21lRW5hYmxlZCA9IDE7CisgICAgICAgICAgICAvL2RwaFNldEFDTShwTWFjLCBwU3RhRHMpOworICAgICAgICB9CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgLyogV2hlbiB0aGUgcGVlciBkZXZpY2Ugc3VwcG9ydHMgRURDQSBwYXJhbWV0ZXJzLCB0aGVuIHdlIHdlcmUgbm90IAorICAgICAgY29uc2lkZXJpbmcuIEFkZGVkIHRoaXMgY29kZSB3aGVuIHdlIHNhdyB0aGF0IG9uZSBvZiB0aGUgUGVlciBEZXZpY2UKKyAgICAgIHdhcyBhZHZlcnRpc2luZyBXTU0gcGFyYW0gd2hlcmUgd2Ugd2VyZSBub3QgaG9ub3VyaW5nIHRoYXQuIENSIyAyMTA3NTYKKyAgICAqLworICAgIGlmIChwUGVlck5vZGUtPndtZUVkY2FQcmVzZW50ICYmIHBzZXNzaW9uRW50cnktPmxpbVdtZUVuYWJsZWQpIHsKKyAgICAgICAgcFN0YURzLT5xb3NNb2RlICAgID0gMTsKKyAgICAgICAgcFN0YURzLT5sbGVFbmFibGVkID0gMDsKKyAgICAgICAgaWYgKCEgcFN0YURzLT53bWVFbmFibGVkKSB7CisgICAgICAgICAgICBwU3RhRHMtPndtZUVuYWJsZWQgPSAxOworICAgICAgICB9CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICAvLyBwZWVyIGlzIG5vdCB3bWUgY2FwYWJsZSBub3cgYnV0IHdhcyB3bWUgZW5hYmxlZCBlYXJsaWVyCisgICAgZWxzZSBpZiAocFN0YURzLT53bWVFbmFibGVkKQorICAgIHsKKyAgICAgICAgcFN0YURzLT5xb3NNb2RlICAgICAgPSAwOworICAgICAgICBwU3RhRHMtPndtZUVuYWJsZWQgICA9IDA7CisgICAgfQorCit9CisKK3N0YXRpYyB2b2lkCitpYnNzX3N0YV9yYXRlc191cGRhdGUoCisgICAgdHBBbmlTaXJHbG9iYWwgICBwTWFjLAorICAgIHRwRHBoSGFzaE5vZGUgICAgcFN0YURzLAorICAgIHRMaW1JYnNzUGVlck5vZGUgKnBQZWVyLAorICAgIHRwUEVTZXNzaW9uICAgICAgIHBzZXNzaW9uRW50cnkpCit7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KyAgICBwTWFjLT5saW0uaWJzc0luZm8ucEJlYWNvbiA9IE5VTEw7Cit9CisKKy8qCisgKiBzYXZlIHRoZSBiZWFjb24gcGFyYW1zIGZvciB1c2Ugd2hlbiBhZGRpbmcgdGhlIGJzcworICovCitzdGF0aWMgdm9pZAoraWJzc19jb2FsZXNjZV9zYXZlKAorICAgIHRwQW5pU2lyR2xvYmFsICAgICAgcE1hYywKKyAgICB0cFNpck1hY01nbXRIZHIgICAgIHBIZHIsCisgICAgdHBTY2hCZWFjb25TdHJ1Y3QgICBwQmVhY29uKQoreworICAgIC8vIGdldCByaWQgb2YgYW55IHNhdmVkIGluZm8KKyAgICBpYnNzX2NvYWxlc2NlX2ZyZWUocE1hYyk7CisKKyAgICBwTWFjLT5saW0uaWJzc0luZm8ucEhkciA9IHZvc19tZW1fbWFsbG9jKHNpemVvZigqcEhkcikpOworICAgIGlmIChOVUxMID09IHBNYWMtPmxpbS5pYnNzSW5mby5wSGRyKQorICAgIHsKKyAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiaWJicy1zYXZlOiBGYWlsZWQgbWFsbG9jIHBIZHIiKSk7KQorICAgICAgICByZXR1cm47CisgICAgfQorICAgIHBNYWMtPmxpbS5pYnNzSW5mby5wQmVhY29uID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKCpwQmVhY29uKSk7CisgICAgaWYgKE5VTEwgPT0gcE1hYy0+bGltLmlic3NJbmZvLnBCZWFjb24pCisgICAgeworICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJpYmJzLXNhdmU6IEZhaWxlZCBtYWxsb2MgcEJlYWNvbiIpKTspCisgICAgICAgIGlic3NfY29hbGVzY2VfZnJlZShwTWFjKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHZvc19tZW1fY29weShwTWFjLT5saW0uaWJzc0luZm8ucEhkciwgcEhkciwgc2l6ZW9mKCpwSGRyKSk7CisgICAgdm9z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oYXQKKyAgICAgKiBBSUQgYW5kIHRoZW4gYWRkIGFuIGVudHJ5IHRvIGhhc2ggdGFibGUgbWFpbnRhaW5lZAorICAgICAqIGJ5IERQSCBtb2R1bGUuCisgICAgICovCisgICAgcGVlcklkeCA9IGxpbUFzc2lnblBlZXJJZHgocE1hYywgcHNlc3Npb25FbnRyeSk7CisKKyAgICBwU3RhRHMgPSBkcGhHZXRIYXNoRW50cnkocE1hYywgcGVlcklkeCwgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUpOworICAgIGlmIChwU3RhRHMpCisgICAgeworICAgICAgICAodm9pZCkgbGltRGVsU3RhKHBNYWMsIHBTdGFEcywgZmFsc2UgLyphc3luY2hyb25vdXMqLyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgbGltRGVsZXRlRHBoSGFzaEVudHJ5KHBNYWMsIHBTdGFEcy0+c3RhQWRkciwgcGVlcklkeCxwc2Vzc2lvbkVudHJ5KTsKKyAgICB9CisKKyAgICBwU3RhRHMgPSBkcGhBZGRIYXNoRW50cnkocE1hYywgcGVlckFkZHIsIHBlZXJJZHgsICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsKKyAgICBpZiAocFN0YURzID09IE5VTEwpCisgICAgeworICAgICAgICAvLyBDb3VsZCBub3QgYWRkIGhhc2ggdGFibGUgZW50cnkKKyAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IGFkZCBoYXNoIGVudHJ5IGF0IERQSCBmb3IgcGVlcklkeC9haWQ9JWQgTUFDYWRkcjoiKSwgcGVlcklkeCk7KQorICAgICAgICBsaW1QcmludE1hY0FkZHIocE1hYywgcGVlckFkZHIsIExPR0UpOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKworICAgICpwcFN0YSA9IHBTdGFEczsKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworfQorCisvLyBzZW5kIGEgc3RhdHVzIGNoYW5nZSBub3RpZmljYXRpb24KK3N0YXRpYyB2b2lkCitpYnNzX3N0YXR1c19jaGdfbm90aWZ5KAorICAgIHRwQW5pU2lyR2xvYmFsICAgICAgICAgIHBNYWMsCisgICAgdFNpck1hY0FkZHIgICAgICAgICAgICAgcGVlckFkZHIsCisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgc3RhSW5kZXgsCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgdWNhc3RTaWcsIAorICAgIHRBTklfVTggICAgICAgICAgICAgICAgIGJjYXN0U2lnLCAKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgICBzdGF0dXMsCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgc2Vzc2lvbklkKQoreworCisgICAgdExpbUlic3NQZWVyTm9kZSAqcGVlck5vZGU7CisgICAgdEFOSV9VOCAqYmVhY29uID0gTlVMTDsKKyAgICB0QU5JX1UxNiBiY25MZW4gPSAwOworCisKKyAgICBwZWVyTm9kZSA9IGlic3NfcGVlcl9maW5kKHBNYWMscGVlckFkZHIpOworICAgIGlmKHBlZXJOb2RlICE9IE5VTEwpCisgICAgeworICAgICAgICBpZihwZWVyTm9kZS0+YmVhY29uID09IE5VTEwpIHBlZXJOb2RlLT5iZWFjb25MZW4gPSAwOworICAgICAgICBiZWFjb24gPSBwZWVyTm9kZS0+YmVhY29uOworICAgICAgICBiY25MZW4gPSBwZWVyTm9kZS0+YmVhY29uTGVuOworICAgICAgICBwZWVyTm9kZS0+YmVhY29uID0gTlVMTDsKKyAgICAgICAgcGVlck5vZGUtPmJlYWNvbkxlbiA9IDA7CisgICAgfQorCisgICAgbGltU2VuZFNtZUlCU1NQZWVySW5kKHBNYWMscGVlckFkZHIsIHN0YUluZGV4LCB1Y2FzdFNpZywgYmNhc3RTaWcsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGJlYWNvbiwgYmNuTGVuLCBzdGF0dXMsIHNlc3Npb25JZCk7CisKKyAgICBpZihiZWFjb24gIT0gTlVMTCkKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZShiZWFjb24pOworICAgIH0KK30KKworCitzdGF0aWMgdm9pZAoraWJzc19ic3NfYWRkKAorICAgIHRwQW5pU2lyR2xvYmFsICAgIHBNYWMsCisgICAgdHBQRVNlc3Npb24gICAgICAgcHNlc3Npb25FbnRyeSkKK3sKKyAgICB0TGltTWxtU3RhcnRSZXEgICBtbG1TdGFydFJlcTsKKyAgICB0QU5JX1UzMiAgICAgICAgICBjZmc7CisgICAgdHBTaXJNYWNNZ210SGRyICAgcEhkciAgICA9ICh0cFNpck1hY01nbXRIZHIpICAgcE1hYy0+bGltLmlic3NJbmZvLnBIZHI7CisgICAgdHBTY2hCZWFjb25TdHJ1Y3QgcEJlYWNvbiA9ICh0cFNjaEJlYWNvblN0cnVjdCkgcE1hYy0+bGltLmlic3NJbmZvLnBCZWFjb247CisgICAgdEFOSV9VOCBudW1FeHRSYXRlcyA9IDA7CisKKyAgICBpZiAoKHBIZHIgPT0gTlVMTCkgfHwgKHBCZWFjb24gPT0gTlVMTCkpCisgICAgeworICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJVbmFibGUgdG8gYWRkIEJTUyAobm8gY2FjaGVkIEJTUyBpbmZvKSIpKTspCisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICB2b3NfbWVtX2NvcHkocHNlc3Npb25FbnRyeS0+YnNzSWQsIHBIZHItPmJzc0lkLAorICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKworICAgICNpZiAwCisgICAgaWYgKGNmZ1NldFN0cihwTWFjLCBXTklfQ0ZHX0JTU0lELCAodEFOSV9VOCAqKSBwSGRyLT5ic3NJZCwgc2l6ZW9mKHRTaXJNYWNBZGRyKSkKKyAgICAgICAgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoImNvdWxkIG5vdCB1cG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Ob2RlOworICAgIHRwRHBoSGFzaE5vZGUgcFN0YURzOworICAgIHRBTklfVTE2IHBlZXJJZHg7CisKKyAgICBwQ3Vyck5vZGUgPSBwVGVtcE5vZGUgPSBwTWFjLT5saW0uZ0xpbUlic3NQZWVyTGlzdDsKKworICAgIHdoaWxlIChwQ3Vyck5vZGUgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIGlmICghcE1hYy0+bGltLmdMaW1OdW1JYnNzUGVlcnMpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgRkwoIk51bWJlciBvZiBwZWVycyBpbiB0aGUgbGlzdCBpcyB6ZXJvIGFuZCBub2RlIHByZXNlbnQiKSk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgLyogRGVsZXRlIHRoZSBkcGggZW50cnkgZm9yIHRoZSBzdGF0aW9uCisgICAgICAgICAgICAgICogU2luY2UgaXQgaXMgY2FsbGVkIHRvIHJlbW92ZSBhbGwgcGVlcnMsIGp1c3QgZGVsZXRlIGZyb20gZHBoLAorICAgICAgICAgICAgICAqIG5vIG5lZWQgdG8gZG8gYW55IGJlYWNvbiByZWxhdGVkIHBhcmFtcyBpLmUuLCBkb250IGNhbGwgbGltRGVsZXRlRHBoSGFzaEVudHJ5CisgICAgICAgICAgICAgICovCisgICAgICAgIHBTdGFEcyA9IGRwaExvb2t1cEhhc2hFbnRyeShwTWFjLCBwQ3Vyck5vZGUtPnBlZXJNYWNBZGRyLCAmcGVlcklkeCwgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUpOworICAgICAgICBpZiggcFN0YURzICkKKyAgICAgICAgeworCisgICAgICAgICAgICBpYnNzX3N0YXR1c19jaGdfbm90aWZ5KCBwTWFjLCBwQ3Vyck5vZGUtPnBlZXJNYWNBZGRyLCBwU3RhRHMtPnN0YUluZGV4LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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KyAgICAgICAgICAgICAgICAqIGxvb3AgY2F1c2luZyB0aGUgbGltLmdMaW1JYnNzUGVlckxpc3QgdG8gcG9pbnQgdG8gc29tZSBmcmVlZCBtZW1vcnkuCisgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgcE1hYy0+bGltLmdMaW1JYnNzUGVlckxpc3QgPSBwVGVtcE5vZGU7CisKKyAgICAgICAgaWYocEN1cnJOb2RlLT5iZWFjb24pCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwQ3Vyck5vZGUtPmJlYWNvbik7CisgICAgICAgIH0KKyAgICAgICAgdm9zX21lbV9mcmVlKHBDdXJyTm9kZSk7CisgICAgICAgIGlmIChwTWFjLT5saW0uZ0xpbU51bUlic3NQZWVycyA+IDApIC8vIGJlIHBhcmFub2lkCisgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbU51bUlic3NQZWVycy0tOworICAgICAgICBwQ3Vyck5vZGUgPSBwVGVtcE5vZGU7CisgICAgfQorCisgICAgaWYgKHBNYWMtPmxpbS5nTGltTnVtSWJzc1BlZXJzKQorICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoIk51bWJlciBvZiBwZWVyc1slZF0gaW4gdGhlIGxpc3QgaXMgbm9uLXplcm8iKSwKKyAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbU51bUlic3NQZWVycyk7CisKKyAgICBwTWFjLT5saW0uZ0xpbU51bUlic3NQZWVycyA9IDA7CisgICAgcE1hYy0+bGltLmdMaW1JYnNzUGVlckxpc3QgPSBOVUxMOworCit9CisvKioKKyAqIGxpbUlic3NEZWxldGUKKyAqCisgKkZVTkNUSU9OOgorICogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgd2hpbGUgdGVhcmluZyBkb3duIGFuIElCU1MuCisgKgorICpMT0dJQzoKKyAqCisgKkFTU1VNUFRJT05TOgorICoKKyAqTk9URToKKyAqCisgKiBAcGFyYW0gIHBNYWMgLSBQb2ludGVy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BQcmV2Tm9kZSA9IHBNYWMtPmxpbS5nTGltSWJzc1BlZXJMaXN0OworCisgICAgaWYgKHBUZW1wTm9kZSA9PSBOVUxMKQorICAgICAgICByZXR1cm47CisKKyAgICB3aGlsZSAocFRlbXBOb2RlICE9IE5VTEwpCisgICAgeworICAgICAgICBpZiAodm9zX21lbV9jb21wYXJlKCh0QU5JX1U4ICopIG1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTggKikgJnBUZW1wTm9kZS0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSkgKQorICAgICAgICB7CisgICAgICAgICAgICAvLyBGb3VuZCBub2RlIHRvIGJlIGRlbGV0ZWQKKyAgICAgICAgICAgIGlmIChwTWFjLT5saW0uZ0xpbUlic3NQZWVyTGlzdCA9PSBwVGVtcE5vZGUpIC8qKiBGaXJzdCBOb2RlIHRvIGJlIGRlbGV0ZWQqLworICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltSWJzc1BlZXJMaXN0ID0gcFRlbXBOb2RlLT5uZXh0OworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHBQcmV2Tm9kZS0+bmV4dCA9IHBUZW1wTm9kZS0+bmV4dDsKKworICAgICAgICAgICAgaWYocFRlbXBOb2RlLT5iZWFjb24pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBUZW1wTm9kZS0+YmVhY29uKTsKKyAgICAgICAgICAgICAgICBwVGVtcE5vZGUtPmJlYWNvbiA9IE5VTEw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocFRlbXBOb2RlKTsKKyAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltTnVtSWJzc1BlZXJzLS07CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBwUHJldk5vZGUgPSBwVGVtcE5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gKHBNYWMtPmxpbS5wcm90U3RhQ2FjaGVbaV0uYWN0aXZlKQorICAgICAgeworICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiQWRkcjogIikpOworICAgICAgICAgIGxpbVByaW50TWFjQWRkcihwTWFjLCBwTWFjLT5saW0ucHJvdFN0YUNhY2hlW2ldLmFkZHIsIExPRzEpOworCisgICAgICAgICAgaWYgKHZvc19tZW1fY29tcGFyZShwTWFjLT5saW0ucHJvdFN0YUNhY2hlW2ldLmFkZHIsCisgICAgICAgICAgICAgIHBlZXJNYWNBZGRyLCBzaXplb2YodFNpck1hY0FkZHIpKSkKKyAgICAgICAgICB7CisgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgibWF0Y2hpbmcgY2FjaGUgZW50cnkgYXQgJWQgYWxyZWFkeSBhY3RpdmUuIiksIGkpOworICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgfQorICAgICAgfQorICB9CisKKyAgZm9yIChpPTA7IGk8TElNX1BST1RfU1RBX0NBQ0hFX1NJWkU7IGkrKykKKyAgeworICAgICAgaWYgKCFwTWFjLT5saW0ucHJvdFN0YUNhY2hlW2ldLmFjdGl2ZSkKKyAgICAgICAgICBicmVhazsKKyAgfQorCisgIGlmIChpID49IExJTV9QUk9UX1NUQV9DQUNIRV9TSVpFKQorICB7CisgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJObyBzcGFjZSBpbiBQcm90U3RhQ2FjaGUiKSk7KQorICAgICAgcmV0dXJuOworICB9CisKKyAgdm9zX21lbV9jb3B5KHBNYWMtPmxpbS5wcm90U3RhQ2FjaGVbaV0uYWRkciwKKyAgICAgICAgICAgICAgIHBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisKKyAgcE1hYy0+bGltLnByb3RTdGFDYWNoZVtpXS5wcm90U3RhQ2FjaGVUeXBlID0gcHJvdFN0YUN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cmVzcyBvZiB0aGUgcGVlciBiZWluZyBhZGRlZAorICogQHJldHVybiByZXRDb2RlICAgIEluZGljYXRlcyBzdWNjZXNzIG9yIGZhaWx1cmUgcmV0dXJuIGNvZGUKKyAqIEByZXR1cm4KKyAqLworCit0U2lyUmV0U3RhdHVzCitsaW1JYnNzU3RhQWRkKAorICAgIHRwQW5pU2lyR2xvYmFsICBwTWFjLAorICAgIHZvaWQgKnBCb2R5LAorICAgIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpCit7CisgICAgdFNpclJldFN0YXR1cyAgICAgICByZXRDb2RlID0gZVNJUl9TVUNDRVNTOworICAgIHRwRHBoSGFzaE5vZGUgICAgICAgcFN0YURzOworICAgIHRMaW1JYnNzUGVlck5vZGUgICAgKnBQZWVyTm9kZTsKKyAgICB0TGltTWxtU3RhdGVzICAgICAgIHByZXZTdGF0ZTsKKyAgICB0U2lyTWFjQWRkciAgICAgICAgICpwUGVlckFkZHIgPSAodFNpck1hY0FkZHIgKikgcEJvZHk7CisgICAgdFVwZGF0ZUJlYWNvblBhcmFtcyBiZWFjb25QYXJhbXM7IAorCisgICAgdm9zX21lbV9zZXQoKHRBTklfVTggKikgJmJlYWNvblBhcmFtcywgc2l6ZW9mKHRVcGRhdGVCZWFjb25QYXJhbXMpLCAwKTsKKworICAgIGlmIChwQm9keSA9PSAwKQorICAgIHsKKyAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiSW52YWxpZCBJQlNTIEFkZFN0YSIpKTspCisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorCisgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiUnggQWRkLUlic3MtU3RhIGZvciBNQUM6IikpOykKKyAgICBsaW1QcmludE1hY0FkZHIocE1hYywgKnBQZWVyQWRkciwgTE9HRSk7CisKKyAgICBwUGVlck5vZGUgPSBpYnNzX3BlZXJfZmluZChwTWFjLCAqcFBlZXJBZGRyKTsKKyAgICBpZiAoTlVMTCAhPSBwUGVlck5vZGUpCisgICAgeworICAgICAgICByZXRDb2RlID0gaWJzc19kcGhfZW50cnlfYWRkKHBNYWMsICpwUGVlckFkZHIsICZwU3RhRHMsIHBzZXNzaW9uRW50cnkpOworICAgICAgICBpZiAoZVNJUl9TVUNDRVNTID09IHJldENvZGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIHByZXZTdGF0ZSA9IHBTdGFEcy0+bWxtU3RhQ29udGV4dC5tbG1TdGF0ZTsKKyAgICAgICAgICAgIHBTdGFEcy0+ZXJwRW5hYmxlZCA9IHBQZWVyTm9kZS0+ZXJwSWVQcmVzZW50OworCisgICAgICAgICAgICBpYnNzX3N0YV9pbmZvX3VwZGF0ZShwTWFjLCBwU3RhRHMsIHBQZWVyTm9kZSwgcHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICBQRUxPR1cobGltTG9nKHBNYWMsIExPR1csIEZMKCJpbml0aWF0aW5nIEFERCBTVEEgZm9yIHRoZSBJQlNTIHBlZXIuIikpOykKKyAgICAgICAgICAgIHJldENvZGUgPSBsaW1BZGRTdGEocE1hYywgcFN0YURzLCBmYWxzZSwgcHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICBpZiAocmV0Q29kZSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiaWJzcy1zdGEtYWRkIGZhaWxlZCAocmVhc29uICV4KSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0Q29kZSk7KQorICAgICAgICAgICAgICAgIGxpbVByaW50TWFjQWRkcihwTWFjLCAqcFBlZXJBZGRyLCBMT0dFKTsKKyAgICAgICAgICAgICAgICBwU3RhRHMtPm1sbVN0YUNvbnRleHQubWxtU3RhdGUgPSBwcmV2U3RhdGU7CisgICAgICAgICAgICAgICAgZHBoRGVsZXRlSGFzaEVudHJ5KHBNYWMsIHBTdGFEcy0+c3RhQWRkciwgcFN0YURzLT5hc3NvY0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcHNlc3Npb25FbnRyeS0+ZHBoLmRwaEhhc2hUYWJsZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYocE1hYy0+bGltLmdMaW1Qcm90ZWN0aW9uQ29udHJvbCAhPSBXTklfQ0ZHX0ZPUkNFX1BPTElDWV9QUk9URUNUSU9OX0RJU0FCTEUpCisgICAgICAgICAgICAgICAgICAgIGxpbUlic3NEZWNpZGVQcm90ZWN0aW9uKHBNYWMsIHBTdGFEcywgJmJlYWNvblBhcmFtcyAsIHBzZXNzaW9uRW50cnkpOworCisgICAgICAgICAgICAgICAgaWYoYmVhY29uUGFyYW1zLnBhcmFtQ2hhbmdlQml0bWFwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiLS0tPiBVcGRhdGUgQmVhY29uIFBhcmFtcyAiKSk7KQorICAgICAgICAgICAgICAgICAgICBzY2hTZXRGaXhlZEJlYWNvbkZpZWxkcyhwTWFjLCBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgYmVhY29uUGFyYW1zLmJzc0lkeCA9IHBzZXNzaW9uRW50cnktPmJzc0lkeDsKKyAgICAgICAgICAgICAgICAgICAgbGltU2VuZEJlYWNvblBhcmFtcyhwTWFjLCAmYmVhY29uUGFyYW1zLCBwc2Vzc2lvbkVudHJ5ICk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiaGFzaFRibEFkZCBmYWlsZWQgKHJlYXNvbiAleCkiKSwgcmV0Q29kZSk7KQorICAgICAgICAgICAgbGltUHJpbnRNYWNBZGRyKHBNYWMsICpwUGVlckFkZHIsIExPR0UpOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHJldENvZGUgPSBlU0lSX0ZBSUxVUkU7CisgICAgfQorCisgICAgcmV0dXJuIHJldENvZGU7Cit9CisKKy8qIGhhbmRsZSB0aGUgcmVzcG9uc2UgZnJvbSBIQUwgZm9yIGFuIEFERCBTVEEgcmVxdWVzdCAqLwordFNpclJldFN0YXR1cworbGltSWJzc0FkZFN0YVJzcCgKKyAgICB0cEFuaVNpckdsb2JhbCAgcE1hYywKKyAgICB2b2lkICptc2csdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSkKK3sKKyAgICB0cERwaEhhc2hOb2RlICAgcFN0YURzOworICAgIHRBTklfVTE2ICAgICAgICBwZWVySWR4OworICAgIHRwQWRkU3RhUGFyYW1zICBwQWRkU3RhUGFyYW1zID0gKHRwQWRkU3RhUGFyYW1zKSBtc2c7CisKKyAgICBTRVRfTElNX1BST0NFU1NfREVGRF9NRVNHUyhwTWFjLCB0cnVlKTsKKyAgICBpZiAocEFkZFN0YVBhcmFtcyA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiSUJTUzogQUREX1NUQV9SU1Agd2l0aCBubyBib2R5ISIpKTspCisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorCisgICAgcFN0YURzID0gZHBoTG9va3VwSGFzaEVudHJ5KHBNYWMsIHBBZGRTdGFQYXJhbXMtPnN0YU1hYywgJnBlZXJJZHgsICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsKKyAgICBpZiAocFN0YURzID09IE5VTEwpCisgICAgeworICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJJQlNTOiBBRERfU1RBX1JTUCBmb3IgdW5rbm93biBNQUMgYWRkciAiKSk7KQorICAgICAgICBsaW1QcmludE1hY0FkZHIocE1hYywgcEFkZFN0YVBhcmFtcy0+c3RhTWFjLCBMT0dFKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBBZGRTdGFQYXJhbXMpOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKworICAgIGlmIChwQWRkU3RhUGFyYW1zLT5zdGF0dXMgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIklCU1M6IEFERF9TVEFfUlNQIGVycm9yICgleCkgIiksIHBBZGRTdGFQYXJhbXMtPnN0YXR1cyk7KQorICAgICAgICBsaW1QcmludE1hY0FkZHIocE1hYywgcEFkZFN0YVBhcmFtcy0+c3RhTWFjLCBMT0dFKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBBZGRTdGFQYXJhbXMpOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKworICAgIHBTdGFEcy0+YnNzSWQgICAgICAgICAgICAgICAgICA9IHBBZGRTdGFQYXJhbXMtPmJzc0lkeDsKKyAgICBwU3RhRHMtPnN0YUluZGV4ICAgICAgICAgICAgICAgPSBwQWRkU3RhUGFyYW1zLT5zdGFJZHg7CisgICAgcFN0YURzLT51Y1VjYXN0U2lnICAgICAgICAgICAgID0gcEFkZFN0YVBhcmFtcy0+dWNVY2FzdFNpZzsKKyAgICBwU3RhRHMtPnVjQmNhc3RTaWcgICAgICAgICAgICAgPSBwQWRkU3RhUGFyYW1zLT51Y0JjYXN0U2lnOworICAgIHBTdGFEcy0+dmFsaWQgICAgICAgICAgICAgICAgICA9IDE7CisgICAgcFN0YURzLT5tbG1TdGFDb250ZXh0Lm1sbVN0YXRlID0gZUxJTV9NTE1fTElOS19FU1RBQkxJU0hFRF9TVEFURTsKKworICAgIFBFTE9HVyhsaW1Mb2cocE1hYywgTE9HVywgRkwoIklCU1M6IHNlbmRpbmcgSUJTU19ORVdfUEVFUiBtc2cgdG8gU01FISIpKTspCisKKyAgICBpYnNzX3N0YXR1c19jaGdfbm90aWZ5KHBNYWMsIHBBZGRTdGFQYXJhbXMtPnN0YU1hYywgcFN0YURzLT5zdGFJbmRleCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPnVjVWNhc3RTaWcsIHBTdGFEcy0+dWNCY2FzdFNpZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGVXTklfU01FX0lCU1NfTkVXX1BFRVJfSU5ELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+c21lU2Vzc2lvbklkKTsKKyAgICB2b3NfbWVtX2ZyZWUocEFkZFN0YVBhcmFtcyk7CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworfQorCisKKwordm9pZCBsaW1JYnNzRGVsQnNzUnNwV2hlbkNvYWxlc2NpbmcodHBBbmlTaXJHbG9iYWwgIHBNYWMsICB2b2lkICptc2csdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSkKK3sKKyAgIHRwRGVsZXRlQnNzUGFyYW1zIHBEZWxCc3MgPSAodHBEZWxldGVCc3NQYXJhbXMpIG1zZzsKKworICAgIFBFTE9HVyhsaW1Mb2cocE1hYywgTE9HVywgRkwoIklCU1M6IERFTF9CU1NfUlNQIFJjdmQgZHVyaW5nIGNvYWxlc2NpbmchIikpOykKKworICAgIGlmIChwRGVsQnNzID09IE5VTEwpCisgICAgeworICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJJQlNTOiBERUxfQlNTX1JTUChjb2FsZXNjZSkgd2l0aCBubyBib2R5ISIpKTspCisgICAgICAgIGdvdG8gZW5kOworICAgIH0KKworICAgIGlmIChwRGVsQnNzLT5zdGF0dXMgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiSUJTUzogREVMX0JTU19SU1AoY29hbGVzY2UpIGVycm9yICgleCkgQnNzICVkICIpLAorICAgICAgICAgICAgICAgcERlbEJzcy0+c3RhdHVzLCBwRGVsQnNzLT5ic3NJZHgpOworICAgICAgICBnb3RvIGVuZDsKKyAgICB9CisgICAgLy9EZWxldGUgcGVlciBlbnRyaWVzLgorICAgIGxpbUlic3NEZWxldGVBbGxQZWVycyhwTWFjLHBzZXNzaW9uRW50cnkpOworCisgICAgLyogYWRkIHRoZSBuZXcgYnNzICovCisgICAgaWJzc19ic3NfYWRkKHBNYWMscHNlc3Npb25FbnRyeSk7CisKKyAgICBlbmQ6CisgICAgaWYocERlbEJzcyAhPSBOVUxMKQorICAgICAgICB2b3NfbWVtX2ZyZWUocERlbEJzcyk7Cit9CisKKworCit2b2lkIGxpbUlic3NBZGRCc3NSc3BXaGVuQ29hbGVzY2luZyh0cEFuaVNpckdsb2JhbCAgcE1hYywgdm9pZCAqbXNnLCB0cFBFU2Vzc2lvbiBwU2Vzc2lvbkVudHJ5KQoreworICAgIHRBTklfVTggICAgICAgICAgIGluZm9MZW47CisgICAgdFNpclNtZU5ld0Jzc0luZm8gbmV3QnNzSW5mbzsKKworICAgIHRwQWRkQnNzUGFyYW1zIHBBZGRCc3MgPSAodHBBZGRCc3NQYXJhbXMpIG1zZzsKKworICAgIHRwU2lyTWFjTWdtdEhkciAgIHBIZHIgICAgPSAodHBTaXJNYWNNZ210SGRyKSAgIHBNYWMtPmxpbS5pYnNzSW5mby5wSGRyOworICAgIHRwU2NoQmVhY29uU3RydWN0IHBCZWFjb24gPSAodHBTY2hCZWFjb25TdHJ1Y3QpIHBNYWMtPmxpbS5pYnNzSW5mby5wQmVhY29uOworCisgICAgaWYgKChwSGRyID09IE5VTEwpIHx8IChwQmVhY29uID09IE5VTEwpKQorICAgIHsKKyAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiVW5hYmxlIHRvIGhhbmRsZSBBZGRCc3NSc3BXaGVuQ29hbGVzY2luZyAobm8gY2FjaGVkIEJTUyBpbmZvKSIpKTspCisgICAgICAgIGdvdG8gZW5kOworICAgIH0KKworICAgIC8vIEluZm9ybSBIb3N0IG9mIElCU1MgY29hbGVzY2luZworICAgIGluZm9MZW4gPSBzaXplb2YodFNpck1hY0FkZHIpICsgc2l6ZW9mKHRTaXJNYWNDaGFuTnVtKSArCisgICAgICAgICAgICAgIHNpemVvZih0QU5JX1U4KSArIHBCZWFjb24tPnNzSWQubGVuZ3RoICsgMTsKKworICAgIHZvc19tZW1fc2V0KCh2b2lkICopICZuZXdCc3NJbmZvLCBzaXplb2YobmV3QnNzSW5mbyksIDApOworICAgIHZvc19tZW1fY29weShuZXdCc3NJbmZvLmJzc0lkLCBwSGRyLT5ic3NJZCwgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgbmV3QnNzSW5mby5jaGFubmVsTnVtYmVyID0gKHRTaXJNYWNDaGFuTnVtKSBwQWRkQnNzLT5jdXJyZW50T3BlckNoYW5uZWw7CisgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4ICopICZuZXdCc3NJbmZvLnNzSWQsCisgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopICZwQmVhY29uLT5zc0lkLCBwQmVhY29uLT5zc0lkLmxlbmd0aCArIDEpOworCisgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiU2VuZGluZyBKT0lORURfTkVXX0JTUyBub3RpZmljYXRpb24gdG8gU01FLiIpKTspCisKKyAgICBsaW1TZW5kU21lV21TdGF0dXNDaGFuZ2VOdGYocE1hYywgZVNJUl9TTUVfSk9JTkVEX05FV19CU1MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1UzMiAqKSAmbmV3QnNzSW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5mb0xlbixwU2Vzc2lvbkVudHJ5LT5zbWVT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U2lnID0gcFN0YURzLT51Y1VjYXN0U2lnOworICAgICAgICAgICAgdWNCY2FzdFNpZyA9IHBTdGFEcy0+dWNCY2FzdFNpZzsKKworICAgICAgICAgICAgKHZvaWQpIGxpbURlbFN0YShwTWFjLCBwU3RhRHMsIGZhbHNlIC8qYXN5bmNocm9ub3VzKi8sIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgbGltRGVsZXRlRHBoSGFzaEVudHJ5KHBNYWMsIHBTdGFEcy0+c3RhQWRkciwgcGVlcklkeCwgcHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICBsaW1SZWxlYXNlUGVlcklkeChwTWFjLCBwZWVySWR4LCBwc2Vzc2lvbkVudHJ5KTsKKworICAgICAgICAgICAgLyogU2VuZCBpbmRpY2F0aW9uIHRvIHVwcGVyIGxheWVycyAqLworICAgICAgICAgICAgaWJzc19zdGF0dXNfY2hnX25vdGlmeShwTWFjLCBtYWNBZGRyLCBzdGFJbmRleCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWNVY2FzdFNpZywgdWNCY2FzdFNpZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVdOSV9TTUVfSUJTU19QRUVSX0RFUEFSVEVEX0lORCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+c21lU2Vzc2lvbklkICk7CisgICAgICAgICAgICBpZiAocFRlbXBOb2RlID09IHBNYWMtPmxpbS5nTGltSWJzc1BlZXJMaXN0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1JYnNzUGVlckxpc3QgPSBwVGVtcE5vZGUtPm5leHQ7CisgICAgICAgICAgICAgICBwUHJldk5vZGUgPSBwTWFjLT5saW0uZ0xpbUlic3NQZWVyTGlzdDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgIHBQcmV2Tm9kZS0+bmV4dCA9IHBUZW1wTm9kZS0+bmV4dDsKKworICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBUZW1wTm9kZSk7CisgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbU51bUlic3NQZWVycy0tOworCisgICAgICAgICAgICBwVGVtcE5vZGUgPSBwVGVtcE5leHROb2RlOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisgICAgICB9CisgICAgICBwUHJldk5vZGUgPSBwVGVtcE5vZGU7CisgICAgICBwVGVtcE5vZGUgPSBwVGVtcE5leHROb2RlOworICAgfQorICAgLyoKKyAgICAqIGlmIGl0IGlzIHRoZSBsYXN0IHBlZXIgd2Fsa2luZyBvdXQsIHdlIGJldHRlcgorICAgICogd2Ugc2V0IElCU1Mgc3RhdGUgdG8gaW5hY3RpdmUuCisgICAgKi8KKyAgIGlmICgwID09IHBNYWMtPmxpbS5nTGltTnVtSWJzc1BlZXJzKQorICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1BFLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICJMYXN0IFNUQSBmcm9tIElCU1Mgd2Fsa2VkIG91dCIpOworICAgICAgIHBzZXNzaW9uRW50cnktPmxpbUlic3NBY3RpdmUgPSBmYWxzZTsKKyAgIH0KK30KKworLyoqCisgKiBsaW1JYnNzQ29hbGVzY2UoKQorICoKKyAqRlVOQ1RJT046CisgKiBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCB1cG9uIHJlY2VpdmluZyBCZWFjb24vUHJvYmUgUmVzcG9uc2UKKyAqIHdoaWxlIG9wZXJhdGluZyBpbiBJQlNTIG1vZGUuCisgKgorICpMT0dJQzoKKyAqCisgKkFTU1VNUFRJT05TOgorICoKKyAqTk9URToKKyAqCisgKiBAcGFyYW0gIHBNYWMgICAgLSBQb2ludGVyIHRvIEdsb2JhbCBNQUMgc3RydWN0dXJlCisgKiBAcGFyYW0gIHBCZWFjb24gLSBQYXJzZWQgQmVhY29uIEZyYW1lIHN0cnVjdHVyZQorICogQHBhcmFtICBwQkQgICAgIC0gUG9pbnRlciB0byByZWNlaXZlZCBCRAorICoKKyAqIEByZXR1cm4gU3RhdHVzIHdoZXRoZXIgdG8gcHJvY2VzcyBvciBpZ25vcmUgcmVjZWl2ZWQgQmVhY29uIEZyYW1lCisgKi8KKwordFNpclJldFN0YXR1cworbGltSWJzc0NvYWxlc2NlKAorICAgIHRwQW5pU2lyR2xvYmFsICAgICAgcE1hYywKKyAgICB0cFNpck1hY01nbXRIZHIgICAgIHBIZHIsCisgICAgdHBTY2hCZWFjb25TdHJ1Y3QgICBwQmVhY29uLAorICAgIHRBTklfVTggICAgICAgICAgICAgICpwSUVzLAorICAgIHRBTklfVTMyICAgICAgICAgICAgaWVMZW4sCisgICAgdEFOSV9VMTYgICAgICAgICAgICBmVHNmTGF0ZXIsCisgICAgdHBQRVNlc3Npb24gICAgICAgICBwc2Vzc2lvbkVudHJ5KQoreworICAgIHRBTklfVTE2ICAgICAgICAgICAgcGVlcklkeDsKKyAgICB0U2lyTWFjQWRkciAgICAgICAgIGN1cnJlbnRCc3NJZDsKKyAgICB0TGltSWJzc1BlZXJOb2RlICAgICpwUGVlck5vZGU7CisgICAgdHBEcGhIYXNoTm9kZSAgICAgICBwU3RhRHM7CisgICAgdFVwZGF0ZUJlYWNvblBhcmFtcyBiZWFjb25QYXJhbXM7CisKKyAgICB2b3NfbWVtX3NldCgodEFOSV9VOCAqKSZiZWFjb25QYXJhbXMsIHNpemVvZih0VXBkYXRlQmVhY29uUGFyYW1zKSwgMCk7CisKKyAgICBzaXJDb3B5TWFjQWRkcihjdXJyZW50QnNzSWQscHNlc3Npb25FbnRyeS0+YnNzSWQpOworCisgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJDdXJyZW50IEJTU0lEIDoiIE1BQ19BRERSRVNTX1NUUiAiIFJlY2VpdmVkIEJTU0lEIDoiIE1BQ19BRERSRVNTX1NUUiApLAorICAgICAgICAg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0aGVuLCBpbnZva2UgZGVsU3RhKCkgdG8gY2xlYW51cCB0aGUgZW50cmllcy4gV2Ugd2lsbAorICAgICAgICAqIGxldCB0aGUgcGVlciBjb2FsZXNjZSB3aGVuIHdlIHJlY2VpdmUgbmV4dCBiZWFjb24gZnJvbSB0aGUgcGVlcgorICAgICAgICAqLworICAgICAgIHBQZWVyTm9kZSA9IGlic3NfcGVlcl9maW5kKHBNYWMsIHBIZHItPnNhKTsKKyAgICAgICBpZiAoTlVMTCAhPSBwUGVlck5vZGUpCisgICAgICAgeworICAgICAgICAgIF9fbGltSWJzc1NlYXJjaEFuZERlbGV0ZVBlZXIgKHBNYWMsIHBzZXNzaW9uRW50cnksIHBIZHItPnNhKTsKKyAgICAgICAgICBQRUxPR1cobGltTG9nKHBNYWMsIExPR1csCisgICAgICAgICAgICAgICBGTCgiKiogUGVlciBhdHRlbXB0aW5nIHRvIHJlY29ubmVjdCBiZWZvcmUgSEIgdGltZW91dCwgZGVsZXRlZCAqKiIpKTspCisgICAgICAgICAgcmV0dXJuIGVTSVJfTElNX0lHTk9SRV9CRUFDT047CisgICAgICAgfQorCisgICAgICAgaWYgKCEgZlRzZkxhdGVyKSAvLyBObyBDb2FsZXNjaW5nIGhhcHBlbmVkLgorICAgICAgIHsKKyAgICAgICAgICBQRUxPR1cobGltTG9nKHBNYWMsIExPR1csIEZMKCJObyBDb2FsZXNjaW5nIGhhcHBlbmVkIikpOykKKyAgICAgICAgICByZXR1cm4gZVNJUl9MSU1fSUdOT1JFX0JFQUNPTjsKKyAgICAgICB9CisgICAgICAgLyoKKyAgICAgICAgKiBJQlNTIENvYWxlc2NpbmcgaGFwcGVuZWQuCisgICAgICAgICogc2F2ZSB0aGUgcmVjZWl2ZWQgYmVhY29uLCBhbmQgZGVsZXRlIHRoZSBjdXJyZW50IEJTUy4gVGhlIHJlc3Qgb2YgdGhlCisgICAgICAgICogcHJvY2Vzc2luZyB3aWxsIGJlIGRvbmUgaW4gdGhlIGRlbEJzcyByZXNwb25zZSBwcm9jZXNzaW5nCisgICAgICAgICovCisgICAgICAgcE1hYy0+bGltLmdMaW1JYnNzQ29hbGVzY2luZ0hhcHBlbmVkID0gdHJ1ZTsKKyAgICAgICBQRUxPR1cobGltTG9nKHBNYWMsIExPR1csIEZMKCJJQlNTIENvYWxlc2NpbmcgaGFwcGVuZWQiKSk7KQorICAgICAgICAgIGlic3NfY29hbGVzY2Vfc2F2ZShwTWFjLCBwSGRyLCBwQmVhY29uKTsKKyAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgRkwoIkRlbGV0ZSBCU1NJRCA6IiBNQUNfQUREUkVTU19TVFIgKSwKKyAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShjdXJyZW50QnNzSWQpKTsKKyAgICAgICBpYnNzX2Jzc19kZWxldGUocE1hYyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgIGlmICghdm9zX21lbV9jb21wYXJlKGN1cnJlbnRCc3NJZCwgcEhkci0+YnNzSWQsIHNpemVvZiggdFNpck1hY0FkZHIgKSkpCisgICAgICAgICAgIHJldHVybiBlU0lSX0xJTV9JR05PUkVfQkVBQ09OOworICAgIH0KKworCisgICAgLy8gU1RBIGluIElCU1MgbW9kZSBhbmQgU1NJRCBtYXRjaGVzIHdpdGggb3VycworICAgIHBQZWVyTm9kZSA9IGlic3NfcGVlcl9maW5kKHBNYWMsIHBIZHItPnNhKTsKKyAgICBpZiAocFBlZXJOb2RlID09IE5VTEwpCisgICAgeworICAgICAgICAvKiBQZWVyIG5vdCBpbiB0aGUgbGlzdCAtIENvbGxlY3QgQlNTIGRlc2NyaXB0aW9uICYgYWRkIHRvIHRoZSBsaXN0ICovCisgICAgICAgIHRBTklfVTMyICAgICAgZnJhbWVMZW47CisgICAgICAgIHRTaXJSZXRTdGF0dXMgcmV0Q29kZTsKKworICAgICAgICAvKgorICAgICAgICAgKiBMaW1pdCB0aGUgTWF4IG51bWJlciBvZiBJQlNTIFBlZXJzIGFsbG93ZWQgYXMgdGhlIG1heAorICAgICAgICAgKiBudW1iZXIgb2YgU1RBJ3MgYWxsb3dlZAorICAgICAgICAgKiBwTWFjLT5saW0uZ0xpbU51bUlic3NQZWVycyB3aWxsIGJlIGluY3JlYW1lbnRlZCBhZnRlciBleGl0aW5nCisgICAgICAgICAqIHRoaXMgZnVuY3Rpb24uIHNvIHdlIHdpbGwgYWRkIGFkZGl0aW9uYWwgMSB0byBjb21wYXJlIGFnYWluc3QKKyAgICAgICAgICogcE1hYy0+bGltLmdMaW1JYnNzU3RhTGltaXQKKyAgICAgICAgICovCisgICAgICAgIGlmICgocE1hYy0+bGltLmdMaW1OdW1JYnNzUGVlcnMrMSkgPj0gcE1hYy0+bGltLmdMaW1JYnNzU3RhTGltaXQpCisgICAgICAgIHsgICAvKlByaW50IGV2ZXJ5IDEwMHRoIHRpbWUgKi8KKyAgICAgICAgICAgIGlmIChwTWFjLT5saW0uZ0xpbUlic3NSZXRyeUNudCAlIDEwMCA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCIqKioqIE1BWCBTVEEgTElNSVQgSEFTIFJFQUNIRUQgKioqKiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltSWJzc1JldHJ5Q250Kys7CisgICAgICAgICAgICByZXR1cm4gZVNJUl9MSU1fTUFYX1NUQV9SRUFDSEVEX0VSUk9SOworICAgICAgICB9CisgICAgICAgIFBFTE9HVyhsaW1Mb2cocE1hYywgTE9HVywgRkwoIklCU1MgUGVlciBub2RlIGRvZXMgbm90IGV4aXN0LCBhZGRpbmcgaXQqKioiKSk7KQorICAgICAgICBmcmFtZUxlbiA9IHNpemVvZih0TGltSWJzc1BlZXJOb2RlKSArIGllTGVuIC0gc2l6ZW9mKHRBTklfVTMyKTsKKworICAgICAgICBwUGVlck5vZGUgPSB2b3NfbWVtX21hbGxvYygodEFOSV9VMTYpZnJhbWVMZW4pOworICAgICAgICBpZiAoTlVMTCA9PSBwUGVlck5vZGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiYWxsb2MgZmFpbCAoJWQgYnl0ZXMpIHN0b3JpbmcgSUJTUyBwZWVyIGluZm8iKSwKKyAgICAgICAgICAgICAgICAgICBmcmFtZUxlbik7CisgICAgICAgICAgICByZXR1cm4gZVNJUl9NRU1fQUxMT0NfRkFJTEVEOworICAgICAgICB9CisKKyAgICAgICAgcFBlZXJOb2RlLT5iZWFjb24gPSBOVUxMOworICAgICAgICBwUGVlck5vZGUtPmJlYWNvbkxlbiA9IDA7CisKKyAgICAgICAgaWJzc19wZWVyX2NvbGxlY3QocE1hYywgcEJlYWNvbiwgcEhkciwgcFBlZXJOb2RlLHBzZXNzaW9uRW50cnkpOworICAgICAgICBwUGVlck5vZGUtPmJlYWNvbiA9IHZvc19tZW1fbWFsbG9jKGllTGVuKTsKKyAgICAgICAgaWYgKE5VTEwgPT0gcFBlZXJOb2RlLT5iZWFjb24pCisgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJVbmFibGUgdG8gYWxsb2NhdGUgbWVtb3J5IHRvIHN0b3JlIGJlYWNvbiIpKTspCisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocFBlZXJOb2RlLT5iZWFjb24sIHBJRXMsIGllTGVuKTsKKyAgICAgICAgICAgIHBQZWVyTm9kZS0+YmVhY29uTGVuID0gKHRBTklfVTE2KWllTGVuOworICAgICAgICB9CisgICAgICAgIGlic3NfcGVlcl9hZGQocE1hYywgcFBlZXJOb2RlKTsKKworICAgICAgICBwU3RhRHMgPSBkcGhMb29rdXBIYXNoRW50cnkocE1hYywgcFBlZXJOb2RlLT5wZWVyTWFjQWRkciwgJnBlZXJJZHgsICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsKKyAgICAgICAgaWYgKHBTdGFEcyAhPSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgICAvLy8gRFBIIG5vZGUgYWxyZWFkeSBleGlzdHMgZm9yIHRoZSBwZWVyCisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIkRQSCBOb2RlIHByZXNlbnQgZm9yIGp1c3QgbGVhcm5lZCBwZWVyIikpOworICAgICAgICAgICAgbGltUHJpbnRNYWNBZGRyKHBNYWMsIHBQZWVyTm9kZS0+cGVlck1hY0FkZHIsIExPRzEpOworICAgICAgICAgICAgaWJzc19zdGFfaW5mb191cGRhdGUocE1hYywgcFN0YURzLCBwUGVlck5vZGUscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworICAgICAgICB9CisgICAgICAgIHJldENvZGUgPSBsaW1JYnNzU3RhQWRkKHBNYWMsIHBQZWVyTm9kZS0+cGVlck1hY0FkZHIscHNlc3Npb25FbnRyeSk7CisgICAgICAgIGlmIChyZXRDb2RlICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgibGltLWlic3Mtc3RhLWFkZCBmYWlsZWQgKHJlYXNvbiAleCkiKSwgcmV0Q29kZSk7KQorICAgICAgICAgICAgbGltUHJpbnRNYWNBZGRyKHBNYWMsIHBQZWVyTm9kZS0+cGVlck1hY0FkZHIsIExPR0UpOworICAgICAgICAgICAgcmV0dXJuIHJldENvZGU7CisgICAgICAgIH0KKworICAgICAgICAvLyBEZWNpZGUgcHJvdGVjdGlvbiBtb2RlCisgICAgICAgIHBTdGFEcyA9IGRwaExvb2t1cEhhc2hFbnRyeShwTWFjLCBwUGVlck5vZGUtPnBlZXJNYWNBZGRyLCAmcGVlckl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VGVtcE5vZGUtPmhlYXJ0YmVhdEZhaWx1cmUrKzsKKyAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkhlYXJ0YmVhdCBmYWlsID0gJWQgIHRocmVzID0gJWQiKSwgcFRlbXBOb2RlLT5oZWFydGJlYXRGYWlsdXJlLCBwTWFjLT5saW0uZ0xpbU51bUlic3NQZWVycyk7KQorICAgICAgICAgICAgaWYocFRlbXBOb2RlLT5oZWFydGJlYXRGYWlsdXJlID49IHRocmVzaG9sZCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9SZW1vdmUgdGhpcyBlbnRyeSBmcm9tIHRoZSBsaXN0LgorICAgICAgICAgICAgICAgIHBTdGFEcyA9IGRwaExvb2t1cEhhc2hFbnRyeShwTWFjLCBwVGVtcE5vZGUtPnBlZXJNYWNBZGRyLCAmcGVlcklkeCwgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUpOworICAgICAgICAgICAgICAgIGlmIChwU3RhRHMpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzdGFJbmRleCA9IHBTdGFEcy0+c3RhSW5kZXg7CisgICAgICAgICAgICAgICAgICAgIHVjVWNhc3RTaWcgPSBwU3RhRHMtPnVjVWNhc3RTaWc7CisgICAgICAgICAgICAgICAgICAgIHVjQmNhc3RTaWcgPSBwU3RhRHMtPnVjQmNhc3RTaWc7CisKKyAgICAgICAgICAgICAgICAgICAgKHZvaWQpIGxpbURlbFN0YShwTWFjLCBwU3RhRHMsIGZhbHNlIC8qYXN5bmNocm9ub3VzKi8scHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgIGxpbURlbGV0ZURwaEhhc2hFbnRyeShwTWFjLCBwU3RhRHMtPnN0YUFkZHIsIHBlZXJJZHgscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgIGxpbVJlbGVhc2VQZWVySWR4KHBNYWMsIHBlZXJJZHgsIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgICAgICAvL1NlbmQgaW5kaWNhdGlvbi4KKyAgICAgICAgICAgICAgICAgICAgaWJzc19zdGF0dXNfY2hnX25vdGlmeSggcE1hYywgcFRlbXBOb2RlLT5wZWVyTWFjQWRkciwgc3RhSW5kZXgsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1Y1VjYXN0U2lnLCB1Y0JjYXN0U2lnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlV05JX1NNRV9JQlNTX1BFRVJfREVQQVJURURfSU5ELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5zbWVTZXNzaW9uSWQgKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYocFRlbXBOb2RlID09IHBNYWMtPmxpbS5nTGltSWJzc1BlZXJMaXN0KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1JYnNzUGVlckxpc3QgPSBwVGVtcE5vZGUtPm5leHQ7CisgICAgICAgICAgICAgICAgICAgIHBQcmV2Tm9kZSA9IHBNYWMtPmxpbS5nTGltSWJzc1BlZXJMaXN0OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHBQcmV2Tm9kZS0+bmV4dCA9IHBUZW1wTm9kZS0+bmV4dDsKKworICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwVGVtcE5vZGUpOworICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltTnVtSWJzc1BlZXJzLS07CisKKyAgICAgICAgICAgICAgICBwVGVtcE5vZGUgPSBwVGVtcE5leHROb2RlOyAvL1NpbmNlIHdlIGRlbGV0ZWQgY3VycmVudCBub2RlLCBwcmV2Tm9kZSByZW1haW5zIHNhbWUuCisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgfQorICAgICAgICAgfQorCisgICAgICAgIHBQcmV2Tm9kZSA9IHBUZW1wTm9kZTsKKyAgICAgICAgcFRlbXBOb2RlID0gcFRlbXBOZXh0Tm9kZTsKKyAgICB9CisKKyAgICAvKiogR2VuZXJhbCBJQlNTIEFjdGl2aXR5IE1vbml0b3IsIGNoZWNrIGlmIGluIElCU1MgTW9kZSB3ZSBhcmUgcmVjZWl2ZWQgYW55IEJlYWNvbnMgKi8KKyAgICBpZihwTWFjLT5saW0uZ0xpbU51bUlic3NQZWVycykKKyAgICB7CisgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPkxpbVJ4ZWRCZWFjb25DbnREdXJpbmdIQiA8IE1BWF9OT19CRUFDT05TX1BFUl9IRUFSVF9CRUFUX0lOVEVSVkFMKQorICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1IZWFydEJlYXRCZWFjb25TdGF0c1twc2Vzc2lvbkVudHJ5LT5MaW1SeGVkQmVhY29uQ250RHVyaW5nSEJdKys7CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltSGVhcnRCZWF0QmVhY29uU3RhdHNbMF0rKzsKKworICAgICAgICBsaW1SZWFjdGl2YXRlSGVhcnRCZWF0VGltZXIocE1hYywgcHNlc3Npb25FbnRyeSk7CisKKyAgICAgICAgLy8gUmVzZXQgbnVtYmVyIG9mIGJlYWNvbnMgcmVjZWl2ZWQKKyAgICAgICAgbGltUmVzZXRIQlBrdENvdW50KHBzZXNzaW9uRW50cnkpOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIGVsc2UKKyAgICB7CisKKyAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiSGVhcnRiZWF0IEZhaWx1cmUiKSk7KQorICAgICAgICBwTWFjLT5saW0uZ0xpbUhCZmFpbHVyZUNudEluTGlua0VzdFN0YXRlKys7CisKKyAgICAgICAg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IpLAorICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW0xMWJQYXJhbXMubnVtU3RhKTsKKyAgICAgICAgICAgIGxpbVByaW50TWFjQWRkcihwTWFjLCBwU3RhRHMtPnN0YUFkZHIsIExPR0UpOykKKyAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5nTGltMTFiUGFyYW1zLm51bVN0YSA+IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZm9yIChpPTA7IGk8TElNX1BST1RfU1RBX0NBQ0hFX1NJWkU7IGkrKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChwTWFjLT5saW0ucHJvdFN0YUNhY2hlW2ldLmFjdGl2ZSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZvc19tZW1fY29tcGFyZShwTWFjLT5saW0ucHJvdFN0YUNhY2hlW2ldLmFkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+c3RhQWRkciwgc2l6ZW9mKHRTaXJNYWNBZGRyKSkpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbTExYlBhcmFtcy5udW1TdGEtLTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0ucHJvdFN0YUNhY2hlW2ldLmFjdGl2ZSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAocHNlc3Npb25FbnRyeS0+Z0xpbTExYlBhcmFtcy5udW1TdGEgPT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQRUx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jb21lIGhlcmUKKyAgICAqIGZvciBldmVyeSBpbmFjdGl2ZSBwZWVyIGRldmljZQorICAgICovCisgICB0QU5JX1U4ICAgICAgIGk7CisKKyAgIHRTaXJJYnNzUGVlckluYWN0aXZpdHlJbmQgKnBlZXJJbmFjdGl2aXR5SW5kID0KKyAgICAgICh0U2lySWJzc1BlZXJJbmFjdGl2aXR5SW5kICopIGJ1ZjsKKworICAgLyoKKyAgICAqIElmIElCU1MgaXMgbm90IHN0YXJ0ZWQgb3IgaGVhcnRiZWF0IG9mZmxvYWQgaXMgbm90IGVuYWJsZWQKKyAgICAqIHdlIHNob3VsZCBub3QgaGFuZGxlIHRoaXMgcmVxdWVzdAorICAgICovCisgICBpZiAoZUxJTV9TVEFfSU5fSUJTU19ST0xFICE9IHBNYWMtPmxpbS5nTGltU3lzdGVtUm9sZSAmJgorICAgICAgICAgIUlTX0lCU1NfSEVBUlRCRUFUX09GRkxPQURfRkVBVFVSRV9FTkFCTEUpCisgICB7CisgICAgICByZXR1cm47CisgICB9CisKKyAgIC8qKiBJZiBMaW5rTW9uaXRvciBpcyBEaXNhYmxlZCAqLworICAgaWYgKCFwTWFjLT5zeXMuZ1N5c0VuYWJsZUxpbmtNb25pdG9yTW9kZSkKKyAgIHsKKyAgICAgIHJldHVybjsKKyAgIH0KKworICAgZm9yIChpID0gMDsgaSA8IHBNYWMtPmxpbS5tYXhCc3NJZDsgaSsrKQorICAgeworICAgICAgaWYgKFZPU19UUlVFID09IHBNYWMtPmxpbS5ncFNlc3Npb25baV0udmFsaWQgJiYKKyAgICAgICAgICAgIGVTSVJfSUJTU19NT0RFID09IHBNYWMtPmxpbS5ncFNlc3Npb25baV0uYnNzVHlwZSkKKyAgICAgIHsKKyAgICAgICAgIF9fbGltSWJzc1BlZXJJbmFjdGl2aXR5SGFuZGxlcihwTWFjLAorICAgICAgICAgICAgICAgJnBNYWMtPmxpbS5ncFNlc3Npb25baV0sCisgICAgICAgICAgICAgICBwZWVySW5hY3Rpdml0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TXNnLT5zdGFJZCwgcE1zZy0+cmVhc29uQ29kZSk7KQorICAgICAgICAgICAgIGlmIChlTElNX1NUQV9JTl9JQlNTX1JPTEUgPT0gcHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSkKKyAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTXNnKTsKKyAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgIHBTdGFEcyA9IGRwaExvb2t1cEFzc29jSWQocE1hYywgcE1zZy0+c3RhSWQsICZwTXNnLT5hc3NvY0lkLCAmcHNlc3Npb25FbnRyeS0+ZHBoLmRwaEhhc2hUYWJsZSk7CisKKyAgICAgICAgICAgICBpZiAoIXBTdGFEcykKKyAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlNraXAgU1RBIGRlbGV0aW9uIChpbnZhbGlkIFNUQSkgbGltU3lzdGVtUm9sZT0lZCIpLHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUpOykKKyAgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBNc2cpOworICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgLyogY2hlY2sgYW5kIHNlZSBpZiBzYW1lIHN0YUlkLiBUaGlzIGlzIHRvIGF2b2lkIHRoZSBzY2VuYXJpbworICAgICAgICAgICAgICAqIHdoZXJlIHdlJ3JlIHRyeWluZyB0byBkZWxldGUgYSBzdGFJZCB3ZSBqdXN0IGFkZGVkLgorICAgICAgICAgICAgICAqLworICAgICAgICAgICAgIGlmIChwU3RhRHMtPnN0YUluZGV4ICE9IHBNc2ctPnN0YUlkKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgic3RhaWQgbWlzbWF0Y2g6ICVkIHZzICVkICIpLCBwU3RhRHMtPnN0YUluZGV4LCBwTXNnLT5zdGFJZCk7KQorICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocE1zZyk7CisgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICBpZigoZUxJTV9CVF9BTVBfQVBfUk9MRSA9PSBwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlKSB8fAorICAgICAgICAgICAgICAgICAgICAgKGVMSU1fQVBfUk9MRSA9PSBwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlKSkKKyAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiU0FQOmxpbSBEZWxldGUgU3RhdGlvbiBDb250ZXh0IChzdGFJZDogJWQsIGFzc29jSWQ6ICVkKSAiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1zZy0+c3RhSWQsIHBNc2ctPmFzc29jSWQpOworICAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAgKiBDaGVjayBpZiBEZWF1dGgvRGlzYXNzb2MgaXMgdHJpZ2dlcmVkIGZyb20gSG9zdC4KKyAgICAgICAgICAgICAgICAgICogSWYgbWxtU3RhdGUgaXMgaW4gc29tZSB0cmFuc2llbnQgc3RhdGUgdGhlbgorICAgICAgICAgICAgICAgICAgKiBkb24ndCB0cmlnZ2VyIFNUQSBkZWxldGlvbiB0byBhdm9pZCB0aGUgcmFjZQorICAgICAgICAgICAgICAgICAgKiBjb25kaXRpb24uCisgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgaWYgKChwU3RhRHMgJiYKKyAgICAgICAgICAgICAgICAgICAgICAoKHBTdGFEcy0+bWxtU3RhQ29udGV4dC5tbG1TdGF0ZSAhPQorICAgICAgICAgICAgICAgICAgICAgICAgZUxJTV9NTE1fTElOS19FU1RBQkxJU0hFRF9TVEFURSkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgKHBTdGFEcy0+bWxtU3RhQ29udGV4dC5tbG1TdGF0ZSAhPQorICAgICAgICAgICAgICAgICAgICAgICAgZUxJTV9NTE1fV1RfQVNTT0NfQ05GX1NUQVRFKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAocFN0YURzLT5tbG1TdGFDb250ZXh0Lm1sbVN0YXRlICE9CisgICAgICAgICAgICAgICAgICAgICAgICBlTElNX01MTV9BU1NPQ0lBVEVEX1NUQVRFKSkpKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJTQVA6cmVjZWl2ZWQgRGVsIFNUQSBjb250ZXh0IGluIHNvbWUgdHJhbnNpdCBzdGF0ZShzdGFJZDogJWQsIGFzc29jSWQ6ICVkKSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNc2ctPnN0YUlkLCBwTXNnLT5hc3NvY0lkKTspCisgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocE1zZyk7CisgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgbGltVHJpZ2dlclNUQWRlbGV0aW9uKHBNYWMsIHBTdGFEcywgcHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgfQorICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICB7CisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICAgICAgICAgICAgICBpZihlTElNX1NUQV9ST0xFID09IHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgJiYKKyAgICAgICAgICAgICAgICAgICAgU1RBX0VOVFJZX1RETFNfUEVFUiA9PSBwU3RhRHMtPnN0YVR5cGUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvL1RlYXJkb3duTGluayB3aXRoIFBFRVIKKyAgICAgICAgICAgICAgICAgICAgLy9SZWFzb24gY29kZSBIQUxfREVMX1NUQV9SRUFTT05fQ09ERV9LRUVQX0FMSVZFIG1lYW5zCisgICAgICAgICAgICAgICAgICAgIC8vZVNJUl9NQUNfVERMU19URUFSRE9XTl9QRUVSX1VOUkVBQ0hBQkxFCisgICAgICAgICAgICAgICAgICAgIGxpbVNlbmRTbWVURExTRGVsU3RhSW5kKHBNYWMsIHBTdGFEcywgcHNlc3Npb25FbnRyeSwKKyAgICAgICAgICAgICAgICAgICAgLypwTXNnLT5yZWFzb25Db2RlKi8gZVNJUl9NQUNfVERMU19URUFSRE9XTl9QRUVSX1VOUkVBQ0hBQkxFKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAvL1RlYXJEb3duTGluayB3aXRoIEFQCisgICAgICAgICAgICAgICAgICAgIHRMaW1NbG1EZWF1dGhJbmQgIG1sbURlYXV0aEluZDsKKyAgICAgICAgICAgICAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgibGltIERlbGV0ZSBTdGF0aW9uIENvbnRleHQgKHN0YUlkOiAlZCwgYXNzb2NJZDogJWQpICIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTXNnLT5zdGFJZCwgcE1zZy0+YXNzb2NJZCk7KQorICAgICAgICAgICAgICAgICAgICBpZiAoKHBTdGFEcyAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocFN0YURzLT5tbG1TdGFDb250ZXh0Lm1sbVN0YXRlICE9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVMSU1fTUxNX0xJTktfRVNUQUJMSVNIRURfU1RBVEUpICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwU3RhRHMtPm1sbVN0YUNvbnRleHQubWxtU3RhdGUgIT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUxJTV9NTE1fV1RfQVNTT0NfQ05GX1NUQVRFKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocFN0YURzLT5tbG1TdGFDb250ZXh0Lm1sbVN0YXRlICE9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVMSU1fTUxNX0FTU09DSUFURURfU1RBVEUpKSkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgICAgICogUmVjZWl2ZWQgV0RBX0RFTEVURV9TVEFfQ09OVEVYVF9JTkQgZm9yIFNUQSB0aGF0IGRvZXMgbm90CisgICAgICAgICAgICAgICAgICAgICAgICAgKiBoYXZlIGNvbnRleHQgb3IgaW4gc29tZSB0cmFuc2l0IHN0YXRlLgorICAgICAgICAgICAgICAgICAgICAgICAgICogTG9nIGVycm9yCisgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBXREFfREVMRVRFX1NUQV9DT05URVhUX0lORCBmb3IgU1RBIHRoYXQgZWl0aGVyIGhhcyBubyBjb250ZXh0IG9yIGluIHNvbWUgdHJhbnNpdCBzdGF0ZSwgQWRkcj0gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJFU1NfU1RSKSwgTUFDX0FERFJfQVJSQVkocE1zZy0+YnNzSWQpKTspCisgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBNc2cpOworICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmKCBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLnNlbmREZWF1dGhCZWZvcmVDb24gKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggYXBDb3VudCA9IHBNYWMtPmxpbS5nTGltSGVhcnRCZWF0QXBNYWNJbmRleDsKKworICAgICAgICAgICAgICAgICAgICAgICBpZihwTWFjLT5saW0uZ0xpbUhlYXJ0QmVhdEFwTWFjSW5kZXgpCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltSGVhcnRCZWF0QXBNYWNJbmRleCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1IZWFydEJlYXRBcE1hY0luZGV4ID0gMTsKKworICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoImxpbSBEZWxldGUgU3RhdGlvbiBDb250ZXh0IGZvciBNQUMgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJFU1NfU1RSIiBTdG9yZSBpdCBvbiBJbmRleCAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocFN0YURzLT5zdGFBZGRyKSxhcENvdW50KTsKKworICAgICAgICAgICAgICAgICAgICAgICBzaXJDb3B5TWFjQWRkcihwTWFjLT5saW0uZ0xpbUhlYXJ0QmVhdEFwTWFjW2FwQ291bnRdLHBTdGFEcy0+c3RhQWRkcik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5tbG1TdGFDb250ZXh0LmRpc2Fzc29jUmVhc29uID0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfTUFDX0RJU0FTU09DX0RVRV9UT19JTkFDVElWSVRZX1JFQVNPTjsKKyAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5tbG1TdGFDb250ZXh0LmNsZWFudXBUcmlnZ2VyID0gZUxJTV9MSU5LX01PTklUT1JJTkdfREVBVVRIOworCisgICAgICAgICAgICAgICAgICAgIGlmIChwU3RhRHMtPmlzRGlzYXNzb2NEZWF1dGhJblByb2dyZXNzKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIk5vIG5lZWQgdG8gY2xlYW51cCBhcyBhbHJlYWR5IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJkaXNhc3NvYyBvciBkZWF1dGggaW4gcHJvZ3Jlc3MiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5pc0Rpc2Fzc29jRGVhdXRoSW5Qcm9ncmVzcysrOworCisgICAgICAgICAgICAgICAgICAgIC8vIElzc3VlIERlYXV0aCBJbmRpY2F0aW9uIHRvIFNNRS4KKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4ICopICZtbG1EZWF1dGhJbmQucGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5zdGFBZGRyLCBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgICAgICAgICAgICAgbWxtRGVhdXRoSW5kLnJlYXNvbkNvZGUgICAgPSAodEFOSV9VOCkgcFN0YURzLT5tbG1TdGFDb250ZXh0LmRpc2Fzc29jUmVhc29uOworICAgICAgICAgICAgICAgICAgICBtbG1EZWF1dGhJbmQuZGVhdXRoVHJpZ2dlciA9ICBwU3RhRHMtPm1sbVN0YUNvbnRleHQuY2xlYW51cFRyaWdnZXI7CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworICAgICAgICAgICAgICAgICAgICAvKiBEZWxldGUgYWxsIFRETFMgcGVlcnMgY29ubmVjdGVkIGJlZm9yZSBsZWF2aW5nIEJTUyovCisgICAgICAgICAgICAgICAgICAgIGxpbURlbGV0ZVRETFNQZWVycyhwTWFjLCBwc2Vzc2lvbkVudHJ5KTsKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICBsaW1Qb3N0U21lTWVzc2FnZShwTWFjLCBMSU1fTUxNX0RFQVVUSF9JTkQsICh0QU5JX1UzMiAqKSAmbWxtRGVhdXRoSW5kKTsKKworICAgICAgICAgICAgICAgICAgICBsaW1TZW5kU21lRGVhdXRoSW5kKHBNYWMsIHBTdGFEcywgcHNlc3Npb25FbnRyeSk7CisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICAgICAgICAgICAgICAgfQorI2VuZGlmCisgICAgICAgICAgICAgfQorICAgICAgICAgICAgIGJyZWFrOyAgICAgICAgCisKKyAgICAgICAgY2FzZSBIQUxfREVMX1NUQV9SRUFTT05fQ09ERV9VTktOT1dOX0EyOgorICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIiBEZWxldGluZyBVbmtub3duIHN0YXRpb24gIikpOykKKyAgICAgICAgICAgICBsaW1QcmludE1hY0FkZHIocE1hYywgcE1zZy0+YWRkcjIsIExPR0UpOworICAgICAgICAgICAgIGxpbVNlbmREZWF1dGhNZ210RnJhbWUoIHBNYWMsIGVTSVJfTUFDX0NMQVNTM19GUkFNRV9GUk9NX05PTl9BU1NPQ19TVEFfUkVBU09OLCBwTXNnLT5hZGRyMiwgcHNlc3Npb25FbnRyeSwgRkFMU0UpOworICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiIFVua25vd24gcmVhc29uIGNvZGUgIikpOykKKyAgICAgICAgICAgICBicmVhazsKKworICAgIH0KKyAgICB2b3NfbWVtX2ZyZWUocE1zZyk7CisgICAg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0YURzLT5tbG1TdGFDb250ZXh0LmNsZWFudXBUcmlnZ2VyID0gZUxJTV9MSU5LX01PTklUT1JJTkdfREVBVVRIOworCisgICAgICAgIC8vLyBJc3N1ZSBEZWF1dGggSW5kaWNhdGlvbiB0byBTTUUuCisgICAgICAgIHZvc19tZW1fY29weSgodEFOSV9VOCAqKSAmbWxtRGVhdXRoSW5kLnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+c3RhQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgLyogaWYgc2VuZERlYXV0aEJlZm9yZUNvbiBpcyBlbmFibGVkIGFuZCByZWFzb25jb2RlIGlzIEJlYWNvbiBNaXNzZWQKKyAgICAgICAgICogU3RvcmUgdGhlIE1BQyBvZiBBUCBpbiB0aGUgZmxpcCBmbG9wIGJ1ZmZlci4gVGhpcyBNQUMgd2lsbCBiZQorICAgICAgICAgKiB1c2VkIHRvIHNlbmQgRGVhdXRoIGJlZm9yZSBjb25uZWN0aW9uLCBpZiB3ZSBjb25uZWN0IHRvIHNhbWUgQVAKKyAgICAgICAgICogYWZ0ZXIgSEIgZmFpbHVyZS4KKyAgICAgICAgICovCisgICAgICAgIGlmKHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uc2VuZERlYXV0aEJlZm9yZUNvbiAmJgorICAgICAgICAgICAgZVNJUl9CRUFDT05fTUlTU0VEID09IHJlYXNvbkNvZGUpCisgICAgICAgIHsKKyAgICAgICAgICAgaW50IGFwQ291bnQgPSBwTWFjLT5saW0uZ0xpbUhlYXJ0QmVhdEFwTWFjSW5kZXg7CisKKyAgICAgICAgICAgaWYocE1hYy0+bGltLmdMaW1IZWFydEJlYXRBcE1hY0luZGV4KQorICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbUhlYXJ0QmVhdEFwTWFjSW5kZXggPSAwOworICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHB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lU3RhdGUgIT0gZUxJTV9TTUVfV1RfREVBVVRIX1NUQVRFKSkKKyAgICB7CisgICAgICAgIGlmICghcE1hYy0+c3lzLmdTeXNFbmFibGVMaW5rTW9uaXRvck1vZGUpCisgICAgICAgICAgICByZXR1cm47CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEJlYWNvbiBmcmFtZSBub3QgcmVjZWl2ZWQgd2l0aGluIGhlYXJ0YmVhdCB0aW1lb3V0LgorICAgICAgICAgKi8KKyAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiSGVhcnRiZWF0IEZhaWx1cmUiKSk7KQorICAgICAgICBwTWFjLT5saW0uZ0xpbUhCZmFpbHVyZUNudEluTGlua0VzdFN0YXRlKys7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIENoZWNrIGlmIGNvbm5lY3RlZCBvbiB0aGUgREZTIGNoYW5uZWwsIGlmIG5vdCBjb25uZWN0ZWQgb24KKyAgICAgICAgICogREZTIGNoYW5uZWwgdGhlbiBvbmx5IHNlbmQgdGhlIHByb2JlIHJlcXVlc3Qgb3RoZXJ3aXNlIHRlYXIgZG93biB0aGUgbGluaworICAgICAgICAgKi8KKyAgICAgICAgaWYoIWxpbUlzY29ubmVjdGVkT25ERlNDaGFubmVsKHBzZXNzaW9uRW50cnktPmN1cnJlbnRPcGVyQ2hhbm5lbCkpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qKiogRGV0ZWN0ZWQgY29udGludW91cyBCZWFjb24gTWlzc2VzICoqKi8KKyAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5MaW1IQkZhaWx1cmVTdGF0dXM9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgIC8qUmVzZXQgdGhlIEhCIHBhY2tldCBjb3VudCBiZWZvcmUgc2VuZGluZyBwcm9iZSovCisgICAgICAgICAgICAgbGltUmVzZXRIQlBrdENvdW50KHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBTZW5kIFByb2JlIFJlcXVlc3QgZnJhbWUgdG8gQVAgdG8gc2VlIGlmCisgICAgICAgICAgICAgKiBpdCBpcyBzdGlsbCBhcm91bmQuIFdhaXQgdW50aWwgY2VydGFpbgorICAgICAgICAgICAgICogdGltZW91dCBmb3IgUHJvYmUgUmVzcG9uc2UgZnJvbSBBUC4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiSGVhcnQgQmVhdCBtaXNzZWQgZnJvbSBBUC4gU2VuZGluZyBQcm9iZSBSZXEiKSk7KQorICAgICAgICAgICAgLyogZm9yIHNlYXJjaGluZyBBUCwgd2UgZG9uJ3QgaW5jbHVkZSBhbnkgYWRkaXRpb25hbCBJRSAqLworICAgICAgICAgICAgbGltU2VuZFByb2JlUmVxTWdtdEZyYW1lKHBNYWMsICZwc2Vzc2lvbkVudHJ5LT5zc0lkLCBwc2Vzc2lvbkVudHJ5LT5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Y3VycmVudE9wZXJDaGFubmVsLHBzZXNzaW9uRW50cnktPnNlbGZNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5kb3QxMW1vZGUsIDAsIE5VTEwpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICAgICBGTCgiSGVhcnQgQmVhdCBtaXNzZWQgZnJvbSBBUCBvbiBERlMgY2hhbmVsIG1vdmluZyB0byBwYXNzaXZlIikpOykKKyAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwgPCBTSVJfTUFYXzI0R181R19DSEFOTkVMX1JBTkdFKXsKKyAgICAgICAgICAgICAgIGxpbUNvdmVydENoYW5uZWxTY2FuVHlwZShwTWFjLCBwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwsIGZhbHNlKTsKKyAgICAgICAgICAgICAgIHBNYWMtPmxpbS5kZnNjaGFubmVsTGlzdC50aW1lU3RhbXBbcHNlc3Npb25FbnRyeS0+Y3VycmVudE9wZXJDaGFubmVsXSA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBDb25uZWN0ZWQgb24gREZTIGNoYW5uZWwgc28gc2hvdWxkIG5vdCBzZW5kIHRoZSBwcm9iZSByZXF1ZXN0CisgICAgICAgICAgICAqIHRlYXIgZG93biB0aGUgbGluayBkaXJlY3RseSAqLworICAgICAgICAgICAgbGltVGVhckRvd25MaW5rV2l0aEFwKHBNYWMsIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLCBlU0lSX0JFQUNPTl9NSVNTRUQpOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIC8qKgorICAgICAgICAgICAgICogSGVhcnRiZWF0IHRpbWVyIG1heSBoYXZlIHRpbWVkIG91dAorICAgICAgICAgICAgKiB3aGlsZSB3ZSdyZSBkb2luZyBiYWNrZ3JvdW5kIHNjYW5uaW5nL2xlYXJuaW5nCisgICAgICAgICAgICAqIG9yIGluIHN0YXRlcyBvdGhlciB0aGFuIGxpbmstZXN0YWJsaXNoZWQgc3RhdGUuCisgICAgICAgICAgICAqIExvZyBlcnJvci4KKyAgICAgICAgICAgICovCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgicmVjZWl2ZWQgaGVhcnRiZWF0IHRpbWVvdXQgaW4gc3RhdGUgJWQiKSwKKyAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlKTsKKyAgICAgICAgbGltUHJpbnRNbG1TdGF0ZShwTWFjLCBMT0cxLCBwc2Vzc2lvbkVudHJ5LT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RlZmRNc2dzOiAlc1xuIiwKKyAgICAgICAgICAgICAgICAgIChwTWFjLT5saW0uZ0xpbVByb2Nlc3NEZWZkTXNncyA9PSAxKSA/ICJFbmFibGVkIiA6ICJEaXNhYmxlZCIpOworCisgIGlmIChwTWFjLT5saW0uZ0xpbVN5c3RlbVJvbGUgPT0gZUxJTV9TVEFfUk9MRSkKKyAgeworICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiQUlEID0gJVhcdFx0XG4iLCBwTWFjLT5saW0uZ0xpbUFJRCk7CisgICAgICBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLHAsICJTU0lEIG1pc21hdGNoIGluIEJlYWNvbiBDb3VudCAgICAgICAgICAgICAgPSAlZFxuIiwKKyAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbUJjblNTSURNaXNtYXRjaENudCk7CisgICAgICBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLHAsICJOdW1iZXIgb2YgbGluayBlc3RhYmxpc2htZW50cyAgICAgICAgICAgICAgID0gJWRcbiIsCisgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1OdW1MaW5rRXN0cyk7CisgIH0KKyAgZWxzZSBpZiAocE1hYy0+bGltLmdMaW1TeXN0ZW1Sb2xlID09IGVMSU1fQVBfUk9MRSkKKyAgeworICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiTnVtIG9mIFNUQXMgYXNzb2NpYXRlZCAgICAgICAgICAgICAgICAgICAgID0gJWRcbiIsCisgICAgICAgICAgICAgICAgICAgICAgcGVHZXRDdXJyZW50U1RBc0NvdW50KHBNYWMpKTsKKworICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiTnVtIG9mIFByZS1hdXRoIGNvbnRleHRzICAgICAgICAgICAgICAgICAgID0gJWRcbiIsCisgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1OdW1QcmVBdXRoQ29udGV4dHMpOworCisgICAgICBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLHAsICJOdW0gb2YgQXNzb2NSZXEgZHJvcHBlZCBpbiBpbnZhbGlkIFN0YXRlICAgPSAlZFxuIiwKKyAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbU51bUFzc29jUmVxRHJvcEludmxkU3RhdGUpOworCisgICAgICBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLHAsICJOdW0gb2YgUmVhc3NvY1JlcSBkcm9wcGVkIGluIGludmFsaWQgU3RhdGUgPSAlZFxuIiwKKyAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbU51bVJlYXNzb2NSZXFEcm9wSW52bGRTdGF0ZSk7CisKKyAgICAgIHAgKz0gbG9nX3NwcmludGYoIHBNYWMscCwgIk51bSBvZiBIYXNoIE1pc3MgRXZlbnQgaWdub3JlZCAgICAgICAgICAgICA9ICVkXG4iLAorICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltTnVtSGFzaE1pc3NJZ25vcmVkKTsKKyAgfQorCisgIHAgKz0gbG9nX3NwcmludGYoIHBNYWMscCwgIk51bSBvZiBSeENsZWFudXAgQ291bnQgICAgICAgICAgICAgICAgICAgICA9ICVkXG4iLAorICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1OdW1SeENsZWFudXApOworICBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLHAsICJVbmV4cGVjdGVkIEJlYWNvbiBDb3VudCAgICAgICAgICAgICAgICAgICAgPSAlZFxuIiwKKyAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltVW5leHBCY25DbnQpOworICBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLHAsICJOdW1iZXIgb2YgUmUvQXNzb2MgcmVqZWN0cyBvZiAxMWIgU1RBcyAgICAgPSAlZFxuIiwKKyAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltMTFiU3RhQXNzb2NSZWplY3R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AgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiXG5Qcm9iZSByZXNwb25zZSBkaXNhYmxlICAgICAgICAgID0gJWRcbiIsCisgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbVByb2JlUmVzcERpc2FibGVGbGFnKTsKKworICBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLHAsICJTY2FuIG1vZGUgZW5hYmxlICAgICAgICAgICAgICAgID0gJWRcbiIsCisgICAgICAgICAgICAgICAgICBwTWFjLT5zeXMuZ1N5c0VuYWJsZVNjYW5Nb2RlKTsKKyAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiQmFja2dyb3VuZFNjYW5EaXNhYmxlICAgICAgICAgICA9ICVkXG4iLAorICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1CYWNrZ3JvdW5kU2NhbkRpc2FibGUpOworICBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLHAsICJGb3JjZUJhY2tncm91bmRTY2FuRGlzYWJsZSAgICAgID0gJWRcbiIsCisgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbUZvcmNlQmFja2dyb3VuZFNjYW5EaXNhYmxlKTsKKyAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiTGlua01vbml0b3IgbW9kZSBlbmFibGUgICAgICAgICA9ICVkXG4iLAorICAgICAgICAgICAgICAgICAgcE1hYy0+c3lzLmdTeXNFbmFibGVMaW5rTW9uaXRvck1vZGUpOworICBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLHAsICJRb3MgQ2FwYWJsZSAgICAgICAgICAgICAgICAgICAgID0gJWRcbiIsCisgICAgICAgICAgICAgICAgICBTSVJfTUFDX0dFVF9RT1MocE1hYy0+bGltLmdMaW1DdXJyZW50QnNzQ2FwcykpOworICBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLHAsICJXbWUgQ2FwYWJsZSAgICAgICAgICAgICAgICAgICAgID0gJWRcbiIsCisgICAgICAgICAgICAgICAgICBMSU1fQlNTX0NBUFNfR0VUKFdNRSwgcE1hYy0+bGltLmdMaW1DdXJyZW50QnNzUW9zQ2FwcykpOworICBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLHAsICJXc20gQ2FwYWJsZSAgICAgICAgICAgICAgICAgICAgID0gJWRcbiIsCisgICAgICAgICAgICAgICAgICBMSU1fQlNTX0NBUFNfR0VUKFdTTSwgcE1hYy0+bGltLmdMaW1DdXJyZW50QnNzUW9zQ2FwcykpOworICBpZiAocE1hYy0+bGltLmdMaW1TeXN0ZW1Sb2xlID09IGVMSU1fU1RBX0lOX0lCU1NfUk9MRSkKKyAgeworICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiTnVtYmVyIG9mIHBlZXJzIGluIElCU1MgICAgICAgICA9ICVkXG4iLAorICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltTnVtSWJzc1BlZXJzKTsKKyAgICAgIGlmIChwTWFjLT5saW0uZ0xpbU51bUlic3NQZWVycykKKyAgICAgIHsKKyAgICAgICAgICB0TGltSWJzc1BlZXJOb2RlICpwVGVtcDsKKyAgICAgICAgICBwVGVtcCA9IHBNYWMtPmxpbS5nTGltSWJzc1BlZXJMaXN0OworICAgICAgICAgIHAgKz0gbG9nX3NwcmludGYoIHBNYWMscCwgIk1BQy1BZGRyICAgICAgICAgICBBbmkgRWRjYSBXbWVJbmZvIEhUICBDYXBzICAjUywjRShSYXRlcylcbiIpOworICAgICAgICAgIHdoaWxlIChwVGVtcCAhPSBOVUxMKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiJTAyWDolMDJYOiUwMlg6JTAyWDolMDJYOiUwMlggIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wLT5wZWVyTWFjQWRkclswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wLT5wZWVyTWFjQWRkclsxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wLT5wZWVyTWFjQWRkclsyXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wLT5wZWVyTWFjQWRkclszXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wLT5wZWVyTWFjQWRkcls0XSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wLT5wZWVyTWFjQWRkcls1XSk7CisgICAgICAgICAgICAgIHAgKz0gbG9nX3NwcmludGYoIHBNYWMscCwgIiAlZCAgICVkLCVkICAgICAgICAlZCAgJWQgICUwNFggICVkLCVkXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRlbXAtPmFuaUluZGljYXRvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wLT5lZGNhUHJlc2VudCwgcFRlbXAtPndtZUVkY2FQcmVzZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRlbXAtPndtZUluZm9QcmVzZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRlbXAtPmh0Q2FwYWJsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wLT5jYXBhYmlsaXR5SW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wLT5zdXBwb3J0ZWRSYXRlcy5udW1SYXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wLT5leHRlbmRlZFJhdGVzLm51bVJhdGVzKTsKKyAgICAgICAgICAgICAgcFRlbXAgPSBwVGVtcC0+bmV4dDsKKyAgICAgICAgICB9CisgICAgICB9CisgIH0KKyAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiU3lzdGVtIFNjYW4vTGVhcm4gTW9kZSBiaXQgICAgICA9ICVkXG4iLAorICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1TeXN0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gpYXJnMikgKT09IE5VTEwpCisgICAgeworICAgICAgICBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLHAsIlNlc3Npb24gZG9lcyBub3QgZXhpc3QgZm9yIGdpdmVuIHNlc3Npb24gSWQgIFxuIik7CisgICAgICAgIHJldHVybiBwOworICAgIH0KKworICAgIHBTdGFEcyA9IGRwaEdldEhhc2hFbnRyeShwTWFjLCAodEFOSV9VMTYpYXJnMSwgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUpOworCisgICAgaWYoTlVMTCA9PSBwU3RhRHMpCisgICAgeworICAgICAgICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiQ291bGQgbm90IGZpbmQgc3RhdGlvbiB3aXRoIGFzc29jSWQgPSAlZFxuIiwgYXJnMSk7CisgICAgICAgICAgICByZXR1cm4gcDsKKyAgICB9CisKKyAgICBwRGlzQXNzb2NSZXEgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpclNtZURpc2Fzc29jUmVxKSk7CisgICAgaWYgKE5VTEwgPT0gcERpc0Fzc29jUmVxKQorICAgIHsKKyAgICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCJzZW5kU21lRGlzQXNzb2NSZXE6IEFsbG9jYXRlTWVtb3J5KCkgZmFpbGVkIFxuIik7CisgICAgICAgIHJldHVybiBwOworICAgIH0KKworICAgIGlmKCAoIChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fU1RBX1JPTEUpIHx8CisgICAgICAgICAgKHBzZXNzaW9uRW50cnkgLT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQlRfQU1QX1NUQV9ST0xFKSApICYmCisgICAgICAgIChwc2Vzc2lvbkVudHJ5LT5zdGF0eXBlRm9yQnNzID09IFNUQV9FTlRSWV9QRUVSKSkKKyAgICB7CisgICAgICAgIHNpckNvcHlNYWNBZGRyKHBEaXNBc3NvY1JlcS0+YnNzSWQscHNlc3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wSm9pblJlcSkKKyAgICB7CisgICAgICAgIHAgKz0gbG9nX3NwcmludGYoIHBNYWMscCwic2VuZFNtZUpvaW5SZXE6IEFsbG9jYXRlTWVtb3J5KCkgZmFpbGVkIFxuIik7CisgICAgICAgIHJldHVybiBwOworICAgIH0KKworICAgIHBCdWYgPSAodW5zaWduZWQgY2hhciAqKXBKb2luUmVxOworICAgIHZvc19tZW1fY29weShwQnVmLCAodEFOSV9VOCAqKW1zZ0R1bXAsIG1zZ0xlbik7CisKKyAgICBtc2cudHlwZSA9IGVXTklfU01FX0pPSU5fUkVROworICAgIG1zZy5ib2R5cHRyID0gcEpvaW5SZXE7CisgICAgbXNnLmJvZHl2YWwgPSAwOworICAgIGxpbVBvc3RNc2dBcGkocE1hYywgJm1zZyk7CisKKyAgICByZXR1cm4gcDsKK30KKworCitzdGF0aWMgY2hhciAqcHJpbnRTZXNzaW9uSW5mbyh0cEFuaVNpckdsb2JhbCBwTWFjLCBjaGFyICpwKQoreworICAgIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkgPSAmcE1hYy0+bGltLmdwU2Vzc2lvblswXTsgIAorICAgIHRBTklfVTggIGk7CisKKyAgICBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLCBwLCAiRHVtcCBQRSBTZXNzaW9uIFxuIik7CisKKyAgICBmb3IoaT0wOyBpIDwgcE1hYy0+bGltLm1heEJzc0lkOyBpKyspCisgICAgeworICAgICAgICBpZiggcE1hYy0+bGltLmdwU2Vzc2lvbltpXS52YWxpZCApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnkgPSAmcE1hYy0+bGltLmdwU2Vzc2lvbltpXTsgIAorICAgICAgICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipcbiIpOworICAgICAgICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiICAgIFBFIFNlc3Npb24g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g6JTB4OiUweDolMHgsIEFJRCAlZCwgSW5kZXggJWRcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRzcGVjTGlzdC0+c3RhQWRkclswXSwgcFRzcGVjTGlzdC0+c3RhQWRkclsxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVHNwZWNMaXN0LT5zdGFBZGRyWzJdLCBwVHNwZWNMaXN0LT5zdGFBZGRyWzNdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUc3BlY0xpc3QtPnN0YUFkZHJbNF0sIHBUc3BlY0xpc3QtPnN0YUFkZHJbNV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRzcGVjTGlzdC0+YXNzb2NJZCwgIHBUc3BlY0xpc3QtPmlkeCk7CisgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiXHRUeXBlICVkLCBMZW5ndGggJWQsIGFja1BvbGljeSAlZCwgdXNlclByaW8gJWQsIGFjY2Vzc1BvbGljeSA9ICVkLCBEaXIgJWQsIHRzaWQgJWRcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRzcGVjTGlzdC0+dHNwZWMudHlwZSwgcFRzcGVjTGlzdC0+dHNwZWMubGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUc3BlY0xpc3QtPnRzcGVjLnRzaW5mby50cmFmZmljLmFja1BvbGljeSwgcFRzcGVjTGlzdC0+dHNwZWMudHNpbmZvLnRyYWZmaWMudXNlclByaW8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRzcGVjTGlzdC0+dHNwZWMudHNpbmZvLnRyYWZmaWMuYWNjZXNzUG9saWN5LCBwVHNwZWNMaXN0LT50c3BlYy50c2luZm8udHJhZmZpYy5kaXJlY3Rpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRzcGVjTGlzdC0+dHNwZWMudHNpbmZvLnRyYWZmaWMudHNpZCk7CisgICAgcCArPSBsb2dfc3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N0aW9uLAorICAgICAgICAgICAgcFRzcGVjTGlzdC0+dHNwZWMudHNpbmZvLnRyYWZmaWMudHNpZCwgcFRzcGVjTGlzdC0+dHNwZWMudHNpbmZvLnRyYWZmaWMudHJhZmZpY1R5cGUpOworCisgIHJldHVybiBwOworfQorCisKK3N0YXRpYyBjaGFyKiBsaW1EdW1wRHBoVGFibGVTdW1tYXJ5KHRwQW5pU2lyR2xvYmFsIHBNYWMsY2hhciAqcCkKK3sKKyAgICB0QU5JX1U4ICBpLCBqOworICAgIHAgKz0gbG9nX3NwcmludGYoIHBNYWMscCwgIkRQSCBUYWJsZSBkdW1wXG4iKTsKKworICAgIGZvcihqPTA7IGogPCBwTWFjLT5saW0ubWF4QnNzSWQ7IGorKykKKyAgICB7CisgICAgICAgIC8qIEZpbmQgZmlyc3QgZnJlZSByb29tIGluIHNlc3Npb24gdGFibGUgKi8KKyAgICAgICAgaWYocE1hYy0+bGltLmdwU2Vzc2lvbltqXS52YWxpZCkKKyAgICAgICAgeworICAgICAgICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiYWlkIHN0YUlkIGJzc2lkIGVuY1BvbCBxb3NNb2RlIHdtZSAxMWUgd3NtIHN0YWFkZHJcbiIpOworICAgICAgICAgICAgZm9yKGkgPSAwOyBpIDwgcE1hYy0+bGltLmdwU2Vzc2lvbltqXS5kcGguZHBoSGFzaFRhYmxlLnNpemU7IGkrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAocE1hYy0+bGltLmdwU2Vzc2lvbltqXS5kcGguZHBoSGFzaFRhYmxlLnBEcGhOb2RlQXJyYXlbaV0uYWRkZWQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLHAsICIlZCAgJWQgICVkICAgICAgJWQgICAgICAgICAlZCAgICVkICVkICAgJWQgICV4OiV4OiV4OiV4OiV4OiV4XG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ3BTZXNzaW9uW2pdLmRwaC5kcGhIYXNoVGFibGUucERwaE5vZGVBcnJheVtpXS5hc3NvY0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ3BTZXNzaW9uW2pdLmRwaC5kcGhIYXNoVGFibGUucERwaE5vZGVBcnJheVtpXS5zdGFJbmRleCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwU2Vzc2lvbltqXS5kcGguZHBoSGFzaFRhYmxlLnBEcGhOb2RlQXJyYXlbaV0uYnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5ncFNlc3Npb25bal0uZHBoLmRwaEhhc2hUYWJsZS5wRHBoTm9kZUFycmF5W2ldLmVuY1BvbGljeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwU2Vzc2lvbltqXS5kcGguZHBoSGFzaFRhYmxlLnBEcGhOb2RlQXJyYXlbaV0ucW9zTW9kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwU2Vzc2lvbltqXS5kcGguZHBoSGFzaFRhYmxlLnBEcGhOb2RlQXJyYXlbaV0ud21lRW5hYmxlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwU2Vzc2lvbltqXS5kcGguZHBoSGFzaFRhYmxlLnBEcGhOb2RlQXJyYXlbaV0ubGxlRW5hYmxlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwU2Vzc2lvbltqXS5kcGguZHBoSGFzaFRhYmxlLnBEcGhOb2RlQXJyYXlbaV0ud3NtRW5hYmxlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwU2Vzc2lvbltqXS5kcGguZHBoSGFzaFRhYmxlLnBEcGhOb2RlQXJyYXlbaV0uc3RhQXV0aGVudGljYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwU2Vzc2lvbltqXS5kcGguZHBoSGFzaFRhYmxlLnBEcGhOb2RlQXJyYXlbaV0uc3RhQWRkclswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwU2Vzc2lvbltqXS5kcGguZHBoSGFzaFRhYmxlLnBEcGhOb2RlQXJyYXlbaV0uc3RhQWRkclsxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwU2Vzc2lvbltqXS5kcGguZHBoSGFzaFRhYmxlLnBEcGhOb2RlQXJyYXlbaV0uc3RhQWRkclsyXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwU2Vzc2lvbltqXS5kcGguZHBoSGFzaFRhYmxlLnBEcGhOb2RlQXJyYXlbaV0uc3RhQWRkclszXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwU2Vzc2lvbltqXS5kcGguZHBoSGFzaFRhYmxlLnBEcGhOb2RlQXJyYXlbaV0uc3RhQWRkcls0XSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwU2Vzc2lvbltqXS5kcGguZHBoSGFzaFRhYmxlLnBEcGhOb2RlQXJyYXlbaV0uc3RhQWRkcls1XSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSAgIAorICAgICAgICB9ICAgCisgICAgfQorICAgIHJldHVybiBwOworfSAgICAgCisKKy8vIGFkZCB0aGUgc3BlY2lmaWVkIHRzcGVjIHRvIHRoZSB0c3BlYyBsaXN0C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BoSGFzaE5vZGUgcFN0YURzOworICAgIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkgPSAmcE1hYy0+bGltLmdwU2Vzc2lvblswXTsgIC8vVEJELVJBSkVTSCBIT1cgVE8gR0VUIHNlc3Npb25FbnRyeT8/Pz8/CisgICAgdFNpck1hY0FkZHIgc3RhTWFjID0gezB9OworICAgIHRBTklfVTE2IHBlZXJJZHg7CisgICAgaWYoYXJnMiA+IDUpCisgICAgICBnb3RvIGFkZFN0YUZhaWw7CisgICAgcGVlcklkeCA9IGxpbUFzc2lnblBlZXJJZHgocE1hYywgcHNlc3Npb25FbnRyeSk7CisgICAgcFN0YURzID0gZHBoR2V0SGFzaEVudHJ5KHBNYWMsIHBlZXJJZHgpOworICAgIGlmKE5VTEwgPT0gcFN0YURzKQorICAgIHsKKyAgICAgICAgc3RhTWFjWzVdID0gKHRBTklfVTgpIGFyZzE7CisgICAgICAgIHBTdGFEcyA9IGRwaEFkZEhhc2hFbnRyeShwTWFjLCBzdGFNYWMsIHBlZXJJZHgsICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsKKyAgICAgICAgaWYoTlVMTCA9PSBwU3RhRHMpCisgICAgICAgICAgZ290byBhZGRTdGFGYWlsOworCisgICAgICAgIHBTdGFEcy0+c3RhVHlwZSA9IFNUQV9FTlRSWV9QRUVSOworICAgICAgICBzd2l0Y2goYXJnMikKKyAgICAgICAgeworICAgICAgICAgICAgLy8xMWIgc3RhdGlvbgorICAgICAgICAgICAgY2FzZSAwOgorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+bWxtU3RhQ29udGV4dC5odENhcGFiaWxpdHkgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+ZXJwRW5hYmxlZCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiMTFiIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIC8vMTFnIHN0YXRpb24KKyAgICAgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPm1sbVN0YUNvbnRleHQuaHRDYXBhYmlsaXR5ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPmVycEVuYWJsZWQgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgKz0gbG9nX3NwcmludGYoIHBNYWMscCwgIjExZyIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAvL2h0MjAgc3RhdGlvbiBub24tR0YKKyAgICAgICAgICAgIGNhc2UgMjoKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPm1sbVN0YUNvbnRleHQuaHRDYXBhYmlsaXR5ID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPmVycEVuYWJsZWQgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+aHRTdXBwb3J0ZWRDaGFubmVsV2lkdGhTZXQgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+aHRHcmVlbmZpZWxkID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLHAsICJIVDIwIG5vbi1HRiIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAvL2h0MjAgc3RhdGlvbiBHRgorICAgICAgICAgICAgY2FzZSAzOgorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+bWxtU3RhQ29udGV4dC5odENhcGFiaWxpdHkgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+ZXJwRW5hYmxlZCA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5odFN1cHBvcnRlZENoYW5uZWxXaWR0aFNldCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5odEdyZWVuZmllbGQgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgKz0gbG9nX3NwcmludGYoIHBNYWMscCwgIkhUMjAgR0YiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgLy9odDQwIHN0YXRpb24gbm9uLUdGCisgICAgICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5tbG1TdGFDb250ZXh0Lmh0Q2FwYWJpbGl0eSA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5lcnBFbmFibGVkID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPmh0U3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0ID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPmh0R3JlZW5maWVsZCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiSFQ0MCBub24tR0YiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgLy9odDQwIHN0YXRpb24gR0YKKyAgICAgICAgICAgIGNhc2UgNToKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPm1sbVN0YUNvbnRleHQuaHRDYXBhYmlsaXR5ID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPmVycEVuYWJsZWQgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+aHRTdXBwb3J0ZWRDaGFubmVsV2lkdGhTZXQgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+aHRHcmVlbmZpZWxkID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLHAsICJIVDQwIEdGIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAgKz0gbG9nX3NwcmludGYoIHBNYWMscCwgImFyZzIgbm90IGluIHJhbmdlIFswLi4zXS4gU3RhdGlvbiBub3QgYWRkZWQuXG4iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBhZGRTdGFGYWlsOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBwU3RhRHMtPmFkZGVkID0gMTsKKyAgICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiIHN0YXRpb24gd2l0aCBtYWMgYWRkcmVzcyAwMDowMDowMDowMDowMDoleCBhZGRlZC5cbiIsICh0QU5JX1U4KWFyZzEpOworICAgICAgICBsaW1BZGRTdGEocE1hYywgcFN0YURzLHBzZXNzaW9uRW50cnkpOworICAgIH0KKyAgICBlbHNlCisgICAgeworYWRkU3RhRmFpbDoKKyAgICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE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2lvbiBJZCAgXG4iKTsKKyAgICAgICAgcmV0dXJuIHA7CisgICAgfQorCisgICAgcFN0YURzID0gZHBoR2V0SGFzaEVudHJ5KHBNYWMsICh0QU5JX1UxNilhcmcxLCAmcHNlc3Npb25FbnRyeS0+ZHBoLmRwaEhhc2hUYWJsZSk7CisKKyAgICBpZihOVUxMID09IHBTdGFEcykKKyAgICB7CisgICAgICAgICAgICBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLHAsICJDb3VsZCBub3QgZmluZCBzdGF0aW9uIHdpdGggYXNzb2NJZCA9ICVkXG4iLCBhcmcxKTsKKyAgICAgICAgICAgIHJldHVybiBwOworICAgIH0KKyAgICAKKyAgICBpZiAocFN0YURzLT5tbG1TdGFDb250ZXh0Lm1sbVN0YXRlICE9IGVMSU1fTUxNX0xJTktfRVNUQUJMSVNIRURfU1RBVEUpCisgICAgeworICAgICAgICBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLHAsICJyZWNlaXZlZCBEaXNhc3NvYyBmcmFtZSBmcm9tIHBlZXIgdGhhdCBpcyBpbiBzdGF0ZSAlWCBcbiIsIHBTdGFEcy0+bWxtU3RhQ29udGV4dC5tbG1TdGF0ZSk7CisgICAgICAgIHJldHVybiBwOworICAgIH0KKworICAgIHBTdGFEcy0+bWxtU3RhQ29udGV4dC5jbGVhbnVwVHJpZ2dlciA9IGVMSU1fUEVFUl9FTlRJVFlfRElTQVNTT0M7CisgICAgcFN0YURzLT5tbG1TdGFDb250ZXh0LmRpc2Fzc29jUmVhc29uID0gKHRTaXJNYWNSZWFzb25Db2RlcykgcmVhc29uQ29kZTsKKworICAgIC8vIElzc3VlIERpc2Fzc29jIEluZGljYXRpb24gdG8gU01FLgorICAgIHZvc19tZW1fY29weSgodEFOSV9VOCAqKSAmbWxtRGlzYXNzb2NJbmQucGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopIHBTdGFEcy0+c3RhQWRkciwgc2l6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QgUklGUyBMc2lnIG4tR0YgaHQyMCAxMWcgMTFiCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCitXTklfQ0ZHX1BST1RFQ1RJT05fRU5BQkxFRCAgICBJICAgIDQgICAgOQorViAgICBSVyAgICBOUCAgUkVTVEFSVAorTElNCiswICAgIDB4ZmYgICAgMHhmZgorViAgICBSVyAgICBOUCAgUkVTVEFSVAorTElNCiswICAgIDB4ZmZmZiAgICAweGZmZmYKKworI0VOVU0gRlJPTV9sbEIgMAorI0VOVU0gRlJPTV9sbEcgMQorI0VOVU0gSFRfMjAgMgorI0VOVU0gTk9OX0dGIDMKKyNFTlVNIExTSUdfVFhPUCA0CisjRU5VTSBSSUZTIDUKKyNFTlVNIE9MQkNfRlJPTV9sbEIgOAorI0VOVU0gT0xCQ19GUk9NX2xsRyA5CisjRU5VTSBPTEJDX0hUMjAgMTAKKyNFTlVNIE9MQkNfTk9OX0dGIDExCisjRU5VTSBPTEJDX0xTSUdfVFhPUCAxMgorI0VOVU0gT0xCQ19SSUZTIDEzCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgaWYoMSA9PSBhcmcxKQorICAgICAgICBkdW1wX2NmZ19zZXQocE1hYywgV05JX0NGR19QUk9URUNUSU9OX0VOQUJMRUQsIDB4ZmYsIGFyZzMsIGFyZzQsIHApOworICAgIGVsc2UgaWYoMiA9PSBhcmcxKQorICAgICAgICBkdW1wX2NmZ19zZXQocE1hYywgV05JX0NGR19QUk9URUNUSU9OX0VOQUJMRUQsIGFyZzIgJiAweGZmLCBhcmczLCBhcmc0LCBwKTsKKyAgICBlbHNlCisgICAgeworICAgICAgICBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLHAsICJUbyBzZXQgcHJvdGVjdGlvbiBjb25maWc6XG4iKTsKKyAgICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiYXJnMTogb3BlcmF0aW9uIHR5cGUoMSAtPiBzZXQgd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FyKiAKK2R1bXBfbGltX2dldF9wZV9zdGF0aXN0aWNzKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTMyIGFyZzEsIHRBTklfVTMyIGFyZzIsIHRBTklfVTMyIGFyZzMsIHRBTklfVTMyIGFyZzQsIGNoYXIgKnApCit7CisgICAgdHBBbmlHZXRQRVN0YXRzUmVxIHBSZXE7CisgICAgdEFOSV9VMzIgc3RhdHNNYXNrOworCisgICAgKHZvaWQpIGFyZzI7ICh2b2lkKSBhcmczOyAodm9pZCkgYXJnNDsKKworICAgIAorICAgIHN3aXRjaChhcmcxKQorICAgIHsgICAgICAgIAorICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICBzdGF0c01hc2sgPSBQRV9TVU1NQVJZX1NUQVRTX0lORk87CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgc3RhdHNNYXNrID0gUEVfR0xPQkFMX0NMQVNTX0FfU1RBVFNfSU5GTzsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIDM6CisgICAgICAgICAgICBzdGF0c01hc2sgPSBQRV9HTE9CQUxfQ0xBU1NfQl9TVEFUU19JTkZPOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgNDoKKyAgICAgICAgICAgIHN0YXRzTWFzayA9IFBFX0dMT0JBTF9DTEFTU19DX1NUQVRTX0lORk87CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSA1OgorICAgICAgICAgICAgc3RhdHNNYXNrID0gUEVfUEVSX1NUQV9TVEFUU19JTkZPOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICByZXR1cm4gcDsKKyAgICB9CisgICAgCisgICAgcFJlcSA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0QW5pR2V0UEVTdGF0c1JlcSkpOworICAgIGlmIChOVUxMID09IHBSZXEpCisgICAgeworICAgICAgICBwICs9IGxvZ19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g0KnNpemVvZih0U2lyTWFjUmFkaW9NZWFzdXJlUmVwb3J0KSk7CisgICAgdEFOSV9VOCBudW0gPSAodEFOSV9VOCkoYXJnNCA+IDQgPyA0IDogYXJnNCk7CisgICAgdEFOSV9VOCBpOworCisgICAgaWYgKCFwUlJNUmVwb3J0KQorICAgIHsKKyAgICAgICAgcCArPSBsb2dfc3ByaW50ZihwTWFjLCBwLAorICAgICAgICAgICAgICAgICAgICAgICAgICJVbmFibGUgdG8gYWxsb2NhdGUgbWVtb3J5IHRvIHByb2Nlc3MgY29tbWFuZFxuIik7CisgICAgICAgIGdvdG8gZG9uZTsKKyAgICB9CisKKyAgICBpZigocHNlc3Npb25FbnRyeSA9IHBlRmluZFNlc3Npb25CeVNlc3Npb25JZChwTWFjLCh0QU5JX1U4KWFyZzIpICk9PSBOVUxMKQorICAgIHsKKyAgICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCJTZXNzaW9uIGRvZXMgbm90IGV4aXN0IGZvciBnaXZlbiBzZXNzaW9uIElkICBcbiIpOworICAgICAgICBnb3RvIGRvbmU7CisgICAgfQorICAgIHN3aXRjaCAoYXJnMykKKyAgICB7CisgICAgICAgICBjYXNlIDA6CisgICAgICAgICAgICAgIC8qIHNlbmQgdHdvIHJlcG9ydHMgd2l0aCBpbmNhcGFibGUgYml0IHNldCAqLworICAgICAgICAgICAgICBwUlJNUmVwb3J0WzBdLnR5cGUgPSA2OworICAgICAgICAgICAgICBwUlJNUmVwb3J0WzFdLnR5cGUgPSA3OworICAgICAgICAgICAgICBsaW1TZW5kUmFkaW9NZWFzdXJlUmVwb3J0QWN0aW9uRnJhbWUoIHBNYWMsIDEsIDIsICZwUlJNUmVwb3J0WzBdLCBwc2Vzc2lvbkVudHJ5LT5ic3NJZCwgcHNlc3Npb25FbnRyeSApOyAKKyAgICAgICAgICAgICAgYnJlYWs7ICAgICAKKyAgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgICAgZm9yICggaSA9IDAgOyBpIDwgbnVtIDsgaSsrICkgCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBwUlJNUmVwb3J0W2ldLnR5cGUgPSA1OworICAgICAgICAgICAgICAgICAgIGlmICggaSA9PSAzICkKKyAgICAgICAgICAgICAgICAgICBwUlJNUmVwb3J0W2ldLnJlZnVzZWQgPSAxOworICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICBwUlJNUmVwb3J0W2ldLnJlZnVzZWQgPSAwOworCisgICAgICAgICAgICAgICAgICAgcFJSTVJlcG9ydFtpXS5yZXBvcnQuYmVhY29uUmVwb3J0LnJlZ0NsYXNzID0gMzI7CisgICAgICAgICAgICAgICAgICAgcFJSTVJlcG9ydFtpXS5yZXBvcnQuYmVhY29uUmVwb3J0LmNoYW5uZWwgPSBpOworICAgICAgICAgICAgICAgICAgIHBSUk1SZXBvcnRbaV0ucmVwb3J0LmJlYWNvblJlcG9ydC5tZWFzRHVyYXRpb24gPSAyMzsKKyAgICAgICAgICAgICAgICAgICBwUlJNUmVwb3J0W2ldLnJlcG9ydC5iZWFjb25SZXBvcnQucGh5VHlwZSA9IGkgPDwgNDsgLy9zb21lIHZhbHVlLgorICAgICAgICAgICAgICAgICAgIHBSUk1SZXBvcnRbaV0ucmVwb3J0LmJlYWNvblJlcG9ydC5iY25Qcm9iZVJzcCA9IDE7CisgICAgICAgICAgICAgICAgICAgcFJSTVJlcG9ydFtpXS5yZXBvcnQuYmVhY29uUmVwb3J0LnJzbmkgPSAxMDsKKyAgICAgICAgICAgICAgICAgICBwUlJNUmVwb3J0W2ldLnJlcG9ydC5iZWFjb25SZXBvcnQucmNwaSA9IDQwOworCisgICAgICAgICAgICAgICAgICAgcFJSTVJlcG9ydFtpXS5yZXBvcnQuYmVhY29uUmVwb3J0LmJzc2lkWzBdID0gMHgwMDsKKyAgICAgICAgICAgICAgICAgICBwUlJNUmVwb3J0W2ldLnJlcG9ydC5iZWFjb25SZXBvcnQuYnNzaWRbMV0gPSAweEFBOyAKKyAgICAgICAgICAgICAgICAgICBwUlJNUmVwb3J0W2ldLnJlcG9ydC5iZWFjb25SZXBvcnQuYnNzaWRbMl0gPSAweEJCOworICAgICAgICAgICAgICAgICAgIHBSUk1SZXBvcnRbaV0ucmVwb3J0LmJlYWNvblJlcG9ydC5ic3NpZFszXSA9IDB4Q0M7CisgICAgICAgICAgICAgICAgICAgcFJSTVJlcG9ydFtpXS5yZXBvcnQuYmVhY29uUmVwb3J0LmJzc2lkWzRdID0gMHgwMDsKKyAgICAgICAgICAgICAgICAgICBwUlJNUmVwb3J0W2ldLnJlcG9ydC5iZWFjb25SZXBvcnQuYnNzaWRbNV0gPSAweDAxIDw8IGk7CisKKworICAgICAgICAgICAgICAgICAgIHBSUk1SZXBvcnRbaV0ucmVwb3J0LmJlYWNvblJlcG9ydC5hbnRlbm5hSWQgPSAxMDsKKyAgICAgICAgICAgICAgICAgICBwUlJNUmVwb3J0W2ldLnJlcG9ydC5iZWFjb25SZXBvcnQucGFyZW50VFNGID0gMHgxMjM0OworCisgICAgICAgICAgICAgICAgICAgcFJSTVJlcG9ydFtpXS5yZXBvcnQuYmVhY29uUmVwb3J0Lm51bUllcyA9IGkgKiAxMDsKKyAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGo7CisgICAgICAgICAgICAgICAgICAgZm9yKCBqID0gMDsgaiA8IHBSUk1SZXBvcnRbaV0ucmVwb3J0LmJlYWNvblJlcG9ydC5udW1JZXMgOyBqKysgKQorICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBwUlJNUmVwb3J0W2ldLnJlcG9ydC5iZWFjb25SZXBvcnQuSWVzW2pdID0gaiArIGk7IC8vSnVuayB2YWx1ZXMuCisgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGxpbVNlbmRSYWRpb01lYXN1cmVSZXBvcnRBY3Rpb25GcmFtZSggcE1hYywgMSwgbnVtLCAmcFJSTVJlcG9ydFswXSwgcHNlc3Npb25FbnRyeS0+YnNzSWQsIHBzZXNzaW9uRW50cnkgKTsgCisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICAvL3NlbmQgTmVpZ2hib3IgcmVxdWVzdC4KKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIHRTaXJNYWNOZWlnaGJvclJlcG9ydFJlcSBuZWlnaGJvcjsKKyAgICAgICAgICAgICAgICAgICBuZWlnaGJvci5kaWFsb2dUb2tlbiA9IDI7CisgICAgICAgICAgICAgICAgICAgbmVpZ2hib3Iuc3NpZF9wcmVzZW50ID0gKHRBTklfVTgpIGFyZzQ7CisgICAgICAgICAgICAgICAgICAgbmVpZ2hib3Iuc3NpZC5sZW5ndGggPSA1OworICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShuZWlnaGJvci5zc2lkLnNzSWQsICJhYmNkZSIsIDUpOworCisgICAgICAgICAgICAgICAgICAgbGltU2VuZE5laWdoYm9yUmVwb3J0UmVxdWVzdEZyYW1lKCBwTWFjLCAmbmVpZ2hib3IsIHBzZXNzaW9uRW50cnktPmJzc0lkLCBwc2Vzc2lvbkVudHJ5ICk7CisKKyAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgY2FzZSAzOgorICAgICAgICAgICAgICAvL3NlbmQgTGluayBtZWFzdXJlIHJlcG9ydC4KKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgdFNpck1hY0xpbmtSZXBvcnQgbGluazsKKyAgICAgICAgICAgICAgICAgIGxpbmsuZGlhbG9nVG9rZW4gPSA0OworICAgICAgICAgICAgICAgICAgbGluay50eFBvd2VyID0gMzQ7CisgICAgICAgICAgICAgICAgICBsaW5rLnJ4QW50ZW5uYSA9IDI7CisgICAgICAgICAgICAgICAgICBsaW5rLnR4QW50ZW5uYSA9IDE7CisgICAgICAgICAgICAgICAgICBsaW5rLnJjcGkgPSA5OworICAgICAgICAgICAgICAgICAgbGluay5yc25pID0gMzsKKyAgICAgICAgICAgICAgICAgIGxpbVNlbmRMaW5rUmVwb3J0QWN0aW9uRnJhbWUoIHBNYWMsICZsaW5rLCBwc2Vzc2lvbkVudHJ5LT5ic3NJZCwgcHNlc3Npb25FbnRyeSApOyAKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgIGJyZWFrOworICAgIH0KKworZG9uZToKKyAgICB2b3NfbWVtX2ZyZWUocFJSTVJlcG9ydCk7CisgICAgcmV0dXJuIHA7ICAgIAorfQorCitzdGF0aWMgY2hhciAqCitkdW1wX2xpbV91bnBhY2tfcnJtX2FjdGlvbiggdHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMzIgYXJnMSwgdEFOSV9VMzIgYXJnMiwgdEFOSV9VMzIgYXJnMywgdEFOSV9VMzIgYXJnNCwgY2hhciAqcCkKK3sKKyAgIHRwUEVTZXNzaW9uICBwc2Vzc2lvbkVudHJ5OworICAgdEFOSV9VMzIgICAgIHN0YXR1czsKKworICAgdEFOSV9VOCBzaXplW10gPSB7CisgICAgICAweDJDLAorICAgICAgMHgyRiwKKyAgICAgIDB4MjUsCisgICAgICAweDJDLAorICAgICAgMHgxQywKKyAgICAgIDB4MDUKKyAgIH07CisKKyAgIHRBTklfVTggcEJvZHlbXVsxMDBdID0geworICAgICAgeworICAgICAgICAgLypCZWFjb24gUmVxdWVzdCAwKi8KKyAgICAgIDB4MDUsIDB4MDAsIDB4MDEsIDB4MDAsIDB4MDAsIAorICAgICAgLy9NZWFzdXJlbWVudCByZXF1ZXN0IElFCisgICAgICAweDI2LCAweDI1LCAweDAxLCAweDAwLCAKKyAgICAgIC8vQmVhY29uIHJlcXVlc3QgdHlwZQorICAgICAgMHgwNSwKKyAgICA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gorICAgICAgMHgwMSwgMHgwMiwgMHgwMCwgMHgwMCwKKyAgICAgIC8vUmVwb3J0aW5nIERldGFpbAorICAgICAgMHgwMiwgMHgwMSwgMHgxLAorICAgICAgLy9SZXF1ZXN0IElFCisgICAgICAweDBBLCAweDA1LCAweDAwLCAweDMwLCAweDQ2LCAweDM2LCAweERELAorICAgICAgLy9BUCBjaGFubmVsIHJlcG9ydAorICAgICAgMHgzMywgMHgwMywgMHgwQywgMHgwMSwgMHgwNiwgICAgCisgICAgICAweDMzLCAweDAzLCAweDBDLCAweDI0LCAweDMwLCAgICAKKyAgICAgIH0sCisgICAgICB7CisgICAgICAgICAvKkJlYWNvbiBSZXF1ZXN0IDIqLworICAgICAgMHgwNSwgMHgwMCwgMHgwMSwgMHgwMCwgMHgwMCwgCisgICAgICAvL01lYXN1cmVtZW50IHJlcXVlc3QgSUUKKyAgICAgIDB4MjYsIDB4MUUsIDB4MDEsIDB4MDAsIAorICAgICAgLy9CZWFjb24gcmVxdWVzdCB0eXBlCisgICAgICAweDA1LAorICAgICAgLy9CZWFjb24gcmVxdWVzdCBzdGFydHMgaGVyZQorICAgICAgMHgwQywgMHgwMCwgMHgzMCwgMHgwMCwgMHgxNCwgMHgwMCwgMHgwMiwKKyAgICAgIC8vQlNTSUQKKyAgICAgIDB4RkYsIDB4RkYsIDB4RkYsIDB4RkYsIDB4ZmYsIDB4RkYsIAorICAgICAgLy9TU0lECisgICAgICAweDAwLCAweDA1LCAweDU3LCAweDY5LCAweDQ2LCAweDY5LCAweDMxLCAKKyAgICAgIC8vMHgwMCwgMHgwOCwgMHg0MSwgMHg1MywgMHg1NCwgMHgyRCwgMHg1NywgMHg0MSwgMHg1MCwgMHg0OSwgCisgICAgICAvL1JlcG9ydGluZyBDb25kaXRpb24KKyAgICAgIDB4MDEsIDB4MDIsIDB4MDAsIDB4MDAsCisgICAgICAvL1JlcG9ydGluZyBEZXRhaWwKKyAgICAgIDB4MDIsIDB4MDEsIDB4MAorICAgICAgLy9SZXF1ZXN0IElFCisgICAgICB9LAorICAgICAgeworICAgICAgICAgLypCZWFjb24gUmVxdWVzdCAzKi8KKyAgICAgIDB4MDUsIDB4MDAsIDB4MDEsIDB4MDAsIDB4MDAsIAorICAgICAgLy9NZWFzdXJlbWVudCByZXF1ZXN0IElFCisgICAgICAweDI2LCAweDI1LCAweDAxLCAweDAwLCAKKyAgICAgIC8vQmVhY29uIHJlcXVlc3QgdHlwZQorICAgICAgMHgwNSwKKyAgICAgIC8vQmVhY29uIHJlcXVlc3Qgc3RhcnRzIGhlcmUKKyAgICAgIDB4MEMsIDB4MDEsIDB4MzAsIDB4MDAsIDB4NjksIDB4MDAsIDB4MDAsCisgICAgICAvL0JTU0lECisgICAgICAweEZGLCAweEZGLCAweEZGLCAweEZGLCAweGZmLCAweEZGLCAKKyAgICAgIC8vU1NJRAorICAgICAgMHgwMCwgMHgwNSwgMHg1NywgMHg2OSwgMHg0NiwgMHg2OSwgMHgzMSwgCisgICAgICAvL1JlcG9ydGluZyBDb25kaXRpb24KKyAgICAgIDB4MDEsIDB4MDIsIDB4MDAsIDB4MDAsCisgICAgICAvL1JlcG9ydGluZyBEZXRhaWwKKyAgICAgIDB4MDIsIDB4MDEsIDB4MSwKKyAgICAgIC8vUmVxdWVzdCBJRQorICAgICAgMHgwQSwgMHgwNSwgMHgwMCwgMHgzMCwgMHg0NiwgMHgzNiwgMHhERAorICAgICAgfSwKKyAgICAgIHsKKyAgICAgICAgIC8qTmVpZ2hib3IgcmVwb3J0Ki8KKyAgICAgIDB4MDUsIDB4MDUsIDB4MDEsICAKKyAgICAgIC8vTWVhc3VyZW1lbnQgcmVxdWVzdCBJRQorICAgICAgMHgzNCwgMHgxNywgIAorICAgICAgLy9CU1NJRAorICAgICAgMHhGRiwgMHhGRiwgMHhGRiwgMHhGRiwgMHhmZiwgMHhGRiwgCisgICAgICAvL0JTU0lEIElORk9vCisgICAgICAweEVELCAweDAxLCAweDAwLCAweDAwLAorICAgICAgLy9SZWcgY2xhc3MsIGNoYW5uZWwsIFBoeSB0eXBlCisgICAgICAweDIwLCAweDAxLCAweDAyLCAKKyAgICAgIC8vVFNGIEluZm8KKyAgICAgIDB4MDEsIDB4MDQsIDB4MDIsIDB4MDAsIDB4NjAsIDB4MDAsCisgICAgICAvL0NvbmRlbnNlZCBjb3VudHJ5CisgICAgICAweDAyLCAweDAyLCAweDYyLCAweDYzCisgICAgICB9LAorICAgICAgeworICAgICAgICAgLyogTGluayBtZWFzdXJlbWVudCByZXF1ZXN0ICovCisgICAgICAweDA1LCAweDAyLCAweDAwLAorICAgICAgLy9UeHBvd2VyIHVzZWQKKyAgICAgIDB4MDAsCisgICAgICAvL01heCBUeCBQb3dlcgorICAgICAgMHgwMCAgIAorICAgICAgfQorICAgfTsKKworICAgaWYoKHBzZXNzaW9uRW50cnkgPSBwZUZpbmRTZXNzaW9uQnlTZXNzaW9uSWQocE1hYywodEFOSV9VOClhcmcxKSApPT0gTlVMTCkKKyAgIHsKKyAgICAgIHAgKz0gbG9nX3NwcmludGYoIHBNYWMscCwiU2Vzc2lvbiBkb2VzIG5vdCBleGlzdCBmb3IgZ2l2ZW4gc2Vzc2lvbiBJZCAgXG4iKTsKKyAgICAgIHJldHVybiBwOworICAgfQorICAgc3dpdGNoIChhcmcyKQorICAgeworICAgICAgY2FzZSAwOgorICAgICAgY2FzZSAxOgorICAgICAgY2FzZSAyOgorICAgICAgY2FzZSAzOgorICAgICAgICAgeworICAgICAgICAgICAgdERvdDExZlJhZGlvTWVhc3VyZW1lbnRSZXF1ZXN0ICpmcm0gPQorICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX21hbGxvYyhzaXplb2YodERvdDExZlJhZGlvTWVhc3VyZW1lbnRSZXF1ZXN0KSk7CisgICAgICAgICAgICBpZiAoIWZybSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwICs9IGxvZ19zcHJpbnRmKHBNYWMsIHAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlVuYWJsZSB0byBhbGxvY2F0ZSBtZW1vcnkgdG8gcHJvY2VzcyBjb21tYW5kXG4iKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmKCAoc3RhdHVzID0gZG90MTFmVW5wYWNrUmFkaW9NZWFzdXJlbWVudFJlcXVlc3QoIHBNYWMsICZwQm9keVthcmcyXVswXSwgc2l6ZVthcmcyXSwgZnJtICkpICE9IDAgKQorICAgICAgICAgICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYywgcCwgImZhaWxlZCB0byB1bnBhY2suLi4uLnN0YXR1cyA9ICV4XG4iLCBzdGF0dXMpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgcnJtUHJvY2Vzc1JhZGlvTWVhc3VyZW1lbnRSZXF1ZXN0KCBwTWFjLCBwc2Vzc2lvbkVudHJ5LT5ic3NJZCwgZnJtLCBwc2Vzc2lvbkVudHJ5ICk7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUoZnJtKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGJyZWFrOworICAgICAgY2FzZSA0OgorICAgICAgICAgeworICAgICAgICAgICAgdERvdDExZk5laWdoYm9yUmVwb3J0UmVzcG9uc2UgKmZybSA9CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fbWFsbG9jKHNpemVvZih0RG90MTFmTmVpZ2hib3JSZXBvcnRSZXNwb25zZSkpOworICAgICAgICAgICAgaWYgKCFmcm0pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcCArPSBsb2dfc3ByaW50ZihwTWFjLCBwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJVbmFibGUgdG8gYWxsb2NhdGUgbWVtb3J5IHRvIHByb2Nlc3MgY29tbWFuZFxuIik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwQm9keVthcmcyXVsyXSA9ICh0QU5JX1U4KWFyZzM7IC8vRGlhbG9nIFRva2VuCisgICAgICAgICAgICBpZiggKHN0YXR1cyA9IGRvdDExZlVucGFja05laWdoYm9yUmVwb3J0UmVzcG9uc2UoIHBNYWMsICZwQm9keVthcmcyXVswXSwgc2l6ZVthcmcyXSwgZnJtICkpICE9IDAgKQorICAgICAgICAgICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYywgcCwgImZhaWxlZCB0byB1bnBhY2suLi4uLnN0YXR1cyA9ICV4XG4iLCBzdGF0dXMpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgcnJtUHJvY2Vzc05laWdoYm9yUmVwb3J0UmVzcG9uc2UoIHBNYWMsIGZybSwgcHNlc3Npb25FbnRyeSApOworICAgICAgICAgICAgdm9zX21lbV9mcmVlKGZybSk7CisgICAgICAgICB9CisgICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgNToKKyAgICAgICAgIHsKKy8vIEZJWE1FLgorICAgICAgICAgfQorICAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIDY6CisgICAgICAgICB7CisgICAgICAgICAgICB0UG93ZXJkQm0gbG9jYWxDb25zdHJhaW50ID0gKHRQb3dlcmRCbSkgYXJnMzsKKyAgICAgICAgICAgIHRQb3dlcmRCbSBtYXhUeFBvd2VyID0gY2ZnR2V0UmVndWxhdG9yeU1heFRyYW5zbWl0UG93ZXIoIHBNYWMsIHBzZXNzaW9uRW50cnktPmN1cnJlbnRPcGVyQ2hhbm5lbCApOyAKKyAgICAgICAgICAgIG1heFR4UG93ZXIgPSBWT1NfTUlOKCBtYXhUeFBvd2VyLCBtYXhUeFBvd2VyLWxvY2FsQ29uc3RyYWludCApOworICAgICAgICAgICAgaWYoIG1heFR4UG93ZXIgIT0gcHNlc3Npb25FbnRyeS0+bWF4VHhQb3dlciApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBycm1TZW5kU2V0TWF4VHhQb3dlclJlcSggcE1hYywgbWF4VHhQb3dlciwgcHNlc3Npb25FbnRyeSApO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ZXR1cm4gcDsKKyAgICB9CisKKyAgICBzd2l0Y2ggKGFyZzEpCisgICAgeworICAgICAgICAgY2FzZSAwOgorICAgICAgICAgICAgICAvLyBTZW5kIFByZS1hdXRoIGV2ZW50CisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0qLworICAgICAgICAgICAgICAgICAgIHAgKz0gbG9nX3NwcmludGYoIHBNYWMscCwgIlByZXBhcmluZyBQcmUgQXV0aCBSZXEgbWVzc2FnZVxuIik7CisgICAgICAgICAgICAgICAgICAgYXV0aF9yZXFfbGVuID0gc2l6ZW9mKHRTaXJGVFByZUF1dGhSZXEpOworCisgICAgICAgICAgICAgICAgICAgcGZ0UHJlQXV0aFJlcSA9IHZvc19tZW1fbWFsbG9jKGF1dGhfcmVxX2xlbik7CisgICAgICAgICAgICAgICAgICAgaWYgKE5VTEwgPT0gcGZ0UHJlQXV0aFJlcSkKKyAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgIHAgKz0gbG9nX3NwcmludGYoIHBNYWMscCwiUHJlIGF1dGggZHVtcDogQWxsb2NhdGVNZW1vcnkoKSBmYWlsZWQgXG4iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHA7CisgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgIHBmdFByZUF1dGhSZXEtPnBic3NEZXNjcmlwdGlvbiA9IHZvc19tZW1fbWFsbG9jKHNpemVvZihQcm9maWxlLnBCc3NEZXNjLT5sZW5ndGgpKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQcm9maWxlLnBCc3NEZXNjLT5sZW5ndGgpOworCisgICAgICAgICAgICAgICAgICAgcGZ0UHJlQXV0aFJlcS0+bWVzc2FnZVR5cGUgPSBlV05JX1NNRV9GVF9QUkVfQVVUSF9SRVE7CisgICAgICAgICAgICAgICAgICAgcGZ0UHJlQXV0aFJlcS0+bGVuZ3RoID0gYXV0aF9yZXFfbGVuICsgc2l6ZW9mKFByb2ZpbGUucEJzc0Rlc2MtPmxlbmd0aCkgKworICAgICAgICAgICAgICAgICAgICAgICBQcm9maWxlLnBCc3NEZXNjLT5sZW5ndGg7CisgICAgICAgICAgICAgICAgICAgcGZ0UHJlQXV0aFJlcS0+cHJlQXV0aGNoYW5uZWxOdW0gPSA2OyAKKworICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgodm9pZCAqKSAmcGZ0UHJlQXV0aFJlcS0+Y3VycmJzc0lkLAorICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKXBzZXNzaW9uRW50cnktPmJzc0lkLCA2KTsgIAorICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgodm9pZCAqKSAmcGZ0UHJlQXV0aFJlcS0+cHJlQXV0aGJzc0lkLAorICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKW1hY0FkZHIsIDYpOyAgCisgICAgICAgICAgICAgICAgICAgcGZ0UHJlQXV0aFJlcS0+ZnRfaWVzX2xlbmd0aCA9ICh0QU5JX1UxNilwTWFjLT5mdC5mdFNtZUNvbnRleHQuYXV0aF9mdF9pZXNfbGVuZ3RoOworCisgICAgICAgICAgICAgICAgICAgLy8gQWxzbyBzZXR1cCB0aGUgbWFjIGFkZHJlc3MgaW4gc21lIGNvbnRleHQuCisgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBNYWMtPmZ0LmZ0U21lQ29udGV4dC5wcmVBdXRoYnNzSWQsIG1hY0FkZHIsIDYpOworCisgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBmdFByZUF1dGhSZXEtPmZ0X2llcywgcE1hYy0+ZnQuZnRTbWVDb250ZXh0LmF1dGhfZnRfaWVzLCAKKyAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+ZnQuZnRTbWVDb250ZXh0LmF1dGhfZnRfaWVzX2xlbmd0aCk7CisKKyAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoUHJvZmlsZS5wQnNzRGVzYy0+YnNzSWQsIG1hY0FkZHIsIDYpOworCisgICAgICAgICAgICAgICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiXG4gLS0tLS0gTElNIERlYnVnIEluZm9ybWF0aW9uIC0tLS0tIFxuIik7CisgICAgICAgICAgICAgICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYywgcCwgIiVzOiBsZW5ndGggPSAlZFxuIiwgX19mdW5jX18sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpbnQpcE1hYy0+ZnQuZnRTbWVDb250ZXh0LmF1dGhfZnRfaWVzX2xlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYywgcCwgIiVzOiBsZW5ndGggPSAlMDJ4XG4iLCBfX2Z1bmNfXywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludClwTWFjLT5mdC5mdFNtZUNvbnRleHQuYXV0aF9mdF9pZXNbMF0pOworICAgICAgICAgICAgICAgICAgIHAgKz0gbG9nX3NwcmludGYoIHBNYWMsIHAsICIlczogQXV0aCBSZXEgJTAyeCAlMDJ4ICUwMnhcbiIsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBwZnRQcmVBdXRoUmVxLT5mdF9pZXNbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGZ0UHJlQXV0aFJlcS0+ZnRfaWVzWzFdLCBwZnRQcmVBdXRoUmVxLT5mdF9pZXNbMl0pOworCisgICAgICAgICAgICAgICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYywgcCwgIiVzOiBTZXNzaW9uICUwMnggJTAyeCAlMDJ4XG4iLCBfX2Z1bmNfXywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+YnNzSWRbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+YnNzSWRbMV0sIHBzZXNzaW9uRW50cnktPmJzc0lkWzJdKTsKKyAgICAgICAgICAgICAgICAgICBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLCBwLCAiJXM6IFNlc3Npb24gJTAyeCAlMDJ4ICUwMnggJXBcbiIsIF9fZnVuY19fLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZnRQcmVBdXRoUmVxLT5jdXJyYnNzSWRbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGZ0UHJlQXV0aFJlcS0+Y3VycmJzc0lkWzFdLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZnRQcmVBdXRoUmVxLT5jdXJyYnNzSWRbMl0sIHBmdFByZUF1dGhSZXEpOworCisgICAgICAgICAgICAgICAgICAgUHJvZmlsZS5wQnNzRGVzYy0+Y2hhbm5lbElkID0gKHRBTklfVTgpYXJnMzsKKyAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHZvaWQgKilwZnRQcmVBdXRoUmVxLT5wYnNzRGVzY3JpcHRpb24sICh2b2lkICopUHJvZmlsZS5wQnNzRGVzYywgCisgICAgICAgICAgICAgICAgICAgICAgIFByb2ZpbGUucEJzc0Rlc2MtPmxlbmd0aCk7ICAKKworICAgICAgICAgICAgICAgICAgIG1zZy50eXBlID0gZVdOSV9TTUVfRlRfUFJFX0FVVEhfUkVROworICAgICAgICAgICAgICAgICAgIG1zZy5ib2R5cHRyID0gcGZ0UHJlQXV0aFJlcTsKKyAgICAgICAgICAgICAgICAgICBtc2cuYm9keXZhbCA9IDA7CisKKyAgICAgICAgICAgICAgICAgICBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLCBwLCAibGltUG9zdE1zZ0FwaShlV05JX1NNRV9GVF9QUkVfQVVUSF9SRVEpIFxuIik7CisgICAgICAgICAgICAgICAgICAgbGltUG9zdE1zZ0FwaShwTWFjLCAmbXNnKTsKKyAgICAgICAgICA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XNzaW9uIGlkPiIsICAgICAgICAgICAgZHVtcF9saW1faW5mb30sCisgICAgezMwMSwgICAiUEUuTElNOiBkdW1wIFRTUEVDIFRhYmxlIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkdW1wX2xpbV90c3BlY190YWJsZX0sCisgICAgezMwMiwgICAiUEUuTElNOiBkdW1wIHNwZWNpZmllZCBUU1BFQyBlbnRyeSAoaWQpIiwgICAgICAgICAgICAgICBkdW1wX2xpbV90c3BlY19lbnRyeX0sCisgICAgezMwMywgICAiUEUuTElNOiBkdW1wIEVEQ0EgcGFyYW1zIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkdW1wX2xpbV9lZGNhX3BhcmFtc30sCisgICAgezMwNCwgICAiUEUuTElNOiBkdW1wIERQSCB0YWJsZSBzdW1tYXJ5IiwgICAgICAgICAgICAgICAgICAgICAgICBkdW1wX2xpbV9kcGhfdGFibGVfc3VtbWFyeX0sCisgICAgezMwNSwgICAiUEUuTElNOiBkdW1wIGxpbmsgbW9uaXRvciBzdGF0cyIsICAgICAgICAgICAgICAgICAgICAgICBkdW1wX2xpbV9saW5rX21vbml0b3Jfc3RhdHN9LAorICAgIHszMDYsICAgIlBFLkxJTTpkdW1wIFNldCB0aGUgQkFSIERlY2xpbmUgc3RhdChhcmcxPSAxLzAgKGVuYWJsZS9kaXNhYmxlKSBhcmcyID1USUQiLCAgICAgICAgICBkdW1wX2xpbV9BZGRCQV9EZWNsaW5lU3RhdH0sCisgICAgezMwNywgICAiUEU6IExJTTogZHVtcCBDU1IgU2VuZCBSZUFzc29jUmVxIiwgICAgICAgICAgICAgICAgICAgICBkdW1wX2xpbV9zbWVfcmVhc3NvY19yZXF9LAorICAgIHszMDgsICAgIlBFOkxJTTogZHVtcCBhbGwgMTFIIHJlbGF0ZWQgZGF0YSIsICAgICAgICAgICAgICAgICAgICAgZHVtcF9saW1fZG90MTFoX3N0YXRzfSwKKyAgICB7MzA5LCAgICJQRTpMSU06IGR1bXAgd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+IiwgICAgICAgICAgICAgIGR1bXBfbGltX2FkZF9zdGF9LAorICAgIHszNDMsICAgIlBFLkxJTTogRGVsU3RhIDxhaWQ+IiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHVtcF9saW1fZGVsX3N0YX0sCisgICAgezM0NCwgICAiUEUuTElNOiBTZXQgcHJvYmUgcmVzcG9uZCBmbGFnIiwgICAgICAgICAgICAgICAgICAgICAgICBkdW1wX2xpbV9wcm9iZXJlc3BfdG9nZ2xlfSwKKyAgICB7MzQ1LCAgICJQRS5MSU06IHNldCBwcm90ZWN0aW9uIGNvbmZpZyBiaXRtYXAiLCAgICAgICAgICAgICAgICAgIHNldF9saW1fcHJvdF9jZmd9LAorICAgIHszNDYsICAgIlBFOkxJTTogU2V0IHRoZSBEb3QxMSBNb2RlIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHVtcF9saW1fc2V0X2RvdDExX21vZGV9LAorICAgIHszNDcsICAgIlBFOkVuYWJsZSBvciBEaXNhYmxlIFByb3RlY3Rpb24iLCAgICAgICAgICAgICAgICAgICAgICAgZHVtcF9saW1fc2V0X3Byb3RlY3Rpb25fY29udHJvbH0sCisgICAgezM0OCwgICAiUEU6TElNOiBTZW5kIFNNIFBvd2VyIE1vZGUgQWN0aW9uIGZyYW1lIiwgICAgICAgICAgICAgICBkdW1wX2xpbV9zZW5kX1NNX1Bvd2VyX01vZGV9LAorICAgIHszNDksICAgIlBFOiBMSU06IENoYW5nZSBDQiBNb2RlIDxzZXNzaW9uIGlkPiA8c2VjIGNobmwgb2Zmc2V0PiIsZHVtcF9saW1fdXBkYXRlX2NiX01vZGV9LAorICAgIHszNTAsICAgIlBFOiBMSU06IGFib3J0IHNjYW4iLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHVtcF9saW1fYWJvcnRfc2Nhbn0sCisgICAgezM1MSwgICAiUEU6IExJTTogU3RhcnQgc3RvcCBCRyBzY2FuIiwgICAgICAgICAgICAgICAgICAgICAgICAgICBkdW1wX2xpbV9zdGFydF9zdG9wX2JnX3NjYW59LAorICAgIHszNTIsICAgIlBFOiBMSU06IFBFIHN0YXRpc3RpY3MgPHNjYW5tYXNrPiIsICAgICAgICAgICAgICAgICAgICAgZHVtcF9saW1fZ2V0X3BlX3N0YXRpc3RpY3N9LAorICAgIHszNTMsICAgIlBFOiBMSU06IFNldCBNQUMgbG9nIGxldmVsIDxNYWMgTW9kdWxlIElEPiA8TG9nIExldmVsPiIsIGR1bXBfbGltX3NldF9sb2dfbGV2ZWx9LAorICAgIHszNTQsICAgIlBFOiBMSU06IFNldCBTY2FuIGluIFBvd2VyIFNhdmUgPDAtZGlzYWJsZSwgMS1lbmFibGU+IiwgIGR1bXBfbGltX3NldF9zY2FuX2luX3Bvd2Vyc2F2ZX0sCisgICAgezM1NSwgICAiUEUuTElNOiBzZW5kIHNtZSBzdGFydCBCU1MgcmVxdWVzdCIsICAgICAgICAgICAgICAgICAgICBkdW1wX2xpbV9zZW5kX3N0YXJ0X2Jzc19yZXF9LAorICAgIHszNTYsICAgIlBFLkxJTTogZHVtcCBwZXNlc3Npb24gaW5mbyAiLCAgICAgICAgICAgICAgICAgICAgICAgICAgZHVtcF9saW1fc2Vzc2lvbl9wcmludH0sCisgICAgezM1NywgICAiUEUuTElNOiBzZW5kIERpc0Fzc29jUmVxdWVzdCIsICAgICAgICAgICAgICAgICAgICAgICAgICBkdW1wX2xpbV9zZW5kX2Rpc2Fzc29jX3JlcX0sCisgICAgezM1OCwgICAiUEUuTElNOiBzZW5kIHNtZSBzdG9wIGJzcyByZXF1ZXN0IDxzZXNzaW9uIElEPiIsICAgICAgICBkdW1wX2xpbV9zdG9wX2Jzc19yZXF9LCAKKyAgICB7MzU5LCAgICJQRS5MSU06IHNlbmQgc21lIGpvaW4gcmVxdWVzdCIsICAgICAgICAgICAgICAgICAgICAgICAgIGR1bXBfbGltX3NlbmRfam9pbl9yZXF9LAorI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJ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hlIFdMQU4gUHJvdG9jb2wgRW5naW5lIGZvcgorICBQMlAuCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICBFRElUIEhJU1RPUlkgRk9SIEZJTEUKKworCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLgorICBOb3RpY2UgdGhhdCBjaGFuZ2VzIGFyZSBsaXN0ZWQgaW4gcmV2ZXJzZSBjaHJvbm9sb2dpY2FsIG9yZGVyLgorCisKKyAgICRIZWFkZXIkJERhdGVUaW1lJCRBdXRob3IkCisKKworICB3aGVuICAgICAgICB3aG8gICAgIHdoYXQsIHdoZXJlLCB3aHkKKy0tLS0tLS0tLS0gICAgLS0tICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisyMDExLTA1LTAyICAgIGRqaW5kYWwgQ29ycmVjdGVkIGZpbGUgaW5kZW50YXRpb24gYW5kIGNoYW5nZWQgcmVtYWluIG9uIGNoYW5uZWwKKyAgICAgICAgICAgICAgICAgICAgICBoYW5kbGluZyBmb3IgY29uY3VycmVuY3kuCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisKKyNpbmNsdWRlICJsaW1VdGlscy5oIgorI2luY2x1ZGUgImxpbVNlc3Npb25VdGlscy5oIgorI2luY2x1ZGUgIndsYW5fcWN0X3dkYS5oIgorCisjZGVmaW5lICAgUFJPQkVfUlNQX0lFX09GRlNFVCAgICAzNgorI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gRW5kIG9mIHJlbWFpbiBvbiBjaGFubmVsIHdpdGggUmVtYWluT25DaGFubmVsTXNnIGFzIFZlbmRvcgorICogU3BlY2lmaWMgaW5mb3JtYXRpb24gZWxlbWVudCBvZiB0aGUgZnJhbWUuCisgKgorICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KK3RTaXJSZXRTdGF0dXMgbGltU2VuZFJlbWFpbk9uQ2hhbm5lbERlYnVnTWFya2VyRnJhbWUodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcmVtYWluT25DaGFubmVsTXNnKQoreworICAgIHRTaXJNYWNBZGRyICAgICAgICAgIG1hZ2ljTWFjQWRkcj0gezB4MTEsIDB4MjIsIDB4MzMsIDB4NDQsIDB4NTUsIDB4NjZ9OworICAgIHRBTklfVTMyICAgICAgICAgICAgIG5CeXRlcywgblBheWxvYWQ7CisgICAgdFNpclJldFN0YXR1cyAgICAgICAgblNpclN0YXR1czsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAqcEZyYW1lOworICAgIHZvaWQgICAgICAgICAgICAgICAgICpwUGFja2V0OworICAgIGVIYWxTdGF0dXMgICAgICAgICAgIGhhbHN0YXR1czsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICB0eEZsYWcgPSAwOworICAgIHB1YmxpY1ZlbmRvclNwZWNpZmljICpwUHVibGljVmVuZG9yU3BlY2lmaWM7CisKKyAgICBwUHVibGljVmVuZG9yU3BlY2lmaWMgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YocHVibGljVmVuZG9yU3BlY2lmaWMpKTsKKyAgICBpZiggcFB1YmxpY1ZlbmRvclNwZWNpZmljID09IE5VTEwgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWF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1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBhbGxvY2F0ZSAlZCBieXRlcyBmb3IgYSBSZW1haW4iCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBvbiBjaGFubmVsIGFjdGlvbiBmcmFtZS4iKSwgbkJ5dGVzICk7CisgICAgICAgIG5TaXJTdGF0dXMgPSBlU0lSX01FTV9BTExPQ19GQUlMRUQ7CisgICAgICAgIGdvdG8gZW5kOworICAgIH0KKyAgICB2b3NfbWVtX3plcm8oIHBGcmFtZSwgbkJ5dGVzICk7CisKKyAgICAvLyBQb3B1bGF0ZSBmcmFtZSB3aXRoIE1BQyBoZWFkZXIKKyAgICBuU2lyU3RhdHVzID0gbGltUG9wdWxhdGVNYWNIZWFkZXIoIHBNYWMsIHBGcmFtZSwgU0lSX01BQ19NR01UX0ZSQU1FLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX01HTVRfQUNUSU9OLCBtYWdpY01hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nU2VsZk1hY0FkZHIpOworICAgIGlmICggZVNJUl9TVUNDRVNTICE9IG5TaXJTdGF0dXMgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIHBvcHVsYXRlIHRoZSBidWZmZXIgZGVzY3JpcHRvciBmb3IgYSIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIEFjdGlvbiBmcmFtZSBmb3IgcmVtYWluIG9uIGNoYW5uZWwuIikgKTsKKyAgICAgICAgcGFsUGt0RnJlZSggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULAorICAgICAgICAgICAgICAgICAgICAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworICAgICAgICBnb3RvIGVuZDsKKyAgICB9CisKKyAgICAvLyBDb3B5IFB1YmxpYyBWZW5kb3Igc3BlY2lmaWMgZmllbGRzIHRvIGZyYW1lJ3MgaW5mb3JtYXRpb24gZWxlbWVudAorICAgIHZvc19tZW1fY29weSggKHBGcmFtZSArIChzaXplb2YoIHRTaXJNYWNNZ210SGRyICkpKSwKKyAgICAgICAgICAgICAgICAgICBwUHVibGljVmVuZG9yU3BlY2lmaWMsIHNpemVvZihwdWJsaWNWZW5kb3JTcGVjaWZpYykgKTsKKyAgICAvLyBDb3B5IFJlbWFpbiBPbiBjaGFubmVsIG1lc3NhZ2UgdG8gVmVuZG9yIFNwZWNpZmljIGluZm9ybWF0aW9uIGZpZWxkCisgICAgdm9zX21lbV9jb3B5KCAocEZyYW1lICsgKG5CeXRlcyAtIHBQdWJsaWNWZW5kb3JTcGVjaWZpYy0+bGVuZ3RoKSksCisgICAgICAgICAgICAgICAgICAgcmVtYWluT25DaGFubmVsTXNnLCBwUHVibGljVmVuZG9yU3BlY2lmaWMtPmxlbmd0aCApOworCisgICAgaGFsc3RhdHVzID0gaGFsVHhGcmFtZSggcE1hYywgcFBhY2tldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIHRBTklfVTE2ICkgc2l6ZW9mKHRTaXJNYWNNZ210SGRyKSArIG5QYXlsb2FkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTklfVFhESVJfVE9EUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA3LC8vU01BQ19TV0JEX1RYX1RJRF9NR01UX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltVHhDb21wbGV0ZSwgcEZyYW1lLCB0eEZsYWcgKTsKKyAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTICggaGFsc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCB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LS0tLS0tLS0tLSovCitlSGFsU3RhdHVzIGxpbVByZXBhcmVBbmRTZW5kQ2FuY2VsUmVtYWluT25DaGFubmVsTXNnKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGlkKQoreworICAgIHRBTklfVTggKmNhbmNlbFJlbWFpbk9uQ2hhbm5lbE1zZzsKKyAgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisKKyAgICBjYW5jZWxSZW1haW5PbkNoYW5uZWxNc2cgPSB2b3NfbWVtX21hbGxvYyggUkVNQUlOX09OX0NIQU5ORUxfTVNHX1NJWkUgKTsKKyAgICBpZiggTlVMTCA9PSBjYW5jZWxSZW1haW5PbkNoYW5uZWxNc2cgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgIEZMKCAiVW5hYmxlIHRvIGFsbG9jYXRlIG1lbW9yeSBmb3IgZW5kIG9mIgorICAgICAgICAgICAgICAgICAgICAiIHJlbWFpbiBvbiBjaGFubmVsIG1lc3NhZ2UiICkpOworICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICB9CisKKyAgICBzbnByaW50ZihjYW5jZWxSZW1haW5PbkNoYW5uZWxNc2csIFJFTUFJTl9PTl9DSEFOTkVMX01TR19TSVpFLAorICAgICAgICAgICAgIkNBTkNFTC1SRU1BSU4tT04tQ0hBTk5FTCVkLVNFUT0lZCIsCisgICAgICAgICAgICBpZCwgcE1hYy0+bGltLnJlbU9uQ2huU2VxTnVtKTsKKyAgICBpZiggZVNJUl9GQUlMVVJFID09IGxpbVNlbmRSZW1haW5PbkNoYW5uZWxEZWJ1Z01hcmtlckZyYW1lKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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uIHRvIFNNRQorICAgIGlmKHBNYWMtPmxpbS5ncExpbVJlbWFpbk9uQ2hhblJlcSkKKyAgICB7CisgICAgICAgIGxpbVNlbmRTbWVSc3AocE1hYywgZVdOSV9TTUVfUkVNQUlOX09OX0NITl9SRFlfSU5ELCBlSEFMX1NUQVRVU19TVUNDRVNTLCAKKyAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5ncExpbVJlbWFpbk9uQ2hhblJlcS0+c2Vzc2lvbklkLCAwKTsgCisgICAgICAgIGlmKHBNYWMtPmxpbS5nRGVidWdQMnBSZW1haW5PbkNoYW5uZWwpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKCBlSEFMX1NUQVRVU19TVUNDRVNTID09IGxpbVByZXBhcmVBbmRTZW5kU3RhcnRSZW1haW5PbkNoYW5uZWxNc2coCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNc2dSZW1haW5vbkNoYW5uZWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVNQUlOX09OX0NIQU5ORUxfU0VDT05EX01BUktFUl9GUkFNRSkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICIlczogU3VjY2Vzc2Z1bGx5IHNlbnQgMm5kIE1hcmtlciBmcmFtZSAiCisgICAgICAgICAgICAgICAgICAgICAgICAic2VxIG51bSA9ICVkIG9uIHN0YXJ0IFJPQyIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLnJlbU9uQ2huU2VxTnVtKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAvL1RoaXMgaXMgcG9zc2libGUgaW4gY2FzZSByZW1haW4gb24gY2hhbm5lbC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5LT5wZVNlc3Npb25JZCA9IHNlc3Npb25JZDsKKworICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID0gZUxJTV9QMlBfREVWSUNFX1JPTEU7CisgICAgICAgIENGR19HRVRfU1RSKCBuU2lyU3RhdHVzLCBwTWFjLCAgV05JX0NGR19TVVBQT1JURURfUkFURVNfMTFBLAorICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cmF0ZVNldC5yYXRlLCB2YWwgLCBTSVJfTUFDX01BWF9OVU1CRVJfT0ZfUkFURVMgKTsKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+cmF0ZVNldC5udW1SYXRlcyA9IHZhbDsKKworICAgICAgICBDRkdfR0VUX1NUUiggblNpclN0YXR1cywgcE1hYywgV05JX0NGR19FWFRFTkRFRF9PUEVSQVRJT05BTF9SQVRFX1NFVCwKKyAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmV4dFJhdGVTZXQucmF0ZSwgdmFsLAorICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19FWFRFTkRFRF9PUEVSQVRJT05BTF9SQVRFX1NFVF9MRU4gKTsKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+ZXh0UmF0ZVNldC5udW1SYXRlcyA9IHZhbDsKKworICAgICAgICBzaXJDb3B5TWFjQWRkcihwc2Vzc2lvbkVudHJ5LT5zZWxmTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwTGltUmVtYWluT25DaGFuUmVxLT5zZWxmTWFjQWRkcik7CisKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+Y3VycmVudE9wZXJDaGFubmVsID0gcE1hYy0+bGltLmdwTGltUmVtYWluT25DaGFuUmVxLT5jaG5OdW07CisgICAgICAgIG5TaXJTdGF0dXMgPSBlU0lSX1NVQ0NFU1M7CisgICAgICAgICpwcFAycFNlc3Npb24gPSBwc2Vzc2lvbkVudHJ5OworICAgIH0KKwor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wgRkwoIiBTdXNwZW5kIGxpbmsgRmFpbHVyZSAiKSApOykKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICB9CisKKworICAgIGlmKChwc2Vzc2lvbkVudHJ5ID0gcGVGaW5kU2Vzc2lvbkJ5QnNzaWQoCisgICAgICAgIHBNYWMscE1hYy0+bGltLmdwTGltUmVtYWluT25DaGFuUmVxLT5zZWxmTWFjQWRkciwgJnNlc3Npb25JZCkpICE9IE5VTEwpCisgICAgeworICAgICAgICBnb3RvIGNoYW5nZV9jaGFubmVsOworICAgIH0KKyAgICBlbHNlIC8qIFNlc3Npb24gRW50cnkgZG9lcyBub3QgZXhpc3QgZm9yIGdpdmVuIEJTU0lkICovCisgICAgeworICAgICAgICAvKiBUcnkgdG8gQ3JlYXRlIGEgbmV3IHNlc3Npb24gKi8KKyAgICAgICAgaWYoZVNJUl9TVUNDRVNTICE9IGxpbUNyZWF0ZVNlc3Npb25Gb3JSZW1haW5PbkNobihwTWFjLCAmcHNlc3Npb25FbnRyeSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiU2Vzc2lvbiBDYW4gbm90IGJlIGNyZWF0ZWQgIikpOworICAgICAgICAgICAgLyogc2VuZCByZW1haW4gb24gY2huIGZhaWx1cmUgKi8KKyAgICAgICAgICAgIGdvdG8gZXJyb3I7CisgICAgICAgIH0KKyAgICB9CisKK2NoYW5nZV9jaGFubmVsOgorICAgIC8qIGNoYW5nZSBjaGFubmVsIHRvIHRoZSByZXF1ZXN0ZWQgYnkgUmVtYWluT24gQ2huKi8KKyAgICBsaW1DaGFuZ2VDaGFubmVsV2l0aENhbGxiYWNrKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ3BMaW1SZW1haW5PbkNoYW5SZXEtPmNobk51bSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVJlbWFpbk9uQ2hubFNldExpbmtTdGF0LCBOV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lyTWFjQWRkciAgICAgICAgICAgICBudWxsQnNzaWQgPSB7MHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH07CisKKyAgICBpZiAoc3RhdHVzICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MpCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJDaGFuZ2UgY2hhbm5lbCBub3Qgc3VjY2Vzc2Z1bCIpKTsKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICB9CisKKyAgICAvLyBTdGFydCB0aW1lciBoZXJlIHRvIGNvbWUgYmFjayB0byBvcGVyYXRpbmcgY2hhbm5lbC4KKyAgICBwTWFjLT5saW0ucDJwUmVtT25DaGFuVGltZVN0YW1wID0gdm9zX3RpbWVyX2dldF9zeXN0ZW1fdGltZSgpOworICAgIHBNYWMtPmxpbS5nVG90YWxTY2FuRHVyYXRpb24gPSBNc2dSZW1haW5vbkNoYW5uZWwtPmR1cmF0aW9uOworICAgIGlmIChwTWFjLT5saW0uZ0RlYnVnUDJwUmVtYWluT25DaGFubmVsKQorICAgIHsKKyAgICAgICAgcE1hYy0+bGltLnJlbU9uQ2huU2VxTnVtKys7CisgICAgICAgIGlmKCBlSEFMX1NUQVRVU19TVUNDRVNTID09IGxpbVByZXBhcmVBbmRTZW5kU3RhcnRSZW1haW5PbkNoYW5uZWxNc2coCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYywgTXNnUmVtYWlub25DaGFubmVsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJFTUFJTl9PTl9DSEFOTkVMX0ZJUlNUX01BUktFUl9GUkFNRSkgKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICIlczogU3VjY2Vzc2Z1bGx5IHNlbnQgMXN0IG1hcmtlciBmcmFtZSB3aXRoIHNlcSBudW0gPSAlZCIKKyAgICAgIC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2JhbCBwTWFjICkKK3sKKyAgICB0QU5JX1UzMiBjdXJyZW50VGltZTsKKyAgICB0QU5JX1UzMiBsYXN0VGltZSA9IDA7CisgICAgdEFOSV9VMzIgdGltZURpZmY7CisgICAgdEFOSV9VOCBpOworICAgIGN1cnJlbnRUaW1lID0gdm9zX3RpbWVyX2dldF9zeXN0ZW1fdGltZSgpOworICAgIGZvciAoaSA9IDE7IGkgPCBTSVJfTUFYXzI0R181R19DSEFOTkVMX1JBTkdFIDsgaSsrKQorICAgIHsKKyAgICAgICAgaWYgKChwTWFjLT5saW0uZGZzY2hhbm5lbExpc3QudGltZVN0YW1wW2ldKSAhPSAwKQorICAgICAgICB7CisgICAgICAgICAgICBsYXN0VGltZSA9IHBNYWMtPmxpbS5kZnNjaGFubmVsTGlzdC50aW1lU3RhbXBbaV07CisgICAgICAgICAgICBpZiAoY3VycmVudFRpbWUgPj0gbGFzdFRpbWUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdGltZURpZmYgPSAoY3VycmVudFRpbWUgLSBsYXN0VGltZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdGltZURpZmYgPSAoMHhGRkZGRkZGRiAtIGxhc3RUaW1lKSArIGN1cnJlbnRUaW1lOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAodGltZURpZmYgPj0gTUFYX1RJTUVfVE9fQkVfQUNUSVZFX0NIQU5ORUwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltQ292ZXJ0Q2hhbm5lbFNjYW5UeXBlKCBwTWFjLCBpLEZBTFNFKTsKKyAgICAgICAgICAgICAgICBwTWFjLT5saW0uZGZzY2hhbm5lbExpc3QudGltZVN0YW1wW2ldID0gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICAvKiBsYXN0VGltZSBpcyB6ZXJvIGlmIHRoZXJlIGlzIG5vIERGUyBhY3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bWFpbk9uQ2hhblJlcSkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgIk5vIFJlbWFpbiBvbiBjaGFubmVsIHBlbmRpbmciKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmKHBNYWMtPmxpbS5nRGVidWdQMnBSZW1haW5PbkNoYW5uZWwpCisgICAgeworICAgICAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyA9PSBsaW1QcmVwYXJlQW5kU2VuZENhbmNlbFJlbWFpbk9uQ2hhbm5lbE1zZygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJFTUFJTl9PTl9DSEFOTkVMX0ZJUlNUX01BUktFUl9GUkFNRSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgIiVzOiBTdWNjZXNzZnVsbHkgc2VudCAxc3QgbWFya2VyIGZyYW1lIHdpdGggc2VxbnVtID0gJWQiCisgICAgICAgICAgICAgICAgICAgICIgb24gY2FuY2VsIFJPQyIsIF9fZnVuY19fLCBwTWFjLT5saW0ucmVtT25DaG5TZXFOdW0pOworICAgICAgICB9CisgICAgfQorCisgICAgLyogZ2V0IHRoZSBwcmV2aW91cyB2YWxpZCBMSU5LIHN0YXRlICovCisgICAgaWYgKGxpbVNldExpbmtTdGF0ZShwTWFjLCBlU0lSX0xJTktfSURMRV9TVEFURSwgbnVsbEJzc2lkLAorICAgICAgICBwTWFjLT5saW0uZ1NlbGZNYWNBZGRyLCBsaW1TZXRsaW5rU3RhdGVDYWxsYmFjaywgTlVMTCkgIT0gZVNJUl9TVUNDRVNTKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCAiVW5hYmxlIHRvIGNoYW5nZSBsaW5rIHN0YXRlIik7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBpZiAocE1hYy0+bGltLmdMaW1NbG1TdGF0ZSAgIT0gZUxJTV9NTE1fUDJQX0xJU1RFTl9TVEFURSApCisgICAgeworICAgICAgICBsaW1SZW1haW5PbkNoblJzcChwTWFjLGVIQUxfU1RBVFVTX1NVQ0NFU1MsIE5VTEwpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAvKiBnZXQgdGhlIHNlc3Npb24gKi8KKyAgICAgICAgaWYoKHBzZXNzaW9uRW50cnkgPSBwZUZpbmRTZXNzaW9uQnlCc3NpZCgKKyAgICAgICAgICAgIHBNYWMscE1hYy0+bGltLmdwTGltUmVtYWluT25DaGFuUmVxLT5zZWxmTWFjQWRkciwgJnNlc3Npb25JZCkpID09IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgRkwoIlNlc3Npb24gRG9lcyBub3QgZXhpc3QgZm9yIGdpdmVuIHNlc3Npb25JRCIpKTsKKyAgICAgICAgICAgIGdvdG8gZXJyb3I7CisgICAgICAgIH0KKworICAgICAgICBsaW1FeGl0UmVtYWluT25DaGFubmVsKHBNYWMsIGVIQUxfU1RBVFVTX1NVQ0NFU1MsIE5VTEwsIHBzZXNzaW9uRW50cnkpOworICAgICAgICByZXR1cm47CitlcnJvcjoKKyAgICAgICAgbGltUmVtYWluT25DaG5Sc3AocE1hYyxlSEFMX1NUQVRVU19GQUlMVVJFLCBOVUxMKTsKKyAgICB9CisgICAgcmV0dXJuOworfQorCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKgorICogbGltY2hhbm5lbGNoYW5nZSBjYWxsYmFjaywgb24gc3VjY2VzcyBjaGFubmVsIGNoYW5nZSwgc2V0IHRoZSBsaW5rX3N0YXRlCisgKiB0byBMSVNURU4KKyA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hlIE1nbXQgRnJhbWUgcmVjZWl2ZWQgdG8gU01FIHRvIEhERCBjYWxsYmFjaworICogaGFuZGxlIFByb2JlX3JlcS9BY3Rpb24gZnJhbWUgY3VycmVudGx5CisgKgorICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwordm9pZCBsaW1TZW5kU21lTWdtdEZyYW1lSW5kKAorICAgICAgICAgICAgICAgICAgICB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UxNiBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBSeFBhY2tldEluZm8sIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnksCisgICAgICAgICAgICAgICAgICAgIHRBTklfUzggcnhSc3NpKQoreworICAgIHRwU2lyU21lTWdtdEZyYW1lSW5kICBwU2lyU21lTWdtdEZyYW1lID0gTlVMTDsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgbGVuZ3RoOworICAgIHRBTklfVTggICAgICAgICAgICAgICBmcmFtZVR5cGU7CisgICAgdHBTaXJNYWNNZ210SGRyICAgICAgIGZyYW1lOworICAgIHRBTklfVTMyICAgICAgICAgICAgICBmcmFtZUxlbjsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgcmZCYW5kID0gMDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgcnhDaGFubmVsOworCisgICAgZnJhbWUgPSBXREFfR0VUX1JYX01BQ19IRUFERVIocFJ4UGFja2V0SW5mbyk7CisgICAgZnJhbWVMZW4gPSBXREFfR0VUX1JYX1BBWUxPQURfTEVOKHBSeFBhY2tldEluZm8pICsgc2l6ZW9mKHRTaXJNYWNNZ210SGRyKTsKKyAgICBsZW5ndGggPSBzaXplb2YodFNpclNtZU1nbXRGcmFtZUluZCkgKyBmcmFtZUxlbjsKKyAgICBmcmFtZVR5cGUgPSBmcmFtZS0+ZmMuc3ViVHlwZTsKKyAgICByZkJhbmQgPSBXREFfR0VUX1JYX1JGQkFORChwUnhQYWNrZXRJbmZvKTsKKyAgICByeENoYW5uZWwgPSBXREFfR0VUX1JYX0NIKCBwUnhQYWNrZXRJbmZvICk7CisKKyAgICBwU2lyU21lTWdtdEZyYW1lID0gdm9zX21lbV9tYWxsb2MobGVuZ3RoKTsKKyAgICBpZiAoTlVMTCA9PSBwU2lyU21lTWdtdEZyYW1lKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICBGTCgiQWxsb2NhdGVNZW1vcnkgZmFpbGVkIGZvciBlV05JX1NNRV9MSVNURU5fUlNQIikpOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIHZvc19tZW1fc2V0KCh2b2lkKilwU2lyU21lTWdtdEZyYW1lLCBsZW5ndGgsIDApOworCisgICAgcFNpclNtZU1nbXRGcmFtZS0+ZnJhbWVMZW4gPSBmcmFtZUxlbjsKKyAgICBwU2lyU21lTWdtdEZyYW1lLT5zZXNzaW9uSWQgPSBzZXNzaW9uSWQ7CisgICAgcFNpclNtZU1nbXRGcmFtZS0+ZnJhbWVUeXBlID0gZnJhbWVUeXBlOworICAgIHBTaXJTbWVNZ210RnJhbWUtPnJ4UnNzaSA9IHJ4UnNzaTsKKworICAgIGlmICgoIElTXzVHX0JBTkQocmZCYW5kKSkpCisgICAgeworICAgICAgICByeENoYW5uZWwgPSBsaW1Vbm1hcENoYW5uZWwocnhDaGFubmVsKTsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICBGTCgicnhDaGFubmVsIGFmdGVyIHVubWFwcGluZyBpcyAlZCIpLCByeENoYW5uZWwpOworICAgICAgICBpZiAoICFyeENoYW5uZWwgKQorICAgICAgICB7CisgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwVGVtcFNlc3Npb25FbnRyeSA9IGxpbUlzQXBTZXNzaW9uQWN0aXZlKHBNYWMpOworICAgICAgICAgICAgaWYocE1hYy0+bGltLmdwTGltUmVtYWluT25DaGFuUmVxICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcnhDaGFubmVsID0gcE1hYy0+bGltLmdwTGltUmVtYWluT25DaGFuUmVxLT5jaG5OdW07CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgICAgRkwoIlJPQyB0aW1lciBpcyBydW5uaW5nLiIKKyAgICAgICAgICAgICAgICAgICAgICAiIEFzc2lnbiBST0MgY2hhbm5lbCB0byByeENoYW5uZWwgaS5lLiwgJWQiKSwgcnhDaGFubmVsKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKCAocFRlbXBTZXNzaW9uRW50cnkgIT0gTlVMTCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAoU0lSX0JBTkRfNV9HSFogIT0KKyAgICAgICAgICAgICAgICAgICAgICAgbGltR2V0UkZCYW5kKHBUZW1wU2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwpKSApCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1csCisgICAgICAgICAgICAgICAgICAgRkwoIk5vIGFjdGl2ZSBwMnAgR08gaW4gNUdIeiIKKyAgICAgICAgICAgICAgICAgICAgICAiICBidXQgcmVjdmQgQWN0aW9uIGZyYW1lIGluIDVHSHoiKSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKgorICAgICAqICBXb3JrIGFyb3VuZCB0byBhZGRyZXNzIExJTSBzZW5kaW5nIHdyb25nIGNoYW5uZWwgdG8gSEREIGZvciBwMnAgYWN0aW9uCisgICAgICogIGZyYW1lcyhJbiBjYXNlIG9mIGF1dG8gR08pIHJlY2lldmVkIG9uIDVHSHogY2hhbm5lbC4KKyAgICAgKiAgQXMgUlhQIGhhcyBvbmx5IDRiaXRzIHRvIHN0b3JlIHRoZSBjaGFubmVsLCB3ZS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GFubmVsKSkgKQorICAgICAgICB7CisgICAgICAgICAgICByeENoYW5uZWwgPSBwVGVtcFNlc3Npb25FbnRyeS0+Y3VycmVudE9wZXJDaGFubmVsOworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgICAgRkwoIkludmFsaWQgcnhDaGFubmVsLiIKKyAgICAgICAgICAgICAgICAgICAgICAiIEFzc2lnbiBHTyBzZXNzaW9uIG9wIGNoYW5uZWwgdG8gcnhDaGFubmVsIGkuZS4sICVkIiksIHJ4Q2hhbm5lbCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwU2lyU21lTWdtdEZyYW1lLT5yeENoYW4gPSByeENoYW5uZWw7CisKKyAgICB2b3NfbWVtX3plcm8ocFNpclNtZU1nbXRGcmFtZS0+ZnJhbWVCdWYsIGZyYW1lTGVuKTsKKyAgICB2b3NfbWVtX2NvcHkocFNpclNtZU1nbXRGcmFtZS0+ZnJhbWVCdWYsIGZyYW1lLCBmcmFtZUxlbik7CisKKyAgICBpZiAocE1hYy0+bWdtdF9mcmFtZV9pbmRfY2IpCisgICAgICAgcE1hYy0+bWdtdF9mcmFtZV9pbmRfY2IocFNpclNtZU1nbXRGcmFtZSk7CisgICAgZWxzZQorICAgIHsKKyAgICAgICBsaW1Mb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgICAgIEZMKCJNYW5hZ2VtZW50IGluZGljYXRpb24gY2FsbGJhY2sgbm90IHJlZ2lzdGVyZWQhISIpKTsKKyAgICB9CisgICAgdm9zX21lbV9mcmVlKHBTaXJTbWVNZ210RnJhbWUpOworICAgIHJldHVybjsKK30gLyoqKiBlbmQgbGltU2VuZFNtZUxpc3RlblJzcCgpICoqKi8KKworCitlSGFsU3RhdHVzIGxpbVAyUEFjdGlvbkNuZih0cEFuaVNpckdsb2JhbCBwTWFjLCB2b2lkICpwRGF0YSkKK3sKKyAgICB0QU5JX1UzMiB0eENvbXBsZXRlU3VjY2VzczsKKyAgICB0cFNpclR4QmRTdGF0dXMgcFR4QmRTdGF0dXM7CisKKyAgICBpZiAoIXBEYXRhKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgRkwoIiBwRGF0YSBpcyBOVUxMIikpOworICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICB9CisKKyAgICBpZiAoSVNfRkVBVFVSRV9TVVBQT1JURURfQllfRlcoRU5IQU5DRURfVFhCRF9DT01QTEVUSU9OKSkKKyAgICB7CisgICAgICAgIHBUeEJkU3RhdHVzID0gKHRwU2lyVHhCZFN0YXR1cykgcERhdGE7CisgICAgICAgIHR4Q29tcGxldGVTdWNjZXNzID0gcFR4QmRTdGF0dXMtPnR4Q29tcGxldGVTdGF0dXM7CisKKyAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgRkwoInR4Q29tcGxldGVTdWNjZXNzICVkLCBUb2tlbiAldSwgU2Vzc2lvbiBJZCAlZCIpLAorICAgICAgICAgICAgICAgIHR4Q29tcGxldGVTdWNjZXNzLCBwVHhCZFN0YXR1cy0+dHhCZFRva2VuLAorICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5tZ210RnJhbWVTZXNzaW9uSWQpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICB0eENvbXBsZXRlU3VjY2VzcyA9ICooKHRBTklfVTMyKikgcERhdGEpOworCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgIEZMKCIgJXMgdHhDb21wbGV0ZVN1Y2Nlc3MgJWQsIFNlc3Npb24gSWQgJWQiKSwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgdHhDb21wbGV0ZVN1Y2Nlc3MsIHBNYWMtPmxpbS5tZ210RnJhbWVTZXNzaW9uSWQpOworICAgIH0KKworICAgIGlmIChwTWFjLT5saW0ubWdtdEZyYW1lU2Vzc2lvbklkICE9IDB4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ICAqcEZyYW1lOworICAgIHZvaWQgICAgICAgICAgICAgICAgKnBQYWNrZXQ7CisgICAgZUhhbFN0YXR1cyAgICAgICAgICBoYWxzdGF0dXM7CisgICAgdEFOSV9VMzIgICAgICAgICAgICB0eEZsYWcgPSAwOworICAgIHRwU2lyTWFjRnJhbWVDdGwgICAgcEZjID0gKHRwU2lyTWFjRnJhbWVDdGwgKSBwTWJNc2ctPmRhdGE7CisgICAgdEFOSV9VOCAgICAgICAgICAgICBub2FMZW4gPSAwOworICAgIHRBTklfVTggICAgICAgICAgICAgbm9hU3RyZWFtW1NJUl9NQVhfTk9BX0FUVFJfTEVOICsgKDIqU0lSX1AyUF9JRV9IRUFERVJfTEVOKV07CisgICAgdEFOSV9VOCAgICAgICAgICAgICBvcmlnTGVuID0gMDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgIHNlc3Npb25JZCA9IDA7CisgICAgdl9VOF90ICAgICAgICAgICAgICAqcFAyUEllID0gTlVMTDsKKyAgICB0cFBFU2Vzc2lvbiAgICAgICAgIHBzZXNzaW9uRW50cnk7CisgICAgdl9VOF90ICAgICAgICAgICAgICAqcFByZXNlbmNlUnNwTm9hQXR0ciA9IE5VTEw7CisgICAgdl9VOF90ICAgICAgICAgICAgICAqcE5ld1AyUEllID0gTlVMTDsKKyAgICB2X1UxNl90ICAgICAgICAgICAgIHJlbWFpbkxlbiA9IDA7CisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgIHRwU2lyTWFjTWdtdEhkciAgICAgICAgcE1hY0hkcjsKKyAgICB0cFNpck1hY0FjdGlvbkZyYW1lSGRyIHBBY3Rpb25IZHI7CisjZW5kaWYKKyAgICBuQnl0ZXMgPSBwTWJNc2ctPm1zZ0xlbiAtIHNpemVvZih0U2lyTWJNc2cpOworCisgICAgbGltTG9nKCBwTWFjLCBMT0cxLCBGTCgic2VuZGluZyBwRmMtPnR5cGU9JWQgcEZjLT5zdWJUeXBlPSVkIiksCisgICAgICAgICAgICAgICAgICAg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7aSsrKQorICAgICAgICB7CisgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5ID0gcGVGaW5kU2Vzc2lvbkJ5U2Vzc2lvbklkKHBNYWMsaSk7CisgICAgICAgICAgICBpZiAoIE5VTEwgIT0gcHNlc3Npb25FbnRyeSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpc1Nlc3Npb25BY3RpdmUgPSAxOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmKCAhaXNTZXNzaW9uQWN0aXZlICkKKyAgICAgICAgeworICAgICAgICAgICAgbGltU2VuZFNtZVJzcChwTWFjLCBlV05JX1NNRV9BQ1RJT05fRlJBTUVfU0VORF9DTkYsIAorICAgICAgICAgICAgICAgICAgICAgICAgICBlSEFMX1NUQVRVU19GQUlMVVJFLCBwTWJNc2ctPnNlc3Npb25JZCwgMCk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICB9CisKKyAgICBpZiAoKFNJUl9NQUNfTUdNVF9GUkFNRSA9PSBwRmMtPnR5cGUpJiYKKyAgICAgICAgKChTSVJfTUFDX01HTVRfUFJPQkVfUlNQID09IHBGYy0+c3ViVHlwZSl8fAorICAgICAgICAoU0lSX01BQ19NR01UX0FDVElPTiA9PSBwRmMtPnN1YlR5cGUpKSkKKyAgICB7CisgICAgICAgIC8vaWYgdGhpcyBpcyBhIHByb2JlIFJTUCBiZWluZyBzZW50IGZyb20gd3BhX3N1cHBsaWNhbnQKKyAgICAgICAgaWYgKFNJUl9NQUNfTUdNVF9QUk9CRV9SU1AgPT0gcEZjLT5zdWJUeXBlKQorICAgICAgICB7CisgICAgICAgICAgICAvL2dldCBwcm9wZXIgb2Zmc2V0IGZvciBQcm9iZSBSU1AKKyAgICAgICAgICAgIHBQMlBJZSA9IGxpbUdldFAycElFUHRyKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4KilwTWJNc2ctPmRhdGEgKyBQUk9CRV9SU1BfSUVfT0ZGU0VULAorICAgICAgICAgICAgICAgICAgICAgICAgICBuQnl0ZXMgLSBQUk9CRV9SU1BfSUVfT0ZGU0VUKTsKKyAgICAgICAgICAgIHdoaWxlICgoTlVMTCAhPSBwUDJQSWUpICYmIChTSVJfTUFDX01BWF9JRV9MRU5HVEggPT0gcFAyUEllWzFdKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByZW1haW5MZW4gPSBuQnl0ZXMgLSAocFAyUEllIC0gKHRBTklfVTgqKXBNYk1zZy0+ZGF0YSk7CisgICAgICAgICAgICAgICAgaWYgKHJlbWFpbkxlbiA+IDIpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgcE5ld1AyUEllID0gbGltR2V0UDJwSUVQdHIocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFAyUEllK1NJUl9NQUNfTUFYX0lFX0xFTkdUSCArIDIsIHJlbWFpbkxlbik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChwTmV3UDJQSWUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwUDJQSWUgPSBwTmV3UDJQSWU7CisgICAgICAgICAgICAgICAgICAgIHBOZXdQMlBJZSA9IE5VTEw7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gLy9lbmQgb2Ygd2hpbGUKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChTSVJfTUFDX0FDVElPTl9WRU5ET1JfU1BFQ0lGSUNfQ0FURUdPUlkgPT0KKyAgICAgICAgICAgICAgICAqKCh2X1U4X3QgKilwTWJNc2ctPmRhdGErQUNUSU9OX09GRlNFVCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdHBTaXJNYWNQMlBBY3Rpb25GcmFtZUhkciBwQWN0aW9uSGRyID0KKyAgICAgICAgICAgICAgICAgICAgKHRwU2lyTWFjUDJQQWN0aW9uRnJhbWVIZHIpKCh2X1U4X3QgKilwTWJNc2ctPmRhdGEgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBQ1RJT05fT0ZGU0VUKTsKKyAgICAgICAgICAgICAgICBpZiAodm9zX21lbV9jb21wYXJlKCBwQWN0aW9uSGRyLT5PdWksCisgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfUDJQX09VSSwgU0lSX01BQ19QMlBfT1VJX1NJWkUgKSAmJgorICAgICAgICAgICAgICAgICAgICAoU0lSX01BQ19BQ1RJT05fUDJQX1NVQlRZUEVfUFJFU0VOQ0VfUlNQID09CisgICAgICAgICAgICAgICAgICAgIHBBY3Rpb25IZHItPk91aVN1YlR5cGUpKQorICAgICAgICAgICAgICAgIHsgLy9JbiBjYXNlIG9mIFByZXNlbmNlIFJTUCByZXNwb25zZQorICAgICAgICAgICAgICAgICAgICBwUDJQSWUgPSBsaW1HZXRQMnBJRVB0cihwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZfVThfdCAqKXBNYk1zZy0+ZGF0YSArIEFDVElPTl9PRkZTRVQgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNQMlBBY3Rpb25GcmFtZUhkciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobkJ5dGVzIC0gQUNUSU9OX09GRlNFVCAtCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY1AyUEFjdGlvbkZyYW1lSGRyKSkpOworICAgICAgICAgICAgICAgICAgICBpZiggTlVMTCAhPSBwUDJQSWUgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvL2V4dHJhY3QgdGhlIHByZXNlbmNlIG9mIE5vQSBhdHRyaWJ1dGUgaW5zaWRlIFAyUCBJRQorICAgICAgICAgICAgICAgICAgICAgICAgcFByZXNlbmNlUnNwTm9hQXR0ciA9CisgICAgICAgICAgICAgICAgICAgICAgICBsaW1HZXRJRVB0cihwTWFjLHBQMlBJZSArIFNJUl9QMlBfSUVfSEVBREVSX0xFTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQMlBJZVsxXSwgU0lSX1AyUF9OT0FfQVRUUixUV09fQllURSk7CisgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKHBQMlBJZSAhPSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgICAvL2dldCBOb0EgYXR0cmlidXRlIHN0cmVhbSBQMlAgSUUKKyAgICAgICAgICAgIG5vYUxlbiA9IGxpbUdldE5vYUF0dHJTdHJlYW0ocE1hYywgbm9hU3RyZWFtLCBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgIC8vbmVlZCB0byBhcHBlbmQgTm9BIGF0dHJpYnV0ZSBpbiBQMlAgSUUKKyAgICAgICAgICAgIGlmIChub2FMZW4gPiAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG9yaWdMZW4gPSBwUDJQSWVbMV07CisgICAgICAgICAgICAgICAvL2lmIFByZXNlbmNlIFJzcCBoYXMgTm9BdHRyCisgICAgICAgICAgICAgICAgaWYgKHBQcmVzZW5jZVJzcE5vYUF0dHIpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB2X1UxNl90IG5vYUF0dHJMZW4gPSBwUHJlc2VuY2VSc3BOb2FBdHRyWzFdIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocFByZXNlbmNlUnNwTm9hQXR0clsyXTw8OCk7CisgICAgICAgICAgICAgICAgICAgIC8qT25lIGJ5dGUgZm9yIGF0dHJpYnV0ZSwgMmJ5dGVzIGZvciBsZW5ndGgqLworICAgICAgICAgICAgICAgICAgICBvcmlnTGVuIC09IChub2FBdHRyTGVuICsgMSArIDIpOworICAgICAgICAgICAgICAgICAgICAvL3JlbW92ZSB0aG9zZSBieXRlcyB0byBjb3B5CisgICAgICAgICAgICAgICAgICAgIG5CeXRlcyAgLT0gKG5vYUF0dHJMZW4gKyAxICsgMik7CisgICAgICAgICAgICAgICAgICAgIC8vcmVtb3ZlIE5vQSBmcm9tIG9yaWdpbmFsIExlbgorICAgICAgICAgICAgICAgICAgICBwUDJQSWVbMV0gPSBvcmlnTGVuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoKHBQMlBJZVsxXSArICh0QU5JX1UxNilub2FMZW4pPiBTSVJfTUFDX01BWF9JRV9MRU5HVEgpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvL0Zvcm0gdGhlIG5ldyBOb0EgQnl0ZSBhcnJheSBpbiBtdWx0aXBsZSBQMlAgSUVzCisgICAgICAgICAgICAgICAgICAgIG5vYUxlbiA9IGxpbUdldE5vYUF0dHJTdHJlYW1Jbk11bHRQMnBJZXMocE1hYywgbm9hU3RyZWFtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9hTGVuLCgocFAyUEllWzFdICsgKHRBTklfVTE2KW5vYUxlbiktCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX01BWF9JRV9MRU5HVEgpKTsKKyAgICAgICAgICAgICAgICAgICAgcFAyUEllWzFdID0gU0lSX01BQ19NQVhfSUVfTEVOR1RIOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwUDJQSWVbMV0gKz0gbm9hTGVuOyAvL2luY3JlbWVudCB0aGUgbGVuZ3RoIG9mIFAyUCBJRQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBuQnl0ZXMgKz0gbm9hTGVuOworICAgICAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJub2FMZW49JWQgb3JpZ0xlbj0lZCBwUDJQSWU9JXAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiIG5CeXRlcz0lZCBuQnl0ZXNUb0NvcHk9JXp1IiksCisgICAgICAgICAgICAgICAgICAgICAgICBub2FMZW4sb3JpZ0xlbiwgcFAyUEllLCBuQnl0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAoKHBQMlBJZSArIG9yaWdMZW4gKyAyKSAtICh2X1U4X3QgKilwTWJNc2ctPmRhdGEpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmIChTSVJfTUFDX01HTVRfUFJPQkVfUlNQID09IHBGYy0+c3ViVHlwZSkKKyAgICAgICAgeworICAgICAgICAgICAgbGltU2V0SHRDYXBzKCBwTWFjLCBwc2Vzc2lvbkVudHJ5LCAodEFOSV9VOCopcE1iTXNnLT5kYXRhICsgUFJPQkVfUlNQX0lFX09GRlNFVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG5CeXRlcyAtIFBST0JFX1JTUF9JRV9PRkZTRVQpOworICAgICAgICB9CisgICAgICAgIGlmICgoU0lSX01BQ19NR01UX0FDVElPTiA9PSBwRmMtPnN1YlR5cGUpICYmCisgICAgICAgICAgICAgICAgKDAgIT0gcE1iTXNnLT53YWl0KSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKHBNYWMtPmxpbS5ncExpbVJlbWFpbk9uQ2hhblJlcSA9PSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJGYWlsZWQgdG8gU2VuZCBBY3Rpb24gZnJhbWUiKSk7CisgICAgICAgICAgICAgICAgbGltU2VuZFNtZVJzcChwTWFjLCBlV05JX1NNRV9BQ1RJT05fRlJBTUVfU0VORF9DTkYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlSEFMX1NUQVRVU19GQUlMVVJFLCBwTWJNc2ctPnNlc3Npb25JZCwgMCk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisKKyAgICAvLyBPay0tIHRyeSB0byBhbGxvY2F0ZSBzb21lIG1lbW9yeToKKyAgICBoYWxzdGF0dXMgPSBwYWxQa3RBbGxvYyggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULAorICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1UxNiluQnl0ZXMsICggdm9pZCoqICkgJnBGcmFtZSwgKHZvaWQqKikgJnBQYWNrZXQpOworICAgIGlmICggISBIQUxfU1RBVFVTX1NVQ0NFU1MgKCBoYWxzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gYWxsb2NhdGUgJWQgYnl0ZXMgZm9yIGEgUHJvYmUiCisgICAgICAgICAgIiBSZXF1ZXN0LiIpLCBuQnl0ZXMgKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIC8vIFBhcmFub2lhOgorICAgIHZvc19tZW1fc2V0KHBGcmFtZSwgbkJ5dGVzLCAwKTsKKworICAgIGlmICgobm9hTGVuID4gMCkgJiYgKG5vYUxlbjwoU0lSX01BWF9OT0FfQVRUUl9MRU4gKyBTSVJfUDJQX0lFX0hFQURFUl9MRU4pKSkKKyAgICB7CisgICAgICAgIC8vIEFkZCAyIGJ5dGVzIGZvciBsZW5ndGggYW5kIEFycmlidXRlIGZpZWxkCisgICAgICAgIHZfVTMyX3QgbkJ5dGVzVG9Db3B5ID0gKChwUDJQSWUgKyBvcmln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TXNnLT5zZXNzaW9uSWQsIDApOworICAgICAgICAgICAgcGFsUGt0RnJlZSggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULAorICAgICAgICAgICAgICAgICAgICAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICB9CisjZW5kaWYKKworICAgIC8qIFVzZSBCRCByYXRlIDIgZm9yIGFsbCBQMlAgcmVsYXRlZCBmcmFtZXMuIEFzIHRoZXNlIGZyYW1lcyBuZWVkIHRvIGdvCisgICAgICogYXQgT0ZETSByYXRlcy4gQW5kIEJEIHJhdGUyIHdlIGNvbmZpZ3VyZWQgYXQgNk1icHMuCisgICAgICovCisgICAgdHhGbGFnIHw9IEhBTF9VU0VfQkRfUkFURTJfRk9SX01BTkFHRU1FTlRfRlJBTUU7CisKKyAgICBpZiAoU0lSX01BQ19NR01UX0FDVElPTiA9PSBwRmMtPnN1YlR5cGUpCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPRzEsIEZMKCJTZW5kaW5nIEFjdGlvbiBGcmFtZSBvdmVyIFdRNSIpKTsKKyAgICAgICAgdHhGbGFnIHw9IEhBTF9VU0VfRldfSU5fVFhfUEFUSDsKKyAgICB9CisKKyAgICBpZiAoIChTSVJfTUFDX01HTVRfUFJPQkVfUlNQID09IHBGYy0+c3ViVHlwZSkgfHwKKyAgICAgICAgIChwTWJNc2ctPm5vYWNrKQorICAgICAgICApCisgICAgeworICAgICAgICBoYWxzdGF0dXMgPSBoYWxUeEZyYW1lKCBwTWFjLCBwUGFja2V0LCAodEFOSV9VMTYpbkJ5dGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCBBTklfVFhESVJfVE9EUywKKyAgICAgICAgICAgICAgICAgICAgICAgIDcsLypTTUFDX1NXQkRfVFhfVElEX01HTVRfSElHSCAqLyBsaW1UeENvbXBsZXRlLCBwRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICB0eEZsYWcgKTsKKworICAgICAgICBpZiAoIXBNYk1zZy0+bm9hY2spCisgICAgICAgIHsKKyAgICAgICAgICAgbGltU2VuZFNtZVJzcChwTWFjLCBlV05JX1NNRV9BQ1RJT05fRlJBTUVfU0VORF9DTkYsIAorICAgICAgICAgICAgICAgaGFsc3RhdHVzLCBwTWJNc2ctPnNlc3Npb25JZCwgMCk7CisgICAgICAgIH0KKyAgICAgICAgcE1hYy0+bGltLm1nbXRGcmFtZVNlc3Npb25JZCA9IDB4ZmY7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHBNYWMtPmxpbS5tZ210RnJhbWVTZXNzaW9uSWQgPSAweGZmOworICAgICAgICBoYWxzdGF0dXMgPSBoYWxUeEZyYW1lV2l0aFR4Q29tcGxldGUoIHBNYWMsIHBQYWNrZXQsICh0QU5JX1UxNiluQnl0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsIEFOSV9UWERJUl9UT0RTLAorICAgICAgICAgICAgICAgICAgICAgICAgNywvKlNNQUNfU1dCRF9UWF9USURfTUdNVF9ISUdIICovIGxpbVR4Q29tcGxldGUsIHBGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbVAyUEFjdGlvbkNuZiwgdHhGbGFnLCBwTWFjLT5saW0udHhCZFRva2VuKysgKTsKKworICAgICAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTICggaGFsc3RhdHVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IHNlbmQgYWN0aW9uIGZyYW1lISIgKSk7CisgICAgICAgICAgICAgbGltU2VuZFNtZVJzcChwTWFjLCBlV05JX1NNRV9BQ1RJT05fRlJBTUVfU0VORF9DTkYsIGhhbHN0YXR1cywgCisgIC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worCisgICAgcHNlc3Npb25FbnRyeSA9IHBlRmluZFNlc3Npb25CeVNlc3Npb25JZCggcE1hYyAsIHNlc3Npb25JZCApOworCisgICAgaWYoIE5VTEwgPT0gcHNlc3Npb25FbnRyeSApCisgICAgeworICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJTZXNzaW9uICVkICBub3QgYWN0aXZlXG4gIiksIHNlc3Npb25JZCk7CisgICAgICByZXR1cm47CisgICAgfQorCisgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJDaGFubmVsIHN3aXRjaCBNb2RlID09ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW1DaGFubmVsU3dpdGNoLnN3aXRjaE1vZGUpOworCisgICAgaWYgKHBzZXNzaW9uRW50cnktPmdMaW1DaGFubmVsU3dpdGNoLnN3aXRjaE1vZGUgPT0gZVNJUl9DSEFOU1dfTU9ERV9TSUxFTlQgfHwKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbUNoYW5uZWxTd2l0Y2guc3dpdGNoQ291bnQgPD0gU0lSX0NIQU5TV19UWF9TVE9QX01BWF9DT1VOVCkKKyAgICB7CisgICAgICAgIC8qIEZyZWV6ZSB0aGUgdHJhbnNtaXNzaW9uICovCisgICAgICAgIGxpbUZyYW1lVHJhbnNtaXNzaW9uQ29udHJvbChwTWFjLCBlTElNX1RYX0FMTCwgZUxJTV9TVE9QX1RYKTsKKworICAgICAgICAvKlJlcXVlc3QgZm9yIEZ1bGwgcG93ZXIgb25seSBpZiB0aGUgZGV2aWNlIGlzIGluIHBvd2Vyc2F2ZSovCisgICAgICAgIGlmKCFsaW1Jc1N5c3RlbUluQWN0aXZlU3RhdGUocE1hYykpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIFJlcXVlc3QgRnVsbCBQb3dlciAqLworICAgICAgICAgICAgbGltU2VuZFNtZVByZUNoYW5uZWxTd2l0Y2hJbmQocE1hYyk7CisgICAgICAgICA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AgICAgICAgICAgIG5TdGF0dXM7CisKKyAgICBwSGRyID0gV0RBX0dFVF9SWF9NQUNfSEVBREVSKHBSeFBhY2tldEluZm8pOworICAgIHBCb2R5ID0gV0RBX0dFVF9SWF9NUERVX0RBVEEocFJ4UGFja2V0SW5mbyk7CisgICAgZnJhbWVMZW4gPSBXREFfR0VUX1JYX1BBWUxPQURfTEVOKHBSeFBhY2tldEluZm8pOworCisgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJSZWNlaXZlZCBDaGFubmVsIHN3aXRjaCBhY3Rpb24gZnJhbWUiKSk7CisgICAgaWYgKCFwc2Vzc2lvbkVudHJ5LT5saW0xMWhFbmFibGUpCisgICAgICAgIHJldHVybjsKKworICAgIHBDaGFubmVsU3dpdGNoRnJhbWUgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YoKnBDaGFubmVsU3dpdGNoRnJhbWUpKTsKKyAgICBpZiAoTlVMTCA9PSBwQ2hhbm5lbFN3aXRjaEZyYW1lKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICBGTCgiQWxsb2NhdGVNZW1vcnkgZmFpbGVkIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgLyogVW5wYWNrIGNoYW5uZWwgc3dpdGNoIGZyYW1lICovCisgICAgblN0YXR1cyA9IGRvdDExZlVucGFja0NoYW5uZWxTd2l0Y2gocE1hYywgcEJvZHksIGZyYW1lTGVuLCBwQ2hhbm5lbFN3aXRjaEZyYW1lKTsKKworICAgIGlmKCBET1QxMUZfRkFJTEVEKCBuU3RhdHVzICkpCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsCisgICAgICAgICAgICBGTCggIkZhaWxlZCB0byB1bnBhY2sgYW5kIHBhcnNlIGFuIDExaC1DSEFOU1cgUmVxdWVzdCAoMHglMDh4LCAlZCBieXRlcyk6IiksCisgICAgICAgICAgICBuU3RhdHVzLAorICAgICAgICAgICAgZnJhbWVMZW4pOworICAgICAgICB2b3NfbWVtX2ZyZWUocENoYW5uZWxTd2l0Y2hGcmFtZSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgZWxzZSBpZihET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkpCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csCisgICAgICAgICAgICBGTCggIlRoZXJlIHdlcmUgd2FybmluZ3Mgd2hpbGUgdW5wYWNraW5nIGFuIDExaC1DSEFOU1cgUmVxdWVzdCAoMHglMDh4LCAlZCBieXRlcyk6IiksCisgICAgICAgICAgICBuU3RhdHVzLAorICAgICAgICAgICAgZnJhbWVMZW4pOworICAgIH0KKworICAgIGlmICh2b3NfbWVtX2NvbXBhcmUoKHRBTklfVTggKikgJnBzZXNzaW9uRW50cnktPmJzc0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTggKikgJnBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSkpCisgICAgeworICAgICAgICAjaWYgMAorICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19CRUFDT05fSU5URVJWQUwsICZ2YWwpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBDaGFubmVsU3dpdGNoRnJhbWUpOworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgQmVhY29uIGludGVydmFsIikpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgICNlbmRpZi8vIFRPIFNVUFBPUlQgQlQtQU1QCisKKyAgICAgICAgLyogY29weSB0aGUgYmVhY29uIGludGVydmFsIGZyb20gcHNlc3Npb25FbnRyeSovCisgICAgICAgIHZhbCA9IHBzZXNzaW9uRW50cnktPmJlYWNvblBhcmFtcy5iZWFjb25JbnRlcnZhbDsKKworICAgIC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mRhcnlDaGFubmVsT2Zmc2V0ID09IFBIWV9ET1VCTEVfQ0hBTk5FTF9MT1dfUFJJTUFSWSkgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgIChwQ2hhbm5lbFN3aXRjaEZyYW1lLT5FeHRDaGFuU3dpdGNoQW5uLnNlY29uZGFyeUNoYW5uZWxPZmZzZXQgPT0gUEhZX0RPVUJMRV9DSEFOTkVMX0hJR0hfUFJJTUFSWSkpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltQ2hhbm5lbFN3aXRjaC5zdGF0ZSA9IGVMSU1fQ0hBTk5FTF9TV0lUQ0hfUFJJTUFSWV9BTkRfU0VDT05EQVJZOworICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbUNoYW5uZWxTd2l0Y2guc2Vjb25kYXJ5U3ViQmFuZCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1HZXQxMUFDUGh5Q0JTdGF0ZShwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbUNoYW5uZWxTd2l0Y2gucHJpbWFyeUNoYW5uZWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2hhbm5lbFN3aXRjaEZyYW1lLT5FeHRDaGFuU3dpdGNoQW5uLnNlY29uZGFyeUNoYW5uZWxPZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2hhbm5lbFN3aXRjaEZyYW1lLT5XaWRlckJXQ2hhblN3aXRjaEFubi5uZXdDZW50ZXJDaGFuRnJlcTAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgfQor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IGRpc2FibGVkIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaWYgKCggUkZfQ0hBTl8xNCA+PSBwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwgKSYmCisgICAgICAgICAgIUlTX0hUNDBfT0JTU19TQ0FOX0ZFQVRVUkVfRU5BQkxFKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1csCisgICAgICAgICAgICAgIEZMKCJjaGFubmVsIGJvbmRpbmcgZGlzYWJsZWQgYXMgRlcgZG9lc24ndCBzdXBvb3J0IENCIGluIDIuNGd6IikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgcE9wZXJhdGluZ01vZGVmcmFtZSA9IHZvc19tZW1fbWFsbG9jKHNpemVvZigqcE9wZXJhdGluZ01vZGVmcmFtZSkpOworICAgIGlmIChOVUxMID09IHBPcGVyYXRpbmdNb2RlZnJhbWUpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgIEZMKCJBbGxvY2F0ZU1lbW9yeSBmYWlsZWQiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICAvKiBVbnBhY2sgY2hhbm5lbCBzd2l0Y2ggZnJhbWUgKi8KKyAgICBuU3RhdHVzID0gZG90MTFmVW5wYWNrT3BlcmF0aW5nTW9kZShwTWFjLCBwQm9keSwgZnJhbWVMZW4sIHBPcGVyYXRpbmdNb2RlZnJhbWUpOworCisgICAgaWYoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwKKyAgICAgICAgICAgIEZMKCAiRmFpbGVkIHRvIHVucGFjayBhbmQgcGFyc2UgYW4gMTFoLUNIQU5TVyBSZXF1ZXN0ICgweCUwOHgsICVkIGJ5dGVzKToiKSwKKyAgICAgICAgICAgIG5TdGF0dXMsCisgICAgICAgICAgICBmcmFtZUxlbik7CisgICAgICAgIH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pLAorICAgICAgICAgICAgKHBPcGVyYXRpbmdNb2RlZnJhbWUtPk9wZXJhdGluZ01vZGUuY2hhbldpZHRoICksCisgICAgICAgICAgICBwU3RhLT5zdGFJbmRleCk7CisKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIAorICAgICAgICAgICAgRkwoIiBNQUMgLSAlMHg6JTB4OiUweDolMHg6JTB4OiUweCIpLAorICAgICAgICAgICAgcEhkci0+c2FbMF0sCisgICAgICAgICAgICBwSGRyLT5zYVsxXSwKKyAgICAgICAgICAgIHBIZHItPnNhWzJdLAorICAgICAgICAgICAgcEhkci0+c2FbM10sCisgICAgICAgICAgICBwSGRyLT5zYVs0XSwKKyAgICAgICAgICAgIHBIZHItPnNhWzVdKTsKKworICAgICAgICBpZihwT3BlcmF0aW5nTW9kZWZyYW1lLT5PcGVyYXRpbmdNb2RlLmNoYW5XaWR0aCA9PSBlSFRfQ0hBTk5FTF9XSURUSF84ME1IWikKKyAgICAgICAgeworICAgICAgICAgICAgcFN0YS0+dmh0U3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0ID0gV05JX0NGR19WSFRfQ0hBTk5FTF9XSURUSF84ME1IWjsKKyAgICAgICAgICAgIHBTdGEtPmh0U3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0ID0gZUhUX0NIQU5ORUxfV0lEVEhfNDBNSFo7CisgICAgICAgIH0gCisgICAgICAgIGVsc2UgaWYocE9wZXJhdGluZ01vZGVmcmFtZS0+T3BlcmF0aW5nTW9kZS5jaGFuV2lkdGggPT0gZUhUX0NIQU5ORUxfV0lEVEhfNDBNSFopCisgICAgICAgIHsKKyAgICAgICAgICAgIHBTdGEtPnZodFN1cHBvcnRlZENoYW5uZWxXaWR0aFNldCA9IFdOSV9DRkdfVkhUX0NIQU5ORUxfV0lEVEhfMjBfNDBNSFo7CisgICAgICAgICAgICBwU3RhLT5odFN1cHBvcnRlZENoYW5uZWxXaWR0aFNldCA9IGVIVF9DSEFOTkVMX1dJR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HRwRHBoSGFzaE5vZGUgICAgcFN0YTsKKyAgICB0QU5JX1UxNiAgICAgICAgIGFpZDsKKyAgICB0QU5JX1UzMiAgICAgICAgIGZyYW1lTGVuOworICAgIHRBTklfVTggICAgICAgICAgKnBCb2R5OworICAgIHRwTGltVHNwZWNJbmZvICAgdHNwZWNJbmZvOworICAgIHRBTklfVTggICAgICAgICAgYWM7IAorICAgIHRwRHBoSGFzaE5vZGUgICAgcFN0YURzID0gTlVMTDsKKyAgICB0QU5JX1U4ICAgICAgICAgIHJzcFJlcWQgPSAxOworICAgIHRBTklfVTMyICAgY2ZnTGVuOworICAgIHRTaXJNYWNBZGRyICBwZWVyTWFjQWRkcjsKKworCisgICAgcEhkciA9IFdEQV9HRVRfUlhfTUFDX0hFQURFUihwUnhQYWNrZXRJbmZvKTsKKyAgICBwQm9keSA9IFdEQV9HRVRfUlhfTVBEVV9EQVRBKHBSeFBhY2tldEluZm8pOworICAgIGZyYW1lTGVuID0gV0RBX0dFVF9SWF9QQVlMT0FEX0xFTihwUnhQYWNrZXRJbmZvKTsKKworCisgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCAiUmVjdiBBZGRUcyBSZXNwb25zZSIpOykKKyAgICBpZiAoKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFKXx8KHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9CVF9BTVBfQVBfUk9MRSkpCisgICAgeworICAgICAgICBQRUxPR1cobGltTG9nKHBNYWMsIExPR1csIEZMKCJBZGRUc1JzcCByZWN2ZCBhdCBBUDogaWdub3JpbmciKSk7KQorICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgcFN0YSA9IGRwaExvb2t1cEhhc2hFbnRyeShwTWFjLCBwSGRyLT5zYSwgJmFpZCwgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUpOworICAgIGlmIChwU3RhID09IE5VTEwp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ICBpZiAoYWRkdHMubnVtVGNsYXMgPiAxKSAvLyBjdXJyZW50bHkgbm8gc3VwcG9ydCBmb3IgbXVsdGlwbGUgdGNsYXMgZWxlbWVudHMKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJTdGEgJWQ6IFRvbyBtYW55IFRjbGFzICglZCksIG9ubHkgMSBzdXBwb3J0ZWQiKSwKKyAgICAgICAgICAgICAgICAgICBhaWQsIGFkZHRzLm51bVRjbGFzKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChhZGR0cy5udW1UY2xhcyA9PSAxKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgIkFkZFRzIFJlc3BvbnNlIGZyb20gU1RBICVkOiB0c2lkICVkLCBVUCAlZCwgT0shIiwgYWlkLAorICAgICAgICAgICAgICAgICAgIGFkZHRzLnRzcGVjLnRzaW5mby50cmFmZmljLnRzaWQsIGFkZHRzLnRzcGVjLnRzaW5mby50cmFmZmljLnVzZXJQcmlvKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBsaW1Mb2cocE1hYywgTE9HVywgIlJlY3YgQWRkVHNSc3A6IHRzaWQgJWQsIFVQICVkLCBzdGF0dXMgJWQgIiwKKyAgICAgICAgICBhZGR0cy50c3BlYy50c2luZm8udHJhZmZpYy50c2lkLCBhZGR0cy50c3BlYy50c2luZm8udHJhZmZpYy51c2VyUHJpbywKKyAgICAgICAgICBhZGR0cy5zdGF0dXMpOworCisgICAgLy8gZGVhY3RpdmF0ZSB0aGUgcmVzcG9uc2UgdGltZXIKKyAgICBsaW1EZWFjdGl2YXRlQW5kQ2hhbmdlVGltZXIocE1hYywgZUxJTV9BRERUU19SU1BfVElNRVIpOworCisgICAgaWYgKGFkZHRzLnN0YXR1cyAhPSBlU0lSX01BQ19TVUNDRVNTX1NUQVRVUykKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLCAiUmVjdiBBZGRUc1JzcDogdHNpZCAlZCwgVVAgJWQsIHN0YXR1cyAlZCAiLAorICAgICAgICAgICAgICBhZGR0cy50c3BlYy50c2luZm8udHJhZmZpYy50c2lkLCBhZGR0cy50c3BlYy50c2luZm8udHJhZmZpYy51c2VyUHJpbywKKyAgICAgICAgICAgICAgYWRkdHMuc3RhdHVzKTsKKyAgICAgICAgbGltU2VuZFNtZUFkZHRzUnNwKHBNYWMsIHRydWUsIGFkZHRzLnN0YXR1cywgcHNlc3Npb25FbnRyeSwgYWRkdHMudHNwZWMsIAorICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnNtZVNlc3Npb25JZCwgcHNlc3Npb25FbnRyeS0+dHJhbnNhY3Rpb25JZCk7CisKKyAgICAgICAgLy8gY2xlYXIgdGhlIGFkZHRzIGZsYWcKKyAgICAgICAgcE1hYy0+bGltLmdMaW1BZGR0c1NlbnQgPSBmYWxzZTsKKworICAgICAgICByZXR1cm47CisgICAgfQorI2lmZGVmIEZFQVRVUkVfV0xBTl9FU0UKKyAgICBpZiAoYWRkdHMudHNtUHJlc2VudCkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLCAiVFNNIElFIFByZXNlbnQiKTsKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+ZXNlQ29udGV4dC50c20udGlkID0gYWRkdHMudHNwZWMudHNpbmZvLnRyYWZmaWMudXNlclByaW87CisgICAgICAgIHZvc19tZW1fY29weSgmcHNlc3Npb25FbnRyeS0+ZXNlQ29udGV4dC50c20udHNtSW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmFkZHRzLnRzbUlFLHNpemVvZih0U2lyTWFjRVNFVFNNSUUpKTsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFX1VQTE9BRAorICAgICAgICBsaW1TZW5kU21lVHNtSUVJbmQocE1hYywgcHNlc3Npb25FbnRyeSwgYWRkdHMud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AgIHsKKyAgICAgICAgICAgIGxpbUFkbWl0Q29udHJvbERlbGV0ZVRTKHBNYWMsIHBTdGEtPmFzc29jSWQsICZhZGR0cy50c3BlYy50c2luZm8sIE5VTEwsICZ0c3BlY0luZm8tPmlkeCk7CisgICAgCisgICAgICAgICAgICAvLyBTZW5kIERFTFRTIGFjdGlvbiBmcmFtZSB0byBBUCAgICAgICAgCisgICAgICAgICAgICBjZmdMZW4gPSBzaXplb2YodFNpck1hY0FkZHIpOworICAgICAgICAgICAgbGltU2VuZERlbHRzUmVxQWN0aW9uRnJhbWUocE1hYywgcGVlck1hY0FkZHIsIHJzcFJlcWQsICZhZGR0cy50c3BlYy50c2luZm8sICZhZGR0cy50c3BlYywKKyAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICBsaW1TZW5kU21lQWRkdHNSc3AocE1hYywgdHJ1ZSwgcmV0dmFsLCBwc2Vzc2lvbkVudHJ5LCBhZGR0cy50c3BlYywKKyAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+c21lU2Vzc2lvbklkLCBwc2Vzc2lvbkVudHJ5LT50cmFuc2FjdGlvbklkKTsKKyAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltQWRkdHNTZW50ID0gZmFsc2U7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiQWRkVHNSc3AgcmVjZWl2ZWQgc3VjY2Vzc2Z1bGx5KFVQICVkLCBUU0lEICVkKSIpLAorICAgICAgICAgICBhZGR0cy50c3BlYy50c2luZm8udHJhZmZpYy51c2VyUHJpbywgYWRkdHMudHNwZWMudHNpbmZvLnRyYWZmaWMudHNpZCk7KQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBQRUxPR1cobGltTG9nKHBNYWMsIExPR1csIEZMKCJBZGRUc1JzcCByZWNlaXZlZCBzdWNjZXNzZnVsb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5JX1U4ICAgICAgICAgICAgICAqcEJvZHk7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgIHRzU3RhdHVzOworICAgIHRTaXJNYWNUU0luZm8gICAqdHNpbmZvOworICAgIHRBTklfVTggdHNwZWNJZHg7CisgICAgdEFOSV9VOCAgYWM7CisgICAgdHBEcGhIYXNoTm9kZSAgcFN0YURzID0gTlVMTDsKKworCisgICAgcEhkciA9IFdEQV9HRVRfUlhfTUFDX0hFQURFUihwUnhQYWNrZXRJbmZvKTsKKyAgICBwQm9keSA9IFdEQV9HRVRfUlhfTVBEVV9EQVRBKHBSeFBhY2tldEluZm8pOworICAgIGZyYW1lTGVuID0gV0RBX0dFVF9SWF9QQVlMT0FEX0xFTihwUnhQYWNrZXRJbmZvKTsKKworICAgIHBTdGEgPSBkcGhMb29rdXBIYXNoRW50cnkocE1hYywgcEhkci0+c2EsICZhaWQsICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsKKyAgICBpZiAocFN0YSA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiU3RhdGlvbiBjb250ZXh0IG5vdCBmb3VuZCAtIGlnbm9yaW5nIERlbFRzIikpOykKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIC8vIHBhcnNlIHRoZSBkZWx0cyByZXF1ZXN0CisgICAgcmV0dmFsID0gc2lyQ29udmVydERlbHRzUmVxMlN0cnVjdChwTWFjLCBwQm9keSwgZnJhbWVMZW4sICZkZWx0cyk7CisgICAgaWYgKHJldHZhbCAhPSBlU0lSX1NVQ0NFU1MpCisgICAgeworICAgICAgICBQRUxPR1cobGltTG9nKHBNYWMsIExPR1csIEZMKCJEZWxUcyBwYXJzaW5nIGZhaWxlZCAoZXJyb3IgJWQpIiksIHJldHZhbCk7KQorICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaWYgKGRlbHRzLndtZVRzcGVjUHJlc2VudCkKKyAgICB7CisgICAgICAgIGlmICgoIXBzZXNzaW9uRW50cnktPmxpbVdtZUVuYWJsZWQpIHx8ICghIHBTdGEtPndtZUVuYWJsZWQpKQorICAgICAgICB7CisgICAgICAgICAgICBQRUxPR1cobGltTG9nKHBNYWMsIExPR1csIEZMKCJJZ25vcmluZyBkZWx0cyByZXF1ZXN0OiB3bWUgbm90IGVuYWJsZWQvY2FwYWJsZSIpKTspCisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJXTUUgRGVsdHMgcmVjZWl2ZWQiKSk7CisgICAgfQorICAgIGVsc2UgaWYgKChwc2Vzc2lvbkVudHJ5LT5saW1Rb3NFbmFibGVkKSAmJiBwU3RhLT5sbGVFbmFibGVkKQorICAgICAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiMTFlIFFvUyBEZWx0cyByZWNlaXZlZCIpKTsKKyAgICAgICAgfQorICAgIGVsc2UgaWYgKChwc2Vzc2lvbkVudHJ5LT5saW1Xc21FbmFibGVkKSAmJiBwU3RhLT53c21FbmFibGVkKQorICAgICAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiV1NNIERlbHRzIHJlY2VpdmVkIikpOworICAgICAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiSWdub3JpbmcgZGVsdHMgcmVxdWVzdDogcW9zIG5vdCBlbmFibGVkL2NhcGFibGUiKSk7KQorICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgdHNpbmZvID0gZGVsdHMud21lVHNwZWNQcmVzZW50ID8gJmRlbHRzLnRzcGVjLnRzaW5mbyA6ICZkZWx0cy50c2luZm87CisKKyAgICAvLyBpZiBubyBBZG1pdCBDb250cm9sLCBpZ25vcmUgdGhlIHJlcXVlc3QKKyAgICBpZiAoKHRzaW5mby0+dHJhZmZ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PSBTSVJfTUFDX0FDQ0VTU1BPTElDWV9CT1RIKSkKKyAgICB7CisgICAgICAvL0VkY2Egb25seSBmb3Igbm93LgorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgLy9zZW5kIG1lc3NhZ2UgdG8gSEFMIHRvIGRlbGV0ZSBUUworICAgICAgaWYoZVNJUl9TVUNDRVNTICE9IGxpbVNlbmRIYWxNc2dEZWxUcyhwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3RhLT5zdGFJbmRleCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHNwZWNJZHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbHRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+YnNzSWQpKQorICAgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgRkwoIkRlbFRzIHdpdGggVVAgJWQgZmFpbGVkIGluIGxpbVNlbmRIYWxNc2dEZWxUcyAtIGlnbm9yaW5nIHJlcXVlc3QiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0c2luZm8tPnRyYWZmaWMudXNlclByaW8pOworICAgICAgICAgcmV0dXJuOworICAgICAgfQorICAgIH0KKworICAgIC8qIFdlIHN1Y2Nlc3NmdWxseSBkZWxldGVkIHRoZSBUU1BFQy4gVXBkYXRlIHRoZSBkeW5hbWljIFVBUFNEIE1hc2suCisgICAgICogVGhlIEFDIGZvciB0aGlzIFRTUEVDIGlzIG5vIGxvbmdlciB0cmlnZ2VyIGVuYWJsZWQgaWYgdGhpcyBUc3BlYworICAgICAqIHdhcyBzZXQtdXAgaW4gdXBsaW5rIGRpcmVjdGlvbiBvb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qcFJ4UGFja2V0SW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSkKK3sKKyAgICAgdHBTaXJNYWNNZ210SGRyICBwSGRyOworICAgICB0QU5JX1UzMiAgICAgICAgIGZyYW1lTGVuOworICAgICB0QU5JX1U4ICAgICAgICAgICpwQm9keTsKKyAgICAgdFNpclJldFN0YXR1cyAgICByZXR2YWw7CisgICAgIHBIZHIgPSBXREFfR0VUX1JYX01BQ19IRUFERVIocFJ4UGFja2V0SW5mbyk7CisgICAgIHBCb2R5ID0gV0RBX0dFVF9SWF9NUERVX0RBVEEocFJ4UGFja2V0SW5mbyk7CisgICAgIGZyYW1lTGVuID0gV0RBX0dFVF9SWF9QQVlMT0FEX0xFTihwUnhQYWNrZXRJbmZvKTsKKyAgICAgcmV0dmFsID0gc2lyQ29udmVydFFvc01hcENvbmZpZ3VyZUZyYW1lMlN0cnVjdChwTWFjLCBwQm9keSwgZnJhbWVMZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwc2Vzc2lvbkVudHJ5LT5Rb3NNYXBTZXQpOworICAgICBpZiAocmV0dmFsICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgeworICAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgRkwoIlFvc01hcENvbmZpZ3VyZSBmcmFtZSBwYXJzaW5nIGZhaWxlZCAoZXJyb3IgJWQpIiksIHJldHZhbCk7KQorICAgICAgICAgcmV0dXJuOworICAgICB9CisgICAgIGxpbVNlbmRTbWVNZ210RnJhbWVJbmQocE1hYywgcHNlc3Npb25FbnRyeS0+c21lU2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSeFBhY2tldEluZm8sIHBzZXNzaW9uRW50cnksIDApOworfQorCisjaWZkZ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bCBwTWFjLCB0QU5JX1U4ICpwUnhQYWNrZXRJbmZvKQoreworICAgIHRwU2lyTWFjTWdtdEhkciAgICAgICAgICAgICAgICAgICAgICAgcEhkcjsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKnBCb2R5OworICAgIHRwU2lyTWFjTWVhc1JlcUFjdGlvbkZyYW1lICAgICAgICAgICAgcE1lYXNSZXFGcmFtZTsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVMZW47CisKKyAgICBwSGRyID0gV0RBX0dFVF9SWF9NQUNfSEVBREVSKHBSeFBhY2tldEluZm8pOworICAgIHBCb2R5ID0gV0RBX0dFVF9SWF9NUERVX0RBVEEocFJ4UGFja2V0SW5mbyk7CisgICAgZnJhbWVMZW4gPSBXREFfR0VUX1JYX1BBWUxPQURfTEVOKHBSeFBhY2tldEluZm8pOworCisgICAgcE1lYXNSZXFGcmFtZSA9IHZvc19tZW1fbWFsbG9jKHNpemVvZiggdFNpck1hY01lYXNSZXFBY3Rpb25GcmFtZSApKTsKKyAgICBpZiAoTlVMTCA9PSBwTWVhc1JlcUZyYW1lKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICBGTCgibGltUHJvY2Vzc01lYXN1cmVtZW50UmVxdWVzdEZyYW1lOiBBbGxvY2F0ZU1lbW9yeSBmYWlsZWQgIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaWYgKHNpckNvbnZlcnRNZWFzUmVxRnJhbWUyU3RydWN0KHBNYWMsIHBCb2R5LCBwTWVhc1JlcUZyYW1lLCBmcmFtZUxlbikgIT0KKyAgICAgICAgZVNJUl9TVUNDRVNTKQorICAgIHsKKyAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiUmN2IGludmFsaWQgTWVhc3VyZW1lbnQgUmVxdWVzdCBBY3Rpb24gRnJhbWUgIikpOykKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworCisgICAgc3dpdGNoKHBNZWFzUmVxRnJhbWUtPm1lYXNSZXFJRS5tZWFzVHlwZSkKKyAgICB7CisgICAgICAgIGNhc2UgU0lSX01BQ19CQVNJQ19NRUFTVVJFTUVOVF9UWVBFOgorICAgICAgICAgICAgX19saW1Qcm9jZXNzQmFzaWNNZWFzUmVxKHBNYWMsIHBNZWFzUmVxRnJhbWUsIHBIZHItPnNhKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgU0lSX01BQ19DQ0FfTUVBU1VSRU1FTlRfVFlQRToKKyAgICAgICAgICAgIF9fbGltUHJvY2Vzc0NjYU1lYXNSZXEocE1hYywgcE1lYXNSZXFGcmFtZSwgcEhkci0+c2EpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBTSVJfTUFDX1JQSV9NRUFTVVJFTUVOVF9UWVBFOgorICAgICAgICAgICAgX19saW1Qcm9jZXNzUnBpTWVhc1JlcShwTWFjLCBwTWVhc1JlcUZyYW1lLCBwSGRyLT5zYSk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJVbmtub3duIE1lYXN1cmVtZW50IFR5cGUgJWQgIiksCisgICAgICAgICAgICAgICAgICAgcE1lYXNSZXFGcmFtZS0+bWVhc1JlcUlFLm1lYXNUeXBlKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgIH0KKworfSAvKioqIGVuZCBsaW1Qcm9jZXNzTWVhc3VyZW1lbnRSZXF1ZXN0RnJhbWUgKioqLworCisKKy8qKgorICogIGxpbVByb2Nlc3NUcGNSZXF1ZXN0RnJhbWUKKyAqCisgKkZVTkNUSU9OOgorICogIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIHVwb24gcmVjZWl2aW5nIFRwYyBSZXF1ZXN0IGZyYW1lLgorICoKKyAqTk9URToKKyAqCisgKiBAcGFyYW0gIHBNYWMgLSBQb2ludGVyIHRvIEdsb2JhbCBNQUMgc3RydWN0dXJlCisgKiBAcGFyYW0gICpwUnhQYWNrZXRJbmZvIC0gQSBwb2ludGVyIHRvIHBhY2tldCBpbmZvIHN0cnVjdHVyZQorICogQHJldHVybiBOb25lCisgKi8KKworc3RhdGljIHZvaWQKK19fbGltUHJvY2Vzc1RwY1JlcXVlc3RGcmFtZSh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4ICpwUnhQYWNrZXRJbmZvKQoreworICAgIHRwU2lyTWFjTWdtdEhkciAgICAgICAgICAgICAgICAgICAgICAgcEhkcjsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKnBCb2R5OworICAgIHRwU2lyTWFjVHBjUmVxQWN0aW9uRnJhbWUgICAgICAgICAgICAgcFRwY1JlcUZyYW1lOworICAgIHRBTklfVTMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZUxlbjsKKworICAgIHBIZHIgPSBXREFfR0VUX1JYX01BQ19IRUFERVIocFJ4UGFja2V0SW5mbyk7CisgICAgcEJvZHkgPSBXREFfR0VUX1JYX01QRFVfREFUQShwUnhQYWNrZXRJbmZvKTsKKyAgICBmcmFtZUxlbiA9IFdEQV9HRVRfUlhfUEFZTE9BRF9MRU4ocFJ4UGFja2V0SW5mbyk7CisKKyAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIioqKipMSU06IFByb2Nlc3NpbmcgVFBDIFJlcXVlc3QgZnJvbSBwZWVyICoqKioiKSk7CisKKyAgICBwVHBjUmVxRnJhbWUgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YoIHRTaXJNYWNUcGNSZXFBY3Rpb25GcmFtZSApKTsKKyAgICBpZiAoTlVMTCA9PSBwVHBjUmVxRnJhbWUpCisgICAgeworICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIE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3RhID0gZHBoTG9va3VwSGFzaEVudHJ5KCBwTWFjLCBwSGRyLT5zYSwgJmFpZCwgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUgKTsKKyAgICBpZiggcFN0YSA9PSBOVUxMICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwKKyAgICAgICAgICAgIEZMKCAiU1RBIGNvbnRleHQgbm90IGZvdW5kIC0gaWdub3JpbmcgQUREQkEgZnJvbSAiICkpOworICAgICAgICBsaW1QcmludE1hY0FkZHIoIHBNYWMsIHBIZHItPnNhLCBMT0dFICk7CisKKyAgICAgICAgLy8gRklYTUUgLSBTaG91bGQgd2UgZG8gdGhpcz8KKyAgICAgICAgc3RhdHVzID0gZVNJUl9NQUNfSU5BQkxJVFlfVE9fQ09ORklSTV9BU1NPQ19TVEFUVVM7CisgICAgICAgIGdvdG8gcmV0dXJuQWZ0ZXJFcnJvcjsKKyAgICB9CisgICAgbGltTG9nKCBwTWFjLCBMT0cxLCBGTCggIkFEREJBIFJlcSBmcm9tIFNUQSAiTUFDX0FERFJFU1NfU1RSICIgd2l0aCBBSUQgJWQiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiB0aWQgPSAlZCBwb2xpY3kgPSAlZCBidWZmc2l6ZSA9ICVkIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgYW1zZHVTdXBwb3J0ZWQgPSAlZCIpLCBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWlkLCBmcm1BZGRCQVJlcS5BZGRCQVBhcmFtZXRlclNldC50aWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJtQWRkQkFSZXEuQWRkQkFQYXJhbWV0ZXJTZXQucG9saWN5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZybUFkZEJBUmVxLkFkZEJBUGFyYW1ldGVyU2V0LmJ1ZmZlclNpemUsCisgICAgICAgICAgICAgIC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0JBX1NFU1NJT05TXzJfNF9HX0JUQyIpKTsKKyAgICAgICAgdmFsID0gMDsKKyAgICB9CisgICAgaWYgKChTSVJfQkFORF8yXzRfR0haID09IGxpbUdldFJGQmFuZChwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwpKSAmJgorICAgICAgICAgICAgICAgICAgICB2YWwpCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csCisgICAgICAgICAgICBGTCggIkJUQyBkaXNhYmxlZCBhZ2dyZWdhdGlvbiAtIGlnbm9yaW5nIEFEREJBIGZyb20gIiApKTsKKyAgICAgICAgbGltUHJpbnRNYWNBZGRyKCBwTWFjLCBwSGRyLT5zYSwgTE9HVyApOworCisgICAgICAgIHN0YXR1cyA9IGVTSVJfTUFDX1JFUV9ERUNMSU5FRF9TVEFUVVM7CisgICAgICAgIGdvdG8gcmV0dXJuQWZ0ZXJFcnJvcjsKKyAgICB9CisKKyAgICAvLyBOb3csIHZhbGlkYXRlIHRoZSBBRERCQSBSZXEKKyAgICBpZiggZVNJUl9NQUNfU1VDQ0VTU19TVEFUVVMgIT0KKyAgICAgIChzdGF0dXMgPSBfX2xpbVZhbGlkYXRlQWRkQkFQYXJhbWV0ZXJTZXQoIHBNYWMsIHBTdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJtQWRkQkFSZXEuQWRkQkFQYXJhbWV0ZXJTZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgLy9kaWFsb2d1ZSB0b2tlbiBpcyBkb24ndCBjYXJlIGluIHJlcXVlc3QgdmFsaWRhdGlvbi4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMSU1fQUREQkFfUkVRLCAmZGVsQkFGbGFnKSkpCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsCisgICAgICAgICAgICBGTCggIkFEREJBIH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worICAgIGxpbUxvZyggcE1hYywgTE9HVywKKyAgICAgICAgRkwoICJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIHVucGFja2luZyBhbiBBRERCQSBSZXNwb25zZSAoMHglMDh4LCAlZCBieXRlcyk6IiksCisgICAgICAgIG5TdGF0dXMsCisgICAgICAgIGZyYW1lTGVuICk7CisKKyAgICBQRUxPRzIoc2lyRHVtcEJ1ZiggcE1hYywgU0lSX0RCR19NT0RVTEVfSUQsIExPRzIsIHBCb2R5LCBmcmFtZUxlbiApOykKKyAgfQorCisgIGxpbUxvZyggcE1hYywgTE9HMSwgRkwoICJBRERCQSBSc3AgZnJvbSBTVEEgIk1BQ19BRERSRVNTX1NUUiAiIHdpdGggQUlEICVkICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgInRpZCA9ICVkIHBvbGljeSA9ICVkIGJ1ZmZzaXplID0gJWQgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAiYW1zZHVTdXBwb3J0ZWQgPSAlZCBzdGF0dXMgPSAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSksIGFpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZnJtQWRkQkFSc3AuQWRkQkFQYXJhbWV0ZXJTZXQudGlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICBmcm1BZGRCQVJzcC5BZGRCQVBhcmFtZXRlclNldC5wb2xpY3ksCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZybUFkZEJBUnNwLkFkZEJBUGFyYW1ldGVyU2V0LmJ1ZmZlclNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZybUFkZEJBUnNwLkFkZEJBUGFyYW1ldGVyU2V0LmFtc2R1U3VwcG9ydGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICBmcm1BZGRCQVJzcC5TdGF0dXMuc3RhdHVzKTsKKyAgLy9pZiB0aGVyZSBpcyBubyBtYXRjaGluIGRp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QWRkQkFQYXJhbWV0ZXJTZXQuYnVmZmVyU2l6ZSA9CisgICAgICAgICAgICAgICAgICAgIFZPU19NSU4odmFsLCBmcm1BZGRCQVJzcC5BZGRCQVBhcmFtZXRlclNldC5idWZmZXJTaXplKTsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0cxLAorICAgICAgICAgICAgRkwoICJBRERCQSBSU1AgIEJ1ZmZzaXplID0gJWQiICksCisgICAgICAgICAgICBmcm1BZGRCQVJzcC5BZGRCQVBhcmFtZXRlclNldC5idWZmZXJTaXplKTsKKyAgICAvLyBOb3csIHZhbGlkYXRlIHRoZSBBRERCQSBSc3AKKyAgICBpZiggZVNJUl9NQUNfU1VDQ0VTU19TVEFUVVMgIT0KKyAgICAgICAgX19saW1WYWxpZGF0ZUFkZEJBUGFyYW1ldGVyU2V0KCBwTWFjLCBwU3RhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJtQWRkQkFSc3AuQWRkQkFQYXJhbWV0ZXJTZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOClmcm1BZGRCQVJzcC5EaWFsb2dUb2tlbi50b2tlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExJTV9BRERCQV9SU1AsIE5VTEwpKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLAorICAgICAgICAgICAgRkwoICJBRERCQSBwYXJhbWV0ZXJzIHZhbGlkYXRpb24gZmFpbGVkIiApKTsKKyAgICAgICAgZ290byByZXR1cm5BZnRlckVycm9yOworICAgIH0KKyAgfQorICBlbHNlCisgICAgZ290byByZXR1cm5BZnRlckVycm9yOworCisgIC8vIENoYW5nZSBTVEEgc3RhdGUgdG8gd2FpdCBmb3IgQUREQkEgUnNwIGZyb20gSEFMCisgIExJTV9TRVRfU1RBX0JBX1NUQVRFKHBTdGEsIGZybUFkZEJBUnNwLkFkZEJBUGFyYW1ld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RV9JRCwgTE9HMiwgcEJvZHksIGZyYW1lTGVuICk7KQorICB9CisKKyAgbGltTG9nKCBwTWFjLCBMT0cxLAorICAgICAgRkwoICJSZWNlaXZlZCBERUxCQSBmcm9tOiAiTUFDX0FERFJFU1NfU1RSIiBmb3IgVElEICVkLCBSZWFzb24gY29kZSAlZCIgKSwKKyAgICAgIE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSwKKyAgICAgIGZybURlbEJBSW5kLkRlbEJBUGFyYW1ldGVyU2V0LnRpZCwKKyAgICAgIGZybURlbEJBSW5kLlJlYXNvbi5jb2RlICk7CisKKyAgLy8gTm93LCB2YWxpZGF0ZSB0aGUgREVMQkEgSW5kCisgIGlmKCBlU0lSX01BQ19TVUNDRVNTX1NUQVRVUyAhPSBfX2xpbVZhbGlkYXRlRGVsQkFQYXJhbWV0ZXJTZXQoIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm1EZWxCQUluZC5EZWxCQVBhcmFtZXRlclNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGEgKSkKKyAgeworICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLAorICAgICAgICAgIEZMKCAiQUREQkEgcGFyYW1ldGVycyB2YWxpZGF0aW9uIGZhaWxlZCAiICkpOworICAgICAgcmV0dXJuOworICB9CisgIC8vCisgIC8vIFBvc3QgV0RBX0RFTEJBX0lORCB0byBIQUwgYW5kIGRlbGV0ZSB0aGUKKyAgLy8gZXhpc3RpbmcgQkEgc2Vzc2lvbgorICAvLworICAvLyBOT1RFIC0gSUVFRSA4MDIuMTEtUkVWbWEtRDguMCwgU2VjdGlvbiA3LjMuMS4xNgorICAvLyBpcyBraW5kIG9mIGNvbmZ1c2luZy4uLgorICAvLworICBpZiggZVNJUl9TVUNDRVNTICE9IGxpbVBvc3RNc2dEZWxCQUluZCggcE1hYywKKyAgICAgICAgcFN0YSwKKyAgICAgICAgKHRBTklfVTgpIGZybURlbEJBSW5kLkRlbEJBUGFyYW1ldGVyU2V0LnRpZCwKKyAgICAgICAgKGVCQV9SRUNJUElFTlQgPT0gZnJtRGVsQkFJbmQuRGVsQkFQYXJhbWV0ZXJTZXQuaW5pdGlhdG9yKT8KKyAgICAgICAgICBlQkFfSU5JVElBVE9SOiBlQkFfUkVDSVBJRU5ULHBzZXNzaW9uRW50cnkpKQorICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoICJQb3N0aW5nIFdEQV9ERUxCQV9JTkQgdG8gSEFMIGZhaWxlZCAiKSk7CisKKyAgcmV0dXJuOworCit9CisKK3N0YXRpYyB2b2lkCitfX2xpbVByb2Nlc3NTTVBvd2VyU2F2ZVVwZGF0ZSh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4ICpwUnhQYWNrZXRJbmZvICx0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KQoreworCisjaWYgMAorICAgICAgICB0cFNpck1hY01nbXRIZHIgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRyOworICAgICAgICB0RG90MTFmU01Qb3dlclNhdmUgICAgICAgICAgICAgICAgICAgIGZybVNNUG93ZXI7CisgICAgICAgIHRTaXJNYWNIVE1JTU9Qb3dlclNhdmVTdGF0ZSAgc3RhdGU7CisgICAgICAgIHRwRHBoSGFzaE5vZGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGE7CisgICAgICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFpZDsKKyAgICAgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVMZW4sIG5TdGF0dXM7CisgICAgICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqcEJvZHk7CisKKyAgICAgICAgcEhkciA9IFNJUl9NQUNfQkRfVE9fTVBEVUhFQURFUiggcEJkICk7CisgICAgICAgIHBCb2R5ID0gU0lSX01BQ19CRF9UT19NUERVREFUQSggcEJkICk7CisgICAgICAgIGZyYW1lTGVuID0gU0lSX01BQ19CRF9UT19QQVlMT0FEX0xFTiggcEJkICk7CisKKyAgICAgICAgcFN0YSA9IGRwaExvb2t1cEhhc2hFbnRyeShwTWFjLCBwSGRyLT5zYSwgJmFpZCwgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUgKTsKKyAgICAgICAgaWYoIHBTdGEgPT0gTlVMTCApIHsKKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSxGTCggIlNUQSBjb250ZXh0IG5vdCBmb3VuZCAtIGlnbm9yaW5nIFVwZGF0ZVNNIFBTYXZlIE1vZGUgZnJvbSAiICkpOworICAgICAgICAgICAgbGltUHJpbnRNYWNBZGRyKCBwTWFjLCBwSGRyLT5zYSwgTE9HVyApOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgLyoqVW5wYWNrIHRoZSByZWNlaXZlZCBmcmFtZSAqLworICAgICAgICBuU3RhdHVzID0gZG90MTFmVW5wYWNrU01Qb3dlclNhdmUoIHBNYWMsIHBCb2R5LCBmcmFtZUxlbiwgJmZybVNNUG93ZXIpOworCisgICAgICAgIGlmKCBET1QxMUZfRkFJTEVEKCBuU3RhdHVzICkpIHsKKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoICJGYWlsZWQgdG8gdW5wYWNrIGFuZCBwYXJzZSBhIFVwZGF0ZSBTTSBQb3dlciAoMHglMDh4LCAlZCBieXRlcyk6IiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgblN0YXR1cywgZnJhbWVMZW4gKTsKKyAgICAgICAgICAgIFBFTE9HMihzaXJEdW1wQnVmKCBwTWFjLCBTSVJfREJHX01PRFVMRV9JRCwgTE9HMiwgcEJvZHksIGZyYW1lTGVuICk7KQorICAgICA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BVFVSRV9WT1dJRkkKKworc3RhdGljIHZvaWQKK19fbGltUHJvY2Vzc1JhZGlvTWVhc3VyZVJlcXVlc3QoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggKnBSeFBhY2tldEluZm8gLHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkgKQoreworICAgICB0cFNpck1hY01nbXRIZHIgICAgICAgICAgICAgICAgcEhkcjsKKyAgICAgdERvdDExZlJhZGlvTWVhc3VyZW1lbnRSZXF1ZXN0IGZybTsKKyAgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgICAgICAgIGZyYW1lTGVuLCBuU3RhdHVzOworICAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgICAgKnBCb2R5OworCisgICAgIHBIZHIgPSBXREFfR0VUX1JYX01BQ19IRUFERVIoIHBSeFBhY2tldEluZm8gKTsKKyAgICAgcEJvZHkgPSBXREFfR0VUX1JYX01QRFVfREFUQSggcFJ4UGFja2V0SW5mbyApOworICAgICBmcmFtZUxlbiA9IFdEQV9HRVRfUlhfUEFZTE9BRF9MRU4oIHBSeFBhY2tldEluZm8gKTsKKworICAgICBpZiggcHNlc3Npb25FbnRyeSA9PSBOVUxMICkKKyAgICAgeworICAgICAgICAgIHJldHVybjsKKyAgICAgfQorCisgICAgIC8qKlVucGFjayB0aGUgcmVjZWl2ZWQgZnJhbWUgKi8KKyAgICAgblN0YXR1cyA9IGRvdDExZlVucGFja1JhZGlvTWVhc3VyZW1lbnRSZXF1ZXN0KCBwTWFjLCBwQm9keSwgZnJhbWVMZW4sICZmcm0gKTsKKworICAgICBpZiggRE9UMTFGX0ZBSUxFRCggblN0YXR1cyApKSB7CisgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCggIkZhaWxlZCB0byB1bnBhY2sgYW5kIHBhcnNlIGEgUmFkaW8gTWVhc3VyZSByZXF1ZXN0ICgweCUwOHgsICVkIGJ5dGVzKToiKSwKKyAgICAgICAgICAgICAgIC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ICAgICAgICAgICAgICAgICAgICAgICpwQm9keTsKKworICAgICBwSGRyID0gV0RBX0dFVF9SWF9NQUNfSEVBREVSKCBwUnhQYWNrZXRJbmZvICk7CisgICAgIHBCb2R5ID0gV0RBX0dFVF9SWF9NUERVX0RBVEEoIHBSeFBhY2tldEluZm8gKTsKKyAgICAgZnJhbWVMZW4gPSBXREFfR0VUX1JYX1BBWUxPQURfTEVOKCBwUnhQYWNrZXRJbmZvICk7CisKKyAgICAgaWYoIHBzZXNzaW9uRW50cnkgPT0gTlVMTCApCisgICAgIHsKKyAgICAgICAgICByZXR1cm47CisgICAgIH0KKworICAgICAvKipVbnBhY2sgdGhlIHJlY2VpdmVkIGZyYW1lICovCisgICAgIG5TdGF0dXMgPSBkb3QxMWZVbnBhY2tMaW5rTWVhc3VyZW1lbnRSZXF1ZXN0KCBwTWFjLCBwQm9keSwgZnJhbWVMZW4sICZmcm0gKTsKKworICAgICBpZiggRE9UMTFGX0ZBSUxFRCggblN0YXR1cyApKSB7CisgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCggIkZhaWxlZCB0byB1bnBhY2sgYW5kIHBhcnNlIGEgTGluayBNZWFzdXJlIHJlcXVlc3QgKDB4JTA4eCwgJWQgYnl0ZXMpOiIpLAorICAgICAgICAgICAgICAgICAgICBuU3RhdHVzLCBmcmFtZUxlbiApOworICAgICAgICAgIFBFTE9HMihzaXJEdW1wQnVmKCBwTWFjLCBTSVJfREJHX01PRFVMRV9JRCwgTE9HMiwgcEJvZHksIGZyYW1lTGVuICk7KQorICAgICAgICAgICAgICAgcmV0dXJuOworICAgICB9ZWxzZSBpZiAoIERPVDExRl9XQVJORUQoIG5TdGF0dXMgKSApIHsKKyAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgRkwoICJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIHVucGFja2luZyBhIExpbmsgTWVhc3VyZSByZXF1ZXN0ICgweCUwOHgsICVkIGJ5dGVzKToiKSwKKyAgICAgICAgICAgICAgICAgICAgblN0YXR1cywgZnJhbWVMZW4gKTsKKyAgICAgICAgICBQRUxPRzIoc2lyRHVtcEJ1ZiggcE1hYywgU0lSX0RCR19NT0RVTEVfSUQsIExPRzIsIHBCb2R5LCBmcmFtZUxlbiApOykKKyAgICAgfQorCisgICAgIC8vIENhbGwgcnJtIGZ1bmN0aW9uIHRvIGhhbmRsZSB0aGUgcmVxdWVzdC4KKworICAgICBycm1Qcm9jZXNzTGlua01lYXN1cmVtZW50UmVxdWVzdCggcE1hYywgcFJ4UGFja2V0SW5mbywgJmZybSwgcHNlc3Npb25FbnRyeSApOworCit9CisKK3N0YXRpYyB2b2lkCitfX2xpbVByb2Nlc3NOZWlnaGJvclJlcG9ydCggdHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VOCAqcFJ4UGFja2V0SW5mbyAsdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSApCit7CisgICAgIHRwU2lyTWFjTWdtdEhkciAgICAgICAgICAgICAgIHBIZHI7CisgICAgIHREb3QxMWZOZWlnaGJvclJlcG9ydFJlc3BvbnNlICpwRnJtOworICAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICAgICAgICBmcmFtZUxlbiwgblN0YXR1czsKKyAgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgICAgKnBCb2R5OworCisgICAgIHBIZHIgPSBXREFfR0VUX1JYX01BQ19IRUFERVIoIHBSeFBhY2tldEluZm8gKTsKKyAgICAgcEJvZHkgPSBXREFfR0VUX1JYX01QRFVfREFUQSggcFJ4UGFja2V0SW5mbyApOworICAgICBmcmFtZUxlbiA9IFdEQV9HRVRfUlhfUEFZTE9BRF9MRU4oIHBSeFBhY2tldEluZm8gKTsKKworICAgICBwRnJtID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHREb3QxMWZOZWlnaGJvclJlcG9ydFJlc3BvbnNlKSk7CisgICAgIGlmIChOVUxMID09IHBGcm0pCisgICAgIHsKKyAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiVW5hYmxlIHRvIGFsbG9jYXRlIG1lbW9yeSBpbiBfX2xpbVByb2Nlc3NOZWlnaGJvclJlcG9ydCIpICk7CisgICAgICAgICByZXR1cm47CisgICAgIH0KKworICAgICBpZihwc2Vzc2lvbkVudHJ5ID09IE5VTEwpCisgICAgIHsKKyAgICAgICAgICB2b3NfbWVtX2ZyZWUocEZybSk7CisgICAgICAgICAgcmV0dXJuOworICAgICB9CisKKyAgICAgLyoqVW5wYWNrIHRoZSByZWNlaXZlZCBmcmFtZSAqLworICAgICBuU3RhdHVzID0gZG90MTFmVW5wYWNrTmVpZ2hib3JSZXBvcnRSZXNwb25zZSggcE1hYywgcEJvZHksIGZyYW1lTGVuLHBGcm0gKTsKKworICAgICBpZiggRE9UMTFGX0ZBSUxFRCggblN0YXR1cyApKSB7CisgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCggIkZhaWxlZCB0byB1bnBhY2sgYW5kIHBhcnNlIGEgTmVpZ2hib3IgcmVwb3J0IHJlc3BvbnNlICgweCUwOHgsICVkIGJ5dGVzKToiKSwKKyAgICAgICAgICAgICAgICAgICAgblN0YXR1cywgZnJhbWVMZW4gKTsKKyAgICAgICAgICBQRUxPRzIoc2lyRHVtcEJ1ZiggcE1hYywgU0lSX0RCR19NT0RVTEVfSUQsIExPRzIsIHBCb2R5LCBmcmFtZUxlbiApOykKKyAgICAgICAgICB2b3NfbWVtX2ZyZWUocEZybSk7CisgICAgICAgICAgcmV0dXJuOworICAgICB9ZWxzZSBpZiAoIERPVDExRl9XQVJORUQoIG5TdGF0dXMgKSApIHsKKyAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgRkwoICJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIHVucGFja2luZyBhIE5laWdoYm9yIHJlcG9ydCByZXNwb25zZSAoMHglMDh4LCAlZCBieXRlcyk6IiksCisgICAgICAgICAgICAgICAgICAgIG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bm5lbExpc3Q7CisKKyAgICBwSGRyID0gV0RBX0dFVF9SWF9NQUNfSEVBREVSKCBwUnhQYWNrZXRJbmZvICk7CisgICAgcEJvZHkgPSBXREFfR0VUX1JYX01QRFVfREFUQSggcFJ4UGFja2V0SW5mbyApOworICAgIGZyYW1lTGVuID0gV0RBX0dFVF9SWF9QQVlMT0FEX0xFTiggcFJ4UGFja2V0SW5mbyApOworCisgICAgcEZybSA9CisgICAgIHZvc19tZW1fbWFsbG9jKHNpemVvZih0RG90MTFmSFQyMDQwQlNTQ29leGlzdGVuY2VNYW5hZ2VtZW50QWN0aW9uRnJhbWUpKTsKKworICAgIGlmIChOVUxMID09IHBGcm0pCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlVuYWJsZSB0byBhbGxvY2F0ZSBtZW1vcnkiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBpZihwc2Vzc2lvbkVudHJ5ID09IE5VTEwpCisgICAgeworICAgICAgICAgdm9zX21lbV9mcmVlKHBGcm0pOworICAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIC8qKlVucGFjayB0aGUgcmVjZWl2ZWQgZnJhbWUgKi8KKyAgICBuU3RhdHVzID0gZG90MTFmVW5wYWNrSFQyMDQwQlNTQ29leGlzdGVuY2VNYW5hZ2VtZW50QWN0aW9uRnJhbWUoIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCb2R5LCBmcmFtZUxlbiwgcEZybSApOworCisgICAgaWYoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSkKKyAgICB7CisgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCAiRmFpbGVkIHRvIHVucGFjayBhbmQgcGFyc2UgYSAyMC80MCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJDb2V4IEFjdGlvbiBGcmFtZSAoMHglMDh4LCAlZCBieXRlcyk6IiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgblN0YXR1cywgZnJhbWVMZW4gKTsKKyAgICAgICAgIFBFTE9HMihzaXJEdW1wQnVmKCBwTWFjLCBTSVJfREJHX01PRFVMRV9JRCwgTE9HMiwgcEJvZHksIGZyYW1lTGVuICk7KQorICAgICAgICAgdm9zX21lbV9mcmVlKHBGcm0pOworICAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBlbHNlIGlmICggRE9UMTFGX1dBUk5FRCggblN0YXR1cyApKQorICAgIHsKKyAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLCBGTCggIlRoZXJlIHdlcmUgd2FybmluZ3Mgd2hpbGUgdW5wYWNraW5nIGEiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgMjAvNDAgQ29leCBBY3Rpb24gRnJhbWUgKDB4JTA4eCwgJWQgYnl0ZXMpOiIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuU3RhdHVzLCBmcmFtZUxlbiApOworICAgICAgICAgUEVMT0cyKHNpckR1bXBCdWYoIHBNYWMsIFNJUl9EQkdfTU9EVUxFX0lELCBMT0cyLCBwQm9keSwgZnJhbWVMZW4gKTspCisgICAgfQorCisgICAgbnVtX2NoYW5uZWxMaXN0ID0gcEZybS0+SFQyMDQwQlNTSW50b2xlcmFudFJlcG9ydC5udW1fY2hhbm5lbExpc3Q7CisKKyAgICBpZiAobnVtX2NoYW5uZWxMaXN0ID4gMCkKKyAgICB7CisgICAgICAgIGxlbmd0aCA9IChzaXplb2YodFNpckhUMjA0MENvZXhJbmZvSW5kKSAtIHNpemVvZih0QU5JX1U4KSArCisgICAgICAgICAgICAgICAgICAgKG51bV9jaGFubmVsTGlzdCAqIHNpemVvZih0QU5JX1U4KSkpOworICAgIH0KKyAgICBlbHNlCisgICAgICAgIGxlbmd0aCA9IHNpemVvZih0U2lySFQyMDQwQ29leEluZm9JbmQpOworCisgICAgbGltTG9nKHBNYWMsIExPR1csRkwoInRTaXJIVDIwNDBDb2V4SW5mb0luZDogTGVuZ3RoOiAlZCIpLGxlbmd0aCk7CisKKyAgICBwU2lyU21lSFQyMDQwQ29leEluZm9JbmQgPSB2b3NfbWVtX21hbGxvYyhsZW5ndGgpOworCisgICAgaWYgKE5VTEwgPT0gcFNpclNtZUhUMjA0MENvZXhJbmZvSW5kKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICBGTCgiQWxsb2NhdGVNZW1vcnkgZmFpbGVkIGZvciBlV05JX1NNRV8yMDQwX0NPRVhfSU5EIikpOworICAgICAgICAgdm9zX21lbV9mcmVlKHBGcm0pOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgdm9zX21lbV9zZXQoKHZvaWQqKXBTaXJTbWVIVDIwNDBDb2V4SW5mb0luZCwgbGVuZ3RoLCAwKTsKKworICAgIHBTaXJTbWVIVDIwNDBDb2V4SW5mb0luZC0+bWVzc2FnZVR5cGUgPSBlV05JX1NNRV8yMDQwX0NPRVhfSU5EOworICAgIHBTaXJTbWVIVDIwNDBDb2V4SW5mb0luZC0+c2Vzc2lvbklkID0gc2Vzc2lvbklkOworICAgIHBTaXJTbWVIVDIwNDBDb2V4SW5mb0luZC0+bGVuZ3RoID0gbGVuZ3RoOworCisgICAgaWYgKHBGcm0tPkhUMjA0MEJTU0NvZXhpc3RlbmNlLnByZXNlbnQpCisgICAgeworCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiaW5mb1JlcXVlc3Q6ICVkIGZvcnR5TUh6SW50b2xlcmFudDogJWQiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiIHR3ZW50eU1IekJzc1dpZHRoUmVxOiAlZCBvYnNzU2NhbkV4ZW1wdGlvblJlcTogJWQiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiIG9ic3NTY2FuRXhlbXB0aW9uR3JhbnQ6ICVkICIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcEZybS0+SFQyMDQwQlNTQ29leGlzdGVuY2UuaW5mb1JlcXVlc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwRnJtLT5IVDIwNDBCU1NDb2V4aXN0ZW5jZS5mb3J0eU1IekludG9sZXJhbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwRnJtLT5IVDIwNDBCU1NDb2V4aXN0ZW5jZS50d2VudHlNSHpCc3NXaWR0aFJlcSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBGcm0tPkhUMjA0MEJTU0NvZXhpc3RlbmNlLm9ic3NTY2FuRXhlbXB0aW9uUmVxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcEZybS0+SFQyMDQwQlNTQ29leGlzdGVuY2Uub2Jzc1NjYW5FeGVtcHRpb25HcmFudCk7CisKKyAgICAgICBwU2lyU21lSFQyMDQwQ29leEluZm9JbmQtPkhUNDBNSHpJbnRvbGVyYW50ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEZybS0+SFQyMDQwQlNTQ29leGlzdGVuY2UuZm9ydHlNSHpJbnRvbGVyYW50OworICAgICAgIHBTaXJTbWVIVDIwNDBDb2V4SW5mb0luZC0+SFQyME1IekJzc1dpZHRoUmVxID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEZybS0+SFQyMDQwQlNTQ29leGlzdGVuY2UudHdlbnR5TUh6QnNzV2lkdGhSZXE7CisgICAgfQorCisgICAgaWYgKHBGcm0tPkhUMjA0MEJTU0ludG9sZXJhbnRSZXBvcnQucHJlc2VudCkKKyAgICB7CisgICAgICAgbGltTG9nKHBNYWMsIExPR1csIEZMKCJvcGVyYXRpbmdDbGFzczogJWQgIG51bV9jaGFubmVsTGlzdDogJWQgIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgcEZybS0+SFQyMDQwQlNTSW50b2xlcmFudFJlcG9ydC5vcGVyYXRpbmdDbGFzcywKKyAgICAgICAgICAgICAgICAgICAgICAgICBudW1fY2hhbm5lbExpc3QpOworCisgICAgICAgaWYgKG51bV9jaGFubmVsTGlzdCA+IDApCisgICAgICAgeworICAgICAgICAgICB2b3NfbWVtX3plcm8ocFNpclNtZUhUMjA0MENvZXhJbmZvSW5kLT5IVDIwNDBCc3NJbnRvQ2hhblJlcG9ydCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBudW1fY2hhbm5lbExpc3QpOworICAgICAgICAgICB2b3NfbWVtX2NvcHkocFNpclNtZUhUMjA0MENvZXhJbmZvSW5kLT5IVDIwNDBCc3NJbnRvQ2hhblJlcG9ydCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRnJtLT5IVDIwNDBCU1NJbnRvbGVyYW50UmVwb3J0LmNoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bV9jaGFubmVsTGlzdCk7CisKKyAgICAgICAgICAgcFNpclNtZUhUMjA0MENvZXhJbmZvSW5kLT5jaGFubmVsX251bSA9IG51bV9jaGFubmVsTGlzdDsKKyAgICAgICB9CisKKyAgICAgICBmb3IoaT0wOyBpIDwgbnVtX2NoYW5uZWxMaXN0OyBpKyspCisgICAgICAgeworICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgRkwoIkNoYW5uZWwgOiAlZCAiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTaXJTbWVIVDIwNDBDb2V4SW5mb0luZC0+SFQyMDQwQnNzSW50b0NoYW5SZXBvcnRbaV0pOworICAgICAgIH0KKyAgICB9CisKKyAgICBtbWhNc2cudHlwZSA9IGVXTklfU01FXzIwNDBfQ09FWF9JTkQ7CisgICAgbW1oTXNnLmJvZHlwdHIgPSBwU2lyU21lSFQyMDQwQ29leEluZm9JbmQ7CisgICAgbW1oTXNnLmJvZHl2YWwgPSAwOworICAgIGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiUG9zdGluZyBlV05JX1NNRV8yMDQwX0NPRVhfSU5EIE1lc3NhZ2UgdG8gU01FICIpK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RnJhbWVIZHIgcEFjdGlvbkhkciA9ICh0cFNpck1hY0FjdGlvbkZyYW1lSGRyKSBwQm9keTsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisgICAgdHBTaXJNYWNNZ210SGRyIHBIZHIgPSBXREFfR0VUX1JYX01BQ19IRUFERVIocFJ4UGFja2V0SW5mbyk7CisKKyAgICBpZiAobGltX2lzX3JvYnVzdF9tZ210X2FjdGlvbl9mcmFtZShwQWN0aW9uSGRyLT5jYXRlZ29yeSkgJiYKKyAgICAgICAgbGltRHJvcFVucHJvdGVjdGVkQWN0aW9uRnJhbWUocE1hYywgcHNlc3Npb25FbnRyeSwgcEhkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFjdGlvbkhkci0+Y2F0ZWdvcnkpKSB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgRkwoIkRvbid0IHNlbmQgdW5wcm90ZWN0IGFjdGlvbiBmcmFtZSB0byB1cHBlciBsYXllciBjYXRlZyAlZCAiKSwKKyAgICAgICAgICAgICAgIHBBY3Rpb25IZHItPmNhdGVnb3J5KTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyNlbmRpZgorCisgICAgc3dpdGNoIChwQWN0aW9uSGRyLT5jYXRlZ29yeSkKKyAgICB7CisgICAgICAgIGNhc2UgU0lSX01BQ19BQ1RJT05fUU9TX01HTVQ6CisgICAgICAgICAgICBpZiAoIChwc2Vzc2lvbkVudHJ5LT5saW1Rb3NFbmFibGVkKSB8fAorICAgICAgICAgICAgICAgICAgKHBBY3Rpb25IZHItPmFjdGlvbklEID09IFNJUl9NQUNfUU9TX01BUF9DT05GSUdVUkUpICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKHBBY3Rpb25IZHItPmFjdGlvbklEKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTSVJfTUFDX1FPU19BRERfVFNfUkVROgorICAgICAgICAgICAgICAgICAgICAgICAgX19saW1Qcm9jZXNzQWRkVHNSZXEocE1hYywgKHRBTklfVTggKikgcFJ4UGFja2V0SW5mbyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgICAgIGNhc2UgU0lSX01BQ19RT1NfQUREX1RTX1JTUDoKKyAgICAgICAgICAgICAgICAgICAgICAgIF9fbGltUHJvY2Vzc0FkZFRzUnNwKHBNYWMsICh0QU5JX1U4ICopIHBSeFBhY2tldEluZm8scHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgICAgICBjYXNlIFNJUl9NQUNfUU9TX0RFTF9UU19SRVE6CisgICAgICAgICAgICAgICAgICAgICAgICBfX2xpbVByb2Nlc3NEZWxUc1JlcShwTWFjLCAodEFOSV9VOCAqKSBwUnhQYWNrZXRJbmZvLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTSVJfTUFDX1FPU19NQVBfQ09ORklHVVJFOgorICAgICAgICAgICAgICAgICAgICAgICAgX19saW1Qcm9jZXNzUW9zTWFwQ29uZmlndXJlRnJhbWUocE1hYywgKHRBTklfVTggKikgcFJ4UGFja2V0SW5mbyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiUW9zIGFjdGlvbiAlZCBub3QgaGFuZGxlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgIHBBY3Rpb25IZHItPmFjdGlvbklEKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhayA7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBTSVJfTUFDX0FDVElPTl9TUEVDVFJVTV9NR01UOgorICAgICAgICAgICAgc3dpdGNoIChwQWN0aW9uSGRyLT5hY3Rpb25JRCkKKyAgICAgICAgICAgIHsKKyNpZmRlZiBBTklfU1VQUE9SVF8xMUgKKyAgICAgICAgICAgICAgICBjYXNlIFNJUl9NQUNfQUNUSU9OX01FQVNVUkVfUkVRVUVTVF9JRDoKKyAgICAgICAgICAgICAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+bGltMTFoRW5hYmxlKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBfX2xpbVByb2Nlc3NNZWFzdXJlbWVudFJlcXVlc3RGcmFtZShwTWFjLCBwUnhQYWNrZXRJbmZvKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgU0lSX01BQ19BQ1RJT05fVFBDX1JFUVVFU1RfSUQ6CisgICAgICAgICAgICAgICAgICAgIGlmICgocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX1NUQV9ST0xFKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgKHBlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0FQX1JPTEUpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihwc2Vzc2lvbkVudHJ5LT5saW0xMWhFbmFibGUpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19saW1Qcm9jZXNzVHBjUmVxdWVzdEZyYW1lKHBNYWMsIHBSeFBhY2tldEluZm8pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisjZW5kaWYKKyAgICAgICAgICAgICAgICBjYXNlIFNJUl9NQUNfQUNUSU9OX0NIQU5ORUxfU1dJVENIX0lEOgorICAgICAgICAgICAgICAgICAgICBpZiAocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX1NUQV9ST0xFKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBfX2xpbVByb2Nlc3NDaGFubmVsU3dpdGNoQWN0aW9uRnJhbWUocE1hYywgcFJ4UGFja2V0SW5mbyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgICAgICAgICBGTCgiU3BlY3RydW0gbWdtdCBhY3Rpb24gaWQgJWQgbm90IGhhbmRsZWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICBwQWN0aW9uSGRyLT5hY3Rpb25JRCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBTSVJfTUFDX0FDVElPTl9XTUU6CisgICAgICAgICAgICBpZiAoISBwc2Vzc2lvbkVudHJ5LT5saW1XbWVFbmFibGVkKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiV01FIG1vZGUgZGlzYWJsZWQgLSBkcm9wcGluZyBhY3Rpb24gZnJhbWUgJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgcEFjdGlvbkhkci0+YWN0aW9uSUQpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc3dpdGNoKHBBY3Rpb25IZHItPmFjdGlvbklEKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNhc2UgU0lSX01BQ19RT1NfQUREX1RTX1JFUToKKyAgICAgICAgICAgICAgICAgICAgX19saW1Qcm9jZXNzQWRkVHNSZXEocE1hYywgKHRBTklfVTggKikgcFJ4UGFja2V0SW5mbyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIFNJUl9NQUNfUU9TX0FERF9UU19SU1A6CisgICAgICAgICAgICAgICAgICAgIF9fbGltUHJvY2Vzc0FkZFRzUnNwKHBNYWMsICh0QU5JX1U4ICopIHBSeFBhY2tldEluZm8scHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBTSVJfTUFDX1FPU19ERUxfVFNfUkVROgorICAgICAgICAgICAgICAgICAgICBfX2xpbVByb2Nlc3NEZWxUc1JlcShwTWFjLCAodEFOSV9VOCAqKSBwUnhQYWNrZXRJbmZvLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgU0lSX01BQ19RT1NfTUFQX0NPTkZJR1VSRToKKyAgICAgICAgICAgICAgICAgICAgX19saW1Qcm9jZXNzUW9zTWFwQ29uZmlndXJlRnJhbWUocE1hYywgKHRBTklfVTggKikgcFJ4UGFja2V0SW5mbyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIldNRSBhY3Rpb24gJWQgbm90IGhhbmRsZWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFjdGlvbkhkci0+YWN0aW9uSUQpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgU0lSX01BQ19BQ1RJT05fQkxLQUNLOgorICAgICAgICAgICAgLy8gRGV0ZXJtaW5lIHRoZSAidHlwZSIgb2YgQkEgQWN0aW9uIEZyYW1lCisgICAgICAgICAgICBzd2l0Y2gocEFjdGlvbkhkci0+YWN0aW9uSUQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGNhc2UgU0lSX01BQ19CTEtBQ0tfQUREX1JFUToKKyAgICAgICAgICAgICAgICBfX2xpbVByb2Nlc3NBZGRCQVJlcSggcE1hYywgKHRBTklfVTggKikgcFJ4UGFja2V0SW5mbyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICBjYXNlIFNJUl9NQUNfQkxLQUNLX0FERF9SU1A6CisgICAgICAgICAgICAgICAgX19saW1Qcm9jZXNzQWRkQkFSc3AoIHBNYWMsICh0QU5JX1U4ICopIHBSeFBhY2tldEluZm8scHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgY2FzZSBTSVJfTUFDX0JMS0FDS19ERUw6CisgICAgICAgICAgICAgICAgX19saW1Qcm9jZXNzRGVsQkFSZXEoIHBNYWMsICh0QU5JX1U4ICopIHBSeFBhY2tldEluZm8scHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYnJlYWs7CisgICAgY2FzZSBTSVJfTUFDX0FDVElPTl9IVDoKKyAgICAgICAgLyoqIFR5cGUgb2YgSFQgQWN0aW9uIHRvIGJlIHBlcmZvcm1lZCovCisgICAgICAgIHN3aXRjaChwQWN0aW9uSGRyLT5hY3Rpb25JRCkgeworICAgICAgICBjYXNlIFNJUl9NQUNfU01fUE9XRVJfU0FWRToKKyAgICAgICAgICAgIF9fbGltUHJvY2Vzc1NNUG93ZXJTYXZlVXBkYXRlKHBNYWMsICh0QU5JX1U4ICopIHBSeFBhY2tldEluZm8scHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgICAgIEZMKCJBY3Rpb24gSUQgJWQgbm90IGhhbmRsZWQgaW4gSFQgQWN0aW9uIGNhdGVnb3J5IiksCisgICAgICAgICAgICAgICAgICAgcEFjdGlvbkhkci0+YWN0aW9uSUQpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisKKyAgICBjYXNlIFNJUl9NQUNfQUNUSU9OX1dOTToKKyAgICB7CisgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HMSwgRkwoIldOTSBBY3Rpb24gY2F0ZWdvcnkgJWQgYWN0aW9uICVkLiIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWN0aW9uSGRyLT5jYXRlZ29yeSwgcEFjdGlvbkhkci0+YWN0aW9uSUQpOykKKyAgICAgICAgc3dpdGNoIChwQWN0aW9uSGRyLT5hY3Rpb25JRCkKKyAgICAgICAgeworICAgICAgICAgICAgY2FzZSBTSVJfTUFDX1dOTV9CU1NfVE1fUVVFUlk6CisgICAgICAgICAgICBjYXNlIFNJUl9NQUNfV05NX0JTU19UTV9SRVFVRVNUOgorICAgICAgICAgICAgY2FzZSBTSVJfTUFDX1dOTV9CU1NfVE1fUkVTUE9OU0U6CisgICAgICAgICAgICBjYXNlIFNJUl9NQUNfV05NX05PVElGX1JFUVVFU1Q6CisgICAgICAgICAgICBjYXNlIFNJUl9NQUNfV05NX05PVElGX1JFU1BPTlNFOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgdHBTaXJNYWNNZ210SGRyICAgICBwSGRyOworICAgICAgICAgICAgICAgdEFOSV9TOCByc3NpID0gV0RBX0dFVF9SWF9SU1NJX0RCKHBSeFBhY2tldEluZm8pOworICAgICAgICAgICAgICAgcEhkciA9IFdEQV9HRVRfUlhfTUFDX0hFQURFUihwUnhQYWNrZXRJbmZvKTsKKyAgICAgICAgICAgICAgIC8qIEZvcndhcmQgdG8gdGhlIFNNRSB0byBIREQgdG8gd3BhX3N1cHBsaWNhbnQgKi8KKyAgICAgICAgICAgICAgIGxpbVNlbmRTbWVNZ210RnJhbWVJbmQocE1hYywgcHNlc3Npb25FbnRyeS0+c21lU2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJ4UGFja2V0SW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnksIHJzc2kpOworICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgICAgfQorI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX1ZPV0lGSQorICAgIGNhc2UgU0lSX01BQ19BQ1RJT05fUlJNOgorICAgICAgICBpZiggcE1hYy0+cnJtLnJybVBFQ29udGV4dC5ycm1FbmFibGUgKQorICAgICAgICB7CisgICAgICAgICAgICBzd2l0Y2gocEFjdGlvbkhkci0+YWN0aW9uSUQpIHsKKyAgICAgICAgICAgICAgICBjYXNlIFNJUl9NQUNfUlJNX1JBRElPX01FQVNVUkVfUkVROgorICAgICAgICAgICAgICAgICAgICBfX2xpbVByb2Nlc3NSYWRpb01lYXN1cmVSZXF1ZXN0KCBwTWFjLCAodEFOSV9VOCAqKSBwUnhQYWNrZXRJbmZvLCBwc2Vzc2lvbkVudHJ5ICk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU0lSX01BQ19SUk1fTElOS19NRUFTVVJFTUVOVF9SRVE6CisgICAgICAgICAgICAgICAgICAgIF9fbGltUHJvY2Vzc0xpbmtNZWFzdXJlbWVudFJlcSggcE1hYywgKHRBTklfVTggKikgcFJ4UGFja2V0SW5mbywgcHNlc3Npb25FbnRyeSApOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNJUl9NQUNfUlJNX05FSUdIQk9SX1JQVDogICAKKyAgICAgICAgICAgICAgICAgICAgX19saW1Qcm9jZXNzTmVpZ2hib3JSZXBvcnQoIHBNYWMsICh0QU5JX1U4KikgcFJ4UGFja2V0SW5mbywgcHNlc3Npb25FbnRyeSApOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPRzEsIEZMKCJBY3Rpb24gSUQgJWQgbm90IGhhbmRsZWQgaW4gUlJNIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgcEFjdGlvbkhkci0+YWN0aW9uSUQpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLy8gRWxzZSB3ZSB3aWxsIGp1c3QgaWdub3JlIHRoZSBSUk0gbWVzc2FnZXMuCisgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPRzEsCisgICAgICAgICAgICAgIEZMKCJSUk0gQWN0aW9uIGZyYW1lIGlnbm9yZWQgYXMgUlJNIGlzIGRpc2FibGVkIGluIGNmZyIpKTsKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyNlbmRpZgorI2lmICBkZWZpbmVkIChXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUikgfHwgZGVmaW5lZCAoRkVBVFVSRV9XTEFOX0VTRSkgfHwgZGVmaW5lZChGRUFUVVJFX1dMQU5fTEZSKQorICAgICAgICBjYXNlIFNJUl9NQUNfQUNUSU9OX1ZFTkRPUl9TUEVDSUZJQ19DQVRFR09SWToKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdHBTaXJNYWNWZW5kb3JTcGVjaWZpY0ZyYW1lSGRyIHBWZW5kb3JTcGVjaWZpYyA9ICh0cFNpck1hY1ZlbmRvclNwZWNpZmljRnJhbWVIZHIpIHBBY3Rpb25IZHI7CisgICAgICAgICAgICAgIHRwU2lyTWFjTWdtdEhkciAgICAgcEhkcjsKKyAgICAgICAgICAgICAgdEFOSV9VOCBPdWlbXSA9IHsgMHgwMCwgMHgwMCwgMHhmMCB9OworCisgICAgICAgICAgICAgIHBIZHIgPSBXREFfR0VUX1JYX01BQ19IRUFERVIocFJ4UGFja2V0SW5mbyk7CisKKyAgICAgICAgICAgICAgLy9DaGVjayBpZiBpdCBpcyBhIHZlbmRvciBzcGVjaWZpYyBhY3Rpb24gZnJhbWUuCisgICAgICAgICAgICAgIGlmICgoZUxJTV9TVEFfUk9MRSA9PSBwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlKSAmJgorICAgICAgICAgICAgICAgICAgKFZPU19UUlVFID09IHZvc19tZW1fY29tcGFyZShwc2Vzc2lvbkVudHJ5LT5zZWxmTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgJnBIZHItPmRhWzBdLCBzaXplb2YodFNpck1hY0FkZHIpKSkgJiYKKyAgICAgICAgICAgICAgICAgICAgSVNfV0VTX01PREVfRU5BQkxFRChwTWFjKSAmJgorICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvbXBhcmUocFZlbmRvclNwZWNpZmljLT5PdWksIE91aSwgMykpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIFBFTE9HRSggbGltTG9nKCBwTWFjLCBMT0dXLCBGTCgiUmVjZWl2ZWQgVmVuZG9yIHNwZWNpZmljIGFjdGlvbiBmcmFtZSwgT1VJICV4ICV4ICV4IiksCisgICAgICAgICAgICAgICAgICAgICAgICAgcFZlbmRvclNwZWNpZmljLT5PdWlbMF0sIHBWZW5kb3JTcGVjaWZpYy0+T3VpWzFdLCBwVmVuZG9yU3BlY2lmaWMtPk91aVsyXSk7KQorICAgICAgICAgICAgICAgICAvKiBGb3J3YXJkIHRvIHRoZSBTTUUgdG8gSEREIHRvIHdwYV9zdXBwbGljYW50ICovCisgICAgICAgICAgICAgICAgIC8vIHR5cGUgaXMgQUNUSU9OCisgICAgICAgICAgICAgICAgICBsaW1TZW5kU21lTWdtdEZyYW1lSW5kKHBNYWMsIHBzZXNzaW9uRW50cnktPnNtZVNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJ4UGFja2V0SW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSwgMCk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgICAgICAgICBGTCgiRHJvcHBpbmcgdGhlIHZlbmRvciBzcGVjaWZpYyBhY3Rpb24gZnJhbWUgYmVjYXVzZSBvZiggIgorICAgICAgICAgICAgICAgICAgICAgICJXRVMgTW9kZSBub3QgZW5hYmxlZCAoV0VTTU9ERSA9ICVkKSBvciBPVUkgbWlzbWF0Y2ggKCUwMnggJTAyeCAlMDJ4KSBvciAiCisgICAgICAgICAgICAgICAgICAgICAgIm5vdCByZWNlaXZlZCB3aXRoIFNlbGZTdGEgTWFjIGFkZHJlc3MpIHN5c3RlbSByb2xlID0gJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICBJU19XRVNfTU9ERV9FTkFCTEVEKHBNYWMpLAorICAgICAgICAgICAgICAgICAgICAgIHBWZW5kb3JTcGVjaWZpYy0+T3VpWzBdLCBwVmVuZG9yU3BlY2lmaWMtPk91aVsxXSwKKyAgICAgICAgICAgICAgICAgICAgICBwVmVuZG9yU3BlY2lmaWMtPk91aVsyXSwKKyAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlICk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgfQorICAgICAgICAgICBicmVhazsKKyNlbmRpZgorICAgIGNhc2UgU0lSX01BQ19BQ1RJT05fUFVCTElDX1VTQUdFOgorICAgICAgICBzd2l0Y2gocEFjdGlvbkhkci0+YWN0aW9uSUQpIHsKKyAgICAgICAgY2FzZSBTSVJfTUFDX0FDVElPTl9WRU5ET1JfU1BFQ0lGSUM6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHRwU2lyTWFjVmVuZG9yU3BlY2lmaWNQdWJsaWNBY3Rpb25GcmFtZUhkciBwUHViQWN0aW9uID0gKHRwU2lyTWFjVmVuZG9yU3BlY2lmaWNQdWJsaWNBY3Rpb25GcmFtZUhkcikgcEFjdGlvbkhkcjsKKyAgICAgICAgICAgICAgdEFOSV9VOCBQMlBPdWlbXSA9IHsgMHg1MCwgMHg2RiwgMHg5QSwgMHgwOSB9OworCisgICAgICAgICAgICAgIC8vQ2hlY2sgaWYgaXQgaXMgYSBQMlAgcHVibGljIGFjdGlvbiBmcmFtZS4KKyAgICAgICAgICAgICAgaWYgKHZvc19tZW1fY29tcGFyZShwUHViQWN0aW9uLT5PdWksIFAyUE91aSwgNCkpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgLyogRm9yd2FyZCB0byB0aGUgU01FIHRvIEhERCB0byB3cGFfc3VwcGxpY2FudCAqLworICAgICAgICAgICAgICAgICAvLyB0eXBlIGlzIEFDVElPTgorICAgICAgICAgICAgICAgICBsaW1TZW5kU21lTWdtdEZyYW1lSW5kKHBNYWMsIHBzZXNzaW9uRW50cnktPnNtZVNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnhQYWNrZXRJbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnksIDApOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgICAgIEZMKCJVbmhhbmRsZWQgcHVibGljIGFjdGlvbiBmcmFtZSAoVmVuZG9yIHNwZWNpZmljKS4gT1VJICV4ICV4ICV4ICV4IiksCisgICAgICAgICAgICAgICAgICAgICAgcFB1YkFjdGlvbi0+T3VpWzBdLCBwUHViQWN0aW9uLT5PdWlbMV0sCisgICAgICAgICAgICAgICAgICAgICAgcFB1YkFjdGlvbi0+T3VpWzJdLCBwUHViQWN0aW9uLT5PdWlbM10gKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfQVBfSFQ0MF8yNEcKKyAgICAgICAgY2FzZSBTSVJfTUFDX0FDVElPTl8yMDQwX0JTU19DT0VYSVNURU5DRToKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGlmIChwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLmFwSFQ0MF8yNEdFbmFibGVkKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HVywgRkwoIlB1YmxpYyBBY3Rpb24gMjAvNDAgQlNTIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJDb2V4aXN0ZW5jZSBNYW5hZ2VtZW50IGZyYW1lIikpOworCisgICAgICAgICAgICAgICAgICAgX19saW1Qcm9jZXNzMjA0MGJzc0NvZXhpc3RlbmNlQWN0aW9uRnJhbWUocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+c21lU2Vzc2lvbklkLCAodEFOSV9VOCAqKSBwUnhQYWNrZXRJbmZvLAorICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorI2VuZGlmCisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICAgICAgICAgY2FzZSBTSVJfTUFDX1RETFNfRElTX1JTUDoKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgdEFOSV9TOCAgICAgICAgICAgICByc3NpOworCisgICAgICAgICAgICAgICByc3NpID0gV0RBX0dFVF9SWF9SU1NJX0RCKHBSeFBhY2tldEluZm8pOworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfUEUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgiUHVibGljIEFjdGlvbiBURExTIERpc2NvdmVyeSBSU1AgLi4iKSkgOworICAgICAgICAgICAgICAgbGltU2VuZFNtZU1nbXRGcmFtZUluZChwTWFjLCBwc2Vzc2lvbkVudHJ5LT5zbWVTZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSeFBhY2tldEluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnksIHJzc2kpOworICAgICAgICAgICB9CisgICAgICAgICAgICAgICBicmVhazsKKyNlbmRpZgorCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlVuaGFuZGxlZCBwdWJsaWMgYWN0aW9uIGZyYW1lIC0tICV4ICIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWN0aW9uSGRyLT5hY3Rpb25JRCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKworI2lmZGVm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lYWs7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgICB9CisjZW5kaWYKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgIGNhc2UgU0lSX01BQ19BQ1RJT05fVkhUOgorICAgIHsKKyAgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPnZodENhcGFiaWxpdHkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHN3aXRjaCAocEFjdGlvbkhkci0+YWN0aW9uSUQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2FzZSAgU0lSX01BQ19WSFRfT1BNT0RFX05PVElGSUNBVElPTjoKKyAgICAgICAgICAgICAgICAgICAgX19saW1Qcm9jZXNzT3BlcmF0aW5nTW9kZUFjdGlvbkZyYW1lKHBNYWMscFJ4UGFja2V0SW5mbyxwc2Vzc2lvbkVudHJ5KTsgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICB9CisjZW5kaWYKKyAgICBkZWZhdWx0OgorICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgRkwoIkFjdGlvbiBjYXRlZ29yeSAlZCBub3QgaGFuZGxlZCIpLCBwQWN0aW9uSGRyLT5jYXRlZ29yeSk7CisgICAgICAgYnJlYWs7CisgICAgfQorfQorCisvKioKKyAqIGxpbVByb2Nlc3NBY3Rpb25GcmFtZU5vU2Vzc2lvbgorICoKKyAqRlVOQ1RJT046CisgKiBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCBieSBsaW1Qcm9jZXNzTWVzc2FnZVF1ZXVlKCkgdXBvbgorICogQWN0aW9uIGZyYW1lIHJlY2VwdGlvbiBhbmQgbm8gc2Vzc2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DB4NTAsIDB4NkYsIDB4OUEsIDB4MDkgfTsKKworICAgICAgICAgICAgICAgIC8vQ2hlY2sgaWYgaXQgaXMgYSBQMlAgcHVibGljIGFjdGlvbiBmcmFtZS4KKyAgICAgICAgICAgICAgICBpZiAodm9zX21lbV9jb21wYXJlKHBBY3Rpb25IZHItPk91aSwgUDJQT3VpLCA0KSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBGb3J3YXJkIHRvIHRoZSBTTUUgdG8gSEREIHRvIHdwYV9zdXBwbGljYW50ICovCisgICAgICAgICAgICAgICAgICAvLyB0eXBlIGlzIEFDVElPTgorICAgICAgICAgICAgICAgICAgbGltU2VuZFNtZU1nbXRGcmFtZUluZChwTWFjLCAwLCBwQmQsIE5VTEwsIDApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgICAgICAgRkwoIlVuaGFuZGxlZCBwdWJsaWMgYWN0aW9uIGZyYW1lIChWZW5kb3Igc3BlY2lmaWMpLiBPVUkgJXggJXggJXggJXgiKSwKKyAgICAgICAgICAgICAgICAgICAgICBwQWN0aW9uSGRyLT5PdWlbMF0sIHBBY3Rpb25IZHItPk91aVsxXSwKKyAgICAgICAgICAgICAgICAgICAgICBwQWN0aW9uSGRyLT5PdWlbMl0sIHBBY3Rpb25IZHItPk91aVszXSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgICBGTCgiVW5oYW5kbGVkIHB1YmxpYyBhY3Rpb24gZnJhbWUgLS0gJXggIiksIHBBY3Rpb25IZHItPmFjdGlvbklEKTsKKyAgICAgICAgICAgICAgICA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nKHBNYWMsIExPRzIsIEZMKCJSY3YgQXNzb2NSZXE6IGNobmw9JWQsIG51bU9mQ2hubD0lZCAiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0Q2hhbm5lbE51bWJlciwgbnVtYmVyT2ZDaGFubmVsKTspCisKKyAgICAgICAgaWYgKG51bWJlck9mQ2hhbm5lbCA+IDEpCisgICAgICAgIHsKKyAgICAgICAgICAgIG5leHRDaGFubmVsTnVtYmVyID0gZmlyc3RDaGFubmVsTnVtYmVyOworICAgICAgICAgICAgaWYoU0lSX0JBTkRfNV9HSFogPT0gbGltR2V0UkZCYW5kKGZpcnN0Q2hhbm5lbE51bWJlcikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZm9yIChqPTE7IGogPCBudW1iZXJPZkNoYW5uZWw7IGorKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIG5leHRDaGFubmVsTnVtYmVyICs9IFNJUl8xMUFfRlJFUVVFTkNZX09GRlNFVDsKKyAgICAgICAgICAgICAgICAgICAgcE1sbUFzc29jSW5kLT5zdXBwb3J0ZWRDaGFubmVscy5jaGFubmVsTGlzdFtpbmRleF0gPSBuZXh0Q2hhbm5lbE51bWJlcjsKKyAgICAgICAgICAgICAgICAgICAgaW5kZXgrKzsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4ID49IFNJUl9NQVhfU1VQUE9SVEVEX0NIQU5ORUxfTElTVCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcE1sbUFzc29jSW5kLT5zdXBwb3J0ZWRDaGFubmVscy5udW1DaG5sID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYoU0lSX0JBTkRfMl80X0dIWiA9PSBsaW1HZXRSRkJhbmQoZmlyc3RDaGFubmVsTnVtYmVyKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBmb3IgKGo9MTsgaiA8IG51bWJlck9mQ2hhbm5lbDsgaisrKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbmV4dENoYW5uZWxOdW1iZXIgKz0gU0lSXzExQl9GUkVRVUVOQ1lfT0ZGU0VUOworICAgICAgICAgICAgICAgICAgICBwTWxtQXNzb2NJbmQtPnN1cHBvcnRlZENoYW5uZWxzLmNoYW5uZWxMaXN0W2luZGV4XSA9IG5leHRDaGFubmVsTnVtYmVyOworICAgICAgICAgICAgICAgICAgICBpbmRleCsrOworICAgICAgICAgICAgICAgICAgICBpZiAoaW5kZXggPj0gU0lSX01BWF9TVVBQT1JURURfQ0hBTk5FTF9MSVNUKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwTWxtQXNzb2NJbmQtPnN1cHBvcnRlZENoYW5uZWxzLm51bUNobmwgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcE1sbUFzc29jSW5kLT5zdXBwb3J0ZWRDaGFubmVscy5udW1DaG5sID0gKHRBTklfVTgpIGluZGV4OworICAgUEVMT0cyKGxpbUxvZyhwTWFjLCBMT0cyLAorICAgICAgICBGTCgiU2VuZCBBc3NvY0luZCB0byBXU006IHNwZWN0cnVtIE9OLCBtaW5Qd3IgJWQsIG1heFB3ciAlZCwgIgorICAgICAgICAgICAibnVtQ2hubCAlZCIpLAorICAgICAgICBwTWxtQXNzb2NJbmQtPnBvd2VyQ2FwLm1pblR4UG93ZXIsCisgICAgICAgIHBNbG1Bc3NvY0luZC0+cG93ZXJDYXAubWF4VHhQb3dlciwKKyAgICAgICAgcE1sbUFzc29jSW5kLT5zdXBwb3J0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gICAgICAgICAgICAgICBwZWVySWR4LCB0ZW1wOworICAgIHRBTklfVTMyICAgICAgICAgICAgICAgIHZhbDsKKyAgICB0QU5JX1MzMiAgICAgICAgICAgICAgICBmcmFtZWxlbjsKKyAgICB0U2lyUmV0U3RhdHVzICAgICAgICAgICBzdGF0dXM7CisgICAgdHBTaXJNYWNNZ210SGRyICAgICAgICAgcEhkcjsKKyAgICBzdHJ1Y3QgdExpbVByZUF1dGhOb2RlICAqcFN0YVByZUF1dGhDb250ZXh0OworICAgIHRBbmlBdXRoVHlwZSAgICAgICAgICAgIGF1dGhUeXBlOworICAgIHRTaXJNYWNDYXBhYmlsaXR5SW5mbyAgIGxvY2FsQ2FwYWJpbGl0aWVzOworICAgIHRwRHBoSGFzaE5vZGUgICAgICAgICAgIHBTdGFEcyA9IE5VTEw7CisgICAgdHBTaXJBc3NvY1JlcSAgICAgICAgICAgcEFzc29jUmVxOworICAgIHRMaW1NbG1TdGF0ZXMgICAgICAgICAgIG1sbVByZXZTdGF0ZTsKKyAgICB0RG90MTFmSUVSU04gICAgICAgICAgICBEb3QxMWZJRVJTTjsKKyAgICB0RG90MTFmSUVXUEEgICAgICAgICAgICBEb3QxMWZJRVdQQTsKKyAgICB0QU5JX1UzMiBwaHlNb2RlOworICAgIHRIYWxCaXRWYWwgcW9zTW9kZTsKKyAgICB0SGFsQml0VmFsIHdzbU1vZGUsIHdtZU1vZGU7CisgICAgdEFOSV9VOCAgICAqd3BzSWUgPSBOVUxMOworICAgIHRTaXJNYWNSYXRlU2V0ICBiYXNpY1JhdGVzOworICAgIHRBTklfVTggaSA9IDAsIGogPSAwOworICAgIHRBTklfQk9PTEVBTiBwbWZDb25uZWN0aW9uID0gZUFOSV9CT09MRUFOX0ZBTFNFOworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMVcKKyAgICB0UG1mU2FRdWVyeVRpbWVySWQgdGltZXJJZDsKKyAgICB0QU5JX1UzMiByZXRyeUludGVydmFsOworI2VuZGlmCisKKyAgIC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50cnktPnBlU2Vzc2lvbklkLAorICAgICAgICAgICAgICBzdWJUeXBlLCBwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlLCBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOworICAgICAgICBzaXJEdW1wQnVmKHBNYWMsIFNJUl9MSU1fTU9EVUxFX0lELCBMT0czLAorICAgICAgICBXREFfR0VUX1JYX01QRFVfREFUQShwUnhQYWNrZXRJbmZvKSwgZnJhbWVsZW4pOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgLyoKKyAgICAgKiBJZiBhIFNUQSBpcyBhbHJlYWR5IHByZXNlbnQgaW4gRFBIIGFuZCBpdAorICAgICAqIGlzIGluaXRpYXRpbmcgYSBBc3NvYyByZS10cmFuc21pdCwgZG8gbm90CisgICAgICogcHJvY2VzcyBpdC4gVGhpcyBjYW4gaGFwcGVuIHdoZW4gZmlyc3QgQXNzb2MgUmVxIGZyYW1lCisgICAgICogaXMgcmVjZWl2ZWQgYnV0IEFDSyBsb3N0IGF0IFNUQSBzaWRlLiBUaGUgQUNLIGZvciB0aGlzCisgICAgICogZHJvcHBlZCBBc3NvYyBSZXEgZnJhbWUgc2hvdWxkIGJlIHNlbnQgYnkgSFcuIEhvc3Qgc2ltcGx5CisgICAgICogZG9lcyBub3QgcHJvY2VzcyBpdCBvbmNlIHRoZSBlbnRyeSBmb3IgdGhlIFNUQSBpcyBhbHJlYWR5CisgICAgICogcHJlc2VudCBpbiBEUEguCisgICAgICovCisgICAgcFN0YURzID0gZHBoTG9va3VwSGFzaEVudHJ5KHBNYWMsIHBIZHItPnNhLCAmcGVlcklkeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUpOworICAgIGlmIChOVUxMICE9IHBTdGFEcykKKyAgICB7CisgICAgICAgIGlmIChwSGRyLT5mYy5yZXRyeSA+IDApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIElnbm9yZSB0aGUgUmV0cnkgKi8KKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICBGTCgiU1RBIGlzIGluaXRpYXRpbmcgQXNzb2MgUmVxIGFmdGVyIEFDSyBsb3N0LiAiCisgICAgICAgICAgICAgICAgICAgICAgICAiU28sIGRvIG5vdCBQcm9jZXNzIHNlc3Npb25pZDogJWQgc3lzIHN1YlR5cGU9JWQgIgorICAgICAgICAgICAgICAgICAgICAgICAgImZvciByb2xlPSVkIGZyb206ICJNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwgc3ViVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSwKKyAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisgICAgICAgICAgICAvKiBEbyBub3Qgc2VuZCBBc3NvYyByc3AgZm9yIGR1cGxpY2F0ZSBhc3NvYyByZXEgaW4gY2FzZSBvZiBQTUYKKyAgICAgICAgICAgICAqIGVuYWJsZWQgU1RBLCBhcyBkcml2ZXIgbmVlZHMgdG8gc3RhcnQgU0EgUXVlcnJ5IGluIHRoaXMgY2FzZQorICAgICAgICAgICAgICovCisgICAgICAgICAgICBpZiAoIXBTdGFEcy0+cm1mRW5hYmxlZCkKKyNlbmRpZgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLyogU1RBIG1pZ2h0IGhhdmUgbWlzc2VkIHRoZSBhc3NvYyByZXNwb25zZSwKKyAgICAgICAgICAgICAgICAqIHNvIGl0IGlzIHNlbmRpbmcgYXNzb2MgcmVxdWVzdCBmcmFtZSBhZ2Fpbi4KKyAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGxpbVNlbmRBc3NvY1JzcE1nbXRGcmFtZSggcE1hYywgZVNJUl9TVUNDRVNTLAorICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPmFzc29jSWQsIHBTdGFEcy0+c3RhQWRkciwKKyAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5tbG1TdGFDb250ZXh0LnN1YlR5cGUsIHBTdGFEcywKKyAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgIEZMKCJEVVQgYWxyZWFkeSByZWNlaXZlZCBhbiBhc3NvYyByZXF1ZXN0IGZyYW1lICIKKyAgICAgICAgICAgICAgICAgICAgICAgICJhbmQgU1RBIGlzIHNlbmRpbmcgYW5vdGhlciBhc3NvYyByZXEuU28sIGRvIG5vdCAiCisgICAgICAgICAgICAgICAgICAgICAgICAiUHJvY2VzcyBzZXNzaW9uaWQ6ICVkIHN5cyBzdWJUeXBlPSVkIGZvciByb2xlPSVkICIKKyAgICAgICAgICAgICAgICAgICAgICAgICJmcm9tOiAiTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsIHN1YlR5cGUsCisgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUsCisgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLy8gR2V0IHBvaW50ZXIgdG8gUmUvQXNzb2NpYXRpb24gUmVxdWVzdCBmcmFtZSBib2R5CisgICAgcEJvZHkgPSBXREFfR0VUX1JYX01QRFVfREFUQShwUnhQYWNrZXRJbmZvKTsKKworICAgIGlmIChsaW1Jc0dyb3VwQWRkcihwSGRyLT5zYSkpCisgICAgeworICAgICAgICAvLyBSZWNlaXZlZCBSZS9Bc3NvYyBSZXEgZnJhbWUgZnJvbSBhIEJDL01DIGFkZHJlc3MKKyAgICAgICAgLy8gTG9nIGVycm9yIGFuZCBpZ25vcmUgaXQKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJSZWNlaXZlZCAlcyBSZXEgb24gc2Vzc2lvbmlkOiAlZCBmcmFtZSBmcm9tIGEgIgorICAgICAgICAiQkMvTUMgYWRkcmVzcyJNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAoTElNX0FTU09DID09IHN1YlR5cGUpID8gIkFzc29jIiA6ICJSZUFzc29jIiwKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgIE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBzaXJEdW1wQnVmKHBNYWMsIFNJUl9MSU1fTU9EVUxFX0lELCBMT0cyLCAodEFOSV9VOCAqKSBwQm9keSwgZnJhbWVsZW4pOworCisgICAgaWYgKHZvc19tZW1fY29tcGFyZSgodEFOSV9VOCogKSBwSGRyLT5zYSwgKHRBTklfVTggKikgcEhkci0+ZGEsCisgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCkgKHNpemVvZih0U2lyTWFjQWRkcikpKSkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiUmVqZWN0ZWQgQXNzb2MgUmVxIGZyYW1lIFNpbmNlIHNhbWUgbWFjIGFzIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBTQVAvR08iKSk7CisgICAgICAgIGxpbVNlbmRBc3NvY1JzcE1nbXRGcmFtZShwTWFjLAorICAgICAgICAgICAgICAgICAgICBlU0lSX01BQ19VTlNQRUNfRkFJTFVSRV9TVEFUVVMsCisgICAgICAgICAgICAgICAgICAgIDEsCisgICAgICAgICAgICAgICAgICAgIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICBzdWJUeXBlLCAwLHBzZXNzaW9uRW50cnkpOworICAgICAgICByZXR1cm4gOworICAgIH0KKworICAgIC8vIElmIFRLSVAgY291bnRlciBtZWFzdXJlcyBhY3RpdmUgc2VuZCBBc3NvYyBSc3AgZnJhbWUgdG8gc3RhdGlvbiB3aXRoIGVTSVJfTUFDX01JQ19GQUlMVVJFX1JFQVNPTgorICAgIGlmICgocHNlc3Npb25FbnRyeS0+YlRraXBDbnRyTWVhc0FjdGl2ZSkgJiYgKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFKSkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiVEtJUCBjb3VudGVyIG1lYXN1cmUgaXMgYWN0aXZlIikpOworICAgICAgICBsaW1TZW5kQXNzb2NSc3BNZ210RnJhbWUocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfTUFDX01JQ19GQUlMVVJFX1JFQVNPTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRyLT5zYSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1YlR5cGUsIDAsIHBzZXNzaW9uRW50cnkpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgLy8gQWxsb2NhdGUgbWVtb3J5IGZvciB0aGUgQXNzb2MgUmVxdWVzdCBmcmFtZQorICAgIHBBc3NvY1JlcSA9IHZvc19tZW1fbWFsbG9jKHNpemVvZigqcEFzc29jUmVxKSk7CisgICAgaWYgKE5VTEwgPT0gcEFzc29jUmVxKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJBbGxvY2F0ZSBNZW1vcnkgZ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HBNYWMsIExPR0UsIEZMKCJVbmFibGUgdG8gYWxsb2NhdGUgbWVtb3J5IGZvciB0aGUgYXNzb2MgcmVxLCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibGVuZ3RoPSVkIGZyb20gIiksZnJhbWVsZW4pOworICAgICAgICBnb3RvIGVycm9yOworICAgIH0KKyAgICAKKyAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKikgcEFzc29jUmVxLT5hc3NvY1JlcUZyYW1lLAorICAgICAgICAgICAgICAgICAgKHRBTklfVTggKikgcEJvZHksIGZyYW1lbGVuKTsKKyAgICBwQXNzb2NSZXEtPmFzc29jUmVxRnJhbWVMZW5ndGggPSBmcmFtZWxlbjsgICAgCisKKyAgICBpZiAoY2ZnR2V0Q2FwYWJpbGl0eUluZm8ocE1hYywgJnRlbXAscHNlc3Npb25FbnRyeSkgIT0gZVNJUl9TVUNDRVNTKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgQ2FwYWJpbGl0aWVzIikpOworICAgICAgICBnb3RvIGVycm9yOworICAgIH0KKyAgICBsaW1Db3B5VTE2KCh0QU5JX1U4ICopICZsb2NhbENhcGFiaWxpdGllcywgdGVtcCk7CisKKyAgICBpZiAobGltQ29tcGFyZUNhcGFiaWxpdGllcyhwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBc3NvY1JlcSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbG9jYWxDYXBhYmlsaXRpZXMscHNlc3Npb25FbnRyeSkgPT0gZmFsc2UpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoImxvY2FsIGNhcHMgbWlzbWF0Y2ggcmVjZWl2ZWQgY2FwcyIpKTsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJSZWNlaXZlZCAlcyBSZXEgd2l0aCB1bnN1cHBvcnRlZCAiCisgICAgICAgICJjYXBhYmlsaXRpZXMgZnJvbSJNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAoTElNX0FTU09DID09IHN1YlR5cGUpID8gIkFzc29jIiA6ICJSZUFzc29jIiwKKyAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTsKKyAgICAgICAgLyoqCisgICAgICAgICAqIENhcGFiaWxpdGllcyBvZiByZXF1ZXN0aW5nIFNUQSBkb2VzIG5vdCBtYXRjaCB3aXRoCisgICAgICAgICAqIGxvY2FsIGNhcGFiaWxpdGllcy4gUmVzcG9uZCB3aXRoICd1bnN1cHBvcnRlZCBjYXBhYmlsaXRpZXMnCisgICAgICAgICAqIHN0YXR1cyBjb2RlLgorICAgICAgICAgKi8KKyAgICAgICAgbGltU2VuZEFzc29jUnNwTWdtdEZyYW1lKAorICAgICAgICAgICAgICAgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfTUFDX0NBUEFCSUxJVElFU19OT1RfU1VQUE9SVEVEX1NUQVRVUywKKyAgICAgICAgICAgICAgICAgICAgICAgIDEsCisgICAgICAgICAgICAgICAgICAgICAgICBwSGRyLT5zYSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHN1YlR5cGUsIDAscHNlc3Npb25FbnRyeSk7CisKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICB9CisKKyAgICB1cGRhdGVDb250ZXh0ID0gZmFsc2U7CisKKyAgICBpZiAobGltQ21wU1NpZChwTWFjLCAmcEFzc29jUmVxLT5zc0lkLCBwc2Vzc2lvbkVudHJ5KSA9PSBmYWxzZSkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiUmVjZWl2ZWQgJXMgUmVxIHdpdGggdW5tYXRjaGVkIHNzaWQgKCBSZWNlaXZlZCIKKyAgICAgICAgIiBTU0lEOiAlLipzIGN1cnJlbnQgU1NJRDogJS4qcyApIGZyb20gIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgIChMSU1fQVNTT0MgPT0gc3ViVHlwZSkgPyAiQXNzb2MiIDogIlJlQXNzb2MiLCBwQXNzb2NSZXEtPnNzSWQubGVuZ3RoLAorICAgICAgICBwQXNzb2NSZXEtPnNzSWQuc3NJZCwgcHNlc3Npb25FbnRyeS0+c3NJZC5sZW5ndGgsCisgICAgICAgIHBzZXNzaW9uRW50cnktPnNzSWQuc3NJZCwgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogUmVjZWl2ZWQgUmUvQXNzb2NpYXRpb24gUmVxdWVzdCB3aXRoIGVpdGhlcgorICAgICAgICAgKiBCcm9hZGNhc3QgU1NJRCBPUiB3aXRoIFNTSUQgdGhhdCBkb2VzIG5vdAorICAgICAgICAgKiBtYXRjaCB3aXRoIGxvY2FsIG9uZS4KKyAgICAgICAgICogUmVzcG9uZCB3aXRoIHVuc3BlY2lmaWVkIHN0YXR1cyBjb2RlLgorICAgICAgICAgKi8KKyAgICAgICAgbGltU2VuZEFzc29jUnNwTWdtdEZyYW1lKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfTUFDX1VOU1BFQ19GQUlMVVJFX1NUQVRVUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1YlR5cGUsIDAscHNlc3Npb25FbnRyeSk7CisKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICB9CisKKyAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAqKiBWZXJpZnkgaWYgdGhlIHJlcXVlc3RlZCByYXRlcyBhcmUgYXZhaWxhYmxlIGluIHN1cHBvcnRlZCByYXRlCisgICAgICAqKiBzZXQgb3IgRXh0ZW5kZWQgcmF0ZSBzZX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ICAgICBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOworICAgICAgICAvKioKKyAgICAgICAgICogUmVxdWVzdGluZyBTVEEgZG9lcyBub3Qgc3VwcG9ydCBBTEwgQlNTIGJhc2ljCisgICAgICAgICAqIHJhdGVzLiBSZXNwb25kIHdpdGggJ2Jhc2ljIHJhdGVzIG5vdCBzdXBwb3J0ZWQnCisgICAgICAgICAqIHN0YXR1cyBjb2RlLgorICAgICAgICAgKi8KKyAgICAgICAgbGltU2VuZEFzc29jUnNwTWdtdEZyYW1lKAorICAgICAgICAgICAgICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICBlU0lSX01BQ19CQVNJQ19SQVRFU19OT1RfU1VQUE9SVEVEX1NUQVRVUywKKyAgICAgICAgICAgICAgICAgICAgMSwKKyAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EsCisgICAgICAgICAgICAgICAgICAgIHN1YlR5cGUsIDAscHNlc3Npb25FbnRyeSk7CisKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICB9CisKKworICAgIGlmKChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQVBfUk9MRSApICYmCisgICAgICAgKHBzZXNzaW9uRW50cnktPmRvdDExbW9kZSA9PSBXTklfQ0ZHX0RPVDExX01PREVfMTFHX09OTFkpICYmCisgICAgICAgKCghcEFzc29jUmVxLT5leHRlbmRlZFJhdGVzUHJlc2VudCApIHx8IChwQXNzb2NSZXEtPkhUQ2Fwcy5wcmVzZW50KSkpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlNPRlRBUCB3YXMgaW4gMTFHIG9ubHkgbW9kZSwgcmVqZWN0aW5nIGxlZ2FjeSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiU1RBIDogIk1BQ19BRERSRVNTX1NUUiksTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTsKKyAgICAgICAgbGltU2VuZEFzc29jUnNwTW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ydW1NZ3QpCisgICAgeworICAgICAgICB0U2lyUmV0U3RhdHVzIHN0YXR1cyA9IGVTSVJfU1VDQ0VTUzsKKworICAgICAgICAvKiBJZiBzdGF0aW9uIGlzIDExaCBjYXBhYmxlLCB0aGVuIGl0IFNIT1VMRCBzZW5kIGFsbCBtYW5kYXRvcnkgCisgICAgICAgICAqIElFcyBpbiBhc3NvYyByZXF1ZXN0IGZyYW1lLiBMZXQgdXMgdmVyaWZ5IHRoYXQKKyAgICAgICAgICovCisgICAgICAgIGlmIChwQXNzb2NSZXEtPmNhcGFiaWxpdHlJbmZvLnNwZWN0cnVtTWd0KQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoISgocEFzc29jUmVxLT5wb3dlckNhcGFiaWxpdHlQcmVzZW50KSAmJiAocEFzc29jUmVxLT5zdXBwb3J0ZWRDaGFubmVsc1ByZXNlbnQpKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBPbmUgb3IgbW9yZSByZXF1aXJlZCBpbmZvcm1hdGlvbiBlbGVtZW50cyBhcmUgbWlzc2luZywgbG9nIHRoZSBwZWVycyBlcnJvciAqLworICAgICAgICAgICAgICAgIGlmICghcEFzc29jUmVxLT5wb3dlckNhcGFiaWxpdHlQcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJMSU0gSW5mbzogTWlzc2luZyBQb3dlciBjYXBhYmlsaXR5ICIKKyAgICAgICAgICAgICAgICAgICAgIklFIGluICVzIFJlcSBmcm9tICJNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgICAoTElNX0FTU09DID09IHN1YlR5cGUpID8gIkFzc29jIiA6ICJSZUFzc29jIiwKKyAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCFwQXNzb2NSZXEtPnN1cHBvcnRlZENoYW5uZWxzUHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiTElNIEluZm86IE1pc3NpbmcgU3VwcG9ydGVkIGNoYW5uZWwgIgorICAgICAgICAgICAgICAgICAgICAiSUUgaW4gJXMgUmVxIGZyb20gIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgIChMSU1fQVNTT0MgPT0gc3ViVHlwZSkgPyAiQXNzb2MiIDogIlJlQXNzb2MiLAorICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOworCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEFzc29jIHJlcXVlc3QgaGFzIG1hbmRhdG9yeSBmaWVsZHMgKi8KKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBsaW1Jc0RvdDExaFBvd2VyQ2FwYWJpbGl0aWVzSW5SYW5nZShwTWFjLCBwQXNzb2NSZXEsIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgIGlmIChlU0lSX1NVQ0NFU1MgIT0gc3RhdHVzKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1csIEZMKCJMSU0gSW5mbzogTWluVHhQb3dlcihTVEEpID4gIgorICAgICAgICAgICAgICAgICAgICAiTWF4VHhQb3dlcihBUCkgaW4gJXMgUmVxIGZyb20gIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgIChMSU1fQVNTT0MgPT0gc3ViVHlwZSkgPyAiQXNzb2MiIDogIlJlQXNzb2MiLAorICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOworCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHN0YXR1cyA9IGxpbUlzRG90MTFoU3VwcG9ydGVkQ2hhbm5lbHNWYWxpZChwTWFjLCBwQXNzb2NSZXEpOworICAgICAgICAgICAgICAgIGlmIChlU0lSX1NVQ0NFU1MgIT0gc3RhdHVzKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1csIEZMKCJMSU0gSW5mbzogd3Jvbmcgc3VwcG9ydGVkICIKKyAgICAgICAgICAgICAgICAgICAgImNoYW5uZWxzIChTVEEpIGluICVzIFJlcSBmcm9tICJNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgICAoTElNX0FTU09DID09IHN1YlR5cGUpID8gIkFzc29jIiA6ICJSZUFzc29jIiwKKyAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTsKKworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvKiBJRXMgYXJlIHZhbGlkLCB1c2UgdGhlbSBpZiBuZWVkZWQgKi8KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSAvL2lmKGFzc29jLmNhcGFiaWxpdHlJbmZvLnNwZWN0cnVtTWd0KQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIEFzIHBlciB0aGUgY2FwYWJpaXRpZXMsIHRoZSBzcGVjdHJ1bSBtYW5hZ2VtZW50IGlzIG5vdCBlbmFibGVkIG9uIHRoZSBzdGF0aW9uCisgICAgICAgICAgICAgKiBUaGUgQVAgbWF5IGFsbG93IHRoZSBhc3NvY2lhdGlvbnMgdG8gaGFwcGVuIGV2ZW4gaWYgc3BlY3RydW0gbWFuYWdlbWVudCBpcyBub3QKKyAgICAgICAgICAgICAqIGFsbG93ZWQsIGlmIHRoZSB0cmFuc21pdCBwb3dlciBvZiBzdGF0aW9uIGlzIGJlbG93IHRoZSByZWd1bGF0b3J5IG1heGltdW0KKyAgICAgICAgICAgICAqLworCisgICAg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AgICAgICAgIGVTSVJfTUFDX09VVFNJREVfU0NPUEVfT0ZfU1BFQ19TVEFUVVMsCisgICAgICAgICAgICAgICAgICAgIDEsCisgICAgICAgICAgICAgICAgICAgIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICBzdWJUeXBlLCAwLHBzZXNzaW9uRW50cnkpOworCisgICAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorCisgICAgLy9pZiAocE1hYy0+ZHBoLmdEcGhQaHlNb2RlID09IFdOSV9DRkdfUEhZX01PREVfMTFHKQorICAgIGlmIChwaHlNb2RlID09IFdOSV9DRkdfUEhZX01PREVfMTFHKQorICAgIHsKKworICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR18xMUdfT05MWV9QT0xJQ1ksICZ2YWwpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgMTFnLW9ubHkgZmxhZyIpKTsKKyAgICAgICAgICAgIGdvdG8gZXJyb3I7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIXBBc3NvY1JlcS0+ZXh0ZW5kZWRSYXRlc1ByZXNlbnQgJiYgdmFsKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlJlamVjdGluZyBSZS9Bc3NvYyByZXEgZnJvbSAxMWIgU1RBOiAiCisgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIpLE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSk7CisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFJlY2VpdmVkIFJlL0Fzc29jaWF0aW9uIFJlcXVlc3QgZnJvbQorICAgICAgICAgICAgICogMTFiIFNUQSB3aGVuIDExZyBvbmx5IHBvbGljeSBvcHRpb24KKyAgICAgICAgICAgICAqIGlzIHNldC4KKyAgICAgICAgICAgICAqIFJlamVjdCB3aXRoIHVuc3BlY2lmaWVkIHN0YXR1cyBjb2RlLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBsaW1TZW5kQXNzb2NSc3BNZ210RnJhbWUoCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9NQUNfQkFTSUNfUkFURVNfTk9UX1NVUFBPUlRFRF9TVEFUVVMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJUeXBlLCAwLHBzZXNzaW9uRW50cnkpOworCisgICAgICAgICAgICAKKyNpZmRlZiBXTEFOX0RFQlVHICAgIAorICAgICAgICAgICAgcE1hYy0+bGltLmdMaW0xMWJTdGFBc3NvY1JlamVjdENvdW50Kys7CisjZW5kaWYKKyAgICAgICAgICAgIGdvdG8gZXJyb3I7CisgICAgICAgIH0KKyAgICB9CisKKyNpZmRlZiBXTU1fQVBTRAorICAgIC8vIFNhdmUgdGhlIFFPUyBpbmZvIGVsZW1lbnQgaW4gYXNzb2MgcmVxdWVzdC4uCisgICAgbGltR2V0V21lTW9kZShwTWFjLCAmd21lTW9kZSk7CisgICAgaWYgKHdtZU1vZGUgPT0gZUhBTF9TRVQpCisgICAgeworICAgICAgICB0cFFvc0luZm9TdGEgcUluZm87CisKKyAgICAgICAgcUluZm8gPSAodHBRb3NJbmZvU3RhKSAocEFzc29jUmVxLT5xb3NDYXBhYmlsaXR5LnFvc0luZm8pOworCisgICAgICAgIGlmICgocE1hYy0+bGltLmdXbW1BcHNkLmFwc2RFbmFibGUgPT0gMCkgJiYgKHFJbmZvLT5hY19iZSB8fCBxSW5mby0+YWNfYmsgfHwgcUluZm8tPmFjX3ZvIHx8IHFJbmZvLT5hY192aSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICAgICAgICAgIEZMKCJSZWplY3RpbmcgUmUvQXNzb2MgcmVxIGZyb20gU1RBOiAiTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJBUFNEIG5vdCBlbmFibGVkLCBxb3NJbmZvIC0gMHgleCIpLCAqcUluZm8pOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFJlY2VpdmVkIFJlL0Fzc29jaWF0aW9uIFJlcXVlc3QgZnJvbQorICAgICAgICAgICAgICogMTFiIFNUQSB3aGVuIDExZyBvbmx5IHBvbGljeSBvcHRpb24KKyAgICAgICAgICAgICAqIGlzIHNldC4KKyAgICAgICAgICAgICAqIFJlamVjdCB3aXRoIHVuc3BlY2lmaWVkIHN0YXR1cyBjb2RlLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBsaW1TZW5kQXNzb2NSc3BNZ210RnJhbWUoCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9NQUNfV01FX1JFRlVTRURfU1RBVFVTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ViVHlwZSwgMCxwc2Vzc2lvbkVudHJ5KTsKKworICAgICAgICAgICAgZ290byBlcnJvcjsKKyAgICAgICAgfQorICAgIH0KKyNlbmRpZgorCisgICAgLy8gQ2hlY2sgZm9yIDgwMi4xMW4gSFQgY2FwcyBjb21wYXRpYmlsaXR5OyBhcmUgSFQgQ2FwYWJpbGl0aWVzCisgICAgLy8gdHVybmVkIG9uIGluIGxpbT8KKyAgICBpZiAoIHBzZXNzaW9uRW50cnktPmh0Q2FwYWJpbGl0eSApCisgICAgeworICAgICAgICAvLyBUaGVyZSBhcmU7IGFyZSB0aGV5IHR1cm5lZCBvbiBpbiB0aGUgU1RBPworICAgICAgICBpZiAoIHBBc3NvY1JlcS0+SFRDYXBzLnByZXNlbnQgKQorICAgICAgICB7CisgICAgICAgICAgICAvLyBUaGUgc3RhdGlvbiAqZG9lcyogc3VwcG9ydCA4MDIuMTFuIEhUIGNhcGFiaWxpdHkuLi4KKworICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0cxLCBGTCggIkFkdkNvZGluZ0NhcDolZCBDaGFXaWR0aFNldDolZCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiUG93ZXJTYXZlOiVkIGdyZWVuRmllbGQ6JWQgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInNob3J0R0kyMDolZCBzaG9ydEdJNDA6JWQiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAidHhTVEJDOiVkIHJ4U1RCQzolZCBkZWxheUJBOiVkIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm1heEFNU0RVc2l6ZTolZCBEU1NTL0NDSzolZCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiUFNNUDolZCBzdGJjQ250bDolZCBsc2lnVFhQcm90OiVkIiksCisgICAgICAgICAgICAgICAgICAgIHBBc3NvY1JlcS0+SFRDYXBzLmFkdkNvZGluZ0NhcCwKKyAgICAgICAgICAgICAgICAgICAgcEFzc29jUmVxLT5IVENhcHMuc3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0LAorICAgICAgICAgICAgICAgICAgICBwQXNzb2NSZXEtPkhUQ2Fwcy5taW1vUG93ZXJTYXZlLAorICAgICAgICAgICAgICAgICAgICBwQXNzb2NSZXEtPkhUQ2Fwcy5ncmVlbkZpZWxkLAorICAgICAgICAgICAgICAgICAgICBwQXNzb2NSZXEtPkhUQ2Fwcy5zaG9ydEdJMjBNSHosCisgICAgICAgICAgICAgICAgICAgIHBBc3NvY1JlcS0+SFRDYXBzLnNob3J0R0k0ME1IeiwKKyAgICAgICAgICAgICAgICAgICAgcEFzc29jUmVxLT5IVENhcHMudHhTVEJDLAorICAgICAgICAgICAgICAgICAgICBwQXNzb2NSZXEtPkhUQ2Fwcy5yeFNUQkMsCisgICAgICAgICAgICAgICAgICAgIHBBc3NvY1JlcS0+SFRDYXBzLmRlbGF5ZWRCQSwKKyAgICAgICAgICAgICAgICAgICAgcEFzc29jUmVxLT5IVENhcHMubWF4aW1hbEFNU0RVc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgcEFzc29jUmVxLT5IVENhcHMuZHNzc0Nja01vZGU0ME1IeiwKKyAgICAgICAgICAgICAgICAgICAgcEFzc29jUmVxLT5IVENhcHMucHNtcCwKKyAgICAgICAgICAgICAgICAgICAgcEFzc29jUmVxLT5IVENhcHMuc3RiY0NvbnRyb2xGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgcEFzc29jUmVxLT5IVENhcHMubHNpZ1RYT1BQcm90ZWN0aW9uICk7CisKKyAgICAgICAgICAgICAgICAvLyBNYWtlIHN1cmUgdGhlIFNUQSdzIGNhcHMgYXJlIGNvbXBhdGlibGUgd2l0aCBvdXIgb3duOgorICAgICAgICAgICAgICAgIC8vMTEuMTUuMiBTdXBwb3J0IG9mIERTU1MvQ0NLIGluIDQwIE1IegorICAgICAgICAgICAgICAgIC8vdGhlIEFQIHNoYWxsIHJlZnVzZSBhc3NvY2lhdGlvbiByZXF1ZXN0cyBmcm9tIGFuIEhUIFNUQSB0aGF0IGhhcyB0aGUgRFNTUy9DQ0sgCisgICAgICAgICAgICAgICAgLy9Nb2RlIGluIDQwIE1IeiBzdWJmaWVsZCBzZXQgdG8gMTsKKworICAgICAgICAgICAgLy9GSVhNRV9CVEFNUF9BUCA6IE5lZWQgdG8gYmUgZW5hYmxlZCAKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICBpZiAoICFwTWFjLT5saW0uZ0hURHNzc0Nja1JhdGU0ME1IelN1cHBvcnQgJiYgcEFzc29jUmVxLT5IVENhcHMuZHNzc0Nja01vZGU0ME1IeiApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RhdHVzQ29kZSA9IGVTSVJfTUFDX0RTU1NfQ0NLX1JBVEVfTk9UX1NVUFBPUlRfU1RBVFVTOworICAgICAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HVywgRkwoICJBUCBEU1NTL0NDSyBpcyBkaXNhYmxlZDsgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJTVEEgcmVqZWN0ZWQuIiApICk7CisgICAgICAgICAgICAgICAgLy8gUmVqZWN0IGFzc29jaWF0aW9uCisgICAgICAgICAgICAgICAgbGltU2VuZEFzc29jUnNwTWdtdEZyYW1lKCBwTWFjLCBzdGF0dXNDb2RlLCAxLCBwSGRyLT5zYSwgc3ViVHlwZSwgMCxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICBnb3RvIGVycm9yOworICAgICAgICAgICAgfQorICAgICAgICAgICAgKi8KKyAgICAgICAgfQorICAgIH0gLy8gRW5kIGlmIG9uIEhUIGNhcHMgdHVybmVkIG9uIGluIGxpbS4KKworICAgIC8qIENsZWFyIHRoZSBidWZmZXJzIHNvIHRoYXQgZnJhbWUgcGFyc2VyIGtub3dzIHRoYXQgdGhlcmUgaXNuJ3QgYSBwcmV2aW91c2x5IGRlY29kZWQgSUUgaW4gdGhlc2UgYnVmZmVycyAqLworICAgIHZvc19tZW1fc2V0KCh0QU5JX1U4KikmRG90MTFmSUVSU04sIHNpemVvZiggRG90MTFmSUVSU04gKSwgMCk7CisgICAgdm9zX21lbV9zZXQoKHRBTklfVTgqKSZEb3QxMWZJRVdQQSwgc2l6ZW9mKCBEb3QxMWZJRVdQQSApLCAwKTsKKworICAgIC8qIGlmIGFkZGl0aW9uYWwgSUUgaXMgcHJlc2VudCwgY2hlY2sgaWYgaXQgaGFzIFdzY0lFICovCisgICAgaWYoIHBBc3NvY1JlcS0+YWRkSUVQcmVzZW50ICYmIHBBc3NvY1JlcS0+YWRkSUUubGVuZ3RoICkKKyAgICAgICAgd3BzSWUgPSBsaW1HZXRXc2NJRVB0cihwTWFjLCBwQXNzb2NSZXEtPmFkZElFLmFkZElFZGF0YSwgcEFzc29jUmVxLT5hZGRJRS5sZW5ndGgpOworICAgIC8qIHdoZW4gd3BzSWUgaXMgcHJlc2VudCwgUlNOL1dQQSBJRSBpcyBpZ25vcmVkICovCisgICAgaWYoIHdwc0llID09IE5VTEwgKQorICAgIHsKKyAgICAgICAgLyoqIGNoZWNrIHdoZXRoZXIgYXMgUlNOIElFIGlzIHByZXNlbnQgKi8KKyAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0FQX1JPTEUgCisgICAgICAgICAgICAmJiBwc2Vzc2lvbkVudHJ5LT5wTGltU3RhcnRCc3NSZXEtPnByaXZhY3kgCisgICAgICAgICAgICAmJiBwc2Vzc2lvbkVudHJ5LT5wTGltU3RhcnRCc3NSZXEtPnJzbklFLmxlbmd0aCkKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgICAgRkwoIlJTTiBlbmFibGVkIGF1dGgsIFJlL0Fzc29jIHJlcSBmcm9tIFNUQTogIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSk7CisgICAgICAgICAgICBpZihwQXNzb2NSZXEtPnJzblByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYocEFzc29jUmVxLT5yc24ubGVuZ3RoKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gVW5wYWNrIHRoZSBSU04gSUUgCisgICAgICAgICAgICAgICAgICAgIGRvdDExZlVucGFja0llUlNOKHBNYWMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwQXNzb2NSZXEtPnJzbi5pbmZvWzBdLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQXNzb2NSZXEtPnJzbi5sZW5ndGgsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZEb3QxMWZJRVJTTik7CisKKyAgICAgICAgICAgICAgICAgICAgLyogQ2hlY2sgUlNOIHZlcnNpb24gaXMgc3VwcG9ydGVkIG9yIG5vdCAqLworICAgICAgICAgICAgICAgICAgICBpZihTSVJfTUFDX09VSV9WRVJTSU9OXzEgPT0gRG90MTFmSUVSU04udmVyc2lvbikKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLyogY2hlY2sgdGhlIGdyb3Vwd2lzZSBhbmQgcGFpcndpc2UgY2lwaGVyIHN1aXRlcyAqLworICAgICAgICAgICAgICAgICAgICAgICAgaWYoZVNJUl9TVUNDRVNTICE9IChzdGF0dXMgPSBsaW1DaGVja1J4UlNOSWVNYXRjaChwTWFjLCBEb3QxMWZJRVJTTiwgcHNlc3Npb25FbnRyeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFzc29jUmVxLT5IVENhcHMucHJlc2VudCwgJnBtZkNvbm5lY3Rpb24pKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlJTTiBNaXNtYXRjaC4gUmVqZWN0aW5nIFJlL0Fzc29jIHJlcSBmcm9tICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlNUQTogIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHNvbWUgSUUgaXMgbm90IHByb3Blcmx5IHNlbnQgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiByZWNlaXZlZCBBc3NvY2lhdGlvbiByZXEgZnJhbWUgd2l0aCBSU04gSUUgYnV0IGxlbmd0aCBpcyAwICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltU2VuZEFzc29jUnNwTWdtdEZyYW1lKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ViVHlwZSwgMCxwc2Vzc2lvbkVudHJ5KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZXJyb3I7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiUlNOIFZlcnNpb24gbWlzbWF0Y2guICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiUmVqZWN0aW5nIFJlL0Fzc29jIHJlcSBmcm9tICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiU1RBOiAiTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOworCisgICAgICAgICAgICAgICAgICAgICAgICAvKiByZWNlaXZlZCBBc3NvY2lhdGlvbiByZXEgZnJhbWUgd2l0aCBSU04gSUUgdmVyc2lvbiB3cm9uZyAqLworICAgICAgICAgICAgICAgICAgICAgICAgbGltU2VuZEFzc29jUnNwTWdtdEZyYW1lKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfTUFDX1VOU1VQUE9SVEVEX1JTTl9JRV9WRVJTSU9OX1NUQVRVUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRyLT5zYSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1YlR5cGUsIDAscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGVycm9yOworCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1csIEZMKCJSU04gbGVuZ3RoIG5vdCBjb3JyZWN0LiAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiUmVqZWN0aW5nIFJlL0Fzc29jIHJlcSBmcm9tIFNUQToiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTsKKyAgICAgICAgICAgICAgICAgICAgLyogcmVjZWl2ZWQgQXNzb2NpYXRpb24gcmVxIGZyYW1lIHdpdGggUlNOIElFIGJ1dCBsZW5ndGggaXMgMCAqLworICAgICAgICAgICAgICAgICAgICBsaW1TZW5kQXNzb2NSc3BNZ210RnJhbWUoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfTUFDX0lOVkFMSURfSU5GT1JNQVRJT05fRUxFTUVOVF9TVEFUVVMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJUeXBlLCAwLHBzZXNzaW9uRW50cnkpOworCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZXJyb3I7CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gLyogZW5kIC0gaWYocEFzc29jUmVxLT5yc25QcmVzZW50KSAqLworICAgICAgICAgICAgaWYoKCFwQXNzb2NSZXEtPnJzblByZXNlbnQpICYmIHBBc3NvY1JlcS0+d3BhUHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBVbnBhY2sgdGhlIFdQQSBJRSAKKyAgICAgICAgICAgICAgICBpZihwQXNzb2NSZXEtPndwYS5sZW5ndGgpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBkb3QxMWZVbnBhY2tJZVdQQShwTWFjLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEFzc29jUmVxLT53cGEuaW5mb1s0XSwgLy9PVUkgaXMgbm90IHRha2VuIGNhcmUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQXNzb2NSZXEtPndwYS5sZW5ndGgsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZEb3QxMWZJRVdQQSk7CisgICAgICAgICAgICAgICAgICAgIC8qIGNoZWNrIHRoZSBncm91cHdpc2UgYW5kIHBhaXJ3aXNlIGNpcGhlciBzdWl0ZXMgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYoZVNJUl9TVUNDRVNTICE9IChzdGF0dXMgPSBsaW1DaGVja1J4V1BBSWVNYXRjaChwTWFjLCBEb3QxMWZJRVdQQSwgcHNlc3Npb25FbnRyeSwgcEFzc29jUmVxLT5IVENhcHMucHJlc2VudCkpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgRkwoIldQQSBJRSBtaXNtYXRjaC4gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJSZWplY3RpbmcgUmUvQXNzb2MgcmVxIGZyb20gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJTVEE6ICJNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOworICAgICAgICAgICAgICAgICAgICAgICAgLyogcmVjZWl2ZWQgQXNzb2NpYXRpb24gcmVxIGZyYW1lIHdpdGggV1BBIElFIGJ1dCBtaXNtYXRjaCAqLworICAgICAgICAgICAgICAgICAgICAgICAgbGltU2VuZEFzc29jUnNwTWdtdEZyYW1lKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRyLT5zYSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1YlR5cGUsIDAscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGVycm9yOworCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1csIEZMKCJXUEEgbGVuIGluY29ycmVjdC4gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlJlamVjdGluZyBSZS9Bc3NvYyByZXEgZnJvbSBTVEE6ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOworICAgICAgICAgICAgICAgICAgICAvKiByZWNlaXZlZCBBc3NvY2lhdGlvbiByZXEgZnJhbWUgd2l0aCBpbnZhbGlkIFdQQSBJRSAqLworICAgICAgICAgICAgICAgICAgICBsaW1TZW5kQXNzb2NSc3BNZ210RnJhbWUoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfTUFDX0lOVkFMSURfSU5GT1JNQVRJT05fRUxFTUVOVF9TVEFUVVMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJUeXBlLCAwLHBzZXNzaW9uRW50cnkpOworCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZXJyb3I7CisgICAgICAgICAgICAgICAgfS8qIGVuZCAtIGlmKHBBc3NvY1JlcS0+d3BhLmxlbmd0aCkgKi8KKyAgICAgICAgICAgIH0gLyogZW5kIC0gaWYocEFzc29jUmVxLT53cGFQcmVzZW50KSAqLworICAgICAgICB9IC8qIGVuZCBvZiBpZihwc2Vzc2lvbkVudHJ5LT5wTGltU3RhcnRCc3NSZXEtPnByaXZhY3kgCisgICAgICAgICAgICAmJiBwc2Vzc2lvbkVudHJ5LT5wTGltU3RhcnRCc3NSZXEtPnJzbklFLT5sZW5ndGgpICovCisKKyAgICB9IC8qIGVuZCBvZiAgICAgaWYoICEgcEFzc29jUmVxLT53c2NJbmZvLnByZXNlbnQgKSAqLworCisgICAgLyoqCisgICAgICogRXh0cmFjdCAnYXNzb2NpYXRlZCcgY29udGV4dCBmb3IgU1RBLCBpZiBhbnkuCisgICAgICogVGhpcyBpcyBtYWludGFpbmVkIGJ5IERQSCBhbmQgY3JlYXRlZCBieSBMSU0uCisgICAgICovCisgICAgcFN0YURzID0gZHBoTG9va3VwSGFzaEVudHJ5KHBNYWMsIHBIZHItPnNhLCAmcGVlcklkeCwgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUpOworCisgICAgLy8vIEV4dHJhY3QgcHJlLWF1dGggY29udGV4dCBmb3IgdGhlIFNUQSwgaWYgYW55LgorICAgIHBTdGFQcmVBdXRoQ29udGV4dCA9IGxpbVNlYXJjaFByZUF1dGhMaXN0KHBNYWMsIHBIZHItPnNhKTsKKworICAgIGlmIChwU3RhRHMgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIC8vLyBSZXF1ZXN0aW5nIFNUQSBpcyBub3QgY3VycmVudGx5IGFzc29jaWF0ZWQKKyAgICAgICAgaWYgKHBlR2V0Q3VycmVudFNUQXNDb3VudChwTWFjKSA9PSBwTWFjLT5saW0ubWF4U3RhdGlvbikKKyAgICAgICAgeworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBNYXhpbXVtIG51bWJlciBvZiBTVEFzIHRoYXQgQVAgY2FuIGhhbmRsZSByZWFjaGVkLgorICAgICAgICAgICAgICogU2VuZCBBc3NvY2lhdGlvbiByZXNwb25zZSB0byBwZWVyIE1BQyBlbnRpdHkKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJNYXggU3RhIGNvdW50IHJlYWNoZWQgOiAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5tYXhTdGF0aW9uKTsKKyAgICAgICAgICAgIGxpbVJlamVjdEFzc29jaWF0aW9uKHBNYWMsIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ViVHlwZSwgZmFsc2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFuaUF1dGhUeXBlKSAwLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodFNpclJlc3VsdENvZGVzKSBlU0lSX01BQ19VTlNQRUNfRkFJTFVSRV9TVEFUVVMsIHBzZXNzaW9uRW50cnkpOworCisgICAgICAgICAgICBnb3RvIGVycm9yOworICAgICAgICB9CisKKyAgICAgICAgLy8vIENoZWNrIGlmIFNUQSBpcyBwcmUtYXV0aGVudGljYXRlZC4KKyAgICAgICAgaWYgKChwU3RhUHJlQXV0aENvbnRleHQgPT0gTlVMTCkgfHwKKyAgICAgICAgICAgIChwU3RhUHJlQXV0aENvbnRleHQgJiYKKyAgICAgICAgICAgICAocFN0YVByZUF1dGhDb250ZXh0LT5tbG1TdGF0ZSAhPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUxJTV9NTE1fQVVUSEVOVElDQVRFRF9TVEFURSkpKQorICAgICAgICB7CisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFNUQSBpcyBub3QgcHJlLWF1dGhlbnRpY2F0ZWQgeWV0IHJlcXVlc3RpbmcKKyAgICAgICAgICAgICAqIFJlL0Fzc29jaWF0aW9uIGJlZm9yZSBBdXRoZW50aWNhdGlvbi4KKyAgICAgICAgICAgICAqIE9SIFNUQSBpcyBpbiB0aGUgcHJvY2VzcyBvZiBnZXR0aW5nIGF1dGhlbnRpY2F0ZWQKKyAgICAgICAgICAgICAqIGFuZCBzZW50IFJlL0Fzc29jaWF0aW9uIHJlcXVlc3QuCisgICAgICAgICAgICAgKiBTZW5kIERlYXV0aGVudGljYXRpb24gZnJhbWUgd2l0aCAncHJpb3IKKyAgICAgICAgICAgICAqIGF1dGhlbnRpY2F0aW9uIHJlcXVpcmVkJyByZWFzb24gY29kZS4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgbGltU2VuZERlYXV0aE1nbXRGcmFtZSgKKyAgICAgICAgICAgICAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICBlU0lSX01BQ19TVEFfTk9UX1BSRV9BVVRIRU5USUNBVEVEX1JFQVNPTiwgLy89OQorICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EsIHBzZXNzaW9uRW50cnksIEZBTFNFKTsKKworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJyZWNlaXZlZCAlcyByZXEgb24gc2Vzc2lvbmlkOiAlZCBmcm9tIFNUQSAiCisgICAgICAgICAgICAidGhhdCBkb2VzIG5vdCBoYXZlIHByZS1hdXRoIGNvbnRleHQiTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgIChMSU1fQVNTT0MgPT0gc3ViVHlwZSkgPyAiQXNzb2MiIDogIlJlQXNzb2MiLAorICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOworICAgICAgICAgICAgZ290byBlcnJvcjsKKyAgICAgICAgfQorCisgICAgICAgIC8vLyBEZWxldGUgJ3ByZS1hdXRoJyBjb250ZXh0IG9mIFNUQQorICAgICAgICBhdXRoVHlwZSA9IHBTdGFQcmVBdXRoQ29udGV4dC0+YXV0aFR5cGU7CisgICAgICAgIGxpbURlbGV0ZVByZUF1dGhOb2RlKHBNYWMsIHBIZHItPnNhKTsKKworICAgICAgICAvLyBBbGwgaXMgd2VsbC4gQXNzaWduIEFJRCAoYWZ0ZXIgZWxzZSBwYXJ0KQorCisgICAgfSAvLyBpZiAocFN0YURzID09IE5VTEwpCisgICAgZWxzZQorICAgIHsKKyAgICAgICAgLy8gU1RBIGNvbnRleHQgZG9lcyBleGlzdCBmb3IgdGhpcyBTVEEKKworICAgICAgICBpZiAocFN0YURzLT5tbG1TdGFDb250ZXh0Lm1sbVN0YXRlICE9IGVMSU1fTUxNX0xJTktfRVNUQUJMSVNIRURfU1RBVEUpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogUmVxdWVzdGluZyBTVEEgaXMgaW4gc29tZSAndHJhbnNpZW50JyBzdGF0ZT8KKyAgICAgICAgICAgICAqIElnbm9yZSB0aGUgUmUvQXNzb2MgUmVxIGZyYW1lIGJ5IGluY3JlbWVudGluZworICAgICAgICAgICAgICogZGVidWcgY291bnRlciAmIGxvZ2dpbmcgZXJyb3IuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmIChzdWJUeXBlID09IExJTV9BU1NPQykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgIAorI2lmZGVmIFdMQU5fREVCVUcgICAgCisgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1OdW1Bc3NvY1JlcURyb3BJbnZsZFN0YXRlKys7CisjZW5kaWYKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoInJlY2VpdmVkIEFzc29jIHJlcSBpbiBzdGF0ZSAiCisgICAgICAgICAgICAgICAgICAgIiVkIGZyb20gIiksIHBTdGFEcy0+bWxtU3RhQ29udGV4dC5tbG1TdGF0ZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7ICAgICAKKyNpZmRlZiBXTEFOX0RFQlVHICAgIAorICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTG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5hYmxlZCkKKyAgICAgICAgeworICAgICAgICAgICAgc3dpdGNoIChwU3RhRHMtPnBtZlNhUXVlcnlTdGF0ZSkKKyAgICAgICAgICAgIHsKKworICAgICAgICAgICAgLy8gc3RhcnQgU0EgUXVlcnkgcHJvY2VkdXJlLCByZXNwb25kIHRvIEFzc29jaWF0aW9uIFJlcXVlc3QKKyAgICAgICAgICAgIC8vIHdpdGggdHJ5IGFnYWluIGxhdGVyCisgICAgICAgICAgICBjYXNlIERQSF9TQV9RVUVSWV9OT1RfSU5fUFJPR1JFU1M6CisgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgKiBXZSBzaG91bGQgcmVzZXQgdGhlIHJldHJ5IGNvdW50ZXIgYmVmb3JlIHdlIHN0YXJ0CisgICAgICAgICAgICAgICAgICogdGhlIFNBIHF1ZXJ5IHByb2NlZHVyZSwgb3RoZXJ3aXNlIGluIG5leHQgc2V0IG9mIFNBIHF1ZXJ5CisgICAgICAgICAgICAgICAgICogcHJvY2VkdXJlIHdlIHdpbGwgZW5kIHVwIHVzaW5nIHRoZSBzdGFsZSB2YWx1ZS4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBwU3RhRHMtPnBtZlNhUXVlcnlSZXRyeUNvdW50ID0gMDsKKyAgICAgICAgICAgICAgICBsaW1TZW5kQXNzb2NSc3BNZ210RnJhbWUocE1hYywgZVNJUl9NQUNfVFJZX0FHQUlOX0xBVEVSLCAxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRyLT5zYSwgc3ViVHlwZSwgcFN0YURzLCBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICBsaW1TZW5kU2FRdWVyeVJlcXVlc3RGcmFtZSgKKyAgICAgICAgICAgICAgICAgICAgcE1hYywgKHRBTklfVTggKikmKHBTdGFEcy0+cG1mU2FRdWVyeUN1cnJlbnRUcmFuc0lkKSwKKyAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EsIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgIHBTdGFEcy0+cG1mU2FRdWVyeVN0YXJ0VHJhbnNJZCA9IHBTdGFEcy0+cG1mU2FRdWVyeUN1cnJlbnRUcmFuc0lkOworICAgICAgICAgICAgICAgIHBTdGFEcy0+cG1mU2FRdWVyeUN1cnJlbnRUcmFuc0lkKys7CisKKyAgICAgICAgICAgICAgICAvLyBzdGFydCB0aW1lciBmb3IgU0EgUXVlcnkgcmV0cnkKKyAgICAgICAgICAgICAgICBpZiAodHhfdGltZXJfYWN0aXZhdGUoJnBTdGFEcy0+cG1mU2FRdWVyeVRpbWVyKSAhPSBUWF9TVUNDRVNTKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJQTUYgU0EgUXVlcnkgdGltZXIgYWN0aXZhdGlvbiBmYWlsZWQhIikpOworICAgICAgICAgICAgICAgICAgICBnb3RvIGVycm9yOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHBTdGFEcy0+cG1mU2FRdWVyeVN0YXRlID0gRFBIX1NBX1FVRVJZX0lOX1BST0dSRVNTOworICAgICAgICAgICAgICAgIGdvdG8gZXJyb3I7CisKKyAgICAgICAgICAgIC8vIFNBIFF1ZXJ5IHByb2NlZHVyZSBzdGlsbCBnb2luZywgcmVzcG9uZCB0byBBc3NvY2lhdGlvbgorICAgICAgICAgICAgLy8gUmVxdWVzdCB3aXRoIHRyeSBhZ2FpbiBsYXRlcgorICAgICAgICAgICAgY2FzZSBEUEhfU0FfUVVFUllfSU5fUFJPR1JFU1M6CisgICAgICAgICAgICAgICAgbGltU2VuZEFzc29jUnNwTWdtdEZyYW1lKHBNYWMsIGVTSVJfTUFDX1RSWV9BR0FJTl9MQVRFUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EsIHN1YlR5cGUsIDAsIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgIGdvdG8gZXJyb3I7CisKKyAgICAgICAgICAgIC8vIFNBIFF1ZXJ5IHByb2NlZHVyZSB0aW1lZCBvdXQsIGFjY2VwdCBBc3NvY2lhdGlvbiBSZXF1ZXN0CisgICAgICAgICAgICAvLyBub3JtYWxseQorICAgICAgICAgICAgIGNhc2UgRFBIX1NBX1FVRVJZX1RJTUVEX09VVDoKKyAgICAgICAgICAgICAgICBwU3RhRHMtPnBtZlNhUXVlcnlTdGF0ZSA9IERQSF9TQV9RVUVSWV9OT1RfSU5fUFJPR1JFU1M7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyNlbmRpZgorCisgICAgICAgIC8qIG5vIGNoYW5nZSBpbiB0aGUgY2FwYWJpbGl0eSBzbyBkcm9wIHRoZSBmcmFtZSAqLworICAgICAgICBpZiAoKFZPU19UUlVFID09IHZvc19tZW1fY29tcGFyZSgmcFN0YURzLT5tbG1TdGFDb250ZXh0LmNhcGFiaWxpdHlJbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBc3NvY1JlcS0+Y2FwYWJpbGl0eUluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0NhcGFiaWxpdHlJbmZvKSkpJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHN1YlR5cGUgPT0gTElNX0FTU09DKSkKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCIgUmVjZWl2ZWQgQXNzb2MgcmVxIGluIHN0YXRlICVkIFNUQWlkPSVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPm1sbVN0YUNvbnRleHQubWxtU3RhdGUscGVlcklkeCk7CisgICAgICAgICAgICBnb3RvIGVycm9yOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgLyoqCisgICAgICAgICAqIFNUQSBzZW50IFJlL2Fzc29jaWF0aW9uIFJlcXVlc3QgZnJhbWUgd2hpbGUgYWxyZWFkeSBpbgorICAgICAgICAgKiAnYXNzb2NpYXRlZCcgc3RhdGUuIFVwZGF0ZSBTVEEgY2FwYWJpbGl0aWVzIGFuZAorICAgICAgICAgKiBzZW5kIEFzc29jaWF0aW9uIHJlc3BvbnNlIGZyYW1lIHdpdGggc2FtZSBBSUQKKyAgICAgICAgICovCisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlJlY2VpdmVkIEFzc29jIHJlcSBmcm9tIFNUQSBhbHJlYWR5IGNvbm5lY3RlZCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIFVwZGF0ZUNvbmV4dCIpKTsKKyAgICAgICAgICAgIHBTdGFEcy0+bWxtU3RhQ29udGV4dC5jYXBhYmlsaXR5SW5mbyA9IHBBc3NvY1JlcS0+Y2FwYWJpbGl0eUluZm87CisgICAgICAgICAgICBpZiAocFN0YVByZUF1dGhDb250ZXh0ICYmCisgICAgICAgICAgICAgICAgKHBTdGFQcmVBdXRoQ29udGV4dC0+bWxtU3RhdGUgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlTElNX01MTV9BVVRIRU5USUNBVEVEX1NUQVRFKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLy8gU1RBIGhhcyB0cmlnZ2VyZWQgcHJlLWF1dGggYWdhaW4KKyAgICAgICAgICAgICAgICBhdXRoVHlwZSA9IHBTdGFQcmVBdXRoQ29udGV4dC0+YXV0aFR5cGU7CisgICAgICAgICAgICAgICAgbGltRGVsZXRlUHJlQXV0aE5vZGUocE1hYywgcEhkci0+c2EpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGF1dGhUeXBlID0gcFN0YURzLT5tbG1TdGFDb250ZXh0LmF1dGhUeXBlOworCisgICAgICAgICAgICB1cGRhdGVDb250ZXh0ID0gdHJ1ZTsKKyAgICAgICAgICAgIGlmIChkcGhJbml0U3RhU3RhdGUocE1hYywgcEhkci0+c2EsIHBlZXJJZHgsIHRydWUsICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IEluaXQgU1RBaWQ9JWQiKSwgcGVlcklkeCk7CisgICAgICAgICAgICAgICAgZ290byAgZXJyb3I7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICBnb3RvIHNlbmRJbmRUb1NtZTsKKyAgICB9IC8vIGVuZCBpZiAobG9va3VwIGZvciBTVEEgaW4gcGVyU3RhRHMgZmFpbHMpCisKKworCisgICAgLy8gY2hlY2sgaWYgc3RhIGlzIGFsbG93ZWQgcGVyIFFvUyBBQyBydWxlcworICAgIC8vaWYgKHBNYWMtPmRwaC5nRHBoUW9zRW5hYmxlZCB8fCBwTWFjLT5kcGguZ0RwaFdtZUVuYWJsZWQpCisgICAgbGltR2V0V21lTW9kZShwc2Vzc2lvbkVudHJ5LCAmd21lTW9kZSk7CisgICAgaWYgKChxb3NNb2RlID09IGVIQUxfU0VUKSB8fCAod21lTW9kZSA9PSBlSEFMX1NFVCkpCisgICAgeworICAgICAgICAvLyBmb3IgYSBxc3RhLCBjaGVjayBpZiB0aGUgcmVxdWVzdGVkIFRyYWZmaWMgc3BlYworICAgICAgICAvLyBpcyBhZG1pc3NpYmxlCisgICAgICAgIC8vIGZvciBhIG5vbi1xc3RhIGNoZWNrIGlmIHRoZSBzdGEgY2FuIGJlIGFkbWl0dGVkCisgICAgICAgIGlmIChwQXNzb2NSZXEtPmFkZHRzUHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgdEFOSV9VOCB0c3BlY0lkeCA9IDA7IC8vaW5kZXggaW4gdGhlIHNjaCB0c3BlYyB0YWJsZS4KKyAgICAgICAgICAgIGlmIChsaW1BZG1pdENvbnRyb2xBZGRUUyhwTWFjLCBwSGRyLT5zYSwgJihwQXNzb2NSZXEtPmFkZHRzUmVxKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKHBBc3NvY1JlcS0+cW9zQ2FwYWJpbGl0eSksIDAsIGZhbHNlLCBOVUxMLCAmdHNwZWNJZHgsIHBzZXNzaW9uRW50cnkpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkFkbWl0Q29udHJvbDogVFNQRUMgcmVqZWN0ZWQiKSk7CisgICAgICAgICAgICAgICAgbGltU2VuZEFzc29jUnNwTWdtdEZyYW1lKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9NQUNfUUFQX05PX0JBTkRXSURUSF9SRUFTT04sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRyLT5zYSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJUeXBlLCAwLHBzZXNzaW9uRW50cnkpOworI2lmZGVmIFdMQU5fREVCVUcgICAgCisgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1OdW1Bc3NvY1JlcURyb3BBQ1JlamVjdFRTKys7CisjZW5kaWYKKyAgICAgICAgICAgICAgICBnb3RvIGVycm9yOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGxpbUFkbWl0Q29udHJvbEFkZFN0YShwTWFjLCBwSGRyLT5zYSwgZmFsc2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJBZG1pdENvbnRyb2w6IFN0YSByZWplY3RlZCIpKTsKKyAgICAgICAgICAgIGxpbVNlbmRBc3NvY1JzcE1nbXRGcmFtZSgKKyAgICAgICAgICAgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgZVNJUl9NQUNfUUFQX05PX0JBTkRXSURUSF9SRUFTT04sCisgICAgICAgICAgICAgICAgICAgIDEsCisgICAgICAgICAgICAgICAgICAgIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICBzdWJUeXBlLCAwLHBzZXNzaW9uRW50cnkpOworI2lmZGVmIFdMQU5fREVCVUcgICAgCisgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbU51bUFzc29jUmVxRHJvcEFDUmVqZWN0U3RhKys7CisjZW5kaWYKKyAgICAgICAgICAgIGdvdG8gZXJyb3I7CisgICAgICAgIH0KKworICAgICAgICAvLyBlbHNlIGFsbCBvaworICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIkFkbWl0Q29udHJvbDogU3RhIE9LISIpKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTVEEgaXMgQXNzb2NpYXRlZCAhCisgICAgICovCisgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJSZWNlaXZlZCAlcyBSZXEgIHN1Y2Nlc3NmdWwgZnJvbSAiTUFDX0FERFJFU1NfU1RSKSwKKyAgICAoTElNX0FTU09DID09IHN1YlR5cGUpID8gIkFzc29jIiA6ICJSZUFzc29jIiwgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTsKKworICAgIC8qKgorICAgICAqIEFJRCBmb3IgdGhpcyBhc3NvY2lhdGlvbiB3aWxsIGJlIHNhbWUgYXMgdGhlIHBlZXIgSW5kZXggdXNlZCBpbiBEUEggdGFibGUuCisgICAgICogQXNzaWduIHVudXNlZC9sZWFzdCByZWNlbnRseSB1c2VkIHBlZXIgSW5kZXggZnJvbSBwZXJTdGFEcy4KKyAgICAgKiBOT1RFOiBsaW1Bc3NpZ25QZWVySWR4KCkgYXNzaWducyBBSUQgdmFsdWVzIHJhbmdpbmcgCisgICAgICogYmV0d2VlbiAxIC0gY2ZnX2l0ZW0oV05JX0NGR19BU1NPQ19TVEFfTElNSVQpCisgICAgICovCisKKyAgICBwZWVySWR4ID0gbGltQXNzaWduUGVlcklkeChwTWFjLCBwc2Vzc2lvbkVudHJ5KTsKKworICAgIGlmICghcGVlcklkeCkKKyAgICB7CisgICAgICAgIC8vIENvdWxkIG5vdCBhc3NpZ24gQUlECisgICAgICAgIC8vIFJlamVjdCBhc3NvY2lhdGlvbgorICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlBlZXJJZHggbm90IGF2YWlhbGJsZS4gUmVqZWN0IGFzc29jaWF0b24iKSk7CisKKyAgICAgICAgbGltUmVqZWN0QXNzb2NpYXRpb24ocE1hYywgcEhkci0+c2EsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1YlR5cGUsIHRydWUsIGF1dGhUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZWVySWR4LCBmYWxzZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRTaXJSZXN1bHRDb2RlcykgZVNJUl9NQUNfVU5TUEVDX0ZBSUxVUkVfU1RBVFVTLCBwc2Vzc2lvbkVudHJ5KTsKKworICAgICAgICBnb3RvIGVycm9yOworICAgIH0KKworICAgIC8qKgorICAgICAqIEFkZCBhbiBlbnRyeSB0byBoYXNoIHRhYmxlIG1haW50YWluZWQgYnkgRFBIIG1vZHVsZQorICAgICAqLworCisgICAgcFN0YURzID0gZHBoQWRkSGFzaEVudHJ5KHBNYWMsIHBIZHItPnNhLCBwZWVySWR4LCAmcHNlc3Npb25FbnRyeS0+ZHBoLmRwaEhhc2hUYWJsZSk7CisKKyAgICBpZiAocFN0YURzID09IE5VTEwpCisgICAgeworICAgICAgICAvLyBDb3VsZCBub3QgYWRkIGhhc2ggdGFibGUgZW50cnkgYXQgRFBICisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICBGTCgiY291bGQgbm90IGFkZCBoYXNoIGVudHJ5IGF0IERQSCBmb3IgYWlkPSVkLCBNYWNBZGRyOiIKKyAgICAgICAgICAgTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgcGVlcklkeCxNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOworCisgICAgICAgIC8vIFJlbGVhc2UgQUlECisgICAgICAgIGxpbVJlbGVhc2VQZWVySWR4KHBNYWMsIHBlZXJJZHgsIHBzZXNzaW9uRW50cnkpOworCisgICAgICAgIGxpbVJlamVjdEFzc29jaWF0aW9uKHBNYWMsIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJUeXBlLCB0cnVlLCBhdXRoVHlwZSwgcGVlcklkeCwgZmFsc2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0U2lyUmVzdWx0Q29kZXMpIGVTSVJfTUFDX1VOU1BFQ19GQUlMVVJFX1NUQVRVUywgcHNlc3Npb25FbnRyeSk7CisKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICB9CisKKworc2VuZEluZFRvU21lOgorCisgICAgcHNlc3Npb25FbnRyeS0+cGFyc2VkQXNzb2NSZXFbcFN0YURzLT5hc3NvY0lkXSA9IHBBc3NvY1JlcTsKKworICAgIHBTdGFEcy0+bWxtU3RhQ29udGV4dC5odENhcGFiaWxpdHkgPSBwQXNzb2NSZXEtPkhUQ2Fwcy5wcmVzZW50OworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisgICAgcFN0YURzLT5tbG1TdGFDb250ZXh0LnZodENhcGFiaWxpdHkgPSBwQXNzb2NSZXEtPlZIVENhcHMucHJlc2V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mFjdG9yID0gcEFzc29jUmVxLT5IVENhcHMubWF4UnhBTVBEVUZhY3RvcjsKKyAgICAgICAgcFN0YURzLT5odE1JTU9QU1N0YXRlID0gcEFzc29jUmVxLT5IVENhcHMubWltb1Bvd2VyU2F2ZTsKKworICAgICAgICAvKiBwQXNzb2NSZXEgd2lsbCBiZSBjb3BpZWQgdG8gcHNlc3Npb25FbnRyeS0+cGFyc2VkQXNzb2NSZXEgbGF0ZXIgKi8KKyAgICAgICAgLyogY2hlY2sgd2hldGhlciBBUCBpcyBlbmFibGVkIHdpdGggc2hvcnRHSSAqLworICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19TSE9SVF9HSV8yME1IWiwgJnZhbCkgIT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfU1VDQ0VTUykgeworICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiY291bGQgbm90IHJldHJpZXZlIHNob3J0R0kgMjBNaHogQ0ZHIikpOworICAgICAgICAgICBnb3RvIGVycm9yOworICAgICAgICB9CisgICAgICAgIGlmICh2YWwpIHsKKyAgICAgICAgICAgIHBTdGFEcy0+aHRTaG9ydEdJMjBNaHogPSAodEFOSV9VOClwQXNzb2NSZXEtPkhUQ2Fwcy5zaG9ydEdJMjBNSHo7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvKiBVbnNldCBodFNob3J0R0kyME1oeiBpbiBodF9jYXBzKi8KKyAgICAgICAgICAgIHBBc3NvY1JlcS0+SFRDYXBzLnNob3J0R0kyME1IeiA9IDA7CisgICAgICAgICAgICBwU3RhRHMtPmh0U2hvcnRHSTIwTWh6ID0gMDsKKyAgICAgICAgfQorCisgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX1NIT1JUX0dJXzQwTUhaLCAmdmFsKSAhPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgZ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0NhcDsKKyAgICB9CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworaWYgKGxpbVBvcHVsYXRlTWF0Y2hpbmdSYXRlU2V0KHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYocEFzc29jUmVxLT5zdXBwb3J0ZWRSYXRlcyksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihwQXNzb2NSZXEtPmV4dGVuZGVkUmF0ZXMpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBc3NvY1JlcS0+SFRDYXBzLnN1cHBvcnRlZE1DU1NldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKHBBc3NvY1JlcS0+cHJvcElFaW5mby5wcm9wUmF0ZXMpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnkgLCAmcEFzc29jUmVxLT5WSFRDYXBzKSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBlU0lSX1NVQ0NFU1MpCisjZWxzZQorCisgICAgaWYgKGxpbVBvcHVsYXRlTWF0Y2hpbmdSYXRlU2V0KHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihwQXNzb2NSZXEtPnN1cHBvcnRlZFJhdGVzKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihwQXNzb2NSZXEtPmV4dGVuZGVkUmF0ZXMpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQXNzb2NSZXEtPkhUQ2Fwcy5zdXBwb3J0ZWRNQ1NTZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYocEFzc29jUmVxLT5wcm9wSUVpbmZvLnByb3BSYXRlcyksIHBzZXNzaW9uRW50cnkpICE9IGVTSVJfU1VDQ0VTUykKKyNlbmRpZgorICAgIHsKKyAgICAgICAgLy8gQ291bGQgbm90IHVwZGF0ZSBoYXNoIHRhYmxlIGVudHJ5IGF0IERQSCB3aXRoIHJhdGVzZXQKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgIEZMKCJjb3VsZCBub3QgdXBkYXRlIGhhc2ggZW50cnkgYXQgRFBIIGZvciBhaWQ9JWQsIE1hY0FkZHI6ICIKKyAgICAgICAgICAgTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgcGVlcklkeCwgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTsKKworICAgICAgICAgICAgICAgIC8vIFJlbGVhc2UgQUlECisgICAgICAgIGxpbVJlbGVhc2VQZWVySWR4KHBNYWMsIHBlZXJJZHgsIHBzZXNzaW9uRW50cnkpOworCisKKyAgICAgICAgbGltUmVqZWN0QXNzb2NpYXRpb24ocE1hYywgcEhkci0+c2EsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1YlR5cGUsIHRydWUsIGF1dGhUeXBlLCBwZWVySWR4LCB0cnVlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodFNpclJlc3VsdENvZGVzKSBlU0lSX01BQ19VTlNQRUNfRkFJTFVSRV9TVEFUVVMsIHBzZXNzaW9uRW50cnkpOworCisgICAgICAgIHBBc3NvY1JlcSA9IHBzZXNzaW9uRW50cnktPnBhcnNlZEFzc29jUmVxW3BTdGFEcy0+YXNzb2NJZF07CisgICAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorCisgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4ICopICZwU3RhRHMtPm1sbVN0YUNvbnRleHQucHJvcFJhdGVTZXQsCisgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopICYocEFzc29jUmVxLT5wcm9wSUVpbmZvLnByb3BSYXRlcyksCisgICAgICAgICAgICAgICAgICBwQXNzb2NSZXEtPnByb3BJRWluZm8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QU0QgLSBXTU1fU0EgcmVsYXRlZCBwcm9jZXNzaW5nIHNob3VsZCBiZSBzZXBhcmF0ZTsgV01NX1NBIGFuZCBXTU1fQVBTRAorICAgICAgICAgY2FuIGNvZXhpc3QgKi8KKyAgICAgICAgaWYoIHBBc3NvY1JlcS0+V01NSW5mb1N0YXRpb24ucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgLyogY2hlY2sgd2hldGhlciBBUCBzdXBwb3J0cyBvciBub3QgKi8KKyAgICAgICAgICAgIGlmICgocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0FQX1JPTEUpCisgICAgICAgICAgICAgICAgICYmIChwc2Vzc2lvbkVudHJ5LT5hcFVhcHNkRW5hYmxlID09IDApICYmIChwQXNzb2NSZXEtPldNTUluZm9TdGF0aW9uLmFjYmVfdWFwc2QgCisgICAgICAgICAgICAgICAgICAgIHx8IHBBc3NvY1JlcS0+V01NSW5mb1N0YXRpb24uYWNia191YXBzZCAKKyAgICAgICAgICAgICAgICAgICAgfHwgcEFzc29jUmVxLT5XTU1JbmZvU3RhdGlvbi5hY3ZvX3VhcHNkIAorICAgICAgICAgICAgICAgICAgICB8fCBwQXNzb2NSZXEtPldNTUluZm9TdGF0aW9uLmFjdmlfdWFwc2QpKQorICAgICAgICAgICAgeworCisgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICogUmVjZWl2ZWQgUmUvQXNzb2NpYXRpb24gUmVxdWVzdCBmcm9tCisgICAgICAgICAgICAgICAgICogU1RBIHdoZW4gVVBBU0QgaXMgbm90IHN1cHBvcnRlZC4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoICJBUCBkbyBub3Qgc3VwcG9ydCBVQVBTRCBzbyByZXBseSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAidG8gU1RBIGFjY29yZGluZ2x5IiApKTsKKyAgICAgICAgICAgICAgIC8qIHVwZGF0ZSBVQVBTRCBhbmQgc2VuZCBpdCB0byBMSU0gdG8gYWRkIFNUQSAqLworICAgICAgICAgICAgICAgcFN0YURzLT5xb3MuY2FwYWJpbGl0eS5xb3NJbmZvLmFjYmVfdWFwc2QgPSAwOworICAgICAgICAgICAgICAgcFN0YURzLT5xb3MuY2FwYWJpbGl0eS5xb3NJbmZvLmFjYmtfdWFwc2QgPSAwOworICAgICAgICAgICAgICAgcFN0YURzLT5xb3MuY2FwYWJpbGl0eS5xb3NJbmZvLmFjdm9fdWFwc2QgPSAwOworICAgICAgICAgICAgICAgcFN0YURzLT5xb3MuY2FwYWJpbGl0eS5xb3NJbmZvLmFjdmlfdWFwc2QgPSAwOworICAgICAgICAgICAgICAgcFN0YURzLT5xb3MuY2FwYWJpbGl0eS5xb3NJbmZvLm1heFNwTGVuID0gICAwOworCisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogdXBkYXRlIFVBUFNEIGFuZCBzZW5kIGl0IHRvIExJTSB0byBhZGQgU1RBICovCisgICAgICAgICAgICAgICAgcFN0YURzLT5xb3MuY2FwYWJpbGl0eS5xb3NJbmZvLmFjYmVfdWFwc2QgPSBwQXNzb2NSZXEtPldNTUluZm9TdGF0aW9uLmFjYmVfdWFwc2Q7CisgICAgICAgICAgICAgICAgcFN0YURzLT5xb3MuY2FwYWJpbGl0eS5xb3NJbmZvLmFjYmtfdWFwc2QgPSBwQXNzb2NSZXEtPldNTUluZm9TdGF0aW9uLmFjYmtfdWFwc2Q7CisgICAgICAgICAgICAgICAgcFN0YURzLT5xb3MuY2FwYWJpbGl0eS5xb3NJbmZvLmFjdm9fdWFwc2QgPSBwQXNzb2NSZXEtPldNTUluZm9TdGF0aW9uLmFjdm9fdWFwc2Q7CisgICAgICAgICAgICAgICAgcFN0YURzLT5xb3MuY2FwYWJpbGl0eS5xb3NJbmZvLmFjdmlfdWF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kVUUllfSU5URVJWQUwsCisgICAgICAgICAgICAgICAgICAgICAgICZyZXRyeUludGVydmFsKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkNvdWxkIG5vdCByZXRyaWV2ZSBQTUYgU0EgUXVlcnkgcmV0cnkgaW50ZXJ2YWwgdmFsdWUiKSk7CisgICAgICAgIGxpbVJlamVjdEFzc29jaWF0aW9uKHBNYWMsIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJUeXBlLCB0cnVlLCBhdXRoVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVlcklkeCwgZmFsc2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0U2lyUmVzdWx0Q29kZXMpIGVTSVJfTUFDX1VOU1BFQ19GQUlMVVJFX1NUQVRVUywgcHNlc3Npb25FbnRyeSk7CisgICAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorICAgIGlmIChXTklfQ0ZHX1BNRl9TQV9RVUVSWV9SRVRSWV9JTlRFUlZBTF9TVEFNSU4gPiByZXRyeUludGVydmFsKQorICAgIHsKKyAgICAgICAgcmV0cnlJbnRlcnZhbCA9IFdOSV9DRkdfUE1GX1NBX1FVRVJZX1JFVFJZX0lOVEVSVkFMX1NUQURFRjsKKyAgICB9CisgICAgaWYgKHR4X3RpbWVyX2NyZWF0ZSgmcFN0YURzLT5wbWZTYVF1ZXJ5VGltZXIsICJQTUYgU0EgUXVlcnkgdGltZXIiLAorICAgICAgICAgICAgICAgICAgICAgICAgbGltUG1mU2FRdWVyeVRpbWVySGFuZGxlciwgdGltZXJJZC52YWx1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIFNZU19NU19UT19USUNLUygocmV0cnlJbnRlcnZhbCAqIDEwMjQpIC8gMTAwMCksCisgICAgICAgICAgICAgICAgICAgICAgICAwLCBUWF9OT19BQ1RJVkFURSkgIT0gVFhfU1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lMVVJFX1NUQVRVUywgcHNlc3Npb25FbnRyeSk7CisKKyAgICAgICAgICAgIHBBc3NvY1JlcSA9IHBzZXNzaW9uRW50cnktPnBhcnNlZEFzc29jUmVxW3BTdGFEcy0+YXNzb2NJZF07CisgICAgICAgICAgICBnb3RvIGVycm9yOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHBTdGFEcy0+bWxtU3RhQ29udGV4dC51cGRhdGVDb250ZXh0ID0gMTsKKworICAgICAgICBtbG1QcmV2U3RhdGUgPSBwU3RhRHMtPm1sbVN0YUNvbnRleHQubWxtU3RhdGU7CisKKyAgICAgICAgLyogQXMgcGVyIHRoZSBIQUwvRlcgbmVlZHMgdGhlIHJlYXNzb2MgcmVxIG5lZWQgbm90IGJlIGNhbGxpbmcgbGltRGVsU3RhICovCisgICAgICAgIGlmKHN1YlR5cGUgIT0gTElNX1JFQVNTT0MpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vd2UgbmVlZCB0byBzZXQgdGhlIG1sbVN0YXRlIGhlcmUgaW4gb3JkZXIgZGlmZmVyZW50aWF0ZSBpbiBsaW1EZWxTdGEuCisgICAgICAgICAgICBwU3RhRHMtPm1sbVN0YUNvbnRleHQubWxtU3RhdGUgPSBlTElNX01MTV9XVF9BU1NPQ19ERUxfU1RBX1JTUF9TVEFURTsKKyAgICAgICAgICAgIGlmKGxpbURlbFN0YShwTWFjLCBwU3RhRHMsIHRydWUsIHBzZXNzaW9uRW50cnkpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoImNvdWxkIG5vdCBERUwgU1RBIHdpdGggYXNzb2NJZD0lZCBzdGFJZCAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5hc3NvY0lkLCBwU3RhRHMtPnN0YUluZGV4KTsKKyAgICAgICAgICAgICAgICBsaW1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ICAgICAgICBwU3RhRHMtPmFzc29jSWQsIHBTdGFEcy0+c3RhSW5kZXgpOworICAgICAgICAgICAgICAgICAgICBsaW1SZWplY3RBc3NvY2lhdGlvbiggcE1hYywgcFN0YURzLT5zdGFBZGRyLCBwU3RhRHMtPm1sbVN0YUNvbnRleHQuc3ViVHlwZSwgdHJ1ZSwgcFN0YURzLT5tbG1TdGFDb250ZXh0LmF1dGhUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5hc3NvY0lkLCB0cnVlLCh0U2lyUmVzdWx0Q29kZXMpIGVTSVJfTUFDX1dNRV9SRUZVU0VEX1NUQVRVUywgcHNlc3Npb25FbnRyeSk7CisKKyAgICAgICAgICAgICAgICAgICAgLy9SZXN0b3JpbmcgdGhlIHN0YXRlIGJhY2suCisgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+bWxtU3RhQ29udGV4dC5tbG1TdGF0ZSA9IG1sbVByZXZTdGF0ZTsKKyAgICAgICAgICAgICAgICAgICAgcEFzc29jUmVxID0gcHNlc3Npb25FbnRyeS0+cGFyc2VkQXNzb2NSZXFbcFN0YURzLT5hc3NvY0lkXTsKKyAgICAgICAgICAgICAgICAgICAgZ290byBlcnJvcjsKKyAgICAgICAgICAgIH0KKworICAgICAgICB9CisKKyAgICB9CisKKyAgICByZXR1cm47CisKK2Vycm9yOgorICAgIGlmIChwQXNzb2NSZXEgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIGlmICggcEFzc29jUmVxLT5hc3NvY1JlcUZyYW1lICkgCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwQXNzb2NSZXEtPmFzc29jUmVxRnJhbWUpOworICAgICAgICAgICAgcEFzc29jUmVxLT5hc3NvY1JlcUZyYW1lID0gTlVMTDsKKyAgICAgICAgfQorCisgICAgICAgIHZvc19tZW1fZnJlZShwQXNzb2NSZXEpOworICAgIH0KKworICAgIC8qIElmIGl0IGlzIG5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0eS5taW5UeFBvd2VyOworICAgICAgICAgICAgcE1sbUFzc29jSW5kLT5wb3dlckNhcC5tYXhUeFBvd2VyID0gcEFzc29jUmVxLT5wb3dlckNhcGFiaWxpdHkubWF4VHhQb3dlcjsKKyAgICAgICAgICAgIGxpbUNvbnZlcnRTdXBwb3J0ZWRDaGFubmVscyhwTWFjLCBwTWxtQXNzb2NJbmQsIHBBc3NvY1JlcSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgICAgcE1sbUFzc29jSW5kLT5zcGVjdHJ1bU1ndEluZGljYXRvciA9IGVTSVJfRkFMU0U7CisKKworICAgICAgICAvKiBUaGlzIGNoZWNrIGlzIHRvIGF2b2lkIGV4dHJhIFNlYyBJRXMgcHJlc2VudCBpbmNhc2Ugb2YgV1BTICovCisgICAgICAgIGlmIChwQXNzb2NSZXEtPndwYVByZXNlbnQgJiYgKE5VTEwgPT0gd3BzSWUpKQorICAgICAgICB7CisgICAgICAgICAgICBpZigocE1sbUFzc29jSW5kLT5yc25JRS5sZW5ndGggKyBwQXNzb2NSZXEtPndwYS5sZW5ndGgpID49IFNJUl9NQUNfTUFYX0lFX0xFTkdUSCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJyc25JRWRhdGEgaW5kZXggb3V0IG9mIGJvdW5kcyAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNbG1Bc3NvY0luZC0+cnNuSUUubGVuZ3RoKTspCisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBNbG1Bc3NvY0luZCk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcE1sbUFzc29jSW5kLT5yc25JRS5yc25JRWRhdGFbcE1sbUFzc29jSW5kLT5yc25JRS5sZW5ndGhdID0gU0lSX01BQ19XUEFfRUlEOworICAgICAgICAgICAgcE1sbUFzc29jSW5kLT5yc25JRS5yc25JRWRhdGFbcE1sbUFzc29jSW5kLT5yc25JRS5sZW5ndGggKyAxXSA9IHBBc3NvY1JlcS0+d3BhLmxlbmd0aDsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSgmcE1sbUFzc29jSW5kLT5yc25JRS5yc25JRWRhdGFbcE1sbUFzc29jSW5kLT5yc25JRS5sZW5ndGggKyAyXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBwQXNzb2NSZXEtPndwYS5pbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgIHBBc3NvY1JlcS0+d3BhLmxlbmd0aCk7CisgICAgICAgICAgICBwTWxtQXNzb2NJbmQtPnJzbklFLmxlbmd0aCArPSAyICsgcEFzc29jUmVxLT53cGEubGVuZ3RoOworICAgICAgICB9CisKKworICAgICAgIHBNbG1Bc3NvY0luZC0+YWRkSUUubGVuZ3RoID0gMDsKKyAgICAgICBpZiAocEFzc29jUmVxLT5hZGRJRVByZXNlbnQpCisgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwTWxtQXNzb2NJbmQtPmFkZElFLmFkZElFZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcEFzc29jUmVxLT5hZGRJRS5hZGRJRWRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBBc3NvY1JlcS0+YWRkSUUubGVuZ3RoKTsKKworICAgICAgICAgICAgcE1sbUFzc29jSW5kLT5hZGRJRS5sZW5ndGggPSBwQXNzb2NSZXEtPmFkZElFLmxlbmd0aDsKKyAgICAgICB9CisKKyAgICAgICAgaWYocEFzc29jUmVxLT53bWVJbmZvUHJlc2VudCkKKyAgICAgICAgeworCisgICAgICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgKHRBTklfVTE2KSBXTklfQ0ZHX1dNRV9FTkFCTEVELCAmdG1wKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgid2xhbl9jZmdHZXRJbnQgZmFpbGVkIGZvciBpZCAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19XTUVfRU5BQkxFRCApOworCisgICAgICAgICAgICAvKiBjaGVjayB3aGV0aGVyIEFQIGlzIGVuYWJsZWQgd2l0aCBXTU0gKi8KKyAgICAgICAgICAgIGlmKHRtcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwTWxtQXNzb2NJbmQtPldtbVN0YUluZm9QcmVzZW50ID0gMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwTWxtQXNzb2NJbmQtPldtbVN0YUluZm9QcmVzZW50PSAwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLyogTm90ZTogd2UgYXJlIG5vdCByZWplY3RpbmcgYXNzb2NpYXRpb24gaGVyZSBiZWNhdXNlIElPVCB3aWxsIGZhaWwgKi8KKworICAgICAgICB9CisjaWZkZWYgV0xBTl9GRUFUVVJFX0FQX0hUNDBfMjRHCisgICAgICAgIGlmKHBBc3NvY1JlcS0+SFRDYXBzLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiSFQ0ME1IekludG86ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgcEFzc29jUmVxLT5IVENhcHMuc3RiY0NvbnRyb2xGcmFtZSk7CisgICAgICAgICAgICBwTWxtQXNzb2NJbmQtPkhUNDBNSHpJbnRvUHJlc2VudCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgcEFzc29jUmVxLT5IVENhcHMuc3RiY0NvbnRyb2xGcmFtZTsKKyAgICAgICAgfQorI2VuZGlmCisKKyAgICAgICAgLy8gUmVxdWlyZWQgZm9yIGluZGljYXRpbmcgdGhlIGZyYW1lcyB0byB1cH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ICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIHZvc19tZW1fc2V0KHBNbG1SZWFzc29jSW5kLCB0ZW1wLCAwKTsKKworICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKikgcE1sbVJlYXNzb2NJbmQtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTggKilwU3RhRHMtPnN0YUFkZHIsIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKikgcE1sbVJlYXNzb2NJbmQtPmN1cnJlbnRBcEFkZHIsCisgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSYocEFzc29jUmVxLT5jdXJyZW50QXBBZGRyKSwgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgIHBNbG1SZWFzc29jSW5kLT5haWQgPSBwU3RhRHMtPmFzc29jSWQ7CisgICAgICAgIHBNbG1SZWFzc29jSW5kLT5hdXRoVHlwZSA9IHBTdGFEcy0+bWxtU3RhQ29udGV4dC5hdXRoVHlwZTsKKyAgICAgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4ICopJnBNbG1SZWFzc29jSW5kLT5zc0lkLAorICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTggKikmKHBBc3NvY1JlcS0+c3NJZCksIHBBc3NvY1JlcS0+c3NJZC5sZW5ndGggKyAxKTsKKworICAgICAgICBpZiAocEFzc29jUmVxLT5wcm9wSUVpbmZvLmFuaUluZGljYXRvcikKKyAgICAgICAgICAgIHBTdGFEcy0+YW5pUGVlciA9IDE7CisKKyAgICAgICAgcE1sbVJlYXNzb2NJbmQtPmNhcGFiaWxpdHlJbmZvID0gcEFzc29jUmVxLT5jYXBhYmlsaXR5SW5mbzsKKyAgICAgICAgcE1sbVJlYXNzb2NJbmQtPnJzbklFLmxlbmd0aCA9IDA7CisKKyAgICAgICAgaWYgKHBBc3NvY1JlcS0+YWRkSUVQcmVzZW50ICYmIHBBc3NvY1JlcS0+YWRkSUUubGVuZ3RoICkKKyAgICAgICAgICAgIHdwc0llID0gbGltR2V0V3NjSUVQdHIocE1hYywgcEFzc29jUmVxLT5hZGRJRS5hZGRJRWRhdGEsIHBBc3NvY1JlcS0+YWRkSUUubGVuZ3RoKTsKKworICAgICAgICBpZiAocEFzc29jUmVxLT5yc25QcmVzZW50ICYmIChOVUxMID09IHdwc0llKSkKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzIsIEZMKCJBc3NvYyBSZXE6IFJTTiBJRSBsZW5ndGggPSAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQXNzb2NSZXEtPnJzbi5sZW5ndGgpOworICAgICAgICAgICAgcE1sbVJlYXNzb2NJbmQtPnJzbklFLmxlbmd0aCA9IDIgKyBwQXNzb2NSZXEtPnJzbi5sZW5ndGg7CisgICAgICAgICAgICBwTWxtUmVhc3NvY0luZC0+cnNuSUUucnNuSUVkYXRhWzBdID0gU0lSX01BQ19SU05fRUlEOworICAgICAgICAgICAgcE1sbVJlYXNzb2NJbmQtPnJzbklFLnJzbklFZGF0YVsxXSA9IHBBc3NvY1JlcS0+cnNuLmxlbmd0aDsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSgmcE1sbVJlYXNzb2NJbmQtPnJzbklFLnJzbklFZGF0YVsyXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcEFzc29jUmVxLT5yc24uaW5mbywgcEFzc29jUmVxLT5yc24ubGVuZ3RoKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIDgwMi4xMWggc3VwcG9ydAorICAgICAgICBpZiAocEFzc29jUmVxLT5wb3dlckNhcGFiaWxpdHlQcmVzZW50ICYmIHBBc3NvY1JlcS0+c3VwcG9ydGVkQ2hhbm5lbHNQcmVzZW50KQorICAgICAgICB7CisgICAgICAgICAgICBwTWxtUmVhc3NvY0luZC0+c3BlY3RydW1NZ3RJb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gICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJTZW5kaW5nIFJlYXNzb2NJbmQ6IGNoblslZF0gPSAlZCAiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgaSwgcE1sbVJlYXNzb2NJbmQtPnN1cHBvcnRlZENoYW5uZWxzLmNoYW5uZWxMaXN0W2ldKTsKKyAgICAgICAgICAgICAgICBqKz0yOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHBNbG1SZWFzc29jSW5kLT5zcGVjdHJ1bU1ndEluZGljYXRvciA9IGVTSVJfRkFMU0U7CisKKworICAgICAgICAvKiBUaGlzIGNoZWNrIGlzIHRvIGF2b2lkIGV4dHJhIFNlYyBJRXMgcHJlc2VudCBpbmNhc2Ugb2YgV1BTICovCisgICAgICAgIGlmIChwQXNzb2NSZXEtPndwYVByZXNlbnQgJiYgKE5VTEwgPT0gd3BzSWUpKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMiwgRkwoIlJlY2VpdmVkIFdQQSBJRSBsZW5ndGggaW4gQXNzb2MgUmVxIGlzICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBc3NvY1JlcS0+d3BhLmxlbmd0aCk7CisgICAgICAgICAgICBwTWxtUmVhc3NvY0luZC0+cnNuSUUucnNuSUVkYXRhW3BNbG1SZWFzc29jSW5kLT5yc25JRS5sZW5ndGhdID0gU0lSX01BQ19XUEFfRUlEOworICAgICAgICAgICAgcE1sbVJlYXNzb2NJbmQtPnJzbklFLnJzbklFZGF0YVtwTWxtUmVhc3NvY0luZC0+cnNuSUUubGVuZ3RoICsgMV0gPSBwQXNzb2NSZXEtPndwYS5sZW5ndGg7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnBNbG1SZWFzc29jSW5kLT5yc25JRS5yc25JRWRhdGFbcE1sbVJlYXNzb2NJbmQtPnJzbklFLmxlbmd0aCArIDJdLAorICAgICAgICAgICAgICAgICAgICAgICAgICBwQXNzb2NSZXEtPndwYS5pbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICBwQXNzb2NSZXEtPndwYS5sZW5ndGgpOworICAgICAgICAgICAgcE1sbVJlYXNzb2NJbmQtPnJzbklFLmxlbmd0aCArPSAyICsgcEFzc29jUmVxLT53cGEubGVuZ3RoOworICAgICAgICB9CisKKyAgICAgICBwTWxtUmVhc3NvY0luZC0+YWRkSUUubGVuZ3RoID0gMDsKKyAgICAgICBpZiAocEFzc29jUmVxLT5hZGRJRVByZXNlbnQpCisgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwTWxtUmVhc3NvY0luZC0+YWRkSUUuYWRkSUVkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgIHBBc3NvY1JlcS0+YWRkSUUuYWRkSUVkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgIHBBc3NvY1JlcS0+YWRkSUUubGVuZ3RoKTsKKworICAgICAgICAgICAgcE1sbVJlYXNzb2NJbmQtPmFkZElFLmxlbmd0aCA9IHBBc3NvY1JlcS0+YWRkSUUubGVuZ3RoOworICAgICAgIH0KKworICAgICAgICBpZihwQXNzb2NSZXEtPndtZUluZm9QcmVzZW50KQorICAgICAgICB7CisKKyAgICAgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCAodEFOSV9VMTYpIFdOSV9DRkdfV01FX0VOQUJMRUQsICZ0bXApICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJ3bGFuX2NmZ0dldEludCBmYWlsZWQgZm9yIGlkICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19XTUVfRU5BQkxFRCApOworCisgICAgICAgICAgICAvKiBjaGVjayB3aGV0aGVyIEFQIGlzIGVuYWJsZWQgd2l0aCBXTU0gKi8KKyAgICAgICAgICAgIGlmKHRtcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwTWxtUmVhc3NvY0luZC0+V21tU3RhSW5mb1ByZXNlbnQgPSAxOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBNbG1SZWFzc29jSW5kLT5XbW1TdGFJbmZvUHJlc2VudCA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBOb3RlOiB3ZSBhcmUgbm90IHJlamVjdGluZyBSZS1hc3NvY2lhdGlvbiBoZXJlIGJlY2F1c2UgSU9UIHdpbGwgZmFpbCAqLworCisgICAgICAgIH0KKworI2lmZGVmIFdMQU5fRkVBVFVSRV9BUF9IVDQwXzI0RworICAgICAgICBpZihwQXNzb2NSZXEtPkhUQ2Fwcy5wcmVzZW50KQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgRkwoIlJBU1NPQyBIVDQwTUh6SW50bzogJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFzc29jUmVxLT5IVENhcHMuc3RiY0NvbnRyb2xGcmFtZSk7CisgICAgICAgICAgICBwTWxtUmVhc3NvY0luZC0+SFQ0ME1IekludG9QcmVzZW50ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQXNzb2NSZXEtPkhUQ2Fwcy5zdGJjQ29udHJvbEZyYW1lOworICAgICAgICB9CisjZW5kaWYKKworICAgICAgICAvLyBSZXF1aXJlZCBmb3IgaW5kaWNhdGluZyB0aGUgZnJhbWVzIHRvIHVwcGVyIGxheWVyCisgICAgICAgIHBNbG1SZWFzc29jSW5kLT5hc3NvY1JlcUxlbmd0aCA9IHBBc3NvY1JlcS0+YXNzb2NSZXFGcmFtZUxlbmd0aDsKKyAgICAgICAgcE1sbVJlYXNzb2NJbmQtPmFzc29jUmVxUHRyID0gcEFzc29jUmVxLT5hc3NvY1JlcUZyYW1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dHlJbmZvID0gcEFzc29jUnNwLT5jYXBhYmlsaXR5SW5mbzsKKyAgICAgICBwU3RhRHMtPnNob3J0UHJlYW1ibGVFbmFibGVkPSAodEFOSV9VOClwQXNzb2NSc3AtPmNhcGFiaWxpdHlJbmZvLnNob3J0UHJlYW1ibGU7CisgICAgCisgICAgICAgLy9VcGRhdGUgSFQgQ2FwYWJpbGl0ZXMgb25seSB3aGVuIHRoZSBzZWxmIG1vZGUgc3VwcG9ydHMgSFQKKyAgICAgICBpZihJU19ET1QxMV9NT0RFX0hUKHBzZXNzaW9uRW50cnktPmRvdDExbW9kZSkpIHsKKyAgICAgICAgICAgcFN0YURzLT5tbG1TdGFDb250ZXh0Lmh0Q2FwYWJpbGl0eSA9IHBBc3NvY1JzcC0+SFRDYXBzLnByZXNlbnQ7CisgICAgCisgICAgICAgICAgIGlmICggcEFzc29jUnNwLT5IVENhcHMucHJlc2VudCApIHsKKyAgICAgICAgICAgICAgIHBTdGFEcy0+aHRHcmVlbmZpZWxkID0gKCB0QU5JX1U4ICkgcEFzc29jUnNwLT5IVENhcHMuZ3JlZW5GaWVsZDsKKyAgICAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5odFN1cHBvcnRlZENoYW5uZWxXaWR0aFNldCkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBwU3RhRHMtPmh0U3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0ID0gKCB0QU5JX1U4ICkgKHBBc3NvY1JzcC0+SFRDYXBzLnN1cHBvcnRlZENoYW5uZWxXaWR0aFNldCA/CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFzc29jUnNwLT5IVEluZm8ucmVjb21tZW5kZWRUeFdpZHRoU2V0IDogCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFzc29jUnNwLT5IVENhcHMuc3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0ICk7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgcFN0YURzLT5odFN1cHBvcnRlZENoYW5uZWxXaWR0aFNldCA9IGVIVF9DSEFOTkVMX1dJRFRIXzIwTUhaOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+aHRMc2lnVFhPUFByb3RlY3Rpb24gPSAoIHRBTklfVTggKSBwQXNzb2NSc3AtPkhUQ2Fwcy5sc2lnVFhPUFByb3RlY3Rpb247CisgICAgICAgICAgICAgICAgICAgcFN0YURzLT5odE1JTU9QU1N0YXRlID0gICh0U2lyTWFjSFRNSU1PUG93ZXJTYXZlU3RhdGUpcEFzc29jUnNwLT5IVENhcHMubWltb1Bvd2VyU2F2ZTsKKyAgICAgICAgICAgICAgICAgICBwU3RhRHMtPmh0TWF4QW1zZHVMZW5ndGggPSAoIHRBTklfVTggKSBwQXNzb2NSc3AtPkhUQ2Fwcy5tYXhpbWFsQU1TRFVzaXplOworICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+aHRBTXBkdURlbnNpdHkgPSAgICAgICAgICAgICBwQXNzb2NSc3AtPkhUQ2Fwcy5tcGR1RGVuc2l0eTsKKyAgICAgICAgICAgICAgICAgICBwU3RhRHMtPmh0RHNzc0Nja1JhdGU0ME1IelN1cHBvcnQgPSAodEFOSV9VOClwQXNzb2NSc3AtPkhUQ2Fwcy5kc3NzQ2NrTW9kZTQwTUh6OworICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+aHRTaG9ydEdJMjBNaHogPSAodEFOSV9VOClwQXNzb2NSc3AtPkhUQ2Fwcy5zaG9ydEdJMjBNSHo7CisgICAgICAgICAgICAgICAgICAgcFN0YURzLT5odFNob3J0R0k0ME1oeiA9ICh0QU5JX1U4KXBBc3N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FjLT5saW0uZ0xpbVFvc0VuYWJsZWQpCisgICAgICAgaWYgKHFvc01vZGUpIHsKKyAgICAgICAgICAgaWYgKHBBc3NvY1JzcC0+ZWRjYVByZXNlbnQpIHsKKyAgICAgICAgICAgICAgIHRTaXJSZXRTdGF0dXMgc3RhdHVzOworICAgICAgICAgICAgICAgc3RhdHVzID0gc2NoQmVhY29uRWRjYVByb2Nlc3MocE1hYywmcEFzc29jUnNwLT5lZGNhLCBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgUEVMT0cyKGxpbUxvZyhwTWFjLCBMT0cyLCAiRWRjYSBzZXQgdXBkYXRlIGJhc2VkIG9uIEFzc29jUnNwOiBzdGF0dXMgJWQiLAorICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyk7KQorICAgICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBlU0lSX1NVQ0NFU1MpIHsKKyAgICAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJFZGNhIGVycm9yIGluIEFzc29jUmVzcCAiKSk7KQorICAgICAgICAgICAgICAgfSBlbHNlIHsgLy8gdXBkYXRlIGRlZmF1bHQgdGlkbWFwIGJhc2VkIG9uIEFDTQorICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+cW9zTW9kZSAgICA9IDE7CisgICAgICAgICAgICAgICAgICAgcFN0YURzLT5sbGVFbmFibGVkID0gMTsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgfQorICAgICAgIH0KKyAgICAKKyAgICAgICBwU3RhRHMtPndtZUVuYWJsZWQgPSAwOworICAgICAgIHBTdGFEcy0+d3NtRW5hYmxlZCA9IDA7CisgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPmxpbVdtZUVuYWJsZWQgJiYgcEFzc29jUnNwLT53bWVFZGNhUHJlc2VudCkKKyAgICAgICB7CisgICAgICAgICAgIHRTaXJSZXRTdGF0dXMgc3RhdHVzOworICAgICAgICAgICBzdGF0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c01vZGUpICYmIHBTdGFEcy0+bWxtU3RhQ29udGV4dC5odENhcGFiaWxpdHkpCisgICAgICAgeworICAgICAgICAgICAvLyBFbmFibGUgUU9TIGZvciBhbGwgSFQgQVAncyBldmVuIHRob3VnaCBXTU0gb3IgODAyLjExRSBJRSBpcyBub3QgcHJlc2VudAorICAgICAgICAgICBwU3RhRHMtPnFvc01vZGUgICAgPSAxOworICAgICAgICAgICBwU3RhRHMtPndtZUVuYWJsZWQgPSAxOworICAgICAgIH0KKworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMVcKKyAgICAgICBpZihwc2Vzc2lvbkVudHJ5LT5saW1SbWZFbmFibGVkKQorICAgICAgIHsKKyAgICAgICAgICAgcFN0YURzLT5ybWZFbmFibGVkID0gMTsKKyAgICAgICB9CisjZW5kaWYKK30KKworLyoqCisgKiBAZnVuY3Rpb24gOiBsaW1VcGRhdGVSZUFzc29jR2xvYmFscworICoKKyAqIEBicmllZiA6ICBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCB0byBVcGRhdGUgdGhlIEdsb2JhbHMgKExJTSkgZHVyaW5nIFJlQXNzb2MuCisgKgorICpMT0dJQzoKKyAqCisgKkFTU1VNUFRJT05TOgorICoKKyAqTk9URToKKyAqCisgKiBAcGFyYW0gIHBNYWMgICAgLSBQb2ludGVyIHRvIEdsb2JhbCBNQUMgc3RydWN0dXJlCisgKiBAcGFyYW0gIHBBc3NvY1JzcCAgICAtIFBvaW50ZXIgdG8gQXNzb2NpYXRpb24gUmVzcG9uc2UgU3RydWN0dXJlCisgKgorICogQHJldHVybiBOb25lCisgKi8KKwordm9pZCBsaW1VcGRhdGVSZUFzc29jR2xvYmFscyh0cEFuaVNpckdsb2JhbCBwTWFjLCB0cFNpckFzc29jUnNwIHBBc3NvY1JzcCx0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KQoreworICAgIC8qKgorICAgICAqIFVwZGF0ZSB0aGUgc3RhdHVzIGZvciBQTU0gbW9kdWxl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kIHVuZXhwZWN0ZWQgUmUvQXNzb2NpYXRpb24gUmVzcG9uc2UgZnJhbWUKKworI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSX0RFQlVHCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCAgRkwoIlJlY2lldmVkIFJlL0Fzc29jIHJzcCBpbiB1bmV4cGVjdGVkICIKKyAgICAgICAgICAgICJzdGF0ZSAlZCBvbiBzZXNzaW9uPSVkIiksCisgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSwgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQpOworI2VuZGlmCisgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICBpZiAoIXBIZHItPmZjLnJldHJ5KQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoICEocE1hYy0+bGltLnJldHJ5UGFja2V0Q250ICYgMHhmKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICBGTCgicmVjZWl2ZWQgUmUvQXNzb2MgcnNwIGZyYW1lIGlzIG5vdCBhIHJldHJ5IGZyYW1lLCAiCisgICAgICAgICAgICAgICAgICAgICAiZnJhbWUgY291bnQgJWQiKSwgKytwTWFjLT5saW0ucmV0cnlQYWNrZXRDbnQpOworICAgICAgICAgICAgICAgIGxpbVByaW50TWxtU3RhdGUocE1hYywgTE9HRSwgcHNlc3Npb25FbnRyeS0+bGltTWxtU3RhdGUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5yZXRyeVBhY2tldENudCsrOworICAgICAgICAgICAgfQorCisgICAgICAgIH0KKyAgICAgICAgdm9zX21lbV9mcmVlKHBCZWFjb25TdHJ1Y3QpOworICAgICAgICByZXR1cm47CisgICAgfQorI2lmIDAKKyAgICBpZiAod2xhbl9jZmdHZXRTdHIocE1hYywgV05JX0NGR19CU1NJRCwgY3VycmVudEJzc0lkLCAmY2ZnKSAhPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX1NVQ0NFU1MpCisgICAgeworICAgICAgICAvLy8gQ291bGQgbm90IGdldCBCU1NJRCBmcm9tIENGRy4gTG9nIGVycm9yLgorICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBCU1NJRCIpKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBCZWFjb25TdHJ1Y3QpOworICAgICAgICByZXR1cm47CisgICAgfQorI2VuZGlmIC8vVE8gU1VQUE9SVCBCVC1BTVAKKyAgICBzaXJDb3B5TWFjQWRkcihjdXJyZW50QnNzSWQscHNlc3Npb25FbnRyeS0+YnNzSWQpOworCisgICAgaWYgKHN1YlR5cGUgPT0gTElNX0FTU09DKQorICAgIHsKKyAgICAgICAgaWYgKCF2b3NfbWVtX2NvbXBhcmUocEhkci0+c2EsIGN1cnJlbnRCc3NJZCwgc2l6ZW9mKHRTaXJNYWNBZGRyKSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogUmVjZWl2ZWQgQXNzb2NpYXRpb24gUmVzcG9uc2UgZnJhbWUgZnJvbSBhbiBlbnRpdHkKKyAgICAgICAgICAgICAqIG90aGVyIHRoYW4gb25lIHRvIHdoaWNoIHJlcXVlc3Qgd2FzIGluaXRpYXRlZC4KKyAgICAgICAgICAgICAqIElnbm9yZSB0aGlzIGFuZCB3YWl0IHVudGlsIEFzc29jaWF0aW9uIEZhaWx1cmUgVGltZW91dC4KKyAgICAgICAgICAgICAqLworCisgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgIFBFTE9HVyhsaW1Mb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgICAgICAgICBGTCgicmVjZWl2ZWQgQXNzb2NSc3AgZnJhbWUgZnJvbSB1bmV4cGVjdGVkIHBlZXIgIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTspCisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocEJlYWNvblN0cnVjdCk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgaWYgKCF2b3NfbWVtX2NvbXBhcmUocEhkci0+c2EsIHBzZXNzaW9uRW50cnktPmxpbVJlQXNzb2Nic3NJZCwgc2l6ZW9mKHRTaXJNYWNBZGRyKSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogUmVjZWl2ZWQgUmVhc3NvY2lhdGlvbiBSZXNwb25zZSBmcmFtZSBmcm9tIGFuIGVudGl0eQorICAgICAgICAgICAgICogb3RoZXIgdGhhbiBvbmUgdG8gd2hpY2ggcmVxdWVzdCB3YXMgaW5pdGlhdGVkLgorICAgICAgICAgICAgICogSWdub3JlIHRoaXMgYW5kIHdhaXQgdW50aWwgUmVhc3NvY2lhdGlvbiBGYWlsdXJlIFRpbWVvdXQuCisgICAgICAgICAgICAgKi8KKworICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICBQRUxPR1cobGltTG9nKHBNYWMsIExPR1csCisgICAgICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIFJlYXNzb2NSc3AgZnJhbWUgZnJvbSB1bmV4cGVjdGVkIHBlZXIgIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTspCisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocEJlYWNvblN0cnVjdCk7CisKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgIH0KKworICAgcEFzc29jUnNwID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKCpwQXNzb2NSc3ApKTsKKyA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wb25zZSIpKTspCisgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5SSUNEYXRhTGVuID0gMDsgCisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocHNlc3Npb25FbnRyeS0+cmljRGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAmcEFzc29jUnNwLT5SSUNEYXRhWzBdLCBwc2Vzc2lvbkVudHJ5LT5SSUNEYXRhTGVuKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlJpYyBpcyBub3QgcHJlc2VudCBTZXR0aW5nIFJJQ0RhdGFMZW4gMCBhbmQgcmljRGF0YSAiCisgICAgICAgICJhcyBOVUxMIikpOworICAgICAgICBwc2Vzc2lvbkVudHJ5LT5SSUNEYXRhTGVuID0gMDsKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+cmljRGF0YSA9IE5VTEw7CisgICAgfQorI2VuZGlmICAgIAorCisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRQorICAgIGlmIChwc2Vzc2lvbkVudHJ5LT50c3BlY0llcyAhPSBOVUxMKSAKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZShwc2Vzc2lvbkVudHJ5LT50c3BlY0llcyk7CisgICAgICAgIHBzZXNzaW9uRW50cnktPnRzcGVjSWVzID0gTlVMTDsKKyAgICB9CisgICAgaWYocEFzc29jUnNwLT50c3BlY1ByZXNlbnQpCisgICAgeworICAgICAgICBwc2Vzc2lvbkVudHJ5LT50c3BlY0xlbiA9IHBBc3NvY1JzcC0+bnVtX3RzcGVjcyAqIHNpemVvZih0RG90MTFmSUVXTU1UU1BFQyk7CisgICAgICAgIHBzZXNzaW9uRW50cnktPnRzcGVjSWVzID0gdm9zX21lbV9tYWxsb2MocHNlc3Npb25FbnRyeS0+dHNwZWNMZW4pOworICAgICAgICBpZiAoIE5VTEwgPT0gcHNlc3Npb25FbnRyeS0+dHNwZWNJZXMgKQorICAgICAgICB7CisgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJVbmFibGUgdG8gYWxsb2NhdGUgbWVtb3J5IHRvIHN0b3JlIGFzc29jIHJlc3BvbnNlIikpOykKKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnRzcGVjTGVuID0gMDsgCisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocHNlc3Npb25FbnRyeS0+dHNwZWNJZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgJnBBc3NvY1JzcC0+VFNQRUNJbmZvWzBdLCBwc2Vzc2lvbkVudHJ5LT50c3BlY0xlbik7CisgICAgICAgIH0KKyAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCIgVHNwZWMgRUlEIHByZXNlbnQgaW4gYXNzb2MgcnNwICIpKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+dHNwZWNMZW4gPSAwOworICAgICAgICBwc2Vzc2lvbkVudHJ5LT50c3BlY0llcyA9IE5VTEw7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiIFRzcGVjIEVJRCAqTk9UKiBwcmVzZW50IGluIGFzc29jIHJzcCAiKSk7CisgICAgfQorI2VuZGlmCisKKyAgICBpZiAocEFzc29jUnNwLT5jYXBhYmlsaXR5SW5mby5pYnNzKQorICAgIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFJlY2VpdmVkIFJlL0Fzc29jaWF0aW9uIFJlc3BvbnNlIGZyb20gcGVlcgorICAgICAgICAgKiB3aXRoIElCU1MgY2FwYWJpbGl0eSBzZXQuCisgICAgICAgICAqIElnbm9yZSB0aGUgZnJhbWUgYW5kIHdhaXQgdW50aWwgUmUvYXNzb2MKKyAgICAgICAgICogZmFpbHVyZSB0aW1lb3V0LgorICAgICAgICAgKi8KKyAgICAgICAgCisgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBSZS9Bc3NvY1JzcCBmcmFtZSB3aXRoIElCU1MgY2FwYWJpbGl0eSIpKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBBc3NvY1JzcCk7CisgICAgICAgIHZvc19tZW1fZnJlZShwQmVhY29uU3RydWN0KTsKKworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaWYgKGNmZ0dldENhcGFiaWxpdHlJbmZvKHBNYWMsICZjYXBzLHBzZXNzaW9uRW50cnkpICE9IGVTSVJfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIC8qKgorICAgICAgICAgKiBDb3VsZCBub3QgZ2V0IENhcGFiaWxpdGllcyB2YWx1ZQorICAgICAgICAgKiBmcm9tIENGRy4gTG9nIGVycm9yLgorICAgICAgICAgKi8gICAgICAgICAKKyAgICAgICAgdm9zX21lbV9mcmVlKHBBc3NvY1JzcCk7CisgICAgICAgIHZvc19tZW1fZnJlZShwQmVhY29uU3RydWN0KTsKKworICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBDYXBhYmlsaXRpZXMgdmFsdWUiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgbGltQ29weVUxNigodEFOSV9VOCAqKSAmbG9jYWxDYXBhYmlsaXRpZXMsIGNhcHMpOworCisgICAgaWYgKHN1YlR5cGUgPT0gTElNX0FTU09DKSAgICAgICAgLy8gU3RvcCBBc3NvY2lhdGlvbiBmYWlsdXJlIHRpbWVyCisgICAgICAgIGxpbURlYWN0aXZhdGVBbmRDaGFuZ2VUaW1lcihwTWFjLCBlTElNX0FTU09DX0ZBSUxfVElNRVIpOworICAgIGVsc2UgICAgICAgIC8vIFN0b3AgUmVhc3NvY2lhdGlvbi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dG8gdXBkYXRlICdhc3NvY2lhdGlvbiBmYWlsdXJlJyBlcnJvciBjb3VudGVyCisgICAgICAgIC8vIGFsb25nIHdpdGggU1RBVFVTIENPREUKKworICAgICAgICAvLyBSZXR1cm4gQXNzb2MgY29uZmlybSB0byBTTUUgd2l0aCByZWNlaXZlZCBmYWlsdXJlIGNvZGUKKworICAgICAgICBpZiAocEFzc29jUnNwLT5wcm9wSUVpbmZvLmxvYWRCYWxhbmNlSW5mb1ByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIG1sbUFzc29jQ25mLnJlc3VsdENvZGUgPSBlU0lSX1NNRV9UUkFOU0ZFUl9TVEE7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocE1hYy0+bGltLmdMaW1BbHRlcm5hdGVSYWRpby5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBwQXNzb2NSc3AtPnByb3BJRWluZm8uYWx0ZXJuYXRlUmFkaW8uYnNzSWQsIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1BbHRlcm5hdGVSYWRpby5jaGFubmVsSWQgPQorICAgICAgICAgICAgICAgICAgICAgICAgICBwQXNzb2NSc3AtPnByb3BJRWluZm8uYWx0ZXJuYXRlUmFkaW8uY2hhbm5lbElkOworICAgICAgICB9ZWxzZQorICAgICAgICAgICAgbWxtQXNzb2NDbmYucmVzdWx0Q29kZSA9IGVTSVJfU01FX0FTU09DX1JFRlVTRUQ7CisKKyAgICAgICAgLy8gRGVsZXRlIFByZS1hdXRoIGNvbnRleHQgZm9yIHRoZSBhc3NvY2lhdGVkIEJTUworICAgICAgICBpZiAobGltU2VhcmNoUHJlQXV0aExpc3QocE1hYywgcEhkci0+c2EpKQorICAgICAgICAgICAgbGltRGVsZXRlUHJlQXV0aE5vZGUocE1hYywgcEhkci0+c2EpOworCisgICAgICAgIGdvdG8gYXNzb2NSZWplY3Q7CisgICAgfQorICAgIGVsc2UgaWYgKChw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QU5fRVNFCisgICAgICAgIHsKKyAgICAgICAgICAgIHRBTklfVTggY250ID0gMDsKKyAgICAgICAgICAgIGlmIChwQXNzb2NSc3AtPnRzbVByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsICJUU00gSUUgUHJlc2VudCBpbiBSZWFzc29jIFJzcCIpOworICAgICAgICAgICAgICAgIC8vIFN0YXJ0IHRoZSBUU00gIHRpbWVyIG9ubHkgaWYgdGhlIFRTUEVDIEllIGlzIHByZXNlbnQgaW4gdGhlIHJlYXNzb2MgcnNwCisgICAgICAgICAgICAgICAgaWYgKHBBc3NvY1JzcC0+dHNwZWNQcmVzZW50KSB7CisgICAgICAgICAgICAgICAgICAgIC8vIEZpbmQgdGhlIFRTUEVDIElFIHdpdGggVk8gdXNlciBwcmlvcml0eQorICAgICAgICAgICAgICAgICAgICBmb3IgKGNudD0wOyBjbnQ8cEFzc29jUnNwLT5udW1fdHNwZWNzOyBjbnQrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCB1cFRvQWMocEFzc29jUnNwLT5UU1BFQ0luZm9bY250XS51c2VyX3ByaW9yaXR5KSA9PSBFRENBX0FDX1ZPKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+ZXNlQ29udGV4dC50c20udGlkID0gcEFzc29jUnNwLT5UU1BFQ0luZm9bY250XS51c2VyX3ByaW9yaXR5OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmcHNlc3Npb25FbnRyeS0+ZXNlQ29udGV4dC50c20udHNtSW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwQXNzb2NSc3AtPnRzbUlFLCBzaXplb2YodFNpck1hY0VTRVRTTUlFKSk7CisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRV9VUExPQUQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1TZW5kU21lVHNtSUVJbmQocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFzc29jUnNwLT50c21JRS50c2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQXNzb2NSc3AtPnRzbUlFLnN0YXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQXNzb2NSc3AtPnRzbUlFLm1zbXRfaW50ZXJ2YWwpOworI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1BY3RpdmF0ZVRTTVN0YXRzVGltZXIocE1hYywgcHNlc3Npb25FbnRyeSk7CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0VTRV9VUExPQUQgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihwc2Vzc2lvbkVudHJ5LT5lc2VDb250ZXh0LnRzbS50c21JbmZvLnN0YXRlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmVzZUNvbnRleHQudHNtLnRzbU1ldHJpY3MuUm9hbWluZ0NvdW50Kys7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsICJUU00gcHJlc2VudCBidXQgVFNQRUMgSUUgbm90IHByZXNlbnQgaW4gUmVhc3NvYyBSc3AiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyNlbmRpZgorICAgICAgICBpZiAocHNlc3Npb25FbnRye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oZWQgVFNQRUMuICAKKyAgICAgICAgICogSnVzdCBnbyBhaGVhZCBhbmQgcmUtYWRkIHRoZSBCU1MsIFNUQSB3aXRoIG5ldyBjYXBhYmlsaXR5IGluZm9ybWF0aW9uLiAKKyAgICAgICAgICogSG93ZXZlciwgaWYgd2UncmUgcmUtYXNzb2NpYXRpbmcgdG8gYSBkaWZmZXJlbnQgQlNTLCB0aGVuIGZvbGxvdyB0aHJ1CisgICAgICAgICAqIHdpdGggZGVsIFNUQSwgZGVsIEJTUywgYWRkIEJTUywgYWRkIFNUQS4gICAgICAgCisgICAgICAgICAqLworICAgICAgICBpZiAoc2lyQ29tcGFyZU1hY0FkZHIoIHBzZXNzaW9uRW50cnktPmJzc0lkLCBwc2Vzc2lvbkVudHJ5LT5saW1SZUFzc29jYnNzSWQpKQorICAgICAgICAgICAgbGltSGFuZGxlQWRkQnNzSW5SZUFzc29jQ29udGV4dChwTWFjLCBwU3RhRHMsIHBzZXNzaW9uRW50cnkpOworICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIHJlc2V0IHRoZSB1YXBzZCBtYXNrIHNldHRpbmdzIHNpbmNlIHdlJ3JlIHJlLWFzc29jaWF0aW5nIHRvIG5ldyBBUAorICAgICAgICAgICAgcE1hYy0+bGltLmdVYXBzZFBlckFjRGVsaXZlcnlFbmFibGVNYXNrID0gMDsKKyAgICAgICAgICAgIHBNYWMtPmxpbS5nVWFwc2RQZXJBY1RyaWdnZXJFbmFibGVNYXNrID0gMDsKKworICAgICAgICAgICAgaWYgKGxpbUNsZWFudXBSeFBhdGgocE1hYywgcFN0YURzLHBzZXNzaW9uRW50cnkpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJDb3VsZCBub3QgY2xlYW51cCB0aGUgcnggcGF0aCIpKTspCisgICAgICAgICAgICAgICAgZ290byBhc3NvY1JlamV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tZXRlcnMucHJlc2VudCkKKyAgICB7CisgICAgICAgIGxpbVVwZGF0ZU9CU1NTY2FuUGFyYW1zKHBzZXNzaW9uRW50cnkgLCAmcEFzc29jUnNwLT5PQlNTU2NhblBhcmFtZXRlcnMpOworICAgIH0KKworICAgIGlmKCBwQXNzb2NSc3AtPlFvc01hcFNldC5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHZvc19tZW1fY29weSgmcHNlc3Npb25FbnRyeS0+UW9zTWFwU2V0LAorICAgICAgICAgICAgICAgICAgICAgJnBBc3NvY1JzcC0+UW9zTWFwU2V0LAorICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJRb3NNYXBTZXQpKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICB2b3NfbWVtX3plcm8oJnBzZXNzaW9uRW50cnktPlFvc01hcFNldCwgc2l6ZW9mKHRTaXJRb3NNYXBTZXQpKTsKKyAgICB9CisKKyAgICAgLy9VcGRhdGUgdGhlIEJTUyBFbnRyeSwgdGhpcyBlbnRyeSB3YXMgYWRkZWQgZHVyaW5nIHByZWFzc29jLgorICAgIGlmKCBlU0lSX1NVQ0NFU1MgPT0gbGltU3RhU2VuZEFkZEJzcyggcE1hYywgcEFzc29jUnNwLCAgcEJlYWNvblN0cnVjdCwKKyAgICAgICAgICAgICAgICAgICAmcHNlc3Npb25FbnRyeS0+cExpbUpvaW5SZXEtPmJzc0Rlc2NyaXB0aW9uLCB0cnVlLCBwc2Vzc2lvbkVudHJ5KSkgIAorICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBBc3NvY1JzcCk7CisgICAgICAgIHZvc19tZW1fZnJlZShwQmVhY29uU3RydWN0KTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJjb3VsZCBub3QgdXBkYXRlIHRoZSBic3MgZW50cnkiKSk7KQorICAgICAgICBtbG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udHJ5LT5saW1NbG1TdGF0ZSkpOworCisgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5wTGltTWxtSm9pblJlcSkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBzZXNzaW9uRW50cnktPnBMaW1NbG1Kb2luUmVxKTsKKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBMaW1NbG1Kb2luUmVxID0gTlVMTDsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChzdWJUeXBlID09IExJTV9BU1NPQykKKyAgICAgICAgeworICAgICAgICAgICBsaW1Qb3N0U21lTWVzc2FnZShwTWFjLCBMSU1fTUxNX0FTU09DX0NORiwgKHRBTklfVTMyICopICZtbG1Bc3NvY0NuZik7CisgICAgICAgIH0KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUgorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgICAgICBtbG1Bc3NvY0NuZi5yZXN1bHRDb2RlID0gZVNJUl9TTUVfRlRfUkVBU1NPQ19GQUlMVVJFOworICAgICAgICAgICAgICAgIGxpbVBvc3RTbWVNZXNzYWdlKHBNYWMsIExJTV9NTE1fUkVBU1NPQ19DTkYsICh0QU5JX1UzMiAqKSAmbWxtQXNzb2NDbmYpOworICAgICAgICB9CisjZW5kaWYgLyogV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIgKi8KKyAgICB9IGVsc2UgeworICAgICAgICBsaW1SZXN0b3JlUHJlUmVhc3NvY1N0YXRlKCBwTWFjLCAKKyAgICAgICAgICAgICAgICAgIGVTSVJfU01FX1JFQVNTT0NfUkVGVVNFRCwgbWxtQXNzb2NDbmYucHJvdFN0YXR1c0NvZGUscHNlc3Npb25FbnRyeSk7IAorICAgIH0KKworICAgIC8qIENSOiB2b3MgcGFja2V0IG1lbW9yeSBpcyBsZWFrZWQgd2hlbiBhc3NvYyByc3AgdGltZW91dGVkL2ZhaWxlZC4gKi8KKyAgICAvKiBub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LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYWluQm9keVsyNTZdOworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgIGZyYW1lTGVuOworICAgIC8vdEFOSV9VMzIgICAgICAgICAgICAgICAgYXV0aFJzcFRpbWVvdXQsIG1heE51bVByZUF1dGgsIHZhbDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICBtYXhOdW1QcmVBdXRoLCB2YWw7CisgICAgdFNpck1hY0F1dGhGcmFtZUJvZHkgICAgKnBSeEF1dGhGcmFtZUJvZHksIHJ4QXV0aEZyYW1lLCBhdXRoRnJhbWU7CisgICAgdHBTaXJNYWNNZ210SGRyICAgICAgICAgcEhkcjsKKyAgICB0Q2ZnV2VwS2V5RW50cnkgICAgICAgICAqcEtleU1hcEVudHJ5ID0gTlVMTDsKKyAgICBzdHJ1Y3QgdExpbVByZUF1dGhOb2RlICAqcEF1dGhOb2RlOworICAgIHRMaW1NbG1BdXRoSW5kICAgICAgICAgIG1sbUF1dGhJbmQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgZGVjcnlwdFJlc3VsdDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAqcENoYWxsZW5nZTsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICBrZXlfbGVuZ3RoPTg7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgY2hhbGxlbmdlVGV4dEFycmF5W1NJUl9NQUNfQVVUSF9DSEFMTEVOR0VfTEVOR1RIXTsKKyAgICB0cERwaEhhc2hOb2RlICAgICAgICAgICBwU3RhRHMgPSBOVUxMOworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgIGFzc29jSWQgPSAwOworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgIGN1cnJTZXFObyA9IDA7CisgICAgLyogQWRkZWQgRm9yIEJUIC1BTVAgc3VwcG9ydCAqLworICAgIC8vIEdldCBwb2ludGVyIHRvIEF1dGhlbnRpY2F0aW9uI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TEVBTl9GQUxTRSk7CisgICAgfQorICAgCisgICAgLy8vIERldGVybWluZSBpZiBXRVAgYml0IGlzIHNldCBpbiB0aGUgRkMgb3IgcmVjZWl2ZWQgTUFDIGhlYWRlcgorICAgIGlmIChwSGRyLT5mYy53ZXApCisgICAgeworICAgICAgICAvKioKKyAgICAgICAgICogV0VQIGJpdCBpcyBzZXQgaW4gRkMgb2YgTUFDIGhlYWRlci4KKyAgICAgICAgICovCisKKyAgICAgICAgLy8gSWYgVEtJUCBjb3VudGVyIG1lYXN1cmVzIGVuYWJsZWQgaXNzdWUgRGVhdXRoIGZyYW1lIHRvIHN0YXRpb24KKyAgICAgICAgaWYgKChwc2Vzc2lvbkVudHJ5LT5iVGtpcENudHJNZWFzQWN0aXZlKSAmJiAocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0FQX1JPTEUpKQorICAgICAgICB7CisgICAgICAgICAgICBQRUxPR0UoIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgRkwoIlRraXAgY291bnRlciBtZWFzdXJlcyBFbmFibGVkLCBzZW5kaW5nIERlYXV0aCBmcmFtZSB0byIpKTsgKQorICAgICAgICAgICAgbGltUHJpbnRNYWNBZGRyKHBNYWMsIHBIZHItPnNhLCBMT0dFKTsKKworICAgICAgICAgICAgbGltU2VuZERlYXV0aE1nbXRGcmFtZSggcE1hYywgZVNJUl9NQUNfTUlDX0ZBSUxVUkVfUkVBU09OLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EsIHBzZXNzaW9uRW50cnksIEZBTFNFICk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICAvLyBFeHRyYWN0IGtleSBJRCBmcm9tIElWIChtb3N0IDIgYml0cyBvZiA0dGggYnl0ZSBvZiBJVikKKworICAgICAgICBrZXlJZCA9ICgqKHBCb2R5ICsgMykpID4+IDY7CisKKyAgICAgICAgLyoqCisgICAgIC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CBMT0dFLAorICAgICAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBBdXRoZW50aWNhdGlvbiBmcmFtZSB3aXRoIHdlcCBiaXQgc2V0IG9uICIKKyAgICAgICAgICAgICAgICAgICAicm9sZT0lZCAiTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlLCBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkgKTspCisgICAgICAgICAgICBsaW1TZW5kQXV0aE1nbXRGcmFtZShwTWFjLCAmYXV0aEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMSU1fTk9fV0VQX0lOX0ZDLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSwgZVNJUl9GQUxTRSk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBpZiAoZnJhbWVMZW4gPCBMSU1fRU5DUl9BVVRIX0JPRFlfTEVOKQorICAgICAgICB7CisgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgIEZMKCJOb3QgZW5vdWdoIHNpemUgWyVkXSB0byBkZWNyeXB0IHJlY2VpdmVkIEF1dGggZnJhbWUiKSwKKyAgICAgICAgICAgICAgICAgICBmcmFtZUxlbik7CisgICAgICAgICAgICBsaW1QcmludE1hY0FkZHIocE1hYywgcEhkci0+c2EsIExPR0UpOworCisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0FQX1JPTEUpCisgICAgICAgIHsKKyAgICAgICAgICAgIHZhbCA9IHBzZXNzaW9uRW50cnktPnByaXZhY3k7IAorICAgICAgICB9IAorICAgICAgICBlbHNlIAorICAgICAgICAvLyBBY2NlcHQgQXV0aGVudGljYXRpb24gZnJhbWUgb25seSBpZiBQcml2YWN5IGlzIGltcGxlbWVudGVkCisgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX1BSSVZBQ1lfRU5BQkxFRCwKKyAgICAgICAgICAgICAgICAgICAgICAmdmFsKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogQ291bGQgbm90IGdldCBQcml2YWN5IG9wdGlvbgorICAgICAgICAgICAgICogZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgUHJpdmFjeSBvcHRpb24iKSk7CisgICAgICAgIH0KKworICAgICAgICBjZmdQcml2YWN5T3B0SW1wID0gKHRBTklfVTgpdmFsOworICAgICAgICBpZiAoY2ZnUHJpdmFjeU9wdEltcCkKKyAgICAgICAgeworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBQcml2YWN5IG9wdGlvbiBpcyBpbXBsZW1lbnRlZC4KKyAgICAgICAgICAgICAqIENoZWNrIGlmIHRoZSByZWNlaXZlZCBmcmFtZSBpcyBBdXRoZW50aWNhdGlvbgorICAgICAgICAgICAgICogZnJhbWUzIGFuZCB0aGVyZSBpcyBhIGNvbnRleHQgZm9yIHJlcXVlc3RpbmcgU1RBLgorICAgICAgICAgICAgICogSWYgbm90LCByZWplY3Qgd2l0aCB1bnNwZWNpZmllZCBmYWlsdXJlIHN0YXR1cyBjb2RlCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHBBdXRoTm9kZSA9IGxpbVNlYXJjaFByZUF1dGhMaXN0KHBNYWMsIHBIZHItPnNhKTsKKworICAgICAgICAgICAgaWYgKHBBdXRoTm9kZSA9PSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIEF1dGhlbnRpY2F0aW9uIGZyYW1lIGZyb20gcGVlciB0aGF0IGhhcyAiCisgICAgICAgICAgICAgICAgICAgICAgICJubyBwcmVhdXRoIGNvbnRleHQgd2l0aCBXRVAgYml0IHNldCAiTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTspCisKKyAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgKiBObyAncHJlLWF1dGgnIGNvbnRleHQgZXhpc3RzIGZvciB0aGlzIFNUQSB0aGF0IHNlbnQKKyAgICAgICAgICAgICAgICAgKiBhbiBBdXRoZW50aWNhdGlvbiBmcmFtZSB3aXRoIEZDIGJpdCBzZXQuCisgICAgICAgICAgICAgICAgICogU2VuZCBBdXRoIGZyYW1lNCB3aXRoICdvdXQgb2Ygc2VxdWVuY2UnIHN0YXR1cyBjb2RlLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoQWxnb051bWJlciA9IGVTSVJfU0hBUkVEX0tFWTsKKyAgICAgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aFRyYW5zYWN0aW9uU2VxTnVtYmVyID0KKyAgICAgICAgICAgICAgICBTSVJfTUFDX0FVVEhfRlJBTUVfNDsKKyAgICAgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aFN0YXR1c0NvZGUgPQorICAgICAgICAgICAgICAgIGVTSVJfTUFDX0FVVEhfRlJBTUVfT1VUX09GX1NFUV9TVEFUVVM7CisKKyAgICAgICAgICAgICAgICBsaW1TZW5kQXV0aE1nbXRGcmFtZShwTWFjLCAmYXV0aEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExJTV9OT19XRVBfSU5fRkMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSwgZVNJUl9GQUxTRSk7CisKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8vIENoYW5nZSB0aGUgYXV0aC1yZXNwb25zZSB0aW1lb3V0CisgICAgICAgICAgICAgICAgbGltRGVhY3RpdmF0ZUFuZENoYW5nZVBlclN0YUlkVGltZXIocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlTElNX0FVVEhfUlNQX1RJTUVSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBdXRoTm9kZS0+YXV0aE5vZGVJZHgpOworCisgICAgICAgICAgICAgICAgLy8vICdQcmUtYXV0aCcgc3RhdHVzIGV4aXN0cyBmb3IgU1RBCisgICAgICAgICAgICAgICAgaWYgKChwQXV0aE5vZGUtPm1sbVN0YXRlICE9CisgICAgICAgICAgICAgICAgICAgICBlTElNX01MTV9XVF9BVVRIX0ZSQU1FM19TVEFURSkgJiYKKyAgICAgICAgICAgICAgICAgICAgKHBBdXRoTm9kZS0+bWxtU3RhdGUgIT0KKyAgICAgICAgICAgICAgICAgICAgIGVMSU1fTUxNX0FVVEhfUlNQX1RJTUVPVVRfU1RBVEUpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBBdXRoZW50aWNhdGlvbiBmcmFtZSBmcm9tIHBlZXIgdGhhdCBpcyAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiaW4gc3RhdGUgJWQgIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEF1dGhOb2RlLT5tbG1TdGF0ZSwgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTspCisKKyAgICAgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICAgICAqIFNob3VsZCBub3QgaGF2ZSByZWNlaXZlZCBBdXRoZW50aWNhdGlvbiBmcmFtZQorICAgICAgICAgICAgICAgICAgICAgKiB3aXRoIFdFUCBiaXQgc2V0IGluIEZDIGluIG90aGVyIHN0YXRlcy4KKyAgICAgICAgICAgICAgICAgICAgICogUmVqZWN0IGJ5IHNlbmRpbmcgQXV0aGVudGljYXRvbiBmcmFtZSB3aXRoCisgICAgICAgICAgICAgICAgICAgICAqIG91dCBvZiBzZXF1ZW5jZSBBdXRoIGZyYW1lIHN0YXR1cyBjb2RlLgorICAgICAgICAgICAgICAgICAgICAgKi8KKworICAgICAgICAgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aEFsZ29OdW1iZXIgPSBlU0lSX1NIQVJFRF9LRVk7CisgICAgICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoVHJhbnNhY3Rpb25TZXFOdW1iZXIgPQorICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX0FVVEhfRlJBTUVfNDsKKyAgICAgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhTdGF0dXNDb2RlID0KKyAgICAgICAgICAgICAgICAgICAgZVNJUl9NQUNfQVVUSF9GUkFNRV9PVVRfT0ZfU0VRX1NUQVRVUzsKKworICAgICAgICAgICAgICAgICAgICBsaW1TZW5kQXV0aE1nbXRGcmFtZShwTWFjLCAmYXV0aEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRyLT5zYSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTElNX05PX1dFUF9JTl9GQywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSwgZVNJUl9GQUxTRSk7CisKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBDaGVjayBpZiB0aGVyZSBleGlzdHMgYSBrZXkgbWFwcHBpbmcga2V5CisgICAgICAgICAgICAgKiBmb3IgdGhlIFNUQSB0aGF0IHNlbnQgQXV0aGVudGljYXRpb24gZnJhbWUKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcEtleU1hcEVudHJ5ID0gbGltTG9va1VwS2V5TWFwcGluZ3MocEhkci0+c2EpOworCisgICAgICAgICAgICBpZiAocEtleU1hcEVudHJ5KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICghcEtleU1hcEVudHJ5LT53ZXBPbikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgicmVjZWl2ZWQgQXV0aCBmcmFtZTMgZnJvbSBwZWVyIHRoYXQgaGFzIE5VTEwgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgImtleSBtYXAgZW50cnkgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJFU1NfU1RSKSxNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOykKKworICAgICAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgICAgICogS2V5IE1hcHBpbmcgZW50cnkgaGFzIG51bGwga2V5LgorICAgICAgICAgICAgICAgICAgICAgKiBTZW5kIEF1dGhlbnRpY2F0aW9uIGZyYW1lCisgICAgICAgICAgICAgICAgICAgICAqIHdpdGggY2hhbGxlbmdlIGZhaWx1cmUgc3RhdHVzIGNvZGUKKyAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoQWxnb051bWJlciA9IGVTSVJfU0hBUkVEX0tFWTsKKyAgICAgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhUcmFuc2FjdGlvblNlcU51bWJlciA9CisgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfQVVUSF9GUkFNRV80OworICAgICAgICAgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aFN0YXR1c0NvZGUgPQorICAgICAgICAgICAgICAgICAgICBlU0lSX01BQ19DSEFMTEVOR0VfRkFJTFVSRV9TVEFUVVM7CisKKyAgICAgICAgICAgICAgICAgICAgbGltU2VuZEF1dGhNZ210RnJhbWUocE1hYywgJmF1dGhGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExJTV9OT19XRVBfSU5fRkMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnksIGVTSVJfRkFMU0UpOworCisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9IC8vIGlmICghcEtleU1hcEVudHJ5LT53ZXBPbikKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBkZWNyeXB0UmVzdWx0ID0gbGltRGVjcnlwdEF1dGhGcmFtZShwTWFjLCBwS2V5TWFwRW50cnktPmtleSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJvZHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYWluQm9keSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5X2xlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTE2KSAoZnJhbWVMZW4tU0lSX01BQ19XRVBfSVZfTEVOR1RIKSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChkZWNyeXB0UmVzdWx0ID09IExJTV9ERUNSWVBUX0lDVl9GQUlMKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLy8gSUNWIGZhaWx1cmUKKyAgICAgICAgICAgICAgICAgICAgICAgIFBFTE9HVyhsaW1Mb2cocE1hYywgTE9HVywgRkwoIj09PT09PiBkZWNyeXB0UmVzdWx0ID09ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICJMSU1fREVDUllQVF9JQ1ZfRkFJTCAuLi4iKSk7KQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIEF1dGhlbnRpY2F0aW9uIGZyYW1lIGZyb20gcGVlciAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInRoYXQgZmFpbGVkIGRlY3J5cHRpb24sIEFkZHIgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSRVNTX1NUUiksIE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSk7KQorCisgICAgICAgICAgICAgICAgICAgICAgICBsaW1EZWxldGVQcmVBdXRoTm9kZShwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EpOworICAgICAgICAgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhBbGdvTnVtYmVyID0gZVNJUl9TSEFSRURfS0VZOworICAgICAgICAgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhUcmFuc2FjdGlvblNlcU51bWJlciA9CisgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX0FVVEhfRlJBTUVfNDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoU3RhdHVzQ29kZSA9CisgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX01BQ19DSEFMTEVOR0VfRkFJTFVSRV9TVEFUVVM7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbVNlbmRBdXRoTWdtdEZyYW1lKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLCAmYXV0aEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRyLT5zYSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTElNX05PX1dFUF9JTl9GQywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSwgZVNJUl9GQUxTRSk7CisKKworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKCAoIHNpckNvbnZlcnRBdXRoRnJhbWUyU3RydWN0KHBNYWMsIHBsYWluQm9keSwgZnJhbWVMZW4tOCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAmcnhBdXRoRnJhbWUpIT1lU0lSX1NVQ0NFU1MgKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICggIWlzQXV0aFZhbGlkKHBNYWMsICZyeEF1dGhGcmFtZSxwc2Vzc2lvbkVudHJ5KSApICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJmYWlsZWQgdG8gY29udmVydCBBdXRoIEZyYW1lIHRvIHN0cnVjdHVyZSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm9yIEF1dGggaXMgbm90IHZhbGlkICIpKTspCisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKworCisgICAgICAgICAgICAgICAgfSAvLyBlbmQgaWYgKHBLZXlNYXBFbnRyeS0+a2V5ID09IE5VTEwpCisgICAgICAgICAgICB9IC8vIGlmIGtleU1hcHBpbmdzIGhhcyBlbnRyeQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworCisgICAgICAgICAgICAgICAgdmFsID0gU0lSX01BQ19LRVlfTEVOR1RIOworCisgICAgICAgICAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0FQX1JPTEUpCisgICAgICAgICAgICAgICAgeyAgIAorICAgICAgICAgICAgICAgICAgICB0cFNpcktleXMgcEtleTsKKyAgICAgICAgICAgICAgICAgICAgcEtleSA9ICAmcHNlc3Npb25FbnRyeS0+V0VQS2V5TWF0ZXJpYWxba2V5SWRdLmtleVswXTsgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoZGVmYXVsdEtleSwgcEtleS0+a2V5LCBwS2V5LT5rZXlMZW5ndGgpOworICAgICAgICAgICAgICAgICAgICB2YWwgPSBwS2V5LT5rZXlMZW5ndGg7CisgICAgICAgICAgICAgICAgfSAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBlbHNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgaWYgKHdsYW5fY2ZnR2V0U3RyKHBNYWMsICh0QU5JX1UxNikgKFdOSV9DRkdfV0VQX0RFRkFVTFRfS0VZXzEgKyBrZXlJZCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0S2V5LCAmdmFsKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvLy8gQ291bGQgbm90IGdldCBEZWZhdWx0IGtleSBmcm9tIENGRy4KKyAgICAgICAgICAgICAgICAgICAgLy9Mb2cgZXJyb3IuCisgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBEZWZhdWx0IGtleSIpKTsKKworICAgICAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgICAgICogU2VuZCBBdXRoZW50aWNhdGlvbiBmcmFtZQorICAgICAgICAgICAgICAgICAgICAgKiB3aXRoIGNoYWxsZW5nZSBmYWlsdXJlIHN0YXR1cyBjb2RlCisgICAgICAgICAgICAgICAgICAgICAqLworCisgICAgICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoQWxnb051bWJlciA9IGVTSVJfU0hBUkVEX0tFWTsKKyAgICAgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhUcmFuc2FjdGlvblNlcU51bWJlciA9CisgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfQVVUSF9GUkFNRV80OworICAgICAgICAgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aFN0YXR1c0NvZGUgPQorICAgICAgICAgICAgICAgICAgICBlU0lSX01BQ19DSEFMTEVOR0VfRkFJTFVSRV9TVEFUVVM7CisKKyAgICAgICAgICAgICAgICAgICAgbGltU2VuZEF1dGhNZ210RnJhbWUocE1hYywgJmF1dGhGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExJTV9OT19XRVBfSU5fRkMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnksIGVTSVJfRkFMU0UpOworCisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAga2V5X2xlbmd0aD12YWw7CisKKyAgICAgICAgICAgICAgICAgICAgZGVjcnlwdFJlc3VsdCA9IGxpbURlY3J5cHRBdXRoRnJhbWUocE1hYywgZGVmYXVsdEtleSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJvZHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYWluQm9keSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5X2xlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTE2KSAoZnJhbWVMZW4tU0lSX01BQ19XRVBfSVZfTEVOR1RIKSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChkZWNyeXB0UmVzdWx0ID09IExJTV9ERUNSWVBUX0lDVl9GQUlMKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBQRUxPR1cobGltTG9nKHBNYWMsIExPR1csIEZMKCI9PT09PT4gZGVjcnlwdFJlc3VsdCA9PSAiCisgICAgICAgICAgICAgICAgICAgICAgICAiTElNX0RFQ1JZUFRfSUNWX0ZBSUwgLi4uIikpOykKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBBdXRoZW50aWNhdGlvbiBmcmFtZSBmcm9tIHBlZXIgdGhhdCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImZhaWxlZCBkZWNyeXB0aW9uOiAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJFU1NfU1RSKSwgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTspCisgICAgICAgICAgICAgICAgICAgICAgICAvLy8gSUNWIGZhaWx1cmUKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbURlbGV0ZVByZUF1dGhOb2RlKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRyLT5zYSk7CisgICAgICAgICAgICAgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aEFsZ29OdW1iZXIgPSBlU0lSX1NIQVJFRF9LRVk7CisgICAgICAgICAgICAgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aFRyYW5zYWN0aW9uU2VxTnVtYmVyID0KKyAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfQVVUSF9GUkFNRV80OworICAgICAgICAgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhTdGF0dXNDb2RlID0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfTUFDX0NIQUxMRU5HRV9GQUlMVVJFX1NUQVRVUzsKKworICAgICAgICAgICAgICAgICAgICAgICAgbGltU2VuZEF1dGhNZ210RnJhbWUoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMsICZhdXRoRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMSU1fTk9fV0VQX0lOX0ZDLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LCBlU0lSX0ZBTFNFKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmICggKCBzaXJDb252ZXJ0QXV0aEZyYW1lMlN0cnVjdChwTWFjLCBwbGFpbkJvZHksIGZyYW1lTGVuLTgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmcnhBdXRoRnJhbWUpIT1lU0lSX1NVQ0NFU1MgKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgKCAhaXNBdXRoVmFsaWQocE1hYywgJnJ4QXV0aEZyYW1lLCBwc2Vzc2lvbkVudHJ5KSApICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoImZhaWxlZCB0byBjb252ZXJ0IEF1dGggRnJhbWUgdG8gc3RydWN0dXJlICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3IgQXV0aCBpcyBub3QgdmFsaWQgIikpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IC8vIEVuZCBvZiBjaGVjayBmb3IgS2V5IE1hcHBpbmcvRGVmYXVsdCBrZXkgcHJlc2VuY2UKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBBdXRoZW50aWNhdGlvbiBmcmFtZTMgZnJvbSBwZWVyIHRoYXQgd2hpbGUgIgorICAgICAgICAgICAgICAgICAgICJwcml2YWN5IG9wdGlvbiBpcyB0dXJuZWQgT0ZGICIKKyAgICAgICAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIpLCBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOykKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogUHJpdmFjeSBvcHRpb24gaXMgbm90IGltcGxlbWVudGVkLgorICAgICAgICAgICAgICogU28gcmVqZWN0IEF1dGhlbnRpY2F0aW9uIGZyYW1lIHJlY2VpdmVkIHdpdGgKKyAgICAgICAgICAgICAqIFdFUCBiaXQgc2V0IGJ5IHNlbmRpbmcgQXV0aGVudGljYXRpb24gZnJhbWUKKyAgICAgICAgICAgICAqIHdpdGggJ2NoYWxsZW5nZSBmYWlsdXJlJyBzdGF0dXMgY29kZS4gVGhpcyBpcworICAgICAgICAgICAgICogYW5vdGhlciBzdHJhbmdlIHRoaW5nIGluIHRoZSBzcGVjLiBTdGF0dXMgY29kZQorICAgICAgICAgICAgICogc2hvdWxkIGhhdmUgYmVlbiAndW5zdXBwb3J0ZWQgYWxnb3JpdGhtJyBzdGF0dXMgY29kZS4KKyAgICAgICAgICAgICAqLworCisgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aEFsZ29OdW1iZXIgPSBlU0lSX1NIQVJFRF9LRVk7CisgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aFRyYW5zYWN0aW9uU2VxTnVtYmVyID0KKyAgICAgICAgICAgIFNJUl9NQUNfQVVUSF9GUkFNRV80OworICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhTdGF0dXNDb2RlID0KKyAgICAgICAgICAgIGVTSVJfTUFDX0NIQUxMRU5HRV9GQUlMVVJFX1NUQVRVUzsKKworICAgICAgICAgICAgbGltU2VuZEF1dGhNZ210RnJhbWUocE1hYywgJmF1dGhGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTElNX05PX1dFUF9JTl9GQywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnksIGVTSVJfRkFMU0UpOworCisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0gLy8gZWxzZSBpZiAod2xhbl9jZmdHZXRJbnQoQ0ZHX1BSSVZBQ1lfT1BUSU9OX0lNUExFTUVOVEVEKSkKKyAgICB9IC8vIGlmIChmYy53ZXApCisgICAgZWxzZQorICAgIHsKKworCisgICAgICAgIGlmICggKCBzaXJDb252ZXJ0QXV0aEZyYW1lMlN0cnVjdChwTWFjLCBwQm9keSwKKyAgICAgICAgICAgIGZyYW1lTGVuLCAmcnhBdXRoRnJhbWUpIT1lU0lSX1NVQ0NFU1MgKSB8fAorICAgICAgICAgICAgKCAhaXNBdXRoVmFsaWQocE1hYywgJnJ4QXV0aEZyYW1lLHBzZXNzaW9uRW50cnkpICkgKQorICAgICAgICB7CisgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgRkwoImZhaWxlZCB0byBjb252ZXJ0IEF1dGggRnJhbWUgdG8gc3RydWN0dXJlIG9yIEF1dGggaXMgIgorICAgICAgICAgICAgICAgICAgICJub3QgdmFsaWQgIikpOykKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgIH0KKworCisgICAgcFJ4QXV0aEZyYW1lQm9keSA9ICZyeEF1dGhGcmFtZTsKKworICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICBGTCgiUmVjZWl2ZWQgQXV0aCBmcmFtZSB3aXRoIHR5cGU9JWQgc2VxbnVtPSVkLCBzdGF0dXM9JWQgKCVkKSIpLAorICAgICAgICAgICAodEFOSV9VMzIpIHBSeEF1dGhGcmFtZUJvZHktPmF1dGhBbGdvTnVtYmVyLAorICAgICAgICAgICAodEFOSV9VMzIpIHBSeEF1dGhGcmFtZUJvZHktPmF1dGhUcmFuc2FjdGlvblNlcU51bWJlciwKKyAgICAgICAgICAgKHRBTklfVTMyKSBwUnhBdXRoRnJhbWVCb2R5LT5hdXRoU3RhdHVzQ29kZSwodEFOSV9VMzIpcE1hYy0+bGltLmdMaW1OdW1QcmVBdXRoQ29udGV4dHMpOykKKworICAgIHN3aXRjaCAocFJ4QXV0aEZyYW1lQm9keS0+YXV0aFRyYW5zYWN0aW9uU2VxTnVtYmVyKQorICAgIHsKKyAgICAgICAgY2FzZSBTSVJfTUFDX0FVVEhfRlJBTUVfMToKKyAgICAgICAgICAgIC8vIEF1dGhGcmFtZSAxCisgICAgICAgICAgICAKKyAgICAgICAgICAgIHBTdGFEcyA9IGRwaExvb2t1cEhhc2hFbnRyeShwTWFjLCBwSGRyLT5zYSwKKyAgICAgICAgICAgICAgICAgICAgJmFzc29jSWQsICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsKKyAgICAgICAgICAgIGlmIChwU3RhRHMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdExpbU1sbURpc2Fzc29jUmVxICAgICAgKnBNbG1EaXNhc3NvY1JlcSA9IE5VTEw7CisgICAgICAgICAgICAgICAgdExpbU1sbURlYXV0aFJlcSAgICAgICAgKnBNbG1EZWF1dGhSZXEgPSBOVUxMOworICAgICAgICAgICAgICAgIHRBbmlCb29sICAgICAgICAgICAgICAgICBpc0Nvbm5lY3RlZCA9IGVTSVJfVFJVRTsKKworICAgICAgICAgICAgICAgIHBNbG1EaXNhc3NvY1JlcSA9IHBNYWMtPmxpbS5saW1EaXNhc3NvY0RlYXV0aENuZlJlcS5wTWxtRGlzYXNzb2NSZXE7CisgICAgICAgICAgICAgICAgaWYgKHBNbG1EaXNhc3NvY1JlcSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgKHZvc19tZW1fY29tcGFyZSgodEFOSV9VOCAqKSBwSGRyLT5zYSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTggKikgJnBNbG1EaXNhc3NvY1JlcS0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJUT0RPOkFjayBmb3IgZGlzYXNzb2MgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZnJhbWUgaXMgcGVuZGluZyBJc3N1ZSBkZWxzdGEgZm9yICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocE1sbURpc2Fzc29jUmVxLT5wZWVyTWFjQWRkcikpOykKKyAgICAgICAgICAgICAgICAgICAgbGltUHJvY2Vzc0Rpc2Fzc29jQWNrVGltZW91dChwTWFjKTsKKyAgICAgICAgICAgICAgICAgICAgaXNDb25uZWN0ZWQgPSBlU0lSX0ZBTFNFOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwTWxtRGVhdXRoUmVxID0gcE1hYy0+bGltLmxpbURpc2Fzc29jRGVhdXRoQ25mUmVxLnBNbG1EZWF1dGhSZXE7CisgICAgICAgICAgICAgICAgaWYgKHBNbG1EZWF1dGhSZXEgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICh2b3NfbWVtX2NvbXBhcmUoKHRBTklfVTggKikgcEhkci0+c2EsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopICZwTWxtRGVhdXRoUmVxLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSkpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiVE9ETzpBY2sgZm9yIGRlYXV0aCBmcmFtZSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpcyBwZW5kaW5nIElzc3VlIGRlbHN0YSBmb3IgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwTWxtRGVhdXRoUmVxLT5wZWVyTWFjQWRkcikpOykKKyAgICAgICAgICAgICAgICAgICAgbGltUHJvY2Vzc0RlYXV0aEFja1RpbWVvdXQocE1hYyk7CisgICAgICAgICAgICAgICAgICAgIGlzQ29ubmVjdGVkID0gZVNJUl9GQUxTRTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvKiBwU3RhRFMgIT0gTlVMTCBhbmQgaXNDb25uZWN0ZWQgPSAxIG1lYW5zIHRoZSBTVEEgaXMgYWxyZWFkeQorICAgICAgICAgICAgICAgICAqIGNvbm5lY3RlZCwgQnV0IFNBUCByZWNlaXZlZCB0aGUgQXV0aCBmcm9tIHRoYXQgc3RhdGlvbi4KKyAgICAgICAgICAgICAgICAgKiBGb3Igbm9uIFBNRiBjb25uZWN0aW9uIHNlbmQgRGVhdXRoIGZyYW1lIGFzIFNUQSB3aWxsIHJldHJ5CisgICAgICAgICAgICAgICAgICogdG8gY29ubmVjdCBiYWNrLgorICAgICAgICAgICAgICAgICAqCisgICAgICAgICAgICAgICAgICogRm9yIFBNRiBjb25uZWN0aW9uIHRoZSBBUCBzaG91bGQgbm90IHRlYXIgZG93biBvciBvdGhlcndpc2UKKyAgICAgICAgICAgICAgICAgKiBtb2RpZnkgdGhlIHN0YXRlIG9mIHRoZSBleGlzdGluZyBhc3NvY2lhdGlvbiB1bnRpbCB0aGUKKyAgICAgICAgICAgICAgICAgKiBTQS1RdWVyeSBwcm9jZWR1cmUgZGV0ZXJtaW5lcyB0aGF0IHRoZSBvcmlnaW5hbCBTQSBpcworICAgICAgICAgICAgICAgICAqIGludmFsaWQuCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgaWYgKGlzQ29ubmVjdGVkCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgICAgICAgICAgICAgICAgICAmJiAhcFN0YURzLT5ybWZFbmFibGVkCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJTVEEgaXMgYWxyZWFkeSBjb25uZWN0ZWQgYnV0IHJlY2VpdmVkIGF1dGggZnJhbWUiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJTZW5kIHRoZSBEZWF1dGggYW5kIGxpbSBEZWxldGUgU3RhdGlvbiBDb250ZXh0IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKHN0YUlkOiAlZCwgYXNzb2NJZDogJWQpICIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+c3RhSW5kZXgsIGFzc29jSWQpOworICAgICAgICAgICAgICAgICAgICBsaW1TZW5kRGVhdXRoTWdtdEZyYW1lKHBNYWMsIGVTSVJfTUFDX1VOU1BFQ19GQUlMVVJFX1JFQVNPTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSBwSGRyLT5zYSwgcHNlc3Npb25FbnRyeSwgRkFMU0UpOworICAgICAgICAgICAgICAgICAgICBsaW1UcmlnZ2VyU1RBZGVsZXRpb24ocE1hYywgcFN0YURzLCBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8vIENoZWNrIGlmIHRoZXJlIGV4aXN0cyBwcmUtYXV0aCBjb250ZXh0IGZvciB0aGlzIFNUQQorICAgICAgICAgICAgcEF1dGhOb2RlID0gbGltU2VhcmNoUHJlQXV0aExpc3QocE1hYywgcEhkci0+c2EpOworICAgICAgICAgICAgaWYgKHBBdXRoTm9kZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLy8gUHJlLWF1dGggY29udGV4dCBleGlzdHMgZm9yIHRoZSBTVEEKKyAgICAgICAgICAgICAgICBpZiAocEhkci0+ZmMucmV0cnkgPT0gMCB8fCBwQXV0aE5vZGUtPnNlcU5vICE9IGN1cnJTZXFObykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgKiBTVEEgaXMgaW5pdGlhdGluZyBicmFuZC1uZXcgQXV0aGVudGljYXRpb24KKyAgICAgICAgICAgICAgICAgICAgICogc2VxdWVuY2UgYWZ0ZXIgbG9jYWwgQXV0aCBSZXNwb25zZSB0aW1lb3V0LgorICAgICAgICAgICAgICAgICAgICAgKiBPciBTVEEgcmV0cnlpbmcgdG8gdHJhbnNtaXQgRmlyc3QgQXV0aCBmcmFtZSBkdWUgdG8gcGFja2V0IGRyb3AgT1RBCisgICAgICAgICAgICAgICAgICAgICAqIERlbGV0ZSBQcmUtYXV0aCBub2RlIGFuZCBmYWxsIHRocm91Z2guCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBpZihwQXV0aE5vZGUtPmZUaW1lclN0YXJ0ZWQpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbURlYWN0aXZhdGVBbmRDaGFuZ2VQZXJTdGFJZFRpbWVyKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUxJTV9BVVRIX1JTUF9USU1FUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQXV0aE5vZGUtPmF1dGhOb2RlSWR4KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJTVEEgaXMgaW5pdGlhdGluZyBicmFuZC1uZXcgIgorICAgICAgICAgICAgICAgICAgICAiQXV0aGVudGljYXRpb24gLi4uIikpOykKKyAgICAgICAgICAgICAgICAgICAgbGltRGVsZXRlUHJlQXV0aE5vZGUocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EpOworICAgICAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgICAgICogIFNBUCBNb2RlOkRpc2Fzc29jaWF0ZSB0aGUgc3RhdGlvbiBhbmQgCisgICAgICAgICAgICAgICAgICAgICAqICBkZWxldGUgaXRzIGVudHJ5IGlmIHdlIGhhdmUgaXRzIGVudHJ5IAorICAgICAgICAgICAgICAgICAgICAgKiAgYWxyZWFkeSBhbmQgcmVjZWl2ZWQgImF1dGgiIGZyb20gdGhlIAorICAgICAgICAgICAgICAgICAgICAgKiAgc2FtZSBzdGF0aW9uLgorICAgICAgICAgICAgICAgICAgICAgKi8gIAorCisgICAgICAgICAgICAgICAgICAgIGZvciAoYXNzb2NJZCA9IDA7IGFzc29jSWQgPCBwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlLnNpemU7IGFzc29jSWQrKykvLyBTb2Z0YXAgZHBoSGFzaFRhYmxlLnNpemUgPSA4CisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcyA9IGRwaEdldEhhc2hFbnRyeShwTWFjLCBhc3NvY0lkLCAmcHNlc3Npb25FbnRyeS0+ZHBoLmRwaEhhc2hUYWJsZSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChOVUxMID09IHBTdGFEcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwU3RhRHMtPnZhbGlkKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodm9zX21lbV9jb21wYXJlKCh0QU5JX1U4ICopICZwU3RhRHMtPnN0YUFkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopICYocEhkci0+c2EpLCAodEFOSV9VOCkgKHNpemVvZih0U2lyTWFjQWRkcikpKSApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcyA9IE5VTEw7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoTlVMTCAhPSBwU3RhRHMKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcFN0YURzLT5ybWZFbmFibGVkCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJsaW0gRGVsZXRlIFN0YXRpb24gIgorICAgICAgICAgICAgICAgICAgICAgICAgIkNvbnRleHQgKHN0YUlkOiAlZCwgYXNzb2NJZDogJWQpICIpLHBTdGFEcy0+c3RhSW5kZXgsCisgICAgICAgICAgICAgICAgICAgICAgICBhc3NvY0lkKTspCisgICAgICAgICAgICAgICAgICAgICAgICBsaW1TZW5kRGVhdXRoTWdtdEZyYW1lKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9NQUNfVU5TUEVDX0ZBSUxVUkVfUkVBU09OLCAodEFOSV9VOCAqKSBwQXV0aE5vZGUtPnBlZXJNYWNBZGRyLCBwc2Vzc2lvbkVudHJ5LCBGQUxTRSk7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW1UcmlnZ2VyU1RBZGVsZXRpb24ocE1hYywgcFN0YURzLCBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiAKKyAgICAgICAgICAgICAgICAgICAgICogVGhpcyBjYW4gaGFwcGVuIHdoZW4gZmlyc3QgYXV0aGVudGljYXRpb24gZnJhbWUgaXMgcmVjZWl2ZWQKKyAgICAgICAgICAgICAgICAgICAgICogYnV0IEFDSyBsb3N0IGF0IFNUQSBzaWRlLCBpbiB0aGlzIGNhc2UgMm5kIGF1dGggZnJhbWUgaXMgYWxyZWFkeSAKKyAgICAgICAgICAgICAgICAgICAgICogaW4gdHJhbnNtaXNzaW9uIHF1ZXVlCisgICAgICAgICAgICAgICAgICAgICAqICovCisgICAgICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlNUQSBpcyBpbml0aWF0aW5nICIKKyAgICAgICAgICAgICAgICAgICAgIkF1dGhlbnRpY2F0aW9uIGFmdGVyIEFDSyBsb3N0Li4uIikpOykKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX01BWF9OVU1fUFJFX0FVVEgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1UzMiAqKSAmbWF4TnVtUHJlQXV0aCkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAqIENvdWxkIG5vdCBnZXQgTWF4TnVtUHJlQXV0aAorICAgICAgICAgICAgICAgICAqIGZyb20gQ0ZHLiBMb2cgZXJyb3IuCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgTWF4TnVtUHJlQXV0aCIpKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHBNYWMtPmxpbS5nTGltTnVtUHJlQXV0aENvbnRleHRzID09IG1heE51bVByZUF1dGggJiYKKyAgICAgICAgICAgICAgICAhbGltRGVsZXRlT3BlbkF1dGhQcmVBdXRoTm9kZShwTWFjKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJNYXggbnVtYmVyIG9mICIKKyAgICAgICAgICAgICAgICAgICAgInByZWF1dGggY29udGV4dCByZWFjaGVkIikpOykKKyAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgKiBNYXhpbXVtIG51bWJlciBvZiBwcmUtYXV0aCBjb250ZXh0cworICAgICAgICAgICAgICAgICAqIHJlYWNoZWQuIFNlbmQgQXV0aGVudGljYXRpb24gZnJhbWUKKyAgICAgICAgICAgICAgICAgKiB3aXRoIHVuc3BlY2lmaWVkIGZhaWx1cmUKKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aEFsZ29OdW1iZXIgPQorICAgICAgICAgICAgICAgIHBSeEF1dGhGcmFtZUJvZHktPmF1dGhBbGdvTnVtYmVyOworICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoVHJhbnNhY3Rpb25TZXFOdW1iZXIgPQorICAgICAgICAgICAgICAgIHBSeEF1dGhGcmFtZUJvZHktPmF1dGhUcmFuc2FjdGlvblNlcU51bWJlciArIDE7CisgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhTdGF0dXNDb2RlID0KKyAgICAgICAgICAgICAgICBlU0lSX01BQ19VTlNQRUNfRkFJTFVSRV9TVEFUVVM7CisKKyAgICAgICAgICAgICAgICBsaW1TZW5kQXV0aE1nbXRGcmFtZShwTWFjLCAmYXV0aEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExJTV9OT19XRVBfSU5fRkMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSwgZVNJUl9GQUxTRSk7CisKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLy8gTm8gUHJlLWF1dGggY29udGV4dCBleGlzdHMgZm9yIHRoZSBTVEEuCisgICAgICAgICAgICBpZiAobGltSXNBdXRoQWxnb1N1cHBvcnRlZCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBbmlBdXRoVHlwZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJ4QXV0aEZyYW1lQm9keS0+YXV0aEFsZ29OdW1iZXIsIHBzZXNzaW9uRW50cnkpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN3aXRjaCAocFJ4QXV0aEZyYW1lQm9keS0+YXV0aEFsZ29OdW1iZXIpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBjYXNlIGVTSVJfT1BFTl9TWVNURU06CisgICAgICAgICAgICAgICAgICAgICAgICBQRUxPR1cobGltTG9nKHBNYWMsIExPR1csIEZMKCI9PT09PT09PiBlU0lSX09QRU5fU1lTVEVNICAuLi4iKSk7KQorICAgICAgICAgICAgICAgICAgICAgICAgLy8vIENyZWF0ZSBlbnRyeSBmb3IgdGhpcyBTVEEgaW4gcHJlLWF1dGggbGlzdAorICAgICAgICAgICAgICAgICAgICAgICAgcEF1dGhOb2RlID0gbGltQWNxdWlyZUZyZWVQcmVBdXRoTm9kZShwTWFjLCAmcE1hYy0+bGltLmdMaW1QcmVBdXRoVGltZXJUYWJsZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAocEF1dGhOb2RlID09IE5VTEwpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJNYXggcHJlLWF1dGggbm9kZXMgcmVhY2hlZCAiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltUHJpbnRNYWNBZGRyKHBNYWMsIHBIZHItPnNhLCBMT0dXKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkFsbG9jIG5ldyBkYXRhOiBwZWVyICJNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgodEFOSV9VOCAqKSBwQXV0aE5vZGUtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRyLT5zYSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHBBdXRoTm9kZS0+bWxtU3RhdGUgPQorICAgICAgICAgICAgICAgICAgICAgICAgZUxJTV9NTE1fQVVUSEVOVElDQVRFRF9TVEFURTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBBdXRoTm9kZS0+YXV0aFR5cGUgPSAodEFuaUF1dGhUeXBlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSeEF1dGhGcmFtZUJvZHktPmF1dGhBbGdvTnVtYmVyOworICAgICAgICAgICAgICAgICAgICAgICAgcEF1dGhOb2RlLT5mU2VlbiA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICBwQXV0aE5vZGUtPmZUaW1lclN0YXJ0ZWQgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgcEF1dGhOb2RlLT5zZXFObyA9ICgocEhkci0+c2VxQ29udHJvbC5zZXFOdW1IaSA8PCA0KSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwSGRyLT5zZXFDb250cm9sLnNlcU51bUxvKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBwQXV0aE5vZGUtPnRpbWVzdGFtcCA9IHZvc190aW1lcl9nZXRfc3lzdGVtX3RpY2tzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW1BZGRQcmVBdXRoTm9kZShwTWFjLCBwQXV0aE5vZGUpOworCisgICAgICAgICAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIFNlbmQgQXV0aGVudGljYXRvbiBmcmFtZSB3aXRoIFN1Y2Nlc3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIHN0YXR1cyBjb2RlLgorICAgICAgICAgICAgICAgICAgICAgICAgICovCisKKyAgICAgICAgICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoQWxnb051bWJlciA9CisgICAgICAgICAgICAgICAgICAgICAgICBwUnhBdXRoRnJhbWVCb2R5LT5hdXRoQWxnb051bWJlcjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoVHJhbnNhY3Rpb25TZXFOdW1iZXIgPQorICAgICAgICAgICAgICAgICAgICAgICAgcFJ4QXV0aEZyYW1lQm9keS0+YXV0aFRyYW5zYWN0aW9uU2VxTnVtYmVyICsgMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoU3RhdHVzQ29kZSA9IGVTSVJfTUFDX1NVQ0NFU1NfU1RBVFVTOworICAgICAgICAgICAgICAgICAgICAgICAgbGltU2VuZEF1dGhNZ210RnJhbWUoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMsICZhdXRoRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMSU1fTk9fV0VQX0lOX0ZDLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LCBlU0lSX0ZBTFNFKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgLy8vIFNlbmQgQXV0aCBpbmRpY2F0aW9uIHRvIFNNRQorCisgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKikgbWxtQXV0aEluZC5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSBwSGRyLT5zYSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1sbUF1dGhJbmQuYXV0aFR5cGUgPSAodEFuaUF1dGhUeXBlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSeEF1dGhGcmFtZUJvZHktPmF1dGhBbGdvTnVtYmVyOworICAgICAgICAgICAgICAgICAgICAgICAgbWxtQXV0aEluZC5zZXNzaW9uSWQgPSBwc2Vzc2lvbkVudHJ5LT5zbWVTZXNzaW9uSWQ7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbVBvc3RTbWVNZXNzYWdlKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMSU1fTUxNX0FVVEhfSU5ELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTMyICopICZtbG1BdXRoSW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgICAgIGNhc2UgZVNJUl9TSEFSRURfS0VZOgorICAgICAgICAgICAgICAgICAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiPT09PT09PT4gZVNJUl9TSEFSRURfS0VZICAuLi4iKSk7KQorICAgICAgICAgICAgICAgICAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0FQX1JPTEUpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsID0gcHNlc3Npb25FbnRyeS0+cHJpdmFjeTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX1BSSVZBQ1lfRU5BQkxFRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnZhbCkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIENvdWxkIG5vdCBnZXQgUHJpdmFjeSBvcHRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBmcm9tIENGRy4gTG9nIGVycm9yLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiY291bGQgbm90IHJldHJpZXZlIFByaXZhY3kgb3B0aW9uIikpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgY2ZnUHJpdmFjeU9wdEltcCA9ICh0QU5JX1U4KXZhbDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY2ZnUHJpdmFjeU9wdEltcCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBBdXRoIGZyYW1lIGZvciB1bnN1cHBvcnRlZCBhdXRoIGFsZ29yaXRobSAlZCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSRVNTX1NUUiksIHBSeEF1dGhGcmFtZUJvZHktPmF1dGhBbGdvTnVtYmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOykKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIEF1dGhlbnRpY2F0b3IgZG9lcyBub3QgaGF2ZSBXRVAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBpbXBsZW1lbnRlZC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBSZWplY3QgYnkgc2VuZGluZyBBdXRoZW50aWNhdGlvbiBmcmFtZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHdpdGggQXV0aCBhbGdvcml0aG0gbm90IHN1cHBvcnRlZCBzdGF0dXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBjb2RlLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhBbGdvTnVtYmVyID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnhBdXRoRnJhbWVCb2R5LT5hdXRoQWxnb051bWJlcjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aFRyYW5zYWN0aW9uU2VxTnVtYmVyID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnhBdXRoRnJhbWVCb2R5LT5hdXRoVHJhbnNhY3Rpb25TZXFOdW1iZXIgKyAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoU3RhdHVzQ29kZSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9NQUNfQVVUSF9BTEdPX05PVF9TVVBQT1JURURfU1RBVFVTOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltU2VuZEF1dGhNZ210RnJhbWUoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLCAmYXV0aEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMSU1fTk9fV0VQX0lOX0ZDLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSwgZVNJUl9GQUxTRSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQ3JlYXRlIGVudHJ5IGZvciB0aGlzIFNUQQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vaW4gcHJlLWF1dGggbGlzdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBdXRoTm9kZSA9IGxpbUFjcXVpcmVGcmVlUHJlQXV0aE5vZGUocE1hYywgJnBNYWMtPmxpbS5nTGltUHJlQXV0aFRpbWVyVGFibGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwQXV0aE5vZGUgPT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJNYXggcHJlLWF1dGggbm9kZXMgcmVhY2hlZCAiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVByaW50TWFjQWRkcihwTWFjLCBwSGRyLT5zYSwgTE9HVyk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgodEFOSV9VOCAqKSBwQXV0aE5vZGUtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBdXRoTm9kZS0+bWxtU3RhdGUgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVMSU1fTUxNX1dUX0FVVEhfRlJBTUUzX1NUQVRFOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBdXRoTm9kZS0+YXV0aFR5cGUgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QW5pQXV0aFR5cGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJ4QXV0aEZyYW1lQm9keS0+YXV0aEFsZ29OdW1iZXI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEF1dGhOb2RlLT5mU2VlbiA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEF1dGhOb2RlLT5mVGltZXJTdGFydGVkID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQXV0aE5vZGUtPnNlcU5vID0gKChwSGRyLT5zZXFDb250cm9sLnNlcU51bUhpIDw8IDQpIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwSGRyLT5zZXFDb250cm9sLnNlcU51bUxvKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEF1dGhOb2RlLT50aW1lc3RhbXAgPSB2b3NfdGltZXJfZ2V0X3N5c3RlbV90aWNrcygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbUFkZFByZUF1dGhOb2RlKHBNYWMsIHBBdXRoTm9kZSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkFsbG9jIG5ldyBkYXRhOiBpZCAlZCBwZWVyICJNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEF1dGhOb2RlLT5hdXRoTm9kZUlkeCwgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vLyBDcmVhdGUgYW5kIGFjdGl2YXRlIEF1dGggUmVzcG9uc2UgdGltZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHhfdGltZXJfY2hhbmdlX2NvbnRleHQoJnBBdXRoTm9kZS0+dGltZXIsIHBBdXRoTm9kZS0+YXV0aE5vZGVJZHgpICE9IFRYX1NVQ0NFU1MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLy8gQ291bGQgbm90IHN0YXJ0IEF1dGggcmVzcG9uc2UgdGltZXIuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIlVuYWJsZSB0byBjaGcgY29udGV4dCBhdXRoIHJlc3BvbnNlIHRpbWVyIGZvciBwZWVyICIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltUHJpbnRNYWNBZGRyKHBNYWMsIHBIZHItPnNhLCBMT0dQKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogU2VuZCBBdXRoZW50aWNhdG9uIGZyYW1lIHdpdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogdW5zcGVjaWZpZWQgZmFpbHVyZSBzdGF0dXMgY29kZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhBbGdvTnVtYmVyID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnhBdXRoRnJhbWVCb2R5LT5hdXRoQWxnb051bWJlcjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhUcmFuc2FjdGlvblNlcU51bWJlciA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJ4QXV0aEZyYW1lQm9keS0+YXV0aFRyYW5zYWN0aW9uU2VxTnVtYmVyICsgMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhTdGF0dXNDb2RlID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX01BQ19VTlNQRUNfRkFJTFVSRV9TVEFUVVM7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltU2VuZEF1dGhNZ210RnJhbWUocE1hYywgJmF1dGhGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExJTV9OT19XRVBfSU5fRkMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnksIGVTSVJfRkFMU0UpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbURlbGV0ZVByZUF1dGhOb2RlKHBNYWMsIHBIZHItPnNhKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbUFjdGl2YXRlQXV0aFJzcFRpbWVyKHBNYWMsIHBBdXRoTm9kZSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQXV0aE5vZGUtPmZUaW1lclN0YXJ0ZWQgPSAxOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZ2V0IHJhbmRvbSBieXRlcyBhbmQgdXNlIGFzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2hhbGxlbmdlIHRleHQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT0RPCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9pZiggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyggdm9zX3JhbmRfZ2V0X2J5dGVzKCAwLCAodEFOSV9VOCAqKWNoYWxsZW5nZVRleHRBcnJheSwgU0lSX01BQ19BVVRIX0NIQUxMRU5HRV9MRU5HVEggKSApICkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsRkwoIkNoYWxsZW5nZSB0ZXh0ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAicHJlcGFyYXRpb24gZmFpbGVkIGluIGxpbVByb2Nlc3NBdXRoRnJhbWUiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDaGFsbGVuZ2UgPSBwQXV0aE5vZGUtPmNoYWxsZW5nZVRleHQ7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocENoYWxsZW5nZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSBjaGFsbGVuZ2VUZXh0QXJyYXksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihjaGFsbGVuZ2VUZXh0QXJyYXkpKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIFNlbmRpbmcgQXV0aGVudGljYXRvbiBmcmFtZSB3aXRoIGNoYWxsZW5nZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoQWxnb051bWJlciA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJ4QXV0aEZyYW1lQm9keS0+YXV0aEFsZ29OdW1iZXI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhUcmFuc2FjdGlvblNlcU51bWJlciA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJ4QXV0aEZyYW1lQm9keS0+YXV0aFRyYW5zYWN0aW9uU2VxTnVtYmVyICsgMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aFN0YXR1c0NvZGUgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfTUFDX1NVQ0NFU1NfU1RBVFVTOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1dGhGcmFtZS50eXBlICAgPSBTSVJfTUFDX0NIQUxMRU5HRV9URVhUX0VJRDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdXRoRnJhbWUubGVuZ3RoID0gU0lSX01BQ19BVVRIX0NIQUxMRU5HRV9MRU5HVEg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KGF1dGhGcmFtZS5jaGFsbGVuZ2VUZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQXV0aE5vZGUtPmNoYWxsZW5nZVRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfQVVUSF9DSEFMTEVOR0VfTEVOR1RIKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVNlbmRBdXRoTWdtdEZyYW1lKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYywgJmF1dGhGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTElNX05PX1dFUF9JTl9GQywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnksIGVTSVJfRkFMU0UpOworICAgICAgICAgICAgICAgICAgICAgICAgfSAvLyBpZiAod2xhbl9jZmdHZXRJbnQoQ0ZHX1BSSVZBQ1lfT1BUSU9OX0lNUExFTUVOVEVEKSkKKworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICAgICAgICAgUEVMT0dFKCBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgicmVjZWl2ZWQgQXV0aCBmcmFtZSBmb3IgdW5zdXBwb3J0ZWQgYXV0aCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImFsZ29yaXRobSAlZCAiTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnhBdXRoRnJhbWVCb2R5LT5hdXRoQWxnb051bWJlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOykKKworICAgICAgICAgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBSZXNwb25kaW5nIHBhcnR5IGRvZXMgbm90IHN1cHBvcnQgdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBhdXRoZW50aWNhdGlvbiBhbGdvcml0aG0gcmVxdWVzdGVkIGJ5CisgICAgICAgICAgICAgICAgICAgICAgICAgKiBzZW5kaW5nIHBhcnR5LgorICAgICAgICAgICAgICAgICAgICAgICAgICogUmVqZWN0IGJ5IHNlbmRpbmcgQXV0aGVudGljYXRpb24gZnJhbWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIHdpdGggYXV0aCBhbGdvcml0aG0gbm90IHN1cHBvcnRlZCBzdGF0dXMgY29kZQorICAgICAgICAgICAgICAgICAgICAgICAgICovCisKKyAgICAgICAgICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoQWxnb051bWJlciA9CisgICAgICAgICAgICAgICAgICAgICAgICBwUnhBdXRoRnJhbWVCb2R5LT5hdXRoQWxnb051bWJlcjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoVHJhbnNhY3Rpb25TZXFOdW1iZXIgPQorICAgICAgICAgICAgICAgICAgICAgICAgcFJ4QXV0aEZyYW1lQm9keS0+YXV0aFRyYW5zYWN0aW9uU2VxTnVtYmVyICsgMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoU3RhdHVzQ29kZSA9CisgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX01BQ19BVVRIX0FMR09fTk9UX1NVUFBPUlRFRF9TVEFUVVM7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbVNlbmRBdXRoTWdtdEZyYW1lKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLCAmYXV0aEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRyLT5zYSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTElNX05PX1dFUF9JTl9GQywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSwgZVNJUl9GQUxTRSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9IC8vIGVuZCBzd2l0Y2gocFJ4QXV0aEZyYW1lQm9keS0+YXV0aEFsZ29OdW1iZXIpCisgICAgICAgICAgICB9IC8vIGlmIChsaW1Jc0F1dGhBbGdvU3VwcG9ydGVkKHBSeEF1dGhGcmFtZUJvZHktPmF1dGhBbGdvTnVtYmVyKSkKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBBdXRoZW50aWNhdGlvbiBmcmFtZSBmb3IgdW5zdXBwb3J0ZWQgYXV0aCAiCisgICAgICAgICAgICAgICAgICAgICAgICJhbGdvcml0aG0gJWQgIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgIHBSeEF1dGhGcmFtZUJvZHktPmF1dGhBbGdvTnVtYmVyLAorICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOykKKworICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAqIFJlc3BvbmRpbmcgcGFydHkgZG9lcyBub3Qgc3VwcG9ydCB0aGUKKyAgICAgICAgICAgICAgICAgKiBhdXRoZW50aWNhdGlvbiBhbGdvcml0aG0gcmVxdWVzdGVkIGJ5IHNlbmRpbmcgcGFydHkuCisgICAgICAgICAgICAgICAgICogUmVqZWN0IEF1dGhlbnRpY2F0aW9uIHdpdGggU3RhdHVzQ29kZT0xMy4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aEFsZ29OdW1iZXIgPQorICAgICAgICAgICAgICAgIHBSeEF1dGhGcmFtZUJvZHktPmF1dGhBbGdvTnVtYmVyOworICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoVHJhbnNhY3Rpb25TZXFOdW1iZXIgPQorICAgICAgICAgICAgICAgIHBSeEF1dGhGcmFtZUJvZHktPmF1dGhUcmFuc2FjdGlvblNlcU51bWJlciArIDE7CisgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhTdGF0dXNDb2RlID0KKyAgICAgICAgICAgICAgICBlU0lSX01BQ19BVVRIX0FMR09fTk9UX1NVUFBPUlRFRF9TVEFUVVM7CisKKyAgICAgICAgICAgICAgICBsaW1TZW5kQXV0aE1nbXRGcmFtZShwTWFjLCAmYXV0aEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExJTV9OT19XRVBfSU5fRkMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSwgZVNJUl9GQUxTRSk7CisKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9IC8vZW5kIGlmIChsaW1Jc0F1dGhBbGdvU3VwcG9ydGVkKHBSeEF1dGhGcmFtZUJvZHktPmF1dGhBbGdvTnVtYmVyKSkKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgU0lSX01BQ19BVVRIX0ZSQU1FXzI6CisgICAgICAgICAgICAvLyBBdXRoRnJhbWUgMgorCisgICAgICAgICAgICBpZiAocHNlc3Npb25FbnRyeS0+bGltTWxtU3RhdGUgIT0gZUxJTV9NTE1fV1RfQVVUSF9GUkFNRTJfU1RBVEUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICogUmVjZWl2ZWQgQXV0aGVudGljYXRpb24gZnJhbWUyIGluIGFuIHVuZXhwZWN0ZWQgc3RhdGUuCisgICAgICAgICAgICAgICAgICogTG9nIGVycm9yIGFuZCBpZ25vcmUgdGhlIGZyYW1lLgorICAgICAgICAgICAgICAgICAqLworCisgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBBdXRoIGZyYW1lMiBmcm9tIHBlZXIgaW4gc3RhdGUgJWQsIGFkZHIgIiksCisgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlKTsKKyAgICAgICAgICAgICAgICBsaW1QcmludE1hY0FkZHIocE1hYywgcEhkci0+c2EsIExPRzEpOworCisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoICF2b3NfbWVtX2NvbXBhcmUoKHRBTklfVTggKikgcEhkci0+c2EsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTggKikgJnBNYWMtPmxpbS5ncExpbU1sbUF1dGhSZXEtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgKiBSZWNlaXZlZCBBdXRoZW50aWNhdGlvbiBmcmFtZSBmcm9tIGFuIGVudGl0eQorICAgICAgICAgICAgICAgICAqIG90aGVyIHRoYW4gb25lIHJlcXVlc3Qgd2FzIGluaXRpYXRlZC4KKyAgICAgICAgICAgICAgICAgKiBXYWl0IHVudGlsIEF1dGhlbnRpY2F0aW9uIEZhaWx1cmUgVGltZW91dC4KKyAgICAgICAgICAgICAgICAgKi8KKworICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgIFBFTE9HVyhsaW1Mb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIEF1dGggZnJhbWUyIGZyb20gdW5leHBlY3RlZCBwZWVyICIKKyAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTspCisKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHBSeEF1dGhGcmFtZUJvZHktPmF1dGhTdGF0dXNDb2RlID09CisgICAgICAgICAgICAgICAgZVNJUl9NQUNfQVVUSF9BTEdPX05PVF9TVVBQT1JURURfU1RBVFVTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAqIEludGVyb3BlcmFiaWxpdHkgd29ya2Fyb3VuZDogTGlua3N5cyBXQVA0NDAwTiBpcyByZXR1cm5pbmcKKyAgICAgICAgICAgICAgICAgKiB3cm9uZyBhdXRoVHlwZSBpbiBPcGVuQXV0aCByZXNwb25zZSBpbiBjYXNlIG9mIAorICAgICAgICAgICAgICAgICAqIFNoYXJlZEtleSBBUCBjb25maWd1cmF0aW9uLiBQcmV0ZW5kIHdlIGRvbid0IHNlZSB0aGF0LAorICAgICAgICAgICAgICAgICAqIHNvIHVwcGVyIGxheWVyIGNhbiBmYWxsYmFjayB0byBTaGFyZWRLZXkgYXV0aFR5cGUsCisgICAgICAgICAgICAgICAgICogYW5kIHN1Y2Nlc3NmdWxseSBjb25uZWN0IHRvIHRoZSBBUC4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBpZiAocFJ4QXV0aEZyYW1lQm9keS0+YXV0aEFsZ29OdW1iZXIgIT0KKyAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwTGltTWxtQXV0aFJlcS0+YXV0aFR5cGUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwUnhBdXRoRnJhbWVCb2R5LT5hdXRoQWxnb051bWJlciA9CisgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5ncExpbU1sbUF1dGhSZXEtPmF1dGhUeXBlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHBSeEF1dGhGcmFtZUJvZHktPmF1dGhBbGdvTnVtYmVyICE9CisgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwTGltTWxtQXV0aFJlcS0+YXV0aFR5cGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICogUmVjZWl2ZWQgQXV0aGVudGljYXRpb24gZnJhbWUgd2l0aCBhbiBhdXRoCisgICAgICAgICAgICAgICAgICogYWxnb3JpdGhtIG90aGVyIHRoYW4gb25lIHJlcXVlc3RlZC4KKyAgICAgICAgICAgICAgICAgKiBXYWl0IHVudGlsIEF1dGhlbnRpY2F0aW9uIEZhaWx1cmUgVGltZW91dC4KKyAgICAgICAgICAgICAgICAgKi8KKworICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgIFBFTE9HVyhsaW1Mb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIEF1dGggZnJhbWUyIGZvciB1bmV4cGVjdGVkIGF1dGggYWxnbyBudW1iZXIgJWQgIgorICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIpLCBwUnhBdXRoRnJhbWVCb2R5LT5hdXRoQWxnb051bWJlciwKKyAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTspCisKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHBSeEF1dGhGcmFtZUJvZHktPmF1dGhTdGF0dXNDb2RlID09CisgICAgICAgICAgICAgICAgZVNJUl9NQUNfU1VDQ0VTU19TVEFUVVMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHBSeEF1dGhGcmFtZUJvZHktPmF1dGhBbGdvTnVtYmVyID09CisgICAgICAgICAgICAgICAgICAgIGVTSVJfT1BFTl9TWVNURU0pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1DdXJyZW50QXV0aFR5cGUgPSBlU0lSX09QRU5fU1lTVEVNOworCisgICAgICAgICAgICAgICAgICAgIHBBdXRoTm9kZSA9IGxpbUFjcXVpcmVGcmVlUHJlQXV0aE5vZGUocE1hYywgJnBNYWMtPmxpbS5nTGltUHJlQXV0aFRpbWVyVGFibGUpOworCisgICAgICAgICAgICAgICAgICAgIGlmIChwQXV0aE5vZGUgPT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiTWF4IHByZS1hdXRoIG5vZGVzIHJlYWNoZWQgIikpOworICAgICAgICAgICAgICAgICAgICAgICAgbGltUHJpbnRNYWNBZGRyKHBNYWMsIHBIZHItPnNhLCBMT0dXKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiQWxsb2MgbmV3IGRhdGE6IHBlZXIgIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTsKKworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKikgcEF1dGhOb2RlLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5ncExpbU1sbUF1dGhSZXEtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgICAgICAgICAgICAgIHBBdXRoTm9kZS0+ZlRpbWVyU3RhcnRlZCA9IDA7CisgICAgICAgICAgICAgICAgICAgIHBBdXRoTm9kZS0+YXV0aFR5cGUgPSBwTWFjLT5saW0uZ3BMaW1NbG1BdXRoUmVxLT5hdXRoVHlwZTsKKyAgICAgICAgICAgICAgICAgICAgcEF1dGhOb2RlLT5zZXFObyA9ICgocEhkci0+c2VxQ29udHJvbC5zZXFOdW1IaSA8PCA0KSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBIZHItPnNlcUNvbnRyb2wuc2VxTnVtTG8pKTsKKyAgICAgICAgICAgICAgICAgICAgcEF1dGhOb2RlLT50aW1lc3RhbXAgPSB2b3NfdGltZXJfZ2V0X3N5c3RlbV90aWNrcygpOworICAgICAgICAgICAgICAgICAgICBsaW1BZGRQcmVBdXRoTm9kZShwTWFjLCBwQXV0aE5vZGUpOworCisgICAgICAgICAgICAgICAgICAgIGxpbVJlc3RvcmVGcm9tQXV0aFN0YXRlKHBNYWMsIGVTSVJfU01FX1NVQ0NFU1MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSeEF1dGhGcmFtZUJvZHktPmF1dGhTdGF0dXNDb2RlLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgIH0gLy8gaWYgKHBSeEF1dGhGcmFtZUJvZHktPmF1dGhBbGdvTnVtYmVyID09IGVTSVJfT1BFTl9TWVNURU0pCisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gU2hhcmVkIGtleSBhdXRoZW50aWNhdGlvbgorCisgICAgICAgICAgICAgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWwgPSBwc2Vzc2lvbkVudHJ5LT5wcml2YWN5OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgICAKKyAgICAgICAgICAgICAgICAgICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfUFJJVkFDWV9FTkFCTEVELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ2YWwpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBDb3VsZCBub3QgZ2V0IFByaXZhY3kgb3B0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBmcm9tIENGRy4gTG9nIGVycm9yLgorICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiY291bGQgbm90IHJldHJpZXZlIFByaXZhY3kgb3B0aW9uIikpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGNmZ1ByaXZhY3lPcHRJbXAgPSAodEFOSV9VOCl2YWw7CisgICAgICAgICAgICAgICAgICAgIGlmICghY2ZnUHJpdmFjeU9wdEltcCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBSZXF1ZXN0aW5nIFNUQSBkb2VzIG5vdCBoYXZlIFdFUCBpbXBsZW1lbnRlZC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAqIFJlamVjdCB3aXRoIHVuc3VwcG9ydGVkIGF1dGhlbnRpY2F0aW9uIGFsZ29yaXRobQorICAgICAgICAgICAgICAgICAgICAgICAgICogU3RhdHVzIGNvZGUgYW5kIHdhaXQgdW50aWwgYXV0aCBmYWlsdXJlIHRpbWVvdXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAqLworCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICAgICAgICAgUEVMT0dFKCBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgicmVjZWl2ZWQgQXV0aCBmcmFtZSBmcm9tIHBlZXIgZm9yICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAidW5zdXBwb3J0ZWQgYXV0aCBhbGdvICVkICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIpLCBwUnhBdXRoRnJhbWVCb2R5LT5hdXRoQWxnb051bWJlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOykKKworICAgICAgICAgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhBbGdvTnVtYmVyID0KKyAgICAgICAgICAgICAgICAgICAgICAgIHBSeEF1dGhGcmFtZUJvZHktPmF1dGhBbGdvTnVtYmVyOworICAgICAgICAgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhUcmFuc2FjdGlvblNlcU51bWJlciA9CisgICAgICAgICAgICAgICAgICAgICAgICBwUnhBdXRoRnJhbWVCb2R5LT5hdXRoVHJhbnNhY3Rpb25TZXFOdW1iZXIgKyAxOworICAgICAgICAgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhTdGF0dXNDb2RlID0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfTUFDX0FVVEhfQUxHT19OT1RfU1VQUE9SVEVEX1NUQVRVUzsKKworICAgICAgICAgICAgICAgICAgICAgICAgbGltU2VuZEF1dGhNZ210RnJhbWUocE1hYywgJmF1dGhGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExJTV9OT19XRVBfSU5fRkMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnksIGVTSVJfRkFMU0UpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAocFJ4QXV0aEZyYW1lQm9keS0+dHlwZSAhPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfQ0hBTExFTkdFX1RFWFRfRUlEKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIEF1dGggZnJhbWUgd2l0aCBpbnZhbGlkICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImNoYWxsZW5nZSB0ZXh0IElFIikpOykKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBDaGVjayBpZiB0aGVyZSBleGlzdHMgYSBrZXkgbWFwcHBpbmcga2V5CisgICAgICAgICAgICAgICAgICAgICAgICAgKiBmb3IgdGhlIFNUQSB0aGF0IHNlbnQgQXV0aGVudGljYXRpb24gZnJhbWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgICAgcEtleU1hcEVudHJ5ID0gbGltTG9va1VwS2V5TWFwcGluZ3MoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZHItPnNhKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBLZXlNYXBFbnRyeSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocEtleU1hcEVudHJ5LT5rZXkgPT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgicmVjZWl2ZWQgQXV0aCBmcmFtZSBmcm9tIHBlZXIgd2hlbiAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAia2V5IG1hcHBpbmcga2V5IGlzIE5VTEwiTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSk7KQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBLZXkgTWFwcGluZyBlbnRyeSBoYXMgbnVsbCBrZXkuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIFNlbmQgQXV0aCBmcmFtZSB3aXRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGNoYWxsZW5nZSBmYWlsdXJlIHN0YXR1cyBjb2RlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aEFsZ29OdW1iZXIgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnhBdXRoRnJhbWVCb2R5LT5hdXRoQWxnb051bWJlcjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhUcmFuc2FjdGlvblNlcU51bWJlciA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSeEF1dGhGcmFtZUJvZHktPmF1dGhUcmFuc2FjdGlvblNlcU51bWJlciArIDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoU3RhdHVzQ29kZSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfTUFDX0NIQUxMRU5HRV9GQUlMVVJFX1NUQVRVUzsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1TZW5kQXV0aE1nbXRGcmFtZShwTWFjLCAmYXV0aEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRyLT5zYSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTElNX05PX1dFUF9JTl9GQywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSwgZVNJUl9GQUxTRSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltUmVzdG9yZUZyb21BdXRoU3RhdGUocE1hYywgZVNJUl9TTUVfTk9fS0VZX01BUFBJTkdfS0VZX0ZPUl9QRUVSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX01BQ19VTlNQRUNfRkFJTFVSRV9SRUFTT04scHNlc3Npb25FbnRyeSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gLy8gaWYgKHBLZXlNYXBFbnRyeS0+a2V5ID09IE5VTEwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh0cFNpck1hY0F1dGhGcmFtZUJvZHkpIHBsYWluQm9keSktPmF1dGhBbGdvTnVtYmVyID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2lyU3dhcFUxNmlmTmVlZGVkKHBSeEF1dGhGcmFtZUJvZHktPmF1dGhBbGdvTnVtYmVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh0cFNpck1hY0F1dGhGcmFtZUJvZHkpIHBsYWluQm9keSktPmF1dGhUcmFuc2FjdGlvblNlcU51bWJlciA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpclN3YXBVMTZpZk5lZWRlZCgodEFOSV9VMTYpIChwUnhBdXRoRnJhbWVCb2R5LT5hdXRoVHJhbnNhY3Rpb25TZXFOdW1iZXIgKyAxKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgodHBTaXJNYWNBdXRoRnJhbWVCb2R5KSBwbGFpbkJvZHkpLT5hdXRoU3RhdHVzQ29kZSA9IGVTSVJfTUFDX1NVQ0NFU1NfU1RBVFVTOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHRwU2lyTWFjQXV0aEZyYW1lQm9keSkgcGxhaW5Cb2R5KS0+dHlwZSAgID0gU0lSX01BQ19DSEFMTEVOR0VfVEVYVF9FSUQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgodHBTaXJNYWNBdXRoRnJhbWVCb2R5KSBwbGFpbkJvZHkpLT5sZW5ndGggPSBTSVJfTUFDX0FVVEhfQ0hBTExFTkdFX0xFTkdUSDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4ICopICgodHBTaXJNYWNBdXRoRnJhbWVCb2R5KSBwbGFpbkJvZHkpLT5jaGFsbGVuZ2VUZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSeEF1dGhGcmFtZUJvZHktPmNoYWxsZW5nZVRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX01BQ19BVVRIX0NIQUxMRU5HRV9MRU5HVEgpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbUVuY3J5cHRBdXRoRnJhbWUocE1hYywgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwS2V5TWFwRW50cnktPmtleSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGFpbkJvZHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5jckF1dGhGcmFtZSxrZXlfbGVuZ3RoKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSA9IGVMSU1fTUxNX1dUX0FVVEhfRlJBTUU0X1NUQVRFOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9NTE1fU1RBVEUsIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLCBwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSkpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVNlbmRBdXRoTWdtdEZyYW1lKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0cFNpck1hY0F1dGhGcmFtZUJvZHkpIGVuY3JBdXRoRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMSU1fV0VQX0lOX0ZDLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LCBlU0lSX0ZBTFNFKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IC8vIGVuZCBpZiAocEtleU1hcEVudHJ5LT5rZXkgPT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gLy8gaWYgKHBLZXlNYXBFbnRyeSkKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19XRVBfREVGQVVMVF9LRVlJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ2YWwpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBDb3VsZCBub3QgZ2V0IERlZmF1bHQga2V5SWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBEZWZhdWx0IGtleUlkIikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXlJZCA9ICh0QU5JX1U4KXZhbDsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbCA9IFNJUl9NQUNfS0VZX0xFTkdUSDsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJLZXlzIHBLZXk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBLZXkgPSAgJnBzZXNzaW9uRW50cnktPldFUEtleU1hdGVyaWFsW2tleUlkXS5rZXlbMF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShkZWZhdWx0S2V5LCBwS2V5LT5rZXksIHBLZXktPmtleUxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAod2xhbl9jZmdHZXRTdHIocE1hYywgKHRBTklfVTE2KSAoV05JX0NGR19XRVBfREVGQVVMVF9LRVlfMSArIGtleUlkKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRLZXksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdmFsKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLy8gQ291bGQgbm90IGdldCBEZWZhdWx0IGtleSBmcm9tIENGRy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9Mb2cgZXJyb3IuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBEZWZhdWx0IGtleSIpKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aEFsZ29OdW1iZXIgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnhBdXRoRnJhbWVCb2R5LT5hdXRoQWxnb051bWJlcjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhUcmFuc2FjdGlvblNlcU51bWJlciA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSeEF1dGhGcmFtZUJvZHktPmF1dGhUcmFuc2FjdGlvblNlcU51bWJlciArIDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoU3RhdHVzQ29kZSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfTUFDX0NIQUxMRU5HRV9GQUlMVVJFX1NUQVRVUzsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1TZW5kQXV0aE1nbXRGcmFtZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLCAmYXV0aEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExJTV9OT19XRVBfSU5fRkMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSwgZVNJUl9GQUxTRSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltUmVzdG9yZUZyb21BdXRoU3RhdGUocE1hYywgZVNJUl9TTUVfSU5WQUxJRF9XRVBfREVGQVVMVF9LRVksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfTUFDX1VOU1BFQ19GQUlMVVJFX1JFQVNPTixwc2Vzc2lvbkVudHJ5KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleV9sZW5ndGg9dmFsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHRwU2lyTWFjQXV0aEZyYW1lQm9keSkgcGxhaW5Cb2R5KS0+YXV0aEFsZ29OdW1iZXIgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXJTd2FwVTE2aWZOZWVkZWQocFJ4QXV0aEZyYW1lQm9keS0+YXV0aEFsZ29OdW1iZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHRwU2lyTWFjQXV0aEZyYW1lQm9keSkgcGxhaW5Cb2R5KS0+YXV0aFRyYW5zYWN0aW9uU2VxTnVtYmVyID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2lyU3dhcFUxNmlmTmVlZGVkKCh0QU5JX1UxNikgKHBSeEF1dGhGcmFtZUJvZHktPmF1dGhUcmFuc2FjdGlvblNlcU51bWJlciArIDEpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh0cFNpck1hY0F1dGhGcmFtZUJvZHkpIHBsYWluQm9keSktPmF1dGhTdGF0dXNDb2RlID0gZVNJUl9NQUNfU1VDQ0VTU19TVEFUVVM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgodHBTaXJNYWNBdXRoRnJhbWVCb2R5KSBwbGFpbkJvZHkpLT50eXBlICAgPSBTSVJfTUFDX0NIQUxMRU5HRV9URVhUX0VJRDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh0cFNpck1hY0F1dGhGcmFtZUJvZHkpIHBsYWluQm9keSktPmxlbmd0aCA9IFNJUl9NQUNfQVVUSF9DSEFMTEVOR0VfTEVOR1RIOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKikgKCh0cFNpck1hY0F1dGhGcmFtZUJvZHkpIHBsYWluQm9keSktPmNoYWxsZW5nZVRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJ4QXV0aEZyYW1lQm9keS0+Y2hhbGxlbmdlVGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX0FVVEhfQ0hBTExFTkdFX0xFTkdUSCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltRW5jcnlwdEF1dGhGcmFtZShwTWFjLCBrZXlJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0S2V5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYWluQm9keSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmNyQXV0aEZyYW1lLGtleV9sZW5ndGgpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUxJTV9NTE1fV1RfQVVUSF9GUkFNRTRfU1RBVEU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX01MTV9TVEFURSwgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsIHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlKSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltU2VuZEF1dGhNZ210RnJhbWUocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRwU2lyTWFjQXV0aEZyYW1lQm9keSkgZW5jckF1dGhGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExJTV9XRVBfSU5fRkMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnksIGVTSVJfRkFMU0UpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfSAvLyBlbmQgaWYgKHBLZXlNYXBFbnRyeSkKKyAgICAgICAgICAgICAgICAgICAgfSAvLyBlbmQgaWYgKCF3bGFuX2NmZ0dldEludChDRkdfUFJJVkFDWV9PUFRJT05fSU1QTEVNRU5URUQpKQorICAgICAgICAgICAgICAgIH0gLy8gZW5kIGlmIChwUnhBdXRoRnJhbWVCb2R5LT5hdXRoQWxnb051bWJlciA9PSBlU0lSX09QRU5fU1lTVEVNKQorICAgICAgICAgICAgfSAvLyBpZiAocFJ4QXV0aEZyYW1lQm9keS0+YXV0aFN0YXR1c0NvZGUgPT0gZVNJUl9NQUNfU1VDQ0VTU19TVEFUVVMpCisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICogQXV0aGVudGljYXRpb24gZmFpbHVyZS4KKyAgICAgICAgICAgICAgICAgKiBSZXR1cm4gQXV0aCBjb25maXJtIHdpdGggcmVjZWl2ZWQgZmFpbHVyZSBjb2RlIHRvIFNNRQorICAgICAgICAgICAgICAgICAqLworCisgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICBGTCgicmVjZWl2ZWQgQXV0aCBmcmFtZSBmcm9tIHBlZXIgd2l0aCBmYWlsdXJlIGNvZGUgJWQgIgorICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIpLCBwUnhBdXRoRnJhbWVCb2R5LT5hdXRoU3RhdHVzQ29kZSwgCisgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSk7KQorCisgICAgICAgICAgICAgICAgbGltUmVzdG9yZUZyb21BdXRoU3RhdGUocE1hYywgZVNJUl9TTUVfQVVUSF9SRUZVU0VELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSeEF1dGhGcmFtZUJvZHktPmF1dGhTdGF0dXNDb2RlLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgfSAvLyBlbmQgaWYgKHBSeEF1dGhGcmFtZUJvZHktPmF1dGhTdGF0dXNDb2RlID09IGVTSVJfTUFDX1NVQ0NFU1NfU1RBVFVTKQorCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFNJUl9NQUNfQVVUSF9GUkFNRV8zOgorICAgICAgICAgICAgLy8gQXV0aEZyYW1lIDMKKworICAgICAgICAgICAgaWYgKHBSeEF1dGhGcmFtZUJvZHktPmF1dGhBbGdvTnVtYmVyICE9IGVTSVJfU0hBUkVEX0tFWSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBBdXRoIGZyYW1lMyBmcm9tIHBlZXIgd2l0aCBhdXRoIGFsZ28gIgorICAgICAgICAgICAgICAgICAgICAgICAibnVtYmVyICVkICJNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgICAgICBwUnhBdXRoRnJhbWVCb2R5LT5hdXRoQWxnb051bWJlciwKKyAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTspCisKKyAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgKiBSZWNlaXZlZCBBdXRoZW50aWNhdGlvbiBmcmFtZTMgd2l0aCBhbGdvcml0aG0gb3RoZXIgdGhhbgorICAgICAgICAgICAgICAgICAqIFNoYXJlZCBLZXkgYXV0aGVudGljYXRpb24gdHlwZS4gUmVqZWN0IHdpdGggQXV0aCBmcmFtZTQKKyAgICAgICAgICAgICAgICAgKiB3aXRoICdvdXQgb2Ygc2VxdWVuY2UnIHN0YXR1cyBjb2RlLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoQWxnb051bWJlciA9IGVTSVJfU0hBUkVEX0tFWTsKKyAgICAgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aFRyYW5zYWN0aW9uU2VxTnVtYmVyID0KKyAgICAgICAgICAgICAgICBTSVJfTUFDX0FVVEhfRlJBTUVfNDsKKyAgICAgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aFN0YXR1c0NvZGUgPQorICAgICAgICAgICAgICAgIGVTSVJfTUFDX0FVVEhfRlJBTUVfT1VUX09GX1NFUV9TVEFUVVM7CisKKyAgICAgICAgICAgICAgICBsaW1TZW5kQXV0aE1nbXRGcmFtZShwTWFjLCAmYXV0aEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExJTV9OT19XRVBfSU5fRkMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSwgZVNJUl9GQUxTRSk7CisKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQVBfUk9MRSB8fCBwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQlRfQU1QX0FQX1JPTEUgfHwKKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fU1RBX0lOX0lCU1NfUk9MRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgKiBDaGVjayBpZiB3ZXAgYml0IHdhcyBzZXQgaW4gRkMuIElmIG5vdCBzZXQsCisgICAgICAgICAgICAgICAgICogcmVqZWN0IHdpdGggQXV0aGVudGljYXRpb24gZnJhbWU0IHdpdGgKKyAgICAgICAgICAgICAgICAgKiAnY2hhbGxlbmdlIGZhaWx1cmUnIHN0YXR1cyBjb2RlLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGlmICghcEhkci0+ZmMud2VwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBBdXRoIGZyYW1lMyBmcm9tIHBlZXIgd2l0aCBubyBXRVAgYml0ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJzZXQgIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOykKKworICAgICAgICAgICAgICAgICAgICAvLy8gV0VQIGJpdCBpcyBub3Qgc2V0IGluIEZDIG9mIEF1dGggRnJhbWUzCisgICAgICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoQWxnb051bWJlciA9IGVTSVJfU0hBUkVEX0tFWTsKKyAgICAgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhUcmFuc2FjdGlvblNlcU51bWJlciA9CisgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfQVVUSF9GUkFNRV80OworICAgICAgICAgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aFN0YXR1c0NvZGUgPQorICAgICAgICAgICAgICAgICAgICBlU0lSX01BQ19DSEFMTEVOR0VfRkFJTFVSRV9TVEFUVVM7CisKKyAgICAgICAgICAgICAgICAgICAgbGltU2VuZEF1dGhNZ210RnJhbWUocE1hYywgJmF1dGhGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExJTV9OT19XRVBfSU5fRkMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnksIGVTSVJfRkFMU0UpOworCisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBwQXV0aE5vZGUgPSBsaW1TZWFyY2hQcmVBdXRoTGlzdChwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EpOworICAgICAgICAgICAgICAgIGlmIChwQXV0aE5vZGUgPT0gTlVMTCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIEF1dGhGcmFtZTMgZnJvbSBwZWVyIHRoYXQgaGFzIG5vICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJwcmVhdXRoIGNvbnRleHQgIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTspCisKKyAgICAgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICAgICAqIE5vICdwcmUtYXV0aCcgY29udGV4dCBleGlzdHMgZm9yCisgICAgICAgICAgICAgICAgICAgICAqIHRoaXMgU1RBIHRoYXQgc2VudCBhbiBBdXRoZW50aWNhdGlvbgorICAgICAgICAgICAgICAgICAgICAgKiBmcmFtZTMuCisgICAgICAgICAgICAgICAgICAgICAqIFNlbmQgQXV0aCBmcmFtZTQgd2l0aCAnb3V0IG9mIHNlcXVlbmNlJworICAgICAgICAgICAgICAgICAgICAgKiBzdGF0dXMgY29kZS4KKyAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoQWxnb051bWJlciA9IGVTSVJfU0hBUkVEX0tFWTsKKyAgICAgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhUcmFuc2FjdGlvblNlcU51bWJlciA9CisgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfQVVUSF9GUkFNRV80OworICAgICAgICAgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aFN0YXR1c0NvZGUgPQorICAgICAgICAgICAgICAgICAgICBlU0lSX01BQ19BVVRIX0ZSQU1FX09VVF9PRl9TRVFfU1RBVFVTOworCisgICAgICAgICAgICAgICAgICAgIGxpbVNlbmRBdXRoTWdtdEZyYW1lKHBNYWMsICZhdXRoRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMSU1fTk9fV0VQX0lOX0ZDLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LCBlU0lSX0ZBTFNFKTsKKworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKHBBdXRoTm9kZS0+bWxtU3RhdGUgPT0gZUxJTV9NTE1fQVVUSF9SU1BfVElNRU9VVF9TVEFURSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJhdXRoIHJlc3BvbnNlIHRpbWVyIHRpbWVkb3V0IGZvciBwZWVyICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSRVNTX1NUUiksTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTsKKyAgICAgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICAgICAqIFJlY2VpdmVkIEF1dGggRnJhbWUzIGFmdGVyIEF1dGggUmVzcG9uc2UgdGltZW91dC4KKyAgICAgICAgICAgICAgICAgICAgICogUmVqZWN0IGJ5IHNlbmRpbmcgQXV0aCBGcmFtZTQgd2l0aAorICAgICAgICAgICAgICAgICAgICAgKiBBdXRoIHJlc3BvbmUgdGltZW91dCBTdGF0dXMgQ29kZS4KKyAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoQWxnb051bWJlciA9IGVTSVJfU0hBUkVEX0tFWTsKKyAgICAgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhUcmFuc2FjdGlvblNlcU51bWJlciA9CisgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfQVVUSF9GUkFNRV80OworICAgICAgICAgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aFN0YXR1c0NvZGUgPQorICAgICAgICAgICAgICAgICAgICBlU0lSX01BQ19BVVRIX1JTUF9USU1FT1VUX1NUQVRVUzsKKworICAgICAgICAgICAgICAgICAgICBsaW1TZW5kQXV0aE1nbXRGcmFtZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLCAmYXV0aEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExJTV9OT19XRVBfSU5fRkMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSwgZVNJUl9GQUxTRSk7CisKKyAgICAgICAgICAgICAgICAgICAgLy8vIERlbGV0ZSBwcmUtYXV0aCBjb250ZXh0IG9mIFNUQQorICAgICAgICAgICAgICAgICAgICBsaW1EZWxldGVQcmVBdXRoTm9kZShwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRyLT5zYSk7CisKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0gLy8gZW5kIHN3aXRjaCAocEF1dGhOb2RlLT5tbG1TdGF0ZSkKKworICAgICAgICAgICAgICAgIGlmIChwUnhBdXRoRnJhbWVCb2R5LT5hdXRoU3RhdHVzQ29kZSAhPSBlU0lSX01BQ19TVUNDRVNTX1NUQVRVUykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgKiBSZWNlaXZlZCBBdXRoZW5ldGljYXRpb24gRnJhbWUgMyB3aXRoIHN0YXR1cyBjb2RlCisgICAgICAgICAgICAgICAgICAgICAqIG90aGVyIHRoYW4gc3VjY2Vzcy4gV2FpdCB1bnRpbCBBdXRoIHJlc3BvbnNlIHRpbWVvdXQKKyAgICAgICAgICAgICAgICAgICAgICogdG8gZGVsZXRlIFNUQSBjb250ZXh0LgorICAgICAgICAgICAgICAgICAgICAgKi8KKworICAgICAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIEF1dGggZnJhbWUzIGZyb20gcGVlciB3aXRoIHN0YXR1cyBjb2RlICVkICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSRVNTX1NUUiksIHBSeEF1dGhGcmFtZUJvZHktPmF1dGhTdGF0dXNDb2RlLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSk7KQorCisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgKiBDaGVjayBpZiByZWNlaXZlZCBjaGFsbGVuZ2UgdGV4dCBpcyBzYW1lIGFzIG9uZSBzZW50IGluCisgICAgICAgICAgICAgICAgICogQXV0aGVudGljYXRpb24gZnJhbWUzCisgICAgICAgICAgICAgICAgICovCisKKyAgICAgICAgICAgICAgICBpZiAodm9zX21lbV9jb21wYXJlKHBSeEF1dGhGcmFtZUJvZHktPmNoYWxsZW5nZVRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQXV0aE5vZGUtPmNoYWxsZW5nZVRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX0FVVEhfQ0hBTExFTkdFX0xFTkdUSCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvLy8gQ2hhbGxlbmdlIG1hdGNoLiBTVEEgaXMgYXV0aGV0aWNhdGVkICEKKworICAgICAgICAgICAgICAgICAgICAvLy8gRGVsZXRlIEF1dGhlbnRpY2F0aW9uIHJlc3BvbnNlIHRpbWVyIGlmIHJ1bm5pbmcKKyAgICAgICAgICAgICAgICAgICAgbGltRGVhY3RpdmF0ZUFuZENoYW5nZVBlclN0YUlkVGltZXIocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUxJTV9BVVRIX1JTUF9USU1FUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEF1dGhOb2RlLT5hdXRoTm9kZUlkeCk7CisKKyAgICAgICAgICAgICAgICAgICAgcEF1dGhOb2RlLT5mVGltZXJTdGFydGVkID0gMDsKKyAgICAgICAgICAgICAgICAgICAgcEF1dGhOb2RlLT5tbG1TdGF0ZSA9IGVMSU1fTUxNX0FVVEhFTlRJQ0FURURfU1RBVEU7CisKKyAgICAgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICAgICAqIFNlbmQgQXV0aGVudGljYXRpb24gRnJhbWU0IHdpdGggJ3N1Y2Nlc3MnIFN0YXR1cyBDb2RlLgorICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgYXV0aEZyYW1lLmF1dGhBbGdvTnVtYmVyID0gZVNJUl9TSEFSRURfS0VZOworICAgICAgICAgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aFRyYW5zYWN0aW9uU2VxTnVtYmVyID0KKyAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfQVVUSF9GUkFNRV80OworICAgICAgICAgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aFN0YXR1c0NvZGUgPSBlU0lSX01BQ19TVUNDRVNTX1NUQVRVUzsKKworICAgICAgICAgICAgICAgICAgICBsaW1TZW5kQXV0aE1nbXRGcmFtZShwTWFjLCAmYXV0aEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRyLT5zYSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTElNX05PX1dFUF9JTl9GQywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSwgZVNJUl9GQUxTRSk7CisKKyAgICAgICAgICAgICAgICAgICAgLy8vIFNlbmQgQXV0aCBpbmRpY2F0aW9uIHRvIFNNRQorICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKikgbWxtQXV0aEluZC5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICAgICAgICAgICAgICBtbG1BdXRoSW5kLmF1dGhUeXBlID0gKHRBbmlBdXRoVHlwZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSeEF1dGhGcmFtZUJvZHktPmF1dGhBbGdvTnVtYmVyOworICAgICAgICAgICAgICAgICAgICBtbG1BdXRoSW5kLnNlc3Npb25JZCA9IHBzZXNzaW9uRW50cnktPnNtZVNlc3Npb25JZDsKKworICAgICAgICAgICAgICAgICAgICBsaW1Qb3N0U21lTWVzc2FnZShwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMSU1fTUxNX0FVVEhfSU5ELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VMzIgKikgJm1sbUF1dGhJbmQpOworCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgICAgIFBFTE9HRSggbGltTG9nKHBNYWMsIExPR1csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJDaGFsbGVuZ2UgZmFpbHVyZSBmb3IgcGVlciAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSk7KQorICAgICAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgICAgICogQ2hhbGxlbmdlIEZhaWx1cmUuCisgICAgICAgICAgICAgICAgICAgICAqIFNlbmQgQXV0aGVudGljYXRpb24gZnJhbWU0IHdpdGggJ2NoYWxsZW5nZSBmYWlsdXJlJworICAgICAgICAgICAgICAgICAgICAgKiBzdGF0dXMgY29kZSBhbmQgd2FpdCB1bnRpbCBBdXRoIHJlc3BvbnNlIHRpbWVvdXQgdG8KKyAgICAgICAgICAgICAgICAgICAgICogZGVsZXRlIFNUQSBjb250ZXh0LgorICAgICAgICAgICAgICAgICAgICAgKi8KKworICAgICAgICAgICAgICAgICAgICBhdXRoRnJhbWUuYXV0aEFsZ29OdW1iZXIgPQorICAgICAgICAgICAgICAgICAgICAgICAgcFJ4QXV0aEZyYW1lQm9keS0+YXV0aEFsZ29OdW1iZXI7CisgICAgICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoVHJhbnNhY3Rpb25TZXFOdW1iZXIgPQorICAgICAgICAgICAgICAgICAgICAgICAgU0lSX01BQ19BVVRIX0ZSQU1FXzQ7CisgICAgICAgICAgICAgICAgICAgIGF1dGhGcmFtZS5hdXRoU3RhdHVzQ29kZSA9CisgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX01BQ19DSEFMTEVOR0VfRkFJTFVSRV9TVEFUVVM7CisKKyAgICAgICAgICAgICAgICAgICAgbGltU2VuZEF1dGhNZ210RnJhbWUocE1hYywgJmF1dGhGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExJTV9OT19XRVBfSU5fRkMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnksIGVTSVJfRkFMU0UpOworCisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IC8vIGlmIChwTWFjLT5saW0uZ0xpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFIHx8IC4uLgorCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFNJUl9NQUNfQVVUSF9GUkFNRV80OgorICAgICAgICAgICAgLy8gQXV0aEZyYW1lIDQKKyAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSAhPSBlTElNX01MTV9XVF9BVVRIX0ZSQU1FNF9TVEFURSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgKiBSZWNlaXZlZCBBdXRoZW50aWNhdGlvbiBmcmFtZTQgaW4gYW4gdW5leHBlY3RlZCBzdGF0ZS4KKyAgICAgICAgICAgICAgICAgKiBMb2cgZXJyb3IgYW5kIGlnbm9yZSB0aGUgZnJhbWUuCisgICAgICAgICAgICAgICAgICovCisKKyAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIHVuZXhwZWN0ZWQgQXV0aCBmcmFtZTQgZnJvbSBwZWVyIGluIHN0YXRlICIKKyAgICAgICAgICAgICAgICAgICAgICAgIiVkLCBhZGRyICJNQUNfQUREUkVTU19TVFIpLCBwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTsKKworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHBSeEF1dGhGcmFtZUJvZHktPmF1dGhBbGdvTnVtYmVyICE9IGVTSVJfU0hBUkVEX0tFWSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgKiBSZWNlaXZlZCBBdXRoZW50aWNhdGlvbiBmcmFtZTQgd2l0aCBhbGdvcml0aG0gb3RoZXIgdGhhbgorICAgICAgICAgICAgICAgICAqIFNoYXJlZCBLZXkgYXV0aGVudGljYXRpb24gdHlwZS4KKyAgICAgICAgICAgICAgICAgKiBXYWl0IHVudGlsIEF1dGggZmFpbHVyZSB0aW1lb3V0IHRvIHJlcG9ydCBhdXRoZW50aWNhdGlvbgorICAgICAgICAgICAgICAgICAqIGZhaWx1cmUgdG8gU01FLgorICAgICAgICAgICAgICAgICAqLworCisgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICBGTCgicmVjZWl2ZWQgQXV0aCBmcmFtZTQgZnJvbSBwZWVyIHdpdGggaW52YWxpZCBhdXRoICIKKyAgICAgICAgICAgICAgICAgICAgICAgImFsZ28gJWQgIk1BQ19BRERSRVNTX1NUUiksIHBSeEF1dGhGcmFtZUJvZHktPmF1dGhBbGdvTnVtYmVyLAorICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOykKKworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKCAhdm9zX21lbV9jb21wYXJlKCh0QU5JX1U4ICopIHBIZHItPnNhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopICZwTWFjLT5saW0uZ3BMaW1NbG1BdXRoUmVxLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICogUmVjZWl2ZWQgQXV0aGVudGljYXRpb24gZnJhbWUgZnJvbSBhbiBlbnRpdHkKKyAgICAgICAgICAgICAgICAgKiBvdGhlciB0aGFuIG9uZSB0byB3aGljaCByZXF1ZXN0IHdhcyBpbml0aWF0ZWQuCisgICAgICAgICAgICAgICAgICogV2FpdCB1bnRpbCBBdXRoZW50aWNhdGlvbiBGYWlsdXJlIFRpbWVvdXQuCisgICAgICAgICAgICAgICAgICovCisKKyAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR1csCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBBdXRoIGZyYW1lNCBmcm9tIHVuZXhwZWN0ZWQgcGVlciAiCisgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSRVNTX1NUUiksIE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSk7KQorCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChwUnhBdXRoRnJhbWVCb2R5LT5hdXRoQWxnb051bWJlciAhPQorICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5ncExpbU1sbUF1dGhSZXEtPmF1dGhUeXBlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAqIFJlY2VpdmVkIEF1dGhlbnRpY2F0aW9uIGZyYW1lIHdpdGggYW4gYXV0aCBhbGdvcml0aG0KKyAgICAgICAgICAgICAgICAgKiBvdGhlciB0aGFuIG9uZSByZXF1ZXN0ZWQuCisgICAgICAgICAgICAgICAgICogV2FpdCB1bnRpbCBBdXRoZW50aWNhdGlvbiBGYWlsdXJlIFRpbWVvdXQuCisgICAgICAgICAgICAgICAgICovCisKKyAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBBdXRoZW50aWNhdGlvbiBmcmFtZSBmcm9tIHBlZXIgd2l0aCAiCisgICAgICAgICAgICAgICAgICAgICAgICJpbnZhbGlkIGF1dGggc2VxIG51bWJlciAlZCAiCisgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSRVNTX1NUUiksIHBSeEF1dGhGcmFtZUJvZHktPmF1dGhUcmFuc2FjdGlvblNlcU51bWJlciwKKyAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTspCisKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHBSeEF1dGhGcmFtZUJvZHktPmF1dGhTdGF0dXNDb2RlID09CisgICAgICAgICAgICAgICAgZVNJUl9NQUNfU1VDQ0VTU19TVEFUVVMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICogQXV0aGVudGljYXRpb24gU3VjY2VzcyAhCisgICAgICAgICAgICAgICAgICogSW5mb3JtIFNNRSBvZiBzYW1lLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbUN1cnJlbnRBdXRoVHlwZSA9IGVTSVJfU0hBUkVEX0tFWTsKKworICAgICAgICAgICAgICAgIHBBdXRoTm9kZSA9IGxpbUFjcXVpcmVGcmVlUHJlQXV0aE5vZGUocE1hYywgJnBNYWMtPmxpbS5nTGltUHJlQXV0aFRpbWVyVGFibGUpOworICAgICAgICAgICAgICAgIGlmIChwQXV0aE5vZGUgPT0gTlVMTCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJNYXggcHJlLWF1dGggbm9kZXMgcmVhY2hlZCAiKSk7CisgICAgICAgICAgICAgICAgICAgIGxpbVByaW50TWFjQWRkcihwTWFjLCBwSGRyLT5zYSwgTE9HVyk7CisKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiQWxsb2MgbmV3IGRhdGE6IHBlZXIgIiBNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSk7CisKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKikgcEF1dGhOb2RlLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwTGltTWxtQXV0aFJlcS0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICAgICAgICAgIHBBdXRoTm9kZS0+ZlRpbWVyU3RhcnRlZCA9IDA7CisgICAgICAgICAgICAgICAgcEF1dGhOb2RlLT5hdXRoVHlwZSA9IHBNYWMtPmxpbS5ncExpbU1sbUF1dGhSZXEtPmF1dGhUeXBlOworICAgICAgICAgICAgICAgIHBBdXRoTm9kZS0+c2VxTm8gPSAoKHBIZHItPnNlcUNvbnRyb2wuc2VxTnVtSGkgPDwgNCkgfAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBIZHItPnNlcUNvbnRyb2wuc2VxTnVtTG8pKTsKKyAgICAgICAgICAgICAgICBwQXV0aE5vZGUtPnRpbWVzdGFtcCA9IHZvc190aW1lcl9nZXRfc3lzdGVtX3RpY2tzKCk7CisgICAgICAgICAgICAgICAgbGltQWRkUHJlQXV0aE5vZGUocE1hYywgcEF1dGhOb2RlKTsKKworICAgICAgICAgICAgICAgIGxpbVJlc3RvcmVGcm9tQXV0aFN0YXRlKHBNYWMsIGVTSVJfU01FX1NVQ0NFU1MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJ4QXV0aEZyYW1lQm9keS0+YXV0aFN0YXR1c0NvZGUscHNlc3Npb25FbnRyeSk7CisKKyAgICAgICAgICAgIH0gLy8gaWYgKHBSeEF1dGhGcmFtZUJvZHktPmF1dGhTdGF0dXNDb2RlID09IGVTSVJfTUFDX1NVQ0NFU1NfU1RBVFVTKQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAqIEF1dGhlbnRpY2F0aW9uIGZhaWx1cmUuCisgICAgICAgICAgICAgICAgICogUmV0dXJuIEF1dGggY29uZmlybSB3aXRoIHJlY2VpdmVkIGZhaWx1cmUgY29kZSB0byBTTUUKKyAgICAgICAgICAgICAgICAgKi8KKworICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkF1dGhlbnRpY2F0aW9uIGZhaWx1cmUgZnJvbSBwZWVyICIKKyAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJFU1NfU1RSKSwgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTspCisKKyAgICAgICAgICAgICAgICBsaW1SZXN0b3JlRnJvbUF1dGhTdGF0ZShwTWFjLCBlU0lSX1NNRV9BVVRIX1JFRlVTRUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJ4QXV0aEZyYW1lQm9keS0+YXV0aFN0YXR1c0NvZGUscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICB9IC8vIGVuZCBpZiAoc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VQ0NFU1MpCisgICAgICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgLyoqCisgICAgICogRXhwZWN0IEJlYWNvbiBvbmx5IHdoZW4KKyAgICAgKiAxLiBTVEEgaXMgaW4gU2NhbiBtb2RlIHdhaXRpbmcgZm9yIEJlYWNvbi9Qcm9iZSByZXNwb25zZSBvcgorICAgICAqIDIuIFNUQSBpcyB3YWl0aW5nIGZvciBCZWFjb24vUHJvYmUgUmVzcG9zZSBGcmFtZQorICAgICAqICAgIHRvIGFubm91bmNlIGpvaW4gc3VjY2Vzcy4KKyAgICAgKiAzLiBTVEEvQVAgaXMgaW4gTGVhcm4gbW9kZQorICAgICAqLworICAgIGlmICgocE1hYy0+bGltLmdMaW1NbG1TdGF0ZSA9PSBlTElNX01MTV9XVF9QUk9CRV9SRVNQX1NUQVRFKSB8fAorICAgICAgICAocE1hYy0+bGltLmdMaW1NbG1TdGF0ZSA9PSBlTElNX01MTV9QQVNTSVZFX1NDQU5fU1RBVEUpIHx8CisgICAgICAgIChwTWFjLT5saW0uZ0xpbU1sbVN0YXRlID09IGVMSU1fTUxNX0xFQVJOX1NUQVRFKSB8fAorICAgICAgICAocHNlc3Npb25FbnRyeS0+bGltTWxtU3RhdGUgPT0gZUxJTV9NTE1fV1RfSk9JTl9CRUFDT05fU1RBVEUpCisgICAgICAgIHx8IHBNYWMtPmZTY2FuT2ZmbG9hZAorICAgICAgICApCisgICAgeworICAgICAgICBwQmVhY29uID0gdm9zX21lbV92bWFsbG9jKHNpemVvZih0U2NoQmVhY29uU3RydWN0KSk7CisgICAgICAgIGlmICggTlVMTCA9PSBwQmVhY29uICkKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJVbmFibGUgdG8gYWxsb2NhdGUgbWVtb3J5IGluIGxpbVByb2Nlc3NCZWFjb25GcmFtZSIpICk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICAvLyBQYXJzZSByZWNlaXZlZCBCZWFjb24KKyAgICAgICAgaWYgKHNpckNvbnZlcnRCZWFjb25GcmFtZTJTdHJ1Y3QocE1hYywgKHRBTklfVTggKikgcFJ4UGFja2V0SW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJlYWNvbikgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICAvLyBSZWNlaXZlZCB3cm9uZ2x5IGZvcm1hdHRlZC9pbnZhbGlkIEJlYWNvbi4KKyAgICAgICAgICAgIC8vIElnbm9yZSBpdCBhbmQgbW92ZSBvbi4KKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICAgICAgICAgIEZMKCJSZWNlaXZlZCBpbnZhbGlkIEJlYWNvbiBpbiBzdGF0ZSAlZCIpLAorICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlKTsKKyAgICAgICAgICAgIGxpbVByaW50TWxtU3RhdGUocE1hYywgTE9HVywgIHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlKTsKKyAgICAgICAgICAgIGlmICgoIXBzZXNzaW9uRW50cnktPmN1cnJlbnRCc3NCZWFjb25DbnQpICYmCisgICAgICAgICAgICAgICAoc2lyQ29tcGFyZU1hY0FkZHIoIHBzZXNzaW9uRW50cnktPmJzc0lkLCBwSGRyLT5zYSkpKQorICAgICAgICAgICAgICAgIGxpbVBhcnNlQmVhY29uRm9yVGltKHBNYWMsICh0QU5JX1U4ICopIHBSeFBhY2tldEluZm8sIHBzZXNzaW9uRW50cnkpOworCisgICAgICAgICAgICB2b3NfbWVtX3ZmcmVlKHBCZWFjb24pOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIC8qZHVyaW5nIHNjYW5uaW5nLCB3aGVuIGFueSBzZXNzaW9uIGlzIGFjdGl2ZSwgYW5kIGJlYWNvbi9QciBiZWxvbmdzIHRvCisgICAgICAgICA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XRJbmZvLAorICAgICAgICAgICAgICAgICAgICBlQU5JX0JPT0xFQU5fRkFMU0UsIGVBTklfQk9PTEVBTl9UUlVFKTsKKworICAgICAgICB9CisKKyAgICAgICAgaWYgKChwTWFjLT5saW0uZ0xpbU1sbVN0YXRlICA9PSBlTElNX01MTV9XVF9QUk9CRV9SRVNQX1NUQVRFKSB8fAorICAgICAgICAgICAgKHBNYWMtPmxpbS5nTGltTWxtU3RhdGUgID09IGVMSU1fTUxNX1BBU1NJVkVfU0NBTl9TVEFURSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUNoZWNrQW5kQWRkQnNzRGVzY3JpcHRpb24ocE1hYywgcEJlYWNvbiwgcFJ4UGFja2V0SW5mbywKKyAgICAgICAgICAgICAgICAgICgocE1hYy0+bGltLmdMaW1IYWxTY2FuU3RhdGUgPT0gZUxJTV9IQUxfU0NBTk5JTkdfU1RBVEUpID8KKyAgICAgICAgICAgICAgICAgICAgZUFOSV9CT09MRUFOX1RSVUUgOiBlQU5JX0JPT0xFQU5fRkFMU0UpLAorICAgICAgICAgICAgICAgICAgICBlQU5JX0JPT0xFQU5fRkFMU0UpOworICAgICAgICAgICAgLyogQ2FsbGluZyBkZnNDaGFubmVsTGlzdCB3aGljaCB3aWxsIGNvbnZlcnQgREZTIGNoYW5uZWwKKyAgICAgICAgICAgICAqIHRvIEFjdGl2ZSBjaGFubmVsIGZvciB4IHNlY3MgaWYgdGhpcyBjaGFubmVsIGlzIERGUyBjaGFubmVsICovCisgICAgICAgICAgICAgbGltU2V0REZTQ2hhbm5lbExpc3QocE1hYywgcEJlYWNvbi0+Y2hhbm5lbE51bWJlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwTWFjLT5saW0uZGZzY2hhbm5lbExpc3QpOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHBNYWMtPmxpbS5nTGltTWxtU3RhdGUgPT0gZUxJTV9NTE1fTEVBUk5fU1RBVEUpCisgICAgICAgIHsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSA9PSBlTElNX01MTV9XVF9KT0lOX0JFQUNPTl9TVEFURSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYoIHBzZXNzaW9uRW50cnktPmJlYWNvbiAhPSBOVUxMICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocHNlc3Npb25FbnRyeS0+YmVhY29uKTsKKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5iZWFjb24gPSBOVUxMOworICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5iY25MZW4gPSBXREFfR0VUX1JYX1BBWUxPQURfTEVOKHBSeFBhY2tldEluZm8pOworICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmJlYWNvbiA9IHZvc19tZW1fbWFsbG9jKHBzZXNzaW9uRW50cnktPmJjbkxlbik7CisgICAgICAgICAgICAgaWYgKCBOVUxMID09IHBzZXNzaW9uRW50cnktPmJlYWNvbiApCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlVuYWJsZSB0byBhbGxvY2F0ZSBtZW1vcnkgdG8gc3RvcmUgYmVhY29uIikpOykKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvL1N0b3JlIHRoZSBCZWFjb24vUHJvYmVSc3AuIFRoaXMgaXMgc2VudCB0byBjc3IvaGRkIGluIGpvaW4gY25mIHJlc3BvbnNlLiAKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocHNlc3Npb25FbnRyeS0+YmVhY29uLCBXREFfR0VUX1JYX01QRFVfREFUQShwUnhQYWNrZXRJbmZvKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcH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mb2cocE1hYywgTE9HRSwgRkwoIlVuYWJsZSB0byBhbGxvY2F0ZSBtZW1vcnkgaW4gbGltUHJvY2Vzc0JlYWNvbkZyYW1lTm9TZXNzaW9uIikgKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChzaXJDb252ZXJ0QmVhY29uRnJhbWUyU3RydWN0KHBNYWMsICh0QU5JX1U4ICopIHBSeFBhY2tldEluZm8sIHBCZWFjb24pICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgLy8gUmVjZWl2ZWQgd3JvbmdseSBmb3JtYXR0ZWQvaW52YWxpZCBCZWFjb24uIElnbm9yZSBhbmQgbW92ZSBvbi4gCisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgRkwoIlJlY2VpdmVkIGludmFsaWQgQmVhY29uIGluIGdsb2JhbCBNTE0gc3RhdGUgJWQiKSwgcE1hYy0+bGltLmdMaW1NbG1TdGF0ZSk7CisgICAgICAgICAgICBsaW1QcmludE1sbVN0YXRlKHBNYWMsIExPR1csICBwTWFjLT5saW0uZ0xpbU1sbVN0YXRlKTsKKyAgICAgICAgICAgIHZvc19tZW1fdmZyZWUocEJlYWNvbik7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBpZiAoIChwTWFjLT5saW0uZ0xpbU1sbVN0YXRlID09IGVMSU1fTUxNX1dUX1BST0JFX1JFU1BfU1RBVEUpIHx8CisgICAgICAgICAgICAgKHBNYWMtPmxpbS5nTGltTWxtU3RhdGUgPT0gZUxJTV9NTE1fUEFTU0lWRV9TQ0FOX1NUQVRFKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUNoZWNrQW5kQWRkQnNzRGVzY3JpcHRpb24ocE1hYywgcEJlYWNvbiwgcFJ4UGFja2V0SW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUFOSV9CT09MRUFOX1RSVUU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GVzZXNzaW9uRW50cnkpCit7CisgICAgdEFOSV9VMzIgdmFsID0gMDsKKworICAgIGlmKCggcGVzZXNzaW9uRW50cnkgIT0gTlVMTCApICYmIChwZXNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0FQX1JPTEUgKSl7CisgICAgICAgIGlmIChwZXNlc3Npb25FbnRyeS0+Z0xpbVByb3RlY3Rpb25Db250cm9sID09IFdOSV9DRkdfRk9SQ0VfUE9MSUNZX1BST1RFQ1RJT05fRElTQUJMRSApCisgICAgICAgICAgICB2b3NfbWVtX3NldCgodm9pZCAqKSZwZXNlc3Npb25FbnRyeS0+Y2ZnUHJvdGVjdGlvbiwgc2l6ZW9mKHRDZmdQcm90ZWN0aW9uKSwgMCk7CisgICAgICAgIGVsc2V7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIiBmcm0xMWEgPSAlZCwgZnJvbTExYiA9ICVkLCBmcm0xMWcgPSAlZCwgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImh0MjAgPSAlZCwgbm9uZ2YgPSAlZCwgbHNpZ1R4b3AgPSAlZCwgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInJpZnMgPSAlZCwgb2JzcyA9ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZXNlc3Npb25FbnRyeS0+Y2ZnUHJvdGVjdGlvbi5mcm9tbGxhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVzZXNzaW9uRW50cnktPmNmZ1Byb3RlY3Rpb24uZnJvbWxsYiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBlc2Vzc2lvbkVudHJ5LT5jZmdQcm90ZWN0aW9uLmZyb21sbGcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZXNlc3Npb25FbnRyeS0+Y2ZnUHJvdGVjdGlvbi5odDIwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVzZXNzaW9uRW50cnktPmNmZ1Byb3RlY3Rpb24ubm9uR2YsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZXNlc3Npb25FbnRyeS0+Y2ZnUHJvdGVjdGlvbi5sc2lnVHhvcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBlc2Vzc2lvbkVudHJ5LT5jZmdQcm90ZWN0aW9uLnJpZnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZXNlc3Npb25FbnRyeS0+Y2ZnUHJvdGVjdGlvbi5vYnNzKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNleworICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0ZPUkNFX1BPTElDWV9QUk9URUNUSU9OLCAmdmFsKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoInJlYWRpbmcgV05JX0NGR19GT1JDRV9QT0xJQ1lfUFJPVEVDVElPTiBjZmcgZmFpbGVkIikpOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIGVsc2UKKyAgICAgICAgcE1hYy0+bGltLmdMaW1Qcm90ZWN0aW9uQ29udHJvbCA9ICh0QU5JX1U4KXZhbDsKKworICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX1BST1RFQ1RJT05fRU5BQkxFRCwgJnZhbCkgIT0gZVNJUl9TVUNDRVNTKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJyZWFkaW5nIHByb3RlY3Rpb24gY2ZnIGZhaWxlZCIpKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmIChwTWFjLT5saW0uZ0xpbVByb3RlY3Rpb25Db250cm9sID09IFdOSV9DRkdfRk9SQ0VfUE9MSUNZX1BST1RFQ1RJ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AgICZ2YWwxKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgRkwoIlVuYWJsZSB0byByZXRyaWV2ZSBleGNsdWRlVW5lbmNyIGZyb20gQ0ZHIikpOworICAgICAgICAgICAgfQorI2lmIDAKKyAgICAgICAgICAgIGhhbFNldFNwRXhjbFVuZGVjcnlwdGVkKHBNYWMsICh0SGFsQml0VmFsKSB2YWwpOworI2Vsc2UKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgIEZMKCJVbnN1cHBvcnRlZCBDRkc6IFdOSV9DRkdfRVhDTFVERV9VTkVOQ1JZUFRFRCIpKTsKKyNlbmRpZgorCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFdOSV9DRkdfQVNTT0NJQVRJT05fRkFJTFVSRV9USU1FT1VUOgorICAgICAgICAgICAgaWYgKHBNYWMtPmxpbS5nTGltTWxtU3RhdGUgIT0gZUxJTV9NTE1fV1RfQVNTT0NfUlNQX1NUQVRFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vICdDaGFuZ2UnIHRpbWVyIGZvciBmdXR1cmUgYWN0aXZhdGlvbnMKKyAgICAgICAgICAgICAgICBsaW1EZWFjdGl2YXRlQW5kQ2hhbmdlVGltZXIocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUxJTV9BU1NPQ19GQUlMX1RJTUVSKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBXTklfQ0ZHX0JBQ0tHUk9VTkRfU0NBTl9QRVJJT0Q6CisKKworICAgICAgICAgICAgbGltRGVhY3RpdmF0ZUFuZENoYW5nZVRpbWVyKHBNYWMsIGVMSU1fQkFDS0dST1VORF9TQ0FOX1RJTUVSKTsKKworICAgICAgICAgICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfQkFDS0dST1VORF9TQ0FOX1BFUklPRCwgJnZhbDEpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgQmFja2dyb3VuZCBzY2FuIHBlcmlvZCB2YWx1ZSIpKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICh2YWwxID09IDApCisgICAgICAgICAgICAgICAgYnJlYWs7CisKKworCisgICAgICAgICAgICBpZiAoIChwTWFjLT5saW0uZ0xpbVN5c3RlbVJvbGUgPT0gZUxJTV9TVEFfUk9MRSkgfHwKKyAgICAgICAgICAgICAgICAgKCAocE1hYy0+bGltLmdMaW1TeXN0ZW1Sb2xlID09IGVMSU1fU1RBX0lOX0lCU1NfUk9MRSkgJiYKKyAgICAgICAgICAgICAgICAgICAocE1hYy0+bGltLmdMaW1TbWVTdGF0ZSA9PSBlTElNX1NNRV9OT1JNQUxfU1RBVEUpKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBSZWFjdGl2YXRlIEJhY2tncm91bmQgc2NhbiB0aW1lcgorICAgICAgICAgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RJTUVSX0FDVElWQVRFLCBOT19TRVNTSU9OLCBlTElNX0JBQ0tHUk9VTkRfU0NBTl9USU1FUikpOworICAgICAgICAgICAgICAgIGlmICh0eF90aW1lcl9hY3RpdmF0ZSgKKyAgICAgICAgICAgICAgICAgICAgICAmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltQmFja2dyb3VuZFNjYW5UaW1lcikgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vLyBDb3VsZCBub3QgYWN0aXZhdGUgYmFja2dyb3VuZCBzY2FuIHRpbWVyLgorICAgICAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCBhY3RpdmF0ZSBiYWNrZ3JvdW5kIHNjYW4gdGltZXIiKSk7CisgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltQmFja2dyb3VuZFNjYW5TdGFydGVkID0gRkFMU0U7CisgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltQmFja2dyb3VuZFNjYW5UZXJtaW5hdGUgPSBUUlVFOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbUJhY2tncm91bmRTY2FuU3RhcnRlZCA9IFRSVUU7CisgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltQmFja2dyb3VuZFNjYW5UZXJtaW5hdGUgPSBGQUxTRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgIFBFTE9HMyhsaW1Mb2cocE1hYywgTE9HMywKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIlVwZGF0ZWQgQmFja2dyb3VuZCBzY2FuIHBlcmlvZCIpKTspCisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgV05JX0NGR19CR19TQ0FOX0NIQU5ORUxfTElTVDoKKyAgICAgICAgICAgIFBFTE9HMShsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgIEZMKCJWQUxJRF9DSEFOTkVMX0xJU1QgaGFzIGNoYW5nZWQsIHJlc2V0IG5leHQgYmcgc2NhbiBjaGFubmVsIikpOykKKyAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltQmFja2dyb3VuZFNjYW5DaGFubmVsSWQgPSAwOworCisgICAgICAgICAgICBicmVhazsKKworICAgIGNhc2UgV05JX0NGR19UUklHX1NUQV9CS19TQ0FOOgorICAgICAgICBpZihsaW1VcGRhdGVUcmlnZ2VyU3RhQmtTY2FuRmxhZyhwTWFjKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICBQRUxPRzIobGltTG9nKHBNYWMsIExPRzIsCisgICAgICAgICAgICAgICBGTCgiVXBkYXRpbmcgbGltIHRyaWdnZXIgc3RhIGJrIHNjYW4gZ2xvYmFsIGZsYWcgZmFpbGVkISIpKTspCisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisKKyAgICBjYXNlIFdOSV9DRkdfUFJPVEVDVElPTl9FTkFCTEVEOgorICAgICAgICBsaW1TZXRDZmdQcm90ZWN0aW9uKHBNYWMsIE5VTEwpOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFdOSV9DRkdfUFJPQkVfUlNQX0JDTl9BREROSUVfRkxBRzoKKyAgICB7CisgICAgICAgIHRTaXJNc2dRIG1zZyA9IHswfTsKKyAgICAgICAgdEFOSV9VMzIgc3RhdHVzOworCisgICAgICAgIG1zZy50eXBlID0gU0lSX0xJTV9VUERBVEVfQkVBQ09OOworCisgICAgICAgIHN0YXR1cyA9IGxpbVBvc3RNc2dBcGkocE1hYywgJm1zZyk7CisKKyAgICAgICAgaWYgKHN0YXR1cyAhPSBUWF9TVUNDRVNTKQorICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIGxpbVBvc3RNc2dBcGkgJXUiKSwgc3RhdHVzKTspCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIFdOSV9DRkdfR1JFRU5GSUVMRF9DQVBBQklMSVRZOgorICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19IVF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gICAgIHsKKyAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBXTklfQ0ZHX0hUX0NBUF9JTkZPICIpKTspCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19IVF9SWF9TVEJDLCAmdmFsMikgIT0gZVNJUl9TVUNDRVNTKSAKKyAgICAgICAgeworICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IHJldHJpZXZlIFdOSV9DRkdfSFRfUlhfU1RCQyIpKTspCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICB2YWwxNiA9ICggdEFOSV9VMTYgKSB2YWwxOworICAgICAgICBwSFRDYXBhYmlsaXR5SW5mbyA9ICggdFNpck1hY0hUQ2FwYWJpbGl0eUluZm8qICkgJnZhbDE2OworICAgICAgICBwSFRDYXBhYmlsaXR5SW5mby0+cnhTVEJDID0gKHRBTklfVTE2KXZhbDI7CisgICAgICAgIGlmKGNmZ1NldEludChwTWFjLCBXTklfQ0ZHX0hUX0NBUF9JTkZPLCAqKHRBTklfVTE2KilwSFRDYXBhYmlsaXR5SW5mbykgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IHVwZGF0ZSBIVCBDYXAgSW5mbyBDRkciKSk7KQorICAgICAgICBicmVhazsKKworICAgIGNhc2UgV05JX0NGR19NQVhfQU1TRFVfTEVOR1RIOgorICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19IVF9DQVBfSU5GTywgJnZhbDEpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIE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IEZMKCJjb3VsZCBub3QgcmV0cmlldmUgSFQgQ2FwIENGRyIpKTspCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX1NIT1JUX0dJXzIwTUhaLCAmdmFsMikgIT0gZVNJUl9TVUNDRVNTKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgc2hvcnRHSSAyME1oeiBDRkciKSk7KQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB2YWwxNiA9ICggdEFOSV9VMTYgKSB2YWwxOworICAgICAgICBwSFRDYXBhYmlsaXR5SW5mbyA9ICggdFNpck1hY0hUQ2FwYWJpbGl0eUluZm8qICkgJnZhbDE2OworICAgICAgICBwSFRDYXBhYmlsaXR5SW5mby0+c2hvcnRHSTIwTUh6ID0gKHRBTklfVTE2KXZhbDI7CisgICAgICAgIGlmKGNmZ1NldEludChwTWFjLCAgV05JX0NGR19IVF9DQVBfSU5GTywgKih0QU5JX1UxNiopcEhUQ2FwYWJpbGl0eUluZm8pICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoImNvdWxkIG5vdCB1cGRhdGUgSFQgQ2FwIEluZm8gQ0ZHIikpOykKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBXTklfQ0ZHX1NIT1JUX0dJXzQwTUhaOgorICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19IVF9DQVBfSU5GTywgJnZhbDEpICE9IGVTSVJfU1VDQ0VTUykgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IHJldHJpZXZlIEhUIENhcCBDRkciKSk7KQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19TSE9SVF9HSV80ME1IWiwgJnZhbDIpICE9IGVTSVJfU1VDQ0VTUykgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IHJldHJpZXZlIHNob3J0R0kgNDBNaHogQ0ZHIikpOykKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgdmFsMTYgPSAoIHRBTklfVTE2ICkgdmFsMTsKKyAgICAgICAgcEhUQ2FwYWJpbGl0eUluZm8gPSAoIHRTaXJNYWNIVENhcGFiaWxpdHlJbmZvKiApICZ2YWwxNjsKKyAgICAgICAgcEhUQ2FwYWJpbGl0eUluZm8tPnNob3J0R0k0ME1IeiA9ICh0QU5JX1UxNil2YWwyOworICAgICAgICBpZihjZmdTZXRJbnQocE1hYywgIFdOSV9DRkdfSFRfQ0FQX0lORk8sICoodEFOSV9VMTYqKXBIVENhcGFiaWxpdHlJbmZvKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJjb3VsZCBub3QgdXBkYXRlIEhUIENhcCBJbmZvIENGRyIpKTspCisgICAgICAgIGJyZWFrOworICAgIGNhc2UgV05JX0NGR19NUERVX0RFTlNJVFk6CisgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0hUX0FNUERVX1BBUkFNUywgJnZhbDEpICE9IGVTSVJfU1VDQ0VTUykgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IHJldHJpZXZlIEhUIEFNUERVIFBhcmFtIENGRyIpKTspCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX01QRFVfREVOU0lUWSwgJnZhbDIpICE9IGVTSVJfU1VDQ0VTUykgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IHJldHJpZXZlIE1QRFUgRGVuc2l0eSBDRkciKSk7KQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB2YWwxNiA9ICggdEFOSV9VMTYgKSB2YWwxOworICAgICAgICBwQW1wZHVQYXJhbUluZm8gPSAoIHRTaXJNYWNIVFBhcmFtZXRlcnNJbmZvKiApICZ2YWwxNjsKKyAgICAgICAgcEFtcGR1UGFyYW1JbmZvLT5tcGR1RGVuc2l0eSA9ICh0QU5JX1U4KXZhbDI7CisgICAgICAgIGlmKGNmZ1NldEludChwTWFjLCAgV05JX0NGR19IVF9BTVBEVV9QQVJBTVMsICoodEFOSV9VOCopcEFtcGR1UGFyYW1JbmZvKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJjb3VsZCBub3QgdXBkYXRlIEhUIEFNUERVIFBhcmFtIENGRyIpKTspCisKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBXTklfQ0ZHX01BWF9SWF9BTVBEVV9GQUNUT1I6CisgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0hUX0FNUERVX1BBUkFNUywgJnZhbDEpICE9IGVTSVJfU1VDQ0VTUykgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IHJldHJpZXZlIEhUIEFNUERVIFBhcmFtIENGRyIpKTspCisgICAgICAgICAg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kVTSE9MRCBDRkciKSk7KQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGlmKCF2YWwxKSAKKyAgICAgICAgeworICAgICAgICAgICAgbGltRGVhY3RpdmF0ZUFuZENoYW5nZVRpbWVyKHBNYWMsIGVMSU1fSEVBUlRfQkVBVF9USU1FUik7CisgICAgICAgICAgICBwTWFjLT5zeXMuZ1N5c0VuYWJsZUxpbmtNb25pdG9yTW9kZSA9IDA7CisgICAgICAgIH0gCisgICAgICAgIGVsc2UgCisgICAgICAgIHsKKyAgICAgICAgICAgIHRBTklfVTE2IHNlc3Npb25JZDsKKyAgICAgICAgICAgIHBNYWMtPnN5cy5nU3lzRW5hYmxlTGlua01vbml0b3JNb2RlID0gMTsKKyAgICAgICAgICAgIGZvcihzZXNzaW9uSWQgPSAwOyBzZXNzaW9uSWQgPCBwTWFjLT5saW0ubWF4QnNzSWQ7IHNlc3Npb25JZCsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKCAocE1hYy0+bGltLmdwU2Vzc2lvbltzZXNzaW9uSWRdLnZhbGlkICkmJgorICAgICAgICAgICAgICAgICAgICAoZUxJTV9NTE1fTElOS19FU1RBQkxJU0hFRF9TVEFURSA9PSBwTWFjLT5saW0uZ3BTZXNzaW9uW3Nlc3Npb25JZF0ubGltTWxtU3RhdGUpICYmCisgICAgICAgICAgICAgICAgICAgICggcE1hYy0+cG1tLmdQbW1TdGF0ZSAhPSBlUE1NX1NUQVRFX0JNUFNfU0xFRVApICYmCisgICAgICAgICAgICAgICAgICAgICghSVNfQUNUSVZFTU9ERV9PRkZMT0FEX0ZFQVRVUkVfRU5BQkxFKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIFBFTE9HMihsaW1Mb2cocE1hYywgTE9HMiwgIkhCIGxpbmsgbW9uaXRvcmluZyByZWFjdGl2YXRlZCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIgZm9yIHNlc3Npb249JWQiLCBzZXNzaW9uSWQpOykKKyAgICAgICAgICAgICAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCAiQmVmb3JlIHJlYWN0aXZhdGluZyBIQiB0aW1lcjsgcGFyYW1ldGVycyBhcmUiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiIHNlc3Npb249JWQgbGltTWxtU3RhdGU9JWQgcG1tU3RhdGU9JWQiLCBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5ncFNlc3Npb25bc2Vzc2lvbklkXS5saW1NbG1TdGF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+cG1tLmdQbW1TdGF0ZSk7KQorICAgICAgICAgICAgICAgICAgICBsaW1SZWFjdGl2YXRlSGVhcnRCZWF0VGltZXIocE1hYywgJnBNYWMtPmxpbS5ncFNlc3Npb25bc2Vzc2lvbklkXSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKCBwTWFjLT5saW0uZ3BTZXNzaW9uW3Nlc3Npb25JZF0udmFsaWQgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCAiSEIgbGluayBtb25pdG9yaW5nIG5vdCByZWFjdGl2YXRlZC0iCisgICAgICAgICAgICAgICAgICAgICAgICAgICAic2Vzc2lvbj0lZCwgbGltTWxtU3RhdGU9JWQsIGdQbW1TdGF0ZT0lZCIsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkLCBwTWFjLT5saW0uZ3BTZXNzaW9uW3Nlc3Npb25JZF0ubGltTWxtU3RhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5wbW0uZ1BtbVN0YXRlKTspCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9ICAgICAgICAKKyAgICBjYXNlIFdOSV9DRkdfTUFYX1BTX1BPTEw6CisgICAgY2FzZSBXTklfQ0ZHX05VTV9CRUFDT05fUEVSX1JTU0lfQVZFUkFHRToKKyAgICBjYXNlIFdOSV9DRkdfTUlOX1JTU0lfVEhSRVNIT0xEOgorICAgIGNhc2UgV05JX0NGR19OVEhfQkVBQ09OX0ZJTFRFUjoKKyAgICBjYXNlIFdOSV9DRkdfQlJPQURDQVNUX0ZSQU1FX0ZJTFRFUl9FTkFCTEU6CisgICAgICAgIHsKKyAgICAgICAgICAgIHRwU2lyUG93ZXJTYXZlQ2ZnIHBQb3dlclNhdmVDb25maWc7CisKKyAgICAgICAgICAgIC8qIEFsbG9jYXRlIGFuZCBmaWxsIGluIHBvd2VyIHNhdmUgY29uZmlndXJhdGlvbi4gKi8KKyAgICAgICAgICAgIHBQb3dlclNhdmVDb25maWcgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpclBvd2VyU2F2ZUNmZykpOworICAgICAgICAgICAgaWYgKCBOVUxMID09IHBQb3dlclNhdmVDb25maWcgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkxJTTogQ2Fubm90IGFsbG9jYXRlIG1lbW9yeSBmb3IgcG93ZXIgc2F2ZSBjb25maWd1cmF0aW9uIikpOykKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyogVGhpcyBjb250ZXh0IHNob3VsZCBiZSB2YWxpZCBpZiBwb3dlci1zYXZlIGNvbmZpZ3VyYXRpb24gbWVzc2FnZSBoYXMgYmVlbiBhbHJlYWR5IGRpc3BhdGhlZCAKKyAgICAgICAgICAgICAqIGR1cmluZyBpbml0aWFsaXphdGlvbiBwcm9jZXNzLiBSZS11c2luZyB0aGUgcHJlc2VudCBjb25maWd1cmF0aW9uIG1hc2sKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBQb3dlclNhdmVDb25maWcsICh0QU5JX1U4ICopJnBNYWMtPnBtbS5nUG1tQ2ZnLCBzaXplb2YodFNpclBvd2VyU2F2ZUNmZykpOworCisgICAgICAgICAgICBpZiAoIChwbW1TZW5kUG93ZXJTYXZlQ2ZnKHBNYWMsIHBQb3dlclNhdmVDb25maWcpKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiTElNOiBwbW1TZW5kUG93ZXJTYXZlQ2ZnKCkgZmFpbGVkICIpKTspCisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisKKworICAgICBjYXNlIFdOSV9DRkdfRE9UMTFfTU9ERToKKyAgICAgICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfRE9UMTFfTU9ERSwgJnZhbDEpICE9IGVTSVJfU1VDQ0VTUykgCisgICAgICAgIHsKKyAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBEb3QxMSBNb2RlICBDRkciKSk7KQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgLyogVE9ETyAqLworICAgICAgICAvL3BzZXNzaW9uRW50cnktPmRvdDExbW9kZSA9IHZhbDE7ICAgIC8vLy8gdW4gY29tbWVudCB0aGlzIGxpbmUgLi4uRk9SQlVJTEQgLVRFTVBGSVguLiBIT1cgVE8gR0VUIHNlc3Npb25FbnRyeT8/Pz8/CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgV05JX0NGR19BRERCQV9SRVFfREVDTElORToKKyAgICAgICAgaWYod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19BRERCQV9SRVFfREVDTElORSwgJnZhbDEpICE9IGVTSVJfU1VDQ0VTUykgeworICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCggIlVuYWJsZSB0byBnZXQgQUREQkFfUkVRX0RFQ0xJTkUgY2ZnIiApKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIHBNYWMtPmxpbS5nQWRkQkFfRGVjbGluZWQgPSAodEFOSV9VOCl2YWwxOworICAgICAgICBicmVhazsKKyAgICAgICAgCisgICAgY2FzZSBXTklfQ0ZHX1NDQU5fSU5fUE9XRVJTQVZFOgorICAgICAgICBpZih3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX1NDQU5fSU5fUE9XRVJTQVZFLCAmdmFsMSkgIT0gZVNJUl9TVUNDRVNTKSB7CisgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCAiVW5hYmxlIHRvIGdldCBXTklfQ0ZHX1NDQU5fSU5fUE9XRVJTQVZFICIgKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBwTWFjLT5saW0uZ1NjYW5JblBvd2Vyc2F2ZSA9ICh0QU5JX1U4KXZhbDE7CisgICAgICAgIGJyZWFrOworCisKKyAgICBjYXNlIFdOSV9DRkdfQVNTT0NfU1RBX0xJTUlUOgorICAgICAgICBpZih3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0FTU09DX1NUQV9MSU1JVCwgJnZhbDEpICE9IGVTSVJfU1VDQ0VTUykgeworICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCggIlVuYWJsZSB0byBnZXQgV05JX0NGR19BU1NPQ19TVEFfTElNSVQiICkpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgcE1hYy0+bGltLmdMaW1Bc3NvY1N0YUxpbWl0ID0gKHRBTklfVTE2KXZhbDE7CisgICAgICAgIGJyZWFrOworCisgICAgY2FzZSBXTklfQ0ZHX0RFTF9BTExfUlhfVFhfQkFfU0VTU0lPTlNfMl80X0dfQlRDOgorICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQKKyAgICAgICAgICAgKHBNYWMsIFdOSV9DRkdfREVMX0FMTF9SWF9UWF9CQV9TRVNTSU9OU18yXzRfR19CVEMsICZ2YWwxKSAhPQorICAgICAgICAgICAgICAgICBlU0lSX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICBGTCggIlVuYWJsZSB0byBnZXQgV05JX0NGR19ERUxfQUxMX1JYX1RYX0JBX1NFU1NJT05TXzJfNF9HX0JUQyIpKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGlmICh2YWwxKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgICAgICBGTCgiQlRDIHJlcXVlc3RlZCB0byBkaXNhYmxlIGFsbCBSWCBCQSBzZXNzaW9ucyIpKTsKKyAgICAgICAgICAgIGxpbURlbFBlckJzc0JBU2Vzc2lvbnNCdGMocE1hYyk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgICAgICBGTCgiUmVzZXR0aW5nIHRoZSBXTklfQ0ZHX0RFTF9BTExfUlhfVFhfQkFfU0VTU0lPTlNfMl80X0dfQlRDIikpOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworCisgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGJyZWFrOworICAgIH0KK30gLyoqKiBlbmQgbGltSGFuZGxlQ0ZHcGFyYW1VcGRhdGUoKSAqKiovCisKKworCisvKioKKyAqIGxpbUFwcGx5Q29uZmlndXJhdGlvbigpCisgKgorICpGVU5DVElPTjoKKyAqIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIHRvIGFwcGx5IHRoZSBjb25maWd1cmVkIHBhcmFtZXRlcnMKKyAqIGJlZm9yZSBqb2luaW5nI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XB0aW9uLgorICoKKyAqTE9HSUM6CisgKgorICpBU1NVTVBUSU9OUzoKKyAqCisgKk5PVEU6CisgKgorICogQHBhcmFtICBwTWFjIC0gUG9pbnRlciB0byBHbG9iYWwgTUFDIHN0cnVjdHVyZQorICogQHBhcmFtICAqcFJ4UGFja2V0SW5mbyAtIEEgcG9pbnRlciB0byBCdWZmZXIgZGVzY3JpcHRvciArIGFzc29jaWF0ZWQgUERVcworICogQHJldHVybiBOb25lCisgKi8KKwordm9pZAorbGltUHJvY2Vzc0RlYXV0aEZyYW1lKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggKnBSeFBhY2tldEluZm8sIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpCit7CisgICAgdEFOSV9VOCAgICAgICAgICAgKnBCb2R5OworICAgIHRBTklfVTE2ICAgICAgICAgIGFpZCwgcmVhc29uQ29kZTsKKyAgICB0cFNpck1hY01nbXRIZHIgICBwSGRyOworICAgIHRMaW1NbG1Bc3NvY0NuZiAgIG1sbUFzc29jQ25mOworICAgIHRMaW1NbG1EZWF1dGhJbmQgIG1sbURlYXV0aEluZDsKKyAgICB0cERwaEhhc2hOb2RlICAgICBwU3RhRHM7CisgICAgdHBQRVNlc3Npb24gICAgICAgcFJvYW1TZXNzaW9uRW50cnk9TlVMTDsKKyAgICB0QU5JX1U4ICAgICAgICAgICByb2FtU2Vzc2lvbklkOworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMVcKKyAgICB0QU5JX1UzMiAgICAgICAgICBmcmFtZUxlbjsKKyNlbmRpZgorCisKKyAgICBwSGRyID0gV0RBX0dFVF9SWF9NQUNfSEVBREVSKHBSeFBhY2tldEluZm8pOworCisgICAgcEJvZHkgPSBXREFfR0VUX1JYX01QRFVfREFUQShwUnhQYWNrZXRJbmZvKTsKKworCisgICAgaWYgKChlTElNX1NUQV9ST0xFID09IHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUpICYmIChlTElNX1NNRV9XVF9ERUFVVEhfU1RBVEUgPT0gcHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUpKQorICAgIHsKKyAgICAgICAgLypFdmVyeSAxNXRoIGRlYXV0aCBmcmFtZSB3aWxsIGJlIGxvZ2dlZCBpbiBrbXNnKi8KKyAgICAgICAgaWYoIShwTWFjLT5saW0uZGVhdXRoTXNnQ250ICYgMHhGKSkKKyAgICAgICAgeworICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBEZWF1dGggZnJhbWUgaW4gREVBVVRIX1dUX1NUQVRFIgorICAgICAgICAgICAgICIoYWxyZWFkeSBwcm9jZXNzaW5nIHByZXZpb3VzbHkgcmVjZWl2ZWQgREVBVVRIIGZyYW1lKS4uIgorICAgICAgICAgICAgICJEcm9wcGluZyB0aGlzLi4gRGVhdXRoIEZhaWxlZCAlZCIpLCsrcE1hYy0+bGltLmRlYXV0aE1zZ0NudCk7KQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcE1hYy0+bGltLmRlYXV0aE1zZ0NudCsrOworICAgICAgICB9CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBpZiAobGltSXNHcm91cEFkZHIocEhkci0+c2EpKQorICAgIHsKKyAgICAgICAgLy8gUmVjZWl2ZWQgRGVhdXRoIGZyYW1lIGZyb20gYSBCQy9NQyBhZGRyZXNzCisgICAgICAgIC8vIExvZyBlcnJvciBhbmQgaWdub3JlIGl0CisgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBEZWF1dGggZnJhbWUgZnJvbSBhIEJDL01DIGFkZHJlc3MiKSk7KQorCisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBpZiAobGltSXNHcm91cEFkZHIocEhkci0+ZGEpICYmICFsaW1Jc0FkZHJCQyhwSGRyLT5k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kKCBwTWFjLCBwSGRyLT5mYy5zdWJUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4KilwSGRyLCAoZnJhbWVMZW4gKyBzaXplb2YodFNpck1hY01nbXRIZHIpKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5zbWVTZXNzaW9uSWQsIHBzZXNzaW9uRW50cnkpOworICAgICAgICByZXR1cm47CisgICAgfQorI2VuZGlmCisKKyAgICAvLyBHZXQgcmVhc29uQ29kZSBmcm9tIERlYXV0aGVudGljYXRpb24gZnJhbWUgYm9keQorICAgIHJlYXNvbkNvZGUgPSBzaXJSZWFkVTE2KHBCb2R5KTsgCisKKyAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgIEZMKCJSZWNlaXZlZCBEZWF1dGggZnJhbWUgZm9yIEFkZHI6ICJNQUNfQUREUkVTU19TVFIiIChtbG0gc3RhdGUgPSAlcywiCisgICAgICAgICIgc21lIHN0YXRlID0gJWQgc3lzdGVtcm9sZSAgPSAlZCkgd2l0aCByZWFzb24gY29kZSAlZCBmcm9tICIKKyAgICAgICAgTUFDX0FERFJFU1NfU1RSKSwgTUFDX0FERFJfQVJSQVkocEhkci0+ZGEpLAorICAgICAgICBsaW1NbG1TdGF0ZVN0cihwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSksIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlLAorICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlLCByZWFzb25Db2RlLAorICAgICAgICBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOykKKyAgICAgIAorICAgIGlmIChsaW1DaGVja0Rpc2Fzc29jRGVhdXRoQWNrUGVuZGluZyhwTWFjLCAodEFOSV9VOCopcEhkci0+c2EpKQorICAgIHsKKyAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICBGTCgiSWdub3JlIHRoZSBEZWF1dGggcmVjZWl2ZWQsIHdoaWxlIHdhaXRpbmcgZm9yIGFjayBvZiAiCisgICAgICAgICAgICAgICAgICAgICJkaXNhc3NvYy9kZWF1dGgiKSk7KQorICAgICAgICBsaW1DbGVhblVwRGlzYXNzb2NEZWF1dGhSZXEocE1hYywodEFOSV9VOCopcEhkci0+c2EsIDEpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgIAorICAgIGlmICggKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFICl8fChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQlRfQU1QX0FQX1JPTEUpICkKKyAgICB7CisgICAgICAgIHN3aXRjaCAocmVhc29uQ29kZSkKKyAgICAgICAgeworICAgICAgICAgICAgY2FzZSBlU0lSX01BQ19VTlNQRUNfRkFJTFVSRV9SRUFTT046CisgICAgICAgICAgICBjYXNlIGVTSVJfTUFDX0RFQVVUSF9MRUFWSU5HX0JTU19SRUFTT046CisgICAgICAgICAgICAgICAgLy8gVmFsaWQgcmVhc29uQ29kZSBpbiByZWNlaXZlZCBEZWF1dGhlbnRpY2F0aW9uIGZyYW1lCisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgLy8gSW52YWxpZCByZWFzb25Db2RlIGluIHJlY2VpdmVkIERlYXV0aGVudGljYXRpb24gZnJhbWUKKyAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IgYW5kIGlnbm9yZSB0aGUgZnJhbWUKKyAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIERlYXV0aCBmcmFtZSB3aXRoIGludmFsaWQgcmVhc29uQ29kZSAlZCBmcm9tICIKKyAgICAgICAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIpLCByZWFzb25Db2RlLCBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOykKKworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYgKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9TVEFfUk9MRSB8fHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9CVF9BTVBfU1RBX1JPTEUpCisgICAgeworICAgICAgICBzd2l0Y2ggKHJlYXNvbkNvZGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGNhc2UgZVNJUl9NQUNfVU5TUEVDX0ZBSUxVUkVfUkVBU09OOgorICAgICAgICAgICAgY2FzZSBlU0lSX01BQ19QUkVWX0FVVEhfTk9UX1ZBTElEX1JFQVNPTjoKKyAgICAgICAgICAgIGNhc2UgZVNJUl9NQUNfREVBVVRIX0xFQVZJTkdfQlNTX1JFQVNPTjoKKyAgICAgICAgICAgIGNhc2UgZVNJUl9NQUNfQ0xBU1MyX0ZSQU1FX0ZST01fTk9OX0FVVEhfU1RBX1JFQVNPTjoKKyAgICAgICAgICAgIGNhc2UgZVNJUl9NQUNfQ0xBU1MzX0ZSQU1FX0ZST01fTk9OX0FTU09DX1NUQV9SRUFTT046CisgICAgICAgICAgICBjYXNlIGVTSVJfTUFDX1NUQV9OT1RfUFJFX0FVVEhFTlRJQ0FURURfUkVBU09OOgorICAgICAgICAgICAgICAgIC8vIFZhbGlkIHJlYXNvbkNvZGUgaW4gcmVjZWl2ZWQgRGVhdXRoIGZyYW1lCisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgLy8gSW52YWxpZCByZWFzb25Db2RlIGluIHJlY2VpdmVkIERlYXV0aCBmcmFtZQorICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvciBhbmQgaWdub3JlIHRoZSBmcmFtZQorICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICBGTCgicmVjZWl2ZWQgRGVhdXRoIGZyYW1lIHdpdGggaW52YWxpZCByZWFzb25Db2RlICVkIGZyb20gIgorICAgICAgICAgICAgICAgICAgIE1BQ19BRERSRVNTX1NUUiksIHJlYXNvbkNvZGUsIE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSk7KQorCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgLy8gUmVjZWl2ZWQgRGVhdXRoIGZyYW1lIGluIGVpdGhlciBJQlNTCisgICAgICAgIC8vIG9yIHVuLWtub3duIHJvbGUuIExvZyBhbmQgaWdub3JlIGl0CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICBGTCgicmVjZWl2ZWQgRGVhdXRoIGZyYW1lIHdpdGggcmVhc29uQ29kZSAlZCBpbiByb2xlICVkIGZyb20gIgorICAgICAgICAgICBNQUNfQUREUkVTU19TVFIpLHJlYXNvbkNvZGUsIHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUsCisgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSk7CisKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIC8qKiBJZiB3ZSBhcmUgaW4gdGhlIG1pZGRsZSBvZiBSZUFzc29jLCBhIGZldyB0aGluZ3MgY291bGQgaGFwcGVuOgorICAgICAqICAtIFNUQSBpcyByZWFzc29jaWF0aW5nIHRvIGN1cnJlbnQgQVAsIGFuZCByZWNlaXZlcyBkZWF1dGggZnJvbToKKyAgICAgKiAgICAgICAgIGEpIGN1cnJlbnQgQVAgCisgICAgICogICAgICAgICBiKSBvdGhlciBBUAorICAgICAqICAtIFNUQSBpcyByZWFzc29jaWF0aW5nIHRvIG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FJFU1NfU1RSKSxNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOykKKyAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIiBwc2Vzc2lvbkVudHJ5LT5ic3NJZDogIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwc2Vzc2lvbkVudHJ5LT5ic3NJZCkpOykKKyAgICAgICAgICAgIGxpbVJlc3RvcmVQcmVSZWFzc29jU3RhdGUocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX1NNRV9SRUFTU09DX1JFRlVTRUQsIHJlYXNvbkNvZGUscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICB9CisKKyAgICAKKyAgICAvKiBJZiByZWNlaXZlZCBEZUF1dGggZnJvbSBBUCBvdGhlciB0aGFuIHRoZSBvbmUgd2UncmUgdHJ5aW5nIHRvIGpvaW4gd2l0aAorICAgICAqIG5vciBhc3NvY2lhdGVkIHdpdGgsIHRoZW4gaWdub3JlIGRlYXV0aCBhbmQgZGVsZXRlIFByZS1hdXRoIGVudHJ5LgorICAgICAqLworICAgIGlmKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgIT0gZUxJTV9BUF9ST0xFICl7CisgICAgICAgIGlmICghSVNfQ1VSUkVOVF9CU1NJRChwTWFjLCBwSGRyLT5ic3NJZCwgcHNlc3Npb25FbnRyeSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoInJlY2VpdmVkIERlQXV0aCBmcm9tIGFuIEFQIG90aGVyICIKKyAgICAgICAgICAgICJ0aGFuIHdlJ3JlIHRyeWluZyB0byBqb2luLiBJZ25vcmUuICJNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTspCisgICAgICAgICAgICBpZiAobGltU2VhcmNoUHJlQXV0aExpc3QocE1hYywgcEhkci0+c2EpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiUHJlYXV0aCBlbnRyeSBleGlzdC4gIgorICAgICAgICAgICAgICAgICJEZWxldGluZy4uLiAiKSk7CisgICAgICAgICAgICAgICAgbGltRGVsZXRlUHJlQXV0aE5vZGUocE1hYywgcEhkci0+c2EpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgfQorCisgICAgICAgIHBTdGFEcyA9IGRwaExvb2t1cEhhc2hFbnRyeShwTWFjLCBwSGRyLT5zYSwgJmFpZCwgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUpOworCisgICAgICAgIC8vIENoZWNrIGZvciBwcmUtYXNzb2Mgc3RhdGVzCisgICAgICAgIHN3aXRjaCAocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSkKKyAgICAgICAgeworICAgICAgICAgICAgY2FzZSBlTElNX1NUQV9ST0xFOgorICAgICAgICAgICAgY2FzZSBlTElNX0JUX0FNUF9TVEFfUk9MRToKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBlTElNX01MTV9XVF9BVVRIX0ZSQU1FMl9TVEFURToKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgICAgICogQVAgc2VudCBEZWF1dGggZnJhbWUgd2hpbGUgd2FpdGluZworICAgICAgICAgICAgICAgICAgICAgICAgICogZm9yIEF1dGggZnJhbWUyLiBSZXBvcnQgQXV0aCBmYWlsdXJlCisgICAgICAgICAgICAgICAgICAgICAgICAgKiB0byBTTUUuCisgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKworICAgICAgICAgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBEZWF1dGggZnJhbWUgc3RhdGUgJWQgd2l0aCBmYWlsdXJlICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJjb2RlICVkIGZyb20gIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSwgcmVhc29uQ29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbVJlc3RvcmVGcm9tQXV0aFN0YXRlKHBNYWMsIGVTSVJfU01FX0RFQVVUSF9XSElMRV9KT0lOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVhc29uQ29kZSxwc2Vzc2lvbkVudHJ5KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworCisgICAgICAgICAgICAgICAgICAgIGNhc2UgZUxJTV9NTE1fQVVUSEVOVElDQVRFRF9TVEFURToKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIERlYXV0aCBmcmFtZSBzdGF0ZSAlZCB3aXRoICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJyZWFzb25Db2RlPSVkIGZyb20gIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSwgcmVhc29uQ29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAvLy8gSXNzdWUgRGVhdXRoIEluZGljYXRpb24gdG8gU01FLgorICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4ICopICZtbG1EZWF1dGhJbmQucGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtbG1EZWF1dGhJbmQucmVhc29uQ29kZSA9IHJlYXNvbkNvZGU7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlID0gZUxJTV9NTE1fSURMRV9TVEFURTsKKyAgICAgICAgICAgICAgICAgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX01MTV9TVEFURSwgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsIHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlKSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgbGltUG9zdFNtZU1lc3NhZ2UocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExJTV9NTE1fREVBVVRIX0lORCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1UzMiAqKSAmbWxtRGVhdXRoSW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKworICAgICAgICAgICAgICAgICAgICBjYXNlIGVMSU1fTUxNX1dUX0FTU09DX1JTUF9TVEFURToKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgICAgICogQVAgbWF5IGhhdmUgJ2FnZWQtb3V0JyBvdXIgUHJlLWF1dGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIGNvbnRleHQuIERlbGV0ZSBsb2NhbCBwcmUtYXV0aCBjb250ZXh0CisgICAgICAgICAgICAgICAgICAgICAgICAgKiBpZiBhbnkgYW5kIGlzc3VlIEFTU09DX0NORiB0byBTTUUuCisgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgicmVjZWl2ZWQgRGVhdXRoIGZyYW1lIHN0YXRlICVkIHdpdGggIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgInJlYXNvbkNvZGU9JWQgZnJvbSAiTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlLCByZWFzb25Db2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxpbVNlYXJjaFByZUF1dGhMaXN0KHBNYWMsIHBIZHItPnNhKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1EZWxldGVQcmVBdXRoTm9kZShwTWFjLCBwSGRyLT5zYSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPnBMaW1NbG1Kb2luUmVxKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwc2Vzc2lvbkVudHJ5LT5wTGltTWxtSm9pblJlcSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cExpbU1sbUpvaW5SZXEgPSBOVUxMOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBtbG1Bc3NvY0NuZi5yZXN1bHRDb2RlID0gZVNJUl9TTUVfREVBVVRIX1dISUxFX0pPSU47CisgICAgICAgICAgICAgICAgICAgICAgICBtbG1Bc3NvY0NuZi5wcm90U3RhdHVzQ29kZSA9IHJlYXNvbkNvZGU7CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIFBFIHNlc3Npb24gSWQqLworICAgICAgICAgICAgICAgICAgICAgICAgbWxtQXNzb2NDbmYuc2Vzc2lvbklkID0gcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQ7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltUHJldk1sbVN0YXRlOworICAgICAgICAgICAgICAgICAgICAgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfTUxNX1NUQVRFLCBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwgcHNlc3Npb25FbnRyeS0+bGltTWxtU3RhdGUpKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgLy8gRGVhY3RpdmUgQXNzb2NpYXRpb24gcmVzcG9uc2UgdGltZW91dAorICAgICAgICAgICAgICAgICAgICAgICAgbGltRGVhY3RpdmF0ZUFuZENoYW5nZVRpbWVyKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUxJTV9BU1NPQ19GQUlMX1RJTUVSKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgbGltUG9zdFNtZU1lc3NhZ2UoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMSU1fTUxNX0FTU09DX0NORiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VMzIgKikgJm1sbUFzc29jQ25mKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworCisgICAgICAgICAgICAgICAgICAgIGNhc2UgZUxJTV9NTE1fV1RfQUREX1NUQV9SU1BfU1RBVEU6CisgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+ZkRlYXV0aFJlY2VpdmVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICBQRUxPR1cobGltTG9nKHBNYWMsIExPR1csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIlJlY2VpdmVkIERlYXV0aCBmcmFtZSBpbiBzdGF0ZSAlZCB3aXRoIFJlYXNvbiAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkNvZGUgJWQgZnJvbSBQZWVyIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltTWxtU3RhdGUsIHJlYXNvbkNvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTspCisgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDsKKworICAgICAgICAgICAgICAgICAgICBjYXNlIGVMSU1fTUxNX0lETEVfU1RBVEU6CisgICAgICAgICAgICAgICAgICAgIGNhc2UgZUxJTV9NTE1fTElOS19FU1RBQkxJU0hFRF9TVEFURToKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChOVUxMICE9IHBTdGFEcykgJiYgKFNUQV9FTlRSWV9URExTX1BFRVIgPT0gcFN0YURzLT5zdGFUeXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBEZWF1dGggZnJhbWUgaW4gc3RhdGUgJWQgd2l0aCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAicmVhc29uIGNvZGUgJWQgZnJvbSBUZGxzIHBlZXIiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltTWxtU3RhdGUscmVhc29uQ29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSk7KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltU2VuZFNtZVRETFNEZWxTdGFJbmQocE1hYywgcFN0YURzLCBwc2Vzc2lvbkVudHJ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVhc29uQ29kZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1EZWxldGVURExTUGVlcnMocE1hYywgcHNlc3Npb25FbnRyeSk7CisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICogVGhpcyBjb3VsZCBiZSBEZWF1dGhlbnRpY2F0aW9uIGZyYW1lIGZyb20KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGEgQlNTIHdpdGggd2hpY2ggcHJlLWF1dGhlbnRpY2F0aW9uIHdhcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICogcGVyZm9ybWVkLiBEZWxldGUgUHJlLWF1dGggZW50cnkgaWYgZm91bmQuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsaW1TZWFyY2hQcmVBdXRoTGlzdChwTWFjLCBwSGRyLT5zYSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1EZWxldGVQcmVBdXRoTm9kZShwTWFjLCBwSGRyLT5zYSk7CisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBlTElNX01MTV9XVF9SRUFTU09DX1JTUF9TVEFURToKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIERlYXV0aCBmcmFtZSBzdGF0ZSAlZCB3aXRoICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJyZWFzb25Db2RlPSVkIGZyb20gIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSwgcmVhc29uQ29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgICAgICBjYXNlIGVMSU1fTUxNX1dUX0ZUX1JFQVNTT0NfUlNQX1NUQVRFOgorICAgICAgICAgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIERlYXV0aCBmcmFtZSBpbiBGVCBzdGF0ZSAlZCB3aXRoICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJyZWFzb25Db2RlPSVkIGZyb20gIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSwgcmVhc29uQ29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSk7KQorICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBEZWF1dGggZnJhbWUgaW4gc3RhdGUgJWQgd2l0aCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAicmVhc29uQ29kZT0lZCBmcm9tICJNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltTWxtU3RhdGUsIHJlYXNvbkNvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOykKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgZUxJTV9TVEFfSU5fSUJTU19ST0xFOgorICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIGVMSU1fQVBfUk9MRToKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgZGVmYXVsdDogLy8gZUxJTV9BUF9ST0xFIG9yIGVMSU1fQlRfQU1QX0FQX1JPTEUKKworCisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9IC8vIGVuZCBzd2l0Y2ggKHBNYWMtPmxpbS5nTGltU3lzdGVtUm9sZSkKKworCisgICAgICAgIAorICAgIC8qKgorICAgICAqIEV4dHJhY3QgJ2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VyIHdvdWxkIHN0YXJ0IGEgZnJlc2ggYXNzb2MuCisgICAgICovCisgICAgaWYgKGxpbUlzUmVhc3NvY0luUHJvZ3Jlc3MocE1hYyxwc2Vzc2lvbkVudHJ5KSkgeworICAgICAgICAvKioKKyAgICAgICAgICogQVAgbWF5IGhhdmUgJ2FnZWQtb3V0JyBvdXIgUHJlLWF1dGgKKyAgICAgICAgICogY29udGV4dC4gRGVsZXRlIGxvY2FsIHByZS1hdXRoIGNvbnRleHQKKyAgICAgICAgICogaWYgYW55IGFuZCBpc3N1ZSBSRUFTU09DX0NORiB0byBTTUUuCisgICAgICAgICAqLworICAgICAgICBpZiAobGltU2VhcmNoUHJlQXV0aExpc3QocE1hYywgcEhkci0+c2EpKQorICAgICAgICAgICAgbGltRGVsZXRlUHJlQXV0aE5vZGUocE1hYywgcEhkci0+c2EpOworCisgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5saW1Bc3NvY1Jlc3BvbnNlRGF0YSkgeworICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBzZXNzaW9uRW50cnktPmxpbUFzc29jUmVzcG9uc2VEYXRhKTsKKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbUFzc29jUmVzcG9uc2VEYXRhID0gTlVMTDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgIH0KKworICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJSY3YgRGVhdXRoIGZyb20gUmVBc3NvYyBBUC4gIgorICAgICAgICAiSXNzdWUgUkVBU1NPQ19DTkYuICIpKTspCisgICAgICAgLyoKKyAgICAgICAgKiBUT0RPOiBJbnN0ZWFkIG9mIG92ZXJsb2FkaW5nIGVTSVJfU01FX0ZUX1JFQVNTT0NfVElNRU9VVF9GQUlMVVJFCisgICAgICAgICogaXQgd291bGQgaGF2ZSBiZWVuIGdvb2QgdG8gZGVmaW5lL3VzZSBhIGRpZmZlcmVudCBmYWlsdXJlIHR5cGUuCis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yBzaXplb2YodFNpck1hY01nbXRIZHIpKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5zbWVTZXNzaW9uSWQsIHBzZXNzaW9uRW50cnkpOworICAgICAgICByZXR1cm47CisgICAgfQorI2VuZGlmCisKKyAgICAvLyBHZXQgcmVhc29uQ29kZSBmcm9tIERpc2Fzc29jaWF0aW9uIGZyYW1lIGJvZHkKKyAgICByZWFzb25Db2RlID0gc2lyUmVhZFUxNihwQm9keSk7CisKKyAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgRkwoIlJlY2VpdmVkIERpc2Fzc29jIGZyYW1lIGZvciBBZGRyOiAiTUFDX0FERFJFU1NfU1RSCisgICAgICAgICIobWxtIHN0YXRlPSVzLCBzbWUgc3RhdGU9JWQpLCIKKyAgICAgICAgIndpdGggcmVhc29uIGNvZGUgJWQgZnJvbSAiTUFDX0FERFJFU1NfU1RSKSwgTUFDX0FERFJfQVJSQVkocEhkci0+ZGEpLAorICAgICAgICBsaW1NbG1TdGF0ZVN0cihwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSksIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlLAorICAgICAgICByZWFzb25Db2RlLCBNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOworCisgICAgLyoqCisgICAqIEV4dHJhY3QgJ2Fzc29jaWF0ZWQnIGNvbnRleHQgZm9yIFNUQSwgaWYgYW55LgorICAgKiBUaGlzIGlzIG1haW50YWluZWQgYnkgRFBIIGFuZCBjcmVhdGVkIGJ5IExJTS4KKyAgICovCisgICAgIHBTdGFEcyA9IGRwaExvb2t1cEhhc2hFbnRyeShwTWFjLCBwSGRyLT5zYSwgJmFpZCwgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUpOworCisgICAgaWYgKHBTdGFEcyA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIERpc2Fzc29jaWF0aW5nIFNUQSBpcyBub3QgYXNzb2NpYXRlZC4KKyAgICAgICAgICogTG9nIGVycm9yLgorICAgICAgICAgKi8KKyAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICBGTCgicmVjZWl2ZWQgRGlzYXNzb2MgZnJhbWUgZnJvbSBTVEEgdGhhdCBkb2VzIG5vdCBoYXZlIGNvbnRleHQgIgorICAgICAgICAgICAicmVhc29uQ29kZT0lZCwgYWRkciAiTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgIHJlYXNvbkNvZGUsTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTspCisKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmIChsaW1DaGVja0Rpc2Fzc29jRGVhdXRoQWNrUGVuZGluZyhwTWFjLCAodEFOSV9VOCopcEhkci0+c2EpKQorICAgIHsKKyAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgICAgICBGTCgiSWdub3JlIHRoZSBEaXNBc3NvYyByZWNlaXZlZCwgd2hpbGUgd2FpdGluZyAiCisgICAgICAgICAgICAgICAgICAgICJmb3IgYWNrIG9mIGRpc2Fzc29jL2RlYXV0aCIpKTspCisgICAgICAgIGxpbUNsZWFuVXBEaXNhc3NvY0RlYXV0aFJlcShwTWFjLCh0QU5JX1U4KilwSGRyLT5zYSwgMSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICAvKiogSWYgd2UgYXJlIGluIHRoZSBXYWl0IGZvciBSZUFzc29jIFJzcCBzdGF0ZSAqLworICAgIGlmIChsaW1Jc1JlYXNzb2NJblByb2dyZXNzKHBNYWMscHNlc3Npb25FbnRyeSkpIHsKKyAgICAgICAgLyoqIElmIHdlIGhhZCByZWNlaXZlZCB0aGUgRGlzQXNzb2MgZnJvbSwKKyAgICAgICAgKiAgICAgYS4gdGhlIEN1cnJlbnQgQVAgZHVyaW5nIFJlQXNzb2NpYXRlIHRvIGRpZmZlcmVudCBBUCBpbiBzYW1lIEVTUworICAgICAgICAqICAgICBiLiBVbmtub3duIEFQCisgICAgICAgICogICBkcm9wL2lnbm9yZSB0aGUgRGlzQXNzb2MgcmVjZWl2ZWQKKyAgICAgICAgKi8KKyAgICAgICAgaWYgKCFJU19SRUFTU09DX0JTU0lEKHBNYWMscEhkci0+c2EscHNlc3Npb25FbnRyeSkpIHsKKyAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIklnbm9yZSB0aGUgRGlzQXNzb2MgcmVjZWl2ZWQsIHdoaWxlICIKKyAgICAgICAgICAgICAgICAgICAgICJQcm9jZXNzaW5nIFJlQXNzb2Mgd2l0aCBkaWZmZXJlbnQvdW5rbm93biBBUCIpKTspCisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgLyoqIElmIHRoZSBEaXNhc3NvYyBpcyByZWNlaXZlZCBmcm9tIHRoZSBuZXcgQVAgdG8gd2hpY2ggd2UgdHJpZWQgdG8gUmVBc3NvY2lhdGUKKyAgICAgICAgICogIERyb3AgUmVBc3NvYyBhbmQgUmVzdG9yZSB0aGUgUHJldmlvdXMgY29udGV4dCggY3VycmVudCBjb25uZWN0ZWQgQVApLgorICAgICAgICAgKi8KKyAgICAgICAgaWYgKCFJU19DVVJSRU5UX0JTU0lEKHBNYWMsIHBIZHItPnNhLHBzZXNzaW9uRW50cnkpKSB7CisgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJyZWNlaXZlZCBEaXNhc3NvYyBmcm9tIHRoZSBOZXcgQVAgdG8gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAid2hpY2ggUmVBc3NvYyBpcyBzZW50ICIpKTspCisgICAgICAgICAgICBsaW1SZXN0b3JlUHJlUmVhc3NvY1N0YXRlKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9TTUVfUkVBU1NPQ19SRUZVU0VELCByZWFzb25Db2RlLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgfQorCisgICAgaWYgKCAocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0FQX1JPTEUpIHx8CisgICAgICAgICAocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0JUX0FNUF9BUF9ST0xFKSApCisgICAgeworICAgICAgICBzd2l0Y2ggKHJlYXNvbkNvZGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGNhc2UgZVNJUl9NQUNfVU5TUEVDX0ZBSUxVUkVfUkVBU09OOgorICAgICAgICAgICAgY2FzZSBlU0lSX01BQ19ESVNBU1NPQ19EVUVfVE9fSU5BQ1RJVklUWV9SRUFTT046CisgICAgICAgICAgICBjYXNlIGVTSVJfTUFDX0RJU0FTU09DX0xFQVZJTkdfQlNTX1JFQVNPTjoKKyAgICAgICAgICAgIGNhc2UgZVNJUl9NQUNfTUlDX0ZBSUxVUkVfUkVBU09OOgorICAgICAgICAgICAgY2FzZSBlU0lSX01BQ180V0FZX0hBTkRTSEFLRV9USU1FT1VUX1JFQVNPTjoKKyAgICAgICAgICAgIGNhc2UgZVNJUl9NQUNfR1JfS0VZX1VQREFURV9USU1FT1VUX1JFQVNPTjoKKyAgICAgICAgICAgIGNhc2UgZVNJUl9NQUNfUlNOX0lFX01JU01BVENIX1JFQVNPTjoKKyAgICAgICAgICAgIGNhc2UgZVNJUl9NQUNfMVhfQVVUSF9GQUlMVVJFX1JFQVNPTjoKKyAgICAgICAgICAgICAgICAvLyBWYWxpZCByZWFzb25Db2RlIGluIHJlY2VpdmVkIERpc2Fzc29jaWF0aW9uIGZyYW1lCisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgLy8gSW52YWxpZCByZWFzb25Db2RlIGluIHJlY2VpdmVkIERpc2Fzc29jaWF0aW9uIGZyYW1lCisgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICBGTCgicmVjZWl2ZWQgRGlzYXNzb2MgZnJhbWUgd2l0aCBpbnZhbGlkIHJlYXNvbkNvZGUgIgorICAgICAgICAgICAgICAgICAgICAgICAiJWQgZnJvbSAiTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgICAgICAgICAgcmVhc29uQ29kZSwgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTspCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoICAoKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9TVEFfUk9MRSkgfHwKKyAgICAgICAgICAgICAgICAocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0JUX0FNUF9TVEFfUk9MRSkpICYmICAKKyAgICAgICAgICAgICAgICgocHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUgIT0gZUxJTV9TTUVfV1RfSk9JTl9TVEFURSkgJiYgCisgICAgICAgICAgICAgICAgKHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlICE9IGVMSU1fU01FX1dUX0FVVEhfU1RBVEUpICAmJgorICAgICAgICAgICAgICAgIChwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSAhPSBlTElNX1NNRV9XVF9BU1NPQ19TVEFURSkgICYmCisgICAgICAgICAgICAgICAgKHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlICE9IGVMSU1fU01FX1dUX1JFQVNTT0NfU1RBVEUpICkpCisgICAgeworICAgICAgICBzd2l0Y2ggKHJlYXNvbkNvZGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGNhc2UgZVNJUl9NQUNfVU5TUEVDX0ZBSUxVUkVfUkVBU09OOgorICAgICAgICAgICAgY2FzZSBlU0lSX01BQ19ESVNBU1NPQ19EVUVfVE9fSU5BQ1RJVklUWV9SRUFTT046CisgICAgICAgICAgICBjYXNlIGVTSVJfTUFDX0RJU0FTU09DX0RVRV9UT19ESVNBQklMSVRZX1JFQVNPTjoKKyAgICAgICAgICAgIGNhc2UgZVNJUl9NQUNfQ0xBU1MyX0ZSQU1FX0ZST01fTk9OX0FVVEhfU1RBX1JFQVNPTjoKKyAgICAgICAgICAgIGNhc2UgZVNJUl9NQUNfQ0xBU1MzX0ZSQU1FX0ZST01fTk9OX0FTU09DX1NUQV9SRUFTT046CisgICAgICAgICAgICBjYXNlIGVTSVJfTUFDX01JQ19GQUlMVVJFX1JFQVNPTjoKKyAgICAgICAgICAgIGNhc2UgZVNJUl9NQUNfNFdBWV9IQU5EU0hBS0VfVElNRU9VVF9SRUFTT046CisgICAgICAgICAgICBjYXNlIGVTSVJfTUFDX0dSX0tFWV9VUERBVEVfVElNRU9VVF9SRUFTT046CisgICAgICAgICAgICBjYXNlIGVTSVJfTUFDX1JTTl9JRV9NSVNNQVRDSF9SRUFTT046CisgICAgICAgICAgICBjYXNlIGVTSVJfTUFDXzFYX0FVVEhfRkFJTFVSRV9SRUFTT046CisgICAgICAgICAgICBjYXNlIGVTSVJfTUFDX1BSRVZfQVVUSF9OT1RfVkFMSURfUkVBU09OOgorICAgICAgICAgICAgICAgIC8vIFZhbGlkIHJlYXNvbkNvZGUgaW4gcmVjZWl2ZWQgRGlzYXNzb2NpYXRpb24gZnJhbWUKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBlU0lSX01BQ19ERUFVVEhfTEVBVklOR19CU1NfUkVBU09OOgorICAgICAgICAgICAgY2FzZSBlU0lSX01BQ19ESVNBU1NPQ19MRUFWSU5HX0JTU19SRUFTT046CisgICAgICAgICAgICAgICAgLy8gVmFsaWQgcmVhc29uQ29kZSBpbiByZWNlaXZlZCBEaXNhc3NvY2lhdGlvbiBmcmFtZQorICAgICAgICAgICAgICAgIC8vIGFzIGxvbmcgYXMgd2UncmUgbm90IGFib3V0IHRvIGNoYW5uZWwgc3dpdGNoCisgICAgICAgICAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+Z0xpbUNoYW5uZWxTd2l0Y2guc3RhdGUgIT0gZUxJTV9DSEFOTkVMX1NXSVRDSF9JRExFKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICBGTCgiSWdub3JpbmcgZGlzYXNzb2MgZnJhbWUgZHVlIHRvIHVwY29taW5nICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJjaGFubmVsIHN3aXRjaCwgZnJvbSAiTUFDX0FERFJFU1NfU1RSKSxNQUNfQUREUl9BUlJBWShwSGRyLT5zYSkpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIC8vIEludmFsaWQgcmVhc29uQ29kZSBpbiByZWNlaXZlZCBEaXNhc3NvY2lhdGlvbiBmcmFtZQorICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvciBhbmQgaWdub3JlIHRoZSBmcmFtZQorICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIERpc2Fzc29jIGZyYW1lIHdpdGggaW52YWxpZCByZWFzb25Db2RlICIKKyAgICAgICAgICAgICAgICAgICAgICAgIiVkIGZyb20gIk1BQ19BRERSRVNTX1NUUiksIHJlYXNvbkNvZGUsCisgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSk7KQorICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAvLyBSZWNlaXZlZCBEaXNhc3NvY2lhdGlvbiBmcmFtZSBpbiBlaXRoZXIgSUJTUworICAgICAgICAvLyBvciB1bi1rbm93biByb2xlLiBMb2cgYW5kIGlnbm9yZSBpdAorICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBEaXNhc3NvYyBmcmFtZSB3aXRoIGludmFsaWQgcmVhc29uQ29kZSAlZCBpbiByb2xlICIKKyAgICAgICAgICAgICAgICIlZCBpbiBzbWUgc3RhdGUgJWQgZnJvbSAiTUFDX0FERFJFU1NfU1RSKSwgcmVhc29uQ29kZSwKKyAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUsIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlLAorICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTsKKworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaWYgKChwU3RhRHMtPm1sbVN0YUNvbnRleHQubWxtU3RhdGUgPT0gZUxJTV9NTE1fV1RfREVMX1NUQV9SU1BfU1RBVEUpIHx8CisgICAgICAgIChwU3RhRHMtPm1sbVN0YUNvbnRleHQubWxtU3RhdGUgPT0gZUxJTV9NTE1fV1RfREVMX0JTU19SU1BfU1RBVEUpKQorICAgIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIEFscmVhZHkgaW4gdGhlIHByb2Nlc3Mgb2YgZGVsZXRpbmcgY29udGV4dCBmb3IgdGhlIHBlZXIKKyAgICAgICAgICogYW5kIHJlY2VpdmVkIERpc2Fzc29jaWF0aW9uIGZyYW1lLiBMb2cgYW5kIElnbm9yZS4KKyAgICAgICAgICovCisgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBEaXNhc3NvYyBmcmFtZSBpbiBzdGF0ZSAlZCBmcm9tICJNQUNfQUREUkVTU19TVFIKKyAgICAgICAgICAgICAgICIsaXNEaXNhc3NvY0RlYXV0aEluUHJvZ3Jlc3MgOiAlZFxuIiksCisgICAgICAgICAgICAgICBwU3RhRHMtPm1sbVN0YUNvbnRleHQubWxtU3RhdGUsIE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSwKKyAgICAgICAgICAgICAgIHBTdGFEcy0+aXNEaXNhc3NvY0RlYXV0aEluUHJvZ3Jlc3MpOykKKworICAgICAgICByZXR1cm47CisgICAgfSAKKworICAgIGlmIChwU3RhRHMtPm1sbVN0YUNvbnRleHQubWxtU3RhdGUgIT0gZUxJTV9NTE1fTElOS19FU1RBQkxJU0hFRF9TVEFURSkKKyAgICB7CisgICAgICAgIC8qKgorICAgICAgICAgKiBSZXF1ZXN0aW5nIFNUQSBpcyBpbiBzb21lICd0cmFuc2llbnQnIHN0YXRlPworICAgICAgICAgKiBMb2cgZXJyb3IuCisgICAgICAgICAqLworICAgICAgICBpZiAocFN0YURzLT5tbG1TdGFDb250ZXh0Lm1sbVN0YXRlID09IGVMSU1fTUxNX1dUX0FTU09DX0NORl9TVEFURSkKKyAgICAgICAgICAgIHBTdGFEcy0+bWxtU3RhQ29udGV4dC51cGRhdGVDb250ZXh0ID0gMTsKKworICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICBGTCgicmVjZWl2ZWQgRGlzYXNzb2MgZnJhbWUgZnJvbSBwZWVyIHRoYXQgaXMgaW4gc3RhdGUgJWQsIGFkZHIgIgorICAgICAgICAgICAgICAgTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgIHBTdGFEcy0+bWxtU3RhQ29udGV4dC5tbG1TdGF0ZSwgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTspCisKKyAgICB9IC8vIGlmIChwU3RhRHMtPm1sbVN0YUNvbnRleHQubWxtU3RhdGU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1cmUgcmVzdWx0IGNvZGUuIEJ5IGRlc2lnbiwgU01FIHdpbGwgdGhlbiBpc3N1ZSAiRGlzYXNzb2MiICAKKyAgICAgKiBhbmQgY2xlYW51cCB3aWxsIGhhcHBlbiBhdCB0aGF0IHRpbWUuIAorICAgICAqLworICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJyZWNlaXZlZCBEaXNhc3NvYyBmcm9tIEFQIHdoaWxlIHdhaXRpbmcgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJmb3IgUmVhc3NvYyBSc3AiKSk7KQorICAgICAKKyAgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPmxpbUFzc29jUmVzcG9uc2VEYXRhKSB7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocHNlc3Npb25FbnRyeS0+bGltQXNzb2NSZXNwb25zZURhdGEpOworICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltQXNzb2NSZXNwb25zZURhdGEgPSBOVUxMOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgfQorCisgICAgICAgIGxpbVJlc3RvcmVQcmVSZWFzc29jU3RhdGUocE1hYyxlU0lSX1NNRV9SRUFTU09DX1JFRlVTRUQsIHJlYXNvbkNvZGUscHNlc3Npb25FbnRyeSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgbGltVXBkYXRlTG9zdExpbmtQYXJhbXMocE1hYywgcHNlc3Npb25FbnRyeSwgcFJ4UGFja2V0SW5mbyk7CisgICAgbGltUG9zdFNtZU1lc3NhZ2UocE1hYywgTElNX01MTV9ESVNBU1NPQ19JTkQsCisgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTMyICopICZtbG1EaXNhc3NvY0luZCk7CisKKworICAgIC8vIHNlbmQgZVdOSV9TTUVfRElTQVNTT0NfSU5EIHRvIFNNRSAgCisgICAgbGltU2VuZFNtZURpc2Fzc29jSW5kKHBNYWMsIHBTdGFEcyxwc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W9uRnJhbWVOb1Nlc3Npb24ocE1hYywgKHRBTklfVTggKikgcFJ4UGFja2V0SW5mbyk7CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworICAgIHsKKyAgICAgICAgdHBTaXJNYWNEYXRhSGRyM2EgcE1hY0hkcjsKKyAgICAgICAgcE1hY0hkciA9IFdEQV9HRVRfUlhfTVBEVUhFQURFUjNBKHBSeFBhY2tldEluZm8pOworCisgICAgICAgIGlmIChsaW1Jc0dyb3VwQWRkcihwTWFjSGRyLT5hZGRyMikpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiSWdub3JpbmcgQTIgSW52YWxpZCBQYWNrZXQgcmVjZWl2ZWQgZm9yIE1DL0JDOiIpKTsKKyAgICAgICAgICAgICAgICAgICAgbGltUHJpbnRNYWNBZGRyKHBNYWMsIHBNYWNIZHItPmFkZHIyLCBMT0cxKTsKKworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICAvKiBURExTX2hrbGVlOiBtb3ZlIGRvd24gaGVyZSB0byByZWplY3QgQWRkcjIgPT0gR3JvdXAgKGZpcnN0IGNoZWNraW5nIGFib3ZlKQorICAgICAgICAgICBhbmQgYWxzbyBjaGVja2luZyBpZiBTeXN0ZW1Sb2xlID09IFNUQSAqLworICAgICAgICBpZiAocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX1NUQV9ST0xFKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBBREQgaGFuZGxpbmcgb2YgUHVibGljIEFjdGlvbiBGcmFtZSAqLworICAgICAgICAgICAgTElNX0xPR19URExTKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1BFLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICgibGltSGFuZGxlVW5rbm93bkEySW5kZXhGcmFtZXM6IHR5cGU9MHgleCwgc3VidHlwZT0weCV4IikscE1hY0hkci0+ZmMudHlwZSwgcE1hY0hkci0+ZmMuc3ViVHlwZSkpOworICAgICAgICAgICAgc3dpdGNoIChwTWFjSGRyLT5mYy50eXBlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNhc2UgU0lSX01BQ19NR01UX0ZSQU1FOgorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHBNYWNIZHItPmZjLnN1YlR5cGUpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBTSVJfTUFDX01HTVRfQUNUSU9OOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1Qcm9jZXNzQWN0aW9uRnJhbWUocE1hYywgcFJ4UGFja2V0SW5mbywgcHNlc3Npb25FbnRyeSkgOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhayA7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyNlbmRpZgorCisKKyAgICByZXR1cm47Cit9CisKKy8qKgorICogbGltQ2hlY2tNZ210UmVnaXN0ZXJlZEZyYW1lcygpCisgKgorICpGVU5DVElPTjo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gVk9TX1RSVUU7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChwTGltTWdtdFJlZ2lzdHJhdGlvbi0+ZnJhbWVUeXBlID09IGZyYW1lVHlwZSkKKyAgICAgICAgeyAKKyAgICAgICAgICAgIGlmIChwTGltTWdtdFJlZ2lzdHJhdGlvbi0+bWF0Y2hMZW4gPiAwKQorICAgICAgICAgICAgeyAgIAorICAgICAgICAgICAgICAgIGlmIChwTGltTWdtdFJlZ2lzdHJhdGlvbi0+bWF0Y2hMZW4gPD0gZnJhbWVsZW4pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAodm9zX21lbV9jb21wYXJlKHBMaW1NZ210UmVnaXN0cmF0aW9uLT5tYXRjaERhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQm9keSwgcExpbU1nbXRSZWdpc3RyYXRpb24tPm1hdGNoTGVuKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGZvdW5kIG1hdGNoISAqLworICAgICAgICAgICAgICAgICAgICAgICAgIG1hdGNoID0gVk9TX1RSVUU7CisgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogZm91bmQgbWF0Y2ghICovICAgCisgICAgICAgICAgICAgICAgbWF0Y2ggPSBWT1NfVFJVRTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAgICAgIAorICAgICAgICB2b3NTdGF0dXMgPSAKKyAgICAgICAgICB2b3NfbGlzdF9wZWVrX25leHQgKCAmcE1hYy0+bGltLmdMaW1NZ210RnJhbWVSZWdpc3RyYXRpblF1ZXVlLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b3NfbGlzdF9ub2RlX3QqKSBwTGltTWdtdFJlZ2lzdHJhdGlvbiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9zX2xpc3Rfbm9kZV90KiopICZwTmV4dCApOworICAgICAgICBwTGltTWdtdFJlZ2lzdHJhdGlvbiA9IHBOZXh0OworICAgICAgICBwTmV4dCA9IE5VTEw7CisgICAgfQorICAgCisgICAgaWYgKG1hdGNoKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0cxLCAKKyAgICAgICAgICAgICAgICBGTCgicmN2ZCBmcmFtZSBtYXRjaCB3aXRoIHJlZ2lzdGVyZWQgZnJhbWUgcGFyYW1zIikpOworCisgICAgICAgIC8qIEluZGljYXRlIHRoaXMgdG8gU01FICovCisgICAgICAgIGxpbVNlbmRTbWVNZ210RnJhbWVJbmQoIHBNYWMsIHBMaW1NZ210UmVnaXN0cmF0aW9uLT5zZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCZCwgcHNlc3Npb25FbnRyeSwgMCk7CisgICAgCisgICAgICAgIGlmICggKHR5cGUgPT0gU0lSX01BQ19NR01UX0ZSQU1FKSAmJiAoZmMudHlwZSA9PSBTSVJfTUFDX01HTVRfRlJBTUUpCisgICAgICAgICAgICAgICYmIChzdWJUeXBlID09IFNJUl9NQUNfTUdNVF9SRVNFUlZFRDE1KSApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIFRoZXNlIHBhY2tldHMgbmVlZHMgdG8gYmUgcHJvY2Vzc2VkIGJ5IFBFL1NNRSBhcyB3ZWxsIGFzIEhERC4KKyAgICAgICAgICAgIC8vIElmIGl0IHJldHVybnMgVFJVRSBoZXJlLCB0aGUgcGFja2V0IGlzIGZvcndhcmRlZCB0byBIREQgb25seS4KKyAgICAgICAgICAgIG1hdGNoID0gVk9TX0ZBTFNFOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIG1hdGNoOworfSAvKioqIGVuZCAgbGltQ2hlY2tNZ210UmVnaXN0ZXJlZEZyYW1lcygpICoqKi8KKworI2lmZGVmIFdMQU5fRkVBVFVSRV9FWFRTQ0FOCisKK3ZvaWQKK2xpbVByb2Nlc3NFWFRTY2FuUmVhbFRpbWVEYXRhKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggKnBSeFBhY2tldEluZm8pCit7CisgICAgdHBTaXJNYWNNZ210SGRyICAgICAgIHBIZHIgPSBOVUxMOworICAgIGVIYWxTdGF0dXMgICAgICAgICAgICBzdGF0dXM7CisgICAgdm9pZCAgICAgICAgICAgICAgICAgICpwQ2FsbGJhY2tDb250ZXh0OworICAgIHRBTklfVTggICAgICAgICAgICAgICByZkJhbmQgPSAwOworICAgIHRBTklfVTggICAgICAgICAgICAgICByeENoYW5uZWxJbkJEID0gMDsKKyAgICB0U2lyTWFjRnJhbWVDdGwgICAgICAgZmM7CisgICAgdERvdDExZkJlYWNvbiAgICAgICAgICpwQmVhY29uID0gTlVMTDsKKyAgICB0RG90MTFmUHJvYmVSZXNwb25zZSAgKnBQcm9iZVJlc3BvbnNlID0gTlVMTDsKKyAgICB0U2lyV2lmaUZ1bGxTY2FuUmVzdWx0RXZlbnQgdEVYVFNjYW5GdWxsU2NhblJlc3VsdDsKKworICAgIHBIZHIgPSBXREFfR0VUX1JYX01BQ19IRUFERVIocFJ4UGFja2V0SW5mbyk7CisgICAgZmMgPSBwSGRyLT5mYzsKKworICAgIGxpbUxvZyhwTWFjLCBMT0cyLAorICAgICAgICAgICAgIEZMKCJSZWNlaXZlZCBFWFRTY2FuIFJlYWwgVGltZSBkYXRhIHdpdGggbGVuZ3RoPSVkIGZyb20gIiksCisgICAgICAgICAgICAgV0RBX0dFVF9SWF9NUERVX0xFTihwUnhQYWNrZXRJbmZvKSk7CisKKyAgICBsaW1QcmludE1hY0FkZHIocE1hYywgcEhkci0+c2EsIExPRzIpOworCisgICAgdm9zX21lbV9zZX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c2l6ZW9mKHREb3QxMWZCZWFjb24pKTsKKyAgICAgICAgaWYgKCBOVUxMID09IHBCZWFjb24gKXsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIGFsbG9jYXRlIG1lbW9yeVxuIikgKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIHZvc19tZW1fc2V0KCAoIHRBTklfVTgqIClwQmVhY29uLCBzaXplb2YodERvdDExZkJlYWNvbiksIDAgKTsKKyAgICAgICAgLy8gZGVsZWdhdGUgdG8gdGhlIGZyYW1lc2MtZ2VuZXJhdGVkIGNvZGUsCisgICAgICAgIHN0YXR1cyA9IGRvdDExZlVucGFja0JlYWNvbiggcE1hYywKKyAgICAgICAgICAgICAgICAgICAgKHRBTklfVTggKilXREFfR0VUX1JYX01QRFVfREFUQShwUnhQYWNrZXRJbmZvKSwKKyAgICAgICAgICAgICAgICAgICAgV0RBX0dFVF9SWF9QQVlMT0FEX0xFTihwUnhQYWNrZXRJbmZvKSwgcEJlYWNvbiApOworCisgICAgICAgIGlmICggRE9UMTFGX0ZBSUxFRCggc3RhdHVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBwYXJzZSBhIEJlYWNvbnMiCisgICAgICAgICAgICAgICAgICAgICAgICAiKCVkKSIpLCBzdGF0dXMpOworICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBCZWFjb24pOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGlmICggcEJlYWNvbi0+U1NJRC5wcmVzZW50ICkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHRFWFRTY2FuRnVsbFNjYW5SZXN1bHQuYXAuc3NpZCwKKyAgICAgICAgICAgICAgICBwQmVhY29uLT5TU0lELnNzaWQsCisgICAgICAgICAgICAgICAgcEJlYWNvbi0+U1NJRC5udW1fc3NpZCk7CisgICAgICAgIH0KKyAgICAgICAgLy9OVUxMIFRlcm1pbmF0ZSB0aGUgc3RyaW5nLgorICAgICAgICB0RVhUU2NhbkZ1bGxTY2FuUmVzdWx0LmFwLnNzaWRbcEJlYWNvbi0+U1NJRC5udW1fc3NpZF0gPSAwOworICAgICAgICB0RVhUU2NhbkZ1bGxTY2FuUmVzdWx0LmFwLmJlYWNvblBlcmlvZCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQmVhY29uLT5CZWFjb25JbnRlcnZhbC5pbnRlcnZhbDsKKyAgICAgICAgdEVYVFNjYW5GdWxsU2NhblJlc3VsdC5hcC5jYXBhYmlsaXR5ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKigodEFOSV9VMTYgKikmcEJlYWNvbi0+Q2FwYWJpbGl0aWVzKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBCZWFjb24pOworICAgIH0KKyAgICBlbHNlIGlmIChmYy5zdWJUeXBlID09IFNJUl9NQUNfTUdNVF9QUk9CRV9SU1ApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPRzIsIEZMKCJQcm9iZSByc3AgIikpOworCisgICAgICAgIHBQcm9iZVJlc3BvbnNlID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHREb3QxMWZQcm9iZVJlc3BvbnNlKSk7CisgICAgICAgIGlmICggTlVMTCA9PSBwUHJvYmVSZXNwb25zZSApeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gYWxsb2NhdGUgbWVtb3J5XG4iKSApOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgdm9zX21lbV9zZXQoICggdEFOSV9VOCogKXBQcm9iZVJlc3BvbnNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodERvdDExZlByb2JlUmVzcG9uc2UpLCAwKTsKKyAgICAgICAgLy9kZWxlZ2F0ZSB0byB0aGUgZnJhbWVzYy1nZW5lcmF0ZWQgY29kZSwKKyAgICAgICAgc3RhdHVzID0gZG90MTFmVW5wYWNrUHJvYmVSZXNwb25zZSggcE1hYywKKyAgICAgICAgICAgICAgICAgICAgKHRBTklfVTggKilXREFfR0VUX1JYX01QRFVfREFUQShwUnhQYWNrZXRJbmZvKSwKKyAgICAgICAgICAgICAgICAgICAgV0RBX0dFVF9SWF9QQVlMT0FEX0xFTihwUnhQYWNrZXRJbmZvKSwgcFByb2JlUmVzcG9uc2UgKTsKKworICAgICAgICBpZiAoIERPVDExRl9GQUlMRUQoIHN0YXR1cyApICkKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gcGFyc2UgYSBQcm9iZSIKKyAgICAgICAgICAgICAgICAgICAgICAgICJSZXNwb25zZSAoJWQiKSwgc3RhdHVzKTsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwUHJvYmVSZXNwb25zZSk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgaWYgKCBwUHJvYmVSZXNwb25zZS0+U1NJRC5wcmVzZW50ICkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHRFWFRTY2FuRnVsbFNjYW5SZXN1bHQuYXAuc3NpZCwKKyAgICAgICAgICAgICAgICBwUHJvYmVSZXNwb25zZS0+U1NJRC5zc2lkLAorICAgICAgICAgICAgICAgIHBQcm9iZVJlc3BvbnNlLT5TU0lELm51bV9zc2lkKTsKKyAgICAgICAgfQorICAgICAgICAvL05VTEwgVGVybWluYXRlIHRoZSBzdHJpbmcuCisgICAgICAgIHRFWFRTY2FuRnVsbFNjYW5SZXN1bHQuYXAuc3NpZFtwUHJvYmVSZXNwb25zZS0+U1NJRC5udW1fc3NpZF0gPSAwOworICAgICAgICB0RVhUU2NhbkZ1bGxTY2FuUmVzdWx0LmFwLmJlYWNvblBlcmlvZCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUHJvYmVSZXNwb25zZS0+QmVhY29uSW50ZXJ2YWwuaW50ZXJ2YWw7CisgICAgICAgIHRFWFRTY2FuRnVsbFNjYW5SZXN1bHQuYXAuY2FwYWJpbGl0eSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKigoKHRBTklfVTE2ICopJnBQcm9iZVJlc3BvbnNlLT5DYXBhYmlsaXRpZXMpKTsKKworICAgICAgICB2b3NfbWVtX2ZyZWUocEJlYWNvbik7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIldyb25nIGZyYW1lIFR5cGUgJWQsIFN1YnR5cGUgJWQgZm9yIExGUiIpLAorICAgICAgICAgICAgICAgIGZjLnR5cGUsIGZjLnN1YlR5cGUpOworICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgdEVYVFNjYW5GdWxsU2NhblJlc3VsdC5yZXF1ZXN0SWQgPSBwTWFjLT5zbWUuZXh0U2NhblN0YXJ0UmVxSWQ7CisgICAgdEVYVFNjYW5GdWxsU2NhblJlc3VsdC5pZUxlbmd0aCA9CisgICAgICAgICAgICAgICAgICAgV0RBX0dFVF9SWF9QQVlMT0FEX0xFTihwUnhQYWNrZXRJbmZvKSAtIFNJWkVfT0ZfRklYRURfUEFSQU07CisgICAgdEVYVFNjYW5GdWxsU2NhblJlc3VsdC5pZSA9KHRTaXJJbmZvcm1hdGlvbkVsZW1lbnQgKikKKyAgICAgICAgKCh0QU5JX1U4ICopV0RBX0dFVF9SWF9NUERVX0RBVEEocFJ4UGFja2V0SW5mbykgKyBTSVpFX09GX0ZJWEVEX1BBUkFNKTsKKworICAgIHBDYWxsYmFja0NvbnRleHQgPSBwTWFjLT5zbWUucEVYVFNjYW5DYWxsYmFja0NvbnRleHQ7CisgICAgaWYocE1hYy0+c21lLnBFWFRT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QU1FICYmIGlzRnJtRnQpIAorICAgIHsKKyNpZiAwIC8vIEVzZSBUQkQgTmVlZCB0byBQT1JUCisgICAgICAgIHRwU2lyTWFjRG90M0hkciBwRGF0YUZybUhkcjsKKworICAgICAgICBwRGF0YUZybUhkciA9ICh0cFNpck1hY0RvdDNIZHIpKCh0QU5JX1U4ICopcEJEKyBXTEFOSEFMX1JYX0JEX0dFVF9NUERVX0hfT0ZGU0VUKHBCRCkpOworICAgICAgICBpZigocHNlc3Npb25FbnRyeSA9IHBlRmluZFNlc3Npb25CeUJzc2lkKHBNYWMscERhdGFGcm1IZHItPnNhLCZzZXNzaW9uSWQpKT09IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIlNlc3Npb24gbm90IGZvdW5kIGZvciBGcm0gdHlwZSAlZCwgc3VidHlwZSAlZCwgU0E6ICIpLCBmYy50eXBlLCBmYy5zdWJUeXBlKTsKKyAgICAgICAgICAgIGxpbVByaW50TWFjQWRkcihwTWFjLCBwRGF0YUZybUhkci0+c2EsIExPR0UpOworICAgICAgICAgICAgbGltUGt0RnJlZShwTWFjLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsIHBCRCwgbGltTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGlmICghcHNlc3Npb25FbnRyeS0+aXNFU0Vjb25uZWN0aW9uKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJMSU0gcmVjZWl2ZWQgVHlwZSAlZCwgU3VidHlwZSAlZCBpbiBOb24gRVNFIGNvbm5lY3Rpb24iKSwKKyAgICAgICAgICAgICAgICAgICAgZmMudHlwZSwgZmMuc3ViVHlwZSk7CisgICAgICAgICAgICBsaW1Qa3RGcmVlKHBNYWMsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwgcEJELCBsaW1Nc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIlByb2Nlc3NpbmcgSUFQUCBGcm0gZnJvbSBTQToiKSk7CisgICAgICAgIGxpbVByaW50TWFjQWRkcihwTWFjLCBwRGF0YUZybUhkci0+c2EsIExPR0UpOworI2Vsc2UKKyAgICAgICAgcHJpbnRrKCIlczogTmVlZCB0byBwb3J0IGhhbmRsaW5nIG9mIElBUFAgZnJhbWVzIHRvIFBSSU1BIGZvciBFU0UiLCBfX2Z1bmNfXyk7CisjZW5kaWYKKworCisgICAgfSBlbHNlCisjZW5kaWYKKworICAgIGlmICgoZmMudHlwZSA9PSBTSVJfTUFDX01HTVRfRlJBTUUpICYmCisgICAgICAgIChmYy5zdWJUeXBlID09IFNJUl9NQUNfTUdNVF9QUk9CRV9SU1ApICYmCisgICAgICAgIHBNYWMtPmxpbS5pc1Nwb29maW5nRW5hYmxlZCkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HMiwgRkwoIlByb2JlIFJzcCByZWNpZXZlZCB3aXRoIERBOiAiTUFDX0FERFJFU1NfU1RSCisgICAgICAgICAgICAiIGFuZCBzZWxmTWFjIEFkZHI6Ik1BQ19BRERSRVNTX1NUUiksIE1BQ19BRERSX0FSUkFZKHBIZHItPmRhKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwTWFjLT5saW0uZ1NlbGZNYWNBZGRyKSk7CisgICAgICAgIGlmIChWT1NfVFJVRSA9PSB2b3NfbWVtX2NvbXBhcmUoKHZfVk9JRF90KikgcEhkci0+ZGEsCisgICAgICAgICAgICAgICAodl9WT0lEX3QqKSBwTWFjLT5saW0uc3Bvb2ZNYWNBZGRyLCBWT1NfTUFDX0FERFJFU1NfTEVOKSkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBIZHItPmRhLCBwTWFjLT5saW0uZ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HBNYWMscEhkci0+ZGEsJnNlc3Npb25JZCk7CisgICAgICAgIH0KKyAgICB9CisKKworICAgIC8qIENoZWNrIGlmIGZyYW1lIGlzIHJlZ2lzdGVyZWQgYnkgSEREICovCisgICAgaWYobGltQ2hlY2tNZ210UmVnaXN0ZXJlZEZyYW1lcyhwTWFjLCBwUnhQYWNrZXRJbmZvLCBwc2Vzc2lvbkVudHJ5KSkKKyAgICB7ICAgICAgICAKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0cxLCBGTCgiUmVjZWl2ZWQgZnJhbWUgaXMgcGFzc2VkIHRvIFNNRSIpKTsKKyAgICAgICAgZ290byBlbmQ7CisgICAgfQorCisKKworICAgIGlmIChmYy5wcm90VmVyICE9IFNJUl9NQUNfUFJPVE9DT0xfVkVSU0lPTikKKyAgICB7ICAgLy8gUmVjZWl2ZWQgRnJhbWUgd2l0aCBub24temVybyBQcm90b2NvbCBWZXJzaW9uCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiVW5leHBlY3RlZCBmcmFtZSB3aXRoIHByb3RWZXJzaW9uICVkIHJlY2VpdmVkIiksCisgICAgICAgICAgIGZjLnByb3RWZXIpOworI2lmZGVmIFdMQU5fREVCVUcgICAgICAgICAgICAKKyAgICAgICAgcE1hYy0+bGltLm51bVByb3RFcnIrKzsKKyNlbmRpZgorICAgICAgICBnb3RvIGVuZDsKKyAgICB9CisKKyAgICBpZiAoIXBNYWMtPmZTY2FuT2ZmbG9hZCkKKyAgICB7CisgICAgICAgIGlmIChsaW1Jc1N5c3RlbUluU2NhblN0YXRlKHBNYWMpKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1IYW5kbGVGcmFtZXNJblNjYW5TdGF0ZShwTWFjLCBsaW1Nc2csIHBSeFBhY2tldEluZm8sIHBEZWZlck1zZywgcHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICB9CisKKy8qIENoYW5jZSBvZiBjcmFzaGluZyA6IHRvIGJlIGRvbmUgQlQtQU1QIC4uLi4uLi4uaGFwcGVucyB3aGVuIGJyb2FkY2FzdCBwcm9iZSByZXEgaXMgcmVjZWl2ZWQgKi8KKworI2lmIDAKKyAgICBpZiAocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX1VOS05PV05fUk9MRSkgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csIEZMKCAiZ0xpbVN5c3RlbVJvbGUgaXMgJWQuIEV4aXRpbmcuLi4iICkscHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSApOworICAgICAgICBsaW1Qa3RGcmVlKHBNYWMsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwgcFJ4UGFja2V0SW5mbywgKHZvaWQgKikgbGltTXNnLT5ib2R5cHRyKTsKKworI2lmZGVmIFdMQU5fREVCVUcgICAgICAgIAorICAgICAgICBwTWFjLT5saW0ubnVtUHJvdEVycisrOworI2VuZGlmCisgICAgICAgIHJldHVybjsKKyAgICB9CisgI2VuZGlmICAgICAvL0hBQ0sgdG8gY29udGludWUgc2Nhbm5pbmcgICAgCisKKworI2lmZGVmIFdMQU5fREVCVUcgICAgCisgICAgcE1hYy0+bGltLm51bU1BQ1tmYy50eXBlXVtmYy5zdWJUeXBlXSsrOworI2VuZGlmCisgICAgCisgICAgc3dpdGNoIChmYy50eXBlKQorICAgIHsKKyAgICAgICAgY2FzZSBTSVJfTUFDX01HTVRfRlJBTUU6CisgICAgICAgIHsKKyAgICAgICAgICAgICAgICAjaWYgMCAgIC8vVEJELVJBSkVTSCBmaXggdGhpcworICAgICAgICAgICAgICAgIGlmIChsaW1Jc1JlYXNzb2NJblByb2dyZXNzKCBwTWFjLHBzZXNzaW9uRW50cnkpICYmIChmYy5zdWJUeXBlICE9IFNJUl9NQUNfTUdNVF9ESVNBU1NPQykgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmYy5zdWJUeXBlICE9IFNJUl9NQUNfTUdNVF9ERUFVVEgpICYmIChmYy5zdWJUeXBlICE9IFNJUl9NQUNfTUdNVF9SRUFTU09DX1JTUCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkZyYW1lIHdpdGggVHlwZSAtICVkLCBTdWJ0eXBlIC0gJWQgcmVjZWl2ZWQgaW4gUmVBc3NvYyBXYWl0IHN0YXRlLCBkcm9wcGluZy4uLiIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZjLnR5cGUsIGZjLnN1YlR5cGUpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgI2VuZGlmICAgLy9IQUNLIHRvIGNvbnRpbnVlIHNjYW5uaW5nIAorICAgICAgICAgICAgLy8gUmVjZWl2ZWQgTWFuYWdlbWVudCBmcmFtZQorICAgICAgICAgICAgc3dpdGNoIChmYy5zdWJUeXBlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNhc2UgU0lSX01BQ19NR01UX0FTU09DX1JFUToKKyAgICAgICAgICAgICAgICAgICAgLy8gTWFrZSBzdXJlIHRoZSByb2xlIHN1cHBvcnRzIEFzc29jaWF0aW9uCisgICAgICAgICAgICAgICAgICAgIGlmICgocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0JUX0FNUF9BUF9ST0xFKQorICAgICAgICAgICAgICAgICAgICB8fCAocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0FQX1JPTEUpCisgICAgICAgICAgICAgICAgICAgICkKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbVByb2Nlc3NBc3NvY1JlcUZyYW1lKHBNYWMsIHBSeFBhY2tldEluZm8sIExJTV9BU1NPQywgcHNlc3Npb25FbnRyeSk7CisKKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBVbndhbnRlZCBtZXNzYWdlcyAtIExvZyBlcnJvcgorICAgICAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJ1bmV4cGVjdGVkIG1lc3NhZ2UgcmVjZWl2ZWQgJVgiKSxsaW1Nc2ctPnR5cGUpOworICAgICAgICAgICAgICAgICAgICAgICAgbGltUHJpbnRNc2dOYW1lKHBNYWMsIExPR0UsIGxpbU1zZy0+dHlwZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIFNJUl9NQUNfTUdNVF9BU1NPQ19SU1A6CisgICAgICAgICAgICAgICAgICAgIGxpbVByb2Nlc3NBc3NvY1JzcEZyYW1lKHBNYWMsIHBSeFBhY2tldEluZm8sIExJTV9BU1NPQyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIFNJUl9NQUNfTUdNVF9SRUFTU09DX1JFUToKKyAgICAgICAgICAgICAgICAgICAgLy8gTWFrZSBzdXJlIHRoZSByb2xlIHN1cHBvcnRzIFJlYXNzb2NpYXRpb24KKyAgICAgICAgICAgICAgICAgICAgaWYgKChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQlRfQU1QX0FQX1JPTEUpCisgICAgICAgICAgICAgICAgICAgICAgfHwgKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFKQorICAgICAgICAgICAgICAgICAgICApeworICAgICAgICAgICAgICAgICAgICAgICAgbGltUHJvY2Vzc0Fzc29jUmVxRnJhbWUocE1hYywgcFJ4UGFja2V0SW5mbywgTElNX1JFQVNTT0MsIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gVW53YW50ZWQgbWVzc2FnZXMgLSBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgidW5leHBlY3RlZCBtZXNzYWdlIHJlY2VpdmVkICVYIiksbGltTXNnLT50eXBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbVByaW50TXNnTmFtZShwTWFjLCBMT0dFLCBsaW1Nc2ctPnR5cGUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBTSVJfTUFDX01HTVRfUkVBU1NPQ19SU1A6CisgICAgICAgICAgICAgICAgICAgIGxpbVByb2Nlc3NBc3NvY1JzcEZyYW1lKHBNYWMsIHBSeFBhY2tldEluZm8sIExJTV9SRUFTU09DLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgU0lSX01BQ19NR01UX1BST0JFX1JFUToKKyAgICAgICAgICAgICAgICAgICAgbGltUHJvY2Vzc1Byb2JlUmVxRnJhbWVfbXVsdGlwbGVfQlNTKHBNYWMsIHBSeFBhY2tldEluZm8scHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBTSVJfTUFDX01HTVRfUFJPQkVfUlNQOgorICAgICAgICAgICAgICAgICAgICBpZihwc2Vzc2lvbkVudHJ5ID09IE5VTEwpCisgICAgICAgICAgICAgICAgICAgICAgICBsaW1Qcm9jZXNzUHJvYmVSc3BGcmFtZU5vU2Vzc2lvbihwTWFjLCBwUnhQYWNrZXRJbmZvKTsKKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgbGltUHJvY2Vzc1Byb2JlUnNwRnJhbWUocE1hYywgcFJ4UGFja2V0SW5mbywgcHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBTSVJfTUFDX01HTVRfQkVBQ09OOgorICAgICAgICAgICAgICAgICAgICBfX2xpbUhhbmRsZUJlYWNvbihwTWFjLCBsaW1Nc2cscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBTSVJfTUFDX01HTVRfRElTQVNTT0M6CisgICAgICAgICAgICAgICAgICAgIGxpbVByb2Nlc3NEaXNhc3NvY0ZyYW1lKHBNYWMsIHBSeFBhY2tldEluZm8scHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBTSVJfTUFDX01HTVRfQVVUSDoKKyAgICAgICAgICAgICAgICAgICAgbGltUHJvY2Vzc0F1dGhGcmFtZShwTWFjLCBwUnhQYWNrZXRJbmZvLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgU0lSX01BQ19NR01UX0RFQVVUSDoKKyAgICAgICAgICAgICAgICAgICAgbGltUHJvY2Vzc0RlYXV0aEZyYW1lKHBNYWMsIHBSeFBhY2tldEluZm8scHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBTSVJfTUFDX01HTVRfQUNUSU9OOgorICAgICAgICAgICAgICAgICAgIGlmKHBzZXNzaW9uRW50cnkgPT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgICBsaW1Qcm9jZXNzQWN0aW9uRnJhbWVOb1Nlc3Npb24ocE1hYywgcFJ4UGFja2V0SW5mbyk7CisgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAoV0RBX0dFVF9SWF9VTktOT1dOX1VDQVNUKHBSeFBhY2tldEluZm8pKQorICAgICAgICAgICAgICAgICAgICAgICAgIGxpbUhhbmRsZVVua25vd25BMkluZGV4RnJhbWVzKHBNYWMsIHBSeFBhY2tldEluZm8scHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgbGltUHJvY2Vzc0FjdGlvbkZyYW1lKHBNYWMsIHBSeFBhY2tldEluZm8scHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgIC8vIFJlY2VpdmVkIE1hbmFnZW1lbnQgZnJhbWUgb2YgJ3Jlc2VydmVkJyBzdWJ0eXBlCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfSAvLyBzd2l0Y2ggKGZjLnN1YlR5cGUpCisKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTSVJfTUFDX0RBVEFfRlJBTUU6CisgICAgICAgIHsKKyNpZiBkZWZpbmVkKEZFQVRVUkVfV0xBTl9FU0UpICYmICFkZWZpbmVkKEZFQVRVUkVfV0xBTl9FU0VfVVBMT0FEKQorICAgICAgICAgICAgIC8qIFdlIGFjY2VwdCBkYXRhIGZyYW1lIChJQVBQIGZyYW1lKSBvbmx5IGlmIFNlc3Npb24gaXMKKyAgICAgICAgICAgICAgKiBwcmVzZW50IGFuZCBlc2UgY29ubmVjdGlvbiBpcyBlc3RhYmxpc2hlZCBvbiB0aGF0CisgICAgICAgICAgICAgICogc2Vzc2lvbgorICAgICAgICAgICAgICAqLworICAgICAgICAgICAgIGlm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gICB7CisgICAgICAgIC8qIHNlbmQgc3RvcCBzY2FuIGNtZCB0byBmdyBpZiBzY2FuIG9mZmxvYWQgaXMgZW5hYmxlZC4gKi8KKyAgICAgICAgbGltU2VuZFN0b3BTY2FuT2ZmbG9hZFJlcShwTWFjLCBTZXNzaW9uSWQpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAvKiBBYm9ydCB0aGUgc2NhbiBpZiBpdHMgcnVubmluZywgZWxzZSBqdXN0IHJldHVybiAqLworICAgICAgICBpZihsaW1Jc1N5c3RlbUluU2NhblN0YXRlKHBNYWMpKQorICAgICAgICB7CisgICAgICAgICAgICBpZiggKGVMSU1fSEFMX0lOSVRfU0NBTl9XQUlUX1NUQVRFID09IHBNYWMtPmxpbS5nTGltSGFsU2NhblN0YXRlICkgfHwKKyAgICAgICAgICAgICAgICAgICAgKGVMSU1fSEFMX1NUQVJUX1NDQU5fV0FJVF9TVEFURSA9PSBwTWFjLT5saW0uZ0xpbUhhbFNjYW5TdGF0ZSApIHx8CisgICAgICAgICAgICAgICAgICAgIChlTElNX0hBTF9FTkRfU0NBTl9XQUlUX1NUQVRFID09IHBNYWMtPmxpbS5nTGltSGFsU2NhblN0YXRlICkgfHwKKyAgICAgICAgICAgICAgICAgICAgKGVMSU1fSEFMX0ZJTklTSF9TQ0FOX1dBSVRfU1RBVEUgPT0gcE1hYy0+bGltLmdMaW1IYWxTY2FuU3RhdGUpICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvL1NpbXBseSBzaWduYWwgd2UgbmVlZCB0byBhYm9ydAorICAgICAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HVywgRkwoIiB3YWl0aW5nIGZvciBIQUwsIHNpbXBseSBzaWduYWwgYWJvcnQgZ0xpbUhhbFNjYW5TdGF0ZSA9ICVkIiksIHBNYWMtPmxpbS5nTGltSGFsU2NhblN0YXRlICk7CisgICAgICAgICAgICAgICAgcE1hYy0+bGltLmFib3J0U2NhbiA9IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9Gb3JjZSBhYm9ydAorICAgICAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HVywgRkwoIiBGb3JjZSBhYm9ydGluZyBzY2FuIikgKTsKKyAgICAgICAgICAgICAgICBwTWFjLT5saW0uYWJvcnRTY2FuID0gMDsKKyAgICAgICAgICAgICAgICBsaW1EZWFjdGl2YXRlQW5kQ2hhbmdlVGltZXIocE1hYywgZUxJTV9NSU5fQ0hBTk5FTF9USU1FUik7CisgICAgICAgICAgICAgICAgbGltRGVhY3RpdmF0ZUFuZENoYW5nZVRpbWVyKHBNYWMsIGVMSU1fTUFYX0NIQU5ORUxfVElNRVIpOworICAgICAgICAgICAgICAgIC8vU2V0IHRoZSByZXN1bWUgY2hhbm5lbCB0byBBbnkgdmFsaWQgY2hhbm5lbCAoaW52YWxpZCkuCisgICAgICAgICAgICAgICAgLy9UaGlzIHdpbGwgaW5zdHJ1Y3QgSEFMIHRvIHNldCBpdCB0byBhbnkgcHJldmlvdXMgdmFsaWQgY2hhbm5lbC4KKyAgICAgICAgICAgICAgICBwZVNldFJlc3VtZUNoYW5uZWwocE1hYywgMCwgMCk7CisgICAgICAgICAgICAgICAgbGltU2VuZEhhbEZpbmlzaFNjYW5SZXEocE1hYywgZUxJTV9IQUxfRklOSVNIX1NDQU5fV0FJVF9TVEFURSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuOworfQorCisvKioKKyAqIGxpbU1lc3NhZ2VQcm9jZXNzb3IKKyAqCisgKkZVTkNUSU9OOgorICogV3JhcHBlciBmdW5jdGlvbiBmb3IgbGltUHJvY2Vzc01lc3NhZ2VzIHdoZW4gaGFuZGxpbmcgbWVzc2FnZXMgcmVjZWl2ZWQgYnkgTElNLgorICogQ291bGQgZWl0aGVyIGRlZmVyIG1lc3NhZ2VzIG9yIHByb2Nlc3MgdGhlbS4KKyAqIEBwYXJhbSAgcE1hYyAgIFBvaW50ZXIgdG8gR2xvYmFsIE1BQyBzdHJ1Y3R1cmUKKyAqIEBwYXJhbSAgbGltTXNnIFJlY2VpdmVkIExJTSBtZXNzYWdlCisgKiBAcmV0dXJuIE5vbmUKKyAqLworCit2b2lkIGxpbU1lc3NhZ2VQcm9jZXNzb3IodHBBbmlTaXJHbG9iYWwgcE1hYywgdHBTaXJNc2dRIGxpbU1zZykKK3sKKyAgICBpZiAoZUxJTV9NTE1fT0ZGTElORV9TVEFURSA9PSBwTWFjLT5saW0uZ0xpbU1sbVN0YXRlKQorICAgIHsKKyAgICAgICAgcGVGcmVlTXNnKHBNYWMsIGxpbU1zZyk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBpZiAoIWRlZk1zZ0RlY2lzaW9uKHBNYWMsIGxpbU1zZykpCisgICAgeworICAgICAgICBsaW1Qcm9jZXNzTWVzc2FnZXMocE1hYywgbGltTXNnKTsKKyAgICAgICAgLy8gcHJvY2VzcyBkZWZlcnJlZCBtZXNzYWdlIHF1ZXVlIGlmIGFsbG93ZWQKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKCAoISAocE1hYy0+bGltLmdMaW1BZGR0c1NlbnQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmCisgICAgICAgICAgICAgICAgICAgICghIChsaW1Jc1N5c3RlbUluU2NhblN0YXRlKHBNYWMpKSkKKyAgICAgICAgICAgICAgICApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHRydWUgPT0gR0VUX0xJTV9QUk9DRVNTX0RFRkRfTUVTR1MocE1hYykpCisgICAgICAgICAgICAgICAgICBsaW1Qcm9jZXNzRGVmZXJyZWRNZXNzYWdlUXVldWUocE1hYyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cit9CisKKyNpZmRlZiBGRUFUVVJFX09FTV9EQVRBX1NVUFBPUlQKKwordm9pZCBsaW1PZW1E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KHRBTklfVTMyKiltbG1PZW1EYXRhUnNwKTsKKworICAgIHJldHVybjsKK30KKworI2VuZGlmCisKK3N0YXRpYyB0QU5JX0JPT0xFQU4gbGltQWdlT3V0UHJvYmVSZXEoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRwU2lyTXNnUSAgbGltTXNnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX3BrdF90ICAqcFZvc1BrdCApCit7CisgICAgdEFOSV9VOCAgICAqcFJ4UGFja2V0SW5mbyA9IE5VTEw7CisgICAgdFNpck1hY0ZyYW1lQ3RsICBmYzsKKyAgICB0cFNpck1hY01nbXRIZHIgICAgcEhkcj1OVUxMOworICAgIHRBTklfQk9PTEVBTiBtYXRjaCA9IFZPU19GQUxTRTsKKworICAgIGxpbUdldEJEZnJvbVJ4UGFja2V0KHBNYWMsIGxpbU1zZy0+Ym9keXB0ciwgKHRBTklfVTMyICoqKSZwUnhQYWNrZXRJbmZvKTsKKyAgICBwSGRyID0gV0RBX0dFVF9SWF9NQUNfSEVBREVSKHBSeFBhY2tldEluZm8pOworICAgIGZjID0gcEhkci0+ZmM7CisgICAgaWYgKCBmYy5zdWJUeXBlID09IFNJUl9NQUNfTUdNVF9QUk9CRV9SRVEgKQorICAgIHsKKyAgICAgICAgaWYoICB2b3NfdGltZXJfZ2V0X3N5c3RlbV90aWNrcygpIC0gcFZvc1BrdC0+dGltZXN0YW1wID49IE1BWF9QUk9CRVJFUV9USU1FICkKKyAgICAgICAgeworICAgICAgICAgICAgLy8gZHJvcCBwYWNrZXQKKyAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgIEZMKCJEcm9wcGluZyBBZ2VkIE91dCBwcm9iZSByZXF1ZXN0cy4gUGVlciBNQUMgaXMgIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+c2EpKTsKKworICAgICAgICAgICAgdm9zX3BrdF9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yAgICAgICAgICAgIC8vLyBDRkcgcGFyYW1ldGVyIHVwZGF0ZWQKKyAgICAgICAgICAgIGlmIChsaW1Jc1N5c3RlbUluU2NhblN0YXRlKHBNYWMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIFN5c3RlbSBpcyBpbiBERlMgKExlYXJuKSBtb2RlCisgICAgICAgICAgICAgICAgLy8gRGVmZXIgcHJvY2Vzc3NpbmcgdGhpcyBtZXNzYWdlCisgICAgICAgICAgICAgICAgaWYgKGxpbURlZmVyTXNnKHBNYWMsIGxpbU1zZykgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmKCEocE1hYy0+bGltLmRlZmVycmVkTXNnQ250ICYgMHhGKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiVW5hYmxlIHRvIERlZmVyIG1lc3NhZ2UoMHglWCkgbGltU21lU3RhdGUgJWQgKHByZXYgc21lIHN0YXRlICVkKSBzeXNSb2xlICVkIG1sbSBzdGF0ZSAlZCAocHJldiBtbG0gc3RhdGUgJWQpIiksCisgICAgICAgICAgICAgICAgICAgICAgICBsaW1Nc2ctPnR5cGUsIHBNYWMtPmxpbS5nTGltU21lU3RhdGUsICBwTWFjLT5saW0uZ0xpbVByZXZTbWVTdGF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltU3lzdGVtUm9sZSwgIHBNYWMtPmxpbS5nTGltTWxtU3RhdGUsICBwTWFjLT5saW0uZ0xpbVByZXZNbG1TdGF0ZSk7KQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGxpbUxvZ1Nlc3Npb25TdGF0ZXMocE1hYyk7CisgICAgICAgICAgICAgICAgICAgIGxpbVByaW50TXNnTmFtZShwTWFjLCBMT0dFLCBsaW1Nc2ctPnR5cGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1IYW5kbGVDRkdwYXJhbVVwZGF0ZShwTWFjLCBsaW1Nc2ctPmJvZHl2YWwpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFdEQV9JTklUX1NDQU5fUlNQOgorICAgICAgICAgICAgbGltUHJvY2Vzc0luaXRTY2FuUnNwKHBNYWMsIGxpbU1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICBsaW1Nc2ctPmJvZHlwdHIgPSBOVUxMOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBXREFfU1RBUlRfU0NBTl9SU1A6CisgICAgICAgICAgICBsaW1Qcm9jZXNzU3RhcnRTY2FuUnNwKHBNYWMsIGxpbU1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICBsaW1Nc2ctPmJvZHlwdHIgPSBOVUxMOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBXREFfRU5EX1NDQU5fUlNQOgorICAgICAgICAgICAgbGltUHJvY2Vzc0VuZFNjYW5Sc3AocE1hYywgbGltTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgIGxpbU1zZy0+Ym9keXB0ciA9IE5VTEw7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFdEQV9GSU5JU0hfU0NBTl9SU1A6CisgICAgICAgICAgICBsaW1Qcm9jZXNzRmluaXNoU2NhblJzcChwTWFjLCBsaW1Nc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgbGltTXNnLT5ib2R5cHRyID0gTlVMTDsKKyAgICAgICAgICAgIGJyZWFrOworI2lmZGVmIEZFQVRVUkVfT0VNX0RBVEFfU1VQUE9SVAorICAgICAgICBjYXNlIFdEQV9TVEFSVF9PRU1fREFUQV9SU1A6CisgICAgICAgICAgICBsaW1Qcm9jZXNzT2VtRGF0YVJzcChwTWFjLCBsaW1Nc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgbGltTXNnLT5ib2R5cHRyID0gTlVMTDsKKyAgICAgICAgICAgIGJyZWFrOworI2VuZGlmCisKKyAgICAgICAgY2FzZSBXREFfU1dJVENIX0NIQU5ORUxfUlNQOgorICAgICAgICAgICAgbGltUHJvY2Vzc1N3aXRjaENoYW5uZWxSc3AocE1hYywgbGltTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgIGxpbU1zZy0+Ym9keXB0ciA9IE5VTEw7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIAorI2lmZGVmIEFOSV9TSVJfSUJTU19QRUVSX0NBQ0hJTkcKKyAgICAgICAgY2FzZSBXREFfSUJTU19TVEFfQUREOgorICAgICAgICAgICAgbGltSWJzc1N0YUFkZChwTWFjLCBsaW1Nc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgYnJlYWs7CisjZW5kaWYKKyAgICAgICAgY2FzZSBTSVJfQkJfWFBPUlRfTUdNVF9NU0c6CisgICAgICAgICAgICAvLyBUaGVzZSBtZXNzYWdlcyBhcmUgZnJvbSBQZWVyIE1BQyBlbnRpdHkuCisjaWZkZWYgV0xBTl9ERUJVRyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIHBNYWMtPmxpbS5udW1CYnQrKzsKKyNlbmRpZgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZfVTE2X3QgICAgIHBrdExlbiA9IDA7CisgICAgICAgICAgICAgICAgdm9zX3BrdF90ICAqcFZvc1BrdDsKKyAgICAgICAgICAgICAgICBWT1NfU1RBVFVTICB2b3NTdGF0dXM7CisgICAgICAgICAgICAgICAgdFNpck1zZ1EgICAgbGltTXNnTmV3OworICAgICAgICAgICAgICAgIC8qIFRoZSBvcmlnaW5hbCBsaW1Nc2cgd2hpY2ggd2Ugd2VyZSBkZWZlcnJpbmcgaGF2ZSB0aGUgCisgICAgICAgICAgICAgICAgICogYm9keVBvaW50ZXIgcG9pbnQgdG8gJ0JEJyBpbnN0ZWFkIG9mICdWb3MgcGt0Jy4gSWYgd2UgZG9uJ3QgbWFrZSBhIGNvcHkKKyAgICAgICAgICAgICAgICAgKiBvZiBsaW1Nc2csIHRoZW4gdm9zX3BrdF9wZWVrX2RhdGEgd2lsbCBvdmVyd3JpdGUgdGhlIGxpbU1zZy0+Ym9keVBvaW50ZXIuIAorICAgICAgICAgICAgICAgICAqIGFuZCBuZXh0IHRpbWUgd2hlbiB3ZSB0cnkgdG8gcHJvY2VzcyB0aGUgbXNnLCB3ZSB3aWxsIHRyeSB0byB1c2UgJ0JEJyBhcyAKKyAgICAgICAgICAgICAgICAgKiAnVm9zIFBrdCcgd2hpY2ggd2lsbCBjYXVzZSBhIGNyYXNoCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4KikmbGltTXNnTmV3LCAodEFOSV9VOCopbGltTXNnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1zZ1EpKTsKKyAgICAgICAgICAgICAgICBwVm9zUGt0ID0gKHZvc19wa3RfdCAqKWxpbU1zZ05ldy5ib2R5cHRyOworICAgICAgICAgICAgICAgIHZvc19wa3RfZ2V0X3BhY2tldF9sZW5ndGgocFZvc1BrdCwgJnBrdExlbik7CisKKyAgICAgICAgICAgICAgICB2b3NTdGF0dXMgPSBXREFfRFNfUGVla1J4UGFja2V0SW5mbyggcFZvc1BrdCwgKHZfUFZPSURfdCAqKSZsaW1Nc2dOZXcuYm9keXB0ciwgVk9TX0ZBTFNFICk7CisKKyAgICAgICAgICAgICAgICBpZiggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGxpbURlY3JlbWVudFBlbmRpbmdNZ210Q291bnQocE1hYyk7CisgICAgICAgICAgICAgICAgICAgIHZvc19wa3RfcmV0dXJuX3BhY2tldChwVm9zUGt0KTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICB9CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfUk9BTV9TQ0FOX09GRkxPQUQKKyAgICAgICAgICAgICAgICBpZiAoV0RBX0dFVF9ST0FNQ0FORElEQVRFSU5EKGxpbU1zZ05ldy5ib2R5cHRyKSkKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJyb2FtQ2FuZGlkYXRlSW5kICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBXREFfR0VUX1JPQU1DQU5ESURBVEVJTkQobGltTXNnTmV3LmJvZHlwdHIpKTsKKworICAgICAgICAgICAgICAgIGlmIChXREFfR0VUX09GRkxPQURTQ0FOTEVBUk4obGltTXNnTmV3LmJvZHlwdHIpKQorICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIm9mZmxvYWRTY2FuTGVhcm4gJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIFdEQV9HRVRfT0ZGTE9BRFNDQU5MRUFSTihsaW1Nc2dOZXcuYm9keXB0cikpOworI2VuZGlmCisKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICogcHV0dGluZyBhIGNoZWNrIGZvciBhZ2Ugb3V0IHByb2JlIHJlcXVlc3QgZnJhbWVzCisgICAgICAgICAgICAgICAgKiBzdWNoIHRoYXQgYW55IHByb2JlIHJlcSBtb3JlIHRoYW4gMC41IHNlYyBvbGQgY2FuIGRpcmVjdGx5CisgICAgICAgICAgICAgICAgKiBiZSBkcm9wcGVkLiBXaXRoIHRoaXMsIHRoZXJlIHdvbid0IGJlIGJsb2NraW5nIG9mIE1DIHRocmVhZC4KKyAgICAgICAgICAgICAgICAqLworCisgICAgICAgICAgICAgICAgaWYoIGxpbUFnZU91dFByb2JlUmVxICggcE1hYywgJmxpbU1zZ05ldywgcFZvc1BrdCApKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBsaW1EZWNyZW1lbnRQZW5kaW5nTWdtdENvdW50KHBNYWMpOworICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKworCisgICAgICAgICAgICAgICAgbGltSGFuZGxlODAyMTFGcmFtZXMocE1hYywgJmxpbU1zZ05ldywgJmRlZmVyTXNnKTsKKworICAgICAgICAgICAgICAgIGlmICggZGVmZXJNc2cgPT0gdHJ1ZSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzIsIEZMKCJEZWZlciBtZXNzYWdlIHR5cGU9JVggIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1Nc2ctPnR5cGUpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxpbURlZmVyTXNnKHBNYWMsIGxpbU1zZykgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJVbmFibGUgdG8gRGVmZXIgbWVzc2FnZSgweCVYKSBsaW1TbWVTdGF0ZSAlZCAocHJldiBzbWUgc3RhdGUgJWQpIHN5c1JvbGUgJWQgbWxtIHN0YXRlICVkIChwcmV2IG1sbSBzdGF0ZSAlZCkiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltTXNnLT50eXBlLCBwTWFjLT5saW0uZ0xpbVNtZVN0YXRlLCAgcE1hYy0+bGltLmdMaW1QcmV2U21lU3RhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltU3lzdGVtUm9sZSwgIHBNYWMtPmxpbS5nTGltTWxtU3RhdGUsICBwTWFjLT5saW0uZ0xpbVByZXZNbG1TdGF0ZSk7KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbUxvZ1Nlc3Npb25TdGF0ZXMocE1hYyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltUHJpbnRNc2dOYW1lKHBNYWMsIExPR0UsIGxpbU1zZy0+dHlwZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltRGVjcmVtZW50UGVuZGluZ01nbXRDb3VudChwTWFjKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfcGt0X3JldHVybl9wYWNrZXQocFZvc1BrdCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qIFBFIGlzIG5vdCBkZWZlcnJpbmcgdGhpcyA4MDIuMTEgZnJhbWUgc28gd2UgbmVlZCB0byBjYWxsIHZvc19wa3RfcmV0dXJuLiAKKyAgICAgICAgICAgICAgICAgICAgICogQXN1bXB0aW9uIGhlcmUgaXMgd2hlbiBSeCBtZ210IGZyYW1lIHByb2Nlc3NpbmcgaXMgZG9uZSwKKyAgICAgICAgICAgICAgICAgICAgICogdm9zcyBwYWNrZXQgY291bGQgYmUgZnJlZWQgaGVyZS4KKyAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgIGxpbURlY3JlbWVudFBlbmRpbmdNZ210Q291bnQocE1hYyk7CisgICAgICAgICAgICAgICAgICAgIHZvc19wa3RfcmV0dXJuX3BhY2tldChwVm9zUGt0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9TQ0FOX1JFUToKKyAgICAgICAgY2FzZSBlV05JX1NNRV9SRU1BSU5fT05fQ0hBTk5FTF9SRVE6CisgICAgICAgIGNhc2UgZVdOSV9TTUVfRElTQVNTT0NfUkVROgorICAgICAgICBjYXNlIGVXTklfU01FX0RFQVVUSF9SRVE6CisgICAgICAgIGNhc2UgZVdOSV9TTUVfR0VUX1NDQU5ORURfQ0hBTk5FTF9SRVE6CisjaWZkZWYgRkVBVFVSRV9PRU1fREFUQV9TVVBQT1JUCisgICAgICAgIGNhc2UgZVdOSV9TTUVfT0VNX0RBVEFfUkVROgorI2VuZGlmCisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICAgICAgY2FzZSBlV05JX1NNRV9URExTX1NFTkRfTUdNVF9SRVE6CisgICAgICAgIGNhc2UgZVdOSV9TTUVfVERMU19BRERfU1RBX1JFUToKKyAgICAgICAgY2FzZSBlV05JX1NNRV9URExTX0RFTF9TVEFfUkVROgorICAgICAgICBjYXNlIGVXTklfU01FX1RETFNfTElOS19FU1RBQkxJU0hfUkVROgorLy8gdGRsc29mZmNoYW4KKyAgICAgICAgY2FzZSBlV05JX1NNRV9URExTX0NIQU5ORUxfU1dJVENIX1JFUToKKyNlbmRpZgorICAgICAgICBjYXNlIGVXTklfU01FX1JFU0VUX0FQX0NBUFNfQ0hBTkdFRDoKKyAgICAgICAgICAgIC8vIFRoZXNlIG1lc3NhZ2VzIGFyZSBmcm9tIEhERAorICAgICAgICAgICAgbGltUHJvY2Vzc05vcm1hbEhkZE1zZyhwTWFjLCBsaW1Nc2csIHRydWUpOyAgLy9uZWVkIHRvIHJlc3BvbnNlIHRvIGhkZAorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlV05JX1NNRV9TQ0FOX0FCT1JUX0lORDoKKyAgICAgICAgeworICAgICAgICAgICAgdEFOSV9VOCAqcFNlc3Npb25JZCA9ICh0QU5JX1U4ICopbGltTXNnLT5ib2R5cHRyOworICAgICAgICAgICAgbGltUHJvY2Vzc0Fib3J0U2NhbkluZChwTWFjLCAqcFNlc3Npb25JZCk7CisgICAgICAgICAgICB2b3NfbWVtX2Z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1NNRV9NQUNfU1BPT0ZfQUREUl9JTkQ6CisgICAgICAgIGNhc2UgZVdOSV9TTUVfUkVHSVNURVJfTUdNVF9GUkFNRV9DQjoKKyAgICAgICAgICAgIC8vIFRoZXNlIG1lc3NhZ2VzIGFyZSBmcm9tIEhERAorICAgICAgICAgICAgbGltUHJvY2Vzc05vcm1hbEhkZE1zZyhwTWFjLCBsaW1Nc2csIGZhbHNlKTsgICAvL25vIG5lZWQgdG8gcmVzcG9uc2UgdG8gaGRkCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICAvL1Bvd2VyIFNhdmUgTWVzc2FnZXMgRnJvbSBIREQKKyAgICAgICAgY2FzZSBlV05JX1BNQ19QV1JfU0FWRV9DRkc6CisgICAgICAgIGNhc2UgZVdOSV9QTUNfRU5URVJfQk1QU19SRVE6CisgICAgICAgIGNhc2UgZVdOSV9QTUNfRVhJVF9CTVBTX1JFUToKKyAgICAgICAgY2FzZSBlV05JX1BNQ19FTlRFUl9JTVBTX1JFUToKKyAgICAgICAgY2FzZSBlV05JX1BNQ19FWElUX0lNUFNfUkVROgorICAgICAgICBjYXNlIGVXTklfUE1DX0VOVEVSX1VBUFNEX1JFUToKKyAgICAgICAgY2FzZSBlV05JX1BNQ19FWElUX1VBUFNEX1JFUToKKyAgICAgICAgY2FzZSBlV05JX1BNQ19FTlRFUl9XT1dMX1JFUToKKyAgICAgICAgY2FzZSBlV05JX1BNQ19FWElUX1dPV0xfUkVROgorICAgICAgICBjYXNlIGVXTklfUE1DX1dPV0xfQUREX0JDQVNUX1BUUk46CisgICAgICAgIGNhc2UgZVdOSV9QTUNfV09XTF9ERUxfQkNBU1RfUFRSTjoKKyAgICAgICAgICAgIHBtbVByb2Nlc3NNZXNzYWdlKHBNYWMsIGxpbU1zZyk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVXTklfUE1DX1NNUFNfU1RBVEVfSU5EIDoKKyAgICAgICAgeworICAgICAgICAgICAgaWYobGltTXNnLT5ib2R5cHRyKXsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShsaW1Nc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgbGltTXNnLT5ib2R5cHRyID0gTlVMTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfU0VORF9BQ1RJT05fRlJBTUVfSU5EOgorICAgICAgICAgICAgbGltU2VuZFAyUEFjdGlvbkZyYW1lKHBNYWMsIGxpbU1zZyk7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUobGltTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgIGxpbU1zZy0+Ym9keXB0ciA9IE5VTEw7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9BQk9SVF9SRU1BSU5fT05fQ0hBTl9JTkQ6CisgICAgICAgICAgICBsaW1BYm9ydFJlbWFpbk9uQ2hhbihwTWFjKTsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShsaW1Nc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgbGltTXNnLT5ib2R5cHRyID0gTlVMTDsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgU0lSX0hBTF9QMlBfTk9BX1NUQVJUX0lORDoKKyAgICAgICAgeworICAgICAgICAgICAgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSA9ICZwTWFjLT5saW0uZ3BTZXNzaW9uWzBdOworICAgICAgICAgICAgdEFOSV9VOCAgaTsKKyAgICAgICAgICAgIHRBTklfVTggcDJwR09FeGlzdHMgPSAwOworCisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgIkxJTSByZWNlaXZlZCBOT0Egc3RhcnQgJXgiLCBsaW1Nc2ctPnR5cGUpOworCisgICAgICAgICAgICAvKiBTaW5jZSBpbnNlcnQgTk9BIGlzIGRvbmUgYW5kIE5PQSBzdGFydCBtc2cgcmVjZWl2ZWQsIHdlIHNob3VsZCBkZWFjdGl2YXRlIHRoZSBJbnNlcnQgTk9BIHRpbWVyICovCisgICAgICAgICAgICBsaW1EZWFjdGl2YXRlQW5kQ2hhbmdlVGltZXIocE1hYywgZUxJTV9JTlNFUlRfU0lOR0xFU0hPVF9OT0FfVElNRVIpOworCisgICAgICAgICAgICBmb3IoaT0wOyBpIDwgcE1hYy0+bGltLm1heEJzc0lkOyBpKyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSA9ICZwTWFjLT5saW0uZ3BTZXNzaW9uW2ldOworICAgICAgICAgICAgICAgIGlmICAgKCAocHNlc3Npb25FbnRyeSAhPSBOVUxMKSAmJiAocHNlc3Npb25FbnRyeS0+dmFsaWQpICYmCisgICAgICAgICAgICAgICAgICAgIChwc2Vzc2lvbkVudHJ5LT5wZVBlcnNvbmEgPT0gVk9TX1AyUF9HT19NT0RFKSkKKyAgICAgICAgICAgICAgICB7IC8vU2F2ZSBQMlAgTk9BIHN0YXJ0IGF0dHJpYnV0ZXMgZm9yIFAyUCBHbyBwZXJzb25hCisgICAgICAgICAgICAgICAgICAgIHAycEdPRXhpc3RzID0gMTsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwc2Vzc2lvbkVudHJ5LT5wMnBHb1BzTm9hU3RhcnRJbmQsIGxpbU1zZy0+Ym9keXB0ciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyUDJQTm9hU3RhcnQpKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPnAycEdvUHNOb2FTdGFydEluZC5zdGF0dXMgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1csIEZMKCJHTyBOT0Egc3RhcnQgZmFpbHVyZSBzdGF0dXMgJWQgcmVwb3J0ZWQgYnkgRlcuIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgLSBzdGlsbCBnbyBhaGVhZCB3aXRoIGRlZmVycmVkIHNtZSByZXEuIFRoaXMgaXMganVzdCBpbmZvIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cDJwR29Qc05vYVN0YXJ0SW5kLnN0YXR1cyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAocDJwR09FeGlzdHMgPT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgRkwoIkJ5IHRoZSB0aW1lLCB3ZSByZWNlaXZlZCBOT0Egc3RhcnQsIEdPIGlzIGFscmVhZHkgcmVtb3ZlZC4iCisgICAgICAgICAgICAgICAgICAgICAgICAiIC0gc3RpbGwgZ28gYWhlYWQgd2l0aCBkZWZlcnJlZCBzbWUgcmVxLiBUaGlzIGlzIGp1c3QgaW5mbyIpKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyogV2UgcmVjZWl2ZWQgdGhlIE5PQSBzdGFydCBpbmRpY2F0aW9uLiBOb3cgd2UgY2FuIHNlbmQgZG93biB0aGUgU01FIHJlcXVlc3Qgd2hpY2ggcmVxdWlyZXMgb2ZmLWNoYW5uZWwgb3BlcmF0aW9uICovCisgICAgICAgICAgICBsaW1Qcm9jZXNzUmVnZERlZmRTbWVSZXFBZnRlck5PQVN0YXJ0KHBNYWMpOworICAgICAgICAgICAgdm9zX21lbV9mcmVlKGxpbU1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICBsaW1Nc2ctPmJvZHlwdHIgPSBOVUxMOworICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICAgICAgY2FzZSBTSVJfSEFMX1RETFNfSU5EOgorICAgICAgICB7CisgICAgICAgICAgICB0U2lyVGRsc0luZCAgKnBUZGxzSW5kID0gKHRwU2lyVGRsc0luZClsaW1Nc2ctPmJvZHlwdHIgOworICAgICAgICAgICAgdHBEcGhIYXNoTm9kZSBwU3RhRHMgPSBOVUxMIDsKKyAgICAgICAgICAgIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkgPSBOVUxMOworICAgICAgICAgICAgdEFOSV9VOCAgICAgICAgICAgICBzZXNzaW9uSWQ7CisgICAgICAgICAgICBpZigocHNlc3Npb25FbnRyeSA9IHBlRmluZFNlc3Npb25CeVN0YUlkKHBNYWMscFRkbHNJbmQtPnN0YUlkeCwmc2Vzc2lvbklkKSk9PSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJzZXNzaW9uIGRvZXMgbm90IGV4aXN0IGZvciBnaXZlbiBic3NJZFxuIikpOworICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKGxpbU1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgICBsaW1Nc2ctPmJvZHlwdHIgPSBOVUxMOworICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKChwU3RhRHMgPSBkcGhHZXRIYXNoRW50cnkocE1hYywgcFRkbHNJbmQtPmFzc29jSWQsICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKSkgPT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgicFN0YURzIERvZXMgbm90IGV4aXN0IGZvciBnaXZlbiBzdGFJZFxuIikpOworICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKGxpbU1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgICBsaW1Nc2ctPmJvZHlwdHIgPSBOVUxMOworICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoKFNUQV9FTlRSWV9URExTX1BFRVIgPT0gcFN0YURzLT5zdGFUeXBlKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIFRETFMgSW5kaWNhdGlvbiBmcm9tIHRoZSBGaXJtd2FyZSB3aXRoIFJlYXNvbiBDb2RlICVkICIpLAorICAgICAgICAgICAgICAgICAgICAgICBwVGRsc0luZC0+cmVhc29uQ29kZSk7CisgICAgICAgICAgICAgICAgbGltU2VuZFNtZVRETFNEZWxTdGFJbmQocE1hYywgcFN0YURzLCBwc2Vzc2lvbkVudHJ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZGxzSW5kLT5yZWFzb25Db2RlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShsaW1Nc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgbGltTXNnLT5ib2R5cHRyID0gTlVMTDsKKyAgICAgICAgIH0KKyAgICAgICAgIGJyZWFrOworI2VuZGlmCisgICAgICAgIGNhc2UgU0lSX0hBTF9QMlBfTk9BX0FUVFJfSU5EOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkgPSAmcE1hYy0+bGltLmdwU2Vzc2lvblswXTsgIAorICAgICAgICAgICAgICAgIHRBTklfVTggIGk7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1csIEZMKCJSZWNlaXZlZCBtZXNzYWdlIE5vYV9BVFRSICV4IiksIGxpbU1zZy0+dHlwZSk7CisgICAgICAgICAgICAgICAgZm9yKGk9MDsgaSA8IHBNYWMtPmxpbS5tYXhCc3NJZDsgaSsrKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSA9ICZwTWFjLT5saW0uZ3BTZXNzaW9uW2ldOworICAgICAgICAgICAgICAgICAgICBpZiAgICggKHBzZXNzaW9uRW50cnkgIT0gTlVMTCkgJiYgKHBzZXNzaW9uRW50cnktPnZhbGlkKSAmJiAKKyAgICAgICAgICAgICAgICAgICAgICAgIChwc2Vzc2lvbkVudHJ5LT5wZVBlcnNvbmEgPT0gVk9TX1AyUF9HT19NT0RFKSkKKyAgICAgICAgICAgICAgICAgICAgeyAvL1NhdmUgUDJQIGF0dHJpYnV0ZXMgZm9yIFAyUCBHbyBwZXJzb25hCisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwc2Vzc2lvbkVudHJ5LT5wMnBHb1BzVXBkYXRlLCBsaW1Nc2ctPmJvZHlwdHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJQMlBOb2FBdHRyKSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cyLCBGTCgiICZwc2Vzc2lvbkVudHJ5LT5ic3NJZCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJFU1NfU1RSICIgY3RXaW49JWQgb3BwUHNGbGFnPSVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocHNlc3Npb25FbnRyeS0+YnNzSWQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnAycEdvUHNVcGRhdGUuY3RXaW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cDJwR29Qc1VwZGF0ZS5vcHBQc0ZsYWcpOworCisgICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMiwgRkwoIiB1Tm9hMUludGVydmFsQ250PSVkIHVOb2ExRHVyYXRpb249JWQgdU5vYTFJbnRlcnZhbD0lZCB1Tm9hMVN0YXJ0VGltZT0lZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnAycEdvUHNVcGRhdGUudU5vYTFJbnRlcnZhbENudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wMnBHb1BzVXBkYXRlLnVOb2ExRHVyYXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cDJwR29Qc1VwZGF0ZS51Tm9hMUludGVydmFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnAycEdvUHNVcGRhdGUudU5vYTFTdGFydFRpbWUpOworCisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgfQorICAgICAgICAgICAgdm9zX21lbV9mcmVlKGxpbU1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICBsaW1Nc2ctPmJvZHlwdHIgPSBOVUxMOworICAgICAgICAgICAgCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgCisgICAgICAgIC8qIGVXTklfU01FX1BSRV9DSEFOTkVMX1NXSVRDSF9GVUxMX1BPV0VSIE1lc3NhZ2UgY29tZXMgYWZ0ZXIgdGhlCisgICAgICAgICAqIGRldmljZSBjb21lcyBvdXQgb2YgZnVsbCBwb3dlciBmb3IgdGhlIGZ1bGwgcG93ZXIgcmVxdWVzdCBzZW50IAorICAgICAgICAgKiBiZWNhdXNlIG9mIGNoYW5uZWwgc3dpdGNoIHdpdGggc3dpdG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AgICAgIHBtbVByb2Nlc3NNZXNzYWdlKHBNYWMsIGxpbU1zZyk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFdEQV9MT1dfUlNTSV9JTkQ6CisgICAgICAgICAgICAvL2xpbUhhbmRsZUxvd1Jzc2lJbmQocE1hYyk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFdEQV9CTVBTX1NUQVRVU19JTkQ6CisgICAgICAgICAgICBsaW1IYW5kbGVCbXBzU3RhdHVzSW5kKHBNYWMpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBXREFfTUlTU0VEX0JFQUNPTl9JTkQ6CisgICAgICAgICAgICBsaW1IYW5kbGVNaXNzZWRCZWFjb25JbmQocE1hYywgbGltTXNnKTsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShsaW1Nc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgbGltTXNnLT5ib2R5cHRyID0gTlVMTDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdEQV9NSUNfRkFJTFVSRV9JTkQ6CisgICAgICAgICAgIGxpbU1pY0ZhaWx1cmVJbmQocE1hYywgbGltTXNnKTsKKyAgICAgICAgICAgdm9zX21lbV9mcmVlKGxpbU1zZy0+Ym9keXB0cik7CisgICAgICAgICAgIGxpbU1zZy0+Ym9keXB0ciA9IE5VTEw7CisgICAgICAgICAgIGJyZWFrOworICAgIAorICAgICAgICBjYXNlIFdEQV9MT1NUX0xJTktfUEFSQU1TX0lORDoKKyAgICAgICAgICAgIGxpbVByb2Nlc3NMb3N0TGlua1BhcmFtc0luZChwTWFjLGxpbU1zZyk7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUobGltTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgIGxpbU1zZy0+Ym9keXB0ciA9IE5VTEw7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFNJUl9MSU1fQUREVFNfUlNQX1RJT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isgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTSVJfTElNX0RFTF9CQV9BTExfSU5EOgorICAgICAgICAgICAgbGltRGVsQWxsQkFTZXNzaW9ucyhwTWFjKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9MSU1fREVMX0JBX0lORDoKKyAgICAgICAgICAgIGxpbVByb2Nlc3NNbG1IYWxCQURlbGV0ZUluZCggcE1hYywgbGltTXNnICk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgY2FzZSBTSVJfTElNX0JFQUNPTl9HRU5fSU5EOiB7CisKKyAgICAgICAgICAgICAgICBpZiggcE1hYy0+bGltLmdMaW1TeXN0ZW1Sb2xlICE9IGVMSU1fQVBfUk9MRSApCisgICAgICAgICAgICAgICAgICAgIHNjaFByb2Nlc3NQcmVCZWFjb25JbmQocE1hYywgbGltTXNnKTsgICAgCisKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBTSVJfTElNX0RFTEVURV9TVEFfQ09OVEVYVF9JTkQ6CisgICAgICAgICAgICBsaW1EZWxldGVTdGFDb250ZXh0KHBNYWMsIGxpbU1zZyk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFNJUl9MSU1fTUlOX0NIQU5ORUxfVElNRU9VVDoKKyAgICAgICAgY2FzZSBTSVJfTElNX01BWF9DSEFOTkVMX1RJTUVPVVQ6CisgICAgICAgIGNhc2UgU0lSX0xJTV9QRVJJT0RJQ19QUk9CRV9SRVFfVElNRU9VVDoKKyAgICAgICAgY2FzZSBTSVJfTElNX0pPSU5fRkFJTF9USU1FT1VUOgorICAgICAgICBjYXNlIFNJUl9MSU1fUEVSSU9ESUNfSk9JTl9QUk9CRV9SRVFfVElNRU9VVDoKKyAgICAgICAgY2FzZSBTSVJfTElNX0FVVEhfRkFJTF9USU1FT1VUOgorICAgICAgICBjYXNlIFNJUl9MSU1fQVVUSF9SU1BfVElNRU9VVDoKKyAgICAgICAgY2FzZSBTSVJfTElNX0FTU09DX0ZBSUxfVElNRU9VVDoKKyAgICAgICAgY2FzZSBTSVJfTElNX1JFQVNTT0NfRkFJTF9USU1FT1VUOgorI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCisgICAgICAgIGNhc2UgU0lSX0xJTV9GVF9QUkVBVVRIX1JTUF9USU1FT1VUOgorI2VuZGlmCisgICAgICAgIGNhc2UgU0lSX0xJTV9SRU1BSU5fQ0hOX1RJTUVPVVQ6CisgICAgICAgIGNhc2UgU0lSX0xJTV9JTlNFUlRfU0lOR0xFU0hPVF9OT0FfVElNRU9VVDoKKyAgICAgICAgY2FzZSBTSVJfTElNX0RJU0FTU09DX0FDS19USU1FT1VUOgorICAgICAgICBjYXNlIFNJUl9MSU1fREVBVVRIX0FDS19USU1FT1VUOgorICAgICAgICBjYXNlIFNJUl9MSU1fQ09OVkVSVF9BQ1RJVkVfQ0hBTk5FTF9UT19QQVNTSVZFOgorICAgICAgICBjYXNlIFNJUl9MSU1fQVVUSF9SRVRSWV9USU1FT1VUOgorICAgICAgICAgICAgLy8gVGhlc2UgdGltZW91dCBtZXNzYWdlcyBhcmUgaGFuZGxlZCBieSBNTE0gc3ViIG1vZHVsZQorCisgICAgICAgICAgICBsaW1Qcm9jZXNzTWxtUmVxTWVzc2FnZXMocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1Nc2cpOworCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFNJUl9MSU1fSEVBUlRfQkVBVF9USU1FT1VUOgorICAgICAgICAgICAgLyoqIGNoZWNrIGlmIGhlYXJ0IGJlYXQgZmFpbGVkLCBldmVuIGlmIG9uZSBCZWFjb24KKyAgICAgICAgICAgICAgICAgICAgKiBpcyByY3ZkIHdpdGhpbiB0aGUgSGVhcnQgQmVhdCBpbnRlcnZhbCBjb250aW51ZQorICAgICAgICAgICAgICAgICAgKiBub3JtYWwgcHJvY2Vzc2luZworICAgICAgICAgICAgICAgICAgICAqLworCisgICAgICAgICAgICAjaWYgMCAKKyAgICAgICAgICAgIFBFTE9HMShsaW1Mb2cocE1hYywgTE9HMSwgRkwoIkhlYXJ0YmVhdCB0aW1lb3V0LCBTTUUgJWQsIE1MTUUgJWQsICNiY24gJWQiKSwKKyAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbVNtZVN0YXRlLCBwTWFjLT5saW0uZ0xpbU1sbVN0YXRlLAorICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltUnhlZEJlYWNvbkNudER1cmluZ0hCKTspCisKKyAgICAgICAgICAgIGlmKHBNYWMtPmxpbS5nTGltU3lzdGVtUm9sZSA9PSBlTElNX1NUQV9JTl9JQlNTX1JPTEUpCisgICAgICAgICAgICAgICAgbGltSWJzc0hlYXJ0QmVhdEhhbmRsZShwTWFjKTsgLy9IZWFydEJlYXQgZm9yIHBlZXJzLgorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgICAgKiBIZWFydGJlYXQgZmFpbHVyZSBvY2N1cnJlZCBvbiBTVEEKKyAgICAgICAgICAgICAgICAgICAgICAqIFRoaXMgaXMgaGFuZGxlZCBieSBMTU0gc3ViIG1vZHVsZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgbGltSGFuZGxlSGVhcnRCZWF0RmFpbHVyZShwTWFjKTsKKworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAjZW5kaWYgLy9UTyBTVVBQT1JUIEJULUFNUAorICAgICAgICAgICAgaWYgKGxpbUlzU3lzdGVtSW5TY2FuU3RhdGUocE1hYykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gU3lzdGVtIGlzIGluIERGUyAoTGVhcm4pIG1vZGUKKyAgICAgICAgICAgICAgICAvLyBEZWZlciBwcm9jZXNzc2luZyB0aGlzIG1lc3NhZ2UKKyAgICAgICAgICAgICAgICBpZiAobGltRGVmZXJNc2cocE1hYywgbGltTXNnKSAhPSBUWF9TVUNDRVNTKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiVW5hYmxlIHRvIERlZmVyIG1lc3NhZ2UoMHglWCkgbGltU21lU3RhdGUgJWQgKHByZXYgc21lIHN0YXRlICVkKSBzeXNSb2xlICVkIG1sbSBzdGF0ZSAlZCAocHJldiBtbG0gc3RhdGUgJWQpIiksCisgICAgICAgICAgICAgICAgICAgICAgICBsaW1Nc2ctPnR5cGUsIHBNYWMtPmxpbS5nTGltU21lU3RhdGUsICBwTWFjLT5saW0uZ0xpbVByZXZTbWVTdGF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltU3lzdGVtUm9sZSwgIHBNYWMtPmxpbS5nTGltTWxtU3RhdGUsICBwTWFjLT5saW0uZ0xpbVByZXZNbG1TdGF0ZSk7KQorICAgICAgICAgICAgICAgICAgICBsaW1Mb2dTZXNzaW9uU3RhdGVzKHBNYWMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgaWYgKE5VTEwgPT0gbGltTXNnLT5ib2R5cHRyKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICBsaW1IYW5kbGVIZWFydEJlYXRUaW1lb3V0KHBNYWMpOworICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgbGltSGFuZGxlSGVhcnRCZWF0VGltZW91dEZvclNlc3Npb24ocE1hYywgKHRwUEVTZXNzaW9uKWxpbU1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgU0lSX0xJTV9QUk9CRV9IQl9GQUlMVVJFX1RJTUVPVVQ6CisgICAgICAgICAgICBsaW1IYW5kbGVIZWFydEJlYXRGYWlsdXJlVGltZW91dChwTWFjKTsgICAgICAgICAgICAKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgU0lSX0xJTV9DSEFOTkVMX1NDQU5fVElNRU9VVDoKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogQmFja2dyb3VuZCBzY2FuIHRpbWVvdXQgb2NjdXJyZWQgb24gU1RBLgorICAgICAgICAgICAgICogVGhpcyBpcyBoYW5kbGVkIGJ5IExNTSBzdWIgbW9kdWxlLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICAgbGltRGVhY3RpdmF0ZUFuZENoYW5nZVRpbWVyKHBNYWMsIGVMSU1fQkFDS0dST1VORF9TQ0FOX1RJTUVSKTsKKworICAgICAgICAgICAgLy9XZSB3aWxsIGRvIGJhY2tncm91bmQgc2NhbiBldmVuIGluIGJjbnBzIG1vZGUKKyAgICAgICAgICAgIC8vaWYgKHBNYWMtPnN5cy5nU3lzRW5hYmxlU2Nhbk1vZGUpCisgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbVJlcG9ydEJhY2tncm91bmRTY2FuUmVzdWx0cyA9IEZBTFNFOworICAgICAgICAgICAgbGltVHJpZ2dlckJhY2tncm91bmRTY2FuKHBNYWMpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBTSVJfTElNX0NORl9XQUlUX1RJTUVPVVQ6CisKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAqKiBEb2VzIG5vdCByZWNlaXZlIENORiBvciBkdW1teSBwYWNrZXQKKyAgICAgICAgICAgICoqLworICAgICAgICAgICAgbGltSGFuZGxlQ25mV2FpdFRpbWVvdXQocE1hYywgKHRBTklfVTE2KSBsaW1Nc2ctPmJvZHl2YWwpOworCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFNJUl9MSU1fS0VFUEFMSVZFX1RJTUVPVVQ6CisgICAgICAgICAgICBsaW1TZW5kS2VlcEFsaXZlVG9QZWVyKHBNYWMpOworCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFNJUl9MSU1fUkVUUllfSU5URVJSVVBUX01TRzoKKyAgICAgICAgICAgIC8vIE1lc3NhZ2UgZnJvbSBJU1IgdXBvbiBURlAncyBtYXggcmV0cnkgbGltaXQgaW50ZXJydXB0CisKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgU0lSX0xJTV9JTlZfS0VZX0lOVEVSUlVQVF9NU0c6CisgICAgICAgICAgICAvLyBNZXNzYWdlIGZyb20gSVNSIHVwb24gU1AncyBJbnZhbGlkIHNlc3Npb24ga2V5IGludGVycnVwdAorCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFNJUl9MSU1fS0VZX0lEX0lOVEVSUlVQVF9NU0c6CisgICAgICAgICAgICAvLyBNZXNzYWdlIGZyb20gSVNSIHVwb24gU1AncyBJbnZhbGlkIGtleSBJRCBpbnRlcnJ1cHQKKworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBTSVJfTElNX1JFUExBWV9USFJFU19JTlRFUlJVUFRfTVNHOgorICAgICAgICAgICAgLy8gTWVzc2FnZSBmcm9tIElTUiB1cG9uIFNQJ3MgUmVwbGF5IHRocmVzaG9sZCBpbnRlcnJ1cHQKKworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBTSVJfTElNX0NIQU5ORUxfU1dJVENIX1RJTUVPVVQ6CisgICAgICAgICAgICBsaW1Qcm9jZXNzQ2hhbm5lbFN3aXRjaFRpbWVvdXQocE1hYyk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFNJUl9MSU1fUVVJRVRfVElNRU9VVDoKKyAgICAgICAgICAgIGxpbVByb2Nlc3NRdWlldFRpbWVvdXQocE1hYyk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFNJUl9MSU1fUVVJRVRfQlNTX1RJTUVPVVQ6CisgICAgICAgICAgICBsaW1Qcm9jZXNzUXVpZXRCc3NUaW1lb3V0KHBNYWMpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBTSVJfTElNX1VQREFURV9PTEJDX0NBQ0hFTF9USU1FT1VUOgorICAgICAgICAgICAgbGltSGFuZGxlVXBkYXRlT2xiY0NhY2hlKHBNYWMpOworICAgICAgICAgICAgYnJlYWs7CisjaWYgMAorICAgICAgICBjYXNlIFNJUl9MSU1fV1BTX09WRVJMQVBfVElNRU9VVDoKKyAgICAgICAgICAgIGxpbVByb2Nlc3NXUFNPdmVybGFwVGltZW91dChwTWFjKTsKKyAgICAgICAgICAgIGJyZWFrOworI2VuZGlmCisgICAgICAgIGNhc2UgV0RBX0FERF9CU1NfUlNQOgorICAgICAgICAgICAgbGltUHJvY2Vzc01sbUFkZEJzc1JzcCggcE1hYywgbGltTXNnICk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFdEQV9BRERfU1RBX1JTUDoKKworICAgICAgICAgICAgLy9jYWxsIGEgd3JhcHBlciBieSBwYWFzaW5nIGJvZHlwdHIsIHRoZWlyIGdldCBzZXNzaW9uSUQgYW5kIGFuZCBjYWxsIHByb3BlciBmdW5jdGlvbiBmcm9tIHRoZXJlLgorICAgICAgICAgICAgbGltUHJvY2Vzc0FkZFN0YVJzcChwTWFjLGxpbU1zZyk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFdEQV9ERUxFVEVfU1RBX1JTUDoKKyAgICAgICAgICAgIGxpbVByb2Nlc3NNbG1EZWxTdGFSc3AocE1hYywgbGltTXNnKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgV0RBX0FERF9TVEFfU0VMRl9SU1A6CisgICAgICAgICAgICBsaW1Qcm9jZXNzQWRkU3RhU2VsZlJzcChwTWFjLCBsaW1Nc2cpOworICAgICAgICAgICAgYnJlYWs7IAorICAgICAgICBjYXNlIFdEQV9ERUxfU1RBX1NFTEZfUlNQOgorICAgICAgICAgICAgbGltUHJvY2Vzc0RlbFN0YVNlbGZSc3AocE1hYywgbGltTXNnKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgV0RBX0RFTEVURV9CU1NfUlNQOgorICAgICAgICAgICAgbGltSGFuZGxlRGVsZXRlQnNzUnNwKHBNYWMsbGltTXNnKTsgLy93cmFwcGVyIHJvdXRpbmUgdG8gaGFuZGxlIGRlbGV0ZSBic3MgcmVzcG9uc2UgCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFdEQV9TRVRfQlNTS0VZX1JTUDoKKyAgICAgICAgY2FzZSBXREFfU0VUX1NUQV9CQ0FTVEtFWV9SU1A6CisgICAgICAgICAgICBsaW1Qcm9jZXNzTWxtU2V0QnNzS2V5UnNwKCBwTWFjLCBsaW1Nc2cgKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdEQV9TRVRfU1RBS0VZX1JTUDoKKyAgICAgICAgICAgIGxpbVByb2Nlc3NNbG1TZXRTdGFLZXlSc3AoIHBNYWMsIGxpbU1zZyApOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgV0RBX1JFTU9WRV9CU1NLRVlfUlNQOgorICAgICAgICBjYXNlIFdEQV9SRU1PVkVfU1RBS0VZX1JTUDoKKyAgICAgICAgICAgIGxpbVByb2Nlc3NNbG1SZW1vdmVLZXlSc3AoIHBNYWMsIGxpbU1zZyApOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgV0RBX0FEREJBX1JTUDoKKyAgICAgICAgICAgIGxpbVByb2Nlc3NNbG1IYWxBZGRCQVJzcCggcE1hYywgbGltTXNnICk7CisgICAgICAgICAg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UWF9QT1dFUl9SU1A6ICAgICAgICAgIC8vbGltUHJvY2Vzc0dldFR4UG93ZXJSc3AocE1hYywgbGltTXNnKTsKKyAgICAgICAgY2FzZSBXREFfR0VUX05PSVNFX1JTUDoKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZSgodl9WT0lEX3QqKWxpbU1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICBsaW1Nc2ctPmJvZHlwdHIgPSBOVUxMOworICAgICAgICAgICAgLy9saW1Qcm9jZXNzR2V0Tm9pc2VSc3AocE1hYywgbGltTXNnKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgV0RBX1NFVF9NQVhfVFhfUE9XRVJfUlNQOgorI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX1ZPV0lGSQorICAgICAgICAgICAgcnJtU2V0TWF4VHhQb3dlclJzcCggcE1hYywgbGltTXNnICk7CisjZW5kaWYKKyAgICAgICAgICAgIGlmKGxpbU1zZy0+Ym9keXB0ciAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKCh2X1ZPSURfdCopbGltTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgICAgIGxpbU1zZy0+Ym9keXB0ciA9IE5VTEw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgIGNhc2UgU0lSX0xJTV9BRERSMl9NSVNTX0lORDoKKyAgICAgICB7CisgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgIEZMKCJBZGRyMiBtaXNtYXRjaCBpbnRlcnJ1cHQgcmVjZWl2ZWQgJVgiKSwKKyAgICAgICAgICAgICAgICAgICBsaW1Nc2ctPnR5cGUpOworICAgICAgICAgICAvKmEgbWVzc2FnZSBmcm9tIEhBTCBpbmRpY2F0aW5nIGFkZHIyIG1pc21hdGNoIGludGVycnVwdCBvY2N1cnJlZAorICAgICAgICAgICAgIGxpbU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CisgICAgICAgICAgICB0QU5JX1U4IHNlc3Npb25JZCA9ICh0QU5JX1U4KWxpbU1zZy0+Ym9keXZhbCA7CisgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5ID0gJnBNYWMtPmxpbS5ncFNlc3Npb25bc2Vzc2lvbklkXTsKKyAgICAgICAgICAgIGlmKHBzZXNzaW9uRW50cnkgIT0gTlVMTCAmJiBJU19BQ1RJVkVNT0RFX09GRkxPQURfRkVBVFVSRV9FTkFCTEUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvLyBzZW5kaW5nIGJlYWNvbiBmaWx0ZXJpbmcgaW5mb3JtYXRpb24gZG93biB0byBIQUwKKyAgICAgICAgICAgICAgIGlmIChsaW1TZW5kQmVhY29uRmlsdGVySW5mbyhwTWFjLCBwc2Vzc2lvbkVudHJ5KSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkZhaWwgdG8gc2VuZCBCZWFjb24gRmlsdGVyIEluZm8gIikpOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgdm9zX21lbV9mcmVlKCh2X1ZPSURfdCAqKShsaW1Nc2ctPmJvZHlwdHIpKTsKKyAgICAgICAgICAgIGxpbU1zZy0+Ym9keXB0ciA9IE5VTEw7CisjZW5kaWYKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICBjYXNlIGVXTklfU01FX0hUNDBfT0JTU19TQ0FOX0lORDoKKyAgICAgICAgeworICAgICAgICAgICAgdHBQRVNlc3Npb24gICAgIHBzZXNzaW9uRW50cnkgPSBOVUxMOworICAgICAgICAgICAgdEFOSV9VOCAgICAgICAgIHNlc3Npb25JZDsKKyAgICAgICAgICAgIHRTaXJTbWVIVDQwT0JTU1NjYW5JbmQgKmh0NDBTY2FuSW5kID0KKyAgICAgICAgICAgICAgICAodFNpclNtZUhUNDBPQlNTU2NhbkluZCAqKWxpbU1zZy0+Ym9keXB0cjsKKworICAgICAgICAgICAgcHNlc3Npb25FbnRyeSA9IHBlRmluZFNlc3Npb25CeUJzc2lkKHBNYWMsIGh0NDBTY2FuSW5kLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgJnNlc3Npb25JZCk7CisKKyAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5ICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoIElTX0hUNDBfT0JTU19TQ0FOX0ZFQVRVUkVfRU5BQkxFICYmCisgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5odFN1cHBvcnRlZENoYW5uZWxXaWR0aFNldCA9PQorICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19DSEFOTkVMX0JPTkRJTkdfTU9ERV9FTkFCTEUgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfUEUsVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIk9CU1MgU2NhbiBTdGFydCBSZXE6IHNlc3Npb24gaWQgJWQiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgImh0U3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0ICVkIiwgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+aHRTdXBwb3J0ZWRDaGFubmVsV2lkdGhTZXQpOworICAgICAgICAgICAgICAgICAgICBsaW1TZW5kSFQ0ME9CU1NTY2FuSW5kKHBNYWMsIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9QRSxWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiT0JTUyBTY2FuIG5vdCBzdGFydGVkOiBodFN1cHBvcnRlZENoYW5uZWxXaWR0aFNldC0gJWQiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBzZXNzaW9uIGlkICVkIiwgcHNlc3Npb25FbnRyeS0+aHRTdXBwb3J0ZWRDaGFubmVsV2lkdGhTZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9QRSxWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICJPQlNTIFNjYW4gbm90IHN0YXJ0ZWQ6IHNlc3Npb24gaWQgaXMgTlVMTCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdm9zX21lbV9mcmVlKGxpbU1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICBsaW1Nc2ctPmJvZHlwdHIgPSBOVUxMOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgZVdOSV9TTUVfSFQ0MF9TVE9QX09CU1NfU0NBTl9JTkQ6CisgICAgICAgIHsKKyAgICAgICAgICAgdHBQRVNlc3Npb24gICAgIHBzZXNzaW9uRW50cnkgPSBOVUxMOworICAgICAgICAgICB0QU5JX1U4IHNlc3Npb25JZCA9ICh0QU5JX1U4KWxpbU1zZy0+Ym9keXZhbCA7CisKKyAgICAgICAgICAgcHNlc3Npb25FbnRyeSA9ICZwTWFjLT5saW0uZ3BTZXNzaW9uW3Nlc3Npb25JZF07CisgICAgICAgICAgIC8qIFNlbmRpbmcgTElNIFNUT1AgT0JTUyBTQ0FOIEluZGljYXRpb24KKyAgICAgICAgICAgICAgICAgICAgIFN0b3AgY29tbWFuZCBzdXBwb3J0IGlzIG9ubHkgZm9yIGRlYnVnZ2luZyBwdXJwb3NlICovCisgICAgICAgICAgIGlmICggSVNfSFQ0MF9PQlNTX1NDQU5fRkVBVFVSRV9FTkFCTEUgKQorICAgICAgICAgICAgICBsaW1TZW5kSFQ0ME9CU1NTdG9wU2NhbkluZChwTWFjLCBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9QRSxWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgIk9CU1MgU2NhbiBTdG9wIG5vdCBzdGFydGVkICIpOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworI2lmZGVmIFdMQU5fRkVBVFVSRV9BUF9IVDQwXzI0RworICAgIGNhc2UgZVdOSV9TTUVfU0VUX0hUXzIwNDBfTU9ERToKKyAgICAgICAgbGltUHJvY2Vzc1NtZVJlcU1lc3NhZ2VzKHBNYWMsIGxpbU1zZyk7CisgICAgICAgIHZvc19tZW1fZnJlZSgodl9WT0lEX3QqKWxpbU1zZy0+Ym9keXB0cik7CisgICAgICAgIGxpbU1zZy0+Ym9keXB0ciA9IE5VTEw7CisgICAgICAgIGJyZWFrOworI2VuZGlmCisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworICAgICAgICBjYXNlIFdEQV9TRVRfVERMU19MSU5LX0VTVEFCTElTSF9SRVFfUlNQOgorICAgICAgICB7CisgICAgICAgICAgICB0cFBFU2Vzc2lvbiAgICAgcHNlc3Npb25FbnRyeTsKKyAgICAgICAgICAgIHRBTklfVTggICAgICAgICBzZXNzaW9uSWQ7CisgICAgICAgICAgICB0VGRsc0xpbmtFc3RhYmxpc2hQYXJhbXMgKnBUZGxzTGlua0VzdGFibGlzaFBhcmFtczsKKyAgICAgICAgICAgIHBUZGxzTGlua0VzdGFibGlzaFBhcmFtcyA9ICh0VGRsc0xpbmtFc3RhYmxpc2hQYXJhbXMqKSBsaW1Nc2ctPmJvZHlwdHI7CisKKyAgICAgICAgICAgIGlmKChwc2Vzc2lvbkVudHJ5ID0gcGVGaW5kU2Vzc2lvbkJ5U3RhSWQocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zLT5zdGFJZHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZzZXNzaW9uSWQpKT09IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJzZXNzaW9uICV1ICBkb2VzIG5vdCBleGlzdCIpLCBzZXNzaW9uSWQpOworICAgICAgICAgICAgICAgIC8qIFN0aWxsIHNlbmQgdGhlIGVXTklfU01FX1RETFNfTElOS19FU1RBQkxJU0hfUlNQIG1lc3NhZ2UgdG8gU01FCisgICAgICAgICAgICAgICAgICAgd2l0aCBzZXNzaW9uIGlkIGFzIHplcm8gYW5kIHN0YXR1cyBhcyBGQUlMVVJFIHNvLCB0aGF0IG1lc3NhZ2UKKyAgICAgICAgICAgICAgICAgICBxdWV1ZWQgaW4gU01FIHF1ZXVlIGNhbiBiZSBmcmVlZCB0byBwcmV2ZW50IHRoZSBTTUUgY21kIGJ1ZmZlciBsZWFrICovCisgICAgICAgICAgICAgICAgbGltU2VuZFNtZVRkbHNMaW5rRXN0YWJsaXNoUmVxUnNwKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfRkFJTFVSRSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltU2VuZFNtZVRkbHNMaW5rRXN0YWJsaXNoUmVxUnNwKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnNtZVNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zLT5zdGF0dXMpIDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHZvc19tZW1fZnJlZSgodl9WT0lEX3QgKikobGltTXNnLT5ib2R5cHRyKSk7CisgICAgICAgICAgICBsaW1Nc2ctPmJvZHlwdHIgPSBOVUxMOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIFdEQV9TRVRfVERMU19DSEFOX1NXSVRDSF9SRVFfUlNQOgorICAgICAgICB7CisgICAgICAgICAgICB0cFBFU2Vzc2lvbiAgICAgcHNlc3Npb25FbnRyeTsKKyAgICAgICAgICAgIHRBTklfVTggICAgICAgICBzZXNzaW9uSWQ7CisgICAgICAgICAgICB0VGRsc0NoYW5Td2l0Y2hQYXJhbXMgKnBUZGxzQ2hhblN3aXRjaFBhcmFtczsKKyAgICAgICAgICAgIHBUZGxzQ2hhblN3aXRjaFBhcmFtcyA9ICh0VGRsc0NoYW5Td2l0Y2hQYXJhbXMqKSBsaW1Nc2ctPmJvZHlwdHI7CisKKyAgICAgICAgICAgIGlmKChwc2Vzc2lvbkVudHJ5ID0gcGVGaW5kU2Vzc2lvbkJ5U3RhSWQocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRkbHNDaGFuU3dpdGNoUGFyYW1zLT5zdGFJZHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZzZXNzaW9uSWQpKT09IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJzZXNzaW9uICV1ICBkb2VzIG5vdCBleGlzdCIpLCBzZXNzaW9uSWQpOworICAgICAgICAgICAgICAgIC8qIFN0aWxsIHNlbmQgdGhlIGVXTklfU01FX1RETFNfTElOS19FU1RBQkxJU0hfUlNQIG1lc3NhZ2UgdG8gU01FCisgICAgICAgICAgICAgICAgICAgd2l0aCBzZXNzaW9uIGlkIGFzIHplcm8gYW5kIHN0YXR1cyBhcyBGQUlMVVJFIHNvLCB0aGF0IG1lc3NhZ2UKKyAgICAgICAgICAgICAgICAgICBxdWV1ZWQgaW4gU01FIHF1ZXVlIGNhbiBiZSBmcmVlZCB0byBwcmV2ZW50IHRoZSBTTUUgY21kIGJ1ZmZlciBsZWFrICovCisgICAgICAgICAgICAgICAgbGltU2VuZFNtZVRkbHNDaGFuU3dpdGNoUmVxUnNwKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfRkFJTFVSRSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltU2VuZFNtZVRkbHNDaGFuU3dpdGNoUmVxUnNwKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnNtZVNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRkbHNDaGFuU3dpdGNoUGFyYW1zLT5zdGF0dXMpIDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHZvc19tZW1fZnJlZSgodl9WT0lEX3QgKikobGltTXNnLT5ib2R5cHRyKSk7CisgICAgICAgICAgICBsaW1Nc2ctPmJvZHlwdHIgPSBOVUxMOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyNlbmRpZgorCisgICAgY2FzZSBXREFfUlhfU0NBTl9FVkVOVDoKKyAgICAgICAgbGltUHJvY2Vzc1J4U2NhbkV2ZW50KHBNYWMsIGxpbU1zZy0+Ym9keXB0cik7CisgICAgICAgIGJyZWFrOworCisgICAgY2FzZSBXREFfSUJTU19QRUVSX0lOQUNUSVZJVFlfSU5EOgorICAgIHsKKyAgICAgICBsaW1Qcm9jZXNzSWJzc1BlZXJJbmFjdGl2aXR5KHBNYWMsIGxpbU1zZy0+Ym9keXB0cik7CisgICAgICAgdm9zX21lbV9mcmVlKCh2X1ZPSURfdCAqKShsaW1Nc2ctPmJvZHlwdHIpKTsKKyAgICAgICBsaW1Nc2ctPmJvZHlwdHIgPSBOVUxMOworICAgICAgIGJyZWFrOworICAgIH0KKworICAgIGNhc2UgV0RBX1NQT09GX01BQ19BRERSX1JTUDoKKyAgICAgICBsaW1Qcm9jZXNzTWxtU3Bvb2ZNYWNBZGRyUnNwKHBNYWMsICh0U2lyUmV0U3RhdHVzKWxpbU1zZy0+Ym9keXZhbCk7CisgICAgICAgYnJlYWs7CisKKyAgICBjYXNlIGVXTklfU01FX1NFVF9URExTXzIwNDBfQlNTQ09FWF9SRVE6CisgICAgICAgICBsaW1Qcm9jZXNzU21lU2V0VGRsczIwNDBCU1NDb2V4UmVxKHBNYWMsIGxpbU1zZy0+Ym9keXB0cik7CisgICAgICAgICB2b3NfbWVtX2ZyZWUoKHZfVk9JRF90KilsaW1Nc2ctPmJvZHlwdHIpOworICAgICAgICAgbGltTXNnLT5ib2R5cHRyID0gTlVMTDsKKyAgICAgICAgYnJlYWs7CisKKyAgICBjYXNlIGVXTklfU01FX0RFTF9BTExfVERMU19QRUVSUzoKKyAgICAgICAgIGxpbVByb2Nlc3NTbWVEZWxBbGxUZGxzUGVlcnMocE1hYywgbGltTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIHZvc19tZW1fZnJlZSgodl9WT0lEX3QqKWxpbU1zZy0+Ym9keXB0cik7CisgICAgICAgICBsaW1Nc2ctPmJvZHlwdHIgPSBOVUxMOworICAgICAgICAgYnJlYWs7CisKKyAgICBkZWZhdWx0OgorICAgICAgICB2b3NfbWVtX2ZyZWUoKHZfVk9JRF90KilsaW1Nc2ctPmJvZHlwdHIpOworICAgICAgICBsaW1Nc2ctPmJvZHlwdHIgPSBOVUxMOworICAgICAgICAvLyBVbndhbnRlZCBtZXNzYWdlcworICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgRkwoIkRpc2NhcmRpbmcgdW5leHBlY3RlZCBtZXNzYWdlIHJlY2VpdmVkICVYIiksCisgICAgICAgICAgICAgICAgbGltTXNnLT50eXBlKTsKKyAgICAgICAgbGltUHJpbnRNc2dOYW1lKHBNYWMsIExPR0UsIGxpbU1zZy0+dHlwZSk7CisgICAgICAgIGJyZWFrOworCisgICAgfSAvLyBzd2l0Y2ggKG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ICAgICAgIHBNYWMtPmxpbS5nTGltU3lzdGVtUm9sZSwgIHBNYWMtPmxpbS5nTGltTWxtU3RhdGUsICBwTWFjLT5saW0uZ0xpbVByZXZNbG1TdGF0ZSk7KQorICAgICAgICAgICAgbGltTG9nU2Vzc2lvblN0YXRlcyhwTWFjKTsKKyAgICAgICAgICAgIGxpbVByaW50TXNnTmFtZShwTWFjLCBMT0dFLCBwTGltTXNnLT50eXBlKTsKKyAgICAgICAgICAgIC8vIFJlbGVhc2UgYm9keQorICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBMaW1Nc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgcExpbU1zZy0+Ym9keXB0ciA9IE5VTEw7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgaWYoZlJzcFJlcWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIFRoZXNlIG1lc3NhZ2VzIGFyZSBmcm9tIEhERAorICAgICAgICAgICAgLy8gU2luY2UgdGhlc2UgcmVxdWVzdHMgbWF5IGFsc28gYmUgZ2VuZXJhdGVkCisgICAgICAgICAgICAvLyBpbnRlcm5hbGx5IHdpdGhpbiBMSU0gbW9kdWxlLCBuZWVkIHRvCisgICAgICAgICAgICAvLyBkaXN0aW5xdWlzaCBhbmQgc2VuZCByZXNwb25zZSB0byBob3N0CisgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbVJzcFJlcWQgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgfQorI2lmZGVmIFdMQU5fREVCVUcgICAgICAgICAgICAKKyAgICAgICAgcE1hYy0+bGltLm51bVNtZSsrOworI2VuZGlmCisgICAgICAgIGlmKGxpbVByb2Nlc3NTbWVSZXFNZXNzYWdlcyhwTWFjLCBwTGltTXNnKSkKKyAgICAgICAgeworICAgICAgICAgICAgLy8gUmVsZWFzZSBib2R5CisgICAgICAgICAgICAvLyBsaW1Qcm9jZXNzU21lUmVxTWVzc2FnZSBjb25zd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hYyk7IGJyZWFrOworICAgICAgICBjYXNlIFNJUl9MSU1fSU5TRVJUX1NJTkdMRVNIT1RfTk9BX1RJTUVPVVQ6ICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVByb2Nlc3NJbnNlcnRTaW5nbGVTaG90Tk9BVGltZW91dChwTWFjKTsgYnJlYWs7CisgICAgICAgIGNhc2UgU0lSX0xJTV9DT05WRVJUX0FDVElWRV9DSEFOTkVMX1RPX1BBU1NJVkU6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbUNvbnZlcnRBY3RpdmVDaGFubmVsVG9QYXNzaXZlQ2hhbm5lbChwTWFjKTsgYnJlYWs7CisgICAgICAgIGNhc2UgU0lSX0xJTV9BVVRIX1JFVFJZX1RJTUVPVVQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVByb2Nlc3NBdXRoUmV0cnlUaW1lcihwTWFjKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU0lSX0xJTV9ESVNBU1NPQ19BQ0tfVElNRU9VVDogIGxpbVByb2Nlc3NEaXNhc3NvY0Fja1RpbWVvdXQocE1hYyk7IGJyZWFrOworICAgICAgICBjYXNlIFNJUl9MSU1fREVBVVRIX0FDS19USU1FT1VUOiAgICBsaW1Qcm9jZXNzRGVhdXRoQWNrVGltZW91dChwTWFjKTsgYnJlYWs7CisgICAgICAgIGNhc2UgTElNX01MTV9BRERCQV9SRVE6ICAgICAgICAgICAgIGxpbVByb2Nlc3NNbG1BZGRCQVJlcSggcE1hYywgTXNnLT5ib2R5cHRyICk7IGJyZWFrOworICAgICAgICBjYXNlIExJTV9NTE1fQUREQkFfUlNQOiAgICAgICAgICAgICBsaW1Qcm9jZXNzTWxtQWRkQkFSc3AoIHBNYWMsIE1zZy0+Ym9keXB0ciApOyBicm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LAorICAgICAgICBQSFlfU0lOR0xFX0NIQU5ORUxfQ0VOVEVSRUQsCisgICAgICAgIHBzZXNzaW9uRW50cnktPm1heFR4UG93ZXIsIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkKTsKKworICAgIHJldHVybjsKK30KKworCisvKioKKyAqIGxpbUNvbnRpbnVlUG9zdENoYW5uZWxTY2FuKCkKKyAqCisgKkZVTkNUSU9OOgorICogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgdG8gc2NhbiB0aGUgY3VycmVudCBjaGFubmVsLgorICoKKyAqTE9HSUM6CisgKgorICpBU1NVTVBUSU9OUzoKKyAqIE5BCisgKgorICpOT1RFOgorICogTkEKKyAqCisgKiBAcGFyYW0gIHBNYWMgICAgLSBQb2ludGVyIHRvIEdsb2JhbCBNQUMgc3RydWN0dXJlCisgKgorICogQHJldHVybiBOb25lCisgKi8KKwordm9pZCBsaW1Db250aW51ZVBvc3RDaGFubmVsU2Nhbih0cEFuaVNpckdsb2JhbCBwTWFjKQoreworICAgIHRBTklfVTggY2hhbm5lbE51bTsKKyAgICB0QU5JX1U4IGkgPSAwOworICAgIHRTaXJSZXRTdGF0dXMgc3RhdHVzID0gZVNJUl9TVUNDRVNTOworCisgICAgaWYoIHBNYWMtPmxpbS5hYm9ydFNjYW4gfHwgKE5VTEwgPT0gcE1hYy0+bGltLmdwTGltTWxtU2NhblJlcSApIHx8CisgICAgICAgIChwTWFjLT5saW0uZ0xpbUN1cnJlbnRTY2FuQ2hhbm5lbElkID4KKyAgICAgICAgICAgICh0QU5JX1UzMikocE1hYy0+bGltLmdwTGltTWxtU2NhblJlcS0+Y2hhbm5lbExpc3QubnVtQ2hhbm5lbHMgLSAxKSkpCisgICAgeworICAgICAgICBwTWFjLT5saW0uYWJvcnRTY2FuID0gMDsKKyAgICAgICAgbGltRGVhY3RpdmF0ZUFuZENoYW5nZVRpbWVyKHBNYWMsIGVMSU1fTUlOX0NIQU5ORUxfVElNRVIpOworICAgICAgIC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BhbGwKKyAgICAgICAgICogdGhlIFNTSURzIHByZXNlbnQgaW4gdGhlIHNhdmVkIE1MTQorICAgICAgICAgKi8KKyAgICAgICAgZG8KKyAgICAgICAgeworICAgICAgICAgICAgdFNpck1hY0FkZHIgICAgICAgICBnU2VsZk1hY0FkZHI7CisKKyAgICAgICAgICAgIC8qIFNlbmQgc2VsZiBNQUMgYXMgc3JjIGFkZHJlc3MgaWYKKyAgICAgICAgICAgICAqIE1BQyBzcG9vZiBpcyBub3QgZW5hYmxlZCBPUgorICAgICAgICAgICAgICogc3Bvb2ZNYWNBZGRyIGlzIGFsbCAwIE9SCisgICAgICAgICAgICAgKiBkaXNhYmxlUDJQTWFjU3Bvb2YgaXMgZW5hYmxlZCBhbmQgc2NhbiBpcyBQMlAgc2NhbgorICAgICAgICAgICAgICogZWxzZSB1c2UgdGhlIHNwb29mTWFjIGFzIHNyYyBhZGRyZXNzCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmICgocE1hYy0+bGltLmlzU3Bvb2ZpbmdFbmFibGVkICE9IFRSVUUpIHx8CisgICAgICAgICAgICAgICAgKFRSVUUgPT0KKyAgICAgICAgICAgICAgICB2b3NfaXNfbWFjYWRkcl96ZXJvKCh2X01BQ0FERFJfdCAqKSZwTWFjLT5saW0uc3Bvb2ZNYWNBZGRyKSkgfHwKKyAgICAgICAgICAgICAgICAocE1hYy0+cm9hbS5jb25maWdQYXJhbS5kaXNhYmxlUDJQTWFjU3Bvb2ZpbmcgJiYKKyAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ3BMaW1NbG1TY2FuUmVxLT5wMnBTZWFyY2gpKSB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KGdTZWxmTWFjQWRkciwgcE1hYy0+bGltLmdTZWxmTWFjQWRkciwgVk9TX01BQ19BRERSRVNTX0xFTik7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShnU2VsZk1hY0FkZHIsIHBNYWMtPmxpbS5zcG9vZk1hY0FkZHIsIFZPU19NQUNfQUREUkVTU19MRU4pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgIEZMKCIgTWFjIEFkZHIgIk1BQ19BRERSRVNTX1NUUiAiIHVzZWQgaW4gc2VuZGluZyBQcm9iZVJlcSBudW1iZXIgJWQsIGZvciBTU0lEICVzIG9uIGNoYW5uZWw6ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkoZ1NlbGZNYWNBZGRyKSAsaSwgcE1hYy0+bGltLmdwTGltTWxtU2NhblJlcS0+c3NJZFtpXS5zc0lkLCBjaGFubmVsTnVtKTsKKyAgICAgICAgICAgIC8vIGluY2x1ZGUgYWRkaXRpb25hbCBJRSBpZiB0aGVyZSBpcworICAgICAgICAgICAgc3RhdHVzID0gbGltU2VuZFByb2JlUmVxTWdtdEZyYW1lKCBwTWFjLCAmcE1hYy0+bGltLmdwTGltTWxtU2NhblJlcS0+c3NJZFtpXSwKKyAgICAgICAgICAgICAgIHBNYWMtPmxpbS5ncExpbU1sbVNjYW5SZXEtPmJzc0lkLCBjaGFubmVsTnVtLCBnU2VsZk1hY0FkZHIsCisgICAgICAgICAgICAgICBwTWFjLT5saW0uZ3BMaW1NbG1TY2FuUmVxLT5kb3QxMW1vZGUsCisgICAgICAgICAgICAgICBwTWFjLT5saW0uZ3BMaW1NbG1TY2FuUmVxLT51SUVGaWVsZExlbiwKKyAgICAgICAgICAgICAgICh0QU5JX1U4ICopKHBNYWMtPmxpbS5ncExpbU1sbVNjYW5SZXEpK3BNYWMtPmxpbS5ncExpbU1sbVNjYW5SZXEtPnVJRUZpZWxkT2Zmc2V0KTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKCBzdGF0dXMgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoInNlbmQgUHJvYmVSZXEgZmFpbGVkIGZvciBTU0lEICVzIG9uIGNoYW5uZWw6ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ3BMaW1NbG1TY2FuUmVxLT5zc0lkW2ldLnNzSWQsIGNoYW5uZWxOdW0pOykKKyAgICAgICAgICAgICAgICBsaW1EZWFjdGl2YXRlQW5kQ2hhbmdlVGltZXIocE1hYywgZUxJTV9NSU5fQ0hBTk5FTF9USU1FUik7CisgICAgICAgICAgICAgICAgbGltU2VuZEhhbEVuZFNjYW5SZXEocE1hYywgY2hhbm5lbE51bSwgZUxJTV9IQUxfRU5EX1NDQU5fV0FJVF9TVEFURSk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaSsrOworICAgICAgICB9IHdoaWxlIChpIDwgcE1hYy0+bGltLmdwTGltTWxtU2NhblJlcS0+bnVtU3NpZCk7CisKKyAgICAgICAgeworI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX1ZPV0lGSQorICAgICAgICAgICAvL0lmIG1pbkNoYW5uZWxUaW1lIGlzIHNldCB0byB6ZXJvLCBTTUUgaXMgcmVxdWVzdGluZyBzY2FuIHRvIG5vdCB1c2UgbWluIGNoYW5uZWwgdGltZXIuCisgICAgICAgICAgIC8vVGhpcyBpcyB1c2VkIGluIDExayB0byByZXF1ZXN0IGZvciBiZWFjb24gbWVhc3VyZW1lbnQgcmVxdWVzdCB3aXRoIGEgZml4ZWQgZHVyYXRpb24gaW4KKyAgICAgICAgICAgLy9tYXggY2hhbm5lbCB0aW1lLgorICAgICAgICAgICBpZiggcE1hYy0+bGltLmdwTGltTWxtU2NhblJlcS0+bWluQ2hhbm5lbFRpbWUgIT0gMCApCisgICAgICAgICAgIHsKKyNlbmRpZgorICAgICAgICAgICAgLy8vIFRYUCBoYXMgc2VudCBQcm9iZSBSZXF1ZXN0CisgICAgICAgICAgICAvLy8gQWN0aXZhdGUgbWluQ2hhbm5lbFRpbWVyCisgICAgICAgICAgICBsaW1EZWFjdGl2YXRlQW5kQ2hhbmdlVGltZXIocE1hYywgZUxJTV9NSU5fQ0hBTk5FTF9USU1FUik7CisKKyNpZmRlZiBHRU42X1RPRE8KKyAgICAgICAgICAgIC8qIHJldmlzaXQgdGhpcyBwaWVjZSBvZiBjb2RlIHRvIGFzc2lnbiB0aGUgYXBwcm9wcmlhdGUgc2Vzc2lvbklkCisgICAgICAgICAgICAgKiBiZWxvdyBwcmlvcml0eSAtIExPVy9taWdodCBub3QgYmUgbmVlZGVkCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbU1pbkNoYW5uZWxUaW1lci5zZXNzaW9uSWQgPSBzZXNzaW9uSWQ7CisjZW5kaWYKKyAgICAgICAgICAgIGlmICh0eF90aW1lcl9hY3RpdmF0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltTWluQ2hhbm5lbFRpbWVyKSAhPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVFhfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoImNvdWxkIG5vdCBzdGFydCBtaW4gY2hhbm5lbCB0aW1lciIpKTsKKyAgICAgICAgICAgICAgICBsaW1EZWFjdGl2YXRlQW5kQ2hhbmdlVGltZXIocE1hYywgZUxJTV9NSU5fQ0hBTk5FTF9USU1FUik7CisgICAgICAgICAgICAgICAgbGltU2VuZEhhbEVuZFNjYW5SZXEocE1hYywgY2hhbm5lbE51bSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUxJTV9IQUxfRU5EX1NDQU5fV0FJVF9TVEFURSk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBJbml0aWFsaXplIG1heCB0aW1lciB0b28KKyAgICAgICAgICAgIGxpbURlYWN0aXZhdGVBbmRDaGFuZ2VUaW1lcihwTWFjLCBlTElNX01BWF9DSEFOTkVMX1RJTUVSKTsKKyNpZiBkZWZpbmVkIFdMQU5fRkVBVFVSRV9WT1dJRkkKKyAgICAgICAgfQorICAgICAgICAgICBlbHNlCisgICAgICAgICAgIHsKKyNpZiBkZWZpbmVkIFdMQU5fVk9XSUZJX0RFQlVHCisgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2coIHBNYWMsIExPR0UsICJNaW4gY2hhbm5lbCB0aW1lID09IDAsIFVzZSBvbmx5IG1heCBjaGFuIHRpbWVyIiApOykKKyNlbmRpZgorICAgICAgICAgICAgICAvL05vIE5lZWQgdG8gc3RhcnQgTWluIGNoYW5uZWwgdGltZXIuIFN0YXJ0IE1heCBDaGFubmVsIHRpbWVyLgorICAgICAgICAgICAgICBsaW1EZWFjdGl2YXRlQW5kQ2hhbmdlVGltZXIocE1hYywgZUxJTV9NQVhfQ0hBTk5FTF9USU1FUik7CisgICAgICAgICAgICAgIGlmICh0eF90aW1lcl9hY3RpdmF0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltTWF4Q2hhbm5lbFRpbWVyKQorICAgICAgICAgICAgICAgICAgICA9PSBUWF9USU1FUl9FUlJPUikKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAvLy8gQ291bGQgbm90IGFjdGl2YXRlIG1heCBjaGFubmVsIHRpbWVyLgorICAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsTE9HRSwgRkwoImNvdWxkIG5vdCBzdGFydCBtYXggY2hhbm5lbCB0aW1lciIpKTsKKyAgICAgICAgICAgICAgICAgbGltRGVhY3RpdmF0ZUFuZENoYW5nZVRpbWVyKHBNYWMsIGVMSU1fTUFYX0NIQU5ORUxfVElNRVIpOworICAgICAgICAgICAgICAgICBsaW1TZW5kSGFsRW5kU2NhblJlcShwTWFjLAorICAgICAgICAgICAgICAgICAgICBjaGFubmVsTnVtLCBlTElNX0hBTF9FTkRfU0NBTl9XQUlUX1NUQVRFKTsKKyAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICB9CisKKyAgICB9CisjZW5kaWYKKyAgICAgICAgfQorICAgICAgICAvKiBTdGFydCBwZXJpZGljIHRpbWVyIHdoaWNoIHdpbGwgdHJpZ2dlciBwcm9iZSByZXEgYmFzZWQgb24gbWluL21heAorICAgICAgICAgICBjaGFubmVsIHRpbWVyICovCisgICAgICAgIHBlcmlvZGljU2NhblRpbWVyID0gJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbVBlcmlvZGljUHJvYmVSZXFUaW1lcjsKKyAgICAgICAgbGltRGVhY3RpdmF0ZUFuZENoYW5nZVRpbWVyKHBNYWMsIGVMSU1fUEVSSU9ESUNfUFJPQkVfUkVRX1RJTUVSKTsKKyAgICAgICAgaWYgKHR4X3RpbWVyX2FjdGl2YXRlKHBlcmlvZGljU2NhblRpbWVyKSAhPSBUWF9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJjb3VsZCBub3Qgc3RhcnQgcGVyaW9kaWMgcHJvYmUgcmVxICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0aW1lciIpKTsKKyAgICAgICAgfQorICAgICAgICBwZXJpb2RpY1NjYW5UaW1lci0+c2Vzc2lvbklkID0gY2hhbm5lbE51bTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgdEFOSV9VMzIgdmFsOworICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlNUQVJUIFBBU1NJVkUgU2NhbiBjaGFuICVkIiksIGNoYW5uZWxOdW0pOworCisgICAgICAgIC8vLyBQYXNzaXZlIFNjYW5uaW5nLiBBY3RpdmF0ZSBtYXhDaGFubmVsVGltZXIKKyAgICAgICAgaWYgKHR4X3RpbWVyX2RlYWN0aXZhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbU1heENoYW5uZWxUaW1lcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgLy8gQ291bGQgbm90IGRlYWN0aXZhdGUgbWF4IGNoYW5uZWwgdGltZXIuCisgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiVW5hYmxlIHRvIGRlYWN0aXZhdGUgbWF4IGNoYW5uZWwgdGltZXIiKSk7CisgICAgICAgICAgICBsaW1TZW5kSGFsRW5kU2NhblJlcShwTWFjLCBjaGFubmVsTnVtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUxJTV9IQUxfRU5EX1NDQU5fV0FJVF9TVEFURSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBpZiAocE1hYy0+bWlyYWNhc3RfbW9kZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2YWwgPSBERUZBVUxUX01JTl9DSEFOX1RJTUVfRFVSSU5HX01JUkFDQVNUICsKKyAgICAgICAgICAgICAgICAgICAgREVGQVVMVF9NQVhfQ0hBTl9USU1FX0RVUklOR19NSVJBQ0FTVDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfUEFTU0lWRV9NQVhJTVVNX0NIQU5ORUxfVElNRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJnZhbCkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAqIENvdWxkIG5vdCBnZXQgbWF4IGNoYW5uZWwgdmFsdWUKKyAgICAgICAgICAgICAgICAgKiBmcm9tIENGRy4gTG9nIGVycm9yLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICBGTCgiY291bGQgbm90IHJldHJpZXZlIHBhc3NpdmUgbWF4IGNoYW4gdmFsdWUsIFVzZSBEZWYgdmFsIikpOworICAgICAgICAgICAgICAgIHZhbD0gV05JX0NGR19QQVNTSVZFX01BWElNVU1fQ0hBTk5FTF9USU1FX1NUQURFRjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdmFsID0gU1lTX01TX1RPX1RJQ0tTKHZhbCk7CisgICAgICAgICAgICBpZiAodHhfdGltZXJfY2hhbmdlKCZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1NYXhDaGFubmVsVGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICB2YWwsIDApICE9IFRYX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gQ291bGQgbm90IGNoYW5nZSBtYXggY2hhbm5lbCB0aW1lci4KKyAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlVuYWJsZSB0byBjaGFuZ2UgbWF4IGNoYW5uZWwgdGltZXIiKSk7CisgICAgICAgICAgICAgICAgbGltRGVhY3RpdmF0ZUFuZENoYW5nZVRpbWVyKHBNYWMsIGVMSU1fTUFYX0NIQU5ORUxfVElNRVIpOworICAgICAgICAgICAgICAgIGxpbVNlbmRIYWxFbmRTY2FuUmVxKHBNYWMsIGNoYW5uZWxOdW0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUxJTV9IQUxfRU5EX1NDQU5fV0FJVF9TVEFURSk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAodHhfdGltZXJfYWN0aXZhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbU1heENoYW5uZWxUaW1lcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICE9IFRYX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoImNvdWxkIG5vdCBzdGFydCBtYXggY2hhbm5lbCB0aW1lciIpKTsKKyAgICAgICAgICAgICAgICBsaW1EZWFjdGl2YXRlQW5kQ2hhbmdlVGltZXIocE1hYywgZUxJTV9NQVhfQ0hBTk5FTF9USU1FUik7CisgICAgICAgICAgICAgICAgbGltU2VuZEhhbEVuZFNjYW5SZXEocE1hYywgY2hhbm5lbE51bSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVMSU1fSEFMX0VORF9TQ0FOX1dBSVRfU1RBVEUpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAvLyBXYWl0IGZvciBCZWFjb25zIHRvIGFycml2ZQorICAgIH0gLy8gaWYgKHBNYWMtPmxpbS5nTGltTWxtU2NhblJlcS0+c2NhblR5cGUgPT0gZVNJUl9BQ1RJVkVfU0NBTikKKworICAgIGxpbUFkZFNjYW5DaGFubmVsSW5mbyhwTWFjLCBjaGFubmVsTnVtKTsKKyAgICByZXR1cm47Cit9CisKKworCisKKworLyogbGltQ292ZXJ0Q2hhbm5lbFNjYW5UeXBlKCkKKyAqCisgKkZVTkNUSU9OOgorICogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgdG8gZ2V0IHRoZSBsaXN0LCBjaGFuZ2UgdGhlIGNoYW5uZWwgdHlwZSBhbmQgc2V0IGFnYWluLgorICoKKyAqTE9HS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ICAgICAgICByZXR1cm4gOworICAgIH0KKyAgICBpZiAobGVuID4gV05JX0NGR19TQ0FOX0NPTlRST0xfTElTVF9MRU4pCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkludmFsaWQgc2NhbiBjb250cm9sIGxpc3QgbGVuZ3RoOiVkIiksIGxlbik7CisgICAgICAgIHJldHVybiA7CisgICAgfQorICAgIGlmIChwTWFjLT5mQWN0aXZlU2Nhbk9uREZTQ2hhbm5lbHMpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIkRGUyBmZWF0dXJlIHRyaWdnZXJlZCwiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiYmxvY2sgc2NhbiB0eXBlIGNvbnZlcnNpb24iKSk7CisgICAgICAgIHJldHVybiA7CisgICAgfQorICAgIGZvciAoaT0wOyAoaSsxKSA8IGxlbjsgaSs9MikKKyAgICB7CisgICAgICAgIGlmIChjaGFubmVsUGFpcltpXSA9PSBjaGFubmVsTnVtKQorICAgICAgICB7CisgICAgICAgICAgICAgaWYgKChlU0lSX1BBU1NJVkVfU0NBTiA9PSBjaGFubmVsUGFpcltpKzFdKSAmJiBUUlVFID09IHBhc3NpdmVUb0FjdGl2ZSkKKyAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiQ2hhbm5lbCAlZCBjaGFuZ2VkIGZyb20gUGFzc2l2ZSB0byBBY3RpdmUiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxOdW0pOworICAgICAgICAgICAgICAgICBjaGFubmVsUGFpcltpKzFdID0gZVNJUl9BQ1RJVkVfU0NBTjsKKyAgICAgICAgICAgICAgICAgYnJlYWsgOworICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICBpZiAoKGVTSVJfQUNUSVZFX1NDQU4gPT0gY2hhbm5lbFBhaXJbaSsxXSkgJiYgRkFMU0UgPT0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tPmxpbS5ncFNlc3Npb25baV0ubGltU3lzdGVtUm9sZSAhPSBlTElNX0JUX0FNUF9TVEFfUk9MRSkgJiYKKyAgICAgICAgICAgICAgICAgICAocEluaXRTY2FuUGFyYW0tPnNjYW5FbnRyeS5hY3RpdmVCU1NjbnQgPCBIQUxfTlVNX0JTU0lEKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBJbml0U2NhblBhcmFtLT5zY2FuRW50cnkuYnNzSWR4W3BJbml0U2NhblBhcmFtLT5zY2FuRW50cnkuYWN0aXZlQlNTY250XSAKKyAgICAgICAgICAgICAgICAgICAgICAgID0gcE1hYy0+bGltLmdwU2Vzc2lvbltpXS5ic3NJZHg7CisgICAgICAgICAgICAgICAgICAgIHBJbml0U2NhblBhcmFtLT5zY2FuRW50cnkuYWN0aXZlQlNTY250Kys7CisKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKCAoZUxJTV9BUF9ST0xFID09IHBNYWMtPmxpbS5ncFNlc3Npb25baV0ubGltU3lzdGVtUm9sZSApIAorICAgICAgICAgICAgICAgICAgICAmJiAoIFZPU19QMlBfR09fTU9ERSA9PSBwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLnBlUGVyc29uYSApCisgICAgICAgICAgICAgICAgICAgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBJbml0U2NhblBhcmFtLT51c2VOb0EgPSBUUlVFOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIGlmIChwSW5pdFNjYW5QYXJhbS0+c2NhbkVudHJ5LmFjdGl2ZUJTU2NudCkKKyAgICB7CisgICAgICAgIHBJbml0U2NhblBhcmFtLT5ub3RpZnlCc3MgPSBUUlVFOworICAgICAgICBwSW5pdFNjYW5QYXJhbS0+ZnJhbWVUeXBlID0gU0lSX01BQ19EQVRBX0ZSQU1FOworICAgICAgICBwSW5pdFNjYW5QYXJhbS0+ZnJhbW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BpbiBMSU5LLUVTVEIgc3RhdGUgb3IgQlNTX1NUQVJURUQgU3RhdGUKKyAgICAgICAgICAgICAgICAvL2ZvciBCVCwgbmVlZCB0byBzZW5kIENUUzJTZWxmCisgICAgICAgICAgICAgICBpZiAoKHBNYWMtPmxpbS5ncFNlc3Npb25baV0ubGltU3lzdGVtUm9sZSAhPSBlTElNX0JUX0FNUF9TVEFfUk9MRSkgJiYKKyAgICAgICAgICAgICAgICAgICAocEZpbmlzaFNjYW5QYXJhbS0+c2NhbkVudHJ5LmFjdGl2ZUJTU2NudCA8IEhBTF9OVU1fQlNTSUQpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEZpbmlzaFNjYW5QYXJhbS0+c2NhbkVudHJ5LmJzc0lkeFtwRmluaXNoU2NhblBhcmFtLT5zY2FuRW50cnkuYWN0aXZlQlNTY250XSAKKyAgICAgICAgICAgICAgICAgICAgICAgID0gcE1hYy0+bGltLmdwU2Vzc2lvbltpXS5ic3NJZHg7CisgICAgICAgICAgICAgICAgICAgIHBGaW5pc2hTY2FuUGFyYW0tPnNjYW5FbnRyeS5hY3RpdmVCU1NjbnQrKzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgaWYgKHBGaW5pc2hTY2FuUGFyYW0tPnNjYW5FbnRyeS5hY3RpdmVCU1NjbnQpCisgICAgeworICAgICAgICBwRmluaXNoU2NhblBhcmFtLT5ub3RpZnlCc3MgPSBUUlVFOworICAgICAgICBwRmluaXNoU2NhblBhcmFtLT5mcmFtZVR5cGUgPSBTSVJfTUFDX0RBVEFfRlJBTUU7CisgICAgICAgIHBGaW5pc2hTY2FuUGFyYW0tPmZyYW1lTGVuZ3RoID0gMDsKKyAgICB9Cit9CisKK3ZvaWQKK2xpbVNlbmRIYWxJbml0U2NhblJlcSh0cEFuaVNpckdsb2JhbCBwTWFjLCB0TGltTGltSGFsU2NhblN0YXRlIG5leHRTdGF0ZSwgdFNpckxpbmtUcmFmZmljQ2hlY2sgdHJhZmZpY0NoZWNrKQoreworCisKKyAgICB0U2lyTXNnUSAgICAgICAgICAgICAgICBtc2c7CisgICAgdHBJbml0U2NhblBhcmFtcyAgICAgICAgcEluaXRTY2FuUGFyYW07CisgICAgdFNpclJldFN0YXR1cyAgICAgICAgICAgcmMgPSBlU0lSX1NVQ0NFU1M7CisKKyAgICBwSW5pdFNjYW5QYXJhbSA9IHZvc19tZW1fbWFsbG9jKHNpemVvZigqcEluaXRTY2FuUGFyYW0pKTsKKyAgICBpZiAoIE5VTEwgPT0gcEluaXRTY2FuUGFyYW0gKQorICAgIHsKKyAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiQWxsb2NhdGVNZW1vcnkoKSBmYWlsZWQiKSk7KQorICAgICAgICBnb3RvIGVycm9yOworICAgIH0KKyAgICAKKyAgICAvKkluaXRpYWxpemUgdGhlIHBJbml0U2NhblBhcmFtIHdpdGggMCovCisgICAgdm9zX21lbV9zZXQoKHRBTklfVTggKilwSW5pdFNjYW5QYXJhbSwgc2l6ZW9mKCpwSW5pdFNjYW5QYXJhbSksIDApOworCisgICAgbXNnLnR5cGUgPSBXREFfSU5JVF9TQ0FOX1JFUTsKKyAgICBtc2cuYm9keXB0ciA9IHBJbml0U2NhblBhcmFtOworICAgIG1zZy5ib2R5dmFsID0gMDsKKworICAgIHZvc19tZW1fc2V0KCh0QU5JX1U4ICopJnBJbml0U2NhblBhcmFtLT5tYWNNZ210SGRyLCBzaXplb2YodFNpck1hY01nbXRIZHIpLCAwKTsKKyAgICBpZiAobmV4dFN0YXRlID09IGVMSU1fSEFMX0lOSVRfTEVBUk5fV0FJVF9TVEFURSkKKyAgICB7CisgICAgICAgIHBJbml0U2NhblBhcmFtLT5ub3RpZnlCc3MgPSBUUlVFOworICAgICAgICBwSW5pdFNjYW5QYXJhbS0+bm90aWZ5SG9zdCA9IEZBTFNFOworICAgICAgICBpZiAoZVNJUl9DSEVDS19ST0FNSU5HX1NDQU4gPT0gdHJhZmZpY0NoZWNrKQorICAgICAgICB7CisgICAgICAgICAgIHBJbml0U2NhblBhcmFtLT5zY2FuTW9kZSA9IGVIQUxfU1lTX01PREVfUk9BTV9TQ0FOOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICBwSW5pdFNjYW5QYXJhbS0+c2Nhbk1vZGUgPSBlSEFMX1NZU19NT0RFX0xFQVJOOworICAgICAgICB9CisKKyAgICAgICAgcEluaXRTY2FuUGFyYW0tPmZyYW1lVHlwZSA9IFNJUl9NQUNfQ1RSTF9DVFM7CisgICAgICAgIF9fbGltQ3JlYXRlSW5pdFNjYW5SYXdGcmFtZShwTWFjLCBwSW5pdFNjYW5QYXJhbSk7CisgICAgICAgIHBJbml0U2NhblBhcmFtLT5jaGVja0xpbmtUcmFmZmljID0gdHJhZmZpY0NoZWNrOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBpZihuZXh0U3RhdGUgPT0gZUxJTV9IQUxfU1VTUEVORF9MSU5LX1dBSVRfU1RBVEUpCisgICAgICAgIHsKKyAgICAgICAgICAgaWYgKGVTSVJfQ0hFQ0tfUk9BTUlOR19TQ0FOID09IHRyYWZmaWNDaGVjaykKKyAgICAgICAgICAgeworICAgICAgICAgICAgICBwSW5pdFNjYW5QYXJhbS0+c2Nhbk1vZGUgPSBlSEFMX1NZU19NT0RFX1JPQU1fU1VTUEVORF9MSU5LOworICAgICAgICAgICB9CisgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgeworICAgICAgICAgICAgICBwSW5pdFNjYW5QYXJhbS0+c2Nhbk1vZGUgPSBlSEFMX1NZU19NT0RFX1NVU1BFTkRfTElOSzsKKyAgICAgICAgICAgfQorICAgICAgICAgICAKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChlU0lSX0NIRUNLX1JPQU1JTkdfU0NBTiA9PSB0cmFmZmljQ2hlY2spCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBwSW5pdFNjYW5QYXJhbS0+c2Nhbk1vZGUgPSBlSEFMX1NZU19NT0RFX1JPQU1fU0NBTjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHBJbml0U2NhblBhcmFtLT5zY2FuTW9kZSA9IGVIQUxfU1lTX01PREVfU0NBTjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBfX2xpbUNyZWF0ZUluaXRTY2FuUmF3RnJhbWUocE1hYywgcEluaXRTY2FuUGFyYW0pOworICAgICAgICBpZiAocEluaXRTY2FuUGFyYW0tPnVzZU5vQSkKKyAgICAgICAgeworICAgICAgICAgICAgcEluaXRTY2FuUGFyYW0tPnNjYW5EdXJhdGlvbiA9IHBNYWMtPmxpbS5nVG90YWxTY2FuRHVyYXRpb247CisgICAgICAgIH0KKyAgICAgICAgLyogSW5mb3JtIEhBTCB3aGV0aGVyIGl0IHNob3VsZCBjaGVjayBmb3IgdHJhZmZpYyBvbiB0aGUgbGluaworICAgICAgICAgKiBwcmlvciB0byBwZXJmb3JtaW5nIGEgYmFja2dyb3VuZCBzY2FuCisgICAgICAgICAqLworICAgICAgICBwSW5pdFNjYW5QYXJhbS0+Y2hlY2tMaW5rVHJhZmZpYyA9IHRyYWZmaWNDaGVjazsKKyAgICB9CisKKyAgICBwTWFjLT5saW0uZ0xpbUhhbFNjYW5TdGF0ZSA9IG5leHRTdGF0ZTsKKyAgICBTRVRfTElNX1BST0NFU1NfREVGRF9NRVNHUyhwTWFjLCBmYWxzZSk7CisgICAgTVRSQUNFKG1hY1RyYWNlTXNnVHgocE1hYywgTk9fU0VTU0lPTiwgbXNnLnR5cGUpKTsKKworICAgIHJjID0gd2RhUG9zdEN0cmxNc2cocE1hYywgJm1zZyk7CisgICAgaWYgKHJjID09IGVTSVJfU1VDQ0VTUykg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0YXJ0U2NhblBhcmFtID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKCpwU3RhcnRTY2FuUGFyYW0pKTsKKyAgICAgICAgaWYgKCBOVUxMID09IHBTdGFydFNjYW5QYXJhbSApCisgICAgICAgIHsKKyAgICAgICAgICAgIFBFTE9HVyhsaW1Mb2cocE1hYywgTE9HVywgRkwoIkFsbG9jYXRlTWVtb3J5KCkgZmFpbGVkIikpOykKKyAgICAgICAgICAgICAgICBnb3RvIGVycm9yOworICAgICAgICB9CisKKyAgICAgICAgbXNnLnR5cGUgPSBXREFfU1RBUlRfU0NBTl9SRVE7CisgICAgICAgIG1zZy5ib2R5cHRyID0gcFN0YXJ0U2NhblBhcmFtOworICAgICAgICBtc2cuYm9keXZhbCA9IDA7CisgICAgICAgIHBTdGFydFNjYW5QYXJhbS0+c3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgcFN0YXJ0U2NhblBhcmFtLT5zY2FuQ2hhbm5lbCA9ICh0QU5JX1U4KWNoYW5uZWxOdW07CisKKyAgICAgICAgcE1hYy0+bGltLmdMaW1IYWxTY2FuU3RhdGUgPSBuZXh0U3RhdGU7CisgICAgICAgIFNFVF9MSU1fUFJPQ0VTU19ERUZEX01FU0dTKHBNYWMsIGZhbHNlKTsKKworICAgICAgICBNVFJBQ0UobWFjVHJhY2VNc2dUeChwTWFjLCBOT19TRVNTSU9OLCBtc2cudHlwZSkpOworCisgICAgICAgICAgICByYyA9IHdkYVBvc3RDdHJsTXNnKHBNYWMsICZtc2cpOworICAgICAgICBpZiAocmMgPT0gZVNJUl9TVUNDRVNTKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBTRVRfTElNX1BST0NFU1NfREVGRF9NRVNHUyhwTWFjLCB0cnVlKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBTdGFydFNjYW5QYXJhbSk7CisgICAgICAgIFBFTE9HVyhsaW1Mb2cocE1hYywgTE9HVywgRkwoIndkYVBvc3RDdHJsTXNnIGZhaWxlZCwgZXJyb3IgY29kZSAlZCIpLCByYyk7KQorCitlcnJvcjoKKyAgICAgICAgc3dpdGNoKG5leHRTdGF0ZSkKKyAgICAgICAgeworICAgICAgICAgICAgY2FzZSBlTElNX0hBTF9TVEFSVF9TQ0FOX1dBSVRfU1RBVEU6CisgICAgICAgICAgICAgICAgbGltQ29tcGxldGVNbG1TY2FuKHBNYWMsIGVTSVJfU01FX0hBTF9TQ0FOX0lOSVRfRkFJTEVEKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworCisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIHBNYWMtPmxpbS5nTGltSGFsU2NhblN0YXRlID0gZUxJTV9IQUxfSURMRV9TQ0FOX1NUQVRFOworCisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIFBFTE9HVyhsaW1Mb2cocE1hYywgTE9HVywgRkwoIkludmFsaWQgc3RhdGUgZm9yIFNUQVJUX1NDQU5fUkVRIG1lc3NhZ2U9JWQiKSwgcE1hYy0+bGltLmdMaW1IYWxTY2FuU3RhdGUpOykKKyAgICB9CisKKyAgICByZXR1cm47Cit9CisKK3ZvaWQgbGltU2VuZEhhbEVuZFNjYW5SZXEodHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VOCBjaGFubmVsTnVtLCB0TGltTGltSGFsU2NhblN0YXRlIG5leHRTdGF0ZSkKK3sKKyAgICB0U2lyTXNnUSAgICAgICAgICAgIG1zZzsKKyAgICB0cEVuZFNjYW5QYXJhbXMgICAgIHBFbmRTY2FuUGFyYW07CisgICAgdFNpclJldFN0YXR1cyAgICAgICByYyA9IGVTSVJfU1VDQ0VTUzsKKworICAgIC8qKgorICAgICAqIFRoZSBFbmQgc2NhbiByZXF1ZXN0IHRvIGJlIHNlbnQgb25seSBpZiBFbmQgU2NhbiBpcyBub3QgYWxyZWFkeSByZXF1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NBTl9SRVE7CisgICAgICAgIG1zZy5ib2R5cHRyID0gcEVuZFNjYW5QYXJhbTsKKyAgICAgICAgbXNnLmJvZHl2YWwgPSAwOworICAgICAgICBwRW5kU2NhblBhcmFtLT5zdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICBwRW5kU2NhblBhcmFtLT5zY2FuQ2hhbm5lbCA9ICh0QU5JX1U4KWNoYW5uZWxOdW07CisKKyAgICAgICAgcE1hYy0+bGltLmdMaW1IYWxTY2FuU3RhdGUgPSBuZXh0U3RhdGU7CisgICAgICAgIFNFVF9MSU1fUFJPQ0VTU19ERUZEX01FU0dTKHBNYWMsIGZhbHNlKTsKKyAgICAgICAgTVRSQUNFKG1hY1RyYWNlTXNnVHgocE1hYywgTk9fU0VTU0lPTiwgbXNnLnR5cGUpKTsKKworICAgICAgICByYyA9IHdkYVBvc3RDdHJsTXNnKHBNYWMsICZtc2cpOworICAgICAgICBpZiAocmMgPT0gZVNJUl9TVUNDRVNTKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBTRVRfTElNX1BST0NFU1NfREVGRF9NRVNHUyhwTWFjLCB0cnVlKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBFbmRTY2FuUGFyYW0pOworICAgICAgICBQRUxPR1cobGltTG9nKHBNYWMsIExPR1csIEZMKCJ3ZGFQb3N0Q3RybE1zZyBmYWlsZWQsIGVycm9yIGNvZGUgJWQiKSwgcmMpOykKKworICAgICAgICAgICAgZXJyb3I6CisgICAgICAgICAgICBzd2l0Y2gobmV4dFN0YXRlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNhc2UgZUxJTV9IQUxfRU5EX1NDQU5fV0FJVF9TVEFURToKKyAgICAgICAgICAgICAgICAgICAgbGltQ29tcGxldGVNbG1TY2FuKHBNYWMsIGVTSVJfU01FX0hBTF9TQ0FOX0VORF9GQUlMRUQpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKK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worICAgICAgICAvLy8gRG9uZSBzY2FubmluZyBhbGwgcmVxdWlyZWQgY2hhbm5lbHMKKyAgICAgICAgbGltU2VuZEhhbEZpbmlzaFNjYW5SZXEocE1hYywgZUxJTV9IQUxfRklOSVNIX1NDQU5fV0FJVF9TVEFURSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICAvLy8gQXRsZWFzdCBvbmUgbW9yZSBjaGFubmVsIGlzIHRvIGJlIHNjYW5uZWQKKworICAgIGlmICgocE1hYy0+bGltLmdMaW1SZXR1cm5BZnRlckZpcnN0TWF0Y2ggJiAweDQwKSB8fAorICAgICAgICAocE1hYy0+bGltLmdMaW1SZXR1cm5BZnRlckZpcnN0TWF0Y2ggJiAweDgwKSkKKyAgICB7CisgICAgICAgIHdoaWxlIChwTWFjLT5saW0uZ0xpbUN1cnJlbnRTY2FuQ2hhbm5lbElkIDw9CisgICAgICAgICAgICAgICAodEFOSV9VMzIpIChwTWFjLT5saW0uZ3BMaW1NbG1TY2FuUmVxLT5jaGFubmVsTGlzdC5udW1DaGFubmVscyAtIDEpKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoKChsaW1HZXRDdXJyZW50U2NhbkNoYW5uZWwocE1hYykgPD0gMTQpICYmCisgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbTI0QmFuZDExZFNjYW5Eb25lKSB8fAorICAgICAgICAgICAgICAgICgobGltR2V0Q3VycmVudFNjYW5DaGFubmVsKHBNYWMpID4gMTQpICYmCisgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbTUwQmFuZDExZFNjYW5Eb25lKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgRkwoInNraXBwaW5nIGNoYW4gJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgbGltR2V0Q3VycmVudFNjYW5DaGFubmVsKHBNYWMpKTsKKyAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbUN1cnJlbnRTY2FuQ2hhbm5lbElkKys7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBpZiAocE1hYy0+bGltLmdMaW1DdXJyZW50U2NhbkNoYW5uZWxJZCA+CisgICAgICAgICAgICAodEFOSV9VMzIpIChwTWFjLT5saW0uZ3BMaW1NbG1TY2FuUmVxLT5jaGFubmVsTGlzdC5udW1DaGFubmVscyAtIDEpKQorICAgICAgICB7CisgICAgICAgICAgICBwTWFjLT5saW0uYWJvcnRTY2FuID0gMDsKKyAgICAgICAgICAgIGxpbURlYWN0aXZhdGVBbmRDaGFuZ2VUaW1lcihwTWFjLCBlTElNX01JTl9DSEFOTkVMX1RJTUVSKTsKKyAgICAgICAgICAgIGxpbURlYWN0aXZhdGVBbmRDaGFuZ2VUaW1lcihwTWFjLCBlTElNX01BWF9DSEFOTkVMX1RJTUVSKTsKKyAgICAgICAgICAgIC8vLyBEb25lIHNjYW5uaW5nIGFsbCByZXF1aXJlZCBjaGFubmVscworICAgICAgICAgICAgLy9TZXQgdGhlIHJlc3VtZSBjaGFubmVsIHRvIEFueSB2YWxpZCBjaGFubmVsIChpbnZhbGlkKS4gCisgICAgICAgICAgICAvL1RoaXMgd2lsbCBpbnN0cnVjdCBIQUwgdG8gc2V0IGl0IHRvIGFueSBwcmV2aW91cyB2YWxpZCBjaGFubmVsLgorICAgICAgICAgICAgcGVTZXRSZXN1bWVDaGFubmVsKHBNYWMsIDAsIDApOworICAgICAgICAgICAgbGltU2VuZEhhbEZpbmlzaFNjYW5SZXEocE1hYywgZUxJTV9IQUxfRklOSVNIX1NDQU5fV0FJVF9TVEFURSk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICB9CisKKyAgICBjaGFubmVsTnVtID0gbGltR2V0Q3VycmVudFNjYW5DaGFubmVsKHBNYWMpOworICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCg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GltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlBTIE9WRVJMQVAgVGltZXIiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVdQU092ZXJsYXBUaW1lckhhbmRsZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX0xJTV9XUFNfT1ZFUkxBUF9USU1FT1VULCAvLyBleHBpcmF0aW9uX2lucHV0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgU1lTX01TX1RPX1RJQ0tTKExJTV9XUFNfT1ZFUkxBUF9USU1FUl9NUyksICAvLyBpbml0aWFsX3RpY2tzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgU1lTX01TX1RPX1RJQ0tTKExJTV9XUFNfT1ZFUkxBUF9USU1FUl9NUyksICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJlc2NoZWR1bGVfdGlja3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBUWF9BVVRPX0FDVElWQVRFIC8qIFRYX05PX0FDVElWQVRFKi8pICE9IFRYX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJmYWlsZWQgdG8gY3JlYXRlIFdQUyBvdmVybGFwIFRpbWVyIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBwTWFjLT5saW0ubGltVGltZXJzLmdMaW1XUFNPdmVybGFwVGltZXJPYmouc2Vzc2lvbklkID0gcE1sbVN0YXJ0UmVxLT5zZXNzaW9uSWQ7CisgICAgICAgICAgICBwTWFjLT5saW0ubGltVGltZXJzLmdMaW1XUFNPdmVybGFwVGltZXJPYmouaXNUaW1lckNyZWF0ZWQgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiQ3JlYXRlIFdQUyBvdmVybGFwIFRpbWVyLCBzZXNzaW9uPSVkIiksIHBNbG1TdGFyd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gICAgICAgICAgICAgICAgKHBNYWMtPmxpbS5ncFNlc3Npb25baV0ubGltTWxtU3RhdGUgPT0gZUxJTV9NTE1fTElOS19FU1RBQkxJU0hFRF9TVEFURSkgKXx8CisgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICggICAgKCAocE1hYy0+bGltLmdwU2Vzc2lvbltpXS5ic3NUeXBlID09IGVTSVJfSUJTU19NT0RFKXx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAocE1hYy0+bGltLmdwU2Vzc2lvbltpXS5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQlRfQU1QX0FQX1JPTEUpfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIChwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9CVF9BTVBfU1RBX1JPTEUpICkmJgorICAgICAgICAgICAgICAgICAgICAgICAocE1hYy0+bGltLmdwU2Vzc2lvbltpXS5saW1NbG1TdGF0ZSA9PSBlTElNX01MTV9CU1NfU1RBUlRFRF9TVEFURSkgKQorICAgICAgICAgICAgICAgfHwgICggKCAoIChwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmJzc1R5cGUgPT0gZVNJUl9JTkZSQV9BUF9NT0RFKSAKKyAgICAgICAgICAgICAgICAgICAgICAmJiAoIHBNYWMtPmxpbS5ncFNlc3Npb25baV0ucGVQZXJzb25hID09IFZPU19QMlBfR09fTU9ERSkgKQorICAgICAgICAgICAgICAgICAgICB8fCAocE1hYy0+bGltLmdwU2Vzc2lvbltpXS5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQVBfUk9MRSkgKQorICAgICAgICAgICAgICAgICAgJiYgKHBNYWMtPmxpbS5ncFNlc3Npb25baV0ubGltTWxtU3RhdGUgPT0gZUxJTV9NTE1fQlNTX1NUQVJURURfU1RBVEUpICkKKyAgICAgICAgICAgICAgICApKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHJldHVybiBGQU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1NJVkVfU0NBTl9TVEFURTsKKyAgICAgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfTUxNX1NUQVRFLCBOT19TRVNTSU9OLCBwTWFjLT5saW0uZ0xpbU1sbVN0YXRlKSk7CisKKyAgICAgICAgcE1hYy0+bGltLmdMaW1TeXN0ZW1JblNjYW5MZWFybk1vZGUgPSAxOworCisgICAgICAgIC8qIHRlbXBvcmFyeSBmaXggdG8gaGFuZGxlIGNhc2Ugd2hlcmUgTk9BIGR1cmF0aW9uIGNhbGN1bGF0aW9uIGlzIGluY29ycmVjdAorICAgICAgICAgKiBmb3Igc2Nhbm5pbmcgb24gREZTIGNoYW5uZWxzICovCisKKyAgICAgICAgcE1hYy0+bGltLmdUb3RhbFNjYW5EdXJhdGlvbiA9IDA7CisKKyAgICAgICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfUEFTU0lWRV9NQVhJTVVNX0NIQU5ORUxfVElNRSwgJnZhbCkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogQ291bGQgbm90IGdldCBtYXggY2hhbm5lbCB2YWx1ZQorICAgICAgICAgICAgICogZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBwYXNzaXZlIG1heCBjaGFubmVsIHZhbHVlIHVzZSBkZWYiKSk7CisgICAgICAgICAgICAvKiB1c2UgYSBkZWZhdWx0IHZhbHVlICovCisgICAgICAgICAgICB2YWw9IFdOSV9DRkdfUEFTU0lWRV9NQVhJTVVNX0NIQU5ORUxfVElNRV9TVEFERUY7CisgICAgICAgIH0KKworICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcE1hYy0+bGltLmdwTGltTWxtU2NhblJlcS0+Y2hhbm5lbExpc3QubnVtQ2hhbm5lbHM7IGkrKykgeworICAgICAgICAgICAgdEFOSV9VOCBjaGFubmVsTnVtID0gcE1hYy0+bGltLmdwTGltTWxtU2NhblJlcS0+Y2hhbm5lbExpc3QuY2hhbm5lbE51bWJlcltpXTsKKworICAgICAgICAgICAgaWYgKHBNYWMtPm1pcmFjYXN0X21vZGUpIHsKKyAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ1RvdGFsU2NhbkR1cmF0aW9uICs9IChERUZBVUxUX01JTl9DSEFOX1RJTUVfRFVSSU5HX01JUkFDQVNUICsKKyAgICAgICAgICAgICAgICAgICAgICAgIERFRkFVTFRfTUFYX0NIQU5fVElNRV9EVVJJTkdfTUlSQUNBU1QpOworICAgICAgICAgICAgfSBlbHNlIGlmIChsaW1BY3RpdmVTY2FuQWxsb3dlZChwTWFjLCBjaGFubmVsTnVtKSkgeworICAgICAgICAgICAgICAgIC8qIFVzZSBtaW4gKyBtYXggY2hhbm5lbCB0aW1lIHRvIGNhbGN1bGF0ZSB0aGUgdG90YWwgZHVyYXRpb24gb2Ygc2NhbiAqLworICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nVG90YWxTY2FuRHVyYXRpb24gKz0gcE1hYy0+bGltLmdwTGltTWxtU2NhblJlcS0+bWluQ2hhbm5lbFRpbWUgKyBwTWFjLT5saW0uZ3BMaW1NbG1TY2FuUmVxLT5tYXhDaGFubmVsVGltZTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLyogdXNpbmcgdGhlIHZhbHVlIGZyb20gV05JX0NGR19QQVNTSVZFX01JTklNVU1fQ0hBTk5FTF9USU1FIGFzIGlzIGRvbmUgaW4KKyAgICAgICAgICAgICAgICAgKiB2b2lkIGxpbUNvbnRpbnVlUG9zdENoYW5uZWxTY2FuKHRwQW5pU2lyR2xvYmFsIHBNYWMpCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdUb3RhbFNjYW5EdXJhdGlvbiArPSB2YWw7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvKiBBZGRpbmcgYW4gb3ZlcmhlYWQgb2YgNW1zIHRvIGFjY291bnQgZm9yIHRoZSBzY2FuIG1lc3NhZ2luZyBkZWxheXMgKi8KKyAgICAgICAgcE1hYy0+bGltLmdUb3RhbFNjYW5EdXJhdGlvbiArPSA1OworICAgICAgICBsaW1TZXRTY2FuTW9kZShwTWFjKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFNob3VsZCBub3QgaGF2ZSByZWNlaXZlZCBTQ0FOIHJlcSBpbiBvdGhlciBzdGF0ZXMKKyAgICAgICAgICogT1Igc2hvdWxkIG5vdCBoYXZlIHJlY2VpdmVkIExJTV9NTE1fU0NBTl9SRVEgd2l0aAorICAgICAgICAgKiB6ZXJvIG51bWJlciBvZiBjaGFubmVscworICAgICAgICAgKiBMb2cgZXJyb3IKKyAgICAgICAgICovCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIHVuZXhwZWN0ZWQgTUxNX1NDQU5fUkVRIGluIHN0YXRlICVkIE9SIHplcm8gbnVtYmVyIG9mIGNoYW5uZWxzOiAlZCIpLAorICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1NbG1TdGF0ZSwgKCh0TGltTWxtU2NhblJlcSAqKSBwTXNnQnVmKS0+Y2hhbm5lbExpc3QubnVtQ2hhbm5lbHMpOworICAgICAgICBsaW1QcmludE1sbVN0YXRlKHBNYWMsIExPR1csIHBNYWMtPmxpbS5nTGltTWxtU3RhdGUpOworCisgICAgICAgIC8vLyBGcmVlIHVwIGJ1ZmZlciBhbGxvY2F0ZWQgZm9yCisgICAgICAgIC8vLyBwTWFjLT5saW0uZ0xpbU1sbVNjYW5SZXEKKyAgICAgICAgdm9zX21lbV9mcmVlKHBNc2dCdWYpOworCisgICAgICAgIC8vL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AgIGlmKCBpc0xpbVNlc3Npb25PZmZDaGFubmVsKHBNYWMsIHNlc3Npb25JZCkgKQorICAgICAgICB7CisgICAgICAgICAgLy9zdXNwZW5kIGxpbmsKKyAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlN1c3BlbmQgbGluayBhcyBMaW1TZXNzaW9uIG9uIHNlc3Npb25pZCAlZCIKKyAgICAgICAgICAiaXMgb2ZmIGNoYW5uZWwiKSxzZXNzaW9uSWQpOworICAgICAgICAgIGlmIChsaW1Jc0xpbmtTdXNwZW5kZWQocE1hYykpCisgICAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJMaW5rIGlzIGFscmVhZHkgc3VzcGVuZGVkIGZvciBzb21lIG90aGVyIgorICAgICAgICAgICAgICAgICAgICIgcmVhc29uLiBSZXR1cm4gZmFpbHVyZSBvbiBzZXNzaW9uSWQ6JWQiKSwgc2Vzc2lvbklkKTsKKyAgICAgICAgICAgIGdvdG8gZXJyb3I7CisgICAgICAgICAgfQorICAgICAgICAgIGxpbVN1c3BlbmRMaW5rKHBNYWMsIGVTSVJfRE9OVF9DSEVDS19MSU5LX1RSQUZGSUNfQkVGT1JFX1NDQU4sIAorICAgICAgICAgICAgICAgICAgIGxpbVByb2Nlc3NNbG1Qb3N0Sm9pblN1c3BlbmRMaW5rLCAodEFOSV9VMzIqKXBzZXNzaW9uRW50cnkgKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAvL05vIG5lZWQgdG8gc3VzcGVuZCBsaW5rLgorICAgICAgICAgIGxpbUxvZyhwTWFjLExPRzEsIlNlc3Npb25JZDolZCBKb2luIHJlcXVlc3Qgb24gY3VycmVudCBjaGFubmVsIiwKKyAgICAgICAgICAgICAgICAgc2Vzc2lvbklkKTsKKyAgICAgICAgICBsaW1Qcm9jZXNzTWxtUG9zdEpvaW5TdXNwZW5kTGluayggcE1hYywgZUhBTF9TVEFUVVNfU1VDQ0VTUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VMzIqKSBwc2Vzc2lvbkVudHJ5ICk7CisgICAgICAgIH0KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAvKioKKyAgICAgICAgICogU2hvdWxkIG5vdCBoYXZlIHJlY2VpdmVkIEpPSU4gcmVxIGluIHN0YXRlcyBvdGhlciB0aGFuCisgICAgICAgICAqIElkbGUgc3RhdGUgb3Igb24gQVAuCisgICAgICAgICAqIFJldHVybiBqb2luIGNvbmZpcm0gd2l0aCBpbnZhbGlkIHBhcmFtZXRlcnMgY29kZS4KKyAgICAgICAgICovCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgRkwoIlNlc3Npb25JZDolZCBVbmV4cGVjdGVkIEpvaW4gcmVxdWVzdCBmb3Igcm9sZSAlZCBzdGF0ZSAlZCAiKSwKKyAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUsCisgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSk7CisgICAgICAgIGxpbVByaW50TWxtU3RhdGUocE1hYywgTE9HRSwgcHNlc3Npb25FbnRyeS0+bGltTWxtU3RhdGUpOworICAgIH0KKworZXJyb3I6IAorICAgIHZvc19tZW1fZnJlZShwTXNnQnVmKTsKKyAgICBpZiAocHNlc3Npb25FbnRyeSAhPSBOVUxMKQorICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wTGltTWxtSm9pblJlcSA9IE5VTEw7CisKKyAgICBtbG1Kb2luQ25mLnJlc3VsdENvZGUgPSBlU0lSX1NNRV9SRVNPVVJDRVNfVU5BVkFJTEFCTEU7CisgICAgbWxtSm9pbkNuZi5zZXNza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RoVHlwZSk7CisKKworICAgIC8qKgorICAgICAqIEV4cGVjdCBBdXRoIHJlcXVlc3Qgb25seSB3aGVuOgorICAgICAqIDEuIFNUQSBqb2luZWQvYXNzb2NpYXRlZCB3aXRoIGEgQlNTIG9yCisgICAgICogMi4gU1RBIGlzIGluIElCU1MgbW9kZQorICAgICAqIGFuZCBTVEEgaXMgZ29pbmcgdG8gYXV0aGVudGljYXRlIHdpdGggYSB1bmljYXN0CisgICAgICogYWRyZXNzIGFuZCByZXF1ZXN0ZWQgYXV0aGVudGljYXRpb24gYWxnb3JpdGhtIGlzCisgICAgICogc3VwcG9ydGVkLgorICAgICAqLworICAgICAjaWYgMAorICAgIGlmICh3bGFuX2NmZ0dldFN0cihwTWFjLCBXTklfQ0ZHX0JTU0lELCBjdXJyZW50QnNzSWQsICZjZmcpICE9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIC8vLyBDb3VsZCBub3QgZ2V0IEJTU0lEIGZyb20gQ0ZHLiBMb2cgZXJyb3IuCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiY291bGQgbm90IHJldHJpZXZlIEJTU0lEIikpOworICAgIH0KKyAgICAjZW5kaWYgLy9UbyBTdXBwb1JUIEJULUFNUAorCisgICAgc2lyQ29weU1hY0FkZHIoY3VycmVudEJzc0lkLHBzZXNzaW9uRW50cnktPmJzc0lkKTsKKworICAgIGlmICgoKCgocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZT09IGVMSU1fU1RBX1JPTEUpIHx8IChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQlRfQU1QX1NUQV9ST0xFKSkgJiYKKyAgICAgICAgICAoKHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlID09IGVMSU1fTUxNX0pPSU5FRF9TVEFURSkgfHwKKyAgICAgICAgICAgKHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlID09CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUxJTV9NTE1fTElOS19FU1RBQkxJU0hFRF9TVEFURSkpKSB8fAorICAgICAgICAgKChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fU1RBX0lOX0lCU1NfUk9MRSkgJiYKKyAgICAgICAgICAocHNlc3Npb25FbnRyeS0+bGltTWxtU3RhdGUgPT0gZUxJTV9NTE1fQlNTX1NUQVJURURfU1RBVEUpKSkgJiYKKyAgICAgICAgKGxpbUlzR3JvdXBBZGRyKHBNYWMtPmxpbS5ncExpbU1sbUF1dGhSZXEtPnBlZXJNYWNBZGRyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gZmFsc2UpICYmCisgICAgICAgIChsaW1Jc0F1dGhBbGdvU3VwcG9ydGVkKAorICAgICAgICAgICAgICAgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5ncExpbU1sbUF1dGhSZXEtPmF1dGhUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSkgPT0gdHJ1ZSkKKyAgICAgICAgKSAgICAgICAgCisgICAgeworICAgICAgICAvKioKKyAgICAgICAgICogVGhpcyBpcyBhIHJlcXVlc3QgZm9yIHByZS1hdXRoZW50aWNhdGlvbi4KKyAgICAgICAgICogQ2hlY2sgaWYgdGhlcmUgZXhpc3RzIGNvbnRleHQgYWxyZWFkeSBmb3IKKyAgICAgICAgICogdGhlIHJlcXVlc3RlZCBwZWVyIE9SCisgICAgICAgICAqIGlmIHRoaXMgcmVxdWVzdCBpcyBmb3IgdGhlIEFQIHdlJ3JlIGN1cnJlbnRseQorICAgICAgICAgKiBhc3NvY2lhdGVkIHdpdGguCisgICAgICAgICAqIElmIHllcywgcmV0dXJuIGF1dGggY29uZmlybSBpbW1lZGlhdGVseSB3aGVuCisgICAgICAgICAqIHJlcXVlc3RlZCBhdXRoIHR5cGUgaXMgc2FtZSBhcyB0aGUgb25lIHVzZWQgYmVmb3JlLgorICAgICAgICAgKi8KKyAgICAgICAgaWYgKCgoKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9TVEFfUk9MRSkgfHwocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0JUX0FNUF9TVEFfUk9MRSkgKSYmCisgICAgICAgICAgICAgKHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlID09CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUxJTV9NTE1fTElOS19FU1RBQkxJU0hFRF9TVEFURSkgJiYKKyAgICAgICAgICAgICAoKChwU3RhRHMgPSBkcGhHZXRIYXNoRW50cnkocE1hYywgRFBIX1NUQV9IQVNIX0lOREVYX1BFRVIsICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKSkgIT0gTlVMTCkgJiYKKyAgICAgICAgICAgICAgKHBNYWMtPmxpbS5ncExpbU1sbUF1dGhSZXEtPmF1dGhUeXBlID09CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+bWxtU3RhQ29udGV4dC5hdXRoVHlwZSkpICYmCisgICAgICAgICAgICAgKHZvc19tZW1fY29tcGFyZShwTWFjLT5saW0uZ3BMaW1NbG1BdXRoUmVxLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRCc3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpICkpIHx8CisgICAgICAgICAgICAoKChwcmVBdXRoTm9kZSA9CisgICAgICAgICAgICAgICBsaW1TZWFyY2hQcmVBdXRoTGlzdCgKKyAgICAgICAgICAgICAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ3BMaW1NbG1BdXRoUmVxLT5wZWVyTWFjQWRkcikpICE9IE5VTEwpICYmCisgICAgICAgICAgICAgKHByZUF1dGhOb2RlLT5hdXRoVHlwZSA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ3BMaW1NbG1BdXRoUmVxLT5hdXRoVHlwZSkpKQorICAgICAgICB7CisgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cyLAorICAgICAgICAgICAgICAgICAgIEZMKCJBbHJlYWR5IGhhdmUgcHJlLWF1dGggY29udGV4dCB3aXRoIHBlZXI6ICJNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBNYWMtPmxpbS5ncExpbU1sbUF1dGhSZXEtPnBlZXJNYWNBZGRyKSk7CisKKyAgICAgICAgICAgIG1sbUF1dGhDbmYucmVzdWx0Q29kZSA9ICh0U2lyUmVzdWx0Q29kZXMpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX01BQ19TVUNDRVNTX1NUQVRVUzsKKyAgICAgICAgICAgIAorCisgICAgICAgICAgICBnb3RvIGVuZDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX01BWF9OVU1fUFJFX0FVVEgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1UzMiAqKSAmbnVtUHJlQXV0aENvbnRleHRzKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgRkwoIkNvdWxkIG5vdCByZXRyaWV2ZSBOdW1QcmVBdXRoTGltaXQgZnJvbSBDRkciKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChwTWFjLT5saW0uZ0xpbU51bVByZUF1dGhDb250ZXh0cyA9PSBudW1QcmVBdXRoQ29udGV4dHMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICAgICAgICAgICAgICBGTCgiTnVtYmVyIG9mIHByZS1hdXRoIHJlYWNoZWQgbWF4IGxpbWl0IikpOykKKworICAgICAgICAgICAgICAgIC8vLyBSZXR1cm4gQXV0aCBjb25maXJtIHdpdGggcmVqZWN0IGNvZGUKKyAgICAgICAgICAgICAgICBtbG1BdXRoQ25mLnJlc3VsdENvZGUgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfU01FX01BWF9OVU1fT0ZfUFJFX0FVVEhfUkVBQ0hFRDsKKworICAgICAgICAgICAgICAgIGdvdG8gZW5kOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gRGVsZXRlIHByZS1hdXRoIG5vZGUgaWYgZXhpc3RzCisgICAgICAgIGlmIChwcmVBdXRoTm9kZSkKKyAgICAgICAgICAgIGxpbURlbGV0ZVByZUF1dGhOb2RlKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ3BMaW1NbG1BdXRoUmVxLT5wZWVyTWFjQWRkcik7CisKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltUHJldk1sbVN0YXRlID0gcHNlc3Npb25FbnRyeS0+bGltTWxtU3RhdGU7CisgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlID0gZUxJTV9NTE1fV1RfQVVUSF9GUkFNRTJfU1RBVEU7CisgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX01MTV9TVEFURSwgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsIHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlKSk7CisKKyAgICAgICAgLy8vIFByZXBhcmUgJiBzZW5kIEF1dGhlbnRpY2F0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2VUaW1lcihwTWFjLCBlTElNX0FVVEhfUkVUUllfVElNRVIpOworICAgICAgICAvLyBBY3RpdmF0ZSBBdXRoIGZhaWx1cmUgdGltZXIKKyAgICAgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfVElNRVJfQUNUSVZBVEUsIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLCBlTElNX0FVVEhfRkFJTF9USU1FUikpOworICAgICAgICBpZiAodHhfdGltZXJfYWN0aXZhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbUF1dGhGYWlsdXJlVGltZXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBUWF9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICAvLy8gQ291bGQgbm90IHN0YXJ0IEF1dGggZmFpbHVyZSB0aW1lci4KKyAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCBzdGFydCBBdXRoIGZhaWx1cmUgdGltZXIiKSk7CisgICAgICAgICAgICAvLyBDbGVhbnVwIGFzIGlmIGF1dGggdGltZXIgZXhwaXJlZAorICAgICAgICAgICAgbGltUHJvY2Vzc0F1dGhGYWlsdXJlVGltZW91dChwTWFjKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RJTUVSX0FDVElWQVRFLAorICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwgZUxJTV9BVVRIX1JFVFJZX1RJTUVSKSk7CisgICAgICAgICAgICAvLyBBY3RpdmF0ZSBBdXRoIFJldHJ5IHRpbWVyCisgICAgICAgICAgICBpZiAodHhfdGltZXJfYWN0aXZhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbVBlcmlvZGljQXV0aFJldHJ5VGltZXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiY291bGQgbm90IGFjdGl2YXRlIEF1dGggUmV0cnkgdGltZXIiKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAvKioKKyAgICAgICAgICogVW5leHBlY3RlZCBhdXRoIHJlcXVlc3QuCisgICAgICAgICAqIFJldHVybiBBdXRoIGNvbmZpcm0gd2l0aCBJbnZhbGlkIHBhcmFtZXRlcnMgY29kZS4KKyAgICAgICAgICovCisgICAgICAgIG1sbUF1dGhDbmYucmVzdWx0Q29kZSA9IGVTSVJfU01FX0lOVkFMSURfUEFSQU1FVEVSUzsKKworICAgICAgICBnb3RvIGVuZDsKKyAgICB9CisKK2VuZDoKKyAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKikgJm1sbUF1dGhDbmYucGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopICZwTWFjLT5saW0uZ3BMaW1NbG1BdXRoUmVxLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisKKyAgICBtbG1BdXRoQ25mLmF1dGhUeXBlID0gcE1hYy0+bGltLmdwTGltTWxtQXV0aFJlcS0+YXV0aFR5cGU7CisgICAgbWxtQXV0aENuZi5zZXNzaW9uSWQgPSBzZXNzaW9uSWQ7CisKKyAgICAvLy8gRnJlZSB1cCBidWZmZXIgYWxsb2NhdGVkCisgICAgLy8vIGZvciBwTWFjLT5saW0uZ0xpbU1sbUF1dGhSZXEKKyAgICB2b3Nfb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0FQX1JPTEUpICYmIChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlICE9IGVMSU1fQlRfQU1QX0FQX1JPTEUpKSAmJgorICAgICAgICAgKHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlID09IGVMSU1fTUxNX0xJTktfRVNUQUJMSVNIRURfU1RBVEUpKQorICAgIHsKKyAgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPnBMaW1NbG1SZWFzc29jUmVxKQorICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBzZXNzaW9uRW50cnktPnBMaW1NbG1SZWFzc29jUmVxKTsKKworICAgICAgICAvKiBIb2xkIFJlLUFzc29jIHJlcXVlc3QgYXMgcGFydCBvZiBTZXNzaW9uLCBrbm9jay1vdXQgcE1hYyAqLworICAgICAgICAvLy8gSG9sZCBvbnRvIFJlYXNzb2MgcmVxdWVzdCBwYXJhbWV0ZXJzCisgICAgICAgIHBzZXNzaW9uRW50cnktPnBMaW1NbG1SZWFzc29jUmVxID0gcE1sbVJlYXNzb2NSZXE7CisgICAgICAgIAorICAgICAgICAvLyBTZWUgaWYgd2UgaGF2ZSBwcmUtYXV0aCBjb250ZXh0IHdpdGggbmV3IEFQCisgICAgICAgIHBBdXRoTm9kZSA9IGxpbVNlYXJjaFByZUF1dGhMaXN0KHBNYWMsIHBzZXNzaW9uRW50cnktPmxpbVJlQXNzb2Nic3NJZCk7CisKKyAgICAgICAgaWYgKCFwQXV0aE5vZGUgJiYKKyAgICAgICAgICAgICghdm9zX21lbV9jb21wYXJlKHBNbG1SZWFzc29jUmVxLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+YnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpICkpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIEVpdGhlciBwcmUtYXV0aCBjb250ZXh0IGRvZXMgbm90IGV4aXN0IEFORAor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ICAgIHsKKyAgICAgICAgLy8vIENvdWxkIG5vdCBnZXQgQlNTSUQgZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgQlNTSUQiKSk7CisgICAgfQorICAgICNlbmRpZiAvL0JULUFNUCBTdXBwb3J0CisgICAgc2lyQ29weU1hY0FkZHIoY3VycmVudEJzc0lkLHBzZXNzaW9uRW50cnktPmJzc0lkKTsKKworICAgIHN3aXRjaCAocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSkKKyAgICB7CisgICAgICAgIGNhc2UgZUxJTV9TVEFfUk9MRToKKyAgICAgICAgY2FzZSBlTElNX0JUX0FNUF9TVEFfUk9MRTogICAgCisgICAgICAgICAgICBpZiAoICF2b3NfbWVtX2NvbXBhcmUocE1sbURpc2Fzc29jUmVxLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudEJzc0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBNTE1fRElTQVNTT0NfUkVRIHdpdGggaW52YWxpZCBCU1MgaWQgZnJvbTogIgorICAgICAgICAgICAgICAgICAgIE1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocE1sbURpc2Fzc29jUmVxLT5wZWVyTWFjQWRkcikpOykKKworICAgICAgICAgICAgICAgIC8vLyBQcmVwYXJlIGFuZCBTZW5kIExJTV9NTE1fRElTQVNTT0NfQ05GCisKKyAgICAgICAgICAgICAgICBtbG1EaXNhc3NvY0NuZi5yZXN1bHRDb2RlICAgICAgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9TTUVfSU5WQUxJRF9QQVJBTUVURVJTOworCisgICAgICAgICAgICAgICAgZ290byBlbmQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUxJTV9TVEFfSU5fSUJTU19ST0xFOgorCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0OiAvLyBlTElNX0FQX1JPTEUKKworICAgICAgICAgICAgLy8gRmFsbCB0aHJvdWdoCisgICAgICAgICAgICBicmVhazsKKworICAgIH0gLy8gZW5kIHN3aXRjaCAocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSkKKworICAgIC8qKgorICAgICAqIENoZWNrIGlmIHRoZXJlIGV4aXN0cyBhIGNvbnRleHQgZm9yIHRoZSBwZWVyIGVudGl0eQorICAgICAqIHRvIGJlIGRpc2Fzc29jaWF0ZWQgd2l0aC4KKyAgICAgKi8KKyAgICBwU3RhRHMgPSBkcGhMb29rdXBIYXNoRW50cnkocE1hYywgcE1sbURpc2Fzc29jUmVxLT5wZWVyTWFjQWRkciwgJmFpZCwgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUpOworICAgIGlmICgocFN0YURzID09IE5VTEwpIHx8CisgICAgICAgIChwU3RhRHMgJiYKKyAgICAgICAgICgocFN0YURzLT5tbG1TdGFDb250ZXh0Lm1sbVN0YXRlICE9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVMSU1fTUxNX0xJTktfRVNUQUJMSVNIRURfU1RBVEUpICYmCisgICAgICAgICAgKHBTdGFEcy0+bWxtU3RhQ29udGV4dC5tbG1TdGF0ZSAhPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlTElNX01MTV9XVF9BU1NPQ19DTkZfU1RBVEUpICYmCisgICAgICAgICAgKHBTdGFEcy0+bWxtU3RhQ29udGV4dC5tbG1TdGF0ZSAhPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlTElNX01MTV9BU1NPQ0lBVEVEX1NUQVRFKSkpKQorICAgIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFJlY2VpdmVkIExJTV9NTE1fRElTQVNTT0NfUkVRIGZvciBTVEEgdGhhdCBkb2VzIG5vdAorICAgICAgICAgKiBoYXZlIGNvbnRleHQgb3IgaW4gc29tZSB0cmFuc2l0IHN0YXRlLgorICAgICAgICAgKiBMb2cgZXJyb3IKKyAgICAgICAgICovCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICBGTCgicmVjZWl2ZWQgTUxNX0RJU0FTU09DX1JFUSBmb3IgU1RBIHRoYXQgZWl0aGVyIGhhcyBubyBjb250ZXh0ICIKKyAgICAgICAgICAgIm9yIGluIHNvbWUgdHJhbnNpdCBzdGF0ZSwgQWRkcj0gIgorICAgICAgICAgICBNQUNfQUREUkVTU19TVFIpLE1BQ19BRERSX0FSUkFZKHBNbG1EaXNhc3NvY1JlcS0+cGVlck1hY0FkZHIpKTsKKyAgICAgICAgaWYgKHBTdGFEcyAhPSBOVUxMKQorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJTdGEgTWxtU3RhdGUgOiAlZCIpLAorICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPm1sbVN0YUNvbnRleHQubWxtU3RhdGUpOworCisgICAgICAgIC8qCisgICAgICAgICAqIERpc2Fzc29jaWF0aW9uIHJlc3BvbnNlIGR1ZSB0bworICAgICAgICAgKiBob3N0IHRyaWdnZXJlZCBkaXNhc3NvY2lhdGlvbgorICAgICAgICAgKi8KKworICAgICAgICAgcFNpclNtZURpc2Fzc29jUnNwID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRTaXJTbWVEaXNhc3NvY1JzcCkpOworICAgICAgICAgaWYgKCBOVUxMID09IHBTaXJTbWVEaXNhc3NvY1JzcCApCisgICAgICAgICB7CisgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICBsaW1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XJTbWVEaXNhc3NvY1JzcDsKKworICAgICAgICAgbGltU2VuZFNtZURpc2Fzc29jRGVhdXRoTnRmKCBwTWFjLCBlSEFMX1NUQVRVU19TVUNDRVNTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTMyKikgcE1zZyApOworICAgICAgICAgcmV0dXJuOworCisgICAgfQorCisgICAgLy9wU3RhRHMtPm1sbVN0YUNvbnRleHQucnhQdXJnZVJlcSA9IDE7CisgICAgcFN0YURzLT5tbG1TdGFDb250ZXh0LmRpc2Fzc29jUmVhc29uID0gKHRTaXJNYWNSZWFzb25Db2RlcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWxtRGlzYXNzb2NSZXEtPnJlYXNvbkNvZGU7CisgICAgcFN0YURzLT5tbG1TdGFDb250ZXh0LmNsZWFudXBUcmlnZ2VyID0gcE1sbURpc2Fzc29jUmVxLT5kaXNhc3NvY1RyaWdnZXI7CisgICAvKiogU2V0IHN0YXRlIHRvIG1sbSBTdGF0ZSB0byBlTElNX01MTV9XVF9ERUxfU1RBX1JTUF9TVEFURQorICAgICogVGhpcyBpcyB0byBhZGRyZXNzIHRoZSBpc3N1ZSBvZiByYWNlIGNvbmRpdGlvbiBiZXR3ZWVuCisgICAgKiBkaXNjb25uZWN0IHJlcXVlc3QgZnJvbSB0aGUgSEREIGFuZCBkZWF1dGggZnJvbSBBUAorICAgICovCisgICAgcFN0YURzLT5tbG1TdGFDb250ZXh0Lm1sbVN0YXRlICAgPSBlTElNX01MTV9XVF9ERUxfU1RBX1JTUF9TVEFURTsKKworICAgIC8vLyBTZW5kIERpc2Fzc29jaWF0ZSBmcmFtZSB0byBwZWVyIGVudGl0eQorICAgIGlmIChzZW5kRGlzYXNzb2NGcmFtZSAmJiAocE1sbURpc2Fzc29jUmVxLT5yZWFzb25Db2RlICE9IGVTSVJfTUFDX0RJU0FTU09DX0RVRV9UT19GVEhBTkRPRkZfUkVBU09OKSkKKyAgICB7CisgICAgICAgIHBNYWMtPmxpbS5saW1EaXNhc3NvY0RlYXV0aENuZlJlcS5wTWxtRGlzYXNzb2NSZXEgPSBwTWxtRGlzYXNzb2NSZXE7CisKKworICAgICAgICAvKiBJZiB0aGUgcmVhc29uIGZvciBkaXNhc3NvY2lhdGlvbiBpcyBpbmFjdGl2aXR5IG9mIFNUQSwgdGhlbgorICAgICAgICAgICBkb250IHdhaXQgZm9yIGFja25vd2xlZGdlbWVudC4gQWxzbywgaWYgRldfSU5fVFhfUEFUSCBmZWF0dXJlCisgICAgICAgICAgIGlzIGVuYWJsZWQgZG8gbm90IHdhaXQgZm9yIEFDSyAqLworICAgICAgICBpZiAoKChwTWxtRGlzYXNzb2NSZXEtPnJlYXNvbkNvZGUgPT0gZVNJUl9NQUNfRElTQVNTT0NfRFVFX1RPX0lOQUNUSVZJVFlfUkVBU09OKSAmJgorICAgICAgICAgICAgKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFKSkgfHwKKyAgICAgICAgICAgIElTX0ZXX0lOX1RYX1BBVEhfRkVBVFVSRV9FTkFCTEUgKQorICAgICAgICB7CisKKyAgICAgICAgICAgICBsaW1TZW5kRGlzYXNzb2NNZ210RnJhbWUocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNbG1EaXNhc3NvY1JlcS0+cmVhc29uQ29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNbG1EaXNhc3NvY1JlcS0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LCBGQUxTRSk7CisKKyAgICAgICAgICAgICAvKiBTZW5kIERpc2Fzc29jIENORiBhbmQgcmVjZWl2ZSBwYXRoIGNsZWFudXAgKi8KKyAgICAgICAgICAgICBsaW1TZW5kRGlzYXNzb2NDbmYocE1hYyk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAgbGltU2VuZERpc2Fzc29jTWdtdEZyYW1lKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWxtRGlzYXNzb2NSZXEtPnJlYXNvbkNvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWxtRGlzYXNzb2NSZXEtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSwgVFJVRSk7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAvKiBEaXNhc3NvYyBmcmFtZSBpcyBub3Qgc2VudCBPVEEgKi8KKyAgICAgICBzZW5kRGlzYXNzb2NGcmFtZSA9IDE7CisgICAgICAgLy8gUmVjZWl2ZSBwYXRoIGNsZWFudXAgd2l0aCBkdW1teSBwYWNrZXQKKyAgICAgICBpZihlU0lSX1NVQ0NFU1MgIT0gbGltQ2xlYW51cFJ4UGF0aChwTWFjLCBwU3RhRHMscHNlc3Npb25FbnRyeSkpCisgICAgICAgeworICAgICAgICAgICBtbG1EaXNhc3NvY0NuZi5yZXN1bHRDb2RlID0gZVNJUl9TTUVfUkVTT1VSQ0VTX1VOQVZBSUxBQkxFOworICAgICAgICAgICBnb3RvIGVuZDsKKyAgICAgICB9CisgICAgICAgLy8gRnJlZSB1cCBidWZmZXIgYWxsb2NhdGVkIGZvciBtbG1EaXNhc3NvY1JlcQorICAgICAgIHZvc19tZW1fZnJlZShwTWxtRGlzYXNzb2NSZXEpOworICAgIH0KKworICAgIHJldHVybjsKKworZW5kOgorICAgIHZvc19tZW1fY29weSgodEFOSV9VOCAqKSAmbWxtRGlzYXNzb2NDbmYucGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopIHBNbG1EaXNhc3NvY1JlcS0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgIG1sbURpc2Fzc29jQ25mLmFpZCA9IHBNbG1EaXNhc3NvY1JlcS0+YWlkOworICAgIG1sbURpc2Fzc29jQ25mLmRpc2Fzc29jVHJpZ2dlciA9IHBNbG1EaXNhc3NvY1JlcS0+ZGlzYXNzb2NUcmlnZ2VyOworICAgIAorICAgIC8qIFVwZGF0ZSBQRSBzZXNzaW9uIElEKi8KKyAgICBtbG1EaXNhc3NvY0NuZi5zZXNzaW9uSWQgPSBwTWxtRGlzYXNzb2NSZXEtPnNlc3Npb25JZDsKKworICAgIC8vLyBGcmVlIHVwIGJ1ZmZlciBhbGxvY2F0ZWQgZm9yIG1sbURpc2Fzc29jUmVxCisgICAgdm9zX21lbV9mcmVlKHBNbG1EaXNhc3NvY1JlcSk7CisKKyAgICBsaW1Qb3N0U21lTWVzc2FnZShwTWFjLAorICAgICAgICAgICAgICAgICAgICAgIExJTV9NTE1fRElTQVNTT0NfQ05GLAorICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1UzMiAqKSAmbWxtRGlzYXNzb2NDbmYpOworfQorCit0QU5JX0JPT0xFQU4gbGltQ2hlY2tEaXNhc3NvY0RlYXV0aEFja1BlbmRpbmcodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpzdGFNYWMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApCit7CisgICAgdExpbU1sbURpc2Fzc29jUmVxICAgICAgKnBNbG1EaXNhc3NvY1JlcTsKKyAgICB0TGltTWxtRGVhdXRoUmVxICAgICAgICAqcE1sbURlYXV0aFJlcTsKKyAgICBwTWxtRGlzYXNzb2NSZXEgPSBwTWFjLT5saW0ubGltRGlzYXNzb2NEZWF1dGhDbmZSZXEucE1sbURpc2Fzc29jUmVxOworICAgIHBNbG1EZWF1dGhSZXEgPSBwTWFjLT5saW0ubGltRGlzYXNzb2NEZWF1dGhDbmZSZXEucE1sbURlYXV0aFJlcTsKKyAgICBpZiAoCisgICAgICAgICAgICAocE1sbURpc2Fzc29jUmVxICYmCisgICAgICAgICAgICAgKHZvc19tZW1fY29tcGFyZSgodEFOSV9VOCAqKSBzdGFNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSAmcE1sbURpc2Fzc29jUmVxLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpKSkgCisgICAgICAgICAgICB8fAorICAgICAgICAgICAgKHBNbG1EZWF1dGhSZXEgJiYKKyAgICAgICAgICAgICAodm9zX21lbV9jb21wYXJlKCh0QU5JX1U4ICopIHN0YU1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopICZwTWxtRGVhdXRoUmVxLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKSkpCisgICAgICAgKQorICAgIHsKKyAgICAgICAgUEVMT0cxKGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiRGlzYXNzb2MvRGVhdXRoIGFjayBwZW5kaW5nIikpOykKKyAgICAgICAgcmV0dXJuIGVBTklfQk9PTEVBTl9UUlVFOworICAgIH0KKyAgICAgZWxzZQorICAgICB7CisgICAgICAgIFBFTE9HMShsaW1Mb2cocE1hYywgTE9HMSwgRkwoIkRpc2Fzc29jL0RlYXV0aCBBY2sgbm90IHBlbmRpbmciKSk7KQorICAgICAgICByZXR1cm4gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICB9Cit9CisKK3ZvaWQgbGltQ2xlYW5VcERpc2Fzc29jRGVhdXRoUmVxKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgIHRBTklfVTggKnN0YU1hYywKKyAgICAgICAgdEFOSV9CT09MRUFOIGNsZWFuUnhQYXRoKQoreworICAgIHRMaW1NbG1EaXNhc3NvY1JlcSAgICAgICAqcE1sbURpc2Fzc29jUmVxOworICAgIHRMaW1NbG1EZWF1dGhSZXEgICAgICAgICpwTWxtRGVhdXRoUmVxOworICAgIHBNbG1EaXNhc3NvY1JlcSA9IHBNYWMtPmxpbS5saW1EaXNhc3NvY0RlYXV0aENuZlJlcS5wTWxtRGlzYXNzb2NSZXE7CisgICAgaWYgKHBNbG1EaXNhc3NvY1JlcSAmJgorICAgICAgICAgICAgKHZvc19tZW1fY29tcGFyZSgodEFOSV9VOCAqKSBzdGFNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopICZwTWxtRGlzYXNzb2NSZXEtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKSkpCisgICAgeworICAgICAgICBpZiAoY2xlYW5SeFBhdGgpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbVByb2Nlc3NEaXNhc3NvY0Fja1RpbWVvdXQocE1hYyk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBpZiAodHhfdGltZXJfcnVubmluZygmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltRGlzYXNzb2NBY2tUaW1lcikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltRGVhY3RpdmF0ZUFuZENoYW5nZVRpbWVyKHBNYWMsIGVMSU1fRElTQVNTT0NfQUNLX1RJTUVSKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTWxtRGlzYXNzb2NSZXEpOworICAgICAgICAgICAgcE1hYy0+bGltLmxpbURpc2Fzc29jRGVhdXRoQ25mUmVxLnBNbG1EaXNhc3NvY1JlcSA9IE5VTEw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwTWxtRGVhdXRoUmVxID0gcE1hYy0+bGltLmxpbURpc2Fzc29jRGVhdXRoQ25mUmVxLnBNbG1EZWF1dGhSZXE7CisgICAgaWYgKHBNbG1EZWF1dGhSZXEgJiYKKyAgICAgICAgICAgICh2b3NfbWVtX2NvbXBhcmUoKHRBTklfVTggKikgc3RhTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSAmcE1sbURlYXV0aFJlcS0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpKSkKKyAgICB7CisgICAgICAgIGlmIChjbGVhblJ4UGF0aCkKKyAgICAgICAgeworICAgICAgICAgICAgbGltUHJvY2Vzc0RlYXV0aEFja1RpbWVvdXQocE1hYyk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBpZiAodHhfdGltZXJfcnVubmluZygmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltRGVhdXRoQWNrVGltZXIpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbURlYWN0aXZhdGVBbmRDaGFuZ2VUaW1lcihwTWFjLCBlTElNX0RFQVVUSF9BQ0tfVElNRVIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBNbG1EZWF1dGhSZXEpOworICAgICAgICAgICAgcE1hYy0+bGltLmxpbURpc2Fzc29jRGVhdXRoQ25mUmVxLnBNbG1EZWF1dGhSZXEgPSBOVUxMOworICAgICAgICB9CisgICAgfQorfQorCit2b2lkIGxpbVByb2Nlc3NEaXNhc3NvY0Fja1RpbWVvdXQodHBBbmlTaXJHbG9iYWwgcE1hYykKK3sKKyAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIiIpKTsKKyAgICBsaW1TZW5kRGlzYXNzb2NDbmYocE1hYyk7Cit9CisKKy8qKgorICogbGltUHJvY2Vzc01sbURpc2Fzc29jUmVxKCkKKyAqCisgKkZVTkNUSU9OOgorICogVGhpcyBmdW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yb20gQ0ZHLiBMb2cgZXJyb3IuCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiY291bGQgbm90IHJldHJpZXZlIEJTU0lEIikpOworICAgIH0KKyAgICAjZW5kaWYgLy9TVVBQT1JUIEJULUFNUAorICAgIHNpckNvcHlNYWNBZGRyKGN1cnJlbnRCc3NJZCxwc2Vzc2lvbkVudHJ5LT5ic3NJZCk7CisKKyAgICBzd2l0Y2ggKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUpCisgICAgeworICAgICAgICBjYXNlIGVMSU1fU1RBX1JPTEU6CisgICAgICAgIGNhc2UgZUxJTV9CVF9BTVBfU1RBX1JPTEU6CisgICAgICAgICAgICBzd2l0Y2ggKHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNhc2UgZUxJTV9NTE1fSURMRV9TVEFURToKKyAgICAgICAgICAgICAgICAgICAgLy8gQXR0ZW1wdGluZyB0byBEZWF1dGhlbnRpY2F0ZQorICAgICAgICAgICAgICAgICAgICAvLyB3aXRoIGEgcHJlLWF1dGhlbnRpY2F0ZWQgcGVlci4KKyAgICAgICAgICAgICAgICAgICAgLy8gRGVhdXRoZXRpYXRlIHdpdGggcGVlciBpZiB0aGVyZQorICAgICAgICAgICAgICAgICAgICAvLyBleGlzdHMgYSBwcmUtYXV0aCBjb250ZXh0IGJlbG93LgorICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgZUxJTV9NTE1fQVVUSEVOVElDQVRFRF9TVEFURToKKyAgICAgICAgICAgICAgICBjYXNlIGVMSU1fTUxNX1dUX0FTU09DX1JTUF9TVEFURToKKyAgICAgICAgICAgICAgICBjYXNlIGVMSU1fTUxNX0xJTktfRVNUQUJMSVNIRURfU1RBVEU6CisgICAgICAgICAgICAgICAgICAgIGlmICghdm9zX21lbV9jb21wYXJlKHBNbG1EZWF1dGhSZXEtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRCc3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKSApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIE1MTV9ERUFVVEhfUkVRIHdpdGggaW52YWxpZCBCU1MgaWQgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIlBlZXIgTUFDOiAiTUFDX0FERFJFU1NfU1RSICIgQ0ZHIEJTU0lEIEFkZHIgOiAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocE1sbURlYXV0aFJlcS0+cGVlck1hY0FkZHIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkoY3VycmVudEJzc0lkKSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vLyBQcmVwYXJlIGFuZCBTZW5kIExJTV9NTE1fREVBVVRIX0NORgorCisgICAgICAgICAgICAgICAgICAgICAgICBtbG1EZWF1dGhDbmYucmVzdWx0Q29kZSA9IGVTSVJfU01FX0lOVkFMSURfUEFSQU1FVEVSUzsKKworICAgICAgICAgICAgICAgICAgICAgICAgZ290byBlbmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoKHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlID09CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlTElNX01MTV9BVVRIRU5USUNBVEVEX1NUQVRFKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgIChwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUxJTV9NTE1fV1RfQVNTT0NfUlNQX1NUQVRFKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gU2VuZCBEZWF1dGhlbnRpY2F0aW9uIGZyYW1lCisgICAgICAgICAgICAgICAgICAgICAgICAvLyB0byBwZWVyIGVudGl0eQorICAgICAgICAgICAgICAgICAgICAgICAgbGltU2VuZERlYXV0aE1nbXRGcmFtZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1sbURlYXV0aFJlcS0+cmVhc29uQ29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1sbURlYXV0aFJlcS0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnksIEZBTFNFKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgLy8vIFByZXBhcmUgYW5kIFNlbmQgTElNX01MTV9ERUFVVEhfQ05GCisgICAgICAgICAgICAgICAgICAgICAgICBtbG1EZWF1dGhDbmYucmVzdWx0Q29kZSA9IGVTSVJfU01FX1NVQ0NFU1M7CisgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSA9IGVMSU1fTUxNX0lETEVfU1RBVEU7CisgICAgICAgICAgICAgICAgICAgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9NTE1fU1RBVEUsIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLCBwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSkpOworICAgICAgICAgICAgICAgICAgICAgICAgZ290byBlbmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBMSU5LX0VTVEFCTElTRURfU1RBVEUKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIENsZWFudXAgUlggJiBUWCBwYXRocworICAgICAgICAgICAgICAgICAgICAgICAgLy8gYmVsb3cKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKworICAgICAgICAgICAgICAgICAgICBQRUxPR1cobGltTG9nKHBNYWMsIExPR1csCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBNTE1fREVBVVRIX1JFUSB3aXRoIGluIHN0YXRlICVkIGZvciBwZWVyICJNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSxNQUNfQUREUl9BUlJBWShwTWxtRGVhdXRoUmVxLT5wZWVyTWFjQWRkcikpOykKKyAgICAgICAgICAgICAgICAgICAgbGltUHJpbnRNbG1TdGF0ZShwTWFjLCBMT0dXLCBwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSk7CisKKyAgICAgICAgICAgICAgICAgICAgLy8vIFByZXBhcmUgYW5kIFNlbmQgTElNX01MTV9ERUFVVEhfQ05GCisgICAgICAgICAgICAgICAgICAgIG1sbURlYXV0aENuZi5yZXN1bHRDb2RlID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfU01FX1NUQV9OT1RfQVVUSEVOVElDQVRFRDsKKworICAgICAgICAgICAgICAgICAgICBnb3RvIGVuZDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlTElNX1NUQV9JTl9JQlNTX1JPTEU6CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIE1MTV9ERUFVVEhfUkVRIElCU1MgTW9kZSAiKSk7CisgICAgICAgICAgICBtbG1EZWF1dGhDbmYucmVzdWx0Q29kZSA9IGVTSVJfU01FX0lOVkFMSURfUEFSQU1FVEVSUzsKKyAgICAgICAgICAgIGdvdG8gZW5kOworICAgICAgICBkZWZhdWx0OiAvLyBlTElNX0FQX1JPTEUKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgfSAvLyBlbmQgc3dpdGNoIChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlKQorCisgICAgLyoqCisgICAgICogQ2hlY2sgaWYgdGhlcmUgZXhpc3RzIGEgY29udGV4dCBmb3IgdGhlIHBlZXIgZW50aXR5CisgICAgICogdG8gYmUgZGVhdXRoZW50aWNhdGVkIHdpdGguCisgICAgICovCisgICAgcFN0YURzID0gZHBoTG9va3VwSGFzaEVudHJ5KHBNYWMsIHBNbG1EZWF1dGhSZXEtPnBlZXJNYWNBZGRyLCAmYWlkLCAmcHNlc3Npb25FbnRyeS0+ZHBoLmRwaEhhc2hUYWJsZSk7CisKKyAgICBpZiAocFN0YURzID09IE5VTEwpCisgICAgeworICAgICAgICAvLy8gQ2hlY2sgaWYgdGhlcmUgZXhpc3RzIHByZS1hdXRoIGNvbnRleHQgZm9yIHRoaXMgU1RBCisgICAgICAgIHBBdXRoTm9kZSA9IGxpbVNlYXJjaFByZUF1dGhMaXN0KHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNbG1EZWF1dGhSZXEtPnBlZXJNYWNBZGRyKTsKKworICAgICAgICBpZiAocEF1dGhOb2RlID09IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogUmVjZWl2ZWQgREVBVVRIIFJFUSBmb3IgYSBTVEEgdGhhdCBpcyBuZWl0aGVyCisgICAgICAgICAgICAgKiBBc3NvY2lhdGVkIG5vciBQcmUtYXV0aGVudGljYXRlZC4gTG9nIGVycm9yLAorICAgICAgICAgICAgICogUHJlcGFyZSBhbmQgU2VuZCBMSU1fTUxNX0RFQVVUSF9DTkYKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIE1MTV9ERUFVVEhfUkVRIGluIG1sbWUgc3RhdGUgJWQgZm9yIFNUQSB0aGF0ICIKKyAgICAgICAgICAgICAgICJkb2VzIG5vdCBoYXZlIGNvbnRleHQsIEFkZHI9Ik1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSwKKyAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBNbG1EZWF1dGhSZXEtPnBlZXJNYWNBZGRyKSk7KQorCisgICAgICAgICAgICBtbG1EZWF1dGhDbmYucmVzdWx0Q29kZSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX1NNRV9TVEFfTk9UX0FVVEhFTlRJQ0FURUQ7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBtbG1EZWF1dGhDbmYucmVzdWx0Q29kZSA9IGVTSVJfU01FX1NVQ0NFU1M7CisKKyAgICAgICAgICAgIC8vLyBEZWxldGUgU1RBIGZyb20gcHJlLWF1dGggU1RBIGxpc3QKKyAgICAgICAgICAgIGxpbURlbGV0ZVByZUF1dGhOb2RlKHBNYWMsIHBNbG1EZWF1dGhSZXEtPnBlZXJNYWNBZGRyKTsKKworICAgICAgICAgICAgLy8vIFNlbmQgRGVhdXRoZW50aWNhdGlvbiBmcmFtZSB0byBwZWVyIGVudGl0eQorICAgICAgICAgICAgbGltU2VuZERlYXV0aE1nbXRGcmFtZShwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWxtRGVhdXRoUmVxLT5yZWFzb25Db2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWxtRGVhdXRoUmVxLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSwgRkFMU0UpOworICAgICAgICB9CisKKyAgICAgICAgZ290byBlbmQ7CisgICAgfQorICAgIGVsc2UgaWYgKChwU3RhRHMtPm1sbVN0YUNvbnRleHQubWxtU3RhdGUgIT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlTElNX01MTV9MSU5LX0VTVEFCTElTSEVEX1NUQVRFKSAmJgorICAgICAgICAgICAgIChwU3RhRHMtPm1sbVN0YUNvbnRleHQubWxtU3RhdGUgIT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVMSU1fTUxNX1dUX0FTU09DX0NORl9TVEFURSkpCisgICAgeworICAgICAgICAvKioKKyAgICAgICAgICogUmVjZWl2ZWQgTElNX01MTV9ERUFVVEhfUkVRIGZvciBTVEEgdGhhdCBpcyBuCisgICAgICAgICAqIHNvbWUgdHJhbnNpdCBzdGF0ZS4gTG9nIGVycm9yLgorICAgICAgICAgKi8KKyAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICBGTCgicmVjZWl2ZWQgTUxNX0RFQVVUSF9SRVEgZm9yIFNUQSB0aGF0IGVpdGhlciBoYXMgbm8gY29udGV4dCBvciBpbiBzb21lIHRyYW5zaXQgc3RhdGUsIEFkZHI9IgorICAgICAgICAgICBNQUNfQUREUkVTU19TVFIpLE1BQ19BRERSX0FSUkFZKHBNbG1EZWF1dGhSZXEtPnBlZXJNYWNBZGRyKSk7KQorCisgICAgICAgIC8qCisgICAgICAgICAqIERlYXV0aGVudGljYXRpb24gcmVzcG9uc2UgdG8gaG9zdCB0cmlnZ2VyZWQKKyAgICAgICAgICogZGVhdXRoZW50aWNhdGlvbi4KKyAgICAgICAgICovCisgICAgICAgIHBTaXJTbWVEZWF1dGhSc3AgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpclNtZURlYXV0aFJzcCkpOworICAgICAgICBpZiAoIE5VTEwgPT0gcFNpclNtZURlYXV0aFJzcCApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgRkwoImNhbGwgdG8gQWxsb2NhdGVNZW1vcnkgZmFpbGVkIGZvciBlV05JX1NNRV9ERUFVVEhfUlNQIikpOworCisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJzZW5kIGVXTklfU01FX0RFQVVUSF9SU1Agd2l0aCAiCisgICAgICAgICAgICAgICAicmV0Q29kZTogJWQgZm9yIk1BQ19BRERSRVNTX1NUUiksZVNJUl9TTUVfREVBVVRIX1NUQVRVUywKKyAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBNbG1EZWF1dGhSZXEtPnBlZXJNYWNBZGRyKSk7CisgICAgICAgIHBTaXJTbWVEZWF1dGhSc3AtPm1lc3NhZ2VUeXBlID0gZVdOSV9TTUVfREVBVVRIX1JTUDsKKyAgICAgICAgcFNpclNtZURlYXV0aFJzcC0+bGVuZ3RoICA9IHNpemVvZih0U2lyU21lRGVhdXRoUnNwKTsKKyAgICAgICAgcFNpclNtZURlYXV0aFJzcC0+c3RhdHVzQ29kZSA9IGVTSVJfU01FX0RFQVVUSF9TVEFUVVM7CisgICAgICAgIHBTaXJTbWVEZWF1dGhSc3AtPnNlc3Npb25JZCA9IHBNbG1EZWF1dGhSZXEtPnNlc3Npb25JZDsKKyAgICAgICAgcFNpclNtZURlYXV0aFJzcC0+dHJhbnNhY3Rpb25JZCA9IDA7CisKKyAgICAgICAgcEJ1ZiAgPSAodEFOSV9VOCAqKSBwU2lyU21lRGVhdXRoUn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HkgdGltZXIuIFRoaXMgd2lsbCBtYWtlIHN1cmUgdGhhdCB3ZSB3aWxsIG5vdAorICAgICAqIHByb2Nlc3MgZGlzYXNzb2MgaWYgZGVhdXRoIGlzIGluIHByb2dyZXNzIGZvciB0aGUgc3RhdGlvbgorICAgICAqIGFuZCB0aHVzIG1sbVN0YUNvbnRleHQuY2xlYW51cFRyaWdnZXIgd2lsbCBub3QgYmUgb3ZlcndyaXR0ZW4uCisgICAgKi8KKyAgICBwU3RhRHMtPm1sbVN0YUNvbnRleHQubWxtU3RhdGUgICA9IGVMSU1fTUxNX1dUX0RFTF9TVEFfUlNQX1NUQVRFOworCisgICAgLy8vIFNlbmQgRGVhdXRoZW50aWNhdGlvbiBmcmFtZSB0byBwZWVyIGVudGl0eQorICAgIC8qIElmIEZXX0lOX1RYX1BBVEggZmVhdHVyZSBpcyBlbmFibGVkCisgICAgICAgZG8gbm90IHdhaXQgZm9yIEFDSyAqLworICAgIGlmKCBJU19GV19JTl9UWF9QQVRIX0ZFQVRVUkVfRU5BQkxFICkKKyAgICB7CisgICAgICAgIGxpbVNlbmREZWF1dGhNZ210RnJhbWUocE1hYywgcE1sbURlYXV0aFJlcS0+cmVhc29uQ29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWxtRGVhdXRoUmVxLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LCBGQUxTRSk7CisKKyAgICAgICAgLyogU2VuZCBEZWF1dGggQ05GIGFuZCByZWNlaXZlIHBhdGggY2xlYW51cCAqLworICAgICAgICBsaW1TZW5kRGVhdXRoQ25mKHBNYWMpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBsaW1TZW5kRGVhdXRoTWdtdEZyYW1lKHBNYWMsIHBNbG1EZWF1dGhSZXEtPnJlYXNvbkNvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1sbURlYXV0aFJlcS0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSwgVFJVRSk7CisgICAgfQorCisgICAgcmV0dXJuOworCitlbmQ6CisgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4ICopICZtbG1EZWF1dGhDbmYucGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopIHBNbG1EZWF1dGhSZXEtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICBtbG1EZWF1dGhDbmYuZGVhdXRoVHJpZ2dlciA9IHBNbG1EZWF1dGhSZXEtPmRlYXV0aFRyaWdnZXI7CisgICAgbWxtRGVhdXRoQ25mLmFpZCAgICAgICAgICAgPSBwTWxtRGVhdXRoUmVxLT5haWQ7CisgICAgbWxtRGVhdXRoQ25mLnNlc3Npb25JZCA9IHBNbG1EZWF1dGhSZXEtPnNlc3Npb25JZDsKKworICAgIC8vIEZyZWUgdXAgYnVmZmVyIGFsbG9jYXRlZAorICAgIC8vIGZvciBtbG1EZWF1dGhSZXEKKyAgICB2b3NfbWVtX2ZyZWUocE1sbURlYXV0aFJlcSk7CisKKyAgICBsaW1Qb3N0U21lTWVzc2FnZShwTWFjLAorICAgICAgICAgICAgICAgICAgICAgIExJTV9NTE1fREVBVVRIX0NORiwKKyAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VMzIgKikgJm1sbURlYXV0aENuZik7CisKK30KKworCit2b2lkIGxpbVByb2Nlc3NEZWF1dGhBY2tUaW1lb3V0KHRwQW5pU2lyR2xvYmFsIHBNYWMpCit7CisgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCIiKSk7CisgICAgbGltU2VuZERlYXV0aENuZihwTWFjKTsKK30KKworLyoqCisgKiBsaW1Qcm9jZXNzTWxtRGVhdXRoUmVxKCkKKyAqCisgKkZVTkNUSU9OOgorICogVGhpcyBmdW5jdGlvbiBpc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JDKCBwTWxtU2V0S2V5c1JlcS0+cGVlck1hY0FkZHIgKSApICYmCisgICAgICAgICAgKCF2b3NfbWVtX2NvbXBhcmUocE1sbVNldEtleXNSZXEtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRCc3NJZCwgc2l6ZW9mKHRTaXJNYWNBZGRyKSkpICl7CisgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csIEZMKCJSZWNlaXZlZCBNTE1fU0VUS0VZU19SRVEgd2l0aCBpbnZhbGlkIEJTU0lEIikpOworICAgICAgICBsaW1QcmludE1hY0FkZHIoIHBNYWMsIHBNbG1TZXRLZXlzUmVxLT5wZWVyTWFjQWRkciwgTE9HVyApOworCisgICAgICAgIC8vIFByZXBhcmUgYW5kIFNlbmQgTElNX01MTV9TRVRLRVlTX0NORiB3aXRoIGVycm9yIGNvZGUKKyAgICAgICAgbWxtU2V0S2V5c0NuZi5yZXN1bHRDb2RlID0gZVNJUl9TTUVfSU5WQUxJRF9QQVJBTUVURVJTOworICAgICAgICBnb3RvIGVuZDsKKyAgICAgIH0KKyNlbmRpZgorICAgICAgLy8gRmFsbCB0aHJ1JyAmICdQbHVtYicga2V5cyBiZWxvdworICAgICAgYnJlYWs7CisgICAgY2FzZSBlTElNX1NUQV9JTl9JQlNTX1JPTEU6CisgICAgZGVmYXVsdDogLy8gb3RoZXJzCisgICAgICAvLyBGYWxsIHRocnUuLi4KKyAgICAgIGJyZWFrOworICB9CisKKyAgICAvKioKKyAgICAgICogVXNlIHRoZSAidW5pY2FzdCIgcGFyYW1ldGVyIHRvIGRldGVybWluZSBpZiB0aGUgIkdyb3VwIEtleXMiCisgICAgICAqIGFyZSBiZWluZyBzZXQuCisgICAgICAqIHBNbG1TZXRLZXlzUmVxLT5rZXkudW5pY2FzdCA9IDAgLT4gTXVsdGljYXN0L2Jyb2FkY2FzdAorICAgICAgKiBwTWxtU2V0S2V5c1JlcS0+a2V5LnVuaWNhc3QgLSAxIC0+IFVuaWNhc3Qga2V5cyBhcmUgYmVpbmcgc2V0CisgICAgICAqLworICAgIGlmKCBsaW1Jc0FkZHJCQyggcE1sbVNldEtleXNSZXEtPnBlZXJNYWNBZGRyICkpIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0cxLCBGTCgiVHJ5aW5nIHRvIHNldCBHcm91cCBLZXlzLi4uJWQgIiksIHBNbG1TZXRLZXlzUmVxLT5zZXNzaW9uSWQpOworICAgICAgICAvKiogV2hlbiB0cnlpbmcgdG8gc2V0IEdyb3VwIEtleXMgZm9yIGFueQorICAgICAgICAgICogc2VjdXJpdHkgbW9kZSBvdGhlciB0aGFuIFdFUCwgdXNlIHRoZQorICAgICAgICAgICogU1RBIEluZGV4IGNvcnJlc3BvbmRpbmcgdG8gdGhlIEFQLi4uCisgICAgICAgICAgKi8KKyAgICAgICAgc3dpdGNoKCBwTWxtU2V0S2V5c1JlcS0+ZWRUeXBlICkgeworICAgICAgY2FzZSBlU0lSX0VEX0NDTVA6CisgICAgICAgICAKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisgICAgICBjYXNlIGVTSVJfRURfQUVTXzEyOF9DTUFDOgorI2VuZGlmCisgICAgICAgIHN0YUlkeCA9IHBzZXNzaW9uRW50cnktPnN0YUlkOworICAgICAgICBicmVhazsKKworICAgICAgZGVmYXVsdDoKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgIH1lbHNlIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0cxLCBGTCgiVHJ5aW5nIHRvIHNldCBVbmljYXN0IEtleXMuLi4iKSk7CisgICAgLyoqCisgICAgICogQ2hlY2sgaWYgdGhlcmUgZXhpc3RzIGEgY29udGV4dCBmb3IgdGhlCisgICAgICogcGVlciBlbnRpdHkgZm9yIHdoaWNoIGtleXMgbmVlZCB0byBiZSBzZXQuCisgICAgICovCisKKworICAgIHBTdGFEcyA9IGRwaExvb2t1cEhhc2hFbnRyeSggcE1hYywgcE1sbVNldEtleXNSZXEtPnBlZXJNYWNBZGRyLCAmYWlkICwgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUpOworCisgICAgaWYgKChwU3RhRHMgPT0gTlVMTCkgfHwKKyAgICAgICAgICAgKChwU3RhRHMtPm1sbVN0YUNvbnRleHQubWxtU3RhdGUgIT0gZUxJTV9NTE1fTElOS19FU1RBQkxJU0hFRF9TVEFURSkgJiYgKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgIT0gZUxJTV9BUF9ST0xFKSkpIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFJlY2VpdmVkIExJTV9NTE1fU0VUS0VZU19SRVEgZm9yIFNUQQorICAgICAgICAgKiB0aGF0IGRvZXMgbm90IGhhdmUgY29udGV4dCBvciBpbiBzb21lCisgICAgICAgICAqIHRyYW5zaXQgc3RhdGUuIExvZyBlcnJvci4KKyAgICAgICAgICovCisgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPRzEsCisgICAgICAgICAgICBGTCgiUmVjZWl2ZWQgTUxNX1NFVEtFWVNfUkVRIGZvciBTVEEgdGhhdCBlaXRoZXIgaGFzIG5vIGNvbnRleHQgb3IgaW4gc29tZSB0cmFuc2l0IHN0YXRlLCBBZGRyID0gIikpOworICAgICAgICBsaW1QcmludE1hY0FkZHIoIHBNYWMsIHBNbG1TZXRLZXlzUmVxLT5wZWVyTWFjQWRkciwgTE9HVyApOworCisgICAgICAgIC8vIFByZXBhcmUgYW5kIFNlbmQgTElNX01MTV9TRVRLRVlTX0NORgorICAgICAgICBtbG1TZXRLZXlzQ25mLnJlc3VsdENvZGUgPSBlU0lSX1NNRV9JTlZBTElEX1BBUkFNRVRFUlM7CisgICAgICAgIGdvdG8gZW5kOworICAgICAgICB9IGVsc2UKKyAgICAgIHN0YUlkeCA9IHBTdGFEcy0+c3RhSW5kZXg7CisgIH0KKworICAgIGlmICgocE1sbVNldEtleXNSZXEtPm51bUtleXMgPT0gMC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ZW1vdmVLZXlDbmYgIG1sbVJlbW92ZUtleUNuZjsKKyAgICB0cFBFU2Vzc2lvbiAgICAgICAgIHBzZXNzaW9uRW50cnk7CisKKyAgICBpZihwTXNnQnVmID09IE5VTEwpCisgICAgeworICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsRkwoIkJ1ZmZlciBpcyBQb2ludGluZyB0byBOVUxMIikpOykKKyAgICAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHBNbG1SZW1vdmVLZXlSZXEgPSAodExpbU1sbVJlbW92ZUtleVJlcSAqKSBwTXNnQnVmOworCisKKyAgICBpZigocHNlc3Npb25FbnRyeSA9IHBlRmluZFNlc3Npb25CeVNlc3Npb25JZChwTWFjLHBNbG1SZW1vdmVLZXlSZXEtPnNlc3Npb25JZCkpPT0gTlVMTCkKKyAgICB7CisgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgRkwoInNlc3Npb24gZG9lcyBub3QgZXhpc3QgZm9yIGdpdmVuIHNlc3Npb25JZCIpKTspCisgICAgICAgIHZvc19tZW1fZnJlZShwTXNnQnVmKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworCisgICAgaWYoIHBNYWMtPmxpbS5ncExpbU1sbVJlbW92ZUtleVJlcSAhPSBOVUxMICkKKyAgICB7CisgICAgICAgIC8vIEZyZWUgYW55IHByZXZpb3VzIHJlcXVlc3RzLgorICAgICAgICB2b3NfbWVtX2ZyZWUocE1hYy0+bGltLmdwTGltTWxtUmVtb3ZlS2V5UmVxKTsKKyAgICAgICAgcE1hYy0+bGltLmdwTGltTWxtUmVtb3ZlS2V5UmVxID0gTlVMTDsKKyAgICB9CisgICAgLy8gSG9sZCBvbnRvIHRoZSBSZW1vdmVLZXlzIHJlcXVlc3QgcGFyYW1ldGVycworICAgIHBNYWMtPmxpbS5ncExpbU1sbVJlbW92ZUtleVJlcSA9ICh2b2lkICopIHBNbG1SZW1v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jaGFubmVsTGlzdC5jaGFubmVsTnVtYmVyKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNoYW5uZWxOdW0gPSBwTWFjLT5saW0uZ3BMaW1NbG1TY2FuUmVxLT5jaGFubmVsTGlzdC5jaGFubmVsTnVtYmVyW3BNYWMtPmxpbS5ncExpbU1sbVNjYW5SZXEtPmNoYW5uZWxMaXN0Lm51bUNoYW5uZWxzIC0gMV07CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBjaGFubmVsTnVtID0gMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICBGTCgiU2VuZGluZyBFbmQgU2NhbiByZXEgZnJvbSBNSU5fQ0hfVElNRU9VVCBpbiBzdGF0ZSAlZCBjaC0lZCIpLAorICAgICAgICAgICBwTWFjLT5saW0uZ0xpbU1sbVN0YXRlLGNoYW5uZWxOdW0pOworICAgICAgICBsaW1TZW5kSGFsRW5kU2NhblJlcShwTWFjLCBjaGFubmVsTnVtLCBlTElNX0hBTF9FTkRfU0NBTl9XQUlUX1NUQVRFKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAvKioKKyAgICAgICAgICogTUlOIGNoYW5uZWwgdGltZXIgc2hvdWxkIG5vdCBoYXZlIHRpbWVkIG91dAorICAgICAgICAgKiBpbiBzdGF0ZXMgb3RoZXIgdGhhbiB3YWl0X3Byb2JlX3Jlc3BvbnNlLgorICAgICAgICAgKiBMb2cgZXJyb3IuCisgICAgICAgICAqLworICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgRkwoInJlY2VpdmVkIHVuZXhwZWN0ZWQgTUlOIGNoYW5uZWwgdGltZW91dCBpbiBtbG1lIHN0YXRlICVkIGFuZCBoYWwgc2NhbiBTdGF0ZSAlZCIpLAorICAgICAgICAgICBwTWFjLT5saW0uZ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XJbcE1hYy0+bGltLmdwTGltTWxtU2NhblJlcS0+Y2hhbm5lbExpc3QubnVtQ2hhbm5lbHMgLSAxXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGNoYW5uZWxOdW0gPSAxOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICBGTCgiU2VuZGluZyBFbmQgU2NhbiByZXEgZnJvbSBNQVhfQ0hfVElNRU9VVCBpbiBzdGF0ZSAlZCBvbiBjaC0lZCIpLAorICAgICAgICAgICBwTWFjLT5saW0uZ0xpbU1sbVN0YXRlLGNoYW5uZWxOdW0pOworICAgICAgICBsaW1TZW5kSGFsRW5kU2NhblJlcShwTWFjLCBjaGFubmVsTnVtLCBlTElNX0hBTF9FTkRfU0NBTl9XQUlUX1NUQVRFKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIE1BWCBjaGFubmVsIHRpbWVyIHNob3VsZCBub3QgaGF2ZSB0aW1lZCBvdXQKKyAgICAgICAgICogaW4gc3RhdGVzIG90aGVyIHRoYW4gd2FpdF9zY2FuLgorICAgICAgICAgKiBMb2cgZXJyb3IuCisgICAgICAgICAqLworICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgRkwoInJlY2VpdmVkIHVuZXhwZWN0ZWQgTUFYIGNoYW5uZWwgdGltZW91dCBpbiBtbG1lIHN0YXRlICVkIGFuZCBoYWwgc2NhbiBzdGF0ZSAlZCIpLAorICAgICAgICAgICBwTWFjLT5saW0uZ0xpbU1sbVN0YXRlLCBwTWFjLT5saW0uZ0xpbUhhbFNjYW5TdGF0ZSk7CisgICAgICAgIGxpbVByaW50TWxtU3RhdGUocE1hYywgTE9HVywgcE1hYy0+bGltLmdMaW1NbG1TdGF0ZSk7CisgICAgfQorfSAvKioqIGxp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TV9XVF9QUk9CRV9SRVNQX1NUQVRFKSAmJgorICAgICAgICAocFBlcmlvZGljUHJvYmVSZXFUaW1lci0+c2Vzc2lvbklkICE9IDB4ZmYpICYmIChwTWFjLT5saW0ucHJvYmVDb3VudGVyIDwgcE1hYy0+bGltLm1heFByb2JlKSkKKyAgICB7CisgICAgICAgIHRMaW1NbG1TY2FuUmVxICpwTGltTWxtU2NhblJlcSA9IHBNYWMtPmxpbS5ncExpbU1sbVNjYW5SZXE7CisgICAgICAgIHBNYWMtPmxpbS5wcm9iZUNvdW50ZXIrKzsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFBlcmlvZGljIGNoYW5uZWwgdGltZXIgdGltZWQgb3V0CisgICAgICAgICAqIHRvIHNlbmQgcHJvYmUgcmVxdWVzdC4KKyAgICAgICAgICovCisgICAgICAgIGNoYW5uZWxOdW0gPSBsaW1HZXRDdXJyZW50U2NhbkNoYW5uZWwocE1hYyk7CisgICAgICAgIC8qIFByZXBhcmUgYW5kIHNlbmQgUHJvYmUgUmVxdWVzdCBmcmFtZSBmb3IgYWxsIHRoZSBTU0lEcworICAgICAgICAgKiBwcmVzZW50IGluIHRoZSBzYXZlZCBNTE0KKyAgICAgICAgICovCisgICAgICAgIGRvCisgICAgICAgIHsKKyAgICAgICAgICAgIHRTaXJNYWNBZGRyICAgICAgICAgZ1NlbGZNYWNBZGRyOworCisgICAgICAgICAgICAvKiBTZW5kIHNlbGYgTUFDIGFzIHNyYyBhZGRyZXNzIGlmCisgICAgICAgICAgICAgKiBNQUMgc3Bvb2YgaXMgbm90IGVuYWJsZWQgT1IKKyAgICAgICAgICAgICAqIHNwb29mTWFjQWRkciBpcyBhbGwgMCBPUgorICAgICAgICAgICAgICogZGlzYWJsZVAyUE1hY1Nwb29mIGlzIGVuYWJsZWQgYW5kIHNjYW4gaXMgUDJQIHNjYW4KKyAgICAgICAgICAgICAqIGVsc2UgdXNlIHRoZSBzcG9vZk1hYyBhcyBzcmMgYWRkcmVzcworICAgICAgICAgICAgICovCisgICAgICAgICAgICBpZiAoKHBNYWMtPmxpbS5pc1Nwb29maW5nRW5hYmxlZCAhPSBUUlVFKSB8fAorICAgICAgICAgICAgICAgIChUUlVFID09CisgICAgICAgICAgICAgICAgdm9zX2lzX21hY2FkZHJfemVybygodl9NQUNBRERSX3QgKikmcE1hYy0+bGltLnNwb29mTWFjQWRkcikpIHx8CisgICAgICAgICAgICAgICAgKHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uZGlzYWJsZVAyUE1hY1Nwb29maW5nICYmCisgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwTGltTWxtU2NhblJlcS0+cDJwU2VhcmNoKSkgeworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShnU2VsZk1hY0FkZHIsIHBNYWMtPmxpbS5nU2VsZk1hY0FkZHIsIFZPU19NQUNfQUREUkVTU19MRU4pOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoZ1NlbGZNYWNBZGRyLCBwTWFjLT5saW0uc3Bvb2ZNYWNBZGRyLCBWT1NfTUFDX0FERFJFU1NfTEVOKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HMSwgRkwoIk1hYyBBZGRyIHVzZWQgaW4gUHJvYmUgUmVxIGlzIDoiTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkoZ1NlbGZNYWNBZGRyKSk7CisKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiBQRUxPR0UobGltTG9nKHBNYWMsIExPR1csIEZMKCJzZW5kaW5nIFByb2JlUmVxIG51bWJlciAlZCwiCisgICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGZvciBTU0lEICVzIG9uIGNoYW5uZWw6ICVkIiksCisgICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSwgcExpbU1sbVNjYW5SZXEtPnNzSWRbaV0uc3NJZCwKKyAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbE51bSk7KQorICAgICAgICAgICAgICovCisgICAgICAgICAgICBzdGF0dXMgPSBsaW1TZW5kUHJvYmVSZXFNZ210RnJhbWUoIHBNYWMsICZwTGltTWxtU2NhblJlcS0+c3NJZFtpXSwKKyAgICAgICAgICAgICAgICAgICAgIHBMaW1NbG1TY2FuUmVxLT5ic3NJZCwgY2hhbm5lbE51bSwgZ1NlbGZNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgcExpbU1sbVNjYW5SZXEtPmRvdDExbW9kZSwgcExpbU1sbVNjYW5SZXEtPnVJRUZpZWxkTGVuLAorICAgICAgICAgICAgICAgKHRBTklfVTggKikocExpbU1sbVNjYW5SZXEpICsgcExpbU1sbVNjYW5SZXEtPnVJRUZpZWxkT2Zmc2V0KTsKKworCisgICAgICAgICAgICBpZiAoIHN0YXR1cyAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgic2VuZCBQcm9iZVJlcSBmYWlsZWQgZm9yIFNTSUQgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzIG9uIGNoYW5uZWw6ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcExpbU1sbVNjYW5SZXEtPnNzSWRbaV0uc3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsTnVtKTspCisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaSsrOworICAgICAgICB9IHdoaWxlIChpIDwgcExpbU1sbVNjYW5SZXEtPm51bVNzaWQpOworCisgICAgICAgIC8qIEFjdGl2YXRlIHRpbWVyIGFnYWluICovCisgICAgICAgIGlmICh0eF90aW1lcl9hY3RpdmF0ZShwUGVyaW9kaWNQcm9iZVJlcVRpbWVyKSAhPSBUWF9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJjb3VsZCBub3Qgc3RhcnQgcGVyaW9kaWMgcHJvYmUiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIHJlcSB0aW1lciIpKTsKKyAgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFBlcmlvZGljIHNjYW4gaXMgdGltZW91dCBpcyBoYXBwZW5pbmcgaW4KKyAgICAgICAgICogaW4gc3RhdGVzIG90aGVyIHRoYW4gd2FpdF9zY2FuLgorICAgICAgICAgKiBMb2cgZXJyb3IuCisgICAgICAgICAqLworICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgRkwoInJlY2VpdmVkIHVuZXhwZWN0ZWQgUGVyaW9kaWMgc2NhbiB0aW1lb3V0IGluIHN0YXRlICVkIiksCisgICAgICAgICAgIHBNYWMtPmxpbS5nTGltTWxtU3RhdGUpOworICAgIH0KK30gLyoqKiBsaW1Qcm9jZXNzUGVyaW9kaWNQcm9iZVJlcVRpbWVyKCkgKioqLworCisvKioKKyAqIGxpbVByb2Nlc3NKb2luRmFpbHVyZVRpbWVvdXQoKQorICoKKyAqRlVOQ1RJT046CisgKiBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCB0byBwcm9jZXNzIEpvaW5GYWlsdXJlVGltZW91dAorICoKKyAqTE9HSUM6CisgKgorICpBU1NVTVBUSU9OUzoKKyAqCisgKk5PVEU6CisgKgorICogQHBhcmFtICBwTWFjICAgICAgUG9pbnRlciB0byBHbG9iY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Vzc2lvbkVudHJ5LT5zZWxmTWFjQWRkciwgTlVMTCwgTlVMTCkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCAgRkwoIkZhaWxlZCB0byBzZXQgdGhlIExpbmtTdGF0ZSIpKTspCisgICAgICAgIC8qIFVwZGF0ZSBQRSBzZXNzaW9uIElkICovCisgICAgICAgIG1sbUpvaW5DbmYuc2Vzc2lvbklkID0gcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQ7CisgICAgICAgIAorICAgICAgIAorICAgICAgICAvLyBGcmVldXAgYnVmZmVyIGFsbG9jYXRlZCB0byBqb2luIHJlcXVlc3QKKyAgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPnBMaW1NbG1Kb2luUmVxKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocHNlc3Npb25FbnRyeS0+cExpbU1sbUpvaW5SZXEpOworICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cExpbU1sbUpvaW5SZXEgPSBOVUxMOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBsaW1Qb3N0U21lTWVzc2FnZShwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICBMSU1fTUxNX0pPSU5fQ05GLAorICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VMzIgKikgJm1sbUpvaW5DbmYpOworCisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIEpvaW4gZmFpbHVyZSB0aW1lciBzaG91bGQgbm90IGhhdmUgdGltZWQgb3V0CisgICAgICAgICAqIGluIHN0YXRlcyBvdGhlciB0aGFuIHdhaXRfam9pbl9iZWFjb24gc3RhdGUuCisgICAgICAgICAqIExvZyBlcnJvci4KKyAgICAgICAgICovCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICBGTCgicmVjZW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c3Npb25FbnRyeS0+bGltTWxtU3RhdGUpCisgICAgeworICAgICAgICBjYXNlIGVMSU1fTUxNX1dUX0FVVEhfRlJBTUUyX1NUQVRFOgorICAgICAgICBjYXNlIGVMSU1fTUxNX1dUX0FVVEhfRlJBTUU0X1NUQVRFOgorICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBSZXF1ZXN0aW5nIFNUQSBkaWQgbm90IHJlY2VpdmUgbmV4dCBhdXRoIGZyYW1lCisgICAgICAgICAgICAgKiBiZWZvcmUgQXV0aCBGYWlsdXJlIHRpbWVvdXQuCisgICAgICAgICAgICAgKiBJc3N1ZSBNTE0gYXV0aCBjb25maXJtIHdpdGggdGltZW91dCByZWFzb24gY29kZQorICAgICAgICAgICAgICovCisgICAgICAgICAgICAgLy9SZXN0b3JlIGRlZmF1bHQgZmFpbHVyZSB0aW1lb3V0CisgICAgICAgICAgICAgaWYgKFZPU19QMlBfQ0xJRU5UX01PREUgPT0gcHNlc3Npb25FbnRyeS0+cGVQZXJzb25hICYmIHBzZXNzaW9uRW50cnktPmRlZmF1bHRBdXRoRmFpbHVyZVRpbWVvdXQpCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBjY21DZmdTZXRJbnQocE1hYyxXTklfQ0ZHX0FVVEhFTlRJQ0FURV9GQUlMVVJFX1RJTUVPVVQgLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+ZGVmYXVsdEF1dGhGYWlsdXJlVGltZW91dCwgTlVMTCwgZUFOSV9CT09MRUFOX0ZBTFNFKTsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgICBsaW1SZXN0b3JlRnJvbUF1dGhTdGF0ZShwTWFjLGVTSVJfU01FX0FVVEhfVElNRU9VVF9SRVNVTFRfQ09ERSxlU0lSX01BQ19VTlNQRUNfRkFJTFVSRV9SRUFTT04scHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBBdXRoIGZhaWx1cmUgdGltZXIgc2hvdWxkIG5vdCBoYXZlIHRpbWVkIG91dAorICAgICAgICAgICAgICogaW4gc3RhdGVzIG90aGVyIHRoYW4gd3RfYXV0aF9mcmFtZTIvNAorICAgICAgICAgICAgICogTG9nIGVycm9yLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJyZWNlaXZlZCB1bmV4cGVjdGVkIEFVVEggZmFpbHVyZSB0aW1lb3V0IGluIHN0YXRlICVkIiksIHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlKTspCisgICAgICAgICAgICBsaW1QcmludE1sbVN0YXRlKHBNYWMsIExPR0UsIHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlKTsKKworICAgICAgICAgICAgYnJlYWs7CisgICAgfQorfSAvKioqIGxpbVByb2Nlc3NBdXRoRmFpbHVyZVRpbWVvdXQoKSAqKiovCisKKworCisvKioKKyAqIGxpbVByb2Nlc3NBdXRoUnNwVGltZW91dCgpCisgKgorICpGVU5DVElPTjoKKyAqIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIHRvIHByb2Nlc3MgTWluIENoYW5uZWwgVGltZW91dAorICogZHVyaW5nIGNoYW5uZWwgc2Nhbi4KKyAqCisgKkxPR0lDOgorICoKKyAqQVNTVU1QVElPTlM6CisgKgorICpOT1RFOgorICoKKyAqIEBwYXJhbSAgcE1hYyAgICAgIFBvaW50ZXIgdG8gR2xvYmFsIE1BQyBzdHJ1Y3R1cmUKKyAqIEByZXR1cm4gTm9uZQorICovCisKK3N0YXRpYyB2b2lkCitsaW1Qcm9jZXNzQXV0aFJzcFRpbWVvdXQodHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMzIgYXV0aEluZGV4KQoreworICAgIHN0cnVjdCB0TGltUHJlQXV0aE5vZGUgKnBBdXRoTm9kZTsKKyAgICB0cFBFU2Vzc2lvbiAgICAgICAgcHNlc3Npb25FbnRyeTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgc2Vzc2lvbklkOworCisgICAgcEF1dGhOb2RlID0gbGltR2V0UHJlQXV0aE5vZGVGcm9tSW5kZXgocE1hYywgJnBNYWMtPmxpbS5nTGltUHJlQXV0aFRpbWVyVGFibGUsIGF1dGhJbmRleCk7CisKKyAgICBpZiAoTlVMTCA9PSBwQXV0aE5vZGUpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgRkwoIkludmFsaWQgYXV0aCBub2RlIikpOworICAgICAgICByZXR1cm47CisgICAgfSAKKworICAgIGlmICgocHNlc3Npb25FbnRyeSA9IHBlRmluZFNlc3Npb25CeUJzc2lkKHBNYWMsIHBBdXRoTm9kZS0+cGVlck1hY0FkZHIsICZzZXNzaW9uSWQpKSA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1csIEZMKCJzZXNzaW9uIGRvZXMgbm90IGV4aXN0IGZvciBnaXZlbiBCU1NJRCAiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9IAorCisgICAgaWYgKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFIHx8CisgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9TVEFfSU5fSUJTU19ST0xFKQorICAgIHsKKyAgICAgICAgaWYgKHBBdXRoTm9kZS0+bWxtU3RhdGUgIT0gZUxJTV9NTE1fV1RfQVVUSF9GUkFNRTNfU1RBVEUpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogQXV0aGVudGljYXRpb24gcmVzcG9uc2UgdGltZXIgdGltZWRvdXQKKyAgICAgICAgICAgICAqIGluIHVuZXhwZWN0ZWQgc3RhdGUuIExvZyBlcnJvcgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICBGTCgicmVjZWl2ZWQgQVVUSCByc3AgdGltZW91dCBpbiB1bmV4cGVjdGVkIHN0YXRlICIKKyAgICAgICAgICAgICAgICAgICAgICAgICJmb3IgTUFDIGFkZHJlc3M6ICJNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEF1dGhOb2RlLT5wZWVyTWFjQWRkcikpOykKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIEF1dGhlbnRpY2F0aW9uIHJlc3BvbnNlIHRpbWVyCisgICAgICAgICAgICAvLyB0aW1lZG91dCBmb3IgYW4gU1RBLgorICAgICAgICAgICAgcEF1dGhOb2RlLT5tbG1TdGF0ZSA9IGVMSU1fTUxNX0FVVEhfUlNQX1RJTUVPVVRfU1RBVEU7CisgICAgICAgICAgICBwQXV0aE5vZGUtPmZUaW1lclN0YXJ0ZWQgPSAwOworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgICAgICAgICBGTCgiQVVUSCByc3AgdGltZWRvdXQgZm9yIE1BQyBhZGRyZXNzICJNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEF1dGhOb2RlLT5wZWVyTWFjQWRkcikpOworCisgICAgICAgICAgICAvLyBDaGFuZ2UgdGltZXIgdG8gcmVhY3RpdmF0ZSBpdCBpbiBmdXR1cmUKKyAgICAgICAgICAgIGxpbURlYWN0aXZhdGVBbmRDaGFuZ2VQZXJTdGFJZFRpbWVyKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICBlTElNX0FVVEhfUlNQX1RJTUVSLAorICAgICAgICAgICAgICAgICAgICAgICAgcEF1dGhOb2RlLT5hdXRoTm9kZUlkeCk7CisKKyAgICAgICAgICAgIG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XJlIGFjdGl2YXRpb25zCisgICAgICAgICAgICBsaW1EZWFjdGl2YXRlQW5kQ2hhbmdlVGltZXIocE1hYywgZUxJTV9BU1NPQ19GQUlMX1RJTUVSKTsKKworICAgICAgICAgICAgLy8gRnJlZSB1cCBidWZmZXIgYWxsb2NhdGVkIGZvciBKb2luUmVxIGhlbGQgYnkKKyAgICAgICAgICAgIC8vIE1MTSBzdGF0ZSBtYWNoaW5lCisgICAgICAgICAgICBpZiAocHNlc3Npb25FbnRyeS0+cExpbU1sbUpvaW5SZXEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBzZXNzaW9uRW50cnktPnBMaW1NbG1Kb2luUmVxKTsKKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wTGltTWxtSm9pblJlcSA9IE5VTEw7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vVG8gcmVtb3ZlIHRoZSBwcmVhdXRoIG5vZGUgaW4gY2FzZSBvZiBmYWlsIHRvIGFzc29jaWF0ZQorICAgICAgICAgICAgaWYgKGxpbVNlYXJjaFByZUF1dGhMaXN0KHBNYWMsIHBzZXNzaW9uRW50cnktPmJzc0lkKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIiBkZWxldGUgcHJlIGF1dGggbm9kZSBmb3IgIgorICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIpLCBNQUNfQUREUl9BUlJBWShwc2Vzc2lvbkVudHJ5LT5ic3NJZCkpOworICAgICAgICAgICAgICAgIGxpbURlbGV0ZVByZUF1dGhOb2RlKHBNYWMsIHBzZXNzaW9uRW50cnktPmJzc0lkKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbWxtQXNzb2NDbmYucmVzdWx0Q29kZSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9TTUVfQVNTT0NfVElNRU9VVF9SRVNVTFRfQ09ERTsKKyAgICAgICAgICAgIG1sbUFzc29jQ25mLnByb3RTdGF0dXNDb2RlID0gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9NQUNfVU5TUEVDX0ZBSUxVUkVfU1RBVFVTOworICAgICAgICAgICAgCisgICAgICAgICAgICAvKiBVcGRhdGUgUEUgc2Vzc2lvbiBJZCovCisgICAgICAgICAgICBtbG1Bc3NvY0NuZi5zZXNzaW9uSWQgPSBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZDsKKyAgICAgICAgICAgIGlmIChNc2dUeXBlID09IExJTV9BU1NPQykKKyAgICAgICAgICAgICAgICBsaW1Qb3N0U21lTWVzc2FnZShwTWFjLCBMSU1fTUxNX0FTU09DX0NORiwgKHRBTklfVTMyICopICZtbG1Bc3NvY0NuZik7CisgICAgICAgICAgICBlbHNlIAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIFdpbGwgY29tZSBoZXJlIG9ubHkgaW4gY2FzZSBvZiAxMXIsIEVTRSwgRlQgd2hlbiByZWFzc29jIHJzcAorICAgICAgICAgICAgICAgICAgIGlzIG5vdCByZWNlaXZlZCBhbmQgd2UgcmVjZWl2ZSBhIHJlYXNzb2MgLSB0aW1lc291dCAqLworICAgICAgICAgICAgICAgIG1sbUFzc29jQ25mLnJlc3VsdENvZGUgPSBlU0lSX1NNRV9GVF9SRUFTU09DX1RJTUVPVVRfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICBsaW1Qb3N0U21lTWVzc2FnZShwTWFjLCBMSU1fTUxNX1JFQVNTT0NfQ05GLCAodEFOSV9VMzIgKikgJm1sbUFzc29jQ25mKTsKKyAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBSZXN0b3JlIHByZS1yZWFzc29jIHJlcSBzdGF0ZS4KKyAgICAgICAgICAgICAqIFNldCBCU1NJRCB0byBjd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gY2JTdGF0ZSA9ICBQSFlfUVVBRFJVUExFX0NIQU5ORUxfMjBNSFpfTE9XXzQwTUhaX0hJR0g7CisgICAgICAgIGVsc2UgCisgICAgICAgICAgICBsaW1Mb2cgKHBNYWMsIExPR1AsIAorICAgICAgICAgICAgICAgICAgICAgICBGTCgiSW52YWxpZCBDaGFubmVsIE51bWJlciA9ICVkIENlbnRlciBDaGFuID0gJWQgIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsLCBwZWVyQ2VudGVyQ2hhbik7CisgICAgfQorICAgIGlmICggKGh0U2Vjb25kYXJ5Q2hhbm5lbE9mZnNldCAKKyAgICAgICAgICAgICAgICAgPT0gUEhZX0RPVUJMRV9DSEFOTkVMX0hJR0hfUFJJTUFSWSkKKyAgICAgICApCisgICAgeworICAgICAgICBpZiAoKGNoYW5uZWwgLSAyICkgPT0gcGVlckNlbnRlckNoYW4gKQorICAgICAgICAgICAgY2JTdGF0ZSA9ICBQSFlfUVVBRFJVUExFX0NIQU5ORUxfMjBNSFpfSElHSF80ME1IWl9DRU5URVJFRDsKKyAgICAgICAgZWxzZSBpZiAoKGNoYW5uZWwgKyAyICkgPT0gcGVlckNlbnRlckNoYW4gKQorICAgICAgICAgICAgY2JTdGF0ZSA9ICBQSFlfUVVBRFJVUExFX0NIQU5ORUxfMjBNSFpfSElHSF80ME1IWl9MT1c7CisgICAgICAgIGVsc2UgaWYgKChjaGFubmVsIC0gNiApID09IHBlZXJDZW50ZXJDaGFuICkKKyAgICAgICAgICAgIGNiU3RhdGUgPSAgUEhZX1FVQURSVVBMRV9DSEFOTkVMXzIwTUhaX0hJR0hfNDBNSFpfSElHSDsKKyAgICAgICAgZWxzZSAKKyAgICAgICAgICAgbGltTG9nIChwTWFjLCBMT0dQLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiSW52YWxpZCBDaGFubmVsIE51bWJlciA9ICVkIENlbnRlciBDaGFuID0gJWQgIiksCisgICAgICAgICAgIC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TElNX01MTV9TQ0FOX0NORjoKKyAgICAgICAgICAgIGxpbVByb2Nlc3NNbG1TY2FuQ25mKHBNYWMsIHBNc2dCdWYpOworICAgICAgICAgICAgYnJlYWs7CisKKyNpZmRlZiBGRUFUVVJFX09FTV9EQVRBX1NVUFBPUlQKKyAgICAgICAgY2FzZSBMSU1fTUxNX09FTV9EQVRBX0NORjoKKyAgICAgICAgICAgIGxpbVByb2Nlc3NNbG1PZW1EYXRhUmVxQ25mKHBNYWMsIHBNc2dCdWYpOworICAgICAgICAgICAgcE1zZ0J1ZiA9IE5VTEw7CisgICAgICAgICAgICBicmVhazsKKyNlbmRpZgorCisgICAgICAgIGNhc2UgTElNX01MTV9BVVRIX0NORjoKKyAgICAgICAgICAgIGxpbVByb2Nlc3NNbG1BdXRoQ25mKHBNYWMsIHBNc2dCdWYpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTElNX01MTV9BVVRIX0lORDoKKyAgICAgICAgICAgIGxpbVByb2Nlc3NNbG1BdXRoSW5kKHBNYWMsIHBNc2dCdWYpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTElNX01MTV9BU1NPQ19DTkY6CisgICAgICAgICAgICBsaW1Qcm9jZXNzTWxtQXNzb2NDbmYocE1hYywgcE1zZ0J1Zik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBMSU1fTUxNX1NUQVJUX0NORjoKKyAgICAgICAgICAgIGxpbVByb2Nlc3NNbG1TdGFydENuZihwTWFjLCBwTXNnQnVmKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIExJTV9NTE1fSk9JTl9DTkY6CisgICAgICAgICAgICBsaW1Qcm9jZXNzTWxtSm9pbkNuZihwTWFjLCBwTXNnQnVmKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIExJTV9NTE1fQVNTT0NfSU5EOgorICAgICAgICAgICAgIGxpbVByb2Nlc3NNbG1Bc3NvY0luZChwTWFjLCBwTXNnQnVmKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIExJTV9NTE1fUkVBU1NPQ19DTkY6CisgICAgICAgICAgICBsaW1Qcm9jZXNzTWxtUmVhc3NvY0NuZihwTWFjLCBwTXNnQnVmKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIExJTV9NTE1fUkVBU1NPQ19JTkQ6CisgICAgICAgICAgIGxpbVByb2Nlc3NNbG1SZWFzc29jSW5kKHBNYWMsIHBNc2dCdWYpOworICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBMSU1fTUxNX0RJU0FTU09DX0NORjoKKyAgICAgICAgICAgIGxpbVByb2Nlc3NNbG1EaXNhc3NvY0NuZihwTWFjLCBwTXNnQnVmKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIExJTV9NTE1fRElTQVNTT0NfSU5EOgorICAgICAgICAgICAgbGltUHJvY2Vzc01sbURpc2Fzc29jSW5kKHBNYWMsIHBNc2dCdWYpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTElNX01MTV9QVVJHRV9TVEFfSU5EOgorICAgICAgICAgICAgbGltUHJvY2Vzc01sbVB1cmdlU3RhSW5kKHBNYWMsIHBNc2dCdWYpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTElNX01MTV9ERUFVVEhfQ05GOgorICAgICAgICAgICAgbGltUHJvY2Vzc01sbURlYXV0aENuZihwTWFjLCBwTXNnQnVmKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIExJTV9NTE1fREVBVVRIX0lORDoKKyAgICAgICAgICAgIGxpbVByb2Nlc3NNbG1EZWF1dGhJbmQocE1hYywgcE1zZ0J1Zik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBMSU1fTUxNX1NFVEtFWVNfQ05GOgorICAgICAgICAgICAgbGltUHJvY2Vzc01sbVNldEtleXNDbmYocE1hYywgcE1zZ0J1Zik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBMSU1fTUxNX1JFTU9WRUtFWV9DTkY6CisgICAgICAgICAgICBsaW1Qcm9jZXNzTWxtUmVtb3ZlS2V5Q25mKHBNYWMsIHBNc2dCdWYpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTElNX01MTV9UU1BFQ19DTkY6CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBMSU1fTUxNX0FEREJBX0NORjoKKyAgICAgICAgICAgIGxpbVByb2Nlc3NNbG1BZGRCQUNuZiggcE1hYywgcE1zZ0J1ZiApOworICAgICAgICAgICAgcE1zZ0J1ZiA9IE5VTEw7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBMSU1fTUxNX0RFTEJBX0NORjoKKyAgICAgICAgICAgIGxpbVByb2Nlc3NNbG1EZWxCQUNuZiggcE1hYywgcE1zZ0J1ZiApOworICAgICAgICAgICAgcE1zZ0J1ZiA9IE5VTEw7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGJyZWFrOworICAgIH0gLy8gc3dpdGNoIChtc2dUeXBlKQorICAgIHJldHVybjsKK30gLyoqKiBlbmQgbGltUHJvY2Vzc01sbVJzcE1lc3NhZ2VzKCkgKioqLworCisvKioKKyAqIGxpbVByb2Nlc3NNbG1TY2FuQ25mKCkKKyAqCisgKkZVTkNUSU9OOgorICogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgdG8gcHJvY2Vzc2VzIE1MTV9TQ0FOX0NORgorICogbWVzc2FnZSBmcm9tIE1MTSBTdGF0ZSBtYWNoaW5lLgorICoKKyAqTE9HSUM6CisgKgorICpBU1NVTVBUSU9OUzoKKyAqCisgKk5PVEU6CisgKgorICogQHBhcmFtIHBNYWMgICAgICAgUG9pbnRlciB0byBHbG9iYWwgTUFDIHN0cnVjdHVyZQorICogQHBhcmFtIHBNc2dCdWYgICAgQSBwb2ludGVyIHRvIHRoZSBNTE0gbWVzc2FnZSBidWZmZXIKKyAqCisgKiBAcmV0dXJuIE5vbmUKKyAqLwordm9pZAorbGltUHJvY2Vzc01sbVNjYW5DbmYodHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMzIgKnBNc2dCdWYpCit7CisgICAgc3dpdGNoKHBNYWMtPmxpbS5nTGltU21lU3RhdGUpCisgICAgeworICAgICAgICBjYXNlIGVMSU1fU01FX1dUX1NDQU5fU1RBVEU6CisgICAgICAgIC8vY2FzZSBlTElNX1NNRV9MSU5LX0VTVF9XVF9TQ0FOX1NUQVRFOiAgLy9UTyBTVVBQT1JUIEJULUFNUAorICAgICAgICAvL2Nhc2UgZUxJTV9TTUVfTk9STUFMX0NIQU5ORUxfU0NBTl9TVEFURTogICAvL1RPIFNVUFBPUlQgQlQtQU1QCisgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbVNtZVN0YXRlID0gcE1hYy0+bGltLmdMaW1QcmV2U21lU3RhdGU7CisgICAgICAgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9TTUVfU1RBVEUsIE5PX1NFU1NJT04sIHBNYWMtPmxpbS5nTGltU21lU3RhdGUpKTsKKyAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltU3lzdGVtSW5TY2FuTGVhcm5Nb2RlID0gMDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBTaG91bGQgbm90IGhhdmUgcmVjZWl2ZWQgc2NhbiBjb25maXJtCisgICAgICAgICAgICAgKiBmcm9tIE1MTSBpbiBvdGhlciBzdGF0ZXMuCisgICAgICAgICAgICAgKiBMb2cgZXJyb3IKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIHVuZXhwZWN0ZWQgTUxNX1NDQU5fQ05GIGluIHN0YXRlICVkIiksCisgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbVNtZVN0YXRlKTspCisgICAgICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgLy8vIFByb2Nlc3MgcmVjZWl2ZWQgc2NhbiBjb25maXJtCisgICAgLy8vIEluY3JlbWVudCBsZW5ndGggb2YgY2FjaGVkIHNjYW4gcmVzdWx0cworICAgIHBNYWMtPmxpbS5nTGltU21lU2NhblJlc3VsdExlbmd0aCArPQorICAgICAgICAgICAgICAgICAgICAoKHRMaW1NbG1TY2FuQ25mICopIHBNc2dCdWYpLT5zY2FuUmVzdWx0TGVuZ3RoOworICAgIGlmICgocE1hYy0+bGltLmdMaW1Sc3BSZXFkKSB8fCBwTWFjLT5saW0uZ0xpbVJlcG9ydEJhY2tncm91bmRTY2FuUmVzdWx0cykKKyAgICB7CisgICAgICAgIHRBTklfVTE2ICAgIHNjYW5Sc3BMZW4gPSAwOworICAgICAgICAvLy8gTmVlZCB0byBzZW5kIHJlc3BvbnNlIHRvIEhvc3QKKyAgICAgICAgcE1hYy0+bGltLmdMaW1Sc3BSZXFkID0gZmFsc2U7CisgICAgICAgIGlmICgoKCh0TGltTWxtU2NhbkNuZiAqKSBwTXNnQnVmKS0+cmVzdWx0Q29kZSA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9TTUVfU1VDQ0VTUykgfHwKKyAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltU21lU2NhblJlc3VsdExlbmd0aCkKKyAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzY2FuUnNwTGVuID0gc2l6ZW9mKHRTaXJTbWVTY2FuUnNwKSArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbVNtZVNjYW5SZXN1bHRMZW5ndGggLQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJCc3NEZXNjcmlwdGlvbik7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBzY2FuUnNwTGVuID0gc2l6ZW9mKHRTaXJTbWVTY2FuUnNwKTsKKyAgICAgICAgfQorICAgICAgIGlmKHBNYWMtPmxpbS5nTGltUmVwb3J0QmFja2dyb3VuZFNjYW5SZXN1bHRzKQorICAgICAgICB7CisgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbUJhY2tncm91bmRTY2FuVGVybWluYXRlID0gVFJVRTsKKyAgICAgICAgfQorICAgICAgICBpZiAocE1hYy0+bGltLmdMaW1TbWVTY2FuUmVzdWx0TGVuZ3RoID09IDApCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbVNlbmRTbWVTY2FuUnNwKHBNYWMsIHNjYW5Sc3BMZW4sIGVTSVJfU01FX1NVQ0NFU1MsIHBNYWMtPmxpbS5nU21lU2Vzc2lvbklkLCBwTWFjLT5saW0uZ1RyYW5zYWN0aW9uSWQpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgbGltU2VuZFNtZVNjYW5Sc3AocE1hYywgc2NhblJzcExlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfU01FX1NVQ0NFU1MscE1hYy0+bGltLmdTbWVTZXNzaW9uSWQsIHBNYWMtPmxpbS5nVHJhbnNhY3Rpb25JZCk7CisgICAgICAgIH0KKyAgICB9IC8vIGlmIChwTWFjLT5saW0uZ0xpbVJzcFJlcWQpCisgICAgLy9jaGVjayB0byBzZWUgd2hldGhlciB3ZSBuZWVkIHRvIHJ1biBiZ1NjYW4gdGltZXIKKyAgICBpZihwTWFjLT5saW0uZ0xpbUJhY2tncm91bmRTY2FuVGVybWluYXRlID09IEZBTFNFKQorICAgIHsKKyAgICAgICAgaWYgKHR4X3RpbWVyX2FjdGl2YXRlKAorICAgICAgICAgICAgJnBNYWMtPm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gKiBpbiBvdGhlciBzdGF0ZXMuCisgICAgICAgICAqIExvZyBlcnJvcgorICAgICAgICAgKi8KKyAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICBGTCgicmVjZWl2ZWQgdW5leHBlY3RlZCBNTE1fU1RBUlRfQ05GIGluIHN0YXRlICVkIiksCisgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlKTspCisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgaWYgKCgodExpbU1sbVN0YXJ0Q25mICopIHBNc2dCdWYpLT5yZXN1bHRDb2RlID09CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfU01FX1NVQ0NFU1MpCisgICAgeworCisgICAgICAgIC8qKgorICAgICAgICAgKiBVcGRhdGUgZ2xvYmFsIFNNRSBzdGF0ZSBzbyB0aGF0IEJlYWNvbiBHZW5lcmF0aW9uCisgICAgICAgICAqIG1vZHVsZSBzdGFydHMgd3JpdGluZyBCZWFjb24gZnJhbWVzIGludG8gVEZQJ3MKKyAgICAgICAgICogQmVhY29uIGZpbGUgcmVnaXN0ZXIuCisgICAgICAgICAqLworICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSA9IGVMSU1fU01FX05PUk1BTF9TVEFURTsKKyAgICAgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfU01FX1NUQVRFLCBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwgcHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUpKTsKKyAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+YnNzVHlwZSA9PSBlU0lSX0JUQU1QX1NUQV9NT0RFKQorICAgICAgICB7CisgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCIqKiogU3RhcnRlZCBCU1MgaW4gQlRfQU1QIFNUQSBTSURFKioqIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYocHNlc3Npb25FbnRyeS0+YnNzVHlwZSA9PSBlU0lSX0JUQU1QX0FQX01PREUpCisgICAgICAgIHsKKyAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIioqKiBTdGFydGVkIEJTUyBpbiBCVF9BTVAgQVAgU0lERSoqKiIpKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmKHBzZXNzaW9uRW50cnktPmJzc1R5cGUgPT0gZVNJUl9JTkZSQV9BUF9NT0RFKQorICAgICAgICB7CisgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCIqKiogU3RhcnRlZCBCU1MgaW4gSU5GUkEgQVAgU0lERSoqKiIpKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIioqKiBTdGFydGVkIEJTUyAqKioiKSk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIC8vLyBTdGFydCBCU1MgaXMgYSBmYWlsdXJlCisgICAgICAgIHBlRGVsZXRlU2Vzc2lvbihwTWFjLHBzZXNzaW9uRW50cnkpOworICAgICAgICBwc2Vzc2lvbkVudHJ5ID0gTlVMTDsKKyAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLEZMKCJTdGFydCBCU1MgRmFpbGVkICIpKTspCisgICAgfQorICAgIC8vLyBTZW5kIHJlc3BvbnNlIHRvIEhvc3QKKyAgICBsaW1TZW5kU21lU3RhcnRCc3NSc3AocE1hYywgZVdOSV9TTUVfU1RBUlRfQlNTX1JTUCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKCh0TGltTWxtU3RhcnRDbmYgKikgcE1zZ0J1ZiktPnJlc3VsdENvZGUscHNlc3Npb25FbnRyeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgc21lc2Vzc2lvbklkLHNtZXRyYW5zYWN0aW9uSWQpOworICAgIGlmICgoKH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IGlmIChwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSA9PSBlTElNX1NNRV9XVF9BVVRIX1NUQVRFKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0FVVEhFTlRJQ0FUSU9OX1RZUEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1UzMiAqKSAmY2ZnQXV0aFR5cGUpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgKiBDb3VsZCBub3QgZ2V0IEF1dGhUeXBlIHZhbHVlIGZyb20gQ0ZHLgorICAgICAgICAgICAgICAgICAqIExvZyBlcnJvci4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBBdXRoVHlwZSB2YWx1ZSIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGNmZ0F1dGhUeXBlID0gcE1hYy0+bGltLmdMaW1QcmVBdXRoVHlwZTsKKyAgICAgICAgCisgICAgICAgIGlmICgoY2ZnQXV0aFR5cGUgPT0gZVNJUl9BVVRPX1NXSVRDSCkgJiYKKyAgICAgICAgICAgICAgICAoKCh0TGltTWxtQXV0aENuZiAqKSBwTXNnQnVmKS0+YXV0aFR5cGUgPT0gZVNJUl9PUEVOX1NZU1RFTSkKKyAgICAgICAgICAgICAgICAmJiAoZVNJUl9NQUNfQVVUSF9BTEdPX05PVF9TVVBQT1JURURfU1RBVFVTID09ICgodExpbU1sbUF1dGhDbmYgKikgcE1zZ0J1ZiktPnByb3RTdGF0dXNDb2RlKSkKKyAgICAgICAgeworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBXaGVuIE9wZW4gYXV0aGVudGljYXRpb24gZmFpbHMgd2l0aCByZWFzb24gY29kZSAiMTMiIGFuZAorICAgICAgICAgICAgICogYXV0aFR5cGUgc2V0IHRvICdhdXRvIHN3aXRjaCcsIFRyeSB3aXRoIFNoYXJlZCBBdXRoZW50aWNhdGlvbgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBhdXRoTW9kZSA9IGVTSVJfU0hBUkVEX0tFWTsKKyAgICAgICAgICAgIC8vIFRyaWdnZXIgTUFDIGJhc2VkIEF1dGhlbnRpY2F0aW9uCisgICAgICAgICAgICBwTWxtQXV0aFJlcSA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0TGltTWxtQXV0aFJlcSkpOworICAgICAgICAgICAgaWYgKCBOVUxMID09IHBNbG1BdXRoUmVxICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICBGTCgiY2FsbCB0byBBbGxvY2F0ZU1lbW9yeSBmYWlsZWQgZm9yIG1sbUF1dGhSZXEiKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdm9zX21lbV9zZXQoKHRBTklfVTggKikgcE1sbUF1dGhSZXEsIHNpemVvZih0TGltTWxtQXV0aFJlcSksIDApOworICAgICAgICAgICAgdmFsID0gc2l6ZW9mKHRTaXJNYWNBZGRyKTsKKyAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSA9PSBlTElNX1NNRV9XVF9BVVRIX1NUQVRFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNpckNvcHlNYWNBZGRyKHBNbG1BdXRoUmVxLT5wZWVyTWFjQWRkcixwc2Vzc2lvbkVudHJ5LT5ic3NJZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4ICopICZwTWxtQXV0aFJlcS0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopICZwTWFjLT5saW0uZ0xpbVByZUF1dGhQZWVyQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICAgICAgcE1sbUF1dGhSZXEtPmF1dGhUeXBlID0gYXV0aE1vZGU7CisgICAgICAgICAgICAvKiBVcGRhdGUgUEUgc2Vzc2lvbiBJZCovCisgICAgICAgICAgICBwTWxtQXV0aFJlcS0+c2Vzc2lvbklkID0gcE1sbUF1dGhDbmYtPnNlc3Npb25JZDsKKyAgICAgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0FVVEhFTlRJQ0FURV9GQUlMVVJFX1RJTUVPVVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1UzMiAqKSAmcE1sbUF1dGhSZXEtPmF1dGhGYWlsdXJlVGltZW91dCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICogQ291bGQgbm90IGdldCBBdXRoRmFpbHVyZVRpbWVvdXQgdmFsdWUgZnJvbSBDRkcuCisgICAgICAgICAgICAgICAgICogTG9nIGVycm9yLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgQXV0aEZhaWx1cmVUaW1lb3V0IHZhbHVlIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbGltUG9zdE1sbU1lc3NhZ2UocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExJTV9NTE1fQVVUSF9SRVEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VMzIgKikgcE1sbUF1dGhSZXEpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLy8gTUFDIGJhc2VkIGF1dGhlbnRpY2F0aW9uIGZhaWx1cmUKKyAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSA9PSBlTElNX1NNRV9XVF9BVVRIX1NUQVRFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkF1dGggRmFpbHVyZSBvY2N1cnJlZC4iKSk7KQorICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlID0gZUxJTV9TTUVfSk9JTl9GQUlMVVJFX1NUQVRFOworICAgICAgICAgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1NNRV9TVEFURSwgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlKSk7CisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltTWxtU3RhdGUgPSBlTElNX01MTV9JRExFX1NUQVRFOworICAgICAgICAgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX01MTV9TVEFURSwgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsIHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlKSk7CisKKyAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgKiBOZWVkIHRvIHNlbmQgSm9pbiByZXNwb25zZSB3aXRoCisgICAgICAgICAgICAgICAgICogYXV0aCBmYWlsdXJlIHRvIEhvc3QuCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgbGltSGFuZGxlU21lSm9pblJlc3VsdChwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh0TGltTWxtQXV0aENuZiAqKSBwTXNnQnVmKS0+cmVzdWx0Q29kZSwgKCh0TGltTWxtQXV0aENuZiAqKSBwTXNnQnVmKS0+cHJvdFN0YXR1c0NvZGUscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICogUHJlLWF1dGhlbnRpY2F0aW9uIGZhaWx1cmUuCisgICAgICAgICAgICAgICAgICogU2VuZCBQcmUtYXV0aCBmYWlsdXJlIHJlc3BvbnNlIHRvIGhvc3QKKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSA9IHBzZXNzaW9uRW50cnktPmxpbVByZXZTbWVTdGF0ZTsKKyAgICAgICAgICAgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9TTUVfU1RBVEUsIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLCBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSkpOworICAgICAgICAgICAgICAgIGxpbVNlbmRTbWVBdXRoUnNwKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh0TGltTWxtQXV0aENuZiAqKSBwTXNnQnVmKS0+cmVzdWx0Q29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHRMaW1NbG1BdXRoQ25mICopIHBNc2dCdWYpLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHRMaW1NbG1BdXRoQ25mICopIHBNc2dCdWYpLT5hdXRoVHlwZSwKKyAgICAgICAgICAgICAgICAg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FsbCB0byBBbGxvY2F0ZU1lbW9yeSBmYWlsZWQgZm9yIG1sbUFzc29jUmVxIikpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHZhbCA9IHNpemVvZih0U2lyTWFjQWRkcik7CisgICAgICAgICAgICAjaWYgMAorICAgICAgICAgICAgaWYgKGNmZ0dldFN0cihwTWFjLCBXTklfQ0ZHX0JTU0lELAorICAgICAgICAgICAgICAgICAgICAgICAgICBwTWxtQXNzb2NSZXEtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAmdmFsKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8vIENvdWxkIG5vdCBnZXQgQlNTSUQgZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBCU1NJRCIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgICNlbmRpZiAvL1NVUFBPUlQgQlQtQU1QCisgICAgICAgICAgICBzaXJDb3B5TWFjQWRkcihwTWxtQXNzb2NSZXEtPnBlZXJNYWNBZGRyLHBzZXNzaW9uRW50cnktPmJzc0lkKTsKKyAgICAgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0FTU09DSUFUSU9OX0ZBSUxVUkVfVElNRU9VVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTMyICopICZwTWxtQXNzb2NSZXEtPmFzc29jRmFpbHVyZVRpbWVvdXQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICogQ291bGQgbm90IGdldCBBc3NvY0ZhaWx1cmVUaW1lb3V0IHZhbHVlCisgICAgICAgICAgICAgICAgICogZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICBGTCgiY291bGQgbm90IHJldHJpZXZlIEFzc29jRmFpbHVyZVRpbWVvdXQgdmFsdWUiKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoY2ZnR2V0Q2FwYWJpbGl0eUluZm8ocE1hYywgJmNhcHMscHNlc3Npb25FbnRyeSkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAqIENvdWxkIG5vdCBnZXQgQ2FwYWJpbGl0aWVzIHZhbHVlCisgICAgICAgICAgICAgICAgICogZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBDYXBhYmlsaXRpZXMgdmFsdWUiKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvKkNsZWFyIHNwZWN0cnVtIG1hbmFnZW1lbnQgYml0IGlmIEFQIGRvZXNuJ3Qgc3VwcG9ydCBpdCovCisgICAgICAgICAgICBpZighKHBzZXNzaW9uRW50cnktPnBMaW1Kb2luUmVxLT5ic3NEZXNjcmlwdGlvbi5jYXBhYmlsaXR5SW5mbyAmIExJTV9TUEVDVFJVTV9NQU5BR0VNRU5UX0JJVF9NQVNLKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKkFQIGRvZXNuJ3Qgc3VwcG9ydCBzcGVjdHJ1bSBtYW5hZ2VtZW50IGNsZWFyIHNwZWN0cnVtIG1hbmFnZW1lbnQgYml0Ki8KKyAgICAgICAgICAgICAgICBjYXBzICY9ICh+TElNX1NQRUNUUlVNX01BTkFHRU1FTlRfQklUX01BU0spOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKiBDbGVhciBycm0gYml0IGlmIEFQIGRvZXNuJ3Qgc3VwcG9ydCBpdCAqLworICAgICAgICAgICAgaWYoIShwc2Vzc2lvbkVudHJ5LT5wTGltSm9pblJlcS0+YnNzRGVzY3JpcHRpb24uY2FwYWJpbGl0eUluZm8KKyAgICAgICAgICAgICAgICAgJiBMSU1fUlJNX0JJVF9NQVNLKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGNhcHMgJj0gKH5MSU1fUlJNX0JJVF9NQVNLKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyogQ2xlYXIgc2hvcnQgcHJlYW1ibGUgYml0IGlmIEFQIGRvZXMgbm90IHN1cHBvcnQgaXQgKi8KKyAgICAgICAgICAgIGlmKCEocHNlc3Npb25FbnRyeS0+cExpbUpvaW5SZXEtPmJzc0Rlc2NyaXB0aW9uLmNhcGFiaWxpdHlJbmZvICYKKyAgICAgICAgICAgICAgICAoTElNX1NIT1JUX1BSRUFNQkxFX0JJVF9NQVNLKSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2FwcyAmPSAofkxJTV9TSE9SVF9QUkVBTUJMRV9CSVRfTUFTSyk7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJDbGVhcmluZyBzaG9ydCBwcmVhbWJsZTpubyBBUCBzdXBwb3J0IikpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKiBDbGVhciBpbW1lZGlhdGUgYmxvY2sgYWNrIGJpdCBpZiBBUCBkb2VzIG5vdCBzdXBwb3J0IGl0ICovCisgICAgICAgICAgICBpZighKHBzZXNzaW9uRW50cnktPnBMaW1Kb2luUmVxLT5ic3NEZXNjcmlwdGlvbi5jYXBhYmlsaXR5SW5mbyAmCisgICAgICAgICAgICAgICAgKExJTV9JTU1FRElBVEVfQkxPQ0tfQUNLX01BU0spKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjYXBzICY9ICh+TElNX0lNTUVESUFURV9CTE9DS19BQ0tfTUFTSyk7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJDbGVhcmluZyBJbW1lZCBCbGsgQWNrOm5vIEFQIHN1cHBvcnQiKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHBNbG1Bc3NvY1JlcS0+Y2FwYWJpbGl0eUluZm8gPSBjYXBzOworICAgICAgICAgICBQRUxPRzMobGltTG9nKHBNYWMsIExPRzMsCisgICAgICAgICAgICAgICBGTCgiQ2FwYWJpbGl0aWVzIHRvIGJlIHVzZWQgaW4gQXNzb2NSZXE9MHglWCwgcHJpdmFjeSBiaXQ9JXggc2hvcnRTbG90VGltZSAleCIpLAorICAgICAgICAgICAgICAgY2FwcywKKyAgICAgICAgICAgICAgICgodHBTaXJNYWNDYXBhYmlsaXR5SW5mbykgJnBNbG1Bc3NvY1JlcS0+Y2FwYWJpbGl0eUluZm8pLT5wcml2YWN5LAorICAgICAgICAgICAgICAgKCh0cFNpck1hY0NhcGFiaWxpdHlJbmZvKSAmcE1sbUFzc29jUmVxLT5jYXBhYmlsaXR5SW5mbyktPnNob3J0U2xvdFRpbWUpOykKKworICAgICAgICAgICAvKiBJZiB0ZWxlc2NvcGljIGJlYWNvbmluZyBpcyBlbmFibGVkLCBzZXQgbGlzdGVuIGludGVydmFsIHRvCisgICAgICAgICAgICAgIFdOSV9DRkdfVEVMRV9CQ05fTUFYX0xJICovCisgICAgICAgICAgICBpZih3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX1RFTEVfQkNOX1dBS0VVUF9FTiwgJnRlbGVCY25FbikgIT0KKyAgICAgICAgICAgICAgIGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiQ291bGRuJ3QgZ2V0IFdOSV9DRkdfVEVMRV9CQ05fV0FLRVVQX0VOIikpOworCisgICAgICAgICAgICB2YWwgPSBXTklfQ0ZHX0xJU1RFTl9JTlRFUlZBTF9TVEFERUY7CisKKyAgICAgICAgICAgIGlmKHRlbGVCY25FbikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGlmKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfVEVMRV9CQ05fTUFYX0xJLCAmdmFsKSAhPQorICAgICAgICAgICAgICAgICAgZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgKiBDb3VsZCBub3QgZ2V0IExpc3RlbkludGVydmFsIHZhbHVlCisgICAgICAgICAgICAgICAgICAqIGZyb20gQ0ZHLiBMb2cgZXJyb3IuCisgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgTGlzdGVuSW50ZXJ2YWwiKSk7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19MSVNURU5fSU5URVJWQUwsICZ2YWwpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgKiBDb3VsZCBub3QgZ2V0IExpc3RlbkludGVydmFsIHZhbHVlCisgICAgICAgICAgICAgICAgICogZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiY291bGQgbm90IHJldHJpZXZlIExpc3RlbkludGVydmFsIikpOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBwTWxtQXNzb2NSZXEtPmxpc3RlbkludGVydmFsID0gKHRBTklfVTE2KXZhbDsKKyAgICAgICAgICAgIC8qIFVwZGF0ZSBQRSBzZXNzaW9uIElEKi8KKyAgICAgICAgICAgIHBNbG1Bc3NvY1JlcS0+c2Vzc2lvbklkID0gcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQ7CisgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1QcmV2U21lU3RhdGUgPSBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZTsKKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlICAgICA9IGVMSU1fU01FX1dUX0FTU09DX1NUQVRFOworICAgICAgICAgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfU01FX1NUQVRFLCBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwgcHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUpKTsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLExPRzEsIlNlc3Npb25JZDolZCBQb3N0TUxNTWVzc2FnZTogTElNX01MTV9BU1NPQ19SRVEiLAorICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkKTsKKyAgICAgICAgICAgIGxpbVBvc3RNbG1NZXNzYWdlKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMSU1fTUxNX0FTU09DX1JFUSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1UzMiAqKSBwTWxtQXNzb2NSZXEpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBTdWNjZXNzZnVsIFByZS1hdXRoZW50aWNhdGlvbi4KKyAgICAgICAgICAgICAqIFNlbmQgUHJlLWF1dGggcmVzcG9uc2UgdG8gaG9zdAorICAgICAgICAgICAgICov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AgICAgIHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFIHx8IHBzZXNzaW9uRW50cnkgLT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQlRfQU1QX0FQX1JPTEUpCisgICAgeworICAgICAgICAvKioKKyAgICAgICAgICogU2hvdWxkIG5vdCBoYXZlIHJlY2VpdmVkIEFzc29jaWNhdGlvbiBjb25maXJtCisgICAgICAgICAqIGZyb20gTUxNIGluIG90aGVyIHN0YXRlcyBPUiBvbiBBUC4KKyAgICAgICAgICogTG9nIGVycm9yCisgICAgICAgICAqLworICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICBGTCgiU2Vzc2lvbklkOiVkIFJlY2VpdmVkIHVuZXhwZWN0ZWQgTUxNX0FTU09DX0NORiBpbiBzdGF0ZSAlZCIpLAorICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQscHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUpOykKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBpZiAoKCh0TGltTWxtQXNzb2NDbmYgKikgcE1zZ0J1ZiktPnJlc3VsdENvZGUgIT0gZVNJUl9TTUVfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIC8vIEFzc29jaWF0aW9uIGZhaWx1cmUKKyAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICBGTCgiU2Vzc2lvbklkOiAlZCBBc3NvY2lhdGlvbiBmYWlsdXJlIHJlc3VsdENvZGU6ICVkIgorICAgICAgICAgICAgICAgICAgICJsaW1TbWVTdGF0ZTogJWQiKSwgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgKCh0TGltTWxtQXNzb2NDbmYgKikgcE1zZ0J1ZiktPnJlc3VsdENvZGUsCisgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlKTsKKworICAgICAgICAvKiBJZiBkcml2ZXIgZ2V0cyBkZWF1dGggd2hlbiBpdHMgd2FpdGluZyBmb3IgQUREX1NUQV9SU1AgdGhlbiB3ZSBuZWVkCisgICAgICAgICAqIHRvIGRvIERFTF9TVEEgZm9sbG93ZWQgYnkgREVMX0JTUy4gU28gYmFzZWQgb24gYmVsb3cgcmVhc29uLWNvZGUgaGVyZQorICAgICAgICAgKiB3ZSBkZWNpZGUgd2hldGhlciB0byBkbyBvbmx5IERFTF9CU1Mgb3IgREVMX1NUQSArIERFTF9CU1MKKyAgICAgICAgICovCisgICAgICAgIGlmKCgodExpbU1sbUFzc29jQ25mICopIHBNc2dCdWYpLT5yZXN1bHRDb2RlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gZVNJUl9TTUVfSk9JTl9ERUFVVEhfRlJPTV9BUF9EVVJJTkdfQUREX1NUQSkKKyAgICAgICAgeworICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUgPSBlTElNX1NNRV9KT0lOX0ZBSUxVUkVfU1RBVEU7CisgICAgICAgIH0KKyAgICAgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfU01FX1NUQVRFLCBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltU21lU3RhdGUpKTsKKyAgICAgICAgLyoqCisgICAgICAgICAqIE5lZWQgdG8gc2VuZCBKb2luIHJlc3BvbnNlIHdpdGgKKyAgICAgICAgICogQXNzb2NpYXRpb24gZmFpbHVyZSB0byBIb3N0LgorICAgICAgICAgKi8KKyAgICAgICAgbGltSGFuZGxlU21lSm9pblJlc3VsdChwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICgodExpbU1sbUFzc29jQ25mICopIHBNc2dCdWYpLT5yZXN1bHRDb2RlLAorICAgICAgICAgIC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wpCisgICAgeworICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgic2Vzc2lvbiBEb2VzIG5vdCBleGlzdCBmb3IgZ2l2ZW4gc2Vzc2lvbiBJZCIpKTspCisgICAgICAgICByZXR1cm47CisgICAgfQorICAgIGlmICgocHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUgIT0gZUxJTV9TTUVfV1RfUkVBU1NPQ19TVEFURSkgfHwKKyAgICAgICAgIChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQVBfUk9MRSl8fChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQlRfQU1QX0FQX1JPTEUpKQorICAgIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFNob3VsZCBub3QgaGF2ZSByZWNlaXZlZCBSZWFzc29jaWNhdGlvbiBjb25maXJtCisgICAgICAgICAqIGZyb20gTUxNIGluIG90aGVyIHN0YXRlcyBPUiBvbiBBUC4KKyAgICAgICAgICogTG9nIGVycm9yCisgICAgICAgICAqLworICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgRkwoIlJjdiB1bmV4cGVjdGVkIE1MTV9SRUFTU09DX0NORiBpbiByb2xlICVkLCBzbWUgc3RhdGUgJWQiKSwKKyAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlLCBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSk7KQorICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgaWYgKHBzZXNzaW9uRW50cnktPnBMaW1SZUFzc29jUmVxKSB7CisgICAgICAgIHZvc19tZW1fZnJlZShwc2Vzc2lvbkVudHJ5LT5wTGltUmVBc3NvY1JlcSk7CisgICAgICAgIHBzZXNzaW9uRW50cnktPnBMaW1SZUFzc29jUmVxID0gTlVMTDsKKyAgIC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TspCisgICAgaWYgKHBMaW1NbG1SZWFzc29jQ25mLT5yZXN1bHRDb2RlID09IGVTSVJfU01FX1NVQ0NFU1MpIHsKKyAgICAgICAgLy8gU3VjY2Vzc2Z1bCBSZWFzc29jaWF0aW9uCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiKioqIFJlYXNzb2NpYXRlZCB3aXRoIG5ldyBCU1MgKioqIikpOworCisgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlID0gZUxJTV9TTUVfTElOS19FU1RfU1RBVEU7CisgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1NNRV9TVEFURSwgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlKSk7CisKKyAgICAgICAgLyoqCisgICAgICAgICogTmVlZCB0byBzZW5kIFJlYXNzb2MgcmVzcG9uc2Ugd2l0aAorICAgICAgICAqIFJlYXNzb2NpYXRpb24gc3VjY2VzcyB0byBIb3N0LgorICAgICAgICAqLworICAgICAgICBsaW1TZW5kU21lSm9pblJlYXNzb2NSc3AoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYywgZVdOSV9TTUVfUkVBU1NPQ19SU1AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTGltTWxtUmVhc3NvY0NuZi0+cmVzdWx0Q29kZSwgcExpbU1sbVJlYXNzb2NDbmYtPnByb3RTdGF0dXNDb2RlLHBzZXNzaW9uRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5zbWVTZXNzaW9uSWQscHNlc3Npb25FbnRyeS0+dHJhbnNhY3Rpb25JZCk7CisgICAgfWVsc2UgaWYgKHBMaW1NbG1SZWFzc29jQ25mLT5yZXN1bHRDb2RlID09IGVTSVJfU01FX1JFQVNTT0NfUkVGVVNFRCkgeworICAgICAgICAvKiogUmVhc3NvY2lhdGlvbiBmYWlsdXJlIFdpdGggdGhlIE5ldyBBUAorICAgICAgICAqICAgYnV0IHdlIHN0aWxsIGhhdmUgdGhlIGxpbmsgd2l0aCB0aGUgT2xkZXIgQVAKKyAgICAgICAgKi8KKyAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUgPSBlTElNX1NNRV9MSU5LX0VTVF9TVEFURTsKKyAgICAgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfU01FX1NUQVRFLCBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwgcHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUpKTsKKworICAgICAgICAvKioKKyAgICAgICAgKiBOZWVkIHRvIHNlbmQgUmVhc3NvYyByZXNwb25zZSB3aXRoCisgICAgICAgICogQXNzb2NpYXRpb24gZmFpbHVyZSB0byBIb3N0LgorICAgICAgICAqLworICAgICAgICBsaW1TZW5kU21lSm9pblJlYXNzb2NSc3AocE1hYywgZVdOSV9TTUVfUkVBU1NPQ19SU1AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTGltTWxtUmVhc3NvY0NuZi0+cmVzdWx0Q29kZSwgcExpbU1sbVJlYXNzb2NDbmYtPnByb3RTdGF0dXNDb2RlLHBzZXNzaW9uRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5zbWVTZXNzaW9uSWQscHNlc3Npb25FbnRyeS0+dHJhbnNhY3Rpb25JZCk7CisgICAgfWVsc2UgeworICAgICAgICAvKiBJZiBkcml2ZXIgZ2V0cyBkZWF1dGggd2hlbiBpdHMgd2FpdGluZyBmb3IgQUREX1NUQV9SU1AgdGhlbiB3ZSBuZWVkCisgICAgICAgICogdG8gZG8gREVMX1NUQSBmb2xsb3dlZCBieSBERUxfQlNTLiBTbyBiYXNlZCBvbiBiZWxvdyByZWFzb24tY29kZSBoZXJlCisgICAgICAgICogd2UgZG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HRTaXJTbWVBdXRoSW5kICAgICAqcFNpclNtZUF1dGhJbmQ7CisKKyAgICBpZihwTXNnQnVmID09IE5VTEwpCisgICAgeworICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsRkwoIkJ1ZmZlciBpcyBQb2ludGluZyB0byBOVUxMIikpOykKKyAgICAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBwU2lyU21lQXV0aEluZCA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0U2lyU21lQXV0aEluZCkpOworICAgIGlmICggTlVMTCA9PSBwU2lyU21lQXV0aEluZCApCisgICAgeworICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgIEZMKCJjYWxsIHRvIEFsbG9jYXRlTWVtb3J5IGZhaWxlZCBmb3IgZVdOSV9TTUVfQVVUSF9JTkQiKSk7CisgICAgfQorICAgIGxpbUNvcHlVMTYoKHRBTklfVTggKikgJnBTaXJTbWVBdXRoSW5kLT5tZXNzYWdlVHlwZSwgZVdOSV9TTUVfQVVUSF9JTkQpOworICAgIGxpbUF1dGhJbmRTZXJEZXMocE1hYywgKHRwTGltTWxtQXV0aEluZCkgcE1zZ0J1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopICYocFNpclNtZUF1dGhJbmQtPmxlbmd0aCkpOworICAgIG1zZ1EudHlwZSA9IGVXTklfU01FX0FVVEhfSU5EOworICAgIG1zZ1EuYm9keXB0ciA9IHBTaXJTbWVBdXRoSW5kOworICAgIG1zZ1EuYm9keXZhbCA9IDA7CisgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfVFhfU01FX01TRywgTk9fU0VTU0lPTiwgbXNnUS50eXBlKSk7CisjaWZkZWYgRkVBVFVSRV9XTEFOX0RJQUdfU1VQUE9SVF9MSU0gLy9GRUFUVVJFX1dMQU5fRElBR19TVVBQT1JUCisgICAgbGltRGlh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3lzdGVtUm9sZSkKKyAgICB7CisgICAgICAgIGNhc2UgZUxJTV9TVEFfSU5fSUJTU19ST0xFOgorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZUxJTV9TVEFfUk9MRToKKyAgICAgICAgY2FzZSBlTElNX0JUX0FNUF9TVEFfUk9MRToKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUgPSBlTElNX1NNRV9XVF9ESVNBU1NPQ19TVEFURTsKKyAgICAgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1NNRV9TVEFURSwgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDogLy8gZUxJTV9BUF9ST0xFIC8vZUxJTV9CVF9BTVBfQVBfUk9MRQorICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgICAgICAgICBGTCgiKioqIFBlZXIgc3RhSWQgPSAlZCBEaXNhc3NvY2lhdGVkICoqKiIpLAorICAgICAgICAgICAgICAgICAgICAgICAgcE1sbURpc2Fzc29jSW5kLT5haWQpOworICAgICAgICAgICAgLy8gU2VuZCBTTUVfRElTQVNPQ19JTkQgYWZ0ZXIgUG9sYXJpcyBjbGVhbnVwCisgICAgICAgICAgICAvLyAoYWZ0ZXIgcmVjZWl2aW5nIExJTV9NTE1fUFVSR0VfU1RBX0lORCkKKyAgICAgICAgICAgIGJyZWFrOworICAgIH0gLy8gZW5kIHN3aXRjaCAocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSkKK30gLyoqKiBlbmQgbGltUHJvY2Vzc01sbURpc2Fzc29jSW5kKCkgKioqLworCisvKioKKyAqIGxpbVByb2Nlc3NNbG1EaXNhc3NvY0NuZigpCisgKgorICpGVU5DVElPTjoKKyAqIFRoaXMgZ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KKyAgICAgICAgICAgICAgICAgIGVMSU1fTElOS19NT05JVE9SSU5HX0RJU0FTU09DKSA/CisgICAgICAgICAgICAgICAgIGVTSVJfU01FX0xPU1RfTElOS19XSVRIX1BFRVJfUkVTVUxUX0NPREUgOgorICAgICAgICAgICAgICAgICBwTWxtRGlzYXNzb2NDbmYtPnJlc3VsdENvZGU7CisgICAgaWYgKChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fU1RBX1JPTEUpfHwgKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9CVF9BTVBfU1RBX1JPTEUpKQorICAgIHsKKyAgICAgICAgLy8gRGlzYXNzb2NpYXRlIENvbmZpcm0gZnJvbSBNTE0KKyAgICAgICAgaWYgKCAocHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUgIT0gZUxJTV9TTUVfV1RfRElTQVNTT0NfU1RBVEUpICYmCisgICAgICAgICAgICAgKHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlICE9IGVMSU1fU01FX1dUX0RFQVVUSF9TVEFURSkgKQorICAgICAgICB7CisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFNob3VsZCBub3QgaGF2ZSByZWNlaXZlZAorICAgICAgICAgICAgICogRGlzYXNzb2NhdGUgY29uZmlybQorICAgICAgICAgICAgICogZnJvbSBNTE0gaW4gb3RoZXIgc3RhdGVzLgorICAgICAgICAgICAgICogTG9nIGVycm9yCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCB1bmV4cGVjdGVkIE1MTV9ESVNBU1NPQ19DTkYgaW4gc3RhdGUgJWQiKSxwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSk7KQorICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGlmIChwTWFjLT5saW0uZ0xpbVJzcFJlcWQpCisgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbVJzcFJlcWQgPSBmYWxzZTsKKyAgICAgICAgaWYgKHBNbG1EaXNhc3NvY0NuZi0+ZGlzYXNzb2NUcmlnZ2VyID09CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlTElNX1BST01JU0NVT1VTX01PREVfRElTQVNTT0MpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChwTWxtRGlzYXNzb2NDbmYtPnJlc3VsdENvZGUgIT0gZVNJUl9TTUVfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSA9IHBzZXNzaW9uRW50cnktPmxpbVByZXZTbWVTdGF0ZTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSA9IGVMSU1fU01FX09GRkxJTkVfU1RBVEU7CisgICAgICAgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9TTUVfU1RBVEUsIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLCBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSkpOworICAgICAgICAgICAgLy8gU2VuZCBQcm9taXNjdW91cyBtb2RlIHJlc3BvbnNlIHRvIGhvc3QKKyAgICAgICAgICAgIGxpbVNlbmRTbWVQcm9taXNjdW91c01vZGVSc3AocE1hYyk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBpZiAocE1sbURpc2Fzc29jQ25mLT5yZXN1bHRDb2RlICE9IGVTSVJfU01FX1NVQ0NFU1MpCisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUgPSBwc2Vzc2lvbkVudHJ5LT5saW1QcmV2U21lU3RhdGU7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUgPSBlTElNX1NNRV9JRExFX1NUQVRFOworICAgICAgICAgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfU01FX1NUQVRFLCBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwgcHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUpKTsKKyAgICAgICAgICAgIGxpbVNlbmRTbWVEaXNhc3NvY050ZihwTWFjLCBwTWxtRGlzYXNzb2NDbmYtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdENvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1sbURpc2Fzc29jQ25mLT5kaXNhc3NvY1RyaWdnZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1sbURpc2Fzc29jQ25mLT5haWQscHNlc3Npb25FbnRyeS0+c21lU2Vzc2lvbklkLHBzZXNzaW9uRW50cnktPnRyYW5zYWN0aW9uSWQscHNlc3Npb25FbnRyeSk7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAgKCAocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0FQX1JPTEUpfHwgKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9CVF9BTVBfQVBfUk9MRSkgKQorICAgIHsKKyAgICAgICAgbGltU2VuZFNtZURpc2Fzc29jTnRmKHBNYWMsIHBNbG1EaXNhc3NvY0NuZi0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHRDb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1sbURpc2Fzc29jQ25mLT5kaXNhc3NvY1RyaWdnZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWxtRGlzYXNzb2NDbmYtPmFpZCxwc2V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TE9HRSxGTCgic2Vzc2lvbiBkb2VzIG5vdCBleGlzdCBmb3IgQWRkcjoiIE1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBNbG1EZWF1dGhJbmQtPnBlZXJNYWNBZGRyKSk7KQorICAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBzd2l0Y2ggKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUpCisgICAgeworICAgICAgICBjYXNlIGVMSU1fU1RBX0lOX0lCU1NfUk9MRToKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVMSU1fU1RBX1JPTEU6CisgICAgICAgIGNhc2UgZUxJTV9CVF9BTVBfU1RBX1JPTEU6CisgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSA9IGVMSU1fU01FX1dUX0RFQVVUSF9TVEFURTsKKyAgICAgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1NNRV9TVEFURSwgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlKSk7CisKKyAgICAgICAgZGVmYXVsdDogLy8gZUxJTV9BUF9ST0xFCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgICAgRkwoIioqKiBSZWNlaXZlZCBEZWF1dGhlbnRpY2F0aW9uIGZyb20gc3RhSWQ9JWQgKioqIiksCisgICAgICAgICAgICAgICAgICAgcE1sbURlYXV0aEluZC0+YWlkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIFNlbmQgU01FX0RFQVVUSF9JTkQgYWZ0ZXIgUG9sYXJpcyBjbGVhbnVwCisgICAgICAgICAgICAvLyAoYWZ0ZXIgcmVjZWl2aW5nIExJTV9NTE1fUFVSR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vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSAhPSBlTElNX1NNRV9XVF9ERUFVVEhfU1RBVEUpKQorICAgICAgICB7CisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFNob3VsZCBub3QgaGF2ZSByZWNlaXZlZCBEZWF1dGggY29uZmlybQorICAgICAgICAgICAgICogZnJvbSBNTE0gaW4gb3RoZXIgc3RhdGVzLgorICAgICAgICAgICAgICogTG9nIGVycm9yCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCB1bmV4cGVjdGVkIE1MTV9ERUFVVEhfQ05GIGluIHN0YXRlICVkIiksCisgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSk7KQorICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGlmIChwTWxtRGVhdXRoQ25mLT5yZXN1bHRDb2RlID09IGVTSVJfU01FX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlID0gZUxJTV9TTUVfSURMRV9TVEFURTsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgICAgIEZMKCIqKiogRGVhdXRoZW50aWNhdGVkIHdpdGggQlNTICoqKiIpKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSA9IHBzZXNzaW9uRW50cnktPmxpbVByZXZTbWVTdGF0ZTsKKyAgICAgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfU01FX1NUQVRFLCBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwgcHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUpKTsKKworICAgICAgICBp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gaWYgKChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fU1RBX1JPTEUpICYmCisgICAgICAgICAgICAgICAgKHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlICE9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlTElNX1NNRV9XVF9ESVNBU1NPQ19TVEFURSkgJiYKKyAgICAgICAgICAgICAgICAocHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUgIT0gZUxJTV9TTUVfV1RfREVBVVRIX1NUQVRFKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgKiBTaG91bGQgbm90IGhhdmUgcmVjZWl2ZWQKKyAgICAgICAgICAgICAgICAgKiBQdXJnZSBTVEEgaW5kaWNhdGlvbgorICAgICAgICAgICAgICAgICAqIGZyb20gTUxNIGluIG90aGVyIHN0YXRlcy4KKyAgICAgICAgICAgICAgICAgKiBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIHVuZXhwZWN0ZWQgTUxNX1BVUkdFX1NUQV9JTkQgaW4gc3RhdGUgJWQiKSwKKyAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSk7KQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgUEVMT0cxKGxpbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgRkwoIioqKiBQb2xhcmlzIGNsZWFudXAgY29tcGxldGVkIGZvciBzdGFJZD0lZCAqKioiKSwKKyAgICAgICAgICAgICAgIHBNbG1QdXJnZVN0YUluZC0+YWlkKTspCisgICAgICAgICAgICBpZiAoKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9TVEFfUk9MRSl8fChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQlRfQU1QX1NUQV9ST0xFKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSA9IGVMSU1fU01FX0lETEVfU1RBVEU7CisgICAgICAgICAgICAgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfU01FX1NUQVRFLCBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwgcHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUpKTsKKworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHBNbG1QdXJnZVN0YUluZC0+cHVyZ2VUcmlnZ2VyID09IGVMSU1fUEVFUl9FTlRJVFlfREVBVVRIKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbVNlbmRTbWVEZWF1dGhOdGYocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWxtUHVyZ2VTdGFJbmQtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdENvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1sbVB1cmdlU3RhSW5kLT5wdXJnZVRyaWdnZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1sbVB1cmdlU3RhSW5kLT5haWQscHNlc3Npb25FbnRyeS0+c21lU2Vzc2lvbklkLHBzZXNzaW9uRW50cnktPnRyYW5zYWN0aW9uSWQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGxpbVNlbmRTbWVEaXNhc3NvY050ZihwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1sbVB1cmdlU3RhSW5kLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg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nN0YWxsZWQgPSAxOworICAgICAgICBpZiAoKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFKSB8fAorICAgICAgICAgICAgKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9CVF9BTVBfQVBfUk9MRSkpIHsKKyAgICAgICAgICAgIHBTdGFEcyA9IGRwaExvb2t1cEhhc2hFbnRyeShwTWFjLCBwTWxtU2V0S2V5c0NuZi0+cGVlck1hY0FkZHIsICZhaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUpOworICAgICAgICAgICAgaWYgKHBTdGFEcyAhPSBOVUxMKQorICAgICAgICAgICAgICAgIHBTdGFEcy0+aXNLZXlJbnN0YWxsZWQgPSAxOworICAgICAgICB9CisgICAgfQorICAgIGxpbVNlbmRTbWVTZXRDb250ZXh0UnNwKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1sbVNldEtleXNDbmYtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRTaXJSZXN1bHRDb2RlcykgcE1sbVNldEtleXNDbmYtPnJlc3VsdENvZGUscHNlc3Npb25FbnRyeSxwc2Vzc2lvbkVudHJ5LT5zbWVTZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+dHJhbnNhY3Rpb25JZCk7Cit9IC8qKiogZW5kIGxpbVByb2Nlc3NNbG1TZXRLZXlzQ25mKCkgKioqLworLyoqCisgKiBsaW1Qcm9jZXNzTWxtUmVtb3ZlS2V5Q25mKCkKKyAqCisgKkZVTkNUSU9OOgorICogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgdG8gcHJvY2Vzc2VzIE1MTV9SRU1PVkVLRVlfQ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TWFjLCBwU3RhRHMsIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgLyogQ2xlYW51cCBpZiBhZGQgYnNzIGZhaWxlZCAqLworICAgICAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+YWRkQnNzZmFpbGVkKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBkcGhEZWxldGVIYXNoRW50cnkocE1hYywgcFN0YURzLT5zdGFBZGRyLCBwU3RhRHMtPmFzc29jSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsKKyAgICAgICAgICAgICAgZ290byBlcnJvcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgIH0KK2Vycm9yOgorICAgIC8vRGVsZXRlIHRlaCBzZXNzaW9uIGlmIFJFQVNTT0MgZmFpbHVyZSBvY2N1cnJlZC4KKyAgICBpZihyZXN1bHRDb2RlICE9IGVTSVJfU01FX1NVQ0NFU1MpCisgICAgeworICAgICAgICBpZihOVUxMICE9IHBzZXNzaW9uRW50cnkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBlRGVsZXRlU2Vzc2lvbihwTWFjLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgcHNlc3Npb25FbnRyeSA9IE5VTEw7CisgICAgICAgIH0KKyAgICB9CisgICAgbGltU2VuZFNtZUpvaW5SZWFzc29jUnNwKHBNYWMsIGVXTklfU01FX1JFQVNTT0NfUlNQLCByZXN1bHRDb2RlLCBwcm90U3RhdHVzQ29kZSxwc2Vzc2lvbkVudHJ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21lc2Vzc2lvbklkLCAgc21ldHJhbnNhY3Rpb25JZCk7Cit9IC8qKiogZW5kIGxpbUhhbmRsZVNtZVJlYXNzb2NSZXN1bHQoKSAqKiovCisKKy8qKgorICAqIGxpbVByb2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X0pPSU5fREVBVVRIX0ZST01fQVBfRFVSSU5HX0FERF9TVEE7CisgICAgICAgICAgbWxtQXNzb2NDbmYucHJvdFN0YXR1c0NvZGUgPSBlU0lSX01BQ19VTlNQRUNfRkFJTFVSRV9TVEFUVVM7CisgICAgICAgICAgcHNlc3Npb25FbnRyeS0+c3RhSWQgPSBwQWRkU3RhUGFyYW1zLT5zdGFJZHg7CisgICAgICAgICAgZ290byBlbmQ7CisgICAgICB9CisgICAgfQorCisgICAgaWYgKCBlSEFMX1NUQVRVU19TVUNDRVNTID09IHBBZGRTdGFQYXJhbXMtPnN0YXR1cyApCisgICAgeworICAgICAgICBpZiAoIGVMSU1fTUxNX1dUX0FERF9TVEFfUlNQX1NUQVRFICE9IHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlKQorICAgICAgICB7CisgICAgICAgICAgICAvL1RPRE86IGFueSByZXNwb25zZSB0byBiZSBzZW50IG91dCBoZXJlID8KKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICBGTCggIlJlY2VpdmVkIHVuZXhwZWN0ZWQgV0RBX0FERF9TVEFfUlNQIGluIHN0YXRlICVkIiApLAorICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlKTsKKyAgICAgICAgICAgIG1sbUFzc29jQ25mLnJlc3VsdENvZGUgPSAodFNpclJlc3VsdENvZGVzKSBlU0lSX1NNRV9SRUZVU0VEOworICAgICAgICAgICAgZ290byBlbmQ7CisgICAgICAgIH0KKworICAgICAgICBpZihwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSA9PSBlTElNX1NNRV9XVF9SRUFTU09DX1NUQVRFKQorICAgICAgICAgICAgICBtZXNnVHlwZSA9IExJTV9NTE1fUkVBU1NPQ19DTkY7CisgICAgICAgIC8vCisgICAgICAgIC8vIFVwZGF0ZSB0aGUgRFBIIEhhc2ggRW50cnkgZm9yIHRoaXMgU1RBCisgICAgIC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isgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPm1sbVN0YUNvbnRleHQubWxtU3RhdGUpOykKKyAgICAgICAgICAgIHN0YXR1c0NvZGUgPSBlU0lSX1NNRV9SRUZVU0VEOworICAgICAgICAgICAgZ290byBlbmQ7CisgICAgICAgIH0KKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0cxLCBGTCgiU1RBIEFzc29jSUQgJWQgTUFDICIpLCBwU3RhRHMtPmFzc29jSWQgKTsKKyAgICAgICAgbGltUHJpbnRNYWNBZGRyKHBNYWMsIHBTdGFEcy0+c3RhQWRkciwgTE9HMSk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIC8qIElmIERlbEJTUyByZXNwb25zZSBpcyBmYWlsdXJlLCBnbyBhaGVhZCBhbmQKKyAgICAgICAgICogcG9zdCByZXNwb25zZSB0byBTTUUKKyAgICAgICAgICovCisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoICJERUwgQlNTIGZhaWxlZCEgU3RhdHVzOiVkIiApLAorICAgICAgICAgICAgICAgIHBEZWxCc3NQYXJhbXMtPnN0YXR1cyApOworICAgICAgICBzdGF0dXNDb2RlID0gZVNJUl9TTUVfUkVGVVNFRDsKKyAgICB9CisKK2VuZDoKKyAgICAgaWYoIDAgIT0gbGltTXNnUS0+Ym9keXB0ciApCisgICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBEZWxCc3NQYXJhbXMpOworICAgICAgICBsaW1Nc2dRLT5ib2R5cHRyID0gTlVMTDsKKyAgICAgfQorICAgIGlmKHBTdGFEcyA9PSBOVUxMKQorICAgICAgICAgIHJldHVybjsKKyAgICBpZiAoICgocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSAgPT0gZUxJTV9TVEFfUk9MRSkgfHwgKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgID09IGVMSU1fQlRfQU1QX1NUQV9ST0xFKSkgJiYKKyAgICAgICAg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lcyBmb3Igc3RhSWQgJWQgYXNzb2NJZCAlZCAiICksCisgICAgICAgICAgICAgICBsaW1NbG1TdGF0ZVN0cihwU3RhRHMtPm1sbVN0YUNvbnRleHQubWxtU3RhdGUpLCBwU3RhRHMtPnN0YUluZGV4LCBwU3RhRHMtPmFzc29jSWQpOworICAgICAgICAgICAgc3RhdHVzQ29kZSA9IGVTSVJfU01FX1JFRlVTRUQ7CisgICAgICAgICAgICBnb3RvIGVuZDsKKyAgICAgICAgfQorCisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HMSwKKyAgICAgICAgICAgIEZMKCJEZWxldGVkIFNUQSBBc3NvY0lEICVkIHN0YUlkICVkIE1BQyAiKSwKKyAgICAgICAgICAgIHBTdGFEcy0+YXNzb2NJZCwgcFN0YURzLT5zdGFJbmRleCk7CisgICAgICAgIGxpbVByaW50TWFjQWRkcihwTWFjLCBwU3RhRHMtPnN0YUFkZHIsIExPRzEpOworICAgICAgIGlmKGVMSU1fTUxNX1dUX0FTU09DX0RFTF9TVEFfUlNQX1NUQVRFID09IHBTdGFEcy0+bWxtU3RhQ29udGV4dC5tbG1TdGF0ZSkKKyAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocERlbFN0YVBhcmFtcyk7CisgICAgICAgICAgICBsaW1Nc2dRLT5ib2R5cHRyID0gTlVMTDsKKyAgICAgICAgICAgIGlmIChsaW1BZGRTdGEocE1hYywgcFN0YURzLCBmYWxzZSwgcHNlc3Npb25FbnRyeSkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCBBZGQgU1RBIHdpdGggYXNzb2NJZD0lZCIpLAorICAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPmFzc29jSWQpOykKKyAgICAgICAgICAgICAgLy8gZGVsZXRlIHRoZSBUUyBpZiBpdCBoYXMgYWxyZWFkeSBiZWVuIGFkZGVkLgorICAgICAgICAgICAgICAgLy8gc2VuZCB0aGUgcmVzcG9uc2Ugd2l0aCBlcnJvciBzdGF0dXMuCisgICAgICAgICAgICAgICAgaWYocFN0YURzLT5xb3MuYWRkdHNQcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHRwTGltVHNwZWNJbmZvIHBUc3BlY0luZm87CisgICAgICAgICAgICAgICAgICBpZihlU0lSX1NVQ0NFU1MgPT0gbGltVHNwZWNGaW5kQnlBc3NvY0lkKHBNYWMsIHBTdGFEcy0+YXNzb2NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFN0YURzLT5xb3MuYWRkdHMudHNwZWMsICZwTWFjLT5saW0udHNwZWNJbmZvWzBdLCAmcFRzcGVjSW5mbykpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGxpbUFkbWl0Q29udHJvbERlbGV0ZVRTKHBNYWMsIHBTdGFEcy0+YXNzb2NJZCwgJnBTdGFEcy0+cW9zLmFkZHRzLnRzcGVjLnRzaW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsICZwVHNwZWNJbmZvLT5pZHgpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBsaW1SZWplY3RBc3NvY2lhdGlvbihwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+c3RhQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPm1sbVN0YUNvbnRleHQuc3ViVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0cnVlLCBwU3RhRHMtPm1sbVN0YUNvbnRleHQuYXV0aFR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5hc3NvY0lkLCB0cnVlLAorICA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5IEhBTCkgZm9yIHRoZSBCU1MgZW50cnkgaXMgc3RvcmVkIGhlcmUKKyAgICAgICAgICAgIHBTdGFEcy0+c3RhSW5kZXggPSBwQWRkQnNzUGFyYW1zLT5zdGFDb250ZXh0LnN0YUlkeDsKKyAgICAgICAgICAgIC8vIFRyaWdnZXIgQXV0aGVudGljYXRpb24gd2l0aCBBUAorICAgICAgICAgICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfQVVUSEVOVElDQVRJT05fVFlQRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTMyICopICZjZmdBdXRoVHlwZSkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAqIENvdWxkIG5vdCBnZXQgQXV0aFR5cGUgZnJvbSBDRkcuCisgICAgICAgICAgICAgICAgICogTG9nIGVycm9yLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgICAgICBGTCgiY291bGQgbm90IHJldHJpZXZlIEF1dGhUeXBlIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGNmZ0F1dGhUeXBlID09IGVTSVJfQVVUT19TV0lUQ0gpIAorICAgICAgICAgICAgICAgIGF1dGhNb2RlID0gZVNJUl9PUEVOX1NZU1RFTTsgLy8gVHJ5IE9wZW4gQXV0aGVudGljYXRpb24gZmlyc3QKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBhdXRoTW9kZSA9IGNmZ0F1dGhUeXBlOworCisgICAgICAgICAgICAvLyBUcmlnZ2VyIE1BQyBiYXNlZCBBdXRoZW50aWNhdGlvbgorICAgICAgICAgICAgcE1sbUF1dGhSZXEgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodExpbU1sbUF1dGhSZXEpKTsKKyAgICAgICAgICAgIGlmICggTlVMTCA9PSBwTWxtQXV0aFJlcSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJjYWxsIHRvIEFsbG9jYXRlTWVtb3J5IGZhaWxlZCBmb3IgbWxtQXV0aFJlcSIpKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICAjaWYgMAorICAgICAgICAgICAgdmFsID0gc2l6ZW9mKHRTaXJNYWNBZGRyKTsKKyAgICAgICAgICAgIGlmICh3bGFuX2NmZ0dldFN0cihwTWFjLCBXTklfQ0ZHX0JTU0lELAorICAgICAgICAgICAgICAgICAgICAgICAgICBwTWxtQXV0aFJlcS0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICZ2YWwpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLy8gQ291bGQgbm90IGdldCBCU1NJRCBmcm9tIENGRy4gTG9nIGVycm9yLgorICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiY291bGQgbm90IHJldHJpZXZlIEJTU0lEIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgI2VuZGlmIC8vVE8gU1VQUE9SVCBCVC1BTVAKKyAgICAgICAgICAgIHNpckNvcHlNYWNBZGRyKHBNbG1BdXRoUmVxLT5wZWVyTWFjQWRkcixwc2Vzc2lvbkVudHJ5LT5ic3NJZCk7CisKKyAgICAgICAgICAgIHBNbG1BdXRoUmVxLT5hdXRoVHlwZSA9IGF1dGhNb2RlOworICAgICAgICAgICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfQVVUSEVOVElDQVRFX0ZBSUxVUkVfVElNRU9VVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTMyICopICZwTWxtQXV0aFJlcS0+YXV0aEZhaWx1cmVUaW1lb3V0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICogQ291bGQgbm90IGdldCBBdXRoRmFpbHVyZVRpbWVvdXQKKyAgICAgICAgICAgICAgICAgKiB2YWx1ZSBmcm9tIENGRy4gTG9nIGVycm9yLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgQXV0aEZhaWx1cmVUaW1lb3V0IHZhbHVlIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gU1VOSVRfRklYX01FOiAgU2V0IEJPVEg/IEFzc3VtZSBub3QuIFBsZWFzZSB2ZXJpZnkgaGVyZSBhbmQgYmVsb3cuCisgICAgICAgICAgICAvL3BNYWMtPmxpbS5nTGltTWxtU3RhdGUgPSBlTElNX01MTV9KT0lORURfU1RBVEU7CisgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSA9IGVMSU1fTUxNX0pPSU5FRF9TVEFURTsKKyAgICAgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX01MTV9TVEFURSwgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsIGVMSU1fTUxNX0pPSU5FRF9TVEFURSkpOworICAgICAgICAgICAgcE1sbUF1dGhSZXEtPnNlc3Npb25JZCA9IHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkOworICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltUHJldlNtZVN0YXRlID0gcHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGU7CisgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSAgICAgPSBlTElNX1NNRV9XVF9BVVRIX1NUQVRFOworICAgICAgICAgICAgLy8gcmVtZW1iZXIgc3RhSWQgaW4gY2FzZSBvZiBhc3NvYyB0aW1lb3V0L2ZhaWx1cmUgaGFuZGxpbmcKKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnN0YUlkID0gcEFkZEJzc1BhcmFtcy0+c3RhQ29udGV4dC5zdGFJZHg7CisKKyAgICAgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1NNRV9TVEFURSwKKyAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLCBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSkpOworICAgICAgICAgICAgbGltTG9nKHBNYWMsTE9HMSwiU2Vzc2lvbklkOiVkIGxpbVBvc3RNbG1NZXNzYWdlIExJTV9NTE1fQVVUSF9SRVEiCisgICAgICAgICAgICAgICAid2l0aCBsaW1TbWVTdGF0ZTolZCIscHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUpOworICAgICAgICAgICAgbGltUG9zdE1sbU1lc3NhZ2UocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExJTV9NTE1fQVVUSF9SRVEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VMzIgKikgcE1sbUF1dGhSZXEpOworICAgICAgICAgICAgcmV0dXJuOworICAgIH0KKworam9pbkZhaWx1cmU6CisgICAgeworICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSA9IGVMSU1fU01FX0pPSU5fRkFJTFVSRV9TVEFURTsKKyAgICAgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfU01FX1NUQVRFLCBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwgcHNlc3Npb25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5LT5saW1TbWVTdGF0ZSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKCBlTElNX01MTV9XVF9BRERfQlNTX1JTUF9TVEFURSAhPSBwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gTWVzZyByZWNlaXZlZCBmcm9tIEhBTCBpbiBJbnZhbGlkIHN0YXRlIQorICAgICAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSxGTCggIlNlc3Npb25JZDolZCBSZWNlaXZlZCB1bmV4cGVjdGVkIgorICAgICAgICAgICAgICAgICJXREFfQUREX0JTU19SU1AgaW4gc3RhdGUgJWQiICksCisgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlKTsKKyAgICAgICAgICAgICAgICBtbG1TdGFydENuZi5yZXN1bHRDb2RlID0gZVNJUl9TTUVfQlNTX0FMUkVBRFlfU1RBUlRFRF9PUl9KT0lORUQ7CisgICAgICAgICAgICAgICAgaWYoIDAgIT0gbGltTXNnUS0+Ym9keXB0ciApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX3plcm8ocEFkZEJzc1BhcmFtcywgc2l6ZW9mKHRBZGRCc3NQYXJhbXMpKTsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBBZGRCc3NQYXJhbXMpOworICAgICAgICAgICAgICAgICAgICBsaW1Nc2dRLT5ib2R5cHRyID0gTlVMTDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbGltUG9zdFNtZU1lc3NhZ2UoIHBNYWMsIExJTV9NTE1fU1RBUlRfQ05GLCAodEFOSV9VMzIgKikgJm1sbVN0YXJ0Q25mICk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmICgocHNlc3Npb25FbnRyeS0+YnNzVHlwZ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CisgICAgdm9zX21lbV9mcmVlKGxpbU1zZ1EtPmJvZHlwdHIpOworICAgIGxpbU1zZ1EtPmJvZHlwdHIgPSBOVUxMOworICAgIC8vIFJlc3RvcmUgTUxNRSBzdGF0ZQorICAgIHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlID0gcHNlc3Npb25FbnRyeS0+bGltUHJldk1sbVN0YXRlOworICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX01MTV9TVEFURSwgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsIHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlKSk7CisgICAgaWYoIHJlc3BSZXFkICkKKyAgICB7CisgICAgICAgIHRwTGltTWxtU2V0S2V5c1JlcSBscExpbU1sbVNldEtleXNSZXEgPSAodHBMaW1NbG1TZXRLZXlzUmVxKSBwTWFjLT5saW0uZ3BMaW1NbG1TZXRLZXlzUmVxOworICAgICAgICAvLyBQcmVwYXJlIGFuZCBTZW5kIExJTV9NTE1fU0VUS0VZU19DTkYKKyAgICAgICAgaWYoIE5VTEwgIT0gbHBMaW1NbG1TZXRLZXlzUmVxICkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4ICopICZtbG1TZXRLZXlzQ25mLnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopIGxwTGltTWxtU2V0S2V5c1JlcS0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICAgICAgLy8gRnJlZSB0aGUgYnVmZmVyIGNhY2hlZCBmb3IgdGhlIGdsb2JhbCBwTWFjLT5saW0uZ3BMaW1NbG1TZXRLZXlzUmVxCisgICAgICAgICAgICB2b3NfbWVtX3plcm8ocE1hYy0+bGltLmdwTGltTWxtU2V0S2V5c1JlcSwKKyAgICAgICAgICAgICAgICAgICAgICAg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0S2V5c1JlcSkgcE1hYy0+bGltLmdwTGltTWxtU2V0S2V5c1JlcTsKKyAgICBtbG1TZXRLZXlzQ25mLnNlc3Npb25JZCA9IHNlc3Npb25JZDsKKworICAgIC8qIFByZXBhcmUgYW5kIFNlbmQgTElNX01MTV9TRVRLRVlTX0NORiAqLworICAgIGlmKCBOVUxMICE9IGxwTGltTWxtU2V0S2V5c1JlcSApCisgICAgeworICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKikgJm1sbVNldEtleXNDbmYucGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSBscExpbU1sbVNldEtleXNSZXEtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICAvKiBGcmVlIHRoZSBidWZmZXIgY2FjaGVkIGZvciB0aGUgZ2xvYmFsIHBNYWMtPmxpbS5ncExpbU1sbVNldEtleXNSZXEgKi8KKyAgICAgICAgdm9zX21lbV96ZXJvKHBNYWMtPmxpbS5ncExpbU1sbVNldEtleXNSZXEsCisgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodExpbU1sbVNldEtleXNSZXEpKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBNYWMtPmxpbS5ncExpbU1sbVNldEtleXNSZXEpOworICAgICAgICBwTWFjLT5saW0uZ3BMaW1NbG1TZXRLZXlzUmVxID0gTlVMTDsKKyAgICB9CisgICAgbGltUG9zdFNtZU1lc3NhZ2UocE1hYywgTElNX01MTV9TRVRLRVlTX0NORiwgKHRBTklfVTMyICopICZtbG1TZXRLZXlzQ25mKTsKK30KKy8qKgorICogbGltUHJvY2Vzc01sbVJlbW92ZUtleVJzcCgpCisgKgorICpGVU5DVElPTjoKKyAqCisgKkxPR0lDOgorICoKKyAqQVNTVU1QVElPTlM6CisgKgorICpOT1RFOgorICoKKyAqIEBwYXJhbSAgcE1hYyAgICAgIFBvaW50ZXIgdG8g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V9VMzIpIGVIQUxfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBQRUxPR1cobGltTG9nKHBNYWMsIExPR1csIEZMKCJJbml0U2NhblJzcCB3aXRoIGZhaWxlZCBzdGF0dXM9ICVkIiksIHN0YXR1cyk7KQorICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1IYWxTY2FuU3RhdGUgPSBlTElNX0hBTF9JRExFX1NDQU5fU1RBVEU7CisgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbU51bU9mQ29uc2VjdXRpdmVCa2duZFNjYW5GYWlsdXJlICs9IDE7CisgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICogT24gV2luZG93cyBlU0lSX1NNRV9IQUxfU0NBTl9JTklUX0ZBSUxFRCBtZXNzYWdlIHRvIENTUiBtYXkgdHJpZ2dlcgorICAgICAgICAgICAgICAgICogYW5vdGhlciBTY2FuIHJlcXVlc3QgaW4gdGhlIHNhbWUgY29udGV4dCAoaGFwcGVucyB3aGVuIDExZCBpcyBlbmFibGVkCisgICAgICAgICAgICAgICAgKiBhbmQgZmlyc3Qgc2NhbiByZXF1ZXN0IHdpdGggMTFkIGNoYW5uZWxzIGZhaWxzIGZvciB3aGF0ZXZlciByZWFzb24sIHRoZW4gQ1NSIGlzc3VlcyBuZXh0IGluaXQKKyAgICAgICAgICAgICAgICAqIHNjYW4gaW4gdGhlIHNhbWUgY29udGV4dCBidXQgd2l0aCBiaWdnZXIgY2hhbm5lbCBsaXN0KSwgc28gdGhlIHN0YXRlIG5lZWRzIHRvIGJlCisgICAgICAgICAgICAgICAgKiBjaGFuZ2VkIGJlZm9yZSB0aGlzIHJlc3BvbnNlIG1lc3NhZ2UgaXMgc2VudC4KKyAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgbGltQ29tcGxldGVNbG1TY2FuKHBNYWMsIGVTSVJfU01FX0hBTF9TQ0FOX0lOSVRfRkFJTEVEKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChzdGF0dXMgPT0gZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBzaW5jZSB3ZSBoYXZlIHN1Y2Nlc3NmdWxseSB0cmlnZ2VyZWQgYSBiYWNrZ3JvdW5kIHNjYW4sCisgICAgICAgICAgICAgICAgICogcmVzZXQgdGhlICJjb25zZWN1dGl2ZSBia2duZCBzY2FuIGZhaWx1cmUiIGNvdW50IHRvIDAKKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbU51bU9mQ29uc2VjdXRpdmVCa2duZFNjYW5GYWlsdXJlID0gMDsKKyAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbU51bU9mQmFja2dyb3VuZFNjYW5TdWNjZXNzICs9IDE7CisgICAgICAgICAgICAgICAgcE1hYy0+bGltLnByb2JlQ291bnRlciA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBsaW1Db250aW51ZUNoYW5uZWxTY2FuKHBNYWMpOworICAgICAgICAgICAgYnJlYWs7CisvL1dMQU5fU1VTUEVORF9MSU5LIFJlbGF0ZWQKKyAgICAgICAgY2FzZSBlTElNX0hBTF9TVVNQRU5EX0xJTktfV0FJVF9TVEFURToKKyAgICAgICAgICAgIGlmKCBwTWFjLT5saW0uZ3BMaW1TdXNwZW5kQ2FsbGJhY2sgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgaWYoIGVIQUxfU1RBVFVTX1NVQ0NFU1MgPT0gc3RhdHVzICkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltSGFsU2NhblN0YXRlID0gZUxJTV9IQUxfU1VTUEVORF9MSU5LX1NUQVRFOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1IYWxTY2FuU3RhdGUgPSBlTElNX0hBTF9JRExFX1NDQU5fU1RBVEU7CisgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbVN5c3RlbUluU2NhbkxlYXJuTW9kZSA9IDA7CisgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgIHBNYWMtPmxpbS5ncExpbVN1c3BlbmRDYWxsYmFjayggcE1hYywgc3RhdHVzLCBwTWFjLT5saW0uZ3BMaW1TdXNwZW5kRGF0YSApOworICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwTGltU3VzcGVuZENhbGxiYWNrID0gTlVMTDsKKyAgICAgICAgICAgICAgIHBNYWMtPmxpbS5ncExpbVN1c3BlbmREYXRhID0gTlVMTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HUCwgIk5vIHN1c3BlbmQgbGluayBjYWxsYmFjayBzZXQgYnV0IHN0YXRpb24gaXMgaW4gc3VzcGVuZCBzdGF0ZSIpOworICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisvL2VuZCBXTEFOX1NVU1BFTkRfTElOSyBSZWxhdGVkCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgRkwoImxpbVByb2Nlc3NJbml0U2NhblJzcDogUmN2ZCBJbml0U2NhblJzcCBub3QgaW4gV0FJVCBTdGF0ZSwgc3RhdGUgJWQiKSwKKyAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbUhhbFNjYW5TdGF0ZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICB9CisgICAgcmV0dXJuOworfQorLyoqCisgKiBsaW1Qcm9jZXNzU3dpdGNoQ2hhbm5lbFJlQXNzb2NSZX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VUNDRVNTKQorICAgIHsKKyAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiQ2hhbmdlIGNoYW5uZWwgZmFpbGVkISEiKSk7KQorICAgICAgICBnb3RvIGVycm9yOworICAgIH0KKworICAgIGlmICggKE5VTEwgPT0gcHNlc3Npb25FbnRyeSApIHx8IChOVUxMID09IHBzZXNzaW9uRW50cnktPnBMaW1NbG1Kb2luUmVxKSApCisgICAgeworICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJpbnZhbGlkIHBvaW50ZXIhISIpKTspCisgICAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorCisgICAKKyAgICAvKiBlU0lSX0JUQU1QX0FQX01PREUgc3Ryb2VkIGFzIGJzcyB0eXBlIGluIHNlc3Npb24gVGFibGUgd2hlbiBqb2luIHJlcSBpcyByZWNlaXZlZCwgaXMgdG8gYmUgdmVpZmllZCAgICovCisgICAgaWYocHNlc3Npb25FbnRyeS0+YnNzVHlwZSA9PSBlU0lSX0JUQU1QX0FQX01PREUpCisgICAgeworICAgICAgICBpZiAobGltU2V0TGlua1N0YXRlKHBNYWMsIGVTSVJfTElOS19CVEFNUF9QUkVBU1NPQ19TVEFURSwgcHNlc3Npb25FbnRyeS0+YnNzSWQsCisgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+c2VsZk1hY0FkZHIsIE5VTEwsIE5VTEwpICE9IGVTSVJfU1VDQ0VTUyApCisgICAgICAgIHsKKyAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlNlc3Npb25pZDogJWQgU2V0IGxpbmsgc3RhdGUgIgorICAgICAgICAgICAgImZhaWxlZCEhIEJTU0lEOiJNQUNfQUREUkVTU19TVFIpLHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLAorICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocHNlc3Npb25FbnRyeS0+YnNzSWQpKTspCisgICAgICAgICA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UhlYXJ0QmVhdEFwTWFjW2FwQ291bnRdLCBzaXplb2YodFNpck1hY0FkZHIpKSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJJbmRleCAlZCBTZXNzaW9uaWQ6ICVkIFNlbmQgZGVhdXRoIG9uICIKKyAgICAgICAgICAgICAgICAgImNoYW5uZWwgJWQgdG8gQlNTSUQ6ICJNQUNfQUREUkVTU19TVFIgKSwgYXBDb3VudCwKKyAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsIHBzZXNzaW9uRW50cnktPmN1cnJlbnRPcGVyQ2hhbm5lbCwKKyAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocHNlc3Npb25FbnRyeS0+cExpbU1sbUpvaW5SZXEtPmJzc0Rlc2NyaXB0aW9uLmJzc0lkKSk7CisKKyAgICAgICAgICAgICAgIGxpbVNlbmREZWF1dGhNZ210RnJhbWUoIHBNYWMsIGVTSVJfTUFDX1VOU1BFQ19GQUlMVVJFX1JFQVNPTiwKKyAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBMaW1NbG1Kb2luUmVxLT5ic3NEZXNjcmlwdGlvbi5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnksIEZBTFNFICk7CisKKyAgICAgICAgICAgICAgIHZvc19tZW1femVybyhwTWFjLT5saW0uZ0xpbUhlYXJ0QmVhdEFwTWFjW2FwQ291bnRdLAorICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICB9CisgICAgICAgfQorICAgIH0KKworICAgIC8vLyBXYWl0IGZvciBCZWFjb24gdG8gYW5ub3VuY2Ugam9pbiBzdWNjZXNzCisgICAgdm9zX21lbV9jb3B5KHNzSWQuc3NJZCwKKyAgICAgICAgICAgICAgICAgcHNlc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3RvIGVycm9yOworICAgIH0KKworICAgIGlmKCBwc2Vzc2lvbkVudHJ5LT5wZVBlcnNvbmEgPT0gVk9TX1AyUF9DTElFTlRfTU9ERSApCisgICAgeworICAgICAgICAvLyBBY3RpdmF0ZSBKb2luIFBlcmlvZGljIFByb2JlIFJlcSB0aW1lcgorICAgICAgICBpZiAodHhfdGltZXJfYWN0aXZhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbVBlcmlvZGljSm9pblByb2JlUmVxVGltZXIpICE9IFRYX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiY291bGQgbm90IGFjdGl2YXRlIFBlcmlvZGljIEpvaW4gcmVxIGZhaWx1cmUgdGltZXIiKSk7CisgICAgICAgICAgICBnb3RvIGVycm9yOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuOworZXJyb3I6ICAKKyAgICBpZihOVUxMICE9IHBzZXNzaW9uRW50cnkpCisgICAgeworICAgICAgICB2b3NfbWVtX2ZyZWUocHNlc3Npb25FbnRyeS0+cExpbU1sbUpvaW5SZXEpOworICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wTGltTWxtSm9pblJlcSA9IE5VTEw7CisgICAgICAgIG1sbUpvaW5DbmYuc2Vzc2lvbklkID0gcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQ7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIG1sbUpvaW5DbmYuc2Vzc2lvbklkID0gMDsKKyAgICB9CisgICAgbWxtSm9pbkNuZi5yZXN1bHRDb2RlID0gZVNJUl9TTUVfUkVTT1VSQ0VTX1VOQVZBSUxBQkxFOworICAgIG1sbUpvaW5DbmYucHJvdFN0YXR1c0NvZGUgPSBlU0lSX01BQ19VTlNQRUNfRkFJTFVSRV9TVEFUVVM7CisgICAgbGltUG9zdFNtZU1lc3NhZ2UocE1hYywgTElNX01MTV9KT0lOX0NORiwgKHRB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lIHJlZ2lzdGVyZWQgY2FsbCBiYWNrIik7CisgICAgICAgICAgICAgICAgaWYgKGVIQUxfQ0hBTk5FTF9TV0lUQ0hfU09VUkNFX0NTQSA9PSBwQ2hubFBhcmFtcy0+Y2hhbm5lbFN3aXRjaFNyYyApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAoSVNfTUNDX1NVUFBPUlRFRCAmJiBsaW1Jc0xpbmtTdXNwZW5kZWQoIHBNYWMgKSApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICggcHNlc3Npb25FbnRyeSAmJiBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IGVMSU1fU01FX0xJTktfRVNUX1NUQVRFICkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZVNldFJlc3VtZUNoYW5uZWwoIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmN1cnJlbnRPcGVyQ2hhbm5lbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+aHRTZWNvbmRhcnlDaGFubmVsT2Zmc2V0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZVNldFJlc3VtZUNoYW5uZWwoIHBNYWMsIDAsIDApOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgbGltUmVzdW1lTGluayhwTWFjLCBsaW1Td2l0Y2hDaGFubmVsUmVzdW1lTGlua1JzcCwgTlVMTCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICA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d2lsbCBpbnN0cnVjdCBIQUwgdG8gc2V0IGl0IHRvIGFueSBwcmV2aW91cyB2YWxpZCBjaGFubmVsLgorICAgICAgICBwZVNldFJlc3VtZUNoYW5uZWwocE1hYywgMCwgMCk7CisgICAgICAgIGxpbVNlbmRIYWxGaW5pc2hTY2FuUmVxKHBNYWMsIGVMSU1fSEFMX0ZJTklTSF9TQ0FOX1dBSVRfU1RBVEUpOworICAgIH0KKyAgICBzd2l0Y2gocE1hYy0+bGltLmdMaW1IYWxTY2FuU3RhdGUpCisgICAgeworICAgICAgICBjYXNlIGVMSU1fSEFMX1NUQVJUX1NDQU5fV0FJVF9TVEFURToKKyAgICAgICAgICAgIGlmIChzdGF0dXMgIT0gKHRBTklfVTMyKSBlSEFMX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiU3RhcnRTY2FuUnNwIHdpdGggZmFpbGVkIHN0YXR1cz0gJWQiKSwgc3RhdHVzKTspCisgICAgICAgICAgICAgICAvLworICAgICAgICAgICAgICAgLy8gRklYTUUgLSBXaXRoIHRoaXMsIExJTSB3aWxsIHRyeSBhbmQgcmVjb3ZlciBzdGF0ZSwgYnV0CisgICAgICAgICAgICAgICAvLyBlV05JX1NNRV9TQ0FOX0NORiBtYXliZSByZXBvcnRpbmcgYW4gaW5jb3JyZWN0CisgICAgICAgICAgICAgICAvLyBzdGF0dXMgYmFjayB0byB0aGUgU01FCisgICAgICAgICAgICAgICAvLworICAgICAgICAgICAgICAgLy9TZXQgdGhlIHJlc3VtZSBjaGFubmVsIHRvIEFueSB2YWxpZCBjaGFubmVsIChpbnZhbGlkKS4gCisgICAgICAgICAgICAgICAvL1RoaXMgd2lsbCBpbnN0cnVjdCBIQUwgdG8gc2V0IGl0IHRvIGFueSBwcmV2aW91cyB2YWxpZCBjaGFubmVsLgorICAgICAgICAgICAgICAgcGVTZXRSZXN1bWVDaGFubmVsKHBNYWMsIDAsIDApOworICAgICAgICAgICAgICAgbGltU2VuZEhhbEZpbmlzaFNjYW5SZXEoIHBNYWMsIGVMSU1fSEFMX0ZJTklTSF9TQ0FOX1dBSVRfU1RBVEUgKTsKKyAgICAgICAgICAgICAgIC8vbGltQ29tcGxldGVNbG1TY2FuKHBNYWMsIGVTSVJfU01FX0hBTF9TQ0FOX0lOSVRfRkFJTEVEKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltSGFsU2NhblN0YXRlID0gZUxJTV9IQUxfU0NBTk5JTkdfU1RBVEU7CisgICAgICAgICAgICAgICBsaW1Db250aW51ZVBvc3RDaGFubmVsU2NhbihwTWFjKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1csIEZMKCJSY3ZkIFN0YXJ0U2NhblJzcCBub3QgaW4gV0FJVCBTdGF0ZSwgc3RhdGUgJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltSGFsU2NhblN0YXRlKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgIH0KKyAgICByZXR1cm47Cit9Cit2b2lkIGxpbVByb2Nlc3NFbmRTY2FuUnNwKHRwQW5pU2lyR2xvYmFsIHBNYWMsICB2b2lkICpib2R5KQoreworICAgIHRwRW5kU2NhblBhcmFtcyAgICAgcEVuZFNjYW5QYXJhbTsKKyAgICBlSGFsU3RhdHVzICAgICAgICAgIHN0YXR1czsKKyAgICBTRVRfTElNX1BST0NFU1NfREVGRF9NRVNHUyhwTWFjLCB0cnVlKTsKKyAgICBwRW5kU2NhblBhcmFtID0gKHRwRW5kU2NhblBhcmFtcykgYm9keTsKKyAgICBzdGF0dXMgPSBwRW5kU2NhblBhcmFtLT5zdGF0dXM7CisgICAgdm9zX21lbV9mcmVlKGJvZHkpOworICAgIGJvZHkgPSBOVUxMOworICAgIHN3aXRjaChwTWFjLT5saW0uZ0xpbUhhbFNjYW5TdGF0ZSkKKyAgICB7CisgICAgICAgIGNhc2UgZUxJTV9IQUxfRU5EX1NDQU5fV0FJVF9TVEFURToKKyAgICAgICAgICAgIGlmIChzdGF0dXMgIT0gKHRBTklfVTMyKSBlSEFMX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiRW5kU2NhblJzcCB3aXRoIGZhaWxlZCBzdGF0dXM9ICVkIiksIHN0YXR1cyk7KQorICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1IYWxTY2FuU3RhdGUgPSBlTElNX0hBTF9JRExFX1NDQU5fU1RBVEU7CisgICAgICAgICAgICAgICBsaW1Db21wbGV0ZU1sbVNjYW4ocE1hYywgZVNJUl9TTUVfSEFMX1NDQU5fSU5JVF9GQUlMRUQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1DdXJyZW50U2NhbkNoYW5uZWxJZCsrOworICAgICAgICAgICAgICAgbGltQ29udGludWVDaGFubmVsU2NhbihwTWFjKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1csIEZMKCJSY3ZkIGVuZFNjYW5Sc3Agbm90IGluIFdBSVQgU3RhdGUsIHN0YXRlICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbUhhbFNjYW5TdGF0ZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICB9CisgICAgcmV0dXJuOworfQorLyoqCisgKiAgbGltU3RvcFR4QW5kU3dpdGNoKCkKKyAqCisgKkZVTkNUSU9OOgorICogU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worCisgICAgc3dpdGNoKHBNYWMtPmxpbS5nTGltSGFsU2NhblN0YXRlKQorICAgIHsKKyAgICAgICAgY2FzZSBlTElNX0hBTF9GSU5JU0hfU0NBTl9XQUlUX1NUQVRFOgorICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1IYWxTY2FuU3RhdGUgPSBlTElNX0hBTF9JRExFX1NDQU5fU1RBVEU7CisgICAgICAgICAgICBpZiAocE1hYy0+bGltLmFib3J0U2NhbikKKyAgICAgICAgICAgICAgICBwTWFjLT5saW0uYWJvcnRTY2FuID0gMDsKKyAgICAgICAgICAgIGxpbUNvbXBsZXRlTWxtU2NhbihwTWFjLCBlU0lSX1NNRV9TVUNDRVNTKTsKKyAgICAgICAgICAgIGlmIChsaW1Jc0NoYW5Td2l0Y2hSdW5uaW5nKHBNYWMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qKiBSaWdodCB0aW1lIHRvIHN0b3AgdHggYW5kIHN0YXJ0IHRoZSB0aW1lciBmb3IgY2hhbm5lbCBzd2l0Y2ggKi8KKyAgICAgICAgICAgICAgICAvKiBTZW5kaW5nIFNlc3Npb24gSUQgMCwgbWF5IG5vdCBiZSBjb3JyZWN0LCBzaW5jZSBTQ0FOIGlzIGdsb2JhbCB0aGVyZSBzaG91bGQgbm90CisgICAgICAgICAgICAgICAgICogYmUgYW55IGFzc29jaWF0ZWQgc2Vzc2lvbiBpZAorICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgbGltU3RvcFR4QW5kU3dpdGNoKHBNYWMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAobGltSXNRdWlldEJlZ2luKHBNYWMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qKiBTdGFydCB0aGUgcXVpZXRpbmcgKi8KKyAgICAgICAgICAgICAgICAvKiBTZW5kaW5nIFNlc3Npb24gSUQgMCwgbWF5IG5vdCBiZSBjb3JyZWN0LCBzaW5jZSBTQ0FOIGlzIGdsb2JhbCB0aGVyZSBzaG91bGQgbm90CisgICAgICAgICAgICAgICAgICogYmUgYW55IGFzc29jaWF0ZWQgc2Vzc2lvbiBpZAorICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgbGltU3RhcnRRdWlldE9uU2Vzc2lvbihwTWFjKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChzdGF0dXMgIT0gKHRBTklfVTMyKSBlSEFMX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiRW5kU2NhblJzcCB3aXRoIGZhaWxlZCBzdGF0dXM9ICVkIiksIHN0YXR1cyk7KQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisvL1dMQU5fU1VTUEVORF9MSU5LIFJlbGF0ZWQKKyAgICAgICAgY2FzZSBlTElNX0hBTF9SRVNVTUVfTElOS19XQUlUX1NUQVRFOgorICAgICAgICAgICAgaWYoIHBNYWMtPmxpbS5ncExpbVJlc3VtZUNhbGxiYWNrICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltSGFsU2NhblN0YXRlID0gZUxJTV9IQUxfSURMRV9TQ0FOX1NUQVRFOworICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwTGltUmVzdW1lQ2FsbGJhY2soIHBNYWMsIHN0YXR1cywgcE1hYy0+bGltLmdwTGltUmVzdW1lRGF0YSApOworICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwTGltUmVzdW1lQ2FsbGJhY2sgPSBOVUxMOworICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwTGltUmVzdW1lRGF0YSA9IE5VTEw7CisgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbVN5c3RlbUluU2NhbkxlYXJuTW9kZSA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1AsICJObyBSZXN1bWUgbGluayBjYWxsYmFjayBzZXQgYnV0IHN0YXRpb24gaXMgaW4gc3VzcGVuZCBzdGF0ZSIpOworICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKGJvZHkpOworICAgICAgICAgICAgICAgYm9keSA9IE5VTEw7CisgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKy8vZW5kIFdMQU5fU1VTUEVORF9MSU5LIFJlbGF0ZWQKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJSY3ZkIEZpbmlzaFNjYW5Sc3Agbm90IGluIFdBSVQgU3RhdGUsIHN0YXRlICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbUhhbFNjYW5TdGF0ZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICB9CisgICAgdm9zX21lbV9mcmVlKGJvZHkpOworICAgIGJvZHkgPSBOVUxMOworICAgIHJldHVybjsKK30KKy8qKgorICogQGZ1bmN0aW9uIDogbGltUHJvY2Vzc01sbUhhbEFkZEJBUnNwCisgKgorICogQGJyaWVmOiAgICAgUHJvY2VzcyBXREFfQUREQkFfUlNQIGNvbWluZyBmcm9tIEhBTAorICoKKyAqCisgKiBAcGFyYW0gcE1hYyBUaGUgZ2xvYmFsIHRwQW5pU2lyR2xvYmFsIG9iamVjdAorICoKKyAqIEBwYXJhbSB0U2lyTXNnUSBUaGUgTXNnUSBoZWFkZXIgY29udGFpbmluZyB0aGUgcmVzcG9uc2UgYnVmZmVyCisgKgorICogQHJldHVybiBub25lCisgKi8KK3ZvaWQgbGltUHJvY2Vzc01sbUhhbEFkZEJBUnNwKCB0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgIHRwU2lyTXNnUSBsaW1Nc2dRICkKK3sKKyAgICAvLyBTZW5kIExJTV9NTE1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T5kcGguZHBoSGFzaFRhYmxlICk7CisgICAgaWYoIE5VTEwgPT0gcFN0YSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsCisgICAgICAgICAgICBGTCggIlNUQSBjb250ZXh0IG5vdCBmb3VuZCAtIGlnbm9yaW5nIERFTEJBIENORiBmcm9tIEhBTCIgKSk7CisgICAgICAgIHZvc19tZW1fZnJlZShwTXNnQnVmKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBpZihOVUxMID09IHBNbG1EZWxCQUNuZikKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwKKyAgICAgICAgRkwoICJwTWxtRGVsQkFDbmYgaXMgTlVMTCAtIGlnbm9yaW5nIERFTEJBIENORiBmcm9tIEhBTCIgKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgLy8gTmVlZCB0byB2YWxpZGF0ZSBiYVN0YXRlCisgICAgTElNX0dFVF9TVEFfQkFfU1RBVEUocFN0YSwgcE1sbURlbEJBQ25mLT5iYVRJRCwgJmN1ckJhU3RhdGUpOworICAgIGlmKCBlTElNX0JBX1NUQVRFX1dUX0RFTF9SU1AgIT0gY3VyQmFTdGF0ZSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsCisgICAgICAgIEZMKCAiUmVjZWl2ZWQgdW5leHBlY3RlZCBERUxCQSBDTkYgd2hlbiBTVEEgQkEgc3RhdGUgaXMgJWQiICksCisgICAgICAgIGN1ckJhU3RhdGUgKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBNc2dCdWYpOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIC8vIFJlc3RvcmUgU1RBIEJBIHN0YXRlCisgICAgTElNX1NFVF9TVEFfQkFfU1RBVEUocFN0YSwgcE1sbURlbEJBQ25mLT5iYVRJRCwgZUxJTV9CQV9TVEFURV9JRExFKTsKKyAgICAvLyBGcmVlIHRoZSBtZW1vcnkgYWxsb2NhdGVkIGZ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isvKioKKyAqICBAZnVuY3Rpb24gOiBsaW1Qcm9jZXNzU2V0TWltb1JzcCgpCisgKgorICogIEBicmllZiA6ICBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCB1cG9uIHJlY2VpdmluZyB0aGUgV0RBX1NFVF9NSU1PUFNfUlNQIGZyb20gdGhlIEhBTAorICogICAgICAgICAgICAgICAgICAgICAgYWZ0ZXIgUHJvY2Vzc2luZyB0aGUgUmVxIGZyb20gdGhlIFNNRSAoUE1DKQorICoKKyAqICAgICAgTE9HSUM6CisgKgorICogICAgICBBU1NVTVBUSU9OUzoKKyAqICAgICAgICAgIE5BCisgKgorICogICAgICBOT1RFOgorICogICAgICAgICAgTkEKKyAqCisgKiBAcGFyYW0gIHBNYWMgLSBQb2ludGVyIHRvIEdsb2JhbCBNQUMgc3RydWN0dXJlCisgKiBAcGFyYW0gIGxpbU1zZyAtIExpbSBNZXNzYWdlIHN0cnVjdHVyZSBvYmplY3Qgd2l0aCB0aGUgTWltb1BTcGFyYW0gaW4gYm9keQorICogQHJldHVybiBOb25lCisgKi8KKwordm9pZAorbGltUHJvY2Vzc1NldE1pbW9Sc3AodHBBbmlTaXJHbG9iYWwgcE1hYywgdHBTaXJNc2dRIGxpbU1zZykKK3sKKyNpZiAwCisgICAgdFNpclJldFN0YXR1cyAgICAgICAgICAgcmV0U3RhdHVzOworICAgIHRwU2V0TUlNT1BTICAgICAgICAgIHBNSU1PX1BTUGFyYW1zOworCisKKyAgICBkbyB7CisKKyAgICAgICAgcE1JTU9fUFNQYXJhbXMgPSAodHBTZXRNSU1PUFMpbGltTXNnLT5ib2R5cHRyOworICAgICAgICBpZiggTlVMTCA9PSBwTUlNT19QU1BhcmFtcyApIHsKKyAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgIlJlY2VpdmVkIHRoZSBXREFfU0VUX01JTU9QU19SU1Agd2l0aCBOVUxMIGFzIHRoZSBQUyBwYXJhbSIpOykKKyAgICAgICAgICA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GluZyB0aGUgaW50ZXJuYWwgc3RydWN0dXJlcworICAgICAgICAgICovCisgICAgICAgIGlmICghaXNFbnRlcmluZ01pbW9QUyhwTWFjLT5saW0uZ0hUTUlNT1BTU3RhdGUsIHBNSU1PX1BTUGFyYW1zLT5odE1JTU9QU1N0YXRlKSkgeworICAgICAgICAgICAgdFNpck1hY0FkZHIgICAgICAgICAgICBtYWNBZGRyOworCisgICAgICAgICAgICAvKiogT2J0YWluIHRoZSBBUCdzIE1hYyBBZGRyZXNzICovCisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKiltYWNBZGRyLCBwTWFjLT5saW0uZ0xpbUJzc2lkLCBzaXplb2YodFNpck1hY0FkZHIpKTsKKworICAgICAgICAgICAgLyoqIFNlbmQgQWN0aW9uIEZyYW1lIHdpdGggdGhlIGNvcnJlc3BvbmRpbmcgbW9kZSAqLworICAgICAgICAgICAgcmV0U3RhdHVzID0gbGltU2VuZFNNUG93ZXJTdGF0ZUZyYW1lKHBNYWMsIG1hY0FkZHIsIHBNSU1PX1BTUGFyYW1zLT5odE1JTU9QU1N0YXRlKTsKKyAgICAgICAgICAgIGlmIChyZXRTdGF0dXMgIT0gZVNJUl9TVUNDRVNTKSB7CisgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiU2VuZGluZyBBY3Rpb24gRnJhbWUgaGFzIGZhaWxlZCIpKTspCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgUEVMT0cxKGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiVGhlIFNldHRpbmcgdXAgb2YgTGltR2xvYmFscyBpcyBzdWNjZXNzZnVsIGZvciBNSU1PUFMiKSk7KQorICAgIH13aGlsZSgwKTsKKworICAgIHZvc19tZW1fZnJlZSgodm9pZCAqKSBwTUlNT19QU1BhcmFtcyk7CisjZW5kaWYKK30KKy8qKgorICAqICAgICBAZnVuY3Rpb24gOiBsaW1IYW5kbGVEZWxCc3NJblJlQXNzb2NDb250ZXh0CisgICogICAgIEBicmllZiAgICAgIDogV2hpbGUgUHJvY2Vzc2luZyB0aGUgUmVBc3NvY2lhdGlvbiBSZXNwb25zZSBGcmFtZSBpbiBTVEEsCisgICogICAgICAgICAgICAgICAgICAgICAgICAgYS4gaW1tZWRpYXRlbHkgYWZ0ZXIgcmVjZWl2aW5nIHRoZSBSZWFzc29jIFJlc3BvbnNlIHRoZSBSeENsZWFuVXAgaXMKKyAgKiAgICAgICAgICAgICAgICAgICAgICAgICBiZWluZyBpc3N1ZWQgYW5kIHRoZSBlbmQgb2YgRGVsQlNTIHRoZSBuZXcgQlNTIGlzIGJlaW5nIGFkZGVkLgorICAqCisgICogICAgICAgICAgICAgICAgICAgICAgICAgYiAuSWYgYW4gQVAgcmVqZWN0cyB0aGUgUmVBc3NvY2lhdGlvbiAoRGlzYXNzb2MgLyBEZWF1dGgpIHdpdGggc29tZSBjb250ZXh0CisgICogICAgICAgICAgICAgICAgICAgICAgICAgY2hhbmdlLCBXZSBuZWVkIHRvIHVwZGF0ZSBDU1Igd2l0aCBSZUFzc29jQ05GIFJlc3BvbnNlIHdpdGggdGhlCisgICogICAgICAgICAgICAgICAgICAgICAgICAgUmVBc3NvYyBGYWlsIGFuZCB0aGUgcmVhc29uIENvZGUsIHRoYXQgaXMgYWxzbyBiZWluZyBoYW5kbGVkIGluIHRoZSBERUxCU1MKKyAgKiAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0IG9ubHkKKyAgKgorICAqICAgICBAcGFyYW0gOiAgIHBNYWMgLSB0cEFuaVNpckdsb2JhbAorICAqICAgICAgICAgICAgICAgICAgICAgcFN0YURzIC0gU3RhdGlvbiBEZXNjcmlwdG9yCisgICoKKyAgKiAgICAgQHJldHVybiA6ICBub25lCisgICovCitzdGF0aWMgdm9pZAorbGltSGFuZGxlRGVsQnNzSW5SZUFzc29jQ29udGV4dCh0cEFuaVNpckdsb2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Sk7CisgICAgICAgICAgICAgICAgbWxtUmVhc3NvY0NuZi5yZXN1bHRDb2RlID0gZVNJUl9TTUVfUkVTT1VSQ0VTX1VOQVZBSUxBQkxFOworICAgICAgICAgICAgICAgIG1sbVJlYXNzb2NDbmYucHJvdFN0YXR1c0NvZGUgPSBlU0lSX01BQ19VTlNQRUNfRkFJTFVSRV9TVEFUVVM7CisgICAgICAgICAgICAgICAgbGltRGVsZXRlRHBoSGFzaEVudHJ5KHBNYWMsIHBzZXNzaW9uRW50cnktPmJzc0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEUEhfU1RBX0hBU0hfSU5ERVhfUEVFUiwgcHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgZ290byBFcnJvcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8qKiBEZWxldGUgdGhlIG9sZGVyIFNUQSBUYWJsZSBlbnRyeSAqLworICAgICAgICAgICAgbGltRGVsZXRlRHBoSGFzaEVudHJ5KHBNYWMsIHBzZXNzaW9uRW50cnktPmJzc0lkLCBEUEhfU1RBX0hBU0hfSU5ERVhfUEVFUiwgcHNlc3Npb25FbnRyeSk7CisgICAgICAgLyoqCisgICAgICAgICAgICAgKiBBZGQgYW4gZW50cnkgZm9yIEFQIHRvIGhhc2ggdGFibGUKKyAgICAgICAgICAgICAqIG1haW50YWluZWQgYnkgRFBIIG1vZHVsZQorICAgICAgICAgICAgICovCisgICAgICAgICAgICBpZiAoKHBTdGFEcyA9IGRwaEFkZEhhc2hFbnRyeShwTWFjLCBwc2Vzc2lvbkVudHJ5LT5saW1SZUFzc29jYnNzSWQsIERQSF9TVEFfSEFTSF9JTkRFWF9QRUVSLCAmcHNlc3Npb25FbnRyeS0+ZHBoLmRwaEhhc2hUYWJsZSkpID09IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gQ291bGQgbm90IGFkZCBoYXNoIHRhYmxlIGVudHJ5CisgICAgICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IGFkZCBoYXNoIGVudHJ5IGF0IERQSCBmb3IgIikpOykKKyAgICAgICAgICAgICAgICBsaW1QcmludE1hY0FkZHIocE1hYywgcHNlc3Npb25FbnRyeS0+bGltUmVBc3NvY2Jzc0lkLCBMT0dFKTsKKyAgICAgICAgICAgICAgICBtbG1SZWFzc29jQ25mLnJlc3VsdENvZGUgPSBlU0lSX1NNRV9SRVNPVVJDRVNfVU5BVkFJTEFCTEU7CisgICAgICAgICAgICAgICAgbWxtUmVhc3NvY0NuZi5wcm90U3RhdHVzQ29kZSA9IGVTSVJfU01FX1NVQ0NFU1M7CisgICAgICAgICAgICAgICAgdm9zX21lbV92ZnJlZShwQmVhY29uU3RydWN0KTsKKyAgICAgICAgICAgICAgICBnb3RvIEVycm9yOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLyoqIFdoaWxlIFByb2Nlc3NpbmcgdGhlIFJlQXNzb2MgUmVzcG9uc2UgRnJhbWUgdGhlIFJlQXNzb2NSc3AgRnJhbWUKKyAgICAgICAgICAgICogICBpcyBiZWluZyBzdG9yZWQgdG8gYmUgdXNlZCBoZXJlIGZvciBzZW5kaW5nIEFEREJTUworICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGFzc29jUnNwID0gKHRwU2lyQXNzb2NSc3ApcHNlc3Npb25FbnRyeS0+bGltQXNzb2NSZXNwb25zZURhdGE7CisgICAgICAgICAgICBsaW1VcGRhdGVBc3NvY1N0YURhdGFzKHBNYWMsIHBTdGFEcywgYXNzb2NSc3AscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICBsaW1VcGRhdGVSZUFzc29jR2xvYmFscyhwTWFjLCBhc3NvY1JzcCxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgIGxpbUV4dHJhY3RBcENhcGFiaWxpdGllcyggcE1hYywKKyAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopIHBz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YXNzb2NSc3AsIHBCZWFjb25TdHJ1Y3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBzZXNzaW9uRW50cnktPnBMaW1SZUFzc29jUmVxLT5ic3NEZXNjcmlwdGlvbiwgZmFsc2UsIHBzZXNzaW9uRW50cnkpKSAgeworICAgICAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoICJQb3N0aW5nIEFEREJTUyBpbiB0aGUgUmVBc3NvY0NvbnRleHQgaGFzIEZhaWxlZCAiKSk7CisgICAgICAgICAgICAgICAgcmV0U3RhdHVzID0gZVNJUl9GQUlMVVJFOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHJldFN0YXR1cyAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbWxtUmVhc3NvY0NuZi5yZXN1bHRDb2RlID0gZVNJUl9TTUVfUkVTT1VSQ0VTX1VOQVZBSUxBQkxFOworICAgICAgICAgICAgICAgIG1sbVJlYXNzb2NDbmYucHJvdFN0YXR1c0NvZGUgPSBlU0lSX01BQ19VTlNQRUNfRkFJTFVSRV9TVEFUVVM7CisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKGFzc29jUnNwKTsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX3ZmcmVlKHBCZWFjb25TdHJ1Y3QpOworICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltQXNzb2NSZXNwb25zZURhdGEgPSBOVUxMOworICAgICAgICAgICAgICAgIGdvdG8gRXJyb3I7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUoYXNzb2NSc3ApOworICAgICAgICAgICAgdm9zX21lbV92ZnJlZShwQmVhY29uU3RydWN0KTsKKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbUFzc29jUmVzcG9uc2VEYXRhID0gTlVMTDsKKyAgICAgICAgfQorICAgICAgICB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VEEsCisgICogICAgICAgICAgICAgICAgICAgICAgICAgYS4gaW1tZWRpYXRlbHkgYWZ0ZXIgcmVjZWl2aW5nIHRoZSBSZWFzc29jIFJlc3BvbnNlIHRoZSBSeENsZWFuVXAgaXMKKyAgKiAgICAgICAgICAgICAgICAgICAgICAgICBiZWluZyBpc3N1ZWQgYW5kIHRoZSBlbmQgb2YgRGVsQlNTIHRoZSBuZXcgQlNTIGlzIGJlaW5nIGFkZGVkLgorICAqCisgICogICAgICAgICAgICAgICAgICAgICAgICAgYiAuSWYgYW4gQVAgcmVqZWN0cyB0aGUgUmVBc3NvY2lhdGlvbiAoRGlzYXNzb2MgLyBEZWF1dGgpIHdpdGggc29tZSBjb250ZXh0CisgICogICAgICAgICAgICAgICAgICAgICAgICAgY2hhbmdlLCBXZSBuZWVkIHRvIHVwZGF0ZSBDU1Igd2l0aCBSZUFzc29jQ05GIFJlc3BvbnNlIHdpdGggdGhlCisgICogICAgICAgICAgICAgICAgICAgICAgICAgUmVBc3NvYyBGYWlsIGFuZCB0aGUgcmVhc29uIENvZGUsIHRoYXQgaXMgYWxzbyBiZWluZyBoYW5kbGVkIGluIHRoZSBERUxCU1MKKyAgKiAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0IG9ubHkKKyAgKgorICAqICAgICBAcGFyYW0gOiAgIHBNYWMgLSB0cEFuaVNpckdsb2JhbAorICAqICAgICAgICAgICAgICAgICAgICAgcFN0YURzIC0gU3RhdGlvbiBEZXNjcmlwdG9yCisgICoKKyAgKiAgICAgQHJldHVybiA6ICBub25lCisgICovCit2b2lkCitsaW1IYW5kbGVBZGRCc3NJblJlQXNzb2NDb250ZXh0KHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRwRHBoSGFzaE5vZGUgcFN0YURzLCB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KQoreworICAgIHRMaW1NbG1SZWFzc29jQ25mICAgICAgICAgICBtbG1SZWFzc29jQ25mOworICAgIC8qKiBTa2lwc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AgICAgICAgbWxtUmVhc3NvY0NuZi5wcm90U3RhdHVzQ29kZSA9IGVTSVJfU01FX1JFU09VUkNFU19VTkFWQUlMQUJMRTsKKyAgICAgICAgICAgICAgICBnb3RvIEVycm9yOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBHZXQgdGhlIEFQIGVudHJ5IGZyb20gRFBIIGhhc2ggdGFibGUKKyAgICAgICAgICAgIHBTdGFEcyA9IGRwaEdldEhhc2hFbnRyeShwTWFjLCBEUEhfU1RBX0hBU0hfSU5ERVhfUEVFUiwgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUpOworICAgICAgICAgICAgaWYgKHBTdGFEcyA9PSBOVUxMICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJGYWlsIHRvIGdldCBTVEEgUEVFUiBlbnRyeSBmcm9tIGhhc2giKSk7KQorICAgICAgICAgICAgICAgIG1sbVJlYXNzb2NDbmYucmVzdWx0Q29kZSA9IGVTSVJfU01FX1JFU09VUkNFU19VTkFWQUlMQUJMRTsKKyAgICAgICAgICAgICAgICBtbG1SZWFzc29jQ25mLnByb3RTdGF0dXNDb2RlID0gZVNJUl9TTUVfU1VDQ0VTUzsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocEJlYWNvblN0cnVjdCk7CisgICAgICAgICAgICAgICAgZ290byBFcnJvcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8qKiBXaGlsZSBQcm9jZXNzaW5nIHRoZSBSZUFzc29jIFJlc3BvbnNlIEZyYW1lIHRoZSBSZUFzc29jUnNwIEZyYW1lCisgICAgICAgICAgICAqICAgaXMgYmVpbmcgc3RvcmVkIHRvIGJlIHVzZWQgaGVyZSBmb3Igc2VuZGluZyBBRERCU1MKKyAgICAgICAgICAgICovCisgICAgICAgICAgICBhc3NvY1JzcCA9ICh0cFNpckFzc29jUnNwKXBzZXN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CisgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmJlYWNvblBhcmFtcy5mU2hvcnRQcmVhbWJsZSA9IDE7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChlU0lSX1NVQ0NFU1MgIT0gbGltU3RhU2VuZEFkZEJzcyggcE1hYywgYXNzb2NSc3AsIHBCZWFjb25TdHJ1Y3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBzZXNzaW9uRW50cnktPnBMaW1SZUFzc29jUmVxLT5ic3NEZXNjcmlwdGlvbiwgdHJ1ZSwgcHNlc3Npb25FbnRyeSkpICB7CisgICAgICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCggIlBvc3RpbmcgQUREQlNTIGluIHRoZSBSZUFzc29jQ29udGV4dCBoYXMgRmFpbGVkICIpKTsKKyAgICAgICAgICAgICAgICByZXRTdGF0dXMgPSBlU0lSX0ZBSUxVUkU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAocmV0U3RhdHVzICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBtbG1SZWFzc29jQ25mLnJlc3VsdENvZGUgPSBlU0lSX1NNRV9SRVNPVVJDRVNfVU5BVkFJTEFCTEU7CisgICAgICAgICAgICAgICAgbWxtUmVhc3NvY0NuZi5wcm90U3RhdHVzQ29kZSA9IGVTSVJfTUFDX1VOU1BFQ19GQUlMVVJFX1NUQVRVUzsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUoYXNzb2NSc3ApOworICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltQXNzb2NSZXNwb25zZURhdGEgPSBOVUxMOworICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwQmVhY29uU3RydWN0KTsKKyAgICAgICAgICAgICAgICBnb3RvIEVycm9yOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdm9zX21lbV9mcmVlKGFzc29jUnNwKTsKKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbUFzc29jUmVzcG9uc2VEYXRhID0gTlVMTDsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwQmVhY29uU3RydWN0KTsKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlTElNX1NNRV9XVF9SRUFTU09DX0xJTktfRkFJTF9TVEFURTogeyAgICAgLyoqIENhc2Ugd2hlcmVpbiB0aGUgRGlzQXNzb2MgLyBEZWF1dGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqICAgYmVpbmcgc2VudCBhcyByZXNwb25zZSB0byBSZUFzc29jIFJlcSovCisgICAgICAgICAgICAvKiogU2VuZCB0aGUgUmVhc29uIGNvZGUgYXMgdGhlIHNhbWUgcmVjZWl2ZWQgaW4gRGlzYXNzb2MgLyBEZWF1dGggRnJhbWUqLworICAgICAgICAgICAgbWxtUmVhc3NvY0NuZi5yZXN1bHRDb2RlID0gcFN0YURzLT5tbG1TdGFDb250ZXh0LmRpc2Fzc29jUmVhc29uOworICAgICAgICAgICAgbWxtUmVhc3NvY0NuZi5wcm90U3RhdHVzQ29kZSA9IHBTdGFEcy0+bWxtU3RhQ29udGV4dC5jbGVhbnVwVHJpZ2dlcjsKKyAgICAgICAgICAgIC8qKiBTZXQgdGhlIFNNRSBTdGF0ZSBiYWNrIHRvIFdUX1JlYXNzb2MgU3RhdGUqLworICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUgPSBlTElNX1NNRV9XVF9SRUFTU09DX1NUQVRFOworICAgICAgICAgICAgbGltRGVsZXRlRHBoSGFzaEVudHJ5KHBNYWMsIHBTdGFEcy0+c3RhQWRkciwgcFN0YURzLT5hc3NvY0lkLCBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgIC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AgICAgICAqKi8KKyAgICAgICBsaW1TZW5kU21lRGlzYXNzb2NOdGYoIHBNYWMsIGFzc29jQ25mLnBlZXJNYWNBZGRyLCBlU0lSX1NNRV9TVEFfTk9UX0FTU09DSUFURUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlTElNX1BFRVJfRU5USVRZX0RJU0FTU09DLCBhc3NvY0NuZi5haWQscHNlc3Npb25FbnRyeS0+c21lU2Vzc2lvbklkLHBzZXNzaW9uRW50cnktPnRyYW5zYWN0aW9uSWQscHNlc3Npb25FbnRyeSk7CisgICAgICAgZ290byBlbmQ7CisgICAgfQorICAgIGlmICgocFN0YURzICYmCisgICAgICAgICAoKCAhdm9zX21lbV9jb21wYXJlKCh0QU5JX1U4ICopIHBTdGFEcy0+c3RhQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopIGFzc29jQ25mLnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSkgKSB8fAorICAgICAgICAgIChwU3RhRHMtPm1sbVN0YUNvbnRleHQubWxtU3RhdGUgIT0gZUxJTV9NTE1fV1RfQVNTT0NfQ05GX1NUQVRFKSB8fAorICAgICAgICAgICgocFN0YURzLT5tbG1TdGFDb250ZXh0LnN1YlR5cGUgPT0gTElNX0FTU09DKSAmJgorICAgICAgICAgICAobXNnVHlwZSAhPSBlV05JX1NNRV9BU1NPQ19DTkYpKSB8fAorICAgICAgICAgICgocFN0YURzLT5tbG1TdGFDb250ZXh0LnN1YlR5cGUgPT0gTElNX1JFQVNTT0MpICYmCisgICAgICAgICAgIChtc2dUeXBlICE9IGVXTklfU01FX1JFQVNTT0NfQ05GKSkpKSkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICBGTCgiUmVjZWl2ZWQgaW52YWxpZCBtZXNzYWdlICVYIGR1ZSB0byBwZWVyTWFjQWRkciBtaXNtYXRjaGVkI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YWMsIExPRzEsIEZMKCJzZW5kaW5nIEFzc29jIFJzcCBmcmFtZSB0byBTVEEgKGFzc29jIGlkPSVkKSAiKSwgcFN0YURzLT5hc3NvY0lkKTsKKyAgICAgICAgbGltU2VuZEFzc29jUnNwTWdtdEZyYW1lKCBwTWFjLCBlU0lSX1NVQ0NFU1MsIHBTdGFEcy0+YXNzb2NJZCwgcFN0YURzLT5zdGFBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+bWxtU3RhQ29udGV4dC5zdWJUeXBlLCBwU3RhRHMsIHBzZXNzaW9uRW50cnkpOworICAgICAgICBnb3RvIGVuZDsKKyAgICB9IC8vIChhc3NvY0NuZi5zdGF0dXNDb2RlID09IGVTSVJfU01FX1NVQ0NFU1MpCisgICAgZWxzZQorICAgIHsKKyAgICAgICAgLy8gU01FX0FTU09DX0NORiBzdGF0dXMgaXMgbm9uLXN1Y2Nlc3MsIHNvIFNUQSBpcyBub3QgYWxsb3dlZCB0byBiZSBhc3NvY2lhdGVkCisgICAgICAgIGxpbVJlamVjdEFzc29jaWF0aW9uKHBNYWMsIHBTdGFEcy0+c3RhQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5tbG1TdGFDb250ZXh0LnN1YlR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRydWUsIHBTdGFEcy0+bWxtU3RhQ29udGV4dC5hdXRoVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5hc3NvY0lkLCB0cnVlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhc3NvY0NuZi5zdGF0dXNDb2RlLCBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KK2VuZDoKKyAgICBpZiAoIHBzZXNzaW9uRW50cnktPnBhcnNlZEFzc29jUmVxW3BTdGFEcy0+YXNzb2NJZF0gIT0gTlVMTCApCisgICAgeworICAgIC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UsCisgICAgICAgICAgICAgICAgICAgICAgICBGTCggIkVycm9yOlVuYWJsZSB0byBnZXQgdGhlIFBFU2Vzc2lvbkVudHJ5IiApKTspCisgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBwQmVhY29uR2VuUGFyYW1zID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKCpwQmVhY29uR2VuUGFyYW1zKSk7CisgICAgaWYgKCBOVUxMID09IHBCZWFjb25HZW5QYXJhbXMgKQorICAgIHsKKyAgICAgICAgUEVMT0dFKCBsaW1Mb2coIHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgICAgICBGTCggIlVuYWJsZSB0byBhbGxvY2F0ZSBtZW1vcnkgZHVyaW5nIHNlbmRpbmcgYmVhY29uUHJlTWVzc2FnZSIgKSk7KQorICAgICAgICByZXR1cm47CisgICAgfQorICAgIHZvc19tZW1fc2V0KHBCZWFjb25HZW5QYXJhbXMsIHNpemVvZigqcEJlYWNvbkdlblBhcmFtcyksIDApOworICAgIHZvc19tZW1fY29weSgodm9pZCAqKSBwQmVhY29uR2VuUGFyYW1zLT5ic3NJZCwKKyAgICAgICAgICAgICAgICAgKHZvaWQgKilwc2Vzc2lvbkVudHJ5LT5ic3NJZCwKKyAgICAgICAgICAgICAgICAgIFNJUl9NQUNfQUREUl9MRU5HVEggKTsKKyAgICBsaW1Nc2cuYm9keXB0ciA9IHBCZWFjb25HZW5QYXJhbXM7CisgICAgc2NoUHJvY2Vzc1ByZUJlYWNvbkluZChwTWFjLCAmbGltTXNnKTsKKyAgICByZXR1cm47Cit9CisKK3ZvaWQgbGltU2VuZFNjYW5PZmZsb2FkQ29tcGxldGUodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpclJlc3VsdENvZGVzIHJlYXNvbkNvZGUpCit7CisgICAgdEFOSV9VMTYgc2NhblJzcExlbiA9IDA7CisKKyAgICBwTWFjLT5saW0uZ0xpbVNtZVNjYW5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fc2V0KCh0QU5JX1U4ICopdXVpZF9lLCBTSVJfV1BTX1VVSURfTEVOLCAwKTsKKworICAgIGZvciAocGJjID0gcHNlc3Npb25FbnRyeS0+cEFQV1BTUEJDU2Vzc2lvbjsgcGJjOyBwYmMgPSBwYmMtPm5leHQpIHsKKworICAgICAgICBpZiAoY3VyVGltZSA+IHBiYy0+dGltZXN0YW1wICsgU0lSX1dQU19QQkNfV0FMS19USU1FKQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY291bnQrKzsKKyAgICAgICAgaWYoY291bnQgPiAxKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAKKyAgICAgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4ICopYWRkciwgKHRBTklfVTggKilwYmMtPmFkZHIsIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKil1dWlkX2UsICh0QU5JX1U4ICopcGJjLT51dWlkX2UsIFNJUl9XUFNfVVVJRF9MRU4pOworICAgICAgICB9CisKKyAgICBpZiAoY291bnQgPiAxKQorICAgIHsKKyAgICAgICAgKm92ZXJsYXAgPSBlU0FQX1dQU1BCQ19PVkVSTEFQX0lOMTIwUzsgICAgLy8gT3ZlcmxhcCAgCisgICAgfQorICAgIGVsc2UgaWYoY291bnQgPT0gMCkKKyAgICB7CisgICAgICAgICpvdmVybGFwID0gZVNBUF9XUFNQQkNfTk9fV1BTUEJDX1BST0JFX1JFUV9JTjEyMFM7ICAgIC8vIG5vIFdQUyBwcm9iZSByZXF1ZXN0IGluIDEyMCBzZWNvbmQgICAgCisgICAgfSBlbHNlCisgICAgeworICAgICAgICAgKm92ZXJsYXAgPSBlU0FQX1dQU1BCQ19PTkVfV1BTUEJDX1BST0JFX1JFUV9JTjEyMFM7ICAgLy8gT25lIFdQUyBwcm9iZSByZXF1ZXN0IGluIDEyMCBzZWNvbmQKKyAgICB9CisKKyAgICBQRUxPR0UobGltTG9nKHBNYWM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BwYmMtPm5leHQ7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cEFQV1BTUEJDU2Vzc2lvbiA9IHBiYy0+bmV4dDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIHByZXYgPSBwYmM7CisgICAgICAgIHBiYyA9IHBiYy0+bmV4dDsKKyAgICB9CisKKyAgICBpZiAoIXBiYykgeworICAgICAgICBwYmMgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpcldQU1BCQ1Nlc3Npb24pKTsKKyAgICAgICAgaWYgKCBOVUxMID09IHBiYyApCisgICAgICAgIHsKKyAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIm1lbW9yeSBhbGxvY2F0ZSBmYWlsZWQhIikpOykKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKilwYmMtPmFkZHIsICh0QU5JX1U4ICopYWRkciwgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgCisgICAgICAgIGlmICh1dWlkX2UpCisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKilwYmMtPnV1aWRfZSwgKHRBTklfVTggKil1dWlkX2UsIFNJUl9XUFNfVVVJRF9MRU4pOworICAgIH0KKyAgICAKKyAgICBwYmMtPm5leHQgPSBwc2Vzc2lvbkVudHJ5LT5wQVBXUFNQQkNTZXNzaW9uOworICAgIHBzZXNzaW9uRW50cnktPnBBUFdQU1BCQ1Nlc3Npb24gPSBwYmM7CisgICAgcGJjLT50aW1lc3RhbXAgPSBjdXJUaW1lOworICAgIAorICAgIC8qIHJlbW92ZSBlbnRyaWVzIHRoYXQgaGF2ZSB0aW1lZCBvdXQgKi8KKyAgICBwcmV2ID0gcGJjOworICAgIHBiYyA9IHBiYy0+bmV4dDsKKworICAgIHdoaWxlIChwYmMpIHsKKyAgICAg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yBQQUxfVElDS1NfUEVSX1NFQ09ORCk7CisgICAgCisgICAgUEVMT0czKGxpbUxvZyhwTWFjLCBMT0czLCBGTCgiV1BTIFBCQyBjbGVhbnVwIHRpbWVvdXQgY3VyVGltZT0lZCIpLCBjdXJUaW1lKTspCisKKyAgICBwcmV2ID0gcHNlc3Npb25FbnRyeS0+cEFQV1BTUEJDU2Vzc2lvbjsgCisgICAgaWYocHJldikKKyAgICAgICAgcGJjID0gcHJldi0+bmV4dDsKKyAgICBlbHNlCisgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIAorICAgIHdoaWxlIChwYmMpIHsKKyAgICAgICAgaWYgKGN1clRpbWUgPiBwYmMtPnRpbWVzdGFtcCArIFNJUl9XUFNfUEJDX1dBTEtfVElNRSkgeworICAgICAgICAgICAgcHJldi0+bmV4dCA9IE5VTEw7CisgICAgICAgICAgICBsaW1SZW1vdmVUaW1lb3V0UEJDc2Vzc2lvbnMocE1hYywgcGJjKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIHByZXYgPSBwYmM7CisgICAgICAgIHBiYyA9IHBiYy0+bmV4dDsKKyAgICB9CisKKyAgICBpZihwcmV2KQorICAgIHsKKyAgICAgICAgIGlmIChjdXJUaW1lID4gcHJldi0+dGltZXN0YW1wICsgU0lSX1dQU19QQkNfV0FMS19USU1FKSB7CisgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wQVBXUFNQQkNTZXNzaW9uID0gTlVMTDsgIAorICAgICAgICAgICAgbGltUmVtb3ZlVGltZW91dFBCQ3Nlc3Npb25zKHBNYWMsIHByZXYpOworICAgICAgICAgfQorICAgIH0KKworfQorI2VuZGlmCisvKioKKyAqIGxpbVdQU1BCQ0Nsb3NlCisgKgorICpGVU5DVElPTjoKKyAqIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIHdoZW4gQlNTIGlzIGNsb3NlZAorICoKKyAqTE9HSUM6CisgKiBUaGlzIGZ1bmN0aW9uIHJlbW92ZSBhbGwgdGhlIFdQUyBQQkMgZW50cmllcworICoKKyAqQVNTVU1QVElPTlM6CisgKgorICoKKyAqTk9URToKKyAqCisgKiBAcGFyYW0gIHBNYWMgICBQb2ludGVyIHRvIEdsb2JhbCBNQUMgc3RydWN0dXJlCisgKiBAcGFyYW0gIHBzZXNzaW9uRW50cnkgICBBIHBvaW50ZXIgdG8gc3RhdGlvbiBQRSBzZXNzaW9uCisgKgorICogQHJldHVybiBOb25lCisgKi8KKwordm9pZCBsaW1XUFNQQkNDbG9zZSh0cEFuaVNpckdsb2JhbCBwTWFjLCB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KQoreworCisgICAgbGltUmVtb3ZlVGltZW91dFBCQ3Nlc3Npb25zKHBNYWMsIHBzZXNzaW9uRW50cnktPnBBUFdQU1BCQ1Nlc3Npb24pOworCit9CisKKy8qKgorICogbGltQ2hlY2sxMWJSYXRlcworICoKKyAqRlVOQ1RJT046CisgKiBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCBieSBsaW1Qcm9jZXNzUHJvYmVSZXFGcmFtZSgpIHVwb24KKyAqIFByb2JlIFJlcXVlc3QgZnJhbWUgcmVjZXB0aW9uLgorICoKKyAqTE9HSUM6CisgKiBUaGlzIGZ1bmN0aW9uIGNoZWNrIDExYiByYXRlcyBpbiBzdXBwb3J0ZWRSYXRlcyBhbmQgZXh0ZW5kZWRSYXRlcyByYXRlcworICogCisgKk5PVEU6CisgKgorICogQHBhcmFtICByYXRlICAgCisgKgorICogQHJldHVybiBCT09MRUFOCisgKi8KKwordEFOSV9CT09MRUFOIGxpbUNoZWNrMTFiUmF0ZXModEFOSV9VOCByYXRlKQoreworICAgIGlmICggKCAweDAyID09IChyYXRlKSkKKyAgICAgIHx8ICggMHgwNCA9PSAocmF0ZSkpCisgICAgICB8fCAoIDB4MGIgPT0gKHJhdGUpKQorICAgICAgfHwgKCAweDE2ID09IChyYXRlKSkKKyAgICAgICApCisgICAgICAgeworICA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ZCBQRFVzCisgKgorICogQHJldHVybiBOb25lCisgKi8KKwordm9pZAorbGltUHJvY2Vzc1Byb2JlUmVxRnJhbWUodHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VOCAqcFJ4UGFja2V0SW5mbyx0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KQoreworICAgIHRBTklfVTggICAgICAgICAgICAgKnBCb2R5OworICAgIHRwU2lyTWFjTWdtdEhkciAgICAgcEhkcjsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgIGZyYW1lTGVuOworICAgIHRTaXJQcm9iZVJlcSAgICAgICAgcHJvYmVSZXE7CisgICAgdEFuaVNTSUQgICAgICAgICAgICBzc0lkOworICAgIHRTaXJNc2dRICAgICAgICAgICAgbXNnUTsKKyAgICB0U2lyU21lUHJvYmVSZXEgICAgICpwU2lyU21lUHJvYmVSZXE7CisgICAgdEFOSV9VMzIgICAgICAgICAgICB3cHNBcEVuYWJsZT0wLCB0bXA7CisKKyAgICBkb3sKKyAgICAgICAgLy8gRG9uJ3Qgc2VuZCBwcm9iZSByZXNwb25zZXMgaWYgZGlzYWJsZWQKKyAgICAgICAgaWYgKHBNYWMtPmxpbS5nTGltUHJvYmVSZXNwRGlzYWJsZUZsYWcpCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICAvLyBEb24ndCBzZW5kIHByb2JlIHJlc3BvbnNlIGlmIFAyUCBnbyBpcyBzY2FubmluZyB0aWxsIHNjYW4gY29tZSB0byBpZGxlIHN0YXRlLiAKKyAgICAgICAgaWYoKHBzZXNzaW9uRW50cnktPnBlUGVyc29uYSA9PSBWT1NfUDJQX0dPX01PREUpICYmICgocE1hYy0+bGltLmdwTGltUmVtYWluT25DaGFuUmVxICkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAocE1hYy0+bGltLmdMaW1IYWxTY2FuU3RhdGUgIT0gZUxJTV9IQUxfSURMRV9TQ0FOX1NUQVRFKSkpCisgICAgICAgIHsKKyA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yAgICAgICAgICAgcEJvZHkgPSBXREFfR0VUX1JYX01QRFVfREFUQShwUnhQYWNrZXRJbmZvKTsKKworICAgICAgICAgICAgLy8gUGFyc2UgUHJvYmUgUmVxdWVzdCBmcmFtZQorICAgICAgICAgICAgaWYgKHNpckNvbnZlcnRQcm9iZVJlcUZyYW1lMlN0cnVjdChwTWFjLCBwQm9keSwgZnJhbWVMZW4sICZwcm9iZVJlcSk9PWVTSVJfRkFJTFVSRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQRUxPR1cobGltTG9nKHBNYWMsIExPR0UsIEZMKCJQYXJzZSBlcnJvciBQcm9iZVJlcXVlc3QsIgorICAgICAgICAgICAgICAgICIgbGVuZ3RoPSVkLCBTQSBpczoiIE1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgIGZyYW1lTGVuLE1BQ19BRERSX0FSUkFZKHBIZHItPnNhKSk7KQorICAgICAgICAgICAgICAgIHBNYWMtPnN5cy5wcm9iZUVycm9yKys7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPnBlUGVyc29uYSA9PSBWT1NfUDJQX0dPX01PREUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGkgPSAwLCByYXRlXzExYiA9IDAsIG90aGVyX3JhdGVzID0gMDsKKyAgICAgICAgICAgICAgICAgICAgLy8gQ2hlY2sgMTFiIHJhdGVzIGluIHN1cHBvcnRlZCByYXRlcworICAgICAgICAgICAgICAgICAgICBmb3IgKCBpID0gMCA7IGkgPCBwcm9iZVJlcS5zdXBwb3J0ZWRSYXRlcy5udW1SYXRlczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkrKyApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsaW1DaGVjazExYlJhdGVzKHByb2JlUmVxLnN1cHBvcnRlZFJhdGVzLnJhdGVbaV0gJiAweDdmKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByYXRlXzExYisrOyAKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdGhlcl9yYXRlcysrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLy8gQ2hlY2sgMTFiIHJhdGVzIGluIGV4dGVuZGVkIHJhdGVzCisgICAgICAgICAgICAgICAgICAgIGZvciAoIGkgPSAwIDsgaSA8IHByb2JlUmVxLmV4dGVuZGVkUmF0ZXMubnVtUmF0ZXM7IGkrKyApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsaW1DaGVjazExYlJhdGVzKHByb2JlUmVxLmV4dGVuZGVkUmF0ZXMucmF0ZVtpXSAmIDB4N2YpKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJhdGVfMTFiKys7IAorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG90aGVyX3JhdGVzKys7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoIChyYXRlXzExYiA+IDApICYmIChvdGhlcl9yYXRlcyA9PSAwKSApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFBFTE9HMyhsaW1Mb2cocE1hYywgTE9HMywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIlJlY2VpdmVkIGEgcHJvYmUgcmVxdWVzdCBmcmFtZSB3aXRoIG9ubHkgMTFiIHJhdGVzLCBTQSBpczogIikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVByaW50TWFjQWRkcihwTWFjLCBwSGRyLT5zYSwgTE9HMyk7KQorICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICgocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0FQX1JPTEUpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBpZiAoIChwc2Vzc2lvbkVudHJ5LT5BUFdQU0lFcy5TaXJXUFNQcm9iZVJzcElFLkZpZWxkUHJlc2VudCAmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9XUFNfUFJPQlJTUF9WRVJfUFJFU0VOVCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAocHJvYmVSZXEud3NjSWVQcmVzZW50ID09ICAxKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgIChwcm9iZVJlcS5wcm9iZVJlcVdzY0llSW5mby5EZXZpY2VQYXNzd29yZElELmlkID09IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXU0NfUEFTU1dEX0lEX1BVU0hfQlVUVE9OKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgIChwcm9iZVJlcS5wcm9iZVJlcVdzY0llSW5mby5VVUlEX0UucHJlc2VudCA9PSAxKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+ZndkV1BTUEJDUHJvYmVSZXEpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUEVMT0c0KHNpckR1bXBCdWYocE1hYywgU0lSX0xJTV9NT0RVTEVfSUQsIExPRzQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EsIHNpemVvZih0U2lyTWFjQWRkcikpOykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBQRUxPRzQoc2lyRHVtcEJ1ZihwTWFjLCBTSVJfTElNX01PRFVMRV9JRCwgTE9HNCwgcEJvZHksIGZyYW1lTGVuKTspCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltU2VuZFNtZVByb2JlUmVxSW5kKHBNYWMsIHBIZHItPnNhLCBwQm9keSwgZnJhbWVMZW4sIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgICAgICAgICAgfSAKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1VcGRhdGVQQkNTZXNzaW9uRW50cnkocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkci0+c2EsIHByb2JlUmVxLnByb2JlUmVxV3NjSWVJbmZvLlVVSURfRS51dWlkLCBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgKHRBTklfVTE2KSBXTklfQ0ZHX1dQU19FTkFCTEUsICZ0bXApICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCJGYWlsZWQgdG8gY2ZnIGdldCBpZCAlZCIsIFdOSV9DRkdfV1BTX0VOQUJMRSApOworCisgICAgICAgICAgICAgICAgICAgIHdwc0FwRW5hYmxlID0gdG1wICYgV05JX0NGR19XUFNfRU5BQkxFX0FQOworICAgICAgICAgICAgICAgICAgICBpZiAoKHdwc0FwRW5hYmxlKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgKHByb2JlUmVxLndzY0llUHJlc2VudCA9PSAgMSkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIChwcm9iZVJlcS5wcm9iZVJlcVdzY0llSW5mby5EZXZpY2VQYXNzd29yZElELmlkID09IFdTQ19QQVNTV0RfSURfUFVTSF9CVVRUT04pKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBzZW5kIHRoZSBwcm9iZSByZXEgdG8gV1NNIHdoZW4gaXQgaXMgZnJvbSBhIFBCQyBzdGF0aW9uIAorICAgICAgICAgICAgICAgICAgICAgICAgcFNpclNtZVByb2JlUmVxID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRTaXJTbWVQcm9iZVJlcSkpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCBOVUxMID09IHBTaXJTbWVQcm9iZVJlcSApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoImNhbGwgdG8gQWxsb2NhdGVNZW1vcnkgZmFpbGVkIGZvciBlV05JX1NNRV9QUk9CRV9SRVEiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgbXNnUS50eXBlID0gZVdOSV9TTUVfUFJPQkVfUkVROworICAgICAgICAgICAgICAgICAgICAgICAgbXNnUS5ib2R5dmFsID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1zZ1EuYm9keXB0ciA9IHBTaXJTbWVQcm9iZVJlcTsKKworICAgICAgICAgICAgICAgICAgICAgICAgcFNpclNtZVByb2JlUmVxLT5tZXNzYWdlVHlwZSA9IGVXTklfU01FX1BST0JFX1JFUTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTaXJTbWVQcm9iZVJlcS0+bGVuZ3RoID0gc2l6ZW9mKHRTaXJTbWVQcm9iZVJlcSk7CisgICAgICAgICAgICAgICAgICAgICAgICBwU2lyU21lUHJvYmVSZXEtPnNlc3Npb25JZCA9IHBzZXNzaW9uRW50cnktPnNtZVNlc3Npb25JZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwU2lyU21lUHJvYmVSZXEtPnBlZXJNYWNBZGRyLCBwSGRyLT5zYSwgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBwU2lyU21lUHJvYmVSZXEtPmRldmljZVBhc3N3ZElkID0gcHJvYmVSZXEucHJvYmVSZXFXc2NJZUluZm8uRGV2aWNlUGFzc3dvcmRJRC5pZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RYX1NNRV9NU0csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsIG1zZ1EudHlwZSkpOworICAgICAgICAgICAgICAgICAgICAgICBpZiAobGltU3lzUHJvY2Vzc01taE1zZ0FwaShwTWFjLCAmbXNnUSwgIGVQUk9UKSAhPSBlU0lSX1NVQ0NFU1MpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBFTE9HMyhsaW1Mb2cocE1hYywgTE9HMywgRkwoImNvdWxkbnQgc2VuZCB0aGUgcHJvYmUgcmVxIHRvIHdzbSAiKSk7KQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBzc0lkLmxlbmd0aCA9IHBzZXNzaW9uRW50cnktPnNzSWQubGVuZ3RoOworICAgICAgICAgICAgIC8qIENvcHkgdGhlIFNTSUQgZnJvbSBzZXNzaW8gZW50cnkgdG8gbG9jYWwgdmFyaWFibGUgKi8KKyAgICAgICAgICAgIHZvc19tZW1fY29weShzc0lkLnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+c3NJZC5zc0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnNzSWQubGVuZ3RoKTsKKworICAgICAgICAgICAgLy8gQ29tcGFyZSByZWNlaXZlZCBTU0lEIHdpdGggY3VycmVudCBTU0lELiBJZiB0aGV5CisgICAgICAgICAgICAvLyBtYXRjaCwgcmVwbHkgd2l0aCBQcm9iZSBSZXNwb25zZS4KKyAgICAgICAgICAgIGlmIChwcm9iZVJlcS5zc0lkLmxlbmd0aCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoIXNzSWQubGVuZ3RoKQorICAgICAgICAgICAgICAgICAgICBnb3RvIG11bHRpcGxlU1NJRGNoZWNrOworCisgICAgICAgICAgICAgICAgaWYgKHZvc19tZW1fY29tcGFyZSgodEFOSV9VOCAqKSAmc3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopICYocHJvYmVSZXEuc3NJZCksICh0QU5JX1U4KSAoc3NJZC5sZW5ndGggKyAxKSkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbGltU2VuZFByb2JlUnNwTWdtdEZyYW1lKHBNYWMsIHBIZHItPnNhLCAmc3NJZCwgRFBIX1VTRV9NR01UX1NUQUlELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRFBIX05PTl9LRUVQQUxJVkVfRlJBTUUsIHBzZXNzaW9uRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9iZVJlcS5wMnBJZVByZXNlbnQpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAocHNlc3Npb25FbnRyeS0+cGVQZXJzb25hID09IFZPU19QMlBfR09fTU9ERSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHRBTklfVTggICBkaXJlY3Rfc3NpZFs3XSA9ICJESVJFQ1QtIjsKKyAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAgIGRpcmVjdF9zc2lkX2xlbiA9IDc7CisgICAgICAgICAgICAgICAgICAgIGlmICh2b3NfbWVtX2NvbXBhcmUoKHRBTklfVTggKikgJmRpcmVjdF9zc2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTggKikgJihwcm9iZVJlcS5zc0lkLnNzSWQpLCAodEFOSV9VOCkgKGRpcmVjdF9zc2lkX2xlbikpICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgbGltU2VuZFByb2JlUnNwTWdtdEZyYW1lKHBNYWMsIHBIZHItPnNhLCAmc3NJZCwgRFBIX1VTRV9NR01UX1NUQUlELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRFBIX05PTl9LRUVQQUxJVkVfRlJBTUUsIHBzZXNzaW9uRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9iZVJlcS5wMnBJZVByZXNlbnQpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBQRUxPRzMobGltTG9nKHBNYWMsIExPRzMsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJJZ25vcmluZyBQcm9iZVJlcSBmcmFtZSB3aXRoIHVubWF0Y2hlZCBTU0lEIHJlY2VpdmVkIGZyb20gIikpOworICAgICAgICAgICAgICAgICAgICBsaW1QcmludE1hY0FkZHIocE1hYywgcEhkci0+c2EsIExPRzMpOykKKyAgICAgICAgICAgICAgICAgICAgcE1hYy0+c3lzLnByb2JlQmFkU3NpZCsrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmICgoVk9TX1AyUF9HT19NT0RFID09IHBzZXNzaW9uRW50cnktPnBlUGVyc29uYSkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bWlyYWNhc3RWZW5kb3JDb25maWcpCisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisKKyAgICAgICAgICAgICAgICAgICAgLy8gQnJvYWRjYXN0IFNTSUQgaW4gdGhlIFByb2JlIFJlcXVlc3QuCisgICAgICAgICAgICAgICAgICAgIC8vIFJlcGx5IHdpdGggU1NJRCB3ZSdyZSBjb25maWd1cmVkIHdpdGguCisgICAgICAgICAgICAgICAgICAgIC8vVHVybiBvZmYgdGhlIFNTSUQgbGVuZ3RoIHRvIDAgaWYgaGlkZGVuIFNTSUQgZmVhdHVyZSBpcyBwcmVzZW50CisgICAgICAgICAgICAgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPnNzaWRIaWRkZW4pCisgICAgICAgICAgICAgICAgICAgICAgLypXZSBhcmUgcmV0dXJuaW5nIGZyb20gaGVyZSBhcyBwcm9iZSByZXF1ZXN0IGNvbnRhaW5zIHRoZSBicm9hZGNhc3QgU1NJRC4KKyAgICAgICAgICAgICAgICAgICAgICAgIFNvIG5vIG5lZWQgdG8gc2VuZCB0aGUgcHJvYmUgcmVzcCovCisgICAgICAgICAgICAgICAgICAgICAgICAvL3NzSWQubGVuZ3RoID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgbGltU2VuZFByb2JlUnNwTWdtdEZyYW1lKHBNYWMsIHBIZHItPnNhLCAmc3NJZCwgRFBIX1VTRV9NR01UX1NUQUlELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRFBIX05PTl9LRUVQQUxJVkVfRlJBTUUsIHBzZXNzaW9uRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9iZVJlcS5wMnBJZVByZXNlbnQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KK211bHRpcGxlU1NJRGNoZWNrOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgUEVMT0czKGxpbUxvZyhwTWFjLCBMT0czLAorICAgICAgICAgICAgICAgICAgIEZMKCJJZ25vcmluZyBQcm9iZVJlcSBmcmFtZSB3aXRoIHVubWF0Y2hlZCBTU0lEIHJlY2VpdmVkIGZyb20gIikpOworICAgICAgICAgICAgICAgIGxpbVByaW50TWFjQWRkcihwTWFjLCBwSGRyLT5zYSwgTE9HMyk7KQorICAgICAgICAgICAgICAgIHBNYWMtPnN5cy5wcm9iZUJhZFNzaWQrKzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIElnbm9yZSByZWNlaXZlZCBQcm9iZSBSZXF1ZXN0IGZyYW1lCisgICAgICAgICAgICBQRUxPRzMobGltTG9nKHBNYWMsIExPR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Npb25JZChwTWFjLGkpOworICAgICAgICBpZiAoIChwc2Vzc2lvbkVudHJ5ICE9IE5VTEwpICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKChlTElNX0FQX1JPTEUgPT0gcHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSkKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfUDJQX0lOVEVSTkFMCisgICAgICAgICAgICAgfHwgKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9QMlBfREVWSUNFX1JPTEUpCisjZW5kaWYKKyAgICAgICAgICAgICAgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUluZGljYXRlUHJvYmVSZXFUb0hERChwTWFjLCBwQmQsIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKCAoZUxJTV9BUF9ST0xFID09IHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUpIHx8CisgICAgICAgICAgICAgICAgKGVMSU1fU1RBX0lOX0lCU1NfUk9MRSA9PSBwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlKSB8fAorICAgICAgICAgICAgICAgIChlTElNX0JUX0FNUF9BUF9ST0xFID09IHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUpIHx8CisgICAgICAgICAgICAgICAgKGVMSU1fQlRfQU1QX1NUQV9ST0xFID09IHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUpCisgICAgICAgICAgICAgICApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltUHJvY2Vzc1Byb2JlUmVxRnJhbWUocE1hYyxwQmQscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKK30gLyoqKiBlbmQgbGltUHJvY2Vzc1Byb2JlUmVxRnJhbWVfbXVsdGlwbGVfQlNTKCkgKioqLworCisvKioKKyAqIGxpbVNlbmRTbWVQcm9iZVJlcUluZCgpCisgKgorICpGVU5DVElPTjoKKyAqIFRoaXMgZnVuY3Rpb24gaXMgdG8gc2VuZAorICogIGVXTklfU01FX1dQU19QQkNfUFJPQkVfUkVRX0lORCBtZXNzYWdlIHRvIGhvc3QKKyAqCisgKlBBUkFNUzoKKyAqCisgKkxPR0lDOgorICoKKyAqQVNTVU1QVElPTlM6CisgKiBOQQorICoKKyAqTk9URToKKyAqIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCBmb3Igc2VuZGluZyAgZVdOSV9TTUVfV1BTX1BCQ19QUk9CRV9SRVFfSU5ECisgKiB0byBob3N0LgorICoKKyAqIEBwYXJhbSBwZWVyTWFjQWRkciAgICAgICBJbmRpY2F0ZXMgdGhlIHBlZXIgTUFDIGFkZHIgdGhhdCB0aGUgcHJvYmUgcmVxdWVzdAorICogICAgICAgICAgICAgICAgICAgICAgICAgIGlzIGdlbmVyYXRlZC4KKyAqIEBwYXJhbSBwUHJvYmVSZXFJRSAgICAgICBwb2ludGVyIHRvIFJBVyBwcm9iZSByZXF1ZXN0IElFCisgKiBAcGFyYW0gUHJvYmVSZXFJRUxlbiAgICAgVGhlIGxlbmd0aCBvZiBwcm9iZSByZXF1ZXN0IElFLgorICogQHBhcmFtIHBzZXNzaW9uRW50cnkgICAgIEEgcG9pbnRlciB0byBQRSBzZXNzaW9uCisgKgorICogQHJldHVybiBOb25lCisgKi8KK3ZvaWQKK2xpbVNlbmRTbWVQcm9iZVJlcUluZCh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNBZGRyIHBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBQcm9iZVJlcUlFLAorICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIFByb2JlUmVxSUVMZW4sIAorICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpCit7CisgICAgdFNpclNtZVByb2JlUmVxSW5kICAgICAqcFNpclNtZVByb2JlUmVxSW5kOworICAgIHRTaXJNc2dRICAgICAgICAgICAgICAgIG1zZ1E7ICAgCisKKyAgICBwU2lyU21lUHJvYmVSZXFJbmQgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpclNtZVByb2JlUmVxSW5kKSk7CisgICAgaWYgKCBOVUxMID09IHBTaXJTbWVQcm9iZVJlcUluZCApCisgICAgeworICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICBGTCgiY2FsbCB0byBBbGxvY2F0ZU1lbW9yeSBmYWlsZWQgZm9yIGVXTklfU01FX1BST0JFX1JFUSIpKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgCisgICAgbXNnUS50eXBlID0gIGVXTklfU01FX1dQU19QQkNfUFJPQkVfUkVRX0lORDsKKyAgICBtc2dRLmJvZHl2YWwgPSAwOworICAgIG1zZ1EuYm9keXB0ciA9IHBTaXJTbWVQcm9iZVJlcUluZDsKKyAgICAKKyAgICBwU2lyU21lUHJvYmVSZXFJbmQtPm1lc3NhZ2VUeXBlID0gIGVXTklfU01FX1dQU19QQkNfUFJPQkVfUkVRX0lORDsKKyAgICBwU2lyU21lUHJvYmVSZXFJbmQtPmxlbmd0aCA9IHNpemVvZih0U2lyU21lUHJvYmVSZXEpOworICAgIHBTaXJTbWVQcm9iZVJlcUluZC0+c2Vzc2lvbklkID0gcHNlc3Npb25FbnRyeS0+c21lU2Vzc2lvbklkOworCisgICAgdm9zX21lbV9jb3B5KHBTaXJTbWVQcm9iZVJlcUluZC0+YnNzSWQsIHBzZXNzaW9uRW50cnktPmJzc0lkLCBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICB2b3NfbWVtX2NvcHkocFNpclNtZVByb2JlUmVxSW5kLT5XUFNQQkNQcm9iZVJlcS5wZWVyTWFjQWRkciwgcGVlck1hY0FkZHIsIHNpemVvZih0U2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gICAgdHBTaXJNYWNNZ210SGRyICAgICBwSGRyOworICAgIHRBTklfVTMyICAgICAgICAgICAgZnJhbWVMZW47CisgICAgdFNpclByb2JlUmVxICAgICAgICBwcm9iZVJlcTsKKworICAgIHBIZHIgPSAgV0RBX0dFVF9SWF9NQUNfSEVBREVSKHBCZCk7CisgICAgLy8gR2V0IHBvaW50ZXIgdG8gUHJvYmUgUmVxdWVzdCBmcmFtZSBib2R5CisgICAgcEJvZHkgPSAgV0RBX0dFVF9SWF9NUERVX0RBVEEocEJkKTsgICAKKworICAgIGlmKCAocEJvZHlbMF0gPT0gMCkgJiYgKHBCb2R5WzFdID09IHNzSWQubGVuZ3RoKSAmJgorICAgICAgKHZvc19tZW1fY29tcGFyZShzc0lkLnNzSWQsIHBCb2R5ICsgMiwKKyAgICAgICAgICAgICAgICAgICAgICAgc3NJZC5sZW5ndGgpKSkKKyAgICB7CisgICAgICAgIC8vIFBhcnNlIFByb2JlIFJlcXVlc3QgZnJhbWUKKyAgICAgICAgZnJhbWVMZW4gPSBXREFfR0VUX1JYX1BBWUxPQURfTEVOKHBCZCk7CisgICAgICAgIGlmIChlU0lSX0ZBSUxVUkUgPT0gc2lyQ29udmVydFByb2JlUmVxRnJhbWUyU3RydWN0KHBNYWMsIHBCb2R5LCBmcmFtZUxlbiwgJnByb2JlUmVxKSkKKyAgICAgICAgeworICAgICAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiUGFyc2UgZXJyb3IgUHJvYmVSZXF1ZXN0LCBsZW5ndGg9JWQsIFNBIGlzOiIpLCBmcmFtZUxlbik7KQorICAgICAgICAgICAgbGltUHJpbnRNYWNBZGRyKHBNYWMsIHBIZHItPnNhLCBMT0dXKTsKKyAgICAgICAgICAgIHBNYWMtPnN5cy5wcm9iZUVycm9yKys7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBpZiAocHNlc3Npb25FbnRyeS0+cGVQZXJzb25hID09IFZPU19Q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VUxMID09IHBQcm9iZVJzcCApCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlVuYWJsZSB0byBhbGxvY2F0ZSBtZW1vcnkgaW4gbGltUHJvY2Vzc1Byb2JlUnNwRnJhbWUiKSApOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgcFByb2JlUnNwLT5zc0lkLmxlbmd0aCAgICAgICAgICAgICAgPSAwOworICAgIHBQcm9iZVJzcC0+d3BhLmxlbmd0aCAgICAgICAgICAgICAgID0gMDsKKyAgICBwUHJvYmVSc3AtPnByb3BJRWluZm8uYXBOYW1lLmxlbmd0aCA9IDA7CisKKworICAgIHBIZHIgPSBXREFfR0VUX1JYX01BQ19IRUFERVIocFJ4UGFja2V0SW5mbyk7CisKKworICAgbGltTG9nKHBNYWMsIExPRzIsCisgICAgICAgICAgICAgRkwoIlJlY2VpdmVkIFByb2JlIFJlc3BvbnNlIGZyYW1lIHdpdGggbGVuZ3RoPSVkIGZyb20gIiksCisgICAgICAgICAgICAgV0RBX0dFVF9SWF9NUERVX0xFTihwUnhQYWNrZXRJbmZvKSk7CisgICAgbGltUHJpbnRNYWNBZGRyKHBNYWMsIHBIZHItPnNhLCBMT0cyKTsKKworICAgaWYgKCFwTWFjLT5mU2Nhbk9mZmxvYWQpCisgICB7CisgICAgICAgaWYgKGxpbURlYWN0aXZhdGVNaW5DaGFubmVsVGltZXJEdXJpbmdTY2FuKHBNYWMpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICB7CisgICAgICAgICAgIHZvc19tZW1fdmZyZWUocFByb2JlUnNwKTsKKyAgICAgICAgICAgcmV0dXJuOworICAgICAgIH0KKyAgIH0KKworICAgLy8gVmFsaWRhdGUgSUUgaW5mb3JtYXRpb24gYmVmb3JlIHByb2Nlc3NpbmcgUHJvYmUgUmVzcG9uc2UgRnJhbWUKKyAgIGlmIChsaW1WYWxpZGF0ZUlFSW5mb3JtYXRpb25JblByb2JlUnNwRnJhbWUocE1hYywgc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4dGggb2N0CisgICAgICAgIHsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVMSU1fTUxNX1dUX0pPSU5fQkVBQ09OX1NUQVRFKQorICAgICAgICB7CisgICAgICAgICAgICBpZiggcHNlc3Npb25FbnRyeS0+YmVhY29uICE9IE5VTEwgKS8vRWl0aGVyIEJlYWNvbi9wcm9iZSByZXNwb25zZSBpcyByZXF1aXJlZC4gSGVuY2Ugc3RvcmUgaXQgaW4gc2FtZSBidWZmZXIuCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBzZXNzaW9uRW50cnktPmJlYWNvbik7CisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+YmVhY29uID0gTlVMTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmJjbkxlbiA9IFdEQV9HRVRfUlhfUEFZTE9BRF9MRU4ocFJ4UGFja2V0SW5mbyk7CisKKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmJlYWNvbiA9IHZvc19tZW1fbWFsbG9jKHBzZXNzaW9uRW50cnktPmJjbkxlbik7CisgICAgICAgICAgICBpZiAoIE5VTEwgPT0gcHNlc3Npb25FbnRyeS0+YmVhY29uICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiVW5hYmxlIHRvIGFsbG9jYXRlIG1lbW9yeSB0byBzdG9yZSBiZWFjb24iKSk7KQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vU3RvcmUgdGhlIEJlYWNvbi9Qcm9iZVJzcC4gVGhpcyBpcyBzZW50IHRvIGNzci9oZGQgaW4gam9pbiBjbmYgcmVzcG9uc2UuIAorICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwc2Vzc2lvbkVudHJ5LT5iZWFjb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdEQV9HRVRfUlhfTVBEVV9EQVRBKHBSeFBhY2tldEluZm8pLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5iY25MZW4pOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBTVEEgaW4gV1RfSk9JTl9CRUFDT05fU1RBVEUKKyAgICAgICAgICAgIGxpbUNoZWNrQW5kQW5ub3VuY2VKb2luU3VjY2VzcyhwTWFjLCBwUHJvYmVSc3AsIHBIZHIsIHBzZXNzaW9uRW50cnkpOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYocHNlc3Npb25FbnRyeS0+bGltTWxtU3RhdGUgPT0gZUxJTV9NTE1fTElOS19FU1RBQkxJU0hFRF9TVEFURSkKKyAgICAgICAgeworICAgICAgICAgICAgdHBEcGhIYXNoTm9kZSBwU3RhRHMgPSBOVUxMOworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBDaGVjayBpZiB0aGlzIFByb2JlIFJlc3BvbnNlIGlzIGZvcgorICAgICAgICAgICAgKiBvdXIgUHJvYmUgUmVxdWVzdCBzZW50IHVwb24gcmVhY2hpbmcKKyAgICAgICAgICAgICogaGVhcnQgYmVhdCB0aHJlc2hvbGQKKyAgICAgICAgICAgICovCisgICAgICAgICAgICAjaWYgMAorICAgICAgICAgICAgaWYgKHdsYW5fY2ZnR2V0U3RyKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfQlNTSUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRCc3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJmNmZykgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vLyBDb3VsZCBub3QgZ2V0IEJTU0lEIGZyb20gQ0ZHLiBMb2cgZXJyb3IuCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgQlNTSUQiKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAjZW5kaWYgLy9UTyBTVVBQT1JUIEJULUFNUAorICAgICAgICAgICAgc2lyQ29weU1hY0FkZHIoY3VycmVudEJzc0lkLHBzZXNzaW9uRW50cnktPmJzc0lkKTsKKworICAgICAgICAgICAgaWYgKCAhdm9zX21lbV9jb21wYXJlKGN1cnJlbnRCc3NJZCwgcEhkci0+YnNzSWQsIHNpemVvZih0U2lyTWFjQWRkcikpICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX3ZmcmVlKHBQcm9iZVJzcCk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoIUxJTV9JU19DT05ORUNUSU9OX0FDVElWRShwc2Vzc2lvbkVudHJ5KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgICAgICAgICAgRkwoIlJlY2VpdmVkIFByb2JlIFJlc3AgZnJvbSBBUC4gU28gaXQgaXMgYWxpdmUhISIpKTsKKworICAgICAgICAgICAgICAgIGlmIChwUHJvYmVSc3AtPkhUSW5mby5wcmVzZW50KQorICAgICAgICAgICAgICAgICAgICBsaW1SZWNlaXZlZEhCSGFuZGxlcihwTWFjLCAodEFOSV9VOClwUHJvYmVSc3AtPkhUSW5mby5wcmltYXJ5Q2hhbm5lbCwgcHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICBsaW1SZWNlaXZlZEhCSGFuZGxlcihwTWFjLCAodEFOSV9VOClwUHJvYmVSc3AtPmNoYW5uZWxOdW1iZXIsIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fU1RBX1JPTEUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHBQcm9iZVJzcC0+Y2hhbm5lbFN3aXRjaFByZXNlbnQgfHwKKyAgICAgICAgICAgICAgICAgICAgcFByb2JlUnNwLT5wcm9wSUVpbmZvLnByb3BDaGFubmVsU3dpdGNoUHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGxpbVVwZGF0ZUNoYW5uZWxTd2l0Y2gocE1hYywgcFByb2JlUnNwLCBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAocHNlc3Npb25FbnRyeS0+Z0xpbVNwZWNNZ210LmRvdDExaENoYW5Td1N0YXRlID09IGVMSU1fMTFIX0NIQU5TV19SVU5OSU5HKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbGltQ2FuY2VsRG90MTFoQ2hhbm5lbFN3aXRjaChwTWFjLCBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIAorICAgICAgICAgICAgCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICogTm93IFByb2Nlc3MgRURDQSBQYXJhbWV0ZXJzLCBpZiBFRENBUGFyYW1TZXQgY291bnQgaXMgZGlmZmVyZW50LgorICAgICAgICAgICAgKiAgICAgLS0gV2hpbGUgcHJvY2Vzc2luZyBiZWFjb25zIGluIGxpbmsgZXN0YWJsaXNoZWQgc3RhdGUgaWYgaXQgaXMgZGV0ZXJtaW5lZCB0aGF0CisgICAgICAgICAgICAqICAgICAgICAgUW9TIEluZm8gSUUgaGFzIGEgZGlmZmVyZW50IGNvdW50IGZvciBFRENBIFBhcmFtcywKKyAgICAgICAgICAgICogICAgICAgICBhbmQgRURDQSBJRSBpcyBub3QgcHJlc2VudCBpbiBiZWFjb24sCisgICAgICAgICAgICAqICAgICAgICAgdGhlbiBwcm9iZSByZXEgaXMgc2VudCBvdXQgdG8gZ2V0IHRoZSBFRENBIHBhcmFtcy4KKyAgICAgICAgICAgICovCisKKyAgICAgICAgICAgIHBTdGFEcyA9IGRwaEdldEhhc2hFbnRyeShwTWFjLCBEUEhfU1RBX0hBU0hfSU5ERVhfUEVFUiwgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUpOworCisgICAgICAgICAgICBsaW1HZXRRb3NNb2RlKHBzZXNzaW9uRW50cnksICZxb3NFbmFibGVkKTsKKyAgICAgICAgICAgIGxpbUdldFdtZU1vZGUocHNlc3Npb25FbnRyeSwgJndtZUVuYWJsZWQpOworICAgICAgICAgICBQRUxPRzIobGltTG9nKHBNYWMsIExPRzIsCisgICAgICAgICAgICAgICAgICAgIEZMKCJ3bWVFZGNhUHJlc2VudDogJWQgd21lRW5hYmxlZDogJWQsIGVkY2FQcmVzZW50OiAlZCwgcW9zRW5hYmxlZDogJWQsICBlZGNhUGFyYW1zLnFvc0luZm8uY291bnQ6ICVkIHNjaE9iamVjdC5nTGltRWRjYVBhcmFtU2V0Q291bnQ6ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBQcm9iZVJzcC0+d21lRWRjYVByZXNlbnQsIHdtZUVuYWJsZWQsIHBQcm9iZVJzcC0+ZWRjYVByZXNlbnQsIHFvc0VuYWJsZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBQcm9iZVJzcC0+ZWRjYVBhcmFtcy5xb3NJbmZvLmNvdW50LCBwc2Vzc2lvbkVudHJ5LT5nTGltRWRjYVBhcmFtU2V0Q291bnQpOykKKyAgICAgICAgICAgIGlmICgoKHBQcm9iZVJzcC0+d21lRWRjYVByZXNlbnQgJiYgd21lRW5hYmxlZCkgfHwKKyAgICAgICAgICAgICAgICAocFByb2JlUnNwLT5lZGNhUHJlc2VudCAmJiBxb3NFbmFibGVkKSkgJiYKKyAgICAgICAgICAgICAgICAocFByb2JlUnNwLT5lZGNhUGFyYW1zLnFvc0luZm8uY291bnQgIT0gcHNlc3Npb25FbnRyeS0+Z0xpbUVkY2FQYXJhbVNldENvdW50KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoc2NoQmVhY29uRWRjYVByb2Nlc3MocE1hYywgJnBQcm9iZVJzcC0+ZWRjYVBhcmFtcywgcHNlc3Npb25FbnRyeSkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJFRENBIHBhcmFtZXRlciBwcm9jZXNzaW5nIGVycm9yIikpOykKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChwU3RhRHMgIT0gTlVMTCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vIElmIG5lZWRlZCwgZG93bmdyYWRlIHRoZSBFRENBIHBhcmFtZXRlcnMKKyAgICAgICAgICAgICAgICAgICAgbGltU2V0QWN0aXZlRWRjYVBhcmFtcyhwTWFjLCBwc2Vzc2lvbkVudHJ5LT5nTGltRWRjYVBhcmFtcywgcHNlc3Npb25FbnRyeSk7IAorCisgICAgICAgICAgICAgICAgICAgIGlmIChwU3RhRHMtPmFuaVBlZXIgPT0gZUFOSV9CT09MRUFOX1RSVUUpCisgICAgICAgICAgICAgICAgICAgICAgICBsaW1TZW5kRWRjYVBhcmFtcyhwTWFjLCBwc2Vzc2lvbkVudHJ5LT5nTGltRWRjYVBhcmFtc0FjdGl2ZSwgcFN0YURzLT5ic3NJZCwgZUFOSV9CT09MRUFOX1RSVUUpOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICBsaW1TZW5kRWRjYVBhcmFtcyhwTWFjLCB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k7CisgICAgLy8gSWdub3JlIFByb2JlIFJlc3BvbnNlIGZyYW1lIGluIGFsbCBvdGhlciBzdGF0ZXMKKyAgICByZXR1cm47Cit9IC8qKiogZW5kIGxpbVByb2Nlc3NQcm9iZVJzcEZyYW1lKCkgKioqLworCisKK3ZvaWQKK2xpbVByb2Nlc3NQcm9iZVJzcEZyYW1lTm9TZXNzaW9uKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggKnBSeFBhY2tldEluZm8pCit7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgKnBCb2R5OworICAgIHRBTklfVTMyICAgICAgICAgICAgICAgIGZyYW1lTGVuID0gMDsKKyAgICB0cFNpck1hY01nbXRIZHIgICAgICAgICBwSGRyOworICAgIHRTaXJQcm9iZVJlc3BCZWFjb24gICAgKnBQcm9iZVJzcDsKKworICAgIHBQcm9iZVJzcCA9IHZvc19tZW1fdm1hbGxvYyhzaXplb2YodFNpclByb2JlUmVzcEJlYWNvbikpOworICAgIGlmICggTlVMTCA9PSBwUHJvYmVSc3AgKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJVbmFibGUgdG8gYWxsb2NhdGUgbWVtb3J5IGluIGxpbVByb2Nlc3NQcm9iZVJzcEZyYW1lTm9TZXNzaW9uIikgKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHBQcm9iZVJzcC0+c3NJZC5sZW5ndGggICAgICAgICAgICAgID0gMDsKKyAgICBwUHJvYmVSc3AtPndwYS5sZW5ndGggICAgICAgICAgICAgICA9IDA7CisgICAgcFByb2JlUnNwLT5wcm9wSUVpbmZvLmFwTmFtZS5sZW5ndGggPSAwOworCisKKyAgICBwSGRyID0gV0RBX0dFVF9SWF9NQUNfSEVBREVSKHBSeFBhY2tldEluZm8pOworCisKKyAgICBsaW1Mb2cocE1hYywgTE9HMiwKKyAgICAgICAgICAgICBGTCgiUmVjZWl2ZWQgUHJvYmUgUmVzcG9uc2Ug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ICAgICAgICAgICAgICAgICAgICAgRkwoIlByb2JlIFJlc3AgRnJhbWUgUmVjZWl2ZWQ6IEJTU0lEICIgTUFDX0FERFJFU1NfU1RSICIgKFJTU0kgJWQpIiksCisgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEhkci0+YnNzSWQpLAorICAgICAgICAgICAgICAgICAgICAgICh1aW50KWFicygodEFOSV9TOClXREFfR0VUX1JYX1JTU0lfREIocFJ4UGFja2V0SW5mbykpKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIEdldCBwb2ludGVyIHRvIFByb2JlIFJlc3BvbnNlIGZyYW1lIGJvZHkKKyAgICAgICAgcEJvZHkgPSBXREFfR0VUX1JYX01QRFVfREFUQShwUnhQYWNrZXRJbmZvKTsKKworICAgICAgICBpZiAoc2lyQ29udmVydFByb2JlRnJhbWUyU3RydWN0KHBNYWMsIHBCb2R5LCBmcmFtZUxlbiwgcFByb2JlUnNwKSA9PSBlU0lSX0ZBSUxVUkUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiUGFyc2UgZXJyb3IgUHJvYmVSZXNwb25zZSwgbGVuZ3RoPSVkXG4iKSwgZnJhbWVMZW4pOworICAgICAgICAgICAgdm9zX21lbV92ZnJlZShwUHJvYmVSc3ApOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HMiwgRkwoIlNhdmUgdGhpcyBwcm9iZSByc3AgaW4gTEZSIGNhY2hlIikpOworICAgICAgICBsaW1DaGVja0FuZEFkZEJzc0Rlc2NyaXB0aW9uKHBNYWMsIHBQcm9iZVJzcCwgcFJ4UGFja2V0SW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQU5JX0JPT0xFQU5fRkFMU0UsIGVBTklfQk9PTEVBTl9UUlVFKTsKKyAgICB9CisgICAgZWxzZQorI2VuZGlmCisgICAgaWYg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T5saW0uZ0xpbU1sbVN0YXRlID09IGVMSU1fTUxNX0xFQVJOX1NUQVRFKSApCisgICAgeworICAgICAgICBmcmFtZUxlbiA9IFdEQV9HRVRfUlhfUEFZTE9BRF9MRU4ocFJ4UGFja2V0SW5mbyk7CisKKyAgICAgICAgaWYgKHBNYWMtPmxpbS5nTGltQmFja2dyb3VuZFNjYW5Nb2RlID09IGVTSVJfUk9BTUlOR19TQ0FOKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgIEZMKCJQcm9iZSBSZXNwIEZyYW1lIFJlY2VpdmVkOiBCU1NJRCAiIE1BQ19BRERSRVNTX1NUUiAiIChSU1NJICVkKSIpLAorICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBIZHItPmJzc0lkKSwKKyAgICAgICAgICAgICAgICAgICAgICAodWludClhYnMoKHRBTklfUzgpV0RBX0dFVF9SWF9SU1NJX0RCKHBSeFBhY2tldEluZm8pKSk7CisgICAgICAgIH0KKworICAgICAgICAvLyBHZXQgcG9pbnRlciB0byBQcm9iZSBSZXNwb25zZSBmcmFtZSBib2R5CisgICAgICAgIHBCb2R5ID0gV0RBX0dFVF9SWF9NUERVX0RBVEEocFJ4UGFja2V0SW5mbyk7CisKKyAgICAgICAgaWYgKHNpckNvbnZlcnRQcm9iZUZyYW1lMlN0cnVjdChwTWFjLCBwQm9keSwgZnJhbWVMZW4sIHBQcm9iZVJzcCkgPT0gZVNJUl9GQUlMVVJFKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlBhcnNlIGVycm9yIFByb2JlUmVzcG9uc2UsIGxlbmd0aD0lZCIpLCBmcmFtZUxlbik7CisgICAgICAgICAgICB2b3NfbWVtX3ZmcmVlKHBQcm9iZVJzcCk7CisgICAgICAgICAgICByZXR1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MSU1fU01FX0xJTktfRVNUX1NUQVRFKSApfHwKKyAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgKCAgICAoIChwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmJzc1R5cGUgPT0gZVNJUl9JQlNTX01PREUpfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIChwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9CVF9BTVBfQVBfUk9MRSl8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBNYWMtPmxpbS5ncFNlc3Npb25baV0ubGltU3lzdGVtUm9sZSA9PSBlTElNX0JUX0FNUF9TVEFfUk9MRSkgKSYmCisgICAgICAgICAgICAgICAgICAgICAgIChwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmxpbVNtZVN0YXRlID09IGVMSU1fU01FX05PUk1BTF9TVEFURSkgKQorICAgICAgICAgICAgICAgfHwgICggKCAoIChwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmJzc1R5cGUgPT0gZVNJUl9JTkZSQV9BUF9NT0RFKSAKKyAgICAgICAgICAgICAgICAgICAgICAmJiAoIHBNYWMtPmxpbS5ncFNlc3Npb25baV0ucGVQZXJzb25hID09IFZPU19QMlBfR09fTU9ERSkgKQorICAgICAgICAgICAgICAgICAgICB8fCAocE1hYy0+bGltLmdwU2Vzc2lvbltpXS5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQVBfUk9MRSkgKQorICAgICAgICAgICAgICAgICAgJiYgKHBNYWMtPmxpbS5ncFNlc3Npb25baV0ubGltU21lU3RhdGUgPT0gZUxJTV9TTUVfTk9STUFMX1NUQVRFKSApCisgICAgICAgICAgICAgKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdmFsaWRTdGF0ZSA9IEZBTFNFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgfQ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AgICAgICAgICAgICovCisgICAgICAgICAgICBpZiAoY2ZnU2V0SW50KHBNYWMsIFdOSV9DRkdfTkVXX0JTU19GT1VORF9JTkQsICgodFNpclNtZVN0YXJ0UmVxICopIHBNc2dCdWYpLT5zZW5kTmV3QnNzSW5kKQorICAgICAgICAgICAgICAgICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoImNvdWxkIG5vdCBzZXQgTkVJR0hCT1JfQlNTX0lORCBhdCBDRkciKSk7CisgICAgICAgICAgICAgICAgcmV0Q29kZSA9IGVTSVJfU01FX1VORVhQRUNURURfUkVRX1JFU1VMVF9DT0RFOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIC8qKgorICAgICAgICAgKiBTaG91bGQgbm90IGhhdmUgcmVjZWl2ZWQgZVdOSV9TTUVfU1RBUlRfUkVRIGluIHN0YXRlcworICAgICAgICAgKiBvdGhlciB0aGFuIE9GRkxJTkUuIFJldHVybiByZXNwb25zZSB0byBob3N0IGFuZAorICAgICAgICAgKiBsb2cgZXJyb3IKKyAgICAgICAgICovCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiSW52YWxpZCBTTUVfU1RBUlRfUkVRIHJlY2VpdmVkIGluIFNNRSBzdGF0ZSAlZCIpLHBNYWMtPmxpbS5nTGltU21lU3RhdGUgKTsKKyAgICAgICAgbGltUHJpbnRTbWVTdGF0ZShwTWFjLCBMT0dFLCBwTWFjLT5saW0uZ0xpbVNtZVN0YXRlKTsKKyAgICAgICAgcmV0Q29kZSA9IGVTSVJfU01FX1VORVhQRUNURURfUkVRX1JFU1VMVF9DT0RFOworICAgIH0KKyAgICBsaW1TZW5kU21lUnNwKHBNYWMsIGVXTklfU01FX1NUQVJUX1JTUCwgcmV0Q29kZSxzbWVzZXNzaW9uSWQsc21ldHJhbnNhY3Rpb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ByaW1hcnljaGFuTnVtICsgMjsKKyAgICAgICAgICAgIGNhc2UgUEhZX1FVQURSVVBMRV9DSEFOTkVMXzIwTUhaX0hJR0hfNDBNSFpfQ0VOVEVSRUQ6CisgICAgICAgICAgICAgICByZXR1cm4gcHJpbWFyeWNoYW5OdW0gLSAyOworICAgICAgICAgICAgY2FzZSBQSFlfUVVBRFJVUExFX0NIQU5ORUxfMjBNSFpfTE9XXzQwTUhaX0xPVzoKKyAgICAgICAgICAgICAgIHJldHVybiBwcmltYXJ5Y2hhbk51bSArIDY7CisgICAgICAgICAgICBjYXNlIFBIWV9RVUFEUlVQTEVfQ0hBTk5FTF8yME1IWl9ISUdIXzQwTUhaX0xPVzoKKyAgICAgICAgICAgICAgIHJldHVybiBwcmltYXJ5Y2hhbk51bSArIDI7CisgICAgICAgICAgICBjYXNlIFBIWV9RVUFEUlVQTEVfQ0hBTk5FTF8yME1IWl9MT1dfNDBNSFpfSElHSDoKKyAgICAgICAgICAgICAgIHJldHVybiBwcmltYXJ5Y2hhbk51bSAtIDI7CisgICAgICAgICAgICBjYXNlIFBIWV9RVUFEUlVQTEVfQ0hBTk5FTF8yME1IWl9ISUdIXzQwTUhaX0hJR0g6CisgICAgICAgICAgICAgICByZXR1cm4gcHJpbWFyeWNoYW5OdW0gLSA2OworICAgICAgICAgICAgZGVmYXVsdCA6CisgICAgICAgICAgICAgICByZXR1cm4gZVNJUl9DRkdfSU5WQUxJRF9JRDsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmIChjaGFuV2lkdGggPT0gV05JX0NGR19WSFRfQ0hBTk5FTF9XSURUSF8yMF80ME1IWikKKyAgICB7CisgICAgICAgIHN3aXRjaChzZWNvbmRhcnlDaGFuT2Zmc2V0KQorICAgICAgICB7CisgICAgICAgICAgICBjYXNlIFBIWV9ET1VCTEVfQ0hBTk5FTF9MT1dfUFJJTUFSWToKKyAgICAgICAgICAgICAgICByZXR1cm4gcHJpbWFyeWNoYW5OdW0gKyAyOworICAgICAgICAgICAgY2FzZSBQSFlfRE9VQkxFX0NIQU5ORUxfSElHSF9QUklNQVJZOgorICAgICAgICAgICAgICAgIHJldHVybiBwcmltYXJ5Y2hhbk51bSAtIDI7CisgICAgICAgICAgICBjYXNlIFBIWV9RVUFEUlVQTEVfQ0hBTk5FTF8yME1IWl9DRU5URVJFRF80ME1IWl9DRU5URVJFRDoKKyAgICAgICAgICAgICAgICByZXR1cm4gcHJpbWFyeWNoYW5OdW07CisgICAgICAgICAgICBjYXNlIFBIWV9RVUFEUlVQTEVfQ0hBTk5FTF8yME1IWl9MT1dfNDBNSFpfQ0VOVEVSRUQ6CisgICAgICAgICAgICAgICByZXR1cm4gcHJpbWFyeWNoYW5OdW0gKyAyOworICAgICAgICAgICAgY2FzZSBQSFlfUVVBRFJVUExFX0NIQU5ORUxfMjBNSFpfSElHSF80ME1IWl9DRU5URVJFRDoKKyAgICAgICAgICAgICAgIHJldHVybiBwcmltYXJ5Y2hhbk51bSAtIDI7CisgICAgICAgICAgICBjYXNlIFBIWV9RVUFEUlVQTEVfQ0hBTk5FTF8yME1IWl9MT1dfNDBNSFpfTE9XOgorICAgICAgICAgICAgICAgcmV0dXJuIHByaW1hcnljaGFuTnVtICsgMjsKKyAgICAgICAgICAgIGNhc2UgUEhZX1FVQURSVVBMRV9DSEFOTkVMXzIwTUhaX0hJR0hfNDBNSFpfTE9XOgorICAgICAgICAgICAgICAgcmV0dXJuIHByaW1hcnljaGFuTnVtIC0gMjsKKyAgICAgICAgICAgIGNhc2UgUEhZX1FVQURSVVBMRV9DSEFOTkVMXzIwTUhaX0xPV180ME1IWl9ISUdIOgorICAgICAgICAgICAgICAgcmV0dXJuIHByaW1hcnljaGFuTnVtICsgMjsKKyAgICAgICAgICAgIGNhc2UgUEhZX1FVQURSVVBMRV9DSEFOTkVMXzIwTUhaX0hJR0hfNDBNSFpfSElHSDoKKyAgICAgICAgICAgICAgIHJldHVybiBwcmltYXJ5Y2hhbk51bSAtIDI7CisgICAgICAgICAgICBkZWZhdWx0IDoKKyAgICAgICAgICAgICAgIHJldHVybiBlU0lSX0NGR19JTlZBTElEX0lEOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiBwcmltYXJ5Y2hhbk51bTsKK30KKworI2VuZGlmCisvKioKKyAqIF9fbGltSGFuZGxlU21lU3RhcnRCc3NSZXF1ZXN0KCkKKyAqCisgKkZVTkNUSU9OOgorICogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgdG8gcHJvY2VzcyBTTUVfU1RBUlRfQlNTX1JFUSBtZXNzYWdlCisgKiBmcm9tIEhERCBvciB1cHBlciBsYXllciBhcHBsaWNhdGlvbi4KKyAqCisgKkxPR0lDOgorICoKKyAqQVNTVU1QVElPTlM6CisgKgorICpOT1RFOgorICoKKyAqIEBwYXJhbSAgcE1hYyAgICAgIFBvaW50ZXIgdG8gR2xvYmFsIE1BQyBzdHJ1Y3R1cmUKKyAqIEBwYXJhbSAgKnBNc2dCdWYgIEEgcG9pbnRlciB0byB0aGUgU01FIG1lc3NhZ2UgYnVmZmVyCisgKiBAcmV0dXJuIE5vbmUKKyAqLworCitzdGF0aWMgdm9pZAorX19saW1IYW5kbGVTbWVTdGFydEJzc1JlcXVlc3QodHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMzIgKnBNc2dCdWYpCit7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgc2l6ZTsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICB2YWwgPSAwOworICAgIHRTaXJSZXRTdGF0dXMgICAgICAgICAgIHJldFN0YXR1czsKKyAgICB0U2lyTWFjQ2hhbk51bSAgICAgICAgICBjaGFubmVsTnVtYmVyOworICAgIHRMaW1NbG1TdGFydFJlcSAgICAgICAgICpwTWxtU3RhcnRSZXEgPSBOVUxMOworICAgIHRwU2lyU21lU3RhcnRCc3NSZXEgICAgIHBTbWVTdGFydEJzc1JlcSA9IE5VTEw7CisgICAgdFNpclJlc3VsdENvZGVzICAgICAgIC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NzaW9uRW50cnktPnZodENhcGFiaWxpdHkpOworI2VuZGlmCisKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+dHhMZHBjSW5pRmVhdHVyZUVuYWJsZWQgPSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTbWVTdGFydEJzc1JlcS0+dHhMZHBjSW5pRmVhdHVyZUVuYWJsZWQ7CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVJtZkVuYWJsZWQgPSBwU21lU3RhcnRCc3NSZXEtPnBtZkNhcGFibGUgPyAxIDogMDsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJTZXNzaW9uIFJNRiBlbmFibGVkOiAlZCIpLCBwc2Vzc2lvbkVudHJ5LT5saW1SbWZFbmFibGVkKTsKKyNlbmRpZgorCisgICAgICAgIHZvc19tZW1fY29weSgodm9pZCopJnBzZXNzaW9uRW50cnktPnJhdGVTZXQsCisgICAgICAgICAgICAodm9pZCopJnBTbWVTdGFydEJzc1JlcS0+b3BlcmF0aW9uYWxSYXRlU2V0LAorICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNSYXRlU2V0KSk7CisgICAgICAgIHZvc19tZW1fY29weSgodm9pZCopJnBzZXNzaW9uRW50cnktPmV4dFJhdGVTZXQsCisgICAgICAgICAgICAodm9pZCopJnBTbWVTdGFydEJzc1JlcS0+ZXh0ZW5kZWRSYXRlU2V0LAorICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNSYXRlU2V0KSk7CisKKyAgICAgICAgc3dpdGNoKHBTbWVTdGFydEJzc1JlcS0+YnNzVHlwZSkKKyAgICAgICAgeworICAgICAgICAgICAgY2FzZSBlU0lSX0lORlJBX0FQX01PREU6CisgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPSBlTElNX0FQX1JPTEU7CisgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnByaXZhY3kgPSBwU21lU3RhcnRCc3NSZXEtPnByaXZhY3k7CisgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmZ3ZFdQU1BCQ1Byb2JlUmVxID0gcFNtZVN0YXJ0QnNzUmVxLT5md2RXUFNQQkNQcm9iZVJlcTsKKyAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+YXV0aFR5cGUgPSBwU21lU3RhcnRCc3NSZXEtPmF1dGhUeXBlOworICAgICAgICAgICAgICAgICAvKiBTdG9yZSB0aGUgRFRJTSBwZXJpb2QgKi8KKyAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+ZHRpbVBlcmlvZCA9ICh0QU5JX1U4KXBTbWVTdGFydEJzc1JlcS0+ZHRpbVBlcmlvZDsKKyAgICAgICAgICAgICAgICAgLypFbmFibGUvZGlzYWJsZSBVQVBTRCovCisgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmFwVWFwc2RFbmFibGUgPSBwU21lU3RhcnRCc3NSZXEtPmFwVWFwc2RFbmFibGU7CisgICAgICAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5wZVBlcnNvbmEgPT0gVk9TX1AyUF9HT19NT0RFKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wcm94eVByb2JlUnNwRW4gPSAwOworICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgLyogVG8gZGV0ZWN0IFBCQyBvdmVybGFwIGluIFNBUCBXUFMgbW9kZSwgSG9zdCBoYW5kbGVzCisgICAgICAgICAgICAgICAgICAgICAgKiBQcm9iZSBSZXF1ZXN0cy4KKyAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgaWYoU0FQX1dQU19ESVNBQkxFRCA9PSBwU21lU3RhcnRCc3NSZXEtPndwc19zdGF0ZSkKKyAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wcm94eVByb2JlUnNwRW4gPSAxOworICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnByb3h5UHJvYmVSc3BFbiA9IDA7CisgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+c3NpZEhpZGRlbiA9IHBTbWVTdGFydEJzc1JlcS0+c3NpZEhpZGRlbjsKKyAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+d3BzX3N0YXRlID0gcFNtZVN0YXJ0QnNzUmVxLT53cHNfc3RhdGU7CisgICAgICAgICAgICAgICAgIGxpbUdldFNob3J0U2xvdEZyb21QaHlNb2RlKHBNYWMsIHBzZXNzaW9uRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW1QaHlNb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcHNlc3Npb25FbnRyeS0+c2hvcnRTbG90VGltZVN1cHBvcnRlZCk7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBlU0lSX0lCU1NfTU9ERToKKyAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9IGVMSU1fU1RBX0lOX0lCU1NfUk9MRTsKKyAgICAgICAgICAgICAgICAgbGltR2V0U2hvcnRTbG90RnJvbVBoeU1vZGUocE1hYywgcHNlc3Npb25FbnRyeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbVBoeU1vZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwc2Vzc2lvbkVudHJ5LT5zaG9ydFNsb3RUaW1lU3VwcG9ydGVkKTsKKyAgICAgICAgICAgICAgICAgLyogSW4gV1BBLU5PTkUgY2FzZSB3ZSB3b250IGdldCB0aGUgcHJpdmFjeSBiaXQgaW4gaWJzcyBjb25maWcKKyAgICAgICAgICAgICAgICAgICogZnJvbSBzdXBwbGljYW50LCBidXQgd2UgYXJlIHVwZGF0aW5nIFdOSV9DRkdfUFJJVkFDWV9FTkFCTEVECisgICAgICAgICAgICAgICAgICAqIG9uIGJhc2lzIG9mIEVuY3J5cHRpb24gdHlwZSBpbiBjc3JSb2FtU2V0QnNzQ29uZmlnQ2ZnLiBTbworICAgICAgICAgICAgICAgICAgKiBnZXQgdGhlIHByaXZhY3kgaW5mbyBmcm9tIFdOSV9DRkdfUFJJVkFDWV9FTkFCTEVECisgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19QUklWQUNZX0VOQUJMRUQsICZ2YWwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJjZmcgZ2V0IFdOSV9DRkdfUFJJVkFDWV9FTkFCTEVEIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgZmFpbGVkIikpOworICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wcml2YWN5ID0odEFOSV9VOCkgdmFsOworICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5pc0NvYWxlc2luZ0luSUJTU0FsbG93ZWQgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU21lU3RhcnRCc3NSZXEtPmlzQ29hbGVzaW5nSW5JQlNTQWxsb3dlZDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgZVNJUl9CVEFNUF9BUF9NT0RFOgorICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID0gZUxJTV9CVF9BTVBfQVBfUk9MRTsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgZVNJUl9CVEFNUF9TVEFfTU9ERToKKyAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9IGVMSU1fQlRfQU1QX1NUQV9ST0xFOworICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgICAvKiBUaGVyZSBpcyBvbmUgbW9yZSBtb2RlIGNhbGxlZCBhdXRvIG1vZGUuIHdoaWNoIGlzIHVzZWQgbm8gd2hlcmUgKi8KKworICAgICAgICAgICAgICAgICAvL0ZPUkJVSUxEIC1URU1QRklYLi4gSE9XIFRPIHVzZSBBVVRPIE1PREU/Pz8/PworCisKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbm90IHVzZWQgYW55d2hlcmUuLi51c2VkIGluIHNjYW4gZnVuY3Rpb24KKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICAvLyBCVC1BTVA6IEFsbG9jYXRlIG1lbW9yeSBmb3IgdGhlIGFycmF5IG9mIHBhcnNlZCAoUmUpQXNzb2MgcmVxdWVzdCBzdHJ1Y3R1cmUKKyAgICAgICAgaWYgKCAocFNtZVN0YXJ0QnNzUmVxLT5ic3NUeXBlID09IGVTSVJfQlRBTVBfQVBfTU9ERSkKKyAgICAgICAgfHwgKHBTbWVTdGFydEJzc1JlcS0+YnNzVHlwZSA9PSBlU0lSX0lORlJBX0FQX01PREUpCisgICAgICAgICkKKyAgICAgICAgeworICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGFyc2VkQXNzb2NSZXEgPSB2b3NfbWVtX21hbGxvYygKKyAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUuc2l6ZSAqIHNpemVvZih0cFNpckFzc29jUmVxKSk7CisgICAgICAgICAgICBpZiAoIE5VTEwgPT0gcHNlc3Npb25FbnRyeS0+cGFyc2VkQXNzb2NSZXEgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiQWxsb2NhdGVNZW1vcnkoKSBmYWlsZWQiKSk7CisgICAgICAgICAgICAgICAgcmV0Q29kZSA9IGVTSVJfU01FX1JFU09VUkNFU19VTkFWQUlMQUJMRTsKKyAgICAgICAgICAgICAgICBnb3RvIGZyZWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB2b3NfbWVtX3NldChwc2Vzc2lvbkVudHJ5LT5wYXJzZWRBc3NvY1JlcSwKKyAgICAgICAgICAgICAgICAgICAgKHBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUuc2l6ZSAqIHNpemVvZih0cFNpckFzc29jUmVxKSksCisgICAgICAgICAgICAgICAgICAgICAwICk7CisgICAgICAgIH0KKworICAgICAgICAvKiBDaGFubmVsIEJvbmRpbmcgaXMgbm90IGFkZHJlc3NkIHlldCBmb3IgQlQtQU1QIFN1cHBvcnQuLiBzdW5pdCB3aWxsIGFkZHJlc3MgY2hhbm5lbCBib25kaW5nICAgKi8KKyAgICAgICAgaWYgKHBTbWVTdGFydEJzc1JlcS0+Y2hhbm5lbElkKQorICAgICAgICB7CisgICAgICAgICAgICBjaGFubmVsTnVtYmVyID0gcFNtZVN0YXJ0QnNzUmVxLT5jaGFubmVsSWQ7CisgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5odFN1cHBvcnRlZENoYW5uZWxXaWR0aFNldCA9IChwU21lU3RhcnRCc3NSZXEtPmNiTW9kZSk/MTowOyAvLyBUaGlzIGlzIGFscmVhZHkgbWVyZ2VkIHZhbHVlIG9mIHBlZXIgYW5kIHNlbGYgLSBkb25lIGJ5IGNzciBpbiBjc3JHZXRDQk1vZGVGcm9tSWVzCisgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5odFJlY29tbWVuZGVkVHhXaWR0aFNldCA9IHBzZXNzaW9uRW50cnktPmh0U3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0OworICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+aHRTZWNvbmRhcnlDaGFubmVsT2Zmc2V0ID0gcFNtZVN0YXJ0QnNzUmVxLT5jYk1vZGU7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9QRSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgRkwoImNiTW9kZSAldSIpLCBwU21lU3RhcnRCc3NSZXEtPmNiTW9kZSk7CisjaWZkZWYgV0xBTl9GRUFUVVJFXzExQUMKKyAgICAgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPnZodENhcGFiaWxpdHkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdEFOSV9VMzIgY2VudGVyQ2hhbjsKKyAgICAgICAgICAgICAgICB0QU5JX1UzMiBjaGFuV2lkdGg7CisKKyAgICAgICAgICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19WSFRfQ0hBTk5FTF9XSURUSCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJmNoYW5XaWR0aCkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgICAgRkwoIlVuYWJsZSB0byByZXRyaWV2ZSBDaGFubmVsIFdpZHRoIGZyb20gQ0ZHIikpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmKGNoYW5uZWxOdW1iZXIgPD0gUkZfQ0hBTl8xNCAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFuV2lkdGggIT0gZUhUX0NIQU5ORUxfV0lEVEhfMjBNSFopCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgY2hhbldpZHRoID0gZUhUX0NIQU5ORUxfV0lEVEhfMjBNSFo7CisgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlNldHRpbmcgY2hhbldpZHRoIHRvIDIwTWh6IGZvciIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgY2hhbm5lbCAlZCIpLGNoYW5uZWxOdW1iZXIpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmKGNoYW5XaWR0aCA9PSBlSFRfQ0hBTk5FTF9XSURUSF8yME1IWiB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFuV2lkdGggPT0gZUhUX0NIQU5ORUxfV0lEVEhfNDBNSFopCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAoY2ZnU2V0SW50KHBNYWMsIFdOSV9DRkdfVkhUX0NIQU5ORUxfV0lEVEgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19WSFRfQ0hBTk5FTF9XSURUSF8yMF80ME1IWikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiY291bGQgbm90IHNldCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBXTklfQ0ZHX0NIQU5ORUxfQk9ORElOR19NT0RFIGF0IENGRyIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldENvZGUgPSBlU0lSX0xPR1BfRVhDRVBUSU9OOworICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZnJlZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoY2hhbldpZHRoID09IGVIVF9DSEFOTkVMX1dJRFRIXzgwTUhaKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNmZ1NldEludChwTWFjLCBXTklfQ0ZHX1ZIVF9DSEFOTkVMX1dJRFRILAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfVkhUX0NIQU5ORUxfV0lEVEhfODBNSFopCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiY291bGQgbm90IHNldCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBXTklfQ0ZHX0NIQU5ORUxfQk9ORElOR19NT0RFIGF0IENGRyIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldENvZGUgPSBlU0lSX0xPR1BfRVhDRVBUSU9OOworICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZnJlZTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGNlbnRlckNoYW4gPSBsaW1HZXRDZW50ZXJDaGFubmVsKCBwTWFjLCBjaGFubmVsTnVtYmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU21lU3RhcnRCc3NSZXEtPmNiTW9kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19WSFRfQ0hBTk5FTF9XSURUSF84ME1IWik7CisgICAgICAgICAgICAgICAgICAgIGlmKGNlbnRlckNoYW4gIT0gZVNJUl9DRkdfSU5WQUxJRF9JRCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1csIEZMKCIqKipDZW50ZXIgQ2hhbm5lbCBmb3IgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICI4ME1IWiBjaGFubmVsIHdpZHRoID0gJWQiKSxjZW50ZXJDaGFuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmFwQ2VudGVyQ2hhbiA9IGNlbnRlckNoYW47CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2ZnU2V0SW50KHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfVkhUX0NIQU5ORUxfQ0VOVEVSX0ZSRVFfU0VHTUVOVDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNlbnRlckNoYW4pICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoImNvdWxkIG5vdCBzZXQgICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIldOSV9DRkdfQ0hBTk5FTF9CT05ESU5HX01PREUgYXQgQ0ZHIikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldENvZGUgPSBlU0lSX0xPR1BfRVhDRVBUSU9OOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZnJlZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8qIEFsbCB0aGUgdHJhbnNsYXRpb24gaXMgZG9uZSBieSBub3cgZm9yIGdWaHRDaGFubmVsV2lkdGgKKyAgICAgICAgICAgICAgICAgKiBmcm9tIC5pbmkgZmlsZSB0byB0aGUgYWN0dWFsIHZhbHVlcyBhcyBkZWZpbmVkIGluIHNwZWMuCisgICAgICAgICAgICAgICAgICogU28sIGdyYWJpbmcgdGhlIHNwZWMgdmFsdWUgd2hpY2ggaXMKKyAgICAgICAgICAgICAgICAgKiB1cGRhdGVkIGluIC5kYXQgZmlsZSBieSB0aGUgYWJvdmUgbG9naWMgKi8KKyAgICAgICAgICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19WSFRfQ0hBTk5FTF9XSURUSCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmNoYW5XaWR0aCkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgICAgRkwoIlVuYWJsZSB0byByZXRyaWV2ZSBDaGFubmVsIFdpZHRoIGZyb20gQ0ZHIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvKkZvciBTdGErcDJwLUdvIGNvbmN1cnJlbmN5ICAKKyAgICAgICAgICAgICAgICAgIHZodFR4Q2hhbm5lbFdpZHRoU2V0IGlzIHVzZWQgZm9yIHN0b3JpbmcgcDJwLUdPIGNoYW5uZWwgd2lkdGgKKyAgICAgICAgICAgICAgICAgIGFwQ2hhbldpZHRoIGlzIHVzZWQgZm9yIHN0b3JpbmcgdGhlIEFQIGNoYW5uZWwgd2lkdGggdGhhdCB0aGUgU3RhIGlzIGdvaW5nIHRvIGFzc29jaWF0ZS4KKyAgICAgICAgICAgICAgICAgIEluaXRpYWxpemUgdGhlIGFwQ2hhbldpZHRoIHNhbWUgYXMgcDJwLUdPIGNoYW5uZWwgd2lkdGggdGhpcyBnZXRzIG92ZXIgd3JpdHRlbiBvbmNlIHRoZSBzdGF0aW9uIGpvaW5zIHRoZSBBUAorICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+dmh0VHhDaGFubmVsV2lkdGhTZXQgPSBjaGFuV2lkdGg7CisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+YXBDaGFuV2lkdGggPSBjaGFuV2lkdGg7ICAgICAgICAgCisgICAgICAgICAgICB9CisgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5odFNlY29uZGFyeUNoYW5uZWxPZmZzZXQgPSBsaW1HZXRIVENCU3RhdGUocFNtZVN0YXJ0QnNzUmVxLT5jYk1vZGUpOworI2VuZGlmCisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBQRUxPR1cobGltTG9nKHBNYWMsIExPR1csIEZMKCJSZWNlaXZlZCBpbnZhbGlkIGVXTklfU01FX1NUQVJUX0JTU19SRVEiKSk7KQorICAgICAgICAgICAgcmV0Q29kZSA9IGVTSVJfU01FX0lOVkFMSURfUEFSQU1FVEVSUzsKKyAgICAgICAgICAgIGdvdG8gZnJlZTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIERlbGV0ZSBwcmUtYXV0aCBsaXN0IGlmIGFueQorICAgICAgICBsaW1EZWxldGVQcmVBdXRoTGlzdChwTWFjKTsKKworICAgICAgICAvLyBEZWxldGUgSUJTUyBwZWVyIEJTU2Rlc2NyaXB0aW9uIGxpc3QgaWYgYW55CisgICAgICAgIC8vbGltSWJzc0RlbGV0ZShwTWFjKTsgc2VwIDI2IHJldmlldworCisKKworI2lmZGVmIEZJWE1FX0dFTjYgICAvL2ZvbGxvd2luZyBjb2RlIG1heSBub3QgYmUgcmVxdWlyZWQuIGxpbUluaXRNbG0gaXMgbm93IGJl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yAxMWIqLworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCAodm9pZCAqKSAmcHNlc3Npb25FbnRyeS0+Y2ZnUHJvdGVjdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKikgJnBTbWVTdGFydEJzc1JlcS0+aHRfY2FwYWIsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiggdEFOSV9VMTYgKSk7CisgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wQVBXUFNQQkNTZXNzaW9uID0gTlVMTDsgLy8gSW5pdGlhbGl6ZSBXUFMgUEJDIHNlc3Npb24gbGluayBsaXN0CisgICAgICAgIH0KKworICAgICAgICAvLyBQcmVwYXJlIGFuZCBJc3N1ZSBMSU1fTUxNX1NUQVJUX1JFUSB0byBNTE0KKyAgICAgICAgcE1sbVN0YXJ0UmVxID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRMaW1NbG1TdGFydFJlcSkpOworICAgICAgICBpZiAoIE5VTEwgPT0gcE1sbVN0YXJ0UmVxICkKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJjYWxsIHRvIEFsbG9jYXRlTWVtb3J5IGZhaWxlZCBmb3IgbWxtU3RhcnRSZXEiKSk7CisgICAgICAgICAgICByZXRDb2RlID0gZVNJUl9TTUVfUkVTT1VSQ0VTX1VOQVZBSUxBQkxFOworICAgICAgICAgICAgZ290byBmcmVlOworICAgICAgICB9CisKKyAgICAgICAgdm9zX21lbV9zZXQoKHZvaWQgKikgcE1sbVN0YXJ0UmVxLCBzaXplb2YodExpbU1sbVN0YXJ0UmVxKSwgMCk7CisKKyAgICAgICAgLyogQ29weSBTU0lEIHRvIHRoZSBNTE0gc3RhcnQgc3RydWN0dXJlICovCisgICAgICAgIHZvc19tZW1fY29weSggKHRBTklfVTggKikgJnBNbG1TdGFydFJlcS0+c3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTkl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CwgRkwoImNvdWxkIG5vdCByZXRyaXZlIEJTU0lELCByZXRTdGF0dXM9JWQiKSwgcmV0U3RhdHVzKTsKKworICAgICAgICAgICAgLyogQ29weSB0aGUgQlNTSWQgZnJvbSBzZXNzaW9uVGFibGUgdG8gbWxtU3RhcnRSZXEgc3RydWN0ICovCisgICAgICAgICAgICBzaXJDb3B5TWFjQWRkcihwTWxtU3RhcnRSZXEtPmJzc0lkLHBzZXNzaW9uRW50cnktPmJzc0lkKTsKKyAgICAgICAgfQorCisgICAgICAgIGVsc2UgLy8gaWJzcyBtb2RlCisgICAgICAgIHsKKyAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltSWJzc0NvYWxlc2NpbmdIYXBwZW5lZCA9IGZhbHNlOworCisgICAgICAgICAgICBpZigocmV0U3RhdHVzID0gd2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19JQlNTX0FVVE9fQlNTSUQsICZhdXRvR2VuQnNzSWQpKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJDb3VsZCBub3QgcmV0cmlldmUgQXV0byBHZW4gQlNTSUQsIHJldFN0YXR1cz0lZCIpLCByZXRTdGF0dXMpOworICAgICAgICAgICAgICAgIHJldENvZGUgPSBlU0lSX0xPR1BfRVhDRVBUSU9OOworICAgICAgICAgICAgICAgIGdvdG8gZnJlZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYoIWF1dG9HZW5Cc3NJZCkKKyAgICAgICAgICAgIHsgICAKKyAgICAgICAgICAgICAgICAvLyBXZSdyZSBub3QgYXV0byBnZW5lcmF0aW5nIEJTU0lELiBJbnN0ZWFkLCBnZXQgaXQgZnJvbSBzZXNzaW9uIGVudHJ5CisgICAgICAgICAgICAgICAgc2lyQ29weU1hY0FkZHIocE1sbVN0YXJ0UmVxLT5ic3NJZCxwc2Vzc2lvbkVudHJ5LT5ic3NJZCk7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgaWYocE1sbVN0YXJ0UmVxLT5ic3NJZFswXSAmIDB4MDEpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlJlcXVlc3QgdG8gc3RhcnQgSUJTUyB3aXRoIGdyb3VwIEJTU0lEXG4gQXV0b2dlbmVyYXRpbmcgdGhlIEJTU0lEIikpOykKKyAgICAgICAgICAgICAgICAgICBhdXRvR2VuQnNzSWQgPSBUUlVFOworICAgICAgICAgICAgICAgIH0gICAgICAgICAgICAgCisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmKCBhdXRvR2VuQnNzSWQgKQorICAgICAgICAgICAgeyAgIC8vaWYgQlNTSUQgaXMgbm90IGFueSB1YyBpZC4gdGhlbiB1c2UgbG9jYWxseSBnZW5lcmF0ZWQgQlNTSUQuCisgICAgICAgICAgICAgICAgLy9BdXRvZ2VuZXJhdGUgdGhlIEJTU0lECisgICAgICAgICAgICAgICAgbGltR2V0UmFuZG9tQnNzaWQoIHBNYWMsIHBNbG1TdGFydFJlcS0+YnNzSWQpOworICAgICAgICAgICAgICAgIHBNbG1TdGFydFJlcS0+YnNzSWRbMF09IDB4MDI7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgLyogQ29weSByYW5kb21seSBnZW5lcmF0ZWQgQlNTSUQgdG8gdGhlIHNlc3Npb24gVGFibGUgKi8KKyAgICAgICAgICAgICAgICBzaXJDb3B5TWFjQWRkcihwc2Vzc2lvbkVudHJ5LT5ic3NJZCxwTWxtU3RhcnRSZXEtPmJzc0lkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAvKiBzdG9yZSB0aGUgY2hhbm5lbCBudW0gaW4gbWxtc3RhcnQgcmVxIHN0cnVjdHVyZSAqLworICAgICAgICBwTWxtU3RhcnRSZXEtPmNoYW5uZWxOdW1iZXIgPSBwc2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3JvdW5kU2Nhbk1vZGUgIT0gZVNJUl9ST0FNSU5HX1NDQU4gKSAmJgorICAgICAgICAgICAgICAoIUlTX0FDVElWRU1PREVfT0ZGTE9BRF9GRUFUVVJFX0VOQUJMRSkpCisgICAgICB7CisgICAgICAgICAgZm9yKGk9MDtpPHBNYWMtPmxpbS5tYXhCc3NJZDtpKyspCisgICAgICAgICAgeworICAgICAgICAgICAgICBpZigocGVGaW5kU2Vzc2lvbkJ5U2Vzc2lvbklkKHBNYWMsaSkgIT0gTlVMTCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAocE1hYy0+bGltLmdwU2Vzc2lvbltpXS52YWxpZCA9PSBUUlVFKSAmJgorICAgICAgICAgICAgICAgICAgICAgIChlTElNX01MTV9MSU5LX0VTVEFCTElTSEVEX1NUQVRFID09IHBNYWMtPmxpbS5ncFNlc3Npb25baV0ubGltTWxtU3RhdGUpKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBsaW1IZWFydEJlYXREZWFjdGl2YXRlQW5kQ2hhbmdlVGltZXIocE1hYywgcGVGaW5kU2Vzc2lvbkJ5U2Vzc2lvbklkKHBNYWMsaSkpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorCisgICAgICBpZiAocE1hYy0+ZlNjYW5PZmZsb2FkKQorICAgICAgeworICAgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9CisgICAgICAgICAgICAgICAgICBsaW1TZW5kSGFsU3RhcnRTY2FuT2ZmbG9hZFJlcShwTWFjLCBwU2NhblJlcSkpCisgICAgICAgICAgeworICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkNvdWxkbid0IHNlbmQgT2ZmbG9hZCBzY2FuIHJlcXVlc3QiKSk7CisgICAgICAgICAgICAgIGxpbVNlbmRTbWVTY2FuUnNwKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0b2YodFNpclNtZVNjYW5Sc3AsIGJzc0Rlc2NyaXB0aW9uWzBdKSwKKyAgICAgICAgICAgICAgICAgICAgICBlU0lSX1NNRV9JTlZBTElEX1BBUkFNRVRFUlMsCisgICAgICAgICAgICAgICAgICAgICAgcFNjYW5SZXEtPnNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICBwU2NhblJlcS0+dHJhbnNhY3Rpb25JZCk7CisgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICB9CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisKKyAgICAgICAgICAvKkNoYW5nZSBHbG9iYWwgU01FIHN0YXRlICAqLworICAgICAgICAgIC8qIFN0b3JlIHRoZSBwcmV2aW91cyBTTUUgc3RhdGUgKi8KKyAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIk5vbiBPZmZsb2FkIFNDQU4gcmVxdWVzdCAiKSk7CisgICAgICAgICAgcE1hYy0+bGltLmdMaW1QcmV2U21lU3RhdGUgPSBwTWFjLT5saW0uZ0xpbVNtZVN0YXRlOworICAgICAgICAgIHBNYWMtPmxpbS5nTGltU21lU3RhdGUgPSBlTElNX1NNRV9XVF9TQ0FOX1NUQVRFOworICAgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1NNRV9TVEFURSwgcFNjYW5SZXEtPnNlc3Npb25JZCwgcE1hYy0+bGltLmdMaW1TbWVTdGF0ZSkpOworCisgICAgICAgICAgaWYgKHBTY2FuUmVxLT5jaGFubmVsTGlzdC5udW1DaGFubmVscyA9PSAwKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdEFOSV9VMzIgICAgICAgICAgICBjZmdfbGVuOworCisgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgICAgICAgRkwoIlNjYW4gYWxsIGNoYW5uZWxzIGFzIE51bWJlciBvZiBjaGFubmVscyBpcyAwIikpOworICAgICAgICAgICAgICAvLyBTY2FuIGFsbCBjaGFubmVscworICAgICAgICAgICAgICBsZW4gPSBzaXplb2YodExpbU1sbVNjYW5SZXEpICsKKyAgICAgICAgICAgICAgICAgIChzaXplb2YoIHBTY2FuUmVxLT5jaGFubmVsTGlzdC5jaGFubmVsTnVtYmVyICkgKiAoV05JX0NGR19WQUxJRF9DSEFOTkVMX0xJU1RfTEVOIC0gMSkpICsKKyAgICAgICAgICAgICAgICAgIHBTY2FuUmVxLT51SUVGaWVsZExlbjsKKyAgICAgICAgICAgICAgcE1sbVNjYW5SZXEgPSB2b3NfbWVtX21hbGxvYyhsZW4pOworICAgICAgICAgICAgICBpZiAoIE5VTEwgPT0gcE1sbVNjYW5SZXEgKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJjYWxsIHRvIEFsbG9jYXRlTWVtb3J5IGZhaWxlZCBmb3IgbWxtU2NhblJlcSAoJWQpIiksIGxlbik7CisKKyAgICAgICAgICAgICAgICBpZiAocE1hYy0+bGltLmdMaW1Sc3BSZXFkKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltUnNwUmVxZCA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgICBsaW1TZW5kU21lU2NhblJzcChwTWFjLCBzaXplb2YodFNpclNtZVNjYW5Sc3ApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9TTUVfUkVTT1VSQ0VTX1VOQVZBSUxBQkxFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjYW5SZXEtPnNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuUmVxLT50cmFuc2FjdGlvbklkKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAvLyBJbml0aWFsaXplIHRoaXMgYnVmZmVyCisgICAgICAgICAgICAgIHZvc19tZW1fc2V0KCAodEFOSV9VOCAqKSBwTWxtU2NhblJlcSwgbGVuLCAwICk7CisKKyAgICAgICAgICAgICAgY2ZnX2xlbiA9IFdOSV9DRkdfVkFMSURfQ0hBTk5FTF9MSVNUX0xFTjsKKyAgICAgICAgICAgICAgaWYgKHdsYW5fY2ZnR2V0U3RyKHBNYWMsIFdOSV9DRkdfVkFMSURfQ0hBTk5FTF9MSVNULAorICAgICAgICAgICAgICAgICAgICAgICAgICBwTWxtU2NhblJlcS0+Y2hhbm5lbExpc3QuY2hhbm5lbE51bWJlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJmNmZ19sZW4pICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICAgKiBDb3VsZCBub3QgZ2V0IFZhbGlkIGNoYW5uZWwgbGlzdCBmcm9tIENGRy4KKyAgICAgICAgICAgICAgICAgICAqIExvZyBlcnJvci4KKyAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgVmFsaWQgY2hhbm5lbCBsaXN0IikpOworCisgICAgICAgICAgICAgICAgICBpZiAocE1hYy0+bGltLmdMaW1Sc3BSZXFkKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltUnNwUmVxZCA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgICAgICAgbGltU2VuZFNtZVNjYW5Sc3AocE1hYywgc2l6ZW9mKHRTaXJTbWVTY2FuUnNwKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX1NNRV9JTlZBTElEX1BBUkFNRVRFUlMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjYW5SZXEtPnNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NhblJlcS0+dHJhbnNhY3Rpb25JZCk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocE1sbVNjYW5SZXEpOworICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIHBNbG1TY2FuUmVxLT5jaGFubmVsTGlzdC5udW1DaGFubmVscyA9ICh0QU5JX1U4KSBjZmdfbGVuOworCisgICAgICAgICAgICAgIC8vSWdub3JlIERGUyBjaGFubmVscyBpZiBERlMgc2NhbiBpcyBkaXNhYmxlZAorICAgICAgICAgICAgICBpZihwTWFjLT5zY2FuLmZFbmFibGVERlNDaG5sU2NhbiA9PSBERlNfQ0hOTF9TQ0FOX0RJU0FCTEVEKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICB0QU5JX1U4IG51bUNoYW4gPSAwOworICAgICAgICAgICAgICAgICAgdEFOSV9VOCBjaGFubmVsX3N0YXRlOworICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqY2hhbl9wdHIgPSBwTWxtU2NhblJlcS0+Y2hhbm5lbExpc3QuY2hhbm5lbE51bWJlcjsKKworICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgICAgICBGTCgiSWdub3JlIERGUyBjaGFubmVscyBmcm9tIHZhbGlkIGNoYW5uZWwgbGlzdCIpKTsKKworICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFX0hFWF9EVU1QKFZPU19NT0RVTEVfSURfUEUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWxtU2NhblJlcS0+Y2hhbm5lbExpc3QuY2hhbm5lbE51bWJlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1sbVNjYW5SZXEtPmNoYW5uZWxMaXN0Lm51bUNoYW5uZWxzKTsKKworICAgICAgICAgICAgICAgICAgLy9GaWx0ZXIgREZTIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY2ZnX2xlbjsgaSsrKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsX3N0YXRlID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19udl9nZXRDaGFubmVsRW5hYmxlZFN0YXRlKCooY2hhbl9wdHIgKyBpKSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgLy9BbGxvdyBjaGFubmVsIGlmIG5vdCBERlMKKyAgICAgICAgICAgICAgICAgICAgICAgaWYoY2hhbm5lbF9zdGF0ZSAhPSBOVl9DSEFOTkVMX0RGUykKKyAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAqKGNoYW5fcHRyICsgbnVtQ2hhbikgPSAqKGNoYW5fcHRyICsgaSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIG51bUNoYW4rKzsKKyAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgcE1sbVNjYW5SZXEtPmNoYW5uZWxMaXN0Lm51bUNoYW5uZWxzID0gKHRBTklfVTgpIG51bUNoYW47CisKKyAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiTm8gb2YgdmFsaWQgY2hhbm5lbHMgJWQsIE5vIG9mIgorICAgICAgICAgICAgICAgICAgICAgICAgICJjaGFubmVscyBhZnRlciBmaWx0ZXJpbmcgJWQiKSwgY2ZnX2xlbiwgbnVtQ2hhbik7CisKKyAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiQ2hhbm5lbCBsaXN0IGFmdGVyIGZpbHRlcmluZzogIikpOworCisgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0VfSEVYX0RVTVAoVk9TX01PRFVMRV9JRF9QRSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNbG1TY2FuUmVxLT5jaGFubmVsTGlzdC5jaGFubmVsTnVtYmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWxtU2NhblJlcS0+Y2hhbm5lbExpc3QubnVtQ2hhbm5lbHMpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICAgIGxlbiA9IHNpemVvZiggdExpbU1sbVNjYW5SZXEgKSAtIHNpemVvZiggcFNjYW5SZXEtPmNoYW5uZWxMaXN0LmNoYW5uZWxOdW1iZXIgKSArCisgICAgICAgICAgICAgICAgICAoc2l6ZW9mKCBwU2NhblJlcS0+Y2hhbm5lbExpc3QuY2hhbm5lbE51bWJlciApICogcFNjYW5SZXEtPmNoYW5uZWxMaXN0Lm51bUNoYW5uZWxzICkgKworICAgICAgICAgICAgICAgICAgcFNjYW5SZXEtPnVJRUZpZWxkTGVuOworCisgICAgICAgICAgICAgIHBNbG1TY2FuUmVxID0gdm9zX21lbV9tYWxsb2MobGVuKTsKKyAgICAgICAgICAgICAgaWYgKCBOVUxMID09IHBNbG1TY2FuUmVxICkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgICBGTCgiY2FsbCB0byBBbGxvY2F0ZU1lbW9yeSBmYWlsZWQgZm9yIG1sbVNjYW5SZXEoJWQpIiksIGxlbik7CisKKyAgICAgICAgICAgICAgICBpZiAocE1hYy0+bGltLmdMaW1Sc3BSZXFkKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltUnNwUmVxZCA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgICBsaW1TZW5kU21lU2NhblJzcChwTWFjLCBzaXplb2YodFNpclNtZVNjYW5Sc3ApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9TTUVfUkVTT1VSQ0VTX1VOQVZBSUxBQkxFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjYW5SZXEtPnNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuUmVxLT50cmFuc2FjdGlvbklkKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAvLyBJbml0aWFsaXplIHRoaXMgYnVmZmVyCisgICAgICAgICAgICAgIHZvc19tZW1fc2V0KCAodEFOSV9VOCAqKSBwTWxtU2NhblJlcSwgbGVuLCAwKTsKKyAgICAgICAgICAgICAgcE1sbVNjYW5SZXEtPmNoYW5uZWxMaXN0Lm51bUNoYW5uZWxzID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NhblJlcS0+Y2hhbm5lbExpc3QubnVtQ2hhbm5lbHM7CisKKyAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCBwTWxtU2NhblJlcS0+Y2hhbm5lbExpc3QuY2hhbm5lbE51bWJlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjYW5SZXEtPmNoYW5uZWxMaXN0LmNoYW5uZWxOdW1iZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuUmVxLT5jaGFubmVsTGlzdC5udW1DaGFubmVscyk7CisgICAgICAgIH0KKworICAgICAgICAgcE1sbVNjYW5SZXEtPnVJRUZpZWxkTGVuID0gcFNjYW5SZXEtPnVJRUZpZWxkTGVuOworICAgICAgICAgcE1sbVNjYW5SZXEtPnVJRUZpZWxkT2Zmc2V0ID0gbGVuIC0gcFNjYW5SZXEtPnVJRUZpZWxkTGVuOworICAgICAgICAgaWYocFNjYW5SZXEtPnVJRUZpZWxkTGVuKQorICAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCAodEFOSV9VOCAqKXBNbG1TY2FuUmVxKyBwTWxtU2NhblJlcS0+dUlFRmllbGRPZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopcFNjYW5SZXErKHBTY2FuUmVxLT51SUVGaWVsZE9mZnNldCksCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuUmVxLT51SUVGaWVsZExlbik7CisgICAgICAgICB9CisKKyAgICAgICAgIHBNbG1TY2FuUmVxLT5ic3NUeXBlID0gcFNjYW5SZXEtPmJzc1R5cGU7CisgICAgICAgICB2b3NfbWVtX2NvcHkoIHBNbG1TY2FuUmVxLT5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICBwU2NhblJlcS0+YnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgICBwTWxtU2NhblJlcS0+bnVtU3NpZCA9IHBTY2FuUmVxLT5udW1Tc2lkOworCisgICAgICAgICBpID0gMDsKKyAgICAgICAgIHdoaWxlIChpIDwgcE1sbVNjYW5SZXEtPm51bVNzaWQpCisgICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoICh0QU5JX1U4ICopICZwTWxtU2NhblJlcS0+c3NJZFtpXSwKKyAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSAmcFNjYW5SZXEtPnNzSWRbaV0sCisgICAgICAgICAgICAgICAgICAgICAgcFNjYW5SZXEtPnNzSWRbaV0ubGVuZ3RoICsgMSk7CisKKyAgICAgICAgICAgICAgaSsrOworICAgICAgICAgIH0KKworCisgICAgICA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JfQ0FDSEVEX1JFU1VMVFMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1TbWVMZnJTY2FuUmVzdWx0TGVuZ3RoID0gcE1hYy0+bGltLmdMaW1NbG1MZnJTY2FuUmVzdWx0TGVuZ3RoOworICAgICAgICAgICAgICAgIGlmIChwTWFjLT5saW0uZ0xpbVNtZUxmclNjYW5SZXN1bHRMZW5ndGggPT0gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGxpbVNlbmRTbWVMZnJTY2FuUnNwKHBNYWMsIHNjYW5Sc3BMZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfU01FX1NVQ0NFU1MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuUmVxLT5zZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuUmVxLT50cmFuc2FjdGlvbklkKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc2NhblJzcExlbiA9IHNpemVvZih0U2lyU21lU2NhblJzcCkgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1TbWVMZnJTY2FuUmVzdWx0TGVuZ3RoIC0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyQnNzRGVzY3JpcHRpb24pOworICAgICAgICAgICAgICAgICAgICBsaW1TZW5kU21lTGZyU2NhblJzcChwTWFjLCBzY2FuUnNwTGVuLCBlU0lSX1NNRV9TVUNDRVNTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuUmVxLT5zZXNzaW9uSWQsIHBTY2FuUmVxLT50cmFuc2FjdGlvbklkKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisjZW5kaWYKKyAgICAgICAgICAgICAgIGlmIChwTWFjLT5saW0uZ0xpbVNtZVNjYW5SZXN1bHRMZW5ndGggPT0gMCkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGxpbVNlbmRTbWVTY2FuUnNwKHBNYWMsIHNjYW5Sc3BMZW4sIGVTSVJfU01FX1NVQ0NFU1MsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuUmVxLT5zZXNzaW9uSWQsIHBTY2FuUmVxLT50cmFuc2FjdGlvbklkKTsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHNjYW5Sc3BMZW4gPSBzaXplb2YodFNpclNtZVNjYW5Sc3ApICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbVNtZVNjYW5SZXN1bHRMZW5ndGggLQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyQnNzRGVzY3JpcHRpb24pOworICAgICAgICAgICAgICAgICAgbGltU2VuZFNtZVNjYW5Sc3AocE1hYywgc2NhblJzcExlbiwgZVNJUl9TTUVfU1VDQ0VTUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NhblJlcS0+c2Vzc2lvbklkLCBwU2NhblJlcS0+dHJhbnNhY3Rpb25JZCk7CisgICAgICAgICAgICAgICB9CisjaWZkZWYgV0xBTl9GRUFUVVJFX1JPQU1fU0NBTl9PRkZMT0FECisgICAgICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiQ2FjaGVkIHNjYW4gcmVzdWx0cyBhcmUgcmV0dXJuZWQgIikpOworCisgICAgICAgICAgICBpZiAocFNjYW5SZXEtPnJldHVybkZy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REFUQV9SRVEgdG8gTUxNCisgICAgbGltUG9zdE1sbU1lc3NhZ2UocE1hYywgTElNX01MTV9PRU1fREFUQV9SRVEsICh0QU5JX1UzMiopcE1sbU9lbURhdGFSZXEpOworCisgICAgcmV0dXJuOworCit9IC8qKiogZW5kIF9fbGltUHJvY2Vzc1NtZU9lbURhdGFSZXEoKSAqKiovCisKKyNlbmRpZiAvL0ZFQVRVUkVfT0VNX0RBVEFfU1VQUE9SVAorCisvKioKKyAqIF9fbGltUHJvY2Vzc0NsZWFyRGZzQ2hhbm5lbExpc3QoKQorICoKKyAqRlVOQ1RJT046CisgKkNsZWFyIERGUyBjaGFubmVsIGxpc3QgIHdoZW4gY291bnRyeSBpcyBjaGFuZ2VkL2FxdWlyZWQuCisuKlRoaXMgbWVzc2FnZSBpcyBzZW50IGZyb20gU01FLgorICoKKyAqTE9HSUM6CisgKgorICpBU1NVTVBUSU9OUzoKKyAqCisgKk5PVEU6CisgKgorICogQHBhcmFtICBwTWFjICAgICAgUG9pbnRlciB0byBHbG9iYWwgTUFDIHN0cnVjdHVyZQorICogQHBhcmFtICAqcE1zZ0J1ZiAgQSBwb2ludGVyIHRvIHRoZSBTTUUgbWVzc2FnZSBidWZmZXIKKyAqIEByZXR1cm4gTm9uZQorICovCitzdGF0aWMgdm9pZCBfX2xpbVByb2Nlc3NDbGVhckRmc0NoYW5uZWxMaXN0KHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyTXNnUSBwTXNnKQoreworICAgIHZvc19tZW1fc2V0KCAmcE1hYy0+bGltLmRmc2NoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJERlNDaGFubmVsTGlzdCksIDApOworfQorCisvKioKKyAqIF9fbGltUHJvY2Vzc1NtZUpvaW5SZXEoKQorICoKKyAqRlVOQ1RJT046CisgKiBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCB0byBwcm9jZXNzIFNNRV9KT0lOX1JFUSBtZXNzYWdlCisgKiBmcm9tIEhERCBvciB1cHBlciBsYXllciBhcHBsaWNhdGlvbi4KKyAqCisgKkxPR0lDOgorICoKKyAqQVNTVU1QVElPTlM6CisgKgorICpOT1RFOgorICoKKyAqIEBwYXJhbSAgcE1hYyAgICAgIFBvaW50ZXIgdG8gR2xvYmFsIE1BQyBzdHJ1Y3R1cmUKKyAqIEBwYXJhbSAgKnBNc2dCdWYgIEEgcG9pbnRlciB0byB0aGUgU01FIG1lc3NhZ2UgYnVmZmVyCisgKiBAcmV0dXJuIE5vbmUKKyAqLworc3RhdGljIHZvaWQKK19fbGltUHJvY2Vzc1NtZUpvaW5SZXEodHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMzIgKnBNc2dCdWYpCit7CisgIC8vICB0QU5JX1U4ICAgICAgICAgICAgICpwQnVmOworICAgIC8vdEFOSV9VMzIgICAgICAgICAgICBsZW47CisvLyAgICB0U2lyTWFjQWRkciAgICAgICAgIGN1cnJlbnRCc3NJZDsKKyAgICB0cFNpclNtZUpvaW5SZXEgICAgIHBTbWVKb2luUmVxID0gTlVMTDsKKyAgICB0TGltTWxtSm9pblJlcSAgICAgICpwTWxtSm9pblJlcTsKKyAgICB0U2lyUmVzdWx0Q29kZXMgICAgIHJldENvZGUgPSBlU0lSX1NNRV9TVUNDRVNTOworICAgIHRBTklfVTMyICAgICAgICAgICAgdmFsID0gMDsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgIG5TaXplOworICAgIHRBTklfVTggICAgICAgICAgICAgc2Vzc2lvbklkOworICAgIHRwUEVTZXNzaW9uICAgICAgICAgcHNlc3Npb25FbnRyeSA9IE5VTEw7CisgICAgdEFOSV9VOCAgICAgICAgICAgICBzbWVzZXNzaW9uSWQ7CisgICAgdEFOSV9VMTYgICAgICAgICAgICBzbWV0cmFuc2FjdGlvbklkOworICAgIHRQb3dlcmRCbSAgICAgIC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mFpbnQgb24gMXN0IGFzc29jaWF0aW9uIGFmdGVyIGRyaXZlciBsb2FkaW5nLiAqLworICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX1JSTV9FTkFCTEVELCAmdmFsKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiY2ZnIGdldCBycm0gZW5hYmxlZCBmYWlsZWQiKSk7CisgICAgcE1hYy0+cnJtLnJybVBFQ29udGV4dC5ycm1FbmFibGUgPSAodmFsKSA/IDEgOiAwOworICAgIHZhbCA9IDA7CisjZW5kaWYgLyogV0xBTl9GRUFUVVJFX1ZPV0lGSSAqLworCisgICAvKioKKyAgICAgKiBFeHBlY3QgSm9pbiByZXF1ZXN0IGluIGlkbGUgc3RhdGUuCisgICAgICogUmVhc3NvY2lhdGUgcmVxdWVzdCBpcyBleHBlY3RlZCBpbiBsaW5rIGVzdGFibGlzaGVkIHN0YXRlLgorICAgICAqLworICAgIAorICAgIC8qIEdsb2JhbCBTTUUgYW5kIExJTSBzdGF0ZXMgYXJlIG5vdCBkZWZpbmVkIHlldCBmb3IgQlQtQU1QIFN1cHBvcnQgKi8KKyAgICBpZihwTWFjLT5saW0uZ0xpbVNtZVN0YXRlID09IGVMSU1fU01FX0lETEVfU1RBVEUpCisgICAgeworICAgICAgICBuU2l6ZSA9IF9fbGltR2V0U21lSm9pblJlcVNpemVGb3JBbGxvYygodEFOSV9VOCopIHBNc2dCdWYpOworCisgICAgICAgIHBTbWVKb2luUmVxID0gdm9zX21lbV9tYWxsb2MoblNpemUpOworICAgICAgICBpZiAoIE5VTEwgPT0gcFNtZUpvaW5SZXEgKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoImNhbGwgdG8gQWxsb2NhdGVNZW1vcnkgZmFpbGVkIGZvciAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInBTbWVKb2luUmVxIikpOworICAgICAgICAgICAgcmV0Q29kZSA9IGVTSVJfU01FX1JFU09VUkNFU19VTkFWQUlMQUJMRTsKKyAgICAgICAgICAgIGdvdG8gZW5kOworICAgICAgICB9CisgICAgICAgICh2b2lkKSB2b3NfbWVtX3NldCgodm9pZCAqKSBwU21lSm9pblJlcSwgblNpemUsIDApOworIAorICAgICAgICBpZiAoKGxpbUpvaW5SZXFTZXJEZXMocE1hYywgcFNtZUpvaW5SZXEsICh0QU5JX1U4ICopcE1zZ0J1ZikgPT0gZVNJUl9GQUlMVVJFKSB8fAorICAgICAgICAgICAgICAgICghbGltSXNTbWVKb2luUmVxVmFsaWQocE1hYywgcFNtZUpvaW5SZXEpKSkKKyAgICAgICAgeworICAgICAgICAgICAgLy8vIFJlY2VpdmVkIGludmFsaWQgZVdOSV9TTUVfSk9JTl9SRVEKKyAgICAgICAgICAgIC8vIExvZyB0aGUgZXZlbnQKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiU2Vzc2lvbklkOiVkIFJlY2VpdmVkIFNNRV9KT0lOX1JFUSB3aXRoIgorICAgICAgICAgICAgICAgICAgICJpbnZhbGlkIGRhdGEiKSxwU21lSm9pblJlcS0+c2Vzc2lvbklkKTsKKyAgICAgICAgICAgIHJldENvZGUgPSBlU0lSX1NNRV9JTlZBTElEX1BBUkFNRVRFUlM7CisgICAgICAgICAgICBnb3RvIGVuZDsKKyAgICAgICAgfQorCisgICAgICAgIC8vcE1hYy0+bGltLmdwTGltSm9pblJlcSA9IHBTbWVKb2luUmVxOyBUTyBTVVBQT1JUIEJULUFNUCwgcmV2aWV3IG9zIHNlcCAyMworCisgICAgICAgIC8qIGNoZWNrIGZvciB0aGUgZXhpc3RlbmNlIG9mIHN0YXJ0IEJTUyBzZXNzaW9uICAqLworI2lmZGVmIEZJWE1FX0dFTjYgICAgCisgICAgICAgIGlmKHBTbWVKb2luUmVxLT5ic3N0eXBlID09IGVTSVJfQlRBTVBfQVBfTU9ERSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYocGVWYWxpZGF0ZUJ0Sm9pblJlcXVlc3QocE1hYykhPSBUUlVFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiU2Vzc2lvbklkOiVkIFN0YXJ0IEJzcyBzZXNzaW9uIgorICAgICAgICAgICAgICAgICAgICAgICJub3QgcHJlc2VudDo6U01FX0pPSU5fUkVRIGluIHVuZXhwZWN0ZWQgc3RhdGUiKSwKKyAgICAgICAgICAgICAgICAgICAgICBwU21lSm9pblJlcS0+c2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICByZXRDb2RlID0gZVNJUl9TTUVfVU5FWFBFQ1RFRF9SRVFfUkVTVUxUX0NPREU7CisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSA9IE5VTEw7CisgICAgICAgICAgICAgICAgZ290byBlbmQ7ICAgCisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisjZW5kaWYKKworCisgICAgICAgIGlmKChwc2Vzc2lvbkVudHJ5ID0gcGVGaW5kU2Vzc2lvbkJ5QnNzaWQocE1hYyxwU21lSm9pblJlcS0+YnNzRGVzY3JpcHRpb24uYnNzSWQsJnNlc3Npb25JZCkpICE9IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiU2Vzc2lvbiglZCkgQWxyZWFkeSBleGlzdHMgZm9yIEJTU0lEOiAiCisgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIiIGluIGxpbVNtZVN0YXRlID0gJWQiKSxzZXNzaW9uSWQsCisgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwU21lSm9pblJlcS0+YnNzRGVzY3JpcHRpb24uYnNzSWQpLAorICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUpOworICAgICAgICAgICAgCisgICAgICAgICAgICBpZihwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSA9PSBlTElNX1NNRV9MSU5LX0VTVF9TVEFURSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBSZWNlaXZlZCBlV05JX1NNRV9KT0lOX1JFUSBmb3Igc2FtZQorICAgICAgICAgICAgICAgIC8vIEJTUyBhcyBjdXJyZW50bHkgYXNzb2NpYXRlZC4KKyAgICAgICAgICAgICAgICAvLyBMb2cgdGhlIGV2ZW50IGFuZCBzZW5kIHN1Y2Nlc3MKKyAgICAgICAgICAgICAgICBQRUxPR1cobGltTG9nKHBNYWMsIExPR1csIEZMKCJTZXNzaW9uSWQ6JWQgUmVjZWl2ZWQiCisgICAgICAgICAgICAgICAgIlNNRV9KT0lOX1JFUSBmb3IgY3VycmVudGx5IGpvaW5lZCBCU1MiKSxzZXNzaW9uSWQpOykKKyAgICAgICAgICAgICAgICAvLy8gU2VuZCBKb2luIHN1Y2Nlc3MgcmVzcG9uc2UgdG8gaG9zdAorICAgICAgICAgICAgICAgIHJldENvZGUgPSBlU0lSX1NNRV9BTFJFQURZX0pPSU5FRF9BX0JTUzsKKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5ID0gTlVMTDsKKyAgICAgICAgICAgICAgICBnb3RvIGVuZDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJTTUVfSk9JTl9SRVEgbm90IGZvciIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJjdXJyZW50bHkgam9pbmVkIEJTUyIpKTspCisgICAgICAgICAgICAgICAgcmV0Q29kZSA9IGVTSVJfU01FX1JFRlVTRUQ7CisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSA9IE5VTEw7CisgICAgICAgICAgICAgICAgZ290byBlbmQ7CisgICAgICAgICAgICB9ICAgIAorICAgICAgICB9ICAgIAorICAgICAgICBlbHNlICAgICAgIC8qIFNlc3Npb24gRW50cnkgZG9lcyBub3QgZXhpc3QgZm9yIGdpdmVuIEJTU0lkICovCisgICAgICAgIHsgICAgICAgCisgICAgICAgICAgICAvKiBUcnkgdG8gQ3JlYXRlIGEgbmV3IHNlc3Npb24gKi8KKyAgICAgICAgICAgIGlmKChwc2Vzc2lvbkVudHJ5ID0gcGVDcmVhdGVTZXNzaW9uKHBNYWMscFNtZUpvaW5SZXEtPmJzc0Rlc2NyaXB0aW9uLmJzc0lkLCZzZXNzaW9uSWQsIHBNYWMtPmxpbS5tYXhTdGF0aW9uKSkgPT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlNlc3Npb24gQ2FuIG5vdCBiZSBjcmVhdGVkICIpKTsKKyAgICAgICAgICAgICAgICByZXRDb2RlID0gZVNJUl9TTUVfUkVTT1VSQ0VTX1VOQVZBSUxBQkxFOworICAgICAgICAgICAgICAgIGdvdG8gZW5kOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLExPRzEsRkwoIlNlc3Npb25JZDolZCBOZXcgc2Vzc2lvbiBjcmVhdGVkIiksCisgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCk7CisgICAgICAgIH0KKworICAgICAgICBpZihwc2Vzc2lvbkVudHJ5ICE9IE5VTEwgJiYgcFNtZUpvaW5SZXEtPm9wZXJhdGlvbmFsUmF0ZVNldC5udW1SYXRlcyA+IDAgKXsKKyAgICAgICAgICAgIGlmKCFsaW1DaGVjazExQlJhdGVCaXRtYXAocFNtZUpvaW5SZXEtPnJhdGVCaXRNYXApKXsKKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5pczExR29ubHkgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcHNlc3Npb25FbnRy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0Rlc2NyaXB0aW9uLmllRmllbGRzKSAsIGllTGVuKTsKKworICAgICAgICBpZiAoIE5VTEwgIT0gdmVuZG9ySUUgKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgIEZMKCJEVVQgaXMgdHJ5aW5nIHRvIGNvbm5lY3QgdG8gQ2lzY28gQVAiKSk7CisgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5pc0Npc2NvVmVuZG9yQVAgPSBUUlVFOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+aXNDaXNjb1ZlbmRvckFQID0gRkFMU0U7CisgICAgICAgIH0KKworICAgICAgICAvKiBDb3B5IHRoZSBkb3QgMTEgbW9kZSBpbiB0byB0aGUgc2Vzc2lvbiB0YWJsZSAqLworCisgICAgICAgIHBzZXNzaW9uRW50cnktPmRvdDExbW9kZSAgPSBwU21lSm9pblJlcS0+ZG90MTFtb2RlOworICAgICAgICBwc2Vzc2lvbkVudHJ5LT5ud1R5cGUgPSBwU21lSm9pblJlcS0+YnNzRGVzY3JpcHRpb24ubndUeXBlOworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisgICAgICAgIHBzZXNzaW9uRW50cnktPnZodENhcGFiaWxpdHkgPSBJU19ET1QxMV9NT0RFX1ZIVChwc2Vzc2lvbkVudHJ5LT5kb3QxMW1vZGUpOworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9QRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fTUVELAorICAgICAgICAgICAgIioqKl9fbGltUHJvY2Vzc1NtZUpvaW5SZXE6IHZodENhcGFiaWxpdHk9JWQqKioqIixwc2Vzc2lvbkVudHJ5LT52aHRDYXBhYmlsaXR5KTsKKyAgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPnZodENhcGFiaWxpdHkgKQorICAgICAgICB7CisgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT50eEJGSW5pRmVhdHVyZUVuYWJsZWQgPSBwU21lSm9pblJlcS0+dHhCRkluaUZlYXR1cmVFbmFibGVkOworCisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9QRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fTUVELAorICAgICAgICAgICAgICAgICIqKipfX2xpbVByb2Nlc3NTbWVKb2luUmVxOiB0eEJGSW5pRmVhdHVyZUVuYWJsZWQ9JWQqKioqIiwKKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT50eEJGSW5pRmVhdHVyZUVuYWJsZWQpOworCisgICAgICAgICAgICBpZiggcHNlc3Npb25FbnRyeS0+dHhCRkluaUZlYXR1cmVFbmFibGVkICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoY2ZnU2V0SW50KHBNYWMsIFdOSV9DRkdfVkhUX1NVX0JFQU1GT1JNRUVfQ0FQLCBwc2Vzc2lvbkVudHJ5LT50eEJGSW5pRmVhdHVyZUVuYWJsZWQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJjb3VsZCBub3Qgc2V0ICAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIldOSV9DRkdfVkhUX1NVX0JFQU1GT1JNRUVfQ0FQIGF0IENGRyIpKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0Q29kZSA9IGVTSVJfTE9HUF9FWENFUFRJT047CisgICAgICAgICAgICAgICAgICAgIGdvdG8gZW5kOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9QRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fTUVELAorICAgICAgICAgICAgICAgICAgICAiKioqX19saW1Qcm9jZXNzU21lSm9pblJlcTogdHhCRkNzblZhbHVlPSVkKioqKiIsCisgICAgICAgICAgICAgICAgICAgIHBTbWVKb2luUmVxLT50eEJGQ3NuVmFsdWUpOworCisgICAgICAgICAgICAgICAgaWYgKGNmZ1NldEludChwTWFjLCBXTklfQ0ZHX1ZIVF9DU05fQkVBTUZPUk1FRV9BTlRfU1VQUE9SVEVELCBwU21lSm9pblJlcS0+dHhCRkNzblZhbHVlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiY291bGQgbm90IHNldCAiCisgICAgICAgICAgICAgICAgICAgICAiV05JX0NGR19WSFRfQ1NOX0JFQU1GT1JNRUVfQU5UX1NVUFBPUlRFRCBhdCBDRkciKSk7CisgICAgICAgICAgICAgICAgICAgIHJldENvZGUgPSBlU0lSX0xPR1BfRVhDRVBUSU9OOworICAgICAgICAgICAgICAgICAgICBnb3RvIGVuZDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoIEZBTFNFID09IHBNYWMtPmlzTXVCZnNlc3Npb25leGlzdCApCisgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnR4TXVCZm9ybWVlID0gcFNtZUpvaW5SZXEtPnR4TXVCZm9ybWVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9QRSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAiU21lSm9pblJlcTp0eE11QmZvcm1lZT0lZCBwc2Vzc2lvbkVudHJ5OiB0eE11QmZvcm1lZSA9ICVkIiwKKyAgICAgICAgICAgICAgICAgICAgIHBTbWVKb2luUmVxLT50eE11QmZvcm1lZSwgcHNlc3Npb25FbnRyeS0+dHhNdUJmb3JtZWUpOworCisgICAgICAgICAgICBpZihjZmdTZXRJbnQocE1hYywgV05JX0NGR19WSFRfTVVfQkVBTUZPUk1FRV9DQVAsIHBzZXNzaW9uRW50cnktPnR4TXVCZm9ybWVlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJjb3VsZCBub3Qgc2V0ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiV05JX0NGR19WSFRfTVVfQkVBTUZPUk1FRV9DQVAgYXQgQ0ZHIikpOworICAgICAgICAgICAgICAgIHJldENvZGUgPSBlU0lSX0xPR1BfRVhDRVBUSU9OOworICAgICAgICAgICAgICAgIGdvdG8gZW5kOworICAgICAgICAgICAgfQorCisgICAgICAgIH0KKworI2VuZGlmCisKKyAgICAgICAgLypQaHkgbW9kZSovCisgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW1QaHlNb2RlID0gcFNtZUpvaW5SZXEtPmJzc0Rlc2NyaXB0aW9uLm53VHlwZTsKKworICAgICAgICBoYW5kbGVIVENhcGFiaWxpdHlhbmRIVEluZm8ocE1hYywgcHNlc3Npb25FbnRyeSk7CisgICAgICAgIC8qIENvcHkgVGhlIGNoYW5uZWwgSWQgdG8gdGhlIHNlc3Npb24gVGFibGUgKi8KKyAgICAgICAgcHNlc3Npb25FbnRyeS0+Y3VycmVudE9wZXJDaGFubmVsID0gcFNtZUpvaW5SZXEtPmJzc0Rlc2NyaXB0aW9uLmNoYW5uZWxJZDsKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+aHRTdXBwb3J0ZWRDaGFubmVsV2lkdGhTZXQgPSAocFNtZUpvaW5SZXEtPm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KCJyZWNlaXZlZCBTTUVfSk9JTl9SRVEgd2l0aCBpbnZhbGlkIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBic3MgdHlwZSAlZCIpLCBwc2Vzc2lvbkVudHJ5LT5ic3NUeXBlKTsKKyAgICAgICAgICAgIHJldENvZGUgPSBlU0lSX1NNRV9JTlZBTElEX1BBUkFNRVRFUlM7CisgICAgICAgICAgICBnb3RvIGVuZDsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChwU21lSm9pblJlcS0+YWRkSUVTY2FuLmxlbmd0aCkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCAmcHNlc3Npb25FbnRyeS0+cExpbUpvaW5SZXEtPmFkZElFU2NhbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJnBTbWVKb2luUmVxLT5hZGRJRVNjYW4sIHNpemVvZih0U2lyQWRkaWUpKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChwU21lSm9pblJlcS0+YWRkSUVBc3NvYy5sZW5ndGgpCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSggJnBzZXNzaW9uRW50cnktPnBMaW1Kb2luUmVxLT5hZGRJRUFzc29jLAorICAgICAgICAgICAgICAgICAgICAgICAgICAmcFNtZUpvaW5SZXEtPmFkZElFQXNzb2MsIHNpemVvZih0U2lyQWRkaWUpKTsKKyAgICAgICAgfQorICAgICAgICAgICAgICAgICAKKyAgICAgICAgdmFsID0gc2l6ZW9mKHRMaW1NbG1Kb2luUmVxKSArIHBzZXNzaW9uRW50cnktPnBMaW1Kb2luUmVxLT5ic3NEZXNjcmlwdGlvbi5sZW5ndGggKyAyOworICAgICAgICBwTWxtSm9pblJlcSA9IHZvc19tZW1fbWFsbG9jKHZhbCk7CisgICAgICAgIGlmICggTlVMTCA9PSBwTWxtSm9pblJlcSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiY2FsbCB0byBBbGxvY2F0ZU1lbW9yeSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJmYWlsZWQgZm9yIG1sbUpvaW5SZXEiKSk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgKHZvaWQpIHZvc19tZW1fc2V0KCh2b2lkICopIHBNbG1Kb2luUmVxLCB2YWwsIDApOworCisgICAgICAgIC8qIFBFIFNlc3Npb25JZCBpcyBzdG9yZWQgYXMgYSBwYXJ0IG9mIEpvaW5SZXEqLworICAgICAgICBwTWxtSm9pblJlcS0+c2Vzc2lvbklkID0gcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQ7CisgICAgICAgIAorICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19KT0lOX0ZBSUxVUkVfVElNRU9VVCwgKHRBTklfVTMyICopICZwTWxtSm9pblJlcS0+am9pbkZhaWx1cmVUaW1lb3V0KQorICAgICAgICAgICAgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBKb2luRmFpbHVyZVRpbWVyIHZhbHVlICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInNldHRpbmcgaXQgdG8gZGVmYXVsdCB2YWx1ZSIpKTsKKyAgICAgICAgICAgIHBNbG1Kb2luUmVxLT5qb2luRmFpbHVyZVRpbWVvdXQgPSBKT0lOX0ZBSUxVUkVfVElNRU9VVDsKKyAgICAgICAgfQorCisgICAgICAgIC8qIGNvcHkgb3BlcmF0aW9uYWwgcmF0ZSBmcm9tIHBzZXNzaW9uRW50cnkqLworICAgICAgICB2b3NfbWVtX2NvcHkoKHZvaWQqKSZwc2Vzc2lvbkVudHJ5LT5yYXRlU2V0LCAodm9pZCopJnBTbWVKb2luUmVxLT5vcGVyYXRpb25hbFJhdGVTZXQsCisgICAgICAgICAgICAg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01heCwgbG9jYWxQb3dlckNvbnN0cmFpbnQsIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ublR4UG93ZXJDYXApOworI2Vsc2UKKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPm1heFR4UG93ZXIgPSBWT1NfTUlOKCByZWdNYXgsIChsb2NhbFBvd2VyQ29uc3RyYWludCkgKTsKKyNlbmRpZgorICAgICAgICBpZiAoIXBzZXNzaW9uRW50cnktPm1heFR4UG93ZXIpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1BFLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJUeCBwb3dlciIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpcyB6ZXJvLiBTZXR0aW5nIGl0IHRvIGRlZmF1bHQgdmFsdWUgJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUWF9QT1dFUl9ERUZBVUxUKTsKKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPm1heFR4UG93ZXIgPSBUWF9QT1dFUl9ERUZBVUxUOworICAgICAgICB9CisKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfUEUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgIlJlZ3VsYXRvcnkgbWF4ID0gJWQsIGxvY2FsIHBvd2VyIGNvbnN0cmFpbnQgPSAlZCwiCisgICAgICAgICAgICAgICAgICAgICAgICAiIG1heCB0eCA9ICVkIiwgcmVnTWF4LCBsb2NhbFBvd2VyQ29uc3RyYWludCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bWF4VHhQb3dlciApOworCisgICAgICAgIGlmIChwTWFjLT5saW0uZ0xpbUN1cnJlbnRCc3NVYXBzZCkKKyAgICAgICAgeworICAgICAgICAgICAgcE1hYy0+bGltLmdVYXBzZFBlckFjQml0bWFzayA9IHBzZXNzaW9uRW50cnktPnBMaW1Kb2luUmVxLT51YXBzZFBlckFjQml0bWFzazsKKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HMSwgRkwoIlVBUFNEIGZsYWcgZm9yIGFsbCBBQyAtIDB4JTJ4IiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ1VhcHNkUGVyQWNCaXRtYXNrKTsKKworICAgICAgICAgICAgLy8gcmVzZXR0aW5nIHRoZSBkeW5hbWljIHVhcHNkIG1hc2sgCisgICAgICAgICAgICBwTWFjLT5saW0uZ1VhcHNkUGVyQWNEZWxpdmVyeUVuYWJsZU1hc2sgPSAwOworICAgICAgICAgICAgcE1hYy0+bGltLmdVYXBzZFBlckFjVHJpZ2dlckVuYWJsZU1hc2sgPSAwOworICAgICAgICB9CisKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltUkZCYW5kID0gbGltR2V0UkZCYW5kKHBzZXNzaW9uRW50cnktPmN1cnJlbnRPcGVyQ2hhbm5lbCk7CisKKyAgICAgICAgLy8gSW5pdGlhbGl6ZSAxMWggRW5hYmxlIEZsYWcKKyAgICAgICAgaWYoU0lSX0JBTkRfNV9HSFogPT0gcHNlc3Npb25FbnRyeS0+bGltUkZCYW5kKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR18xMUhfRU5BQkxFRCwgJnZhbCkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiRmFpbCB0byBnZXQgV05JX0NGR18xMUhfRU5BQkxFRCAiKSk7CisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltMTFoRW5hYmxlID0gMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW0xM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SRVEgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaW4gc3RhdGUgJWQiKSwgcE1hYy0+bGltLmdMaW1TbWVTdGF0ZSk7CisgICAgICAgIGxpbVByaW50U21lU3RhdGUocE1hYywgTE9HRSwgcE1hYy0+bGltLmdMaW1TbWVTdGF0ZSk7CisgICAgICAgIHJldENvZGUgPSBlU0lSX1NNRV9VTkVYUEVDVEVEX1JFUV9SRVNVTFRfQ09ERTsKKyAgICAgICAgcHNlc3Npb25FbnRyeSA9IE5VTEw7CisgICAgICAgIGdvdG8gZW5kOworICAgICAgICAKKyAgICB9CisKK2VuZDoKKyAgICBsaW1HZXRTZXNzaW9uSW5mbyhwTWFjLCh0QU5JX1U4KilwTXNnQnVmLCZzbWVzZXNzaW9uSWQsJnNtZXRyYW5zYWN0aW9uSWQpOyAKKyAgICAKKyAgICBpZihwU21lSm9pblJlcSkKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZShwU21lSm9pblJlcSk7CisgICAgICAgIHBTbWVKb2luUmVxID0gTlVMTDsKKyAgICAgICAgaWYgKE5VTEwgIT0gcHNlc3Npb25FbnRyeSkKKyAgICAgICAgeworICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cExpbUpvaW5SZXEgPSBOVUxMOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIGlmKHJldENvZGUgIT0gZVNJUl9TTUVfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIGlmKE5VTEwgIT0gcHNlc3Npb25FbnRyeSkKKyAgICAgICAgeworICAgICAgICAgICAgcGVEZWxldGVTZXNzaW9uKHBNYWMscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5ID0gTlVMTDsKKyAgICAgICAgfQorICAgIH0gCisgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJTZW5kaW5nIGZhaWx1cmUgc3RhdHVzIGxpbVNlbmRTbWVKb2luUmVhc3NvY1JzcCIKKyAgICAgICAgICAgICA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0QU5JX1UxNiAgICAgICAgICAgIG5TaXplOworCisKKyAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlJlY2VpdmVkIFNNRV9SRUFTU09DX1JFUSIpKTsKKyAgICAKKyAgICBuU2l6ZSA9IF9fbGltR2V0U21lSm9pblJlcVNpemVGb3JBbGxvYygodEFOSV9VOCAqKSBwTXNnQnVmKTsKKyAgICBwUmVhc3NvY1JlcSA9IHZvc19tZW1fbWFsbG9jKG5TaXplKTsKKyAgICBpZiAoIE5VTEwgPT0gcFJlYXNzb2NSZXEgKQorICAgIHsKKyAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgRkwoImNhbGwgdG8gQWxsb2NhdGVNZW1vcnkgZmFpbGVkIGZvciBwUmVhc3NvY1JlcSIpKTsKKworICAgICAgICByZXRDb2RlID0gZVNJUl9TTUVfUkVTT1VSQ0VTX1VOQVZBSUxBQkxFOworICAgICAgICBnb3RvIGVuZDsKKyAgICB9CisgICAgKHZvaWQpIHZvc19tZW1fc2V0KCh2b2lkICopIHBSZWFzc29jUmVxLCBuU2l6ZSwgMCk7CisgICAgaWYgKChsaW1Kb2luUmVxU2VyRGVzKHBNYWMsICh0cFNpclNtZUpvaW5SZXEpIHBSZWFzc29jUmVxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSBwTXNnQnVmKSA9PSBlU0lSX0ZBSUxVUkUpIHx8CisgICAgICAgICghbGltSXNTbWVKb2luUmVxVmFsaWQocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodHBTaXJTbWVKb2luUmVxKSBwUmVhc3NvY1JlcSkpKQorICAgIHsKKyAgICAgICAgLy8vIFJlY2VpdmVkIGludmFsaWQgZVdOSV9TTUVfUkVBU1NPQ19SRVEKKyAgICAgICAgLy8gTG9nIHRoZSBldmVudAorICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywKKyAgICA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zSWQsCisgICAgICAgICAgICAgICAgcE1hYy0+ZnQuZnRQRUNvbnRleHQucEZUUHJlQXV0aFJlcS0+cHJlQXV0aGJzc0lkLCA2KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1QcmludE1hY0FkZHIocE1hYywgcFJlYXNzb2NSZXEtPmJzc0Rlc2NyaXB0aW9uLmJzc0lkLCBMT0dFKTsKKyAgICAgICAgICAgICAgICBsaW1QcmludE1hY0FkZHIocE1hYywgcE1hYy0+ZnQuZnRQRUNvbnRleHQucEZUUHJlQXV0aFJlcS0+cHJlQXV0aGJzc0lkLCBMT0dFKTsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoIlVua25vd24gYnNzSWQgaW4gcmVhc3NvYyBzdGF0ZSIpKTsKKyAgICAgICAgICAgICAgICByZXRDb2RlID0gZVNJUl9TTUVfSU5WQUxJRF9QQVJBTUVURVJTOworICAgICAgICAgICAgICAgIGdvdG8gZW5kOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBsaW1Qcm9jZXNzTWxtRlRSZWFzc29jUmVxKHBNYWMsIHBNc2dCdWYsIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgLy8vIFNob3VsZCBub3QgaGF2ZSByZWNlaXZlZCBlV05JX1NNRV9SRUFTU09DX1JFUQorICAgICAgICAvLyBMb2cgdGhlIGV2ZW50CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIHVuZXhwZWN0ZWQgU01FX1JFQVNTT0NfUkVRIGluIHN0YXRlICVkIiksCisgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSk7CisgICAgICAgIGxpbVByaW50U21lU3RhdGUocE1hYywgTE9HRSwgcHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUpOworCisgICAgICA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NYXhUcmFuc21pdFBvd2VyKCBwTWFjLCBwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwgKTsgCisgICAgbG9jYWxQb3dlckNvbnN0cmFpbnQgPSByZWdNYXg7CisgICAgbGltRXh0cmFjdEFwQ2FwYWJpbGl0eSggcE1hYywKKyAgICAgICAgICAgICAgKHRBTklfVTggKikgcHNlc3Npb25FbnRyeS0+cExpbVJlQXNzb2NSZXEtPmJzc0Rlc2NyaXB0aW9uLmllRmllbGRzLAorICAgICAgICAgICAgICBsaW1HZXRJRWxlbkZyb21Cc3NEZXNjcmlwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICZwc2Vzc2lvbkVudHJ5LT5wTGltUmVBc3NvY1JlcS0+YnNzRGVzY3JpcHRpb24pLAorICAgICAgICAgICAgICAmcHNlc3Npb25FbnRyeS0+bGltUmVhc3NvY0Jzc1Fvc0NhcHMsCisgICAgICAgICAgICAgICZwc2Vzc2lvbkVudHJ5LT5saW1SZWFzc29jQnNzUHJvcENhcCwKKyAgICAgICAgICAgICAgJnBNYWMtPmxpbS5nTGltQ3VycmVudEJzc1VhcHNkIC8vVEJELVJBSkVTSCBtYWtlIGdMaW1SZWFzc29jQnNzVWFwc2Qgc2Vzc2lvbiBzcGVjaWZpYworICAgICAgICAgICAgICAsICZsb2NhbFBvd2VyQ29uc3RyYWludCwKKyAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeQorICAgICAgICAgICAgICApOworCisgICAgcHNlc3Npb25FbnRyeS0+bWF4VHhQb3dlciA9IFZPU19NSU4oIHJlZ01heCwgKGxvY2FsUG93ZXJDb25zdHJhaW50KSApOworICAgIGlmICghcHNlc3Npb25FbnRyeS0+bWF4VHhQb3dlcikKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1BFLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJUeCBwb3dlciAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICA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AgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+c3NJZC5zc0lkLAorICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnNzSWQubGVuZ3RoKTsKKyAgICAjZW5kaWYKKyAgICBwc2Vzc2lvbkVudHJ5LT5saW1SZWFzc29jU1NJRC5sZW5ndGggPSBwUmVhc3NvY1JlcS0+c3NJZC5sZW5ndGg7CisgICAgdm9zX21lbV9jb3B5KCAgIHBzZXNzaW9uRW50cnktPmxpbVJlYXNzb2NTU0lELnNzSWQsCisgICAgICAgICAgICAgICAgICAgIHBSZWFzc29jUmVxLT5zc0lkLnNzSWQsIHBzZXNzaW9uRW50cnktPmxpbVJlYXNzb2NTU0lELmxlbmd0aCk7CisKKyAgICB9CisKKyAgICBpZiAocE1hYy0+bGltLmdMaW1DdXJyZW50QnNzVWFwc2QpCisgICAgeworICAgICAgICBwTWFjLT5saW0uZ1VhcHNkUGVyQWNCaXRtYXNrID0gcHNlc3Npb25FbnRyeS0+cExpbVJlQXNzb2NSZXEtPnVhcHNkUGVyQWNCaXRtYXNrOworICAgICAgICBsaW1Mb2coIHBNYWMsIExPRzEsIEZMKCJVQVBTRCBmbGFnIGZvciBhbGwgQUMgLSAweCUyeCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nVWFwc2RQZXJBY0JpdG1hc2spOworICAgIH0KKworICAgIHBNbG1SZWFzc29jUmVxID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRMaW1NbG1SZWFzc29jUmVxKSk7CisgICAgaWYgKCBOVUxMID09IHBNbG1SZWFzc29jUmVxICkKKyAgICB7CisgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgIEZMKCJjYWxsIHRvIEFsbG9jYXRlTWVtb3J5IGZhaWxlZCBmb3IgbWxtUmVhc3NvY1JlcSIpKTsKKworICAgICAgICByZXRDb2RlID0gZVNJUl9TTUVfUkVTT1VSQ0VTX1VOQVZBSUxBQkxFOworICAgICAgICBnb3RvIGVuZDsKKyAgICB9CisKKyAgICB2b3NfbWVtX2NvcHkoIHBNbG1SZWFzc29jUmVxLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVJlQXNzb2Nic3NJZCwKKyAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworCisgICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfUkVBU1NPQ0lBVElPTl9GQUlMVVJFX1RJTUVPVVQsCisgICAgICAgICAgICAgICAgICAodEFOSV9VMzIgKikgJnBNbG1SZWFzc29jUmVxLT5yZWFzc29jRmFpbHVyZVRpbWVvdXQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBlU0lSX1NVQ0NFU1MpCisgICAgeworICAgICAgICAvKioKKyAgICAgICAgICogQ291bGQgbm90IGdldCBSZWFzc29jRmFpbHVyZVRpbWVvdXQgdmFsdWUKKyAgICAgICAgICogZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgICovCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBSZWFzc29jRmFpbHVyZVRpbWVvdXQgdmFsdWUiKSk7CisgICAgfQorCisgICAgaWYgKGNmZ0dldENhcGFiaWxpdHlJbmZvKHBNYWMsICZjYXBzLHBzZXNzaW9uRW50cnkpICE9IGVTSVJfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIC8qKgorICAgICAgICAgKiBDb3VsZCBub3QgZ2V0IENhcGFiaWxpdGllcyB2YWx1ZQorICAgICAgICAgKiBmcm9tIENGRy4gTG9nIGVycm9yLgorICAgICAgICAgKi8KKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICBGTCgiY291bGQgbm90IHJldHJpZXZlIENhcGFiaWxpdGllcyB2YWx1ZSIpKTsKKyAgICB9CisgICAgcE1sbVJlYXNzb2NSZXEtPmNhcGFiaWxpdHlJbmZvID0gY2FwczsKKyAgICAKKyAgICAvKiBVcGRhdGUgUEUgc2Vzc2lvbklkKi8KKyAgICBwTWxtUmVhc3NvY1JlcS0+c2Vzc2lvbklkID0gc2Vzc2lvbklkOworCisgICAvKiBJZiB0ZWxlc2NvcGljIGJlYWNvbmluZyBpcyBlbmFibGVkLCBzZXQgbGlzdGVuIGludGVydmFsIHRvCisgICAgIFdOSV9DRkdfVEVMRV9CQ05fTUFYX0xJICovCisgICAgaWYod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19URUxFX0JDTl9XQUtFVVBfRU4sICZ0ZWxlQmNuRW4pICE9IAorICAgICAgIGVTSVJfU1VDQ0VTUykgCisgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJDb3VsZG4ndCBnZXQgV05JX0NGR19URUxFX0JDTl9XQUtFVVBfRU4iKSk7CisgICAKKyAgICB2YWwgPSBXTklfQ0ZHX0xJU1RFTl9JTlRFUlZBTF9TVEFERUY7CisgICAKKyAgICBpZih0ZWxlQmNuRW4pCisgICAgeworICAgICAgIGlmKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfVEVMRV9CQ05fTUFYX0xJLCAmdmFsKSAhPSAKKyAgICAgICAgICBlU0lSX1NVQ0NFU1MpCisgICAgICAgeworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAqIENvdWxkIG5vdCBnZXQgTGlzdGVuSW50ZXJ2YWwgdmFsdWUKKyAgICAgICAgICAgICogZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgICAqLworICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiY291bGQgbm90IHJldHJpZXZlIExpc3RlbkludGVydmFsIikpOworICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAg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gbWVzc2FnZQorICogZnJvbSBIREQgb3IgdXBwZXIgbGF5ZXIgYXBwbGljYXRpb24uCisgKgorICpMT0dJQzoKKyAqCisgKkFTU1VNUFRJT05TOgorICoKKyAqTk9URToKKyAqCisgKiBAcGFyYW0gIHBNYWMgICAgICBQb2ludGVyIHRvIEdsb2JhbCBNQUMgc3RydWN0dXJlCisgKiBAcGFyYW0gICpwTXNnQnVmICBBIHBvaW50ZXIgdG8gdGhlIFNNRSBtZXNzYWdlIGJ1ZmZlcgorICogQHJldHVybiBOb25lCisgKi8KKworc3RhdGljIHZvaWQKK19fbGltUHJvY2Vzc1NtZURpc2Fzc29jUmVxKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTMyICpwTXNnQnVmKQoreworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgIGRpc2Fzc29jVHJpZ2dlciwgcmVhc29uQ29kZTsKKyAgICB0TGltTWxtRGlzYXNzb2NSZXEgICAgICAqcE1sbURpc2Fzc29jUmVxOworICAgIHRTaXJSZXN1bHRDb2RlcyAgICAgICAgIHJldENvZGUgPSBlU0lSX1NNRV9TVUNDRVNTOworICAgIHRTaXJSZXRTdGF0dXMgICAgICAgICAgIHN0YXR1czsKKyAgICB0U2lyU21lRGlzYXNzb2NSZXEgICAgICBzbWVEaXNhc3NvY1JlcTsKKyAgICB0cFBFU2Vzc2lvbiAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5ID0gTlVMTDsgCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgc2Vzc2lvbklkOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgIHNtZXNlc3Npb25JZDsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgICBzbWV0cmFuc2FjdGlvbklkOworCisgICAgCisgICAgaWYgKHBNc2dCdWYgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiQnVmZmVyIGlzIFBvaW50aW5nIHRvIE5VTEwiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBsaW1HZXRTZXNzaW9uSW5mbyhwTWFjLCAodEFOSV9VOCAqKXBNc2dCdWYsJnNtZXNlc3Npb25JZCwgJnNtZXRyYW5zYWN0aW9uSWQpOworCisgICAgc3RhdHVzID0gbGltRGlzYXNzb2NSZXFTZXJEZXMocE1hYywgJnNtZURpc2Fzc29jUmVxLCAodEFOSV9VOCAqKSBwTXNnQnVmKTsKKyAgICAKKyAgICBpZiAoIChlU0lSX0ZBSUxVUkUgPT0gc3RhdHVzKSB8fAorICAgICAgICAgKCFsaW1Jc1NtZURpc2Fzc29jUmVxVmFsaWQocE1hYywgJnNtZURpc2Fzc29jUmVxLCBwc2Vzc2lvbkVudHJ5KSkgKQorICAgIHsKKyAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIGludmFsaWQgU01FX0RJU0FTU09DX1JFUSBtZXNzYWdlIikpOykKKworICAgICAgICBpZiAocE1hYy0+bGltLmdMaW1Sc3BSZXFkKQorICAgICAgICB7CisgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbVJzcFJlcWQgPSBmYWxzZTsKKworICAgICAgICAgICAgcmV0Q29kZSAgICAgICAgID0gZVNJUl9TTUVfSU5WQUxJRF9QQVJBTUVURVJTOworICAgICAgICAgICAgZGlzYXNzb2NUcmlnZ2VyID0gZUxJTV9IT1NUX0RJU0FTU09DOworICAgICAgICAgICAgZ290byBzZW5kRGlzYXNzb2M7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaWYoKHBzZXNzaW9uRW50cnkgPSBwZUZpbmRTZXNzaW9uQnlCc3NpZChwTWFjLHNtZURpc2Fzc29jUmVxLmJzc0lkLCZzZXNzaW9uSWQpKT09IE5VTEwpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSxGTCgic2Vzc2lvbiBkb2VzIG5vdCBleG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hbnNhY3Rpb24gSUQqLworCisgICAgcHNlc3Npb25FbnRyeS0+c21lU2Vzc2lvbklkID0gc21lc2Vzc2lvbklkOworICAgIHBzZXNzaW9uRW50cnktPnRyYW5zYWN0aW9uSWQgPSBzbWV0cmFuc2FjdGlvbklkOworCisgICAgc3dpdGNoIChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlKQorICAgIHsKKyAgICAgICAgY2FzZSBlTElNX1NUQV9ST0xFOgorICAgICAgICBjYXNlIGVMSU1fQlRfQU1QX1NUQV9ST0xFOgorICAgICAgICAgICAgc3dpdGNoIChwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjYXNlIGVMSU1fU01FX0FTU09DSUFURURfU1RBVEU6CisgICAgICAgICAgICAgICAgY2FzZSBlTElNX1NNRV9MSU5LX0VTVF9TVEFURToKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJSY3ZkIFNNRV9ESVNBU1NPQ19SRVEgd2hpbGUgaW4gIgorICAgICAgICAgICAgICAgICAgICAgICJsaW1TbWVTdGF0ZTogJWQgIikscHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUpOworCisgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVByZXZTbWVTdGF0ZSA9IHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlOworICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZT0gZUxJTV9TTUVfV1RfRElTQVNTT0NfU1RBVEU7CisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICAgICAgICAgICAgICAgICAgLyogRGVsZXRlIGFsbCBURExTIHBlZXJzIGNvbm5lY3RlZCBiZWZvcmUgbGVhdmluZyBCU1MqLworICAgICAgICAgICAgICAgICAgICBsaW1EZWxldGVURExTUGVlcnMocE1hYywgcHNlc3Npb25FbnRyeSk7CisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfU01FX1NUQVRFLCBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwgcHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUpKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIGVMSU1fU01FX1dUX0RFQVVUSF9TVEFURToKKyAgICAgICAgICAgICAgICAgICAgLyogUEUgc2hhbGwgc3RpbGwgcHJvY2VzcyB0aGUgRElTQVNTT0NfUkVRIGFuZCBwcm9jZWVkIHdpdGggCisgICAgICAgICAgICAgICAgICAgICAqIGxpbmsgdGVhciBkb3duIGV2ZW4gaWYgaXQgaGFkIGFscmVhZHkgc2VudCBhIERFQVVUSF9JTkQgdG8KKyAgICAgICAgICAgICAgICAgICAgICogdG8gU01FLiBwTWFjLT5saW0uZ0xpbVByZXZTbWVTdGF0ZSBzaGFsbCByZW1haW4gdGhlIHNhbWUgYXMKKyAgICAgICAgICAgICAgICAgICAgICogaXRzIGJlZW4gc2V0IHdoZW4gUEUgZW50ZXJlZCBXVF9ERUFVVEhfU1RBVEUuIAorICAgICAgICAgICAgICAgICAgICAgKi8gICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGU9IGVMSU1fU01FX1dUX0RJU0FTU09DX1NUQVRFOworICAgICAgICAgICAgICAgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9TTUVfU1RBVEUsIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLCBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSkpOworICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlJjdmQgU01FX0RJU0FTU09DX1JFUSB3aGlsZSBpbiAiCisgICAgICAgICAgICAgICAgICAgICAgICJTTUVfV1RfREVBVVRIX1NUQVRFLiAiKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBlTElNX1NNRV9XVF9ESVNBU1NPQ19TVEFURToKKyAgICAgICAgICAgICAgICAgICAgLyogUEUgUmVjaWV2ZWQgYSBEaXNhc3NvYyBmcmFtZS4gTm9ybWFsbHkgaXQgZ2V0cyBESVNBU1NPQ19DTkYgYnV0IGl0CisgICAgICAgICAgICAgICAgICAgICAqIHJlY2VpdmVkIERJU0FTU09DX1JFUS4gV2hpY2ggbWVhbnMgaG9zdCBpcyBhbHNvIHRyeWluZyB0byBkaXNjb25uZWN0LgorICAgICAgICAgICAgICAgICAgICAgKiBQRSBjYW4gY29udGludWUgcHJvY2Vzc2luZyBESVNBU1NPQ19SRVEgYW5kIHNlbmQgdGhlIHJlc3BvbnNlIGluc3RlYWQKKyAgICAgICAgICAgICAgICAgICAgICogb2YgZmFpbGluZyB0aGUgcmVxdWVzdC4gU01FIHdpbGwgYW55d2F5IGlnbm9yZSBERUFVVEhfSU5EIHRoYXQgd2FzIHNlbnQKKyAgICAgICAgICAgICAgICAgICAgICogZm9yIGRpc2Fzc29jIGZyYW1lLgorICAgICAgICAgICAgICAgICAgICAgKgorICAgICAgICAgICAgICAgICAgICAgKiBJdCB3aWxsIHNlbmQgYSBkaXNhc3NvYywgd2hpY2ggaXMgb2suIEhvd2V2ZXIsIHdlIGNhbiB1c2UgdGhlIGdsb2JhbCBmbGFnCisgICAgICAgICAgICAgICAgICAgICAqIHNlbmREaXNhc3NvYyB0byBub3Qgc2VuZCBkaXNhc3NvYyBmcmFtZS4KKyAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiUmN2ZCBTTUVfRElTQVNTT0NfUkVRIHdoaWxlIGluICIKKyAgICAgICAgICAgICAgICAgICAgICAgIlNNRV9XVF9ESVNBU1NPQ19TVEFURS4gIikpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgZUxJTV9TTUVfSk9JTl9GQUlMVVJFX1NUQVRFOiB7CisgICAgICAgICAgICAgICAgICAgIC8qKiBSZXR1cm4gU3VjY2VzcyBhcyB3ZSBhcmUgYWxyZWFkeSBpbiBEaXNjb25uZWN0ZWQgU3RhdGUqLworICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlJjdmQgU01FX0RJU0FTU09DX1JFUSB3aGlsZSBpbiAiCisgICAgICAgICAgICAgICAgICAgICAgICJlTElNX1NNRV9KT0lOX0ZBSUxVUkVfU1RBVEUuICIpKTsKKyAgICAgICAgICAgICAgICAgICAgIGlmIChwTWFjLT5saW0uZ0xpbVJzcFJlcWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldENvZGUgPSBlU0lSX1NNRV9TVUNDRVNTOyAgCisgICAgICAgICAgICAgICAgICAgICAgICBkaXNhc3NvY1RyaWdnZXIgPSBlTElNX0hPU1RfRElTQVNTT0M7CisgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIHNlbmREaXNhc3NvYzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH1icmVhazsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgICAgICogU1RBIGlzIG5vdCBjdXJyZW50bHkgYXNzb2NpYXRlZC4KKyAgICAgICAgICAgICAgICAgICAgICogTG9nIGVycm9yIGFuZCBzZW5kIHJlc3BvbnNlIHRvIGhvc3QKKyAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICBGTCgicmVjZWl2ZWQgdW5leHBlY3RlZCBTTUVfRElTQVNTT0NfUkVRIGluIHN0YXRlICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgbGltUHJpbnRTbWVTdGF0ZShwTWFjLCBMT0dFLCBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKHBNYWMtPmxpbS5nTGltUnNwUmVxZCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlICE9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlTElNX1NNRV9XVF9BU1NPQ19TVEFURSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltUnNwUmVxZCA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgICAgICAgICByZXRDb2RlID0gZVNJUl9TTUVfVU5FWFBFQ1RFRF9SRVFfUkVTVUxUX0NPREU7CisgICAgICAgICAgICAgICAgICAgICAgICBkaXNhc3NvY1RyaWdnZXIgPSBlTElNX0hPU1RfRElTQVNTT0M7CisgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIHNlbmREaXNhc3NvYzsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlTElNX0FQX1JPTEU6CisgICAgY2FzZSBlTElNX0JUX0FNUF9BUF9ST0xFOgorICAgICAgICAgICAgLy8gRmFsbCB0aHJvdWdoCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVMSU1fU1RBX0lOX0lCU1NfUk9MRToKKyAgICAgICAgZGVmYXVsdDogLy8gZUxJTV9VTktOT1dOX1JPTEUKKyAgICA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RyaWdnZXI7CisgICAgCisgICAgLyogVXBkYXRlIFBFIHNlc3Npb24gSUQqLworICAgIHBNbG1EaXNhc3NvY1JlcS0+c2Vzc2lvbklkID0gc2Vzc2lvbklkOworCisgICAgbGltUG9zdE1sbU1lc3NhZ2UocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICBMSU1fTUxNX0RJU0FTU09DX1JFUSwKKyAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VMzIgKikgcE1sbURpc2Fzc29jUmVxKTsKKyAgICByZXR1cm47CisKK3NlbmREaXNhc3NvYzoKKyAgICBpZiAocHNlc3Npb25FbnRyeSkgCisgICAgICAgIGxpbVNlbmRTbWVEaXNhc3NvY050ZihwTWFjLCBzbWVEaXNhc3NvY1JlcS5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0Q29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzYXNzb2NUcmlnZ2VyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAxLHNtZXNlc3Npb25JZCxzbWV0cmFuc2FjdGlvbklkLHBzZXNzaW9uRW50cnkpOworICAgIGVsc2UgCisgICAgICAgIGxpbVNlbmRTbWVEaXNhc3NvY050ZihwTWFjLCBzbWVEaXNhc3NvY1JlcS5wZWVyTWFjQWRkciwgCisgICAgICAgICAgICAgICAgcmV0Q29kZSwgCisgICAgICAgICAgICAgICAgZGlzYXNzb2NUcmlnZ2VyLAorICAgICAgICAgICAgICAgIDEsIHNtZXNlc3Npb25JZCwgc21ldHJhbnNhY3Rpb25JZCwgTlVMTCk7CisKKworfSAvKioqIGVuZCBfX2xpbVByb2Nlc3NTbWVEaXNhc3NvY1JlcSgpICoqKi8KKworCisvKiogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgXGJyaWVmIF9fbGltUHJvY2Vzc1NtZURpc2Fzc29jQ25m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nQocE1hYywgV0xBTl9QRV9ESUFHX0RFQVVUSF9DTkZfRVZFTlQsIHBzZXNzaW9uRW50cnksICh0QU5JX1UxNilzbWVEaXNhc3NvY0NuZi5zdGF0dXNDb2RlLCAwKTsKKyNlbmRpZiAvL0ZFQVRVUkVfV0xBTl9ESUFHX1NVUFBPUlQKKworICAgIHN3aXRjaCAocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSkKKyAgICB7CisgICAgICAgIGNhc2UgZUxJTV9TVEFfUk9MRToKKyAgICAgICAgY2FzZSBlTElNX0JUX0FNUF9TVEFfUk9MRTogIC8vVG8gdGVzdCByZWNvbm4KKyAgICAgICAgICAgIGlmICgocHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUgIT0gZUxJTV9TTUVfSURMRV9TVEFURSkgJiYKKyAgICAgICAgICAgICAgICAocHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUgIT0gZUxJTV9TTUVfV1RfRElTQVNTT0NfU1RBVEUpICYmCisgICAgICAgICAgICAgICAgKHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlICE9IGVMSU1fU01FX1dUX0RFQVVUSF9TVEFURSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIHVuZXhwIFNNRV9ESVNBU1NPQ19DTkYgaW4gc3RhdGUgJWQiKSwKKyAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlKTsKKyAgICAgICAgICAgICAgICBsaW1QcmludFNtZVN0YXRlKHBNYWMsIExPR0UsIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVMSU1fQVBfUk9MRToKKyAgICAgICAgICAgIC8vIEZhbGwgdGhyb3VnaAorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlTElNX1NUQV9JTl9JQlNTX1JPTEU6CisgICAgICAgIGRlZmF1bHQ6IC8vIGVMSU1fVU5LTk9XTl9ST0xFCisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCB1bmV4cGVjdGVkIFNNRV9ESVNBU1NPQ19DTkYgcm9sZSAlZCIpLAorICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSk7CisKKyAgICAgICAgICAgIHJldHVybjsKKyAgICB9IAorCisKKyAgICBpZiAoIChwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSA9PSBlTElNX1NNRV9XVF9ESVNBU1NPQ19TVEFURSkgfHwgCisgICAgICAgICAocHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUgPT0gZUxJTV9TTUVfV1RfREVBVVRIX1NUQVRFKQorICAgICAgICAgIHx8IChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQVBfUk9MRSApICAgCisgICAgICkKKyAgICB7ICAgICAgIAorICAgICAgICBwU3RhRHMgPSBkcGhMb29rdXBIYXNoRW50cnkocE1hYywgc21lRGlzYXNzb2NDbmYucGVlck1hY0FkZHIsICZhaWQsICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsKKyAgICAgICAgaWYgKHBTdGFEcyA9PSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJyZWNlaXZlZCBESVNBU1NPQ19DTkYgZm9yIGEgU1RBIHRoYXQgIgorICAgICAgICAgICAgICAgImRvZXMgbm90IGhhdmUgY29udGV4dCwgYWRkcj0gIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShzbWVEaXNhc3NvY0NuZi5wZWVyTWFjQWRkcikpOykKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICAvKgorICAgICAgICAgKiBJZiBNbE0gc3RhdGUgaXMgZWl0aGVyIG9mIGRlbF9zdGEgb3IgZGVsX2JzcyBzdGF0ZSwgdGhlbiBubyBuZWVkIHRvCisgICAgICAgICAqIGdvIGFoZWFkIGFuZCBjbGVhbiB1cCBmdXJ0aGVyIGFzIHRoZXJlIG11c3QgYmUgc29tZSBjbGVhbnVwIGluCisgICAgICAgICAqIHByb2dyZXNzIGZyb20gdXBwZXIgbGF5ZXIgZGlzYXNzb2MvZGVhdXRoIHJlcXVlc3QuCisgICAgICAgICAqLworICAgICAgICBpZigocFN0YURzLT5tbG1TdGFDb250ZXh0Lm1sbVN0YXRlID09IGVMSU1fTUxNX1dUX0RFTF9TVEFfUlNQX1NUQVRFKSB8fAorICAgICAgICAgICAocFN0YURzLT5tbG1TdGFDb250ZXh0Lm1sbVN0YXRlID09IGVMSU1fTUxNX1dUX0RFTF9CU1NfUlNQX1NUQVRFKSkKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJObyBuZWVkIHRvIGNsZWFudXAgZm9yIGFkZHI6Ik1BQ19BRERSRVNTX1NUUgorICAgICAgICAgICAgICAgICAgICJhcyBNbG0gc3RhdGUgaXMgJWQiKSwKKyAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShzbWVEaXNhc3NvY0NuZi5wZWVyTWFjQWRkciksCisgICAgICAgICAgICAgICAgICAgcFN0YURzLT5tbG1TdGFDb250ZXh0Lm1sbVN0YXRlKTsKKyAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgLyogRGVsZXRlIEZUIHNlc3Npb24gaWYgdGhlcmUgZXhpc3RzIG9uZSAqLworICAgICAgICBsaW1GVENsZWFudXAocE1hYyk7CisgICAgICAgIGxpbUNsZWFudXBSeFBhdGgocE1hYywg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9uRW50cnktPmxpbVNtZVN0YXRlKSk7CisKKyAgICAgICAgICAgICAgICAgICAgLy8gU2VuZCBEZWF1dGhlbnRpY2F0aW9uIHJlcXVlc3QgdG8gTUxNIGJlbG93CisKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBlTElNX1NNRV9XVF9ERUFVVEhfU1RBVEU6CisgICAgICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICAgICAqIFBFIFJlY2lldmVkIGEgRGVhdXRoIGZyYW1lLiBOb3JtYWxseSBpdCBnZXRzCisgICAgICAgICAgICAgICAgICAgICAqIERFQVVUSF9DTkYgYnV0IGl0IHJlY2VpdmVkIERFQVVUSF9SRVEuIFdoaWNoCisgICAgICAgICAgICAgICAgICAgICAqIG1lYW5zIGhvc3QgaXMgYWxzbyB0cnlpbmcgdG8gZGlzY29ubmVjdC4KKyAgICAgICAgICAgICAgICAgICAgICogUEUgY2FuIGNvbnRpbnVlIHByb2Nlc3NpbmcgREVBVVRIX1JFUSBhbmQgc2VuZAorICAgICAgICAgICAgICAgICAgICAgKiB0aGUgcmVzcG9uc2UgaW5zdGVhZCBvZiBmYWlsaW5nIHRoZSByZXF1ZXN0LgorICAgICAgICAgICAgICAgICAgICAgKiBTTUUgd2lsbCBhbnl3YXkgaWdub3JlIERFQVVUSF9JTkQgdGhhdCB3YXMgc2VudAorICAgICAgICAgICAgICAgICAgICAgKiBmb3IgZGVhdXRoIGZyYW1lLgorICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJSY3ZkIFNNRV9ERUFVVEhfUkVRIHdoaWxlIGluICIKKyAgICAgICAgICAgICAgICAgICAgICAgIlNNRV9XVF9ERUFVVEhfU1RBVEUuICIpKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBlTElNX1NNRV9XVF9ESVNBU1NPQ19TVEFURToKKyAgICAgICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICAgICAgKiBQRSBSZWNpZXZlZCBhIERpc2Fzc29jIGZyYW1lLiBOb3JtYWxseSBpdCBnZXRzCisgICAgICAgICAgICAgICAgICAgICAgKiBESVNBU1NPQ19DTkYgYnV0IGl0IHJlY2VpdmVkIERFQVVUSF9SRVEuIFRoaXMgbWVhbnMKKyAgICAgICAgICAgICAgICAgICAgICAqIGhvc3QgaXMgYWxzbyB0cnlpbmcgdG8gZGlzY29ubmVjdC4KKyAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiUmN2ZCBTTUVfREVBVVRIX1JFUSB3aGlsZSBpbiAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJTTUVfV1RfRElTQVNTT0NfU1RBVEUuICIpKTsKKyAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgICAgICogU1RBIGlzIG5vdCBpbiBhIHN0YXRlIHRvIGRlYXV0aGVudGljYXRlIHdpdGgKKyAgICAgICAgICAgICAgICAgICAgICogcGVlci4gTG9nIGVycm9yIGFuZCBzZW5kIHJlc3BvbnNlIHRvIGhvc3QuCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIHVuZXhwIFNNRV9ERUFVVEhfUkVRIGluIHN0YXRlICVkIiksCisgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgbGltUHJpbnRTbWVTdGF0ZShwTWFjLCBMT0dFLCBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKHBNYWMtPmxpbS5nTGltUnNwUmVxZCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1Sc3BSZXFkID0gZmFsc2U7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldENvZGUgICAgICAgPSBlU0lSX1NNRV9TVEFfTk9UX0FVVEhFTlRJQ0FURUQ7CisgICAgICAgICAgICAgICAgICAgICAgICBkZWF1dGhUcmlnZ2VyID0gZUxJTV9IT1NUX0RFQVVUSDsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgICAgICpoZXJlIHdlIHJlY2VpdmVkIGRlYXV0aCByZXF1ZXN0IGZyb20gQVAgc28gc21lIHN0YXRlIGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgIGVMSU1fU01FX1dUX0RFQVVUSF9TVEFURS5pZiB3ZSBoYXZlIElTU1VFRCBkZWxTdGEgdGhlbgorICAgICAgICAgICAgICAgICAgICAgICAgICBtbG0gc3RhdGUgc2hvdWxkIGJlIGVMSU1fTUxNX1dUX0RFTF9TVEFfUlNQX1NUQVRFIGFuZCBpZgorICAgICAgICAgICAgICAgICAgICAgICAgICB3ZSBnb3QgZGVsQlNTIHJzcCB0aGVuIG1sbSBzdGF0ZSBzaG91bGQgYmUgZUxJTV9NTE1fSURMRV9TVEFURQorICAgICAgICAgICAgICAgICAgICAgICAgICBzbyB0aGUgYmVsb3cgY29uZGl0aW9uIGNhcHR1cmVzIHRoZSBzdGF0ZSB3aGVyZSBkZWxTdGEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgbm90IGRvbmUgYW5kIGZpcm13YXJlIHN0aWxsIGluIGNvbm5lY3RlZCBzdGF0ZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAocHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUgPT0gZUxJTV9TTUVfV1RfREVBVVRIX1NUQVRFICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltTWxtU3RhdGUgIT0gZUxJTV9NTE1fSURMRV9TVEFURSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlICE9IGVMSU1fTUxNX1dUX0RFTF9TVEFfUlNQX1NUQVRFKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldENvZGUgPSBlU0lSX1NNRV9ERUFVVEhfU1RBVFVTOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZ290byBzZW5kRGVhdXRoOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVMSU1fU1RBX0lOX0lCU1NfUk9MRToKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLEZMKCJEZWF1dGggbm90IGFsbG93ZWQgaW4gSUJTUyIpKTsKKyAgICAgICAgICAgIGlmIChwTWFjLT5saW0uZ0xpbVJzcFJlcWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1Sc3BSZXFkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgcmV0Q29kZSA9IGVTSVJfU01FX0lOVkFMSURfUEFSQU1FVEVSUzsKKyAgICAgICAgICAgICAgICAgICBkZWF1dGhUcmlnZ2VyID0gZUxJTV9IT1NUX0RFQVVUSDsKKyAgICAgICAgICAgICAgICAgICBnb3RvIHNlbmREZWF1dGg7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm47CisKKyAgICAgICAgY2FzZSBlTElNX0FQX1JPTEU6CisgICAgICAgICAgICAvLyBGYWxsIHRocm91Z2gKKworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIHVuZXhwZWN0ZWQgU01FX0RFQVVUSF9SRVEgZm9yIHJvbGUgJWQiKSwKKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlKTsKKyAgICAgICAgICAgIGlmIChwTWFjLT5saW0uZ0xpbVJzcFJlcWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1Sc3BSZXFkID0gZmFsc2U7CisKKyAgICAgICAgICAgICAgICAgICByZXRDb2RlID0gZVNJUl9TTUVfSU5WQUxJRF9QQVJBTUVURVJTOworICAgICAgICAgICAgICAgICAgIGRlYXV0aFRyaWdnZXIgPSBlTElNX0hPU1RfREVBVVRIOworICAgICAgICAgICAgICAgICAgIGdvdG8gc2VuZERlYXV0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybjsKKworICAgIH0gLy8gZW5kIHN3aXRjaCAocE1hYy0+bGltLmdMaW1TeXN0ZW1Sb2xlKQorCisgICAgaWYgKHNtZURlYXV0aFJlcS5yZWFzb25Db2RlID09IGVMSU1fTElOS19NT05JVE9SSU5HX0RFQVVUSCkKKyAgICB7CisgICAgICAgIC8vLyBEZWF1dGhlbnRpY2F0aW9uIGlzIHRyaWdnZXJlZCBieSBMaW5rIE1vbml0b3JpbmcKKyAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICBGTCgiRGVhdXRoZW50aWNhdGlvbiBpcyB0cmlnZ2VyZWQgYnkgTGluayBNb25pdG9yaW5nIikpOworICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgIEZMKCJTZXQgVHJpZ2dlciB0byBlTElNX0xJTktfTU9OSVRPUklOR19ERUFVVEgiKSk7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgRkwoImFuZCBSZWFzb24gdG8gZVNJUl9NQUNfVU5TUEVDX0ZBSUxVUkVfUkVBU09OIikpOworICAgICAgICBkZWF1dGhUcmlnZ2VyID0gZUxJTV9MSU5LX01PTklUT1JJTkdfREVBVVRIOworICAgICAgICByZWFzb25Db2RlICAgID0gZVNJUl9NQUNfVU5TUEVDX0ZBSUxVUkVfUkVBU09OOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBkZWF1dGhUcmlnZ2VyID0gZUxJTV9IT1NUX0RFQVVUSDsKKyAgICAgICAgcmVhc29uQ29kZSAgICA9IHNtZURlYXV0aFJlcS5yZWFzb25Db2RlOworICAgIH0KKworICAgIC8vIFRyaWdnZXIgRGVhdXRoZW50aWNhdGlvbiBmcmFtZSB0byBwZWVyIE1BQyBlbnRpdHkKKyAgICBwTWxtRGVhdXRoUmVxID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRMaW1NbG1EZWF1dGhSZXEpKTsKKyAgICBpZiAoIE5VTEwgPT0gcE1sbURlYXV0aFJlcSApCisgICAgeworICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICBGTCgiY2FsbCB0byBBbGxvY2F0ZU1lbW9yeSBmYWlsZWQgZm9yIG1sbURlYXV0aFJlcSIpKTsKKyAgICAgICAgaWYgKHBNYWMtPmxpbS5nTGltUnNwUmVxZCkKKyAgICAgICAgeworICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1Sc3BSZXFkID0gZmFsc2U7CisgICAgICAgICAgICByZXRDb2RlID0gZVNJUl9TTUVfUkVTT1VSQ0VTX1VOQVZBSUxBQkxFOworICAgICAgICAgICAgZGVhdXRoVHJpZ2dlciA9IGVMSU1fSE9TVF9ERUFVVEg7CisgICAgICAgICAgICBnb3RvIHNlbmREZWF1dGg7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHZvc19tZW1fY29weSggKHRBTklfVTggKikgJnBNbG1EZWF1dGhSZXEtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgKHRBTklfVTggKikgJnNtZURlYXV0aFJlcS5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworCisgICAgcE1sbURlYXV0aFJlcS0+cmVhc29uQ29kZSA9IHJlYXNvbkNvZGU7CisgICAgcE1sbURlYXV0aFJlcS0+ZGVhdXRoVHJpZ2dlciA9IGRlYXV0aFRyaWdnZXI7CisKKyAgICAvKiBVcGRhdGUgUEUgc2Vzc2lvbiBJZCovCisgICAgcE1sbURlYXV0aFJlcS0+c2Vzc2lvbklkID0gc2Vzc2lvbklkOworCisgICAgbGltUG9zdE1sbU1lc3NhZ2UocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICBMSU1fTUxNX0RFQVVUSF9SRVEsCisgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTMyICopIHBNbG1EZWF1dGhSZXEpOworICAgIHJldHVybjsKKworc2VuZERlYXV0aDoKKyAgICBsaW1TZW5kU21lRGVhdXRoTnRmKHBNYWMsIHNtZURlYXV0aFJlcS5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldENvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICBkZWF1dGhUcmlnZ2VyLAorICAgICAgICAgICAgICAgICAgICAgICAgMSwgCisgICAgICAgICAgICAgICAgICAgICAgICBzbWVzZXNzaW9uSWQsIHNtZXRyYW5zYWN0aW9uSWQpOworfSAvKioqIGVuZCBfX2xpbVByb2Nlc3NTbWVEZWF1dGhSZXEoKSAqKiovCisKKworCisvKioKKyAqIF9fbGltUHJvY2Vzc1NtZVNldENvbnRleHRSZXEoKQorICoKKyAqRlVOQ1RJT046CisgKiBUaGlzIGZ1bm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XJpYWwubnVtS2V5cyk7KQorICAgICAgICBsaW1TZW5kU21lU2V0Q29udGV4dFJzcChwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2V0Q29udGV4dFJlcS0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfU01FX0lOVkFMSURfUEFSQU1FVEVSUyxOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbWVzZXNzaW9uSWQsc21ldHJhbnNhY3Rpb25JZCk7CisKKyAgICAgICAgZ290byBlbmQ7CisgICAgfQorCisKKyAgICBpZigocHNlc3Npb25FbnRyeSA9IHBlRmluZFNlc3Npb25CeUJzc2lkKHBNYWMsIHBTZXRDb250ZXh0UmVxLT5ic3NJZCwgJnNlc3Npb25JZCkpID09IE5VTEwpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgRkwoIlNlc3Npb24gZG9lcyBub3QgZXhpc3QgZm9yIGdpdmVuIEJTU0lEIikpOworICAgICAgICBsaW1TZW5kU21lU2V0Q29udGV4dFJzcChwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2V0Q29udGV4dFJlcS0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfU01FX0lOVkFMSURfUEFSQU1FVEVSUyxOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbWVzZXNzaW9uSWQsc21ldHJhbnNhY3Rpb25JZCk7CisKKyAgICAgICAgZ290byBlbmQ7CisgICAgfQorCisjaWZkZWYgRkVBVFVSRV9XTEFOX0RJQUdfU1VQUE9SVF9MSU0gLy9GRUFUVVJFX1dMQU5fRElBR19TVVBQT1JUIAorICAgIGxpbURpYWdFdmVudFJlcG9ydChwTWFj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vIGVuZDsKKyAgICAgICAgfQorICAgICAgICB2b3NfbWVtX3plcm8ocE1sbVNldEtleXNSZXEsc2l6ZW9mKHRMaW1NbG1TZXRLZXlzUmVxKSk7CisgICAgICAgIHBNbG1TZXRLZXlzUmVxLT5lZFR5cGUgID0gcFNldENvbnRleHRSZXEtPmtleU1hdGVyaWFsLmVkVHlwZTsKKyAgICAgICAgcE1sbVNldEtleXNSZXEtPm51bUtleXMgPSBwU2V0Q29udGV4dFJlcS0+a2V5TWF0ZXJpYWwubnVtS2V5czsKKyAgICAgICAgaWYocE1sbVNldEtleXNSZXEtPm51bUtleXMgPiBTSVJfTUFDX01BWF9OVU1fT0ZfREVGQVVMVF9LRVlTKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoIk51bSBvZiBrZXlzIGV4Y2VlZGVkIG1heCBudW0gb2YgZGVmYXVsdCBrZXlzIGxpbWl0IikpOworICAgICAgICAgICAgZ290byBlbmQ7CisgICAgICAgIH0KKyAgICAgICAgdm9zX21lbV9jb3B5KCAodEFOSV9VOCAqKSAmcE1sbVNldEtleXNSZXEtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopICZwU2V0Q29udGV4dFJlcS0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisKKworICAgICAgICB2b3NfbWVtX2NvcHkoICh0QU5JX1U4ICopICZwTWxtU2V0S2V5c1JlcS0+a2V5LAorICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopICZwU2V0Q29udGV4dFJlcS0+a2V5TWF0ZXJpYWwua2V5LAorICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyS2V5cykgKiAocE1sbVNldEtleXNSZXEtPm51bUtleXMgPyBwTWxtU2V0S2V5c1JlcS0+bnVtS2V5cyA6IDEpKTsKKworICAgICAgICBwTWxtU2V0S2V5c1JlcS0+c2Vzc2lvbklkID0gc2Vzc2lvbklkOworI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSX0RFQlVHCisgICAgICAgIFBFTE9HMShsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgRkwoInJlY2VpdmVkIFNFVENPTlRFWFRfUkVRIG1lc3NhZ2Ugc2Vzc2lvbklkPSVkIiksIHBNbG1TZXRLZXlzUmVxLT5zZXNzaW9uSWQpOyk7CisjZW5kaWYKKworICAgICAgICBpZigoKHBTZXRDb250ZXh0UmVxLT5rZXlNYXRlcmlhbC5lZFR5cGUgPT0gZVNJUl9FRF9XRVA0MCkgfHwgKHBTZXRDb250ZXh0UmVxLT5rZXlNYXRlcmlhbC5lZFR5cGUgPT0gZVNJUl9FRF9XRVAxMDQpKQorICAgICAgICAmJiAocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0FQX1JPTEUpKQorICAgICAgICB7CisgICAgICAgICAgICBpZihwU2V0Q29udGV4dFJlcS0+a2V5TWF0ZXJpYWwua2V5WzBdLmtleUxlbmd0aCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB0QU5JX1U4IGtleUlkOworICAgICAgICAgICAgICAgIGtleUlkID0gcFNldENvbnRleHRSZXEtPmtleU1hdGVyaWFsLmtleVswXS5rZXlJZDsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoICh0QU5JX1U4ICopJnBzZXNzaW9uRW50cnktPldFUEtleU1hdGVyaWFsW2tleUlkXSwKKyAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSAmcFNldENvbnRleHRSZXEtPmtleU1hdGVyaWFsLCBzaXplb2YodFNpcktleU1hdGVyaWFsKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICB0QU5JX1UzMiBpOworICAgICAgICAgICAgICAgIGZvciggaSA9IDA7IGkgPCBTSVJfTUFDX01BWF9OVU1fT0ZfREVGQVVMVF9LRVlTOyBpKyspCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoICh0QU5JX1U4ICopICZwTWxtU2V0S2V5c1JlcS0+a2V5W2ldLAorICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTggKilwc2Vzc2lvbkVudHJ5LT5XRVBLZXlNYXRlcmlhbFtpXS5rZXksIHNpemVvZih0U2lyS2V5cykpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGxpbVBvc3RNbG1NZXNzYWdlKHBNYWMsIExJTV9NTE1fU0VUS0VZU19SRVEsICh0QU5JX1UzMiAqKSBwTWxtU2V0S2V5c1JlcSk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICBGTCgicmVjZWl2ZWQgdW5leHBlY3RlZCBTTUVfU0VUQ09OVEVYVF9SRVEgZm9yIHJvbGUgJWQsIHN0YXRlPSVkIiksCisgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUsCisgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlKTsKKyAgICAgICAgbGltUHJpbnRTbWVTdGF0ZShwTWFjLCBMT0dFLCBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSk7CisKKyAgICAgICAgbGltU2VuZFNtZVNldENvbnRleHRSc3AocE1hYywgcFNldENvbnRleHRSZXEtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX1NNRV9VTkVYUEVDVEVEX1JFUV9SRVNVTFRfQ09ERSxwc2Vzc2lvbkVudHJ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbWVzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtZXRyYW5zYWN0aW9uSWQpOworICAgIH0KKworZW5kOgorICAgIHZvc19tZW1femVybyhwU2V0Q29udGV4dFJlcSwKKyAgICAgICAgICAgICAgICAgIChzaXplb2YodFNpcktleXMpICogU0lSX01BQ19NQVhfTlVNX09GX0RFRkFVTFRfS0VZUykpOworICAgIHZvc19tZW1fZnJlZSggcFNldENvbnRleHRSZXEpOworICAgIHJldHVybjsKK30gLyoqKiBlbmQgX19saW1Qcm9jZXNzU21lU2V0Q29udGV4dFJlcSgpICoqKi8KKworLyoqCisgKiBfX2xpbVByb2Nlc3NTbWVSZW1vdmVLZXlSZXEoKQorICoKKyAqRlVOQ1RJT046CisgKiBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCB0byBwcm9jZXNzIFNNRV9SRU1PVkVLRVlfUkVRIG1lc3NhZ2UKKyAqIGZyb20gSEREIG9yIHVwcGVyIGxheWVyIGFwcGxpY2F0aW9uLgorICoKKyAqTE9HSUM6CisgKgorICpBU1NVTVBUSU9OUzoKKyAqCisgKk5PVEU6CisgKgorICogQHBhcmFtICBwTWFjICAgICAgUG9pbnRlciB0byBHbG9iYWwgTUFDIHN0cnVjdHVyZQorICogQHBhcmFtICAqcE1zZ0J1ZiAgQSBwb2ludGVyIHRvIHRoZSBTTUUgbWVzc2FnZSBidWZmZXIKKyAqIEByZXR1cm4gTm9uZQorICovCisKK3N0YXRpYyB2b2lkCitfX2xpbVByb2Nlc3NTbWVSZW1vdmVLZXlSZXEodHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMzIgKnBNc2dCdWYpCit7CisgICAgdHBTaXJTbWVSZW1vdmVLZXlSZXEgICAgcFJlbW92ZUtleVJlcTsKKyAgICB0TGltTWxtUmVtb3ZlS2V5UmVxICAgICAqcE1sbVJlbW92ZUtleVJlcTsKKyAgICB0cFBFU2Vzc2lvbiAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgIHNlc3Npb25JZDsgIC8vUEUgc2Vzc2lvbklECisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgc21lc2Vzc2lvbklkOyAgCisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgc21ldHJhbnNhY3Rpb25JZDsKKworICAgIGxpbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICBGTCgicmVjZWl2ZWQgU01FX1JFTU9WRUtFWV9SRVEgbWVzc2FnZSIpKTsKKworICAgIGlmKHBNc2dCdWYgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLEZMKCJCdWZmZXIgaXMgUG9pbnRpbmcgdG8gTlVMTCIpKTsKKyAgICAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIAorICAgIGxpbUdldFNlc3Npb25JbmZvKHBNYWMsKHRBTklfVTggKilwTXNnQnVmLCZzbWVzZXNzaW9uSWQsJnNtZXRyYW5zYWN0aW9uSWQpOworCisgICAgcFJlbW92ZUtleVJlcSA9IHZvc19tZW1fbWFsbG9jKHNpemVvZigqcFJlbW92ZUtleVJlcSkpOworICAgIGlmICggTlVMTCA9PSBwUmVtb3ZlS2V5UmVxICkKKyAgICB7CisgICAgICAgIC8vTG9nIGVycm9yCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgRkwoImNhbGwgdG8gQWxsb2NhdGVNZW1vcnkgZmFpbGVkIGZvciBwUmVtb3ZlS2V5UmVxIikpOworCisgICAgICAgIHJldHVybjsKKyAgICAgfQorCisgICAgaWYgKChsaW1SZW1vdmVLZXlSZXFTZXJEZXMocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJlbW92ZUtleVJlcSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTggKikgcE1zZ0J1ZikgPT0gZVNJUl9GQUlMVVJFKSkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIGludmFsaWQgU01FX1JFTU9WRUNPTlRFWFRfUkVRIG1lc3NhZ2UiKSk7CisKKyAgICAgICAgLyogZXh0cmEgbG9vayB1cCBpcyBuZWVkZWQgc2luY2UsIHNlc3Npb24gZW50cnkgdG8gYmUgcGFzc2VkIGlsIGxpbXNlbmRyZW1vdmVrZXkgcmVzcG9uc2UgKi8KKworICAgICAgICBpZigocHNlc3Npb25FbnRyeSA9IHBlRmluZFNlc3Npb25CeUJzc2lkKHBNYWMscFJlbW92ZUtleVJlcS0+YnNzSWQsJnNlc3Npb25JZCkpPT0gTlVMTCkKKyAgICAgICAgeyAgICAgCisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSxGTCgic2Vzc2lvbiBkb2VzIG5vdCBleGlzdCBmb3IgZ2l2ZW4gYnNzSWQiKSk7CisgICAgICAgICAgICAvL2dvdG8gZW5kOworICAgICAgICB9CisKKyAgICAgICAgbGltU2VuZFNtZVJlbW92ZUtleVJzcChwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUmVtb3ZlS2V5UmVxLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9TTUVfSU5WQUxJRF9QQVJBTUVURVJTLHBzZXNzaW9uRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtZXNlc3Npb25JZCxzbWV0cmFuc2FjdGlvbklkKTsKKworICAgICAgICBnb3RvIGVuZDsKKyAgICB9CisKKyAgICBpZigocHNlc3Npb25FbnRyeSA9IHBlRmluZFNlc3Npb25CeUJzc2lkKHBNYWMscFJlbW92ZUtleVJlcS0+YnNzSWQsICZzZXNzaW9uSWQpKT09IE5VTEwpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICBGTCgic2Vzc2lvbiBkb2VzIG5v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G1SZW1vdmVLZXlSZXEpKTsKKyAgICAgICAgaWYgKCBOVUxMID09IHBNbG1SZW1vdmVLZXlSZXEgKQorICAgICAgICB7CisgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgIEZMKCJjYWxsIHRvIEFsbG9jYXRlTWVtb3J5IGZhaWxlZCBmb3IgbWxtUmVtb3ZlS2V5c1JlcSIpKTsKKworICAgICAgICAgICAgZ290byBlbmQ7CisgICAgICAgIH0KKworICAgICAgICBwTWxtUmVtb3ZlS2V5UmVxLT5lZFR5cGUgID0gKHRBbmlFZFR5cGUpcFJlbW92ZUtleVJlcS0+ZWRUeXBlOyAKKyAgICAgICAgcE1sbVJlbW92ZUtleVJlcS0+a2V5SWQgPSBwUmVtb3ZlS2V5UmVxLT5rZXlJZDsKKyAgICAgICAgcE1sbVJlbW92ZUtleVJlcS0+d2VwVHlwZSA9IHBSZW1vdmVLZXlSZXEtPndlcFR5cGU7CisgICAgICAgIHBNbG1SZW1vdmVLZXlSZXEtPnVuaWNhc3QgPSBwUmVtb3ZlS2V5UmVxLT51bmljYXN0OworICAgICAgICAKKyAgICAgICAgLyogVXBkYXRlIFBFIHNlc3Npb24gSWQgKi8KKyAgICAgICAgcE1sbVJlbW92ZUtleVJlcS0+c2Vzc2lvbklkID0gc2Vzc2lvbklkOworCisgICAgICAgIHZvc19tZW1fY29weSggKHRBTklfVTggKikgJnBNbG1SZW1vdmVLZXlSZXEtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopICZwUmVtb3ZlS2V5UmVxLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKworCisgICAgICAgIGxpbVBvc3RNbG1NZXNzYWdlKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgIExJTV9NTE1fUkVNT1ZFS0VZX1JFUSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTMyICopIHBNbG1SZW1vdmVLZXlSZXEpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgRkwoInJlY2VpdmVkIHVuZXhwZWN0ZWQgU01FX1JFTU9WRUtFWV9SRVEgZm9yIHJvbGUgJWQsIHN0YXRlPSVkIiksCisgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUsCisgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlKTsKKyAgICAgICAgbGltUHJpbnRTbWVTdGF0ZShwTWFjLCBMT0dFLCBwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSk7CisKKyAgICAgICAgbGltU2VuZFNtZVJlbW92ZUtleVJzcChwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUmVtb3ZlS2V5UmVxLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9TTUVfVU5FWFBFQ1RFRF9SRVFfUkVTVUxUX0NPREUscHNlc3Npb25FbnRyeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21lc2Vzc2lvbklkLHNtZXRyYW5zYWN0aW9uSWQpOworICAgIH0KKworZW5kOgorICAgIHZvc19tZW1fZnJlZSggcFJlbW92ZUtleVJlcSk7Cit9IC8qKiogZW5kIF9fbGltUHJvY2Vzc1NtZVJlbW92ZUtleVJlcSgpICoqKi8KKwordm9pZCBsaW1Qcm9jZXNzU21lR2V0U2NhbkNoYW5uZWxJbmZvKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTMyICpwTXNnQnVmKQoreworICAgIHRTaXJNc2dRICAgICAgICAgbW1oTXNnOworICAgIHRwU21lR2V0U2NhbkNoblJzcCAgcFNpclNtZVJzcDsKKyAgICB0QU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pbS5nTGltUnNwUmVxZCA9IGZhbHNlOworICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RYX1NNRV9NU0csIE5PX1NFU1NJT04sIG1taE1zZy50eXBlKSk7CisgICAgbGltU3lzUHJvY2Vzc01taE1zZ0FwaShwTWFjLCAmbW1oTXNnLCAgZVBST1QpOworfQorCisKK3ZvaWQgbGltUHJvY2Vzc1NtZUdldEFzc29jU1RBc0luZm8odHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMzIgKnBNc2dCdWYpCit7CisgICAgdFNpclNtZUdldEFzc29jU1RBc1JlcSAgZ2V0QXNzb2NTVEFzUmVxOworICAgIHRwRHBoSGFzaE5vZGUgICAgICAgICAgIHBTdGFEcyA9IE5VTEw7CisgICAgdHBQRVNlc3Npb24gICAgICAgICAgICAgcHNlc3Npb25FbnRyeSA9IE5VTEw7CisgICAgdFNhcF9FdmVudCAgICAgICAgICAgICAgc2FwRXZlbnQ7CisgICAgdHBXTEFOX1NBUEV2ZW50Q0IgICAgICAgcFNhcEV2ZW50Q2FsbGJhY2sgPSBOVUxMOworICAgIHRwU2FwX0Fzc29jTWFjQWRkciAgICAgIHBBc3NvY1N0YXNUZW1wID0gTlVMTDsvLyAjaW5jbHVkZSAic2FwQXBpLmgiCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgc2Vzc2lvbklkID0gQ1NSX1NFU1NJT05fSURfSU5WQUxJRDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICBhc3NvY0lkID0gMDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICBzdGFDb3VudCA9IDA7CisKKyAgICBpZiAoIWxpbUlzU21lR2V0QXNzb2NTVEFzUmVxVmFsaWQocE1hYywgJmdldEFzc29jU1RBc1JlcSwgKHRBTklfVTggKikgcE1zZ0J1ZikpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBpbnZhbGlkIGVXTklfU01FX0dFVF9BU1NPQ19TVEFTX1JFUSBtZXNzYWdlIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgc3dpdGNoIChnZXRBc3NvY1NUQXNSZXEubW9kSWQpCisgICAgeworLyoqICAgICAgICAKKyAgICAgICAgY2FzZSBWT1NfTU9EVUxFX0lEX0hBTDoKKyAgICAgICAgICAgIHdkYVBvc3RDdHJsTXNnKCBwTWFjLCAmbXNnUSApOworICAgICAgICAgICAgcmV0dXJuOworCisgICAgICAgIGNhc2UgVk9TX01PRFVMRV9JRF9UTDoKKyAgICAgICAgICAgIFBvc3QgbXNnIFRMCisgICAgICAgICAgICByZXR1cm47CisqLworICAgICAgICBjYXNlIFZPU19NT0RVTEVfSURfUEU6CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICAvLyBHZXQgQXNzb2NpYXRlZCBzdGF0aW9ucyBmcm9tIFBFCisgICAgLy8gRmluZCBQRSBzZXNzaW9uIEVudHJ5CisgICAgaWYgKChwc2Vzc2lvbkVudHJ5ID0gcGVGaW5kU2Vzc2lvbkJ5QnNzaWQocE1hYywgZ2V0QXNzb2NTVEFzUmVxLmJzc0lkLCAmc2Vzc2lvbklkKSkgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgRkwoInNlc3Npb24gZG9lcyBub3QgZXhpc3QgZm9yIGdpdmVuIGJzc0lkIikpOworICAgICAgICBnb3RvIGxpbUFzc29jU3RhRW5kOworICAgIH0KKworICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlICE9IGVMSU1fQVBfUk9MRSkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgRkwoIlJlY2VpdmVkIHVuZXhwZWN0ZWQg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AgICAgc2l6ZW9mKHZfTUFDQUREUl90KSk7ICAvLyBNYWMgYWRkcmVzcworICAgICAgICAgICAgcEFzc29jU3Rhc1RlbXAtPmFzc29jSWQgPSAodl9VOF90KXBTdGFEcy0+YXNzb2NJZDsgICAgICAgICAvLyBBc3NvY2lhdGlvbiBJZAorICAgICAgICAgICAgcEFzc29jU3Rhc1RlbXAtPnN0YUlkICAgPSAodl9VOF90KXBTdGFEcy0+c3RhSW5kZXg7ICAgICAgICAvLyBTdGF0aW9uIElkCisKKyAgICAgICAgICAgIHZvc19tZW1fY29weSgodEFOSV9VOCAqKSZwQXNzb2NTdGFzVGVtcC0+c3VwcG9ydGVkUmF0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopJnBTdGFEcy0+c3VwcG9ydGVkUmF0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyU3VwcG9ydGVkUmF0ZXMpKTsKKyAgICAgICAgICAgIHBBc3NvY1N0YXNUZW1wLT5TaG9ydEdJNDBNaHogPSBwU3RhRHMtPmh0U2hvcnRHSTQwTWh6OworICAgICAgICAgICAgcEFzc29jU3Rhc1RlbXAtPlNob3J0R0kyME1oeiA9IHBTdGFEcy0+aHRTaG9ydEdJMjBNaHo7CisgICAgICAgICAgICBwQXNzb2NTdGFzVGVtcC0+U3VwcG9ydDQwTWh6ID0gcFN0YURzLT5odERzc3NDY2tSYXRlNDBNSHpTdXBwb3J0OworCisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoImRwaCBTdGF0aW9uIE51bWJlciA9ICVkIiksIHN0YUNvdW50KzEpOworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJNQUMgPSAiIE1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocFN0YURzLT5zdGFBZG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bGltUHJvY2Vzc1RraXBDb3VudGVyTWVhc3VyZXModHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMzIgKnBNc2dCdWYpCit7CisgICAgdFNpclNtZVRraXBDbnRyTWVhc1JlcSAgdGtpcENudHJNZWFzUmVxOworICAgIHRwUEVTZXNzaW9uICAgICAgICAgICAgIHBzZXNzaW9uRW50cnk7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgc2Vzc2lvbklkOyAgICAgIC8vUEUgc2Vzc2lvbklkCisKKyAgICBpZiAoIGxpbVRraXBDbnRyTWVhc1JlcVNlckRlcyggcE1hYywgJnRraXBDbnRyTWVhc1JlcSwgKHRBTklfVTggKikgcE1zZ0J1ZiApICE9IGVTSVJfU1VDQ0VTUyApCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJyZWNlaXZlZCBpbnZhbGlkIGVXTklfU01FX1RLSVBfQ05UUl9NRUFTX1JFUSBtZXNzYWdlIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaWYgKCBOVUxMID09IChwc2Vzc2lvbkVudHJ5ID0gcGVGaW5kU2Vzc2lvbkJ5QnNzaWQoIHBNYWMsIHRraXBDbnRyTWVhc1JlcS5ic3NJZCwgJnNlc3Npb25JZCApKSApCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoInNlc3Npb24gZG9lcyBub3QgZXhpc3QgZm9yIGdpdmVuIEJTU0lEICIpKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmICggdGtpcENudHJNZWFzUmVxLmJFbmFibGUgKQorICAgIHsKKyAgICAgICAgX19saW1Db3VudGVyTWVhc3VyZXMoIHBNYWMsIHBzZXNzaW9uRW50cnkgKTsKKyAgICB9CisKKyAgICBwc2Vzc2lvbkVudHJ5LT5iVGtpcENudHJNZWFzQWN0aXZlID0gdGtpcENudHJNZWFzUmVxLmJFbmFib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ludmFsaWQgbWVzc2FnZSAlWCBkdWUgdG8gbm8gU1RBIGNvbnRleHQsICIKKyAgICAgICAgICAgICAgICJmb3IgYWlkICVkLCBwZWVyICIpLAorICAgICAgICAgICAgICAgbXNnVHlwZSwgYXNzb2NDbmYuYWlkKTsKKyAgICAgICAgbGltUHJpbnRNYWNBZGRyKHBNYWMsIGFzc29jQ25mLnBlZXJNYWNBZGRyLCBMT0cxKTsgICAgIAorCisgICAgICAgIC8qCisgICAgICAgICoqIHNlbmQgYSBESVNBU1NPQ19JTkQgbWVzc2FnZSB0byBXU00gdG8gbWFrZSBzdXJlCisgICAgICAgICoqIHRoZSBzdGF0ZSBpbiBXU00gYW5kIExJTSBpcyB0aGUgc2FtZQorICAgICAgICAqKi8KKyAgICAgICBsaW1TZW5kU21lRGlzYXNzb2NOdGYoIHBNYWMsIGFzc29jQ25mLnBlZXJNYWNBZGRyLCBlU0lSX1NNRV9TVEFfTk9UX0FTU09DSUFURUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlTElNX1BFRVJfRU5USVRZX0RJU0FTU09DLCBhc3NvY0NuZi5haWQscHNlc3Npb25FbnRyeS0+c21lU2Vzc2lvbklkLHBzZXNzaW9uRW50cnktPnRyYW5zYWN0aW9uSWQscHNlc3Npb25FbnRyeSk7CisgICAgICAgZ290byBlbmQ7CisgICAgfQorICAgIGlmICgocFN0YURzICYmCisgICAgICAgICAoKCAhdm9zX21lbV9jb21wYXJlKCAodEFOSV9VOCAqKSBwU3RhRHMtPnN0YUFkZHIsCisgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSBhc3NvY0NuZi5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpICkgfHwKKyAgICAgICAgICAocFN0YURzLT5tbG1TdGFDb250ZXh0Lm1sbVN0YXRlICE9IGVMSU1fTUxNX1dUX0FTU09DX0NORl9TVEFURSkgfHwKKyAgICAgICAgICAoKHBTdGF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nRyeTsKKyAgICB0QU5JX1U4ICAgICBzZXNzaW9uSWQ7CisKKyAgICAKKyAgICBpZihwTXNnQnVmID09IE5VTEwpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSxGTCgiQnVmZmVyIGlzIFBvaW50aW5nIHRvIE5VTEwiKSk7CisgICAgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgCisgICAgcFN0YXRzUmVxID0gKHRwQW5pR2V0U3RhdHNSZXEpIHBNc2dCdWY7CisgICAgCisgICAgaWYoKHBzZXNzaW9uRW50cnkgPSBwZUZpbmRTZXNzaW9uQnlCc3NpZChwTWFjLHBTdGF0c1JlcS0+YnNzSWQsJnNlc3Npb25JZCkpPT0gTlVMTCkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgic2Vzc2lvbiBkb2VzIG5vdCBleGlzdCBmb3IgZ2l2ZW4gYnNzSWQiKSk7CisgICAgICAgIHZvc19tZW1fZnJlZSggcE1zZ0J1ZiApOworICAgICAgICBwTXNnQnVmID0gTlVMTDsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgICAgIAorICAgIAorICAgIHN3aXRjaChwU3RhdHNSZXEtPm1zZ1R5cGUpCisgICAgeworICAgICAgICAvL0FkZCBMaW0gc3RhdHMgaGVyZS4gYW5kIHNlbmQgcmVxc3BvbnNlLgorCisgICAgICAgIC8vSEFMIG1haW50YWluZWQgU3RhdHMuCisgICAgICAgIGNhc2UgZVdOSV9TTUVfU1RBX1NUQVRfUkVROgorICAgICAgICAgICAgbXNnUS50eXBlID0gV0RBX1NUQV9TVEFUX1JFUTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVXTklfU01FX0FHR1JfU1RBVF9SRVE6CisgICAgICAgICAgICBtc2dRLnR5cGUgPSBXREFfQUdHUl9TVEFUX1JFUTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVXTklfU01FX0dMT0JBTF9TVEFUX1JFUToKKyAgICAgICAgICAgIG1zZ1EudHlwZSA9IFdEQV9HTE9CQUxfU1RBVF9SRVE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9TVEFUX1NVTU1fUkVROgorICAgICAgICAgICAgbXNnUS50eXBlID0gV0RBX1NUQVRfU1VNTV9SRVE7CisgICAgICAgICAgICBicmVhazsgICAKKyAgICAgICAgZGVmYXVsdDogLy9Vbmtub3duIHJlcXVlc3QuCisgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsICJVbmtub3duIFN0YXRpc3RpY3MgcmVxdWVzdCIpOykKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZSggcE1zZ0J1ZiApOworICAgICAgICAgICAgcE1zZ0J1ZiA9IE5VTEw7CisgICAgICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgbXNnUS5yZXNlcnZlZCA9IDA7CisgICAgbXNnUS5ib2R5cHRyID0gcE1zZ0J1ZjsKKyAgICBtc2dRLmJvZHl2YWwgPSAwOworICAgIGlmKE5VTEwgPT0gcHNlc3Npb25FbnRyeSkKKyAgICB7CisgICAgICAgIE1UUkFDRShtYWNUcmFjZU1zZ1R4KHBNYWMsIE5PX1NFU1NJT04sIG1zZ1EudHlwZSkpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBNVFJBQ0UobWFjVHJhY2VNc2dUeChwTWFjLCBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwgbXNnUS50eXBlKSk7CisgICAgfQorICAgIGlmKCBlU0lSX1NVQ0NFU1MgIT0gKHdkYVBvc3RDdHJsTXNnKCBwTWFjLCAmbXNnUSApKSl7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCAiVW5hYmxlIHRvIGZvcndhcmQgcmVxdWVzdCIpOworICAgICAgICB2b3NfbWVtX2ZyZWUoIHBNc2dCdWYgKTsKKyAgICAgICAgcE1zZ0J1ZiA9IE5VTEw7CisgICAgIC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9ET1VCTEVfQ0hBTk5FTF9ISUdIX1BSSU1BUlk7CisgICAgICAgIHBzZXNzaW9uRW50cnktPmh0UmVjb21tZW5kZWRUeFdpZHRoU2V0ID0gMTsKKyAgICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsRkwoIkludmFsaWQgY2JNb2RlIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgbGltTG9nKHBNYWMsIExPR1csIEZMKCJDaGFubmVsIEJvbmRpbmcgbW9kZSA6ICVkIgorICAgICAgICAgICAgICAgICAgICAgICAgICAiIGh0U2Vjb25kYXJ5Q2hhbm5lbE9mZnNldDogJWQiCisgICAgICAgICAgICAgICAgICAgICAgICAgICIgaHRSZWNvbW1lbmRlZFR4V2lkdGhTZXQgOiVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBTZXRIVDIwNDBNb2RlLT5jYk1vZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmh0U2Vjb25kYXJ5Q2hhbm5lbE9mZnNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+aHRSZWNvbW1lbmRlZFR4V2lkdGhTZXQpOworCisgICAgbGltTG9nKHBNYWMsIExPR1csIEZMKCJVcGRhdGUgQmVhY29uIElFcyIpKTsKKworICAgIC8qIFVwZGF0ZSBiZWFjb24gKi8KKyAgICBzY2hTZXRGaXhlZEJlYWNvbkZpZWxkcyhwTWFjLCBwc2Vzc2lvbkVudHJ5KTsKKyAgICBsaW1TZW5kQmVhY29uSW5kKHBNYWMsIHBzZXNzaW9uRW50cnkpOworCisgICAgLyogVXBkYXRlIE9QIE1vZGUgKi8KKyAgICBwSHRPcE1vZGUgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodFVwZGF0ZVZIVE9wTW9kZSkpOworICAgIGlmICggTlVMTCA9PSBwSHRPcE1vZGUgKQorICAgIHsKKyAgIC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lvbiAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgaWYgKHBMaW1NZ210UmVnaXN0cmF0aW9uLT5mcmFtZVR5cGUgPT0gcFNtZVJlcS0+ZnJhbWVUeXBlKQorICAgICAgICB7CisgICAgICAgICAgICBpZihwU21lUmVxLT5tYXRjaExlbikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAocExpbU1nbXRSZWdpc3RyYXRpb24tPm1hdGNoTGVuID09IHBTbWVSZXEtPm1hdGNoTGVuKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHZvc19tZW1fY29tcGFyZSggcExpbU1nbXRSZWdpc3RyYXRpb24tPm1hdGNoRGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNtZVJlcS0+bWF0Y2hEYXRhLCBwTGltTWdtdFJlZ2lzdHJhdGlvbi0+bWF0Y2hMZW4pKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvKiBmb3VuZCBtYXRjaCEgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIG1hdGNoID0gVk9TX1RSVUU7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBmb3VuZCBtYXRjaCEgKi8KKyAgICAgICAgICAgICAgICBtYXRjaCA9IFZPU19UUlVFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHZvc1N0YXR1cyA9IHZvc19saXN0X3BlZWtfbmV4dCAoCisgICAgICAgICAgICAgICAgJnBNYWMtPmxpbS5nTGltTWdtdEZyYW1lUmVnaXN0cmF0aW5RdWV1ZSwKKyAgICAgICAgICAgICAgICAodm9zX2xpc3Rfbm9kZV90KikgcExpbU1nbXRSZWdpc3RyYXRpb24sCisgICAgICAgICAgICAgICAgKHZvc19saXN0X25vZGVfdCoqKSAmcE5leHQgKTsKKworICAgICAgICBwTGltTWdtdFJlZ2lzdHJhdGlvbiA9IHBOZXh0OworICAgICAgICBwTmV4dCA9IE5VTEw7IAorCisgICAgfQorCisgICAgaWYgKG1hdGNoKQorICAgIHsKKyAgICAgICAgdm9zX2xpc3RfcmVtb3ZlX25vZGUoJnBNYWMtPmxpbS5nTGltTWdtdEZyYW1lUmVnaXN0cmF0aW5RdWV1ZSwKKyAgICAgICAgICAgICAgICAodm9zX2xpc3Rfbm9kZV90KilwTGltTWdtdFJlZ2lzdHJhdGlvbik7CisgICAgICAgIHZvc19tZW1fZnJlZShwTGltTWdtdFJlZ2lzdHJhdGlvbik7CisgICAgfQorCisgICAgaWYocFNtZVJlcS0+cmVnaXN0ZXJGcmFtZSkKKyAgICB7CisgICAgICAgIHBMaW1NZ210UmVnaXN0cmF0aW9uID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRMaW1NZ210RnJhbWVSZWdpc3RyYXRpb24pICsgcFNtZVJlcS0+bWF0Y2hMZW4pOworICAgICAgICBpZiAoIHBMaW1NZ210UmVnaXN0cmF0aW9uICE9IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fc2V0KCh2b2lkKilwTGltTWdtdFJlZ2lzdHJhdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodExpbU1nbXRGcmFtZVJlZ2lzdHJhdGlvbikgKyBwU21lUmVxLT5tYXRjaExlbiwgMCApOworICAgICAgICAgICAgcExpbU1nbXRSZWdpc3RyYXRpb24tPmZyYW1lVHlwZSA9IHBTbWVSZXEtPmZyYW1lVHlwZTsKKyAgICAgICAgICAgIHBMaW1NZ210UmVnaXN0cmF0aW9uLT5tYXRjaExlbiAgPSBwU21lUmVxLT5tYXRjaExlbjsKKyAgICAgICAgICAgIHBMaW1NZ210UmVnaXN0cmF0aW9uLT5zZXNzaW9uSWQgPSBwU21lUmVxLT5zZXNzaW9uSWQ7CisgICAgICAgICAgICBpZihwU21lUmVxLT5tYXRjaExlbikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocExpbU1nbXRSZWdpc3RyYXRpb24tPm1hdGNoRGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNtZVJlcS0+bWF0Y2hEYXRhLCBwU21lUmVxLT5tYXRjaExlbik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB2b3NfbGlzdF9pbnNlcnRfZnJvbnQoJnBNYWMtPmxpbS5nTGltTWdtdEZyYW1lUmVnaXN0cmF0aW5RdWV1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwTGltTWdtdFJlZ2lzdHJhdGlvbi0+bm9kZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm47Cit9IC8qKiogZW5kIF9fbGltUHJvY2Vzc1NtZVJlZ2lzdGVyTWdtdEZyYW1lUmVxKCkgKioqLworCitzdGF0aWMgdEFOSV9CT09MRUFOCitfX2xpbUluc2VydFNpbmdsZVNob3ROT0FGb3JTY2FuKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTMyIG5vYUR1cmF0aW9uKQoreworICAgIHRwUDJwUHNQYXJhbXMgcE1zZ05vQTsKKyAgICB0U2lyTXNnUSBtc2c7CisKKyAgICBwTXNnTm9BID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKCB0UDJwUHNDb25maWcgKSk7CisgICAgaWYgKCBOVUxMID09IHBNc2dOb0EgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgICAgRkwoICJVbmFibGUgdG8gYWxsb2NhdGUgbWVtb3J5IGR1cmluZyBOb0EgVXBkYXRlIiApKTsKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICB9CisKK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ggKG1zZ1R5cGUpCisgICAgeworICAgICAgICBjYXNlIGVXTklfU01FX1NDQU5fUkVROgorICAgICAgICB7CisgICAgICAgICAgICB0QU5JX1UzMiB2YWw7CisgICAgICAgICAgICB0QU5JX1U4IGk7CisgICAgICAgICAgICB0cFNpclNtZVNjYW5SZXEgcFNjYW5SZXEgPSAodHBTaXJTbWVTY2FuUmVxKSBwTXNnQnVmOworICAgICAgICAgICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfUEFTU0lWRV9NQVhJTVVNX0NIQU5ORUxfVElNRSwgJnZhbCkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICogQ291bGQgbm90IGdldCBtYXggY2hhbm5lbCB2YWx1ZQorICAgICAgICAgICAgICAgICAqIGZyb20gQ0ZHLiBMb2cgZXJyb3IuCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgcGFzc2l2ZSBtYXggY2hhbm5lbCB2YWx1ZSIpKTsKKworICAgICAgICAgICAgICAgIC8qIHVzZSBhIGRlZmF1bHQgdmFsdWUgb2YgMTEwbXMgKi8KKyAgICAgICAgICAgICAgICB2YWwgPSBERUZBVUxUX1BBU1NJVkVfTUFYX0NIQU5ORUxfVElNRTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHBTY2FuUmVxLT5jaGFubmVsTGlzdC5udW1DaGFubmVsczsgaSsrKSB7CisgICAgICAgICAgICAgICAgdEFOSV9VOCBjaGFubmVsTnVtID0gcFNjYW5SZXEtPmNoYW5uZWxMaXN0LmNoYW5uZWxOdW1iZXJbaV07CisKKyAgICAgICAgICAgICAgICBpZiAocE1hYy0+bWlyYWNhc3RfbW9kZSkgeworICAgICAgICAgICAgICAgICAgICBub2FEdXJhdGlvbiArPSBERUZBVUxUX01JTl9DSEFOX1RJTUVfRFVSSU5HX01JUkFDQVNUICsKKyAgICAgICAgICAgICAgICAgICAgICAgIERFRkFVTFRfTUFYX0NIQU5fVElNRV9EVVJJTkdfTUlSQUNBU1Q7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpc1Bhc3NpdmVTY2FuIHx8ICFsaW1BY3RpdmVTY2FuQWxsb3dlZChwTWFjLCBjaGFubmVsTnVtKSkgeworICAgICAgICAgICAgICAgICAgICAvKiB1c2luZyB0aGUgdmFsdWUgZnJvbSBXTklfQ0ZHX1BBU1NJVkVfTUlOSU1VTV9DSEFOTkVMX1RJTUUgYXMgaXMgZG9uZSBpbgorICAgICAgICAgICAgICAgICAgICAgKiB2b2lkIGxpbUNvbnRpbnVlUG9zdENoYW5uZWxTY2FuKHRwQW5pU2lyR2xvYmFsIHBNYWMpCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBub2FEdXJhdGlvbiArPSB2YWw7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgLyogVXNlIG1pbiArIG1heCBjaGFubmVsIHRpbWUgdG8gY2FsY3VsYXRlIHRoZSB0b3RhbCBkdXJhdGlvbiBvZiBzY2FuICovCisgICAgICAgICAgICAgICAgICAgIG5vYUR1cmF0aW9uICs9IHBTY2FuUmVxLT5taW5DaGFubmVsVGltZSArIHBTY2FuUmVxLT5tYXhDaGFubmVsVGltZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qIEFkZGluZyBhbiBvdmVyaGVhZCBvZiAyMG1zIHRvIGFjY291bnQgZm9yIHRoZSBzY2FuIG1lc3NhZ2luZyBkZWxheXMgKi8KKyAgICAgICAgICAgIG5vYUR1cmF0aW9uICs9IFNDQU5fTUVTU0FHSU5HX09WRVJIRUFEOworICAgICAgICAgICAgbm9hRHVyYXRpb24gKj0gQ09OVl9NU19UT19VUzsKKworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIGVXTklfU01FX09FTV9EQVRBX1JFUToKKyAgICAgICAgICAgIG5vYUR1cmF0aW9uID0gT0VNX0RBVEFfTk9BX0RVUkFUSU9OKkNPTlZfTVNfVE9fVVM7IC8vIHVzZSA2MCBtc2VjIGFzIGRlZmF1bHQKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVdOSV9TTUVfUkVNQUlOX09OX0NIQU5ORUxfUkVROgorICAgICAgICB7CisgICAgICAgICAgICB0U2lyUmVtYWluT25DaG5SZXEgKnBSZW1haW5PbkNoblJlcSA9ICh0U2lyUmVtYWluT25DaG5SZXEgKikgcE1zZ0J1ZjsKKyAgICAgICAgICAgIG5vYUR1cmF0aW9uID0gKHBSZW1haW5PbkNoblJlcS0+ZHVyYXRpb24pKkNPTlZfTVNfVE9fVVM7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgZVdOSV9TTUVfSk9JTl9SRVE6CisgICAgICAgICAgICBub2FEdXJhdGlvbiA9IEpPSU5fTk9BX0RVUkFUSU9OKkNPTlZfTVNfVE9fVVM7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgbm9hRHVyYXRpb24gPSAwOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICB9CisgICAgbGltTG9nKHBNYWMsIExPR1csIEZMKCJtc2dUeXBlICVkIG5vYSAlZCIpLCBtc2dUeXBlLCBub2FEdXJhdGlvbik7CisgICAgcmV0dXJuIG5vYUR1cmF0aW9uOworfQorCit2b2lkIGxpbVByb2Nlc3NSZWdkRGVmZFNtZVJlcUFmdGVyTk9BU3RhcnQodHBBbmlTaXJHbG9iYWwgcE1hYykKK3sKKyAgICB0QU5JX0JPT0xFQU4gYnVmQ29uc3VtZWQgPSBUUlVFOworCisgICAgbGltTG9nKHBNYWMsIExPRzEsIE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ICAgICAgICAqLworICAgICAgICAgICAgICAgIGlmIChGQUxTRSA9PSBidWZDb25zdW1lZCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5ncERlZmRTbWVNc2dGb3JOT0EgPSBOVUxMOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZVdOSV9TTUVfSk9JTl9SRVE6CisgICAgICAgICAgICAgICAgX19saW1Qcm9jZXNzU21lSm9pblJlcShwTWFjLCBwTWFjLT5saW0uZ3BEZWZkU21lTXNnRm9yTk9BKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJVbmtub3duIGRlZmVycmVkIG1zZyB0eXBlICVkIiksIHBNYWMtPmxpbS5nRGVmZXJNc2dUeXBlRm9yTk9BKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBfX2xpbURlcmVnaXN0ZXJEZWZlcnJlZFNtZVJlcUFmdGVyTk9BU3RhcnQocE1hYyk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HVywgRkwoInN0YXJ0IHJlY2VpdmVkIGZyb20gRlcgd2hlbiBubyBzbWUgZGVmZXJyZWQgbXNnIHBlbmRpbmcuIERvIG5vdGhpbmcuIgorICAgICAgICAgICAgIkl0IG1pZ2h0IGhhcHBlbiBzb21ldGltZSB3aGVuIE5PQSBzdGFydCBpbmQgYW5kIHRpbWVvdXQgaGFwcGVuIGF0IHRoZSBzYW1lIHRpbWUiKSk7CisgICAgfQorfQorCitzdGF0aWMgdm9pZAorX19saW1Qcm9jZXNzU21lUmVzZXRBcENhcHNDaGFuZ2UodHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMzIgKnBNc2dCdWYpCit7Cis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IHByb2Nlc3NlZCBsYXRlciB3aGVuCisgICAgICogc3RhcnQgZXZlbnQgaGFwcGVucworICAgICAqLworICAgIHN3aXRjaCAocE1zZy0+dHlwZSkKKyAgICB7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfU0NBTl9SRVE6CisgICAgICAgIHBTY2FuUmVxID0gKHRwU2lyU21lU2NhblJlcSkgcE1zZ0J1ZjsKKyAgICAgICAgaXNQYXNzaXZlU2NhbiA9IChwU2NhblJlcS0+c2NhblR5cGUgPT0gZVNJUl9QQVNTSVZFX1NDQU4pID8gVFJVRSA6IEZBTFNFOworICAgICAgICBjYXNlIGVXTklfU01FX1JFTUFJTl9PTl9DSEFOTkVMX1JFUToKKworICAgICAgICAgICAgLyogSWYgc2NhbiBpcyBkaXNhYmxlZCByZXR1cm4gZnJvbSBoZXJlCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmIChwTWFjLT5saW0uZlNjYW5EaXNhYmxlZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAocE1zZy0+dHlwZSA9PSBlV05JX1NNRV9TQ0FOX1JFUSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgbGltU2VuZFNtZVNjYW5Sc3AocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXRvZih0U2lyU21lU2NhblJzcCxic3NEZXNjcmlwdGlvblswXSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9TTUVfSU5WQUxJRF9QQVJBTUVURVJTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuUmVxLT5zZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjYW5SZXEtPnRyYW5zYWN0aW9uSWQpOworCisgICAgICAgICAgICAgICAgICAgYnVmQ29uc3VtZWQgPSBUUlVFOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmIChwTXNnLT50eXBlID09IGVXTklfU01FX1JFTUFJTl9PTl9DSEFOTkVMX1JFUSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5ncERlZmRTbWVNc2dGb3JOT0EgPSBOVUxMOworICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ3BMaW1SZW1haW5PbkNoYW5SZXEgPSAodHBTaXJSZW1haW5PbkNoblJlcSApcE1zZ0J1ZjsKKyAgICAgICAgICAgICAgICAgICAgbGltUmVtYWluT25DaG5Sc3AocE1hYyxlSEFMX1NUQVRVU19GQUlMVVJFLCBOVUxMKTsKKworICAgICAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAgICAgKiBsaW1SZW1haW5PbkNoblJzcCB3aWxsIGZyZWUgdGhlIGJ1ZmZlciB0aGlzIGNoYW5nZSBpcyB0bworICAgICAgICAgICAgICAgICAgICAgKiBhdm9pZCAiZG91YmxlIGZyZWUiCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBidWZDb25zdW1lZCA9IEZBTFNFOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICBGTCgiRXJyb3I6IFNjYW4gRGlzYWJsZWQuIgorICAgICAgICAgICAgICAgICAgICAgICAgICAiIFJldHVybiB3aXRoIGVycm9yIHN0YXR1cyBmb3IgU01FIE1lc3NhZ2UgJXMoJWQpIiksCisgICAgICAgICAgICAgICAgICAgICAgIGxpbU1zZ1N0cihwTXNnLT50eXBlKSwgcE1zZy0+dHlwZSk7CisKKyAgICAgICAgICAgICAgICByZXR1cm4gYnVmQ29uc3VtZWQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogRG8gbm90IGFkZCBCUkVBSyBoZXJlCisgICAgICAgICAgICAgKi8K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bVByb2Nlc3NTbWVTdGFydFJlcShwTWFjLCBwTXNnQnVmKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVdOSV9TTUVfU1lTX1JFQURZX0lORDoKKyAgICAgICAgICAgIGJ1ZkNvbnN1bWVkID0gX19saW1Qcm9jZXNzU21lU3lzUmVhZHlJbmQocE1hYywgcE1zZ0J1Zik7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVXTklfU01FX1NUQVJUX0JTU19SRVE6CisgICAgICAgICAgICBidWZDb25zdW1lZCA9IF9fbGltUHJvY2Vzc1NtZVN0YXJ0QnNzUmVxKHBNYWMsIHBNc2cpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlV05JX1NNRV9TQ0FOX1JFUToKKyAgICAgICAgICAgIF9fbGltUHJvY2Vzc1NtZVNjYW5SZXEocE1hYywgcE1zZ0J1Zik7CisgICAgICAgICAgICBicmVhazsKKworI2lmZGVmIEZFQVRVUkVfT0VNX0RBVEFfU1VQUE9SVAorICAgICAgICBjYXNlIGVXTklfU01FX09FTV9EQVRBX1JFUToKKyAgICAgICAgICAgIF9fbGltUHJvY2Vzc1NtZU9lbURhdGFSZXEocE1hYywgcE1zZ0J1Zik7CisgICAgICAgICAgICBicmVhazsKKyNlbmRpZgorICAgICAgICBjYXNlIGVXTklfU01FX1JFTUFJTl9PTl9DSEFOTkVMX1JFUToKKyAgICAgICAgICAgIGJ1ZkNvbnN1bWVkID0gbGltUHJvY2Vzc1JlbWFpbk9uQ2hubFJlcShwTWFjLCBwTXNnQnVmKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVdOSV9TTUVfVVBEQVRFX05PQToKKyAgICAgICAgICAgIF9fbGltUHJvY2Vzc1NtZU5vQVVwZGF0ZShwTWFjLCBwTXNnQnVmKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVXTklfU01FX0NMRUFSX0RGU19DSEFOTkVMX0xJU1Q6CisgICAgICAgICAgICBfX2xpbVByb2Nlc3NDbGVhckRmc0NoYW5uZWxMaXN0KHBNYWMsIHBNc2cpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfSk9JTl9SRVE6CisgICAgICAgICAgICBfX2xpbVByb2Nlc3NTbWVKb2luUmVxKHBNYWMsIHBNc2dCdWYpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlV05JX1NNRV9BVVRIX1JFUToKKyAgICAgICAgICAgLy8gX19saW1Qcm9jZXNzU21lQXV0aFJlcShwTWFjLCBwTXNnQnVmKTsKKworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlV05JX1NNRV9SRUFTU09DX1JFUToKKyAgICAgICAgICAgIF9fbGltUHJvY2Vzc1NtZVJlYXNzb2NSZXEocE1hYywgcE1zZ0J1Zik7CisKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVdOSV9TTUVfUFJPTUlTQ1VPVVNfTU9ERV9SRVE6CisgICAgICAgICAgICAvL19fbGltUHJvY2Vzc1NtZVByb21pc2N1b3VzUmVxKHBNYWMsIHBNc2dCdWYpOworCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVXTklfU01FX0RJU0FTU09DX1JFUToKKyAgICAgICAgICAgIF9fbGltUHJvY2Vzc1NtZURpc2Fzc29jUmVxKHBNYWMsIHBNc2dCdWYpOworCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVXTklfU01FX0RJU0FTU09DX0NORjoKKyAgICAgICAgY2FzZSBlV05JX1NNRV9ERUFVVEhfQ05GOgorICAgICAgICAgICAgX19saW1Qcm9jZXNzU21lRGlzYXNzb2NDbmYocE1hYywgcE1zZ0J1Zik7CisKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVdOSV9TTUVfREVBVVRIX1JFUToKKyAgICAgICAgICAgIF9fbGltUHJvY2Vzc1NtZURlYXV0aFJlcShwTWFjLCBwTXNnQnVmKTsKKworICAgICAgICAgICAgYnJlYWs7CisKKworCisgICAgICAgIGNhc2UgZVdOSV9TTUVfU0VUQ09OVEVYVF9SRVE6CisgICAgICAgICAgICBfX2xpbVByb2Nlc3NTbWVTZXRDb250ZXh0UmVxKHBNYWMsIHBNc2dCdWYpOworCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVXTklfU01FX1JFTU9WRUtFWV9SRVE6CisgICAgICAgICAgICBfX2xpbVByb2Nlc3NTbWVSZW1vdmVLZXlSZXEocE1hYywgcE1zZ0J1Zik7CisKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVdOSV9TTUVfU1RPUF9CU1NfUkVROgorICAgICAgICAgICAgYnVmQ29uc3VtZWQgPSBfX2xpbVByb2Nlc3NTbWVTdG9wQnNzUmVxKHBNYWMsIHBNc2cpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlV05JX1NNRV9BU1NPQ19DTkY6CisgICAgICAgIGNhc2UgZVdOSV9TTUVfUkVBU1NPQ19DTkY6CisgICAgICAgICAgICBpZiAocE1zZy0+dHlwZSA9PSBlV05JX1NNRV9BU1NPQ19DTkYpCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJSZWNlaXZlZCBBU1NPQ19DTkYgbWVzc2FnZSIpKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlJlY2VpdmVkIFJFQVNTT0NfQ05GIG1lc3NhZ2UiKSk7CisgICAgICAgICAgICBfX2xpbVByb2Nlc3NTbWVBc3NvY0NuZk5ldyhwTWFjLCBwTXNnLT50eXBlLCBwTXNnQnVmKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVdOSV9TTUVfQUREVFNfUkVROgorICAgICAgIC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gICBidWZDb25zdW1lZCA9IEZBTFNFOworICAgICAgICAgICAgYnJlYWs7CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0VTRSAmJiBGRUFUVVJFX1dMQU5fRVNFX1VQTE9BRCAqLworICAgICAgICBjYXNlIGVXTklfU01FX0RFTF9CQV9QRUVSX0lORDoKKyAgICAgICAgICAgIGxpbVByb2Nlc3NTbWVEZWxCYVBlZXJJbmQocE1hYywgcE1zZ0J1Zik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9HRVRfU0NBTk5FRF9DSEFOTkVMX1JFUToKKyAgICAgICAgICAgIGxpbVByb2Nlc3NTbWVHZXRTY2FuQ2hhbm5lbEluZm8ocE1hYywgcE1zZ0J1Zik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9HRVRfQVNTT0NfU1RBU19SRVE6CisgICAgICAgICAgICBsaW1Qcm9jZXNzU21lR2V0QXNzb2NTVEFzSW5mbyhwTWFjLCBwTXNnQnVmKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVXTklfU01FX1RLSVBfQ05UUl9NRUFTX1JFUToKKyAgICAgICAgICAgIGxpbVByb2Nlc3NUa2lwQ291bnRlck1lYXN1cmVzKHBNYWMsIHBNc2dCdWYpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICBjYXNlIGVXTklfU01FX0hJREVfU1NJRF9SRVE6IAorICAgICAgICAgICAgX19saW1Qcm9jZXNzU21lSGlkZVNTSUQocE1hYywgcE1zZ0J1Zik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICBjYXNlIGVXTklfU01FX1VQREFURV9BUFdQU0lFX1JFUTogCisgICAgICAgICAgICBfX2xpbVByb2Nlc3NTbWVVcGRhdGVBUFdQU0lFcyhwTWFjLCBwTXNnQnVmKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVXTklfU01FX0dFVF9XUFNQQ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VJfTUdNVF9GUkFNRV9SRVE6CisgICAgICAgICAgICBfX2xpbVByb2Nlc3NTbWVSZWdpc3Rlck1nbXRGcmFtZVJlcSggcE1hYywgcE1zZ0J1ZiApOworICAgICAgICAgICAgYnJlYWs7CisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICAgICAgY2FzZSBlV05JX1NNRV9URExTX1NFTkRfTUdNVF9SRVE6CisgICAgICAgICAgICBsaW1Qcm9jZXNzU21lVGRsc01nbXRTZW5kUmVxKHBNYWMsIHBNc2dCdWYpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfVERMU19BRERfU1RBX1JFUToKKyAgICAgICAgICAgIGxpbVByb2Nlc3NTbWVUZGxzQWRkU3RhUmVxKHBNYWMsIHBNc2dCdWYpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfVERMU19ERUxfU1RBX1JFUToKKyAgICAgICAgICAgIGxpbVByb2Nlc3NTbWVUZGxzRGVsU3RhUmVxKHBNYWMsIHBNc2dCdWYpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfVERMU19MSU5LX0VTVEFCTElTSF9SRVE6CisgICAgICAgICAgICBsaW1Qcm9jZXNTbWVUZGxzTGlua0VzdGFibGlzaFJlcShwTWFjLCBwTXNnQnVmKTsKKyAgICAgICAgICAgIGJyZWFrOworLy8gdGRsc29mZmNoYW4KKyAgICAgICAgY2FzZSBlV05JX1NNRV9URExTX0NIQU5ORUxfU1dJVENIX1JFUToKKyAgICAgICAgICAgIGxpbVByb2Nlc1NtZVRkbHNDaGFuU3dpdGNoUmVxKHBNYWMsIHBNc2dCdWYpOworICAgICAgICAgICAgYnJlYWs7CisjZW5kaWYKKyAgICAgICAgY2FzZSBlV05JX1NNRV9SRVNFVF9BUF9DQVBTX0NIQU5HRUQ6CisgICAgICAgICAgICBfX2xpbVByb2Nlc3NTbWVSZXNldEF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QU4gQUNUSU9OIE9GIENPTlRSQUNULCBORUdMSUdFTkNFIE9SIE9USEVSCisgKiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SCisgKiBQRVJGT1JNQU5DRSBPRiBUSElTIFNPRlRXQVJFLgorICovCisKKy8qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgbGltUHJvY2Vzc1RkbHMuYyAKKworICBPVkVSVklFVzoKKworICBERVBFTkRFTkNJRVM6CisKKyAgQXJlIGxpc3RlZCBmb3IgZWFjaCBBUEkgYmVsb3cuCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisgICAkSGVhZGV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AgICAgICAgICAgIHREb3QxMWZJRUxpbmtJZGVudGlmaWVyICpsaW5rSWRlbiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNBZGRyIHBlZXJNYWMsIHRBTklfVTggcmVxVHlwZSkgOwordm9pZCBQb3B1bGF0ZURvdDExZlRkbHNFeHRDYXBhYmlsaXR5KHRwQW5pU2lyR2xvYmFsIHBNYWMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFRXh0Q2FwICpleHRDYXBhYmlsaXR5KSA7CisKK3ZvaWQgUG9wdWxhdGVEb3QxMWZUZGxzT2ZmY2hhbm5lbFBhcmFtcyh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnksCisgICAgICAgICAgdERvdDExZklFU3VwcENoYW5uZWxzICpzdXBwQ2hhbm5lbHMsCisgICAgICAgICAgdERvdDExZklFU3VwcE9wZXJhdGluZ0NsYXNzZXMgKnN1cHBPcGVyQ2xhc3Nlcyk7CisKK3ZvaWQgbGltTG9nVkhUQ2FwKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVWSFRDYXBzICpwRG90MTFmKTsKK3RTaXJSZXRTdGF0dXMgbGltUG9wdWxhdGVWaHRNY3NTZXQodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFNpclN1cHBvcnRlZFJhdGVzIHBSYXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVWSFRDYXBzICpwUGVlclZIVENhcHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSk7CitlUGh5Q2hhbkJvbmRTdGF0ZSAgbGltR2V0SFRDQlN0YXRlKGVQaHlDaGFuQm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AgICBURExTX1BFRVJfV01NX0NBUCA9IDIKK30gZVRkbHNQZWVyQ2FwYWJpbGl0eTsKKworLyogc29tZSBsb2NhbCBkZWZpbmVzICovCisjZGVmaW5lIExJTktfSURFTl9CU1NJRF9PRkZTRVQgICAgICAoMCkKKyNkZWZpbmUgUEVFUl9NQUNfT0ZGU0VUICAgKDEyKSAKKyNkZWZpbmUgU1RBX01BQ19PRkZTRVQgICAgKDYpCisjZGVmaW5lIExJTktfSURFTl9FTEVfSUQgICgxMDEpCisvLyNkZWZpbmUgTElOS19JREVOX0xFTkdUSCAgICgxOCkgCisjZGVmaW5lIExJTktfSURFTl9BRERSX09GRlNFVCh4KSAoJnguTGlua0lkZW50aWZpZXIpCisjZGVmaW5lIFBUSV9MSU5LX0lERU5fT0ZGU0VUICAgICAoNSkKKyNkZWZpbmUgUFRJX0JVRl9TVEFUVVNfT0ZGU0VUICAgICgyNSkKKworLyogVE9ETywgTW92ZSB0aGlzIHBhcmFtZXRlcnMgdG8gY29uZmlndXJhdGlvbiAqLworI2RlZmluZSBQRUVSX1BTTV9TVVBQT1JUICAgICAgICAgICgwKQorI2RlZmluZSBQRUVSX0JVRkZFUl9TVEFfU1VQUE9SVCAgICgwKQorI2RlZmluZSBDSF9TV0lUQ0hfU1VQUE9SVCAgICAgICAgICgwKQorI2RlZmluZSBURExTX1NVUFBPUlQgICAgICAgICAgICAgICgxKQorI2RlZmluZSBURExTX1BST0hJQklURUQgICAgICAgICAgICgwKQorI2RlZmluZSBURExTX0NIX1NXSVRDSF9QUk9ISUJJVEVEICgxKQorLyoqIEBicmllZiBTZXQgYml0IG1hbmlwdWxhdGlvbiBtYWNybyAqLworI2RlZmluZSBTRVRfQklUKHZhbHVlLG1hc2spICAgICAgICgodmFsdWUpIHw9ICgxIDw8IChtYXNrKSkpCisvKiogQGJyaWVmIENsZWFyIGJpdCBtYW5pcHVsYXRpb24gbWFjcm8gKi8KKyNkZWZpbmUgQ0xFQVJfQklUKHZhbHVlLG1hc2spICAgICAoKHZhbHVlKSAmPSB+KDEgPDwgKG1hc2spKSkKKy8qKiBAYnJpZWYgQ2hlY2sgYml0IG1hbmlwdWxhdGlvbiBtYWNybyAqLworI2RlZmluZSBDSEVDS19CSVQodmFsdWUsIG1hc2spICAgICgodmFsdWUpICYgKDEgPDwgKG1hc2spKSkKKworI2RlZmluZSBTRVRfUEVFUl9BSURfQklUTUFQKHBlZXJfYml0bWFwLCBhaWQpIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhaWQpIDwgKHNpemVvZih0QU5JX1UzMikgPDwgMykpIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTRVRfQklUKHBlZXJfYml0bWFwWzBdLCAoYWlkKSk7IFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoKGFpZCkgPCAoc2l6ZW9mKHRBTklfVTMyKSA8PCA0KSkgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNFVF9CSVQocGVlcl9iaXRtYXBbMV0sICgoYWlkKSAtIChzaXplb2YodEFOSV9VMzIpIDw8IDMpKSk7CisKKyNkZWZpbmUgQ0xFQVJfUEVFUl9BSURfQklUTUFQKHBlZXJfYml0bWFwLCBhaWQpIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhaWQpIDwgKHNpemVvZih0QU5JX1UzMikgPDwgMykpIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDTEVBUl9CSVQocGVlcl9iaXRtYXBbMF0sIChhaWQpKTsgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICgoYWlkKSA8IChzaXplb2YodEFOSV9VMzIpIDw8IDQpKSBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0xFQVJfQklUKHBlZXJfYml0bWFwWzFdLCAoKGFpZCkgLSAoc2l6ZW9mKHRBTklfVTMyKSA8PCAzKSkpOworCisKKyNpZmRlZiBMSU1fREVCVUdfVERMUworCisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyNkZWZpbmUgV05JX0NGR19URExTX0RJU0NPVkVSWV9SU1BfV0FJVCAgICAgICAgICAgICAoMTAwKQorI2RlZmluZSBXTklfQ0ZHX1RETFNfTElOS19TRVRVUF9SU1BfVElNRU9VVCAgICAgICAgICg4MDApCisjZGVmaW5lIFdOSV9DRkdfVERMU19MSU5LX1NFVFVQX0NORl9USU1FT1VUICAgICAgICAgKDIwMCkKKyNlbmRpZgorCisjZGVmaW5lIElTX1FPU19FTkFCTEVEKHBzZXNzaW9uRW50cnkpICgoKChwc2Vzc2lvbkVudHJ5KS0+bGltUW9zRW5hYmxlZCkgJiYgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX0dFVF9RT1MoKHBzZXNzaW9uRW50cnkpLT5saW1DdXJyZW50QnNzQ2FwcykpIHx8IFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKHBzZXNzaW9uRW50cnkpLT5saW1XbWVFbmFibGVkICkgJiYgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMSU1fQlNTX0NBUFNfR0VUKFdNRSwgKHBzZXNzaW9uRW50cnkpLT5saW1DdXJyZW50QnNzUW9zQ2FwcykpKQorCisjZGVmaW5lIFRJRF9BQ19WSSAgICAgICAgICAgICAgICAgIDQKKyNkZWZpbmUgVElEX0FDX0JLICAgICAgICAgICAgICAgICAgMQorCitjb25zdCB0QU5JX1U4KiBsaW1UcmFjZVRkbHNBY3Rpb25TdHJpbmcoIHRBTklfVTggdGRsc0FjdGlvbkNvZGUgKQoreworICAgc3dpdGNoKCB0ZGxzQWN0aW9uQ29kZSApCisgICB7CisgICAgICAgQ0FTRV9SRVRVUk5fU1RSSU5HKFNJUl9NQUNfVERMU19TRVRVUF9SRVEpOworICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhTSVJfTUFDX1RETFNfU0VUVVBfUlNQKTsKKyAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoU0lSX01BQ19URExTX1NFVFVQX0NORik7CisgICAgICAgQ0FTRV9SRVRVUk5fU1RSSU5HKFNJUl9NQUNfVERMU19URUFSRE9XTik7CisgICAgICAgQ0FTRV9SRVRVUk5fU1RSSU5HKFNJUl9NQUNfVERMU19QRUVSX1RSQUZGSUNfSU5EKTsKKyAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoU0lSX01BQ19URExTX0NIX1NXSVRDSF9SRVEpOworICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhTSVJfTUFDX1RETFNfQ0hfU1dJVENIX1JTUCk7CisgICAgICAgQ0FTRV9SRVRVUk5fU1RSSU5HKFNJUl9NQUNfVERMU19QRUVSX1RSQUZGSUNfUlNQKTsKKyAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoU0lSX01BQ19URExTX0RJU19SRVEpOworICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhTSVJfTUFDX1RETFNfRElTX1JTUCk7CisgICB9CisgICByZXR1cm4gKGNvbnN0IHRBTklfVTgqKSJVTktOT1dOIjsKK30KKyNlbmRpZgorI2lmIDAKK3N0YXRpYyB2b2lkIHByaW50TWFjQWRkcih0U2lyTWFjQWRkciBtYWNBZGRyKQoreworICAgIGludCBpID0gMCA7CisgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfUEUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgKCIgTWFjIEFkZHI6ICIpKTsKKworICAgIGZvcihpID0gMCA7IGkgPCA2OyBpKyspCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9QRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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WMgKyBzaXplb2YodFNpck1hY0FkZHIpKSA7CisjZW5kaWYgICAgCisgICAgdEFOSV9VOCB0b0RzID0gIEFOSV9UWERJUl9JQlNTICA7CisKKyAgICBwTWFjSGRyID0gKHRwU2lyTWFjTWdtdEhkcikgKHBGcmFtZSk7CisKKyAgICAvKgorICAgICAqIHByZXBhcmUgODAyLjExIGhlYWRlcgorICAgICAqLyAKKyAgICBwTWFjSGRyLT5mYy5wcm90VmVyID0gU0lSX01BQ19QUk9UT0NPTF9WRVJTSU9OOworICAgIHBNYWNIZHItPmZjLnR5cGUgICAgPSB0eXBlIDsKKyAgICBwTWFjSGRyLT5mYy5zdWJUeXBlID0gc3ViVHlwZSA7CisgICAgLyoKKyAgICAgKiBUTCBpcyBub3Qgc2V0dGluZyB1cCBiZWxvdyBmaWVsZHMsIHNvIHdlIGFyZSBkb2luZyBpdCBoZXJlCisgICAgICovCisgICAgcE1hY0hkci0+ZmMudG9EUyAgICA9IHRvRHMgOworICAgIHBNYWNIZHItPmZjLnBvd2VyTWdtdCA9IDAgOworCisgICAgIAorICAgIHZvc19tZW1fY29weSggKHRBTklfVTggKikgcE1hY0hkci0+ZGEsIHBlZXJNYWMsIHNpemVvZiggdFNpck1hY0FkZHIgKSk7CisgICAgdm9zX21lbV9jb3B5KCAodEFOSV9VOCAqKSBwTWFjSGRyLT5zYSwKKyAgICAgICAgICAgICAgICAgICBzdGFNYWMsIHNpemVvZiggdFNpck1hY0FkZHIgKSk7CisKKyAgICB2b3NfbWVtX2NvcHkoICh0QU5JX1U4ICopIHBNYWNIZHItPmJzc0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBic3NpZCwgc2l6ZW9mKCB0U2lyTWFjQWRkciApKTsKKyAgIAorICAgTElNX0xPR19URExTKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1BFLCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwgKCJQcmVwYXJpbmcgVERMUyBhY3Rpb24gZnJhbWVcbiUwMng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VHlwZSwKKyAgICAgICAgICAgdEFOSV9VOCB0aWQsIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpCit7CisgICAgdHBTaXJNYWNEYXRhSGRyM2EgcE1hY0hkciA7CisgICAgdEFOSV9VMzIgaGVhZGVyX29mZnNldCA9IDAgOworICAgIHRBTklfVTggKmFkZHIxID0gTlVMTCA7CisgICAgdEFOSV9VOCAqYWRkcjMgPSBOVUxMIDsKKyAgICB0cERwaEhhc2hOb2RlIHBTdGFEcyA9IE5VTEw7CisgICAgdEFOSV9VMTYgICAgICBhaWQgPSAwOworICAgIHRBTklfVTggICAgICAgcW9zTW9kZSA9IDA7CisKKyAgICB0QU5JX1U4IHRvRHMgPSAodGRsc0xpbmtUeXBlID09IFRETFNfTElOS19BUCkgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IEFOSV9UWERJUl9UT0RTIDpBTklfVFhESVJfSUJTUyAgOworICAgIHRBTklfVTggKnBlZXJNYWMgPSAocmVxVHlwZSA9PSBURExTX0lOSVRJQVRPUikgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGxpbmtfaWRlbi0+UmVzcFN0YUFkZHIgOiBsaW5rX2lkZW4tPkluaXRTdGFBZGRyOyAKKyAgICB0QU5JX1U4ICpzdGFNYWMgPSAocmVxVHlwZSA9PSBURExTX0lOSVRJQVRPUikgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGxpbmtfaWRlbi0+SW5pdFN0YUFkZHIgOiBsaW5rX2lkZW4tPlJlc3BTdGFBZGRyOyAKKyAgICBwTWFjSGRyID0gKHRwU2lyTWFjRGF0YUhkcjNhKSAocEZyYW1lKTsKKworICAgIC8qIAorICAgICAqIGlmIFRETFMgZnJhbWUgZ29lcyB0aHJvdWdoIHRoZSBBUCBsaW5rLCBpdCBmb2xsb3dzIG5vcm1hbCBhZGRyZXNzCisgICAgICogcGF0dGVybiwgaWYgVERMUyBmcmFtZSBnb2VzIHRob3J1Z2ggdGhlIGRpcmVjdCBsaW5rLCB0aGVuCisgICAgICogQTEtLT4gUGVlciBTVEEgYWRkciwgQTItLT5TZWxmIFNUQSBhZGRyZXNzLCBBMy0tPiBCU1NJRAorICAgICAqLworICAgICh0ZGxzTGlua1R5cGUgPT0gVERMU19MSU5LX0FQKSA/ICgoYWRkcjEgPSAobGlua19pZGVuLT5ic3NpZCkpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYWRkcjMgPSAocGVlck1hYykpKSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoKGFkZHIxID0gKHBlZXJNYWMpKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYWRkcjMgPSAobGlua19pZGVuLT5ic3NpZCkpKSA7CisgICAgLyoKKyAgICAgKiBwcmVwYXJlIDgwMi4xMSBoZWFkZXIKKyAgICAgKi8gCisgICAgcE1hY0hkci0+ZmMucHJvdFZlciA9IFNJUl9NQUNfUFJPVE9DT0xfVkVSU0lPTjsKKyAgICBwTWFjSGRyLT5mYy50eXBlICAgID0gU0lSX01BQ19EQVRBX0ZSQU1FIDsKKworICAgIHBTdGFEcyA9IGRwaExvb2t1cEhhc2hFbnRyeShwTWFjLCBwZWVyTWFjLCAmYWlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsKKyAgICBpZiAocFN0YURzKQorICAgIHsKKyAgICAgICAgcW9zTW9kZSA9IHBTdGFEcy0+cW9zTW9kZTsKKyAgICB9CisKKyAgICBwTWFjSGRyLT5mYy5zdWJUeXBlID0gKChJU19RT1NfRU5BQkxFRChwc2Vzc2lvbkVudHJ5KSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRkbHNMaW5rVHlwZSA9PSBURExTX0xJTktfQVApKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh0ZGxzTGlua1R5cGUgPT0gVERMU19MSU5LX0RJUkVDVCkgJiYgcW9zTW9kZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFNJUl9NQUNfREFUQV9RT1NfREFUQSA6IFNJUl9NQUNfREFUQV9EQVRBOworCisgICAgLyoKKyAgICAgKiBUTCBpcyBub3Qgc2V0dGluZyB1cCBiZWxvdyBmaWVsZHMsIHNvIHdlIGFyZSBkb2luZyBpdCBoZXJlCisgICAgICovCisgICAgcE1hY0hkci0+ZmMudG9EUyAgICA9IHRvRHMgOworICAgIHBNYWNIZHItPmZjLnBvd2VyTWdtdCA9IDAgOworICAgIHBNYWNIZHItPmZjLndlcCA9IChwc2Vzc2lvbkVudHJ5LT5lbmNyeXB0VHlwZSA9PSBlU0lSX0VEX05PTkUpPyAwIDogMTsKKworICAgICAKKyAgICB2b3NfbWVtX2NvcHkoICh0QU5JX1U4ICopIHBNYWNIZHItPmFkZHIxLAorICAgICAgICAgICAgICAgICAgKHRBTklfVTggKilhZGRyMSwKKyAgICAgICAgICAgICAgICAgIHNpemVvZiggdFNpck1hY0FkZHIgKSk7CisgICAgdm9zX21lbV9jb3B5KCAodEFOSV9VOCAqKSBwTWFjSGRyLT5hZGRyMiwKKyAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopIHN0YU1hYywKKyAgICAgICAgICAgICAgICAgIHNpemVvZiggdFNpck1hY0FkZHIgKSk7CisKKyAgICB2b3NfbWVtX2NvcHkoICh0QU5JX1U4ICopIHBNYWNIZHItPmFkZHIzLAorICAgICAgICAgICAgICAgICAgKHRBTklfVTggKikgKGFkZHIzKSwKKyAgICAgICAgICAgICAgICAgIHNpemVvZiggdFNpck1hY0FkZHIgKSk7CisKKyAgICBsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgRkwoIlByZXBhcmluZyBURExTIGZyYW1lIGhlYWRlciB0byAlcyBBMToiTUFDX0FERFJFU1NfU1RSIiwgQTI6Ik1BQ19BRERSRVNTX1NUUiIsIEEzOiJNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAodGRsc0xpbmtUeXBlID09IFRETFNfTElOS19BUCkgPyAiQVAiIDogIkRJUkVDVCIsCisgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBNYWNIZHItPmFkZHIxKSwKKyAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocE1hY0hkci0+YWRkcjIpLAorICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwTWFjSGRyLT5hZGRyMykpOworCisgICAgLy9wcmludE1hY0FkZHIocE1hY0hkci0+YnNzSWQpIDsKKyAgICAvL3ByaW50TWFjQWRkcihwTWFjSGRyLT5zYSkgOworICAgIC8vcHJpbnRNYWNBZGRyKHBNYWNIZHItPmRhKSA7CisKKyAgICBpZiAoKCh0ZGxzTGlua1R5cGUgPT0gVERMU19MSU5LX0FQKSAmJiAoSVNfUU9TX0VOQUJMRUQocHNlc3Npb25FbnRyeSkpKSB8fAorICAgICAgICAoKHRkbHNMaW5rVHlwZSA9PSBURExTX0xJTktfRElSRUNUKSAmJiBxb3NNb2RlKSkKKyAgICB7CisgICAgICAgIHBNYWNIZHItPnFvc0NvbnRyb2wudGlkID0gdGlkOworICAgICAgICBoZWFkZXJfb2Zmc2V0ICs9IHNpemVvZih0U2lyTWFjRGF0YUhkcjNhKTsKKyAgICB9CisgICAgZWxzZQorICAgICAgICBoZWFkZXJfb2Zmc2V0ICs9IHNpemVvZih0U2lyTWFjTWdtdEhkcik7CisKKyAgICAvKiAKKyAgICAgKiBOb3cgZm9ybSBSRkMxMDQyIGhlYWRlcgorICAgICAqLworICAgIHZvc19tZW1fY29weSgodEFOSV9VOCAqKShwRnJhbWUgKyBoZWFkZXJfb2Zmc2V0KSwKKyAgICAgICAgICAgICAgICAgKHRBTklfVTggKilldGhfODkwZF9oZWFkZXIsIHNpemVvZihldGhfODkwZF9oZWFkZXIpKSA7CisKKyAgICBoZWFkZXJfb2Zmc2V0ICs9IHNpem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rva2VuLnRva2VuID0gZGlhbG9nIDsKKworCisgICAgc2l6ZSA9IHNpemVvZih0U2lyTWFjQWRkcikgOworICAgCisgICAgUG9wdWxhdGVEb3QxMWZMaW5rSWRlbiggcE1hYywgcHNlc3Npb25FbnRyeSwgJnRkbHNEaXNSZXEuTGlua0lkZW50aWZpZXIsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBlZXJfbWFjLCBURExTX0lOSVRJQVRPUikgOworCisgICAgLyogCisgICAgICogbm93IHdlIHBhY2sgaXQuICBGaXJzdCwgaG93IG11Y2ggc3BhY2UgYXJlIHdlIGdvaW5nIHRvIG5lZWQ/CisgICAgICovCisgICAgc3RhdHVzID0gZG90MTFmR2V0UGFja2VkVERMU0Rpc1JlcVNpemUoIHBNYWMsICZ0ZGxzRGlzUmVxLCAmblBheWxvYWQpOworICAgIGlmICggRE9UMTFGX0ZBSUxFRCggc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICBGTCgiRmFpbGVkIHRvIGNhbGN1bGF0ZSB0aGUgcGFja2VkIHNpemUgZm9yIGEgZGlzY292ZXJ5IFJlcXVlc3QgKDB4JTA4eCkuIiksCisgICAgICAgICAgICAgICBzdGF0dXMpOworICAgICAgICAvKiBXZSdsbCBmYWxsIGJhY2sgb24gdGhlIHdvcnN0IGNhc2Ugc2NlbmFyaW86ICovCisgICAgICAgIG5QYXlsb2FkID0gc2l6ZW9mKCB0RG90MTFmVERMU0Rpc1JlcSApOworICAgIH0KKyAgICBlbHNlIGlmICggRE9UMTFGX1dBUk5FRCggc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1csCisgICAgICAgICAgICAgICBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBjYWxjdWxhdGluZyB0aGUgcGFja2VkIHNpemUgZm9yIGEgZGlzY292ZXJ5IFJlc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FRUVfODAyM19TSVpFKQorICAgIHsKKyAgICAgICAgcGFkTGVuID0gTUlOX0lFRUVfODAyM19TSVpFIC0gKG5QYXlsb2FkICsgUEFZTE9BRF9UWVBFX1RETFNfU0laRSApIDsKKworICAgICAgICAvKiBpZiBwYWRMZW4gaXMgbGVzcyB0aGFuIG1pbmltdW0gdmVuZG9yU3BlY2lmaWMgKDUpLCBwYWQgdXAgdG8gNSAqLworICAgICAgICBpZiAocGFkTGVuIDwgTUlOX1ZFTkRPUl9TUEVDSUZJQ19JRV9TSVpFKQorICAgICAgICAgICAgcGFkTGVuID0gTUlOX1ZFTkRPUl9TUEVDSUZJQ19JRV9TSVpFOworCisgICAgICAgIG5CeXRlcyArPSBwYWRMZW47CisgICAgfQorI2VuZGlmCisKKyAgICAvKiBPay0tIHRyeSB0byBhbGxvY2F0ZSBtZW1vcnkgZnJvbSBNR01UIFBLVCBwb29sICovCisKKyAgICBoYWxzdGF0dXMgPSBwYWxQa3RBbGxvYyggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIHRBTklfVTE2ICluQnl0ZXMsICggdm9pZCoqICkgJnBGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCB2b2lkKiogKSAmcFBhY2tldCApOworICAgIGlmICggISBIQUxfU1RBVFVTX1NVQ0NFU1MgKCBoYWxzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgIEZMKCJGYWlsZWQgdG8gYWxsb2NhdGUgJWQgYnl0ZXMgZm9yIGEgVERMUyBEaXNjb3ZlcnkgUmVxdWVzdC4iKSwKKyAgICAgICAgICAgICAgIG5CeXRlcyk7CisgICAgICAgIHJldHVybiBlU0lSX01FTV9BTExPQ19GQUlMRUQ7CisgICAgfQorCisgICAgLyogemVybyBvdXQgdGhlIG1lbW9yeSAqLworICAgIHZvc19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ICBzdGF0dXMgPSBkb3QxMWZQYWNrVERMU0Rpc1JlcSggcE1hYywgJnRkbHNEaXNSZXEsIHBGcmFtZSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGhlYWRlcl9vZmZzZXQsIG5QYXlsb2FkLCAmblBheWxvYWQgKTsKKworICAgIGlmICggRE9UMTFGX0ZBSUxFRCggc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gcGFjayBhIFRETFMgZGlzY292ZXJ5IHJlcSAoMHglMDh4KS4iKSwKKyAgICAgICAgICAgICAgIHN0YXR1cyk7CisgICAgICAgIHBhbFBrdEZyZWUoIHBNYWMtPmhIZGQsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggdm9pZCogKSBwRnJhbWUsICggdm9pZCogKSBwUGFja2V0ICk7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgRkwoIlRoZXJlIHdlcmUgd2FybmluZ3Mgd2hpbGUgcGFja2luZyBURExTIERpc2NvdmVyeSBSZXF1ZXN0ICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgc3RhdHVzKTsKKyAgICB9CisKKyNpZm5kZWYgTk9fUEFEX1RETFNfTUlOXzgwMjNfU0laRQorICAgIGlmIChwYWRMZW4gIT0gMCkKKyAgICB7CisgICAgICAgIC8qIFFDT00gVkVORE9SIE9VSSA9IHsgMHgwMCwgMHhBMCwgMHhDNiwgdHlwZSA9IDB4MDAwMCB9OyAqLworICAgICAgICB0QU5JX1U4ICpwYWRWZW5kb3JTcGVjaWZpYyA9IHBGcmFtZSArIGhlYWRlcl9vZmZzZXQgKyBuUGF5bG9hZDsKKyAgICAgICAgLyogbWFrZSBRQ09NX1ZFTkRPUl9PVUksIGFuZCB0eXBlID0gMHgwMDAwLCBhbmQgYWxsIHRoZSBwYXlsb2FkIHRvIGJlIHplcm8gKi8KKyAgICAgICAgcGFkVmVuZG9yU3BlY2lmaWNbMF0gPSAyMjE7CisgICAgICAgIHBhZFZlbmRvclNwZWNpZmljWzFdID0gcGFkTGVuIC0gMjsKKyAgICAgICAgcGFkVmVuZG9yU3BlY2lmaWNbMl0gPSAweDAwOworICAgICAgICBwYWRWZW5kb3JTcGVjaWZpY1szXSA9IDB4QTA7CisgICAgICAgIHBhZFZlbmRvclNwZWNpZmljWzRdID0gMHhDNjsKKworICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlBhZGRpbmcgVmVuZG9yIFNwZWNpZmljIEllIExlbiA9ICVkIiksIHBhZExlbik7CisKKyAgICAgICAgLyogcGFkZGluZyB6ZXJvIGlmIG1vcmUgdGhhbiA1IGJ5dGVzIGFyZSByZXF1aXJlZCAqLworICAgICAgICBpZiAocGFkTGVuID4gTUlOX1ZFTkRPUl9TUEVDSUZJQ19JRV9TSVpFKQorICAgICAgICAgICAgdm9zX21lbV9zZXQoIHBGcmFtZSArIGhlYWRlcl9vZmZzZXQgKyBuUGF5bG9hZCArIE1JTl9WRU5ET1JfU1BFQ0lGSUNfSUVfU0laRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBwYWRMZW4gLSBNSU5fVkVORE9SX1NQRUNJRklDX0lFX1NJWkUsIDApOworICAgIH0KKyNlbmRpZgorCisgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgIEZMKCJbVERMU10gYWN0aW9uICVkICglcykgLUFQLT4gT1RBIHBlZXI9Ik1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgIFNJUl9NQUNfVERMU19ESVNfUkVRLAorICAgICAgICAgICBsaW1UcmFjZVRkbHNBY3Rpb25TdHJpbmcoU0lSX01BQ19URExTX0RJU19SRVEpLAorICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwZWVyX21hYykpOworCisgICAgaGFsc3RhdHVzID0gaGFsVHhGcmFtZVdpdGhUeENvbXBsZXRlKCBwTWFjLCBwUGFja2V0LCAoIHRBTklfVTE2ICkgbkJ5dGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTF9UWFJYX0ZSTV84MDJfMTFfREFUQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTklfVFhESVJfVE9EUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBUSURfQUNfVkksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltVHhDb21wbGV0ZSwgcEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbU1nbXRUWENvbXBsZXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTF9VU0VfQkRfUkFURTJfRk9SX01BTkFHRU1FTlRfRlJBTUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLnR4QmRUb2tlbisrKTsKKyAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTICggaGFsc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgcE1hYy0+bGltLm1nbXRGcmFtZVNlc3Npb25JZCA9IDB4ZmY7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IHNlbmQgVERMUyBEaXNjb3ZlcnkgUmVxdWVzdCBmcmFtZSIpKTsKKyAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICB9CisgICAgcE1hYy0+bGltLm1nbXRGcmFtZVNlc3Npb25JZCA9IHBzZXNzaW9uRW50cnktPnNtZVNlc3Npb25JZDsKKworICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7CisKK30KKworLyoKKyAqIFRoaXMgc3RhdGljIGZ1bmN0aW9uIGlzIGNvbnNpc3RlbnQgd2l0aCBhbnkga2luZCBvZiBURExTIG1hbmFnZW1l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ICAgICAgICAgaHRDYXAtPnByZXNlbnQsIGh0Q2FwLT5zdXBwb3J0ZWRDaGFubmVsV2lkdGhTZXQpOworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisgICAgaWYgKElTX0RPVDExX01PREVfVkhUKHNlbGZEb3QxMU1vZGUpICYmCisgICAgICAgIElTX0ZFQVRVUkVfU1VQUE9SVEVEX0JZX0ZXKERPVDExQUMpKQorICAgIHsKKyAgICAgICAgLyogSW5jbHVkZSBWSFQgQ2FwYWJpbGl0eSBJRSAqLworICAgICAgICBQb3B1bGF0ZURvdDExZlZIVENhcHMoIHBNYWMsIHZodENhcCwKKyAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Y3VycmVudE9wZXJDaGFubmVsLCBlU0lSX0ZBTFNFICk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHZodENhcC0+cHJlc2VudCA9IDA7CisgICAgfQorICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiVkhUIHByZXNlbnQgPSAlaHUiKSwKKyAgICAgICAgICAgIHZodENhcC0+cHJlc2VudCk7CisjZW5kaWYKK30KKworLyoKKyAqIFNlbmQgVERMUyBkaXNjb3ZlcnkgcmVzcG9uc2UgZnJhbWUgb24gZGlyZWN0IGxpbmsuCisgKi8KKworc3RhdGljIHRTaXJSZXRTdGF0dXMgbGltU2VuZFRkbHNEaXNSc3BGcmFtZSh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgdFNpck1hY0FkZHIgcGVlck1hYywgdEFOSV9VOCBkaWFsb2csCisgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5LCB0QU5JX1U4ICphZGRJZSwKKyAgICAgICAgICAgICAgICAgICAgIHRBTklfVTE2IGFkZEllTGVuKQoreworICAgIHREb3QxMWZURExTRGlzUnNwICAgdGRsc0Rpc1JzcCA7CisgICAgdEFOSV9VMTYgICAgICAg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0IGJ5IHplcm8taW5pdGlhbGl6aW5nIHRoZSBzdHJ1Y3R1cmU6CisgICAgICovCisgICAgdm9zX21lbV9zZXQoICggdEFOSV9VOCogKSZ0ZGxzRGlzUnNwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoIHREb3QxMWZURExTRGlzUnNwICksIDAgKTsKKworICAgIC8qCisgICAgICogc2V0dXAgRml4ZWQgZmllbGRzLAorICAgICAqLworICAgIHRkbHNEaXNSc3AuQ2F0ZWdvcnkuY2F0ZWdvcnkgPSBTSVJfTUFDX0FDVElPTl9QVUJMSUNfVVNBR0U7CisgICAgdGRsc0Rpc1JzcC5BY3Rpb24uYWN0aW9uICAgICA9IFNJUl9NQUNfVERMU19ESVNfUlNQIDsKKyAgICB0ZGxzRGlzUnNwLkRpYWxvZ1Rva2VuLnRva2VuID0gZGlhbG9nIDsKKworICAgIFBvcHVsYXRlRG90MTFmTGlua0lkZW4oIHBNYWMsIHBzZXNzaW9uRW50cnksICZ0ZGxzRGlzUnNwLkxpbmtJZGVudGlmaWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBlZXJNYWMsIFRETFNfUkVTUE9OREVSKSA7CisKKyAgICBpZiAoY2ZnR2V0Q2FwYWJpbGl0eUluZm8ocE1hYywgJmNhcHMsIHBzZXNzaW9uRW50cnkpICE9IGVTSVJfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIC8qCisgICAgICAgICAqIENvdWxkIG5vdCBnZXQgQ2FwYWJpbGl0aWVzIHZhbHVlCisgICAgICAgICAqIGZyb20gQ0ZHLiBMb2cgZXJyb3IuCisgICAgICAgICAqLworICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgQ2FwYWJpbGl0aWVzIHZhbHVlIikpOworICAgIH0KKyAgICBzd2FwQml0RmllbGQxNihjYXBzLCAoIHRBTklfVTE2KiApJnRkbHNEaXNSc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XNlIHNjZW5hcmlvOiAqLworICAgICAgICBuUGF5bG9hZCA9IHNpemVvZiggdERvdDExZlByb2JlUmVxdWVzdCApOworICAgIH0KKyAgICBlbHNlIGlmICggRE9UMTFGX1dBUk5FRCggc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1csCisgICAgICAgICAgICAgICBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBjYWxjdWxhdGluZyB0aGUgcGFja2VkIHNpemUgZm9yIGEgRGlzY292ZXJ5IFJlc3BvbnNlICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgc3RhdHVzKTsKKyAgICB9CisKKyAgICAvKgorICAgICAqIFRoaXMgZnJhbWUgaXMgZ29pbmcgb3V0IGZyb20gUEUgYXMgZGF0YSBmcmFtZXMgd2l0aCBzcGVjaWFsIGV0aGVydHlwZQorICAgICAqIDg5LTBkLgorICAgICAqIDggYnl0ZXMgb2YgUkZDIDEwNDIgaGVhZGVyCisgICAgICovIAorCisKKyAgICBuQnl0ZXMgPSBuUGF5bG9hZCArIHNpemVvZiggdFNpck1hY01nbXRIZHIgKSArIGFkZEllTGVuOworCisgICAgLyogT2stLSB0cnkgdG8gYWxsb2NhdGUgbWVtb3J5IGZyb20gTUdNVCBQS1QgcG9vbCAqLworCisgICAgaGFsc3RhdHVzID0gcGFsUGt0QWxsb2MoIHBNYWMtPmhIZGQsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCB0QU5JX1UxNiApbkJ5dGVzLCAoIHZvaWQqKiApICZwRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggdm9pZCoqICkgJnBQYWNrZXQgKTsKKyAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTICggaGFsc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICBGT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mMudG9EUyAgICA9IEFOSV9UWERJUl9JQlNTOworICAgICAgICBwTWFjSGRyLT5mYy5wb3dlck1nbXQgPSAwIDsKKyAgICAgICAgc2lyQ29weU1hY0FkZHIocE1hY0hkci0+YnNzSWQscHNlc3Npb25FbnRyeS0+YnNzSWQpOworICAgIH0KKworI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTX05FR0FUSVZFCisgICAgaWYocE1hYy0+bGltLmdMaW1UZGxzTmVnYXRpdmVCZWhhdmlvciAmIExJTV9URExTX05FR0FUSVZFX1dST05HX0JTU0lEX0lOX0RTQ1ZfUlNQKQorICAgIHsKKyAgICAgICAgdGRsc0Rpc1JzcC5MaW5rSWRlbnRpZmllci5ic3NpZFs0XSA9IDB4ZGU7CisgICAgICAgIHRkbHNEaXNSc3AuTGlua0lkZW50aWZpZXIuYnNzaWRbNV0gPSAweGFkOyAKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfUEUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICgiVERMUyBuZWdhdGl2ZSBydW5uaW5nOiB3cm9uZyBCU1NJRCAiIE1BQ19BRERSRVNTX1NUUiAiIGluIFRETFMgRGlzY292ZXJ5IFJzcCIpLAorICAgICAgICAgTUFDX0FERFJfQVJSQVkodGRsc0Rpc1JzcC5MaW5rSWRlbnRpZmllci5ic3NpZCkpOworICAgIH0KKyNlbmRpZgorICAgIHN0YXR1cyA9IGRvdDExZlBhY2tURExTRGlzUnNwKCBwTWFjLCAmdGRsc0Rpc1JzcCwgcEZyYW1lICsgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCB0U2lyTWFjTWdtdEhkciApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuUGF5bG9hZCwgJm5QYXlsb2FkICk7CisKKyAgICBpZiAoIERPVDExRl9GQUlMRUQoIHN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICBGTCgiRmFpbGVkIHRvIHBhY2sgYSBURExTIERpc2NvdmVyeSBSZXNwb25zZSAoMHglMDh4KS4iKSwKKyAgICAgICAgICAgICAgICBzdGF0dXMpOworICAgICAgICBwYWxQa3RGcmVlKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKyAgICBlbHNlIGlmICggRE9UMTFGX1dBUk5FRCggc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dXLAorICAgICAgICAgICAgICAgIEZMKCJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIHBhY2tpbmcgVERMUyBEaXNjb3ZlcnkgUmVxdWVzdCAoMHglMDh4KS4iKSwKKyAgICAgICAgICAgICAgICBzdGF0dXMpOworICAgIH0KKworI2lmIDAKKyAgICBpZihwTWFjLT5oYWwucENCYWNrRm5UeENvbXAgPT0gTlVMTCkgCisgICAgeworICAgICAgICBwTWFjLT5oYWwucENCYWNrRm5UeENvbXAgPSAodHBDQmFja0ZuVHhDb21wKWxpbVRkbHNEaXNSc3BUeENvbXBsZXRlOworCisgICAgICAgIGlmKFRYX1NVQ0NFU1MgIT0gdHhfdGltZXJfYWN0aXZhdGUoJnBNYWMtPmhhbC50eENvbXBUaW1lcikpIAorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgfQorICAgIH0KKyNlbmRpZgorICAgIGlmICgwICE9IGFkZEllTGVuKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJDb3B5IEFkZGl0aW9uYWwgSWUgTGVuID0gJWQiKSwgYWRkSWVMZW4pOworICAgICAgICB2b3NfbWVtX2NvcHkocEZyYW1lICsgc2l6ZW9mKHRTaXJNYWNNZ210SGRyKSArIG5QYXlsb2FkLCBhZGRJZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSWVMZW4pOworICAgIH0KKyAgICBsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgRkwoIltURExTXSBhY3Rpb24gJWQgKCVzKSAtRElSRUNULT4gT1RBIHBlZXI9Ik1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgIFNJUl9NQUNfVERMU19ESVNfUlNQLAorICAgICAgICAgICBsaW1UcmFjZVRkbHNBY3Rpb25TdHJpbmcoU0lSX01BQ19URExTX0RJU19SU1ApLAorICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwZWVyTWFjKSk7CisKKyAgICAvKgorICAgICAqIFRyYW5zbWl0IERpc2NvdmVyeSByZXNwb25zZSBhbmQgd2F0Y2ggaWYgdGhpcyBpcyBkZWxpdmVyZWQgdG8KKyAgICAgKiBwZWVyIFNUQS4KKyAgICAgKi8KKyAgICBoYWxzdGF0dXMgPSBoYWxUeEZyYW1lV2l0aFR4Q29tcGxldGUoIHBNYWMsIHBQYWNrZXQsICggdEFOSV9VMTYgKSBuQnl0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEFMX1RYUlhfRlJNXzgwMl8xMV9EQVRBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFOSV9UWERJUl9JQlNTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltVHhDb21wbGV0ZSwgcEZyYW1lLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1NZ210VFh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Chwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwgPD0gU0lSXzExQl9DSEFOTkVMX0VORCkgJiYKKyAgICAgICAgICBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLmVuYWJsZVZodEZvcjI0R0h6KSB8fAorICAgICAgICAgKHBzZXNzaW9uRW50cnktPmN1cnJlbnRPcGVyQ2hhbm5lbCA+PSBTSVJfMTFCX0NIQU5ORUxfRU5EKSkKKyAgICB7CisgICAgICAgIGlmIChJU19ET1QxMV9NT0RFX1ZIVChzZWxmRG90MTFNb2RlKSAmJgorICAgICAgICAgICAgSVNfRkVBVFVSRV9TVVBQT1JURURfQllfRlcoRE9UMTFBQykpCisgICAgICAgIHsKKworICAgICAgICAgICAgdEFOSV9VMTYgYWlkOworICAgICAgICAgICAgdHBEcGhIYXNoTm9kZSAgICAgICBwU3RhRHM7CisKKyAgICAgICAgICAgIHBTdGFEcyA9IGRwaExvb2t1cEhhc2hFbnRyeShwTWFjLCBwZWVyTWFjLCAmYWlkLCAmcHNlc3Npb25FbnRyeS0+ZHBoLmRwaEhhc2hUYWJsZSk7CisgICAgICAgICAgICBpZiAoTlVMTCAhPSBwU3RhRHMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIEFpZC0+cHJlc2VudCA9IDE7CisgICAgICAgICAgICAgICAgIEFpZC0+YXNzb2NJZCA9IGFpZCB8IExJTV9BSURfTUFTSzsgLy8gc2V0IGJpdCAxNCBhbmQgMTUgMSdzCisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgQWlkLT5wcmVzZW50ID0gMDsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoInBTdGFEcyBpcyBOVUxMIGZvciAiIE1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBlZXJNYWMpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBBaWQtPnByZXNlbnQgPSAwOworICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgRkwoIlZodCBub3QgZW5hYmxlIGZyb20gaW5pIGZvciAyLjRHSHouIikpOworICAgIH0KK30KKworLyoKKyAqIFRETFMgc2V0dXAgUmVxdWVzdCBmcmFtZSBvbiBBUCBsaW5rCisgKi8KKwordFNpclJldFN0YXR1cyBsaW1TZW5kVGRsc0xpbmtTZXR1cFJlcUZyYW1lKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICB0U2lyTWFjQWRkciBwZWVyTWFjLCB0QU5JX1U4IGRpYWxvZywgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSwKKyAgICAgICAgICAgIHRBTklfVTggKmFkZEllLCB0QU5JX1UxNiBhZGRJZUxlbikKK3sKKyAgICB0RG90MTFmVERMU1NldHVwUmVxICAgIHRkbHNTZXR1cFJlcSA7CisgICAgdEFOSV9VMTYgICAgICAgICAgICBjYXBzID0gMCA7CisgICAgdEFOSV9VMzIgICAgICAgICAgICBzdGF0dXMgPSAwIDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgIG5QYXlsb2FkID0gMCA7CisgICAgdEFOSV9VMzIgICAgICAgICAgICBuQnl0ZXMgPSAwIDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgIGhlYWRlcl9vZmZzZXQgPSAwIDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgKnBGcmFtZTsKKyAgICB2b2lkICAgICAgICAgICAgICAgKnBQYWNrZXQ7CisgICAgZUhhbFN0YXR1cyAgICAgICAgICBoYWxzdGF0dXM7CisgICAgdWludDMyICAgICAgICAgICAgICBzZWxmRG90MTFNb2RlOworICAgIHRwU2lyTWFjQ2FwYWJpbGl0eUluZm8gcENhcEluZm87CisvLyAgUGxhY2Vob2xkZXIgdG8gc3VwcG9ydCBkaW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nIDsKKworCisgICAgUG9wdWxhdGVEb3QxMWZMaW5rSWRlbiggcE1hYywgcHNlc3Npb25FbnRyeSwgJnRkbHNTZXR1cFJlcS5MaW5rSWRlbnRpZmllciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZWVyTWFjLCBURExTX0lOSVRJQVRPUikgOworCisgICAgaWYgKGNmZ0dldENhcGFiaWxpdHlJbmZvKHBNYWMsICZjYXBzLCBwc2Vzc2lvbkVudHJ5KSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgeworICAgICAgICAvKgorICAgICAgICAgKiBDb3VsZCBub3QgZ2V0IENhcGFiaWxpdGllcyB2YWx1ZQorICAgICAgICAgKiBmcm9tIENGRy4gTG9nIGVycm9yLgorICAgICAgICAgKi8KKyAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IHJldHJpZXZlIENhcGFiaWxpdGllcyB2YWx1ZSIpKTsKKyAgICB9CisKKyAgICBwQ2FwSW5mbyA9ICh0cFNpck1hY0NhcGFiaWxpdHlJbmZvKSAmY2FwczsKKyAgICAvKiBFeHBvcnQgUU9TIGNhcGFiaWxpdHkgICovCisgICAgcENhcEluZm8tPnFvcyA9IDE7CisKKyAgICBzd2FwQml0RmllbGQxNihjYXBzLCAoIHRBTklfVTE2KiApJnRkbHNTZXR1cFJlcS5DYXBhYmlsaXRpZXMgKTsKKworICAgIC8qIHBvcHVsYXRlIHN1cHBvcnRlZCByYXRlIGFuZCBleHQgc3VwcG9ydGVkIHJhdGUgSUUgKi8KKyAgICBQb3B1bGF0ZURvdDExZlJhdGVzVGRscyhwTWFjLCAmdGRsc1NldHVwUmVxLlN1cHBSYXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdGRsc1NldHVwUmVxLkV4dFN1cHBSYXRlcyk7CisKKyAgICAvKiBQb3B1bGF0ZSBleHRlbmRlZCBjYXBhYmlsaXR5IElFICovCisgICAgUG9wdWxhdGVEb3QxMWZUZGxzRXh0Q2FwYWJpbGl0eSggcE1hYywgJnRkbHNTZXR1cFJlcS5FeHRDYXAgKTsKKworICAgIGlmICggMSA9PSBwTWFjLT5saW0uZ0xpbVRETFNXbW1Nb2RlICkKKyAgICB7CisgICAgICAgIHRBTklfVTMyICB2YWwgPSAwOworCisgICAgICAgIC8qIGluY2x1ZGUgV01NIElFICovCisgICAgICAgIHRkbHNTZXR1cFJlcS5XTU1JbmZvU3RhdGlvbi52ZXJzaW9uID0gU0lSX01BQ19PVUlfVkVSU0lPTl8xOworICAgICAgICB0ZGxzU2V0dXBSZXEuV01NSW5mb1N0YXRpb24uYWN2b191YXBzZCA9CisgICAgICAgICAgICAgICAgICAgICAocE1hYy0+bGltLmdMaW1URExTVWFwc2RNYXNrICYgMHgwMSk7CisgICAgICAgIHRkbHNTZXR1cFJlcS5XTU1JbmZvU3RhdGlvbi5hY3ZpX3VhcHNkID0KKyAgICAgICAgICAgICAgICAgICAgICgocE1hYy0+bGltLmdMaW1URExTVWFwc2RNYXNrICYgMHgwMikgPj4gMSk7CisgICAgICAgIHRkbHNTZXR1cFJlcS5XTU1JbmZvU3RhdGlvbi5hY2JrX3VhcHNkID0KKyAgICAgICAgICAgICAgICAgICAgICgocE1hYy0+bGltLmdMaW1URExTVWFwc2RNYXNrICYgMHgwNCkgPj4gMik7CisgICAgICAgIHRkbHNTZXR1cFJlcS5XTU1JbmZvU3RhdGlvbi5hY2JlX3VhcHNkID0KKyAgICAgICAgICAgICAgICAgICAgICgocE1hYy0+bGltLmdMaW1URExTVWFwc2RNYXNrICYgMHgwOCkgPj4gMyk7CisKKyAgICAgICAgaWYod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19NQVhfU1BfTEVOR1RILCAmdmFsKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IHJldHJpZXZlIE1heCBTUCBMZW5nd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U2V0dXBSZXEuSFRDYXBzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ0ZGxzU2V0dXBSZXEuVkhUQ2FwcywgcHNlc3Npb25FbnRyeSApOworCisgICAgLyogUG9wdWxhdGUgQUlEICovCisgICAgUG9wdWxhdGVEb3RmVGRsc1ZodEFJRCggcE1hYywgc2VsZkRvdDExTW9kZSwgcGVlck1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdGRsc1NldHVwUmVxLkFJRCwgcHNlc3Npb25FbnRyeSApOworCisgICAgaWYgKCAxID09IHBNYWMtPmxpbS5nTGltVERMU09mZkNoYW5uZWxFbmFibGVkICkKKyAgICAgICAgUG9wdWxhdGVEb3QxMWZUZGxzT2ZmY2hhbm5lbFBhcmFtcyggcE1hYywgcHNlc3Npb25FbnRyeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnRkbHNTZXR1cFJlcS5TdXBwQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ0ZGxzU2V0dXBSZXEuU3VwcE9wZXJhdGluZ0NsYXNzZXMpOworCisgICAgaWYgKFRSVUUgPT0gcE1hYy0+bGltLkVuYWJsZVRkbHMyMDQwQlNTQ29leElFKQorICAgIHsKKyAgICAgICAgaWYgKCAxID09IHBNYWMtPmxpbS5nTGltVERMU09mZkNoYW5uZWxFbmFibGVkICYmCisgICAgICAgICAgICAoIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uYmFuZENhcGFiaWxpdHkgIT0gZUNTUl9CQU5EXzI0KSkKKyAgICAgICAgeworICAgICAgICAgICAgdGRsc1NldHVwUmVxLkhUMjA0MEJTU0NvZXhpc3RlbmNlLnByZXNlbnQgPSAxOworICAgICAgICAgICAgdGRsc1NldHVwUmVxLkhUMjA0MEJTU0NvZXhpc3RlbmNlLmluZm9SZXF1ZXN0ID0gMTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qCisgICAgICogbm93IHdlIHBhY2sgaXQuICBGaXJzdCwgaG93IG11Y2ggc3BhY2UgYXJlIHdlIGdvaW5nIHRvIG5lZWQ/CisgICAgICovCisgICAgc3RhdHVzID0gZG90MTFmR2V0UGFja2VkVERMU1NldHVwUmVxU2l6ZSggcE1hYywgJnRkbHNTZXR1cFJlcSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm5QYXlsb2FkKTsKKyAgICBpZiAoIERPVDExRl9GQUlMRUQoIHN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgRkwoIkZhaWxlZCB0byBjYWxjdWxhdGUgdGhlIHBhY2tlZCBzaXplIGZvciBhIFNldHVwIFJlcXVlc3QgKDB4JTA4eCkuIiksCisgICAgICAgICAgICAgICBzdGF0dXMpOworICAgICAgICAvKiBXZSdsbCBmYWxsIGJhY2sgb24gdGhlIHdvcnN0IGNhc2Ugc2NlbmFyaW86ICovCisgICAgICAgIG5QYXlsb2FkID0gc2l6ZW9mKCB0RG90MTFmUHJvYmVSZXF1ZXN0ICk7CisgICAgfQorICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgICAgIEZMKCJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIGNhbGN1bGF0aW5nIHRoZSBwYWNrZWQgc2l6ZSBmb3IgYSBTZXR1cCBSZXF1ZXN0ICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgc3RhdHVzKTsKKyAgICB9CisKKworICAgIC8qCisgICAgICogVGhpcyBmcmFtZSBpcyBnb2luZyBvdXQgZnJvbSBQRSBhcyBkYXRhIGZyYW1lcyB3aXRoIHNwZWNpYWwgZXRoZXJ0eXBlCisgICAgICogODktMGQuCisgICAgICogOCBieXRlcyBvZiBSRkMgMTA0MiBoZWFkZXIKKyAgICAgKi8KKworCisgICAgbkJ5dGVzID0gblBheWxvYWQgKyAoKElTX1FPU19FTkFCTEVEKHBzZXNzaW9uRW50cnkpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBzaXplb2YodFNpck1hY0RhdGFIZHIzYSkgOiBzaXplb2YodFNpck1hY01nbXRIZHIpKQorICAgICAgICAgICAgICAgICAgICAgICsgc2l6ZW9mKCBldGhfODkwZF9oZWFkZXIgKQorICAgICAgICAgICAgICAgICAgICAgICsgUEFZTE9BRF9UWVBFX1RETFNfU0laRQorICAgICAgICAgICAgICAgICAgICAgICsgYWRkSWVMZW47CisKKyAgICAvKiBPay0tIHRyeSB0byBhbGxvY2F0ZSBtZW1vcnkgZnJvbSBNR01UIFBLVCBwb29sICovCisKKyAgICBoYWxzdGF0dXMgPSBwYWxQa3RBbGxvYyggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIHRBTklfVTE2ICluQnl0ZXMsICggdm9pZCoqICkgJnBGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCB2b2lkKiogKSAmcFBhY2tldCApOworICAgIGlmICggISBIQUxfU1RBVFVTX1NVQ0NFU1MgKCBoYWxzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgIEZMKCJGYWlsZWQgdG8gYWxsb2NhdGUgJWQgYnl0ZXMgZm9yIGEgVERMUyBTZXR1cCBSZXF1ZXN0LiIpLAorICAgICAgICAgICAgICAgbkJ5dGVzKTsKKyAgICAgICAgcmV0dXJuIGVTSVJfTUVNX0FMTE9DX0ZBSUxFRDsKKyAgICB9CisKKyAgICAvKiB6ZXJvIG91dCB0aGUgbWVtb3J5ICovCisgICAgdm9zX21lbV9zZXQoIHBGcmFtZSwgbkJ5dGVzLCAwKTsKKworICAgIC8qCisgICAgICogSUUgZm9ybWF0aW9uLCBtZW1vcnkgYWxsb2NhdGlvbiBpcyBjb21wbGV0ZWQsIE5vdyBmb3JtIFRETFMgZGlzY292ZXJ5CisgICAgICogcmVxdWVzdCBmcmFtZQorICAgICAqLworCisgICAgLyogZmlsbCBvdXQgdGhlIGJ1ZmZlciBkZXNjcmlwdG9yICovCisKKyAgICBoZWFkZXJfb2Zmc2V0ID0gbGltUHJlcGFyZVRkbHNGcmFtZUhlYWRlcihwTWFjLCBwRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgIExJTktfSURFTl9BRERSX09GRlNFVCh0ZGxzU2V0dXBSZXEpLAorICAgICAgICAgICAgICAgICAgICAgICAgICBURExTX0xJTktfQVAsIFRETFNfSU5JVElBVE9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICBUSURfQUNfVkksIHBzZXNzaW9uRW50cnkpIDsKKworI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTX05FR0FUSVZFCisgICAgaWYocE1hYy0+bGltLmdMaW1UZGxzTmVnYXRpdmVCZWhhdmlvciAmIExJTV9URExTX05FR0FUSVZFX1dST05HX0JTU0lEX0lOX1NFVFVQX1JFUSkKKyAgICB7CisgICAgICAgIHRkbHNTZXR1cFJlcS5MaW5rSWRlbnRpZmllci5ic3NpZFs0XSA9IDB4ZGU7CisgICAgICAgIHRkbHNTZXR1cFJlcS5MaW5rSWRlbnRpZmllci5ic3NpZFs1XSA9IDB4YWQ7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1BFLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICgiVERMUyBuZWdhdGl2ZSBydW5uaW5nOiB3cm9uZyBCU1NJRCAiIE1BQ19BRERSRVNTX1NUUiAiIGluIFRETFMgU2V0dXAgUmVxIiksCisgICAgICAgICBNQUNfQUREUl9BUlJBWSh0ZGxzU2V0dXBSZXEuTGlua0lkZW50aWZpZXIuYnNzaWQpKTsKKyAgICB9CisjZW5kaWYKKyAgICBsaW1Mb2coIHBNYWMsIExPR1csIEZMKCJTdXBwb3J0ZWRDaG5sV2lkdGggJXggcnhNQ1NNYXAgJXggcnhNQ1NNYXAgJXggdHhTdXBEYXRhUmF0ZSAleCIpLAorICAgICAgICAgICAgdGRsc1NldHVwUmVxLlZIVENhcHMuc3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0LAorICAgICAgICAgICAgdGRsc1NldHVwUmVxLlZIVENhcHMucnhNQ1NNYXAsCisgICAgICAgICAgICB0ZGxzU2V0dXBSZXEuVkhUQ2Fwcy50eE1DU01hcCwKKyAgICAgICAgICAgIHRkbHNTZXR1cFJlcS5WSFRDYXBzLnR4U3VwRGF0YVJhdGUpOworCisgICAgc3RhdHVzID0gZG90MTFmUGFja1RETFNTZXR1cFJlcSggcE1hYywgJnRkbHNTZXR1cFJlcSwgcEZyYW1lCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBoZWFkZXJfb2Zmc2V0LCBuUGF5bG9hZCwgJm5QYXlsb2FkICk7CisKKyAgICBpZiAoIERPVDExRl9GQUlMRUQoIHN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgRkwoIkZhaWxlZCB0byBwYWNrIGEgVERMUyBTZXR1cCBSZXF1ZXN0ICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgICAgIHN0YXR1cyk7CisgICAgICAgIHBhbFBrdEZyZWUoIHBNYWMtPmhIZGQsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggdm9pZCogKSBwRnJhbWUsICggdm9pZCogKSBwUGFja2V0ICk7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgICAgIEZMKCJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIHBhY2tpbmcgVERMUyBTZXR1cCBSZXF1ZXN0ICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgc3RhdHVzKTsKKyAgICB9CisKKyAgICAvL0NvcHkgdGhlIGFkZGl0aW9uYWwgSUUuCisgICAgLy9UT0RPIDogYWRkSWUgaXMgYWRkZWQgYXQgdGhlIGVuZCBvZiB0aGUgZnJhbWUuIFRoaXMgbWVhbnMgaXQgZG9lc250CisgICAgLy9mb2xsb3cgdGhlIG9yZGVyLiBUaGlzIHNob3VsZCBiZSBvaywgYnV0IHdlIHNob3VsZCBjb25zaWRlciBjaGFuZ2luZyB0aGlzCisgICAgLy9pZiB0aGVyZSBpcyBhbnkgSU9UIGlzc3VlLgorICAgIGlmKCBhZGRJZUxlbiAhPSAwICkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiQ29weSBBZGRpdGlvbmFsIEllIExlbiA9ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRJZUxlbik7CisgICAgICAgIHZvc19tZW1fY29weSggcEZyYW1lICsgaGVhZGVyX29mZnNldCArIG5QYXlsb2FkLCBhZGRJZSwgYWRkSWVMZW4gKTsKKyAgICB9CisKKyAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIltURExTXSBhY3Rpb24gJWQgKCVzKSAtQVAtPiBPVEEgcGVlcj0iTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgICAgICAgICAgU0lSX01BQ19URExTX1NFVFVQX1JFUSwKKyAgICAgICAgICAgICAgICAgICAgICAgbGltVHJhY2VUZGxzQWN0aW9uU3RyaW5nKFNJUl9NQUNfVERMU19TRVRVUF9SRVEpLAorICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwZWVyTWFjKSk7CisKKyAgICBoYWxzdGF0dXMgPSBoYWxUeEZyYW1lV2l0aFR4Q29tcGxldGUoIHBNYWMsIHBQYWNrZXQsICggdEFOSV9VMTYgKSBuQnl0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEFMX1RYUlhfRlJNXzgwMl8xMV9EQVRBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFOSV9UWERJUl9UT0RTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRJRF9BQ19WSSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1UeENvbXBsZXRlLCBwRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltTWdtdFRYQ29tcGxldGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEFMX1VTRV9CRF9SQVRFMl9GT1JfTUFOQUdFTUVOVF9GUkFNRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0udHhCZFRva2VuKyspOworCisgICAgaWYgKCAhIEhBTF9TVEFUVVNfU1VDQ0VTUyAoIGhhbHN0YXR1cyApICkKKyAgICB7CisgICAgICAgIHBNYWMtPmxpbS5tZ210RnJhbWVTZXNzaW9uSWQgPSAweGZmOworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoImNvdWxkIG5vdCBzZW5kIFRETFMgU2V0dXAgUmVxdWVzdCBmcmFtZSEiKSk7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorICAgIHBNYWMtPmxpbS5tZ210RnJhbWVTZXNzaW9uSWQgPSBwc2Vzc2lvbkVudHJ5LT5zbWVTZXNzaW9uSWQ7CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworCit9CisvKgorICogU2VuZCBURExTIFRlYXJkb3duIGZyYW1lIG9uIERpcmVjdCBsaW5rIG9yIEFQIGxpbmssIGRlcGVuZHMgb24gcmVhc29uIGNvZGUuCisgKi8KKwordFNpclJldFN0YXR1cyBsaW1TZW5kVGRsc1RlYXJkb3duRnJhbWUodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgIHRTaXJNYWNBZGRyIHBlZXJNYWMsIHRBTklfVTE2IHJlYXNvbiwgdEFOSV9VOCByZXNwb25kZXIsIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnksCisgICAgICAgICAgICB0QU5JX1U4ICphZGRJZSwgdEFOSV9VMTYgYWRkSWVMZW4pCit7CisgICAgdERvdDExZlRETFNUZWFyZG93biB0ZWFyZG93biA7CisgICAgdEFOSV9VMzIgICAgICAgICAgICBzdGF0dXMgPSAwIDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgIG5QYXlsb2FkID0gMCA7CisgICAgdEFOSV9VMzIgICAgICAgICAgICBuQnl0ZXMgPSAwIDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgIGhlYWRlcl9vZmZzZXQgPSAwIDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgKnBGcmFtZTsKKyAgICB2b2lkICAgICAgICAgICAgICAgKnBQYWNrZXQ7CisgICAgZUhhbFN0YXR1cyAgICAgICAgICBoYWxzdGF0dXM7CisjaWZuZGVmIE5PX1BBRF9URExTX01JTl84MDIzX1NJWkUKKyAgICB0QU5JX1UzMiAgICAgICAgICAgIHBhZExlbiA9IDA7CisjZW5kaWYKKyAgICB0cERwaEhhc2hOb2RlICAgICAgIHBTdGFEcyA9IE5VTEw7CisgICAgdEFOSV9VMTYgICAgICAgICAgICBhaWQgPSAwOworICAgIHRBTklfVTggICAgICAgICAgICAgcW9zTW9kZSA9IDA7CisgICAgdEFOSV9VOCAgICAgICAgICAgICB0ZGxzTGlua1R5cGUgPSAwOworCisgICAgLyoKKyAgICAgKiBUaGUgc2NoZW1lIGhlcmUgaXMgdG8gZmlsbCBvdXQgYSAndERvdDExZlByb2JlUmVxdWVzdCcgc3RydWN0dXJlCisgICAgICogYW5kIHRoZW4gaGFuZCBpdCBvZmYgdG8gJ2RvdDExZlBhY2tQcm9iZVJlcXVlc3QnIChmb3IKKyAgICAgKiBzZXJpYWxpemF0aW9uKS4gIFdlIHN0YXJ0IGJ5IHplcm8taW5pdGlhbGl6aW5nIHRoZSBzdHJ1Y3R1cmU6CisgICAgICovCisgICAgdm9zX21lbV9zZXQoICggdEFOSV9VOCogKSZ0ZWFyZG93biwgc2l6ZW9mKCB0RG90MTFmVERMU1RlYXJkb3duICksIDAgKTsKKyAgICB0ZWFyZG93bi5DYXRlZ29yeS5jYXRlZ29yeSA9IFNJUl9NQUNfQUNUSU9OX1RETFMgOworICAgIHRlYXJkb3duLkFjdGlvbi5hY3Rpb24gICAgID0gU0lSX01BQ19URExTX1RFQVJET1dOIDsKKyAgICB0ZWFyZG93bi5SZWFzb24uY29kZSAgICAgICA9IHJlYXNvbiA7CisKKyAgICBQb3B1bGF0ZURvdDExZkxpbmtJZGVuKCBwTWFjLCBwc2Vzc2lvbkVudHJ5LCAmdGVhcmRvd24uTGlua0lkZW50aWZpZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZWVyTWFjLCAocmVzcG9uZGVyID09IFRSVUUpID8gVERMU19SRVNQT05ERVIgOiBURExTX0lOSVRJQVRPUikgOworICAgIC8qCisgICAgICogbm93IHdlIHBhY2sgaXQuICBGaXJzdCwgaG93IG11Y2ggc3BhY2UgYXJlIHdlIGdvaW5nIHRvIG5lZWQ/CisgICAgICovCisgICAgc3RhdHVzID0gZG90MTFmR2V0UGFja2VkVERMU1RlYXJkb3duU2l6ZSggcE1hYywgJnRlYXJkb3duLCAmblBheWxvYWQpOworICAgIGlmICggRE9UMTFGX0ZBSUxFRCggc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICBGTCgiRmFpbGVkIHRvIGNhbGN1bGF0ZSB0aGUgcGFja2VkIHNpemUgZm9yIFRlYXJkb3duIGZyYW1lICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgc3RhdHVzKTsKKyAgICAgICAgLyogV2UnbGwgZmFsbCBiYWNrIG9uIHRoZSB3b3JzdCBjYXNlIHNjZW5hcmlvOiAqLworICAgICAgICBuUGF5bG9hZCA9IHNpemVvZiggdERvdDExZlByb2JlUmVxdWVzdCApOworICAgIH0KKyAgICBlbHNlIGlmICggRE9UMTFGX1dBUk5FRCggc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1csCisgICAgICAgICAgICAgICBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBjYWxjdWxhdGluZyB0aGUgcGFja2VkIHNpemUgZm9yIFRlYXJkb3duIGZyYW1lICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgc3RhdHVzKTsKKyAgICB9CisgICAgLyoKKyAgICAgKiBUaGlzIGZyYW1lIGlzIGdvaW5nIG91dCBmcm9tIFBFIGFzIGRhdGEgZnJhbWVzIHdpdGggc3BlY2lhbCBldGhlcnR5cGUKKyAgICAgKiA4OS0wZC4KKyAgICAgKiA4IGJ5dGVzIG9mIFJGQyAxMDQyIGhlYWRlcgorICAgICAqLworICAgIHBTdGFEcyA9IGRwaExvb2t1cEhhc2hFbnRyeShwTWFjLCBwZWVyTWFjLCAmYWlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsKKyAgICBpZiAocFN0YURzKQorICAgIHsKKyAgICAgICAgcW9zTW9kZSA9IHBTdGFEcy0+cW9zTW9kZTsKKyAgICB9CisgICAgdGRsc0xpbmtUeXBlID0gKHJlYXNvbiA9PSBlU0lSX01BQ19URExTX1RFQVJET1dOX1BFRVJfVU5SRUFDSEFCTEUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFRETFNfTElOS19BUCA6IFRETFNfTElOS19ESVJFQ1Q7CisgICAgbkJ5dGVzID0gblBheWxvYWQgKyAoKChJU19RT1NfRU5BQkxFRChwc2Vzc2lvbkVudHJ5KSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAodGRsc0xpbmtUeXBlID09IFRETFNfTElOS19BUCkpIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICgodGRsc0xpbmtUeXBlID09IFRETFNfTElOS19ESVJFQ1QpICYmIHFvc01vZGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBzaXplb2YodFNpck1hY0RhdGFIZHIzYSkgOiBzaXplb2YodFNpck1hY01nbXRIZHIpKQorICAgICAgICAgICAgICAgICAgICAgICsgc2l6ZW9mKCBldGhfODkwZF9oZWFkZXIgKQorICAgICAgICAgICAgICAgICAgICAgICsgUEFZTE9BRF9UWVBFX1RETFNfU0laRQorICAgICAgICAgICAgICAgICAgICAgICsgYWRkSWVMZW47CisKKyNpZm5kZWYgTk9fUEFEX1RETFNfTUlOXzgwMjNfU0laRQorICAgIC8qIElPVCBpc3N1ZSB3aXRoIHNvbWUgQVAgOiBzb21lIEFQIGRvZXNuJ3QgbGlrZSB0aGUgZGF0YSBwYWNrZXQgc2l6ZSA8IG1pbmltdW0gODAyLjMgZnJhbWUgbGVuZ3RoICg2NCkKKyAgICAgICBIZW5jZSBBUCBpdHNlbGYgcGFkZGluZyBzb21lIGJ5dGVzLCB3aGljaCBjYXVzZWQgdGVhcmRvd24gcGFja2V0IGlzIGRyb3BwZWQgYXQKKyAgICAgICByZWNlaXZlciBzaWRlLiBUbyBhdm9pZCBzdWNoIElPVCBpc3N1ZSwgd2UgYWRkZWQgc29tZSBleHRyYSBieXRlcyB0byBtZWV0IGRhdGEgZnJhbWUgc2l6ZSA+PSA2NAorICAgICAqLworICAgIGlmIChuUGF5bG9hZCArIFBBWUxPQURfVFlQRV9URExTX1NJWkUgPCBNSU5fSUVFRV84MDIzX1NJWkUpCisgICAgeworICAgICAgICBwYWRMZW4gPSBNSU5fSUVFRV84MDIzX1NJWkUgLSAoblBheWxvYWQgKyBQQVlMT0FEX1RZUEVfVERMU19TSVpFICkgOworCisgICAgICAgIC8qIGlmIHBhZExlbiBpcyBsZXNzIHRoYW4gbWluaW11bSB2ZW5kb3JTcGVjaWZpYyAoNSksIHBhZCB1cCB0byA1ICovCisgICAgICAgIGlmIChwYWRMZW4gPCBNSU5fVkVORE9SX1NQRUNJRklDX0lFX1NJWkUpCisgICAgICAgICAgICBwYWRMZW4gPSBNSU5fVkVORE9SX1NQRUNJRklDX0lFX1NJWkU7CisKKyAgICAgICAgbkJ5dGVzICs9IHBhZExlbjsKKyAgICB9CisjZW5kaWYKKworICAgIC8qIE9rLS0gdHJ5IHRvIGFsbG9jYXRlIG1lbW9yeSBmcm9tIE1HTVQgUEtUIHBvb2wgKi8KKworICAgIGhhbHN0YXR1cyA9IHBhbFBrdEFsbG9jKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggdEFOSV9VMTYgKW5CeXRlcywgKCB2b2lkKiogKSAmcEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIHZvaWQqKiApICZwUGFja2V0ICk7CisgICAgaWYgKCAhIEhBTF9TVEFUVVNfU1VDQ0VTUyAoIGhhbHN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgRkwoIkZhaWxlZCB0byBhbGxvY2F0ZSAlZCBieXRlcyBmb3IgYSBURExTIFRlYXJkb3duIEZyYW1lLiIpLAorICAgICAgICAgICAgICAgbkJ5dGVzKTsKKyAgICAgICAgcmV0dXJuIGVTSVJfTUVNX0FMTE9DX0ZBSUxFRDsKKyAgICB9CisKKyAgICAvKiB6ZXJvIG91dCB0aGUgbWVtb3J5ICovCisgICAgdm9zX21lbV9zZXQoIHBGcmFtZSwgbkJ5dGVzLCAwICk7CisKKyAgICAvKgorICAgICAqIElFIGZvcm1hdGlvbiwgbWVtb3J5IGFsbG9jYXRpb24gaXMgY29tcGxldGVkLCBOb3cgZm9ybSBURExTIGRpc2NvdmVyeQorICAgICAqIHJlcXVlc3QgZnJhbWUKKyAgICAgKi8KKyAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlJlYXNvbiBvZiBURExTIFRlYXJkb3duOiAlZCIpLCByZWFzb24pOworICAgIC8qIGZpbGwgb3V0IHRoZSBidWZmZXIgZGVzY3JpcHRvciAqLworCisgICAgaGVhZGVyX29mZnNldCA9IGxpbVByZXBhcmVUZGxzRnJhbWVIZWFkZXIocE1hYywgcEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgTElOS19JREVOX0FERFJfT0ZGU0VUKHRlYXJkb3duKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKHJlYXNvbiA9PSBlU0lSX01BQ19URExTX1RFQVJET1dOX1BFRVJfVU5SRUFDSEFCTEUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFRETFNfTElOS19BUCA6IFRETFNfTElOS19ESVJFQ1QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocmVzcG9uZGVyID09IFRSVUUpID8gVERMU19SRVNQT05ERVIgOiBURExTX0lOSVRJQVRPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRJRF9BQ19WSSwgcHNlc3Npb25FbnRyeSkgOworCisgICAgc3RhdHVzID0gZG90MTFmUGFja1RETFNUZWFyZG93biggcE1hYywgJnRlYXJkb3duLCBwRnJhbWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGhlYWRlcl9vZmZzZXQsIG5QYXlsb2FkLCAmblBheWxvYWQgKTsKKworICAgIGlmICggRE9UMTFGX0ZBSUxFRCggc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIHBhY2sgYSBURExTIFRlYXJkb3duIHJlcSAoMHglMDh4KS4iKSwKKyAgICAgICAgICAgICAgICBzdGF0dXMpOworICAgICAgICBwYWxQa3RGcmVlKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggdm9pZCogKSBwRnJhbWUsICggdm9pZCogKSBwUGFja2V0ICk7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgRkwoIlRoZXJlIHdlcmUgd2FybmluZ3Mgd2hpbGUgcGFja2luZyBURExTIFRlYXJkb3duIGZyYW1lICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgc3RhdHVzKTsKKyAgICB9CisjaWYgMAorICAgIGlmKHBNYWMtPmhhbC5wQ0JhY2tGblR4Q29tcCA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgcE1hYy0+aGFsLnBDQmFja0ZuVHhDb21wID0gKHRwQ0JhY2tGblR4Q29tcClsaW1UZGxzVGVhcmRvd25UeENvbXBsZXRlOworICAgICAgICBpZihUWF9TVUNDRVNTICE9IHR4X3RpbWVyX2FjdGl2YXRlKCZwTWFjLT5oYWwudHhDb21wVGltZXIpKQorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBWT1NfQVNTRVJUKDApIDsKKyAgICAgICAgcmV0dXJuIHN0YXR1cyA7CisgICAgfQorI2VuZGlmCisKKyAgICBpZiggYWRkSWVMZW4gIT0gMCApCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIkNvcHkgQWRkaXRpb25hbCBJZSBMZW4gPSAlZCIpLCBhZGRJZUxlbik7Cis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ICsgYWRkSWVMZW4gKyBNSU5fVkVORE9SX1NQRUNJRklDX0lFX1NJWkUsCisgICAgICAgICAgICAgICAgICAgICAgICAgcGFkTGVuIC0gTUlOX1ZFTkRPUl9TUEVDSUZJQ19JRV9TSVpFLCAwKTsKKyAgICB9CisjZW5kaWYKKyAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIltURExTXSBhY3Rpb24gJWQgKCVzKSAtJXMtPiBPVEEgcGVlcj0iTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgICAgICAgICAgU0lSX01BQ19URExTX1RFQVJET1dOLAorICAgICAgICAgICAgICAgICAgICAgICBsaW1UcmFjZVRkbHNBY3Rpb25TdHJpbmcoU0lSX01BQ19URExTX1RFQVJET1dOKSwKKyAgICAgICAgICAgICAgICAgICAgICAgKChyZWFzb24gPT0gZVNJUl9NQUNfVERMU19URUFSRE9XTl9QRUVSX1VOUkVBQ0hBQkxFKSA/CisgICAgICAgICAgICAgICAgICAgICAgICJBUCI6ICJESVJFQ1QiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocGVlck1hYykpOworCisgICAgaGFsc3RhdHVzID0gaGFsVHhGcmFtZVdpdGhUeENvbXBsZXRlKCBwTWFjLCBwUGFja2V0LCAoIHRBTklfVTE2ICkgbkJ5dGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTF9UWFJYX0ZSTV84MDJfMTFfREFUQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTklfVFhESVJfVE9EUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBUSURfQUNfVkksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltVHhDb21wbGV0ZSwgcEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbU1nbXRUWENvbXBsZXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTF9VU0VfQkRfUkFURTJfRk9SX01BTkFHRU1FTlRfRlJBTUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLnR4QmRUb2tlbisrKTsKKyAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTICggaGFsc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgcE1hYy0+bGltLm1nbXRGcmFtZVNlc3Npb25JZCA9IDB4ZmY7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IHNlbmQgVERMUyBUZWFyZG93biBmcmFtZSIpKTsKKyAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKworICAgIH0KKyAgICBwTWFjLT5saW0ubWdtdEZyYW1lU2Vzc2lvbklkID0gcHNlc3Npb25FbnRyeS0+c21lU2Vzc2lvbklkOworICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7CisKK30KKworLyoKKyAqIFNlbmQgU2V0dXAgUlNQIGZyYW1lIG9uIEFQIGxpbmsuCisgKi8KK3N0YXRpYyB0U2lyUmV0U3RhdHVzIGxpbVNlbmRUZGxzU2V0dXBSc3BGcmFtZSh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICB0U2lyTWFjQWRkciBwZWVyTWFjLCB0QU5JX1U4IGRpYWxvZywgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSwKKyAgICAgICAgICAgICAgICAgICAgZXRkbHNMaW5rU2V0dXBTdGF0dXMgc2V0dXBTdGF0dXMsIHRBTklfVTggKmFkZEllLCB0QU5JX1UxNiBhZGRJZUxlbiApCit7CisgICAgdERvdDExZlRETFNTZXR1cFJzcCAgdGRsc1NldHVwUnNwIDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgIHN0YXR1cyA9IDAgOworICAgIHRBTklfVTE2ICAgICAgICAgICAgY2FwcyA9IDAgOworICAgIHRBTklfVTMyICAgICAgICAgICAgblBheWxvYWQgPSAwIDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgIGhlYWR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U6CisgICAgICovCisgICAgdm9zX21lbV9zZXQoICggdEFOSV9VOCogKSZ0ZGxzU2V0dXBSc3AsIHNpemVvZiggdERvdDExZlRETFNTZXR1cFJzcCApLDAgKTsKKworICAgIC8qCisgICAgICogc2V0dXAgRml4ZWQgZmllbGRzLAorICAgICAqLworICAgIHRkbHNTZXR1cFJzcC5DYXRlZ29yeS5jYXRlZ29yeSA9IFNJUl9NQUNfQUNUSU9OX1RETFM7CisgICAgdGRsc1NldHVwUnNwLkFjdGlvbi5hY3Rpb24gICAgID0gU0lSX01BQ19URExTX1NFVFVQX1JTUCA7CisgICAgdGRsc1NldHVwUnNwLkRpYWxvZ1Rva2VuLnRva2VuID0gZGlhbG9nOworCisgICAgUG9wdWxhdGVEb3QxMWZMaW5rSWRlbiggcE1hYywgcHNlc3Npb25FbnRyeSwgJnRkbHNTZXR1cFJzcC5MaW5rSWRlbnRpZmllciwKKyAgICAgICAgICAgICAgICAgcGVlck1hYywgVERMU19SRVNQT05ERVIpIDsKKworICAgIGlmIChjZmdHZXRDYXBhYmlsaXR5SW5mbyhwTWFjLCAmY2FwcywgcHNlc3Npb25FbnRyeSkgIT0gZVNJUl9TVUNDRVNTKQorICAgIHsKKyAgICAgICAgLyoKKyAgICAgICAgICogQ291bGQgbm90IGdldCBDYXBhYmlsaXRpZXMgdmFsdWUKKyAgICAgICAgICogZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgICovCisgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBDYXBhYmlsaXRpZXMgdmFsdWUiKSk7CisgICAgfQorCisgICAgcENhcEluZm8gPSAodHBTaXJNYWNDYXBhYmlsaXR5SW5mbykgJmNhcHM7CisgICAgLyogRXhwb3J0IFFvUyBjYXBhYmlsaXR5ICovCisgICAgcENhcEluZm8tPnFvcyA9IDE7CisKKyAgICBzd2FwQml0RmllbGQxNihjYXBzLCAoIHRBTklfVTE2KiApJnRkbHNTZXR1cFJzcC5DYXBhYmlsaXRpZXMgKTsKKworICAgIC8qIHBvcHVsYXRlIHN1cHBvcnRlZCByYXRlIGFuZCBleHQgc3VwcG9ydGVkIHJhdGUgSUUgKi8KKyAgICBQb3B1bGF0ZURvdDExZlJhdGVzVGRscyhwTWFjLCAmdGRsc1NldHVwUnNwLlN1cHBSYXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnRkbHNTZXR1cFJzcC5FeHRTdXBwUmF0ZXMpOworCisgICAgLyogUG9wdWxhdGUgZXh0ZW5kZWQgY2FwYWJpbGl0eSBJRSAqLworICAgIFBvcHVsYXRlRG90MTFmVGRsc0V4dENhcGFiaWxpdHkoIHBNYWMsICZ0ZGxzU2V0dXBSc3AuRXh0Q2FwICk7CisKKyAgICBpZiAoIDEgPT0gcE1hYy0+bGltLmdMaW1URExTV21tTW9kZSApCisgICAgeworICAgICAgICB0QU5JX1UzMiAgdmFsID0gMDsKKworICAgICAgICAvKiBpbmNsdWRlIFdNTSBJRSAqLworICAgICAgICB0ZGxzU2V0dXBSc3AuV01NSW5mb1N0YXRpb24udmVyc2lvbiA9IFNJUl9NQUNfT1VJX1ZFUlNJT05fMTsKKyAgICAgICAgdGRsc1NldHVwUnNwLldNTUluZm9TdGF0aW9uLmFjdm9fdWFwc2QgPQorICAgICAgICAgICAgICAgICAgICAgKHBNYWMtPmxpbS5nTGltVERMU1VhcHNkTWFzayAmIDB4MDEpOworICAgICAgICB0ZGxzU2V0dXBSc3AuV01NSW5mb1N0YXRpb24uYWN2aV91YXBzZCA9CisgICAgICAgICAgICAgICAgICAgICAoKHBNYWMtPmxpbS5nTGltVERMU1VhcHNkTWFzayAmIDB4MDIpID4+IDEpOworICAgICAgICB0ZGxzU2V0dXBSc3AuV01NSW5mb1N0YXRpb24uYWNia191YXBzZCA9CisgICAgICAgICAgICAgICAgICAgICAoKHBNYWMtPmxpbS5nTGltVERMU1VhcHNkTWFzayAmIDB4MDQpID4+IDIpOworICAg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VC9WSFQgQ2FwYWJpbGl0aWVzICovCisgICAgUG9wdWxhdGVEb3QxMWZUZGxzSHRWaHRDYXAoIHBNYWMsIHNlbGZEb3QxMU1vZGUsICZ0ZGxzU2V0dXBSc3AuSFRDYXBzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdGRsc1NldHVwUnNwLlZIVENhcHMsIHBzZXNzaW9uRW50cnkgKTsKKworICAgIC8qIFBvcHVsYXRlIEFJRCAqLworICAgIFBvcHVsYXRlRG90ZlRkbHNWaHRBSUQoIHBNYWMsIHNlbGZEb3QxMU1vZGUsIHBlZXJNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnRkbHNTZXR1cFJzcC5BSUQsIHBzZXNzaW9uRW50cnkgKTsKKworICAgIGlmICggMSA9PSBwTWFjLT5saW0uZ0xpbVRETFNPZmZDaGFubmVsRW5hYmxlZCApCisgICAgICAgIFBvcHVsYXRlRG90MTFmVGRsc09mZmNoYW5uZWxQYXJhbXMoIHBNYWMsIHBzZXNzaW9uRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ0ZGxzU2V0dXBSc3AuU3VwcENoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdGRsc1NldHVwUnNwLlN1cHBPcGVyYXRpbmdDbGFzc2VzKTsKKworICAgIHRkbHNTZXR1cFJzcC5TdGF0dXMuc3RhdHVzID0gc2V0dXBTdGF0dXMgOworCisgICAgaWYgKFRSVUUgPT0gcE1hYy0+bGltLkVuYWJsZVRkbHMyMDQwQlNTQ29leElFKQorICAgIHsKKyAgICAgICAgaWYgKCAxID09IHBNYWMtPmxpbS5nTGltVERMU09mZkNoYW5uZWxFbmFibGVkICYmCisgICAgICAgICAgICAoIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uYmFuZENhcGFiaWxpdHkgIT0gZUNTUl9CQU5EXzI0KSkKKyAgICAgICAgeworICAgICAgICAgICAgdGRsc1NldHVwUnNwLkhUMjA0MEJTU0NvZXhpc3RlbmNlLnByZXNlbnQgPSAxOworICAgICAgICAgICAgdGRsc1NldHVwUnNwLkhUMjA0MEJTU0NvZXhpc3RlbmNlLmluZm9SZXF1ZXN0ID0gMTsKKyAgICAgICAgfQorICAgIH0KKyAgICAvKiAKKyAgICAgKiBub3cgd2UgcGFjayBpdC4gIEZpcnN0LCBob3cgbXVjaCBzcGFjZSBhcmUgd2UgZ29pbmcgdG8gbmVlZD8KKyAgICAgKi8KKyAgICBzdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRURExTU2V0dXBSc3BTaXplKCBwTWFjLCAmdGRsc1NldHVwUnNwLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm5QYXlsb2FkKTsKKyAgICBpZiAoIERPVDExRl9GQUlMRUQoIHN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgRkwoIkZhaWxlZCB0byBjYWxjdWxhdGUgdGhlIHBhY2tlZCBzaXplIGZvciBhIFNldHVwIFJlc3BvbnNlICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgc3RhdHVzKTsKKyAgICAgICAgLyogV2UnbGwgZmFsbCBiYWNrIG9uIHRoZSB3b3JzdCBjYXNlIHNjZW5hcmlvOiAqLworICAgICAgICBuUGF5bG9hZCA9IHNpemVvZiggdERvdDExZlByb2JlUmVxdWVzdCApOworICAgIH0KKyAgICBlbHNlIGlmICggRE9UMTFGX1dBUk5FRCggc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1csCisgICAgICAgICAgICAgICBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBjYWxjdWxhdGluZyB0aGUgcGFja2VkIHNpemUgZm9yIFNldHVwIFJlc3BvbnNlICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgc3RhdHVzKTsKKyAgICB9CisKKyAgICAvKgorICAgICAqIFRoaXMgZnJhbWUgaXMgZ29pbmcgb3V0IGZyb20gUEUgYXMgZGF0YSBmcmFtZXMgd2l0aCBzcGVjaWFsIGV0aGVydHlwZQorICAgICAqIDg5LTBkLgorICAgICAqIDggYnl0ZXMgb2YgUkZDIDEwNDIgaGVhZGVyCisgICAgICovIAorCisKKyAgICBuQnl0ZXMgPSBuUGF5bG9hZCArICgoSVNfUU9TX0VOQUJMRUQocHNlc3Npb25FbnRyeSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHNpemVvZih0U2lyTWFjRGF0YUhkcjNhKSA6IHNpemVvZih0U2lyTWFjTWdtdEhkcikpCisgICAgICAgICAgICAgICAgICAgICAgKyBzaXplb2YoIGV0aF84OTBkX2hlYWRlciApCisgICAgICAgICAgICAgICAgICAgICAgKyBQQVlMT0FEX1RZUEVfVERMU19TSVpFCisgICAgICAgICAgICAgICAgICAgICAgKyBhZGRJZUxlbjsKKworICAgIC8qIE9rLS0gdHJ5IHRvIGFsbG9jYXRlIG1lbW9yeSBmcm9tIE1HTVQgUEtUIHBvb2wgKi8KKworICAgIGhhbHN0YXR1cyA9IHBhbFBrdEFsbG9jKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggdEFOSV9VMTYgKW5CeXRlcywgKCB2b2lkKiogKSAmcEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIHZvaWQqKiApICZwUGFja2V0ICk7CisgICAgaWYgKCAhIEhBTF9TVEFUVVNfU1VDQ0VTUyAoIGhhbHN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgRkwoIkZhaWxlZCB0byBhbGxvY2F0ZSAlZCBieXRlcyBmb3IgYSBURExTIFNldHVwIFJlc3BvbnNlLiIpLAorICAgICAgICAgICAgICAgbkJ5dGVzKTsKKyAgICAgICAgcmV0dXJuIGVTSVJfTUVNX0FMTE9DX0ZBSUxFRDsKKyAgICB9CisKKyAgICAvKiB6ZXJvIG91dCB0aGUgbWVtb3J5ICovCisgICAgdm9zX21lbV9zZXQoICBwRnJhbWUsIG5CeXRlcywgMCApOworCisgICAgLyogCisgICAgICogSUUgZm9ybWF0aW9uLCBtZW1vcnkgYWxsb2NhdGlvbiBpcyBjb21wbGV0ZWQsIE5vdyBmb3JtIFRETFMgZGlzY292ZXJ5CisgICAgICogcmVxdWVzdCBmcmFtZQorICAgICAqLworCisgICAgLyogZmlsbCBvdXQgdGhlIGJ1ZmZlciBkZXNjcmlwdG9yICovCisKKyAgICBoZWFkZXJfb2Zmc2V0ID0gbGltUHJlcGFyZVRkbHNGcmFtZUhlYWRlcihwTWFjLCBwRnJhbWUsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTElOS19JREVOX0FERFJfT0ZGU0VUKHRkbHNTZXR1cFJzcCksIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVERMU19MSU5LX0FQLCBURExTX1JFU1BPTkRFUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRJRF9BQ19WSSwgcHNlc3Npb25FbnRyeSkgOworCisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFNfTkVHQVRJVkUKKyAgICBpZihwTWFjLT5saW0uZ0xpbVRkbHNOZWdhdGl2ZUJlaGF2aW9yICYgTElNX1RETFNfTkVHQVRJVkVfV1JPTkdfQlNTSURfSU5fU0VUVVBfUlNQKQorICAgIHsKKyAgICAgICAgdGRsc1NldHVwUnNwLkxpbmtJZGVudGlmaWVyLmJzc2lkWzRdID0gMHhkZTsKKyAgICAgICAgdGRsc1NldHVwUnNwLkxpbmtJZGVudGlmaWVyLmJzc2lkWzVdID0gMHhhZDsgCisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0l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wKKyAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocGVlck1hYykpOworCisgICAgaGFsc3RhdHVzID0gaGFsVHhGcmFtZVdpdGhUeENvbXBsZXRlKCBwTWFjLCBwUGFja2V0LCAoIHRBTklfVTE2ICkgbkJ5dGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTF9UWFJYX0ZSTV84MDJfMTFfREFUQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTklfVFhESVJfVE9EUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0FOSV9UWERJUl9JQlNTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRJRF9BQ19WSSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1UeENvbXBsZXRlLCBwRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltTWdtdFRYQ29tcGxldGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEFMX1VTRV9CRF9SQVRFMl9GT1JfTUFOQUdFTUVOVF9GUkFNRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0udHhCZFRva2VuKyspOworICAgIGlmICggISBIQUxfU1RBVFVTX1NVQ0NFU1MgKCBoYWxzdGF0dXMgKSApCisgICAgeworICAgICAgICBwTWFjLT5saW0ubWdtdEZyYW1lU2Vzc2lvbklkID0gMHhmZjsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJjb3VsZCBub3Qgc2VuZCBURExTIFNldHVwIFJlc3BvbnNlIikpOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKyAgICBwTWFjLT5saW0ubWdtdEZyYW1lU2Vzc2lvbklkID0gcHNlc3Npb25FbnRyeS0+c21lU2Vzc2lvbklkOworCisgICAgcmV0dXJuIGVTSVJfU1VDQ0VTUzsKKworfQorCisvKgorICogU2VuZCBURExTIHNldHVwIENORiBmcmFtZSBvbiBBUCBsaW5rCisgK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LmJhbmRDYXBhYmlsaXR5ICE9IGVDU1JfQkFORF8yNCkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHRkbHNTZXR1cENuZi5IVDIwNDBCU1NDb2V4aXN0ZW5jZS5wcmVzZW50ID0gMTsKKyAgICAgICAgICAgIHRkbHNTZXR1cENuZi5IVDIwNDBCU1NDb2V4aXN0ZW5jZS5pbmZvUmVxdWVzdCA9IDE7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKiAKKyAgICAgKiBub3cgd2UgcGFjayBpdC4gIEZpcnN0LCBob3cgbXVjaCBzcGFjZSBhcmUgd2UgZ29pbmcgdG8gbmVlZD8KKyAgICAgKi8KKyAgICBzdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRURExTU2V0dXBDbmZTaXplKCBwTWFjLCAmdGRsc1NldHVwQ25mLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm5QYXlsb2FkKTsKKyAgICBpZiAoIERPVDExRl9GQUlMRUQoIHN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgRkwoIkZhaWxlZCB0byBjYWxjdWxhdGUgdGhlIHBhY2tlZCBzaXplIGZvciBTZXR1cCBDb25maXJtICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgc3RhdHVzKTsKKyAgICAgICAgLyogV2UnbGwgZmFsbCBiYWNrIG9uIHRoZSB3b3JzdCBjYXNlIHNjZW5hcmlvOiAqLworICAgICAgICBuUGF5bG9hZCA9IHNpemVvZiggdERvdDExZlByb2JlUmVxdWVzdCApOworICAgIH0KKyAgICBlbHNlIGlmICggRE9UMTFGX1dBUk5FRCggc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1csCisgICAgICAgICAgICAgICBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBjYWxjdWxhdGluZyB0aGUgcGFja2VkIHNpemUgZm9yIFNldHVwIENvbmZpcm0gKDB4JTA4eCkuIiksCisgICAgICAgICAgICAgICBzdGF0dXMpOworICAgIH0KKworICAgIC8qCisgICAgICogVGhpcyBmcmFtZSBpcyBnb2luZyBvdXQgZnJvbSBQRSBhcyBkYXRhIGZyYW1lcyB3aXRoIHNwZWNpYWwgZXRoZXJ0eXBlCisgICAgICogODktMGQuCisgICAgICogOCBieXRlcyBvZiBSRkMgMTA0MiBoZWFkZXIKKyAgICAgKi8gCisKKworICAgIG5CeXRlcyA9IG5QYXlsb2FkICsgKChJU19RT1NfRU5BQkxFRChwc2Vzc2lvbkVudHJ5KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gc2l6ZW9mKHRTaXJNYWNEYXRhSGRyM2EpIDogc2l6ZW9mKHRTaXJNYWNNZ210SGRyKSkKKyAgICAgICAgICAgICAgICAgICAgICArIHNpemVvZiggZXRoXzg5MGRfaGVhZGVyICkKKyAgICAgICAgICAgICAgICAgICAgICArIFBBWUxPQURfVFlQRV9URExTX1NJWkUKKyAgICAgICAgICAgICAgICAgICAgICArIGFkZEllTGVuOworCisjaWZuZGVmIE5PX1BBRF9URExTX01JTl84MDIzX1NJWkUKKyAgICAvKiBJT1QgaXNzdWUgd2l0aCBzb21lIEFQIDogc29tZSBBUCBkb2Vzbid0IGxpa2UgdGhlIGRhdGEgcGFja2V0IHNpemUgPCBtaW5pbXVtIDgwMi4zIGZyYW1lIGxlbmd0aCAoNjQpCisgICAgICAgSGVuY2UgQVAgaXRzZWxmIHBhZGRpbmcgc29tZSBieXRlcywgd2hpY2ggY2F1c2VkIHRlYXJkb3duIHBhY2tldCBpcyBkcm9wcGVkIGF0CisgICAgICAgcmVjZWl2ZXIgc2lkZS4gVG8gYXZvaWQgc3VjaCBJT1QgaXNzdWUsIHdlIGFkZGVkIHNvbWUgZXh0cmEgYnl0ZXMgdG8gbWVldCBkYXRhIGZyYW1lIHNpemUgPj0gNjQKKyAgICAgKi8KKyAgICBpZiAoblBheWxvYWQgKyBQQVlMT0FEX1RZUEVfVERMU19TSVpFIDwgTUlOX0lFRUVfODAyM19TSVpFKQorICAgIHsKKyAgICAgICAgcGFkTGVuID0gTUlOX0lFRUVfODAyM19TSVpFIC0gKG5QYXlsb2FkICsgUEFZTE9BRF9UWVBFX1RETFNfU0laRSApIDsKKworICAgICAgICAvKiBpZiBwYWRMZW4gaXMgbGVzcyB0aGFuIG1pbmltdW0gdmVuZG9yU3BlY2lmaWMgKDUpLCBwYWQgdXAgdG8gNSAqLworICAgICAgICBpZiAocGFkTGVuIDwgTUlOX1ZFTkRPUl9TUEVDSUZJQ19JRV9TSVpFKQorICAgICAgICAgICAgcGFkTGVuID0gTUlOX1ZFTkRPUl9TUEVDSUZJQ19JRV9TSVpFOworCisgICAgICAgIG5CeXRlcyArPSBwYWRMZW47CisgICAgfQorI2VuZGlmCisKKworICAgIC8qIE9rLS0gdHJ5IHRvIGFsbG9jYXRlIG1lbW9yeSBmcm9tIE1HTVQgUEtUIHBvb2wgKi8KKworICAgIGhhbHN0YXR1cyA9IHBhbFBrdEFsbG9jKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggdEFOSV9VMTYgKW5CeXRlcywgKCB2b2lkKiogKSAmcEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIHZvaWQqKiApICZwUGFja2V0ICk7CisgICAgaWYgKCAhIEhBTF9TVEFUVVNfU1VDQ0VTUyAoIGhhbHN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgRkwoIkZhaWxlZCB0byBhbGxvY2F0ZSAlZCBieXRlcyBmb3IgYSBURExTIFNldHVwIENvbmZpcm0uIiksCisgICAgICAgICAgICAgICBuQnl0ZXMpOworICAgICAgICByZXR1cm4gZVNJUl9NRU1fQUxMT0NfRkFJT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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgaGVhZGVyX29mZnNldCwgblBheWxvYWQsICZuUGF5bG9hZCApOworCisgICAgaWYgKCBET1QxMUZfRkFJTEVEKCBzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgIEZMKCJGYWlsZWQgdG8gcGFjayBhIFRETFMgU2V0dXAgQ29uZmlybSAoMHglMDh4KS4iKSwKKyAgICAgICAgICAgICAgIHN0YXR1cyk7CisgICAgICAgIHBhbFBrdEZyZWUoIHBNYWMtPmhIZGQsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggdm9pZCogKSBwRnJhbWUsICggdm9pZCogKSBwUGFja2V0ICk7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgICAgIEZMKCJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIHBhY2tpbmcgVERMUyBTZXR1cCBDb25maXJtICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgc3RhdHVzKTsKKyAgICB9CisjaWYgMAorICAgIGlmKHBNYWMtPmhhbC5wQ0JhY2tGblR4Q29tcCA9PSBOVUxMKSAKKyAgICB7CisgICAgICAgIHBNYWMtPmhhbC5wQ0JhY2tGblR4Q29tcCA9ICh0cENCYWNrRm5UeENvbXApbGltVGRsc1NldHVwQ25mVHhDb21wbGV0ZTsKKyAgICAgICAgaWYoVFhfU1VDQ0VTUyAhPSB0eF90aW1lcl9hY3RpdmF0ZSgmcE1hYy0+aGFsLnR4Q29tcFRpbWVyKSkgCisgICAgICAgIHsKKyAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICByZXR1cm4gc3RhdHVzOworICAgICAgICAgICAgICAgIAorICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIFZPU19BU1NFUlQoMCkgOworICAgICAgICByZXR1cm4gc3RhdHVzIDsKKyAgICB9CisjZW5kaWYKKyAgICAvL0NvcHkgdGhlIGFkZGl0aW9uYWwgSUUuIAorICAgIC8vVE9ETyA6IGFkZEllIGlzIGFkZGVkIGF0IHRoZSBlbmQgb2YgdGhlIGZyYW1lLiBUaGlzIG1lYW5zIGl0IGRvZXNudAorICAgIC8vZm9sbG93IHRoZSBvcmRlci4gVGhpcyBzaG91bGQgYmUgb2ssIGJ1dCB3ZSBzaG91bGQgY29uc2lkZXIgY2hhbmdpbmcgdGhpcworICAgIC8vaWYgdGhlcmUgaXMgYW55IElPVCBpc3N1ZS4KKyAgICBpZiggYWRkSWVMZW4gIT0gMCApCisgICAgeworICAgICAgIHZvc19tZW1fY29weSggcEZyYW1lICsgaGVhZGVyX29mZnNldCArIG5QYXlsb2FkLCBhZGRJZSwgYWRkSWVMZW4gKTsKKyAgICB9CisKKyNpZm5kZWYgTk9fUEFEX1RETFNfTUlOXzgwMjNfU0laRQorICAgIGlmIChwYWRMZW4gIT0gMCkKKyAgICB7CisgICAgICAgIC8qIFFDT00gVkVORE9SIE9VSSA9IHsgMHgwMCwgMHhBMCwgMHhDNiwgdHlwZSA9IDB4MDAwMCB9OyAqLworICAgICAgICB0QU5JX1U4ICpwYWRWZW5kb3JTcGVjaWZpYyA9IHBGcmFtZSArIGhlYWRlcl9vZmZzZXQgKyBuUGF5bG9hZCArIGFkZEllTGVuOworICAgICAgICAvKiBtYWtlIFFDT01fVkVORE9SX09VSSwgYW5kIHR5cGUgPSAweDAwMDAsIGFuZCBhbGwgdGhlIHBheWxvYWQgdG8gYmUgemVybyAqLworICAgICAgICBwYWRWZW5kb3JTcGVjaWZpY1swXSA9IDIyMTsKKyAgICAgICAgcGFkVmVuZG9yU3BlY2lmaWNbMV0gPSBwYWRMZW4gLSAyOworICAgICAgICBwYWRWZW5kb3JTcGVjaWZpY1syXSA9IDB4MDA7CisgICAgICAgIHBhZFZlbmRvclNwZWNpZmljWzNdID0gMHhBMDsKKyAgICAgICAgcGFkVmVuZG9yU3BlY2lmaWNbNF0gPSAweEM2OworCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiUGFkZGluZyBWZW5kb3IgU3BlY2lmaWMgSWUgTGVuID0gJWQiKSwgcGFkTGVuKTsKKworICAgICAgICAvKiBwYWRkaW5nIHplcm8gaWYgbW9yZSB0aGFuIDUgYnl0ZXMgYXJlIHJlcXVpcmVkICovCisgICAgICAgIGlmIChwYWRMZW4gPiBNSU5fVkVORE9SX1NQRUNJRklDX0lFX1NJWkUpCisgICAgICAgICAgICB2b3NfbWVtX3NldCggcEZyYW1lICsgaGVhZGVyX29mZnNldCArIG5QYXlsb2FkICsgYWRkSWVMZW4gKyBNSU5fVkVORE9SX1NQRUNJRklDX0lFX1NJWkUsCisgICAgICAgICAgICAgICAgICAgICAgICAgcGFkTGVuIC0gTUlOX1ZFTkRPUl9TUEVDSUZJQ19JRV9TSVpFLCAwKTsKKyAgICB9CisjZW5kaWYKKworCisgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgIEZMKCJbVERMU10gYWN0aW9uICVkICglcykgLUFQLT4gT1RBIHBlZXI9Ik1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgIFNJUl9NQUNfVERMU19TRVRVUF9DTkYsCisgICAgICAgICAgIGxpbVRyYWNlVGRsc0FjdGlvblN0cmluZyhTSVJfTUFDX1RETFNfU0VUVVBfQ05GKSwKKyAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocGVlck1hYykpOworCisgICAgaGFsc3RhdHVzID0gaGFsVHhGcmFtZVdpdGhUeENvbXBsZXRlKCBwTWFjLCBwUGFja2V0LCAoIHRBTklfVTE2ICkgbkJ5dGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTF9UWFJYX0ZSTV84MDJfMTFfREFUQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTklfVFhESVJfVE9EUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBUSURfQUNfVkksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltVHhDb21wbGV0ZSwgcEZyYW1lLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1NZ210VFhDb21wbGV0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBIQUxfVVNFX0JEX1JBVEUyX0ZPUl9NQU5BR0VNRU5UX0ZSQU1FLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS50eEJkVG9rZW4rKyk7CisKKworICAgIGlmICggISBIQUxfU1RBVFVTX1NVQ0NFU1MgKCBoYWxzdGF0dXMgKSApCisgICAgeworICAgICAgICBwTWFjLT5saW0ubWdtdEZyYW1lU2Vzc2lvbklkID0gMHhmZjsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJjb3VsZCBub3Qgc2VuZCBURExTIFNldHVwIENvbmZpcm0gZnJhbWUiKSk7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisKKyAgICB9CisgICAgcE1hYy0+bGltLm1nbXRGcmFtZVNlc3Npb25JZCA9IHBzZXNzaW9uRW50cnktPnNtZVNlc3Npb25JZDsKKworICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7Cit9CisKKy8qIFRoaXMgRnVuY3Rpb24gaXMgc2ltaWxhciB0byBQb3B1bGF0ZURvdDExZkhUQ2FwcywgZXhjZXB0IHRoYXQgdGhlIEhUIENhcGFiaWxpdGllcworICogYXJlIGNvbnNpZGVyZWQgZnJvbSB0aGUgQWRkU3RhUmVxIHJhdGhlciBmcm9tIHRoZSBjZmcuZGF0IGFzIGluIFBvcHVsYXRlRG90MTFmSFRDYXBzCisgKi8KK3N0YXRp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KKyAgICBwRG90MTFmLT5taW1vUG93ZXJTYXZlICAgICAgICAgICAgPSB1SFRDYXBhYmlsaXR5SW5mby5odENhcEluZm8ubWltb1Bvd2VyU2F2ZTsKKyAgICBwRG90MTFmLT5ncmVlbkZpZWxkICAgICAgICAgICAgICAgPSB1SFRDYXBhYmlsaXR5SW5mby5odENhcEluZm8uZ3JlZW5GaWVsZDsKKyAgICBwRG90MTFmLT5zaG9ydEdJMjBNSHogICAgICAgICAgICAgPSB1SFRDYXBhYmlsaXR5SW5mby5odENhcEluZm8uc2hvcnRHSTIwTUh6OworICAgIHBEb3QxMWYtPnNob3J0R0k0ME1IeiAgICAgICAgICAgICA9IHVIVENhcGFiaWxpdHlJbmZvLmh0Q2FwSW5mby5zaG9ydEdJNDBNSHo7CisgICAgcERvdDExZi0+dHhTVEJDICAgICAgICAgICAgICAgICAgID0gdUhUQ2FwYWJpbGl0eUluZm8uaHRDYXBJbmZvLnR4U1RCQzsKKyAgICBwRG90MTFmLT5yeFNUQkMgICAgICAgICAgICAgICAgICAgPSB1SFRDYXBhYmlsaXR5SW5mby5odENhcEluZm8ucnhTVEJDOworICAgIHBEb3QxMWYtPmRlbGF5ZWRCQSAgICAgICAgICAgICAgICA9IHVIVENhcGFiaWxpdHlJbmZvLmh0Q2FwSW5mby5kZWxheWVkQkE7CisgICAgcERvdDExZi0+bWF4aW1hbEFNU0RVc2l6ZSAgICAgICAgID0gdUhUQ2FwYWJpbGl0eUluZm8uaHRDYXBJbmZvLm1heGltYWxBTVNEVXNpemU7CisgICAgcERvdDExZi0+ZHNzc0Nja01vZGU0ME1IeiAgICAgICAgID0gdUhUQ2FwYWJpbGl0eUluZm8uaHRDYXBJbmZvLmRzc3NDY2tNb2RlNDBNSHo7CisgICAgcERvdDExZi0+cHNtcCAgICAgICAgICAgICAgICAgICAgID0gdUhUQ2FwYWJpbGl0eUluZm8uaHRDYXBJbmZvLnBzbXA7CisgICAgcERvdDExZi0+c3RiY0NvbnRyb2xGcmFtZS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dENTSUZlZWRiYWNrOworICAgIHBEb3QxMWYtPmFudGVubmFJbmRpY2VzRmVlZGJhY2sgICA9IHBBU0NhcGFiaWxpdHlJbmZvLT5hbnRlbm5hSW5kaWNlc0ZlZWRiYWNrOworICAgIHBEb3QxMWYtPnJ4QVMgICAgICAgICAgICAgICAgICAgICA9IHBBU0NhcGFiaWxpdHlJbmZvLT5yeEFTOworICAgIHBEb3QxMWYtPnR4U291bmRpbmdQUERVcyAgICAgICAgICA9IHBBU0NhcGFiaWxpdHlJbmZvLT50eFNvdW5kaW5nUFBEVXM7CisKKyAgICBwRG90MTFmLT5wcmVzZW50ID0gcFRkbHNBZGRTdGFSZXEtPmh0Y2FwX3ByZXNlbnQ7CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworCit9CisKK3RTaXJSZXRTdGF0dXMKK2xpbVRkbHNQb3B1bGF0ZURvdDExZlZIVENhcHModHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICB0U2lyVGRsc0FkZFN0YVJlcSAqcFRkbHNBZGRTdGFSZXEsCisgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFVkhUQ2FwcyAgKnBEb3QxMWYpCit7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgbkNmZ1ZhbHVlPTA7CisgICAgdW5pb24geworICAgICAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICAgICAgICAgbkNmZ1ZhbHVlMzI7CisgICAgICAgIHRTaXJNYWNWSFRDYXBhYmlsaXR5SW5mbyAgICAgICB2aHRDYXBJbmZvOworICAgIH0gdVZIVENhcGFiaWxpdHlJbmZvOworICAgIHVuaW9uIHsKKyAgICAgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgICAgICAgIG5DZmdWYWx1ZTE2OworICAgICAgICB0U2lyTWFjVkhUVHhTdXBEYXRhUmF0ZUluZm8gICAgdmh0VHhTdXBEYXRhUmF0ZUluZm87CisgICAgICAgIHRTaXJNYWNWSFRSeFN1c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XR1cm4gZVNJUl9TVUNDRVNTOworCit9CisKK3N0YXRpYyB0U2lyUmV0U3RhdHVzCitsaW1UZGxzUG9wdWxhdGVNYXRjaGluZ1JhdGVTZXQodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwRHBoSGFzaE5vZGUgcFN0YURzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcFN1cHBvcnRlZFJhdGVTZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IHN1cHBvcnRlUmF0ZXNMZW5ndGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4KiBwU3VwcG9ydGVkTUNTU2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY1Byb3BSYXRlU2V0ICpwQW5pTGVnUmF0ZVNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uICBwc2Vzc2lvbkVudHJ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFVkhUQ2FwcyAqcFZIVENhcHMpCisKK3sKKyAgICB0U2lyTWFjUmF0ZVNldCAgICB0ZW1wUmF0ZVNldDsKKyAgICB0QU5JX1UzMiAgICAgICAgICBpLGosdmFsLG1pbixpc0FyYXRlOworICAgIHRTaXJNYWNSYXRlU2V0ICAgIHRlbXBSYXRlU2V0MjsKKyAgICB0QU5JX1UzMiBwaHlNb2RlOworICAgIHRBTklfVTggbWNzU2V0W1NJWkVfT0ZfU1VQUE9SVEVEX01DU19TRVRdOworICAgIGlzQXJhdGU9MDsKKyAgICB0ZW1wUmF0ZVNldDIubnVtUmF0ZXMgPSAwOworCisgICAgLy8gbGltR2V0UGh5TW9kZShwTWFjLCAmcGh5TW9kZSk7CisgICAgbGltR2V0UGh5TW9kZShwTWFjLCAmcGh5TW9kZSwgTlVMTCk7CisKKyAgICAvLyBnZXQgb3duIHJhdGUgc2V0CisgICAgdmFsID0gV05JX0NGR19PUEVSQVRJT05BTF9SQVRFX1NFVF9MRU47CisgICAgaWYgKHdsYW5fY2ZnR2V0U3RyKHBNYWMsIFdOSV9DRkdfT1BFUkFUSU9OQUxfUkFURV9TRVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSAmdGVtcFJhdGVTZXQucmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ2YWwpICE9IGVTSVJfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIC8vLyBDb3VsZCBub3QgZ2V0IHJhdGVzZXQgZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgcmF0ZXNldCIpKTsKKyAgICAgICAgdmFsID0gMDsKKyAgICB9CisgICAgdGVtcFJhdGVTZXQubnVtUmF0ZXMgPSB2YWw7CisKKyAgICBpZiAocGh5TW9kZSA9PSBXTklfQ0ZHX1BIWV9NT0RFXzExRykKKyAgICB7CisKKyAgICAgICAgLy8gZ2V0IG93biBleHRlbmRlZCByYXRlIHNldAorICAgICAgICB2YWwgPSBXTklfQ0ZHX0VYVEVOREVEX09QRVJBVElPTkFMX1JBVEVfU0VUX0xFTjsKKyAgICAgICAgaWYgKHdsYW5fY2ZnR2V0U3RyKHBNYWMsIFdOSV9DRkdfRVhURU5ERURfT1BFUkFUSU9OQUxfUkFURV9TRVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopICZ0ZW1wUmF0ZVNldDIucmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnZhbCkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICB0ZW1wUmF0ZVNldDIubnVtUmF0ZXMgPSB2YWw7CisgICAgfQorCisgICAgaWYgK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NJUl9NQUNfUkFURVNFVF9FSURfTUFYOworICAgIH0KKyAgICBmb3IgKGkgPSAwOyBpIDwgc3VwcG9ydGVSYXRlc0xlbmd0aDsgaSsrKQorICAgIHsKKyAgICAgICAgdGVtcFJhdGVTZXQucmF0ZVtpXSA9IHBTdXBwb3J0ZWRSYXRlU2V0W2ldOworICAgIH0KKyAgICB0ZW1wUmF0ZVNldC5udW1SYXRlcyA9IHN1cHBvcnRlUmF0ZXNMZW5ndGg7CisKKyAgICB7CisgICAgICAgIHRwU2lyU3VwcG9ydGVkUmF0ZXMgIHJhdGVzID0gJnBTdGFEcy0+c3VwcG9ydGVkUmF0ZXM7CisgICAgICAgIHRBTklfVTggYVJhdGVJbmRleCA9IDA7CisgICAgICAgIHRBTklfVTggYlJhdGVJbmRleCA9IDA7CisgICAgICAgIHZvc19tZW1fc2V0KCAodEFOSV9VOCAqKSByYXRlcywgc2l6ZW9mKHRTaXJTdXBwb3J0ZWRSYXRlcyksIDApOworCisgICAgICAgIGZvciAoaSA9IDA7aSA8IHRlbXBSYXRlU2V0Mi5udW1SYXRlczsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICBmb3IgKGogPSAwO2ogPCB0ZW1wUmF0ZVNldC5udW1SYXRlczsgaisrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICgodGVtcFJhdGVTZXQyLnJhdGVbaV0gJiAweDdGKSA9PQorICAgICAgICAgICAgICAgICAgICAgICAgKHRlbXBSYXRlU2V0LnJhdGVbal0gJiAweDdGKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChzaXJJc0FyYXRlKHRlbXBSYXRlU2V0Mi5yYXRlW2ldICYgMHg3ZikpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlzQXJhdGU9MTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhUmF0ZUluZGV4IDwgU0lSX05VTV8xMUFfUkFURVMpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmF0ZXMtPmxsYVJhdGVzW2FSYXRlSW5kZXgrK10gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wUmF0ZVNldDIucmF0ZVtpXTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChiUmF0ZUluZGV4IDwgU0lSX05VTV8xMUJfUkFURVMpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmF0ZXMtPmxsYlJhdGVzW2JSYXRlSW5kZXgrK10gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wUmF0ZVNldDIucmF0ZVtpXTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKworICAgIC8vY29tcHV0ZSB0aGUgbWF0Y2hpbmcgTUNTIHJhdGUgc2V0LCBpZiBwZWVyIGlzIDExbiBjYXBhYmxlIGFuZCBzZWxmIG1vZGUgaXMgMTFuCisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICBpZiAocFN0YURzLT5tbG1TdGFDb250ZXh0Lmh0Q2FwYWJpbGl0eSkKKyNlbHNlCisgICAgaWYgKElTX0RPVDExX01PREVfSFQocHNlc3Npb25FbnRyeS0+ZG90MTFtb2RlKSAmJgorICAgICAgIChwU3RhRHMtPm1sbVN0YUNvbnRleHQuaHRDYXBhYmlsaXR5KSkKKyNlbmRpZgorICAgIHsKKyAgICAgICAgdmFsID0gU0laRV9PRl9TVVBQT1JURURfTUNTX1NFVDsKKyAgICAgICAgaWYgKHdsYW5fY2ZnR2V0U3RyKHBNYWMsIFdOSV9DRkdfU1VQUE9SVEVEX01DU19TRVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBtY3NTZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmdmFsKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vLyBDb3VsZCBub3QgZ2V0IHJhdGVzZXQgZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiY291bGQgbm90IHJldHJpZXZlIHN1cHBvcnRlZE1DU1NldCIpKTsKKyAgICAgICAgICAgIGdvdG8gZXJyb3I7CisgICAgICAgIH0KKworICAgICAgICBmb3IgKGk9MDsgaTx2YWw7IGkrKykKKyAgICAgICAgICAgIHBTdGFEcy0+c3VwcG9ydGVkUmF0ZXMuc3VwcG9ydGVkTUNTU2V0W2ldID0gbWNzU2V0W2ldICYgcFN1cHBvcnRlZE1DU1NldFtpXTsKKworICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIk1DUyBSYXRlIFNldCBCaXRtYXAgZnJvbSBDRkcgYW5kIERQSDoiKSk7CisgICAgICAgIGZvciAoaT0wOyBpPFNJUl9NQUNfTUFYX1NVUFBPUlRFRF9NQ1NfU0VUOyBpKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiJXggJXgiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY3NTZXRbaV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5zdXBwb3J0ZWRSYXRlcy5zdXBwb3J0ZWRNQ1NTZXRbaV0pOworICAgICAgICB9CisgICAgfQorCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExQUMKKyAgICBsaW1Qb3B1bGF0ZVZodE1jc1NldChwTWFjLCAmcFN0YURzLT5zdXBwb3J0ZWRSYXRlcywgcFZIVENhcHMsIHBzZXNzaW9uRW50cnkpOworI2VuZGlmCisgICAgLyoqCisgICAgICAgICAqIFNldCB0aGUgZXJw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IQU5ORUxfMjBNSFpfSElHSF80ME1IWl9MT1cgLSAxOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKCBjaGFubmVsID09IDQ0IHx8IGNoYW5uZWwgPT0gNjAgfHwgY2hhbm5lbCA9PSAxMDggfHwKKyAgICAgICAgICAgICAgICAgIGNoYW5uZWwgPT0gMTI0IHx8IGNoYW5uZWwgPT0gMTU3ICkKKyAgICAgICAgeworICAgICAgICAgICByZXR1cm4gUEhZX1FVQURSVVBMRV9DSEFOTkVMXzIwTUhaX0xPV180ME1IWl9ISUdIIC0xOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKCBjaGFubmVsID09IDQ4IHx8IGNoYW5uZWwgPT0gNjQgfHwgY2hhbm5lbCA9PSAxMTIgfHwKKyAgICAgICAgICAgICBjaGFubmVsID09IDEyOCB8fCBjaGFubmVsID09IDE2MSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHJldHVybiBQSFlfUVVBRFJVUExFX0NIQU5ORUxfMjBNSFpfSElHSF80ME1IWl9ISUdIIC0gMTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmICggY2hhbm5lbCA9PSAxNjUgKQorICAgICAgICB7CisgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmICggcFN0YURzLT5tbG1TdGFDb250ZXh0Lmh0Q2FwYWJpbGl0eSApCisgICAgeworICAgICAgICBpZiAoIGNoYW5uZWw9PSA0MCB8fCBjaGFubmVsID09IDQ4IHx8IGNoYW5uZWwgPT0gNTYgfHwKKyAgICAgICAgICAgICBjaGFubmVsID09IDY0IHx8IGNoYW5uZWwgPT0gMTA0IHx8IGNoYW5uZWwgPT0gMTEyIHx8CisgICAgICAgICAgICAgY2hhbm5lbCA9PSAxMjAgfHwgY2hhbm5lbCA9PSAxMjggfHwgY2hhbm5lbCA9PSAxMzYgfHwKKyAgICAgICAgICAgICBjaGFubmVsID09IDE0NCB8fCBjaGFubmVsID09IDE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aW5rTW9kZSA9IFRETFNfTElOS19NT0RFX04gOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBwU3RhRHMtPm1sbVN0YUNvbnRleHQuaHRDYXBhYmlsaXR5ID0gMCA7CisgICAgICAgIHBNYWMtPmxpbS5nTGltVGRsc0xpbmtNb2RlID0gVERMU19MSU5LX01PREVfQkcgOworICAgIH0KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgIGxpbVRkbHNQb3B1bGF0ZURvdDExZlZIVENhcHMocE1hYywgcFRkbHNBZGRTdGFSZXEsICZ2aHRDYXApOworICAgIHBWaHRDYXBzID0gJnZodENhcDsKKyAgICBpZiAocFZodENhcHMtPnByZXNlbnQpCisgICAgeworICAgICAgICBwU3RhRHMtPm1sbVN0YUNvbnRleHQudmh0Q2FwYWJpbGl0eSA9IDEgOworCisgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwgPD0gU0lSXzExQl9DSEFOTkVMX0VORCkKKyAgICAgICAgeworICAgICAgICAgICAgLyogaWYgdGhlIGNoYW5uZWwgaXMgMkcgdGhlbiB1cGRhdGUgdGhlIG1pbiBjaGFubmVsIHdpZHRoc2V0IGluCisgICAgICAgICAgICAgKiBwU3RhRHMuIFRoZXNlIHZhbHVlcyBhcmUgdXNlZCB3aGVuIHNlbmRpbmcgYSBBZGRTdGEgcmVxdWVzdCB0bworICAgICAgICAgICAgICogZmlybXdhcmUKKyAgICAgICAgICAgICAqIDExLjIxLjEgR2VuZXJhbDogVGhlIGNoYW5uZWwgd2lkdGggb2YgdGhlIFRETFMgZGlyZWN0IGxpbmsgb24gdGhlCisgICAgICAgICAgICAgKiBiYXNlIGNoYW5uZWwgc2hhbGwgbm90IGV4Y2VlZCB0aGUgY2hhbm5lbCB3aWR0aCBvZiB0aGUgQlNTIHRvIHdoaWNoCisgICAgICAgICAgICAgKiB0aGUgVERMUyBwZWVyIFNUQXMgYXJlIGFzc29jaWF0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FRkbHNBZGRTdGFSZXEtPmh0Y2FwX3ByZXNlbnQ7CisgICAgcFN0YURzLT53bWVFbmFibGVkID0gMTsKKyAgICBwU3RhRHMtPmxsZUVuYWJsZWQgPSAwOworICAgIC8qICBURExTIER1bW15IEFkZFNUQSBkb2VzIG5vdCBoYXZlIHFvc0luZm8gLCBpcyBpdCBPSyA/PworICAgICAqLworICAgIHBTdGFEcy0+cW9zLmNhcGFiaWxpdHkucW9zSW5mbyA9ICgqKHRTaXJNYWNRb3NJbmZvU3RhdGlvbiAqKSAmcFRkbHNBZGRTdGFSZXEtPnVhcHNkX3F1ZXVlcyk7CisKKyAgICAvKiBwb3B1bGF0ZSBtYXRjaGluZyByYXRlIHNldCAqLworCisgICAgLyogVERMUyBEdW1teSBBZGRTVEEgZG9lcyBub3QgaGF2ZSBIVENhcCxWSFRDYXAsUmF0ZXMgaW5mbyAsIGlzIGl0IE9LID8/CisgICAgICovCisgICAgbGltVGRsc1BvcHVsYXRlTWF0Y2hpbmdSYXRlU2V0KHBNYWMsIHBTdGFEcywgcFRkbHNBZGRTdGFSZXEtPnN1cHBvcnRlZF9yYXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRkbHNBZGRTdGFSZXEtPnN1cHBvcnRlZF9yYXRlc19sZW5ndGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopcFRkbHNBZGRTdGFSZXEtPmh0Q2FwLnN1cHBNY3NTZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwU3RhRHMtPm1sbVN0YUNvbnRleHQucHJvcFJhdGVTZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnksIHBWaHRDYXBzKTsKKworICAgIC8qICBURExTIER1bW15IEFkZFNUQSBkb2VzIG5vdCBoYXZlIHJpZ2h0IGNhcGFiaWxpdHkgLCBpcyBpdCBPSyA/PworICAgICAqLworICAgIHBTdGFEcy0+bWxtU3RhQ29udGV4dC5jYXBhYmlsaXR5SW5mbyA9ICggKih0U2lyTWFjQ2FwYWJpbGl0eUluZm8gKikgJnBUZGxzQWRkU3RhUmVxLT5jYXBhYmlsaXR5KTsKKworICAgIHJldHVybiA7IAorfQorCisvKgorICogQWRkIFNUQSBmb3IgVERMUyBzZXR1cCBwcm9jZWR1cmUKKyAqLworc3RhdGljIHRTaXJSZXRTdGF0dXMgbGltVGRsc1NldHVwQWRkU3RhKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpclRkbHNBZGRTdGFSZXEgKnBBZGRTdGFSZXEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSkKK3sKKyAgICB0cERwaEhhc2hOb2RlIHBTdGFEcyA9IE5VTEwgOworICAgIHRTaXJSZXRTdGF0dXMgc3RhdHVzID0gZVNJUl9TVUNDRVNTIDsKKyAgICB0QU5JX1UxNiBhaWQgPSAwIDsKKworICAgIHBTdGFEcyA9IGRwaExvb2t1cEhhc2hFbnRyeShwTWFjLCBwQWRkU3RhUmVxLT5wZWVyTWFjLCAmYWlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcHNlc3Npb25FbnRyeS0+ZHBoLmRwaEhhc2hUYWJsZSk7CisgICAgaWYoTlVMTCA9PSBwU3RhRHMpCisgICAgeworICAgICAgICBhaWQgPSBsaW1Bc3NpZ25QZWVySWR4KHBNYWMsIHBzZXNzaW9uRW50cnkpIDsKKworICAgICAgICBpZiggIWFpZCApCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiTm8gbW9yZSBmcmVlIEFJRCBmb3IgcGVlciAiIE1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEFkZFN0YVJlcS0+cGVlck1hYykpOworICAgICAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICAgICAgfQorCisgICAgICAgIC8qIFNldCB0aGUgYWlkIGluIHBlZXJBSURCaXRtYXAgYXMgaXQgaGFzIGJlZW4gYXNzaWduZWQgdG8gVERMUyBwZWVyICovCisgICAgICAgIFNFVF9QRUVSX0FJRF9CSVRNQVAocHNlc3Npb25FbnRyeS0+cGVlckFJREJpdG1hcCwgYWlkKTsKKworICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIkFpZCA9ICVkLCBmb3IgcGVlciA9IiBNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgYWlkLCBNQUNfQUREUl9BUlJBWShwQWRkU3RhUmVxLT5wZWVyTWFjKSk7CisgICAgICAgIHBTdGFEcyA9IGRwaEdldEhhc2hFbnRyeShwTWFjLCBhaWQsICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsKKworICAgICAgICBpZiAocFN0YURzKQorICAgICAgICB7CisgICAgICAgICAgICAodm9pZCkgbGltRGVsU3RhKHBNYWMsIHBTdGFEcywgZmFsc2UgLyphc3luY2hyb25vdXMqLywgcHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICBsaW1EZWxldGVEcGhIYXNoRW50cnkocE1hYywgcFN0YURzLT5zdGFBZGRyLCBhaWQsIHBzZXNzaW9uRW50cnkpOworICAgICAgICB9CisKKyAgICAgICAgcFN0YURzID0gZHBoQWRkSGFzaEVudHJ5KHBNYWMsIHBBZGRTdGFSZXEtPnBlZXJNYWMsIGFpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKSA7CisKKyAgICAgICAgaWYoTlVMTCA9PSBwU3RhRHMpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiYWRkIGhhc2ggZW50cnkgZmFpbGVkIikpOworICAgICAgICAgICAgVk9TX0FTU0VSVCgwKSA7CisgICAgICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgICAgICB9CisgICAgfQorCisgICAgbGltVGRsc1VwZGF0ZUhhc2hOb2RlSW5mbyhwTWFjLCBwU3RhRHMsIHBBZGRTdGFSZXEsIHBzZXNzaW9uRW50cnkpIDsKKworICAgIHBTdGFEcy0+c3RhVHlwZSA9IFNUQV9FTlRSWV9URExTX1BFRVIgOworCisgICAgc3RhdHVzID0gbGltQWRkU3RhKHBNYWMsIHBTdGFEcywgKHBBZGRTdGFSZXEtPnRkbHNBZGRPcGVyID09IFRETFNfT1BFUl9VUERBVEUpID8gdHJ1ZTogZmFsc2UsIHBzZXNzaW9uRW50cnkpOworCisgICAgaWYoZVNJUl9TVUNDRVNTICE9IHN0YXR1cykKKyAgICB7CisgICAgICAgIC8qIHNob3VsZCBub3QgZmFpbCAqLworICAgICAgICBWT1NfQVNTRVJUKDApIDsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1cyA7Cit9CisKKy8qCisgKiBEZWwgU1RBLCBhZnRlciBMaW5rIGlzIHRlYXJkb3duIG9yIGRpc2NvdmVyeSByZXNwb25zZSBzZW50IG9uIGRpcmVjdCBsaW5rCisgKi8KK3N0YXRpYyB0cERwaEhhc2hOb2RlIGxpbVRkbHNEZWxTdGEodHBBbmlTaXJHbG9iYWwgcE1hYywgdFNpck1hY0FkZHIgcGVlck1hYywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSkKK3sKKyAgICB0U2lyUmV0U3RhdHVzIHN0YXR1cyA9IGVTSVJfU1VDQ0VTUyA7CisgICAgdEFOSV9VMTYgcGVlcklkeCA9IDAgOworICAgIHRwRHBoSGFzaE5vZGUgcFN0YURzID0gTlVMTCA7CisgCisgICAgcFN0YURzID0gZHBoTG9va3VwSGFzaEVudHJ5KHBNYWMsIHBlZXJNYWMsICZwZWVySWR4LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUpIDsKKworICAgIGlmKHBTdGFEcykKKyAgICB7CisgICAgCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiREVMIFNUQSBwZWVyIE1BQzogIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwU3RhRHMtPnN0YUFkZHIpKTsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJTVEEgdHlwZSA9ICV4LCBzdGEgaWR4ID0gJXgiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+c3RhVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+c3RhSW5kZXgpOworICAgICAgICBsaW1EZWxldGVCQVNlc3Npb25zKHBNYWMsIHBzZXNzaW9uRW50cnksIEJBX0JPVEhfRElSRUNUSU9OUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX01BQ19QRUVSX1RJTUVET1VUX1JFQVNPTik7CisgICAgICAgIHN0YXR1cyA9IGxpbURlbFN0YShwTWFjLCBwU3RhRHMsIGZhbHNlLCBwc2Vzc2lvbkVudHJ5KSA7CisgICAgfQorICAgICAgICAgICAKKyAgICByZXR1cm4gcFN0YURzIDsKK30KKyAgICAgCisvKiAKKyAqIE9uY2UgTGluayBpcyBzZXR1cCB3aXRoIFBFRVIsIHNlbmQgQWRkIFNUQSBpbmQgdG8gU01FCisgKi8KK3N0YXRpYyBlSGFsU3RhdHVzIGxpbVNlbmRTbWVUZGxzQWRkU3RhUnNwKHRwQW5pU2lyR2xvYmFsIHBNYWMsIAorICAgICAgICAgICA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NYWM9Ik1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgIHBBZGRTdGFQYXJhbXMtPnN0YUlkeCwKKyAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEFkZFN0YVBhcmFtcy0+c3RhTWFjKSk7CisKKyAgICBpZiAocEFkZFN0YVBhcmFtcy0+c3RhdHVzICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MpCisgICAgeworICAgICAgICBWT1NfQVNTRVJUKDApIDsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJBZGQgc3RhIGZhaWxlZCAiKSk7CisgICAgICAgIHN0YXR1cyA9IGVTSVJfRkFJTFVSRTsKKyAgICAgICAgZ290byBhZGRfc3RhX2Vycm9yOworICAgIH0KKworICAgIHBTdGFEcyA9IGRwaExvb2t1cEhhc2hFbnRyeShwTWFjLCBwQWRkU3RhUGFyYW1zLT5zdGFNYWMsICZhaWQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcHNlc3Npb25FbnRyeS0+ZHBoLmRwaEhhc2hUYWJsZSk7CisgICAgaWYoTlVMTCA9PSBwU3RhRHMpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoInBTdGFEcyBpcyBOVUxMICIpKTsKKyAgICAgICAgc3RhdHVzID0gZVNJUl9GQUlMVVJFOworICAgICAgICBnb3RvIGFkZF9zdGFfZXJyb3I7CisgICAgfQorCisgICAgcFN0YURzLT5ic3NJZCAgICAgICAgICAgICAgICAgID0gcEFkZFN0YVBhcmFtcy0+YnNzSWR4OworICAgIHBTdGFEcy0+c3RhSW5kZXggICAgICAgICAgICAgICA9IHBBZGRTdGFQYXJhbXMtPnN0YUlkeDsKKyAgICBwU3RhRHMtPnVjVWNhc3RTaWcgICAgICAgICAgICAgPSBwQWRkU3RhUGFyYW1zLT51Y1VjYXN0U2lnOworICAgIHBTdGFEcy0+dWNCY2FzdFNp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bGFzczsKKyAgICBpZiAod2xhbl9jZmdHZXRTdHIocE1hYywgV05JX0NGR19WQUxJRF9DSEFOTkVMX0xJU1QsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbGlkQ2hhbiwgJm51bUNoYW5zKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgeworICAgICAgICAvKioKKyAgICAgICAgICogQ291bGQgbm90IGdldCBWYWxpZCBjaGFubmVsIGxpc3QgZnJvbSBDRkcuCisgICAgICAgICAqIExvZyBlcnJvci4KKyAgICAgICAgICovCisgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSB2YWxpZCBjaGFubmVsIGxpc3QiKSk7CisgICAgICAgICByZXR1cm47CisgICAgfQorICAgIHN1cHBDaGFubmVscy0+bnVtX2JhbmRzID0gKHRBTklfVTgpIG51bUNoYW5zOworCisgICAgZm9yICggaSA9IDBVLCBqID0gMFU7IGkgPCBzdXBwQ2hhbm5lbHMtPm51bV9iYW5kcyAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICBqIDwgTElNX01BWF9CQU5EUzsgaSsrKQorICAgIHsKKyAgICAgICAgLyogZG9uJ3QgcG9wdWxhdGUgZGZzIGNoYW5uZWxzIGluIHN1cHBvcnRlZCBjaGFubmVscyBpZSAqLworICAgICAgICBpZiAoIShOVl9DSEFOTkVMX0RGUyA9PSB2b3NfbnZfZ2V0Q2hhbm5lbEVuYWJsZWRTdGF0ZSh2YWxpZENoYW5baV0pKSkgeworICAgICAgICAgICAgc3VwcENoYW5uZWxzLT5iYW5kc1tqXVswXSA9IHZhbGlkQ2hhbltpXTsKKyAgICAgICAgICAgIHN1cHBDaGFubmVscy0+YmFuZHNbal1bMV0gPSAxOworICAgICAgICAgICAgLyogc3RvcmUgdGRscyBzZWxmIHN1cHBvcnRlZCBjaGFubmVscyAqLworICAgICAgICAgICAgdGRsc1NlbGZTdXBwb3J0ZWRDaGFubmVsc1tqXSA9IHZhbGlkQ2hhbltpXTsKKyAgICAgICAgICAgIGorKzsKKyAgICAgICAgfQorICAgIH0KKyAgICAvKiB1cGRhdGUgdGhlIGNoYW5uZWwgbGlzdCB3aXRoIG5ldyBsZW5ndGggKi8KKyAgICBzdXBwQ2hhbm5lbHMtPm51bV9iYW5kcyA9IGo7CisgICAgc3VwcENoYW5uZWxzLT5wcmVzZW50ID0gMSA7CisgICAgLyogc3RvcmUgdGRscyBzZWxmIHN1cHBvcnRlZCBjaGFubmVscyBuZXcgbGVuZ3RoICovCisgICAgdGRsc1NlbGZOdW1DaGFucyA9IGo7CisKKyAgICAvKkdldCBwcmVzZW50IG9wZXJhdGluZyBjbGFzcyBiYXNlZCBvbiBjdXJyZW50IG9wZXJhdGluZyBjaGFubmVsKi8KKyAgICBvcF9jbGFzcyA9IGxpbUdldE9QQ2xhc3NGcm9tQ2hhbm5lbCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmNvdW50cnlDb2RlQ3VycmVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+aHRTZWNvbmRhcnlDaGFubmVsT2Zmc2V0KTsKKyAgICBpZiAob3BfY2xhc3MgPT0gMCkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgRkwoIlByZXNlbnQgT3BlcmF0aW5nIGNsYXNzIGlzIHdyb25nLCBjb3VudHJ5Q29kZUN1cnJlbnQ6ICVzLCBjdXJyZW50T3BlckNoYW5uZWw6ICVkLCBodFNlY29uZGFyeUNoYW5uZWxPZmZzZXQ6ICVkIiksCisgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmNvdW50cnlDb2RlQ3VycmVudCwKKyAgICAgICAgICAgICAgIHBzZXN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nQgSUUKKyAqCisgKi8KKworCit2b2lkIFBvcHVsYXRlRG90MTFmTGlua0lkZW4odHBBbmlTaXJHbG9iYWwgcE1hYywgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVMaW5rSWRlbnRpZmllciAqbGlua0lkZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjQWRkciBwZWVyTWFjLCB0QU5JX1U4IHJlcVR5cGUpCit7CisgICAgLy90QU5JX1UzMiBzaXplID0gc2l6ZW9mKHRTaXJNYWNBZGRyKSA7CisgICAgdEFOSV9VOCAqaW5pdFN0YUFkZHIgPSBOVUxMIDsKKyAgICB0QU5JX1U4ICpyZXNwU3RhQWRkciA9IE5VTEwgOworCisgICAgKHJlcVR5cGUgPT0gVERMU19JTklUSUFUT1IpID8gKChpbml0U3RhQWRkciA9IGxpbmtJZGVuLT5Jbml0U3RhQWRkciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChyZXNwU3RhQWRkciA9IGxpbmtJZGVuLT5SZXNwU3RhQWRkcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKChyZXNwU3RhQWRkciA9IGxpbmtJZGVuLT5Jbml0U3RhQWRkciApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaW5pdFN0YUFkZHIgPSBsaW5rSWRlbi0+UmVzcFN0YUFkZHIpKSA7CisgICAgdm9zX21lbV9jb3B5KCAodEFOSV9VOCAqKWxpbmtJZGVuLT5ic3NpZCwKKyAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopIHBzZXNzaW9uRW50cnktPmJzc0lkLCBzaXplb2YodFNpck1hY0FkZHIpKSA7IAorCisgICAgdm9zX21lbV9jb3B5KCAodEFOSV9VOCAqKWluaXRTdGFBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5zZWxmTWFjQWRkciwgc2l6ZW9mKHRTaXJNYWNBZGRyKSkgOworCisgICAgdm9zX21lbV9jb3B5KCAodEFOSV9VOCAqKXJlc3BTdGFBZGRyLCAodEFOSV9VOCAqKSBwZWVyTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiggdFNpck1hY0FkZHIgKSk7CisKKyAgICBsaW5rSWRlbi0+cHJlc2VudCA9IDEgOworICAgIHJldHVybiA7CisKK30KKwordm9pZCBQb3B1bGF0ZURvdDExZlRkbHNFeHRDYXBhYmlsaXR5KHRwQW5pU2lyR2xvYmFsIHBNYWMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUV4dENhcCAqZXh0Q2FwYWJpbGl0eSkKK3sKKyAgICBleHRDYXBhYmlsaXR5LT5URExTUGVlclBTTVN1cHAgPSBQRUVSX1BTTV9TVVBQT1JUIDsKKyAgICBleHRDYXBhYmlsaXR5LT5URExTUGVlclVBUFNEQnVmZmVyU1RBID0gcE1hYy0+bGltLmdMaW1URExTQnVmU3RhRW5hYmxlZDsKKyAgICBleHRDYXBhYmlsaXR5LT5URExTQ2hhbm5lbFN3aXRjaGluZyA9IHBNYWMtPmxpbS5nTGltVERMU09mZkNoYW5uZWxFbmFibGVkIDsKKyAgICBleHRDYXBhYmlsaXR5LT5URExTU3VwcG9ydCA9IFRETFNfU1VQUE9SVCA7CisgICAgZXh0Q2FwYWJpbGl0eS0+VERMU1Byb2hpYml0ZWQgPSBURExTX1BST0hJQklURUQgOworICAgIGV4dENhcGFiaWxpdHktPlRETFNDaGFuU3dpdFByb2hpYml0ZWQgPSBURExTX0NIX1NXSVRDSF9QUk9ISUJJVEVEIDsKKyAgICBleHRDYXBhYmlsaXR5LT5wcmVzZW50ID0gMSA7CisgICAgcmV0dXJuIDsKK30KKworLyoKKyAqIFByb2Nlc3MgU2VuZCBNZ210I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8gd29yayBhcyBURExTIGNsaWVudCAqLyAKKyAgICBpZiAocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSAhPSBlTElNX1NUQV9ST0xFKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfUEUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgInNlbmQgbWdtdCByZWNlaXZlZCBpbiB3cm9uZyBzeXN0ZW0gUm9sZSAlZCIsCisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSk7CisgICAgICAgIGdvdG8gbGltX3RkbHNfc2VuZF9tZ210X2Vycm9yOworICAgIH0KKworICAgIC8qCisgICAgICogaWYgd2UgYXJlIHN0aWxsIGdvb2QsIGdvIGFoZWFkIGFuZCBjaGVjayBpZiB3ZSBhcmUgaW4gcHJvcGVyIHN0YXRlIHRvCisgICAgICogZG8gVERMUyBkaXNjb3ZlcnkgcmVxL3JzcC8uLi4uZnJhbWVzLgorICAgICAqLworICAgIGlmICgocHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUgIT0gZUxJTV9TTUVfQVNTT0NJQVRFRF9TVEFURSkgJiYKKyAgICAgICAgICAgIChwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSAhPSBlTElNX1NNRV9MSU5LX0VTVF9TVEFURSkpCisgICAgeworCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgic2VuZCBtZ210IHJlY2VpdmVkIGluIGludmFsaWQgTElNc21lIHN0YXRlICglZCkiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlKTsKKyAgICAgICAgZ290byBsaW1fdGRsc19zZW5kX21nbXRfZXJyb3I7CisgICAgfQorCisgICAgc3dpdGNoKCBwU2VuZE1nbXRSZXEtPnJlcVR5cGUgKQorICAgIHsKKyAgICAgICAgY2FzZSBTSVJfTUFDX1RETFNfRElTX1JFUToKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiVHJhbnNtaXQgRGlzY292ZXJ5IFJlcXVlc3QgRnJhbWUiKSk7CisgICAgICAgICAgICAvKiBmb3JtYXQgVERMUyBkaXNjb3ZlcnkgcmVxdWVzdCBmcmFtZSBhbmQgdHJhbnNtaXQgaXQgKi8KKyAgICAgICAgICAgIGxpbVNlbmRUZGxzRGlzUmVxRnJhbWUocE1hYywgcFNlbmRNZ210UmVxLT5wZWVyTWFjLCBwU2VuZE1nbXRSZXEtPmRpYWxvZywgCisgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnkpIDsKKyAgICAgICAgICAgIHJlc3VsdENvZGUgPSBlU0lSX1NNRV9TVUNDRVNTOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU0lSX01BQ19URExTX0RJU19SU1A6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJUcmFuc21pdCBEaXNjb3ZlcnkgUmVzcG9uc2UgRnJhbWUiKSk7CisgICAgICAgICAgICAgICAgLy9TZW5kIGEgcmVzcG9uc2UgbWdtdCBhY3Rpb24gZnJhbWUKKyAgICAgICAgICAgICAgICBsaW1TZW5kVGRsc0Rpc1JzcEZyYW1lKHBNYWMsIHBTZW5kTWdtdFJlcS0+cGVlck1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTZW5kTWdtdFJlcS0+ZGlhbG9nLCBwc2Vzc2lvbkVudHJ5LAorICAgICAgICAgICAgICAgICAgICAgICAgJnBTZW5kTWdtdFJlcS0+YWRkSWVbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAocFNlbmRNZ210UmVxLT5sZW5ndGggLSBzaXplb2YodFNpclRkbHNTZW5kTWdtdFJlcSkpKTsKKyAgICAgICAgICAgICAgICByZXN1bHRDb2RlID0gZVNJUl9TTUVfU1VDQ0VTUzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfVERMU19TRVRVUF9SRVE6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJUcmFuc21pdCBTZXR1cCBSZXF1ZXN0IEZyYW1lIikpOworICAgICAgICAgICAgICAgIGxpbVNlbmRUZGxzTGlua1NldHVwUmVxRnJhbWUocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTZW5kTWdtdFJlcS0+cGVlck1hYywgcFNlbmRNZ210UmVxLT5kaWFsb2csIHBzZXNzaW9uRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAmcFNlbmRNZ210UmVxLT5hZGRJZVswXSwgKHBTZW5kTWdtdFJlcS0+bGVuZ3RoIC0gc2l6ZW9mKHRTaXJUZGxzU2VuZE1nbXRSZXEpKSk7IAorICAgICAgICAgICAgICAgIHJlc3VsdENvZGUgPSBlU0lSX1NNRV9TVUNDRVNTOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU0lSX01BQ19URExTX1NFVFVQX1JTUDoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlRyYW5zbWl0IFNldHVwIFJlc3BvbnNlIEZyYW1lIikpOworICAgICAgICAgICAgICAgIGxpbVNlbmRUZGxzU2V0dXBSc3BGcmFtZShwTWFjLCAKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTZW5kTWdtdFJlcS0+cGVlck1hYywgcFNlbmRNZ210UmVxLT5kaWFsb2csIHBzZXNzaW9uRW50cnksIHBTZW5kTWdtdFJlcS0+c3RhdHVzQ29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICZwU2VuZE1nbXRSZXEtPmFkZEllWzBdLCAocFNlbmRNZ210UmVxLT5sZW5ndGggLSBzaXplb2YodFNpclRkbHNTZW5kTWdtdFJlcSkpKTsKKyAgICAgICAgICAgICAgICByZXN1bHRDb2RlID0gZVNJUl9TTUVfU1VDQ0VTUzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfVERMU19TRVRVUF9DTkY6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJUcmFuc21pdCBTZXR1cCBDb25maXJtIEZyYW1lIikpOworICAgICAgICAgICAgICAgIGxpbVNlbmRUZGxzTGlua1NldHVwQ25mRnJhbWUocE1hYywgcFNlbmRNZ210UmVxLT5wZWVyTWFjLCBwU2VuZE1nbXRSZXEtPmRpYWxvZywgcFNlbmRNZ210UmVxLT5wZWVyQ2FwYWJpbGl0eSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnksICZwU2VuZE1nbXRSZXEtPmFkZEllWzBdLCAocFNlbmRNZ210UmVxLT5sZW5ndGggLSBzaXplb2YodFNpclRkbHNTZW5kTWdtdFJlcSkpKTsgIAorICAgICAgICAgICAgICAgIHJlc3VsdENvZGUgPSBlU0lSX1NNRV9TVUNDRVNTOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU0lSX01BQ19URExTX1RFQVJET1dOOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiVHJhbnNtaXQgVGVhcmRvd24gRnJhbWUiKSk7CisgICAgICAgICAgICAgICAgbGltU2VuZFRkbHNUZWFyZG93bkZyYW1lKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICBwU2VuZE1nbXRSZXEtPnBlZXJNYWMsIHBTZW5kTWdtdFJlcS0+c3RhdHVzQ29kZSwgcFNlbmRNZ210UmVxLT5yZXNwb25kZXIsIHBzZXNzaW9uRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAmcFNlbmRNZ210UmVxLT5hZGRJZVswXSwgKHBTZW5kTWdtdFJlcS0+bGVuZ3RoIC0gc2l6ZW9mKHRTaXJUZGxzU2VuZE1nbXRSZXEpKSk7IAorICAgICAgICAgICAgICAgIHJlc3VsdENvZGUgPSBlU0lSX1NNRV9TVUNDRVNTOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU0lSX01BQ19URExTX1BFRVJfVFJBRkZJQ19JTkQ6CisgICAgICAgICAgICB7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTSVJfTUFDX1RETFNfQ0hfU1dJVENIX1JFUToKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfVERMU19DSF9TV0lUQ0hfUlNQOgorICAgICAgICAgICAgeworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU0lSX01BQ19URExTX1BFRVJfVFJBRkZJQ19SU1A6CisgICAgICAgICAgICB7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGJyZWFrOworICAgIH0KKworbGltX3RkbHNfc2VuZF9tZ210X2Vycm9yOgorCisgICAgbGltU2VuZFNtZVJzcCggcE1hYywgZVdOSV9TTUVfVERMU19TRU5EX01HTVRfUlNQLAorICAgICAgICAgICAgcmVzdWx0Q29kZSwgcFNlbmRNZ210UmVxLT5zZXNzaW9uSWQsIHBTZW5kTWdtdFJlcS0+dHJhbnNhY3Rpb25JZCk7CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworfQorCisvKgorICogU2VuZCBSZXNwb25zZSB0byBMaW5rIEVzdGFibGlzaCBSZXF1ZXN0IHRvIFNNRQorICovCit2b2lkIGxpbVNlbmRTbWVUZGxzTGlua0VzdGFibGlzaFJlcVJzcCh0cE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dGF0dXMgOworICAgIGlmKCBwU3RhRHMgKQorICAgIHsKKyAgICAgICAgcERlbFN0YS0+c3RhSWQgPSBwU3RhRHMtPnN0YUluZGV4IDsKKyAgICB9CisgICAgZWxzZQorICAgICAgICBwRGVsU3RhLT5zdGFJZCA9IEhBTF9TVEFfSU5WQUxJRF9JRFg7CisKKyAgICBpZiggcGVlck1hYyApCisgICAgeworICAgICAgICB2b3NfbWVtX2NvcHkocERlbFN0YS0+cGVlck1hYywgcGVlck1hYywgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgfQorCisgICAgcERlbFN0YS0+bGVuZ3RoID0gc2l6ZW9mKHRTaXJUZGxzRGVsU3RhUnNwKSA7CisgICAgcERlbFN0YS0+bWVzc2FnZVR5cGUgPSBlV05JX1NNRV9URExTX0RFTF9TVEFfUlNQIDsKKworICAgIG1taE1zZy5ib2R5cHRyID0gcERlbFN0YTsKKworICAgIG1taE1zZy5ib2R5dmFsID0gMDsKKyAgICBsaW1TeXNQcm9jZXNzTW1oTXNnQXBpKHBNYWMsICZtbWhNc2csIGVQUk9UKTsKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTIDsKKworfQorCisvKgorICogUHJvY2VzcyBTZW5kIE1nbXQgUmVxdWVzdCBmcm9tIFNNRSBhbmQgdHJhbnNtaXQgdG8gQVAuCisgKi8KK3RTaXJSZXRTdGF0dXMgbGltUHJvY2Vzc1NtZVRkbHNBZGRTdGFSZXEodHBBbmlTaXJHbG9iYWwgcE1hYywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwTXNnQnVmKQoreworICAgIC8qIGdldCBhbGwgZGlzY292ZXJ5IHJlcXVlc3QgcGFyYW1ldGVycyAqLworICAgIHRTaXJUZGxzQWRkU3RhUmVxICpwQWRkU3RhUmVxID0gKHRTaXJUZGxzQWRkU3RhUmVxKikgcE1zZ0J1ZiA7CisgICAgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeTsKKyAgICB0QU5JX1U4ICAgICAgc2Vzc2lvbklkOworCisgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJURExTIEFkZCBTVEEgUmVxdWVzdCBSZWNpZXZlZCIpKTsKKworICAgIGlmKChwc2Vzc2lvbkVudHJ5ID0gcGVGaW5kU2Vzc2lvbkJ5QnNzaWQocE1hYywgcEFkZFN0YVJlcS0+YnNzaWQsICZzZXNzaW9uSWQpKSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IE5VTEwpCisgICAgeworICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgRkwoIlBFIFNlc3Npb24gZG9lcyBub3QgZXhpc3QgZm9yIGdpdmVuIHNtZSBzZXNzaW9uSWQgJWQiKSwKKyAgICAgICAgICAgICAgICBwQWRkU3RhUmVxLT5zZXNzaW9uSWQpOworICAgICAgICAgZ290byBsaW1fdGRsc19hZGRfc3RhX2Vycm9yOworICAgIH0KKyAgICAKKyAgICAvKiBjaGVjayBpZiB3ZSBhcmUgaW4gcHJvcGVyIHN0YXRlIHRvIHdvcmsgYXMgVERMUyBjbGllbnQgKi8gCisgICAgaWYgKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgIT0gZUxJTV9TVEFfUk9MRSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1BFLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICAgICAgICJzZW5kIG1nbXQgcmVjZWl2ZWQgaW4gd3Jvbmcgc3lzdGVtIFJvbGUgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSk7CisgICAgICAgIGdvdG8gbGltX3RkbHNfYWRkX3N0YV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X1NNRV9BU1NPQ0lBVEVEX1NUQVRFKSAmJgorICAgICAgICAgICAgKHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlICE9IGVMSU1fU01FX0xJTktfRVNUX1NUQVRFKSkKKyAgICB7CisKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJEZWwgU3RhIHJlY2VpdmVkIGluIGludmFsaWQgTElNc21lIHN0YXRlICglZCkiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlKTsKKyAgICAgICAgZ290byBsaW1fdGRsc19kZWxfc3RhX2Vycm9yOworICAgIH0KKworICAgIHBTdGFEcyA9IGxpbVRkbHNEZWxTdGEocE1hYywgcERlbFN0YVJlcS0+cGVlck1hYywgcHNlc3Npb25FbnRyeSkgOworCisgICAgLyogbm93IHNlbmQgaW5kaWNhdGlvbiB0byBTTUUtLT5IREQtPlRMIHRvIHJlbW92ZSBTVEEgZnJvbSBUTCAqLworCisgICAgaWYocFN0YURzKQorICAgIHsKKyAgICAgICAgbGltU2VuZFNtZVRkbHNEZWxTdGFSc3AocE1hYywgcHNlc3Npb25FbnRyeS0+c21lU2Vzc2lvbklkLCBwRGVsU3RhUmVxLT5wZWVyTWFjLAorICAgICAgICAgICAgICAgIHBTdGFEcywgZVNJUl9TVUNDRVNTKSA7CisgICAgICAgIGxpbVJlbGVhc2VQZWVySWR4KHBNYWMsIHBTdGFEcy0+YXNzb2NJZCwgcHNlc3Npb25FbnRyeSkgOworCisgICAgICAgIC8qIENsZWFyIHRoZSBhaWQgaW4gcGVlckFJREJpdG1hcCBhcyB0aGlzIGFpZCBpcyBub3cgaW4gZnJlZXBvb2wgKi8KKyAgICAgICAgQ0xFQVJfUEVFUl9BSURfQklUTUFQKHBzZXNzaW9uRW50cnktPnBlZXJBSURCaXRtYXAsIHBTdGFEcy0+YXNzb2NJZCk7CisgICAgICAgIGxpbURlbGV0ZURwaEhhc2hFbnRyeShw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hZz0wOworICAgICAgICBmb3Ioaj0wO2o8aW5wdXQyX2xlbmd0aDtqKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKGlucHV0X2FycmF5MVtpXT09aW5wdXRfYXJyYXkyW2pdKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGZsYWc9MTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZihmbGFnPT0xKQorICAgICAgICB7CisgICAgICAgICAgICBvdXRwdXRfYXJyYXlba109aW5wdXRfYXJyYXkxW2ldOworICAgICAgICAgICAgaysrOworICAgICAgICB9CisgICAgfQorICAgICpvdXRwdXRfbGVuZ3RoID0gazsKK30KKy8qCisgKiBQcm9jZXNzIExpbmsgRXN0YWJsaXNobWVudCBSZXF1ZXN0IGZyb20gU01FIC4KKyAqLwordFNpclJldFN0YXR1cyBsaW1Qcm9jZXNTbWVUZGxzTGlua0VzdGFibGlzaFJlcSh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcE1zZ0J1ZikKK3sKKyAgICAvKiBnZXQgYWxsIGRpc2NvdmVyeSByZXF1ZXN0IHBhcmFtZXRlcnMgKi8KKyAgICB0U2lyVGRsc0xpbmtFc3RhYmxpc2hSZXEgKnBUZGxzTGlua0VzdGFibGlzaFJlcSA9ICh0U2lyVGRsc0xpbmtFc3RhYmxpc2hSZXEqKSBwTXNnQnVmIDsKKyAgICB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5OworICAgIHRBTklfVTggICAgICBzZXNzaW9uSWQ7CisgICAgdHBUZGxzTGlua0VzdGFibGlzaFBhcmFtcyBwTXNnVGRsc0xpbmtFc3RhYmxpc2hSZXE7CisgICAgdFNpck1zZ1EgbXNnOworICAgIHRBTklfVTE2IHBlZXJJZHggPSAwIDsKKyAgICB0cERwaE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lICVkIiwKKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlKTsKKyAgICAgICAgZ290byBsaW1fdGRsc19saW5rX2VzdGFibGlzaF9lcnJvcjsKKyAgICB9CisKKyAgICAvKgorICAgICAqIGlmIHdlIGFyZSBzdGlsbCBnb29kLCBnbyBhaGVhZCBhbmQgY2hlY2sgaWYgd2UgYXJlIGluIHByb3BlciBzdGF0ZSB0bworICAgICAqIGRvIFRETFMgZGlzY292ZXJ5IHJlcS9yc3AvLi4uLmZyYW1lcy4KKyAgICAgKi8KKyAgICBpZiAoKHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlICE9IGVMSU1fU01FX0FTU09DSUFURURfU1RBVEUpICYmCisgICAgICAgICAgICAocHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUgIT0gZUxJTV9TTUVfTElOS19FU1RfU1RBVEUpKQorICAgIHsKKworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgIEZMKCJURExTIExpbmsgRXN0YWJsaXNoIFJlcXVlc3QgcmVjZWl2ZWQgaW4gaW52YWxpZCBMSU1zbWUgc3RhdGUgKCVkKSIpLAorICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltU21lU3RhdGUpOworICAgICAgICBnb3RvIGxpbV90ZGxzX2xpbmtfZXN0YWJsaXNoX2Vycm9yOworICAgIH0KKyAgICAvKlRPRE8gU3VuaWwgLCBURExTUGVlciBFbnRyeSBoYXMgdGhlIFNUQSBJRCAsIFVzZSBpdCAqLworICAgIHBTdGFEcyA9IGRwaExvb2t1cEhhc2hFbnRyeShwTWFjLCBwVGRsc0xpbmtFc3RhYmxpc2hSZXEtPnBlZXJNYWMsICZwZWVySWR4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcHNlc3Npb25FbnRyeS0+ZHBoLmRwaEhhc2hUYWJsZSkgOworICAgIGlmICggTlVMTCA9PSBwU3RhR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VsZXRlVERMU1BlZXJzKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpCit7CisgICAgdHBEcGhIYXNoTm9kZSBwU3RhRHMgPSBOVUxMIDsKKyAgICBpbnQgaSwgYWlkOworCisgICAgaWYgKE5VTEwgPT0gcHNlc3Npb25FbnRyeSkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiTlVMTCBwc2Vzc2lvbkVudHJ5IikpOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKworICAgIC8qIENoZWNrIGFsbCB0aGUgc2V0IGJpdCBpbiBwZWVyQUlEQml0bWFwIGFuZCBkZWxldGUgdGhlIHBlZXIgKHdpdGggdGhhdCBhaWQpIGVudHJ5CisgICAgICAgZnJvbSB0aGUgaGFzaCB0YWJsZSBhbmQgYWRkIHRoZSBhaWQgaW4gZnJlZSBwb29sICovCisgICAgZm9yIChpID0gMDsgaSA8IHNpemVvZihwc2Vzc2lvbkVudHJ5LT5wZWVyQUlEQml0bWFwKS9zaXplb2YodEFOSV9VMzIpOyBpKyspCisgICAgeworICAgICAgICBmb3IgKGFpZCA9IDA7IGFpZCA8IChzaXplb2YodEFOSV9VMzIpIDw8IDMpOyBhaWQrKykKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKENIRUNLX0JJVChwc2Vzc2lvbkVudHJ5LT5wZWVyQUlEQml0bWFwW2ldLCBhaWQpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBTdGFEcyA9IGRwaEdldEhhc2hFbnRyeShwTWFjLCAoYWlkICsgaSooc2l6ZW9mKHRBTklfVTMyKSA8PCAzKSksICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsKKworICAgICAgICAgICAgICAgIGlmIChOVUxMICE9IHBTdGFEcykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiRGVsZXRpbmcgIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwU3RhRHMtPnN0YUFkZHIpKTsKKworICAgICAgICAgICAgICAgICAgICBsaW1TZW5kRGVhdXRoTWdtdEZyYW1lKHBNYWMsIGVTSVJfTUFDX0RFQVVUSF9MRUFWSU5HX0JTU19SRUFTT04sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5zdGFBZGRyLCBwc2Vzc2lvbkVudHJ5LCBGQUxTRSk7CisgICAgICAgICAgICAgICAgICAgIGRwaERlbGV0ZUhhc2hFbnRyeShwTWFjLCBwU3RhRHMtPnN0YUFkZHIsIHBTdGFEcy0+YXNzb2NJZCwgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBsaW1SZWxlYXNlUGVlcklkeChwTWFjLCAoYWlkICsgaSooc2l6ZW9mKHRBTklfVTMyKSA8PCAzKSksIHBzZXNzaW9uRW50cnkpIDsKKyAgICAgICAgICAgICAgICBDTEVBUl9CSVQocHNlc3Npb25FbnRyeS0+cGVlckFJREJpdG1hcFtpXSwgYWlkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBsaW1TZW5kU21lVERMU0RlbGV0ZUFsbFBlZXJJbmQocE1hYywgcHNlc3Npb25FbnRyeSk7CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworfQorCisKK3RBTklfVTggbGltR2V0T2ZmQ2hNYXhCd09mZnNldEZyb21DaGFubmVsKHRBTklfVTggKmNvdW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGNoYW5uZWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IHBlZXJWSFRDYXBhYmlsaXR5KQoreworICAgIG9wX2NsYXNzX21hcF90ICpjbGFzcyA9IE5VTEw7CisgICAgdEFOSV9VMTYgaSA9IDA7CisgICAgb2Zmc2V0X3Qgb2Zmc2V0ID0gQlcyMCwgbWF4X2FsbG93ZWQgPSBCVzgwOworCisgICAgaWYgKChUUlVFID09IHBlZXJWSFRDYXBhYmlsaXR5KSAmJgorICAgICAgICBJU19GRUFUVVJFX1NVUFBPUlRFRF9CWV9GVyhET1QxMUFDKSAmJgorICAgICAgICBJU19GRUFUVVJFX1NVUFBPUlRFRF9CWV9EUklWRVIoRE9UMTFBQykpCisgICAgICAgIG1heF9hbGxvd2VkID0gQlc4MDsKKyAgICBlbHNlCisgICAgICAgIG1heF9hbGxvd2VkID0gQlc0ME1JTlVTOworCisgICAgaWYgKFZPU19UUlVFID09IHZvc19tZW1fY29tcGFyZShjb3VudHJ5LCJVUyIsIDIpKSAgeworCisgICAgICAgIGNsYXNzID0gdXNfb3BfY2xhc3M7CisKKyAgICB9IGVsc2UgaWYgKFZPU19UUlVFID09IHZvc19tZW1fY29tcGFyZShjb3VudHJ5LCJFVSIsIDIpKSB7CisKKyAgICAgICAgY2xhc3MgPSBldXJvX29wX2NsYXNzOworCisgICAgfSBlbHNlIGlmIChWT1NfVFJVRSA9PSB2b3NfbWVtX2NvbXBhcmUoY291bnRyeSwiSlAiLCAyKSkgeworCisgICAgICAgIGNsYXNzID0gamFwYW5fb3BfY2xhc3M7CisKKyAgICB9IGVsc2UgeworCisgICAgICAgIGNsYXNzID0gZ2xvYmFsX29wX2NsYXNzOworCisgICAgfQorCisgICAgd2hpbGUgKGNsYXNzLT5vcF9jbGFzcykKKyAgICB7CisgICAgICAgIGZvciAoaT0wOyAoaSA8IDI1ICYmIGNsYXNzLT5jaGFubmVsc1tpXSk7IGkrKykKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKGNoYW5uZWwgPT0gY2xhc3MtPmNoYW5uZWxzW2ldICYmIGNsYXNzLT5vZmZzZXQgPD0gbWF4X2FsbG93ZWQpCisgICAgICAgICAgICAgICAgb2Zmc2V0ID0gY2xhc3MtPm9mZnNldDsKKyAgICAgICAgfQorICAgICAgICBjbGFzcysrOworICAgIH0KKworICAgIHJldHVybiBvZmZzZXQ7Cit9CisKKwordEFOSV9VOCBsaW1HZXRPUENsYXNzRnJvbUNoYW5uZWwodEFOSV9VOCAqY291bnRyeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBjaGFubmVsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IG9mZnNldCkKK3sKKyAgICBvcF9jbGFzc19tYXBfdCAqY2xhc3MgPSBOVUxMOworICAgIHRBTklfVTE2IGkgPSAwOworCisgICAgaWYgKFZPU19UUlVFID09IHZvc19tZW1fY29tcGFyZShjb3VudHJ5LCJVUyIsIDIpKSAgeworCisgICAgICAgIGNsYXNzID0gdXNfb3BfY2xhc3M7CisKKyAgICB9IGVsc2UgaWYgKFZPU19UUlVFID09IHZvc19tZW1fY29tcGFyZShjb3VudHJ5LCJFVSIsIDIpKSB7CisKKyAgICAgICAgY2xhc3MgPSBldXJvX29wX2NsYXNzOworCisgICAgfSBlbHNlIGlmIChWT1NfVFJVRSA9PSB2b3NfbWVtX2NvbXBhcmUoY291bnRyeSwiSlAiLCAyKSkgeworCisgICAgICAgIGNsYXNzID0gamFwYW5fb3BfY2xhc3M7CisKKyAgICB9IGVsc2UgeworCisgICAgICAgIGNsYXNzID0gZ2xvYmFsX29wX2NsYXNzOworCisgICAgfQorCisgICAgd2hpbGUgKGNsYXNzLT5vcF9jbGFzcykKKyAgICB7CisgICAgICAgIGlmICgob2Zmc2V0ID09IGNsYXNzLT5vZmZzZXQpIHx8IChvZmZzZXQgPT0gQldBTEwpKQorICAgICAgICB7CisgICAgICAgICAgICBmb3IgKGk9MDsgKGkgPCAyNSAmJiBjbGFzcy0+Y2hhbm5lbHNbaV0pOyBpKyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGNoYW5uZWwgPT0gY2xhc3MtPmNoYW5uZWxzW2ldKQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2xhc3MtPm9wX2NsYXNzOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGNsYXNzKys7CisgICAgfQorICAgIHJldHVybiAwOworfQorCit0QU5JX0JPT0xFQU4gIENoZWNrQW5kQWRkT1AodEFOSV9VOCBjbGFzcykKK3sKKyAgICB0QU5JX1U4IGk7CisKKyAgICBmb3IgKGk9MDsgaSA8IChTSVJfTUFDX01BWF9TVVBQX09QRVJfQ0xBU1NFUyAtIDEpOyBpKyspCisgICAgeworICAgICAgICAvKjAgaXMgYW4gaW52YWxpZCBjbGFzcy4gSWYgY2xhc3MgaXMgYWxyZWFkeSBwcmVzZW50IGlnbm9yZSovCisgICAgICAgIGlmIChjbGFzcyA9PSBvcF9jbGFzc2VzLmNsYXNzZXNbaV0pCisgICAgICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgICAgIGlmKG9wX2NsYXNzZXMuY2xhc3Nlc1tpXSA9PSAwKQorICAgICAgICB7CisgICAgICAgICAgICByZXR1cm4gVFJVRTsKKyAgICAgICAgfQorICAgIH0KKyAgICAvL2xpbUxvZyhwTWFjLCBMT0dFLCBGTCgiTm8gc3BhY2UgbGVmdCBmb3IgY2xhc3MgPSAlZCIpLCBjbGFzcyk7CisgICAgcmV0dXJuIEZBTFNFOworfQorCit2b2lkIGxpbUluaXRPcGVyYXRpbmdDbGFzc2VzKCB0SGFsSGFuZGxlIGhIYWwgKQoreworCisgICAgdEFOSV9VOCBJbmRleCA9IDA7CisgICAgdEFOSV9VOCBjbGFzcyA9IDA7CisgICAgdEFOSV9VOCBpID0gMDsKKyAgICB0QU5JX1U4IGogPSAwOworICAgIHRBTklfVTggc3dhcCA9IDA7CisgICAgdEFOSV9VOCBudW1DaGFubmVscyA9IDA7CisgICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9IFBNQUNfU1RSVUNUKCBoSGFsICk7CisgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJDdXJyZW50IENvdW50cnkgPSAlYyVjIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnNjYW4uY291bnRyeUNvZGVDdXJyZW50WzBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmNvdW50cnlDb2RlQ3VycmVudFsxXSk7CisKKyAgICB2b3NfbWVtX3NldChvcF9jbGFzc2VzLmNsYXNzZXMsIHNpemVvZihvcF9jbGFzc2VzLmNsYXNzZXMpLCAwKTsKKyAgICBudW1DaGFubmVscyA9IHBNYWMtPnNjYW4uYmFzZUNoYW5uZWxzLm51bUNoYW5uZWxzOworICAgIGxpbUxvZyhwTWFjLCBMT0cxLCAiTnVtIG9mIGJhc2UgY2ggPSVkIiwgbnVtQ2hhbm5lbHMpOworICAgIGZvciAoIEluZGV4ID0gMDsKKyAgICAgICAgICBJbmRleCA8IG51bUNoYW5uZWxzICYmIGkgPCAoU0lSX01BQ19NQVhfU1VQUF9PUEVSX0NMQVNTRVMgLSAxKTsKKyAgICAgICAgICBJbmRleCsrKQorICAgIHsKKyAgICAgICAgY2xhc3MgPSBsaW1HZXRPUENsYXNzRnJvbUNoYW5uZWwoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+c2Nhbi5jb3VudHJ5Q29kZUN1cnJlbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+c2Nhbi5iYXNlQ2hhbm5lbHMuY2hhbm5lbExpc3RbIEluZGV4IF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQldBTEwpOworICAgICAgICBsaW1Mb2cocE1hYywgTE9HNCwgImNoPSVkIDw9PiAlZD1jbGFzcyIsCisgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmJhc2VDaGFubmVscy5jaGFubmVsTGlzdFsgSW5kZXggXSwKKyAgICAgICAgICAgICAgIGNsYXNzKTsKKyAgICAgICAgaWYgKENoZWNrQW5kQWRkT1AoY2xhc3MpKQorICAgICAgICB7CisgICAgICAgICAgICBvcF9jbGFzc2VzLmNsYXNzZXNbaV09IGNsYXNzOworICAgICAgICAgICAgaSsrOworICAgICAgICB9CisgICAgfQorCisgICAgbnVtQ2hhbm5lbHMgPSBwTWFjLT5zY2FuLmJhc2UyME1IekNoYW5uZWxzLm51bUNoYW5uZWxzOworICAgIGxpbUxvZyhwTWFjLCBMT0cxLCAiTnVtIG9mIDIwTUh6IGNoID0lZCIsIG51bUNoYW5uZWxzKTsKKyAgICBmb3IgKCBJbmRleCA9IDA7CisgICAgICAgICAgSW5kZXggPCBudW1DaGFubmVscyAmJiBpIDwgKFNJUl9NQUNfTUFYX1NVUFBfT1BFUl9DTEFTU0VTIC0gMSk7CisgICAgICAgICAgSW5kZXgrKykKKyAgICB7CisgICAgICAgIGNsYXNzID0gbGltR2V0T1BDbGFzc0Zyb21DaGFubmVsKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnNjYW4uY291bnRyeUNvZGVDdXJyZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnNjYW4uYmFzZTIwTUh6Q2hhbm5lbHMuY2hhbm5lbExpc3RbIEluZGV4IF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQldBTEwpOworICAgICAgICBsaW1Mb2cocE1hYywgTE9HNCwgImNoPSVkIDw9PiAlZD1jbGFzcyIsCisgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmJhc2UyME1IekNoYW5uZWxzLmNoYW5uZWxMaXN0WyBJbmRleCBdLAorICAgICAgICAgICAgICAgY2xhc3MpOworICAgICAgICBpZiAoQ2hlY2tBbmRBZGRPUChjbGFzcykpCisgICAgICAgIHsKKyAgICAgICAgICAgIG9wX2NsYXNzZXMuY2xhc3Nlc1tpXT0gY2xhc3M7CisgICAgICAgICAgICBpKys7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBudW1DaGFubmVscyA9IHBNYWMtPnNjYW4uYmFzZTQwTUh6Q2hhbm5lbHMubnVtQ2hhbm5lbHM7CisgICAgbGltTG9nKHBNYWMsIExPRzEsICJOdW0gb2YgNDBNSHogY2ggPSVkIiwgbnVtQ2hhbm5lbHMpOworICAgIGZvciAoIEluZGV4ID0gMDsKKyAgICAgICAgICBJbmRleCA8IG51bUNoYW5uZWxzICYmIGkgPCAoU0lSX01BQ19NQVhfU1VQUF9PUEVSX0NMQVNTRVMgLSAxKTsKKyAgICAgICAgICBJbmRleCsrKQorICAgIHsKKyAgICAgICAgY2xhc3MgPSBsaW1HZXRPUENsYXNzRnJvbUNoYW5uZWwoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+c2Nhbi5jb3VudHJ5Q29kZUN1cnJlbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+c2Nhbi5iYXNlNDBNSHpDaGFubmVscy5jaGFubmVsTGlzdFsgSW5kZXggXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBCV0FMTCk7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0c0LCAiY2g9JWQgPD0+ICVkPWNsYXNzIiwKKyAgICAgICAgICAgICAgIHBNYWMtPnNjYW4uYmFzZTQwTUh6Q2hhbm5lbHMuY2hhbm5lbExpc3RbIEluZGV4IF0sCisgICAgICAgICAgICAgICBjbGFzcyk7CisgICAgICAgIGlmIChDaGVja0FuZEFkZE9QKGNsYXNzKSkKKyAgICAgICAgeworICAgICAgICAgICAgb3BfY2xhc3Nlcy5jbGFzc2VzW2ldPSBjbGFzczsKKyAgICAgICAgICAgIGkrKzsKKyAgICAgICAgfQorICAgIH0KKworICAgIG9wX2NsYXNzZXMubnVtX2NsYXNzZXMgPSBpOworICAgIGxpbUxvZyhwTWFjLCBMT0cxLCAiVG90YWwgbnVtYmVyIG9mIFVuaXF1ZSBzdXBwb3J0ZWQgY2xhc3NlcyA9JWQiLAorICAgICAgICAgICBvcF9jbGFzc2VzLm51bV9jbGFzc2VzKTsKKyAgICAvKmFzIHBlciBzcGVjIHRoZSBvcGVyYXRpbmcgY2xhc3NlcyBzaG91bGQgYmUgaW4gYXNjZW5kaW5nIG9yZGVyKi8KKyAgICAvKkJ1YmJsZSBzb3J0IGlzIGZpbmUgYXMgd2UgZG9uJ3QgaGF2ZSBtYW55IGNsYXNzZXMqLworICAgIGZvciAoaSA9IDAgOyBpIDwgKCBvcF9jbGFzc2VzLm51bV9jbGFzc2VzIC0gMSApOyBpKyspCisgICAgeworICAgICAgICBmb3IgKGogPSAwIDsgaiA8IG9wX2NsYXNzZXMubnVtX2NsYXNzZXMgLSBpIC0gMTsgaisrKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBGb3IgZGVjcmVhc2luZyBvcmRlciB1c2UgPCAqLworICAgICAgICAgICAgaWYgKG9wX2NsYXNzZXMuY2xhc3Nlc1tqXSA+IG9wX2NsYXNzZXMuY2xhc3Nlc1tqKzFdKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN3YXAgPSBvcF9jbGFzc2VzLmNsYXNzZXNbal07CisgICAgICAgICAgICAgICAgb3BfY2xhc3Nlcy5jbGFzc2VzW2pdID0gb3BfY2xhc3Nlcy5jbGFzc2VzW2orMV07CisgICAgICAgICAgICAgICAgb3BfY2xhc3Nlcy5jbGFzc2VzW2orMV0gPSBzd2FwOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIGZvciAoaT0wOyBpIDwgb3BfY2xhc3Nlcy5udW1fY2xhc3NlczsgaSsrKQorICAgIHsKKworICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgInN1cHBvcnRlZCBvcF9jbGFzc1slZF09JWQiLCBpLAorICAgICAgICAgICAgICAgb3BfY2xhc3Nlcy5jbGFzc2VzW2ldKTsKKworICAgIH0KK30KKworI2VuZGlmCisvLyB0ZGxzb2ZmY2hhbgorLyo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T5ic3NpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnNlc3Npb25JZCk7CisgICAgaWYgKHBzZXNzaW9uRW50cnkgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1BFLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiUEUgU2Vzc2lvbiBkb2VzIG5vdCBleGlzdCBmb3IgZ2l2ZW4gc21lIHNlc3Npb25JZCAlZCIsCisgICAgICAgICAgICAgICAgICBwVGRsc0NoYW5Td2l0Y2gtPnNlc3Npb25JZCk7CisgICAgICAgIGxpbVNlbmRTbWVUZGxzQ2hhblN3aXRjaFJlcVJzcChwTWFjLCBwVGRsc0NoYW5Td2l0Y2gtPnNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZGxzQ2hhblN3aXRjaC0+cGVlck1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsIGVTSVJfRkFJTFVSRSkgOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKworICAgIC8qIGNoZWNrIGlmIHdlIGFyZSBpbiBwcm9wZXIgc3RhdGUgdG8gd29yayBhcyBURExTIGNsaWVudCAqLworICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlICE9IGVMSU1fU1RBX1JPTEUpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9QRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIlRETFMgQ2hhbm5lbCBTd2l0Y2ggcmVjZWl2ZWQgaW4gd3Jvbmcgc3lzdGVtIFJvbGUgJWQiLAorICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSk7CisgICAgICAgIGd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7CisgICAgcE1zZ1RkbHNDaGFuU3dpdGNoLT5vcGVyQ2xhc3MgPSBsaW1HZXRPUENsYXNzRnJvbUNoYW5uZWwoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+c2Nhbi5jb3VudHJ5Q29kZUN1cnJlbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRkbHNDaGFuU3dpdGNoLT50ZGxzT2ZmQ2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRkbHNDaGFuU3dpdGNoLT50ZGxzT2ZmQ2hCd09mZnNldCk7CisKKyAgICBpZihwTXNnVGRsc0NoYW5Td2l0Y2gtPm9wZXJDbGFzcyA9PSAwKQorICAgIHsKKworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9QRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiSW52YWxpZCBPcGVyYXRpbmcgY2xhc3MgMCAhISEiKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBNc2dUZGxzQ2hhblN3aXRjaCk7CisgICAgICAgIGdvdG8gbGltX3RkbHNfY2hhbl9zd2l0Y2hfZXJyb3I7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfUEUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAiJXM6IFRETFMgQ2hhbm5lbCBTd2l0Y2ggcGFyYW1zOiBzdGFJZHggJWQgY2xhc3MgJWQgY2ggJWQgYncgJWQiCisgICAgICAgICAgICAgICIgbW9kZSAlZCBjb3VudHJ5IGNvZGUgJWMlYyIsCisgICAgICAgICAgICAgICBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgIHBNc2dUZGxzQ2hhblN3aXRjaC0+c3RhSWR4LAorICAgICAgIC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ICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwgZVNJUl9GQUlMVVJFKTsKKyAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworfQorCisvKgorICogU2V0IDIwXzQwIEJTUyBDb2V4IElFIGluIFRETFMgZnJhbWVzLgorICovCit0U2lyUmV0U3RhdHVzIGxpbVByb2Nlc3NTbWVTZXRUZGxzMjA0MEJTU0NvZXhSZXEodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcE1zZ0J1ZikKK3sKKyAgICB0QW5pU2V0VGRsczIwNDBCU1NDb2V4ICpwbXNnID0gTlVMTDsKKyAgICBwbXNnID0gKHRBbmlTZXRUZGxzMjA0MEJTU0NvZXgqKSBwTXNnQnVmIDsKKworICAgIGlmIChOVUxMICE9IHBtc2cpIHsKKyAgICAgICAgcE1hYy0+bGltLkVuYWJsZVRkbHMyMDQwQlNTQ29leElFID0gcG1zZy0+U2V0VGRsczIwNDBCU1NDb2V4OworICAgIH0KKyAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9QRSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICIlczogMjBfNDAgQlNTIENvZXggSUUgaW4gVERMUyBmcmFtZXMgIgorICAgICAgICAgICAgICAicE1hYy0+bGltLkVuYWJsZVRkbHMyMDQwQlNTQ29leElFICVkICIsIF9fZnVuY19fLAorICAgICAgICAgICAgICBwTWFjLT5saW0uRW5hYmxlVGRsczIwNDBCU1NDb2V4SUUpOworCisgICAgcmV0dXJuIGVTSVJfU1VDQ0VTUzsKK30KKwordFNpclJldFN0YXR1cyBsaW1Qcm9jZXNzU21lRGVsQWxsVGRsc1BlZXJzKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBNc2dCd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yAgICAgICAgeworICAgICAgICAgICAgaWYgKENIRUNLX0JJVChwc2Vzc2lvbkVudHJ5LT5wZWVyQUlEQml0bWFwW2ldLCBhaWQpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBTdGFEcyA9IGRwaEdldEhhc2hFbnRyeShwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYWlkICsgaSooc2l6ZW9mKHRBTklfVTMyKSA8PCAzKSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsKKyAgICAgICAgICAgICAgICBpZiAoTlVMTCAhPSBwU3RhRHMpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkRlbGV0aW5nICJNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocFN0YURzLT5zdGFBZGRyKSk7CisKKyAgICAgICAgICAgICAgICAgICAgbGltU2VuZERlYXV0aE1nbXRGcmFtZShwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfTUFDX0RFQVVUSF9MRUFWSU5HX0JTU19SRUFTT04sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5zdGFBZGRyLCBwc2Vzc2lvbkVudHJ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZBTFNFKTsKKworICAgICAgICAgICAgICAgICAgICBsaW1UZGxzRGVsU3RhKHBNYWMsIHBTdGFEcy0+c3RhQWRkciwgcHNlc3Npb25FbnRyeSk7CisKKyAgICAgICAgICAgICAgICAgICAgZHBoRGVsZXRlSGFzaEVudHJ5KHBNYWMsIHBTdGFEcy0+c3RhQWRkciwgcFN0YURzLT5hc3NvY0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBsaW1SZWxlYXNlUGVlcklkeChwTWFjLCAoYWlkICsgaSooc2l6ZW9mKHRBTklfVTMyKSA8PCAzKSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSkgOworICAgICAgICAgICAgICAgIENMRUFSX0JJVChwc2Vzc2lvbkVudHJ5LT5wZWVyQUlEQml0bWFwW2ldLCBhaWQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIGVTSVJfU1VDQ0VTUzsKK30KZGlmZiAtLWdpdCBhL3dsYW4vcHJpbWEvQ09SRS9NQUMvc3JjL3BlL2xpbS9saW1Qcm9wRXh0c1V0aWxzLmMgYi93bGFuL3ByaW1hL0NPUkUvTUFDL3NyYy9wZS9saW0vbGltUHJvcEV4dHNVdGlscy5jCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjEzNDVhMTEKLS0tIC9kZXYvbnVsbAorKysgYi93bGFuL3ByaW1hL0NPUkUvTUFDL3NyYy9wZS9saW0vbGltUHJvcEV4dHNVdGlscy5jCkBAIC0wLDAgKzEsMjk4IEBACisvKgorICogQ29weXJpZ2h0IChjKSAyMDEyLTIwMTUgVGhlIExpbnV4IEZvdW5kYXRpb24uIEFsbCByaWdodHMgcmVzZXJ2ZWQuCisgKgorICogUHJldmlvdXNseSBsaWNlbnNlZCB1bmRlciB0aGUgSVNDIGxpY2Vuc2UgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICoKKyAqCisgKiBQZXJtaXNzaW9uIHRvIHVzZSwgY29weSwgbW9kaWZ5LCBhbmQvb3IgZGlzdHJpYnV0ZSB0aGlzIHNvZnR3YXJlIGZvcgorICogYW55IHB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UluZm9QcmVzZW50IHx8IHBCZWFjb25TdHJ1Y3QtPndtZUVkY2FQcmVzZW50CisgICAgICAgICAgICB8fCBwQmVhY29uU3RydWN0LT5IVENhcHMucHJlc2VudCkKKyAgICAgICAgICAgIExJTV9CU1NfQ0FQU19TRVQoV01FLCAqcW9zQ2FwKTsKKyAgICAgICAgaWYgKExJTV9CU1NfQ0FQU19HRVQoV01FLCAqcW9zQ2FwKSAmJiBwQmVhY29uU3RydWN0LT53c21DYXBhYmxlUHJlc2VudCkKKyAgICAgICAgICAgIExJTV9CU1NfQ0FQU19TRVQoV1NNLCAqcW9zQ2FwKTsKKyAgICAgICAgaWYgKHBCZWFjb25TdHJ1Y3QtPnByb3BJRWluZm8uYW5pSW5kaWNhdG9yICYmCisgICAgICAgICAgICBwQmVhY29uU3RydWN0LT5wcm9wSUVpbmZvLmNhcGFiaWxpdHlQcmVzZW50KQorICAgICAgICAgICAgKnByb3BDYXAgPSBwQmVhY29uU3RydWN0LT5wcm9wSUVpbmZvLmNhcGFiaWxpdHk7CisgICAgICAgIGlmIChwQmVhY29uU3RydWN0LT5IVENhcHMucHJlc2VudCkKKyAgICAgICAgICAgIHBNYWMtPmxpbS5odENhcGFiaWxpdHlQcmVzZW50SW5CZWFjb24gPSAxOworICAgICAgICBlbHNlCisgICAgICAgICAgICBwTWFjLT5saW0uaHRDYXBhYmlsaXR5UHJlc2VudEluQmVhY29uID0gMDsKKworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1BFLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19NRUQsCisgICAgICAgICAgICAiKioqYmVhY29uLlZIVENhcHMucHJlc2VudCoqKioqPSVkIEJTU19WSFRfQ0FQQUJMRTolZCIsCisgICAgICAgICAgICBwQmVhY29uU3RydWN0LT5WSFRDYXBzLnByZXNlbnQsCisgICAgICAgICAgICBJU19CU1NfVkhUX0NBUEFCTEUocEJlYWNvblN0cnVjdC0+VkhUQ2FwcykpOworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9QRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fTUVELAorICAgICAgICAgICAiKioqYmVhY29uLlNVIEJlYW1mb3JtZXIgQ2FwYWJsZSoqKioqPSVkIixwQmVhY29uU3RydWN0LT5WSFRDYXBzLnN1QmVhbUZvcm1lckNhcCk7CisKKyAgICAgICAgaWYgKElTX0JTU19WSFRfQ0FQQUJMRShwQmVhY29uU3RydWN0LT5WSFRDYXBzKQorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwQmVhY29uU3RydWN0LT5WSFRPcGVyYXRpb24ucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+dmh0Q2FwYWJpbGl0eVByZXNlbnRJbkJlYWNvbiA9IDE7CisgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5hcENlbnRlckNoYW4gPSBwQmVhY29uU3RydWN0LT5WSFRPcGVyYXRpb24uY2hhbkNlbnRlckZyZXFTZWcxOworICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+YXBDaGFuV2lkdGggPSBwQmVhY29uU3RydWN0LT5WSFRPcGVyYXRpb24uY2hhbldpZHRoOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+dmh0Q2FwYWJpbGl0eVByZXNlbnRJbkJlYWNvbiA9IDA7CisgICAgICAgIH0KKyNlbmRpZgorICAgICAgICAvLyBFeHRyYWN0IHRoZSBVQVBTRCBmbGFnIGZyb20gV01NIFBhcmFtZXRlciBlbGVtZW50CisgICAgICAgIGlmIChwQmVhY29uU3RydWN0LT53bWVFZGNhUHJlc2VudCkKKyAgICAgICAgICAgICp1YXBzZCA9IHBCZWFjb25TdHJ1Y3QtPmVkY2FQYXJhbXMucW9zSW5mby51YXBzZDsKKworICAgICAgICAvKiBHZXQgTWF4VHhQd3IgZnJvbSBjb3VudHJ5IElFIGlmIHByZXNlbnQuCisgICAgICAgICAgIElmIHRoZSBjaGFubmVsIG51bWJlciBmaWVsZCBoYXMgYSBwb3NpdGl2ZSAgaW50ZWdlciB2YWx1ZSBsZXNzCisgICAgICAgICAgIHRoYW4gMjAxLCB0aGVuIGl0IGNvbnRhaW5zIGEgcG9zaXRpdmUgaW50ZWdlciB2YWx1ZSB0aGF0IGluZGljYXRlcworICAgICAgICAgICB0aGUgbG93ZXN0IGNoYW5uZWwgbnVtYmVyIGluIHRoZSBzdWJiYW5kICovCisKKyAgICAgICAgaWYgKHBCZWFjb25TdHJ1Y3QtPmNvdW50cnlJbmZvUHJlc2VudCAmJgorICAgICAgICAgICAgcEJlYWNvblN0cnVjdC0+Y291bnRyeUluZm9QYXJhbS5jaGFubmVsVHJhbnNtaXRQb3dlclswXS5jaGFubmVsTnVtYmVyIDwgTElNX09QRVJBVElOR19FWFRfSURFTlRJRklFUiApCisgICAgICAgIHsKKyAgICAgICAgICAgIGludCBpOworICAgICAgICAgICAgdEFOSV9VOCBmaXJzdENoYW5uZWwgPTAsIG51bUNoYW5uZWxzID0wOworICAgICAgICAgICAgdEFOSV9VOCBjaGFubmVsID0gcHNlc3Npb25FbnRyeS0+Y3VycmVudE9wZXJDaGFubmVsOworCisgICAgICAgICAgICBmb3IgKGk9MDsgaSA8IHBCZWFjb25TdHJ1Y3QtPmNvdW50cnlJbmZvUGFyYW0ubnVtSW50ZXJ2YWxzOyArK2kpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGkgPj0gQ09VTlRSWV9JTkZPX01BWF9DSEFOTkVMKQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGZpcnN0Q2hhbm5lbCA9IHBCZWFjb25TdHJ1Y3QtPmNvdW50cnlJbmZvUGFyYW0uY2hhbm5lbFRyYW5zbWl0UG93ZXJbaV0uY2hhbm5lbE51bWJlcjsKKyAgICAgICAgICAgICAgICBudW1DaGFubmVscyA9IHBCZWFjb25TdHJ1Y3QtPmNvdW50cnlJbmZvUGFyYW0uY2hhbm5lbFRyYW5zbWl0UG93ZXJbaV0ubnVtQ2hhbm5lbDsKKworICAgICAgICAgICAgICAgIGlmICgoY2hhbm5lbCA+PSBmaXJzdENoYW5uZWwpICYmCisgICAgICAgICAgICAgICAgICAgIChjaGFubmVsIDwgKGZpcnN0Q2hhbm5lbCArIG51bUNoYW5uZWxzKSkpCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoaSA8IHBCZWFjb25TdHJ1Y3QtPmNvdW50cnlJbmZvUGFyYW0ubnVtSW50ZXJ2YWxzICYmIGkgPCBDT1VOVFJZX0lORk9fTUFYX0NIQU5ORUwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKmxvY2FsQ29uc3RyYWludCA9IHBCZWFjb25TdHJ1Y3QtPmNvdW50cnlJbmZvUGFyYW0uY2hhbm5lbFRyYW5zbWl0UG93ZXJbaV0ubWF4VHJhbnNtaXRQb3dlcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorI2lmIGRlZmluZWQgRkVBVFVSRV9XTEFOX0VTRQorICAgICAgICAvKiBJZiB0aGVyZSBpcyBQb3dlciBDb25zdHJhaW50IEVsZW1lbnQgc3BlY2lmaWNhbGx5LAorICAgICAgICAgKiBhZGFwdCB0byBpdC4gSGVuY2UgdGhlcmUgaXMgZWxzZSBjb25kaXRpb24gY2hlY2sKKyAgICAgICAgICogZm9yIHRoaXMgaWYgc3RhdGVtZW50LgorICAgICAgICAgKi8KKyAgICAgICAgaWYgKCBwQmVhY29uU3RydWN0LT5lc2VUeFB3ci5wcmVzZW50KQorICAgICAgICB7CisgICAgICAgICAgICAqbG9jYWxDb25zdHJhaW50ID0gcEJlYWNvblN0cnVjdC0+ZXNlVHhQd3IucG93ZXJfbGltaXQ7CisgICAgICAgIH0KKyNlbmRpZgorICAgICAgICBpZiAocEJlYWNvblN0cnVjdC0+cG93ZXJDb25zdHJhaW50UHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgKmxvY2FsQ29uc3RyYWludCAtPSBwQmVhY29uU3RydWN0LT5sb2NhbFBvd2VyQ29uc3RyYWludC5sb2NhbFBvd2VyQ29uc3RyYWludHM7CisgICAgICAgIH0KKyNpZiAhZGVmaW5lZCBXTEFOX0ZFQVRVUkVfVk9XSUZJCisgICAgICAgIGxvY2FsUG93ZXJDb25zdHJhaW50cyA9ICh0QU5JX1UzMilwQmVhY29uU3RydWN0LT5sb2NhbFBvd2VyQ29uc3RyYWludC5sb2NhbFBvd2VyQ29uc3RyYWludHM7CisgICAgICAgIGlmIChjZmdTZXRJbnQocE1hYywgV05JX0NGR19MT0NBTF9QT1dFUl9DT05TVFJBSU5ULCBsb2NhbFBvd2VyQ29uc3RyYWludHMpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJDb3VsZCBub3QgdXBkYXRlIGxvY2FsIHBvd2VyIGNvbnN0cmFpbnQgdG8gY2ZnLiIpKTsKKyAgICAgICAgfQorI2VuZGlmCisgICAgICAgIHBzZXNzaW9uRW50cnktPmNvdW50cnlJbmZvUHJlc2VudCA9IEZBTFNFOyAvKiBJbml0aWFsaXppbmcgYmVmb3JlIGZpcnN0IHVzZSAqLworICAgICAgICBpZiAocEJlYWNvblN0cnVjdC0+Y291bnRyeUluZm9QcmVzZW50KQorICAgICAgICB7CisgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5jb3VudHJ5SW5mb1ByZXNlbnQgPSBUUlVFOworICAgICAgICB9CisgICAgICAgIC8qIENoZWNrIGlmIEV4dGVuZGVkIGNhcHMgYXJlIHByZXNlbnQgaW4gcHJvYmUgcmVzcCBvciBub3QgKi8KKyAgICAgICAgaWYgKHBCZWFjb25TdHJ1Y3QtPkV4dENhcC5wcmVzZW50KQorICAgIC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SBDRkcuCisgICAgICAgICAqIExvZyBlcnJvci4KKyAgICAgICAgICovCisgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSB2YWxpZCBjaGFubmVsIGxpc3QiKSk7KQorCisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICAvLyBUaW1lIHRvIHBlcmZvcm0gYmFja2dyb3VuZCBzY2FuLiBQcmVwYXJlIGFuZCBpc3N1ZQorICAgIC8vIFNNRV9TQ0FOX1JFUSB0byBTTUUgU3RhdGUgbWFjaGluZQorICAgIHNtZVNjYW5SZXEubWVzc2FnZVR5cGUgPSBlV05JX1NNRV9TQ0FOX1JFUTsKKyAgICBzbWVTY2FuUmVxLmxlbmd0aCAgICAgID0gc2l6ZW9mKHRTaXJTbWVTY2FuUmVxKTsKKyAgICBzbWVTY2FuUmVxLmJzc1R5cGUgICAgID0gZVNJUl9JTkZSQVNUUlVDVFVSRV9NT0RFOworICAgIHZvc19tZW1fY29weSggKHRBTklfVTggKikgc21lU2NhblJlcS5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopICZiY0FkZHIsIHNpemVvZih0U2lyTWFjQWRkcikpOworIAorICAgIGlmICh3bGFuX2NmZ0dldFN0cihwTWFjLCBXTklfQ0ZHX1NTSUQsCisgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopIChzbWVTY2FuUmVxLnNzSWRbMF0uc3NJZCksCisgICAgICAgICAgICAgICAgICAgICh0QU5JX1UzMiAqKSAmc3NpZExlbikgIT0gZVNJUl9TVUNDRVNTKQorICAgIHsKKyAgICAgICAgLy8vIENvdWxkIG5vdCBnZXQgU1NJRCBmcm9tIENGRy4gTG9nIGVycm9yLgorICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBTU0lEIikpOworICAgIH0KKyAgICBzbWVTY2FuUmVxLnNzSWRbMF0ubGVuZ3RoID0gKHRBTklfVTgpIHNzaWRMZW47CisgICAgc21lU2NhblJlcS5udW1Tc2lkID0gMTsKKworICAgIHNtZVNjYW5SZXEuc2NhblR5cGUgICAgPSBlU0lSX0FDVElWRV9TQ0FOOworICAgIHNtZVNjYW5SZXEuc2Vzc2lvbklkID0gMDsKKworICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0FDVElWRV9NSU5JTVVNX0NIQU5ORUxfVElNRSwKKyAgICAgICAgICAgICAgICAgICZzbWVTY2FuUmVxLm1pbkNoYW5uZWxUaW1lKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgeworICAgICAgICAvLy8gQ291bGQgbm90IGdldCBtaW5DaGxUaW1lIHZhbHVlIGZyb20gQ0ZHLiBMb2cgZXJyb3IuCisgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBtaW5DaGxUaW1lIHZhbHVlIikpOykKKworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfQUNUSVZFX01BWElNVU1fQ0hBTk5FTF9USU1FLAorICAgICAgICAgICAgICAgICAgJnNtZVNjYW5SZXEubWF4Q2hhbm5lbFRpbWUpICE9IGVTSVJfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIC8vLyBDb3VsZCBub3QgZ2V0IG1heENobFRpbWUgdmFsdWUgZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IHJldHJpZXZlIG1heENobFRpbWUgdmFsdWUiKSk7KQorCisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBzbWVTY2FuUmVxLnJldHVybkFmdGVyRmlyc3RNYXRjaCA9IDA7CisgICAgc21lU2NhblJlcS5yZXR1cm5VbmlxdWVSZXN1bHRzICAgPSAxOworC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X1NDQU5fUEVSSU9EIAorICAgICAgICAgKiBpbmRpY2F0aW9uIHRvIHN0YXJ0IHRoZSBiYWNrZ3JvdW5kIHNjYW4gYWdhaW4uCisgICAgICAgICAqLworICAgICAgICBpZiAoVFhfVElNRVJfVkFMSUQocE1hYy0+bGltLmxpbVRpbWVycy5nTGltQmFja2dyb3VuZFNjYW5UaW1lcikpCisgICAgICAgIHsKKyAgICAgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RJTUVSX0RFQUNUSVZBVEUsIE5PX1NFU1NJT04sIGVMSU1fQkFDS0dST1VORF9TQ0FOX1RJTUVSKSk7CisgICAgICAgICAgICBpZiAodHhfdGltZXJfZGVhY3RpdmF0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltQmFja2dyb3VuZFNjYW5UaW1lcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBUWF9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIENvdWxkIG5vdCBkZWFjdGl2YXRlIEJhY2tncm91bmRTY2FuVGltZXIgdGltZXIuCisgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgRkwoInVuYWJsZSB0byBkZWFjdGl2YXRlIEJhY2tncm91bmRTY2FuVGltZXIgdGltZXIiKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwTWFjLT5saW0uZ0xpbUJhY2tncm91bmRTY2FuVGVybWluYXRlID0gVFJVRTsKKworICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJTZW5kIGR1bW15IHNjYW4gd2l0aCByZXR1cm5GcmVzaFJlc3VsdHMgYXMgMCB0byByZXBvcnQgQkcgc2NhbiByZXN1bHRzIHRvIFNNRS4iKSk7KQorICAgICAgICByZXR1cm47CisgICAgfQorICAgIHNtZV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gICAgLyoqCisgICAgICAgICAqIEJlYWNvbi9Qcm9iZSBSZXNwb25zZSBpcyByZWNlaXZlZCBkdXJpbmcgYWN0aXZlIHNjYW5uaW5nLgorICAgICAgICAgKiBEZWFjdGl2YXRlIE1JTiBjaGFubmVsIHRpbWVyIGlmIHJ1bm5pbmcuCisgICAgICAgICAqLworCisgICAgICAgIGxpbURlYWN0aXZhdGVBbmRDaGFuZ2VUaW1lcihwTWFjLGVMSU1fTUlOX0NIQU5ORUxfVElNRVIpOworICAgICAgICBpZiAodHhfdGltZXJfYWN0aXZhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbU1heENoYW5uZWxUaW1lcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IFRYX1RJTUVSX0VSUk9SKQorICAgICAgICB7CisgICAgICAgICAgICAvLy8gQ291bGQgbm90IGFjdGl2YXRlIG1heCBjaGFubmVsIHRpbWVyLgorICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICBsaW1Mb2cocE1hYyxMT0dQLCBGTCgiY291bGQgbm90IGFjdGl2YXRlIG1heCBjaGFubmVsIHRpbWVyIikpOworCisgICAgICAgICAgICBsaW1Db21wbGV0ZU1sbVNjYW4ocE1hYywgZVNJUl9TTUVfUkVTT1VSQ0VTX1VOQVZBSUxBQkxFKTsKKyAgICAgICAgICAgIHJldHVybiBUWF9USU1FUl9FUlJPUjsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworfSAvKioqIGVuZCBsaW1EZWFjdGl2YXRlTWluQ2hhbm5lbFRpbWVyRHVyaW5nU2NhbigpICoqKi8KKworCisKKy8qKgorICogbGltQ29sbGVjdEJzc0Rlc2NyaXB0aW9uKCkKKyAqCisgKkZVTkNUSU9OOgorICogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZHVyaW5nIHNjYW4gdXBvbiByZWNlaXZpbmcKKyAqIEJlYWNvbi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V0SW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICBmU2Nhbm5pbmcpCisjZWxzZQorZUhhbFN0YXR1cworbGltQ29sbGVjdEJzc0Rlc2NyaXB0aW9uKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgdFNpckJzc0Rlc2NyaXB0aW9uICpwQnNzRGVzY3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJQcm9iZVJlc3BCZWFjb24gcEJQUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwUnhQYWNrZXRJbmZvKQorI2VuZGlmCit7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAqcEJvZHk7CisgICAgdEFOSV9VMzIgICAgICAgICAgICBpZUxlbiA9IDA7CisgICAgdHBTaXJNYWNNZ210SGRyICAgICBwSGRyOworICAgIHRBTklfVTggICAgICAgICAgICAgY2hhbm5lbE51bTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgIHJ4Q2hhbm5lbDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgIHJmQmFuZCA9IDA7CisKKyAgICBwSGRyID0gV0RBX0dFVF9SWF9NQUNfSEVBREVSKHBSeFBhY2tldEluZm8pOworICAgIFZPU19BU1NFUlQoV0RBX0dFVF9SWF9QQVlMT0FEX0xFTihwUnhQYWNrZXRJbmZvKSA+PSBTSVJfTUFDX0JfUFJfU1NJRF9PRkZTRVQpOworICAgIGllTGVuICAgID0gV0RBX0dFVF9SWF9QQVlMT0FEX0xFTihwUnhQYWNrZXRJbmZvKSAtIFNJUl9NQUNfQl9QUl9TU0lEX09GRlNFVDsKKyAgICByeENoYW5uZWwgPSBXREFfR0VUX1JYX0NIKHBSeFBhY2tldEluZm8pOworICAgIHBCb2R5ID0gV0RBX0dFVF9SWF9NUERVX0RBVEEocFJ4UGFja2V0SW5mbyk7CisgICAgcmZCYW5kID0gV0RBX0dFVF9SWF9SRkJBTkQocFJ4UGFja2V0SW5mbyk7CisKKyAgICAvKioKKyAgICAgKiBEcm9wIGFsbCB0aGUgYmVhY29ucyBhbmQgcHJvYmUgcmVzcG9uc2Ugd2l0aG91dCBQMlAgSUUgZHVyaW5nIFAyUCBzZWFyY2gKKyAgICAgKi8KKyAgICBpZiAoTlVMTCAhPSBwTWFjLT5saW0uZ3BMaW1NbG1TY2FuUmVxICYmIHBNYWMtPmxpbS5ncExpbU1sbVNjYW5SZXEtPnAycFNlYXJjaCkKKyAgICB7CisgICAgICAgIGlmIChOVUxMID09IGxpbUdldFAycElFUHRyKHBNYWMsIChwQm9keSArIFNJUl9NQUNfQl9QUl9TU0lEX09GRlNFVCksIGllTGVuKSkKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0czLCBNQUNfQUREUkVTU19TVFIsIE1BQ19BRERSX0FSUkFZKHBIZHItPmJzc0lkKSk7CisgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIExlbmd0aCBvZiBCU1MgZGVzcmlwdGlvbiBpcyB3aXRob3V0IGxlbmd0aCBvZgorICAgICAqIGxlbmd0aCBpdHNlbGYgYW5kIGxlbmd0aCBvZiBwb2ludGVyCisgICAgICogdGhhdCBob2xkcyB0aGUgbmV4dCBCU1MgZGVzY3JpcHRpb24KKyAgICAgKi8KKyAgICBwQnNzRGVzY3ItPmxlbmd0aCA9ICh0QU5JX1UxNikoCisgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyQnNzRGVzY3JpcHRpb24pIC0gc2l6ZW9mKHRBTklfVTE2KSAtCisgICAgICAgICAgICAgICAgICAgIHNpemVvZih0QU5JX1UzMikgKyBpZUxlbik7CisKKyAgICAvLyBDb3B5IEJTUyBJZAorICAgIHZvc19tZW1fY29weSgodEFOSV9VOCAqKSAmcEJzc0Rlc2NyLT5ic3NJZCwKKyAgICAgICAgICAgICAgICAgKHRBTklfVTggKikgcEhkci0+YnNzSWQsCisgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKworICAgIC8vIENvcHkgVGltZXN0YW1wLCBCZWFjb24gSW50ZXJ2YWwgYW5kIENhcGFiaWxpdHkgSW5mbworICAgIHBCc3NEZXNjci0+c2NhblN5c1RpbWVNc2VjID0gdm9zX3RpbWVyX2dldF9zeXN0ZW1fdGltZSgpOworCisgICAgcEJzc0Rlc2NyLT50aW1lU3RhbXBbMF0gICA9IHBCUFItPnRpbWVTdGFtcFswXTsKKyAgICBwQnNzRGVzY3ItPnRpbWVTdGFtcFsxXSAgID0gcEJQUi0+dGltZVN0YW1wWzFdOworICAgIHBCc3NEZXNjci0+YmVhY29uSW50ZXJ2YWwgPSBwQlBSLT5iZWFjb25JbnRlcnZhbDsKKyAgICBwQnNzRGVzY3ItPmNhcGFiaWxpdHlJbmZvID0gbGltR2V0VTE2KCh0QU5JX1U4ICopICZwQlBSLT5jYXBhYmlsaXR5SW5mbyk7CisKKyAgICAgaWYoIXBCc3NEZXNjci0+YmVhY29uSW50ZXJ2YWwgKQorICAgIHsKKwkJCSAgICAgICAgbGltTG9nKHBNYWMsIExPR1csCisgICAgICAgICAgICBGTCgiQmVhY29uIEludGVydmFsIGlzIFpFUk8sIG1ha2luZyBpdCB0byBkZWZhdWx0IDEwMCAiCisgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIpLCBNQUNfQUREUl9BUlJBWShwSGRyLT5ic3NJZCkpOworICAgICAgICBwQnNzRGVzY3ItPmJlYWNvbkludGVydmFsPSAxMDA7CisgICAgfQkKKyAgICAvKgorICAgICogVGhlcmUgaXMgYSBuYXJyb3cgd2luZG93IGFmdGVyIENoYW5uZWwgU3dpdGNoIG1zZyBpcyBzZW50IHRvIEhBTCBhbmQgYmVmb3JlIHRoZSBBR0MgaXMgc2h1dAorICAgICogZG93biBhbmQgYmVhY29ucy9Qcm9iZSBSc3BzIGNhbiB0cmlja2xlIG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AgICAgdEFOSV9VOCAqcFJ4UGFja2V0SW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9CT09MRUFOIGZTY2FubmluZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBmUHJvYmVSc3ApCit7CisgICAgdExpbVNjYW5SZXN1bHROb2RlICAgKnBCc3NEZXNjcjsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgZnJhbWVMZW4sIGllTGVuID0gMDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgcnhDaGFubmVsSW5CZWFjb24gPSAwOworICAgIGVIYWxTdGF0dXMgICAgICAgICAgICBzdGF0dXM7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgIGRvbnRVcGRhdGVBbGwgPSAwOworICAgIHRBTklfVTggICAgICAgICAgICAgICByZkJhbmQgPSAwOworICAgIHRBTklfVTggICAgICAgICAgICAgICByeENoYW5uZWxJbkJEID0gMDsKKworICAgIHRTaXJNYWNBZGRyIGJzc2lkID0gezB4ZmYsIDB4ZmYsIDB4ZmYsIDB4ZmYsIDB4ZmYsIDB4ZmZ9OworICAgIHRTaXJNYWNBZGRyIGJzc2lkX3plcm8gPSAgezB4MCwgMHgwLCAweDAsIDB4MCwgMHgwLCAweDB9OworICAgIHRBTklfQk9PTEVBTiBmRm91bmQgPSBGQUxTRTsKKyAgICB0cFNpck1hY0RhdGFIZHIzYSBwSGRyOworCisgICAgcEhkciA9IFdEQV9HRVRfUlhfTVBEVUhFQURFUjNBKCh0QU5JX1U4ICopcFJ4UGFja2V0SW5mbyk7CisKKyAgICAvLyBDaGVjayBGb3IgTnVsbCBCU1NJRDsgU2tpcCBpbiBjYXNlIG9mIFAyUC4KKyAgICBpZiAodm9zX21lbV9jb21wYXJlKGJzc2lkX3plcm8sICZwSGRyLT5hZGRyMywgNikpCisgICAgeworICAgICAgICByZXR1cm4gOworICAgIH0KKworICAgIC8vQ2hlY2tpbmcgaWYgc2Nhbm5pbmcgZm9yIGEgcGFydGljdWxhciBCU1NJRAorICAgIGlmICgoZlNjYW5uaW5nKSAmJiAocE1hYy0+bGltLmdwTGltTWxtU2NhblJlcSkpIAorICAgIHsKKyAgICAgICAgZkZvdW5kID0gdm9zX21lbV9jb21wYXJlKHBIZHItPmFkZHIzLCAmcE1hYy0+bGltLmdwTGltTWxtU2NhblJlcS0+YnNzSWQsIDYpOworICAgICAgICBpZiAoIWZGb3VuZCkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKChwTWFjLT5saW0uZ3BMaW1NbG1TY2FuUmVxLT5wMnBTZWFyY2gpICYmCisgICAgICAgICAgICAgICAodm9zX21lbV9jb21wYXJlKHBCUFItPlAyUFByb2JlUmVzLlAyUERldmljZUluZm8uUDJQRGV2aWNlQWRkcmVzcywKKyAgICAgICAgICAgICAgICZwTWFjLT5saW0uZ3BMaW1NbG1TY2FuUmVxLT5ic3NJZCwgNikpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGZGb3VuZCA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogQ29tcGFyZSBTU0lEIHdpdGggdGhlIG9uZSBzZW50IGluCisgICAgICogUHJvYmUgUmVxdWVzdCBmcmFtZSwgaWYgYW55LgorICAgICAqIElmIHRoZXkgZG9uJ3QgbWF0Y2gsIGlnbm9yZSB0aGUKKyAgICAgKiBCZWFjb24gZnJhbWUuCisgICAgICogcE1hYy0+bGltLmdMaW1NbG1TY2FuUmVxLT5zc0lkLmxlbmd0aCA9PSAwCisgICAgICogaW5kaWNhdGVzIEJyb2FkY2FzdCBTU0lELgorICAgICAqIFdoZW4gZ0xpbVJldHVybkFmdGVyRmlyc3RNYXRjaCBpcyBzZXQsIGl0IG1lYW5zIHRoZSBzY2FuIGhhcyB0byBtYXRjaCAKKyAgICAgKiBhIFNTSUQgKGlmIGl0IGlzIGFsc28gc2V0KS4gSWdub3JlIHRoZSBvdGhlciBCU1MgaW4gdGhhdCBjYXNlLgorICAgICAqLworCisjaWZkZWYgV0xBTl9GRUFUVVJFX1JPQU1fU0NBTl9PRkZMT0FECisgICAgaWYgKCEoV0RBX0dFVF9PRkZMT0FEU0NBTkxFQVJOKHBSeFBhY2tldEluZm8pKSkKKyAgICB7CisjZW5kaWYKKyAgICAgIGlmICgocE1hYy0+bGltLmdwTGltTWxtU2NhblJlcSkgJiYKKyAgICAgICAgICgoKGZTY2FubmluZykgJiYKKyAgICAgICAgICAgKCBwTWFjLT5saW0uZ0xpbVJldHVybkFmdGVyRmlyc3RNYXRjaCAmIDB4MDEgKSAmJgorICAgICAgICAgICAocE1hYy0+bGltLmdwTGltTWxtU2NhblJlcS0+bnVtU3NpZCkgJiYKKyAgICAgICAgICAgIWxpbUlzU2NhblJlcXVlc3RlZFNTSUQocE1hYywgJnBCUFItPnNzSWQpKSB8fAorICAgICAgICAgICghZkZvdW5kICYmIChwTWFjLT5saW0uZ3BMaW1NbG1TY2FuUmVxICYmCisgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5ncExpbU1sbVNjYW5SZXEtPmJzc0lkKSAmJgorICAgICAgICAgICAhdm9zX21lbV9jb21wYXJlKGJzc2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBNYWMtPmxpbS5ncExpbU1sbVNjYW5SZXEtPmJzc0lkLCA2KSkpKQorICAgIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFJlY2VpdmVkIFNTSUQgZG9lcyBub3QgbWF0Y2ggd2l0aAorICAgICAgICAgKiB0aGUgb25lIHdlJ3JlIHNjYW5uaW5nIGZvci4KKyAgICAgICAgICogSWdub3JlIHJlY2VpdmVkIEJlYWNvbiBmcmFtZQorICAgICAgICAgKi8KKworICAgICAgICByZXR1cm47CisgICAgfQorI2lmZGVmIFdMQU5fRkVBVFVSRV9ST0FNX1NDQU5fT0ZGTE9BRAorICAgIH0KKyNlbmRpZgorCisgICAgLyogVGhlc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gIHJ4Q2hhbm5lbEluQkQgPSBXREFfR0VUX1JYX0NIKHBSeFBhY2tldEluZm8pOworCisgICAgICAgaWYgKCghcmZCYW5kKSB8fCBJU181R19CQU5EKHJmQmFuZCkpCisgICAgICAgeworICAgICAgICAgIHJ4Q2hhbm5lbEluQkQgPSBsaW1Vbm1hcENoYW5uZWwocnhDaGFubmVsSW5CRCk7CisgICAgICAgfQorCisgICAgICAgaWYocnhDaGFubmVsSW5CRCAhPSByeENoYW5uZWxJbkJlYWNvbikKKyAgICAgICB7CisgICAgICAgICAgLyogQkNBU1QgRnJhbWUsIGlmIENIIGRvIG5vdCBtYXRjaCwgRHJvcCAqLworICAgICAgICAgICBpZihXREFfSVNfUlhfQkNBU1QocFJ4UGFja2V0SW5mbykpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMywgRkwoIkJlYWNvbi9Qcm9iZSBSc3AgZHJvcHBlZC4gQ2hhbm5lbCBpbiBCRCAlZC4gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQ2hhbm5lbCBpbiBiZWFjb24iICIgJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgV0RBX0dFVF9SWF9DSChwUnhQYWNrZXRJbmZvKSxsaW1HZXRDaGFubmVsRnJvbUJlYWNvbihwTWFjLCBwQlBSKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICB9CisgICAgICAgICAgIC8qIFVuaXQgY2FzdCBmcmFtZSwgUHJvYmUgUlNQLCBkbyBub3QgZHJvcCAqLworICAgICAgICAgICBlbHNlCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZG9udFVwZGF0ZUFsbCA9IDE7CisgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0czLCBGTCgiU1NJRCAlcywgQ0ggaW4gUHJvYmVSc3AgJWQsIENIIGluIEJEICVkLCBtaXNzLW1hdGNoLCBEbyBOb3QgRHJvcCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCUFItPnNzSWQuc3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByeENoYW5uZWxJbkJlYWNvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXREFfR0VUX1JYX0NIKHBSeFBhY2tldEluZm8pKTsKKyAgICAgICAgICAgICAgV0RBX0dFVF9SWF9DSChwUnhQYWNrZXRJbmZvKSA9IHJ4Q2hhbm5lbEluQmVhY29uOworICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBBbGxvY2F0ZSBidWZmZXIgdG8gaG9sZCBCU1MgZGVzY3JpcHRpb24gZnJvbQorICAgICAqIHJlY2VpdmVkIEJlYWNvbiBmcmFtZS4KKyAgICAgKiBJbmNsdWRlIHNpemUgb2YgZml4ZWQgZmllbGRzIGFuZCBJRXMgbGVuZ3RoCisgICAgICovCisKKyAgICBpZUxlbiA9IFdEQV9HRVRfUlhfUEFZTE9BRF9MRU4ocFJ4UGFja2V0SW5mbyk7CisgICAgaWYgKGllTGVuIDw9IFNJUl9NQUNfQl9QUl9TU0lEX09GRlNFVCkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgRkwoIlJYIHBhY2tldCBoYXMgaW52YWxpZCBsZW5ndGggJWQiKSwgaWVMZW4pOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaWVMZW4gLT0gU0lSX01BQ19CX1BSX1NTSURfT0ZGU0VUOworCisgICAgZnJhbWVMZW4gPSBzaXplb2YodExpbVNjYW5SZXN1bHROb2RlKSArIGllTGVuIC0gc2l6ZW9mKHRBTklfVTMyKTsgLy9TaXplb2YodEFOSV9VMzIpIGlzIGZvciBpZUZpZWxkc1sxXQorCisgICAgcEJzc0Rlc2NyID0gdm9zX21lbV9tYWxsb2MoZnJhbWVMZW4pOworICAgIGlmICggT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tPmxpbS5nTGltUmV0dXJuVW5pcXVlUmVzdWx0cyB8fCAoIWZTY2FubmluZykpCisgICAgeworICAgICAgICBzdGF0dXMgPSBsaW1Mb29rdXBOYWRkSGFzaEVudHJ5KHBNYWMsIHBCc3NEZXNjciwgTElNX0hBU0hfVVBEQVRFLCBkb250VXBkYXRlQWxsKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgc3RhdHVzID0gbGltTG9va3VwTmFkZEhhc2hFbnRyeShwTWFjLCBwQnNzRGVzY3IsIExJTV9IQVNIX0FERCwgZG9udFVwZGF0ZUFsbCk7CisgICAgfQorCisgICAgaWYoZlNjYW5uaW5nKQorICAgIHsKKyAgICAgICAgaWYgKChwQnNzRGVzY3ItPmJzc0Rlc2NyaXB0aW9uLmNoYW5uZWxJZCA8PSAxNCkgJiYKKyAgICAgICAgICAgIChwTWFjLT5saW0uZ0xpbVJldHVybkFmdGVyRmlyc3RNYXRjaCAmIDB4NDApICYmCisgICAgICAgICAgICBwQlBSLT5jb3VudHJ5SW5mb1ByZXNlbnQpCisgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbTI0QmFuZDExZFNjYW5Eb25lID0gMTsKKworICAgICAgICBpZiAoKHBCc3NEZXNjci0+YnNzRGVzY3JpcHRpb24uY2hhbm5lbElkID4gMTQpICYmCisgICAgICAgICAgICAocE1hYy0+bGltLmdMaW1SZXR1cm5BZnRlckZpcnN0TWF0Y2ggJiAweDgwKSAmJgorICAgICAgICAgICAgcEJQUi0+Y291bnRyeUluZm9QcmVzZW50KQorICAgICAgICAgICAgcE1hYy0+bGltLmdMaW01MEJhbmQxMWRTY2FuRG9uZSA9IDE7CisKKyAgICAgICAgaWYgKCAoIHBNYWMtPmxpbS5nTGltUmV0dXJuQWZ0ZXJGaXJzdE1hdGNoICYgMHgwMSApIHx8CisgICAgICAgICAgICAgKCBwTWFjLT5saW0uZ0xpbTI0QmFuZDExZFNjYW5Eb25lICYmICggcE1hYy0+bGltLmdMaW1SZXR1cm5BZnRlckZpcnN0TWF0Y2ggJiAweDQwICkgKSB8fAorICAgICAgICAgICAgICggcE1hYy0+bGltLmdMaW01MEJhbmQxMWRTY2FuRG9uZSAmJiAoIHBNYWMtPmxpbS5nTGltUmV0dXJuQWZ0ZXJGaXJzdE1hdGNoICYgMHg4MCApICkgfHwKKyAgICAgICAgICAgICAgZkZvdW5kICkKKyAgICAgICAgeworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBTdG9wIHNjYW5uaW5nIGFuZCByZXR1cm4gdGhlIEJTUyBkZXNjcmlwdGlvbihzKQorICAgICAgICAgICAgICogY29sbGVjdGVkIHNvIGZhci4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgbGltTG9nKHBNYWMsCisgICAgICAgICAgICAgICAgICAgTE9HVywKKyAgICAgICAgICAgICAgICAgICBGTCgiQ29tcGxldGVkIHNjYW46IDI0QmFuZDExZFNjYW4gPSAlZCwgNTBCYW5kMTFkU2NhbiA9ICVkIEJTUyBpZCIpLAorICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltMjRCYW5kMTFkU2NhbkRvbmUsCisgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW01MEJhbmQxMWRTY2FuRG9uZSk7CisKKyAgICAgICAgICAgIC8vTmVlZCB0byBkaXNhYmxlIHRoZSB0aW1lcnMuIElmIHRoZXkgZmlyZSwgdGhleSB3aWxsIHNlbmQgRU5EX1NDQU4KKyAgICAgICAgICAgIC8vd2hpbGUgd2UgYWxyZWFkeSBzZW5kIEZJTklTSF9TQ0FOIGhlcmUuIFRoaXMgbWF5IG1lc3MgdXAgdGhlIGdMaW1IYWxTY2FuU3RhdGUKKyAgICAgICAgICAgIGxpbURlYWN0aXZhdGVBbmRDaGFuZ2VUaW1lcihwTWFjLCBlTElNX01JTl9DSEFOTkVMX1RJTUVSKTsKKyAgICAgICAgICAgIGxpbURlYWN0aXZhdGVBbmRDaGFuZ2VUaW1lcihwTWFjLC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NoIGluZGV4CisgKi8KKwordEFOSV9VOAorbGltU2Nhbkhhc2hGdW5jdGlvbih0U2lyTWFjQWRkciBic3NJZCkKK3sKKyAgICB0QU5JX1UxNiAgICBpLCBoYXNoID0gMDsKKworICAgIGZvciAoaSA9IDA7IGkgPCBzaXplb2YodFNpck1hY0FkZHIpOyBpKyspCisgICAgICAgIGhhc2ggKz0gYnNzSWRbaV07CisKKyAgICByZXR1cm4gaGFzaCAlIExJTV9NQVhfTlVNX09GX1NDQU5fUkVTVUxUUzsKK30gLyoqKioqKiBlbmQgbGltU2Nhbkhhc2hGdW5jdGlvbigpICoqKioqKi8KKworCisKKy8qKgorICogbGltSW5pdEhhc2hUYWJsZSgpCisgKgorICpGVU5DVElPTjoKKyAqIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIHVwb24gcmVjZWl2aW5nIFNNRV9TVEFSVF9SRVEKKyAqIHRvIGluaXRpYWxpemUgZ2xvYmFsIGNhY2hlZCBzY2FuIGhhc2ggdGFibGUKKyAqCisgKkxPR0lDOgorICoKKyAqQVNTVU1QVElPTlM6CisgKiBOQQorICoKKyAqTk9URToKKyAqIE5BCisgKgorICogQHBhcmFtICBwTWFjIC0gUG9pbnRlciB0byBHbG9iYWwgTUFDIHN0cnVjdHVyZQorICogQHJldHVybiBOb25lCisgKi8KKwordm9pZAorbGltSW5pdEhhc2hUYWJsZSh0cEFuaVNpckdsb2JhbCBwTWFjKQoreworICAgIHRBTklfVTE2IGk7CisgICAgZm9yIChpID0gMDsgaSA8IExJTV9NQVhfTlVNX09GX1NDQU5fUkVTVUxUUzsgaSsrKQorICAgICAgICBwTWFjLT5saW0uZ0xpbUNhY2hlZFNjYW5IYXNoVGFibGVbaV0gPSBOVUxMOworfSAvKioqKioqIGVuZCBsaW1Jbml0SGFzaFRhYmxlKCkgKioqKioqLworCisKKworLyoqCisgKiBsaW1Mb29rdXBOYWRkSGFzaEVudHJ5KCkKKyAqCisgKkZVTkNUSU9OOgorICogVGhpcyBmd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BlIGZpcnN0CisgICAgICAgICAgICAodm9zX21lbV9jb21wYXJlKCAodEFOSV9VOCAqKSBwQnNzRGVzY3ItPmJzc0Rlc2NyaXB0aW9uLmJzc0lkLAorICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopIHB0ZW1wLT5ic3NEZXNjcmlwdGlvbi5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKSkgJiYgICAvL21hdGNoaW5nIEJTU0lECisgICAgICAgICAgICAgLy8gbWF0Y2hpbmcgYmFuZCB0byB1cGRhdGUgbmV3IGNoYW5uZWwgaW5mbworICAgICAgICAgICAgKHZvc19jaGFuX3RvX2JhbmQocEJzc0Rlc2NyLT5ic3NEZXNjcmlwdGlvbi5jaGFubmVsSWQpID09CisgICAgICAgICAgICAgICAgICAgICAgdm9zX2NoYW5fdG9fYmFuZChwdGVtcC0+YnNzRGVzY3JpcHRpb24uY2hhbm5lbElkKSkgJiYKKyAgICAgICAgICAgIHZvc19tZW1fY29tcGFyZSggKCh0QU5JX1U4ICopICZwQnNzRGVzY3ItPmJzc0Rlc2NyaXB0aW9uLmllRmllbGRzICsgMSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHRBTklfVTggKikgJnB0ZW1wLT5ic3NEZXNjcmlwdGlvbi5pZUZpZWxkcyArIDEpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTgpIChzc2lkTGVuICsgMSkpICYmCisgICAgICAgICAgICAoKHBTaXJDYXBUZW1wLT5lc3MpIHx8IC8vd2UgYXJlIGRvbmUgZm9yIGluZnJhc3RydWN0dXJlCisgICAgICAgICAgICAvL0ZvciBJQlNTLCBud1R5cGUgYW5kIGNoYW5uZWxJZAorICAgICAgICAgICAgKCgocEJzc0Rlc2NyLT5ic3NEZXNjcmlwdGlvbi5ud1R5cGUgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRlbXAtPmJzc0Rlc2NyaXB0aW9uLm53VHlwZSkgJiYKKyAgICAgICAgICAgIChwQnNzRGVzY3ItPmJzc0Rlc2NyaXB0aW9uLmNoYW5uZWxJZCA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdGVtcC0+YnNzRGVzY3JpcHRpb24uY2hhbm5lbElkKSkpKQorICAgICAgICApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIEZvdW5kIHRoZSBzYW1lIEJTUyBkZXNjcmlwdGlvbgorICAgICAgICAgICAgaWYgKGFjdGlvbiA9PSBMSU1fSEFTSF9VUERBVEUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoZG9udFVwZGF0ZUFsbCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgcnNzaSA9IHB0ZW1wLT5ic3NEZXNjcmlwdGlvbi5yc3NpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmKHBCc3NEZXNjci0+YnNzRGVzY3JpcHRpb24uZlByb2JlUnNwICE9IHB0ZW1wLT5ic3NEZXNjcmlwdGlvbi5mUHJvYmVSc3ApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvL1dlIGdldCBhIGRpZmZlcmVudCwgc2F2ZSB0aGUgb2xkIGZyYW1lIFdTQyBJRSBpZiBpdCBpcyB0aGVyZQorICAgICAgICAgICAgICAgICAgICBpZHggPSAwOworICAgICAgICAgICAgICAgICAgICBsZW4gPSBwdGVtcC0+YnNzRGVzY3JpcHRpb24ubGVuZ3RoIC0gc2l6ZW9mKHRTaXJCc3NEZXNjcmlwdGlvbikgKyAKKyAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRBTklfVTE2KSArIHNpemVvZih0QU5JX1UzMikgLSBET1QxMUZfSUVfV1NDUFJPQkVSRVNfTUlOX0xFTiAtIDI7CisgICAgICAgICAgICAgICAgICAgIHBiSWUgPSAodEFOSV9VOCAqKXB0ZW1wLT5ic3NEZXNjcmlwdGlvbi5pZUZpZWxkczsKKyAgICAgICAgICAgICAgICAgICAgLy9TYXZlIFdQUyBJRSBpZiBpdCBleGlzdHMKKyAgICAgICAgICAgICAgICAgICAgcEJzc0Rlc2NyLT5ic3NEZXNjcmlwdGlvbi5Xc2NJZUxlbiA9IDA7CisgICAgICAgICAgICAgICAgICAgIHdoaWxlKGlkeCA8IGxlbikKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYoKERPVDExRl9FSURfV1NDUFJPQkVSRVMgPT0gcGJJZVswXSkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDAwID09IHBiSWVbMl0pICYmICgweDUwID09IHBiSWVbM10pICYmICgweGYyID09IHBiSWVbNF0pICYmICgweDA0ID09IHBiSWVbNV0pKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vRm91bmQgaXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZigoRE9UMTFGX0lFX1dTQ1BST0JFUkVTX01BWF9MRU4gLSAyKSA+PSBwYkllWzFdKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBCc3NEZXNjci0+YnNzRGVzY3JpcHRpb24uV3NjSWVQcm9iZVJzcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGJJZSwgcGJJZVsxXSArIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQnNzRGVzY3ItPmJzc0Rlc2NyaXB0aW9uLldzY0llTGVuID0gcGJJZVsxXSArIDI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWR4ICs9IHBiSWVbMV0gKyAyOworICAgICAgICAgICAgICAgICAgICAgICAgcGJJZSArPSBwYkllWzFdICsgMjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworCisgICAgICAgICAgICAgICAgaWYoTlVMTCAhPSBwTWFjLT5saW0uZ3BMaW1NbG1TY2FuUmVxKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBpZigocE1hYy0+bGltLmdwTGltTWxtU2NhblJlcS0+bnVtU3NpZCkmJgorICAgICAgICAgICAgICAgICAgICAgICggbGltSXNOdWxsU3NpZCgodFNpck1hY1NTaWQgKikoKHRBTklfVTggKikKKyAgICAgICAgICAgICAgICAgICAgICAmcEJzc0Rlc2NyLT5ic3NEZXNjcmlwdGlvbi5pZUZpZWxkcyArIDEpKSkpCisgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gRGVsZXRlIHRoaXMgZW50cnkKKyAgICAgICAgICAgICAgICBpZiAocHRlbXAgPT0gcE1hYy0+bGltLmdMaW1DYWNoZWRTY2FuSGFzaFRhYmxlW2luZGV4XSkKKyAgICAgICAgICAgICAgICAgICAgcHByZXYgPSBwTWFjLT5saW0uZ0xpbUNhY2hlZFNjYW5IYXNoVGFibGVbaW5kZXhdID0gcHRlbXAtPm5leHQ7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICBwcHJldi0+bmV4dCA9IHB0ZW1wLT5uZXh0OworCisgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1NbG1TY2FuUmVzdWx0TGVuZ3RoIC09CisgICAgICAgICAgICAgICAgICAgIHB0ZW1wLT5ic3NEZXNjcmlwdGlvbi5sZW5ndGggKyBzaXplb2YodEFOSV9VMTYpOworCisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHB0ZW1wKTsKKyAgICAgICAgICAgIH0K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0aW9uLmJzc0lkLAorICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopIHB0ZW1wLT5ic3NEZXNjcmlwdGlvbi5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKSkgJiYgICAvL21hdGNoaW5nIEJTU0lECisgICAgICAgICAgICAocEJzc0Rlc2NyLT5ic3NEZXNjcmlwdGlvbi5jaGFubmVsSWQgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRlbXAtPmJzc0Rlc2NyaXB0aW9uLmNoYW5uZWxJZCkgJiYKKyAgICAgICAgICAgIHZvc19tZW1fY29tcGFyZSggKCh0QU5JX1U4ICopICZwQnNzRGVzY3ItPmJzc0Rlc2NyaXB0aW9uLmllRmllbGRzICsgMSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHRBTklfVTggKikgJnB0ZW1wLT5ic3NEZXNjcmlwdGlvbi5pZUZpZWxkcyArIDEpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTgpIChzc2lkTGVuICsgMSkpICYmCisgICAgICAgICAgICAoKHBTaXJDYXBUZW1wLT5lc3MpIHx8IC8vd2UgYXJlIGRvbmUgZm9yIGluZnJhc3RydWN0dXJlCisgICAgICAgICAgICAvL0ZvciBJQlNTLCBud1R5cGUgYW5kIGNoYW5uZWxJZAorICAgICAgICAgICAgKCgocEJzc0Rlc2NyLT5ic3NEZXNjcmlwdGlvbi5ud1R5cGUgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRlbXAtPmJzc0Rlc2NyaXB0aW9uLm53VHlwZSkgJiYKKyAgICAgICAgICAgIChwQnNzRGVzY3ItPmJzc0Rlc2NyaXB0aW9uLmNoYW5uZWxJZCA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdGVtcC0+YnNzRGVzY3JpcHRpb24uY2hhbm5lbElkKSkpKQorICAgICAgICApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIEZvdW5kIHRoZSBzYW1lIEJTUyBkZXNjcmlwdGlvbgorICAgICAgICAgICAgaWYgKGFjdGlvbiA9PSBMSU1fSEFTSF9VUERBVEUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoZG9udFVwZGF0ZUFsbCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgcnNzaSA9IHB0ZW1wLT5ic3NEZXNjcmlwdGlvbi5yc3NpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmKHBCc3NEZXNjci0+YnNzRGVzY3JpcHRpb24uZlByb2JlUnNwICE9IHB0ZW1wLT5ic3NEZXNjcmlwdGlvbi5mUHJvYmVSc3ApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvL1dlIGdldCBhIGRpZmZlcmVudCwgc2F2ZSB0aGUgb2xkIGZyYW1lIFdTQyBJRSBpZiBpdCBpcyB0aGVyZQorICAgICAgICAgICAgICAgICAgICBpZHggPSAwOworICAgICAgICAgICAgICAgICAgICBsZW4gPSBwdGVtcC0+YnNzRGVzY3JpcHRpb24ubGVuZ3RoIC0gc2l6ZW9mKHRTaXJCc3NEZXNjcmlwdGlvbikgKworICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodEFOSV9VMTYpICsgc2l6ZW9mKHRBTklfVTMyKSAtIERPVDExRl9JRV9XU0NQUk9CRVJFU19NSU5fTEVOIC0gMjsKKyAgICAgICAgICAgICAgICAgICAgcGJJZSA9ICh0QU5JX1U4ICopcHRlbXAtPmJzc0Rlc2NyaXB0aW9uLmllRmllbGRzOworICAgICAgICAgICAgICAgICAgICAvL1NhdmUgV1BTIElFIGlmIGl0IGV4aXN0cworICAgICAgICAgICAgICAgICAgICBwQnNzRGVzY3ItPmJzc0Rlc2NyaXB0aW9uLldzY0llTGVuID0gMDsKKyAgICAgICAgICAgICAgICAgICAgd2hpbGUoaWR4IDwgbGVuKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZigoRE9UMTFGX0VJRF9XU0NQUk9CRVJFUyA9PSBwYkllWzBdKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MDAgPT0gcGJJZVsyXSkgJiYgKDB4NTAgPT0gcGJJZVszXSkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICgweGYyID09IHBiSWVbNF0pICYmICgweDA0ID09IHBiSWVbNV0pKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vRm91bmQgaXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZigoRE9UMTFGX0lFX1dTQ1BST0JFUkVTX01BWF9MRU4gLSAyKSA+PSBwYkllWzFdKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCBwQnNzRGVzY3ItPmJzc0Rlc2NyaXB0aW9uLldzY0llUHJvYmVSc3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBiSWUsIHBiSWVbMV0gKyAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJzc0Rlc2NyLT5ic3NEZXNjcmlwdGlvbi5Xc2NJZUxlbiA9IHBiSWVbMV0gKyAyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlkeCArPSBwYkllWzFdICsgMjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBiSWUgKz0gcGJJZVsxXSArIDI7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKworICAgICAgICAgICAgICAgIGlmKE5VTEwgIT0gcE1hYy0+bGltLmdwTGltTWxtU2NhblJlcSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgaWYoKHBNYWMtPmxpbS5ncExpbU1sbVNjYW5SZXEtPm51bVNzaWQpJiYKKyAgICAgICAgICAgICAgICAgICAgICAoIGxpbUlzTnVsbFNzaWQoKHRTaXJNYWNTU2lkICopKCh0QU5JX1U4ICopCisgICAgICAgICAgICAgICAgICAgICAgJnBCc3NEZXNjci0+YnNzRGVzY3JpcHRpb24uaWVGaWVsZHMgKyAxKSkpKQorICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8vIERlbGV0ZSB0aGlzIGVudHJ5CisgICAgICAgICAgICAgICAgaWYgKHB0ZW1wID09IHBNYWMtPmxpbS5nTGltQ2FjaGVkTGZyU2Nhbkhhc2hUYWJsZVtpbmRleF0pCisgICAgICAgICAgICAgICAgICAgIHBwcmV2ID0gcE1hYy0+bGltLmdMaW1DYWNoZWRMZnJTY2FuSGFzaFRhYmxlW2luZGV4XSA9IHB0ZW1wLT5uZXh0OworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgcHByZXYtPm5leHQgPSBwdGVtcC0+bmV4dDsKKworICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltTWxtTGZyU2NhblJlc3VsdExlbmd0aCAtPQorICAgICAgICAgICAgICAgICAgICBwdGVtcC0+YnNzRGVzY3JpcHRpb24ubGVuZ3RoICsgc2l6ZW9mKHRBTklfVTE2KTsKKworICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwdGVtcCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8vZm9yIG5vdywgb25seSByc3NpLCB3ZSBjYW4gYWRkIG1vcmUgaWYgbmVlZGVkCisgICAgaWYgKChhY3Rpb24gPT0gTElNX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BsaW1Qcm9jZXNzU21lTWVzc2FnZXMoKSB3aGlsZQorICogc2VuZGluZyBTTUVfU0NBTl9SU1Agd2l0aCBzY2FuIHJlc3VsdCB0byBIREQuCisgKgorICpMT0dJQzoKKyAqIFRoaXMgZnVuY3Rpb24gdHJhdmVyc2VzIHRoZSBzY2FuIGxpc3Qgc3RvcmVkIGluIHNjYW4gaGFzaCB0YWJsZQorICoKKyAqQVNTVU1QVElPTlM6CisgKiBOQQorICoKKyAqTk9URToKKyAqIE5BCisgKgorICogQHBhcmFtICBwTWFjIC0gUG9pbnRlciB0byBHbG9iYWwgTUFDIHN0cnVjdHVyZQorICogQHBhcmFtICBwRGVzdCAtIERlc3RpbmF0aW9uIHBvaW50ZXIKKyAqCisgKiBAcmV0dXJuIE5vbmUKKyAqLworCit2b2lkCitsaW1Db3B5U2NhblJlc3VsdCh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4ICpwRGVzdCkKK3sKKyAgICB0TGltU2NhblJlc3VsdE5vZGUgICAgKnB0ZW1wOworICAgIHRBTklfVTE2IGk7CisgICAgZm9yIChpID0gMDsgaSA8IExJTV9NQVhfTlVNX09GX1NDQU5fUkVTVUxUUzsgaSsrKQorICAgIHsKKyAgICAgICAgaWYgKChwdGVtcCA9IHBNYWMtPmxpbS5nTGltQ2FjaGVkU2Nhbkhhc2hUYWJsZVtpXSkgIT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgICAgd2hpbGUocHRlbXApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8vIENvcHkgZW50aXJlIEJTUyBkZXNjcmlwdGlvbiBpbmNsdWRpbmcgbGVuZ3RoCisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCBwRGVzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopICZwdGVtcC0+YnNzRGVzY3JpcHRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdGVtcC0+YnNzRGVz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mdMaW1DYWNoZWRTY2FuSGFzaFRhYmxlW2ldKSAhPSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgICB3aGlsZSAocE5vZGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcE5leHROb2RlID0gcE5vZGUtPm5leHQ7CisKKyAgICAgICAgICAgICAgICAvLyBEZWxldGUgdGhlIGN1cnJlbnQgbm9kZQorICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTm9kZSk7CisKKyAgICAgICAgICAgICAgICBwTm9kZSA9IHBOZXh0Tm9kZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHBNYWMtPmxpbS5nTGltU21lU2NhblJlc3VsdExlbmd0aCA9IDA7Cit9IC8qKioqKiogZW5kIGxpbURlbGV0ZUNhY2hlZFNjYW5SZXN1bHRzKCkgKioqKioqLworCisKKworLyoqCisgKiBsaW1SZUluaXRTY2FuUmVzdWx0cygpCisgKgorICpGVU5DVElPTjoKKyAqIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIGRlbGV0ZSBleGlzaXRpbmcgc2NhbiByZXN1bHRzCisgKiBhbmQgaW5pdGlhbGl6ZSB0aGUgc2NhbiBoYXNoIHRhYmxlCisgKgorICpMT0dJQzoKKyAqCisgKkFTU1VNUFRJT05TOgorICogTkEKKyAqCisgKk5PVEU6CisgKiBOQQorICoKKyAqIEBwYXJhbSAgcE1hYyAtIFBvaW50ZXIgdG8gR2xvYmFsIE1BQyBzdHJ1Y3R1cmUKKyAqIEByZXR1cm4gTm9uZQorICovCisKK3ZvaWQKK2xpbVJlSW5pdFNjYW5SZXN1bHRzKHRwQW5pU2lyR2xvYmFsIHBNYWMpCit7CisgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJSZSBpbml0aWFsaXplIHNjYW4gaGFzaCB0YWJsZS4iKSk7CisgICAgbGltRGVsZXRlQ2FjaGVkU2NhblJlc3VsdHMocE1hYyk7CisgICAgbGltSW5pdEhh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kZTsKKyAgICB0QU5JX1UxNiBpOworICAgIGZvciAoaSA9IDA7IGkgPCBMSU1fTUFYX05VTV9PRl9TQ0FOX1JFU1VMVFM7IGkrKykKKyAgICB7CisgICAgICAgIGlmICgocE5vZGUgPSBwTWFjLT5saW0uZ0xpbUNhY2hlZExmclNjYW5IYXNoVGFibGVbaV0pICE9IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIHdoaWxlIChwTm9kZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwTmV4dE5vZGUgPSBwTm9kZS0+bmV4dDsKKworICAgICAgICAgICAgICAgIC8vIERlbGV0ZSB0aGUgY3VycmVudCBub2RlCisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBOb2RlKTsKKworICAgICAgICAgICAgICAgIHBOb2RlID0gcE5leHROb2RlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcE1hYy0+bGltLmdMaW1TbWVMZnJTY2FuUmVzdWx0TGVuZ3RoID0gMDsKK30gLyoqKioqKiBlbmQgbGltRGVsZXRlQ2FjaGVkTGZyU2NhblJlc3VsdHMoKSAqKioqKiovCisKKworCisvKioKKyAqIGxpbVJlSW5pdExmclNjYW5SZXN1bHRzKCkKKyAqCisgKkZVTkNUSU9OOgorICogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZGVsZXRlIGV4aXNpdGluZyBzY2FuIHJlc3VsdHMKKyAqIGFuZCBpbml0aWFsaXplIHRoZSBsZnIgc2NhbiBoYXNoIHRhYmxlCisgKgorICpMT0dJQzoKKyAqCisgKkFTU1VNUFRJT05TOgorICogTkEKKyAqCisgKk5PVEU6CisgKiBOQQorICoKKyAqIEBwYXJhbSAgcE1hYyAtIFBvaW50ZXIgdG8gR2xvYmFsIE1BQyBzdHJ1Y3R1cmUKKyAqIEByZXR1cm4gTm9uZQorICovCisKK3ZvaWQKK2xpbVJlSW5pdExmclNjYW5SZXN1bHRzKHRwQW5pU2lyR2xv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GSQorZUhhbFN0YXR1cyAgICBsaW1Db2xsZWN0QnNzRGVzY3JpcHRpb24odHBBbmlTaXJHbG9iYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyQnNzRGVzY3JpcHRpb24gKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyUHJvYmVSZXNwQmVhY29uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCk7CisjZWxzZQorZUhhbFN0YXR1cyAgICBsaW1Db2xsZWN0QnNzRGVzY3JpcHRpb24odHBBbmlTaXJHbG9iYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyQnNzRGVzY3JpcHRpb24gKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyUHJvYmVSZXNwQmVhY29uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqKTsKKyNlbmRpZgorCisjZW5kaWYgLyogX19MSU1fU0NBTl9VVElMU19IICovCmRpZmYgLS1naXQgYS93bGFuL3ByaW1hL0NPUkUvTUFDL3NyYy9wZS9saW0vbGltU2VjdXJpdHlVdGlscy5jIGIvd2xhbi9wcmltYS9DT1JFL01BQy9zcmMvcGUvbGltL2xpbVNlY3VyaXR5VXRpbHMuYwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi40NWE3ODIzCi0tLSAvZGV2L251bGwKKysrIGIvd2xhbi9wcmltYS9DT1JFL01BQy9zcmMvcGUvbGltL2xpbVNlY3VyaXR5VXRpbHMuYwpAQCAtMCwwICsxLDEzNzggQEAKKy8qCisgKiBDb3B5cmlnaHQgKGMpIDIwMTMtMjAxNSBUaGUgTGludXggRm91bmRhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KKyAqCisgKiBQcmV2aW91c2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Sb2xlID09IGVMSU1fQVBfUk9MRSkKKyAgICAgICAgeworICAgICAgICAgICBpZigocHNlc3Npb25FbnRyeS0+YXV0aFR5cGUgPT0gZVNJUl9PUEVOX1NZU1RFTSkgfHwgKHBzZXNzaW9uRW50cnktPmF1dGhUeXBlID09IGVTSVJfQVVUT19TV0lUQ0gpKQorICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7IAorICAgICAgICB9CisKKyAgICAgICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfT1BFTl9TWVNURU1fQVVUSF9FTkFCTEUsCisgICAgICAgICAgICAgICAgICAgICAgJmFsZ29FbmFibGUpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBDb3VsZCBub3QgZ2V0IEF1dGhBbGdvMSBFbmFibGUgdmFsdWUKKyAgICAgICAgICAgICAqIGZyb20gQ0ZHLiBMb2cgZXJyb3IuCisgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBBdXRoQWxnbzEgRW5hYmxlIHZhbHVlIikpOworCisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgICAgcmV0dXJuICggKGFsZ29FbmFibGUgPiAwID8gdHJ1ZSA6IGZhbHNlKSApOworICAgIH0KKyAgICBlbHNlCisgICAgeworCisgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFKQorICAgICAgICB7CisgICAgICAgICAgICBpZigocHNlc3Npb25FbnRyeS0+YXV0aFR5cGUgPT0gZVNJUl9TSEFSRURfS0VZKSB8fCAocHNlc3Npb25FbnRyeS0+YXV0aFR5cGUgPT0gZVNJUl9BVVRPX1NXSVRDSCkpCisgICAgICAgICAgICAgICAgYWxnb0VuYWJsZSA9IHRydWU7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgYWxnb0VuYWJsZSA9IGZhbHNlOworICAgICAgICAgICAgCisgICAgICAgIH0KKyAgICAgICAgZWxzZQorCisgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX1NIQVJFRF9LRVlfQVVUSF9FTkFCTEUsCisgICAgICAgICAgICAgICAgICAgICAgJmFsZ29FbmFibGUpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBDb3VsZCBub3QgZ2V0IEF1dGhBbGdvMiBFbmFibGUgdmFsdWUKKyAgICAgICAgICAgICAqIGZyb20gQ0ZHLiBMb2cgZXJyb3IuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgQXV0aEFsZ28yIEVuYWJsZSB2YWx1ZSIpKTsKKworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0FQX1JPTEUpCisgICAgICAgIHsKKyAgICAgICAgICAgIHByaXZhY3lPcHRJbXAgPSBwc2Vzc2lvbkVudHJ5LT5wcml2YWN5OworICAgICAgICB9CisgICAgICAgIGVsc2UKKworICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19QUklWQUNZX0VOQUJMRUQsCisgICAgICAgICAgICAgICAgICAgICAgJnByaXZhY3lPcHRJbXApICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBDb3Vs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DVElPTjoKKyAqIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIHdoZW4gQXV0aGVudGljYXRpb24gZnJhbWUgaXMgcmVjZWl2ZWQKKyAqIGJ5IEFQIChvciBhdCBhIFNUQSBpbiBJQlNTIHN1cHBvcnRpbmcgTUFDIGJhc2VkIGF1dGhlbnRpY2F0aW9uKQorICogdG8gc2VhcmNoIGlmIGEgU1RBIGlzIGluIHRoZSBtaWRkbGUgb2YgTUFDIEF1dGhlbnRpY2F0aW9uCisgKiB0cmFuc2FjdGlvbiBzZXF1ZW5jZS4KKyAqCisgKkxPR0lDOgorICoKKyAqQVNTVU1QVElPTlM6CisgKgorICpOT1RFOgorICoKKyAqIEBwYXJhbSAgbWFjQWRkciAtIE1BQyBhZGRyZXNzIG9mIHRoZSBTVEEgdGhhdCBzZW50CisgKiAgICAgICAgICAgICAgICAgICAgICAgQXV0aGVudGljYXRpb24gZnJhbWUuCisgKgorICogQHJldHVybiBQb2ludGVyIHRvIHByZS1hdXRoIG5vZGUgaWYgZm91bmQsIGVsc2UgTlVMTAorICovCisKK3N0cnVjdCB0TGltUHJlQXV0aE5vZGUgKgorbGltU2VhcmNoUHJlQXV0aExpc3QodHBBbmlTaXJHbG9iYWwgcE1hYywgdFNpck1hY0FkZHIgbWFjQWRkcikKK3sKKyAgICBzdHJ1Y3QgdExpbVByZUF1dGhOb2RlICAgICpwVGVtcE5vZGUgPSBwTWFjLT5saW0ucExpbVByZUF1dGhMaXN0OworCisgICAgd2hpbGUgKHBUZW1wTm9kZSAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgaWYgKHZvc19tZW1fY29tcGFyZSggKHRBTklfVTggKikgbWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTggKikgJnBUZW1wTm9kZS0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKSApCisgICAgICAgICAgICBicmVhazsKKwor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ICAgIGlmIChwVGVtcE5vZGUtPm1sbVN0YXRlID09IGVMSU1fTUxNX0FVVEhFTlRJQ0FURURfU1RBVEUgJiYKKyAgICAgICAgICAgIHBUZW1wTm9kZS0+YXV0aFR5cGUgPT0gZVNJUl9PUEVOX1NZU1RFTSAmJgorICAgICAgICAgICAgKHZvc190aW1lcl9nZXRfc3lzdGVtX3RpY2tzKCkgPgorICAgICAgICAgICAgICAgICAgIChMSU1fT1BFTkFVVEhfVElNRU9VVCArIHBUZW1wTm9kZS0+dGltZXN0YW1wKSB8fAorICAgICAgICAgICAgIHZvc190aW1lcl9nZXRfc3lzdGVtX3RpY2tzKCkgPCBwVGVtcE5vZGUtPnRpbWVzdGFtcCkpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIEZvdW5kIG5vZGUgdG8gYmUgZGVsZXRlZAorICAgICAgICAgICAgYXV0aE5vZGVGcmVlZCA9IHRydWU7CisgICAgICAgICAgICBwRm91bmROb2RlID0gcFRlbXBOb2RlOworICAgICAgICAgICAgaWYgKHBNYWMtPmxpbS5wTGltUHJlQXV0aExpc3QgPT0gcFRlbXBOb2RlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBQcmV2Tm9kZSA9IHBNYWMtPmxpbS5wTGltUHJlQXV0aExpc3QgPSBwVGVtcE5vZGUgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEZvdW5kTm9kZS0+bmV4dDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwUHJldk5vZGUtPm5leHQgPSBwVGVtcE5vZGUtPm5leHQ7CisgICAgICAgICAgICAgICAgcFRlbXBOb2RlID0gcFByZXZOb2RlLT5uZXh0OworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBsaW1SZWxlYXNlUHJlQXV0aE5vZGUocE1hYywgcEZvdW5kTm9kZSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAg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AgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKSApCisgICAgeworICAgICAgICAvLyBGaXJzdCBub2RlIHRvIGJlIGRlbGV0ZWQKKworICAgICAgICBwTWFjLT5saW0ucExpbVByZUF1dGhMaXN0ID0gcFRlbXBOb2RlLT5uZXh0OworCisKKyAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCIgZmlyc3Qgbm9kZSB0byBkZWxldGUiKSk7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgRkwoIiBSZWxlYXNlIGRhdGEgZW50cnk6JXAgaWR4ICVkIHBlZXI6ICIgTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRlbXBOb2RlLCBwVGVtcE5vZGUtPmF1dGhOb2RlSWR4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkobWFjQWRkcikpOworICAgICAgICBsaW1SZWxlYXNlUHJlQXV0aE5vZGUocE1hYywgcFRlbXBOb2RlKTsKKworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgcFRlbXBOb2RlID0gcFRlbXBOb2RlLT5uZXh0OworCisgICAgd2hpbGUgKHBUZW1wTm9kZSAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgaWYgKHZvc19tZW1fY29tcGFyZSggKHRBTklfVTggKikgbWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTggKikgJnBUZW1wTm9kZS0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSkgKQorICAgICAgICB7CisgICAgICAgICAgICAvLyBGb3VuZCBub2RlIHRvIGJlIGRlbGV0ZWQKKworICAgICAgICAgICAgcFByZXZOb2RlLT5uZXh0ID0gcFRlbXBOb2RlLT5uZXh0OworCisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIiBzdWJzZXF1ZW50IG5vZGUgdG8gZGVsZXRlIikpOworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgICAgRkwoIlJlbGVhc2UgZGF0YSBlbnRyeTogJXAgaWQgJWQgcGVlcjogIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgcFRlbXBOb2RlLCBwVGVtcE5vZGUtPmF1dGhOb2RlSWR4LCBNQUNfQUREUl9BUlJBWShtYWNBZGRyKSk7CisgICAgICAgICAgICBsaW1SZWxlYXNlUHJlQXV0aE5vZGUocE1hYywgcFRlbXBOb2RlKTsKKworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgcFByZXZOb2RlID0gcFRlbXBOb2RlOworICAgICAgICBwVGVtcE5vZGUgPSBwVGVtcE5vZGUtPm5leHQ7CisgICAgfQorCisgICAgLy8gU2hvdWxkIG5vdCBiZSBoZXJlCisgICAgLy8gTG9nIGVycm9yCisgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJwZWVyIG5vdCBmb3VuZCBpbiBwcmUtYXV0aCBsaXN0LCBhZGRyPSAiKSk7CisgICAgbGltUHJpbnRNYWNBZGRyKHBNYWMsIG1hY0FkZHIsIExPR1ApOworCit9IC8qKiogZW5kIGxpbURlbGV0ZVByZUF1dGhOb2RlKCkgKioqLworCisKKworCisKKy8qKgorICogbGltUmVzdG9yZUZyb21QcmVBdXRoU3RhdGUKKyAqCisgKkZVTkNUSU9OOgorICogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgb24gU1RBIHdoZW5ldmVyIGFuIEF1dGhlbnRpY2F0aW9uCisgKiBzZXF1ZW5jZSBpcyBjb21wbGV0ZSBhbmQgc3RhdGUgcHJpb3IgdG8gYXV0aCBuZWVkIHRvIGJlCisgKiByZXN0b3JlZC4KKyAqCisgKkxPR0lDOgorICogTUxN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leHQKKyAqIEBwYXJhbSAgcFNyYyAgICAgICAgICAgU291cmNlIGxvY2F0aW9uIHRvIGJlIGVuY3J5cHRlZAorICogQHBhcmFtICBzZWVkICAgICAgICAgICBDb250YWlucyBzZWVkIChJViArIGtleSkgZm9yIFBSTkcKKyAqIEBwYXJhbSAga2V5TGVuZ3RoICAgICAgOCAoV0VQNDApIG9yIDE2IChXRVAxMDQpCisgKiBAcGFyYW0gIGZyYW1lTGVuICAgICAgIExlbmd0aCBvZiB0aGUgZnJhbWUKKyAqCisgKiBAcmV0dXJuIE5vbmUKKyAqLworCit2b2lkCitsaW1SQzQodEFOSV9VOCAqcERlc3QsIHRBTklfVTggKnBTcmMsIHRBTklfVTggKnNlZWQsIHRBTklfVTMyIGtleUxlbmd0aCwgdEFOSV9VMTYgZnJhbWVMZW4pCit7CisgICAgdHlwZWRlZiBzdHJ1Y3QKKyAgICB7CisgICAgICAgIHRBTklfVTggaSwgajsKKyAgICAgICAgdEFOSV9VOCBzYm94WzI1Nl07CisgICAgfSB0UkM0Q29udGV4dDsKKworICAgIHRSQzRDb250ZXh0IGN0eDsKKworICAgIHsKKyAgICAgICAgdEFOSV9VMTYgaSwgaiwgazsKKworICAgICAgICAvLworICAgICAgICAvLyBJbml0aWFsaXplIHNib3ggdXNpbmcgc2VlZAorICAgICAgICAvLworCisgICAgICAgIGN0eC5pID0gY3R4LmogPSAwOworICAgICAgICBmb3IgKGk9MDsgaTwyNTY7IGkrKykKKyAgICAgICAgICAgIGN0eC5zYm94W2ldID0gKHRBTklfVTgpaTsKKworICAgICAgICBqID0gMDsKKyAgICAgICAgayA9IDA7CisgICAgICAgIGZvciAoaT0wOyBpPDI1NjsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICB0QU5JX1U4IHRlbXA7CisgICAgICAgICAgICBpZiAoIGsgPCBMSU1fU0VFRF9MRU5HVEggKQorICAgICAgICAgICAgICAgIGogPSAodEFOSV9VOCkoaiArIGN0eC5zYm94W2ldICsgc2VlZFtrXSk7CisgICAgICAgICAgICB0ZW1wID0gY3R4LnNib3hbaV07CisgICAgICAgICAgICBjdHguc2JveFtpXSA9IGN0eC5zYm94W2pdOworICAgICAgICAgICAgY3R4LnNib3hbal0gPSB0ZW1wOworCisgICAgICAgICAgICBpZiAoKytrID49IGtleUxlbmd0aCkKKyAgICAgICAgICAgICAgICBrID0gMDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHsKKyAgICAgICAgdEFOSV9VOCBpICAgPSBjdHguaTsKKyAgICAgICAgdEFOSV9VOCBqICAgPSBjdHguajsKKyAgICAgICAgdEFOSV9VOCBsZW4gPSAodEFOSV9VOCkgZnJhbWVMZW47CisKKyAgICAgICAgd2hpbGUgKGxlbi0tID4gMCkKKyAgICAgICAgeworICAgICAgICAgICAgdEFOSV9VOCB0ZW1wMSwgdGVtcDI7CisKKyAgICAgICAgICAgIGkgICAgID0gKHRBTklfVTgpKGkrMSk7CisgICAgICAgICAgICB0ZW1wMSA9IGN0eC5zYm94W2ldOworICAgICAgICAgICAgaiAgICAgPSAodEFOSV9VOCkoaiArIHRlbXAxKTsKKworICAgICAgICAgICAgY3R4LnNib3hbaV0gPSB0ZW1wMiA9IGN0eC5zYm94W2pdOworICAgICAgICAgICAgY3R4LnNib3hbal0gPSB0ZW1wMTsKKworICAgICAgICAgICAgdGVtcDEgPSAodEFOSV9VOCkodGVtcDEgKyB0ZW1wMik7CisgICAgICAgICAgICB0ZW1wMSA9IGN0eC5zYm94W3RlbXAxXTsKKyAgICAgICAgICAgIHRlbXAyID0gKHRBTklfVTgpKHBTcmMgPyAqcFNyYysrIDogMCk7CisKKyAgICAgICAgICAgICpwRGVzdCsrID0gKHRBTklfVTgpKHRlbXAxIF4gdGVtcDIpOworICAgICAgICB9CisKKyAgICAgICAgY3R4LmkgPSBpOworICAgICAgICBjdHguaiA9IGo7CisgICAgfQorfSAvKioqKioqIGVuZCBsaW1SQzQoKSAqKioqKiovCisKKworCisvKioKKyAqIGxpbURlY3J5cHRBdXR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TaXJLZXlzICkpOworICAgICAgICAgIH0KKyAgICAgICAgICBwU2V0U3RhS2V5UGFyYW1zLT53ZXBUeXBlID0gZVNJUl9XRVBfU1RBVElDOworICAgICAgICAgIHNlc3Npb25FbnRyeS0+bGltTWxtU3RhdGUgPSBlTElNX01MTV9XVF9TRVRfU1RBX0tFWV9TVEFURTsKKyAgICAgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9NTE1fU1RBVEUsIHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsIHNlc3Npb25FbnRyeS0+bGltTWxtU3RhdGUpKTsKKyAgICAgIH1lbHNlIHsKKyAgICAgICAgICAvKlRoaXMgY2FzZSB0aGUga2V5cyBhcmUgY29taW5nIGZyb20gdXBwZXIgbGF5ZXIgc28gbmVlZCB0byBmaWxsIHRoZSAKKyAgICAgICAgICAqIGtleSBhdCB0aGUgZGVmYXVsdCB3ZXAga2V5IGluZGV4IGFuZCBzZW5kIHRvIHRoZSBIQUwgKi8KKyAgICAgICAgICBpZiAoZGVmV0VQSWR4ID49IFNJUl9NQUNfTUFYX05VTV9PRl9ERUZBVUxUX0tFWVMpCisgICAgICAgICAgeworICAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIldFUElkeCBsZW5ndGggJWQgbW9yZSB0aGFuICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0aGUgTWF4IGxpbWl0LCByZXNldCB0byBNYXgiKSxkZWZXRVBJZHgpOworICAgICAgICAgICAgIHZvc19tZW1fZnJlZSAocFNldFN0YUtleVBhcmFtcyk7CisgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgIH0KKyAgICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKikgJnBTZXRTdGFLZXlQYXJhbXMtPmtleVtkZWZXRVBJZHhdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSAmcE1sbVNldEtleXNSZXEtPmtleVswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoIHBNbG1TZXRLZXlzUmVxLT5rZXlbMF0gKSk7CisgICAgICAgICAgcE1sbVNldEtleXNSZXEtPm51bUtleXMgPSBTSVJfTUFDX01BWF9OVU1fT0ZfREVGQVVMVF9LRVlTOworCisgICAgICB9CisgICAgICBicmVhazsKKyAgY2FzZSBlU0lSX0VEX1RLSVA6CisgIGNhc2UgZVNJUl9FRF9DQ01QOgorI2lmZGVmIEZFQVRVUkVfV0xBTl9XQVBJIAorICBjYXNlIGVTSVJfRURfV1BJOiAKKyNlbmRpZgorICAgICAgeworICAgICAgICAgIHZvc19tZW1fY29weSggKHRBTklfVTggKikgJnBTZXRTdGFLZXlQYXJhbXMtPmtleSwKKyAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopICZwTWxtU2V0S2V5c1JlcS0+a2V5WzBdLCBzaXplb2YoIHRTaXJLZXlzICkpOworICAgICAgfQorICAgICAgYnJlYWs7CisgIGRlZmF1bHQ6CisgICAgICBicmVhazsKKyAgfQorCisgIAorICAvLworICAvLyBGSVhNRV9HRU40CisgIC8vIEEgZ2xvYmFsIGNvdW50ZXIgKGRpYWxvZyB0b2tlbikgaXMgcmVxdWlyZWQgdG8ga2VlcCB0cmFjayBvZgorICAvLyBhbGwgUEUgPC0+IEhBTCBjb21tdW5pY2F0aW9uKHMpCisgIC8vCisgIG1zZ1EucmVzZXJ2ZWQgPSAwOworICBtc2dRLmJvZHlwdHIgPSBwU2V0U3RhS2V5UGFyYW1zOworICBtc2dRLmJvZHl2YWwgPSAwOworCisgIGxpbUxvZyggcE1hYywgTE9HMSwgRkwoICJTZW5kaW5nIFdEQV9TRVRfU1RBS0VZX1JFUS4uLiIgKSk7CisgIE1UUkFDRShtYWNUcmFjZU1zZ1R4KHBNYWMsIHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsIG1zZ1EudHlwZSkpOworICBpZiggZVN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8vLy8vLy8vLy8vLy8vLy8vLy8KKwordFNpclJldFN0YXR1cyBsaW1TdHJpcE9mZkV4dENhcElFKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqYWRkSUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMTYgKmFkZG5JRUxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwRXh0cmFjdGVkRXh0Q2FwSUVCdWYgKQoreworICAgIHRBTklfVTgqIHRlbXBidWYgPSBOVUxMOworICAgIHRBTklfVTE2IHRlbXBMZW4gPSAwOworICAgIGludCBsZWZ0ID0gKmFkZG5JRUxlbjsKKyAgICB0QU5JX1U4ICpwdHIgPSBhZGRJRTsKKyAgICB0QU5JX1U4IGVsZW1faWQsIGVsZW1fbGVuOworCisgICAgaWYgKE5VTEwgPT0gYWRkSUUpCisgICAgeworICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPRzEsIEZMKCJOVUxMIGFkZElFIHBvaW50ZXIiKSk7KQorICAgICAgICByZXR1cm4gZVNJUl9JR05PUkVfSUUgOworICAgIH0KKworICAgIHRlbXBidWYgPSB2b3NfbWVtX21hbGxvYyhsZWZ0KTsKKyAgICBpZiAoIE5VTEwgPT0gdGVtcGJ1ZiApCisgICAgeworICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgRkwoIlVuYWJsZSB0byBhbGxvY2F0ZSBtZW1vcnkgdG8gc3RvcmUgYWRkbiBJRSIpKTspCisgICAgICAgIHJldHVybiBlU0lSX01FTV9BTExPQ19GQUlMRUQ7CisgICAgfQorCisgICAgd2hpbGUobGVmdCA+PSAyKQorICAgIHsKKyAgICAgICAgZWxlbV9pZCAgPSBwdHJbMF07CisgICAgICAgIGVsZW1fbGVuID0gcHRyWzFdOworICAgICAgICBsZWZ0IC09IDI7CisgICAgICAgIGlmIChlbGVtX2xlbiA+IGxlZnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgIEZMKCJJbnZhbGlkIElFcyBlaWQgPSAlZCBlbGVtX2xlbj0lZCBsZWZ0PSVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1faWQsZWxlbV9sZW4sbGVmdCk7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUodGVtcGJ1Zik7CisgICAgICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgICAgICB9CisgICAgICAgIGlmICggIShET1QxMUZfRUlEX0VYVENBUCA9PSBlbGVtX2lkKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSAodGVtcGJ1ZiArIHRlbXBMZW4sICZwdHJbMF0sIGVsZW1fbGVuICsgMik7CisgICAgICAgICAgICB0ZW1wTGVuICs9IChlbGVtX2xlbiArIDIpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeyAvKkVzdCBDYXAgcHJlc2VudCBzaXplIGlzIDggKyAyIGJ5dGUgYXQgcHJlc2VudCovCisgICAgICAgICAgICBpZiAoIE5VTEwgIT0gcEV4dHJhY3RlZEV4dENhcElFQnVmICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX3NldChwRXh0cmFjdGVkRXh0Q2FwSUVCdWYsCisgICAgICAgICAgICAgICAgICAgIERPVDExRl9JRV9FWFRDQVBfTUFYX0xFTiArIDIsIDApOworICAgICAgICAgICAgICAgIGlmIChlbGVtX2xlbiA8PSBET1QxMUZfSUVfRVhUQ0FQX01BWF9MRU4gKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5IChwRXh0cmFjdGVkRXh0Q2FwSUVCdWYsICZwdHJbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtX2xlbiArIDIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBsZWZ0IC09IGVsZW1fbGVuOworICAgICAgICBwdHIgKz0gKGVsZW1fbGVuICsgMik7CisgICAgfQorICAgIHZvc19tZW1fY29weSAoYWRkSUUsIHRlbXBidWYsIHRlbXBMZW4pOworICAgICphZGRuSUVMZW4gPSB0ZW1wTGVuOworICAgIHZvc19tZW1fZnJlZSh0ZW1wYnVmKTsKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworfQorCit2b2lkIGxpbVVwZGF0ZUV4dENhcElFdG9TdHJ1Y3QodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUV4dENhcCAqcERzdCkKK3sKKyAgICB0QU5JX1U4IHBPdXRbRE9UMTFGX0lFX0VYVENBUF9NQVhfTEVOXTsKKworICAgIGlmICggTlVMTCA9PSBwQnVmICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgIEZMKCJJbnZhbGlkIEJ1ZmZlciBBZGRyZXNzIikpOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIGlmKE5VTEwgPT0gcERzdCkKKyAgICB7CisgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICBGTCgiTlVMTCBwRHN0IHBvaW50ZXIiKSk7KQorICAgICAgICByZXR1cm4gOworICAgIH0KKworICAgIGlmICggRE9UMTFGX0VJRF9FWFRDQVAgIT0gcEJ1ZlswXSB8fAorICAgICAgICAgcEJ1ZlsxXSA+IERPVDExRl9JRV9FWFRDQVBfTUFYX0xFTiApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICBGTCgiSW52YWxpZCBJRXMgZWlkID0gJWQgZWxlbV9sZW49JWQgIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCdWZbMF0scEJ1ZlsxXSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgdm9zX21lbV9zZXQoKCB0QU5JX1U4KiApJnBPdXRbMF0sIERPVDExRl9JRV9FWFRDQVBfTUFYX0xFTiwgMCk7CisgICAgLyogY29udmVyc2lvbiBzaG91bGQgZm9sbG93IDQsIDIsIDIgYnl0ZSBvcmRlciAqLworICAgIGxpbVV0aWxzZnJhbWVzaHRvbmwocE1hYywgJnBPdXRbMF0sKigodEFOSV9VMzIqKSZwQnVmWzJdKSwwKTsKKyAgICBsaW1VdGlsc2ZyYW1lc2h0b25zKHBNYWMsICZwT3V0WzRdLCooKHRBTklfVTE2KikmcEJ1Zls2XSksMCk7CisgICAgbGltVXRpbHNmcmFtZXNodG9ucyhwTWFjLCAmcE91dFs2XSwqKCh0QU5JX1UxNiopJnBCdWZbOF0pLDApOworCisgICAgaWYgKCBET1QxMUZfUEFSU0VfU1VDQ0VTUyAhPSBkb3QxMWZVbnBhY2tJZUV4dENhcCggcE1hYywKKyAgICAgICAgICAgICAgICAmcE91dFswXSwgRE9UMTFGX0lFX0VYVENBUF9NQVhfTEVOLCBwRHN0KSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICBGTCgiZG90MTFmVW5wYWNrSWVFeHRDYXAgUGFyc2UgRXJyb3IgIikpOworICAgIH0KK30KKwordFNpclJldFN0YXR1cyBsaW1TdHJpcE9mZkV4dENhcElFQW5kVXBkYXRlU3RydWN0KHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCogYWRkSUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMTYgKmFkZG5JRUxlbiwK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CBiZSB0aGUgTUdNVCBmcmFtZSBwYXlsb2FkIFRoZSBwYXlsb2FkIGl0c2VsZiBpcyBwb3B1bGF0ZWQgYnkgdGhlCisgKiBjYWxsZXIgQVBJCisgKgorICoKKyAqLworCit0U2lyUmV0U3RhdHVzIGxpbVBvcHVsYXRlTWFjSGVhZGVyKCB0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4KiBwQkQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBzdWJUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjQWRkciBwZWVyQWRkciwgdFNpck1hY0FkZHIgc2VsZk1hY0FkZHIpCit7CisgICAgdFNpclJldFN0YXR1cyAgIHN0YXR1c0NvZGUgPSBlU0lSX1NVQ0NFU1M7CisgICAgdHBTaXJNYWNNZ210SGRyIHBNYWNIZHI7CisgICAgCisgICAgLy8vIFByZXBhcmUgTUFDIG1hbmFnZW1lbnQgaGVhZGVyCisgICAgcE1hY0hkciA9ICh0cFNpck1hY01nbXRIZHIpIChwQkQpOworCisgICAgLy8gUHJlcGFyZSBGQworICAgIHBNYWNIZHItPmZjLnByb3RWZXIgPSBTSVJfTUFDX1BST1RPQ09MX1ZFUlNJT047CisgICAgcE1hY0hkci0+ZmMudHlwZSAgICA9IHR5cGU7CisgICAgcE1hY0hkci0+ZmMuc3ViVHlwZSA9IHN1YlR5cGU7CisKKyAgICAvLyBQcmVwYXJlIEFkZHJlc3MgMQorICAgIHZvc19tZW1fY29weSggICh0QU5JX1U4ICopIHBNYWNIZHItPmRhLAorICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopIHBlZXJBZGRyLAorICAgICAgICAgICAgICAgICAgIHNpemVvZiggdFNpck1hY0FkZHIgKSk7CisKKyAgICAvLyBQcmVwYXJlIEFkZHJlc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ZGUgdGhpcyBmaWVsZCBpbiB0aGUgUHJvYmUgUmVxdWVzdCBmcmFtZQorICoKKyAqIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIGJ5IHZhcmlvdXMgTElNIG1vZHVsZXMgdG8gc2VuZCBQcm9iZSBSZXF1ZXN0IGZyYW1lCisgKiBkdXJpbmcgYWN0aXZlIHNjYW4vbGVhcm4gcGhhc2UuCisgKiBQcm9iZSByZXF1ZXN0IGlzIHNlbnQgb3V0IGluIHRoZSBmb2xsb3dpbmcgc2NlbmFyaW9zOgorICogLS1oZWFydGJlYXQgZmFpbHVyZTogIHNlc3Npb24gbmVlZGVkCisgKiAtLWpvaW4gcmVxOiAgICAgICAgICAgc2Vzc2lvbiBuZWVkZWQKKyAqIC0tZm9yZWdyb3VuZCBzY2FuOiAgICBubyBzZXNzaW9uCisgKiAtLWJhY2tncm91bmQgc2NhbjogICAgbm8gc2Vzc2lvbgorICogLS1zY2hCZWFjb25Qcm9jZXNzaW5nOiAgdG8gZ2V0IEVEQ0EgcGFyYW1ldGVyczogIHNlc3Npb24gbmVlZGVkCisgKgorICoKKyAqLwordFNpclJldFN0YXR1cworbGltU2VuZFByb2JlUmVxTWdtdEZyYW1lKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY1NTaWQgICAqcFNzaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY0FkZHIgICAgYnNzaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAgICAgICAgbkNoYW5uZWxOdW0sCisgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY0FkZHIgICAgU2VsZk1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgZG90MTFtb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5BZGRpdGlvbmFsSUVMZW4sIAorICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBBZGRpdGlvbmFsSUUpCit7CisgICAgdERvdDExZlByb2JlUmVxdWVzdCAgcHI7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgblN0YXR1cywgbkJ5dGVzLCBuUGF5bG9hZDsKKyAgICB0U2lyUmV0U3RhdHVzICAgICAgICBuU2lyU3RhdHVzOworICAgIHRBTklfVTggICAgICAgICAgICAgKnBGcmFtZTsKKyAgICB2b2lkICAgICAgICAgICAgICAgICpwUGFja2V0OworICAgIGVIYWxTdGF0dXMgICAgICAgICAgIGhhbHN0YXR1czsKKyAgICB0cFBFU2Vzc2lvbiAgICAgICAgICBwc2Vzc2lvbkVudHJ5OworICAgIHRBTklfVTggICAgICAgICAgICAgIHNlc3Npb25JZDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICpwMnBJZSA9IE5VTEw7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgdHhGbGFnID0gMDsKKworI2lmbmRlZiBHRU40X1NDQU4KKyAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworI2VuZGlmCisKKyNpZiBkZWZpbmVkICggQU5JX0RWVF9ERUJVRyApCisgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyNlbmRpZgorCisgICAgLyogVGhlIHByb2JlIHJlcSBzaG91bGQgbm90IHNlbmQgMTFhYyBjYXBhYmlsaWV0aWVzIGlmIGJhbmQgaXMgMi40R0h6LAorICAgICAqIHVubGVzcyBlbmFibGVWaHRGb3IyNEdIeiBpcyBlbmFibGVkIGluIElOSS4gU28gaWYgZW5hYmxlVmh0Rm9yMjRHSHoKKyAgICAgKiBpcyBmYWxzZSBhbmQgZG90MTFtb2RlIGlzIDExYWMgc2V0IGl0IHRvIDExbi4KKyAgICAgKi8KKyAgICBpZiAoIG5DaGFubmVsTnVtIDw9IFNJUl8xMUJfQ0hBTk5FTF9FTkQgJiYKKyAgICAgICAgKCBGQUxTRSA9PSBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLmVuYWJsZ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F9NT0RFID09IHBzZXNzaW9uRW50cnktPnBlUGVyc29uYSApICkKKyAgICAgICAgICkKKyAgICAgICkKKyAgICB7CisgICAgICAgIC8qIEluIHRoZSBiZWxvdyBBUEkgcGFzcyBjaGFubmVsIG51bWJlciA+IDE0LCBkbyB0aGF0IGl0IGZpbGxzIG9ubHkKKyAgICAgICAgICogMTFhIHJhdGVzIGluIHN1cHBvcnRlZCByYXRlcyAqLworICAgICAgICBQb3B1bGF0ZURvdDExZlN1cHBSYXRlcyggcE1hYywgMTUsICZwci5TdXBwUmF0ZXMscHNlc3Npb25FbnRyeSk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIFBvcHVsYXRlRG90MTFmU3VwcFJhdGVzKCBwTWFjLCBuQ2hhbm5lbE51bSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwci5TdXBwUmF0ZXMscHNlc3Npb25FbnRyeSk7CisKKyAgICAgICAgaWYgKCBXTklfQ0ZHX0RPVDExX01PREVfMTFCICE9IGRvdDExbW9kZSApCisgICAgICAgIHsKKyAgICAgICAgICAgIFBvcHVsYXRlRG90MTFmRXh0U3VwcFJhdGVzMSggcE1hYywgbkNoYW5uZWxOdW0sICZwci5FeHRTdXBwUmF0ZXMgKTsKKyAgICAgICAgfQorICAgIH0KKworI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX1ZPV0lGSQorICAgIC8vVGFibGUgNy0xNCBpbiBJRUVFIFN0ZC4gODAyLjExay0yMDA4IHNheXMKKyAgICAvL0RTIHBhcmFtcyAiY2FuIiBiZSBwcmVzZW50IGluIFJSTSBpcyBkaXNhYmxlZCBhbmQgImlzIiBwcmVzZW50IGlmIAorICAgIC8vUlJNIGlzIGVuYWJsZWQuIEl0IHNob3VsZCBiZSBvayBldmVuIGlmIHdlIGFkZCBpdCBpbnRvIHByb2JlIHJlcSB3aGVuIAorICAgIC8vUlJNIGlzIG5vdCBlbmFibGVkLiAKKyAgICB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kb3QxMWZHZXRQYWNrZWRQcm9iZVJlcXVlc3RTaXplKCBwTWFjLCAmcHIsICZuUGF5bG9hZCApOworICAgIGlmICggRE9UMTFGX0ZBSUxFRCggblN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HUCwgRkwoIkZhaWxlZCB0byBjYWxjdWxhdGUgdGhlIHBhY2tlZCBzaXplIGYiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm9yIGEgUHJvYmUgUmVxdWVzdCAoMHglMDh4KS4iKSwgblN0YXR1cyApOworICAgICAgICAvLyBXZSdsbCBmYWxsIGJhY2sgb24gdGhlIHdvcnN0IGNhc2Ugc2NlbmFyaW86CisgICAgICAgIG5QYXlsb2FkID0gc2l6ZW9mKCB0RG90MTFmUHJvYmVSZXF1ZXN0ICk7CisgICAgfQorICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dXLCBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBjYWxjdWxhdGluZyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAidGhlIHBhY2tlZCBzaXplIGZvciBhIFByb2JlIFJlcXVlc3QgKCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiMHglMDh4KS4iKSwgblN0YXR1cyApOworICAgIH0KKworICAgIG5CeXRlcyA9IG5QYXlsb2FkICsgc2l6ZW9mKCB0U2lyTWFjTWdtdEhkciApICsgbkFkZGl0aW9uYWxJRUxlbjsKKyAgCisgICAgLy8gT2stLSB0cnkgdG8gYWxsb2NhdGUgc29tZSBtZW1vcnk6CisgICAgaGFsc3RhdHVzID0gcGFsUGt0QWxsb2MoIHBNYWMtPmhIZGQsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCB0QU5JX1UxNiApbkJ5dGVzLCAoIHZvaWQqKiApICZwRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggdm9pZCoqICkgJnBQYWNrZXQgKTsKKyAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTICggaGFsc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dQLCBGTCgiRmFpbGVkIHRvIGFsbG9jYXRlICVkIGJ5dGVzIGZvciBhIFBybyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiYmUgUmVxdWVzdC4iKSwgbkJ5dGVzICk7CisgICAgICAgIHJldHVybiBlU0lSX01FTV9BTExPQ19GQUlMRUQ7CisgICAgfQorCisgICAgLy8gUGFyYW5vaWE6CisgICAgdm9zX21lbV9zZXQoIHBGcmFtZSwgbkJ5dGVzLCAwICk7CisKKyAgICAvLyBOZXh0LCB3ZSBmaWxsIG91dCB0aGUgYnVmZmVyIGRlc2NyaXB0b3I6CisgICAgblNpclN0YXR1cyA9IGxpbVBvcHVsYXRlTWFjSGVhZGVyKCBwTWFjLCBwRnJhbWUsIFNJUl9NQUNfTUdNVF9GUkFNRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX01BQ19NR01UX1BST0JFX1JFUSwgYnNzaWQsIFNlbGZNYWNBZGRyKTsKKyAgICBpZiAoIGVTSVJfU1VDQ0VTUyAhPSBuU2lyU3RhdHVzICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBwb3B1bGF0ZSB0aGUgYnVmZmVyIGRlc2NyaXAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInRvciBmb3IgYSBQcm9iZSBSZXF1ZXN0ICglZCkuIiksCisgICAgICAgICAgICAgICAgblNpclN0YXR1cyApOworICAgICAgICBwYWxQa3RGcmVlKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgICAgICggdm9pZCogKSBwRnJhbWUsICggdm9pZCogKSBwUGFja2V0ICk7CisgICAgICAgIHJldHVybiBuU2lyU3RhdHVzOyAgICAgIC8vIGFsbG9jYXRlZCEKKyAgICB9CisKKyAgICAvLyBUaGF0IGRvbmUsIHBhY2sgdGhlIFByb2JlIFJlcXVlc3Q6CisgICAgblN0YXR1cyA9IGRvdDExZlBhY2tQcm9iZVJlcXVlc3QoIHBNYWMsICZwciwgcEZyYW1lICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCB0U2lyTWFjTWdtdEhkciApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuUGF5bG9hZCwgJm5QYXlsb2FkICk7CisgICAgaWYgKCBET1QxMUZfRkFJTEVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIHBhY2sgYSBQcm9iZSBSZXF1ZXN0ICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgIG5TdGF0dXMgKTsKKyAgICAgICAgcGFsUGt0RnJlZSggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOyAgICAvLyBhbGxvY2F0ZWQhCisgICAgfQorICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dXLCBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBwYWNraW5nIGEgUCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAicm9iZSBSZXF1ZXN0ICgweCUwOHgpLiIpLCBuU3RhdHVzICk7CisgICAgfQorCisgICAgLy8gQXBwZW5kIGFueSBBZGRJRSBpZiBwcmVzZW50LgorICAgIGlmKCBuQWRkaXRpb25hbElFTGVuICkKKyAgICB7CisgICAgICAgIHZvc19tZW1fY29weSggcEZyYW1lK3NpemVvZih0U2lyTWFjTWdtdEhkcikrblBheWxvYWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkZGl0aW9uYWxJRSwgbkFkZGl0aW9uYWxJRUxlbiApOworICAgICAgICBuUGF5bG9hZCArPSBuQWRkaXRpb25hbElFTGVuOworICAgIH0KKworICAgIC8qIElmIHRoaXMgcHJvYmUgcmVxdWVzdCBpcyBzZW50IGR1cmluZyBQMlAgU2VhcmNoIFN0YXRlLCB0aGVuIHdlIG5lZWQgCisgICAgICogdG8gc2VuZCBpdCBhdCBPRkRNIHJhdGUuIAorICAgICAqLworICAgIGlmKCAoIFNJUl9CQU5EXzVfR0haID09IGxpbUdldFJGQmFuZChuQ2hhbm5lbE51bSkpCisgICAgICB8fCAoKCBwTWFjLT5saW0uZ3BMaW1NbG1TY2FuUmVxICE9IE5VTEwpICYmCisgICAgICAgICAgcE1hYy0+bGltLmdwTGltTWxtU2NhblJlcS0+cDJwU2VhcmNoICkKKyAgICAgIC8qIEZvciB1bmljYXN0IHByb2JlIHJlcSBtZ210IGZyb20gSm9pbiBmdW5jdGlvbgorICAgICAgICAgd2UgZG9uJ3Qgc2V0IGFib3ZlIHZhcmlhYmxlcy4gU28gd2UgbmVlZCB0byBhZGQKKyAgICAgICAgIG9uZSBtb3JlIGNoZWNrIHdoZXRoZXIgaXQgaXMgcGVQZXJzb25hIGlzIFAyUF9DTElFTlQgb3Igbm90ICovCisgICAgICB8fCAoICggcHNlc3Npb25FbnRyeSAhPSBOVUxMICkgJiYKKyAgICAgICAgICAgKCBWT1NfUDJQX0NMSUVOVF9NT0RFID09IHBzZXNzaW9uRW50cnktPnBlUGVyc29uYSApICkKKyAgICAgICkgCisgICAgeworICAgICAgICB0eEZsYWcgfD0gSEFMX1VTRV9CRF9SQVRFMl9GT1JfTUFOQUdFTUVOVF9GUkFNRTsgCisgICAgfQorCisgICAgaWYoICggcHNlc3Npb25FbnRyeSAhPSBOVUxMICkgJiYgKCBwc2Vzc2lvbkVudHJ5LT5pczExR29ubHkgPT0gdHJ1ZSApICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCAhSVNfQlJPQURDQVNUX01BQyhic3NpZCkgKSApeworICAgICAgICB0eEZsYWcgfD0gSEFMX1VTRV9CRF9SQVRFMl9GT1JfTUFOQUdFTUVOVF9GUkFNRTsKKyAgICB9CisKKyAgICBoYWxzdGF0dXMgPSBoYWxUeEZyYW1lKCBwTWFjLCBwUGFja2V0LCAoIHRBTklfVTE2ICkgc2l6ZW9mKHRTaXJNYWNNZ210SGRyKSArIG5QYXlsb2FkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTklfVFhESVJfVE9EUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA3LC8vU01BQ19TV0JEX1RYX1RJRF9NR01UX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltVHhDb21wbGV0ZSwgcEZyYW1lLCB0eEZsYWcgKTsKKyAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTICggaGFsc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgiY291bGQgbm90IHNlbmQgUHJvYmUgUmVxdWVzdCBmcmFtZSEiICkpOworICAgICAgICAvL1BrdCB3aWxsIGJlIGZyZWVkIHVwIGJ5IHRoZSBjYWxsYmFjaworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKworICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7Cit9IC8vIEVuZCBsaW1TZW5kUHJvYmVSZXFNZ210RnJhbWUuCisKK3RTaXJSZXRTdGF0dXMgbGltR2V0QWRkbkllRm9yUHJvYmVSZXNwKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4KiBhZGRJRSwgdEFOSV9VMTYgKmFkZG5JRUxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggcHJvYmVSZXFQMnBJZSkKK3sKKyAgICAvKiBJZiBQcm9iZSByZXF1ZXN0IGRvZXNuJ3QgaGF2ZSBQMlAgSUUsIHRoZW4gdGFrZSBvdXQgUDJQIElFCisgICAgICAgZnJvbSBhZGRpdGlvbmFsIElFICovCisgICAgaWYoIXByb2JlUmVxUDJwSWUpCisgICAgeworICAgICAgICB0QU5JX1U4KiB0ZW1wYnVmID0gTlVMTDsKKyAgICAgICAgdEFOSV9VMTYgdGVtcExlbiA9IDA7CisgICAgICAgIGludCBsZWZ0ID0gKmFkZG5JRUxlbjsKKyAgICAgICAgdl9VOF90ICpwdHIgPSBhZGRJRTsKKyAgICAgICAgdl9VOF90IGVsZW1faWQsIGVsZW1fbGVuOworCisgICAgICAgIGlmKE5VTEwgPT0gYWRkSUUpCisgICAgICAgIHsKKyAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICBGTCgiIE5VTEwgYWRkSUUgcG9pbnRlciIpKTspCisgICAgICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgICAgICB9CisKKyAgICAgICAgdGVtcGJ1ZiA9IHZvc19tZW1fbWFsbG9jKGxlZnQpOworICAgICAgICBpZiAoIE5VTEwgPT0gdGVtcGJ1ZiApCisgICAgICAgIHsKKyAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgRkwoIlVuYWJsZSB0byBhbGxvY2F0ZSBtZW1vcnkgdG8gc3RvcmUgYWRkbiBJRSIpKTspCisgICAgICAgICAgICByZXR1cm4gZVNJUl9NRU1fQUxMT0NfRkFJTEVEOworICAgICAgICB9CisKKyAgICAgICAgd2hpbGUobGVmdCA+PSAyKQorICAgICAgICB7CisgICAgICAgICAgICBlbGVtX2lkICA9IHB0clswXTsKKyAgICAgICAgICAgIGVsZW1fbGVuID0gcHRyWzFdOworICAgICAgICAgICAgbGVmdCAtPSAyOworICAgICAgICAgICAgaWYoZWxlbV9sZW4gPiBsZWZ0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICBGTCgiKioqKkludmFsaWQgSUVzIGVpZCA9ICVkIGVsZW1fbGVuPSVkIGxlZnQ9JWQqKioqKiIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbV9pZCxlbGVtX2xlbixsZWZ0KTsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUodGVtcGJ1Zik7CisgICAgICAgICAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICggISggKFNJUl9NQUNfRUlEX1ZFTkRPUiA9PSBlbGVtX2lkKSAmJgorICAgICAgICAgICAgICAgICAgIChtZW1jbXAoJnB0clsyXSwgU0lSX01BQ19QMlBfT1VJLCBTSVJfTUFDX1AyUF9PVUlfU0laRSk9PTApICkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSAodGVtcGJ1ZiArIHRlbXBMZW4sICZwdHJbMF0sIGVsZW1fbGVuICsgMik7CisgICAgICAgICAgICAgICAgdGVtcExlbiArPSAoZWxlbV9sZW4gKyAyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGxlZnQgLT0gZWxlbV9sZW47CisgICAgICAgICAgICBwdHIgKz0gKGVsZW1fbGVuICsgMik7CisgICAgICAgfQorICAgICAgIHZvc19tZW1fY29weSAoYWRkSUUsIHRlbXBidWYsIHRlbXBMZW4pOworICAgICAgICphZGRuSUVMZW4gPSB0ZW1wTGVuOworICAgICAgIHZvc19tZW1fZnJlZSh0ZW1wYnVmKTsKKyAgICB9CisgICAgcmV0dXJuIGVTSVJfU1VDQ0VTUzsKK30KKwordm9pZAorbGltU2VuZFByb2JlUnNwTWdtdEZyYW1lKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY0FkZHIgICAgcGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgdHBBbmlTU0lEICAgICAgcFNzaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgc2hvcnQgICAgICAgICAgblN0YUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggICAgICAgIG5LZWVwQWxpdmUsCisgICAgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICAgICAgICBwcm9iZVJlcVAycEllKQoreworICAgIHREb3QxMWZQcm9iZVJlc3BvbnNlICpwRnJtOworICAgIHRTaXJSZXRTdGF0dXMgICAgICAgICBuU2lyU3RhdHVzOworICAgIHRBTklfVTMyICAgICAgICAgICAgICBjZmcsIG5QYXlsb2FkLCBuU3RhdHVzOworICAgIHRwU2lyTWFjTWdtdEhkciAgICAgICBwTWFjSGRyOworICAgIHRBTklfVTggICAgICAgICAgICAgICpwRnJhbWU7CisgICAgdm9pZCAgICAgICAgICAgICAgICAgKnBQYWNrZXQ7CisgICAgZUhhbFN0YXR1cyAgICAgICAgICAgIGhhbHN0YXR1czsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgYWRkbklFUHJlc2VudDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgYWRkbklFMUxlbj0wOworICAgIHRBTklfVTMyICAgICAgICAgICAgICBhZGRuSUUyTGVuPTA7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgIGFkZG5JRTNMZW49MDsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgdG90YWxBZGRuSWVMZW4gPSAwOworICAgIHRBTklfVTMyICAgICAgICAgICAgICB3cHNBcEVuYWJsZT0wLCB0bXA7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgIHR4RmxhZyA9IDA7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgKmFkZElFID0gTlVMTDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAqcFAycEllID0gTlVMTDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgbm9hTGVuID0gMDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgdG90YWxfbm9hTGVuID0gMDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgbm9hU3RyZWFtW1NJUl9NQVhfTk9BX0FUVFJfTEVOCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBTSVJfUDJQX0lFX0hFQURFUl9MRU5dOworICAgIHRBTklfVTggICAgICAgICAgICAgICBub2FJZVtTSVJfTUFYX05PQV9BVFRSX0xFTiArIFNJUl9QMlBfSUVfSEVBREVSX0xFTl07CisgICAgdERvdDExZklFRXh0Q2FwICAgICAgZXh0cmFjdGVkRXh0Q2FwOworICAgIHRBTklfQk9PTEVBTiAgICAgICAgIGV4dHJhY3RlZEV4dENhcEZsYWcgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICBuQnl0ZXMgPSAwOworCisgICAgaWYocE1hYy0+Z0RyaXZlclR5cGUgPT0gZURSSVZFUl9UWVBFX01GRykgICAgICAgICAvLyBXZSBkb24ndCBhbnN3ZXIgcmVxdWVzdHMKKyAgICB7CisgICAgICAgIHJldHVybjsgICAgICAgICAgICAgICAgICAgICAvLyBpbiB0aGlzIGNhc2UuCisgICAgfQorCisgICAgaWYoTlVMTCA9PSBwc2Vzc2lvbkVudHJ5KQorICAgIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHBGcm0gPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodERvdDExZlByb2JlUmVzcG9uc2UpKTsKKyAgICBpZiAoIE5VTEwgPT0gcEZybSApCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlVuYWJsZSB0byBhbGxvY2F0ZSBtZW1vcnkgaW4gbGltU2VuZFByb2JlUnNwTWdtdEZyYW1lIikgKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHZvc19tZW1fc2V0KCggdEFOSV9VOCogKSZleHRyYWN0ZWRFeHRDYXAsIHNpemVvZiggdERvdDExZklFRXh0Q2FwICksIDApOworCisgICAgLy8gRmlsbCBvdXQgJ2ZybScsIGFmdGVyIHdoaWNoIHdlJ2xsIGp1c3QgaGFuZCB0aGUgc3RydWN0IG9mZiB0bworICAgIC8vICdkb3QxMWZQYWNrUHJvYmVSZXNwb25zZScuCisgICAgdm9zX21lbV9zZXQoKCB0QU5JX1U4KiApcEZybSwgc2l6ZW9mKCB0RG90MTFmUHJvYmVSZXNwb25zZSApLCAwKTsKKworICAgIC8vIFRpbWVzdGFtcCB0byBiZSB1cGRhdGVkIGJ5IFRGUCwgYmVsb3cuCisKKyAgICAvLyBCZWFjb24gSW50ZXJ2YWw6CisgICAgaWYocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0FQX1JPTEUpCisgICAgeworICAgICAgICBwRnJtLT5CZWFjb25JbnRlcnZhbC5pbnRlcnZhbCA9IHBNYWMtPnNjaC5zY2hPYmplY3QuZ1NjaEJlYWNvbkludGVydmFsOyAgICAgICAgCisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIG5TaXJTdGF0dXMgPSB3bGFuX2NmZ0dldEludCggcE1hYywgV05JX0NGR19CRUFDT05fSU5URVJWQUwsICZjZmcpOworICAgICAgICBpZiA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pZihwc2Vzc2lvbkVudHJ5LT53cHNfc3RhdGUgIT0gU0FQX1dQU19ESVNBQkxFRCkKKyAgICAgICAgeworICAgICAgICAgICAgUG9wdWxhdGVEb3QxMWZQcm9iZVJlc1dQU0lFcyhwTWFjLCAmcEZybS0+V3NjUHJvYmVSZXMsIHBzZXNzaW9uRW50cnkpOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCAodEFOSV9VMTYpIFdOSV9DRkdfV1BTX0VOQUJMRSwgJnRtcCkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIkZhaWxlZCB0byBjZmcgZ2V0IGlkICVkIiwgV05JX0NGR19XUFNfRU5BQkxFICk7CisKKyAgICAgICAgd3BzQXBFbmFibGUgPSB0bXAgJiBXTklfQ0ZHX1dQU19FTkFCTEVfQVA7CisKKyAgICAgICAgaWYgKHdwc0FwRW5hYmxlKQorICAgICAgICB7CisgICAgICAgICAgICBQb3B1bGF0ZURvdDExZldzY0luUHJvYmVSZXMocE1hYywgJnBGcm0tPldzY1Byb2JlUmVzKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChwTWFjLT5saW0ud3NjSWVJbmZvLnByb2JlUmVzcFdzY0Vucm9sbG1lbnRTdGF0ZSA9PSBlTElNX1dTQ19FTlJPTExfQkVHSU4pCisgICAgICAgIHsKKyAgICAgICAgICAgIFBvcHVsYXRlRG90MTFmV3NjUmVnaXN0cmFySW5mb0luUHJvYmVSZXMocE1hYywgJnBGcm0tPldzY1Byb2JlUmVzKTsKKyAgICAgICAgICAgIHBNYWMtPmxpbS53c2NJZUluZm8ucHJvYmVSZXNwV3NjRW5yb2xsbWVudFN0YXRlID0gZUxJTV9XU0NfRU5ST0xMX0lOX1BST0dSRVNTOworICAgICAgICB9CisKKyAgICAgICAgaWYgKHBNYWMtPmxpbS53c2NJZUluZm8ud3NjRW5yb2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gICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX1BST0JFX1JTUF9BREROSUVfRkxBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICZhZGRuSUVQcmVzZW50KSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiVW5hYmxlIHRvIGdldCBXTklfQ0ZHX1BST0JFX1JTUF9BREROSUVfRkxBRyIpKTsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwRnJtKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgIH0KKworICAgIGlmIChhZGRuSUVQcmVzZW50KQorICAgIHsKKworICAgICAgICBhZGRJRSA9IHZvc19tZW1fbWFsbG9jKFdOSV9DRkdfUFJPQkVfUlNQX0FERE5JRV9EQVRBMV9MRU4qMyk7CisgICAgICAgIGlmICggTlVMTCA9PSBhZGRJRSApCisgICAgICAgIHsKKyAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgRkwoIlVuYWJsZSB0byBhbGxvY2F0ZSBtZW1vcnkgdG8gc3RvcmUgYWRkbiBJRSIpKTspCisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocEZybSk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIC8vUHJvYmUgcnNwIElFIGF2YWlsYWJsZQorICAgICAgICBpZiAoIGVTSVJfU1VDQ0VTUyAhPSB3bGFuX2NmZ0dldFN0ckxlbihwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfUFJPQkVfUlNQX0FERE5JRV9EQVRBMSwgJmFkZG5JRTFMZW4pICkKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJVbmFibGUgdG8gZ2V0IFdOSV9DRkdfUFJPQkVfUlNQX0FERE5JRV9EQVRBMSBsZW5ndGgiKSk7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUoYWRkSUUpOworICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBGcm0pOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGlmIChhZGRuSUUxTGVuIDw9IFdOSV9DRkdfUFJPQkVfUlNQX0FERE5JRV9EQVRBMV9MRU4gJiYgYWRkbklFMUxlbiAmJgorICAgICAgICAgICAgICAgICAgICAgKG5CeXRlcyArIGFkZG5JRTFMZW4pIDw9IFNJUl9NQVhfUEFDS0VUX1NJWkUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmICggZVNJUl9TVUNDRVNTICE9IHdsYW5fY2ZnR2V0U3RyKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19QUk9CRV9SU1BfQURETklFX0RBVEExLCAmYWRkSUVbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmFkZG5JRTFMZW4pICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICAgIEZMKCJVbmFibGUgdG8gZ2V0IFdOSV9DRkdfUFJPQkVfUlNQX0FERE5JRV9EQVRBMSBTdHJpbmciKSk7CisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKGFkZElFKTsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocEZybSk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy9Qcm9iZSByc3AgSUUgYXZhaWxhYmxlCisgICAgICAgIGlmICggZVNJUl9TVUNDRVNTICE9IHdsYW5fY2ZnR2V0U3RyTGVuKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19QUk9CRV9SU1BfQURETklFX0RBVEEyLCAmYWRkbklFMkxlbikgKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoIlVuYWJsZSB0byBnZXQgV05JX0NGR19QUk9CRV9SU1BfQURETklFX0RBVEEyIGxlbmd0aCIpKTsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShhZGRJRSk7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocEZybSk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgaWYgKGFkZG5JRTJMZW4gPD0gV05JX0NGR19QUk9CRV9SU1BfQURETklFX0RBVEEyX0xFTiAmJiBhZGRuSUUyTGVuICYmCisgICAgICAgICAgICAgICAgICAgICAobkJ5dGVzICsgYWRkbklFMkxlbikgPD0gU0lSX01BWF9QQUNLRVRfU0laRSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKCBlU0lSX1NVQ0NFU1MgIT0gd2xhbl9jZmdHZXRTdHIocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX1BST0JFX1JTUF9BREROSUVfREFUQTIsICZhZGRJRVthZGRuSUUxTGVuXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmYWRkbklFMkxlbikgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgICAgRkwoIlVuYWJsZSB0byBnZXQgV05JX0NGR19QUk9CRV9SU1BfQURETklFX0RBVEEyIFN0cmluZyIpKTsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUoYWRkSUUpOworICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwRnJtKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvL1Byb2JlIHJzcCBJRSBhdmFpbGFibGUKKyAgICAgICAgaWYgKCBlU0lSX1NVQ0NFU1MgIT0gd2xhbl9jZmdHZXRTdHJMZW4ocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX1BST0JFX1JTUF9BREROSUVfREFUQTMsICZhZGRuSUUzTGVuKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiVW5hYmxlIHRvIGdldCBXTklfQ0ZHX1BST0JFX1JTUF9BREROSUVfREFUQTMgbGVuZ3RoIikpOworICAgICAgICAgICAgdm9zX21lbV9mcmVlKGFkZElFKTsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwRnJtKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBpZiAoYWRkbklFM0xlbiA8PSBXTklfQ0ZHX1BST0JFX1JTUF9BREROSUVfREFUQTNfTEVOICYmIGFkZG5JRTNMZW4gJiYKKyAgICAgICAgICAgICAgICAgICAgIChuQnl0ZXMgKyBhZGRuSUUzTGVuKSA8PSBTSVJfTUFYX1BBQ0tFVF9TSVpFKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoIGVTSVJfU1VDQ0VTUyAhPSB3bGFuX2NmZ0dldFN0cihwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfUFJPQkVfUlNQX0FERE5JRV9EQVRBMywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmYWRkSUVbYWRkbklFMUxlbiArIGFkZG5JRTJMZW5dLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZhZGRuSUUzTGVuKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgICBGTCgiVW5hYmxlIHRvIGdldCBXTklfQ0ZHX1BST0JFX1JTUF9BREROSUVfREFUQTMgU3RyaW5nIikpOworICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShhZGRJRSk7CisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBGcm0pOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICB0b3RhbEFkZG5JZUxlbiA9IGFkZG5JRTFMZW4gKyBhZGRuSUUyTGVuICsgYWRkbklFM0xlbjsKKworICAgICAgICBpZihlU0lSX1NVQ0NFU1MgIT0gbGltR2V0QWRkbkllRm9yUHJvYmVSZXNwKHBNYWMsIGFkZElFLCAmdG90YWxBZGRuSWVMZW4sIHByb2JlUmVxUDJwSWUpKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgRkwoIlVuYWJsZSB0byBnZXQgZmluYWwgQWRkaXRpb25hbCBJRSBmb3IgUHJvYmUgUmVxIikpOworICAgICAgICAgICAgdm9zX21lbV9mcmVlKGFkZElFKTsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwRnJtKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgblNpclN0YXR1cyA9IGxpbVN0cmlwT2ZmRXh0Q2FwSUVBbmRVcGRhdGVTdHJ1Y3QocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRJRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdG90YWxBZGRuSWVMZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmV4dHJhY3RlZEV4dENhcCApOworICAgICAgICBpZihlU0lSX1NVQ0NFU1MgIT0gblNpclN0YXR1cyApCisgICAgICAgIHsKKyAgICAgICAgICAgIGV4dHJhY3RlZEV4dENhcEZsYWcgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgICBGTCgiVW5hYmxlIHRvIFN0cmlwb2ZmIEV4dENhcCBJRSBmcm9tIFByb2JlIFJzcCIpKTsKKyAgICAgICAgfQorCisgICAgICAgIG5CeXRlcyA9IG5CeXRlcyArIHRvdGFsQWRkbkllTGVuOworICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgIEZMKCJwcm9iZSByc3AgcGFja2V0IHNpemUgaXMgJWQgIiksIG5CeXRlcyk7CisgICAgICAgIGlmIChwcm9iZVJlcVAycEllKQorICAgICAgICB7CisgICAgICAgICAgICBwUDJwSWUgPSBsaW1HZXRQMnBJRVB0cihwTWFjLCAmYWRkSUVbMF0sIHRvdGFsQWRkbkllTGVuKTsKKyAgICAgICAgICAgIGlmIChwUDJwSWUgIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvL2dldCBOb0EgYXR0cmlidXRlIHN0cmVhbSBQMlAgSUUKKyAgICAgICAgICAgICAgICBub2FMZW4gPSBsaW1HZXROb2FBdHRyU3RyZWFtKHBNYWMsIG5vYVN0cmVhbSwgcHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgaWYgKG5vYUxlbiAhPSAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdG90YWxfbm9hTGVuID0gbGltQnVpbGRQMnBJZShwTWFjLCAmbm9hSWVbMF0sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbm9hU3RyZWFtWzBdLCBub2FMZW4pOyAKKyAgICAgICAgICAgICAgICAgICAgbkJ5dGVzID0gbkJ5dGVzICsgdG90YWxfbm9hTGVuOworICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJwMnAgcHJvYmUgcnNwIHBhY2tldCBzaXplIGlzICAlZCwgbm9hbGVuZ3RoIGlzICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbkJ5dGVzLCB0b3RhbF9ub2FMZW4pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qbWVyZ2UgRXh0Q2FwIElFKi8KKyAgICBpZiAoZXh0cmFjdGVkRXh0Q2FwRmxhZyAmJiBleHRyYWN0ZWRFeHRDYXAucHJlc2VudCkKKyAgICB7CisgICAgICAgIGxpbU1lcmdlRXh0Q2FwSUVTdHJ1Y3QoJnBGcm0tPkV4dENhcCwgJmV4dHJhY3RlZEV4dENhcCk7CisgICAgfQorCisgICAgblN0YXR1cyA9IGRvdDExZkdldFBhY2tlZFByb2JlUmVzcG9uc2VTaXplKCBwTWFjLCBwRnJtLCAmblBheWxvYWQgKTsKKyAgICBpZiAoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1AsIEZMKCJGYWlsZWQgdG8gY2FsY3VsYXRlIHRoZSBwYWNrZWQgc2l6ZSBmIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvciBhIFByb2JlIFJlc3BvbnNlICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgIG5TdGF0dXMgKTsKKyAgICAgICAgLy8gV2UnbGwgZmFsbCBiYWNrIG9uIHRoZSB3b3JzdCBjYXNlIHNjZW5hcmlvOgorICAgICAgICBuUGF5bG9hZCA9IHNpemVvZiggdERvdDExZlByb2JlUmVzcG9uc2UgKTsKKyAgICB9CisgICAgZWxzZSBpZiAoIERPVDExRl9XQVJORUQoIG5TdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csIEZMKCJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIGNhbGN1bGF0aW5nIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0aGUgcGFja2VkIHNpemUgZm9yIGEgUHJvYmUgUmVzcG9uc2UgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIoMHglMDh4KS4iKSwgblN0YXR1cyApOworICAgIH0KKworICAgIG5CeXRlcyArPSBuUGF5bG9hZCArIHNpemVvZiggdFNpck1hY01nbXRIZHIgKTsKKworICAgIGhhbHN0YXR1cyA9IHBhbFBrdEFsbG9jKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggdEFOSV9VMTYgKW5CeXRlcywgKCB2b2lkKiogKSAmcEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIHZvaWQqKiApICZwUGFja2V0ICk7CisgICAgaWYgKCAhIEhBTF9TVEFUVVNfU1VDQ0VTUyAoIGhhbHN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HUCwgRkwoIkZhaWxlZCB0byBhbGxvY2F0ZSAlZCBieXRlcyBmb3IgYSBQcm8iCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImJlIFJlc3BvbnNlLiIpLCBuQnl0ZXMgKTsKKyAgICAgICAgaWYgKCBhZGRJRSAhPSBOVUxMICkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9mcmVlKGFkZElFKTsKKyAgICAgICAgfQorICAgICAgICB2b3NfbWVtX2ZyZWUocEZybSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICAvLyBQYXJhbm9pYToKKyAgICB2b3NfbWVtX3NldCggcEZyYW1lLCBuQnl0ZXMsIDAgKTsKKworICAgIC8vIE5leHQsIHdlIGZpbGwgb3V0IHRoZSBidWZmZXIgZGVzY3JpcHRvcjoKKyAgICBuU2lyU3RhdHVzID0gbGltUG9wdWxhdGVNYWNIZWFkZXIoIHBNYWMsIHBGcmFtZSwgU0lSX01BQ19NR01UX0ZSQU1FLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX01HTVRfUFJPQkVfUlNQLCBwZWVyTWFjQWRkcixwc2Vzc2lvbkVudHJ5LT5zZWxmTWFjQWRkcik7CisgICAgaWYgKCBlU0lSX1NVQ0NFU1MgIT0gblNpclN0YXR1cyApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gcG9wdWxhdGUgdGhlIGJ1ZmZlciBkZXNjcmlwIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0b3IgZm9yIGEgUHJvYmUgUmVzcG9uc2UgKCVkKS4iKSwKKyAgICAgICAgICAgICAgICBuU2lyU3RhdHVzICk7CisgICAgICAgIHBhbFBrdEZyZWUoIHBNYWMtPmhIZGQsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICAgICAgICAgKCB2b2lkKiApIHBGcmFtZSwgKCB2b2lkKiApIHBQYWNrZXQgKTsKKyAgICAgICAgaWYgKCBhZGRJRSAhPSBOVUxMICkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9mcmVlKGFkZElFKTsKKyAgICAgICAgfQorICAgICAgICB2b3NfbWVtX2ZyZWUocEZybSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBwTWFjSGRyID0gKCB0cFNpck1hY01nbXRIZHIgKSBwRnJhbWU7CisgIAorICAgIHNpckNvcHlNYWNBZGRyKHBNYWNIZHItPmJzc0lkLHBzZXNzaW9uRW50cnktPmJzc0lkKTsKKworICAgIC8vIFRoYXQgZG9uZSwgcGFjayB0aGUgUHJvYmUgUmVzcG9uc2U6CisgICAgblN0YXR1cyA9IGRvdDExZlBhY2tQcm9iZVJlc3BvbnNlKCBwTWFjLCBwRnJtLCBwRnJhbWUgKyBzaXplb2YodFNpck1hY01nbXRIZHIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgblBheWxvYWQsICZuUGF5bG9hZCApOworICAgIGlmICggRE9UMTFGX0ZBSUxFRCggblN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBwYWNrIGEgUHJvYmUgUmVzcG9uc2UgKDB4JTA4eCkuIiksCisgICAgICAgICAgICAgICAgblN0YXR1cyApOworICAgICAgICBwYWxQa3RGcmVlKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsICggdm9pZCogKSBwRnJhbWUsICggdm9pZCogKSBwUGFja2V0ICk7CisgICAgICAgIGlmICggYWRkSUUgIT0gTlVMTCApCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShhZGRJRSk7CisgICAgICAgIH0KKyAgICAgICAgdm9zX21lbV9mcmVlKHBGcm0pOworICAgICAgICByZXR1cm47ICAgICAgICAgICAgICAgICAvLyBhbGxvY2F0ZWQhCisgICAgfQorICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dXLCBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBwYWNraW5nIGEgUCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAicm9iZSBSZXNwb25zZSAoMHglMDh4KS4iKSwgblN0YXR1cyApOworICAgIH0KKworICAgIFBFTE9HMyhsaW1Mb2coIHBNYWMsIExPRzMsIEZMKCJTZW5kaW5nIFByb2JlIFJlc3BvbnNlIGZyYW1lIHRvICIpICk7CisgICAgbGltUHJpbnRNYWNBZGRyKCBwTWFjLCBwZWVyTWFjQWRkciwgTE9HMyApOykKKworICAgIHBNYWMtPnN5cy5wcm9iZVJlc3BvbmQrKzsKKworICAgIGlmKCBwTWFjLT5saW0uZ3BMaW1SZW1haW5PbkNoYW5SZXEgKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9jb3B5ICggcEZyYW1lK3NpemVvZih0U2lyTWFjTWdtdEhkcikrblBheWxvYWQsCisgICAgICAgICAgcE1hYy0+bGltLmdwTGltUmVtYWluT25DaGFuUmVxLT5wcm9iZVJzcEllLCAocE1hYy0+bGltLmdwTGltUmVtYWluT25DaGFuUmVxLT5sZW5ndGggLSBzaXplb2YoIHRTaXJSZW1haW5PbkNoblJlcSApKSApOworICAgIH0KKworICAgIGlmICggYWRkbklFUHJlc2VudCApCisgICAgeworICAgICAgICB2b3NfbWVtX2NvcHkocEZyYW1lK3NpemVvZih0U2lyTWFjTWdtdEhkcikrblBheWxvYWQsICZhZGRJRVswXSwgdG90YWxBZGRuSWVMZW4pOworICAgIH0KKyAgICBpZiAobm9hTGVuICE9IDApCisgICAgeworICAgICAgICBpZiAodG90YWxfbm9hTGVuID4gKFNJUl9NQVhfTk9BX0FUVFJfTEVOICsgU0lSX1AyUF9JRV9IRUFERVJfTEVOKSkKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICBGTCgiTm90IGFibGUgdG8gaW5zZXJ0IE5vQSBiZWNhdXNlIG9mIGxlbmd0aCBjb25zdHJhaW50LiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVG90YWwgTGVuZ3RoIGlzIDolZCIpLHRvdGFsX25vYUxlbik7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUoYWRkSUUpOworICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBGcm0pOworICAgICAgICAgICAgcGFsUGt0RnJlZSggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULAorICAgICAgICAgICAgICAgICAgICAgICAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCAmcEZyYW1lW25CeXRlcyAtICh0b3RhbF9ub2FMZW4pXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbm9hSWVbMF0sIHRvdGFsX25vYUxlbik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBpZiggKCBTSVJfQkFORF81X0dIWiA9PSBsaW1HZXRSRkJhbmQocHNlc3Npb25FbnRyeS0+Y3VycmVudE9wZXJDaGFubmVsKSkKKyAgICAgICB8fCAoIHBzZXNzaW9uRW50cnktPnBlUGVyc29uYSA9PSBWT1NfUDJQX0NMSUVOVF9NT0RFICkgfHwKKyAgICAgICAgICggcHNlc3Npb25FbnRyeS0+cGVQZXJzb25hID09IFZPU19QMlBfR09fTU9ERSkKKyAgICAgICAgICkKKyAgICB7CisgICAgICAgIHR4RmxhZyB8PSBIQUxfVVNFX0JEX1JBVEUyX0ZPUl9NQU5BR0VNRU5UX0ZSQU1FOworICAgIH0KKworICAgIC8vIFF1ZXVlIFByb2JlIFJlc3BvbnNlIGZyYW1lIGluIGhpZ2ggcHJpb3JpdHkgV1EKKyAgICBoYWxzdGF0dXMgPSBoYWxUeEZyYW1lKCAoIHRIYWxIYW5kbGUgKSBwTWFjLCBwUGFja2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICggdEFOSV9VMTYgKSBuQnl0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFOSV9UWERJUl9UT0RTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDcsLy9TTUFDX1NXQkRfVFhfVElEX01HTVRfTE9XLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVR4Q29tcGxldGUsIHBGcmFtZSwgdHhGbGFnICk7CisgICAgaWYgKCAhIEhBTF9TVEFUVVNfU1VDQ0VTUyAoIGhhbHN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIkNvdWxkIG5vdCBzZW5kIFByb2JlIFJlc3BvbnNlLiIpICk7CisgICAgICAgIC8vUGt0IHdpbGwgYmUgZnJlZWQgdXAgYnkgdGhlIGNhbGxiYWNrCisgICAgfQorCisgICAgaWYgKCBhZGRJRSAhPSBOVUxMICkKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZShhZGRJRSk7CisgICAgfQorCisgICAgdm9zX21lbV9mcmVlKHBGcm0pOworICAgIHJldHVybjsKKworCit9IC8vIEVuZCBsaW1TZW5kUHJvYmVSc3BNZ210RnJhbWUuCisKK3ZvaWQKK2xpbVNlbmRBZGR0c1JlcUFjdGlvbkZyYW1lKHRwQW5pU2lyR2xvYmFsICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjQWRkciAgICAgICBwZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJBZGR0c1JlcUluZm8gKnBBZGRUUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uICAgICAgIHBzZXNzaW9uRW50cnkpCit7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICBpOworICAgIHRBTklfVTggICAgICAgICAgICAgICAqcEZyYW1lOworICAgIHRTaXJSZXRTdGF0dXMgICAgICAgICAgblNpclN0YXR1czsKKyAgICB0RG90MTFmQWRkVFNSZXF1ZXN0ICAgIEFkZFRTUmVxOworICAgIHREb3QxMWZXTU1BZGRUU1JlcXVlc3QgV01NQWRkVFNSZXE7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICBuUGF5bG9hZCwgbkJ5dGVzLCBuU3RhdHVzOworICAgIHRwU2lyTWFjTWdtdEhkciAgICAgICAgcE1hY0hkcjsKKyAgICB2b2lkICAgICAgICAgICAgICAgICAgKnBQYWNrZXQ7CisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRQorICAgIHRBTklfVTMyICAgICAgICAgICAgICAgcGh5TW9kZTsKKyNlbmRpZgorICAgIGVIYWxTdGF0dXMgICAgICAgICAgICAgaGFsc3RhdHVzOworICAgIHRBTklfVTMyICAgICAgICAgICAgICAgdHhGbGFnID0gMDsKKworICAgIGlmKE5VTEwgPT0gcHNlc3Npb25FbnRyeSkKKyAgICB7CisgICAgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBpZiAoICEgcEFkZFRTLT53bWVUc3BlY1ByZXNlbnQgKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9zZXQoKCB0QU5JX1U4KiApJkFkZFRTUmVxLCBzaXplb2YoIEFkZFRTUmVxICksIDApOworCisgICAgICAgIEFkZFRTUmVxLkFjdGlvbi5hY3Rpb24gICAgID0gU0lSX01BQ19RT1NfQUREX1RTX1JFUTsKKyAgICAgICAgQWRkVFNSZXEuRGlhbG9nVG9rZW4udG9rZW4gPSBwQWRkVFMtPmRpYWxvZ1Rva2VuOworICAgICAgICBBZGRUU1JlcS5DYXRlZ29yeS5jYXRlZ29yeSA9IFNJUl9NQUNfQUNUSU9OX1FPU19NR01UOworICAgICAgICBpZiAoIHBBZGRUUy0+bGxlVHNwZWNQcmVzZW50ICkKKyAgICAgICAgeworICAgICAgICAgICAgUG9wdWxhdGVEb3QxMWZUU1BFQyggJnBBZGRUUy0+dHNwZWMsICZBZGRUU1JlcS5UU1BFQyApOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgUG9wdWxhdGVEb3QxMWZXTU1UU1BFQyggJnBBZGRUUy0+dHNwZWMsICZBZGRUU1JlcS5XTU1UU1BFQyApOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCBwQWRkVFMtPmxsZVRzcGVjUHJlc2VudCApCisgICAgICAgIHsKKyAgICAgICAgICAgIEFkZFRTUmVxLm51bV9XTU1UQ0xBUyA9IDA7CisgICAgICAgICAgICBBZGRUU1JlcS5udW1fVENMQVMgPSBwQWRkVFMtPm51bVRjbGFzOworICAgICAgICAgICAgZm9yICggaSA9IDA7IGkgPCBwQWRkVFMtPm51bVRjbGFzOyArK2kpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgUG9wdWxhdGVEb3QxMWZUQ0xBUyggcE1hYywgJnBBZGRUUy0+dGNsYXNJbmZvW2ldLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZBZGRUU1JlcS5UQ0xBU1tpXSApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgQWRkVFNSZXEubnVtX1RDTEFTID0gMDsKKyAgICAgICAgICAgIEFkZFRTUmVxLm51bV9XTU1UQ0xBUyA9IHBBZGRUUy0+bnVtVGNsYXM7CisgICAgICAgICAgICBmb3IgKCBpID0gMDsgaSA8IHBBZGRUUy0+bnVtVGNsYXM7ICsraSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQb3B1bGF0ZURvdDExZldNTVRDTEFTKCBwTWFjLCAmcEFkZFRTLT50Y2xhc0luZm9baV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJkFkZFRTUmVxLldNTVRDTEFTW2ldICk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoIHBBZGRUUy0+dGNsYXNQcm9jUHJlc2VudCApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmICggcEFkZFRTLT5sbGVUc3BlY1ByZXNlbnQgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEFkZFRTUmVxLlRDTEFTU1BST0MucHJvY2Vzc2luZyA9IHBBZGRUUy0+dGNsYXNQcm9jOworICAgICAgICAgICAgICAgIEFkZFRTUmVxLlRDTEFTU1BST0MucHJlc2VudCAgICA9IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgQWRkVFNSZXEuV01NVENMQVNQUk9DLnZlcnNpb24gICAgPSAxOworICAgICAgICAgICAgICAgIEFkZFRTUmVxLldNTVRDTEFTUFJPQy5wcm9jZXNzaW5nID0gcEFkZFRTLT50Y2xhc1Byb2M7CisgICAgICAgICAgICAgICAgQWRkVFNSZXEuV01NVENMQVNQUk9DLnByZXNlbnQgICAgPSAxOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgblN0YXR1cyA9IGRvdDExZkdldFBhY2tlZEFkZFRTUmVxdWVzdFNpemUoIHBNYWMsICZBZGRUU1JlcSwgJm5QYXlsb2FkICk7CisgICAgICAgIGlmICggRE9UMTFGX0ZBSUxFRCggblN0YXR1cyApICkKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dQLCBGTCgiRmFpbGVkIHRvIGNhbGN1bGF0ZSB0aGUgcGFja2VkIHNpemUgZiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm9yIGFuIEFkZCBUUyBSZXF1ZXN0ICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgICAgICBuU3RhdHVzICk7CisgICAgICAgICAgICAvLyBXZSdsbCBmYWxsIGJhY2sgb24gdGhlIHdvcnN0IGNhc2Ugc2NlbmFyaW86CisgICAgICAgICAgICBuUGF5bG9hZCA9IHNpemVvZiggdERvdDExZkFkZFRTUmVxdWVzdCApOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csIEZMKCJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIGNhbGN1bGF0aW5nIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAidGhlIHBhY2tlZCBzaXplIGZvciBhbiBBZGQgVFMgUmVxdWVzdCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiAoMHglMDh4KS4iKSwgblN0YXR1cyApOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHZvc19tZW1fc2V0KCggdEFOSV9VOCogKSZXTU1BZGRUU1JlcS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FNSZXEuRVNFVHJhZlN0cm1SYXRlU2V0LHNpemVvZih0QU5JX1U4KSk7CisjZW5kaWYKKyAgICAgICAgLy8gZmlsbFdtZVRzcGVjSUUKKworICAgICAgICBuU3RhdHVzID0gZG90MTFmR2V0UGFja2VkV01NQWRkVFNSZXF1ZXN0U2l6ZSggcE1hYywgJldNTUFkZFRTUmVxLCAmblBheWxvYWQgKTsKKyAgICAgICAgaWYgKCBET1QxMUZfRkFJTEVEKCBuU3RhdHVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1AsIEZMKCJGYWlsZWQgdG8gY2FsY3VsYXRlIHRoZSBwYWNrZWQgc2l6ZSBmIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3IgYSBXTU0gQWRkIFRTIFJlcXVlc3QgKDB4JTA4eCkuIiksCisgICAgICAgICAgICAgICAgICAgIG5TdGF0dXMgKTsKKyAgICAgICAgICAgIC8vIFdlJ2xsIGZhbGwgYmFjayBvbiB0aGUgd29yc3QgY2FzZSBzY2VuYXJpbzoKKyAgICAgICAgICAgIG5QYXlsb2FkID0gc2l6ZW9mKCB0RG90MTFmQWRkVFNSZXF1ZXN0ICk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoIERPVDExRl9XQVJORUQoIG5TdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HVywgRkwoIlRoZXJlIHdlcmUgd2FybmluZ3Mgd2hpbGUgY2FsY3VsYXRpbmciCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0aGUgcGFja2VkIHNpemUgZm9yIGEgV01NIEFkZCBUUyBSZXF1IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZXN0ICgweCUwOHgpLiIpLCBuU3RhdHVzICk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBuQnl0ZXMgPSBuUGF5bG9hZCArIHNpemVvZiggdFNpck1hY01nbXRIZHIgKTsKKworICAgIGhhbHN0YXR1cyA9IHBhbFBrdEFsbG9jKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggdEFOSV9VMTYgKW5CeXRlcywgKCB2b2lkKiogKSAmcEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIHZvaWQqKiApICZwUGFja2V0ICk7CisgICAgaWYgKCAhIEhBTF9TVEFUVVNfU1VDQ0VTUyAoIGhhbHN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HUCwgRkwoIkZhaWxlZCB0byBhbGxvY2F0ZSAlZCBieXRlcyBmb3IgYW4gQWQiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImQgVFMgUmVxdWVzdC4iKSwgbkJ5dGVzICk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICAvLyBQYXJhbm9pYToKKyAgICB2b3NfbWVtX3NldCggcEZyYW1lLCBuQnl0ZXMsIDAgKTsKKworICAgIC8vIE5leHQsIHdlIGZpbGwgb3V0IHRoZSBidWZmZXIgZGVzY3JpcHRvcjoKKyAgICBuU2lyU3RhdHVzID0gbGltUG9wdWxhdGVNYWNIZWFkZXIoIHBNYWMsIHBGcmFtZSwgU0lSX01BQ19NR01UX0ZSQU1FLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX01HTVRfQUNUSU9OLCBwZWVyTWFjQWRkcixwc2Vzc2lvbkVudHJ5LT5zZWxmTWFjQWRkcik7CisgICAgaWYgKCBlU0lSX1NVQ0NFU1MgIT0gblNpclN0YXR1cyApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gcG9wdWxhdGUgdGhlIGJ1ZmZlciBkZXNjcmlwIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0b3IgZm9yIGFuIEFkZCBUUyBSZXF1ZXN0ICglZCkuIiksCisgICAgICAgICAgICAgICAgblNpclN0YXR1cyApOworICAgICAgICBwYWxQa3RGcmVlKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgICAgICggdm9pZCogKSBwRnJhbWUsICggdm9pZCogKSBwUGFja2V0ICk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBwTWFjSGRyID0gKCB0cFNpck1hY01nbXRIZHIgKSBwRnJhbWU7CisKKyAgICAjaWYgMAorICAgIGNmZ0xlbiA9IFNJUl9NQUNfQUREUl9MRU5HVEg7CisgICAgaWYgKCBlU0lSX1NVQ0NFU1MgIT0gd2xhbl9jZmdHZXRTdHIoIHBNYWMsIFdOSV9DRkdfQlNTSUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIHRBTklfVTgqIClwTWFjSGRyLT5ic3NJZCwgJmNmZ0xlbiApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HUCwgRkwoIkZhaWxlZCB0byByZXRyaWV2ZSBXTklfQ0ZHX0JTU0lEIHdoaWwiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImUgc2VuZGluZyBhbiBBZGQgVFMgUmVxdWVzdC4iKSApOworICAgICAgICBwYWxQa3RGcmVlKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgICAgICggdm9pZCogKSBwRnJhbWUsICggdm9pZCogKSBwUGFja2V0ICk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgI2VuZGlmIC8vVE8gU1VQUE9SVCBCVC1BTVAKKyAgICAKKyAgICBzaXJDb3B5TWFjQWRkcihwTWFjSGRyLT5ic3NJZCxwc2Vzc2lvbkVudHJ5LT5ic3NJZCk7CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisgICAgbGltU2V0UHJvdGVjdGVkQml0KHBNYWMsIHBzZXNzaW9uRW50cnksIHBlZXJNYWNBZGRyLCBwTWFjSGRyKTsKKyNlbmRpZgorCisgICAgLy8gVGhhdCBkb25lLCBwYWNrIHRoZSBzdHJ1Y3Q6CisgICAgaWYgKCAhIHBBZGRUUy0+d21lVHNwZWNQcmVzZW50ICkKKyAgICB7CisgICAgICAgIG5TdGF0dXMgPSBkb3QxMWZQYWNrQWRkVFNSZXF1ZXN0KCBwTWFjLCAmQWRkVFNSZXEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRnJhbWUgKyBzaXplb2YodFNpck1hY01nbXRIZHIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgblBheWxvYWQsICZuUGF5bG9hZCApOworICAgICAgICBpZiAoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBwYWNrIGFuIEFkZCBUUyBSZXF1ZXN0ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIigweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgICAgICBuU3RhdHVzICk7CisgICAgICAgICAgICBwYWxQa3RGcmVlKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsICggdm9pZCogKSBwRnJhbWUsICggdm9pZCogKSBwUGFja2V0ICk7CisgICAgICAgICAgICByZXR1cm47ICAgICAgICAgICAgIC8vIGFsbG9jYXRlZCEKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmICggRE9UMTFGX1dBUk5FRCggblN0YXR1cyApICkKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dXLCBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBwYWNraW5nICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImFuIEFkZCBUUyBSZXF1ZXN0ICgweCUwOHgpLiIpLCBuU3RhdHVzICk7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgblN0YXR1cyA9IGRvdDExZlBhY2tXTU1BZGRUU1JlcXVlc3QoIHBNYWMsICZXTU1BZGRUU1JlcSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBGcmFtZSArIHNpemVvZih0U2lyTWFjTWdtdEhkciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuUGF5bG9hZCwgJm5QYXlsb2FkICk7CisgICAgICAgIGlmICggRE9UMTFGX0ZBSUxFRCggblN0YXR1cyApICkKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIHBhY2sgYSBXTU0gQWRkIFRTIFJlcXVlIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAic3QgKDB4JTA4eCkuIiksCisgICAgICAgICAgICAgICAgICAgIG5TdGF0dXMgKTsKKyAgICAgICAgICAgIHBhbFBrdEZyZWUoIHBNYWMtPmhIZGQsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwgKCB2b2lkKiApIHBGcmFtZSwgKCB2b2lkKiApIHBQYWNrZXQgKTsKKyAgICAgICAgICAgIHJldHVybjsgICAgICAgICAgICAvLyBhbGxvY2F0ZWQhCisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoIERPVDExRl9XQVJORUQoIG5TdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HVywgRkwoIlRoZXJlIHdlcmUgd2FybmluZ3Mgd2hpbGUgcGFja2luZyAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJhIFdNTSBBZGQgVFMgUmVxdWVzdCAoMHglMDh4KS4iKSwgblN0YXR1cyApOworICAgICAgICB9CisgICAgfQorCisgICAgbGltTG9nKCBwTWFjLCBMT0cxLCBGTCgiU2VuZGluZyBhbiBBZGQgVFMgUmVxdWVzdCBmcmFtZSB0byAiKSApOworICAgIGxpbVByaW50TWFjQWRkciggcE1hYywgcGVlck1hY0FkZHIsIExPRzEgKTsKKworICAgIGlmKCAoIFNJUl9CQU5EXzVfR0haID09IGxpbUdldFJGQmFuZChwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwpKQorICAgICAgIHx8ICggcHNlc3Npb25FbnRyeS0+cGVQZXJzb25hID09IFZPU19QMlBfQ0xJRU5UX01PREUgKSB8fAorICAgICAgICAgKCBwc2Vzc2lvbkVudHJ5LT5wZVBlcnNvbmEgPT0gVk9TX1AyUF9HT19NT0RFKQorICAgICAgICAgKQorICAgIHsKKyAgICAgICAgdHhGbGFnIHw9IEhBTF9VU0VfQkRfUkFURTJfRk9SX01BTkFHRU1FTlRfRlJBTUU7CisgICAgfQorCisgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfVFhfTUdNVCwKKyAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgICAgIHBNYWNIZHItPmZjLnN1YlR5cGUpKTsKKyAgICAvLyBRdWV1ZSBBZGR0cyBSZXNwb25zZSBmcmFtZSBpbiBoaWdoIHByaW9yaXR5IFdRCisgICAgaGFsc3RhdHVzID0gaGFsVHhGcmFtZSggcE1hYywgcFBhY2tldCwgKCB0QU5JX1UxNiApIG5CeXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQU5JX1RYRElSX1RPRFMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgNywvL1NNQUNfU1dCRF9UWF9USURfTUdNVF9ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVR4Q29tcGxldGUsIHBGcmFtZSwgdHhGbGFnICk7CisgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfVFhfQ09NUExFVEUsCisgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLAorICAgICAgICAgICBoYWxzdGF0dXMpKTsKKyAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTICggaGFsc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCggIioqKiBDb3VsZCBub3Qgc2VuZCBhbiBBZGQgVFMgUmVxdWVzdCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiAoJVgpICoqKiIgKSwgaGFsc3RhdHVzICk7CisgICAgICAgIC8vUGt0IHdpbGwgYmUgZnJlZWQgdXAgYnkgdGhlIGNhbGxiYWNrCisgICAgfQorCit9IC8vIEVuZCBsaW1TZW5kQWRkdHNSZXFBY3Rpb25GcmFtZS4KKworCisKK3ZvaWQKK2xpbVNlbmRBc3NvY1JzcE1nbXRGcmFtZSh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTE2ICAgICAgIHN0YXR1c0NvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMTYgICAgICAgYWlkLAorICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNBZGRyICAgIHBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggICAgICAgIHN1YlR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgdHBEcGhIYXNoTm9kZSAgcFN0YSx0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KQoreworICAgIHN0YXRpYyB0RG90MTFmQXNzb2NSZXNwb25zZSBmcm07CisgICAgdEFOSV9VOCAgICAgICAgICAgICAqcEZyYW1lLCAqbWFjQWRkcjsKKyAgICB0cFNpck1hY01nbXRIZHIgICAgICBwTWFjSGRyOworICAgIHRTaXJSZXRTdGF0dXMgICAgICAgIG5TaXJTdGF0dXM7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgbGxlTW9kZSA9IDAsIGZBZGRUUywgZWRjYUluY2x1ZGUgPSAwOworICAgIHRIYWxCaXRWYWwgICAgICAgICAgIHFvc01vZGUsIHdtZU1vZGU7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgblBheWxvYWQsIG5TdGF0dXM7CisgICAgdm9pZCAgICAgICAgICAgICAgICAqcFBhY2tldDsKKyAgICBlSGFsU3RhdHVzICAgICAgICAgICBoYWxzdGF0dXM7CisgICAgdFVwZGF0ZUJlYWNvblBhcmFtcyAgYmVhY29uUGFyYW1zOworICAgIHRBTklfVTMyICAgICAgICAgICAgIHR4RmxhZyA9IDA7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgYWRkbklFUHJlc2VudCA9IGZhbHNlOworICAgIHRBTklfVTMyICAgICAgICAgICAgIGFkZG5JRUxlbj0wOworICAgIHRBTklfVTggICAgICAgICAgICAgIGFkZElFW1dOSV9DRkdfQVNTT0NfUlNQX0FERE5JRV9EQVRBX0xFTl07CisgICAgdHBTaXJBc3NvY1JlcSAgICAgICAgcEFzc29jUmVxID0gTlVMTDsgCisgICAgdEFOSV9VMTYgICAgICAgICAgICAgYWRkU3RyaXBvZmZJRUxlbiA9IDA7CisgICAgdERvdDExZklFRXh0Q2FwICAgICAgZXh0cmFjdGVkRXh0Q2FwOworICAgIHRBTklfQk9PTEVBTiAgICAgICAgIGV4dHJhY3RlZEV4dENhcEZsYWcgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgbkJ5dGVzID0gMDsKKworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMVcKKyAgICB0QU5JX1UzMiByZXRyeUludGVydmFsOworICAgIHRBTklfVTMyIG1heFJldHJpZXM7CisjZW5kaWYKK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mZnJtLkV4dFN1cHBSYXRlcywgcHNlc3Npb25FbnRyeSApOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgIFBvcHVsYXRlRG90MTFmQXNzb2NSc3BSYXRlcyggcE1hYywgJmZybS5TdXBwUmF0ZXMsICZmcm0uRXh0U3VwcFJhdGVzLAorICAgICAgICAgICAgICAgICAgICAgIHBTdGEtPnN1cHBvcnRlZFJhdGVzLmxsYlJhdGVzLCBwU3RhLT5zdXBwb3J0ZWRSYXRlcy5sbGFSYXRlcyApOworICAgIH0KKworICAgIGlmKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFKQorICAgIHsKKyAgICAgICAgaWYoIHBTdGEgIT0gTlVMTCAmJiBlU0lSX1NVQ0NFU1MgPT0gc3RhdHVzQ29kZSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBBc3NvY1JlcSA9IAorICAgICAgICAgICAgICAgICh0cFNpckFzc29jUmVxKSBwc2Vzc2lvbkVudHJ5LT5wYXJzZWRBc3NvY1JlcVtwU3RhLT5hc3NvY0lkXTsKKyAgICAgICAgICAgIC8qIHBvcHVsYXRlIFAyUCBJRSBpbiBBc3NvY1JzcCB3aGVuIGFzc29jUmVxIGZyb20gdGhlIHBlZXIgaW5jbHVkZXMgUDJQIElFICovCisgICAgICAgICAgICBpZiggcEFzc29jUmVxICE9IE5VTEwgJiYgcEFzc29jUmVxLT5hZGRJRVByZXNlbnQgKSB7CisgICAgICAgICAgICAgICAgUG9wdWxhdGVEb3QxMUFzc29jUmVzUDJQSUUocE1hYywgJmZybS5QMlBBc3NvY1JlcywgcEFzc29jUmVxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIGlmICggTlVMTCAhPSBwU3RhICkKKyAgICB7CisgICAgICAgIGlmICggZUhBTF9TRVQgPT0gcW9zTW9kZSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmICggcFN0YS0+bGxlRW5hYmxlZCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGxlTW9kZSA9IDE7CisgICAgICAgICAgICAgICAgaWYgKCAoICEgcFN0YS0+YW5pUGVlciApIHx8ICggISBQUk9QX0NBUEFCSUxJVFlfR0VUKCAxMUVRT1MsIHBTdGEtPnByb3BDYXBhYmlsaXR5ICkgKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBQb3B1bGF0ZURvdDExZkVEQ0FQYXJhbVNldCggcE1hYywgJmZybS5FRENBUGFyYW1TZXQsIHBzZXNzaW9uRW50cnkpOworCisvLyAgICAgICAgICAgICAgICAgICAgIEZyYW1lc1RvRG86Li4uCisvLyAgICAgICAgICAgICAgICAgICAgIGlmICggZkFkZFRTICkKKy8vICAgICAgICAgICAgICAgICAgICAgeworLy8gICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEFmID0gcEJvZHk7CisvLyAgICAgICAgICAgICAgICAgICAgICAgICAqcEFmKysgPSBTSVJfTUFDX1FPU19BQ1RJT05fRUlEOworLy8gICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgdGxlbjsKKy8vICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IHNpckFkZHRzUnNwRmlsbChwTWFjLCBwQWYsIHN0YXR1c0NvZGUsICZwU3RhLT5xb3MuYWRkdHMsIE5VTEwsCisvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnRsZW4sIGJ1ZkxlbiAtIGZyYW1lTGVuKTsKKy8vICAgICAgICAgICAgICAgICAgICAgfSAvLyBFbmQgaWYgb24gQWRkIFRTLgorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gLy8gRW5kIGlmIG9uIC4xMWUgZW5hYmxlZCBpbiAncFN0YScuCisgICAgICAgIH0gLy8gRW5kIGlmIG9uIFFPUyBNb2RlIG9uLgorCisgICAgICAgIGlmICggKCAhIGxsZU1vZGUgKSAmJiAoIGVIQUxfU0VUID09IHdtZU1vZGUgKSAmJiBwU3RhLT53bWVFbmFibGVkICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKCAoICEgcFN0YS0+YW5pUGVlciApIHx8ICggISBQUk9QX0NBUEFCSUxJVFlfR0VUKCBXTUUsIHBTdGEtPnByb3BDYXBhYmlsaXR5ICkgKSApCisgICAgICAgICAgICB7CisKKyAgICAgICAgICAgICAgICBQb3B1bGF0ZURvdDExZldNTVBhcmFtcyggcE1hYywgJmZybS5XTU1QYXJhbXMsIHBzZXNzaW9uRW50cnkpOworCisgICAgICAgICAgICAgICAgaWYgKCBwU3RhLT53c21FbmFibGVkICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIFBvcHVsYXRlRG90MTFmV01NQ2FwcygmZnJtLldNTUNhcHMgKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoIHBTdGEtPmFuaVBlZXIgKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoICggbGxlTW9kZSAmJiBQUk9QX0NBUEFCSUxJVFlfR0VUKCAxMUVRT1MsIHBTdGEtPnByb3BDYXBhYmlsaXR5ICkgKSB8fAorICAgICAgICAgICAgICAgICAoIHBTdGEtPndtZUVuYWJsZWQgJiYgUFJPUF9DQVBBQklMSVRZX0dFVCggV01FLCBwU3RhLT5wcm9wQ2FwYWJpbGl0eSApICkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGVkY2FJbmNsdWRlID0gMTsKKyAgICAgICAgICAgIH0KKworICAgICAgICB9IC8vIEVuZCBpZiBvbiBBaXJnbyBwZWVyLgorCisgICAgICAgIGlmICggcFN0YS0+bWxtU3RhQ29udGV4dC5odENhcGFiaWxpdHkgICYmIAorICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmh0Q2FwYWJpbGl0eSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiUG9wdWxhdGUgSFQgSUVzIGluIEFzc29jIFJlc3BvbnNlIikpOworICAgICAgICAgICAgUG9wdWxhdGVEb3QxMWZIVENhcHMoIHBNYWMsIHBzZXNzaW9uRW50cnksICZmcm0uSFRDYXBzICk7CisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICpDaGVjayB0aGUgU1RBIGNhcGFiaWxpdHkgYW5kIHVwZGF0ZSB0aGUgSFRDYXBzIGFjY29yZGluZ2x5CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGZybS5IVENhcHMuc3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0ID0KKyAgICAgICAgICAgIChwU3RhLT5odFN1cHBvcnRlZENoYW5uZWxXaWR0aFNldCA8IHBzZXNzaW9uRW50cnktPmh0U3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0KSA/CisgICAgICAgICAgICBwU3RhLT5odFN1cHBvcnRlZENoYW5uZWxXaWR0aFNldCA6IHBzZXNzaW9uRW50cnktPmh0U3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0IDsKKworICAgICAgICAgICAgaWYgKCFmcm0uSFRDYXBzLnN1cHBvcnRlZENoYW5uZWxXaWR0aFNldCkKKyAgICAgICAgICAgICAgICBmcm0uSFRDYXBzLnNob3J0R0k0ME1IeiA9IDA7CisKKyAgICAgICAgICAgIFBvcHVsYXRlRG90MTFmSFRJbmZvKCBwTWFjLCAmZnJtLkhUSW5mbywgcHNlc3Npb25FbnRyeSApOworICAgICAgICB9CisgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlN1cHBvcnRlZENobmxXaWR0aDogJWQsIG1pbW9QUzogJWQsIEdGOiAlZCwiCisgICAgICAgICAgICAgICAgICAgICAgICAgICJzaG9ydEdJMjA6JWQsIHNob3J0R0k0MDogJWQsIGRzc3NDY2s6ICVkLCBBTVBEVSBQYXJhbTogJXgiKSwKKyAgICAgICAgICAgICAgICAgZnJtLkhUQ2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gICAgICAgICAgICAqIE1vZGUgaW4gNDAgTUh6IGJpdCBpbiBIVCBjYXBhYmxpdHkuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGZybS5IVENhcHMuZHNzc0Nja01vZGU0ME1IeiA9IDE7CisgICAgICAgIH0KKyNlbmRpZgorCisgICAgICAgIFBvcHVsYXRlRG90MTFmRXh0Q2FwKCBwTWFjLCAmZnJtLkV4dENhcCwgcHNlc3Npb25FbnRyeSk7CisjaWZkZWYgV0xBTl9GRUFUVVJFXzExQUMKKyAgICAgICAgaWYoIHBTdGEtPm1sbVN0YUNvbnRleHQudmh0Q2FwYWJpbGl0eSAmJiAKKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnZodENhcGFiaWxpdHkgKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPRzEsIEZMKCJQb3B1bGF0ZSBWSFQgSUVzIGluIEFzc29jIFJlc3BvbnNlIikpOworICAgICAgICAgICAgUG9wdWxhdGVEb3QxMWZWSFRDYXBzKCBwTWFjLCAmZnJtLlZIVENhcHMsCisgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmN1cnJlbnRPcGVyQ2hhbm5lbCwgZVNJUl9UUlVFICk7CisgICAgICAgICAgICBQb3B1bGF0ZURvdDExZlZIVE9wZXJhdGlvbiggcE1hYywgJmZybS5WSFRPcGVyYXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmN1cnJlbnRPcGVyQ2hhbm5lbCk7CisgICAgICAgIH0KKyNlbmRpZgorCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgICAgICBpZiggZVNJUl9NQUNfVFJZX0FHQUlOX0xBVEVSID09IHN0YXR1c0NvZGUgKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoIHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfUE1GX1NBX1FVRVJZX01BWF9SRVRSSUVTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbWF4UmV0cmllcyApICE9IGVTSVJfU1VDQ0VTUyApCisgICAgICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkNvdWxkIG5vdCByZXRyaWV2ZSBQTUYgU0EgUXVlcnkgbWF4aW11bSByZXRyaWVzIHZhbHVlIikgKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBpZiAoIHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfUE1GX1NBX1FVRVJZX1JFVFJZX0lOVEVSVkFMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnJldHJ5SW50ZXJ2YWwgKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiQ291bGQgbm90IHJldHJpZXZlIFBNRiBTQSBRdWVyeSB0aW1lciBpbnRlcnZhbCB2YWx1ZSIpICk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICBQb3B1bGF0ZURvdDExZlRpbWVvdXRJbnRlcnZhbCgKKyAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMsICZmcm0uVGltZW91dEludGVydmFsLCBTSVJfTUFDX1RJX1RZUEVfQVNTT0NfQ09NRUJBQ0ssCisgICAgICAgICAgICAgICAgICAgICAgICAobWF4UmV0cmllcyAtIHBTdGEtPnBtZlNhUXVlcnlSZXRyeUNvdW50KSAqIHJldHJ5SW50ZXJ2YWwgKTsKKyAgICAgICAgfQorI2VuZGlmCisgICAgfSAvLyBFbmQgaWYgb24gbm9uLU5VTEwgJ3BTdGEnLgorCisgICAgdm9zX21lbV9zZXQoKCB0QU5JX1U4KiApJmJlYWNvblBhcmFtcywgc2l6ZW9mKCB0VXBkYXRl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kgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoIlVuYWJsZSB0byBnZXQgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJXTklfQ0ZHX0FTU09DX1JTUF9BREROSUVfRkxBRyIpKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChhZGRuSUVQcmVzZW50KQorICAgICAgICB7CisgICAgICAgICAgICAvL0Fzc29jIHJzcCBJRSBhdmFpbGFibGUKKyAgICAgICAgICAgIGlmICh3bGFuX2NmZ0dldFN0ckxlbihwTWFjLCBXTklfQ0ZHX0FTU09DX1JTUF9BREROSUVfREFUQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICZhZGRuSUVMZW4pICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoIlVuYWJsZSB0byBnZXQgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIldOSV9DRkdfQVNTT0NfUlNQX0FERE5JRV9EQVRBIGxlbmd0aCIpKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChhZGRuSUVMZW4gPD0gV05JX0NGR19BU1NPQ19SU1BfQURETklFX0RBVEFfTEVOICYmIGFkZG5JRUxlbiAmJgorICAgICAgICAgICAgICAgICAgICAobkJ5dGVzICsgYWRkbklFTGVuKSA8PSBTSVJfTUFYX1BBQ0tFVF9TSVpFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICh3bGFuX2NmZ0dldFN0cihwTWFjLCBXTklfQ0ZHX0FTU09DX1JTUF9BREROSUVfREFUQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmYWRkSUVbMF0sICZhZGRuSUVMZW4pID09IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICB7CisKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9zZXQoKCB0QU5JX1U4KiApJmV4dHJhY3RlZEV4dENhcCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiggdERvdDExZklFRXh0Q2FwICksIDApOworICAgICAgICAgICAgICAgICAgICBhZGRTdHJpcG9mZklFTGVuID0gYWRkbklFTGVuOworICAgICAgICAgICAgICAgICAgICBuU2lyU3RhdHVzID0gbGltU3RyaXBPZmZFeHRDYXBJRUFuZFVwZGF0ZVN0cnVjdChwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmYWRkSUVbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZhZGRTdHJpcG9mZklFTGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZXh0cmFjdGVkRXh0Q2FwICk7CisgICAgICAgICAgICAgICAgICAgIGlmKGVTSVJfU1VDQ0VTUyAhPSBuU2lyU3RhdHVzKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiVW5hYmxlIHRvIFN0cmlwb2ZmIEV4dENhcCBJRSBmcm9tIEFzc29jIFJzcCIpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFkZG5JRUxlbiA9IGFkZFN0cmlwb2ZmSUVMZW47CisgICAgICAgICAgICAgICAgICAgICAgICBleHRyYWN0ZWRFeHRDYXBGbGFnID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgbkJ5dGVzID0gbkJ5dGVzICsgYWRkbklFTGVuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qIG1lcmdlIHRoZSBFeHRDYXAgc3RydWN0Ki8KKyAgICBpZiAoZXh0cmFjdGVkRXh0Q2FwRmxhZyAmJiBleHRyYWN0ZWRFeHRDYXAucHJlc2VudCkKKyAgICB7CisgICAgICAgIGxpbU1lcmdlRXh0Q2FwSUVTdHJ1Y3QoJihmcm0uRXh0Q2FwKSwgJmV4dHJhY3RlZEV4dENhcCk7CisgICAgfQorCisgICAgblN0YXR1cyA9IGRvdDExZkdldFBhY2tlZEFzc29jUmVzcG9uc2VTaXplKCBwTWFjLCAmZnJtLCAmblBheWxvYWQgKTsKKyAgICBpZiAoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gY2FsY3VsYXRlIHRoZSBwYWNrZWQgc2l6ZSBmIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvciBhbiBBc3NvY2lhdGlvbiBSZXNwb25zZSAoMHglMDh4KS4iKSwKKyAgICAgICAgICAgICAgICBuU3RhdHVzICk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgZWxzZSBpZiAoIERPVDExRl9XQVJORUQoIG5TdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csIEZMKCJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIGNhbGN1bGF0aW5nICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAidGhlIHBhY2tlZCBzaXplIGZvciBhbiBBc3NvY2lhdGlvbiBSZSIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAic3BvbnNlICgweCUwOHgpLiIpLCBuU3RhdHVzICk7CisgICAgfQorCisgICAgbkJ5dGVzICs9IHNpemVvZiggdFNpck1hY01nbXRIZHIgKSArIG5QYXlsb2FkOworCisgICAgaGFsc3RhdHVzID0gcGFsUGt0QWxsb2MoIHBNYWMtPmhIZGQsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCB0QU5JX1UxNiApbkJ5dGVzLCAoIHZvaWQqKiApICZwRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggdm9pZCoqICkgJnBQYWNrZXQgKTsKKyAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTICggaGFsc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJDYWxsIHRvIGJ1ZkFsbG9jIGZhaWxlZCBmb3IgUkUvQVNTT0MgUlNQLiIpKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIC8vIFBhcmFub2lhOgorICAgIHZvc19tZW1fc2V0KCBwRnJhbWUsIG5CeXRlcywgMCApOworCisgICAgLy8gTmV4dCwgd2UgZmlsbCBvdXQgdGhlIGJ1ZmZlciBkZXNjcmlwdG9yOgorICAgIG5TaXJTdGF0dXMgPSBsaW1Qb3B1bGF0ZU1hY0hlYWRlciggcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX01HTVRfRlJBTUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggTElNX0FTU09DID09IHN1YlR5cGUgKSA/CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX01HTVRfQVNTT0NfUlNQIDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfTUdNVF9SRUFTU09DX1JTUCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVlck1hY0FkZHIscHNlc3Npb25FbnRyeS0+c2VsZk1hY0FkZHIpOworICAgIGlmICggZVNJUl9TVUNDRVNTICE9IG5TaXJTdGF0dXMgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIHBvcHVsYXRlIHRoZSBidWZmZXIgZGVzY3JpcCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAidG9yIGZvciBhbiBBc3NvY2lhdGlvbiBSZXNwb25zZSAoJWQpLiIpLAorICAgICAgICAgICAgICAgIG5TaXJTdGF0dXMgKTsKKyAgICAgICAgcGFsUGt0RnJlZSggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULAorICAgICAgICAgICAgICAgICAgICAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgcE1hY0hkciA9ICggdHBTaXJNYWNNZ210SGRyICkgcEZyYW1lOworCisgICAgc2lyQ29weU1hY0FkZHIocE1hY0hkci0+YnNzSWQscHNlc3Npb25FbnRyeS0+YnNzSWQpOworCisgICAgblN0YXR1cyA9IGRvdDExZlBhY2tBc3NvY1Jlc3BvbnNlKCBwTWFjLCAmZnJtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEZyYW1lICsgc2l6ZW9mKCB0U2lyTWFjTWdtdEhkciApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgblBheWxvYWQsICZuUGF5bG9hZCApOworICAgIGlmICggRE9UMTFGX0ZBSUxFRCggblN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBwYWNrIGFuIEFzc29jaWF0aW9uIFJlc3BvbnNlIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgKDB4JTA4eCkuIiksIG5TdGF0dXMgKTsKKyAgICAgICAgcGFsUGt0RnJlZSggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULAorICAgICAgICAgICAgICAgICAgICAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworICAgICAgICByZXR1cm47ICAgICAgICAgICAgICAgICAvLyBhbGxvY2F0ZWQhCisgICAgfQorICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dXLCBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBwYWNraW5nIGFuICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQXNzb2NpYXRpb24gUmVzcG9uc2UgKDB4JTA4eCkuIiksIG5TdGF0dXMgKTsKKyAgICB9CisKKyAgICBtYWNBZGRyID0gcE1hY0hkci0+ZGE7CisKKyAgICBpZiAoc3ViVHlwZSA9PSBMSU1fQVNTT0MpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgIEZMKCIqKiogU2VuZGluZyBBc3NvYyBSZXNwIHN0YXR1cyAlZCBhaWQgJWQgdG8gIiksCisgICAgICAgICAgICAgICBzdGF0dXNDb2RlLCBhaWQpOworICAgIH0gICAgCisgICAgZWxzZXsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICBGTCgiKioqIFNlbmRpbmcgUmVBc3NvYyBSZXNwIHN0YXR1cyAlZCBhaWQgJWQgdG8gIiksCisgICAgICAgICAgICAgICBzdGF0dXNDb2RlLCBhaWQpOworICAgIH0KKyAgICBsaW1QcmludE1hY0FkZHIocE1hYywgcE1hY0hkci0+ZGEsIExPRzEpOworCisgICAgaWYgKCBhZGRuSUVQcmVzZW50ICkKKyAgICB7CisgICAgICAgIHZvc19tZW1fY29weSAoICBwRnJhbWUrc2l6ZW9mKHRTaXJNYWNNZ210SGRyKStuUGF5bG9hZCwgJmFkZElFWzBdLCBhZGRuSUVMZW4gKSA7CisgICAgfQorCisgICAgaW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lvbiBSZXNwb25zZSBmcmFtZSBpbiBoaWdoIHByaW9yaXR5IFdRCisgICAgICAgIGhhbHN0YXR1cyA9IGhhbFR4RnJhbWVXaXRoVHhDb21wbGV0ZSggcE1hYywgcFBhY2tldCwgKCB0QU5JX1UxNiApIG5CeXRlcywKKyAgICAgICAgICAgICAgICBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgQU5JX1RYRElSX1RPRFMsCisgICAgICAgICAgICAgICAgNywvL1NNQUNfU1dCRF9UWF9USURfTUdNVF9ISUdILAorICAgICAgICAgICAgICAgIGxpbVR4Q29tcGxldGUsIHBGcmFtZSwgbGltVHhCZENvbXBsZXRlLAorICAgICAgICAgICAgICAgIHR4RmxhZywgcE1hYy0+bGltLnR4QmRUb2tlbiApOworICAgICAgICBwTWFjLT5saW0udHhCZFRva2VuKys7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIC8vLyBRdWV1ZSBBc3NvY2lhdGlvbiBSZXNwb25zZSBmcmFtZSBpbiBoaWdoIHByaW9yaXR5IFdRCisgICAgICAgIGhhbHN0YXR1cyA9IGhhbFR4RnJhbWUoIHBNYWMsIHBQYWNrZXQsICggdEFOSV9VMTYgKSBuQnl0ZXMsCisgICAgICAgICAgICAgICAgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULAorICAgICAgICAgICAgICAgIEFOSV9UWERJUl9UT0RTLAorICAgICAgICAgICAgICAgIDcsLy9TTUFDX1NXQkRfVFhfVElEX01HTVRfSElHSCwKKyAgICAgICAgICAgICAgICBsaW1UeENvbXBsZXRlLCBwRnJhbWUsIHR4RmxhZyApOworICAgIH0KKyAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9DT01QTEVURSwKKyAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgICAgIGhhbHN0YXR1cykpOworICAgIGlmICggISBIQUxfU1RBVFVTX1NVQ0NFU1MgKCBoYWxzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgIEZMKCIqKiogQ291bGQgbm90IFNlbmQgUmUvQXNzb2NSc3AsIHJldENvZGU9JVggKioqIiksCisgICAgICAgICAgICAgICBuU2lyU3RhdHVzKTsKKworICAgICAgICAvL1BrdCB3aWxsIGJlIGZyZWVkIHVwIGJ5IHRoZSBjYWxsYmFjaworICAgIH0KKworICAgIC8vIHVwZGF0ZSB0aGUgQU5JIHBlZXIgc3RhdGlvbiBjb3VudAorICAgIC8vRklYTUVfUFJPVEVDVElPTiA6IHRha2UgY2FyZSBvZiBkaWZmZXJlbnQgdHlwZSBvZiBzdGF0aW9uCisgICAgLy8gY291bnRlciBpbnNpZGUgdGhpcyBmdW5jdGlvbi4KKyAgICBsaW1VdGlsQ291bnRTdGFBZGQocE1hYywgcFN0YSwgcHNlc3Npb25FbnRyeSk7CisKK30gLy8gRW5kIGxpbVNlbmRBc3NvY1JzcE1nbXRGcmFtZS4KKworCisgCit2b2lkCitsaW1TZW5kQWRkdHNSc3BBY3Rpb25GcmFtZSh0cEFuaVNpckdsb2JhbCAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNBZGRyICAgICAgICBwZWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMTYgICAgICAgICAgIG5TdGF0dXNDb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpckFkZHRzUmVxSW5mbyAgKnBBZGRUUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNTY2hlZHVsZUlFICpwU2NoZWR1bGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiAgICAgICAgcHNlc3Npb25FbnRyeSkKK3sKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICpwRnJhbWU7CisgICAgdHBTaXJNYWNNZ210SGRyICAgICAgICAgcE1hY0hkcjsKKyAgICB0RG90MTFmQWRkVFNSZXNwb25zZSAgICBBZGRUU1JzcDsKKyAgICB0RG90MTFmV01NQWRkVFNSZXNwb25zZSBXTU1BZGRUU1JzcDsKKyAgICB0U2lyUmV0U3RhdHVzICAgICAgICAgICBuU2lyU3RhdHVzOworICAgIHRBTklfVTMyICAgICAgICAgICAgICAgIGksIG5CeXRlcywgblBheWxvYWQsIG5TdGF0dXM7CisgICAgdm9pZCAgICAgICAgICAgICAgICAgICAqcFBhY2tldDsKKyAgICBlSGFsU3RhdHVzICAgICAgICAgICAgICBoYWxzdGF0dXM7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgdHhGbGFnID0gMDsKKworICAgIGlmKE5VTEwgPT0gcHNlc3Npb25FbnRyeSkKKyAgICB7CisgICAgICAgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBpZiAoICEgcEFkZFRTLT53bWVUc3BlY1ByZXNlbnQgKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9zZXQoICggdEFOSV9VOCogKSZBZGRUU1JzcCwgc2l6ZW9mKCBBZGRUU1JzcCApLCAwICk7CisKKyAgICAgICAgQWRkVFNSc3AuQ2F0ZWdvcnkuY2F0ZWdvcnkgPSBTSVJfTUFDX0FDVElPTl9RT1NfTUdNVDsKKyAgICAgICAgQWRkVFNSc3AuQWN0aW9uLmFjdGlvbiAgICAgPSBTSVJfTUFDX1FPU19BRERfVFNfUlNQOworICAgICAgICBBZGRUU1JzcC5EaWFsb2dUb2tlbi50b2tlbiA9IHBBZGRUUy0+ZGlhbG9nVG9rZW47CisgICAgICAgIEFkZFRTUnNwLlN0YXR1cy5zdGF0dXMgICAgID0gblN0YXR1c0NvZGU7CisKKyAgICAgICAgLy8gVGhlIFRzRGVsYXkgaW5mb3JtYXRpb24gZWxlbWVudCBpcyBvbmx5IGZpbGxlZCBpbiBmb3IgYSBzcGVjaWZpYworICAgICAgICAvLyBzdGF0dXMgY29kZToKKyAgICAgICAgaWYgKCBlU0lSX01BQ19UU19OT1RfQ1JFQVRFRF9TVEFUVVMgPT0gblN0YXR1c0NvZGUgKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoIHBBZGRUUy0+d3NtVHNwZWNQcmVzZW50ICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBBZGRUU1JzcC5XTU1UU0RlbGF5LnZlcnNpb24gPSAxOworICAgICAgICAgICAgICAgIEFkZFRTUnNwLldNTVRTRGVsYXkuZGVsYXkgICA9IDEwOworICAgICAgICAgICAgICAgIEFkZFRTUnNwLldNTVRTRGVsYXkucHJlc2VudCA9IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgQWRkVFNSc3AuVFNEZWxheS5kZWxheSAgID0gMTA7CisgICAgICAgICAgICAgICAgQWRkVFNSc3AuVFNEZWxheS5wcmVzZW50ID0gMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmICggcEFkZFRTLT53c21Uc3BlY1ByZXNlbnQgKQorICAgICAgICB7CisgICAgICAgICAgICBQb3B1bGF0ZURvdDExZldNTVRTUEVDKCAmcEFkZFRTLT50c3BlYywgJkFkZFRTUnNwLldNTVRTUEVDICk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBQb3B1bGF0ZURvdDExZlRTUEVDKCAmcEFkZFRTLT50c3BlYywgJkFkZFRTUnNwLlRTUEVDICk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIHBBZGRUUy0+d3NtVHNwZWNQcmVzZW50ICkKKyAgICAgICAgeworICAgICAgICAgICAgQWRkVFNSc3AubnVtX1dNTVRDTEFTID0gMDsKKyAgICAgICAgICAgIEFkZFRTUnNwLm51bV9UQ0xBUyA9IHBBZGRUUy0+bnVtVGNsYXM7CisgICAgICAgICAgICBmb3IgKCBpID0gMDsgaSA8IEFkZFRTUnNwLm51bV9UQ0xBUzsgKytpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFBvcHVsYXRlRG90MTFmVENMQVMoIHBNYWMsICZwQWRkVFMtPnRjbGFzSW5mb1tpXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmQWRkVFNSc3AuVENMQVNbaV0gKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIEFkZFRTUnNwLm51bV9UQ0xBUyA9IDA7CisgICAgICAgICAgICBBZGRUU1JzcC5udW1fV01NVENMQVMgPSBwQWRkVFMtPm51bVRjbGFzOworICAgICAgICAgICAgZm9yICggaSA9IDA7IGkgPCBBZGRUU1JzcC5udW1fV01NVENMQVM7ICsraSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQb3B1bGF0ZURvdDExZldNTVRDTEFTKCBwTWFjLCAmcEFkZFRTLT50Y2xhc0luZm9baV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJkFkZFRTUnNwLldNTVRDTEFTW2ldICk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoIHBBZGRUUy0+dGNsYXNQcm9jUHJlc2VudCApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmICggcEFkZFRTLT53c21Uc3BlY1ByZXNlbnQgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEFkZFRTUnNwLldNTVRDTEFTUFJPQy52ZXJzaW9uICAgID0gMTsKKyAgICAgICAgICAgICAgICBBZGRUU1JzcC5XTU1UQ0xBU1BST0MucHJvY2Vzc2luZyA9IHBBZGRUUy0+dGNsYXNQcm9jOworICAgICAgICAgICAgICAgIEFkZFRTUnNwLldNTVRDTEFTUFJPQy5wcmVzZW50ICAgID0gMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgIC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gICAgICAgUG9wdWxhdGVEb3QxMWZXTU1TY2hlZHVsZSggcFNjaGVkdWxlLCAmQWRkVFNSc3AuV01NU2NoZWR1bGUgKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQb3B1bGF0ZURvdDExZlNjaGVkdWxlKCBwU2NoZWR1bGUsICZBZGRUU1JzcC5TY2hlZHVsZSApOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgblN0YXR1cyA9IGRvdDExZkdldFBhY2tlZEFkZFRTUmVzcG9uc2VTaXplKCBwTWFjLCAmQWRkVFNSc3AsICZuUGF5bG9hZCApOworICAgICAgICBpZiAoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HUCwgRkwoIkZhaWxlZCB0byBjYWxjdWxhdGUgdGhlIHBhY2tlZCBzaSIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInplIGZvciBhbiBBZGQgVFMgUmVzcG9uc2UgKDB4JTA4eCkuIiksCisgICAgICAgICAgICAgICAgICAgIG5TdGF0dXMgKTsKKyAgICAgICAgICAgIC8vIFdlJ2xsIGZhbGwgYmFjayBvbiB0aGUgd29yc3QgY2FzZSBzY2VuYXJpbzoKKyAgICAgICAgICAgIG5QYXlsb2FkID0gc2l6ZW9mKCB0RG90MTFmQWRkVFNSZXNwb25zZSApOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csIEZMKCJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIGNhbGN1bGEiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0aW5nIHRoZSBwYWNrZWQgc2l6ZSBmb3IgYW4gQWRkIFRTIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIFJlc3BvbnNlICgweCUwOHgpLiIpLCBuU3RhdHVzICk7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgdm9zX21lbV9zZXQoICggdEFOSV9VOCogKSZXTU1BZGRUU1JzcCwgc2l6ZW9mKCBXTU1BZGRUU1JzcCApLCAwICk7CisKKyAgICAgICAgV01NQWRkVFNSc3AuQ2F0ZWdvcnkuY2F0ZWdvcnkgPSBTSVJfTUFDX0FDVElPTl9XTUU7CisgICAgICAgIFdNTUFkZFRTUnNwLkFjdGlvbi5hY3Rpb24gICAgID0gU0lSX01BQ19RT1NfQUREX1RTX1JTUDsKKyAgICAgICAgV01NQWRkVFNSc3AuRGlhbG9nVG9rZW4udG9rZW4gPSBwQWRkVFMtPmRpYWxvZ1Rva2VuOworICAgICAgICBXTU1BZGRUU1JzcC5TdGF0dXNDb2RlLnN0YXR1c0NvZGUgPSAodEFOSV9VOCluU3RhdHVzQ29kZTsKKworICAgICAgICBQb3B1bGF0ZURvdDExZldNTVRTUEVDKCAmcEFkZFRTLT50c3BlYywgJldNTUFkZFRTUnNwLldNTVRTUEVDICk7CisKKyAgICAgICAgblN0YXR1cyA9IGRvdDExZkdldFBhY2tlZFdNTUFkZFRTUmVzcG9uc2VTaXplKCBwTWFjLCAmV01NQWRkVFNSc3AsICZuUGF5bG9hZCApOworICAgICAgICBpZiAoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HUCwgRkwoIkZhaWxlZCB0byBjYWxjdWxhdGUgdGhlIHBhY2tlZCBzaSIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInplIGZvciBhIFdNTSBBZGQgVFMgUmVzcG9uc2UgKDB4JTA4eCkuIiksCisgICAgICAgICAgICAgICAgICAgIG5TdGF0dXMgKTsKKyAgICAgICAgICAgIC8vIFdlJ2xsIGZhbGwgYmFjayBvbiB0aGUgd29yc3QgY2FzZSBzY2VuYXJpbzoKKyAgICAgICAgICAgIG5QYXlsb2FkID0gc2l6ZW9mKCB0RG90MTFmV01NQWRkVFNSZXNwb25zZSApOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csIEZMKCJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIGNhbGN1bGEiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0aW5nIHRoZSBwYWNrZWQgc2l6ZSBmb3IgYSBXTU0gQWRkIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVFMgUmVzcG9uc2UgKDB4JTA4eCkuIiksIG5TdGF0dXMgKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIG5CeXRlcyA9IG5QYXlsb2FkICsgc2l6ZW9mKCB0U2lyTWFjTWdtdEhkciApOworCisgICAgaGFsc3RhdHVzID0gcGFsUGt0QWxsb2MoIHBNYWMtPmhIZGQsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwgKCB0QU5JX1UxNiApbkJ5dGVzLCAoIHZvaWQqKiApICZwRnJhbWUsICggdm9pZCoqICkgJnBQYWNrZXQgKTsKKyAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTICggaGFsc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dQLCBGTCgiRmFpbGVkIHRvIGFsbG9jYXRlICVkIGJ5dGVzIGZvciBhbiBBZCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZCBUUyBSZXNwb25zZS4iKSwgbkJ5dGVzICk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICAvLyBQYXJhbm9pYToKKyAgICB2b3NfbWVtX3NldCggIHBGcmFtZSwgbkJ5dGVzLCAwICk7CisKKyAgICAvLyBOZXh0LCB3ZSBmaWxsIG91dCB0aGUgYnVmZmVyIGRlc2NyaXB0b3I6CisgICAgblNpclN0YXR1cyA9IGxpbVBvcHVsYXRlTWFjSGVhZGVyKCBwTWFjLCBwRnJhbWUsIFNJUl9NQUNfTUdNVF9GUkFNRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX01BQ19NR01UX0FDVElPTiwgcGVlcixwc2Vzc2lvbkVudHJ5LT5zZWxmTWFjQWRkcik7CisgICAgaWYgKCBlU0lSX1NVQ0NFU1MgIT0gblNpclN0YXR1cyApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gcG9wdWxhdGUgdGhlIGJ1ZmZlciBkZXNjcmlwIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0b3IgZm9yIGFuIEFkZCBUUyBSZXNwb25zZSAoJWQpLiIpLAorICAgICAgICAgICAgICAgIG5TaXJTdGF0dXMgKTsKKyAgICAgICAgcGFsUGt0RnJlZSggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworICAgICAgICByZXR1cm47ICAgICAgICAgICAgICAgICAvLyBhbGxvY2F0ZWQhCisgICAgfQorCisgICAgcE1hY0hkciA9ICggdHBTaXJNYWNNZ210SGRyICkgcEZyYW1lOworCisgICAgIAorICAgICNpZiAwCisgICAgaWYgKCBlU0lSX1NVQ0NFU1MgIT0gd2xhbl9jZmdHZXRTdHIoIHBNYWMsIFdOSV9DRkdfQlNTSUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIHRBTklfVTgqIClwTWFjSGRyLT5ic3NJZCwgJmNmZ0xlbiApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HUCwgRkwoIkZhaWxlZCB0byByZXRyaWV2ZSBXTklfQ0ZHX0JTU0lEIHdoaWwiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImUgc2VuZGluZyBhbiBBZGQgVFMgUmVzcG9uc2UuIikgKTsKKyAgICAgICAgcGFsUGt0RnJlZSggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworICAgICAgICByZXR1cm47ICAgICAgICAgICAgICAgICAvLyBhbGxvY2F0ZWQhCisgICAgfQorICAgICNlbmRpZiAvL1RPIFNVUFBPUlQgQlQtQU1QCisgICAgc2lyQ29weU1hY0FkZHIocE1hY0hkci0+YnNzSWQscHNlc3Npb25FbnRyeS0+YnNzSWQpOworCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgIGxpbVNldFByb3RlY3RlZEJpdChwTWFjLCBwc2Vzc2lvbkVudHJ5LCBwZWVyLCBwTWFjSGRyKTsKKyNlbmRpZgorCisgICAgLy8gVGhhdCBkb25lLCBwYWNrIHRoZSBzdHJ1Y3Q6CisgICAgaWYgKCAhIHBBZGRUUy0+d21lVHNwZWNQcmVzZW50ICkKKyAgICB7CisgICAgICAgIG5TdGF0dXMgPSBkb3QxMWZQYWNrQWRkVFNSZXNwb25zZSggcE1hYywgJkFkZFRTUnNwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBGcmFtZSArIHNpemVvZiggdFNpck1hY01nbXRIZHIgKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuUGF5bG9hZCwgJm5QYXlsb2FkICk7CisgICAgICAgIGlmICggRE9UMTFGX0ZBSUxFRCggblN0YXR1cyApICkKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIHBhY2sgYW4gQWRkIFRTIFJlc3BvbnNlICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIigweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgICAgICBuU3RhdHVzICk7CisgICAgICAgICAgICBwYWxQa3RGcmVlKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsICggdm9pZCogKSBwRnJhbWUsICggdm9pZCogKSBwUGFja2V0ICk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoIERPVDExRl9XQVJORUQoIG5TdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HVywgRkwoIlRoZXJlIHdlcmUgd2FybmluZ3Mgd2hpbGUgcGFja2luZyAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJhbiBBZGQgVFMgUmVzcG9uc2UgKDB4JTA4eCkuIiksIG5TdGF0dXMgKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBuU3RhdHVzID0gZG90MTFmUGFja1dNTUFkZFRTUmVzcG9uc2UoIHBNYWMsICZXTU1BZGRUU1JzcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRnJhbWUgKyBzaXplb2YoIHRTaXJNYWNNZ210SGRyICksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgblBheWxvYWQsICZuUGF5bG9hZCApOworICAgICAgICBpZiAoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBwYWNrIGEgV01NIEFkZCBUUyBSZXNwb25zZSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIoMHglMDh4KS4iKSwKKyAgICAgICAgICAgICAgICAgICAgblN0YXR1cyApOworICAgICAgICAgICAgcGFsUGt0RnJlZSggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csIEZMKCJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIHBhY2tpbmcgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiYSBXTU0gQWRkIFRTIFJlc3BvbnNlICgweCUwOHgpLiIpLCBuU3RhdHVzICk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBsaW1Mb2coIHBNYWMsIExPRzEsIEZMKCJTZW5kaW5nIGFuIEFkZCBUUyBSZXNwb25zZSAoc3RhdHVzICVkKSB0byAiKSwKKyAgICAgICAgICAgIG5TdGF0dXNDb2RlICk7CisgICAgbGltUHJpbnRNYWNBZGRyKCBwTWFjLCBwTWFjSGRyLT5kYSwgTE9HMSApOworCisgICAgaWYoICggU0lSX0JBTkRfNV9HSFogPT0gbGltR2V0UkZCYW5kKHBzZXNzaW9uRW50cnktPmN1cnJlbnRPcGVyQ2hhbm5lbCkpCisgICAgICAgfHwgKCBwc2Vzc2lvbkVudHJ5LT5wZVBlcnNvbmEgPT0gVk9TX1AyUF9DTElFTlRfTU9ERSApIHx8CisgICAgICAgICAoIHBzZXNzaW9uRW50cnktPnBlUGVyc29uYSA9PSBWT1NfUDJQX0dPX01PREUpCisgICAgICAgICApCisgICAgeworICAgICAgICB0eEZsYWcgfD0gSEFMX1VTRV9CRF9SQVRFMl9GT1JfTUFOQUdFTUVOVF9GUkFNRTsKKyAgICB9CisKKyAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9NR01ULAorICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwKKyAgICAgICAgICAgcE1hY0hkci0+ZmMuc3ViVHlwZSkpOworICAgIC8vIFF1ZXVlIHRoZSBmcmFtZSBpbiBoaWdoIHByaW9yaXR5IFdROgorICAgIGhhbHN0YXR1cyA9IGhhbFR4RnJhbWUoIHBNYWMsIHBQYWNrZXQsICggdEFOSV9VMTYgKSBuQnl0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFOSV9UWERJUl9UT0RTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDcsLy9TTUFDX1NXQkRfVFhfVElEX01HTVRfSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1UeENvbXBsZXRlLCBwRnJhbWUsIHR4RmxhZyApOworICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RYX0NPTVBMRVRFLAorICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwKKyAgICAgICAgICAgaGFsc3RhdHVzKSk7CisgICAgaWYgKCAhIEhBTF9TVEFUVVNfU1VDQ0VTUyAoIGhhbHN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBzZW5kIEFkZCBUUyBSZXNwb25zZSAoJVgpISIpLAorICAgICAgICAgICAgICAgIG5TaXJTdGF0dXMgKTsKKyAgICAgICAgLy9Qa3Qgd2lsbCBiZSBmcmVlZCB1cCBieSB0aGUgY2FsbGJhY2sKKyAgICB9CisKK30gLy8gRW5kIGxpbVNlbmRBZGR0c1JzcEFjdGlvbkZyYW1lLgorCit2b2lkCitsaW1TZW5kRGVsdHNSZXFBY3Rpb25GcmFtZSh0cEFuaVNpckdsb2JhbCAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNBZGRyICBwZWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAgd21tVHNwZWNQcmVzZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY1RTSW5mbyAgKnBUc2luZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjVHNwZWNJRSAgKnBUc3BlY0llLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSkKK3sKKyAgICB0QU5JX1U4ICAgICAgICAgKnBGcmFtZTsKKyAgICB0cFNpck1hY01nbXRIZHIgIHBNYWNIZHI7CisgICAgdERvdDExZkRlbFRTICAgICBEZWxUUzsKKyAgICB0RG90MTFmV01NRGVsVFMgIFdNTURlbFRTOworICAgIHRTaXJSZXRTdGF0dXMgICAgblNpclN0YXR1czsKKyAgICB0QU5JX1UzMiAgICAgICAgIG5CeXRlcywgblBheWxvYWQsIG5TdGF0dXM7CisgICAgdm9pZCAgICAgICAgICAgICpwUGFja2V0OworICAgIGVIYWxTdGF0dXMgICAgICAgaGFsc3RhdHVzOworICAgIHRBTklfVTMyICAgICAgICAgdHhGbGFnID0gMDsKKworICAgIGlmKE5VTEwgPT0gcHNlc3Npb25FbnRyeSkKKyAgICB7CisgICAgICAgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBpZiAoICEgd21tVHNwZWNQcmVzZW50ICkKKyAgICB7CisgICAgICAgIHZvc19tZW1fc2V0KCAoIHRBTklfVTgqICkmRGVsVFMsIHNpemVvZiggRGVsVFMgKSwgMCApOworCisgICAgICAgIERlbFRTLkNhdGVnb3J5LmNhdGVnb3J5ID0gU0lSX01BQ19BQ1RJT05fUU9TX01HTVQ7CisgICAgICAgIERlbFRTLkFjdGlvbi5hY3Rpb24gICAgID0gU0lSX01BQ19RT1NfREVMX1RTX1JFUTsKKyAgICAgICAgUG9wdWxhdGVEb3QxMWZUU0luZm8oIHBUc2luZm8sICZEZWxUUy5UU0luZm8gKTsKKworICAgICAgICBuU3RhdHVzID0gZG90MTFmR2V0UGFja2VkRGVsVFNTaXplKCBwTWFjLCAmRGVsVFMsICZuUGF5bG9hZCApOworICAgICAgICBpZiAoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HUCwgRkwoIkZhaWxlZCB0byBjYWxjdWxhdGUgdGhlIHBhY2tlZCBzaSIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInplIGZvciBhIERlbCBUUyAoMHglMDh4KS4iKSwKKyAgICAgICAgICAgICAgICAgICAgblN0YXR1cyApOworICAgICAgICAgICAgLy8gV2UnbGwgZmFsbCBiYWNrIG9uIHRoZSB3b3JzdCBjYXNlIHNjZW5hcmlvOgorICAgICAgICAgICAgblBheWxvYWQgPSBzaXplb2YoIHREb3QxMWZEZWxUUyApOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csIEZMKCJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIGNhbGN1bGEiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0aW5nIHRoZSBwYWNrZWQgc2l6ZSBmb3IgYSBEZWwgVFMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgKDB4JTA4eCkuIiksIG5TdGF0dXMgKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICB2b3NfbWVtX3NldCggKCB0QU5JX1U4KiApJldNTURlbFRTLCBzaXplb2YoIFdNTURlbFRTICksIDAgKTsKKworICAgICAgICBXTU1EZWxUUy5DYXRlZ29yeS5jYXRlZ29yeSA9IFNJUl9NQUNfQUNUSU9OX1dNRTsKKyAgICAgICAgV01NRGVsVFMuQWN0aW9uLmFjdGlvbiAgICAgPSBTSVJfTUFDX1FPU19ERUxfVFNfUkVROworICAgICAgICBXTU1EZWxUUy5EaWFsb2dUb2tlbi50b2tlbiA9IDA7CisgICAgICAgIFdNTURlbFRTLlN0YXR1c0NvZGUuc3RhdHVzQ29kZSA9IDA7CisgICAgICAgIFBvcHVsYXRlRG90MTFmV01NVFNQRUMoIHBUc3BlY0llLCAmV01NRGVsVFMuV01NVFNQRUMgKTsKKyAgICAgICAgblN0YXR1cyA9IGRvdDExZkdldFBhY2tlZFdNTURlbFRTU2l6ZSggcE1hYywgJldNTURlbFRTLCAmblBheWxvYWQgKTsKKyAgICAgICAgaWYgKCBET1QxMUZfRkFJTEVEKCBuU3RhdHVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1AsIEZMKCJGYWlsZWQgdG8gY2FsY3VsYXRlIHRoZSBwYWNrZWQgc2kiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ6ZSBmb3IgYSBXTU0gRGVsIFRTICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgICAgICBuU3RhdHVzICk7CisgICAgICAgICAgICAvLyBXZSdsbCBmYWxsIGJhY2sgb24gdGhlIHdvcnN0IGNhc2Ugc2NlbmFyaW86CisgICAgICAgICAgICBuUGF5bG9hZCA9IHNpemVvZiggdERvdDExZkRlbFRTICk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoIERPVDExRl9XQVJORUQoIG5TdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HVywgRkwoIlRoZXJlIHdlcmUgd2FybmluZ3Mgd2hpbGUgY2FsY3VsYSIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInRpbmcgdGhlIHBhY2tlZCBzaXplIGZvciBhIFdNTSBEZSIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImwgVFMgKDB4JTA4eCkuIiksIG5TdGF0dXMgKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIG5CeXRlcyA9IG5QYXlsb2FkICsgc2l6ZW9mKCB0U2lyTWFjTWdtdEhkciApOworCisgICAgaGFsc3RhdHVzID0gcGFsUGt0QWxsb2MoIHBNYWMtPmhIZGQsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwgKCB0QU5JX1UxNiApbkJ5dGVzLCAoIHZvaWQqKiApICZwRnJhbWUsICggdm9pZCoqICkgJnBQYWNrZXQgKTsKKyAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTICggaGFsc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dQLCBGTCgiRmFpbGVkIHRvIGFsbG9jYXRlICVkIGJ5dGVzIGZvciBhbiBBZCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZCBUUyBSZXNwb25zZS4iKSwgbkJ5dGVzICk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICAvLyBQYXJhbm9pYToKKyAgICB2b3NfbWVtX3NldCggcEZyYW1lLCBuQnl0ZXMsIDAgKTsKKworICAgIC8vIE5leHQsIHdlIGZpbGwgb3V0IHRoZSBidWZmZXIgZGVzY3JpcHRvcjoKKyAgICBuU2lyU3RhdHVzID0gbGltUG9wdWxhdGVNYWNIZWFkZXIoIHBNYWMsIHBGcmFtZSwgU0lSX01BQ19NR01UX0ZSQU1FLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX01HTVRfQUNUSU9OLCBwZWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5zZWxmTWFjQWRkcik7CisgICAgaWYgKCBlU0lSX1NVQ0NFU1MgIT0gblNpclN0YXR1cyApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gcG9wdWxhdGUgdGhlIGJ1ZmZlciBkZXNjcmlwIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0b3IgZm9yIGFuIEFkZCBUUyBSZXNwb25zZSAoJWQpLiIpLAorICAgICAgICAgICAgICAgIG5TaXJTdGF0dXMgKTsKKyAgICAgICAgcGFsUGt0RnJlZSggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworICAgICAgICByZXR1cm47ICAgICAgICAgICAgICAgICAvLyBhbGxvY2F0ZWQhCisgICAgfQorCisgICAgcE1hY0hkciA9ICggdHBTaXJNYWNNZ210SGRyICkgcEZyYW1lOworCisgICAgI2lmIDAKKworICAgIGNmZ0xlbiA9IFNJUl9NQUNfQUREUl9MRU5HVEg7CisgICAgaWYgKCBlU0lSX1NVQ0NFU1MgIT0gd2xhbl9jZmdHZXRTdHIoIHBNYWMsIFdOSV9DRkdfQlNTSUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIHRBTklfVTgqIClwTWFjSGRyLT5ic3NJZCwgJmNmZ0xlbiApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HUCwgRkwoIkZhaWxlZCB0byByZXRyaWV2ZSBXTklfQ0ZHX0JTU0lEIHdoaWwiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImUgc2VuZGluZyBhbiBBZGQgVFMgUmVzcG9uc2UuIikgKTsKKyAgICAgICAgcGFsUGt0RnJlZSggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworICAgICAgICByZXR1cm47ICAgICAgICAgICAgICAgICAvLyBhbGxvY2F0ZWQhCisgICAgfQorICAgICNlbmRpZiAvL1RPIFNVUFBPUlQgQlQtQU1QCisgICAgc2lyQ29weU1hY0FkZHIocE1hY0hkci0+YnNzSWQsIHBzZXNzaW9uRW50cnktPmJzc0lkKTsKKyAgICAKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisgICAgbGltU2V0UHJvdGVjdGVkQml0KHBNYWMsIHBzZXNzaW9uRW50cnksIHBlZXIsIHBNYWNIZHIpOworI2VuZGlmCisKKyAgICAvLyBUaGF0IGRvbmUsIHBhY2sgdGhlIHN0cnVjdDoKKyAgICBpZiAoICF3bW1Uc3BlY1ByZXNlbnQgKQorICAgIHsKKyAgICAgICAgblN0YXR1cyA9IGRvdDExZlBhY2tEZWxUUyggcE1hYywgJkRlbFRTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRnJhbWUgKyBzaXplb2YoIHRTaXJNYWNNZ210SGRyICksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5QYXlsb2FkLCAmblBheWxvYWQgKTsKKyAgICAgICAgaWYgKCBET1QxMUZfRkFJTEVEKCBuU3RhdHVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gcGFjayBhIERlbCBUUyBmcmFtZSAoMHglMDh4KS4iKSwKKyAgICAgICAgICAgICAgICAgICAgblN0YXR1cyApOworICAgICAgICAgICAgcGFsUGt0RnJlZSggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworICAgICAgICAgICAgcmV0dXJuOyAgICAgICAgICAgICAvLyBhbGxvY2F0ZWQhCisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoIERPVDExRl9XQVJORUQoIG5TdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HVywgRkwoIlRoZXJlIHdlcmUgd2FybmluZ3Mgd2hpbGUgcGFja2luZyAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJhIERlbCBUUyBmcmFtZSAoMHglMDh4KS4iKSwgblN0YXR1cyApOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIG5TdGF0dXMgPSBkb3QxMWZQYWNrV01NRGVsVFMoIHBNYWMsICZXTU1EZWxUUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEZyYW1lICsgc2l6ZW9mKCB0U2lyTWFjTWdtdEhkciApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuUGF5bG9hZCwgJm5QYXlsb2FkICk7CisgICAgICAgIGlmICggRE9UMTFGX0ZBSUxFRCggblN0YXR1cyApICkKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIHBhY2sgYSBXTU0gRGVsIFRTIGZyYW1lICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgICAgICBuU3RhdHVzICk7CisgICAgICAgICAgICBwYWxQa3RGcmVlKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsICggdm9pZCogKSBwRnJhbWUsICggdm9pZCogKSBwUGFja2V0ICk7CisgICAgICAgICAgICByZXR1cm47ICAgICAgICAgICAgIC8vIGFsbG9jYXRlZCEKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmICggRE9UMTFGX1dBUk5FRCggblN0YXR1cyApICkKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dXLCBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBwYWNraW5nICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImEgV01NIERlbCBUUyBmcmFtZSAoMHglMDh4KS4iKSwgblN0YXR1cyApOworICAgICAgICB9CisgICAgfQorCisgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJTZW5kaW5nIERFTFRTIFJFUSAoc2l6ZSAlZCkgdG8gIiksIG5CeXRlcyk7CisgICAgbGltUHJpbnRNYWNBZGRyKHBNYWMsIHBNYWNIZHItPmRhLCBMT0cxKTsKKworICAgIGlmKCAoIFNJUl9CQU5EXzVfR0haID09IGxpbUdldFJGQmFuZChwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwpKQorICAgICAgIHx8ICggcHNlc3Npb25FbnRyeS0+cGVQZXJzb25hID09IFZPU19QMlBfQ0xJRU5UX01PREUgKSB8fAorICAgICAgICAgKCBwc2Vzc2lvbkVudHJ5LT5wZVBlcnNvbmEgPT0gVk9TX1AyUF9HT19NT0RFKQorICAgICAgICAgKQorICAgIHsKKyAgICAgICAgdHhGbGFnIHw9IEhBTF9VU0VfQkRfUkFURTJfRk9SX01BTkFHRU1FTlRfRlJBTUU7CisgICAgfQorCisgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfVFhfTUdNVCwKKyAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgICAgIHBNYWNIZHItPmZjLnN1YlR5cGUpKTsKKyAgICBoYWxzdGF0dXMgPSBoYWxUeEZyYW1lKCBwTWFjLCBwUGFja2V0LCAoIHRBTklfVTE2ICkgbkJ5dGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTklfVFhESVJfVE9EUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA3LC8vU01BQ19TV0JEX1RYX1RJRF9NR01UX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltVHhDb21wbGV0ZSwgcEZyYW1lLCB0eEZsYWcgKTsKKyAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9DT01QTEVURSwKKyAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgICAgIGhhbHN0YXR1cykpOworICAgIGlmICggISBIQUxfU1RBVFVTX1NVQ0NFU1MgKCBoYWxzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gc2VuZCBEZWwgVFMgKCVYKSEiKSwKKyAgICAgICAgICAgICAgICBuU2lyU3RhdHVzICk7CisgICAgICAgIC8vUGt0IHdpbGwgYmUgZnJlZWQgdXAgYnkgdGhlIGNhbGxiYWNrCisgICAgfQorCit9IC8vIEVuZCBsaW1TZW5kRGVsdHNSZXFBY3Rpb25GcmFtZS4KKwordm9pZAorbGltU2VuZEFzc29jUmVxTWdtdEZyYW1lKHRwQW5pU2lyR2xvYmFsICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICB0TGltTWxtQXNzb2NSZXEgKnBNbG1Bc3NvY1JlcSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KQoreworICAgIHREb3QxMWZBc3NvY1JlcXVlc3QgKnBGcm07CisgICAgdEFOSV9VMTYgICAgICAgICAgICBjYXBzOworICAgIHRBTklfVTggICAgICAgICAgICAqcEZyYW1lOworICAgIHRTaXJSZXRTdGF0dXMgICAgICAgblNpclN0YXR1cyA9IGVTSVJfRkFJTFVSRTsKKyAgICB0TGltTWxtQXNzb2NDbmYgICAgIG1sbUFzc29jQ25mOworICAgIHRBTklfVTMyICAgICAgICAgICAgblBheWxvYWQsIG5TdGF0dXM7CisgICAgdEFOSV9VOCAgICAgICAgICAgICBmUW9zRW5hYmxlZCwgZldtZUVuYWJsZWQsIGZXc21FbmFibGVkOworICAgIHZvaWQgICAgICAgICAgICAgICAqcFBhY2tldDsKKyAgICBlSGFsU3RhdHVzICAgICAgICAgIGhhbHN0YXR1czsKKyAgICB0QU5JX1UxNiAgICAgICA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c3NvYy5hZGRJRWRhdGE7CisKKyAgICBwRnJtID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHREb3QxMWZBc3NvY1JlcXVlc3QpKTsKKyAgICBpZiAoIE5VTEwgPT0gcEZybSApCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlVuYWJsZSB0byBhbGxvY2F0ZSBtZW1vcnkiKSApOworICAgICAgICByZXR1cm47CisgICAgfQorCisKKyAgICB2b3NfbWVtX3NldCggKCB0QU5JX1U4KiApcEZybSwgc2l6ZW9mKCB0RG90MTFmQXNzb2NSZXF1ZXN0ICksIDAgKTsKKworICAgIHZvc19tZW1fc2V0KCggdEFOSV9VOCogKSZleHRyYWN0ZWRFeHRDYXAsIHNpemVvZiggdERvdDExZklFRXh0Q2FwICksIDApOworICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5pc19leHRfY2Fwc19wcmVzZW50KQorICAgIHsKKyAgICAgICAgblNpclN0YXR1cyA9IGxpbVN0cmlwT2ZmRXh0Q2FwSUVBbmRVcGRhdGVTdHJ1Y3QocE1hYywgcEFkZElFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZuQWRkSUVMZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmV4dHJhY3RlZEV4dENhcCApOworICAgIH0KKyAgICBpZihlU0lSX1NVQ0NFU1MgIT0gblNpclN0YXR1cyApCisgICAgeworICAgICAgICBleHRyYWN0ZWRFeHRDYXBGbGFnID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgICBGTCgiVW5hYmxlIHRvIFN0cmlwb2ZmIEV4dENhcCBJRSBmcm9tIEFzc29jIFJlcSIpKTsKKyAgICB9CisgICAgLyogVE9ETzpyZW1vdmUgdGhpcyBjb2RlIG9uY2UgZHJpdmVyIHByb3ZpZGVzIHRoZSBjYWxsIGJhY2sgZnVuY3Rpb24KKyAgICAgKiB0byBzdXBwbGljYW50IGZvciBzZXRfcW9zX21hcAorICAgICAqLworICAgIGVsc2UKKyAgICB7CisgICAgICAgIGlmKGV4dHJhY3RlZEV4dENhcC5pbnRlcndvcmtpbmdTZXJ2aWNlKQorICAgICAgICB7CisgICAgICAgICAgICBleHRyYWN0ZWRFeHRDYXAucW9zTWFwID0gMTsKKyAgICAgICAgfQorICAgICAgICAvKiBObyBuZWVkIHRvIG1lcmdlIHRoZSBFWFQgQ2FwIGZyb20gU3VwcGxpY2FudAorICAgICAgICAgKiBpZiBpbnRlcndvcmtpbmdTZXJ2aWNlIGlzIG5vdCBzZXQsIGFzIGN1cnJlbnRseQorICAgICAgICAgKiBkcml2ZXIgaXMgb25seSBpbnRlcmVzdGVkIGluIGludGVyd29ya2luZ1NlcnZpY2UKKyAgICAgICAgICogY2FwYWJpbGl0eSBmcm9tIHN1cHBsaWNhbnQuIGlmIGluCisgICAgICAgICAqIGZ1dHVyZSBhbnkgb3RoZXIgRVhUIENhcCBpbmZvIGlzIHJlcXVpcmVkIGZyb20KKyAgICAgICAgICogc3VwcGxpY2FudCBpdCBuZWVkcyB0byBiZSBoYW5kbGVkIGhlcmUuCisgICAgICAgICAqLworICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIGV4dHJhY3RlZEV4dENhcEZsYWcgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBjYXBzID0gcE1sbUFzc29jUmVxLT5jYXBhYmlsaXR5SW5mbzsKKyAgICBpZiAoIFBST1BfQ0FQQUJJTElUWV9HRVQoIDExRVFPUywgcHNlc3Npb25FbnRyeS0+bGltQ3VycmVudEJzc1Byb3BDYXAgKSApCisgICAgICAgICgodFNpck1hY0NhcGFiaWxpdHlJbmZvICopICZjYXBzKS0+cW9zID0gMDsKKyNpZiBkZWZpbmVkKEZFQVRVUkVfV0xBTl9XQVBJKQorICAgIC8qIENSOiAyNjI0NjMgOiAKK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B7CisgICAgICAgICAgICBQb3B1bGF0ZURvdDExZldNTUluZm9TdGF0aW9uKCBwTWFjLCAmcEZybS0+V01NSW5mb1N0YXRpb24gKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmICggZldzbUVuYWJsZWQgJiYKKyAgICAgICAgICAgICAgICAoICEgUFJPUF9DQVBBQklMSVRZX0dFVChXU00sIHBzZXNzaW9uRW50cnktPmxpbUN1cnJlbnRCc3NQcm9wQ2FwICkpKQorICAgICAgICB7CisgICAgICAgICAgICBQb3B1bGF0ZURvdDExZldNTUNhcHMoICZwRnJtLT5XTU1DYXBzICk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvL1BvcHVsYXRlIEhUIElFcywgd2hlbiBvcGVyYXRpbmcgaW4gMTFuIG9yIFRhdXJ1cyBtb2RlcyBBTkQKKyAgICAvL3doZW4gQVAgaXMgYWxzbyBvcGVyYXRpbmcgaW4gMTFuIG1vZGUuCisgICAgaWYgKCBwc2Vzc2lvbkVudHJ5LT5odENhcGFiaWxpdHkgJiYKKyAgICAgICAgICAgIHBNYWMtPmxpbS5odENhcGFiaWxpdHlQcmVzZW50SW5CZWFjb24pCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlBvcHVsYXRlIEhUIElFcyBpbiBBc3NvYyBSZXF1ZXN0IikpOworICAgICAgICBQb3B1bGF0ZURvdDExZkhUQ2FwcyggcE1hYywgcHNlc3Npb25FbnRyeSwgJnBGcm0tPkhUQ2FwcyApOworI2lmZGVmIERJU0FCTEVfR0ZfRk9SX0lOVEVST1AKKworICAgICAgICAvKgorICAgICAgICAgKiBUbyByZXNvbHZlIHRoZSBpbnRlcm9wIHByb2JsZW0gd2l0aCBCcm9hZGNvbSBBUCwgCisgICAgICAgICAqIHdoZXJlIFRRIFNUQSBjb3VsZCBub3QgcGFzcyB0cmFmZmljIHdpdGggR0YgZW5hYmxlZCwKKyAgICAgICAgICogVFEgU1RBIHdpbGwgZG8gR3JlZW5maWVsZCBvbmx5IHdpdGggVFEgQVAsIGZvciAKKyAgICAgICAgICogZXZlcnlib2R5IGVsc2UgaXQgd2lsbCBiZSB0dXJuZWQgb2ZmLgorICAgICAgICAgKi8KKworICAgICAgICBpZiggKHBzZXNzaW9uRW50cnktPnBMaW1Kb2luUmVxICE9IE5VTEwpICYmICghcHNlc3Npb25FbnRyeS0+cExpbUpvaW5SZXEtPmJzc0Rlc2NyaXB0aW9uLmFuaUluZGljYXRvcikpCisgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPRzEsIEZMKCJTZW5kaW5nIEFzc29jIFJlcSB0byBOb24tVFEgQVAsIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgVHVybmluZyBvZmYgR3JlZW5maWVsZCIpKTsKKyAgICAgICAgICAgIHBGcm0tPkhUQ2Fwcy5ncmVlbkZpZWxkID0gV05JX0NGR19HUkVFTkZJRUxEX0NBUEFCSUxJVFlfRElTQUJMRTsKKyAgICAgICAgfQorI2VuZGlmCisKKyAgICB9CisKKyAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlN1cHBvcnRlZENobmxXaWR0aDogJWQsIG1pbW9QUzogJWQsIEdGOiAlZCwiCisgICAgICAgICAgICAgICAgICAgICAgICAgICJzaG9ydEdJMjA6JWQsIHNob3J0R0k0MDogJWQsIGRzc3NDY2s6ICVkLCBBTVBEVSBQYXJhbTogJXgiKSwKKyAgICAgICAgICAgcEZybS0+SFRDYXBzLnN1cHBvcnRlZENoYW5uZWxXaWR0aFNldCwgcEZybS0+SFRDYXBzLm1pbW9Qb3dlclNhdmUsCisgICAgICAgICAgIHBGcm0tPkhUQ2Fwcy5ncmVlbkZpZWxkLCBwRnJtLT5IVENhcHMuc2hvcnRHSTIwTUh6LCBwRnJtLT5IVENhcHMuc2hvcnRHSTQwTUh6LAorICAgICAgICAgICBwRnJtLT5IVENhcHMuZHNzc0Nja01vZGU0ME1IeiwgcEZybS0+S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AgICAgICBsaW1NZXJnZUV4dENhcElFU3RydWN0KCZwRnJtLT5FeHRDYXAsICZleHRyYWN0ZWRFeHRDYXApOworICAgIH0KKworICAgIG5TdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRBc3NvY1JlcXVlc3RTaXplKCBwTWFjLCBwRnJtLCAmblBheWxvYWQgKTsKKyAgICBpZiAoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1AsIEZMKCJGYWlsZWQgdG8gY2FsY3VsYXRlIHRoZSBwYWNrZWQgc2l6ZSBmIgorICAgICAgICAgICAgICAgICAgICAib3IgYW4gQXNzb2NpYXRpb24gUmVxdWVzdCAoMHglMDh4KS4iKSwKKyAgICAgICAgICAgICAgICBuU3RhdHVzICk7CisgICAgICAgIC8vIFdlJ2xsIGZhbGwgYmFjayBvbiB0aGUgd29yc3QgY2FzZSBzY2VuYXJpbzoKKyAgICAgICAgblBheWxvYWQgPSBzaXplb2YoIHREb3QxMWZBc3NvY1JlcXVlc3QgKTsKKyAgICB9CisgICAgZWxzZSBpZiAoIERPVDExRl9XQVJORUQoIG5TdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csIEZMKCJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIGNhbGN1bGF0aW5nICIKKyAgICAgICAgICAgICAgICAgICAgInRoZSBwYWNrZWQgc2l6ZSBmb3IgYW4gQXNzb2NpYXRpb24gUmUgIgorICAgICAgICAgICAgICAgICAgICAicXVlc3QoMHglMDh4KS4iKSwgblN0YXR1cyApOworICAgIH0KKworICAgIG5CeXRlcyA9IG5QYXlsb2FkICsgc2l6ZW9mKCB0U2lyTWFjTWdtdEhkciApICsgbkFkZElFTGVuOworCisgICAgaGFsc3RhdHVzID0gcGFsUGt0QWxsb2MoIHBNYWMtPmhIZGQsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICggdEFOSV9VMTYgKW5CeXRlcywgKCB2b2lkKiogKSAmcEZyYW1lLAorICAgICAgICAgICAgKCB2b2lkKiogKSAmcFBhY2tldCApOworICAgIGlmICggISBIQUxfU1RBVFVTX1NVQ0NFU1MgKCBoYWxzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1AsIEZMKCJGYWlsZWQgdG8gYWxsb2NhdGUgJWQgYnl0ZXMgZm9yIGFuIEFzIgorICAgICAgICAgICAgICAgICAgICAic29jaWF0aW9uIFJlcXVlc3QuIiksIG5CeXRlcyApOworCisgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlID0gcHNlc3Npb25FbnRyeS0+bGltUHJldk1sbVN0YXRlOworICAgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9NTE1fU1RBVEUsIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLCBwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSkpOworCisKKyAgICAgICAgLyogVXBkYXRlIFBFIHNlc3Npb24gaWQqLworICAgICAgICBtbG1Bc3NvY0NuZi5zZXNzaW9uSWQgPSBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZDsKKworICAgICAgICBtbG1Bc3NvY0NuZi5yZXN1bHRDb2RlID0gZVNJUl9TTUVfUkVTT1VSQ0VTX1VOQVZBSUxBQkxFOworCisgICAgICAgIHBhbFBrdEZyZWUoIHBNYWMtPmhIZGQsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICAgICAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworCisgICAgICAgIGxpbVBvc3RTbWVNZXNzYWdlKCBwTWFjLCBMSU1fTUxNX0FTU09DX0NORiwKKyAgICAgICAgICAgICAgICAoIHRBTklfVTMyKiApICZtbG1Bc3NvY0NuZik7CisKKyAgICAgICAgdm9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gIG5QYXlsb2FkLCAmblBheWxvYWQgKTsKKyAgICBpZiAoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gcGFjayBhIEFzc29jIFJlcXVlc3QgKDB4JTAiCisgICAgICAgICAgICAgICAgICAgICI4eCkuIiksCisgICAgICAgICAgICAgICAgblN0YXR1cyApOworICAgICAgICBwYWxQa3RGcmVlKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgKCB2b2lkKiApIHBGcmFtZSwgKCB2b2lkKiApIHBQYWNrZXQgKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBGcm0pOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dXLCBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBwYWNraW5nIGEgQXNzb2MiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlJlcXVlc3QgKDB4JTA4eCkuIiksIG5TdGF0dXMgKTsKKyAgICB9CisKKyAgICBQRUxPRzEobGltTG9nKCBwTWFjLCBMT0cxLCBGTCgiKioqIFNlbmRpbmcgQXNzb2NpYXRpb24gUmVxdWVzdCBsZW5ndGggJWQiCisgICAgICAgICAgICAgICAgICAgICJ0byAiKSwKKyAgICAgICAgICAgICAgICBuQnl0ZXMgKTspCisgICAgICAgIC8vICAgbGltUHJpbnRNYWNBZGRyKCBwTWFjLCBic3NpZCwgTE9HMSApOworCisgICAgICAgIGlmKCBwc2Vzc2lvbkVudHJ5LT5hc3NvY1JlcSAhPSBOVUxMICkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBzZXNzaW9uRW50cnktPmFzc29jUmVxKTsKKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmFzc29jUmVxID0gTlVMTDsKKyAgICAgICAgfQorCisgICAgaWYoIG5BZGRJRUxlbiApCisgICAgeworICAgICAgICB2b3NfbWVtX2NvcHkoIHBGcmFtZSArIHNpemVvZih0U2lyTWFjTWdtdEhkcikgKyBuUGF5bG9hZCwKKyAgICAgICAgICAgICAgICAgICAgICBwQWRkSUUsCisgICAgICAgICAgICAgICAgICAgICAgbkFkZElFTGVuICk7CisgICAgICAgIG5QYXlsb2FkICs9IG5BZGRJRUxlbjsKKyAgICB9CisKKyAgICBwc2Vzc2lvbkVudHJ5LT5hc3NvY1JlcSA9IHZvc19tZW1fbWFsbG9jKG5QYXlsb2FkKTsKKyAgICBpZiAoIE5VTEwgPT0gcHNlc3Npb25FbnRyeS0+YXNzb2NSZXEgKQorICAgIHsKKyAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiVW5hYmxlIHRvIGFsbG9jYXRlIG1lbW9yeSB0byBzdG9yZSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImFzc29jIHJlcXVlc3QiKSk7KQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAvL1N0b3JlIHRoZSBBc3NvYyByZXF1ZXN0LiBUaGlzIGlzIHNlbnQgdG8gY3NyL2hkZCBpbiBqb2luIGNuZiByZXNwb25zZS4gCisgICAgICAgIHZvc19tZW1fY29weSggcHNlc3Npb25FbnRyeS0+YXNzb2NSZXEsIHBGcmFtZSArIHNpemVvZih0U2lyTWFjTWdtdEhkciksIG5QYXlsb2FkKTsKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+YXNzb2NSZXFMZW4gPSBuUGF5bG9hZDsKKyAgICB9CisKKyAgICBpZiggKCBTSVJfQkFORF81X0dIWiA9PSBsaW1HZXRSRkJhbmQocHNlc3Npb25FbnRyeS0+Y3VycmVudE9wZXJDaGFubmVsKSkKKyAgICAgICB8fCAoIH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gICAgICAgICAgICAgICAgICAgICAoICFJU19CUk9BRENBU1RfTUFDKHBNbG1Bc3NvY1JlcS0+cGVlck1hY0FkZHIpICkgKXsKKyAgICAgICAgdHhGbGFnIHw9IEhBTF9VU0VfQkRfUkFURTJfRk9SX01BTkFHRU1FTlRfRlJBTUU7CisgICAgfQorICAgIGlmIChJU19GRUFUVVJFX1NVUFBPUlRFRF9CWV9GVyhFTkhBTkNFRF9UWEJEX0NPTVBMRVRJT04pKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJBc3NvYyBSZXEgLSB0eEJkVG9rZW4gJXUiKSwgcE1hYy0+bGltLnR4QmRUb2tlbik7CisgICAgICAgIGhhbHN0YXR1cyA9IGhhbFR4RnJhbWVXaXRoVHhDb21wbGV0ZSggcE1hYywgcFBhY2tldCwKKyAgICAgICAgICAgICAgICAoIHRBTklfVTE2ICkgKHNpemVvZih0U2lyTWFjTWdtdEhkcikgKyBuUGF5bG9hZCksCisgICAgICAgICAgICAgICAgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCBBTklfVFhESVJfVE9EUywKKyAgICAgICAgICAgICAgICA3LC8vU01BQ19TV0JEX1RYX1RJRF9NR01UX0hJR0gsCisgICAgICAgICAgICAgICAgbGltVHhDb21wbGV0ZSwgcEZyYW1lLCBsaW1UeEJkQ29tcGxldGUsIHR4RmxhZywKKyAgICAgICAgICAgICAgICBwTWFjLT5saW0udHhCZFRva2VuKTsKKyAgICAgICAgcE1hYy0+bGltLnR4QmRUb2tlbisrOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBoYWxzdGF0dXMgPSBoYWxUeEZyYW1lKCBwTWFjLCBwUGFja2V0LAorICAgICAgICAgICAgICAgICggdEFOSV9VMTYgKSAoc2l6ZW9mKHRTaXJNYWNNZ210SGRyKSArIG5QYXlsb2FkKSwKKyAgICAgICAgICAgICAgICBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAg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X1ZPV0lGSQorICAgIHRBTklfVTggICAgICAgICAgICAgICBQb3dlckNhcHNQb3B1bGF0ZWQgPSBGQUxTRTsKKyNlbmRpZgorICAgIHRBTklfVTE2ICAgICAgICAgICAgICBmdF9pZXNfbGVuZ3RoID0gMDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgKnBCb2R5OworICAgIHRBTklfVTE2ICAgICAgICAgICAgICBuQWRkSUVMZW47IAorICAgIHRBTklfVTggICAgICAgICAgICAgICAqcEFkZElFOworI2lmIGRlZmluZWQgRkVBVFVSRV9XTEFOX0VTRSB8fCBkZWZpbmVkKEZFQVRVUkVfV0xBTl9MRlIpCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICp3cHNJZSA9IE5VTEw7CisjZW5kaWYKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgdHhGbGFnID0gMDsKKyAgICB0cFNpck1hY01nbXRIZHIgICAgICAgcE1hY0hkcjsKKworICAgIGlmIChOVUxMID09IHBzZXNzaW9uRW50cnkpCisgICAgeworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgLyogY2hlY2sgdGhpcyBlYXJseSB0byBhdm9pZCB1bm5jZXNzYXJ5IG9wZXJhdGlvbiAqLworICAgIGlmKE5VTEwgPT0gcHNlc3Npb25FbnRyeS0+cExpbVJlQXNzb2NSZXEpCisgICAgeworICAgICAgICByZXR1cm47CisgICAgfQorICAgIG5BZGRJRUxlbiA9IHBzZXNzaW9uRW50cnktPnBMaW1SZUFzc29jUmVxLT5hZGRJRUFzc29jLmxlbmd0aDsgCisgICAgcEFkZElFID0gcHNlc3Npb25FbnRyeS0+cExpbVJlQXNzb2NSZXEtPmFkZElFQXNzb2MuYWRkSUVkYXRhOworICAgIGxpbUxvZyggcE1hYywgTE9HMSwgRkwoImxpbVNlbmRSZWFzc29jUmVxV2l0aEZUSUVzTWdtdEZyYW1lIHJlY2VpdmVkIGluICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJzdGF0ZSAoJW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yeS0+bGltMTFoRW5hYmxlICAmJgorICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cExpbVJlQXNzb2NSZXEtPnNwZWN0cnVtTWd0SW5kaWNhdG9yID09IGVTSVJfVFJVRSApCisgICAgeworI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX1ZPV0lGSQorICAgICAgICBQb3dlckNhcHNQb3B1bGF0ZWQgPSBUUlVFOworCisgICAgICAgIFBvcHVsYXRlRG90MTFmUG93ZXJDYXBzKCBwTWFjLCAmZnJtLlBvd2VyQ2FwcywgTElNX1JFQVNTT0MscHNlc3Npb25FbnRyeSk7CisgICAgICAgIFBvcHVsYXRlRG90MTFmU3VwcENoYW5uZWxzKCBwTWFjLCAmZnJtLlN1cHBDaGFubmVscywgTElNX1JFQVNTT0MscHNlc3Npb25FbnRyeSk7CisjZW5kaWYKKyAgICB9CisKKyNpZiBkZWZpbmVkIFdMQU5fRkVBVFVSRV9WT1dJRkkKKyAgICBpZiggcE1hYy0+cnJtLnJybVBFQ29udGV4dC5ycm1FbmFibGUgJiYKKyAgICAgICAgICAgIFNJUl9NQUNfR0VUX1JSTSggcHNlc3Npb25FbnRyeS0+bGltQ3VycmVudEJzc0NhcHMgKSApCisgICAgeworICAgICAgICBpZiAoUG93ZXJDYXBzUG9wdWxhdGVkID09IEZBTFNFKSAKKyAgICAgICAgeworICAgICAgICAgICAgUG93ZXJDYXBzUG9wdWxhdGVkID0gVFJVRTsKKyAgICAgICAgICAgIFBvcHVsYXRlRG90MTFmUG93ZXJDYXBzKHBNYWMsICZmcm0uUG93ZXJDYXBzLCBMSU1fUkVBU1NPQywgcHNlc3Npb25FbnRyeSk7CisgICAgICAgIH0KKyAgICB9CisjZW5kaWYKKworICAgIGlmICggZlFvc0VuYWJsZWQgJiYKKyAgICAgICAgICAgICggISBQUk9QX0NBUEFCSUxJVFlfR0VUKDExRVFPUywgcHNlc3Npb25FbnRyeS0+bGltUmVhc3NvY0Jzc1Byb3BDYXAgKSApKQorIC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gICAgLy8gZWxpZGluZyB0aGUgV1BBIG9yIFJTTiBJRSwgd2UganVzdCBza2lwIHRoaXM6CisgICAgaWYgKCFwc2Vzc2lvbkVudHJ5LT5pczExUmNvbm5lY3Rpb24pCisgICAgeworICAgICAgICBpZiggbkFkZElFTGVuICYmIHBBZGRJRSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHdwc0llID0gbGltR2V0V3NjSUVQdHIocE1hYywgcEFkZElFLCBuQWRkSUVMZW4pOworICAgICAgICB9CisgICAgICAgIGlmICggTlVMTCA9PSB3cHNJZSApCisgICAgICAgIHsKKyAgICAgICAgICAgIFBvcHVsYXRlRG90MTFmUlNOT3BhcXVlKCBwTWFjLCAmKCBwc2Vzc2lvbkVudHJ5LT5wTGltUmVBc3NvY1JlcS0+cnNuSUUgKSwKKyAgICAgICAgICAgICAgICAgICAgJmZybS5SU05PcGFxdWUgKTsKKyAgICAgICAgICAgIFBvcHVsYXRlRG90MTFmV1BBT3BhcXVlKCBwTWFjLCAmKCBwc2Vzc2lvbkVudHJ5LT5wTGltUmVBc3NvY1JlcS0+cnNuSUUgKSwKKyAgICAgICAgICAgICAgICAgICAgJmZybS5XUEFPcGFxdWUgKTsKKyAgICAgICAgfQorCisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRQorICAgICAgICBpZiAocHNlc3Npb25FbnRyeS0+cExpbVJlQXNzb2NSZXEtPmNja21JRS5sZW5ndGgpCisgICAgICAgIHsKKyAgICAgICAgICAgIFBvcHVsYXRlRG90MTFmRVNFQ2NrbU9wYXF1ZSggcE1hYywgJiggcHNlc3Npb25FbnRyeS0+cExpbVJlQXNzb2NSZXEtPmNja21JRSApLAorICAgICAgICAgICAgICAgICAgICAmZnJtLkVTRUNja21PcGFxdWUgKTsKKyAgICAgICAgfQorI2VuZGlmIC8vRkVBVFVSRV9XTEFOX0VTRQorICAgIH0KKworI2lmZGVmIEZFQVRVUkVfV0xBTl9FU0UKKyAgICAvLyBGb3IgRVNFIEFzc29jaWF0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b25FbnRyeS0+aXNFU0Vjb25uZWN0aW9uKQorICAgICAgICB7CisgICAgICAgICAgICBQb3B1bGF0ZURvdDExZlJlQXNzb2NUc3BlYyhwTWFjLCAmZnJtLCBwc2Vzc2lvbkVudHJ5KTsKKworICAgICAgICAgICAgLy8gUG9wdWxhdGUgdGhlIFRTUlMgSUUgaWYgVFNQRUMgaXMgaW5jbHVkZWQgaW4gdGhlIHJlYXNzb2MgcmVxdWVzdAorICAgICAgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPnBMaW1SZUFzc29jUmVxLT5lc2VUc3BlY0luZm8ubnVtVHNwZWNzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHRBTklfVTMyIHBoeU1vZGU7CisgICAgICAgICAgICAgICAgdFNpck1hY0VTRVRTUlNJRSAgICB0c3JzSUU7CisgICAgICAgICAgICAgICAgbGltR2V0UGh5TW9kZShwTWFjLCAmcGh5TW9kZSwgcHNlc3Npb25FbnRyeSk7CisKKyAgICAgICAgICAgICAgICB0c3JzSUUudHNpZCA9IDA7CisgICAgICAgICAgICAgICAgaWYoIHBoeU1vZGUgPT0gV05JX0NGR19QSFlfTU9ERV8xMUcgfHwgcGh5TW9kZSA9PSBXTklfQ0ZHX1BIWV9NT0RFXzExQSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHRzcnNJRS5yYXRlc1swXSA9IFRTUlNfMTFBR19SQVRFXzZNQlBTOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB0c3JzSUUucmF0ZXNbMF0gPSBUU1JTXzExQl9SQVRFXzVfNU1CUFM7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIFBvcHVsYXRlRG90MTFUU1JTSUUocE1hYywmdHNyc0lFLCAmZnJtLkVTRVRyYWZTdHJtUmF0ZVNldCwgc2l6ZW9mKHRBTklfVTgpKTsKKyAgICAg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0LCB3ZSBmaWxsIG91dCB0aGUgYnVmZmVyIGRlc2NyaXB0b3I6CisgICAgblNpclN0YXR1cyA9IGxpbVBvcHVsYXRlTWFjSGVhZGVyKCBwTWFjLCBwRnJhbWUsIFNJUl9NQUNfTUdNVF9GUkFNRSwKKyAgICAgICAgICAgIFNJUl9NQUNfTUdNVF9SRUFTU09DX1JFUSwKKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVJlQXNzb2Nic3NJZCxwc2Vzc2lvbkVudHJ5LT5zZWxmTWFjQWRkcik7CisgICAgaWYgKCBlU0lSX1NVQ0NFU1MgIT0gblNpclN0YXR1cyApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gcG9wdWxhdGUgdGhlIGJ1ZmZlciBkZXNjcmlwIgorICAgICAgICAgICAgICAgICAgICAidG9yIGZvciBhbiBBc3NvY2lhdGlvbiBSZXF1ZXN0ICglZCkuIiksCisgICAgICAgICAgICAgICAgblNpclN0YXR1cyApOworICAgICAgICBwYWxQa3RGcmVlKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsICggdm9pZCogKSBwRnJhbWUsICggdm9pZCogKSBwUGFja2V0ICk7CisgICAgICAgIGdvdG8gZW5kOworICAgIH0KKworICAgIHBNYWNIZHIgPSAodHBTaXJNYWNNZ210SGRyKSBwRnJhbWU7CisgICAgLy8gVGhhdCBkb25lLCBwYWNrIHRoZSBSZUFzc29jIFJlcXVlc3Q6CisgICAgblN0YXR1cyA9IGRvdDExZlBhY2tSZUFzc29jUmVxdWVzdCggcE1hYywgJmZybSwgcEZyYW1lICsKKyAgICAgICAgICAgIHNpemVvZih0U2lyTWFjTWdtdEhkciksCisgICAgICAgICAgICBuUGF5bG9hZCwgJm5QYXlsb2FkICk7CisgICAgaWYgKCBET1QxMUZfRkFJTEVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIHBhY2sgYSBSZS1Bc3NvY2lhdGlvbiBSZXF1ZSIKKyAgICAgICAgICAgICAgICAgICAgInN0ICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgIG5TdGF0dXMgKTsKKyAgICAgICAgcGFsUGt0RnJlZSggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworICAgICAgICBnb3RvIGVuZDsKKyAgICB9CisgICAgZWxzZSBpZiAoIERPVDExRl9XQVJORUQoIG5TdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csIEZMKCJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIHBhY2tpbmcgYSBSIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJlLUFzc29jaWF0aW9uIFJlcXVlc3QgKDB4JTA4eCkuIiksIG5TdGF0dXMgKTsKKyAgICB9CisKKyAgICBQRUxPRzMobGltTG9nKCBwTWFjLCBMT0czLCAKKyAgICAgICAgICAgIEZMKCIqKiogU2VuZGluZyBSZS1Bc3NvY2lhdGlvbiBSZXF1ZXN0IGxlbmd0aCAlZCAlZCB0byAiKSwKKyAgICAgICAgICAgIG5CeXRlcywgblBheWxvYWQgKTspCisgICAgaWYoIHBzZXNzaW9uRW50cnktPmFzc29jUmVxICE9IE5VTEwgKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBzZXNzaW9uRW50cnktPmFzc29jUmVxKTsKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+YXNzb2NSZXEgPSBOVUxMOworICAgIH0KKworICAgIGlmKCBuQWRkSUVMZW4gKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9jb3B5KCBwRnJhbWUgKyBzaXplb2YodFNpck1hY01nbXRIZHIpICsgblBheWxvYWQsCisgICAgICAgICAgICAgICAgICAgICAgcEFkZElFLAorICAgICAgICAgICAgICAgICAgICAgIG5BZGRJRUxlbiApOworICAgICAgICBuUGF5bG9hZCArPSBuQWRkSUVMZW47CisgICAgfQorCisgICAgcHNlc3Npb25FbnRyeS0+YXNzb2NSZXEgPSB2b3NfbWVtX21hbGxvYyhuUGF5bG9hZCk7CisgICAgaWYgKCBOVUxMID09IHBzZXNzaW9uRW50cnktPmFzc29jUmVxICkKKyAgICB7CisgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlVuYWJsZSB0byBhbGxvY2F0ZSBtZW1vcnkgdG8gc3RvcmUgYXNzb2MgcmVxdWVzdCIpKTspCisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIC8vU3RvcmUgdGhlIEFzc29jIHJlcXVlc3QuIFRoaXMgaXMgc2VudCB0byBjc3IvaGRkIGluIGpvaW4gY25mIHJlc3BvbnNlLiAKKyAgICAgICAgdm9zX21lbV9jb3B5KCBwc2Vzc2lvbkVudHJ5LT5hc3NvY1JlcSwgcEZyYW1lICsgc2l6ZW9mKHRTaXJNYWNNZ210SGRyKSwgblBheWxvYWQpOworICAgICAgICBwc2Vzc2lvbkVudHJ5LT5hc3NvY1JlcUxlbiA9IG5QYXlsb2FkOworICAgIH0KKworICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5pczExUmNvbm5lY3Rpb24pCisgICAgeworICAgICAgICB7CisgICAgICAgICAgICBpbnQgaSA9IDA7CisKKyAgICAgICAgICAgIHBCb2R5ID0gcEZyYW1lICsgbkJ5dGVzOworICAgICAgICAgICAgZm9yIChpPTA7IGk8ZnRfaWVzX2xlbmd0aDsgaSsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICpwQm9keSA9IHBNYWMtPmZ0LmZ0U21lQ29udGV4dC5yZWFzc29jX2Z0X2llc1tpXTsKKyAgICAgICAgICAgICAgICBwQm9keSsrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisjaWZkZWYgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVJfREVCVUcKKyAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPRzEsIEZMKCJSZS1hc3NvYyBSZXEgRnJhbWUgaXM6ICIpKTsKKyAgICAgICAgICAgIHNpckR1bXBCdWYocE1hYywgU0lSX0xJTV9NT0RVTEVfSUQsIExPRzEsCisgICAgICAgICAgICAgICAgKHRBTklfVTggKilwRnJhbWUsCisgICAgICAgICAgICAgICAgKG5CeXRlcyArIGZ0X2llc19sZW5ndGgpKTspCisjZW5kaWYKKworCisgICAgaWYoICggU0lSX0JBTkRfNV9HSFogPT0gbGltR2V0UkZCYW5kKHBzZXNzaW9uRW50cnktPmN1cnJlbnRPcGVyQ2hhbm5lbCkpCisgICAgICAgfHwgKCBwc2Vzc2lvbkVudHJ5LT5wZVBlcnNvbmEgPT0gVk9TX1AyUF9DTElFTlRfTU9ERSApIHx8CisgICAgICAgICAoIHBzZXNzaW9uRW50cnktPnBlUGVyc29uYSA9PSBWT1NfUDJQX0dPX01PREUpCisgICAgICAgICApCisgICAgeworICAgICAgICB0eEZsYWcgfD0gSEFMX1VTRV9CRF9SQVRFMl9GT1JfTUFOQUdFTUVOVF9GUkFNRTsKKyAgICB9CisgCisgICAgaWYoIE5VTEwgIT0gcHNlc3Npb25FbnRyeS0+YXNzb2NSZXEgKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBzZXNzaW9uRW50cnktPmFzc29jUmVxKTsKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+YXNzb2NSZXEgPSBOVUxMOworICAgIH0KKworICAgIHBzZXNzaW9uRW50cnktPmFzc29jUmVxID0gdm9zX21lbV9tYWxsb2MoZnRfaWVzX2xlbmd0aCk7CisgICAgaWYgKCBOVUxMID09IHBzZXNzaW9uRW50cnktPmFzc29jUmVxICkKKyAgICB7CisgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlVuYWJsZSB0byBhbGxvY2F0ZSBtZW1vcnkgdG8gc3RvcmUgYXNzb2MgcmVxdWVzdCIpKTspCisgICAgICAgIHBzZXNzaW9uRW50cnktPmFzc29jUmVxTGVuID0gMDsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAvL1N0b3JlIHRoZSBBc3NvYyByZXF1ZXN0LiBUaGlzIGlzIHNlbnQgdG8gY3NyL2hkZCBpbiBqb2luIGNuZiByZXNwb25zZS4gCisgICAgICAgdm9zX21lbV9jb3B5KCBwc2Vzc2lvbkVudHJ5LT5hc3NvY1JlcSwgcE1hYy0+ZnQuZnRTbWVDb250ZXh0LnJlYXNzb2NfZnRfaWVzLAorICAgICAgICAgICAgICAgICAgICAoZnRfaWVzX2xlbmd0aCkpOworICAgICAgIHBzZXNzaW9uRW50cnktPmFzc29jUmVxTGVuID0gKGZ0X2llc19sZW5ndGgpOworICAgIH0KKworICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RYX01HTVQsCisgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLAorICAgICAgICAgICBwTWFjSGRyLT5mYy5zdWJUeXBlKSk7CisgICAgaWYgKElTX0ZFQVRVUkVfU1VQUE9SVEVEX0JZX0ZXKEVOSEFOQ0VEX1RYQkRfQ09NUExFVElPTikpCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPRzEsIEZMKCJSZWFzc29jIHJlcSAtIHR4QmRUb2tlbiAldSIpLCBwTWFjLT5saW0udHhCZFRva2VuKTsKKyAgICAgICAgaGFsc3RhdHVzID0gaGFsVHhGcmFtZVdpdGhUeENvbXBsZXRlKCBwTWFjLCBwUGFja2V0LAorICAgICAgICAgICAgICAgICggdEFOSV9VMTYgKSAobkJ5dGVzICsgZnRfaWVzX2xlbmd0aCksCisgICAgICAgICAgICAgICAgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCBBTklfVFhESVJfVE9EUywKKyAgICAgICAgICAgICAgICA3LC8vU01BQ19TV0JEX1RYX1RJRF9NR01UX0hJR0gsCisgICAgICAgICAgICAgICAgbGltVHhDb21wbGV0ZSwgcEZyYW1lLCBsaW1UeEJkQ29tcGxldGUsIHR4RmxhZywKKyAgICAgICAgICAgICAgICBwTWFjLT5saW0udHhCZFRva2VuKTsKKyAgICAgICAgcE1hYy0+bGltLnR4QmRUb2tlbisrOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBoYWxzdGF0dXMgPSBoYWxUeEZyYW1lKCBwTWFjLCBwUGFja2V0LCAoIHRBTklfVTE2ICkgKG5CeXRlcyArIGZ0X2llc19sZW5ndGgpLAorICAgICAgICAgICAgICAgIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICAgICBBTklfVFhESVJfVE9EUywKKyAgICAgICAgICAgICAgICA3LC8vU01BQ19TV0JEX1RYX1RJRF9NR01UX0hJR0gsCisgICAgICAgICAgICAgICAgbGltVHhDb21wbGV0ZSwgcEZyYW1lLCB0eEZsYWcgKTsKKyAgICB9CisgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfVFhfQ09NUExFVEUsCisgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLAorICAgICAgICAgICBoYWxzdGF0dXMpKTsKKyAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTICggaGFsc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIHNlbmQgUmUtQXNzb2NpYXRpb24gUmVxdWVzdCIKKyAgICAgICAgICAgICAgICAgICAgIiglWCkhIiksCisgICAgICAgICAgICAgICAgblNpclN0YXR1cyApOworICAgICAgICAvL1BrdCB3aWxsIGJlIGZyZWVkIHVwIGJ5IHRoZSBjYWxsYmFjaworICAgICAgICBnb3RvIGVuZDsKKyAgICB9CisKKyAgICAvLyBFbmFibGUgVEwgY2FoY2hp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OSV9VMzIgKikgJm1sbVJlYXNzb2NDbmYpOworfQorCisjZW5kaWYgLyogV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIgKi8KKworCit2b2lkCitsaW1TZW5kUmVhc3NvY1JlcU1nbXRGcmFtZSh0cEFuaVNpckdsb2JhbCAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRMaW1NbG1SZWFzc29jUmVxICpwTWxtUmVhc3NvY1JlcSx0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KQoreworICAgIHN0YXRpYyB0RG90MTFmUmVBc3NvY1JlcXVlc3QgZnJtOworICAgIHRBTklfVTE2ICAgICAgICAgICAgICBjYXBzOworICAgIHRBTklfVTggICAgICAgICAgICAgICpwRnJhbWU7CisgICAgdFNpclJldFN0YXR1cyAgICAgICAgIG5TaXJTdGF0dXM7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgIG5CeXRlcywgblBheWxvYWQsIG5TdGF0dXM7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgIGZRb3NFbmFibGVkLCBmV21lRW5hYmxlZCwgZldzbUVuYWJsZWQ7CisgICAgdm9pZCAgICAgICAgICAgICAgICAgKnBQYWNrZXQ7CisgICAgZUhhbFN0YXR1cyAgICAgICAgICAgIGhhbHN0YXR1czsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgbkFkZElFTGVuOyAKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgKnBBZGRJRTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgKndwc0llID0gTlVMTDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgdHhGbGFnID0gMDsKKyNpZiBkZWZpbmVkIFdMQU5fRkVBVFVSRV9WT1dJRkkKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgUG93ZXJDYXBzUG9wdWxhdGVkID0gRkFMU0U7CisjZW5kaWYKKyAgICB0cFNpck1hY01nbXRIZHIgICAgICAgcE1hY0hkcjsKKwor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ZSA9IGxpbUdldFdzY0lFUHRyKHBNYWMsIHBBZGRJRSwgbkFkZElFTGVuKTsKKyAgICB9CisgICAgaWYgKCBOVUxMID09IHdwc0llICkKKyAgICB7CisgICAgICAgIFBvcHVsYXRlRG90MTFmUlNOT3BhcXVlKCBwTWFjLCAmKCBwc2Vzc2lvbkVudHJ5LT5wTGltUmVBc3NvY1JlcS0+cnNuSUUgKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZmcm0uUlNOT3BhcXVlICk7CisgICAgICAgIFBvcHVsYXRlRG90MTFmV1BBT3BhcXVlKCBwTWFjLCAmKCBwc2Vzc2lvbkVudHJ5LT5wTGltUmVBc3NvY1JlcS0+cnNuSUUgKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZmcm0uV1BBT3BhcXVlICk7CisjaWYgZGVmaW5lZChGRUFUVVJFX1dMQU5fV0FQSSkKKyAgICAgICAgUG9wdWxhdGVEb3QxMWZXQVBJT3BhcXVlKCBwTWFjLCAmKCBwc2Vzc2lvbkVudHJ5LT5wTGltUmVBc3NvY1JlcS0+cnNuSUUgKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZmcm0uV0FQSU9wYXF1ZSApOworI2VuZGlmIC8vIGRlZmluZWQoRkVBVFVSRV9XTEFOX1dBUEkpCisgICAgfQorCisgICAgLy8gaW5jbHVkZSBXTUUgRURDQSBJRSBhcyB3ZWxsCisgICAgaWYgKCBmV21lRW5hYmxlZCApCisgICAgeworICAgICAgICBpZiAoICEgUFJPUF9DQVBBQklMSVRZX0dFVCggV01FLCBwc2Vzc2lvbkVudHJ5LT5saW1SZWFzc29jQnNzUHJvcENhcCApICkKKyAgICAgICAgeworICAgICAgICAgICAgUG9wdWxhdGVEb3QxMWZXTU1JbmZvU3RhdGlvbiggcE1hYywgJmZybS5XTU1JbmZvU3RhdGlvbiApOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCBmV3NtRW5hYmxlZCAmJgorIC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5LT52aHRDYXBhYmlsaXR5UHJlc2VudEluQmVhY29uKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0cxLCBGTCgiUG9wdWxhdGUgVkhUIElFcyBpbiBSZS1Bc3NvYyBSZXF1ZXN0IikpOworICAgICAgICBQb3B1bGF0ZURvdDExZlZIVENhcHMoIHBNYWMsICZmcm0uVkhUQ2FwcywKKyAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmN1cnJlbnRPcGVyQ2hhbm5lbCwgZVNJUl9GQUxTRSApOworICAgICAgICBpZiAocHNlc3Npb25FbnRyeS0+aXNfZXh0X2NhcHNfcHJlc2VudCkKKyAgICAgICAgICAgIFBvcHVsYXRlRG90MTFmRXh0Q2FwKCBwTWFjLCAmZnJtLkV4dENhcCwgcHNlc3Npb25FbnRyeSk7CisgICAgfQorI2VuZGlmCisKKyAgICBuU3RhdHVzID0gZG90MTFmR2V0UGFja2VkUmVBc3NvY1JlcXVlc3RTaXplKCBwTWFjLCAmZnJtLCAmblBheWxvYWQgKTsKKyAgICBpZiAoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1AsIEZMKCJGYWlsZWQgdG8gY2FsY3VsYXRlIHRoZSBwYWNrZWQgc2l6ZSBmIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvciBhIFJlLUFzc29jaWF0aW9uIFJlcXVlc3QgKDB4JTA4eCkuIiksCisgICAgICAgICAgICAgICAgblN0YXR1cyApOworICAgICAgICAvLyBXZSdsbCBmYWxsIGJhY2sgb24gdGhlIHdvcnN0IGNhc2Ugc2NlbmFyaW86CisgICAgICAgIG5QYXlsb2FkID0gc2l6ZW9mKCB0RG90MTFmUmVBc3NvY1JlcXVlc3QgKTsKKyAgICB9CisgICAgZWxzZSBpZiAoIERPVDExRl9XQVJORUQoIG5TdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csIEZMKCJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIGNhbGN1bGF0aW5nICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAidGhlIHBhY2tlZCBzaXplIGZvciBhIFJlLUFzc29jaWF0aW9uIFJlICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAicXVlc3QoMHglMDh4KS4iKSwgblN0YXR1cyApOworICAgIH0KKworICAgIG5CeXRlcyA9IG5QYXlsb2FkICsgc2l6ZW9mKCB0U2lyTWFjTWdtdEhkciApICsgbkFkZElFTGVuOworCisgICAgaGFsc3RhdHVzID0gcGFsUGt0QWxsb2MoIHBNYWMtPmhIZGQsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCB0QU5JX1UxNiApbkJ5dGVzLCAoIHZvaWQqKiApICZwRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggdm9pZCoqICkgJnBQYWNrZXQgKTsKKyAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTICggaGFsc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltTWxtU3RhdGUgPSBwc2Vzc2lvbkVudHJ5LT5saW1QcmV2TWxtU3RhdGU7CisgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX01MTV9TVEFURSwgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsIHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlKSk7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HUCwgRkwoIkZhaWxlZCB0byBhbGxvY2F0ZSAlZCBieXRlcyBmb3IgYSBSZS1BcyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAic29jaWF0aW9uIFJlcXVlc3QuIiksIG5CeXRlcyApOworICAgICAgICBnb3RvIGVuZDsKKyAgICB9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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY01nbXRIZHIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5QYXlsb2FkLCAmblBheWxvYWQgKTsKKyAgICBpZiAoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gcGFjayBhIFJlLUFzc29jaWF0aW9uIFJlcXVlIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJzdCAoMHglMDh4KS4iKSwKKyAgICAgICAgICAgICAgICBuU3RhdHVzICk7CisgICAgICAgIHBhbFBrdEZyZWUoIHBNYWMtPmhIZGQsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwgKCB2b2lkKiApIHBGcmFtZSwgKCB2b2lkKiApIHBQYWNrZXQgKTsKKyAgICAgICAgZ290byBlbmQ7CisgICAgfQorICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dXLCBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBwYWNraW5nIGEgUiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZS1Bc3NvY2lhdGlvbiBSZXF1ZXN0ICgweCUwOHgpLiIpLCBuU3RhdHVzICk7CisgICAgfQorCisgICAgUEVMT0cxKGxpbUxvZyggcE1hYywgTE9HMSwgRkwoIioqKiBTZW5kaW5nIFJlLUFzc29jaWF0aW9uIFJlcXVlc3QgbGVuZ3RoICVkIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgInRvICIpLAorICAgICAgICAgICAgbkJ5dGVzICk7KQorCisgICAgaWYoIHBzZXNzaW9uRW50cnktPmFzc29jUmVxICE9IE5VTEwgKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBzZXNzaW9uRW50cnktPmFzc29jUmVxKTsKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+YXNzb2NSZXEgPSBOVUxMOworICAgIH0KKworICAgIGlmKCBuQWRkSUVMZW4gKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9jb3B5KCBwRnJhbWUgKyBzaXplb2YodFNpck1hY01nbXRIZHIpICsgblBheWxvYWQsCisgICAgICAgICAgICAgICAgICAgICAgcEFkZElFLAorICAgICAgICAgICAgICAgICAgICAgIG5BZGRJRUxlbiApOworICAgICAgICBuUGF5bG9hZCArPSBuQWRkSUVMZW47CisgICAgfQorCisgICAgcHNlc3Npb25FbnRyeS0+YXNzb2NSZXEgPSB2b3NfbWVtX21hbGxvYyhuUGF5bG9hZCk7CisgICAgaWYgKCBOVUxMID09IHBzZXNzaW9uRW50cnktPmFzc29jUmVxICkKKyAgICB7CisgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlVuYWJsZSB0byBhbGxvY2F0ZSBtZW1vcnkgdG8gc3RvcmUgYXNzb2MgcmVxdWVzdCIpKTspCisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIC8vU3RvcmUgdGhlIEFzc29jIHJlcXVlc3QuIFRoaXMgaXMgc2VudCB0byBjc3IvaGRkIGluIGpvaW4gY25mIHJlc3BvbnNlLiAKKyAgICAgICAgdm9zX21lbV9jb3B5KHBzZXNzaW9uRW50cnktPmFzc29jUmVxLCBwRnJhbWUgKyBzaXplb2YodFNpck1hY01nbXRIZHIpLCBuUGF5bG9hZCk7CisgICAgICAgIHBzZXNzaW9uRW50cnktPmFzc29jUmVxTGVuID0gblBheWxvYWQ7CisgICAgfQorCisgICAgaWYoICggU0lSX0JBTkRfNV9HSFogPT0gbGltR2V0UkZCYW5kKHBzZXNzaW9uRW50cnktPmN1cnJlbnRPcGVyQ2hhbm5lbCkpCisgICAgICAgfHwgKCBwc2Vzc2lvbkVudHJ5LT5wZVBlcnNvbmEgPT0gVk9TX1AyUF9DTElFTlRfTU9ERSApIHx8CisgICAgICAgICAoIHBzZXNzaW9uRW50cnktPnBlUGVyc29uYSA9PSBWT1NfUDJQX0dPX01PREUpCisgICAgICAgICApCisgICAgeworICAgICAgICB0eEZsYWcgfD0gSEFMX1VTRV9CRF9SQVRFMl9GT1JfTUFOQUdFTUVOVF9GUkFNRTsKKyAgICB9CisKKyAgICBpZihwc2Vzc2lvbkVudHJ5LT5wZVBlcnNvbmEgPT0gVk9TX1AyUF9DTElFTlRfTU9ERSB8fAorICAgICAgIHBzZXNzaW9uRW50cnktPnBlUGVyc29uYSA9PSBWT1NfU1RBX01PREUpCisgICAgeworICAgICAgICB0eEZsYWcgfD0gSEFMX1VTRV9QRUVSX1NUQV9SRVFVRVNURURfTUFTSzsKKyAgICB9CisKKyAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9NR01ULAorICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwKKyAgICAgICAgICAgcE1hY0hkci0+ZmMuc3ViVHlwZSkpOworCisgICAgaWYgKElTX0ZFQVRVUkVfU1VQUE9SVEVEX0JZX0ZXKEVOSEFOQ0VEX1RYQkRfQ09NUExFVElPTikpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlJlYXNzb2MgcmVxIC0gdHhCZFRva2VuICV1IiksIHBNYWMtPmxpbS50eEJkVG9rZW4pOworICAgICAgICBoYWxzdGF0dXMgPSBoYWxUeEZyYW1lV2l0aFR4Q29tcGxldGUoIHBNYWMsIHBQYWNrZXQsCisgICAgICAgICAgICAgICAgKCB0QU5JX1UxNiApIChzaXplb2YodFNpck1hY01nbXRIZHIpICsgblBheWxvYWQpLAorICAgICAgICAgICAgICAgIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwgQU5JX1RYRElSX1RPRFMsCisgICAgICAgICAgICAgICAgNywvL1NNQUNfU1dCRF9UWF9USURfTUdNVF9ISUdILAorICAgICAgICAgICAgICAgIGxpbVR4Q29tcGxldGUsIHBGcmFtZSwgbGltVHhCZENvbXBsZXRlLAorICAgICAgICAgICAgICAgIHR4RmxhZywgcE1hYy0+bGltLnR4QmRUb2tlbiApOworICAgICAgICBwTWFjLT5saW0udHhCZFRva2VuKys7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGhhbHN0YXR1cyA9IGhhbFR4RnJhbWUoIHBNYWMsIHBQYWNrZXQsICggdEFOSV9VMTYgKSAoc2l6ZW9mKHRTaXJNYWNNZ210SGRyKSArIG5QYXlsb2FkKSwKKyAgICAgICAgICAgICAgICBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgQU5JX1RYRElSX1RPRFMsCisgICAgICAgICAgICAgICAgNywvL1NNQUNfU1dCRF9UWF9USURfTUdNVF9ISUdILAorICAgICAgICAgICAgICAgIGxpbVR4Q29tcGxldGUsIHBGcmFtZSwgdHhGbGFnICk7CisgICAgfQorICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RYX0NPTVBMRVRFLAorICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwKKyAgICAgICAgICAgaGFsc3RhdHVzKSk7CisgICAgaWYgKCAhIEhBTF9TVEFUVVNfU1VDQ0VTUyAoIGhhbHN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBzZW5kIFJlLUFzc29jaWF0aW9uIFJlcXVlc3QiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiglWCkhIiksCisgICAgICAgICAgICAgICAgblNpclN0YXR1cyApOworICAgICAgICAvL1BrdCB3aWxsIGJlIGZyZWVkIHVwIGJ5IHRoZSBjYWxsYmFjaworICAgICAgICBnb3RvIGVuZDsKKyAgICB9CisKKyAgICAvLyBlbmFibGUgY2FjaGluZworICAgIFdMQU5UTF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JlIHNldCBpbiBGQyB3aGlsZSBzZW5kaW5nCisgKiBBdXRoZW50aWNhdGlvbiBmcmFtZTMKKyAqCisgKgorICogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgYnkgbGltUHJvY2Vzc01sbU1lc3NhZ2VzKCkuICBBdXRoZW50aWNhdGlvbiBmcmFtZQorICogaXMgZm9ybWF0dGVkIGFuZCBzZW50IHdoZW4gdGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQuCisgKgorICoKKyAqLworCit2b2lkCitsaW1TZW5kQXV0aE1nbXRGcmFtZSh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgdHBTaXJNYWNBdXRoRnJhbWVCb2R5IHBBdXRoRnJhbWVCb2R5LAorICAgICAgICAgICAgICAgICAgICAgdFNpck1hY0FkZHIgICAgICAgICAgIHBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAgICAgICAgICAgICAgIHdlcEJpdCwKKyAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LAorICAgICAgICAgICAgICAgICAgICAgdEFuaUJvb2wgICAgICAgICAgICAgIHdhaXRGb3JBY2sKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApCit7CisgICAgdEFOSV9VOCAgICAgICAgICAgICpwRnJhbWUsICpwQm9keTsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgIGZyYW1lTGVuID0gMCwgYm9keUxlbiA9IDA7CisgICAgdHBTaXJNYWNNZ210SGRyICAgICBwTWFjSGRyOworICAgIHRBTklfVTE2ICAgICAgICAgICAgaTsKKyAgICB2b2lkICAgICAgICAgICAgICAgKnBQYWNrZXQ7CisgICAgZUhhbFN0YXR1cyAgICAgICAgICBoYWxzdGF0dXM7CisgICAgdEFOSV9VMzIgICAgICAgICAgICB0eEZsYWcgPSAwOworCisgICAgaW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AgICAgICAqLworCisgICAgICAgIGZyYW1lTGVuID0gc2l6ZW9mKHRTaXJNYWNNZ210SGRyKSArIExJTV9FTkNSX0FVVEhfQk9EWV9MRU47CisKKyAgICAgICAgYm9keUxlbiA9IExJTV9FTkNSX0FVVEhfQk9EWV9MRU47CisgICAgfSAvLyBpZiAod2VwQml0ID09IExJTV9XRVBfSU5fRkMpCisgICAgZWxzZQorICAgIHsKKyAgICAgICAgc3dpdGNoIChwQXV0aEZyYW1lQm9keS0+YXV0aFRyYW5zYWN0aW9uU2VxTnVtYmVyKQorICAgICAgICB7CisgICAgICAgICAgICBjYXNlIFNJUl9NQUNfQVVUSF9GUkFNRV8xOgorICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAqIEFsbG9jYXRlIGJ1ZmZlciBmb3IgQXV0aGVudGljYXRvbiBmcmFtZSBvZiBzaXplCisgICAgICAgICAgICAgICAgICogZXF1YWwgdG8gbWFuYWdlbWVudCBmcmFtZSBoZWFkZXIgbGVuZ3RoIHBsdXMgMiBieXRlcworICAgICAgICAgICAgICAgICAqIGVhY2ggZm9yIGF1dGggYWxnb3JpdGhtIG51bWJlciwgdHJhbnNhY3Rpb24gbnVtYmVyCisgICAgICAgICAgICAgICAgICogYW5kIHN0YXR1cyBjb2RlLgorICAgICAgICAgICAgICAgICAqLworCisgICAgICAgICAgICAgICAgZnJhbWVMZW4gPSBzaXplb2YodFNpck1hY01nbXRIZHIpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfQVVUSF9DSEFMTEVOR0VfT0ZGU0VUOworICAgICAgICAgICAgICAgIGJvZHlMZW4gID0gU0lSX01BQ19BVVRIX0NIQUxMRU5HRV9PRkZTRVQ7CisKKyNpZiBkZWZpbmVkIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCisgICAgICAgICAgICBpZiAocEF1dGhGcmFtZUJvZHktPmF1dGhBbGdvTnVtYmVyID09IGVTSVJfRlRfQVVUSCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoMCAhPSBwTWFjLT5mdC5mdFBFQ29udGV4dC5wRlRQcmVBdXRoUmVxLT5mdF9pZXNfbGVuZ3RoKSAKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGZyYW1lTGVuICs9IHBNYWMtPmZ0LmZ0UEVDb250ZXh0LnBGVFByZUF1dGhSZXEtPmZ0X2llc19sZW5ndGg7CisgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0czLCBGTCgiQXV0aCBmcmFtZSwgRlRJRVMgbGVuZ3RoIGFkZGVkPSVkIiksCisgICAgICAgICAgICAgICAgICAgIHBNYWMtPmZ0LmZ0UEVDb250ZXh0LnBGVFByZUF1dGhSZXEtPmZ0X2llc19sZW5ndGgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMywgRkwoIkF1dGggZnJhbWUsIERvZXMgbm90IGNvbnRhaW4gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkZUSUVTISEhIikpOworICAgICAgICAgICAgICAgICAgICBmcmFtZUxlbiArPSAoMitTSVJfTURJRV9TSVpFKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBTSVJfTUFDX0FVVEhfRlJBTUVfMjoKKyAgICAgICAgICAgICAgICBpZiAoKHBBdXRoRnJhbWVCb2R5LT5hdXRoQWxnb051bWJlciA9PSBlU0lSX09QRU5fU1lTVEVNKSB8fAorICAgICAgICAgICAgICAgICAgICAoKHBBdXRoRnJhbWVCb2R5LT5hdXRoQWxnb051bWJlciA9PSBlU0lSX1NIQVJFRF9LRVkpICYmCisgICAgICAgICAgICAgICAgICAgICAocEF1dGhGcmFtZUJvZHktPmF1dGhTdGF0dXNDb2RlICE9IGVTSVJfTUFDX1NVQ0NFU1NfU1RBVFVTKSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgICAgICogQWxsb2NhdGUgYnVmZmVyIGZvciBBdXRoZW50aWNhdG9uIGZyYW1lIG9mIHNpemUKKyAgICAgICAgICAgICAgICAgICAgICogZXF1YWwgdG8gbWFuYWdlbWVudCBmcmFtZSBoZWFkZXIgbGVuZ3RoIHBsdXMKKyAgICAgICAgICAgICAgICAgICAgICogMiBieXRlcyBlYWNoIGZvciBhdXRoIGFsZ29yaXRobSBudW1iZXIsCisgICAgICAgICAgICAgICAgICAgICAqIHRyYW5zYWN0aW9uIG51bWJlciBhbmQgc3RhdHVzIGNvZGUuCisgICAgICAgICAgICAgICAgICAgICAqLworCisgICAgICAgICAgICAgICAgICAgIGZyYW1lTGVuID0gc2l6ZW9mKHRTaXJNYWNNZ210SGRyKSArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX01BQ19BVVRIX0NIQUxMRU5HRV9PRkZTRVQ7CisgICAgICAgICAgICAgICAgICAgIGJvZHlMZW4gPSBTSVJfTUFDX0FVVEhfQ0hBTExFTkdFX09GRlNFVDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gU2hhcmVkIEtleSBhbGdvcml0aG0gd2l0aCBjaGFsbGVuZ2UgdGV4dAorICAgICAgICAgICAgICAgICAgICAvLyB0byBiZSBzZW50CisgICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgKiBBbGxvY2F0ZSBidWZmZXIgZm9yIEF1dGhlbnRpY2F0b24gZnJhbWUgb2Ygc2l6ZQorICAgICAgICAgICAgICAgICAgICAgKiBlcXVhbCB0byBtYW5hZ2VtZW50IGZyYW1lIGhlYWRlciBsZW5ndGggcGx1cworICAgICAgICAgICAgICAgICAgICAgKiAyIGJ5dGVzIGVhY2ggZm9yIGF1dGggYWxnb3JpdGhtIG51bWJlciwKKyAgICAgICAgICAgICAgICAgICAgICogdHJhbnNhY3Rpb24gbnVtYmVyLCBzdGF0dXMgY29kZSBhbmQgMTI4IGJ5dGVzCisgICAgICAgICAgICAgICAgICAgICAqIGZvciBjaGFsbGVuZ2UgdGV4dC4KKyAgICAgICAgICAgICAgICAgICAgICovCisKKyAgICAgICAgICAgICAgICAgICAgZnJhbWVMZW4gPSBzaXplb2YodFNpck1hY01nbXRIZHIpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0F1dGhGcmFtZSk7CisgICAgICAgICAgICAgICAgICAgIGJvZHlMZW4gID0gc2l6ZW9mKHRTaXJNYWNBdXRoRnJhbWVCb2R5KTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBTSVJfTUFDX0FVVEhfRlJBTUVfMzoKKyAgICAgICAgICAgICAgICAvLy8gQXV0aCBmcmFtZTMgdG8gYmUgc2VudCB3aXRob3V0IGVuY3J5cHRlZCBmcmFtZWJvZHkKKyAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgKiBBbGxvY2F0ZSBidWZmZXIgZm9yIEF1dGhlbnRpY2F0b24gZnJhbWUgb2Ygc2l6ZSBlcXVhbAorICAgICAgICAgICAgICAgICAqIHRvIG1hbmFnZW1lbnQgZnJhbWUgaGVhZGVyIGxlbmd0aCBwbHVzIDIgYnl0ZXMgZWFjaAorICAgICAgICAgICAgICAgICAqIGZvciBhdXRoIGFsZ29yaXRobSBudW1iZXIsIHRyYW5zYWN0aW9uIG51bWJlciBhbmQKKyAgICAgICAgICAgICAgICAgKiBzdGF0dXMgY29kZS4KKyAgICAgICAgICAgICAgICAgKi8KKworICAgICAgICAgICAgICAgIGZyYW1lTGVuID0gc2l6ZW9mKHRTaXJNYWNNZ210SGRyKSArCisgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX0FVVEhfQ0hBTExFTkdFX09GRlNFVDsKKyAgICAgICAgICAgICAgICBib2R5TGVuICA9IFNJUl9NQUNfQVVUSF9DSEFMTEVOR0VfT0ZGU0VUOworCisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgU0lSX01BQ19BVVRIX0ZSQU1FXzQ6CisgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICogQWxsb2NhdGUgYnVmZmVyIGZvciBBdXRoZW50aWNhdG9uIGZyYW1lIG9mIHNpemUgZXF1YWwKKyAgICAgICAgICAgICAgICAgKiB0byBtYW5hZ2VtZW50IGZyYW1lIGhlYWRlciBsZW5ndGggcGx1cyAyIGJ5dGVzIGVhY2gKKyAgICAgICAgICAgICAgICAgKiBmb3IgYXV0aCBhbGdvcml0aG0gbnVtYmVyLCB0cmFuc2FjdGlvbiBudW1iZXIgYW5kCisgICAgICAgICAgICAgICAgICogc3RhdHVzIGNvZGUuCisgICAgICAgICAgICAgICAgICovCisKKyAgICAgICAgICAgICAgICBmcmFtZUxlbiA9IHNpemVvZih0U2lyTWFjTWdtdEhkcikgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX01BQ19BVVRIX0NIQUxMRU5HRV9PRkZTRVQ7CisgICAgICAgICAgICAgICAgYm9keUxlbiAgPSBTSVJfTUFDX0FVVEhfQ0hBTExFTkdFX09GRlNFVDsKKworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9IC8vIHN3aXRjaCAocEF1dGhGcmFtZUJvZHktPmF1dGhUcmFuc2FjdGlvblNlcU51bWJlcikKKyAgICB9IC8vIGVuZCBpZiAod2VwQml0ID09IExJTV9XRVBfSU5fRkMpCisKKworICAgIGhhbHN0YXR1cyA9IHBhbFBrdEFsbG9jKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GU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AvLyBQcmVwYXJlIEJTU0lkCisgICAgaWYoICAocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0FQX1JPTEUpfHwgKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9CVF9BTVBfQVBfUk9MRSkgKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9jb3B5KCAodEFOSV9VOCAqKSBwTWFjSGRyLT5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSBwc2Vzc2lvbkVudHJ5LT5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoIHRTaXJNYWNBZGRyICkpOworICAgIH0KKworICAgIC8vLyBQcmVwYXJlIEF1dGhlbnRpY2F0aW9uIGZyYW1lIGJvZHkKKyAgICBwQm9keSAgICA9IHBGcmFtZSArIHNpemVvZih0U2lyTWFjTWdtdEhkcik7CisKKyAgICBpZiAod2VwQml0ID09IExJTV9XRVBfSU5fRkMpCisgICAgeworICAgICAgICB2b3NfbWVtX2NvcHkocEJvZHksICh0QU5JX1U4ICopIHBBdXRoRnJhbWVCb2R5LCBib2R5TGVuKTsKKworICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgRkwoIioqKiBTZW5kaW5nIEF1dGggc2VxIyAzIHN0YXR1cyAlZCAoJWQpIHRvIk1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgIHBBdXRoRnJhbWVCb2R5LT5hdXRoU3RhdHVzQ29kZSwKKyAgICAgICAgICAgKHBBdXRoRnJhbWVCb2R5LT5hdXRoU3RhdHVzQ29kZSA9PSBlU0lSX01BQ19TVUNDRVNTX1NUQVRVUyksCisgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBNYWNIZHItPmRhKSk7CisKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgKigodEFOSV9VMTYgKikocEJvZHkpKSA9IHNpclN3YXBVMTZpZk5lZWRlZChwQXV0aEZyYW1lQm9keS0+YXV0aEFsZ29OdW1iZXIpOworICAgICAgICBwQm9keSAgICs9IHNpemVvZih0QU5JX1UxNik7CisgICAgICAgIGJvZHlMZW4gLT0gc2l6ZW9mKHRBTklfVTE2KTsKKworICAgICAgICAqKCh0QU5JX1UxNiAqKShwQm9keSkpID0gc2lyU3dhcFUxNmlmTmVlZGVkKHBBdXRoRnJhbWVCb2R5LT5hdXRoVHJhbnNhY3Rpb25TZXFOdW1iZXIpOworICAgICAgICBwQm9keSAgICs9IHNpemVvZih0QU5JX1UxNik7CisgICAgICAgIGJvZHlMZW4gLT0gc2l6ZW9mKHRBTklfVTE2KTsKKworICAgICAgICAqKCh0QU5JX1UxNiAqKShwQm9keSkpID0gc2lyU3dhcFUxNmlmTmVlZGVkKHBBdXRoRnJhbWVCb2R5LT5hdXRoU3RhdHVzQ29kZSk7CisgICAgICAgIHBCb2R5ICAgKz0gc2l6ZW9mKHRBTklfVTE2KTsKKyAgICAgICAgYm9keUxlbiAtPSBzaXplb2YodEFOSV9VMTYpOworICAgICAgICBpZiAoIGJvZHlMZW4gPD0gKHNpemVvZiAocEF1dGhGcmFtZUJvZHktPnR5cGUpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YgKHBBdXRoRnJhbWVCb2R5LT5sZW5ndGgpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YgKHBBdXRoRnJhbWVCb2R5LT5jaGFsbGVuZ2VUZXh0KSkpCisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocEJvZHksICh0QU5JX1U4ICopICZwQXV0aEZyYW1lQm9keS0+dHlwZSwgYm9keUxlbik7CisKKyNpZiBkZWZpbmVkIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCisgICAgICAgIGlmICgocEF1dGhGcmFtZUJvZHktPmF1dGhBbGdvTnVtYmVyID09IGVTSVJfRlRfQVVUSCkgJiYgCisgICAgICAgICAgICAgICAgKHBBdXRoRnJhbWVCb2R5LT5hdXRoVHJhbnNhY3Rpb25TZXFOdW1iZXIgPT0gU0lSX01BQ19BVVRIX0ZSQU1FXzEpKQorICAgICAgICB7CisKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpbnQgaSA9IDA7CisgICAgICAgICAgICAgICAgaWYgKHBNYWMtPmZ0LmZ0UEVDb250ZXh0LnBGVFByZUF1dGhSZXEtPmZ0X2llc19sZW5ndGgpIAorICAgICAgICAgICAgICAgIHsKKyNpZiBkZWZpbmVkIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSX0RFQlVHCisgICAgICAgICAgICAgICAgICAgIFBFTE9HMihsaW1Mb2cocE1hYywgTE9HMiwgRkwoIkF1dGgxIEZyYW1lIEZUSUUgaXM6ICIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNpckR1bXBCdWYocE1hYywgU0lSX0xJTV9NT0RVTEVfSUQsIExPRzIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTggKilwQm9keSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAocE1hYy0+ZnQuZnRQRUNvbnRleHQucEZUUHJlQXV0aFJlcS0+ZnRfaWVzX2xlbmd0aCkpOykKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICBmb3IgKGk9MDsgaTxwTWFjLT5mdC5mdFBFQ29udGV4dC5wRlRQcmVBdXRoUmVxLT5mdF9pZXNfbGVuZ3RoOyBpKyspCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICpwQm9keSA9IHBNYWMtPmZ0LmZ0UEVDb250ZXh0LnBGVFByZUF1dGhSZXEtPmZ0X2llc1tpXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBCb2R5Kys7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsgCisgICAgICAgICAgICAgICAgICAgIC8qIE1ESUQgYXR0ciBpcyA1NCovCisgICAgICAgICAgICAgICAgICAgICpwQm9keSA9IDU0OworICAgICAgICAgICAgICAgICAgICBwQm9keSsrOworICAgICAgICAgICAgICAgICAgICAqcEJvZHkgPSBTSVJfTURJRV9TSVpFOworICAgICAgICAgICAgICAgICAgICBwQm9keSsrOworICAgICAgICAgICAgICAgICAgICBmb3IoaT0wO2k8U0lSX01ESUVfU0laRTtpKyspCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAqcEJvZHkgPSBwTWFjLT5mdC5mdFBFQ29udGV4dC5wRlRQcmVBdXRoUmVxLT5wYnNzRGVzY3JpcHRpb24tPm1kaWVbaV07CisgICAgICAgICAgICAgICAgICAgICAgIHBCb2R5Kys7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyNlbmRpZgorCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICBGTCgiKioqIFNlbmRpbmcgQXV0aCBzZXEjICVkIHN0YXR1cyAlZCAoJWQpIHRvICJNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICBwQXV0aEZyYW1lQm9keS0+YXV0aFRyYW5zYWN0aW9uU2VxTnVtYmVyLAorICAgICAgICAgICBwQXV0aEZyYW1lQm9keS0+YXV0aFN0YXR1c0NvZGUsCisgICAgICAgICAgIChwQXV0aEZyYW1lQm9keS0+YXV0aFN0YXR1c0NvZGUgPT0gZVNJUl9NQUNfU1VDQ0VTU19TVEFUVVMpLAorICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwTWFjSGRyLT5kYSkpOworICAgIH0KKyAgICBQRUxPRzIoc2lyRHVtcEJ1ZihwTWFjLCBTSVJfTElNX01PRFVMRV9JRCwgTE9HMiwgcEZyYW1lLCBmcmFtZUxlbik7KQorCisgICAgaWYoICggU0lSX0JBTkRfNV9HSFogPT0gbGltR2V0UkZCYW5kKHBzZXNza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iksIHdhaXRGb3JBY2ssIE1BQ19BRERSX0FSUkFZKHBNYWNIZHItPmRhKSwKKyAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocHNlc3Npb25FbnRyeS0+c2VsZk1hY0FkZHIpKTsKKworICAgIHR4RmxhZyB8PSBIQUxfVVNFX0ZXX0lOX1RYX1BBVEg7CisKKyAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9NR01ULAorICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwKKyAgICAgICAgICAgcE1hY0hkci0+ZmMuc3ViVHlwZSkpOworCisgICAgaWYoICggcHNlc3Npb25FbnRyeS0+aXMxMUdvbmx5ID09IHRydWUgKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgKCAhSVNfQlJPQURDQVNUX01BQyhwZWVyTWFjQWRkcikgKSApeworICAgICAgICAgdHhGbGFnIHw9IEhBTF9VU0VfQkRfUkFURTJfRk9SX01BTkFHRU1FTlRfRlJBTUU7CisgICAgfQorICAgIGlmKGVTSVJfVFJVRSA9PSB3YWl0Rm9yQWNrKQorICAgIHsKKyAgICAgICAgcE1hYy0+YXV0aEFja1N0YXR1cyA9IExJTV9BVVRIX0FDS19OT1RfUkNEOworICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIkF1dGggZnJhbWUgLSB0eEJkVG9rZW4gJXUiKSwKKyAgICAgICAgICAgICAgICBwTWFjLT5saW0udHhCZFRva2VuKTsKKyAgICAgICAgaGFsc3RhdHVzID0gaGFsVHhGcmFtZVdpdGhUeENvbXBsZXRlKCBwTWFjLCBwUGFja2V0LAorICAgICAgICAgICAgICAgICAgICAoIHRBTklfVTE2ICkgZnJhbWVMZW4sCisgICAgICAgICAgICAgICAgICAgIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICAgICAgICAgQU5JX1RYRElSX1RPRFMsCisgICAgICAgICAgICAgICAgICAgIDcsLy9TTUFDX1NXQkRfVFhfVElEX01HTVRfSElHSCwKKyAgICAgICAgICAgICAgICAgICAgbGltVHhDb21wbGV0ZSwgcEZyYW1lLCBsaW1BdXRoVHhDb21wbGV0ZUNuZiwgdHhGbGFnLAorICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0udHhCZFRva2VuKTsKKyAgICAgICAgcE1hYy0+bGltLnR4QmRUb2tlbisrOworICAgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9DT01QTEVURSwKKyAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLAorICAgICAgICAgICAgICAgaGFsc3RhdHVzKSk7CisgICAgICAgIGlmICghSEFMX1NUQVRVU19TVUNDRVNTKGhhbHN0YXR1cykpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwKKyAgICAgICAgICAgICBGTCgiQ291bGQgbm90IHNlbmQgQXV0aCBmcmFtZSwgcmV0Q29kZT0lWCAiKSwKKyAgICAgICAgICAgICAgICAgICAgaGFsc3RhdHVzICk7CisgICAgICAgICAgICBwTWFjLT5hdXRoQWNrU3RhdHVzID0gTElNX0FVVEhfQUNLX1JDRF9GQUlMVVJFOworICAgICAgICAgICAgLy9Qa3Qgd2lsbCBiZSBmcmVlZCB1cCBieSB0aGUgY2FsbGJhY2sKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgLy8vIFF1ZXVlIEF1dGhlbnRpY2F0aW9uIGZyYW1lIGluIGhpZ2ggcHJpb3JpdHkgV1EKKyAgICAgIGhhbHN0YXR1cyA9IGhhbFR4RnJhbWUoIHBNYWMsIHBQYWNrZXQsICggdEFOSV9VMTYgKSBmcmFtZUxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQU5JX1RYRElSX1RPRFMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgNywvL1NNQUNfU1dCRF9UWF9USURfTUdNVF9ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVR4Q29tcGxldGUsIHBGcmFtZSwgdHhGbGFnICk7CisgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9DT01QTEVURSwKKyAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgICAgIGhhbHN0YXR1cykpOworICAgICAgaWYgKCAhIEhBTF9TVEFUVVNfU1VDQ0VTUyAoIGhhbHN0YXR1cyApICkKKyAgICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICBGTCgiKioqIENvdWxkIG5vdCBzZW5kIEF1dGggZnJhbWUsIHJldENvZGU9JVggKioqIiksCisgICAgICAgICAgICAgICBoYWxzdGF0dXMpOworCisgICAgICAgIC8vUGt0IHdpbGwgYmUgZnJlZWQgdXAgYnkgdGhlIGNhbGxiYWNrCisgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuOworfSAvKioqIGVuZCBsaW1TZW5kQXV0aE1nbXRGcmFtZSgpICoqKi8KKworZUhhbFN0YXR1cyBsaW1TZW5kRGVhdXRoQ25mKHRwQW5pU2lyR2xvYmFsIHBNYWMpCit7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgYWlkOworICAgIHRwRHBoSGFzaE5vZGUgICAgICAgICAgIHBTdGFEczsKKyAgICB0TGltTWxtRGVhdXRoUmVxICAgICAgICAqcE1sbURlYXV0aFJlcTsKKyAgICB0TGltTWxtRGVhdXRoQ25mICAgICAgICBtbG1EZWF1dGhDbmY7CisgICAgdHBQRVNlc3Npb24gICAgICAgICAgICAgcHNlc3Npb25FbnRyeTsKKworICAgIHBNbG1EZWF1dGhSZXEgPSBwTWFjLT5saW0ubGltRGlzYXNzb2NEZWF1dGhDbmZSZXEucE1sbURlYXV0aFJlcTsKKyAgICBpZiAocE1sbURlYXV0aFJlcSkKKyAgICB7CisgICAgICAgIGlmICh0eF90aW1lcl9ydW5uaW5nKCZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1EZWF1dGhBY2tUaW1lcikpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbURlYWN0aXZhdGVBbmRDaGFuZ2VUaW1lcihwTWFjLCBlTElNX0RFQVVUSF9BQ0tfVElNRVIpOworICAgICAgICB9CisKKyAgICAgICAgaWYoKHBzZXNzaW9uRW50cnkgPSBwZUZpbmRTZXNzaW9uQnlTZXNzaW9uSWQocE1hYywgcE1sbURlYXV0aFJlcS0+c2Vzc2lvbklkKSk9PSBOVUxMKQorICAgICAgICB7CisKKyAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJzZXNzaW9uIGRvZXMgbm90IGV4aXN0IGZvciBnaXZlbiBzZXNzaW9uSWQiKSk7KQorICAgICAgICAgICAgICAgIG1sbURlYXV0aENuZi5yZXN1bHRDb2RlID0gZVNJUl9TTUVfSU5WQUxJRF9QQVJBTUVURVJTOworICAgICAgICAgICAgZ290byBlbmQ7CisgICAgICAgIH0KKworICAgICAgICBwU3RhRHMgPSBkcGhMb29rdXBIYXNoRW50cnkocE1hYywgcE1sbURlYXV0aFJlcS0+cGVlck1hY0FkZHIsICZhaWQsICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsKKyAgICAgICAgaWYgKHBTdGFEcyA9PSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgICBtbG1EZWF1dGhDbmYucmVzdWx0Q29kZSA9IGVTSVJfU01FX0lOVkFMSURfUEFSQU1FVEVSUzsKKyAgICAgICAgICAgIGdvdG8gZW5kOworICAgICAgICB9CisKKyAgICAgICAgLy8vIFJlY2VpdmUgcGF0aCBjbGVhbnVwIHdpdGggZHVtbXkgcGFja2V0CisgICAgICAgIGxpbUNsZWFudXBSeFBhdGgocE1hYywgcFN0YURzLHBzZXNzaW9uRW50cnkpOworCisjaWZkZWYgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIKKyAgICAgICAgaWYgICggcHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX1NUQV9ST0xFICkKKyAgICAgICAgeworICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgICAgIEZMKCJGVCBQcmVhdXRoIFNlc3Npb25JZCAlZCBDbGVhbnVwIgorI2lmZGVmIEZFQVRVUkVfV0xBTl9FU0UKKyAgICAgICAgICAgICAgICAgICAiIGlzRVNFICVkIgorI2VuZGlmCisjaWZkZWYgRkVBVFVSRV9XTEFOX0xGUgorICAgICAgICAgICAgICAgICAgICIgaXNMRlIgJWQiCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAiIGlzMTFyICVkLCBEZWF1dGggcmVhc29uICVkIFRyaWdnZXIgPSAlZCIpLAorICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLAorI2lmZGVmIEZFQVRVUkVfV0xBTl9FU0UKKyAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5pc0VTRWNvbm5lY3Rpb24sCisjZW5kaWYKKyNpZmRlZiBGRUFUVVJFX1dMQU5fTEZSCisgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+aXNGYXN0Um9hbUluaUZlYXR1cmVFbmFibGVkLAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+aXMxMVJjb25uZWN0aW9uLAorICAgICAgICAgICAgICAgICAgIHBNbG1EZWF1dGhSZXEtPnJlYXNvbkNvZGUsCisgICAgICAgICAgICAgICAgICAgcE1sbURlYXV0aFJlcS0+ZGVhdXRoVHJpZ2dlcik7KTsKKworICAgICAgICAgICAgbGltRl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9iYWwgcE1hYykKK3sKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgICAgYWlkOworICAgIHRwRHBoSGFzaE5vZGUgICAgICAgICAgICBwU3RhRHM7CisgICAgdExpbU1sbURpc2Fzc29jQ25mICAgICAgIG1sbURpc2Fzc29jQ25mOworICAgIHRwUEVTZXNzaW9uICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5OworICAgIHRMaW1NbG1EaXNhc3NvY1JlcSAgICAgICAqcE1sbURpc2Fzc29jUmVxOworCisgICAgcE1sbURpc2Fzc29jUmVxID0gcE1hYy0+bGltLmxpbURpc2Fzc29jRGVhdXRoQ25mUmVxLnBNbG1EaXNhc3NvY1JlcTsKKyAgICBpZiAocE1sbURpc2Fzc29jUmVxKQorICAgIHsKKyAgICAgICAgaWYgKHR4X3RpbWVyX3J1bm5pbmcoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbURpc2Fzc29jQWNrVGltZXIpKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1EZWFjdGl2YXRlQW5kQ2hhbmdlVGltZXIocE1hYywgZUxJTV9ESVNBU1NPQ19BQ0tfVElNRVIpOworICAgICAgICB9CisKKyAgICAgICAgaWYoKHBzZXNzaW9uRW50cnkgPSBwZUZpbmRTZXNzaW9uQnlTZXNzaW9uSWQocE1hYywgcE1sbURpc2Fzc29jUmVxLT5zZXNzaW9uSWQpKT09IE5VTEwpCisgICAgICAgIHsKKworICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgRkwoInNlc3Npb24gZG9lcyBub3QgZXhpc3QgZm9yIGdpdmVuIHNlc3Npb25JZCIpKTspCisgICAgICAgICAgICAgICAgbWxtRGlzYXNzb2NDbmYucmVzdWx0Q29kZSA9IGVTSVJfU01FX0lOVkFMSURfUEFSQU1FVEVSUzsKKyAgICAgICAgICAgIGdvdG8gZW5kOworICAgICAgICB9CisKKyAgICAgICAgcFN0YURzID0gZHBoTG9va3VwSGFzaEVudHJ5KHBNYWMsIHBNbG1EaXNhc3NvY1JlcS0+cGVlck1hY0FkZHIsICZhaWQsICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsKKyAgICAgICAgaWYgKHBTdGFEcyA9PSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICBGTCgiU3RhRHMgTnVsbCIpKTsKKyAgICAgICAgICAgIG1sbURpc2Fzc29jQ25mLnJlc3VsdENvZGUgPSBlU0lSX1NNRV9JTlZBTElEX1BBUkFNRVRFUlM7CisgICAgICAgICAgICBnb3RvIGVuZDsKKyAgICAgICAgfQorCisgICAgICAgIC8vLyBSZWNlaXZlIHBhdGggY2xlYW51cCB3aXRoIGR1bW15IHBhY2tldAorICAgICAgICBpZihlU0lSX1NVQ0NFU1MgIT0gbGltQ2xlYW51cFJ4UGF0aChwTWFjLCBwU3RhRHMsIHBzZXNzaW9uRW50cnkpKQorICAgICAgICB7CisgICAgICAgICAgICBtbG1EaXNhc3NvY0NuZi5yZXN1bHRDb2RlID0gZVNJUl9TTUVfUkVTT1VSQ0VTX1VOQVZBSUxBQkxFOworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgRkwoIkNsZWFudXBSeFBhdGggZXJyb3IiKSk7CisgICAgICAgICAgICBnb3RvIGVuZDsKKyAgICAgICAgfQorCisjaWZkZWYgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIKKyAgICAgICAgaWYgICggKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9TVEFfUk9MRSApICYmIAorICAgICAgICAgICAgICAgIChwTWxtRGlzYXNzb2NSZXEtPnJlYXNvbkNvZGUgIT0KKyAgICAgICAgICAgICAgICAgZVNJUl9NQUNfRElTQVNTT0NfRFVFX1RPX0ZUSEFORE9GRl9SRUFTT04pKQorICAgICAgICB7CisgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgICAgRkwoIkZUIFByZWF1dGggU2Vzc2lvbklkICVkIENsZWFudXAiCisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRQorICAgICAgICAgICAgICAgICAgICIgaXNFU0UgJWQiCisjZW5kaWYKKyNpZmRlZiBGRUFUVVJFX1dMQU5fTEZSCisgICAgICAgICAgICAgICAgICAgIiBpc0xGUiAlZCIKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICIgaXMxMXIgJWQgcmVhc29uICVkIiksCisgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRQorICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmlzRVNFY29ubmVjdGlvbiwKKyNlbmRpZgorI2lmZGVmIEZFQVRVUkVfV0xBTl9MRlIKKyAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5pc0Zhc3RSb2FtSW5pRmVhdHVyZUVuYWJsZWQsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5pczExUmNvbm5lY3Rpb24sCisgICAgICAgICAgICAgICAgICAgcE1sbURpc2Fzc29jUmVxLT5yZWFzb25Db2RlKTspOworICAgICAgICAgICAgbGltRlRDbGVhbnVwKHBNYWMpOworICAgICAgICB9CisjZW5kaWYKKworICAgICAgICAvLy8gRnJlZSB1cCBidWZmZXIgYWxsb2NhdGVkIGZvciBtbG1EaXNhc3NvY1JlcQorICAgICAgICB2b3NfbWVtX2ZyZWUocE1sbURpc2Fzc29jUmVxKTsKKyAgICAgICAgcE1hYy0+bGltLmxpbURpc2Fzc29jRGVhdXRoQ25mUmVxLnBNbG1EaXNhc3NvY1JlcSA9IE5VTEw7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVR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Y1R4Q29tcGxldGVDbmYodHBBbmlTaXJHbG9iYWwgcE1hYywgdm9pZCAqcERhdGEpCit7CisgICAgaWYgKHBEYXRhICYmIElTX0ZFQVRVUkVfU1VQUE9SVEVEX0JZX0ZXKEVOSEFOQ0VEX1RYQkRfQ09NUExFVElPTikpCisgICAgeworICAgICAgICB0cFNpclR4QmRTdGF0dXMgcFR4QmRTdGF0dXM7CisgICAgICAgIHBUeEJkU3RhdHVzID0gKHRwU2lyVHhCZFN0YXR1cykgcERhdGE7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgidHhDb21wbGV0ZVN0YXR1cyAldSwgdHhCZFRva2VuICV1IiksCisgICAgICAgICAgICAgICAgcFR4QmRTdGF0dXMtPnR4Q29tcGxldGVTdGF0dXMsIHBUeEJkU3RhdHVzLT50eEJkVG9rZW4pOworICAgIH0KKyAgICByZXR1cm4gbGltU2VuZERpc2Fzc29jQ25mKHBNYWMpOworfQorCitlSGFsU3RhdHVzIGxpbURlYXV0aFR4Q29tcGxldGVDbmYodHBBbmlTaXJHbG9iYWwgcE1hYywgdm9pZCAqcERhdGEpCit7CisgICAgaWYgKHBEYXRhICYmIElTX0ZFQVRVUkVfU1VQUE9SVEVEX0JZX0ZXKEVOSEFOQ0VEX1RYQkRfQ09NUExFVElPTikpCisgICAgeworICAgICAgICB0cFNpclR4QmRTdGF0dXMgcFR4QmRTdGF0dXM7CisgICAgICAgIHBUeEJkU3RhdHVzID0gKHRwU2lyVHhCZFN0YXR1cykgcERhdGE7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgidHhDb21wbGV0ZVN0YXR1cyAldSwgdHhCZFRva2VuICV1IiksCisgICAgICAgICAgICAgICAgcFR4QmRTdGF0dXMtPnR4Q29tcGxldGVTdGF0dXMsIHBUeEJkU3RhdHVzLT50eEJkVG9rZW4pOworICAgIH0KKyAgICByZXR1cm4gbGltU2VuZERlYXV0aENuZihwTWFjKTsKK30KKworLyoqCisgKiBcYnJpZWYgVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgdG8gc2VuZCBEaXNhc3NvY2lhdGUgZnJhbWUuCisgKgorICoKKyAqIFxwYXJhbSBwTWFjIFBvaW50ZXIgdG8gR2xvYmFsIE1BQyBzdHJ1Y3R1cmUKKyAqCisgKiBccGFyYW0gblJlYXNvbiBJbmRpY2F0ZXMgdGhlIHJlYXNvbiB0aGF0IG5lZWQgdG8gYmUgc2VudCBpbgorICogRGlzYXNzb2NpYXRpb24gZnJhbWUKKyAqCisgKiBccGFyYW0gcGVlck1hY0FkZHIgTUFDIGFkZHJlc3Mgb2YgdGhlIFNUQSB0byB3aGljaCBEaXNhc3NvY2lhdGlvbiBmcmFtZSBpcworICogc2VudAorICoKKyAqCisgKi8KKwordm9pZAorbGltU2VuZERpc2Fzc29jTWdtdEZyYW1lKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMTYgICAgICAgblJlYXNvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjQWRkciAgICBwZWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9CT09MRUFOIHdhaXRGb3JBY2spCit7CisgICAgdERvdDExZkRpc2Fzc29jaWF0aW9uIGZybTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAqcEZyYW1lOworICAgIHRTaXJSZXRTdGF0dXMgICAgICAgICBuU2lyU3RhdHVzOworICAgIHRwU2lyTWFjTWdtdEhkciAgICAgICBwTWFjSGRyOworICAgIHRBTklfVTMyICAgICAgICAgICAgICBuQnl0ZXMsIG5QYXlsb2FkLCBuU3RhdHVzOworICAgIHZvaWQgICAgICAgICAgICAgICAgICpwUGFja2V0OworICAgIGVIYWxTdGF0dXMgICAgICAgICAgICBoYWxzdGF0dXM7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgIHR4RmxhZyA9IDA7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgIHZhbCA9IDA7CisgICAgaWYoTlVMTCA9PSBwc2Vzc2lvbkVudHJ5KQorICAgIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICAKKyAgICB2b3NfbWVtX3NldCggKCB0QU5JX1U4KiApJmZybSwgc2l6ZW9mKCBmcm0gKSwgMCk7CisKKyAgICBmcm0uUmVhc29uLmNvZGUgPSBuUmVhc29uOworCisgICAgblN0YXR1cyA9IGRvdDExZkdldFBhY2tlZERpc2Fzc29jaWF0aW9uU2l6ZSggcE1hYywgJmZybSwgJm5QYXlsb2FkICk7CisgICAgaWYgKCBET1QxMUZfRkFJTEVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dQLCBGTCgiRmFpbGVkIHRvIGNhbGN1bGF0ZSB0aGUgcGFja2VkIHNpemUgZiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3IgYSBEaXNhc3NvY2lhdGlvbiAoMHglMDh4KS4iKSwKKyAgICAgICAgICAgICAgICBuU3RhdHVzICk7CisgICAgICAgIC8vIFdlJ2xsIGZhbGwgYmFjayBvbiB0aGUgd29yc3QgY2FzZSBzY2VuYXJpbzoKKyAgICAgICAgblBheWxvYWQgPSBzaXplb2YoIHREb3QxMWZEaXNhc3NvY2lhdGlvbiApOworICAgIH0KKyAgICBlbHNlIGlmICggRE9UMTFGX1dBUk5FRCggblN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HVywgRkwoIlRoZXJlIHdlcmUgd2FybmluZ3Mgd2hpbGUgY2FsY3VsYXRpbmcgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0aGUgcGFja2VkIHNpemUgZm9yIGEgRGlzYXNzb2NpYXRpb24gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIoMHglMDh4KS4iKSwgblN0YXR1cyApOworICAgIH0KKworICAgIG5CeXRlcyA9IG5QYXlsb2FkICsgc2l6ZW9mKCB0U2lyTWFjTWdtdEhkciApOworCisgICAgaGFsc3RhdHVzID0gcGFsUGt0QWxsb2MoIHBNYWMtPmhIZGQsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCB0QU5JX1UxNiApbkJ5dGVzLCAoIHZvaWQqKiApICZwRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggdm9pZCoqICkgJnBQYWNrZXQgKTsKKyAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTICggaGFsc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dQLCBGTCgiRmFpbGVkIHRvIGFsbG9jYXRlICVkIGJ5dGVzIGZvciBhIERpcyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiYXNzb2NpYXRpb24uIiksIG5CeXRlcyApOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgLy8gUGFyYW5vaWE6CisgICAgdm9zX21lbV9zZXQoIHBGcmFtZSwgbkJ5dGVzLCAwICk7CisKKyAgICAvLyBOZXh0LCB3ZSBmaWxsIG91dCB0aGUgYnVmZmVyIGRlc2NyaXB0b3I6CisgICAgblNpclN0YXR1cyA9IGxpbVBvcHVsYXRlTWFjSGVhZGVyKCBwTWFjLCBwRnJhbWUsIFNJUl9NQUNfTUdNVF9GUkFNRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX01BQ19NR01UX0RJU0FTU09DLCBwZWVyLHBzZXNzaW9uRW50cnktPnNlbGZNYWNBZGRyKTsKKyAgICBpZiAoIGVTSVJfU1VDQ0VTUyAhPSBuU2lyU3RhdHVzICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBwb3B1bGF0ZSB0aGUgYnVmZmVyIGRlc2NyaXAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInRvciBmb3IgYSBEaXNhc3NvY2lhdGlvbiAoJWQpLiIpLAorICAgICAgICAgICAgICAgIG5TaXJTdGF0dXMgKTsKKyAgICAgICAgcGFsUGt0RnJlZSggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULAorICAgICAgICAgICAgICAgICAgICAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworICAgICAgICByZXR1cm47ICAgICAgICAgICAgICAgICAvLyBqdXN0IGFsbG9jYXRlZC4uLgorICAgIH0KKworICAgIHBNYWNIZHIgPSAoIHRwU2lyTWFjTWdtdEhkciApIHBGcmFtZTsKKworICAgIC8vIFByZXBhcmUgdGhlIEJTU0lECisgICAgc2lyQ29weU1hY0FkZHIocE1hY0hkci0+YnNzSWQscHNlc3Npb25FbnRyeS0+YnNzSWQpOworICAgIAorI2lmZGVmIFdMQU5fRkVBVFVSRV8xMVcKKyAgICBsaW1TZXRQcm90ZWN0ZWRCaXQocE1hYywgcHNlc3Npb25FbnRyeSwgcGVlciwgcE1hY0hkcik7CisjZW5kaWYKKworICAgIG5TdGF0dXMgPSBkb3QxMWZQYWNrRGlzYXNzb2NpYXRpb24oIHBNYWMsICZmcm0sIHBGcmFtZSArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNNZ210SGRyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuUGF5bG9hZCwgJm5QYXlsb2FkICk7CisgICAgaWYgKCBET1QxMUZfRkFJTEVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIHBhY2sgYSBEaXNhc3NvY2lhdGlvbiAoMHglMDh4KS4iKSwKKyAgICAgICAgICAgICAgICBuU3RhdHVzICk7CisgICAgICAgIHBhbFBrdEZyZWUoIHBNYWMtPmhIZGQsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICAgICAgICAgKCB2b2lkKiApIHBGcmFtZSwgKCB2b2lkKiApIHBQYWNrZXQgKTsKKyAgICAgICAgcmV0dXJuOyAgICAgICAgICAgICAgICAgLy8gYWxsb2NhdGVkIQorICAgIH0KKyAgICBlbHNlIGlmICggRE9UMTFGX1dBUk5FRCggblN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HVywgRkwoIlRoZXJlIHdlcmUgd2FybmluZ3Mgd2hpbGUgcGFja2luZyBhIEQiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImlzYXNzb2NpYXRpb24gKDB4JTA4eCkuIiksIG5TdGF0dXMgKTsKKyAgICB9CisKKyAgICBsaW1Mb2coIHBNYWMsIExPRzEsIEZMKCIqKipTZXNzaW9uaWQgJWQgU2VuZGluZyBEaXNhc3NvY2lhdGlvbiBmcmFtZSB3aXRoICIKKyAgICAgICAgICAicmVhc29uICV1IGFuZCB3YWl0Rm9yQWNrICVkIHRvICJNQUNfQUREUkVTU19TVFIiICxGcm9tICIKKyAgICAgICAgICBNQUNfQUREUkVTU19TVFIpLCBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwgblJlYXNvbiwgd2FpdEZvckFjaywKKyAgICAgICAgICBNQUNfQUREUl9BUlJBWShwTWFjSGRyLT5kYSksCisgICAgICAgICAgTUFDX0FERFJfQVJSQVkocHNlc3Npb25FbnRyeS0+c2VsZk1hY0FkZHIpKTsKKworICAgIGlmKCAoIFNJUl9CQU5EXzVfR0haID09IGxpbUdldFJGQmFuZChwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwpKQorICAgICAgIHx8ICggcHNlc3Npb25FbnRyeS0+cGVQZXJzb25hID09IFZPU19QMlBfQ0xJRU5UX01PREUgKSB8f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spCisgICAgeworICAgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9NR01ULAorICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgICAgICAgICBwTWFjSGRyLT5mYy5zdWJUeXBlKSk7CisgICAgICAgIC8vIFF1ZXVlIERpc2Fzc29jaWF0aW9uIGZyYW1lIGluIGhpZ2ggcHJpb3JpdHkgV1EKKyAgICAgICAgLyogZ2V0IHRoZSBkdXJhdGlvbiBmcm9tIHRoZSByZXF1ZXN0ICovCisgICAgICAgIGhhbHN0YXR1cyA9IGhhbFR4RnJhbWVXaXRoVHhDb21wbGV0ZSggcE1hYywgcFBhY2tldCwgKCB0QU5JX1UxNiApIG5CeXRlcywKKyAgICAgICAgICAgICAgICBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgQU5JX1RYRElSX1RPRFMsCisgICAgICAgICAgICAgICAgNywvL1NNQUNfU1dCRF9UWF9USURfTUdNVF9ISUdILAorICAgICAgICAgICAgICAgIGxpbVR4Q29tcGxldGUsIHBGcmFtZSwgbGltRGlzYXNzb2NUeENvbXBsZXRlQ25mLAorICAgICAgICAgICAgICAgIHR4RmxhZywKKyAgICAgICAgICAgICAgICBwTWFjLT5saW0udHhCZFRva2VuKyspOworICAgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9DT01QTEVURSwKKyAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLAorICAgICAgICAgICAgICAgaGFsc3RhdHVzKSk7CisgICAgICAgIHZhbCA9IFNZU19NU19UT19USUNLUyhMSU1fRElTQVNTT0NfREVBVVRIX0FDS19USU1FT1VUKTsKKworICAgICAgICBpZiAodHhfdGltZXJfY2hhbmdlKAorICAgICAgICAgICAgICAgICAgICAmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltRGlzYXNzb2NBY2tUaW1lciwgdmFsLCAwKQorICAgICAgICAgICAgICAgICE9IFRYX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgICBGTCgiVW5hYmxlIHRvIGNoYW5nZSBEaXNhc3NvYyBhY2sgVGltZXIgdmFsIikpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYoVFhfU1VDQ0VTUyAhPSB0eF90aW1lcl9hY3RpdmF0ZSgKKyAgICAgICAgICAgICAgICAgICAgJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbURpc2Fzc29jQWNrVGltZXIpKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICAgRkwoIlVuYWJsZSB0byBhY3RpdmF0ZSBEaXNhc3NvYyBhY2sgVGltZXIiKSk7CisgICAgICAgICAgICBsaW1EZWFjdGl2YXRlQW5kQ2hhbmdlVGltZXIocE1hYywgZUxJTV9ESVNBU1NPQ19BQ0tfVElNRVIpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UgCisgICAgeworICAgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9NR01ULAorICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgICAgICAgICBwTWFjSGRyLT5mYy5zdWJUeXBlKSk7CisgICAgICAgIC8vIFF1ZXVlIERpc2Fzc29jaWF0aW9uIGZyYW1lIGluIGhpZ2ggcHJpb3JpdHkgV1EKKyAgICAgICAgaGFsc3RhdHVzID0gaGFsVHhGcmFtZSggcE1hYywgcFBhY2tldCwgKCB0QU5JX1UxNiApIG5CeXRlcywKKyAgICAgICAgICAgICAgICBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgQU5JX1RYRElSX1RPRFMsCisgICAgICAgICAgICAgICAgNywvL1NNQUNfU1dCRF9UWF9USURfTUdNVF9ISUdILAorICAgICAgICAgICAgICAgIGxpbVR4Q29tcGxldGUsIHBGcmFtZSwgdHhGbGFnICk7CisgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RYX0NPTVBMRVRFLAorICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgICAgICAgICBoYWxzdGF0dXMpKTsKKyAgICAgICAgaWYgKCAhIEhBTF9TVEFUVVNfU1VDQ0VTUyAoIGhhbHN0YXR1cyApICkKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIHNlbmQgRGlzYXNzb2NpYXRpb24gIgorICAgICAgICAgICAgICAgICAgICAgICAgIiglWCkhIiksCisgICAgICAgICAgICAgICAgICAgIG5TaXJTdGF0dXMgKTsKKyAgICAgICAgICAgIC8vUGt0IHdpbGwgYmUgZnJlZWQgdXAgYnkgdGhlIGNhbGxiYWNrCisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICB9Cit9IC8vIEVuZCBsaW1TZW5kRGlzYXNzb2NNZ210RnJhbWUuCisKKy8qKgorICogXGJyaWVmIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIHRvIHNlbmQgYSBEZWF1dGhlbnRpY2F0ZSBmcmFtZQorICoKKyAqCisgKiBccGFyYW0gcE1hYyBQb2ludGVyIHRvIGdsb2JhbCBNQUMgc3RydWN0dXJlCisgKgorICogXHBhcmFtIG5SZWFzb24gSW5kaWNhdGVzIHRoZSByZWFzb24gdGhhdCBuZWVkIHRvIGJlIHNlbnQgaW4gdGhlCisgKiBEZWF1dGhlbnRpY2F0ZSBmcmFtZQorICoKKyAqIFxwYXJhbSBwZWVlciBhZGRyZXNzIG9mIHRoZSBTVEEgdG8gd2hpY2ggdGhlIGZyYW1lIGlzIHRvIGJlIHNlbnQKKyAqCisgKgorICovCisKK3ZvaWQKK2xpbVNlbmREZWF1dGhNZ210RnJhbWUodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMTYgICAgICAgblJlYXNvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY0FkZHIgICAgcGVlciwKKyAgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSwKKyAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9CT09MRUFOIHdhaXRGb3JBY2spCit7CisgICAgdERvdDExZkRlQXV0aCAgICBmcm07CisgICAgdEFOSV9VOCAgICAgICAgICpwRnJhbWU7CisgICAgdFNpclJldFN0YXR1cyAgICBuU2lyU3RhdHVzOworICAgIHRwU2lyTWFjTWdtdEhkciAgcE1hY0hkcjsKKyAgICB0QU5JX1UzMiAgICAgICAgIG5CeXRlcywgblBheWxvYWQsIG5TdGF0dXM7CisgICAgdm9pZCAgICAgICAgICAgICpwUGFja2V0OworICAgIGVIYWxTdGF0dXMgICAgICAgaGFsc3RhdHVzOworICAgIHRBTklfVTMyICAgICAgICAgdHhGbGFnID0gMDsKKyAgICB0QU5JX1UzMiAgICAgICAgIHZhbCA9IDA7CisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICB0QU5JX1UxNiAgICAgICAgICBhaWQ7CisgICAgdHBEcGhIYXNoTm9kZSAgICAgcFN0YURzOworI2VuZGlmCisKKyAgICBpZihOVUxMID09IHBzZXNzaW9uRW50cnkpCisgICAgeworICAgICAgICByZXR1cm47CisgICAgfQorICAgIAorICAgIHZvc19tZW1fc2V0KCAoIHRBTklfVTgqICkgJmZybSwgc2l6ZW9mKCBmcm0gKSwgMCApOworCisgICAgZnJtLlJlYXNvbi5jb2RlID0gblJlYXNvbjsKKworICAgIG5TdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWREZUF1dGhTaXplKCBwTWFjLCAmZnJtLCAmblBheWxvYWQgKTsKKyAgICBpZiAoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1AsIEZMKCJGYWlsZWQgdG8gY2FsY3VsYXRlIHRoZSBwYWNrZWQgc2l6ZSBmIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvciBhIERlLUF1dGhlbnRpY2F0aW9uICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgIG5TdGF0dXMgKTsKKyAgICAgICAgLy8gV2UnbGwgZmFsbCBiYWNrIG9uIHRoZSB3b3JzdCBjYXNlIHNjZW5hcmlvOgorICAgICAgICBuUGF5bG9hZCA9IHNpemVvZiggdERvdDExZkRlQXV0aCApOworICAgIH0KKyAgICBlbHNlIGlmICggRE9UMTFGX1dBUk5FRCggblN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HVywgRkwoIlRoZXJlIHdlcmUgd2FybmluZ3Mgd2hpbGUgY2FsY3VsYXRpbmcgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0aGUgcGFja2VkIHNpemUgZm9yIGEgRGUtQXV0aGVudGljYXRpb24gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIoMHglMDh4KS4iKSwgblN0YXR1cyApOworICAgIH0KKworICAgIG5CeXRlcyA9IG5QYXlsb2FkICsgc2l6ZW9mKCB0U2lyTWFjTWdtdEhkciApOworCisgICAgaGFsc3RhdHVzID0gcGFsUGt0QWxsb2MoIHBNYWMtPmhIZGQsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCB0QU5JX1UxNiApbkJ5dGVzLCAoIHZvaWQqKiApICZwRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggdm9pZCoqICkgJnBQYWNrZXQgKTsKKyAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTICggaGFsc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dQLCBGTCgiRmFpbGVkIHRvIGFsbG9jYXRlICVkIGJ5dGVzIGZvciBhIERlLSIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQXV0aGVudGljYXRpb24uIiksIG5CeXRlcyApOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgLy8gUGFyYW5vaWE6CisgICAgdm9zX21lbV9zZXQoICBwRnJhbWUsIG5CeXRlcywgMCApOworCisgICAgLy8gTmV4dCwgd2UgZmlsbCBvdXQgdGhlIGJ1ZmZlciBkZXNjcmlwdG9yOgorICAgIG5TaXJTdGF0dXMgPSBsaW1Qb3B1bGF0ZU1hY0hlYWRlciggcE1hYywgcEZyYW1lLCBTSVJfTUFDX01HTVRfRlJBTUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfTUdNVF9ERUFVVEgsIHBlZXIscHNlc3Npb25FbnRyeS0+c2VsZk1hY0FkZHIpOworICAgIGlmICggZVNJUl9TVUNDRVNTICE9IG5TaXJTdGF0dXMgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIHBvcHVsYXRlIHRoZSBidWZmZXIgZGVzY3JpcCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAidG9yIGZvciBhIERlLUF1dGhlbnRpY2F0aW9uICglZCkuIiksCisgICAgICAgICAgICAgICAgblNpclN0YXR1cyApOworICAgICAgICBwYWxQa3RGcmVlKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgICAgICggdm9pZCogKSBwRnJhbWUsICggdm9pZCogKSBwUGFja2V0ICk7CisgICAgICAgIHJldHVybjsgICAgICAgICAgICAgICAgIC8vIGp1c3QgYWxsb2NhdGVkLi4uCisgICAgfQorCisgICAgcE1hY0hkciA9ICggdHBTaXJNYWNNZ210SGRyICkgcEZyYW1lOworCisgICAgLy8gUHJlcGFyZSB0aGUgQlNTSUQKKyAgICBzaXJDb3B5TWFjQWRkcihwTWFjSGRyLT5ic3NJZCxwc2Vzc2lvbkVudHJ5LT5ic3NJZCk7CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisgICAgbGltU2V0UHJvdGVjdGVkQml0KHBNYWMsIHBzZXNzaW9uRW50cnksIHBlZXIsIHBNYWNIZHIpOworI2VuZGlmCisKKyAgICBuU3RhdHVzID0gZG90MTFmUGFja0RlQXV0aCggcE1hYywgJmZybSwgcEZyYW1lICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNNZ210SGRyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgblBheWxvYWQsICZuUGF5bG9hZCApOworICAgIGlmICggRE9UMTFGX0ZBSUxFRCggblN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBwYWNrIGEgRGVBdXRoZW50aWNhdGlvbiAoMHglMDh4KS4iKSwKKyAgICAgICAgICAgICAgICBuU3RhdHVzICk7CisgICAgICAgIHBhbFBrdEZyZWUoIHBNYWMtPmhIZGQsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICAgICAgICAgKCB2b2lkKiApIHBGcmFtZSwgKCB2b2lkKiApIHBQYWNrZXQgKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBlbHNlIGlmICggRE9UMTFGX1dBUk5FRCggblN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HVywgRkwoIlRoZXJlIHdlcmUgd2FybmluZ3Mgd2hpbGUgcGFja2luZyBhIEQiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImUtQXV0aGVudGljYXRpb24gKDB4JTA4eCkuIiksIG5TdGF0dXMgKTsKKyAgICB9CisgICAgIGxpbUxvZyggcE1hYywgTE9HMSwgRkwoIioqKlNlc3Npb25pZCAlZCBTZW5kaW5nIERlYXV0aCBmcmFtZSB3aXRoICIKKyAgICAgICAgICAicmVhc29uICV1IGFuZCB3YWl0Rm9yQWNrICVkIHRvICJNQUNfQUREUkVTU19TVFIiICxGcm9tICIKKyAgICAgICAgICBNQUNfQUREUkVTU19TVFIpLCBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwgblJlYXNvbiwgd2FpdEZvckFjaywKKyAgICAgICAgICBNQUNfQUREUl9BUlJBWShwTWFjSGRyLT5kYSksCisgICAgICAgICAgTUFDX0FERFJfQVJSQVkocHNlc3Npb25FbnRyeS0+c2VsZk1hY0FkZHIpKTsKKworICAgIGlmKCAoIFNJUl9CQU5EXzVfR0haID09IGxpbUdldFJGQmFuZChwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwpKQorICAgICAgIHx8ICggcHNlc3Npb25FbnRyeS0+cGVQZXJzb25hID09IFZPU19QMlBfQ0xJRU5UX01PREUgKSB8fAorICAgICAgICAgKCBwc2Vzc2lvbkVudHJ5LT5wZVBlcnNvbmEgPT0gVk9TX1AyUF9HT19NT0RFKQorICAgICAgICAgKQorICAgIHsKKyAgICAgICAgdHhGbGFnIHw9IEhBTF9VU0VfQkRfUkFURTJfRk9SX01BTkFHRU1FTlRfRlJBTUU7CisgICAgfQorCisgICAgdHhGbGFnIHw9IEhBTF9VU0VfUEVFUl9TVEFfUkVRVUVTVEVEX01BU0s7CisKKyAgICBpZiggSVNfRldfSU5fVFhfUEFUSF9GRUFUVVJFX0VOQUJMRSApCisgICAgeworICAgICAgICAvKiBUaGlzIGZyYW1lIHdpbGwgYmUgc2VudCBvbiBhaXIgYnkgZmlybXdhcmUsCisgICAgICAgICAgIHdoaWNoIHdpbGwgZW5zdXJlIHR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GF0dXMgPSBoYWxUeEZyYW1lV2l0aFR4Q29tcGxldGUoIHBNYWMsIHBQYWNrZXQsICggdEFOSV9VMTYgKSBuQnl0ZXMsCisgICAgICAgICAgICAgICAgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULAorICAgICAgICAgICAgICAgIEFOSV9UWERJUl9UT0RTLAorICAgICAgICAgICAgICAgIDcsLy9TTUFDX1NXQkRfVFhfVElEX01HTVRfSElHSCwKKyAgICAgICAgICAgICAgICBsaW1UeENvbXBsZXRlLCBwRnJhbWUsIGxpbURlYXV0aFR4Q29tcGxldGVDbmYsIHR4RmxhZywKKyAgICAgICAgICAgICAgICBwTWFjLT5saW0udHhCZFRva2VuKyspOworICAgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9DT01QTEVURSwKKyAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLAorICAgICAgICAgICAgICAgaGFsc3RhdHVzKSk7CisgICAgICAgIGlmICghSEFMX1NUQVRVU19TVUNDRVNTKGhhbHN0YXR1cykpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBzZW5kIERlLUF1dGhlbnRpY2F0aW9uICIKKyAgICAgICAgICAgICAgICAgICAgIiglWCkhIiksCisgICAgICAgICAgICAgICAgICAgIG5TaXJTdGF0dXMgKTsKKyAgICAgICAgICAgIC8vUGt0IHdpbGwgYmUgZnJlZWQgdXAgYnkgdGhlIGNhbGxiYWNrIGxpbVR4Q29tcGxldGUKKworICAgICAgICAgICAgLypDYWxsIGxpbVByb2Nlc3NEZWF1dGhBY2tUaW1lb3V0IHdoaWNoIHdpbGwgc2VuZAorICAgICAgICAgICAgKiBEZWF1dGhDbmYgZm9yIHRoaXMgZnJhbWUKKyAgICAgICAgICAgICovCisgICAgICAgICAgICBsaW1Qcm9jZXNzRGVhdXRoQWNrVGltZW91dChwTWFjKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIHZhbCA9IFNZU19NU19UT19USUNLUyhMSU1fRElTQVNTT0NfREVBVVRIX0FDS19USU1FT1VUKTsKKworICAgICAgICBpZiAodHhfdGltZXJfY2hhbmdlKAorICAgICAgICAgICAgICAgICAgICAmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltRGVhdXRoQWNrVGltZXIsIHZhbCwgMCkKKyAgICAgICAgICAgICAgICAhPSBUWF9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICAgRkwoIlVuYWJsZSB0byBjaGFuZ2UgRGVhdXRoIGFjayBUaW1lciB2YWwiKSk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZihUWF9TVUNDRVNTICE9IHR4X3RpbWVyX2FjdGl2YXRlKAorICAgICAgICAgICAgICAgICAgICAmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltRGVhdXRoQWNrVGltZXIpKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICAgRkwoIlVuYWJsZSB0byBhY3RpdmF0ZSBEZWF1dGggYWNrIFRpbWVyIikpOworICAgICAgICAgICAgbGltRGVhY3RpdmF0ZUFuZENoYW5nZVRpbWVyKHBNYWMsIGVMSU1fREVBVVRIX0FDS19USU1FUik7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfVFhfTUdNVCwKKyAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLAorICAgICAgICAgICAgICAgcE1hY0hkci0+ZmMuc3ViVHlwZSkpOworI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgICAgICAgIGlmICgoTlVMTCAhPSBwU3RhRHMpICYmIChTVEFfRU5UUllfVERMU19QRUVSID09IHBTdGFEcy0+c3RhVHlwZSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIFF1ZXVlIERpc2Fzc29jaWF0aW9uIGZyYW1lIGluIGhpZ2ggcHJpb3JpdHkgV1EKKyAgICAgICAgICAgIGhhbHN0YXR1cyA9IGhhbFR4RnJhbWUoIHBNYWMsIHBQYWNrZXQsICggdEFOSV9VMTYgKSBuQnl0ZXMsCisgICAgICAgICAgICAgICAgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULAorICAgICAgICAgICAgICAgIEFOSV9UWERJUl9JQlNTLAorICAgICAgICAgICAgICAgIDcsLy9TTUFDX1NXQkRfVFhfVElEX01HTVRfSElHSCwKKyAgICAgICAgICAgICAgICBsaW1UeENvbXBsZXRlLCBwRnJhbWUsIHR4RmxhZyApOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworI2VuZGlmCisgICAgICAgICAgICAvLyBRdWV1ZSBEaXNhc3NvY2lhdGlvbiBmcmFtZSBpbiBoaWdoIHByaW9yaXR5IFdRCisgICAgICAgICAgICBoYWxzdGF0dXMgPSBoYWxUeEZyYW1lKCBwTWFjLCBwUGFja2V0LCAoIHRBTklfVTE2ICkgbkJ5dGVzLAorICAgICAgICAgICAgICAgICAgICBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgICAgIEFOSV9UWERJUl9UT0RTLAorICAgICAgICAgICAgICAgICAgICA3LC8vU01BQ19TV0JEX1RYX1RJRF9NR01UX0hJR0gsCisgICAgICAgICAgICAgICAgICAgIGxpbVR4Q29tcGxldGUsIHBGcmFtZSwgdHhGbGFnICk7CisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICAgICAgfQorI2VuZGlmCisgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX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gICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNBZGRyICAgICAgICAgICAgICAgIHBlZXIpCit7CisgICAgdERvdDExZk1lYXN1cmVtZW50UmVwb3J0ICBmcm07CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICpwRnJhbWU7CisgICAgdFNpclJldFN0YXR1cyAgICAgICAgICAgICBuU2lyU3RhdHVzOworICAgIHRwU2lyTWFjTWdtdEhkciAgICAgICAgICAgcE1hY0hkcjsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICAgIG5CeXRlcywgblBheWxvYWQsIG5TdGF0dXMsIG5DZmc7CisgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgICpwUGFja2V0OworICAgIGVIYWxTdGF0dXMgICAgICAgICAgICAgICAgaGFsc3RhdHVzOworICAgCisgICAgdm9zX21lbV9zZXQoICggdEFOSV9VOCogKSZmcm0sIHNpemVvZiggZnJtICksIDAgKTsKKworICAgIGZybS5DYXRlZ29yeS5jYXRlZ29yeSA9IFNJUl9NQUNfQUNUSU9OX1NQRUNUUlVNX01HTVQ7CisgICAgZnJtLkFjdGlvbi5hY3Rpb24gICAgID0gU0lSX01BQ19BQ1RJT05fTUVBU1VSRV9SRVBPUlRfSUQ7CisgICAgZnJtLkRpYWxvZ1Rva2VuLnRva2VuID0gcE1lYXNSZXFGcmFtZS0+YWN0aW9uSGVhZGVyLmRpYWxvZ1Rva2VuOworCisgICAgc3dpdGNoICggcE1lYXNSZXFGcmFtZS0+bWVhc1JlcUlFLm1lYXNUeXBlICkKKyAgICB7CisgICAgY2FzZSBTSVJfTUFDX0JBU0lDX01FQVNVUkVNRU5UX1RZUEU6CisgICAgICAgIG5TaXJTdGF0dXMgPQorICAgICAgICAgICAgUG9wdWxhdGVEb3QxMWZNZWFzdXJlbWVudFJlcG9ydDAoIHBNYWMsIHBNZWFzUmVxRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZmcm0uTWVhc3VyZW1lbnRSZXBvcnQgKTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBTSVJfTUFDX0NDQV9NRUFTVVJFTUVOVF9UWVBFOgorICAgICAgICBuU2lyU3RhdHVzID0KKyAgICAgICAgICAgIFBvcHVsYXRlRG90MTFmTWVhc3VyZW1lbnRSZXBvcnQxKCBwTWFjLCBwTWVhc1JlcUZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZnJtLk1lYXN1cmVtZW50UmVwb3J0ICk7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgU0lSX01BQ19SUElfTUVBU1VSRU1FTlRfVFlQRToKKyAgICAgICAgblNpclN0YXR1cyA9CisgICAgICAgICAgICBQb3B1bGF0ZURvdDExZk1lYXN1cmVtZW50UmVwb3J0MiggcE1hYywgcE1lYXNSZXFGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmZybS5NZWFzdXJlbWVudFJlcG9ydCApOworICAgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJVbmtub3duIG1lYXN1cmVtZW50IHR5cGUgJWQgaW4gbGltU2VuIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJkTWVhc1JlcG9ydEZyYW1lLiIpLAorICAgICAgICAgICAgICAgIHBNZWFzUmVxRnJhbWUtPm1lYXNSZXFJRS5tZWFzVHlwZSApOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKworICAgIGlmICggZVNJUl9TVUNDRVNTICE9IG5TaXJTdGF0dXMgKSByZXR1cm4gZVNJUl9GQUlMVVJFOworCisgICAgblN0YXR1cyA9IGRvdDExZkdldFBhY2tlZE1lYXN1cmVtZW50UmVwb3J0U2l6ZSggcE1hYywgJmZybSwgJm5QYXlsb2FkICk7CisgICAgaWYgKCBET1QxMUZfRkFJTEVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dQLCBGTCgiRmFpbGVkIHRvIGNhbGN1bGF0ZSB0aGUgcGFja2VkIHNpemUgZiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3IgYSBNZWFzdXJlbWVudCBSZXBvcnQgKDB4JTA4eCkuIiksCisgICAgICAgICAgICAgICAgblN0YXR1cyApOworICAgICAgICAvLyBXZSdsbCBmYWxsIGJhY2sgb24gdGhlIHdvcnN0IGNhc2Ugc2NlbmFyaW86CisgICAgICAgIG5QYXlsb2FkID0gc2l6ZW9mKCB0RG90MTFmTWVhc3VyZW1lbnRSZXBvcnQgKTsKKyAgICB9CisgICAgZWxzZSBpZiAoIERPVDExRl9XQVJORUQoIG5TdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csIEZMKCJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIGNhbGN1bGF0aW5nICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAidGhlIHBhY2tlZCBzaXplIGZvciBhIE1lYXN1cmVtZW50IFJlcCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3J0ICgweCUwOHgpLiIpLCBuU3RhdHVzICk7CisgICAgfQorCisgICAgbkJ5dGVzID0gblBheWxvYWQgKyBzaXplb2YoIHRTaXJNYWNNZ210SGRyICk7CisKKyAgICBoYWxzdGF0dXMgPSBwYWxQa3RBbGxvYyggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCAoIHRBTklfVTE2ICluQnl0ZXMsICggdm9pZCoqICkgJnBGcmFtZSwgKCB2b2lkKiogKSAmcFBhY2tldCApOworICAgIGlmICggISBIQUxfU1RBVFVTX1NVQ0NFU1MgKCBoYWxzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1AsIEZMKCJGYWlsZWQgdG8gYWxsb2NhdGUgJWQgYnl0ZXMgZm9yIGEgRGUtIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJBdXRoZW50aWNhdGlvbi4iKSwgbkJ5dGVzICk7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorCisgICAgLy8gUGFyYW5vaWE6CisgICAgdm9zX21lbV9zZXQoIHBGcmFtZSwgbkJ5dGVzLCAwICk7CisKKyAgICAvLyBOZXh0LCB3ZSBmaWxsIG91dCB0aGUgYnVmZmVyIGRlc2NyaXB0b3I6CisgICAgblNpclN0YXR1cyA9IGxpbVBvcHVsYXRlTWFjSGVhZGVyKCBwTWFjLCBwRnJhbWUsIFNJUl9NQUNfTUdNVF9GUkFNRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX01BQ19NR01UX0FDVElPTiwgcGVlcik7CisgICAgaWYgKCBlU0lSX1NVQ0NFU1MgIT0gblNpclN0YXR1cyApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gcG9wdWxhdGUgdGhlIGJ1ZmZlciBkZXNjcmlwIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0b3IgZm9yIGEgTWVhc3VyZW1lbnQgUmVwb3J0ICglZCkuIiksCisgICAgICAgICAgICAgICAgblNpclN0YXR1cyApOworICAgICAgICBwYWxQa3RGcmVlKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsICggdm9pZCogKSBwRnJhbWUsICggdm9pZCogKSBwUGFja2V0ICk7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7ICAgIC8vIGp1c3QgYWxsb2NhdGVkLi4uCisgICAgfQorCisgICAgcE1hY0hkciA9ICggdHBTaXJNYWNNZ210SGRyICkgcEZyYW1lOworCisgICAgbkNmZyA9IDY7CisgICAgblNpclN0YXR1cyA9IHdsYW5fY2ZnR2V0U3RyKCBwTWFjLCBXTklfQ0ZHX0JTU0lELCBwTWFjSGRyLT5ic3NJZCwgJm5DZmcgKTsKKyAgICBpZiAoIGVTSVJfU1VDQ0VTUyAhPSBuU2lyU3RhdHVzICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byByZXRyaWV2ZSBXTklfQ0ZHX0JTU0lEIGZyb20iCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBDRkcgKCVkKS4iKSwKKyAgICAgICAgICAgICAgICBuU2lyU3RhdHVzICk7CisgICAgICAgIHBhbFBrdEZyZWUoIHBNYWMtPmhIZGQsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwgKCB2b2lkKiApIHBGcmFtZSwgKCB2b2lkKiApIHBQYWNrZXQgKTsKKyAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsgICAgLy8ganVzdCBhbGxvY2F0ZWQuLi4KKyAgICB9CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisgICAgbGltU2V0UHJvdGVjdGVkQml0KHBNYWMsIHBzZXNzaW9uRW50cnksIHBlZXIsIHBNYWNIZHIpOworI2VuZGlmCisKKyAgICBuU3RhdHVzID0gZG90MTFmUGFja01lYXN1cmVtZW50UmVwb3J0KCBwTWFjLCAmZnJtLCBwRnJhbWUgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjTWdtdEhkciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgblBheWxvYWQsICZuUGF5bG9hZCApOworICAgIGlmICggRE9UMTFGX0ZBSUxFRCggblN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBwYWNrIGEgTWVhc3VyZW1lbnQgUmVwb3J0ICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgIG5TdGF0dXMgKTsKKyAgICAgICAgcGFsUGt0RnJlZSggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOyAgICAvLyBhbGxvY2F0ZWQhCisgICAgfQorICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dXLCBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBwYWNraW5nIGEgTSIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZWFzdXJlbWVudCBSZXBvcnQgKDB4JTA4eCkuIiksIG5TdGF0dXMgKTsKKyAgICB9CisKKyAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9NR01ULAorICAgICAgICAgICAoKHBzZXNzaW9uRW50cnkpPyBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCA6IE5PX1NFU1NJT04pLAorICAgICAgICAgICBwTWFjSGRyLT5mYy5zdWJUeXBlKSk7CisgICAgaGFsc3RhdHVzID0gaGFsVHhGcmFtZSggcE1hYywgcFBhY2tldCwgKCB0QU5JX1UxNiApIG5CeXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQU5JX1RYRElSX1RPRFMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgNywvL1NNQUNfU1dCRF9UWF9USURfTUdNVF9ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVR4Q29tcGxldGUsIHBGcmFtZSwgMCApOworICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RYX0NPTVBMRVRFLAorICAgICAgICAgICAoKHBzZ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1czsKKyAgICB0cFNpck1hY01nbXRIZHIgICAgcE1hY0hkcjsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgbkJ5dGVzLCBuUGF5bG9hZCwgblN0YXR1cywgbkNmZzsKKyAgICB2b2lkICAgICAgICAgICAgICAqcFBhY2tldDsKKyAgICBlSGFsU3RhdHVzICAgICAgICAgaGFsc3RhdHVzOworICAgCisgICAgdm9zX21lbV9zZXQoICggdEFOSV9VOCogKSZmcm0sIHNpemVvZiggZnJtICksIDAgKTsKKworICAgIGZybS5DYXRlZ29yeS5jYXRlZ29yeSAgPSBTSVJfTUFDX0FDVElPTl9TUEVDVFJVTV9NR01UOworICAgIGZybS5BY3Rpb24uYWN0aW9uICAgICAgPSBTSVJfTUFDX0FDVElPTl9UUENfUkVRVUVTVF9JRDsKKyAgICBmcm0uRGlhbG9nVG9rZW4udG9rZW4gID0gMTsKKyAgICBmcm0uVFBDUmVxdWVzdC5wcmVzZW50ID0gMTsKKworICAgIG5TdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRUUENSZXF1ZXN0U2l6ZSggcE1hYywgJmZybSwgJm5QYXlsb2FkICk7CisgICAgaWYgKCBET1QxMUZfRkFJTEVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dQLCBGTCgiRmFpbGVkIHRvIGNhbGN1bGF0ZSB0aGUgcGFja2VkIHNpemUgZiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3IgYSBUUEMgUmVxdWVzdCAoMHglMDh4KS4iKSwKKyAgICAgICAgICAgICAgICBuU3RhdHVzICk7CisgICAgICAgIC8vIFdlJ2xsIGZhbGwgYmFjayBvbiB0aGUgd29yc3QgY2FzZSBzY2VuYXJpbzoKKyAgICAgICAgblBheWxvYWQgPSBzaXplb2YoIHREb3QxMWZUUENSZXF1ZXN0ICk7CisgICAgfQorICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dXLCBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBjYWxjdWxhdGluZyAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInRoZSBwYWNrZWQgc2l6ZSBmb3IgYSBUUEMgUmVxdWVzdCAoMHgiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiUwOHgpLiIpLCBuU3RhdHVzICk7CisgICAgfQorCisgICAgbkJ5dGVzID0gblBheWxvYWQgKyBzaXplb2YoIHRTaXJNYWNNZ210SGRyICk7CisKKyAgICBoYWxzdGF0dXMgPSBwYWxQa3RBbGxvYyggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCAoIHRBTklfVTE2ICluQnl0ZXMsICggdm9pZCoqICkgJnBGcmFtZSwgKCB2b2lkKiogKSAmcFBhY2tldCApOworICAgIGlmICggISBIQUxfU1RBVFVTX1NVQ0NFU1MgKCBoYWxzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1AsIEZMKCJGYWlsZWQgdG8gYWxsb2NhdGUgJWQgYnl0ZXMgZm9yIGEgVFBDIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgUmVxdWVzdC4iKSwgbkJ5dGVzICk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICAvLyBQYXJhbm9pYToKKyAgICB2b3NfbWVtX3NldChwRnJhbWUsIG5CeXRlcywwKTsKKworICAgIC8vIE5leHQsIHdlIGZpbGwgb3V0IHRoZSBidWZmZXIgZGVzY3JpcHRvcjoKKyAgICBuU2lyU3RhdHVzID0gbGltUG9wdWxhdGVNYWNIZWFkZXIoIHBNYWMsIHBGcmFtZSwgU0lSX01BQ19NR01UX0ZSQU1FLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX01HTVRfQUNUSU9OLCBwZWVyKTsKKyAgICBpZiAoIGVTSVJfU1VDQ0VTUyAhPSBuU2lyU3RhdHVzICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBwb3B1bGF0ZSB0aGUgYnVmZmVyIGRlc2NyaXAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInRvciBmb3IgYSBUUEMgUmVxdWVzdCAoJWQpLiIpLAorICAgICAgICAgICAgICAgIG5TaXJTdGF0dXMgKTsKKyAgICAgICAgcGFsUGt0RnJlZSggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworICAgICAgICByZXR1cm47ICAgICAgICAgICAgICAgICAvLyBqdXN0IGFsbG9jYXRlZC4uLgorICAgIH0KKworICAgIHBNYWNIZHIgPSAoIHRwU2lyTWFjTWdtdEhkciApIHBGcmFtZTsKKworICAgIG5DZmcgPSA2OworICAgIG5TaXJTdGF0dXMgPSB3bGFuX2NmZ0dldFN0ciggcE1hYywgV05JX0NGR19CU1NJRCwgcE1hY0hkci0+YnNzSWQsICZuQ2ZnICk7CisgICAgaWYgKCBlU0lSX1NVQ0NFU1MgIT0gblNpclN0YXR1cyApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gcmV0cmlldmUgV05JX0NGR19CU1NJRCBmcm9tIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgQ0ZHICglZCkuIiksCisgICAgICAgICAgICAgICAgblNpclN0YXR1cyApOworICAgICAgICBwYWxQa3RGcmVlKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsICggdm9pZCogKSBwRnJhbWUsICggdm9pZCogKSBwUGFja2V0ICk7CisgICAgICAgIHJldHVybjsgICAgICAgICAgICAgICAgIC8vIGp1c3QgYWxsb2NhdGVkLi4uCisgICAgfQorCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgIGxpbVNldFByb3RlY3RlZEJpdChwTWFjLCBwc2Vzc2lvbkVudHJ5LCBwZWVyLCBwTWFjSGRyKTsKKyNlbmRpZgorCisgICAgblN0YXR1cyA9IGRvdDExZlBhY2tUUENSZXF1ZXN0KCBwTWFjLCAmZnJtLCBwRnJhbWUgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNNZ210SGRyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5QYXlsb2FkLCAmblBheWxvYWQgKTsKKyAgICBpZiAoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gcGFjayBhIFRQQyBSZXF1ZXN0ICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgIG5TdGF0dXMgKTsKKyAgICAgICAgcGFsUGt0RnJlZSggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworICAgICAgICByZXR1cm47ICAgICAgICAgICAgICAgICAvLyBhbGxvY2F0ZWQhCisgICAgfQorICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dXLCBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBwYWNraW5nIGEgVCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiUEMgUmVxdWVzdCAoMHglMDh4KS4iKSwgblN0YXR1cyApOworICAgIH0KKworICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RYX01HTVQsCisgICAgICAgICAgICgocHNlc3Npb25FbnRyeSk/IHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkIDogTk9fU0VTU0lPTiksCisgICAgICAgICAgIHBNYWNIZHItPmZjLnN1YlR5cGUpKTsKKyAgICBoYWxzdGF0dXMgPSBoYWxUeEZyYW1lKCBwTWFjLCBwUGFja2V0LCAoIHRBTklfVTE2ICkgbkJ5dGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTklfVFhESVJfVE9EUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA3LC8vU01BQ19TV0JEX1RYX1RJRF9NR01UX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltVHhDb21wbGV0ZSwgcEZyYW1lLCAwICk7CisgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfVFhfQ09NUExFVEUsCisgICAgICAgICAgICgocHNlc3Npb25FbnRyeSk/IHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkIDogTk9fU0VTU0lPTiksCisgICAgICAgICAgIGhhbHN0YXR1cykpOworICAgIGlmICggISBIQUxfU1RBVFVTX1NVQ0NFU1MgKCBoYWxzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gc2VuZCBhIFRQQyBSZXF1ZXN0ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKCVYKSEiKSwKKyAgICAgICAgICAgICAgICBuU2lyU3RhdHVzICk7CisgICAgICAgIC8vUGt0IHdpbGwgYmUgZnJlZWQgdXAgYnkgdGhlIGNhbGxiYWNrCisgICAgICAgIHJldHVybjsKKyAgICB9CisKK30gLy8gRW5kIGxpbVNlbmRUcGNSZXF1ZXN0RnJhbWUuCisKKworLyoqCisgKiBcYnJpZWYgU2VuZCBhIFRQQyBSZXBvcnQgQWN0aW9uIGZyYW1lCisgKgor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CBwTWFjLCBMT0dXLCBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBjYWxjdWxhdGluZyAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInRoZSBwYWNrZWQgc2l6ZSBmb3IgYSBUUEMgUmVwb3J0ICgweCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJTA4eCkuIiksIG5TdGF0dXMgKTsKKyAgICB9CisKKyAgICBuQnl0ZXMgPSBuUGF5bG9hZCArIHNpemVvZiggdFNpck1hY01nbXRIZHIgKTsKKworICAgIGhhbHN0YXR1cyA9IHBhbFBrdEFsbG9jKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsICggdEFOSV9VMTYgKW5CeXRlcywgKCB2b2lkKiogKSAmcEZyYW1lLCAoIHZvaWQqKiApICZwUGFja2V0ICk7CisgICAgaWYgKCAhIEhBTF9TVEFUVVNfU1VDQ0VTUyAoIGhhbHN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HUCwgRkwoIkZhaWxlZCB0byBhbGxvY2F0ZSAlZCBieXRlcyBmb3IgYSBUUEMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBSZXBvcnQuIiksIG5CeXRlcyApOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKworICAgIC8vIFBhcmFub2lhOgorICAgIHZvc19tZW1fc2V0KCBwRnJhbWUsIG5CeXRlcywgMCApOworCisgICAgLy8gTmV4dCwgd2UgZmlsbCBvdXQgdGhlIGJ1ZmZlciBkZXNjcmlwdG9yOgorICAgIG5TaXJTdGF0dXMgPSBsaW1Qb3B1bGF0ZU1hY0hlYWRlciggcE1hYywgcEZyYW1lLCBTSVJfTUFDX01HTVRfRlJBTUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfTUdNVF9BQ1RJT04sIHBlZXIpOworICAgIGlmICggZ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XN0IGFsbG9jYXRlZC4uLgorICAgIH0KKworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMVcKKyAgICBsaW1TZXRQcm90ZWN0ZWRCaXQocE1hYywgcHNlc3Npb25FbnRyeSwgcGVlciwgcE1hY0hkcik7CisjZW5kaWYKKworICAgIG5TdGF0dXMgPSBkb3QxMWZQYWNrVFBDUmVwb3J0KCBwTWFjLCAmZnJtLCBwRnJhbWUgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY01nbXRIZHIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuUGF5bG9hZCwgJm5QYXlsb2FkICk7CisgICAgaWYgKCBET1QxMUZfRkFJTEVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIHBhY2sgYSBUUEMgUmVwb3J0ICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgIG5TdGF0dXMgKTsKKyAgICAgICAgcGFsUGt0RnJlZSggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOyAgICAvLyBhbGxvY2F0ZWQhCisgICAgfQorICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dXLCBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBwYWNraW5nIGEgVCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiUEMgUmVwb3J0ICgweCUwOHgpLiIpLCBuU3RhdHVzICk7CisgICAgfQorCisKKyAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9NR01ULAorICAgICAgICAgICAoKHBzZXNzaW9uRW50cnkpPyBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCA6IE5PX1NFU1NJT04pLAorICAgICAgICAgICBwTWFjSGRyLT5mYy5zdWJUeXBlKSk7CisgICAgaGFsc3RhdHVzID0gaGFsVHhGcmFtZSggcE1hYywgcFBhY2tldCwgKCB0QU5JX1UxNiApIG5CeXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQU5JX1RYRElSX1RPRFMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgNywvL1NNQUNfU1dCRF9UWF9USURfTUdNVF9ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVR4Q29tcGxldGUsIHBGcmFtZSwgMCApOworICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RYX0NPTVBMRVRFLAorICAgICAgICAgICAoKHBzZXNzaW9uRW50cnkpPyBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCA6IE5PX1NFU1NJT04pLAorICAgICAgICAgICBoYWxzdGF0dXMpKTsKKyAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTICggaGFsc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIHNlbmQgYSBUUEMgUmVwb3J0ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKCVYKSEiKSwKKyAgICAgICAgICAgICAgICBuU2lyU3RhdHVzICk7CisgICAgICAgIC8vUGt0IHdpbGwgYmUgZnJlZWQgdXAgYnkgdGhlIGNhbGxiYWNrCisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7ICAgIC8vIGp1c3QgYWxsb2NhdGVkLi4uCisgICAgfQorCisgICAgcmV0dXJuIGVTSVJfU1VDQ0VTUzsKKworfSAvLyBFbmQgbGltU2VuZFRwY1JlcG9ydEZyYW1lLgorI2VuZGlmICAvL0FOSV9TVVBQT1JUXzExSAorCisKKy8qKgorICogXGJyaWVmIFNlbmQgYSBDaGFubmVsIFN3aXRjaCBBbm5vdW5jZW1lbnQKKyAqCisgKgorICogXHBhcmFtIHBNYWMgUG9pbnRlciB0byB0aGUgZ2xvYmFsIE1BQyBkYXRhc3RydWN0dXJlCisgKgorICogXHBhcmFtIHBlZXIgTUFDIGFkZHJlc3MgdG8gd2hpY2ggdGhpcyBmcmFtZSB3aWxsIGJlIHNlbnQKKyAqCisgKiBccGFyYW0gbk1vZGUKKyAqCisgKiBccGFyYW0gbk5ld0NoYW5uZWwKKyAqCisgKiBccGFyYW0gbkNvdW50CisgKgorICogXHJldHVybiBlU0lSX1NVQ0NFU1Mgb24gc3VjY2VzcywgZVNJUl9GQUlMVVJFIGVsc2UKKyAqCisgKgorICovCisKK3RTaXJSZXRTdGF0dXMKK2xpbVNlbmRDaGFubmVsU3dpdGNoTWdtdEZyYW1lKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjQWRkciAgICBwZWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAgICAgICAgbk1vZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICAgICAgICBuTmV3Q2hhbm5lbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggICAgICAgIG5Db3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uICAgIHBzZXNzaW9uRW50cnkgKQoreworICAgIHREb3QxMWZDaGFubmVsU3dpdGNoICAgZnJtOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgKnBGcmFtZTsKKyAgICB0U2lyUmV0U3RhdHVzICAgICAgICAgIG5TaXJTdGF0dXM7CisgICAgdHBTaXJNYWNNZ210SGRyICAgICAgICBwTWFjSGRyOworICAgIHRBTklfVTMyICAgICAgICAgICAgICAgbkJ5dGVzLCBuUGF5bG9hZCwgblN0YXR1czsvLywgbkNmZzsKKyAgICB2b2lkICAgICAgICAgICAgICAgICAgICpwUGFja2V0OworICAgIGVIYWxTdGF0dXMgICAgICAgICAgICAgaGFsc3RhdHVzOworICAgIHRBTklfVTMyICAgICAgICAgICAgICAgdHhGbGFnID0gMDsKKyAgICAKKyAgICB2b3NfbWVtX3NldCggKCB0QU5JX1U4KiApJmZybSwgc2l6ZW9mKCBmcm0gKSwgMCApOworCisgICAgZnJtLkNhdGVnb3J5LmNhdGVnb3J5ICAgICA9IFNJUl9NQUNfQUNUSU9OX1NQRUNUUlVNX01HTVQ7CisgICAgZnJtLkFjdGlvbi5hY3Rpb24gICAgICAgICA9IFNJUl9NQUNfQUNUSU9OX0NIQU5ORUxfU1dJVENIX0lEOworICAgIGZybS5DaGFuU3dpdGNoQW5uLnN3aXRjaE1vZGUgICAgPSBuTW9kZTsKKyAgICBmcm0uQ2hhblN3aXRjaEFubi5uZXdDaGFubmVsICAgID0gbk5ld0NoYW5uZWw7CisgICAgZnJtLkNoYW5Td2l0Y2hBbm4uc3dpdGNoQ291bnQgICA9IG5Db3VudDsKKyAgICBmcm0uQ2hhblN3aXRjaEFubi5wcmVzZW50ID0gMTsKKworICAgIG5TdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRDaGFubmVsU3dpdGNoU2l6ZSggcE1hYywgJmZybSwgJm5QYXlsb2FkICk7CisgICAgaWYgKCBET1QxMUZfRkFJTEVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dQLCBGTCgiRmFpbGVkIHRvIGNhbGN1bGF0ZSB0aGUgcGFja2VkIHNpemUgZiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3IgYSBDaGFubmVsIFN3aXRjaCAoMHglMDh4KS4iKSwKKyAgICAgICAgICAgICAgICBuU3RhdHVzICk7CisgICAgICAgIC8vIFdlJ2xsIGZhbGwgYmFjayBvbiB0aGUgd29yc3QgY2FzZSBzY2VuYXJpbzoKKyAgICAgICAgblBheWxvYWQgPSBzaXplb2YoIHREb3QxMWZDaGFubmVsU3dpdGNoICk7CisgICAgfQorICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dXLCBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBjYWxjdWxhdGluZyAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInRoZSBwYWNrZWQgc2l6ZSBmb3IgYSBDaGFubmVsIFN3aXRjaCAoMHgiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiUwOHgpLiIpLCBuU3RhdHVzICk7CisgICAgfQorCisgICAgbkJ5dGVzID0gblBheWxvYWQgKyBzaXplb2YoIHRTaXJNYWNNZ210SGRyICk7CisKKyAgICBoYWxzdGF0dXMgPSBwYWxQa3RBbGxvYyggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCAoIHRBTklfVTE2ICluQnl0ZXMsICggdm9pZCoqICkgJnBGcmFtZSwgKCB2b2lkKiogKSAmcFBhY2tldCApOworICAgIGlmICggISBIQUxfU1RBVFVTX1NVQ0NFU1MgKCBoYWxzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1AsIEZMKCJGYWlsZWQgdG8gYWxsb2NhdGUgJWQgYnl0ZXMgZm9yIGEgVFBDIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgUmVwb3J0LiIpLCBuQnl0ZXMgKTsKKyAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICB9CisKKyAgICAvLyBQYXJhbm9pYToKKyAgICB2b3NfbWVtX3NldCggcEZyYW1lLCBuQnl0ZXMsID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cFBhY2tldCwgKCB0QU5JX1UxNiApIG5CeXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQU5JX1RYRElSX1RPRFMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgNywvL1NNQUNfU1dCRF9UWF9USURfTUdNVF9ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVR4Q29tcGxldGUsIHBGcmFtZSwgdHhGbGFnICk7CisgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfVFhfQ09NUExFVEUsCisgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLAorICAgICAgICAgICBoYWxzdGF0dXMpKTsKKyAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTICggaGFsc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIHNlbmQgYSBDaGFubmVsIFN3aXRjaCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiglWCkhIiksCisgICAgICAgICAgICAgICAgblNpclN0YXR1cyApOworICAgICAgICAvL1BrdCB3aWxsIGJlIGZyZWVkIHVwIGJ5IHRoZSBjYWxsYmFjaworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKworICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7CisKK30gLy8gRW5kIGxpbVNlbmRDaGFubmVsU3dpdGNoTWdtdEZyYW1lLgorCisKKworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDICAgIAordFNpclJldFN0YXR1cworbGltU2VuZFZIVE9wbW9kZU5vdGlmaWNhdGlvbkZyYW1lKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjQWRkciAgICBwZWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAgICAgICAgbk1vZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiAgICBwc2Vzc2lvbkVudHJ5ICkKK3sKKyAgICB0RG90MTFmT3BlcmF0aW5nTW9kZSAgIGZybTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICpwRnJhbWU7CisgICAgdFNpclJldFN0YXR1cyAgICAgICAgICBuU2lyU3RhdHVzOworICAgIHRwU2lyTWFjTWdtdEhkciAgICAgICAgcE1hY0hkcjsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgIG5CeXRlcywgblBheWxvYWQgPSAwLCBuU3RhdHVzOy8vLCBuQ2ZnOworICAgIHZvaWQgICAgICAgICAgICAgICAgICAgKnBQYWNrZXQ7CisgICAgZUhhbFN0YXR1cyAgICAgICAgICAgICBoYWxzdGF0dXM7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICB0eEZsYWcgPSAwOworICAgIAorICAgIHZvc19tZW1fc2V0KCAoIHRBTklfVTgqICkmZnJtLCBzaXplb2YoIGZybSApLCAwICk7CisKKyAgICBmcm0uQ2F0ZWdvcnkuY2F0ZWdvcnkgICAgID0gU0lSX01BQ19BQ1RJT05fVkhUOworICAgIGZybS5BY3Rpb24uYWN0aW9uICAgICAgICAgPSBTSVJfTUFDX1ZIVF9PUE1PREVfTk9USUZJQ0FUSU9OOworICAgIGZybS5PcGVyYXRpbmdNb2RlLmNoYW5XaWR0aCAgICA9IG5Nb2RlOworICAgIGZybS5PcGVyYXRpbmdNb2RlLnJ4TlNTICAgPSAwOworICAgIGZybS5PcGVyYXRpbmdNb2RlLnJ4TlNTVHlwZSAgICA9IDA7CisKKyAgICBuU3RhdHVzID0gZG90MTFmR2V0UGFja2VkT3BlcmF0aW5nTW9kZVNpemUoIHBNYWMsICZmcm0sICZuUGF5bG9hZCApOworICAgIGlmICggRE9UMTFGX0ZBSUxFRCggblN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HUCwgRkwoIkZhaWxlZCB0byBjYWxjdWxhdGUgdGhlIHBhY2tlZCBzaXplIGYiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm9yIGEgT3BlcmF0aW5nIE1vZGUgKDB4JTA4eCkuIiksCisgICAgICAgICAgICAgICAgblN0YXR1cyApOworICAgICAgICAvLyBXZSdsbCBmYWxsIGJhY2sgb24gdGhlIHdvcnN0IGNhc2Ugc2NlbmFyaW86CisgICAgICAgIG5QYXlsb2FkID0gc2l6ZW9mKCB0RG90MTFmT3BlcmF0aW5nTW9kZSk7CisgICAgfQorICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dXLCBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBjYWxjdWxhdGluZyAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInRoZSBwYWNrZWQgc2l6ZSBmb3IgYSBPcGVyYXRpbmcgTW9kZSAoMHgiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiUwOHgpLiIpLCBuU3RhdHVzICk7CisgICAgfQorCisgICAgbkJ5dGVzID0gblBheWxvYWQgKyBzaXplb2YoIHRTaXJNYWNNZ210SGRyICk7CisKKyAgICBoYWxzdGF0dXMgPSBwYWxQa3RBbGxvYyggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCAoIHRBTklfVTE2ICluQnl0ZXMsICggdm9pZCoqICkgJnBGcmFtZSwgKCB2b2lkKiogKSAmcFBhY2tldCApOworICAgIGlmICggISBIQUxfU1RBVFVTX1NVQ0NFU1MgKCBoYWxzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1AsIEZMKCJGYWlsZWQgdG8gYWxsb2NhdGUgJWQgYnl0ZXMgZm9yIGEgT3BlcmF0aW5nIE1vZGUiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBSZXBvcnQuIiksIG5CeXRlcyApOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKworICAgIC8vIFBhcmFub2lhOgorICAgIHZvc19tZW1fc2V0KCBwRnJhbWUsIG5CeXRlcywgMCApOworCisKKyAgICAvLyBOZXh0LCB3ZSBmaWxsIG91dCB0aGUgYnVmZmVyIGRlc2NyaXB0b3I6CisgICAgaWYocHNlc3Npb25FbnRyeS0+cGVQZXJzb25hID09IFZPU19TVEFfU0FQX01PREUpIHsKKyAgICAgICAgblNpclN0YXR1cyA9IGxpbVBvcHVsYXRlTWFjSGVhZGVyKCBwTWFjLCBwRnJhbWUsIFNJUl9NQUNfTUdNVF9GUkFNRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX01HTVRfQUNUSU9OLCBwZWVyLCBwc2Vzc2lvbkVudHJ5LT5zZWxmTWFjQWRkcik7CisgICAgfSBlbHNlCisgICAgICAgIG5TaXJTdGF0dXMgPSBsaW1Qb3B1bGF0ZU1hY0hlYWRlciggcE1hYywgcEZyYW1lLCBTSVJfTUFDX01HTVRfRlJBTUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX01BQ19NR01UX0FDVElPTiwgcHNlc3Npb25FbnRyeS0+YnNzSWQsIHBzZXNzaW9uRW50cnktPnNlbGZNYWNBZGRyKTsKKyAgICBwTWFjSGRyID0gKCB0cFNpck1hY01nbXRIZHIgKSBwRnJhbWU7CisgICAgdm9zX21lbV9jb3B5KCAodEFOSV9VOCAqKSBwTWFjSGRyLT5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopIHBzZXNzaW9uRW50cnktPmJzc0lkLAorICAgICAgICAgICAgICAgICAgc2l6ZW9mKCB0U2lyTWFjQWRkciApKTsKKyAgICBpZiAoIGVTSVJfU1VDQ0VTUyAhPSBuU2lyU3RhdHVzICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBwb3B1bGF0ZSB0aGUgYnVmZmVyIGRlc2NyaXAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInRvciBmb3IgYSBPcGVyYXRpbmcgTW9kZSAoJWQpLiIpLAorICAgICAgICAgICAgICAgIG5TaXJTdGF0dXMgKTsKKyAgICAgICAgcGFsUGt0RnJlZSggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOyAgICAvLyBqdXN0IGFsbG9jYXRlZC4uLgorICAgIH0KKyAgICBuU3RhdHVzID0gZG90MTFmUGFja09wZXJhdGluZ01vZGUoIHBNYWMsICZmcm0sIHBGcmFtZSArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY01nbXRIZHIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgblBheWxvYWQsICZuUGF5bG9hZCApOworICAgIGlmICggRE9UMTFGX0ZBSUxFRCggblN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBwYWNrIGEgT3BlcmF0aW5nIE1vZGUgKDB4JTA4eCkuIiksCisgICAgICAgICAgICAgICAgblN0YXR1cyApOworICAgICAgICBwYWxQa3RGcmVlKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsICggdm9pZCogKSBwRnJhbWUsICggdm9pZCogKSBwUGFja2V0ICk7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7ICAgIC8vIGFsbG9jYXRlZCEKKyAgICB9CisgICAgZWxzZSBpZiAoIERPVDExRl9XQVJORUQoIG5TdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csIEZMKCJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIHBhY2tpbmcgYSBPcGVyYXRpbmcgTW9kZSIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiICgweCUwOHgpLiIpLCBuU3RhdHVzICk7CisgICAgfQorICAgIGlmKCAoIFNJUl9CQU5EXzVfR0haID09IGxpbUdldFJGQmFuZChwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwpKQorICAgICAgIHx8ICggcHNlc3Npb25FbnRyeS0+cGVQZXJzb25hID09IFZPU19QMlBfQ0xJRU5UX01PREUgKSB8fAorICAgICAgICAgKCBwc2Vzc2lvbkVudHJ5LT5wZVBlcnNvbmEgPT0gVk9TX1AyUF9HT19NT0RFKQorICAgICAgICAgKQorICAgIHsKKyAgICAgICAgdHhGbGFnIHw9IEhBTF9VU0VfQkRfUkFURTJfRk9SX01BTkFHRU1FTlRfRlJBTUU7CisgICAgfQorCisgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfVFhfTUdNVCwKKyAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgICAgIHBNYWNIZHItPmZjLnN1YlR5cGUpKTsKKyAgICBoYWxzdGF0dXMgPSBoYWxUeEZyYW1lKCBwTWFjLCBwUGFja2V0LCAoIHRBTklfVTE2ICkgbkJ5dGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTklfVFhESVJfVE9EUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA3LC8vU01BQ19TV0JEX1RYX1RJRF9NR01UX0hJR0gsCisgICAgICAgICAgICAgICAgICAgIC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mlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNBZGRyICAgIHBlZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICAgICAgICBuQ2hhbldpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAgICAgICAgbk5ld0NoYW5uZWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICAgICAgICBuY2JNb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gICAgcHNlc3Npb25FbnRyeSApCit7CisgICAgdERvdDExZkNoYW5uZWxTd2l0Y2ggICBmcm07CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAqcEZyYW1lOworICAgIHRTaXJSZXRTdGF0dXMgICAgICAgICAgblNpclN0YXR1czsKKyAgICB0cFNpck1hY01nbXRIZHIgICAgICAgIHBNYWNIZHI7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICBuQnl0ZXMsIG5QYXlsb2FkLCBuU3RhdHVzOy8vLCBuQ2ZnOworICAgIHZvaWQgICAgICAgICAgICAgICAgICAgKnBQYWNrZXQ7CisgICAgZUhhbFN0YXR1cyAgICAgICAgICAgICBoYWxzdGF0dXM7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICB0eEZsYWcgPSAwOworICAgIAorICAgIHZvc19tZW1fc2V0KCAoIHRBTklfVTgqICkmZnJtLCBzaXplb2YoIGZybSApLCAwICk7CisgICAgICAgICAgICAgICAgCisKKyAgICBmcm0uQ2F0ZWdvcnkuY2F0ZWdvcnkgICAgID0gU0lSX01BQ19BQ1RJT05fU1BFQ1RSVU1fTUdNVDsKKyAgICBmcm0uQWN0aW9uLmFjdGlvbiAgICAgICAgID0gU0lSX01BQ19BQ1RJT05fQ0hBTk5FTF9TV0lUQ0hfSUQ7CisgICAgZnJtLkNoYW5Td2l0Y2hBbm4uc3dp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ZhbGwgYmFjayBvbiB0aGUgd29yc3QgY2FzZSBzY2VuYXJpbzoKKyAgICAgICAgblBheWxvYWQgPSBzaXplb2YoIHREb3QxMWZDaGFubmVsU3dpdGNoICk7CisgICAgfQorICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dXLCBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBjYWxjdWxhdGluZyAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInRoZSBwYWNrZWQgc2l6ZSBmb3IgYSBDaGFubmVsIFN3aXRjaCAoMHgiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiUwOHgpLiIpLCBuU3RhdHVzICk7CisgICAgfQorCisgICAgbkJ5dGVzID0gblBheWxvYWQgKyBzaXplb2YoIHRTaXJNYWNNZ210SGRyICk7CisKKyAgICBoYWxzdGF0dXMgPSBwYWxQa3RBbGxvYyggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCAoIHRBTklfVTE2ICluQnl0ZXMsICggdm9pZCoqICkgJnBGcmFtZSwgKCB2b2lkKiogKSAmcFBhY2tldCApOworICAgIGlmICggISBIQUxfU1RBVFVTX1NVQ0NFU1MgKCBoYWxzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1AsIEZMKCJGYWlsZWQgdG8gYWxsb2NhdGUgJWQgYnl0ZXMgZm9yIGEgVFBDIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgUmVwb3J0LiIpLCBuQnl0ZXMgKTsKKyAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICB9CisgICAvLyBQYXJhbm9pYToKKyAgICB2b3NfbWVtX3NldCggcEZyYW1lLCBuQnl0ZXMsIDAgKTsKKworICAgIC8vIE5leHQsIHdlIGZpbGwgb3V0IHRoZSBidWZmZXIgZGVzY3JpcHRvcjoKKyAgICBuU2lyU3RhdHVzID0gbGltUG9wdWxhdGVNYWNIZWFkZXIoIHBNYWMsIHBGcmFtZSwgU0lSX01BQ19NR01UX0ZSQU1FLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX01HTVRfQUNUSU9OLCBwZWVyLCBwc2Vzc2lvbkVudHJ5LT5zZWxmTWFjQWRkcik7CisgICAgcE1hY0hkciA9ICggdHBTaXJNYWNNZ210SGRyICkgcEZyYW1lOworICAgIHZvc19tZW1fY29weSggKHRBTklfVTggKikgcE1hY0hkci0+YnNzSWQsCisgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSBwc2Vzc2lvbkVudHJ5LT5ic3NJZCwKKyAgICAgICAgICAgICAgICAgIHNpemVvZiggdFNpck1hY0FkZHIgKSk7CisgICAgaWYgKCBlU0lSX1NVQ0NFU1MgIT0gblNpclN0YXR1cyApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gcG9wdWxhdGUgdGhlIGJ1ZmZlciBkZXNjcmlwIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0b3IgZm9yIGEgQ2hhbm5lbCBTd2l0Y2ggKCVkKS4iKSwKKyAgICAgICAgICAgICAgICBuU2lyU3RhdHVzICk7CisgICAgICAgIHBhbFBrdEZyZWUoIHBNYWMtPmhIZGQsIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwgKCB2b2lkKiApIHBGcmFtZSwgKCB2b2lkKiApIHBQYWNrZXQgKTsKKyAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsgICAgLy8ganVzdCBhbGxvY2F0ZWQuLi4KKyAgICB9CisgICAgblN0YXR1cyA9IGRvdDExZlBhY2tDaGFubmVsU3dpdGNoKCBwTWFjLCAmZnJtLCBwRnJhbWUgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNNZ210SGRyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5QYXlsb2FkLCAmblBheWxvYWQgKTsKKyAgICBpZiAoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gcGFjayBhIENoYW5uZWwgU3dpdGNoICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgIG5TdGF0dXMgKTsKKyAgICAgICAgcGFsUGt0RnJlZSggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOyAgICAvLyBhbGxvY2F0ZWQhCisgICAgfQorICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dXLCBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBwYWNraW5nIGEgQyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaGFubmVsIFN3aXRjaCAoMHglMDh4KS4iKSwgblN0YXR1cyApOworICAgIH0KKworICAgIGlmKCAoIFNJUl9CQU5EXzVfR0haID09IGxpbUdldFJGQmFuZChwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwpKQorICAgICAgIHx8ICggcHNlc3Npb25FbnRyeS0+cGVQZXJzb25hID09IFZPU19QMlBfQ0xJRU5UX01PREUgKSB8fAorICAgICAgICAgKCBwc2Vzc2lvbkVudHJ5LT5wZVBlcnNvbmEgPT0gVk9TX1AyUF9HT19NT0RFKQorICAgICAgICAgKQorICAgIHsKKyAgICAgICAgdHhGbGFnIHw9IEhBTF9VU0VfQkRfUkFURTJfRk9SX01BTkFHRU1FTlRfRlJBTUU7CisgICAgfQorCisgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfVFhfTUdNVCwKKyAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgICAgIHBNYWNIZHItPmZjLnN1YlR5cGUpKTsKKyAgICBoYWxzdGF0dXMgPSBoYWxUeEZyYW1lKCBwTWFjLCBwUGFja2V0LCAoIHRBTklfVTE2ICkgbkJ5dGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTklfVFhESVJfVE9EUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA3LC8vU01BQ19TV0JEX1RYX1RJRF9NR01UX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltVHhDb21wbGV0ZSwgcEZyYW1lLCB0eEZsYWcgKTsKKyAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9DT01QTEVURSwKKyAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgICAgIGhhbHN0YXR1cykpOworICAgIGlmICggISBIQUxfU1RBVFVTX1NVQ0NFU1MgKCBoYWxzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gc2VuZCBhIENoYW5uZWwgU3dpdGNoICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKCVYKSEiKSwKKyAgICAgICAgICAgICAgICBuU2lyU3RhdHVzICk7CisgICAgICAgIC8vUGt0IHdpbGwgYmUgZnJlZWQgdXAgYnkgdGhlIGNhbGxiYWNrCisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorCisgICAgcmV0dXJuIGVTSVJfU1VDQ0VTUzs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yAwIC0gaW5kaWNhdGVzIG5vIEJBIHRpbWVvdXQKKyAgICBmcm1BZGRCQVJlcS5CQVRpbWVvdXQudGltZW91dCA9IHBNbG1BZGRCQVJlcS0+YmFUaW1lb3V0OworCisgICAgLyogU2VuZCBTU04gd2hhdGV2ZXIgd2UgZ2V0IGZyb20gRlcuCisgICAgICovCisgICAgZnJtQWRkQkFSZXEuQkFTdGFydGluZ1NlcXVlbmNlQ29udHJvbC5zc24gPSBwTWxtQWRkQkFSZXEtPmJhU1NOOworCisgICAgblN0YXR1cyA9IGRvdDExZkdldFBhY2tlZEFkZEJBUmVxU2l6ZSggcE1hYywgJmZybUFkZEJBUmVxLCAmblBheWxvYWQgKTsKKworICAgIGlmKCBET1QxMUZfRkFJTEVEKCBuU3RhdHVzICkpCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csCisgICAgICAgIEZMKCAiRmFpbGVkIHRvIGNhbGN1bGF0ZSB0aGUgcGFja2VkIHNpemUgZm9yICIKKyAgICAgICAgICAiYW4gQUREQkEgUmVxdWVzdCAoMHglMDh4KS4iKSwKKyAgICAgICAgblN0YXR1cyApOworCisgICAgICAgIC8vIFdlJ2xsIGZhbGwgYmFjayBvbiB0aGUgd29yc3QgY2FzZSBzY2VuYXJpbzoKKyAgICAgICAgblBheWxvYWQgPSBzaXplb2YoIHREb3QxMWZBZGRCQVJlcSApOworICAgIH0KKyAgICBlbHNlIGlmKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkpCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csCisgICAgICAgIEZMKCAiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBjYWxjdWxhdGluZyAiCisgICAgICAgICAgInRoZSBwYWNrZWQgc2l6ZSBmb3IgYW4gQUREQkEgUmVxICgweCUwOHgpLiIpLAorICAgICAgICBuU3RhdHVzICk7CisgICAgfQorCisgICAgLy8gQWRkIHRoZSBNR01UIGhlYWRlciB0byBmcmFtZSBsZW5ndGgKKyAgICBmcmFtZUxlbiA9IG5QYXlsb2FkICsgc2l6ZW9mKCB0U2lyTWFjTWdtdEhkciApOworCisgICAgLy8gTmVlZCB0byBhbGxvY2F0ZSBhIGJ1ZmZlciBmb3IgQUREQkEgQUYKKyAgICBpZiggZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPQorICAgICAgKGhhbFN0YXR1cyA9IHBhbFBrdEFsbG9jKCBwTWFjLT5oSGRkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1UxNikgZnJhbWVMZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICoqKSAmcEFkZEJBUmVxQnVmZmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKikgJnBQYWNrZXQgKSkpCisgICAgeworICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dQLAorICAgICAgICBGTCgicGFsUGt0QWxsb2MgRkFJTEVEISBMZW5ndGggWyVkXSwgU3RhdHVzIFslZF0iKSwKKyAgICAgICAgZnJhbWVMZW4sCisgICAgICAgIGhhbFN0YXR1cyApOworCisgICAgICAgIHN0YXR1c0NvZGUgPSBlU0lSX01FTV9BTExPQ19GQUlMRUQ7CisgICAgICAgIGdvdG8gcmV0dXJuQWZ0ZXJFcnJvcjsKKyAgICB9CisKKyAgICB2b3NfbWVtX3NldCggKHZvaWQgKikgcEFkZEJBUmVxQnVmZmVyLCBmcmFtZUxlbiwgMCApOworCisgICAgLy8gQ29weSBuZWNlc3NhcnkgaW5mbyB0byBCRAorICAgIGlmKCBlU0lSX1NVQ0NFU1MgIT0KKyAgICAgIChzdGF0dXNDb2RlID0gbGltUG9wdWxhdGVNYWNIZWFkZXIoIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGRCQVJlcUJ1ZmZlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX01BQ19NR01UX0ZSQU1FLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX01HTVRfQUNUSU9OLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWxtQWRkQkFSZXEtPnBlZXJNYWNBZGRyLHBzZXNzaW9uRW50cnktPnNlbGZNYWNBZGRyKSkpCisgICAgZ290byByZXR1cm5BZnRlckVycm9yOworCisgICAgLy8gVXBkYXRlIEEzIHdpdGggdGhlIEJTU0lECisgICAgcE1hY0hkciA9ICggdHBTaXJNYWNNZ210SGRyICkgcEFkZEJBUmVxQnVmZmVyOworICAgIAorICAgICNpZiAwCisgICAgY2ZnTGVuID0gU0lSX01BQ19BRERSX0xFTkdUSDsKKyAgICBpZiggZVNJUl9TVUNDRVNTICE9IGNmZ0dldFN0ciggcE1hYywKKyAgICAgICAgV05JX0NGR19CU1NJRCwKKyAgICAgICAgKHRBTklfVTggKikgcE1hY0hkci0+YnNzSWQsCisgICAgICAgICZjZmdMZW4gKSkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HUCwKKyAgICAgICAgRkwoICJGYWlsZWQgdG8gcmV0cmlldmUgV05JX0NGR19CU1NJRCB3aGlsZSIKKyAgICAgICAgICAic2VuZGluZyBhbiBBQ1RJT04gRnJhbWUiICkpOworCisgICAgICAgIC8vIEZJWE1FIC0gTmVlZCB0byBjb252ZXJ0IHRvIHRTaXJSZXRTdGF0dXMKKyAgICAgICAgc3RhdHVzQ29kZSA9IGVTSVJfRkFJTFVSRTsKKyAgICAgICAgZ290byByZXR1cm5BZnRlckVycm9yOworICAgIH0KKyAgICAjZW5kaWYvL1RPIFNVUFBPUlQgQlQtQU1QCisgICAgc2lyQ29weU1hY0FkZHIocE1hY0hkci0+YnNzSWQscHNlc3Npb25FbnRyeS0+YnNzSWQpOworCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgIGxpbVNldFByb3RlY3RlZEJpdChwTWFjLCBwc2Vzc2lvbkVudHJ5LCBwTWxtQWRkQkFSZXEtPnBlZXJNYWNBZGRyLCBwTWFjSGRyKTsKKyNlbmRpZgorCisgICAgLy8gTm93LCB3ZSdyZSByZWFkeSB0byAicGFjayIgdGhlIGZyYW1lcworICAgIG5TdGF0dXMgPSBkb3QxMWZQYWNrQWRkQkFSZXEoIHBNYWMsCisgICAgICAmZnJtQWRkQkFSZXEsCisgICAgICBwQWRkQkFSZXFCdWZmZXIgKyBzaXplb2YoIHRTaXJNYWNNZ210SGRyICksCisgICAgICBuUGF5bG9hZCwKKyAgICAgICZuUGF5bG9hZCApOworCisgICAgaWYoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwKKyAgICAgICAgRkwoICJGYWlsZWQgdG8gcGFjayBhbiBBRERCQSBSZXEgKDB4JTA4eCkuIiApLAorICAgICAgICBuU3RhdHVzICk7CisKKyAgICAgICAgLy8gRklYTUUgLSBOZWVkIHRvIGNvbnZlcnQgdG8gdFNpclJldFN0YXR1cworICAgICAgICBzdGF0dXNDb2RlID0gZVNJUl9GQUlMVVJFOworICAgICAgICBnb3RvIHJldHVybkFmdGVyRXJyb3I7CisgICAgfQorICAgIGVsc2UgaWYoIERPVDExRl9XQVJORUQoIG5TdGF0dXMgKSkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HVywKKyAgICAgICAgICAgICAgICBGTCggIlRoZXJlIHdlcmUgd2FybmluZ3Mgd2hpbGUgcGFja2luZyBhbiBBRERCQSBSZXEgKDB4JTA4eCkuIiksCisgICAgICAgICAgICAgICAgblN0YXR1cyApOworICAgIH0KKworICAgIGxpbUxvZyggcE1hYywgTE9HMSwgRkwoICJTZW5kaW5nIGFuIEFEREJBIFJFUSB0byAiTUFDX0FERFJFU1NfU1RSICIgd2l0aCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIHRpZCA9ICVkIHBvbGljeSA9ICVkIGJ1ZmZzaXplID0gJWQgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgYW1zZHVTdXBwb3J0ZWQgPSAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBNbG1BZGRCQVJlcS0+cGVlck1hY0FkZHIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZybUFkZEJBUmVxLkFkZEJBUGFyYW1ldGVyU2V0LnRpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm1BZGRCQVJlcS5BZGRCQVBhcmFtZXRlclNldC5wb2xpY3ksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJtQWRkQkFSZXEuQWRkQkFQYXJhbWV0ZXJTZXQuYnVmZmVyU2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm1BZGRCQVJlcS5BZGRCQVBhcmFtZXRlclNldC5hbXNkdVN1cHBvcnRlZCk7CisKKyAgICBsaW1Mb2coIHBNYWMsIExPRzEsIEZMKCAic3NuID0gJWQgZnJhZ051bSA9ICVkIiApLAorICAgICAgICAgICAgICAgICAgICAgICAgICBmcm1BZGRCQVJlcS5CQVN0YXJ0aW5nU2VxdWVuY2VDb250cm9sLnNzbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZnJtQWRkQkFSZXEuQkFTdGFydGluZ1NlcXVlbmNlQ29udHJvbC5mcmFnTnVtYmVyKTsKKworICAgIGlmKCAoIFNJUl9CQU5EXzVfR0haID09IGxpbUdldFJGQmFuZChwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwpKQorICAgICAgIHx8ICggcHNlc3Npb25FbnRyeS0+cGVQZXJzb25hID09IFZPU19QMlBfQ0xJRU5UX01PREUgKSB8fAorICAgICAgICAgKCBwc2Vzc2lvbkVudHJ5LT5wZVBlcnNvbmEgPT0gVk9TX1AyUF9HT19NT0RFKQorICAgICAgICAgKQorICAgIHsKKyAgICAgICAgdHhGbGFnIHw9IEhBTF9VU0VfQkRfUkFURTJfRk9SX01BTkFHRU1FTlRfRlJBTUU7CisgICAgfQorCisgICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfVFhfTUdNVCwKKyAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgICAgIHBNYWNIZHItPmZjLnN1YlR5cGUpKTsKKyAgICBoYWxTdGF0dXMgPSBoYWxUeEZyYW1lKCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQYWNrZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTE2KSBmcmFtZUxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQU5JX1RYRElSX1RPRFMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgNywvL1NNQUNfU1dCRF9UWF9USURfTUdNVF9ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVR4Q29tcGxldGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkZEJBUmVxQnVmZmVyLCB0eEZsYWcgKTsKKyAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9DT01QTEVURSwKKyAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgICAgIGhhbFN0YXR1cykpOworICAgIGlmKCBlSEFMX1NUQVRVU19TVUNDRVNTICE9IGhhbFN0YXR1cyApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsCisgICAgICAgIEZMKCAiaGFsVHhGcmFtZSBGQUlMRUQhIFN0YXR1cyBbJWRdIiksCisgICAgIC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iAgICAgICAgIGVTSVJfRkFJTFVSRSBpcyBzb21lIHByb2JsZW0gaXMgZW5jb3VudGVyZWQKKyAqLwordFNpclJldFN0YXR1cyBsaW1TZW5kQWRkQkFSc3AoIHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgdHBMaW1NbG1BZGRCQVJzcCBwTWxtQWRkQkFSc3AsCisgICAgdHBQRVNlc3Npb24gICAgICBwc2Vzc2lvbkVudHJ5KQoreworICAgIHREb3QxMWZBZGRCQVJzcCAgIGZybUFkZEJBUnNwOworICAgIHRBTklfVTggICAgICAgICAgKnBBZGRCQVJzcEJ1ZmZlciA9IE5VTEw7CisgICAgdHBTaXJNYWNNZ210SGRyICAgcE1hY0hkcjsKKyAgICB0QU5JX1UzMiAgICAgICAgICBmcmFtZUxlbiA9IDAsIG5TdGF0dXMsIG5QYXlsb2FkOworICAgIHRTaXJSZXRTdGF0dXMgICAgIHN0YXR1c0NvZGU7CisgICAgZUhhbFN0YXR1cyAgICAgICAgaGFsU3RhdHVzOworICAgIHZvaWQgICAgICAgICAgICAgKnBQYWNrZXQ7CisgICAgdEFOSV9VMzIgICAgICAgICAgdHhGbGFnID0gMDsKKworICAgICBpZihOVUxMID09IHBzZXNzaW9uRW50cnkpCisgICAgeworICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJTZXNzaW9uIGVudHJ5IGlzIE5VTEwhISEiKSk7KQorICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKworICAgICAgdm9zX21lbV9zZXQoICh2b2lkICopICZmcm1BZGRCQVJzcCwgc2l6ZW9mKCBmcm1BZGRCQVJzcCApLCAwKTsKKworICAgICAgLy8gQ2F0ZWdvcnkgLSAzIChCQSkKKyAgICAgIGZybUFkZEJBUnNwLkNhdGVnb3J5LmNhdGVnb3J5ID0gU0lSX01BQ19BQ1RJT05fQkxLQUNLOworICAgICAgLy8gQWN0aW9uIC0gMSAoQUREQkEgUnNwKQorICAgICAgZnJ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1cHBvcnRlZCA9IDA7CisgICAgICB9CisKKyAgICAgIC8vIEJBIHRpbWVvdXQKKyAgICAgIC8vIDAgLSBpbmRpY2F0ZXMgbm8gQkEgdGltZW91dAorICAgICAgZnJtQWRkQkFSc3AuQkFUaW1lb3V0LnRpbWVvdXQgPSBwTWxtQWRkQkFSc3AtPmJhVGltZW91dDsKKworICAgICAgblN0YXR1cyA9IGRvdDExZkdldFBhY2tlZEFkZEJBUnNwU2l6ZSggcE1hYywgJmZybUFkZEJBUnNwLCAmblBheWxvYWQgKTsKKworICAgICAgaWYoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSkKKyAgICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dXLAorICAgICAgICAgICAgRkwoICJGYWlsZWQgdG8gY2FsY3VsYXRlIHRoZSBwYWNrZWQgc2l6ZSBmb3IgIgorICAgICAgICAgICAgICAiYW4gQUREQkEgUmVzcG9uc2UgKDB4JTA4eCkuIiksCisgICAgICAgICAgICBuU3RhdHVzICk7CisKKyAgICAgICAgLy8gV2UnbGwgZmFsbCBiYWNrIG9uIHRoZSB3b3JzdCBjYXNlIHNjZW5hcmlvOgorICAgICAgICBuUGF5bG9hZCA9IHNpemVvZiggdERvdDExZkFkZEJBUnNwICk7CisgICAgICB9CisgICAgICBlbHNlIGlmKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkpCisgICAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HVywKKyAgICAgICAgICAgIEZMKCAiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBjYWxjdWxhdGluZyAiCisgICAgICAgICAgICAgICJ0aGUgcGFja2VkIHNpemUgZm9yIGFuIEFEREJBIFJzcCAoMHglMDh4KS4iKSwKKyAgICAgICAgICAgIG5TdGF0dXMgKTsKKyAgICAgIH0KKworICAgICAgLy8gTmVlZCB0byBhbGxvY2F0ZSBhIGJ1ZmZlciBmb3IgQUREQkEgQUYKKyAgICAgIGZyYW1lTGVuID0gblBheWxvYWQgKyBzaXplb2YoIHRTaXJNYWNNZ210SGRyICk7CisKKyAgICAgIC8vIEFsbG9jYXRlIHNoYXJlZCBtZW1vcnkKKyAgICAgIGlmKCBlSEFMX1NUQVRVU19TVUNDRVNTICE9CisgICAgICAgICAgKGhhbFN0YXR1cyA9IHBhbFBrdEFsbG9jKCBwTWFjLT5oSGRkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTE2KSBmcmFtZUxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICoqKSAmcEFkZEJBUnNwQnVmZmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKiopICZwUGFja2V0ICkpKQorICAgICAgeworICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dQLAorICAgICAgICAgICAgRkwoInBhbFBrdEFsbG9jIEZBSUxFRCEgTGVuZ3RoIFslZF0sIFN0YXR1cyBbJWRdIiksCisgICAgICAgICAgICBmcmFtZUxlbiwKKyAgICAgICAgICAgIGhhbFN0YXR1cyApOworCisgICAgICAgIHN0YXR1c0NvZGUgPSBlU0lSX01FTV9BTExPQ19GQUlMRUQ7CisgICAgICAgIGdvdG8gcmV0dXJuQWZ0ZXJFcnJvcjsKKyAgICAgIH0KKworICAgICAgdm9zX21lbV9zZXQoICh2b2lkICopIHBBZGRCQVJzcEJ1ZmZlciwgZnJhbWVMZW4sIDAgKTsKKworICAgICAgLy8gQ29weSBuZWNlc3NhcnkgaW5mbyB0byBCRAorICAgICAgaWYoIGVTSVJfU1VDQ0VTUyAhPQorICAgICAgICAgIChzdGF0dXNDb2RlID0gbGltUG9wdWxhdGVNYWNIZWFkZXIoIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRkQkFSc3BCdWZmZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX01HTVRfRlJBTUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX01HTVRfQUNUSU9OLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1sbUFkZEJBUnNwLT5wZWVyTWFjQWRkcixwc2Vzc2lvbkVudHJ5LT5zZWxmTWFjQWRkcikpKQorICAgICAgICBnb3RvIHJldHVybkFmdGVyRXJyb3I7CisKKyAgICAgIC8vIFVwZGF0ZSBBMyB3aXRoIHRoZSBCU1NJRAorICAgICAgCisgICAgICBwTWFjSGRyID0gKCB0cFNpck1hY01nbXRIZHIgKSBwQWRkQkFSc3BCdWZmZXI7CisgICAgICAKKyAgICAgICNpZiAwCisgICAgICBjZmdMZW4gPSBTSVJfTUFDX0FERFJfTEVOR1RIOworICAgICAgaWYoIGVTSVJfU1VDQ0VTUyAhPSB3bGFuX2NmZ0dldFN0ciggcE1hYywKKyAgICAgICAgICAgIFdOSV9DRkdfQlNTSUQsCisgICAgICAgICAgICAodEFOSV9VOCAqKSBwTWFjSGRyLT5ic3NJZCwKKyAgICAgICAgICAgICZjZmdMZW4gKSkKKyAgICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dQLAorICAgICAgICAgICAgRkwoICJGYWlsZWQgdG8gcmV0cmlldmUgV05JX0NGR19CU1NJRCB3aGlsZSIKKyAgICAgICAgICAgICAgInNlbmRpbmcgYW4gQUNUSU9OIEZyYW1lIiApKTsKKworICAgICAgICAvLyBGSVhNRSAtIE5lZWQgdG8gY29udmVydCB0byB0U2lyUmV0U3RhdHVzCisgICAgICAgIHN0YXR1c0NvZGUgPSBlU0lSX0ZBSUxVUkU7CisgICAgICAgIGdvdG8gcmV0dXJuQWZ0ZXJFcnJvcjsKKyAgICAgIH0KKyAgICAgICNlbmRpZiAvLyBUTyBTVVBQT1JUIEJULUFNUAorICAgICAgc2lyQ29weU1hY0FkZHIocE1hY0hkci0+YnNzSWQscHNlc3Npb25FbnRyeS0+YnNzSWQpOworCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgICAgbGltU2V0UHJvdGVjdGVkQml0KHBNYWMsIHBzZXNzaW9uRW50cnksIHBNbG1BZGRCQVJzcC0+cGVlck1hY0FkZHIsIHBNYWNIZHIpOworI2VuZGlmCisKKyAgICAgIC8vIE5vdywgd2UncmUgcmVhZHkgdG8gInBhY2siIHRoZSBmcmFtZXMKKyAgICAgIG5TdGF0dXMgPSBkb3QxMWZQYWNrQWRkQkFSc3AoIHBNYWMsCisgICAgICAgICAgJmZybUFkZEJBUnNwLAorICAgICAgICAgIHBBZGRCQVJzcEJ1ZmZlciArIHNpemVvZiggdFNpck1hY01nbXRIZHIgKSwKKyAgICAgICAgICBuUGF5bG9hZCwKKyAgICAgICAgICAmblBheWxvYWQgKTsKKworICAgICAgaWYoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSkKKyAgICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLAorICAgICAgICAgICAgRkwoICJGYWlsZWQgdG8gcGFjayBhbiBBRERCQSBSc3AgKDB4JTA4eCkuIiApLAorICAgICAgICAgICAgblN0YXR1cyApOworCisgICAgICAgIC8vIEZJWE1FIC0gTmVlZCB0byBjb252ZXJ0IHRvIHRTaXJSZXRTdGF0dXMKKyAgICAgICAgc3RhdHVzQ29kZSA9IGVTSVJfRkFJTFVSRTsKKyAgICAgICAgZ290byByZXR1cm5BZnRlckVycm9yOworICAgICAgfQorICAgICAgZWxzZSBpZiggRE9UMTFGX1dBUk5FRCggblN0YXR1cyApKQorICAgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csCisgICAgICAgICAgICAgICAgRkwoICJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIHBhY2tpbmcgYW4gQUREQkEgUnNwICgweCUwOHgpLiIgKSwKKyAgICAgICAgICAgICAgICBuU3RhdHVzKTsKKyAgICAgIH0KKworICAgICAgbGltTG9nKCBwTWFjLCBMT0cxLCBGTCggIlNlbmRpbmcgYW4gQUREQkEgUlNQIHRvICJNQUNfQUREUkVTU19TVFIgIiB3aXRoIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiB0aWQgPSAlZCBwb2xpY3kgPSAlZCBidWZmc2l6ZSA9ICVkIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBhbXNkdVN1cHBvcnRlZCA9ICVkIHN0YXR1cyAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocE1sbUFkZEJBUnNwLT5wZWVyTWFjQWRkciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm1BZGRCQVJzcC5BZGRCQVBhcmFtZXRlclNldC50aWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm1BZGRCQVJzcC5BZGRCQVBhcmFtZXRlclNldC5wb2xpY3ksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm1BZGRCQVJzcC5BZGRCQVBhcmFtZXRlclNldC5idWZmZXJTaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJtQWRkQkFSc3AuQWRkQkFQYXJhbWV0ZXJTZXQuYW1zZHVTdXBwb3J0ZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm1BZGRCQVJzcC5TdGF0dXMuc3RhdHVzKTsKKworCisgICAgaWYoICggU0lSX0JBTkRfNV9HSFogPT0gbGltR2V0UkZCYW5kKHBzZXNzaW9uRW50cnktPmN1cnJlbnRPcGVyQ2hhbm5lbCkpCisgICAgICAgfHwgKCBwc2Vzc2lvbkVudHJ5LT5wZVBlcnNvbmEgPT0gVk9TX1AyUF9DTElFTlRfTU9ERSApIHx8CisgICAgICAgICAoIHBzZXNzaW9uRW50cnktPnBlUGVyc29uYSA9PSBWT1NfUDJQX0dPX01PREUpCisgICAgICAgICApCisgICAgeworICAgICAgICB0eEZsYWcgfD0gSEFMX1VTRV9CRF9SQVRFMl9GT1JfTUFOQUdFTUVOVF9GUkFNRTsKKyAgICB9CisKKyAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9NR01ULAorICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwKKyAgICAgICAgICAgcE1hY0hkci0+ZmMuc3ViVHlwZSkpOworICAgIGhhbFN0YXR1cyA9IGhhbFR4RnJhbWUoIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFBhY2tldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VMTYpIGZyYW1lTGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTklfVFhESVJfVE9EUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA3LC8vU01BQ19TV0JEX1RYX1RJRF9NR01UX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltVHhDb21wbGV0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRkQkFSc3BCdWZmZXIsIHR4RmxhZyApOworICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RYX0NPTVBMRVRFLAorICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwKKyAgICAgICAgICAgaGFsU3RhdHVzKSk7CisgICAgaWYoIGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gaGFsU3RhdHVzICkKKyAgICB7CisgICAgbGltTG9nKCBwTWFjLCBMT0dFLAorICAgICAgICBGTCggImhhbFR4RnJhbWUgRkFJTEVEISBTdGF0dXMgWyVkXSIgKSwKKyAg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QgY2FzZSBzY2VuYXJpbzoKKyAgICAgICAgblBheWxvYWQgPSBzaXplb2YoIHREb3QxMWZEZWxCQUluZCApOworICAgICAgfQorICAgICAgZWxzZSBpZiggRE9UMTFGX1dBUk5FRCggblN0YXR1cyApKQorICAgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csCisgICAgICAgICAgICBGTCggIlRoZXJlIHdlcmUgd2FybmluZ3Mgd2hpbGUgY2FsY3VsYXRpbmcgIgorICAgICAgICAgICAgICAidGhlIHBhY2tlZCBzaXplIGZvciBhbiBERUxCQSBJbmQgKDB4JTA4eCkuIiksCisgICAgICAgICAgICBuU3RhdHVzICk7CisgICAgICB9CisKKyAgICAgIC8vIEFkZCB0aGUgTUdNVCBoZWFkZXIgdG8gZnJhbWUgbGVuZ3RoCisgICAgICBmcmFtZUxlbiA9IG5QYXlsb2FkICsgc2l6ZW9mKCB0U2lyTWFjTWdtdEhkciApOworCisgICAgICAvLyBBbGxvY2F0ZSBzaGFyZWQgbWVtb3J5CisgICAgICBpZiggZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPQorICAgICAgICAgIChoYWxTdGF0dXMgPSBwYWxQa3RBbGxvYyggcE1hYy0+aEhkZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1UxNikgZnJhbWVMZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKikgJnBEZWxCQUluZEJ1ZmZlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICoqKSAmcFBhY2tldCApKSkKKyAgICAgIHsKKyAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HUCwKKyAgICAgICAgICAgIEZMKCJwYWxQa3RBbGxvYyBGQUlMRUQhIExlbmd0aCBbJWRdLCBTdGF0dXMgWyVkXSIpLAorICAgICAgICAgICAgZnJhbWVMZW4sCisgICAgICAgICAgICBoYWxTdGF0dXMgKTsKKworICAgICAgICBzdGF0dXNDb2RlID0gZVNJUl9NRU1fQUxMT0NfRkFJTEVEOworICAgICAgICBnb3RvIHJldHVybkFmdGVyRXJyb3I7CisgICAgICB9CisKKyAgICAgIHZvc19tZW1fc2V0KCAodm9pZCAqKSBwRGVsQkFJbmRCdWZmZXIsIGZyYW1lTGVuLCAwICk7CisKKyAgICAgIC8vIENvcHkgbmVjZXNzYXJ5IGluZm8gdG8gQkQKKyAgICAgIGlmKCBlU0lSX1NVQ0NFU1MgIT0KKyAgICAgICAgICAoc3RhdHVzQ29kZSA9IGxpbVBvcHVsYXRlTWFjSGVhZGVyKCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERlbEJBSW5kQnVmZmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX01BQ19NR01UX0ZSQU1FLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX01BQ19NR01UX0FDVElPTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNbG1EZWxCQVJlcS0+cGVlck1hY0FkZHIscHNlc3Npb25FbnRyeS0+c2VsZk1hY0FkZHIpKSkKKyAgICAgICAgZ290byByZXR1cm5BZnRlckVycm9yOworCisgICAgICAvLyBVcGRhdGUgQTMgd2l0aCB0aGUgQlNTSUQKKyAgICAgIHBNYWNIZHIgPSAoIHRwU2lyTWFjTWdtdEhkciApIHBEZWxCQUluZEJ1ZmZlcjsKKyAgICAgIAorICAgICAgI2lmIDAKKyAgICAgIGNmZ0xlbiA9IFNJUl9NQUNfQUREUl9MRU5HVEg7CisgICAgICBpZiggZVNJUl9TVUNDRVNTICE9IGNmZ0dldFN0ciggcE1hYywKKyAgICAgICAgICAgIFdOSV9DRkdfQlNTSUQsCisgICAgICAgICAgICAodEFOSV9VOCAqKSBwTWFjSGRyLT5ic3NJZCwKKyAgICAgICAgICAgICZjZmdMZW4gKSkKKyAgICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dQLAorICAgICAgICAgICAgRkwoICJGYWlsZWQgdG8gcmV0cmlldmUgV05JX0NGR19CU1NJRCB3aGlsZSIKKyAgICAgICAgICAgICAgInNlbmRpbmcgYW4gQUNUSU9OIEZyYW1lIiApKTsKKworICAgICAgICAvLyBGSVhNRSAtIE5lZWQgdG8gY29udmVydCB0byB0U2lyUmV0U3RhdHVzCisgICAgICAgIHN0YXR1c0NvZGUgPSBlU0lSX0ZBSUxVUkU7CisgICAgICAgIGdvdG8gcmV0dXJuQWZ0ZXJFcnJvcjsKKyAgICAgIH0KKyAgICAgICNlbmRpZiAvL1RPIFNVUFBPUlQgQlQtQU1QCisgICAgICBzaXJDb3B5TWFjQWRkcihwTWFjSGRyLT5ic3NJZCxwc2Vzc2lvbkVudHJ5LT5ic3NJZCk7CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisgICAgICBsaW1TZXRQcm90ZWN0ZWRCaXQocE1hYywgcHNlc3Npb25FbnRyeSwgcE1sbURlbEJBUmVxLT5wZWVyTWFjQWRkciwgcE1hY0hkcik7CisjZW5kaWYKKworICAgICAgLy8gTm93LCB3ZSdyZSByZWFkeSB0byAicGFjayIgdGhlIGZyYW1lcworICAgICAgblN0YXR1cyA9IGRvdDExZlBhY2tEZWxCQUluZCggcE1hYywKKyAgICAgICAgICAmZnJtRGVsQkFJbmQsCisgICAgICAgICAgcERlbEJBSW5kQnVmZmVyICsgc2l6ZW9mKCB0U2lyTWFjTWdtdEhkciApLAorICAgICAgICAgIG5QYXlsb2FkLAorICAgICAgICAgICZuUGF5bG9hZCApOworCisgICAgICBpZiggRE9UMTFGX0ZBSUxFRCggblN0YXR1cyApKQorICAgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsCisgICAgICAgICAgICBGTCggIkZhaWxlZCB0byBwYWNrIGFuIERFTEJBIEluZCAoMHglMDh4KS4iICksCisgICAgICAgICAgICBuU3RhdHVzICk7CisKKyAgICAgICAgLy8gRklYTUUgLSBOZWVkIHRvIGNvbnZlcnQgdG8gdFNpclJldFN0YXR1cworICAgICAgICBzdGF0dXNDb2RlID0gZVNJUl9GQUlMVVJFOworICAgICAgICBnb3RvIHJldHVybkFmdGVyRXJyb3I7CisgICAgICB9CisgICAgICBlbHNlIGlmKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkpCisgICAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HVywKKyAgICAgICAgICAgICAgICBGTCggIlRoZXJlIHdlcmUgd2FybmluZ3Mgd2hpbGUgcGFja2luZyBhbiBERUxCQSBJbmQgKDB4JTA4eCkuIiApLAorICAgICAgICAgICAgICAgIG5TdGF0dXMpOworICAgICAgfQorCisgICAgICBsaW1Mb2coIHBNYWMsIExPRzEsCisgICAgICAgICAgICBGTCggIlNlbmRpbmcgYSBERUxCQSBJTkQgdG86ICJNQUNfQUREUkVTU19TVFIiIHdpdGggVGlkID0gJWQiCisgICAgICAgICAgICAiIGluaXRpYXRvciA9ICVkIHJlYXNvbiA9ICVkIiApLAorICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocE1sbURlbEJBUmVxLT5wZWVyTWFjQWRkciksCisgICAgICAgICAgICBmcm1EZWxCQUluZC5EZWxCQVBhcmFtZXRlclNldC50aWQsCisgICAgICAgICAgICBmcm1EZWxCQUluZC5EZWxCQVBhcmFtZXRlclNldC5pbml0aWF0b3IsCisgICAgICAgICAgICBmcm1EZWxCQUluZC5SZWFzb24uY29kZSk7CisKKworICAgIGlmKCAoIFNJUl9CQU5EXzVfR0haID09IGxpbUdldFJGQmFuZChwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwpKQorICAgICAgIHx8ICggcHNlc3Npb25FbnRyeS0+cGVQZXJzb25hID09IFZPU19QMlBfQ0xJRU5UX01PREUgKSB8fAorICAgICAgICAgKCBwc2Vzc2lvbkVudHJ5LT5wZVBlcnNvbmEgPT0gVk9TX1AyUF9HT19NT0RFKQorICAgICAgICAgKQorICAgIHsKKyAgICAgICAgdHhGbGFnIHw9IEhBTF9VU0VfQkRfUkFURTJfRk9SX01BTkFHRU1FTlRfRlJBTUU7CisgICAgfQorCisgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9NR01ULAorICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLAorICAgICAgICAgIHBNYWNIZHItPmZjLnN1YlR5cGUpKTsKKyAgIGhhbFN0YXR1cyA9IGhhbFR4RnJhbWUoIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwUGFja2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTE2KSBmcmFtZUxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTF9UWFJYX0ZSTV84MDJfMTFfTUdNVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIEFOSV9UWERJUl9UT0RTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgNywvL1NNQUNfU1dCRF9UWF9USURfTUdNVF9ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltVHhDb21wbGV0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEZWxCQUluZEJ1ZmZlciwgdHhGbGFnICk7CisgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9DT01QTEVURSwKKyAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwKKyAgICAgICAgICBoYWxTdGF0dXMpKTsKKyAgaWYoIGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gaGFsU3RhdHVzICkKKyAgeworICAgIFBFTE9HRShsaW1Mb2coIHBNYWMsIExPR0UsIEZMK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Mgb24gc3VjY2VzcywgZVNJUl9GQUlMVVJFIGVsc2UKKyAqCisgKgorICovCisKK3RTaXJSZXRTdGF0dXMKK2xpbVNlbmROZWlnaGJvclJlcG9ydFJlcXVlc3RGcmFtZSh0cEFuaVNpckdsb2JhbCAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJNYWNOZWlnaGJvclJlcG9ydFJlcSBwTmVpZ2hib3JSZXEsCisgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNBZGRyICAgICAgICAgICAgICAgIHBlZXIsCisgICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkKKyAgICAgICAgICAgICAgICAgICAgICAgKQoreworICAgdFNpclJldFN0YXR1cyAgICAgICAgICAgICAgICBzdGF0dXNDb2RlID0gZVNJUl9TVUNDRVNTOworICAgdERvdDExZk5laWdoYm9yUmVwb3J0UmVxdWVzdCBmcm07CisgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgICpwRnJhbWU7CisgICB0cFNpck1hY01nbXRIZHIgICAgICAgICAgICAgIHBNYWNIZHI7CisgICB0QU5JX1UzMiAgICAgICAgICAgICAgICAgICAgIG5CeXRlcywgblBheWxvYWQsIG5TdGF0dXM7CisgICB2b2lkICAgICAgICAgICAgICAgICAgICAgICAgICpwUGFja2V0OworICAgZUhhbFN0YXR1cyAgICAgICAgICAgICAgICAgICBoYWxzdGF0dXM7CisgICB0QU5JX1UzMiAgICAgICAgICAgICAgICAgICAgIHR4RmxhZyA9IDA7CisKKyAgIGlmICggcHNlc3Npb25FbnRyeSA9PSBOVUxMICkKKyAgIHsKKyAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIihwc2Vzc2lvbiA9PSBOVUxMKSBpbiBSZXF1ZXN0IHRvIHNlbmQgTmVpZ2hib3IgUmVwb3J0IHJlcXVlc3QgYWN0aW9uIGZyYW1lIikgKTsKKyAgICAgIHJldHVybiBlU0lSX0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gICAgICAgICBTSVJfTUFDX01HTVRfQUNUSU9OLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZWVyLCBwc2Vzc2lvbkVudHJ5LT5zZWxmTWFjQWRkcikpKQorICAgICAgZ290byByZXR1cm5BZnRlckVycm9yOworCisgICAvLyBVcGRhdGUgQTMgd2l0aCB0aGUgQlNTSUQKKyAgIHBNYWNIZHIgPSAoIHRwU2lyTWFjTWdtdEhkciApIHBGcmFtZTsKKworICAgc2lyQ29weU1hY0FkZHIoIHBNYWNIZHItPmJzc0lkLCBwc2Vzc2lvbkVudHJ5LT5ic3NJZCApOworCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgbGltU2V0UHJvdGVjdGVkQml0KHBNYWMsIHBzZXNzaW9uRW50cnksIHBlZXIsIHBNYWNIZHIpOworI2VuZGlmCisKKyAgIC8vIE5vdywgd2UncmUgcmVhZHkgdG8gInBhY2siIHRoZSBmcmFtZXMKKyAgIG5TdGF0dXMgPSBkb3QxMWZQYWNrTmVpZ2hib3JSZXBvcnRSZXF1ZXN0KCBwTWFjLAorICAgICAgICAgJmZybSwKKyAgICAgICAgIHBGcmFtZSArIHNpemVvZiggdFNpck1hY01nbXRIZHIgKSwKKyAgICAgICAgIG5QYXlsb2FkLAorICAgICAgICAgJm5QYXlsb2FkICk7CisKKyAgIGlmKCBET1QxMUZfRkFJTEVEKCBuU3RhdHVzICkpCisgICB7CisgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsCisgICAgICAgICAgICBGTCggIkZhaWxlZCB0byBwYWNrIGFuIE5laWdoYm9yIFJlcG9ydCBSZXF1ZXN0ICgweCUwOHgpLiIgKSwKKyAgICAgICAgICAgIG5TdGF0dXMgKTsKKworICAgICAgLy8gRklYTUUgLSBOZWVkIHRvIGNvbnZlcnQgdG8gdFNpclJldFN0YXR1cworICAgICAgc3RhdHVzQ29kZSA9IGVTSVJfRkFJTFVSRTsKKyAgICAgIGdvdG8gcmV0dXJuQWZ0ZXJFcnJvcjsKKyAgIH0KKyAgIGVsc2UgaWYoIERPVDExRl9XQVJORUQoIG5TdGF0dXMgKSkKKyAgIHsKKyAgICAgIGxpbUxvZyggcE1hYywgTE9HVywKKyAgICAgICAgICAgICAgRkwoICJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIHBhY2tpbmcgTmVpZ2hib3IgUmVwb3J0ICIKKyAgICAgICAgICAgICAgICAgICJSZXF1ZXN0ICgweCUwOHgpLiIgKSwgblN0YXR1cyk7CisgICB9CisKKyAgIGxpbUxvZyggcE1hYywgTE9HVywKKyAgICAgICAgIEZMKCAiU2VuZGluZyBhIE5laWdoYm9yIFJlcG9ydCBSZXF1ZXN0IHRvICIgKSk7CisgICBsaW1QcmludE1hY0FkZHIoIHBNYWMsIHBlZXIsIExPR1cgKTsKKworICAgIGlmKCAoIFNJUl9CQU5EXzVfR0haID09IGxpbUdldFJGQmFuZChwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwpKQorICAgICAgIHx8ICggcHNlc3Npb25FbnRyeS0+cGVQZXJzb25hID09IFZPU19QMlBfQ0xJRU5UX01PREUgKSB8fAorICAgICAgICAgKCBwc2Vzc2lvbkVudHJ5LT5wZVBlcnNvbmEgPT0gVk9TX1AyUF9HT19NT0RFKQorICAgICAgICAgKQorICAgIHsKKyAgICAgICAgdHhGbGFnIHw9IEhBTF9VU0VfQkRfUkFURTJfRk9SX01BTkFHRU1FTlRfRlJBTUU7CisgICAgfQorCisgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9NR01ULAorICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLAorICAgICAgICAgIHBNYWNIZHItPmZjLnN1YlR5cGUpKTsKKyAgIGhhbHN0YXR1cyA9IGhhbFR4RnJhbWUoIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwUGFja2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTE2KSBuQnl0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBBTklfVFhESVJfVE9EUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIDcsLy9TTUFDX1NXQkRfVFhfVElEX01HTVRfSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVR4Q29tcGxldGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwRnJhbWUsIHR4RmxhZyApOworICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfVFhfQ09NUExFVEUsCisgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgICAgaGFsc3RhdHVzKSk7CisgICBpZiggZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSBoYWxzdGF0dXMgKQorICAgeworICAgICAgUEVMT0dFKGxpbUxvZyggcE1hYywgTE9HRSwgRkwoICJoYWxUeEZyYW1lIEZBSUxFRCEgU3RhdHVzIFslZF0iICksIGhhbHN0YXR1cyApOykKKyAgICAgICAgIHN0YXR1c0NvZGUgPSBlU0lSX0ZBSUxVUkU7CisgICAgICAvL1BrdCB3aWxsIGJlIGZyZWVkIHVwIGJ5IHRoZSBjYWxsYmFjaworICAgICAgcmV0dXJuIHN0YXR1c0NvZGU7CisgICB9CisgICBlbHNlCisgICAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworCityZXR1cm5BZnRlckVycm9yOgorICAgcGFsUGt0RnJlZSggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCAoIHZvaWQqICkgcEZyYW1lLCAoIHZvaWQqICkgcFBhY2tldCApOworCisgICByZXR1cm4gc3RhdHVzQ29kZTsKK30gLy8gRW5kIGxpbVNlbmROZWlnaGJvclJlcG9ydFJlcXVlc3RGcmFtZS4KKworLyoqCisgKiBcYnJpZWYgU2VuZCBhIExpbmsgUmVwb3J0IEFjdGlvbiBmcmFtZQorICoKKyAqCisgKiBccGFyYW0gcE1hYyBQb2ludGVyIHRvIHRoZSBnbG9iYWwgTUFDIHN0cnVjdHVyZQorICoKKyAqIFxwYXJhbSBwTGlua1JlcG9ydCBBZGRyZXNzIG9mIGEgdFNpck1hY0xpbmtSZXBvcnQKKyAqCisgKiBccGFyYW0gcGVlciBtYWMgYWRkcmVzcyBvZiBwZWVyIHN0YXRpb24uCisgKgorICogXHBhcmFtIHBzZXNzaW9uRW50cnkgYWRkcmVzcyBvZiBzZXNzaW9uIGVudHJ5LgorICoKKyAqIFxyZXR1cm4gZVNJUl9TVUNDRVNTIG9uIHN1Y2Nlc3MsIGVTSVJfRkFJTFVSRSBlbHNlCisgKgorICoKKyAqLworCit0U2lyUmV0U3RhdHVzCitsaW1TZW5kTGlua1JlcG9ydEFjdGlvbkZyYW1lKHRwQW5pU2lyR2xvYmFsICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICB0cFNpck1hY0xpbmtSZXBvcnQgcExpbmtSZXBvcnQsCisgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNBZGRyICAgICAgICAgICAgICAgIHBlZXIsCisgICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkKKyAgICAgICAgICAgICAgICAgICAgICAgKQoreworICAgdFNpclJldFN0YXR1cyAgICAgICAgICAgICAgICBzdGF0dXNDb2RlID0gZVNJUl9TVUNDRVNTOworICAgdERvdDExZkxpbmtNZWFzdXJlbWVudFJlcG9ydCBmcm07CisgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgICpwRnJhbWU7CisgICB0cFNpck1hY01nbXRIZHIgICAgICAgICAgICAgIHBNYWNIZHI7CisgICB0QU5JX1UzMiAgICAgICAgICAgICAgICAgICAgIG5CeXRlcywgblBheWxvYWQsIG5TdGF0dXM7CisgICB2b2lkICAgICA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JnBQYWNrZXQgKTsKKyAgIGlmICggISBIQUxfU1RBVFVTX1NVQ0NFU1MgKCBoYWxzdGF0dXMgKSApCisgICB7CisgICAgICBsaW1Mb2coIHBNYWMsIExPR1AsIEZMKCJGYWlsZWQgdG8gYWxsb2NhdGUgJWQgYnl0ZXMgZm9yIGEgTGluayAiCisgICAgICAgICAgICAgICAiUmVwb3J0LiIpLCBuQnl0ZXMgKTsKKyAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICB9CisKKyAgIC8vIFBhcmFub2lhOgorICAgdm9zX21lbV9zZXQoIHBGcmFtZSwgbkJ5dGVzLCAwICk7CisKKyAgIC8vIENvcHkgbmVjZXNzYXJ5IGluZm8gdG8gQkQKKyAgIGlmKCBlU0lSX1NVQ0NFU1MgIT0KKyAgICAgICAgIChzdGF0dXNDb2RlID0gbGltUG9wdWxhdGVNYWNIZWFkZXIoIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX01BQ19NR01UX0ZSQU1FLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX01HTVRfQUNUSU9OLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZWVyLCBwc2Vzc2lvbkVudHJ5LT5zZWxmTWFjQWRkcikpKQorICAgICAgZ290byByZXR1cm5BZnRlckVycm9yOworCisgICAvLyBVcGRhdGUgQTMgd2l0aCB0aGUgQlNTSUQKKyAgIHBNYWNIZHIgPSAoIHRwU2lyTWFjTWdtdEhkciApIHBGcmFtZTsKKworICAgc2lyQ29weU1hY0FkZHIoIHBNYWNIZHItPmJzc0lkLCBwc2Vzc2lvbkVudHJ5LT5ic3NJZCApOworCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgbGltU2V0UHJvdGVjdGVkQml0KHBNYWMsIHBzZXNzaW9uRW50cnksIHBlZXIsIHBNYWNIZHIpOworI2VuZGlmCisKKyAgIC8vIE5vdywgd2UncmUgcmVhZHkgdG8gInBhY2siIHRoZSBmcmFtZXMKKyAgIG5TdGF0dXMgPSBkb3QxMWZQYWNrTGlua01lYXN1cmVtZW50UmVwb3J0KCBwTWFjLAorICAgICAgICAgJmZybSwKKyAgICAgICAgIHBGcmFtZSArIHNpemVvZiggdFNpck1hY01nbXRIZHIgKSwKKyAgICAgICAgIG5QYXlsb2FkLAorICAgICAgICAgJm5QYXlsb2FkICk7CisKKyAgIGlmKCBET1QxMUZfRkFJTEVEKCBuU3RhdHVzICkpCisgICB7CisgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsCisgICAgICAgICAgICBGTCggIkZhaWxlZCB0byBwYWNrIGFuIExpbmsgUmVwb3J0ICgweCUwOHgpLiIgKSwKKyAgICAgICAgICAgIG5TdGF0dXMgKTsKKworICAgICAgLy8gRklYTUUgLSBOZWVkIHRvIGNvbnZlcnQgdG8gdFNpclJldFN0YXR1cworICAgICAgc3RhdHVzQ29kZSA9IGVTSVJfRkFJTFVSRTsKKyAgICAgIGdvdG8gcmV0dXJuQWZ0ZXJFcnJvcjsKKyAgIH0KKyAgIGVsc2UgaWYoIERPVDExRl9XQVJORUQoIG5TdGF0dXMgKSkKKyAgIHsKKyAgICAgIGxpbUxvZyggcE1hYywgTE9HVywKKyAgICAgICAgICAgICAgRkwoICJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIHBhY2tpbmcgTGluayBSZXBvcnQgKDB4JTA4eCkuIiApLAorICAgICAgICAgICAgICBuU3RhdHVzICk7CisgICB9CisKKyAgIGxpbUxvZyggcE1hYywgTE9HVywKKyAgICAgICAgIEZMKCAiU2VuZGluZyBhIExpbmsgUmVwb3J0IHRvICIgKSk7CisgICBsaW1QcmludE1hY0FkZHIoIHBNYWMsIHBlZXIsIExPR1cgKTsKKworICAgIGlmKCAoIFNJUl9CQU5EXzVfR0haID09IGxpbUdldFJGQmFuZChwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwpKQorICAgICAgIHx8ICggcHNlc3Npb25FbnRyeS0+cGVQZXJzb25hID09IFZPU19QMlBfQ0xJRU5UX01PREUgKSB8fAorICAgICAgICAgKCBwc2Vzc2lvbkVudHJ5LT5wZVBlcnNvbmEgPT0gVk9TX1AyUF9HT19NT0RFKQorICAgICAgICAgKQorICAgIHsKKyAgICAgICAgdHhGbGFnIHw9IEhBTF9VU0VfQkRfUkFURTJfRk9SX01BTkFHRU1FTlRfRlJBTUU7CisgICAgfQorCisgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9NR01ULAorICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLAorICAgICAgICAgIHBNYWNIZHItPmZjLnN1YlR5cGUpKTsKKyAgIGhhbHN0YXR1cyA9IGhhbFR4RnJhbWUoIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwUGFja2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTE2KSBuQnl0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBBTklfVFhESVJfVE9EUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIDcsLy9TTUFDX1NXQkRfVFhfVElEX01HTVRfSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVR4Q29tcGxldGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwRnJhbWUsIHR4RmxhZyApOworICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfVFhfQ09NUExFVEUsCisgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgICAgaGFsc3RhdHVzKSk7CisgICBpZiggZUhBTF9TVEFUVVNfU1VDQ0VTU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npb25FbnRyeSBhZGRyZXNzIG9mIHNlc3Npb24gZW50cnkuCisgKgorICogXHJldHVybiBlU0lSX1NVQ0NFU1Mgb24gc3VjY2VzcywgZVNJUl9GQUlMVVJFIGVsc2UKKyAqCisgKgorICovCisKK3RTaXJSZXRTdGF0dXMKK2xpbVNlbmRSYWRpb01lYXN1cmVSZXBvcnRBY3Rpb25GcmFtZSh0cEFuaVNpckdsb2JhbCAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAgICAgICAgICAgICAgZGlhbG9nX3Rva2VuLAorICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICAgICAgICAgICAgICBudW1fcmVwb3J0LAorICAgICAgICAgICAgICAgICAgICAgICB0cFNpck1hY1JhZGlvTWVhc3VyZVJlcG9ydCBwUlJNUmVwb3J0LAorICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjQWRkciAgICAgICAgICAgICAgICBwZWVyLAorICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5CisgICAgICAgICAgICAgICAgICAgICAgICkKK3sKKyAgIHRTaXJSZXRTdGF0dXMgICAgICBzdGF0dXNDb2RlID0gZVNJUl9TVUNDRVNTOworICAgdEFOSV9VOCAgICAgICAgICAgICpwRnJhbWU7CisgICB0cFNpck1hY01nbXRIZHIgICAgcE1hY0hkcjsKKyAgIHRBTklfVTMyICAgICAgICAgICBuQnl0ZXMsIG5QYXlsb2FkLCBuU3RhdHVzOworICAgdm9pZCAgICAgICAgICAgICAgICpwUGFja2V0OworICAgZUhhbFN0YXR1cyAgICAgICAgIGhhbHN0YXR1czsKKyAgIHRBTklfVTggICAgICAgICAgICBpOworICAgdEFOSV9VMzIgICAgICAgICAgIHR4RmxhZyA9IDA7CisKKyAgIHREb3QxMWZSYWRpb01lYXN1cmVtZW50UmVwb3J0ICpmcm0gPQorICAgICAgICAgdm9zX21lbV9tYWxsb2Moc2l6ZW9mKH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iogKSAmcFBhY2tldCApOworICAgaWYgKCAhIEhBTF9TVEFUVVNfU1VDQ0VTUyAoIGhhbHN0YXR1cyApICkKKyAgIHsKKyAgICAgIGxpbUxvZyggcE1hYywgTE9HUCwgRkwoIkZhaWxlZCB0byBhbGxvY2F0ZSAlZCBieXRlcyBmb3IgYSBSYWRpbyBNZWFzdXJlICIKKyAgICAgICAgICAgICAgICJSZXBvcnQuIiksIG5CeXRlcyApOworICAgICAgdm9zX21lbV9mcmVlKGZybSk7CisgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgfQorCisgICAvLyBQYXJhbm9pYToKKyAgIHZvc19tZW1fc2V0KCBwRnJhbWUsIG5CeXRlcywgMCApOworCisgICAvLyBDb3B5IG5lY2Vzc2FyeSBpbmZvIHRvIEJECisgICBpZiggZVNJUl9TVUNDRVNTICE9CisgICAgICAgICAoc3RhdHVzQ29kZSA9IGxpbVBvcHVsYXRlTWFjSGVhZGVyKCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfTUdNVF9GUkFNRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX01BQ19NR01UX0FDVElPTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVlciwgcHNlc3Npb25FbnRyeS0+c2VsZk1hY0FkZHIpKSkKKyAgICAgIGdvdG8gcmV0dXJuQWZ0ZXJFcnJvcjsKKworICAgLy8gVXBkYXRlIEEzIHdpdGggdGhlIEJTU0lECisgICBwTWFjSGRyID0gKCB0cFNpck1hY01nbXRIZHIgKSBwRnJhbWU7CisKKyAgIHNpckNvcHlNYWNBZGRyKCBwTWFjSGRyLT5ic3NJZCwgcHNlc3Npb25FbnRyeS0+YnNzSWQgKTsKKworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMVcKKyAgIGxpbVNldFByb3RlY3RlZEJpdChwTWFjLCBwc2Vzc2lvbkVudHJ5LCBwZWVyLCBwTWFjSGRyKTsKKyNlbmRpZgorCisgICAvLyBOb3csIHdlJ3JlIHJlYWR5IHRvICJwYWNrIiB0aGUgZnJhbWVzCisgICBuU3RhdHVzID0gZG90MTFmUGFja1JhZGlvTWVhc3VyZW1lbnRSZXBvcnQoIHBNYWMsCisgICAgICAgICBmcm0sCisgICAgICAgICBwRnJhbWUgKyBzaXplb2YoIHRTaXJNYWNNZ210SGRyICksCisgICAgICAgICBuUGF5bG9hZCwKKyAgICAgICAgICZuUGF5bG9hZCApOworCisgICBpZiggRE9UMTFGX0ZBSUxFRCggblN0YXR1cyApKQorICAgeworICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLAorICAgICAgICAgICAgRkwoICJGYWlsZWQgdG8gcGFjayBhbiBSYWRpbyBNZWFzdXJlIFJlcG9ydCAoMHglMDh4KS4iICksCisgICAgICAgICAgICBuU3RhdHVzICk7CisKKyAgICAgIC8vIEZJWE1FIC0gTmVlZCB0byBjb252ZXJ0IHRvIHRTaXJSZXRTdGF0dXMKKyAgICAgIHN0YXR1c0NvZGUgPSBlU0lSX0ZBSUxVUkU7CisgICAgICBnb3RvIHJldHVybkFmdGVyRXJyb3I7CisgICB9CisgICBlbHNlIGlmKCBET1QxMUZfV0FSTkVEKCBuU3RhdHVzICkpCisgICB7CisgICAgICBsaW1Mb2coIHBNYWMsIExPR1csCisgICAgICAgICAgICAgIEZMKCAiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBwYWNraW5nIFJhZGlvICIKKyAgICAgICAgICAgICAgICAgICJNZWFzdXJlIFJlcG9ydCAoMHglMDh4KS4iICksIG5TdGF0dXMpOworICAgfQorCisgICBsaW1Mb2coIHBNYWMsIExPR1csCisgICAgICAgICBGTCggIlNlbmRpbmcgYSBSYWRpbyBNZWFzdXJlIFJlcG9ydCB0byAiICkpOworICAgbGltUHJpbnRNYWNBZGRyKCBwTWFjLCBwZWVyLCBMT0dXICk7CisKKyAgICBpZiggKCBTSVJfQkFORF81X0dIWiA9PSBsaW1HZXRSRkJhbmQocHNlc3Npb25FbnRyeS0+Y3VycmVudE9wZXJDaGFubmVsKSkKKyAgICAgICB8fCAoIHBzZXNzaW9uRW50cnktPnBlUGVyc29uYSA9PSBWT1NfUDJQX0NMSUVOVF9NT0RFICkgfHwKKyAgICAgICAgICggcHNlc3Npb25FbnRyeS0+cGVQZXJzb25hID09IFZPU19QMlBfR09fTU9ERSkKKyAgICAgICAgICkKKyAgICB7CisgICAgICAgIHR4RmxhZyB8PSBIQUxfVVNFX0JEX1JBVEUyX0ZPUl9NQU5BR0VNRU5UX0ZSQU1FOworICAgIH0KKworICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfVFhfTUdNVCwKKyAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwKKyAgICAgICAgICBwTWFjSGRyLT5mYy5zdWJUeXBlKSk7CisgICBoYWxzdGF0dXMgPSBoYWxUeEZyYW1lKCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcFBhY2tldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1UxNikgbkJ5dGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgQU5JX1RYRElSX1RPRFMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICA3LC8vU01BQ19TV0JEX1RYX1RJRF9NR01UX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1UeENvbXBsZXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcEZyYW1lLCB0eEZsYWcgKTsKKyAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RYX0NPTVBMRVRFLAorICAgICAgICAgIHBzZXNzaW9uRW50cnkt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oZSBwYWNrZWQgc2l6ZSBmb3IgYW4gU0EgUXVlcnkgUmVxdWVzdCIKKyAgICAgICAgICAgICAgICIgKDB4JTA4eCkuIiksIG5TdGF0dXMgKTsKKyAgIH0KKworICAgbkJ5dGVzID0gblBheWxvYWQgKyBzaXplb2YoIHRTaXJNYWNNZ210SGRyICk7CisgICBoYWxzdGF0dXMgPSBwYWxQa3RBbGxvYyggcE1hYy0+aEhkZCwgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULCAgbkJ5dGVzLCAoIHZvaWQqKiApICZwRnJhbWUsICggdm9pZCoqICkgJnBQYWNrZXQgKTsKKyAgIGlmICggISBIQUxfU1RBVFVTX1NVQ0NFU1MgKCBoYWxzdGF0dXMgKSApCisgICB7CisgICAgICBsaW1Mb2coIHBNYWMsIExPR1AsIEZMKCJGYWlsZWQgdG8gYWxsb2NhdGUgJWQgYnl0ZXMgZm9yIGEgU0EgUXVlcnkgUmVxdWVzdCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImFjdGlvbiBmcmFtZSIpLCBuQnl0ZXMgKTsKKyAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICB9CisKKyAgIC8vIFBhcmFub2lhOgorICAgdm9zX21lbV9zZXQoIHBGcmFtZSwgbkJ5dGVzLCAwICk7CisKKyAgIC8vIENvcHkgbmVjZXNzYXJ5IGluZm8gdG8gQkQKKyAgIG5TaXJTdGF0dXMgPSBsaW1Qb3B1bGF0ZU1hY0hlYWRlciggcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX01HTVRfRlJBTUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfTUdNVF9BQ1RJT04sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBlZXIsIHBzZXNzaW9uRW50c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TWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcFBhY2tldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1UxNikgbkJ5dGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgSEFMX1RYUlhfRlJNXzgwMl8xMV9NR01ULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgQU5JX1RYRElSX1RPRFMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICA3LC8vU01BQ19TV0JEX1RYX1RJRF9NR01UX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1UeENvbXBsZXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcEZyYW1lLCB0eEZsYWcgKTsKKyAgIGlmICggZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSBoYWxzdGF0dXMgKQorICAgeworICAgICAgUEVMT0dFKGxpbUxvZyggcE1hYywgTE9HRSwgRkwoICJoYWxUeEZyYW1lIEZBSUxFRCEgU3RhdHVzIFslZF0iICksIGhhbHN0YXR1cyApOykKKyAgICAgIG5TaXJTdGF0dXMgPSBlU0lSX0ZBSUxVUkU7CisgICAgICAvL1BrdCB3aWxsIGJlIGZyZWVkIHVwIGJ5IHRoZSBjYWxsYmFjaworICAgICAgcmV0dXJuIG5TaXJTdGF0dXM7CisgICB9CisgICBlbHNlIHsKKyAgICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7CisgICB9CisKK3JldHVybkFmdGVyRXJyb3I6CisgICBwYWxQa3RGcmVlKCBwTWFjLT5oSGRkLCBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsICggdm9pZCogKSBwRnJhbWUsICggdm9pZCogKSBwUGFja2V0ICk7CisgICByZXR1cm4gblNpclN0YXR1czsKK30gLy8gRW5kIGxpbVNlbmRTYVF1ZXJ5UmVxdWVzdEZyYW1lCisKKy8qKgorICogXGJyaWVmIFNlbmQgU0EgcXVlcnkgcmVzcG9uc2UgYWN0aW9uIGZyYW1lIHRvIHBl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gICAgICAgICAgICAgICAgICAgIHBGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX01BQ19NR01UX0ZSQU1FLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX01HTVRfQUNUSU9OLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZWVyLCBwc2Vzc2lvbkVudHJ5LT5zZWxmTWFjQWRkciApOworICAgaWYgKCBlU0lSX1NVQ0NFU1MgIT0gblNpclN0YXR1cyApCisgICAgICBnb3RvIHJldHVybkFmdGVyRXJyb3I7CisKKyAgIC8vIFVwZGF0ZSBBMyB3aXRoIHRoZSBCU1NJRAorICAgcE1hY0hkciA9ICggdHBTaXJNYWNNZ210SGRyICkgcEZyYW1lOworCisgICBzaXJDb3B5TWFjQWRkciggcE1hY0hkci0+YnNzSWQsIHBzZXNzaW9uRW50cnktPmJzc0lkICk7CisKKyAgIC8vIFNpbmNlIHRoaXMgaXMgYSBTQSBRdWVyeSBSZXNwb25zZSwgc2V0IHRoZSAicHJvdGVjdCIgKGFrYSBXRVApIGJpdAorICAgLy8gaW4gdGhlIEZDCisgICBsaW1TZXRQcm90ZWN0ZWRCaXQocE1hYywgcHNlc3Npb25FbnRyeSwgcGVlciwgcE1hY0hkcik7CisKKyAgIC8vIFBhY2sgMTF3IFNBIHF1ZXJ5IHJlc3BvbnNlIGZyYW1lCisgICBuU3RhdHVzID0gZG90MTFmUGFja1NhUXVlcnlSc3AoIHBNYWMsCisgICAgICAgICAmZnJtLAorICAgICAgICAgcEZyYW1lICsgc2l6ZW9mKCB0U2lyTWFjTWdtdEhkciApLAorICAgICAgICAgblBheWxvYWQsCisgICAgICAgICAmblBheWxvYWQgKTsKKworICAgaWYgKCBET1QxMUZfRkFJTEVEKCBuU3RhdHVzICkpCisgICB7CisgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsCisgICAgICAgICAgICBGTCggIkZhaWxlZCB0by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ywgVFJBQ0VfQ09ERV9UWF9NR01ULAorICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLAorICAgICAgICAgIHBNYWNIZHItPmZjLnN1YlR5cGUpKTsKKyAgIGhhbHN0YXR1cyA9IGhhbFR4RnJhbWUoIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwUGFja2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTE2KSBuQnl0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBIQUxfVFhSWF9GUk1fODAyXzExX01HTVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBBTklfVFhESVJfVE9EUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIDcsLy9TTUFDX1NXQkRfVFhfVElEX01HTVRfSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVR4Q29tcGxldGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwRnJhbWUsIHR4RmxhZyApOworICAgTVRSQUNFKG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfVFhfQ09NUExFVEUsCisgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgICAgaGFsc3RhdHVzKSk7CisgICBpZiAoIGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gaGFsc3RhdHVzICkKKyAgIHsKKyAgICAgIFBFTE9HRShsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCAiaGFsVHhGcmFtZSBGQUlMRUQhIFN0YXR1cyBbJWRdIiApLCBoYWxzdGF0dXMgKTspCisgICAgICBuU2lyU3RhdHVzID0gZVNJUl9GQUlMVVJFOworICAgICAgLy9Qa3Qgd2lsbCBiZSBmcmVlZCB1cCBieSB0aGUgY2FsbGJhY2sKKyAgICAgIHJldHVybiBuU2lyU3RhdHVzOworICAgfQorICAgZWxzZSB7CisgICAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworICAgfQ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BTk5FTF9MSVNULAorICAgICAgICAgICAgICAgICAgICAgICAgICB2YWxpZENoYW5MaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAmdmFsaWRDaGFubmVsTnVtKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICBGTCgiY291bGQgbm90IHJldHJpZXZlIFZhbGlkIGNoYW5uZWwgbGlzdCIpKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKGh0NDBPQlNTU2NhbkluZCk7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorICAgIC8qIEV4dHJhY3QgMjRHIGNoYW5uZWwgbGlzdCAqLworICAgIGNoYW5uZWwyNEdOdW0gPSAwOworICAgIGZvciggY291bnQgPTAgO2NvdW50IDwgdmFsaWRDaGFubmVsTnVtICYmCisgICAgICAgICAgICAgICAgICAgKGNoYW5uZWwyNEdOdW0gPCBTSVJfUk9BTV9NQVhfQ0hBTk5FTFMpO2NvdW50KyspCisgICAgeworICAgICAgIGlmICgodmFsaWRDaGFuTGlzdFtjb3VudF0+IFJGX0NIQU5fMSkgJiYKKyAgICAgICAgICAgKHZhbGlkQ2hhbkxpc3RbY291bnRdIDwgUkZfQ0hBTl8xNCkpCisgICAgICAgeworICAgICAgICAgIGh0NDBPQlNTU2NhbkluZC0+Y2hhbm5lbHNbY2hhbm5lbDI0R051bV0gPSB2YWxpZENoYW5MaXN0W2NvdW50XTsKKyAgICAgICAgICBjaGFubmVsMjRHTnVtKys7CisgICAgICAgfQorICAgIH0KKyAgICBodDQwT0JTU1NjYW5JbmQtPmNoYW5uZWxDb3VudCA9IGNoYW5uZWwyNEdOdW07CisgICAgLyogRlcgQVBJIHJlcXVlc3RzIEJTUyBJRFggKi8KKyAgICBodDQwT0JTU1NjYW5JbmQtPnNlbGZTdGFJZHggPSBwc2Vzc2lvbkVudHJ5LT5zdGFJZDsKKyAgICBodD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isgICAgaWYoIHBzZXNzaW9uRW50cnkgPT0gTlVMTCApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsIHRvIGZpbmQgdGhlIHJpZ2h0IHNlc3Npb24gIikpOworICAgICAgICByZXRDb2RlID0gZVNJUl9GQUlMVVJFOworICAgICAgICByZXR1cm4gcmV0Q29kZTsKKyAgICB9CisgICAgLyoKKyAgICAgKiBEb250IHNlbmQgdGhlIFdQQSBhbmQgUlNOIGlFIGluIGZpbHRlciBpZiBGVyBkb2VzbnQgc3VwcG9ydAorICAgICAqIElTX0ZFQVRVUkVfQkNOX0ZMVF9ERUxUQV9FTkFCTEUsCisgICAgICogZWxzZSBob3N0IHdpbGwgZ2V0IGFsbCBiZWFjb25zIHdoaWNoIGhhdmUgUlNOIElFIG9yIFdQQSBJRQorICAgICAqLworICAgIGlmKElTX0ZFQVRVUkVfQkNOX0ZMVF9ERUxUQV9FTkFCTEUpCisgICAgICAgIG1zZ1NpemUgPSBzaXplb2YodEJlYWNvbkZpbHRlck1zZykgKyBzaXplb2YoYmVhY29uRmlsdGVyVGFibGUpOworICAgIGVsc2UKKyAgICAgICAgbXNnU2l6ZSA9IHNpemVvZih0QmVhY29uRmlsdGVyTXNnKSArIHNpemVvZihiZWFjb25GaWx0ZXJUYWJsZSkgLSAoMiAqIHNpemVvZih0QmVhY29uRmlsdGVySWUpKTsKKworICAgIHBCZWFjb25GaWx0ZXJNc2cgPSB2b3NfbWVtX21hbGxvYyhtc2dTaXplKTsKKyAgICBpZiAoIE5VTEwgPT0gcEJlYWNvbkZpbHRlck1zZyApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1AsIEZMKCJGYWlsIHRvIGFsbG9jYXRlIG1lbW9yeSBmb3IgYmVhY29uRmlpbHRlck1zZyAiKSk7CisgICAgICAgIHJldENvZGUgPSBlU0lSX01FTV9BTExPQ19GQUlMRUQ7CisgICAgICAgIHJldHVybiByZXRDb2RlOworICAgI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gICAgICAgICAgICAgICAgICB0QU5JX1U4IHByaW1hcnljaGFuTnVtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlUGh5Q2hhbkJvbmRTdGF0ZSBzZWNvbmRhcnlDaGFuT2Zmc2V0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBjaGFuV2lkdGgpOworI2VuZGlmCisjaWYgZGVmaW5lZCBXTEFOX0ZFQVRVUkVfVk9XSUZJICAKK3RTaXJSZXRTdGF0dXMgbGltU2VuZFN3aXRjaENobmxQYXJhbXModHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VOCBjaG5sTnVtYmVyLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVBoeUNoYW5Cb25kU3RhdGUgc2Vjb25kYXJ5Q2hubE9mZnNldCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRQb3dlcmRCbSBtYXhUeFBvd2VyLHRBTklfVTggcGVTZXNzaW9uSWQpOworI2Vsc2UKK3RTaXJSZXRTdGF0dXMgbGltU2VuZFN3aXRjaENobmxQYXJhbXModHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VOCBjaG5sTnVtYmVyLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVBoeUNoYW5Cb25kU3RhdGUgc2Vjb25kYXJ5Q2hubE9mZnNldCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggbG9jYWxQd3JDb25zdHJhaW50LHRBTklfVTggcGVTZXNzaW9uSWQpOworI2VuZGlmCit0U2lyUmV0U3RhdHVzIGxpbVNlbmRFZGNhUGFyYW1zKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRTaXJNYWNFZGNhUGFyYW1SZWNvcmQgKnBVcGRhdGVkRWRjYVBhcmFtcywgdEFOSV9VMTYgYnNzSWR4LCB0QU5JX0JPT0xFQU4gaGlnaFBlcm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ICAgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSk7Cit0U2lyUmV0U3RhdHVzIGxpbVNlbmRIVDQwT0JTU1N0b3BTY2FuSW5kKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSk7CisKKyNkZWZpbmUgQ0FQQUJJTElUWV9GSUxURVJfTUFTSyAgMHg3M0NGCisjZGVmaW5lIEVSUF9GSUxURVJfTUFTSyAgICAgICAgIDB4RjgKKyNkZWZpbmUgRURDQV9GSUxURVJfTUFTSyAgICAgICAgMHhGMAorI2RlZmluZSBRT1NfRklMVEVSX01BU0sgICAgICAgICAweEYwCisjZGVmaW5lIEhUX0JZVEUwX0ZJTFRFUl9NQVNLICAgIDB4MAorI2RlZmluZSBIVF9CWVRFMV9GSUxURVJfTUFTSyAgICAweEY4CisjZGVmaW5lIEhUX0JZVEUyX0ZJTFRFUl9NQVNLICAgIDB4RUIKKyNkZWZpbmUgSFRfQllURTVfRklMVEVSX01BU0sgICAgMHhGRAorI2RlZmluZSBEU19QQVJBTV9DSEFOTkVMX01BU0sgICAweDAKKyNkZWZpbmUgVkhUT1BfQ0hXSURUSF9NQVNLICAgICAgMHhGQworCit0U2lyUmV0U3RhdHVzIGxpbVNlbmRCZWFjb25GaWx0ZXJJbmZvKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpOworCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVwordFNpclJldFN0YXR1cyBsaW1TZW5kRXhjbHVkZVVuZW5jcnlwdEluZCh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX0JPT0xFQU4gZXhjbHVkZVVuZW5jLAorICAgICAgICAgICAgICAgICAg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0RJQUdfRU5URVJfQk1QU19SU1BfRVZFTlQsIHBzZXNzaW9uRW50cnksICh0QU5JX1UxNilyZXN1bHRDb2RlLCAwKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVXTklfUE1DX0VYSVRfQk1QU19SU1A6CisgICAgICAgICAgICBsaW1EaWFnRXZlbnRSZXBvcnQocE1hYywgV0xBTl9QRV9ESUFHX0VYSVRfQk1QU19SU1BfRVZFTlQsIHBzZXNzaW9uRW50cnksICh0QU5JX1UxNilyZXN1bHRDb2RlLCAwKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVXTklfUE1DX0VOVEVSX0lNUFNfUlNQOgorICAgICAgICAgICAgbGltRGlhZ0V2ZW50UmVwb3J0KHBNYWMsIFdMQU5fUEVfRElBR19FTlRFUl9JTVBTX1JTUF9FVkVOVCwgcHNlc3Npb25FbnRyeSwgKHRBTklfVTE2KXJlc3VsdENvZGUsIDApOworICAgICAgICAgICAgYnJlYWs7ICAgICAgICAKKyAgICAgICAgY2FzZSBlV05JX1BNQ19FWElUX0lNUFNfUlNQOgorICAgICAgICAgICAgbGltRGlhZ0V2ZW50UmVwb3J0KHBNYWMsIFdMQU5fUEVfRElBR19FWElUX0lNUFNfUlNQX0VWRU5ULCBwc2Vzc2lvbkVudHJ5LCAodEFOSV9VMTYpcmVzdWx0Q29kZSwgMCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlV05JX1BNQ19FTlRFUl9VQVBTRF9SU1A6CisgICAgICAgICAgICBsaW1EaWFnRXZlbnRSZXBvcnQocE1hYywgV0xBTl9QRV9ESUFHX0VOVEVSX1VBUFNEX1JTUF9FVkVOVCwgcHNlc3Npb25FbnRyeSwgKHRBTklfVTE2KXJlc3VsdENvZGUsIDApOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZVdOSV9QTUNfRVhJVF9VQVBTRF9SU1A6CisgICAgICAgICAgICBsaW1EaWFn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ElBR19TVVBQT1JUCisgICAgCisgICAgbGltU3lzUHJvY2Vzc01taE1zZ0FwaShwTWFjLCAmbW1oTXNnLCAgZVBST1QpOworfSAvKioqIGVuZCBsaW1TZW5kU21lUnNwKCkgKioqLworCisKKy8qKgorICogbGltU2VuZFNtZUpvaW5SZWFzc29jUnNwQWZ0ZXJSZXN1bWUoKQorICoKKyAqRlVOQ1RJT046CisgKiBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCB0byBzZW5kIEpvaW4vUmVhc3NvYyByc3AKKyAqIG1lc3NhZ2UgdG8gU01FIGFmdGVyIHRoZSByZXN1bWUgbGluay4KKyAqCisgKlBBUkFNUzoKKyAqCisgKkxPR0lDOgorICoKKyAqQVNTVU1QVElPTlM6CisgKiBOQQorICoKKyAqTk9URToKKyAqIE5BCisgKgorICogQHBhcmFtIHBNYWMgICAgICAgICBQb2ludGVyIHRvIEdsb2JhbCBNQUMgc3RydWN0dXJlCisgKiBAcGFyYW0gc3RhdHVzICAgICAgIFJlc3VtZSBsaW5rIHN0YXR1cyAKKyAqIEBwYXJhbSBjdHggICAgICAgICAgY29udGV4dCBwYXNzZWQgd2hpbGUgY2FsbGluZyByZXNtdW5lIGxpbmsuCisgKiAgICAgICAgICAgICAgICAgICAgIChqb2luIHJlc3BvbnNlIHRvIGJlIHNlbnQpCisgKgorICogQHJldHVybiBOb25lCisgKi8KK3N0YXRpYyB2b2lkIGxpbVNlbmRTbWVKb2luUmVhc3NvY1JzcEFmdGVyUmVzdW1lKCB0cEFuaVNpckdsb2JhbCBwTWFjLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVIYWxTdGF0dXMgc3RhdHVzLCB0QU5JX1UzMiAqY3R4KQoreworICAgIHRTaXJNc2dRICAgICAgICAgbW1oTXNnOworICAgIHRwU2lyU21lSm9pblJzcCAgcFNpclNtZUpvaW5Sc3AgPSAodHBTaXJTbWVKb2luUnNwKSBjdHg7CisKKyAgICBtbWhNc2cudHl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ZighSVNfRE9UMTFfTU9ERV9IVChwc2Vzc2lvbkVudHJ5LT5kb3QxMW1vZGUpICYmCisgICAgICAgIUlTX0RPVDExX01PREVfVkhUKHBzZXNzaW9uRW50cnktPmRvdDExbW9kZSkpCisgICAgeworICAgICAgIHJhdGVfZmxhZ3MgfD0gZUhBTF9UWF9SQVRFX0xFR0FDWTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgaWYoSVNfRE9UMTFfTU9ERV9IVChwc2Vzc2lvbkVudHJ5LT5kb3QxMW1vZGUpKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAocFN0YURzLT5odFNob3J0R0kyME1oeiB8fCBwU3RhRHMtPmh0U2hvcnRHSTQwTWh6ICkKKyAgICAgICAgICAgICAgICByYXRlX2ZsYWdzIHw9IGVIQUxfVFhfUkFURV9TR0k7CisKKyAgICAgICAgICAgIGlmIChwU3RhRHMtPmh0U3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0KQorICAgICAgICAgICAgICAgIHJhdGVfZmxhZ3MgfD1lSEFMX1RYX1JBVEVfSFQ0MDsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICByYXRlX2ZsYWdzIHw9ZUhBTF9UWF9SQVRFX0hUMjA7CisgICAgICAgIH0KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgICAgICBpZihJU19ET1QxMV9NT0RFX1ZIVChwc2Vzc2lvbkVudHJ5LT5kb3QxMW1vZGUpKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoV05JX0NGR19WSFRfQ0hBTk5FTF9XSURUSF84ME1IWiA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+dmh0U3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHJhdGVfZmxhZ3MgfD0gZUhBTF9UWF9SQVRFX1ZIVDgwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZihXTklfQ0ZHX1ZIVF9DSEFOTkVMX1dJRFRIXzIwXzQwTUhaID09CisgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPnZodFN1cHBvcnRlZENoYW5uZWxXaWR0aFNldCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoZUhUX0NIQU5ORUxfV0lEVEhfNDBNSFogPT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPmh0U3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0KQorICAgICAgICAgICAgICAgICAgICByYXRlX2ZsYWdzIHw9IGVIQUxfVFhfUkFURV9WSFQ0MDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHJhdGVfZmxhZ3MgfD0gZUhBTF9UWF9SQVRFX1ZIVDIwOworICAgICAgICAgICB9CisgICAgICAgIH0KKyNlbmRpZgorICAgIH0KKworICAgICByZXR1cm4gcmF0ZV9mbGFnczsKK30KKworLyoqCisgKiBsaW1TZW5kU21lSm9pblJlYXNzb2NSc3AoKQorICoKKyAqRlVOQ1RJT046CisgKiBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCBieSBsaW1Qcm9jZXNzU21lUmVxTWVzc2FnZXMoKSB0byBzZW5kCisgKiBlV05JX1NNRV9KT0lOX1JTUCBvciBlV05JX1NNRV9SRUFTU09DX1JTUCBtZXNzYWdlcyB0byBhcHBsaWNhdGlvbnMKKyAqIGFib3ZlIE1BQyBTb2Z0d2FyZS4KKyAqCisgKlBBUkFNUzoKKyAqCisgKkxPR0lDOgorICoKKyAqQVNTVU1QVElPTlM6CisgKiBOQQorICoKKyAqTk9URToKKyAqIE5BCisgKgorICogQHBhcmFtIHBNYWMgICAgICAgICBQb2ludGVyIHRvIEdsb2JhbCBNQUMgc3RydWN0dXJlCisgKiBAcGFyYW0gbXNnVHlwZSAgICAgIEluZGljYXRlcyBtZXNzYWdlIHR5cGUKKyAqIE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5kaWYgLy9GRUFUVVJFX1dMQU5fRElBR19TVVBQT1JUCisKKyAgICBsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgRkwoIlNlbmRpbmcgbWVzc2FnZSAlcyB3aXRoIHJlYXNvbkNvZGUgJXMiKSwKKyAgICAgICAgICAgbGltTXNnU3RyKG1zZ1R5cGUpLCBsaW1SZXN1bHRDb2RlU3RyKHJlc3VsdENvZGUpKTsKKworICAgIGlmKHBzZXNzaW9uRW50cnkgPT0gTlVMTCkKKyAgICB7CisKKyAgICAgICAgcnNwTGVuID0gc2l6ZW9mKHRTaXJTbWVKb2luUnNwKTsgICAKKworICAgICAgICBwU2lyU21lSm9pblJzcCA9IHZvc19tZW1fbWFsbG9jKHJzcExlbik7CisgICAgICAgIGlmICggTlVMTCA9PSBwU2lyU21lSm9pblJzcCApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vLyBCdWZmZXIgbm90IGF2YWlsYWJsZS4gTG9nIGVycm9yCisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoImNhbGwgdG8gQWxsb2NhdGVNZW1vcnkgZmFpbGVkIGZvciBKT0lOL1JFQVNTT0NfUlNQIikpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgICAKKyAgICAgICAgdm9zX21lbV9zZXQoKHRBTklfVTgqKXBTaXJTbWVKb2luUnNwLCByc3BMZW4sIDApOworICAgICAgICAgCisgICAgICAgICAKKyAgICAgICAgcFNpclNtZUpvaW5Sc3AtPmJlYWNvbkxlbmd0aCA9IDA7CisgICAgICAgIHBTaXJTbWVKb2luUnNwLT5hc3NvY1JlcUxlbmd0aCA9IDA7CisgICAgICAgIHBTaXJTbWVKb2luUnNwLT5hc3NvY1JzcExlbmd0aCA9IDA7CisgICAgfQorCisgICAgZWxzZQorICAgIHsKKyAgICAgICAgcnNwTGVuID0gcHNlc3Npb25FbnRyeS0+YXNzb2NSZXFMZW4gKyBwc2Vzc2lvbkVudHJ5LT5hc3NvY1JzcExlbiArIAorICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+YmNuTGVuICsgCisjaWZkZWYgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIKKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPlJJQ0RhdGFMZW4gKworI2VuZGlmCisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRQorICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+dHNwZWNMZW4gKyAKKyNlbmRpZiAgICAgICAgICAgIAorICAgICAgICAgICAgc2l6ZW9mKHRTaXJTbWVKb2luUnNwKSAtIHNpemVvZih0QU5JX1U4KSA7CisKKyAgICAgICAgcFNpclNtZUpvaW5Sc3AgPSB2b3NfbWVtX21hbGxvYyhyc3BMZW4pOworICAgICAgICBpZiAoIE5VTEwgPT0gcFNpclNtZUpvaW5Sc3AgKQorICAgICAgICB7CisgICAgICAgICAgICAvLy8gQnVmZmVyIG5vdCBhdmFpbGFibGUuIExvZyBlcnJvcgorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICBGTCgiY2FsbCB0byBBbGxvY2F0ZU1lbW9yeSBmYWlsZWQgZm9yIEpPSU4vUkVBU1NPQ19SU1AiKSk7CisKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIHZvc19tZW1fc2V0KCh0QU5JX1U4KilwU2lyU21lSm9pblJzcCwgcnNwTGVuLCAwKTsKKworICAgICAgICBpZiAocmVzdWx0Q29kZSA9PSBlU0lSX1NNRV9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICBwU3RhRHMgPSBkcGhHZXRIYXNoRW50cnkocE1hYywgRFBIX1NUQV9IQVNIX0lOREVYX1BFRVIsICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsKKyAgICAgICAgICAgIGlmIChwU3RhRHMgPT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJjb3VsZCBub3QgR2V0IFNlbGYgRW50cnkgZm9yIHRoZSBzdGF0aW9uIikpOykKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvL1Bhc3MgdGhlIHBlZXIncyBzdGFJZAorICAgICAgICAgICAgICAgIHBTaXJTbWVKb2luUnNwLT5zdGFJZCA9IHBTdGFEcy0+c3RhSW5kZXg7CisgICAgICAgICAgICAgICAgcFNpclNtZUpvaW5Sc3AtPnVjYXN0U2lnICAgPSBwU3RhRHMtPnVjVWNhc3RTaWc7CisgICAgICAgICAgICAgICAgcFNpclNtZUpvaW5Sc3AtPmJjYXN0U2lnICAgPSBwU3RhRHMtPnVjQmNhc3RTaWc7CisgICAgICAgICAgICAgICAgcFNpclNtZUpvaW5Sc3AtPm1heFJhdGVGbGFncyA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbUdldE1heFJhdGVGbGFncyhwU3RhRHMsIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HMSwgRkwoIm1heFJhdGVGbGFnczogJXgiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2lyU21lSm9pblJzcC0+bWF4UmF0ZUZsYWdzKTspCisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwU2lyU21lSm9pblJzcC0+YmVhY29uTGVuZ3RoID0gMDsKKyAgICAgICAgcFNpclNtZUpvaW5Sc3AtPmFzc29jUmVxTGVuZ3RoID0gMDsKKyAgICAgICAgcFNpclNtZUpvaW5Sc3AtPmFzc29jUnNwTGVuZ3RoID0gMDsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUgorICAgICAgICBwU2lyU21lSm9pblJzcC0+cGFyc2VkUmljUnNwTGVuID0gMDsKKyNlbmRpZgorI2lmZGVmIEZFQVRVUkVfV0xBTl9FU0UKKyAgICAgICAgcFNpclNtZUpvaW5Sc3AtPnRzcGVjSWVMZW4gPSAwOworI2VuZGlmCisgICAgICAgIAorICAgICAgICBpZihyZXN1bHRDb2RlID09IGVTSVJfU01FX1NVQ0NFU1MpCisgICAgICAgIHsKKworICAgICAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+YmVhY29uICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFNpclNtZUpvaW5Sc3AtPmJlYWNvbkxlbmd0aCA9IHBzZXNzaW9uRW50cnktPmJjbkxlbjsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoIHBTaXJTbWVKb2luUnNwLT5mcmFtZXMsIHBzZXNzaW9uRW50cnktPmJlYWNvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTaXJTbWVKb2luUnNwLT5iZWFjb25MZW5ndGgpOworICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZSggcHNlc3Npb25FbnRyeS0+YmVhY29uKTsKKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5iZWFjb24gPSBOVUxMOworI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSX0RFQlVHCisgICAgICAgICAgICAgICAgUEVMT0cxKGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiQmVhY29uPSVkIiksIHBzZXNzaW9uRW50cnktPmJjbkxlbik7KQorI2VuZGlmCisgICAgICAgICAgICB9CisgICAgICAgIAorICAgICAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+YXNzb2NSZXEgIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwU2lyU21lSm9pblJzcC0+YXNzb2NSZXFMZW5ndGggPSBwc2Vzc2lvbkVudHJ5LT5hc3NvY1JlcUxlbjsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoIHBTaXJTbWVKb2luUnNwLT5mcmFtZXMgKyBwc2Vzc2lvbkVudHJ5LT5iY25MZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5hc3NvY1JlcSwgcFNpclNtZUpvaW5Sc3AtPmFzc29jUmVxTGVuZ3RoKTsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUoIHBzZXNzaW9uRW50cnktPmFzc29jUmVxKTsKKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5hc3NvY1JlcSA9IE5VTEw7CisjaWZkZWYgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVJfREVCVUcKKyAgICAgICAgICAgICAgICBQRUxPRzEobGltTG9nKHBNYWMsIExPRzEsIEZMKCJBc3NvY1JlcT0lZCIpLCBwc2Vzc2lvbkVudHJ5LT5hc3NvY1JlcUxlbik7KQorI2VuZGlmCisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZihwc2Vzc2lvbkVudHJ5LT5hc3NvY1JzcCAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBTaXJTbWVKb2luUnNwLT5hc3NvY1JzcExlbmd0aCA9IHBzZXNzaW9uRW50cnktPmFzc29jUnNwTGVuOworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSggcFNpclNtZUpvaW5Sc3AtPmZyYW1lcyArIHBzZXNzaW9uRW50cnktPmJjbkxlbiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmFzc29jUmVxTGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+YXNzb2NSc3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2lyU21lSm9pblJzcC0+YXNzb2NSc3BMZW5ndGgpOworICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZSggcHNlc3Npb25FbnRyeS0+YXNzb2NSc3ApOworICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmFzc29jUnNwID0gTlVMTDsKKyAgICAgICAgICAgIH0gICAgICAgICAgIAorI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCisgICAgICAgICAgICBpZihwc2Vzc2lvbkVudHJ5LT5yaWNEYXRhICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFNpclNtZUpvaW5Sc3AtPnBhcnNlZFJpY1JzcExlbiA9IHBzZXNzaW9uRW50cnktPlJJQ0RhdGFMZW47CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCBwU2lyU21lSm9pblJzcC0+ZnJhbWVzICsgcHNlc3Npb25FbnRyeS0+YmNuTGVuICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmFzc29jUmVxTGVuICsgcHNlc3Npb25FbnRyeS0+YXNzb2NSc3BMZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5yaWNEYXRhLCBwU2lyU21lSm9pblJzcC0+cGFyc2VkUmljUnNwTGVuKTsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocHNlc3Npb25FbnRyeS0+cmljRGF0YSk7CisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cmljRGF0YSA9IE5VTEw7CisgICAgICAgICAgICAgICAgUEVMT0cxKGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiUmljTGVuZ3RoPSVkIiksIHBTaXJTbWVKb2luUnNwLT5wYXJzZWRSaWNSc3BMZW4pOykKKyAgICAgICAgICAgIH0KKyNlbmRpZgorI2lmZGVmIEZFQVRVUkVfV0xBTl9FU0UKKyAgICAgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPnRzcGVjSWVzICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFNpclNtZUpvaW5Sc3AtPnRzcGVjSWVMZW4gPSBwc2Vzc2lvbkVudHJ5LT50c3BlY0xlbjsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoIHBTaXJTbWVKb2luUnNwLT5mcmFtZXMgKyBwc2Vzc2lvbkVudHJ5LT5iY25MZW4gKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5hc3NvY1JlcUxlbiArIHBzZXNzaW9uRW50cnktPmFzc29jUnNwTGVuICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5SSUNEYXRhTGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+dHNwZWNJZXMsIHBTaXJTbWVKb2luUnNwLT50c3BlY0llTGVuKTsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocHNlc3Npb25FbnRyeS0+dHNwZWNJZXMpOworICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnRzcGVjSWVzID0gTlVMTDsKKyAgICAgICAgICAgICAgICBQRUxPRzEobGltTG9nKHBNYWMsIExPRzEsIEZMKCJFU0UtVHNwZWNMZW49JWQiKSwgcHNlc3Npb25FbnRyeS0+dHNwZWNMZW4pOykKKyAgICAgICAgICAgIH0KKyNlbmRpZiAgICAgICAgICAgIAorICAgICAgICAgICAgcFNpclNtZUpvaW5Sc3AtPmFpZCA9IHBzZXNzaW9uRW50cnktPmxpbUFJRDsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUl9ERUJVRworICAgICAgICAgICAgUEVMT0cxKGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiQXNzb2NSc3A9JWQiKSwgcHNlc3Npb25FbnRyeS0+YXNzb2NSc3BMZW4pOykKKyNlbmRpZgorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworCisgICAgICAgICAgICBpZihwc2Vzc2lvbkVudHJ5LT5iZWFjb24gIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocHNlc3Npb25FbnRyeS0+YmVhY29uKTsKKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5iZWFjb24gPSBOVUxMOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZihwc2Vzc2lvbkVudHJ5LT5hc3NvY1JlcSAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZSggcHNlc3Npb25FbnRyeS0+YXNzb2NSZXEpOworICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmFzc29jUmVxID0gTlVMTDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+YXNzb2NSc3AgIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUoIHBzZXNzaW9uRW50cnktPmFzc29jUnNwKTsKKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5hc3NvY1JzcCA9IE5VTEw7CisgICAgICAgICAgICB9CisjaWZkZWYgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIKKyAgICAgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPnJpY0RhdGEgIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUoIHBzZXNzaW9uRW50cnktPnJpY0RhdGEpOworICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnJpY0RhdGEgPSBOVUxMOworICAgICAgICAgICAgfQorI2VuZGlmCisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICAgICAgICAgICBpZihwc2Vzc2lvbkVudHJ5LT50c3BlY0llcyAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwc2V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JvbSAxMW4gY2JTdGF0ZSovCisgICAgICAgICAgICAgICAgIGh0U2Vjb25kYXJ5Q2hhbm5lbE9mZnNldCA9IGxpbUdldDExQUNQaHlDQlN0YXRlKHBNYWMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Y3VycmVudE9wZXJDaGFubmVsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+aHRTZWNvbmRhcnlDaGFubmVsT2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+YXBDZW50ZXJDaGFuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgcGVTZXRSZXN1bWVDaGFubmVsKCBwTWFjLCBwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwsIGh0U2Vjb25kYXJ5Q2hhbm5lbE9mZnNldCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIAorI2VuZGlmCisgICAgICAgICAgICAgICBwZVNldFJlc3VtZUNoYW5uZWwoIHBNYWMsIHBzZXNzaW9uRW50cnktPmN1cnJlbnRPcGVyQ2hhbm5lbCwgcHNlc3Npb25FbnRyeS0+aHRTZWNvbmRhcnlDaGFubmVsT2Zmc2V0KTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHBlU2V0UmVzdW1lQ2hhbm5lbCggcE1hYywgMCwgMCk7CisgICAgICAgIH0KKyAgICAgICAgbGltUmVzdW1lTGluayggcE1hYywgbGltU2VuZFNtZUpvaW5SZWFzc29jUnNwQWZ0ZXJSZXN1bWUsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1UzMiopIHBTaXJTbWVKb2luUnNwICk7CisgICAgfQor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XNzaW9uRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBzbWVzZXNzaW9uSWQsdEFOSV9VMTYgc21ldHJhbnNhY3Rpb25JZCkKK3sKKworCisgICAgdEFOSV9VMTYgICAgICAgICAgICBzaXplID0gMDsKKyAgICB0U2lyTXNnUSAgICAgICAgICAgIG1taE1zZzsKKyAgICB0U2lyU21lU3RhcnRCc3NSc3AgICpwU2lyU21lUnNwOworICAgIHRBTklfVTE2ICAgICAgICAgICAgaWVMZW47CisgICAgdEFOSV9VMTYgICAgICAgICAgICBpZU9mZnNldCwgY3VyTGVuOworCisgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJTZW5kaW5nIG1lc3NhZ2UgJXMgd2l0aCByZWFzb25Db2RlICVzIiksCisgICAgICAgICAgIGxpbU1zZ1N0cihtc2dUeXBlKSwgbGltUmVzdWx0Q29kZVN0cihyZXN1bHRDb2RlKSk7CisKKyAgICBzaXplID0gc2l6ZW9mKHRTaXJTbWVTdGFydEJzc1JzcCk7CisKKyAgICBpZihwc2Vzc2lvbkVudHJ5ID09IE5VTEwpCisgICAgeworICAgICAgICAgcFNpclNtZVJzcCA9IHZvc19tZW1fbWFsbG9jKHNpemUpOworICAgICAgICAgaWYgKCBOVUxMID09IHBTaXJTbWVSc3AgKQorICAgICAgICAgeworICAgICAgICAgICAgLy8vIEJ1ZmZlciBub3QgYXZhaWxhYmxlLiBMb2cgZXJyb3IKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLEZMKCJjYWxsIHRvIEFsbG9jYXRlTWVtb3J5IGZhaWxlZCBmb3IgZVdOSV9TTUVfU1RBUlRfQlNTX1JTUCIpKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgIH0KKyAgICAgICAgIHZvc19tZW1fc2V0KCh0QU5JX1U4KilwU2lyU21lUnNwLCBzaXplLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAKKyAgICB9CisgICAgZWxzZQorICAgIHs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IAorICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgcFNpclNtZVJzcC0+YnNzRGVzY3JpcHRpb24uY2hhbm5lbElkID0gcHNlc3Npb25FbnRyeS0+Y3VycmVudE9wZXJDaGFubmVsOworCisgICAgICAgICAgICAgICAgcFNpclNtZVJzcC0+YnNzRGVzY3JpcHRpb24uYW5pSW5kaWNhdG9yID0gMTsKKworICAgICAgICAgICAgICAgIGN1ckxlbiA9IHBNYWMtPnNjaC5zY2hPYmplY3QuZ1NjaEJlYWNvbk9mZnNldEJlZ2luIC0gaWVPZmZzZXQ7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCAodEFOSV9VOCAqKSAmcFNpclNtZVJzcC0+YnNzRGVzY3JpcHRpb24uaWVGaWVsZHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5zY2guc2NoT2JqZWN0LmdTY2hCZWFjb25GcmFtZUJlZ2luICsgaWVPZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1UzMiljdXJMZW4pOworCisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCAoKHRBTklfVTggKikgJnBTaXJTbWVSc3AtPmJzc0Rlc2NyaXB0aW9uLmllRmllbGRzKSArIGN1ckxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnNjaC5zY2hPYmplY3QuZ1NjaEJlYWNvbkZyYW1lRW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VMzIpcE1hYy0+c2NoLnNjaE9iamVjdC5nU2NoQmVhY29uT2Zmc2V0RW5kKTsKKworCisgICAgICAgICAgICAgICAgLy9zdWJ0cmFjdGluZyBzaXplIG9mIGxlbmd0aCBpbmRpY2F0b3IgaXRzZWxmIGFuZCBzaXplIG9mIHBvaW50ZXIgdG8gaWVGaWVsZHMKKyAgICAgICAgICAgICAgICBwU2lyU21lUnNwLT5ic3NEZXNjcmlwdGlvbi5sZW5ndGggPSBzaXplb2YodFNpckJzc0Rlc2NyaXB0aW9uKSAtCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodEFOSV9VMTYpIC0gc2l6ZW9mKHRBTklfVTMyKSArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZUxlbjsKKyAgICAgICAgICAgICAgICAvL1RoaXMgaXMgdGhlIHNpemUgb2YgdGhlIG1lc3NhZ2UsIHN1YnRyYWN0aW5nIHRoZSBzaXplIG9mIHRoZSBwb2ludGVyIHRvIGllRmllbGRzCisgICAgICAgICAgICAgICAgc2l6ZSArPSBpZUxlbiAtIHNpemVvZih0QU5JX1UzMik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwU2lyU21lUnNwLT5tZXNzYWdlVHlwZSAgICAgPSBtc2dUeXBlOworICAgIHBTaXJTbWVSc3AtPmxlbmd0aCAgICAgICAgICA9IHNpemU7CisKKyAgICAvKiBVcGRhdGUgU01FIHNlc3Npb24gSWQgYW5kIHRyYW5zYWN0aW9uIElkICovCisgICAgcFNpclNtZVJzcC0+c2Vzc2lvbklkICAgICAgID0gc21lc2Vzc2lvbklkOworICAgIHBTaXJTbWVSc3AtPnRyYW5zYWN0aW9uSWQgICA9IHNtZXRyYW5zYWN0aW9uSWQ7CisgICAgcFNpclNtZVJzcC0+c3RhdHVzQ29kZSAgICAgID0gcmVzdWx0Q29kZTsKKyAgICBpZihwc2Vzc2lvbkVudHJ5ICE9IE5VTEwgKQorICAgIHBTaXJTbWVSc3AtPnN0YUlkICAgICAgICAgICA9IHBzZXNzaW9uRW50cnktPnN0YUlkOyAvL2Vsc2UgaXQgd2lsbCBiZSBhbHdheXMgemVybyBzbWVSc3AgU3RhSUQgPSAwIAorICAgICAgCisKKyAgICBtbWhNc2cudHlwZSA9IG1zZ1R5cGU7CisgICAgbW1oTXNnLmJvZHlwdHIgPSBwU2lyU21lUnNwOworICAgIG1taE1zZy5ib2R5dmFsID0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NjOworCisgICAgaWYgKHJlc3VsdENvZGUgIT0gZVNJUl9TTUVfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIGxpbVBvc3RTbWVTY2FuUnNwTWVzc2FnZShwTWFjLCBsZW5ndGgsIHJlc3VsdENvZGUsc21lc2Vzc2lvbklkLHNtZXRyYW5zY2F0aW9uSWQpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgbW1oTXNnLnR5cGUgPSBlV05JX1NNRV9TQ0FOX1JTUDsKKyAgICBpID0gMDsKKyAgICBic3NDb3VudCA9IDA7CisgICAgbXNnTGVuID0gMDsKKyAgICBhbGxvY0xlbmd0aCA9IExJTV9NQVhfTlVNX09GX1NDQU5fUkVTVUxUU19SRVBPUlRFRCAqIExJTV9TSVpFX09GX0VBQ0hfQlNTOworICAgIHBTaXJTbWVTY2FuUnNwID0gdm9zX21lbV9tYWxsb2MoYWxsb2NMZW5ndGgpOworICAgIGlmICggTlVMTCA9PSBwU2lyU21lU2NhblJzcCApCisgICAgeworICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgRkwoImNhbGwgdG8gQWxsb2NhdGVNZW1vcnkgZmFpbGVkIGZvciBlV05JX1NNRV9TQ0FOX1JTUCIpKTsKKworICAgICAgICByZXR1cm47CisgICAgfQorICAgIGZvciAoaSA9IDA7IGkgPCBMSU1fTUFYX05VTV9PRl9TQ0FOX1JFU1VMVFM7IGkrKykKKyAgICB7CisgICAgICAgIC8vd2hlbiBwdGVtcCBpcyBub3QgTlVMTCBpdCBpcyBhIGxlZnQgb3ZlcgorICAgICAgICBwdGVtcCA9IHBNYWMtPmxpbS5nTGltQ2FjaGVkU2Nhbkhhc2hUYWJsZVtpXTsKKyAgICAgICAgd2hpbGUocHRlbXApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBiQnVmID0gKCh0QU5JX1U4ICopcFNpclNtZVNjYW5Sc3ApICsgbXNnTGVuOworICAgICAgICAgICAgaWYoMCA9PSBic3NDb3VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBtc2dMZW4gPSBzaXplb2YodFNpclNtZVNjYW5Sc3ApIC0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyQnNzRGVzY3JpcHRpb24pICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0ZW1wLT5ic3NEZXNjcmlwdGlvbi5sZW5ndGggKworICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHB0ZW1wLT5ic3NEZXNjcmlwdGlvbi5sZW5ndGgpOworICAgICAgICAgICAgICAgIHBEZXNjID0gcFNpclNtZVNjYW5Sc3AtPmJzc0Rlc2NyaXB0aW9uOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG1zZ0xlbiArPSBwdGVtcC0+YnNzRGVzY3JpcHRpb24ubGVuZ3RoICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHB0ZW1wLT5ic3NEZXNjcmlwdGlvbi5sZW5ndGgpOworICAgICAgICAgICAgICAgIHBEZXNjID0gKHRTaXJCc3NEZXNjcmlwdGlvbiAqKXBiQnVmOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYoIChhbGxvY0xlbmd0aCA8IG1zZ0xlbikgfHwKKyAgICAgICAgICAgICAgICAgKExJTV9NQVhfTlVNX09GX1NDQU5fUkVTVUxUU19SRVBPUlRFRCA8PSBic3NDb3VudCsrKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFNpclNtZVNjYW5Sc3AtPnN0YXR1c0NvZGUgID0KKyAgICAgICAgICAgICAgICAgICAgZVNJUl9TTUVfTU9SRV9TQ0FOX1JFU1VMVFNfRk9MTE9XOworICAgICAgICAgICAgICAgIHBTaXJTbWVTY2FuUnNwLT5tZXNzYWdlVHlwZSA9IGVXTklfU01FX1NDQU5fUlNQOworICAgICAgICAgICAgICAgIHBTaXJTbWVTY2FuUnNwLT5sZW5ndGggICAgICA9IGN1ck1zZ0xlbjsKKyAgICAgICAgICAgICAgICBtbWhNc2cuYm9keXB0ciA9IHBTaXJTbWVTY2FuUnNwOworICAgICAgICAgICAgICAgIG1taE1zZy5ib2R5dmFsID0gMDsKKyAgICAgICAgICAgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9TTUVfTVNHLCBOT19TRVNTSU9OLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtbWhNc2cudHlwZSkpOworICAgICAgICAgICAgICAgIGxpbVN5c1Byb2Nlc3NNbWhNc2dBcGkocE1hYywgJm1taE1zZywgZVBST1QpOworICAgICAgICAgICAgICAgIHBTaXJTbWVTY2FuUnNwID0gdm9zX21lbV9tYWxsb2MoYWxsb2NMZW5ndGgpOworICAgICAgICAgICAgICAgIGlmICggTlVMTCA9PSBwU2lyU21lU2NhblJzcCApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiY2FsbCB0byBBbGxvY2F0ZU1lbW9yeSBmYWlsZWQgZm9yIGVXTklfU01FX1NDQU5fUlNQIikpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1zZ0xlbiA9IHNpemVvZih0U2lyU21lU2NhblJzcCkgLQorICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJCc3NEZXNjcmlwdGlvbikgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRlbXAtPmJzc0Rlc2NyaXB0aW9uLmxlbmd0aCArCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YocHRlbXAtPmJzc0Rlc2NyaXB0aW9uLmxlbmd0aCk7CisgICAgICAgICAgICAgICAgcERlc2MgPSBwU2lyU21lU2NhblJzcC0+YnNzRGVzY3JpcHRpb247CisgICAgICAgICAgICAgICAgYnNzQ291bnQgPSAxOworICAgICAgICAgICAgfQorICAgICAgICAgICAgY3VyTXNnTGVuID0gbXNnTGVuOworCisgICAgICAgICAgICBwRGVzYy0+bGVuZ3RoCisgICAgICAgICAgICAgICAgICAgID0gcHRlbXAtPmJzc0Rlc2NyaXB0aW9uLmxlbmd0aDsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSggKHRBTklfVTggKikgJnBEZXNjLT5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTggKikgJnB0ZW1wLT5ic3NEZXNjcmlwdGlvbi5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0ZW1wLT5ic3NEZXNjcmlwdGlvbi5sZW5ndGgpOworCisgICAgICAgICAgICBwU2lyU21lU2NhblJzcC0+c2Vzc2lvbklkICAgPSBzbWVzZXNzaW9uSWQ7CisgICAgICAgICAgICBwU2lyU21lU2NhblJzcC0+dHJhbnNjYXRpb25JZCA9IHNtZXRyYW5zY2F0aW9uSWQ7CisKKyAgICAgICAgICAgIHB0ZW1wID0gcHRlbXAtPm5leHQ7CisgICAgICAgIH0gLy93aGlsZShwdGVtcCkKKyAgICB9IC8vZm9yIChpID0gMDsgaSA8IExJTV9NQVhfTlVNX09GX1NDQU5fUkVTVUxUUzsgaSsrKQorCisgICAgaWYoMCA9PSBic3NDb3VudCkKKyAgICB7CisgICAgICAgbGltUG9zdFNtZVNjYW5Sc3BNZXNzYWdlKHBNYWMsIGxlbmd0aCwgcmVzdWx0Q29kZSwgc21lc2Vzc2lvbklkLCBzbWV0cmFuc2NhdGlvbklkKTsKKyAgICAgICBpZiAoTlVMTCAhPSBwU2lyU21lU2NhblJzcCkKKyAgICAgICB7CisgICAgICAgICAgIHZvc19tZW1fZnJlZSggcFNpclNtZVNjYW5Sc3ApOworICAgICAgICAgICBwU2lyU21lU2NhblJzcCA9IE5VTEw7CisgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAvLyBzZW5kIGxhc3QgbWVzc2FnZQorICAgICAgICBwU2lyU21lU2NhblJzcC0+c3RhdHVzQ29kZSAgPSBlU0lSX1NNRV9TVUNDRVNTOworICAgICAgICBwU2lyU21lU2NhblJzcC0+bWVzc2FnZVR5cGUgPSBlV05JX1NNRV9TQ0FOX1JTUDsKKyAgICAgICAgcFNpclNtZVNjYW5Sc3AtPmxlbmd0aCA9IGN1ck1zZ0xlbjsKKworICAgICAgICAvKiBVcGRhdGUgU01FIHNlc3Npb24gSWQgYW5kIFNNRSB0cmFuc2NhdGlvbiBJZCAqLworICAgICAgICBwU2lyU21lU2NhblJzcC0+c2Vzc2lvbklkICAgPSBzbWVzZXNzaW9uSWQ7CisgICAgICAgIHBTaXJTbWVTY2FuUnNwLT50cmFuc2NhdGlvbklkID0gc21ldHJhbnNjYXRpb25JZDsKKworICAgICAgICBtbWhNc2cudHlwZSA9IGVXTklfU01FX1NDQU5fUlNQOworICAgICAgICBtbWhNc2cuYm9keXB0ciA9IHBTaXJTbWVTY2FuUnNwOworICAgICAgICBtbWhNc2cuYm9keXZhbCA9IDA7CisgICAgICAgIGxpbVN5c1Byb2Nlc3NNbWhNc2dBcGkocE1hYywgJm1taE1zZywgZVBST1QpOworICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoInN0YXR1c0NvZGUgOiBlU0lSX1NNRV9TVUNDRVNTIikpOworICAgIH0KKworICAgIHJldHVybjsKKworfSAvKioqIGVuZCBsaW1TZW5kU21lU2NhblJzcCgpICoqKi8KKworI2lmZGVmIFdMQU5fRkVBVFVSRV9ST0FNX1NDQU5fT0ZGTE9BRAorLyoqCisgKiBsaW1TZW5kU21lTGZyU2NhblJzcCgpCisgKgorICpGVU5DVElPTjoKKyAqI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01FX1NDQU5fUlNQXG4iKSk7CisKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBmb3IgKGkgPSAwOyBpIDwgTElNX01BWF9OVU1fT0ZfU0NBTl9SRVNVTFRTOyBpKyspCisgICAgeworICAgICAgICAvL3doZW4gcHRlbXAgaXMgbm90IE5VTEwgaXQgaXMgYSBsZWZ0IG92ZXIKKyAgICAgICAgcHRlbXAgPSBwTWFjLT5saW0uZ0xpbUNhY2hlZExmclNjYW5IYXNoVGFibGVbaV07CisgICAgICAgIHdoaWxlKHB0ZW1wKQorICAgICAgICB7CisgICAgICAgICAgICBwYkJ1ZiA9ICgodEFOSV9VOCAqKXBTaXJTbWVTY2FuUnNwKSArIG1zZ0xlbjsKKyAgICAgICAgICAgIGlmKDAgPT0gYnNzQ291bnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbXNnTGVuID0gc2l6ZW9mKHRTaXJTbWVTY2FuUnNwKSAtCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpckJzc0Rlc2NyaXB0aW9uKSArCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwdGVtcC0+YnNzRGVzY3JpcHRpb24ubGVuZ3RoICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihwdGVtcC0+YnNzRGVzY3JpcHRpb24ubGVuZ3RoKTsKKyAgICAgICAgICAgICAgICBwRGVzYyA9IHBTaXJTbWVTY2FuUnNwLT5ic3NEZXNjcmlwdGlvbjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBtc2dMZW4gKz0gcHRlbXAtPmJzc0Rlc2NyaXB0aW9uLmxlbmd0aCArCisgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihwdGVtcC0+YnNzRGVzY3JpcHRpb24ubGVuZ3RoKTsKKyAgICAgICAgICAgICAgICBwRGVzYyA9ICh0U2lyQnNzRGVzY3JpcHRpb24gKilwYkJ1ZjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICggKGFsbG9jTGVuZ3RoIDwgbXNnTGVuKSB8fAorICAgICAgICAgICAgICAgICAoTElNX01BWF9OVU1fT0ZfU0NBTl9SRVNVTFRTX1JFUE9SVEVEIDw9IGJzc0NvdW50KyspICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwU2lyU21lU2NhblJzcC0+c3RhdHVzQ29kZSAgPQorICAgICAgICAgICAgICAgICAgICBlU0lSX1NNRV9NT1JFX1NDQU5fUkVTVUxUU19GT0xMT1c7CisgICAgICAgICAgICAgICAgcFNpclNtZVNjYW5Sc3AtPm1lc3NhZ2VUeXBlID0gZVdOSV9TTUVfU0NBTl9SU1A7CisgICAgICAgICAgICAgICAgcFNpclNtZVNjYW5Sc3AtPmxlbmd0aCAgICAgID0gY3VyTXNnTGVuOworICAgICAgICAgICAgICAgIG1taE1zZy5ib2R5cHRyID0gcFNpclNtZVNjYW5Sc3A7CisgICAgICAgICAgICAgICAgbW1oTXNnLmJvZHl2YWwgPSAwOworICAgICAgICAgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RYX1NNRV9NU0csIE5PX1NFU1NJT04sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtbWhNc2cudHlwZSkpOworICAgICAgICAgICAgICAgIGxpbVN5c1Byb2Nlc3NNbWhNc2dBcGkocE1hYywgJm1taE1zZywgZVBST1QpOworICAgICAgICAgICAgICAgIHBTaXJTbWVTY2FuUnNwID0gdm9zX21lbV9tYWxsb2MoYWxsb2NMZW5ndGgpOworICAgICAgICAgICAgICAgIGlmICggTlVMTCA9PSBwU2lyU21lU2NhblJzcCApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiY2FsbCB0byBBbGxvY2F0ZU1lbW9yeSBmYWlsZWQgZm9yIGVXTklfU01FX1NDQU5fUlNQXG4iKSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbXNnTGVuID0gc2l6ZW9mKHRTaXJTbWVTY2FuUnNwKSAtCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpckJzc0Rlc2NyaXB0aW9uKSArCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwdGVtcC0+YnNzRGVzY3JpcHRpb24ubGVuZ3RoICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihwdGVtcC0+YnNzRGVzY3JpcHRpb24ubGVuZ3RoKTsKKyAgICAgICAgICAgICAgICBwRGVzYyA9IHBTaXJTbWVTY2FuUnNwLT5ic3NEZXNjcmlwdGlvbjsKKyAgICAgICAgICAgICAgICBic3NDb3VudCA9IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjdXJNc2dMZW4gPSBtc2dMZW47CisKKyAgICAgICAgICAgIFBFTE9HMihsaW1Mb2cocE1hYywgTE9HMiwgRkwoIlNjYW5Sc3AgOiBtc2dMZW4gJWQsIGJzc0Rlc2NyIExlbj0lZFxuIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZ0xlbiwgcHRlbXAtPmJzc0Rlc2NyaXB0aW9uLmxlbmd0aCk7KQorICAgICAgICAgICAgcERlc2MtPmxlbmd0aAorICAgICAgICAgICAgICAgICAgICA9IHB0ZW1wLT5ic3NEZXNjcmlwdGlvbi5sZW5ndGg7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoICh0QU5JX1U4ICopICZwRGVzYy0+YnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopICZwdGVtcC0+YnNzRGVzY3JpcHRpb24uYnNzSW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BwcmV2aW91c2x5IGlzc3VlZAorICogICAgICAgICAgICAgICAgICAgICBlV05JX1NNRV9BVVRIX1JFUSBtZXNzYWdlCisgKgorICogQHJldHVybiBOb25lCisgKi8KK3ZvaWQKK2xpbVNlbmRTbWVBdXRoUnNwKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICB0U2lyUmVzdWx0Q29kZXMgc3RhdHVzQ29kZSwKKyAgICAgICAgICAgICAgICAgIHRTaXJNYWNBZGRyIHBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgdEFuaUF1dGhUeXBlIGF1dGhUeXBlLAorICAgICAgICAgICAgICAgICAgdEFOSV9VMTYgICBwcm90U3RhdHVzQ29kZSwKKyAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnksdEFOSV9VOCBzbWVzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICB0QU5JX1UxNiBzbWV0cmFuc2FjdGlvbklkKQoreworI2lmIDAKKyAgICB0U2lyTXNnUSAgICAgICBtbWhNc2c7CisgICAgdFNpclNtZUF1dGhSc3AgKnBTaXJTbWVBdXRoUnNwOworCisgICAgcFNpclNtZUF1dGhSc3AgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpclNtZUF1dGhSc3ApKTsKKyAgICBpZiAoTlVMTCA9PSBwU2lyU21lQXV0aFJzcCkKKyAgICB7CisgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgIEZMKCJjYWxsIHRvIEFsbG9jYXRlTWVtb3J5IGZhaWxlZCBmb3IgZVdOSV9TTUVfQVVUSF9SU1AiKSk7CisKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgCisKKyAgICBpZihwc2Vzc2lvbkVudHJ5ICE9IE5VTEwpCisgICAgeworICAgICAgICB2b3NfbWVtX2NvcHkoICh0QU5JX1U4ICopIHBTaXJTbWVBdX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gICAgICAgICAgICAgICAgIGRpc2Fzc29jaWF0ZSB3YXMgaW5pdGlhdGVkCisgKiBAcGFyYW0gcmVhc29uQ29kZSAgICAgICAgSW5kaWNhdGVzIHRoZSByZWFzb24gZm9yIERpc2Fzc29jaWF0aW9uCisgKiBAcGFyYW0gZGlzYXNzb2NUcmlnZ2VyICAgSW5kaWNhdGVzIHRoZSB0cmlnZ2VyIGZvciBEaXNhc3NvY2lhdGlvbgorICogQHBhcmFtIGFpZCAgICAgICAgICAgICAgIEluZGljYXRlcyB0aGUgU1RBSUQuIFRoaXMgcGFyYW1ldGVyIGlzCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlc2VudCBvbmx5IG9uIEFQLgorICoKKyAqIEByZXR1cm4gTm9uZQorICovCit2b2lkCitsaW1TZW5kU21lRGlzYXNzb2NOdGYodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjQWRkciBwZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICB0U2lyUmVzdWx0Q29kZXMgcmVhc29uQ29kZSwKKyAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UxNiBkaXNhc3NvY1RyaWdnZXIsCisgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMTYgYWlkLAorICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggc21lc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTE2IHNtZXRyYW5zYWN0aW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSkKK3sKKworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAqcEJ1ZjsKKyAgICB0U2lyU21lRGlzYXNzb2NSc3AgICAgICAqcFNpclNtZURpc2Fzc29jUnNwOworICAgIHRTaXJTbWVEaXNhc3NvY0luZCAgICAgICpwU2lyU21lRGlzYXNzb2NJbmQ7CisgICAgdEFOSV9VMzIgKnBNc2c7CisgICAgYm9vbCBmYWlsdXJlID0gRkFMU0U7CisKKyAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIkRpc2Fzc29jIE50ZiB3aXRoIHRyaWdnZXIgOiAlZCIKKyAgICAgICAgICAgICJyZWFzb25Db2RlOiAlZCIpLAorICAgICAgICAgICAgZGlzYXNzb2NUcmlnZ2VyLAorICAgICAgICAgICAgcmVhc29uQ29kZSk7CisgICAgCisgICAgc3dpdGNoIChkaXNhc3NvY1RyaWdnZXIpCisgICAgeworICAgICAgICBjYXNlIGVMSU1fUEVFUl9FTlRJVFlfRElTQVNTT0M6CisgICAgICAgICAgICBpZiAocmVhc29uQ29kZSAhPSBlU0lSX1NNRV9TVEFfTk9UX0FTU09DSUFURUQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZmFpbHVyZSA9IFRSVUU7CisgICAgICAgICAgICAgICAgZ290byBlcnJvcjsKKyAgICAgICAgICAgIH0KKworICAgICAgICBjYXNlIGVMSU1fSE9TVF9ESVNBU1NPQzoKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogRGlzYXNzb2NpYXRpb24gcmVzcG9uc2UgZHVlIHRvCisgICAgICAgICAgICAgKiBob3N0IHRyaWdnZXJlZCBkaXNhc3NvY2lhdGlvbgorICAgICAgICAgICAgICovCisKKyAgICAgICAgICAgIHBTaXJTbWVEaXNhc3NvY1JzcCA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0U2lyU21lRGlzYXNzb2NSc3ApKTsKKyAgICAgICAgICAgIGlmICggTlVMTCA9PSBwU2lyU21lRGlzYXNzb2NSc3AgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgIEZMKCJjYWxsIHRvIEFsbG9jYXRlTWVtb3J5IGZhaWxlZCBmb3IgZVdOSV9TTUVfRElTQVNTT0NfUlNQIikpOworICAgICAgICAgICAgICAgIGZhaWx1cmUgPSBUUlVFOworICAgICAgICAgICAgICAgIGdvdG8gZXJyb3I7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoInNlbmQgZVdOSV9TTUVfRElTQVNTT0NfUlNQIHdpdGggIgorICAgICAgICAgICAgInJldENvZGU6ICVkIGZvciAiTUFDX0FERFJFU1NfU1RSKSxyZWFzb25Db2RlLAorICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocGVlck1hY0FkZHIpKTsKKyAgICAgICAgICAgIHBTaXJTbWVEaXNhc3NvY1JzcC0+bWVzc2FnZVR5cGUgPSBlV05JX1NNRV9ESVNBU1NPQ19SU1A7CisgICAgICAgICAgICBwU2lyU21lRGlzYXNzb2NSc3AtPmxlbmd0aCAgICAgID0gc2l6ZW9mKHRTaXJTbWVEaXNhc3NvY1JzcCk7CisgICAgICAgICAgICAvL3Nlc3Npb25JZAorICAgICAgICAgICAgcEJ1ZiA9ICh0QU5JX1U4ICopICZwU2lyU21lRGlzYXNzb2NSc3AtPnNlc3Npb25JZDsKKyAgICAgICAgICAgICpwQnVmID0gc21lc2Vzc2lvbklkOworICAgICAgICAgICAgcEJ1ZisrOworCisgICAgICAgICAgICAvL3RyYW5zYWN0aW9uSWQKKyAgICAgICAgICAgIGxpbUNvcHlVMTYocEJ1Ziwgc21ldHJhbnNhY3Rpb25JZCk7CisgICAgICAgICAgICBwQnVmICs9IHNpemVvZih0QU5JX1UxNik7CisKKyAgICAgICAgICAgIC8vc3RhdHVzQ29kZSAgICAgICAgICAgIAorICAgICAgICAgICAgbGltQ29weVUzMihwQnVmLCByZWFzb25Db2RlKTsKKyAgICAgICAgICAgIHBCdWYgKz0gc2l6ZW9mKHRTaXJSZXN1bHRDb2Rlcyk7CisKKyAgICAgICAgICAgIC8vcGVlck1hY0FkZHIKKyAgICAgICAgICAgIHZvc19tZW1fY29weSggcEJ1ZiwgcGVlck1hY0FkZHIsIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICAgICAgcEJ1ZiArPSBzaXplb2YodFNpck1hY0FkZHIpOworCisgICAgICAgICAgICAvLyBDbGVhciBTdGF0aW9uIFN0YXRzCisgICAgICAgICAgICAvL2ZvciBzdGEsIGl0IGlzIGFsd2F5cyAxLCBJQlNTIGlzIGhhbmRsZWQgYXQgaGFsSW5pdFN0YQorCisKKyAgICAgICAgICAKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRElBR19TVVBQT1JUX0xJTSAvL0ZFQVRVUkVfV0xBTl9ESUFHX1NVUFBPUlQgCisKKyAgICAgICAgICAgIGxpbURpYWdFdmVudFJlcG9ydChwTWFjLCBXTEFOX1BFX0RJQUdfRElTQVNTT0NfUlNQX0VWRU5ULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LCAodEFOSV9VMTYpcmVhc29uQ29kZSwgMCk7CisjZW5kaWYKKyAgICAgICAgICAgIHBNc2cgPSAodEFOSV9VMzIqKSBwU2lyU21lRGlzYXNzb2NSc3A7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBEaXNhc3NvY2lhdGlvbiBpbmRpY2F0aW9uIGR1ZSB0byBEaXNhc3NvY2lhdGlvbgorICAgICAgICAgICAgICogZnJhbWUgcmVjZXB0aW9uIGZyb20gcGVlciBlbnRpdHkgb3IgZHVlIHRvCisgICAgICAgICAgICAgKiBsb3NzIG9mIGxpbmsgd2l0aCBwZWVyIGVudGl0eS4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcFNpclNtZURpc2Fzc29jSW5kID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRTaXJTbWVEaXNhc3NvY0luZCkpOworICAgICAgICAgICAgaWYgKCBOVUxMID09IHBTaXJTbWVEaXNhc3NvY0luZCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgRkwoImNhbGwgdG8gQWxsb2NhdGVNZW1vcnkgZmFpbGVkIGZvciBlV05JX1NNRV9ESVNBU1NPQ19JTkQiKSk7CisKKyAgICAgICAgICAgICAgICBmYWlsdXJlID0gVFJVRTsKKyAgICAgICAgICAgICAgICBnb3RvIGVycm9yOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJzZW5kIGVXTklfU01FX0RJU0FTU09DX0lORCB3aXRoICIKKyAgICAgICAgICAgICJyZXRDb2RlOiAlZCBmb3IgIk1BQ19BRERSRVNTX1NUUikscmVhc29uQ29kZSwKKyAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBlZXJNYWNBZGRyKSk7CisgICAgICAgICAgICBwU2lyU21lRGlzYXNzb2NJbmQtPm1lc3NhZ2VUeXBlID0gZVdOSV9TTUVfRElTQVNTT0NfSU5EOworICAgICAgICAgICAgcFNpclNtZURpc2Fzc29jSW5kLT5sZW5ndGggICAgICA9IHNpemVvZih0U2lyU21lRGlzYXNzb2NJbmQpOworICAgICAgICAgICAgCisgICAgICAgICAgICAvKiBVcGRhdGUgU01FIHNlc3Npb24gSWQgYW5kIFRyYW5zYWN0aW9uIElkICovCisgICAgICAgICAgICBwU2lyU21lRGlzYXNzb2NJbmQtPnNlc3Npb25JZCA9IHNtZXNlc3Npb25JZDsKKyAgICAgICAgICAgIHBTaXJTbWVEaXNhc3NvY0luZC0+dHJhbnNhY3Rpb25JZCA9IHNtZXRyYW5zYWN0aW9uSWQ7CisgICAgICAgICAgICBwU2lyU21lRGlzYXNzb2NJbmQtPnJlYXNvbkNvZGUgPSByZWFzb25Db2RlOworICAgICAgICAgICAgcEJ1ZiA9ICh0QU5JX1U4ICopICZwU2lyU21lRGlzYXNzb2NJbmQtPnN0YXR1c0NvZGU7CisKKyAgICAgICAgICAgIGxpbUNvcHlVMzIocEJ1ZiwgcmVhc29uQ29kZSk7CisgICAgICAgICAgICBwQnVmICs9IHNpemVvZih0U2lyUmVzdWx0Q29kZXMpOworCisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoIHBCdWYsIHBzZXNzaW9uRW50cnktPmJzc0lkLCBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgICAgIHBCdWYgKz0gc2l6ZW9mKHRTaXJNYWNBZGRyKTsKKworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCBwQnVmLCBwZWVyTWFjQWRkciwgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisKKworI2lmZGVmIEZFQVRVUkVfV0xBTl9ESUFHX1NVUFBPUlRfTElNIC8vRkVBVFVSRV9XTEFOX0RJQUdfU1VQUE9SVCAKKyAgICAgICAgICAgIGxpbURpYWdFdmVudFJlcG9ydChwTWFjLCBXTEFOX1BFX0RJQUdfRElTQVNTT0NfSU5EX0VWRU5ULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnksICh0QU5JX1UxNilyZWFzb25Db2RlLCAwKTsKKyNlbmRpZgorICAgICAgICAgICAgcE1zZyA9ICh0QU5JX1UzMiopIHBTaXJTbWVEaXNhc3NvY0luZDsKKworICAgICAgICAgICAgYnJlYWs7CisgICAgfQorCitlcnJvcjoKKyAgICAvKiBEZWxldGUgdGhlIFBFIHNlc3Npb24gQ3JlYXRlZCAqLworICAgIGlmKChwc2Vzc2lvbkVudHJ5ICE9IE5VTEwpICYmICgocHNlc3Npb25FbnRyeSAtPmxpbVN5c3RlbVJvbGUgPT0gIGVMSU1fU1RBX1JPTEUpIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBzZXNzaW9uRW50cnkgLT5saW1TeXN0ZW1Sb2xlID09ICBlTElNX0JUX0FNUF9TVEFfUk9MRSkpICkKKyAgICB7CisgICAgICAgIHB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ZCx0QU5JX1U4IHNtZXNlc3Npb25JZCwgdEFOSV9VMTYgc21ldHJhbnNhY3Rpb25JZCkKK3sKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICpwQnVmOworICAgIHRTaXJTbWVEZWF1dGhSc3AgICAgKnBTaXJTbWVEZWF1dGhSc3A7CisgICAgdFNpclNtZURlYXV0aEluZCAgICAqcFNpclNtZURlYXV0aEluZDsKKyAgICB0cFBFU2Vzc2lvbiAgICAgICAgIHBzZXNzaW9uRW50cnk7CisgICAgdEFOSV9VOCAgICAgICAgICAgICBzZXNzaW9uSWQ7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAqcE1zZzsKKworICAgIHBzZXNzaW9uRW50cnkgPSBwZUZpbmRTZXNzaW9uQnlCc3NpZChwTWFjLHBlZXJNYWNBZGRyLCZzZXNzaW9uSWQpOyAgCisgICAgc3dpdGNoIChkZWF1dGhUcmlnZ2VyKQorICAgIHsKKyAgICAgICAgY2FzZSBlTElNX1BFRVJfRU5USVRZX0RFQVVUSDoKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIAorICAgICAgICBjYXNlIGVMSU1fSE9TVF9ERUFVVEg6CisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIERlYXV0aGVudGljYXRpb24gcmVzcG9uc2UgdG8gaG9zdCB0cmlnZ2VyZWQKKyAgICAgICAgICAgICAqIGRlYXV0aGVudGljYXRpb24uCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHBTaXJTbWVEZWF1dGhSc3AgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpclNtZURlYXV0aFJzcCkpOworICAgICAgICAgICAgaWYgKCBOVUxMID09IHBTaXJTbWVEZWF1dGhSc3AgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgIEZMKCJjYWxsIHRvIEFsbG9jYXRlTWVtb3J5IGZhaWxlZCBmb3IgZVdOSV9TTUVfREVBVVRIX1JTUCIpKTsKKworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgic2VuZCBlV05JX1NNRV9ERUFVVEhfUlNQIHdpdGggIgorICAgICAgICAgICAgInJldENvZGU6ICVkIGZvciJNQUNfQUREUkVTU19TVFIpLHJlYXNvbkNvZGUsCisgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwZWVyTWFjQWRkcikpOworICAgICAgICAgICAgcFNpclNtZURlYXV0aFJzcC0+bWVzc2FnZVR5cGUgPSBlV05JX1NNRV9ERUFVVEhfUlNQOworICAgICAgICAgICAgcFNpclNtZURlYXV0aFJzcC0+bGVuZ3RoICAgICAgPSBzaXplb2YodFNpclNtZURlYXV0aFJzcCk7CisgICAgICAgICAgICBwU2lyU21lRGVhdXRoUnNwLT5zdGF0dXNDb2RlID0gcmVhc29uQ29kZTsKKyAgICAgICAgICAgIHBTaXJTbWVEZWF1dGhSc3AtPnNlc3Npb25JZCA9IHNtZXNlc3Npb25JZDsKKyAgICAgICAgICAgIHBTaXJTbWVEZWF1dGhSc3AtPnRyYW5zYWN0aW9uSWQgPSBzbWV0cmFuc2FjdGlvbklkOyAgCisKKyAgICAgICAgICAgIHBCdWYgID0gKHRBTklfVTggKikgcFNpclNtZURlYXV0aFJzcC0+cGVlck1hY0FkZHI7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoIHBCdWYsIHBlZXJNYWNBZGRyLCBzaXplb2YodFNpck1hY0FkZHIpKTsKKworI2lmZGVmIEZFQVRVUkVfV0xBTl9ESUFHX1NVUFBPUlRfTElNIC8vRkVBVFVSRV9XTEFOX0RJQUdfU1VQUE9SVCAKKyAgICAgICAgICAgIGxpbURpYWdFdmVudFJlcG9ydChwTWFjLCBXTEFOX1BFX0RJQUdfREVBVVRIX1JTUF9FVkVOVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSwgMCwgKHRBTklfVTE2KXJlYXNvbkNvZGUpOworI2VuZGlmCisgICAgICAgICAgICBwTXNnID0gKHRBTklfVTMyKilwU2lyU21lRGVhdXRoUnNwOworCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBEZWF1dGhlbnRpY2F0aW9uIGluZGljYXRpb24gZHVlIHRvIERlYXV0aGVudGljYXRpb24KKyAgICAgICAgICAgICAqIGZyYW1lIHJlY2VwdGlvbiBmcm9tIHBlZXIgZW50aXR5IG9yIGR1ZSB0bworICAgICAgICAgICAgICogbG9zcyBvZiBsaW5rIHdpdGggcGVlciBlbnRpdHkuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHBTaXJTbWVEZWF1dGhJbmQgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpclNtZURlYXV0aEluZCkpOworICAgICAgICAgICAgaWYgKCBOVUxMID09IHBTaXJTbWVEZWF1dGhJbmQgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgIEZMKCJjYWxsIHRvIEFsbG9jYXRlTWVtb3J5IGZhaWxlZCBmb3IgZVdOSV9TTUVfREVBVVRIX0luZCIpKTsKKworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgic2VuZCBlV05JX1NNRV9ERUFVVEhfSU5EIHdpdGggIgorICAgICAgICAgICAgInJldENvZGU6ICVkIGZvciAiTUFDX0FERFJFU1NfU1RSKSxyZWFzb25Db2RlLAorICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocGVlck1hY0FkZHIpKTsKKyAgICAgICAgICAgIHBTaXJTbWVEZWF1dGhJbmQtPm1lc3NhZ2VUeXBlID0gZVdOSV9TTUVfREVBVVRIX0lORDsKKyAgICAgICAgICAgIHBTaXJTbWVEZWF1dGhJbmQtPmxlbmd0aCAgICAgID0gc2l6ZW9mKHRTaXJTbWVEZWF1dGhJbmQpOworICAgICAgICAgICAgcFNpclNtZURlYXV0aEluZC0+cmVhc29uQ29kZSA9IGVTSVJfTUFDX1VOU1BFQ19GQUlMVVJFX1JFQVNPTjsKKworICAgICAgICAgICAgLy8gc2Vzc2lvbklkCisgICAgICAgICAgICBwQnVmID0gKHRBTklfVTgqKSAmcFNpclNtZURlYXV0aEluZC0+c2Vzc2lvbklkOworICAgICAgICAgICAgKnBCdWYrKyA9IHNtZXNlc3Npb25JZDsKKworICAgICAgICAgICAgLy90cmFuc2FjdGlvbiBJRAorICAgICAgICAgICAgbGltQ29weVUxNihwQnVmLCBzbWV0cmFuc2FjdGlvbklkKTsKKyAgICAgICAgICAgIHBCdWYgKz0gc2l6ZW9mKHRBTklfVTE2KTsKKworICAgICAgICAgICAgLy8gc3RhdHVzIGNvZGUKKyAgICAgICAgICAgIGxpbUNvcHlVMzIocEJ1ZiwgcmVhc29uQ29kZSk7CisgICAgICAgICAgICBwQnVmICs9IHNpemVvZih0U2lyUmVzdWx0Q29kZXMpOworCisgICAgICAgICAgICAvL2Jzc0lkCisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoIHBCdWYsIHBzZXNzaW9uRW50cnktPmJzc0lkLCBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgICAgIHBCdWYgKz0gc2l6ZW9mKHRTaXJNYWNBZGRyKTsKKworICAgICAgICAgICAgLy9wZWVyTWFjQWRkcgorICAgICAgICAgICAgdm9zX21lbV9jb3B5KCBwU2lyU21lRGVhdXRoSW5kLT5wZWVyTWFjQWRkciwgcGVlck1hY0FkZHIsIHNpemVvZih0U2lyTWFjQWRkcikpOworCisjaWZkZWYgRkVBVFVSRV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ICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgRkwoImNhbGwgdG8gQWxsb2NhdGVNZW1vcnkgZmFpbGVkIGZvciBlV05JX1NNRV9XTV9TVEFUVVNfQ0hBTkdFX05URiIpKTsKKyAgICAgICAgICByZXR1cm47CisgICAgfQorCisKKyAgICBtbWhNc2cudHlwZSA9IGVXTklfU01FX1dNX1NUQVRVU19DSEFOR0VfTlRGOworICAgIG1taE1zZy5ib2R5dmFsID0gMDsKKyAgICBtbWhNc2cuYm9keXB0ciA9IHBTaXJTbWVXbVN0YXR1c0NoYW5nZU50ZjsKKworICAgIHN3aXRjaChzdGF0dXNDaGFuZ2VDb2RlKQorICAgIHsKKyAgICAgICAgY2FzZSBlU0lSX1NNRV9SQURBUl9ERVRFQ1RFRDoKKworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlU0lSX1NNRV9DQl9MRUdBQ1lfQlNTX0ZPVU5EX0JZX0FQOgorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlU0lSX1NNRV9CQUNLR1JPVU5EX1NDQU5fRkFJTDoKKyAgICAgICAgICAgIGxpbVBhY2tCa2duZFNjYW5GYWlsTm90aWZ5KHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXNDaGFuZ2VDb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRwU2lyQmFja2dyb3VuZFNjYW5JbmZvKXBTdGF0dXNDaGFuZ2VJbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNpclNtZVdtU3RhdHVzQ2hhbmdlTnRmLCBzZXNzaW9uSWQpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgcFNpclNtZVdtU3RhdHVzQ2hhbmdlTnRmLT5tZXNzYWdlVHlwZSA9IGVXTklfU01FX1dNX1NUQVRVU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KCBwTWFjLCBMT0dQLCBGTCgibGltU3lzUHJvY2Vzc01taE1zZ0FwaSBmYWlsZWQiKSk7CisgICAgfQorCit9IC8qKiogZW5kIGxpbVNlbmRTbWVXbVN0YXR1c0NoYW5nZU50ZigpICoqKi8KKworCisvKioKKyAqIGxpbVNlbmRTbWVTZXRDb250ZXh0UnNwKCkKKyAqCisgKkZVTkNUSU9OOgorICogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgYnkgbGltUHJvY2Vzc1NtZU1lc3NhZ2VzKCkgdG8gc2VuZAorICogZVdOSV9TTUVfU0VUQ09OVEVYVF9SU1AgbWVzc2FnZSB0byBob3N0CisgKgorICpQQVJBTVM6CisgKgorICpMT0dJQzoKKyAqCisgKkFTU1VNUFRJT05TOgorICogTkEKKyAqCisgKk5PVEU6CisgKgorICogQHBhcmFtIHBNYWMgICAgICAgICBQb2ludGVyIHRvIEdsb2JhbCBNQUMgc3RydWN0dXJlCisgKiBAcGFyYW0gcGVlck1hY0FkZHIgIEluZGljYXRlcyB0aGUgcGVlciBNQUMgYWRkciB0byB3aGljaAorICogICAgICAgICAgICAgICAgICAgICBzZXRDb250ZXh0IHdhcyBwZXJmb3JtZWQKKyAqIEBwYXJhbSBhaWQgICAgICAgICAgSW5kaWNhdGVzIHRoZSBhaWQgY29ycmVzcG9uZGluZyB0byB0aGUgcGVlciBNQUMKKyAqICAgICAgICAgICAgICAgICAgICAgYWRkcmVzcworICogQHBhcmFtIHJlc3VsdENvZGUgICBJbmRpY2F0ZXMgdGhlIHJlc3VsdCBvZiBwcmV2aW91c2x5IGlzc3VlZAorICogICAgICAgICAgICAgICAgICAgICBlV05JX1NNRV9TRVRDT05URVhUX1JTUCBtZXNzYWdlCisgKgorICogQHJldHVybiBOb25lCisgKi8KK3ZvaWQKK2xpbVNlbmRTbWVTZXRDb250ZXh0UnNwKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjQWRkciBwZWVyTWFjQWRkciwgdEFOSV9VMTYgYWlkLAorICAgICAgICAgICAgICAgICAgICAgICAgdFNpclJlc3VsdENvZGVzIHJlc3VsdENvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5LHRBTklfVTggc21lc2Vzc2lvbklkLHRBTklfVTE2IHNtZXRyYW5zYWN0aW9uSWQpCit7CisKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICpwQnVmOworICAgIHRTaXJNc2dRICAgICAgICAgICAgIG1taE1zZzsKKyAgICB0U2lyU21lU2V0Q29udGV4dFJzcCAqcFNpclNtZVNldENvbnRleHRSc3A7CisKKyAgICBwU2lyU21lU2V0Q29udGV4dFJzcCA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0U2lyU21lU2V0Q29udGV4dFJzcCkpOworICAgIGlmICggTlVMTCA9PSBwU2lyU21lU2V0Q29udGV4dFJzcCApCisgICAgeworICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICBGTCgiY2FsbCB0byBBbGxvY2F0ZU1lbW9yeSBmYWlsZWQgZm9yIFNtZVNldENvbnRleHRSc3AiKSk7CisKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHBTaXJTbWVTZXRDb250ZXh0UnNwLT5tZXNzYWdlVHlwZSA9IGVXTklfU01FX1NFVENPTlRFWFRfUlNQOworICAgIHBTaXJTbWVTZXRDb250ZXh0UnNwLT5sZW5ndGggICAgICA9IHNpemVvZih0U2lyU21lU2V0Q29udGV4dFJzcCk7CisgICAgcFNpclNtZVNldENvbnRleHRSc3AtPnN0YXR1c0NvZGUgID0gcmVzdWx0Q29kZTsKKworICAgIHBCdWYgPSBwU2lyU21lU2V0Q29udGV4dFJzcC0+cGVlck1hY0FkZHI7CisKKyAgICB2b3NfbWVtX2NvcHkoIHBCdWYsICh0QU5JX1U4ICopIHBlZXJ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jLAorICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY0FkZHIgcGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICB0U2lyUmVzdWx0Q29kZXMgcmVzdWx0Q29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnksdEFOSV9VOCBzbWVzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UxNiBzbWV0cmFuc2FjdGlvbklkKQoreworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICpwQnVmOworICAgIHRTaXJNc2dRICAgICAgICAgICAgICAgIG1taE1zZzsKKyAgICB0U2lyU21lUmVtb3ZlS2V5UnNwICAgICAqcFNpclNtZVJlbW92ZUtleVJzcDsKKworICAgIHBTaXJTbWVSZW1vdmVLZXlSc3AgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpclNtZVJlbW92ZUtleVJzcCkpOworICAgIGlmICggTlVMTCA9PSBwU2lyU21lUmVtb3ZlS2V5UnNwICkKKyAgICB7CisgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgIEZMKCJjYWxsIHRvIEFsbG9jYXRlTWVtb3J5IGZhaWxlZCBmb3IgU21lUmVtb3ZlS2V5UnNwIikpOworCisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICAKKworICAgIGlmKHBzZXNzaW9uRW50cnkgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIHBCdWYgPSBwU2lyU21lUmVtb3ZlS2V5UnNwLT5wZWVyTWFjQWRkcjsKKyAgICAgICAgdm9zX21lbV9jb3B5KCBwQnVmLCAodEFOSV9VOCAqKSBwZWVyTWFjQWRkciwgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgfQorICAgIAorICAgIHBTaXJTbWVSZW1vdmVLZXlSc3AtPm1lc3NhZ2VUeXBlID0gZVdOS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RICAgICAgICAgICAgICAgICBtc2dROworICAgIHRBTklfVTMyICAgICAgICAgICAgICAgICAgICAgIHZhbDsKKyAgICB0U2lyU21lTmVpZ2hib3JCc3NJbmQgICAgKnBOZXdCc3NJbmQ7CisKKyAgICBpZiAoKHBNYWMtPmxpbS5nTGltU21lU3RhdGUgIT0gZUxJTV9TTUVfTElOS19FU1RfV1RfU0NBTl9TVEFURSkgfHwKKyAgICAgICAgKChwTWFjLT5saW0uZ0xpbVNtZVN0YXRlID09IGVMSU1fU01FX0xJTktfRVNUX1dUX1NDQU5fU1RBVEUpICYmCisgICAgICAgICBwTWFjLT5saW0uZ0xpbVJzcFJlcWQpKQorICAgIHsKKyAgICAgICAgLy8gTElNIGlzIG5vdCBpbiBiYWNrZ3JvdW5kIHNjYW4gc3RhdGUgT1IKKyAgICAgICAgLy8gY3VycmVudCBzY2FuIGlzIGluaXRpYXRlZCBieSBIREQuCisgICAgICAgIC8vIE5vIG5lZWQgdG8gc2VuZCBuZXcgQlNTIGluZGljYXRpb24gdG8gSERECisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19ORVdfQlNTX0ZPVU5EX0lORCwgJnZhbCkgIT0gZVNJUl9TVUNDRVNTKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJjb3VsZCBub3QgZ2V0IE5FSUdIQk9SX0JTU19JTkQgZnJvbSBDRkciKSk7CisKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmICh2YWwgPT0gMCkKKyAgICAgICAgcmV0dXJuOworCisgICAgLyoqCisgICAgICogTmVlZCB0byBpbmRpY2F0ZSBuZXcgQlNTcyBmb3VuZCBkdXJpbmcKKyAgICAgKiBiYWNrZ3JvdW5kIHNjYW5uaW5nIHRvIGhvc3QuCisgICAgICogQWxsb2NhdGUgYnVmZmVyIGZvciBzZW5kaW5nIGluZGljYXRpb24uCisgICAgICogTG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5JX1U4IHNtZXNlc3Npb25JZCwgdEFOSV9VMTYgc21ldHJhbnNhY3Rpb25JZCkgIAoreworICAgIHRwU2lyQWRkdHNSc3AgICAgIHJzcDsKKyAgICB0U2lyTXNnUSAgICAgICAgICBtbWhNc2c7CisKKyAgICBpZiAoISByc3BSZXFkKQorICAgICAgICByZXR1cm47CisKKyAgICByc3AgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpckFkZHRzUnNwKSk7CisgICAgaWYgKCBOVUxMID09IHJzcCApCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoIkFsbG9jYXRlTWVtb3J5IGZhaWxlZCBmb3IgQUREVFNfUlNQIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgdm9zX21lbV9zZXQoICh0QU5JX1U4ICopIHJzcCwgc2l6ZW9mKCpyc3ApLCAwKTsKKyAgICByc3AtPm1lc3NhZ2VUeXBlID0gZVdOSV9TTUVfQUREVFNfUlNQOworICAgIHJzcC0+cmMgPSBzdGF0dXM7CisgICAgcnNwLT5yc3Auc3RhdHVzID0gKGVudW0gZVNpck1hY1N0YXR1c0NvZGVzKSBzdGF0dXM7CisgICAgLy92b3NfbWVtX2NvcHkoICh0QU5JX1U4ICopICZyc3AtPnJzcC50c3BlYywgKHRBTklfVTggKikgJmFkZHRzLT50c3BlYywgc2l6ZW9mKGFkZHRzLT50c3BlYykpOworICAgIHJzcC0+cnNwLnRzcGVjID0gdHNwZWM7CisgICAgLyogVXBkYXRlIFNNRSBzZXNzaW9uIElkIGFuZCB0cmFuc2NhdGlvbiBJZCAqLworICAgIHJzcC0+c2Vzc2lvbklkID0gc21lc2Vzc2lvbklkOworICAgIHJzcC0+dHJhbnNhY3Rpb25JZCA9IHNtZXRyYW5zYWN0aW9uSWQ7CisgICAgCisgICAgbW1oTXNnLnR5cGUgPSBlV05JX1NNRV9BRERUU19SU1A7CisgICAgbW1oTXNnLmJvZHlwdHIgPSByc3A7CisgICAgbW1oTXNnLmJvZHl2YWwgPSAwOworICAgIGlmKE5VTEwgPT0gcHNlc3Npb25FbnRyeSkKKyAgICB7CisgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RYX1NNRV9NU0csIE5PX1NFU1NJT04sIG1taE1zZy50eXBlKSk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RYX1NNRV9NU0csCisgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLCBtbWhNc2cudHlwZSkpOworICAgIH0KKyNpZmRlZiBGRUFUVVJFX1dMQU5fRElBR19TVVBQT1JUX0xJTSAvL0ZFQVRVUkVfV0xBTl9ESUFHX1NVUFBPUlQgCisgICAgbGltRGlhZ0V2ZW50UmVwb3J0KHBNYWMsIFdMQU5fUEVfRElBR19BRERUU19SU1BfRVZFTlQsIHBzZXNzaW9uRW50cnksIDAsIDApOworI2VuZGlmIC8vRkVBVFVSRV9XTEFOX0RJQUdfU1VQUE9SVAorICAgIAorICAgIGxpbVN5c1Byb2Nlc3NNbWhNc2dBcGkocE1hYywgJm1taE1zZywgZVBST1QpOworICAgIHJldHVybjsKK30KKwordm9pZAorbGltU2VuZFNtZUFkZHRzSW5kKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRwU2lyQWRkdHNSZXFJbmZvIGFkZHRzKQoreworICAgIHRwU2lyQWRkdHNSc3AgcnNwOworICAgIHRTaXJNc2dRICAgICAgbW1oTXNnOworCisgICAgbGltTG9nKHBNYWMsIExPR1csICJTZW5kU21lQWRkdHNJbmQgKHRva2VuICVkLCB0c2lkICVkLCB1cCAlZCkiLAorICAgICAgICAgICBhZGR0cy0+ZGlhbG9nVG9rZW4sCisgICAgICAgICAgIGFkZHRzLT50c3BlYy50c2luZm8udHJhZmZpYy50c2lkLAorICAgICAgICAgICBhZGR0cy0+dHNwZWMudHNpbmZvLn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b2cocE1hYywgTE9HVywgIlNlbmRTbWVEZWx0c1JzcCAoYWlkICVkLCB0c2lkICVkLCB1cCAlZCkgc3RhdHVzICVkIiwKKyAgICAgICAgICAgZGVsdHMtPmFpZCwKKyAgICAgICAgICAgZGVsdHMtPnJlcS50c2luZm8udHJhZmZpYy50c2lkLAorICAgICAgICAgICBkZWx0cy0+cmVxLnRzaW5mby50cmFmZmljLnVzZXJQcmlvLAorICAgICAgICAgICBzdGF0dXMpOworICAgIGlmICghIGRlbHRzLT5yc3BSZXFkKQorICAgICAgICByZXR1cm47CisKKyAgICByc3AgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpckRlbHRzUnNwKSk7CisgICAgaWYgKCBOVUxMID09IHJzcCApCisgICAgeworICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJBbGxvY2F0ZU1lbW9yeSBmYWlsZWQgZm9yIERFTFRTX1JTUCIpKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICB2b3NfbWVtX3NldCggKHRBTklfVTggKikgcnNwLCBzaXplb2YoKnJzcCksIDApOworICAKKyAgICBpZihwc2Vzc2lvbkVudHJ5ICE9IE5VTEwpCisgICAgeworICAgICAgICAKKyAgICAgICAgcnNwLT5haWQgICAgICAgICAgICAgPSBkZWx0cy0+YWlkOworICAgICAgICB2b3NfbWVtX2NvcHkoICh0QU5JX1U4ICopICZyc3AtPm1hY0FkZHJbMF0sICh0QU5JX1U4ICopICZkZWx0cy0+bWFjQWRkclswXSwgNik7CisgICAgICAgIHZvc19tZW1fY29weSggKHRBTklfVTggKikgJnJzcC0+cnNwLCAodEFOSV9VOCAqKSAmZGVsdHMtPnJlcSwgc2l6ZW9mKHRTaXJEZWx0c1JlcUluZm8pKTsKKyAgICB9IAorCisgICAgCisgICAgcnNwLT5tZXNzYWdlVHlwZSAgICAgPSBlV05JX1NNRV9ERUxUU19SU1A7CisgICAgcnNwLT5yYyAgICAgICAgICAgICAgPSBzdGF0dXM7CisKKyAgICAvKiBVcGRhdGUgU01FIHNlc3Npb24gSWQgYW5kIHRyYW5zY2F0aW9uIElkICovCisgICAgcnNwLT5zZXNzaW9uSWQgPSBzbWVzZXNzaW9uSWQ7CisgICAgcnNwLT50cmFuc2FjdGlvbklkID0gc21ldHJhbnNhY3Rpb25JZDsKKworICAgIG1taE1zZy50eXBlID0gZVdOSV9TTUVfREVMVFNfUlNQOworICAgIG1taE1zZy5ib2R5cHRyID0gcnNwOworICAgIG1taE1zZy5ib2R5dmFsID0gMDsKKyAgICBpZihOVUxMID09IHBzZXNzaW9uRW50cnkpCisgICAgeworICAgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9TTUVfTVNHLCBOT19TRVNTSU9OLCBtbWhNc2cudHlwZSkpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9UWF9TTUVfTVNHLAorICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLCBtbWhNc2cudHlwZSkpOworICAgIH0KKyNpZmRlZiBGRUFUVVJFX1dMQU5fRElBR19TVVBQT1JUX0xJTSAvL0ZFQVRVUkVfV0xBTl9ESUFHX1NVUFBPUlQgCisgICAgbGltRGlhZ0V2ZW50UmVwb3J0KHBNYWMsIFdMQU5fUEVfRElBR19ERUxUU19SU1BfRVZFTlQsIHBzZXNzaW9uRW50cnksICh0QU5JX1UxNilzdGF0dXMsIDApOworI2VuZGlmIC8vRkVBVFVSRV9XTEFOX0RJQUdfU1VQUE9SVAorICAgIAorICAgIGxpbVN5c1Byb2Nlc3NNbWhNc2dBcGkocE1hYywgJm1taE1zZywgZVBST1QpOworfQorCit2b2lkCitsaW1TZW5kU21lRGVsdHNJbmQodHBBbmlTaXJHbG9iYWwgcE1hYywgdHBTaXJEZWx0c1JlcUluZm8gZGVsdHMsIHRBTklfVTE2IGFpZCx0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KQoreworICAgIHRwU2lyRGVsdHNSc3AgcnNwOworICAgIHRTaXJNc2dRICAgICAgbW1oTXNnOworCisgICAgbGltTG9nKHBNYWMsIExPR1csICJTZW5kU21lRGVsdHNJbmQgKGFpZCAlZCwgdHNpZCAlZCwgdXAgJWQpIiwKKyAgICAgICAgICAgYWlkLAorICAgICAgICAgICBkZWx0cy0+dHNpbmZvLnRyYWZmaWMudHNpZCwKKyAgICAgICAgICAgZGVsdHMtPnRzaW5mby50cmFmZmljLnVzZXJQcmlvKTsKKworICAgIHJzcCA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0U2lyRGVsdHNSc3ApKTsKKyAgICBpZiAoIE5VTEwgPT0gcnNwICkKKyAgICB7CisgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoIkFsbG9jYXRlTWVtb3J5IGZhaWxlZCBmb3IgREVMVFNfSU5EIikpOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIHZvc19tZW1fc2V0KCAodEFOSV9VOCAqKSByc3AsIHNpemVvZigqcnNwKSwgMCk7CisKKyAgICByc3AtPm1lc3NhZ2VUeXBlICAgICA9IGVXTklfU01FX0RFTFRTX0lORDsKKyAgICByc3AtPnJjICAgICAgICAgICAgICA9IGVTSVJfU1VDQ0VTUzsKKyAgICByc3AtPmFpZCAgICAgICAgICAgICA9IGFpZDsKKyAgICB2b3NfbWVtX2NvcHkoICh0QU5JX1U4ICopICZyc3AtPnJzcCwgKHRBTklfVTggKikgZGVsdHMsIHNpemVvZigqZGVsdHMpKTsKKworICAgIC8qIFVwZGF0ZSBTTUUgIHNlc3Npb24gSWQgYW5kIFNNRSB0cmFuc2FjdGlvbiBJZCAqLworCisgICAgcnNwLT5zZXNzaW9uSWQgPSBwc2Vzc2lvbkVudHJ5LT5zbWVTZXNzaW9uSWQ7CisgICAgcnNwLT50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U3RhdHMgIFN0YXRpc3RpY3Mgc2VudCBpbiByZXNwb25zZSAKKyAqIEBwYXJhbSByZXN1bHRDb2RlICAgVE9ETzoKKyAqIAorICoKKyAqIEByZXR1cm4gbm9uZQorICovCisKK3ZvaWQKK2xpbVNlbmRTbWVTdGF0c1JzcCh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UxNiBtc2dUeXBlLCB2b2lkKiBzdGF0cykKK3sKKyAgICB0U2lyTXNnUSAgICAgICAgICAgICAgbW1oTXNnOworICAgIHRTaXJTbWVSc3AgICAgICAgICAgICpwTXNnSGRyID0gKHRTaXJTbWVSc3AqKSBzdGF0czsKKworICAgIHN3aXRjaChtc2dUeXBlKQorICAgIHsKKyAgICAgICAgY2FzZSBXREFfU1RBX1NUQVRfUlNQOgorICAgICAgICAgICAgbW1oTXNnLnR5cGUgPSBlV05JX1NNRV9TVEFfU1RBVF9SU1A7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBXREFfQUdHUl9TVEFUX1JTUDoKKyAgICAgICAgICAgIG1taE1zZy50eXBlID0gZVdOSV9TTUVfQUdHUl9TVEFUX1JTUDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdEQV9HTE9CQUxfU1RBVF9SU1A6CisgICAgICAgICAgICBtbWhNc2cudHlwZSA9IGVXTklfU01FX0dMT0JBTF9TVEFUX1JTUDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFdEQV9TVEFUX1NVTU1fUlNQOgorICAgICAgICAgICAgbW1oTXNnLnR5cGUgPSBlV05JX1NNRV9TVEFUX1NVTU1fUlNQOworICAgICAgICAgICAgYnJlYWs7ICAgICAgCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBtbWhNc2cudHlwZSA9IG1zZ1R5cGU7IC8vUmVzcG9uc2UgZnJvbSB3aXRoaW4gUEUKKyAgICAgICAgICAgIGJyZWFrOworICAgIH0KKworICAgIHBNc2dIZHItPm1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ZVBFRXNlVHNtUnNwKCkgKioqLworCisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0VTRSkgJiYgRkVBVFVSRV9XTEFOX0VTRV9VUExPQUQgKi8KKworCit2b2lkCitsaW1TZW5kU21lSUJTU1BlZXJJbmQoCisgICAgdHBBbmlTaXJHbG9iYWwgICAgICBwTWFjLAorICAgIHRTaXJNYWNBZGRyIHBlZXJNYWNBZGRyLAorICAgIHRBTklfVTE2ICAgIHN0YUluZGV4LCAKKyAgICB0QU5JX1U4ICAgICB1Y2FzdElkeCwKKyAgICB0QU5JX1U4ICAgICBiY2FzdElkeCwKKyAgICB0QU5JX1U4ICAqYmVhY29uLCAKKyAgICB0QU5JX1UxNiBiZWFjb25MZW4sIAorICAgIHRBTklfVTE2IG1zZ1R5cGUsCisgICAgdEFOSV9VOCBzZXNzaW9uSWQpCit7CisgICAgdFNpck1zZ1EgICAgICAgICAgICAgICAgICBtbWhNc2c7CisgICAgdFNtZUlic3NQZWVySW5kICpwTmV3UGVlckluZDsKKyAgICAKKyAgICBwTmV3UGVlckluZCA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0U21lSWJzc1BlZXJJbmQpICsgYmVhY29uTGVuKTsKKyAgICBpZiAoIE5VTEwgPT0gcE5ld1BlZXJJbmQgKQorICAgIHsKKyAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIGFsbG9jYXRlIG1lbW9yeSIpKTspCisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgCisgICAgdm9zX21lbV9zZXQoKHZvaWQgKikgcE5ld1BlZXJJbmQsIChzaXplb2YodFNtZUlic3NQZWVySW5kKSArIGJlYWNvbkxlbiksIDApOworCisgICAgdm9zX21lbV9jb3B5KCAodEFOSV9VOCAqKSBwTmV3UGVlckluZC0+cGVlckFkZHIsCisgICAgICAgICAgICAgICAgICAgcGVlck1hY0FkZHIsIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgIHBOZ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hMX0lORDsKKyAgICBtbWhNc2cuYm9keXB0ciA9IE5VTEw7CisgICAgbW1oTXNnLmJvZHl2YWwgPSAwOworICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RYX1NNRV9NU0csIE5PX1NFU1NJT04sIG1taE1zZy50eXBlKSk7CisgICAgbGltU3lzUHJvY2Vzc01taE1zZ0FwaShwTWFjLCAmbW1oTXNnLCBlUFJPVCk7CisKKyAgICByZXR1cm47Cit9CisKK3ZvaWQgbGltU2VuZFNtZU1heEFzc29jRXhjZWVkZWROdGYodHBBbmlTaXJHbG9iYWwgcE1hYywgdFNpck1hY0FkZHIgcGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgIHRBTklfVTggc21lc2Vzc2lvbklkKQoreworICAgIHRTaXJNc2dRICAgICAgICAgbW1oTXNnOworICAgIHRTbWVNYXhBc3NvY0luZCAqcFNtZU1heEFzc29jSW5kOworCisgICAgcFNtZU1heEFzc29jSW5kID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRTbWVNYXhBc3NvY0luZCkpOworICAgIGlmICggTlVMTCA9PSBwU21lTWF4QXNzb2NJbmQgKQorICAgIHsKKyAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIGFsbG9jYXRlIG1lbW9yeSIpKTspCisgICAgICAgIHJldHVybjsKKyAgICB9ICAgIAorICAgIHZvc19tZW1fc2V0KCh2b2lkICopIHBTbWVNYXhBc3NvY0luZCwgc2l6ZW9mKHRTbWVNYXhBc3NvY0luZCksMCk7CisgICAgdm9zX21lbV9jb3B5KCAodEFOSV9VOCAqKXBTbWVNYXhBc3NvY0luZC0+cGVlck1hYywKKyAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopcGVlck1hY0FkZHIsIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgIHBTbWVNYXhBc3NvY0luZC0+bWVzZ1R5cGUgID0gZVdOSV9TTUVfT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Sc3AsCisgICAgICAgICAgICAgICAgICAgICAgIHBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgIFdTQ0lFX1BST0JFX1JTUF9MRU4pOworCisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgRkwoInJlbWFpbmluZyBieXRlcyBsZW4gJWQgaXMgbGVzcyB0aGFuIFdTQ0lFX1BST0JFX1JTUF9MRU4iKSwKKyAgICAgICAgICAgICAgICAgICAgIHBCc3NEZXNjcmlwdGlvbi0+V3NjSWVMZW4pOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKworICAgIC8qIDEgcmVzZXJ2ZWQgYnl0ZSBwYWRkaW5nICovCisgICAgcEJ1ZiArPSAoV1NDSUVfUFJPQkVfUlNQX0xFTiArIDEpOworICAgIGxlbiAtPSAoV1NDSUVfUFJPQkVfUlNQX0xFTiArIDEpOworCisgICAgaWYgKGxlbiA+IDApCisgICAgeworICAgICAgICB2b3NfbWVtX2NvcHkoICh0QU5JX1U4ICopIHBCc3NEZXNjcmlwdGlvbi0+aWVGaWVsZHMsCisgICAgICAgICAgICAgICAgICAgICAgIHBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgIGxlbik7CisgICAgfQorICAgIGVsc2UgaWYgKGxlbiA8IDApCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgCisgICAgICAgICAgICAgICAgICAgICBGTCgicmVtYWluaW5nIGxlbmd0aCBpcyBuZWdhdGl2ZS4gbGVuID0gJWQsIGFjdHVhbCBsZW5ndGggPSAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgbGVuLCBwQnNzRGVzY3JpcHRpb24tPmxlbmd0aCk7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfSAgICAKKworICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7Cit9IC8qKiogZW5kIGxpbUdldEJzc0R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TklfVTE2KTsKKyAgICBsZW4gICAgICAgICs9IHNpemVvZih0QU5JX1UxNik7CisKKyAgICBsaW1Db3B5VTE2KHBCdWYsIHBCc3NEZXNjcmlwdGlvbi0+Y2FwYWJpbGl0eUluZm8pOworICAgIHBCdWYgICAgICAgKz0gc2l6ZW9mKHRBTklfVTE2KTsKKyAgICBsZW4gICAgICAgICs9IHNpemVvZih0QU5JX1UxNik7CisKKyAgICBsaW1Db3B5VTMyKHBCdWYsIHBCc3NEZXNjcmlwdGlvbi0+bndUeXBlKTsKKyAgICBwQnVmICAgICAgICs9IHNpemVvZih0QU5JX1UzMik7CisgICAgbGVuICAgICAgICArPSBzaXplb2YodEFOSV9VMzIpOworCisgICAgKnBCdWYrKyA9IHBCc3NEZXNjcmlwdGlvbi0+YW5pSW5kaWNhdG9yOworICAgIGxlbisrOworCisgICAgKnBCdWYrKyA9IHBCc3NEZXNjcmlwdGlvbi0+cnNzaTsKKyAgICBsZW4rKzsKKworICAgICpwQnVmKysgPSBwQnNzRGVzY3JpcHRpb24tPnNpbnI7CisgICAgbGVuKys7CisKKyAgICAqcEJ1ZisrID0gcEJzc0Rlc2NyaXB0aW9uLT5jaGFubmVsSWQ7CisgICAgbGVuKys7CisKKyAgICB2b3NfbWVtX2NvcHkoIHBCdWYsICh0QU5JX1U4ICopICYocEJzc0Rlc2NyaXB0aW9uLT5pZUZpZWxkcyksCisgICAgICAgICAgICAgICAgICBsaW1HZXRJRWxlbkZyb21Cc3NEZXNjcmlwdGlvbihwQnNzRGVzY3JpcHRpb24pKTsKKworICAgIHJldHVybiAobGVuICsgc2l6ZW9mKHRBTklfVTE2KSk7Cit9IC8qKiogZW5kIGxpbUNvcHlCc3NEZXNjcmlwdGlvbigpICoqKi8KKworCisKKworCisvKioKKyAqIGxpbUdldEtleXNJbmZvKCkKKyAqCisgKkZVTkNUSU9OOgorICogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgYnkgdmFyaW91cyBMSU0gZnVuY3Rpb25zI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ZisrOworICAgIGxlbisrOworCisgICAgcEtleUluZm8tPmtleUxlbmd0aCAgICA9IGxpbUdldFUxNihwQnVmKTsKKyAgICBwQnVmICs9IHNpemVvZih0QU5JX1UxNik7CisgICAgbGVuICArPSBzaXplb2YodEFOSV9VMTYpOworICAgIHZvc19tZW1fY29weSggcEtleUluZm8tPmtleSwgcEJ1ZiwgcEtleUluZm8tPmtleUxlbmd0aCk7CisgICAgcEJ1ZiArPSBwS2V5SW5mby0+a2V5TGVuZ3RoOworICAgIGxlbiAgKz0gcEtleUluZm8tPmtleUxlbmd0aDsKKworICAgUEVMT0czKGxpbUxvZyhwTWFjLCBMT0czLAorICAgICAgICAgICBGTCgiRXh0cmFjdGVkIGtleUlkPSVkLCBrZXlMZW5ndGg9JWQsIEtleSBpcyA6IiksCisgICAgICAgICAgIHBLZXlJbmZvLT5rZXlJZCwgcEtleUluZm8tPmtleUxlbmd0aCk7CisgICAgc2lyRHVtcEJ1ZihwTWFjLCBTSVJfTElNX01PRFVMRV9JRCwgTE9HMywKKyAgICAgICAgICAgICAgIHBLZXlJbmZvLT5rZXksIHBLZXlJbmZvLT5rZXlMZW5ndGgpOykKKworICAgIHJldHVybiBsZW47Cit9IC8qKiogZW5kIGxpbUdldEtleXNJbmZvKCkgKioqLworCisKKworLyoqCisgKiBsaW1TdGFydEJzc1JlcVNlckRlcygpCisgKgorICpGVU5DVElPTjoKKyAqIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIGJ5IGxpbVByb2Nlc3NTbWVNZXNzYWdlcygpIHVwb24gcmVjZWl2aW5nCisgKiBTTUVfU1RBUlRfQlNTX1JFUSBmcm9tIGhvc3QKKyAqCisgKlBBUkFNUzoKKyAqCisgKkxPR0lDOgorICoKKyAqQVNTVU1QVElPTlM6CisgKiBOQQorICoKKyAqTk9URToKKyAqIE5BCisgKgorICogQHBhcmFtICBwU3RhcnRCc3NSZXEgIFBvaW50ZXIgdG8gdFNpclNtZVN0YXJ0QnNzUmVxIGJla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UkVRIGxlbmd0aCAlZCBieXRlcyBpczoiKSwgbGVuKTspCisgICAgZWxzZQorICAgICAgICBQRUxPRzEobGltTG9nKHBNYWMsIExPRzMsIEZMKCJTTUVfUkVBU1NPQ19SRVEgbGVuZ3RoICVkIGJ5dGVzIGlzOiIpLAorICAgICAgICAgICAgICAgICAgICAgIGxlbik7KQorCisgICAgUEVMT0cxKHNpckR1bXBCdWYocE1hYywgU0lSX0xJTV9NT0RVTEVfSUQsIExPRzMsIHBUZW1wLCBsZW4pOykKKworICAgIGlmIChsZW4gPCAodEFOSV9TMTYpIHNpemVvZih0QU5JX1UzMikpCisgICAgeworICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJsZW4gJWQgaXMgdG9vIHNob3J0IiksIGxlbik7KQorICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKworICAgIGxlbiAtPSBzaXplb2YodEFOSV9VMzIpOyAvLyBza2lwIG1lc3NhZ2UgaGVhZGVyCisgICAgaWYgKGxpbUNoZWNrUmVtYWluaW5nTGVuZ3RoKHBNYWMsIGxlbikgPT0gZVNJUl9GQUlMVVJFKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJyZW1haW5pbmcgbGVuICVkIGlzIHRvbyBzaG9ydCIpLCBsZW4pOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKyAgICAvLyBFeHRyYWN0IHNlc3Npb25JZAorICAgIHBKb2luUmVxLT5zZXNzaW9uSWQgPSAqcEJ1ZisrOworICAgIGxlbi0tOworICAgIGlmIChsaW1DaGVja1JlbWFpbmluZ0xlbmd0aChwTWFjLCBsZW4pID09IGVTSVJfRkFJTFVSRSkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgicmVtYWluaW5nIGxlbiAlZCBpcyB0b28gc2hvcnQiKSwgbGVuKTsKKyAgICAgICAgcmV0dXJuIGVTSVJfRk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bmEKKyAgICBwSm9pblJlcS0+c3RhUGVyc29uYSA9ICpwQnVmKys7CisgICAgbGVuLS07CisgICAgaWYgKGxpbUNoZWNrUmVtYWluaW5nTGVuZ3RoKHBNYWMsIGxlbikgPT0gZVNJUl9GQUlMVVJFKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJyZW1haW5pbmcgbGVuICVkIGlzIHRvbyBzaG9ydCIpLCBsZW4pOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKworICAgIHBKb2luUmVxLT5iT1NFTkFzc29jaWF0aW9uID0gKnBCdWYrKzsKKyAgICBsZW4tLTsKKyAgICBpZiAobGltQ2hlY2tSZW1haW5pbmdMZW5ndGgocE1hYywgbGVuKSA9PSBlU0lSX0ZBSUxVUkUpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoInJlbWFpbmluZyBsZW4gJWQgaXMgdG9vIHNob3J0IiksIGxlbik7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorCisgICAgLy8gRXh0cmFjdCBjYk1vZGUKKyAgICBwSm9pblJlcS0+Y2JNb2RlID0gKnBCdWYrKzsKKyAgICBsZW4tLTsKKyAgICBpZiAobGltQ2hlY2tSZW1haW5pbmdMZW5ndGgocE1hYywgbGVuKSA9PSBlU0lSX0ZBSUxVUkUpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoInJlbWFpbmluZyBsZW4gJWQgaXMgdG9vIHNob3J0IiksIGxlbik7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorCisgICAgLy8gRXh0cmFjdCB1YXBzZFBlckFjQml0bWFzaworICAgIHBKb2luUmVxLT51YXBzZFBlckFjQml0bWFzayA9ICpwQnVmKys7CisgICAgbGVuLS07CisgICAgaWYgKGxpbUNoZWNrUmVtYWluaW5nTGVuZ3RoKHBNYWMsIGxlbikgPT0gZV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yAgICAgICAgaWYgKChwSm9pblJlcS0+cnNuSUUubGVuZ3RoID4gU0lSX01BQ19NQVhfSUVfTEVOR1RIICsgMikgfHwKKyAgICAgICAgICAgICAocEpvaW5SZXEtPnJzbklFLmxlbmd0aCAhPSAyICsgKihwQnVmICsgMSkpKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgICAgICAgICBGTCgiSW52YWxpZCBSU04gSUUgbGVuZ3RoICVkIGluIFNNRV9KT0lOX1JFUSIpLAorICAgICAgICAgICAgICAgICAgIHBKb2luUmVxLT5yc25JRS5sZW5ndGgpOworICAgICAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICAgICAgfQorICAgICAgICB2b3NfbWVtX2NvcHkoICh0QU5JX1U4ICopIHBKb2luUmVxLT5yc25JRS5yc25JRWRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgcEJ1ZiwgcEpvaW5SZXEtPnJzbklFLmxlbmd0aCk7CisgICAgICAgIHBCdWYgKz0gcEpvaW5SZXEtPnJzbklFLmxlbmd0aDsKKyAgICAgICAgbGVuICAtPSBwSm9pblJlcS0+cnNuSUUubGVuZ3RoOyAvLyBza2lwIFJTTiBJRQorICAgICAgICBpZiAobGltQ2hlY2tSZW1haW5pbmdMZW5ndGgocE1hYywgbGVuKSA9PSBlU0lSX0ZBSUxVUkUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgicmVtYWluaW5nIGxlbiAlZCBpcyB0b28gc2hvcnQiKSwgbGVuKTsKKyAgICAgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgICAgIH0KKyAgICB9CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICAgLy8gRXh0cmFjdCBDQ0tNIElFCisgICAgcEpvaW5SZXEtPmNja21JRS5sZW5ndGggPSBsaW1HZXRVMTYocEJ1Zik7CisgICAgcEJ1ZiArPSBzaXplb2YodEFOSV9VMTYpOworICAgIGxlbiAtPSBzaXplb2YodEFOSV9VMTYpOworICAgIGlmIChwSm9pblJlcS0+Y2NrbUlFLmxlbmd0aCkKKyAgICB7CisgICAgICAgIC8vIENoZWNrIGZvciBDQ0tNIElFIGxlbmd0aCAodGhhdCBpbmNsdWRlcyBsZW5ndGggb2YgdHlwZSAmIGxlbmd0aCkKKyAgICAgICAgaWYgKChwSm9pblJlcS0+Y2NrbUlFLmxlbmd0aCA+IFNJUl9NQUNfTUFYX0lFX0xFTkdUSCkgfHwKKyAgICAgICAgICAgICAocEpvaW5SZXEtPmNja21JRS5sZW5ndGggIT0gKDIgKyAqKHBCdWYgKyAxKSkpKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgICAgICAgICBGTCgiSW52YWxpZCBDQ0tNIElFIGxlbmd0aCAlZC8lZCBpbiBTTUVfSk9JTi9SRUFTU09DX1JFUSIpLAorICAgICAgICAgICAgICAgICAgIHBKb2luUmVxLT5jY2ttSUUubGVuZ3RoLCAyICsgKihwQnVmICsgMSkpOworICAgICAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICAgICAgfQorICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKikgcEpvaW5SZXEtPmNja21JRS5jY2ttSUVkYXRhLAorICAgICAgICAgICAgICAgICAgICAgIHBCdWYsIHBKb2luUmVxLT5jY2ttSUUubGVuZ3RoKTsKKyAgICAgICAgcEJ1ZiArPSBwSm9pblJlcS0+Y2NrbUlFLmxlbmd0aDsKKyAgICAgICAgbGVuICAtPSBwSm9pblJlcS0+Y2NrbUlFLmxlbmd0aDsgLy8gc2tpcCBDQ0tNIElFCisgICAgICAgIGlmIChsaW1DaGVja1JlbWFpbmluZ0xlbmd0aChwTWFjLCBsZW4pID09IGVTSVJfRkFJTFVSRSkKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJyZW1haW5pbmcgbGVuICVkIGlzIHRvbyBzaG9ydCIpLCBsZW4pOworICAgICAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICAgICAgfQorICAgIH0KKyNlbmRpZgorCisgICAgLy8gRXh0cmFjdCBBZGQgSUUgZm9yIHNjYW4KKyAgICBwSm9pblJlcS0+YWRkSUVTY2FuLmxlbmd0aCA9IGxpbUdldFUxNihwQnVmKTsKKyAgICBwQnVmICs9IHNpemVvZih0QU5JX1UxNik7CisgICAgbGVuIC09IHNpemVvZih0QU5JX1UxNik7CisKKyAgICBpZiAocEpvaW5SZXEtPmFkZElFU2Nhbi5sZW5ndGgpCisgICAgeworICAgICAgICAvLyBDaGVjayBmb3IgSUUgbGVuZ3RoICh0aGF0IGluY2x1ZGVzIGxlbmd0aCBvZiB0eXBlICYgbGVuZ3RoKQorICAgICAgICBpZiAocEpvaW5SZXEtPmFkZElFU2Nhbi5sZW5ndGggPiBTSVJfTUFDX01BWF9BRERfSUVfTEVOR1RIICsgMikKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgRkwoIkludmFsaWQgYWRkSUUgU2NhbiBsZW5ndGggJWQgaW4gU01FX0pPSU5fUkVRIiksCisgICAgICAgICAgICAgICAgICAgcEpvaW5SZXEtPmFkZElFU2Nhbi5sZW5ndGgpOworICAgICAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICAgICAgfQorICAgICAgICAvLyBDaGVjayBmb3IgUDJQIElFIGxlbmd0aCAodGhhdCBpbmNsdWRlcyBsZW5ndGggb2YgdHlwZSAmIGxlbmd0aCkKKyAgICAgICAgdm9zX21lbV9jb3B5KCAodEFOSV9VOCAqKSBwSm9pblJlcS0+YWRkSUVTY2FuLmFkZElFZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICBwQnVmLCBwSm9pblJlcS0+YWRkSUVTY2FuLmxlbmd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b2NJbmQtPnBvd2VyQ2FwLm1pblR4UG93ZXI7CisgICAgICAgIHBCdWYrKzsKKyAgICAgICAgKnBCdWYgPSBwQXNzb2NJbmQtPnBvd2VyQ2FwLm1heFR4UG93ZXI7CisgICAgICAgIHBCdWYrKzsKKyAgICAgICAgbUxlbiArPSBzaXplb2YodFNpck1hY1Bvd2VyQ2FwSW5mbyk7CisKKyAgICAgICAgKnBCdWYgPSBwQXNzb2NJbmQtPnN1cHBvcnRlZENoYW5uZWxzLm51bUNobmw7CisgICAgICAgIHBCdWYrKzsKKyAgICAgICAgbUxlbisrOworCisgICAgICAgIHZvc19tZW1fY29weSggcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopICYocEFzc29jSW5kLT5zdXBwb3J0ZWRDaGFubmVscy5jaGFubmVsTGlzdCksCisgICAgICAgICAgICAgICAgICAgICBwQXNzb2NJbmQtPnN1cHBvcnRlZENoYW5uZWxzLm51bUNobmwpOworCisKKyAgICAgICAgcEJ1ZiArPSBwQXNzb2NJbmQtPnN1cHBvcnRlZENoYW5uZWxzLm51bUNobmw7CisgICAgICAgIG1MZW4gKz0gcEFzc29jSW5kLT5zdXBwb3J0ZWRDaGFubmVscy5udW1DaG5sOworICAgIH0KKyAgICBsaW1Db3B5VTMyKHBCdWYsIHBBc3NvY0luZC0+V21tU3RhSW5mb1ByZXNlbnQpOworICAgIHBCdWYgKz0gc2l6ZW9mKHRBTklfVTMyKTsKKyAgICBtTGVuICs9IHNpemVvZih0QU5JX1UzMik7CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfQVBfSFQ0MF8yNEcKKyAgICBsaW1Db3B5VTMyKHBCdWYsIHBBc3NvY0luZC0+SFQ0ME1IekludG9QcmVzZW50KTsKKyAgICBwQnVmICs9IHNpemVvZih0QU5JX1UzMik7CisgICAgbUxlbiArPSBzaXplb2YodEFOSV9VMzIpOworI2VuZGlmCisKKyAgICAgLy8gRmlsbCBpbiBsZW5ndGggb2YgU01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OgorICoKKyAqTE9HSUM6CisgKgorICpBU1NVTVBUSU9OUzoKKyAqIE5BCisgKgorICpOT1RFOgorICogTkEKKyAqCisgKiBAcGFyYW0gIHBEaXNhc3NvY0NuZiAgUG9pbnRlciB0byB0U2lyU21lRGlzYXNzb2NDbmYgYmVpbmcKKyAqICAgICAgICAgICAgICAgICAgICAgICBleHRyYWN0ZWQgaW50bworICogQHBhcmFtICBwQnVmICAgICAgICAgIFBvaW50ZXIgdG8gc2VyaWFsaXplZCBidWZmZXIKKyAqIEByZXR1cm4gcmV0Q29kZSAgICAgICBJbmRpY2F0ZXMgd2hldGhlciBtZXNzYWdlIGlzIHN1Y2Nlc3NmdWxseQorICogICAgICAgICAgICAgICAgICAgICAgIGRlLXNlcmlhbGl6ZWQgKGVTSVJfU1VDQ0VTUykgb3IKKyAqICAgICAgICAgICAgICAgICAgICAgICBub3QgKGVTSVJfRkFJTFVSRSkKKyAqLworCit0U2lyUmV0U3RhdHVzCitsaW1EaXNhc3NvY0NuZlNlckRlcyh0cEFuaVNpckdsb2JhbCBwTWFjLCB0cFNpclNtZURpc2Fzc29jQ25mIHBEaXNhc3NvY0NuZiwgdEFOSV9VOCAqcEJ1ZikKK3sKKyNpZmRlZiAgUEVfREVCVUdfTE9HMQorICAgIHRBTklfVTggICpwVGVtcCA9IHBCdWY7CisjZW5kaWYKKworICAgIGlmICghcERpc2Fzc29jQ25mIHx8ICFwQnVmKQorICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworCisgICAgcERpc2Fzc29jQ25mLT5tZXNzYWdlVHlwZSA9IGxpbUdldFUxNihwQnVmKTsKKyAgICBwQnVmICs9IHNpemVvZih0QU5JX1UxNik7CisKKyAgICBwRGlzYXNzb2NDbmYtPmxlbmd0aCA9IGxpbUdldFUxNihwQnVmKTsKKyAgICBwQnVmICs9IHNpemVvZih0QU5JX1UxNik7CisKKyAgICBQRUxPRzEobGltTG9nKHBNYWMsIExPRzEsIEZMKCJTTUVfRElTQVNTT0N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mxlbmd0aDsKKyAgICBtTGVuICs9IHBSZWFzc29jSW5kLT5zc0lkLmxlbmd0aCArIDE7CisKKyAgICAvLyBGaWxsIGluIHJzbklFCisgICAgbGltQ29weVUxNihwQnVmLCBwUmVhc3NvY0luZC0+cnNuSUUubGVuZ3RoKTsKKyAgICBwQnVmICs9IHNpemVvZih0QU5JX1UxNik7CisgICAgbUxlbiArPSBzaXplb2YodEFOSV9VMTYpOworICAgIHZvc19tZW1fY29weSggcEJ1ZiwgKHRBTklfVTggKikgJihwUmVhc3NvY0luZC0+cnNuSUUucnNuSUVkYXRhKSwKKyAgICAgICAgICAgICAgICAgIHBSZWFzc29jSW5kLT5yc25JRS5sZW5ndGgpOworICAgIHBCdWYgKz0gcFJlYXNzb2NJbmQtPnJzbklFLmxlbmd0aDsKKyAgICBtTGVuICs9IHBSZWFzc29jSW5kLT5yc25JRS5sZW5ndGg7CisKKyAgICAvLyBGaWxsIGluIGFkZElFCisgICAgbGltQ29weVUxNihwQnVmLCBwUmVhc3NvY0luZC0+YWRkSUUubGVuZ3RoKTsKKyAgICBwQnVmICs9IHNpemVvZih0QU5JX1UxNik7CisgICAgbUxlbiArPSBzaXplb2YodEFOSV9VMTYpOworICAgIHZvc19tZW1fY29weSggcEJ1ZiwgKHRBTklfVTgqKSAmKHBSZWFzc29jSW5kLT5hZGRJRS5hZGRJRWRhdGEpLAorICAgICAgICAgICAgICAgICAgIHBSZWFzc29jSW5kLT5hZGRJRS5sZW5ndGgpOworICAgIHBCdWYgKz0gcFJlYXNzb2NJbmQtPmFkZElFLmxlbmd0aDsKKyAgICBtTGVuICs9IHBSZWFzc29jSW5kLT5hZGRJRS5sZW5ndGg7CisKKworICAgIGxpbUNvcHlVMzIocEJ1ZiwgcFJlYXNzb2NJbmQtPnNwZWN0cnVtTWd0SW5kaWNhdG9yKTsKKyAgICBwQnVmICs9IHNpemVvZih0QW5pQm9vbCk7CisgICAgbUxlbiArPSBzaXplb2YodEFuaUJvb2wpOworCisgICAgaWYgKHBSZWFzc29jSW5kLT5zcGVjdHJ1bU1ndEluZGljYXRvciA9PSBlU0lSX1RSVUUpCisgICAgeworICAgICAgICAqcEJ1ZiA9IHBSZWFzc29jSW5kLT5wb3dlckNhcC5taW5UeFBvd2VyOworICAgICAgICBwQnVmKys7CisgICAgICAgICpwQnVmID0gcFJlYXNzb2NJbmQtPnBvd2VyQ2FwLm1heFR4UG93ZXI7CisgICAgICAgIHBCdWYrKzsKKyAgICAgICAgbUxlbiArPSBzaXplb2YodFNpck1hY1Bvd2VyQ2FwSW5mbyk7CisKKyAgICAgICAgKnBCdWYgPSBwUmVhc3NvY0luZC0+c3VwcG9ydGVkQ2hhbm5lbHMubnVtQ2hubDsKKyAgICAgICAgcEJ1ZisrOworICAgICAgICBtTGVuKys7CisKKyAgICAgICAgdm9zX21lbV9jb3B5KCBwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSAmKHBSZWFzc29jSW5kLT5zdXBwb3J0ZWRDaGFubmVscy5jaGFubmVsTGlzdCksCisgICAgICAgICAgICAgICAgICAgICAgIHBSZWFzc29jSW5kLT5zdXBwb3J0ZWRDaGFubmVscy5udW1DaG5sKTsKKworICAgICAgICBwQnVmICs9IHBSZWFzc29jSW5kLT5zdXBwb3J0ZWRDaGFubmVscy5udW1DaG5sOworICAgICAgICBtTGVuICs9IHBSZWFzc29jSW5kLT5zdXBwb3J0ZWRDaGFubmVscy5udW1DaG5sOworICAgIH0KKyAgICBsaW1Db3B5VTMyKHBCdWYsIHBSZWFzc29jSW5kLT5XbW1TdGFJbmZvUHJlc2VudCk7CisgICAgcEJ1ZiArPSBzaXplb2YodEFOSV9VMzIpOworICAgIG1MZW4gKz0gc2l6ZW9mKHRBTklfVTMyKTsKKworICAgIC8vIEZpbGwgaW4gbGVuZ3RoIG9mIFNNRV9SRUFTU09DX0lORCBtZXNzYWdlCisgICAgbGltQ29weVUxNihwTGVuLCBtTGVuKTsKKworICAgIFBFTE9HMShsaW1M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wU2V0Q29udGV4dFJlcS0+a2V5TWF0ZXJpYWwua2V5OworCisgICAgICAgIHBLZXlpbmZvLT5rZXlJZCA9IDA7CisgICAgICAgIHBLZXlpbmZvLT5rZXlEaXJlY3Rpb24gPSBlU0lSX1RYX1JYOyAKKyAgICAgICAgcEtleWluZm8tPmtleUxlbmd0aCA9IDA7CisgICAgICAgICAgICAKKyAgICAgICAgaWYgKCFsaW1Jc0FkZHJCQyhwU2V0Q29udGV4dFJlcS0+cGVlck1hY0FkZHIpKQorICAgICAgICAgICAgcEtleWluZm8tPnVuaWNhc3QgPSAxOworICAgICAgICBlbHNlCisgICAgICAgICAgICBwS2V5aW5mby0+dW5pY2FzdCA9IDA7ICAgICAgICAgICAgIAorICAgIH1lbHNlIHsKKyAgICAgICAgcEtleXMgID0gKHRBTklfVTggKikgcFNldENvbnRleHRSZXEtPmtleU1hdGVyaWFsLmtleTsKKyAgICAgICAgZG8geworICAgICAgICAgICAgdEFOSV9VMzIga2V5U2l6ZSAgID0gbGltR2V0S2V5c0luZm8ocE1hYywgKHRwU2lyS2V5cykgcEtleXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQnVmKTsKKyAgICAgICAgICAgIHZvc19tZW1femVybyhwQnVmLCBrZXlTaXplKTsKKyAgICAgICAgICAgIHBCdWYgICAgICAgICArPSBrZXlTaXplOworICAgICAgICAgICAgcEtleXMgICAgICAgICs9IHNpemVvZih0U2lyS2V5cyk7CisgICAgICAgICAgICB0b3RhbEtleVNpemUgKz0gKHRBTklfVTE2KSBrZXlTaXplOworICAgICAgICAgICAgaWYgKG51bUtleXMgPT0gMCkKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIG51bUtleXMtLTsgICAgICAgICAgICAKKyAgICAgICAgfXdoaWxlIChudW1LZXlzKTsKKyAgICB9CisgICAgcmV0dXJuIGVTSVJfU1VDQ0VTUzsKK30gLyoqKiBlbmQgbGltU2V0Q29udGV4dFJlcVNlckRl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l9GQUlMVVJFOworCisgICAgcFJlbW92ZUtleVJlcS0+bWVzc2FnZVR5cGUgPSBsaW1HZXRVMTYocEJ1Zik7CisgICAgcEJ1ZiArPSBzaXplb2YodEFOSV9VMTYpOworCisgICAgbGVuID0gcFJlbW92ZUtleVJlcS0+bGVuZ3RoID0gbGltR2V0VTE2KHBCdWYpOworICAgIHBCdWYgKz0gc2l6ZW9mKHRBTklfVTE2KTsKKworICAgIFBFTE9HMShsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlNNRV9SRU1PVkVLRVlfUkVRIGxlbmd0aCAlZCBieXRlcyBpczoiKSwgbGVuKTspCisgICAgUEVMT0cxKHNpckR1bXBCdWYocE1hYywgU0lSX0xJTV9NT0RVTEVfSUQsIExPRzEsIHBUZW1wLCBsZW4pOykKKworICAgIGlmIChsZW4gPCAodEFOSV9TMTYpIHNpemVvZih0QU5JX1UzMikpCisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisKKyAgICBsZW4gLT0gc2l6ZW9mKHRBTklfVTMyKTsgLy8gc2tpcCBtZXNzYWdlIGhlYWRlcgorICAgIGlmIChsaW1DaGVja1JlbWFpbmluZ0xlbmd0aChwTWFjLCBsZW4pID09IGVTSVJfRkFJTFVSRSkKKyAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKworICAgIHZvc19tZW1fY29weSggKHRBTklfVTggKikgcFJlbW92ZUtleVJlcS0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICBwQnVmLCBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICBwQnVmICs9IHNpemVvZih0U2lyTWFjQWRkcik7CisgICAgbGVuICAtPSBzaXplb2YodFNpck1hY0FkZHIpOworICAgIGlmIChsaW1DaGVja1JlbWFpbmluZ0xlbmd0aChwTWFjLCBsZW4pID09IGVTSVJfRkFJTFVSRSkKKyAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKworCisgICAgcFJlbW92ZUtleVJlcS0+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QVNTVU1QVElPTlM6CisgKiBOQQorICoKKyAqTk9URToKKyAqIE5BCisgKgorICogQHBhcmFtICB0cFNpclNtZVRraXBDbnRyTWVhc1JlcSAgUG9pbnRlciB0byB0U2lyU21lVGtpcENudHJNZWFzUmVxIGJlaW5nIGV4dHJhY3RlZAorICogQHBhcmFtICBwQnVmICAgICAgICAgICAgICAgICAgICAgUG9pbnRlciB0byBzZXJpYWxpemVkIGJ1ZmZlcgorICogQHJldHVybiByZXRDb2RlICAgICAgICAgICAgICAgICAgSW5kaWNhdGVzIHdoZXRoZXIgbWVzc2FnZSBpcyBzdWNjZXNzZnVsbHkKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlLXNlcmlhbGl6ZWQgKGVTSVJfU1VDQ0VTUykgb3IKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vdCAoZVNJUl9GQUlMVVJFKQorICovCit0U2lyUmV0U3RhdHVzCitsaW1Ua2lwQ250ck1lYXNSZXFTZXJEZXModHBBbmlTaXJHbG9iYWwgcE1hYywgdHBTaXJTbWVUa2lwQ250ck1lYXNSZXEgIHBUa2lwQ250ck1lYXNSZXEsIHRBTklfVTggKnBCdWYpCit7CisgICAgdEFOSV9TMTYgbGVuID0gMDsKKworI2lmZGVmIFBFX0RFQlVHX0xPRzEKKyAgICB0QU5JX1U4ICAqcFRlbXAgPSBwQnVmOworI2VuZGlmCisKKyAgICBwVGtpcENudHJNZWFzUmVxLT5tZXNzYWdlVHlwZSA9IGxpbUdldFUxNihwQnVmKTsKKyAgICBwQnVmICs9IHNpemVvZih0QU5JX1UxNik7CisKKyAgICBsZW4gPSBwVGtpcENudHJNZWFzUmVxLT5sZW5ndGggPSBsaW1HZXRVMTYocEJ1Zik7CisgICAgcEJ1ZiArPSBzaXplb2YodEFOSV9VMTYpOworCisgICAgUEVMT0cxKGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiU01FX1RLSVBfQ05UUl9NRUFTX1JFUSBs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V9CWVRFX0VORElBTikpKQorICAgICpwdHIrKyA9ICh0QU5JX1U4KSAodTE2VmFsICYgMHhmZik7CisgICAgKnB0ciAgID0gKHRBTklfVTgpICgodTE2VmFsID4+IDgpICYgMHhmZik7CisjZWxzZQorI2Vycm9yICJVbmtub3duIGNvbWJpbmF0aW9uIG9mIE9TIFR5cGUgYW5kIGVuZGlhbmVzcyIKKyNlbmRpZgorfQorICAgICAgICAKK3N0YXRpYyBpbmxpbmUgdEFOSV9VMTYgbGltR2V0VTE2KHRBTklfVTggKnB0cikKK3sKKyNpZiAoKGRlZmluZWQoQU5JX09TX1RZUEVfUU5YKSAmJiBkZWZpbmVkKEFOSV9MSVRUTEVfQllURV9FTkRJQU4pKSB8fCAgIFwKKyAgICAgKGRlZmluZWQoQU5JX09TX1RZUEVfQU5EUk9JRCkgJiYgZGVmaW5lZChBTklfTElUVExFX0JZVEVfRU5ESUFOKSkpCisgICAgcmV0dXJuICgoKHRBTklfVTE2KSAoKihwdHIrMSkgPDwgOCkpIHwKKyAgICAgICAgICAgICgodEFOSV9VMTYpICgqcHRyKSkpOworI2Vsc2UKKyNlcnJvciAiVW5rbm93biBjb21iaW5hdGlvbiBvZiBPUyBUeXBlIGFuZCBlbmRpYW5lc3MiCisjZW5kaWYKK30KKworc3RhdGljIGlubGluZSB2b2lkIGxpbUNvcHlVMzIodEFOSV9VOCAqcHRyLCB0QU5JX1UzMiB1MzJWYWwpCit7CisjaWYgKChkZWZpbmVkKEFOSV9PU19UWVBFX1FOWCkgJiYgZGVmaW5lZChBTklfTElUVExFX0JZVEVfRU5ESUFOKSkgfHwgICBcCisgICAgIChkZWZpbmVkKEFOSV9PU19UWVBFX0FORFJPSUQpICYmIGRlZmluZWQoQU5JX0xJVFRMRV9CWVRFX0VORElBTikpKQorICAgICpwdHIrKyA9ICh0QU5JX1U4KSAodTMyVmFsICYgMHhmZik7CisgICAgKnB0cisrID0gKHRBTklfVTgpICgodTMyVmFsID4+IDgpICYgMHhmZik7Cisg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OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAKKyAgXGZpbGUgIGxpbVNlc3Npb24uYworICAKKyAgXGJyaWVmIGltcGxlbWVudGF0aW9uIGZvciBsaW0gU2Vzc2lvbiByZWxhdGVkIEFQSXMKKworICBcYXV0aG9yIFN1bml0IEJoYXRpYQorICAKKyAgCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBJbmNsdWRlIEZpbGVzCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisjaW5jbHVkZSAiYW5pR2xvYmFsLmgiCisjaW5jbHVkZSAibGltRGVidWcuaCIKKyNpbmNsdWRlICJsaW1TZXNzaW9uLmgiCisjaW5jbHVkZSAibGltVXRpbHMuaCIKKyNpZiBkZWZpbmVkKEZFQVRVUkVfV0xBTl9FU0UpICY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uKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggKmJzc2lkICwgdEFOSV9VOCogc2Vzc2lvbklkLCB0QU5JX1UxNiBudW1TdGEpCit7CisgICAgdEFOSV9VOCBpOworICAgIGZvcihpID0wOyBpIDwgcE1hYy0+bGltLm1heEJzc0lkOyBpKyspCisgICAgeworICAgICAgICAvKiBGaW5kIGZpcnN0IGZyZWUgcm9vbSBpbiBzZXNzaW9uIHRhYmxlICovCisgICAgICAgIGlmKHBNYWMtPmxpbS5ncFNlc3Npb25baV0udmFsaWQgPT0gRkFMU0UpCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fc2V0KCh2b2lkKikmcE1hYy0+bGltLmdwU2Vzc2lvbltpXSwgc2l6ZW9mKHRQRVNlc3Npb24pLCAwKTsKKworICAgICAgICAgICAgLy9BbGxvY2F0ZSBzcGFjZSBmb3IgU3RhdGlvbiBUYWJsZSBmb3IgdGhpcyBzZXNzaW9uLgorICAgICAgICAgICAgcE1hYy0+bGltLmdwU2Vzc2lvbltpXS5kcGguZHBoSGFzaFRhYmxlLnBIYXNoVGFibGUgPSB2b3NfbWVtX3ZtYWxsb2MoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0cERwaEhhc2hOb2RlKSpudW1TdGEpOworICAgICAgICAgICAgaWYgKCBOVUxMID09IHBNYWMtPmxpbS5ncFNlc3Npb25baV0uZHBoLmRwaEhhc2hUYWJsZS5wSGFzaFRhYmxlICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIm1lbW9yeSBhbGxvY2F0ZSBmb3Igc2l6ZSAlbHUgZmFpbGVkISIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsb25nIHVuc2lnbmVkIGludCkgc2l6ZW9mKHRwRHBoSGFzaE5vZGUpKm51bVN0YSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHBNYWMtPmxpbS5ncFNlc3Npb25baV0uZHBoLmRwaEhhc2hUYWJsZS5wRHBoTm9kZUFycmF5ID0gdm9zX21lbV92bWFsbG9jKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0RHBoSGFzaE5vZGUpKm51bVN0YSk7CisgICAgICAgICAgICBpZiAoIE5VTEwgPT0gcE1hYy0+bGltLmdwU2Vzc2lvbltpXS5kcGguZHBoSGFzaFRhYmxlLnBEcGhOb2RlQXJyYXkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgibWVtb3J5IGFsbG9jYXRlIGZhaWxlZCBmb3IgTm9kZSBhcnJheSIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvZiBzaXplICVsdSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobG9uZyB1bnNpZ25lZCBpbnQpIHNpemVvZih0RHBoSGFzaE5vZGUpKm51bVN0YSk7CisgICAgICAgICAgICAgICAgdm9zX21lbV92ZnJlZShwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmRwaC5kcGhIYXNoVGFibGUucEhhc2hUYWJsZSk7CisgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwU2Vzc2lvbltpXS5kcGguZHBoSGFzaFRhYmxlLnBIYXNoVGFibGUgPSBOVUxMOworICAgICAgICAgICAgICAgIHJldHVybiBOVUxMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcE1hYy0+bGltLmdwU2Vzc2lvbltpXS5kcGguZHBoSGFzaFRhYmxlLnNpemUgPSBudW1TdGE7CisKKyAgICAgICAgICAgIGRwaEhhc2hUYWJsZUNsYXNzSW5pdChwTWFjLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICZwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmRwaC5kcGhIYXNoVGFibGUpOworCisgICAgICAgICAgICBwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmdwTGltUGVlcklkeHBvb2wgPSB2b3NfbWVtX3ZtYWxsb2Moc2l6ZW9mKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqcE1hYy0+bGltLmdwU2Vzc2lvbltpXS5ncExpbVBlZXJJZHhwb29sKSAqIChudW1TdGErMSkpOworICAgICAgICAgICAgaWYgKCBOVUxMID09IHBNYWMtPmxpbS5ncFNlc3Npb25baV0uZ3BMaW1QZWVySWR4cG9vbCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJtZW1vcnkgYWxsb2NhdGUgZmFpbGVkICIKKyAgICAgICAgICAgICAgICAiZm9yIHBlZXJJZCBwb29sIG9mIHNpemUgJWx1ISIpLCAobG9uZyB1bnNpZ25lZCBpbnQpCisgICAgICAgICAgICAgICAgc2l6ZW9mKCpwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmdwTGltUGVlcklkeHBvb2wpICogKG51bVN0YSsxKSk7CisgICAgICAgICAgICAgICAgdm9zX21lbV92ZnJlZShwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmRwaC5kcGhIYXNoVGFibGUucEhhc2hUYWJsZSk7CisgICAgICAgICAgICAgICAgdm9zX21lbV92ZnJlZShwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmRwaC5kcGhIYXNoVGFibGUucERwaE5vZGVBcnJheSk7CisgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwU2Vzc2lvbltpXS5kcGguZHBoSGFzaFRhYmxlLnBIYXNoVGFibGUgPSBOVUxMOworICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5ncFNlc3Npb25baV0uZHBoLmRwaEhhc2hUYWJsZS5wRHBoTm9kZUFycmF5ID0gTlVMTDsKKyAgICAgICAgICAgICAgICByZXR1cm4gTlVMTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHZvc19tZW1fc2V0KHBNYWMtPmxpbS5ncFNlc3Npb25baV0uZ3BMaW1QZWVySWR4cG9vbCwKKyAgICAgICAgICAgICAgICAgIHNpemVvZigqcE1hYy0+bGltLmdwU2Vzc2lvbltpXS5ncExpbVBlZXJJZHhwb29sKSAqIChudW1TdGErMSksIDApOworICAgICAgICAgICAgcE1hYy0+bGltLmdwU2Vzc2lvbltpXS5mcmVlUGVlcklkeEhlYWQgPSAwOworICAgICAgICAgICAgcE1hYy0+bGltLmdwU2Vzc2lvbltpXS5mcmVlUGVlcklkeFRhaWwgPSAwOworICAgICAgICAgICAgcE1hYy0+bGltLmdwU2Vzc2lvbltpXS5nTGltTnVtT2ZDdXJyZW50U1RBcyA9IDA7CisKKyAgICAgICAgICAgIC8qIENvcHkgdGhlIEJTU0lEIHRvIHRoZSBzZXNzaW9uIHRhYmxlICovCisgICAgICAgICAgICBzaXJDb3B5TWFjQWRkcihwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmJzc0lkLCBic3NpZCk7CisgICAgICAgICAgICBwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLnZhbGlkID0gVFJVRTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgLyogSW50aWFsaXplIHRoZSBTTUUgYW5kIE1MTSBzdGF0ZXMgdG8gSURMRSAqLworICAgICAgICAgICAgcE1hYy0+bGltLmdwU2Vzc2lvbltpXS5saW1NbG1TdGF0ZSA9IGVMSU1fTUxNX0lETEVfU1RBVEU7CisgICAgICAgICAgICBwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmxpbVNtZVN0YXRlID0gZUxJTV9TTUVfSURMRV9TVEFURTsKKyAgICAgICAgICAgIHBNYWMtPmxpbS5ncFNlc3Npb25baV0ubGltQ3VycmVudEF1dGhUeXBlID0gZVNJUl9PUEVOX1NZU1RFTTsKKyAgICAgICAgICAgIHBlSW5pdEJlYWNvblBhcmFtcy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zc2lvbkVudHJ5LT5vcGVyTW9kZSwgcHNlc3Npb25FbnRyeS0+YnNzSWR4LAorICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwc2Vzc2lvbkVudHJ5LT5ic3NJZCkpOworCisgICAgZm9yIChuID0gMDsgbiA8IHBNYWMtPmxpbS5tYXhTdGF0aW9uOyBuKyspCisgICAgeworICAgICAgICB0aW1lcl9wdHIgPSAmcE1hYy0+bGltLmxpbVRpbWVycy5ncExpbUNuZldhaXRUaW1lcltuXTsKKworICAgICAgICBpZihwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCA9PSB0aW1lcl9wdHItPnNlc3Npb25JZCkKKyAgICAgICAgeworICAgICAgICAgICAgaWYoVk9TX1RSVUUgPT0gdHhfdGltZXJfcnVubmluZyh0aW1lcl9wdHIpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHR4X3RpbWVyX2RlYWN0aXZhdGUodGltZXJfcHRyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisKKyAgICAvKiBVbmJsb2NrIHRoZSBNdUJGIGZvciBvdGhlciBzZXNzaW9uIGlmIHRoZSBNdUJmIHNlc3Npb24gaXMgZGVsZXRlZAorICAgICAqLworICAgIGlmKHBzZXNzaW9uRW50cnktPnR4TXVCZm9ybWVlKQorICAgIHsKKyAgICAgICAgcE1hYy0+aXNNdUJmc2Vzc2lvbmV4aXN0ID0gRkFMU0U7CisgICAgfQorCisjZW5kaWYKKworICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5wTGltU3RhcnRCc3NSZXEgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZSggcHNlc3Npb25FbnRyeS0+cExpbVN0YXJ0QnNzUmVxICk7CisgICAgICAgIHBzZXNzaW9uRW50cnktPnBMaW1TdGFydEJzc1JlcSA9IE5VTEw7CisgICAgfQorCisgICAgaWYocHNlc3Npb25FbnRyeS0+cExpbUpvaW5SZXEgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZSggcHNlc3Npb25FbnRyeS0+cExpbUpvaW5SZXEgKTsKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+cExpbUpvaW5SZXEgPSBOVUxMOworICAgIH0KKworICAgIGlmKHBzZXNzaW9uRW50cnktPnBMaW1SZUFzc29jUmVxICE9IE5VTEwpCisgICAgeworICAgICAgICB2b3NfbWVtX2ZyZWUoIHBzZXNzaW9uRW50cnktPnBMaW1SZUFzc29jUmVxICk7CisgICAgICAgIHBzZXNzaW9uRW50cnktPnBMaW1SZUFzc29jUmVxID0gTlVMTDsKKyAgICB9CisKKyAgICBpZihwc2Vzc2lvbkVudHJ5LT5wTGltTWxtSm9pblJlcSAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKCBwc2Vzc2lvbkVudHJ5LT5wTGltTWxtSm9pblJlcSApOworICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wTGltTWxtSm9pblJlcSA9IE5VTEw7CisgICAgfQorCisgICAgbG9ja19zdGF0dXMgPSAgcGVfQWNxdWlyZUdsb2JhbExvY2soJnBNYWMtPmxpbSk7CisgICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgPT0gbG9ja19zdGF0dXMpCisgICAgeworICAgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUucEhhc2hUYWJsZSAhPSBOVUxMKQorICAgICAgICAgeworICAgICAgICAgICAgIHZvc19tZW1fdmZyZWUocHNlc3Npb25FbnRyeS0+ZHBoLmRwaEhhc2hUYWJsZS5wSGFzaFRhYmxlKTsKKyAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlLnBIYXNoVGFibGUgPSBOVUxMOworICAgICAgICAgfQorICAgIH0KKyAgICBwZV9SZWxlYXNlR2xvYmFsTG9jaygmcE1hYy0+bGltKTsKKworICAgIGlmKHBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUucERwaE5vZGVBcnJheSAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgdm9zX21lbV92ZnJlZShwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlLnBEcGhOb2RlQXJyYXkpOworICAgICAgICBwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlLnBEcGhOb2RlQXJyYXkgPSBOVUxMOworICAgIH0KKworICAgIGlmKHBzZXNzaW9uRW50cnktPmdwTGltUGVlcklkeHBvb2wgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIHZvc19tZW1fdmZyZWUocHNlc3Npb25FbnRyeS0+Z3BMaW1QZWVySWR4cG9vbCk7CisgICAgICAgIHBzZXNzaW9uRW50cnktPmdwTGltUGVlcklkeHBvb2wgPSBOVUxMOworICAgIH0KKworICAgIGlmKHBzZXNzaW9uRW50cnktPmJlYWNvbiAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKCBwc2Vzc2lvbkVudHJ5LT5iZWFjb24pOworICAgICAgICBwc2Vzc2lvbkVudHJ5LT5iZWFjb24gPSBOVUxMOworICAgIH0KKworICAgIGlmKHBzZXNzaW9uRW50cnktPmFzc29jUmVxICE9IE5VTEwpCisgICAgeworICAgICAgICB2b3NfbWVtX2ZyZWUoIHBzZXNzaW9uRW50cnktPmFzc29jUmVxKTsKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+YXNzb2NSZXEgPSBOVUxMOworICAgIH0KKworICAgIGlmKHBzZXNzaW9uRW50cnktPmFzc29jUnNwICE9IE5VTEwpCisgICAgeworICAgICAgICB2b3NfbWVtX2ZyZWUoIHBzZXNzaW9uRW50cnktPmFzc29jUnNwKTsKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+YXNzb2NSc3AgPSBOVUxMOworICAgIH0KKworCisgICAgaWYocHNlc3Npb25FbnRyeS0+cGFyc2VkQXNzb2NSZXEgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIC8vIENsZWFudXAgdGhlIGluZGl2aWR1YWwgYWxsb2NhdGlvbiBmaXJzdAorICAgICAgICBmb3IgKGk9MDsgaSA8IHBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUuc2l6ZTsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoIHBzZXNzaW9uRW50cnktPnBhcnNlZEFzc29jUmVxW2ldICE9IE5VTEwgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKCAoKHRwU2lyQXNzb2NSZXEpKHBzZXNzaW9uRW50cnktPnBhcnNlZEFzc29jUmVxW2ldKSktPmFzc29jUmVxRnJhbWUgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUoKCh0cFNpckFzc29jUmVxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocHNlc3Npb25FbnRyeS0+cGFyc2VkQXNzb2NSZXFbaV0pKS0+YXNzb2NSZXFGcmFtZSk7CisgICAgICAgICAgICAgICAgICAgKCh0cFNpckFzc29jUmVxKShwc2Vzc2lvbkVudHJ5LT5wYXJzZWRBc3NvY1JlcVtpXSkpLT5hc3NvY1JlcUZyYW1lID0gTlVMTDsKKyAgICAgICAgICAgICAgICAgICAoKHRwU2lyQXNzb2NSZXEpKHBzZXNzaW9uRW50cnktPnBhcnNlZEFzc29jUmVxW2ldKSktPmFzc29jUmVxRnJhbWVMZW5ndGggPSAwOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocHNlc3Npb25FbnRyeS0+cGFyc2VkQXNzb2NSZXFbaV0pOworICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBhcnNlZEFzc29jUmVxW2ldID0gTlVMTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAvLyBDbGVhbnVwIHRoZS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bG9iYWwgcE1hYykKK3sKKyAgICB0QU5JX1U4IGk7CisgICAgdEFOSV9VOCBzZXNzaW9uY291bnQgPSAwOworICAgIHRBTklfVTggc2Vzc2lvbklkID0gMDsKKworICAgIGZvcihpID0gMDsgaSA8IHBNYWMtPmxpbS5tYXhCc3NJZDsgaSsrKQorICAgIHsKKyAgICAgICAgaWYoIChwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLnZhbGlkID09IFRSVUUpJiYKKyAgICAgICAgICAgIChwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9TVEFfUk9MRSkmJgorICAgICAgICAgICAgKHBNYWMtPmxpbS5ncFNlc3Npb25baV0ubGltTWxtU3RhdGUgPT0gZUxJTV9NTE1fTElOS19FU1RBQkxJU0hFRF9TVEFURSkpIHsKKyAgICAgICAgICAgIHNlc3Npb25jb3VudCsrOworICAgICAgICAgICAgc2Vzc2lvbklkID0gaTsKKworICAgICAgICAgICAgaWYoc2Vzc2lvbmNvdW50ID4gMSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByZXR1cm4oTlVMTCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgIH0KKworICAgIGlmKCAocE1hYy0+bGltLmdwU2Vzc2lvbltzZXNzaW9uSWRdLnZhbGlkID09IFRSVUUpJiYKKyAgICAgICAgKHBNYWMtPmxpbS5ncFNlc3Npb25bc2Vzc2lvbklkXS5saW1TeXN0ZW1Sb2xlID09IGVMSU1fU1RBX1JPTEUpJiYKKyAgICAgICAgKHBNYWMtPmxpbS5ncFNlc3Npb25bc2Vzc2lvbklkXS5saW1NbG1TdGF0ZSA9PSBlTElNX01MTV9MSU5LX0VTVEFCTElTSEVEX1NUQVRFKSkKKworICAgIHsKKyAgICAgICByZXR1cm4oJnBNYWMtPmxpbS5ncFNlc3Npb25bc2Vzc2lvbklkXSk7CisgICAgfQorICAgIHJldHVybihOVUxMKTsKKyAgICAKK30KKy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Yy0+bGltLmdwU2Vzc2lvbltpXS5jdXJyZW50T3BlckNoYW5uZWw7CisgICAgICAgICAgICAqcmVzdW1lUGh5Q2JTdGF0ZSA9IHBNYWMtPmxpbS5ncFNlc3Npb25baV0uaHRTZWNvbmRhcnlDaGFubmVsT2Zmc2V0OworICAgICAgICAgICAgCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExQUMKKyAgICAgICAgICAgIGlmICgocE1hYy0+bGltLmdwU2Vzc2lvbltpXS52aHRDYXBhYmlsaXR5KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8qR2V0IDExYWMgY2JTdGF0ZSBmcm9tIDExbiBjYlN0YXRlKi8KKyAgICAgICAgICAgICAgICAqcmVzdW1lUGh5Q2JTdGF0ZSA9IGxpbUdldDExQUNQaHlDQlN0YXRlKHBNYWMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwU2Vzc2lvbltpXS5jdXJyZW50T3BlckNoYW5uZWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmh0U2Vjb25kYXJ5Q2hhbm5lbE9mZnNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5ncFNlc3Npb25baV0uYXBDZW50ZXJDaGFuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBNYWMtPmxpbS5ncFNlc3Npb25baV0pOworICAgICAgICAgICAgfQorI2VuZGlmCisgICAgICAgICAgICAqcmVzdW1lUGh5Q2JTdGF0ZSA9ICgqcmVzdW1lUGh5Q2JTdGF0ZSA+IHByZXZQaHlDYlN0YXRlICk/ICpyZXN1bWVQaHlDYlN0YXRlIDogcHJldlBoeUNiU3RhdGU7CisgICAgICAgICAgICBwcmV2UGh5Q2JTdGF0ZSA9ICpyZXN1bWVQaHlDYlN0YXRlOworICAgICAgICB9CisgICAgfQ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Wxsb3cgbWl4ZWQgbW9kZSBmb3IgR3Vlc3QgYWNjZXNzCisgICAgICAgICAqIGFsbG93IEJTUyBjcmVhdGlvbi9qb2luIHdpdGggbm8gUHJpdmFjeSBjYXBhYmlsaXR5CisgICAgICAgICAqIHlldCBhZHZlcnRpc2luZyBXUEEgSUUKKyAgICAgICAgICovCisgICAgICAgIFBFTE9HMShsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlJTTiBpZSBsZW4gJWQgYnV0IFBSSVZBQ1kgJWQgUlNOICVkIiksCisgICAgICAgICAgICAgICBwUlNOaWUtPmxlbmd0aCwgcHJpdmFjeSwgdmFsKTspCisgICAgfQorCisgICAgaWYgKHBSU05pZS0+bGVuZ3RoKQorICAgIHsKKyAgICAgICAgaWYgKChwUlNOaWUtPnJzbklFZGF0YVswXSAhPSBET1QxMUZfRUlEX1JTTikgJiYKKyAgICAgICAgICAgIChwUlNOaWUtPnJzbklFZGF0YVswXSAhPSBET1QxMUZfRUlEX1dQQSkKKyNpZmRlZiBGRUFUVVJFX1dMQU5fV0FQSQorICAgICAgICAgICAgJiYgKHBSU05pZS0+cnNuSUVkYXRhWzBdICE9IERPVDExRl9FSURfV0FQSSkKKyNlbmRpZgorICAgICAgICAgICAgKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlJTTi9XUEEvV0FQSSBFSUQgJWQgbm90IFslZCB8fCAlZF0iKSwKKyAgICAgICAgICAgICAgICAgICBwUlNOaWUtPnJzbklFZGF0YVswXSwgRE9UMTFGX0VJRF9SU04sIAorICAgICAgICAgICAgICAgICAgIERPVDExRl9FSURfV1BBKTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIGxlbiA9IHBSU05pZS0+bGVuZ3RoOworICAgICAgICBzdGFydFBvcyA9IDA7CisgICAgICAgIHdoaWxlKGxlbiA+IDApCisgICAgICAgIHsKKyAgICAgICAgLy8gQ2hlY2sgdmFsaWRpdHkgb2YgUlNOIElFCisgICAgICAgICAgICBpZiAocFJTTmllLT5yc25JRWRhdGFbc3RhcnRQb3NdID09IERPVDExRl9FSURfUlNOKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZigocFJTTmllLT5yc25JRWRhdGFbc3RhcnRQb3MrMV0gPiBET1QxMUZfSUVfUlNOX01BWF9MRU4pIHx8CisgICAgICAgICAgICAgICAgICAgIChwUlNOaWUtPnJzbklFZGF0YVtzdGFydFBvcysxXSA8IERPVDExRl9JRV9SU05fTUlOX0xFTikpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiUlNOIElFIGxlbiAlZCBub3QgWyVkLCVkXSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICBwUlNOaWUtPnJzbklFZGF0YVtzdGFydFBvcysxXSwgRE9UMTFGX0lFX1JTTl9NSU5fTEVOLAorICAgICAgICAgICAgICAgICAgICAgICAgICBET1QxMUZfSUVfUlNOX01BWF9MRU4pOworICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKHBSU05pZS0+cnNuSUVkYXRhW3N0YXJ0UG9zXSA9PSBET1QxMUZfRUlEX1dQQSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBDaGVjayB2YWxpZGl0eSBvZiBXUEEgSUUKKyAgICAgICAgICAgICAgICBpZiAoU0lSX01BQ19NQVhfSUVfTEVOR1RIID4gc3RhcnRQb3MpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAoc3RhcnRQb3MgPD0gKFNJUl9NQUNfTUFYX0lFX0xFTkdUSCAtIHNpemVvZih0QU5JX1UzMikpKQorICAgICAgICAgICAgICAgICAgICAgICAgdmFsID0gc2lyUmVhZFUzMigodEFOSV9VOCAqKSAmcFJTTmllLT5yc25JRWRhdGFbc3RhcnRQb3MgKyAyXSk7CisgICAgICAgICAgICAgICAgICAgIGlmKChwUlNOaWUtPnJzbklFZGF0YVtzdGFydFBvcyArIDFdIDwgRE9UMTFGX0lFX1dQQV9NSU5fTEVOKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgKHBSU05pZS0+cnNuSUVkYXRhW3N0YXJ0UG9zICsgMV0gPiBET1QxMUZfSUVfV1BBX01BWF9MRU4pIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAoU0lSX01BQ19XUEFfT1VJICE9IHZhbCkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiV1BBIElFIGxlbiAlZCBub3QgWyVkLCVkXSBPUiBkYXRhIDB4JXggbm90IDB4JXgiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSU05pZS0+cnNuSUVkYXRhW3N0YXJ0UG9zKzFdLCBET1QxMUZfSUVfV1BBX01JTl9MRU4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBET1QxMUZfSUVfV1BBX01BWF9MRU4sIHZhbCwgU0lSX01BQ19XUEFfT1VJKTsKKworICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisjaWZkZWYgRkVBVFVSRV9XTEFOX1dBUEkKKyAgICAgICAgICAgIGVsc2UgaWYocFJTTmllLT5yc25JRWRhdGFbc3RhcnRQb3NdID09IERPVDExRl9FSURfV0FQSSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZigocFJTTmllLT5yc25JRWRhdGFbc3RhcnRQb3MrMV0gPiBET1QxMUZfSUVfV0FQSV9NQVhfTEVOKSB8fAorICAgICAgICAgICAgICAgICAocFJTTmllLT5yc25JRWRhdGFbc3RhcnRQb3MrMV0gPCBET1QxMUZfSUVfV0FQSV9NSU5fTEVOKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIldBUEkgSUUgbGVuICVkIG5vdCBbJWQsJWRdIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwUlNOaWUtPnJzbklFZGF0YVtzdGFydFBvcysxXSwgRE9UMTFGX0lFX1dBUElfTUlOX0xFTiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICBET1QxMUZfSUVfV0FQSV9NQVhfTEVOKTsKKworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorI2VuZGlmCisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy93ZSB3aWxsIG5ldmVyIGJlIGhlcmUsIHNpbXBseSBmb3IgY29tcGxldGVuZXNzCisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc3RhcnRQb3MgKz0gMiArIHBSU05pZS0+cnNuSUVkYXRhW3N0YXJ0UG9zKzFdOyAgLy9FSUQgKyBsZW5ndGggZmllbGQgKyBsZW5ndGgKKyAgICAgICAgICAgIGxlbiAtPSBzdGFydFBvczsKKyAgICAgICAgfS8vd2hpbGUKKworICAgIH0KKworICAgIHJldHVybiB0cnVlOworfSAvKioqIGVuZCBsaW1Jc1JTTmllVmFsaWRJblNtZVJlcU1lc3NhZ2UoKSAqKiovCisKKy8qKgorICogbGltSXNBZGRpZVZhbGlkSW5TbWVSZXFNZXNzYWdlKCkKKyAqCisgKkZVTkNUSU9OOgorICogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgdG8gdmVyaWZ5IGlmIHRoZSBBZGQgSUUKKyAqIHJlY2VpdmVkIGluIHZhcmlvdXMgU01FX1JFUSBtZXNzYWdlcyBpcyB2YWxpZCBvciBub3QKKyAqCisgKkxPR0lDOgorICogQWRkIElFIHZhbGlkaXR5IGNoZWNrcyBhcmUgcGVyZm9ybWVkIG9uIG9ubHkgbGVuZ3RoCisgKgorICpBU1NVTVBUSU9OUzoKKyAqCisgKk5PVEU6CisgKgorICogQHBhcmFtICBwTWFjICAgUG9pbnRlciB0byBHbG9iYWwgTUFDIHN0cnVjdHVyZQorICogQHBhcmFtICBwV1NDaWUgUG9pbnRlciB0byByZWNlaXZlZCBXU0MgSUUKKyAqIEByZXR1cm4gdHJ1ZSB3aGVuIFdTQyBJRSBpcyB2YWxpZCwgZmFsc2Ugb3RoZXJ3aXNlCisgKi8KKworc3RhdGljIHRBTklfVTgKK2xpbUlzQWRkaWVWYWxpZEluU21lUmVxTWVzc2FnZSh0cEFuaVNpckdsb2JhbCBwTWFjLCB0cFNpckFkZGllIHBBZGRpZSkKK3sKKyAgICBpbnQgbGVmdCA9IHBBZGRpZS0+bGVuZ3RoOworICAgIHRBTklfVTggKnB0ciA9IHBBZGRpZS0+YWRkSUVkYXRhOworICAgIHRBTklfVTggZWxlbV9pZCwgZWxlbV9sZW47CisKKyAgICBpZiAobGVmdCA9PSAwKQorICAgICAgICByZXR1cm4gdHJ1ZTsKKworICAgIHdoaWxlKGxlZnQgPj0gMikKKyAgICB7CisgICAgICAgIGVsZW1faWQgID0gcHRyWzBdOworICAgICAgICBlbGVtX2xlbiA9IHB0clsxXTsKKyAgICAgICAgbGVmdCAtPSAyOworICAgICAgICBpZihlbGVtX2xlbiA+IGxlZnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgCisgICAgICAgICAgICAgICBGTCgiKioqKkludmFsaWQgQWRkIElFcyBlaWQgPSAlZCBlbGVtX2xlbj0lZCBsZWZ0PSVkKioqKioiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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SwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uIHBTZXNzaW9uRW50cnkpCit7CisgICAgdEFOSV9VOCAgd3BhSW5kZXggPSAwOworICAgIHRBTklfVTMyIHByaXZhY3ksIHZhbDsKKworICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX1BSSVZBQ1lfRU5BQkxFRCwKKyAgICAgICAgICAgICAgICAgICZwcml2YWN5KSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgIEZMKCJVbmFibGUgdG8gcmV0cmlldmUgUE9JIGZyb20gQ0ZHIikpOworICAgIH0KKworICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX1JTTl9FTkFCTEVELAorICAgICAgICAgICAgICAgICAgJnZhbCkgIT0gZVNJUl9TVUNDRVNTKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICBGTCgiVW5hYmxlIHRvIHJldHJpZXZlIFJTTl9FTkFCTEVEIGZyb20gQ0ZHIikpOworICAgIH0KKworICAgIGlmIChwUlNOaWUtPmxlbmd0aCAmJiAoIXByaXZhY3kgfHwgIXZhbCkpCisgICAgeworICAgICAgICAvLyBQcml2YWN5ICYgUlNOIG5vdCBlbmFibGVkIGluIENGRy4KKyAgICAgICAgLyoqCisgICAgICAgICAqIEluIG9yZGVyIHRvIGFsbG93IG1peGVkIG1vZGUgZm9yIEd1ZXN0IGFjY2VzcworICAgICAgICAgKiBhbGxvdyBCU1MgY3JlYXRpb24vam9pbiB3aXRoIG5vIFByaXZhY3kgY2FwYWJpbGl0eQorICAgICAgICAgKiB5ZXQgYWR2ZXJ0aXNpbmcgV1BBIElFCisgICAgICAgICAqLworICAgICAgICBQRUxPRzEobGltTG9nKHBNYWMsIExPRzEsIEZMKCJSU04gaWUgbGVuICVkIGJ1dCBQUklWQUNZICVkIFJTTiAlZCIpLAorICAgICAgICAgICAgICAgcFJTTmllLT5sZW5ndGgsIHByaXZhY3ksIHZhbCk7KQorICAgIH0KKworICAgIGlmIChwUlNOaWUtPmxlbmd0aCkKKyAgICB7CisgICAgICAgIGlmICgocFJTTmllLT5yc25JRWRhdGFbMF0gIT0gU0lSX01BQ19SU05fRUlEKSAmJgorICAgICAgICAgICAgKHBSU05pZS0+cnNuSUVkYXRhWzBdICE9IFNJUl9NQUNfV1BBX0VJRCkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiUlNOL1dQQSBFSUQgJWQgbm90IFslZCB8fCAlZF0iKSwKKyAgICAgICAgICAgICAgICAgICBwUlNOaWUtPnJzbklFZGF0YVswXSwgU0lSX01BQ19SU05fRUlELCAKKyAgICAgICAgICAgICAgICAgICBTSVJfTUFDX1dQQV9FSUQpOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgLy8gQ2hlY2sgdmFsaWRpdHkgb2YgUlNOIElFCisgICAgICAgIGlmICgocFJTTmllLT5yc25JRWRhdGFbMF0gPT0gU0lSX01BQ19SU05fRUlEKSAmJgorI2lmIDAgLy8gQ29tcGFyaXNvbiBhbHdheXMgZmFsc2UKKyAgICAgICAgICAgIChwUlNOaWUtPnJzbklFZGF0YVsxXSA+IFNJUl9NQUNfUlNOX0lFX01BWF9MRU5HVEgpIHx8CisjZW5kaWYKKyAgICAgICAgICAgICAocFJTTmllLT5yc25JRWRhdGFbMV0gPCBTSVJfTUFDX1JTTl9JRV9NSU5fTEVOR1RIKSkKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJSU04gSUUgbGVuICVkIG5vdCBbJWQsJWRdIiksCisgICAgICAgICAgICAgICAgICAgcFJTTmllLT5yc25JRWRhdGFbMV0sIFNJUl9NQUNfUlNOX0lFX01JTl9MRU5HVEgsIAorICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfUlNOX0lFX01BWF9MRU5HVEgpOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgaWYgKHBSU05pZS0+bGVuZ3RoID4gcFJTTmllLT5yc25JRWRhdGFbMV0gKyAyKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAocFJTTmllLT5yc25JRWRhdGFbMF0gIT0gU0lSX01BQ19SU05fRUlEKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICBGTCgiRmlyc3QgYnl0ZVslZF0gaW4gcnNuSUVkYXRhIGlzIG5vdCBSU05fRUlEIiksCisgICAgICAgICAgICAgICAgICAgICAgIHBSU05pZS0+cnNuSUVkYXRhWzFdKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLAorICAgICAgICAgICAgICAgICAgIExPRzEsCisgICAgICAgICAgICAgICAgICAgRkwoIldQQSBJRSBpcyBwcmVzZW50IGFsb25nIHdpdGggV1BBMiBJRSIpKTsKKyAgICAgICAgICAgIHdwYUluZGV4ID0gMiArIHBSU05pZS0+cnNuSUVkYXRhWzFdOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKChwUlNOaWUtPmxlbmd0aCA9PSBwUlNOaWUtPnJzbklFZGF0YVsxXSArIDIpICYmCisgICAgICAgICAgICAgICAgIChwUlNOaWUtPnJzbklFZGF0YVswXSA9PSBTSVJfTUFDX1JTTl9FSUQpKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywKKyAgICAgICAgICAgICAgICAgICBMT0cxLAorICAgICAgICAgICAgICAgICAgIEZMKCJPbmx5IFJTTiBJRSBpcyBwcmVzZW50IikpOworICAgICAgICAgICAgZG90MTFmVW5wYWNrSWVSU04ocE1hYywmcFJTTmllLT5yc25JRWRhdGFbMl0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOClwUlNOaWUtPmxlbmd0aCwmcFNlc3Npb25FbnRyeS0+Z1N0YXJ0QnNzUlNOSWUpOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKChwUlNOaWUtPmxlbmd0aCA9PSBwUlNOaWUtPnJzbklFZGF0YVsxXSArIDIpICYmCisgICAgICAgICAgICAgICAgIChwUlNOaWUtPnJzbklFZGF0YVswXSA9PSBTSVJfTUFDX1dQQV9FSUQpKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywKKyAgICAgICAgICAgICAgICAgICBMT0cxLAorICAgICAgICAgICAgICAgICAgIEZMKCJPbmx5IFdQQSBJRSBpcyBwcmVzZW50IikpOworCisgICAgICAgICAgICBkb3QxMWZVbnBhY2tJZVdQQShwTWFjLCZwUlNOaWUtPnJzbklFZGF0YVs2XSwodEFOSV9VOClwUlNOaWUtPmxlbmd0aC00LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFNlc3Npb25FbnRyeS0+Z1N0YXJ0QnNzV1BBSWUpOworICAgICAgICB9CisKKyAgICAgICAgLy8gQ2hlY2sgdmFsaWRpdHkgb2YgV1BBIElFCisgICAgICAgIGlmKHdwYUluZGV4ICs0IDwgU0lSX01BQ19NQVhfSUVfTEVOR1RIICkKKyAgICAgICAgeworICAgICAgICAgICAgdmFsID0gc2lyUmVhZFUzMigodEFOSV9VOCAqKSAmcFJTTmllLT5yc25JRWRhdGFbd3BhSW5kZXggKyAyXSk7CisKKyAgICAgICAgICAgIGlmICgocFJTTmllLT5yc25JRWRhdGFbd3BhSW5kZXhdID09IFNJUl9NQUNfV1BBX0VJRCkgJiYKKyNpZiAwIC8vIENvbXBhcmlzb24gYWx3YXlzIGZhbHNlCisgICAgICAgICAgICAgICAgKHBSU05pZS0+cnNuSUVkYXRhW3dwYUluZGV4ICsgMV0gPiBTSVJfTUFDX1dQQV9JRV9NQVhfTEVOR1RIKSB8fAorI2VuZGlmCisgICAgICAgICAgICAgICAgKChwUlNOaWUtPnJzbklFZGF0YVt3cGFJbmRleCArIDFdIDwgU0lSX01BQ19XUEFfSUVfTUlOX0xFTkdUSCkgfHwKKyAgICAgICAgICAgICAgICAoU0lSX01BQ19XUEFfT1VJICE9IHZhbCkpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgRkwoIldQQSBJRSBsZW4gJWQgbm90IFslZCwlZF0gT1IgZGF0YSAweCV4IG5vdCAweCV4IiksCisgICAgICAgICAgICAgICAgICBwUlNOaWUtPnJzbklFZGF0YVsxXSwgU0lSX01BQ19SU05fSUVfTUlOX0xFTkdUSCwKKyAgICAgICAgICAgICAgICAgIFNJUl9NQUNfUlNOX0lFX01BWF9MRU5HVEgsIHZhbCwgU0lSX01BQ19XUEFfT1VJKTsKKworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBCb3RoIFJTTiBhbmQgV1BBIElFcyBhcmUgcHJlc2VudCAqLworICAgICAgICAgICAgICAgIGRvdDExZlVucGFja0llUlNOKHBNYWMsJnBSU05pZS0+cnNuSUVkYXRhWzJdLAorICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4KXBSU05pZS0+bGVuZ3RoLCZwU2Vzc2lvbkVudHJ5LT5nU3RhcnRCc3NSU05JZSk7CisKKyAgICAgICAgICAgICAgICBkb3QxMWZVbnBhY2tJZVdQQShwTWFjLCZwUlNOaWUtPnJzbklFZGF0YVt3cGFJbmRleCArIDZdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJTTmllLT5yc25JRWRhdGFbd3BhSW5kZXggKyAxXS00LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBTZXNzaW9uRW50cnktPmdTdGFydEJzc1dQQUllKTsKKworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIHRydWU7Cit9IC8qKiogZW5kIGxpbVNldFJTTmllV1BBaWVmcm9tU21lU3RhcnRCU1NSZXFNZXNzYWdlKCkgKioqLworCisKKworCisvKioKKyAqIGxpbUlzQnNzRGVzY3JWYWxpZEluU21lUmVxTWVzc2FnZSgpCisgKgorICpGVU5DVElPTjoKKyAqIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIHRvIHZlcmlmeSBpZiB0aGUgQlNTIERlc2NyCisgKiByZWNlaXZlZCBpbiB2YXJpb3VzIFNNRV9SRVEgbWVzc2FnZXMgaXMgdmFsaWQgb3Igbm90CisgKgorICpMT0dJQzoKKyAqIEJTUyBEZXNjcml0aXBpb24gdmFsaWRpdHkgY2hlY2tzIGFyZSBwZXJmb3JtZWQgaW4gdGhpcyBmdW5jdGlvbgorICoKKyAqQVNTVU1QVElPTlM6CisgKgorICpOT1RFOgorICoKKyAqIEBwYXJhbSAgcE1hYyAgICAgIFBvaW50ZXIgdG8gR2xvYmFsIE1BQyBzdHJ1Y3R1cmUKKyAqIEBwYXJhbSAgcEJzc0Rlc2NyIFBvaW50ZXIgdG8gcmVjZWl2ZWQgQnNzIERlc2NyaXRpcGlvbgorICogQHJldHVybiB0cnVlIHdoZW4gQlNTIGRlc2NyaXB0aW9uIGlzIHZhbGlkLCBmYWxzZSBvdGhlcndpc2UKKyAqLworCitzdGF0aWMgdEFOSV9VOAorbGltSXNCc3NEZXNjclZhbGlkSW5TbWVSZXFNZXNzYWdlKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaX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Nhc2UgZVNJUl9JTkZSQVNUUlVDVFVSRV9NT0RFOgorICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBTaG91bGQgbm90IGhhdmUgcmVjZWl2ZWQgc3RhcnQgQlNTIHJlcSB3aXRoIGJzc1R5cGUKKyAgICAgICAgICAgICAqIEluZnJhc3RydWN0dXJlIG9uIFNUQS4KKyAgICAgICAgICAgICAqIExvZyBlcnJvci4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgRkwoIkludmFsaWQgYnNzVHlwZSAlZCBpbiBlV05JX1NNRV9TVEFSVF9CU1NfUkVRIiksCisgICAgICAgICAgICAgICAgICAgcFN0YXJ0QnNzUmVxLT5ic3NUeXBlKTsKKyAgICAgICAgICAgIHZhbGlkID0gZmFsc2U7CisgICAgICAgICAgICBnb3RvIGVuZDsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVNJUl9JQlNTX01PREU6CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICAvKiBBZGRlZCBmb3IgQlQgQU1QIHN1cHBvcnQgKi8KKyAgICAgICAgY2FzZSBlU0lSX0JUQU1QX1NUQV9NT0RFOiAgICAgICAgICAgICAgCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIAorICAgICAgICAvKiBBZGRlZCBmb3IgQlQgQU1QIHN1cHBvcnQgKi8KKyAgICAgICAgY2FzZSBlU0lSX0JUQU1QX0FQX01PREU6CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICAvKiBBZGRlZCBmb3IgU29mdEFQIHN1cHBvcnQgKi8KKyAgICAgICAgY2FzZSBlU0lSX0lORlJBX0FQX01PREU6CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFNob3VsZCBub3QgaGF2ZSByZWNlaXZlZCBzdGFydCBCU1MgcmVxIHdpdGggYnNzVHlwZQorICAgICAgICAgICAgICogb3RoZXIgdGhhbiBJbmZyYXN0cnVjdHVyZS9JQlNTLgorICAgICAgICAgICAgICogTG9nIGVycm9yCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICAgICAgRkwoIkludmFsaWQgYnNzVHlwZSAlZCBpbiBlV05JX1NNRV9TVEFSVF9CU1NfUkVRIiksCisgICAgICAgICAgICAgICBwU3RhcnRCc3NSZXEtPmJzc1R5cGUpOworCisgICAgICAgICAgICB2YWxpZCA9IGZhbHNlOworICAgICAgICAgICAgZ290byBlbmQ7CisgICAgfQorCisgICAgLyogVGhpcyBiZWxvdyBjb2RlIGlzIGNsaWVudCBzcGVjaWZpYyBjb2RlLiBUT0RPICovCisgICAgaWYgKHBTdGFydEJzc1JlcS0+YnNzVHlwZSA9PSBlU0lSX0lCU1NfTU9ERSkKKyAgICB7CisgICAgICAgIGlmICghcFN0YXJ0QnNzUmVxLT5zc0lkLmxlbmd0aCB8fAorICAgICAgICAgICAgKHBTdGFydEJzc1JlcS0+c3NJZC5sZW5ndGggPiBTSVJfTUFDX01BWF9TU0lEX0xFTkdUSCkpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIEludmFsaWQgbGVuZ3RoIGZvciBTU0lELiAgCisgICAgICAgICAgICAvLyBSZWplY3QgU1RBUlRfQlNTX1JFUQorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1csCisgICAgICAgICAgICAgICAgRkwoIkludmFsaWQgU1NJRCBsZW5ndGggaW4gZVdOSV9TTUVfU1RBUlRfQlNTX1JFUSIpKTsKKworICAgICAgICAgICAgdmFsaWQgPSBmYWxzZTsKKyAgICAgICAgICAgIGdvdG8gZW5kOworICAgICAgICB9CisgICAgfQorCisKKyAgICBpZiAoIWxpbUlzUlNOaWVWYWxpZEluU21lUmVxTWVzc2FnZShwTWFjLCAmcFN0YXJ0QnNzUmVxLT5yc25JRSkpCisgICAgeworICAgICAgICB2YWxpZCA9IGZhbHNlOworICAgICAgICBnb3RvIGVuZDsKKyAgICB9CisKKyAgICBpZiAocFN0YXJ0QnNzUmVxLT5ud1R5cGUgIT0gZVNJUl8xMUFfTldfVFlQRSAmJgorICAgICAgICBwU3RhcnRCc3NSZXEtPm53VHlwZSAhPSBlU0lSXzExQl9OV19UWVBFICYmCisgICAgICAgIHBTdGFydEJzc1JlcS0+bndUeXBlICE9IGVTSVJfMTFHX05XX1RZUEUpCisgICAgeworICAgICAgICB2YWxpZCA9IGZhbHNlOworICAgICAgICBnb3RvIGVuZDsKKyAgICB9CisKKyAgICBpZiAocFN0YXJ0QnNzUmVxLT5ud1R5cGUgPT0gZVNJUl8xMUFfTldfVFlQRSkKKyAgICB7CisgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwU3RhcnRCc3NSZXEtPm9wZXJhdGlvbmFsUmF0ZVNldC5udW1SYXRlczsgaSsrKQorICAgICAgICAgICAgaWYgKCFzaXJJc0FyYXRlKHBTdGFydEJzc1JlcS0+b3BlcmF0aW9uYWxSYXRlU2V0LnJhdGVbaV0gJiAweDdGKSkKKyAgICAgICAgeworICAgICAgICAgICAgLy8gSW52YWxpZCBPcGVyYXRpb25hbCByYXRlcworICAgICAgICAgICAgLy8gUmVqZWN0IFNUQVJUX0JTU19SRVEKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICAgICAgICAgIEZMKCJJbnZhbGlkIG9wZXJhdGlvbmFsIHJhdGVzIGluIGVXTklfU01FX1NUQVJUX0JTU19SRVEiKSk7CisgICAgICAgICAgICBzaXJEdW1wQnVmKHBNYWMsIFNJUl9MSU1fTU9EVUxFX0lELCBMT0cyLAorICAgICAgICAgICAgICAgICAgICAgICBwU3RhcnRCc3NSZXEtPm9wZXJhdGlvbmFsUmF0ZVNldC5yYXRlLAorICAgICAgICAgICAgICAgICAgICAgICBwU3RhcnRCc3NSZXEtPm9wZXJhdGlvbmFsUmF0ZVNldC5udW1SYXRlcyk7CisKKyAgICAgICAgICAgIHZhbGlkID0gZmFsc2U7CisgICAgICAgICAgICBnb3RvIGVuZDsKKyAgICAgICAgfQorICAgIH0KKyAgICAvLyBjaGVjayBpZiBhbGwgdGhlIHJhdGVzIGluIHRoZSBvcGVyYXRpb2FsIHJhdGUgc2V0IGFyZSBsZWdhbCAxMUcgcmF0ZXMKKyAgICBlbHNlIGlmIChwU3RhcnRCc3NSZXEtPm53VHlwZSA9PSBlU0lSXzExR19OV19UWVBFKQorICAgIHsKKyAgICAgICAgZm9yIChpID0gMDsgaSA8IHBTdGFydEJzc1JlcS0+b3BlcmF0aW9uYWxSYXRlU2V0Lm51bVJhdGVzOyBpKyspCisgICAgICAgICAgICBpZiAoIXNpcklzR3JhdGUocFN0YXJ0QnNzUmVxLT5vcGVyYXRpb25hbFJhdGVTZXQucmF0ZVtpXSAmIDB4N0YpKQorICAgICAgICB7CisgICAgICAgICAgICAvLyBJbnZhbGlkIE9wZXJhdGlvbmFsIHJhdGVzCisgICAgICAgICAgICAvLyBSZWplY3QgU1RBUlRfQlNTX1JFUQorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1csCisgICAgICAgICAgICAgICAgICAgRkwoIkludmFsaWQgb3BlcmF0aW9uYWwgcmF0ZXMgaW4gZVdOSV9TTUVfU1RBUlRfQlNTX1JFUSIpKTsKKyAgICAgICAgICAgIHNpckR1bXBCdWYocE1hYywgU0lSX0xJTV9NT0RVTEVfSUQsIExPRzIsCisgICAgICAgICAgICAgICAgICAgICAgIHBTdGFydEJzc1JlcS0+b3BlcmF0aW9uYWxSYXRlU2V0LnJhdGUsCisgICAgICAgICAgICAgICAgICAgICAgIHBTdGFydEJzc1JlcS0+b3BlcmF0aW9uYWxSYXRlU2V0Lm51bVJhdGVzKTsKKworICAgICAgICAgICAgdmFsaWQgPSBmYWxzZTsKKyAgICAgICAgICAgIGdvdG8gZW5kOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwU3RhcnRCc3NSZXEtPm9wZXJhdGlvbmFsUmF0ZVNldC5udW1SYXRlczsgaSsrKQorICAgICAgICAgICAgaWYgKCFzaXJJc0JyYXRlKHBTdGFydEJzc1JlcS0+b3BlcmF0aW9uYWxSYXRlU2V0LnJhdGVbaV0gJiAweDdGKSkKKyAgICAgICAgeworICAgICAgICAgICAgLy8gSW52YWxpZCBPcGVyYXRpb25hbCByYXRlcworICAgICAgICAgICAgLy8gUmVqZWN0IFNUQVJUX0JTU19SRVEKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICAgICAgICAgIEZMKCJJbnZhbGlkIG9wZXJhdGlvbmFsIHJhdGVzIGluIGVXTklfU01FX1NUQVJUX0JTU19SRVEiKSk7CisgICAgICAgICAgICBzaXJEdW1wQnVmKHBNYWMsIFNJUl9MSU1fTU9EVUxFX0lELCBMT0cyLAorICAgICAgICAgICAgICAgICAgICAgICBwU3RhcnRCc3NSZXEtPm9wZXJhdGlvbmFsUmF0ZVNldC5yYXRlLAorICAgICAgICAgICAgICAgICAgICAgICBwU3RhcnRCc3NSZXEtPm9wZXJhdGlvbmFsUmF0ZVNldC5udW1SYXRlcyk7CisKKyAgICAgICAgICAgIHZhbGlkID0gZmFsc2U7CisgICAgICAgICAgICBnb3RvIGVuZDsKKyAgICAgICAgfQorICAgIH0KKworZW5kOgorICAgIHJldHVybiB2YWxpZDsKK30gLyoqKiBlbmQgbGltSXNTbWVTdGFydEJzc1JlcVZhbGlkKCkgKioqLworCisKKworLyoqCisgKiBsaW1Jc1NtZUpvaW5SZXFWYWxpZCgpCisgKgorICpGVU5DVElPTjoKKyAqIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIGJ5IGxpbVByb2Nlc3NTbWVSZXFNZXNzYWdlcygpIHVwb24KKyAqIHJlY2VpdmluZyBTTUVfSk9JTl9SRVEgbWVzc2FnZSB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WxpZCBhZGRpdGlvbmFsIElFIGZvciBzY2FuIikpOworICAgICAgICB2YWxpZCA9IGZhbHNlOworICAgICAgICBnb3RvIGVuZDsKKyAgICB9CisKKyAgICBpZiAoIWxpbUlzQWRkaWVWYWxpZEluU21lUmVxTWVzc2FnZShwTWFjLCAmcEpvaW5SZXEtPmFkZElFQXNzb2MpKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICBGTCgicmVjZWl2ZWQgU01FX0pPSU5fUkVRIHdpdGggaW52YWxpZCBhZGRpdGlvbmFsIElFIGZvciBhc3NvYyIpKTsKKyAgICAgICAgdmFsaWQgPSBmYWxzZTsKKyAgICAgICAgZ290byBlbmQ7CisgICAgfQorCisKKyAgICBpZiAoIWxpbUlzQnNzRGVzY3JWYWxpZEluU21lUmVxTWVzc2FnZShwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwSm9pblJlcS0+YnNzRGVzY3JpcHRpb24pKQorICAgIHsKKyAgICAgICAgLy8vIFJlY2VpdmVkIGVXTklfU01FX0pPSU5fUkVRIHdpdGggaW52YWxpZCBCU1MgSW5mbworICAgICAgICAvLyBMb2cgdGhlIGV2ZW50CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgRkwoInJlY2VpdmVkIFNNRV9KT0lOX1JFUSB3aXRoIGludmFsaWQgYnNzSW5mbyIpKTsKKworICAgICAgICB2YWxpZCA9IGZhbHNlOworICAgICAgICBnb3RvIGVuZDsKKyAgICB9CisKKyAgICAvKgorICAgICAgIFJlamVjdCBKb2luIFJlcSBpZiB0aGUgU2VsZiBNYWMgQWRkcmVzcyBhbmQgCisgICAgICAgdGhlIEFwJ3MgTWFjIEFkZHJlc3MgaXMgc2FtZQorICAgICovCisgICAgaWYgKCB2b3NfbWVtX2NvbXBhcmUoICh0QU5JX1U4KiApIHBKb2luUmVxLT5zZWxmTWFjQWRkciwK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IGVTSVJfRURfV0VQNDApICYmCisgICAgICAgIChwU2V0Q29udGV4dFJlcS0+a2V5TWF0ZXJpYWwuZWRUeXBlICE9IGVTSVJfRURfV0VQMTA0KSAmJgorICAgICAgICAocFNldENvbnRleHRSZXEtPmtleU1hdGVyaWFsLmVkVHlwZSAhPSBlU0lSX0VEX05PTkUpICYmCisjaWZkZWYgRkVBVFVSRV9XTEFOX1dBUEkKKyAgICAgICAgKHBTZXRDb250ZXh0UmVxLT5rZXlNYXRlcmlhbC5lZFR5cGUgIT0gZVNJUl9FRF9XUEkpICYmIAorI2VuZGlmCisgICAgICAgICFwU2V0Q29udGV4dFJlcS0+a2V5TWF0ZXJpYWwubnVtS2V5cykKKyAgICB7CisgICAgICAgIC8qKgorICAgICAgICAgKiBObyBrZXlzIHByZXNlbnQgaW4gY2FzZSBvZiBUS0lQIG9yIENDTVAKKyAgICAgICAgICogTG9nIGVycm9yLgorICAgICAgICAgKi8KKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1csCisgICAgICAgICAgIEZMKCJObyBrZXlzIHByZXNlbnQgaW4gU01FX1NFVENPTlRFWFRfUkVRIGZvciBlZFR5cGU9JWQiKSwKKyAgICAgICAgICAgcFNldENvbnRleHRSZXEtPmtleU1hdGVyaWFsLmVkVHlwZSk7CisKKyAgICAgICAgdmFsaWQgPSBmYWxzZTsKKyAgICAgICAgZ290byBlbmQ7CisgICAgfQorCisgICAgaWYgKHBTZXRDb250ZXh0UmVxLT5rZXlNYXRlcmlhbC5udW1LZXlzICYmCisgICAgICAgIChwU2V0Q29udGV4dFJlcS0+a2V5TWF0ZXJpYWwuZWRUeXBlID09IGVTSVJfRURfTk9ORSkpCisgICAgeworICAgICAgICAvKioKKyAgICAgICAgICogS2V5cyBwcmVzZW50IGluIGNhc2Ugb2Ygbm8gRUQgcG9saWN5CisgICAgICAgICAqIExvZyBlcnJvci4KKyAgICAgICAgICovCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICBGTCgiS2V5cyBwcmVzZW50IGluIFNNRV9TRVRDT05URVhUX1JFUSBmb3IgZWRUeXBlPSVkIiksCisgICAgICAgICAgIHBTZXRDb250ZXh0UmVxLT5rZXlNYXRlcmlhbC5lZFR5cGUpOworCisgICAgICAgIHZhbGlkID0gZmFsc2U7CisgICAgICAgIGdvdG8gZW5kOworICAgIH0KKworICAgIGlmIChwU2V0Q29udGV4dFJlcS0+a2V5TWF0ZXJpYWwuZWRUeXBlID49IGVTSVJfRURfTk9UX0lNUExFTUVOVEVEKQorICAgIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIEludmFsaWQgZWRUeXBlIGluIHRoZSBtZXNzYWdlCisgICAgICAgICAqIExvZyBlcnJvci4KKyAgICAgICAgICovCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICAgICAgRkwoIkludmFsaWQgZWRUeXBlPSVkIGluIFNNRV9TRVRDT05URVhUX1JFUSIpLAorICAgICAgICAgICAgICAgcFNldENvbnRleHRSZXEtPmtleU1hdGVyaWFsLmVkVHlwZSk7CisKKyAgICAgICAgdmFsaWQgPSBmYWxzZTsKKyAgICAgICAgZ290byBlbmQ7CisgICAgfQorICAgIGVsc2UgaWYgKHBTZXRDb250ZXh0UmVxLT5rZXlNYXRlcmlhbC5lZFR5cGUgPiBlU0lSX0VEX05PTkUpCisgICAgeworICAgICAgICB0QU5JX1UzMiBwb2k7CisKKyAgICAgICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfUFJJVkFDWV9FTkFCTEVELAorICAgICAgICAgICAgICAgICAgICAgICZwb2kpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgRkwoIlVuYWJsZSB0byByZXRyaWV2ZSBQT0kgZnJvbSBDRkciKSk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIXBvaSkKKyAgICAgICAgeworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBQcml2YWN5IGlzIG5vdCBlbmFibGVkCisgICAgICAgICAgICAgKiBJbiBvcmRlciB0byBhbGxvdyBtaXhlZCBtb2RlIGZvciBHdWVzdCBhY2Nlc3MKKyAgICAgICAgICAgICAqIGFsbG93IEJTUyBjcmVhdGlvbi9qb2luIHdpdGggbm8gUHJpdmFjeSBjYXBhYmlsaXR5CisgICAgICAgICAgICAgKiB5ZXQgYWR2ZXJ0aXNpbmcgV1BBIElFCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIFBFTE9HMShsaW1Mb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgIEZMKCJQcml2YWN5IGlzIG5vdCBlbmFibGVkLCB5ZXQgbm9uLU5vbmUgRUR0eXBlPSVkIGluIFNNRV9TRVRDT05URVhUX1JFUSIpLAorICAgICAgICAgICAgICAgcFNldENvbnRleHRSZXEtPmtleU1hdGVyaWFsLmVkVHlwZSk7KQorICAgICAgICB9CisgICAgfQorCisgICAgZm9yIChpID0gMDsgaSA8IHBTZXRDb250ZXh0UmVxLT5rZXlNYXRlcmlhbC5udW1LZXlzOyBpKyspCisgICAgeworICAgICAgICBpZiAoKChwU2V0Q29udGV4dFJlcS0+a2V5TWF0ZXJpYWwuZWRUeXBlID09IGVTSVJfRURfV0VQNDApICYmCisgICAgICAgICAgICAgKHBLZXktPmtleUxlbmd0aCAhPSA1KSkgfHwKKyAgICAgICAgICAgICgocFNldENvbnRleHRSZXEtPmtleU1hdGVyaWFsLmVkVHlwZSA9PSBlU0lSX0VEX1dFUDEwNCkgJiYKKyAgICAgICAgICAgICAocEtleS0+a2V5TGVuZ3RoICE9IDEzKSkgfHwKKyAgICAgICAgICAgICgocFNldENvbnRleHRSZXEtPmtleU1hdGVyaWFsLmVkVHlwZSA9PSBlU0lSX0VEX1RLSVApICYmCisgICAgICAgICAgICAgKHBLZXktPmtleUxlbmd0aCAhPSAzMikpIHx8CisjaWZkZWYgRkVBVFVSRV9XTEFOX1dBUEkgCisgICAgICAgICAgICAoKHBTZXRDb250ZXh0UmVxLT5rZXlNYXRlcmlhbC5lZFR5cGUgPT0gZVNJUl9FRF9XUEkpICYmCisgICAgICAgICAgICAgKHBLZXktPmtleUxlbmd0aCAhPSAzMikpIHx8CisjZW5kaWYgCisgICAgICAgICAgICAoKHBTZXRDb250ZXh0UmVxLT5rZXlNYXRlcmlhbC5lZFR5cGUgPT0gZVNJUl9FRF9DQ01QKSAmJgorICAgICAgICAgICAgIChwS2V5LT5rZXlMZW5ndGggIT0gMTYpKSkKKyAgICAgICAgeworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBJbnZhbGlkIGtleSBsZW5ndGggZm9yIGEgZ2l2ZW4gRUQgdHlwZQorICAgICAgICAgICAgICogTG9nIGVycm9yLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgICAgIEZMKCJJbnZhbGlkIGtleUxlbmd0aCA9JWQgZm9yIGVkVHlwZT0lZCBpbiBTTUVfU0VUQ09OVEVYVF9SRVEiKSwKKyAgICAgICAgICAgICAgIHBLZXktPmtleUxlbmd0aCwgcFNldENvbnRleHRSZXEtPmtleU1hdGVyaWFsLmVkVHlwZSk7CisKKyAgICAgICAgICAgIHZhbGlkID0gZmFsc2U7CisgICAgICAgICAgICBnb3RvIGVuZDsKKyAgICAgICAgfQorICAgICAgICBwS2V5Kys7CisgICAgfQorCitlbmQ6CisgICAgcmV0dXJuIHZhbGlkOworfSAvKioqIGVuZCBsaW1Jc1NtZVNldENvbnRleHRSZXFWYWxpZCgpICoqKi8KKworCisKKy8qKgorICogbGltSXNTbWVTdG9wQnNzUmVxVmFsaWQoKQorICoKKyAqRlVOQ1RJT046CisgKiBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCBieSBsaW1Qcm9jZXNzU21lUmVxTWVzc2FnZXMoKSB1cG9uCisgKiByZWNlaXZpbmcg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hdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbVBlcmlvZGljUHJvYmVSZXFUaW1lciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJQZXJpb2RpYyBQcm9iZSBSZXF1ZXN0IFRpbWVyIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVRpbWVySGFuZGxlciwgU0lSX0xJTV9QRVJJT0RJQ19QUk9CRV9SRVFfVElNRU9VVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGNmZ1ZhbHVlMSwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIFRYX05PX0FDVElWQVRFKSAhPSBUWF9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgIC8vLyBDb3VsZCBub3Qgc3RhcnQgUGVyaW9kaWMgUHJvYmUgUmVxIHRpbWVyLgorICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJjb3VsZCBub3QgY3JlYXRlIHBlcmlvZGljIHByb2JlIHRpbWVyIikpOworICAgICAgICAgICBnb3RvIGVycl90aW1lcjsKKyAgICAgICAgfQorICAgICB9CisKKworICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0FDVElWRV9NQVhJTVVNX0NIQU5ORUxfVElNRSwKKyAgICAgICAgICAgICAgICAgICZjZmdWYWx1ZSkgIT0gZVNJUl9TVUNDRVNTKQorICAgIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIENvdWxkIG5vdCBnZXQgTUFYQ2hhbm5lbFRpbWVvdXQgdmFsdWUKKyAgICAgICAgICogZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgICovCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBNQVhDaGFubmVsVGltZW91dCB2YWx1ZSIpKTsKKyAgICB9CisgICAgY2ZnV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RjaFRpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJDSEFOTkVMIFNXSVRDSCBUSU1FUiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltQ2hhbm5lbFN3aXRjaFRpbWVySGFuZGxlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCAgICAgICAgICAgICAgICAgICAgICAgICAvLyBleHBpcmF0aW9uX2lucHV0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTElNX0NIQU5ORUxfU1dJVENIX1RJTUVSX1RJQ0tTLCAgLy8gaW5pdGlhbF90aWNrcworICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJlc2NoZWR1bGVfdGlja3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBUWF9OT19BQ1RJVkFURSkgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJmYWlsZWQgdG8gY3JlYXRlIENoYW5uZWwgU3dpdGNoIHRpbWVyIikpOworICAgICAgICAgICAgZ290byBlcnJfdGltZXI7CisgICAgICAgIH0KKworICAgICAgICAvLworICAgICAgICAvLyBDcmVhdGUgUXVpZXQgVGltZXIKKyAgICAgICAgLy8gVGhpcyBpcyB1c2VkIG9uIHRoZSBTVEEgdG8gZ28gYW5kIHNodXQtb2ZmCisgICAgICAgIC8vIFR4L1J4ICJhZnRlciIgdGhlIHNwZWNpZmllZCBxdWl0ZUludGVydmFsCisgICAgICAgIC8vCisgICAgICAgIGlmICh0eF90aW1lcl9jcmVhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbVF1aWV0VGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlFVSUVUIFRJTUVSIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1RdWlldFRpbWVySGFuZGxlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTElNX1FVSUVUX1RJTUVPVVQsICAgICAvLyBleHBpcmF0aW9uX2lucHV0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTElNX1FVSUVUX1RJTUVSX1RJQ0tTLCAgICAgLy8gaW5pdGlhbF90aWNrcworICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJlc2NoZWR1bGVfdGlja3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBUWF9OT19BQ1RJVkFURSkgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJmYWlsZWQgdG8gY3JlYXRlIFF1aWV0IEJlZ2luIFRpbWVyIikpOworICAgICAgICAgICAgZ290byBlcnJfdGltZXI7CisgICAgICAgIH0KKworICAgICAgICAvLworICAgICAgICAvLyBDcmVhdGUgUXVpZXQgQlNTIFRpbWVyCisgICAgICAgIC8vIEFmdGVyIHRoZSBzcGVjaWZpZWQgcXVpdGVJbnRlcnZhbCwgZGV0ZXJtaW5lZCBieQorICAgICAgICAvLyBnTGltUXVpZXRUaW1lciwgdGhpcyB0aW1lciwgZ0xpbVF1aWV0QnNzVGltZXIsCisgICAgICAgIC8vIHRyaWdnZXIgYW5kIHB1dCB0aGUgU1RBIHRvIHNsZWVwIGZvciB0aGUgc3BlY2lmaWVkCisgICAgICAgIC8vIGdMaW1RdWlldER1cmF0aW9uCisgICAgICAgIC8vCisgICAgICAgIGlmICh0eF90aW1lcl9jcmVhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbVF1aWV0QnNzVGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlFVSUVUIEJTUyBUSU1FUiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltUXVpZXRCc3NUaW1lckhhbmRsZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX0xJTV9RVUlFVF9CU1NfVElNRU9VVCwgLy8gZXhwaXJhdGlvbl9pbnB1dAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIExJTV9RVUlFVF9CU1NfVElNRVJfVElDSywgIC8vIGluaXRpYWxfdGlja3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCAgICAgICAgICAgICAgICAgICAgICAgICAvLyByZXNjaGVkdWxlX3RpY2tzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVFhfTk9fQUNUSVZBVEUpICE9IFRYX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiZmFpbGVkIHRvIGNyZWF0ZSBRdWlldCBCZWdpbiBUaW1lciIpKTsKKyAgICAgICAgICAgIGdvdG8gZXJyX3RpbWVyOworICAgICAgICB9CisKKyAgICAgICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfSk9JTl9GQUlMVVJFX1RJTUVPVVQsCisgICAgICAgICAgICAgICAgICAgICAgJmNmZ1ZhbHVlKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogQ291bGQgbm90IGdldCBKb2luRmFpbHVyZVRpbWVvdXQgdmFsdWUKKyAgICAgICAgICAgICAqIGZyb20gQ0ZHLiBMb2cgZXJyb3IuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBKb2luRmFpbHVyZVRpbWVvdXQgdmFsdWUiKSk7CisgICAgICAgIH0KKyAgICAgICAgY2ZnVmFsdWUgPSBTWVNfTVNfVE9fVElDS1MoY2ZnVmFsdWUpOworCisgICAgICAgIC8vIENyZWF0ZSBKb2luIGZhaWx1cmUgdGltZXIgYW5kIGFjdGl2YXRlIGl0IGxhdGVyCisgICAgICAgIGlmICh0eF90aW1lcl9jcmVhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbUpvaW5GYWlsdXJlVGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAiSk9JTiBGQUlMVVJFIFRJTUVPVVQiLAorICAgICAgICAgICAgICAgICAgICAgICAgbGltVGltZXJIYW5kbGVyLCBTSVJfTElNX0pPSU5fRkFJTF9USU1FT1VULAorICAgICAgICAgICAgICAgICAgICAgICAgY2ZnVmFsdWUsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICBUWF9OT19BQ1RJVkFURSkgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgLy8vIENvdWxkIG5vdCBjcmVhdGUgSm9pbiBmYWlsdXJlIHRpbWVyLgorICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoImNvdWxkIG5vdCBjcmVhdGUgSm9pbiBmYWlsdXJlIHRpbWVyIikpOworCisgICAgICAgICAgICBnb3RvIGVycl90aW1lcjsKKyAgICAgICAgfQorCisgICAgICAgIC8vU2VuZCB1bmljYXN0IHByb2JlIHJlcSBmcmFtZSBldmVyeSAyMDAgbXMKKyAgICAgICAgaWYgKCh0eF90aW1lcl9jcmVhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbVBlcmlvZGljSm9pblByb2JlUmVxVGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAiUGVyaW9kaWMgSm9pbiBQcm9iZSBSZXF1ZXN0IFRpbWVyIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbVRpbWVySGFuZGxlciwgU0lSX0xJTV9QRVJJT0RJQ19KT0lOX1BST0JFX1JFUV9USU1FT1VULAorICAgICAgICAgICAgICAgICAgICAgICAgU1lTX01TX1RPX1RJQ0tTKExJTV9KT0lOX1BST0JFX1JFUV9USU1FUl9NUyksIDAsCisgICAgICAgICAgICAgICAgICAgICAgICBUWF9OT19BQ1RJVkFURSkpICE9IFRYX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vLyBDb3VsZCBub3QgY3JlYXRlIFBlcmlvZGljIEpvaW4gUHJvYmUgUmVxdWVzdCB0aW1lci4KKyAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJjb3VsZCBub3QgY3JlYXRlIFBlcmlvZGljIEpvaW4gUHJvYmUgUmVxdWVzdCB0aW1lciIpKTsKKyAgICAgICAgICAgIGdvdG8gZXJyX3RpbWVyOworICAgICAgICB9CisgICAgICAgIC8vU2VuZCBBdXRoIGZyYW1lIGV2ZXJ5IDYwIG1zCisgICAgICAgIGlmICgodHhfdGltZXJfY3JlYXRlKCZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1QZXJpb2RpY0F1dGhSZXRyeVRpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgIlBlcmlvZGljIEFVVEggVGltZXIiLAorICAgICAgICAgICAgICAgICAgICAgICAgbGltVGltZXJIYW5kbGVyLCBTSVJfTElNX0FVVEhfUkVUUllfVElNRU9VVCwKKyAgICAgICAgICAgICAgICAgICAgICAgIFNZU19NU19UT19USUNLUyhMSU1fQVVUSF9SRVRSWV9USU1FUl9NUyksIDAsCisgICAgICAgICAgICAgICAgICAgICAgICBUWF9OT19BQ1RJVkFURSkpICE9IFRYX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vLyBDb3VsZCBub3QgY3JlYXRlIFBlcmlvZGljIEpvaW4gUHJvYmUgUmVxdWVzdCB0aW1lci4KKyAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJjb3VsZCBub3QgY3JlYXRlIFBlcmlvZGljIEFVVEggVGltZXIgdGltZXIiKSk7CisgICAgICAgICAgICBnb3RvIGVycl90aW1lcjsKKyAgICAgICAgfQorICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19BU1NPQ0lBVElPTl9GQUlMVVJFX1RJTUVPVVQsCisgICAgICAgICAgICAgICAgICAgICAgJmNmZ1ZhbHVlKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogQ291bGQgbm90IGdldCBBc3NvY0ZhaWx1cmVUaW1lb3V0IHZhbHVlCisgICAgICAgICAgICAgKiBmcm9tIENGRy4gTG9nIGVycm9yLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgQXNzb2NGYWlsdXJlVGltZW91dCB2YWx1ZSIpKTsKKyAgICAgICAgfQorICAgICAgICBjZmdWYWx1ZSA9IFNZU19NU19UT19USUNLUyhjZmdWYWx1ZSk7CisKKyAgICAgICAgLy8gQ3JlYXRlIEFzc29jaWF0aW9uIGZhaWx1cmUgdGltZXIgYW5kIGFjdGl2YXRlIGl0IGxhdGVyCisgICAgICAgIGlmICh0eF90aW1lcl9jcmVhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbUFzc29jRmFpbHVyZVRpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgIkFTU09DIEZBSUxVUkUgVElNRU9VVCIsCisgICAgICAgICAgICAgICAgICAgICAgICBsaW1Bc3NvY0ZhaWx1cmVUaW1lckhhbmRsZXIsIExJTV9BU1NPQywKKyAgICAgICAgICAgICAgICAgICAgICAgIGNmZ1ZhbHVlLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgVFhfTk9fQUNUSVZBVEUpICE9IFRYX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vLyBDb3VsZCBub3QgY3JlYXRlIEFzc29jIGZhaWx1cmUgdGltZXIuCisgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCBjcmVhdGUgQXNzb2NpYXRpb24gZmFpbHVyZSB0aW1lciIpKTsKKworICAgICAgICAgICAgZ290byBlcnJfdGltZXI7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfUkVBU1NPQ0lBVElPTl9GQUlMVVJFX1RJTUVPVVQsCisgICAgICAgICAgICAgICAgICAgICAgJmNmZ1ZhbHVlKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogQ291bGQgbm90IGdldCBSZWFzc29jRmFpbHVyZVRpbWVvdXQgdmFsdWUKKyAgICAgICAgICAgICAqIGZyb20gQ0ZHLiBMb2cgZXJyb3IuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBSZWFzc29jRmFpbHVyZVRpbWVvdXQgdmFsdWUiKSk7CisgICAgICAgIH0KKyAgICAgICAgY2ZnVmFsdWUgPSBTWVNfTVNfVE9fVElDS1MoY2ZnVmFsdWUpOworCisgICAgICAgIC8vIENyZWF0ZSBBc3NvY2lhdGlvbiBmYWlsdXJlIHRpbWVyIGFuZCBhY3RpdmF0ZSBpdCBsYXRlcgorICAgICAgICBpZiAodHhfdGltZXJfY3JlYXRlKCZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1SZWFzc29jRmFpbHVyZVRpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJSRUFTU09DIEZBSUxVUkUgVElNRU9VVCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltQXNzb2NGYWlsdXJlVGltZXJIYW5kbGVyLCBMSU1fUkVBU1NPQywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZmdWYWx1ZSwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBUWF9OT19BQ1RJVkFURSkgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgLy8vIENvdWxkIG5vdCBjcmVhdGUgUmVhc3NvYyBmYWlsdXJlIHRpbWVyLgorICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgIEZMKCJjb3VsZCBub3QgY3JlYXRlIFJlYXNzb2NpYXRpb24gZmFpbHVyZSB0aW1lciIpKTsKKworICAgICAgICAgICAgZ290byBlcnJfdGltZXI7CisgICAgICAgIH0KKworICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19BRERUU19SU1BfVElNRU9VVCwgJmNmZ1ZhbHVlKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoIkZhaWwgdG8gZ2V0IFdOSV9DRkdfQUREVFNfUlNQX1RJTUVPVVQgIikpOworCisgICAgICAgIGNmZ1ZhbHVlID0gU1lTX01TX1RPX1RJQ0tTKGNmZ1ZhbHVlKTsKKworICAgICAgICAvLyBDcmVhdGUgQWRkdHMgcmVzcG9uc2UgdGltZXIgYW5kIGFjdGl2YXRlIGl0IGxhdGVyCisgICAgICAgIGlmICh0eF90aW1lcl9jcmVhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbUFkZHRzUnNwVGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkFERFRTIFJTUCBUSU1FT1VUIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1BZGR0c1Jlc3BvbnNlVGltZXJIYW5kbGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9MSU1fQUREVFNfUlNQX1RJTUVPVVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2ZnVmFsdWUsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVFhfTk9fQUNUSVZBVEUpICE9IFRYX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vLyBDb3VsZCBub3QgY3JlYXRlIEF1dGggZmFpbHVyZSB0aW1lci4KKyAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJjb3VsZCBub3QgY3JlYXRlIEFkZHRzIHJlc3BvbnNlIHRpbWVyIikpOworCisgICAgICAgICAgICBnb3RvIGVycl90aW1lcjsKKyAgICAgICAgfQorCisgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0FVVEhFTlRJQ0FURV9GQUlMVVJFX1RJTUVPVVQsCisgICAgICAgICAgICAgICAgICAgICAgJmNmZ1ZhbHVlKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogQ291bGQgbm90IGdldCBBdXRoRmFpbHVyZVRpbWVvdXQgdmFsdWUKKyAgICAgICAgICAgICAqIGZyb20gQ0ZHLiBMb2cgZXJyb3IuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBBdXRoRmFpbHVyZVRpbWVvdXQgdmFsdWUiKSk7CisgICAgICAgIH0KKyAgICAgICAgY2ZnVmFsdWUgPSBTWVNfTVNfVE9fVElDS1MoY2ZnVmFsdWUpOworCisgICAgICAgIC8vIENyZWF0ZSBBdXRoIGZhaWx1cmUgdGltZXIgYW5kIGFjdGl2YXRlIGl0IGxhdGVyCisgICAgICAgIGlmICh0eF90aW1lcl9jcmVhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbUF1dGhGYWlsdXJlVGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkFVVEggRkFJTFVSRSBUSU1FT1VUIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1UaW1lckhhbmRsZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX0xJTV9BVVRIX0ZBSUxfVElNRU9VVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZmdWYWx1ZSwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBUWF9OT19BQ1RJVkFURSkgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgLy8vIENvdWxkIG5vdCBjcmVhdGUgQXV0aCBmYWlsdXJlIHRpbWVyLgorICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoImNvdWxkIG5vdCBjcmVhdGUgQXV0aCBmYWlsdXJlIHRpbWVyIikpOworCisgICAgICAgICAgICBnb3RvIGVycl90aW1lcjsKKyAgICAgICAgfQorCisgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0JFQUNPTl9JTlRFUlZBTCwKKyAgICAgICAgICAgICAgICAgICAgICAmY2ZnVmFsdWUpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBDb3VsZCBub3QgZ2V0IEJFQUNPTl9JTlRFUlZBTCB2YWx1ZQorICAgICAgICAgICAgICogZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICBGTCgiY291bGQgbm90IHJldHJpZXZlIEJFQUNPTl9JTlRFUlZBTCB2YWx1ZSIpKTsKKyAgICAgICAgfQorICAgICAgICBjZmdWYWx1ZSA9IFNZU19NU19UT19USUNLUyhjZmdWYWx1ZSk7CisKKyAgICAgICAgaWYgKHR4X3RpbWVyX2NyZWF0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltSGVhcnRCZWF0VGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkhlYXJ0YmVhdCBUSU1FT1VUIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1UaW1lckhhbmRsZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX0xJTV9IRUFSVF9CRUFUX1RJTUVPVVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2ZnVmFsdWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBUWF9OT19BQ1RJVkFURSkgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgLy8vIENvdWxkIG5vdCBzdGFydCBIZWFydGJlYXQgdGltZXIuCisgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgRkwoImNhbGwgdG8gY3JlYXRlIGhlYXJ0YmVhdCB0aW1lciBmYWlsZWQiKSk7CisgICAgICAgICAgICBnb3RvIGVycl90aW1lcjsKKyAgICAgICAgfQorCisgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX1BST0JFX0FGVEVSX0hCX0ZBSUxfVElNRU9VVCwKKyAgICAgICAgICAgICAgICAgICAgICAmY2ZnVmFsdWUpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBDb3VsZCBub3QgZ2V0IFBST0JFX0FGVEVSX0hCX0ZBSUxVUkUKKyAgICAgICAgICAgICAqIHZhbHVlIGZyb20gQ0ZHLiBMb2cgZXJyb3IuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBQUk9CRV9BRlRFUl9IQl9GQUlMX1RJTUVPVVQgdmFsdWUiKSk7CisgICAgICAgIH0KKworICAgICAgICAvLyBDaGFuZ2UgdGltZXIgdG8gcmVhY3RpdmF0ZSBpdCBpbiBmdXR1cmUKKyAgICAgICAgY2ZnVmFsdWUgPSBTWVNfTVNfVE9fVElDS1MoY2ZnVmFsdWUpOworCisgICAgICAgIGlmICh0eF90aW1lcl9jcmVhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbVByb2JlQWZ0ZXJIQlRpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJQcm9iZSBhZnRlciBIZWFydGJlYXQgVElNRU9VVCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltVGltZXJIYW5kbGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9MSU1fUFJPQkVfSEJfRkFJTFVSRV9USU1FT1VULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNmZ1ZhbHVlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVFhfTk9fQUNUSVZBVEUpICE9IFRYX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIENvdWxkIG5vdCBjcmVhdCB3dC1wcm9iZS1hZnRlci1IZWFydEJlYXQtZmFpbHVyZSB0aW1lci4KKyAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgRkwoInVuYWJsZSB0byBjcmVhdGUgUHJvYmVBZnRlckhCVGltZXIiKSk7CisgICAgICAgICAgICBnb3RvIGVycl90aW1lcjsKKyAgICAgICAgfQorCisgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0JBQ0tHUk9VTkRfU0NBTl9QRVJJT0QsCisgICAgICAgICAgICAgICAgICAgICAgJmNmZ1ZhbHVlKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogQ291bGQgbm90IGdldCBCYWNrZ3JvdW5kIHNjYW4gcGVyaW9kIHZhbHVlCisgICAgICAgICAgICAgKiBmcm9tIENGRy4gTG9nIGVycm9yLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgQmFja2dyb3VuZCBzY2FuIHBlcmlvZCB2YWx1ZSIpKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qCisgICAgICAgICAqIHNldHRpbmcgcGVyaW9kIHRvIHplcm8gbWVhbnMgZGlzYWJsaW5nIGJhY2tncm91bmQgc2NhbnMgd2hlbiBhc3NvY2lhdGVkCisgICAgICAgICAqIHRoZSB3YXkgd2UgZG8gdGhpcyBpcyB0byBzZXQgYSBmbGFnIGluZGljYXRpbmcgdGhpcyBhbmQga2VlcGluZworICAgICAgICAgKiB0aGUgdGltZXIgcnVubmluZywgc2luY2UgaXQgd2lsbCBiZSB1c2VkIGZvciBQRFUgbGVhayB3b3JrYXJvdW5kcworICAgICAgICAgKiBhcyB3ZWxsIGFzIGJhY2tncm91bmQgc2Nhbm5pbmcgZHVyaW5nIFNNRSBpZGxlIHN0YXRlcworICAgICAgICAgKi8KKyAgICAgICAgaWYgKGNmZ1ZhbHVlID09IDApCisgICAgICAgIHsKKyAgICAgICAgICAgIGNmZ1ZhbHVlID0gTElNX0JBQ0tHUk9VTkRfU0NBTl9QRVJJT0RfREVGQVVMVF9NUzsKKyAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltQmFja2dyb3VuZFNjYW5EaXNhYmxlID0gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbUJhY2tncm91bmRTY2FuRGlzYWJsZSA9IGZhbHNlOworCisgICAgICAgIGNmZ1ZhbHVlID0gU1lTX01TX1RPX1RJQ0tTKGNmZ1ZhbHVlKTsKKworICAgICAgICBpZiAodHhfdGltZXJfY3JlYXRlKCZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1CYWNrZ3JvdW5kU2NhblRpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJCYWNrZ3JvdW5kIHNjYW4gVElNRU9VVCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltVGltZXJIYW5kbGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9MSU1fQ0hBTk5FTF9TQ0FOX1RJTUVPVVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2ZnVmFsdWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2ZnVmFsdWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVFhfTk9fQUNUSVZBVEUpICE9IFRYX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vLyBDb3VsZCBub3Qgc3RhcnQgYmFja2dyb3VuZCBzY2FuIHRpbWVyLgorICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgIEZMKCJjYWxsIHRvIGNyZWF0ZSBiYWNrZ3JvdW5kIHNjYW4gdGltZXIgZmFpbGVkIikpOworICAgICAgICAgICAgZ290byBlcnJfdGltZXI7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDcmVhdGUga2VlcGFsaXZlIHRpbWVyIGFuZCAgYWN0aXZhdGUgaXQgcmlnaHQgYXdheSBmb3IgQVAgcm9sZQorICAgICAqLworCisgICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfS0VFUEFMSVZFX1RJTUVPVVQsCisgICAgICAgICAgICAgICAgICAmY2ZnVmFsdWUpICE9IGVTSVJfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIC8qKgorICAgICAgICAgKiBDb3VsZCBub3QgZ2V0IGtlZXBhbGl2ZSB0aW1lb3V0IHZhbHVlCisgICAgICAgICAqIGZyb20gQ0ZHLiBMb2cgZXJyb3IuCisgICAgICAgICAqLworICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgIEZMKCJjb3VsZCBub3QgcmV0cmlldmUga2VlcGFsaXZlIHRpbWVvdXQgdmFsdWUiKSk7CisgICAgfQorCisgICAgLy8gQSB2YWx1ZSBvZiB6ZXJvIGltcGxpZXMga2VlcCBhbGl2ZSBzaG91bGQgYmUgZGlzYWJsZWQKKyAgICBpZiAoY2ZnVmFsdWUgPT0gMCkKKyAgICB7CisgICAgICAgIGNmZ1ZhbHVlID0gTElNX0tFRVBBTElWRV9USU1FUl9NUzsKKyAgICAgICAgcE1hYy0+c2NoLmtlZXBBbGl2ZSA9IDA7CisgICAgfSBlbHNlCisgICAgICAgIHBNYWMtPnNjaC5rZWVwQWxpdmUgPSAxOworCisKKyAgICBjZmdWYWx1ZSA9IFNZU19NU19UT19USUNLUyhjZmdWYWx1ZSArIFNZU19USUNLX0RVUl9NUyAtIDEpOworCisgICAgaWYgKHR4X3RpbWVyX2NyZWF0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltS2VlcGFsaXZlVGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAiS0VFUEFMSVZFX1RJTUVPVVQiLAorICAgICAgICAgICAgICAgICAgICAgICAgbGltS2VlcGFsaXZlVG1lckhhbmRsZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAwLAorICAgICAgICAgICAgICAgICAgICAgICAgY2ZnVmFsdWUsCisgICAgICAgICAgICAgICAgICAgICAgICBjZmdWYWx1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIChwTWFjLT5saW0uZ0xpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFKSA/CisgICAgICAgICAgICAgICAgICAgICAgICAgVFhfQVVUT19BQ1RJVkFURSA6IFRYX05PX0FDVElWQVRFKQorICAgICAgICAgICAgICAgICAgIT0gVFhfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIC8vIENhbm5vdCBjcmVhdGUga2VlcGFsaXZlIHRpbWVyLiAgTG9nIGVycm9yLgorICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoIkNhbm5vdCBjcmVhdGUga2VlcGFsaXZlIHRpbWVyLiIpKTsKKyAgICAgICAgZ290byBlcnJfdGltZXI7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ3JlYXRlIGFsbCBDTkZfV0FJVCBUaW1lcnMgdXBmcm9udAorICAgICAqLworCisgICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfV1RfQ05GX1RJTUVPVVQsCisgICAgICAgICAgICAgICAgICAmY2ZnVmFsdWUpICE9IGVTSVJfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIC8qKgorICAgICAgICAgKiBDb3VsZCBub3QgZ2V0IENORl9XQUlUIHRpbWVvdXQgdmFsdWUKKyAgICAgICAgICogZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgICovCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBDTkYgdGltZW91dCB2YWx1ZSIpKTsKKyAgICB9CisgICAgY2ZnVmFsdWUgPSBTWVNfTVNfVE9fVElDS1MoY2ZnVmFsdWUpOworCisgICAgZm9yIChpPTA7IGk8cE1hYy0+bGltLm1heFN0YXRpb247IGkrKykKKyAgICB7CisgICAgICAgIGlmICh0eF90aW1lcl9jcmVhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ3BMaW1DbmZXYWl0VGltZXJbaV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkNORl9NSVNTX1RJTUVPVVQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbUNuZldhaXRUbWVySGFuZGxlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VMzIpaSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZmdWYWx1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRYX05PX0FDVElWQVRFKSAhPSBUWF9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICAvLyBDYW5ub3QgY3JlYXRlIHRpbWVyLiAgTG9nIGVycm9yLgorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJDYW5ub3QgY3JlYXRlIENORiB3YWl0IHRpbWVyLiIpKTsKKyAgICAgICAgICAgIGdvdG8gZXJyX3RpbWVyOworICAgICAgICB9CisgICAgfQorCisgICAgLyoKKyAgICAqKiBBbGxvYyBhbmQgaW5pdCB0YWJsZSBmb3IgdGhlIHByZUF1dGggdGltZXIgbGlzdAorICAgICoqCisgICAgKiovCisKKyAgICAvLyBnZXQgbWF4IG51bWJlciBvZiBQcmVhdXRoZW50aWNhdGlvbgorICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX01BWF9OVU1fUFJFX0FVVEgsCisgICAgICAgICAgICAgJmNmZ1ZhbHVlKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgeworICAgICAgICAvKgorICAgICAgICAqKiBDb3VsZCBub3QgZ2V0IG1heCBwcmVhdXRoIHZhbHVlCisgICAgICAgICoqIGZyb20gQ0ZHLiBMb2cgZXJyb3IuCisgICAgICAgICoqLworICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgbWFjIHByZWF1dGggdmFsdWUiKSk7CisgICAgfQorICAgIHBNYWMtPmxpbS5nTGltUHJlQXV0aFRpbWVyVGFibGUubnVtRW50cnkgPSBjZmdWYWx1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FjayB0byBob21lIGNoYW5uZWwKKyAgICBjZmdWYWx1ZSA9IDEwMDA7CisgICAgY2ZnVmFsdWUgPSBTWVNfTVNfVE9fVElDS1MoY2ZnVmFsdWUpOworCisgICAgaWYgKHR4X3RpbWVyX2NyZWF0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltRlRQcmVBdXRoUnNwVGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRlQgUFJFQVVUSCBSU1AgVElNRU9VVCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1UaW1lckhhbmRsZXIsIFNJUl9MSU1fRlRfUFJFQVVUSF9SU1BfVElNRU9VVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNmZ1ZhbHVlLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVFhfTk9fQUNUSVZBVEUpICE9IFRYX1NVQ0NFU1MpCisgICAgeworICAgICAgICAvLyBDb3VsZCBub3QgY3JlYXRlIEpvaW4gZmFpbHVyZSB0aW1lci4KKyAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiY291bGQgbm90IGNyZWF0ZSBKb2luIGZhaWx1cmUgdGltZXIiKSk7CisgICAgICAgIGdvdG8gZXJyX3RpbWVyOworICAgIH0KKyNlbmRpZgorCisjaWYgZGVmaW5lZChGRUFUVVJFX1dMQU5fRVNFKSAmJiAhZGVmaW5lZChGRUFUVVJFX1dMQU5fRVNFX1VQTE9BRCkKKyAgICBjZmdWYWx1ZSA9IDUwMDA7CisgICAgY2ZnVmFsdWUgPSBTWVNfTVNfVE9fVElDS1MoY2ZnVmFsdWUpOworCisgICAgaWYgKHR4X3RpbWVyX2NyZWF0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltRXNlVHNtVGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRVNFIFRTTSBTdGF0cyBUSU1FT1VUIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVRpbWVySGFuZGxlciwgU0lSX0xJTV9FU0VfVFNNX1RJTUVPVVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZmdWYWx1ZSwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRYX05PX0FDVElWQVRFKSAhPSBUWF9TVUNDRVNTKQorICAgIHsKKyAgICAgICAgLy8gQ291bGQgbm90IGNyZWF0ZSBKb2luIGZhaWx1cmUgdGltZXIuCisgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoImNvdWxkIG5vdCBjcmVhdGUgSm9pbiBmYWlsdXJlIHRpbWVyIikpOworICAgICAgICBnb3RvIGVycl90aW1lcjsKKyAgICB9CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0VTRSAmJiAhRkVBVFVSRV9XTEFOX0VTRV9VUExPQUQgKi8KKworICAgIGNmZ1ZhbHVlID0gMTAwMDsKKyAgICBjZmdWYWx1ZSA9IFNZU19NU19UT19USUNLUyhjZmdWYWx1ZSk7CisgICAgaWYgKHR4X3RpbWVyX2NyZWF0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltRGlzYXNzb2NBY2tUaW1lciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJESVNBU1NPQyBBQ0sgVElNRU9VVCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1UaW1lckhhbmRsZXIsIFNJUl9MSU1fRElTQVNTT0NfQUNLX1RJTUVPVVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZmdWYWx1ZSwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRYX05PX0FDVElWQVRFKSAhPSBUWF9TVUNDRVNTKQorICAgIHsKKyA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Sk7CisgICAgaWYgKHR4X3RpbWVyX2NyZWF0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltUDJwU2luZ2xlU2hvdE5vYUluc2VydFRpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlNpbmdsZSBTaG90IE5PQSBJbnNlcnQgdGltZW91dCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1UaW1lckhhbmRsZXIsIFNJUl9MSU1fSU5TRVJUX1NJTkdMRVNIT1RfTk9BX1RJTUVPVVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZmdWYWx1ZSwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRYX05PX0FDVElWQVRFKSAhPSBUWF9TVUNDRVNTKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJjb3VsZCBub3QgY3JlYXRlIFNpbmdsZSBTaG90IE5PQSBJbnNlcnQgVGltZW91dCB0aW1lciIpKTsKKyAgICAgICAgZ290byBlcnJfdGltZXI7CisgICAgfQorCisgICAgY2ZnVmFsdWUgPSBBQ1RJVkVfVE9fUEFTU0lWRV9DT05WRVJJU09OX1RJTUVPVVQ7CisgICAgY2ZnVmFsdWUgPSBTWVNfTVNfVE9fVElDS1MoY2ZnVmFsdWUpOworICAgIGlmICh0eF90aW1lcl9jcmVhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbUFjdGl2ZVRvUGFzc2l2ZUNoYW5uZWxUaW1lciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQUNUSVZFIFRPIFBBU1NJVkUgQ0hBTk5FTCIsIGxpbVRpbWVySGFuZGxlciwKKyAgICAgICAgICAgICAgICAgU0lSX0xJTV9DT05WRVJUX0FDVElWRV9DSEFOTkVMX1RPX1BBU1NJVkUsIGNmZ1ZhbHVlLCAwLAorICAgICAgICAgICAgICAgICBUWF9OT19B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gZnVuY3Rpb24gaXMgY2FsbGVkIHRvIGRlYWN0aXZhdGUgYW5kIGNoYW5nZSBhIHRpbWVyCisgKiBmb3IgZnV0dXJlIHJlLWFjdGl2YXRpb24KKyAqCisgKkxPR0lDOgorICoKKyAqQVNTVU1QVElPTlM6CisgKiBOQQorICoKKyAqTk9URToKKyAqIE5BCisgKgorICogQHBhcmFtICBwTWFjICAgIC0gUG9pbnRlciB0byBHbG9iYWwgTUFDIHN0cnVjdHVyZQorICogQHBhcmFtICB0aW1lcklkIC0gZW51bSBvZiB0aW1lciB0byBiZSBkZWFjdGl2YXRlZCBhbmQgY2hhbmdlZAorICogICAgICAgICAgICAgICAgICAgVGhpcyBlbnVtIGlzIGRlZmluZWQgaW4gbGltVXRpbHMuaCBmaWxlCisgKgorICogQHJldHVybiBOb25lCisgKi8KKwordm9pZAorbGltRGVhY3RpdmF0ZUFuZENoYW5nZVRpbWVyKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTMyIHRpbWVySWQpCit7CisgICAgdEFOSV9VMzIgICAgdmFsPTAsIHZhbDE9MDsKKyAgICB0cFBFU2Vzc2lvbiAgcHNlc3Npb25FbnRyeTsKKworICAgIHN3aXRjaCAodGltZXJJZCkKKyAgICB7CisgICAgICAgIGNhc2UgZUxJTV9BRERUU19SU1BfVElNRVI6CisgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbUFkZHRzUnNwVGltZXJDb3VudCsrOworICAgICAgICAgICAgaWYgKHR4X3RpbWVyX2RlYWN0aXZhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbUFkZHRzUnNwVGltZXIpICE9IFRYX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gQ291bGQgbm90IGRlYWN0aXZhdGUgQWRkdHNSc3AgVGltZXIKKyAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIlVuYWJsZSB0byBkZWFjdGl2YXRlIEFkZHRzUnNwIHRpbWVyIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlTElNX01JTl9DSEFOTkVMX1RJTUVSOgorICAgICAgICAgICAgaWYgKHR4X3RpbWVyX2RlYWN0aXZhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbU1pbkNoYW5uZWxUaW1lcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBDb3VsZCBub3QgZGVhY3RpdmF0ZSBtaW4gY2hhbm5lbCB0aW1lci4KKyAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIlVuYWJsZSB0byBkZWFjdGl2YXRlIG1pbiBjaGFubmVsIHRpbWVyIikpOworICAgICAgICAgICAgfQorCisjaWYgMAorICAgICAgICAgICAgLy8gSWYgYSBiYWNrZ3JvdW5kIHdhcyB0cmlnZ2VyZWQgdmlhIFF1aWV0IEJTUywKKyAgICAgICAgICAgIC8vIHRoZW4gd2UgbmVlZCB0byBhZGp1c3QgdGhlIE1JTiBhbmQgTUFYIGNoYW5uZWwKKyAgICAgICAgICAgIC8vIHRpbWVyJ3MgYWNjb3JkaW5nbHkgdG8gdGhlIFF1aWV0IGR1cmF0aW9uIHRoYXQKKyAgICAgICAgICAgIC8vIHdhcyBzcGVjaWZpZWQKKyAgICAgICAgICAgIGlmKCBlTElNX1FVSUVUX1JVTk5JTkcgPT0gcE1hYy0+bGltLmdMaW1TcGVjTWdtdC5xdWlldFN0YXRlICYmCisgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1UcmlnZ2VyQmFja2dyb3VuZFNjYW5EdXJpbmdRdWlldEJzcyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gZ0xpbVF1aWV0RHVyYXRpb24gaXMgYWxyZWFkeSBjYWNoZWQgaW4gdW5pdHMgb2YKKyAgICAgICAgICAgICAgICAvLyBzeXN0ZW0gdGlja3MuIE5vIGNvbnZlcnNpb24gaXMgcmVxZC4uLgorICAgICAgICAgICAgICAgIHZhbCA9IHBNYWMtPmxpbS5nTGltU3BlY01nbXQucXVpZXREdXJhdGlvbjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyNlbmRpZgorICAgICAgICAgICAgICAgIGlmKHBNYWMtPmxpbS5ncExpbU1sbVNjYW5SZXEpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB2YWwgPSBTWVNfTVNfVE9fVElDS1MocE1hYy0+bGltLmdwTGltTWxtU2NhblJlcS0+bWluQ2hhbm5lbFRpbWUpOworICAgICAgICAgICAgICAgICAgICBpZiAocE1hYy0+YnRjLmJ0Y1NjYW5Db21wcm9taXNlKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAocE1hYy0+bGltLmdwTGltTWxtU2NhblJlcS0+bWluQ2hhbm5lbFRpbWVCdGMpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsID0gU1lTX01TX1RPX1RJQ0tTKHBNYWMtPmxpbS5ncExpbU1sbVNjYW5SZXEtPm1pbkNoYW5uZWxUaW1lQnRjKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlVzaW5nIEJUQyBNaW4gQWN0aXZlIFNjYW4gdGltZSIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkJUQyBBY3RpdmUgU2NhbiBNaW4gVGltZSBpcyBOb3QgU2V0IikpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiIGdwTGltTWxtU2NhblJlcSBpcyBOVUxMICIpKTsKKyAgICAgICAgICAgICAgICAgICAgLy9ObyBuZWVkIHRvIGNoYW5nZSBtaW4gdGltZXIuIFRoaXMgaXMgbm90IGEgc2NhbgorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisjaWYgMAorICAgICAgICAgICAgfQorI2VuZGlmCisKKyAgICAgICAgICAgIGlmICh0eF90aW1lcl9jaGFuZ2UoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbU1pbkNoYW5uZWxUaW1lciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsLCAwKSAhPSBUWF9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIENvdWxkIG5vdCBjaGFuZ2UgbWluIGNoYW5uZWwgdGltZXIuCisgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJVbmFibGUgdG8gY2hhbmdlIG1pbiBjaGFubmVsIHRpbWVyIikpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVMSU1fUEVSSU9ESUNfUFJPQkVfUkVRX1RJTUVSOgorICAgICAgICAgICAgaWYgKHR4X3RpbWVyX2RlYWN0aXZhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbVBlcmlvZGljUHJvYmVSZXFUaW1lcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBDb3VsZCBub3QgZGVhY3RpdmF0ZSBtaW4gY2hhbm5lbCB0aW1lci4KKyAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIlVuYWJsZSB0byBkZWFjdGl2YXRlIHBlcmlvZGljIHRpbWVyIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYocE1hYy0+bGltLmdwTGltTWxtU2NhblJlcSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2YWwgPSBTWVNfTVNfVE9fVElDS1MocE1hYy0+bGltLmdwTGltTWxtU2NhblJlcS0+bWluQ2hhbm5lbFRpbWUpLzI7CisgICAgICAgICAgICAgICAgaWYgKHBNYWMtPmJ0Yy5idGNTY2FuQ29tcHJvbWlzZSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChwTWFjLT5saW0uZ3BMaW1NbG1TY2FuUmVxLT5taW5DaGFubmVsVGltZUJ0YykKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsID0gU1lTX01TX1RPX1RJQ0tTKHBNYWMtPmxpbS5ncExpbU1sbVNjYW5SZXEtPm1pbkNoYW5uZWxUaW1lQnRjKS8yOworICAgICAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJVc2luZyBCVEMgTWluIEFjdGl2ZSBTY2FuIHRpbWUiKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkJUQyBBY3RpdmUgU2NhbiBNaW4gVGltZSBpcyBOb3QgU2V0IikpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgLypJZiB2YWwgaXMgMCBpdCBtZWFucyBtaW4gQ2hhbm5lbCB0aW1lciBpcyAwIHNvIHRha2UgdGhlIHZhbHVlIGZyb20gbWF4Q2hhbm5lbFRpbWVyKi8KKyAgICAgICAgICAgIGlmICghdmFsKQorICAgICAgICAgICAgeworCisgICAgICAgICAgICAgICAgaWYocE1hYy0+bGltLmdwTGltTWxtU2NhblJlcSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHZhbCA9IFNZU19NU19UT19USUNLUyhwTWFjLT5saW0uZ3BMaW1NbG1TY2FuUmVxLT5tYXhDaGFubmVsVGltZSkvMjsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHBNYWMtPmJ0Yy5idGNTY2FuQ29tcHJvbWlzZSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBNYWMtPmxpbS5ncExpbU1sbVNjYW5SZXEtPm1heENoYW5uZWxUaW1lQnRjKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbCA9IFNZU19NU19UT19USUNLUyhwTWFjLT5saW0uZ3BMaW1NbG1TY2FuUmVxLT5tYXhDaGFubmVsVGltZUJ0YykvMjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlVzaW5nIEJUQyBNYXggQWN0aXZlIFNjYW4gdGltZSIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkJUQyBBY3RpdmUgU2NhbiBNYXggVGltZSBpcyBOb3QgU2V0IikpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiIGdwTGltTWxtU2NhblJlcSBpcyBOVUxMICIpKTsKKyAgICAgICAgICAgICAgICAgICAgLy9ObyBuZWVkIHRvIGNoYW5nZSBtYXggdGltZXIuIFRoaXMgaXMgbm90IGEgc2NhbgorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAodmFsKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICh0eF90aW1lcl9jaGFuZ2UoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbVBlcmlvZGljUHJvYmVSZXFUaW1lciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbCwgMCkgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vIENvdWxkIG5vdCBjaGFuZ2UgbWluIGNoYW5uZWwgdGltZXIuCisgICAgICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlVuYWJsZSB0byBjaGFuZ2UgcGVyaW9kaWMgdGltZXIiKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiRG8gbm90IGNoYW5nZSBnTGltUGVyaW9kaWNQcm9iZVJlcVRpbWVyIHZhbHVlcywiCisgICAgICAgICAgICAgICAgICAgICAgICJ2YWx1ZSA9ICVkIG1pbmNoYW5uZWwgdGltZSA9ICVkIgorICAgICAgICAgICAgICAgICAgICAgICAibWF4Y2hhbm5lbCB0aW1lID0gJWQiKSwgdmFsLAorICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ3BMaW1NbG1TY2FuUmVxLT5taW5DaGFubmVsVGltZSwKKyAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdwTGltTWxtU2NhblJlcS0+bWF4Q2hhbm5lbFRpbWUpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVMSU1fTUFYX0NIQU5ORUxfVElNRVI6CisgICAgICAgICAgICBpZiAodHhfdGltZXJfZGVhY3RpdmF0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltTWF4Q2hhbm5lbFRpbWVyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBUWF9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIENvdWxkIG5vdCBkZWFjdGl2YXRlIG1heCBjaGFubmVsIHRpbWVyLgorICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgICAgICBGTCgiVW5hYmxlIHRvIGRlYWN0aXZhdGUgbWF4IGNoYW5uZWwgdGltZXIiKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIElmIGEgYmFja2dyb3VuZCB3YXMgdHJpZ2dlcmVkIHZpYSBRdWlldCBCU1MsCisgICAgICAgICAgICAvLyB0aGVuIHdlIG5lZWQgdG8gYWRqdXN0IHRoZSBNSU4gYW5kIE1BWCBjaGFubmVsCisgICAgICAgICAgICAvLyB0aW1lcidzIGFjY29yZGluZ2x5IHRvIHRoZSBRdWlldCBkdXJhdGlvbiB0aGF0CisgICAgICAgICAgICAvLyB3YXMgc3BlY2lmaWVkCisgICAgICAgICAgICBpZiAocE1hYy0+bGltLmdMaW1TeXN0ZW1Sb2xlICE9IGVMSU1fQVBfUk9MRSkKKyAgICAgICAgICAgIHsKKyNpZiAwCisKKyAgICAgICAgICAgICAgICBpZiggZUxJTV9RVUlFVF9SVU5OSU5HID09IHBNYWMtPmxpbS5nTGltU3BlY01nbXQucXVpZXRTdGF0ZSAmJgorICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbVRyaWdnZXJCYWNrZ3JvdW5kU2NhbkR1cmluZ1F1aWV0QnNzICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vIGdMaW1RdWlldER1cmF0aW9uIGlzIGFscmVhZHkgY2FjaGVkIGluIHVuaXRzIG9mCisgICAgICAgICAgICAgICAgICAgIC8vIHN5c3RlbSB0aWNrcy4gTm8gY29udmVyc2lvbiBpcyByZXFkLi4uCisgICAgICAgICAgICAgICAgICAgIHZhbCA9IHBNYWMtPmxpbS5nTGltU3BlY01nbXQucXVpZXREdXJhdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICBpZihwTWFjLT5saW0uZ3BMaW1NbG1TY2FuUmVxKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWwgPSBTWVNfTVNfVE9fVElDS1MocE1hYy0+bGltLmdwTGltTWxtU2NhblJlcS0+bWF4Q2hhbm5lbFRpbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBNYWMtPmJ0Yy5idGNTY2FuQ29tcHJvbWlzZSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocE1hYy0+bGltLmdwTGltTWxtU2NhblJlcS0+bWF4Q2hhbm5lbFRpbWVCdGMpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWwgPSBTWVNfTVNfVE9fVElDS1MocE1hYy0+bGltLmdwTGltTWxtU2NhblJlcS0+bWF4Q2hhbm5lbFRpbWVCdGMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlVzaW5nIEJUQyBNYXggQWN0aXZlIFNjYW4gdGltZSIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJCVEMgQWN0aXZlIFNjYW4gTWF4IFRpbWUgaXMgTm90IFNldCIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIiBncExpbU1sbVNjYW5SZXEgaXMgTlVMTCAiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAvL05vIG5lZWQgdG8gY2hhbmdlIG1heCB0aW1lci4gVGhpcyBpcyBub3QgYSBzY2FuCisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorI2lmIDAKKyAgICAgICAgICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHR4X3RpbWVyX2NoYW5nZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltTWF4Q2hhbm5lbFRpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWwsIDApICE9IFRYX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gQ291bGQgbm90IGNoYW5nZSBtYXggY2hhbm5lbCB0aW1lci4KKyAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIlVuYWJsZSB0byBjaGFuZ2UgbWF4IGNoYW5uZWwgdGltZXIiKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUxJTV9KT0lOX0ZBSUxfVElNRVI6CisgICAgICAgICAgICBpZiAodHhfdGltZXJfZGVhY3RpdmF0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltSm9pbkZhaWx1cmVUaW1lcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgKiBDb3VsZCBub3QgZGVhY3RpdmF0ZSBKb2luIEZhaWx1cmUKKyAgICAgICAgICAgICAgICAgKiB0aW1lci4gTG9nIGVycm9yLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgICAgICBGTCgiVW5hYmxlIHRvIGRlYWN0aXZhdGUgSm9pbiBGYWlsdXJlIHRpbWVyIikpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19KT0lOX0ZBSUxVUkVfVElNRU9VVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJnZhbCkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAqIENvdWxkIG5vdCBnZXQgSm9pbkZhaWx1cmVUaW1lb3V0IHZhbHVlCisgICAgICAgICAgICAgICAgICogZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICBGTCgiY291bGQgbm90IHJldHJpZXZlIEpvaW5GYWlsdXJlVGltZW91dCB2YWx1ZSIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHZhbCA9IFNZU19NU19UT19USUNLUyh2YWwpOworCisgICAgICAgICAgICBpZiAodHhfdGltZXJfY2hhbmdlKCZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1Kb2luRmFpbHVyZVRpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWwsIDApICE9IFRYX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICogQ291bGQgbm90IGNoYW5nZSBKb2luIEZhaWx1cmUKKyAgICAgICAgICAgICAgICAgKiB0aW1lci4gTG9nIGVycm9yLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgICAgICBGTCgiVW5hYmxlIHRvIGNoYW5nZSBKb2luIEZhaWx1cmUgdGltZXIiKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUxJTV9QRVJJT0RJQ19KT0lOX1BST0JFX1JFUV9USU1FUjoKKyAgICAgICAgICAgIGlmICh0eF90aW1lcl9kZWFjdGl2YXRlKCZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1QZXJpb2RpY0pvaW5Qcm9iZVJlcVRpbWVyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBUWF9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIENvdWxkIG5vdCBkZWFjdGl2YXRlIHBlcmlvZGljIGpvaW4gcmVxIFRpbWVzLgorICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgICAgICBGTCgiVW5hYmxlIHRvIGRlYWN0aXZhdGUgcGVyaW9kaWMgam9pbiByZXF1ZXN0IHRpbWVyIikpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB2YWwgPSBTWVNfTVNfVE9fVElDS1MoTElNX0pPSU5fUFJPQkVfUkVRX1RJTUVSX01TKTsKKyAgICAgICAgICAgIGlmICh0eF90aW1lcl9jaGFuZ2UoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbVBlcmlvZGljSm9pblByb2JlUmVxVGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbCwgMCkgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBDb3VsZCBub3QgY2hhbmdlIHBlcmlvZGljIGpvaW4gcmVxIHRpbWVzLgorICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiVW5hYmxlIHRvIGNoYW5nZSBwZXJpb2RpYyBqb2luIHJlcXVlc3QgdGltZXIiKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUxJTV9BVVRIX0ZBSUxfVElNRVI6CisgICAgICAgICAgICBpZiAodHhfdGltZXJfZGVhY3RpdmF0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltQXV0aEZhaWx1cmVUaW1lcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBUWF9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIENvdWxkIG5vdCBkZWFjdGl2YXRlIEF1dGggZmFpbHVyZSB0aW1lci4KKyAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIlVuYWJsZSB0byBkZWFjdGl2YXRlIGF1dGggZmFpbHVyZSB0aW1lciIpKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gQ2hhbmdlIHRpbWVyIHRvIHJlYWN0aXZhdGUgaXQgaW4gZnV0dXJlCisgICAgICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19BVVRIRU5USUNBVEVfRkFJTFVSRV9USU1FT1VULAorICAgICAgICAgICAgICAgICAgICAgICAgICAmdmFsKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICogQ291bGQgbm90IGdldCBBdXRoRmFpbHVyZVRpbWVvdXQgdmFsdWUKKyAgICAgICAgICAgICAgICAgKiBmcm9tIENGRy4gTG9nIGVycm9yLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgQXV0aEZhaWx1cmVUaW1lb3V0IHZhbHVlIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdmFsID0gU1lTX01TX1RPX1RJQ0tTKHZhbCk7CisKKyAgICAgICAgICAgIGlmICh0eF90aW1lcl9jaGFuZ2UoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbUF1dGhGYWlsdXJlVGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbCwgMCkgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBDb3VsZCBub3QgY2hhbmdlIEF1dGhlbnRpY2F0aW9uIGZhaWx1cmUgdGltZXIuCisgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJ1bmFibGUgdG8gY2hhbmdlIEF1dGggZmFpbHVyZSB0aW1lciIpKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlTElNX0FVVEhfUkVUUllfVElNRVI6CisKKyAgICAgICAgICAgIGlmICh0eF90aW1lcl9kZWFjdGl2YXRlKCZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1QZXJpb2RpY0F1dGhSZXRyeVRpbWVyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBUWF9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIENvdWxkIG5vdCBkZWFjdGl2YXRlIEF1dGggUmV0cnkgVGltZXIuCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJVbmFibGUgdG8gZGVhY3RpdmF0ZSBBdXRoIFJldHJ5IHRpbWVyIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKChwc2Vzc2lvbkVudHJ5ID0gcGVGaW5kU2Vzc2lvbkJ5U2Vzc2lvbklkKHBNYWMsCisgICAgICAgICAgICAgICAgcE1hYy0+bGltLmxpbVRpbWVycy5nTGltUGVyaW9kaWNBdXRoUmV0cnlUaW1lci5zZXNzaW9uSWQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgICBGTCgic2Vzc2lvbiBkb2VzIG5vdCBleGlzdCBmb3IgZ2l2ZW4gU2Vzc2lvbklkIDogJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbVBlcmlvZGljQXV0aFJldHJ5VGltZXIuc2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8qIDMvNSBvZiB0aGUgYmVhY29uIGludGVydmFsKi8KKyAgICAgICAgICAgIHZhbCA9IHBzZXNzaW9uRW50cnktPmJlYWNvblBhcmFtcy5iZWFjb25JbnRlcnZhbCAqIDMvNTsKKyAgICAgICAgICAgIHZhbCA9IFNZU19NU19UT19USUNLUyh2YWwpOworICAgICAgICAgICAgaWYgKHR4X3RpbWVyX2NoYW5nZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltUGVyaW9kaWNBdXRoUmV0cnlUaW1lciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsLCAwKSAhPSBUWF9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIENvdWxkIG5vdCBjaGFuZ2UgQXV0aCBSZXRyeSB0aW1lci4KKyAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoIlVuYWJsZSB0byBjaGFuZ2UgQXV0aCBSZXRyeSB0aW1lciIpKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlTElNX0FTU09DX0ZBSUxfVElNRVI6CisgICAgICAgICAgICBpZiAodHhfdGltZXJfZGVhY3RpdmF0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltQXNzb2NGYWlsdXJlVGltZXIpICE9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUWF9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIENvdWxkIG5vdCBkZWFjdGl2YXRlIEFzc29jaWF0aW9uIGZhaWx1cmUgdGltZXIuCisgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgRkwoInVuYWJsZSB0byBkZWFjdGl2YXRlIEFzc29jaWF0aW9uIGZhaWx1cmUgdGltZXIiKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIENoYW5nZSB0aW1lciB0byByZWFjdGl2YXRlIGl0IGluIGZ1dHVyZQorICAgICAgICAgICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfQVNTT0NJQVRJT05fRkFJTFVSRV9USU1FT1VULAorICAgICAgICAgICAgICAgICAgICAgICAgICAmdmFsKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICogQ291bGQgbm90IGdldCBBc3NvY0ZhaWx1cmVUaW1lb3V0IHZhbHVlCisgICAgICAgICAgICAgICAgICogZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICBGTCgiY291bGQgbm90IHJldHJpZXZlIEFzc29jRmFpbHVyZVRpbWVvdXQgdmFsdWUiKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB2YWwgPSBTWVNfTVNfVE9fVElDS1ModmFsKTsKKworICAgICAgICAgICAgaWYgKHR4X3RpbWVyX2NoYW5nZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltQXNzb2NGYWlsdXJlVGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbCwgMCkgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBDb3VsZCBub3QgY2hhbmdlIEFzc29jaWF0aW9uIGZhaWx1cmUgdGltZXIuCisgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJ1bmFibGUgdG8gY2hhbmdlIEFzc29jIGZhaWx1cmUgdGltZXIiKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUxJTV9SRUFTU09DX0ZBSUxfVElNRVI6CisgICAgICAgICAgICBpZiAodHhfdGltZXJfZGVhY3RpdmF0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltUmVhc3NvY0ZhaWx1cmVUaW1lcikgIT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRYX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gQ291bGQgbm90IGRlYWN0aXZhdGUgUmVhc3NvY2lhdGlvbiBmYWlsdXJlIHRpbWVyLgorICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgIEZMKCJ1bmFibGUgdG8gZGVhY3RpdmF0ZSBSZWFzc29jIGZhaWx1cmUgdGltZXIiKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIENoYW5nZSB0aW1lciB0byByZWFjdGl2YXRlIGl0IGluIGZ1dHVyZQorICAgICAgICAgICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfUkVBU1NPQ0lBVElPTl9GQUlMVVJFX1RJTUVPVVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICZ2YWwpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgKiBDb3VsZCBub3QgZ2V0IFJlYXNzb2NGYWlsdXJlVGltZW91dCB2YWx1ZQorICAgICAgICAgICAgICAgICAqIGZyb20gQ0ZHLiBMb2cgZXJyb3IuCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBSZWFzc29jRmFpbHVyZVRpbWVvdXQgdmFsdWUiKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB2YWwgPSBTWVNfTVNfVE9fVElDS1ModmFsKTsKKworICAgICAgICAgICAgaWYgKHR4X3RpbWVyX2NoYW5nZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltUmVhc3NvY0ZhaWx1cmVUaW1lciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsLCAwKSAhPSBUWF9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIENvdWxkIG5vdCBjaGFuZ2UgUmVhc3NvY2lhdGlvbiBmYWlsdXJlIHRpbWVyLgorICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgIEZMKCJ1bmFibGUgdG8gY2hhbmdlIFJlYXNzb2NpYXRpb24gZmFpbHVyZSB0aW1lciIpKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlTElNX0hFQVJUX0JFQVRfVElNRVI6CisgICAgICAgICAgICBpZiAodHhfdGltZXJfZGVhY3RpdmF0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltSGVhcnRCZWF0VGltZXIpICE9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUWF9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIENvdWxkIG5vdCBkZWFjdGl2YXRlIEhlYXJ0YmVhdCB0aW1lci4KKyAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoInVuYWJsZSB0byBkZWFjdGl2YXRlIEhlYXJ0YmVhdCB0aW1lciIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgRkwoIkRlYWN0aXZhdGVkIGhlYXJ0YmVhdCBsaW5rIG1vbml0b3JpbmciKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0JFQUNPTl9JTlRFUlZBTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJnZhbCkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAqIENvdWxkIG5vdCBnZXQgQkVBQ09OX0lOVEVSVkFMIHZhbHVlCisgICAgICAgICAgICAgICAgICogZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBCRUFDT05fSU5URVJWQUwgdmFsdWUiKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0hFQVJUX0JFQVRfVEhSRVNIT0xELCAmdmFsMSkgIT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBoZWFydGJlYXQgZmFpbHVyZSB2YWx1ZSIpKTsKKworICAgICAgICAgICAgLy8gQ2hhbmdlIHRpbWVyIHRvIHJlYWN0aXZhdGUgaXQgaW4gZnV0dXJlCisgICAgICAgICAgICB2YWwgPSBTWVNfTVNfVE9fVElDS1ModmFsICogdmFsMSk7CisKKyAgICAgICAgICAgIGlmICh0eF90aW1lcl9jaGFuZ2UoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbUhlYXJ0QmVhdFRpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWwsIDApICE9IFRYX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gQ291bGQgbm90IGNoYW5nZSBIZWFydEJlYXQgdGltZXIuCisgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJ1bmFibGUgdG8gY2hhbmdlIEhlYXJ0QmVhdCB0aW1lciIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgRkwoIkhlYXJ0QmVhdCB0aW1lciB2YWx1ZSBpcyBjaGFuZ2VkID0gJXUiKSwgdmFsKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUxJTV9QUk9CRV9BRlRFUl9IQl9USU1FUjoKKyAgICAgICAgICAgIGlmICh0eF90aW1lcl9kZWFjdGl2YXRlKCZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1Qcm9iZUFmdGVySEJUaW1lcikgIT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRYX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gQ291bGQgbm90IGRlYWN0aXZhdGUgSGVhcnRiZWF0IHRpbWVyLgorICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgIEZMKCJ1bmFibGUgdG8gZGVhY3RpdmF0ZSBwcm9iZUFmdGVySEJUaW1lciIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIkRlYWN0aXZhdGVkIHByb2JlIGFmdGVyIGhiIHRpbWVyIikpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19QUk9CRV9BRlRFUl9IQl9GQUlMX1RJTUVPVVQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICZ2YWwpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgKiBDb3VsZCBub3QgZ2V0IFBST0JFX0FGVEVSX0hCX0ZBSUxVUkUKKyAgICAgICAgICAgICAgICAgKiB2YWx1ZSBmcm9tIENGRy4gTG9nIGVycm9yLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgUFJPQkVfQUZURVJfSEJfRkFJTF9USU1FT1VUIHZhbHVlIikpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBDaGFuZ2UgdGltZXIgdG8gcmVhY3RpdmF0ZSBpdCBpbiBmdXR1cmUKKyAgICAgICAgICAgIHZhbCA9IFNZU19NU19UT19USUNLUyh2YWwpOworCisgICAgICAgICAgICBpZiAodHhfdGltZXJfY2hhbmdlKCZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1Qcm9iZUFmdGVySEJUaW1lciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsLCAwKSAhPSBUWF9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIENvdWxkIG5vdCBjaGFuZ2UgSGVhcnRCZWF0IHRpbWVyLgorICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgICAgICBGTCgidW5hYmxlIHRvIGNoYW5nZSBQcm9iZUFmdGVySEJUaW1lciIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgRkwoIlByb2JlIGFmdGVyIEhCIHRpbWVyIHZhbHVlIGlzIGNoYW5nZWQgPSAldSIpLCB2YWwpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVMSU1fS0VFUEFMSVZFX1RJTUVSOgorICAgICAgICAgICAgaWYgKHR4X3RpbWVyX2RlYWN0aXZhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbUtlZXBhbGl2ZVRpbWVyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICE9IFRYX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gQ291bGQgbm90IGRlYWN0aXZhdGUgS2VlcGFsaXZlIHRpbWVyLgorICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgIEZMKCJ1bmFibGUgdG8gZGVhY3RpdmF0ZSBLZWVwYWxpdmVUaW1lciB0aW1lciIpKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gQ2hhbmdlIHRpbWVyIHRvIHJlYWN0aXZhdGUgaXQgaW4gZnV0dXJlCisKKyAgICAgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0tFRVBBTElWRV9USU1FT1VULAorICAgICAgICAgICAgICAgICAgICAgICAgICAmdmFsKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICogQ291bGQgbm90IGdldCBrZWVwYWxpdmUgdGltZW91dCB2YWx1ZQorICAgICAgICAgICAgICAgICAqIGZyb20gQ0ZHLiBMb2cgZXJyb3IuCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBrZWVwYWxpdmUgdGltZW91dCB2YWx1ZSIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICh2YWwgPT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2YWwgPSAzMDAwOworICAgICAgICAgICAgICAgIHBNYWMtPnNjaC5rZWVwQWxpdmUgPSAwOworICAgICAgICAgICAgfSBlbHNlCisgICAgICAgICAgICAgICAgcE1hYy0+c2NoLmtlZXBBbGl2ZSA9IDE7CisKKworCisgICAgICAgICAgICB2YWwgPSBTWVNfTVNfVE9fVElDS1ModmFsICsgU1lTX1RJQ0tfRFVSX01TIC0gMSk7CisKKyAgICAgICAgICAgIGlmICh0eF90aW1lcl9jaGFuZ2UoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbUtlZXBhbGl2ZVRpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWwsIHZhbCkgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBDb3VsZCBub3QgY2hhbmdlIEtlZXBhbGl2ZVRpbWVyIHRpbWVyLgorICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgIEZMKCJ1bmFibGUgdG8gY2hhbmdlIEtlZXBhbGl2ZVRpbWVyIHRpbWVyIikpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVMSU1fQkFDS0dST1VORF9TQ0FOX1RJTUVSOgorICAgICAgICAgICAgaWYgKHR4X3RpbWVyX2RlYWN0aXZhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbUJhY2tncm91bmRTY2FuVGltZXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBDb3VsZCBub3QgZGVhY3RpdmF0ZSBCYWNrZ3JvdW5kU2NhblRpbWVyIHRpbWVyLgorICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgIEZMKCJ1bmFibGUgdG8gZGVhY3RpdmF0ZSBCYWNrZ3JvdW5kU2NhblRpbWVyIHRpbWVyIikpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBDaGFuZ2UgdGltZXIgdG8gcmVhY3RpdmF0ZSBpdCBpbiBmdXR1cmUKKyAgICAgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0JBQ0tHUk9VTkRfU0NBTl9QRVJJT0QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICZ2YWwpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgKiBDb3VsZCBub3QgZ2V0IEJhY2tncm91bmQgc2NhbiBwZXJpb2QgdmFsdWUKKyAgICAgICAgICAgICAgICAgKiBmcm9tIENGRy4gTG9nIGVycm9yLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgQmFja2dyb3VuZCBzY2FuIHBlcmlvZCB2YWx1ZSIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICh2YWwgPT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2YWwgPSBMSU1fQkFDS0dST1VORF9TQ0FOX1BFUklPRF9ERUZBVUxUX01TOworICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltQmFja2dyb3VuZFNjYW5EaXNhYmxlID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbUJhY2tncm91bmRTY2FuRGlzYWJsZSA9IGZhbHNlOworCisgICAgICAgICAgICB2YWwgPSBTWVNfTVNfVE9fVElDS1ModmFsKTsKKworICAgICAgICAgICAgaWYgKHR4X3RpbWVyX2NoYW5nZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltQmFja2dyb3VuZFNjYW5UaW1lciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsLCB2YWwpICE9IFRYX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gQ291bGQgbm90IGNoYW5nZSBCYWNrZ3JvdW5kU2NhblRpbWVyIHRpbWVyLgorICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgIEZMKCJ1bmFibGUgdG8gY2hhbmdlIEJhY2tncm91bmRTY2FuVGltZXIgdGltZXIiKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGJyZWFrOworCisjaWYgMAorICAgICAgICBjYXNlIGVMSU1fQ0hBTk5FTF9TV0lUQ0hfVElNRVI6CisgICAgICAgICAgICBpZiAodHhfdGltZXJfZGVhY3RpdmF0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltQ2hhbm5lbFN3aXRjaFRpbWVyKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJ0eF90aW1lcl9kZWFjdGl2YXRlIGZhaWxlZCEiKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAodHhfdGltZXJfY2hhbmdlKCZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1DaGFubmVsU3dpdGNoVGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbUNoYW5uZWxTd2l0Y2guc3dpdGNoVGltZW91dFZhbHVlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoInR4X3RpbWVyX2NoYW5nZSBmYWlsZWQgIikpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworI2VuZGlmCisKKyAgICAgICAgY2FzZSBlTElNX0xFQVJOX0RVUkFUSU9OX1RJTUVSOgorICAgICAgICAgICAgYnJlYWs7CisKKyNpZiAwCisgICAgICAgIGNhc2UgZUxJTV9RVUlFVF9CU1NfVElNRVI6CisgICAgICAgICAgICBpZiAoVFhfU1VDQ0VTUyAhPQorICAgICAgICAgICAgdHhfdGltZXJfZGVhY3RpdmF0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltUXVpZXRCc3NUaW1lcikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgRkwoIlVuYWJsZSB0byBkZS1hY3RpdmF0ZSBnTGltUXVpZXRCc3NUaW1lciEgV2lsbCBhdHRlbXB0IHRvIGFjdGl2YXRlIGFueXdheS4uLiIpKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gZ0xpbVF1aWV0RHVyYXRpb24gYXBwZWFycyB0byBiZSBpbiB1bml0cyBvZiB0aWNrcworICAgICAgICAgICAgLy8gVXNlIGl0IGFzIGlzCisgICAgICAgICAgICBpZiAoVFhfU1VDQ0VTUyAhPQorICAgICAgICAgICAgICAgIHR4X3RpbWVyX2NoYW5nZSggJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbVF1aWV0QnNzVGltZXIsCisgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbVNwZWNNZ210LnF1aWV0RHVyYXRpb24sCisgICAgICAgICAgICAgICAgICAwKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICBGTCgiVW5hYmxlIHRvIGNoYW5nZSBnTGltUXVpZXRCc3NUaW1lciEgV2lsbCBzdGlsbCBhdHRlbXB0IHRvIGFjdGl2YXRlIGFueXdheS4uLiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUxJTV9RVUlFVF9USU1FUjoKKyAgICAgICAgICAgIGlmKCBUWF9TVUNDRVNTICE9IHR4X3RpbWVyX2RlYWN0aXZhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbVF1aWV0VGltZXIpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgRkwoICJVbmFibGUgdG8gZGVhY3RpdmF0ZSBnTGltUXVpZXRUaW1lciEgV2lsbCBzdGlsbCBhdHRlbXB0IHRvIHJlLWFjdGl2YXRlIGFueXdheS4uLiIgKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIFNldCB0aGUgTkVXIHRpbWVvdXQgdmFsdWUsIGluIHRpY2tzCisgICAgICAgICAgICBpZiggVFhfU1VDQ0VTUyAhPSB0eF90aW1lcl9jaGFuZ2UoICZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1RdWlldFRpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU1lTX01TX1RPX1RJQ0tTKHBNYWMtPmxpbS5nTGltU3BlY01nbXQucXVpZXRUaW1lb3V0VmFsdWUpLCAwKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgIEZMKCAiVW5hYmxlIHRvIGNoYW5nZSBnTGltUXVpZXRUaW1lciEgV2lsbCBzdGlsbCBhdHRlbXB0IHRvIHJlLWFjdGl2YXRlIGFueXdheS4uLiIgKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyNlbmRpZgorCisjaWYgMAorICAgICAgICBjYXNlIGVMSU1fV1BTX09WRVJMQVBfVElNRVI6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAvLyBSZXN0YXJ0IExlYXJuIEludGVydmFsIHRpbWVyCisKKyAgICAgICAgICAgICAgdEFOSV9VMzIgV1BTT3ZlcmxhcFRpbWVyID0gU1lTX01TX1RPX1RJQ0tTKExJTV9XUFNfT1ZFUkxBUF9USU1FUl9NUyk7CisKKyAgICAgICAgICAgICAgaWYgKHR4X3RpbWVyX2RlYWN0aXZhdGUoCisgICAgICAgICAgICAgICAgICAgICAmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltV1BTT3ZlcmxhcFRpbWVyT2JqLmdMaW1XUFNPdmVybGFwVGltZXIpICE9IFRYX1NVQ0NFU1MpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8vIENvdWxkIG5vdCBkZWFjdGl2YXRlIExlYXJuIEludGVydmFsIHRpbWVyLgorICAgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiVW5hYmxlIHRvIGRlYWN0aXZhdGUgV1BTIG92ZXJsYXAgdGltZXIiKSk7CisgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICBpZiAodHhfdGltZXJfY2hhbmdlKAorICAgICAgICAgICAgICAgICAgICAgICAgICZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1XUFNPdmVybGFwVGltZXJPYmouZ0xpbVdQU092ZXJsYXBUaW1lciwKKyAgICAgICAgICAgICAgICAgICAgICAgICBXUFNPdmVybGFwVGltZXIsIDApICE9IFRYX1NVQ0NFU1MpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8vIENvdWxkIG5vdCBjaGFuZ2UgTGVhcm4gSW50ZXJ2YWwgdGltZXIuCisgICAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiVW5hYmxlIHRvIGNoYW5nZSBXUFMgb3ZlcmxhcCB0aW1lciIpKTsKKworICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgRkwoIlNldHRpbmcgV1BTIG92ZXJsYXAgVElNRVIgdG8gJWQgdGlja3MiKSwKKyAgICAgICAgICAgICAgICAgIFdQU092ZXJsYXBUaW1lcik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyNlbmRpZgorCisjaWZkZWYgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIKKyAgICAgICAgY2FzZSBlTElNX0ZUX1BSRUFVVEhfUlNQX1RJTUVSOgorICAgICAgICAgICAgaWYgKHR4X3RpbWVyX2RlYWN0aXZhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbUZUUHJlQXV0aFJzcFRpbWVyKSAhPSBUWF9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICoqIENvdWxkIG5vdCBkZWFjdGl2YXRlIEpvaW4gRmFpbHVyZQorICAgICAgICAgICAgICAgICoqIHRpbWVyLiBMb2cgZXJyb3IuCisgICAgICAgICAgICAgICAgKiovCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJVbmFibGUgdG8gZGVhY3RpdmF0ZSBQcmVhdXRoIHJlc3BvbnNlIEZhaWx1cmUgdGltZXIiKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdmFsID0gMTAwMDsKKyAgICAgICAgICAgIHZhbCA9IFNZU19NU19UT19USUNLUyh2YWwpOworICAgICAgICAgICAgaWYgKHR4X3RpbWVyX2NoYW5nZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltRlRQcmVBdXRoUnNwVGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWwsIDApICE9IFRYX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgKiBDb3VsZCBub3QgY2hhbmdlIEpvaW4gRmFpbHVyZQorICAgICAgICAgICAgICAgICogdGltZXIuIExvZyBlcnJvci4KKyAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiVW5hYmxlIHRvIGNoYW5nZSBKb2luIEZhaWx1cmUgdGltZXIiKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisjZW5kaWYKKyNpZiBkZWZpbmVkKEZFQVRVUkVfV0xBTl9FU0UpICYmICFkZWZpbmVkKEZFQVRVUkVfV0xBTl9FU0VfVVBMT0FEKQorICAgICAgICAgY2FzZSBlTElNX1RTTV9USU1FUjoKKyAgICAgICAgICAgICBpZiAodHhfdGltZXJfZGVhY3RpdmF0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltRXNlVHNtVGltZXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiVW5hYmxlIHRvIGRlYWN0aXZhdGUgVFNNIHRpbWVyIikpOworICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICBicmVhazsKKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fRVNFICYmICFGRUFUVVJFX1dMQU5fRVNFX1VQTE9BRCAqLworCisgICAgY2FzZSBlTElNX0NPTlZFUlRfQUNUSVZFX0NIQU5ORUxfVE9fUEFTU0lWRToKKyAgICAgICAgICAgIGlmICh0eF90aW1lcl9kZWFjdGl2YXRlKCZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1BY3RpdmVUb1Bhc3NpdmVDaGFubmVsVGltZXIpICE9IFRYX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgKiogQ291bGQgbm90IGRlYWN0aXZhdGUgQWN0aXZlIHRvIHBhc3NpdmUgY2hhbm5lbCB0aW1lci4KKyAgICAgICAgICAgICAgICAqKiBMb2cgZXJyb3IuCisgICAgICAgICAgICAgICAgKiovCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJVbmFibGUgdG8gRGVhY3RpdmF0ZSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJBY3RpdmUgdG8gcGFzc2l2ZSBjaGFubmVsIHRpbWVyIikpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHZhbCA9IEFDVElWRV9UT19QQVNTSVZFX0NPTlZFUklTT05fVElNRU9VVDsKKyAgICAgICAgICAgIHZhbCA9IFNZU19NU19UT19USUNLUyh2YWwpOworICAgICAgICAgICAgaWYgKHR4X3RpbWVyX2NoYW5nZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltQWN0aXZlVG9QYXNzaXZlQ2hhbm5lbFRpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsLCAwKSAhPSBUWF9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICogQ291bGQgbm90IGNoYW5nZSB0aW1lciB0byBjaGVjayBzY2FuIHR5cGUgZm9yIHBhc3NpdmUgY2hhbm5lbC4KKyAgICAgICAgICAgICAgICAqIHRpbWVyLiBMb2cgZXJyb3IuCisgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoIlVuYWJsZSB0byBjaGFuZ2UgdGltZXIiKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICBjYXNlIGVMSU1fRElTQVNTT0NfQUNLX1RJTUVSOgorICAgICAgICAgICAgaWYgKHR4X3RpbWVyX2RlYWN0aXZhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbURpc2Fzc29jQWNrVGltZXIpICE9IFRYX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgKiogQ291bGQgbm90IGRlYWN0aXZhdGUgSm9pbiBGYWlsdXJlCisgICAgICAgICAgICAgICAgKiogdGltZXIuIExvZyBlcnJvci4KKyAgICAgICAgICAgICAgICAqKi8KKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoIlVuYWJsZSB0byBkZWFjdGl2YXRlIERpc2Fzc29jIGFjayB0aW1lciIpKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICB2YWwgPSAxMDAwOworICAgICAgICAgICAgdmFsID0gU1lTX01TX1RPX1RJQ0tTKHZhbCk7CisgICAgICAgICAgICBpZiAodHhfdGltZXJfY2hhbmdlKCZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1EaXNhc3NvY0Fja1RpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsLCAwKSAhPSBUWF9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICogQ291bGQgbm90IGNoYW5nZSBKb2luIEZhaWx1cmUKKyAgICAgICAgICAgICAgICAqIHRpbWVyLiBMb2cgZXJyb3IuCisgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoIlVuYWJsZSB0byBjaGFuZ2UgdGltZXIiKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICBjYXNlIGVMSU1fREVBVVRIX0FDS19USU1FUjoKKyAgICAgICAgICAgIGlmICh0eF90aW1lcl9kZWFjdGl2YXRlKCZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1EZWF1dGhBY2tUaW1lcikgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAqKiBDb3VsZCBub3QgZGVhY3RpdmF0ZSBKb2luIEZhaWx1cmUKKyAgICAgICAgICAgICAgICAqKiB0aW1lci4gTG9nIGVycm9yLgorICAgICAgICAgICAgICAgICoqLworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiVW5hYmxlIHRvIGRlYWN0aXZhdGUgRGVhdXRoIGFjayB0aW1lciIpKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICB2YWwgPSAxMDAwOworICAgICAgICAgICAgdmFsID0gU1lTX01TX1RPX1RJQ0tTKHZhbCk7CisgICAgICAgICAgICBpZiAodHhfdGltZXJfY2hhbmdlKCZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1EZWF1dGhBY2tUaW1lciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbCwgMCkgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAqIENvdWxkIG5vdCBjaGFuZ2UgSm9pbiBGYWlsdXJlCisgICAgICAgICAgICAgICAgKiB0aW1lci4gTG9nIGVycm9yLgorICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJVbmFibGUgdG8gY2hhbmdlIHRpbWVyIikpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgY2FzZSBlTElNX0lOU0VSVF9TSU5HTEVTSE9UX05PQV9USU1FUjoKKyAgICAgICAgaWYgKHR4X3RpbWVyX2RlYWN0aXZhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbVAycFNpbmdsZVNob3ROb2FJbnNlcnRUaW1lcikgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgLyoqCisgICAgICAgKiogQ291bGQgbm90IGRlYWN0aXZhdGUgU2luZ2xlU2hvdCBOT0EgSW5zZXJ0CisgICAgICAgKiogdGltZXIuIExvZyBlcnJvci4KKyAgICAgICAqKi8KKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiVW5hYmxlIHRvIGRlYWN0aXZhdGUgU2luZ2xlU2hvdCBOT0EgSW5zZXJ0IHRpbWVyIikpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIHZhbCA9IExJTV9JTlNFUlRfU0lOR0xFU0hPVE5PQV9USU1FT1VUX1ZBTFVFOworICAgICAgICB2YWwgPSBTWVNfTVNfVE9fVElDS1ModmFsKTsKKyAgICAgICAgaWYgKHR4X3RpbWVyX2NoYW5nZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltUDJwU2luZ2xlU2hvdE5vYUluc2VydFRpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWwsIDApICE9IFRYX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qKgorICAgICAgICogQ291bGQgbm90IGNoYW5nZSBTaW5nbGUgU2hvdCBOT0EgSW5zZXJ0CisgICAgICAgKiB0aW1lci4gTG9nIGVycm9yLgorICAgICAgICovCisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoIlVuYWJsZSB0byBjaGFuZ2UgdGltZXIiKSk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIC8vIEludmFsaWQgdGltZXJJZC4gTG9nIGVycm9yCisgICAgICAgICAgICBicmVhazsKKyAgICB9Cit9IC8qKioqKiogZW5kIGxpbURlYWN0aXZhdGVBbmRDaGFuZ2VUaW1lcigpICoqKioqKi8KKworCisKKy8qKi0tLS0tLS0tLS0tLS0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0aXZhdGUgSGVhcnRiZWF0IHRpbWVyIikpOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiSUJTUyBIZWFydEJlYXQgT2ZmbG9hZGVkLCBEZWFjdGl2YXRlZCBoZWFydGJlYXQgbGluayBtb25pdG9yaW5nIikpOworICAgICAgICAgIH0KKyAgICAgICB9CisgICAgICAgZWxzZQorICAgICAgIHsKKyAgICAgICAgICBpZiAodHhfdGltZXJfYWN0aXZhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbUhlYXJ0QmVhdFRpbWVyKSE9IFRYX1NVQ0NFU1MpCisgICAgICAgICAgeworICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLEZMKCJjb3VsZCBub3QgYWN0aXZhdGUgSGVhcnRiZWF0IHRpbWVyIikpOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiUmVhY3RpdmF0ZWQgaGVhcnRiZWF0IGxpbmsgbW9uaXRvcmluZyIpKTsKKyAgICAgICAgICB9CisgICAgICAgfQorICAgICAgIGxpbVJlc2V0SEJQa3RDb3VudChwc2Vzc2lvbkVudHJ5KTsKKyAgICB9CisKK30gLyoqKioqKiBlbmQgbGltUmVhY3RpdmF0ZUhlYXJ0QmVhdFRpbWVyKCkgKioqKioqLworCisKKy8qKgorICogbGltQWN0aXZhdGVIZWFyQmVhdFRpbWVyKCkKKyAqCisgKgorICogQGJyaWVmOiBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCB0byBhY3RpdmF0ZSBoZWFydGJlYXQgdGltZXIKKyAqCisgKkxPR0lDOgorICoKKyAqQVNTVU1QVElPTlM6CisgKiBOQQorICoKKyAqIEBub3RlICAgc3RhSWQgZm9yIGVMSU1fQVVUSF9SU1BfVElNRVIgaXMgYX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yAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBIQiBvZmZsb2FkIGluIElCU1MgbW9kZSAqLworICAgICAgICAgICAgICBzdGF0dXMgPSB0eF90aW1lcl9kZWFjdGl2YXRlKCZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1IZWFydEJlYXRUaW1lcik7CisgICAgICAgICAgICAgIGlmIChUWF9TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgIEZMKCJJQlNTIEhCIE9mZmxvYWQsIENvdWxkIG5vdCBkZWFjdGl2YXRlIEhCIHRpbWVyIHN0YXR1cyglZCkiKSwKKyAgICAgICAgICAgICAgICAgc3RhdHVzKTspCisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgRkwoIiVzXSBJQlNTIEhCIE9mZmxvYWRlZCwgSGVhcnRiZWF0IHRpbWVyIGRlYWN0aXZhdGVkIiksCisgICAgICAgICAgICAgICAgIF9fZnVuY19fKTspCisgICAgICAgICAgICAgIH0KKworICAgICAgICAgICB9CisgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgeworICAgICAgICAgICAgICBzdGF0dXMgPSB0eF90aW1lcl9hY3RpdmF0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltSGVhcnRCZWF0VGltZXIpOworICAgICAgICAgICAgICBpZiAoIFRYX1NVQ0NFU1MgIT0gc3RhdHVzICkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgIEZMKCJjb3VsZCBub3QgYWN0aXZhdGUgSGVhcnRiZWF0IHRpbWVyIHN0YXR1cyglZCkiKSwgc3R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E5vbmUKKyAqLworCit2b2lkCitsaW1EZWFjdGl2YXRlQW5kQ2hhbmdlUGVyU3RhSWRUaW1lcih0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UzMiB0aW1lcklkLCB0QU5JX1UxNiBzdGFJZCkKK3sKKyAgICB0QU5JX1UzMiAgICB2YWw7CisKKyAgICBzd2l0Y2ggKHRpbWVySWQpCisgICAgeworICAgICAgICBjYXNlIGVMSU1fQ05GX1dBSVRfVElNRVI6CisKKyAgICAgICAgICAgIGlmICh0eF90aW1lcl9kZWFjdGl2YXRlKCZwTWFjLT5saW0ubGltVGltZXJzLmdwTGltQ25mV2FpdFRpbWVyW3N0YUlkXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBUWF9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoInVuYWJsZSB0byBkZWFjdGl2YXRlIENORiB3YWl0IHRpbWVyIikpOworCisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIENoYW5nZSB0aW1lciB0byByZWFjdGl2YXRlIGl0IGluIGZ1dHVyZQorCisgICAgICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19XVF9DTkZfVElNRU9VVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJnZhbCkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAqIENvdWxkIG5vdCBnZXQgY25mIHRpbWVvdXQgdmFsdWUKKyAgICAgICAgICAgICAgICAgKiBmcm9tIENGRy4gTG9nIGVycm9yLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgY25mIHRpbWVvdXQgdmFsdWUiKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB2YWwgPSBTWVNfTVNfVE9fVElDS1ModmFsKTsKKworICAgICAgICAgICAgaWYgKHR4X3RpbWVyX2NoYW5nZSgmcE1hYy0+bGltLmxpbVRpbWVycy5ncExpbUNuZldhaXRUaW1lcltzdGFJZF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbCwgdmFsKSAhPSBUWF9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIENvdWxkIG5vdCBjaGFuZ2UgY25mIHRpbWVyLgorICAgICAgICAgICAgICAgIC8vIExvZyBlcnJvcgorICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgidW5hYmxlIHRvIGNoYW5nZSBjbmYgd2FpdCB0aW1lciIpKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlTElNX0FVVEhfUlNQX1RJTUVSOgorICAgICAgICB7CisgICAgICAgICAgICB0TGltUHJlQXV0aE5vZGUgKnBBdXRoTm9kZTsKKworICAgICAgICAgICAgcEF1dGhOb2RlID0gbGltR2V0UHJlQXV0aE5vZGVGcm9tSW5kZXgocE1hYywgJnBNYWMtPmxpbS5nTGltUHJlQXV0aFRpbWVyVGFibGUsIHN0YUlkKTsKKworICAgICAgICAgICAgaWYgKHBBdXRoTm9kZSA9PSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiSW52YWxpZCBQcmUgQXV0aCBJbmRleCBwYXNzZWQgOiVkIiksIHN0YUlkKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHR4X3RpbWVyX2RlYWN0aXZhdGUoJnBBdXRoTm9kZS0+dGltZXIpICE9IFRYX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gQ291bGQgbm90IGRlYWN0aXZhdGUgYXV0aCByZXNwb25zZSB0aW1lci4KKyAgICAgICAgICAgICAgICAvLyBMb2cgZXJyb3IKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoInVuYWJsZSB0byBkZWFjdGl2YXRlIGF1dGggcmVzcG9uc2UgdGltZXIiKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIENoYW5nZSB0aW1lciB0byByZWFjdGl2YXRlIGl0IGluIGZ1dHVyZQorCisgICAgICAgICAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19BVVRIRU5USUNBVEVfUlNQX1RJTUVPVVQsICZ2YWwpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAgICAgKiBDb3VsZCBub3QgZ2V0IGF1dGggcnNwIHRpbWVvdXQgdmFsdWUKKyAgICAgICAgICAgICAgICAgKiBmcm9tIENGRy4gTG9nIGVycm9yLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgYXV0aCByZXNwb25zZSB0aW1lb3V0IHZhbHVlIikpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB2YWwgPSBTWVNfTVNfVE9fVElDS1ModmFsKTsKKworICAgICAgICAgICAgaWYgKHR4X3RpbWVyX2NoYW5nZSgmcEF1dGhOb2RlLT50aW1lciwgdmFsLCAwKSAhPSBUWF9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIENvdWxkIG5vdCBjaGFuZ2UgYXV0aCByc3AgdGltZXIuCisgICAgICAgICAgICAgICAgLy8gTG9nIGVycm9yCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJ1bmFibGUgdG8gY2hhbmdlIGF1dGggcnNwIHRpbWVyIikpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAvLyBJbnZhbGlkIHRpbWVySWQuIExvZyBlcnJvcgorICAgICAgICAgICAgYnJlYWs7CisKKyAgICB9Cit9CisKKworLyoqCisgKiBsaW1BY3RpdmF0ZUNuZlRpbWVyKCkKKyAqCisgKkZVTkNUSU9OOgorICogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgdG8gYWN0aXZhdGUgYSBwZXIgU1RBIHRpbWVyCisgKgorICpMT0dJQzoKKyAqCisgKkFTU1VNUFRJT05TOgorICogTkEKKyAqCisgKk5PVEU6CisgKiBOQQorICoKKyAqIEBwYXJhbSAgcE1hYyAgICAtIFBvaW50ZXIgdG8gR2xvYmFsIE1BQyBzdHJ1Y3R1cmUKKyAqIEBwYXJhbSAgU3RhSWQgICAtIHN0YUlkCisgKgorICogQHJldHVybiBOb25lCisgKi8KKwordm9pZCBsaW1BY3RpdmF0ZUNuZlRpbWVyKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTE2IHN0YUlkLCB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KQoreworICAgIHBNYWMtPmxpbS5saW1UaW1lcnMuZ3BMaW1DbmZXYWl0VGltZXJbc3RhSWRdLnNlc3Npb25JZCA9IHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkOworICAgIGlmICh0eF90aW1lcl9hY3RpdmF0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5ncExpbUNuZldhaXRUaW1lcltzdGFJZF0pCisgICAgICAgICAgICAgICAgIT0gVFhfU1VDQ0VTUykKKyAgICB7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgRkwoImNvdWxkIG5vdCBhY3RpdmF0ZSBjbmYgd2Fpd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uaVNpckdsb2JhbClwTWFjR2xvYmFsOworCisgICAgbXNnLnR5cGUgPSBTSVJfTElNX0tFRVBBTElWRV9USU1FT1VUOworICAgIG1zZy5ib2R5dmFsID0gKHRBTklfVTMyKXBhcmFtOworICAgIG1zZy5ib2R5cHRyID0gTlVMTDsKKworICAgIGlmICgoc3RhdHVzQ29kZSA9IGxpbVBvc3RNc2dBcGkocE1hYywgJm1zZykpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICBGTCgicG9zdGluZyB0byBMSU0gZmFpbGVkLCByZWFzb249JWQiKSwgc3RhdHVzQ29kZSk7CisKK30KKwordm9pZAorbGltQ2hhbm5lbFN3aXRjaFRpbWVySGFuZGxlcih2b2lkICpwTWFjR2xvYmFsLCB0QU5JX1UzMiBwYXJhbSkKK3sKKyAgICB0U2lyTXNnUSAgICBtc2c7CisgICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9ICh0cEFuaVNpckdsb2JhbClwTWFjR2xvYmFsOworCisgICAgbGltTG9nKHBNYWMsIExPRzEsCisgICAgICAgIEZMKCJDaGFubmVsU3dpdGNoIFRpbWVyIGV4cGlyZWQuICBQb3N0aW5nIG1zZyB0byBMSU0gIikpOworCisgICAgbXNnLnR5cGUgPSBTSVJfTElNX0NIQU5ORUxfU1dJVENIX1RJTUVPVVQ7CisgICAgbXNnLmJvZHl2YWwgPSAodEFOSV9VMzIpcGFyYW07CisgICAgbXNnLmJvZHlwdHIgPSBOVUxMOworCisgICAgbGltUG9zdE1zZ0FwaShwTWFjLCAmbXNnKTsKK30KKwordm9pZAorbGltUXVpZXRUaW1lckhhbmRsZXIodm9pZCAqcE1hY0dsb2JhbCwgdEFOSV9VMzIgcGFyYW0pCit7CisgICAgdFNpck1zZ1EgICAgbXNnOworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSAodHBBbmlTaXJHbG9iYWwpcE1hY0dsb2JhbDsKKworICAgIG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SSU5HKGVMSU1fUVVJRVRfVElNRVIpOworICAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoZUxJTV9RVUlFVF9CU1NfVElNRVIpOworICAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoZUxJTV9XUFNfT1ZFUkxBUF9USU1FUik7CisjaWZkZWYgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIKKyAgICAgICAgQ0FTRV9SRVRVUk5fU1RSSU5HKGVMSU1fRlRfUFJFQVVUSF9SU1BfVElNRVIpOworI2VuZGlmCisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhlTElNX1BFUklPRElDX1BST0JFX1JFUV9USU1FUik7CisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRQorICAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoZUxJTV9UU01fVElNRVIpOworI2VuZGlmCisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhlTElNX0RJU0FTU09DX0FDS19USU1FUik7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhlTElNX0RFQVVUSF9BQ0tfVElNRVIpOworICAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoZUxJTV9QRVJJT0RJQ19KT0lOX1BST0JFX1JFUV9USU1FUik7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhlTElNX0lOU0VSVF9TSU5HTEVTSE9UX05PQV9USU1FUik7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhlTElNX0NPTlZFUlRfQUNUSVZFX0NIQU5ORUxfVE9fUEFTU0lWRSk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhlTElNX0FVVEhfUkVUUllfVElNRVIpOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgcmV0dXJuKCAiVU5LTk9XTiIgKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgIH0KK30KKworCitzdGF0aWMgdEFOSV9VOCogX19saW1UcmFjZUdldE1nbXREcm9wUmVhc29uU3RyaW5nKCB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gIlJlYXNzb2NpYXRpb24gcmVxdWVzdCIsCisgICAgICAgICJSZWFzc29jaWF0aW9uIHJlc3BvbnNlIiwKKyAgICAgICAgIlByb2JlIHJlcXVlc3QiLAorICAgICAgICAiUHJvYmUgcmVzcG9uc2UiLAorICAgICAgICBOVUxMLAorICAgICAgICBOVUxMLAorICAgICAgICAiQmVhY29uIiwKKyAgICAgICAgIkFUSU0iLAorICAgICAgICAiRGlzYXNzb2NhdGlvbiIsCisgICAgICAgICJBdXRoZW50aWNhdGlvbiIsCisgICAgICAgICJEZWF1dGhlbnRpY2F0aW9uIiwKKyAgICAgICAgIkFjdGlvbiIKKyAgICB9OworCisKKyAgICBzd2l0Y2ggKHBSZWNvcmQtPmNvZGUpIHsKKyAgICAgICAgY2FzZSBUUkFDRV9DT0RFX01MTV9TVEFURToKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCAiJTA0ZCAlMDEydSBTJWQgJS0xNHMgICUtMzBzKDB4JXgpIiwKKyAgICAgICAgICAgICAgIHJlY0luZGV4LCBwUmVjb3JkLT50aW1lLCBwUmVjb3JkLT5zZXNzaW9uLAorICAgICAgICAgICAgICAgIk1MTSBTdGF0ZToiLAorICAgICAgICAgICAgICAgbGltVHJhY2VHZXRNbG1TdGF0ZVN0cmluZygodEFOSV9VMTYpcFJlY29yZC0+ZGF0YSksCisgICAgICAgICAgICAgICBwUmVjb3JkLT5kYXRhKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFRSQUNFX0NPREVfU01FX1NUQVRFOgorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsICIlMDRkICUwMTJ1IFMlZCAlLTE0cyAlLTMwcygweCV4KSIsCisgICAgICAgICAgICAgICByZWNJbmRleCwgcFJlY29yZC0+dGltZSwgcFJlY29yZC0+c2Vzc2lvbiwKKyAgICAgICAgICAgICAgICJTTUUgU3RhdGU6IiwKKyAgICAgICAgICAgICAgIGxpbVRyYWNlR2V0U21lU3RhdGVTdHJpbmcoKHRBTklfVTE2KXBSZWNvcmQtPmRhdGEpLAorICAgICAgICAgICAgICAgcFJlY29yZC0+ZGF0YSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBUUkFDRV9DT0RFX1RYX01HTVQ6CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgIiUwNGQgJTAxMnUgUyVkICUtMTRzICUtMzBzKDB4JXgpIiwKKyAgICAgICAgICAgICAgIHJlY0luZGV4LCBwUmVjb3JkLT50aW1lLCBwUmVjb3JkLT5zZXNzaW9uLAorICAgICAgICAgICAgICAgIlRYIE1nbXQ6IiwgZnJhbWVTdWJ0eXBlU3RyW3BSZWNvcmQtPmRhdGFdLCBwUmVjb3JkLT5kYXRhKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgVFJBQ0VfQ09ERV9SWF9NR01UOgorICAgICAgICAgICAgaWYgKExJTV9UUkFDRV9NQVhfU1VCVFlQRVMgPD0gTElNX1RSQUNFX0dFVF9TVUJUWVBFKHBSZWNvcmQtPmRhdGEpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCAiV3JvbmcgU3VidHlwZSAtICVkIiwKKyAgICAgICAgICAgICAgICAgICAgTElNX1RSQUNFX0dFVF9TVUJUWVBFKHBSZWNvcmQtPmRhdGEpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywKKyAgICAgICAgICAgICAgICAgICAgTE9HMSwgIiUwNGQgJTAxMnUgUyVkICUtMTRzICUtMzBzKCVkKSBTTjogJWQgIiwKKyAgICAgICAgICAgICAgICAgICAgcmVjSW5kZXgsIHBSZWNvcmQtPnRpbWUsIHBSZWNvcmQtPnNlc3Npb24sCisgICAgICAgICAgICAgICAgICAgICJSWCBNZ210OiIsCisgICAgICAgICAgICAgICAgICAgIGZyYW1lU3VidHlwZVN0cltMSU1fVFJBQ0VfR0VUX1NVQlRZUEUocFJlY29yZC0+ZGF0YSldLAorICAgICAgICAgICAgICAgICAgICBMSU1fVFJBQ0VfR0VUX1NVQlRZUEUocFJlY29yZC0+ZGF0YSksCisgICAgICAgICAgICAgICAgICAgIExJTV9UUkFDRV9HRVRfU1NOKHBSZWNvcmQtPmRhdGEpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFRSQUNFX0NPREVfUlhfTUdNVF9EUk9QOgorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsICIlMDRkICUwMTJ1IFMlZCAlLTE0cyAlLTMwcyglZCkiLAorICAgICAgICAgICAgICAgICAgIHJlY0luZGV4LCBwUmVjb3JkLT50aW1lLCBwUmVjb3JkLT5zZXNzaW9uLAorICAgICAgICAgICAgICAgICAgICJEcm9wIFJYIE1nbXQ6IiwKKyAgICAgICAgICAgICAgICAgICBfX2xpbVRyYWNlR2V0TWdtdERyb3BSZWFzb25TdHJpbmcoKHRBTklfVTE2KXBSZWNvcmQtPmRhdGEpLAorICAgICAgICAgICAgICAgICAgIHBSZWNvcmQtPmRhdGEpOworICAgICAgICAgICAgYnJlYWs7CisKKworICAgICAgICBjYXNlIFRSQUNFX0NPREVfUlhfTUdNVF9UU0Y6CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgIiUwNGQgJTAxMnUgUyVkICUtMTRzICUtMzBzMHgleCglZCkiLAorICAgICAgICAgICAgICAgICAgIHJlY0luZGV4LCBwUmVjb3JkLT50aW1lLCBwUmVjb3JkLT5zZXNzaW9uLAorICAgICAgICAgICAgICAgICAgICJSWCBNZ210IFRTRjoiLCAiICIsIHBSZWNvcmQtPmRhdGEsIHBSZWNvcmQtPmRhdGEpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBUUkFDRV9DT0RFX1RYX0NPTVBMRVRFOgorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsICIlMDRkICUwMTJ1IFMlZCAlLTE0cyAgJWQiLAorICAgICAgICAgICAgICAgICAgIHJlY0luZGV4LCBwUmVjb3JkLT50aW1lLCBwUmVjb3JkLT5zZXNzaW9uLAorICAgICAgICAgICAgICAgICAgICJUWCBDb21wbGV0ZSIsIHBSZWNvcmQtPmRhdGEpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBUUkFDRV9DT0RFX1RYX1NNRV9NU0c6CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgIiUwNGQgJTAxMnUgUyVkICUtMTRzICUtMzBzKDB4JXgpIiwKKyAgICAgICAgICAgICAgICAgICByZWNJbmRleCwgcFJlY29yZC0+dGltZSwgcFJlY29yZC0+c2Vzc2lvbiwKKyAgICAgICAgICAgICAgICAgICAiVFggU01FIE1zZzoiLAorICAgICAgICAgICAgICAgICAgIG1hY1RyYWNlR2V0U21lTXNnU3RyaW5nKCh0QU5JX1UxNilwUmVjb3JkLT5kYXRhKSwKKyAgICAgICAgICAgICAgICAgICBwUmVjb3JkLT5kYXRhICk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBUUkFDRV9DT0RFX1JYX1NNRV9NU0c6CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgIiUwNGQgJTAxMnUgUyVkICUtMTRzICUtMzBzKDB4JXgpIiwKKyAgICAgICAgICAgICAgICAgICByZWNJbmRleCwgcFJlY29yZC0+dGltZSwgcFJlY29yZC0+c2Vzc2lvbiwKKyAgICAgICAgICAgICAgICAgICBMSU1fVFJBQ0VfR0VUX0RFRlJEX09SX0RST1BQRUQocFJlY29yZC0+ZGF0YSkKKyAgICAgICAgICAgICAgICAgICA/ICJEZWYvRHJwIExJTSBNc2c6IjogIlJYIFNtZSBNc2c6IiwKKyAgICAgICAgICAgICAgICAgICBtYWNUcmFjZUdldFNtZU1zZ1N0cmluZygodEFOSV9VMTYpcFJlY29yZC0+ZGF0YSksCisgICAgICAgICAgICAgICAgICAgcFJlY29yZC0+ZGF0YSk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFRSQUNFX0NPREVfVFhfV0RBX01TRzoKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCAiJTA0ZCAlMDEydSBTJWQgJS0xNHMgJS0zMHMoMHgleCkiLAorICAgICAgICAgICAgICAgICAgIHJlY0luZGV4LCBwUmVjb3JkLT50aW1lLCBwUmVjb3JkLT5zZXNzaW9uLAorICAgICAgICAgICAgICAgICAgICJUWCBXREEgTXNnOiIsCisgICAgICAgICAgICAgICAgICAgbWFjVHJhY2VHZXRXZGFNc2dTdHJpbmcoKHRBTklfVTE2KXBSZWNvcmQtPmRhdGEpLAorICAgICAgICAgICAgICAgICAgIHBSZWNvcmQtPmRhdGEpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBUUkFDRV9DT0RFX1JYX1dEQV9NU0c6CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgIiUwNGQgJTAxMnUgUyVkICUtMTRzICUtMzBzKDB4JXgpIiwKKyAgICAgICAgICAgICAgICAgICByZWNJbmRleCwgcFJlY29yZC0+dGltZSwgcFJlY29yZC0+c2Vzc2lvbiwKKyAgICAgICAgICAgICAgICAgICBMSU1fVFJBQ0VfR0VUX0RFRlJEX09SX0RST1BQRUQocFJlY29yZC0+ZGF0YSkKKyAgICAgICAgICAgICAgICAgICA/ICJEZWYvRHJwIExJTSBNc2c6IjogIlJYIFdEQSBNc2c6IiwKKyAgICAgICAgICAgICAgICAgICBtYWNUcmFjZUdldFdkYU1zZ1N0cmluZygodEFOSV9VMTYpcFJlY29yZC0+ZGF0YSksCisgICAgICAgICAgICAgICAgICAgcFJlY29yZC0+ZGF0YSApOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBUUkFDRV9DT0RFX1RYX0xJTV9NU0c6CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgIiUwNGQgJTAxMnUgUyVkICUtMTRzICUtMzBzKDB4JXgpIiwKKyAgICAgICAgICAgICAgICAgICByZWNJbmRleCwgcFJlY29yZC0+dGltZSwgcFJlY29yZC0+c2Vzc2lvbiwKKyAgICAgICAgICAgICAgICAgICAiVFggTElNIE1zZzoiLAorICAgICAgICAgICAgICAgICAgIG1hY1RyYWNlR2V0TGltTXNnU3RyaW5nKCh0QU5JX1UxNilwUmVjb3JkLT5kYXRhKSwKKyAgICAgICAgICAgICAgICAgICBwUmVjb3JkLT5kYXRhKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFRSQUNFX0NPREVfUlhfTElNX01TRzoKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCAiJTA0ZCAlMDEydSBTJWQgJS0xNHMgJS0zMHMoMHgleCkiLAorICAgICAgICAgICAgICAgICAgIHJlY0luZGV4LCBwUmVjb3JkLT50aW1lLCBwUmVjb3JkLT5zZXNzaW9uLAorICAgICAgICAgICAgICAgICAgIExJTV9UUkFDRV9HRVRfREVGUkRfT1JfRFJPUFBFRChwUmVjb3JkLT5kYXRhKQorICAgICAgICAgICAgICAgICAgID8gIkRlZi9EcnAgTElNIE1zZzoiOiAiUlggTElNIE1zZyIsCisgICAgICAgICAgICAgICAgICAgbWFjVHJhY2VHZXRMaW1Nc2dTdHJpbmcoKHRBTklfVTE2KXBSZWNvcmQtPmRhdGEpLAorICAgICAgICAgICAgICAgICAgIHBSZWNvcmQtPmRhdGEgKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFRSQUNFX0NPREVfVFhfQ0ZHX01TRzoKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCAiJTA0ZCAlMDEydSBTJWQgJS0xNHMgJS0zMHMoMHgleCkiLAorICAgICAgICAgICAgICAgICAgIHJlY0luZGV4LCBwUmVjb3JkLT50aW1lLCBwUmVjb3JkLT5zZXNzaW9uLAorICAgICAgICAgICAgICAgICAgICJUWCBDRkcgTXNnOiIsCisgICAgICAgICAgICAgICAgICAgbWFjVHJhY2VHZXRDZmdNc2dTdHJpbmcoKHRBTklfVTE2KXBSZWNvcmQtPmRhdGEpLAorICAgICAgICAgICAgICAgICAgIHBSZWNvcmQtPmRhdGEpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgVFJBQ0VfQ09ERV9SWF9DRkdfTVNHOgorICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsICIlMDRkICUwMTJ1IFMlZCAlLTE0cyAlLTMwcygweCV4KSIsCisgICAgICAgICAgICAgICAgICAgcmVjSW5kZXgsIHBSZWNvcmQtPnRpbWUsIHBSZWNvcmQtPnNlc3Npb24sCisgICAgICAgICAgICAgICAgICAgTElNX1RSQUNFX0dFVF9ERUZSRF9PUl9EUk9QUEVEKHBSZWNvcmQtPmRhdGEpCisgICAgICAgICAgICAgICAgICAgPyAiRGVmL0RycCBMSU0gTXNnOiI6ICJSWCBDRkcgTXNnOiIsCisgICAgICAgICAgICAgICAgICAgbWFjVHJhY2VHZXRDZmdNc2dTdHJpbmcKKyAgICAgICAgICAgICAgICAgICAoKHRBTklfVTE2KU1BQ19UUkFDRV9HRVRfTVNHX0lEKHBSZWNvcmQtPmRhdGEpKSwKKyAgICAgICAgICAgICAgICAgICBwUmVjb3JkLT5kYXRhKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgVFJBQ0VfQ09ERV9USU1FUl9BQ1RJVkFURToKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCAiJTA0ZCAlMDEydSBTJWQgJS0xNHMgJS0zMHMoMHgleCkiLAorICAgICAgICAgICAgICAgICAgIHJlY0luZGV4LCBwUmVjb3JkLT50aW1lLCBwUmVjb3JkLT5zZXNzaW9uLAorICAgICAgICAgICAgICAgICAgICJUaW1lciBBY3R2dGQiLAorICAgICAgICAgICAgICAgICAgIF9fbGltVHJhY2VHZXRUaW1lclN0cmluZygodEFOSV9VMTYpcFJlY29yZC0+ZGF0YSksCisgICAgICAgICAgICAgICAgICAgcFJlY29yZC0+ZGF0YSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBUUkFDRV9DT0RFX1RJTUVSX0RFQUNUSVZBVEU6CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgIiUwNGQgJTAxMnUgUyVkICUtMTRzICUtMzBzKDB4JXgpIiwKKyAgICAgICAgICAgICAgICAgIHJlY0luZGV4LCBwUmVjb3JkLT50aW1lLCBwUmVjb3JkLT5zZXNzaW9uLAorICAgICAgICAgICAgICAgICAgIlRpbWVyIERlQWN0dnRkIiwKKyAgICAgICAgICAgICAgICAgIF9fbGltVHJhY2VHZXRUaW1lclN0cmluZygodEFOSV9VMTYpcFJlY29yZC0+ZGF0YSksCisgICAgICAgICAgICAgICAgICBwUmVjb3JkLT5kYXRhKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgVFJBQ0VfQ09ERV9JTkZPX0xPRzoKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCAiJTA0ZCAlMDEydSBTJWQgJS0xNHMgJS0zMHMoMHgleCkiLAorICAgICAgICAgICAgICAgICAgcmVjSW5kZXgsIHBSZWNvcmQtPnRpbWUsIHBSZWNvcmQtPnNlc3Npb24sCisgICAgICAgICAgICAgICAgICAiSU5GT1JNQVRJT05fTE9HIiwKKyAgICAgICAgICAgICAgICAgIG1hY1RyYWNlR2V0SW5mb0xvZ1N0cmluZygodEFOSV9VMTYpcFJlY29yZC0+ZGF0YSksCisgICAgICAgICAgICAgICAgICBwUmVjb3JkLT5kYXRhKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0IDoKKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCAiJTA0ZCAlMDEydSBTJWQgJS0xNHMoJWQpICgweCV4KSIsCisgICAgICAgICAgICAgICAgICByZWNJbmRleCwgcFJlY29yZC0+dGltZSwgcFJlY29yZC0+c2Vzc2lvbiwKKyAgICAgICAgICAgICAgICAgICJVbmtub3duIENvZGUiLCBwUmVjb3JkLT5jb2RlLCBwUmVjb3JkLT5kYXRhKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgIH0KK30KKworCit2b2lkIG1hY1RyYWNlTXNnVHgodHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VOCBzZXNzaW9uLCB0QU5JX1UzMiBkYXRhKQoreworCisgICAgdEFOSV9VMTYgbXNnSWQgPSAodEFOSV9VMTYpTUFDX1RSQUNFX0dFVF9NU0dfSUQoZGF0YSk7CisgICAgdEFOSV9VOCBtb2R1bGVJZCA9ICh0QU5JX1U4KU1BQ19UUkFDRV9HRVRfTU9EVUxFX0lEKGRhdGEpOworCisgICAgc3dpdGNoKG1vZHVsZUlkKQorICAgIHsKKyAgICAgICAgY2FzZSBTSVJfTElNX01PRFVMRV9JRDoKKyAgICAgICAgICAgIGlmKG1zZ0lkID49IFNJUl9MSU1fSVRDX01TR19UWVBFU19CRUdJTikKKyAgICAgICAgICAgICAgICBtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RYX0xJTV9NU0csIHNlc3Npb24sIGRhdGEpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfVFhfU01FX01TRywgc2Vzc2lvbiwgZGF0YSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTSVJfV0RBX01PRFVMRV9JRDoKKyAgICAgICAgICAgIG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfVFhfV0RBX01TRywgc2Vzc2lvbiwgZGF0YSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTSVJfQ0ZHX01PRFVMRV9JRDoKKyAgICAgICAgICAgIG1hY1RyYWNlK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gICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9DRkdfTU9EVUxFX0lEOgorICAgICAgICAgICAgbWFjVHJhY2VOZXcocE1hYywgbW9kdWxlLCBUUkFDRV9DT0RFX1RYX0NGR19NU0csIHNlc3Npb24sIGRhdGEpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBtYWNUcmFjZShwTWFjLCBtb2R1bGVJZCwgc2Vzc2lvbiwgZGF0YSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorfQorCisvKgorKiBiaXQzMTogUnggbWVzc2FnZSBkZWZmZXJyZWQgb3Igbm90CisqIGJpdCAwLTE1OiBtZXNzYWdlIElEOgorKi8KK3ZvaWQgbWFjVHJhY2VNc2dSeCh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4IHNlc3Npb24sIHRBTklfVTMyIGRhdGEpCit7CisgICAgdEFOSV9VMTYgbXNnSWQgPSAodEFOSV9VMTYpTUFDX1RSQUNFX0dFVF9NU0dfSUQoZGF0YSk7CisgICAgdEFOSV9VOCBtb2R1bGVJZCA9ICh0QU5JX1U4KU1BQ19UUkFDRV9HRVRfTU9EVUxFX0lEKGRhdGEpOworCisKKyAgICBzd2l0Y2gobW9kdWxlSWQpCisgICAgeworICAgICAgICBjYXNlIFNJUl9MSU1fTU9EVUxFX0lEOgorICAgICAgICAgICAgaWYobXNnSWQgPj0gU0lSX0xJTV9JVENfTVNHX1RZUEVTX0JFR0lOKQorICAgICAgICAgICAgICAgIG1hY1RyYWNlKHBNYWMsIFRSQUNFX0NPREVfUlhfTElNX01TRywgc2Vzc2lvbiwgZGF0YSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgbWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9SWF9TTUVfTVNHLCBzZXNzaW9uLCBkYXRhKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9XREFf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0dfU1RBUlQgICAgICAgICAgIDEwMDAKKyNkZWZpbmUgTElNX01MTV9TQ0FOX1JFUSAgICAgICAgICAgIExJTV9NTE1fTVNHX1NUQVJUCisjZGVmaW5lIExJTV9NTE1fU0NBTl9DTkYgICAgICAgICAgICAoTElNX01MTV9NU0dfU1RBUlQgKyAxKQorI2RlZmluZSBMSU1fTUxNX1NUQVJUX1JFUSAgICAgICAgICAgKExJTV9NTE1fTVNHX1NUQVJUICsgMikKKyNkZWZpbmUgTElNX01MTV9TVEFSVF9DTkYgICAgICAgICAgIChMSU1fTUxNX01TR19TVEFSVCArIDMpCisjZGVmaW5lIExJTV9NTE1fSk9JTl9SRVEgICAgICAgICAgICAoTElNX01MTV9NU0dfU1RBUlQgKyA0KQorI2RlZmluZSBMSU1fTUxNX0pPSU5fQ05GICAgICAgICAgICAgKExJTV9NTE1fTVNHX1NUQVJUICsgNSkKKyNkZWZpbmUgTElNX01MTV9BVVRIX1JFUSAgICAgICAgICAgIChMSU1fTUxNX01TR19TVEFSVCArIDYpCisjZGVmaW5lIExJTV9NTE1fQVVUSF9DTkYgICAgICAgICAgICAoTElNX01MTV9NU0dfU1RBUlQgKyA3KQorI2RlZmluZSBMSU1fTUxNX0FVVEhfSU5EICAgICAgICAgICAgKExJTV9NTE1fTVNHX1NUQVJUICsgOCkKKyNkZWZpbmUgTElNX01MTV9BU1NPQ19SRVEgICAgICAgICAgIChMSU1fTUxNX01TR19TVEFSVCArIDkpCisjZGVmaW5lIExJTV9NTE1fQVNTT0NfQ05GICAgICAgICAgICAoTElNX01MTV9NU0dfU1RBUlQgKyAxMCkKKyNkZWZpbmUgTElNX01MTV9BU1NPQ19JTkQgICAgICAgICAgIChMSU1fTUxNX01TR19TVEFSVCArIDExKQorI2RlZmluZSBMSU1fTUxNX0RJU0FTU09DX1JFUSAgICAgICAgKExJTV9NTE1fTVNHX1NUQVJUICsgMTIpCisjZGVmaW5lIExJTV9NTE1fRElTQVNTT0NfQ05GICAgICAgICAoTElNX01MTV9NU0dfU1RBUlQgKyAxMykKKyNkZWZpbmUgTElNX01MTV9ESVNBU1NPQ19JTkQgICAgICAgIChMSU1fTUxNX01TR19TVEFSVCArIDE0KQorI2RlZmluZSBMSU1fTUxNX1JFQVNTT0NfUkVRICAgICAgICAgKExJTV9NTE1fTVNHX1NUQVJUICsgMTUpCisjZGVmaW5lIExJTV9NTE1fUkVBU1NPQ19DTkYgICAgICAgICAoTElNX01MTV9NU0dfU1RBUlQgKyAxNikKKyNkZWZpbmUgTElNX01MTV9SRUFTU09DX0lORCAgICAgICAgIChMSU1fTUxNX01TR19TVEFSVCArIDE3KQorI2RlZmluZSBMSU1fTUxNX0RFQVVUSF9SRVEgICAgICAgICAgKExJTV9NTE1fTVNHX1NUQVJUICsgMTgpCisjZGVmaW5lIExJTV9NTE1fREVBVVRIX0NORiAgICAgICAgICAoTElNX01MTV9NU0dfU1RBUlQgKyAxOSkKKyNkZWZpbmUgTElNX01MTV9ERUFVVEhfSU5EICAgICAgICAgIChMSU1fTUxNX01TR19TVEFSVCArIDIwKQorI2RlZmluZSBMSU1fTUxNX1RTUEVDX1JFUSAgICAgICAgICAgKExJTV9NTE1fTVNHX1NUQVJUICsgMjEpCisjZGVmaW5lIExJTV9NTE1fVFNQRUNfQ05GICAgICAgICAgICAoTElNX01MTV9NU0dfU1RBUlQgKyAyMikKKyNkZWZpbmUgTElNX01MTV9UU1BFQ19JTkQgICAgICAgICAgIChMSU1fTUxNX01TR19TVEFSVCArIDIzKQorI2RlZmluZSBMSU1fTUxNX1NFVEtFWVNfUkVRICAgICAgICAgKExJTV9NTE1fTVNHX1NUQVJUICsgMjQpCisjZGVmaW5lIExJTV9NTE1fU0VUS0VZU19DTkYgICAgICAgICAoTElNX01MTV9NU0dfU1RBUlQgKyAyNSkKKyNkZWZpbmUgTElNX01MTV9MSU5LX1RFU1RfU1RPUF9SRVEgIChMSU1fTUxNX01TR19TVEFSVCArIDMwKQorI2RlZmluZSBMSU1fTUxNX1BVUkdFX1NUQV9JTkQgICAgICAgKExJTV9NTE1fTVNHX1NUQVJUICsgMzEpCisjZGVmaW5lIExJTV9NTE1fQUREQkFfUkVRICAgICAgICAgICAoTElNX01MTV9NU0dfU1RBUlQgKyAzMikKKyNkZWZpbmUgTElNX01MTV9BRERCQV9DTkYgICAgICAgICAgIChMSU1fTUxNX01TR19TVEFSVCArIDMzKQorI2RlZmluZSBMSU1fTUxNX0FEREJBX0lORCAgICAgICAgICAgKExJTV9NTE1fTVNHX1NUQVJUICsgMzQpCisjZGVmaW5lIExJTV9NTE1fQUREQkFfUlNQICAgICAgICAgICAoTElNX01MTV9NU0dfU1RBUlQgKyAzNSkKKyNkZWZpbmUgTElNX01MTV9ERUxCQV9SRVEgICAgICAgICAgIChMSU1fTUxNX01TR19TVEFSVCArIDM2KQorI2RlZmluZSBMSU1fTUxNX0RFTEJBX0NORiAgICAgICAgICAgKExJTV9NTE1fTVNHX1NUQVJUICsgMzcpCisjZGVmaW5lIExJTV9NTE1fREVMQkFfSU5EICAgICAgICAgICAoTElNX01MTV9NU0dfU1RBUlQgKyAzOCkKKyNkZWZpbmUgTElNX01MTV9SRU1PVkVLRVlfUkVRICAoTElNX01MTV9NU0dfU1RBUlQgKyAzOSkKKyNkZWZpbmUgTElNX01MTV9SRU1PVkVLRVlfQ05GICAoTElNX01MTV9NU0dfU1RBUlQgKyA0MCkKKworI2lmZGVmIEZFQVRVUkVfT0VNX0RBVEFfU1VQUE9SVAorI2RlZmluZSBMSU1fTUxNX09FTV9EQVRBX1JFUSAgICAgICAgICAgIChMSU1fTUxNX01TR19TVEFSVCArIDQxKQorI2RlZmluZSBMSU1fTUxNX09FTV9EQVRBX0NORiAgICAgICAgICAgIChMSU1fTUxNX01TR19TVEFSVCArIDQyKQorI2VuZGlmCisKKyNkZWZpbmUgTElNX0hBU0hfQUREICAgICAgICAgICAgMAorI2RlZmluZSBMSU1fSEFTSF9VUERBVEUgICAgICAgICAxCisKKyNkZWZpbmUgTElNX1dFUF9JTl9GQyAgICAgICAgICAgMQorI2RlZmluZSBMSU1fTk9fV0VQX0lOX0ZDICAgICAgICAwCisKKyNkZWZpbmUgTElNX0RFQ1JZUFRfSUNWX0ZBSUwgICAgMQorCisvLy8gRGVmaW5pdGlvbnMgdG8gZGlzdGlucXVpc2ggYmV0d2VlbiBBc3NvY2lhdGlvbi9SZWFzc29jaWF0b24KKyNkZWZpbmUgTElNX0FTU09DICAgIDAKKyNkZWZpbmUgTElNX1JFQVNTT0MgIDEKKworLy8vIE1pbmltdW0gTWVtb3J5IGJsb2NrcyByZXF1aXJlIGZvciBkaWZmZXJlbnQgc2NlbmFyaW8KKyNkZWZpbmUgTElNX01JTl9NRU1fQVNTT0MgICAgICAgNAorCisvLy8gVmVyaWZpZXMgd2hldGhlciBnaXZlbiBtYWMgYWRkciBtYXRjaGVzIHRoZSBDVVJSRU5UIEJzc2lkCisjZGVmaW5lIElTX0NVUlJFTlRfQlNTSUQocE1hYywgYWRkcixwc2Vzc2lvbkVudHJ5KSAgKHZvc19tZW1fY29tcGFyZSggYWRkciwgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmJzc0lkLCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHBzZXNzaW9uRW50cnktPmJzc0lkKSkpCisvLy8gVmVyaWZpZXMgd2hldGhlciBnaXZlbiBhZGRyIG1hdGNoZXMgdGhlIFJFQVNTT0MgQnNzaWQKKyNkZWZpbmUgSVNfUkVBU1NPQ19CU1NJRChwTWFjLCBhZGRyLHBzZXNzaW9uRW50cnkpICAodm9zX21lbV9jb21wYXJlKCBhZGRyLCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+bGltUmVBc3NvY2Jzc0lkLCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHBzZXNzaW9uRW50cnktPmxpbVJlQXNzb2Nic3NJZCkpKQorCisjZGVmaW5lIFJFUV9UWVBFX1JFR0lTVFJBUiAgICAgICAgICAgICAgICAgICAoMHgyKQorI2RlZmluZSBSRVFfVFlQRV9XTEFOX01BTkFHRVJfUkVHSVNUUkFSICAgICAgKDB4MykKKworI2RlZmluZSBSRVNQX1RZUEVfUkVHSVNUUkFSICAgICAgICAgICAgICAgICAgKDB4MikKKyNkZWZpbmUgUkVTUF9UWVBFX0VOUk9MTEVFX0lORk9fT05MWSAgICAgICAgICgweDApCisjZGVmaW5lIFJFU1BfVFlQRV9FTlJPTExFRV9PUEVOXzgwMjFYICAgICAgICAoMHgxKQorI2RlZmluZSBSRVNQX1RZUEVfQVAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MykKKyNkZWZpbmUgTElNX1RYX0ZSQU1FU19USFJFU0hPTERfT05fQ0hJUCAgICAgICAzMDAKKworCisvLyBlbnVtcyB1c2VkIGJ5IExJTSBhcmUgYXMgZm9sbG93cworCitlbnVtIGVMaW1EaXNhc3NvY1RyaWdnZXIKK3sKKyAgICBlTElNX0hPU1RfRElTQVNTT0MsCisgICAgZUxJTV9QRUVSX0VOVElUWV9ESVNBU1NPQywKKyAgICBlTElNX0xJTktfTU9OSVRPUklOR19ESVNBU1NPQywKKyAgICBlTElNX1BST01JU0NVT1VTX01PREVfRElTQVNTT0MsCisgICAgZUxJTV9IT1NUX0RFQVVUSCwKKyAgICBlTElNX1BFRVJfRU5USVRZX0RFQVVUSCwKKyAgICBlTElNX0xJTktfTU9OSVRPUklOR19ERUFVVEgsCisgICAgZUxJTV9KT0lOX0ZBSUxVUkUsCisgICAgZUxJTV9SRUFTU09DX1JFSkVDVAorfTsKKworLyogUmVhc29uIGNvZGUg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ICAgICAgICAgc2Vzc2lvbklkOyAvL0FkZGVkIEZvciBCVC1BTVAgU3VwcG9ydCAgIAorCisgICAgLy8gUGFyYW1ldGVycyByZXFkIGZvciBuZXcgSEFMIChtZXNzYWdlKSBpbnRlcmZhY2UKKyAgICB0U2lyTndUeXBlICAgICAgICAgICAgbndUeXBlOworICAgIHRBTklfVTggICAgICAgICAgICAgICBodENhcGFibGU7CisgICAgdFNpck1hY0hUT3BlcmF0aW5nTW9kZSAgICAgaHRPcGVyTW9kZTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICBkdWFsQ1RTUHJvdGVjdGlvbjsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICB0eENoYW5uZWxXaWR0aFNldDsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICBzc2lkSGlkZGVuOworICAgIHRBTklfVTggICAgICAgICAgICAgIHdwc19zdGF0ZTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICBvYnNzUHJvdEVuYWJsZWQ7Cit9IHRMaW1NbG1TdGFydFJlcSwgKnRwTGltTWxtU3RhcnRSZXE7CisKK3R5cGVkZWYgc3RydWN0IHNMaW1NbG1TdGFydENuZgoreworICAgIHRTaXJSZXN1bHRDb2RlcyByZXN1bHRDb2RlOworICAgIHRBTklfVTggICAgICAgICBzZXNzaW9uSWQ7Cit9IHRMaW1NbG1TdGFydENuZiwgKnRwTGltTWxtU3RhcnRDbmY7CisKK3R5cGVkZWYgc3RydWN0IHNMaW1NbG1TY2FuQ25mCit7CisgICAgdFNpclJlc3VsdENvZGVzICAgICAgICAgcmVzdWx0Q29kZTsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgICBzY2FuUmVzdWx0TGVuZ3RoOworICAgIHRTaXJCc3NEZXNjcmlwdGlvbiAgICAgIGJzc0Rlc2NyaXB0aW9uWzFdOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgIHNlc3Npb25JZDsKK30gdExpbU1sbVNjYW5DbmYsICp0c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kZWYgc3RydWN0IHNMaW1NbG1Bc3NvY0luZAoreworICAgIHRTaXJNYWNBZGRyICAgICAgICAgIHBlZXJNYWNBZGRyOworICAgIHRBTklfVTE2ICAgICAgICAgICAgICAgICAgYWlkOworICAgIHRBbmlBdXRoVHlwZSAgICAgICAgIGF1dGhUeXBlOworICAgIHRBbmlTU0lEICAgICAgICAgICAgIHNzSWQ7CisgICAgdFNpclJTTmllICAgICAgICAgICAgcnNuSUU7CisgICAgdFNpckFkZGllICAgICAgICAgICAgYWRkSUU7IC8vIGFkZGl0aW9uYWwgSUUgcmVjZWl2ZWQgZnJvbSB0aGUgcGVlciwgd2hpY2ggcG9zc2libHkgaW5jbHVkZXMgV1NDIElFIGFuZC9vciBQMlAgSUUuCisgICAgdFNpck1hY0NhcGFiaWxpdHlJbmZvIGNhcGFiaWxpdHlJbmZvOworICAgIHRBbmlCb29sICAgICAgICAgICAgICAgIHNwZWN0cnVtTWd0SW5kaWNhdG9yOworICAgIHRTaXJNYWNQb3dlckNhcEluZm8gICAgIHBvd2VyQ2FwOworICAgIHRTaXJTdXBDaG5sICAgICAgICAgICAgIHN1cHBvcnRlZENoYW5uZWxzOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgIHNlc3Npb25JZDsKKworCisgICAgdEFuaUJvb2wgICAgICAgICAgICAgICBXbW1TdGFJbmZvUHJlc2VudDsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfQVBfSFQ0MF8yNEcKKyAgICB0QW5pQm9vbCAgICAgICAgICAgICAgIEhUNDBNSHpJbnRvUHJlc2VudDsKKyNlbmRpZgorCisgICAgLy8gUmVxdWlyZWQgZm9yIGluZGljYXRpbmcgdGhlIGZyYW1lcyB0byB1cHBlciBsYXllcgorICAgIHRBTklfVTMyICAgICAgICAgICAgIGJlYWNvbkxlbmd0aDsKKyAgICB0QU5JX1U4KiAgICAgICAgICAgICBiZWFjb25QdHI7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgYXNzb2NSZXFMZW5ndGg7CisgICAgdEFOSV9VOCogICAgICAgICAgICAgYXNzb2NSZXFQdHI7ICAgIAorfSB0TGltTWxtQXNzb2NJbmQsICp0cExpbU1sbUFzc29jSW5kOworCit0eXBlZGVmIHN0cnVjdCBzTGltTWxtUmVhc3NvY1JlcQoreworICAgIHRTaXJNYWNBZGRyICAgICAgICAgICBwZWVyTWFjQWRkcjsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICAgICByZWFzc29jRmFpbHVyZVRpbWVvdXQ7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgICAgY2FwYWJpbGl0eUluZm87CisgICAgdFNpck1hY0xpc3RlbkludGVydmFsIGxpc3RlbkludGVydmFsOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgc2Vzc2lvbklkOyAKK30gdExpbU1sbVJlYXNzb2NSZXEsICp0cExpbU1sbVJlYXNzb2NSZXE7CisKK3R5cGVkZWYgc3RydWN0IHNMaW1NbG1SZWFzc29jQ25mCit7CisgICAgdFNpclJlc3VsdENvZGVzIHJlc3VsdENvZGU7CisgICAgdEFOSV9VMTYgcHJvdFN0YXR1c0NvZGU7IC8vUHJvdG9jb2wgU3RhdHVzIGNvZGUuCisgICAgdEFOSV9VOCAgc2Vzc2lvbklkOworfSB0TGltTWxtUmVhc3NvY0NuZiwgKnRwTGltTWxtUmVhc3NvY0NuZjsKKwordHlwZWRlZiBzdHJ1Y3Qgc0xpbU1sbVJlYXNzb2NJbmQKK3sKKyAgICB0U2lyTWFjQWRkciAgICAgICAgICBwZWVyTWFjQWRkcjsKKyAgICB0U2lyTWFjQWRkciAgICAgICAgICBjdXJyZW50QXBBZGRyOworICAgIHRBTklfVTE2ICAgICAgICAgICAgIGFpZDsKKyAgICB0QW5pQXV0aFR5cGUgICAgICAgICBhdXRoVHlwZTsKKyAgICB0QW5pU1NJRCAgICAgICAgICAgICBzc0lkOworICAgIHRTaXJSU05pZSAgICAgICAgICAgIHJzbklFOworICAgIHRTaXJBZGRpZSAgICAgICAgICAgIGFkZElFOyAvLyBhZGRpdGlvbmFsIElFIHJlY2VpdmVkIGZyb20gdGhlIHBlZXIsIHdoaWNoIGNhbiBiZSBXU0MgSUUgYW5kL29yIFAyUCBJRS4KKyAgICB0U2lyTWFjQ2FwYWJpbGl0eUluZm8gY2FwYWJpbGl0eUluZm87CisgICAgdEFuaUJvb2wgICAgICAgICAgICAgICAgc3BlY3RydW1NZ3RJbmRpY2F0b3I7CisgICAgdFNpck1hY1Bvd2VyQ2FwSW5mbyAgICAgcG93ZXJDYXA7CisgICAgdFNpclN1cENobmwgICAgICAgICAgICAgc3VwcG9ydGVkQ2hhbm5lbHM7CisKKyAgICB0QW5pQm9vbCAgICAgICAgICAgICAgIFdtbVN0YUluZm9QcmVzZW50OworI2lmZGVmIFdMQU5fRkVBVFVSRV9BUF9IVDQwXzI0RworICAgIHRBbmlCb29sICAgICAgICAgICAgICAgSFQ0ME1IekludG9QcmVzZW50OworI2VuZGlmCisKKyAgICAvLyBSZXF1aXJlZCBmb3IgaW5kaWNhdGluZyB0aGUgZnJhbWVzIHRvIHVwcGVyIGxheWVyCisgICAgdEFOSV9VMzIgICAgICAgICAgICAgYmVhY29uTGVuZ3RoOworICAgIHRBTklfVTgqICAgICAgICAgICAgIGJlYWNvblB0cjsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICBhc3NvY1JlcUxlbmd0aDsKKyAgICB0QU5JX1U4KiAgICAgICAgICAgICBhc3NvY1JlcVB0cjsgICAgCit9IHRMaW1NbG1SZWFzc29jSW5kLCAqdHBMaW1NbG1SZWFzc29jSW5kOworCit0eXBlZGVmIHN0cnVjdCBzTGltTWxtQXV0aENuZgoreworICAgIHRTaXJNYWNBZGRyICAgICBwZWVyTWFjQWRkcjsKKyAgICB0QW5pQXV0aFR5cGUgICAgYXV0aFR5cGU7CisgICAgdFNpclJlc3VsdENvZGVzIHJlc3VsdENvZGU7CisgICAgdEFOSV9VMTYgICAgICAgIHByb3RTdGF0dXNDb2RlOworICAgI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AgICAgcE1hYy0+bGltLnBEaWFsb2d1ZVRva2VuSGVhZCA9IE5VTEw7CisgICAgICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7CisgICAgfQorCisgICAgLy9maXJzdCBub2RlIGRpZCBub3QgbWF0Y2guIHNvIG1vdmUgdG8gdGhlIG5leHQgb25lLgorICAgIHBDdXJyTm9kZSA9IHBDdXJyTm9kZS0+bmV4dDsKKyAgICB3aGlsZShOVUxMICE9IHBDdXJyTm9kZSApCisgICAgeworICAgICAgICBpZih0b2tlbiA9PSBwQ3Vyck5vZGUtPnRva2VuKQorICAgICAgICB7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIHBQcmV2Tm9kZSA9IHBDdXJyTm9kZTsKKyAgICAgICAgcEN1cnJOb2RlID0gcEN1cnJOb2RlLT5uZXh0OworICAgIH0KKworICAgIGlmKHBDdXJyTm9kZSAmJgorICAgICAgICAoYXNzb2NJZCA9PSBwQ3Vyck5vZGUtPmFzc29jSWQpICYmCisgICAgICAgICh0aWQgPT0gcEN1cnJOb2RlLT50aWQpKQorICAgIHsKKyAgICAgICAgcFByZXZOb2RlLT5uZXh0ID0gcEN1cnJOb2RlLT5uZXh0OworICAgICAgICAvL2lmIHRoZSBub2RlIGJlaW5nIGRlbGV0ZWQgaXMgdGhlIGxhc3Qgb25lIHRoZW4gd2UgYWxzbyBuZWVkIHRvIG1vdmUgdGhlIHRhaWwgcG9pbnRlciB0byB0aGUgcHJldk5vZGUuCisgICAgICAgIGlmKE5VTEwgPT0gcEN1cnJOb2RlLT5uZXh0KQorICAgICAgICAgICAgICBwTWFjLT5saW0ucERpYWxvZ3VlVG9rZW5UYWlsID0gcFByZXZOb2RlOworICAgICAgICB2b3NfbWVtX2ZyZWUocEN1cnJOb2RlKTsKKyAgICAgICAgcE1hYy0+bGltLnBEaWFsb2d1ZVRva2VuSGVhZCA9IE5VTEw7CisgICAgICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7CisgICAgfQ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AgICAgICAgICByZXR1cm4gImVMSU1fTUxNX09GRkxJTkVfU1RBVEUiOworICAgICAgICBjYXNlIGVMSU1fTUxNX0lETEVfU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fTUxNX0lETEVfU1RBVEUiOworICAgICAgICBjYXNlIGVMSU1fTUxNX1dUX1BST0JFX1JFU1BfU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fTUxNX1dUX1BST0JFX1JFU1BfU1RBVEUiOworICAgICAgICBjYXNlIGVMSU1fTUxNX1BBU1NJVkVfU0NBTl9TVEFURToKKyAgICAgICAgICAgIHJldHVybiAiZUxJTV9NTE1fUEFTU0lWRV9TQ0FOX1NUQVRFIjsKKyAgICAgICAgY2FzZSBlTElNX01MTV9XVF9KT0lOX0JFQUNPTl9TVEFURToKKyAgICAgICAgICAgIHJldHVybiAiZUxJTV9NTE1fV1RfSk9JTl9CRUFDT05fU1RBVEUiOworICAgICAgICBjYXNlIGVMSU1fTUxNX0pPSU5FRF9TVEFURToKKyAgICAgICAgICAgIHJldHVybiAiZUxJTV9NTE1fSk9JTkVEX1NUQVRFIjsKKyAgICAgICAgY2FzZSBlTElNX01MTV9CU1NfU1RBUlRFRF9TVEFURToKKyAgICAgICAgICAgIHJldHVybiAiZUxJTV9NTE1fQlNTX1NUQVJURURfU1RBVEUiOworICAgICAgICBjYXNlIGVMSU1fTUxNX1dUX0FVVEhfRlJBTUUyX1NUQVRFOgorICAgICAgICAgICAgcmV0dXJuICJlTElNX01MTV9XVF9BVVRIX0ZSQU1FMl9TVEFURSI7CisgICAgICAgIGNhc2UgZUxJTV9NTE1fV1RfQVVUSF9GUkFNRTNfU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fTUxNX1dUX0FVVEhfRlJBTUUzX1NUQVRFIjsKKyAgICAgICAgY2FzZSBlTElNX01MTV9XVF9BVVRIX0ZSQU1FNF9TVEFURToKKyAgICAgICAgICAgIHJldHVybiAiZUxJTV9NTE1fV1RfQVVUSF9GUkFNRTRfU1RBVEUiOworICAgICAgICBjYXNlIGVMSU1fTUxNX0FVVEhfUlNQX1RJTUVPVVRfU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fTUxNX0FVVEhfUlNQX1RJTUVPVVRfU1RBVEUiOworICAgICAgICBjYXNlIGVMSU1fTUxNX0FVVEhFTlRJQ0FURURfU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fTUxNX0FVVEhFTlRJQ0FURURfU1RBVEUiOworICAgICAgICBjYXNlIGVMSU1fTUxNX1dUX0FTU09DX1JTUF9TVEFURToKKyAgICAgICAgICAgIHJldHVybiAiZUxJTV9NTE1fV1RfQVNTT0NfUlNQX1NUQVRFIjsKKyAgICAgICAgY2FzZSBlTElNX01MTV9XVF9SRUFTU09DX1JTUF9TVEFURToKKyAgICAgICAgICAgIHJldHVybiAiZUxJTV9NTE1fV1RfUkVBU1NPQ19SU1BfU1RBVEUiOworICAgICAgICBjYXNlIGVMSU1fTUxNX1dUX0ZUX1JFQVNTT0NfUlNQX1NUQVRFOgorICAgICAgICAgICAgcmV0dXJuICJlTElNX01MTV9XVF9GVF9SRUFTU09DX1JTUF9TVEFURSI7CisgICAgICAgIGNhc2UgZUxJTV9NTE1fV1RfREVMX1NUQV9SU1BfU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fTUxNX1dUX0RFTF9TVEFfUlNQX1NUQVRFIjsKKyAgICAgICAgY2FzZSBlTElNX01MTV9XVF9ERUxfQlNTX1JTUF9TVEFURToKKyAgICAgICAgICAgIHJldHVybiAiZUxJTV9NTE1fV1RfREVMX0JTU19SU1BfU1RBVEUiOworICAgICAgICBjYXNlIGVMSU1fTUxNX1dUX0FERF9TVEFfUlNQX1NUQVRFOgorICAgICAgICAgICAgcmV0dXJuICJlTElNX01MTV9XVF9BRERfU1RBX1JTUF9TVEFURSI7CisgICAgICAgIGNhc2UgZUxJTV9NTE1fV1RfQUREX0JTU19SU1BfU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fTUxNX1dUX0FERF9CU1NfUlNQX1NUQVRFIjsKKyAgICAgICAgY2FzZSBlTElNX01MTV9SRUFTU09DSUFURURfU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fTUxNX1JFQVNTT0NJQVRFRF9TVEFURSI7CisgICAgICAgIGNhc2UgZUxJTV9NTE1fTElOS19FU1RBQkxJU0hFRF9TVEFURToKKyAgICAgICAgICAgIHJldHVybiAiZUxJTV9NTE1fTElOS19FU1RBQkxJU0hFRF9TVEFURSI7CisgICAgICAgIGNhc2UgZUxJTV9NTE1fV1RfQVNTT0NfQ05GX1NUQVRFOgorICAgICAgICAgICAgcmV0dXJuICJlTElNX01MTV9XVF9BU1NPQ19DTkZfU1RBVEUiOworICAgICAgICBjYXNlIGVMSU1fTUxNX1dUX0FERF9CU1NfUlNQX0FTU09DX1NUQVRFOgorICAgICAgICAgICAgcmV0dXJuICJlTElNX01MTV9XVF9BRERfQlNTX1JTUF9BU1NPQ19TVEFURSI7CisgICAgICAgIGNhc2UgZUxJTV9NTE1fV1RfQUREX0JTU19SU1BfUkVBU1NPQ19TVEFURToKKyAgICAgICAgICAgIHJldHVybiAiZUxJTV9NTE1fV1RfQUREX0JTU19SU1BfUkVBU1NPQ19TVEFURSI7CisgICAgICAgIGNhc2UgZUxJTV9NTE1fV1RfQUREX0JTU19SU1BfRlRfUkVBU1NPQ19TVEFURToKKyAgICAgICAgICAgIHJldHVybiAiZUxJTV9NTE1fV1RfQUREX0JTU19SU1BfRlRfUkVBU1NPQ19TVEFURSI7CisgICAgICAgIGNhc2UgZUxJTV9NTE1fV1RfQVNTT0NfREVMX1NUQV9SU1BfU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fTUxNX1dUX0FTU09DX0RFTF9TVEFfUlNQX1NUQVRFIjsKKyAgICAgICAgY2FzZSBlTElNX01MTV9XVF9TRVRfQlNTX0tFWV9TVEFURToKKyAgICAgICAgICAgIHJldHVybiAiZUxJTV9NTE1fV1RfU0VUX0JTU19LRVlfU1RBVEUiOworICAgICAgICBjYXNlIGVMSU1fTUxNX1dUX1NFVF9TVEFfS0VZX1NUQVRFOgorICAgICAgICAgICAgcmV0dXJuICJlTElNX01MTV9XVF9TRVRfU1RBX0tFWV9TVEFURSI7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICByZXR1cm4gIklOVkFMSUQgTUxNIHN0YXRlIjsKKyAgICB9Cit9CisKK3ZvaWQKK2xpbVByaW50TWxtU3RhdGUodHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMTYgbG9nTGV2ZWwsIHRMaW1NbG1TdGF0ZXMgc3RhdGUpCit7CisgICAgbGltTG9nKHBNYWMsIGxvZ0xldmVsLCBsaW1NbG1TdGF0ZVN0cihzdGF0ZSkpOworfQorCitjaGFyICoKK2xpbVNtZVN0YXRlU3RyKHRMaW1TbWVTdGF0ZXMgc3RhdGUpCit7CisjaWZkZWYgRklYTUVfR0VONgorICAgIHN3aXRjaCAoc3RhdGUpCisgICAgeworICAgICAgICBjYXNlIGVMSU1fU01FX09GRkxJTkVfU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fU01FX09GRkxJTkVfU1RBVEUiOworICAgICAgICBjYXNlIGVMSU1fU01FX0lETEVfU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fU01FX0lETEVfU1RBVEUiOworICAgICAgICBjYXNlIGVMSU1fU01FX1NVU1BFTkRfU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fU01FX1NVU1BFTkRfU1RBVEUiOworICAgICAgICBjYXNlIGVMSU1fU01FX1dUX1NDQU5fU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fU01FX1dUX1NDQU5fU1RBVEUiOworICAgICAgICBjYXNlIGVMSU1fU01FX1dUX0pPSU5fU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fU01FX1dUX0pPSU5fU1RBVEUiOworICAgICAgICBjYXNlIGVMSU1fU01FX1dUX0FVVEhfU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fU01FX1dUX0FVVEhfU1RBVEUiOworICAgICAgICBjYXNlIGVMSU1fU01FX1dUX0FTU09DX1NUQVRFOgorICAgICAgICAgICAgcmV0dXJuICJlTElNX1NNRV9XVF9BU1NPQ19TVEFURSI7CisgICAgICAgIGNhc2UgZUxJTV9TTUVfV1RfUkVBU1NPQ19TVEFURToKKyAgICAgICAgICAgIHJldHVybiAiZUxJTV9TTUVfV1RfUkVBU1NPQ19TVEFURSI7CisgICAgICAgIGNhc2UgZUxJTV9TTUVfV1RfUkVBU1NPQ19MSU5LX0ZBSUxfU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fU01FX1dUX1JFQVNTT0NfTElOS19GQUlMX1NUQVRFIjsKKyAgICAgICAgY2FzZSBlTElNX1NNRV9KT0lOX0ZBSUxVUkVfU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fU01FX0pPSU5fRkFJTFVSRV9TVEFURSI7CisgICAgICAgIGNhc2UgZUxJTV9TTUVfQVNTT0NJQVRFRF9TVEFURToKKyAgICAgICAgICAgIHJldHVybiAiZUxJTV9TTUVfQVNTT0NJQVRFRF9TVEFURSI7CisgICAgICAgIGNhc2UgZUxJTV9TTUVfUkVBU1NPQ0lBVEVEX1NUQVRFOgorICAgICAgICAgICAgcmV0dXJuICJlTElNX1NNRV9SRUFTU09DSUFURURfU1RBVEUiOworICAgICAgICBjYXNlIGVMSU1fU01FX0xJTktfRVNUX1NUQVRFOgorICAgICAgICAgICAgcmV0dXJuICJlTElNX1NNRV9MSU5LX0VTVF9TVEFURSI7CisgICAgICAgIGNhc2UgZUxJTV9TTUVfTElOS19FU1RfV1RfU0NBTl9TVEFURToKKyAgICAgICAgICAgIHJldHVybiAiZUxJTV9TTUVfTElOS19FU1RfV1RfU0NBTl9TVEFURSI7CisgICAgICAgIGNhc2UgZUxJTV9TTUVfV1RfUFJFX0FVVEhfU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fU01FX1dUX1BSRV9BVVRIX1NUQVRFIjsKKyAgICAgICAgY2FzZSBlTElNX1NNRV9XVF9ESVNBU1NPQ19TVEFURToKKyAgICAgICAgICAgIHJldHVybiAiZUxJTV9TTUVfV1RfRElTQVNTT0NfU1RBVEUiOworICAgICAgICBjYXNlIGVMSU1fU01FX1dUX0RFQVVUSF9TVEFURToKKyAgICAgICAgICAgIHJldHVybiAiZUxJTV9TTUVfV1RfREVBVVRIX1NUQVRFIjsKKyAgICAgICAgY2FzZSBlTElNX1NNRV9XVF9TVEFSVF9CU1NfU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fU01FX1dUX1NUQVJUX0JTU19TVEFURSI7CisgICAgICAgIGNhc2UgZUxJTV9TTUVfV1RfU1RPUF9CU1NfU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fU01FX1dUX1NUT1BfQlNTX1NUQVRFIjsKKyAgICAgICAgY2FzZSBlTElNX1NNRV9OT1JNQUxfU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fU01FX05PUk1BTF9TVEFURSI7CisgICAgICAgIGNhc2UgZUxJTV9TTUVfQ0hBTk5FTF9TQ0FOX1NUQVRFOgorICAgICAgICAgICAgcmV0dXJuICJlTElNX1NNRV9DSEFOTkVMX1NDQU5fU1RBVEUiOworICAgICAgICBjYXNlIGVMSU1fU01FX05PUk1BTF9DSEFOTkVMX1NDQU5fU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVMSU1fU01FX05PUk1BTF9DSEFOTkVMX1NDQU5fU1RBVEUiOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgcmV0dXJuICJJTlZBTElEIFNNRSBzdGF0ZSI7CisgICAgfQorI2VuZGlmCityZXR1cm4gIiI7Cit9CisKKworY2hhciogbGltRG90MTFNb2RlU3RyKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggZG90MTFNb2RlKQoreworI2lmZGVmIEZJWE1FX0dFTjYKKworICAgIHN3aXRjaChkb3QxMU1vZGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGNhc2UgV05JX0NGR19ET1QxMV9NT0RFX0FMTDoKKyAgICAgICAgICAgICAgICByZXR1cm4gIkFMTCI7CisgICAgICAgICAgICBjYXNlIFdOSV9DRkdfRE9UMTFfTU9ERV8xMUE6CisgICAgICAgICAgICAgICAgcmV0dXJuICIxMUEiOworICAgICAgICAgICAgY2FzZSBXTklfQ0ZHX0RPVDExX01PREVfMTFCOgorICAgICAgICAgICAgICAgIHJldHVybiAiMTFCIjsKKyAgICAgICAgICAgIGNhc2UgV05JX0NGR19ET1QxMV9NT0RFXzExRzoKKyAgICAgICAgICAgICAgICByZXR1cm4gIjExRyI7CisgICAgICAgICAgICBjYXNlIFdOSV9DRkdfRE9UMTFfTU9ERV8xMU46CisgICAgICAgICAgICAgICAgcmV0dXJuICIxMU4iOworICAgICAgICAgICAgY2FzZSBXTklfQ0ZHX0RPVDExX01PREVfUE9MQVJJUzoKKyAgICAgICAgICAgICAgICByZXR1cm4gIlBvbGFyaXMiOworICAgICAgICAgICAgY2FzZSBXTklfQ0ZHX0RPVDExX01PREVfVElUQU46CisgICAgICAgICAgICAgICAgcmV0dXJuICJUaXRhbiI7CisgICAgICAgICAgICBjYXNlIFdOSV9DRkdfRE9UMTFfTU9ERV9UQVVSVVM6CisgICAgICAgICAgICAgICAgcmV0dXJuICJUYXVydXMiOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICByZXR1cm4gIkludmFsaWQgRG90MTEgTW9kZSI7CisgICAgICAgIH0KKyNlbmRpZgorcmV0dXJuICIiOworfQorCisKK2NoYXIqIGxpbVN0YU9wUmF0ZU1vZGVTdHIodFN0YVJhdGVNb2RlIG9wUmF0ZU1vZGUpCit7CisjaWZkZWYgRklYTUVfR0VONgorCisgICAgc3dpdGNoKG9wUmF0ZU1vZGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGNhc2UgZVNUQV9UQVVSVVM6CisgICAgICAgICAgICAgICAgcmV0dXJuICJUYXVydXMiOworICAgICAgICAgICAgY2FzZSBlU1RBXzExYToKKyAgICAgICAgICAgICAgICByZXR1cm4gIjExQSI7CisgICAgICAgICAgICBjYXNlIGVTVEFfMTFiOgorICAgICAgICAgICAgICAgIHJldHVybiAiMTFCIjsKKyAgICAgICAgICAgIGNhc2UgZVNUQV8xMWJnOgorICAgICAgICAgICAgICAgIHJldHVybiAiMTFHIjsKKyAgICAgICAgICAgIGNhc2UgZVNUQV8xMW46CisgICAgICAgICAgICAgICAgcmV0dXJuICIxMU4iOworICAgICAgICAgICAgY2FzZSBlU1RBX1BPTEFSSVM6CisgICAgICAgICAgICAgICAgcmV0dXJuICJQb2xhcmlzIjsKKyAgICAgICAgICAgIGNhc2UgZVNUQV9USVRBTjoKKyAgICAgICAgICAgICAgICByZXR1cm4gIlRpdGFuIjsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgcmV0dXJuICJJbnZhbGlkIERvdDExIE1vZGUiOworICAgICAgICB9CisjZW5kaWYKK3JldHVybiAiIjsKK30KKworY2hhciogbGltQnNzVHlwZVN0cih0U2lyQnNzVHlwZSBic3NUeXBlKQoreworICAgIHN3aXRjaChic3NUeXBlKQorICAgIHsKKyAgICAgICAgY2FzZSBlU0lSX0lORlJBU1RSVUNUVVJFX01PREU6CisgICAgICAgICAgICByZXR1cm4gImVTSVJfSU5GUkFTVFJVQ1RVUkVfTU9ERSI7CisgICAgICAgIGNhc2UgZVNJUl9JQlNTX01PREU6CisgICAgICAgICAgICByZXR1cm4gImVTSVJfSUJTU19NT0RFIjsKKyAgICAgICAgY2FzZSBlU0lSX0JUQU1QX1NUQV9NT0RFOgorICAgICAgICAgICAgcmV0dXJuICJlU0lSX0JUQU1QX1NUQV9NT0RFIjsKKyAgICAgICAgY2FzZSBlU0lSX0JUQU1QX0FQX01PREU6CisgICAgICAgICAgICByZXR1cm4gImVTSVJfQlRBTVBfQVBfTU9ERSI7CisgICAgICAgIGNhc2UgZVNJUl9BVVRPX01PREU6CisgICAgICAgICAgICByZXR1cm4gImVTSVJfQVVUT19NT0RFIjsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIHJldHVybiAiSW52YWxpZCBCU1MgVHlwZSI7CisgICAgfQorfQorCit2b2lkCitsaW1QcmludFNtZVN0YXRlKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTE2IGxvZ0xldmVsLCB0TGltU21lU3RhdGVzIHN0YXRlKQoreworICAgIGxpbUxvZyhwTWFjLCBsb2dMZXZlbCwgbGltU21lU3RhdGVTdHIoc3RhdGUpKTsKK30KKworY2hhciAqbGltTXNnU3RyKHRBTklfVTMyIG1zZ1R5cGUpCit7CisjaWZkZWYgRklYTUVfR0VONgorICAgIHN3aXRjaCAobXNnVHlwZSkKKyAgICB7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfU1RBUlRfUkVROgorICAgICAgICAgICAgcmV0dXJuICJlV05JX1NNRV9TVEFSVF9SRVEiOworICAgICAgICBjYXNlIGVXTklfU01FX1NUQVJUX1JTUDoKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfU1RBUlRfUlNQIjsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9TWVNfUkVBRFlfSU5EOgorICAgICAgICAgICAgcmV0dXJuICJlV05JX1NNRV9TWVNfUkVBRFlfSU5EIjsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9TQ0FOX1JFUToKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfU0NBTl9SRVEiOworI2lmZGVmIEZFQVRVUkVfT0VNX0RBVEFfU1VQUE9SVAorICAgICAgICBjYXNlIGVXTklfU01FX09FTV9EQVRBX1JFUToKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfT0VNX0RBVEFfUkVRIjsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9PRU1fREFUQV9SU1A6CisgICAgICAgICAgICByZXR1cm4gImVXTklfU01FX09FTV9EQVRBX1JTUCI7CisjZW5kaWYKKyAgICAgICAgY2FzZSBlV05JX1NNRV9TQ0FOX1JTUDoKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfU0NBTl9SU1AiOworICAgICAgICBjYXNlIGVXTklfU01FX0pPSU5fUkVROgorICAgICAgICAgICAgcmV0dXJuICJlV05JX1NNRV9KT0lOX1JFUSI7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfSk9JTl9SU1A6CisgICAgICAgICAgICByZXR1cm4gImVXTklfU01FX0pPSU5fUlNQIjsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9TRVRDT05URVhUX1JFUToKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfU0VUQ09OVEVYVF9SRVEiOworICAgICAgICBjYXNlIGVXTklfU01FX1NFVENPTlRFWFRfUlNQOgorICAgICAgICAgICAgcmV0dXJuICJlV05JX1NNRV9TRVRDT05URVhUX1JTUCI7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfUkVBU1NPQ19SRVE6CisgICAgICAgICAgICByZXR1cm4gImVXTklfU01FX1JFQVNTT0NfUkVRIjsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9SRUFTU09DX1JTUDoKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfUkVBU1NPQ19SU1AiOworICAgICAgICBjYXNlIGVXTklfU01FX0FVVEhfUkVROgorICAgICAgICAgICAgcmV0dXJuICJlV05JX1NNRV9BVVRIX1JFUSI7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfQVVUSF9SU1A6CisgICAgICAgICAgICByZXR1cm4gImVXTklfU01FX0FVVEhfUlNQIjsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9ESVNBU1NPQ19SRVE6CisgICAgICAgICAgICByZXR1cm4gImVXTklfU01FX0RJU0FTU09DX1JFUSI7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfRElTQVNTT0NfUlNQOgorICAgICAgICAgICAgcmV0dXJuICJlV05JX1NNRV9ESVNBU1NPQ19SU1AiOworICAgICAgICBjYXNlIGVXTklfU01FX0RJU0FTU09DX0lORDoKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfRElTQVNTT0NfSU5EIjsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9ESVNBU1NPQ19DTkY6CisgICAgICAgICAgICByZXR1cm4gImVXTklfU01FX0RJU0FTU09DX0NORiI7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfREVBVVRIX1JFUToKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfREVBVVRIX1JFUSI7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfREVBVVRIX1JTUDoKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfREVBVVRIX1JTUCI7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfREVBVVRIX0lORDoKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfREVBVVRIX0lORCI7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfV01fU1RBVFVTX0NIQU5HRV9OVEY6CisgICAgICAgICAgICByZXR1cm4gImVXTklfU01FX1dNX1NUQVRVU19DSEFOR0VfTlRGIjsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9TVEFSVF9CU1NfUkVROgorICAgICAgICAgICAgcmV0dXJuICJlV05JX1NNRV9TVEFSVF9CU1NfUkVRIjsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9TVEFSVF9CU1NfUlNQOgorICAgICAgICAgICAgcmV0dXJuICJlV05JX1NNRV9TVEFSVF9CU1NfUlNQIjsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9BVVRIX0lORDoKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfQVVUSF9JTkQiOworICAgICAgICBjYXNlIGVXTklfU01FX0FTU09DX0lORDoKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfQVNTT0NfSU5EIjsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9BU1NPQ19DTkY6CisgICAgICAgICAgICByZXR1cm4gImVXTklfU01FX0FTU09DX0NORiI7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfUkVBU1NPQ19JTkQ6CisgICAgICAgICAgICByZXR1cm4gImVXTklfU01FX1JFQVNTT0NfSU5EIjsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9SRUFTU09DX0NORjoKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfUkVBU1NPQ19DTkYiOworICAgICAgICBjYXNlIGVXTklfU01FX1NXSVRDSF9DSExfUkVROgorICAgICAgICAgICAgcmV0dXJuICJlV05JX1NNRV9TV0lUQ0hfQ0hMX1JFUSI7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfU1dJVENIX0NITF9SU1A6CisgICAgICAgICAgICByZXR1cm4gImVXTklfU01FX1NXSVRDSF9DSExfUlNQIjsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9TV0lUQ0hfQ0hMX0NCX1BSSU1BUllfUkVROgorICAgICAgICAgICAgcmV0dXJuICJlV05JX1NNRV9TV0lUQ0hfQ0hMX0NCX1BSSU1BUllfUkVRIjsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9TV0lUQ0hfQ0hMX0NCX1NFQ09OREFSWV9SRVE6CisgICAgICAgICAgICByZXR1cm4gImVXTklfU01FX1NXSVRDSF9DSExfQ0JfU0VDT05EQVJZX1JFUSI7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfU1RPUF9CU1NfUkVROgorICAgICAgICAgICAgcmV0dXJuICJlV05JX1NNRV9TVE9QX0JTU19SRVEiOworICAgICAgICBjYXNlIGVXTklfU01FX1NUT1BfQlNTX1JTUDoKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfU1RPUF9CU1NfUlNQIjsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9QUk9NSVNDVU9VU19NT0RFX1JFUToKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfUFJPTUlTQ1VPVVNfTU9ERV9SRVEiOworICAgICAgICBjYXNlIGVXTklfU01FX1BST01JU0NVT1VTX01PREVfUlNQOgorICAgICAgICAgICAgcmV0dXJuICJlV05JX1NNRV9QUk9NSVNDVU9VU19NT0RFX1JTUCI7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfTkVJR0hCT1JfQlNTX0lORDoKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfTkVJR0hCT1JfQlNTX0lORCI7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfTUVBU1VSRU1FTlRfUkVROgorICAgICAgICAgICAgcmV0dXJuICJlV05JX1NNRV9NRUFTVVJFTUVOVF9SRVEiOworICAgICAgICBjYXNlIGVXTklfU01FX01FQVNVUkVNRU5UX1JTUDoKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfTUVBU1VSRU1FTlRfUlNQIjsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9NRUFTVVJFTUVOVF9JTkQ6CisgICAgICAgICAgICByZXR1cm4gImVXTklfU01FX01FQVNVUkVNRU5UX0lORCI7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfU0VUX1dEU19JTkZPX1JFUToKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfU0VUX1dEU19JTkZPX1JFUSI7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfU0VUX1dEU19JTkZPX1JTUDoKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfU0VUX1dEU19JTkZPX1JTUCI7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfV0RTX0lORk9fSU5EOgorICAgICAgICAgICAgcmV0dXJuICJlV05JX1NNRV9XRFNfSU5GT19JTkQiOworICAgICAgICBjYXNlIGVXTklfU01FX0RFQVVUSF9DTkY6CisgICAgICAgICAgICByZXR1cm4gImVXTklfU01FX0RFQVVUSF9DTkYiOworICAgICAgICBjYXNlIGVXTklfU01FX01JQ19GQUlMVVJFX0lORDoKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfTUlDX0ZBSUxVUkVfSU5EIjsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9MT1NUX0xJTktfUEFSQU1TX0lORDoKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfTE9TVF9MSU5LX1BBUkFNU19JTkQiOworICAgICAgICBjYXNlIGVXTklfU01FX0FERFRTX1JFUToKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfQUREVFNfUkVRIjsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9BRERUU19SU1A6CisgICAgICAgICAgICByZXR1cm4gImVXTklfU01FX0FERFRTX1JTUCI7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfQUREVFNfQ05GOgorICAgICAgICAgICAgcmV0dXJuICJlV05JX1NNRV9BRERUU19DTkYiOworICAgICAgICBjYXNlIGVXTklfU01FX0FERFRTX0lORDoKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfQUREVFNfSU5EIjsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9ERUxUU19SRVE6CisgICAgICAgICAgICByZXR1cm4gImVXTklfU01FX0RFTFRTX1JFUSI7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfREVMVFNfUlNQOgorICAgICAgICAgICAgcmV0dXJuICJlV05JX1NNRV9ERUxUU19SU1AiOworICAgICAgICBjYXNlIGVXTklfU01FX0RFTFRTX0lORDoKKyAgICAgICAgICAgIHJldHVybiAiZVdOSV9TTUVfREVMVFNfSU5EIjsKKyNpZiBkZWZpbmVkIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSIHx8IGRlZmluZWQgRkVBVFVSRV9XTEFOX0VTRSB8fCBkZWZpbmVkKEZFQVRVUkVfV0xBTl9MRlIpCisgICAgICAgIGNhc2UgZVdOSV9TTUVfR0VUX1JPQU1fUlNTSV9SRVE6CisgICAgICAg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gICAgICAgICAgcmV0dXJuICJTSVJfTElNX0xJTktfVEVTVF9EVVJBVElPTl9USU1FT1VUIjsKKyAgICAgICAgY2FzZSBTSVJfTElNX0tFRVBBTElWRV9USU1FT1VUOgorICAgICAgICAgICAgcmV0dXJuICJTSVJfTElNX0tFRVBBTElWRV9USU1FT1VUIjsKKyAgICAgICAgY2FzZSBTSVJfTElNX1VQREFURV9PTEJDX0NBQ0hFTF9USU1FT1VUOgorICAgICAgICAgICAgcmV0dXJuICJTSVJfTElNX1VQREFURV9PTEJDX0NBQ0hFTF9USU1FT1VUIjsKKyAgICAgICAgY2FzZSBTSVJfTElNX0NORl9XQUlUX1RJTUVPVVQ6CisgICAgICAgICAgICByZXR1cm4gIlNJUl9MSU1fQ05GX1dBSVRfVElNRU9VVCI7CisgICAgICAgIGNhc2UgU0lSX0xJTV9SQURBUl9ERVRFQ1RfSU5EOgorICAgICAgICAgICAgcmV0dXJuICJTSVJfTElNX1JBREFSX0RFVEVDVF9JTkQiOworI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCisgICAgICAgIGNhc2UgU0lSX0xJTV9GVF9QUkVBVVRIX1JTUF9USU1FT1VUOgorICAgICAgICAgICAgcmV0dXJuICJTSVJfTElNX0ZUX1BSRUFVVEhfUlNQX1RJTUVPVVQiOworI2VuZGlmCisKKyAgICAgICAgY2FzZSBTSVJfSEFMX0FQUF9TRVRVUF9OVEY6CisgICAgICAgICAgICByZXR1cm4gIlNJUl9IQUxfQVBQX1NFVFVQX05URiI7CisgICAgICAgIGNhc2UgU0lSX0hBTF9JTklUSUFMX0NBTF9GQUlMRURfTlRGOgorICAgICAgICAgICAgcmV0dXJuICJTSVJfSEFMX0lOSVRJQUxfQ0FMX0ZBSUxFRF9OVEYiOworICAgICAgICBjYXNlIFNJUl9IQUxfTklDX09QRVJfTlRGOgorICAgICAgICAgICAgcmV0dXJuICJTSVJfSEFMX05JQ19PUEVSX05URiI7CisgICAgICAgIGNhc2UgU0lSX0hBTF9JTklUX1NUQVJUX1JFUToKKyAgICAgICAgICAgIHJldHVybiAiU0lSX0hBTF9JTklUX1NUQVJUX1JFUSI7CisgICAgICAgIGNhc2UgU0lSX0hBTF9TSFVURE9XTl9SRVE6CisgICAgICAgICAgICByZXR1cm4gIlNJUl9IQUxfU0hVVERPV05fUkVRIjsKKyAgICAgICAgY2FzZSBTSVJfSEFMX1NIVVRET1dOX0NORjoKKyAgICAgICAgICAgIHJldHVybiAiU0lSX0hBTF9TSFVURE9XTl9DTkYiOworICAgICAgICBjYXNlIFNJUl9IQUxfUkVTRVRfUkVROgorICAgICAgICAgICAgcmV0dXJuICJTSVJfSEFMX1JFU0VUX1JFUSI7CisgICAgICAgIGNhc2UgU0lSX0hBTF9SRVNFVF9DTkY6CisgICAgICAgICAgICByZXR1cm4gIlNJUl9IQUxfUkVTRVRfQ05GIjsKKyAgICAgICAgY2FzZSBTSVJfV1JJVEVfVE9fVEQ6CisgICAgICAgICAgICByZXR1cm4gIlNJUl9XUklURV9UT19URCI7CisKKyAgICAgICAgY2FzZSBXTklfQ0ZHX1BBUkFNX1VQREFURV9JTkQ6CisgICAgICAgICAgICByZXR1cm4gIldOSV9DRkdfUEFSQU1fVVBEQVRFX0lORCI7CisgICAgICAgIGNhc2UgV05JX0NGR19ETkxEX1JFUToKKyAgICAgICAgICAgIHJldHVybiAiV05JX0NGR19ETkxEX1JFUSI7CisgICAgICAgIGNhc2UgV05JX0NGR19ETkxEX0NORjoKKyAgICAgICAgICAgIHJldHVybiAiV05JX0NGR19ETkxEX0NORiI7CisgICAgICAgIGNhc2UgV05JX0NGR19HRVRfUlNQOgorICAgICAgICAgICAgcmV0dXJuICJXTklfQ0ZHX0dFVF9SU1AiOworICAgICAgICBjYXNlIFdOSV9DRkdfU0VUX0NORjoKKyAgICAgICAgICAgIHJldHVybiAiV05JX0NGR19TRVRfQ05GIjsKKyAgICAgICAgY2FzZSBXTklfQ0ZHX0dFVF9BVFRSSUJfUlNQOgorICAgICAgICAgICAgcmV0dXJuICJXTklfQ0ZHX0dFVF9BVFRSSUJfUlNQIjsKKyAgICAgICAgY2FzZSBXTklfQ0ZHX0FERF9HUlBfQUREUl9DTkY6CisgICAgICAgICAgICByZXR1cm4gIldOSV9DRkdfQUREX0dSUF9BRERSX0NORiI7CisgICAgICAgIGNhc2UgV05JX0NGR19ERUxfR1JQX0FERFJfQ05GOgorICAgICAgICAgICAgcmV0dXJuICJXTklfQ0ZHX0RFTF9HUlBfQUREUl9DTkYiOworICAgICAgICBjYXNlIEFOSV9DRkdfR0VUX1JBRElPX1NUQVRfUlNQOgorICAgICAgICAgICAgcmV0dXJuICJBTklfQ0ZHX0dFVF9SQURJT19TVEFUX1JTUCI7CisgICAgICAgIGNhc2UgQU5JX0NGR19HRVRfUEVSX1NUQV9TVEFUX1JTUDoKKyAgICAgICAgICAgIHJldHVybiAiQU5JX0NGR19HRVRfUEVSX1NUQV9TVEFUX1JTUCI7CisgICAgICAgIGNhc2UgQU5JX0NGR19HRVRfQUdHX1NUQV9TVEFUX1JTUDoKKyAgICAgICAgICAgIHJldHVybiAiQU5JX0NGR19HRVRfQUdHX1NUQV9TVEFUX1JTUCI7CisgICAgICAgIGNhc2UgQU5JX0NGR19DTEVBUl9TVEFUX1JTUDoKKyAgICAgICAgICAgIHJldHVybiAiQU5JX0NGR19DTEVBUl9TVEFUX1JTUCI7CisgICAgICAgIGNhc2UgV05JX0NGR19ETkxEX1JTUDoKKyAgICAgICAgICAgIHJldHVybiAiV05JX0NGR19ETkxEX1JTUCI7CisgICAgICAgIGNhc2UgV05JX0NGR19HRVRfUkVROgorICAgICAgICAgICAgcmV0dXJuICJXTklfQ0ZHX0dFVF9SRVEiOworICAgICAgICBjYXNlIFdOSV9DRkdfU0VUX1JFUToKKyAgICAgICAgICAgIHJldHVybiAiV05JX0NGR19TRVRfUkVRIjsKKyAgICAgICAgY2FzZSBXTklfQ0ZHX1NFVF9SRVFfTk9fUlNQOgorICAgICAgICAgICAgcmV0dXJuIC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X1VQTE9BRCAqLworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgcmV0dXJuICJJTlZBTElEIFNNRSBtZXNzYWdlIjsKKyAgICB9CisjZW5kaWYKK3JldHVybiAiIjsKK30KKworCisKK2NoYXIgKmxpbVJlc3VsdENvZGVTdHIodFNpclJlc3VsdENvZGVzIHJlc3VsdENvZGUpCit7CisgICAgc3dpdGNoIChyZXN1bHRDb2RlKQorICAgIHsKKyAgICAgIGNhc2UgZVNJUl9TTUVfU1VDQ0VTUzoKKyAgICAgICAgICAgIHJldHVybiAiZVNJUl9TTUVfU1VDQ0VTUyI7CisgICAgICBjYXNlIGVTSVJfRU9GX1NPRl9FWENFUFRJT046CisgICAgICAgICAgICByZXR1cm4gImVTSVJfRU9GX1NPRl9FWENFUFRJT04iOworICAgICAgY2FzZSBlU0lSX0JNVV9FWENFUFRJT046CisgICAgICAgICAgICByZXR1cm4gImVTSVJfQk1VX0VYQ0VQVElPTiI7CisgICAgICBjYXNlIGVTSVJfTE9XX1BEVV9FWENFUFRJT046CisgICAgICAgICAgICByZXR1cm4gImVTSVJfTE9XX1BEVV9FWENFUFRJT04iOworICAgICAgY2FzZSBlU0lSX1VTRVJfVFJJR19SRVNFVDoKKyAgICAgICAgICAgIHJldHVybiJlU0lSX1VTRVJfVFJJR19SRVNFVCI7CisgICAgICBjYXNlIGVTSVJfTE9HUF9FWENFUFRJT046CisgICAgICAgICAgICByZXR1cm4gImVTSVJfTE9HUF9FWENFUFRJT04iOworICAgICAgY2FzZSBlU0lSX0NQX0VYQ0VQVElPTjoKKyAgICAgICAgICAgIHJldHVybiAiZVNJUl9DUF9FWENFUFRJT04iOworICAgICAgY2FzZSBlU0lSX1NUT1BfQlNTOgorICAgICAgICAgICAgcmV0dXJuICJlU0lSX1NUT1BfQlNTIjsKKyAgICAgIGNhc2UgZVNJUl9BSEJfSEFOR19FWENFUFRJT046CisgICAgICAgICAgICByZXR1cm4gImVTSVJfQUhCX0hBTkdfRVhDRVBUSU9OIjsKKyAgICAgIGNhc2UgZVNJUl9EUFVfRVhDRVBUSU9OOgorICAgICAgICAgICAgcmV0dXJuICJlU0lSX0RQVV9FWENFUFRJT04iOworICAgICAgY2FzZSBlU0lSX1JYUF9FWENFUFRJT046CisgICAgICAgICAgICByZXR1cm4gImVTSVJfUlhQX0VYQ0VQVElPTiI7CisgICAgICBjYXNlIGVTSVJfTUNQVV9FWENFUFRJT046CisgICAgICAgICAgICByZXR1cm4gImVTSVJfTUNQVV9FWENFUFRJT04iOworICAgICAgY2FzZSBlU0lSX01DVV9FWENFUFRJT046CisgICAgICAgICAgICByZXR1cm4gImVTSVJfTUNVX0VYQ0VQVElPTiI7CisgICAgICBjYXNlIGVTSVJfTVRVX0VYQ0VQVElPTjoKKyAgICAgICAgICAgIHJldHVybiAiZVNJUl9NVFVfRVhDRVBUSU9OIjsKKyAgICAgIGNhc2UgZVNJUl9NSUZfRVhDRVBUSU9OOgorICAgICAgICAgICAgcmV0dXJuICJlU0lSX01JRl9FWENFUFRJT04iOworICAgICAgY2FzZSBlU0lSX0ZXX0VYQ0VQVElPTjoKKyAgICAgICAgICAgIHJldHVybiAiZVNJUl9GV19FWENFUFRJT04iOworICAgICAgY2FzZSBlU0lSX01BSUxCT1hfU0FOSVRZX0NIS19GQUlMRUQ6CisgICAgICAgICAgICByZXR1cm4gImVTSVJfTUFJTEJPWF9TQU5JVFlfQ0hLX0ZBSUxFRCI7CisgICAgICBjYXNlIGVTSVJfUkFESU9fSFdfU1dJVENIX1NUQVRVU19JU19PRkY6CisgICAgICAgICAgICByZXR1cm4gImVTSVJfUkFESU9fSFdfU1dJVENIX1NUQVRVU19JU19PRkYiOworICAgICAgY2FzZSBlU0lSX0NGQl9GTEFHX1NUVUNLX0VYQ0VQVElPTjoKKyAgICAgICAgICAgIHJldHVybiAiZVNJUl9DRkJfRkxBR19TVFVDS19FWENFUFRJT04iOworICAgICAgY2FzZSBlU0lSX1NNRV9CQVNJQ19SQVRFU19OT1RfU1VQUE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RFRDoKKyAgICAgICAgICAgIHJldHVybiAiZVNJUl9TTUVfU1RBX05PVF9BVVRIRU5USUNBVEVEIjsKKyAgICAgIGNhc2UgZVNJUl9TTUVfU1RBX05PVF9BU1NPQ0lBVEVEOgorICAgICAgICAgICAgcmV0dXJuICJlU0lSX1NNRV9TVEFfTk9UX0FTU09DSUFURUQiOworICAgICAgY2FzZSBlU0lSX1NNRV9TVEFfRElTQVNTT0NJQVRFRDoKKyAgICAgICAgICAgIHJldHVybiAiZVNJUl9TTUVfU1RBX0RJU0FTU09DSUFURUQiOworICAgICAgY2FzZSBlU0lSX1NNRV9BTFJFQURZX0pPSU5FRF9BX0JTUzoKKyAgICAgICAgICAgIHJldHVybiAiZVNJUl9TTUVfQUxSRUFEWV9KT0lORURfQV9CU1MiOworICAgICAgY2FzZSBlU0lSX1VMQV9DT01QTEVURUQ6CisgICAgICAgICAgICByZXR1cm4gImVTSVJfVUxBX0NPTVBMRVRFRCI7CisgICAgICBjYXNlIGVTSVJfVUxBX0ZBSUxVUkU6CisgICAgICAgICAgICByZXR1cm4gImVTSVJfVUxBX0ZBSUxVUkUiOworICAgICAgY2FzZSBlU0lSX1NNRV9MSU5LX0VTVEFCTElTSEVEOgorICAgICAgICAgICAgcmV0dXJuICJlU0lSX1NNRV9MSU5LX0VTVEFCTElTSEVEIjsKKyAgICAgIGNhc2UgZVNJUl9TTUVfVU5BQkxFX1RPX1BFUkZPUk1fTUVBU1VSRU1FTlRTOgorICAgICAgICAgICAgcmV0dXJuICJlU0lSX1NNRV9VTkFCTEVfVE9fUEVSRk9STV9NRUFTVVJFTUVOVFMiOworICAgICAgY2FzZSBlU0lSX1NNRV9VTkFCTEVfVE9fUEVSRk9STV9ERlM6CisgICAgICAgICAgICByZXR1cm4gImVTSVJfU01FX1VOQUJMRV9UT19QRVJGT1JNX0RGUyI7CisgICAgICBjYXNlIGVTSVJfU01FX0RGU19GQUlMRUQ6CisgICAgICAgICAgICByZXR1cm4gImVTSVJfU01FX0RGU19GQUlMRUQiOworICAgICAgY2FzZSBlU0lSX1NNRV9UUkFOU0ZFUl9TVEE6CisgICAgICAgICAgICByZXR1cm4gImVTSVJfU01FX1RSQU5TRkVSX1NUQSI7CisgICAgICBjYXNlIGVTSVJfU01FX0lOVkFMSURfTElOS19URVNUX1BBUkFNRVRFUlM6CisgICAgICAgICAgICByZXR1cm4gImVTSVJfU01FX0lOVkFMSURfTElOS19URVNUX1BBUkFNRVRFUlMiOworICAgICAgY2FzZSBlU0lSX1NNRV9MSU5LX1RFU1RfTUFYX0VYQ0VFREVEOgorICAgICAgICAgICAgcmV0dXJuICJlU0lSX1NNRV9MSU5LX1RFU1RfTUFYX0VYQ0VFREVEIjsKKyAgICAgIGNhc2UgZVNJUl9TTUVfVU5TVVBQT1JURURfUkFURToKKyAgICAgICAgICAgIHJldHVybiAiZVNJUl9TTUVfVU5TVVBQT1JURURfUkFURSI7CisgICAgICBjYXNlIGVTSVJfU01FX0xJTktfVEVTVF9USU1FT1VUOgorICAgICAgICAgICAgcmV0dXJuICJlU0lSX1NNRV9MSU5LX1RFU1RfVElNRU9VVCI7CisgICAgICBjYXNlIGVTSVJfU01FX0xJTktfVEVTVF9DT01QTEVURToKKyAgICAgICAgICAgIHJldHVybiAiZVNJUl9TTUVfTElOS19URVNUX0NPTVBMRVRFIjsKKyAgICAgIGNhc2UgZVNJUl9TTUVfTElOS19URVNUX0lOVkFMSURfU1RBVEU6CisgICAgICAgICAgICByZXR1cm4gImVTSVJfU01FX0xJTktfVEVTVF9JTlZBTElEX1NUQVRFIjsKKyAgICAgIGNhc2UgZVNJUl9TTUVfTElOS19URVNUX0lOVkFMSURfQUREUkVTUzoKKyAgICAgICAgICAgIHJldHVybiAiZVNJUl9TTUVfTElOS19URVNUX0lOVkFMSURfQUREUkVTUyI7CisgICAgICBjYXNlIGVTSVJfU01FX1BPTEFSSVNfUkVTRVQ6CisgICAgICAgICAgICByZXR1cm4gImVTSVJfU01FX1BPTEFSSVNfUkVTRVQiOwor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IG4rKyxwQXV0aE5vZGUrKykKKyAgICAgICAgeworICAgICAgICAgICAgLy8gRGVsZXRlIGFueSBBdXRoZW50aWNhdGlvbiByZXNwb25zZQorICAgICAgICAgICAgLy8gdGltZXJzLCB3aGljaCBtaWdodCBoYXZlIGJlZW4gc3RhcnRlZC4KKyAgICAgICAgICAgIHR4X3RpbWVyX2RlbGV0ZSgmcEF1dGhOb2RlLT50aW1lcik7CisgICAgICAgIH0KKworICAgICAgICB0eF90aW1lcl9kZWFjdGl2YXRlKCZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1VcGRhdGVPbGJjQ2FjaGVUaW1lcik7CisgICAgICAgIHR4X3RpbWVyX2RlbGV0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltVXBkYXRlT2xiY0NhY2hlVGltZXIpOworICAgICAgICB0eF90aW1lcl9kZWFjdGl2YXRlKCZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1QcmVBdXRoQ2xudXBUaW1lcik7CisgICAgICAgIHR4X3RpbWVyX2RlbGV0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltUHJlQXV0aENsbnVwVGltZXIpOworCisjaWYgMCAvLyBUaGUgV1BTIFBCQyBjbGVhbiB1cCB0aW1lciBpcyBkaXNhYmxlZAorICAgICAgICBpZiAocE1hYy0+bGltLmdMaW1TeXN0ZW1Sb2xlID09IGVMSU1fQVBfUk9MRSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYocE1hYy0+bGltLmxpbVRpbWVycy5nTGltV1BTT3ZlcmxhcFRpbWVyT2JqLmlzVGltZXJDcmVhdGVkID09IGVBTklfQk9PTEVBTl9UUlVFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHR4X3RpbWVyX2RlYWN0aXZhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbVdQU092ZXJsYXBUaW1lck9iai5nTGltV1BTT3ZlcmxhcFRpbWVyKTsKKyAgICAgICAgICAgICAgICB0eF90aW1lcl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EVfSURfUEUsIE5VTEwpKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfUEUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIEZMKCJTU1IgaXMgZGV0ZWN0ZWQsIHByb2NlZWQgdG8gY2xlYW4gdXAgcG1mU2FRdWVyeVRpbWVyIikpOworICAgICAgICBmb3IgKGJzc19lbnRyeSA9IDA7IGJzc19lbnRyeSA8IHBNYWMtPmxpbS5tYXhCc3NJZDsgYnNzX2VudHJ5KyspCisgICAgICAgIHsKKyAgICAgICAgICAgICBpZiAocE1hYy0+bGltLmdwU2Vzc2lvbltic3NfZW50cnldLnZhbGlkKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgZm9yIChzdGFfZW50cnkgPSAxOyBzdGFfZW50cnkgPCBwTWFjLT5saW0uZ0xpbUFzc29jU3RhTGltaXQ7CisgICAgICAgICAgICAgICAgICAgICAgc3RhX2VudHJ5KyspCisgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5ID0gJnBNYWMtPmxpbS5ncFNlc3Npb25bYnNzX2VudHJ5XTsKKyAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMgPSBkcGhHZXRIYXNoRW50cnkocE1hYywgc3RhX2VudHJ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAoTlVMTCA9PSBwU3RhRHMpCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfUEUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkRlbGV0aW5nIHBtZlNhUXVlcnlUaW1lciBmb3Igc3RhaWRbJWRdIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+c3RhSW5kZXgpIDsKKyAgICAgICAgICAgICAgICAgICAgICB0eF90aW1lcl9kZWFjdGl2YXRlKCZwU3RhRHMtPnBtZlNhUXVlcnlUaW1lcik7CisgICAgICAgICAgICAgICAgICAgICAgdHhfdGltZXJfZGVsZXRlKCZwU3RhRHMtPnBtZlNhUXVlcnlUaW1lcik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorI2VuZGlmCisKKyAgICAvLy8gQ2xlYW51cCBjYWNoZWQgc2NhbiBsaXN0CisgICAgbGltUmVJbml0U2NhblJlc3VsdHMocE1hYyk7CisjaWZkZWYgV0xBTl9GRUFUVVJFX1JPQU1fU0NBTl9PRkZMT0FECisgICAgLy8vIENsZWFudXAgY2FjaGVkIHNjYW4gbGlzdAorICAgIGxpbVJlSW5pdExmclNjYW5SZXN1bHRzKHBNYWMpOworI2VuZGlmCisKK30gLyoqKiBlbmQgbGltQ2xlYW51cE1sbSgpICoqKi8KKworCisKKy8qKgorICogbGltQ2xlYW51cExtbSgpCisgKgorICpGVU5DVElPTjoKKyAqIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIHRvIGNsZWFudXAgYW55IHJlc291cmNlcworICogYWxsb2NhdGVkIGJ5IExNTSBzdWItbW9kdWxlLgorICoKKyAqUEFSQU1TOgorICoKKyAqTE9HSUM6CisgKgorICpBU1NVTVBUSU9OUzoKKyAqIE5BCisgKgorICpOT1RFOgorICogTkEKKyAqCisgKiBAcGFyYW0gIHBNYWMgICAgICBQb2ludGVyIHRvIEdsb2JhbCBNQUMgc3RydWN0dXJlCisgKiBAcmV0dXJuIE5vbmUKKyAqLworCit2b2lkCitsaW1DbGVhbnVwTG1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BMSU1fREVGRVJSRURfUV9DSEVDS19USFJFU0hPTEQgPCBwTWFjLT5saW0uZ0xpbURlZmVycmVkTXNnUS5zaXplICkKKyAgICAgICAgeworICAgICAgICAgICAgdEFOSV9VMTYgaWR4LCBjb3VudCA9IDA7CisgICAgICAgICAgICBmb3IoaWR4ID0gMDsgaWR4IDwgcE1hYy0+bGltLmdMaW1EZWZlcnJlZE1zZ1Euc2l6ZTsgaWR4KyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoIFNJUl9CQl9YUE9SVF9NR01UX01TRyA9PSBwTWFjLT5saW0uZ0xpbURlZmVycmVkTXNnUS5kZWZlcnJlZFF1ZXVlW2lkeF0udHlwZSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBjb3VudCsrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmKCBMSU1fTUFYX05VTV9NR01UX0ZSQU1FX0RFRkVSUkVEIDwgY291bnQgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vV2UgcmVhY2ggdGhlIHF1b3RhIGZvciBtYW5hZ2VtZW50IGZyYW1lcywgZHJvcCB0aGlzIG9uZQorICAgICAgICAgICAgICAgIFBFTE9HVyhsaW1Mb2cocE1hYywgTE9HVywgRkwoIkNhbm5vdCBkZWZlcnJlZC4gTXNnOiAlZCBUb28gbWFueSAoY291bnQ9JWQpIGFscmVhZHkiKSwgbGltTXNnLT50eXBlLCBjb3VudCk7KQorICAgICAgICAgICAgICAgIC8vUmV0dXJuIGVycm9yLCBjYWxsZXIga25vd3Mgd2hhdCB0byBkbworICAgICAgICAgICAgICAgIHJldHVybiBUWF9RVUVVRV9GVUxMOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgKytwTWFjLT5saW0uZ0xpbURlZmVycmVkTXNnUS5zaXplOworCisgICAgLyogcmVzZXQgdGhlIGNvdW50IGhlcmUgc2luY2Ugd2UgYXJl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RU42CisKKyAgICBpZiAodHlwZSA9PSBTSVJfTUFDX01HTVRfRlJBTUUpCisgICAgeworICAgICAgICBzd2l0Y2ggKHN1YlR5cGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGNhc2UgU0lSX01BQ19NR01UX0FTU09DX1JFUToKKyAgICAgICAgICAgICAgICByZXR1cm4gIk1BQ19NR01UX0FTU09DX1JFUSI7CisgICAgICAgICAgICBjYXNlIFNJUl9NQUNfTUdNVF9BU1NPQ19SU1A6CisgICAgICAgICAgICAgICAgcmV0dXJuICJNQUNfTUdNVF9BU1NPQ19SU1AiOworICAgICAgICAgICAgY2FzZSBTSVJfTUFDX01HTVRfUkVBU1NPQ19SRVE6CisgICAgICAgICAgICAgICAgcmV0dXJuICJNQUNfTUdNVF9SRUFTU09DX1JFUSI7CisgICAgICAgICAgICBjYXNlIFNJUl9NQUNfTUdNVF9SRUFTU09DX1JTUDoKKyAgICAgICAgICAgICAgICByZXR1cm4gIk1BQ19NR01UX1JFQVNTT0NfUlNQIjsKKyAgICAgICAgICAgIGNhc2UgU0lSX01BQ19NR01UX1BST0JFX1JFUToKKyAgICAgICAgICAgICAgICByZXR1cm4gIk1BQ19NR01UX1BST0JFX1JFUSI7CisgICAgICAgICAgICBjYXNlIFNJUl9NQUNfTUdNVF9QUk9CRV9SU1A6CisgICAgICAgICAgICAgICAgcmV0dXJuICJNQUNfTUdNVF9QUk9CRV9SU1AiOworICAgICAgICAgICAgY2FzZSBTSVJfTUFDX01HTVRfQkVBQ09OOgorICAgICAgICAgICAgICAgIHJldHVybiAiTUFDX01HTVRfQkVBQ09OIjsKKyAgICAgICAgICAgIGNhc2UgU0lSX01BQ19NR01UX0FUSU06CisgICAgICAgICAgICAgICAgcmV0dXJuICJNQUNfTUdNVF9BVElNIjsKKyAgICAgICAgICAgIGNhc2UgU0lSX01BQ19NR01UX0RJU0FTU09DOgorICAgICAgICAgICAgICAgIHJldHVybiAiTUFDX01HTVRfRElTQVNTT0MiOworICAgICAgICAgICAgY2FzZSBTSVJfTUFDX01HTVRfQVVUSDoKKyAgICAgICAgICAgICAgICByZXR1cm4gIk1BQ19NR01UX0FVVEgiOworICAgICAgICAgICAgY2FzZSBTSVJfTUFDX01HTVRfREVBVVRIOgorICAgICAgICAgICAgICAgIHJldHVybiAiTUFDX01HTVRfREVBVVRIIjsKKyAgICAgICAgICAgIGNhc2UgU0lSX01BQ19NR01UX0FDVElPTjoKKyAgICAgICAgICAgICAgICByZXR1cm4gIk1BQ19NR01UX0FDVElPTiI7CisgICAgICAgICAgICBjYXNlIFNJUl9NQUNfTUdNVF9SRVNFUlZFRDE1OgorICAgICAgICAgICAgICAgIHJldHVybiAiTUFDX01HTVRfUkVTRVJWRUQxNSI7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHJldHVybiAiVW5rbm93biBNR01UIEZyYW1lIjsKKyAgICAgICAgfQorICAgIH0KKworICAgIGVsc2UgaWYgKHR5cGUgPT0gU0lSX01BQ19DVFJMX0ZSQU1FKQorICAgIHsKKyAgICAgICAgc3dpdGNoIChzdWJUeXBlKQorICAgICAgICB7CisgICAgICAgICAgICBjYXNlIFNJUl9NQUNfQ1RSTF9SUjoKKyAgICAgICAgICAgICAgICByZXR1cm4gIk1BQ19DVFJMX1JSIjsKKyAgICAgICAgICAgIGNhc2UgU0lSX01BQ19DVFJMX0JBUjoKKyAgICAgICAgICAgICAgICByZXR1cm4gIk1BQ19DVFJMX0JBUiI7CisgICAgICAgICAgICBjYXNlIFNJUl9NQUNfQ1RSTF9CQToKKyAgICAgICAgICAgICAgICByZXR1cm4gIk1BQ19DVFJMX0JBIjsKKyAgICAgICAgICAgIGNhc2UgU0lSX01BQ19DVFJMX1BTX1BPTEw6CisgICAgICAgICAgICAgICAgcmV0dXJuICJNQUNfQ1RSTF9QU19QT0xMIjsKKyAgICAgICAgICAgIGNhc2UgU0lSX01BQ19DVFJMX1JUUzoKKyAgICAgICAgICAgICAgICByZXR1cm4gIk1BQ19DVFJMX1JUUyI7CisgICAgICAgICAgICBjYXNlIFNJUl9NQUNfQ1RSTF9DVFM6CisgICAgICAgICAgICAgICAgcmV0dXJuICJNQUNfQ1RSTF9DVFMiOworICAgICAgICAgICAgY2FzZSBTSVJfTUFDX0NUUkxfQUNLOgorICAgICAgICAgICAgICAgIHJldHVybiAiTUFDX0NUUkxfQUNLIjsKKyAgICAgICAgICAgIGNhc2UgU0lSX01BQ19DVFJMX0NGX0VORDoKKyAgICAgICAgICAgICAgICByZXR1cm4gIk1BQ19DVFJMX0NGX0VORCI7CisgICAgICAgICAgICBjYXNlIFNJUl9NQUNfQ1RSTF9DRl9FTkRfQUNLOgorICAgICAgICAgICAgICAgIHJldHVybiAiTUFDX0NUUkxfQ0ZfRU5EX0FDSyI7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHJldHVybiAiVW5rbm93biBDVFJMIEZyYW1lIjsKKyAgICAgICAgfQorICAgIH0KKworICAgIGVsc2UgaWYgKHR5cGUgPT0gU0lSX01BQ19EQVRBX0ZSQU1FKQorICAgIHsKKyAgICAgICAgc3dpdGNoIChzdWJUeXBlKQorICAgICAgICB7CisgICAgICAgICAgICBjYXNlIFNJUl9NQUNfREFUQV9EQVRBOgorICAgICAgICAgICAgICAgIHJldHVybiAiTUFDX0RBVEFfREFUQSI7CisgICAgICAgICAgICBjYXNlIFNJUl9NQUNfREFUQV9EQVRBX0FDSzoKKyAgICAgICAgICAgICAgICByZXR1cm4gIk1BQ19EQVRBX0RBVEFfQUNLIjsKKyAgICAgICAgICAgIGNhc2UgU0lSX01BQ19EQVRBX0RBVEFfUE9MTDoKKyAgICAgICAgICAgICAgICByZXR1cm4gIk1BQ19EQVRBX0RBVEFfUE9MTCI7CisgICAgICAgICAgICBjYXNlIFNJUl9NQUNfREFUQV9EQVRBX0FDS19QT0xMOgorICAgICAgICAgICAgICAgIHJldHVybiAiTUFDX0RBVEFfREFUQV9BQ0tfUE9MTCI7CisgICAgICAgICAgICBjYXNlIFNJUl9NQUNfREFUQV9OVUxMOgorICAgICAgICAgICAgICAgIHJldHVybiAiTUFDX0RBVEFfTlVMTCI7CisgICAgICAgICAgICBjYXNlIFNJUl9NQUNfREFUQV9OVUxMX0FDSzoKKyAgICAgICAgICAgICAgICByZXR1cm4gIk1BQ19EQVRBX05VTExfQUNLIjsKKyAgICAgICAgICAgIGNhc2UgU0lSX01BQ19EQVRBX05VTExfUE9MTDoKKyAgICAgICAgICAgICAgICByZXR1cm4gIk1BQ19EQVRBX05VTExfUE9MTCI7CisgICAgICAgICAgICBjYXNlIFNJUl9NQUNfREFUQV9OVUxMX0FDS19QT0xMOgorICAgICAgICAgICAgICAgIHJldHVybiAiTUFDX0RBVEFfTlVMTF9BQ0tfUE9MTCI7CisgICAgICAgICAgICBjYXNlIFNJUl9NQUNfREFUQV9RT1NfREFUQToKKyAgICAgICAgICAgICAgICByZXR1cm4gIk1BQ19EQVRBX1FPU19EQVRBIjsKKyAgICAgICAgICAgIGNhc2UgU0lSX01BQ19EQVRBX1FPU19EQVRBX0FDSzoKKyAgICAgICAgICAgICAgICByZXR1cm4gIk1BQ19EQVRBX1FPU19EQVRBX0FDSyI7CisgICAgICAgICAgICBjYXNlIFNJUl9NQUNfREFUQV9RT1NfREFUQV9QT0xMOgorICAgICAgICAgICAgICAgIHJldHVybiAiTUFDX0RBVEFfUU9TX0RBVEFfUE9MTCI7CisgICAgICAgICAgICBjYXNlIFNJUl9NQUNfREFUQV9RT1NfREFUQV9BQ0tfUE9MTDoKKyAgICAgICAgICAgICAgICByZXR1cm4gIk1BQ19EQVRBX1FPU19EQVRBX0FDS19QT0xMIjsKKyAgICAgICAgICAgIGNhc2UgU0lSX01BQ19EQVRBX1FPU19OVUxMOgorICAgICAgICAgICAgICAgIHJldHVybiAiTUFDX0RBVEFfUU9TX05VTEwiOworICAgICAgICAgICAgY2FzZSBTSVJfTUFDX0RBVEFfUU9TX05VTExfQUNLOgorICAgICAgICAgICAgICAgIHJldHVybiAiTUFDX0RBVEFfUU9TX05VTExfQUNLIjsKKyAgICAgICAgICAgIGNhc2UgU0lSX01BQ19EQVRBX1FPU19OVUxMX1BPTEw6CisgICAgICAgICAgICAgICAgcmV0dXJuICJNQUNfREFUQV9RT1NfTlVMTF9QT0xMIjsKKyAgICAgICAgICAgIGNhc2UgU0lSX01BQ19EQVRBX1FPU19OVUxMX0FDS19QT0xMOgorICAgICAgICAgICAgICAgIHJldHVybiAiTUFDX0RBVEFfUU9TX05VTExfQUNLX1BPTEwiOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICByZXR1cm4gIlVua25vd24gRGF0YSBGcmFtZSI7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgICAgICByZXR1cm4gIlVua25vd24iOworI2VuZGlmCityZXR1cm4gIiI7Cit9CisKK3ZvaWQgbGltSGFuZGxlVXBkYXRlT2xiY0NhY2hlKHRwQW5pU2lyR2xvYmFsIHBNYWMpCit7CisgICAgaW50IGk7CisgICAgc3RhdGljIGludCBlbmFibGU7CisgICAgdFVwZGF0ZUJlYWNvblBhcmFtcyBiZWFjb25QYXJhbXM7CisKKyAgICB0cFBFU2Vzc2lvbiAgICAgICBwc2Vzc2lvbkVudHJ5ID0gbGltSXNBcFNlc3Npb25BY3RpdmUocE1hYyk7CisKKyAgICBpZiAocHNlc3Npb25FbnRyeSA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiIFNlc3Npb24gbm90IGZvdW5kIikpOykKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHZvc19tZW1fc2V0KCAoIHRBTklfVTgqICkmYmVhY29uUGFyYW1zLCBzaXplb2YoIHRVcGRhdGVCZWFjb25QYXJhbXMpLCAwKTsKKyAgICBiZWFjb25QYXJhbXMuYnNzSWR4ID0gcHNlc3Npb25FbnRyeS0+YnNzSWR4OworICAgIAorICAgIGJlYWNvblBhcmFtcy5wYXJ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ICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5nTGltT2xiY1BhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoIXBzZXNzaW9uRW50cnktPmdMaW0xMWJQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBQRUxPRzEobGltTG9nKHBNYWMsIExPRzEsIEZMKCJPdmVybGFwIGNhY2hlIGFsbCBjbGVhciBhbmQgbm8gMTFCIFNUQSBkZXRlY3RlZCIpKTspCisgICAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZTExZ1Byb3RlY3Rpb24ocE1hYywgZmFsc2UsIHRydWUsICZiZWFjb25QYXJhbXMsIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmICghcHNlc3Npb25FbnRyeS0+Z0xpbU92ZXJsYXAxMWdQYXJhbXMubnVtU3RhKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAocHNlc3Npb25FbnRyeS0+Z0xpbU92ZXJsYXAxMWdQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKCFwc2Vzc2lvbkVudHJ5LT5nTGltMTFnUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgUEVMT0cxKGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiT3ZlcmxhcCBjYWNoZSBhbGwgY2xlYXIgYW5kIG5vIDExRyBTVEEgZGV0ZWN0ZWQiKSk7KQorICAgICAgICAgICAgICAgICAgICBsaW1FbmFibGVIdFByb3RlY3Rpb25Gcm9tMTFnKHBNYWMsIGZhbHNlLCB0cnVlLCAmYmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmICghcHNlc3Npb25FbnRyeS0+Z0xpbU92ZXJsYXBIdDIwUGFyYW1zLm51bVN0YSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPmdMaW1PdmVybGFwSHQyMFBhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoIXBzZXNzaW9uRW50cnktPmdMaW1IdDIwUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgUEVMT0cxKGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiT3ZlcmxhcCBjYWNoZSBhbGwgY2xlYXIgYW5kIG5vIEhUMjAgU1RBIGRldGVjdGVkIikpOykKKyAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlMTFnUHJvdGVjdGlvbihwTWFjLCBmYWxzZSwgdHJ1ZSwgJmJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBlbmFibGUgPSAwOworICAgIH0KKworICAgIGlmKGJlYWNvblBhcmFtcy5wYXJhbUNoYW5nZUJpdG1hcCkKKyAgICB7CisgICAgICAgIHNjaFNldEZpeGVkQmVhY29uRmllbGRzKHBNYWMscHNlc3Npb25FbnRyeSk7CisgICAgICAgIGxpbVNlbmRCZWFjb25QYXJhbXMocE1hYywgJmJlYWNvblBhcmFtcywgcHNlc3Npb25FbnRyeSk7CisgICAgfQorCisgICAgLy8gU3RhcnQgT0xCQyB0aW1lcgorICAgIGlmICh0eF90aW1lcl9hY3RpdmF0ZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltVXBkYXRlT2xiY0NhY2hlVGltZXIpICE9IFR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pCisgICAgICAgIHsKKyAgICAgICAgICAgICBmTnVsbFNzaWQgPSB0cnVlOworICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLyogY2hlY2sgaWYgYWxsIHRoZSBjaGFyYWN0ZXMgaW4gU1NJRCBhcmUgTlVMTCovCisgICAgICAgICAgICBTc2lkTGVuZ3RoID0gcFNzaWQtPmxlbmd0aDsKKyAgICAgICAgICAgIHBTc2lkU3RyID0gcFNzaWQtPnNzSWQ7CisKKyAgICAgICAgICAgIHdoaWxlICggU3NpZExlbmd0aCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoICpwU3NpZFN0ciApCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgcFNzaWRTdHIrKzsKKyAgICAgICAgICAgICAgICBTc2lkTGVuZ3RoLS07CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmKCAwID09IFNzaWRMZW5ndGggKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGZOdWxsU3NpZCA9IHRydWU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgd2hpbGUoIDAgKTsKKworICAgIHJldHVybiBmTnVsbFNzaWQ7Cit9IC8qKioqKiogZW5kIGxpbUlzTnVsbFNzaWQoKSAqKioqKiovCisKKworCisKKy8qKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCitcZm4gbGltVXBkYXRlUHJvdFN0YVBhcmFtcworXGJyaWVmIHVwZGF0ZXMgcHJvdGVjdGlvbiByZWxhdGVkIGNvdW50ZXJzLgorXHBhcmFtICAgICAgdHBBbmlTaXJHbG9iYWwgICAgcE1hYworXHBhcmFtICAgICAgdFNpck1hY0FkZHIgcGVlck1hY0FkZHIKK1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LCBMT0cxKTspCisKKyAgICAgICAgICBpZiAodm9zX21lbV9jb21wYXJlKAorICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wcm90U3RhQ2FjaGVbaV0uYWRkciwKKyAgICAgICAgICAgICAgcGVlck1hY0FkZHIsIHNpemVvZih0U2lyTWFjQWRkcikpKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICAgUEVMT0cxKGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgibWF0Y2hpbmcgY2FjaGUgZW50cnkgYXQgJWQgYWxyZWFkeSBhY3RpdmUuIiksIGkpOykKKyAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgIH0KKyAgICAgIH0KKyAgfQorCisgIGZvciAoaT0wOyBpPExJTV9QUk9UX1NUQV9DQUNIRV9TSVpFOyBpKyspCisgIHsKKyAgICAgIGlmICghcHNlc3Npb25FbnRyeS0+cHJvdFN0YUNhY2hlW2ldLmFjdGl2ZSkKKyAgICAgICAgICBicmVhazsKKyAgfQorCisgIGlmIChpID49IExJTV9QUk9UX1NUQV9DQUNIRV9TSVpFKQorICB7CisgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJObyBzcGFjZSBpbiBQcm90U3RhQ2FjaGUiKSk7KQorICAgICAgcmV0dXJuOworICB9CisKKyAgdm9zX21lbV9jb3B5KCBwc2Vzc2lvbkVudHJ5LT5wcm90U3RhQ2FjaGVbaV0uYWRkciwKKyAgICAgICAgICAgICAgICBwZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKworICBwc2Vzc2lvbkVudHJ5LT5wcm90U3RhQ2FjaGVbaV0ucHJvdFN0YUNhY2hlVHlwZSA9IHByb3RTdGFDYWNoZVR5cGU7CisgIHBzZXNzaW9uRW50cnktPnByb3RTdGFDYWNoZVtpXS5hY3RpdmUgPSB0cnVlOworICBpZihlTElNX1BST1RfU1RBX0NBQ0hFX1RZUEVfbGxCID09IHByb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ICAgICAgICAKKyAgICAgICAgICAgIGlmKGZhbHNlID09IHBTdGFEcy0+bWxtU3RhQ29udGV4dC5odENhcGFiaWxpdHkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltRW5hYmxlMTFhUHJvdGVjdGlvbihwTWFjLCB0cnVlLCBmYWxzZSwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZihTSVJfQkFORF8yXzRfR0haPT0gcmZCYW5kKQorICAgIHsKKyAgICAgICAgbGltR2V0UGh5TW9kZShwTWFjLCAmcGh5TW9kZSwgcHNlc3Npb25FbnRyeSk7CisKKyAgICAgICAgLy9XZSBhcmUgMTFHLiBDaGVjayBpZiB3ZSBuZWVkIHByb3RlY3Rpb24gZnJvbSAxMWIgU3RhdGlvbnMuCisgICAgICAgIGlmICgocGh5TW9kZSA9PSBXTklfQ0ZHX1BIWV9NT0RFXzExRykgJiYKKyAgICAgICAgICAgICAgKGZhbHNlID09IHBzZXNzaW9uRW50cnktPmh0Q2FwYWJpbGl0eSkpCisgICAgICAgIHsKKworICAgICAgICAgICAgaWYgKHBTdGFEcy0+ZXJwRW5hYmxlZD09IGVIQUxfQ0xFQVIpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcHJvdFN0YUNhY2hlVHlwZSA9IGVMSU1fUFJPVF9TVEFfQ0FDSEVfVFlQRV9sbEI7CisgICAgICAgICAgICAgICAgLy8gZW5hYmxlIHByb3RlY3Rpb24KKyAgICAgICAgICAgICAgICBQRUxPRzMobGltTG9nKHBNYWMsIExPRzMsIEZMKCJFbmFibGluZyBwcm90ZWN0aW9uIGZyb20gMTFCIikpOykKKyAgICAgICAgICAgICAgICBsaW1FbmFibGUxMWdQcm90ZWN0aW9uKHBNYWMsIHRydWUsIGZhbHNlLCBwQmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy9IVCBzdGF0aW9uLgorICAgICAgICBpZiAodHJ1ZSA9PSBwc2Vzc2lvbkVudHJ5LT5odENhcGFiaWxpdHkpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vY2hlY2sgaWYgd2UgbmVlZCBwcm90ZWN0aW9uIGZyb20gMTFiIHN0YXRpb24KKyAgICAgICAgICAgIGlmICgocFN0YURzLT5lcnBFbmFibGVkID09IGVIQUxfQ0xFQVIpICYmCisgICAgICAgICAgICAgICAgKCFwU3RhRHMtPm1sbVN0YUNvbnRleHQuaHRDYXBhYmlsaXR5KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwcm90U3RhQ2FjaGVUeXBlID0gZUxJTV9QUk9UX1NUQV9DQUNIRV9UWVBFX2xsQjsKKyAgICAgICAgICAgICAgICAvLyBlbmFibGUgcHJvdGVjdGlvbgorICAgICAgICAgICAgICAgIFBFTE9HMyhsaW1Mb2cocE1hYywgTE9HMywgRkwoIkVuYWJsaW5nIHByb3RlY3Rpb24gZnJvbSAxMUIiKSk7KQorICAgICAgICAgICAgICAgIGxpbUVuYWJsZTExZ1Byb3RlY3Rpb24ocE1hYywgdHJ1ZSwgZmFsc2UsIHBCZWFjb25QYXJhbXMsIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy9zdGF0aW9uIGJlaW5nIGpvaW5lZCBpcyBub24tMTFiIGFuZCBub24taHQgPT0+IDExZyBkZXZpY2UKKyAgICAgICAgICAgIGVsc2UgaWYoIXBTdGFEcy0+bWxtU3RhQ29udGV4dC5odENhcGFiaWxpdHkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcHJvdFN0YUNhY2hlVHlwZSA9IGVMSU1fUFJPVF9TVEFfQ0FDSEVfVFlQRV9sbEc7CisgICAgICAgICAgICAgICAgLy9lbmFibGUgcHJvdGVjdGlvbgorICAgICAgICAg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UEVMT0cxKGxpbUxvZyhwTWFjLExPRzEsRkwoIlNob3J0IFByZWFtYmxlIGlzIG5vdCBlbmFibGVkIGluIEFzc29jIFJlcSBmcm9tICIpKTsKKyAgICAgICAgICAgICAgICAgICAgbGltUHJpbnRNYWNBZGRyKHBNYWMsIHBlZXJNYWNBZGRyLCBMT0cxKTspCisKKyAgICAgICAgICAgICAgICBmb3IgKGk9MDsgaTxMSU1fUFJPVF9TVEFfQ0FDSEVfU0laRTsgaSsrKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFICkgICYmCisgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltTm9TaG9ydFBhcmFtcy5zdGFOb1Nob3J0Q2FjaGVbaV0uYWN0aXZlKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodm9zX21lbV9jb21wYXJlKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbU5vU2hvcnRQYXJhbXMuc3RhTm9TaG9ydENhY2hlW2ldLmFkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZWVyTWFjQWRkciwgc2l6ZW9mKHRTaXJNYWNBZGRyKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH1lbHNlIGlmKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgIT0gZUxJTV9BUF9ST0xFKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHBNYWMtPmxpbS5nTGltTm9TaG9ydFBhcmFtcy5zdGFOb1Nob3J0Q2FjaGVbaV0uYWN0aXZlKQorICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2b3NfbWVtX2NvbXBhcmUoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbU5vU2hvcnRQYXJhbXMuc3RhTm9TaG9ydENhY2hlW2ldLmFkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZWVyTWFjQWRkciwgc2l6ZW9mKHRTaXJNYWNBZGRyKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKworICAgICAgICAgICAgZm9yIChpPTA7IGk8TElNX1BST1RfU1RBX0NBQ0hFX1NJWkU7IGkrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoIChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQVBfUk9MRSApICAmJgorICAgICAgICAgICAgICAgICAgICAgICFwc2Vzc2lvbkVudHJ5LT5nTGltTm9TaG9ydFBhcmFtcy5zdGFOb1Nob3J0Q2FjaGVbaV0uYWN0aXZlKQorICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgZWxzZSAgICAgICAgCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAoIXBNYWMtPmxpbS5nTGltTm9TaG9ydFBhcmFtcy5zdGFOb1Nob3J0Q2FjaGVbaV0uYWN0aXZlKQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChpID49IExJTV9QUk9UX1NUQV9DQUNIRV9TSVpFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFKXsKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJObyBzcGFjZSBpbiBTaG9ydCBjYWNoZSAoI2FjdGl2ZSAlZCwgI3N0YSAlZCkgZm9yIHN0YSAiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpLCBwc2Vzc2lvbkVudHJ5LT5nTGltTm9TaG9ydFBhcmFtcy5udW1Ob25TaG9ydFByZWFtYmxlU3RhKTsKKyAgICAgICAgICAgICAgICAgICAgbGltUHJpbnRNYWNBZGRyKHBNYWMsIHBlZXJNYWNBZGRyLCBMT0dFKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIk5vIHNwYWNlIGluIFNob3J0IGNhY2hlICgjYWN0aXZlICVkLCAjc3RhICVkKSBmb3Igc3RhICIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGksIHBNYWMtPmxpbS5nTGltTm9TaG9ydFBhcmFtcy5udW1Ob25TaG9ydFByZWFtYmxlU3RhKTsKKyAgICAgICAgICAgICAgICAgICAgbGltUHJpbnRNYWNBZGRyKHBNYWMsIHBlZXJNYWNBZGRyLCBMT0dFKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgfQorCisKKyAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQVBfUk9MRSl7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCBwc2Vzc2lvbkVudHJ5LT5nTGltTm9TaG9ydFBhcmFtcy5zdGFOb1Nob3J0Q2FjaGVbaV0uYWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBlZXJNYWNBZGRyLCAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbU5vU2hvcnRQYXJhbXMuc3RhTm9TaG9ydENhY2hlW2ldLmFjdGl2ZSA9IHRydWU7CisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbU5vU2hvcnRQYXJhbXMubnVtTm9uU2hvcnRQcmVhbWJsZVN0YSsrOworICAgICAgICAgICAgfWVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoICBwTWFjLT5saW0uZ0xpbU5vU2hvcnRQYXJhbXMuc3RhTm9TaG9ydENhY2hlW2ldLmFkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVlck1hY0FkZHIsICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbU5vU2hvcnRQYXJhbXMuc3RhTm9TaG9ydENhY2hlW2ldLmFjdGl2ZSA9IHRydWU7CisgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1Ob1Nob3J0UGFyYW1zLm51bU5vblNob3J0UHJlYW1ibGVTdGErKzsgICAgICAgIAorICAgICAgICAgICAgfSAKKworCisgICAgICAgICAgICAvLyBlbmFibGUgbG9uZyBwcmVhbWJsZQorICAgICAgICAgICAgUEVMT0cxKGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiRGlzYWJsaW5nIHNob3J0IHByZWFtYmxlIikpOykKKworICAgICAgICAgICAgaWYgKGxpbUVuYWJsZVNob3J0UHJlYW1ibGUocE1hYywgZmFsc2UsIHBCZWFjb25QYXJhbXMsIHBzZXNzaW9uRW50cnkpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJDYW5ub3QgZW5hYmxlIGxvbmcgcHJlYW1ibGUiKSk7KQorICAgICAgICB9CisgICAgfQorfQorC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k8TElNX1BST1RfU1RBX0NBQ0hFX1NJWkU7IGkrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFICkgJiYKKyAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW1Ob1Nob3J0U2xvdFBhcmFtcy5zdGFOb1Nob3J0U2xvdENhY2hlW2ldLmFjdGl2ZSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmICh2b3NfbWVtX2NvbXBhcmUoCisgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbU5vU2hvcnRTbG90UGFyYW1zLnN0YU5vU2hvcnRTbG90Q2FjaGVbaV0uYWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICBwZWVyTWFjQWRkciwgc2l6ZW9mKHRTaXJNYWNBZGRyKSkpCisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSAhPSBlTElNX0FQX1JPTEUgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHBNYWMtPmxpbS5nTGltTm9TaG9ydFNsb3RQYXJhbXMuc3RhTm9TaG9ydFNsb3RDYWNoZVtpXS5hY3RpdmUpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2b3NfbWVtX2NvbXBhcmUoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1Ob1Nob3J0U2xvdFBhcmFtcy5zdGFOb1Nob3J0U2xvdENhY2hlW2ldLmFkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVlck1hY0FkZHIsIHNpemVvZih0U2lyTWFjQWRkcikpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZvciAoaT0wOyBpPExJTV9QUk9UX1NUQV9DQUNIRV9TSVpFOyBpKyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQVBfUk9MRSApICYmCisgICAgICAgICAgICAgICAgICAgICAhcHNlc3Npb25FbnRyeS0+Z0xpbU5vU2hvcnRTbG90UGFyYW1zLnN0YU5vU2hvcnRTbG90Q2FjaGVbaV0uYWN0aXZlKQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICBpZiAoIXBNYWMtPmxpbS5nTGltTm9TaG9ydFNsb3RQYXJhbXMuc3RhTm9TaG9ydFNsb3RDYWNoZVtpXS5hY3RpdmUpCisgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChpID49IExJTV9QUk9UX1NUQV9DQUNIRV9TSVpFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFKXsKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJObyBzcGFjZSBpbiBTaG9ydFNsb3QgY2FjaGUgKCNhY3RpdmUgJWQsICNzdGEgJWQpIGZvciBzdGEgIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSwgcHNlc3Npb25FbnRyeS0+Z0xpbU5vU2hvcnRTbG90UGFyYW1zLm51bU5vblNob3J0U2xvdFN0YSk7CisgICAgICAgICAgICAgICAgICAgIGxpbVByaW50TWFjQWRkcihwTWFjLCBwZWVyTWFjQWRkciwgTE9HRSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9ZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJObyBzcGFjZSBpbiBTaG9ydFNsb3QgY2FjaGUgKCNhY3RpdmUgJWQsICNzdGEgJWQpIGZvciBzdGEgIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBpLCBwTWFjLT5saW0uZ0xpbU5vU2hvcnRTbG90UGFyYW1zLm51bU5vblNob3J0U2xvdFN0YSk7CisgICAgICAgICAgICAgICAgICAgIGxpbVByaW50TWFjQWRkcihwTWFjLCBwZWVyTWFjQWRkciwgTE9HRSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKworICAgICAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0FQX1JPTEUpeworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSggIHBzZXNzaW9uRW50cnktPmdMaW1Ob1Nob3J0U2xvdFBhcmFtcy5zdGFOb1Nob3J0U2xvdENhY2hlW2ldLmFkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVlck1hY0FkZHIsIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW1Ob1Nob3J0U2xvdFBhcmFtcy5zdGFOb1Nob3J0U2xvdENhY2hlW2ldLmFjdGl2ZSA9IHRydWU7CisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbU5vU2hvcnRTbG90UGFyYW1zLm51bU5vblNob3J0U2xvdFN0YSsrOworICAgICAgICAgICAgfWVsc2UKKyA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c3Npb25FbnRyeSk7CisgICAgbGltR2V0UGh5TW9kZShwTWFjLCAmcGh5TW9kZSwgcHNlc3Npb25FbnRyeSk7CisKKyAgICBpZihTSVJfQkFORF81X0dIWiA9PSByZkJhbmQpCisgICAgeworICAgICAgICBpZigoZVNJUl9IVF9PUF9NT0RFX01JWEVEID09IHBCZWFjb25TdHJ1Y3QtPkhUSW5mby5vcE1vZGUpICB8fAorICAgICAgICAgICAgICAgICAgICAoZVNJUl9IVF9PUF9NT0RFX09WRVJMQVBfTEVHQUNZID09IHBCZWFjb25TdHJ1Y3QtPkhUSW5mby5vcE1vZGUpKQorICAgICAgICB7CisgICAgICAgICAgICBpZihwTWFjLT5saW0uY2ZnUHJvdGVjdGlvbi5mcm9tbGxhKQorICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmJlYWNvblBhcmFtcy5sbGFDb2V4aXN0ID0gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmKGVTSVJfSFRfT1BfTU9ERV9OT19MRUdBQ1lfMjBNSFpfSFQgPT0gcEJlYWNvblN0cnVjdC0+SFRJbmZvLm9wTW9kZSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYocE1hYy0+bGltLmNmZ1Byb3RlY3Rpb24uaHQyMCkKKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5iZWFjb25QYXJhbXMuaHQyMENvZXhpc3QgPSB0cnVlOworICAgICAgICB9CisKKyAgICB9CisgICAgZWxzZSBpZihTSVJfQkFORF8yXzRfR0haID09IHJmQmFuZCkKKyAgICB7CisgICAgICAgIC8vc3BlYyA3LjMuMi4xMworICAgICAgICAvL1VzZVByb3RlY3Rpb24gd2lsbCBiZSBzZXQgd2hlbiBub25FUlAgU1RBIGlzIGFzc29jaWF0ZWQuCisgICAgICAgIC8vTm9uRVJQUHJlc2VudCBiaXQgd2lsbCBiZSBzZXQgd2hlbjoKKyAgICAgICAgLy8tLW5vbkVSUCBTdGEgaXMgYXNzb2NpYXRlZCBPUgorICAgICAgICAvLy0tbm9uRVJQIFN0YSBleGlzdHMgaW4gb3ZlcmxhcHBpbmcgQlNTCisgICAgICAgIC8vd2hlbiB1c2VQcm90ZWN0aW9uIGlzIG5vdCBzZXQgdGhlbiBwcm90ZWN0aW9uIGZyb20gbm9uRVJQIHN0YXRpb25zIGlzIG9wdGlvbmFsLgorCisgICAgICAgIC8vQ0ZHIHByb3RlY3Rpb24gZnJvbSAxMWIgaXMgZW5hYmxlZCBhbmQKKyAgICAgICAgLy8xMUIgZGV2aWNlIGluIHRoZSBCU1MKKyAgICAgICAgIC8qIFRPRE8sIFRoaXMgaXMgbm90IHNlc3Npb25pemVkICovCisgICAgICAgIGlmIChwaHlNb2RlICE9IFdOSV9DRkdfUEhZX01PREVfMTFCKSAKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKHBNYWMtPmxpbS5jZmdQcm90ZWN0aW9uLmZyb21sbGIgJiYKKyAgICAgICAgICAgICAgICBwQmVhY29uU3RydWN0LT5lcnBQcmVzZW50ICYmCisgICAgICAgICAgICAgICAgKHBCZWFjb25TdHJ1Y3QtPmVycElFSW5mby51c2VQcm90ZWN0aW9uIHx8CisgICAgICAgICAgICAgICAgcEJlYWNvblN0cnVjdC0+ZXJwSUVJbmZvLm5vbkVycFByZXNlbnQpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmJlYWNvblBhcmFtcy5sbGJDb2V4aXN0ID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vQVAgaGFzIG5vIDExYiBzdGF0aW9uIGFzc29jaWF0ZWQuCisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+YmVhY29uUGFyYW1zLmxsYkNvZXhpc3QgPSBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAvL2ZvbGxvd2luZyBjb2RlIGJsb2NrIGlzIG9ubHkgZm9yIEhUIHN0YXRpb24uCisgICAgICAgIGlmKChwc2Vzc2lvbkVudHJ5LT5odENhcGFiaWxpdHkpICYmCisgICAgICAgICAgICAgIChwQmVhY29uU3RydWN0LT5IVEluZm8ucHJlc2VudCkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHREb3QxMWZJRUhUSW5mbyBodEluZm8gPSBwQmVhY29uU3RydWN0LT5IVEluZm87CisgICAgICAgICAgIAorICAgICAgICAgICAgLy9PYnNzIE5vbiBIVCBTVEEgcHJlc2VudCBtb2RlIAorICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+YmVhY29uUGFyYW1zLmdIVE9ic3NNb2RlID0gICh0QU5JX1U4KWh0SW5mby5vYnNzTm9uSFRTdGFQcmVzZW50OworCisgICAgICAgICAgICAKKyAgICAgICAgICAvL0NGRyBwcm90ZWN0aW9uIGZyb20gMTFHIGlzIGVuYWJsZWQgYW5kCisgICAgICAgICAgICAvL291ciBBUCBoYXMgYXQgbGVhc3Qgb25lIDExRyBzdGF0aW9uIGFzc29jaWF0ZWQuICAgICAgIAorICAgICAgICAgICAgaWYocE1hYy0+bGltLmNmZ1Byb3RlY3Rpb24uZnJvbWxsZyAmJgorICAgICAgICAgICAgICAgICAgKChlU0lSX0hUX09QX01PREVfTUlYRUQgPT0gaHRJbmZvLm9wTW9kZSkgIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAoZVNJUl9IVF9PUF9NT0RFX09WRVJMQVBfTEVHQUNZID09IGh0SW5mby5vcE1vZGUpKSYmCisgICAgICAgICAgICAgICAgICAgICAgKCFwc2Vzc2lvbkVudHJ5LT5iZWFjb25QYXJhbXMubGxiQ29leGlzdCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYocE1hYy0+bGltLmNmZ1Byb3RlY3Rpb24uZnJvbWxsZykKKyAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+YmVhY29uUGFyYW1zLmxsZ0NvZXhp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7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKGVTSVJfSFRfT1BfTU9ERV9QVVJFID09IHBCZWFjb25TdHJ1Y3QtPkhUSW5mby5vcE1vZGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltRW5hYmxlMTFhUHJvdGVjdGlvbihwTWFjLCBmYWxzZSwgZmFsc2UsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7ICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgbGltRW5hYmxlSFQyMFByb3RlY3Rpb24ocE1hYywgZmFsc2UsIGZhbHNlLCBwQmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYoU0lSX0JBTkRfMl80X0dIWiA9PSByZkJhbmQpCisgICAgeworICAgICAgICAvKiBzcGVjIDcuMy4yLjEzCisgICAgICAgICAqIFVzZVByb3RlY3Rpb24gd2lsbCBiZSBzZXQgd2hlbiBub25FUlAgU1RBIGlzIGFzc29jaWF0ZWQuCisgICAgICAgICAqIE5vbkVSUFByZXNlbnQgYml0IHdpbGwgYmUgc2V0IHdoZW46CisgICAgICAgICAqIC0tbm9uRVJQIFN0YSBpcyBhc3NvY2lhdGVkIE9SCisgICAgICAgICAqIC0tbm9uRVJQIFN0YSBleGlzdHMgaW4gb3ZlcmxhcHBpbmcgQlNTCisgICAgICAgICAqIHdoZW4gdXNlUHJvdGVjdGlvbiBpcyBub3Qgc2V0IHRoZW4gcHJvdGVjdGlvbiBmcm9tIG5vbkVSUCBzdGF0aW9ucyBpcyBvcHRpb25hbC4KKyAgICAgICAgICovCisKKyAgICAgICAgaWYgKHBoeU1vZGUgIT0gV05JX0NGR19QSFlfTU9ERV8xMUIpIAorICAgICAgICB7CisgICAgICAgICAgICBpZiAocEJlYWNvblN0cnVjdC0+ZXJwUHJlc2VudCAmJgorICAgICAgICAgICAgICAgICAgKHBCZWFjb25TdHJ1Y3QtPmVycElFSW5mby51c2VQcm90ZWN0aW9uIHx8CisgICAgICAgICAgICAgICAgICBwQmVhY29uU3RydWN0LT5lcnBJRUluZm8ubm9uRXJwUHJlc2VudCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltRW5hYmxlMTFnUHJvdGVjdGlvbihwTWFjLCB0cnVlLCBmYWxzZSwgcEJlYWNvblBhcmFtcywgcHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvL0FQIGhhcyBubyAxMWIgc3RhdGlvbiBhc3NvY2lhdGVkLgorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vZGlzYWJsZSBwcm90ZWN0aW9uIGZyb20gMTFiIHN0YXRpb24KKyAgICAgICAgICAgICAgICBsaW1FbmFibGUxMWdQcm90ZWN0aW9uKHBNYWMsIGZhbHNlLCBmYWxzZSwgcEJlYWNvblBhcmFtcywgcHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICB9CisgICAgICAgICB9CisKKyAgICAgICAgLy9mb2xsb3dpbmcgY29kZSBibG9jayBpcyBvbmx5IGZvciBIVCBzdGF0aW9uLgorICAgICAgICBpZigocHNlc3Npb25FbnRyeS0+aHRDYXBhYmlsaXR5KSAmJgorICAgICAgICAgICAgICAocEJlYWNvblN0cnVjdC0+SFRJbmZvLnByZXNlbnQpKQorICAgICAgICB7CisgICAgICAgICAgCisgICAgICAgICAgICB0RG90MTFmSUVIVEluZm8gaHRJbmZvID0gcEJlYWNvblN0cnVjdC0+SFRJbmZvOworICAgICAgICAgICAgLy9BUCBoYXMgYXQgbGVhc3Qgb25lIDExRyBzdGF0aW9uIGFzc29jaWF0ZWQuCisgICAgICAgICAgICBpZigoKGVTSVJfSFRfT1BfTU9ERV9NSVhFRCA9PSBodEluZm8ub3BNb2RlKSAgfHwKKyAgICAgICAgICAgICAgICAgIChlU0lSX0hUX09QX01PREVfT1ZFUkxBUF9MRUdBQ1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MjAKKyAgICAgICAgICAgICAgICAgLy9kaXNhYmxlIHByb3RlY3Rpb24gZnJvbSBhbnkgbm9uLUhUIGRldmljZXMuCisgICAgICAgICAgICAgICAgIC8vZGVjaXNpb24gZm9yIGRpc2FibGluZyBwcm90ZWN0aW9uIGZyb20gMTFiIGhhcyBhbHJlYWR5IGJlZW4gdGFrZW4gYWJvdmUuCisgICAgICAgICAgICAgICAgaWYoZVNJUl9IVF9PUF9NT0RFX05PX0xFR0FDWV8yME1IWl9IVCA9PSBodEluZm8ub3BNb2RlKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy9EaXNhYmxlIHByb3RlY3Rpb24gZnJvbSAxMUcgc3RhdGlvbi4KKyAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRQcm90ZWN0aW9uRnJvbTExZyhwTWFjLCBmYWxzZSwgZmFsc2UsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7CisgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBsaW1FbmFibGVIVDIwUHJvdGVjdGlvbihwTWFjLCB0cnVlLCBmYWxzZSwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLy9EaXNhYmxlIHByb3RlY3Rpb24gZnJvbSBub24tSFQgYW5kIEhUMjAgZGV2aWNlcy4KKyAgICAgICAgICAgICAgICAvL2RlY2lzaW9uIGZvciBkaXNhYmxpbmcgcHJvdGVjdGlvbiBmcm9tIDExYiBoYXMgYWxyZWFkeSBiZWVuIHRha2VuIGFib3ZlLgorICAgICAgICAgICAgICAgIGVsc2UgaWYoZVNJUl9IVF9PUF9NT0RFX1BVUkUgPT0gaHRJbmZvLm9wTW9kZSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZUh0UHJvdGVjdGlvbkZyb20xMWcocE1hYywgZmFsc2UsIGZhbHNlLCBwQmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgICAgICBsaW1FbmFibGVIVDIwUHJvdGVjdGlvbihwTWFjLCBmYWxzZSwgZmFsc2UsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvL2ZvbGxvd2luZyBjb2RlIGJsb2NrIGlzIG9ubHkgZm9yIEhUIHN0YXRpb24uICggMi40IEdIWiBhcyB3ZWxsIGFzIDUgR0haKQorICAgIGlmKChwc2Vzc2lvbkVudHJ5LT5odENhcGFiaWxpdHkpICYmCisgICAgICAgICAgKHBCZWFjb25TdHJ1Y3QtPkhUSW5mby5wcmVzZW50KSkKKyAgICB7CisgICAgICAgIHREb3QxMWZJRUhUSW5mbyBodEluZm8gPSBwQmVhY29uU3RydWN0LT5IVEluZm87ICAgIAorICAgICAgICAvL0NoZWNrIGZvciBjaGFuZ2VzIGluIHByb3RlY3Rpb24gcmVsYXRlZCBmYWN0b3JzIG90aGVyIHRoYW4gSFQgb3BlcmF0aW5nIG1vZGUuCisgICAgICAgIC8vQ2hlY2sgZm9yIGNoYW5nZXMgaW4gUklGUyBtb2RlLCBub25HRkRldmljZXNQcmVzZW50LCBsc2lnVFhPUFByb3RlY3Rpb25GdWxsU3VwcG9ydC4KKyAgICAgICAgaWYgKCBwc2Vzc2lvbkVudHJ5LT5iZWFjb25QYXJhbXMuZlJJRlNNb2RlICE9IAorICAgICAgICAgICAgICAgICggdEFOSV9VOCApIGh0SW5mby5yaWZzTW9kZSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBCZWFjb25QYXJhbXMtPmZSSUZTTW9kZSA9IAorICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmJlYWNvblBhcmFtcy5mUklGU01vZGUgID0gCisgICAgICAgICAgICAgICAgKCB0QU5JX1U4ICkgaHRJb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NoYW5uZWxTd2l0Y2hUaW1lci5zZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX01BQ19VTlNQRUNfRkFJTFVSRV9SRUFTT04pOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIGxpbUNvdmVydENoYW5uZWxTY2FuVHlwZShwTWFjLCBwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwsIGZhbHNlKTsKKyAgICBwTWFjLT5saW0uZGZzY2hhbm5lbExpc3QudGltZVN0YW1wW3BzZXNzaW9uRW50cnktPmN1cnJlbnRPcGVyQ2hhbm5lbF0gPSAwOworICAgIHN3aXRjaChwc2Vzc2lvbkVudHJ5LT5nTGltQ2hhbm5lbFN3aXRjaC5zdGF0ZSkKKyAgICB7CisgICAgICAgIGNhc2UgZUxJTV9DSEFOTkVMX1NXSVRDSF9QUklNQVJZX09OTFk6CisgICAgICAgIGNhc2UgZUxJTV9DSEFOTkVMX1NXSVRDSF9QUklNQVJZX0FORF9TRUNPTkRBUlk6CisgICAgICAgICAgICBpZiAoIGlzTGltU2Vzc2lvbk9mZkNoYW5uZWwocE1hYywKKyAgICAgICAgICAgICAgICBwTWFjLT5saW0ubGltVGltZXJzLmdMaW1DaGFubmVsU3dpdGNoVGltZXIuc2Vzc2lvbklkKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltU3VzcGVuZExpbmsocE1hYywKKyAgICAgICAgICAgICAgICAgICAgZVNJUl9ET05UX0NIRUNLX0xJTktfVFJBRkZJQ19CRUZPUkVfU0NBTiwKKyAgICAgICAgICAgICAgICAgICAgbGltUHJvY2Vzc0NoYW5uZWxTd2l0Y2hTdXNwZW5kTGluaywKKyAgICAgICAgICAgICAgICAgICAgKHRBTklfVTMyKilwc2Vzc2lvbkVudHJ5ICk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltUHJvY2Vzc0NoYW5uZWxTd2l0Y2hTdXNwZW5kTGluayhwTWFjLAorICAgICAgICAgICAgICAgICAgICBlSEFMX1NUQVRVU19TVUNDRVNTLAorICAgICAgICAgICAgICAgICAgICAodEFOSV9VMzIqKXBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlTElNX0NIQU5ORUxfU1dJVENIX1NFQ09OREFSWV9PTkxZOgorICAgICAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiQ0hBTk5FTF9TV0lUQ0hfU0VDT05EQVJZX09OTFkgIikpOykKKyAgICAgICAgICAgIGxpbVN3aXRjaFByaW1hcnlTZWNvbmRhcnlDaGFubmVsKHBNYWMsIHBzZXNzaW9uRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltQ2hhbm5lbFN3aXRjaC5zZWNvbmRhcnlTdWJCYW5kKTsKKyAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW1DaGFubmVsU3dpdGNoLnN0YXRlID0gZUxJTV9DSEFOTkVMX1NXSVRDSF9JRExFOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZUxJTV9DSEFOTkVMX1NXSVRDSF9JRExFOgorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiaW5jb3JyZWN0IHN0YXRlICIpKTspCisgICAgICAgICAgICBpZihsaW1SZXN0b3JlUHJlQ2hhbm5lbFN3aXRjaFN0YXRlKHBNYWMsIHBzZXNzaW9uRW50cnkpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg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mV3Q2hhbldpZHRoID09IFdOSV9DRkdfVkhUX0NIQU5ORUxfV0lEVEhfODBNSFopCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBCZWFjb24tPmV4dENoYW5uZWxTd2l0Y2hQcmVzZW50KQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgocEJlYWNvbi0+ZXh0Q2hhbm5lbFN3aXRjaElFLnNlY29uZGFyeUNoYW5uZWxPZmZzZXQgPT0gUEhZX0RPVUJMRV9DSEFOTkVMX0xPV19QUklNQVJZKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocEJlYWNvbi0+ZXh0Q2hhbm5lbFN3aXRjaElFLnNlY29uZGFyeUNoYW5uZWxPZmZzZXQgPT0gUEhZX0RPVUJMRV9DSEFOTkVMX0hJR0hfUFJJTUFSWSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltQ2hhbm5lbFN3aXRjaC5zdGF0ZSA9IGVMSU1fQ0hBTk5FTF9TV0lUQ0hfUFJJTUFSWV9BTkRfU0VDT05EQVJZOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltQ2hhbm5lbFN3aXRjaC5zZWNvbmRhcnlTdWJCYW5kID0gbGltR2V0MTFBQ1BoeUNCU3RhdGUocE1hYywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltQ2hhbm5lbFN3aXRjaC5wcmltYXJ5Q2hhbm5lbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCZWFjb24tPmV4dENoYW5uZWxTd2l0Y2hJRS5zZWNvbmRhcnlDaGFubmVsT2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFdpZGVyQ2hubFN3aXRjaC0+bmV3Q2VudGVyQ2hhbkZyZXEwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorI2VuZGlmCisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgfQorCisKKyAgICBpZiAoZVNJUl9TVUNDRVNTICE9IGxpbVN0YXJ0Q2hhbm5lbFN3aXRjaChwTWFjLCBwc2Vzc2lvbkVudHJ5KSkKKyAgICB7CisgICAgICAgIFBFTE9HVyhsaW1Mb2cocE1hYywgTE9HVywgRkwoIkNvdWxkIG5vdCBzdGFydCBDaGFubmVsIFN3aXRjaCIpKTspCisgICAgfQorCisgICAgbGltTG9nKHBNYWMsIExPR1csCisgICAgICAgIEZMKCJzZXNzaW9uICVkIHByaW1hcnkgY2hsICVkLCBzdWJiYW5kICVkLCBjb3VudCAgJWQgKCVkIHRpY2tzKSAiKSwKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW1DaGFubmVsU3dpdGNoLnByaW1hcnlDaGFubmVsLAorICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTG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pYyBvbmx5IGlmIGNoYW5uZWwgc3dpdGNoIGlzIG5vdCBydW5uaW5nIGluIHNpbGVudCBtb2RlLgorICAgICAgICAgIGlmICghKChwc2Vzc2lvbkVudHJ5LT5nTGltU3BlY01nbXQuZG90MTFoQ2hhblN3U3RhdGUgPT0gZUxJTV8xMUhfQ0hBTlNXX1JVTk5JTkcpICYmCisgICAgICAgICAgICAgICAgICAocHNlc3Npb25FbnRyeS0+Z0xpbUNoYW5uZWxTd2l0Y2guc3dpdGNoTW9kZSA9PSBlU0lSX0NIQU5TV19NT0RFX1NJTEVOVCkpKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbGltRnJhbWVUcmFuc21pc3Npb25Db250cm9sKHBNYWMsIGVMSU1fVFhfQUxMLCBlTElNX1JFU1VNRV9UWCk7CisgICAgICAgICAgICAgIGxpbVJlc3RvcmVQcmVRdWlldFN0YXRlKHBNYWMsIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgIH0KKyAgICAgIAorICAgICAgICAgIC8qIFJlc2V0IHN0YXR1cyBmbGFnICovCisgICAgICAgICAgaWYoZ2xpbVRyaWdnZXJCYWNrZ3JvdW5kU2NhbkR1cmluZ1F1aWV0QnNzX1N0YXR1cyA9PSBlU0lSX0ZBTFNFKQorICAgICAgICAgICAgICBnbGltVHJpZ2dlckJhY2tncm91bmRTY2FuRHVyaW5nUXVpZXRCc3NfU3RhdHVzID0gZVNJUl9UUlVFOworCisgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0cyLAorICAgICAgICAgICAgICBGTCgiUXVpZXQgQlNTOiBSZXN1bWluZyB0cmFmZmljLi4uIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgIC8vCisgICAgICAgICAgLy8gTm90aGluZyBzcGVjaWZpYyB0byBiZSBkb25lIGluIHRoaXMgY2FzZQorICAgICAgICAgIC8vIEEgYmFja2dyb3VuZCBzY2FuIHRoYXQgd2FzIHRyaWdnZXJlZCBkdXJpbmcKKyAgICAgICAgICAvLyBTSVJfTElNX1FVSUVUX1RJTUVPVVQgd2lsbCBjb21wbGV0ZSBvbiBpdHMgb3duCisgICAgICAgICAgLy8KKyAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPRzIsCisgICAgICAgICAgICAgIEZMKCJCYWNrZ3JvdW5kIHNjYW4gc2hvdWxkIGJlIGNvbXBsZXRlIG5vdy4uLiIpKTsKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBlTElNX1FVSUVUX0lOSVQ6CisgICAgICBjYXNlIGVMSU1fUVVJRVRfQkVHSU46CisgICAgICBjYXNlIGVMSU1fUVVJRVRfRU5EOgorICAgICAgICBQRUxPRzIobGltTG9nKHBNYWMsIExPRzIsIEZMKCJRdWlldCBzdGF0ZSBub3QgaW4gUlVOTklORyIpKTspCisgICAgICAgIC8qIElmIHRoZSBxdWlldCBwZXJpb2QgaGFzIGVuZGVkLCB0aGVuIHJlc3VtZSB0aGUgZnJhbWUgdHJhbnNtaXNzaW9uICovCisgICAgICAgIGxpbUZyYW1lVHJhbnNtaXNzaW9uQ29udHJvbChwTWFjLCBlTElNX1RYX0FMTCwgZUxJTV9SRVNVTUVfVFgpOworICAgICAgICBsaW1SZXN0b3JlUHJlUXVpZXRTdGF0ZShwTWFjLCBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbVNwZWNNZ210LnF1aWV0U3RhdGUgPSBlTElNX1FVSUVUX0lOSVQ7CisgICAgICAgIGJyZWFrOworCisgICAgICBkZWZhdWx0OgorICAgICAgICAvLworICAgICAgICAvLyBBcyBvZiBub3csIG5vdGhpbmcgdG8gYmUgZG9uZQorICAgICAgICAvLworICAgICAgICBicmVhazsKKyAgICB9CisgIH0KK30KKy8qKgorICogbGltUHJvY2Vzc1dQU092ZXJsYXBUaW1lb3V0CisgKgorICogRlVOQ1RJT046IFRoaXMgZnVuY3Rpb24gY2FsbCBsaW1XUF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OworICAgICAgICAqKCh0QU5JX1UxNiAqKXB0cikgPSAgKHRBTklfVTE2KSAoY2ZnVmFsdWUgJiAweGZmZmYpOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICBpZiggaHRDYXAgPCBlSFRfTUFYX1JYX0FNUERVX0ZBQ1RPUiApCisgICAgICAgIHsKKyAgICAgICAgICAvLyBHZXQgSFQgQ2FwYWJpbGl0aWVzCisgICAgICAgICAgaWYoIGVTSVJfU1VDQ0VTUyAhPSB3bGFuX2NmZ0dldEludCggcE1hYywgV05JX0NGR19IVF9DQVBfSU5GTywgJmNmZ1ZhbHVlICkpCisgICAgICAgICAgICBjZmdWYWx1ZSA9IDA7CisgICAgICAgICAgcHRyID0gKHRBTklfVTggKikgJm1hY0hUQ2FwYWJpbGl0eUluZm87CisgICAgICAgICAgLy8gQ1IgMjY1MjgyIE1ETSBTb2Z0QVAgMi40UEw6IFNvZnRBUCBib290IHVwIGNyYXNoIGluIDIuNCBQTCBidWlsZHMgd2hpbGUgc2FtZSBXTEFOIFNVIGlzIHdvcmtpbmcgb24gMi4xIFBMCisgICAgICAgICAgKnB0cisrID0gY2ZnVmFsdWUgJiAweGZmOworICAgICAgICAgICpwdHIgPSAoY2ZnVmFsdWUgPj4gOCkgJiAweGZmOworICAgICAgICB9CisgICAgICB9CisgICAgfQorICB9CisKKyAgc3dpdGNoKCBodENhcCApCisgIHsKKyAgICBjYXNlIGVIVF9MU0lHX1RYT1BfUFJPVEVDVElPTjoKKyAgICAgIHJldFZhbCA9IHBNYWMtPmxpbS5nSFRMc2lnVFhPUFByb3RlY3Rpb247CisgICAgICBicmVhazsKKworICAgIGNhc2UgZUhUX1NUQkNfQ09OVFJPTF9GUkFNRToKKyAgICAgIHJldFZhbCA9ICh0QU5JX1U4KSBtYWNIVENhcGFiaWxpdHlJbmZvLnN0YmNDb250cm9sRnJhbWU7CisgICAgICBicmVhazsKKworICAgIGNhc2UgZUhUX1BTTVA6CisgICAgICByZXRWYWwgPSBwTWFjLT5saW0uZ0hUUFNNUFN1cHBvcnQ7CisgICAgICBicmVhazsKKworICAgIGNhc2UgZUhUX0RTU1NfQ0NLX01PREVfNDBNSFo6CisgICAgICByZXRWYWwgPSBwTWFjLT5saW0uZ0hURHNzc0Nja1JhdGU0ME1IelN1cHBvcnQ7CisgICAgICBicmVhazsKKworICAgIGNhc2UgZUhUX01BWF9BTVNEVV9MRU5HVEg6CisgICAgICByZXRWYWwgPSAodEFOSV9VOCkgbWFjSFRDYXBhYmlsaXR5SW5mby5tYXhpbWFsQU1TRFVzaXplOworICAgICAgYnJlYWs7CisKKyAgICBjYXNlIGVIVF9ERUxBWUVEX0JBOgorICAgICAgcmV0VmFsID0gKHRBTklfVTgpIG1hY0hUQ2FwYWJpbGl0eUluZm8uZGVsYXllZEJBOworICAgICAgYnJlYWs7CisKKyAgICBjYXNlIGVIVF9SWF9TVEJDOgorICAgICAgcmV0VmFsID0gKHRBTklfVTgpIG1hY0hUQ2FwYWJpbGl0eUluZm8ucnhTVEJDOworICAgICAgYnJlYWs7CisKKyAgICBjYXNlIGVIVF9UWF9TVEJDOgorICAgICAgcmV0VmFsID0gKHRBTklfVTgpIG1hY0hUQ2FwYWJpbGl0eUluZm8udHhTVEJDOworICAgICAgYnJlYWs7CisKKyAgICBjYXNlIGVIVF9TSE9SVF9HSV80ME1IWjoKKyAgICAgIHJldFZhbCA9ICh0QU5JX1U4KSBtYWNIVENhcGFiaWxpdHlJbmZvLnNob3J0R0k0ME1IejsKKyAgICAgIGJyZWFrOworCisgICAgY2FzZSBlSFRfU0hPUlRfR0lfMjBNSFo6CisgICAgICByZXRWYWwgPSAodEFOSV9VOCkgbWFjSFRDYXBhYmlsaXR5SW5mby5zaG9ydEdJMjBNSHo7CisgICAgICBicmVhazsKKworICAgIGNhc2UgZUhUX0dSRUVORklFTEQ6CisgICAgICByZXRWYWwgPSAodEFOSV9VOCkgbWFjSFRDYXBhYmlsaXR5SW5mby5ncmVlbkZpZWxkOworICAgIC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W50cnktPmh0T3Blck1vZGU7CisgICAgICBlbHNlCisgICAgICAgICAgcmV0VmFsID0gcE1hYy0+bGltLmdIVE9wZXJNb2RlOworICAgICAgYnJlYWs7CisKKyAgICBjYXNlIGVIVF9CQVNJQ19TVEJDX01DUzoKKyAgICAgIHJldFZhbCA9IHBNYWMtPmxpbS5nSFRTVEJDQmFzaWNNQ1M7CisgICAgICBicmVhazsKKworICAgIGNhc2UgZUhUX0RVQUxfQ1RTX1BST1RFQ1RJT046CisgICAgICByZXRWYWwgPSBwTWFjLT5saW0uZ0hURHVhbENUU1Byb3RlY3Rpb247CisgICAgICBicmVhazsKKworICAgIGNhc2UgZUhUX0xTSUdfVFhPUF9QUk9URUNUSU9OX0ZVTExfU1VQUE9SVDoKKyAgICAgIHJldFZhbCA9IHBzZXNzaW9uRW50cnktPmJlYWNvblBhcmFtcy5mTHNpZ1RYT1BQcm90ZWN0aW9uRnVsbFN1cHBvcnQ7CisgICAgICBicmVhazsKKworICAgIGNhc2UgZUhUX1BDT19BQ1RJVkU6CisgICAgICByZXRWYWwgPSBwTWFjLT5saW0uZ0hUUENPQWN0aXZlOworICAgICAgYnJlYWs7CisKKyAgICBjYXNlIGVIVF9QQ09fUEhBU0U6CisgICAgICByZXRWYWwgPSBwTWFjLT5saW0uZ0hUUENPUGhhc2U7CisgICAgICBicmVhazsKKworICAgIGRlZmF1bHQ6CisgICAgICBicmVhazsKKyAgfQorCisgIHJldHVybiByZXRWYWw7Cit9CisKK3ZvaWQgbGltR2V0TXlNYWNBZGRyKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggKm1hYykKK3sKKyAgICB2b3NfbWVtX2NvcHkoIG1hYywgcE1hYy0+bGltLmdMaW1NeU1hY0FkZHIsIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgIHJldHVybjsKK30KKworCisKKworLyoqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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AgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vbm9ybWFsIHByb3RlY3Rpb24gY29uZmlnIGNoZWNrCisgICAgICAgICAgICBpZiAoKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFKSAmJgorICAgICAgICAgICAgICAgICghcHNlc3Npb25FbnRyeS0+Y2ZnUHJvdGVjdGlvbi5mcm9tbGxhKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBwcm90ZWN0aW9uIGRpc2FibGVkLgorICAgICAgICAgICAgICAgIFBFTE9HMyhsaW1Mb2cocE1hYywgTE9HMywgRkwoInByb3RlY3Rpb24gZnJvbSAxMWEgaXMgZGlzYWJsZWQiKSk7KQorICAgICAgICAgICAgICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgIGlmIChlbmFibGUpCisgICAgeworICAgICAgICAvL0lmIHdlIGFyZSBBUCBhbmQgSFQgY2FwYWJsZSwgd2UgbmVlZCB0byBzZXQgdGhlIEhUIE9QIG1vZGUKKyAgICAgICAgLy9hcHByb3ByaWF0ZWx5LgorICAgICAgICBpZigoKGVMSU1fQVBfUk9MRSA9PSBwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlKXx8KGVMSU1fQlRfQU1QX0FQX1JPTEUgPT0gcHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSkpJiYKKyAgICAgICAgICAgICAgKHRydWUgPT0gcHNlc3Npb25FbnRyeS0+aHRDYXBhYmlsaXR5KSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYob3ZlcmxhcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbU92ZXJsYXAxMWFQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQgPSB0cnVlOworICAgICAgICAgICAgICAgIGlmKChlU0lSX0hUX09QX01PREVfT1ZFUkxBUF9MRUdBQ1kgIT0gcE1hYy0+bGltLmdIVE9wZXJNb2RlKSAmJgorICAgICAgICAgICAgICAgICAgIChlU0lSX0hUX09QX01PREVfTUlYRUQgIT0gcE1hYy0+bGltLmdIVE9wZXJNb2RlKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nSFRPcGVyTW9kZSA9IGVTSVJfSFRfT1BfTU9ERV9PVkVSTEFQX0xFR0FDWTsKKyAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+aHRPcGVyTW9kZSA9IGVTSVJfSFRfT1BfTU9ERV9PVkVSTEFQX0xFR0FDWTsKKyAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRSaWZzUHJvdGVjdGlvbihwTWFjLCB0cnVlLCBvdmVybGFwLCBwQmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOyAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRPQlNTUHJvdGVjdGlvbihwTWFjLCAgdHJ1ZSwgb3ZlcmxhcCwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsgICAgICAgICAKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbTExYVBhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgaWYoZVNJUl9IVF9PUF9NT0RFX01JWEVEICE9IHBNYWMtPmxpbS5nSFRPcGVyTW9kZSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nSFRPcGVyTW9kZSA9IGVTSVJfSFRfT1BfTU9ERV9NSVhFRDsKKyAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+aHRPcGVyTW9kZ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CisgICAgICAgIC8vV2UgbmVlZCB0byB0YWtlIGNhcmUgb2YgT3ZlcmxhcCBjYXNlcy4KKyAgICAgICAgaWYoZUxJTV9BUF9ST0xFID09IHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKG92ZXJsYXApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9PdmVybGFwIExlZ2FjeSBwcm90ZWN0aW9uIGRpc2FibGVkLgorICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltT3ZlcmxhcDExYVBhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgLy9XZSBuZWVkIHRvIHRha2UgY2FyZSBvZiBIVCBPUCBtb2RlIGlmZiB3ZSBhcmUgSFQgQVAuCisgICAgICAgICAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+aHRDYXBhYmlsaXR5KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAvLyBubyBIVCBvcCBtb2RlIGNoYW5nZSBpZiBhbnkgb2YgdGhlIG92ZXJsYXAgcHJvdGVjdGlvbiBlbmFibGVkLgorICAgICAgICAgICAgICAgICAgICBpZighKHBNYWMtPmxpbS5nTGltT3ZlcmxhcDExYVBhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCB8fAorICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltT3ZlcmxhcEh0MjBQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbU92ZXJsYXBOb25HZlBhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCkpCisKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLy9DaGVjayBpZiB0aGVyZSBpcyBhIG5lZWQgdG8gY2hhbmdlIEhUIE9QIG1vZGUuCisgICAgICAgICAgICAgICAgICAgICAgICBpZihlU0lSX0hUX09QX01PREVfT1ZFUkxBUF9MRUdBQ1kgPT0gcE1hYy0+bGltLmdIVE9wZXJNb2RlKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZUh0Umlmc1Byb3RlY3Rpb24ocE1hYywgZmFsc2UsIG92ZXJsYXAsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRPQlNTUHJvdGVjdGlvbihwTWFjLCAgZmFsc2UsIG92ZXJsYXAsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7ICAgICAgICAKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPmdMaW1IdDIwUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0hUT3Blck1vZGUgPSBlU0lSX0hUX09QX01PREVfTk9fTEVHQUNZXzIwTUhaX0hUOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdIVE9wZXJNb2RlID0gZVNJUl9IVF9PUF9NT0RFX1BVUkU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9EaXNhYmxlIHByb3RlY3Rpb24gZnJvbSAxMUEgc3RhdGlvbnMuCisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbTExYVBhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGxpbU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isgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYocHNlc3Npb25FbnRyeS0+Z0xpbUh0MjBQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdIVE9wZXJNb2RlID0gZVNJUl9IVF9PUF9NT0RFX05PX0xFR0FDWV8yME1IWl9IVDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmh0T3Blck1vZGUgPSBlU0lSX0hUX09QX01PREVfTk9fTEVHQUNZXzIwTUhaX0hUOworICAgICAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRSaWZzUHJvdGVjdGlvbihwTWFjLCBmYWxzZSwgb3ZlcmxhcCwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nSFRPcGVyTW9kZSA9IGVTSVJfSFRfT1BfTU9ERV9QVVJFOworICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+aHRPcGVyTW9kZSA9IGVTSVJfSFRfT1BfTU9ERV9QVVJFOworICAgICAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRSaWZzUHJvdGVjdGlvbihwTWFjLCBmYWxzZSwgb3ZlcmxhcCwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIGlmKCFwTWFjLT5saW0uZ0xpbU92ZXJsYXAxMWFQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQgJiYKKyAgICAgICAgICAgIXBzZXNzaW9uRW50cnktPmdMaW0xMWFQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQpCisgICA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ICAgICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7CisgICAgICAgIH1lbHNlIGlmKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgIT0gZUxJTV9BUF9ST0xFKQorICAgICAgICB7ICAgCisgICAgICAgICAgICBpZighcE1hYy0+bGltLmNmZ1Byb3RlY3Rpb24uZnJvbWxsYikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBwcm90ZWN0aW9uIGRpc2FibGVkLgorICAgICAgICAgICAgICAgIFBFTE9HMShsaW1Mb2cocE1hYywgTE9HMSwgRkwoInByb3RlY3Rpb24gZnJvbSAxMWIgaXMgZGlzYWJsZWQiKSk7KQorICAgICAgICAgICAgICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBpZiAoZW5hYmxlKQorICAgIHsKKyAgICAgICAgLy9JZiB3ZSBhcmUgQVAgYW5kIEhUIGNhcGFibGUsIHdlIG5lZWQgdG8gc2V0IHRoZSBIVCBPUCBtb2RlCisgICAgICAgIC8vYXBwcm9wcmlhdGVseS4KKyAgICAgICAgaWYoZUxJTV9BUF9ST0xFID09IHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKG92ZXJsYXApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbU9sYmNQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQgPSB0cnVlOworICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoInByb3RlY3Rpb24gZnJvbSBvbGJjIGlzIGVuYWJsZWQiKSk7KQorICAgICAgICAgICAgICAgIGlmKHRydWUgPT0gcHNlc3Npb25FbnRyeS0+aHRDYXBhYmlsaXR5KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoKGVTSVJfSFRfT1BfTU9ERV9PVkVSTEFQX0xFR0FDWSAhPSBwc2Vzc2lvbkVudHJ5LT5odE9wZXJNb2RlKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlU0lSX0hUX09QX01PREVfTUlYRUQgIT0gcHNlc3Npb25FbnRyeS0+aHRPcGVyTW9kZSkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmh0T3Blck1vZGUgPSBlU0lSX0hUX09QX01PREVfT1ZFUkxBUF9MRUdBQ1k7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgLy9DUi0yNjMwMjE6IE9CU1MgYml0IGlzIG5vdCBzd2l0Y2hpbmcgYmFjayB0byAwIGFmdGVyIGRpc2FibGluZyB0aGUgb3ZlcmxhcHBpbmcgbGVnYWN5IEJTUworICAgICAgICAgICAgICAgICAgICAvLyBUaGlzIGZpeGVzIGlzc3VlIG9mIE9CU1MgYml0IG5vdCBzZXQgYWZ0ZXIgMTFiLCAxMWcgc3RhdGlvbiBsZWF2ZXMKKyAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRSaWZzUHJvdGVjdGlvbihwTWFjLCB0cnVlLCBvdmVybGFwLCBwQmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgICAgICAvL05vdCBwcm9jZXNzaW5nIE9CU1MgYml0IGZyb20gb3RoZXIgQVBzLCBhcyB3ZSBhcmUgYWxyZWFkeSB0YWtpbmcgY2FyZQorICAgICAgICAgICAgICAgICAgICAvL29mIFByb3RlY3Rpb24gZnJvbSBvdmVybGFwcGluZyBCU1MgYmFzZWQgb24gZXJwIElFIG9yIHVzZVByb3RlY3Rpb24gYml0CisgICAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZUh0T0JTU1Byb3RlY3Rpb24ocE1hYywgIHRydWUsIG92ZXJsYXAsIHBCZWFjb25QYXJhbXMsIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltMTFiUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJwcm90ZWN0aW9uIGZyb20gMTFiIGlzIGVuYWJsZWQiKSk7KQorICAgICAgICAgICAgICAgIGlmKHRydWUgPT0gcHNlc3Npb25FbnRyeS0+aHRDYXBhYmlsaXR5KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoZVNJUl9IVF9PUF9NT0RFX01JWEVEICE9IHBzZXNzaW9uRW50cnktPmh0T3Blck1vZGUpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmh0T3Blck1vZGUgPSBlU0lSX0hUX09QX01PREVfTUlYRUQ7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW1FbmFibGVIdFJpZnNQcm90ZWN0aW9uKHBNYWMsIHRydWUsIG92ZXJsYXAsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW1FbmFibGVIdE9CU1NQcm90ZWN0aW9uKHBNYWMsICB0cnVlLCBvdmVybGFwLCBwQmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOyAgICAgCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH1lbHNlIGlmICgoZUxJTV9CVF9BTVBfQVBfUk9MRSA9PSBwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlKSAmJgorICAgICAgICAgICAgICAgICh0cnVlID09IHBzZXNzaW9uRW50cnktPmh0Q2FwYWJpbGl0eSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYob3ZlcmxhcCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW1PbGJjUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgaWYoKGVTSVJfSFRfT1BfTU9ERV9PVkVSTEFQX0xFR0FDWSAhPSBwTWFjLT5saW0uZ0hUT3Blck1vZGUpICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGVTSVJfSFRfT1BfTU9ERV9NSVhFRCAhPSBwTWFjLT5saW0uZ0hUT3Blck1vZGUpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0hUT3Blck1vZGUgPSBlU0lSX0hUX09QX01PREVfT1ZFUkxBUF9MRUdBQ1k7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgLy9DUi0yNjMwMjE6IE9CU1MgYml0IGlzIG5vdCBzd2l0Y2hpbmcgYmFjayB0byAwIGFmdGVyIGRpc2FibGluZyB0aGUgb3ZlcmxhcHBpbmcgbGVnYWN5IEJTUworICAgICAgICAgICAgICAgICAgICAvLyBUaGlzIGZpeGVzIGlzc3VlIG9mIE9CU1MgYml0IG5vdCBzZXQgYWZ0ZXIgMTFiLCAxMWcgc3RhdGlvbiBsZWF2ZXMKKyAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRSaWZzUHJvdGVjdGlvbihwTWFjLCB0cnVlLCBvdmVybGFwLCBwQmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgICAgICAvL05vdCBwcm9jZXNzaW5nIE9CU1MgYml0IGZyb20gb3RoZXIgQVBzLCBhcyB3ZSBhcmUgYWxyZWFkeSB0YWtpbmcgY2FyZQorICAgICAgICAgICAgICAgICAgICAvL29mIFByb3RlY3Rpb24gZnJvbSBvdmVybGFwcGluZyBCU1MgYmFzZWQgb24gZXJwIElFIG9yIHVzZVByb3RlY3Rpb24gYml0CisgICAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZUh0T0JTU1Byb3RlY3Rpb24ocE1hYywgIHRydWUsIG92ZXJsYXAsIHBCZWFjb25QYXJhbXMsIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltMTFiUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgaWYoZVNJUl9IVF9PUF9NT0RFX01JWEVEICE9IHBNYWMtPmxpbS5nSFRPcGVyTW9kZSkKKyAgICAgICAgICAgICAgICAgICAgeyAKKyAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nSFRPcGVyTW9kZSA9IGVTSVJfSFRfT1BfTU9ERV9NSVhFRDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZUh0Umlmc1Byb3RlY3Rpb24ocE1hYywgdHJ1ZSwgb3ZlcmxhcCwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZUh0T0JTU1Byb3RlY3Rpb24ocE1hYywgIHRydWUsIG92ZXJsYXAsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7ICAgICAKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAvL1RoaXMgcGFydCBpcyBjb21tb24gZm9yIHN0YWl0b24gYXMgd2VsbC4KKyAgICAgICAgaWYoZmFsc2UgPT0gcHNlc3Npb25FbnRyeS0+YmVhY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nktPmh0Q2FwYWJpbGl0eSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vIG5vIEhUIG9wIG1vZGUgY2hhbmdlIGlmIGFueSBvZiB0aGUgb3ZlcmxhcCBwcm90ZWN0aW9uIGVuYWJsZWQuCisgICAgICAgICAgICAgICAgICAgIGlmKCEocHNlc3Npb25FbnRyeS0+Z0xpbU92ZXJsYXAxMWdQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbU92ZXJsYXBIdDIwUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW1PdmVybGFwTm9uR2ZQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvL0NoZWNrIGlmIHRoZXJlIGlzIGEgbmVlZCB0byBjaGFuZ2UgSFQgT1AgbW9kZS4KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKGVTSVJfSFRfT1BfTU9ERV9PVkVSTEFQX0xFR0FDWSA9PSBwc2Vzc2lvbkVudHJ5LT5odE9wZXJNb2RlKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZUh0Umlmc1Byb3RlY3Rpb24ocE1hYywgZmFsc2UsIG92ZXJsYXAsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRPQlNTUHJvdGVjdGlvbihwTWFjLCAgZmFsc2UsIG92ZXJsYXAsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7ICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+Z0xpbUh0MjBQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0NvbW1lbnRpbmcgb3V0IGJlYWN1c2Ugb2YgQ1IgMjU4NTg4IFdGQSBjZXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vcHNlc3Npb25FbnRyeS0+aHRPcGVyTW9kZSA9IGVTSVJfSFRfT1BfTU9ERV9OT19MRUdBQ1lfMjBNSFpfSFQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmh0T3Blck1vZGUgPSBlU0lSX0hUX09QX01PREVfUFVSRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5odE9wZXJNb2RlID0gZVNJUl9IVF9PUF9NT0RFX1BVUkU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9EaXNhYmxlIHByb3RlY3Rpb24gZnJvbSAxMUIgc3RhdGlvbnMuCisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbTExYlBhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIj09PT4gMTFCIFByb3RlY3Rpb24gRGlzYWJsZWQiKSk7KQorICAgICAgICAgICAgICAgICAgICAvL0NoZWNrIGlmIGFueSBvdGhlciBub24tSFQgcHJvdGVjdGlvbiBlbmFibGVkLgorICAgICAgICAgICAgICAgIGlmKCFwc2Vzc2lvbkVudHJ5LT5nTGltMTFnUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy9SaWdodCBub3cgd2UgYXJlIGluIEhUIE9QIE1peGVkIG1vZGUuCisgICAgICAgICAgICAgICAgICAgIC8vQ2hhbmdlIEhUIG9wIG1vZGUgYXBwcm9wcmlhdGVseS4KKyAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRPQlNTUHJvdGVjdGlvbihwTWFjLCAgZmFsc2UsIG92ZXJsYXAsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7ICAgICAgICAgICAgCisKKyAgICAgICAgICAgICAgICAgICAgLy9DaGFuZ2UgSFQgT1AgbW9kZSB0byAwMSBpZiBhbnkgb3ZlcmxhcCBwcm90ZWN0aW9uIGVuYWJsZWQKKyAgICAgICAgICAgICAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+Z0xpbU9sYmNQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltT3ZlcmxhcDExZ1BhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW1PdmVybGFwSHQyMFBhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW1PdmVybGFwTm9uR2ZQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmh0T3Blck1vZGUgPSBlU0lSX0hUX09QX01PREVfT1ZFUkxBUF9MRUdBQ1k7CisgICAgICAgICAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCI9PT0+IDExRyBQcm90ZWN0aW9uIERpc2FibGVkIikpOykKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZUh0Umlmc1Byb3RlY3Rpb24ocE1hYywgdHJ1ZSwgb3ZlcmxhcCwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKHBzZXNzaW9uRW50cnktPmdMaW1IdDIwUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvL0NvbW1lbnRpbmcgYmVjYXVzZSBvZiBDUiAyNTg1ODggV0ZBIGNlcnQKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vcHNlc3Npb25FbnRyeS0+aHRPcGVyTW9kZSA9IGVTSVJfSFRfT1BfTU9ERV9OT19MRUdBQ1lfMjBNSFpfSFQ7CisgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5odE9wZXJNb2RlID0gZVNJUl9IVF9PUF9NT0RFX1BVUkU7CisgICAgICAgICAgICAgICAgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCI9PT0+IDExRyBQcm90ZWN0aW9uIERpc2FibGVkIikpOykKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZUh0Umlmc1Byb3RlY3Rpb24ocE1hYywgZmFsc2UsIG92ZXJsYXAsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5odE9wZXJNb2RlID0gZVNJUl9IVF9PUF9NT0RFX1BVUkU7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW1FbmFibGVIdFJpZnNQcm90ZWN0aW9uKHBNYWMsIGZhbHNlLCBvdmVybGFwLCBwQmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYoIXBzZXNzaW9uRW50cnktPmdMaW1PbGJjUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkICYmCisgICAgICAgICAgICAgICAgICAgICFwc2Vzc2lvbkVudHJ5LT5nTGltMTFiUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIj09PT4gMTFHIFByb3RlY3Rpb24gRGlzYWJsZWQiKSk7KQorICAgICAgICAgICAgICAgIHBCZWFjb25QYXJhbXMtPmxsYkNvZXhpc3QgPSBwc2Vzc2lvbkVudHJ5LT5iZWFjb25QYXJhbXMubGxiQ29leGlzdCA9IGZhbHNlOworICAgICAgICAgICAgICAgIHBCZWFjb25QYXJhbXMtPnBhcmFtQ2hhbmdlQml0bWFwIHw9IFBBUkFNX2xsQkNPRVhJU1RfQ0hBTkdFRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfWVsc2UgaWYoZUxJTV9CVF9BTVBfQVBfUk9MRSA9PSBwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKG92ZXJsYXApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvL092ZXJsYXAgTGVnYWN5IHByb3RlY3Rpb24gZGlzYWJsZWQuCisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbU9sYmNQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQgPSBmYWxzZTsKKworICAgICAgICAgICAgICAgICAgICAvL1dlIG5lZWQgdG8gdGFrZSBjYXJlIG9mIEhUIE9QIG1vZGUgaWZmIHdlIGFyZSBIVCBBUC4KKyAgICAgICAgICAgICAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+aHRDYXBhYmlsaXR5KQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBubyBIVCBvcCBtb2RlIGNoYW5nZSBpZiBhbnkgb2YgdGhlIG92ZXJsYXAgcHJvdGVjdGlvbiBlbmFibGVkLgorICAgICAgICAgICAgICAgICAgICAgICAgaWYoIShwTWFjLT5saW0uZ0xpbU92ZXJsYXAxMWdQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltT3ZlcmxhcEh0MjBQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltT3ZlcmxhcE5vbkdmUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkKSkKKworICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vQ2hlY2sgaWYgdGhlcmUgaXMgYSBuZWVkIHRvIGNoYW5nZSBIVCBPUCBtb2RlLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGVTSVJfSFRfT1BfTU9ERV9PVkVSTEFQX0xFR0FDWSA9PSBwTWFjLT5saW0uZ0hUT3Blck1vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1FbmFibGVIdFJpZnNQcm90ZWN0aW9uKHBNYWMsIGZhbHNlLCBvdmVybGFwLCBwQmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1FbmFibGVIdE9CU1NQcm90ZWN0aW9uKHBNYWMsICBmYWxzZSwgb3ZlcmxhcCwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihwc2Vzc2lvbkVudHJ5LT5nTGltSHQyMFBhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nSFRPcGVyTW9kZSA9IGVTSVJfSFRfT1BfTU9ERV9OT19MRUdBQ1lfMjBNSFpfSFQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nSFRPcGVyTW9kZSA9IGVTSVJfSFRfT1BfTU9ERV9QVVJFOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvL0Rpc2FibGUgcHJvdGVjdGlvbiBmcm9tIDExQiBzdGF0aW9ucy4KKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltMTFiUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIC8vQ2hlY2sgaWYgYW55IG90aGVyIG5vbi1IVCBwcm90ZWN0aW9uIGVuYWJsZWQuCisgICAgICAgICAgICAgICAgaWYoIXBzZXNzaW9uRW50cnktPmdMaW0xMWdQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vUmlnaHQgbm93IHdlIGFyZSBpbiBIVCBPUCBNaXhlZCBtb2RlLgorICAgICAgICAgICAgICAgICAgICAgICAgLy9DaGFuZ2UgSFQgb3AgbW9kZSBhcHByb3ByaWF0ZWx5LgorICAgICAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRPQlNTUHJvdGVjdGlvbihwTWFjLCAgZmFsc2UsIG92ZXJsYXAsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7ICAgICAgICAgICAgCisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vQ2hhbmdlIEhUIE9QIG1vZGUgdG8gMDEgaWYgYW55IG92ZXJsYXAgcHJvdGVjdGlvbiBlbmFibGVkCisgICAgICAgICAgICAgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPmdMaW1PbGJjUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltT3ZlcmxhcDExZ1BhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbU92ZXJsYXBIdDIwUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltT3ZlcmxhcE5vbkdmUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkKQorCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdIVE9wZXJNb2RlID0gZVNJUl9IVF9PUF9NT0RFX09WRVJMQVBfTEVHQUNZOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZUh0Umlmc1Byb3RlY3Rpb24ocE1hYywgdHJ1ZSwgb3ZlcmxhcCwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZihwc2Vzc2lvbkVudHJ5LT5nTGltSHQyMFBhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0hUT3Blck1vZGUgPSBlU0lSX0hUX09QX01PREVfTk9fTEVHQUNZXzIwTUhaX0hUOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZUh0Umlmc1Byb3RlY3Rpb24ocE1hYywgZmFsc2UsIG92ZXJsYXAsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdIVE9wZXJNb2RlID0gZVNJUl9IVF9PUF9NT0RFX1BVUkU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRSaWZzUHJvdGVjdGlvbihwTWFjLCBmYWxzZSwgb3ZlcmxhcCwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmKCFwc2Vzc2lvbkVudHJ5LT5nTGltT2xiY1BhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCAmJgorICAgICAgICAgICAgICAgICAgIXBzZXNzaW9uRW50cnktPmdMaW0xMWJQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBQRUxPRzEobGltTG9nKHBNYWMsIExPRzEsIEZMKCI9PT0+IDExRyBQcm90ZWN0aW9uIERpc2FibGVkIikpOykKKyAgICAgICAgICAgICAgICBwQmVhY29uUGF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SVJfU1VDQ0VTUzsKKyAgICAgICAgfWVsc2UgaWYgKChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQlRfQU1QX0FQX1JPTEUpICYmICghcE1hYy0+bGltLmNmZ1Byb3RlY3Rpb24ub3ZlcmxhcEZyb21sbGcpKQorICAgICAgICB7CisgICAgICAgICAgICAvLyBwcm90ZWN0aW9uIGRpc2FibGVkLgorICAgICAgICAgICAgUEVMT0czKGxpbUxvZyhwTWFjLCBMT0czLCBGTCgib3ZlcmxhcCBwcm90ZWN0aW9uIGZyb20gMTFnIGlzIGRpc2FibGVkIikpOyk7CisgICAgICAgICAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworICAgICAgICB9CisgICAgICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAvL25vcm1hbCBwcm90ZWN0aW9uIGNvbmZpZyBjaGVjaworICAgICAgIGlmKChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQVBfUk9MRSApICYmIAorICAgICAgICAgICAhcHNlc3Npb25FbnRyeS0+Y2ZnUHJvdGVjdGlvbi5mcm9tbGxnKXsKKyAgICAgICAgICAgIC8vIHByb3RlY3Rpb24gZGlzYWJsZWQuCisgICAgICAgICAgICBQRUxPRzMobGltTG9nKHBNYWMsIExPRzMsIEZMKCJwcm90ZWN0aW9uIGZyb20gMTFnIGlzIGRpc2FibGVkIikpOykKKyAgICAgICAgICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7CisgICAgICAgICB9ZWxzZSBpZihwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlICE9IGVMSU1fQVBfUk9MRSApCisgICAgICAgeworICAgICAgICAgIGlmKCFwTWFjLT5saW0uY2ZnUHJvdGVjdGlvbi5mcm9tbGxnKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gcHJvdGVjdGlvbiBkaXNhYmxlZC4KKyAgICAgICAgICAgICAgICBQRUxPRzMobGltTG9nKHBNYWMsIExPRzMsIEZMKCJwcm90ZWN0aW9uIGZyb20gMTFnIGlzIGRpc2FibGVkIikpOykKKyAgICAgICAgICAgICAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgIH0KKyAgICBpZiAoZW5hYmxlKQorICAgIHsKKyAgICAgICAgLy9JZiB3ZSBhcmUgQVAgYW5kIEhUIGNhcGFibGUsIHdlIG5lZWQgdG8gc2V0IHRoZSBIVCBPUCBtb2RlCisgICAgICAgIC8vYXBwcm9wcmlhdGVseS4KKworICAgICAgICBpZihlTElNX0FQX1JPTEUgPT0gcHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYob3ZlcmxhcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltT3ZlcmxhcDExZ1BhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgLy8xMWcgZXhpc3RzIGluIG92ZXJsYXAgQlNTLgorICAgICAgICAgICAgICAgIC8vbmVlZCBub3QgdG8gY2hhbmdlIHRoZSBvcGVyYXRpbmcgbW9kZSB0byBvdmVybGFwX2xlZ2FjeQorICAgICAgICAgICAgICAgIC8vaWYgaGlnaGVyIG9yIHNhbWUgcHJvdGVjdGlvbiBvcGVyYXRpbmcgbW9kZSBpcyBlbmFibGVkIHJpZ2h0IG5vdy4KKyAgICAgICAgICAgICAgICBpZigoZVNJUl9IVF9PUF9NT0RFX09WRVJMQVBfTEVHQUNZICE9IHBzZXNzaW9uRW50cnktPmh0T3Blck1vZGUpICYmCisgICAgICAgICAgICAgICAgICAgIChlU0lSX0hUX09QX01PREVfTUlYRUQgIT0gcHNlc3Npb25FbnRyeS0+aHRPcGVyTW9kZSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwc2Vzc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mxhcCwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH1lbHNlIGlmKGVMSU1fQlRfQU1QX0FQX1JPTEUgPT0gcHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYob3ZlcmxhcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbU92ZXJsYXAxMWdQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQgPSB0cnVlOworICAgICAgICAgICAgICAgIC8vMTFnIGV4aXN0cyBpbiBvdmVybGFwIEJTUy4KKyAgICAgICAgICAgICAgICAvL25lZWQgbm90IHRvIGNoYW5nZSB0aGUgb3BlcmF0aW5nIG1vZGUgdG8gb3ZlcmxhcF9sZWdhY3kKKyAgICAgICAgICAgICAgICAvL2lmIGhpZ2hlciBvciBzYW1lIHByb3RlY3Rpb24gb3BlcmF0aW5nIG1vZGUgaXMgZW5hYmxlZCByaWdodCBub3cuCisgICAgICAgICAgICAgICAgaWYoKGVTSVJfSFRfT1BfTU9ERV9PVkVSTEFQX0xFR0FDWSAhPSBwTWFjLT5saW0uZ0hUT3Blck1vZGUpICYmCisgICAgICAgICAgICAgICAgICAgIChlU0lSX0hUX09QX01PREVfTUlYRUQgIT0gcE1hYy0+bGltLmdIVE9wZXJNb2RlKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nSFRPcGVyTW9kZSA9IGVTSVJfSFRfT1BfTU9ERV9PVkVSTEFQX0xFR0FDWTsKKyAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRSaWZzUHJvdGVjdGlvbihwTWFjLCB0cnVlLCBvdmVybGFwLCBwQmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH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ICAgICAgICAgIGlmKG92ZXJsYXApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9PdmVybGFwIExlZ2FjeSBwcm90ZWN0aW9uIGRpc2FibGVkLgorICAgICAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5nTGltMTFnUGFyYW1zLm51bVN0YSA9PSAwKQorICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW1PdmVybGFwMTFnUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkID0gZmFsc2U7CisKKyAgICAgICAgICAgICAgICAvLyBubyBIVCBvcCBtb2RlIGNoYW5nZSBpZiBhbnkgb2YgdGhlIG92ZXJsYXAgcHJvdGVjdGlvbiBlbmFibGVkLgorICAgICAgICAgICAgICAgIGlmKCEocHNlc3Npb25FbnRyeS0+Z0xpbU9sYmNQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQgfHwKKyAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbU92ZXJsYXBIdDIwUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkIHx8CisgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW1PdmVybGFwTm9uR2ZQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy9DaGVjayBpZiB0aGVyZSBpcyBhIG5lZWQgdG8gY2hhbmdlIEhUIE9QIG1vZGUuCisgICAgICAgICAgICAgICAgICAgIGlmKGVTSVJfSFRfT1BfTU9ERV9PVkVSTEFQX0xFR0FDWSA9PSBwc2Vzc2lvbkVudHJ5LT5odE9wZXJNb2RlKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW1FbmFibGVIdFJpZnNQcm90ZWN0aW9uKHBNYWMsIGZhbHNlLCBvdmVybGFwLCBwQmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRPQlNTUHJvdGVjdGlvbihwTWFjLCAgZmFsc2UsIG92ZXJsYXAsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7ICAgICAgICAgICAgCisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPmdMaW1IdDIwUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0NvbW1lbnRpbmcgYmVjYXVzZSBvZiBDUiAyNTg1ODggV0ZBIGNlcnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3BzZXNzaW9uRW50cnktPmh0T3Blck1vZGUgPSBlU0lSX0hUX09QX01PREVfTk9fTEVHQUNZXzIwTUhaX0hUOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmh0T3Blck1vZGUgPSBlU0lSX0hUX09QX01PREVfUFVSRTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5odE9wZXJNb2RlID0gZVNJUl9IVF9PUF9NT0RFX1BVUkU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9EaXNhYmxlIHByb3RlY3Rpb24gZnJvbSAxMUcgc3RhdGlvbnMuCisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbTExZ1BhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgIC8vQ2hlY2sgaWYgYW55IG90aGVyIG5vbi1IVCBwcm90ZWN0aW9uIGVuYWJsZWQuCisgICAgICAgICAgICAgICAgaWYoIXBzZXNzaW9uRW50cnktPmdMaW0xMWJQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQpCisgICAgICAgICAgICAgICAgeworCisgICAgICAgICAgICAgICAgICAgIC8vUmlnaHQgbm93IHdlIGFyZSBpbiBIVCBPUCBNaXhlZCBtb2RlLgorICAgICAgICAgICAgICAgICAgICAvL0NoYW5nZSBIVCBvcCBtb2RlIGFwcHJvcHJpYXRlbHkuCisgICAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZUh0T0JTU1Byb3RlY3Rpb24ocE1hYywgIGZhbHNlLCBvdmVybGFwLCBwQmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOyAgICAgICAgICAgIAorCisgICAgICAgICAgICAgICAgICAgIC8vQ2hhbmdlIEhUIE9QIG1vZGUgdG8gMDEgaWYgYW55IG92ZXJsYXAgcHJvdGVjdGlvbiBlbmFibGVkCisgICAgICAgICAgICAgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPmdMaW1PbGJjUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkIHx8CisgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltT3ZlcmxhcDExZ1BhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCB8fAorICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbU92ZXJsYXBIdDIwUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkIHx8CisgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltT3ZlcmxhcE5vbkdmUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkKQorCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmh0T3Blck1vZGUgPSBlU0lSX0hUX09QX01PREVfT1ZFUkxBUF9MRUdBQ1k7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW1FbmFibGVIdFJpZnNQcm90ZWN0aW9uKHBNYWMsIHRydWUsIG92ZXJsYXAsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZihwc2Vzc2lvbkVudHJ5LT5nTGltSHQyMFBhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLy9Db21tZW50aW5nIGJlY2F1c2Ugb2YgQ1IgMjU4NTg4IFdGQSBjZXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAvL3BzZXNzaW9uRW50cnktPmh0T3Blck1vZGUgPSBlU0lSX0hUX09QX01PREVfTk9fTEVHQUNZXzIwTUhaX0hUOworICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+aHRPcGVyTW9kZSA9IGVTSVJfSFRfT1BfTU9ERV9QVVJFOworICAgICAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRSaWZzUHJvdGVjdGlvbihwTWFjLCBmYWxzZSwgb3ZlcmxhcCwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmh0T3Blck1vZGUgPSBlU0lSX0hUX09QX01PREVfUFVSRTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZUh0Umlmc1Byb3RlY3Rpb24ocE1hYywgZmFsc2UsIG92ZXJsYXAsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZighcHNlc3Npb25FbnRyeS0+Z0xpbU92ZXJsYXAxMWdQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQgJiYKKyAgICAgICAgICAgICAgICAgICFwc2Vzc2lvbkVudHJ5LT5nTGltMTFnUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFBFTE9HMShsaW1Mb2cocE1hYywgTE9HMSwgRkwoIj09PT4gUHJvdGVjdGlvbiBmcm9tIDExRyBEaXNhYmxlZCIpKTspCisgICAgICAgICAgICAgICAgcEJlYWNvblBhcmFtcy0+bGxnQ29leGlzdCA9IHBzZXNzaW9uRW50cnktPmJlYWNvblBhcmFtcy5sbGdDb2V4aXN0ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgcEJlYWNvblBhcmFtcy0+cGFyYW1DaGFuZ2VCaXRtYXAgfD0gUEFSQU1fbGxHQ09FWElTVF9DSEFOR0VEOworICAgICAgICAgICAgfQorICAgICAgICB9ZWxzZSBpZihlTElNX0JUX0FNUF9BUF9ST0xFID09IHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKG92ZXJsYXApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9PdmVybGFwIExlZ2FjeSBwcm90ZWN0aW9uIGRpc2FibGVkLgorICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltT3ZlcmxhcDExZ1BhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgLy8gbm8gSFQgb3AgbW9kZSBjaGFuZ2UgaWYgYW55IG9mIHRoZSBvdmVybGFwIHByb3RlY3Rpb24gZW5hYmxlZC4KKyAgICAgICAgICAgICAgICBpZighKHBzZXNzaW9uRW50cnktPmdMaW1PbGJjUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkIHx8CisgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW1PdmVybGFwSHQyMFBhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCB8fAorICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltT3ZlcmxhcE5vbkdmUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vQ2hlY2sgaWYgdGhlcmUgaXMgYSBuZWVkIHRvIGNoYW5nZSBIVCBPUCBtb2RlLgorICAgICAgICAgICAgICAgICAgICBpZihlU0lSX0hUX09QX01PREVfT1ZFUkxBUF9MRUdBQ1kgPT0gcE1hYy0+bGltLmdIVE9wZXJNb2RlKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW1FbmFibGVIdFJpZnNQcm90ZWN0aW9uKHBNYWMsIGZhbHNlLCBvdmVybGFwLCBwQmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRPQlNTUHJvdGVjdGlvbihwTWFjLCAgZmFsc2UsIG92ZXJsYXAsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7ICAgICAgICAgICAgCisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPmdMaW1IdDIwUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nSFRPcGVyTW9kZSA9IGVTSVJfSFRfT1BfTU9ERV9OT19MRUdBQ1lfMjBNSFpfSFQ7CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdIVE9wZXJNb2RlID0gZVNJUl9IVF9PUF9NT0RFX1BVUkU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9EaXNhYmxlIHByb3RlY3Rpb24gZnJvbSAxMUcgc3RhdGlvbnMuCisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbTExZ1BhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgIC8vQ2hlY2sgaWYgYW55IG90aGVyIG5vbi1IVCBwcm90ZWN0aW9uIGVuYWJsZWQuCisgICAgICAgICAgICAgICAgaWYoIXBzZXNzaW9uRW50cnktPmdMaW0xMWJQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQpCisgICAgICAgICAgICAgICAgeworCisgICAgICAgICAgICAgICAgICAgIC8vUmlnaHQgbm93IHdlIGFyZSBpbiBIVCBPUCBNaXhlZCBtb2RlLgorICAgICAgICAgICAgICAgICAgICAvL0NoYW5nZSBIVCBvcCBtb2RlIGFwcHJvcHJpYXRlbHkuCisgICAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZUh0T0JTU1Byb3RlY3Rpb24ocE1hYywgIGZhbHNlLCBvdmVybGFwLCBwQmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOyAgICAgICAgICAgIAorCisgICAgICAgICAgICAgICAgICAgIC8vQ2hhbmdlIEhUIE9QIG1vZGUgdG8gMDEgaWYgYW55IG92ZXJsYXAgcHJvdGVjdGlvbiBlbmFibGVkCisgICAgICAgICAgICAgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPmdMaW1PbGJjUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkIHx8CisgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbU92ZXJsYXAxMWdQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltT3ZlcmxhcEh0MjBQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltT3ZlcmxhcE5vbkdmUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkKQorCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nSFRPcGVyTW9kZSA9IGVTSVJfSFRfT1BfTU9ERV9PVkVSTEFQX0xFR0FDWTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZUh0Umlmc1Byb3RlY3Rpb24ocE1hYywgdHJ1ZSwgb3ZlcmxhcCwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKHBzZXNzaW9uRW50cnktPmdMaW1IdDIwUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0hUT3Blck1vZGUgPSBlU0lSX0hUX09QX01PREVfTk9fTEVHQUNZXzIwTUhaX0hUOworICAgICAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRSaWZzUHJvdGVjdGlvbihwTWFjLCBmYWxzZSwgb3ZlcmxhcCwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nSFRPcGVyTW9kZSA9IGVTSVJfSFRfT1BfTU9ERV9QVVJFOworICAgICAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRSaWZzUHJvdGVjdGlvbihwTWFjLCBmYWxzZSwgb3ZlcmxhcCwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH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9uICBpcyBvbmx5IGZvciBIVCBzdGF0aW9ucy4KKworICAgIC8vb3ZlcmxhcHBpbmcgcHJvdGVjdGlvbiBjb25maWd1cmF0aW9uIGNoZWNrLgorICAgIGlmKG92ZXJsYXApCisgICAgeworICAgICAgICAvL292ZXJsYXBwaW5nIHByb3RlY3Rpb24gY29uZmlndXJhdGlvbiBjaGVjay4KKyAgICB9IAorICAgIGVsc2UgCisgICAgeworICAgICAgICAvL25vcm1hbCBwcm90ZWN0aW9uIGNvbmZpZyBjaGVjaworICAgICAgICBpZigocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0FQX1JPTEUpICYmICFwc2Vzc2lvbkVudHJ5LT5jZmdQcm90ZWN0aW9uLm9ic3MpIAorICAgICAgICB7IC8vVG9EbyBVcGRhdGUgdGhpcyBmaWVsZAorICAgICAgICAgICAgLy8gcHJvdGVjdGlvbiBkaXNhYmxlZC4KKyAgICAgICAgICAgIFBFTE9HMShsaW1Mb2cocE1hYywgTE9HMSwgRkwoInByb3RlY3Rpb24gZnJvbSBPYnNzIGlzIGRpc2FibGVkIikpOykKKyAgICAgICAgICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7CisgICAgICAgIH1lbHNlIGlmKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgIT0gZUxJTV9BUF9ST0xFKQorICAgICAgICB7CisgICAgICAgICAgICBpZighcE1hYy0+bGltLmNmZ1Byb3RlY3Rpb24ub2JzcykgCisgICAgICAgICAgICB7IC8vVG9EbyBVcGRhdGUgdGhpcyBmaWVsZAorICAgICAgICAgICAgICAgIC8vIHByb3RlY3Rpb24gZGlzYWJsZWQuCisgICAgICAgICAgICAgICAgUEVMT0cxKGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgicHJvdGVjdGlvbiBmcm9tIE9ic3MgaXMgZGlzYWJsZWQiKSk7KQorICAgICAgICAgICAgICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7CisgICAgICAgICA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xhcHBpbmcgcHJvdGVjdGlvbiBjb25maWd1cmF0aW9uIGNoZWNrLgorICAgICAgICBpZihvdmVybGFwKQorICAgICAgICB7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvL25vcm1hbCBwcm90ZWN0aW9uIGNvbmZpZyBjaGVjaworICAgICAgICAgICAgaWYoKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFICkgJiYKKyAgICAgICAgICAgICAgICAhcHNlc3Npb25FbnRyeS0+Y2ZnUHJvdGVjdGlvbi5odDIwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIHByb3RlY3Rpb24gZGlzYWJsZWQuCisgICAgICAgICAgICAgICAgUEVMT0czKGxpbUxvZyhwTWFjLCBMT0czLCBGTCgicHJvdGVjdGlvbiBmcm9tIEhUMjAgaXMgZGlzYWJsZWQiKSk7KQorICAgICAgICAgICAgICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7CisgICAgICAgICAgICB9ZWxzZSBpZihwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlICE9IGVMSU1fQVBfUk9MRSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoIXBNYWMtPmxpbS5jZmdQcm90ZWN0aW9uLmh0MjApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvLyBwcm90ZWN0aW9uIGRpc2FibGVkLgorICAgICAgICAgICAgICAgICAgICBQRUxPRzMobGltTG9nKHBNYWMsIExPRzMsIEZMKCJwcm90ZWN0aW9uIGZyb20gSFQyMCBpcyBkaXNhYmxlZCIpKTspCisgICAgICAgICAgICAgICAgICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICBpZiAoZW5hYmxlKQorICAgIHsKKyAgICAgICAgLy9JZiB3ZSBhcmUgQVAgYW5kIEhUIGNhcGFibGUsIHdlIG5lZWQgdG8gc2V0IHRoZSBIVCBPUCBtb2RlCisgICAgICAgIC8vYXBwcm9wcmlhdGVseS4KKworICAgICAgICBpZihlTElNX0FQX1JPTEUgPT0gcHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSl7CisgICAgICAgICAgICBpZihvdmVybGFwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW1PdmVybGFwSHQyMFBhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgaWYoKGVTSVJfSFRfT1BfTU9ERV9PVkVSTEFQX0xFR0FDWSAhPSBwc2Vzc2lvbkVudHJ5LT5odE9wZXJNb2RlKSAmJgorICAgICAgICAgICAgICAgICAgICAoZVNJUl9IVF9PUF9NT0RFX01JWEVEICE9IHBzZXNzaW9uRW50cnktPmh0T3Blck1vZGUpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+aHRPcGVyTW9kZSA9IGVTSVJfSFRfT1BfTU9ERV9PVkVSTEFQX0xFR0FDWTsKKyAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRSaWZzUHJvdGVjdGlvbihwTWFjLCB0cnVlLCBvdmVybGFwLCBwQmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW1IdDIwUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBpZihlU0lSX0hUX09QX01PREVfUFVSRSA9PSBwc2Vzc2lvbkVudHJ5LT5odE9wZXJNb2RlKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy9Db21tZW50aW5nIGJlY2F1c2Ugb2YgQ1IgMjU4NTg4IFdGQSBjZXJ0CisgICAgICAgICAgICAgICAgICAgIC8vcHNlc3Npb25FbnRyeS0+aHRPcGVyTW9kZSA9IGVTSVJfSFRfT1BfTU9ERV9OT19MRUdBQ1lfMjBNSFpfSFQ7CisgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmh0T3Blck1vZGUgPSBlU0lSX0hUX09QX01PREVfUFVSRTsKKyAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRSaWZzUHJvdGVjdGlvbihwTWFjLCBmYWxzZSwgb3ZlcmxhcCwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRPQlNTUHJvdGVjdGlvbihwTWFjLCAgZmFsc2UsIG92ZXJsYXAsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9ZWxzZSBpZihlTElNX0JUX0FNUF9BUF9ST0xFID09IHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKG92ZXJsYXApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1PdmVybGFwSHQyMFBhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgaWYoKGVTSVJfSFRfT1BfTU9ERV9PVkVSTEFQX0xFR0FDWSAhPSBwTWFjLT5saW0uZ0hUT3Blck1vZGUpICYmCisgICAgICAgICAgICAgICAgICAgIChlU0lSX0hUX09QX01PREVfTUlYRUQgIT0gcE1hYy0+bGltLmdIVE9wZXJNb2RlKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nSFRPcGVyTW9kZSA9IGVTSVJfSFRfT1BfTU9ERV9PVkVSTEFQX0xFR0FDWTsKKyAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRSaWZzUHJvdGVjdGlvbihwTWFjLCB0cnVlLCBvdmVybGFwLCBwQmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltSHQyMFBhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgaWYoZVNJUl9IVF9PUF9NT0RFX1BVUkUgPT0gcE1hYy0+bGltLmdIVE9wZXJNb2RlKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdIVE9wZXJNb2RlID0gZVNJUl9IVF9PUF9NT0RFX05PX0xFR0FDWV8yME1IWl9IVDsKKyAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRSaWZzUHJvdGVjdGlvbihwTWFjLCBmYWxzZSwgb3ZlcmxhcCwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRPQlNTUHJvdGVjdGlvbihwTWFjLCAgZmFsc2UsIG92ZXJsYXAsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy9UaGlzIHBhcnQgaXMgY29tbW9uIGZvciBzdGFpdG9uIGFzIHdlbGwuCisgICAgICAgIGlmKGZhbHNlID09IHBzZXNzaW9uRW50cnktPmJlYWNvblBhcmFtcy5odDIwQ29leGlzdCkKKyAgICAgICAgeworICAgICAgICAgICAgUEVMT0cxKGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiPT4g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AgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltT3ZlcmxhcDExZ1BhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCB8fAorICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltT3ZlcmxhcEh0MjBQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQgfHwKKyAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbU92ZXJsYXBOb25HZlBhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCkpCisgICAgICAgICAgICAgICAgeworCisgICAgICAgICAgICAgICAgICAgIC8vQ2hlY2sgaWYgdGhlcmUgaXMgYSBuZWVkIHRvIGNoYW5nZSBIVCBPUCBtb2RlLgorICAgICAgICAgICAgICAgICAgICBpZihlU0lSX0hUX09QX01PREVfT1ZFUkxBUF9MRUdBQ1kgPT0gcHNlc3Npb25FbnRyeS0+aHRPcGVyTW9kZSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+Z0xpbUh0MjBQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9Db21tZW50ZWQgYmVhY3VzZSBvZiBDUiAyNTg1ODggZm9yIFdGQSBDZXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9wc2Vzc2lvbkVudHJ5LT5odE9wZXJNb2RlID0gZVNJUl9IVF9PUF9NT0RFX05PX0xFR0FDWV8yME1IWl9IVDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5odE9wZXJNb2RlID0gZVNJUl9IVF9PUF9NT0RFX1BVUkU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRSaWZzUHJvdGVjdGlvbihwTWFjLCBmYWxzZSwgb3ZlcmxhcCwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1FbmFibGVIdE9CU1NQcm90ZWN0aW9uKHBNYWMsICBmYWxzZSwgb3ZlcmxhcCwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5odE9wZXJNb2RlID0gZVNJUl9IVF9PUF9NT0RFX1BVUkU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9EaXNhYmxlIHByb3RlY3Rpb24gZnJvbSAxMUcgc3RhdGlvbnMuCisgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbUh0MjBQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQgPSBmYWxzZTsKKworICAgICAgICAgICAgICAgIC8vQ2hhbmdlIEhUIG9wIG1vZGUgYXBwcm9wcmlhdGVseS4KKyAgICAgICAgICAgICAgICBpZihlU0lSX0hUX09QX01PREVfTk9fTEVHQUNZXzIwTUhaX0hUID09IHBzZXNzaW9uRW50cnktPmh0T3Blck1vZGUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5odE9wZXJNb2RlID0gZVNJUl9IVF9PUF9NT0RFX1BVUkU7CisgICAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZUh0Umlmc1Byb3RlY3Rpb24ocE1hYywgZmFsc2UsIG92ZXJsYXAsIHBCZWFjb25Q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AgICAgICAgIHBNYWMtPmxpbS5nTGltT3ZlcmxhcDExZ1BhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCB8fAorICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbU92ZXJsYXBIdDIwUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkIHx8CisgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nTGltT3ZlcmxhcE5vbkdmUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkKSkKKyAgICAgICAgICAgICAgICB7CisKKyAgICAgICAgICAgICAgICAgICAgLy9DaGVjayBpZiB0aGVyZSBpcyBhIG5lZWQgdG8gY2hhbmdlIEhUIE9QIG1vZGUuCisgICAgICAgICAgICAgICAgICAgIGlmKGVTSVJfSFRfT1BfTU9ERV9PVkVSTEFQX0xFR0FDWSA9PSBwTWFjLT5saW0uZ0hUT3Blck1vZGUpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPmdMaW1IdDIwUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmxpbS5nSFRPcGVyTW9kZSA9IGVTSVJfSFRfT1BfTU9ERV9OT19MRUdBQ1lfMjBNSFpfSFQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRSaWZzUHJvdGVjdGlvbihwTWFjLCBmYWxzZSwgb3ZlcmxhcCwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1FbmFibGVIdE9CU1NQcm90ZWN0aW9uKHBNYWMsICBmYWxzZSwgb3ZlcmxhcCwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0hUT3Blck1vZGUgPSBlU0lSX0hUX09QX01PREVfUFVSRTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvL0Rpc2FibGUgcHJvdGVjdGlvbiBmcm9tIDExRyBzdGF0aW9ucy4KKyAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltSHQyMFBhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgLy9DaGFuZ2UgSFQgb3AgbW9kZSBhcHByb3ByaWF0ZWx5LgorICAgICAgICAgICAgICAgIGlmKGVTSVJfSFRfT1BfTU9ERV9OT19MRUdBQ1lfMjBNSFpfSFQgPT0gcE1hYy0+bGltLmdIVE9wZXJNb2RlKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdIVE9wZXJNb2RlID0gZVNJUl9IVF9PUF9NT0RFX1BVUkU7CisgICAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZUh0Umlmc1Byb3RlY3Rpb24ocE1hYywgZmFsc2UsIG92ZXJsYXAsIHBCZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZUh0T0JTU1Byb3RlY3Rpb24ocE1hYywgIGZhbHNlLCBvdmVybGFwLCBwQmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOyAgICAgICAgCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgUEVMT0cxKGxpbUxvZyh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worICAgICAgICAgICAgICAgIC8vIHByb3RlY3Rpb24gZGlzYWJsZWQuCisgICAgICAgICAgICAgICAgUEVMT0czKGxpbUxvZyhwTWFjLCBMT0czLCBGTCgicHJvdGVjdGlvbiBmcm9tIE5vbkdmIGlzIGRpc2FibGVkIikpOykKKyAgICAgICAgICAgICAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworICAgICAgICAgICAgfWVsc2UgaWYocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSAhPSBlTElNX0FQX1JPTEUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9ub3JtYWwgcHJvdGVjdGlvbiBjb25maWcgY2hlY2sKKyAgICAgICAgICAgICAgICBpZighcE1hYy0+bGltLmNmZ1Byb3RlY3Rpb24ubm9uR2YpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvLyBwcm90ZWN0aW9uIGRpc2FibGVkLgorICAgICAgICAgICAgICAgICAgICBQRUxPRzMobGltTG9nKHBNYWMsIExPRzMsIEZMKCJwcm90ZWN0aW9uIGZyb20gTm9uR2YgaXMgZGlzYWJsZWQiKSk7KQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICBpZihwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQVBfUk9MRSl7CisgICAgICAgIGlmICgoZW5hYmxlKSAmJiAoZmFsc2UgPT0gcHNlc3Npb25FbnRyeS0+YmVhY29uUGFyYW1zLmxsbk5vbkdGQ29leGlzdCkpCisgICAgICAgIHsKKyAgICAgICAgICAgIFBFTE9HMShsaW1Mb2cocE1hYywgTE9HMSwgRkwoIiA9PiBQcnRlY3Rpb24gZnJvbSBub24gR0YgRW5hYmxlZCIpKTspCisgICAgICAgICAgICBwQmVhY29uUGFyYW1zLT5sbG5Ob25HRkNvZXhpc3QgPSBw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jaGVjay4KKyAgICAgICAgaWYob3ZlcmxhcCkKKyAgICAgICAgeworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgIC8vbm9ybWFsIHByb3RlY3Rpb24gY29uZmlnIGNoZWNrCisgICAgICAgICAgICBpZigocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0FQX1JPTEUpICYmCisgICAgICAgICAgICAgICAhcHNlc3Npb25FbnRyeS0+Y2ZnUHJvdGVjdGlvbi5yaWZzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIHByb3RlY3Rpb24gZGlzYWJsZWQuCisgICAgICAgICAgICAgICAgUEVMT0czKGxpbUxvZyhwTWFjLCBMT0czLCBGTCgiIHByb3RlY3Rpb24gZnJvbSBSaWZzIGlzIGRpc2FibGVkIikpOykKKyAgICAgICAgICAgICAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworICAgICAgICAgICAgfWVsc2UgaWYocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSAhPSBlTElNX0FQX1JPTEUgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLy9ub3JtYWwgcHJvdGVjdGlvbiBjb25maWcgY2hlY2sKKyAgICAgICAgICAgICAgIGlmKCFwTWFjLT5saW0uY2ZnUHJvdGVjdGlvbi5yaWZzKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgLy8gcHJvdGVjdGlvbiBkaXNhYmxlZC4KKyAgICAgICAgICAgICAgICAgIFBFTE9HMyhsaW1Mb2cocE1hYywgTE9HMywgRkwoIiBwcm90ZWN0aW9uIGZyb20gUmlmcyBpcyBkaXNhYmxlZCIpKTspCisgICAgICAgICAgICAgICAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICBpZihwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGV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NX1JJRlNfTU9ERV9DSEFOR0VEOworICAgICAgICB9CisgICAgfWVsc2UKKyAgICB7CisgICAgICAgIC8vIERpc2FibGluZyB0aGUgUklGUyBQcm90ZWN0aW9uIG1lYW5zIEVuYWJsZSB0aGUgUklGUyBtb2RlIG9mIG9wZXJhdGlvbiBpbiB0aGUgQlNTCisgICAgICAgIGlmICgoIWVuYWJsZSkgJiYgKGZhbHNlID09IHBzZXNzaW9uRW50cnktPmJlYWNvblBhcmFtcy5mUklGU01vZGUpKQorICAgICAgICB7CisgICAgICAgICAgICBQRUxPRzEobGltTG9nKHBNYWMsIExPRzEsIEZMKCIgPT4gUmlmcyBwcm90ZWN0aW9uIERpc2FibGVkIikpOykKKyAgICAgICAgICAgIHBCZWFjb25QYXJhbXMtPmZSSUZTTW9kZSA9IHBzZXNzaW9uRW50cnktPmJlYWNvblBhcmFtcy5mUklGU01vZGUgPSB0cnVlOworICAgICAgICAgICAgcEJlYWNvblBhcmFtcy0+cGFyYW1DaGFuZ2VCaXRtYXAgfD0gUEFSQU1fUklGU19NT0RFX0NIQU5HRUQ7CisgICAgICAgIH0KKyAgICAvLyBFbmFibGluZyB0aGUgUklGUyBQcm90ZWN0aW9uIG1lYW5zIERpc2FibGUgdGhlIFJJRlMgbW9kZSBvZiBvcGVyYXRpb24gaW4gdGhlIEJTUworICAgICAgICBlbHNlIGlmIChlbmFibGUgJiYgKHRydWUgPT0gcHNlc3Npb25FbnRyeS0+YmVhY29uUGFyYW1zLmZSSUZTTW9kZSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIFBFTE9HMShsaW1Mb2cocE1hYywgTE9HMSwgRkwoIj09PT4gUmlmcyBQcm90ZWN0aW9uIEVuYWJsZWQiKSk7KQorICAgICAgICAgICAgcEJlYWNvblBhcmFtcy0+ZlJJRlNNb2RlID0gcHNlc3Npb25FbnRyeS0+YmVhY29uUGFyYW1zLmZSSUZTTW9kZSA9IGZhbHNlOworICAgICAgICAgICAgcEJlYWNvblBhcmFtcy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CBMT0dFLCBGTCgiRGVsZXRlIFRTIHJlcXVlc3QgcG9pbnRlciBpcyBOVUxMIikpOykKKyAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorCisgICAgaWYgKChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fU1RBX1JPTEUpfHwocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0JUX0FNUF9TVEFfUk9MRSkpCisgICAgeworICAgICAgICB0QU5JX1UzMiB2YWw7CisKKyAgICAgICAgLy8gc3RhdGlvbiBhbHdheXMgdGFsa3MgdG8gdGhlIEFQCisgICAgICAgIHBTdGEgPSBkcGhHZXRIYXNoRW50cnkocE1hYywgRFBIX1NUQV9IQVNIX0lOREVYX1BFRVIsICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsKKworICAgICAgICB2YWwgPSBzaXplb2YodFNpck1hY0FkZHIpOworICAgICAgICAjaWYgMAorICAgICAgICBpZiAod2xhbl9jZmdHZXRTdHIocE1hYywgV05JX0NGR19CU1NJRCwgcGVlck1hY0FkZHIsICZ2YWwpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgLy8vIENvdWxkIG5vdCBnZXQgQlNTSUQgZnJvbSBDRkcuIExvZyBlcnJvci4KKyAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiY291bGQgbm90IHJldHJpZXZlIEJTU0lEIikpOworICAgICAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICAgICAgfQorICAgICAgICNlbmRpZi8vIFRPIFNVUFBPUlQgQlQtQU1QCisgICAgICAgc2lyQ29weU1hY0FkZHIocGVlck1hY0FkZHIscHNlc3Npb25FbnRyeS0+YnNzSWQpOworICAgICAgIAorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICB0QU5JX1UxNiBhc3NvY0lkOworICAgICAgICB0QU5JX1U4ICptYWNhZGRyID0gKHRBTklfVTggKikgcGVlck1hY0FkZHI7CisKKyAgICAgICAgYXNzb2NJZCA9IHBEZWx0c1JlcS0+YWlkOworICAgICAgICBpZiAoYXNzb2NJZCAhPSAwKQorICAgICAgICAgICAgcFN0YSA9IGRwaEdldEhhc2hFbnRyeShwTWFjLCBhc3NvY0lkLCAmcHNlc3Npb25FbnRyeS0+ZHBoLmRwaEhhc2hUYWJsZSk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHBTdGEgPSBkcGhMb29rdXBIYXNoRW50cnkocE1hYywgcERlbHRzUmVxLT5tYWNBZGRyLCAmYXNzb2NJZCwgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUpOworCisgICAgICAgIGlmIChwU3RhICE9IE5VTEwpCisgICAgICAgICAgICAvLyBUQkQ6IGNoZWNrIHN0YSBhc3NvYyBzdGF0ZSBhcyB3ZWxsCisgICAgICAgICAgICBmb3IgKGkgPTA7IGkgPCBzaXplb2YodFNpck1hY0FkZHIpOyBpKyspCisgICAgICAgICAgICAgICAgbWFjYWRkcltpXSA9IHBTdGEtPnN0YUFkZHJbaV07CisgICAgfQorCisgICAgaWYgKHBTdGEgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgIkNhbm5vdCBmaW5kIHN0YXRpb24gY29udGV4dCBmb3IgZGVsdHMgcmVxIik7KQorICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKworICAgIGlmICgoISBwU3RhLT52YWxpZCkgfHwKKyAgICAgICAgKHBTdGEtPm1sbVN0YUNvbnRleHQubWxtU3RhdGUgIT0gZUxJTV9NTE1fTElOS19FU1RBQkxJU0hFRF9TVEFURSkpCisgICAgeworICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsICJJbnZhbGlkIFN0YSAob3Igc3RhdGUpIGZvciBEZWxUc1JlcSIpOykKKyAgICAgIC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C8vZWRjYSBvbmx5IG5vdy4KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgIGlmKCh0c2luZm8tPnRyYWZmaWMuYWNjZXNzUG9saWN5ID09IFNJUl9NQUNfQUNDRVNTUE9MSUNZX0VEQ0EpICYmIAorICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltRWRjYVBhcmFtc1t1cFRvQWModHNpbmZvLT50cmFmZmljLnVzZXJQcmlvKV0uYWNpLmFjbSkKKyAgICAgIHsKKyAgICAgICAgLy9zZW5kIG1lc3NhZ2UgdG8gSEFMIHRvIGRlbGV0ZSBUUworICAgICAgICBpZihlU0lSX1NVQ0NFU1MgIT0gbGltU2VuZEhhbE1zZ0RlbFRzKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YS0+c3RhSW5kZXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHNwZWNJZHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERlbHRzUmVxLT5yZXEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+YnNzSWQpKQorICAgICAgICB7CisgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1csIEZMKCJEZWxUcyB3aXRoIFVQICVkIGZhaWxlZCBpbiBsaW1TZW5kSGFsTXNnRGVsVHMgLSBpZ25vcmluZyByZXF1ZXN0IiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0c2luZm8tPnRyYWZmaWMudXNlclByaW8pOworICAgICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgICAgICB9CisgICAgICB9CisgICAgfQorICAgIHJldHVybiBlU0lSX1NVQ0NF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ICAgICAgdEFOSV9VMzIgYmFEaXJlY3Rpb24sIHRTaXJNYWNSZWFzb25Db2RlcyBiYVJlYXNvbkNvZGUpCit7CisgICAgdEFOSV9VMzIgaTsKKyAgICB0QU5JX1U4IHRpZDsKKyAgICB0cERwaEhhc2hOb2RlIHBTdGE7CisKKyAgICBpZiAoTlVMTCA9PSBwU2Vzc2lvbkVudHJ5KQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJTZXNzaW9uIGRvZXMgbm90IGV4aXN0IikpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBmb3IodGlkID0gMDsgdGlkIDwgU1RBQ0ZHX01BWF9UQzsgdGlkKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmICgoZUxJTV9BUF9ST0xFID09IHBTZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUpIHx8CisgICAgICAgICAgICAgICAgKHBTZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9CVF9BTVBfQVBfUk9MRSkgfHwKKyAgICAgICAgICAgICAgICAoZUxJTV9TVEFfSU5fSUJTU19ST0xFID09IHBTZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUpIHx8CisgICAgICAgICAgICAgICAgKHBTZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9QMlBfREVWSUNFX0dPKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcE1hYy0+bGltLm1heFN0YXRpb247IGkrKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBTdGEgPSBwU2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlLnBEcGhOb2RlQXJyYXkgKyBpOworICAgICAgICAgICAgICAgICAgICBpZiAocFN0YSAmJiBwU3RhLT5hZGRlZCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChlQkFfRU5BQkxFID09IHBTdGEtPnRjQ2ZnW3RpZF0uZlVzZUJBVHgpICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYmFEaXJlY3Rpb24gJiBCQV9JTklUSUFUT1IpKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVBvc3RNbG1EZWxCQVJlcShwTWFjLCBwU3RhLCBlQkFfSU5JVElBVE9SLCB0aWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhUmVhc29uQ29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGVCQV9FTkFCTEUgPT0gcFN0YS0+dGNDZmdbdGlkXS5mVXNlQkFSeCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYmFEaXJlY3Rpb24gJiBCQV9SRUNJUElFTlQpKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVBvc3RNbG1EZWxCQVJlcShwTWFjLCBwU3RhLCBlQkFfUkVDSVBJRU5ULCB0aWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhUmVhc29uQ29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmICgoZUxJTV9TVEFfUk9MRSA9PSBwU2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlKSB8fAorICAgICAgICAgICAgICAgICAgICAgKGVMSU1fQlRfQU1QX1NUQV9ST0xFID09IHBTZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUpIHx8CisgICAgICAgICAgICAgICAgICAgICAoZUxJTV9QMlBfREVWSUNFX1JPTEUgPT0gcFNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFN0YSA9IGRwaEdldEhhc2hFbnRyeShwTWFjLCBEUEhfU1RBX0hBU0hfSU5ERVhfUEVFUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwU2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKTsKKyAgICAgICAgICAgICAgICBpZiAocFN0YSAmJiBwU3RhLT5hZGRlZCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmICgoZUJBX0VOQUJMRSA9PSBwU3RhLT50Y0NmZ1t0aWRdLmZVc2VCQVR4KSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGJhRGlyZWN0aW9uICYgQkFfSU5JVElBVE9SKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgbGltUG9zdE1sbURlbEJBUmVxKHBNYWMsIHBTdGEsIGVCQV9JTklUSUFUT1IsIHRpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYVJlYXNvbkNvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKChlQkFfRU5BQkxFID09IHBTdGEtPnRjQ2ZnW3RpZF0uZlVzZUJBUngpICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYmFEaXJlY3Rpb24gJiBCQV9SRUNJUElFTlQpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW1Qb3N0TWxtRGVsQkFSZXEocE1hYywgcFN0YSwgZUJBX1JFQ0lQSUVOVCwgdGlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhUmVhc29uQ29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KK30KKworLyoqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KK1xmbiAgICAgbGltRGVsQWxsQkFTZXNzaW9ucworXGJyaWVmICBEZWxldGVzIGFsbCB0aGUgZXhpc2l0bmcgQkEgc2Vzc2lvbnMuCitccGFyYW0gIHRwQW5pU2lyR2xvYmFsIHBNYWMKK1xyZXR1cm4gTm9uZQorLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisKK3ZvaWQgbGltRGVsQWxsQkFTZXNzaW9ucyh0cEFuaVNpckdsb2JhbCBwTWFjKQoreworICAgIHRBTklfVTMyIGk7CisgICAgdHBQRVNlc3Npb24gcFNlc3Npb25FbnRyeTsKKworICAgIGZvciAoaSA9IDA7IGkgPCBwTWFjLT5saW0ubWF4QnNzSWQ7IGkrKykKKyAgICB7CisgICAgICAgIHBTZXNzaW9uRW50cnkgPSBwZUZpbmRTZXNzaW9uQnlTZXNzaW9uSWQocE1hYywgaSk7CisgICAgICAgIGlmIChwU2Vzc2lvbkVudHJ5KQorICAgICAgICB7CisgICAgICAgICAgICBsaW1EZWxldGVCQVNlc3Npb25zKHB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yICAgICAgICAgICBwZWVyTWFjQWRkcjsKKyAgdHBTaXJEZWx0c1JlcUluZm8gICAgIHBEZWxUc1JlcUluZm87CisgIHRwTGltVHNwZWNJbmZvICAgICAgICBwVHNwZWNJbmZvOworICB0cFBFU2Vzc2lvbiAgICAgICAgICAgcHNlc3Npb25FbnRyeTsKKyAgdEFOSV9VOCAgICAgICAgICAgICAgIHNlc3Npb25JZDsgIAorCitpZigocHNlc3Npb25FbnRyeSA9IHBlRmluZFNlc3Npb25CeUJzc2lkKHBNYWMscERlbFRzUGFyYW0tPmJzc0lkLCZzZXNzaW9uSWQpKT09IE5VTEwpCisgICAgeworICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsRkwoInNlc3Npb24gZG9lcyBub3QgZXhpc3QgZm9yIGdpdmVuIEJzc0lkIikpOworICAgICAgICAgdm9zX21lbV9mcmVlKGxpbU1zZy0+Ym9keXB0cik7CisgICAgICAgICBsaW1Nc2ctPmJvZHlwdHIgPSBOVUxMOworICAgICAgICAgcmV0dXJuOworICAgIH0KKworICBwVHNwZWNJbmZvID0gJihwTWFjLT5saW0udHNwZWNJbmZvW3BEZWxUc1BhcmFtLT50c3BlY0lkeF0pOworICBpZihwVHNwZWNJbmZvLT5pbnVzZSA9PSBmYWxzZSkKKyAgeworICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoInRzcGVjIGVudHJ5IHdpdGggaW5kZXggJWQgaXMgbm90IGluIHVzZSIpLCBwRGVsVHNQYXJhbS0+dHNwZWNJZHgpOykKKyAgICBnb3RvIGVycm9yMTsKKyAgfQorCisgIHBTdGEgPSBkcGhHZXRIYXNoRW50cnkocE1hYywgcFRzcGVjSW5mby0+YXNzb2NJZCwgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUpOworICBpZihwU3RhID09IE5VTEwpCisgIHsKKyAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkNvdWxkIG5vdCBmaW5kIGVudHJ5IGluIERQSCB0YWJsZSBmb3IgYXNzb2NJZCA9ICVkIiksCisgICAgICAgICAgICAgICAgcFRzcGVjSW5mby0+YXNzb2NJZCk7CisgICAgZ290byBlcnJvcjE7CisgIH0KKworICBwRGVsVHNSZXEgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpckRlbHRzUmVxKSk7CisgIGlmICggTlVMTCA9PSBwRGVsVHNSZXEgKQorICB7CisgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkFsbG9jYXRlTWVtb3J5KCkgZmFpbGVkIikpOykKKyAgICAgZ290byBlcnJvcjE7CisgIH0KKworICB2b3NfbWVtX3NldCggKHRBTklfVTggKilwRGVsVHNSZXEsIHNpemVvZih0U2lyRGVsdHNSZXEpLCAwKTsKKworICBpZihwU3RhLT53bWVFbmFibGVkKQorICAgIHZvc19tZW1fY29weSggJihwRGVsVHNSZXEtPnJlcS50c3BlYyksICYocFRzcGVjSW5mby0+dHNwZWMpLCBzaXplb2YodFNpck1hY1RzcGVjSUUpKTsKKyAgZWxzZQorICAgIHZvc19tZW1fY29weSggJihwRGVsVHNSZXEtPnJlcS50c2luZm8pLCAmKHBUc3BlY0luZm8tPnRzcGVjLnRzaW5mbyksIHNpemVvZih0U2lyTWFjVFNJbmZvKSk7CisKKworICAvL3ZhbGlkYXRlIHRoZSByZXEKKyAgaWYgKGVTSVJfU1VDQ0VTUyAhPSBsaW1WYWxpZGF0ZURlbHRzUmVxKHBNYWMsIHBEZWxUc1JlcSwgcGVlck1hY0FkZHIscHNlc3Npb25FbnRyeSkpCisgIHsKKyAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJsaW1WYWxpZGF0ZURlbHRzUmVxIGZhaWxlZCIpKTspCisgICAgZ290byBlcnJvcjI7CisgIH0KKyAgbGltTG9nKHBNYWMsIExPRzEsICJTZW50IERFTFRTIHJlcXVlc3QgdG8gc3RhdGlvbiB3aXRoICIKKyAgICAgICAgICAgICAgICAiYXNzb2NJ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gU0lSX01BWF9TVVBQT1JURURfQ0hBTk5FTF9MSVNUKQorICAgICAgICB7CisgICAgICAgICAgICBwTWFjLT5saW0uc2NhbkNobkluZm8uc2NhbkNobltwTWFjLT5saW0uc2NhbkNobkluZm8ubnVtQ2huSW5mb10uY2hhbm5lbElkID0gY2hhbm5lbElkOworICAgICAgICAgICAgcE1hYy0+bGltLnNjYW5DaG5JbmZvLnNjYW5DaG5bcE1hYy0+bGltLnNjYW5DaG5JbmZvLm51bUNobkluZm8rK10ubnVtVGltZVNjYW4gPSAxOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiIC0tIG51bWJlciBvZiBjaGFubmVscyBleGNlZWQgbWFjIikpOykKKyAgICAgICAgfQorICAgIH0KK30KKworCisvKioKKyAqIEBmdW5jdGlvbiA6ICBsaW1Jc0NoYW5uZWxWYWxpZEZvckNoYW5uZWxTd2l0Y2goKSAKKyAqCisgKiBAYnJpZWYgIDogIFRoaXMgZnVuY3Rpb24gY2hlY2tzIGlmIHRoZSBjaGFubmVsIHRvIHdoaWNoIEFQCisgKiAgICAgICAgICAgIGlzIGV4cGVjdGluZyB1cyB0byBzd2l0Y2gsIGlzIGEgdmFsaWQgY2hhbm5lbCBmb3IgdXMuCisgKiAgICAgIExPR0lDOgorICoKKyAqICAgICAgQVNTVU1QVElPTlM6CisgKiAgICAgICAgICBOQQorICoKKyAqICAgICAgTk9URToKKyAqICAgICAgICAgIE5BCisgKgorICogQHBhcmFtICBwTWFjIC0gUG9pbnRlciB0byBHbG9iYWwgTUFDIHN0cnVjdHVyZQorICogQHBhcmFtICBjaGFubmVsIC0gTmV3IGNoYW5uZWwgdG8gd2hpY2ggd2UgYXJlIGV4cGVjdGVkIHRvIG1vdmUKKyAqIEByZXR1cm4gTm9uZQorICovCit0QW5pQm9vbCAKK2xpbUlzQ2hhbm5lbFZhbGlkRm9yQ2hhbm5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RlbHkgKi8KKyAgICAgICAgICAgIHBUeEN0cmxNc2ctPmZDdHJsR2xvYmFsID0gMTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUxJTV9UWF9CU1NfQlVUX0JFQUNPTjoKKyAgICAgICAgICAgIC8qKiBTdG9wcy9yZXN1bWVzIHRyYW5zbWlzc2lvbiBvbiBhIHBhcnRpY3VsYXIgQlNTLiBTdG9wcGluZyBCU1MsIGRvZXNudAorICAgICAgICAgICAgICAqICBzdG9wIGJlYWNvbiB0cmFuc21pc3Npb24uCisgICAgICAgICAgICAgICovCisgICAgICAgICAgICBwVHhDdHJsTXNnLT5jdHJsQnNzID0gMTsKKyAgICAgICAgICAgIHBUeEN0cmxNc2ctPmJzc0JpdG1hcCAgICB8PSAoMSA8PCBwc2Vzc2lvbkVudHJ5LT5ic3NJZHgpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlTElNX1RYX1NUQToKKyAgICAgICAgICAgIC8qKiBNZW1vcnkgZm9yIHN0YXRpb24gYml0bWFwIGlzIGFsbG9jYXRlZCBkeW5hbWljYWxseSBpbiBjYWxsZXIgb2YgdGhpcworICAgICAgICAgICAgICAqICBzbyBkZWNvZGUgcHJvcGVybHkgaGVyZSBhbmQgZmlsbCB0aGUgYml0bWFwLiBOb3cgbm90IGltcGxlbWVudGVkLAorICAgICAgICAgICAgICAqICBmYWxsIHRocm91Z2guCisgICAgICAgICAgICAgICovCisgICAgICAgIGNhc2UgZUxJTV9UWF9CU1M6CisgICAgICAgICAgICAvL0ZhbGwgdGhydS4uLgorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiSW52YWxpZCBjYXNlOiBOb3QgSGFuZGxlZCIpKTspCisgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICB9CisKKyAgICByZXR1cm4gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKK30KKworLyoqCisgKiBAZnVuY3Rpb24gOiAgbGltRnJhbWVUcmFuc21pc3Npb25Db250cm9sKCkgCisgKgorICogQGJyaWVmICA6ICBUaGlzIEFQSSBpcyBjYWxsZWQgYnkgdGhlIHVzZXIgdG8gaGFsdC9yZXN1bWUgYW55IGZyYW1lCisgKiAgICAgICB0cmFuc21pc3Npb24gZnJvbSB0aGUgZGV2aWNlLiBJZiBzdG9wcGVkLCBhbGwgZnJhbWVzIHdpbGwgYmUKKyAqICAgICAgICAgICAgcXVldWVkIHN0YXJ0aW5nIGZyb20gaGFyZHdhcmUuIFRoZW4gYmFjay1wcmVzc3VyZQorICogICAgICAgICAgICBpcyBidWlsdCB0aWxsIHRoZSBkcml2ZXIuCisgKiAgICAgIExPR0lDOgorICoKKyAqICAgICAgQVNTVU1QVElPTlM6CisgKiAgICAgICAgICBOQQorICoKKyAqICAgICAgTk9URToKKyAqICAgICAgICAgIE5BCisgKgorICogQHBhcmFtICBwTWFjIC0gUG9pbnRlciB0byBHbG9iYWwgTUFDIHN0cnVjdHVyZQorICogQHJldHVybiBOb25lCisgKi8KK3ZvaWQgbGltRnJhbWVUcmFuc21pc3Npb25Db250cm9sKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRMaW1RdWlldFR4TW9kZSB0eXBlLCB0TGltQ29udHJvbFR4IG1vZGUpCit7CisKKyAgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgdHBUeENvbnRyb2xQYXJhbXMgcFR4Q3RybE1zZzsKKyAgICB0U2lyTXNnUSAgICAgICAgICBtc2dROworICAgIHRBTklfVTggICAgICAgICAgIG5CeXRlcyA9IDA7ICAvLyBObyBvZiBieXRlcyByZXF1aXJlZCBmb3Igc3RhdGlvbiBiaXRtYXAuCisKKyAgICAvKiogQWxsb2NhdGUgb25seSByZXF1aXJlZCBudW1iZXIgb2YgYnl0ZXMgZm9yIHN0YXRpb24gYml0bWFwCisgICAgICogTWFrZSBpdCB0byBhbGlnbiB0byA0IGJ5dGUgYm91bmRhcnkgICovCisgICAgbkJ5dGVzID0gKHRBTklfVTgpSEFMTVNHX05VTUJZVEVTX1NUQVRJT05fQklUTUFQKHBNYWMtPmxpbS5tYXhTdGF0aW9uKTsKKworICAgIHBUeEN0cmxNc2cgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YoKnBUeEN0cmxNc2cpICsgbkJ5dGVzKTsKKyAgICBpZiAoIE5VTEwgPT0gcFR4Q3RybE1zZyApCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoIkFsbG9jYXRlTWVtb3J5KCkgZmFpbGVkIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgdm9zX21lbV9zZXQoKHZvaWQgKikgcFR4Q3RybE1zZywKKyAgICAgICAgICAgICAgIChzaXplb2YoKnBUeEN0cmxNc2cpICsgbkJ5dGVzKSwgMCk7CisgICAgc3RhdHVzID0gX19saW1GaWxsVHhDb250cm9sUGFyYW1zKHBNYWMsIHBUeEN0cmxNc2csIHR5cGUsIG1vZGUpOworICAgIGlmIChzdGF0dXMgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZShwVHhDdHJsTXNnKTsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJfX2xpbUZpbGxUeENvbnRyb2xQYXJhbXMgZmFpbGVkLCBzdGF0dXMgPSAlZCIpLCBzdGF0dXMpOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIAorICAgIG1zZ1EuYm9keXB0ciA9ICh2b2lkICopIHBUeEN0cmxNc2c7CisgICAgbXNnUS5ib2R5dmFsID0gMDsKKyAgICBtc2dRLnJlc2VydmVkID0gMDsKKyAgICBtc2dRLnR5cGUgPSBXREFfVFJBTlNNSVNTSU9OX0NPTlRST0xfSU5EOworCisgICAgTVRSQUNFKG1hY1RyYWNlTXNnVHgocE1hYywgTk9fU0VTU0lPTiwgbXNnUS50eXBlKSk7CisgICAgaWYod2RhUG9zdEN0cmxNc2coIHBNYWMsICZtc2dRKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgeworICAgICAgICB2b3NfbWVtX2ZyZWUocFR4Q3RybE1zZyk7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HUCwgRkwoIlBvc3RpbmcgTWVzc2FnZSB0byBIQUwgZmFpbGVkIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaWYgKG1vZGUgPT0gZUxJTV9TVE9QX1RYKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlN0b3BwaW5nIHRoZSB0cmFuc21pc3Npb24gb2YgYWxsIHBhY2tldHMsIGluZGljYXRlZCBzb2Z0bWFjIikpOworICAgICAgICB9CisgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlJlc3VtaW5nIHRoZSB0cmFuc21pc3Npb24gb2YgYWxsIHBhY2tldHMsIGluZGljYXRlZCBzb2Z0bWFjIikpOworICAgICAgICB9CisgICAgcmV0dXJuOworfQorCisKKy8qKgorICogQGZ1bmN0aW9uIDogIGxpbVJlc3RvcmVQcmVDaGFubmVsU3dpdGNoU3RhdGUoKSAKKyAqCisgKiBAYnJpZWYgIDogIFRoaXMgQVBJIGlzIGNhbGxlZCBieSB0aGUgdXNlciB0byB1bmRvIGFueSAKKyAqICAgICAgICAgICAgc3BlY2lmaWMgY2hhbmdlcyBkb25lIG9uIHRoZSBkZXZpY2UgZHVyaW5nCisgKiAgICAgICAgICAgIGNoYW5uZWwgc3dpdGNoLgorICogICAgICBMT0dJQzoKKyAqCisgKiAgICAgIEFTU1VNUFRJT05TOgorICogICAgICAgICAgTkEKKyAqCisgKiAgICAgIE5PVEU6CisgKiAgICAgICAgICBOQQorICoKKyAqIEBwYXJhbSAgcE1hYyAtIFBvaW50ZXIgdG8g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kLCBlbHNlIGRvbid0IGJvdGhlciAqLworICAgICAgICBpZiAoKHJldENvZGUgPSB3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0JBQ0tHUk9VTkRfU0NBTl9QRVJJT0QsCisgICAgICAgICAgICAgICAgICAgICAgJnZhbCkpICE9IGVTSVJfU1VDQ0VTUykKKworICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoImNvdWxkIG5vdCByZXRyaWV2ZSBCYWNrZ3JvdW5kIHNjYW4gcGVyaW9kIHZhbHVlIikpOworICAgICAgICAgICAgcmV0dXJuIChyZXRDb2RlKTsgICAKKyAgICAgICAgfQorCisgICAgICAgIGlmICh2YWwgPiAwICYmIFRYX1RJTUVSX1ZBTElEKHBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbUJhY2tncm91bmRTY2FuVGltZXIpKQorICAgICAgICB7CisgICAgICAgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9USU1FUl9BQ1RJVkFURSwKKyAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkLCBlTElNX0JBQ0tHUk9VTkRfU0NBTl9USU1FUikpOworICAgICAgICAgICAgaWYodHhfdGltZXJfYWN0aXZhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbUJhY2tncm91bmRTY2FuVGltZXIpICE9IFRYX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJDb3VsZCBub3QgcmVzdGFydCBiYWNrZ3JvdW5kIHNjYW4gdGltZXIsIGRvaW5nIExPR1AiKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIChlU0lSX0ZBSUxVUkUpOworICAgICAgICAgICAgfQorCisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKiBFbmFibGUgaGVhcnRiZWF0IHRpbWVyICovCisgICAgaWYgK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EJhY2tncm91bmQgc2NhbiBwZXJpb2QgdmFsdWUiKSk7CisgICAgICAgICAgICByZXR1cm4gKHJldENvZGUpOyAgIAorICAgICAgICB9CisKKyAgICAgICAgaWYgKHZhbCA+IDAgJiYgVFhfVElNRVJfVkFMSUQocE1hYy0+bGltLmxpbVRpbWVycy5nTGltQmFja2dyb3VuZFNjYW5UaW1lcikpCisgICAgICAgIHsKKyAgICAgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RJTUVSX0FDVElWQVRFLCBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwgZUxJTV9CQUNLR1JPVU5EX1NDQU5fVElNRVIpKTsKKyAgICAgICAgICAgIGlmKHR4X3RpbWVyX2FjdGl2YXRlKCZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1CYWNrZ3JvdW5kU2NhblRpbWVyKSAhPSBUWF9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiQ291bGQgbm90IHJlc3RhcnQgYmFja2dyb3VuZCBzY2FuIHRpbWVyLCBkb2luZyBMT0dQIikpOworICAgICAgICAgICAgICAgIHJldHVybiAoZVNJUl9GQUlMVVJFKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICB9CisgICAgfQorCisgICAgLyogRW5hYmxlIGhlYXJ0YmVhdCB0aW1lciAqLworICAgIGlmIChUWF9USU1FUl9WQUxJRChwTWFjLT5saW0ubGltVGltZXJzLmdMaW1IZWFydEJlYXRUaW1lcikpCisgICAgeworICAgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9USU1FUl9BQ1RJVkFURSwgcHNlc3Npb25FbnRyeS0+cGVTZXNzaW9uSWQsIGVMSU1fSEVBUlRfQkVBVF9USU1FUikpOworICAgICAgICBpZihsaW1BY3RpdmF0ZUhlYXJCZWF0VGltZXIocE1hYywgcHNlc3Npb25FbnRyeSkgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJDb3VsZCBub3QgcmVzdGFydCBoZWFydGJlYXQgdGltZXIsIGRvaW5nIExPR1AiKSk7CisgICAgICAgICAgICByZXR1cm4gKGVTSVJfRkFJTFVSRSk7CisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIChyZXRDb2RlKTsKK30KKworCisvKioKKyAqIEBmdW5jdGlvbjogbGltUHJlcGFyZUZvcjExaENoYW5uZWxTd2l0Y2goKSAKKyAqCisgKiBAYnJpZWYgIDogIFRoaXMgQVBJIGlzIGNhbGxlZCBieSB0aGUgdXNlciB0byBwcmVwYXJlIGZvcgorICogICAgICAgICAgICAxMWggY2hhbm5lbCBzd2l0Y2guIEFzIG9mIG5vdywgdGhlIEFQSSBkb2VzIAorICogICAgICAgICAgICB2ZXJ5IG1pbmltYWwgd29yay4gVXNlciBjYW4gYWRkIG1vcmUgaW50byB0aGUKKyAqICAgICAgICAgICAgc2FtZSBBUEkgaWYgbmVlZGVkLgorICogICAgICBMT0dJQzoKKyAqCisgKiAgICAgIEFTU1VNUFRJT05TOgorICogICAgICAgICAgTkEKKyAqCisgKiAgICAgIE5PVEU6CisgKiAgICAgICAgICBOQQorICoKKyAqIEBwYXJhbSAgcE1hYyAtIFBvaW50ZXIgdG8gR2xvYmFsIE1BQyBzdHJ1Y3R1cmUKKyAqIEBwYXJhbSAgcHNlc3Npb25FbnRyeQorICogQHJldHVybiBOb25lCisgKi8KK3ZvaWQgCitsaW1QcmVwYXJlRm9yMTFoQ2hhbm5lbFN3aXRjaCh0cEFuaVNpckdsb2JhbCBwTWFjLCB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KQoreworICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlICE9IGVMSU1fU1RBX1JPTEUpCisgICAgICAgIHJldHVybjsKKyAgICAgCisgICAgLyogRm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iZSByZXNwb25zZQorCitccmV0dXJuIE5ldHdvcmsgdHlwZSBhL2IvZy4KKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KK3RTaXJOd1R5cGUgbGltR2V0TndUeXBlKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggY2hhbm5lbE51bSwgdEFOSV9VMzIgdHlwZSwgdHBTY2hCZWFjb25TdHJ1Y3QgcEJlYWNvbikKK3sKKyAgICB0U2lyTndUeXBlIG53VHlwZSA9IGVTSVJfMTFCX05XX1RZUEU7CisKKyAgICBpZiAodHlwZSA9PSBTSVJfTUFDX0RBVEFfRlJBTUUpCisgICAgeworICAgICAgICBpZiAoKGNoYW5uZWxOdW0gPiAwKSAmJiAoY2hhbm5lbE51bSA8IDE1KSkKKyAgICAgICAgeworICAgICAgICAgICAgbndUeXBlID0gZVNJUl8xMUdfTldfVFlQRTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIG53VHlwZSA9IGVTSVJfMTFBX05XX1RZUEU7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgaWYgKChjaGFubmVsTnVtID4gMCkgJiYgKGNoYW5uZWxOdW0gPCAxNSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGludCBpOworICAgICAgICAgICAgLy8gMTFiIG9yIDExZyBwYWNrZXQKKyAgICAgICAgICAgIC8vIDExZyBpZmYgZXh0ZW5kZWQgUmF0ZSBJRSBpcyBwcmVzZW50IG9yCisgICAgICAgICAgICAvLyBpZiB0aGVyZSBpcyBhbiBBIHJhdGUgaW4gc3VwcFJhdGUgSUUKKyAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwQmVhY29uLT5zdXBwb3J0ZWRSYXRlcy5udW1SYXRlczsgaSsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChzaXJJc0FyYXRlKHBCZWFjb24tPnN1cHBvcnRlZFJhdGVzLnJhdGVbaV0gJiAweDdmKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIG53VHlwZSA9IGVTSVJfMTFHX05XX1RZUEU7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChwQmVhY29uLT5leHRlbmRlZFJhdGVzUHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQRUxPRzMobGltTG9nKHBNYWMsIExPRzMsIEZMKCJCZWFjb24sIG53dHlwZT1HIikpOykKKyAgICAgICAgICAgICAgICBud1R5cGUgPSBlU0lSXzExR19OV19UWVBFOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLy8gMTFhIHBhY2tldAorICAgICAgICAgICAgUEVMT0czKGxpbUxvZyhwTWFjLCBMT0czLEZMKCJCZWFjb24sIG53dHlwZT1BIikpOykKKyAgICAgICAgICAgIG53VHlwZSA9IGVTSVJfMTFBX05XX1RZUEU7CisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIG53VHlwZTsKK30KKworCisvKiotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KK1xmbiAgICAgICAgbGltR2V0Q2hhbm5lbEZyb21CZWFjb24KK1xicmllZiAgICBUbyBleHRyYWN0IGNoYW5uZWwgbnVtYmVyIGZyb20gYmVhY29uCisKK1xwYXJhbSBwTWFjCitccGFyYW0gcEJlYWNvbiAtIFBvaW50ZXIgdG8gYmVhY29uIG9yIHByb2JlIHJzcAorXHJldHVybiBjaGFubmVsIG51bWJlcgorLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGxpbUlic3NIZWFydEJlYXRIYW5kbGUocE1hYywmcE1hYy0+bGltLmdwU2Vzc2lvbltpXSk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmKChwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmJzc1R5cGUgPT0gZVNJUl9JTkZSQVNUUlVDVFVSRV9NT0RFKSAmJgorICAgICAgICAgICAgICAgIChwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9TVEFfUk9MRSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltSGFuZGxlSGVhcnRCZWF0RmFpbHVyZShwTWFjLCZwTWFjLT5saW0uZ3BTZXNzaW9uW2ldKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICB9CisgICAgIGZvcihpPTA7IGk8IHBNYWMtPmxpbS5tYXhCc3NJZDsgaSsrKQorICAgICB7CisgICAgICAgIGlmKHBNYWMtPmxpbS5ncFNlc3Npb25baV0udmFsaWQgPT0gVFJVRSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKChwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmJzc1R5cGUgPT0gZVNJUl9JTkZSQVNUUlVDVFVSRV9NT0RFKSAmJgorICAgICAgICAgICAgICAgIChwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9TVEFfUk9MRSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYocE1hYy0+bGltLmdwU2Vzc2lvbltpXS5MaW1IQkZhaWx1cmVTdGF0dXMgPT0gZUFOSV9CT09MRUFOX1RSVUUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBBY3RpdmF0ZSBQcm9iZSBBZnRlciBIZWFydEJlYXQgVGltZXIgaW5jYXNlIEhCIEZhaWx1cmUgZGV0ZWN0ZWQgKi8KKyAgICAgICAgICAgICAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLEZMKCJTZW5kaW5nIFByb2JlIGZvciBTZXNzaW9uOiAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkpOykKKyAgICAgICAgICAgICAgICAgICAgbGltRGVhY3RpdmF0ZUFuZENoYW5nZVRpbWVyKHBNYWMsIGVMSU1fUFJPQkVfQUZURVJfSEJfVElNRVIpOworICAgICAgICAgICAgICAgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJBQ0VfQ09ERV9USU1FUl9BQ1RJVkFURSwgMCwgZUxJTV9QUk9CRV9BRlRFUl9IQl9USU1FUikpOworICAgICAgICAgICAgICAgICAgICBpZiAodHhfdGltZXJfYWN0aXZhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbVByb2JlQWZ0ZXJIQlRpbWVyKSAhPSBUWF9TVUNDRVNTKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoIkZhaWwgdG8gcmUtYWN0aXZhdGUgUHJvYmUtYWZ0ZXItaGVhcnRiZWF0IHRpbWVyIikpOworICAgICAgICAgICAgICAgICAgICAgICAgbGltUmVhY3RpdmF0ZUhlYXJ0QmVhdFRpbWVyKHBNYWMsICZwTWFjLT5saW0uZ3BTZXNzaW9uW2ldKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cit9CisKK3ZvaWQgbGltSGFuZGxlSGVhcnRCZWF0VGltZW91dEZvclNlc3Npb24odHBBbmlTaXJHbG9iYWwgcE1hYywgdHBQRVNlc3Npb24gcHNlc3Npb25FbnRyeSkKK3sKKyAgICBpZihwc2Vzc2lvbkVudHJ5LT52YWxpZCA9PSBUUlVFICkKKyAgICB7CisgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPmJzc1R5cGUgPT0gZVNJUl9JQlNTX01PREUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUlic3NIZWFydEJlYXRIYW5kbGUocE1hYyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgfQorICAgICAgICBpZigocHNlc3Npb25FbnRyeS0+YnNzVHlwZSA9PSBlU0lSX0lORlJBU1RSVUNUVVJFX01PREUpICYmCisgICAgICAgICAgICAgKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9TVEFfUk9MRSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbUhhbmRsZUhlYXJ0QmVhdEZhaWx1cmUocE1hYyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgfQorICAgIH0KKyAgICAvKiBJbiB0aGUgZnVuY3Rpb24gbGltSGFuZGxlSGVhcnRCZWF0RmFpbHVyZSB0aGluZ3MgY2FuIGNoYW5nZSBzbyBjaGVjayBmb3IgdGhlIHNlc3Npb24gZW50cnkgIHZhbGlkCisgICAgIGFuZCB0aGUgb3RoZXIgdGhpbmdzIGFnYWluICovCisgICAgaWYocHNlc3Npb25FbnRyeS0+dmFsaWQgPT0gVFJVRSApCisgICAgeworICAgICAgICBpZigocHNlc3Npb25FbnRyeS0+YnNzVHlwZSA9PSBlU0lSX0lORlJBU1RSVUNUVVJFX01PREUpICYmCisgICAgICAgICAgICAocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX1NUQV9ST0xFKSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+TGltSEJGYWlsdXJlU3RhdHVzID09IGVBTklfQk9PTEVBTl9UUlVFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEFjdGl2YXRlIFByb2JlIEFmdGVyIEhlYXJ0QmVhdCBUaW1lciBpbmNhc2UgSEIgRmFpbHVyZSBkZXRlY3RlZCAqLworICAgICAgICAgICAgICAgIFBFTE9HVyhsaW1Mb2cocE1hYywgTE9HVyxGTCgiU2VuZGluZyBQcm9iZSBmb3IgU2Vzc2lvbjogJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+YnNzSWR4KTspCisgICAgICAgICAgICAgICAgbGltRGVhY3RpdmF0ZUFuZENoYW5nZVRpbWVyKHBNYWMsIGVMSU1fUFJPQkVfQUZURVJfSEJfVElNRVIpOworICAgICAgICAgICAgICAgIE1UUkFDRShtYWNUcmFjZShwTWFjLCBUUkFDRV9DT0RFX1RJTUVSX0FDVElWQVRFLCAwLCBlTElNX1BST0JFX0FGVEVSX0hCX1RJTUVSKSk7CisgICAgICAgICAgICAgICAgaWYgKHR4X3RpbWVyX2FjdGl2YXRlKCZwTWFjLT5saW0ubGltVGltZXJzLmdMaW1Qcm9iZUFmdGVySEJUaW1lcikgIT0gVFhfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiRmFpbCB0byByZS1hY3RpdmF0ZSBQcm9iZS1hZnRlci1oZWFydGJlYXQgdGltZXIiKSk7CisgICAgICAgICAgICAgICAgICAgIGxpbVJlYWN0aXZhdGVIZWFydEJlYXRUaW1lcihwTWFjLCBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cit9CisKKwordEFOSV9VOCBsaW1HZXRDdXJyZW50T3BlcmF0aW5nQ2hhbm5lbCh0cEFuaVNpckdsb2JhbCBwTWFjKQoreworICAgIHRBTklfVTggaTsKKyAgICBmb3IoaSA9MDtpIDwgcE1hYy0+bGltLm1heEJzc0lkO2krKykKKyAgICB7CisgICAgICAgIGlmKHBNYWMtPmxpbS5ncFNlc3Npb25baV0udmFsaWQgPT0gVFJVRSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKChwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmJzc1R5cGUgPT0gZVNJUl9JTkZSQVNUUlVDVFVSRV9NT0RFKSAmJgorICAgICAgICAgICAgICAgIChwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9TVEFfUk9MRSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHBNYWMtPmxpbS5ncFNlc3Npb25baV0uY3VycmVudE9wZXJDaGFubmVsOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIHJldHVybiAwOworfQorCit2b2lkIGxpbVByb2Nlc3NBZGRTdGFSc3AodHBBbmlTaXJHbG9iYWwgcE1hYyx0cFNpck1zZ1EgbGltTXNnUSkKK3sKKyAgICAgCisgICAgdHBQRVNlc3Npb24gICAgICAgICBwc2Vzc2lvbkVudHJ5OworLy8gICAgdEFOSV9VOCAgICAgICAgICAgICBzZXNzaW9uSWQ7CisgICAgdHBBZGRTdGFQYXJhbXMgICAgICBwQWRkU3RhUGFyYW1zOworCisgICAgcEFkZFN0YVBhcmFtcyA9ICh0cEFkZFN0YVBhcmFtcylsaW1Nc2dRLT5ib2R5cHRyOyAgICAKKyAgICAKKyAgICBpZigocHNlc3Npb25FbnRyeSA9IHBlRmluZFNlc3Npb25CeVNlc3Npb25JZChwTWFjLHBBZGRTdGFQYXJhbXMtPnNlc3Npb25JZCkpPT1OVUxMKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsRkwoIlNlc3Npb24gRG9lcyBub3QgZXhpc3QgZm9yIGdpdmVuIHNlc3Npb25JRCIpKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBBZGRTdGFQYXJhbXMpOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fU1RBX0lOX0lCU1NfUk9MRSkKKyAgICAgICAgKHZvaWQpIGxpbUlic3NBZGRTdGFSc3AocE1hYywgbGltTXNnUS0+Ym9keXB0cixwc2Vzc2lvbkVudHJ5KTsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworICAgIGVsc2UgaWYocE1hYy0+bGltLmdMaW1BZGRTdGFUZGxzKQorICAgIHsKKyAgICAgICAgbGltUHJvY2Vzc1RkbHNBZGRTdGFSc3AocE1hYywgbGltTXNnUS0+Ym9keXB0ciwgcHNlc3Npb25FbnRyeSkgOworICAgICAgICBwTWFjLT5saW0uZ0xpbUFkZFN0YVRkbHMgPSBGQUxTRSA7CisgICAgfSAgICAKKyNlbmRpZgorICAgIGVsc2UKKyAgICAgICAgbGltUHJvY2Vzc01sbUFkZFN0YVJzcChwTWFjLCBsaW1Nc2dRLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgIAorfQorCisKK3ZvaWQgbGltVXBkYXRlQmVhY29uKHRwQW5pU2lyR2xvYmFsIHBNYWMpCit7CisgICAgdEFOSV9VOCBpOworICAgCisgICAgZm9yKGkgPTA7aSA8IHBNYWMtPmxpbS5tYXhCc3NJZDtpKyspCisgICAgeworICAgICAgICBpZihwTWFjLT5saW0uZ3BTZXNzaW9uW2ldLnZhbGlkID09IFRSVUUgKQorICAgICAgICB7CisgICAgICAgICAgICBpZiggKCAocE1hYy0+bGltLmdwU2Vzc2lvbltpXS5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQVBfUk9MRSkgfHwgCisgICAgICAgICAgICAgICAgKHBNYWMtPmxpbS5ncFNlc3Npb25baV0ubGltU3lzdGVtUm9sZSA9PSBlTElNX1NUQV9JTl9JQlNTX1JPTEUpICkKKyAgICAgICAgICAgICAgICAmJiAoZUxJTV9TTUVfTk9STUFMX1NUQVRFID09IHBNYWMtPmxpbS5ncFNlc3Npb25baV0ubGltU21lU3RhdGUpCisgICAgICAgICAgICAgICApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2NoU2V0Rml4ZWRCZWFjb25GaWVsZHMocE1hYywmcE1hYy0+bGltLmdwU2Vzc2lvbltpXSk7CisgICAgICAgICAgICAgICAgbGltU2VuZEJlYWNvbkluZChwTWFjLCAmcE1hYy0+bGltLmdwU2Vzc2lvbltpXSk7CisgICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKCAocE1hYy0+bGltLmdwU2Vzc2lvbltpXS5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQlRfQU1QX0FQX1JPTEUpfHwKKyAgICAgICAgICAgICAgICAgICAgKHBNYWMtPmxpbS5ncFNlc3Npb25baV0ubGltU3lzdGVtUm9sZSA9PSBlTElNX0JUX0FNUF9TVEFfUk9MRSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgaWYocE1hYy0+bGltLmdwU2Vzc2lvbltpXS5zdGF0eXBlRm9yQnNzID09IFNUQV9FTlRSWV9TRUxGKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY2hTZXRGaXhlZEJlYWNvbkZpZWxkcyhwTWFjLCZwTWFjLT5saW0uZ3BTZXNzaW9uW2ldKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0gICAKK30KKwordm9pZCBsaW1IYW5kbGVIZWFydEJlYXRGYWlsdXJlVGltZW91dCh0cEFuaVNpckdsb2JhbCBwTWFjKQoreworICAgIHRBTklfVTggaTsKKyAgICB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5OworICAgIC8qIFByb2JlIHJlc3BvbnNlIGlzIG5vdCByZWNlaXZlZCAgYWZ0ZXIgSEIgZmFpbHVyZS4gIFRoaXMgaXMgaGFuZGxlZCBieSBMTU0gc3ViIG1vZHVsZS4gKi8KKyAgICBmb3IoaSA9MDsgaSA8IHBNYWMtPmxpbS5tYXhCc3NJZDsgaSsrKQorICAgIHsKKyAgICAgICAgaWYocE1hYy0+bGltLmdwU2Vzc2lvbltpXS52YWxpZCA9PSBUUlVFKQorICAgICAgICB7CisgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5ID0gJnBNYWMtPmxpbS5ncFNlc3Npb25baV07CisgICAgICAgICAgICBpZihwc2Vzc2lvbkVudHJ5LT5MaW1IQkZhaWx1cmVTdGF0dXMgPT0gZUFOSV9CT09MRUFOX1RSVUUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICBGTCgiUHJvYmVfaGJfZmFpbHVyZTogU01FICVkLCBNTE1FICVkLCBIQi1Db3VudCAlZCBCQ04gY291bnQgJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlLCBwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPkxpbVJ4ZWRCZWFjb25DbnREdXJpbmdIQiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmN1cnJlbnRCc3NCZWFjb25DbnQpOworI2lmZGVmIEZFQVRVUkVfV0xBTl9ESUFHX1NVUFBPUlRfTElNIC8vRkVBVFVSRV9XTEFOX0RJQUdfU1VQUE9SVAorICAgICAgICAgICAgICAgIGxpbURpYWdFdmVudFJlcG9ydChwTWFjLCBXTEFOX1BFX0RJQUdfSEJfRkFJTFVSRV9USU1FT1VULCBwc2Vzc2lvbkVudHJ5LCAwLCAwKTsKKyNlbmRpZgorICAgICAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSA9PSBlTElNX01MTV9MSU5LX0VTVEFCTElTSEVEX1NUQVRFKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogRGlzY29ubmVjdCBldmVuIGlmIHdlIGhhdmUgbm90IHJlY2VpdmVkIGEgc2luZ2xlIGJlYWNvbgorICAgICAgICAgICAgICAgICAgICAgKiBhZnRlciBjb25uZWN0aW9uLgorICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKCgoIUxJTV9JU19DT05ORUNUSU9OX0FDVElWRShwc2Vzc2lvbkVudHJ5KSkgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAoMCA9PSBwc2Vzc2lvbkVudHJ5LT5jdXJyZW50QnNzQmVhY29uQ250KSkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIChwc2Vzc2lvbkVudHJ5LT5saW1TbWVTdGF0ZSAhPSBlTElNX1NNRV9XVF9ESVNBU1NPQ19TVEFURSkmJgorICAgICAgICAgICAgICAgICAgICAgICAgKHBzZXNzaW9uRW50cnktPmxpbVNtZVN0YXRlICE9IGVMSU1fU01FX1dUX0RFQVVUSF9TVEFURSkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiUHJvYmVfaGJfZmFpbHVyZTogZm9yIHNlc3Npb246JWQgIiApLHBzZXNzaW9uRW50cnktPnBlU2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIEFQIGRpZCBub3QgcmVzcG9uZCB0byBQcm9iZSBSZXF1ZXN0LiBUZWFyIGRvd24gbGluayB3aXRoIGl0LiovCisgICAgICAgICAgICAgICAgICAgICAgICBsaW1UZWFyRG93bkxpbmtXaXRoQXAocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5wZVNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX0JFQUNPTl9NSVNTRUQpOworICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+bGltLmdMaW1Qcm9iZUZhaWx1cmVBZnRlckhCZmFpbGVkQ250KysgOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgLy8gcmVzdGFydCBoZWFydGJlYXQgdGltZXIKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgbGltUmVhY3RpdmF0ZUhlYXJ0QmVhdFRpbWVyKHBNYWMsIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiVW5leHBlY3RlZCB3dC1wcm9iZS10aW1lb3V0IGluIHN0YXRlICIpKTsKKyAgICAgICAgICAgICAgICAgICAgbGltUHJpbnRNbG1TdGF0ZShwTWFjLCBMT0dFLCBwc2Vzc2lvbkVudHJ5LT5saW1NbG1TdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgIGxpbVJlYWN0aXZhdGVIZWFydEJlYXRUaW1lcihwTWFjLCBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICAvKiBEZWFjdGl2YXRlIFRpbWVyIFByb2JlQWZ0ZXJIQiBUaW1lciAtPiBBcyBpdHMgYSBvbmVzaG90IHRpbWVyLCBuZWVkIG5vdCBkZWFjdGl2YXRlIHRoZSB0aW1lciAqLworICAgIC8vIHR4X3RpbWVyX2RlYWN0aXZhdGUoJnBNYWMtPmxpbS5saW1UaW1lcnMuZ0xpbVByb2JlQWZ0ZXJIQlRpbWVyKTsKK30KKworCisvKgorKiBUaGlzIGZ1bmN0aW9uIGFzc3VtZXMgdG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bWFwQ2hhbm5lbCA8PSBhVW5zb3J0ZWRDaGFubmVsTGlzdFNpemUgKQorICAgICAgIGlmIChJU19ST0FNX1NDQU5fT0ZGTE9BRF9GRUFUVVJFX0VOQUJMRSkKKyAgICAgICAgICAgcmV0dXJuIGFVbnNvcnRlZENoYW5uZWxMaXN0W21hcENoYW5uZWwgLTFdOworICAgICAgIGVsc2UKKyNlbHNlCisgICBpZiggbWFwQ2hhbm5lbCA+IDAgJiYgbWFwQ2hhbm5lbCA8PSBhYkNoYW5uZWxTaXplICkKKyNlbmRpZgorICAgICByZXR1cm4gYWJDaGFubmVsW21hcENoYW5uZWwgLTFdOworICAgZWxzZQorICAgICByZXR1cm4gMDsKK30KKworCit2X1U4X3QqIGxpbUdldElFUHRyKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHZfVThfdCAqcEllcywgaW50IGxlbmd0aCwgdl9VOF90IGVpZCxlU2l6ZU9mTGVuRmllbGQgc2l6ZV9vZl9sZW5fZmllbGQpCit7CisgICAgaW50IGxlZnQgPSBsZW5ndGg7CisgICAgdl9VOF90ICpwdHIgPSBwSWVzOworICAgIHZfVThfdCBlbGVtX2lkOworICAgIHZfVTE2X3QgZWxlbV9sZW47CisgICAKKyAgICB3aGlsZShsZWZ0ID49IChzaXplX29mX2xlbl9maWVsZCsxKSkKKyAgICB7ICAgCisgICAgICAgIGVsZW1faWQgID0gIHB0clswXTsKKyAgICAgICAgaWYgKHNpemVfb2ZfbGVuX2ZpZWxkID09IFRXT19CWVRFKQorICAgICAgICB7CisgICAgICAgICAgICBlbGVtX2xlbiA9ICgodl9VMTZfdCkgcHRyWzFdKSB8IChwdHJbMl08PDgpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgZWxlbV9sZW4gPSAgcHRyWzFdOworICAgICAgICB9CisgICAgCisgICAgICAgICAgICAKKyAgICAgICAgbGVmdCAtPSAoc2l6ZV9vZl9sZW5fZmllbGQrMSk7CisgICAgICAgIGlmKGVsZW1fbGVuID4gbGVmdCkKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgIEZMKCIqKioqSW52YWxpZCBJRXMgZWlkID0gJWQgZWxlbV9sZW49JWQgbGVmdD0lZCoqKioqIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWlkLGVsZW1fbGVuLGxlZnQpOworICAgICAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGVsZW1faWQgPT0gZWlkKSAKKyAgICAgICAgeworICAgICAgICAgICAgcmV0dXJuIHB0cjsKKyAgICAgICAgfQorICAgCisgICAgICAgIGxlZnQgLT0gZWxlbV9sZW47CisgICAgICAgIHB0ciArPSAoZWxlbV9sZW4gKyAoc2l6ZV9vZl9sZW5fZmllbGQrMSkpOworICAgIH0KKyAgICByZXR1cm4gTlVMTDsKK30KKworLyogcmV0dXJuIE5VTEwgaWYgb3VpIGlzIG5vdCBmb3VuZCBpbiBpZQorICAgcmV0dXJuICFOVUxMIHBvaW50ZXIgdG8gdmVuZG9yIElFIChzdGFydGluZyBmcm9tIDB4REQpIGlmIG91aSBpcyBmb3VuZCAKKyAqLwordl9VOF90KiBsaW1HZXRWZW5kb3JJRU91aVB0cih0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4ICpvdWksIHRBTklfVTggb3VpX3NpemUsIHRBTklfVTggKmllLCB0QU5JX1UxNiBpZV9sZW4pCit7ICAgCisgICAgaW50IGxlZnQgPSBpZV9sZW47CisgICAgdl9VOF90ICpwdHIgPSBpZTsKKyAgICB2X1U4X3QgZWxlbV9pZCwgZWxlbV9sZW47CisKKyAgICB3aGlsZShsZWZ0ID49IDIpCisgICAgeworICAgICAgICBlbGVtX2lkICA9IHB0clswXTsKKyAgICAgICAgZWxlbV9sZW4gPSBwdHJbMV07CisgICAgICAgIGxlZnQgLT0gMjsKKyAgICAgICAgaWYoZWxlbV9sZW4gPiBsZWZ0KQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIAorICAgICAgICAgICAgICAgRkwoIioqKipJbnZhbGlkIElFcyBlaWQgPSAlZCBlbGVtX2xlbj0lZCBsZWZ0PSVkKioqKioiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbV9pZCxlbGVtX2xlbixsZWZ0KTsKKyAgICAgICAgICAgIHJldHVybiBOVUxMOworICAgICAgICB9CisgICAgICAgIGlmIChTSVJfTUFDX0VJRF9WRU5ET1IgPT0gZWxlbV9pZCkgCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKG1lbWNtcCgmcHRyWzJdLCBvdWksIG91aV9zaXplKT09MCkKKyAgICAgICAgICAgICAgICByZXR1cm4gcHRyOworICAgICAgICB9CisgCisgICAgICAgIGxlZnQgLT0gZWxlbV9sZW47CisgICAgICAgIHB0ciArPSAoZWxlbV9sZW4gKyAyKTsKKyAgICB9CisgICAgcmV0dXJuIE5VTEw7Cit9CisKKy8vUmV0dXJucyBsZW5ndGggb2YgUDJQIHN0cmVhbSBhbmQgUG9pbnRlciBpZSBwYXNzZWQgdG8gdGhpcyBmdW5jdGlvbiBpcyBmaWxsZWQgd2l0aCBub2Egc3RyZWFtCisKK3ZfVThfdCBsaW1CdWlsZFAycEllKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggKmllLCB0QU5JX1U4ICpkYXRhLCB0QU5JX1U4IGllX2xlbikKK3sKKyAgICBpbnQgbGVuZ3RoID0gMDsKKyAgICB0QU5JX1U4ICpwdHIgPSBpZTsgCisKKyAgICBwdHJbbGVuZ3RoKytdID0gU0lSX01BQ19FSURfVkVORE9SOworICAgIHB0cltsZW5ndGgrK10gPSBpZV9sZW4gKyBTSVJfTUFDX1AyUF9PVUlfU0laRTsKKyAgICB2b3NfbWVtX2NvcHkoJnB0cltsZW5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JEdXJhdGlvbikpCisgICAgICAgICAgICAmJiAoIXBzZXNzaW9uRW50cnktPnAycEdvUHNVcGRhdGUub3BwUHNGbGFnKQorICAgICAgICAgICkKKyAgICAgICAgIHJldHVybiAwOyAvL05vIE5vQSBEZXNjcmlwdG9yIHRoZW4gcmV0dXJuIDAKKworCisgICAgICAgIHBCb2R5WzBdID0gU0lSX1AyUF9OT0FfQVRUUjsKKyAgICAgICAgCisgICAgICAgIHBCb2R5WzNdID0gcHNlc3Npb25FbnRyeS0+cDJwR29Qc1VwZGF0ZS5pbmRleDsKKyAgICAgICAgcEJvZHlbNF0gPSBwc2Vzc2lvbkVudHJ5LT5wMnBHb1BzVXBkYXRlLmN0V2luIHwgKHBzZXNzaW9uRW50cnktPnAycEdvUHNVcGRhdGUub3BwUHNGbGFnPDw3KTsKKyAgICAgICAgbGVuID0gNTsKKyAgICAgICAgcEJvZHkgKz0gbGVuOworICAgICAgICAKKyAgICAgICAgCisgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5wMnBHb1BzVXBkYXRlLnVOb2ExRHVyYXRpb24pCisgICAgICAgIHsKKyAgICAgICAgICAgICpwQm9keSA9IHBzZXNzaW9uRW50cnktPnAycEdvUHNVcGRhdGUudU5vYTFJbnRlcnZhbENudDsgCisgICAgICAgICAgICBwQm9keSArPSAxOworICAgICAgICAgICAgbGVuICs9MTsKKyAgICAgICAgICAgICAKKyAgICAgICAgICAgICooKHRBTklfVTMyICopKHBCb2R5KSkgPSBzaXJTd2FwVTMyaWZOZWVkZWQocHNlc3Npb25FbnRyeS0+cDJwR29Qc1VwZGF0ZS51Tm9hMUR1cmF0aW9uKTsKKyAgICAgICAgICAgIHBCb2R5ICAgKz0gc2l6ZW9mKHRBTklfVTMyKTsgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIGxlbiArPTQ7CisgICAgICAgICAgICAKKyAgICAgICAgICAgICooKHRBTklfVTMyICopKHBCb2R5KSkgPSBzaXJTd2FwVTMyaWZOZWVkZWQocHNlc3Npb25FbnRyeS0+cDJwR29Qc1VwZGF0ZS51Tm9hMUludGVydmFsKTsKKyAgICAgICAgICAgIHBCb2R5ICAgKz0gc2l6ZW9mKHRBTklfVTMyKTsgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIGxlbiArPTQ7CisgICAgICAgICAgICAKKyAgICAgICAgICAgICooKHRBTklfVTMyICopKHBCb2R5KSkgPSBzaXJTd2FwVTMyaWZOZWVkZWQocHNlc3Npb25FbnRyeS0+cDJwR29Qc1VwZGF0ZS51Tm9hMVN0YXJ0VGltZSk7CisgICAgICAgICAgICBwQm9keSAgICs9IHNpemVvZih0QU5JX1UzMik7ICAgICAgICAgICAgICAgCisgICAgICAgICAgICBsZW4gKz00OworICAgICAgICAgICAgCisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5wMnBHb1BzVXBkYXRlLnVOb2EyRHVyYXRpb24pCisgICAgICAgIHsKKyAgICAgICAgICAgICpwQm9keSA9IHBzZXNzaW9uRW50cnktPnAycEdvUHNVcGRhdGUudU5vYTJJbnRlcnZhbENudDsgCisgICAgICAgICAgICBwQm9keSArPSAxOworICAgICAgICAgICAgbGVuICs9MTsKKyAgICAgICAgICAgICAKKyAgICAgICAgICAgICooKHRBTklfVTMyICopKHBCb2R5KSkgPSBzaXJTd2FwVTMyaWZOZWVkZWQocHNlc3Npb25FbnRyeS0+cDJwR29Qc1VwZGF0ZS51Tm9hMkR1cmF0aW9uKTsKKyAgICAgICAgICAgIHBCb2R5ICAgKz0gc2l6ZW9mKHRBTklfVTMyKTsgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIGxlbiArPTQ7CisgICAgICAgICAgICAKKyAgICAgICAgICAgICooKHRBTklfVTMyICopKHBCb2R5KSkgPSBzaXJTd2FwVTMyaWZOZWVkZWQocHNlc3Npb25FbnRyeS0+cDJwR29Qc1VwZGF0ZS51Tm9hMkludGVydmFsKTsKKyAgICAgICAgICAgIHBCb2R5ICAgKz0gc2l6ZW9mKHRBTklfVTMyKTsgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIGxlbiArPTQ7CisgICAgICAgICAgICAKKyAgICAgICAgICAgICooKHRBTklfVTMyICopKHBCb2R5KSkgPSBzaXJTd2FwVTMyaWZOZWVkZWQocHNlc3Npb25FbnRyeS0+cDJwR29Qc1VwZGF0ZS51Tm9hMlN0YXJ0VGltZSk7CisgICAgICAgICAgICBwQm9keSAgICs9IHNpemVvZih0QU5JX1UzMik7ICAgICAgICAgICAgICAgCisgICAgICAgICAgICBsZW4gKz00OworCisgICAgICAgIH0KKyAgICAKKworICAgICAgICBwQm9keSA9IHBOb2FTdHJlYW0gKyAxOyAgICAgICAgICAgIAorICAgICAgICAqKCh0QU5JX1UxNiAqKShwQm9keSkpID0gc2lyU3dhcFUxNmlmTmVlZGVkKGxlbi0zKTsvKm9uZSBieXRlIGZvciBBdHRyIGFuZCAyIGJ5dGVzIGZvciBsZW5ndGgqLworCisgICAgICAgIHJldHVybiAobGVuKTsKKworICAgIH0gICAgCisgICAgcmV0dXJuIDA7CisgICAgICAgIAorfQorCit2b2lkIHBlU2V0UmVzdW1lQ2hhbm5lbCh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UxNiBjaGFubmVsLCBlUGh5Q2hhbkJvbmRTdGF0ZSBwaHlDYlN0YXRlKQoreworCisgICBwTWFjLT5saW0uZ1Jlc3VtZUNoYW5uZWwgPSBjaGFubmVsOworICAgcE1hYy0+bGltLmdSZXN1bWVQaHlDYlN0YXRlID0gcGh5Q2JTdGF0ZTsKK30KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAKKyAgXGJyaWVmIHBlR2V0UmVzdW1lQ2hhbm5lbCgpIC0gUmV0dXJucyB0aGUgIGNoYW5uZWwgbnVtYmVyIGZvciBzY2FubmluZywgZ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KyAgICAgICAgICAgICAgICByZXR1cm4gVFJVRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gRkFMU0U7Cit9CisKKwordEFOSV9CT09MRUFOIGxpbUlzY29ubmVjdGVkT25ERlNDaGFubmVsKHRBTklfVTggY3VycmVudENoYW5uZWwpCit7CisgICAgaWYoTlZfQ0hBTk5FTF9ERlMgPT0gdm9zX252X2dldENoYW5uZWxFbmFibGVkU3RhdGUoY3VycmVudENoYW5uZWwpKQorICAgIHsKKyAgICAgICAgcmV0dXJuIGVBTklfQk9PTEVBTl9UUlVFOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICByZXR1cm4gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgIH0KK30KKworLyoqCisgKiBcYnJpZWYgdmVyaWZ5IHRoZSBjaGFuZ2VzIGluIGNoYW5uZWwgYm9uZGluZworICoKKyAqIFxwYXJhbSBwTWFjIFBvaW50ZXIgdG8gdGhlIGdsb2JhbCBNQUMgc3RydWN0dXJlCisgKgorICogXHBhcmFtIHBzZXNzaW9uRW50cnkgc2Vzc2lvbiBlbnRyeQorICogICAgICAgICAgIGJlYWNvblNlY0NoYW5XaWR0aCAgICBTZWNvbmRhcnkgY2hhbm5lbCB3aWR0aAorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZHZlcnRpemVkIGluIGJlYWNvbgorICogICAgICAgICAgY3VycmVudFNlY0NoYW5XaWR0aCAgICAgQ3VycmVudCBjb25maWd1cmVkIHdpZHRoCisgKiAgICAgICAgICBzdGFJZCAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdGF0aW9uIElkCisgKiBccmV0dXJuIGVTSVJfU1VDQ0VTUyBvbiBzdWNjZXNzLCBlU0lSX0ZBSUxVUkUgZWxzZQorICovCit0QU5JX0JPT0xFQU4gbGltQ2hlY2tIVENoYW5Cb25kTW9kZUNoYW5nZSh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGJlYWNvblNlY0NoYW5XaWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBjdXJyZW50U2VjQ2hhbldpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IHN0YUlkKQoreworICAgIHRVcGRhdGVWSFRPcE1vZGUgdGVtcFBhcmFtOworICAgIHRBTklfQk9PTEVBTiBmQ2JNb2RlMjRHID0gRkFMU0U7CisgICAgdEFOSV9CT09MRUFOIHN0YXR1cyA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKworICAgICAvKiBNb3ZpbmcgZnJvbSBIVDQwIHRvIEhUMjAgb3BlcmF0aW9uKi8KKyAgICBpZiAoKChQSFlfRE9VQkxFX0NIQU5ORUxfTE9XX1BSSU1BUlkgPT0gY3VycmVudFNlY0NoYW5XaWR0aCkgfHwKKyAgICAgIChQSFlfRE9VQkxFX0NIQU5ORUxfSElHSF9QUklNQVJZID09IGN1cnJlbnRTZWNDaGFuV2lkdGgpKQorICAgICAgJiYgKFBIWV9TSU5HTEVfQ0hBTk5FTF9DRU5URVJFRCA9PSBiZWFjb25TZWNDaGFuV2lkdGgpKQorICAgIHsKKyAgICAgICB0ZW1wUGFyYW0ub3BNb2RlID0gZUhUX0NIQU5ORUxfV0lEVEhfMjBNSFo7CisgICAgICAgdGVtcFBhcmFtLnN0YUlkICA9IHN0YUlkOworICAgICAgIGZDYk1vZGUyNEcgPSBUUlVFOworICAgIH0KKworICAgICAvKiBNb3ZpbmcgZnJvbSBIVDIwIHRvIEhUNDAgb3BlcmF0aW9uKi8KKyAgICBpZiA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YUlkKQoreworICAgIHRVcGRhdGVWSFRPcE1vZGUgdGVtcFBhcmFtOworICAgIAorICAgIHRlbXBQYXJhbS5vcE1vZGUgPSBjaGFuV2lkdGg7CisgICAgdGVtcFBhcmFtLnN0YUlkICA9IHN0YUlkOworCisgICAgbGltU2VuZE1vZGVVcGRhdGUoIHBNYWMsICZ0ZW1wUGFyYW0sIHBzZXNzaW9uRW50cnkgKTsKKworICAgIHJldHVybiBlQU5JX0JPT0xFQU5fVFJVRTsKK30KKyNlbmRpZgorCit2b2lkIGxpbUdldFNob3J0U2xvdEZyb21QaHlNb2RlKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIHBoeU1vZGUsIHRBTklfVTggKnBTaG9ydFNsb3RFbmFibGVkKQoreworICAgIHRBTklfVTggdmFsPTA7CisKKyAgICAvL29ubHkgMi40RyBiYW5kIHNob3VsZCBoYXZlIHNob3J0IHNsb3QgZW5hYmxlLCByZXN0IGl0IHNob3VsZCBiZSBkZWZhdWx0CisgICAgaWYgKHBoeU1vZGUgPT0gV05JX0NGR19QSFlfTU9ERV8xMUcpCisgICAgeworICAgICAgICAvKiBzaG9ydCBzbG90IGlzIGRlZmF1bHQgaW4gYWxsIG90aGVyIG1vZGVzICovCisgICAgICAgIGlmICgocHNlc3Npb25FbnRyeS0+cGVQZXJzb25hID09IFZPU19TVEFfU0FQX01PREUpIHx8CisgICAgICAgICAgICAocHNlc3Npb25FbnRyeS0+cGVQZXJzb25hID09IFZPU19JQlNTX01PREUpIHx8CisgICAgICAgICAgICAocHNlc3Npb25FbnRyeS0+cGVQZXJzb25hID09IFZPU19QMlBfR09fTU9ERSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHZhbCA9IHRydWU7CisgICAgICAgIH0KKyAgICAgICAgLy8gUHJvZ3JhbSBQb2xhcmlzIGJhc2VkIG9uIEFQIGNhcGFiaWxpdHkKKyAgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlID09IGVMSU1fTUxNX1dUX0pPSU5fQkVBQ09OX1NUQVRFKQorICAgICAgICB7CisgICAgICAgICAgICAvLyBKb2luaW5nIEJTUy4KKyAgICAgICAgICAgIHZhbCA9IFNJUl9NQUNfR0VUX1NIT1JUX1NMT1RfVElNRSggcHNlc3Npb25FbnRyeS0+bGltQ3VycmVudEJzc0NhcHMpOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHBzZXNzaW9uRW50cnktPmxpbU1sbVN0YXRlID09IGVMSU1fTUxNX1dUX1JFQVNTT0NfUlNQX1NUQVRFKQorICAgICAgICB7CisgICAgICAgICAgICAvLyBSZWFzc29jaWF0aW5nIHdpdGggQVAuCisgICAgICAgICAgICB2YWwgPSBTSVJfTUFDX0dFVF9TSE9SVF9TTE9UX1RJTUUoIHBzZXNzaW9uRW50cnktPmxpbVJlYXNzb2NCc3NDYXBzKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAvKgorICAgICAgICAgKiAxMUIgZG9lcyBub3Qgc2hvcnQgc2xvdCBhbmQgc2hvcnQgc2xvdCBpcyBkZWZhdWx0CisgICAgICAgICAqIGZvciAxMUEgbW9kZS4gSGVuY2UsIG5vdCBuZWVkIHRvIHNldCB0aGlzIGJpdAorICAgICAgICAgKi8KKyAgICAgICAgdmFsID0gZmFsc2U7CisgICAgfQorCisgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJwaHlNb2RlID0gJXUgc2hvcnRzbG90c3VwcG9ydGVkID0gJXUiKSwgcGh5TW9kZSwgdmFsKTsKKyAgICAqcFNob3J0U2xvdEVuYWJsZWQgPSB2YWw7Cit9CisKK3ZvaWQgbGltVXRpbHNmcmFtZXNodG9ucyh0cEFuaVNpckdsb2JhbCAgICBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggICpwT3V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTE2ICBwSW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAgZk1zYikKK3sKKyAgICAodm9pZClwQ3R4OworI2lmIGRlZmluZWQgKCBET1QxMUZfTElUVExFX0VORElBTl9IT1NUICkKKyAgICBpZiAoICFmTXNiICkKKyAgICB7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcE91dCwgJnBJbiwgMik7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgICpwT3V0ICAgICAgICAgPSAoIHBJbiAmIDB4ZmYwMCApID4+IDg7CisgICAgICAgICooIHBPdXQgKyAxICkgPSBwSW4gJiAweGZmOworICAgIH0KKyNlbHNlCisgICAgaWYgKCAhZk1zYiApCisgICAgeworICAgICAgICAqcE91dCAgICAgICAgID0gcEluICYgMHhmZjsKKyAgICAgICAgKiggcE91dCArIDEgKSA9ICggcEluICYgMHhmZjAwICkgPj4gODsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwT3V0LCAmcEluLCAyKTsKKyAgICB9CisjZW5kaWYKK30KKwordm9pZCBsaW1VdGlsc2ZyYW1lc2h0b25sKHRwQW5pU2lyR2xvYmFsICAgIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICAqcE91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICBwSW4sCisgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICBmTXNiKQoreworICAgICh2b2lkKXBDdHg7CisjaWYgZGVmaW5lZCAoIERPVDExRl9MSVRUTEVfRU5ESUFOX0hPU1QgKQorICAgIGlmICggIWZNc2IgKQorICAgIHsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwT3V0LCAmcEluLCA0KTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgKnBPdXQgICAgICAgICA9ICggcEluICYgMHhmZjAwMDAwMCApID4+IDI0OworICAgICAgICAqKCBwT3V0ICsgMSApID0gKCBwSW4gJiAweDAwZmYwMDAwICkgPj4gMTY7CisgICAgICAgICooIHBPdXQgKyAyICkgPSAoIHBJbiAmIDB4MDAwMGZmMDAgKSA+PiAgODsKKyAgICAgICAgKiggcE91dCArIDMgKSA9ICggcEluICYgMHgwMDAwMDBmZiApOworICAgIH0KKyNlbHNlCisgICAgaWYgKCAhZk1zYiApCisgICAgeworICAgICAgICAqKCBwT3V0ICAgICApID0gKCBwSW4gJiAweDAwMDAwMGZmICk7CisgICAgICAgICooIHBPdXQgKyAxICkgPSAoIHBJbiAmIDB4MDAwMGZmMDAgKSA+PiAgODsKKyAgICAgICAgKiggcE91dCArIDIgKSA9ICggcEluICYgMHgwMGZmMDAwMCApID4+IDE2OworICAgICAgICAqKCBwT3V0ICsgMyApID0gKCBwSW4gJiAweGZmMDAwMDAwICkgPj4gMjQ7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcE91dCwgJnBJbiwgNCk7CisgICAgfQorI2VuZGlmCit9CisKKworLyoqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KK1xmbiAgICAgICBsaW1VcGRhdGVPQlNTU2NhblBhcmFtcworXGJyaWVmICAgIFVwZGF0ZXMgT0JTUyBTQ0FOIElFIHBhcmFtZXRlcnMgdG8gc2Vzc2lvbgorCitccGFyYW0gcHNlc3Npb25FbnRyeSAgLSBTZXNzaW9uIEVudHJ5CitccmV0dXJuIE5PTkUKKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCit2b2lkIGxpbVVwZGF0ZU9CU1NTY2FuUGFyYW1zKHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkgLAorICAgICAgICAgICAgIHREb3QxMWZJ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uIHBzZXNzaW9uRW50cnk7CisgICAgdHBEcGhIYXNoTm9kZSBwU3RhOworICAgIHRBTklfVTMyIG1heFJldHJpZXM7CisKKyAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIlNBIFF1ZXJ5IHRpbWVyIGZpcmVzIikpOworICAgIHRpbWVySWQudmFsdWUgPSBwYXJhbTsKKworICAgIC8vIENoZWNrIHRoYXQgU0EgUXVlcnkgaXMgaW4gcHJvZ3Jlc3MKKyAgICBpZiAoKHBzZXNzaW9uRW50cnkgPSBwZUZpbmRTZXNzaW9uQnlTZXNzaW9uSWQoCisgICAgICAgIHBNYWMsIHRpbWVySWQuZmllbGRzLnNlc3Npb25JZCkpID09IE5VTEwpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlNlc3Npb24gZG9lcyBub3QgZXhpc3QgZm9yIGdpdmVuIHNlc3Npb24gSUQgJWQiKSwKKyAgICAgICAgICAgICAgIHRpbWVySWQuZmllbGRzLnNlc3Npb25JZCk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgaWYgKChwU3RhID0gZHBoR2V0SGFzaEVudHJ5KHBNYWMsIHRpbWVySWQuZmllbGRzLnBlZXJJZHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwc2Vzc2lvbkVudHJ5LT5kcGguZHBoSGFzaFRhYmxlKSkgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiRW50cnkgZG9lcyBub3QgZXhpc3QgZm9yIGdpdmVuIHBlZXIgaW5kZXggJWQiKSwKKyAgICAgICAgICAgICAgIHRpbWVySWQuZmllbGRzLnBlZXJJZHgpOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIGlmIChEUEhfU0FfUVVFUllfSU5fUFJPR1JFU1MgIT0gcFN0YS0+cG1mU2FRdWVyeVN0YXRlKQorICAgICAgICByZXR1cm47CisKKyAgICAvLyBJbmNyZW1lbnQgdGhlIHJldHJ5IGNvdW50LCBjaGVjayBpZiByZWFjaGVkIG1heGltdW0KKyAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19QTUZfU0FfUVVFUllfTUFYX1JFVFJJRVMsCisgICAgICAgICAgICAgICAgICAgICAgICZtYXhSZXRyaWVzKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkNvdWxkIG5vdCByZXRyaWV2ZSBQTUYgU0EgUXVlcnkgbWF4aW11bSByZXRyaWVzIHZhbHVlIikpOworICAgICAgICBwU3RhLT5wbWZTYVF1ZXJ5U3RhdGUgPSBEUEhfU0FfUVVFUllfTk9UX0lOX1BST0dSRVNTOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIHBTdGEtPnBtZlNhUXVlcnlSZXRyeUNvdW50Kys7CisgICAgaWYgKHBTdGEtPnBtZlNhUXVlcnlSZXRyeUNvdW50ID49IG1heFJldHJpZXMpCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgRkwoIlNBIFF1ZXJ5IHRpbWVkIG91dCxEZWxldGluZyBTVEE6ICIgTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwU3RhLT5zdGFBZGRyKSk7CisgICAgICAgIGxpbVNlbmREaXNhc3NvY01nbXRGcmFtZShwTWFjLAorICAgICAgICAgICAgICAgICAgZVNJUl9NQUNfRElTQVNTT0NfRFVFX1RPX0lOQUNUSVZJVFlfUkVBU09OLAorICAgICAgICAgICAgICAgICAgcFN0YS0+c3RhQWRkciwgcHNlc3Npb25FbnRyeSwgRkFMU0UpOworICAgICAgICBsaW1UcmlnZ2VyU1RBZGVsZXRpb24ocE1hYywgcFN0YSwgcHNlc3Npb25FbnRyeSk7CisgICAgICAgIHBTdGEtPnBtZlNhUXVlcnlTdGF0ZSA9I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yAgICB7CisgICAgICAgIGNhc2UgZUxJTV9DSEFOTkVMX1NXSVRDSF9QUklNQVJZX09OTFk6CisgICAgICAgICAgICBQRUxPR1cobGltTG9nKHBNYWMsIExPR1csCisgICAgICAgICAgICAgICAgRkwoIkNIQU5ORUxfU1dJVENIX1BSSU1BUllfT05MWSAiKSk7KQorICAgICAgICAgICAgbGltU3dpdGNoUHJpbWFyeUNoYW5uZWwocE1hYywKKyAgICAgICAgICAgICAgICBwU2Vzc2lvbkVudHJ5LT5nTGltQ2hhbm5lbFN3aXRjaC5wcmltYXJ5Q2hhbm5lbCwKKyAgICAgICAgICAgICAgICBwU2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgIHBTZXNzaW9uRW50cnktPmdMaW1DaGFubmVsU3dpdGNoLnN0YXRlID0KKyAgICAgICAgICAgICAgICBlTElNX0NIQU5ORUxfU1dJVENIX0lETEU7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVMSU1fQ0hBTk5FTF9TV0lUQ0hfUFJJTUFSWV9BTkRfU0VDT05EQVJZOgorICAgICAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICAgICAgIEZMKCJDSEFOTkVMX1NXSVRDSF9QUklNQVJZX0FORF9TRUNPTkRBUlkiKSk7KQorICAgICAgICAgICAgbGltU3dpdGNoUHJpbWFyeVNlY29uZGFyeUNoYW5uZWwocE1hYywgcFNlc3Npb25FbnRyeSwKKyAgICAgICAgICAgICAgICAgcFNlc3Npb25FbnRyeS0+Z0xpbUNoYW5uZWxTd2l0Y2gucHJpbWFyeUNoYW5uZWwsCisgICAgICAgICAgICAgICAgIHBTZXNzaW9uRW50cnktPmdMaW1DaGFubmVsU3dpdGNoLnNlY29uZGFyeVN1YkJhbmQpOworICAgICAgICAgICAgcFNlc3Npb25FbnRyeS0+Z0xpbUNoYW5uZWxTd2l0Y2guc3RhdGUgPQorICAgICAgICAgICAgICAgIGVMSU1fQ0hBTk5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Q0ZHX09CU1NfSFQ0MF9TQ0FOX1dJRFRIX1RSSUdHRVJfSU5URVJWQUwsCisgICAgICAgICAgICAgICAgICAgICAgICZjZmdWYWx1ZSkgIT0gZVNJUl9TVUNDRVNTKQorICAgIHsKKyAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkZhaWwgdG8gcmV0cmlldmUgIgorICAgICAgICAgICAgICJXTklfQ0ZHX09CU1NfSFQ0MF9TQ0FOX1dJRFRIX1RSSUdHRVJfSU5URVJWQUwgdmFsdWUiKSk7CisgICAgICAgcmV0dXJuIDsKKyAgICB9CisgICAgcHNlc3Npb25FbnRyeS0+b2Jzc0hUNDBTY2FuUGFyYW0uQlNTQ2hhbm5lbFdpZHRoVHJpZ2dlclNjYW5JbnRlcnZhbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IGNmZ1ZhbHVlOworICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLAorICAgICAgICAgIFdOSV9DRkdfT0JTU19IVDQwX1NDQU5fQUNUSVZFX1RPVEFMX1BFUl9DSEFOTkVMLAorICAgICAgICAgICZjZmdWYWx1ZSkgIT0gZVNJUl9TVUNDRVNTKQorICAgIHsKKyAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkZhaWwgdG8gcmV0cmlldmUiCisgICAgICAgICAgICAgIldOSV9DRkdfT0JTU19IVDQwX1NDQU5fQUNUSVZFX1RPVEFMX1BFUl9DSEFOTkVMIHZhbHVlIikpOworICAgICAgIHJldHVybiA7CisgICAgfQorICAgIHBzZXNzaW9uRW50cnktPm9ic3NIVDQwU2NhblBhcmFtLk9CU1NTY2FuQWN0aXZlVG90YWxQZXJDaGFubmVsID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZmdWYWx1ZTsKKyAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywKKyAgICAgICAgIFdOSV9DRkdfT0JTU19IVDQwX1NDQU5fUEFTU0lWRV9UT1RBTF9QRVJfQ0hBTk5FTCwgJmNmZ1ZhbHVlKQorICAgICAgICAgIT0gZVNJUl9TVUNDRVNTKQorICAgIHsKKyAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkZhaWwgdG8gcmV0cmlldmUiCisgICAgICAgICAgICAgICJXTklfQ0ZHX09CU1NfSFQ0MF9TQ0FOX1BBU1NJVkVfVE9UQUxfUEVSX0NIQU5ORUwgdmFsdWUiKSk7CisgICAgICAgcmV0dXJuIDsKKyAgICB9CisgICAgcHNlc3Npb25FbnRyeS0+b2Jzc0hUNDBTY2FuUGFyYW0uT0JTU1NjYW5QYXNzaXZlVG90YWxQZXJDaGFubmVsID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZmdWYWx1ZTsKKworICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLAorICAgICAgICAgV05JX0NGR19PQlNTX0hUNDBfV0lEVEhfQ0hBTk5FTF9UUkFOU0lUSU9OX0RFTEFZX0ZBQ1RPUiwgJmNmZ1ZhbHVlKQorICAgICAgICAgIT0gZVNJUl9TVUNDRVNTKQorICAgIHsKKyAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkZhaWwgdG8gcmV0cmlldmUiCisgICAgICAgICAgICAgICJXTklfQ0ZHX09CU1NfSFQ0MF9XSURUSF9DSEFOTkVMX1RSQU5TSVRJT05fREVMQVlfRkFDVE9SIHZhbHVlIikpOworICAgICAgIHJldHVybiA7CisgICAgfQorICAgIHBzZXNzaW9uRW50cnktPm9ic3NIVDQwU2NhblBhcmFtLkJTU1dpZHRoQ2hhbm5lbFRyYW5zaXRpb25EZWxheUZhY3RvciA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2ZnVmFsdWU7CisKK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uYWJsZWQgd2lsbCBiZSBzZXQgYXQgdGhlIHRpbWUgb2YgYWRkYnNzLgorICAgICAgICAgICAgICogYnV0IHNvbWV0aW1lcyBFQVAgYXV0aCBmYWlscyBhbmQga2V5cyBhcmUgbm90CisgICAgICAgICAgICAgKiBpbnN0YWxsZWQgdGhlbiBpZiB3ZSBzZW5kIGFueSBtYW5hZ2VtZW50IGZyYW1lCisgICAgICAgICAgICAgKiBsaWtlIGRlYXV0aC9kaXNhc3NvYyB3aXRoIHRoaXMgYml0IHNldCB0aGVuCisgICAgICAgICAgICAgKiBmaXJtd2FyZSBjcmFzaGVzLiBzbyBjaGVjayBmb3Iga2V5cyBhcmUKKyAgICAgICAgICAgICAqIGluc3RhbGxlZCBvciBub3QgYWxzbyBiZWZvcmUgc2V0dGluZyB0aGUgYml0CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmIChwU3RhRHMtPnJtZkVuYWJsZWQgJiYgcFN0YURzLT5pc0tleUluc3RhbGxlZCkKKyAgICAgICAgICAgICAgICBwTWFjSGRyLT5mYy53ZXAgPSAxOworICAgIH0KKyAgICBlbHNlIGlmICggcHNlc3Npb25FbnRyeS0+bGltUm1mRW5hYmxlZCAmJiBwc2Vzc2lvbkVudHJ5LT5pc0tleUluc3RhbGxlZCkKKyAgICAgICAgcE1hY0hkci0+ZmMud2VwID0gMTsKK30gLyoqKiBlbmQgbGltU2V0UHJvdGVjdGVkQml0KCkgKioqLworI2VuZGlmCisKK3RBTklfVTgqIGxpbUdldEllUHRyKHZfVThfdCAqcEllcywgaW50IGxlbmd0aCwgdl9VOF90IGVpZCkKK3sKKyAgICBpbnQgbGVmdCA9IGxlbmd0aDsKKyAgICB0QU5JX1U4ICpwdHIgPSBwSWVzOworICAgIHRBTklfVTggZWxlbV9pZCxlbGVtX2xlbjsKKworICAgIHdoaWxlIChsZWZ0ID49IDIpCisgICAgeworICAgICAgIGVsZW1faWQgID0gIHB0clswXTsKKyAgICAgICBlbGVtX2xlbiA9ICBwdHJbMV07CisgICAgICAgbGVmdCAtPSAyOworCisgICAgICAgaWYgKGVsZW1fbGVuID4gbGVmdCkKKyAgICAgICB7CisgICAgICAgICAgIFZPU19UUkFDRSAoVk9TX01PRFVMRV9JRF9QRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgRkwoIioqKipJbnZhbGlkIElFcyBlaWQgPSAlZCBlbGVtX2xlbj0lZCBsZWZ0PSVkXG4qKioqKiIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWlkLGVsZW1fbGVuLGxlZnQpOworICAgICAgICAgICByZXR1cm4gTlVMTDsKKyAgICAgICB9CisgICAgICAgaWYgKGVsZW1faWQgPT0gZWlkKQorICAgICAgIHsKKyAgICAgICAgICAgcmV0dXJuIHB0cjsKKyAgICAgICB9CisKKyAgICAgICBsZWZ0IC09IGVsZW1fbGVuOworICAgICAgIHB0ciArPSAoZWxlbV9sZW4gKyAyKTsKKyAgICB9CisgICAgcmV0dXJuIE5VTEw7Cit9CisKKwordm9pZCBsaW1QYXJzZUJlYWNvbkZvclRpbSh0cEFuaVNpckdsb2JhbCBwTWFjLHRBTklfVTgqIHBSeFBhY2tldEluZm8sIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpCit7CisKKyAgICB0QU5JX1UzMiAgICAgICAgblBheWxvYWQ7CisgICAgdEFOSV9VOCAgICAgICAgKnBQYXlsb2FkOworICAgIHRBTklfVTggICAgICAgICppZXB0cjsKKyAgICB0U2lyTWFjVGltICAgICAqdGltOworCisgICAgcFBheWxvYWQgPSBXREFfR0VUX1JYX01QRFVfREFUQSggcFJ4UGFja2V0SW5mbyApOworICAgIG5QYXlsb2FkID0gV0RBX0dFVF9SWF9QQVlMT0FEX0xFTiggcFJ4UGFja2V0SW5mbyApOworCisgICAgaWYgKG5QYXlsb2FkIDwgKFNJUl9NQUNfQl9QUl9TU0lEX09GRlNFVCArIFNJUl9NQUNfTUlOX0lFX0xFTikpCisgICAgeworICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiQmVhY29uIGxlbmd0aCB0b28gc2hvcnQgdG8gcGFyc2UiKSk7CisgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmIChOVUxMICE9CisgICAgICAgKGllcHRyID0gbGltR2V0SWVQdHIoKHBQYXlsb2FkICsgU0lSX01BQ19CX1BSX1NTSURfT0ZGU0VUKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgblBheWxvYWQsIFNJUl9NQUNfVElNX0VJRCkpKQorICAgIHsKKyAgICAgICAvKiBJZ25vcmUgRUlEIGFuZCBMZW5ndGggZmllbGQqLworICAgICAgIHRpbSAgPSAodFNpck1hY1RpbSAqKShpZXB0ciArIDIpOworCisgICAgICAgdm9zX21lbV9jb3B5KCggdEFOSV9VOCogKSZwc2Vzc2lvbkVudHJ5LT5sYXN0QmVhY29uVGltZVN0YW1wLAorICAgICAgICAgICAgICAgICAgICAgKCB0QU5JX1U4KiApcFBheWxvYWQsIHNpemVvZih0QU5JX1U2NCkpOworICAgICAgIGlmICh0aW0tPmR0aW1Db3VudCA+PSBNQVhfRFRJTV9DT1VOVCkKKyAgICAgICAgICAgdGltLT5kdGltQ291bnQgPSBEVElNX0NPVU5UX0RFRkFVTFQ7CisgICAgICAgaWYgKHRpbS0+ZHRpbVBlcmlvZCA+PSBNQVhfRFRJTV9QRVJJT0QpCisgICAgICAgICAgIHRpbS0+ZHRpbVBlcmlvZCA9IERUSU1fUEVSSU9EX0RFRkFVTFQ7CisgICAgICAgcHNlc3Npb25FbnRyeS0+bGFzdEJlYWNvbkR0aW1Db3VudCA9IHRpbS0+ZHRpbUNvdW50OworICAgICAgIHBzZXNzaW9uRW50cnktPmxhc3RCZWFjb25EdGltUGVyaW9kID0gdGltLT5kdGltUGVyaW9kOworICAgICAgIHBzZXNzaW9uRW50cnktPmN1cnJlbnRCc3NCZWFjb25DbnQrKzsKKworICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICBGTCgiY3VycmVudEJzc0JlYWNvbkNudCAlZCBsYXN0QmVhY29uRHRpbUNvdW50ICVkIGxhc3RCZWFjb25EdGltUGVyaW9kICVkIiksCisgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmN1cnJlbnRCc3NCZWFjb25DbnQsIHBzZXNzaW9uRW50cnktPmxhc3RCZWFjb25EdGltQ291bnQsCisgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmxhc3RCZWFjb25EdGltUGVyaW9kKTsKKworICAgIH0KKyAgICByZXR1cm47Cit9CisKK3ZvaWQgbGltVXBkYXRlTWF4UmF0ZUZsYWcodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBzbWVTZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG1heFJhdGVGbGFnKQoreworICAgIHRwU2lyU21lVXBkYXRlTWF4UmF0ZVBhcmFtcyAgcFJzcDsKKyAgICB0U2lyTXNnUSAgICAgICAgICAgICAgICAgICAgIG1zZzsKKworICAgIHBSc3AgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpclNtZVVwZGF0ZU1heFJhdGVQYXJhbXMpKTsKKyAgICBpZiAoTlVMTCA9PSBwUnNwKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJNZW1vcnkgYWxsb2NhdGlvbiBmYWlsZWQiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgdm9zX21lbV9zZXQoKHRBTklfVTgqKXBSc3AsIHNpemVvZih0U2lyU21lVXBkYXRlTWF4UmF0ZVBhcmFtcyksIDApOworICAgIHBSc3AtPm1heFJhdGVGbGFnID0gbWF4UmF0ZUZsYWc7CisgICAgcFJzcC0+c21lU2Vzc2lvbklkID0gc21lU2Vzc2lvbklkOworICAgIG1zZy50eXBlID0gZVdOSV9TTUVfVVBEQVRFX01BWF9SQVRFX0lORDsKKyAgICBtc2cuYm9keXB0ciA9IHBSc3A7CisgICAgbXNnLmJvZHl2YWwgPSAwOworICAgIGxpbVN5c1Byb2Nlc3NNbWhNc2dBcGkocE1hYywgJm1zZywgIGVQUk9UKTsKKyAgICByZXR1cm47Cit9CisKK3ZvaWQgbGltRGVjcmVtZW50UGVuZGluZ01nbXRDb3VudCAodHBBbmlTaXJHbG9iYWwgcE1hYykKK3sKKyAgICBpZiggcE1hYy0+c3lzLmdTeXNCYnRQZW5kaW5nTWdtdENvdW50ICkKKyAgICB7CisgICAgICAgICB2b3Nfc3Bpbl9sb2NrX2FjcXVpcmUoICZwTWFjLT5zeXMubG9jayApOworICAgICAgICAgcE1hYy0+c3lzLmdTeXNCYnRQZW5kaW5nTWdtdENvdW50LS07CisgICAgICAgICB2b3Nfc3Bpbl9sb2NrX3JlbGVhc2UoICZwTWFjLT5zeXMubG9jayApOworICAgIH0KKyAgICBlbHNlCisgICAgICAgICBsaW1Mb2cocE1hYywgTE9HVywgRkwoIlBlbmRpbmcgTWFuYWdlbWVudCBjb3VudCBnb2luZyBuZWdhdGl2ZSIpKTsKK30KKworZUhhbFN0YXR1cyBsaW1UeEJkQ29tcGxldGUodHBBbmlTaXJHbG9iYWwgcE1hYywgdm9pZCAqcERhdGEpCit7CisgICAgdHBTaXJUeEJkU3RhdHVzIHBUeEJkU3RhdHVzOworCisgICAgaWYgKCFwRGF0YSkKKyAgICB7CisgICAgICAgbGltTG9nKHBNYWMsIExPR0UsIEZMKCJwRGF0YSBpcyBOVUxMIikpOworICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIH0KKworICAgIHBUeEJkU3RhdHVzID0gKHRwU2lyVHhCZFN0YXR1cykgcERhdGE7CisKKyAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoInR4QmRUb2tlbiAldSwgdHhCZFN0YXR1cyAldSIpLAorICAgICAgICAgICAgcFR4QmRT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gICAgICAgICAgICAgICAgIHRBTklfVTggIGZNc2IpOworCit2b2lkIGxpbVV0aWxzZnJhbWVzaHRvbmwodHBBbmlTaXJHbG9iYWwgIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAgKnBPdXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgIHBJbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICBmTXNiKTsKKwordm9pZCBsaW1VcGRhdGVPQlNTU2NhblBhcmFtcyh0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5ICwKKyAgICAgICAgICAgICB0RG90MTFmSUVPQlNTU2NhblBhcmFtZXRlcnMgKnBPQlNTU2NhblBhcmFtZXRlcnMpOworCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVwordm9pZCBsaW1QbWZTYVF1ZXJ5VGltZXJIYW5kbGVyKHZvaWQgKnBNYWNHbG9iYWwsIHRBTklfVTMyIHBhcmFtKTsKKwordm9pZCBsaW1TZXRQcm90ZWN0ZWRCaXQodHBBbmlTaXJHbG9iYWwgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiAgICAgcHNlc3Npb25FbnRyeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNBZGRyICAgICBwZWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJNYWNNZ210SGRyIHBNYWNIZHIpOworI2VuZGlmCit2b2lkIGxpbUluaXRPcGVyYXRpbmdDbGFzc2VzKHRIYWxIYW5kbGUgaEhhbCk7Cit0QU5JX1U4IGxpbUdldE9QQ2xhc3NGcm9tQ2hhbm5lbCh0QU5JX1U4ICpjb3VudHJ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBjaGFubmVsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBvZmZzZXQ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KKyAgICAgICAgICAgaWYoVk9TX1RSVUUgIT0gdHhfdGltZXJfcnVubmluZygmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltSGVhcnRCZWF0VGltZXIpKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBQRUxPR0UocG1tTG9nKHBNYWMsIExPR0UsIEZMKCJVbmV4cGVjdGVkIGhlYXJ0YmVhdCB0aW1lciBub3QgcnVubmluZyIpKTspCisgICAgICAgICAgICAgICBsaW1SZWFjdGl2YXRlSGVhcnRCZWF0VGltZXIocE1hYywgcHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgIH0KKyAgICAgICB9CisgICAgfQorCisgICAgLy9HZW5lcmF0ZSBhbiBlcnJvciByZXNwb25zZSBiYWNrIHRvIFBNQworICAgIHBNYWMtPnBtbS5nUG1tU3RhdGUgPSBuZXh0U3RhdGU7CisgICAgcG1tQm1wc1VwZGF0ZVNsZWVwUmVxRmFpbHVyZUNudChwTWFjKTsKKyAgICBsaW1TZW5kU21lUnNwKHBNYWMsIGVXTklfUE1DX0VOVEVSX0JNUFNfUlNQLCByZXRTdGF0dXMsIDAsIDApOworICAgIHJldHVybjsKKworfQorCisvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorLyoqCisgKiBwbW1FeGl0Qm1wc1JlcXVlc3RIYW5kbGVyCisgKgorICogRlVOQ1RJT046CisgKiBUaGlzIGZ1bmN0aW9uIHdpbGwgc2VuZCB0aGUgd2FrZXVwIG1lc3NhZ2UgdG8gSEFMCisgKgorICogTE9HSUM6CisgKgorICogQVNTVU1QVElPTlM6CisgKgorICogTk9URToKKyAqCisgKiBAcGFyYW0gcE1hYyAgcG9pbnRlciB0byBHbG9iYWwgTWFjIHN0cnVjdHVyZS4KKworICogQHJldHVybiBOb25lCisgKi8KKwordm9pZCBwbW1FeGl0Qm1wc1JlcXVlc3RIYW5kbG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AgICAgICAgKi8KKyAgICAgICAgcE1hYy0+cG1tLmdQbW1FeGl0Qm1wc1JlYXNvbkNvZGUgPSBwRXhpdEJtcHNJbmZvLT5leGl0Qm1wc1JlYXNvbjsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBFeGl0Qm1wc0luZm8pOworCisgICAgICAgIFBFTE9HVyhwbW1Mb2cocE1hYywgTE9HVywgCisgICAgICAgICAgICBGTCgicG1tQm1wczogUmN2ZCBFWElUX0JNUFMgd2l0aCByZWFzb24gY29kZSVkICIpLCBwTWFjLT5wbW0uZ1BtbUV4aXRCbXBzUmVhc29uQ29kZSk7KQorCisKKyAgICAgICAgLy8gU2V0IFBNTSB0byBCTVBTX1dUX1dBS0VVUF9SU1Agc3RhdGUKKyAgICAgICAgcE1hYy0+cG1tLmdQbW1TdGF0ZSA9IGVQTU1fU1RBVEVfQk1QU19XVF9XQUtFVVBfUlNQOworICAgICAgICBpZihwbW1TZW5kQ2hhbmdlUG93ZXJTYXZlTXNnKHBNYWMpICE9ICBlU0lSX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIFdha2V1cCByZXF1ZXN0IGZhaWxlZCAqLworICAgICAgICAgICAgcmVzcFN0YXR1cyA9IGVTSVJfU01FX0JNUFNfUkVRX1JFSkVDVDsKKyAgICAgICAgICAgIHBtbUJtcHNVcGRhdGVIYWxSZXFGYWlsdXJlQ250KHBNYWMpOworICAgICAgICAgICAgZ290byBmYWlsdXJlOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcG1tTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJwbW1CbXBzOiBlV05JX1BNQ19FWElUX0JNUFNfUkVRIHdhcyBzdWNjZXNzZnVsbHkgc2VudCB0byBIQUwiKSk7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgUEVMT0dFKHBtbUxvZyhwTWFjL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9IGVTSVJfU01FX0lOVkFMSURfUE1NX1NUQVRFOworICAgICAgICBwbW1CbXBzVXBkYXRlSW52YWxpZFN0YXRlQ250KHBNYWMpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBQRUxPR1cocG1tTG9nKHBNYWMsIExPR1csIEZMKCJSZWNlaXZlZCBTSVJfSEFMX0VYSVRfQk1QU19SU1AgaW4gY29ycmVjdCBzdGF0ZS4gIikpOykKKyAgICB9CisKKyAgICAvKiBQRSBpcyBnb2luZyB0byB3YWtldXAgaXJyZXNwZWN0aXZlIG9mIHdoZXRoZXIKKyAgICAgKiBTSVJfSEFMX0VYSVRfQk1QU19SRVEgd2FzIHN1Y2Nlc3NmdWwgb3Igbm90CisgICAgICovCisgICAgc3dpdGNoIChyc3BTdGF0dXMpCisgICAgeworICAgICAgICBjYXNlIGVIQUxfU1RBVFVTX1NVQ0NFU1M6CisgICAgICAgICAgICByZXRTdGF0dXMgPSBlU0lSX1NNRV9TVUNDRVNTOworICAgICAgICAgICAgcE1hYy0+cG1tLmdQbW1TdGF0ZSA9IGVQTU1fU1RBVEVfQk1QU19XQUtFVVA7CisgICAgICAgICAgICAvKiBVcGRhdGUgd2FrZXVwIHN0YXRpc3RpY3MgKi8KKyAgICAgICAgICAgIHBtbVVwZGF0ZVdha2V1cFN0YXRzKHBNYWMpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBQRSBpcyBnb2luZyB0byBiZSBhd2FrZSBpcnJlc3BlY3RpdmUgb2Ygd2hldGhlciBFWElUX0JNUFNfUkVRCisgICAgICAgICAgICAgICAgICogZmFpbGVkIG9yIG5vdC4gVGhpcyBpcyBtYWlubHkgdG8gZWxpbWluYXRlIHRoZSBkZWFkLWxvY2sgY29uZGl0aW9uCisgICAgICAgICAgICAgICAgICogQnV0LCBQTUMgd2lsbCBiZSBpbmZvcm1lZCBhYm91dCB0aGUgZXJyb3IuCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgcmV0U3RhdHVzID0gZVNJUl9TTUVfQk1QU19SRVFfRkFJTEVEOworICAgICAgICAgICAgICAgIHBNYWMtPnBtbS5nUG1tU3RhdGUgPSBlUE1NX1NUQVRFX0JNUFNfU0xFRVA7CisgICAgICAgICAgICAgICAgcG1tQm1wc1VwZGF0ZVdha2V1cFJlcUZhaWx1cmVDbnQocE1hYyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgIH0KKworICAgIC8vIHR1cm4gb24gYmFja2dyb3VuZCBzY2FuCisgICAgcE1hYy0+c3lzLmdTeXNFbmFibGVTY2FuTW9kZSA9IHRydWU7CisKKyAgICAvLyBzZW5kIHJlc3BvbnNlIHRvIFBNQworICAgaWYoSVNfRkVBVFVSRV9TVVBQT1JURURfQllfRlcoU0xNX1NFU1NJT05JWkFUSU9OKSApCisgICB7CisgICAgICAgbGltU2VuZFNtZVJzcChwTWFjLCBlV05JX1BNQ19FWElUX0JNUFNfUlNQLCByZXRTdGF0dXMsCisgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5zbWVTZXNzaW9uSWQsIHBzZXNzaW9uRW50cnktPnRyYW5zYWN0aW9uSWQpOworICAgfQorICAgZWxzZQorICAgeworICAgICAgIGxpbVNlbmRTbWVSc3AocE1hYywgZVdOSV9QTUNfRVhJVF9CTVBTX1JTUCwgcmV0U3RhdHVzLCAwLCAwKTsKKyAgIH0KKworICAgIGlmICggcE1hYy0+cG1tLmdQbW1FeGl0Qm1wc1JlYXNvbkNvZGUgPT0gZVNNRV9NSVNTRURfQkVBQ09OX0lORF9SQ1ZEKQorICAgIHsKKyAgICAgICAgUEVMT0dXKHBtbUxvZyhwTWFjLCBMT0dXLCBGTCgiUmN2ZCBTSVJfSEFMX0VYSVRfQk1QU19SU1Agd2l0aCBNSVNTRURfQkVBQ09OIikpOykKKyAgICAgICAgcG1tTWlzc2VkQm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GlkZW50aWZpZXMKKyAgICAgICAgICogdGhhdCB0aGUgU29mdE1BQyBoYXMgaWRlbnRpZmllZCBoZWFydC1iZWF0IG1pc3MKKyAgICAgICAgICovCisgICAgICAgIGNhc2UgZUhBTF9TVEFUVVNfSEVBUlRCRUFUX1RNT1VUOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBtbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoInBtbUJtcHM6IFRoZSBkZXZpY2Ugd29rZSB1cCBkdWUgdG8gSGVhcnRCZWF0IFRpbWVvdXQiKSk7CisKKyAgICAgICAgICAgICAgICAvKiBQcm9jZWVkIG9ubHkgaWYgSGVhcnRCZWF0IHRpbWVyIGlzIGNyZWF0ZWQgKi8KKyAgICAgICAgICAgICAgICBpZigocE1hYy0+bGltLmxpbVRpbWVycy5nTGltSGVhcnRCZWF0VGltZXIucE1hYykgJiYKKyAgICAgICAgICAgICAgICAgICAocE1hYy0+bGltLmdMaW1UaW1lcnNDcmVhdGVkKSkKKyAgICAgICAgICAgICAgICB7CisKKyAgICAgICAgICAgICAgICAgICAgLyogUmVhZCB0aGUgYmVhY29uIGludGVydmFsIGZyb20gc2Vzc2lvblRhYmxlICovCisgICAgICAgICAgICAgICAgICAgIGJlYWNvbkludGVydmFsID0gcHNlc3Npb25FbnRyeS0+YmVhY29uUGFyYW1zLmJlYWNvbkludGVydmFsOworCisgICAgICAgICAgICAgICAgICAgIC8qIENoYW5nZSB0aW1lciB0byByZWFjdGl2YXRlIGl0IGluIGZ1dHVyZSAqLworICAgICAgICAgICAgICAgICAgICBoZWFydEJlYXRJbnRlcnZhbD0gU1lTX01TX1RPX1RJQ0tTKGJlYWNvbkludGVydmFsICogaGVhcnRCZWF0SW50ZXJ2YWwpOworCisgICAgICAgICAgICAgICAgICAgIGlmKHR4X3RpbWVyX2NoYW5nZSgmcE1hYy0+bGltLmxpbVRpbWVycy5nTGltSGVhcnRCZWF0VGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VMzIpaGVhcnRCZWF0SW50ZXJ2YWwsIDApICE9IFRYX1NVQ0NFU1MpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBtbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJwbW1CbXBzOiBVbmFibGUgdG8gY2hhbmdlIEhlYXJ0QmVhdCB0aW1lciIpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIC8qIHVwZGF0ZSBzb21lIHN0YXRpc3RpY3MgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYoTElNX0lTX0NPTk5FQ1RJT05fQUNUSVZFKHBzZXNzaW9uRW50cnkpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihwc2Vzc2lvbkVudHJ5LT5MaW1SeGVkQmVhY29uQ250RHVyaW5nSEIgPCBNQVhfTk9fQkVBQ09OU19QRVJfSEVBUlRfQkVBVF9JTlRFUlZBTCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbUhlYXJ0QmVhdEJlYWNvblN0YXRzW3BzZXNzaW9uRW50cnktPkxpbVJ4ZWRCZWFjb25DbnREdXJpbmdIQl0rKzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5saW0uZ0xpbUhlYXJ0QmVhdEJlYWNvblN0YXRzWzBdKys7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvKiBUbyBoYW5kbGUgdGhlIGhlYXJ0YmVhdCBmYWlsdXJlLCBtZXNzYWdlIGlzIGJlaW5nIHBvc3RlZCB0byBzZWxmIGFzIGlmIHRoZQorICAgICAgICAgICAgICAgICAgICAgKiBhY3R1YWwgdGltZXIgaGFzIGV4cGlyZWQuIFRoaXMgaXMgZG9uZSB0byBtYWtlIHN1cmUgdGhhdCB0aGVyZSBleGlzdHMgb25lCisgICAgICAgICAgICAgICAgICAgICAqIGNvbW1vbiBlbnRyeSBhbmQgZXhpdCBwb2ludHMKKyAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgIHBtbVNlbmRNZXNzYWdlVG9MaW0ocE1hYywgU0lSX0xJTV9IRUFSVF9CRUFUX1RJTUVPVVQpOworCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisKKyAgICAgICAgICAgICAgICAgICAgUEVMT0dFKHBtbUxvZyhwTWFjLCBMT0dFLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJwbW1CbXBzOiBIZWFydEJlYXQgVGltZXIgaXMgbm90IGNyZWF0ZWQsIGNhbm5vdCByZS1hY3RpdmF0ZSIpKTspCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlSEFMX1NUQVRVU19OVEhfQkVBQ09OX0RFTElWRVJZOgorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgfQorCisgICAgcmV0dXJuOworCit9CisKKworLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKy8qKgorICogcG1tUHJvY2Vzc01lc3NhZ2UKKyAqCisgKiBGVU5DVElPTjogIFByb2Nlc3NlcyB0aGUgbmV4dCByZWNlaXZlZCBQb3dlciBNYW5hZ2VtZW50IG1lc3NhZ2UKKyAqCisgKiBMT0dJQzoKKyAqCisgKiBBU1NVTVBUSU9OUzoKKyAqCisgKiBOT1RFOgorICoKKyAqIEBwYXJhbSBOb25lCisgKiBAcmV0dXJuIE5vbmUKKyAqLworCit2b2lkIHBtbVByb2Nlc3NNZXNzYWdlKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRwU2lyTXNnUSBwTXNnKQoreworICAgIHN3aXRjaCAocE1zZy0+dHlwZSkKKyAgICB7CisgICAgICAgIGNhc2UgZVdOSV9QTUNfUFdSX1NBVkVfQ0ZHOgorICAgICAgICB7CisgICAgICAgICAgICB0cFNpclBvd2VyU2F2ZUNmZyBwUFNDZmc7CisgICAgICAgICAgICB0U2lyTWJNc2cgKnBNYk1zZyA9ICh0U2lyTWJNc2cgKilwTXNnLT5ib2R5cHRyOworCisgICAgICAgICAgICBwUFNDZmcgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpclBvd2VyU2F2ZUNmZykpOworICAgICAgICAgICAgaWYgKCBOVUxMID09IHBQU0NmZyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcG1tTG9nKHBNYWMsIExPR1AsICJQTU06IE5vdCBhYmxlIHRvIGFsbG9jYXRlIG1lbW9yeSBmb3IgUE1DIENvbmZpZyIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgKHZvaWQpIHZvc19tZW1fY29weShwUFNDZmcsIHBNYk1zZy0+ZGF0YSwgc2l6ZW9mKHRTaXJQb3dlclNhdmVDZmcpKTsKKyAgICAgICAgICAgICh2b2lkKSBwbW1TZW5kUG93ZXJTYXZlQ2ZnKHBNYWMsIHBQU0NmZyk7CisgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVdOSV9QTUNfRU5URVJfQk1QU19SRVE6CisgICAgICAgICAgICBwbW1Jbml0Qm1wc1B3clNhdmUocE1hYyk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFdEQV9FTlRFUl9CTVBTX1JTUDoKKyAgICAgICAgICAgIHBtbUluaXRCbXBzUmVzcG9uc2VIYW5kbGVyKHBNYWMsIHBNc2cpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlV05JX1BNQ19FWElUX0JNUFNfUkVROgorICAgICAgICB7CisgICAgICAgICAgICB0cEV4aXRCbXBzSW5mbyAgcEV4aXRCbXBzSW5mbzsKKyAgICAgICAgICAgIHRTaXJNYk1zZyAgICAgICpwTWJNc2cgPSAodFNpck1iTXNnICopcE1zZy0+Ym9keXB0cjsKKworICAgICAgICAgICAgcEV4aXRCbXBzSW5mbyA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0RXhpdEJtcHNJbmZvKSk7CisgICAgICAgICAgICBpZiAoIE5VTEwgPT0gcEV4aXRCbXBzSW5mbyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcG1tTG9nKHBNYWMsIExPR1AsICJQTU06IEZhaWxlZCB0byBhbGxvY2F0ZSBtZW1vcnkgZm9yIEV4aXQgQk1QUyBJbmZvICIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgKHZvaWQpIHZvc19tZW1fY29weShwRXhpdEJtcHNJbmZvLCBwTWJNc2ctPmRhdGEsIHNpemVvZih0RXhpdEJtcHNJbmZvKSk7CisgICAgICAgICAgICAodm9pZCkgcG1tRXhpdEJtcHNSZXF1ZXN0SGFuZGxlcihwTWFjLCBwRXhpdEJtcHNJbmZvKTsKKyAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBXREFfRVhJVF9CTVBTX1JTUDoKKyAgICAgICAgICAgIHBtbUV4aXRCbXBzUmVzcG9uc2VIYW5kbGVyKHBNYWMsIHBNc2cpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBXREFfRVhJVF9CTVBTX0lORDoKKyAgICAgICAgICAgIHBtbUV4aXRCbXBzSW5kaWNhdGlvbkhhbmRsZXIocE1hYywgU0lSX1BNX0FDVElWRV9NT0RFLCAoZUhhbFN0YXR1cylwTXNnLT5ib2R5dmFsKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVdOSV9QTUNfRU5URVJfSU1QU19SRVE6CisgICAgICAgICAgICBwbW1FbnRlckltcHNSZXF1ZXN0SGFuZGxlcihwTWFjKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgV0RBX0VOVEVSX0lNUFNfUlNQOgorICAgICAgICAgICAgcG1tRW50ZXJJbXBzUmVzcG9uc2VIYW5kbGVyKHBNYWMsIChlSGFsU3RhdHVzKXBNc2ctPmJvZHl2YWwpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlV05JX1BNQ19FWElUX0lNUFNfUkVROgorICAgICAgICAgICAgcG1tRXhpdEltcHNSZXF1ZXN0SGFuZGxlcihwTWFjKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgV0RBX0VYSVRfSU1QU19SU1A6CisgICAgICAgICAgICBwbW1FeGl0SW1wc1Jlc3BvbnNlSGFuZGxlcihwTWFjLCAoZUhhbFN0YXR1cylwTXNnLT5ib2R5dmFsKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVdOSV9QTUNfRU5URVJfVUFQU0RfUkVROgorICAgICAgICAgICAgcG1tRW50ZXJVYXBzZFJlcXVlc3RIYW5kbGVyKHBNYWMpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBXREFfRU5URVJfVUFQU0RfUlNQOgorICAgICAgICAgICAgcG1tRW50ZXJVYXBzZFJlc3BvbnNlSGFuZGxlcihwTWFjLCBwTXNnKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVdOSV9QTUNfRVhJVF9VQVBTRF9SRVE6CisgICAgICAgICAgICBwbW1FeGl0VWFwc2RSZXF1ZXN0SGFuZGxlcihwTWFjKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgV0RBX0VYSVRfVUFQU0RfUlNQOgorICAgICAgICAgICAgcG1tRXhpdFVhcHNkUmVzcG9uc2VIYW5kbGVyKHBNYWMsIHBNc2cpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlV05JX1BNQ19XT1dMX0FERF9CQ0FTVF9QVFJOOgorICAgICAgICAgICAgcG1tU2VuZFdvd2xBZGRCY2FzdFB0cm4ocE1hYywgcE1zZyk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVXTklfUE1DX1dPV0xfREVMX0JDQVNUX1BUUk46CisgICAgICAgICAgICBwbW1TZW5kV293bERlbEJjYXN0UHRybihwTWFjLCBwTXNnKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVdOSV9QTUNfRU5URVJfV09XTF9SRVE6CisgICAgICAgICAgICBwbW1FbnRlcldvd2xSZXF1ZXN0SGFuZGxlcihwTWFjLCBwTXNnKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgV0RBX1dPV0xfRU5URVJfUlNQOgorICAgICAgICAgICAgcG1tRW50ZXJXb3dsYW5SZXNwb25zZUhhbmRsZXIocE1hYywgcE1zZyk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVXTklfUE1DX0VYSVRfV09XTF9SRVE6CisgICAgICAgICAgICBwbW1FeGl0V293bGFuUmVxdWVzdEhhbmRsZXIocE1hYyk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFdEQV9XT1dMX0VYSVRfUlNQOgorICAgICAgICAgICAgcG1tRXhpdFdvd2xhblJlc3BvbnNlSGFuZGxlcihwTWFjLCBwTXNnKTsKKyAgICAgICAgICAgIGJyZWFrOworI2lmZGVmIFdMQU5fRkVBVFVSRV9QQUNLRVRfRklMVEVSSU5HCisgICAgICAgIGNhc2UgV0RBX1BBQ0tFVF9DT0FMRVNDSU5HX0ZJTFRFUl9NQVRDSF9DT1VOVF9SU1A6CisgICAgICAgICAgICBwbW1GaWx0ZXJNYXRjaENvdW50UmVzcG9uc2VIYW5kbGVyKHBNYWMsIHBNc2cpOworICAgICAgICAgICAgYnJlYWs7CisjZW5kaWYgLy8gV0xBTl9GRUFUVVJFX1BBQ0tFVF9GSUxURVJJTkcKKworCisjaWZkZWYgV0xBTl9GRUFUVVJFX0dUS19PRkZMT0FECisgICAgICAgIGNhc2UgV0RBX0dUS19PRkZMT0FEX0dFVElORk9fUlNQOgorICAgICAgICAgICAgcG1tR1RLT2ZmbG9hZEdldEluZm9SZXNwb25zZUhhbmRsZXIocE1hYywgcE1zZyk7CisgICAgICAgICAgICBicmVhazsKKyNlbmRpZiAvLyBXTEFOX0ZFQVRVUkVfR1RLX09GRkxPQUQKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgUEVMT0dXKHBtbUxvZyhwTWFjLCBMT0dXLCAKKyAgICAgICAgICAgICAgICBGTCgiUE1NOiBVbmtub3duIG1lc3NhZ2UgaW4gcG1tTXNnUSB0eXBlICVkLCBwb3RlbnRpYWwgbWVtb3J5IGxlYWshISIpLAorICAgICAgICAgICAgICAgIHBNc2ctPnR5cGUpOykKKyAgICB9CisKKyAgICBpZiAoTlVMTCAhPSBwTXNnLT5ib2R5cHRyKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBNc2ctPmJvZHlwdHIpOworICAgICAgICBwTXNnLT5ib2R5cHRyID0gTlVMTDsKKyAgICB9Cit9CisKKworCisKKworCisvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorLyoqCisgKiBwbW1Qb3N0TWVzc2FnZQorICoKKyAqIEZVTkNUSU9OOgorICogUG9zdCBhIG1lc3NhZ2UgdG8gdGhlIHBtbSBtZXNzYWdlIHF1ZXVlCisgKgorICogTE9HSUM6CisgKgorICogQVNTVU1QVElPTlM6CisgKgorICogTk9URToKKyAqCisgKiBAcGFyYW0gcE1zZyBwb2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HBlSXNBbnlTZXNzaW9uQWN0aXZlKHBNYWMpKQorICAgIHsKKyAgICAgICAgLyogUHJpbnQgYWN0aXZlIHBlc2Vzc2lvbiBhbmQgdHJhY2VkdW1wIG9uY2UgaW4gZXZlcnkgMTYKKyAgICAgICAgICogY29udGlub3VzIGVycm9yLgorICAgICAgICAgKi8KKyAgICAgICAgaWYgKCEocE1hYy0+cG1jLkltcHNSZXFGYWlsQ250ICYgMHhGKSkKKyAgICAgICAgeworICAgICAgICAgICAgcGVQcmludEFjdGl2ZVNlc3Npb24ocE1hYyk7CisgICAgICAgICAgICB2b3NUcmFjZUR1bXBBbGwocE1hYywwLDAsMTAwLDApOworICAgICAgICB9CisgICAgICAgIHJlc3VsdENvZGUgPSBlU0lSX1NNRV9JTlZBTElEX1NUQVRFOworICAgICAgICBwbW1Mb2cocE1hYywgTE9HRSwgRkwoIlNlc3Npb24gaXMgYWN0aXZlIGdvIHRvIGZhaWx1cmUgcmVzdWx0Q29kZSA9ICIKKyAgICAgICAgICAgICAgICJlU0lSX1NNRV9JTlZBTElEX1NUQVRFICglZCkiKSxyZXN1bHRDb2RlKTsKKyAgICAgICAgZ290byBmYWlsdXJlOworICAgIH0KKworICAgIGlmICggKChwTWFjLT5wbW0uZ1BtbVN0YXRlICE9IGVQTU1fU1RBVEVfUkVBRFkpICYmCisgICAgICAgICAgKHBNYWMtPnBtbS5nUG1tU3RhdGUgIT0gZVBNTV9TVEFURV9JTVBTX1dBS0VVUCkpIHx8CisgICAgICAgICAoKHBNYWMtPmxpbS5nTGltU21lU3RhdGUgIT0gZUxJTV9TTUVfSURMRV9TVEFURSkgJiYKKyAgICAgICAgICAocE1hYy0+bGltLmdMaW1TbWVTdGF0ZSAhPSBlTElNX1NNRV9KT0lOX0ZBSUxVUkVfU1RBVEUpKSB8fAorICAgICAgICAgKHBNYWMtPmxpbS5nTGltTWxtU3RhdGUgIT0gZUxJTV9NTE1fSURMRV9TVEFURSkgfHwKKyAgICAgICAgIGxpbUlzQ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AgICAgZ290byBmYWlsdXJlOworICAgIH0KKworICAgIGlmKGVIQUxfU1RBVFVTX1NVQ0NFU1MgPT0gcnNwU3RhdHVzKQorICAgIHsKKyAgICAgICAgLy9pZiBzdWNjZXNzLCBjaGFuZ2UgdGhlIHN0YXRlIHRvIElNUFMgc2xlZXAgbW9kZQorICAgICAgICBwTWFjLT5wbW0uZ1BtbVN0YXRlID0gZVBNTV9TVEFURV9JTVBTX1NMRUVQOworCisgICAgICAgIHBtbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgRkwoInBtbUltcHM6IFJlY2VpdmVkIHN1Y2Nlc3NmdWwgV0RBX0VOVEVSX0lNUFNfUlNQIGZyb20gSEFMIikpOworCisgICAgICAgIC8vdXBkYXRlIHBvd2VyIHNhdmUgc3RhdGlzdGljcworICAgICAgICBwbW1JbXBzVXBkYXRlUHdyU2F2ZVN0YXRzKHBNYWMpOworCisgICAgICAgIGxpbVNlbmRTbWVSc3AocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICBlV05JX1BNQ19FTlRFUl9JTVBTX1JTUCwKKyAgICAgICAgICAgICAgICAgICAgICByZXN1bHRDb2RlLCAwLCAwKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgLy8gZ28gYmFjayB0byBwcmV2aW91cyBzdGF0ZSBpZiByZXF1ZXN0IGZhaWxlZAorICAgICAgICBuZXh0U3RhdGUgPSBlUE1NX1NUQVRFX1JFQURZOworICAgICAgICByZXN1bHRDb2RlID0gZVNJUl9TTUVfQ0FOTk9UX0VOVEVSX0lNUFM7CisgICAgICAgIGdvdG8gZmFpbHVyZTsKKyAgICB9CisgICAgcmV0dXJuOworCitmYWlsdXJlOgorICAgIGlmICghKGZhaWxDbnQgJiAweEYpKQorICAgICAgICAgUEVMT0dFKHBtbUxvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICBGTCgicG1tSW1wc1NsZWVwUnNwIGZhaWxlZCwgUmV0IENvZGU6ICVkLCBuZXh0I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tLmdQbW1TdGF0ZSk7KQorCisgICAgICAgIHJlc3VsdENvZGUgPSBlU0lSX1NNRV9JTlZBTElEX1BNTV9TVEFURTsKKyAgICAgICAgcG1tSW1wc1VwZGF0ZUVyclN0YXRlU3RhdHMocE1hYyk7CisgICAgfQorCisgICAgc3dpdGNoKHJzcFN0YXR1cykKKyAgICB7CisgICAgY2FzZSBlSEFMX1NUQVRVU19TVUNDRVNTOgorICAgICAgICB7CisgICAgICAgICAgICByZXN1bHRDb2RlID0gZVNJUl9TTUVfU1VDQ0VTUzsKKyAgICAgICAgICAgIHBNYWMtPnBtbS5nUG1tU3RhdGUgPSBlUE1NX1NUQVRFX0lNUFNfV0FLRVVQOworICAgICAgICAgICAgcG1tTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJwbW1JbXBzOiBSZWNlaXZlZCBXREFfRVhJVF9JTVBTX1JTUCB3aXRoIFN1Y2Nlc3NmdWwgcmVzcG9uc2UgZnJvbSBIQUwiKSk7CisgICAgICAgICAgICAvL3VwZGF0ZSBwb3dlciBzYXZlIHN0YXRpc3RpY3MKKyAgICAgICAgICAgIHBtbUltcHNVcGRhdGVXYWtldXBTdGF0cyhwTWFjKTsKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHJlc3VsdENvZGUgPSBlU0lSX1NNRV9JTVBTX1JFUV9GQUlMRUQ7CisgICAgICAgICAgICAgICAgLyogU2V0IHRoZSBzdGF0dXMgYmFjayB0byBJTVBTIFNMRUVQIGFzIHdlIGZhaWxlZAorICAgICAgICAgICAgICAgICAqIHRvIGNvbWUgb3V0IG9mIHNsZWVwCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgcE1hYy0+cG1tLmdQbW1TdGF0ZSA9IGVQTU1fU1RBVEVfSU1QU19TTEVFUDsKKyAgICAgICAgICAgICAgICBQRUxPR1cocG1tT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GV0ZVB0cm47CisgICAgdFNpck1iTXNnICAgICAgICAgICAgICAgKnBNYk1zZyA9ICh0U2lyTWJNc2cgKilwTXNnLT5ib2R5cHRyOworICAgIHRTaXJSZXRTdGF0dXMgICAgICAgICAgIHJldENvZGUgPSBlU0lSX1NVQ0NFU1M7CisgICAgdFNpck1zZ1EgICAgICAgICAgICAgICAgbXNnUTsKKworICAgIHBEZWxldGVQdHJuID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKCpwRGVsZXRlUHRybikpOworICAgIGlmICggTlVMTCA9PSBwRGVsZXRlUHRybiApCisgICAgeworICAgICAgICBwbW1Mb2cocE1hYywgTE9HUCwgRkwoIkZhaWwgdG8gYWxsb2NhdGUgbWVtb3J5IGZvciBXb1dMQU4gRGVsZXRlIEJjYXN0IFBhdHRlcm4gIikpOworICAgICAgICByZXR1cm47CisgICAgfQorICAgICh2b2lkKSB2b3NfbWVtX2NvcHkocERlbGV0ZVB0cm4sIHBNYk1zZy0+ZGF0YSwgc2l6ZW9mKCpwRGVsZXRlUHRybikpOworCisgICAgaWYgKE5VTEwgPT0gcERlbGV0ZVB0cm4pCisgICAgeworICAgICAgICBwbW1Mb2cocE1hYywgTE9HRSwgRkwoIkRlbGV0ZSBicm9hZGNhc3QgcGF0dGVybiBtZXNzYWdlIGlzIE5VTEwgIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgbXNnUS50eXBlID0gV0RBX1dPV0xfREVMX0JDQVNUX1BUUk47CisgICAgbXNnUS5yZXNlcnZlZCA9IDA7CisgICAgbXNnUS5ib2R5cHRyID0gcERlbGV0ZVB0cm47CisgICAgbXNnUS5ib2R5dmFsID0gMDsKKworICAgIHBtbUxvZyhwTWFjLCBMT0cxLCBGTCggIlNlbmRpbmcgV0RBX1dPV0xfREVMX0JDQVNUX1BUUk4iKSk7CisjaWZkZWYgRkVBVFVSRV9XTEFOX0RJQUdfU1VQUE9SVCAKKyAgICBsaW1EaWFnRXZlbnRSZXBvcnQocE1h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V0xBTl9ESUFHX1NVUFBPUlQKKworICAgIGlmICggcE1hYy0+cG1tLmdQbW1TdGF0ZSAhPSBlUE1NX1NUQVRFX1dPV0xBTiApCisgICAgeworICAgICAgICBwbW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgIEZMKCJFeGl0IFdPV0xBTiBSZXF1ZXN0IHJlY2VpdmVkIGluIGludmFsaWQgc3RhdGUgUE1NPSVkICIpLAorICAgICAgICAgICAgcE1hYy0+cG1tLmdQbW1TdGF0ZSk7CisgICAgICAgIHNtZVJzcENvZGUgPSBlU0lSX1NNRV9JTlZBTElEX1BNTV9TVEFURTsKKyAgICAgICAgZ290byBmYWlsdXJlOworICAgIH0KKworICAgICh2b2lkKSB2b3NfbWVtX3NldCgodEFOSV9VOCAqKXBIYWxXb3dsTXNnLCBzaXplb2YoKnBIYWxXb3dsTXNnKSwgMCk7CisgICAgcEhhbFdvd2xNc2ctPmJzc0lkeCA9IHBTZXNzaW9uRW50cnktPmJzc0lkeDsKKworICAgIGlmKChyZXRTdGF0dXMgPSBwbW1TZW5kRXhpdFdvd2xSZXEocE1hYywgcEhhbFdvd2xNc2cpKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgeworICAgICAgICBwbW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgIEZMKCJGYWlsIHRvIHNlbmQgV0RBX1dPV0xfRVhJVF9SRVEsIHJlYXNvbiBjb2RlICVkIiksCisgICAgICAgICAgICByZXRTdGF0dXMpOworICAgICAgICBzbWVSc3BDb2RlID0gZVNJUl9TTUVfV09XTF9FWElUX1JFUV9GQUlMRUQ7CisgICAgICAgIGdvdG8gZmFpbHVyZTsKKyAgICB9CisgICAgcmV0dXJuOworCitmYWlsdXJlOgorICAgIGlmIChwSGFsV293bE1zZyAhPSBOVUxMKQorICAgICAgIHZvc19tZW1fZnJlZShwSGFsV293bE1zZyk7CisgICAgbGltU2VuZFNtZVJzcChwTWFjLCBlV05JX1BNQ19FWElUX1dPV0xfU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LCBMT0dXLCBGTCgicG1tVWFwc2QgOiBmYWlsZWQgdG8gYWxsb2NhdGUgbWVtb3J5IikpOykKKyAgICAgICAgICAgIHJldFN0YXR1cyA9IGVTSVJfTUVNX0FMTE9DX0ZBSUxFRDsKKyAgICAgICAgICAgIHJldHVybiByZXRTdGF0dXM7CisgICAgICAgIH0KKworICAgICAgICB2b3NfbWVtX3NldCggKHRBTklfVTggKilwVWFwc2RQYXJhbXMsIHNpemVvZih0VWFwc2RQYXJhbXMpLCAwKTsKKyAgICAgICAgbXNnUS50eXBlID0gV0RBX0VOVEVSX1VBUFNEX1JFUTsKKyAgICAgICAgbXNnUS5ib2R5cHRyID0gcFVhcHNkUGFyYW1zOworCisgICAgICAgIC8qCisgICAgICAgICogQW4gQUMgaXMgZGVsaXZlcnkgZW5hYmxlZCBBQyBpZiB0aGUgYml0IGZvciB0aGF0IEFDIGlzIHNldCBpbnRvIHRoZQorICAgICAgICAqIGdBY0FkbWl0TWFza1tTSVJfTUFDX0RJUkVDVElPTl9ETElOS10saXQgaXMgbm90IHNldCB0aGVuIHdlIHdpbGwgdGFrZSBTdGF0aWMgdmFsdWVzLgorICAgICAgICAqLworCisgICAgICAgIGlmICggcE1hYy0+bGltLmdBY0FkbWl0TWFza1tTSVJfTUFDX0RJUkVDVElPTl9ETkxJTktdICYgTElNX0FETUlUX01BU0tfRkxBR19BQ0JFKQorICAgICAgICB7CisgICAgICAgICAgICBwVWFwc2RQYXJhbXMtPmJlRGVsaXZlcnlFbmFibGVkID0gTElNX1VBUFNEX0dFVChBQ0JFLCBwTWFjLT5saW0uZ1VhcHNkUGVyQWNEZWxpdmVyeUVuYWJsZU1hc2spOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcFVhcHNkUGFyYW1zLT5iZURlbGl2ZXJ5RW5hYmxlZCA9IExJTV9VQVBTRF9HRVQoQUNCRSwgcE1hYy0+bGltLmdVYXBzZFBlckFjQml0bWFzayk7CisgICAg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1NJUl9NQUNfRElSRUNUSU9OX1VQTElOS10gJiBMSU1fQURNSVRfTUFTS19GTEFHX0FDQkspCisgICAgICAgIHsKKyAgICAgICAgICAgICBwVWFwc2RQYXJhbXMtPmJrVHJpZ2dlckVuYWJsZWQgPSBMSU1fVUFQU0RfR0VUKEFDQkssIHBNYWMtPmxpbS5nVWFwc2RQZXJBY1RyaWdnZXJFbmFibGVNYXNrKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgICBwVWFwc2RQYXJhbXMtPmJrVHJpZ2dlckVuYWJsZWQgPSBMSU1fVUFQU0RfR0VUKEFDQkssIHBNYWMtPmxpbS5nVWFwc2RQZXJBY0JpdG1hc2spOworICAgICAgICB9CisgICAgICAgIGlmICggcE1hYy0+bGltLmdBY0FkbWl0TWFza1tTSVJfTUFDX0RJUkVDVElPTl9VUExJTktdICYgTElNX0FETUlUX01BU0tfRkxBR19BQ1ZJKQorICAgICAgICB7CisgICAgICAgICAgICAgcFVhcHNkUGFyYW1zLT52aVRyaWdnZXJFbmFibGVkID0gTElNX1VBUFNEX0dFVChBQ1ZJLCBwTWFjLT5saW0uZ1VhcHNkUGVyQWNUcmlnZ2VyRW5hYmxlTWFzayk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAgcFVhcHNkUGFyYW1zLT52aVRyaWdnZXJFbmFibGVkID0gTElNX1VBUFNEX0dFVChBQ1ZJLCBwTWFjLT5saW0uZ1VhcHNkUGVyQWNCaXRtYXNrKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmICggcE1hYy0+bGltLmdBY0FkbWl0TWFza1tTSVJfTUFDX0RJUkVDVElPTl9VUExJTktdICYgTElNX0FETUlUX01BU0tfRkxBR19BQ1ZPKQorICAgICAgICB7CisgICAgICAgICAgICAgcFVhcHNkUGFyYW1zLT52b1RyaWdnZXJFbmFibGVkID0gTElNX1VBUFNEX0dFVChBQ1ZPLCBwTW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isgIFxhdXRob3IgU3VuaXQgQmhhdGlhCisgIAorICAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworI2luY2x1ZGUgInZvc190cmFjZS5oIgorI2luY2x1ZGUgInBtbURlYnVnLmgiCisjZGVmaW5lIExPR19TSVpFIDI1NgorCit2b2lkIHBtbUxvZyh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UzMiBsb2dsZXZlbCwgY29uc3QgY2hhciAqcFN0cmluZywgLi4uKQorIHsKKyAgICAgICBWT1NfVFJBQ0VfTEVWRUwgIHZvc0RlYnVnTGV2ZWw7CisgICAgICAgY2hhciAgICBsb2dCdWZmZXJbTE9HX1NJWkVdOworICAgICAgIHZhX2xpc3QgbWFya2VyOworCisgICAgICAgLyogIGdldHRpbmcgcHJvcGVyIERlYnVnIGxldmVsICAqLworICAgICAgIHZvc0RlYnVnTGV2ZWwgPSBnZXRWb3NEZWJ1Z0xldmVsKGxvZ2xldmVsKTsKKworICAgICAgIC8qIGV4dHJhY3RpbmcgYXJndW1lbnRzIGZyb20gcHN0cmluZyAqLworICAgICAgIHZhX3N0YXJ0KCBtYXJrZXIsIHBTdHJpbmcgKTsKKyAgICAgICB2c25wcmludGYobG9nQnVmZmVyLCBMT0dfU0laRSwgcFN0cmluZywgbWFya2VyKTsKKworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1BNQywgdm9zRGVidWdMZXZlbCwgIiVzIiwgbG9nQnVmZmVyKTsKKyAgICAgICB2YV9lbmQoIG1hcmtlciApOworIH0KZGlmZiAtLWdpdCBhL3dsYW4vcHJpbWEvQ09SRS9NQUMvc3JjL3BlL3BtbS9wbW1EZWJ1Zy5oIGIvd2xhbi9wcmltYS9DT1JFL01BQy9zcmMvcGUvcG1tL3BtbURlYnVnLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZW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PSB7MHhGRiwgMHhGRiwgMHhGRiwgMHhGRiwgMHhGRiwgMHhGRn07CisKKyAgIGlmKCB2b3NfbWVtX2NvbXBhcmUoYnNzaWQsIHBNYXhUeFBhcmFtcy0+YnNzSWQsIHNpemVvZih0U2lyTWFjQWRkcikpKQorICAgeworICAgICAgZm9yIChpID0wO2kgPCBwTWFjLT5saW0ubWF4QnNzSWQ7aSsrKQorICAgICAgeworICAgICAgICAgaWYgKCAocE1hYy0+bGltLmdwU2Vzc2lvbltpXS52YWxpZCA9PSBUUlVFICkpCisgICAgICAgICB7CisgICAgICAgICAgICBwU2Vzc2lvbkVudHJ5ID0gJnBNYWMtPmxpbS5ncFNlc3Npb25baV07CisgICAgICAgICAgICBycm1DYWNoZU1nbXRUeFBvd2VyICggcE1hYywgcE1heFR4UGFyYW1zLT5wb3dlciwgcFNlc3Npb25FbnRyeSApOworICAgICAgICAgfQorICAgICAgfQorICAgfQorICAgZWxzZQorICAgeworICAgICAgaWYoKHBTZXNzaW9uRW50cnkgPSBwZUZpbmRTZXNzaW9uQnlCc3NpZChwTWFjLCBwTWF4VHhQYXJhbXMtPmJzc0lkLCAmc2Vzc2lvbklkKSk9PU5VTEwpCisgICAgICB7CisgICAgICAgICBQRUxPR0UobGltTG9nKHBNYWMsIExPR0UsIEZMKCJVbmFibGUgdG8gZmluZCBzZXNzaW9uOiIpICk7KQorICAgICAgICAgcmV0Q29kZSA9IGVTSVJfRkFJTFVSRTsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgIHJybUNhY2hlTWdtdFR4UG93ZXIgKCBwTWFjLCBwTWF4VHhQYXJhbXMtPnBvd2VyLCBwU2Vzc2lvbkVudHJ5ICk7CisgICAgICB9CisgICB9CisKKyAgIHZvc19tZW1fZnJlZShsaW1Nc2dRLT5ib2R5cHRyKTsKKyAgIGxpbU1zZ1EtPmJvZHlwdHIgPSBOVUxMOworICAgcmV0dXJuIHJldENvZGU7Cit9CisvLyAtLS0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Vhc3VyZW1lbnQgcmVxdWVzdCIpOworCisgICBpZiggcFJ4UGFja2V0SW5mbyA9PSBOVUxMIHx8IHBMaW5rUmVxID09IE5VTEwgfHwgcFNlc3Npb25FbnRyeSA9PSBOVUxMICkKKyAgIHsKKyAgICAgIFBFTE9HRShsaW1Mb2coIHBNYWMsIExPR0UsCisgICAgICAgICAgICAgIiVzIEludmFsaWQgcGFyYW1ldGVycyAtIElnbm9yaW5nIHRoZSByZXF1ZXN0IiwgX19mdW5jX18pOykKKyAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICB9CisgICBwSGRyID0gV0RBX0dFVF9SWF9NQUNfSEVBREVSKCBwUnhQYWNrZXRJbmZvICk7CisgICBpZiggKHVpbnQ4KShwU2Vzc2lvbkVudHJ5LT5tYXhUeFBvd2VyKSAhPSBwTGlua1JlcS0+TWF4VHhQb3dlci5tYXhUeFBvd2VyICkKKyAgIHsKKyAgICAgIFBFTE9HVyhsaW1Mb2coIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICBMT0dXLAorICAgICAgICAgICAgICAgICAgICAgRkwoIiBtYXhUeCBwb3dlciBpbiBsaW5rIHJlcXVlc3QgaXMgbm90IHNhbWUgYXMgbG9jYWwuLi4gIgorICAgICAgICAgICAgICAgICAgICAgICAgIiBMb2NhbCA9ICVkIExpbmtSZXEgPSAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb25FbnRyeS0+bWF4VHhQb3dlciwKKyAgICAgICAgICAgICAgICAgICAgIHBMaW5rUmVxLT5NYXhUeFBvd2VyLm1heFR4UG93ZXIgKTspCisgICAgICBpZiggKE1JTl9TVEFfUFdSX0NBUF9EQk0gPD0gcExpbmtSZXEtPk1heFR4UG93ZXIubWF4VHhQb3dlcikgJiYKKyAgICAgICAgIChNQVhfU1RBX1BXUl9DQVBfREJNID49IHBMaW5rUmVxLT5NYXhUeFBvd2VyLm1heFR4UG93ZXIpICkKKyAgICAgIHsKKyAgICAgICAgIExpbmtSZXBvcnQudHhQb3dlciA9IHBMaW5rUmVxLT5NYXhUeFBvd2VyLm1heFR4UG93ZXI7CisgICAgICB9CisgICAgICBlbHNlIGlmKCBNSU5fU1RBX1BXUl9DQVBfREJNID4gcExpbmtSZXEtPk1heFR4UG93ZXIubWF4VHhQb3dlciApCisgICAgICB7CisgICAgICAgICBMaW5rUmVwb3J0LnR4UG93ZXIgPSBNSU5fU1RBX1BXUl9DQVBfREJNOworICAgICAgfQorICAgICAgZWxzZSBpZiggTUFYX1NUQV9QV1JfQ0FQX0RCTSA8IHBMaW5rUmVxLT5NYXhUeFBvd2VyLm1heFR4UG93ZXIgKQorICAgICAgeworICAgICAgICAgTGlua1JlcG9ydC50eFBvd2VyID0gTUFYX1NUQV9QV1JfQ0FQX0RCTTsKKyAgICAgIH0KKworICAgICAgaWYoIChMaW5rUmVwb3J0LnR4UG93ZXIgIT0gKHVpbnQ4KShwU2Vzc2lvbkVudHJ5LT5tYXhUeFBvd2VyKSkgJiYKKyAgICAgICAgICAoZVNJUl9TVUNDRVNTID09IHJybVNlbmRTZXRNYXhUeFBvd2VyUmVxICggcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRQb3dlcmRCbSkoTGlua1JlcG9ydC50eFBvd2VyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb25FbnRyeSkpICkKKyAgICAgIHsKKyAgICAgICAgIHBTZXNzaW9uRW50cnktPm1heFR4UG93ZXIgPSAodFBvd2VyZEJtKShMaW5rUmVwb3J0LnR4UG93ZXIpOworICAgICAgfQorICAgfQorICAgZWxzZQorICAgeworICAgICAgaWYoIChNSU5fU1RBX1BXUl9DQVBfREJNIDw9ICh1aW50OCkocFNlc3Npb25FbnRyeS0+bWF4VHhQb3dlcikpICYmCisgICAgICAgICAoTUFYX1NUQV9QV1JfQ0FQX0RCTSA+PSAodWludDgpKHBTZXNzaW9uRW50cnktPm1heFR4UG93ZXIpKSApCisgICAgICB7CisgICAgICAgICBMaW5rUmVwb3J0LnR4UG93ZXIgPSAodWludDgpKHBTZXNzaW9uRW50cnktPm1heFR4UG93ZXIpOworICAgICAgfQorICAgICAgZWxzZSBpZiggTUlOX1NUQV9QV1JfQ0FQX0RCTSA+ICh1aW50OCkocFNlc3Npb25FbnRyeS0+bWF4VHhQb3dlcikgKQorICAgICAgeworICAgICAgICAgTGlua1JlcG9ydC50eFBvd2VyID0gTUlOX1NUQV9QV1JfQ0FQX0RCTTsKKyAgICAgIH0KKyAgICAgIGVsc2UgaWYoIE1BWF9TVEFfUFdSX0NBUF9EQk0gPCAodWludDgpKHBTZXNzaW9uRW50cnktPm1heFR4UG93ZXIpICkKKyAgICAgIHsKKyAgICAgICAgIExpbmtSZXBvcnQudHhQb3dlciA9IE1BWF9TVEFfUFdSX0NBUF9EQk07CisgICAgICB9CisgICB9CisgICBQRUxPR1cobGltTG9nKCBwTWFjLAorICAgICAgICAgICAgICAgICAgTE9HVywKKyAgICAgICAgICAgICAgICAgIEZMKCIgbWF4VHggcG93ZXIgaW4gbGluayByZXF1ZXN0IGlzIG5vdCBzYW1lIGFzIGxvY2FsLi4uICIKKyAgICAgICAgICAgICAgICAgICAgICIgTG9jYWwgPSAlZCBMaW5rIFJlcG9ydCBUeFBvd2VyID0gJWQiKSwKKyAgICAgICAgICAgICAgICAgIHBTZXNzaW9uRW50cnktPm1heFR4UG93ZXIsCisgICAgICAgICAgICAgICAgICBMaW5rUmVwb3J0LnR4UG93ZXIgKTspCisKKyAgIExpbmtSZXBvcnQuZGlhbG9nVG9rZW4gPSBwTGlua1JlcS0+RGlhbG9nVG9rZW4udG9rZW47CisgICBMaW5rUmVwb3J0LnJ4QW50ZW5uYSA9IDA7CisgICBMaW5rUmVwb3J0LnR4QW50ZW5uYSA9IDA7CisgICBjdXJyZW50UlNTSSA9IFdEQV9HRVRfUlhfUlNTSV9EQihwUnhQYWNrZXRJ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0ICpwQmVhY29uUmVxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gcFNlc3Npb25FbnRyeSApCit7CisgICB0U2lyTXNnUSAgICAgICAgICAgICAgICAgIG1taE1zZzsKKyAgIHRwU2lyQmVhY29uUmVwb3J0UmVxSW5kIHBTbWVCY25SZXBvcnRSZXE7CisgICB0QU5JX1U4IG51bV9jaGFubmVscyA9IDAsIG51bV9BUENoYW5SZXBvcnQ7CisgICB0QU5JX1UxNiBtZWFzRHVyYXRpb24sIG1heE1lYXNkdXJhdGlvbjsKKyAgIHRBTklfUzggIG1heER1cmF0aW9uOworICAgdEFOSV9VOCAgc2lnbjsKKworICAgaWYoIHBCZWFjb25SZXEtPm1lYXN1cmVtZW50X3JlcXVlc3QuQmVhY29uLkJlYWNvblJlcG9ydGluZy5wcmVzZW50ICYmCisgICAgICAgKHBCZWFjb25SZXEtPm1lYXN1cmVtZW50X3JlcXVlc3QuQmVhY29uLkJlYWNvblJlcG9ydGluZy5yZXBvcnRpbmdDb25kaXRpb24gIT0gMCkgKQorICAgeworICAgICAgLy9SZXBlYXRlZCBtZWFzdXJlbWVudCBpcyBub3Qgc3VwcG9ydGVkLiBUaGlzIG1lYW5zIG51bWJlciBvZiByZXBldGl0aW9ucyBzaG91bGQgYmUgemVyby4oQWxyZWFkeSBjaGVja2VkKQorICAgICAgLy9BbGwgdGVzdCBjYXNlIGluIFZvV2lmaShhcyBvZiB2ZXJzaW9uIDAuMzYpICB1c2UgemVybyBmb3IgbnVtYmVyIG9mIHJlcGV0aXRpb25zLgorICAgICAgLy9CZWFjb24gcmVwb3J0aW5nIHNob3VsZCBub3QgYmUgaW5jbHVkZWQgaW4gcmVxdWVzdCBpZiBudW1iZXIgb2YgcmVwZXRpdG9ucyBpcyB6ZXJvLgorICAgICAgLy8gSUVFRSBTdGQgODAyLjExay0yMDA4IFRhYmxlIDctMjlnIGFuZCBzZWN0aW9uIDExLjEwLjguMQorCisgICAgICBQRUxPR0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XNlZCBpbiB0aGUgUlJNIGNhcGFiaWxpdGllcworCisgICAgICBtYXhNZWFzdXJlbWVudER1cmF0aW9uID0gMl4obm9uT3BlcmF0aW5nQ2hhbk1heCAtIDQpICogQmVhY29uSW50ZXJ2YWwKKyAgICAqLworICAgbWF4RHVyYXRpb24gPSBwTWFjLT5ycm0ucnJtUEVDb250ZXh0LnJybUVuYWJsZWRDYXBzLm5vbk9wZXJhdGluZ0NoYW5NYXggLSA0OworICAgc2lnbiA9IChtYXhEdXJhdGlvbiA8IDApID8gMSA6IDA7CisgICBtYXhEdXJhdGlvbiA9ICgxTCA8PCBBQlMobWF4RHVyYXRpb24pKTsKKyAgIGlmICghc2lnbikKKyAgICAgIG1heE1lYXNkdXJhdGlvbiA9IG1heER1cmF0aW9uICogcFNlc3Npb25FbnRyeS0+YmVhY29uUGFyYW1zLmJlYWNvbkludGVydmFsOworICAgZWxzZQorICAgICAgbWF4TWVhc2R1cmF0aW9uID0gcFNlc3Npb25FbnRyeS0+YmVhY29uUGFyYW1zLmJlYWNvbkludGVydmFsIC8gbWF4RHVyYXRpb247CisKKyAgIG1lYXNEdXJhdGlvbiA9IHBCZWFjb25SZXEtPm1lYXN1cmVtZW50X3JlcXVlc3QuQmVhY29uLm1lYXNfZHVyYXRpb247CisKKyAgIGxpbUxvZyggcE1hYywgTE9HMywKKyAgICAgICAgICAibWF4RHVyYXRpb24gPSAlZCBzaWduID0gJWQgbWF4TWVhc2R1cmF0aW9uID0gJWQgbWVhc0R1cmF0aW9uID0gJWQiLAorICAgICAgICAgIG1heER1cmF0aW9uLCBzaWduLCBtYXhNZWFzZHVyYXRpb24sIG1lYXNEdXJhdGlvbiApOworCisgICBpZiggbWF4TWVhc2R1cmF0aW9uIDwgbWVhc0R1cmF0aW9uICkKKyAgIHsKKyAgICAgIGlmKCBwQmVhY29uUmVxLT5kdXJhdGlvbk1hbmRhdG9yeSApCisgICAgICB7CisgICAgICAgICBQRUxPR0UobGltTG9nKCBwTWFjLCBMT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NEZXNjLT5pZUZpZWxkc1swXTsKKyAgIEJjbk51bUllcyA9ICh0QU5JX1U4KUdFVF9JRV9MRU5fSU5fQlNTKCBwQnNzRGVzYy0+bGVuZ3RoICk7CisKKyAgICpwTnVtSWVzID0gMDsKKworICAgKigodEFOSV9VMzIqKXBJZXMpID0gcEJzc0Rlc2MtPnRpbWVTdGFtcFswXTsKKyAgICpwTnVtSWVzKz1zaXplb2YodEFOSV9VMzIpOyBwSWVzKz1zaXplb2YodEFOSV9VMzIpOworICAgKigodEFOSV9VMzIqKXBJZXMpID0gcEJzc0Rlc2MtPnRpbWVTdGFtcFsxXTsKKyAgICpwTnVtSWVzKz1zaXplb2YodEFOSV9VMzIpOyBwSWVzKz1zaXplb2YodEFOSV9VMzIpOworICAgKigodEFOSV9VMTYqKXBJZXMpID0gIHBCc3NEZXNjLT5iZWFjb25JbnRlcnZhbDsKKyAgICpwTnVtSWVzKz1zaXplb2YodEFOSV9VMTYpOyBwSWVzKz1zaXplb2YodEFOSV9VMTYpOworICAgKigodEFOSV9VMTYqKXBJZXMpID0gcEJzc0Rlc2MtPmNhcGFiaWxpdHlJbmZvOworICAgKnBOdW1JZXMrPXNpemVvZih0QU5JX1UxNik7IHBJZXMrPXNpemVvZih0QU5JX1UxNik7CisKKyAgIHdoaWxlICggQmNuTnVtSWVzID4gMCApCisgICB7CisgICAgICBsZW4gPSAqKHBCY25JZXMgKyAxKSArIDI7IC8vZWxlbWVudCBpZCArIGxlbmd0aC4KKyAgICAgIGxpbUxvZyggcE1hYywgTE9HMywgIkVJRCA9ICVkLCBsZW4gPSAlZCB0b3RhbCA9ICVkIiwKKyAgICAgICAgICAgICAqcEJjbkllcywgKihwQmNuSWVzKzEpLCBsZW4gKTsKKworICAgICAgaSA9IDA7CisgICAgICBkbworICAgICAgeworICAgICAgICAgaWYoICggKGVpZHMgPT0gTlVMTCkgfHwgKCAqcEJjbkllcyA9PSBlaWRzW2ldICkgKSAgJiYKKyAgICAgICAgICAgICAoICgqcE51bUllcykgKyBsZW4pIDwgcEllc01heFNpemUgKQorICAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0czLCAiQWRkaW5nIEVpZCAlZCwgbGVuPSVkIiwgKnBCY25JZXMsIGxlbiApOworCisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocEllcywgcEJjbkllcywgbGVuKTsKKyAgICAgICAgICAgIHBJZXMgKz0gbGVuOworICAgICAgICAgICAgKnBOdW1JZXMgKz0gbGVuOworICAgICAgICAgICAgY291bnQrKzsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgfQorICAgICAgICAgaSsrOworICAgICAgfXdoaWxlKCBpIDwgbnVtRWlkcyApOworCisgICAgICBwQmNuSWVzICs9IGxlbjsKKyAgICAgIEJjbk51bUllcyAtPSBsZW47CisgICB9CisgICBsaW1Mb2coIHBNYWMsIExPRzEsICJUb3RhbCBsZW5ndGggb2YgSWVzIGFkZGVkID0gJWQiLCAqcE51bUllcyApOworfQorCisvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorLyoqCisgKiBycm1Qcm9jZXNzQmVhY29uUmVwb3J0WG1pdAorICoKKyAqIEZVTkNUSU9OOgorICoKKyAqIExPR0lDOiBDcmVhdGUgYSBSYWRpbyBtZWFzdXJlbWVudCByZXBvcnQgYWN0aW9uIGZyYW1lIGFuZCBzZW5kIGl0IHRvIHBlZXIuCisgKgorICogQVNTVU1QVElPTlM6CisgKgorICogTk9URToKKyAqCisgKiBAcGFyYW0gcEJjblJlcG9ydCBEYXRhIGZvciBiZWFjb24gcmVwb3J0IElFIGZyb20gU01FLgorICogQHJldHVybiBOb25lCisgKi8KK3RTaXJSZXRTdGF0dXMKK3JybVByb2Nlc3NCZWFjb25SZXBvcnRYbWl0KCB0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAg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gcEJjblJlcG9ydC0+bnVtQnNzRGVzYyA9IChwQmNuUmVwb3J0LT5udW1Cc3NEZXNjID09IFJSTV9CQ05fUlBUX05PX0JTU19JTkZPKT8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSUk1fQkNOX1JQVF9NSU5fUlBUIDogcEJjblJlcG9ydC0+bnVtQnNzRGVzYzsKKworICAgICAgaWYgKE5VTEwgPT0gKHBTZXNzaW9uRW50cnkgPSBwZUZpbmRTZXNzaW9uQnlCc3NpZChwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQmNuUmVwb3J0LT5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnNlc3Npb25JZCkpKQorICAgICAgeworICAgICAgICAgUEVMT0dFKGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgic2Vzc2lvbiBkb2VzIG5vdCBleGlzdCBmb3IgZ2l2ZW4gYnNzSWQiKSk7KQorICAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICAgIH0KKworICAgICAgcFJlcG9ydCA9IHZvc19tZW1fbWFsbG9jKHBCY25SZXBvcnQtPm51bUJzc0Rlc2MgKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNSYWRpb01lYXN1cmVSZXBvcnQpKTsKKworICAgICAgaWYgKE5VTEwgPT0gcFJlcG9ydCkKKyAgICAgIHsKKyAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwgRkwoIlJSTSBSZXBvcnQgaXMgTlVMTCwgYWxsb2NhdGlvbiBmYWlsZWQiKSk7KQorICAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICAgIH0KKworICAgICAgdm9zX21lbV96ZXJvKCBwUmVwb3J0LAorICAgICAgICAgICAgICAgICAgICBwQmNuUmVwb3J0LT5udW1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ApCisgICAgICAgICB7CisgICAgICAgICAgICBwUmVwb3J0W2Jzc0Rlc2NDbnRdLnJlcG9ydC5iZWFjb25SZXBvcnQucmVnQ2xhc3MgPSAgcEJjblJlcG9ydC0+cmVnQ2xhc3M7CisgICAgICAgICAgICBpZiAoIGZsYWdCU1NQcmVzZW50ICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHBSZXBvcnRbYnNzRGVzY0NudF0ucmVwb3J0LmJlYWNvblJlcG9ydC5jaGFubmVsID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCY25SZXBvcnQtPnBCc3NEZXNjcmlwdGlvbltic3NEZXNjQ250XS0+Y2hhbm5lbElkOworICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCBwUmVwb3J0W2Jzc0Rlc2NDbnRdLnJlcG9ydC5iZWFjb25SZXBvcnQubWVhc1N0YXJ0VGltZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJjblJlcG9ydC0+cEJzc0Rlc2NyaXB0aW9uW2Jzc0Rlc2NDbnRdLT5zdGFydFRTRiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCBwQmNuUmVwb3J0LT5wQnNzRGVzY3JpcHRpb25bYnNzRGVzY0NudF0tPnN0YXJ0VFNGKSApOworICAgICAgICAgICAgICAgcFJlcG9ydFtic3NEZXNjQ250XS5yZXBvcnQuYmVhY29uUmVwb3J0Lm1lYXNEdXJhdGlvbiA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTWVNfTVNfVE9fVFUocEJjblJlcG9ydC0+ZHVyYXRpb24pOworICAgICAgICAgICAgICAgcFJlcG9ydFtic3NEZXNjQ250XS5yZXBvcnQuYmVhY29uUmVwb3J0LnBoeVR5cGUgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQmNuUmVwb3J0LT5wQnNzRGVzY3JpcHRpb25bYnNzRGVzY0NudF0tPm53VHlwZTsKKyAgICAgICAgICAgICAgIHBSZXBvcnRbYnNzRGVzY0NudF0ucmVwb3J0LmJlYWNvblJlcG9ydC5iY25Qcm9iZVJzcCA9IDE7CisgICAgICAgICAgICAgICBwUmVwb3J0W2Jzc0Rlc2NDbnRdLnJlcG9ydC5iZWFjb25SZXBvcnQucnNuaSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCY25SZXBvcnQtPnBCc3NEZXNjcmlwdGlvbltic3NEZXNjQ250XS0+c2lucjsKKyAgICAgICAgICAgICAgIHBSZXBvcnRbYnNzRGVzY0NudF0ucmVwb3J0LmJlYWNvblJlcG9ydC5yY3BpID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJjblJlcG9ydC0+cEJzc0Rlc2NyaXB0aW9uW2Jzc0Rlc2NDbnRdLT5yc3NpOworCisgICAgICAgICAgICAgICBwUmVwb3J0W2Jzc0Rlc2NDbnRdLnJlcG9ydC5iZWFjb25SZXBvcnQuYW50ZW5uYUlkID0gMDsKKyAgICAgICAgICAgICAgIHBSZXBvcnRbYnNzRGVzY0NudF0ucmVwb3J0LmJlYWNvblJlcG9ydC5wYXJlbnRUU0YgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQmNuUmVwb3J0LT5wQnNzRGVzY3JpcHRpb25bYnNzRGVzY0NudF0tPnBhcmVudFRTRjsKKyAgICAgICAgICAgICAgIHZvc19tZW1fY29weSggcFJlcG9ydFtic3NEZXNjQ250XS5yZXBvcnQuYmVhY29uUmVwb3J0LmJzc2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQmNuUmVwb3J0LT5wQnNzRGVzY3JpcHRpb25bYnNzRGVzY0NudF0tPmJzc0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc3dpdGNoICggcEN1cnJlbnRSZXEtPnJlcXVlc3QuQmVhY29uLnJlcG9ydGluZ0RldGFpbCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBjYXNlIEJFQUNPTl9SRVBPUlRJTkdfREVUQUlMX05PX0ZGX0lFOgorICAgICAgICAgICAgICAgLy8wIE5vIG5lZWQgdG8gaW5jbHVkZSBhbnkgZWxlbWVudHMuCisgICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzMsICJObyByZXBvcnRpbmcgZGV0YWlsIHJlcXVlc3RlZCIpOworICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICBjYXNlIEJFQUNPTl9SRVBPUlRJTkdfREVUQUlMX0FMTF9GRl9SRVFfSUU6CisgICAgICAgICAgICAgICAvLzE6IEluY2x1ZGUgYWxsIEZGcyBhbmQgUmVxdWVzdGVkIEllcy4KKyAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0czLAorICAgICAgICAgICAgICAgIk9ubHkgcmVxdWVzdGVkIElFcyBpbiByZXBvcnRpbmcgZGV0YWlsIHJlcXVlc3RlZCIpOworCisgICAgICAgICAgICAgICBpZiAoIGZsYWdCU1NQcmVzZW50ICkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBycm1GaWxsQmVhY29uSWVzKCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4KikgJnBSZXBvcnRbYnNzRGVzY0NudF0ucmVwb3J0LmJlYWNvblJlcG9ydC5JZXNbMF0sCisgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTgqKSAmcFJlcG9ydFtic3NEZXNjQ250XS5yZXBvcnQuYmVhY29uUmVwb3J0Lm51bUllcywKKyAgICAgICAgICAgICAgICAgICAgICBCRUFDT05fUkVQT1JUX01BWF9JRVMsCisgICAgICAgICAgICAgICAgICAgICAgcEN1cnJlbnRSZXEtPnJlcXVlc3QuQmVhY29uLnJlcUllcy5wRWxlbWVudElkcywKKyAgICAgICAgICAgICAgICAgICAgICBwQ3VycmVudFJlcS0+cmVxdWVzdC5CZWFjb24ucmVxSWVzLm51bSwKKyAgICAgICAgICAgICAgICAgICAgICBwQmNuUmVwb3J0LT5wQnNzRGVzY3JpcHRpb25bYnNzRGVzY0NudF0gKTsKKyAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICBjYXNlIEJFQUNPTl9SRVBPUlRJTkdfREVUQUlMX0FMTF9GRl9JRToKKyAgICAgICAgICAgICAgIC8vMiAvIGRlZmF1bHQgLSBJbmNsdWRlIGFsbCBGRnMgYW5kIGFsbCBJZXMuCisgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgbGltTG9nKHBNYWMsIExPRzMsICJEZWZhdWx0IGFsbCBJRXMgYW5kIEZGcyIpOworICAgICAgICAgICAgICAgaWYgKCBmbGFnQlNTUHJlc2VudCApCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgcnJtRmlsbEJlYWNvbkllcyggcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCopICZwUmVwb3J0W2Jzc0Rlc2NDbnRdLnJlcG9ydC5iZWFjb25SZXBvcnQuSWVzWzBdLAorICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4KikgJnBSZXBvcnRbYnNzRGVzY0NudF0ucmVwb3J0LmJlYWNvblJlcG9ydC5udW1JZXMsCisgICAgICAgICAgICAgICAgICAgICAgQkVBQ09OX1JFUE9SVF9NQVhfSUVTLAorICAgICAgICAgICAgICAgICAgICAgIE5VTEwsIDAsCisgICAgICAgICAgICAgICAgICAgICAgcEJjblJlcG9ydC0+cEJzc0Rlc2NyaXB0aW9uW2Jzc0Rlc2NDbnRdICk7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgIH0KKworICAgICAgbGltTG9nKCBwTWFjLCBMT0cxLCAiU2VuZGluZyBBY3Rpb24gZnJhbWUgd2l0aCAlZCBic3MgaW5mbyIsIGJzc0Rlc2NDbnQpOworICAgICAgbGltU2VuZFJhZGlvTWVhc3VyZVJlcG9ydEFjdGlvbkZyYW1lKCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ3VycmVudFJlcS0+ZGlhbG9nX3Rva2VuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBic3NEZXNjQ250LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUmVwb3J0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQmNuUmVwb3J0LT5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb25FbnRyeSApOworCisgICAgICBwQ3VycmVudFJlcS0+c2VuZEVtcHR5QmNuUnB0ID0gZmFsc2U7CisgICB9CisKKyAgIGlmKCBwQmNuUmVwb3J0LT5mTWVhc3VyZURvbmUgKQorICAgeworICAgICAgbGltTG9nKCBwTWFjLCBMT0czLCAiTWVhc3VyZW1lbnQgZG9uZS4uLi5jbGVhbnVwIHRoZSBjb250ZXh0Iik7CisKKyAgICAgIHJybUNsZWFudXAocE1hYyk7CisgICB9CisKKyAgIGlmKCBOVUxMICE9IHBSZXBvcnQgKQorICAgICAgdm9zX21lbV9mcmVlKHBSZXBvcnQpOworCisgICByZXR1cm4gc3RhdHVzOworfQorCit2b2lkIHJybVByb2Nlc3NCZWFjb25SZXF1ZXN0RmFpbHVyZSh0cEFuaVNpckdsb2JhbCBwTWFjLCB0cFBFU2Vzc2lvbiBwU2Vzc2lvbkVudHJ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY0FkZHIgcGVlciwgdFJybVJldFN0YXR1cyBzdGF0dXMpCit7CisgICAgdHBTaXJNYWNSYWRpb01lYXN1cmVSZXBvcnQgcFJlcG9ydCA9IE5VTEw7CisgICAgdHBSUk1SZXEgcEN1cnJlbnRSZXEgPSBwTWFjLT5ycm0ucnJtUEVDb250ZXh0LnBDdXJyZW50UmVxOworCisgICAgcFJlcG9ydCA9IHZvc19tZW1fbWFsbG9jKHNpemVvZiggdFNpck1hY1JhZGlvTWVhc3VyZVJlcG9ydCApKTsKKyAgICBpZiAoIE5VTEwgPT0gcFJlcG9ydCApCisgICAgeworICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgRkwoICJVbmFibGUgdG8gYWxsb2NhdGUgbWVtb3J5IGR1cmluZyBSUk0gUmVxIHByb2Nlc3NpbmciICkpOworICAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICB2b3NfbWVtX3NldChwUmVwb3J0LCBzaXplb2YodFNpck1hY1JhZGlvTWVhc3VyZVJlcG9ydCksIDApOworICAgIHBSZXBvcnQtPnRva2VuID0gcEN1cnJlbnRSZXEtPnRva2VuOworICAgIHBSZXBvcnQtPnR5cGUgPSBTSVJfTUFDX1JSTV9CRUFDT05fVFlQRTsKKworICAgIHN3aXRjaCAoc3RhdHVzKQorICAgIHsKKyAgICAgICAgY2FzZSBlUlJNX1JFRlVTRUQ6CisgICAgICAgICAgICBwUmVwb3J0LT5yZWZ1c2VkID0gMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVSUk1fSU5DQVBBQkxFOgorICAgICAgICAgICAgcFJlcG9ydC0+aW5jYXBhYmxlID0gMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgUEVMT0dFKGxpbUxvZyggcE1hYywgTE9HRSwKKyAgICAgICAgICAgICBGTCgiIEJlYWNvbiByZXF1ZXN0IHByb2Nlc3NpbmcgZmFpbGVkIG5vIHJlcG9ydCBzZW50IHdpdGggc3RhdHVzICVkICIpLAorICAgICAgICAgICAgIHN0YXR1cyk7KTsKKyAgICAgICAgICAgIHZvc19tZW1fZnJl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ICAgICAgICAgICAgICAgIHRTaXJNYWNBZGRyIHBlZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZlJhZGlvTWVhc3VyZW1lbnRSZXF1ZXN0ICpwUlJNUmVxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uIHBTZXNzaW9uRW50cnkgKQoreworICAgdEFOSV9VOCBpOworICAgdFNpclJldFN0YXR1cyBzdGF0dXMgPSBlU0lSX1NVQ0NFU1M7CisgICB0cFNpck1hY1JhZGlvTWVhc3VyZVJlcG9ydCBwUmVwb3J0ID0gTlVMTDsKKyAgIHRBTklfVTggbnVtX3JlcG9ydCA9IDA7CisgICB0cFJSTVJlcSBwQ3VycmVudFJlcSA9IHBNYWMtPnJybS5ycm1QRUNvbnRleHQucEN1cnJlbnRSZXE7CisgICB0UnJtUmV0U3RhdHVzICAgIHJybVN0YXR1cyA9IGVSUk1fU1VDQ0VTUzsKKworICAgaWYoICFwUlJNUmVxLT5udW1fTWVhc3VyZW1lbnRSZXF1ZXN0ICkKKyAgIHsKKyAgICAgIC8vTm8gbWVhc3VyZW1lbnQgcmVxdWVzdHMuLi4uCisgICAgICAvLworICAgICAgcFJlcG9ydCA9IHZvc19tZW1fbWFsbG9jKHNpemVvZiggdFNpck1hY1JhZGlvTWVhc3VyZVJlcG9ydCApKTsKKyAgICAgIGlmICggTlVMTCA9PSAgcFJlcG9ydCApCisgICAgICB7CisgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICBGTCggIlVuYWJsZSB0byBhbGxvY2F0ZSBtZW1vcnkgZHVyaW5nIFJSTSBSZXEgcHJvY2Vzc2luZyIgKSk7CisgICAgICAgICByZXR1cm4gZVNJUl9NRU1fQUxMT0NfRkFJTEVEOworICAgICAgfQorICAgICAgdm9zX21lbV9zZXQocFJlcG9ydCwgc2l6ZW9mKHRTaXJNYWNSYWRpb01lYXN1cmVSZXBvcnQpLDAp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0U2lyTWFjUmFkaW9NZWFzdXJlUmVwb3J0ICkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIChwUlJNUmVxLT5udW1fTWVhc3VyZW1lbnRSZXF1ZXN0IC0gaSkpOworICAgICAgICAgICAgICAgICAgaWYgKCBOVUxMID09IHBSZXBvcnQgKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dQLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoICJVbmFibGUgdG8gYWxsb2NhdGUgbWVtb3J5IGR1cmluZyBSUk0gUmVxIHByb2Nlc3NpbmciICkpOworICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVTSVJfTUVNX0FMTE9DX0ZBSUxFRDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHZvc19tZW1fc2V0KHBSZXBvcnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoIHRTaXJNYWNSYWRpb01lYXN1cmVSZXBvcnQgKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAocFJSTVJlcS0+bnVtX01lYXN1cmVtZW50UmVxdWVzdCAtIGkpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCk7CisgICAgICAgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPRzMsCisgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIiBycm0gYmVhY29uIHR5cGUgcmVmdXNlZCBvZiAlZCByZXBvcnQgaW4gYmVhY29uIHRhYmxlIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgbnVtX3JlcG9ydCApOworCisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICBwUmVwb3J0W251bV9yZXBvcnRdLnJlZnVzZWQgPSAxOworICAgICAgICAgICAgICAgcFJlcG9ydFtudW1fcmVwb3J0XS50eXBlID0gU0lSX01BQ19SUk1fQkVBQ09OX1RZUEU7CisgICAgICAgICAgICAgICBwUmVwb3J0W251bV9yZXBvcnRdLnRva2VuID0gcFJSTVJlcS0+TWVhc3VyZW1lbnRSZXF1ZXN0W2ldLm1lYXN1cmVtZW50X3Rva2VuOworICAgICAgICAgICAgICAgbnVtX3JlcG9ydCsrOworICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBwQ3VycmVudFJlcSA9IHZvc19tZW1fbWFsbG9jKHNpemVvZiggKnBDdXJyZW50UmVxICkpOworICAgICAgICAgICAgICAgaWYgKCBOVUxMID09IHBDdXJyZW50UmVxICkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICAgICAgIEZMKCAiVW5hYmxlIHRvIGFsbG9jYXRlIG1lbW9yeSBkdXJpbmcgUlJNIFJlcSBwcm9jZXNzaW5nIiApKTsKKyAgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwUmVwb3J0KTsKKyAgICAgICAgICAgICAgICAgIHJldHVybiBlU0lSX01FTV9BTExPQ19GQUlMRUQ7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPRzMsIEZMKCIgUHJvY2Vzc2luZyBCZWFjb24gUmVwb3J0IHJlcXVlc3QiKSApOworICAgICAgICAgICAgICAgIHZvc19tZW1fc2V0KHBDdXJyZW50UmVxLCBzaXplb2YoICpwQ3VycmVudFJlcSApLCAwKTsKKyAgICAgICAgICAgICAgIHBDdXJyZW50UmVxLT5kaWFsb2dfdG9rZW4gPSBwUlJNUmVxLT5EaWFsb2dUb2tlbi50b2tlbjsKKyAgICAgICAgICAgICAgIHBDdXJyZW50UmVxLT50b2tlbiA9IHBSUk1SZXEtPk1lYXN1cmVtZW50UmVxdWVzdFtpXS5tZWFzdXJlbWVudF90b2tlbjsKKyAgICAgICAgICAgICAgIHBDdXJyZW50UmVxLT5zZW5kRW1wdHlCY25ScHQgPSB0cnVlOworICAgICAgICAgICAgICAgcE1hYy0+cnJtLnJybVBFQ29udGV4dC5wQ3VycmVudFJlcSA9IHBDdXJyZW50UmVxOworICAgICAgICAgICAgICAgcnJtU3RhdHVzID0gcnJtUHJvY2Vzc0JlYWNvblJlcG9ydFJlcSggcE1hYywgcEN1cnJlbnRSZXEsICZwUlJNUmVxLT5NZWFzdXJlbWVudFJlcXVlc3RbaV0sIHBTZXNzaW9uRW50cnkgKTsKKyAgICAgICAgICAgICAgIGlmIChlUlJNX1NVQ0NFU1MgIT0gcnJtU3RhdHVzKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIHJybVByb2Nlc3NCZWFjb25SZXF1ZXN0RmFpbHVyZShwTWFjLCBwU2Vzc2lvbkVudHJ5LCBwZWVyLCBycm1TdGF0dXMpOworICAgICAgICAgICAgICAgICAgIHJybUNsZWFudXAocE1hYyk7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAvL1NlbmQgYSByZXBvcnQgd2l0aCBpbmNhcGFiYWxlIGJpdCBzZXQuCisgICAgICAgICAgICBpZiAoIHBSZXBvcnQgPT0gTlVMTCApIC8vQWxsb2NhdGUgbWVtb3J5IHRvIHNlbmQgcmVwb3J0cyBmb3IgYW55IHN1YnNlcXVlbnQgcmVxdWVzdHMuCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBwUmVwb3J0ID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKCB0U2lyTWFjUmFkaW9NZWFzdXJlUmVwb3J0ICkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAocFJSTVJlcS0+bnVtX01lYXN1cmVtZW50UmVxdWVzdCAtIGkpKTsKKyAgICAgICAgICAgICAgIGlmICggTlVMTCA9PSBwUmVwb3J0ICkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGxpbUxvZyggcE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICAgICAgICAgIEZMKCAiVW5hYmxlIHRvIGFsbG9jYXRlIG1lbW9yeSBkdXJpbmcgUlJNIFJlcSBwcm9jZXNzaW5nIiApKTsKKyAgICAgICAgICAgICAgICAgIHJldHVybiBlU0lSX01FTV9BTExPQ19GQUlMRUQ7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICB2b3NfbWVtX3NldChwUmVwb3J0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCB0U2lyTWFjUmFkaW9NZWFzdXJlUmVwb3J0ICkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICogKHBSUk1SZXEtPm51bV9NZWFzdXJlbWVudFJlcXVlc3QgLSBpKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIDApOworICAgICAgICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0czLAorICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCIgcnJtIGJlYWNvbiB0eXBlIGluY2FwYmxlIG9mICVkIHJlcG9ydCAiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBudW1fcmVwb3J0ICk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwUmVwb3J0W251bV9yZXBvcnRdLmluY2FwYWJsZSA9IDE7CisgICAgICAgICAgICBwUmVwb3J0W251bV9yZXBvcnRdLnR5cGUgPSBwUlJNUmVxLT5NZWFzdXJlbWVudFJlcXVlc3RbaV0ubWVhc3VyZW1lbnRfdHlwZTsKKyAgICAgICAgICAgIHBSZXBvcnRbbnVtX3JlcG9ydF0udG9rZW4gPSBwUlJNUmVxLT5NZWFzdXJlbWVudFJlcXVlc3RbaV0ubWVhc3VyZW1lbnRfdG9rZW47CisgICAgICAgICAgICBudW1fcmVwb3J0Kys7CisgICAgICAgICAgICBicmVhazsKKyAgICAgIH0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LS0tLS0tLS0tLS0tLS0tCisvKioKKyAqIHNjaFBvc3RNZXNzYWdlCisgKgorICogRlVOQ1RJT046CisgKiBQb3N0IHRoZSBiZWFjb24gbWVzc2FnZSB0byB0aGUgc2NoZWR1bGVyIG1lc3NhZ2UgcXVldWUKKyAqCisgKiBMT0dJQzoKKyAqCisgKiBBU1NVTVBUSU9OUzoKKyAqCisgKiBOT1RFOgorICoKKyAqIEBwYXJhbSBwTXNnIHBvaW50ZXIgdG8gbWVzc2FnZQorICogQHJldHVybiBOb25lCisgKi8KKwordFNpclJldFN0YXR1cworc2NoUG9zdE1lc3NhZ2UodHBBbmlTaXJHbG9iYWwgcE1hYywgdHBTaXJNc2dRIHBNc2cpCit7CisgICAgc2NoUHJvY2Vzc01lc3NhZ2UocE1hYywgcE1zZyk7CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworfQorCisKKworCisKKy8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorLyoqCisgKiBzY2hTZW5kU3RhcnRTY2FuUnNwCisgKgorICogRlVOQ1RJT046CisgKgorICogTE9HSUM6CisgKgorICogQVNTVU1QVElPTlM6CisgKgorICogTk9URToKKyAqCisgKiBAcGFyYW0gTm9uZQorICogQHJldHVybiBOb25lCisgKi8KKwordm9pZAorc2NoU2VuZFN0YXJ0U2NhblJzcCh0cEFuaVNpckdsb2JhbCBwTWFjKQoreworICAgIHRTaXJNc2dRICAgICAgICBtc2dROworICAgIHRBTklfVTMyICAgICAgICByZXRDb2RlOworCisgICAgc2NoTG9nKHBNYWMsIExPRzEsIEZMKCJTZW5kaW5nIFNJUl9TQ0hfU1RBUlRfU0NBTl9SU1AgdG8gTElNIikpOworICAgIG1zZ1EudHlwZSA9IFNJUl9TQ0hfU1RBUlRfU0NBTl9SU1A7CisgICAgaWYgKChyZXRDb2RlID0gbGltUG9zdE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lJTUF9UTVBMKSkpCisgICAgICApCisKKyAgICB7CisgICAgICAgIHNjaExvZyhwTWFjLCBMT0cxLCBGTCgiU2VuZGluZyBwcm9iZVJzcCBUZW1wbGF0ZSB0byBIQUwiKSk7CisgICAgICAgIGlmKGVTSVJfU1VDQ0VTUyAhPSAocmV0Q29kZSA9IGxpbVNlbmRQcm9iZVJzcFRlbXBsYXRlVG9IYWwocE1hYyxwc2Vzc2lvbkVudHJ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBzZXNzaW9uRW50cnktPkRlZlByb2JlUnNwSWVCaXRtYXBbMF0pKSkKKyAgICAgICAgeworICAgICAgICAgICAgLyogY2hlY2sgd2hldGhlciB3ZSBoYXZlIHRvIGZyZWUgYW55IG1lbW9yeSAqLworICAgICAgICAgICAgc2NoTG9nKHBNYWMsIExPR0UsIEZMKCJGQUlMRUQgdG8gc2VuZCBwcm9iZSByZXNwb25zZSB0ZW1wbGF0ZSB3aXRoIHJldENvZGUgJWQiKSwgcmV0Q29kZSk7CisgICAgICAgIH0KKyAgICB9CisgIH0KKworICByZXR1cm4gcmV0Q29kZTsKK30KKwordEFOSV9VMzIgbGltU2VuZFByb2JlUnNwVGVtcGxhdGVUb0hhbCh0cEFuaVNpckdsb2JhbCBwTWFjLHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAsdEFOSV9VMzIqIEllQml0bWFwKQoreworICAgIHRTaXJNc2dRICBtc2dROworICAgIHRBTklfVTggKnBGcmFtZTJIYWwgPSBwTWFjLT5zY2guc2NoT2JqZWN0LmdTY2hQcm9iZVJzcFRlbXBsYXRlOworICAgIHRwU2VuZFByb2JlUmVzcFBhcmFtcyBwcHJvYmVSZXNwUGFyYW1zPU5VTEw7CisgICAgdEFOSV9VMzIgIHJldENvZGUgPSBlU0lSX0ZBSUxVUkU7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgblBheWxvYWQsbkJ5dGVzLG5TdGF0dXM7CisgICAgdHBTaXJNYWNNZ210SGRyICAgICAgcE1hY0hkcjsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICBhZGRuSUVQcmVzZW50OworICAgIHRBTklfVTMyICAgICAgICAgICAgIGFkZG5JRUxlbj0wOworICAgIHRTaXJSZXRTdGF0dXMgICAgICAgIG5TaXJTdGF0dXM7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgKmFkZElFID0gTlVMTDsKKworICAgIG5TdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRQcm9iZVJlc3BvbnNlU2l6ZSggcE1hYywgJnBzZXNzaW9uRW50cnktPnByb2JlUmVzcEZyYW1lLCAmblBheWxvYWQgKTsKKyAgICBpZiAoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSApCisgICAgeworICAgICAgICBzY2hMb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gY2FsY3VsYXRlIHRoZSBwYWNrZWQgc2l6ZSBmIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvciBhIFByb2JlIFJlc3BvbnNlICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgIG5TdGF0dXMgKTsKKyAgICAgICAgLy8gV2UnbGwgZmFsbCBiYWNrIG9uIHRoZSB3b3JzdCBjYXNlIHNjZW5hcmlvOgorICAgICAgICBuUGF5bG9hZCA9IHNpemVvZiggdERvdDExZlByb2JlUmVzcG9uc2UgKTsKKyAgICB9CisgICAgZWxzZSBpZiAoIERPVDExRl9XQVJORUQoIG5TdGF0dXMgKSApCisgICAgeworICAgICAgICBzY2hMb2coIHBNYWMsIExPR0UsIEZMKCJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIGNhbGN1bGF0aW5nIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0aGUgcGFja2VkIHNpemUgZm9yIGEgUHJvYmUgUmVzcG9uc2UgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIoMHglMDh4KS4iKSwgblN0YXR1cyApOworICAgIH0KKworICAgIG5CeXRlcyA9IG5QYXlsb2FkICsgc2l6ZW9mKCB0U2lyTWFjTWdtdEhkciApOworCisgICAgLy9DaGVjayBpZiBwcm9iZSByZXNwb25zZSBJRSBpcyBwcmVzZW50IG9yIG5vdAorICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX1BST0JFX1JTUF9BREROSUVfRkxBRywgJmFkZG5JRVByZXNlbnQpICE9IGVTSVJfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIHNjaExvZyhwTWFjLCBMT0dFLCBGTCgiVW5hYmxlIHRvIGdldCBXTklfQ0ZHX1BST0JFX1JTUF9BREROSUVfRkxBRyIpKTsKKyAgICAgICAgcmV0dXJuIHJldENvZGU7CisgICAgfQorCisgICAgaWYgKGFkZG5JRVByZXNlbnQpCisgICAgeworICAgICAgICAvL1Byb2JlIHJzcCBJRSBhdmFpbGFibGUKKyAgICAgICAgYWRkSUUgPSB2b3NfbWVtX21hbGxvYyhXTklfQ0ZHX1BST0JFX1JTUF9BREROSUVfREFUQTFfTEVOKTsKKyAgICAgICAgaWYgKCBOVUxMID09IGFkZElFICkKKyAgICAgICAgeworICAgICAgICAgICAgIHNjaExvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICBGTCgiVW5hYmxlIHRvIGdldCBXTklfQ0ZHX1BST0JFX1JTUF9BREROSUVfREFUQTEgbGVuZ3RoIikpOworICAgICAgICAgICAgIHJldHVybiByZXRDb2RlOworICAgICAgICB9CisKKyAgICAgICAgaWYgKHdsYW5fY2ZnR2V0U3RyTGVuKHBNYWMsIFdOSV9DRkdfUFJPQkVfUlNQX0FERE5JRV9EQVRBMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmFkZG5JRUxlbikgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICBzY2hMb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICBGTCgiVW5hYmxlIHRvIGdldCBXTklfQ0ZHX1BST0JFX1JTUF9BREROSUVfREFUQTEgbGVuZ3RoIikpOworCisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUoYWRkSUUpOworICAgICAgICAgICAgcmV0dXJuIHJldENvZGU7CisgICAgICAgIH0KKworICAgICAgICBpZiAoYWRkbklFTGVuIDw9IFdOSV9DRkdfUFJPQkVfUlNQX0FERE5JRV9EQVRBMV9MRU4gJiYgYWRkbklFTGVuICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobkJ5dGVzICsgYWRkbklFTGVuKSA8PSBTSVJfTUFYX1BBQ0tFVF9TSVpFKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoIGVTSVJfU1VDQ0VTUyAhPSB3bGFuX2NmZ0dldFN0cihwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19QUk9CRV9SU1BfQURETklFX0RBVEExLCAmYWRkSUVbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmYWRkbklFTGVuKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBzY2hMb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICBGTCgiVW5hYmxlIHRvIGdldCBXTklfQ0ZHX1BST0JFX1JTUF9BREROSUVfREFUQTEgU3RyaW5nIikpOworCisgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUoYWRkSUUpOworICAgICAgICAgICAgICAgcmV0dXJuIHJldENvZGU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBpZiAoYWRkbklFUHJlc2VudCkKKyAgICB7CisgICAgICAgIGlmICgobkJ5dGVzICsgYWRkbklFTGVuKSA8PSBTSVJfTUFYX1BBQ0tFVF9TSVpFICkKKyAgICAgICAgICAgIG5CeXRlcyArPSBhZGRuSUVMZW47CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGFkZG5JRVByZXNlbnQgPSBmYWxzZTsgLy9Eb250IGluY2x1ZGUgdGhlIElFLgorICAgIH0KKworICAgIC8vIFBhcmFub2lhOgorICAgIHZvc19tZW1fc2V0KHBGcmFtZTJIYWwsIG5CeXRlcywgMCk7CisKKyAgICAvLyBOZXh0LCB3ZSBmaWxsIG91dCB0aGUgYnVmZmVyIGRlc2NyaXB0b3I6CisgICAgblNpclN0YXR1cyA9IGxpbVBvcHVsYXRlTWFjSGVhZGVyKCBwTWFjLCBwRnJhbWUySGFsLCBTSVJfTUFDX01HTVRfRlJBTUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfTUdNVF9QUk9CRV9SU1AsIHBzZXNzaW9uRW50cnktPnNlbGZNYWNBZGRyLHBzZXNzaW9uRW50cnktPnNlbGZNYWNBZGRyKTsKKworICAgIGlmICggZVNJUl9TVUNDRVNTICE9IG5TaXJTdGF0dXMgKQorICAgIHsKKyAgICAgICAgc2NoTG9nKCBwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIHBvcHVsYXRlIHRoZSBidWZmZXIgZGVzY3JpcCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAidG9yIGZvciBhIFByb2JlIFJlc3BvbnNlICglZCkuIiksCisgICAgICAgICAgICAgICAgblNpclN0YXR1cyApOworCisgICAgICAgIHZvc19tZW1fZnJlZShhZGRJRSk7CisgICAgICAgIHJldHVybiByZXRDb2RlOworICAgIH0KKworICAgIHBNYWNIZHIgPSAoIHRwU2lyTWFjTWdtdEhkciApIHBGcmFtZTJIYWw7CisKKyAgICBzaXJDb3B5TWFjQWRkcihwTWFjSGRyLT5ic3NJZCxwc2Vzc2lvbkVudHJ5LT5ic3NJZCk7CisKKyAgICAvLyBUaGF0IGRvbmUsIHBhY2sgdGhlIFByb2JlIFJlc3BvbnNlOgorICAgIG5TdGF0dXMgPSBkb3QxMWZQYWNrUHJvYmVSZXNwb25zZSggcE1hYywgJnBzZXNzaW9uRW50cnktPnByb2JlUmVzcEZyYW1lLCBwRnJhbWUySGFsICsgc2l6ZW9mKHRTaXJNYWNNZ210SGRyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5QYXlsb2FkLCAmblBheWxvYWQgKTsKKworICAgIGlmICggRE9UMTFGX0ZBSUxFRCggblN0YXR1cyApICkKKyAgICB7CisgICAgICAgIHNjaExvZyggcE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBwYWNrIGEgUHJvYmUgUmVzcG9uc2UgKDB4JTA4eCkuIiksCisgICAgICAgICAgICAgICAgblN0YXR1cyApOworCisgICAgICAgIHZvc19tZW1fZnJlZShhZGRJRSk7CisgICAgICAgIHJldHVybiByZXRDb2RlOyAgICAgICAgICAgICAgICAgLy8gYWxsb2NhdGVkIQorICAgIH0KKyAgICBlbHNlIGlmICggRE9UMTFGX1dBUk5FRCggblN0YXR1cyApICkKKyAgICB7CisgICAgICAgIHNjaExvZyggcE1hYywgTE9HRSwgRkwoIlRoZXJlIHdlcmUgd2FybmluZ3Mgd2hpbGUgcGFja2luZyBhIFAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInJvYmUgUmVzcG9uc2UgKDB4JTA4eCkuIiksIG5TdGF0dXMgKTsKKyAgICB9CisKKyAgICBpZiAoYWRkbklFUHJlc2VudCkKKyAgICB7CisgICAgICAgIHZvc19tZW1fY29weSAoICZwRnJhbWUySGFsW25CeXRlcyAtIGFkZG5JRUxlbl0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZhZGRJRVswXSwgYWRkbklFTGVuKTsKKyAgICB9CisKKyAgICAvKiBmcmVlIHRoZSBhbGxvY2F0ZWQgTWVtb3J5ICovCisgICAgdm9zX21lbV9mcmVlKGFkZElFKTsKKworICAgIHBwcm9iZVJlc3BQYXJhbXMgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YoIHRTZW5kUHJvYmVSZXNwUGFyYW1zICk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c3N1bWluZyBUSU0gPSAwCisvLworCitjb25zdCB0QU5JX1U4IFAycE91aVtdID0gezB4NTAsIDB4NkYsIDB4OUEsIDB4OX07CisKKwordFNpclJldFN0YXR1cyBzY2hHZXRQMnBJZU9mZnNldCh0QU5JX1U4ICpwRXh0cmFJZSwgdEFOSV9VMzIgZXh0cmFJZUxlbiwgdEFOSV9VMTYgKnBQMnBJZU9mZnNldCkKK3sKKyAgICB0U2lyUmV0U3RhdHVzIHN0YXR1cyA9IGVTSVJfRkFJTFVSRTsgICAKKyAgICAqcFAycEllT2Zmc2V0ID0gMDsKKworICAgIC8vIEV4dHJhIElFIGlzIG5vdCBwcmVzZW50CisgICAgaWYoMCA9PSBleHRyYUllTGVuKQorICAgIHsKKyAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICB9CisKKyAgICAvLyBDYWxjdWxhdGUgdGhlIFAyUCBJRSBPZmZzZXQKKyAgICBkbworICAgIHsKKyAgICAgICAgaWYoKnBFeHRyYUllID09IDB4REQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmICggdm9zX21lbV9jb21wYXJlICggKHZvaWQgKikocEV4dHJhSWUrMiksICZQMnBPdWksIHNpemVvZihQMnBPdWkpICkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVTSVJfU1VDQ0VTUzsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgICgqcFAycEllT2Zmc2V0KSsrOworICAgICAgICBwRXh0cmFJZSsrOworICAgICB9d2hpbGUoLS1leHRyYUllTGVuID4gMCk7IAorCisgICAgIHJldHVybiBzdGF0dXM7Cit9CisKK3RTaXJSZXRTdGF0dXMgc2NoQXBwZW5kQWRkbklFKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEZyYW1lLCB0QU5JX1UzMiBtYXhCZWFjb25TaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpuQnl0ZXMpCit7CisgICAgdFNpclJldFN0YXR1cyBzdGF0dXMgPSBlU0lSX0ZBSUxVUkU7CisgICAgdEFOSV9VMzIgcHJlc2VudCwgbGVuOworICAgIHRBTklfVTggYWRkSUVbV05JX0NGR19QUk9CRV9SU1BfQkNOX0FERE5JRV9EQVRBX0xFTl07CisgICAgCisgICAgIGlmKChzdGF0dXMgPSB3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX1BST0JFX1JTUF9CQ05fQURETklFX0ZMQUcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcHJlc2VudCkpICE9IGVTSVJfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIHNjaExvZyhwTWFjLCBMT0dQLCBGTCgiVW5hYmxlIHRvIGdldCBXTklfQ0ZHX1BST0JFX1JTUF9CQ05fQURETklFX0ZMQUciKSk7CisgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgfQorCisgICAgaWYocHJlc2VudCkKKyAgICB7CisgICAgICAgIGlmKChzdGF0dXMgPSB3bGFuX2NmZ0dldFN0ckxlbihwTWFjLCBXTklfQ0ZHX1BST0JFX1JTUF9CQ05fQURETklFX0RBVEEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbGVuKSkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICBzY2hMb2cocE1hYywgTE9HUCwKKyAgICAgICAgICAgICAgICBGTCgiVW5hYmxlIHRvIGdldCBXTklfQ0ZHX1BST0JFX1JTUF9CQ05fQURETklFX0RBVEEgbGVuZ3RoIikpOworICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgfQorCisgICAgICAgIGlmKGxlbiA8PSBXTklfQ0ZHX1BST0JFX1JTUF9CQ05fQURETklFX0RBVEFfTEVOICYmIGxlbiAmJiAKKyAgICAgICAgICAoKGxlbiArICpuQnl0ZXMpIDw9IG1heEJlYWNvblNpemUpKQorICAgICAgICB7CisgICAgICAgICAgICBpZigoc3RhdHVzID0gd2xhbl9jZmdHZXRTdHIocE1hYywgCisgICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfUFJPQkVfUlNQX0JDTl9BREROSUVfREFUQSwgJmFkZElFWzBdLCAmbGVuKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHRBTklfVTgqIHBQMnBJZSA9IGxpbUdldFAycElFUHRyKHBNYWMsICZhZGRJRVswXSwgbGVuKTsKKyAgICAgICAgICAgICAgICBpZihwUDJwSWUgIT0gTlVMTCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHRBTklfVTggbm9hTGVuID0gMDsKKyAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBub2FTdHJlYW1bU0lSX01BWF9OT0FfQVRUUl9MRU4gKyBTSVJfUDJQX0lFX0hFQURFUl9MRU5dOworICAgICAgICAgICAgICAgICAgICAvL2dldCBOb0EgYXR0cmlidXRlIHN0cmVhbSBQMlAgSUUKKyAgICAgICAgICAgICAgICAgICAgbm9hTGVuID0gbGltR2V0Tm9hQXR0clN0cmVhbShwTWFjLCBub2FTdHJlYW0sIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgICAgICBpZihub2FMZW4pCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICggKG5vYUxlbiArIGxlbikgPD0gV05JX0NGR19QUk9CRV9SU1BfQkNOX0FERE5JRV9EQVRBX0xFTiApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZhZGRJRVtsZW5dLCBub2FTdHJlYW0sIG5vYUxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVuICs9IG5vYUxlbjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBVcGRhdGUgSUUgTGVuICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFAycEllWzFdICs9IG5vYUxlbjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2hMb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIk5vQSBsZW5ndGggaXMgJWQiKSxub2FMZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjaExvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJOb3QgYWJsZSB0byBpbnNlcnQgTm9BIGJlY2F1c2Ugb2YgbGVuZ3RoIGNvbnN0cmFpbnQiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBGcmFtZSwgJmFkZElFWzBdLCBsZW4pOworICAgICAgICAgICAgICAgICpuQnl0ZXMgPSAqbkJ5dGVzICsgbGVuOworICAgICAgICAgICAgICAgIHNjaExvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgICAgICBGTCgiVG90YWwgYmVhY29uIHNpemUgaXMgJWQiKSwgKm5CeXRlcyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gc3RhdHVzOworfQorCisvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorLyoqCisgKiBzY2hTZXRGaXhlZEJlYWNvbkZpZWxkcworICoKKyAqIEZVTkNUSU9OOgorICoKKyAqIExPR0lDOgorICoKKyAqIEFTU1VNUFRJT05TOgorICoKKyAqIE5PVEU6CisgKgorICogQHBhcmFtIE5vbmUKKyAqIEByZXR1cm4gTm9uZQorICovCisKK3RTaXJSZXRTdGF0dXMgc2NoU2V0Rml4ZWRCZWFjb25GaWVsZHModHBBbmlTaXJHbG9iYWwgcE1hYyx0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KQoreworICAgIHRwQW5pQmVhY29uU3RydWN0IHBCZWFjb24gPSAodHBBbmlCZWFjb25TdHJ1Y3QpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnNjaC5zY2hPYmplY3QuZ1NjaEJlYWNvbkZyYW1lQmVnaW47CisgICAgdHBTaXJNYWNNZ210SGRyIG1hYzsKKyAgICB0QU5JX1UxNiAgICAgICAgb2Zmc2V0OworICAgIHRBTklfVTggICAgICAgICpwdHI7CisgICAgdERvdDExZkJlYWNvbjEgKnBCY24xOworICAgIHREb3QxMWZCZWFjb24yICpwQmNuMjsKKyAgICB0QU5JX1UzMiAgICAgICAgaSwgblN0YXR1cywgbkJ5dGVzOworICAgIHRBTklfVTMyICAgICAgICB3cHNBcEVuYWJsZT0wLCB0bXA7CisgICAgdERvdDExZklFV3NjUHJvYmVSZXMgICAgICAqcFdzY1Byb2JlUmVzOworICAgIHRBTklfVTggICpwRXh0cmFJZSA9IE5VTEw7CisgICAgdEFOSV9VMzIgZXh0cmFJZUxlbiA9MDsKKyAgICB0QU5JX1UxNiBleHRyYUllT2Zmc2V0ID0gMDsKKyAgICB0QU5JX1UxNiBwMnBJZU9mZnNldCA9IDA7CisgICAgdFNpclJldFN0YXR1cyBzdGF0dXMgPSBlU0lSX1NVQ0NFU1M7CisKKyAgICBwQmNuMSA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0RG90MTFmQmVhY29uMSkpOworICAgIGlmICggTlVMTCA9PSBwQmNuMSApCisgICAgeworICAgICAgICBzY2hMb2cocE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBhbGxvY2F0ZSBtZW1vcnkiKSApOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKworICAgIHBCY24yID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHREb3QxMWZCZWFjb24yKSk7CisgICAgaWYgKCBOVUxMID09IHBCY24yICkKKyAgICB7CisgICAgICAgIHNjaExvZyhwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIGFsbG9jYXRlIG1lbW9yeSIpICk7CisgICAgICAgIHZvc19tZW1fZnJlZShwQmNuMSk7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorCisgICAgcFdzY1Byb2JlUmVzID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHREb3QxMWZJRVdzY1Byb2JlUmVzKSk7CisgICAgaWYgKCBOVUxMID09IHBXc2NQcm9iZVJlcyApCisgICAgeworICAgICAgICBzY2hMb2cocE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBhbGxvY2F0ZSBtZW1vcnkiKSApOworICAgICAgICB2b3NfbWVtX2ZyZWUocEJjbjEpOworICAgICAgICB2b3NfbWVtX2ZyZWUocEJjbjIpOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKworICAgIFBFTE9HMShzY2hMb2cocE1hYywgTE9HMSwgRkwoIlNldHRpbmcgZml4ZWQgYmVhY29uIGZpZWxkcyIpKTspCisKKyAgICAvKgorICAgICAqIEZpcnN0IHNldCB0aGUgZml4ZWQgZmllbGRzCisgICAgICovCisKKyAgICAvLyBzZXQgdGhlIFRGUCBoZWFkZXJzCisKKyAgICAvLyBzZXQgdGhlIG1hYyBoZWFkZXIKKyAgICB2b3NfbWVtX3NldCgoIHRBTklfVTgqKSAmcEJlYWNvbi0+bWFjSGRyLCBzaXplb2YoIHRTaXJNYWNNZ210SGRyICksM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fUFJCUlNQX1RNUEwpKSkKKyAgICAgICkKKyAgICB7CisgICAgICAgIC8qIEluaXRpYWxpemUgdGhlIGRlZmF1bHQgSUUgYml0bWFwIHRvIHplcm8gKi8KKyAgICAgICAgdm9zX21lbV9zZXQoKCB0QU5JX1U4KiApJihwc2Vzc2lvbkVudHJ5LT5EZWZQcm9iZVJzcEllQml0bWFwKSwgKHNpemVvZiggdEFOSV9VMzIgKSAqIDgpLCAwKTsKKworICAgICAgICAvKiBJbml0aWFsaXplIHRoZSBkZWZhdWx0IElFIGJpdG1hcCB0byB6ZXJvICovCisgICAgICAgIHZvc19tZW1fc2V0KCggdEFOSV9VOCogKSYocHNlc3Npb25FbnRyeS0+cHJvYmVSZXNwRnJhbWUpLAorICAgICAgICAgICAgICAgICAgICBzaXplb2YocHNlc3Npb25FbnRyeS0+cHJvYmVSZXNwRnJhbWUpLCAwKTsKKworICAgICAgICAvKiBDYW4gYmUgZWZmaWNpZW50bHkgdXBkYXRlZCB3aGVuZXZlciBuZXcgSUUgYWRkZWQgIGluIFByb2JlIHJlc3BvbnNlIGluIGZ1dHVyZSAqLworICAgICAgICBsaW1VcGRhdGVQcm9iZVJzcFRlbXBsYXRlSWVCaXRtYXBCZWFjb24xKHBNYWMscEJjbjEsJnBzZXNzaW9uRW50cnktPkRlZlByb2JlUnNwSWVCaXRtYXBbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcHNlc3Npb25FbnRyeS0+cHJvYmVSZXNwRnJhbWUpOworICAgIH0KKworICAgIG5TdGF0dXMgPSBkb3QxMWZQYWNrQmVhY29uMSggcE1hYywgcEJjbjEsIHB0ciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNDSF9NQVhfQkVBQ09OX1NJWkUgLSBvZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbkJ5dGVzICk7CisgICAgaWYgKCBET1QxMUZfRkFJTEVEKCBuU3RhdHVzICkgKQorICAgIHsKKyAgICAgIHNjaExvZyggcE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBwYWNrZWQgYSB0RG90MTFmQmVhY29uMSAoMHglMCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIjh4LikuIiksIG5TdGF0dXMgKTsKKyAgICAgIHZvc19tZW1fZnJlZShwQmNuMSk7CisgICAgICB2b3NfbWVtX2ZyZWUocEJjbjIpOworICAgICAgdm9zX21lbV9mcmVlKHBXc2NQcm9iZVJlcyk7CisgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKyAgICBlbHNlIGlmICggRE9UMTFGX1dBUk5FRCggblN0YXR1cyApICkKKyAgICB7CisgICAgICBzY2hMb2coIHBNYWMsIExPR0UsIEZMKCJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIHBhY2tpbmcgYSB0RG8iCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0MTFmQmVhY29uMSAoMHglMDh4LikuIiksIG5TdGF0dXMgKTsKKyAgICB9CisgICAgLypjaGFuZ2VkICB0byBjb3JyZWN0IGJlYWNvbiBjb3JydXB0aW9uICovCisgICAgdm9zX21lbV9zZXQoKCB0QU5JX1U4KikgcEJjbjIsIHNpemVvZiggdERvdDExZkJlYWNvbjIgKSwgMCk7CisgICAgcE1hYy0+c2NoLnNjaE9iamVjdC5nU2NoQmVhY29uT2Zmc2V0QmVnaW4gPSBvZmZzZXQgKyAoIHRBTklfVTE2ICluQnl0ZXM7CisgICAgc2NoTG9nKCBwTWFjLCBMT0cxLCBGTCgiSW5pdGlhbGl6ZWQgYmVhY29uIGJlZ2luLCBvZmZzZXQgJWQiKSwgb2Zmc2V0ICk7CisKKyAgICAvKgorICAgICAqIEluaXRpYWxpemUgdGhlICduZXcnIGZpZWxkcyBhdCB0aGUgZW5kIG9mIHRoZSBiZWFjb24KKyAgICAgKi8KKworICAgIAorICAgIFBvcHVsYXRlRG90MTFmQ291bnRyeSggcE1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XJhdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmN1cnJlbnRPcGVyQ2hhbm5lbCk7CisgICAgICAgIC8vIHdlIGRvIG5vdCBzdXBwb3J0IG11bHRpIHVzZXJzIHlldAorICAgICAgICAvL1BvcHVsYXRlRG90MTFmVkhURXh0QnNzTG9hZCggcE1hYywgJmJjbjIuVkhURXh0QnNzTG9hZCk7CisgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPmdMaW1PcGVyYXRpbmdNb2RlLnByZXNlbnQpCisgICAgICAgICAgICBQb3B1bGF0ZURvdDExZk9wZXJhdGluZ01vZGUoIHBNYWMsICZwQmNuMi0+T3BlcmF0aW5nTW9kZSwgcHNlc3Npb25FbnRyeSApOworICAgIH0KKyNlbmRpZgorCisgICAgUG9wdWxhdGVEb3QxMWZFeHRTdXBwUmF0ZXMoIHBNYWMsIFBPUFVMQVRFX0RPVDExRl9SQVRFU19PUEVSQVRJT05BTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBCY24yLT5FeHRTdXBwUmF0ZXMsIHBzZXNzaW9uRW50cnkgKTsKKyAKKyAgICBpZiggcHNlc3Npb25FbnRyeS0+cExpbVN0YXJ0QnNzUmVxICE9IE5VTEwgKQorICAgIHsKKyAgICAgICAgICBQb3B1bGF0ZURvdDExZldQQSggcE1hYywgJnBzZXNzaW9uRW50cnktPnBMaW1TdGFydEJzc1JlcS0+cnNuSUUsCisgICAgICAgICAgICAgICAgICAgICAgICZwQmNuMi0+V1BBICk7CisgICAgICAgICAgUG9wdWxhdGVEb3QxMWZSU05PcGFxdWUoIHBNYWMsICZwc2Vzc2lvbkVudHJ5LT5wTGltU3RhcnRCc3NSZXEtPnJzbklFLAorICAgICAgICAgICAgICAgICAgICAgICAmcEJjbjItPlJTTk9wYXF1ZSApOworICAgIH0KKworICAgIGlmKHBzZXNzaW9uRW50cnktPmxpbVdtZUVuYWJsZWQpCisgICAgeworICAgICAgICBQb3B1bGF0ZURvdDExZldNTSggcE1hYywgJnBCY24yLT5XTU1JbmZvQXAsICZwQmNuMi0+V01NUGFyYW1zLCAmcEJjbjItPldNTUNhcHMsIHBzZXNzaW9uRW50cnkpOworICAgIH0KKyAgICBpZihwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQVBfUk9MRSkKKyAgICB7CisgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPndwc19zdGF0ZSAhPSBTQVBfV1BTX0RJU0FCTEVEKQorICAgICAgICB7CisgICAgICAgICAgICBQb3B1bGF0ZURvdDExZkJlYWNvbldQU0lFcyggcE1hYywgJnBCY24yLT5Xc2NCZWFjb24sIHBzZXNzaW9uRW50cnkpOyAgICAgICAgICAgIAorICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCAodEFOSV9VMTYpIFdOSV9DRkdfV1BTX0VOQUJMRSwgJnRtcCkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgc2NoTG9nKHBNYWMsIExPR1AsIkZhaWxlZCB0byBjZmcgZ2V0IGlkICVkIiwgV05JX0NGR19XUFNfRU5BQkxFICk7CisKKyAgICAgICAgd3BzQXBFbmFibGUgPSB0bXAgJiBXTklfQ0ZHX1dQU19FTkFCTEVfQVA7CisKKyAgICAgICAgaWYgKHdwc0FwRW5hYmxlKQorICAgICAgICB7CisgICAgICAgICAgICBQb3B1bGF0ZURvdDExZldzYyhwTWFjLCAmcEJjbjItPldzY0JlYWNvbik7CisgICAgICAgIH0KKworICAgICAgICBpZiAocE1hYy0+bGltLndzY0llSW5mby53c2NFbnJvbGxtZW50U3RhdGUgPT0gZUxJTV9XU0NfRU5ST0xMX0JFR0lOKQorICAgICAgICB7CisgICAgICAgICAgICBQb3B1bGF0ZURvdDExZldzY1JlZ2lzdHJhckluZm8ocE1hYywgJnBCY24yLT5Xc2NCZWFjb24pOworICAgICAgICAgICAgcE1hYy0+bGltLndzY0llSW5mby53c2NFbnJvbGxtZW50U3RhdGUgPSBlTElNX1dTQ19FTlJPTExfSU5fUFJPR1JFU1M7CisgICAgICAgIH0KKworICAgICAgICBpZiAocE1hYy0+bGltLndzY0llSW5mby53c2NFbnJvbGxtZW50U3RhdGUgPT0gZUxJTV9XU0NfRU5ST0xMX0VORCkKKyAgICAgICAgeworICAgICAgICAgICAgRGVQb3B1bGF0ZURvdDExZldzY1JlZ2lzdHJhckluZm8ocE1hYywgJnBCY24yLT5Xc2NCZWFjb24pOworICAgICAgICAgICAgcE1hYy0+bGltLndzY0llSW5mby53c2NFbnJvbGxtZW50U3RhdGUgPSBlTElNX1dTQ19FTlJPTExfTk9PUDsKKyAgICAgICAgfQorICAgIH0KKworICAgIGlmKChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQVBfUk9MRSkgCisgICAgICAgICYmICgocHNlc3Npb25FbnRyeS0+cHJveHlQcm9iZVJzcEVuKQorICAgICAgICB8fCAoSVNfRkVBVFVSRV9TVVBQT1JURURfQllfRlcoV1BTX1BSQlJTUF9UTVBMKSkpCisgICAgICApCisgICAgeworICAgICAgICAvKiBDYW4gYmUgZWZmaWNpZW50bHkgdXBkYXRlZCB3aGVuZXZlciBuZXcgSUUgYWRkZWQgIGluIFByb2JlIHJlc3BvbnNlIGluIGZ1dHVyZSAqLworICAgICAgICBsaW1VcGRhdGVQcm9iZVJzcFRlbXBsYXRlSWVCaXRtYXBCZWFjb24yKHBNYWMscEJjbjIsJnBzZXNzaW9uRW50cnktPkRlZlByb2JlUnNwSWVCaXRtYXBbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcHNlc3Npb25FbnRyeS0+cHJvYmVSZXNwRnJhbWUpOworCisgICAgICAgIC8qIHVwZGF0ZSBwcm9iZSByZXNwb25zZSBXUFMgSUUgaW5zdGVhZCBvZiBiZWFjb24gV1BTIElFCisgICAgICAgICogKi8KKyAgICAgICAgaWYocHNlc3Npb25FbnRyeS0+d3BzX3N0YXRlICE9IFNBUF9XUFNfRElTQUJMRUQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKHBzZXNzaW9uRW50cnktPkFQV1BTSUVzLlNpcldQU1Byb2JlUnNwSUUuRmllbGRQcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFBvcHVsYXRlRG90MTFmUHJvYmVSZXNXUFNJRXMocE1hYywgcFdzY1Byb2JlUmVzLCBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwV3NjUHJvYmVSZXMtPnByZXNlbnQgPSAwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYocFdzY1Byb2JlUmVzLT5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFNldFByb2JlUnNwSWVCaXRtYXAoJnBzZXNzaW9uRW50cnktPkRlZlByb2JlUnNwSWVCaXRtYXBbMF0sU0lSX01BQ19XUEFfRUlEKTsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHZvaWQgKikmcHNlc3Npb25FbnRyeS0+cHJvYmVSZXNwRnJhbWUuV3NjUHJvYmVSZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopcFdzY1Byb2JlUmVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodERvdDExZklFV3NjUHJvYmVSZXMpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgfQorCisgICAgblN0YXR1cyA9IGRvdDExZlBhY2tCZWFjb24yKCBwTWFjLCBwQmNuMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnNjaC5zY2hPYmplY3QuZ1NjaEJlYWNvbkZyYW1lRW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0NIX01BWF9CRUFDT05fU0laRSwgJm5CeXRlcyApOworICAgIGlmICggRE9UMTFGX0ZBSUxFRCggblN0YXR1cyApICkKKyAgICB7CisgICAgICBzY2hMb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gcGFja2VkIGEgdERvdDExZkJlYWNvbjIgKDB4JTAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICI4eC4pLiIpLCBuU3RhdHVzICk7CisgICAgICB2b3NfbWVtX2ZyZWUocEJjbjEpOworICAgICAgdm9zX21lbV9mcmVlKHBCY24yKTsKKyAgICAgIHZvc19tZW1fZnJlZShwV3NjUHJvYmVSZXMpOworICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICB9CisgICAgZWxzZSBpZiAoIERPVDExRl9XQVJORUQoIG5TdGF0dXMgKSApCisgICAgeworICAgICAgc2NoTG9nKCBwTWFjLCBMT0dFLCBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSBwYWNraW5nIGEgdERvIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAidDExZkJlYWNvbjIgKDB4JTA4eC4pLiIpLCBuU3RhdHVzICk7CisgICAgfQorCisgICAgcEV4dHJhSWUgPSBwTWFjLT5zY2guc2NoT2JqZWN0LmdTY2hCZWFjb25GcmFtZUVuZCArIG5CeXRlczsKKyAgICBleHRyYUllT2Zmc2V0ID0gbkJ5dGVzOworCisgICAgLy9UT0RPOiBBcHBlbmQgYWRkaXRpb25hbCBJRSBoZXJlLgorICAgIHNjaEFwcGVuZEFkZG5JRShwTWFjLCBwc2Vzc2lvbkVudHJ5LCAKKyAgICAgICAgICAgICAgICAgICAgcE1hYy0+c2NoLnNjaE9iamVjdC5nU2NoQmVhY29uRnJhbWVFbmQgKyBuQnl0ZXMsCisgICAgICAgICAgICAgICAgICAgIFNDSF9NQVhfQkVBQ09OX1NJWkUsICZuQnl0ZXMpOworCisg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JlUnNwVGVtcGxhdGVJZUJpdG1hcEJlYWNvbjEodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmQmVhY29uMSogYmVhY29uMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiogRGVmUHJvYmVSc3BJZUJpdG1hcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmUHJvYmVSZXNwb25zZSogcHJiX3JzcCkKK3sKKyAgICBwcmJfcnNwLT5CZWFjb25JbnRlcnZhbCA9IGJlYWNvbjEtPkJlYWNvbkludGVydmFsOworICAgIHZvc19tZW1fY29weSgodm9pZCAqKSZwcmJfcnNwLT5DYXBhYmlsaXRpZXMsICh2b2lkICopJmJlYWNvbjEtPkNhcGFiaWxpdGllcywKKyAgICAgICAgICAgICAgICAgc2l6ZW9mKGJlYWNvbjEtPkNhcGFiaWxpdGllcykpOworCisgICAgLyogU1NJRCAqLworICAgIGlmKGJlYWNvbjEtPlNTSUQucHJlc2VudCkKKyAgICB7CisgICAgICAgIFNldFByb2JlUnNwSWVCaXRtYXAoRGVmUHJvYmVSc3BJZUJpdG1hcCxTSVJfTUFDX1NTSURfRUlEKTsKKyAgICAgICAgLyogcG9wdWxhdGluZyBpdCwgYmVjYXVzZSBwcm9iZSByZXNwb25zZSBoYXMgdG8gZ28gd2l0aCBTU0lEIGV2ZW4gaW4gaGlkZGVuIGNhc2UgKi8KKyAgICAgICAgUG9wdWxhdGVEb3QxMWZTU0lEMiggcE1hYywgJnByYl9yc3AtPlNTSUQgKTsKKyAgICB9CisgICAgLyogc3VwcG9ydGVkIHJhdGVzICovCisgICAgaWYoYmVhY29uMS0+U3VwcFJhdGVzLnByZXNlbnQpCisgICAgeworICAgICAgICBTZXRQcm9iZVJzcEllQml0bWFwKERlZlByb2JlUnNwSWVCaXRtYXAsU0lSX01BQ19SQVRFU0VUX0VJRCk7CisgICAgICAgIHZvc19tZW1fY29weSgodm9pZCAqKSZwcmJfcnNwLT5TdXBwUmF0ZXMsICh2b2lkICopJmJlYWNvbjEtPlN1cHBSYXRlcywKKyAgICAgICAgICAgICAgICAgICAgIHNpemVvZihiZWFjb24xLT5TdXBwUmF0ZXMpKTsKKworICAgIH0KKyAgICAvKiBEUyBQYXJhbWV0ZXIgc2V0ICovCisgICAgaWYoYmVhY29uMS0+RFNQYXJhbXMucHJlc2VudCkKKyAgICB7CisgICAgICAgIFNldFByb2JlUnNwSWVCaXRtYXAoRGVmUHJvYmVSc3BJZUJpdG1hcCxTSVJfTUFDX0RTX1BBUkFNX1NFVF9FSUQpOworICAgICAgICB2b3NfbWVtX2NvcHkoKHZvaWQgKikmcHJiX3JzcC0+RFNQYXJhbXMsICh2b2lkICopJmJlYWNvbjEtPkRTUGFyYW1zLAorICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihiZWFjb24xLT5EU1BhcmFtcykpOworCisgICAgfQorCisgICAgLyogSUJTUyBwYXJhbXMgd2lsbCBub3QgYmUgcHJlc2VudCBpbiB0aGUgQmVhY29ucyB0cmFuc21pdHRlZCBieSBBUCAqLworfQorCit2b2lkIGxpbVVwZGF0ZVByb2JlUnNwVGVtcGxhdGVJZUJpdG1hcEJlYWNvbjIodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmQmVhY29uMiogYmVhY29uMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiogRGVmUHJvYmVSc3BJZUJpdG1hcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmUHJvYmVSZXNwb25zZSogcHJiX3JzcCkKK3sKKyAgICAvKiBJQlNTIHBhcmFtZXRlciBzZXQgLSB3aWxsIG5vdCBiZSBwcmVzZW50IGluIHByb2JlIHJlc3BvbnNlIHR4IGJ5IEFQICovCisgICAgLyogY291bnRyeSAqLworICAgIGlmKGJlYWNvbjItPkNvdW50cnkucHJlc2VudCkKKyAgICB7CisgICAgICAgIFNldFByb2JlUnNwSWVCaXRtYXAoRGVmUHJvYmVSc3BJZUJpdG1hcCxTSVJfTUFDX0NPVU5UUllfRUlEKTsKKyAgICAgICAgdm9zX21lbV9jb3B5KCh2b2lkICopJnByYl9yc3AtPkNvdW50cnksICh2b2lkICopJmJlYWNvbjItPkNvdW50cnksCisgICAgICAgICAgICAgICAgICAgICBzaXplb2YoYmVhY29uMi0+Q291bnRyeSkpOworCisgICAgfQorICAgIC8qIFBvd2VyIGNvbnN0cmFpbnQgKi8KKyAgICBpZihiZWFjb24yLT5Qb3dlckNvbnN0cmFpbnRzLnByZXNlbnQpCisgICAgeworICAgICAgICBTZXRQcm9iZVJzcEllQml0bWFwKERlZlByb2JlUnNwSWVCaXRtYXAsU0lSX01BQ19QV1JfQ09OU1RSQUlOVF9FSUQpOworICAgICAgICB2b3NfbWVtX2NvcHkoKHZvaWQgKikmcHJiX3JzcC0+UG93ZXJDb25zdHJhaW50cywgKHZvaWQgKikmYmVhY29uMi0+UG93ZXJDb25zdHJhaW50cywKKyAgICAgICAgICAgICAgICAgICAgIHNpemVvZihiZWFjb24yLT5Qb3dlckNvbnN0cmFpbnRzKSk7CisKKyAgICB9CisgICAgLyogQ2hhbm5lbCBTd2l0Y2ggQW5ub291bmNlbWVudCBTSVJfTUFDX0NITkxfU1dJVENIX0FOTl9FSUQgKi8KKyAgICBpZihiZWFjb24yLT5DaGFuU3dpdGNoQW5uLnByZXNlbnQpCisgICAgeworICAgICAgICBTZXRQcm9iZVJzcEllQml0bWFwKERlZlByb2JlUnNwSWVCaXRtYXAsU0lSX01BQ19DSE5MX1NXSVRDSF9BTk5fRUlEKTsKKyAgICAgICAgdm9zX21lbV9jb3B5KCh2b2lkICopJnByYl9yc3AtPkNoYW5Td2l0Y2hBbm4sICh2b2lkICopJmJlYWNvbjItPkNoYW5Td2l0Y2hBbm4sCisgICAgICAgICAgICAgICAgICAgICBzaXplb2YoYmVhY29uMi0+Q2hhblN3aXRjaEFubikpOworCisgICAgfQorICAgIC8qIEVSUCBpbmZvcm1hdGlvbiAqLworICAgIGlmKGJlYWNvbjItPkVSUEluZm8ucHJlc2VudCkKKyAgICB7CisgICAgICAgIFNldFByb2JlUnNwSWVCaXRtYXAoRGVmUHJvYmVSc3BJZUJpdG1hcCxTSVJfTUFDX0VSUF9JTkZPX0VJRCk7CisgICAgICAgIHZvc19tZW1fY29weSgodm9pZCAqKSZwcmJfcnNwLT5FUlBJbmZvLCAodm9pZCAqKSZiZWFjb24yLT5FUlBJbmZvLAorICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKGJlYWNvbjItPkVSUEluZm8pKTsKKworICAgIH0KKyAgICAvKiBFeHRlbmRlZCBzdXBwb3J0ZWQgcmF0ZXMgKi8KKyAgICBpZihiZWFjb24yLT5FeHRTdXBwUmF0ZXMucHJlc2VudCkKKyAgICB7CisgICAgICAgIFNldFByb2JlUnNwSWVCaXRtYXAoRGVmUHJvYmVSc3BJZUJpdG1hcCxTSVJfTUFDX0VYVEVOREVEX1JBVEVfRUlEKTsKKyAgICAgICAgdm9zX21lbV9jb3B5KCh2b2lkICopJnByYl9yc3AtPkV4dFN1cHBSYXRlcywgKHZvaWQgKikmYmVhY29uMi0+RXh0U3VwcFJhdGVzLAorICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKGJlYWNvbjItPkV4dFN1cHBSYXRlcykpOworCisgICAgfQorCisgICAgLyogV1BBICovCisgICAgaWYoYmVhY29uMi0+V1BBLnByZXNlbnQpCisgICAgeworICAgICAgICBTZXRQcm9iZVJzcEllQml0bWFwKERlZlByb2JlUnNwSWVCaXRtYXAsU0lSX01BQ19XUEFfRUlEKTsKKyAgICAgICAgdm9zX21lbV9jb3B5KCh2b2lkICopJnByYl9yc3AtPldQQSwgKHZvaWQgKikmYmVhY29uMi0+V1BBLAorICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKGJlYWNvbjItPldQQSkpOworCisgICAgfQorCisgICAgLyogUlNOICovCisgICAgaWYoYmVhY29uMi0+UlNOT3BhcXVlLnByZXNlbnQpCisgICAgeworICAgICAgICBTZXRQcm9iZVJzcEllQml0bWFwKERlZlByb2JlUnNwSWVCaXRtYXAsU0lSX01BQ19SU05fRUlEKTsKKyAgICAgICAgdm9zX21lbV9jb3B5KCh2b2lkICopJnByYl9yc3AtPlJTTk9wYXF1ZSwgKHZvaWQgKikmYmVhY29uMi0+UlNOT3BhcXVlLAorICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKGJlYWNvbjItPlJTTk9wYXF1ZSkpOworICAgIH0KKy8qCisgICAgLy8gQlNTIGxvYWQKKyAgICBpZihiZWFjb24yLT5RQlNTTG9hZC5wcmVzZW50KQorICAgIHsKKyAgICAgICAgU2V0UHJvYmVSc3BJZUJpdG1hcChEZWZQcm9iZVJzcEllQml0bWFwLFNJUl9NQUNfUUJTU19MT0FEX0VJRCk7CisgICAgfQorKi8KKyAgICAvKiBFRENBIFBhcmFtZXRlciBzZXQgKi8KKyAgICBpZihiZWFjb24yLT5FRENBUGFyYW1TZXQucHJlc2VudCkKKyAgICB7CisgICAgICAgIFNldFByb2JlUnNwSWVCaXRtYXAoRGVmUHJvYmVSc3BJZUJpdG1hcCxTSVJfTUFDX0VEQ0FfUEFSQU1fU0VUX0VJRCk7CisgICAgICAgIHZvc19tZW1fY29weSgodm9pZCAqKSZwcmJfcnNwLT5FRENBUGFyYW1TZXQsICh2b2lkICopJmJlYWNvbjItPkVEQ0FQYXJhbVNldCwKKyAgICAgICAgICAgICAgICAgICAgIHNpemVvZihiZWFjb24yLT5FRENBUGFyYW1TZXQpKTsKKworICAgIH0KKyAgICAvKiBWZW5kb3Igc3BlY2lmaWMgLSBjdXJyZW50bHkgbm8gdmVuZG9yIHNwZWNpZmlj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Qcm9iZVJzcEllQml0bWFwKERlZlByb2JlUnNwSWVCaXRtYXAsCisgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfT0JTU19TQ0FOX1BBUkFNRVRFUlNfRUlEKTsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSgodm9pZCAqKSZwcmJfcnNwLT5PQlNTU2NhblBhcmFtZXRlcnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKSZiZWFjb24yLT5PQlNTU2NhblBhcmFtZXRlcnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoYmVhY29uMi0+T0JTU1NjYW5QYXJhbWV0ZXJzKSk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoYmVhY29uMi0+RXh0Q2FwLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIFNldFByb2JlUnNwSWVCaXRtYXAoRGVmUHJvYmVSc3BJZUJpdG1hcCwKKyAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfRVhURU5ERURfQ0FQQUJJTElUSUVTX0VJRCk7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHZvaWQgKikmcHJiX3JzcC0+RXh0Q2FwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKikmYmVhY29uMi0+RXh0Q2FwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKGJlYWNvbjItPkV4dENhcCkpOworCisgICAgICAgIH0KKyAgICB9CisjZW5kaWYKKworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisgICAgaWYoYmVhY29uMi0+VkhUQ2Fwcy5wcmVzZW50KQorICAgIHsKKyAgICAgICAgU2V0UHJvYmVSc3BJZUJpdG1hcChEZWZQcm9iZVJzcEllQml0bWFwLFNJUl9NQUNfVkhUX0NBUEFCSUxJVElFU19FSUQpOworICAgICAgICB2b3NfbWVtX2NvcHkoKHZvaWQgKikmcHJiX3JzcC0+VkhUQ2FwcywgKHZvaWQgKikmYmVhY29uMi0+VkhUQ2FwcywKKyAgICAgICAgICAgICAgICAgICAgIHNpemVvZihiZWFjb24yLT5WSFRDYXBzKSk7CisgICAgfQorICAgIGlmKGJlYWNvbjItPlZIVE9wZXJhdGlvbi5wcmVzZW50KQorICAgIHsKKyAgICAgICAgU2V0UHJvYmVSc3BJZUJpdG1hcChEZWZQcm9iZVJzcEllQml0bWFwLFNJUl9NQUNfVkhUX09QRVJBVElPTl9FSUQpOworICAgICAgICB2b3NfbWVtX2NvcHkoKHZvaWQgKikmcHJiX3JzcC0+VkhUT3BlcmF0aW9uLCAodm9pZCAqKSZiZWFjb24yLT5WSFRPcGVyYXRpb24sCisgICAgICAgICAgICAgICAgICAgICBzaXplb2YoYmVhY29uMi0+VkhUT3BlcmF0aW9uKSk7CisgICAgfQorICAgIGlmKGJlYWNvbjItPlZIVEV4dEJzc0xvYWQucHJlc2VudCkKKyAgICB7CisgICAgICAgIFNldFByb2JlUnNwSWVCaXRtYXAoRGVmUHJvYmVSc3BJZUJpdG1hcCxTSVJfTUFDX1ZIVF9FWFRfQlNTX0xPQURfRUlEKTsKKyAgICAgICAgdm9zX21lbV9jb3B5KCh2b2lkICopJnByYl9yc3AtPlZIVEV4dEJzc0xvYWQsICh2b2lkICopJmJlYWNvbjItPlZIVEV4dEJzc0xvYWQsCisgICAgICAgICAgICAgICAgICAgICBzaXplb2YoYmVhY29uMi0+VkhURXh0QnNzTG9hZCkpOworICAgIH0KKyNlbmRpZgorCisgICAgLy9XTU0gSUUKKyAgICBpZihiZWFjb24yLT5XTU1QYXJhbXMucHJlc2VudCkKKyAgICB7CisgICAgICAgIFNldFByb2JlUnNwSWVCaXRtYXAoRGVmUHJvYmVSc3BJZUJpdG1hcCxTSVJfTUFDX1dQQV9FSUQpOworICAgICAgICB2b3NfbWVtX2NvcHkoKHZvaWQgKikmcHJiX3JzcC0+V01NUGFyYW1zLCAodm9pZCAqKSZiZWFjb24yLT5XTU1QYXJhbXMsCisgICAgICAgICAgICAgICAgICAgICBzaXplb2YoYmVhY29uMi0+V01NUGFyYW1zKSk7CisgICAgfQorICAgIC8vV01NIGNhcGFiaWxpdHkgLSBtb3N0IG9mIHRoZSBjYXNlIHdvbid0IGJlIHByZXNlbnQKKyAgICBpZihiZWFjb24yLT5XTU1DYXBzLnByZXNlbnQpCisgICAgeworICAgICAgICBTZXRQcm9iZVJzcEllQml0bWFwKERlZlByb2JlUnNwSWVCaXRtYXAsU0lSX01BQ19XUEFfRUlEKTsKKyAgICAgICAgdm9zX21lbV9jb3B5KCh2b2lkICopJnByYl9yc3AtPldNTUNhcHMsICh2b2lkICopJmJlYWNvbjItPldNTUNhcHMsCisgICAgICAgICAgICAgICAgICAgICBzaXplb2YoYmVhY29uMi0+V01NQ2FwcykpOworICAgIH0KKworfQorCit2b2lkIFNldFByb2JlUnNwSWVCaXRtYXAodEFOSV9VMzIqIEllQml0bWFwLHRBTklfVTMyIHBvcykKK3sKKyAgICB0QU5JX1UzMiBpbmRleCx0ZW1wOworCisgICAgaW5kZXggPSBwb3MgPj4gNTsKKyAgICBpZihpbmRleCA+PSA4ICkKKyAgICB7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgdGVtcCA9IEllQml0bWFwW2luZGV4XTsKKworICAgIHRlbXAgfD0gMSA8PCAocG9zICYgMHgxRik7CisKKyAgICBJZUJpdG1hcFtpbmRleF0gPSB0ZW1wOworfQorCisKKworLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKy8qKgorICogd3JpdGVCZWFjb25Ub01lbW9yeQorICoKKyAqIEZVTkNUSU9OOgorICoKKyAqIExPR0lDOgorICoKKyAqIEFTU1VNUFRJT05TOgorICoKKyAqIE5PVEU6CisgKgorICogQHBhcmFtIE5vbmUKKyAqIEBwYXJhbSBzaXplICAgIFNpemUgb2YgdGhlIGJlYWNvbiB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m8sCisgICAgdHBTY2hCZWFjb25TdHJ1Y3QgcEJjblN0cnVjdCwKKyAgICB0cFVwZGF0ZUJlYWNvblBhcmFtcyBwQmVhY29uUGFyYW1zLAorICAgIHRwUEVTZXNzaW9uICAgICAgICAgcHNlc3Npb25FbnRyeSkKK3sKKyAgICB0cFNpck1hY01nbXRIZHIgICAgcE1oID0gV0RBX0dFVF9SWF9NQUNfSEVBREVSKHBSeFBhY2tldEluZm8pOworICAgIHRBTklfVTMyICAgICAgICAgICBwaHlNb2RlOworICAgIHRTaXJSRkJhbmQgICAgICAgICAgcmZCYW5kID0gU0lSX0JBTkRfVU5LTk9XTjsKKyAgICAvL0dldCBSRiBiYW5kIGZyb20gcHNlc3Npb25FbnRyeQorICAgIHJmQmFuZCA9IHBzZXNzaW9uRW50cnktPmxpbVJGQmFuZDsKKworICAgIGxpbUdldFBoeU1vZGUocE1hYywgJnBoeU1vZGUsIHBzZXNzaW9uRW50cnkpOworCisgICAgaWYoU0lSX0JBTkRfNV9HSFogPT0gcmZCYW5kKQorICAgIHsKKyAgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPmh0Q2FwYWJpbGl0eSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKHBCY25TdHJ1Y3QtPmNoYW5uZWxOdW1iZXIgPT0gcHNlc3Npb25FbnRyeS0+Y3VycmVudE9wZXJDaGFubmVsKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvLzExYSAobm9uIEhUKSBBUCAgb3ZlcmxhcHMgb3IKKyAgICAgICAgICAgICAgLy9IVCBBUCB3aXRoIEhUIG9wIG1vZGUgYXMgbWl4ZWQgb3ZlcmxhcHMuICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgLy9IVCBBUCB3aXRoIEhUIG9wIG1vZGUgYXMgb3ZlcmxhcCBsZWdhY3kgb3ZlcmxhcHMuICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICBpZiAoKCFwQmNuU3RydWN0LT5IVEluZm8ucHJlc2VudCkgfHwKKyAgICAgICAgICAgICAgICAgIChlU0lSX0hUX09QX01PREVfTUlYRUQgPT0gcEJjblN0cnVjdC0+SFRJbmZvLm9wTW9kZSkgfHwKKyAgICAgICAgICAgICAgICAgIChlU0lSX0hUX09QX01PREVfT1ZFUkxBUF9MRUdBQ1kgPT0gcEJjblN0cnVjdC0+SFRJbmZvLm9wTW9kZSkpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBsaW1VcGRhdGVPdmVybGFwU3RhUGFyYW0ocE1hYywgcE1oLT5ic3NJZCwgJihwTWFjLT5saW0uZ0xpbU92ZXJsYXAxMWFQYXJhbXMpKTsKKworICAgICAgICAgICAgICAgICAgaWYgKHBNYWMtPmxpbS5nTGltT3ZlcmxhcDExYVBhcmFtcy5udW1TdGEgJiYKKyAgICAgICAgICAgICAgICAgICAgICAhcE1hYy0+bGltLmdMaW1PdmVybGFwMTFhUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZTExYVByb3RlY3Rpb24ocE1hYywgdHJ1ZSwgdHJ1ZSwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAvL0hUIEFQIHdpdGggSFQyMCBvcCBtb2RlIG92ZXJsYXBzLgorICAgICAgICAgICAgICBlbHNlIGlmKGVTSVJfSFRfT1BfTU9ERV9OT19MRUdBQ1lfMjBNSFpfSFQgPT0gcEJjblN0cnVjdC0+SFRJbmZvLm9wTW9kZSkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgbGltVXBkYXRlT3ZlcmxhcFN0YVBhcmFtKHBNYWMsIHBNaC0+YnNzSWQsICYocE1hYy0+bGltLmdMaW1PdmVybGFwSHQyMFBhcmFtcykpOworCisgICAgICAgICAgICAgICAgICBpZiAocE1hYy0+bGltLmdMaW1PdmVybGFwSHQyMFBhcmFtcy5udW1TdGEgJiYKKyAgICAgICAgICAgICAgICAgICAgICAhcE1hYy0+bGltLmdMaW1PdmVybGFwSHQyMFBhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBsaW1FbmFibGVIVDIwUHJvdGVjdGlvbihwTWFjLCB0cnVlLCB0cnVlLCBwQmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0gICAgCisgICAgfQorICAgIGVsc2UgaWYoU0lSX0JBTkRfMl80X0dIWiA9PSByZkJhbmQpCisgICAgeworICAgICAgICAvL1dlIGFyZSAxMUcgQVAuCisgICAgICAgIGlmICgocGh5TW9kZSA9PSBXTklfQ0ZHX1BIWV9NT0RFXzExRykgJiYKKyAgICAgICAgICAgICAgKGZhbHNlID09IHBzZXNzaW9uRW50cnktPmh0Q2FwYWJpbGl0eSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChwQmNuU3RydWN0LT5jaGFubmVsTnVtYmVyID09IHBzZXNzaW9uRW50cnktPmN1cnJlbnRPcGVyQ2hhbm5lbCkgICAgICAgIAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICgoKCEocEJjblN0cnVjdC0+ZXJwUHJlc2VudCkpICYmIAorICAgICAgICAgICAgICAgICAgICAgICEocEJjblN0cnVjdC0+SFRJbmZvLnByZXNlbnQpKXx8IAorICAgICAgICAgICAgICAgICAgICAvL2lmIGVycCBub3QgcHJlc2VudCB0aGVuICAxMUIgQVAgb3ZlcmxhcHBpbmcKKyAgICAgICAgICAgICAgICAgICAgKCFwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLmlnbm9yZVBlZXJFcnBJbmZvICYmCisgICAgICAgICAgICAgICAgICAgICAgcEJjblN0cnVjdC0+ZXJwUHJlc2VudCAmJgorICAgICAgICAgICAgICAgICAgICAocEJjblN0cnVjdC0+ZXJwSUVJbmZvLnVzZVByb3RlY3Rpb24gfHwKKyAgICAgICAgICAgICAgICAgICAgcEJjblN0cnVjdC0+ZXJwSUVJbmZvLm5vbkVycFByZXNlbnQpKSkKKyAgICAgICAgICAgICAgICB7CisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRQorICAgICAgICAgICAgICAgICAgICBpZiggcHNlc3Npb25FbnRyeS0+aXNFU0Vjb25uZWN0aW9uICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFIChWT1NfTU9EVUxFX0lEX1BFLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBbSU5GT0xPR11FU0UgMTFnIGVycFByZXNlbnQ9JWQgdXNlUHJvdGVjdGlvbj0lZCBub25FcnBQcmVzZW50PSVkIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJjblN0cnVjdC0+ZXJwUHJlc2VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQmNuU3RydWN0LT5lcnBJRUluZm8udXNlUHJvdGVjdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQmNuU3RydWN0LT5lcnBJRUluZm8ubm9uRXJwUHJlc2VudCk7CisgICAgICAgICAgICAgICAgICAgIH0gCisjZW5kaWYgCisgICAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZU92ZXJsYXAxMWdQcm90ZWN0aW9uKHBNYWMsIHBCZWFjb25QYXJhbXMsIHBNaCxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSAgICAgICAgCisgICAgICAgIC8vIGhhbmRsaW5nIHRoZSBjYXNlIHdoZW4gSFQgQVAgaGFzIG92ZXJsYXBwaW5nIGxlZ2FjeSBCU1MuCisgICAgICAgIGVsc2UgaWYocHNlc3Npb25FbnRyeS0+aHRDYXBhYmlsaXR5KQorICAgICAgICB7ICAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKHBCY25TdHJ1Y3QtPmNoYW5uZWxOdW1iZXIgPT0gcHNlc3Npb25FbnRyeS0+Y3VycmVudE9wZXJDaGFubmVsKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoKCghKHBCY25TdHJ1Y3QtPmVycFByZXNlbnQpKSAmJiAKKyAgICAgICAgICAgICAgICAgICAgIShwQmNuU3RydWN0LT5IVEluZm8ucHJlc2VudCkpfHwgCisgICAgICAgICAgICAgICAgICAvL2lmIGVycCBub3QgcHJlc2VudCB0aGVuICAxMUIgQVAgb3ZlcmxhcHBpbmcKKyAgICAgICAgICAgICAgICAgICghcE1hYy0+cm9hbS5jb25maWdQYXJhbS5pZ25vcmVQZWVyRXJwSW5mbyAmJgorICAgICAgICAgICAgICAgICAgICBwQmNuU3RydWN0LT5lcnBQcmVzZW50ICYmCisgICAgICAgICAgICAgICAgICAocEJjblN0cnVjdC0+ZXJwSUVJbmZvLnVzZVByb3RlY3Rpb24gfHwKKyAgICAgICAgICAgICAgICAgIHBCY25TdHJ1Y3QtPmVycElFSW5mby5ub25FcnBQcmVzZW50KSkpCisgICAgICAgICAgICAgIHsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICAgICAgICAgICAgICAgICBpZiggcHNlc3Npb25FbnRyeS0+aXNFU0Vjb25uZWN0aW9uICkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UgKFZPU19NT0RVTEVfSURfUEUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBbSU5GT0xPR11FU0UgMTFnIGVycFByZXNlbnQ9JWQgdXNlUHJvdGVjdGlvbj0lZCBub25FcnBQcmVzZW50PSVkIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBCY25TdHJ1Y3QtPmVycFByZXNlbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBCY25TdHJ1Y3QtPmVycElFSW5mby51c2VQcm90ZWN0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICBwQmNuU3RydWN0LT5lcnBJRUluZm8ubm9uRXJwUHJlc2VudCk7CisgICAgICAgICAgICAgICAgICB9ICAKKyNlbmRpZiAKKyAgICAgICAgICAgICAgICAgIGxpbUVuYWJsZU92ZXJsYXAxMWdQcm90ZWN0aW9uKHBNYWMsIHBCZWFjb25QYXJhbXMsIHBNaCxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgIC8vMTFnIGRldmljZSBvdmVybGFwcworICAgICAgICAgICAgICBpZiAocEJjblN0cnVjdC0+ZXJwUHJlc2VudCAmJgorICAgICAgICAgICAgICAgICAgIShwQmNuU3RydWN0LT5lcnBJRUluZm8udXNlUHJvdGVjdGlvbiB8fCAKKyAgICAgICAgICAgICAgICAgICAgcEJjblN0cnVjdC0+ZXJwSUVJbmZvLm5vbkVycFByZXNlbnQpICYmICEocEJjblN0cnVjdC0+SFRJbmZvLnByZXNlbnQpKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGxpbVVwZGF0ZU92ZXJsYXBTdGFQYXJhbShwTWFjLCBwTWgtPmJzc0lkLCAmKHBzZXNzaW9uRW50cnktPmdMaW1PdmVybGFwMTFnUGFyYW1zKSk7CisKKyAgICAgICAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5nTGltT3ZlcmxhcDExZ1BhcmFtcy5udW1TdGEgJiYgCisgICAgICAgICAgICAgICAgICAgICAgIXBzZXNzaW9uRW50cnktPmdMaW1PdmVybGFwMTFnUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkKQorICAgICAgICAgICAgICA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gICAgICAgICAgLy9tb2RlIHdvdWxkIGhhdmUgYWxyZWFkeSBiZWVuIHNldCB0byBsZWdhY3kgaW4gdGhlIHByZXZpb3VzIGJsb2Nrcy4KKyAgICAgICAgICAgICAgICAgIGlmKGVTSVJfSFRfT1BfTU9ERV9PVkVSTEFQX0xFR0FDWSA9PSBwQmNuU3RydWN0LT5IVEluZm8ub3BNb2RlCisgICAgICAgICAgICAgICAgICAgICAmJiAhcE1hYy0+cm9hbS5jb25maWdQYXJhbS5pZ25vcmVQZWVySFRvcE1vZGUpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgaWYoKGVTSVJfSFRfT1BfTU9ERV9NSVhFRCAhPSBwTWFjLT5saW0uZ0hUT3Blck1vZGUpICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgIChlU0lSX0hUX09QX01PREVfT1ZFUkxBUF9MRUdBQ1kgIT0gcE1hYy0+bGltLmdIVE9wZXJNb2RlKSkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbVVwZGF0ZU92ZXJsYXBTdGFQYXJhbShwTWFjLCBwTWgtPmJzc0lkLCAmKHBzZXNzaW9uRW50cnktPmdMaW1PdmVybGFwMTFnUGFyYW1zKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5nTGltT3ZlcmxhcDExZ1BhcmFtcy5udW1TdGEgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICFwc2Vzc2lvbkVudHJ5LT5nTGltT3ZlcmxhcDExZ1BhcmFtcy5wcm90ZWN0aW9uRW5hYmxlZCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSHRQcm90ZWN0aW9uRnJvbTExZyhwTWFjLCB0cnVlLCB0cnVlLCBwQmVhY29uUGFyYW1zLHBzZXNzaW9uRW50cnkpOworICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgfSAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICBlbHNlIGlmKGVTSVJfSFRfT1BfTU9ERV9OT19MRUdBQ1lfMjBNSFpfSFQgPT0gcEJjblN0cnVjdC0+SFRJbmZvLm9wTW9kZSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBsaW1VcGRhdGVPdmVybGFwU3RhUGFyYW0ocE1hYywgcE1oLT5ic3NJZCwgJihwc2Vzc2lvbkVudHJ5LT5nTGltT3ZlcmxhcEh0MjBQYXJhbXMpKTsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAocHNlc3Npb25FbnRyeS0+Z0xpbU92ZXJsYXBIdDIwUGFyYW1zLm51bVN0YSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAhcHNlc3Npb25FbnRyeS0+Z0xpbU92ZXJsYXBIdDIwUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgbGltRW5hYmxlSFQyMFByb3RlY3Rpb24ocE1hYywgdHJ1ZSwgdHJ1ZSwgcEJlYWNvblBhcmFtcyxwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgCisgICAgICAgICAgICB9CisgICAgICAgIH0gICAgIAorICAgIH0KKyAgICBwTWFjLT5zY2guZ1NjaEJjbklnbm9yZWQrKzsKK30KKy8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworCisKKy8qKgorICogX19zY2hCZWFjb25Qcm9jZXNzTm9TZXNzaW9uCisgKgorICogRlVOQ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Y29udGV4dC4KKyAqICAgICAgICAgICAgICogSW5mcmEvSUJTUyBib3RoIGFjdGl2ZSBhbmQgcmVjZWl2ZXMgSW5mcmEgYmVhY29uOgorICogICAgICAgICAgICAgICAgICAtIGNhbGwgc2NoQmVhY29uUHJvY2Vzc0Zyb21BUCB3aXRoIHRoYXQgc2Vzc2lvbidzIGNvbnRleHQuCisgKiAgICAgICAgICAgICAgICAgICAgIGFueSB1cGRhdGVzIHRvIEVEQ0EgcGFyYW1ldGVycyB3aWxsIGJlIGVmZmVjdGl2ZSBmb3IgSUJTUyBhcyB3ZWxsLCAKKyAqICAgICAgICAgICAgICAgICAgICAgZXZlbiB0aG91Z2ggbm8gV01NIGZvciBJQlNTID8/IE5lZWQgdG8gZmlndXJlIG91dCBob3cgdG8gaGFuZGxlIHRoaXMgc2NlbmFyaW8uCisgKiAgICAgICAgICAgICAqIEluZnJhL0JUU1RBIGJvdGggYWN0aXZlIGFuZCByZWNlaXZlIEluZnJhIGJlYWNvbi4KKyAqICAgICAgICAgICAgICAgICAgLSBjaGFuZ2UgaW4gRURDQSBwYXJhbWV0ZXJzIG9uIEluZnJhIGFmZmVjdCB0aGUgQlRTVEEgbGluay4KKyAqICAgICAgICAgICAgICAgICAgICAgVXBkYXRlIHRoZSBzYW1lIHBhcmFtZXRlcnMgb24gQlQgbGluaworICogICAgICAgICAgICAgICogSW5mcmEvQlRTVEEgYm90aCBhY3RpdmUgYW5kIHJlY2VpdmUgQlQtQVAgYmVhY29uLgorICogICAgICAgICAgICAgICAgIC11cGRhdGUgYmVhY29uIGNudCBmb3IgaGVhcnRiZWF0CisgKiAgICAgICAgICAgICAqIEluZnJhL0JUQVAgYm90aCBhY3RpdmUgYW5kIHJlY2VpdmUgSW5mcmEgYmVhY29uLgorICogICAgICAgICAgICAgICAgIC0gQlQtQVAgc3RhcnRzIGFkdmVydGlzaW5nIEJFIHBhcmFtZXRlcnMgZnJvbSBJbmZyYSBBUCwgaWYgdGhleSBnZXQgY2hhbmdlZC4KKyAqCisgKiAgICAgICAgICAgICAqIEluZnJhL0JUQVAgYm90aCBhY3RpdmUgYW5kIHJlY2VpdmUgQlRTVEEgYmVhY29uLgorICogICAgICAgICAgICAgICAgLSB1cGRhdGUgYmVhY29uIGNudCBmb3IgaGVhcnRiZWF0CisgKi8KKworc3RhdGljIHZvaWQgX19zY2hCZWFjb25Qcm9jZXNzRm9yU2Vzc2lvbiggdHBBbmlTaXJHbG9iYWwgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTY2hCZWFjb25TdHJ1Y3QgICBwQmVhY29uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCogcFJ4UGFja2V0SW5mbywgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KQoreworICAgIHRBTklfVTMyICAgICAgICAgICAgICAgICAgICAgYmk7CisgICAgdEFOSV9VOCBic3NJZHggPSAwOworICAgIC8vdHBTaXJNYWNNZ210SGRyICAgICAgICAgcE1oID0gU0lSX01BQ19CRF9UT19NUERVSEVBREVSKHBSeFBhY2tldEluZm8pOworICAgIC8vdEFOSV9VOCBic3NpZFtzaXplb2YodFNpck1hY0FkZHIpXTsKKyAgICB0VXBkYXRlQmVhY29uUGFyYW1zIGJlYWNvblBhcmFtczsKKyAgICB0QU5JX1U4IHNlbmRQcm9iZVJlcSA9IEZBTFNFOworICAgIHRwRHBoSGFzaE5vZGUgcFN0YURzID0gTlVMTDsKKyAgICB0QU5JX1UzMiAgIGNoYW5uZWxCb25kaW5nTW9kZTsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgIHRwU2lyTWFjTWdtdEhkciAgICBwTWggPSBXREFfR0VUX1JYX01BQ19IRUFERVIocFJ4UGFja2V0SW5mbyk7CisgICAgdEFOSV9VMTYgIGFpZDsKKyAgICB0QU5JX1U4ICBvcGVyTW9kZTsKKyAgICB0QU5JX1U4ICBjaFdpZHRoID0gMDsKKyNlbmRpZgorI2lmIGRlZmluZWQgRkVBVFVSRV9XTEFOX0VTRSB8fCBkZWZpbmVkIFdMQU5fRkVBVFVSRV9WT1dJRkkKKyAgICAgdFBvd2VyZEJtIHJlZ01heCA9IDAsbWF4VHhQb3dlciA9IDA7CisjZW5kaWYKKworICAgIHZvc19tZW1femVybygmYmVhY29uUGFyYW1zLCBzaXplb2YodFVwZGF0ZUJlYWNvblBhcmFtcykpOworICAgIGJlYWNvblBhcmFtcy5wYXJhbUNoYW5nZUJpdG1hcCA9IDA7CisKKyAgICBpZihlTElNX1NUQV9JTl9JQlNTX1JPTEUgPT0gcHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSApCisgICAgeworICAgICAgICBpZiggbGltSGFuZGxlSUJTU2NvYWxlc2NpbmcocE1hYywgcEJlYWNvbiwgcFJ4UGFja2V0SW5mbywgcHNlc3Npb25FbnRyeSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICE9IGVTSVJfU1VDQ0VTUyApCisgICAgICAgICAgICByZXR1cm47CisgICAgfQorICAgIGVsc2UgaWYoICAoZUxJTV9TVEFfUk9MRSA9PSBwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlKSB8fCAKKyAgICAgICAgICAgICAgICAgIChlTElNX0JUX0FNUF9TVEFfUk9MRSA9PSBwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlKSkKKyAgICB7CisgICAgICAgIC8qCisgICAgICAgICogIFRoaXMgaGFuZGxlcyB0d28gY2FzZXM6CisgICAgICAgICogIC0tIEluZnJhIFNUQSByZWNldmluZyBiZWFjb25zIGZyb20gQVAgIAorICAgICAgICAqICAtLSBCVEFNUF9TVEEgcmVjZXZpbmcgYmVhY29ucyBmcm9tIEJUQU1QX0FQCisgICAgICAgICovCisgICAgICAgIC8vQWx3YXlzIHNhdmUgdGhlIGJlYWNvbiBpbnRvIExJTSdzIGNhY2hlZCBzY2FuIHJlc3VsdHMKKyAgICAgICAgbGltQ2hlY2tBbmRBZGRCc3NEZXNjcmlwdGlvbihwTWFjLCBwQmVhY29uLCBwUnhQYWNrZXRJbmZvLCBlQU5JX0JPT0xFQU5fRkFMU0UsIGVBTklfQk9PTEVBTl9GQUxTRSk7CisKKyAgICAgICAgLyoqCisgICAgICAgICAgICAgICAqIFRoaXMgaXMgdGhlIEJlYWNvbiByZWNlaXZlZCBmcm9tIHRoZSBBUCAgd2UncmUgY3VycmVudGx5IGFzc29jaWF0ZWQgd2l0aC4gQ2hlY2sKKyAgICAgICAgICAgICAgICogaWYgdGhlcmUgYXJlIGFueSBjaGFuZ2VzIGluIEFQJ3MgY2FwYWJpbGl0aWVzIAorICAgICAgICAgICAgICAgKi8KKyAgICAgICAgaWYoKHRBTklfVTgpIHBCZWFjb24tPmNoYW5uZWxOdW1iZXIgIT0gcHNlc3Npb25FbnRyeS0+Y3VycmVudE9wZXJDaGFubmVsKQorICAgICAgICB7CisgICAgICAgICAgICBQRUxPR0Uoc2NoTG9nKHBNYWMsIExPR0UsIEZMKCJDaGFubmVsIENoYW5nZSBmcm9tICVkIC0tPiAlZCAgLSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJJZ25vcmluZyBiZWFjb24hIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmN1cnJlbnRPcGVyQ2hhbm5lbCwgcEJlYWNvbi0+Y2hhbm5lbE51bWJlcik7KQorICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgIH0KKworICAgICAgICBpZiggUkZfQ0hBTl8xNCA+PSBwc2Vzc2lvbkVudHJ5LT5jdXJyZW50T3BlckNoYW5uZWwgKQorICAgICAgICB7CisgICAgICAgICAgIGNoYW5uZWxCb25kaW5nTW9kZSA9IHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uY2hhbm5lbEJvbmRpbmdNb2RlMjRHSHo7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgIGNoYW5uZWxCb25kaW5nTW9kZSA9IHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uY2hhbm5lbEJvbmRpbmdNb2RlNUdIejsKKyAgICAgICAgfQorCisgICAgICAgIGxpbURldGVjdENoYW5nZUluQXBDYXBhYmlsaXRpZXMocE1hYywgcEJlYWNvbiwgcHNlc3Npb25FbnRyeSk7CisgICAgICAgIGlmKGxpbUdldFN0YUhhc2hCc3NpZHgocE1hYywgRFBIX1NUQV9IQVNIX0lOREVYX1BFRVIsICZic3NJZHgsIHBzZXNzaW9uRW50cnkpICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgYmVhY29uUGFyYW1zLmJzc0lkeCA9IGJzc0lkeDsKKyAgICAgICAgdm9zX21lbV9jb3B5KCggdEFOSV9VOCogKSZwc2Vzc2lvbkVudHJ5LT5sYXN0QmVhY29uVGltZVN0YW1wLAorICAgICAgICAgICAgICAgICAgICAgKCB0QU5JX1U4KiApcEJlYWNvbi0+dGltZVN0YW1wLCBzaXplb2YodEFOSV9VNjQpKTsKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+bGFzdEJlYWNvbkR0aW1Db3VudCA9IHBCZWFjb24tPnRpbS5kdGltQ291bnQ7CisgICAgICAgIHBzZXNzaW9uRW50cnktPmxhc3RCZWFjb25EdGltUGVyaW9kPSBwQmVhY29uLT50aW0uZHRpbVBlcmlvZDsKKyAgICAgICAgcHNlc3Npb25FbnRyeS0+Y3VycmVudEJzc0JlYWNvbkNudCsrOworCisKKworICAgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgVFJ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FyYW1TZXQuY2ZwUGVyaW9kKTsKKyAgICAgICAgICAgIGxpbVNlbmRDRlBhcmFtcyhwTWFjLCBic3NJZHgsIHBCZWFjb24tPmNmUGFyYW1TZXQuY2ZwQ291bnQsIHBCZWFjb24tPmNmUGFyYW1TZXQuY2ZwUGVyaW9kKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChwQmVhY29uLT50aW1QcmVzZW50KQorICAgICAgICB7CisgICAgICAgICAgICBjZmdTZXRJbnQocE1hYywgV05JX0NGR19EVElNX1BFUklPRCwgcEJlYWNvbi0+dGltLmR0aW1QZXJpb2QpOworICAgICAgICAgICAgLy9ObyBuZWVkIHRvIHNlbmQgRFRJTSBQZXJpb2QgYW5kIENvdW50IHRvIEhBTC9TTUFDCisgICAgICAgICAgICAvL1NNQUMgYWxyZWFkeSBwYXJzZXMgVElNIGJpdC4KKyAgICAgICAgfQorCisgICAgICAgIGlmKHBNYWMtPmxpbS5nTGltUHJvdGVjdGlvbkNvbnRyb2wgIT0gV05JX0NGR19GT1JDRV9QT0xJQ1lfUFJPVEVDVElPTl9ESVNBQkxFKQorCisgICAgICAgIGxpbURlY2lkZVN0YVByb3RlY3Rpb24ocE1hYywgcEJlYWNvbiwgJmJlYWNvblBhcmFtcywgcHNlc3Npb25FbnRyeSk7CisgICAgICAgIGlmIChwQmVhY29uLT5lcnBQcmVzZW50KQorICAgICAgICB7CisgICAgICAgICAgICBpZiAocEJlYWNvbi0+ZXJwSUVJbmZvLmJhcmtlclByZWFtYmxlTW9kZSkKKyAgICAgICAgICAgICAgICBsaW1FbmFibGVTaG9ydFByZWFtYmxlKHBNYWMsIGZhbHNlLCAmYmVhY29uUGFyYW1zLCBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBsaW1FbmFibGVTaG9ydFByZWFtYmxlKHBNYWMsIHRydWUsICZiZWFjb25QYXJhbXMsIHBzZXNzaW9uRW50cnkpOworICAgICAgICAgIH0KKyAgICAgICAgbGltVXBkYXRlU2hvcnRTbG90KHBNYWMsIHBCZWFjb24sICZiZWFjb25QYXJhbXMscHNlc3Npb25FbnRyeSk7CisKKyAgICAgICAgcFN0YURzID0gZHBoR2V0SGFzaEVudHJ5KHBNYWMsIERQSF9TVEFfSEFTSF9JTkRFWF9QRUVSLCAmcHNlc3Npb25FbnRyeS0+ZHBoLmRwaEhhc2hUYWJsZSk7CisgICAgICAgIGlmICgocEJlYWNvbi0+d21lRWRjYVByZXNlbnQgJiYgKHBzZXNzaW9uRW50cnktPmxpbVdtZUVuYWJsZWQpKSB8fAorICAgICAgICAgICAgIChwQmVhY29uLT5lZGNhUHJlc2VudCAgICAmJiAocHNlc3Npb25FbnRyeS0+bGltUW9zRW5hYmxlZCkpKQorICAgICAgICB7CisgICAgICAgICAgICBpZihwQmVhY29uLT5lZGNhUGFyYW1zLnFvc0luZm8uY291bnQgIT0gcHNlc3Npb25FbnRyeS0+Z0xpbUVkY2FQYXJhbVNldENvdW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChzY2hCZWFjb25FZGNhUHJvY2VzcyhwTWFjLCAmcEJlYWNvbi0+ZWRjYVBhcmFtcywgcHNlc3Npb25FbnRyeSkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgICAgICAgICBQRUxPR0Uoc2NoTG9nKHBNYWMsIExPR0UsIEZMKCJFRENBIHBhcmFtZXRlciBwcm9jZXNzaW5nIGVycm9yIikpOykKKyAgICAgICAgICAgICAgICBlbHNlIGlmKHBTdGFEcyAhPSBOVUxMKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gSWYgbmVlZGVkLCBkb3duZ3JhZGUgdGhlIEVEQ0EgcGFyYW1ldGVycworICAgICAgICAgICAgICAgICAgICBsaW1TZXRBY3RpdmVFZGNhUGFyYW1zKHBNYWMsIHBzZXNzaW9uRW50cnktPmdMaW1FZGNhUGFyYW1zLCBwc2Vzc2lvbkVud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hYywgJnBCZWFjb24tPkhUSW5mbywgYnNzSWR4LHBzZXNzaW9uRW50cnkpOworICAgIH0KKworICAgIGlmICggKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9TVEFfUk9MRSkgfHwocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX0JUX0FNUF9TVEFfUk9MRSkgfHwKKyAgICAgICAgICAocHNlc3Npb25FbnRyeS0+bGltU3lzdGVtUm9sZSA9PSBlTElNX1NUQV9JTl9JQlNTX1JPTEUpICkKKyAgICB7CisgICAgICAgIC8qIENoYW5uZWwgU3dpdGNoIGluZm9ybWF0aW9uIGVsZW1lbnQgdXBkYXRlZCAqLworICAgICAgICBpZihwQmVhY29uLT5jaGFubmVsU3dpdGNoUHJlc2VudCB8fAorICAgICAgICAgICAgcEJlYWNvbi0+cHJvcElFaW5mby5wcm9wQ2hhbm5lbFN3aXRjaFByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGxpbVVwZGF0ZUNoYW5uZWxTd2l0Y2gocE1hYywgcEJlYWNvbiwgcHNlc3Npb25FbnRyeSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocHNlc3Npb25FbnRyeS0+Z0xpbVNwZWNNZ210LmRvdDExaENoYW5Td1N0YXRlID09IGVMSU1fMTFIX0NIQU5TV19SVU5OSU5HKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1DYW5jZWxEb3QxMWhDaGFubmVsU3dpdGNoKHBNYWMsIHBzZXNzaW9uRW50cnkpOworICAgICAgICB9CisgICAgICAgIC8vIGNoZWNrIGZvciBIVCBjYXBhYmlsaXR5CisgICAgICAgIHBTdGFEcyA9IGRwaExvb2t1cEhhc2hFbnRyeShwTWFjLCBwTWgtPnNhLCAmYWlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBzZXNzaW9uRW50cnktPmRwaC5kcGhIYXNoVGFibGUpOworICAgICAgICAv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hcnlDaGFubmVsT2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgcEJlYWNvbi0+SFRJbmZvLnNlY29uZGFyeUNoYW5uZWxPZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPnN0YUluZGV4KTsKKyAgICAgICAgICAgICAgaWYgKGVBTklfQk9PTEVBTl9UUlVFID09KGxpbUNoZWNrSFRDaGFuQm9uZE1vZGVDaGFuZ2UocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCZWFjb24tPkhUSW5mby5zZWNvbmRhcnlDaGFubmVsT2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+aHRTZWNvbmRhcnlDaGFubmVsT2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+c3RhSW5kZXgpKSkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgcFN0YURzLT5odFN1cHBvcnRlZENoYW5uZWxXaWR0aFNldCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCZWFjb24tPkhUSW5mby5yZWNvbW1lbmRlZFR4V2lkdGhTZXQ7CisgICAgICAgICAgICAgICAgICBwU3RhRHMtPmh0U2Vjb25kYXJ5Q2hhbm5lbE9mZnNldCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCZWFjb24tPkhUSW5mby5zZWNvbmRhcnlDaGFubmVsT2Zmc2V0OworICAgICAgICAgICAgICAgICAgbGltVXBkYXRlTWF4UmF0ZUZsYWcocE1hYywgcHNlc3Npb25FbnRyeS0+c21lU2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltR2V0TWF4UmF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0YUluZGV4ICkgJiYKKyAgICAgICAgICAgIChXTklfQ0ZHX0NIQU5ORUxfQk9ORElOR19NT0RFX0RJU0FCTEUgIT0gY2hhbm5lbEJvbmRpbmdNb2RlKSApCisgICAgICAgeworICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT52aHRDYXBhYmlsaXR5ICYmIHBCZWFjb24tPk9wZXJhdGluZ01vZGUucHJlc2VudCApCisgICAgICAgICAgeworICAgICAgICAgICAgIG9wZXJNb2RlID0gcFN0YURzLT52aHRTdXBwb3J0ZWRDaGFubmVsV2lkdGhTZXQgPworICAgICAgICAgICAgICAgIGVIVF9DSEFOTkVMX1dJRFRIXzgwTUhaIDoKKyAgICAgICAgICAgICAgICBwU3RhRHMtPmh0U3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0ID8KKyAgICAgICAgICAgICAgICBlSFRfQ0hBTk5FTF9XSURUSF80ME1IWjogZUhUX0NIQU5ORUxfV0lEVEhfMjBNSFo7CisgICAgICAgICAgICAgaWYgKG9wZXJNb2RlICE9IHBCZWFjb24tPk9wZXJhdGluZ01vZGUuY2hhbldpZHRoKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBzY2hMb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiIHJlY2VpdmVkIE9wTW9kZSBDaGFud2lkdGggJWQsIHN0YUlkeCA9ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgcEJlYWNvbi0+T3BlcmF0aW5nTW9kZS5jaGFuV2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5zdGFJbmRleCk7CisgICAgICAgICAgICAgICAgICAgc2NoTG9nKHBNYWMsIExPRzEsIEZMKCIgTUFDIC0iIE1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocE1oLT5zYSkpOworCisgICAgICAgICAgICAgICAgICAgaWYgKHBCZWFjb24tPk9wZXJhdGluZ01vZGUuY2hhbldpZHRoID09IGVIVF9DSEFOTkVMX1dJRFRIXzgwTUhaKQorICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBzY2hMb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiVXBkYXRpbmcgdGhlIENIIFdpZHRoIHRvIDgwTUh6IikpOworICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+dmh0U3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX1ZIVF9DSEFOTkVMX1dJRFRIXzgwTUhaOworICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+aHRTdXBwb3J0ZWRDaGFubmVsV2lkdGhTZXQgPSBlSFRfQ0hBTk5FTF9XSURUSF80ME1IWjsKKyAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocEJlYWNvbi0+T3BlcmF0aW5nTW9kZS5jaGFuV2lkdGggPT0gZUhUX0NIQU5ORUxfV0lEVEhfNDBNSFopCisgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIHNjaExvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJVcGRhdGluZyB0aGUgQ0ggV2lkdGggdG8gNDBNSHoiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT52aHRTdXBwb3J0ZWRDaGFubmVsV2lkdGhTZXQgPQorICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfVkhUX0NIQU5ORUxfV0lEVEhfMjBfNDBNSFo7CisgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5odFN1cHBvcnRlZENoYW5uZWxXaWR0aFNldCA9IGVIVF9DSEFOTkVMX1dJRFRIXzQwTUhaOworICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChwQmVhY29uLT5PcGVyYXRpbmdNb2RlLmNoYW5XaWR0aCA9PQorICAgICAgICAgICAgICAgICAgICAgICAgIGVIVF9DSEFOTkVMX1dJRFRIXzIwTUhaKQorICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBzY2hMb2cocE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiVXBkYXRpbmcgdGhlIENIIFdpZHRoIHRvIDIwTUh6IikpOworICAgICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+dmh0U3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX1ZIVF9DSEFOTkVMX1dJRFRIXzIwXzQwTUhaOworICAgICAgICAgICAgICAgICAgICAgIHBTdGFEcy0+aHRTdXBwb3J0ZWRDaGFubmVsV2lkdGhTZXQgPSBlSFRfQ0hBTk5FTF9XSURUSF8yME1IWjsKKyAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbGltQ2hlY2tWSFRPcE1vZGVDaGFuZ2UocE1hYywgcHNlc3Npb25FbnRyeSwKKyAgICAgICAgICAgICAgICAgICAgICBwQmVhY29uLT5PcGVyYXRpbmdNb2RlLmNoYW5XaWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPnN0YUluZGV4KTsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHBzZXNzaW9uRW50cnktPnZodENhcGFiaWxpdHkgJiYgcEJlYWNvbi0+VkhUT3BlcmF0aW9uLnByZXNlbnQpCisgICAgICAgICAgeworICAgICAgICAgICAgIG9wZXJNb2RlID0gcFN0YURzLT52aHRTdXBwb3J0ZWRDaGFubmVsV2lkdGhTZXQ7CisgICAgICAgICAgICAgaWYgKG9wZXJNb2RlICE9IHBCZWFjb24tPlZIVE9wZXJhdGlvbi5jaGFuV2lkdGgpCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIHNjaExvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCIgcmVjZWl2ZWQgVkhUT1AgQ0hXaWR0aCAlZCBzdGFJZHggPSAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgIHBCZWFjb24tPlZIVE9wZXJhdGlvbi5jaGFuV2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5zdGFJbmRleCk7CisgICAgICAgICAgICAgICAgICAgc2NoTG9nKHBNYWMsIExPRzEsIEZMKCIgTUFDIC0iIE1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBNaC0+c2EpKTsKKworICAgICAgICAgICAgICAgICAgIGlmIChwQmVhY29uLT5WSFRPcGVyYXRpb24uY2hhbldpZHRoID09CisgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19WSFRfQ0hBTk5FTF9XSURUSF84ME1IWikKKyAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgc2NoTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIlVwZGF0aW5nIHRoZSBDSCBXaWR0aCB0byA4ME1IeiIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPnZodFN1cHBvcnRlZENoYW5uZWxXaWR0aFNldCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19WSFRfQ0hBTk5FTF9XSURUSF84ME1IWjsKKyAgICAgICAgICAgICAgICAgICAgICBwU3RhRHMtPmh0U3VwcG9ydGVkQ2hhbm5lbFdpZHRoU2V0ID0gZUhUX0NIQU5ORUxfV0lEVEhfNDBNSFo7CisgICAgICAgICAgICAgICAgICAgICAgY2hXaWR0aCA9IGVIVF9DSEFOTkVMX1dJRFRIXzgwTUhaOworICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChwQmVhY29uLT5WSFRPcGVyYXRpb24uY2hhbldpZHRoID09CisgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19WSFRfQ0hBTk5FTF9XSURUSF8yMF80ME1IWikKKyAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT52aHRTdXBwb3J0ZWRDaGFubmVsV2lkdGhTZXQgPQorICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfVkhUX0NIQU5ORUxfV0lEVEhfMjBfNDBNSFo7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKHBCZWFjb24tPkhUQ2Fwcy5zdXBwb3J0ZWRDaGFubmVsV2lkdGhTZXQpCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgIHNjaExvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJVcGRhdGluZyB0aGUgQ0ggV2lkdGggdG8gNDBNSHoiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5odFN1cHBvcnRlZENoYW5uZWxXaWR0aFNldCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUhUX0NIQU5ORUxfV0lEVEhfNDBNSFo7CisgICAgICAgICAgICAgICAgICAgICAgICAgY2hXaWR0aCA9IGVIVF9DSEFOTkVMX1dJRFRIXzQwTUhaOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgIHNjaExvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJVcGRhdGluZyB0aGUgQ0ggV2lkdGggdG8gMjBNSHoiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YURzLT5odFN1cHBvcnRlZENoYW5uZWxXaWR0aFNldCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUhUX0NIQU5ORUxfV0lEVEhfMjBNSFo7CisgICAgICAgICAgICAgICAgICAgICAgICAgY2hXaWR0aCA9IGVIVF9DSEFOTkVMX1dJRFRIXzIwTUhaOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbGltQ2hlY2tWSFRPcE1vZGVDaGFuZ2UocE1hYywgcHNlc3Npb25FbnRyeSwKKyAgICAgICAgICAgICAgICAgICAgICBjaFdpZHRoLCBwU3RhRHMtPnN0YUluZGV4KTsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgIH0KKyAgICB9CisjZW5kaWYKKworI2lmIGRlZmluZWQgKEZFQVRVUkVfV0xBTl9FU0UpIHx8IGRlZmluZWQgKFdMQU5fRkVBVFVSRV9WT1dJRkkpCisgICAgLyogT2J0YWluIHRoZSBNYXggVHggcG93ZXIgZm9yIHRoZSBjdXJyZW50IHJlZ3VsYXRvcnkgICovCisgICAgcmVnTWF4ID0gY2ZnR2V0UmVndWxhdG9yeU1heFRyYW5zbWl0UG93ZXIoIHBNYWMsIHBzZXNzaW9uRW50cnktPmN1cnJlbnRPcGVyQ2hhbm5lbCApOworI2VuZGlmCisjaWYgZGVmaW5lZCBXTEFOX0ZFQVRVUkVfVk9XSUZJCisgICAgeworICAgICAgICB0UG93ZXJkQm0gIGxvY2FsUlJNQ29uc3RyYWludCA9IDA7CisgICAgICAgIGlmICggcE1hYy0+cnJtLnJybVBFQ29udGV4dC5ycm1FbmFibGUgJiYgcEJlYWNvbi0+cG93ZXJDb25zdHJhaW50UHJlc2VudCApCisgICAgICAgIHsKKyAgICAgICAgICAgIGxvY2FsUlJNQ29uc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jaEJCWHBvcnRSY3ZDbnQrKzsKKworCisgICAgICAgICAgICBwQkQgPSAodEFOSV9VMzIgKikgcFNjaE1zZy0+Ym9keXB0cjsKKworCisgICAgICAgICAgICBtaCA9IFNJUl9NQUNfQkRfVE9fTVBEVUhFQURFUiggcEJEICk7CisKKyAgICAgICAgICAgIGlmIChtaC0+ZmMudHlwZSA9PSBTSVJfTUFDX01HTVRfRlJBTUUgJiYKKyAgICAgICAgICAgICAgICBtaC0+ZmMuc3ViVHlwZSA9PSBTSVJfTUFDX01HTVRfQkVBQ09OKQorICAgICAgICAgICAgICAgIHNjaEJlYWNvblByb2Nlc3MocE1hYywgcEJEKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzY2hMb2cocE1hYywgTE9HRSwgRkwoIlVuZXhwZWN0ZWQgbWVzc2FnZSAoJWQsJWQpIHJjdmQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgbWgtPmZjLnR5cGUsIG1oLT5mYy5zdWJUeXBlKTsKKyAgICAgICAgICAgICAgICBwTWFjLT5zY2guZ1NjaFVua25vd25SY3ZDbnQrKzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworI2VuZGlmCisKKyAgICAgICAgY2FzZSBTSVJfU0NIX0NIQU5ORUxfU1dJVENIX1JFUVVFU1Q6CisgICAgICAgICAgICBzY2hMb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICBGTCgiQ2hhbm5lbCBzd2l0Y2ggcmVxdWVzdCBub3QgaGFuZGxlZCIpKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgU0lSX1NDSF9TVEFSVF9TQ0FOX1JFUToKKyAgICAgICAgICAgIHBNYWMtPnNjaC5nU2NoU2NhblJlcVJjdmQgPSB0cnVlOworICAgICAgICAgICAgaWYgKHBNYWMtPnNjaC5nU2NoSGNmRW5hYmxlZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBJbiBIQ0YgbW9kZSwgd2FpdCBmb3IgVEZQIHRvIHN0b3AgYmVmb3JlIHNlbmRpbmcgYSByZXNwb25zZQorICAgICAgICAgICAgICAgIGlmIChwTWFjLT5zY2guc2NoT2JqZWN0LmdTY2hDRkJJbml0aWF0ZWQgfHwKKyAgICAgICAgICAgICAgICAgICAgcE1hYy0+c2NoLnNjaE9iamVjdC5nU2NoQ0ZQSW5pdGlhdGVkKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBQRUxPRzEoc2NoTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiV2FpdGluZyBmb3IgVEZQIHRvIGhhbHQgYmVmb3JlIHNlbmRpbmcgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInN0YXJ0IHNjYW4gcmVzcG9uc2UiKSk7KQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHNjaFNlbmRTdGFydFNjYW5Sc3AocE1hYyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gSW4gZURDRiBtb2RlLCBzZW5kIHRoZSByZXNwb25zZSByaWdodCBhd2F5CisgICAgICAgICAgICAgICAgc2NoU2VuZFN0YXJ0U2NhblJzcChwTWFjKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgU0lSX1NDSF9FTkRfU0NBTl9OVEY6CisgICAgICAgICAgIFBFTE9HMyhzY2hMb2cocE1hYywgTE9HMywKKyAgICAgICAgICAgICAgICAgICBGTCgiUmVjZWl2ZWQgU1RPUF9TQ0FOX05URiBmcm9tIExJTSIpKTspCisgICAgICAgICAgICBwTWFjLT5zY2guZ1NjaFNjYW5SZXFSY3ZkID0gZmFsc2U7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFNJUl9DRkdfUEFSQU1fVVBEQVRFX0lORDoKKworICAgICAgICAgICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsICh0QU5JX1UxNikgcFNjaE1zZy0+Ym9keXZhbCwgJnZhbCkgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICAgICAgICAgIHNjaExvZyhwTWFjLCBMT0dQLCBGTCgiZmFpbGVkIHRvIGNmZyBnZXQgaWQgJWQiKSwgcFNjaE1zZy0+Ym9keXZhbCk7CisKKyAgICAgICAgICAgIHN3aXRjaCAocFNjaE1zZy0+Ym9keXZhbCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjYXNlIFdOSV9DRkdfQkVBQ09OX0lOVEVSVkFMOgorICAgICAgICAgICAgICAgICAgICAvLyBXaGF0IHRvIGRvIGZvciBJQlNTID8/IC0gVEJECisgICAgICAgICAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQVBfUk9MRSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjaFNldEJlYWNvbkludGVydmFsKHBNYWMscHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisKKyAgICAgICAgICAgICAgICBjYXNlIFdOSV9DRkdfRFRJTV9QRVJJT0Q6CisgICAgICAgICAgICAgICAgICAgIHBNYWMtPnNjaC5zY2hPYmplY3QuZ1NjaERUSU1Db3VudCA9IDA7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBXTklfQ0ZHX0NGUF9QRVJJT0Q6CisgICAgICAgICAgICAgICAgICAgIHBNYWMtPnNjaC5zY2hPYmplY3QuZ1NjaENGUENvdW50ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIFdOSV9DRkdfRURDQV9QUk9GSUxFOgorICAgICAgICAgICAgICAgICAgICBzY2hFZGNhUHJvZmlsZVVwZGF0ZShwTWFjLCBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIFdOSV9DRkdfRURDQV9BTklfQUNCS19MT0NBTDoKKyAgICAgICAgICAgICAgICBjYXNlIFdOSV9DRkdfRURDQV9BTklfQUNCRV9MT0NBTDoKKyAgICAgICAgICAgICAgICBjYXNlIFdOSV9DRkdfRURDQV9BTklfQUNWSV9MT0NBTDoKKyAgICAgICAgICAgICAgICBjYXNlIFdOSV9DRkdfRURDQV9BTklfQUNWT19MT0NBTDoKKyAgICAgICAgICAgICAgICBjYXNlIFdOSV9DRkdfRURDQV9XTUVfQUNCS19MT0NBTDoKKyAgICAgICAgICAgICAgICBjYXNlIFdOSV9DRkdfRURDQV9XTUVfQUNCRV9MT0NBTDoKKyAgICAgICAgICAgICAgICBjYXNlIFdOSV9DRkdfRURDQV9XTUVfQUNWSV9MT0NBTDoKKyAgICAgICAgICAgICAgICBjYXNlIFdOSV9DRkdfRURDQV9XTUVfQUNWT19MT0NBTDoKKyAgICAgICAgICAgICAgICAgICAgaWYgKHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgPT0gZUxJTV9BUF9ST0xFKQorICAgICAgICAgICAgICAgICAgICAgICAgc2NoUW9zVXBkYXRlTG9jYWwocE1hYywgcHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBXTklfQ0ZHX0VEQ0FfQU5JX0FDQks6CisgICAgICAgICAgICAgICAgY2FzZSBXTklfQ0ZHX0VEQ0FfQU5JX0FDQkU6CisgICAgICAgICAgICAgICAgY2FzZSBXTklfQ0ZHX0VEQ0FfQU5JX0FDVkk6CisgICAgICAgICAgICAgICAgY2FzZSBXTklfQ0ZHX0VEQ0FfQU5JX0FDVk86CisgICAgICAgICAgICAgICAgY2FzZSBXTklfQ0ZHX0VEQ0FfV01FX0FDQks6CisgICAgICAgICAgICAgICAgY2FzZSBXTklfQ0ZHX0VEQ0FfV01FX0FDQkU6CisgICAgICAgICAgICAgICAgY2FzZSBXTklfQ0ZHX0VEQ0FfV01FX0FDVkk6CisgICAgICAgICAgICAgICAgY2FzZSBXTklfQ0ZHX0VEQ0FfV01FX0FDVk86CisgICAgICAgICAgICAgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5saW1TeXN0ZW1Sb2xlID09IGVMSU1fQVBfUk9MRSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbUVkY2FQYXJhbVNldENvdW50Kys7CisgICAgICAgICAgICAgICAgICAgICAgICBzY2hRb3NVcGRhdGVCcm9hZGNhc3QocE1hYywgcHNlc3Npb25FbnRyeSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICBzY2hMb2cocE1hYywgTE9HRSwgRkwoIkNmZyBwYXJhbSAlZCBpbmRpY2F0aW9uIG5vdCBoYW5kbGVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NoTXNnLT5ib2R5dmFsKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBzY2hMb2cocE1hYywgTE9HRSwgRkwoIlVua25vd24gbWVzc2FnZSBpbiBzY2hNc2dRIHR5cGUgJWQiKSwKKyAgICAgICAgICAgICAgICAgICBwU2NoTXNnLT50eXBlKTsKKyAgICB9CisKK30KKworCisvLyBnZXQgdGhlIGxvY2FsIG9yIGJyb2FkY2FzdCBwYXJhbWV0ZXJzIGJhc2VkIG9uIHRoZSBwcm9maWxlIHNlcGNpZmllZCBpbiB0aGUgY29uZmlnC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ZJTEVfQU5JOworICAgIH0KKworICAgIHNjaExvZyhwTWFjLCBMT0dXLCBGTCgiRWRjYVByb2ZpbGU6IFVzaW5nICVkICglcykiKSwgIHZhbCwKKyAgICAgICAgICAgKCh2YWwgPT0gV05JX0NGR19FRENBX1BST0ZJTEVfV01NKSA/ICJXTU0iCisgICAgICAgICAgIDogKCAodmFsID09IFdOSV9DRkdfRURDQV9QUk9GSUxFX1RJVF9ERU1PKSA/ICJUaXRhbiIgOiAiSGlQZXJmIikpKTsKKworICAgIGlmIChsb2NhbCkKKyAgICB7CisgICAgICAgIHN3aXRjaCAodmFsKQorICAgICAgICB7CisgICAgICAgICAgIGNhc2UgV05JX0NGR19FRENBX1BST0ZJTEVfV01NOgorICAgICAgICAgICAgICBwcmYgPSAmd21lX2xbMF07CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICBjYXNlIFdOSV9DRkdfRURDQV9QUk9GSUxFX1RJVF9ERU1POgorICAgICAgICAgICAgICBwcmYgPSAmZGVtb19sWzBdOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgY2FzZSBXTklfQ0ZHX0VEQ0FfUFJPRklMRV9BTkk6CisgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgIHByZiA9ICZhbmlfbFswXTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgc3dpdGNoICh2YWwpCisgICAgICAgIHsKKyAgICAgICAgICAgY2FzZSBXTklfQ0ZHX0VEQ0FfUFJPRklMRV9XTU06CisgICAgICAgICAgICAgIHByZiA9ICZ3bWVfYlswXTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgIGNhc2UgV05JX0NGR19FRENBX1BST0ZJTEVfVElUX0RFTU86CisgICAgICAgICAgICAgIHByZiA9ICZkZW1vX2JbMF07CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICBjYXNlIFdOSV9DRkdfRURDQV9QUk9GSUxFX0FOSToKKyAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgcHJmID0gJmFuaV9iWzBdOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIGZvciAoaT0wOyBpIDwgNDsgaSsrKQorICAgIHsKKyAgICAgICAgdEFOSV9VOCAgZGF0YVtXTklfQ0ZHX0VEQ0FfQU5JX0FDQktfTEVOXTsKKyAgICAgICAgdEFOSV9VMzIgbGVuID0gV05JX0NGR19FRENBX0FOSV9BQ0JLX0xPQ0FMX0xFTjsKKyAgICAgICAgaWYgKHdsYW5fY2ZnR2V0U3RyKHBNYWMsICh0QU5JX1UxNikgcHJmW2ldLCAodEFOSV9VOCAqKSAmZGF0YVswXSwgJmxlbikgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICBzY2hMb2cocE1hYywgTE9HUCwgRkwoImNmZ0dldCBmYWlsZWQgZm9yICVkIiksIHByZltpXSk7CisgICAgICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgICAgICB9CisgICAgICAgIGlmIChsZW4gPiBXTklfQ0ZHX0VEQ0FfQU5JX0FDQktfTE9DQUxfTEVOKQorICAgICAgICB7CisgICAgICAgICAgICBzY2hMb2cocE1hYywgTE9HRSwgRkwoImNmZ0dldCBmb3IgJWQ6IGxlbmd0aCBpcyAlZCBpbnN0ZWFkIG9mICVkIiksCisgICAgICAgICAgICAgICAgICAgcHJmW2ldLCBsZW4sIFdOSV9DRkdfRURDQV9BTklfQUNCS19MT0NBTF9MRU4pOworICAgICAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICAgICAgfQorICAgICAgICBmb3IgKGlkeD0wOyBpZHggPCBsZW47IGlkeCsrKQorICAgICAgICAgICAgcGFyYW1zW2ldW2lkeF0gPSAodEFOSV9VMzIpIGRhdGFbaWR4XTsKKyAgICB9CisgICAgUEVMT0cxKHNjaExvZyhwTW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npb246IEFDIDolZDogQUlGU046ICVkLCBBQ00gJWQsIENXbWluICVkLCBDV21heCAlZCwgVHhPcCAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICBqLAorICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbUVkY2FQYXJhbXNCQ1tqXS5hY2kuYWlmc24sCisgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltRWRjYVBhcmFtc0JDW2pdLmFjaS5hY20sCisgICAgICAgICAgICAgICAgICAgICAgICBwc2Vzc2lvbkVudHJ5LT5nTGltRWRjYVBhcmFtc0JDW2pdLmN3Lm1pbiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW1FZGNhUGFyYW1zQkNbal0uY3cubWF4LAorICAgICAgICAgICAgICAgICAgICAgICAgcHNlc3Npb25FbnRyeS0+Z0xpbUVkY2FQYXJhbXNCQ1tqXS50eG9wbGltaXQpOykKKworICAgICAgICAgICAgfQorICAgICAgICAgICAgLyogT25jZSBhdGxlYXN0IG9uZSBjb25jdXJyZW50IHNlc3Npb24gb24gc2FtZSBjaGFubmVsIGlzIGZvdW5kIGFuZCBXTU0gYnJvYWRjYXN0IHBhcmFtcyBmb3IgY3VycmVudCBTb2Z0QVAvR08gc2Vzc2lvbiB1cGRhdGVkLCByZXR1cm4qLworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9Cit9CisKK3ZvaWQKK3NjaFFvc1VwZGF0ZUJyb2FkY2FzdCh0cEFuaVNpckdsb2JhbCBwTWFjLCB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KQoreworICAgIHRBTklfVTMyICAgICAgICBwYXJhbXNbNF1bV05JX0NGR19FRENBX0FOSV9BQ0JLX0xPQ0FMX0xFTl07CisgICAgdEFOSV9VMzIgICAgICAgIGN3bWluaWR4LCBjd21heGlkeCwgdHhvcGlkeDsKKyAgICB0QU5JX1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RTT0VWRVIgUkVTVUxUSU5HIEZST00gTE9TUyBPRiBVU0UsIERBVEEgT1IKKyAqIFBST0ZJVFMsIFdIRVRIRVIgSU4gQU4gQUNUSU9OIE9GIENPTlRSQUNULCBORUdMSUdFTkNFIE9SIE9USEVSCisgKiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SCisgKiBQRVJGT1JNQU5DRSBPRiBUSElTIFNPRlRXQVJFLgorICovCisKKy8qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisjaWZuZGVmIFdMQU5fUUNUX1dMQU5TQVBfSAorI2RlZmluZSBXTEFOX1FDVF9XTEFOU0FQX0gKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgVyBMIEEgTiAgIFMgTyBGIFQgQSBQICBQIEEgTCAgIEwgQSBZIEUgUiAKKyAgICAgICAgICAgICAgICAgICAgICAgRSBYIFQgRSBSIE4gQSBMICBBIFAgSQorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgIAorREVTQ1JJUFRJT04KKyAgVGhpcyBmaWxlIGNvbnRhaW5zIHRoZSBleHRlcm5hbCBBUEkgZXhwb3NlZCBieSB0aGUgd2xhbiBTQVAgUEFMIGxheWVyIAorICBtb2R1bGUuCisgIAorICAgICAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICBFRElUIEhJU1RPUlkgRk9SIEZJTEUKKworCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLgorICBOb3RpY2UgdGhhdCBjaGFuZ2VzIGFyZSBsaXN0ZWQgaW4gcmV2ZXJzZSBjaHJvbm9sb2dpY2FsIG9yZGVyLgorCisKKyAgJEhlYWRlcjogL2N5Z2RyaXZlL2QvQnVpbGRzL003MjAxSlNEQ0FBUEFENTIyNDBCL1dNL3BsYXRmb3JtL21zbTcyMDAvU3JjL0RyaXZlcnMvU0QvQ2xpZW50RHJpdmVycy9XTEFOL1FDVF9CVEFNUF9SU04vQ09SRS9TQVAvaW5jL3NhcEFwaS5oLHYgMS4yMSAyMDA5LzAzLzA5IDA4OjU4OjI2IGp6bXVkYSBFeHAganptdWRhICQgJERhdGVUaW1lOiAkICRBdXRob3I6IGp6bXVkYSAkCisKKword2hlbiAgICAgICAgICAgd2hvICAgICAgICAgICAgICAgIHdoYXQsIHdoZXJlLCB3aHkKKy0tLS0tLS0tICAgIC0tLSAgICAgICAgICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorMDcvMDEvMDggICAgIFNBUCB0ZWFtICAgICAgIENyZWF0ZWQgbW9kdWxlLgorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICA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HZfVThfdCAgICAgICAgICBtYXhfbnVtX3N0YTsgICAgIC8qIG1heGltdW0gbnVtYmVyIG9mIFNUQXMgaW4gc3RhdGlvbiB0YWJsZSAqLworICAgIHZfVThfdCAgICAgICAgICBkdGltX3BlcmlvZDsgICAgIC8qIGR0aW0gaW50ZXJ2YWwgKi8KKyAgICB2X1U4X3QgICAgICAgICAgbnVtX2FjY2VwdF9tYWM7CisgICAgdl9VOF90ICAgICAgICAgIG51bV9kZW55X21hYzsKKyAgICB2X1U4X3QgICAgICAgICAgKnBSU05XUEFSZXFJRTsgICAvL0lmIG5vdCBudWxsLCBpdCBoYXMgdGhlIElFIGJ5dGUgc3RyZWFtIGZvciBSU04gL1dQQQorCisgICAgdl9VOF90ICAgICAgICAgIGNvdW50cnlDb2RlW1dOSV9DRkdfQ09VTlRSWV9DT0RFX0xFTl07ICAvL2l0IGlzIGlnbm9yZWQgaWYgWzBdIGlzIDAuCisgICAgdl9VOF90ICAgICAgICAgIFJTTkF1dGhUeXBlOworICAgIHZfVThfdCAgICAgICAgICBSU05FbmNyeXB0VHlwZTsKKyAgICB2X1U4X3QgICAgICAgICAgbWNSU05FbmNyeXB0VHlwZTsKKyAgICBlU2FwQXV0aFR5cGUgICAgYXV0aFR5cGU7CisgICAgdl9CT09MX3QgICAgICAgIHByaXZhY3k7CisgICAgdl9CT09MX3QgICAgICAgIFVhcHNkRW5hYmxlOworICAgIHZfQk9PTF90ICAgICAgICBmd2RXUFNQQkNQcm9iZVJlcTsKKyAgICB2X1U4X3QgICAgICAgICAgd3BzX3N0YXRlOyAvLyAwIC0gZGlzYWJsZWQsIDEgLSBub3QgY29uZmlndXJlZCAsIDIgLSBjb25maWd1cmVkCisKKyAgICB2X1UxNl90ICAgICAgICAgaHRfY2FwYWI7CisgICAgdl9VMTZfdCAgICAgICAgIFJTTldQQVJlcUlFTGVuZ3RoOyAgIC8vVGhlIGJ5dGUgY291bnQgaW4gdGhlIHBXUEFSZXFJRQorCisgICAgdl9VMzJf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DAwMDAwMDAxCisjZGVmaW5lIFdQU19QUk9CUlNQX1NUQVRFX1BSRVNFTlQgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAyCisjZGVmaW5lIFdQU19QUk9CUlNQX0FQU0VUVVBMT0NLX1BSRVNFTlQgICAgICAgICAgICAgICAgICAweDAwMDAwMDA0CisjZGVmaW5lIFdQU19QUk9CUlNQX1NFTEVDVEVEUkVHSVNUUkFfUFJFU0VOVCAgICAgICAgICAgICAweDAwMDAwMDA4CisjZGVmaW5lIFdQU19QUk9CUlNQX0RFVklDRVBBU1NXT1JESURfUFJFU0VOVCAgICAgICAgICAgICAweDAwMDAwMDEwCisjZGVmaW5lIFdQU19QUk9CUlNQX1NFTEVDVEVEUkVHSVNUUkFDRkdNRVRIT0RfUFJFU0VOVCAgICAweDAwMDAwMDIwCisjZGVmaW5lIFdQU19QUk9CUlNQX1JFU1BPTlNFVFlQRV9QUkVTRU5UICAgICAgICAgICAgICAgICAweDAwMDAwMDQwCisjZGVmaW5lIFdQU19QUk9CUlNQX1VVSURFX1BSRVNFTlQgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDgwCisjZGVmaW5lIFdQU19QUk9CUlNQX01BTlVGQUNUVVJFX1BSRVNFTlQgICAgICAgICAgICAgICAgICAweDAwMDAwMTAwCisjZGVmaW5lIFdQU19QUk9CUlNQX01PREVMTkFNRV9QUkVTRU5UICAgICAgICAgICAgICAgICAgICAweDAwMDAwMjAwCisjZGVmaW5lIFdQU19QUk9CUlNQX01PREVMTlVNQkVSX1BSRVNFTlQgICAgICAgICAgICAgICAgICAweDAwMDAwNDAwCisjZGVmaW5lIFdQU19QUk9CUlNQX1NFUklBTE5VTUJFUl9QUkVTRU5UICAgICAgICAgICAgICAgICAweDAwMDAwODAwCisjZGVmaW5lIFdQU19QUk9CUlNQX1BSSU1BUllERVZJQ0VUWVBFX1BSRVNFTlQgICAgICAgICAgICAweDAwMDAxMDAwCisjZGVmaW5lIFdQU19QUk9CU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sVHlwZTsKKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fQ0hfQVZPSUQgKi8KKworaW50IHNhcFNldFByZWZlcnJlZENoYW5uZWwodEFOSV9VOCogcHRyKTsKK3ZvaWQgc2FwQ2xlYW51cENoYW5uZWxMaXN0KHZvaWQpOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5TQVBfU2V0X1dwc0llCisKKyAgREVTQ1JJUFRJT04gCisgICAgVGhpcyBhcGkgZnVuY3Rpb24gcHJvdmlkZXMgZm9yIEFwIEFwcC9IREQgdG8gc2V0IFdQUyBJRS4KKworICBERVBFTkRFTkNJRVMgCisgICAgTkEuIAorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgIHB2b3NHQ3R4OiBQb2ludGVyIHRvIHZvcyBnbG9iYWwgY29udGV4dCBzdHJ1Y3R1cmUKKyAgcFdQU0lFOiAgdFNhcF9XUFNJRSBzdHJ1Y3R1cmUgZm9yIHRoZSBzdGF0aW9uCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIFZPU19TVEFUVVMgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIFN1Y2Nlc3MKKyAgCisgIFNJREUgRUZGRUNUUyAgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOU0FQX1NldF9XcHNJZQorKAorICAgIHZfUFZPSURfdCBwdm9zR0N0eCwgdFNhcF9XUFNJRSAqcFdQU0llCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgV0xBTlNBUF9VcGRhdGVfV3BzSWUKKworICBERVNDUklQVElPTiAKKyAgICBUaGlzIGFwaSBmdW5jdGlvbiBwcm92aWRlcyBmb3IgQXAgQXBwL0hERCB0byBzdGFydCBXUFMgc2Vzc2lvbi4KKworICBERVBFTkRFTkNJRVMKKyAgICBOQS4gCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KK3B2b3NHQ3R4OiBQb2ludGVyIHRvIHZvcyBnbG9iYWwgY29udGV4dCBzdHJ1Y3R1cmUKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgVk9TX1NUQVRVUyBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgU3VjY2VzcworICAKKyAgU0lERSBFRkZFQ1RTICAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5TQVBfVXBkYXRlX1dwc0llCisoCisgICAgdl9QVk9JRF90IHB2b3NHQ3R4CispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5TQVBfU3RvcF9XcHMKKworICBERVNDUklQVElPTiAKKyAgICBUaGlzIGFwaSBmdW5jdGlvbiBwcm92aWRlcyBmb3IgQXAgQXBwL0hERCB0byBzdG9wIFdQUyBzZXNzaW9uLgorCisgIERFUEVOREVOQ0lFUyAKKyAgICBOQS4gCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KK3B2b3NHQ3R4OiBQb2ludGVyIHRvIHZvcyBnbG9iYWwgY29udGV4dCBzdHJ1Y3R1cmUKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgVk9TX1NUQVRVUyBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgU3VjY2VzcworICAKKyAgU0lERSBFRkZFQ1RTICAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5TQVBfU3RvcF9XcHMKKygKKyAgICB2X1BWT0lEX3QgcHZvc0dDdHgKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlNBUF9HZXRfV1BTX1N0YXRlCisKKyAgREVTQ1JJUFRJT04gCisgICAgVGhpcyBhcGkgZnVuY3Rpb24gcHJvdmlkZXMgZm9yIEFwIEFwcC9IREQgdG8gZ2V0IFdQUyBzdGF0ZS4KKworICBERVBFTkRFTkNJRVMgCisgICAgTkEuIAorCisgIFBBUkFNRVRFUlMKKworICAgIElOCitwdm9zR0N0eDogUG9pbnRlciB0byB2b3MgZ2xvYmFsIGNvbnRleHQgc3RydWN0dXJlCisKKyAgICBPVVQKK3BiV1BTU3RhdGU6IFBvaW50ZXIgdG8gdmFyaWFibGUgdG8gaW5kaWNhdGUgaWYgaXQgaXMgaW4gV1BTIFJlZ2lzdHJhdGlvbiBzdGF0ZQorIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgVk9TX1NUQVRVUyBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgU3VjY2VzcworICAKKyAgU0lERSBFRkZFQ1RTICAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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8gc3RhcnQgdG8gCisgICAgcmVnaXN0ZXIgd2l0aCB0aGUgb3RoZXIgbW9kdWxlcy4gCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgIHB2b3NHQ3R4OiAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFuZGxlIHRvIFNBUCdzIAorICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQgCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgcG9pbnRlciB0byBTQVAgY2IgaXMgTlVMTCA7IGFjY2VzcyB3b3VsZCBjYXVzZSBhIHBhZ2UgCisgICAgICAgICAgICAgICAgICAgICAgICAgZmF1bHQgIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KSAKKworICBTSURFIEVGRkVDVFMgICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyAKK1dMQU5TQVBfT3BlbgorKCAKKyAgICB2X1BWT0lEX3QgIHB2b3NHQ3R4IAorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOU0FQX1N0YXJ0CisKKyAgREVTQ1JJUFRJT04gCisgICAgQ2FsbGVkIGFzIHBhcnQgb2YgdGhlIG92ZXJhbGwgc3RhcnQgcHJvY2VkdXJlICh2b3Nfc3RhcnQpLiAKKyAgICAKKyAgREVQRU5ERU5DSUVTIAorICAgIAorICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICBwdm9zR0N0eDogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZSB0byBTQVAncyAKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQgCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgcG9pbnRlciB0byBTQVAgY2IgaXMgTlVMTCA7IGFjY2VzcyB3b3VsZCBjYXVzZSBhIHBhZ2UgCisgICAgICAgICAgICAgICAgICAgICAgICAgZmF1bHQgIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KSAKKworICAgIE90aGVyIGNvZGVzIGNhbiBiZSByZXR1cm5lZCBhcyBhIHJlc3VsdCBvZiBhIEJBTCBmYWlsdXJlOworICAgIAorICBTSURFIEVGRkVDVFMgICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyAKK1dMQU5TQVBfU3RhcnQKKyggCisgICAgdl9QVk9JRF90ICBwdm9zR0N0eCAKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlNBUF9TdG9wCisKKyAgREVTQ1JJUFRJT04gCisgICAgQ2FsbGVkIGJ5IHZvc19zdG9wIHRvIHN0b3Agb3BlcmF0aW9uIGluIFNBUCwgYmVmb3JlIGNsb3NlLiAKKyAgICAKKyAgREVQRU5ERU5DSUVTIAorICAgIAorICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICBwdm9zR0N0eDogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZSB0byBTQVAncyAKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQgCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgcG9pbnRlciB0byBTQVAgY2IgaXMgTlVMTCA7IGFjY2VzcyB3b3VsZCBjYXVzZSBhIHBhZ2UgCisgICAgICAgICAgICAgICAgICAgICAgICAgZmF1bHQgIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KSAKKworICBTSURFIEVGRkVDVFMgICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyAKK1dMQU5TQVBfU3RvcAorKCAKKyAgICB2X1BWT0lEX3QgIHB2b3NHQ3R4IAorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOU0FQX0Nsb3NlCisKKyAgREVTQ1JJUFRJT04gCisgICAgQ2FsbGVkIGJ5IHZvc19jbG9zZSBkdXJpbmcgZ2VuZXJhbCBkcml2ZXIgY2xvc2UgcHJvY2VkdXJlLiBTQVAgd2lsbCBjbGVhbiB1cCAKKyAgICBhbGwgdGhlIGludGVybmFsIHJlc291cmNlcy4gCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gU0FQJ3MgCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wgYmxvY2sgY2FuIGJlIGV4dHJhY3RlZCBmcm9tIGl0cyBjb250ZXh0IAorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfRV9GQVVMVDogIHBvaW50ZXIgdG8gU0FQIGNiIGlzIE5VTEwgOyBhY2Nlc3Mgd291bGQgY2F1c2UgYSBwYWdlIAorICAgICAgICAgICAgICAgICAgICAgICAgIGZhdWx0ICAKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikgCisKKyAgU0lERSBFRkZFQ1RTICAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgCitXTEFOU0FQX0Nsb3NlCisoIAorICAgIHZfUFZPSURfdCAgcHZvc0dDdHggCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgICgqdHBXTEFOX1NBUEV2ZW50Q0IpCisKKyAgREVTQ1JJUFRJT04gCisgICAgSW1wbGVtZW50cyB0aGUgY2FsbGJhY2sgZm9yIEFMTCBhc3luY2hyb25vdXMgZXZlbnRzLiAKKyAgICBJbmNsdWRpbmcgRXZlbnRzIHJlc3VsdGluZyBmcm9tOgorICAgICAqIFN0YXJ0IEJTUyAKKyAgICAgKiBTdG9wIEJTUywuLi4KKworICBERVBFTkRFTkNJRVMgCisgICAgTkEuIAorCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgIHBTYXBFdmVudDogIHBvaW50ZXIgdG8gdGhlIHVuaW9uIG9mICJTYXAgRXZlbnQiIHN0cnVjdHVyZXMuIFRoaXMgbm93IGVuY29kZXMgQUxMIGV2ZW50IHR5cGVzLgorICAgICAgICBJbmNsdWRpbmcgQ29tbWFuZCBDb21wbGV0ZSBhbmQgQ29tbWFuZCBTdGF0dXMKKyAgICBwVXNyQ29udGV4dCAgIDogcFVzckNvbnRleHQgcGFyYW1ldGVyIHRoYXQgd2FzIHBhc3NlZCB0byBzYXBTdGFydEJzcworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbiAgCisKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6ICBwb2ludGVyIHRvIHBTYXBFdmVudCBpcyBOVUxMCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgU3VjY2VzcworICAKKyAgU0lERSBFRkZFQ1RTICAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3R5cGVkZWYgVk9TX1NUQVRVUyAoKnRwV0xBTl9TQVBFdmVudENCKSggdHBTYXBfRXZlbnQgcFNhcEV2ZW50LCB2X1BWT0lEX3QgIHBVc3JDb250ZXh0KTsKKworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlNBUF9nZXRTdGF0ZQorCisgIERFU0NSSVBUSU9OIAorICAgIFRoaXMgYXBpIHJldHVybnMgdGhlIGN1cnJlbnQgU0FQIHN0YXRlIHRvIHRoZSBjYWxsZXIuCisKKyAgREVQRU5ERU5DSUVTIAorCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgIHBDb250ZXh0ICAgICAgICAgICAgOiBQb2ludGVyIHRvIFNhcCBDb250ZXh0IHN0cnVjdHVyZQorCisgIFJFVFVSTiBWQUxVRQorICAgIFJldHVybnMgdGhlIFNBUCBGU00gc3RhdGUuICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCit2X1U4X3QgV0xBTlNBUF9nZXRTdGF0ZSAoIHZfUFZPSURfdCAgcHZvc0dDdHgpOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5TQVBfU3RhcnRCc3MKKworICBERVNDUklQVElPTiAKKyAgICBUaGlzIGFwaSBmdW5jdGlvbiBwcm92aWRlcyBTQVAgRlNNIGV2ZW50IGVXTEFOX1NBUF9IRERfUEhZU0lDQUxfTElOS19DUkVBVEUgZm9yCitzdGFydGluZyBBUCBCU1MgCisKKyAgREVQRU5ERU5DSUVTIAorICAgIE5BLiAKKworICBQQVJBTUVURVJTIAorCisgICAgSU4KK3B2b3NHQ3R4OiBQb2ludGVyIHRvIHZvcyBnbG9iYWwgY29udGV4dCBzdHJ1Y3R1cmUKK3BDb25maWc6IFBvaW50ZXIgdG8gY29uZmlndXJhdGlvbiBzdHJ1Y3R1cmUgcGFzc2VkIGRvd24gZnJvbSBIREQoSG9zdEFwZCBmb3IgQW5kcm9pZCkKK2hkZF9TYXBFdmVudENhbGxiYWNrOiBDYWxsYmFjayBmdW5jdGlvbiBpbiBIREQgY2FsbGVkIGJ5IFNBUCB0byBpbmZvcm0gSEREIGFib3V0IFNBUCByZXN1bHRzCit1c3JEYXRhRm9yQ2FsbGJhY2s6IFBhcmFtZXRlciB0aGF0IHdpbGwgYmUgcGFzc2VkIGJhY2sgaW4gYWxsIHRoZSBTQVAgY2FsbGJhY2sgZXZlbnRzLgorCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIFZPU19TVEFUVVMgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIFN1Y2Nlc3MKKyAgCisgIFNJREUgRUZGRUNUUyAgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIAorV0xBTlNBUF9TdGFydEJzcworKAorICAgIHZfUFZPSURfdCAgcHZvc0dDdHgsIAorICAgIHRwV0xBTl9TQVBFdmVudENCIHBTYXBFdmVudENhbGxiYWNrLCAKKyAgICB0c2FwX0NvbmZpZ190ICpwQ29uZmlnLCB2X1BWT0lEX3QgIHBVc3JDb250ZXh0CispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5TQVBfU2V0TWFjQUNMCisKKyAgREVTQ1JJUFRJT04KKyAgVGhpcyBhcGkgZnVuY3Rpb24gcHJvdmlkZXMgU0FQIHRvIHNldCBtYWMgbGlzdCBlbnRyeSBpbiBhY2NlcHQgbGlzdCBhcyB3ZWxsCisgIGFzIGRlbnkgbGlzdAorCisgIERFUEVOREVOQ0lFUworICAgIE5BLgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCitwdm9zR0N0eDogUG9pbnRlciB0byB2b3MgZ2xvYmFsIGNvbnRleHQgc3RydWN0dXJlCitwQ29uZmlnOiAgUG9pbnRlciB0byBjb25maWd1cmF0aW9uIHN0cnVjdHVyZSBwYXNzZWQgZG93biBmcm9tCisgICAgICAgICAgSEREKEhvc3RBcGQgZm9yIEFuZHJvaWQpCisKKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgVk9TX1NUQVRVUyBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIFN1Y2Nlc3MKKworICBTSURFIEVGRkVDVFMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlNBUF9TZXRNYWNBQ0wKKygKKyAgICB2X1BWT0lEX3QgIHB2b3NHQ3R4LAorICAgIHRzYXBfQ29uZmlnX3QgKnBDb25maWcKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlNBUF9TdG9wCisKKyAgREVTQ1JJUFRJT04gCisgICAgVGhpcyBhcGkgZnVuY3Rpb24gcHJvdmlkZXMgU0FQIEZTTSBldmVudCBlV0xBTl9TQVBfSEREX1BIWVNJQ0FMX0xJTktfRElTQ09OTkVDVCBmb3IKK3N0b3BwaW5nIEJTUyAKKworICBERVBFTkRFTkNJRVMgCisgICAgTkEuIAorCisgIFBBUkFNRVRFUlMgVworCisgICAgSU4KKyAgICBwdm9zR0N0eDogUG9pbnRlciB0byB2b3MgZ2xvYmFsIGNvbnRleHQgc3RydWN0dXJlCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIFZPU19TVEFUVVMgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIFN1Y2Nlc3MKKyAgCisgIFNJREUgRUZGRUNUUyAgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIAorV0xBTlNBUF9TdG9wQnNzCisoCisgICAgdl9QVk9JRF90ICBwdm9zR0N0eAorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOU0FQX0Rpc2Fzc29jU3RhCisKKyAgREVTQ1JJUFRJT04gCisgICAgVGhpcyBhcGkgZnVuY3Rpb24gcHJvdmlkZXMgZm9yIEFwIEFwcC9IREQgaW5pdGlhdGVkIGRpc2Fzc29jaWF0aW9uIG9mIHN0YXRpb24KKworICBERVBFTkRFTkNJRVMgCisgICAgTkEuIAorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcHZvc0dDdHggICAgICAgICAgICA6IFBvaW50ZXIgdG8gdm9zIGdsb2JhbCBjb250ZXh0IHN0cnVjdHVyZQorICAgIHBQZWVyU3RhTWFjICAgICAgICAgOiBNYWMgYWRkcmVzcyBvZiB0aGUgc3RhdGlvbiB0byBkaXNhc3NvY2lhdGUKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgVk9TX1NUQVRVUyBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgU3VjY2VzcworICAKKyAgU0lERSBFRkZFQ1RTICAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgCitXTEFOU0FQX0Rpc2Fzc29jU3RhCisoCisgICAgdl9QVk9JRF90ICBwdm9zR0N0eCwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgY29uc3Qgdl9VOF90ICpwUGVlclN0YU1hYworI2Vsc2UKKyAgICB2X1U4X3QgKnBQZWVyU3RhTWFjCisjZW5kaWYKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlNBUF9EZWF1dGhTdGEKKworICBERVNDUklQVElPTiAKKyAgICBUaGlzIGFwaSBmdW5jdGlvbiBwcm92aWRlcyBmb3IgQXAgQXBwL0hERCBpbml0aWF0ZWQgZGVhdXRoZW50aWNhdGlvbiBvZiBzdGF0aW9uCisKKyAgREVQRU5ERU5DSUVTIAorICAgIE5BLiAKKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHB2b3NHQ3R4ICAgICAgICAgICAgOiBQb2ludGVyIHRvIHZvcyBnbG9iYWwgY29udGV4dCBzdHJ1Y3R1cmUKKyAgICBwRGVsU3RhUGFyYW1zICAgICAgIDogUG9pbnRlciB0byBwYXJhbWV0ZXJzIG9mIHRoZSBzdGF0aW9uIHRvCisgICAgICAgICAgICAgICAgICAgICAgICAgIGRlYXV0aGVudGljYXRlCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIFZPU19TVEFUVVMgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIFN1Y2Nlc3MKKyAgCisgIFNJREUgRUZGRUNUUyAgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIAorV0xBTlNBUF9EZWF1dGhTdGEKKygKKyAgICB2X1BWT0lEX3QgIHB2b3NHQ3R4LAorICAgIHN0cnVjdCB0YWdDc3JEZWxTdGFQYXJhbXMgKnBEZWxTdGFQYXJhbXMKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlNBUF9TZXRDaGFubmVsUmFuZ2UKKworICBERVNDUklQVElPTiAKKyAgICAgIFRoaXMgYXBpIGZ1bmN0aW9uIHNldHMgdGhlIHJhbmdlIG9mIGNoYW5uZWxzIGZvciBTb2Z0QVAuCisKKyAgREVQRU5ERU5DSUVTIAorICAgIE5BLiAKKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHN0YXJ0Q2hhbm5lbCAgICAgICAgIDogc3RhcnQgY2hhbm5lbAorICAgIGVuZENoYW5uZWwgICAgICAgICAgIDogRW5kIGNoYW5uZWwKKyAgICBvcGVyYXRpbmdCYW5kICAgICAgICA6IE9wZXJhdGluZyBiYW5kICgyLjRHSHovNUdIeikKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgVk9TX1NUQVRVUyBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgU3VjY2VzcworICAKKyAgU0lERSBFRkZFQ1RTICAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5TQVBfU2V0Q2hhbm5lbFJhbmdlKHRIYWxIYW5kbGUgaEhhbCx2X1U4X3Qgc3RhcnRDaGFubmVsLCB2X1U4X3QgZW5kQ2hhbm5lbCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU2FwT3BlcmF0aW5nQmFuZCBvcGVyYXRpbmdCYW5kKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOU0FQX1NldEtleVN0YQorCisgIERFU0NSSVBUSU9OIAorICAgIFRoaXMgYXBpIGZ1bmN0aW9uIHByb3ZpZGVzIGZvciBBcCBBcHAvSEREIHRvIGRlbGV0ZSBrZXkgZm9yIGEgc3RhdGlvbi4KKworICBERVBFTkRFTkNJRVMgCisgICAgTkEuIAorCisgIFBBUkFNRVRFUlMKKworICAgIElOCitwdm9zR0N0eDogUG9pbnRlciB0byB2b3MgZ2xvYmFsIGNvbnRleHQgc3RydWN0dXJlCitwU2V0S2V5SW5mbzogdENzclJvYW1TZXRLZXkgc3RydWN0dXJlIGZvciB0aGUgc3RhdGlvbgorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSBWT1NfU1RBVFVTIGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbiAgCisKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBTdWNjZXNzCisgIAorICBTSURFIEVGRkVDVFMgICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlNBUF9TZXRLZXlTdGEKKygKKyAgICB2X1BWT0lEX3QgcHZvc0dDdHgsIHRDc3JSb2FtU2V0S2V5ICpwU2V0S2V5SW5mbworKTsgCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlNBUF9EZWxLZXlTdGEKKworICBERVNDUklQVElPTiAKKyAgICBUaGlzIGFwaSBmdW5jdGlvbiBwcm92aWRlcyBmb3IgQXAgQXBwL0hERCB0byBkZWxldGUga2V5IGZvciBhIHN0YXRpb24uCisKKyAgREVQRU5ERU5DSUVTIAorICAgIE5BLiAKKworICBQQVJBTUVURVJTCisKKyAgICBJTgorcHZvc0dDdHg6IFBvaW50ZXIgdG8gdm9zIGdsb2JhbCBjb250ZXh0IHN0cnVjdHVyZQorcFNldEtleUluZm86IHRDc3JSb2FtU2V0S2V5IHN0cnVjdHVyZSBmb3IgdGhlIHN0YXRpb24KKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgVk9TX1NUQVRVUyBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgU3VjY2VzcworICAKKyAgU0lERSBFRkZFQ1RTICAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5TQVBfRGVsS2V5U3RhCisoCisgICAgdl9QVk9JRF90IHB2b3NHQ3R4LCB0Q3NyUm9hbVJlbW92ZUtleSAqcERlbEtleUluZm8KKyk7IAorCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOU0FQX0dldEFzc29jU3RhdGlvbnMKKworICBERVNDUklQVElPTiAKKyAgICBUaGlzIGFwaSBmdW5jdGlvbiBpcyB1c2VkIHRvIHByb2JlIHRoZSBsaXN0IG9mIGFzc29jaWF0ZWQgc3RhdGlvbnMgZnJvbSB2YXJpb3VzIG1vZHVsZXMgb2YgQ09SRSBzdGFjaworCisgIERFUEVOREVOQ0lFUyAKKyAgICBOQS4gCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KK3B2b3NHQ3R4OiBQb2ludGVyIHRvIHZvcyBnbG9iYWwgY29udGV4dCBzdHJ1Y3R1cmUKK21vZDogTW9kdWxlIGZyb20gd2hvbSBsaXN0IG9mIGFzc29jaXRhdGVkIHN0YXRpb25zICBpcyBzdXB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T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5TQVBfZ2V0V3BzU2Vzc2lvbk92ZXJsYXAKKworICBERVNDUklQVElPTiAKKyAgICBUaGlzIGFwaSBmdW5jdGlvbiBwcm92aWRlcyBmb3IgQXAgQXBwL0hERCB0byBnZXQgV1BTIHNlc3Npb24gb3ZlcmxhcCBpbmZvLgorCisgIERFUEVOREVOQ0lFUyAKKyAgICBOQS4gCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KK3B2b3NHQ3R4OiBQb2ludGVyIHRvIHZvcyBnbG9iYWwgY29udGV4dCBzdHJ1Y3R1cmUKK3BTZXNzaW9uTWFjOiBwb2ludGVyIHRvIHZfTUFDQUREUl90IGZvciBzZXNzaW9uIE1BQyBhZGRyZXNzCit1dWlkZTogUG9pbnRlciB0byAxNiBieXRlcyBhcnJheSBmb3Igc2Vzc2lvbiBVVUlEX0UKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgVk9TX1NUQVRVUyBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgU3VjY2VzcworICAgIFZPU19TVEFUVVNfRV9GQVVMVDogIE92ZXJsYXAgaXMgZGVjdGVjdGVkLiBUaGUgcGFyYW1ldGVyIGlzIGZ1bmN0aW9uIG5vdCB2YWxpZC4KKyAgCisgIFNJREUgRUZGRUNUUyAgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOU0FQX2dldFdwc1Nlc3Npb25PdmVybGFwCisoCisgICAgdl9QVk9JRF90IHB2b3NHQ3R4CispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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FTkNJRVMgCisgICAgTkEuIAorCisgIFBBUkFNRVRFUlMKKworICAgIElOCitwdm9zR0N0eDogUG9pbnRlciB0byB2b3MgZ2xvYmFsIGNvbnRleHQgc3RydWN0dXJlCitiRW5hYmxlOiBJZiBUUlVFIHRoYW4gYWxsIHN0YXRpb25zIHdpbGwgYmUgZGlzYXNzb2NpYXRlZCBhbmQgbm8gbW9yZSB3aWxsIGJlIGFsbG93ZWQgdG8gYXNzb2NpYXRlLiBJZiBGQUxTRSB0aGFuIENPUkUKK3dpbGwgY29tZSBvdXQgb2YgdGhpcyBzdGF0ZS4KKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgVk9TX1NUQVRVUyBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgU3VjY2VzcworICAKKyAgU0lERSBFRkZFQ1RTICAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5TQVBfU2V0Q291bnRlck1lYXN1cmUKKygKKyAgICB2X1BWT0lEX3QgcHZvc0dDdHgsIHZfQk9PTF90IGJFbmFibGUKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlNhcF9nZXRzdGF0aW9uSUVfaW5mb3JtYXRpb24KKworICBERVNDUklQVElPTiAKKyAgICBUaGlzIGFwaSBmdW5jdGlvbiBwcm92aWRlcyBmb3IgQXAgQXBwL0hERCB0byByZXRyaXZlIHRoZSBXUEEgYW5kIFJTTklFIG9mIGEgc3RhdGlvbi4KKworICBERVBFTkRFTkNJRVMgCisgICAgTkEuIAorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgICAgIHB2b3NHQ3R4OiBQb2ludGVyIHRvIHZvcyBnbG9iYWwgY29udGV4dCBzdHJ1Y3R1cmUKKyAgICAgICAgcExlbiA6IGxlbmd0aCBvZiBXUEFSU04gZWxtZW50IElFIHdoZXJlIGl0IHdvdWxkIGJlIGNvcGllZAorICAgICAgICBwQnVmIDogYnVmIHRvIGNvcHkgdGhlIFdQQVJTTkllIAorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSBWT1NfU1RBVFVTIGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbiAgCisKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBTdWNjZXNzCisgIAorICBTSURFIEVGRkVDVFMgICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlNhcF9nZXRzdGF0aW9uSUVfaW5mb3JtYXRpb24odl9QVk9JRF90IHB2b3NHQ3R4LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgICAqcExlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAgICAqcEJ1Zik7CisKKworVk9TX1NUQVRVUworV0xBTlNBUF9nZXRXcHNTZXNzaW9uT3ZlcmxhcAorKAorICAgIHZfUFZPSURfdCBwdm9zR0N0eAorKTsKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlNBUF9DbGVhckFDTAorCisgIERFU0NSSVBUSU9OIAorICAgIFRoaXMgYXBpIGZ1bmN0aW9uIHJlbW92ZXMgYWxsIHRoZSBlbnRyaWVzIGluIGJvdGggYWNjZXB0IGFuZCBkZW55IGxpc3RzLgorCisgIERFUEVOREVOQ0lFUyAKKyAgICBOQS4gCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICAgICAgcHZvc0dDdHg6IFBvaW50ZXIgdG8gdm9zIGdsb2JhbCBjb250ZXh0IHN0cnVjdHVyZQorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSBWT1NfU1RBVFVTIGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbiAgCisKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBTdWNjZXNzCisgIAorICBTSURFIEVGRkVDVFMgICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyAKK1dMQU5TQVBfQ2xlYXJBQ0wKKyggCisgICAgdl9QVk9JRF90ICBwdm9zR0N0eAorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOU0FQX1NldE1vZGUKKworICBERVNDUklQVElPTiAKKyAgICBUaGlzIGFwaSBpcyB1c2VkIHRvIHNldCBtb2RlIGZvciBBQ0wKKworICBERVBFTkRFTkNJRVMgCisgICAgTkEuIAorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgICAgIHB2b3NHQ3R4OiBQb2ludGVyIHRvIHZvcyBnbG9iYWwgY29udGV4dCBzdHJ1Y3R1cmUKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgVk9TX1NUQVRVUyBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgU3VjY2VzcworICAKKyAgU0lERSBFRkZFQ1RTICAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgCitXTEFOU0FQX1NldE1vZGUKKyggCisgICAgdl9QVk9JRF90ICBwdm9zR0N0eCwKKyAgICB2X1UzMl90IG1vZGUKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlNBUF9Nb2RpZnlBQ0wKKworICBERVNDUklQVElPTiAKKyAgICBUaGlzIGFwaSBmdW5jdGlvbiBwcm92aWRlcyBmb3IgQXAgQXBwL0hERCB0byBhZGQvcmVtb3ZlIG1hYyBhZGRyZXNzZXMgZnJvbSBibGFjay93aGl0ZSBsaXN0cyAoQUNMcykuCisKKyAgREVQRU5ERU5DSUVTIAorICAgIE5BLiAKKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgICAgICBwdm9zR0N0eCAgICAgICAgOiBQb2ludGVyIHRvIHZvcyBnbG9iYWwgY29udGV4dCBzdHJ1Y3R1cmUKKyAgICAgICAgcFBlZXJTdGFNYWMgICAgIDogTUFDIGFkZHJlc3MgdG8gYmUgYWRkZWQgb3IgcmVtb3ZlZCAKKyAgICAgICAgbGlzdFR5cGUgICAgICAgIDogYWRkL3JlbW92ZSB0byBiZSBkb25lIG9uIGJsYWNrIG9yIHdoaXRlIGxpc3QKKyAgICAgICAgY21kICAgICAgICAgICAgIDogQXJlIHdlIGRvaW5nIHRvIGFkZCBvciBkZWxldGUgYSBtYWMgYWRkciBmcm9tIGFuIEFDTC4KKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIFZPU19TVEFUVVMgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIFN1Y2Nlc3MKKyAgCisgIFNJREUgRUZGRUNUUyAgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIAorV0xBTlNBUF9Nb2RpZnlBQ0wKKygKKyAgICB2X1BWT0lEX3QgIHB2b3NHQ3R4LAorICAgIHZfVThfdCAqcFBlZXJTdGFNYWMsCisgICAgZVNhcEFDTFR5cGUgbGlzdFR5cGUsCisgICAgZVNhcEFDTENtZFR5cGUgY21kCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5TQVBfU2V0X1dQQVJTTkllcworCisgIERFU0NSSVBUSU9OIAorICAgIFRoaXMgYXBpIGZ1bmN0aW9uIHByb3ZpZGVzIGZvciBBcCBBcHAvSEREIHRvIHNldCBBUCBXUEEgYW5kIFJTTiBJRSBpbiBpdHMgYmVhY29uIGFuZCBwcm9iZSByZXNwb25zZS4KKworICBERVBFTkRFTkNJRVMgCisgICAgTkEuIAorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgICAgIHB2b3NHQ3R4OiBQb2ludGVyIHRvIHZvcyBnbG9iYWwgY29udGV4dCBzdHJ1Y3R1cmUKKyAgICAgICAgcFdQQVJTTklFczogYnVmZmVyIHRvIHRoZSBXUEEvUlNOIElFcyAKKyAgICAgICAgV1BBUlNOSUVzTGVuOiBsZW5ndGggb2YgV1BBL1JTTiBJRXMKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgVk9TX1NUQVRVUyBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgU3VjY2VzcworICAKKyAgU0lERSBFRkZFQ1RTICAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgV0xBTlNBUF9TZXRfV1BBUlNOSWVzKHZfUFZPSURfdCBwdm9zR0N0eCwgdl9VOF90ICpwV1BBUlNOSUVzLCB2X1UzMl90IFdQQVJTTklFc0xlbik7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlNBUF9HZXRTdGF0aXN0aWNzCisKKyAgREVTQ1JJUFRJT04gCisgICAgVGhpcyBhcGkgZnVuY3Rpb24gcHJvdmlkZXMgZm9yIEFwIEFwcC9IREQgdG8gZ2V0IFRMIHN0YXRpc3RpY3MgZm9yIGFsbCBzdGF0aW9ucyBvZiBTb2Z0IEFQLgorCisgIERFUEVOREVOQ0lFUyAKKyAgICBOQS4gCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICAgICAgcHZvc0dDdHg6IFBvaW50ZXIgdG8gdm9zIGdsb2JhbCBjb250ZXh0IHN0cnVjdHVyZQorICAgICAgICBiUmVzZXQ6IElmIHNldCBUTCBzdGF0aXN0aWNzIHdpbGwgYmUgY2xlYXJlZCBhZnRlciByZWFkaW5nCisgICAgT1VUCisgICAgICAgIHN0YXRCdWY6IEJ1ZmZlciB0byBnZXQgdGhlIHN0YXRpc3RpY3MKKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgVk9TX1NUQVRVUyBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgU3VjY2VzcworCisgIFNJREUgRUZGRUNUUyAgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5TQVBfR2V0U3RhdGlzdGljcyh2X1BWT0lEX3QgcHZvc0dDdHgsIHRTYXBfU29mdGFwU3RhdHMgKnN0YXRCdWYsIHZfQk9PTF90IGJSZXNldCk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOU0FQX1NlbmRBY3Rpb24KKworICBERVNDUklQVElPTiAKKyAgICBUaGlzIGFwaSBmdW5jdGlvbiBwcm92aWRlcyB0byBzZW5kIGFjdGlvbiBmcmFtZSBzZW50IGJ5IHVwcGVyIGxheWVyLgorCisgIERFUEVOREVOQ0lFUyAKKyAgICBOQS4gCisKKyAgUEFSQU1FVEVSUworCisgIElOCisgICAgcHZvc0dDdHg6IFBvaW50ZXIgdG8gdm9zIGdsb2JhbCBjb250ZXh0IHN0cnVjdHVyZQorICAgIHBCdWY6IFBvaW50ZXIgb2YgdGhlIGFjdGlvbiBmcmFtZSB0byBiZSB0cmFuc21pdHRlZAorICAgIGxlbjogTGVuZ3RoIG9mIHRoZSBhY3Rpb24gZnJhbWUKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgVk9TX1NUQVRVUyBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgU3VjY2VzcworICAKKyAgU0lERSBFRkZFQ1RTICAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgV0xBTlNBUF9TZW5kQWN0aW9uKCB2X1BWT0lEX3QgcHZvc0dDdHgsIGNvbnN0IHRBTklfVTggKnBCdWYsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIGxlbiwgdEFOSV9VMTYgd2FpdCApOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlNBUF9SZW1haW5PbkNoYW5uZWwKKworICBERVNDUklQVElPTiAKKyAgICBUaGlzIGFwaSBmdW5jdGlvbiBwcm92aWRlcyB0byBzZXQgUmVtYWluIE9uIGNoYW5uZWwgb24gc3BlY2lmaWVkIGNoYW5uZWwKKyAgICBmb3Igc3BlY2lmaWVkIGR1cmF0aW9uLgorCisgIERFUEVOREVOQ0lFUyAKKyAgICBOQS4gCisKKyAgUEFSQU1FVEVSUworCisgIElOCisgICAgcHZvc0dDdHg6IFBvaW50ZXIgdG8gdm9zIGdsb2JhbCBjb250ZXh0IHN0cnVjdHVyZQorICAgIGNoYW5uZWw6IENoYW5uZWwgb24gd2hpY2ggZHJpdmVyIGhhcyB0byBsaXN0ZW4gCisgICAgZHVyYXRpb246IER1cmF0aW9uIGZvciB3aGljaCBkcml2ZXIgaGFzIHRvIGxpc3RlbiBvbiBzcGVjaWZpZWQgY2hhbm5lbAorICAgIGNhbGxiYWNrOiBDYWxsYmFjayBmdW5jdGlvbiB0byBiZSBjYWxsZWQgb25jZSBMaXN0ZW4gaXMgZG9uZS4KKyAgICBwQ29udGV4dDogQ29udGV4dCBuZWVkcyB0byBiZSBjYWxsZWQgaW4gY2FsbGJhY2sgZnVuY3Rpb24uIAorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSBWT1NfU1RBVFVTIGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbiAgCisKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBTdWNjZXNzCisgIAorICBTSURFIEVGRkVDVFMgICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOU0FQX1JlbWFpbk9uQ2hhbm5lbCggdl9QVk9JRF90IHB2b3NHQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBjaGFubmVsLCB0QU5JX1UzMiBkdXJhdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbWFpbk9uQ2hhbkNhbGxiYWNrIGNhbGxiYWNrLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnBDb250ZXh0ICk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOU0FQX0NhbmNlbFJlbWFpbk9uQ2hhbm5lbAorCisgIERFU0NSSVBUSU9OIAorICAgIFRoaXMgYXBpIGNhbmNlbCBwcmV2aW91cyByZW1haW4gb24gY2hhbm5lbCByZXF1ZXN0LgorCisgIERFUEVOREVOQ0lFUyAKKyAgICBOQS4gCisKKyAgUEFSQU1FVEVSUworCisgIElOCisgICAgcHZvc0dDdHg6IFBvaW50ZXIgdG8gdm9zIGdsb2JhbCBjb250ZXh0IHN0cnVjdHVyZQorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSBWT1NfU1RBVFVTIGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbiAgCisKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBTdWNjZXNzCisgIAorICBTSURFIEVGRkVDVFMgICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOU0FQX0NhbmNlbFJlbWFpbk9uQ2hhbm5lbCggdl9QVk9JRF90IHB2b3NHQ3R4ICk7CisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09P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FOSV9VMTYgZnJhbWVUeXBlLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCogbWF0Y2hEYXRhLCB0QU5JX1UxNiBtYXRjaExlbiApOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlNBUF9EZVJlZ2lzdGVyTWdtdEZyYW1lCisKKyAgREVTQ1JJUFRJT04gCisgICBUaGlzIEFQSSBpcyB1c2VkIHRvIGRlcmVnaXN0ZXIgcHJldmlvdXNseSByZWdpc3RlcmVkIGZyYW1lLiAKKworICBERVBFTkRFTkNJRVMgCisgICAgTkEuIAorCisgIFBBUkFNRVRFUlMKKworICBJTgorICAgIHB2b3NHQ3R4OiBQb2ludGVyIHRvIHZvcyBnbG9iYWwgY29udGV4dCBzdHJ1Y3R1cmUKKyAgICBmcmFtZVR5cGU6IGZyYW1lVHlwZSB0aGF0IG5lZWRzIHRvIGJlIERlLXJlZ2lzdGVyZWQgd2l0aCBQRS4KKyAgICBtYXRjaERhdGE6IERhdGEgcG9pbnRlciB3aGljaCBzaG91bGQgYmUgbWF0Y2hlZCBhZnRlciBmcmFtZSB0eXBlIGlzIG1hdGNoZWQuCisgICAgbWF0Y2hMZW46IExlbmd0aCBvZiB0aGUgbWF0Y2hEYXRhCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIFZPU19TVEFUVVMgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIFN1Y2Nlc3MKKyAgCisgIFNJREUgRUZGRUNUUyAgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5TQVBfRGVSZWdpc3Rlck1nbXRGcmFtZSggdl9QVk9JRF90IHB2b3NHQ3R4LCB0QU5JX1UxNiBmcmFtZVR5cGUsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4KiBtYXRjaERhdGEsIHRBTklfVTE2IG1hdGNoTGVuICk7CisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOU0FQX1BvcHVsYXRlRGVsU3RhUGFyYW1zCisKKyAgREVTQ1JJUFRJT04KKyAgVGhpcyBBUEkgaXMgdXNlZCB0byBwb3B1bGF0ZSBkZWwgc3RhdGlvbiBwYXJhbWV0ZXJzCisgIERFUEVOREVOQ0lFUworICBOQS4KKworICBQQVJBTUVURVJTCisgIElOCisgIG1hYzogICAgICAgICAgIHBvaW50ZXIgdG8gcGVlciBtYWMgYWRkcmVzcy4KKyAgcmVhc29uX2NvZGU6ICAgUmVhc29uIGNvZGUgZm9yIHRoZSBkaXNhc3NvYy9kZWF1dGguCisgIHN1YnR5cGU6ICAgICAgIHN1YnR5cGUgcG9pbnRzIHRvIGVpdGhlciBkaXNhc3NvYy9kZWF1dGggZnJhbWUuCisgIHBEZWxTdGFQYXJhbXM6IGFkZHJlc3Mgd2hlcmUgcGFyYW1ldGVycyB0byBiZSBwb3B1bGF0ZWQuCisKKyAgUkVUVVJOIFZBTFVFIE5PTkUKKworICBTSURFIEVGRkVDVFMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCit2b2lkIFdMQU5TQVBfUG9wdWxhdGVEZWxTdGFQYXJhbXMoY29uc3Qgdl9VOF90ICptYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UxNl90IHJlYXNvbl9jb2RlLAorICAgICAgICAgICAgICAgICAgICAgIC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gICAgICAgICAgICAgICAgICAgICAgIAorICBPVkVSVklFVzoKKyAgCisgIFRoaXMgc29mdHdhcmUgdW5pdCBob2xkcyB0aGUgaW1wbGVtZW50YXRpb24gb2YgdGhlIFdMQU4gU0FQIG1vZHVsZXMKKyAgTGluayBDb250cm9sIGZ1bmN0aW9ucy4KKyAgCisgIFRoZSBmdW5jdGlvbnMgZXh0ZXJuYWxpemVkIGJ5IHRoaXMgbW9kdWxlIGFyZSB0byBiZSBjYWxsZWQgT05MWSBieSBvdGhlciAKKyAgV0xBTiBtb2R1bGVzIChIREQpIAorCisgIERFUEVOREVOQ0lFUzogCisKKyAgQXJlIGxpc3RlZCBmb3IgZWFjaCBBUEkgYmVsb3cuIAorICAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisgICAkSGVhZGVyOiAvY3lnZHJpdmUvYy9Ecm9wYm94L003MjAxSlNEQ0FBUEFENTIyNDBCL1dNL3BsYXRmb3JtL21zbTcyMDAvU3JjL0RyaXZlcnMvU0QvQ2xpZW50RHJpdmVycy9XTEFOL1FDVF9TQVBfUEFML0NPUkUvU0FQL3NyYy9zYXBBcGlMaW5rQ250bC5jLHYgMS43IDIwMDgvMTIvMTggMTk6NDQ6MTEganptdWRhIEV4cCBqem11ZGEgJCREYXRl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jb250ZXh0IHBhc3MgaW4gZm9yIHRoZSBjYWxsZXIgKHNhcENvbnRleHQpCisgICAgb3BlckNoYW5uZWwgOiBTQVAgT3BlcmF0aW5nIENoYW5uZWwKKworICBSRVRVUk4gVkFMVUUKKworICBTSURFIEVGRkVDVFMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCit2b2lkIHNhcFNldE9wZXJhdGluZ0NoYW5uZWwocHRTYXBDb250ZXh0IHBzYXBDb250ZXh0LCB2X1U4X3Qgb3BlckNoYW5uZWwpCit7CisgICAgdl9VOF90IGkgPSAwOworICAgIHZfVTMyX3QgZXZlbnQ7CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICBGTCgiU0FQIENoYW5uZWwgOiAlZCIpLCBwc2FwQ29udGV4dC0+Y2hhbm5lbCk7CisKKyAgICBpZiAob3BlckNoYW5uZWwgPT0gU0FQX0NIQU5ORUxfTk9UX1NFTEVDVEVEKQorI2lmZGVmIFNPRlRBUF9DSEFOTkVMX1JBTkdFCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICBGTCgiTm8gc3VpdGFibGUgY2hhbm5lbCBzZWxlY3RlZCIpKTsKKworICAgICAgICBpZiAoIGVDU1JfQkFORF9BTEwgPT0gIHBzYXBDb250ZXh0LT5zY2FuQmFuZFByZWZlcmVuY2UgfHwKKyAgICAgICAgICAgICAgICBwc2FwQ29udGV4dC0+YWxsQmFuZFNjYW5uZWQgPT0gZVNBUF9UUlVFKQorICAgICAgICB7CisgICAgICAgICAgICBpZihwc2FwQ29udGV4dC0+Y2hhbm5lbExpc3QgIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgcHNhcENvbnRleHQtPmNoYW5uZWwgPSBTQVBfREVGQVVMVF9DSEFOTkVMOworICAgICAgICAgICAgICAgICBmb3IgKCBpID0gMCA7IGkgPCBwc2FwQ29udGV4dC0+bnVtb2ZDaGFubmVsIDsgaSsrKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChOVl9DSEFOTkVMX0VOQUJMRSA9PQorICAgICAgICAgICAgICAgICAgICAgdm9zX252X2dldENoYW5uZWxFbmFibGVkU3RhdGUocHNhcENvbnRleHQtPmNoYW5uZWxMaXN0W2ldKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcHNhcENvbnRleHQtPmNoYW5uZWwgPSBwc2FwQ29udGV4dC0+Y2hhbm5lbExpc3RbaV07CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogaWYgdGhlIGNoYW5uZWwgbGlzdCBpcyBlbXB0eSB0aGVuIHRoZXJlIGlzIG5vIHZhbGlkIGNoYW5uZWwKKyAgICAgICAgICAgICAgICAgICBpbiB0aGUgc2VsZWN0ZWQgc3ViLWJhbmQgc28gc2VsZWN0IGRlZmF1bHQgY2hhbm5lbCBpbiB0aGUKKyAgICAgICAgICAgICAgICAgICBCQU5EKDIuNEdIeikgYXMgMi40IGNoYW5uZWxzIGFyZSBhdmFpbGFibGUgaW4gYWxsIHRoZQorICAgICAgICAgICAgICAgICAgIGNvdW50cmllcyovCisgICAgICAgICAgICAgICAgICAgcHNhcENvbnRleHQtPmNoYW5uZWwgPSBTQVBfREVGQVVMVF9DSEFOTkVMOworCisjaWZkZWYgRkVBVFVSRV9XTEFOX0NIX0FWT0lECisgICAgICAgICAgICAgICAgZm9yKCBpID0gMDsgaSA8IE5VTV8yME1IWl9SRl9DSEFOTkVMUzsgaSsrICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmKChOVl9DSEFOTkVMX0VOQUJMRSA9PQorICAgICAgICAgICAgICAgICAgICAgICAgdm9zX252X2dldENoYW5uZWxFbmFibGVkU3RhdGUoc2FmZUNoYW5uZWxzW2ldLmNoYW5uZWxOdW1iZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIChWT1NfVFJVRSA9PSBzYWZlQ2hhbm5lbHNbaV0uaXNTYWZlKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcHNhcENvbnRleHQtPmNoYW5uZWwgPSBzYWZlQ2hhbm5lbHNbaV0uY2hhbm5lbE51bWJlcjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorI2VuZGlmCisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgRkwoIkhhcyBzY2FuIGJhbmQgcHJlZmVyZW5jZSIpKTsKKyAgICAgICAgICAgIGlmIChlQ1NSX0JBTkRfMjQgPT0gcHNhcENvbnRleHQtPmN1cnJlbnRQcmVmZXJyZWRCYW5kKQorICAgICAgICAgICAgICAgIHBzYXBDb250ZXh0LT5jdXJyZW50UHJlZmVycmVkQmFuZCA9IGVDU1JfQkFORF81RzsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBwc2FwQ29udGV4dC0+Y3VycmVudFByZWZlcnJlZEJhbmQgPSBlQ1NSX0JBTkRfMjQ7CisKKyAgICAgICAgICAgIHBzYXBDb250ZXh0LT5hbGxCYW5kU2Nhbm5lZCA9IGVTQVBfVFJVRTsKKyAgICAgICAgICAgIC8vZ28gYmFjayB0byBESVNDT05ORUNUIHN0YXRlLCBzY2FuIG5leHQgYmFuZAorICAgICAgICAgICAgcHNhcENvbnRleHQtPnNhcHNNYWNoaW5lID0gZVNBUF9ESVNDT05ORUNURUQ7CisgICAgICAgICAgICBldmVudCA9IGVTQVBfQ0hBTk5FTF9TRUxFQ1RJT05fRkFJTEVEOworICAgICAgICB9CisgICAgfQorI2Vsc2UKKyAgICAgICBwc2FwQ29udGV4dC0+Y2hhbm5lbCA9IFNBUF9ERUZBVUxUX0NIQU5ORUw7CisjZW5kaWYKKyAgICBlbHNlCisgICAgeworICAgICAgcHNhcENvbnRleHQtPmNoYW5uZWwgPSBvcGVyQ2hhbm5lbDsKKyAgICB9CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgIEZMKCJTQVAgQ2hhbm5lbCA6ICVkIiksIHBzYXBDb250ZXh0LT5jaGFubmVsKTsKK30KKworI2lmZGVmIFdMQU5fRkVBVFVSRV9BUF9IVDQwXzI0RworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBzYXBfaHQyMDQwX3RpbWVyX2NiKCkKKworICBERVNDUklQVElPTgorICAgIFNBUCBIVDQwIHRpbWVyIENhbGxCYWNrLCBPbmNlIHRoaXMgZnVuY3Rpb24gZXhlY3V0ZSBpdCB3aWxsIG1vdmUgU0FQCisgICAgZnJvbSBIVDIwIHRvIEhUNDAKKworICBERVBFTkRFTkNJRVMKKyAgICBOQS4KKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHVzckRhdGFGb3JDYWxsYmFjayAgIDogVGhlIHNlY29uZCBjb250ZXh0IHBhc3MgaW4gZm9yIHRoZSBjYWxsZXIgKHNhcENvbnRleHQpCisKKyAgUkVUVVJOIFZBTFVFCisgIFNJREUgRUZGRUNUUworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIHNhcF9odDIwNDBfdGltZXJfY2Iodl9QVk9JRF90IHVzckRhdGFGb3JDYWxsYmFjaykKK3sKKyAgICB2X1U4X3QgY2JNb2RlOworICAgIHRIYWxIYW5kbGUgaEhhbDsKKyAgICBlSGFsU3RhdHVzIGhhbFN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgcHRTYXBDb250ZXh0IHNhcENvbnRleHQgPSAocHRTYXBDb250ZXh0KXVzckRhdGFGb3JDYWxsYmFjazsKKyAgICBlU2FwUGh5TW9kZSBzYXBQaHlNb2RlOworCisgICAgaEhhbCA9ICh0SGFsSGFuZGxlKXZvc19nZXRfY29udGV4dCggVk9TX01PRFVMRV9JRF9TTUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYXBDb250ZXh0LT5wdm9zR0N0eCk7CisgICAgaWYgKE5VTEwgPT0gaEhhbCkKKyAgICB7CisgICAgICAgIC8qIHdlIGhhdmUgYSBzZXJpb3VzIHByb2JsZW0gKi8KKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgIEZMKCJJbnZhbGlkIGhIYWwiKSk7CisgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGNiTW9kZSA9IHNtZV9HZXRDaGFubmVsQm9uZGluZ01vZGUyNEcoaEhhbCk7CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgIEZMKCJDdXJyZW50IENoYW5uZWwgYm9uZGluZyA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lOSV9ET1VCTEVfQ0hBTk5FTF9MT1dfUFJJTUFSWSkKKyAgICAgICAgICAgIGNiTW9kZSA9IFBIWV9ET1VCTEVfQ0hBTk5FTF9MT1dfUFJJTUFSWTsKKworICAgICAgICBoYWxTdGF0dXMgPSBzbWVfU2V0SFQyMDQwTW9kZShoSGFsLCBzYXBDb250ZXh0LT5zZXNzaW9uSWQsIGNiTW9kZSk7CisKKyAgICAgICAgaWYgKGhhbFN0YXR1cyA9PSBlSEFMX1NUQVRVU19GQUlMVVJFICkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkZhaWxlZCB0byBjaGFuZ2UgSFQyMC80MCBtb2RlIikpOworICAgICAgICB9CisgICAgfQorfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIHNhcENoZWNrSFQyMDQwQ29leEFjdGlvbigpCisKKyAgREVTQ1JJUFRJT04KKyAgICBDaGVjayAyMC80MCBDb2V4IEluZm8KKworICBERVBFTkRFTkNJRVMKKyAgICBOQS4KKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHB0U2FwQ29udGV4dCAgIDogVGhlIHNlY29uZCBjb250ZXh0IHBhc3MgaW4gZm9yIHRoZSBjYWxsZXIgKHNhcENvbnRleHQpCisgICAgdHBTaXJIVDIwNDBDb2V4SW5mb0luZCA6IDIwLzQwIENvZXggaW5mbworCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSBlSGFsU3RhdHVzIGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorCisgICAgZUhBTF9TVEFUVVNfU1VDQ0VTUzogU3VjY2VzcworCisgIFNJREUgRUZGRUNUUworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIHNhcENoZWNrSFQyMDQwQ29leEFjdGlvbihwdFNhcENvbnRleHQgcHNhcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJIVDIwNDBDb2V4SW5mb0luZCBwU21lSFQyMDQwQ29leEluZm9JbmQpCit7CisgICAgdl9VOF90IGk7CisgICAgdl9VOF90IGlzSFQ0MEFsbG93ZWQgPSAxOworICAgIHRIYWxIYW5kbGUgaEhhbDsKKyAgICB2X1U4X3QgY2JNb2RlOworICAgIGVIYWxTdGF0dXMgaGFsU3RhdHVzOworICAgIFZPU19TVEFUVVMgIHZvc1N0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgICB1bnNpZ25lZCBpbnQgZGVsYXk7CisKKyAgICAvKiB0SGFsSGFuZGxlICovCisgICAgaEhhbCA9IFZPU19HRVRfSEFMX0NCKHBzYXBDdHgtPnB2b3NHQ3R4KTsKKworICAgIGlmIChOVUxMID09IGhIYWwpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICBGTCgiSW4gaW52YWxpZCBoSGFsIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgLy8gR2V0IENoYW5uZWwgQm9uZGluZyBNb2RlCisgICAgY2JNb2RlID0gc21lX0dldENoYW5uZWxCb25kaW5nTW9kZTI0RyhoSGFsKTsKKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgRkwoIkN1cnJlbnQgQ2hhbm5lbCBCb25kaW5nIE1vZGU6ICVkIiksCisgICAgICAgICAgICAgICBjYk1vZGUpOworCisgICAgaWYgKHBTbWVIVDIwNDBDb2V4SW5mb0luZC0+SFQyME1IekJzc1dpZHRoUmVxKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgRkwoIjIwIE1IeiBCU1Mgd2lkdGggcmVxdWVzdCBiaXQgaXMgIgorICAgICAgICAgICAgICAgICAgICJzZXQgaW4gMjAvNDAgY29leGlzdGVuY2UgaW5mbyIpKTsKKyAgICAgICAgaXNIVDQwQWxsb3dlZCA9IDA7CisgICAgfQorCisgICAgaWYgKHBTbWVIVDIwNDBDb2V4SW5mb0luZC0+SFQ0ME1IekludG9sZXJhbnQpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICBGTCgiNDAgTUh6IGludG9sZXJhbnQgYml0IGlzIHNldCBpbiAiCisgICAgICAgICAgICAgICAgICAgICIyMC80MCBjb2V4aXN0ZW5jZSBpbmZvIikpOworICAgICAgICBpc0hUNDBBbGxvd2VkID0gMDsKKyAgICB9CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICBGTCgiVG90YWwgUmVwb3J0ZWQgMjAvNDAgQlNTIEludG9sZXJhbnQgQ2hhbm5lbHMgOiVkIiksCisgICAgICAgICAgICAgICAgcFNtZUhUMjA0MENvZXhJbmZvSW5kLT5jaGFubmVsX251bSk7CisKKyAgICBpZiAoKDAgPT0gcHNhcEN0eC0+YWZmZWN0ZWRfc3RhcnQpICYmICgwID09IHBzYXBDdHgtPmFmZmVjdGVkX2VuZCkpCisgICAgeworICAgICAgICBpZiAoIXNhcEdldDI0R09CU1NBZmZlY3RlZENoYW5uZWwoaEhhbCwgcHNhcEN0eCkpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIEZMKCJGYWlsZWQgdG8gZ2V0IE9CU1MgQWZmZWN0ZWQgQ2hhbm5lbCAiCisgICAgICAgICAgICAgICAgICAgICAiUmFuZ2UgZm9yIENoYW5uZWw6ICVkIiksIHBzYXBDdHgtPmNoYW5uZWwpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIC8qIFVwZGF0ZSB0byBPcmlnaW5hbCBDaGFubmVsIEJvbmRpbmcgZm9yIDIuNEdIeiAqLworICAgICAgICBzbWVfVXBkYXRlQ2hhbm5lbEJvbmRpbmdNb2RlMjRHKGhIYWwsIGNiTW9kZSk7CisgICAgfQorCisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICBGTCgiT0JTUyBBZmZlY3RlZCBDaGFubmVsIFJhbmdlIDogWyVkICVkXSIpLAorICAgICAgICAgICAgICAgcHNhcEN0eC0+YWZmZWN0ZWRfc3RhcnQsIHBzYXBDdHgtPmFmZmVjdGVkX2VuZCk7CisKKyAgICBpZiAocFNtZUhUMjA0MENvZXhJbmZvSW5kLT5jaGFubmVsX251bSkKKyAgICB7CisgICAgICAgIGZvcihpID0gMDsgaSA8IHBTbWVIVDIwNDBDb2V4SW5mb0luZC0+Y2hhbm5lbF9udW07IGkrKykKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKChwU21lSFQyMDQwQ29leEluZm9JbmQtPkhUMjA0MEJzc0ludG9DaGFuUmVwb3J0W2ldID4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNhcEN0eC0+YWZmZWN0ZWRfc3RhcnQpCisgICAgICAgICAgICAgICYmIChwU21lSFQyMDQwQ29leEluZm9JbmQtPkhUMjA0MEJzc0ludG9DaGFuUmVwb3J0W2ldIDwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNhcEN0eC0+YWZmZWN0ZWRfZW5kKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJCU1MgSW50b2xlcmFudCBDaGFubmVsOiAlZCB3aXRoaW4gT0JTUyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBBZmZlY3RlZCBDaGFubmVsIFJhbmdlIDogWyVkICVkXSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNtZUhUMjA0MENvZXhJbmZvSW5kLT5IVDIwNDBCc3NJbnRvQ2hhblJlcG9ydFtpXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzYXBDdHgtPmFmZmVjdGVkX3N0YXJ0LCBwc2FwQ3R4LT5hZmZlY3RlZF9lbmQpOworICAgICAgICAgICAgICAgIGlzSFQ0MEFsbG93ZWQgPSAwOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIlJlcG9ydGVkIDIwLzQwIEJTUyBJbnRvbGVyYW50IENoYW5uZWw6JWQgIgorICAgICAgICAgICAgICAgICAgICAgICAgIiBpcyBPdXQgb2YgT0JTUyBBZmZlY3RlZCBDaGFubmVsIFJhbmdlIDogWyVkICVkXSIpLAorICAgICAgICAgICAgICAgICAgICAgICBwU21lSFQyMDQwQ29leEluZm9JbmQtPkhUMjA0MEJzc0ludG9DaGFuUmVwb3J0W2ldLAorICAgICAgICAgICAgICAgICAgICAgICBwc2FwQ3R4LT5hZmZlY3RlZF9zdGFydCwgcHNhcEN0eC0+YWZmZWN0ZWRfZW5kKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIGlmICghaXNIVDQwQWxsb3dlZCkKKyAgICB7CisgICAgICAgIGlmKGNiTW9kZSkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgRkwoIk1vdmUgU0FQIGZyb20gSFQ0MCB0byBIVDIwIikpOworCisgICAgICAgICAgICBoYWxTdGF0dXMgPSBzbWVfU2V0SFQyMDQwTW9kZShoSGFsLCBwc2FwQ3R4LT5zZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBIWV9TSU5HTEVfQ0hBTk5FTF9DRU5URVJFRCk7CisgICAgICAgICAgICBpZiAoaGFsU3RhdHVzID09IGVIQUxfU1RBVFVTX0ZBSUxVUkUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkZhaWxlZCB0byBjaGFuZ2UgSFQyMC80MCBtb2RlIikpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyogRGlzYWJsZSBDaGFubmVsIEJvbmRpbmcgZm9yIDIuNEdIeiAqLworICAgICAgICAgICAgc21lX1VwZGF0ZUNoYW5uZWxCb25kaW5nTW9kZTI0RyhoSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQSFlfU0lOR0xFX0NIQU5ORUxfQ0VOVEVSRUQpOworICAgICAgICB9CisKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgRkwoIlNBUCBpcyBBbHJlYWR5IGluIEhUMjAiKSk7CisKKyAgICAgICAgaWYgKCghc2FwQ2hlY2tIVDQwU2Vjb25kYXJ5SXNOb3RBbGxvd2VkKHBzYXBDdHgpKQorICAgICAgICAgICAmJiAoIXBzYXBDdHgtPm51bUhUNDBJbnRvU3RhKSkKKyAgICAgICAgeworICAgICAgICAgICAgLyogU3RvcCBQcmV2aW91cyBSdW5uaW5nIEhUMjAvNDAgVGltZXIgJiBTdGFydCB0aW1lcgorICAgICAgICAgICAgICAgd2l0aCAoT0JTUyBUcmFuc2l0aW9uRGVsYXlGYWN0b3IgKiBvYnNzIGludGVydmFsKQorICAgICAgICAgICAgICAgZGVsYXkgYWZ0ZXIgdGltZSBvdXQgbW92ZSBBUCBmcm9tIEhUMjAgLT4gSFQ0MAorICAgICAgICAgICAgICAgbW9kZQorICAgICAgICAgICAgICovCisgICAgICAgICAgICBpZiAoVk9TX1RJTUVSX1NUQVRFX1JVTk5JTkcgPT0gcHNhcEN0eC0+c2FwX0hUMjA0MF90aW1lci5zdGF0ZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NTdGF0dXMgPSB2b3NfdGltZXJfc3RvcCgmcHNhcEN0eC0+c2FwX0hUMjA0MF90aW1lcik7CisgICAgICAgICAgICAgICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zU3RhdHVzKSkKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJGYWlsZWQgdG8gU3RvcCBIVDIwLzQwIHRpbWVyIikpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBkZWxheSA9IHBzYXBDdHgtPk9ic3NTY2FuSW50ZXJ2YWwgKiBwc2FwQ3R4LT5PYnNzVHJhbnNpdGlvbkRlbGF5RmFjdG9yOworCisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJTdGFydCBIVDIwLzQwIGl0cmFuc2l0aW9uIgorICAgICAgICAgICAgICAgICAgICAgICAiIHRpbWVyICglZCBzZWMpIiksIGRlbGF5KTsKKworICAgICAgICAgICAgdm9zU3RhdHVzID0gdm9zX3RpbWVyX3N0YXJ0KCAmcHNhcEN0eC0+c2FwX0hUMjA0MF90aW1lciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkZWxheSAqIDEwMDApKTsKKworICAgICAgICAgICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zU3RhdHVzKSkKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkZhaWxlZCB0byBTdGFydCBIVDIwLzQwIHRpbWVyIikpOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybjsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBzYXBDaGVja0ZvcjIwTWh6T2JzcygpCisKKyAgREVTQ1JJUFRJT04KKyAgICBDaGVjayAyMCBNSHogT3ZlcmxhcHBpbmcgQlNTCisKKyAgREVQRU5ERU5DSUVTCisgICAgTkEuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICBjaGFubmVsTnVtYmVyIDogUGVlciBCU1MgT3BlcmF0aW5nIENoYW5uZWwKKyAgICB0cFNpclByb2JlUmVzcEJlYWNvbjogUG9pbnRlciB0byBCZWFjb24gU3RydWN0CisgICAgcHRTYXBDb250ZXh0OiBQb2ludGVyIHRvIFNBUCBDb250ZXh0CisKKyAgUkVUVVJOIFZBTFVFCisgICAgdl9VOF90ICAgICAgICAgIDogU3VjY2VzcyAtIEZvdW5kIE9CU1MgQlNTLCBGYWlsIC0gemVybworCisgIFNJREUgRUZGRUNUUworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKK2VIYWxTdGF0dXMgc2FwQ2hlY2tGb3IyME1oek9ic3Modl9VOF90IGNoYW5uZWxOdW1iZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJQcm9iZVJlc3BCZWFjb24gIHBCZWFjb25TdHJ1Y3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRTYXBDb250ZXh0IHBzYXBDdHgpCit7CisKKyAgICB2X1UxNl90IHNlY29uZGFyeUNoYW5uZWxPZmZzZXQ7CisgICAgZUhhbFN0YXR1cyBoYWxTdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworCisgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICBGTCgiY2hhbm5lbE51bWJlcjogJWQgQlNTOiAlcyIpLCBjaGFubmVsTnVtYmVyLAorICAgICAgICAgICAgIHBCZWFjb25TdHJ1Y3QtPnNzSWQuc3NJZCk7CisKKyAgICBpZiAoY2hhbm5lbE51bWJlciA8IHBzYXBDdHgtPmFmZmVjdGVkX3N0YXJ0CisgICAgICB8fCBjaGFubmVsTnVtYmVyID4gcHNhcEN0eC0+YWZmZWN0ZWRfZW5kKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICA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WN0LT5zc0lkLnNzSWQsIHNlY29uZGFyeUNoYW5uZWxPZmZzZXQsCisgICAgICAgICAgICAgICAgICAgY2hhbm5lbE51bWJlcik7CisgICAgICAgIGlmIChQSFlfU0lOR0xFX0NIQU5ORUxfQ0VOVEVSRUQgPT0gc2Vjb25kYXJ5Q2hhbm5lbE9mZnNldCkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgRkwoIkZvdW5kIG92ZXJsYXBwaW5nIDIwIE1IeiBIVCBCU1M6ICVzIG9uIENoYW5uZWwgOiAlZCIpLAorICAgICAgICAgICAgICAgICAgIHBCZWFjb25TdHJ1Y3QtPnNzSWQuc3NJZCwgY2hhbm5lbE51bWJlcik7CisgICAgICAgICAgICBoYWxTdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgcmV0dXJuIGhhbFN0YXR1czsKKyAgICAgICAgfQorICAgICB9CisgICAgIHJldHVybiBoYWxTdGF0dXM7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgc2FwR2V0UHJpbWFyeVNlY29uZGFyeUNoYW5uZWxPZkJzcygpCisKKyAgREVTQ1JJUFRJT04KKyAgICBHZXQgUHJpbWFyeSAmIFNlY29uYXJ5IENoYW5uZWwgb2YgT3ZlcmxhcHBpbmcgQlNTCisKKyAgREVQRU5ERU5DSUVTCisgICAgTkEuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICB0cFNpclByb2JlUmVzcEJlYWNvbjogUG9pbnRlciB0byBCZWFjb24gU3RydWN0CisgICAgcHJpX2NoYW4gOiBQcmltYXJ5IE9wZXJhdGluZyBDaGFubmVsCisgICAgc2VjX2NoYW4gOiBTZW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TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICBGTCgiQlNTIFByaW1hcnkgJiBTZWNvbmRhcnkgQ2hhbm5lbCA6ICVkICVkICIpLAorICAgICAgICAgICAgICAgKnByaV9jaGFuLCAqc2VjX2NoYW4pOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIHNhcENoZWNrSFQ0MFNlY29uZGFyeUlzTm90QWxsb3dlZCgpCisKKyAgREVTQ1JJUFRJT04KKyAgICBDaGVjayBIVDQwIENoYW5uZWwgU2Vjb25kYXJ5IGlzIEFsbG93ZWQKKworICBERVBFTkRFTkNJRVMKKyAgICBOQS4KKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHB0U2FwQ29udGV4dDogUG9pbnRlciB0byBTQVAgQ29udGV4dAorCisgIFJFVFVSTiBWQUxVRQorICAgIHZfVThfdCAgICAgICAgICA6IFN1Y2Nlc3MgLSBIVDQwIEFsbG93ZWQgaW4gU2VsZWN0ZWQgQ2hhbm5hbGUgUGFpcgorICAgICAgICAgICAgICAgICAgICAgIEZhaWwgLSBIVDQwIE5vdCBBbGxvd2VkCisKKyAgU0lERSBFRkZFQ1RTCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworZUhhbFN0YXR1cyBzYXBDaGVja0hUNDBTZWNvbmRhcnlJc05vdEFsbG93ZWQocHRTYXBDb250ZXh0IHBzYXBDdHgpCit7CisgICAgdl9VOF90IGNvdW50OworICAgIHZfVThfdCBmVmFsaWRDaGFubmVsID0gMDsKKyAgICBlSGFsU3RhdHVzIGhhbFN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisjaWZkZWYgRkVBVFVSRV9XTEFOX0NIX0FWT0lECisgICAgaW50IGk7CisgICAg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NvbmRhcnkgQ2hhbm5lbDogJWQiKSwKKyAgICAgICAgICAgdW5zYWZlQ2hhbm5lbENvdW50LCBwc2FwQ3R4LT5zYXBfc2VjX2NoYW4pOworCisgICAgZm9yIChpID0gMDsgaSA8IHVuc2FmZUNoYW5uZWxDb3VudDsgaSsrKQorICAgIHsKKyAgICAgICAgaWYgKChwc2FwQ3R4LT5zYXBfc2VjX2NoYW4gPT0gdW5zYWZlQ2hhbm5lbExpc3RbaV0pKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgIEZMKCJVbnNhZmUgQ2hhbm5lbCAlZCBTQVAgU2Vjb25kYXJ5IENoYW5uZWw6ICVkIiksCisgICAgICAgICAgICAgICAgICAgIHVuc2FmZUNoYW5uZWxMaXN0W2ldLCBwc2FwQ3R4LT5zYXBfc2VjX2NoYW4pOworICAgICAgICAgICAgZlZhbGlkQ2hhbm5lbCA9IEZBTFNFOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0NIX0FWT0lEICovCisKKyAgICBpZiAoIWZWYWxpZENoYW5uZWwpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICBGTCgiSFQ0MCBJbiBTZWNvbmRhcnkgQ2hhbm5lbCA6ICVkIG5vdCBhbGxvd2VkIiksCisgICAgICAgICAgICAgICAgICAgcHNhcEN0eC0+c2FwX3NlY19jaGFuKTsKKworICAgICAgICBoYWxTdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICByZXR1cm4gaGFsU3RhdHVzOworICAgIH0KKworICAgIHJldHVybiBoYWxTdGF0dXM7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgc2FwR2V0MjRHT0JTU0FmZmVjdGVkQ2hhbm5lbCgpCisKKyAgREVTQ1JJUFRJT04KKyAgICBHZXQgT0JTUyBBZmZlY3RlZCBDaGFubmVsIFJhbmdlCisKKyAgREVQRU5ERU5DSUVTCisgICAgTkEuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICB0SGFsSGFuZGxlICA6IHRIYWxIYW5kbGUgcGFzc2VkIGluIHdpdGggQWZmZWN0ZWQgQ2hhbm5lbAorICAgIHB0U2FwQ29udGV4dDogUG9pbnRlciB0byBTQVAgQ29udGV4dAorCisgIFJFVFVSTiBWQUxVRQorICAgIHZfVThfdCAgICAgICAgICA6IFN1Y2Nlc3MgLSBBYmxlIHRvIGdldCBBZmZlY3RlZENoYW5uZWwKKyAgICAgICAgICAgICAgICAgICAgICBGYWlsIC0gRmFpbCB0byBnZXQgQWZmZWN0ZWRDaGFubmVsCisKKyAgU0lERSBFRkZFQ1RTCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworZUhhbFN0YXR1cyBzYXBHZXQyNEdPQlNTQWZmZWN0ZWRDaGFubmVsKHRIYWxIYW5kbGUgaGFsSGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRTYXBDb250ZXh0IHBzYXBDdHgpCit7CisKKyAgICB2X1U4X3QgY2JNb2RlOworICAgIHZfVTMyX3QgcHJpX2ZyZXEsIHNlY19mcmVxOworICAgIHZfVTMyX3QgYWZmZWN0ZWRfc3RhcnRfZnJlcSwgYWZmZWN0ZWRfZW5kX2ZyZXE7CisgICAgZVNhcFBoeU1vZGUgc2FwUGh5TW9kZTsKKyAgICBlSGFsU3RhdHVzIGhhbFN0YXR1cz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mIDI0ODIgRnJlcXVlbmN5CisgICAgICAgICAqIEhlbmNlIHRha2luZyBsb3dlciBjaGFubmVsIDEzIChGcmVxIDI0NzIpIGhlcmUuCisgICAgICAgICAqLworICAgICAgICBpZiAoKDI0NzcgPT0gKGFmZmVjdGVkX2VuZF9mcmVxKSkgfHwgKDI0ODIgPT0gYWZmZWN0ZWRfZW5kX2ZyZXEpKQorICAgICAgICB7CisgICAgICAgICAgICBwc2FwQ3R4LT5hZmZlY3RlZF9lbmQgPSAxMzsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmICgyNDg3ID09IGFmZmVjdGVkX2VuZF9mcmVxKQorICAgICAgICB7CisgICAgICAgICAgIC8qIEFzIHRoZXJlIGlzIG5vIGNoYW5uZWwgYXZhaWxhYmUgZm9yIDI0ODcgRnJlcXVlbmN5CisgICAgICAgICAgICAqIEhlbmNlIHRha2luZyBsb3dlciBjaGFubmVsIDE0IChGcmVxIDI0ODQpIGhlcmUuCisgICAgICAgICAgICAqLworICAgICAgICAgICAgcHNhcEN0eC0+YWZmZWN0ZWRfZW5kID0gMTQ7CisgICAgICAgIH0KKworICAgICAgICBwc2FwQ3R4LT5zYXBfc2VjX2NoYW4gPSB2b3NfZnJlcV90b19jaGFuKHNlY19mcmVxKTsKKworICAgICAgICBoYWxTdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICByZXR1cm4gaGFsU3RhdHVzOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBwc2FwQ3R4LT5hZmZlY3RlZF9zdGFydCA9IDA7CisgICAgICAgIHBzYXBDdHgtPmFmZmVjdGVkX2VuZCA9IDA7CisgICAgICAgIHBzYXBDdHgtPnNhcF9zZWNfY2hhbiA9IDA7CisgICAgICAgIGhhbFN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgIHJldHVybiBoYWxTdGF0dXM7CisgICAgfQorfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIHNhcENoZWNrNDBNaHoyNEcKKworICBERVNDUklQVElPTgorICBDaGVjayBIVDQwIGlzIHBvc3NpYmxlIGluIDIuNEdIeiBtb2RlCisKKyAgREVQRU5ERU5DSUVTCisgICAgTkEuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICBoYWxIYW5kbGUgICAgICAgOiBQb2ludGVyIHRvIEhBTCBoYW5kbGUKKyAgICBwdFNhcENvbnRleHQgICAgOiBQb2ludGVyIHRvIFNBUCBDb250ZXh0CisgICAgcFJlc3VsdCAgICAgICAgIDogUG9pbnRlciB0byB0U2NhblJlc3VsdEhhbmRsZQorCisgIFJFVFVSTiBWQUxVRQorICAgIHZfVThfdCAgICAgICAgICA6IFN1Y2Nlc3MgLSBIVDQwIFBvc3NpYmxlLCBGYWlsIC0gemVybworCisgIFNJREUgRUZGRUNUUworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKK2VIYWxTdGF0dXMgc2FwQ2hlY2s0ME1oejI0Ryh0SGFsSGFuZGxlIGhhbEhhbmRsZSwgcHRTYXBDb250ZXh0IHBzYXBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTY2FuUmVzdWx0SGFuZGxlIHBSZXN1bHQpCit7CisgICAgdl9VMzJfdCBwcmlfY2hhbiwgc2VjX2NoYW47CisgICAgdl9VMzJfdCBpZUxlbiA9IDA7CisgICAgdl9VOF90IGNoYW5uZWxOdW1iZXIgPSAwOworICAgIHRTaXJQcm9iZVJlc3BCZWFjb24gKnBCZWFjb25TdHJ1Y3Q7CisgICAgdENzclNjYW5SZXN1bHRJbmZvICpwU2NhblJlc3VsdDsKKyAgICB0cEFuaVNpckdsb2JhbCAgcE1hYyA9ICh0cEFuaVNpckdsb2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IGVsc2UKKyAgICAgICAgICAgIGNoYW5uZWxOdW1iZXIgPSBwU2NhblJlc3VsdC0+QnNzRGVzY3JpcHRvci5jaGFubmVsSWQ7CisKKyAgICAgICAgaWYgKGNoYW5uZWxOdW1iZXIgPiBTSVJfMTFCX0NIQU5ORUxfRU5EKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgIEZMKCJjaGFubmVsTnVtYmVyOiAlZCBCU1M6ICVzIiksCisgICAgICAgICAgICAgICAgICAgY2hhbm5lbE51bWJlciwgIHBCZWFjb25TdHJ1Y3QtPnNzSWQuc3NJZCk7CisgICAgICAgICAgICBnb3RvIE5leHRSZXN1bHQ7CisgICAgICAgIH0KKworICAgICAgICBpZiAoKHBTY2FuUmVzdWx0LT5Cc3NEZXNjcmlwdG9yLmllRmllbGRzICE9IE5VTEwpKQorICAgICAgICB7CisgICAgICAgICAgICBpZUxlbiA9IChwU2NhblJlc3VsdC0+QnNzRGVzY3JpcHRvci5sZW5ndGggKyBzaXplb2YodEFOSV9VMTYpKTsKKyAgICAgICAgICAgIGllTGVuICs9IChzaXplb2YodEFOSV9VMzIpIC0gc2l6ZW9mKHRTaXJCc3NEZXNjcmlwdGlvbikpOworICAgICAgICAgICAgdm9zX21lbV9zZXQoKHRBTklfVTggKikgcEJlYWNvblN0cnVjdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpclByb2JlUmVzcEJlYWNvbiksIDApOworCisgICAgICAgICAgICBpZiAoKGVTSVJfU1VDQ0VTUyA9PSBzaXJQYXJzZUJlYWNvbklFKHBNYWMsIHBCZWFjb25TdHJ1Y3QsCisgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSggcFNjYW5SZXN1bHQtPkJzc0Rlc2NyaXB0b3IuaWVGaWVsZHMpLCBpZUxlbikpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIENoZWNrIFBlZXIgQlNTIGlzIEhUMjAgb3IgTGVnYWN5IEFQICovCisgICAgICAgICAgICAgICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgc2FwQ2hlY2tGb3IyME1oek9ic3MoY2hhbm5lbE51bWJlciwgcEJlYWNvblN0cnVjdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNhcEN0eCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIk92ZXJsYXBwaW5nIDIwIE1IeiBCU1MgaXMgZm91bmQiKSk7CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwQmVhY29uU3RydWN0KTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGhhbFN0YXR1czsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBzYXBHZXRQcmltYXJ5U2Vjb25kYXJ5Q2hhbm5lbE9mQnNzKHBCZWFjb25TdHJ1Y3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcHJpX2NoYW4sICZzZWNfY2hhbik7CisKKyAgICAgICAgICAgICAgICAvKiBDaGVjayBwZWVyIEJTUyBPcGVyYXRpbmcgY2hhbm5lbCBpcyBub3Qgd2l0aGluIE9CU1MgYWZmZWN0ZWQKKyAgICAgICAgICAgICAgICAgKiBjaGFubmVsIHJhbmdlCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgaWYgKChwcmlfY2hhbiA8IHBzYXBDdHgtPmFmZmVjdGVkX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgIHx8IHByaV9jaGFuID4gcHNhcEN0eC0+YWZmZWN0ZWRfZW5kKQorICAgICAgICAgICAgICAgICAgICYmIChzZWNfY2hhbiA8IHBzYXBDdHgtPmFmZmVjdGVkX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgIHx8IHNlY19jaGFuID4gcHNhcEN0eC0+YWZmZWN0ZWRfZW5kKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICBGTCgiUGVlciBCU1M6ICVzIFByaW1hcnkgJiBTZWNvbmRhcnkgQ2hhbm5lbCBbJWQgJWRdIgorICAgICAgICAgICAgICAgICAgICAgICAgImlzIG91dCBvZiBhZmZlY3RlZCBSYW5nZTogWyVkICVkXSIpLAorICAgICAgICAgICAgICAgICAgICAgcEJlYWNvblN0cnVjdC0+c3NJZC5zc0lkLCBwcmlfY2hhbiwgc2VjX2NoYW4sCisgICAgICAgICAgICAgICAgICAgICBwc2FwQ3R4LT5hZmZlY3RlZF9zdGFydCwgcHNhcEN0eC0+YWZmZWN0ZWRfZW5kKTsKKyAgICAgICAgICAgICAgICAgICAgZ290byBOZXh0UmVzdWx0OyAvKiBub3Qgd2l0aGluIGFmZmVjdGVkIGNoYW5uZWwgcmFuZ2UgKi8KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICBGTCgiTmVpZ2hib3JpbmcgQlNTOiAlcyBQcmltYXJ5ICYgU2Vjb25kYXJ5IENoYW5uZWwgWyVkICVkXSIpLAorICAgICAgICAgICAgICAgICBwQmVhY29uU3RydWN0LT5zc0lkLnNzSWQsIHByaV9jaGFuLCBzZWNfY2hhbik7CisKKyAgICAgICAgICAgICAgICBpZiAoc2VjX2NoYW4pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBQZWVyIEJTUyBpcyBIVDQwIGNhcGFibGUgdGhlbiBjaGVjayBwZWVyIEJTUworICAgICAgICAgICAgICAgICAgICAgKiBwcmltYXJ5ICYgc2Vjb25kYXJ5IGNoYW5uZWwgd2l0aCBTQVAKKyAgICAgICAgICAgICAgICAgICAgICogUHJpbWFyeSAmIFNlY29uZGFyeSBjaGFubmVsLgorICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKChwc2FwQ3R4LT5jaGFubmVsICE9ICBwcmlfY2hhbikKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgKHBzYXBDdHgtPnNhcF9zZWNfY2hhbiAhPSBzZWNfY2hhbikpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIjQwIE1IeiBQcmkvU2VjIGNoYW5uZWwgOiBbJWQgJWRdIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgbWlzc21hdGNoIHdpdGggIEJTUzogJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBQcmkvU2VjIGNoYW5uZWwgOiBbJWQgJWRdIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNhcEN0eC0+Y2hhbm5lbCwgcHNhcEN0eC0+c2FwX3NlY19jaGFuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCZWFjb25TdHJ1Y3QtPnNzSWQuc3NJZCwgcHJpX2NoYW4sIHNlY19jaGFuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocEJlYWNvblN0cnVjdCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGhhbFN0YXR1czsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChwQmVhY29uU3RydWN0LT5IVENhcHMucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qIENoZWNrIFBlZXIgQlNTIEhUIGNhcGFibGl0eSBoYXMgNDBNSHogSW50b2xlcmFudCBiaXQgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKHBCZWFjb25TdHJ1Y3QtPkhUQ2Fwcy5zdGJjQ29udHJvbEZyYW1lKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiRm91bmQgQlNTOiAlcyB3aXRoIDQwIE1IeiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkludG9sZXJhbnQgaXMgc2V0IG9uIENoYW5uZWwgOiAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQmVhY29uU3RydWN0LT5zc0lkLnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxOdW1iZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBCZWFjb25TdHJ1Y3QpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGhhbFN0YXR1czsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkZhaWxlZCB0byBQYXJzZSB0aGUgQmVhY29uIElFcyIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICBGTCgiQlNTIElFcyBGYWlsZWQgaXMgTlVMTCBpbiBTY2FuIikpOworICAgICAgICB9CisKK05leHRSZXN1bHQ6CisgICAgICAgIHBTY2FuUmVzdWx0ID0gc21lX1NjYW5SZXN1bHRHZXROZXh0KGhhbEhhbmRsZSwgcFJlc3VsdCk7CisgICAgfQorICAgIHZvc19tZW1fZnJlZShwQmVhY29uU3RydWN0KTsKKworICAgIGlmIChwc2FwQ3R4LT5zYXBfc2VjX2NoYW4pCisgICAgeworICAgICAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyA9PSBzYXBDaGVja0hUNDBTZWNvbmRhcnlJc05vdEFsbG93ZWQocHNhcEN0eCkpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJTdGFydCBTQVAvUDJQIEdPIGluIEhUIDQwTUh6ICIKKyAgICAgICAgICAgICAgICAgICAgICAgIlByaW1hcnkgJiBTZWNvbmRhcnkgQ2hhbm5lbDogWyVkICVkXSIpLAorICAgICAgICAgICAgICAgICAgICAgICBwc2FwQ3R4LT5jaGFubmVsLCBwc2FwQ3R4LT5zYXBfc2VjX2NoYW4pOworICAgICAgICAgICAgaGFsU3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgIHJldHVybiBoYWxTdGF0dXM7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gaGFsU3RhdHVzOworfQorI2VuZGlmCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlNBUF9TY2FuQ2FsbGJhY2soKQorCisgIERFU0NSSVBUSU9OCisgICAgQ2FsbGJhY2sgZm9yIFNjYW4gKHNjYW4gcmVzdWx0cykgRXZlbnRzCisKKyAgREVQRU5ERU5DSUVTCisgICAgTkEuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICB0SGFsSGFuZGxlICA6IHRIYWxIYW5kbGUgcGFzc2VkIGluIHdpdGggdGhlIHNjYW4gcmVxdWVzdAorICAgICpwQ29udGV4dCAgIDogVGhlIHNlY29uZCBjb250ZXh0IHBhc3MgaW4gZm9yIHRoZSBjYWxsZXIgKHNhcENvbnRleHQpCisgICAgc2NhbklEICAgICAgOiBzY2FuSUQgZ290IGFmdGVyIHRoZSBzY2FuCisgICAgc3RhdHVzICAgICAgOiBTdGF0dXMgb2Ygc2NhbiAtc3VjY2VzcywgZmFpbHVyZSBvciBhYm9ydAorCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSBlSGFsU3RhdHVzIGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorCisgICAgZUhBTF9TVEFUVVNfU1VDQ0VTUzogU3VjY2VzcworCisgIFNJREUgRUZGRUNUUworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitlSGFsU3RhdHVzCitXTEFOU0FQX1NjYW5DYWxsYmFjaworKAorICB0SGFsSGFuZGxlIGhhbEhhbmRsZSwKKyAgdm9pZCAqcENvbnRleHQsICAgICAgICAgICAvKiBPcGFxdWUgU0F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VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgIkluICVzLCBiZWZvcmUgc3dpdGNoIG9uIHNjYW5TdGF0dXMgPSAlZCIsIF9fZnVuY19fLCBzY2FuU3RhdHVzKTsKKworICAgIHN3aXRjaCAoc2NhblN0YXR1cykKKyAgICB7CisgICAgICAgIGNhc2UgZUNTUl9TQ0FOX1NVQ0NFU1M6CisgICAgICAgICAgICAvLyBzYXBTY2FuQ29tcGxldGVDYWxsYmFjayB3aXRoIGVDU1JfU0NBTl9TVUNDRVNTCisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgIkluICVzLCBDU1Igc2NhblN0YXR1cyA9ICVzICglZCkiLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICJlQ1NSX1NDQU5fU1VDQ0VTUyIsIHNjYW5TdGF0dXMpOworCisgICAgICAgICAgICAvKiBHZXQgc2NhbiByZXN1bHRzLCBSdW4gY2hhbm5lbCBzZWxlY3Rpb24gYWxnb3JpdGhtLAorICAgICAgICAgICAgICogc2VsZWN0IGNoYW5uZWwgYW5kIGtlZXAgaW4gcFNhcENvbnRleHQtPkNoYW5uZWwKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgc2NhbkdldFJlc3VsdFN0YXR1cyA9IHNtZV9TY2FuR2V0UmVzdWx0KGhhbEhhbmRsZSwgMCwgTlVMTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwUmVzdWx0KTsKKworICAgICAgICAgICAgZXZlbnQgPSBlU0FQX01BQ19TQ0FOX0NPTVBMRVRFOworCisgICAgICAgICAgICBpZiAoKHNjYW5HZXRSZXN1bHRTdGF0dXMgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICYmIChzY2FuR2V0UmVzdWx0U3RhdHVzICE9IGVIQUxfU1RBVFVTX0VfTlVMTF9WQUxVRSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gTm8gc2NhbiByZXN1bHRzCisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgIkluICVzLCBHZXQgc2NhbiByZXN1bHQgZmFpbGVkISByZXQgPSAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBzY2FuR2V0UmVzdWx0U3RhdHVzKTsKKyAgICAgICAgICAgICAgICBzYXBTZXRPcGVyYXRpbmdDaGFubmVsKHBzYXBDb250ZXh0LCBvcGVyQ2hhbm5lbCk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfQVBfSFQ0MF8yNEcKKyAgICAgICAgICAgIGlmIChwc2FwQ29udGV4dC0+Y2hhbm5lbCA9PSBBVVRPX0NIQU5ORUxfU0VMRUNUKQorI2VuZGlmCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgb3BlckNoYW5uZWwgPSBzYXBTZWxlY3RDaGFubmVsKGhhbEhhbmRsZSwgcHNhcENvbnRleHQsIHBSZXN1bHQpOworICAgICAgICAgICAgICAgIHNhcFNldE9wZXJhdGluZ0NoYW5uZWwocHNhcENvbnRleHQsIG9wZXJDaGFubmVsKTsKKyAgICAgICAgICAgIH0KKworI2lmZGVmIFdMQU5fRkVBVFVSRV9BUF9IVDQwXzI0RworICAgICAgICAgICAgaWYgKChwc2FwQ29udGV4dC0+Y2hhbm5lbCA8PSBTSVJfMTFCX0NIQU5ORUxfRU5EKQorICAgICAgICAgICAgICAgJiYgKHBzYXBDb250ZXh0LT5jaGFubmVsID4gMCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0KKyAgICAgICAgICAgICAgICAgICAgICAgICBzYXBDaGVjazQwTWh6MjRHKGhhbEhhbmRsZSwgcHNhcENvbnRleHQsIHBSZXN1bHQpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJTdGFydGluZyBTQVAgaW50byBIVDIwIikpOworICAgICAgICAgICAgICAgICAgICAvKiBEaXNhYmxlIENoYW5uZWwgQm9uZGluZyBmb3IgMi40R0h6ICovCisgICAgICAgICAgICAgICAgICAgIHNtZV9VcGRhdGVDaGFubmVsQm9uZGluZ01vZGUyNEcoaGFsSGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUEhZX1NJTkdMRV9DSEFOTkVMX0NFTlRFUkVEKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgfQorI2VuZGlmCisgICAgICAgICAgICBzbWVfU2NhblJlc3VsdFB1cmdlKGhhbEhhbmRsZSwgcFJlc3VsdCk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgZXZlbnQgPSBlU0FQX0NIQU5ORUxfU0VMRUNUSU9OX0ZBSUxFRDsKKyAgICAgICAgICAgIGlmIChwc2FwQ29udGV4dC0+Y2hhbm5lbCA9PSBBVVRPX0NIQU5ORUxfU0VMRUNUKQorICAgICAgICAgICAgICAgIHNhcFNldE9wZXJhdGluZ0NoYW5uZWwocHNhcENvbnRleHQsIG9wZXJDaGFubmVsKTsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfQVBfSFQ0MF8yNEcKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUi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XMsIAorICAgIGVDc3JSb2FtUmVzdWx0IHJvYW1SZXN1bHQKKykKK3sKKyAgICAvKiBzYXBDb250ZXh0IHZhbHVlICovICAgIAorICAgIHB0U2FwQ29udGV4dCBzYXBDb250ZXh0ID0gKHB0U2FwQ29udGV4dCkgcENvbnRleHQ7IAorICAgIHRXTEFOX1NBUEV2ZW50IHNhcEV2ZW50OyAvKiBTdGF0ZSBtYWNoaW5lIGV2ZW50ICovCisgICAgVk9TX1NUQVRVUyAgdm9zU3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgIGVIYWxTdGF0dXMgaGFsU3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAgRkwoIkJlZm9yZSBzd2l0Y2ggb24gcm9hbVN0YXR1cyA9ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb2FtU3RhdHVzKTsKKyAgICBzd2l0Y2gocm9hbVN0YXR1cykKKyAgICB7CisgICAgICAgIGNhc2UgZUNTUl9ST0FNX1NFU1NJT05fT1BFTkVEOgorICAgICAgICB7CisgICAgICAgICAgICAvKiB0SGFsSGFuZGxlICovCisgICAgICAgICAgICB0SGFsSGFuZGxlIGhIYWwgPSBWT1NfR0VUX0hBTF9DQihzYXBDb250ZXh0LT5wdm9zR0N0eCk7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkNTUiByb2FtU3RhdHVzID0gJXMgKCVkKSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgImVDU1JfUk9BTV9TRVNTSU9OX09QRU5FRCIsIHJvYW1TdGF0dXMpOworCisgICAgICAgICAgICBpZiAoTlVMTCA9PSBoSGFsKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAiSW4gJXMgaW52YWxpZCBoSGFsIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgaGFsU3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTEVEX0FMTE9DOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIkluICVzIGNhbGxpbmcgc21lX1JvYW1Db25uZWN0IHdpdGggZUNTUl9CU1NfVFlQRV9JTkZSQV9BUCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgIHNhcENvbnRleHQtPmlzU2FwU2Vzc2lvbk9wZW4gPSBlU0FQX1RSVUU7CisgICAgICAgICAgICAgICBoYWxTdGF0dXMgPSBzbWVfUm9hbUNvbm5lY3QoaEhhbCwgc2FwQ29udGV4dC0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZzYXBDb250ZXh0LT5jc3JSb2FtUHJvZmlsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmc2FwQ29udGV4dC0+Y3NyUm9hbUlkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fSU5GUkFfSU5EOgorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJDU1Igcm9hbVN0YXR1cyA9ICVzICglZCkiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJlQ1NSX1JPQU1fSU5GUkFfSU5EIiwgcm9hbVN0YXR1cyk7CisgICAgICAgICAgICBpZihyb2FtUmVzdWx0ID09IGVDU1JfUk9BTV9SRVNVTFRfSU5GUkFfU1RBUlRfRkFJTEVEKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEZpbGwgaW4gdGhlIGV2ZW50IHN0cnVjdHVyZSAqLyAKKyAgICAgICAgICAgICAgICBzYXBFdmVudC5ldmVudCA9IGVTQVBfTUFDX1NUQVJUX0ZBSUxTOyAKKyAgICAgICAgICAgICAgICBzYXBFdmVudC5wYXJhbXMgPSBwQ3NyUm9hbUluZm87CisgICAgICAgICAgICAgICAgc2FwRXZlbnQudTEgPSByb2FtU3RhdHVzOworICAgICAgICAgICAgICAgIHNhcEV2ZW50LnUyID0gcm9hbVJlc3VsdDsgCisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgLyogSGFuZGxlIGV2ZW50ICovIAorICAgICAgICAgICAgICAgIHZvc1N0YXR1cyA9IHNhcEZzbShzYXBDb250ZXh0LCAmc2FwRXZlbnQpOworICAgICAgICAgICAgICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zU3RhdHVzKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGhhbFN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fTE9TVExJTks6CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkNTUiByb2FtU3RhdHVzID0gJXMgKCVkKSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgImVDU1JfUk9BTV9MT1NUTElOSyIsIHJvYW1TdGF0dXMpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fTUlDX0VSUk9SX0lORDoKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAgICBGTCgiQ1NSIHJvYW1TdGF0dXMgPSAlcyAoJWQpIiksCisgICAgICAgICAgICAgICAgICAgICAgICAiZUNTUl9ST0FNX01JQ19FUlJPUl9JTkQiLCByb2FtU3RhdHVzKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUNTUl9ST0FNX1NFVF9LRVlfQ09NUExFVEU6CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkNTUiByb2FtU3RhdHVzID0gJXMgKCVkKSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgImVDU1JfUk9BTV9TRVRfS0VZX0NPTVBMRVRFIiwgcm9hbVN0YXR1cyk7CisgICAgICAgICAgICBpZiAocm9hbVJlc3VsdCA9PSBlQ1NSX1JPQU1fUkVTVUxUX0ZBSUxVUkUgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEZvcm1hdCB0aGUgU0VUIEtFWSBjb21wbGV0ZSBpbmZvcm1hdGlvbiBwYXNzIHRvIEhERC4uLiAqLworICAgICAgICAgICAgICAgIHNhcFNpZ25hbEhERGV2ZW50KHNhcENvbnRleHQsIHBDc3JSb2FtSW5mbywgZVNBUF9TVEFfU0VUX0tFWV9FVkVOVCwodl9QVk9JRF90KSBlU0FQX1NUQVRVU19GQUlMVVJFKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUNTUl9ST0FNX1JFTU9WRV9LRVlfQ09NUExFVEU6CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkNTUiByb2FtU3RhdHVzID0gJXMgKCVkKSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgImVDU1JfUk9BTV9SRU1PVkVfS0VZX0NPTVBMRVRFIiwgcm9hbVN0YXR1cyk7CisgICAgICAgICAgICBpZiAocm9hbVJlc3VsdCA9PSBlQ1NSX1JPQU1fUkVTVUxUX0ZBSUxVUkUgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEZvcm1hdCB0aGUgU0VUIEtFWSBjb21wbGV0ZSBpbmZvcm1hdGlvbiBwYXNzIHRvIEhERC4uLiAqLworICAgICAgICAgICAgICAgIHNhcFNpZ25hbEhERGV2ZW50KHNhcENvbnRleHQsIHBDc3JSb2FtSW5mbywgZVNBUF9TVEFfREVMX0tFWV9FVkVOVCwgKHZfUFZPSURfdCllU0FQX1NUQVRVU19GQUlMVVJFKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUNTUl9ST0FNX0FTU09DSUFUSU9OX0NPTVBMRVRJT046CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkNTUiByb2FtU3RhdHVzID0gJXMgKCVkKSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgImVDU1JfUk9BTV9BU1NPQ0lBVElPTl9DT01QTEVUSU9OIiwgcm9hbVN0YXR1cyk7CisgICAgICAgICAgICBpZiAocm9hbVJlc3VsdCA9PSBlQ1NSX1JPQU1fUkVTVUxUX0ZBSUxVUkUgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEZvcm1hdCB0aGUgU0VUIEtFWSBjb21wbGV0ZSBpbmZvcm1hdGlvbiBwYXNzIHRvIEhERC4uLiAqLworICAgICAgICAgICAgICAgIHNhcFNpZ25hbEhERGV2ZW50KHNhcENvbnRleHQsIHBDc3JSb2FtSW5mbywgZVNBUF9TVEFfUkVBU1NPQ19FVkVOVCwgKHZfUFZPSURfdCllU0FQX1NUQVRVU19GQUlMVVJFKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUNTUl9ST0FNX0RJU0FTU09DSUFURUQ6CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkNTUiByb2FtU3RhdHVzID0gJXMgKCVkKSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgImVDU1JfUk9BTV9ESVNBU1NPQ0lBVEVEIiwgcm9hbVN0YXR1cyk7CisgICAgICAgICAgICBpZiAocm9hbVJlc3VsdCA9PSBlQ1NSX1JPQU1fUkVTVUxUX01JQ19GQUlMVVJFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEZvcm1hdCB0aGUgTUlDIGZhaWx1cmUgZXZlbnQgdG8gcmV0dXJuLi4uICovCisgICAgICAgICAgICAgICAgc2FwU2lnbmFsSEREZXZlbnQoc2FwQ29udGV4dCwgcENzclJvYW1JbmZvLCBlU0FQX1NUQV9NSUNfRkFJTFVSRV9FVkVOVCwodl9QVk9JRF90KSBlU0FQX1NUQVRVU19GQUlMVVJFKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgIGNhc2UgZUNTUl9ST0FNX1dQU19QQkNfUFJPQkVfUkVRX0lORDoKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAgICBGTCgiQ1NSIHJvYW1TdGF0dXMgPSAlcyAoJWQpIiksCisgICAgICAgICAgICAgICAgICAgICAgICAiZUNTUl9ST0FNX1dQU19QQkNfUFJPQkVfUkVRX0lORCIsIHJvYW1TdGF0dXMpOworICAgICAgICAgICAgYnJlYWs7ICAgICAgICAKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fUkVNQUlOX0NIQU5fUkVBRFk6CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkNTUiByb2FtU3RhdHVzID0gJXMgKCVkKSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgImVDU1JfUk9BTV9SRU1BSU5fQ0hBTl9SRUFEWSIsIHJvYW1TdGF0dXMpOworICAgICAgICAgICAgc2FwU2lnbmFsSEREZXZlbnQoc2FwQ29udGV4dCwgcENzclJvYW1JbmZvLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTQVBfUkVNQUlOX0NIQU5fUkVBRFksIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZfUFZPSURfdCkgZVNBUF9TVEFUVVNfU1VDQ0VTUyk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fU0VORF9BQ1RJT05fQ05GOgorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJDU1Igcm9hbVN0YXR1cyA9ICVzICglZCkiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICJlQ1NSX1JPQU1fU0VORF9BQ1RJT05fQ05GIiwgcm9hbVN0YXR1cyk7CisgICAgICAgICAgICBzYXBTaWduYWxIRERldmVudChzYXBDb250ZXh0LCBwQ3NyUm9hbUluZm8sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTQVBfU0VORF9BQ1RJT05fQ05GLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAodl9QVk9JRF90KSgoZVNhcFN0YXR1cykoKHJvYW1SZXN1bHQgPT0gZUNTUl9ST0FNX1JFU1VMVF9OT05FKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZVNBUF9TVEFUVVNfU1VDQ0VTUyA6IGVTQVBfU1RBVFVTX0ZBSUxVUkUpKSk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgIGNhc2UgZUNTUl9ST0FNX0RJU0NPTk5FQ1RfQUxMX1AyUF9DTElFTlRTOgorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJDU1Igcm9hbVN0YXR1cyA9ICVzICglZCkiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICJlQ1NSX1JPQU1fRElTQ09OTkVDVF9BTExfUDJQX0NMSUVOVFMiLCByb2FtU3RhdHVzKTsKKyAgICAgICAgICAgIHNhcFNpZ25hbEhERGV2ZW50KHNhcENvbnRleHQsIHBDc3JSb2FtSW5mbywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNBUF9ESVNDT05ORUNUX0FMTF9QMlBfQ0xJRU5ULCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAodl9QVk9JRF90KSBlU0FQX1NUQVRVU19TVUNDRVNTICk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIAorICAgICAgIGNhc2UgZUNTUl9ST0FNX1NFTkRfUDJQX1NUT1BfQlNTOgorICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiUmVjZWl2ZWQgc3RvcGJzcyIpKTsKKyAgICAgICAgICAgc2FwU2lnbmFsSEREZXZlbnQoc2FwQ29udGV4dCwgcENzclJvYW1JbmZvLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU0FQX01BQ19UUklHX1NUT1BfQlNTX0VWRU5ULCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAodl9QVk9JRF90KSBlU0FQX1NUQVRVU19TVUNDRVNTICk7CisgICAgICAgIGJyZWFrOworCisjaWZkZWYgV0xBTl9GRUFUVVJFX0FQX0hUNDBfMjRHCisgICAgICAgIGNhc2UgZUNTUl9ST0FNXzIwNDBfQ09FWF9JTkZPX0lORDoKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAgICBGTCgiQ1NSIHJvYW1TdGF0dXMgPSAlcyAoJWQpIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiZUNTUl9ST0FNXzIwNDBfQ09FWF9JTkZPX0lORCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICByb2FtU3RhdHVzKTsKKworICAgICAgICAgICBzYXBDaGVja0hUMjA0MENvZXhBY3Rpb24oc2FwQ29udGV4dCwgcENzclJvYW1JbmZvLT5wU21lSFQyMDQwQ29leEluZm9JbmQpOworICAgICAgICAgICBicmVhazsKKyNlbmRpZgorCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkNTUiByb2FtU3RhdHVzIG5vdCBoYW5kbGVkIHJvYW1TdGF0dXMgPSAlcyAoJWQpIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0X2VSb2FtQ21kU3RhdHVzX3N0cihyb2FtU3RhdHVzKSwgcm9hbVN0YXR1cyk7CisgICAgICAgICAgICBicmVhazsKKyAgICB9CisKKworICAgIHN3aXRjaCAocm9hbVJlc3VsdCkKKyAgICB7CisgICAgICAgIGNhc2UgZUNTUl9ST0FNX1JFU1VMVF9JTkZSQV9BU1NPQ0lBVElPTl9JTkQ6CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCAiQ1NSIHJvYW1SZXN1bHQgPSAlcyAoJWQpIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJlQ1NSX1JPQU1fUkVTVUxUX0lORlJBX0FTU09DSUFUSU9OX0lORCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb2FtUmVzdWx0KTsKKyAgICAgICAgICAgIHNhcENvbnRleHQtPm5TdGFXUEFSU25SZXFJZUxlbmd0aCA9IHBDc3JSb2FtSW5mby0+cnNuSUVMZW47CisgICAgICAgICAgICAgCisgICAgICAgICAgICBpZihzYXBDb250ZXh0LT5uU3RhV1BBUlNuUmVxSWVMZW5ndGgpCisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCBzYXBDb250ZXh0LT5wU3RhV3BhUnNuUmVxSUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ3NyUm9hbUluZm8tPnByc25JRSwgc2FwQ29udGV4dC0+blN0YVdQQVJTblJlcUllTGVuZ3RoKTsKKworICAgICAgICAgICAgc2FwQ29udGV4dC0+blN0YUFkZEllTGVuZ3RoID0gcENzclJvYW1JbmZvLT5hZGRJRUxlbjsKKyAgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmKHNhcENvbnRleHQtPm5TdGFBZGRJZUxlbmd0aCkKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoIHNhcENvbnRleHQtPnBTdGFBZGRJRSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBDc3JSb2FtSW5mby0+cGFkZElFLCBzYXBDb250ZXh0LT5uU3RhQWRkSWVMZW5ndGgpOworCisgICAgICAgICAgICBzYXBDb250ZXh0LT5TYXBRb3NDZmcuV21tSXNFbmFibGVkID0gcENzclJvYW1JbmZvLT53bW1FbmFibGVkU3RhOworICAgICAgICAgICAgLy8gTUFDIGZpbHRlcmluZworICAgICAgICAgICAgdm9zU3RhdHVzID0gc2FwSXNQZWVyTWFjQWxsb3dlZChzYXBDb250ZXh0LCAodl9VOF90ICopcENzclJvYW1JbmZvLT5wZWVyTWFjKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKCBWT1NfU1RBVFVTX1NVQ0NFU1MgPT0gdm9zU3RhdHVzICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NTdGF0dXMgPSBzYXBTaWduYWxIRERldmVudCggc2FwQ29udGV4dCwgcENzclJvYW1JbmZvLCBlU0FQX1NUQV9BU1NPQ19JTkQsICh2X1BWT0lEX3QpZVNBUF9TVEFUVVNfU1VDQ0VTUyk7CisgICAgICAgICAgICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkNTUiByb2FtUmVzdWx0ID0gKCVkKSBNQUMgKCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJFU1NfU1RSIikgZmFpbCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb2FtUmVzdWx0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwQ3NyUm9hbUluZm8tPnBlZXJNYWMpKTsKKyAgICAgICAgICAgICAgICAgICAgaGFsU3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkNTUiByb2FtUmVzdWx0ID0gKCVkKSBNQUMgKCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJFU1NfU1RSIikgbm90IGFsbG93ZWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcm9hbVJlc3VsdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocENzclJvYW1JbmZvLT5wZWVyTWFjKSk7CisgICAgICAgICAgICAgICAgaGFsU3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIH0gCisKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUNTUl9ST0FNX1JFU1VMVF9JTkZSQV9BU1NPQ0lBVElPTl9DTkY6CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiQ1NSIHJvYW1SZXN1bHQgPSAlcyAoJWQpIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJlQ1NSX1JPQU1fUkVTVUxUX0lORlJBX0FTU09DSUFUSU9OX0NORiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb2FtUmVzdWx0KTsKKworICAgICAgICAgICAgc2FwQ29udGV4dC0+blN0YVdQQVJTblJlcUllTGVuZ3RoID0gcENzclJvYW1JbmZvLT5yc25JRUxlbjsKKyAgICAgICAgICAgIGlmIChzYXBDb250ZXh0LT5uU3RhV1BBUlNuUmVxSWVMZW5ndGgpCisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCBzYXBDb250ZXh0LT5wU3RhV3BhUnNuUmVxSUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ3NyUm9hbUluZm8tPnByc25JRSwgc2FwQ29udGV4dC0+blN0YVdQQVJTblJlcUllTGVuZ3RoKTsKKworICAgICAgICAgICAgc2FwQ29udGV4dC0+blN0YUFkZEllTGVuZ3RoID0gcENzclJvYW1JbmZvLT5hZGRJRUxlbjsKKyAgICAgICAgICAgIGlmKHNhcENvbnRleHQtPm5TdGFBZGRJZUxlbmd0aCkKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoIHNhcENvbnRleHQtPnBTdGFBZGRJRSwKKyAgICAgICAgICAgICAgICAgICAgcENzclJvYW1JbmZvLT5wYWRkSUUsIHNhcENvbnRleHQtPm5TdGFBZGRJZUxlbmd0aCk7CisKKyAgICAgICAgICAgIHNhcENvbnRleHQtPlNhcFFvc0NmZy5XbW1Jc0VuYWJsZWQgPSBwQ3NyUm9hbUluZm8tPndtbUVuYWJsZWRTdGE7CisgICAgICAgICAgICAvKiBGaWxsIGluIHRoZSBldmVudCBzdHJ1Y3R1cmUgKi8KKyAgICAgICAgICAgIHZvc1N0YXR1cyA9IHNhcFNpZ25hbEhERGV2ZW50KCBzYXBDb250ZXh0LCBwQ3NyUm9hbUluZm8sIGVTQVBfU1RBX0FTU09DX0VWRU5ULCAodl9QVk9JRF90KWVTQVBfU1RBVFVTX1NVQ0NFU1MpOworICAgICAgICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhhbFN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICB9CisjaWZkZWYgV0xBTl9GRUFUVVJFX0FQX0hUNDBfMjRHCisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHBDc3JSb2FtSW5mby0+SFQ0ME1IekludG9FbmFibGVkU3RhKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc2FwQWRkSFQ0MEludG9sZXJhbnRTdGEoc2FwQ29udGV4dCwgcENzclJvYW1JbmZvKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUNTUl9ST0FNX1JFU1VMVF9ESVNBU1NPQ19JTkQ6CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiQ1NSIHJvYW1SZXN1bHQgPSAlcyAoJWQpIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJlQ1NSX1JPQU1fUkVTVUxUX0RJU0FTU09DX0lORCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb2FtUmVzdWx0KTsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfQVBfSFQ0MF8yNEcKKyAgICAgICAgICAgIHNhcFJlbW92ZUhUNDBJbnRvbGVyYW50U3RhKHNhcENvbnRleHQsIHBDc3JSb2FtSW5mbyk7CisjZW5kaWYKKyAgICAgICAgICAgIC8qIEZpbGwgaW4gdGhlIGV2ZW50IHN0cnVjdHVyZSAqLworICAgICAgICAgICAgdm9zU3RhdHVzID0gc2FwU2lnbmFsSEREZXZlbnQoIHNhcENvbnRleHQsIHBDc3JSb2FtSW5mbywgZVNBUF9TVEFfRElTQVNTT0NfRVZFTlQsICh2X1BWT0lEX3QpZVNBUF9TVEFUVVNfU1VDQ0VTUyk7CisgICAgICAgICAgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGFsU3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUNTUl9ST0FNX1JFU1VMVF9ERUFVVEhfSU5EOgorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkNTUiByb2FtUmVzdWx0ID0gJXMgKCVkKSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZUNTUl9ST0FNX1JFU1VMVF9ERUFVVEhfSU5EIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvYW1SZXN1bHQpOworI2lmZGVmIFdMQU5fRkVBVFVSRV9BUF9IVDQwXzI0RworICAgICAgICAgICAgc2FwUmVtb3ZlSFQ0MEludG9sZXJhbnRTdGEoc2FwQ29udGV4dCwgcENzclJvYW1JbmZvKTsKKyNlbmRpZgorICAgICAgICAgICAgLyogRmlsbCBpbiB0aGUgZXZlbnQgc3RydWN0dXJlICovCisgICAgICAgICAgICAvL1RPRE86IHdlIHdpbGwgdXNlIHRoZSBzYW1lIGV2ZW50IGlub3JkZXIgdG8gaW5mb3JtIEhERCB0byBkaXNhc3NvY2lhdGUgdGhlIHN0YXRpb24KKyAgICAgICAgICAgIHZvc1N0YXR1cyA9IHNhcFNpZ25hbEhERGV2ZW50KCBzYXBDb250ZXh0LCBwQ3NyUm9hbUluZm8sIGVTQVBfU1RBX0RJU0FTU09DX0VWRU5ULCAodl9QVk9JRF90KWVTQVBfU1RBVFVTX1NVQ0NFU1MpOworICAgICAgICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhhbFN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVDU1JfUk9BTV9SRVNVTFRfTUlDX0VSUk9SX0dST1VQOgorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkNTUiByb2FtUmVzdWx0ID0gJXMgKCVkKSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZUNTUl9ST0FNX1JFU1VMVF9NSUNfRVJST1JfR1JPVVAiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm9hbVJlc3VsdCk7CisgICAgICAgICAgICAvKiBGaWxsIGluIHRoZSBldmVudCBzdHJ1Y3R1cmUgKi8KKyAgICAgICAgICAgIC8vVE9ETzogc3VwcG9ydCBmb3IgZ3JvdXAga2V5IE1JQyBmYWlsdXJlIGV2ZW50IHRvIGJlIGhhbmRsZWQKKyAgICAgICAgICAgIHZvc1N0YXR1cyA9IHNhcFNpZ25hbEhERGV2ZW50KCBzYXBDb250ZXh0LCBwQ3NyUm9hbUluZm8sIGVTQVBfU1RBX01JQ19GQUlMVVJFX0VWRU5ULCh2X1BWT0lEX3QpIE5VTEwpOworICAgICAgICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhhbFN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVDU1JfUk9BTV9SRVNVTFRfTUlDX0VSUk9SX1VOSUNBU1Q6IAorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkNTUiByb2FtUmVzdWx0ID0gJXMgKCVkKSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZUNTUl9ST0FNX1JFU1VMVF9NSUNfRVJST1JfVU5JQ0FTVCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb2FtUmVzdWx0KTsKKyAgICAgICAgICAgIC8qIEZpbGwgaW4gdGhlIGV2ZW50IHN0cnVjdHVyZSAqLworICAgICAgICAgICAgLy9UT0RPOiBzdXBwb3J0IGZvciB1bmljYXN0IGtleSBNSUMgZmFpbHVyZSBldmVudCB0byBiZSBoYW5kbGVkCisgICAgICAgICAgICB2b3NTdGF0dXMgPSBzYXBTaWduYWxIRERldmVudCggc2FwQ29udGV4dCwgcENzclJvYW1JbmZvLCBlU0FQX1NUQV9NSUNfRkFJTFVSRV9FVkVOVCwodl9QVk9JRF90KSBOVUxMKTsKKyAgICAgICAgICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zU3RhdHVzKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoYWxTdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fUkVTVUxUX0FVVEhFTlRJQ0FURUQ6CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiQ1NSIHJvYW1SZXN1bHQgPSAlcyAoJWQpIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJlQ1NSX1JPQU1fUkVTVUxUX0FVVEhFTlRJQ0FURUQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm9hbVJlc3VsdCk7CisgICAgICAgICAgICAvKiBGaWxsIGluIHRoZSBldmVudCBzdHJ1Y3R1cmUgKi8KKyAgICAgICAgICAgIHNhcFNpZ25hbEhERGV2ZW50KCBzYXBDb250ZXh0LCBwQ3NyUm9hbUluZm8sZVNBUF9TVEFfU0VUX0tFWV9FVkVOVCwgKHZfUFZPSURfdCllU0FQX1NUQVRVU19TVUNDRVNTKTsKKyAgICAgICAgICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zU3RhdHVzKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBoYWxTdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fUkVTVUxUX0FTU09DSUFURUQ6CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiQ1NSIHJvYW1SZXN1bHQgPSAlcyAoJWQpIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJlQ1NSX1JPQU1fUkVTVUxUX0FTU09DSUFURUQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm9hbVJlc3VsdCk7CisgICAgICAgICAgICAvKiBGaWxsIGluIHRoZSBldmVudCBzdHJ1Y3R1cmUgKi8KKyAgICAgICAgICAgIHNhcFNpZ25hbEhERGV2ZW50KCBzYXBDb250ZXh0LCBwQ3NyUm9hbUluZm8sZVNBUF9TVEFfUkVBU1NPQ19FVkVOVCwgKHZfUFZPSURfdCllU0FQX1NUQVRVU19TVUNDRVNTKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUNTUl9ST0FNX1JFU1VMVF9JTkZSQV9TVEFSVEVEOgorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkNTUiByb2FtUmVzdWx0ID0gJXMgKCVkKSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZUNTUl9ST0FNX1JFU1VMVF9JTkZSQV9TVEFSVEVEIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvYW1SZXN1bHQpOworICAgICAgICAgICAgLyogRmlsbCBpbiB0aGUgZXZlbnQgc3RydWN0dXJlICovIAorICAgICAgICAgICAgc2FwRXZlbnQuZXZlbnQgPSBlU0FQX01BQ19TVEFSVF9CU1NfU1VDQ0VTUzsKKyAgICAgICAgICAgIHNhcEV2ZW50LnBhcmFtcyA9IHBDc3JSb2FtSW5mbzsKKyAgICAgICAgICAgIHNhcEV2ZW50LnUxID0gcm9hbVN0YXR1czsKKyAgICAgICAgICAgIHNhcEV2ZW50LnUyID0gcm9hbVJlc3VsdDsKKworICAgICAgICAgICAgLyogSGFuZGxlIGV2ZW50ICovIAorICAgICAgICAgICAgdm9zU3RhdHVzID0gc2FwRnNtKHNhcENvbnRleHQsICZzYXBFdmVudCk7CisgICAgICAgICAgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGFsU3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUNTUl9ST0FNX1JFU1VMVF9JTkZSQV9TVE9QUEVEOgorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkNTUiByb2FtUmVzdWx0ID0gJXMgKCVkKSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZUNTUl9ST0FNX1JFU1VMVF9JTkZSQV9TVE9QUEVEIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvYW1SZXN1bHQpOworICAgICAgICAgICAgLyogRmlsbCBpbiB0aGUgZXZlbnQgc3RydWN0dXJlICovIAorICAgICAgICAgICAgc2FwRXZlbnQuZXZlbnQgPSBlU0FQX01BQ19SRUFEWV9GT1JfQ09OTkVDVElPTlM7CisgICAgICAgICAgICBzYXBFdmVudC5wYXJhbXMgPSBwQ3NyUm9hbUluZm87CisgICAgICAgICAgICBzYXBFdmVudC51MSA9IHJvYW1TdGF0dXM7CisgICAgICAgICAgICBzYXBFdmVudC51MiA9IHJvYW1SZXN1bHQ7CisKKyAgICAgICAgICAgIC8qIEhhbmRsZSBldmVudCAqLyAKKyAgICAgICAgICAgIHZvc1N0YXR1cyA9IHNhcEZzbShzYXBDb250ZXh0LCAmc2FwRXZlbnQpOworICAgICAgICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhhbFN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVDU1JfUk9BTV9SRVNVTFRfV1BTX1BCQ19QUk9CRV9SRVFfSU5EOgorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkNTUiByb2FtUmVzdWx0ID0gJXMgKCVkKSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZUNTUl9ST0FNX1JFU1VMVF9XUFNfUEJDX1BST0JFX1JFUV9JTkQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm9hbVJlc3VsdCk7CisgICAgICAgICAgICAvKiBGaWxsIGluIHRoZSBldmVudCBzdHJ1Y3R1cmUgKi8KKyAgICAgICAgICAgIC8vVE9ETzogc3VwcG9ydCBmb3IgZ3JvdXAga2V5IE1JQyBmYWlsdXJlIGV2ZW50IHRvIGJlIGhhbmRsZWQKKyAgICAgICAgICAgIHZvc1N0YXR1cyA9IHNhcFNpZ25hbEhERGV2ZW50KCBzYXBDb250ZXh0LCBwQ3NyUm9hbUluZm8sIGVTQVBfV1BTX1BCQ19QUk9CRV9SRVFfRVZFTlQsKHZfUFZPSURfdCkgTlVMTCk7CisgICAgICAgICAgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaGFsU3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUNTUl9ST0FNX1JFU1VMVF9GT1JDRUQ6CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiQ1NSIHJvYW1SZXN1bHQgPSAlcyAoJWQpIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJlQ1NSX1JPQU1fUkVTVUxUX0ZPUkNFRCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb2FtUmVzdWx0KTsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfQVBfSFQ0MF8yNEcKKyAgICAgICAgICAgIHNhcFJlbW92ZUhUNDBJbnRvbGVyYW50U3RhKHNhcENvbnRleHQsIHBDc3JSb2FtSW5mbyk7CisjZW5kaWYKKyAgICAgICAgICAgIC8vVGhpcyBldmVudCBjYW4gYmUgdXNlZCB0byBpbmZvcm0gaGRkIGFib3V0IHVzZXIgdHJpZ2dlcmVkIGRpc2Fzc29jIGV2ZW50CisgICAgICAgICAgICAvKiBGaWxsIGluIHRoZSBldmVudCBzdHJ1Y3R1cmUgKi8KKyAgICAgICAgICAgIHNhcFNpZ25hbEhERGV2ZW50KCBzYXBDb250ZXh0LCBwQ3NyUm9hbUluZm8sIGVTQVBfU1RBX0RJU0FTU09DX0VWRU5ULCAodl9QVk9JRF90KWVTQVBfU1RBVFVTX1NVQ0NFU1MpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fUkVTVUxUX05PTkU6CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiQ1NSIHJvYW1SZXN1bHQgPSAlcyAoJWQpIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJlQ1NSX1JPQU1fUkVTVUxUX05PTkUiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm9hbVJlc3VsdCk7CisgICAgICAgICAgICAvL1RoaXMgZXZlbnQgY2FuIGJlIHVzZWQgdG8gaW5mb3JtIGhkZCBhYm91dCB1c2VyIHRyaWdnZXJlZCBkaXNhc3NvYyBldmVudAorICAgICAgICAgICAgLyogRmlsbCBpbiB0aGUgZXZlbnQgc3RydWN0dXJlICovCisgICAgICAgICAgICBpZiAoIHJvYW1TdGF0dXMgPT0gZUNTUl9ST0FNX1NFVF9LRVlfQ09NUExFVEUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2FwU2lnbmFsSEREZXZlbnQoIHNhcENvbnRleHQsIHBDc3JSb2FtSW5mbyxlU0FQX1NUQV9TRVRfS0VZX0VWRU5ULCh2X1BWT0lEX3QpIGVTQVBfU1RBVFVTX1NVQ0NFU1MpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAocm9hbVN0YXR1cyA9PSBlQ1NSX1JPQU1fUkVNT1ZFX0tFWV9DT01QTEVURSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2FwU2lnbmFsSEREZXZlbnQoIHNhcENvbnRleHQsIHBDc3JSb2FtSW5mbyxlU0FQX1NUQV9ERUxfS0VZX0VWRU5ULCh2X1BWT0lEX3QpIGVTQVBfU1RBVFVTX1NVQ0NFU1MpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlQ1NSX1JPQU1fUkVTVUxUX01BWF9BU1NPQ19FWENFRURFRDoKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJDU1Igcm9hbVJlc3VsdCA9ICVzICglZCkiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImVDU1JfUk9BTV9SRVNVTFRfTUFYX0FTU09DX0VYQ0VFREVEIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvYW1SZXN1bHQpOworICAgICAgICAgICAgLyogRmlsbCBpbiB0aGUgZXZlbnQgc3RydWN0dXJlICovCisgICAgICAgICAgICB2b3NTdGF0dXMgPSBzYXBTaWduYWxIRERldmVudChzYXBDb250ZXh0LCBwQ3NyUm9hbUluZm8sIGVTQVBfTUFYX0FTU09DX0VYQ0VFREVELCAodl9QVk9JRF90KU5VTEwpOworICAgICAgICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGhhbFN0YXR1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AorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgIHMgYSBwIEMgaCBTIGUgbCBlIGMgdCAuIEMKKyAgT1ZFUlZJRVc6CisKKyAgVGhpcyBzb2Z0d2FyZSB1bml0IGhvbGRzIHRoZSBpbXBsZW1lbnRhdGlvbiBvZiB0aGUgV0xBTiBTQVAgbW9kdWxlcworICBmdW5jdGlvbnMgZm9yIGNoYW5uZWwgc2VsZWN0aW9uLgorCisgIERFUEVOREVOQ0lFUzoKKworICBBcmUgbGlzdGVkIGZvciBlYWNoIEFQSSBiZWxvdy4KKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICBFRElUIEhJU1RPUlkgRk9SIEZJTEUKKworCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLgorICBOb3RpY2UgdGhhdCBjaGFuZ2VzIGFyZSBsaXN0ZWQgaW4gcmV2ZXJzZSBjaHJvbm9sb2dpY2FsIG9yZGVyLgorCisKKworICB3aGVuICAgICAgICB3aG8gICAgICAgd2hhdCwgd2hlcmUsIHdoeQorLS0tLS0tLS0tLSAgICAtLS0gICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKzIwMTAtMDMtMTUgIFNPRlRBUCAgICAgIENyZWF0ZWQgbW9kdWxlCisKKz09PT09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ZWZpbmUgSVNfUlNTSV9WQUxJRCggZXh0UnNzaSwgcnNzaSApIFwKKyggXAorICAgKChleHRSc3NpIDwgcnNzaSk/ZUFOSV9CT09MRUFOX1RSVUU6ZUFOSV9CT09MRUFOX0ZBTFNFKSBcCispCisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fQ0hfQVZPSUQKK2V4dGVybiBzYWZlQ2hhbm5lbFR5cGUgc2FmZUNoYW5uZWxzW107CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0NIX0FWT0lEICovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgc2FwQ2xlYW51cENoYW5uZWxMaXN0CisKKyAgREVTQ1JJUFRJT04gCisgICAgRnVuY3Rpb24gc2FwQ2xlYW51cENoYW5uZWxMaXN0IGZyZWVzIHVwIHRoZSBtZW1vcnkgYWxsb2NhdGVkIHRvIHRoZSBjaGFubmVsIGxpc3QuCisKKyAgREVQRU5ERU5DSUVTIAorICAgIE5BLiAKKworICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICBOVUxMCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgTlVMTAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKK3ZvaWQgc2FwQ2xlYW51cENoYW5uZWxMaXN0KHZvaWQpCit7CisgICAgdl9QVk9JRF90IHB2b3NHQ3R4ID0gdm9zX2dldF9nbG9iYWxfY29udGV4dChWT1NfTU9EVUxFX0lEX1NBUCwgTlVMTCk7CisgICAgcHRTYXBDb250ZXh0IHBTYXBDdHg7CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgCisgICAgICAgICAgICAgICAiQ2xlYW5pbmcgdXAgdGhlIGNoYW5uZWwgbGlzdCBzdHJ1Y3R1cmUiKTsKKworICAgIGlmIChOVUxMID09IHB2b3NHQ3R4KQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICJTQVAgR2xvYmFsIENvbnRleHQgaXMgTlVMTCIpOworICAgICAgICByZXR1cm4gOworICAgIH0KKworICAgIHBTYXBDdHggPSBWT1NfR0VUX1NBUF9DQihwdm9zR0N0eCk7CisgICAgaWYgKE5VTEwgPT0gcFNhcEN0eCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAiU0FQIENvbnRleHQgaXMgTlVMTCIpOworICAgICAgICByZXR1cm4gOworICAgIH0KKworICAgIHBTYXBDdHgtPlNhcENobmxMaXN0Lm51bUNoYW5uZWwgPSAwOworICAgIHZvc19tZW1fZnJlZShwU2FwQ3R4LT5TYXBDaG5sTGlzdC5jaGFubmVsTGlzdCk7CisgICAgcFNhcEN0eC0+U2FwQ2hubExpc3QuY2hhbm5lbExpc3QgPSBOVUxMOworfQorCit0eXBlZGVmIHN0cnVjdAoreworICAgIHZfVTE2X3QgY2hTdGFydE51bTsKKyAgICB2X1UzMl90IHdlaWdodDsKK30gc2FwQWNzQ2hhbm5lbEluZm87CisKKyNkZWZpbmUgQUNTX1dFSUdIVF9NQVggICAgIDQ0NDQKKworc2FwQWNzQ2hhbm5lbEluZm8gYWNzSFQ0MENoYW5uZWxzNUdbIF0gPSB7CisgICAgezM2LCAgIEFDU19XRUlHSFRfTUFYfSwKKyAgICB7NDQsICAgQUNTX1dFSUdIVF9NQVh9LAorICAgIHs1MiwgICBBQ1NfV0VJR0hUX01BWH0sCisgICAgezYwLCAgIEFDU19XRUlHSFRfTUFYfSwKKyAgICB7M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PT09PT09PT09CisgIEZVTkNUSU9OICAgIHNhcFNldFByZWZlcnJlZENoYW5uZWwKKworICBERVNDUklQVElPTiAKKyAgICBGdW5jdGlvbiBzYXBTZXRQcmVmZXJyZWRDaGFubmVsIHNldHMgdGhlIGNoYW5uZWwgbGlzdCB3aGljaCBoYXMgYmVlbiBjb25maWd1cmVkCisgICAgaW50byBzYXAgY29udGV4dCAocFNhcEN0eCkgd2hpY2ggd2lsbCBiZSB1c2VkIGF0IHRoZSB0aW1lIG9mIGJlc3QgY2hhbm5lbCBzZWxlY3Rpb24uIAorCisgIERFUEVOREVOQ0lFUyAKKyAgICBOQS4gCisKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgKnB0cjogcG9pbnRlciBoYXZpbmcgdGhlIGNvbW1hbmQgZm9sbG93ZWQgYnkgdGhlIGFyZ3VtZW50cyBpbiBzdHJpbmcgZm9ybWF0CisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgaW50OiAgcmV0dXJuIDAgd2hlbiBzdWNjZXNzIGVsc2UgcmV0dXJucyBlcnJvciBjb2RlLgorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKK2ludCBzYXBTZXRQcmVmZXJyZWRDaGFubmVsKHRBTklfVTgqIHB0cikKK3sKKworICAgIHZfUFZPSURfdCBwdm9zR0N0eCA9IHZvc19nZXRfZ2xvYmFsX2NvbnRleHQoVk9TX01PRFVMRV9JRF9TQVAsIE5VTEwpOworICAgIHB0U2FwQ29udGV4dCBwU2FwQ3R4OworICAgIHRBTklfVTgqIHBhcmFtOworICAgIGludCB0ZW1wSW50OworICAgIGludCBqOworCisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgCisgICAgICAgICAgICAgICAiRW50ZXI6ICVzIiwgX19mdW5jX18pOworCisgICAgaWYgKE5V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tPlNhcENobmxMaXN0LmNoYW5uZWxMaXN0ID0gKHZfVThfdCAqKXZvc19tZW1fbWFsbG9jKHRlbXBJbnQpOworCisgICAgaWYgKE5VTEwgPT0gIHBTYXBDdHgtPlNhcENobmxMaXN0LmNoYW5uZWxMaXN0KQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICJJbiAlcywgVk9TX01BTExPQ19FUlIiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgIH0KKworICAgIHBTYXBDdHgtPlNhcENobmxMaXN0Lm51bUNoYW5uZWwgPSB0ZW1wSW50OworICAgIGZvcihqPTA7ajxwU2FwQ3R4LT5TYXBDaG5sTGlzdC5udW1DaGFubmVsO2orKykKKyAgICB7CisKKyAgICAgICAgLypwYXJhbSBwb2ludGluZyB0byB0aGUgYmVnaW5uaW5nIG9mIGZpcnN0IHNwYWNlIGFmdGVyIG51bWJlciBvZiBjaGFubmVscyovCisgICAgICAgIHBhcmFtID0gc3RycGJyayggcGFyYW0sICIgIiApOyAKKyAgICAgICAgLypubyBjaGFubmVsIGxpc3QgYWZ0ZXIgdGhlIG51bWJlciBvZiBjaGFubmVscyBhcmd1bWVudCovCisgICAgICAgIGlmIChOVUxMID09IHBhcmFtKQorICAgICAgICB7CisgICAgICAgICAgICBzYXBDbGVhbnVwQ2hhbm5lbExpc3QoKTsKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICB9CisKKyAgICAgICAgcGFyYW0rKzsKKworICAgICAgICAvKnJlbW92aW5nIGVtcHR5IHNwYWNlKi8KKyAgICAgICAgd2hpbGUoKFNQQUNFX0FTQ0lJX1ZBTFVFID09ICpwYXJhbSkgJiYgKCdcMCcgIT0gKnBhcmFtKSApIHBhcmFtKys7CisKKyAgICAgICAgLypubyBjaGFubmVsIGxpc3QgYWZ0ZXIgdGhlIG51bWJlciBvZiBjaGFubmVscyBhcmd1bWVudCBhbmQgc3BhY2VzKi8KKyAgICAgICAgaWYoICdcMCcgPT0gKnBhcmFtICkKKyAgICAgICAgeworICAgICAgICAgICAgc2FwQ2xlYW51cENoYW5uZWxMaXN0KCk7CisgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChzc2NhbmYocGFyYW0sICIlZCAiLCAmdGVtcEludCkgIT0gMSkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IENhbm5vdCByZWFkIGNoYW5uZWwgbnVtYmVyIiwgX19mdW5jX18pOworICAgICAgICAgICAgc2FwQ2xlYW51cENoYW5uZWxMaXN0KCk7CisgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgfQorICAgICAgICBpZiAodGVtcEludCA8IDAgfHwgdGVtcEludCA+IDI1NSkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgY2hhbm5lbCBudW1iZXIgcmVjZWl2ZWQiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICBzYXBDbGVhbnVwQ2hhbm5lbExpc3QoKTsKKyAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOworICAgICAgICB9CisKKyAgICAgICAgcFNhcEN0eC0+U2FwQ2hubExpc3QuY2hhbm5lbExpc3Rbal0gPSB0ZW1wSW50OworCisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsIAorICAgICAgICAgICAgICAgICAgICIlczogQ2hhbm5lbCAlZCBhZGRlZCB0byBwcmVmZXJyZWQgY2hhbm5lbCBsaXN0IiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcFNhcEN0eC0+U2FwQ2hubExpc3QuY2hhbm5lbExpc3Rbal0gKTsKKworICAgIH0KKworICAgIC8qZXh0cmEgYXJndW1lbnRzIGNoZWNrKi8KKyAgICBwYXJhbSA9IHN0cnBicmsoIHBhcmFtLCAiICIgKTsKKyAgICBpZiAoTlVMTCAhPSBwYXJhbSkKKyAgICB7CisgICAgICAgIHdoaWxlKChTUEFDRV9BU0NJSV9WQUxVRSA9PSAqcGFyYW0pICYmICgnXDAnICE9ICpwYXJhbSkgKSBwYXJhbSsrOworCisgICAgICAgIGlmKCdcMCcgIT0gICpwYXJhbSkKKyAgICAgICAgeworICAgICAgICAgICAgc2FwQ2xlYW51cENoYW5uZWxMaXN0KCk7CisgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgfQorICAgIH0KKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsIAorICAgICAgICAgICAgICAgIkV4aXQ6ICVzIiwgX19mdW5jX18pOworCisgICAgcmV0dXJuIDA7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgc2FwU2VsZWN0UHJlZmVycmVkQ2hhbm5lbEZyb21DaGFubmVsTGlzdAorCisgIERFU0NSSVBUSU9OIAorICAgIEZ1bmN0aW9uIHNhcFNlbGVjdFByZWZlcnJlZENoYW5uZWxGcm9tQ2hhbm5lbExpc3QgY2FsY3VsYXRlcyB0aGUgYmVzdCBjaGFubmVsCisgICAgYW1vbmcgdGhlIGNvbmZpZ3VyZWQgY2hhbm5lbCBsaXN0LiBJZiBjaGFubmVsIGxpc3Qgbm90IGNvbmZpZ3VyZWQgdGhlbiByZXR1cm5zIAorICAgIHRoZSBiZXN0IGNoYW5uZWwgY2FsY3VsYXRlZCBhbW9uZyBhbGwgdGhlIGNoYW5uZWwgbGlzdC4KKworICBERVBFTkRFTkNJRVMgCisgICAgTkEuIAorCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgICpwU3BlY3RJbmZvUGFyYW1zICA6IFBvaW50ZXIgdG8gdFNhcENoU2VsU3BlY3RJbmZvIHN0cnVjdHVyZQorICAgIGJlc3RDaE51bTogYmVzdCBjaGFubmVsIGFscmVhZHkgY2FsY3VsYXRlZCBhbW9uZyBhbGwgdGhlIGNoYW5lbHMKKyAgICBwU2FwQ3R4OiBoYXZpbmcgaW5mbyBvZiBjaGFubmVsIGxpc3QgZnJvbSB3aGljaCBiZXN0IGNoYW5uZWwgaXMgc2VsZWN0ZWQgCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgdl9VOF90OiAgYmVzdCBjaGFubmVsCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZfVThfdCBzYXBTZWxlY3RQcmVmZXJyZWRDaGFubmVsRnJvbUNoYW5uZWxMaXN0KHZfVThfdCBiZXN0Q2hOdW0sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRTYXBDb250ZXh0IHBTYXBDdHgsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNhcENoU2VsU3BlY3RJbmZvICpwU3BlY3RJbmZvUGFyYW1zKQoreworICAgIHZfVThfdCBqID0gMDsKKyAgICB2X1U4X3QgY291bnQgPSAwOworCisgICAgLy9JZiBDaGFubmVsIExpc3QgaXMgbm90IENvbmZpZ3VyZWQgZG9uJ3QgZG8gYW55dGhpbmcKKyAgICAvL0Vsc2UgcmV0dXJuIHRoZSBCZXN0IENoYW5uZWwgZnJvbSB0aGUgQ2hhbm5lbCBMaXN0CisgICAgaWYoKE5VTEwgPT0gcFNhcEN0eC0+U2FwQ2hubExpc3QuY2hhbm5lbExpc3QpIHx8IAorICAgICAgIChOVUxMID09IHBTcGVjdEluZm9QYXJhbXMpIHx8IAorICAgICAgICgwID09IHBTYXBDdHgtPlNhcENobmxMaXN0Lm51bUNoYW5uZWwpKQorICAgIHsKKyAgICAgICAgcmV0dXJuIGJlc3RDaE51bTsKKyAgICB9CisKKyAgICBpZiAoYmVzdENoTnVtID4gMCAmJiBiZXN0Q2hOdW0gPD0gMjUyKQorICAgIHsKKyAgICAgICAgZm9yKGNvdW50PTA7IGNvdW50IDwgcFNwZWN0SW5mb1BhcmFtcy0+bnVtU3BlY3RDaGFucyA7IGNvdW50KyspCisgICAgICAgIHsKKyAgICAgICAgICAgIGJlc3RDaE51bSA9ICh2X1U4X3QpcFNwZWN0SW5mb1BhcmFtcy0+cFNwZWN0Q2hbY291bnRdLmNoTnVtOworICAgICAgICAgICAgLy8gU2VsZWN0IHRoZSBiZXN0IGNoYW5uZWwgZnJvbSBhbGxvd2VkIGxpc3QKKyAgICAgICAgICAgIGZvcihqPTA7ajwgcFNhcEN0eC0+U2FwQ2hubExpc3QubnVtQ2hhbm5lbDtqKyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoIChwU2FwQ3R4LT5TYXBDaG5sTGlzdC5jaGFubmVsTGlzdFtqXSkgPT0gYmVzdENoTnVtKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkJlc3QgY2hhbm5lbCBjb21wdXRlZCBmcm9tIENoYW5uZWwgTGlzdCBpczogJWQiLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiZXN0Q2hOdW0pOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gYmVzdENoTnVtOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBTQVBfQ0hBTk5FTF9OT1RfU0VMRUNURUQ7CisgICAgfQorICAgIGVsc2UKKyAgICAgICAgcmV0dXJuIFNBUF9DSEFOTkVMX05PVF9TRUxFQ1RFRDsKK30KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIHNhcENoYW5TZWxJbml0CisKKyAgREVTQ1JJUFRJT04gCisgICAgRnVuY3Rpb24gc2FwQ2hhblNlbEluaXQgYWxsb2NhdGVzIHRoZSBtZW1vcnksIGludGlhbGl6ZXMgdGhlCisgICAgICAgICBzdHJ1Y3R1cmVzIHVzZWQgYnkgdGhlIGNoYW5uZWwgc2VsZWN0aW9uIGFsZ29yaXRobQorCisgIERFUEVOREVOQ0lFUyAKKyAgICBOQS4gCisKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgKnBTcGVjdEluZm9QYXJhbXMgIDogUG9pbnRlciB0byB0U2FwQ2hTZWxTcGVjdEluZm8gc3RydWN0dXJlCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgdl9CT09MX3Q6ICBTdWNjZXNzIG9yIEZBSUwKKyAgCisgIFNJREUgRUZGRUNUUyAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordl9CT09MX3Qgc2FwQ2hhblNlbEluaXQodEhhbEhhbmRsZSBoYWxIYW5kbGUsIHRTYXBDaFNlbFNwZWN0SW5mbyAqcFNwZWN0SW5mb1BhcmFtcykKK3sKKyAgICB0U2FwU3BlY3RDaEluZm8gKnBTcGVjdENoID0gTlVMTDsKKyAgICB2X1U4X3QgKnBDaGF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AgICAgICAgY2hTYWZlID0gVk9TX0ZBTFNFOworICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fQ0hfQVZPSUQgKi8KKworICAgICAgICBpZigqcENoYW5zID09IDE0ICkgLy9PRkRNIHJhdGVzIGFyZSBub3Qgc3VwcG9ydGVkIG9uIGNoYW5uZWwgMTQKKyAgICAgICAgeworICAgICAgICAgICAgcENoYW5zKys7CisgICAgICAgICAgICBwU3BlY3RDaCsrOworICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKyNpZmRlZiBGRUFUVVJFX1dMQU5fQ0hfQVZPSUQKKyAgICAgICAgaWYgKFZPU19UUlVFID09IGNoU2FmZSkKKyAgICAgICAgeworI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9DSF9BVk9JRCAqLworICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9ERUJVRywKKyAgICAgICAgICAgICAgICAgICAgICIlcyA6IEF2YWlsYWJsZSBDaCAlZCIsCisgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgKnBDaGFucyk7CisgICAgICAgICAgIHBTcGVjdENoLT5jaE51bSA9ICpwQ2hhbnM7CisgICAgICAgICAgIHBTcGVjdENoLT52YWxpZCA9IGVTQVBfVFJVRTsKKyAgICAgICAgICAgLy8gSW5pdGlhbGlzZSBmb3IgYWxsIGNoYW5uZWxzCisgICAgICAgICAgIHBTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAvLyBJbml0aWFsaXNlIDIwTUh6IGZvciBhbGwgdGhlIENoYW5uZWxzCisgICAgICAgICAgIHBTcGVjdENoLT5jaGFubmVsV2lkdGggPSBTT0ZUQVBfSFQyMF9DSEFOTkVMV0lEVEg7CisjaWZkZWYgRkVBVFVSRV9XTEFOX0NIX0FWT0lECisgICAgICAgIH0KKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fQ0hfQVZPSUQgKi8KKyAgICAgICAgcFNwZWN0Q2grKzsKKyAgICAgICAgcENoYW5zKys7CisgICAgfQorICAgIHJldHVybiBlU0FQX1RSVUU7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgc2Fwd2VpZ2h0UnNzaUNvdW50CisKKyAgREVTQ1JJUFRJT04gCisgICAgRnVuY3Rpb24gd2VpZ2h0UnNzaUNvdW50IGNhbGN1bGF0ZXMgdGhlIGNoYW5uZWwgd2VpZ2h0IGR1ZSB0byByc3NpCisgICAgICAgICBhbmQgZGF0YSBjb3VudChoZXJlIG51bWJlciBvZiBCU1Mgb2JzZXJ2ZWQpCisgICAgICAgICAKKyAgREVQRU5ERU5DSUVTIAorICAgIE5BLiAKKworICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICByc3NpICAgICAgICA6IE1heCBzaWduYWwgc3RyZW5ndGggcmVjZWlldmVkIGZyb20gYSBCU1MgZm9yIHRoZSBjaGFubmVsCisgICAgY291bnQgICAgICAgOiBOdW1iZXIgb2YgQlNTIG9ic2VydmVkIGluIHRoZSBjaGFubmVsCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgdl9VMzJfdCAgICAgOiBDYWxjdWxhdGVkIGNoYW5uZWwgd2VpZ2h0IGJhc2VkIG9uIGFib3ZlIHR3bworICAKKyAgU0lERSBFRkZFQ1RTIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2X1UzMl90IHNhcHdlaWdodFJzc2lDb3VudCh2X1M3X3QgcnNzaSwgdl9VMTZfdCBjb3VudCkKK3sKKyAgICB2X1MzMV90ICAgICByc3NpV2VpZ2h0PTA7CisgICAgdl9TMzF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c2ljb3VudFdlaWdodCk7CisgICAgCisgICAgcmV0dXJuKHJzc2ljb3VudFdlaWdodCk7Cit9CisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBzYXBJbnRlcmZlcmVuY2VSc3NpQ291bnQKKworICBERVNDUklQVElPTgorICAgIEZ1bmN0aW9uIHNhcEludGVyZmVyZW5jZVJzc2lDb3VudCBDb25zaWRlcnMgdGhlIEFkamFjZW50IGNoYW5uZWwgcnNzaQorICAgIGFuZCBkYXRhIGNvdW50KGhlcmUgbnVtYmVyIG9mIEJTUyBvYnNlcnZlZCkKKworICBERVBFTkRFTkNJRVMKKyAgICBOQS4KKworICBQQVJBTUVURVJTCisKKyAgICBwU3BlY3RDaCAgICA6IENoYW5uZWwgSW5mb3JtYXRpb24KKworICBSRVRVUk4gVkFMVUUKKyAgICBOQS4KKworICBTSURFIEVGRkVDVFMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBzYXBJbnRlcmZlcmVuY2VSc3NpQ291bnQodFNhcFNwZWN0Q2hJbmZvICpwU3BlY3RDaCkKK3sKKyAgICB0U2FwU3BlY3RDaEluZm8gKnBFeHRTcGVjdENoID0gTlVMTDsKKyAgICB2X1MzMV90IHJzc2k7CisKKyAgICBpZiAoTlVMTCA9PSBwU3BlY3RDaCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiJXM6IHBTcGVjdENoIGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBzd2l0Y2gocFNwZWN0Q2gtPmNoTnVtKQorICAgIHsKKyAgICAgICAgY2FzZSBDSEFOTkVMXzE6CisgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCArIDEpOworICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsKKyAgICAgICAgICAgICAgICAgICAgICAgU0FQXzI0R0haX0ZJUlNUX09WRVJMQVBfQ0hBTl9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgIGlmIChJU19SU1NJX1ZBTElEKHBFeHRTcGVjdENoLT5yc3NpQWdyLCByc3NpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gcnNzaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoICsgMik7CisgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2ggIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICArK3BFeHRTcGVjdENoLT5ic3NDb3VudDsKKyAgICAgICAgICAgICAgICByc3NpID0gcFNwZWN0Q2gtPnJzc2lBZ3IgKworICAgICAgICAgICAgICAgICAgICAgICBTQVBfMjRHSFpfU0VDX09WRVJMQVBfQ0hBTl9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgIGlmIChJU19SU1NJX1ZBTElEKHBFeHRTcGVjdENoLT5yc3NpQWdyLCByc3NpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gcnNzaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYocEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPCBTT0ZUQVBfTUlOX1JTU0kpCisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcEV4dFNwZWN0Q2ggPSAocFNwZWN0Q2ggKyAzKTsKKyAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaCAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArCisgICAgICAgICAgICAgICAgICAgICAgIFNBUF8yNEdIWl9USElSRF9PVkVSTEFQX0NIQU5fUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoICsgNCk7CisgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2ggIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICArK3BFeHRTcGVjdENoLT5ic3NDb3VudDsKKyAgICAgICAgICAgICAgICByc3NpID0gcFNwZWN0Q2gtPnJzc2lBZ3IgKworICAgICAgICAgICAgICAgICAgICAgICBTQVBfMjRHSFpfRk9VUlRIX09WRVJMQVBfQ0hBTl9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgIGlmIChJU19SU1NJX1ZBTElEKHBFeHRTcGVjdENoLT5yc3NpQWdyLCByc3NpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gcnNzaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBDSEFOTkVMXzI6CisgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCAtIDEpOworICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsKKyAgICAgICAgICAgICAgICAgICAgICAgU0FQXzI0R0haX0ZJUlNUX09WRVJMQVBfQ0hBTl9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgIGlmIChJU19SU1NJX1ZBTElEKHBFeHRTcGVjdENoLT5yc3NpQWdyLCByc3NpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gcnNzaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoICsgMSk7CisgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2ggIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICArK3BFeHRTcGVjdENoLT5ic3NDb3VudDsKKyAgICAgICAgICAgICAgICByc3NpID0gcFNwZWN0Q2gtPnJzc2lBZ3IgKworICAgICAgICAgICAgICAgICAgICAgICBTQVBfMjRHSFpfRklSU1RfT1ZFUkxBUF9DSEFOX1JTU0lfRUZGRUNUX1BSSU1BUlk7CisgICAgICAgICAgICAgICAgaWYgKElTX1JTU0lfVkFMSUQocEV4dFNwZWN0Q2gtPnJzc2lBZ3IsIHJzc2kpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSByc3NpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPCBTT0ZUQVBfTUlOX1JTU0kpCisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcEV4dFNwZWN0Q2ggPSAocFNwZWN0Q2ggKyAyKTsKKyAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaCAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArCisgICAgICAgICAgICAgICAgICAgICAgIFNBUF8yNEdIWl9TRUNfT1ZFUkxBUF9DSEFOX1JTU0lfRUZGRUNUX1BSSU1BUlk7CisgICAgICAgICAgICAgICAgaWYgKElTX1JTU0lfVkFMSUQocEV4dFNwZWN0Q2gtPnJzc2lBZ3IsIHJzc2kpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSByc3NpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPCBTT0ZUQVBfTUlOX1JTU0kpCisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcEV4dFNwZWN0Q2ggPSAocFNwZWN0Q2ggKyAzKTsKKyAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaCAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArCisgICAgICAgICAgICAgICAgICAgICAgIFNBUF8yNEdIWl9USElSRF9PVkVSTEFQX0NIQU5fUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCArIDQpOworICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsKKyAgICAgICAgICAgICAgICAgICAgICAgU0FQXzI0R0haX1RISVJEX09WRVJMQVBfQ0hBTl9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgIGlmIChJU19SU1NJX1ZBTElEKHBFeHRTcGVjdENoLT5yc3NpQWdyLCByc3NpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gcnNzaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIENIQU5ORUxfMzoKKyAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoIC0gMik7CisgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2ggIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICArK3BFeHRTcGVjdENoLT5ic3NDb3VudDsKKyAgICAgICAgICAgICAgICByc3NpID0gcFNwZWN0Q2gtPnJzc2lBZ3IgKworICAgICAgICAgICAgICAgICAgICAgICBTQVBfMjRHSFpfU0VDX09WRVJMQVBfQ0hBTl9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgIGlmIChJU19SU1NJX1ZBTElEKHBFeHRTcGVjdENoLT5yc3NpQWdyLCByc3NpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gcnNzaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoIC0gMSk7CisgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2ggIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICArK3BFeHRTcGVjdENoLT5ic3NDb3VudDsKKyAgICAgICAgICAgICAgICByc3NpID0gcFNwZWN0Q2gtPnJzc2lBZ3IgKworICAgICAgICAgICAgICAgICAgICAgICBTQVBfMjRHSFpfRklSU1RfT1ZFUkxBUF9DSEFOX1JTU0lfRUZGRUNUX1BSSU1BUlk7CisgICAgICAgICAgICAgICAgaWYgKElTX1JTU0lfVkFMSUQocEV4dFNwZWN0Q2gtPnJzc2lBZ3IsIHJzc2kpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSByc3NpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPCBTT0ZUQVBfTUlOX1JTU0kpCisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcEV4dFNwZWN0Q2ggPSAocFNwZWN0Q2ggKyAxKTsKKyAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaCAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArCisgICAgICAgICAgICAgICAgICAgICAgIFNBUF8yNEdIWl9GSVJTVF9PVkVSTEFQX0NIQU5fUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCArIDIpOworICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsKKyAgICAgICAgICAgICAgICAgICAgICAgU0FQXzI0R0haX1NFQ19PVkVSTEFQX0NIQU5fUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCArIDMpOworICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsKKyAgICAgICAgICAgICAgICAgICAgICAgU0FQXzI0R0haX1RISVJEX09WRVJMQVBfQ0hBTl9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgIGlmIChJU19SU1NJX1ZBTElEKHBFeHRTcGVjdENoLT5yc3NpQWdyLCByc3NpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gcnNzaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoICsgNCk7CisgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2ggIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICArK3BFeHRTcGVjdENoLT5ic3NDb3VudDsKKyAgICAgICAgICAgICAgICByc3NpID0gcFNwZWN0Q2gtPnJzc2lBZ3IgKworICAgICAgICAgICAgICAgICAgICAgICBTQVBfMjRHSFpfRk9VUlRIX09WRVJMQVBfQ0hBTl9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgIGlmIChJU19SU1NJX1ZBTElEKHBFeHRTcGVjdENoLT5yc3NpQWdyLCByc3NpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gcnNzaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIENIQU5ORUxfNDoKKyAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoIC0gMyk7CisgICAgICAgICAgICBpZihwRXh0U3BlY3RDaCAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArCisgICAgICAgICAgICAgICAgICAgICAgIFNBUF8yNEdIWl9USElSRF9PVkVSTEFQX0NIQU5fUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCAtIDIpOworICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsKKyAgICAgICAgICAgICAgICAgICAgICAgU0FQXzI0R0haX1NFQ19PVkVSTEFQX0NIQU5fUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCAtIDEpOworICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsKKyAgICAgICAgICAgICAgICAgICAgICAgU0FQXzI0R0haX0ZJUlNUX09WRVJMQVBfQ0hBTl9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgIGlmIChJU19SU1NJX1ZBTElEKHBFeHRTcGVjdENoLT5yc3NpQWdyLCByc3NpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gcnNzaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYocEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPCBTT0ZUQVBfTUlOX1JTU0kpCisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcEV4dFNwZWN0Q2ggPSAocFNwZWN0Q2ggKyAxKTsKKyAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaCAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArCisgICAgICAgICAgICAgICAgICAgICAgIFNBUF8yNEdIWl9GSVJTVF9PVkVSTEFQX0NIQU5fUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCArIDIpOworICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsKKyAgICAgICAgICAgICAgICAgICAgICAgU0FQXzI0R0haX1NFQ19PVkVSTEFQX0NIQU5fUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCArIDMpOworICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsKKyAgICAgICAgICAgICAgICAgICAgICAgU0FQXzI0R0haX1RISVJEX09WRVJMQVBfQ0hBTl9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgIGlmIChJU19SU1NJX1ZBTElEKHBFeHRTcGVjdENoLT5yc3NpQWdyLCByc3NpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gcnNzaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoICsgNCk7CisgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2ggIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICArK3BFeHRTcGVjdENoLT5ic3NDb3VudDsKKyAgICAgICAgICAgICAgICByc3NpID0gcFNwZWN0Q2gtPnJzc2lBZ3IgKworICAgICAgICAgICAgICAgICAgICAgICBTQVBfMjRHSFpfRk9VUlRIX09WRVJMQVBfQ0hBTl9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgIGlmIChJU19SU1NJX1ZBTElEKHBFeHRTcGVjdENoLT5yc3NpQWdyLCByc3NpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gcnNzaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgQ0hBTk5FTF81OgorICAgICAgICBjYXNlIENIQU5ORUxfNjoKKyAgICAgICAgY2FzZSBDSEFOTkVMXzc6CisgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCAtIDQpOworICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsKKyAgICAgICAgICAgICAgICAgICAgICAgU0FQXzI0R0haX0ZPVVJUSF9PVkVSTEFQX0NIQU5fUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoIC0gMyk7CisgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2ggIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICArK3BFeHRTcGVjdENoLT5ic3NDb3VudDsKKyAgICAgICAgICAgICAgICByc3NpID0gcFNwZWN0Q2gtPnJzc2lBZ3IgKworICAgICAgICAgICAgICAgICAgICAgICBTQVBfMjRHSFpfVEhJUkRfT1ZFUkxBUF9DSEFOX1JTU0lfRUZGRUNUX1BSSU1BUlk7CisgICAgICAgICAgICAgICAgaWYgKElTX1JTU0lfVkFMSUQocEV4dFNwZWN0Q2gtPnJzc2lBZ3IsIHJzc2kpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSByc3NpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZihwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCAtIDIpOworICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsKKyAgICAgICAgICAgICAgICAgICAgICAgU0FQXzI0R0haX1NFQ19PVkVSTEFQX0NIQU5fUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCAtIDEpOworICAgICAgICAgICAgaWYocEV4dFNwZWN0Q2ggIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICArK3BFeHRTcGVjdENoLT5ic3NDb3VudDsKKyAgICAgICAgICAgICAgICByc3NpID0gcFNwZWN0Q2gtPnJzc2lBZ3IgKworICAgICAgICAgICAgICAgICAgICAgICBTQVBfMjRHSFpfRklSU1RfT1ZFUkxBUF9DSEFOX1JTU0lfRUZGRUNUX1BSSU1BUlk7CisgICAgICAgICAgICAgICAgaWYgKElTX1JTU0lfVkFMSUQocEV4dFNwZWN0Q2gtPnJzc2lBZ3IsIHJzc2kpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSByc3NpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPCBTT0ZUQVBfTUlOX1JTU0kpCisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcEV4dFNwZWN0Q2ggPSAocFNwZWN0Q2ggKyAxKTsKKyAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaCAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArCisgICAgICAgICAgICAgICAgICAgICAgIFNBUF8yNEdIWl9GSVJTVF9PVkVSTEFQX0NIQU5fUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCArIDIpOworICAgICAgICAgICAgaWYocEV4dFNwZWN0Q2ggIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICArK3BFeHRTcGVjdENoLT5ic3NDb3VudDsKKyAgICAgICAgICAgICAgICByc3NpID0gcFNwZWN0Q2gtPnJzc2lBZ3IgKworICAgICAgICAgICAgICAgICAgICAgICBTQVBfMjRHSFpfU0VDX09WRVJMQVBfQ0hBTl9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgIGlmIChJU19SU1NJX1ZBTElEKHBFeHRTcGVjdENoLT5yc3NpQWdyLCByc3NpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gcnNzaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoICsgMyk7CisgICAgICAgICAgICBpZihwRXh0U3BlY3RDaCAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArCisgICAgICAgICAgICAgICAgICAgICAgIFNBUF8yNEdIWl9USElSRF9PVkVSTEFQX0NIQU5fUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCArIDQpOworICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsKKyAgICAgICAgICAgICAgICAgICAgICAgU0FQXzI0R0haX0ZPVVJUSF9PVkVSTEFQX0NIQU5fUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgQ0hBTk5FTF84OgorICAgICAgICAgICAgcEV4dFNwZWN0Q2ggPSAocFNwZWN0Q2ggLSA0KTsKKyAgICAgICAgICAgIGlmKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsKKyAgICAgICAgICAgICAgICAgICAgICAgU0FQXzI0R0haX0ZPVVJUSF9PVkVSTEFQX0NIQU5fUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoIC0gMyk7CisgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2ggIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICArK3BFeHRTcGVjdENoLT5ic3NDb3VudDsKKyAgICAgICAgICAgICAgICByc3NpID0gcFNwZWN0Q2gtPnJzc2lBZ3IgKworICAgICAgICAgICAgICAgICAgICAgICBTQVBfMjRHSFpfVEhJUkRfT1ZFUkxBUF9DSEFOX1JTU0lfRUZGRUNUX1BSSU1BUlk7CisgICAgICAgICAgICAgICAgaWYgKElTX1JTU0lfVkFMSUQocEV4dFNwZWN0Q2gtPnJzc2lBZ3IsIHJzc2kpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSByc3NpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPCBTT0ZUQVBfTUlOX1JTU0kpCisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcEV4dFNwZWN0Q2ggPSAocFNwZWN0Q2ggLSAyKTsKKyAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaCAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArCisgICAgICAgICAgICAgICAgICAgICAgIFNBUF8yNEdIWl9TRUNfT1ZFUkxBUF9DSEFOX1JTU0lfRUZGRUNUX1BSSU1BUlk7CisgICAgICAgICAgICAgICAgaWYgKElTX1JTU0lfVkFMSUQocEV4dFNwZWN0Q2gtPnJzc2lBZ3IsIHJzc2kpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSByc3NpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPCBTT0ZUQVBfTUlOX1JTU0kpCisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcEV4dFNwZWN0Q2ggPSAocFNwZWN0Q2ggLSAxKTsKKyAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaCAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArCisgICAgICAgICAgICAgICAgICAgICAgIFNBUF8yNEdIWl9GSVJTVF9PVkVSTEFQX0NIQU5fUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCArIDEpOworICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsKKyAgICAgICAgICAgICAgICAgICAgICAgU0FQXzI0R0haX0ZJUlNUX09WRVJMQVBfQ0hBTl9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgIGlmIChJU19SU1NJX1ZBTElEKHBFeHRTcGVjdENoLT5yc3NpQWdyLCByc3NpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gcnNzaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoICsgMik7CisgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2ggIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICArK3BFeHRTcGVjdENoLT5ic3NDb3VudDsKKyAgICAgICAgICAgICAgICByc3NpID0gcFNwZWN0Q2gtPnJzc2lBZ3IgKworICAgICAgICAgICAgICAgICAgICAgICBTQVBfMjRHSFpfU0VDX09WRVJMQVBfQ0hBTl9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgIGlmIChJU19SU1NJX1ZBTElEKHBFeHRTcGVjdENoLT5yc3NpQWdyLCByc3NpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gcnNzaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoICsgMyk7CisgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2ggIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICArK3BFeHRTcGVjdENoLT5ic3NDb3VudDsKKyAgICAgICAgICAgICAgICByc3NpID0gcFNwZWN0Q2gtPnJzc2lBZ3IgKworICAgICAgICAgICAgICAgICAgICAgICBTQVBfMjRHSFpfVEhJUkRfT1ZFUkxBUF9DSEFOX1JTU0lfRUZGRUNUX1BSSU1BUlk7CisgICAgICAgICAgICAgICAgaWYgKElTX1JTU0lfVkFMSUQocEV4dFNwZWN0Q2gtPnJzc2lBZ3IsIHJzc2kpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSByc3NpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPCBTT0ZUQVBfTUlOX1JTU0kpCisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBDSEFOTkVMXzk6CisgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCAtIDQpOworICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsKKyAgICAgICAgICAgICAgICAgICAgICAgU0FQXzI0R0haX0ZPVVJUSF9PVkVSTEFQX0NIQU5fUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcEV4dFNwZWN0Q2ggPSAocFNwZWN0Q2ggLSAzKTsKKyAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaCAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArCisgICAgICAgICAgICAgICAgICAgICAgIFNBUF8yNEdIWl9USElSRF9PVkVSTEFQX0NIQU5fUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCAtIDIpOworICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsKKyAgICAgICAgICAgICAgICAgICAgICAgU0FQXzI0R0haX1NFQ19PVkVSTEFQX0NIQU5fUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCAtIDEpOworICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsKKyAgICAgICAgICAgICAgICAgICAgICAgU0FQXzI0R0haX0ZJUlNUX09WRVJMQVBfQ0hBTl9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgIGlmIChJU19SU1NJX1ZBTElEKHBFeHRTcGVjdENoLT5yc3NpQWdyLCByc3NpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gcnNzaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoICsgMSk7CisgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2ggIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICArK3BFeHRTcGVjdENoLT5ic3NDb3VudDsKKyAgICAgICAgICAgICAgICByc3NpID0gcFNwZWN0Q2gtPnJzc2lBZ3IgKworICAgICAgICAgICAgICAgICAgICAgICBTQVBfMjRHSFpfRklSU1RfT1ZFUkxBUF9DSEFOX1JTU0lfRUZGRUNUX1BSSU1BUlk7CisgICAgICAgICAgICAgICAgaWYgKElTX1JTU0lfVkFMSUQocEV4dFNwZWN0Q2gtPnJzc2lBZ3IsIHJzc2kpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSByc3NpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPCBTT0ZUQVBfTUlOX1JTU0kpCisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcEV4dFNwZWN0Q2ggPSAocFNwZWN0Q2ggKyAyKTsKKyAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaCAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArCisgICAgICAgICAgICAgICAgICAgICAgIFNBUF8yNEdIWl9TRUNfT1ZFUkxBUF9DSEFOX1JTU0lfRUZGRUNUX1BSSU1BUlk7CisgICAgICAgICAgICAgICAgaWYgKElTX1JTU0lfVkFMSUQocEV4dFNwZWN0Q2gtPnJzc2lBZ3IsIHJzc2kpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSByc3NpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPCBTT0ZUQVBfTUlOX1JTU0kpCisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBDSEFOTkVMXzEwOgorICAgICAgICAgICAgcEV4dFNwZWN0Q2ggPSAocFNwZWN0Q2ggLSA0KTsKKyAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaCAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArCisgICAgICAgICAgICAgICAgICAgICAgIFNBUF8yNEdIWl9GT1VSVEhfT1ZFUkxBUF9DSEFOX1JTU0lfRUZGRUNUX1BSSU1BUlk7CisgICAgICAgICAgICAgICAgaWYgKElTX1JTU0lfVkFMSUQocEV4dFNwZWN0Q2gtPnJzc2lBZ3IsIHJzc2kpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSByc3NpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPCBTT0ZUQVBfTUlOX1JTU0kpCisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCAtIDMpOworICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsKKyAgICAgICAgICAgICAgICAgICAgICAgU0FQXzI0R0haX1RISVJEX09WRVJMQVBfQ0hBTl9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgIGlmIChJU19SU1NJX1ZBTElEKHBFeHRTcGVjdENoLT5yc3NpQWdyLCByc3NpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gcnNzaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoIC0gMik7CisgICAgICAgICAgICBpZihwRXh0U3BlY3RDaCAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArCisgICAgICAgICAgICAgICAgICAgICAgIFNBUF8yNEdIWl9TRUNfT1ZFUkxBUF9DSEFOX1JTU0lfRUZGRUNUX1BSSU1BUlk7CisgICAgICAgICAgICAgICAgaWYgKElTX1JTU0lfVkFMSUQocEV4dFNwZWN0Q2gtPnJzc2lBZ3IsIHJzc2kpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSByc3NpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPCBTT0ZUQVBfTUlOX1JTU0kpCisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcEV4dFNwZWN0Q2ggPSAocFNwZWN0Q2ggLSAxKTsKKyAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaCAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArCisgICAgICAgICAgICAgICAgICAgICAgIFNBUF8yNEdIWl9GSVJTVF9PVkVSTEFQX0NIQU5fUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCArIDEpOworICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsKKyAgICAgICAgICAgICAgICAgICAgICAgU0FQXzI0R0haX0ZJUlNUX09WRVJMQVBfQ0hBTl9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgIGlmIChJU19SU1NJX1ZBTElEKHBFeHRTcGVjdENoLT5yc3NpQWdyLCByc3NpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gcnNzaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgQ0hBTk5FTF8xMToKKyAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoIC0gMSk7CisgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2ggIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICArK3BFeHRTcGVjdENoLT5ic3NDb3VudDsKKyAgICAgICAgICAgICAgICByc3NpID0gcFNwZWN0Q2gtPnJzc2lBZ3IgKworICAgICAgICAgICAgICAgICAgICAgICBTQVBfMjRHSFpfRklSU1RfT1ZFUkxBUF9DSEFOX1JTU0lfRUZGRUNUX1BSSU1BUlk7CisgICAgICAgICAgICAgICAgaWYgKElTX1JTU0lfVkFMSUQocEV4dFNwZWN0Q2gtPnJzc2lBZ3IsIHJzc2kpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSByc3NpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPCBTT0ZUQVBfTUlOX1JTU0kpCisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcEV4dFNwZWN0Q2ggPSAocFNwZWN0Q2ggLSAyKTsKKyAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaCAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArCisgICAgICAgICAgICAgICAgICAgICAgIFNBUF8yNEdIWl9TRUNfT1ZFUkxBUF9DSEFOX1JTU0lfRUZGRUNUX1BSSU1BUlk7CisgICAgICAgICAgICAgICAgaWYgKElTX1JTU0lfVkFMSUQocEV4dFNwZWN0Q2gtPnJzc2lBZ3IsIHJzc2kpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSByc3NpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAocEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPCBTT0ZUQVBfTUlOX1JTU0kpCisgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcEV4dFNwZWN0Q2ggPSAocFNwZWN0Q2ggLSAzKTsKKyAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaCAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArCisgICAgICAgICAgICAgICAgICAgICAgIFNBUF8yNEdIWl9USElSRF9PVkVSTEFQX0NIQU5fUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCAtIDQpOworICAgICAgICAgICAgaWYgKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsKKyAgICAgICAgICAgICAgICAgICAgICAgU0FQXzI0R0haX0ZPVVJUSF9PVkVSTEFQX0NIQU5fUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgYnJlYWs7CisgICAgfQorfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIHNhcENvbXB1dGVTcGVjdFdlaWdodAorCisgIERFU0NSSVBUSU9OIAorICAgIE1haW4gZnVuY3Rpb24gZm9yIGNvbXB1dGluZyB0aGUgd2VpZ2h0IG9mIGVhY2ggY2hhbm5lbCBpbiB0aGUKKyAgICBzcGVjdHJ1bSBiYXNlZCBvbiB0aGUgUlNTSSB2YWx1ZSBvZiB0aGUgQlNTZXMgb24gdGhlIGNoYW5uZWwKKyAgICBhbmQgbnVtYmVyIG9mIEJTUworICAgIAorICBERVBFTkRFTkNJRVMgCisgICAgTkEuIAorCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgIHBTcGVjdEluZm9QYXJhbXMgICAgICAgOiBQb2ludGVyIHRvIHRoZSB0U3BlY3RJbmZvUGFyYW1zIHN0cnVjdHVyZQorICAgIGhhbEhhbmRsZSAgICAgICAgICAgICAgOiBQb2ludGVyIHRvIEhBTCBoYW5kbGUKKyAgICBwUmVzdWx0ICAgICAgICAgICAgICAgIDogUG9pbnRlciB0byB0U2NhblJlc3VsdEhhbmRsZQorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIHZvaWQgICAgIDogTlVMTAorICAKKyAgU0lERSBFRkZFQ1RTIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIHNhcENvbXB1dGVTcGVjdFdlaWdodCggdFNhcENoU2VsU3BlY3RJbmZvKiBwU3BlY3RJbmZvUGFyYW1zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0SGFsSGFuZGxlIGhhbEhhbmRsZSwgdFNjYW5SZXN1bHRIYW5kbGUgcFJlc3VsdCkKK3sKKyAgICB2X1M3X3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Qcm9iZVJlc3BCZWFjb24pLCAwKTsKKworICAgICAgICAgICAgaWYgKChzaXJQYXJzZUJlYWNvbklFKHBNYWMsIHBCZWFjb25TdHJ1Y3QsKHRBTklfVTggKikoIHBTY2FuUmVzdWx0LT5Cc3NEZXNjcmlwdG9yLmllRmllbGRzKSwgaWVMZW4pKSA9PSBlU0lSX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHBCZWFjb25TdHJ1Y3QtPkhUQ2Fwcy5wcmVzZW50ICYmIHBCZWFjb25TdHJ1Y3QtPkhUSW5mby5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY2hhbm5lbFdpZHRoID0gcEJlYWNvblN0cnVjdC0+SFRDYXBzLnN1cHBvcnRlZENoYW5uZWxXaWR0aFNldDsKKyAgICAgICAgICAgICAgICAgICAgc2Vjb25kYXJ5Q2hhbm5lbE9mZnNldCA9IHBCZWFjb25TdHJ1Y3QtPkhUSW5mby5zZWNvbmRhcnlDaGFubmVsT2Zmc2V0OworICAgICAgICAgICAgICAgICAgICBpZihwQmVhY29uU3RydWN0LT5WSFRPcGVyYXRpb24ucHJlc2VudCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgdmh0U3VwcG9ydCA9IHBCZWFjb25TdHJ1Y3QtPlZIVE9wZXJhdGlvbi5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgaWYocEJlYWNvblN0cnVjdC0+VkhUT3BlcmF0aW9uLmNoYW5XaWR0aCA+IFdOSV9DRkdfVkhUX0NIQU5ORUxfV0lEVEhfMjBfNDBNSFopCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbFdpZHRoID0gZUhUX0NIQU5ORUxfV0lEVEhfODBNSFo7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2VudGVyRnJlcSA9IHBCZWFjb25TdHJ1Y3QtPlZIVE9wZXJhdGlvbi5jaGFuQ2VudGVyRnJlcVNlZzE7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgLy8gUHJvY2Vzc2luZyBmb3IgZWFjaCB0Q3NyU2NhblJlc3VsdEluZm8gaW4gdGhlIHRDc3JTY2FuUmVzdWx0IERMaW5rIGxpc3QKKyAgICAgICAgZm9yIChjaG5fbnVtID0gMDsgY2huX251bSA8IHBTcGVjdEluZm9QYXJhbXMtPm51bVNwZWN0Q2hhbnM7IGNobl9udW0rKykgeworCisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogIGlmIHRoZSBCZWFjb24gaGFzIGNoYW5uZWwgSUQsIHVzZSBpdCBvdGhlciB3aXNlIHdlIHdpbGwgCisgICAgICAgICAgICAgKiAgcmVseSBvbiB0aGUgY2hhbm5lbElkU2VsZgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBpZihwU2NhblJlc3VsdC0+QnNzRGVzY3JpcHRvci5jaGFubmVsSWQgPT0gMCkKKyAgICAgICAgICAgICAgICBjaGFubmVsX2lkID0gcFNjYW5SZXN1bHQtPkJzc0Rlc2NyaXB0b3IuY2hhbm5lbElkU2VsZjsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBjaGFubmVsX2lkID0gcFNjYW5SZXN1bHQtPkJzc0Rlc2NyaXB0b3IuY2hhbm5lbElkOworCisgICAgICAgICAgICBpZiAocFNwZWN0Q2ggJiYgKGNoYW5uZWxfaWQgPT0gcFNwZWN0Q2gtPmNoTnVtKSkgeworICAgICAgICAgICAgICAgIGlmIChwU3BlY3RDaC0+cnNzaUFnciA8IHBTY2FuUmVzdWx0LT5Cc3NEZXNjcmlwdG9yLnJzc2kpCisgICAgICAgICAgICAgICAgICAgIHBTcGVjdENoLT5yc3NpQWdyID0gcFNjYW5SZXN1bHQtPkJzc0Rlc2NyaXB0b3IucnNzaTsKKworICAgICAgICAgICAgICAgICsrcFNwZWN0Q2gtPmJzc0NvdW50OyAvLyBJbmNyZW1lbnQgdGhlIGNvdW50IG9mIEJTUworCisgICAgICAgICAgICAgICAgaWYob3BlcmF0aW5nQmFuZCkgLy8gQ29ubnNpZGVyaW5nIHRoZSBFeHRlbnNpb24gQ2hhbm5lbCBvbmx5IGluIGEgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qIFVwZGF0aW5nIHRoZSByZWNlaXZlZCBDaGFubmVsV2lkdGggKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKHBTcGVjdENoLT5jaGFubmVsV2lkdGggIT0gY2hhbm5lbFdpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgcFNwZWN0Q2gtPmNoYW5uZWxXaWR0aCA9IGNoYW5uZWxXaWR0aDsKKyAgICAgICAgICAgICAgICAgICAgLyogSWYgcmVjZWl2ZWQgQ2hhbm5lbFdpZHRoIGlzIG90aGVyIHRoYW4gSFQyMCwgd2UgbmVlZCB0byB1cGRhdGUgdGhlIGV4dGVuc2lvbiBjaGFubmVsIFBhcmFtcyBhcyB3ZWxsICovCisgICAgICAgICAgICAgICAgICAgIC8qIGNoYW5uZWxXaWR0aCA9PSAwLCBIVDIwICovCisgICAgICAgICAgICAgICAgICAgIC8qIGNoYW5uZWxXaWR0aCA9PSAxLCBIVDQwICovCisgICAgICAgICAgICAgICAgICAgIC8qIGNoYW5uZWxXaWR0aCA9PSAyLCBWSFQ4MCovCisgICAgICAgICAgICAgICAgICAgIHN3aXRjaChwU3BlY3RDaC0+Y2hhbm5lbFdpZHRoKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGVIVF9DSEFOTkVMX1dJRFRIXzQwTUhaOiAvL0hUNDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2goIHNlY29uZGFyeUNoYW5uZWxPZmZzZXQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2FwU3BlY3RDaEluZm8gKnBFeHRTcGVjdENoID0gTlVMTDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBQSFlfRE9VQkxFX0NIQU5ORUxfTE9XX1BSSU1BUlk6IC8vIEFib3ZlIHRoZSBQcmltYXJ5IENoYW5uZWwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoICsgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihwRXh0U3BlY3RDaCAhPSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArIFNBUF9TVUJCQU5EMV9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJFZHVjaW5nIHRoZSByc3NpIGJ5IC0yMCBhbmQgYXNzaWduaW5nIGl0IHRvIEV4dGVuc2lvbiBjaGFubmVsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKElTX1JTU0lfVkFMSUQocEV4dFNwZWN0Q2gtPnJzc2lBZ3IsIHJzc2kpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSByc3NpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgUEhZX0RPVUJMRV9DSEFOTkVMX0hJR0hfUFJJTUFSWTogLy8gQmVsb3cgdGhlIFByaW1hcnkgY2hhbm5lbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2ggPSAocFNwZWN0Q2ggLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBFeHRTcGVjdENoICE9IE5VTEwpIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArIFNBUF9TVUJCQU5EMV9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChJU19SU1NJX1ZBTElEKHBFeHRTcGVjdENoLT5yc3NpQWdyLCByc3NpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gcnNzaTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPCBTT0ZUQVBfTUlOX1JTU0kpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgZUhUX0NIQU5ORUxfV0lEVEhfODBNSFo6IC8vIFZIVDgwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoKGNlbnRlckZyZXEgLSBjaGFubmVsX2lkKSA9PSA2KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNhcFNwZWN0Q2hJbmZvICpwRXh0U3BlY3RDaCA9IE5VTEw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoICsgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsgU0FQX1NVQkJBTkQxX1JTU0lfRUZGRUNUX1BSSU1BUlk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSByc3NpOyAvLyBSZWR1Y2luZyB0aGUgcnNzaSBieSAtMjAgYW5kIGFzc2lnbmluZyBpdCB0byBTdWJiYW5kIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoICsgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsgU0FQX1NVQkJBTkQyX1JTU0lfRUZGRUNUX1BSSU1BUlk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSByc3NpOyAvLyBSZWR1Y2luZyB0aGUgcnNzaSBieSAtMzAgYW5kIGFzc2lnbmluZyBpdCB0byBTdWJiYW5kIDIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoICsgMyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsgU0FQX1NVQkJBTkQzX1JTU0lfRUZGRUNUX1BSSU1BUlk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSByc3NpOyAvLyBSZWR1Y2luZyB0aGUgcnNzaSBieSAtNDAgYW5kIGFzc2lnbmluZyBpdCB0byBTdWJiYW5kIDMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoKGNlbnRlckZyZXEgLSBjaGFubmVsX2lkKSA9PSAyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNhcFNwZWN0Q2hJbmZvICpwRXh0U3BlY3RDaCA9IE5VTEw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoIC0gMSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihwRXh0U3BlY3RDaCAhPSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArK3BFeHRTcGVjdENoLT5ic3NDb3VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArIFNBUF9TVUJCQU5EMV9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKElTX1JTU0lfVkFMSUQocEV4dFNwZWN0Q2gtPnJzc2lBZ3IsIHJzc2kpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gcnNzaTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoICsgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsgU0FQX1NVQkJBTkQxX1JTU0lfRUZGRUNUX1BSSU1BUlk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSByc3NpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPCBTT0ZUQVBfTUlOX1JTU0kpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2ggPSAocFNwZWN0Q2ggKyAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocEV4dFNwZWN0Q2ggIT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByc3NpID0gcFNwZWN0Q2gtPnJzc2lBZ3IgKyBTQVBfU1VCQkFORDJfUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChJU19SU1NJX1ZBTElEKHBFeHRTcGVjdENoLT5yc3NpQWdyLCByc3NpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKChjZW50ZXJGcmVxIC0gY2hhbm5lbF9pZCkgPT0gLTIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2FwU3BlY3RDaEluZm8gKnBFeHRTcGVjdENoID0gTlVMTDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2ggPSAocFNwZWN0Q2ggLSAxICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsgU0FQX1NVQkJBTkQxX1JTU0lfRUZGRUNUX1BSSU1BUlk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSByc3NpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPCBTT0ZUQVBfTUlOX1JTU0kpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2ggPSAocFNwZWN0Q2ggLSAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocEV4dFNwZWN0Q2ggIT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByc3NpID0gcFNwZWN0Q2gtPnJzc2lBZ3IgKyBTQVBfU1VCQkFORDJfUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChJU19SU1NJX1ZBTElEKHBFeHRTcGVjdENoLT5yc3NpQWdyLCByc3NpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCArIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihwRXh0U3BlY3RDaCAhPSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArK3BFeHRTcGVjdENoLT5ic3NDb3VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArIFNBUF9TVUJCQU5EMV9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKElTX1JTU0lfVkFMSUQocEV4dFNwZWN0Q2gtPnJzc2lBZ3IsIHJzc2kpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gcnNzaTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoKGNlbnRlckZyZXEgLSBjaGFubmVsX2lkKSA9PSAtNikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTYXBTcGVjdENoSW5mbyAqcEV4dFNwZWN0Q2ggPSBOVUxMOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCAtIDEgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocEV4dFNwZWN0Q2ggIT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKytwRXh0U3BlY3RDaC0+YnNzQ291bnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByc3NpID0gcFNwZWN0Q2gtPnJzc2lBZ3IgKyBTQVBfU1VCQkFORDFfUlNTSV9FRkZFQ1RfUFJJTUFSWTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChJU19SU1NJX1ZBTElEKHBFeHRTcGVjdENoLT5yc3NpQWdyLCByc3NpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IHJzc2k7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihwRXh0U3BlY3RDaC0+cnNzaUFnciA8IFNPRlRBUF9NSU5fUlNTSSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaC0+cnNzaUFnciA9IFNPRlRBUF9NSU5fUlNTSTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRXh0U3BlY3RDaCA9IChwU3BlY3RDaCAtIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihwRXh0U3BlY3RDaCAhPSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArK3BFeHRTcGVjdENoLT5ic3NDb3VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJzc2kgPSBwU3BlY3RDaC0+cnNzaUFnciArIFNBUF9TVUJCQU5EMl9SU1NJX0VGRkVDVF9QUklNQVJZOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKElTX1JTU0lfVkFMSUQocEV4dFNwZWN0Q2gtPnJzc2lBZ3IsIHJzc2kpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gcnNzaTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBFeHRTcGVjdENoLT5yc3NpQWdyIDwgU09GVEFQX01JTl9SU1NJKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoLT5yc3NpQWdyID0gU09GVEFQX01JTl9SU1NJOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFeHRTcGVjdENoID0gKHBTcGVjdENoIC0gMyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBFeHRTcGVjdENoICE9IE5VTEwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsrcEV4dFNwZWN0Q2gtPmJzc0NvdW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnNzaSA9IHBTcGVjdENoLT5yc3NpQWdyICsgU0FQX1NVQkJBTkQzX1JTU0lfRUZGRUNUX1BSSU1BUlk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoSVNfUlNTSV9WQUxJRChwRXh0U3BlY3RDaC0+cnNzaUFnciwgcnNzaSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSByc3NpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPCBTT0ZUQVBfTUlOX1JTU0kpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEV4dFNwZWN0Q2gtPnJzc2lBZ3IgPSBTT0ZUQVBfTUlOX1JTU0k7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmKG9wZXJhdGluZ0JhbmQgPT0gZVNBUF9SRl9TVUJCQU5EXzJfNF9HSFopCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgc2FwSW50ZXJmZXJlbmNlUnNzaUNvdW50KHBTcGVjdENoKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICAgIkluICVzLCBic3NkZXMuY2hfc2VsZj0lZCwgYnNzZGVzLmNoX0lEPSVkLCBic3NkZXMucnNzaT0lZCwgU3BlY3RDaC5ic3NDb3VudD0lZCwgcFNjYW5SZXN1bHQ9JXAsIENoYW5uZWxXaWR0aCAlZCwgc2Vjb25kYXJ5Q2hhbk9mZnNldCAlZCwgY2VudGVyIGZyZXF1ZW5jeSAlZCAiLAorICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHBTY2FuUmVzdWx0LT5Cc3NEZXNjcmlwdG9yLmNoYW5uZWxJZFNlbGYsIHBTY2FuUmVzdWx0LT5Cc3NEZXNjcmlwdG9yLmNoYW5uZWxJZCwgcFNjYW5SZXN1bHQtPkJzc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SW5mb1BhcmFtcyAgICAgICA6IFBvaW50ZXIgdG8gdGhlIHRTYXBDaFNlbFNwZWN0SW5mbyBzdHJ1Y3R1cmUKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICB2b2lkICAgICA6IE5VTEwKKyAgCisgIFNJREUgRUZGRUNUUyAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBzYXBDaGFuU2VsRXhpdCggdFNhcENoU2VsU3BlY3RJbmZvICpwU3BlY3RJbmZvUGFyYW1zICkKK3sKKyAgICAvLyBGcmVlIGFsbCB0aGUgYWxsb2NhdGVkIG1lbW9yeQorICAgIHZvc19tZW1fZnJlZShwU3BlY3RJbmZvUGFyYW1zLT5wU3BlY3RDaCk7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgc2FwU29ydENobFdlaWdodAorCisgIERFU0NSSVBUSU9OIAorICAgIEZ1bnRpb24gdG8gc29ydCB0aGUgY2hhbm5lbHMgd2l0aCB0aGUgbGVhc3Qgd2VpZ2h0IGZpcnN0CisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICBOQS4gCisKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcFNwZWN0SW5mb1BhcmFtcyAgICAgICA6IFBvaW50ZXIgdG8gdGhlIHRTYXBDaFNlbFNwZWN0SW5mbyBzdHJ1Y3R1cmUKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICB2b2lkICAgICA6IE5VTEwKKyAgCisgIFNJREUgRUZGRUNUUyAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBzYXBTb3J0Q2hsV2VpZ2h0KHRTYXBDaFNlbFNwZWN0SW5mbyAqcFNwZWN0SW5mb1BhcmFtcykKK3sKKyAgICB0U2FwU3BlY3RDaEluZm8gdGVtcDsKKworICAgIHRTYXBTcGVjdENoSW5mbyAqcFNwZWN0Q2ggPSBOVUxMOworICAgIHZfVTMyX3QgaSA9IDAsIGogPSAwLCBtaW5XZWlnaHRJbmRleCA9IDA7CisKKyAgICBwU3BlY3RDaCA9IHBTcGVjdEluZm9QYXJhbXMtPnBTcGVjdENoOworICAgIGZvciAoaSA9IDA7IGkgPCBwU3BlY3RJbmZvUGFyYW1zLT5udW1TcGVjdENoYW5zOyBpKyspIHsKKyAgICAgICAgbWluV2VpZ2h0SW5kZXggPSBpOworICAgICAgICBmb3IoIGogPSBpICsgMTsgaiA8IHBTcGVjdEluZm9QYXJhbXMtPm51bVNwZWN0Q2hhbnM7IGorKykgeworICAgICAgICAgICAgaWYocFNwZWN0Q2hbal0ud2VpZ2h0IDwgcFNwZWN0Q2hbbWluV2VpZ2h0SW5kZXhdLndlaWdodCkgeworICAgICAgICAgICAgICAgIG1pbldlaWdodEluZGV4ID0gajsgCisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYobWluV2VpZ2h0SW5kZXggIT0gaSkgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZ0ZW1wLCAmcFNwZWN0Q2hbbWluV2VpZ2h0SW5kZXhdLCBzaXplb2YoKnBTcGVjdENoKSk7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnBTcGVjdENoW21pbldlaWdodEluZGV4XSwgJnBTcGVjdENoW2ldLCBzaXplb2YoKnBTcGVjdENoKSk7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnBTcGVjdENoW2ldLCAmdGVtcCwgc2l6ZW9mKCpwU3BlY3RDaCkpOworICAgICAgICB9CisgICAgfQorfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIHNhcFNvcnRDaGxXZWlnaHRIVDgwCisKKyAgREVTQ1JJUFRJT04KKyAgICBGdW50aW9uIHRvIHNvcnQgdGhlIGNoYW5uZWxzIHdpdGggdGhlIGxlYXN0IHdlaWdodCBmaXJzdCBmb3IgSFQ4MCBjaGFubmVscworCisgIERFUEVOREVOQ0lFUworICAgIE5BLgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcFNwZWN0SW5mb1BhcmFtcyAgICAgICA6IFBvaW50ZXIgdG8gdGhlIHRTYXBDaFNlbFNwZWN0SW5mbyBzdHJ1Y3R1cmUKKworICBSRVRVUk4gVkFMVUUKKyAgICB2b2lkICAgICA6IE5VTEwKKworICBTSURFIEVGRkVDVFMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBzYXBTb3J0Q2hsV2VpZ2h0SFQ4MCh0U2FwQ2hTZWxTcGVjdEluZm8gKnBTcGVjdEluZm9QYXJhbXMpCit7CisgICAgdl9VOF90IGksIGosIG47CisgICAgdFNhcFNwZWN0Q2hJbmZvICpwU3BlY3RJbmZvOworICAgIHZfVThfdCBtaW5JZHg7CisKKyAgICBwU3BlY3RJbmZvID0gcFNwZWN0SW5mb1BhcmFtcy0+cFNwZWN0Q2g7CisgICAgLyogZm9yIGVhY2ggSFQ4MCBjaGFubmVsLCBjYWxjdWxhdGUgdGhlIGNvbWJpbmVkIHdlaWdodCBvZiB0aGUKKyAgICAgICBmb3VyIDIwTUh6IHdlaWdodCAqLworICAgIGZvciAoaSA9IDA7IGkgPCBBUlJBWV9TSVpFKGFjc0hUODBDaGFubmVscyk7IGkrKykKKyAgICB7CisgICAgICAgIGZvciAoaiA9IDA7IGogPCBwU3BlY3RJbmZvUGFyYW1zLT5udW1TcGVjdENoYW5zOyBqKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmICggcFNwZWN0SW5mb1tqXS5jaE51bSA9PSBhY3NIVDgwQ2hhbm5lbHNbaV0uY2hTdGFydE51bSApCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGogPT0gcFNwZWN0SW5mb1BhcmFtcy0+bnVtU3BlY3RDaGFucykKKyAgICAgICAgICAgIGNvbnRpbnVlOworCisgICAgICAgIC8qZm91bmQgdGhlIGNoYW5uZWwsIGFkZCB0aGUgNCBhZGphY2VudCBjaGFubmVscycgd2VpZ2h0Ki8KKyAgICAgICAgaWYgKCgocFNwZWN0SW5mb1tqXS5jaE51bSArNCkgPT0gcFNwZWN0SW5mb1tqKzFdLmNoTnVtKSAmJgorICAgICAgICAgICAgICgocFNwZWN0SW5mb1tqXS5jaE51bSArOCkgPT0gcFNwZWN0SW5mb1tqKzJdLmNoTnVtKSAmJgorICAgICAgICAgICAgICgocFNwZWN0SW5mb1tqXS5jaE51bSArMTIpID09IHBTcGVjdEluZm9baiszXS5jaE51bSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGFjc0hUODBDaGFubmVsc1tpXS53ZWlnaHQgPSBwU3BlY3RJbmZvW2pdLndlaWdodCArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNwZWN0SW5mb1tqKzFdLndlaWdodCArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNwZWN0SW5mb1tqKzJdLndlaWdodCArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNwZWN0SW5mb1tqKzNdLndlaWdodDsKKyAgICAgICAgICAgIC8qIGZpbmQgYmVzdCBjaGFubmVsIGFtb25nIDQgY2hhbm5lbHMgYXMgdGhlIHByaW1hcnkgY2hhbm5lbCAqLworICAgICAgICAgICAgaWYgKChwU3BlY3RJbmZvW2pdLndlaWdodCArIHBTcGVjdEluZm9baisxXS53ZWlnaHQpIDwKKyAgICAgICAgICAgICAgICAgICAgKHBTcGVjdEluZm9baisyXS53ZWlnaHQgKyBwU3BlY3RJbmZvW2orM10ud2VpZ2h0KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBsb3dlciAyIGNoYW5uZWxzIGFyZSBiZXR0ZXIgY2hvaWNlICovCisgICAgICAgICAgICAgICAgaWYgKHBTcGVjdEluZm9bal0ud2VpZ2h0IDwgcFNwZWN0SW5mb1tqKzFdLndlaWdodCkKKyAgICAgICAgICAgICAgICAgICAgbWluSWR4ID0gMDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIG1pbklkeCA9IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogdXBwZXIgMiBjaGFubmVscyBhcmUgYmV0dGVyIGNob2ljZSAqLworICAgICAgICAgICAgICAgIGlmIChwU3BlY3RJbmZvW2orMl0ud2VpZ2h0IDw9IHBTcGVjdEluZm9baiszXS53ZWlnaHQpCisgICAgICAgICAgICAgICAgICAgIG1pbklkeCA9IDI7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICBtaW5JZHggPSAzOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKiBzZXQgYWxsIDQgY2hhbm5lbHMgdG8gbWF4IHZhbHVlIGZpcnN0LCB0aGVuIHJlc2V0IHRoZQorICAgICAgICAgICAgICAgYmVzdCBjaGFubmVsIGFzIHRoZSBzZWxlY3RlZCBwcmltYXJ5IGNoYW5uZWwsIHVwZGF0ZSBpdHMKKyAgICAgICAgICAgICAgIHdlaWdodGFnZSB3aXRoIHRoZSBjb21iaW5lZCB3ZWlnaHQgdmFsdWUgKi8KKyAgICAgICAgICAgIGZvciAobj0wOyBuPDQ7IG4rKykKKyAgICAgICAgICAgICAgICBwU3BlY3RJbmZvW2orbl0ud2VpZ2h0ID0gQUNTX1dFSUdIVF9NQVggKiA0OworCisgICAgICAgICAgICBwU3BlY3RJbmZvW2orbWluSWR4XS53ZWlnaHQgPSBhY3NIVDgwQ2hhbm5lbHNbaV0ud2VpZ2h0OworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLyogc29tZSBjaGFubmVscyBkb2VzIG5vdCBleGlzdCBpbiBwU2VjdEluZm8gYXJyYXksCisgICAgICAgICAgICAgICBza2lwIHRoaXMgY2hhbm5lbCBhbmQgdGhvc2UgaW4gdGhlIHNhbWUgSFQ4MCB3aWR0aCovCisgICAgICAgICAgICBwU3BlY3RJbmZvW2pdLndlaWdodCA9IEFDU19XRUlHSFRfTUFYICogNDsKKyAgICAgICAgICAgIGlmICgocFNwZWN0SW5mb1tqXS5jaE51bSArNCkgPT0gcFNwZWN0SW5mb1tqKzFdLmNoTnVtKQorICAgICAgICAgICAgICAgIHBTcGVjdEluZm9baisxXS53ZWlnaHQgPSBBQ1NfV0VJR0hUX01BWCAqIDQ7CisgICAgICAgICAgICBpZiAoKHBTcGVjdEluZm9bal0uY2hOdW0gKzgpID09IHBTcGVjdEluZm9baisyXS5jaE51bSkKKyAgICAgICAgICAgICAgICBwU3BlY3RJbmZvW2orMl0ud2VpZ2h0ID0gQUNTX1dFSUdIVF9NQVggKiA0OworICAgICAgICAgICAgaWYgKChwU3BlY3RJbmZvW2pdLmNoTnVtICsxMikgPT0gcFNwZWN0SW5mb1tqKzNdLmNoTnVtKQorICAgICAgICAgICAgICAgIHBTcGVjdEluZm9baiszXS53ZWlnaHQgPSBBQ1NfV0VJR0hUX01BWCAqIDQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwU3BlY3RJbmZvID0gcFNwZWN0SW5mb1BhcmFtcy0+cFNwZWN0Q2g7CisgICAgZm9yIChqID0gMDsgaiA8IHBTcGVjdEluZm9QYXJhbXMtPm51bVNwZWN0Q2hhbnM7IGorKykKKyAgICB7CisgICAgICAgIGlmICggQ0hBTk5FTF8xNjUgPT0gcFNwZWN0SW5mb1tqXS5jaE51bSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBTcGVjdEluZm9bal0ud2VpZ2h0ID0gQUNTX1dFSUdIVF9NQVggKiA0OworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwU3BlY3RJbmZvID0gcFNwZWN0SW5mb1BhcmFtcy0+cFNwZWN0Q2g7CisgICAgZm9yIChqID0gMDsgaiA8IChwU3BlY3RJbmZvUGFyYW1zLT5udW1TcGVjdENoYW5zKTsgaisrKSB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgIkluICVzLCBDaGFubmVsPSVkIFdlaWdodD0gJWQgcnNzaT0lZCBic3NDb3VudD0lZCIsCisgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBwU3BlY3RJbmZvLT5jaE51bSwgcFNwZWN0SW5mby0+d2VpZ2h0LAorICAgICAgICAgICAgICAgICAgICBwU3BlY3RJbmZvLT5yc3NpQWdyLCBwU3BlY3RJbmZvLT5ic3NDb3VudCk7CisgICAgICAgIHBTcGVjdEluZm8rKzsKKyAgICB9CisKKyAgICBzYXBTb3J0Q2hsV2VpZ2h0KHBTcGVjdEluZm9QYXJhbXMpOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIHNhcFNvcnRDaGxXZWlnaHRIVDQwXzI0RworCisgIERFU0NSSVBUSU9OCisgICAgRnVudGlvbiB0byBzb3J0IHRoZSBjaGFubmVscyB3aXRoIHRoZSBsZWFzdCB3ZWlnaHQgZmlyc3QgZm9yIDIwTUh6IGNoYW5uZWxzCisKKyAgREVQRU5ERU5DSUVTCisgICAgTkEuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICBwU3BlY3RJbmZvUGFyYW1zICAgICAgIDogUG9pbnRlciB0byB0aGUgdFNhcENoU2VsU3BlY3RJbmZvIHN0cnVjdHVyZQorCisgIFJFVFVSTiBWQUxVRQorICAgIHZvaWQgICAgIDogTlVMTAorCisgIFNJREUgRUZGRUNUUworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIHNhcFNvcnRDaGxXZWlnaHRIVDQwXzI0Ryh0U2FwQ2hTZWxTcGVjdEluZm8gKnBTcGVjdEluZm9QYXJhbXMpCit7CisgICAgdl9VOF90IGksIGo7CisgICAgdFNhcFNwZWN0Q2hJbmZvICpwU3BlY3RJbmZvOworICAgIHZfVTMyX3QgdG1wV2VpZ2h0MSwgdG1wV2VpZ2h0MjsKKworICAgIHBTcGVjdEluZm8gPSBwU3BlY3RJbmZvUGFyYW1zLT5wU3BlY3RDaDsKKyAgICAvKmZvciBlYWNoIEhUNDAgY2hhbm5lbCwgY2FsY3VsYXRlIHRoZSBjb21iaW5lZCB3ZWlnaHQgb2YgdGhlCisgICAgICB0d28gMjBNSHogd2VpZ2h0ICovCisgICAgZm9yIChpID0gMDsgaSA8IEFSUkFZX1NJWkUoYWNzSFQ0MENoYW5uZWxzMjRHKTsgaSsrKQorICAgIHsKKyAgICAgICAgZm9yIChqID0gMDsgaiA8IHBTcGVjdEluZm9QYXJhbXMtPm51bVNwZWN0Q2hhbnM7IGorKykKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKHBTcGVjdEluZm9bal0uY2hOdW0gPT0gYWNzSFQ0MENoYW5uZWxzMjRHW2ldLmNoU3RhcnROdW0pCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGogPT0gcFNwZWN0SW5mb1BhcmFtcy0+bnVtU3BlY3RDaGFucykKKyAgICAgICAgICAgIGNvbnRpbnVlOworCisgICAgICAgIGlmICgocFNwZWN0SW5mb1tqXS5jaE51bSArNCkgPT0gcFNwZWN0SW5mb1tqKzRdLmNoTnVtKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBjaGVjayBpZiB0aGVyZSBpcyBhbm90aGVyIGNoYW5uZWwgY29tYmluYXRpb24gcG9zc2libGl0eQorICAgICAgICAgICAgICAgZS5nLiwgezEsIDV9ICYgezUsIDl9ICovCisgICAgICAgICAgICBpZiAoKHBTcGVjdEluZm9bais0XS5jaE51bSArIDQpPT0gcFNwZWN0SW5mb1tqKzhdLmNoTnVtKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIG5lZWQgdG8gY29tcGFyZSB0d28gY2hhbm5lbCBwYWlycyAqLworICAgICAgICAgICAgICAgIHRtcFdlaWdodDEgPSBwU3BlY3RJbmZvW2pdLndlaWdodCArIHBTcGVjdEluZm9bais0XS53ZWlnaHQ7CisgICAgICAgICAgICAgICAgdG1wV2VpZ2h0MiA9IHBTcGVjdEluZm9bais0XS53ZWlnaHQgKyBwU3BlY3RJbmZvW2orOF0ud2VpZ2h0OworICAgICAgICAgICAgICAgIGlmICh0bXBXZWlnaHQxIDw9IHRtcFdlaWdodDIpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAocFNwZWN0SW5mb1tqXS53ZWlnaHQgPD0gcFNwZWN0SW5mb1tqKzRdLndlaWdodCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcFNwZWN0SW5mb1tqXS53ZWlnaHQgPSB0bXBXZWlnaHQxOworICAgICAgICAgICAgICAgICAgICAgICAgcFNwZWN0SW5mb1tqKzRdLndlaWdodCA9IEFDU19XRUlHSFRfTUFYICogMjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTcGVjdEluZm9bais4XS53ZWlnaHQgPSBBQ1NfV0VJR0hUX01BWCAqIDI7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwU3BlY3RJbmZvW2orNF0ud2VpZ2h0ID0gdG1wV2VpZ2h0MTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTcGVjdEluZm9bal0ud2VpZ2h0ID0gQUNTX1dFSUdIVF9NQVggKiAyOworICAgICAgICAgICAgICAgICAgICAgICAgcFNwZWN0SW5mb1tqKzhdLndlaWdodCA9IEFDU19XRUlHSFRfTUFYICogMjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAocFNwZWN0SW5mb1tqKzRdLndlaWdodCA8PSBwU3BlY3RJbmZvW2orOF0ud2VpZ2h0KQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwU3BlY3RJbmZvW2orNF0ud2VpZ2h0ID0gdG1wV2VpZ2h0MjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTcGVjdEluZm9bal0ud2VpZ2h0ID0gQUNTX1dFSUdIVF9NQVggKiAyOworICAgICAgICAgICAgICAgICAgICAgICAgcFNwZWN0SW5mb1tqKzhdLndlaWdodCA9IEFDU19XRUlHSFRfTUFYICogMjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTcGVjdEluZm9bais4XS53ZWlnaHQgPSB0bXBXZWlnaHQyOworICAgICAgICAgICAgICAgICAgICAgICAgcFNwZWN0SW5mb1tqXS53ZWlnaHQgPSBBQ1NfV0VJR0hUX01BWCAqIDI7CisgICAgICAgICAgICAgICAgICAgICAgICBwU3BlY3RJbmZvW2orNF0ud2VpZ2h0ID0gQUNTX1dFSUdIVF9NQVggKiAyOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHRtcFdlaWdodDEgPSBwU3BlY3RJbmZvW2pdLndlaWdodCArIHBTcGVjdEluZm9bais0XS53ZWlnaHQ7CisgICAgICAgICAgICAgICAgaWYgKHBTcGVjdEluZm9bal0ud2VpZ2h0IDw9IHBTcGVjdEluZm9bais0XS53ZWlnaHQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwU3BlY3RJbmZvW2pdLndlaWdodCA9IHRtcFdlaWdodDE7CisgICAgICAgICAgICAgICAgICAgIHBTcGVjdEluZm9bais0XS53ZWlnaHQgPSBBQ1NfV0VJR0hUX01BWCAqIDI7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBTcGVjdEluZm9bais0XS53ZWlnaHQgPSB0bXBXZWlnaHQxOworICAgICAgICAgICAgICAgICAgICBwU3BlY3RJbmZvW2pdLndlaWdodCA9IEFDU19XRUlHSFRfTUFYICogMjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgICAgcFNwZWN0SW5mb1tqXS53ZWlnaHQgPSBBQ1NfV0VJR0hUX01BWCAqIDI7CisgICAgfQorCisgICAgc2FwU29ydENobFdlaWdodChwU3BlY3RJbmZvUGFyYW1zKTsKK30KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIHNhcFNvcnRDaGxXZWlnaHRIVDQwXzVHCisKKyAgREVTQ1JJUFRJT04KKyAgICBGdW50aW9uIHRvIHNvcnQgdGhlIGNoYW5uZWxzIHdpdGggdGhlIGxlYXN0IHdlaWdodCBmaXJzdCBmb3IgSFQ0MCBjaGFubmVscworCisgIERFUEVOREVOQ0lFUworICAgIE5BLgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcFNwZWN0SW5mb1BhcmFtcyAgICAgICA6IFBvaW50ZXIgdG8gdGhlIHRTYXBDaFNlbFNwZWN0SW5mbyBzdHJ1Y3R1cmUKKworICBSRVRVUk4gVkFMVUUKKyAgICB2b2lkICAgICA6IE5VTEwKKworICBTSURFIEVGRkVDVFMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBzYXBTb3J0Q2hsV2VpZ2h0SFQ0MF81Ryh0U2FwQ2hTZWxTcGVjdEluZm8gKnBTcGVjdEluZm9QYXJhbXMpCit7CisgICAgdl9VOF90IGksIGo7CisgICAgdFNhcFNwZWN0Q2hJbmZvICpwU3BlY3RJbmZvOworCisgICAgcFNwZWN0SW5mbyA9IHBTcGVjdEluZm9QYXJhbXMtPnBTcGVjdENoOworICAgIC8qZm9yIGVhY2ggSFQ0MCBjaGFubmVsLCBjYWxjdWxhdGUgdGhlIGNvbWJpbmVkIHdlaWdodCBvZiB0aGUKKyAgICAgIHR3byAyME1IeiB3ZWlnaHQgKi8KKyAgICBmb3IgKGkgPSAwOyBpIDwgQVJSQVlfU0laRShhY3NIVDQwQ2hhbm5lbHM1Ryk7IGkrKykKKyAgICB7CisgICAgICAgIGZvciAoaiA9IDA7IGogPCBwU3BlY3RJbmZvUGFyYW1zLT5udW1TcGVjdENoYW5zOyBqKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChwU3BlY3RJbmZvW2pdLmNoTnVtID09IGFjc0hUNDBDaGFubmVsczVHW2ldLmNoU3RhcnROdW0pCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGogPT0gcFNwZWN0SW5mb1BhcmFtcy0+bnVtU3BlY3RDaGFucykKKyAgICAgICAgICAgIGNvbnRpbnVlOworCisgICAgICAgIC8qIGZvdW5kIHRoZSBjaGFubmVsLCBhZGQgdGhlIHR3byBhZGphY2VudCBjaGFubmVscycgd2VpZ2h0ICovCisgICAgICAgIGlmICggKHBTcGVjdEluZm9bal0uY2hOdW0gKzQpID09IHBTcGVjdEluZm9baisxXS5jaE51bSkKKyAgICAgICAgeworICAgICAgICAgICAgYWNzSFQ0MENoYW5uZWxzNUdbaV0ud2VpZ2h0ID0gcFNwZWN0SW5mb1tqXS53ZWlnaHQgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTcGVjdEluZm9baisxXS53ZWlnaHQ7CisgICAgICAgICAgICAvKiBzZWxlY3QgYmV0dGVyIG9mIHRoZSBhZGphY3QgY2hhbm5lbCBhcyB0aGUgcHJpbWFyeSBjaGFubmVsICovCisgICAgICAgICAgICBpZiAocFNwZWN0SW5mb1tqXS53ZWlnaHQgPD0gcFNwZWN0SW5mb1tqKzFdLndlaWdodCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwU3BlY3RJbmZvW2pdLndlaWdodCA9IGFjc0hUNDBDaGFubmVsczVHW2ldLndlaWdodDsKKyAgICAgICAgICAgICAgICAvKiBtYXJrIHRoZSBhZGphY2VudCBjaGFubmVsJ3Mgd2VpZ2h0IGFzIG1heCB2YWx1ZSBzbworICAgICAgICAgICAgICAgICAgIHRoYXQgaXQgd2lsbCBiZSBzb3J0ZWQgdG8gdGhlIGJvdHRvbSAqLworICAgICAgICAgICAgICAgIHBTcGVjdEluZm9baisxXS53ZWlnaHQgPSBBQ1NfV0VJR0hUX01BWCAqIDI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFNwZWN0SW5mb1tqKzFdLndlaWdodCA9IGFjc0hUNDBDaGFubmVsczVHW2ldLndlaWdodDsKKyAgICAgICAgICAgICAgICAvKiBtYXJrIHRoZSBhZGphY2VudCBjaGFubmVsJ3Mgd2VpZ2h0IGFzIG1heCB2YWx1ZSBzbworICAgICAgICAgICAgICAgICAgIHRoYXQgaXQgd2lsbCBiZSBzb3J0ZWQgdG8gdGhlIGJvdHRvbSAqLworICAgICAgICAgICAgICAgIHBTcGVjdEluZm9bal0ud2VpZ2h0ID0gQUNTX1dFSUdIVF9NQVggKiAyOworICAgICAgICAgICAgfQorCisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgICBwU3BlY3RJbmZvW2pdLndlaWdodCA9IEFDU19XRUlHSFRfTUFYICogMjsKKyAgICB9CisKKyAgICAvKiBhdm9pZCBjaGFubmVsIDE2NSBieSBzZXR0aW5nIGl0cyB3ZWlnaHQgdG8gbWF4ICovCisgICAgcFNwZWN0SW5mbyA9IHBTcGVjdEluZm9QYXJhbXMtPnBTcGVjdENoOworICAgIGZvciAoaiA9IDA7IGogPCBwU3BlY3RJbmZvUGFyYW1zLT5udW1TcGVjdENoYW5zOyBqKyspCisgICAgeworICAgICAgICBpZiAoIENIQU5ORUxfMTY1ICA9PSBwU3BlY3RJbmZvW2pdLmNoTnVtICkKKyAgICAgICAgeworICAgICAgICAgICAgcFNwZWN0SW5mb1tqXS53ZWlnaHQgPSBBQ1NfV0VJR0hUX01BWCAqIDI7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIHBTcGVjdEluZm8gPSBwU3BlY3RJbmZvUGFyYW1zLT5wU3BlY3RDaDsKKyAgICBmb3IgKGogPSAwOyBqIDwgKHBTcGVjdEluZm9QYXJhbXMtPm51bVNwZWN0Q2hhbnMpOyBqKyspIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAiSW4gJXMsIENoYW5uZWw9JWQgV2VpZ2h0PSAlZCByc3NpPSVkIGJzc0NvdW50PSVkIiwKKyAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHBTcGVjdEluZm8tPmNoTnVtLCBwU3BlY3RJbmZvLT53ZWlnaHQsCisgICAgICAgICAgICAgICAgICAgIHBTcGVjdEluZm8tPnJzc2lBZ3IsIHBTcGVjdEluZm8tPmJzc0NvdW50KTsKKyAgICAgICAgcFNwZWN0SW5mbysrOworICAgIH0KKworICAgIHNhcFNvcnRDaGxXZWlnaHQocFNwZWN0SW5mb1BhcmFtcyk7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgc2FwU29ydENobFdlaWdodEFsbAorCisgIERFU0NSSVBUSU9OCisgICAgRnVudGlvbiB0byBzb3J0IHRoZSBjaGFubmVscyB3aXRoIHRoZSBsZWFzdCB3ZWlnaHQgZmlyc3QKKworICBERVBFTkRFTkNJRVMKKyAgICBOQS4KKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHB0U2FwQ29udGV4dCAgICAgICAgICAgOiBQb2ludGVyIHRvIHRoZSBwdFNhcENvbnRleHQgc3RydWN0dXJlCisgICAgcFNwZWN0SW5mb1BhcmFtcyAgICAgICA6IFBvaW50ZXIgdG8gdGhlIHRTYXBDaFNlbFNwZWN0SW5mbyBzdHJ1Y3R1cmUKKworICBSRVRVUk4gVkFMVUUKKyAgICB2b2lkICAgICA6IE5VTEwKKworICBTSURFIEVGRkVDVFMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBzYXBTb3J0Q2hsV2VpZ2h0QWxsKHB0U2FwQ29udGV4dCBwU2FwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNhcENoU2VsU3BlY3RJbmZvICpwU3BlY3RJbmZvUGFyYW1zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNoYW5uZWxXaWR0aEluZm8gY2hXaWR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R0haX0NIX0NPVU5UOyBpKyspIHsKKyAgICAgICAgbWluV2VpZ2h0SW5kZXggPSBpOworICAgICAgICBmb3IoIGogPSBpICsgMTsgaiA8IFNQRUNUXzI0R0haX0NIX0NPVU5UOyBqKyspIHsKKyAgICAgICAgICAgIGlmKHBTcGVjdENoW2pdLndlaWdodCA8IHBTcGVjdENoW21pbldlaWdodEluZGV4XS53ZWlnaHQpIHsKKyAgICAgICAgICAgICAgICBtaW5XZWlnaHRJbmRleCA9IGo7IAorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmKG1pbldlaWdodEluZGV4ICE9IGkpIHsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSgmdGVtcCwgJnBTcGVjdENoW21pbldlaWdodEluZGV4XSwgc2l6ZW9mKCpwU3BlY3RDaCkpOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwU3BlY3RDaFttaW5XZWlnaHRJbmRleF0sICZwU3BlY3RDaFtpXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoKnBTcGVjdENoKSk7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnBTcGVjdENoW2ldLCAmdGVtcCwgc2l6ZW9mKCpwU3BlY3RDaCkpOworICAgICAgICB9CisgICAgfQorI2VuZGlmCisKKyAgICAvKiBGb3IgdGVzdGluZyAqLworICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgIkluICVzLCBTb3J0ZWQgU3BlY3RydW0gQ2hhbm5lbHMgV2VpZ2h0IiwgX19mdW5jX18pOworICAgIHBTcGVjdENoID0gcFNwZWN0SW5mb1BhcmFtcy0+cFNwZWN0Q2g7CisgICAgZm9yIChqID0gMDsgaiA8IChwU3BlY3RJbmZvUGFyYW1zLT5udW1TcGVjdENoYW5zKTsgaisrKSB7CisgICAgICA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ZKQorICAgIHsKKyAgICAgICAgaWYgKGNiTW9kZSkKKyAgICAgICAgICAgIGNoV2lkdGggPSBDSFdJRFRIX0hUNDA7CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGNoV2lkdGggPSBDSFdJRFRIX0hUMjA7CisgICAgfQorICAgIGVsc2UgaWYgKHBTYXBDdHgtPmNzclJvYW1Qcm9maWxlLnBoeU1vZGUgPT0gZVNBUF9ET1QxMV9NT0RFXzExYWMgfHwKKyAgICAgICAgcFNhcEN0eC0+Y3NyUm9hbVByb2ZpbGUucGh5TW9kZSA9PSBlU0FQX0RPVDExX01PREVfMTFhY19PTkxZKSB7CisgICAgICAgIGNoV2lkdGggPSBDSFdJRFRIX0hUODA7CisgICAgfQorICAgIGVsc2UgeworICAgICAgICAvKiBTb3J0aW5nIHRoZSBjaGFubmVscyBhcyBwZXIgd2VpZ2h0cyBhcyAyME1IeiBjaGFubmVscyAqLworICAgICAgICBjaFdpZHRoID0gQ0hXSURUSF9IVDIwOworICAgIH0KKworICAgIHJldHVybiBjaFdpZHRoOworfQorLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBzYXBTZWxlY3RDaGFubmVsCisKKyAgREVTQ1JJUFRJT04gCisgICAgUnVucyBhIGFsZ29yaXRobSB0byBzZWxlY3QgdGhlIGJlc3QgY2hhbm5lbCB0byBvcGVyYXRlIGluIGJhc2VkIG9uIEJTUyAKKyAgICByc3NpIGFuZCBic3MgY291bnQgb24gZWFjaCBjaGFubmVsCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICBOQS4gCisKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgaGFsSGFuZGxlICAgICAgIDogUG9pbnRlciB0byBIQUwgaGFuZGxlCisgICAgcFJlc3VsdCAgICAgICAgIDogUG9pbnRlciB0byB0U2NhblJlc3VsdEhhbmRsZQorICAgCisgIF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aE51bSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY29udGludWU7IC8vc2tpcCB0aGlzIGNoYW5uZWwsIGNvbnRpbnVlIHRvIG5leHQgY2hhbm5lbAorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYoYmVzdENoTnVtID09IFNBUF9DSEFOTkVMX05PVF9TRUxFQ1RFRCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBiZXN0Q2hOdW0gPSBwU3BlY3RJbmZvUGFyYW1zLT5wU3BlY3RDaFtjb3VudF0uY2hOdW07CisgICAgICAgICAgICAgICAgLyogY2hlY2sgaWYgYmVzdENoTnVtIGlzIGluIHByZWZlcnJlZCBjaGFubmVsIGxpc3QgKi8KKyAgICAgICAgICAgICAgICBiZXN0Q2hOdW0gPSBzYXBTZWxlY3RQcmVmZXJyZWRDaGFubmVsRnJvbUNoYW5uZWxMaXN0KAorICAgICAgICAgICAgICAgICAgICAgICAgYmVzdENoTnVtLCBwU2FwQ3R4LCBwU3BlY3RJbmZvUGFyYW1zKTsKKyAgICAgICAgICAgICAgICBpZiAoYmVzdENoTnVtID09IFNBUF9DSEFOTkVMX05PVF9TRUxFQ1RFRCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qIG5vdCBpbiBwcmVmZXJyZWQgY2hhbm5lbCBsaXN0LCBnbyB0byBuZXh0IGJlc3QgY2hhbm5lbCovCisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChwU3BlY3RJbmZvUGFyYW1zLT5wU3BlY3RDaFtjb3VudF0ud2VpZ2h0X2NvcHkgPgorICAgICAgICAgICAgICAgICAgICAgICAgcFNhcEN0eC0+YWNzQmFuZFN3aXRjaFRocmVzaG9sZCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qIHRoZSBiZXN0IGNoYW5uZWwgZXhjZWVkcyB0aGUgdGhyZXNob2xkCisgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrIGlmIG5lZWQgdG8gc2NhbiBuZXh0IGJhbmQgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKChlQ1NSX0JBTkRfQUxMICE9ICBwU2FwQ3R4LT5zY2FuQmFuZFByZWZlcmVuY2UpICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIXBTYXBDdHgtPmFsbEJhbmRTY2FubmVkKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvKiBzdG9yZSBiZXN0IGNoYW5uZWwgZm9yIGxhdGVyIGNvbXBhcmlzb24gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIHBTYXBDdHgtPmFjc0Jlc3RDaGFubmVsSW5mby5jaGFubmVsTnVtID0gYmVzdENoTnVtOworICAgICAgICAgICAgICAgICAgICAgICAgcFNhcEN0eC0+YWNzQmVzdENoYW5uZWxJbmZvLndlaWdodCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNwZWN0SW5mb1BhcmFtcy0+cFNwZWN0Q2hbY291bnRdLndlaWdodDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJlc3RDaE51bSA9IFNBUF9DSEFOTkVMX05PVF9TRUxFQ1RFRDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLyogYWxsIGJhbmRzIGFyZSBzY2FubmVkLCBjb21wYXJlIGN1cnJlbnQgYmVzdCBjaGFubmVsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoIGNoYW5uZWwgc2Nhbm5lZCBwcmV2aW91c2x5ICovCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIHBTcGVjdEluZm9QYXJhbXMtPnBTcGVjdENoW2NvdW50XS53ZWlnaHRfY29weSA+CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTYXBDdHgtPmFjc0Jlc3RDaGFubmVsSW5mby53ZWlnaHQpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogcHJldmlvdXMgc3RvcmVkIGNoYW5uZWwgaXMgYmV0dGVyICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmVzdENoTnVtID0gcFNhcEN0eC0+YWNzQmVzdENoYW5uZWxJbmZvLmNoYW5uZWxOdW07CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNhcEN0eC0+YWNzQmVzdENoYW5uZWxJbmZvLmNoYW5uZWxOdW0gPSBiZXN0Q2hOdW07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNhcEN0eC0+YWNzQmVzdENoYW5uZWxJbmZvLndlaWdodCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTcGVjdEluZm9QYXJhbXMtPnBTcGVjdENoW2NvdW50XS53ZWlnaHRfY29weTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZihvcGVyYXRpbmdCYW5kID09IFJGX1NVQkJBTkRfMl80X0dIWikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qIEdpdmUgcHJlZmVyZW5jZSB0byBOb24tb3ZlcmxhcCBjaGFubmVscyAqLworICAgICAgICAgICAgICAgICAgICBpZigoKHBTcGVjdEluZm9QYXJhbXMtPnBTcGVjdENoW2NvdW50XS5jaE51bSA9PSBDSEFOTkVMXzEpIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwU3BlY3RJbmZvUGFyYW1zLT5wU3BlY3RDaFtjb3VudF0uY2hOdW0gPT0gQ0hBTk5FTF82KSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocFNwZWN0SW5mb1BhcmFtcy0+cFNwZWN0Q2hbY291bnRdLmNoTnVtID09IENIQU5ORUxfMTEpKSYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBTcGVjdEluZm9QYXJhbXMtPnBTcGVjdENoW2NvdW50XS53ZWlnaHRfY29weSA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2FwQ3R4LT5hY3NCZXN0Q2hhbm5lbEluZm8ud2VpZ2h0KSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgdG1wQ2hOdW0gPSBwU3BlY3RJbmZvUGFyYW1zLT5wU3BlY3RDaFtjb3VudF0uY2hOdW07CisgICAgICAgICAgICAgICAgICAgICAgICB0bXBDaE51bSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2FwU2VsZWN0UHJlZmVycmVkQ2hhbm5lbEZyb21DaGFubmVsTGlzdCh0bXBDaE51bSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTYXBDdHgsIHBTcGVjdEluZm9QYXJhbXMpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCB0bXBDaE51bSAhPSBTQVBfQ0hBTk5FTF9OT1RfU0VMRUNURUQpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmVzdENoTnVtID0gdG1wQ2hOdW07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgIH0K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4gU0FQIG1vZHVsZXMKKyAgZnVuY3Rpb25zIGZvciBjaGFubmVsIHNlbGVjdGlvbi4KKworICBERVBFTkRFTkNJRVM6ICAgCisgIAorCisgIEFyZSBsaXN0ZWQgZm9yIGVhY2ggQVBJIGJlbG93LiAKKyAgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgIEVESVQgSElTVE9SWSBGT1IgRklMRQorCisKKyAgVGhpcyBzZWN0aW9uIGNvbnRhaW5zIGNvbW1lbnRzIGRlc2NyaWJpbmcgY2hhbmdlcyBtYWRlIHRvIHRoZSBtb2R1bGUuCisgIE5vdGljZSB0aGF0IGNoYW5nZXMgYXJlIGxpc3RlZCBpbiByZXZlcnNlIGNocm9ub2xvZ2ljYWwgb3JkZXIuCisKKworCisgIHdoZW4gICAgICAgICAgICAgd2hvICAgICAgIHdoYXQsIHdoZXJlLCB3aHkKKy0tLS0tLS0tLS0gICAgICAgLS0tLS0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKzIwMTAtMDMtMTUgICAgICAgIFNvZnRBUCAgICBDcmVhdGVkIG1vZHVsZQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgSW5jbHVkZSBGaWxlcworLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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b24gb2YgdGhlIFdMQU4gU0FQIEZpbml0ZQorICBTdGF0ZSBNYWNoaW5lIG1vZHVsZXMKKworICBERVBFTkRFTkNJRVM6CisKKyAgQXJlIGxpc3RlZCBmb3IgZWFjaCBBUEkgYmVsb3cuCisKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgIEVESVQgSElTVE9SWSBGT1IgRklMRQorCisKKyAgVGhpcyBzZWN0aW9uIGNvbnRhaW5zIGNvbW1lbnRzIGRlc2NyaWJpbmcgY2hhbmdlcyBtYWRlIHRvIHRoZSBtb2R1bGUuCisgIE5vdGljZSB0aGF0IGNoYW5nZXMgYXJlIGxpc3RlZCBpbiByZXZlcnNlIGNocm9ub2xvZ2ljYWwgb3JkZXIuCisKKworCisgIHdoZW4gICAgICAgIHdobyAgICAgd2hhdCwgd2hlcmUsIHdoeQorLS0tLS0tLS0tLSAgICAtLS0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKzIwMTAtMDMtMTUgICAgICAgICBDcmVhdGVkIG1vZHVsZQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICogSW5jbHVkZSBGaWxlcworICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgc2FwRXZlbnRJbml0CisKKyAgREVTQ1JJUFRJT04KKyAgICBGdW5jdGlvbiBmb3IgaW5pdGlhbGl6aW5nIHNXTEFOX1NBUEV2ZW50IHN0cnVjdHVyZQorCisgIERFUEVOREVOQ0lFUworICAgIE5BLgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgc2FwRXZlbnQgICAgOiBTdGF0ZSBtYWNoaW5lIGV2ZW50CisKKyAgUkVUVVJOIFZBTFVFCisKKyAgICBOb25lCisKKyAgU0lERSBFRkZFQ1RTCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3N0YXRpYyBpbmxpbmUgdm9pZCBzYXBFdmVudEluaXQocHRXTEFOX1NBUEV2ZW50IHNhcEV2ZW50KQoreworICAgc2FwRXZlbnQtPmV2ZW50ID0gZVNBUF9NQUNfU0NBTl9DT01QTEVURTsKKyAgIHNhcEV2ZW50LT5wYXJhbXMgPSAwOworICAgc2FwRXZlbnQtPnUxID0gMDsKKyAgIHNhcEV2ZW50LT51MiA9IDA7Cit9CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfQVBfSFQ0MF8yNEcKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgc2FwU2V0T2Jzc1Bhcm0KKworICBERVNDUklQVElPTgorICAgIEZ1bmN0aW9uIGZvciBTZXR0aW5nIE9CU1MgU2NhbiBpbnRlcnZhbCAmIE9CU1MgVFJBTlNfREVMQVlfRkFDVE9SCisKKyAgREVQRU5ERU5DSUVTCisgICAgTkEuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICBzYXBDb250ZXh0ICA6IFNhcCBDb250ZXh0IHZhbHVlCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIFZPU19TVEFUVVMgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uCisKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6IFN1Y2Nlc3MKKworICBTSURFIEVGRkVDVFMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBzYXBTZXRPYnNzUGFybShwdFNhcENvbnRleHQgc2FwQ29udGV4dCkKK3sKKyAgICB0SGFsSGFuZGxlIGhIYWw7CisgICAgdHBBbmlTaXJHbG9iYWwgcE1hYzsKKyAgICB0QU5JX1UzMiBjZmdWYWx1ZTsKKworICAgIC8qIHRIYWxIYW5kbGUgKi8KKyAgICBoSGFsID0gVk9TX0dFVF9IQUxfQ0Ioc2FwQ29udGV4dC0+cHZvc0dDdHgpOworCisgICAgaWYgKE5VTEwgPT0gaEhhbCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICBGTCgiSW52YWxpZCBoSGFsIikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgcE1hYyA9IFBNQUNfU1RSVUNUKCBoSGFsICk7CisKKyAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19PQlNTX0hUNDBfU0NBTl9XSURUSF9UUklHR0VSX0lOVEVSVkFMLAorICAgICAgICAgICAgICAgICAgICAgICAmY2ZnVmFsdWUpICE9IGVTSVJfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICBGTCgiRmFpbCB0byByZXRyaWV2ZSIKKyAgICAgICAgICAgICAgICAiV05JX0NGR19PQlNTX0hUNDBfU0NBTl9XSURUSF9UUklHR0VSX0lOVEVSVkFMIHZhbHVlIikpOworICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBzYXBDb250ZXh0LT5PYnNzU2NhbkludGVydmFsID0gY2ZnVmFsdWU7CisKKyAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywKKyAgICAgICAgICBXTklfQ0ZHX09CU1NfSFQ0MF9XSURUSF9DSEFOTkVMX1RSQU5TSVRJT05fREVMQVlfRkFDVE9SLAorICAgICAgICAgICAgICAgICAgICAgICAmY2ZnVmFsdWUpICE9IGVTSVJfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgRkwoIkZhaWwgdG8gcmV0cmlldmUiCisgICAgICAgICAgICAgICJXTklfQ0ZHX09CU1NfSFQ0MF9XSURUSF9DSEFOTkVMX1RSQU5TSVRJT05fREVMQVlfRkFDVE9SIHZhbHVlIikpOworICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBzYXBDb250ZXh0LT5PYnNzVHJhbnNpdGlvbkRlbGF5RmFjdG9yID0gY2ZnVmFsdWU7CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgIEZMKCJPYnNzU2NhbkludGVydmFsOiAlZCIKKyAgICAgICAgICAgICAgICAgIiBPYnNzVHJhbnNpdGlvbkRlbGF5RmFjdG9yOiAlZCIpLAorICAgICAgICAgICAgICAgc2FwQ29udGV4dC0+T2Jzc1NjYW5JbnRlcnZhbCwKKyAgICAgICAgICAgICAgIHNhcENvbnRleHQtPk9ic3NUcmFuc2l0aW9uRGVsYXlGYWN0b3IpOworCisgICAgcmV0dXJuOworfQorI2VuZGlmCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBzYXBHb3RvQ2hhbm5lbFNlbAorCisgIERFU0NSSVBUSU9OCisgICAgRnVuY3Rpb24gZm9yIGluaXRpYXRpbmcgc2NhbiByZXF1ZXN0IGZvciBTTUUKKworICBERVBFTkRFTkNJRVMKKyAgICBOQS4KKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHNhcENvbnRleHQgIDogU2FwIENvbnRleHQgdmFsdWUKKyAgICBzYXBFdmVudCAgICA6IFN0YXRlIG1hY2hpbmUgZXZlbnQKKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgVk9TX1NUQVRVUyBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogU3VjY2VzcworCisgIFNJREUgRUZGRUNUUworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitzYXBHb3RvQ2hhbm5lbFNlbAorKAorICAgIHB0U2FwQ29udGV4dCBzYXBDb250ZXh0LAorICAgIHB0V0xBTl9TQVBFdmVudCBzYXBFdmVudAorKQoreworICAgIC8qIEluaXRpYXRlIGEgU0NBTiByZXF1ZXN0ICovCisgICAgZUhhbFN0YXR1cyBoYWxTdGF0dXM7CisgICAgdENzclNjYW5SZXF1ZXN0IHNjYW5SZXF1ZXN0Oy8qIFRvIGJlIGluaXRpYWxpc2VkIGlmIHNjYW4gaXMgcmVxdWlyZWQgKi8KKyAgICB2X1UzMl90ICAgIHNjYW5SZXF1ZXN0SUQgPSAwOworICAgIFZPU19TVEFUVVMgdm9zU3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRV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ICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgIEZMKCJBdXRvIENoYW5uZWwgU2VsZWN0aW9uIFNjYW4iKSk7CisKKyAgICAgICAgaGFsU3RhdHVzID0gc21lX1NjYW5SZXF1ZXN0KGhIYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwvL05vdCB1c2VkIGluIGNzclNjYW5SZXF1ZXN0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnNjYW5SZXF1ZXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICZzY2FuUmVxdWVzdElELC8vLCB3aGVuIElEID09IDAgMTFEIHNjYW4vYWN0aXZlIHNjYW4gd2l0aCBjYWxsYmFjaywgbWluLW1heENobnRpbWUgc2V0IGluIGNzclNjYW5SZXF1ZXN0KCk/CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJldMQU5TQVBfU2NhbkNhbGxiYWNrLC8vY3NyU2NhbkNvbXBsZXRlQ2FsbGJhY2sgY2FsbGJhY2ssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2FwQ29udGV4dCk7Ly92b2lkICogcENvbnRleHQgc2NhblJlcXVlc3RJRCBmaWxsZWQgdXAKKyAgICAgICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gaGFsU3RhdHVzKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIEZMKCJBdXRvIENoYW5uZWwgU2VsZWN0aW9uIFNjYW4gIGZhaWwgJWQhISEiKSwgaGFsU3RhdHVzKTsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICBGTCgiU29mdEFQIENvbmZpZ3VyaW5nIGZvciBkZWZhdWx0IGNoYW5uZWwsIENoPSAlZCIpLAorICAgICAgICAgICAgICAgICAgc2FwQ29udGV4dC0+Y2hhbm5lbCk7CisgICAgICAgICAgICAvKiBJbiBjYXNlIG9mIGVycm9yLCBzd2l0Y2ggdG8gZGVmYXVsdCBjaGFubmVsICovCisgICAgICAgICAgICBzYXBDb250ZXh0LT5jaGFubmVsID0gU0FQX0RFRkFVTFRfQ0hBTk5FTDsKKyNpZmRlZiBTT0ZUQVBfQ0hBTk5FTF9SQU5HRQorICAgICAgICAgICAgaWYoc2FwQ29udGV4dC0+Y2hhbm5lbExpc3QgIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBmb3IgKCBpID0gMCA7IGkgPCBzYXBDb250ZXh0LT5udW1vZkNoYW5uZWwgOyBpKyspCisgICAgICAgICAgICAgICAgICAgIGlmIChOVl9DSEFOTkVMX0VOQUJMRSA9PQorICAgICAgICAgICAgICAgICAgICAgICAgdm9zX252X2dldENoYW5uZWxFbmFibGVkU3RhdGUoc2FwQ29udGV4dC0+Y2hhbm5lbExpc3RbaV0pKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzYXBDb250ZXh0LT5jaGFubmVsID0gc2FwQ29udGV4dC0+Y2hhbm5lbExpc3RbaV07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHNhcENvbnRleHQtPmNoYW5uZWxMaXN0KTsKKyAgICAgICAgICAgICAgICAgICAgc2FwQ29udGV4dC0+Y2hhbm5lbExpc3QgPSBOVUxMOworICAgICAgICAgICAgfQorI2lmZGVmIEZFQVRVUkVfV0xBTl9DSF9BVk9JRAorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGZvciggaSA9IDA7IGkgPCBOVU1fMjBNSFpfUkZfQ0hBTk5FTFM7IGkrKyApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZigoTlZfQ0hBTk5FTF9FTkFCTEUgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgIHZvc19udl9nZXRDaGFubmVsRW5hYmxlZFN0YXRlKHNhZmVDaGFubmVsc1tpXS5jaGFubmVsTnVtYmVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAoVk9TX1RSVUUgPT0gc2FmZUNoYW5uZWxzW2ldLmlzU2FmZSkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNhcENvbnRleHQtPmNoYW5uZWwgPSBzYWZlQ2hhbm5lbHNbaV0uY2hhbm5lbE51bWJlcjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorI2VuZGlmCisjZW5kaWYKKyAgICAgICAgICAgIC8qIEZpbGwgaW4gdGhlIGV2ZW50IHN0cnVjdHVyZSAqLworICAgICAgICAgICAgc2FwRXZlbnRJbml0KHNhcEV2ZW50KTsKKyAgICAgICAgICAgIC8qIEhhbmRsZSBldmVudCAqLworICAgICAgICAgICAgdm9zU3RhdHVzID0gc2FwRnNtKHNhcENvbnRleHQsIHNhcEV2ZW50KTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICBGTCgiQXV0byBDaGFubmVsIFNlbGVjdGlvbiBTY2FuIFN1Y2Nlc3MiCisgICAgICAgICAgICAgICAgICAgICAiIHNjYW5SZXF1ZXN0SUQ9JWQsIENoPSAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgc2NhblJlcXVlc3RJRCwgc2FwQ29udGV4dC0+Y2hhbm5lbCk7CisgICAgICAgIH0KKworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgRkwoIkZvciBjb25maWd1cmVkIGNoYW5uZWwsIENoPSAlZCIpLCBzYXBDb250ZXh0LT5jaGFubmVsKTsKKworI2lmZGVmIFdMQU5fRkVBVFVSRV9BUF9IVDQwXzI0RworICAgICAgICBpZiAodm9zX2dldF9jb25jdXJyZW5jeV9tb2RlKCkgIT0gVk9TX1NUQV9TQVApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmICgoc2FwQ29udGV4dC0+Y2hhbm5lbCA8PSBTSVJfMTFCX0NIQU5ORUxfRU5EKQorICAgICAgICAgICAgICAmJiAoc2FwQ29udGV4dC0+Y2hhbm5lbCA+IFJGX0NIQU5fMSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gT0JTUyBTY2FuIGZvciBQMlAgR08vU0FQIHdoZXJlIEF1dG8gQ2hhbm5lbCBTZWxlY3Rpb24gaXMgRGlzYWJsZQorICAgICAgICAgICAgICAgIHZvc1N0YXR1cyA9IHNhcEdldENoYW5uZWxMaXN0Rm9yT2JzcyhoSGFsLCBzYXBDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmNoYW5uZWxMaXN0LCAmbnVtT2ZDaGFubmVscyk7CisgICAgICAgICAgICAgICAgaWYgKFZPU19TVEFUVVNfU1VDQ0VTUyA9PSB2b3NTdGF0dXMgJiYgY2hhbm5lbExpc3QgIT0gTlVMTCkKKyAgICAgICAgICAgICAgICB7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNhcENoZWNrSFQ0MFNlY29uZGFyeUlzTm90QWxsb3dlZChzYXBDb250ZXh0KSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYoY2hhbm5lbExpc3QgIT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShjaGFubmVsTGlzdCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsTGlzdCA9IE5VTEw7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGRpc2FibGUyNEdDaGFubmVsQm9uZGluZzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX3plcm8oJnNjYW5SZXF1ZXN0LCBzaXplb2Yoc2NhblJlcXVlc3QpKTsKKworICAgICAgICAgICAgICAgICAgICAvKiBTZXQgc2NhblR5cGUgdG8gUGFzc2l2ZSBzY2FuICovCisgICAgICAgICAgICAgICAgICAgIHNjYW5SZXF1ZXN0LnNjYW5UeXBlID0gZVNJUl9QQVNTSVZFX1NDQU47CisKKyAgICAgICAgICAgICAgICAgICAgLyogU2V0IG1pbiBhbmQgbWF4IGNoYW5uZWwgdGltZSB0byB6ZXJvICovCisgICAgICAgICAgICAgICAgICAgIHNjYW5SZXF1ZXN0Lm1pbkNoblRpbWUgPSBDU1JfQUNUSVZFX01JTl9DSEFOTkVMX1RJTUU7CisgICAgICAgICAgICAgICAgICAgIHNjYW5SZXF1ZXN0Lm1heENoblRpbWUgPSBDU1JfQUNUSVZFX01BWF9DSEFOTkVMX1RJTUU7CisKKyAgICAgICAgICAgICAgICAgICAgLyogU2V0IEJTU1R5cGUgdG8gZGVmYXVsdCB0eXBlICovCisgICAgICAgICAgICAgICAgICAgIHNjYW5SZXF1ZXN0LkJTU1R5cGUgPSBlQ1NSX0JTU19UWVBFX0FOWTsKKworICAgICAgICAgICAgICAgICAgICAvKlNjYW4gdGhlIGNoYW5uZWxzIGluIHRoZSBsaXN0Ki8KKyAgICAgICAgICAgICAgICAgICAgc2NhblJlcXVlc3QuQ2hhbm5lbEluZm8ubnVtT2ZDaGFubmVscyA9IG51bU9mQ2hhbm5lbHM7CisgICAgICAgICAgICAgICAgICAgIHNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0ID0gY2hhbm5lbExpc3Q7CisgICAgICAgICAgICAgICAgICAgIHNjYW5SZXF1ZXN0LnJlcXVlc3RUeXBlID0gZUNTUl9TQ0FOX1NPRlRBUF9DSEFOTkVMX1JBTkdFOworICAgICAgICAgICAgICAgICAgICBzYXBDb250ZXh0LT5jaGFubmVsTGlzdCA9IGNoYW5uZWxMaXN0OworCisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJPQlNTIFNjYW4gZm9yIFNBUC9QMlAgR086ICBDaD0gJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzYXBDb250ZXh0LT5jaGFubmVsKTsKKworICAgICAgICAgICAgICAgICAgICBoYWxTdGF0dXMgPSBzbWVfU2NhblJlcXVlc3QoaEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsLy9Ob3QgdXNlZCBpbiBjc3JTY2FuUmVxdWVzdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnNjYW5SZXF1ZXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnNjYW5SZXF1ZXN0SUQsLy8sIHdoZW4gSUQgPT0gMCAxMUQgc2Nhbi9hY3RpdmUgc2NhbiB3aXRoIGNhbGxiYWNrLCBtaW4tbWF4Q2hudGltZSBzZXQgaW4gY3NyU2NhblJlcXVlc3QoKT8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZXTEFOU0FQX1NjYW5DYWxsYmFjaywvL2NzclNjYW5Db21wbGV0ZUNhbGxiYWNrIGNhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2FwQ29udGV4dCk7Ly92b2lkICogcENvbnRleHQgc2NhblJlcXVlc3RJRCBmaWxsZWQgdXAKKworICAgICAgICAgICAgICAgICAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSBoYWxTdGF0dXMpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJPQlNTIFNjYW5SZXF1ZXN0IEZhaWwgJWQhISEiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYWxTdGF0dXMpOworICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiU29mdEFQIENvbmZpZ3VyaW5nIGZvciBkZWZhdWx0IGNoYW5uZWwsIENoPSAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgc2FwQ29udGV4dC0+Y2hhbm5lbCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNhcENvbnRleHQtPmNoYW5uZWxMaXN0ICE9IE5VTEwpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUoc2FwQ29udGV4dC0+Y2hhbm5lbExpc3QpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgc2FwQ29udGV4dC0+Y2hhbm5lbExpc3QgPSBOVUxMOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZ290byBkaXNhYmxlMjRHQ2hhbm5lbEJvbmRpbmc7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiT0JTUyBTY2FuUmVxdWVzdCBTdWNjZXNzLCBzY2FuUmVxdWVzdElEPSVkIgorICAgICAgICAgICAgICAgICAgICAgICAgICAiIENoPSAlZCIpLCBzY2FuUmVxdWVzdElELCBzYXBDb250ZXh0LT5jaGFubmVsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gc3RhcnRnbzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICBGTCgiRmFpbGVkIHRvIFByZXBhcmUgdGhlIE9CU1MgU2NhbiBjaGFubmVsIGxpc3QiKSk7CisgICAgICAgICAgICAgICAgICAgIGdvdG8gZGlzYWJsZTI0R0NoYW5uZWxCb25kaW5nOworICAgICAgICAgICAgICAgIH0KK2Rpc2FibGUyNEdDaGFubmVsQm9uZGluZzoKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgIEZMKCJEaXNhYmxlIENoYW5uZWwgQm9uZGluZyIpKTsKKyAgICAgICAgICAgICAgICAvKiBEaXNhYmxlIENoYW5uZWwgQm9uZGluZyBmb3IgMi40R0h6ICovCisgICAgICAgICAgICAgICAgc21lX1VwZGF0ZUNoYW5uZWxCb25kaW5nTW9kZTI0RyhoSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUEhZX1NJTkdMRV9DSEFOTkVMX0NFTlRFUkVEKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgIEZMKCJObyBjb25jdXJyZW5jeSAmIENoYW5uZWw6ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgc2FwQ29udGV4dC0+Y2hhbm5lbCk7CisgICAgICAgICAgICAgICBnb3RvIHNlbGVjdENoYW5uZWxCb25kaW5nOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICBGTCgiV2l0aCBjb25jdXJyZW5jeSAmIENoYW5uZWw6ICVkIiksCisgICAgICAgICAgICAgICAgICBzYXBDb250ZXh0LT5jaGFubmVsKTsKKyAgICAgICAgICAgIGdvdG8gc2VsZWN0Q2hhbm5lbEJvbmRpbmc7CisgICAgICAgIH0KKyNlbmRpZgorCisjaWZkZWYgV0xBTl9GRUFUVVJFX0FQX0hUNDBfMjRHCitzZWxlY3RDaGFubmVsQm9uZGluZzoKKyAgICAgICAgICAgIGlmIChzYXBDb250ZXh0LT5jaGFubmVsID4gU0lSXzExQl9DSEFOTkVMX0VORCkKKyNlbmRpZgorICAgICAgICAgICAgICAgIHNtZV9TZWxlY3RDQk1vZGUoaEhhbCwgc2FwUGh5TW9kZSwgc2FwQ29udGV4dC0+Y2hhbm5lbCk7CisKKyAgICAgICAgICAgIC8qIEZpbGwgaW4gdGhlIGV2ZW50IHN0cnVjdHVyZSAqLworICAgICAgICAgICAgLy8gRXZlbnRob3VnaCBzY2FuIHdhcyBub3QgZG9uZSwgbWVhbnMgYSB1c2VyIHNldCBjaGFubmVsIHdhcyBjaG9zZW4KKyAgICAgICAgICAgIHNhcEV2ZW50SW5pdChzYXBFdmVudCk7CisgICAgICAgICAgICAvKiBIYW5kbGUgZXZlbnQgKi8KKyAgICAgICAgICAgIHZvc1N0YXR1cyA9IHNhcEZzbShzYXBDb250ZXh0LCBzYXBFdmVudCk7CisgICAgfQorI2lmZGVmIFdMQU5fRkVBVFVSRV9BUF9IVDQwXzI0Rworc3RhcnRnbzoKKyNlbmRpZgorICAgIC8qIElmIHNjYW4gZmFpbGVkLCBnZXQgZGVmYXVsdCBjaGFubmVsIGFuZCBhZHZhbmNlIHN0YXRlCisgICAgICogbWFjaGluZSBhcyBzdWNjZXNzIHdpdGggZGVmYXVsdCBjaGFubmVsLiBIYXZlIHRvIHdhaXQKKyAgICAgKiBmb3IgdGhlIGNhbGwgYmFjayB0byBiZSBjYWxsZWQgdG8gZ2V0IHRoZSBjaGFubmVsIGNhbm5vdAorICAgICAqIGFkdmFuY2Ugc3RhdGUgbWFjaGluZSBoZXJlIGFzIHNhaWQgYWJvdmUgKi8KKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgIEZMKCJCZWZvcmUgZXhpdGluZyBzYXBHb3RvQ2hhbm5lbFNlbCBjaGFubmVsPSVkIiksCisgICAgICAgIHNhcENvbnRleHQtPmNoYW5uZWwpOworCisgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30vLyBzYXBHb3RvQ2hhbm5lbFNlbAorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIHNhcEdvdG9TdGFydGluZworCisgIERFU0NSSVBUSU9OCisgICAgRnVuY3Rpb24gZm9yIGluaXRpYXRpbmcgc3RhcnQgYnNzIHJlcXVlc3QgZm9yIFNNRQorCisgIERFUEVOREVOQ0lFUworICAgIE5BLgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgc2FwQ29udGV4dCAgOiBTYXAgQ29udGV4dCB2YWx1ZQorICAgIHNhcEV2ZW50ICAgIDogU3RhdGUgbWFjaGluZSBldmVudAorICAgIGJzc1R5cGUgICAgIDogVHlwZSBvZiBic3MgdG8gc3RhcnQsIElOUkEgQVAKKyAgICBzdGF0dXMgICAgICA6IFJldHVybiB0aGUgU0FQIHN0YXR1cyBoZXJlCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIFZPU19TVEFUVVMgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uCisKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6IFN1Y2Nlc3MKKworICBTSURFIEVGRkVDVFMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworc2FwR290b1N0YXJ0aW5nCisoCisgICAgcHRTYXBDb250ZXh0IHNhcENvbnRleHQsCisgICAgcHRXTEFOX1NBUEV2ZW50IHNhcEV2ZW50LAorICAgIGVDc3JSb2FtQnNzVHlwZSBic3NUeXBlCispCit7CisgICAgLyogdEhhbEhhbmRsZSAqLworICAgIHRIYWxIYW5kbGUgaEhhbCA9IFZPU19HRVRfSEFMX0NCKHNhcENvbnRleHQtPnB2b3NHQ3R4KTsKKyAgICBlSGFsU3RhdHVzIGhhbFN0YXR1czsKKworICAgIC8qLSAtIC0gLSAtIC0gLSAtIFRPRE86b25jZSBjb25maWdzIGZyb20gaGRkIGF2YWlsYWJsZSAtIC0gLSAtIC0gLSAtIC0gLSovCisgICAgY2hhciBrZXlfbWF0ZXJpYWxbMzJ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uIFNNRSBTZXNzaW9uIGZvciBTb2Z0YXAgKi8KKyAgICBoYWxTdGF0dXMgPSBzbWVfT3BlblNlc3Npb24oaEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICZXTEFOU0FQX1JvYW1DYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgIHNhcENvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICBzYXBDb250ZXh0LT5zZWxmX21hY19hZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgJnNhcENvbnRleHQtPnNlc3Npb25JZCk7CisKKyAgICBpZihlSEFMX1NUQVRVU19TVUNDRVNTICE9IGhhbFN0YXR1cyApCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJFcnJvcjogSW4gJXMgY2FsbGluZyBzbWVfUm9hbUNvbm5lY3Qgc3RhdHVzID0gJWQiLCBfX2Z1bmNfXywgaGFsU3RhdHVzKTsKKyAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgIH0KKworICAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9Ly8gc2FwR290b1N0YXJ0aW5nCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgc2FwR290b0Rpc2Nvbm5lY3RpbmcKKworICBERVNDUklQVElPTgorICAgIFByb2Nlc3Npbmcgb2YgU0FQIEZTTSBEaXNjb25uZWN0aW5nIHN0YXRlCisKKyAgREVQRU5ERU5DSUVTCisgICAgTkEuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICBzYXBDb250ZXh0ICA6IFNhcCBDb250ZXh0IHZhbHVlCisgICAgc3RhdHVzICAgICAgOiBSZXR1cm4gdGhlIFNBUCBzdGF0dXMgaGVyZQorCisg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ST1IsICJFcnJvcjogSW4gJXMgY2FsbGluZyBzbWVfUm9hbVN0b3BCc3Mgc3RhdHVzID0gJWQiLCBfX2Z1bmNfXywgaGFsU3RhdHVzKTsKKyAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgIH0KKworICAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9CisKK3N0YXRpYyBlSGFsU3RhdHVzIHNhcFJvYW1TZXNzaW9uQ2xvc2VDYWxsYmFjayh2b2lkICpwQ29udGV4dCkKK3sKKyAgICBwdFNhcENvbnRleHQgc2FwQ29udGV4dCA9IChwdFNhcENvbnRleHQpcENvbnRleHQ7CisgICAgcmV0dXJuIHNhcFNpZ25hbEhERGV2ZW50KHNhcENvbnRleHQsIE5VTEwsCisgICAgICAgICAgICAgICAgICAgIGVTQVBfU1RPUF9CU1NfRVZFTlQsICh2X1BWT0lEX3QpIGVTQVBfU1RBVFVTX1NVQ0NFU1MpOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIHNhcEdvdG9EaXNjb25uZWN0ZWQKKworICBERVNDUklQVElPTgorICAgIEZ1bmN0aW9uIGZvciBzZXR0aW5nIHRoZSBTQVAgRlNNIHRvIERpc2Nvbm5lY3Rpb24gc3RhdGUKKworICBERVBFTkRFTkNJRVMKKyAgICBOQS4KKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHNhcENvbnRleHQgIDogU2FwIENvbnRleHQgdmFsdWUKKyAgICBzYXBFdmVudCAgICA6IFN0YXRlIG1hY2hpbmUgZXZlbnQKKyAgICBzdGF0dXMgICAgICA6IFJldHVybiB0aGUgU0FQIHN0YXR1cyBoZXJlCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIFZPU19TVEFUVVMgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uCisKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6IFN1Y2Nlc3MKKworICBTSURFIEVGRkVDVFMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworc2FwR290b0Rpc2Nvbm5lY3RlZAorKAorICAgIHB0U2FwQ29udGV4dCBzYXBDb250ZXh0CispCit7CisgICAgVk9TX1NUQVRVUyB2b3NTdGF0dXMgPSBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICB0V0xBTl9TQVBFdmVudCBzYXBFdmVudDsKKyAgICAvLyBQcm9jZXNzaW5nIGhhcyB0byBiZSBjb2RlZAorICAgIC8vIENsZWFuIHVwIHN0YXRpb25zIGZyb20gVEwgZXRjIGFzIEFQIEJTUyBpcyBzaHV0IGRvd24gdGhlbiBzZXQgZXZlbnQKKyAgICBzYXBFdmVudC5ldmVudCA9IGVTQVBfTUFDX1JFQURZX0ZPUl9DT05ORUNUSU9OUzsvLyBoYXJkY29kZWQKKyAgICBzYXBFdmVudC5wYXJhbXMgPSAwOworICAgIHNhcEV2ZW50LnUxID0gMDsKKyAgICBzYXBFdmVudC51MiA9IDA7CisgICAgLyogSGFuZGxlIGV2ZW50ICovCisgICAgdm9zU3RhdHVzID0gc2FwRnNtKHNhcENvbnRleHQsICZzYXBFdmVudCk7CisKKyAgICByZXR1cm4gdm9zU3RhdHVzOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIHNhcFNpZ25hbEhERGV2ZW50CisKKyAgREVTQ1JJUFRJT04KKyAgICBGdW5jdGlvbiBmb3IgSEREIHRvIHNlbmQgdGhlIGV2ZW50IG5vdGlmaWNhdGlvbiB1c2luZyBjYWxsYmFjaworCisgIERFUEVOREVOQ0lFUwor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ZWRNQ0VuY3J5cHRpb25UeXBlID0gcENzclJvYW1JbmZvLT51LnBDb25uZWN0ZWRQcm9maWxlLT5tY0VuY3J5cHRpb25UeXBlOworICAgICAgICAgICAgICAgc2FwQXBBcHBFdmVudC5zYXBldnQuc2FwQXNzb2NJbmRpY2F0aW9uLmZBdXRoUmVxdWlyZWQgPSBwQ3NyUm9hbUluZm8tPmZBdXRoUmVxdWlyZWQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICBjYXNlIGVTQVBfU1RBUlRfQlNTX0VWRU5UOgorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIlNBUCBldmVudCBjYWxsYmFjayBldmVudCA9ICVzIiksCisgICAgICAgICAgICAgICAgICAgICAgICJlU0FQX1NUQVJUX0JTU19FVkVOVCIpOworICAgICAgICAgICAgc2FwQXBBcHBFdmVudC5zYXBIZGRFdmVudENvZGUgPSBlU0FQX1NUQVJUX0JTU19FVkVOVDsKKyAgICAgICAgICAgIHNhcEFwQXBwRXZlbnQuc2FwZXZ0LnNhcFN0YXJ0QnNzQ29tcGxldGVFdmVudC5zdGF0dXMgPSAoZVNhcFN0YXR1cyApY29udGV4dDsKKyAgICAgICAgICAgIGlmKHBDc3JSb2FtSW5mbyAhPSBOVUxMICl7CisgICAgICAgICAgICAgICAgc2FwQXBBcHBFdmVudC5zYXBldnQuc2FwU3RhcnRCc3NDb21wbGV0ZUV2ZW50LnN0YUlkID0gcENzclJvYW1JbmZvLT5zdGFJZDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBzYXBBcEFwcEV2ZW50LnNhcGV2dC5zYXBTdGFydEJzc0NvbXBsZXRlRXZlbnQuc3RhSWQgPSAwOworICAgICAgICAgICAgc2FwQXBBcHBFdmVudC5zYXBldnQuc2FwU3RhcnRCc3NDb21wbGV0ZUV2ZW50Lm9wZXJhdGluZ0NoYW5uZWwgPSAodl9VOF90KXNhcENvbnRleHQtPmNoYW5uZWw7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVTQVBfU1RPUF9CU1NfRVZFTlQ6CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICBGTCgiU0FQIGV2ZW50IGNhbGxiYWNrIGV2ZW50ID0gJXMiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgImVTQVBfU1RPUF9CU1NfRVZFTlQiKTsKKyAgICAgICAgICAgIHNhcEFwQXBwRXZlbnQuc2FwSGRkRXZlbnRDb2RlID0gZVNBUF9TVE9QX0JTU19FVkVOVDsKKyAgICAgICAgICAgIHNhcEFwQXBwRXZlbnQuc2FwZXZ0LnNhcFN0b3BCc3NDb21wbGV0ZUV2ZW50LnN0YXR1cyA9IChlU2FwU3RhdHVzICljb250ZXh0OworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlU0FQX1NUQV9BU1NPQ19FVkVOVDoKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIlNBUCBldmVudCBjYWxsYmFjayBldmVudCA9ICVzIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICJlU0FQX1NUQV9BU1NPQ19FVkVOVCIpOworICAgICAgICAgICAgaWYgKHBDc3JSb2FtSW5mby0+ZlJlYXNzb2NSZXEpCisgICAgICAgICAgICAgICAgc2FwQXBBcHBFdmVudC5zYXBIZGRFdmVudENvZGUgPSBlU0FQX1NUQV9SRUFTU09DX0VWRU5UOworICAgICAgICAgICA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CisgICAgICAgICAgICAgICAgdl9VOF90ICBsZW4gPSBzYXBBcEFwcEV2ZW50LnNhcGV2dC5zYXBTdGF0aW9uQXNzb2NSZWFzc29jQ29tcGxldGVFdmVudC5pZXNMZW47CisgICAgICAgICAgICAgICAgc2FwQXBBcHBFdmVudC5zYXBldnQuc2FwU3RhdGlvbkFzc29jUmVhc3NvY0NvbXBsZXRlRXZlbnQuaWVzTGVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICs9IHBDc3JSb2FtSW5mby0+YWRkSUVMZW47CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZzYXBBcEFwcEV2ZW50LnNhcGV2dC5zYXBTdGF0aW9uQXNzb2NSZWFzc29jQ29tcGxldGVFdmVudC5pZXNbbGVuXSwgcENzclJvYW1JbmZvLT5wYWRkSUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENzclJvYW1JbmZvLT5hZGRJRUxlbik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHNhcEFwQXBwRXZlbnQuc2FwZXZ0LnNhcFN0YXRpb25Bc3NvY1JlYXNzb2NDb21wbGV0ZUV2ZW50LndtbUVuYWJsZWQgPSBwQ3NyUm9hbUluZm8tPndtbUVuYWJsZWRTdGE7CisgICAgICAgICAgICBzYXBBcEFwcEV2ZW50LnNhcGV2dC5zYXBTdGF0aW9uQXNzb2NSZWFzc29jQ29tcGxldGVFdmVudC5zdGF0dXMgPSAoZVNhcFN0YXR1cyApY29udGV4dDsKKyAgICAgICAgICAgIC8vVE9ETzogTmVlZCB0byBmaWxsIHNhcEF1dGhUeXBlCisgICAgICAgICAgICAvL3NhcEFwQXBwRXZlbnQuc2FwZXZ0LnNhcFN0YXRpb25Bc3NvY1JlYXNzb2NDb21wbGV0ZUV2ZW50LlNhcEF1dGhUeXBlID0gcENzclJvYW1JbmZvLT5wUHJvZmlsZS0+bmVnb3RpYXRlZEF1dGhUeXBlOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIGVTQVBfU1RBX0RJU0FTU09DX0VWRU5UOgorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIlNBUCBldmVudCBjYWxsYmFjayBldmVudCA9ICVzIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICJlU0FQX1NUQV9ESVNBU1NPQ19FVkVOVCIpOworICAgICAgICAgICAgc2FwQXBBcHBFdmVudC5zYXBIZGRFdmVudENvZGUgPSBlU0FQX1NUQV9ESVNBU1NPQ19FVkVOVDsKKworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCAmc2FwQXBBcHBFdmVudC5zYXBldnQuc2FwU3RhdGlvbkRpc2Fzc29jQ29tcGxldGVFdmVudC5zdGFNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBDc3JSb2FtSW5mby0+cGVlck1hYywgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgICAgICBzYXBBcEFwcEV2ZW50LnNhcGV2dC5zYXBTdGF0aW9uRGlzYXNzb2NDb21wbGV0ZUV2ZW50LnN0YUlkID0gcENzclJvYW1JbmZvLT5zdGFJZDsKKyAgICAgICAgICAgIGlmIChwQ3NyUm9hbUluZm8tPnJlYXNvbkNvZGUgPT0gZUNTUl9ST0FNX1JFU1VMVF9GT1JDRUQpCisgICAgICAgICAgICAgICAgc2FwQXBBcHBFdmVudC5zYXBldnQuc2FwU3RhdGlvbkRpc2Fzc29jQ29tcGxldGVFdmVudC5yZWFzb24gPSBlU0FQX1VTUl9JTklUQVRFRF9ESVNBU1NPQzsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBzYXBBcEFwcEV2ZW50LnNhcGV2dC5zYXBTdGF0aW9uRGlzYXNzb2NDb21wbGV0ZUV2ZW50LnJlYXNvbiA9IGVTQVBfTUFDX0lOSVRBVEVEX0RJU0FTU09DOworCisgICAgICAgICAgICBzYXBBcEFwcEV2ZW50LnNhcGV2dC5zYXBTdGF0aW9uRGlzYXNzb2NDb21wbGV0ZUV2ZW50LnN0YXR1c0NvZGUgPSBwQ3NyUm9hbUluZm8tPnN0YXR1c0NvZGU7CisgICAgICAgICAgICBzYXBBcEFwcEV2ZW50LnNhcGV2dC5zYXBTdGF0aW9uRGlzYXNzb2NDb21wbGV0ZUV2ZW50LnN0YXR1cyA9IChlU2FwU3RhdHVzICljb250ZXh0OworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlU0FQX1NUQV9TRVRfS0VZX0VWRU5UOgorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIlNBUCBldmVudCBjYWxsYmFjayBldmVudCA9ICVzIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICJlU0FQX1NUQV9TRVRfS0VZX0VWRU5UIik7CisgICAgICAgICAgICBzYXBBcEFwcEV2ZW50LnNhcEhkZEV2ZW50Q29kZSA9IGVTQVBfU1RBX1NFVF9LRVlfRVZFTlQ7CisgICAgICAgICAgICBzYXBBcEFwcEV2ZW50LnNhcGV2dC5zYXBTdGF0aW9uU2V0S2V5Q29tcGxldGVFdmVudC5zdGF0dXMgPSAoZVNhcFN0YXR1cyApY29udGV4dDsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSgmc2FwQXBBcHBFdmVudC5zYXBldnQuc2FwU3RhdGlvblNldEtleUNvbXBsZXRlRXZlbnQucGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgcENzclJvYW1JbmZvLT5wZWVyTWFjLHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlU0FQX1NUQV9ERUxfS0VZX0VWRU5UIDoKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJTQVAgZXZlbnQgY2FsbGJhY2sgZXZlbnQgPSAlcyIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAiZVNBUF9TVEFfREVMX0tFWV9FVkVOVCIpOworICAgICAgICAgICAgc2FwQXBBcHBFdmVudC5zYXBIZGRFdmVudENvZGUgPSBlU0FQX1NUQV9ERUxfS0VZX0VWRU5UOworICAgICAgICAgICAgc2FwQXBBcHBFdmVudC5zYXBldnQuc2FwU3RhdGlvbkRlbGV0ZUtleUNvbXBsZXRlRXZlbnQuc3RhdHVzID0gKGVTYXBTdGF0dXMgKWNvbnRleHQ7CisgICAgICAgICAgICAvL1RPRE86IFNob3VsZCB3ZSBuZWVkIHRvIHNlbmQgdGhlIGtleSBpbmZvcm1hdGlvbgorICAgICAgICAgICAgLy9zYXBBcEFwcEV2ZW50LnNhcGV2dC5zYXBTdGF0aW9uRGVsZXRlS2V5Q29tcGxldGVFdmVudC5rZXlJZCA9IDsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVNBUF9TVEFfTUlDX0ZBSUxVUkVfRVZFTlQgOgorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIlNBUCBldmVudCBjYWxsYmFjayBldmVudCA9ICVzIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICJlU0FQX1NUQV9NSUNfRkFJTFVSRV9FVkVOVCIpOworICAgICAgICAgICAgc2FwQXBBcHBFdmVudC5zYXBIZGRFdmVudENvZGUgPSBlU0FQX1NUQV9NSUNfRkFJTFVSRV9FVkVOVDsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSggJnNhcEFwQXBwRXZlbnQuc2FwZXZ0LnNhcFN0YXRpb25NSUNGYWlsdXJlRXZlbnQuc3JjTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcENzclJvYW1JbmZvLT51LnBNSUNGYWlsdXJlSW5mby0+c3JjTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoICZzYXBBcEFwcEV2ZW50LnNhcGV2dC5zYXBTdGF0aW9uTUlDRmFpbHVyZUV2ZW50LnN0YU1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcENzclJvYW1JbmZvLT51LnBNSUNGYWlsdXJlSW5mby0+dGFNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSggJnNhcEFwQXBwRXZlbnQuc2FwZXZ0LnNhcFN0YXRpb25NSUNGYWlsdXJlRXZlbnQuZHN0TWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcENzclJvYW1JbmZvLT51LnBNSUNGYWlsdXJlSW5mby0+ZHN0TWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgICAgICBzYXBBcEFwcEV2ZW50LnNhcGV2dC5zYXBTdGF0aW9uTUlDRmFpbHVyZUV2ZW50Lm11bHRpY2FzdCA9IHBDc3JSb2FtSW5mby0+dS5wTUlDRmFpbHVyZUluZm8tPm11bHRpY2FzdDsKKyAgICAgICAgICAgIHNhcEFwQXBwRXZlbnQuc2FwZXZ0LnNhcFN0YXRpb25NSUNGYWlsdXJlRXZlbnQuSVYxID0gcENzclJvYW1JbmZvLT51LnBNSUNGYWlsdXJlSW5mby0+SVYxOworICAgICAgICAgICAgc2FwQXBBcHBFdmVudC5zYXBldnQuc2FwU3RhdGlvbk1JQ0ZhaWx1cmVFdmVudC5rZXlJZCA9IHBDc3JSb2FtSW5mby0+dS5wTUlDRmFpbHVyZUluZm8tPmtleUlkOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCBzYXBBcEFwcEV2ZW50LnNhcGV2dC5zYXBTdGF0aW9uTUlDRmFpbHVyZUV2ZW50LlRTQywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcENzclJvYW1JbmZvLT51LnBNSUNGYWlsdXJlSW5mby0+VFNDLAorICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfQ0lQSEVSX1NFUV9DVFJfU0laRSk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVTQVBfQVNTT0NfU1RBX0NBTExCQUNLX0VWRU5UOgorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIlNBUCBldmVudCBjYWxsYmFjayBldmVudCA9ICVzIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICJlU0FQX0FTU09DX1NUQV9DQUxMQkFDS19FVkVOVCIpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlU0FQX1dQU19QQkNfUFJPQkVfUkVRX0VWRU5UOgorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIlNBUCBldmVudCBjYWxsYmFjayBldmVudCA9ICVzIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICJlU0FQX1dQU19QQkNfUFJPQkVfUkVRX0VWRU5UIik7CisgICAgICAgICAgICBzYXBBcEFwcEV2ZW50LnNhcEhkZEV2ZW50Q29kZSA9IGVTQVBfV1BTX1BCQ19QUk9CRV9SRVFfRVZFTlQ7CisKKyAgICAgICAgICAgIHZvc19tZW1fY29weSggJnNhcEFwQXBwRXZlbnQuc2FwZXZ0LnNhcFBCQ1Byb2JlUmVxRXZlbnQuV1BTUEJDUHJvYmVSZXEsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBDc3JSb2FtSW5mby0+dS5wV1BTUEJDUHJvYmVSZXEsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyV1BTUEJDUHJvYmVSZXEpKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgIGNhc2UgZVNBUF9SRU1BSU5fQ0hBTl9SRUFEWToKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJTQVAgZXZlbnQgY2FsbGJhY2sgZXZlbnQgPSAlcyIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAiZVNBUF9SRU1BSU5fQ0hBTl9SRUFEWSIpOworICAgICAgICAgICBzYXBBcEFwcEV2ZW50LnNhcEhkZEV2ZW50Q29kZSA9IGVTQVBfUkVNQUlOX0NIQU5fUkVBRFk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICBjYXNlIGVTQVBfU0VORF9BQ1RJT05fQ05GOgorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIlNBUCBldmVudCBjYWxsYmFjayBldmVudCA9ICVzIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICJlU0FQX1NFTkRfQUNUSU9OX0NORiIpOworICAgICAgICAgICAgc2FwQXBBcHBFdmVudC5zYXBIZGRFdmVudENvZGUgPSBlU0FQX1NFTkRfQUNUSU9OX0NORjsKKyAgICAgICAgICAgIHNhcEFwQXBwRXZlbnQuc2FwZXZ0LnNhcEFjdGlvbkNuZi5hY3Rpb25TZW5kU3VjY2VzcyA9IChlU2FwU3RhdHVzKWNvbnRleHQ7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgIGNhc2UgZVNBUF9ESVNDT05ORUNUX0FMTF9QMlBfQ0xJRU5UOgorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIlNBUCBldmVudCBjYWxsYmFjayBldmVudCA9ICVzIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICJlU0FQX0RJU0NPTk5FQ1RfQUxMX1AyUF9DTElFTlQiKTsKKyAgICAgICAgICAgIHNhcEFwQXBwRXZlbnQuc2FwSGRkRXZlbnRDb2RlID0gZVNBUF9ESVNDT05ORUNUX0FMTF9QMlBfQ0xJRU5UOworICAgICAgICAgICAgc2FwQXBBcHBFdmVudC5zYXBldnQuc2FwQWN0aW9uQ25mLmFjdGlvblNlbmRTdWNjZXNzID0gKGVTYXBTdGF0dXMpY29udGV4dDsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgY2FzZSBlU0FQX01BQ19UUklHX1NUT1BfQlNTX0VWRU5UIDoKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJTQVAgZXZlbnQgY2FsbGJhY2sgZXZlbnQgPSAlcyIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAiZVNBUF9NQUNfVFJJR19TVE9QX0JTU19FVkVOVCIpOworICAgICAgICAgICAgc2FwQXBBcHBFdmVudC5zYXBIZGRFdmVudENvZGUgPSBlU0FQX01BQ19UUklHX1NUT1BfQlNTX0VWRU5UOworICAgICAgICAgICAgc2FwQXBBcHBFdmVudC5zYXBldnQuc2FwQWN0aW9uQ25mLmFjdGlvblNlbmRTdWNjZXNzID0gKGVTYXBTdGF0dXMpY29udGV4dDsKKyAgICAgICAgICAgIGJyZWFrOworCisKKyAgICAgICAgY2FzZSBlU0FQX1VOS05PV05fU1RBX0pPSU46CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICBGTCgiU0FQIGV2ZW50IGNhbGxiYWNrIGV2ZW50ID0gJXMiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgImVTQVBfVU5LTk9XTl9TVEFfSk9JTiIpOworICAgICAgICAgICAgc2FwQXBBcHBFdmVudC5zYXBIZGRFdmVudENvZGUgPSBlU0FQX1VOS05PV05fU1RBX0pPSU47CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHZfUFZPSURfdClzYXBBcEFwcEV2ZW50LnNhcGV2dC5zYXBVbmtub3duU1RBSm9pbi5tYWNhZGRyLmJ5dGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICh2X1BWT0lEX3QpY29udGV4dCwgc2l6ZW9mKHZfTUFDQUREUl90KSk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVTQVBfTUFYX0FTU09DX0VYQ0VFREVEOgorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIlNBUCBldmVudCBjYWxsYmFjayBldmVudCA9ICVzIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICJlU0FQX01BWF9BU1NPQ19FWENFRURFRCIpOworICAgICAgICAgICAgc2FwQXBBcHBFdmVudC5zYXBIZGRFdmVudENvZGUgPSBlU0FQX01BWF9BU1NPQ19FWENFRURFRDsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSgodl9QVk9JRF90KXNhcEFwQXBwRXZlbnQuc2FwZXZ0LnNhcE1heEFzc29jRXhjZWVkZWQubWFjYWRkci5ieXRlcywKKyAgICAgICAgICAgICAgICAgICAgKHZfUFZPSURfdClwQ3NyUm9hbUluZm8tPnBlZXJNYWMsIHNpemVvZih2X01BQ0FERFJfdCkpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIlNBUCBVbmtub3duIGNhbGxiYWNrIGV2ZW50ID0gJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgc2FwSGRkZXZlbnQpOworICAgICAgICAgICAgYnJlYWs7CisgICAgfQorICAgIHZvc1N0YXR1cyA9ICgqc2FwQ29udGV4dC0+cGZuU2FwRXZlbnRDYWxsYmFjaykKKyAgICAgICAgICAgICAgICAoCisgICAgICAgICAgICAgICAgICZzYXBBcEFwcEV2ZW50LAorICAgICAgICAgICAgICAgICBzYXBDb250ZXh0LT5wVXNyQ29udGV4dC8vdXNlcmRhdGFmb3JjYWxsYmFjayAtIGhkZCBvcGFxdWUgaGFuZGxlCisgICAgICAgICAgICAgICAgICk7CisKKyAgICByZXR1cm4gdm9zU3RhdHVzOworCit9IC8qIHNhcFNpZ25hbEFwQXBwU3RhcnRCc3NFdmVudCAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIHNhcEZzbQorCisgIERFU0NSSVBUSU9OCisgICAgU0FQIFN0YXRlIG1hY2hpbmUgZW50cnkgZnVuY3Rpb24KKworICBERVBFTkRFTkNJRVMKKyAgICBOQS4KKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHN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BVFVTIHZvc1N0YXR1cyA9IFZPU19TVEFUVVNfRV9GQUlMVVJFOworCisgICAgc3dpdGNoIChzdGF0ZVZhcikKKyAgICB7CisgICAgICAgIGNhc2UgZVNBUF9ESVNDT05ORUNURUQ6CisgICAgICAgICAgICBpZiAoKG1zZyA9PSBlU0FQX0hERF9TVEFSVF9JTkZSQV9CU1MpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIFRyYW5zaXRpb24gZnJvbSBlU0FQX0RJU0NPTk5FQ1RFRCB0byBlU0FQX0NIX1NFTEVDVCAoYm90aCB3aXRob3V0IHN1YnN0YXRlcykgKi8KKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiSW4gJXMsIG5ldyBmcm9tIHN0YXRlICVzID0+ICVzIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgImVTQVBfRElTQ09OTkVDVEVEIiwgImVTQVBfQ0hfU0VMRUNUIik7CisKKyAgICAgICAgICAgICAgICAvKiBUaGVyZSBjYW4gYmUgb25lIFNBUCBTZXNzaW9uIGZvciBzb2Z0YXAgKi8KKyAgICAgICAgICAgICAgICBpZiAoc2FwQ29udGV4dC0+aXNTYXBTZXNzaW9uT3BlbiA9PSBlU0FQX1RSVUUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICIlczpTTUUgU2Vzc2lvbiBpcyBhbHJlYWR5IG9wZW5lZFxuIixfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9FWElTVFM7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgc2FwQ29udGV4dC0+c2Vzc2lvbklkID0gMHhmZjsKKworICAgICAgICAgICAgICAgIC8qIFNldCBTQVAgZGV2aWNlIHJvbGUgKi8KKyAgICAgICAgICAgICAgICBzYXBDb250ZXh0LT5zYXBzTWFjaGluZSA9IGVTQVBfQ0hfU0VMRUNUOworCisjaWZkZWYgV0xBTl9GRUFUVVJFX0FQX0hUNDBfMjRHCisgICAgICAgICAgICAgICAgc2FwU2V0T2Jzc1Bhcm0oc2FwQ29udGV4dCk7CisjZW5kaWYKKyAgICAgICAgICAgICAgICAvKiBQZXJmb3JtIHNtZV9TY2FuUmVxdWVzdCAqLworICAgICAgICAgICAgICAgIHZvc1N0YXR1cyA9IHNhcEdvdG9DaGFubmVsU2VsKHNhcENvbnRleHQsIHNhcEV2ZW50KTsKKworICAgICAgICAgICAgICAgIC8qIFRyYW5zaXRpb24gZnJvbSBlU0FQX0RJU0NPTk5FQ1RFRCB0byBlU0FQX0NIX1NFTEVDVCAoYm90aCB3aXRob3V0IHN1YnN0YXRlcykgKi8KKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiSW4gJXMsIGZyb20gc3RhdGUgJXMgPT4gJXMiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sICJlU0FQX0RJU0NPTk5FQ1RFRCIsICJlU0FQX0NIX1NFTEVDVCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJJbiAlcywgaW4gc3RhdGUgJXMsIGV2ZW50IG1zZyAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCAiZVNBUF9ESVNDT05ORUNURUQiLCBtc2cpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlY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IHZvc1N0YXR1cyA9IHNhcEdvdG9TdGFydGluZyggc2FwQ29udGV4dCwgc2FwRXZlbnQsIGVDU1JfQlNTX1RZUEVfSU5GUkFfQVApOworICAgICAgICAgICAgICAgICAvKiBUcmFuc2l0aW9uIGZyb20gZVNBUF9DSF9TRUxFQ1QgdG8gZVNBUF9TVEFSVElORyAoYm90aCB3aXRob3V0IHN1YnN0YXRlcykgKi8KKyAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIkluICVzLCBmcm9tIHN0YXRlICVzID0+ICVzIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sICJlU0FQX0NIX1NFTEVDVCIsICJlU0FQX1NUQVJUSU5HIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiSW4gJXMsIGluIHN0YXRlICVzLCBpbnZhbGlkIGV2ZW50IG1zZyAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sICJlU0FQX0NIX1NFTEVDVCIsIG1zZyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVTQVBfU1RBUlRJTkc6CisgICAgICAgICAgICBpZiAobXNnID09IGVTQVBfTUFDX1NUQVJUX0JTU19TVUNDRVNTICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBUcmFuc2l0aW9uIGZyb20gZVNBUF9TVEFSVElORyB0byBlU0FQX1NUQVJURUQgKGJvdGggd2l0aG91dCBzdWJzdGF0ZXMpICovCisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIkluICVzLCBmcm9tIHN0YXRlIGNoYW5uZWwgPSAlZCAlcyA9PiAlcyIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sc2FwQ29udGV4dC0+Y2hhbm5lbCwgImVTQVBfU1RBUlRJTkciLCAiZVNBUF9TVEFSVEVEIik7CisKKyAgICAgICAgICAgICAgICAgc2FwQ29udGV4dC0+c2Fwc01hY2hpbmUgPSBlU0FQX1NUQVJURUQ7CisgICAgICAgICAgICAgICAgIC8qQWN0aW9uIGNvZGUgZm9yIHRyYW5zaXRpb24gKi8KKyAgICAgICAgICAgICAgICAgdm9zU3RhdHVzID0gc2FwU2lnbmFsSEREZXZlbnQoIHNhcENvbnRleHQsIHJvYW1JbmZvLCBlU0FQX1NUQVJUX0JTU19FVkVOVCwgKHZfUFZPSURfdCllU0FQX1NUQVRVU19TVUNDRVNTKTsKKworICAgICAgICAgICAgICAgICAvKiBUcmFuc2l0aW9uIGZyb20gZVNBUF9TVEFSVElORyB0byBlU0FQX1NUQVJURUQgKGJvdGggd2l0aG91dCBzdWJzdGF0ZXMpICovCisgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICJJbiAlcywgZnJvbSBzdGF0ZSAlcyA9PiAlcyIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sICJlU0FQX1NUQVJUSU5HIiwgImVTQVBfU1RBUlRFRCIpOworCisjaWZkZWYgV0xBTl9GRUFUVVJFX0FQX0hUNDBfMjRHCisgICAgICAgICAgICAgICAgLyogSW5pdGlhbGl6ZSB0aGUgSFQyMDQwIHRpbWVyICovCisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiSW4gJXMsIEluaXQgSFQyMC80MCB0aW1lciIsIF9fZnVuY19fKTsKKworICAgICAgICAgICAgICAgIHZvc1N0YXR1cyA9IHZvc190aW1lcl9pbml0KCAmc2FwQ29udGV4dC0+c2FwX0hUMjA0MF90aW1lciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19USU1FUl9UWVBFX1NXLCBzYXBfaHQyMDQwX3RpbWVyX2NiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZfUFZPSURfdClzYXBDb250ZXh0ICk7CisKKyAgICAgICAgICAgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkluICVzLCBGYWlsZWQgdG8gSW5pdCBIVDIwLzQwIHRpbWVyIiwgX19mdW5jX18pOworI2VuZGlmCisgICAgICAgICAgICAgfQorICAgICAgICAgICAgIGVsc2UgaWYgKG1zZyA9PSBlU0FQX01BQ19TVEFSVF9GQUlMUykKKyAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIC8qVHJhbnNpdGlvbiBmcm9tIFNUQVJUSU5HIHRvIERJU0NPTk5FQ1RFRCAoYm90aCB3aXRob3V0IHN1YnN0YXRlcykqLworICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJJbiAlcywgZnJvbSBzdGF0ZSAlcyA9PiAlcyIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sICJlU0FQX1NUQVJUSU5HIiwgImVTQVBfRElTQ09OTkVDVEVEIik7CisKKyAgICAgICAgICAgICAgICAgLypBY3Rpb24gY29kZSBmb3IgdHJhbnNpdGlvbiAqLworICAgICAgICAgICAgICAgICB2b3NTdGF0dXMgPSBzYXBTaWduYWxIRERldmVudCggc2FwQ29udGV4dCwgTlVMTCwgZVNBUF9TVEFSVF9CU1NfRVZFTlQsKHZfUFZPSURfdCkgZVNBUF9TVEFUVVNfRkFJTFVSRSk7CisgICAgICAgICAgICAgICAgIHZvc1N0YXR1cyA9ICBzYXBHb3RvRGlzY29ubmVjdGVkKHNhcENvbnRleHQpOworCisgICAgICAgICAgICAgICAgIC8qQWR2YW5jZSBvdXRlciBzdGF0ZXZhciAqLworICAgICAgICAgICAgICAgICBzYXBDb250ZXh0LT5zYXBzTWFjaGluZSA9IGVTQVBfRElTQ09OTkVDVEVEOworICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICBlbHNlIGlmIChtc2cgPT0gZVNBUF9IRERfU1RPUF9JTkZSQV9CU1MpCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAvKlRyYW5zaXRpb24gZnJvbSBlU0FQX1NUQVJUSU5HIHRvIGVTQVBfRElTQ09OTkVDVElORyAoYm90aCB3aXRob3V0IHN1YnN0YXRlcykqLworICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAiSW4gJXMsIGZyb20gc3RhdGUgJXMgPT4gJXMiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgImVTQVBfU1RBUlRJTkciLCAiZVNBUF9ESVNDT05ORUNUSU5HIik7CisKKyAgICAgICAgICAgICAgICAgLypBZHZhbmNlIG91dGVyIHN0YXRldmFyICovCisgICAgICAgICAgICAgICAgIHNhcENvbnRleHQtPnNhcHNNYWNoaW5lID0gZVNBUF9ESVNDT05ORUNURUQ7CisgICAgICAgICAgICAgICAgIHZvc1N0YXR1cyA9IHNhcFNpZ25hbEhERGV2ZW50KCBzYXBDb250ZXh0LCBOVUxMLCBlU0FQX1NUQVJUX0JTU19FVkVOVCwgKHZfUFZPSURfdCllU0FQX1NUQVRVU19GQUlMVVJFKTsKKyAgICAgICAgICAgICAgICAgdm9zU3RhdHVzID0gc2FwR290b0Rpc2Nvbm5lY3RlZChzYXBDb250ZXh0KTsKKworI2lmZGVmIFdMQU5fRkVBVFVSRV9BUF9IVDQwXzI0RworICAgICAgICAgICAgICAgICAvKiBSZXNldCB0aGUgT0JTUyBBZmZlY3RlZCBDaGFubmVsIFJhbmdlICovCisgICAgICAgICAgICAgICAgIGlmICggKDAgIT0gc2FwQ29udGV4dC0+YWZmZWN0ZWRfc3RhcnQpCisgICAgICAgICAgICAgICAgICAgJiYgKDAgIT0gc2FwQ29udGV4dC0+YWZmZWN0ZWRfZW5kKQorICAgICAgICAgICAgICAgICAgICYmICgwICE9IHNhcENvbnRleHQtPnNhcF9zZWNfY2hhbikgKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICBzYXBDb250ZXh0LT5hZmZlY3RlZF9zdGFydCA9IDA7CisgICAgICAgICAgICAgICAgICAgICBzYXBDb250ZXh0LT5hZmZlY3RlZF9lbmQgPSAwOworICAgICAgICAgICAgICAgICAgICAgc2FwQ29udGV4dC0+c2FwX3NlY19jaGFuID0gMDsKKyAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJSZXNldCB0aGUgT0JTUyBBZmZlY3RlZCBDaGFubmVsIFJhbmdlIFslZCAlZF0iKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzYXBDb250ZXh0LT5hZmZlY3RlZF9zdGFydCwgc2FwQ29udGV4dC0+YWZmZWN0ZWRfZW5kKTsKKworICAgICAgICAgICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgICAgICAgICAgLyogQ2xvc2UgdGhlIFNNRSBzZXNzaW9uKi8KKworICAgICAgICAgICAgICAgICBpZiAoZVNBUF9UUlVFID09IHNhcENvbnRleHQtPmlzU2FwU2Vzc2lvbk9wZW4pCisgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdEhhbEhhbmRsZSBoSGFsID0gVk9TX0dFVF9IQUxfQ0Ioc2FwQ29udGV4dC0+cHZvc0dDdHgpOworICAgICAgICAgICAgICAgICAgICBpZiAoTlVMTCA9PSBoSGFsKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiSW4gJXMsIE5VTEwgaEhhbCBpbiBzdGF0ZSAlcywgbXNnICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgImVTQVBfU1RBUlRJTkciLCBtc2cpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgICBzbWVfQ2xvc2VTZXNzaW9uKGhIYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNhcENvbnRleHQtPnNlc3Npb25JZCwgVk9TX1RSVUUsIE5VTEwsIE5VTEwpKQorICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgIHNhcENvbnRleHQtPmlzU2FwU2Vzc2lvbk9wZW4gPSBlU0FQX0ZBTFNFOworICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgfQorICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkluICVzLCBpbiBzdGF0ZSAlcywgaW52YWxpZCBldmVudCBtc2cgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgImVTQVBfU1RBUlRJTkciLCBtc2cpOworICAgICAgICAgICAgICAgICAvKiBJbnRlbnRpb25hbGx5IGxlZnQgYmxhbmsgKi8KKyAgICAgICAgICAgICB9CisgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlU0FQX1NUQVJURUQ6CisgICAgICAgICAgICBpZiAobXNnID09IGVTQVBfSEREX1NUT1BfSU5GUkFfQlNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIFRyYW5zaXRpb24gZnJvbSBlU0FQX1NUQVJURUQgdG8gZVNBUF9ESVNDT05ORUNUSU5HIChib3RoIHdpdGhvdXQgc3Vic3RhdGVzKSAqLworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICJJbiAlcywgZnJvbSBzdGF0ZSAlcyA9PiAlcyIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgImVTQVBfU1RBUlRFRCIsICJlU0FQX0RJU0NPTk5FQ1RJTkciKTsKKyAgICAgICAgICAgICAgICBzYXBDb250ZXh0LT5zYXBzTWFjaGluZSA9IGVTQVBfRElTQ09OTkVDVElORzsKKyAgICAgICAgICAgICAgICB2b3NTdGF0dXMgPSBzYXBHb3RvRGlzY29ubmVjdGluZyhzYXBDb250ZXh0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJJbiAlcywgaW4gc3RhdGUgJXMsIGludmFsaWQgZXZlbnQgbXNnICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCAiZVNBUF9TVEFSVEVEIiwgbXNnKTsKKyAgICAgICAgICAgIH0KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfQVBfSFQ0MF8yNEcKKyAgICAgICAgICAgIC8qIFJlc2V0IHRoZSBPQlNTIEFmZmVjdGVkIENoYW5uZWwgUmFuZ2UgKi8KKyAgICAgICAgICAgIGlmICggKDAgIT0gc2FwQ29udGV4dC0+YWZmZWN0ZWRfc3RhcnQpCisgICAgICAgICAgICAgICAmJiAoMCAhPSBzYXBDb250ZXh0LT5hZmZlY3RlZF9lbmQpCisgICAgICAgICAgICAgICAmJiAoMCAhPSBzYXBDb250ZXh0LT5zYXBfc2VjX2NoYW4pICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzYXBDb250ZXh0LT5hZmZlY3RlZF9zdGFydCA9IDA7CisgICAgICAgICAgICAgICAgc2FwQ29udGV4dC0+YWZmZWN0ZWRfZW5kID0gMDsKKyAgICAgICAgICAgICAgICBzYXBDb250ZXh0LT5zYXBfc2VjX2NoYW4gPSAwOworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgRkwoIlJlc2V0IHRoZSBPQlNTIEFmZmVjdGVkIENoYW5uZWwgUmFuZ2UgWyVkICVkXSIpLAorICAgICAgICAgICAgICAgICAgICAgc2FwQ29udGV4dC0+YWZmZWN0ZWRfc3RhcnQsIHNhcENvbnRleHQtPmFmZmVjdGVkX2VuZCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChWT1NfVElNRVJfU1RBVEVfUlVOTklORyA9PSBzYXBDb250ZXh0LT5zYXBfSFQyMDQwX3RpbWVyLnN0YXRlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc1N0YXR1cyA9IHZvc190aW1lcl9zdG9wKCZzYXBDb250ZXh0LT5zYXBfSFQyMDQwX3RpbWVyKTsKKyAgICAgICAgICAgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiRmFpbGVkIHRvIFN0b3AgSFQyMC80MCB0aW1lciIpKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdm9zU3RhdHVzID0gdm9zX3RpbWVyX2Rlc3Ryb3koJnNhcENvbnRleHQtPnNhcF9IVDIwNDBfdGltZXIpOworICAgICAgICAgICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zU3RhdHVzKSkKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJGYWlsZWQgdG8gRGVzdHJveSBIVDIwLzQwIHRpbWVyIikpOworI2VuZGlmCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVTQVBfRElTQ09OTkVDVElORzoKKyAgICAgICAgICAgIGlmIChtc2cgPT0gZVNBUF9NQUNfUkVBRFlfRk9SX0NPTk5FQ1RJT05TKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIFRyYW5zaXRpb24gZnJvbSBlU0FQX0RJU0NPTk5FQ1RJTkcgdG8gZVNBUF9ESVNDT05ORUNURUQgKGJvdGggd2l0aG91dCBzdWJzdGF0ZXMpICovCisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgIkluICVzLCBmcm9tIHN0YXRlICVzID0+ICVzIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sICJlU0FQX0RJU0NPTk5FQ1RJTkciLCAiZVNBUF9ESVNDT05ORUNURUQiKTsKKworICAgICAgICAgICAgICAgIHNhcENvbnRleHQtPnNhcHNNYWNoaW5lID0gZVNBUF9ESVNDT05ORUNURUQ7CisgICAgICAgICAgICAgICAgLyogQ2xvc2UgdGhlIFNNRSBzZXNzaW9uKi8KKyAgICAgICAgICAgICAgICBpZiAoZVNBUF9UUlVFID09IHNhcENvbnRleHQtPmlzU2FwU2Vzc2lvbk9wZW4pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB0SGFsSGFuZGxlIGhIYWwgPSBWT1NfR0VUX0hBTF9DQihzYXBDb250ZXh0LT5wdm9zR0N0eCk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKE5VTEwgPT0gaEhhbCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiSW4gJXMsIE5VTEwgaEhhbCBpbiBzdGF0ZSAlcywgbXNnICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sICJlU0FQX0RJU0NPTk5FQ1RJTkciLCBtc2cpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc2FwQ29udGV4dC0+aXNTYXBTZXNzaW9uT3BlbiA9IGVTQVBfRkFMU0U7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUhBTF9TVEFUVVNfU1VDQ0VTUygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbWVfQ2xvc2VTZXNzaW9uKGhIYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2FwQ29udGV4dC0+c2Vzc2lvbklkLCBWT1NfVFJVRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYXBSb2FtU2Vzc2lvbkNsb3NlQ2FsbGJhY2ssIHNhcENvbnRleHQpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NTdGF0dXMgPSBzYXBTaWduYWxIRERldmVudChzYXBDb250ZXh0LCBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTQVBfU1RPUF9CU1NfRVZFTlQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZfUFZPSURfdCkgZVNBUF9TVEFUVVNfU1VDQ0VTUyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobXNnID09IGVTQVBfQ0hBTk5FTF9TRUxFQ1RJT05fRkFJTEVEKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAvKiBTZXQgU0FQIGRldmljZSByb2xlICovCisgICAgICAgICAgICAgICAgc2FwQ29udGV4dC0+c2Fwc01hY2hpbmUgPSBlU0FQX0NIX1NFTEVDVDsKKworICAgICAgICAgICAgICAgIC8qIFBlcmZvcm0gc21lX1NjYW5SZXF1ZXN0ICovCisgICAgICAgICAgICAgICAgdm9zU3RhdHVzID0gc2FwR290b0NoYW5uZWxTZWwoc2FwQ29udGV4dCwgc2FwRXZlbnQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJJbiAlcywgaW4gc3RhdGUgJXMsIGludmFsaWQgZXZlbnQgbXNnICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sICJlU0FQX0RJU0NPTk5FQ1RJTkciLCBtc2cpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICByZXR1cm4gdm9zU3RhdHVzOworfS8vIHNhcEZzbQorCisKK2VTYXBTdGF0dXMKK3NhcGNvbnZlcnRUb0NzclByb2ZpbGUodHNhcF9Db25maWdfdCAqcGNvbmZpZ19wYXJhbXMsIGVDc3JSb2FtQnNzVHlwZSBic3NUeXBlLCB0Q3NyUm9hbVByb2ZpbGUgKnByb2ZpbGUpCit7CisgICAgLy9DcmVhdGUgUm9hbSBwcm9maWxlIGZvciBTb2Z0QVAgdG8gY29ubmVjdAorICAgIHByb2ZpbGUtPkJTU1R5cGUgPSBlQ1NSX0JTU19UWVBFX0lORlJBX0FQOworICAgIHByb2ZpbGUtPlNTSURzLm51bU9mU1NJRHMgPSAxOworICAgIHByb2ZpbGUtPmNzclBlcnNvbmEgPSBwY29uZmlnX3BhcmFtcy0+cGVyc29uYTsKKworICAgIHZvc19tZW1femVybyhwcm9maWxlLT5TU0lEcy5TU0lETGlzdFswXS5TU0lELnNzSWQsCisgICAgICAgICAgICAgICAgIHNpemVvZihwcm9maWxlLT5TU0lEcy5TU0lETGlzdFswXS5TU0lELnNzSWQpKTsKKworICAgIC8vRmxhZyB0byBub3QgYnJvYWRjYXN0IHRoZSBTU0lEIGluZm9ybWF0aW9uCisgICAgcHJvZmlsZS0+U1NJRHMuU1NJRExpc3RbMF0uc3NpZEhpZGRlbiA9ICBwY29uZmlnX3BhcmFtcy0+U1NJRGluZm8uc3NpZEhpZGRlbjsKKworICAgIHByb2ZpbGUtPlNTSURzLlNTSURMaXN0WzBdLlNTSUQubGVuZ3RoID0gcGNvbmZpZ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ICAgIHZfVThfdCBvdXRlciwgaW5uZXI7CisgICAgdl9NQUNBRERSX3QgdGVtcDsKKyAgICB2X1NJTlRfdCBuUmVzID0gLTE7CisKKyAgICBpZiAoKE5VTEwgPT0gbWFjTGlzdCkgfHwgKHNpemUgPj0gTUFYX0FDTF9NQUNfQUREUkVTUykpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICJJbiAlcywgZWl0aGVyIGJ1ZmZlciBpcyBOVUxMIG9yIHNpemUgPSAlZCBpcyBtb3JlLiIKKyAgICAgICAgICAgICAgICAgICAgICAsX19mdW5jX18sIHNpemUpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgZm9yKG91dGVyID0gMDsgb3V0ZXIgPCBzaXplOyBvdXRlcisrKQorICAgIHsKKyAgICAgICAgZm9yKGlubmVyID0gMDsgaW5uZXIgPCBzaXplIC0gMTsgaW5uZXIrKykKKyAgICAgICAgeworICAgICAgICAgICAgblJlcyA9IHZvc19tZW1fY29tcGFyZTIoKG1hY0xpc3QgKyBpbm5lciktPmJ5dGVzLCAobWFjTGlzdCArIGlubmVyICsgMSktPmJ5dGVzLCBzaXplb2Yodl9NQUNBRERSX3QpKTsKKyAgICAgICAgICAgIGlmIChuUmVzID4gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkodGVtcC5ieXRlcywgKG1hY0xpc3QgKyBpbm5lciArIDEpLT5ieXRlcywgc2l6ZW9mKHZfTUFDQUREUl90KSk7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KChtYWNMaXN0ICsgaW5uZXIgKyAxKS0+Ynl0ZXMsIChtYWNMaXN0ICsgaW5uZXIpLT5ieXRlcywgc2l6ZW9mKHZfTUFDQUREUl90KSk7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KChtYWNMaXN0ICsgaW5uZXIpLT5ieXRlcywgdGVtcC5ieXRlcywgc2l6ZW9mKHZfTUFDQUREUl90KSk7CisgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorfQorCitlU2FwQm9vbAorc2FwU2VhcmNoTWFjTGlzdCh2X01BQ0FERFJfdCAqbWFjTGlzdCwgdl9VOF90IG51bV9tYWMsIHZfVThfdCAqcGVlck1hYywgdl9VOF90ICppbmRleCkKK3sKKyAgICB2X1NJTlRfdCBuUmVzID0gLTE7CisgICAgdl9TN190IG5TdGFydCA9IDAsIG5FbmQsIG5NaWRkbGU7CisgICAgbkVuZCA9IG51bV9tYWMgLSAxOworCisgICAgd2hpbGUgKG5TdGFydCA8PSBuRW5kKQorICAgIHsKKyAgICAgICAgbk1pZGRsZSA9IChuU3RhcnQgKyBuRW5kKSAvIDI7CisgICAgICAgIG5SZXMgPSB2b3NfbWVtX2NvbXBhcmUyKCZtYWNMaXN0W25NaWRkbGVdLCBwZWVyTWFjLCBzaXplb2Yodl9NQUNBRERSX3QpKTsKKworICAgICAgICBpZiAoMCA9PSBuUmVzKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAic2VhcmNoIFNVQ0MiKTsKKyAgICAgICAgICAgIC8vICJpbmRleCBlcXVhbHMgTlVMTCIgbWVhbnMgdGhlIGNhbGxlciBkb2VzIG5vdCBuZWVkIHRoZQorICAgICAgICAgICAgLy8gaW5kZXggdmFsdWUgb2YgdGhlIHBlZXJNYWMgYmVpbmcgc2VhcmNoZWQKKyAgICAgICAgICAgIGlmIChpbmRleCAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICppbmRleCA9ICh2X1U4X3QpIG5NaWRkbGU7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgICJpbmRleCAlZCIsICppbmRleCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gZVNBUF9UUlVFOworICAgICAgICB9CisgICAgICAgIGlmIChuUmVzIDwgMCkKKyAgICAgICAgICAgIG5TdGFydCA9IG5NaWRkbGUgKyAxOworICAgICAgICBlbHNlCisgICAgICAgICAgICBuRW5kID0gbk1pZGRsZSAtIDE7CisgICAgfQorCisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICJzZWFyY2ggbm90IHN1Y2MiKTsKKyAgICByZXR1cm4gZVNBUF9GQUxTRTsKK30KKwordm9pZAorc2FwQWRkTWFjVG9BQ0wodl9NQUNBRERSX3QgKm1hY0xpc3QsIHZfVThfdCAqc2l6ZSwgdl9VOF90ICpwZWVyTWFjKQoreworICAgIHZfU0lOVF90IG5SZXMgPSAtMTsKKyAgICBpbnQgaTsKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCJhZGQgYWNsIGVudGVyZWQiKTsKKworICAgIGlmICgoTlVMTCA9PSBtYWNMaXN0KSB8fCAoKnNpemUgPj0gTUFYX0FDTF9NQUNfQUREUkVTUykpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAiSW4gJXMsIGVpdGhlciBidWZmZXIgaXMgTlVMTCBvciBzaXplICVkIGlzIGluY29ycmVjdC4iCisgICAgICAgICAgICAgICAgICAgICwgX19mdW5jX18sICpzaXplKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGZvciAoaT0oKCpzaXplK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RUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICIqKiBBQ0wgZW50cnkgJWkgLSAiTUFDX0FERFJFU1NfU1RSLCBpLAorICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKG1hY0FycmF5KSk7CisgICAgfQorICAgIHJldHVybjsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBzYXBHZXRTdGFJZAorCisgIERFU0NSSVBUSU9OCisgICAgR2V0IHRoZSBTVEEgSUQgZnJvbSBNYWMgYWRkcmVzcy4KKworICBERVBFTkRFTkNJRVMKKyAgICBOQS4KKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHNhcENvbnRleHQgICA6IFNhcCBDb250ZXh0IHZhbHVlCisgICAgc3RhSWQgICAgICAgIDogU1RBIElECisgICAgcENzclJvYW1JbmZvIDogUG9pbnRlciB0byBDU1IgaW5mbworCisgIFJFVFVSTiBWQUxVRQorCisgIFNJREUgRUZGRUNUUworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKK1ZPU19TVEFUVVMgc2FwR2V0U3RhSWQocHRTYXBDb250ZXh0IHNhcENvbnRleHQsIHZfVThfdCAqc3RhSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRDc3JSb2FtSW5mbyAqcENzclJvYW1JbmZvKQoreworICAgIHZfVThfdCBpOworCisgICAgZm9yIChpID0gMDsgaSA8IFdMQU5fTUFYX1NUQV9DT1VOVDsgaSsrKQorICAgIHsKKyAgICAgICAgaWYgKHZvc19tZW1fY29tcGFyZSgmc2FwQ29udGV4dC0+YVN0YUluZm9baV0ubWFjQWRkclNUQSwKKyAgICAgICAgICAgICAgICBwQ3NyUm9hbUluZm8tPnBlZXJNYWMsIHNpemVvZih2X01BQ0FERFJfdCkpCisgICAgICAgICAgICYmIHNhcENvbnRleHQtPmFTdGFJbmZvW2ldLmlzVXNlZCkKKyAgICAgICAgeworICAgICAgICAgICAgKnN0YUlkID0gaTsKKyAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIHNhcEFkZEhUNDBJbnRvbGVyYW50U3RhCisKKyAgREVTQ1JJUFRJT04KKyAgICBBZGQgSFQ0MCBJbnRvbGVyYW50IFNUQSAmIE1vdmUgU0FQIGZyb20gSFQ0MCB0byBIVDIwCisKKyAgREVQRU5ERU5DSUVTCisgICAgTkEuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICBzYXBDb250ZXh0ICAgOiBTYXAgQ29udGV4dCB2YWx1ZQorICAgIHBDc3JSb2FtSW5mbyA6IFBvaW50ZXIgdG8gQ1NSIGluZm8KKworICBSRVRVUk4gVkFMVUUKKworICBTSURFIEVGRkVDVFMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisjaWZkZWYgV0xBTl9GRUFUVVJFX0FQX0hUNDBfMjRHCit2b2lkIHNhcEFkZEhUNDBJbnRvbGVyYW50U3RhKHB0U2FwQ29udGV4dCBzYXBDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRDc3JSb2FtSW5mbyAqcENzclJvYW1JbmZvKQoreworCisgICAgdEhhbEhhbmRsZSBoSGFsOworICAgIHZfVThfdCBjYk1vZGU7CisgICAgdEFOSV9VOCAgc3RhSWQ7CisgICAgZUhhbFN0YXR1cyBoYWxTdGF0dXM7CisgICAgVk9TX1NUQVRVUyAgdm9zU3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworCisgICAgLyogdEhhbEhhbmRsZSAqLworICAgIGhIYWwgPSBWT1NfR0VUX0hBTF9DQihzYXBDb250ZXh0LT5wdm9zR0N0eCk7CisKKyAgICBpZiAoTlVMTCA9PSBoSGFsKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIEZMKCJJbiBpbnZhbGlkIGhIYWwiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBzdGFJZCA9IHBDc3JSb2FtSW5mby0+c3RhSWQ7CisKKyAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICBGTCgiQWRkIEhUNDAgTUh6IEludG9sZXJhbnQgU1RBIDoiCisgICAgICAgICAgICAgIE1BQ19BRERSRVNTX1NUUiAiIFNUQSBJRDogJWQiKSwKKyAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocENzclJvYW1JbmZvLT5wZWVyTWFjKSwKKyAgICAgICAgICAgICAgc3RhSWQpOworCisgICAgLy8gR2V0IENoYW5uZWwgQm9uZGluZyBNb2RlCisgICAgY2JNb2RlID0gc21lX0dldENoYW5uZWxCb25kaW5nTW9kZTI0RyhoSGFsKTsKKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgRkwoIkN1cnJlbnQgQ2hhbm5lbCBCb25kaW5nIE1vZGU6ICVkICIKKyAgICAgICAgICAgICAgICAgICJIVDQwSW50b2xlcmFudFNldDogJWQiKSwKKyAgICAgICAgICAgICAgIGNiTW9kZSwgc2FwQ29udGV4dC0+YVN0YUluZm9bc3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Tk5JTkcgPT0gc2FwQ29udGV4dC0+c2FwX0hUMjA0MF90aW1lci5zdGF0ZSkKKyAgICB7CisgICAgICAgIHZvc1N0YXR1cyA9IHZvc190aW1lcl9zdG9wKCZzYXBDb250ZXh0LT5zYXBfSFQyMDQwX3RpbWVyKTsKKyAgICAgICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zU3RhdHVzKSkKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICBGTCgiRmFpbGVkIHRvIFN0b3AgSFQyMC80MCB0aW1lciIpKTsKKyAgICB9CisKKyAgICBpZihjYk1vZGUpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICBGTCgiTW92ZSBTQVAgZnJvbSBIVDQwIHRvIEhUMjAiKSk7CisKKyAgICAgICAgaGFsU3RhdHVzID0gc21lX1NldEhUMjA0ME1vZGUoaEhhbCwgc2FwQ29udGV4dC0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQSFlfU0lOR0xFX0NIQU5ORUxfQ0VOVEVSRUQpOworCisgICAgICAgIGlmIChoYWxTdGF0dXMgPT0gZUhBTF9TVEFUVVNfRkFJTFVSRSkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkZhaWxlZCB0byBjaGFuZ2UgSFQyMC80MCBtb2RlIikpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgLyogRGlzYWJsZSBDaGFubmVsIEJvbmRpbmcgZm9yIDIuNEdIeiAqLworICAgICAgICBzbWVfVXBkYXRlQ2hhbm5lbEJvbmRpbmdNb2RlMjRHKGhIYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBIWV9TSU5HTEVfQ0hBTk5FTF9DRU5URVJFRCk7CisKKyAgICB9CisgICAgZWxzZQorICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICBGTCgiU0FQIGlzIEFscmVhZHkgaW4gSFQyMCIpKTsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBzYXBSZW1vdmVIVDQwSW50b2xlcmFudFN0YQorCisgIERFU0NSSVBUSU9OCisgICAgUmVtb3ZlIEhUNDAgSW50b2xlcmFudCBTVEEgJiBNb3ZlIFNBUCBmcm9tIEhUNDAgdG8gSFQyMAorCisgIERFUEVOREVOQ0lFUworICAgIE5BLgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgc2FwQ29udGV4dCAgIDogU2FwIENvbnRleHQgdmFsdWUKKyAgICBwQ3NyUm9hbUluZm8gOiBQb2ludGVyIHRvIENTUiBpbmZvCisKKyAgUkVUVVJOIFZBTFVFCisKKyAgU0lERSBFRkZFQ1RTCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKwordm9pZCBzYXBSZW1vdmVIVDQwSW50b2xlcmFudFN0YShwdFNhcENvbnRleHQgc2FwQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRDc3JSb2FtSW5mbyAqcENzclJvYW1JbmZvKQoreworICAgIHRBTklfVTggIHN0YUlkOworICAgIFZPU19TVEFUVVMgIHZvc1N0YX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leHQtPmFTdGFJbmZvW3N0YUlkXS5pc0hUNDBJbnRvbGVyYW50U2V0KTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHNwaW5fbG9ja19iaCgmc2FwQ29udGV4dC0+c3RhSW5mb19sb2NrKTsKKyAgICBzYXBDb250ZXh0LT5hU3RhSW5mb1tzdGFJZF0uaXNIVDQwSW50b2xlcmFudFNldCA9IDA7CisKKyAgICBpZiAoc2FwQ29udGV4dC0+bnVtSFQ0MEludG9TdGEgPiAwKQorICAgICAgICBzYXBDb250ZXh0LT5udW1IVDQwSW50b1N0YS0tOworCisgICAgc3Bpbl91bmxvY2tfYmgoJnNhcENvbnRleHQtPnN0YUluZm9fbG9jayk7CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgIEZMKCJUb3RhbCBObyBvZiBIVDQwIEludG9sZXJhbnQgU1RBOiAlZCIKKyAgICAgICAgICAgICAgICIgU1RBIElEOiAlZCBIVDQwSW50b2xlcmFudFNldDogJWQiKSwKKyAgICAgICAgICAgICAgICBzYXBDb250ZXh0LT5udW1IVDQwSW50b1N0YSwKKyAgICAgICAgICAgICAgICBzdGFJZCwgc2FwQ29udGV4dC0+YVN0YUluZm9bc3RhSWRdLmlzSFQ0MEludG9sZXJhbnRTZXQpOworCisgICAgaWYgKCghc2FwQ2hlY2tIVDQwU2Vjb25kYXJ5SXNOb3RBbGxvd2VkKHNhcENvbnRleHQpKQorICAgICAgICYmICghc2FwQ29udGV4dC0+bnVtSFQ0MEludG9TdGEpKQorICAgIHsKKyAgICAgICAgLyogU3RvcCBQcmV2aW91cyBSdW5uaW5nIEhUMjAvNDAgVGltZXIgJiBTdGFydCB0aW1lcgorICAgICAgICAgICB3aXRoIChPQlNTIFRyYW5zaXRpb25EZWxheUZhY3RvciAqIG9ic3MgaW50ZXJ2YWwpCisgICAgICAgICAgIGRlbGF5IGFmdGVyIHRpbWUgb3V0IG1vdmUgQVAgZnJvbSBIVDIwIC0+IEhUNDAKKyAgICAgICAgICAgbW9kZQorICAgICAgICAgKi8KKyAgICAgICAgaWYgKFZPU19USU1FUl9TVEFURV9SVU5OSU5HID09IHNhcENvbnRleHQtPnNhcF9IVDIwNDBfdGltZXIuc3RhdGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc1N0YXR1cyA9IHZvc190aW1lcl9zdG9wKCZzYXBDb250ZXh0LT5zYXBfSFQyMDQwX3RpbWVyKTsKKyAgICAgICAgICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpCisgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkZhaWxlZCB0byBTdG9wIEhUMjAvNDAgdGltZXIiKSk7CisgICAgICAgIH0KKworICAgICAgICBkZWxheSA9CisgICAgICAgICAoc2FwQ29udGV4dC0+T2Jzc1NjYW5JbnRlcnZhbCAqIHNhcENvbnRleHQtPk9ic3NUcmFuc2l0aW9uRGVsYXlGYWN0b3IpOworCisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICBGTCgiU3RhcnQgSFQyMC80MCBpdHJhbnNpdGlvbiIKKyAgICAgICAgICAgICAgICAgICAiIHRpbWVyICglZCBzZWMpIiksIGRlbGF5KTsKKworICAgICAgICB2b3NTdGF0dXMgPSB2b3NfdGltZXJfc3RhcnQoICZzYXBDb250ZXh0LT5zYXBfSFQyMDQwX3RpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkZWxheSAqIDEwMDApKTsKKworICAgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoIkZhaWxlZCB0byBTdGFydCBIVDIwLzQwIHRpbWVyIikpOworICAgIH0KKyAgICByZXR1cm47Cit9CisjZW5kaWYKKworVk9TX1NUQVRVUworc2FwSXNQZWVyTWFjQWxsb3dlZChwdFNhcENvbnRleHQgc2FwQ29udGV4dCwgdl9VOF90ICpwZWVyTWFjKQoreworICAgIGlmIChlU0FQX0FMTE9XX0FMTCA9PSBzYXBDb250ZXh0LT5lU2FwTWFjQWRkckFjbE1vZGUpCisgICAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7CisKKyAgICBpZiAoc2FwU2VhcmNoTWFjTGlzdChzYXBDb250ZXh0LT5hY2NlcHRNYWNMaXN0LCBzYXBDb250ZXh0LT5uQWNjZXB0TWFjLCBwZWVyTWFjLCBOVUxMKSkKKyAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKKworICAgIGlmIChzYXBTZWFyY2hNYWNMaXN0KHNhcENvbnRleHQtPmRlbnlNYWNMaXN0LCBzYXBDb250ZXh0LT5uRGVueU1hYywgcGVlck1hYywgTlVMTCkpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgIkluICVzLCBQZWVyICJNQUNfQUREUkVTU19TVFIiIGluIGRlbnkgbGlzdCIsCisgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgTUFDX0FERFJfQVJSQVkocGVlck1hYykpOworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgfQorCisgICAgLy8gQSBuZXcgc3RhdGlvbiBDQU4gYXNzb2NpYXRlL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Q2hhbm5lbExpc3Q6IHN0YXJ0Q2hhbm5lbCAlZCxFbmRDaGFubmVsICVkLE9wZXJhdGluZ2JhbmQ6JWQiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fLHN0YXJ0Q2hhbm5lbE51bSxlbmRDaGFubmVsTnVtLG9wZXJhdGluZ0JhbmQpOworCisgICAgICAgIHN3aXRjaChvcGVyYXRpbmdCYW5kKQorICAgICAgICB7CisgICAgICAgIGNhc2UgZVNBUF9SRl9TVUJCQU5EXzJfNF9HSFo6CisgICAgICAgICAgICBiYW5kU3RhcnRDaGFubmVsID0gUkZfQ0hBTl8xOworICAgICAgICAgICAgYmFuZEVuZENoYW5uZWwgPSBSRl9DSEFOXzE0OworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlU0FQX1JGX1NVQkJBTkRfNV9MT1dfR0haOgorICAgICAgICAgICAgYmFuZFN0YXJ0Q2hhbm5lbCA9IFJGX0NIQU5fMzY7CisgICAgICAgICAgICBiYW5kRW5kQ2hhbm5lbCA9IFJGX0NIQU5fNjQ7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVTQVBfUkZfU1VCQkFORF81X01JRF9HSFo6CisgICAgICAgICAgICBiYW5kU3RhcnRDaGFubmVsID0gUkZfQ0hBTl8xMDA7CisgICAgICAgICAgICBiYW5kRW5kQ2hhbm5lbCA9IFJGX0NIQU5fMTQwOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlU0FQX1JGX1NVQkJBTkRfNV9ISUdIX0dIWjoKKyAgICAgICAgICAgIGJhbmRTdGFydENoYW5uZWwgPSBSRl9DSEFOXzE0OTsKKyAgICAgICAgICAgIGJhbmRFbmRDaGFubmVsID0gUkZfQ0hBTl8xNjU7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVTQVBfUkZfU1VCQkFORF81X0FMTF9HSFo6CisgICAgICAgICAgICBiYW5kU3RhcnRDaGFubmVsID0gUkZfQ0hBTl8zNjsKKyAgICAgICAgICAgIGJhbmRFbmRDaGFubmVsID0gUkZfQ0hBTl8xNjU7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAic2FwR2V0Q2hhbm5lbExpc3Q6T3BlcmF0aW5nQmFuZCBub3QgdmFsaWQgIik7CisgICAgICAgICAgICAvKiBhc3N1bWUgMi40IEdIeiAqLworICAgICAgICAgICAgYmFuZFN0YXJ0Q2hhbm5lbCA9IFJGX0NIQU5fMTsKKyAgICAgICAgICAgIGJhbmRFbmRDaGFubmVsID0gUkZfQ0hBTl8xNDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICIlczogZXhwYW5kZWQgc3RhcnRDaGFubmVsICVkLEVuZENoYW5uZWwgJWQsT3BlcmF0aW5nYmFuZDolZCIsCisgICAgICAgICAgICAgICAgX19mdW5jX18sc3RhcnRDaGFubmVsTnVtLGVuZENoYW5uZWxOdW0sb3BlcmF0aW5nQmFuZCk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGlmICggc2FwQ29udGV4dC0+YWxsQmFuZFNjYW5uZWQgPT0gZVNBUF9GQUxTRSApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vZmlyc3QgYmFuZCBzY2FuCisgICAgICAgICAgICBzYXBDb250ZXh0LT5jdXJyZW50UHJlZmVycmVkQmFuZCA9IHNhcENvbnRleHQtPnNjYW5CYW5kUHJlZmVyZW5jZTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vc2NhbiBuZXh0IGJhbmQKKyAgICAgICAgICAgIGlmICggZUNTUl9CQU5EXzI0ID09IHNhcENvbnRleHQtPnNjYW5CYW5kUHJlZmVyZW5jZSApCisgICAgICAgICAgICAgICAgc2FwQ29udGV4dC0+Y3VycmVudFByZWZlcnJlZEJhbmQgPSBlQ1NSX0JBTkRfNUc7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgc2FwQ29udGV4dC0+Y3VycmVudFByZWZlcnJlZEJhbmQgPSBlQ1NSX0JBTkRfMjQ7CisgICAgICAgIH0KKyAgICAgICAgc3dpdGNoKHNhcENvbnRleHQtPmN1cnJlbnRQcmVmZXJyZWRCYW5kKQorICAgICAgICB7CisgICAgICAgIGNhc2UgZUNTUl9CQU5EXzI0OgorICAgICAgICAgICAgYmFuZFN0YXJ0Q2hhbm5lbCA9IFJGX0NIQU5fMTsKKyAgICAgICAgICAgIGJhbmRFbmRDaGFubmVsID0gUkZfQ0hBTl8xNDsKKyAgICAgICAgICAgIHN0YXJ0Q2hhbm5lbE51bSA9IDE7CisgICAgICAgICAgICBlbmRDaGFubmVsTnVtID0gMTQ7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVDU1JfQkFORF81RzoKKyAgICAgICAgICAgIGJhbmRTdGFydENoYW5uZWwgPSBSRl9DSEFOXzM2OworICAgICAgICAgICAgYmFuZEVuZENoYW5uZWwgPSBSRl9DSEFOXzE2NTsKKyAgICAgICAgICAgIHN0YXJ0Q2hhbm5lbE51bSA9IDM2OworICAgICAgICAgICAgZW5kQ2hhbm5lbE51bSA9IDE2NTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICJzYXBHZXRDaGFubmVsTGlzdDpiYW5kUHJlZmVyZW5jZSBub3QgdmFsaWQgIik7CisgICAgICAg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fKTsKKyAgICAgICAgKm51bWJlck9mQ2hhbm5lbHMgPSAwOworICAgICAgICAqY2hhbm5lbExpc3QgPSBOVUxMOworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX1JFU09VUkNFUzsKKyAgICB9CisKKyAgICAvKlNlYXJjaCBmb3IgdGhlIEFjdGl2ZSBjaGFubmVscyBpbiB0aGUgZ2l2ZW4gcmFuZ2UgKi8KKyAgICBjaGFubmVsQ291bnQgPSAwOworICAgIGZvciggbG9vcENvdW50ID0gYmFuZFN0YXJ0Q2hhbm5lbDsgbG9vcENvdW50IDw9IGJhbmRFbmRDaGFubmVsOyBsb29wQ291bnQrKyApCisgICAgeworICAgICAgICBpZigoc3RhcnRDaGFubmVsTnVtIDw9IHJmQ2hhbm5lbHNbbG9vcENvdW50XS5jaGFubmVsTnVtKSYmCisgICAgICAgICAgICAoZW5kQ2hhbm5lbE51bSA+PSByZkNoYW5uZWxzW2xvb3BDb3VudF0uY2hhbm5lbE51bSApKQorICAgICAgICB7CisgICAgICAgICAgICBpZiggcmVnQ2hhbm5lbHNbbG9vcENvdW50XS5lbmFibGVkICkKKyAgICAgICAgICAgIHsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fQ0hfQVZPSUQKKyAgICAgICAgICAgICAgICBmb3IoIGkgPSAwOyBpIDwgTlVNXzIwTUhaX1JGX0NIQU5ORUxTOyBpKysgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoIChzYWZlQ2hhbm5lbHNbaV0uY2hhbm5lbE51bWJlciA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZkNoYW5uZWxzW2xvb3BDb3VudF0uY2hhbm5lbE51bSkgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvKiBDaGVjayBpZiBjaGFubmVsIGlzIHNhZmUgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKFZPU19UUlVFID09IHNhZmVDaGFubmVsc1tpXS5pc1NhZmUpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2NoYW5uZWxDb3VudF0gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJmQ2hhbm5lbHNbbG9vcENvdW50XS5jaGFubmVsTnVtOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxDb3VudCsrOworI2lmZGVmIEZFQVRVUkVfV0xBTl9DSF9BVk9JRAorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBpZiAoMCA9PSBjaGFubmVsQ291bnQpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICJzYXBHZXRDaGFubmVsTGlzdDpObyBhY3RpdmUgY2hhbm5lbHMgcHJlc2VudCBpbiB0aGUgZ2l2ZW4gcmFuZ2UgZm9yIHRoZSBjdXJyZW50IHJlZ2lvbiIpOworICAgICAgICAvKkxURSBDT0VYOiBjaGFubmVsIHJhbmdlIG91dHNpZGUgdGhlIHJlc3RyaWN0ZWQgMi40R0h6IGJhbmQgbGltaXRzKi8KKyAgICAgICAgaWYgKGVuYWJsZUxURUNvZXggJiYgKHN0YXJ0Q2hhbm5lbE51bSA+IGJhbmRFbmRDaGFubmVsKSkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgInNhcEdldENoYW5uZWxMaXN0OlNBUCBjYW5ub3QgYmUgc3RhcnRlZCBhcyBMVEUgQ09FWCByZXN0cmljdGVkIDIuNEdIeiBsaW1pdHMiKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qIHJldHVybiB0aGUgY2hhbm5lbCBsaXN0IGFuZCBudW1iZXIgb2YgY2hhbm5lbHMgdG8gc2NhbiovCisgICAgKm51bWJlck9mQ2hhbm5lbHMgPSBjaGFubmVsQ291bnQ7CisgICAgaWYoY2hhbm5lbENvdW50ICE9IDApCisgICAgeworICAgICAgICpjaGFubmVsTGlzdCA9IGxpc3Q7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgKmNoYW5uZWxMaXN0ID0gTlVMTDsKKyAgICAgICAgdm9zX21lbV9mcmVlKGxpc3QpOworICAgIH0KKworICAgIGZvciAobG9vcENvdW50ID0gMDsgbG9vcENvdW50IDxjaGFubmVsQ291bnQ7IGxvb3BDb3VudCArKyApCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfREVCVUcsCisgICAgICAgICAgICAgIiVzOiBjaGFubmVsIG51bWJlcjogJWQiLAorICAgICAgICAgICAgIF9fZnVuY19fLGxpc3RbbG9vcENvdW50XSk7CisgICAgfQorICAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9CisjZW5kaWYKKworI2lmZGVmIFdMQU5fRkVBVFVSRV9BUF9IVDQwXzI0Rworc3RhdGljIFZPU19TVEFUVVMgc2FwR2V0Q2hhbm5lbExpc3RGb3JPYnNzKHRIYWxIYW5kbGUgaGFsSGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0U2FwQ29udGV4dCBwc2FwQ3R4LCB2X1U4X3QgKipjaGFubmVsTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKm51bWJlck9mQ2hhbm5lbHMpCit7CisgICAgdl9VMzJfdCBzdGFydENoYW5uZWxOdW07CisgICAgdl9VMzJfdCBlbmRDaG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AgICAgICAgICAgIFcgTCBBIE4gICBTIEEgUCAgUCBBIEwgICBMIEEgWSBFIFIgCisgICAgICAgICAgICAgICAgICAgICAgIEkgTiBUIEUgUiBOIEEgTCAgQSBQIEkKKworCitERVNDUklQVElPTgorICBUaGlzIGZpbGUgY29udGFpbnMgdGhlIGludGVybmFsIEFQSSBleHBvc2VkIGJ5IHRoZSB3bGFuIFNBUCBQQUwgbGF5ZXIgCisgIG1vZHVsZS4KKworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICBFRElUIEhJU1RPUlkgRk9SIEZJTEUKKworCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLgorICBOb3RpY2UgdGhhdCBjaGFuZ2VzIGFyZSBsaXN0ZWQgaW4gcmV2ZXJzZSBjaHJvbm9sb2dpY2FsIG9yZGVyLgorCisKKyAgJEhlYWRlcjogL2N5Z2RyaXZlL2QvQnVpbGRzL003MjAxSlNEQ0FBUEFENTIyNDBCL1dNL3BsYXRmb3JtL21zbTcyMDAvU3JjL0RyaXZlcnMvU0QvQ2xpZW50RHJpdmVycy9XTEFOL1FDVF9CVEFNUF9SU04vQ09SRS9CQVAvc3JjL2JhcEludGVybmFsLmgsdiAxLjcgMjAwOS8wMy8wOSAwODo1MDo0MyByZ2lkdmFuaSBFeHAgcmdpZHZhbmkgJCAkRGF0ZVRpbWU6ICQgJEF1dGhvcjoganptdWRhICQKKworCit3aGVuICAgICAgICAgICB3aG8gICAgICAgIHdoYXQsIHdoZXJlLCB3aHkKKy0tLS0tLS0tICAgICAtLS0gICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiswOS8xNS8wOCAgICBTT0ZUQVAgICAgIENyZWF0ZWQgbW9kdWxlLgorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgICAgICBJTkNMVURFIEZJTEVTIEZPUiBNT0RVTEUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKiBJbmNsdWRlIEZpbGVzCisgKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyNpbmNsdWRlICJ2b3NfYXBpLmgiIAorI2luY2x1ZGUgInZvc19wYWNrZXQuaCIgCisKKy8vIFBpY2sgdXAgdGhlIENTUiBBUEkgZGVmaW5pdGlvbnMKKyNpbmNsdWRlICJjc3JBcGkuaCIKKyNpbmNsdWRlICJzYXBBcGkuaCIKKyNpbmNsdWRlICJzYXBGc21fZXh0LmgiCisjaW5jbHVkZSAic2FwQ2hTZWxlY3QuaCIKKyNpbmNsdWRlICJ3bGFuX2hkZF9kcF91dGlscy5oIgorI2luY2x1ZGUgIndsYW5faGRkX21haW4uaCIKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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gICAgIGtleV9tYXRlcmlhbFszMl07CisKKyAgICAvLyBJbmNsdWRlIHRoZSBhc3NvY2lhdGlvbnMgTUFDIGFkZHJlc3NlcworICAgIHZfVThfdCAgICAgICAgICAgICAgc2VsZl9tYWNfYWRkcltWT1NfTUFDX0FERFJFU1NfTEVOXTsKKworICAgIC8vIE93biBTU0lEICAKKyAgICB2X1U4X3QgICAgICAgICAgICAgIG93blNzaWRbTUFYX1NTSURfTEVOXTsKKyAgICB2X1UzMl90ICAgICAgICAgICAgIG93blNzaWRMZW47CisKKyAgICAvLyBGbGFnIGZvciBzaWduYWxpbmcgaWYgc2VjdXJpdHkgaXMgZW5hYmxlZAorICAgIHZfVThfdCAgICAgICAgICAgICAgdWNTZWNFbmFibGVkOworCisgICAgLy8gSW5jbHVkZSB0aGUgU01FKENTUikgY29udGV4dCBoZXJlCisgICAgdENzclJvYW1Qcm9maWxlICAgICBjc3JSb2FtUHJvZmlsZTsgCisgICAgdl9VMzJfdCAgICAgICAgICAgICBjc3JSb2FtSWQ7CisKKyAgICAvL1NhcCBzZXNzaW9uCisgICAgdEFOSV9CT09MRUFOICAgICAgICBpc1NhcFNlc3Npb25PcGVuOworCisgICAgLy8gU0FQIGV2ZW50IENhbGxiYWNrIHRvIGhkZAorICAgIHRwV0xBTl9TQVBFdmVudENCICAgcGZuU2FwRXZlbnRDYWxsYmFjazsKKworICAgIC8vIEluY2x1ZGUgdGhlIGVuY2xvc2luZyBWT1NTIGNvbnRleHQgaGVyZQorICAgIHZfUFZPSURfdCAgICAgICAgICAgcHZvc0dDdHg7IAorCisgICAgLy8gSW5jbHVkZSB0aGUgc3RhdGUgbWFjaGluZSBzdHJ1Y3R1cmUgaGVyZSwgc3RhdGUgdmFyIHRoYXQga2VlcHMgdHJhY2sgb2Ygc3RhdGUgbWFjaGluZQorICAgIGVTYXBGc21TdGF0ZXNfdCAgICAgc2Fwc01hY2hpbmU7CisKKyAgICAvLyBBY3R1YWwgc3RvcmFnZSBmb3IgQVAgYW5kIHNlbGYgKFNUQSkgU1NJRCAKKyAgICB0Q3NyU1NJREluZm8gICAgICAgIFNTSURMaXN0WzJdOworCisgICAgLy8gQWN0dWFsIHN0b3JhZ2UgZm9yIEFQIGJzc2lkIAorICAgIHRDc3JCc3NpZCAgICAgICAgICAgYnNzaWQ7CisKKyAgICAvLyBNYWMgZmlsdGVyaW5nIHNldHRpbmdzCisgICAgZVNhcE1hY0FkZHJBQ0wgICAgICBlU2FwTWFjQWRkckFjbE1vZGU7CisgICAgdl9NQUNBRERSX3QgICAgICAgICBhY2NlcHRNYWNMaXN0W01BWF9BQ0xfTUFDX0FERFJFU1NdOworICAgIHZfVThfdCAgICAgICAgICAgICAgbkFjY2VwdE1hYzsKKyAgICB2X01BQ0FERFJfdCAgICAgICAgIGRlbnlNYWNMaXN0W01BWF9BQ0xfTUFDX0FERFJFU1NdOworICAgIHZfVThfdCAgICAgICAgICAgICAgbkRlbnlNYWM7CisKKyAgICAvLyBRT1MgY29uZmlnCisgICAgdFNhcFFvc0NmZyAgICAgICAgU2FwUW9zQ2ZnOworCisgICAgdl9QVk9JRF90ICAgICAgICAgcFVzckNvbnRleHQ7CisKKyAgICB2X1UzMl90ICAgICAgICAgICBuU3RhV1BBUlNuUmVxSWVMZW5ndGg7CisgICAgdl9VOF90ICAgICAgICAgICAgcFN0YVdwYVJzblJlcUlFW01BWF9BU1NPQ19JTkRfSUVfTEVOXTsgCisgICAgdFNpckFQV1BTSUVzICAgICAgQVBXUFNJRXM7CisgICAgdFNpclJTTmllICAgICAgICAgQVBXUEFSU05JRXM7CisKKyAgICB2X1UzMl90ICAgICAgICAgICBuU3RhQWRkSWVMZW5ndGg7CisgICAgdl9VOF90ICAgICAgICAgICAgcFN0YUFkZElFW01BWF9BU1NPQ19JTkRfSUVfTEVOXTsgCisgICAgdl9VOF90ICAgICAgICAgICAgKmNoYW5uZWxMaXN0OworICAgIHZfVThfdCAgICAgICAgICAgIG51bW9mQ2hhbm5lbDsKKyAgICB0U2F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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKiBGdW5jdGlvbiBEZWNsYXJhdGlvbnMgYW5kIERvY3VtZW50YXRpb24KKyAqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworI2lmZGVmIFdMQU5fRkVBVFVSRV9BUF9IVDQwXzI0RworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIHNhcEdldDI0R09CU1NBZmZlY3RlZENoYW5uZWwoKQorCisgIERFU0NSSVBUSU9OCisgICAgR2V0IE9CU1MgQWZmZWN0ZWQgQ2hhbm5lbCBubyBmb3IgU0FQCisKKyAgREVQRU5ERU5DSUVTCisgICAgTkEuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICB0SGFsSGFuZGxlOiAgdGhlIHRIYWxIYW5kbGUgcGFzc2VkIGluIHdpdGggdGhlIHNjYW4gcmVxdWVzdAorICAgIHB0U2FwQ29udGV4dDogUG9pbnRlciB0byBTQVAgY29udGV4dAorCisgIFJFVFVSTiBWQUxVRQorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworZUhhbFN0YXR1cyBzYXBHZXQyNEdPQlNTQWZmZWN0ZWRDaGFubmVsKHRIYWxIYW5kbGUgaGFsSGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRTYXBDb250ZXh0IHBzYXBDdHgpOworI2VuZGlmCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOU0FQX1NjYW5DYWxsYmFjaygpCisKKyAgREVTQ1JJUFRJT04gCisgICAgQ2FsbGJhY2sgZm9yIFNjYW4gKHNjYW4gcmVzdWx0cykgRXZlbnRzICAKKworICBERVBFTkRFTkNJRVMgCisgICAgTkEuIAorCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgIHRIYWxIYW5kbGU6ICB0aGUgdEhhbEhhbmRsZSBwYXNzZWQgaW4gd2l0aCB0aGUgc2NhbiByZXF1ZXN0CisgICAgKnAyOiB0aGUgc2Vjb25kIGNvbnRleHQgcGFzcyBpbiBmb3IgdGhlIGNhbGxlciwgb3BhcXVlIHNhcCBIYW5kbGUgaGVyZQorICAgIHNjYW5JRDoKKyAgICBzdGF0dXM6IFN0YXR1cyBvZiBzY2FuIC1zdWNjZXNzLCBmYWlsdXJlIG9yIGFib3J0IAorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSBlSGFsU3RhdHVzIGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbiAgCisKKyAgICBlSEFMX1NUQVRVU19TVUNDRVNTOiAgU3VjY2VzcworICAKKyAgU0lERSBFRkZFQ1RTIAorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK2VIYWxTdGF0dXMKK1dMQU5TQVBfU2NhbkNhbGxiYWNrCisoCisgIHRIYWxIYW5kbGUgaGFsSGFuZGxlLCAKKyAgdm9pZCAqcENvbnRleHQsCisgIHZfVTMyX3Qgc2NhbklELCAKKyAgZUNzclNjYW5TdGF0dXMgc2NhblN0YXR1cworKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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TQVBfUm9hbUNhbGxiYWNrCisoCisgIHZvaWQgKnBDb250ZXh0LCAKKyAgdENzclJvYW1JbmZvICpwQ3NyUm9hbUluZm8sCisgIHZfVTMyX3Qgcm9hbUlkLCAKKyAgZVJvYW1DbWRTdGF0dXMgcm9hbVN0YXR1cywgCisgIGVDc3JSb2FtUmVzdWx0IHJvYW1SZXN1bHQKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOU0FQX0NsZWFuQ0IKKworICBERVNDUklQVElPTiAKKyAgICBDbGVhciBvdXQgYWxsIGZpZWxkcyBpbiB0aGUgU0FQIGNvbnRleHQuCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcFNhcEN0eDogIHBvaW50ZXIgdG8gdGhlIFNBUCBjb250cm9sIGJsb2NrCisgICAgZnJlZUZsYWc6ICAgZmxhZyBpbmRpY2F0aW5nIHdoZXRoZXIgdG8gZnJlZSBhbnkgYWxsb2NhdGlvbnMuCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgcG9pbnRlciB0byBTQVAgY2IgaXMgTlVMTCA7IGFjY2VzcyB3b3VsZCBjYXVzZSBhIHBhZ2UgCisgICAgICAgICAgICAgICAgICAgICAgICAgZmF1bHQgIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KSAKKworICBTSURFIEVGRkVDVFMgCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyAKK1dMQU5TQVBfQ2xlYW5DQgorKCAKKyAgcHRTYXBDb250ZXh0ICBwU2FwQ3R4LAorICB2X1UzMl90IGZyZWVGbGFnIC8qIElmIDAgZG8gbm90IGVtcHR5ICovCispOworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5TYXBGc20KKworICBERVNDUklQVElPTiAKKyAgICBTQVAgZm9yd2FyZCBzdGF0ZSBtYWNoaW5lIHRvIGhhbmRsZSB0aGUgc3RhdGVzIG9mIHRoZSBTQVAgCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgc2FwQ29udGV4dDogIHBvaW50ZXIgdG8gdGhlIFNBUCBjb250cm9sIGJsb2NrCisgICAgc2FwRXZlbnQgICA6IFNBUCBldmVudAorICAgIHN0YXR1cyA6IHN0YXR1cyBvZiBTQVAgc3RhdGUgbWFjaGluZQorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFN0YXR1cyBvZiB0aGUgU0FQIGZvcndhcmQgbWFjaGluZQorCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgcG9pbnRlciB0byBTQVAgY2IgaXMgTlVMTCA7IGFjY2VzcyB3b3VsZCBjYXVzZSBhIHBhZ2UgCisgICAgICAgICAgICAgICAgICAgICAgICAgZmF1bHQgIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KSAKKworICBTSURFIEVGRkVDVFMgCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCitWT1NfU1RBVFVTCitTYXBGc20KKygKKyAgICBwdFNhcENvbnRleHQgc2FwQ29udGV4dCwgLyogc2FwQ29udGV4dCB2YWx1ZSAqLyAgICAKKyAgICBwdFdMQU5fU0FQRXZlbnQgc2FwRXZlbnQsIC8qIFN0YXRlIG1hY2hpbmUgZXZlbnQgKi8KKyAgICB2X1U4X3QgKnN0YXR1cyAgICAvKiByZXR1cm4gdGhlIFNBUCBzdGF0dXMgaGVyZSAqLworKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5TQVBfcG1jRnVsbFB3clJlcUNCCisKKyAgREVTQ1JJUFRJT04gCisgICAgQ2FsbGJhY2sgcHJvdmlkZSB0byBQTUMgaW4gdGhlIHBtY1JlcXVlc3RGdWxsUG93ZXIgQVBJLiAgICAgCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgY2FsbGJhY2tDb250ZXh0OiAgVGhlIHVzZXIgcGFzc2VkIGluIGEgY29udGV4dCB0byBpZGVudGlmeSAKKyAgICBzdGF0dXM6ICAgICAgICAgICBUaGUgaGFsU3RhdHVzICAgICAKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBOb25lCisKKyAgU0lERSBFRkZFQ1RTIAorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgCitXTEFOU0FQX3BtY0Z1bGxQd3JSZXFDQgorKCAKKyAgdm9pZCAqY2FsbGJhY2tDb250ZXh0LCAKKyAgZUhhbFN0YXR1cyBzdGF0dXMKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBzYXBTZWxlY3RDaGFubmVsCisKKyAgREVTQ1JJUFRJT04gCisgICAgUnVucyBhIGFsZ29yaXRobSB0byBzZWxlY3QgdGhlIGJlc3QgY2hhbm5lbCB0byBvcGVyYXRlIGluIGZvciBTb2Z0IEFQIGluIDIuNEdIeiBiYW5kCisKKyAgREVQRU5ERU5DSUVTIAorCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgICAgIGhhbEhhbmRsZSA6IFBvaW50ZXIgdG8gSEFMIGhhbmRsZQorICAgICAgIHBTYXBDdHggOiBQb2ludGVyIHRvIFNBUCBjb250ZXh0CisgICAgICAgcFJlc3VsdCA6IFBvaW50ZXIgdG8gdFNjYW5SZXN1bHRIYW5kbGUKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBJZiBTVUNDRVNTIGNoYW5uZWwgbnVtYmVyIG9yIHplcm8gZm9yIEZBSUxVUkUuCisKKyAgU0lERSBFRkZFQ1RTIAorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKwordl9VOF90IHNhcFNlbGVjdENoYW5uZWwodEhhbEhhbmRsZSBoYWxIYW5kbGUsIHB0U2FwQ29udGV4dCBwU2FwQ3R4LCB0U2NhblJlc3VsdEhhbmRsZSBwU2NhblJlc3VsdCk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBzYXBTaWduYWxIRERldmVudAorCisgIERFU0NSSVBUSU9OIAorICAgIFNBUCBIREQgZXZlbnQgY2FsbGJhY2sgZnVuY3Rpb24KKworICBERVBFTkRFTkNJRVMgCisKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgICAgc2FwQ29udGV4dCA6IFBvaW50ZXIgdG8gU0FQIGhhbmRsZQorICAgICAgIHBDc3JSb2FtSW5mbyA6IGNzclJvYW1wcm9maWxlIAorICAgICAgIHNhcEhkZGV2ZW50ICAgIDogU0FQIEhERCBjYWxsYmFjayBldmVudAorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIElmIFNVQ0NFU1Mgb3IgRkFJTFVSRS4KKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKK1ZPU19TVEFUVVMKK3NhcFNpZ25hbEhERGV2ZW50KCBwdFNhcENvbnRleHQgc2FwQ29udGV4dCwgdENzclJvYW1JbmZvICogcENzclJvYW1JbmZvLCBlU2FwSGRkRXZlbnQgc2FwSGRkZXZlbnQsIHZvaWQgKik7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBzYXBGc20KKworICBERVNDUklQVElPTiAKKyAgICBTQVAgRm9yd2FyZCBzdGF0ZSBtYWNoaW5lCisKKyAgREVQRU5ERU5DSUVTIAorICAgIAorICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICAgICBzYXBDb250ZXh0IDogUG9pbnRlciB0byBTQVAgaGFuZGxlCisgICAgICAgc2FwRXZlbnQgOiBzdGF0ZSBtYWNoaW5lIGV2ZW50CisKKyBSRVRVUk4gVkFMVUUKKyAgICBJZiBTVUNDRVNTIG9yIEZBSUxVUkUuCisKKyAgU0lERSBFRkZFQ1RTIAorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK3NhcEZzbQorKAorICAgIHB0U2FwQ29udGV4dCBzYXBDb250ZXh0LCAgICAvKiBzYXBDb250ZXh0IHZhbHVlICovCisgICAgcHRXTEFOX1NBUEV2ZW50IHNhcEV2ZW50ICAgLyogU3RhdGUgbWFjaGluZSBldmVudCAqLworKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIHNhcENvbnZlcnRUb0NzclByb2ZpbGUKKworICBERVNDUklQVElPTiAKKyAgICBzYXBDb252ZXJ0VG9Dc3JQcm9maWxlCisKKyAgREVQRU5ERU5DSUVTIAorCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgICAgIHBjb25maWdfcGFyYW1zIDogUG9pbnRlciB0byBjb25maWd1cmF0aW9uIHN0cnVjdHVyZQorICAgICAgIGJzc1R5cGUgOiBTb2Z0QVAgdHlwZQorICAgICAgIHByb2ZpbGUgOiBwb2ludGVyIHRvIGEgY3NyUHJvZmlsZSB0aGF0IG5lZWRzIHRvIGJlIHBhc3NlZAorCisgUkVUVVJOIFZBTFVFCisgICAgSWYgU1VDQ0VTUyBvciBGQUlMVVJFLgorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK2VTYXBTdGF0dXMKK3NhcGNvbnZlcnRUb0NzclByb2ZpbGUodHNhcF9Db25maWdfdCAqcGNvbmZpZ19wYXJhbXMsIGVDc3JSb2FtQnNzVHlwZSBic3NUeXBlLCB0Q3NyUm9hbVByb2ZpbGUgKnByb2ZpbGUpOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgc2FwRnJlZVJvYW1Qcm9maWxlCisKKyAgREVTQ1JJUFRJT04gCisgICAgc2FwQ29udmVydFRvQ3NyUHJvZmlsZQorCisgIERFUEVOREVOQ0lFUyAKKworICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICAgICBwcm9maWxlIDogcG9pbnRlciB0byBhIGNzclByb2ZpbGUgdGhhdCBuZWVkcyB0byBiZSBmcmVlZAorCisgUkVUVVJOIFZBTFVFCisgICAgSWYgU1VDQ0VTUyBvciBGQUlMVVJFLgorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgc2FwRnJlZVJvYW1Qcm9maWxlKHRDc3JSb2FtUHJvZmlsZSAqcHJvZmlsZSk7CisKKworI2lmZGVmIFdMQU5fRkVBVFVSRV9BUF9IVDQwXzI0RworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBzYXBBZGRIVDQwSW50b2xlcmFudFN0YQorCisgIERFU0NSSVBUSU9OCisgICAgQWRkIEhUNDAgSW50b2xlcmFudCBTVEEgJiBNb3ZlIFNBUCBmcm9tIEhUNDAgdG8gSFQyMAorCisgIERFUEVOREVOQ0lFUworICAgIE5BLgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgc2FwQ29udGV4dCAgIDogU2FwIENvbnRleHQgdmFsdWUKKyAgICBwQ3NyUm9hbUluZm8gOiBQb2ludGVyIHRvIENTUiBpbmZvCisKKyAgUkVUVVJOIFZBTFVFCisKKyAgU0lERSBFRkZFQ1RTCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKwordm9pZCBzYXBBZGRIVDQwSW50b2xlcmFudFN0YShwdFNhcENvbnRleHQgc2FwQ29udGV4dCwgdENzclJvYW1JbmZvICpwQ3NyUm9hbUluZm8pOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIHNhcFJlbW92ZUhUNDBJbnRvbGVyYW50U3RhCisKKyAgREVTQ1JJUFRJT04KKyAgICBSZW1vdmUgSFQ0MCBJbnRvbGVyYW50IFNUQSAmIE1vdmUgU0FQIGZyb20gSFQ0MCB0byBIVDIwCisKKyAgREVQRU5ERU5DSUVTCisgICAgTkEuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICBzYXBDb250ZXh0ICAgOiBTYXAgQ29udGV4dCB2YWx1ZQorICAgIHBDc3JSb2FtSW5mbyA6IFBvaW50ZXIgdG8gQ1NSIGluZm8KKworICBSRVRVUk4gVkFMVUUKKworICBTSURFIEVGRkVDVFMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCit2b2lkIHNhcFJlbW92ZUhUNDBJbnRvbGVyYW50U3RhKHB0U2FwQ29udGV4dCBzYXBDb250ZXh0LCB0Q3NyUm9hbUluZm8gKnBDc3JSb2FtSW5mbyk7CisjZW5kaWYKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIHNhcElzUGVlck1hY0FsbG93ZWQKKworICBERVNDUklQVElPTiAKKyAgICBGdW5jdGlvbiB0byBpbXBsZW1lbnQgTUFDIGZpbHRlcmluZyBmb3Igc3RhdGlvbiBhc3NvY2lhdGlvbiBpbiBTb2Z0QVAKKworICBERVBFTkRFTkNJRVMgCisKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgICAgc2FwQ29udGV4dCA6IFBvaW50ZXIgdG8gU0FQIGhhbmRsZQorICAgICAgIHBlZXJNYWMgICAgOiBNYWMgYWRkcmVzcyBvZiB0aGUgcGVlcgorCisgUkVUVVJOIFZBTFVFCisgICAgSWYgU1VDQ0VTUyBvciBGQUlMVVJFLgorCisgIFNJREUgRUZGRUNUUyAKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitzYXBJc1BlZXJNYWNBbGxvd2VkKHB0U2FwQ29udGV4dCBzYXBDb250ZXh0LCB2X1U4X3QgKnBlZXJNYWMpOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgc2FwU29ydE1hY0xpc3QKKworICBERVNDUklQVElPTiAKKyAgICBGdW5jdGlvbiB0byBpbXBsZW1lbnQgc29ydGluZyBvZiBNQUMgYWRkcmVzc2VzCisKKyAgREVQRU5ERU5DSUVTIAorCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgICAgIG1hY0xpc3QgOiBQb2ludGVyIHRvIG1hYyBhZGRyZXNzIGFycmF5CisgICAgICAgc2l6ZSAgICA6IE51bWJlciBvZiBlbnRyaWVzIGluIG1hYyBhZGRyZXNzIGFycmF5CisKKyBSRVRVUk4gVkFMVUUKKyAgICBOb25lCisKKyAgU0lERSBFRkZFQ1RTIAorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQKK3NhcFNvcnRNYWNMaXN0KHZfTUFDQUREUl90ICptYWNMaXN0LCB2X1U4X3Qgc2l6ZSk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBzYXBBZGRNYWNUb0FDTAorCisgIERFU0NSSVBUSU9OCisgICAgRnVuY3Rpb24gdG8gQUREIGEgbWFjIGFkZHJlc3MgaW4gYW4gQUNMLgorICAgIFRoZSBmdW5jdGlvbiBlbnN1cmVzIHRoYXQgdGhlIEFDTCBsaXN0IHJlbWFpbnMgc29ydGVkIGFmdGVyIHRoZSBhZGRpdGlvbi4KKyAgICBUaGlzIEFQSSBkb2VzIG5vdCB0YWtlIGNhcmUgb2YgYnVmZmVyIG92ZXJmbG93IGkuZS4gaWYgdGhlIGxpc3QgaXMgYWxyZWFkeQorICAgIG1heGVkIG91dCB3aGlsZSBhZGRpbmcgYSBtYWMgYWRkcmVzcywgaXQgd2lsbCBzdGlsbCB0cnkgdG8gYWRkLgorICAgIFRoZSBjYWxsZXIgbXVzdCB0YWtlIGNhcmUgdGhhdCB0aGUgQUNMIHNpemUgaXMgbGVzcyB0aGFuIE1BWF9BQ0xfTUFDX0FERFJFU1MKKyAgICBiZWZvcmUgY2FsbGluZyB0aGlzIGZ1bmN0aW9uLgorCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgICAgbWFjTGlzdCAgICAgICAgICA6IEFDTCBsaXN0IG9mIG1hYyBhZGRyZXNzZXMgKGJsYWNrL3doaXRlIGxpc3QpCisgICAgICAgc2l6ZSAoSS9PKSAgICAgICA6IHNpemUgb2YgdGhlIEFDTC4gSXQgaXMgYW4gSS9PIGFyZy4gVGhlIEFQSSB0YWtlcyBjYXJlCisgICAgICAgICAgICAgICAgICAgICAgICAgIG9mIGluY3JlbWVudGluZyB0aGUgc2l6ZSBieSAxLgorICAgICAgIHBlZXJNYWMgICAgICAgICAgOiBNYWMgYWRkcmVzcyBvZiB0aGUgcGVlciB0byBiZSBhZGRlZAorCisgUkVUVVJOIFZBTFVFCisgICAgTm9uZS4KKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkCitzYXBBZGRNYWNUb0FDTCh2X01BQ0FERFJfdCAqbWFjTGlzdCwgdl9VOF90ICpzaXplLCB2X1U4X3QgKnBlZXJNYWMpOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgc2FwUmVtb3ZlTWFjRnJvbUFDTAorCisgIERFU0NSSVBUSU9OIAorICAgIEZ1bmN0aW9uIHRvIFJFTU9WRSBhIG1hYyBhZGRyZXNzIGZyb20gYW4gQUNMLgorICAgIFRoZSBmdW5jdGlvbiBlbnN1cmVzIHRoYXQgdGhlIEFDTCBsaXN0IHJlbWFpbnMgc29ydGVkIGFmdGVyIHRoZSBERUxFVElPTi4KKworICBERVBFTkRFTkNJRVMgCisKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgICAgbWFjTGlzdCAgICAgICAgICA6IEFDTCBsaXN0IG9mIG1hYyBhZGRyZXNzZXMgKGJsYWNrL3doaXRlIGxpc3QpCisgICAgICAgc2l6ZSAoSS9PKSAgICAgICA6IHNpemUgb2YgdGhlIEFDTC4gSXQgaXMgYW4gSS9PIGFyZy4gVGhlIEFQSSB0YWtlcyBjYXJlIG9mIGRlY3JlbWVudGluZyB0aGUgc2l6ZSBieSAxLgorICAgICAgIGluZGV4ICAgICAgICAgICAgOiBpbmRleCBpbiB0aGUgQUNMIGxpc3Qgd2hlcmUgdGhlIHBlZXJNYWMgaXMgcHJlc2VudAorICAgICAgICAgICAgICAgICAgICAgICAgICBUaGlzIGluZGV4IGNhbiBiZSBmb3VuZCBieSB1c2luZyB0aGUgInNhcFNlYXJjaE1hY0xpc3QiIEFQSSB3aGljaCByZXR1cm5zIHRoZSBpbmRleCBvZiB0aGUgTUFDCisgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZHIsIGlmIGZvdW5kIGluIGFuIEFDTCwgaW4gb25lIG9mIHRoZSBhcmd1bWVudHMgcGFzc2VkIGJ5IHRoZSBjYWxsZXIuCisKKyBSRVRVUk4gVkFMVUUKKyAgICBOb25lLgorCisgIFNJREUgRUZGRUNUUyAKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkCitzYXBSZW1vdmVNYWNGcm9tQUNMKHZfTUFDQUREUl90ICptYWNMaXN0LCB2X1U4X3QgKnNpemUsIHZfVThfdCBpbmRleCk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBzYXBQcmludEFDTAorCisgIERFU0NSSVBUSU9OIAorICAgIEZ1bmN0aW9uIHRvIHByaW50IGFsbCB0aGUgbWFjIGFkZHJlc3Mgb2YgYW4gQUNMLgorICAgIFVzZWZ1bCBmb3IgZGVidWcuCisgICAgCisgIERFUEVOREVOQ0lFUyAKKworICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICAgICBtYWNMaXN0ICAgICAgICAgIDogQUNMIGxpc3Qgb2YgbWFjIGFkZHJlc3NlcyAoYmxhY2svd2hpdGUgbGlzdCkKKyAgICAgICBzaXplICAgICAgICAgICAgIDogc2l6ZSBvZiB0aGUgQUNMCisKKyBSRVRVUk4gVkFMVUUKKyAgICBOb25lLgorCisgIFNJREUgRUZGRUNUUyAKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIAorc2FwUHJpbnRBQ0wodl9NQUNBRERSX3QgKm1hY0xpc3QsIHZfVThfdCBzaXplKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIHNhcFNlYXJjaE1hY0xpc3QKKworICBERVNDUklQVElPTiAKKyAgICBGdW5jdGlvbiB0byBzZWFyY2ggZm9yIGEgbWFjIGFkZHJlc3MgaW4gYW4gQUNMCisKKyAgREVQRU5ERU5DSUVTIAorCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgICAgIG1hY0xpc3QgICAgICAgICAgOiBsaXN0IG9mIG1hYyBhZGRyZXNzZXMgKGJsYWNrL3doaXRlIGxpc3QpCisgICAgICAgbnVtX21hYyAgICAgICAgICA6IHNpemUgb2YgdGhlIEFDTAorICAgICAgIHBlZXJNYWMgICAgICAgICAgOiBNYWMgYWRkcmVzcyBvZiB0aGUgcGVlcgorICAgIE9QICAgICAgIAorICAgICAgIGluZGV4ICAgICAgICAgICAgOiB0aGUgaW5kZXggYXQgd2hpY2ggdGhlIHBlZXIgbWFjIGlzIGZvdW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzIHZhbHVlIGdldHMgZmlsbGVkIGluIHRoaXMgZnVuY3Rpb24uIElmIHRoZSBjYWxsZXIgaXMgbm90IGludGVyZXN0ZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluIHRoZSBpbmRleCBvZiB0aGUgcGVlck1hYyB0byBiZSBzZWFyY2hlZCwgaXQgY2FuIHBhc3MgTlVMTCBoZXJlLgorCisgUkVUVVJOIFZBTFVFCisgICAgU1VDQ0VTUyAgICAgICAgICA6IGlmIHRoZSBtYWMgYWRkciBiZWluZyBzZWFyY2hlZCBmb3IgaXMgZm91bmQKKyAgICBGQUlMVVJFICAgICAgICAgIDogaWYgdGhlIG1hYyBhZGRyIGJlaW5nIHNlYXJjaGVkIGZvciBpcyBOT1QgZm91bmQKKworICBTSURFIEVGRkVDVFMgCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworZVNhcEJvb2wKK3NhcFNlYXJjaE1hY0xpc3Qodl9NQUNBRERSX3QgKm1hY0xpc3QsIHZfVThfdCBudW1fbWFjLCB2X1U4X3QgKnBlZXJNYWMsIHZfVThfdCAqaW5kZXgpOworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBzYXBfQWNxdWlyZUdsb2JhbExvY2sKKworICBERVNDUklQVElPTiAKKyAgICBGdW5jdGlvbiB0byBpbXBsZW1lbnQgYWNxdWlyZSBTQVAgZ2xvYmFsIGxvY2sKKworICBERVBFTkRFTkNJRVMgCisKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgICAgc2FwQ29udGV4dCA6IFBvaW50ZXIgdG8gU0FQIGhhbmRsZQorICAgICAgIHBlZXJNYWMgICAgOiBNYWMgYWRkcmVzcyBvZiB0aGUgcGVlcgorCisgUkVUVVJOIFZBTFVFCisgICAgSWYgU1VDQ0VTUyBvciBGQUlMVVJFLgorCisgIFNJREUgRUZGRUNUUyAKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitzYXBfQWNxdWlyZUdsb2JhbExvY2soIHB0U2FwQ29udGV4dCAgcFNhcEN0eCApOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgc2FwSXNQZWVyTWFjQWxsb3dlZAorCisgIERFU0NSSVBUSU9OIAorICAgIEZ1bmN0aW9uIHRvIGltcGxlbWVudCByZWxlYXNlIFNBUCBnbG9iYWwgbG9jaworCisgIERFUEVOREVOQ0lFUyAKKworICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICAgICBzYXBDb250ZXh0IDogUG9pbnRlciB0byBTQVAgaGFuZGxlCisgICAgICAgcGVlck1hYyAgICA6IE1hYyBhZGRyZXNzIG9mIHRoZSBwZWVyCisKKyBSRVRVUk4gVkFMVUUKKyAgICBJZiBTVUNDRVNTIG9yIEZBSUxVUkUuCisKKyAgU0lERSBFRkZFQ1RTIAorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK3NhcF9SZWxlYXNlR2xvYmFsTG9jayggcHRTYXBDb250ZXh0ICBwU2FwQ3R4ICk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KK0ZVTkNUSU9OICBzYXBDb252ZXJ0U2FwUGh5TW9kZVRvQ3NyUGh5TW9kZQorCitERVNDUklQVElPTiBGdW5jdGlvbiB0byBpbXBsZW1lbnQgc2VsZWN0aW9uIG9mIENTUiBQaHlNb2RlIHVzaW5nIFNBUCBQaHlNb2RlCisKK0RFUEVOREVOQ0lFUyBQQVJBTUVURVJTCisKK0lOIHNhcFBoeU1vZGUgOiBTQVAgUGh5IE1vZHVsZQorCitSRVRVUk4gVkFMVUUgSWYgU1VDQ0VTUyBvciBGQUlMVVJFCisKK1NJREUgRUZGRUNUUworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitlQ3NyUGh5TW9kZSBzYXBDb252ZXJ0U2FwUGh5TW9kZVRvQ3NyUGh5TW9kZSggZVNhcFBoeU1vZGUgc2FwUGh5TW9kZSApOworCisjaWZkZWYgV0xBTl9GRUFUVVJFX0FQX0hUNDBfMjRHCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CitGVU5DVElPTiAgc2FwX2h0MjA0MF90aW1lcl9jYgorCitERVNDUklQVElPTiBGdW5jdGlvbiB0byBpbXBsZW1lbnQgaHQyMDQwIHRpbWVyIGNhbGxiYWNrIGltcGxlbWVudGF0aW9uCisKK1NJREUgRUZGRUNUUworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b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GZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgcyBhIHAgTSBvIGQgdSBsIGUgLiBDCisKKyAgT1ZFUlZJRVc6CisKKyAgVGhpcyBzb2Z0d2FyZSB1bml0IGhvbGRzIHRoZSBpbXBsZW1lbnRhdGlvbiBvZiB0aGUgV0xBTiBTQVAgbW9kdWxlcworICBmdW5jdGlvbnMgcHJvdmlkaW5nIEVYVEVSTkFMIEFQSXMuIEl0IGlzIGFsc28gd2hlcmUgdGhlIGdsb2JhbCBTQVAgbW9kdWxlCisgIGNvbnRleHQgZ2V0cyBpbml0aWFsaXNlZAorCisgIERFUEVOREVOQ0lFUzoKKworICBBcmUgbGlzdGVkIGZvciBlYWNoIEFQSSBiZWxvdy4KKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICBFRElUIEhJU1RPUlkgRk9SIEZJTEUKKworCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLgorICBOb3RpY2UgdGhhdCBjaGFuZ2VzIGFyZSBsaXN0ZWQgaW4gcmV2ZXJzZSBjaHJvbm9sb2dpY2FsIG9yZGVyLgorCisKKworICB3aGVuICAgICAgICAgICAgICAgd2hvICAgICAgICAgICAgICAgICB3aGF0LCB3aGVyZSwgd2h5CistLS0tLS0tLS0tICAgICAgIC0tLSAgICAgICAgICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorMDMvMTUvMTAgICAgIFNPRlRBUCB0ZWFtICAgICAgICAgICAgQ3JlYXRlZCBtb2R1bGUKKzA2LzAzLzEwICAgICBqcyAgICAgICAgICAgICAgICAgICAgIEFkZGVkIHN1cHBvcnQgdG8gaG9zdGFwZCBkcml2ZW4KKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlYXV0aC9kaXNhc3NvYy9taWMgZmFpbHVyZQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKiAkSGVhZGVyJCAqLworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAqIEluY2x1ZGUgRmlsZXMKKyAqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworI2luY2x1ZGUgIndsYW5fcWN0X3RsLmgiCisjaW5jbHVkZSAidm9zX3RyYWNlLmgiCisKKy8vIFBpY2sgdXAgdGhlIHNtZSBjYWxsYmFjayByZWdpc3RyYXRpb24gQVBJCisjaW5jbHVkZSAic21lX0FwaS5oIgorCisvLyBTQVAgQVBJIGhlYWRlciBmaWxlCisKKyNpbmNsdWRlICJzYXBJbnRlcm5hbC5oIgorI2luY2x1ZGUgInNtZUluc2lkZS5oIgorCisvKi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Iik7CisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICAgfQorCisgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30vKiBXTEFOU0FQX1N0YXJ0ICovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOU0FQX1N0b3AKKworICBERVNDUklQVElPTgorICAgIENhbGxlZCBieSB2b3Nfc3RvcCB0byBzdG9wIG9wZXJhdGlvbiBpbiBTQVAsIGJlZm9yZSBjbG9zZS4gU0FQIHdpbGwgc3VzcGVuZCBhbGwKKyAgICBCVC1BTVAgUHJvdG9jb2wgQWRhcHRpb24gTGF5ZXIgb3BlcmF0aW9uIGFuZCB3aWxsIHdhaXQgZm9yIHRoZSBjbG9zZQorICAgIHJlcXVlc3QgdG8gY2xlYW4gdXAgaXRzIHJlc291cmNlcy4KKworICBERVBFTkRFTkNJRVMKKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHB2b3NHQ3R4ICAgIDogUG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZSB0byBTQVAncworICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQKKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiBQb2ludGVyIHRvIFNBUCBjYiBpcyBOVUxMIDsgYWNjZXNzIHdvdWxkIGNhdXNlIGEgcGFnZQorICAgICAgICAgICAgICAgICAgICAgICAgIGZhdWx0CisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiBTdWNjZXNzCisKKyAgU0lERSBF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ERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgY2FsbGJhY2tDb250ZXh0OiAgVGhlIHVzZXIgcGFzc2VkIGluIGEgY29udGV4dCB0byBpZGVudGlmeQorICAgIHN0YXR1czogICAgICAgICAgIFRoZSBoYWxTdGF0dXMKKworICBSRVRVUk4gVkFMVUUKKyAgICBOb25lCisKKyAgU0lERSBFRkZFQ1RTCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQKK1dMQU5TQVBfcG1jRnVsbFB3clJlcUNCCisoCisgICAgdm9pZCAqY2FsbGJhY2tDb250ZXh0LAorICAgIGVIYWxTdGF0dXMgc3RhdHVzCispCit7CisgICAgaWYoSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgeworICAgICAgICAgLy9JZiBzdWNjZXNzIHdoYXQgZWxzZSB0byBiZSBoYW5kbGVkPz8/CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgIldMQU5TQVBfcG1jRnVsbFB3clJlcUNCOiBQTUMgZmFpbGVkIHRvIHB1dCB0aGUgY2hpcCBpbiBGdWxsIHBvd2VyXG4iKTsKKworICAgIH0KKworfS8vIFdMQU5TQVBfcG1jRnVsbFB3clJlcUNCCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5TQVBfZ2V0U3RhdGUKKworICBERVNDUklQVElPTgorICAgIFRoaXMgYXBpIHJldHVybnMgdGhlIGN1cnJlbnQgU0FQIHN0YXRlIHRvIHRoZSBjYWxsZXIuCisKKyAgREVQRU5ERU5DSUVTCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICBwQ29udGV4dCAgICAgICAgICAgIDogUG9pbnRlciB0byBTYXAgQ29udGV4dCBzdHJ1Y3R1cmUKKworICBSRVRVUk4gVkFMVUUKKyAgICBSZXR1cm5zIHRoZSBTQVAgRlNNIHN0YXRlLgorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKK3ZfVThfdCBXTEFOU0FQX2dldFN0YXRlCisoCisgICAgdl9QVk9JRF90ICBwdm9zR0N0eAorKQoreworICAgIHB0U2FwQ29udGV4dCAgcFNhcEN0eCA9IE5VTEw7CisKKyAgICBwU2FwQ3R4ID0gVk9TX0dFVF9TQVBfQ0IocHZvc0dDdHgpOworCisgICAgaWYgKCBOVUxMID09IHBTYXBDdHggKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgU0FQIHBvaW50ZXIgZnJvbSBwdm9zR0N0eCIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICB9CisgICAgcmV0dXJuIHBTYXBDdHgtPnNhcHNNYWNoaW5lOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5TQVBfU3RhcnRCc3MKKworICBERVNDUklQVElPTgorICAgIFRoaXMgYXBpIGZ1bmN0aW9uIHByb3ZpZGVzIFNBUCBGU00gZXZlbnQgZVdMQU5fU0FQX1BIWVNJQ0FMX0xJTktfQ1JFQVRFIGZvcgorICAgIHN0YXJ0aW5nIEFQIEJTUworCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFN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ZW55TWFjKTsKKworICAgICAgICAvKiBGaWxsIGluIHRoZSBldmVudCBzdHJ1Y3R1cmUgZm9yIEZTTSAqLworICAgICAgICBzYXBFdmVudC5ldmVudCA9IGVTQVBfSEREX1NUQVJUX0lORlJBX0JTUzsKKyAgICAgICAgc2FwRXZlbnQucGFyYW1zID0gMDsvL3BTYXBQaHlzTGlua0NyZWF0ZQorCisgICAgICAgIC8qIFN0b3JlIHRoZSBIREQgY2FsbGJhY2sgaW4gU0FQIGNvbnRleHQgKi8KKyAgICAgICAgcFNhcEN0eC0+cGZuU2FwRXZlbnRDYWxsYmFjayA9IHBTYXBFdmVudENhbGxiYWNrOworCisgICAgICAgIC8qIEhhbmRsZSBldmVudCovCisgICAgICAgIHZvc1N0YXR1cyA9IHNhcEZzbShwU2FwQ3R4LCAmc2FwRXZlbnQpOworICAgICB9CisgICAgIGVsc2UKKyAgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIlNvZnRBcCByb2xlIGhhcyBub3QgYmVlbiBlbmFibGVkIik7CisgICAgIH0KKworICAgIHJldHVybiB2b3NTdGF0dXM7Cit9Ly8gV0xBTlNBUF9TdGFydEJzcworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5TQVBfU2V0TWFjQUNMCisKKyAgREVTQ1JJUFRJT04KKyAgICBUaGlzIGFwaSBmdW5jdGlvbiBwcm92aWRlcyBTQVAgdG8gc2V0IG1hYyBsaXN0IGVudHJ5IGluIGFjY2VwdCBsaXN0IGFzIHdlbGwKKyAgICBhcyBkZW55IGxpc3QKKworICBERVBFTkRFTkNJRVMKKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHBDb250ZXh0ICAgICAgICAgICAgOiBQb2ludGVyIHRvIFNhcCBDb250ZXh0IHN0cnVjdHVyZQorICAgIHBRY3RDb21taXRDb25maWcgICAgOiBQb2ludGVyIHRvIGNvbmZpZ3VyYXRpb24gc3RydWN0dXJlIHBhc3NlZCBkb3duIGZyb20KKyAgICAgICAgICAgICAgICAgICAgICAgICAgSEREKEhvc3RBcGQgZm9yIEFuZHJvaWQpCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICAgIFZPU19TVEFUVVNfRV9GQVVMVDogUG9pbnRlciB0byBTQVAgY2IgaXMgTlVMTCA7IGFjY2VzcyB3b3VsZCBjYXVzZSBhIHBhZ2UKKyAgICAgICAgICAgICAgICAgICAgICAgICBmYXVsdAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogU3VjY2VzcworCisgIFNJREUgRUZGRUNUUworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOU0FQX1NldE1hY0FDTAorKAorICAgIHZfUFZPSURfdCAgcHZvc0dDdHgsICAgLy9wd2V4dEN0eAorICAgIHRzYXBfQ29uZmlnX3QgKnBDb25maWcKKykKK3sKKyAgICBWT1NfU1RBVFVTIHZvc1N0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgICBwdFNhcENvbnRleHQgIHBTYXBDdHggPSBOVUxMOworCisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgIldMQU5TQVBfU2V0TWFjQUNMIik7CisKKyAgICBpZiAoVk9TX1NUQV9TQVBfTU9ERSA9PSB2b3NfZ2V0X2NvbnBhcmFtICgpKQorICAgIHsKKyAgICAgICAgcFNhcEN0eCA9IFZPU19HRVRfU0FQX0NCKHB2b3NHQ3R4KTsKKyAgICAgICAgaWYgKCBOVUxMID09IHBTYXBDdHggKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgU0FQIHBvaW50ZXIgZnJvbSBwdm9zR0N0eCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICAgICAgIH0KKworICAgICAgICAvLyBDb3B5IE1BQyBmaWx0ZXJpbmcgc2V0dGluZ3MgdG8gc2FwIGNvbnRleHQKKyAgICAgICAgcFNhcEN0eC0+ZVNhcE1hY0FkZHJBY2xNb2RlID0gcENvbmZpZy0+U2FwTWFjYWRkcl9hY2w7CisKKyAgICAgICAgaWYgKGVTQVBfREVOWV9VTkxFU1NfQUNDRVBURUQgPT0gcFNhcEN0eC0+ZVNhcE1hY0FkZHJBY2xNb2RlKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocFNhcEN0eC0+YWNjZXB0TWFjTGlzdCwgcENvbmZpZy0+YWNjZXB0X21hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YocENvbmZpZy0+YWNjZXB0X21hYykpOworICAgICAgICAgICAgcFNhcEN0eC0+bkFjY2VwdE1hYyA9IHBDb25maWctPm51bV9hY2NlcHRfbWFjOworICAgICAgICAgICAgc2FwU29ydE1hY0xpc3QocFNhcEN0eC0+YWNjZXB0TWFjTGlzdCwgcFNhcEN0eC0+bkFjY2VwdE1hYyk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoZVNBUF9BQ0NFUFRfVU5MRVNTX0RFTklFRCA9PSBwU2FwQ3R4LT5lU2FwTWFjQWRkckFjbE1vZGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwU2FwQ3R4LT5kZW55TWFjTGlzdCwgcENvbmZpZy0+ZGVueV9tYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihwQ29uZmlnLT5kZW55X21hYykpOworICAgICAgICAgICAgcFNhcEN0eC0+bkRlbnlNYWMgPSBwQ29uZmlnLT5udW1fZGVueV9tYWM7CisgICAgICAgICAgICBzYXBTb3J0TWFjTGlzdChwU2FwQ3R4LT5kZW55TWFjTGlzdCwgcFNhcEN0eC0+bkRlbnlNYWMpOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzIDogU29mdEFwIHJvbGUgaGFzIG5vdCBiZWVuIGVuYWJsZWQiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICAgfQorCisgICAgcmV0dXJuIHZvc1N0YXR1czsKK30vL1dMQU5TQVBfU2V0TWFjQUNMCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlNBUF9TdG9wQnNzCisKKyAgREVTQ1JJUFRJT04KKyAgICBUaGlzIGFwaSBmdW5jdGlvbiBwcm92aWRlcyBTQVAgRlNNIGV2ZW50IGVTQVBfSEREX1NUT1BfSU5GUkFfQlNTIGZvcgorICAgIHN0b3BwaW5nIEFQIEJTUworCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcHZvc0dDdHggICAgOiBQb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFu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DdHgpLCBwU2FwQ3R4LT5zZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZElkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2FwQ3R4LT5wVXNyQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZfUFZPSURfdCAqKXBTYXBDdHgtPnBmblNhcEV2ZW50Q2FsbGJhY2ssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2X1U4X3QgKilwQXNzb2NTdGFzICk7CisKKyAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfQorCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlNBUF9SZW1vdmVXcHNTZXNzaW9uT3ZlcmxhcAorCisgIERFU0NSSVBUSU9OCisgICAgVGhpcyBhcGkgZnVuY3Rpb24gcHJvdmlkZXMgZm9yIEFwIEFwcC9IREQgdG8gcmVtb3ZlIGFuIGVudHJ5IGZyb20gc2Vzc2lvbiBzZXNzaW9uIG92ZXJsYXAgaW5mby4KKworICBERVBFTkRFTkNJRVMKKyAgICBOQS4KKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHB2b3NHQ3R4OiBQb2ludGVyIHRvIHZvcyBnbG9iYWwgY29udGV4dCBzdHJ1Y3R1cmUKKyAgICBwUmVtb3ZlTWFjOiBwb2ludGVyIHRvIHZfTUFDQUREUl90IGZvciBzZXNzaW9uIE1BQyBhZGRyZXNzCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIFZPU19TVEFUVVMgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uCisKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBTdWNjZXNzCisgICAgVk9TX1NUQVRVU19FX0ZBVUxU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ICAgICAgICAgICAgICAgICAgICAgICAgICBwU2FwQ3R4LT5wVXNyQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZfUFZPSURfdCAqKXBTYXBDdHgtPnBmblNhcEV2ZW50Q2FsbGJhY2ssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSZW1vdmVNYWMpOworCisgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlNBUF9nZXRXcHNTZXNzaW9uT3ZlcmxhcAorCisgIERFU0NSSVBUSU9OCisgICAgVGhpcyBhcGkgZnVuY3Rpb24gcHJvdmlkZXMgZm9yIEFwIEFwcC9IREQgdG8gZ2V0IFdQUyBzZXNzaW9uIG92ZXJsYXAgaW5mby4KKworICBERVBFTkRFTkNJRVMKKyAgICBOQS4KKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHB2b3NHQ3R4OiBQb2ludGVyIHRvIHZvcyBnbG9iYWwgY29udGV4dCBzdHJ1Y3R1cmUKKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgVk9TX1NUQVRVUyBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIFN1Y2Nlc3MKKworICBTSURFIEVGRkVDVFMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlNBUF9nZXRXcHNTZXNzaW9uT3ZlcmxhcAorKAorIHZfUFZPSURfdCBwdm9zR0N0eAorKQoreworICAgIHZfTUFDQUREUl90IHBSZW1vdmVNYWMgPSBWT1NfTUFDX0FER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gICAgICAgICAgICBpZiAoY21kID09IEFERF9TVEFfVE9fQUNMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vZXJyb3IgY2hlY2sKKyAgICAgICAgICAgICAgICAvLyBpZiBsaXN0IGlzIGFscmVhZHkgYXQgbWF4LCByZXR1cm4gZmFpbHVyZQorICAgICAgICAgICAgICAgIGlmIChwU2FwQ3R4LT5uQWNjZXB0TWFjID09IE1BWF9BQ0xfTUFDX0FERFJFU1MpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIldoaXRlIGxpc3QgaXMgYWxyZWFkeSBtYXhlZCBvdXQuIENhbm5vdCBhY2NlcHQgIk1BQ19BRERSRVNTX1NUUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwUGVlclN0YU1hYykpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChzdGFJbldoaXRlTGlzdCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vRG8gbm90aGluZyBpZiBhbHJlYWR5IHByZXNlbnQgaW4gd2hpdGUgbGlzdC4gSnVzdCBwcmludCBhIHdhcm5pbmcKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIk1BQyBhZGRyZXNzIGFscmVhZHkgcHJlc2VudCBpbiB3aGl0ZSBsaXN0ICJNQUNfQUREUkVTU19TVFIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocFBlZXJTdGFNYWMpKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChzdGFJbkJsYWNrTGlzdCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLy9yZW1vdmUgaXQgZnJvbSBibGFjayBsaXN0IGJlZm9yZSBhZGRpbmcgdG8gdGhlIHdoaXRlIGxpc3QKKyAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiU1RBIHByZXNlbnQgaW4gYmxhY2sgbGlzdCBzbyBmaXJzdCByZW1vdmUgZnJvbSBpdCIpOworICAgICAgICAgICAgICAgICAgICAgICAgc2FwUmVtb3ZlTWFjRnJvbUFDTChwU2FwQ3R4LT5kZW55TWFjTGlzdCwgJnBTYXBDdHgtPm5EZW55TWFjLCBzdGFCTEluZGV4KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiLi4uIE5vdyBhZGQgdG8gdGhlIHdoaXRlIGxpc3QiKTsKKyAgICAgICAgICAgICAgICAgICAgc2FwQWRkTWFjVG9BQ0wocFNhcEN0eC0+YWNjZXB0TWFjTGlzdCwgJnBTYXBDdHgtPm5BY2NlcHRNYWMsIHBQZWVyU3RhTWFjKTsKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fTE9XLCAic2l6ZSBvZiBhY2NlcHQgYW5kIGRlbnkgbGlzdHMgJWQgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTYXBDdHgtPm5BY2NlcHRNYWMsIHBTYXBDdHgtPm5EZW55TWFjKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChjbWQgPT0gREVMRVRFX1NUQV9GUk9NX0FDTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoc3RhSW5XaGl0ZUxpc3QpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIkRlbGV0ZSBmcm9tIHdoaXRlIGxpc3QiKTsKKyAgICAgICAgICAgICAgICAgICAgc2FwUmVtb3ZlTWFjRnJvbUFDTChwU2FwQ3R4LT5hY2NlcHRNYWNMaXN0LCAmcFNhcEN0eC0+bkFjY2VwdE1hYywgc3RhV0xJbmRleCk7CisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0xPVywgInNpemUgb2YgYWNjZXB0IGFuZCBkZW55IGxpc3RzICVkICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2FwQ3R4LT5uQWNjZXB0TWFjLCBwU2FwQ3R4LT5uRGVueU1hYyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJNQUMgYWRkcmVzcyB0byBiZSBkZWxldGVkIGlzIG5vdCBwcmVzZW50IGluIHRoZSB3aGl0ZSBsaXN0ICJNQUNfQUREUkVTU19TVFIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocFBlZXJTdGFNYWMpKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJJbnZhbGlkIGNtZCB0eXBlIHBhc3NlZCIpOworICAgICAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVNBUF9CTEFDS19MSVNUOgorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgICAgICAgICAiY21kICVkIiwgY21kKTsKKyAgICAgICAgICAgIGlmIChjbWQgPT0gQUREX1NUQV9UT19BQ0wpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9lcnJvciBjaGVjaworICAgICAgICAgICAgICAgIC8vIGlmIGxpc3QgaXMgYWxyZWFkeSBhdCBtYXgsIHJldHVybiBmYWlsdXJlCisgICAgICAgICAgICAgICAgaWYgKHBTYXBDdHgtPm5EZW55TWFjID09IE1BWF9BQ0xfTUFDX0FERFJFU1MpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkJsYWNrIGxpc3QgaXMgYWxyZWFkeSBtYXhlZCBvdXQuIENhbm5vdCBhY2NlcHQgIk1BQ19BRERSRVNTX1NUUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwUGVlclN0YU1hYykpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChzdGFJbkJsYWNrTGlzdCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vRG8gbm90aGluZyBpZiBhbHJlYWR5IHByZXNlbnQgaW4gd2hpdGUgbGlzdAorICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTUFDIGFkZHJlc3MgYWxyZWFkeSBwcmVzZW50IGluIGJsYWNrIGxpc3QgIk1BQ19BRERSRVNTX1NUUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwUGVlclN0YU1hYykpOworICAgICAgICAgICAgICAgIH0gZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHN0YUluV2hpdGVMaXN0KQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvL3JlbW92ZSBpdCBmcm9tIHdoaXRlIGxpc3QgYmVmb3JlIGFkZGluZyB0byB0aGUgd2hpdGUgbGlzdAorICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJQcmVzZW50IGluIHdoaXRlIGxpc3Qgc28gZmlyc3QgcmVtb3ZlIGZyb20gaXQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNhcFJlbW92ZU1hY0Zyb21BQ0wocFNhcEN0eC0+YWNjZXB0TWFjTGlzdCwgJnBTYXBDdHgtPm5BY2NlcHRNYWMsIHN0YVdMSW5kZXgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICIuLi4gTm93IGFkZCB0byBibGFjayBsaXN0Iik7CisgICAgICAgICAgICAgICAgICAgIHNhcEFkZE1hY1RvQUNMKHBTYXBDdHgtPmRlbnlNYWNMaXN0LCAmcFNhcEN0eC0+bkRlbnlNYWMsIHBQZWVyU3RhTWFjKTsKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fTE9XLCJzaXplIG9mIGFjY2VwdCBhbmQgZGVueSBsaXN0cyAlZCAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNhcEN0eC0+bkFjY2VwdE1hYywgcFNhcEN0eC0+bkRlbnlNYWMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKGNtZCA9PSBERUxFVEVfU1RBX0ZST01fQUNMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChzdGFJbkJsYWNrTGlzdCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiRGVsZXRlIGZyb20gYmxhY2sgbGlzdCIpOworICAgICAgICAgICAgICAgICAgICBzYXBSZW1vdmVNYWNGcm9tQUNMKHBTYXBDdHgtPmRlbnlNYWNMaXN0LCAmcFNhcEN0eC0+bkRlbnlNYWMsIHN0YUJMSW5kZXgpOworICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19MT1csIm5vIGFjY2VwdCBhbmQgZGVueSBtYWMgJWQgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTYXBDdHgtPm5BY2NlcHRNYWMsIHBTYXBDdHgtPm5EZW55TWFjKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIk1BQyBhZGRyZXNzIHRvIGJlIGRlbGV0ZWQgaXMgbm90IHByZXNlbnQgaW4gdGhlIGJsYWNrIGxpc3QgIk1BQ19BRERSRVNTX1NUUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwUGVlclN0YU1hYykpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIkludmFsaWQgY21kIHR5cGUgcGFzc2VkIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAiSW52YWxpZCBsa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RFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgU0FQIHBvaW50ZXIgZnJvbSBwdm9zR0N0eCIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICB9CisKKyAgICBzbWVfUm9hbURpc2Nvbm5lY3RTdGEoVk9TX0dFVF9IQUxfQ0IocFNhcEN0eC0+cHZvc0dDdHgpLCBwU2FwQ3R4LT5zZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFBlZXJTdGFNYWMpOworCisgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOU0FQX0RlYXV0aFN0YQorCisgIERFU0NSSVBUSU9OCisgICAgVGhpcyBhcGkgZnVuY3Rpb24gcHJvdmlkZXMgZm9yIEFwIEFwcC9IREQgaW5pdGlhdGVkIGRlYXV0aGVudGljYXRpb24gb2Ygc3RhdGlvbgorCisgIERFUEVOREVOQ0lFUworICAgIE5BLgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcHZvc0dDdHggICAgICAgICAgICA6IFBvaW50ZXIgdG8gdm9zIGdsb2JhbCBjb250ZXh0IHN0cnVjdHVyZQorICAgIHBEZWxTdGFQYXJhbXMgICAgICAgOiBQb2ludGVyIHRvIHBhcmFtZXRlcnMgb2YgdGhlIHN0YXRpb24gdG8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgZGVhdXRoZW50aWNhdGUKKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgVk9TX1NUQVRVUyBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICAgIFZ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b2FtRGVhdXRoU3RhKFZPU19HRVRfSEFMX0NCKHBTYXBDdHgtPnB2b3NHQ3R4KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2FwQ3R4LT5zZXNzaW9uSWQsIHBEZWxTdGFQYXJhbXMpOworCisgICAgaWYgKGhhbFN0YXR1cyA9PSBlSEFMX1NUQVRVU19TVUNDRVNTKQorICAgIHsKKyAgICAgICAgdm9zU3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgIH0KKyAgICByZXR1cm4gdm9zU3RhdHVzOworfQorLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOU0FQX1NldENoYW5uZWxSYW5nZQorCisgIERFU0NSSVBUSU9OCisgICAgVGhpcyBhcGkgZnVuY3Rpb24gc2V0cyB0aGUgcmFuZ2Ugb2YgY2hhbm5lbHMgZm9yIEFQLgorCisgIERFUEVOREVOQ0lFUworICAgIE5BLgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgc3RhcnRDaGFubmVsICAgICAgICAgOiBzdGFydCBjaGFubmVsCisgICAgZW5kQ2hhbm5lbCAgICAgICAgICAgOiBFbmQgY2hhbm5lbAorICAgIG9wZXJhdGluZ0JhbmQgICAgICAgIDogT3BlcmF0aW5nIGJhbmQgKDIuNEdIei81R0h6KQorCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSBWT1NfU1RBVFVTIGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgU3VjY2VzcworCisgIFNJREUgRUZGRUNUUworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOU0FQX1N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ICAgYmFuZFN0YXJ0Q2hhbm5lbCA9IFJGX0NIQU5fMzY7CisgICAgICAgICAgYmFuZEVuZENoYW5uZWwgPSBSRl9DSEFOXzE2NTsKKyAgICAgICAgICBicmVhazsKKworICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICJJbnZhbGlkIG9wZXJhdGluZ0JhbmQgdmFsdWUgb24gV0xBTlNBUF9TZXRDaGFubmVsUmFuZ2UiKTsKKyAgICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICAvKiBWYWxpZGF0aW5nIHRoZSBzdGFydCBjaGFubmVsIGlzIGluIHJhbmdlIG9yIG5vdCovCisgICAgZm9yKGxvb3BTdGFydENvdW50ID0gYmFuZFN0YXJ0Q2hhbm5lbCA7IGxvb3BTdGFydENvdW50IDw9IGJhbmRFbmRDaGFubmVsIDsKKyAgICBsb29wU3RhcnRDb3VudCsrKQorICAgIHsKKyAgICAgICBpZihyZkNoYW5uZWxzW2xvb3BTdGFydENvdW50XS5jaGFubmVsTnVtID09IHN0YXJ0Q2hhbm5lbCApCisgICAgICAgeworICAgICAgICAgIC8qIHN0YXJ0IGNoYW5uZWwgaXMgaW4gdGhlIHJhbmdlICovCisgICAgICAgICAgYnJlYWs7CisgICAgICAgfQorICAgIH0KKyAgICAvKiBWYWxpZGF0aW5nIHRoZSBFbmQgY2hhbm5lbCBpcyBpbiByYW5nZSBvciBub3QqLworICAgIGZvcihsb29wRW5kQ291bnQgPSBiYW5kU3RhcnRDaGFubmVsIDsgbG9vcEVuZENvdW50IDw9IGJhbmRFbmRDaGFubmVsIDsKKyAgICBsb29wRW5kQ291bnQrKykKKyAgICB7CisgICAgICAgIGlmKHJmQ2hhbm5lbHNbbG9vcEVuZENvdW50XS5jaGFubmVsTnVtID09IGVuZENoYW5uZWwgKQorICAgICAgICB7CisgICAgICAgICAgLyogRW5kIGNoYW5uZWwgaXMgaW4gdGhlIHJhbmdlICovCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgICBpZigobG9vcFN0YXJ0Q291bnQgPiBiYW5kRW5kQ2hhbm5lbCl8fChsb29wRW5kQ291bnQgPiBiYW5kRW5kQ2hhbm5lbCkpCisgICAgeworICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogSW52YWxpZCBzdGFydENoYW5uZWwtJWQgb3IgRW5kQ2hhbm5lbC0lZCBmb3IgYmFuZCAtJWQiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLHN0YXJ0Q2hhbm5lbCxlbmRDaGFubmVsLG9wZXJhdGluZ0JhbmQpOworICAgICAgIC8qIFN1cHBsaWVkIGNoYW5uZWxzIGFyZSBudCBpbiB0aGUgb3BlcmF0aW5nIGJhbmQgc28gc2V0IHRoZSBkZWZhdWx0CisgICAgICAgICAgICBjaGFubmVscyBmb3IgdGhlIGdpdmVuIG9wZXJhdGluZyBiYW5kICovCisgICAgICAgc3RhcnRDaGFubmVsID0gcmZDaGFubmVsc1tiYW5kU3RhcnRDaGFubmVsXS5jaGFubmVsTnVtOworICAgICAgIGVuZENoYW5uZWwgPSByZkNoYW5uZWxzW2JhbmRFbmRDaGFubmVsXS5jaGFubmVsTnVtOworICAgIH0KKworICAgIC8qU2VhcmNoIGZvciB0aGUgQWN0aXZlIGNoYW5uZWxzIGluIHRoZSBnaXZlbiByYW5nZSAqLworICAgIGZvciggbG9vcFN0YXJ0Q291bnQgPSBiYW5kU3RhcnRDaGFubmVsOyBsb29wU3RhcnRDb3VudCA8PSBiYW5kRW5kQ2hhbm5lbDsgbG9vcFN0YXJ0Q291bnQrKyApCisgICAgeworICAgICAgIGlmKChzdGFydENoYW5uZWwgPD0gcmZDaGFubmVsc1tsb29wU3RhcnR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3BTZXRLZXlJbmZvOiB0Q3NyUm9hbVNldEtleSBzdHJ1Y3R1cmUgZm9yIHRoZSBzdGF0aW9uCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIFZPU19TVEFUVVMgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uCisKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBTdWNjZXNzCisKKyAgU0lERSBFRkZFQ1RTCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5TQVBfU2V0S2V5U3RhCisoCisgICAgdl9QVk9JRF90IHB2b3NHQ3R4LCB0Q3NyUm9hbVNldEtleSAqcFNldEtleUluZm8KKykKK3sKKyAgICBWT1NfU1RBVFVTIHZvc1N0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgICBwdFNhcENvbnRleHQgIHBTYXBDdHggPSBOVUxMOworICAgIHZfUFZPSURfdCBoSGFsID0gTlVMTDsKKyAgICAgICAgZUhhbFN0YXR1cyBoYWxTdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICB2X1UzMl90IHJvYW1JZD0weEZGOworCisgICAgaWYgKFZPU19TVEFfU0FQX01PREUgPT0gdm9zX2dldF9jb25wYXJhbSAoICkpCisgICAgeworICAgICAgICBwU2FwQ3R4ID0gVk9TX0dFVF9TQVBfQ0IocHZvc0dDdHgpOworICAgICAgICBpZiAoTlVMTCA9PSBwU2FwQ3R4KQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICIlczogSW52YWxpZCBTQVAgcG9pbnRlciBmcm9tIHB2b3NHQ3R4IiwgX19mdW5jX18pOworICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICAgICAgfQorICAgICAgICBoSGFsID0gVk9TX0dFVF9IQUxfQ0IocFNhcEN0eC0+cHZvc0dDdHgpOworICAgICAgICBpZiAoTlVMTCA9PSBoSGFsKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICIlczogSW52YWxpZCBIQUwgcG9pbnRlciBmcm9tIHB2b3NHQ3R4IiwgX19mdW5jX18pOworICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICAgICAgfQorICAgICAgICBoYWxTdGF0dXMgPSBzbWVfUm9hbVNldEtleShoSGFsLCBwU2FwQ3R4LT5zZXNzaW9uSWQsIHBTZXRLZXlJbmZvLCAmcm9hbUlkKTsKKworICAgICAgICBpZiAoaGFsU3RhdHVzID09IGVIQUxfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc1N0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgfSBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc1N0YXR1cyA9IFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgICAgIHZvc1N0YXR1cyA9IFZPU19TVEFUVVNfRV9GQVVMVDsKKworICAgIHJldHVybiB2b3NTdGF0dXM7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlNBUF9EZWxLZXlTdGEKKworICBERVNDUklQVElPTgorICAgIFRoaXMgYXBpIGZ1bmN0aW9uIHByb3ZpZGVzIGZvciBBcCBBc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9zR0N0eCk7CisgICAgICAgIGlmIChOVUxMID09IHBTYXBDdHgpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIFNBUCBwb2ludGVyIGZyb20gcHZvc0dDdHgiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgICAgICB9CisKKyAgICAgICAgaEhhbCA9IFZPU19HRVRfSEFMX0NCKHBTYXBDdHgtPnB2b3NHQ3R4KTsKKyAgICAgICAgaWYgKE5VTEwgPT0gaEhhbCkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgSEFMIHBvaW50ZXIgZnJvbSBwdm9zR0N0eCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICAgICAgIH0KKworICAgICAgICB2b3NfbWVtX3plcm8oJlJlbW92ZUtleUluZm8sIHNpemVvZihSZW1vdmVLZXlJbmZvKSk7CisgICAgICAgIFJlbW92ZUtleUluZm8uZW5jVHlwZSA9IHBSZW1vdmVLZXlJbmZvLT5lbmNUeXBlOworICAgICAgICB2b3NfbWVtX2NvcHkoUmVtb3ZlS2V5SW5mby5wZWVyTWFjLCBwUmVtb3ZlS2V5SW5mby0+cGVlck1hYywgV05JX0NGR19CU1NJRF9MRU4pOworICAgICAgICBSZW1vdmVLZXlJbmZvLmtleUlkID0gcFJlbW92ZUtleUluZm8tPmtleUlkOworCisgICAgICAgIGhhbFN0YXR1cyA9IHNtZV9Sb2FtUmVtb3ZlS2V5KGhIYWwsIHBTYXBDdHgtPnNlc3Npb25JZCwgJlJlbW92ZUtleUluZm8sICZyb2FtSWQpOworCisgICAgICAgIGlmIChIQUxfU1RBVFVTX1NVQ0NFU1MoaGFsU3RhdHVzKSkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zU3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgdm9zU3RhdHVzID0gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICAgICAgdm9zU3RhdHVzID0gVk9TX1NUQVRVU19FX0ZBVUxUOworCisgICAgcmV0dXJuIHZvc1N0YXR1czsKK30KKworVk9TX1NUQVRVUworV0xBTlNhcF9nZXRzdGF0aW9uSUVfaW5mb3JtYXRpb24odl9QVk9JRF90IHB2b3NHQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCAgICpwTGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICAgICpwQnVmKQoreworICAgIFZPU19TVEFUVVMgdm9zU3RhdHVzID0gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgcHRTYXBDb250ZXh0ICBwU2FwQ3R4ID0gTlVMTDsKKyAgICB2X1UzMl90IGxlbiA9IDA7CisKKyAgICBpZiAoVk9TX1NUQV9TQVBfTU9ERSA9PSB2b3NfZ2V0X2NvbnBhcmFtICggKSl7CisgICAgICAgIHBTYXBDdHggPSBWT1NfR0VUX1NBUF9DQihwdm9zR0N0eCk7CisgICAgICAgIGlmIChOVUxMID09IHBTYXBDdHgpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIFNBUCBwb2ludGVyIGZyb20gcHZvc0dDdHgiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgICAgICB9CisgICAgICAgIGlmIChwTGVuKQorICAgICAgICB7CisgICAgICAgICAgICBsZW4gPSAqcExlbjsKKyAgICAgICAgICAgICpwTGVuID0gcFNhcEN0eC0+blN0YVdQQVJTblJlcUllTGVuZ3RoOworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICIlczogV1BBSUUgbGVuIDogJXgiLCBfX2Z1bmNfXywgKnBMZW4pOworICAgICAgICAgICAgaWYocEJ1ZikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZihsZW4gPj0gcFNhcEN0eC0+blN0YVdQQVJTblJlcUllTGVuZ3RoKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCBwQnVmLCBwU2FwQ3R4LT5wU3RhV3BhUnNuUmVxSUUsIHBTYXBDdHgtPm5TdGFXUEFSU25SZXFJZUxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogV1BBSUU6ICUwMng6JTAyeDolMDJ4OiUwMng6JTAyeDolMDJ4IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQnVmWzBdLCBwQnVmWzFdLCBwQnVmWzJdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCdWZbM10sIHBCdWZbNF0sIHBCdWZbNV0pOworICAgICAgICAgICAgICAgICAgICB2b3NTdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgaWYoIFZPU19TVEFUVVNfRV9GQUlMVVJFID09IHZvc1N0YXR1cykKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBFcnJvciB1bmFibGUgdG8gcG9wdWxhdGUgdGhlIFJTTldQQUlFIiwKKyAgICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICB9CisKKyAgICByZXR1cm4gdm9zU3RhdHVzOworCit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlNBUF9TZXRfV3BzSWUKKworICBERVNDUklQVElPTgorICAgIFRoaXMgYXBpIGZ1bmN0aW9uIHByb3ZpZGVzIGZvciBBcCBBcHAvSEREIHRvIHNldCBXUFMgSUUuCisKKyAgREVQRU5ERU5DSUVTCisgICAgTkEuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KK3B2b3NHQ3R4OiBQb2ludGVyIHRvIHZvcyBnbG9iYWwgY29udGV4dCBzdHJ1Y3R1cmUKK3BXUFNJRTogIHRTYXBfV1BTSUUgc3RydWN0dXJlIHRoYXQgaW5jbHVkZSBXUFMgSUVzCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIFZPU19TVEFUVVMgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uCisKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBTdWNjZXNzCisKKyAgU0lERSBFRkZFQ1RTCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK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RVU19FX0ZBVUxUOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCBzYXBfQWNxdWlyZUdsb2JhbExvY2soIHBTYXBDdHggKSA9PSBWT1NfU1RBVFVTX1NVQ0NFU1MgKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAocFNhcF9XUFNJZS0+c2FwV1BTSUVDb2RlID09IGVTQVBfV1BTX0JFQUNPTl9JRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnBTYXBDdHgtPkFQV1BTSUVzLlNpcldQU0JlYWNvbklFLCAmcFNhcF9XUFNJZS0+c2Fwd3BzaWUuc2FwV1BTQmVhY29uSUUsIHNpemVvZih0U2FwX1dQU0JlYWNvbklFKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChwU2FwX1dQU0llLT5zYXBXUFNJRUNvZGUgPT0gZVNBUF9XUFNfUFJPQkVfUlNQX0lFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmcFNhcEN0eC0+QVBXUFNJRXMuU2lyV1BTUHJvYmVSc3BJRSwgJnBTYXBfV1BTSWUtPnNhcHdwc2llLnNhcFdQU1Byb2JlUnNwSUUsIHNpemVvZih0U2FwX1dQU1Byb2JlUnNwSUUpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzYXBfUmVsZWFzZUdsb2JhbExvY2soIHBTYXBDdHggKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc2FwX1JlbGVhc2VHbG9iYWxMb2NrKCBwU2FwQ3R4ICk7CisgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICAgfQorICAgIGVsc2UKKyAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgIFdMQU5TQVBfVXBkYXRlX1dwc0llCisKKyAgREVTQ1JJUFRJT04KKyAgICBUaGlzIGFwaSBmdW5jdGlvbiBwcm92aWRlcyBmb3IgQXAgQXBwL0hERCB0byB1cGRhdGUgV1BTIElFcy4KKworICBERVBFTkRFTkNJRVMKKyAgICBOQS4KKworICBQQVJBTUVURVJTCisKKyAgICBJTgorcHZvc0dDdHg6IFBvaW50ZXIgdG8gdm9zIGdsb2JhbCBjb250ZXh0IHN0cnVjdHVyZQorCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSBWT1NfU1RBVFVTIGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgU3VjY2VzcworCisgIFNJREUgRUZGRUNUUworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOU0FQX1VwZGF0ZV9XcHNJZQorKAorIHZfUFZPSURfdCBwdm9zR0N0eAorKQoreworICAgIFZPU19TVEFUVVMgdm9zU3RhdHVzID0gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgIHB0U2FwQ29udGV4dCAgcFNhcEN0eCA9IE5VTEw7CisgICAgZUhhbFN0YXR1cyBoYWxTdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIHZfUFZPSURfdCBoSGFsID0gTlVMTDsKKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICIlcywgJWQiLCBfX2Z1bmNfXywgX19MSU5FX18pOworCisgICAgaWYoVk9TX1NUQV9TQVBfTU9ERSA9PSB2b3NfZ2V0X2NvbnBhcmFtICggKSl7CisgICAgICAgIHBTYXBDdHggPSBWT1NfR0VUX1NBUF9DQihwdm9zR0N0eCk7CisgICAgICAgIGlmICggTlVMTCA9PSBwU2FwQ3R4ICkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgU0FQIHBvaW50ZXIgZnJvbSBwdm9zR0N0eCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICAgICAgIH0KKworICAgICAgICBoSGFsID0gVk9TX0dFVF9IQUxfQ0IocFNhcEN0eC0+cHZvc0dDdHgpOworICAgICAgICBpZiAoIE5VTEwgPT0gaEhhbCApeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgSEFMIHBvaW50ZXIgZnJvbSBwdm9zR0N0eCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICAgICAgIH0KKworICAgICAgICBoYWxTdGF0dXMgPSBzbWVfUm9hbVVwZGF0ZUFQV1BTSUUoIGhIYWwsIHBTYXBDdHgtPnNlc3Npb25JZCwgJnBTYXBDdHgtPkFQV1BTSUVzKTsKKworICAgICAgICBpZihoYWxTdGF0dXMgPT0gZUhBTF9TVEFUVVNfU1VDQ0VTUykgeworICAgICAgICAgICAgdm9zU3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgICB9IGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgdm9zU3RhdHVzID0gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgICAgICB9CisKKyAgICB9CisKKyAgICByZXR1cm4gdm9zU3RhdHVzOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5TQVBfR2V0X1dQU19TdGF0ZQorCisgIERFU0NSSVBUSU9OCisgICAgVGhpcyBhcGkgZnVuY3Rpb24gcHJvdmlkZXMgZm9yIEFwIEFwcC9IREQgdG8gY2hlY2sgaWYgV1BTIHNlc3Npb24gaW4gcHJvY2Vzcy4KKworICBERVBFTkRFTkNJRVMKKyAgICBOQS4KKworICBQQVJBTUVURVJTCisKKyAgICBJTgorcHZvc0dDdHg6IFBvaW50ZXIgdG8gdm9zIGdsb2JhbCBjb250ZXh0IHN0cnVjdHVyZQorCisgICAgT1VUCitwYldQU1N0YXRlOiBQb2ludGVyIHRvIHZhcmlhYmxlIHRvIGluZGljYXRlIGlmIGl0IGlzIGluIFdQUyBSZWdpc3RyYXRpb24gc3RhdGUKKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgVk9TX1NUQVRVUyBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIFN1Y2Nlc3MKKworICBTSURFIEVGRkVDVFMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlNBUF9HZXRfV1BTX1N0YXRlCisoCisgdl9QVk9JRF90IHB2b3NHQ3R4LCB2X0JPT0xfdCAqYldQU1N0YXRlCispCit7CisgICAgcHRTYXBDb250ZXh0ICBwU2FwQ3R4ID0gTlVMTDsKKyAgICB2X1BWT0lEX3QgaEhhbCA9IE5VTEw7CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgIiVzLCAlZCIsIF9fZnVuY19fLCBfX0xJTkVfXyk7CisKKyAgICBpZihWT1NfU1RBX1NBUF9NT0RFID09IHZvc19nZXRfY29ucGFyYW0gKCApKXsKKworICAgICAgICBwU2FwQ3R4ID0gVk9TX0dFVF9TQVBfQ0IocHZvc0dDdHgpOworICAgICAgICBpZiAoIE5VTEwgPT0gcFNhcEN0eCApCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIFNBUCBwb2ludGVyIGZyb20gcHZvc0dDdHgiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICAgICAgfQorCisgICAgICAgIGhIYWwgPSBWT1NfR0VUX0hBTF9DQihwU2FwQ3R4LT5wdm9zR0N0eCk7CisgICAgICAgIGlmICggTlVMTCA9PSBoSGFsICl7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICIlczogSW52YWxpZCBIQUwgcG9pbnRlciBmcm9tIHB2b3NHQ3R4IiwgX19mdW5jX18pOworICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICAgICAgfQorCisgICAgICAgIGlmICggc2FwX0FjcXVpcmVHbG9iYWxMb2NrKHBTYXBDdHggKSA9PSBWT1NfU1RBVFVTX1NVQ0NFU1MgKQorICAgICAgICB7CisgICAgICAgICAgICBpZihwU2FwQ3R4LT5BUFdQU0lFcy5TaXJXUFNQcm9iZVJzcElFLkZpZWxkUHJlc2VudCAmIFNJUl9XUFNfUFJPQlJTUF9TRUxFQ1RFRFJFR0lTVFJBX1BSRVNFTlQpCisgICAgICAgICAgICAgICAgKmJXUFNTdGF0ZSA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICpiV1BTU3RhdGUgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisKKyAgICAgICAgICAgIHNhcF9SZWxlYXNlR2xvYmFsTG9jayggcFNhcEN0eCAgKTsKKworICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgIH0KKyAgICBlbHNlCisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisKK30KKworVk9TX1NUQVRVUworc2FwX0FjcXVpcmVHbG9iYWxMb2NrCisoCisgICAgcHRTYXBDb250ZXh0ICBwU2FwQ3R4CispCit7CisgICAgVk9TX1NUQVRVUyB2b3NTdGF0dXMgPSBWT1NfU1RBVFVTX0VfRkFVTFQ7CisKKyAgICBpZiggVk9TX0lTX1NUQVRVU19TVUNDRVNTKCB2b3NfbG9ja19hY3F1aXJlKCAmcFNhcEN0eC0+U2FwR2xvYmFsTG9jaykgKSApCisgICAgeworICAgICAgICAgICAgdm9zU3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgIH0KKworICAgIHJldHVybiAodm9zU3RhdHVzKTsKK30KKworVk9TX1NUQVRVUworc2FwX1JlbGVhc2VHbG9iYWxMb2NrCisoCisgICAgcHRTYXBDb250ZXh0ICBwU2FwQ3R4CispCit7CisgICAgVk9TX1NUQVRVUyB2b3NTdGF0dXMgPSBWT1NfU1RBVFVTX0VfRkFVTFQ7CisKKyAgICBpZiggVk9TX0lTX1NUQVRVU19TVUNDRVNTKCB2b3NfbG9ja19yZWxlYXNlKCAmcFNhcEN0eC0+U2FwR2xvYmFsTG9jaykgKSApCisgICAgeworICAgICAgICB2b3NTdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICAgfQorCisgICAgcmV0dXJuICh2b3NTdGF0dXMpOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5TQVBfU2V0X1dQQVJTTkllcworCisgIERFU0NSSVBUSU9OCisgICAgVGhpcyBhcGkgZnVuY3Rpb24gcHJvdmlkZXMgZm9yIEFwIEFwcC9IREQgdG8gc2V0IEFQIFdQQSBhbmQgUlNOIElFIGluIGl0cyBiZWFjb24gYW5kIHByb2JlIHJlc3BvbnNlLgorCisgIERFUEVOREVOQ0lFUworICAgIE5BLgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgICAgIHB2b3NHQ3R4OiBQb2ludGVyIHRvIHZvcyBnbG9iYWwgY29udGV4dCBzdHJ1Y3R1cmUKKyAgICAgICAgcFdQQVJTTklFczogYnVmZmVyIHRvIHRoZSBXUEEvUlNOIElFcworICAgICAgICBXUEFSU05JRXNMZW46IGxlbmd0aCBvZiBXUEEvUlNOIElFcworCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSBWT1NfU1RBVFVTIGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgU3VjY2VzcworCisgIFNJREUgRUZGRUNUUworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5TQVBfU2V0X1dQQVJTTkllcyh2X1BWT0lEX3QgcHZvc0dDdHgsIHZfVThfdCAqcFdQQVJTTklFcywgdl9VMzJfdCBXUEFSU05JRXNMZW4pCit7CisKKyAgICBwdFNhcENvbnRleHQgIHBTYXBDdHggPSBOVUxMOworICAgIGVIYWxTdGF0dXMgaGFsU3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICB2X1BWT0lEX3QgaEhhbCA9IE5VTEw7CisKKyAgICBpZihWT1NfU1RBX1NBUF9NT0RFID09IHZvc19nZXRfY29ucGFyYW0gKCApKXsKKyAgICAgICAgcFNhcEN0eCA9IFZPU19HRVRfU0FQX0NCKHB2b3NHQ3R4KTsKKyAgICAgICAgaWYgKCBOVUxMID09IHBTYXBDdHggKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICIlczogSW52YWxpZCBTQVAgcG9pbnRlciBmcm9tIHB2b3NHQ3R4IiwgX19mdW5jX18pOworICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICAgICAgfQorCisgICAgICAgIGhIYWwgPSBWT1NfR0VUX0hBTF9DQihwU2FwQ3R4LT5wdm9zR0N0eCk7CisgICAgICAgIGlmICggTlVMTCA9PSBoSGFsICl7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICIlczogSW52YWxpZCBIQUwgcG9pbnRlciBmcm9tIHB2b3NHQ3R4IiwgX19mdW5jX18pOworICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICAgICAgfQorCisgICAgICAgIHBTYXBDdHgtPkFQV1BBUlNOSUVzLmxlbmd0aCA9ICh0QU5JX1UxNilXUEFSU05JRXNMZW47CisgICAgICAgIHZvc19tZW1fY29weShwU2FwQ3R4LT5BUFdQQVJTTklFcy5yc25JRWRhdGEsIHBXUEFSU05JRXMsIFdQQVJTTklFc0xlbik7CisKKyAgICAgICAgaGFsU3RhdHVzID0gc21lX1JvYW1VcGRhdGVBUFdQQVJTTklFcyggaEhhbCwgcFNhcEN0eC0+c2Vzc2lvbklkLCAmcFNhcEN0eC0+QVBXUEFSU05JRXMpOworCisgICAgICAgIGlmKGhhbFN0YXR1cyA9PSBlSEFMX1NUQVRVU19TVUNDRVNTKSB7CisgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgICB9IGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7Cit9CisKK1ZPU19TVEFUVVMgV0xBTlNBUF9HZXRTdGF0aXN0aWNzKHZfUFZPSURfdCBwdm9zR0N0eCwgdFNhcF9Tb2Z0YXBTdGF0cyAqc3RhdEJ1Ziwgdl9CT09MX3QgYlJlc2V0KQoreworICAgIGlmIChOVUxMID09IHB2b3NHQ3R4KQorICAgIHsKKyAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICB9CisKKyAgICByZXR1cm4gKFdMQU5UTF9HZXRTb2Z0QVBTdGF0aXN0aWNzKHB2b3NHQ3R4LCBzdGF0QnVmLCBiUmVzZXQpKTsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5TQVBfU2VuZEFjdGlvbgorCisgIERFU0NSSVBUSU9OCisgICAgVGhpcyBhcGkgZnVuY3Rpb24gcHJvdmlkZXMgdG8gc2VuZCBhY3Rpb24gZnJhbWUgc2VudCBieSB1cHBlciBsYXllci4KKworICBERVBFTkRFTkNJRVMKKyAgICBOQS4KKworICBQQVJBTUVURVJTCisKKyAgSU4KKyAgICBwdm9zR0N0eDogUG9pbnRlciB0byB2b3MgZ2xvYmFsIGNvbnRleHQgc3RydWN0dXJlCisgICAgcEJ1ZjogUG9pbnRlciBvZiB0aGUgYWN0aW9uIGZyYW1lIHRvIGJlIHRyYW5zbWl0dGVkCisgICAgbGVuOiBMZW5ndGggb2YgdGhlIGFjdGlvbiBmcmFtZQorCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSBWT1NfU1RBVFVTIGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgU3VjY2VzcworCisgIFNJREUgRUZGRUNUUworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5TQVBfU2VuZEFjdGlvbiggdl9QVk9JRF90IHB2b3NHQ3R4LCBjb25zdCB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIGxlbiwgdEFOSV9VMTYgd2FpdCApCit7CisgICAgcHRTYXBDb250ZXh0ICBwU2FwQ3R4ID0gTlVMTDsKKyAgICB2X1BWT0lEX3QgaEhhbCA9IE5VTEw7CisgICAgZUhhbFN0YXR1cyBoYWxTdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworCisgICAgaWYoIFZPU19TVEFfU0FQX01PREUgPT0gdm9zX2dldF9jb25wYXJhbSAoICkgKQorICAgIHsKKyAgICAgICAgcFNhcEN0eCA9IFZPU19HRVRfU0FQX0NCKCBwdm9zR0N0eCApOworICAgICAgICBpZiAoTlVMTCA9PSBwU2FwQ3R4KQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICIlczogSW52YWxpZCBTQVAgcG9pbnRlciBmcm9tIHB2b3NHQ3R4IiwgX19mdW5jX18pOworICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICAgICAgfQorICAgICAgICBoSGFsID0gVk9TX0dFVF9IQUxfQ0IocFNhcEN0eC0+cHZvc0dDdHgpOworICAgICAgICBpZiggKCBOVUxMID09IGhIYWwgKSB8fCAoIGVTQVBfVFJVRSAhPSBwU2FwQ3R4LT5pc1NhcFNlc3Npb25PcGVuICkgKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU0FQLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICIlczogSEFMIHBvaW50ZXIgKCVwKSBOVUxMIE9SIFNNRSBzZXNzaW9uIGlzIG5vdCBvcGVuICglZCkiLAorICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgaEhhbCwgcFNhcEN0eC0+aXNTYXBTZXNzaW9uT3BlbiApOworICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICAgICAgfQorCisgICAgICAgIGhhbFN0YXR1cyA9IHNtZV9zZW5kQWN0aW9uKCBoSGFsLCBwU2FwQ3R4LT5zZXNzaW9uSWQsIHBCdWYsIGxlbiwgMCAsIDApOworCisgICAgICAgIGlmICggZUhBTF9TVEFUVVNfU1VDQ0VTUyA9PSBoYWxTdGF0dXMgKQorICAgICAgICB7CisgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgICB9CisgICAgfQorCisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIkZhaWxlZCB0byBTZW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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgV0xBTlNBUF9SZW1haW5PbkNoYW5uZWwoIHZfUFZPSURfdCBwdm9zR0N0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggY2hhbm5lbCwgdEFOSV9VMzIgZHVyYXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1haW5PbkNoYW5DYWxsYmFjayBjYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnBDb250ZXh0ICkKK3sKKyAgICBwdFNhcENvbnRleHQgIHBTYXBDdHggPSBOVUxMOworICAgIHZfUFZPSURfdCBoSGFsID0gTlVMTDsKKyAgICBlSGFsU3RhdHVzIGhhbFN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisKKyAgICBpZiggVk9TX1NUQV9TQVBfTU9ERSA9PSB2b3NfZ2V0X2NvbnBhcmFtICggKSApCisgICAgeworICAgICAgICBwU2FwQ3R4ID0gVk9TX0dFVF9TQVBfQ0IoIHB2b3NHQ3R4ICk7CisgICAgICAgIGlmIChOVUxMID09IHBTYXBDdHgpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIFNBUCBwb2ludGVyIGZyb20gcHZvc0dDdHgiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgICAgICB9CisgICAgICAgIGhIYWwgPSBWT1NfR0VUX0hBTF9DQihwU2FwQ3R4LT5wdm9zR0N0eCk7CisgICAgICAgIGlmKCAoIE5VTEwgPT0gaEhhbCApIHx8ICggZVNBUF9UUlVFICE9IHBTYXBDdHgtPmlzU2FwU2Vzc2lvbk9wZW4gKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBIQUwgcG9pbnRlciAoJXApIE5VTEwgT1IgU01FIHNlc3Npb24gaXMgbm90IG9wZW4gKCVkKSIsCisgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBoSGFsLCBwU2FwQ3R4LT5pc1NhcFNlc3Npb25PcGVuICk7CisgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgICAgICB9CisKKyAgICAgICAgaGFsU3RhdHVzID0gc21lX1JlbWFpbk9uQ2hhbm5lbCggaEhhbCwgcFNhcEN0eC0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsLCBkdXJhdGlvbiwgY2FsbGJhY2ssIHBDb250ZXh0LCBUUlVFICk7CisKKyAgICAgICAgaWYoIGVIQUxfU1RBVFVTX1NVQ0NFU1MgPT0gaGFsU3RhdHVzICkKKyAgICAgICAgeworICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgfQorICAgIH0KKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICJGYWlsZWQgdG8gU2V0IFJlbWFpbiBvbiBDaGFubmVsIik7CisKKyAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlNBUF9DYW5jZWxSZW1haW5PbkNoYW5uZWwKKworICBERVNDUklQVElPTgorICAgIFRoaXM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CisgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgICAgICB9CisgICAgICAgIGhIYWwgPSBWT1NfR0VUX0hBTF9DQihwU2FwQ3R4LT5wdm9zR0N0eCk7CisgICAgICAgIGlmKCAoIE5VTEwgPT0gaEhhbCApIHx8ICggZVNBUF9UUlVFICE9IHBTYXBDdHgtPmlzU2FwU2Vzc2lvbk9wZW4gKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBIQUwgcG9pbnRlciAoJXApIE5VTEwgT1IgU01FIHNlc3Npb24gaXMgbm90IG9wZW4gKCVkKSIsCisgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBoSGFsLCBwU2FwQ3R4LT5pc1NhcFNlc3Npb25PcGVuICk7CisgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgICAgICB9CisKKyAgICAgICAgaGFsU3RhdHVzID0gc21lX0NhbmNlbFJlbWFpbk9uQ2hhbm5lbCggaEhhbCwgcFNhcEN0eC0+c2Vzc2lvbklkICk7CisKKyAgICAgICAgaWYoIGVIQUxfU1RBVFVTX1NVQ0NFU1MgPT0gaGFsU3RhdHVzICkKKyAgICAgICAgeworICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgfQorICAgIH0KKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIkZhaWxlZCB0byBDYW5jZWwgUmVtYWluIG9uIENoYW5uZWwiKTsKKworICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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XBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4KiBtYXRjaERhdGEsIHRBTklfVTE2IG1hdGNoTGVuICkKK3sKKyAgICBwdFNhcENvbnRleHQgIHBTYXBDdHggPSBOVUxMOworICAgIHZfUFZPSURfdCBoSGFsID0gTlVMTDsKKyAgICBlSGFsU3RhdHVzIGhhbFN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisKKyAgICBpZiggVk9TX1NUQV9TQVBfTU9ERSA9PSB2b3NfZ2V0X2NvbnBhcmFtICggKSApCisgICAgeworICAgICAgICBwU2FwQ3R4ID0gVk9TX0dFVF9TQVBfQ0IoIHB2b3NHQ3R4ICk7CisgICAgICAgIGlmIChOVUxMID09IHBTYXBDdHgpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIFNBUCBwb2ludGVyIGZyb20gcHZvc0dDdHgiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgICAgICB9CisgICAgICAgIGhIYWwgPSBWT1NfR0VUX0hBTF9DQihwU2FwQ3R4LT5wdm9zR0N0eCk7CisgICAgICAgIGlmKCAoIE5VTEwgPT0gaEhhbCApIHx8ICggZVNBUF9UUlVFICE9IHBTYXBDdHgtPmlzU2FwU2Vzc2lvbk9wZW4gKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TQVAsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBIQUwgcG9pbnRlciAoJXApIE5VTEwgT1IgU01FIHNlc3Npb24gaXMgbm90IG9wZW4gKCVkKSIsCisgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBoSGFsLCBwU2FwQ3R4LT5pc1NhcFNlc3Npb25PcGVuICk7CisgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgICAgICB9CisKKyAgICAgICAgaGFsU3RhdHVzID0gc21lX1JlZ2lzdGVyTWdtdEZyYW1lKGhIYWwsIHBTYXBDdHgtPnNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVUeXBlLCBtYXRjaERhdGEsIG1hdGNoTGVuKTsKKworICAgICAgICBpZiggZUhBTF9TVEFUVVNfU1VDQ0VTUyA9PSBoYWxTdGF0dXMgKQorICAgICAgICB7CisgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgICB9CisgICAgfQorCisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiRmFpbGVkIHRvIFJlZ2lzdGVyIE1HTVQgZnJhbWUiKTsKKworICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOU0FQX0RlUmVnaXN0ZXJNZ210RnJhbWUKKworICBERVNDUklQVElPTgorICAgVGhpcyBBUEkgaXMgdXNlZCB0byBkZXJlZ2lzdGVyIHByZXZpb3VzbHkgcmVnaXN0ZXJlZCBmcmFtZS4KKworICBERVBFTkRFTkNJRVMKKyAgICBOQS4KKworICBQQVJBTUVURVJTCisKKyAgSU4KKyAgICBwdm9zR0N0eDogUG9pbnRlciB0byB2b3MgZ2xvYmFsIGNvbnRleHQgc3RydWN0dXJlCisgICAgZnJhbWVUeXBlOiBmcmFtZVR5cGUgdGhhdCBuZWVkcyB0byBiZS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xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgU0FQIHBvaW50ZXIgZnJvbSBwdm9zR0N0eCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICAgICAgIH0KKyAgICAgICAgaEhhbCA9IFZPU19HRVRfSEFMX0NCKHBTYXBDdHgtPnB2b3NHQ3R4KTsKKyAgICAgICAgaWYoICggTlVMTCA9PSBoSGFsICkgfHwgKCBlU0FQX1RSVUUgIT0gcFNhcEN0eC0+aXNTYXBTZXNzaW9uT3BlbiApICkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEhBTCBwb2ludGVyICglcCkgTlVMTCBPUiBTTUUgc2Vzc2lvbiBpcyBub3Qgb3BlbiAoJWQpIiwKKyAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIGhIYWwsIHBTYXBDdHgtPmlzU2FwU2Vzc2lvbk9wZW4gKTsKKyAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICAgICAgIH0KKworICAgICAgICBoYWxTdGF0dXMgPSBzbWVfRGVyZWdpc3Rlck1nbXRGcmFtZSggaEhhbCwgcFNhcEN0eC0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZVR5cGUsIG1hdGNoRGF0YSwgbWF0Y2hMZW4gKTsKKworICAgICAgICBpZiggZUhBTF9TVEFUVVNfU1VDQ0VTUyA9PSBoYWxTdGF0dXMgKQorICAgICAgICB7CisgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgICB9CisgICAgfQorCisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NBUCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiRmFpbGVkIHRvIERlcmVnaXN0ZXIgTUdNVCBmcmFtZSIpOworCisgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOU0FQX1BvcHVsYXRlRGVsU3RhUGFyYW1zCisKKyAgREVTQ1JJUFRJT04KKyAgVGhpcyBBUEkgaXMgdXNlZCB0byBwb3B1bGF0ZSBkZWwgc3RhdGlvbiBwYXJhbWV0ZXJzCisgIERFUEVOREVOQ0lFUworICBOQS4KKworICBQQVJBTUVURVJTCisgIElOCisgIG1hYzogICAgICAgICAgIHBvaW50ZXIgdG8gcGVlciBtYWMgYWRkcmVzcy4KKyAgcmVhc29uX2NvZGU6ICAgUmVhc29uIGNvZGUgZm9yIHRoZSBkaXNhc3NvYy9kZWF1dGguCisgIHN1YnR5cGU6ICAgICAgIHN1YnR5cGUgcG9pbnRzIHRvIGVpdGhlciBkaXNhc3NvYy9kZWF1dGggZnJhbWUuCisgIHBEZWxTdGFQYXJhbXM6IGFkZHJlc3Mgd2hlcmUgcGFyYW1ldGVycyB0byBiZSBwb3B1bGF0ZWQuCisKKyAgUkVUVVJOIFZBTFVFIE5PTkUKKworICBTSURFIEVGRkVDVFMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBXTEFOU0FQX1BvcHVsYXRlRGVsU3RhUGFyYW1zKGNvbnN0IHZfVThfdCAqbWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTE2X3QgcmVhc29uX2NvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90IHN1YnR5cGUsCis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lmbmRlZiBfX0JUQ19BUElfSF9fCisjZGVmaW5lIF9fQlRDX0FQSV9IX18KKworI2luY2x1ZGUgInZvc190eXBlcy5oIgorI2luY2x1ZGUgInZvc190aW1lci5oIgorI2luY2x1ZGUgInZvc19udml0ZW0uaCIKKworI2RlZmluZSBCVF9JTlZBTElEX0NPTk5fSEFORExFICgweEZGRkYpICAvKio8IEludmFsaWQgY29ubmVjdGlvbiBoYW5kbGUgKi8KKworLyogQUNMIGFuZCBTeW5jIGNvbm5lY3Rpb24gYXR0ZW1wdCByZXN1bHRzICovCisjZGVmaW5lIEJUX0NPTk5fU1RBVFVTX0ZBSUwgICAgICAoMCkgICAgICAgICAvKio8IENvbm5lY3Rpb24gZmFpbGVkICovCisjZGVmaW5lIEJUX0NPTk5fU1RBVFVTX1NVQ0NFU1MgICAoMSkgICAgICAgICAvKio8IENvbm5lY3Rpb24gc3VjY2Vzc2Z1bCAqLworI2RlZmluZSBCVF9DT05OX1NUQVRVU19NQVggICAgICAgKDIpICAgICAgICAgLyoqPCBUaGlzIGFuZCBiZXlvbmQgYXJlIGludmFsaWQgdmFsdWVzICovCisKKy8qKiBBQ0wgYW5kIFN5bmMgbGluayB0eXBlcworICBUaGVzZSBtdXN0IG1hdGNoIHRoZSBCbHVldG9vdGggU3BlYyEKKyovCisjZGVmaW5lIEJUX1NDTyAgICAgICAgICAgICAgICAgICgwKSAgIC8qKjwgU0NPIExpbmsgKi8KKyNkZWZpbmUgQlRfQUNMICAgICAgICAgICAgICAgICAgKDEpICAgLyoqPCBBQ0wgTGluayAqLworI2RlZmluZSBCVF9lU0NPICAgICAgICAgICAgICAgICAoMikgICAvKio8IGVTQ08gTGluayAqLworI2RlZmluZSBCVF9MSU5LX1RZUEVfTUFYICAgICAgICAoMykgICAvKio8IFRoaXMgdmFsdWUgYW5kIGhpZ2hlciBhcmUgaW52YWxpZCAqLworCisvKiogQUNMIGxpbmsgbW9kZXMKKyAgICBUaGVzZSBtdXN0IG1hdGNoIHRoZS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fTkVFRF9SRVNUQVJUID09IChyZXN1bHQpIHx8IFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19ORUVEX1JFTE9BRCA9PSAocmVzdWx0KSkKKworI2RlZmluZSBDQ01fSU5URUdFUl9UWVBFICAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgQ0NNX1NUUklOR19UWVBFICAgICAgICAgICAgICAgICAxCisKK3R5cGVkZWYgdm9pZCAoKnRDY21DZmdTZXRDYWxsYmFjaykodEhhbEhhbmRsZSBoSGFsLCB0QU5JX1MzMiByZXN1bHQpIDsKKwordHlwZWRlZiBlbnVtIHsKKyAgICBlQ0NNX1NUT1BQRUQsCisgICAgZUNDTV9TVEFSVEVELAorICAgIGVDQ01fUkVRX1NFTlQsCisgICAgZUNDTV9SRVFfUVVFVUVELAorICAgIGVDQ01fUkVRX0RPTkUsCit9IGVDY21TdGF0ZSA7CisKKy8qIFdlIGRvIG5vdCB1c2UgTGludXgncyBsaXN0IGZhY2lsaXR5ICovCit0eXBlZGVmIHN0cnVjdCBjZmdyZXEgeworICAgIHN0cnVjdCBjZmdyZXEgICAgICAgKm5leHQgOworICAgIHRBTklfVTE2ICAgICAgICAgICAgY2ZnSWQgOworICAgIHRBTklfVTggICAgICAgICAgICAgdHlwZSA7CisgICAgdEFOSV9VOCAgICAgICAgICAgICBzdGF0ZSA6IDcgOworICAgIHRBTklfVTggICAgICAgICAgICAgdG9CZVNhdmVkIDogMSA7CisgICAgdEFOSV9TMzIgICAgICAgICAgICBsZW5ndGggOworICAgIHZvaWQgICAgICAgICAgICAgICAgKmNjbVB0cjsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgIGNjbVZhbHVlOworICAgIHRDY21DZmdTZXRDYWxsYmFjayAgY2FsbGJhY2s7CisgICAgdm9pZCAgICAgICAgICAgICAgICAqZG9uZSA7Cit9IHRDZmdSZXEgOworCit0eXBlZGVmIHN0cnVjdCB7CisgICAgdEFOSV9VMTYgICA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m9yIGNhbGxlci4KKyAgICB0QU5JX1UxNiAgICAgICAgICAgIGh0X3Byb3RlY3Rpb247CisgICAgdEFOSV9VMzIgICAgICAgICAgICBkdGltUGVyaW9kOworICAgIHRBTklfVTggICAgICAgICAgICAgQXBVYXBzZEVuYWJsZTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgIHNzaWRIaWRkZW47CisgICAgdEFOSV9VOCAgICAgICAgICAgICB3cHNfc3RhdGU7CisgICAgdFZPU19DT05fTU9ERSAgICAgICBic3NQZXJzb25hOworICAgIHRBTklfVTE2ICAgICAgICAgICAgblJTTklFTGVuZ3RoOyAgLy9UaGUgYnl0ZSBjb3VudCBpbiB0aGUgcFJTTklFLCBpZiAwLCBwUlNOSUUgaXMgaWdub3JlZC4KKyAgICB0QU5JX1U4ICAgICAgICAgICAgICpwUlNOSUU7ICAgICAvL0lmIG5vdCBudWxsLCBpdCBoYXMgdGhlIElFIGJ5dGUgc3RyZWFtIGZvciBSU04KKyAgICB0QU5JX0JPT0xFQU4gICAgICAgIHVwZGF0ZWJlYWNvbkludGVydmFsOyAvL0ZsYWcgdXNlZCB0byBpbmRpY2F0ZSB1cGRhdGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGJlYWNvbkludGVydmFsCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgIHRBTklfQk9PTEVBTiAgICAgICAgbWZwQ2FwYWJsZTsKKyAgICB0QU5JX0JPT0xFQU4gICAgICAgIG1mcFJlcXVpcmVkOworI2VuZGlmCit9dENzclJvYW1TdGFydEJzc1BhcmFtczsKKworCit0eXBlZGVmIHN0cnVjdCB0YWdTY2FuQ21kCit7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgc2NhbklEOworICAgIGNzclNjYW5Db21wbGV0ZUNhbGxiYWNrIGNhbGxiYWNrOworICAgIHZvaWQgICAgICAgICAgICAgICAgICAgICpwQ29udGV4dDsKKyAgICBlQ3NyU2NhblJ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AgICAgICAgICAgICAgICAgLy9lYWNoIGZyYW1lIHN0YXJ0cyBhbmQgZW5kcy4KKyAgICB0QU5JX1U4IHN0YUlkOworfXRDc3JSb2FtQ29ubmVjdGVkSW5mbzsKKworCit0eXBlZGVmIHN0cnVjdCB0YWdDc3JMaW5rUXVhbGl0eUluZEluZm8KK3sKKyAgIGNzclJvYW1MaW5rUXVhbGl0eUluZENhbGxiYWNrICBjYWxsYmFjazsKKyAgIHZvaWQgICAgICAgICAgICAgICAgICAgICAgICAgICpjb250ZXh0OworfXRDc3JMaW5rUXVhbGl0eUluZEluZm87CisKK3R5cGVkZWYgc3RydWN0IHRhZ0NzclBlU3RhdHNSZXFJbmZvCit7CisgICB0TGlzdEVsZW0gICAgICAgICAgICAgIGxpbms7ICAvKiBsaXN0IGxpbmtzICovCisgICB0QU5JX1UzMiAgICAgICAgICAgICAgIHN0YXRzTWFzazsKKyAgIHRBTklfVTMyICAgICAgICAgICAgICAgcGVyaW9kaWNpdHk7CisgICB0QU5JX0JPT0xFQU4gICAgICAgICAgIHJzcFBlbmRpbmc7CisgICB2b3NfdGltZXJfdCAgICAgICAgICAgIGhQZVN0YXRzVGltZXI7CisgICB0QU5JX0JPT0xFQU4gICAgICAgICAgIHRpbWVyUnVubmluZzsKKyAgIHRBTklfVTggICAgICAgICAgICAgICAgc3RhSWQ7CisgICB0QU5JX1U4ICAgICAgICAgICAgICAgIG51bUNsaWVudDsKKyAgIHRwQW5pU2lyR2xvYmFsICAgICAgICAgcE1hYzsKKyAgIC8qIFRvIHJlbWVtYmVyIGlmIHRoZSBwZVN0YXRzIHRpbWVyIGlzIHN0b3BwZWQgc3VjY2Vzc2Z1bGx5IG9yIG5vdCAqLworICAgdEFOSV9CT09MRUFOICAgICAgICAgICB0aW1lclN0b3BGYWlsZWQ7CisKK310Q3NyUGVTdGF0c1JlcUluZm87CisKK3R5cGVkZWYgc3RydWN0IHRhZ0NzclN0YXRzQ2xpZW50UmVxSW5mbworeworICAgdExpc3RFbGVtICAgICAgICAgICAgICBsaW5rOyAgLyogbGlzdCBsaW5rcyAqLworICAgZUNzclN0YXRzUmVxdWVzdGVyVHlwZSByZXF1ZXN0ZXJJZDsKKyAgIHRDc3JTdGF0c0NhbGxiYWNrICAgICAgY2FsbGJhY2s7CisgICB0QU5JX1UzMiAgICAgICAgICAgICAgIHBlcmlvZGljaXR5OworICAgdm9pZCAgICAgICAgICAgICAgICAgICpwQ29udGV4dDsKKyAgIHRBTklfVTMyICAgICAgICAgICAgICAgc3RhdHNNYXNrOworICAgdENzclBlU3RhdHNSZXFJbmZvICAgICpwUGVTdGFFbnRyeTsKKyAgIHRBTklfVTggICAgICAgICAgICAgICAgc3RhSWQ7CisgICB2b3NfdGltZXJfdCAgICAgICAgICAgIHRpbWVyOworICAgdEFOSV9CT09MRUFOICAgICAgICAgICB0aW1lckV4cGlyZWQ7CisgICB0cEFuaVNpckdsb2JhbCAgICAgICAgIHBNYWM7IC8vIFRPRE86IENvbmZpcm0gdGhpcyBjaGFuZ2UgQlRBTVAKK310Q3NyU3RhdHNDbGllbnRSZXFJbmZvOworCit0eXBlZGVmIHN0cnVjdCB0YWdDc3JUbFN0YXRzUmVxSW5mbworeworICAgdEFOSV9VMzIgICAgICAgICAgICAgICBwZXJpb2RpY2l0eTsKKyAgIHRBTklfQk9PTEVBTiAgICAgICAgICAgdGltZXJSdW5uaW5nOworICAgdm9zX3RpbWVyX3QgICAgICAgICAgICBoVGxTdGF0c1RpbWVyOworICAgdEFOSV9VOCAgICAgICAgICAgICAgICBudW1DbGllbnQ7Cit9dENzclRsU3RhdHNSZXFJbmZvOworCit0eXBlZGVmIHN0cnVjdCB0YWdDc3JSb2FtU2Vzc2lvbgoreworICAgIHRBTklfVTggc2Vzc2lvbklkOyAgICAgICAgICAgICAvLyBTZXNzaW9uIElECisgICAgdEFOSV9CT09MRUFOIHNlc3Npb25BY3RpdmU7ICAgICAgLy8gVFJVRSBpZiBpdCBpcyB1c2VkCisgICAgdENzckJzc2lkI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NUdIWihjaDEpID09IENTUl9JU19DSEFOTkVMXzVHSFooY2gyKSkKKworCisjZGVmaW5lIENTUl9JU18xMURfSU5GT19GT1VORChwTWFjKSBcCisgICAgICAgICgwICE9IChwTWFjKS0+c2Nhbi5jaGFubmVsT2YxMWRJbmZvKQorLy8gREVBVVRISU5ECisjZGVmaW5lIENTUl9JU19ST0FNSU5HKHBTZXNzaW9uKSAoKENTUl9JU19MT1NUTElOS19ST0FNSU5HKChwU2Vzc2lvbiktPnJvYW1pbmdSZWFzb24pKSB8fCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZUNzckR5bmFtaWNSb2FtaW5nID09IChwU2Vzc2lvbiktPnJvYW1pbmdSZWFzb24pICB8fCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZUNzclJlYXNzb2NSb2FtaW5nID09IChwU2Vzc2lvbiktPnJvYW1pbmdSZWFzb24pKQorCisKKyNkZWZpbmUgQ1NSX0lTX1NFVF9LRVlfQ09NTUFORCggcENvbW1hbmQgKSAgICAoIGVTbWVDb21tYW5kU2V0S2V5ID09IChwQ29tbWFuZCktPmNvbW1hbmQgKQorCisjZGVmaW5lIENTUl9JU19BRERUU19XSEVOX0FDTU9GRl9TVVBQT1JURUQocE1hYykgKHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uYWRkVFNXaGVuQUNNSXNPZmYpCisvLyBERUFVVEhJTkQKKyNkZWZpbmUgQ1NSX0lTX0xPU1RMSU5LX1JPQU1JTkcocmVhc29uKSAgKChlQ3NyTG9zdGxpbmtSb2FtaW5nRGlzYXNzb2MgPT0gKHJlYXNvbikpIHx8IChlQ3NyTG9zdGxpbmtSb2FtaW5nRGVhdXRoID09IChyZWFzb24pKSkKKworI2RlZmluZSBDU1JfSVNfUk9BTUlOR19DT01NQU5EKHBDb21tYW5kKSAoKGVDc3JMb3N0TGluazEgPT0gKHBDb21tYW5kKS0+dS5yb2FtQ21kLnJvYW1SZWFzb24pIHx8XAorICAgICAgICA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WZpbmUgTExfQUNDRVNTX05PTE9DSyAgICAgICAgZUFOSV9CT09MRUFOX0ZBTFNFCisKK3R5cGVkZWYgc3RydWN0IHRhZ0xpc3RFbGVtCit7CisgICAgc3RydWN0IHRhZ0xpc3RFbGVtICpsYXN0OworICAgIHN0cnVjdCB0YWdMaXN0RWxlbSAqbmV4dDsKK310TGlzdEVsZW07CisKK3R5cGVkZWYgZW51bQoreworICAgIExJU1RfRkxBR19DTE9TRSA9IDAsCisgICAgTElTVF9GTEFHX09QRU4gPSAweGExYjJjNGQ3LAorfXRMaXN0RmxhZzsKKworLy9UaGlzIGlzIGEgY2lyY3VsYXIgZG91YmxlIGxpbmsgbGlzdAordHlwZWRlZiBzdHJ1Y3QgdGFnRGJsTGlua0xpc3QKK3sKKyAgdExpc3RFbGVtIExpc3RIZWFkOworICB2b3NfbG9ja190IExvY2s7CisgIHRBTklfVTMyICBDb3VudDsKKyAgdEhkZEhhbmRsZSBoSGRkOworICB0TGlzdEZsYWcgRmxhZzsKKworICAvKmNvbW1hbmQgZGVidWdnaW5nICovCisgIHRBTklfVTMyICBjbWRUaW1lb3V0RHVyYXRpb247ICAvKiBjb21tYW5kIHRpbWVvdXQgZHVyYXRpb24gKi8KKyAgdm9zX3RpbWVyX3QgKmNtZFRpbWVvdXRUaW1lcjsgIC8qY29tbWFuZCB0aW1lb3V0IFRpbWVyICovCit9dERibExpbmtMaXN0OworCisvL1RvIGdldCB0aGUgYWRkcmVzcyBvZiBhbiBvYmplY3Qgb2YgKHR5cGUpIGJhc2Ugb24gdGhlIChhZGRyZXNzKSBvZiBvbmUgb2YgaXRzIChmaWVsZCkKKyNkZWZpbmUgR0VUX0JBU0VfQUREUihhZGRyZXNzLCB0eXBlLCBmaWVsZCkgKCh0eXBlICopKCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopKGFkZHJlc3MpIC0gXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKSgmKCh0eXBlICopMCktPmZpZWxkKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisvL1RvIGdldCB0aGUgb2Zmc2V0IG9mIChmaWVsZCkgaW5zaWRlIHN0cnVjdHVyZSAodHlwZSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorI2RlZmluZSBHRVRfRklFTERfT0ZGU0VUKHR5cGUsIGZpZWxkKSAgKCh1aW50cHRyX3QpKCYoKCh0eXBlICopMCktPmZpZWxkKSkpCisKKyNkZWZpbmUgR0VUX1JPVU5EX1VQKCBfRmllbGQsIF9Cb3VuZGFyeSApICgoKF9GaWVsZCkgKyAoKF9Cb3VuZGFyeSkgLSAxKSkgICYgfigoX0JvdW5kYXJ5KSAtIDEpKQorI2RlZmluZSBCSVRTX09OKCAgX0ZpZWxkLCBfQml0bWFzayApICggKF9GaWVsZCkgfD0gIChfQml0bWFzaykgKQorI2RlZmluZSBCSVRTX09GRiggX0ZpZWxkLCBfQml0bWFzayApICggKF9GaWVsZCkgJj0gfihfQml0bWFzaykgKQorCisjZGVmaW5lIENTUl9NQVgoYSwgYikgICgoYSkgPiAoYikgPyAoYSkgOiAoYikpCisjZGVmaW5lIENTUl9NSU4oYSwgYikgICgoYSkgPCAoYikgPyAoYSkgOiAoYikpCisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisjZGVmaW5lIGNzcklzTGlzdEVtcHR5KHBIZWFkKSAoKHBIZWFkKS0+bmV4dCA9PSAocEhlYWQpKQorCit0QU5JX1UzMiBjc3JMTENvdW50KCB0RGJsTGlua0xpc3QgKnBMaXN0ICk7CisKK2VIYWxTdGF0dXMgY3NyTExPcGVuKCB0SGRkSGFuZGxlIGhIZGQsIHREYmxMaW5rTGlzdCAgKnBMaXN0ICk7Cit2b2lkIGNzckxMQ2xvc2UoIHREY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0ZSAgICAgICBwcmV2TmVpZ2hib3JSb2FtU3RhdGU7CisgICAgdENzck5laWdoYm9yUm9hbUNmZ1BhcmFtcyAgIGNmZ1BhcmFtczsKKyAgICB0Q3NyQnNzaWQgICAgICAgICAgICAgICAgICAgY3VyckFQYnNzaWQ7IC8vIGN1cnJlbnQgYXNzb2MgQVAKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgY3VyckFQb3BlcmF0aW9uQ2hhbm5lbDsgLy8gY3VycmVudCBhc3NvYyBBUAorICAgIHZvc190aW1lcl90ICAgICAgICAgICAgICAgICBuZWlnaGJvclNjYW5UaW1lcjsKKyAgICB2b3NfdGltZXJfdCAgICAgICAgICAgICAgICAgbmVpZ2hib3JSZXN1bHRzUmVmcmVzaFRpbWVyOworICAgIHZvc190aW1lcl90ICAgICAgICAgICAgICAgICBlbXB0eVNjYW5SZWZyZXNoVGltZXI7CisgICAgdENzck5laWdoYm9yUm9hbUNoYW5uZWxJbmZvIHJvYW1DaGFubmVsSW5mbzsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgY3VycmVudE5laWdoYm9yTG9va3VwVGhyZXNob2xkOworICAgIHRBTklfQk9PTEVBTiAgICAgICAgICAgICAgICBzY2FuUnNwUGVuZGluZzsKKyAgICB0QU5JX1RJTUVTVEFNUCAgICAgICAgICAgICAgc2NhblJlcXVlc3RUaW1lU3RhbXA7CisgICAgdERibExpbmtMaXN0ICAgICAgICAgICAgICAgIHJvYW1hYmxlQVBMaXN0OyAgICAvLyBMaXN0IG9mIGN1cnJlbnQgRlQgY2FuZGlkYXRlcworICAgIHRBTklfVTMyICAgICAgICAgICAgICAgICAgICBjc3JTZXNzaW9uSWQ7CisgICAgdENzclJvYW1Qcm9maWxlICAgICAgICAgICAgIGNzck5laWdoYm9yUm9hbVByb2ZpbGU7CisjaWZkZWYgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIgICAgCisgICAgdEFOSV9CT09MRUFOICAgICAgICAgICAgICAgIGlzMTFyQXNzb2M7CisgICAgdENzcjExckFzc29jTmVpZ2hib3JJbmZvICAgIEZUUm9hbUluZm87CisjZW5kaWYgLyogV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIgKi8KKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICAgdEFOSV9CT09MRUFOICAgICAgICAgICAgICAgIGlzRVNFQXNzb2M7CisgICAgdEFOSV9CT09MRUFOICAgICAgICAgICAgICAgIGlzVk9BZG1pdHRlZDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICAgICAgTWluUUJzc0xvYWRSZXF1aXJlZDsKKyNlbmRpZgorI2lmZGVmIEZFQVRVUkVfV0xBTl9MRlIKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgdUVtcHR5U2NhbkNvdW50OyAvKiBDb25zZWN1dGl2ZSBudW1iZXIgb2YgdGltZXMgc2NhbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlpZWxkZWQgbm8gcmVzdWx0cy4gKi8KKyAgICB0Q3NyUm9hbUNvbm5lY3RlZFByb2ZpbGUgICAgcHJldkNvbm5Qcm9maWxlOyAvKiBQcmV2aW91cyBjb25uZWN0ZWQgcHJvZmlsZS4gSWYgdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IHByb2ZpbGUgZG9lcyBub3QgbWF0Y2ggcHJldmlvdXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ZSByZS1pbml0aWFsaXplIG9jY3VwaWVkIGNoYW5uZWwgbGlzdCAqLworICAgIHRBTklfUzggICAgICAgICAgICAgICAgICAgICBsb29rdXBET1dOUnNzaTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgdVNjYW5Nb2RlOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICB1T3NSZXF1ZXN0ZWRIYW5kb2ZmOyAvKiB1cHBlciBsYXllciByZXF1ZXN0ZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYSByZWFzc29jICovCisjaWZkZWYgV0xBTl9GRUFUVVJFX1JPQU1fU0NBTl9PRkZMT0FECisgICAgdENzckhhbmRvZmZSZXF1ZXN0ICAgICAgICAgIGhhbmRvZmZSZXFJbmZvOyAvKiBoYW5kb2ZmIHJlbGF0ZWQgaW5mbyBjYW1lCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoIHVwcGVyIGxheWVyJ3MgcmVxIGZvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVhc3NvYyAqLworI2VuZGlmCisjZW5kaWYKKyAgICB0U21lRmFzdFJvYW1UcmlnZ2VyICAgICAgICAgY2ZnUm9hbUVuOworICAgIHRTaXJNYWNBZGRyICAgICAgICAgICAgICAgICBjZmdSb2FtYnNzSWQ7CisgICAgdm9zX3RpbWVyX3QgICAgICAgICAgICAgICAgIGZvcmNlZEluaXRpYWxSb2FtVG81R0hUaW1lcjsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgaXNGb3JjZWRJbml0aWFsUm9hbVRvNUdIOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICBsYXN0U2VudENtZDsKK30gdENzck5laWdoYm9yUm9hbUNvbnRyb2xJbmZvLCAqdHBDc3JOZWlnaGJvclJvYW1Db250cm9sSW5mbzsKKworCisvKiBBbGwgdGhlIG5lY2Vzc2FyeSBGdW5jdGlvbiBkZWNsYXJhdGlvbnMgYXJlIGhlcmUgKi8KK2VIYWxTdGF0dXMgY3NyTmVpZ2hib3JSb2FtSW5kaWNhdGVDb25uZWN0KHRwQW5pU2lyR2xvYmFsIHBNYWMsdEFOSV9VOCBzZXNzaW9uSWQsIFZPU19TVEFU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sIGNvbnN0IHZfQk9PTF90IGVzZU1vZGUpOworVk9TX1NUQVRVUyBjc3JOZWlnaGJvclJvYW1DaGFubmVsc0ZpbHRlckJ5QmFuZCgKKyAgICAgICAgICAgICAgICAgICAgICB0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTgqICBwSW5wdXRDaGFubmVsTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICAgaW5wdXROdW1PZkNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTgqICBwT3V0cHV0Q2hhbm5lbExpc3QsCisgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCogIHBNZXJnZWRPdXRwdXROdW1PZkNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgIHRTaXJSRkJhbmQgYmFuZAorICAgICAgICAgICAgICAgICAgICAgICk7CitWT1NfU1RBVFVTIGNzck5laWdoYm9yUm9hbVJlYXNzb2NJbmRDYWxsYmFjayh2X1BWT0lEX3QgcEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgdHJhZmZpY1N0YXR1cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfUFZPSURfdCBwVXNlckN0eHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1M3X3QgICBhdmdSc3NpKTsKK1ZPU19TVEFUVVMgY3NyTmVpZ2hib3JSb2FtTWVyZ2VDaGFubmVsTGlzdHModHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAgKnBJbnB1dENoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICBpbnB1dE51bU9mQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggICpwT3V0cHV0Q2hhbm5lbExpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggIG91dHB1dE51bU9mQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggICpwTWVyZ2VkT3V0cHV0TnVtT2ZDaGFubmVscyk7CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfUk9BTV9TQ0FOX09GRkxPQUQKKyNkZWZpbmUgUk9BTV9TQ0FOX09GRkxPQURfU1RBUlQgICAgICAgICAgICAgICAgICAgICAxCisjZGVmaW5lIFJPQU1fU0NBTl9PRkZMT0FEX1NUT1AgICAgICAgICAgICAgICAgICAgICAgMgorI2RlZmluZSBST0FNX1NDQU5fT0ZGTE9BRF9SRVNUQVJUICAgICAgICAgICAgICAgICAgIDMKKyNkZWZpbmUgUk9BTV9TQ0FOX09GRkxPQURfVVBEQVRFX0NGRyAgICAgICAgICAgICAgICA0CisKKyNkZWZpbmUgUkVBU09OX0NPTk5FQ1QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxCisjZGVmaW5lIFJFQVNPTl9DSEFOTkVMX0xJU1RfQ0hBTkdFRCAgICAgICAgICAgICAgICAgMgorI2RlZmluZSBSRUFTT05fTE9PS1VQX1RIUkVTSF9DSEFOR0VEICAgICAgICAgICAgICAgIDMKKyNkZWZpbmUgUkVBU09OX0RJU0NPTk5FQ1RFRCAgICAgICAgICAgICAgICAgICAgICAgICA0CisjZGVmaW5lIFJFQVNPTl9SU1NJX0RJRkZfQ0hBTkdFRCAgICAgICAgICAgICAgICAgICAgNQorI2RlZmluZSBSRUFTT05fRVNFX0lOSV9DRkdfQ0hBTkdFRCAgICAgICAgICAgICAgICAgIDYKKyNkZWZpbmUgUkVBU09OX05FSUdIQk9SX1NDQU5fUkVGUkVTSF9QR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IElFcyBmcm9tIHBTaXJCc3NEZXNjLiBJdCBzaGFsbCBiZSByZXR1cm5lZCBmcm9tIGZ1bmN0aW9uIGNzckdldFBhcnNlZEJzc0Rlc2NyaXB0aW9uSUVzIAordEFOSV9CT09MRUFOIGNzcklzU2VjdXJpdHlNYXRjaCggdEhhbEhhbmRsZSBoSGFsLCB0Q3NyQXV0aExpc3QgKmF1dGhUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdENzckVuY3J5cHRpb25MaXN0ICpwVUNFbmNyeXB0aW9uVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRDc3JFbmNyeXB0aW9uTGlzdCAqcE1DRW5jcnlwdGlvblR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX0JPT0xFQU4gKnBNRlBFbmFibGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcE1GUFJlcXVpcmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcE1GUENhcGFibGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyQnNzRGVzY3JpcHRpb24gKnBTaXJCc3NEZXNjLCB0RG90MTFmQmVhY29uSUVzICpwSWVzLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDc3JBdXRoVHlwZSAqbmVnb3RpYXRlZEF1dGh0eXBlLCBlQ3NyRW5jcnlwdGlvblR5cGUgKm5lZ290aWF0ZWRVQ0NpcGhlciwgZUNzckVuY3J5cHRpb25UeXBlICpuZWdvdGlhdGVkTUNDaXBoZXIgKTsKK3RBTklfQk9PTEVBTiBjc3JJc0JTU1R5cGVNYXRjaChlQ3NyUm9hbUJzc1R5cGUgYnNzVHlwZTEsIGVDc3JSb2FtQnNzVHlwZSBic3NUeXBlMik7Cit0QU5JX0JPT0xFQU4gY3NySXNCc3NUeXBlSUJTUyhlQ3Ny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jLCB0QU5JX1UzMiBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgdENzclJvYW1Nb2RpZnlQcm9maWxlRmllbGRzICpwTW9kUHJvZmlsZUZpZWxkcywKKyAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcFJvYW1JZCwgdl9CT09MX3QgZkZvcmNlKTsKKworZUhhbFN0YXR1cworY3NySXNjb25jdXJyZW50c2Vzc2lvblZhbGlkKHRwQW5pU2lyR2xvYmFsIHBNYWMsdEFOSV9VMzIgY3Vyc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFZPU19DT05fTU9ERSBjdXJyQnNzUGVyc29uYSk7CisKKy8vVXBkYXRlIGJlYWNvbkludGVydmFsIGZvciBQMlAtR08gY2FzZSBpZiBpdCBpcyBkaWZmZXJlbnQgCitlSGFsU3RhdHVzIGNzclVwZGF0ZXAycEJlYWNvbkludGVydmFsKHRwQW5pU2lyR2xvYmFsIHBNYWMpOworCisvL0JlYWNvbkludGVydmFsIHZhbGlkYXRpb24gZm9yIE1DQyBzdXBwb3J0CitlSGFsU3RhdHVzIGNzclZhbGlkYXRlTUNDQmVhY29uSW50ZXJ2YWwodHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VOCBjaGFubmVsSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMTYgKmJlYWNvbkludGVydmFsLCB0QU5JX1UzMiBjdXJzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFZPU19DT05fTU9ERSBjdXJyQnNzUGVyc29uYSk7CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUgordEFOSV9CT09MRUFOIGNzcklzUHJvZmlsZTExciggdENzclJvYW1Qcm9maWxlICpwUHJvZmlsZSApOwordEFOSV9CT09MRUFOIGNzcklzQXV0aFR5cGUxMXIoIGVDc3JBdXRoVHlwZSBB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orKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaWZuZGVmIF9fTkFOX0FQSV9IX18KKyNkZWZpbmUgX19OQU5fQVBJX0hfXworCisjaW5jbHVkZSAidm9zX3R5cGVzLmgiCisjaW5jbHVkZSAiaGFsVHlwZXMuaCIKKwordHlwZWRlZiBzdHJ1Y3Qgc05hblJlcXVlc3RSZXEKK3sKKyAgICB0QU5JX1UxNiByZXF1ZXN0X2RhdGFfbGVuOworICAgIGNvbnN0IHRBTklfVTgqIHJlcXVlc3RfZGF0YTsKK30gdE5hblJlcXVlc3RSZXEsICp0cE5hblJlcXVlc3RSZXE7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIEZ1bmN0aW9uOiBQb2ludGVyIE5hbkNhbGxiYWNrCisgKgorICogRGVzY3JpcHRpb246CisgKiB0aGlzIGZ1bmN0aW9uIHBvaW50ZXIgaXMgdXNlZCBob2xkIG5hbiByZXNwb25zZSBjYWxsYmFjay4gV2hlbiBldmVyIGRyaXZlcgorICogcmVjZWl2ZXMgbmFuIHJlc3BvbnNlLCB0aGlzIGNhbGxiYWNrIHdpbGwgYmUgdXNlZC4KKyAqCisgKiBBcmdzOgorICogZmlyc3QgYXJndW1lbnQgdG8gcGFzcyBoSGFsIHBvaW50ZXIgYW5kIHNlY29uZCBhcmd1bWVudAorICogdG8gcGFzcyB0aGUgbmFuIHJlc3BvbnNlIGRhdGEuCisgKgorICogUmV0dXJuczoKKyAqIHZvaWQKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3R5cGVkZWYgdm9pZCAoKk5hbkNhbGxiYWNrKSh2b2lkKiwgdFNpck5hbkV2ZW50Kik7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIEZ1bmN0aW9uOiBzbWVfTmFuUmVnaXN0ZXJDYWxsYmFjaworICoKKyAqIERlc2NyaXB0aW9uOgorICogVGhpcyBmdW5jdGlvbiBnZXRzIGNhbGxlZCB3aGVuIEhERCB3YW50cyByZWdpc3RlciBuYW4gcnNwIGNhbGxiYWNrIHdpdGgKKyAqIHNtZSBsYXllci4KKyAqCisgKiBBcmdzOgorICogaEhhbCBhbmQgY2FsbGJhY2sgd2hpY2ggbmVlZHMgdG8gYmUgcmVnaXN0ZXJlZC4KKyAqCisgKiBSZXR1cm5zOgorICogdm9pZAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordm9pZCBzbWVfTmFuUmVnaXN0ZXJDYWxsYmFjayh0SGFsSGFuZGxlIGhIYWwsIE5hbkNhbGxiYWNrIGNhbGxiYWNrKTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogRnVuY3Rpb246IHNtZV9OYW5SZXF1ZXN0CisgKgorICogRGVzY3JpcHRpb246CisgKiBUaGlzIGZ1bmN0aW9uIGdldHMgY2FsbGVkIHdoZW4gSEREIHJlY2VpdmVzIE5BTiB2ZW5kb3IgY29tbWFuZAorICogZnJvbSB1c2Vyc3BhY2UKKyAqCisgKiBBcmdzOgorICogaEhhbCwgTmFuIFJlcXVlc3Qgc3RydWN0dXJlIHB0ciBhbmQgc2Vzc2lvbklkCisgKgorICogUmV0dXJuczoKKyAqIFZPU19TVEFUVVMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK1ZPU19TVEFUVVMgc21lX05hblJlcXVlc3QodEhhbEhhbmRsZSBoSGFsSGFuZGxlLCB0cE5hblJlcXVlc3RSZXEgaW5wdXQsCisgICAgICAgIHRBTklfVTMyIHNlc3Npb25JZCk7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgXGZuIHNtZV9OYW5FdmVudAorCisgIFxicmllZgorICBhIGNhbGxiYWNrIGZ1bmN0aW9uIGNhbGxlZCB3aGVuIFNNRSByZWNlaXZlZCBlV05JX1NNRV9OQU5fRVZFTlQKKyAgZXZlbnQgZnJvbSBXREEKKworICBccGFyYW0gaEhhbCAtIEhBTCBoYW5kbGUgZm9yIGRldmljZQorICBccGFyYW0gcE1zZyAtIE1lc3NhZ2UgYm9keSBwYXNzZWQgZnJvbSBXREE7IGluY2x1ZGVzIE5BTiBoZWFkZXIKKworICBccmV0dXJuIFZPU19TVEFUVVMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK1ZPU19TVEFUVVMgc21lX05hbkV2ZW50KHRIYWxIYW5kbGUgaEhhbCwgdm9pZCogcE1zZyk7CisKKyNlbmRpZiAvKiBfX05BTl9BUElfSF9fICovCmRpZmYgLS1naXQgYS93bGFuL3ByaW1hL0NPUkUvU01FL2luYy9vZW1EYXRhQXBpLmggYi93bGFuL3ByaW1hL0NPUkUvU01FL2luYy9vZW1EYXRhQXBpLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMmFlOTc4YgotLS0gL2Rldi9udWxsCisrKyBiL3dsYW4vcHJpbWEvQ09SRS9TTUUvaW5jL29lbURhdGFBcGkuaApAQCAtMCwwICsxLDEzOCBAQAorLyoKKyAqIENvcHlyaWdodCAoYykgMjAxMi0yMDEzIFRoZSBMaW51eCBGb3VuZGF0aW9uLiBBbGw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X0RBVEFfUkVRX1NJWkUgMTM0CisjZW5kaWYKKworI2lmbmRlZiBPRU1fREFUQV9SU1BfU0laRQorI2RlZmluZSBPRU1fREFUQV9SU1BfU0laRSAxOTY4CisjZW5kaWYKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgT0VNIERBVEEgUkVRL1JTUCAtIERBVEEgU1RSVUNUVVJFUworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyogU3RydWN0dXJlIGZvciBkZWZpbmluZyByZXEgc2VudCB0byB0aGUgUEUgKi8KK3R5cGVkZWYgc3RydWN0IHRhZ09lbURhdGFSZXEKK3sKKyAgICB0QU5JX1U4ICAgc2Vzc2lvbklkOworICAgIHRBTklfVTggICBvZW1EYXRhUmVxW09FTV9EQVRBX1JFUV9TSVpFXTsKK30gdE9lbURhdGFSZXEsIHRPZW1EYXRhUmVxQ29uZmlnOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICBPRU0gREFUQSBSRVNQT05TRSAtIERBVEEgU1RSVUNUVVJFUworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3R5cGVkZWYgc3RydWN0IHRhZ09lbURhdGFSc3AKK3sKKyAgICB0QU5JX1U4ICAgb2VtRGF0YVJzcFtPRU1fREFUQV9SU1BfU0laRV07Cit9IHRPZW1EYXRhUnNwOworCisvKioqK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ZGVmIHN0cnVjdCB0YWdPZW1EYXRhU3RydWN0Cit7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgICAgICAgICAgbmV4dE9lbVJlcUlkOyAvL2EgZ2xvYmFsIHJlcSBpZAorICAgIHRBTklfQk9PTEVBTiAgICAgICAgICAgICAgICAgICAgIG9lbURhdGFSZXFBY3RpdmU7IC8vaW5kaWNhdGVzIHRoYXQgY3VycmVudGx5IGEgcmVxdWVzdCBoYXMgYmVlbiBwb3N0ZWQgYW5kIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3dhaXRpbmcgZm9yIHRoZSByZXNwb25zZQorICAgIG9lbURhdGFfT2VtRGF0YVJlcUNvbXBsZXRlQ2FsbGJhY2sgICBjYWxsYmFjazsgLy9jYWxsYmFjayBmdW5jdGlvbiBwb2ludGVyIGZvciByZXR1cm5pbmcgdGhlIHJlc3BvbnNlCisgICAgdm9pZCogICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvbnRleHQ7IC8vY29udGV4dCBvZiB0aGUgb3JpZ2luYWwgY2FsbGVyCisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgICAgICAgICAgb2VtRGF0YVJlcUlEOyAvL29yaWdpbmFsIHJlcXVlc3QgSUQKKyAgICB0T2VtRGF0YVJzcCogICAgICAgICAgICAgICAgICAgICBwT2VtRGF0YVJzcDsgLy9yZXNwb25zZQorICAgIHRPZW1EYXRhUmVxQ29uZmlnICAgICAgICAgICAgICAgIG9lbURhdGFSZXFDb25maWc7IC8vY3VycmVudCBvZW0gZGF0YSByZXF1ZXN0CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkOyAvL1Nlc3Npb24gb24gd2hpY2ggb2VtIGRhdGEgcmVxIGlzIGFjdGl2ZQorfSB0T2VtRGF0YVN0cnVjdDsKKwordHlwZWRlZiBzdHJ1Y3QgdGFnT2VtRGF0YUNtZAoreworIC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KioqKioqKioqKioqKioqKioKKyoKKyogTmFtZTogIHAycF9BcGkuaAorKgorKiBEZXNjcmlwdGlvbjogUDJQIEZTTSBkZWZpbmVzLgorKgorKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaWZuZGVmIF9fUDJQX0FQSV9IX18KKyNkZWZpbmUgX19QMlBfQVBJX0hfXworCisjaW5jbHVkZSAidm9zX3R5cGVzLmgiCisjaW5jbHVkZSAiaGFsVHlwZXMuaCIKKyNpbmNsdWRlICJwYWxUaW1lci5oIgorI2luY2x1ZGUgInZvc19sb2NrLmgiCisKK3R5cGVkZWYgc3RydWN0IHNQMnBQc0NvbmZpZ3sKKyAgdEFOSV9VOCAgIG9wcF9wczsKKyAgdEFOSV9VMzIgIGN0V2luZG93OworICB0QU5JX1U4ICAgY291bnQ7IAorICB0QU5JX1UzMiAgZHVyYXRpb247CisgIHRBTklfVTMyICBpbnRlcnZhbDsKKyAgdEFOSV9VMzIgIHNpbmdsZV9ub2FfZHVyYXRpb247CisgIHRBTklfVTggICBwc1NlbGVjdGlvbjsKKyAgdEFOSV9VOCAgIHNlc3Npb25pZDsgICAKK310UDJwUHNDb25maWcsKnRwUDJwUHNDb25maWc7CisKK3R5cGVkZWYgZUhhbFN0YXR1cyAoKnJlbWFpbk9uQ2hhbkNhbGxiYWNrKSggdEhhbEhhbmRsZSwgdm9pZCogY29udGV4dCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVIYWxTdGF0dXMgc3RhdHVzICk7CisKK3R5cGVkZWYgc3RydWN0IHNSZW1haW5PbkNobnsKKyAgICB0QU5JX1U4IGNobjsKKyAgICB0QU5JX1UzMiBkdXJhdGlvbjsKKyAgICByZW1haW5PbkNoYW5DYWxsYmFjayBjYWxsYmFjazsKKyAgdm9pZCAqcENCQ29udGV4dDsKK310UmVtYWluT25DaG4sIHRwUmV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fVTggT3JpZ2luYWxHcm91cENhcGFiaWxpdHk7CisjZW5kaWYKK30gdHAycENvbnRleHQsICp0UHAycENvbnRleHQ7CisKK2VIYWxTdGF0dXMgc21lX1JlbWFpbk9uQ2hhbm5lbCggdEhhbEhhbmRsZSBoSGFsLCB0QU5JX1U4IHNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBjaGFubmVsLCB0QU5JX1UzMiBkdXJhdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtYWluT25DaGFuQ2FsbGJhY2sgY2FsbGJhY2ssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnBDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGlzUDJQUHJvYmVSZXFBbGxvd2VkKTsKK2VIYWxTdGF0dXMgc21lX1JlcG9ydFByb2JlUmVxKCB0SGFsSGFuZGxlIGhIYWwsIHRBTklfVTggZmxhZyApOworZUhhbFN0YXR1cyBzbWVfdXBkYXRlUDJwSWUoIHRIYWxIYW5kbGUgaEhhbCwgdm9pZCAqcDJwSWUsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIHAycEllTGVuZ3RoICk7CitlSGFsU3RhdHVzIHNtZV9zZW5kQWN0aW9uKCB0SGFsSGFuZGxlIGhIYWwsIHRBTklfVTggc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdEFOSV9VOCAqcEJ1ZiwgdEFOSV9VMzIgbGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMTYgd2FpdCwgdEFOSV9CT09MRUFOIG5vYWNrKTsKK2VIYWxTdGF0dXMgc21lX0NhbmNlbFJlbWFpbk9uQ2hhbm5lbCggdEhhbEhhbmRsZSBoSGFsLCB0QU5JX1U4IHNlc3Npb25JZCApOworZUhhbFN0YXR1cyBzbWVfcDJwT3BlbiggdEhhbEhhbmRsZSBoSGFsICk7CitlSGFsU3RhdHVzIHAycFN0b3AoIHRIYWxIYW5kbGUgaEhhbCApOworZUhhbFN0YXR1cyBzbWVfcDJwQ2xvc2UoIHRIYWxIYW5kbGUgaEhhbCApOworZUhhbFN0YXR1cyBzbWVfcDJwU2V0UHMoIHRIYWxIYW5kbGUgaEhhbCwgdFAycFBzQ29uZmlnICogZGF0YSApOworI2lmZGVmIFdMQU5fRkVBVFVSRV9QMlBfSU5URVJOQUwKK2VIYWxTdGF0dXMgcDJwUmVtYWluT25DaGFubmVsKCB0SGFsSGFuZGxlIGhIYWwsIHRBTklfVTggc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggY2hhbm5lbCwgdEFOSV9VMzIgZHVyYXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtYWluT25DaGFuQ2FsbGJhY2sgY2FsbGJhY2ssIHZvaWQgKnBDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggaXNQMlBQcm9iZVJlcUFsbG93ZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVAyUFJlbWFpbk9uQ2huUmVhc29uIHJlYXNvbik7CisjZWxzZQorZUhhbFN0YXR1cyBwMnBSZW1haW5PbkNoYW5uZWwoIHRIYWxIYW5kbGUgaEhhbCwgdEFOSV9VOCBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBjaGFubmVsLCB0QU5JX1UzMiBkdXJhdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1haW5PbkNoYW5DYWxsYmFjayBjYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpwQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGlzUDJQUHJvYmVSZXFBbGxv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ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisKKyoKKworKiBOYW1lOiAgcG1jQXBpLmgKKworKgorCisqIERlc2NyaXB0aW9uOiBQb3dlciBNYW5hZ2VtZW50IENvbnRyb2wgKFBNQykgQVBJIGRlZmluaXRpb25zLgorCisqIEFsbCBSaWdodHMgUmVzZXJ2ZWQuCisKKworKgorCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKworI2lmbmRlZiBfX1BNQ19BUElfSF9fCisKKyNkZWZpbmUgX19QTUNfQVBJX0hfXworCisvL1RoaXMgdGltZXIgdmFsdWUgZGV0ZXJtaW5lcyB0aGUgZGVmYXVsdCBwZXJpb2RpY2l0eSBhdCB3aGljaCBCTVBTIHJldHJpZXMgd2lsbCBoYXBwZW4KKy8vVGhpcyBkZWZhdWx0IHZhbHVlIGlzIG92ZXJ3cml0dGVuIHR5cGljYWx5IGJ5IE9TIHNwZWNpZmljIHJlZ2lzdHJ5L0lOSSB2YWx1ZXMuIAorI2RlZmluZSBCTVBTX1RSQUZGSUNfVElNRVJfREVGQVVMVCA1MDAwICAvL3VuaXQgPSBtcworI2RlZmluZSBESENQX1JFTUFJTl9QT1dFUl9BQ1RJVkVfVEhSRVNIT0xEIDEyIC8vICgxMiAqIDUpIHNlYyA9IDYwIHNlY29uZHMgPSAxIG1pbgorCisvL1RoaXMgdGltZXIgdmFsdWUgaXMgdXNlZCB3aGVuIHN0YXJ0aW5nIHRoZSB0aW1lciByaWdodCBhZ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RvIHJldHJpZXZlIGZyYW1lcyBmcm9tIEFQLCBGQUxTRSBpZiBhCisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCBkYXRhIGZyYW1lIHdpdGggdGhlIFBNIGJpdCByZXNldCBzaG91bGQgYmUgdXNlZCAqLworCisgICAgdEFOSV9CT09MRUFOIHNldFBtT25MYXN0RnJhbWU7IC8qIFRSVUUgdG8ga2VlcCBkZXZpY2UgaW4gQk1QUyBhcyBtdWNoIGFzIHBvc3NpYmxlLCBGQUxTRSBvdGhlcndpc2UsIFRSVUUgbWVhbnM6CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSkgUE0gYml0IHNob3VsZCBiZSBzZXQgb24gbGFzdCBwZW5kaW5nIHRyYW5zbWl0IGRhdGEgZnJhbWUKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSBudWxsIGZyYW1lIHdpdGggUE0gYml0IHNldCBzaG91bGQgYmUgdHJhbnNtaXR0ZWQgYWZ0ZXIgbGFzdCBwZW5kaW5nIHJlY2VpdmUKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZSBoYXMgYmVlbiBwcm9jZXNzZWQgKi8KKworICAgIHRBTklfQk9PTEVBTiBlbmFibGVCZWFjb25FYXJseVRlcm1pbmF0aW9uOyAvKiBpZiBUUlVFLCBCRVQgZmVhdHVyZSBpbiBSSVZBIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWxsIGJlIGVuYWJsZWQsIEZBTFNFIG90aGVyd2lzZSwgVFJVRSBtZWFuczoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUlhQIHdpbGwgcmVhZCB0aGUgYmVhY29uIGhlYWRlciBmb3IgdGhlIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUSU0gYml0ICYgZGlzY2FyZCB0aGUgcmVzdCBpZiBzZXQgdG8gMCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIGluIEJNUFMgICAgICAgICAgICAgICovCisgICAgdEFOSV9VOCAgICAgIGJjbkVhcmx5VGVybVdha2VJbnRlcnZhbDsgLyogVGhpcyBzcGVjaWZpZXMgaG93IG9mdGVuIGluIHRlcm1zIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZiBMSSB3ZSB3aWxsIGRpc2FibGUgQkVUIGluIG9yZGVyIHRvIHN5bmMgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwIFRTRiovCisKK30gdFBtY0JtcHNDb25maWdQYXJhbXMsICp0cFBtY0JtcHNDb25maWdQYXJhbXM7CisKKworCisKKy8qIENvbmZpZ3VyYXRpb24gcGFyYW1ldGVycyBmb3IgU3BhdGlhbCBNdWxpdHBsZXhpbmcgUG93ZXIgU2F2ZSAoU01QUykuICovCisKK3R5cGVkZWYgc3RydWN0IHNQbWNTbXBzQ29uZmlnUGFyYW1zCisKK3sKKworICAgIHRQbWNTbXBzTW9kZSBtb2RlOyAgLyogbW9kZSB0byB1c2UgKi8KKworICAgIHRBTklfQk9PTEVBTiBlbnRlck9uQWM7ICAvKiBGQUxTRSBpZiBkZXZpY2Ugc2hvdWxkIGVudGVyIFNNUFMgb25seSB3aGVuIGhvc3Qgb3BlcmF0aW5nIG9uCisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmF0dGVyeSBwb3dlciwgVFJVRSBpZiBkZXZpY2Ugc2hvdWxkIGVudGVyIGFsd2F5cyAqLworCit9IHRQbWNTbXBzQ29uZmlnUGFyYW1zLCAqdHBQbWNTbXBzQ29uZmlnUGFyYW1zOworCisKKy8qIFJvdXRpbmUgZGVmaW5pdGlvbnMuICovCitleHRlcm4gZUhhbFN0YXR1cyBwbWNPcGVuICh0SGFsSGFuZGxlIGhIYWwpOworCitleHRlcm4gZUhhbFN0YXR1cyBwbWNTd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NULCBJTkRJUkVDVCwgT1IgQ09OU0VRVUVOVElBTAorICogREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NIExPU1MgT0YgVVNFLCBEQVRBIE9SCisgKiBQUk9GSVRTLCBXSEVUSEVSIElOIEFOIEFDVElPTiBPRiBDT05UUkFDVCwgTkVHTElHRU5DRSBPUiBPVEhFUgorICogVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmICFkZWZpbmVkKCBfX1NNRUlOU0lERV9IICkKKyNkZWZpbmUgX19TTUVJTlNJREVfSAorCisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgCisgIFxmaWxlICBzbWVJbnNpZGUuaAorICAKKyAgXGJyaWVmIHByb3RvdHlwZSBmb3IgU01FIHN0cnVjdHVyZXMgYW5kIEFQSXMgdXNlZCBpbnNzaWRlIFNNRQorICAKKyAgCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qICRIZWFkZXIkICovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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gIHRBTklfVTggc2Vzc2lvbklkLAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHRTaXJNYWNBZGRyIHBlZXJNYWMsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY0FkZHIgcGVlck1hYywKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdENzclRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zICp0ZGxzTGlua0VzdGFibGlzaFBhcmFtcyk7CitlSGFsU3RhdHVzIGNzclRkbHNBZGRQZWVyU3RhKHRIYWxIYW5kbGUgaEhhbCwgdEFOSV9VOCBzZXNzaW9uSWQsCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0U2lyTWFjQWRkciBwZWVyTWFjCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjQWRkciBwZWVyTWFjCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKK2VIYWxTdGF0dXMgY3NyVGRsc0NoYW5nZVBlZXJTdGEodEhhbEhhbmRsZSBoSGFsLCB0QU5JX1U4IHNlc3Npb25JZCwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHRTaXJNYWNBZGRyIHBlZXJNYWMsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjQWRkciBwZWVyTWFjLAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI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mZkNoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9TMzIgdGRsc09mZkNoQndPZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IHRkbHNTd01vZGUpOworI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9URExTICovCisKKyNpZiAgZGVmaW5lZCAoV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIpIHx8IGRlZmluZWQgKEZFQVRVUkVfV0xBTl9FU0UpIHx8IGRlZmluZWQoRkVBVFVSRV9XTEFOX0xGUikKK2VIYWxTdGF0dXMgY3NyRmx1c2hDZmdCZ1NjYW5Sb2FtQ2hhbm5lbExpc3QodHBBbmlTaXJHbG9iYWwgcE1hYyk7CitlSGFsU3RhdHVzIGNzckNyZWF0ZUJnU2NhblJvYW1DaGFubmVsTGlzdCh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0QU5JX1U4ICpwQ2hhbm5lbExpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHRBTklfVTggbnVtQ2hhbm5lbHMpOworZUhhbFN0YXR1cyBjc3JVcGRhdGVCZ1NjYW5Db25maWdJbmlDaGFubmVsTGlzdCh0cEFuaVNpckdsb2JhbCBwTWFjLCBlQ3NyQmFuZCBlQmFuZCk7CisjZW5kaWYKKworI2lmIGRlZmluZWQoRkVBVFVSRV9XTEFOX0VTRSkgJiYgZGVmaW5lZChGRUFUVVJFX1dMQU5fRVNFX1VQTE9BRCkKK2VIYWxTdGF0dXMgY3NyQ3JlYXRlUm9hbVNjYW5DaGFubmVsTGlzdCh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcENoYW5uZWxMaXN0LAorICAgICAgICAgIC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Z2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKyNpZiAhZGVmaW5lZCggX19TTUVRT1NJTlRFUk5BTF9IICkKKyNkZWZpbmUgX19TTUVRT1NJTlRFUk5BTF9ICisKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAKKyAgXGZpbGUgIHNtZVFvc0ludGVybmFsLmgKKyAgCisgIFxicmllZiBwcm90b3R5cGUgZm9yIFNNRSBRb1MgQVBJcworICAKKyAgCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qICRIZWFkZXIkICovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgSW5jbHVkZSBGaWxlcworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworI2luY2x1ZGUgInZvc19sb2NrLmgiCisjaW5jbHVkZSAidm9zX3RyYWNlLmgiCisjaW5jbHVkZSAidm9zX21lbW9yeS5oIgorI2luY2x1ZGUgInZvc190eXBlcy5oIgorI2luY2x1ZGUgImFuaUdsb2JhbC5oIgorI2luY2x1ZGUgInNpckFwaS5oIgorI2luY2x1ZGUgInNtZV9Rb3NBcGkuaCIKKyNpbmNsdWRlICJzbWVJbnRlcm5hbC5oIgorCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tIAorICBUeXBlIGRlY2xhcmF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dBUkUuCisgKi8KKworLyoKKyAqIFRoaXMgZmlsZSB3YXMgb3JpZ2luYWxseSBkaXN0cmlidXRlZCBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKworI2lmICFkZWZpbmVkKCBfX1NNRVJSTUlOVEVSTkFMX0ggKQorI2RlZmluZSBfX1NNRVJSTUlOVEVSTkFMX0gKKworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIAorICBcZmlsZSAgc21lUnJtSW50ZXJuYWwuaAorICAKKyAgXGJyaWVmIHByb3RvdHlwZSBmb3IgU01FIFJSTSBBUElzCisgIAorICAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyogJEhlYWRlciQgKi8KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBJbmNsdWRlIEZpbGVzCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisjaW5jbHVkZSAidm9zX2xvY2suaCIKKyNpbmNsdWRlICJ2b3NfdHJhY2UuaCIKKyNpbmNsdWRlICJ2b3NfbWVtb3J5LmgiCisjaW5jbHVkZSAidm9zX3R5cGVzLmgiCisjaW5jbHVkZSAicGFsVGltZXIuaCIKKyNpbmNsdWRlICJycm1HbG9iYWwuaCIKKworLyotLS0tLS0tLS0tLS0tLS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USU9OIE9GIENPTlRSQUNULCBORUdMSUdFTkNFIE9SIE9USEVSCisgKiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SCisgKiBQRVJGT1JNQU5DRSBPRiBUSElTIFNPRlRXQVJFLgorICovCisKKy8qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisKKworCisjaWYgIWRlZmluZWQoIF9fU01FX0FQSV9IICkKKyNkZWZpbmUgX19TTUVfQVBJX0gKKworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIAorICBcZmlsZSAgc21lQXBpLmgKKyAgCisgIFxicmllZiBwcm90b3R5cGUgZm9yIFNNRSBBUElzCisgIAorICAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyogJEhlYWRlciQgKi8KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBJbmNsdWRlIEZpbGVzCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisjaW5jbHVkZSA8bGludXgvdmVyc2lvbi5oPgorI2luY2x1ZGUgImNjbUFwaS5oIgorI2luY2x1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GRhdGVfZW50aXJlX2NhY2hlIC0gaWYgVFJVRSwgdGhlbiBpdCBvdmVyd3JpdGVzIHRoZSBlbnRpcmUgY2FjaGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGggcFBNS0lEQ2FjaGUsIGVsc2UgaXQgdXBkYXRlcyBlbnRyeSBieQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW50cnkgd2l0aG91dCBkZWxldGluZyB0aGUgb2xkIGVudHJpZXMuCisgICAgXHJldHVybiBlSGFsU3RhdHVzIC0gd2hlbiBmYWlsLCBpdCB1c3VhbGx5IG1lYW5zIHRoZSBidWZmZXIgYWxsb2NhdGVkIGlzIG5vdCAKKyAgICAgICAgICAgICAgICAgICAgICAgICBiaWcgZW5vdWdoIGFuZCBwTnVtSXRlbXMgaGFzIHRoZSBudW1iZXIgb2YgCisgICAgICAgICAgICAgICAgICAgICAgICAgdFBta2lkQ2FjaGVJbmZvLgorICAgIFxOb3RlOiBwTnVtSXRlbXMgaXMgYSBudW1iZXIgb2YgdFBta2lkQ2FjaGVJbmZvLCAKKyAgICAgICAgICAgbm90IHNpemVvZih0UG1raWRDYWNoZUluZm8pICogc29tZXRoaW5nCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCitlSGFsU3RhdHVzIHNtZV9Sb2FtU2V0UE1LSURDYWNoZSggdEhhbEhhbmRsZSBoSGFsLCB0QU5JX1U4IHNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0UG1raWRDYWNoZUluZm8gKnBQTUtJRENhY2hlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG51bUl0ZW1zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfQk9PTEVBTiB1cGRhdGVfZW50aXJlX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AgICAgICAgIE5vdGUgMzogQm90aCBVQVBTRCBhbmQgV09XTCB3b3JrIG9uIHRvcCBvZiBCTVBTLiBPbiBlbnRyeSBpbnRvIEJNUFMsIFNNRQorICAgICAgICAgICAgd2lsbCBnaXZlIHByaW9yaXR5IHRvIFVBUFNEIGFuZCBlbmFibGUgb25seSBVQVBTRCBpZiBib3RoIFVBUFNEIGFuZCBXT1dMCisgICAgICAgICAgICBhcmUgcmVxdWlyZWQuIEN1cnJlbnRseSB0aGVyZSBpcyBubyByZXF1aXJlbWVudCBvciB1c2UgY2FzZSB0byBzdXBwb3J0IFVBUFNECisgICAgICAgICAgICBhbmQgV09XTCBhdCB0aGUgc2FtZSB0aW1lLgorICAgICAgICAgICAgTm90ZSA0LiBSZXF1ZXN0IGZvciBXb1dMIGlzIHJlamVjdGVkIGlmIHRoZXJlIGlzIGEgcGVuZGluZyBVQVBTRCByZXF1ZXN0LgorICAgICAgICAgICAgTm90ZSA1LiBSZXF1ZXN0IGZvciBXb1dMIGlzIHJlamVjdGVkIGlmIEJNUFMgaXMgZGlzYWJsZWQuCisgICAgICAgICAgICAKKyAgICBccGFyYW0gIGhIYWwgLSBUaGUgaGFuZGxlIHJldHVybmVkIGJ5IG1hY09wZW4uCisgICAgXHBhcmFtICBlbnRlcldvd2xDYWxsYmFja1JvdXRpbmUgLSAgQ2FsbGJhY2sgcm91dGluZSBwcm92aWRlZCBieSBIREQuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVXNlZCBmb3Igc3VjY2Vzcy9mYWlsdXJlIG5vdGlmaWNhdGlvbiBieSBTTUUKKyAgICBccGFyYW0gIGVudGVyV293bENhbGxiYWNrQ29udGV4dCAtIEEgY29va2llIHBhc3NlZCBieSBIREQsIHRoYXQgaXMgcGFzc2VkIGJhY2sgdG8gSERECisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdCB0aGUgdGltZSBvZiBjYWxsYmFjay4KKyAgICBccGFyYW0gIHdha2VSZWFzb25JbmRD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gIEZBSUxVUkUgb3IgUkVTT1VSQ0VTICBUaGUgQVBJIGZpbmlzaGVkIGFuZCBmYWlsZWQuCisKKyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCitlSGFsU3RhdHVzIHNtZV9DaGFuZ2VDb3VudHJ5Q29kZSggdEhhbEhhbmRsZSBoSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTbWVDaGFuZ2VDb3VudHJ5Q2FsbGJhY2sgY2FsbGJhY2ssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcENvdW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqcENvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogcFZvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFuaUJvb2wgY291bnRyeUZyb21Vc2VyU3BhY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFuaUJvb2wgc2VuZFJlZ0hpbnQpOworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAgIFxmbiBzbWVfR2VuZXJpY0NoYW5nZUNvdW50cnlDb2RlCisKKyAgICBcYnJpZWYgR2VuZXJpYyBBUEkgdG8gY2hhbmdlIGNvdW50cnkgY29kZQorCisgICAgXHBhcmFtIGhIYWwgLSBUaGUgaGFuZGxlIHJldHVybmVkIGJ5IG1hY09wZW4uCisKKyAgICBccGFyYW0gcENvdW50cnkgTmV3IENvdW50cnkgQ29kZSBTdHJpbmcKKworICAgIFxwYXJhbSByZWdfZG9tYWluIFJlZ3VsYXRvcnkgZG9tYWluIGZvciB0aGUgbmV3IGNvdW50cnkgY29kZQorCisgICAgXHJldHVybiBlSGFsU3RhdHVzICBTVUNDRVNTLgorCisgICAgICAgICAgICAgICAgICAgICAgICBGQUlMVVJFIG9yIFJFU09VUkNFUyAgVGhlIEFQSSBmaW5pc2hlZCBhbmQgZmFpbGVkLgorCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworZUhhbFN0YXR1cyBzbWVfR2VuZXJpY0NoYW5nZUNvdW50cnlDb2RlKCB0SGFsSGFuZGxlIGhIYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBDb3VudHJ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1JFR0RPTUFJTl90IHJlZ19kb21haW4pOworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAgIFxmbiBzbWVfREhDUFN0YXJ0SW5kCisKKyAgICBcYnJpZWYgSW5kaWNhdGUgRlcgYWJvdXQgREhDUCBzdGFydCBldmVudC4KKworICAgIFxwYXJhbSBoSGFsIC0gVGhlIGhhbmRsZSByZXR1cm5lZCBieSBtYWNPcGVuLgorCisgICAgXHBhcmFtIGRldmljZV9tb2RlIHRoZSBtb2RlIG9mIHRoZSBkZXZpY2UKKworICAgIFxwYXJhbSBzZXNzaW9uSWQgc2Vzc2lvbiBJRAorCisgICAgXHJldHVybiBlSGFsU3RhdHVzICBTVUNDRVNTLgorCisgICAgICAgICAgICAgICAgICAgICAgICAgRkFJTFVSRSBvciBSRVNPVVJDRVMgIFRoZSBBUEkgZmluaXNoZWQgYW5kIGZhaWxlZC4KKworICAtLS0t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0NhbGxlciBuZWVkcyB0byB2YWxpZGF0ZSB0aGUgaW5wdXQgdmFsdWVzCitWT1NfU1RBVFVTIHNtZV9EYmdXcml0ZU1lbW9yeSh0SGFsSGFuZGxlIGhIYWwsIHZfVTMyX3QgbWVtQWRkciwgdl9VOF90ICpwQnVmLCB2X1UzMl90IG5MZW4pOworCitWT1NfU1RBVFVTIHNtZV9HZXRXY25zc1dsYW5Db21waWxlZFZlcnNpb24odEhhbEhhbmRsZSBoSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJWZXJzaW9uVHlwZSAqcFZlcnNpb24pOworVk9TX1NUQVRVUyBzbWVfR2V0V2Nuc3NXbGFuUmVwb3J0ZWRWZXJzaW9uKHRIYWxIYW5kbGUgaEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyVmVyc2lvblR5cGUgKnBWZXJzaW9uKTsKK1ZPU19TVEFUVVMgc21lX0dldFdjbnNzU29mdHdhcmVWZXJzaW9uKHRIYWxIYW5kbGUgaEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBWZXJzaW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgdmVyc2lvbkJ1ZmZlclNpemUpOworVk9TX1NUQVRVUyBzbWVfR2V0V2Nuc3NIYXJkd2FyZVZlcnNpb24odEhhbEhhbmRsZSBoSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcFZlcnNpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiB2ZXJzaW9uQnVmZmVyU2l6ZSk7CitlSGFsU3RhdHVzIHNtZV9Sb2FtUmVnaXN0ZXJDYWxsYmFjayh0SGFsSGFuZGxlIGhIYWwsCisgICAgICAgICAgICAgICAgICAgICAgICA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wTnVtSXRlbXMKKyAgICBoYXMgdGhlIG51bWJlciBvZiB0QmtpZENhbmRpZGF0ZUluZm8uCisgICAgXE5vdGU6IHBOdW1JdGVtcyBpcyBhIG51bWJlciBvZiB0QmtpZENhbmRpZGF0ZUluZm8sIAorICAgICAgICAgICBub3Qgc2l6ZW9mKHRCa2lkQ2FuZGlkYXRlSW5mbykgKiBzb21ldGhpbmcKKyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KK2VIYWxTdGF0dXMgc21lX1NjYW5HZXRCS0lEQ2FuZGlkYXRlTGlzdCh0SGFsSGFuZGxlIGhIYWwsIHRBTklfVTMyIHNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QmtpZENhbmRpZGF0ZUluZm8gKnBCa2lkTGlzdCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBOdW1JdGVtcyApOworI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9XQVBJICovCisKKyNpZmRlZiBGRUFUVVJFX09FTV9EQVRBX1NVUFBPUlQKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICBPZW0gZGF0YSByZWxhdGVkIG1vZGlmaWNhdGlvbnMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgIFxmbiBzbWVfT2VtRGF0YVJ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lZXJTdGEodEhhbEhhbmRsZSBoSGFsLCB0QU5JX1U4IHNlc3Npb25JZCwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0U2lyTWFjQWRkciBwZWVyTWFjCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY0FkZHIgcGVlck1hYworI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApOworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgXGZuIHNtZV9EZWxldGVUZGxzUGVlclN0YQorICAgIFxicmllZiAgQVBJIHRvIERlbGV0ZSBURExTIHBlZXIgc3RhIGVudHJ5LgorICAgICAgICAgICAgCisgICAgXHBhcmFtICBwZWVyTWFjIC0gcGVlcidzIE1hYyBBZHJlc3MuCisgICAgXC0gcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTCisgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCitWT1NfU1RBVFVTIHNtZV9EZWxldGVUZGxzUGVlclN0YSh0SGFsSGFuZGxlIGhIYWwsIHRBTklfVTggc2Vzc2lvbklkLAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHRTaXJNYWNBZGRyIHBlZXJNYWMKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjQWRkciBwZWVyTWFjCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICA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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjQWRkciBwZWVyTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfUzMyIHRkbHNPZmZDaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1MzMiB0ZGxzT2ZmQ2hCd09mZnNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IHRkbHNTd01vZGUpOworZUhhbFN0YXR1cyBzbWVfR2V0RndTdGF0cyh0SGFsSGFuZGxlIGhIYWwsIHRBTklfVTMyIHN0YXRzLAorICAgICAgICAgICAgICAgICB2b2lkICpwQ29udGV4dCwgdFNpckZXU3RhdHNDYWxsYmFjayBjYWxsYmFjayk7Cit2b2lkIHNtZV9TZXRNaXJhY2FzdE1vZGUgKHRIYWxIYW5kbGUgaEhhbCx0QU5JX1U4IG1vZGUpOworCit2b2lkIHNtZV9yZXNldENvZXhFZXZlbnQodEhhbEhhbmRsZSBoSGFsKTsKKwordEFOSV9VMzIgc21lX0dldENoYW5uZWxCb25kaW5nTW9kZTVHKHRIYWxIYW5kbGUgaEhhbCk7Cit0QU5JX1UzMiBzbWVfR2V0Q2hhbm5lbEJvbmRpbmdNb2RlMjRHKHRIYWxIYW5kbGUgaEhhbCk7CisjaWZkZWYgV0xBTl9GRUFUVVJFX0FQX0hUNDBfMjRHCit2b2lkIHNtZV9VcGRhdGVDaGFubmVsQm9uZGluZ01vZGUyNEcodEhhbEhhbmRsZSBoSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGNiTW9kZSk7CitlSGFsU3RhdHVzIHNtZV9TZXRIVDIwNDBNb2RlKHRIYWxIYW5kbGUgaEhhbCwKKyAgICAgICAgICAgICAgICAgICB0QU5JX1U4IHNlc3Npb25JZCwgdEFOSV9VOCBjYk1vZGUpOworI2VuZGlmCisKK3ZvaWQgc21lX2R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OF90ICAgICAgICAgICAgICB0aWQ7ICAgICAgIC8qIFRJRCA6IFRvIGJlIGZpbGxlZCB1cCBieSBTTUUtUW9TICovCit9IHNtZV9Rb3NXbW1Uc0luZm9UeXBlOworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgIFRoZSBXTU0gVFNQRUMgRWxlbWVudCAoZnJvbSB0aGUgV01NIHNwZWMpCistLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwordHlwZWRlZiBzdHJ1Y3QKK3sgCisgIHNtZV9Rb3NXbW1Uc0luZm9UeXBlICAgICAgICAgICAgdHNfaW5mbzsKKyAgdl9VMTZfdCAgICAgICAgICAgICAgICAgICAgICAgICBub21pbmFsX21zZHVfc2l6ZTsKKyAgdl9VMTZfdCAgICAgICAgICAgICAgICAgICAgICAgICBtYXhpbXVtX21zZHVfc2l6ZTsKKyAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgICAgICBtaW5fc2VydmljZV9pbnRlcnZhbDsKKyAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgICAgICBtYXhfc2VydmljZV9pbnRlcnZhbDsKKyAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgICAgICBpbmFjdGl2aXR5X2ludGVydmFsOworICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgICAgIHN1c3BlbnNpb25faW50ZXJ2YWw7CisgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICAgICAgc3ZjX3N0YXJ0X3RpbWU7CisgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICAgICAgbWluX2RhdGFfcmF0ZTsKKyAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgICAgICBtZWFuX2RhdGFfcmF0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VkKCBfX1NNRVJSTUFQSV9IICkKKyNkZWZpbmUgX19TTUVSUk1BUElfSAorCisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgCisgIFxmaWxlICBzbWVfUnJtQXBpLmgKKyAgCisgIFxicmllZiBwcm90b3R5cGUgZm9yIFNNRSBSUk0gQVBJcworICAKKyAgCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qICRIZWFkZXIkICovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgSW5jbHVkZSBGaWxlcworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworI2luY2x1ZGUgInZvc19sb2NrLmgiCisjaW5jbHVkZSAidm9zX3RyYWNlLmgiCisjaW5jbHVkZSAidm9zX21lbW9yeS5oIgorI2luY2x1ZGUgInZvc190eXBlcy5oIgorI2luY2x1ZGUgImFuaUdsb2JhbC5oIgorI2luY2x1ZGUgInNpckFwaS5oIgorI2luY2x1ZGUgInNtZUludGVybmFsLmgiCisjaW5jbHVkZSAic21lUnJtSW50ZXJuYWwuaCIKKworCisvL0FQSXMKK2VIYWxTdGF0dXMgc21lX1JybU1zZ1Byb2Nlc3NvciggdHBBbmlTaXJHbG9iYWwgcE1hYywgIHZfVTE2X3QgbXNnX3R5cGUsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpwTXNnQnVmKTsKKworVk9TX1NUQVRVUyBycm1DbG9zZSAodHBBbmlTaXJHbG9iYWwgcE1hYyk7CitWT1NfU1RBVFVTI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Q0UgT1IgT1RIRVIKKyAqIFRPUlRJT1VTIEFDVElPTiwgQVJJU0lORyBPVVQgT0YgT1IgSU4gQ09OTkVDVElPTiBXSVRIIFRIRSBVU0UgT1IKKyAqIFBFUkZPUk1BTkNFIE9GIFRISVMgU09GVFdBUkUuCisgKi8KKworLyoKKyAqIFRoaXMgZmlsZSB3YXMgb3JpZ2luYWxseSBkaXN0cmlidXRlZCBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgc21lX1RyYWNlLmgKKworICBcYnJpZWYgZGVmaW5pdGlvbiBmb3IgdHJhY2UgcmVsYXRlZCBBUElzCisKKyAgXGF1dGhvciBLaXJhbiBLdW1hciBSZWRkeSBDSCBMIFYKKworICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisjaWZuZGVmIF9fU01FX1RSQUNFX0hfXworI2RlZmluZSBfX1NNRV9UUkFDRV9IX18KKworCisjaW5jbHVkZSAibWFjVHJhY2UuaCIKKworI2RlZmluZSBOT19TRVNTSU9OIDB4RkYKK2VudW0geworICAgICBUUkFDRV9DT0RFX1NNRV9DT01NQU5ELAorICAgICBUUkFDRV9DT0RFX1NNRV9UWF9XREFfTVNHLAorICAgICBUUkFDRV9DT0RFX1NNRV9SWF9XREFfTVNHLAorfTsKK2VudW0geworICAgIC8qIFN0YXJ0cyBlbnVtcyBmcm9tIDMgb253YXJkcywgYmVjYXVzZSB1bmtub3duIGNvZGUgY2FwdHVyZXMgZm9yIGZpcnN0CisgICAgICogdGhy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IGhvbGQgaW5mb3JtYXRpb24gcGVyIAorICBmbG93L3JlcXVlc3QsIGxpa2UgVFNQRUMgcGFyYW1zIHJlcXVlc3RlZCwgd2hpY2ggQUMgaXQgaXMgcnVubmluZyBvbiAKKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCit0eXBlZGVmIHN0cnVjdCBzbWVfUW9zRmxvd0luZm9FbnRyeV9zCit7CisgICAgdExpc3RFbGVtICAgICAgICAgICAgIGxpbms7ICAvKiBsaXN0IGxpbmtzICovCisgICAgdl9VOF90ICAgICAgICAgICAgICAgIHNlc3Npb25JZDsKKyAgICB2X1U4X3QgICAgICAgICAgICAgICAgdHNwZWNfbWFzazsKKyAgICBzbWVfUW9zUmVhc29uVHlwZSAgICAgcmVhc29uOworICAgIHZfVTMyX3QgICAgICAgICAgICAgICBRb3NGbG93SUQ7CisgICAgc21lX1Fvc0VkY2FBY1R5cGUgICAgIGFjX3R5cGU7CisgICAgc21lX1Fvc1dtbVRzcGVjSW5mbyAgIFFvU0luZm87CisgICAgdm9pZCAgICAgICAgICAgICAgICAqIEhERGNvbnRleHQ7CisgICAgc21lX1Fvc0NhbGxiYWNrICAgICAgIFFvU0NhbGxiYWNrOworICAgIHZfQk9PTF90ICAgICAgICAgICAgICBob1JlbmV3YWw7Ly9zZXQgdG8gVFJVRSB3aGlsZSByZS1uZWdvdGlhdGluZyBmbG93cyBhZnRlcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vaGFuZG9mZiwgd2lsbCBzZXQgdG8gRkFMU0Ugb25jZSBkb25lIHdpdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3RoZSBwcm9jZXNzLiBIZWxwcyBTTUUgdG8gZGVjaWRlIGlmIGF0IGFsbCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tIAorICAgICAgICAgICAgICAgICAgICAgICAgIEludGVybmFsIGZ1bmN0aW9uIGRlY2xhcmF0aW9ucworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworc21lX1Fvc1N0YXR1c1R5cGUgc21lX1Fvc0ludGVybmFsU2V0dXBSZXEodHBBbmlTaXJHbG9iYWwgcE1hYywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3Qgc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21lX1Fvc1dtbVRzcGVjSW5mbyAqIHBRb1NJbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21lX1Fvc0NhbGxiYWNrIFFvU0NhbGxiYWNrLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKiBIRERjb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21lX1Fvc1dtbVVwVHlwZSBVUFR5cGUsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBRb3NGbG93SUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X0JPT0xfdCBidWZmZXJlZF9jbWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X0JPT0xfdCBob1JlbmV3YWwpOworc21lX1Fvc1N0YXR1c1R5cGUgc21lX1Fvc0ludGVybmFsTW9kaWZ5UmVxKHRwQW5pU2lyR2xvYmFsIHBNYWMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtZV9Rb3NXbW1Uc3BlY0luZm8gKiBwUW9TSW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IFFvc0Zsb3dJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X0JPT0xfdCBidWZmZXJlZF9jbWQpOworc21lX1Fvc1N0YXR1c1R5cGUgc21lX1Fvc0ludGVybmFsUmVsZWFzZVJlcSh0cEFuaVNpckdsb2JhbCBwTWFjLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBRb3NGbG93SUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfQk9PTF90IGJ1ZmZlcmVkX2NtZCk7CitzbWVfUW9zU3RhdHVzVHlwZSBzbWVfUW9zU2V0dXAodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3Qgc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtZV9Rb3NXbW1Uc3BlY0luZm8gKnBUc3BlY19JbmZvLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbWVfUW9zRWRjYUFjVHlwZSBhYyk7CitlSGFsU3RhdHVzIHNtZV9Rb3NBZGRUc1JlcSh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90IHNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtZV9Rb3NXbW1Uc3BlY0luZm8gKiBwVHNwZWNfSW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtZV9Rb3NFZGNhQWNUeXBlIGFjKTsKK2VIYWxTdGF0dXMgc21lX1Fvc0RlbFRzUmVxKHRwQW5pU2lyR2xvYmFsIHBNYWMsC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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21lX1Fvc1dtbVRzcGVjSW5mbyAqIHBRb1NJbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbWVfUW9zRWRjYUFjVHlwZSBhYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90IHRzcGVjTWFzayk7CitzdGF0aWMgdm9pZCBzbWVfUW9zSW5pdEFDcyh0cEFuaVNpckdsb2JhbCBwTWFjLCB2X1U4X3Qgc2Vzc2lvbklkKTsKK3N0YXRpYyBlSGFsU3RhdHVzIHNtZV9Rb3NSZXF1ZXN0UmVhc3NvYyh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4IHNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Q3NyUm9hbU1vZGlmeVByb2ZpbGVGaWVsZHMgKnBNb2RGaWVsZHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9CT09MX3QgZkZvcmNlICk7CitzdGF0aWMgdl9VMzJfdCBzbWVfUW9zQXNzaWduRmxvd0lkKHZvaWQpOworc3RhdGljIHZfVThfdCBzbWVfUW9zQXNzaWduRGlhbG9nVG9rZW4odm9pZCk7CitzdGF0aWMgZUhhbFN0YXR1cyBzbWVfUW9zVXBkYXRlVHNwZWNNYXNrKHZfVThfdCBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtZV9Rb3NTZWFyY2hJbmZvIHNlYXJjaF9rZXksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCBuZXdfdHNwZWNfbWFzayk7CisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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IF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCk7CisgICAgICAgICBzdGF0dXMgPSBTTUVfUU9TX1NUQVRVU19TRVRVUF9GQUlMVVJFX1JTUDsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgIC8vQXNzaWduIGEgRmxvdyBJRAorICAgICAgICAgKnBRb3NGbG93SUQgPSBzbWVfUW9zQXNzaWduRmxvd0lkKCk7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsIAorICAgICAgICAgICAgICAgICAgICIlczogJWQ6IFFvUyByZXF1ZXN0IG9uIHNlc3Npb24gJWQgYXNzaWduZWQgRmxvdyBJRCAlZCIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCwgKnBRb3NGbG93SUQpOworICAgICAgICAgLy9DYWxsIHRoZSBpbnRlcm5hbCBmdW5jdGlvbiBmb3IgUW9TIHNldHVwLAorICAgICAgICAgLy8gYWRkaW5nIGEgbGF5ZXIgb2YgYWJzdHJhY3Rpb24KKyAgICAgICAgIHN0YXR1cyA9IHNtZV9Rb3NJbnRlcm5hbFNldHVwUmVxKHBNYWMsICh2X1U4X3Qpc2Vzc2lvbklkLCBwUW9TSW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFFvU0NhbGxiYWNrLCBIRERjb250ZXh0LCBVUFR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqcFFvc0Zsb3dJRCwgVk9TX0ZBTFNFLCBWT1NfRkFMU0UpOworICAgICAgfQorICAgfQorICAgc21lX1JlbGVhc2VHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UU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gICAgaWYoIHBFbnRyeSApCisgICAgICAgICB7CisgICAgICAgICAgICAgcENvbW1hbmQgPSBHRVRfQkFTRV9BRERSKHBFbnRyeSwgdFNtZUNtZCwgTGluayk7CisgICAgICAgICAgICAgaWYoIGVTbWVDb21tYW5kQWRkVHMgPT0gcENvbW1hbmQtPmNvbW1hbmQgKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBzbWVfUW9zUHJvY2Vzc0FkZFRzUnNwKHBNYWMsIHBNc2dCdWYpOworICAgICAgICAgICAgICAgIGlmKCBjc3JMTFJlbW92ZUVudHJ5KCAmcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QsIHBFbnRyeSwgTExfQUNDRVNTX0xPQ0sgKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIHFvc1JlbGVhc2VDb21tYW5kKCBwTWFjLCBwQ29tbWFuZCApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzbWVQcm9jZXNzUGVuZGluZ1F1ZXVlKCBwTWFjICk7CisgICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIGVXTklfU01FX0RFTFRTX1JTUDoKKyAgICAgICAgIHBFbnRyeSA9IGNzckxMUGVla0hlYWQoJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0LCBMTF9BQ0NFU1NfTE9DSyk7CisgICAgICAgICBpZiggcEVudHJ5ICkKKyAgICAgICAgIHsKKyAgICAgICAgICAgICBwQ29tbWFuZCA9IEdFVF9CQVNFX0FERFIocEVudHJ5LCB0U21lQ21kLCBMaW5rKTsKKyAgICAgICAgICAgICBpZiggZVNtZUNvbW1hbmREZWxUcyA9PSBwQ29tbWFuZC0+Y29tbWFuZCApCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0YXR1cyA9IHNtZV9Rb3NQcm9jZXNzRGVsVHNSc3AocE1hYywgcE1zZ0J1Zik7CisgICAgICAgICAgICAgICAgaWYoIGNzckxMUmVtb3ZlRW50cnkoICZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTE9DSyApICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgcW9zUmVsZWFzZUNvbW1hbmQoIHBNYWMsIHBDb21tYW5kICk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNtZVByb2Nlc3NQZW5kaW5nUXVldWUoIHBNYWMgKTsKKyAgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgZVdOSV9TTUVfREVMVFNfSU5EOgorICAgICAgICAgc3RhdHVzID0gc21lX1Fvc1Byb2Nlc3NEZWxUc0luZChwTWFjLCBwTXNnQnVmKTsKKyAgICAgICAgIGJyZWFrOworI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCisgICAgICBjYXNlIGVXTklfU01FX0ZUX0FHR1JfUU9TX1JTUDoKKyAgICAgICAgIHN0YXR1cyA9IHNtZV9Rb3NQcm9jZXNzQWdnclFvc1JzcChwTWFjLCBwTXNnQnVmKTsKKyAgICAgICAgIGJyZWFrOworI2VuZGlmCisKKyAgICAgIGRlZmF1bHQ6CisgICAgICAgICAvL2VyciBtc2cKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiB1bmtub3duIG1zZyB0eXBlID0gJWQiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywgbXNnX3R5cGUpOworICAgICAgICAgYnJlYWs7CisgICB9CisgICByZXR1cm4gc3RhdHVzOworfQorLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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RQVAgJiBBUFNEIiwKKyAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18pOworICAgZG8KKyAgIHsKKyAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1MoY3NyR2V0UGFyc2VkQnNzRGVzY3JpcHRpb25JRXMocE1hYywgcEJzc0Rlc2MsICZwSWVzKSkpCisgICAgICB7CisgICAgICAgICAvL2VyciBtc2cKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBjc3JHZXRQYXJzZWRCc3NEZXNjcmlwdGlvbklFcygpIGZhaWxlZCIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgLy9jaGVjayBpZiB0aGUgQVAgaXMgUUFQICYgaXQgc3VwcG9ydHMgQVBTRAorICAgICAgaWYoICFDU1JfSVNfUU9TX0JTUyhwSWVzKSApCisgICAgICB7CisgICAgICAgICAvL2VyciBtc2cKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBBUCBkb2Vzbid0IHN1cHBvcnQgUW9TIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18pOworICAgICAgICAgCisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGlmKCEocEllcy0+V01NUGFyYW1zLnFvc0luZm8gJiBTTUVfUU9TX0FQX1NVUFBPUlRTX0FQU0QpICYmCisgICAgICAgICAhKHBJZXMtPldNTUluZm9BcC51YXBzZCkpCisgICAgICB7CisgICAgICAgICAvL2VyciBtc2cKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX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0VTRSkgfHwgZGVmaW5lZChGRUFUVVJFX1dMQU5fTEZSKQorICAgICAgY2FzZSBTTUVfUU9TX0NTUl9TRVRfS0VZX1NVQ0NFU1NfSU5EOgorICAgICAgICAgc3RhdHVzID0gc21lX1Fvc1Byb2Nlc3NTZXRLZXlTdWNjZXNzSW5kKHBNYWMsIHNlc3Npb25JZCwgcEV2ZW50X2luZm8pOworICAgICAgICAgYnJlYWs7CisjZW5kaWYKKyNlbmRpZgorICAgICAgZGVmYXVsdDoKKyAgICAgICAgIC8vRXJyIG1zZworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICIlczogJWQ6IE9uIFNlc3Npb24gJWQgVW5rbm93biBFdmVudCAlZCByZWNlaXZlZCBmcm9tIENTUiIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCwgaW5kICk7CisgICAgICAgICBicmVhazsKKyAgIH0KKyAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgCisgICAgICAgICAgICAgIiVzOiAlZDogT24gU2Vzc2lvbiAlZCBwcm9jZXNzZWQgRXZlbnQgJWQgd2l0aCBzdGF0dXMgJWQiLAorICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICBzZXNzaW9uSWQsIGluZCwgc3RhdHVzICk7CisgICByZXR1cm4gc3RhdHVzOworfQorLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBcYnJpZWYgc21lX1Fvc0dldEFDTU1hc2soKSAtIFRoZSBRb1Mgc3ViLW1vZHVsZSBBUEkgdG8gZmluZCBv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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21lX1Fvc1dtbVRzcGVjSW5mbyAqIHBRb1NJbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21lX1Fvc0NhbGxiYWNrIFFvU0NhbGxiYWNrLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKiBIRERjb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21lX1Fvc1dtbVVwVHlwZSBVUFR5cGUsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBRb3NGbG93SUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X0JPT0xfdCBidWZmZXJlZF9jbWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X0JPT0xfdCBob1JlbmV3YWwpCit7CisgICBzbWVfUW9zU2Vzc2lvbkluZm8gKnBTZXNzaW9uOworICAgc21lX1Fvc0FDSW5mbyAqcEFDSW5mbzsKKyAgIHNtZV9Rb3NFZGNhQWNUeXBlIGFjOworICAgc21lX1Fvc1dtbVRzcGVjSW5mbyBUc3BlY19JbmZvOworICAgc21lX1Fvc1N0YXRlcyBuZXdfc3RhdGUgPSBTTUVfUU9TX0NMT1NFRDsKKyAgIHNtZV9Rb3NGbG93SW5mb0VudHJ5ICpwZW50cnkgPSBOVUxMOworICAgc21lX1Fvc0NtZEluZm8gIGNtZDsKKyAgIHNtZV9Rb3NTdGF0dXNUeXBlIHN0YXR1cyA9IFNNRV9RT1NfU1RBVFVTX1NFVFVQX0ZBSUxVUkVfUlNQOworICAgdl9VOF90IHRtYXNrID0gMDsKKyAgIHZfVThfdCBuZXdfdG1hc2sgPSAwOworICAgc21lX1Fvc1NlYXJjaEluZm8gc2VhcmNoX2tleTsKKyAgIHZfQk9PTF90IGJ1ZmZlckNvbW1hbmQ7CisgICBlSGFsU3RhdHVzIGhzdGF0dXM7CisgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsIAorICAgICAgICAgICAgICIlczogJWQ6IGludm9rZWQgb24gc2Vzc2lvbiAlZCBmb3IgZmxvdyAlZCIsCisgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgIHNlc3Npb25JZCwgUW9zRmxvd0lEKTsKKyAgIHBTZXNzaW9uID0gJnNtZV9Rb3NDYi5zZXNzaW9uSW5mb1tzZXNzaW9uSWRdOworICAgLy8gaWYgY2FsbGVyIHNlbnQgYW4gZW1wdHkgVFNQRUMsIGZpbGwgdXAgd2l0aCB0aGUgZGVmYXVsdCBvbmUKKyAgIGlmKCFwUW9TSW5mbykKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sIAorICAgICAgICAgICAgICAgICIlczogJWQ6IGNhbGxlciBzZW50IGFuIGVtcHR5IFFvUyBwYXJhbSBsaXN0LCB1c2luZyBkZWZhdWx0cyIsCisgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fKTsKKyAgICAgIC8vIGZpbmQgdGhlIEFDIHdpdGggVVBUeXBlIHBhc3NlZCBpbgorICAgICAgYWMgPSBzbWVfUW9zVXBUb0FjKFVQVHlwZSk7CisgICAgICBpZihTTUVfUU9TX0VEQ0FfQUNfTUFYID09IGFjKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICIlczogJWQ6IGludmFsaWQgQUMgJWQgZnJvbSBVUCAlZCIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgIGFjLCBVUFR5cGUpOworICAgICAgICAgCisgICAgICAgICByZXR1cm4gU01FX1FPU19TVEFUVVNfU0VUVVBfSU5WQUxJRF9QQVJBTVNfUlNQOworICAgICAgfQorICAgICAgVHNwZWNfSW5mbyA9IHNtZV9Rb3NDYi5kZWZfUW9TSW5mb1thY107CisgICB9CisgICBlbHNlCisgICB7CisgICAgICAvLyBmaW5kIHRoZSBBQworICAgICAgYWMgPSBzbWVfUW9zVXBUb0FjKHBRb1NJbmZvLT50c19pbmZvLnVwKTsKKyAgICAgIGlmKFNNRV9RT1NfRURDQV9BQ19NQVggPT0gYWMpCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogaW52YWxpZCBBQyAlZCBmcm9tIFVQICVkIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgICAgYWMsIHBRb1NJbmZvLT50c19pbmZvLnVwKTsKKyAgICAgICAgIAorICAgICAgICAgcmV0dXJuIFNNRV9RT1NfU1RBVFVTX1NFVFVQX0lOVkFMSURfUEFSQU1TX1JTUDsKKyAgICAgIH0KKyAgICAgIC8vdmFsaWRhdGUgUW9TIHBhcmFtcworICAgICAgaWYoIXNtZV9Rb3NWYWxpZGF0ZVJlcXVlc3RlZFBhcmFtcyhwTWFjLCBwUW9TSW5mbywgc2Vzc2lvbklkKSkKKyAgICAgIHsKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBpbnZhbGlkIHBhcmFtcyIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fKTsKKyAgICAgICAgIHJldHVybiBTTUVfUU9TX1NUQVRVU19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W5kID0gVk9TX1RSVUU7CisgICAgICB9CisgICB9CisgICBpZiAoYnVmZmVyQ29tbWFuZCkKKyAgIHsKKyAgICAgIC8vIHdlIG5lZWQgdG8gYnVmZmVyIHRoZSBjb21tYW5kCisgICAgICBjbWQuY29tbWFuZCA9IFNNRV9RT1NfU0VUVVBfUkVROworICAgICAgY21kLnBNYWMgPSBwTWFjOworICAgICAgY21kLnNlc3Npb25JZCA9IHNlc3Npb25JZDsKKyAgICAgIGNtZC51LnNldHVwQ21kSW5mby5IRERjb250ZXh0ID0gSEREY29udGV4dDsKKyAgICAgIGNtZC51LnNldHVwQ21kSW5mby5Rb1NJbmZvID0gVHNwZWNfSW5mbzsKKyAgICAgIGNtZC51LnNldHVwQ21kSW5mby5Rb1NDYWxsYmFjayA9IFFvU0NhbGxiYWNrOworICAgICAgY21kLnUuc2V0dXBDbWRJbmZvLlVQVHlwZSA9IFVQVHlwZTsKKyAgICAgIGNtZC51LnNldHVwQ21kSW5mby5ob1JlbmV3YWwgPSBob1JlbmV3YWw7CisgICAgICBjbWQudS5zZXR1cENtZEluZm8uUW9zRmxvd0lEID0gUW9zRmxvd0lEOworICAgICAgaHN0YXR1cyA9IHNtZV9Rb3NCdWZmZXJDbWQoJmNtZCwgYnVmZmVyZWRfY21kKTsKKyAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1MoaHN0YXR1cykpCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogY291bGRuJ3QgYnVmZmVyIHRoZSBzZXR1cCByZXF1ZXN0IGluIHN0YXRlID0gJWQiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICBwQUNJbmZvLT5jdXJyX3N0YXRlICk7CisgICAgICAgICAvLyB1bmFibGUgdG8gYnVmZmV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ElHSCwgCisgICAgICAgICAgICAgICAgIiVzOiAlZDogT24gc2Vzc2lvbiAlZCB3aXRoIEFDICVkIGluIHN0YXRlIFNNRV9RT1NfTElOS19VUCAiCisgICAgICAgICAgICAgICAgInNtZV9Rb3NTZXR1cCByZXR1cm5lZCB3aXRoIHN0YXR1cyAlZCIsCisgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgIHNlc3Npb25JZCwgYWMsIHN0YXR1cyk7CisgICAgICBpZihTTUVfUU9TX1NUQVRVU19TRVRVUF9SRVFfUEVORElOR19SU1AgIT0gc3RhdHVzKQorICAgICAgeworICAgICAgICAgLy8gd2UgYXJlbid0IHdhaXRpbmcgZm9yIGEgcmVzcG9uc2UgZnJvbSB0aGUgQVAKKyAgICAgICAgIC8vIHNvIHZvdGUgcG93ZXJzYXZlIGJhY2sgb24KKyAgICAgICAgIHBTZXNzaW9uLT5yZWFkeUZvclBvd2VyU2F2ZSA9IFZPU19UUlVFOworICAgICAgfQorICAgICAgaWYoKFNNRV9RT1NfU1RBVFVTX1NFVFVQX1JFUV9QRU5ESU5HX1JTUCA9PSBzdGF0dXMpfHwKKyAgICAgICAgIChTTUVfUU9TX1NUQVRVU19TRVRVUF9TVUNDRVNTX05PX0FDTV9OT19BUFNEX1JTUCA9PSBzdGF0dXMpIHx8CisgICAgICAgICAoU01FX1FPU19TVEFUVVNfU0VUVVBfU1VDQ0VTU19BUFNEX1NFVF9BTFJFQURZID09IHN0YXR1cykpCisgICAgICB7CisgICAgICAgICAvLyB3ZSByZWNlaXZlZCBhbiBleHBlY3RlZCAiZ29vZCIgc3RhdHVzCisgICAgICAgICAvL2NyZWF0ZSBhbiBlbnRyeSBpbiB0aGUgZmxvdyBsaXN0CisgICAgICAgICBwZW50cnkgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YoKnBlbnRyeSkpOworICAgICAgICAgaWYgKCFwZW50cnkpCisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBjb3VsZG4ndCBhbGxvY2F0ZSBtZW1vcnkgZm9yIHRoZSBuZXcgIgorICAgICAgICAgICAgICAgICAgICAgICJlbnRyeSBpbiB0aGUgRmxvdyBMaXN0IiwKKyAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18pOworICAgICAgICAgICAgcmV0dXJuIFNNRV9RT1NfU1RBVFVTX1NFVFVQX0ZBSUxVUkVfUlNQOworICAgICAgICAgfQorICAgICAgICAgcGVudHJ5LT5hY190eXBlID0gYWM7CisgICAgICAgICBwZW50cnktPkhERGNvbnRleHQgPSBIRERjb250ZXh0OworICAgICAgICAgcGVudHJ5LT5Rb1NDYWxsYmFjayA9IFFvU0NhbGxiYWNrOworICAgICAgICAgcGVudHJ5LT5ob1JlbmV3YWwgPSBob1JlbmV3YWw7CisgICAgICAgICBwZW50cnktPlFvc0Zsb3dJRCA9IFFvc0Zsb3dJRDsKKyAgICAgICAgIHBlbnRyeS0+c2Vzc2lvbklkID0gc2Vzc2lvbklkOworICAgICAgICAgLy8gc2luY2Ugd2UgYXJlIGluIHN0YXRlIFNNRV9RT1NfTElOS19VUCB0aGlzIG11c3QgYmUgdGhlCisgICAgICAgICAvLyBmaXJzdCBUU1BFQyBvbiB0aGlzIEFDLCBzbyB1c2UgaW5kZXggMCAobWFzayBiaXQgMSkKKyAgICAgICAgIHBBQ0luZm8tPnJlcXVlc3RlZF9Rb1NJbmZvW1NNRV9RT1NfVFNQRUNfSU5ERVhfMF0gPSBUc3BlY19JbmZvOworICAgICAgICAgaWYoU01FX1FPU19TVEFUVVNfU0VUVVBfUkVRX1BFTkRJTkdfUlNQID09IHN0YXR1cykKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGlmKHBBQ0luZm8tPnRzcGVjX21hc2tfc3RhdHVzICYmCisgICAgICAgICAgICAgICAhcEFDSW5mby0+cmVhc3NvY19wZW5kaW5nKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IE9uIHNlc3Npb24gJWQgd2l0aCBBQyAlZCBpbiBzdGF0ZSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlNNRV9RT1NfTElOS19VUCB0c3BlY19tYXNrX3N0YXR1cyBpcyAlZCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgImJ1dCBzaG91bGQgbm90IGJlIHNldCB5ZXQiLAorICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uSWQsIGFjLCBwQUNJbmZvLT50c3BlY19tYXNrX3N0YXR1cyk7CisgICAgICAgICAgICAgICAvL0FTU0VSVAorICAgICAgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwZW50cnkpOworICAgICAgICAgICAgICAgcmV0dXJuIFNNRV9RT1NfU1RBVFVTX1NFVFVQX0ZBSUxVUkVfUlNQOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcEFDSW5mby0+dHNwZWNfbWFza19zdGF0dXMgPSBTTUVfUU9TX1RTUEVDX01BU0tfQklUXzFfU0VUOworICAgICAgICAgICAgaWYoIXBBQ0luZm8tPnJlYXNzb2NfcGVuZGluZykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8vIHdlIGRpZG4ndCByZXF1ZXN0IGZvciByZWFzc29jLCBpdCBtdXN0IGJlIGEgdHNwZWMgbmVnb3RpYXRpb24KKyAgICAgICAgICAgICAgIHBBQ0luZm8tPnRzcGVjX3BlbmRpbmcgPSAxOworICAgICAgICAgICAgfQorICAgICAgICAgICAgIAorICAgICAgICAgICAgcGVudHJ5LT5yZWFzb24gPSBTTUVfUU9TX1JFQVNPTl9TRVRVUDsKKyAgICAgICAgICAgIG5ld19zdGF0ZSA9IFNNRV9RT1NfUkVRVUVTVEVEOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgLy8gU01FX1FPU19TVEFUVVNfU0VUVVBfU1VDQ0VTU19OT19BQ01fTk9fQVBTRF9SU1Agb3IKKyAgICAgICAgICAgIC8vIFNNRV9RT1NfU1RBVFVTX1NFVFVQX1NVQ0NFU1NfQVBTRF9TRVRfQUxSRUFEWQorICAgICAgICAgICAgcGVudHJ5LT5yZWFzb24gPSBTTUVfUU9TX1JFQVNPTl9SRVFfU1VDQ0VTUzsKKyAgICAgICAgICAgIG5ld19zdGF0ZSA9IFNNRV9RT1NfUU9TX09OOworICAgICAgICAgICAgcEFDSW5mby0+dHNwZWNfbWFza19zdGF0dXMgPSBTTUVfUU9TX1RTUEVDX01BU0tfQklUXzFfU0VUOworICAgICAgICAgICAgcEFDSW5mby0+Y3Vycl9Rb1NJbmZvW1NNRV9RT1NfVFNQRUNfSU5ERVhfMF0gPSBUc3BlY19JbmZvOworICAgICAgICAgICAgaWYoYnVmZmVyZWRfY21kICYmICFwZW50cnktPmhvUmVuZXdhbCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFFvU0NhbGxiYWNrKHBNYWMsIEhERGNvbnRleHQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBQ0luZm8tPmN1cnJfUW9TSW5mb1tTTUVfUU9TX1RTUEVDX0lOREVYXzBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVudHJ5LT5Rb3NGbG93SUQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcGVudHJ5LT5ob1JlbmV3YWwgPSBWT1NfRkFMU0U7CisgICAgICAgICB9CisgICAgICAgICBwQUNJbmZvLT5udW1fZmxvd3NbU01FX1FPU19UU1BFQ19JTkRFWF8wXSsrOworCisgICAgICAgICAvL2luZGljYXRlIG9uIHdoaWNoIGluZGV4IHRoZSBmbG93IGVudHJ5IGJlbG9uZ3MgdG8gJiBhZGQgaXQgdG8gdGhlIAorICAgICAgICAgLy9GbG93IExpc3QgYXQgdGhlIGVuZAorICAgICAgICAgcGVudHJ5LT50c3BlY19tYXNrID0gcEFDSW5mby0+dHNwZWNfbWFza19zdGF0dXM7CisgICAgICAgICBwZW50cnktPlFvU0luZm8gPSBUc3BlY19JbmZvOworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAKKyAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBDcmVhdGluZyBlbnRyeSBvbiBzZXNzaW9uICVkIGF0ICVwIHdpdGggZmxvd0lEICVkIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkLCBwZW50cnksIFFvc0Zsb3dJRCk7CisgICAgICAgICBjc3JMTEluc2VydFRhaWwoJnNtZV9Rb3NDYi5mbG93X2xpc3QsICZwZW50cnktPmxpbmssIFZPU19UUlVFKTsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgIC8vIHVuZXhwZWN0ZWQgc3RhdHVzIHJldHVybmVkIGJ5IHNtZV9Rb3NTZXR1cCgpCisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogT24gc2Vzc2lvbiAlZCB1bmV4cGVjdGVkIHN0YXR1cyAlZCAiCisgICAgICAgICAgICAgICAgICAgInJldHVybmVkIGJ5IHNtZV9Rb3NTZXR1cCIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCwgc3RhdHVzKTsKKyAgICAgICAgIG5ld19zdGF0ZSA9IHBBQ0luZm8tPmN1cnJfc3RhdGU7CisgICAgICAgICBpZihidWZmZXJlZF9jbWQgJiYgaG9SZW5ld2FsKQorICAgICAgICAgeworICAgICAgICAgICAgUW9TQ2FsbGJhY2socE1hYywgSEREY29udGV4dCwgCisgICAgICAgICAgICAgICAgICAgICAgICAmcEFDSW5mby0+Y3Vycl9Rb1NJbmZvW1NNRV9RT1NfVFNQRUNfSU5ERVhfMF0sCisgICAgICAgICAgICAgICAgICAgICAgICBTTUVfUU9TX1NUQVRVU19SRUxFQVNFX1FPU19MT1NUX0lORCwKKyAgICAgICAgICAgICAgICAgICAgICAgIFFvc0Zsb3dJRCk7CisgICAgICAgICB9CisgICAgICB9CisgICAgICBicmVhazsKKyAgIGNhc2UgU01FX1FPU19IQU5ET0ZGOgorICAgY2FzZSBTTUVfUU9TX1JFUVVFU1RFRDoKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fTUVELCAKKyAgICAgICAgICAgICAgICAiJXM6ICVkOiBCdWZmZXJpbmcgc2V0dXAgcmVxdWVzdCBmb3IgZmxvdyAlZCBpbiBzdGF0ZSA9ICVkIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgUW9zRmxvd0lELCBwQUNJbmZvLT5jdXJyX3N0YXRlICk7CisgICAgICAvL2J1ZmZlciBjbWQKKyAgICAgIGNtZC5jb21tYW5kID0gU01FX1FPU19TRVRVUF9SRVE7CisgICAgICBjbWQucE1hYyA9IHBNYWM7CisgICAgICBjbWQuc2Vzc2lvbklkID0gc2Vzc2lvbklkOworICAgICAgY21kLnUuc2V0dXBDbWRJbmZvLkhERGNvbnRleHQgPSBIRERjb250ZXh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VUkVfUlNQOworICAgICAgfQorICAgICAgc3RhdHVzID0gU01FX1FPU19TVEFUVVNfU0VUVVBfUkVRX1BFTkRJTkdfUlNQOworICAgICAgbmV3X3N0YXRlID0gcEFDSW5mby0+Y3Vycl9zdGF0ZTsKKyAgICAgIGJyZWFrOworICAgY2FzZSBTTUVfUU9TX1FPU19PTjoKKyAgICAgIAorICAgICAgLy9jaGVjayBpZiBtdWx0aXBsZSBmbG93cyBydW5uaW5nIG9uIHRoZSBhYworICAgICAgaWYoKHBBQ0luZm8tPm51bV9mbG93c1tTTUVfUU9TX1RTUEVDX0lOREVYXzBdID4gMCl8fAorICAgICAgICAgKHBBQ0luZm8tPm51bV9mbG93c1tTTUVfUU9TX1RTUEVDX0lOREVYXzFdID4gMCkpCisgICAgICB7CisgICAgICAgICAvL2RvIHdlIG5lZWQgdG8gY2FyZSBhYm91dCB0aGUgY2FzZSB3aGVyZSBBUFNEIG5lZWRlZCBvbiBBQ00gPSAwIGJlbG93PworICAgICAgICAgaWYoQ1NSX0lTX0FERFRTX1dIRU5fQUNNT0ZGX1NVUFBPUlRFRChwTWFjKSB8fAorICAgICAgICAgICAgc21lX1Fvc0lzQUNNKHBNYWMsIHBTZXNzaW9uLT5hc3NvY0luZm8ucEJzc0Rlc2MsIGFjLCBOVUxMKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fTUVELCAKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiB0c3BlY19tYXNrX3N0YXR1cyA9ICVkIGZvciBBQyA9ICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgICAgICAgcEFDSW5mby0+dHNwZWNfbWFza19zdGF0dXMsIGFjKTsKKyAgICAgICAgICAgIGlmKCFwQUNJbmZvLT50c3BlY19tYXNrX3N0YXR1cykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiB0c3BlY19tYXNrX3N0YXR1cyBjYW4ndCBiZSAwIGZvciBhYyA9ICVkIGluICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAic3RhdGUgPSAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgICAgICAgIGFjLCBwQUNJbmZvLT5jdXJyX3N0YXRlKTsKKyAgICAgICAgICAgICAgIC8vQVNTRVJUCisgICAgICAgICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICAgICAgICAgLy8gdW5hYmxlIHRvIHNlcnZpY2UgdGhlIHJlcXVlc3QKKyAgICAgICAgICAgICAgIC8vIG5vdGhpbmcgaXMgcGVuZGluZyBzbyB2b3RlIHBvd2Vyc2F2ZSBiYWNrIG9uCisgICAgICAgICAgICAgICBwU2Vzc2lvbi0+cmVhZHlGb3JQb3dlclNhdmUgPSBWT1NfVFJVRTsKKyAgICAgICAgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBGbG93IGFnZ3JlZ2F0aW9uICovCisgICAgICAgICAgICBpZigoKHBBQ0luZm8tPnRzcGVjX21hc2tfc3RhdHVzID4gMCkgJiYKKyAgICAgICAgICAgICAgICAocEFDSW5mby0+dHNwZWNfbWFza19zdGF0dXMgPD0gU01FX1FPU19UU1BFQ19JTkRFWF9NQVgpKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogRWl0aGVyIG9mIHVwc3RyZWFtLCBkb3duc3RyZWFtIG9yIGJpZGlyZWN0aW9uYWwgZmxvd3MgYXJlIHByZXNlbnQgKi8KKyAgICAgICAgICAgICAgLyogSWYgZWl0aGVyIG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0aW9uID09IFRzcGVjX0luZm8udHNfaW5mby5kaXJlY3Rpb24pCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBBZ2dyZWdhdGUgdGhlIG5ldyBzdHJlYW0gd2l0aCB0aGUgY3VycmVudCBzdHJlYW0ocykuCisgICAgICAgICAgICAgICAgdG1hc2sgPSBwQUNJbmZvLT50c3BlY19tYXNrX3N0YXR1czsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAvKiBOZXcgc3RyZWFtIGlzIGluIGRpZmZlcmVudCBkaXJlY3Rpb24uICovCisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIE5vIEFnZ3JlZ2F0aW9uLiBNYXJrIHRoZSAybmQgdHBzZWMgaW5kZXggYWxzbyBhcyBhY3RpdmUuCisgICAgICAgICAgICAgICAgdG1hc2sgPSBTTUVfUU9TX1RTUEVDX01BU0tfQ0xFQVI7CisgICAgICAgICAgICAgICAgbmV3X3RtYXNrID0gU01FX1FPU19UU1BFQ19NQVNLX0JJVF8xXzJfU0VUICYgfnBBQ0luZm8tPnRzcGVjX21hc2tfc3RhdHVzOworICAgICAgICAgICAgICAgIHBBQ0luZm8tPnRzcGVjX21hc2tfc3RhdHVzID0gU01FX1FPU19UU1BFQ19NQVNLX0JJVF8xXzJfU0VUOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKFNNRV9RT1NfVFNQRUNfTUFTS19CSVRfMV8yX1NFVCA9PSBwQUNJbmZvLT50c3BlY19tYXNrX3N0YXR1cykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogQm90aCB1cGxpbmsgYW5kIGRvd25saW5rIHN0cmVhbXMgYXJlIHByZXNlbnQuICovCisgICAgICAgICAgICAgIC8qIElmIG5ldyBzdHJlYW0gaXMgYmlkaXJlY3Rpb25hbCwgYWdncmVnYXRlIG5ldyBzdHJlYW0gd2l0aCBhbGwgZXhpc3RpbmcKKyAgICAgICAgICAgICAgICogdXBzdHJlYW1zIGFuZCBkb3duc3RyZWFtcy4gU2VuZCBvdXQgbmV3IGFnZ3JlZ2F0ZWQgdHBzZWMuICovCisgICAgICAgICAgICAgIGlmKFRzcGVjX0luZm8udHNfaW5mby5kaXJlY3Rpb24gPT0gU01FX1FPU19XTU1fVFNfRElSX0JPVEgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBPbmx5IG9uZSB0c3BlYyBpbmRleCAoMCkgd2lsbCBiZSBpbiB1c2UgYWZ0ZXIgdGhpcyBhZ2dyZWdhdGlvbi4KKyAgICAgICAgICAgICAgICB0bWFzayA9IFNNRV9RT1NfVFNQRUNfTUFTS19CSVRfMV8yX1NFVDsKKyAgICAgICAgICAgICAgICBwQUNJbmZvLT50c3BlY19tYXNrX3N0YXR1cyA9IFNNRV9RT1NfVFNQRUNfTUFTS19CSVRfMV9TRVQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogTmV3IHN0cmVhbSBpcyBhbHNvIHVuaS1kaXJlY3Rpb25hbAorICAgICAgICAgICAgICAgKiBGaW5kIG91dCB0aGUgdHNlcGMgaW5kZXggd2l0aCB3aGljaCBpdCBuZWVkcyB0byBiZSBhZ2dyZWdhdGVkICovCisgICAgICAgICAgICAgIGVsc2UgaWYocEFDSW5mby0+Y3Vycl9Rb1NJbmZvW1NNRV9RT1NfVFNQRUNfSU5ERVhfMF0udHNfaW5mby5kaXJlY3Rpb24gIT0gCisgICAgICAgICAgICAgICAgICAgVHNwZWNfSW5mby50c19pbmZvLmRpcmVjdGlvbikKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIEFnZ3JlZ2F0ZSB3aXRoIDJuZCB0c3BlYyBpbmRleAorICAgICAgICAgICAgICAgIHRtYXNrID0gU01FX1FPU19UU1BFQ19NQVNLX0JJVF8yX1NFVDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBBZ2dyZWdhdGUgd2l0aCAxc3QgdHNwZWMgaW5kZXgKKyAgICAgICAgICAgICAgICB0bWFzayA9IFNNRV9RT1NfVFNQRUNfTUFTS19CSVRfMV9TRVQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19NRUQsCisgICAgICAgICAgICAgICAgIiVzOiAlZDogd3JvbmcgdG1hc2sgPSAlZCIsIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICBwQUNJbmZvLT50c3BlY19tYXNrX3N0YXR1cyApOworICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgLy9BQ00gPSAwCisgICAgICAgICAgICAvLyBXZSB3b24ndCBiZSBzZW5kaW5nIGEgVFNQRUMgdG8gdGhlIEFQIGJ1dCB3ZSBzdGlsbCBuZWVkCisgICAgICAgICAgICAvLyB0byBhZ2dyZWdhdGUgdG8gY2FsY3VsYXRlIHRyaWdnZXIgZnJhbWUgcGFyYW1ldGVycworICAgICAgICAgICAgdG1hc2sgPSBTTUVfUU9TX1RTUEVDX01BU0tfQklUXzFfU0VUOworICAgICAgICAgfQorICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19NRUQsCisgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogdG1hc2sgPSAlZCwgbmV3X3RtYXNrID0gJWQgaW4gc3RhdGUgPSAlZCIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgIHRtYXNrLCBuZXdfdG1hc2ssIHBBQ0luZm8tPmN1cnJfc3RhdGUgKTsKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fTUVELAorICAgICAgICAgICAgICAgICAgICIlczogJWQ6IHRzcGVjX21hc2tfc3RhdHVzID0gJWQgZm9yIEFDID0gJWQiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICBwQUNJbmZvLT50c3BlY19tYXNrX3N0YXR1cywgYWMpOworICAgICAgICAgaWYodG1hc2spCisgICAgICAgICB7CisgICAgICAgICAgICAvLyBjcmVhdGUgdGhlIGFnZ3JlZ2F0ZSBUU1BFQworICAgICAgICAgICAgaWYodG1hc2sgIT0gU01FX1FPU19UU1BFQ19NQVNLX0JJVF8xXzJfU0VUKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBoc3RhdHVzID0gc21lX1Fvc0FnZ3JlZ2F0ZVBhcmFtcygmVHNwZWNfSW5mbywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwQUNJbmZvLT5jdXJyX1FvU0luZm9bdG1hc2sgLSAxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBQ0luZm8tPnJlcXVlc3RlZF9Rb1NJbmZvW3RtYXNrIC0gMV0pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBBZ2dyZWdhdGUgdGhlIG5ldyBiaWRpcmVjdGlvbmFsIHN0cmVhbSB3aXRoIHRoZSBleGlzdGluZyB1cHN0cmVhbXMgYW5kIAorICAgICAgICAgICAgICAgKiBkb3duc3RyZWFtcyBpbiB0c3BlYyBpbmRpY2VzIDAgYW5kIDEuICovCisgICAgICAgICAgICAgIHRtYXNrID0gU01FX1FPU19UU1BFQ19NQVNLX0JJVF8xX1NFVDsKKworICAgICAgICAgICAgICBpZigoaHN0YXR1cyA9IHNtZV9Rb3NBZ2dyZWdhdGVQYXJhbXMoJlRzcGVjX0luZm8sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBQ0luZm8tPmN1cnJfUW9TSW5mb1tTTUVfUU9TX1RTUEVDX0lOREVYXzBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBQ0luZm8tPnJlcXVlc3RlZF9Rb1NJbmZvW3RtYXNrIC0gMV0pKQorICAgICAgICAgICAgICAgICAgICAgICAgICA9PSBlSEFMX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaHN0YXR1cyA9IHNtZV9Rb3NBZ2dyZWdhdGVQYXJhbXMoJnBBQ0luZm8tPmN1cnJfUW9TSW5mb1tTTUVfUU9TX1RTUEVDX0lOREVYXzFdLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEFDSW5mby0+cmVxdWVzdGVkX1FvU0luZm9bdG1hc2sgLSAxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKGhzdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLy9lcnIgbXNnCisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogZmFpbGVkIHRvIGFnZ3JlZ2F0ZSBwYXJhbXMiLAorICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXyk7CisgICAgICAgICAgICAgICAvLyB1bmFibGUgdG8gc2VydmljZSB0aGUgcmVxdWVzdAorICAgICAgICAgICAgICAgLy8gbm90aGluZyBpcyBwZW5kaW5nIHNvIHZvdGUgcG93ZXJzYXZlIGJhY2sgb24KKyAgICAgICAgICAgICAgIHBTZXNzaW9uLT5yZWFkeUZvclBvd2VyU2F2ZSA9IFZPU19UUlVFOworICAgICAgICAgICAgICAgcmV0dXJuIFNNRV9RT1NfU1RBVFVTX1NFVFVQX0ZBSUxVUkVfUlNQOworICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgaWYgKCEobmV3X3RtYXNrID4gMCAmJiBuZXdfdG1hc2sgPD0gU01FX1FPU19UU1BFQ19JTkRFWF9NQVgpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBBcnJheUluZGV4T3V0T2ZCb3VuZHNFeGNlcHRpb24iLAorICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXyk7CisKKyAgICAgICAgICAgICAgICAgcmV0dXJuIFNNRV9RT1NfU1RBVFVTX1NFVFVQX0ZBSUxVUkVfUlNQOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdG1hc2sgPSBuZXdfdG1hc2s7CisgICAgICAgICAgICBwQUNJbmZvLT5yZXF1ZXN0ZWRfUW9TSW5mb1t0bWFzay0xXSA9IFRzcGVjX0luZm87CisgICAgICAgICB9CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogbm8gZmxvd3MgcnVubmluZy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dLnRzX2luZm8ucHNiID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVHNwZWNfSW5mby50c19pbmZvLnBzYjsKKyAgICAgIHN0YXR1cyA9IHNtZV9Rb3NTZXR1cChwTWFjLCBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBQ0luZm8tPnJlcXVlc3RlZF9Rb1NJbmZvW3RtYXNrIC0gMV0sIGFjKTsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgCisgICAgICAgICAgICAgICAgIiVzOiAlZDogT24gc2Vzc2lvbiAlZCB3aXRoIEFDICVkIGluIHN0YXRlIFNNRV9RT1NfUU9TX09OICIKKyAgICAgICAgICAgICAgICAic21lX1Fvc1NldHVwIHJldHVybmVkIHdpdGggc3RhdHVzICVkIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgc2Vzc2lvbklkLCBhYywgc3RhdHVzKTsKKyAgICAgIGlmKFNNRV9RT1NfU1RBVFVTX1NFVFVQX1JFUV9QRU5ESU5HX1JTUCAhPSBzdGF0dXMpCisgICAgICB7CisgICAgICAgICAvLyB3ZSBhcmVuJ3Qgd2FpdGluZyBmb3IgYSByZXNwb25zZSBmcm9tIHRoZSBBUAorICAgICAgICAgLy8gc28gdm90ZSBwb3dlcnNhdmUgYmFjayBvbgorICAgICAgICAgcFNlc3Npb24tPnJlYWR5Rm9yUG93ZXJTYXZlID0gVk9TX1RSVUU7CisgICAgICB9CisgICAgICBpZigoU01FX1FPU19TVEFUVVNfU0VUVVBfUkVRX1BFTkRJTkdfUlNQID09IHN0YXR1cyl8fAorICAgICAgICAgKFNNRV9RT1NfU1RBVFVTX1NFVFVQX1NVQ0NFU1NfTk9fQUNNX05PX0FQU0RfUlNQID09IHN0YXR1cykgfHwKKyAgICAgICAgIChTTUVfUU9TX1NUQVRVU19TRVRVUF9TVUNDRVNTX0FQU0RfU0VUX0FMUkVBRFkgPT0gc3RhdHVzKSkKKyAgICAgIHsKKyAgICAgICAgIC8vIHdlIHJlY2VpdmVkIGFuIGV4cGVjdGVkICJnb29kIiBzdGF0dXMKKyAgICAgICAgIC8vY3JlYXRlIGFuIGVudHJ5IGluIHRoZSBmbG93IGxpc3QKKyAgICAgICAgIHBlbnRyeSA9IChzbWVfUW9zRmxvd0luZm9FbnRyeSAqKSB2b3NfbWVtX21hbGxvYyhzaXplb2YoKnBlbnRyeSkpOworICAgICAgICAgaWYgKCFwZW50cnkpCisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBjb3VsZG4ndCBhbGxvY2F0ZSBtZW1vcnkgZm9yIHRoZSBuZXcgIgorICAgICAgICAgICAgICAgICAgICAgICJlbnRyeSBpbiB0aGUgRmxvdyBMaXN0IiwKKyAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18pOworICAgICAgICAgICAgcmV0dXJuIFNNRV9RT1NfU1RBVFVTX1NFVFVQX0ZBSUxVUkVfUlNQOworICAgICAgICAgfQorICAgICAgICAgcGVudHJ5LT5hY190eXBlID0gYWM7CisgICAgICAgICBwZW50cnktPkhERGNvbnRleHQgPSBIRERjb250ZXh0OworICAgICAgICAgcGVudHJ5LT5Rb1NDYWxsYmFjayA9IFFvU0NhbGxiYWNrOworICAgICAgICAgcGVudHJ5LT5ob1JlbmV3YWwgPSBob1JlbmV3YWw7CisgICAgICAgICBwZW50cnktPlFvc0Zsb3dJRCA9IFFvc0Zsb3dJRDsKKyAgICAgICAgIHBlbnRyeS0+c2Vzc2lvbklkID0gc2Vzc2lvbklkOworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAKKyAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBDcmVhdGluZyBmbG93ICVkIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgICAgUW9zRmxvd0lEKTsKKyAgICAgICAgIGlmKChTTUVfUU9TX1NUQVRVU19TRVRVUF9TVUNDRVNTX05PX0FDTV9OT19BUFNEX1JTUCA9PSBzdGF0dXMpfHwKKyAgICAgICAgICAgIChTTUVfUU9TX1NUQVRVU19TRVRVUF9TVUNDRVNTX0FQU0RfU0VUX0FMUkVBRFkgPT0gc3RhdHVzKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIG5ld19zdGF0ZSA9IHBBQ0luZm8tPmN1cnJfc3RhdGU7CisgICAgICAgICAgICBwZW50cnktPnJlYXNvbiA9IFNNRV9RT1NfUkVBU09OX1JFUV9TVUNDRVNTOworICAgICAgICAgICAgcEFDSW5mby0+Y3Vycl9Rb1NJbmZvW1NNRV9RT1NfVFNQRUNfSU5ERVhfMF0gPSAKKyAgICAgICAgICAgICAgIHBBQ0luZm8tPnJlcXVlc3RlZF9Rb1NJbmZvW1NNRV9RT1NfVFNQRUNfSU5ERVhfMF07CisgICAgICAgICAgICBpZihidWZmZXJlZF9jbWQgJiYgIXBlbnRyeS0+aG9SZW5ld2FsKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgUW9TQ2FsbGJhY2socE1hYywgSEREY29udGV4dCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEFDSW5mby0+Y3Vycl9Rb1NJbmZvW1NNRV9RT1NfVFNQRUNfSU5ERVhfMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwZW50cnktPlFvc0Zsb3dJRCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZihTTUVfUU9TX1NUQVRVU19TRVRVUF9TVUNDRVNTX0FQU0RfU0VUX0FMUkVBRFkgPT0gc3RhdHVzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLy8gaWYgd2UgYXJlIG5vdCBpbiBoYW5kb2ZmLCB0aGVuIG5vdGlmeSBhbGwgZmxvd3Mgb24KKyAgICAgICAgICAgICAgIC8vIHRoaXMgQUMgdGhhdCB0aGUgYWdncmVnYXRlIFRTUEVDIG1heSBoYXZlIGNoYW5nZWQKKyAgICAgICAgICAgICAgIGlmKCFwZW50cnktPmhvUmVuZXdhbCkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHZvc19tZW1femVybygmc2VhcmNoX2tleSwgc2l6ZW9mKHNtZV9Rb3NTZWFyY2hJbmZvKSk7CisgICAgICAgICAgICAgICAgICBzZWFyY2hfa2V5LmtleS5hY190eXBlID0gYWM7CisgICAgICAgICAgICAgICAgICBzZWFyY2hfa2V5LmluZGV4ID0gU01FX1FPU19TRUFSQ0hfS0VZX0lOREVYXzI7CisgICAgICAgICAgICAgICAgICBzZWFyY2hfa2V5LnNlc3Npb25JZCA9IHNlc3Npb25JZDsKKyAgICAgICAgICAgICAgICAgIGhzdGF0dXMgPSBzbWVfUW9zRmluZEFsbEluRmxvd0xpc3QocE1hYywgc2VhcmNoX2tleSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21lX1Fvc1NldHVwRm5wKTsKKyAgICAgICAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1MoaHN0YXR1cykpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogY291bGRuJ3Qgbm90aWZ5IG90aGVyICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZW50cmllcyBvbiB0aGlzIEFDID0lZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLCBhYyk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwZW50cnktPmhvUmVuZXdhbCA9IFZPU19GQUxTRTsKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UKKyAgICAgICAgIHsKKyAgICAgICAgICAgIC8vIFNNRV9RT1NfU1RBVFVTX1NFVFVQX1JFUV9QRU5ESU5HX1JTUAorICAgICAgICAgICAgbmV3X3N0YXRlID0gU01FX1FPU19SRVFVRVNURUQ7CisgICAgICAgICAgICBwZW50cnktPnJlYXNvbiA9IFNNRV9RT1NfUkVBU09OX1NFVFVQOworICAgICAgICAgICAgLy9OZWVkIHRoaXMgaW5mbyB3aGVuIGFkZHRzIGNvbWVzIGJhY2sgZnJvbSBQRSB0byBrbm93IG9uCisgICAgICAgICAgICAvL3doaWNoIGluZGV4IG9mIHRoZSBBQyB0aGUgcmVxdWVzdCB3YXMgZnJvbQorICAgICAgICAgICAgcEFDSW5mby0+dHNwZWNfcGVuZGluZyA9IHRtYXNrOworICAgICAgICAgfQorICAgICAgICAgaWYodG1hc2spCisgICAgICAgICAgICBwQUNJbmZvLT5udW1fZmxvd3NbdG1hc2sgLSAxXSsrOworICAgICAgICAgZWxzZQorICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogQXJyYXlJbmRleE91dE9mQm91bmRzRXhjZXB0aW9uIiwKKyAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fKTsKKyAgICAgICAgIC8vaW5kaWNhdGUgb24gd2hpY2ggaW5kZXggdGhlIGZsb3cgZW50cnkgYmVsb25ncyB0byAmIGFkZCBpdCB0byB0aGUgCisgICAgICAgICAvL0Zsb3cgTGlzdCBhdCB0aGUgZW5kCisgICAgICAgICBwZW50cnktPnRzcGVjX21hc2sgPSB0bWFzazsKKyAgICAgICAgIHBlbnRyeS0+UW9TSW5mbyA9IFRzcGVjX0luZm87CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsIAorICAgICAgICAgICAgICAgICAgICIlczogJWQ6IE9uIHNlc3Npb24gJWQgY3JlYXRpbmcgZW50cnkgYXQgJXAgd2l0aCBmbG93SUQgJWQiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICBzZXNzaW9uSWQsIHBlbnRyeSwgUW9zRmxvd0lEKTsKKyAgICAgICAgIGNzckxMSW5zZXJ0VGFpbCgmc21lX1Fvc0NiLmZsb3dfbGlzdCwgJnBlbnRyeS0+bGluaywgVk9TX1RSVUUpOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgLy8gdW5leHBlY3RlZCBzdGF0dXMgcmV0dXJuZWQgYnkgc21lX1Fvc1NldHVwKCkKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBPbiBzZXNzaW9uICVkIHVuZXhwZWN0ZWQgc3RhdHVzICVkICIKKyAgICAgICAgICAgICAgICAgICAicmV0dXJuZWQgYnkgc21lX1Fvc1NldHVwIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkLCBzdGF0dXMpOworICAgICAgICAgbmV3X3N0YXRlID0gcEFDSW5mby0+Y3Vycl9zdGF0ZTsKKyAgICAgIH0KKyAgICAgIGJyZWFrOwor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FbnRyeSwgbGluayApOworICAgYWMgPSBmbG93X2luZm8tPmFjX3R5cGU7CisKKyAgIHNlc3Npb25JZCA9IGZsb3dfaW5mby0+c2Vzc2lvbklkOworICAgcFNlc3Npb24gPSAmc21lX1Fvc0NiLnNlc3Npb25JbmZvW3Nlc3Npb25JZF07CisgICBwQUNJbmZvID0gJnBTZXNzaW9uLT5hY19pbmZvW2FjXTsKKworICAgLy92YWxpZGF0ZSBRb1MgcGFyYW1zCisgICBpZighc21lX1Fvc1ZhbGlkYXRlUmVxdWVzdGVkUGFyYW1zKHBNYWMsIHBRb1NJbmZvLCBzZXNzaW9uSWQpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICIlczogJWQ6IGludmFsaWQgcGFyYW1zIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18pOworICAgICAgcmV0dXJuIFNNRV9RT1NfU1RBVFVTX01PRElGWV9TRVRVUF9JTlZBTElEX1BBUkFNU19SU1A7CisgICB9CisgICAvLyBGb3IgbW9kaWZ5LCBtYWtlIHN1cmUgdGhhdCBkaXJlY3Rpb24sIFRJRCBhbmQgVVAgYXJlIG5vdCBiZWluZyBhbHRlcmVkCisgICBpZigocFFvU0luZm8tPnRzX2luZm8uZGlyZWN0aW9uICE9IGZsb3dfaW5mby0+UW9TSW5mby50c19pbmZvLmRpcmVjdGlvbikgfHwKKyAgICAgIChwUW9TSW5mby0+dHNfaW5mby51cCAhPSBmbG93X2luZm8tPlFvU0luZm8udHNfaW5mby51cCkgfHwKKyAgICAgIChwUW9TSW5mby0+dHNfaW5mby50aWQgIT0gZmxvd19pbmZvLT5Rb1NJbmZvLnRzX2luZm8udGlkKSkKKyAgIHsKKyAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgIiVzOiAlZDogTW9kaWZpY2F0aW9uIG9mIGRpcmVjdGlvbi90aWQvdXAgaXMgbm90IGFsbG93ZWQiLAorICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fKTsKKworICAgICByZXR1cm4gU01FX1FPU19TVEFUVVNfTU9ESUZZX1NFVFVQX0lOVkFMSURfUEFSQU1TX1JTUDsKKyAgIH0KKworICAgLy9zaG91bGQgbm90IGJlIHNhbWUgYXMgcHJldmlvdXMgaW9jdGwgcGFyYW1ldGVycworICAgaWYgKChwUW9TSW5mby0+bm9taW5hbF9tc2R1X3NpemUgPT0gZmxvd19pbmZvLT5Rb1NJbmZvLm5vbWluYWxfbXNkdV9zaXplKSAmJgorICAgICAgIChwUW9TSW5mby0+bWF4aW11bV9tc2R1X3NpemUgPT0gZmxvd19pbmZvLT5Rb1NJbmZvLm1heGltdW1fbXNkdV9zaXplKSAmJgorICAgICAgIChwUW9TSW5mby0+bWluX2RhdGFfcmF0ZSA9PSBmbG93X2luZm8tPlFvU0luZm8ubWluX2RhdGFfcmF0ZSkgJiYKKyAgICAgICAocFFvU0luZm8tPm1lYW5fZGF0YV9yYXRlID09IGZsb3dfaW5mby0+UW9TSW5mby5tZWFuX2RhdGFfcmF0ZSkgJiYKKyAgICAgICAocFFvU0luZm8tPnBlYWtfZGF0YV9yYXRlID09IGZsb3dfaW5mby0+UW9TSW5mby5wZWFrX2RhdGFfcmF0ZSkgJiYKKyAgICAgICAocFFvU0luZm8tPm1pbl9zZXJ2aWNlX2ludGVydmFsID09CisgICAgICAgICAgICAgICAgICBmbG93X2luZm8tPlFvU0luZm8ubWluX3NlcnZpY2VfaW50ZXJ2YWwpICYmCisgICAgICAgKHBRb1NJbmZvLT5tYXhfc2VydmljZV9pbnRlcnZhbCA9PQorICAgICAgICAgICAgICAgICAgZmxvd19pbmZvLT5Rb1NJbmZvLm1heF9zZXJ2aWNlX2ludGVydmFsKSAmJgorICAgICAgIChwUW9TSW5mby0+aW5hY3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QbWNGdWxsUG93ZXJDYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLCBlU01FX1JFQVNPTl9PVEhFUik7CisgICAgICBpZiggZUhBTF9TVEFUVVNfUE1DX1BFTkRJTkcgPT0gaHN0YXR1cyApCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPX01FRCwgCisgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogYnVmZmVyaW5nIHRoZSBtb2RpZnkgcmVxdWVzdCBmb3IgZmxvdyAlZCBpbiBzdGF0ZSAlZCwgIgorICAgICAgICAgICAgICAgICAgICJ3YWl0aW5nIGZvciBmdWxsIHBvd2VyIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sIAorICAgICAgICAgICAgICAgICAgIFFvc0Zsb3dJRCwgcEFDSW5mby0+Y3Vycl9zdGF0ZSApOworICAgICAgICAgYnVmZmVyQ29tbWFuZCA9IFZPU19UUlVFOworICAgICAgfQorICAgfQorICAgaWYgKGJ1ZmZlckNvbW1hbmQpCisgICB7CisgICAgICAvLyB3ZSBuZWVkIHRvIGJ1ZmZlciB0aGUgY29tbWFuZAorICAgICAgY21kLmNvbW1hbmQgPSBTTUVfUU9TX01PRElGWV9SRVE7CisgICAgICBjbWQucE1hYyA9IHBNYWM7CisgICAgICBjbWQuc2Vzc2lvbklkID0gc2Vzc2lvbklkOworICAgICAgY21kLnUubW9kaWZ5Q21kSW5mby5Rb3NGbG93SUQgPSBRb3NGbG93SUQ7CisgICAgICBjbWQudS5tb2RpZnlDbWRJbmZvLlFvU0luZm8gPSAqcFFvU0luZm87CisgICAgICBoc3RhdHVzID0gc21lX1Fvc0J1ZmZlckNtZCgmY21kLCBidWZmZXJlZF9jbWQpOworICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhoc3RhdHVzKSkKKyAgICAgIHsKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBjb3VsZG4ndCBidWZmZXIgdGhlIG1vZGlmeSByZXF1ZXN0IGluIHN0YXRlID0gJWQiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICBwQUNJbmZvLT5jdXJyX3N0YXRlICk7CisgICAgICAgICAvLyB1bmFibGUgdG8gYnVmZmVyIHRoZSByZXF1ZXN0CisgICAgICAgICAvLyBub3RoaW5nIGlzIHBlbmRpbmcgc28gdm90ZSBwb3dlcnNhdmUgYmFjayBvbgorICAgICAgICAgcFNlc3Npb24tPnJlYWR5Rm9yUG93ZXJTYXZlID0gVk9TX1RSVUU7CisgICAgICAgICByZXR1cm4gU01FX1FPU19TVEFUVVNfTU9ESUZZX1NFVFVQX0ZBSUxVUkVfUlNQOworICAgICAgfQorICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAKKyAgICAgICAgICAgICAgICAiJXM6ICVkOiBCdWZmZXJlZCBtb2RpZnkgcmVxdWVzdCBmb3IgZmxvdyA9ICVkIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgUW9zRmxvd0lEKTsKKyAgICAgIHJldHVybiBTTUVfUU9TX1NUQVRVU19NT0RJRllfU0VUVVBfUEVORElOR19SU1A7CisgICB9CisgICAvL2dldCBpbnRvIHRoZSBzdGF0IG0vYyB0byBzZWUgaWYgdGhlIHJlcXVlc3QgY2FuIGJlIGdyYW50ZWQKKyAgIHN3aXRjaChwQUNJbmZvLT5jdXJyX3N0YXRlKQorICAgeworICAgY2FzZSBTTUVfUU9TX1FPU19PTjoKKyAgICAgIC8vc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y9hZGQgdGhlIG5ldyBlbnRyeSB1bmRlciBjb25zdHJ1Y3Rpb24gdG8gdGhlIEZsb3cgTGlzdAorICAgICAgY3NyTExJbnNlcnRUYWlsKCZzbWVfUW9zQ2IuZmxvd19saXN0LCAmcE5ld0VudHJ5LT5saW5rLCBWT1NfVFJVRSk7CisgICAgICAvL3VwZGF0ZSBUU1BFQyB3aXRoIHRoZSBuZXcgcGFyYW0gc2V0CisgICAgICBoc3RhdHVzID0gc21lX1Fvc1VwZGF0ZVBhcmFtcyhzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYywgcE5ld0VudHJ5LT50c3BlY19tYXNrLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZBZ2dyX1RzcGVjX0luZm8pOworICAgICAgaWYoSEFMX1NUQVRVU19TVUNDRVNTKGhzdGF0dXMpKQorICAgICAgeworICAgICAgICAgcEFDSW5mby0+cmVxdWVzdGVkX1FvU0luZm9bcE5ld0VudHJ5LT50c3BlY19tYXNrIC0xXSA9IEFnZ3JfVHNwZWNfSW5mbzsKKyAgICAgICAgIC8vaWYgQUNNLCBzZW5kIG91dCBhIG5ldyBBRERUUworICAgICAgICAgc3RhdHVzID0gc21lX1Fvc1NldHVwKHBNYWMsIHNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEFDSW5mby0+cmVxdWVzdGVkX1FvU0luZm9bcE5ld0VudHJ5LT50c3BlY19tYXNrIC0xXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYyk7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsIAorICAgICAgICAgICAgICAgICAgICIlczogJWQ6IE9uIHNlc3Npb24gJWQgd2l0aCBBQyAlZCBpbiBzdGF0ZSBTTUVfUU9TX1FPU19PTiAiCisgICAgICAgICAgICAgICAgICAgInNtZV9Rb3NTZXR1cCByZXR1cm5lZCB3aXRoIHN0YXR1cyAlZCIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCwgYWMsIHN0YXR1cyk7CisgICAgICAgICBpZihTTUVfUU9TX1NUQVRVU19TRVRVUF9SRVFfUEVORElOR19SU1AgIT0gc3RhdHVzKQorICAgICAgICAgeworICAgICAgICAgICAgLy8gd2UgYXJlbid0IHdhaXRpbmcgZm9yIGEgcmVzcG9uc2UgZnJvbSB0aGUgQVAKKyAgICAgICAgICAgIC8vIHNvIHZvdGUgcG93ZXJzYXZlIGJhY2sgb24KKyAgICAgICAgICAgIHBTZXNzaW9uLT5yZWFkeUZvclBvd2VyU2F2ZSA9IFZPU19UUlVFOworICAgICAgICAgfQorICAgICAgICAgaWYoU01FX1FPU19TVEFUVVNfU0VUVVBfUkVRX1BFTkRJTkdfUlNQID09IHN0YXR1cykgCisgICAgICAgICB7CisgICAgICAgICAgICBuZXdfc3RhdGUgPSBTTUVfUU9TX1JFUVVFU1RFRDsKKyAgICAgICAgICAgIHN0YXR1cyA9IFNNRV9RT1NfU1RBVFVTX01PRElGWV9TRVRVUF9QRU5ESU5HX1JTUDsKKyAgICAgICAgICAgIHBBQ0luZm8tPnRzcGVjX3BlbmRpbmcgPSBwTmV3RW50cnktPnRzcGVjX21hc2s7CisgICAgICAgICB9CisgICAgICAgICBlbHNlIGlmKChTTUVfUU9TX1NUQVRVU19TRVRVUF9TVUNDRVNTX05PX0FDTV9OT19BUFNEX1JTUCA9PSBzdGF0dXMpIHx8CisgICAgICAgICAgICAgICAgIChTTUVfUU9TX1NUQVRVU19TRVRVUF9TVUNDRVNTX0FQU0RfU0VUX0FMUkVBRFkgPT0gc3RhdHVzKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIG5ld19zdGF0ZSA9IFNNRV9RT1NfUU9TX09OOworCisgICAgICAgICAgICB2b3NfbWVtX3plcm8oJnNlYXJjaF9rZXksIHNpemVvZihzbWVfUW9zU2VhcmNoSW5mbykpOworICAgICAgICAgICAgLy9kZWxldGUgdGhlIG9yaWdpbmFsIGVudHJ5IGluIEZMT1cgbGlzdCB3aGljaCBnb3QgbW9kaWZpZWQKKyAgICAgICAgICAgIHNlYXJjaF9rZXkua2V5LmFjX3R5cGUgPSBhYzsKKyAgICAgICAgICAgIHNlYXJjaF9rZXkuaW5kZXggPSBTTUVfUU9TX1NFQVJDSF9LRVlfSU5ERVhfMjsKKyAgICAgICAgICAgIHNlYXJjaF9rZXkuc2Vzc2lvbklkID0gc2Vzc2lvbklkOworICAgICAgICAgICAgaHN0YXR1cyA9IHNtZV9Rb3NGaW5kQWxsSW5GbG93TGlzdChwTWFjLCBzZWFyY2hfa2V5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbWVfUW9zTW9kaWZ5Rm5wKTsKKyAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1MoaHN0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBzdGF0dXMgPSBTTUVfUU9TX1NUQVRVU19NT0RJRllfU0VUVVBfRkFJTFVSRV9SU1A7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZihTTUVfUU9TX1NUQVRVU19NT0RJRllfU0VUVVBfRkFJTFVSRV9SU1AgIT0gc3RhdHVzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgcEFDSW5mby0+Y3Vycl9Rb1NJbmZvW3BOZXdFbnRyeS0+dHNwZWNfbWFzayAtMV0gPSAKKyAgICAgICAgICAgICAgICAgIHBBQ0luZm8tPnJlcXVlc3RlZF9Rb1NJbmZvW3BOZXdFbnRyeS0+dHNwZWNfbWFzayAtMV07CisgICAgICAgICAgICAgICBpZihTTUVfUU9TX1NUQVRVU19TRVRVUF9TVUNDRVNTX0FQU0RfU0VUX0FMUkVBRFkgPT0gc3RhdHVzKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgc3RhdHVzID0gU01FX1FPU19TVEFUVVNfTU9ESUZZX1NFVFVQX1NVQ0NFU1NfQVBTRF9TRVRfQUxSRUFEWTsKKyAgICAgICAgICAgICAgICAgIHZvc19tZW1femVybygmc2VhcmNoX2tleSwgc2l6ZW9mKHNtZV9Rb3NTZWFyY2hJbmZvKSk7CisgICAgICAgICAgICAgICAgICBzZWFyY2hfa2V5LmtleS5hY190eXBlID0gYWM7CisgICAgICAgICAgICAgICAgICBzZWFyY2hfa2V5LmluZGV4ID0gU01FX1FPU19TRUFSQ0hfS0VZX0lOREVYXzI7CisgICAgICAgICAgICAgICAgICBzZWFyY2hfa2V5LnNlc3Npb25JZCA9IHNlc3Npb25JZDsKKyAgICAgICAgICAgICAgICAgIGhzdGF0dXMgPSBzbWVfUW9zRmluZEFsbEluRmxvd0xpc3QocE1hYywgc2VhcmNoX2tleSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtZV9Rb3NNb2RpZmljYXRpb25Ob3RpZnlGbnApOworICAgICAgICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhoc3RhdHVzKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBjb3VsZG4ndCBub3RpZnkgb3RoZXIgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJlbnRyaWVzIG9uIHRoaXMgQUMgPSVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sIGFjKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIGVsc2UgaWYoU01FX1FPU19TVEFUVVNfU0VUVVBfU1VDQ0VTU19OT19BQ01fTk9fQVBTRF9SU1AgPT0gc3RhdHVzKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgc3RhdHVzID0gU01FX1FPU19TVEFUVVNfTU9ESUZZX1NFVFVQX1NVQ0NFU1NfTk9fQUNNX05PX0FQU0RfUlNQOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYoYnVmZmVyZWRfY21kKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgZmxvd19pbmZvLT5Rb1NDYWxsYmFjayhwTWFjLCBmbG93X2luZm8tPkhERGNvbnRleHQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEFDSW5mby0+Y3Vycl9Rb1NJbmZvW3BOZXdFbnRyeS0+dHNwZWNfbWFzayAtMV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvd19pbmZvLT5Rb3NGbG93SUQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICAvLyB1bmV4cGVjdGVkIHN0YXR1cyByZXR1cm5lZCBieSBzbWVfUW9zU2V0dXAoKQorICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IE9uIHNlc3Npb24gJWQgdW5leHBlY3RlZCBzdGF0dXMgJWQgIgorICAgICAgICAgICAgICAgICAgICAgICJyZXR1cm5lZCBieSBzbWVfUW9zU2V0dXAiLAorICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uS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npb24sIGVTTUVfUkVBU09OX09USEVSKTsKKyAgICAgIGlmKCBlSEFMX1NUQVRVU19QTUNfUEVORElORyA9PSBoc3RhdHVzICkKKyAgICAgIHsKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fTUVELCAKKyAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBidWZmZXJpbmcgdGhlIHJlbGVhc2UgcmVxdWVzdCBmb3IgZmxvdyAlZCBpbiBzdGF0ZSAlZCwgIgorICAgICAgICAgICAgICAgICAgICJ3YWl0aW5nIGZvciBmdWxsIHBvd2VyIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sIAorICAgICAgICAgICAgICAgICAgIFFvc0Zsb3dJRCwgcEFDSW5mby0+Y3Vycl9zdGF0ZSApOworICAgICAgICAgYnVmZmVyQ29tbWFuZCA9IFZPU19UUlVFOworICAgICAgfQorICAgfQorICAgaWYgKGJ1ZmZlckNvbW1hbmQpCisgICB7CisgICAgICAvLyB3ZSBuZWVkIHRvIGJ1ZmZlciB0aGUgY29tbWFuZAorICAgICAgY21kLmNvbW1hbmQgPSBTTUVfUU9TX1JFTEVBU0VfUkVROworICAgICAgY21kLnBNYWMgPSBwTWFjOworICAgICAgY21kLnNlc3Npb25JZCA9IHNlc3Npb25JZDsKKyAgICAgIGNtZC51LnJlbGVhc2VDbWRJbmZvLlFvc0Zsb3dJRCA9IFFvc0Zsb3dJRDsKKyAgICAgIGhzdGF0dXMgPSBzbWVfUW9zQnVmZmVyQ21kKCZjbWQsIGJ1ZmZlcmVkX2NtZCk7CisgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKGhzdGF0dXMpKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICIlczogJWQ6IGNvdWxkbid0IGJ1ZmZlciB0aGUgcmVsZWFzZSByZXF1ZXN0IGluIHN0YXRlID0gJWQiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICBwQUNJbmZvLT5jdXJyX3N0YXRlICk7CisgICAgICAgICAvLyB1bmFibGUgdG8gYnVmZmVyIHRoZSByZXF1ZXN0CisgICAgICAgICAvLyBub3RoaW5nIGlzIHBlbmRpbmcgc28gdm90ZSBwb3dlcnNhdmUgYmFjayBvbgorICAgICAgICAgcFNlc3Npb24tPnJlYWR5Rm9yUG93ZXJTYXZlID0gVk9TX1RSVUU7CisgICAgICAgICByZXR1cm4gU01FX1FPU19TVEFUVVNfUkVMRUFTRV9GQUlMVVJFX1JTUDsKKyAgICAgIH0KKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgCisgICAgICAgICAgICAgICAgIiVzOiAlZDogQnVmZmVyZWQgcmVsZWFzZSByZXF1ZXN0IGZvciBmbG93ID0gJWQiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICBRb3NGbG93SUQpOworICAgICAgcmV0dXJuIFNNRV9RT1NfU1RBVFVTX1JFTEVBU0VfUkVRX1BFTkRJTkdfUlNQOworICAgfQorICAgLy9nZXQgaW50byB0aGUgc3RhdCBtL2MgdG8gc2VlIGlmIHRoZSByZXF1ZXN0IGNhbiBiZSBncmFudGVkCisgICBzd2l0Y2gocEFDSW5mby0+Y3Vycl9zdGF0ZSkKKyAgIHsKKyAgIGNhc2UgU01FX1FPU19RT1NfT046CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPX01FRCwgCisgICAgICAgICAgICAgICAgIiVzOiAlZDogdHNwZWNfbWFza19zdGF0dXMgPSAlZCBmb3IgQUMgPSAlZCB3aXRoICIKKyAgICAgICAgICAgICAgICAiZW50cnkgdHNwZWNfbWFzayA9ICVkIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sIAorICAgICAgICAgICAgICAgIHBBQ0luZm8tPnRzcGVjX21hc2tfc3RhdHVzLCBhYywgZmxvd19pbmZvLT50c3BlY19tYXNrKTsKKworICAgICAgLy9jaGVjayBpZiBtdWx0aXBsZSBmbG93cyBydW5uaW5nIG9uIHRoZSBhYworICAgICAgaWYocEFDSW5mby0+bnVtX2Zsb3dzW2Zsb3dfaW5mby0+dHNwZWNfbWFzayAtIDFdID4gMSkKKyAgICAgIHsKKyAgICAgICAgIC8vZG9uJ3Qgd2FudCB0byBpbmNsdWRlIHRoZSBmbG93IGluIHRoZSBuZXcgVFNQRUMgb24gd2hpY2ggcmVsZWFzZSAKKyAgICAgICAgIC8vaXMgcmVxdWVzdGVkCisgICAgICAgICBmbG93X2luZm8tPnJlYXNvbiA9IFNNRV9RT1NfUkVBU09OX1JFTEVBU0U7CisKKyAgICAgICAgIC8qIENoZWNrIGlmIHRoZSBmbG93IGJlaW5nIHJlbGVhc2VkIGlzIGZvciBiaS1kaXJldGlvbmFsLgorICAgICAgICAgICogRm9sbG93aW5nIGZsb3dzIG1heSBwcmVzZW50IGluIHRoZSBzeXN0ZW0uIAorICAgICAgICAgICogYSkgYmktZGlyZWN0aW9uYWwgZmxvd3MKKyAgICAgICAgICAqIGIpIHVwbGluayBmbG93cworICAgICAgICAgICogYykgZG93bmxpbmsgZmxvd3MuIAorICAgICAgICAgICogSWYgdGhlIGZsb3cgYmVpbmcgcmVsZWFzZWQgaXMgZm9yIGJpZGlyZWN0aW9uYWwsIHNwbGl0dGluZyBvZiBleGlzdGluZyAKKyAgICAgICAgICAqIHN0cmVhbXMgaW50byB0d28gdHNwZWMgaW5kaWNlcyBpcyByZXF1aXJlZCBpbiBjYXNlIGZmIChiKSwgKGMpIGFyZSBwcmVzZW50IAorICAgICAg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EZsb3dzUHJlc2VudCA9IFZPU19UUlVFOworCisgICAgICAgICAgIGlmKCFiaURpcmVjdGlvbmFsRmxvd3NQcmVzZW50KQorICAgICAgICAgICB7CisgICAgICAgICAgICAgLy8gVGhlIG9ubHkgZXhpc3RpbmcgYmlkaXJlY3Rpb25hbCBmbG93IGlzIGJlaW5nIHJlbGVhc2VkCisKKyAgICAgICAgICAgICAvLyBDaGVjayBpZiB1cGxpbmsgZmxvd3MgZXhpc3QKKyAgICAgICAgICAgICBzZWFyY2hfa2V5LmRpcmVjdGlvbiA9IFNNRV9RT1NfV01NX1RTX0RJUl9VUExJTks7CisgICAgICAgICAgICAgcFJlc3VsdCA9IHNtZV9Rb3NGaW5kSW5GbG93TGlzdChzZWFyY2hfa2V5KTsKKyAgICAgICAgICAgICBpZihwUmVzdWx0KQorICAgICAgICAgICAgICAgdXBsaW5rRmxvd3NQcmVzZW50ID0gVk9TX1RSVUU7CisKKyAgICAgICAgICAgICAvLyBDaGVjayBpZiBkb3dubGluayBmbG93cyBleGlzdAorICAgICAgICAgICAgIHNlYXJjaF9rZXkuZGlyZWN0aW9uID0gU01FX1FPU19XTU1fVFNfRElSX0RPV05MSU5LOworICAgICAgICAgICAgIHBSZXN1bHQgPSBzbWVfUW9zRmluZEluRmxvd0xpc3Qoc2VhcmNoX2tleSk7CisgICAgICAgICAgICAgaWYocFJlc3VsdCkKKyAgICAgICAgICAgICAgIGRvd25saW5rRmxvd3NQcmVzZW50ID0gVk9TX1RSVUU7CisKKyAgICAgICAgICAgICBpZih1cGxpbmtGbG93c1ByZXNlbnQgJiYgZG93bmxpbmtGbG93c1ByZXNlbnQpCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLy8gTmVlZCB0byBzcGxpdCB0aGUgdW5pLWRpcmVjdGlvbmFsIGZsb3dzIGludG8gU01FX1FPU19UU1BFQ19JTkRFWF8wIGFuZCBTTUVfUU9TX1RTUEVDX0lOREVYXzEKKworICAgICAgICAgICAgICAgdm9zX21lbV96ZXJvKCZzZWFyY2hfa2V5LCBzaXplb2Yoc21lX1Fvc1NlYXJjaEluZm8pKTsKKyAgICAgICAgICAgICAgIC8vIE1hcmsgYWxsIGRvd25zdHJlYW0gZmxvd3MgYXMgdXNpbmcgdHNwZWMgaW5kZXggMQorICAgICAgICAgICAgICAgc2VhcmNoX2tleS5rZXkuYWNfdHlwZSA9IGFjOworICAgICAgICAgICAgICAgc2VhcmNoX2tleS5pbmRleCA9IFNNRV9RT1NfU0VBUkNIX0tFWV9JTkRFWF80OworICAgICAgICAgICAgICAgc2VhcmNoX2tleS5zZXNzaW9uSWQgPSBzZXNzaW9uSWQ7CisgICAgICAgICAgICAgICBzZWFyY2hfa2V5LmRpcmVjdGlvbiA9IFNNRV9RT1NfV01NX1RTX0RJUl9ET1dOTElOSzsKKyAgICAgICAgICAgICAgIHNtZV9Rb3NVcGRhdGVUc3BlY01hc2soc2Vzc2lvbklkLCBzZWFyY2hfa2V5LCBTTUVfUU9TX1RTUEVDX01BU0tfQklUXzJfU0VUKTsKKworICAgICAgICAgICAgICAgLy8gQWdncmVnYXRlIGFsbCBkb3duc3RyZWFtIGZsb3dzCisgICAgICAgICAgICAgICBoc3RhdHVzID0gc21lX1Fvc1VwZGF0ZVBhcmFtcyhzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYywgU01FX1FPU19UU1BFQ19NQVNLX0JJVF8yX1NFVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZBZ2dyX1RzcGVjX0luZm8pOworCisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBPbiBzZXNzaW9uICVkIGJ1ZmZlcmluZyB0aGUgQWRkVFMgcmVxdWVzdCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgImZvciBBQyAlZCBpbiBzdGF0ZSAlZCBhcyBBZGR0cyBpcyBwZW5kaW5nICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAib24gb3RoZXIgVHNwZWMgaW5kZXggb2YgdGhpcyBBQyIsCisgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCwgYWMsIHBBQ0luZm8tPmN1cnJfc3RhdGUpOworCisgICAgICAgICAgICAgICAvLyBCdWZmZXIgdGhlIChhZ2dyZWdhdGVkKSB0c3BlYyByZXF1ZXN0IGZvciBkb3duc3RyZWFtIGZsb3dzLgorICAgICAgICAgICAgICAgLy8gUGxlYXNlIG5vdGUgdGhhdCB0aGUgKGFnZ3JlZ2F0ZWQpIHRzcGVjIGZvciB1cHN0cmVhbSBmbG93cyBpcyBzZW50IAorICAgICAgICAgICAgICAgLy8gb3V0IGJ5IHRoZSBzdXNlcXVlbnQgbG9naWMuCisgICAgICAgICAgICAgICBjbWQuY29tbWFuZCA9IFNNRV9RT1NfUkVTRU5EX1JFUTsKKyAgICAgICAgICAgICAgIGNtZC5wTWFjID0gcE1hYzsKKyAgICAgICAgICAgICAgIGNtZC5zZXNzaW9uSWQgPSBzZXNzaW9uSWQ7CisgICAgICAgICAgICAgICBjbWQudS5yZXNlbmRDbWRJbmZvLmFjID0gYWM7CisgICAgICAgICAgICAgICBjbWQudS5yZXNlbmRDbWRJbmZvLnRzcGVjTWFzayA9IFNNRV9RT1NfVFNQRUNfTUFTS19CSVRfMl9TRVQ7CisgICAgICAgICAgICAgICBjbWQudS5yZXNlbmRDbWRJbmZvLlFvU0luZm8gPSBBZ2dyX1RzcGVjX0luZm87CisgICAgICAgICAgICAgICBwQUNJbmZvLT5yZXF1ZXN0ZWRfUW9TSW5mb1tTTUVfUU9TX1RTUEVDX01BU0tfQklUXzJfU0VUIC0gMV0gPSBBZ2dyX1RzcGVjX0luZm87CisgICAgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHNtZV9Rb3NCdWZmZXJDbWQoJmNtZCwgVk9TX0ZBTFNFKSkpCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBPbiBzZXNzaW9uICVkIHVuYWJsZSB0byBidWZmZXIgdGhlIEFkZFRTICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAicmVxdWVzdCBmb3IgQUMgJWQgVFNQRUMgJWQgaW4gc3RhdGUgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uSWQsIGFjLCBTTUVfUU9TX1RTUEVDX01BU0tfQklUXzJfU0VULCBwQUNJbmZvLT5jdXJyX3N0YXRlKTsKKworICAgICAgICAgICAgICAgICAgLy8gdW5hYmxlIHRvIGJ1ZmZlciB0aGUgcmVxdWVzdAorICAgICAgICAgICAgICAgICAgLy8gbm90aGluZyBpcyBwZW5kaW5nIHNvIHZvdGUgcG93ZXJzYXZlIGJhY2sgb24KKyAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5yZWFkeUZvclBvd2VyU2F2ZSA9IFZPU19UUlVFOworCisgICAgICAgICAgICAgICAgICByZXR1cm4gU01FX1FPU19TVEFUVVNfTU9ESUZZX1NFVFVQX0ZBSUxVUkVfUlNQOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgcEFDSW5mby0+dHNwZWNfbWFza19zdGF0dXMgPSBTTUVfUU9TX1RTUEVDX01BU0tfQklUXzFfMl9TRVQ7CisKKyAgICAgICAgICAgICB9CisgICAgICAgICAgIH0KKyAgICAgICAgIH0KKworICAgICAgICAgLyogSW4gY2FzZSBvZiBzcGxpdHRpbmcgb2YgZXhpc3Rpbmcgc3RyZWFtcywKKyAgICAgICAgICAqIHRzcGVjX21hc2sgd2lsbCBiZSBwb2ludGluZyB0byB0c3BlYyBpbmRleCAwIGFuZCAKKyAgICAgICAgICAqIGFnZ3JlZ2F0ZWQgdHNwZWMgZm9yIHVwc3RyZWFtKHMpIGlzIHNlbnQgb3V0IGhlcmUuICovCisgICAgICAgICBoc3RhdHVzID0gc21lX1Fvc1VwZGF0ZVBhcmFtcyhzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYywgZmxvd19pbmZvLT50c3BlY19tYXNrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJkFnZ3JfVHNwZWNfSW5mbyk7CisgICAgICAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1MoaHN0YXR1cykpCisgICAgICAgICB7CisgICAgICAgICAgICBwQUNJbmZvLT5yZXF1ZXN0ZWRfUW9TSW5mb1tmbG93X2luZm8tPnRzcGVjX21hc2sgLSAxXSA9IEFnZ3JfVHNwZWNfSW5mbzsKKyAgICAgICAgICAgIC8vaWYgQUNNLCBzZW5kIG91dCBhIG5ldyBBRERUUworICAgICAgICAgICAgc3RhdHVzID0gc21lX1Fvc1NldHVwKHBNYWMsIHNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEFDSW5mby0+cmVxdWVzdGVkX1FvU0luZm9bZmxvd19pbmZvLT50c3BlY19tYXNrIC0gMV0sIGFjKTsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogT24gc2Vzc2lvbiAlZCB3aXRoIEFDICVkIGluIHN0YXRlIFNNRV9RT1NfUU9TX09OICIKKyAgICAgICAgICAgICAgICAgICAgICAic21lX1Fvc1NldHVwIHJldHVybmVkIHdpdGggc3RhdHVzICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkLCBhYywgc3RhdHVzKTsKKyAgICAgICAgICAgIGlmKFNNRV9RT1NfU1RBVFVTX1NFVFVQX1JFUV9QRU5ESU5HX1JTUCAhPSBzdGF0dXMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvLyB3ZSBhcmVuJ3Qgd2FpdGluZyBmb3IgYSByZXNwb25zZSBmcm9tIHRoZSBBUAorICAgICAgICAgICAgICAgLy8gc28gdm90ZSBwb3dlcnNhdmUgYmFjayBvbgorICAgICAgICAgICAgICAgcFNlc3Npb24tPnJlYWR5Rm9yUG93ZXJTYXZlID0gVk9TX1RSVUU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZihTTUVfUU9TX1NUQVRVU19TRVRVUF9SRVFfUEVORElOR19SU1AgPT0gc3RhdHVzKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIG5ld19zdGF0ZSA9IFNNRV9RT1NfUkVRVUVTVEVEOworICAgICAgICAgICAgICAgc3RhdHVzID0gU01FX1FPU19TVEFUVVNfUkVMRUFTRV9SRVFfUEVORElOR19SU1A7CisgICAgICAgICAgICAgICBwQUNJbmZvLT50c3BlY19wZW5kaW5nID0gZmxvd19pbmZvLT50c3BlY19tYXNrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZigoU01FX1FPU19TVEFUVVNfU0VUVVBfU1VDQ0VTU19OT19BQ01fTk9fQVBTRF9SU1AgPT0gc3RhdHVzKSB8fAorICAgICAgICAgICAgICAgICAgICAoU01FX1FPU19TVEFUVVNfU0VUVVBfU1VDQ0VTU19BUFNEX1NFVF9BTFJFQURZID09IHN0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBuZXdfc3RhdGUgPSBTTUVfUU9TX1FPU19PTjsKKyAgICAgICAgICAgICAgIHBBQ0luZm8tPm51bV9mbG93c1tmbG93X2luZm8tPnRzcGVjX21hc2sgLSAxXS0tOworICAgICAgICAgICAgICAgcEFDSW5mby0+Y3Vycl9Rb1NJbmZvW2Zsb3dfaW5mby0+dHNwZWNfbWFzayAtIDFdID0KKyAgICAgICAgICAgICAgICAgIHBBQ0luZm8tPnJlcXVlc3RlZF9Rb1NJbmZvW2Zsb3dfaW5mby0+dHNwZWNfbWFzayAtIDFdOworICAgICAgICAgICAgICAgLy9kZWxldGUgdGhlIGVudHJ5IGZyb20gRmxvdyBMaXN0CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsIAorICAgICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IERlbGV0aW5nIGVudHJ5IGF0ICVwIHdpdGggZmxvd0lEICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgICAgICAgICAgZmxvd19pbmZvLCBRb3NGbG93SUQpOworICAgICAgICAgICAgICAgY3NyTExSZW1vdmVFbnRyeSgmc21lX1Fvc0NiLmZsb3dfbGlzdCwgcEVudHJ5LCBWT1NfVFJVRSApOworICAgICAgICAgICAgICAgcERlbGV0ZWRGbG93ID0gZmxvd19pbmZvOworICAgICAgICAgICAgICAgaWYoU01FX1FPU19TVEFUVVNfU0VUVVBfU1VDQ0VTU19BUFNEX1NFVF9BTFJFQURZID09IHN0YXR1cykKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHZvc19tZW1femVybygmc2VhcmNoX2tleSwgc2l6ZW9mKHNtZV9Rb3NTZWFyY2hJbmZvKSk7CisgICAgICAgICAgICAgICAgICBzZWFyY2hfa2V5LmtleS5hY190eXBlID0gYWM7CisgICAgICAgICAgICAgICAgICBzZWFyY2hfa2V5LmluZGV4ID0gU01FX1FPU19TRUFSQ0hfS0VZX0lOREVYXzI7CisgICAgICAgICAgICAgICAgICBzZWFyY2hfa2V5LnNlc3Npb25JZCA9IHNlc3Npb25JZDsKKyAgICAgICAgICAgICAgICAgIGhzdGF0dXMgPSBzbWVfUW9zRmluZEFsbEluRmxvd0xpc3QocE1hYywgc2VhcmNoX2tleSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtZV9Rb3NTZXR1cEZucCk7CisgICAgICAgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKGhzdGF0dXMpKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IGNvdWxkbid0IG5vdGlmeSBvdGhlciAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImVudHJpZXMgb24gdGhpcyBBQyA9JWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywgYWMpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgc3RhdHVzID0gU01FX1FPU19TVEFUVVNfUkVMRUFTRV9TVUNDRVNTX1JTUDsKKyAgICAgICAgICAgICAgIGlmKGJ1ZmZlcmVkX2NtZCkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGZsb3dfaW5mby0+UW9TQ2FsbGJhY2socE1hYywgZmxvd19pbmZvLT5IRERjb250ZXh0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBQ0luZm8tPmN1cnJfUW9TSW5mb1tmbG93X2luZm8tPnRzcGVjX21hc2sgLSAxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG93X2luZm8tPlFvc0Zsb3dJRCk7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvLyB1bmV4cGVjdGVkIHN0YXR1cyByZXR1cm5lZCBieSBzbWVfUW9zU2V0dXAoKQorICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IE9uIHNlc3Npb24gJWQgdW5leHBlY3RlZCBzdGF0dXMgJWQgIgorICAgICAgICAgICAgICAgICAgICAgICAgICJyZXR1cm5lZCBieSBzbWVfUW9zU2V0dXAiLAorICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uSWQsIHN0YXR1cyk7CisgICAgICAgICAgICAgICBuZXdfc3RhdGUgPSBTTUVfUU9TX0xJTktfVVA7CisgICAgICAgICAgICAgICBwQUNJbmZvLT5udW1fZmxvd3NbZmxvd19pbmZvLT50c3BlY19tYXNrIC0gMV0tLTsKKyAgICAgICAgICAgICAgIHBBQ0luZm8tPmN1cnJfUW9TSW5mb1tmbG93X2luZm8tPnRzcGVjX21hc2sgLSAxXSA9CisgICAgICAgICAgICAgICAgICBwQUNJbmZvLT5yZXF1ZXN0ZWRfUW9TSW5mb1tmbG93X2luZm8tPnRzcGVjX21hc2sgLSAxXTsKKyAgICAgICAgICAgICAgIC8vZGVsZXRlIHRoZSBlbnRyeSBmcm9tIEZsb3cgTGlzdAorICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBPbiBzZXNzaW9uICVkIGRlbGV0aW5nIGVudHJ5IGF0ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAiJXAgd2l0aCBmbG93SUQgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uSWQsIGZsb3dfaW5mbywgUW9zRmxvd0lEKTsKKyAgICAgICAgICAgICAgIGNzckxMUmVtb3ZlRW50cnkoJnNtZV9Rb3NDYi5mbG93X2xpc3QsIHBFbnRyeSwgVk9TX1RSVUUgKTsKKyAgICAgICAgICAgICAgIHBEZWxldGVkRmxvdyA9IGZsb3dfaW5mbzsKKyAgICAgICAgICAgICAgIGlmKGJ1ZmZlcmVkX2NtZCkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGZsb3dfaW5mby0+UW9TQ2FsbGJhY2socE1hYywgZmxvd19pbmZvLT5IRERjb250ZXh0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBQ0luZm8tPmN1cnJfUW9TSW5mb1tmbG93X2luZm8tPnRzcGVjX21hc2sgLSAxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG93X2luZm8tPlFvc0Zsb3dJRCk7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICAvL2VyciBtc2cKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBzbWVfUW9zVXBkYXRlUGFyYW1zKCkgZmFpbGVkIiwKKyAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18pOworICAgICAgICAgICAgLy8gdW5hYmxlIHRvIHNlcnZpY2UgdGhlIHJlcXVlc3QKKyAgICAgICAgICAgIC8vIG5vdGhpbmcgaXMgcGVuZGluZyBzbyB2b3RlIHBvd2Vyc2F2ZSBiYWNrIG9uCisgICAgICAgICAgICBwU2Vzc2lvbi0+cmVhZHlGb3JQb3dlclNhdmUgPSBWT1NfVFJVRTsKKyAgICAgICAgICAgIG5ld19zdGF0ZSA9IFNNRV9RT1NfTElOS19VUDsKKyAgICAgICAgICAgIGlmKGJ1ZmZlcmVkX2NtZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGZsb3dfaW5mby0+UW9TQ2FsbGJhY2socE1hYywgZmxvd19pbmZvLT5IRERjb250ZXh0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBQ0luZm8tPmN1cnJfUW9TSW5mb1tmbG93X2luZm8tPnRzcGVjX21hc2sgLSAxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG93X2luZm8tPlFvc0Zsb3dJRCk7CisgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICAvLyB0aGlzIGlzIHRoZSBvbmx5IGZsb3cgYWdncmVnYXRlZCBpbiB0aGlzIFRTUEVDCisgICAgICAgICBzdGF0dXMgPSBTTUVfUU9TX1NUQVRVU19SRUxFQVNFX1NVQ0NFU1NfUlNQOworI2lmIGRlZmluZWQoRkVBVFVSRV9XTEFOX0VTRSkgJiYgIWRlZmluZWQoRkVBVFVSRV9XTEFOX0VTRV9VUExPQUQpCisgICAgICAgICBpZiAoYWMgPT0gU01FX1FPU19FRENBX0FDX1ZPKQorICAgICAgICAgeworICAgICAgICAgICAgLy8gSW5kaWNhdGUgdG8gbmVpZ2hib3Igcm9hbSBsb2dpYyBvZiB0aGUgbmV3IHJlcXVpcmVkIFZPCisgICAgICAgICAgICAvLyBhYyBiYW5kd2lkdGggcmVxdWlyZW1lbnQuCisgICAgICAgICAgICBjc3JOZWlnaGJvclJvYW1JbmRpY2F0ZVZvaWNlQlcoIHBNYWMsIHBBQ0luZm8tPmN1cnJfUW9TSW5mb1swXS5wZWFrX2RhdGFfcmF0ZSwgRkFMU0UgKTsKKyAgICAgICAgIH0KKyNlbmRpZgorICAgICAgICAgLy9jaGVjayBpZiBkZWx0cyBuZWVkcyB0byBiZSBzZW50CisgICAgICAgICBpZihDU1JfSVNfQUREVFNfV0hFTl9BQ01PRkZfU1VQUE9SVEVEKHBNYWMpIHx8CisgICAgICAgICAgICBzbWVfUW9zSXNBQ00ocE1hYywgcFNlc3Npb24tPmFzc29jSW5mby5wQnNzRGVzYywgYWMsIE5VTEwpKQorICAgICAgICAgeworICAgICAgICAgICAgLy9jaGVjayBpZiBvdGhlciBUU1BFQyBmb3IgdGhpcyBBQyBpcyBhbHNvIGluIHVzZQorICAgICAgICAgICAgaWYoU01FX1FPU19UU1BFQ19NQVNLX0JJVF8xXzJfU0VUICE9IHBBQ0luZm8tPnRzcGVjX21hc2tfc3RhdHVzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLy8gdGhpcyBpcyB0aGUgb25seSBUU1BFQyBhY3RpdmUgb24gdGhpcyBBQworICAgICAgICAgICAgICAgLy8gc28gaW5kaWNhdGUgdGhhdCB3ZSBubyBsb25nZXIgcmVxdWlyZSBBUFNECisgICAgICAgICAgICAgICBwU2Vzc2lvbi0+YXBzZE1hc2sgJj0gfigxIDw8IChTTUVfUU9TX0VEQ0FfQUNfVk8gLSBhYykpOworICAgICAgICAgICAgICAgLy9BbHNvIHVwZGF0ZSBtb2RpZnlQcm9maWxlRmllbGRzLnVhcHNkX21hc2sgaW4gQ1NSIGZvciBjb25zaXN0ZW5jeQorICAgICAgICAgICAgICAgY3NyR2V0TW9kaWZ5UHJvZmlsZUZpZWxkcyhwTWFjLCBmbG93X2luZm8tPnNlc3Npb25JZCwgJm1vZGlmeVByb2ZpbGVGaWVsZHMpOworICAgICAgICAgICAgICAgbW9kaWZ5UHJvZmlsZUZpZWxkcy51YXBzZF9tYXNrID0gcFNlc3Npb24tPmFwc2RNYXNrOyAKKyAgICAgICAgICAgICAgIGNzclNldE1vZGlmeVByb2ZpbGVGaWVsZHMocE1hYywgZmxvd19pbmZvLT5zZXNzaW9uSWQsICZtb2RpZnlQcm9maWxlRmllbGRzKTsKKyAgICAgICAgICAgICAgIGlmKCFwU2Vzc2lvbi0+YXBzZE1hc2spCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvLyB0aGlzIHNlc3Npb24gbm8gbG9uZ2VyIG5lZWRzIFVBUFNECisgICAgICAgICAgICAgICAgICAvLyBkbyBhbnkgc2Vzc2lvbnMgc3RpbGwgcmVxdWlyZSBVQVBTRD8KKyAgICAgICAgICAgICAgICAgIGlmICghc21lX1Fvc0lzVWFwc2RBY3RpdmUoKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgIC8vIE5vIHNlc3Npb25zIHJlcXVpcmUgVUFQU0Qgc28gdHVybiBpdCBvZmYKKyAgICAgICAgICAgICAgICAgICAgIC8vIChyZWFsbHkgZG9uJ3QgY2FyZSB3aGVuIFBNQyBzdG9wcyBpdCkKKyAgICAgICAgICAgICAgICAgICAgICh2b2lkKXBtY1N0b3BVYXBzZChwTWFjKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChTTUVfUU9TX1JFTEVBU0VfREVGQVVMVCA9PSBwQUNJbmZvLT5yZWxUcmlnKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLy9zZW5kIGRlbHRzCisgICAgICAgICAgICAgICBoc3RhdHVzID0gcW9zSXNzdWVDb21tYW5kKHBNYWMsIHNlc3Npb25JZCwgZVNtZUNvbW1hbmREZWxUcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwgYWMsIGZsb3dfaW5mby0+dHNwZWNfbWFzayk7CisgICAgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKGhzdGF0dXMpKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgLy9lcnIgbXNnCisgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBzbWVfUW9zRGVsVHNSZXEoKSBmYWlsZWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXyk7CisgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBTTUVfUU9TX1NUQVRVU19SRUxFQVNFX0ZBSUxVUkVfUlNQOworICAgICAgICAgICAgICAgICAgLy8gd2Ugd29uJ3QgYmUgd2FpdGluZyBmb3IgYSByZXNwb25zZSBmcm9tIHRoZSBBUAorICAgICAgICAgICAgICAgICAgLy8gc28gdm90ZSBwb3dlcnNhdmUgYmFjayBvbgorICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPnJlYWR5Rm9yUG93ZXJTYXZlID0gVk9TX1RSVUU7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBwQUNJbmZvLT50c3BlY19tYXNrX3N0YXR1cyAmPSBTTUVfUU9TX1RTUEVDX01BU0tfQklUXzFfMl9TRVQgJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKH5mbG93X2luZm8tPnRzcGVjX21hc2spOworICAgICAgICAgICAgICAgICAgZGVsdHNJc3N1ZWQgPSBWT1NfVFJVRTsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHBTZXNzaW9uLT5yZWFkeUZvclBvd2VyU2F2ZSA9IFZPU19UUlVFOworICAgICAgICAgICAgICAgcEFDSW5mby0+dHNwZWNfbWFza19zdGF0dXMgJj0gU01FX1FPU19UU1BFQ19NQVNLX0JJVF8xXzJfU0VUICYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAofmZsb3dfaW5mby0+dHNwZWNfbWFzayk7CisgICAgICAgICAgICAgICBkZWx0c0lzc3VlZCA9IFZPU19UUlVFOworICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICAgICAgZWxzZSBpZihwU2Vzc2lvbi0+YXBzZE1hc2sgJiAoMSA8PCAoU01FX1FPU19FRENBX0FDX1ZPIC0gYWMpKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIC8vcmVhc3NvYyBsb2dpYworICAgICAgICAgICAgY3NyR2V0TW9kaWZ5UHJvZmlsZUZpZWxkcyhwTWFjLCBzZXNzaW9uSWQsICZtb2RpZnlQcm9maWxlRmllbGRzKTsKKyAgICAgICAgICAgIG1vZGlmeVByb2ZpbGVGaWVsZHMudWFwc2RfbWFzayB8PSBwU2Vzc2lvbi0+YXBzZE1hc2s7CisgICAgICAgICAgICBtb2RpZnlQcm9maWxlRmllbGRzLnVhcHNkX21hc2sgJj0gfigxIDw8IChTTUVfUU9TX0VEQ0FfQUNfVk8gLSBhYykpOworICAgICAgICAgICAgcFNlc3Npb24tPmFwc2RNYXNrICY9IH4oMSA8PCAoU01FX1FPU19FRENBX0FDX1ZPIC0gYWMpKTsKKyAgICAgICAgICAgIGlmKCFwU2Vzc2lvbi0+YXBzZE1hc2spCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvLyB0aGlzIHNlc3Npb24gbm8gbG9uZ2VyIG5lZWRzIFVBUFNECisgICAgICAgICAgICAgICAvLyBkbyBhbnkgc2Vzc2lvbnMgc3RpbGwgcmVxdWlyZSBVQVBTRD8KKyAgICAgICAgICAgICAgIGlmICghc21lX1Fvc0lzVWFwc2RBY3RpdmUoKSkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8vIE5vIHNlc3Npb25zIHJlcXVpcmUgVUFQU0Qgc28gdHVybiBpdCBvZmYKKyAgICAgICAgICAgICAgICAgIC8vIChyZWFsbHkgZG9uJ3QgY2FyZSB3aGVuIFBNQyBzdG9wcyBpdCkKKyAgICAgICAgICAgICAgICAgICh2b2lkKXBtY1N0b3BVYXBzZChwTWFjKTsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGhzdGF0dXMgPSBzbWVfUW9zUmVxdWVzdFJlYXNzb2MocE1hYywgc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbW9kaWZ5UHJvZmlsZUZpZWxkcywgVk9TX0ZBTFNFKTsKKyAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1MoaHN0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvL2VyciBtc2cKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBSZWFzc29jIGZhaWxlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fKTsKKyAgICAgICAgICAgICAgIHN0YXR1cyA9IFNNRV9RT1NfU1RBVFVTX1JFTEVBU0VfRkFJTFVSRV9SU1A7CisgICAgICAgICAgICAgICAvLyB3ZSB3b24ndCBiZSB3YWl0aW5nIGZvciBhIHJlc3BvbnNlIGZyb20gdGhlIEFQCisgICAgICAgICAgICAgICAvLyBzbyB2b3RlIHBvd2Vyc2F2ZSBiYWNrIG9uCisgICAgICAgICAgICAgICBwU2Vzc2lvbi0+cmVhZHlGb3JQb3dlclNhdmUgPSBWT1NfVFJVRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHBBQ0luZm8tPnJlYXNzb2NfcGVuZGluZyA9IFZPU19GQUxTRTsvL25vIG5lZWQgdG8gd2FpdAorICAgICAgICAgICAgICAgcEFDSW5mby0+cHJldl9zdGF0ZSA9IFNNRV9RT1NfTElOS19VUDsKKyAgICAgICAgICAgICAgIHBBQ0luZm8tPnRzcGVjX3BlbmRpbmcgPSAwOworICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBub3RoaW5nIHRvIGRvIGZvciBBQyA9ICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sIGFjKTsKKyAgICAgICAgICAgIC8vIHdlIHdvbid0IGJlIHdhaXRpbmcgZm9yIGEgcmVzcG9uc2UgZnJvbSB0aGUgQVAKKyAgICAgICAgICAgIC8vIHNvIHZvdGUgcG93ZXJzYXZlIGJhY2sgb24KKyAgICAgICAgICAgIHBTZXNzaW9uLT5yZWFkeUZvclBvd2VyU2F2ZSA9IFZPU19UUlVFOworICAgICAgICAgfQorCisgICAgICAgICBpZiAoU01FX1FPU19SRUxFQVNFX0JZX0FQID09IHBBQ0luZm8tPnJlbFRyaWcpCisgICAgICAgICB7CisgICAgICAgICAgICBmbG93X2luZm8tPlFvU0NhbGxiYWNrKHBNYWMsIGZsb3dfaW5mby0+SEREY29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBQ0luZm8tPmN1cnJfUW9TSW5mb1tmbG93X2luZm8tPnRzcGVjX21hc2sgLSAxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgU01FX1FPU19TVEFUVVNfUkVMRUFTRV9RT1NfTE9TVF9JTkQsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb3dfaW5mby0+UW9zRmxvd0lEKTsKKworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IERlbGV0aW5nIGVudHJ5IGF0ICVwIHdpdGggZmxvd0lEICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgICAgICAgZmxvd19pbmZvLCBmbG93X2luZm8tPlFvc0Zsb3dJRCk7CisgICAgICAgICB9CisgICAgICAgICBlbHNlIGlmKGJ1ZmZlcmVkX2NtZCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGZsb3dfaW5mby0+UW9TQ2FsbGJhY2socE1hYywgZmxvd19pbmZvLT5IRERjb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb3dfaW5mby0+UW9zRmxvd0lEKTsKKyAgICAgICAgIH0KKworICAgICAgICAgaWYoU01FX1FPU19TVEFUVVNfUkVMRUFTRV9GQUlMVVJFX1JTUCA9PSBzdGF0dXMpCisgICAgICAgICB7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIH0KKworICAgICAgICAgaWYoKChTTUVfUU9TX1RTUEVDX01BU0tfQklUXzFfMl9TRVQgJiB+Zmxvd19pbmZvLT50c3BlY19tYXNrKSA+IDApICYmCisgICAgICAgICAgICAoKFNNRV9RT1NfVFNQRUNfTUFTS19CSVRfMV8yX1NFVCAmIH5mbG93X2luZm8tPnRzcGVjX21hc2spIDw9IAorICAgICAgICAgICAgICAgIFNNRV9RT1NfVFNQRUNfSU5ERVhfTUFYKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGlmKHBBQ0luZm8tPm51bV9mbG93c1soU01FX1FPU19UU1BFQ19NQVNLX0JJVF8xXzJfU0VUICYgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB+Zmxvd19pbmZvLT50c3BlY19tYXNrKSAtIDFdID4gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIG5ld19zdGF0ZSA9IFNNRV9RT1NfUU9TX09OOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgbmV3X3N0YXRlID0gU01FX1FPU19MSU5LX1VQOworICAgICAgICAgICAgfSAgICAgICAgIAorICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBFeGNlZWRlZCB0aGUgYXJyYXkgYm91bmRzIG9mIHBBQ0luZm8tPm51bV9mbG93cyIsCisgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fKTsKKyAgICAgICAgICAgIFZPU19BU1NFUlQgKDApOworICAgICAgICAgICAgcmV0dXJuIFNNRV9RT1NfU1RBVFVTX1JFTEVBU0VfSU5WQUxJRF9QQVJBTVNfUlNQOworICAgICAgICAgfQorCisgICAgICAgICBpZihWT1NfRkFMU0UgPT0gZGVsdHNJc3N1ZWQpCisgICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX3plcm8oJnBBQ0luZm8tPmN1cnJfUW9TSW5mb1tmbG93X2luZm8tPnRzcGVjX21hc2sgLSAxXSwgCisgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHNtZV9Rb3NXbW1Uc3BlY0luZm8pKTsKKyAgICAgICAgIH0KKyAgICAgICAgIHZvc19tZW1femVybygmcEFDSW5mby0+cmVxdWVzdGVkX1FvU0luZm9bZmxvd19pbmZvLT50c3BlY19tYXNrIC0gMV0sIAorICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihzbWVfUW9zV21tVHNwZWNJbmZvKSk7CisgICAgICAgICBwQUNJbmZvLT5udW1fZmxvd3NbZmxvd19pbmZvLT50c3BlY19tYXNrIC0gMV0tLTsKKyAgICAgICAgIC8vZGVsZXRlIHRoZSBlbnRyeSBmcm9tIEZsb3cgTGlzdAorICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAKKyAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBPbiBzZXNzaW9uICVkIGRlbGV0aW5nIGVudHJ5IGF0ICVwIHdpdGggZmxvd0lEICVkIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkLCBmbG93X2luZm8sIFFvc0Zsb3dJRCk7CisgICAgICAgICBjc3JMTFJlbW92ZUVudHJ5KCZzbWVfUW9zQ2IuZmxvd19saXN0LCBwRW50cnksIFZPU19UUlVFICk7CisgICAgICAgICBwRGVsZXRlZEZsb3cgPSBmbG93X2luZm87CisgICAgICAgICBwQUNJbmZvLT5yZWxUcmlnID0gU01FX1FPU19SRUxFQVNFX0RFRkFVTFQ7CisgICAgICB9CisgICAgICAvKiBpZiB3ZSBhcmUgZG9pbmcgcmVhc3NvYyAmIHdlIGFyZSBhbHJlYWR5IGluIGhhbmRvZmYgc3RhdGUsIG5vIG5lZWQKKyAgICAgICAgIHRvIG1vd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ICAgICAgICAgICAgICAgICAgICAgIFRTUEVDIHJlbGF0ZWQgaW5mbyBhcyBkZWZpbmVkIGFib3ZlCisgIFxwYXJhbSBhYyAtIEVudW1lcmF0aW9uIG9mIHRoZSB2YXJpb3VzIEVEQ0EgQWNjZXNzIENhdGVnb3JpZXMuCisgIAorICBccmV0dXJuIFNNRV9RT1NfU1RBVFVTX1NFVFVQX1NVQ0NFU1NfUlNQIGlmIHRoZSBzZXR1cCBpcyBzdWNjZXNzZnVsCisgIFRoZSBsb2dpYyB1c2VkIGluIHRoZSBjb2RlIG1pZ2h0IGJlIGNvbmZ1c2luZy4gVHJ5aW5nIHRvIGNvdmVyIGFsbCB0aGUgY2FzZXMgCisgIGhlcmUuCisgIEFQIHN1cHBvcnRzICBBcHAgd2FudHMgICBBQ00gPSAxICBBbHJlYWR5IHNldCBBUFNEICAgUmVzdWx0CisgIHwgICAgMCAgICAgfCAgICAwICAgICB8ICAgICAwICAgfCAgICAgICAwICAgICAgICAgIHwgIE5PIEFDTSBOTyBBUFNECisgIHwgICAgMCAgICAgfCAgICAwICAgICB8ICAgICAwICAgfCAgICAgICAxICAgICAgICAgIHwgIE5PIEFDTSBOTyBBUFNEL0lOVkFMSUQKKyAgfCAgICAwICAgICB8ICAgIDAgICAgIHwgICAgIDEgICB8ICAgICAgIDAgICAgICAgICAgfCAgQUREVFMKKyAgfCAgICAwICAgICB8ICAgIDAgICAgIHwgICAgIDEgICB8ICAgICAgIDEgICAgICAgICAgfCAgQUREVFMKKyAgfCAgICAwICAgICB8ICAgIDEgICAgIHwgICAgIDAgICB8ICAgICAgIDAgICAgICAgICAgfCAgRkFJTFVSRQorICB8ICAgIDAgICAgIHwgICAgMSAgICAgfCAgICAgMCAgIHwgICAgICAgMSAgICAgICAgICB8ICBJTlZBTElECisgIHwgICAgMCAgICAgfCAgICAxICAgICB8ICAgICAxICAgfCAgICAgICAwICAgICAgICAgIHwgIEFERFRTCisgIHwgICAgMCAgICAgfCAgICAxICAgICB8ICAgICAxICAgfCAgICAgICAxICAgICAgICAgIHwgIEFERFRTCisgIHwgICAgMSAgICAgfCAgICAwICAgICB8ICAgICAwICAgfCAgICAgICAwICAgICAgICAgIHwgIE5PIEFDTSBOTyBBUFNECisgIHwgICAgMSAgICAgfCAgICAwICAgICB8ICAgICAwICAgfCAgICAgICAxICAgICAgICAgIHwgIE5PIEFDTSBOTyBBUFNECisgIHwgICAgMSAgICAgfCAgICAwICAgICB8ICAgICAxICAgfCAgICAgICAwICAgICAgICAgIHwgIEFERFRTCisgIHwgICAgMSAgICAgfCAgICAwICAgICB8ICAgICAxICAgfCAgICAgICAxICAgICAgICAgIHwgIEFERFRTCisgIHwgICAgMSAgICAgfCAgICAxICAgICB8ICAgICAwICAgfCAgICAgICAwICAgICAgICAgIHwgIFJFQVNTT0MKKyAgfCAgICAxICAgICB8ICAgIDEgICAgIHwgICAgIDAgICB8ICAgICAgIDEgICAgICAgICAgfCAgTk9QOiBBUFNEIFNFVCBBTFJFQURZCisgIHwgICAgMSAgICAgfCAgICAxICAgICB8ICAgICAxICAgfCAgICAgICAwICAgICAgICAgIHwgIEFERFRTCisgIHwgICAgMSAgICAgfCAgICAxICAgICB8ICAgICAxICAgfCAgICAgICAxICAgICAgICAgIHwgIEFERFRTCisgIAorICBcc2EKKyAgCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KK3NtZV9Rb3NTdGF0dXNUeXBlIHNtZV9Rb3NTZXR1cCh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21lX1Fvc1dtbVRzcGVjSW5mbyAqcFRzcGVjX0luZm8sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtZV9Rb3NFZGNh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b2NJbmZvLnBCc3NEZXNjKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICIlczogJWQ6IFNlc3Npb24gJWQgaGFzIGFuIEludmFsaWQgQlNTIERlc2NyaXB0b3IiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICBzZXNzaW9uSWQpOworICAgICAgcmV0dXJuIHN0YXR1czsKKyAgIH0KKyAgIGhzdGF0dXMgPSBjc3JHZXRQYXJzZWRCc3NEZXNjcmlwdGlvbklFcyhwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5hc3NvY0luZm8ucEJzc0Rlc2MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBJZXMpOworICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhoc3RhdHVzKSkKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogJWQ6IE9uIHNlc3Npb24gJWQgdW5hYmxlIHRvIHBhcnNlIEJTUyBJRXMiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICBzZXNzaW9uSWQpOworICAgICAgcmV0dXJuIHN0YXR1czsKKyAgIH0KKworICAgLyogc3VjY2VzcyBzbyBwSWVzIHdhcyBhbGxvY2F0ZWQgKi8KKworICAgaWYoICFDU1JfSVNfUU9TX0JTUyhwSWVzKSApCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgIiVzOiAlZDogT24gc2Vzc2l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xfSU5GT19ISUdILCAKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBSZXF1ZXN0IGlzIGxvb2tpbmcgZm9yIEFQU0QgYnV0IFBNQyBkb2Vzbid0ICIKKyAgICAgICAgICAgICAgICAgICAgICAiaGF2ZSBzdXBwb3J0IGZvciBBUFNEIiwKKyAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18pOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisKKyAgICAgICAgIGlmIChwVHNwZWNfSW5mby0+dHNfaW5mby5wc2IgJiYKKyAgICAgICAgICAgICAhKHBJZXMtPldNTVBhcmFtcy5xb3NJbmZvICYgU01FX1FPU19BUF9TVVBQT1JUU19BUFNEKSAmJgorICAgICAgICAgICAgICEocEllcy0+V01NSW5mb0FwLnVhcHNkKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIC8vIGFwcGxpY2F0aW9uIGlzIGxvb2tpbmcgZm9yIEFQU0QgYnV0IEFQIGRvZXNuJ3Qgc3VwcG9ydCBpdAorICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogT24gc2Vzc2lvbiAlZCBBUCBkb2Vzbid0IHN1cHBvcnQgQVBTRCIsCisgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIH0KKworICAgICAgICAgaWYoU01FX1FPU19NQVhfVElEID09IHBUc3BlY19JbmZvLT50c19pbmZvLnRpZCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIC8vQXBwIGRpZG4ndCBzZXQgVElELCBnZW5lcmF0ZSBvbmUKKyAgICAgICAgICAgIHBUc3BlY19JbmZvLT50c19pbmZvLnRpZCA9CisgICAgICAgICAgICAgICAodl9VOF90KShTTUVfUU9TX1dNTV9VUF9OQyAtIHBUc3BlY19JbmZvLT50c19pbmZvLnVwKTsKKyAgICAgICAgIH0KKyAgICAgICAgIC8vYWRkdHMgbG9naWMKKyAgICAgICAgIGhzdGF0dXMgPSBxb3NJc3N1ZUNvbW1hbmQocE1hYywgc2Vzc2lvbklkLCBlU21lQ29tbWFuZEFkZFRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVHNwZWNfSW5mbywgYWMsIDApOworICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhoc3RhdHVzKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBzbWVfUW9zQWRkVHNSZXEoKSBmYWlsZWQiLAorICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXyk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIH0KKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBPbiBzZXNzaW9uICVkIEFkZFRTIG9uIEFDICVkIGlzIHBlbmRpbmciLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICBzZXNzaW9uSWQsIGFjKTsKKyAgICAgICAgIHN0YXR1cyA9IFNNRV9RT1NfU1RBVFVTX1NFVFVQX1JFUV9QRU5ESU5HX1JTUDsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgLy8gQUNNIGlzIG5vdCBlbmFibGVkIGZvciB0aGlzIEFDCisgICAgICAvLyBJcyB0aGUgYXBwbGljYXRpb24gbG9va2luZyBmb3IgQVBTRD8KKyAgICAgIGlmKDAgPT0gcFRzcGVjX0luZm8tPnRzX2luZm8ucHNiKQorICAgICAgeworICAgICAgICAgLy9ubywgd2UgZG9uJ3QgbmVlZCBBUFNECisgICAgICAgICAvL2J1dCBjaGVjayB0aGUgY2FzZSwgaWYgdGhlIHNldHVwIGlzIGNhbGxlZCBhcyBhIHJlc3VsdCBvZiBhIHJlbGVhc2UgCisgICAgICAgICAvLyBvciBtb2RpZnkgd2hpY2ggYm9pbHMgZG93biB0byB0aGUgZmFjdCB0aGF0IEFQU0Qgd2FzIHNldCBvbiB0aGlzIEFDCisgICAgICAgICAvLyBidXQgbm8gbG9uZ2VyIG5lZWRlZCAtIHNvIHdlIG5lZWQgYSByZWFzc29jIGZvciB0aGUgYWJvdmUgY2FzZSB0byAKKyAgICAgICAgIC8vIGxldCB0aGUgQVAga25vdworICAgICAgICAgaWYocFNlc3Npb24tPmFwc2RNYXNrICYgKDEgPDwgKFNNRV9RT1NfRURDQV9BQ19WTyAtIGFjKSkpCisgICAgICAgICB7CisgICAgICAgICAgICAvLyBBUFNEIHdhcyBmb3JtZXJseSBlbmFibGVkIG9uIHRoaXMgQUMgYnV0IGlzIG5vIGxvbmdlciByZXF1aXJlZAorICAgICAgICAgICAgLy8gc28gd2UgbXVzdCByZWFzc29jaWF0ZQorICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBPbiBzZXNzaW9uICVkIHJlYXNzb2MgbmVlZGVkICIKKyAgICAgICAgICAgICAgICAgICAgICAidG8gZGlzYWJsZSBBUFNEIG9uIEFDICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkLCBhYyk7CisgICAgICAgICAgICBjc3JHZXRNb2RpZnlQcm9maWxlRmllbGRzKHBNYWMsIHNlc3Npb25JZCwgJm1vZGlmeVByb2ZpbGVGaWVsZHMpOworICAgICAgICAgICAgbW9kaWZ5UHJvZmlsZUZpZWxkcy51YXBzZF9tYXNrIHw9IHBTZXNzaW9uLT5hcHNkTWFzazsKKyAgICAgICAgICAgIG1vZGlmeVByb2ZpbGVGaWVsZHMudWFwc2RfbWFzayAmPSB+KDEgPDwgKFNNRV9RT1NfRURDQV9BQ19WTyAtIGFjKSk7CisgICAgICAgICAgICBoc3RhdHVzID0gc21lX1Fvc1JlcXVlc3RSZWFzc29jKHBNYWMsIHNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm1vZGlmeVByb2ZpbGVGaWVsZHMsIFZPU19GQUxTRSk7CisgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKGhzdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLy9lcnIgbXNnCisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogVW5hYmxlIHRvIHJlcXVlc3QgcmVhc3NvY2lhdGlvbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fKTsKKyAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IE9uIHNlc3Npb24gJWQgcmVhc3NvY2lhdGlvbiB0byBlbmFibGUgIgorICAgICAgICAgICAgICAgICAgICAgICAgICJBUFNEIG9uIEFDICVkIGlzIHBlbmRpbmciLAorICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uSWQsIGFjKTsKKyAgICAgICAgICAgICAgIHN0YXR1cyA9IFNNRV9RT1NfU1RBVFVTX1NFVFVQX1JFUV9QRU5ESU5HX1JTUDsKKyAgICAgICAgICAgICAgIHBBQ0luZm8tPnJlYXNzb2NfcGVuZGluZyA9IFZPU19UUlVFOworICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgLy8gd2UgZG9uJ3QgbmVlZCBBUFNEIG9uIHRoaXMgQUMKKyAgICAgICAgICAgIC8vIGFuZCB3ZSBkb24ndCBjdXJyZW50bHkgaGF2ZSBBUFNEIG9uIHRoaXMgQUMKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogUmVxdWVzdCBpcyBub3QgbG9va2luZyBmb3IgQVBTRCAmIEFkbWlzc2lvbiAiCisgICAgICAgICAgICAgICAgICAgICAgIkNvbnRyb2wgaXNuJ3QgbWFuZGF0b3J5IGZvciB0aGUgQUMiLAorICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXyk7CisgICAgICAgICAgICAvL3JldHVybiBzdWNjZXNzIHJpZ2h0IGF3YXkKKyAgICAgICAgICAgIHN0YXR1cyA9IFNNRV9RT1NfU1RBVFVTX1NFVFVQX1NVQ0NFU1NfTk9fQUNNX05PX0FQU0RfUlNQOworICAgICAgICAgfQorICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBlbHNlIGlmKCEocEllcy0+V01NUGFyYW1zLnFvc0luZm8gJiBTTUVfUU9TX0FQX1NVUFBPUlRTX0FQU0QpICYmCisgICAgICAgICAgICAgICEocEllcy0+V01NSW5mb0FwLnVhcHNkKSkKKyAgICAgIHsKKyAgICAgICAgIC8vIGFwcGxpY2F0aW9uIGlzIGxvb2tpbmcgZm9yIEFQU0QgYnV0IEFQIGRvZXNuJ3Qgc3VwcG9ydCBpdAorICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICIlczogJWQ6IE9uIHNlc3Npb24gJWQgQVAgZG9lc24ndCBzdXBwb3J0IEFQU0QiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICBzZXNzaW9uSWQpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBlbHNlIGlmKHBTZXNzaW9uLT5hcHNkTWFzayAmICgxIDw8IChTTUVfUU9TX0VEQ0FfQUNfVk8gLSBhYykpKQorICAgICAgeworICAgICAgICAgLy8gYXBwbGljYXRpb24gaXMgbG9va2luZyBmb3IgQVBTRAorICAgICAgICAgLy8gYW5kIGl0IGlzIGFscmVhZHkgZW5hYmxlZCBvbiB0aGlzIEFDCisgICAgICAgICBzdGF0dXMgPSBTTUVfUU9TX1NUQVRVU19TRVRVUF9TVUNDRVNTX0FQU0RfU0VUX0FMUkVBRFk7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsIAorICAgICAgICAgICAgICAgICAgICIlczogJWQ6IFJlcXVlc3QgaXMgbG9va2luZyBmb3IgQVBTRCBhbmQgaXQgaXMgYWxyZWFkeSAiCisgICAgICAgICAgICAgICAgICAgInNldCBmb3IgdGhlIEFDIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18pOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICAvLyBhcHBsaWNhdGlvbiBpcyBsb29raW5nIGZvciBBUFNECisgICAgICAgICAvLyBidXQgaXQgaXMgbm90IGVuYWJsZWQgb24gdGhpcyBBQworICAgICAgICAgLy8gc28gd2UgbmVlZCB0byByZWFzc29jaWF0ZQorICAgICAgICAgaWYocE1hYy0+cG1jLnVhcHNkRW5hYmxlZCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogT24gc2Vzc2lvbiAlZCByZWFzc29jIG5lZWRlZCAiCisgICAgICAgICAgICAgICAgICAgICAgInRvIGVuYWJsZSBBUFNEIG9uIEFDICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkLCBhYyk7CisgICAgICAgICAgICAvL3JlYXNzb2MgbG9naWMKKyAgICAgICAgICAgIC8vIHVwZGF0ZSB0aGUgVUFQU0QgbWFzayB0byBpbmNsdWRlIHRoZSBuZXcgCisgICAgICAgICAgICAvLyBBQyBvbiB3aGljaCBBUFNEIGlzIHJlcXVlc3RlZAorICAgICAgICAgICAgY3NyR2V0TW9kaWZ5UHJvZmlsZUZpZWxkcyhwTWFjLCBzZXNzaW9uSWQsICZtb2RpZnlQcm9maWxlRmllbGRzKTsKKyAgICAgICAgICAgIG1vZGlmeVByb2ZpbGVGaWVsZHMudWFwc2RfbWFzayB8PSBwU2Vzc2lvbi0+YXBzZE1hc2s7CisgICAgICAgICAgICBtb2RpZnlQcm9maWxlRmllbGRzLnVhcHNkX21hc2sgfD0gMSA8PCAoU01FX1FPU19FRENBX0FDX1ZPIC0gYWMpOworICAgICAgICAgICAgaHN0YXR1cyA9IHNtZV9Rb3NSZXF1ZXN0UmVhc3NvYyhwTWFjLCBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZtb2RpZnlQcm9maWxlRmllbGRzLCBWT1NfRkFMU0UpOworICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhoc3RhdHVzKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8vZXJyIG1zZworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IFVuYWJsZSB0byByZXF1ZXN0IHJlYXNzb2NpYXRpb24iLAorICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXyk7CisgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBPbiBzZXNzaW9uICVkIHJlYXNzb2NpYXRpb24gdG8gZW5hYmxlICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAiQVBTRCBvbiBBQyAlZCBpcyBwZW5kaW5nIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkLCBhYyk7CisgICAgICAgICAgICAgICBzdGF0dXMgPSBTTUVfUU9TX1NUQVRVU19TRVRVUF9SRVFfUEVORElOR19SU1A7CisgICAgICAgICAgICAgICBwQUNJbmZvLT5yZWFzc29jX3BlbmRpbmcgPSBWT1NfVFJVRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UKKyAgICAgICAgIHsKKy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AgICAgdHNwZWNfbWFza19zdGF0dXMgPSBwQUNJbmZvLT50c3BlY19tYXNrX3N0YXR1czsKKworICAgICAgICBkbyB7CisgICAgICAgICAgICBpZiAodHNwZWNfbWFza19zdGF0dXMgJiBTTUVfUU9TX1RTUEVDX01BU0tfQklUXzFfU0VUKSB7CisgICAgICAgICAgICAgICAgLyogSWYgYSB0c3BlYyBzdGF0dXMgaXMgcGVuZGluZywgdGFrZSByZXF1ZXN0ZWRfUW9TSW5mbyBmb3IgUklDIHJlcXVlc3QsIGVsc2UgdXNlIGN1cnJfUW9TSW5mbworICAgICAgICAgICAgICAgICAgIGZvciB0aGUgUklDIHJlcXVlc3QgKi8KKyAgICAgICAgICAgICAgICBpZiAodHNwZWNfcGVuZGluZ19zdGF0dXMgJiBTTUVfUU9TX1RTUEVDX01BU0tfQklUXzFfU0VUKSB7CisgICAgICAgICAgICAgICAgICAgIHNtZV9Rb3NDb3B5VHNwZWNJbmZvKHBNYWMsICZwQUNJbmZvLT5yZXF1ZXN0ZWRfUW9TSW5mb1t0c3BlY19pbmRleF0sICZwRHN0VHNwZWMtPnRzcGVjKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBzbWVfUW9zQ29weVRzcGVjSW5mbyhwTWFjLCAmcEFDSW5mby0+Y3Vycl9Rb1NJbmZvW3RzcGVjX2luZGV4XSwgJnBEc3RUc3BlYy0+dHNwZWMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwRHN0VHNwZWMtPnZhbGlkID0gVFJVRTsKKyAgICAgICAgICAgICAgICBudW1Uc3BlY3MrKzsKKyAgICAgICAgICAgICAgICBwRHN0VHNwZWMrKzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHRzcGVjX21hc2tfc3RhdHVzID4+PSAxOworICAgICAgICAgICAgdHNwZWNfcGVuZGluZ19zdGF0dXMgPj49IDE7CisgICAgICAgICAgICB0c3BlY19pbmRleCsrOworICAgICAg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25seSAqLworICAgIHBFbnRyeSA9IGNzckxMUGVla0hlYWQoICZzbWVfUW9zQ2IuZmxvd19saXN0LCBWT1NfRkFMU0UgKTsKKyAgICBpZighcEVudHJ5KQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgICAiJXM6ICVkOiBGbG93IExpc3QgZW1wdHksIG5vdGhpbmcgdG8gdXBkYXRlIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18pOworICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICB9CisKKyAgICBkbworICAgIHsKKyAgICAgICAgZmxvd19pbmZvID0gR0VUX0JBU0VfQUREUiggcEVudHJ5LCBzbWVfUW9zRmxvd0luZm9FbnRyeSwgbGluayApOworICAgICAgICBpZihzZXNzaW9uSWQgPT0gZmxvd19pbmZvLT5zZXNzaW9uSWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogQ2hhbmdpbmcgRmxvd0lEICVkIHJlYXNvbiB0byBTRVRVUCBhbmQgSE8gcmVuZXdhbCB0byBGQUxTRSIsCisgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICAgZmxvd19pbmZvLT5Rb3NGbG93SUQpOworICAgICAgICAgICAgZmxvd19pbmZvLT5yZWFzb24gPSBTTUVfUU9TX1JFQVNPTl9TRVRVUDsKKyAgICAgICAgICAgIGZsb3dfaW5mby0+aG9SZW5ld2FsID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgIH0KKyAgICAgICAgcEVudHJ5ID0gY3NyTExOZXh0KCAmc21lX1Fvc0NiLm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ICAgIH0KKworICAgIHZvc19tZW1femVybyhwTXNnLCBzaXplb2YodFNpckFnZ3JRb3NSZXEpKTsKKworICAgIHBNc2ctPm1lc3NhZ2VUeXBlID0gcGFsX2NwdV90b19iZTE2KCh2X1UxNl90KWVXTklfU01FX0ZUX0FHR1JfUU9TX1JFUSk7CisgICAgcE1zZy0+bGVuZ3RoID0gc2l6ZW9mKHRTaXJBZ2dyUW9zUmVxKTsKKyAgICBwTXNnLT5zZXNzaW9uSWQgPSBzZXNzaW9uSWQ7CisgICAgcE1zZy0+dGltZW91dCA9IDA7CisgICAgcE1zZy0+cnNwUmVxZCA9IFZPU19UUlVFOworICAgIHZvc19tZW1fY29weSggJnBNc2ctPmJzc0lkWyAwIF0sCisgICAgICAgICAgICAmcFNlc3Npb24tPmFzc29jSW5mby5wQnNzRGVzYy0+YnNzSWRbIDAgXSwKKyAgICAgICAgICAgIHNpemVvZih0Q3NyQnNzaWQpICk7CisKKyAgICBmb3IoIGkgPSAwOyBpIDwgU01FX1FPU19FRENBX0FDX01BWDsgaSsrICkKKyAgICB7CisgICAgICAgIGZvciggaiA9IDA7IGogPCBTTUVfUU9TX1RTUEVDX0lOREVYX01BWDsgaisrICkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgRkwoImFjPSVkLCB0c3BlY19tYXNrX3N0YXVzPSV4LCB0c3BlY19pbmRleD0lZCIpLAorICAgICAgICAgICAgICAgICAgICBpLCBwU2Vzc2lvbi0+YWNfaW5mb1tpXS50c3BlY19tYXNrX3N0YXR1cywgaik7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCAKKyAgICAgICAgICAgICAgICAgICAgRkwoImRpcmVjdGlvbiA9ICVkIiksIHBTZXNzaW9uLT5hY19pbmZvW2ldLmFkZFRzUnNwW2pdLnJzcC50c3BlYy50c2luZm8udHJhZmZpYy5kaXJlY3Rpb24pOworICAgICAgICAgICAgLy8gQ2hlY2sgaWYgYW55IGZsb3cgaXMgYWN0aXZlIG9uIHRoaXMgQUMKKyAgICAgICAgICAgIGlmICgocFNlc3Npb24tPmFjX2luZm9baV0udHNwZWNfbWFza19zdGF0dXMpICYgKDEgPDwgaikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdEFOSV9VOCBkaXJlY3Rpb24gPSBwU2Vzc2lvbi0+YWNfaW5mb1tpXS5hZGRUc1JzcFtqXS5yc3AudHNwZWMudHNpbmZvLnRyYWZmaWMuZGlyZWN0aW9uOworICAgICAgICAgICAgICAgIGlmICgoZGlyZWN0aW9uID09IFNNRV9RT1NfV01NX1RTX0RJUl9VUExJTkspIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAoZGlyZWN0aW9uID09IFNNRV9RT1NfV01NX1RTX0RJUl9CT1RIKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJGb3VuZCB0c3BlYyBlbnRyeSBBQz0lZCwgZmxvdz0lZCwgZGlyZWN0aW9uID0gJWQiKSwgaSwgaiwgZGlyZWN0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgcE1zZy0+YWdnckluZm8uYWdnckFkZFRzSW5mb1tpXS5kaWFsb2dUb2tlbiA9CisgICAgICAgICAgICAgICAgICAgICAgICBzbWVfUW9zQXNzaWduRGlhbG9nVG9rZW4oKTsKKyAgICAgICAgICAgICAgICAgICAgcE1zZy0+YWdnckluZm8uYWdnckFkZFRzSW5mb1tpXS5sbGVUc3BlY1ByZXNlbnQgPQorICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPmFjX2luZm9baV0uYWRkVHNSc3Bbal0ucnNwLmxsZVRzcGVjUHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgcE1zZy0+YWdnckluZm8uYWdnckFkZFRzSW5mb1tpXS5udW1UY2xhcyA9CisgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+YWNfaW5mb1tpXS5hZGRUc1JzcFtqXS5yc3AubnVtVGNsYXM7CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSggcE1zZy0+YWdnckluZm8uYWdnckFkZFRzSW5mb1tpXS50Y2xhc0luZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPmFjX2luZm9baV0uYWRkVHNSc3Bbal0ucnNwLnRjbGFzSW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX1RDTEFTSUVfTUFYTlVNICk7CisgICAgICAgICAgICAgICAgICAgIHBNc2ctPmFnZ3JJbmZvLmFnZ3JBZGRUc0luZm9baV0udGNsYXNQcm9jID0KKyAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5hY19pbmZvW2ldLmFkZFRzUnNwW2pdLnJzcC50Y2xhc1Byb2M7CisgICAgICAgICAgICAgICAgICAgIHBNc2ctPmFnZ3JJbmZvLmFnZ3JBZGRUc0luZm9baV0udGNsYXNQcm9jUHJlc2VudCA9CisgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+YWNfaW5mb1tpXS5hZGRUc1JzcFtqXS5yc3AudGNsYXNQcm9jUHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgcE1zZy0+YWdnckluZm8uYWdnckFkZFRzSW5mb1tpXS50c3BlYyA9CisgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+YWNfaW5mb1tpXS5hZGRUc1JzcFtqXS5yc3AudHNwZWM7CisgICAgICAgICAgICAgICAgICAgIHBNc2ctPmFnZ3JJbmZvLmFnZ3JBZGRUc0luZm9baV0ud21lVHNwZWNQcmVzZW50ID0KKyAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5hY19pbmZvW2ldLmFkZFRzUnNwW2pdLnJzcC53bWVUc3BlY1ByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIHBNc2ctPmFnZ3JJbmZvLmFnZ3JBZGRUc0luZm9baV0ud3NtVHNwZWNQcmVzZW50ID0KKyAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5hY19pbmZvW2ldLmFkZFRzUnNwW2pdLnJzcC53c21Uc3BlY1ByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIHBNc2ctPmFnZ3JJbmZvLnRzcGVjSWR4IHw9ICggMSA8PCBpICk7CisKKyAgICAgICAgICAgICAgICAgICAgLy8gTWFyayB0aGUgaW5kZXggZm9yIHRoaXMgQUMgYXMgcGVuZGluZyBmb3IgcmVzcG9uc2UsIHdoaWNoIHdvdWxkIGJlIAorICAgICAgICAgICAgICAgICAgICAvLyB1c2VkIHRvIHZhbGlkYXRlIHRoZSBBZGRUUyByZXNwb25zZSBmcm9tIEhBTC0+UEUtPlNNRQorICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+YWNfaW5mb1tpXS50c3BlY19wZW5kaW5nID0gKDE8PGopOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sIAorICAgICAgICAgICAgIlNlbmRpbmcgYWdncmVnYXRlZCBtZXNzYWdlIHRvIEhBTCAweCV4IiwgcE1zZy0+YWdnckluZm8udHNwZWNJZHgpOworCisgICAgaWYoSEFMX1NUQVRVU19TVUNDRVNTKHBhbFNlbmRNQk1lc3NhZ2UocE1hYy0+aEhkZCwgcE1zZykpKQorICAgIHsKKyAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgIC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sIGZsb3c9JWQgZGlyPSVkLCB0c3BlY0lkeD0leCIpLAorICAgICAgICAgICAgICAgICAgICBpLCBqLCBkaXJlY3Rpb24sIHBBZ2dyUnNwLT5hZ2dySW5mby50c3BlY0lkeCk7CisgICAgICAgICAgICAvLyBDaGVjayBpZiB0aGUgZGlyZWN0aW9uIGlzIFVwbGluayBvciBiaS1kaXJlY3Rpb25hbAorICAgICAgICAgICAgaWYoICgoMTw8aSkgJiBwQWdnclJzcC0+YWdnckluZm8udHNwZWNJZHgpICYmCisgICAgICAgICAgICAgICAgICAgICgodHNwZWNfbWFza19zdGF0dXMpICYgKDE8PGopKSAmJgorICAgICAgICAgICAgICAgICAgICAoKGRpcmVjdGlvbiA9PSBTTUVfUU9TX1dNTV9UU19ESVJfVVBMSU5LKSB8fAorICAgICAgICAgICAgICAgICAgICAgKGRpcmVjdGlvbiA9PSBTTUVfUU9TX1dNTV9UU19ESVJfQk9USCkpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGFkZHRzUnNwID0gc21lX1Fvc0NiLnNlc3Npb25JbmZvW3Nlc3Npb25JZF0uYWNfaW5mb1tpXS5hZGRUc1JzcFtqXTsKKyAgICAgICAgICAgICAgICBhZGR0c1JzcC5yYyA9IHBBZ2dyUnNwLT5hZ2dySW5mby5hZ2dyUnNwW2ldLnN0YXR1czsKKyAgICAgICAgICAgICAgICBhZGR0c1JzcC5yc3Auc3RhdHVzID0gcEFnZ3JSc3AtPmFnZ3JJbmZvLmFnZ3JSc3BbaV0uc3RhdHVzOworICAgICAgICAgICAgICAgIGFkZHRzUnNwLnJzcC50c3BlYyA9IHBBZ2dyUnNwLT5hZ2dySW5mby5hZ2dyUnNwW2ldLnRzcGVjOworCisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJQcm9jZXNzaW5nIEFkZHRzIHJz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bmRleCA9IDA7IHRzcGVjX2Zsb3dfaW5kZXggPCBTTUVfUU9TX1RTUEVDX0lOREVYX01BWDsgdHNwZWNfZmxvd19pbmRleCsrKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBPbmx5IGluIHRoZSBiZWxvdyBjYXNlLCBjb3B5IHRoZSBBQydzIGN1cnIgUW9TIEluZm8gdG8gcmVxdWVzdGVkIFFvUyBpbmZvICovCisgICAgICAgICAgICBpZiAocEFDSW5mby0+cmljSWRlbnRpZmllclt0c3BlY19mbG93X2luZGV4XSkKKyAgICAgICAgICAgIHsKKworICAgICAgICAgICAgICAgIGlmICghcmljUnNwTGVuKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJSSUMgUmVzcG9uc2Ugbm90IHJlY2VpdmVkIGZvciBBQyAlZCBvbiBUU1BFQyBJbmRleCAlZCwgUklDIFJlcSBJZGVudGlmaWVyID0gJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYywgdHNwZWNfZmxvd19pbmRleCwgcEFDSW5mby0+cmljSWRlbnRpZmllclt0c3BlY19mbG93X2luZGV4XSk7CisgICAgICAgICAgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qIE5vdyB3ZSBnb3QgcmVzcG9uc2UgZm9yIHRoaXMgaWRlbnRpZmllci4gUHJvY2VzcyBpdC4gKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKHBSaWNEYXRhRGVzYy0+cHJlc2VudCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBSaWNEYXRhRGVzYy0+UklDRGF0YS5wcmVzZW50KQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwUmljRGF0YURlc2MtPlJJQ0RhdGEuSWRlbnRpZmllciAhPSBwQUNJbmZvLT5yaWNJZGVudGlmaWVyW3RzcGVjX2Zsb3dfaW5kZXhdKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJSSUMgcmVzcG9uc2Ugb3JkZXIgbm90IHNhbWUgYXMgcmVxdWVzdCBzZW50LiBSZXF1ZXN0IElEID0gJWQsIFJlc3BvbnNlIElEID0gJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQUNJbmZvLT5yaWNJZGVudGlmaWVyW3RzcGVjX2Zsb3dfaW5kZXhdLCBwUmljRGF0YURlc2MtPlJJQ0RhdGEuSWRlbnRpZmllcik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJQcm9jZXNzaW5nIFJJQyBSZXNwb25zZSBmb3IgQUMgJWQsIFRTUEVDIEZsb3cgaW5kZXggJWQgd2l0aCBSSUMgSUQgJWQgIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWMsIHRzcGVjX2Zsb3dfaW5kZXgsIHBSaWNEYXRhRGVzYy0+UklDRGF0YS5JZGVudGlmaWVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gc21lX1Fvc1Byb2Nlc3NGVFJJQ1Jlc3BvbnNlKHBNYWMsIHNlc3Npb25JZCwgcFJpY0RhdGFEZXNjLCBhYywgdHNwZWNfZmxvd19pbmRleCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiRmFpbGVkIHdpdGggc3RhdHVzICVkIGZvciBBQyAlZCBpbiBUU1BFQyBGbG93IGluZGV4ID0gJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzLCBhYywgdHNwZWNfZmxvd19pbmRleCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJpY0RhdGFEZXNjKys7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmljUnNwTGVuIC09IHNpemVvZih0RG90MTFmSUVSSUNEYXRhRGVzYyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgfQorICAgIH0KKworICAgIGlmIChyaWNSc3BMZW4pCisgICAgeworICAgICAgICBWT1NfVFJBQ0U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wKKyAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgc2Vzc2lvbklkLCBhYyk7CisgICBpZiAoc2Vzc2lvbklkID49IENTUl9ST0FNX1NFU1NJT05fTUFYKQorICAgeworICAgICAgLy9lcnIgbXNnCisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6ICVkOiBzZXNzaW9uSWQoJWQpIGlzIGludmFsaWQiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywgc2Vzc2lvbklkKTsKKyAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgfQorCisgICBwU2Vzc2lvbiA9ICZzbWVfUW9zQ2Iuc2Vzc2lvbkluZm9bc2Vzc2lvbklkXTsKKyAgIHBNc2cgPSAodFNpckFkZHRzUmVxICopdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRTaXJBZGR0c1JlcSkpOworICAgaWYgKCFwTXNnKQorICAgeworICAgICAgLy9lcnIgbXNnCisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgIiVzOiAlZDogY291bGRuJ3QgYWxsb2NhdGUgbWVtb3J5IGZvciB0aGUgbXNnIGJ1ZmZlciIsCisgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fKTsKKyAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgfQorICAgdm9zX21lbV96ZXJvKHBNc2csIHNpemVvZih0U2lyQWRkdHNSZXEpKTsKKyAgIHBNc2ctPm1lc3NhZ2VUeXBlID0gcGFsX2NwdV90b19iZTE2KCh2X1UxNl90KWVXTklfU01FX0FERFRTX1JFUSk7CisgICBwTXNnLT5sZW5ndGggPSBzaXplb2YodFNpckFkZHR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gICAgICAgICAgX19mdW5jX18sIF9fTElORV9fKTsKKyAgICAgIHZvc19tZW1fZnJlZShwTXNnKTsKKyAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgfQorICAgdm9zX21lbV9jb3B5KCAmcE1zZy0+YnNzSWRbIDAgXSwgCisgICAgICAgICAgICAgICAgICZwU2Vzc2lvbi0+YXNzb2NJbmZvLnBCc3NEZXNjLT5ic3NJZFsgMCBdLCAKKyAgICAgICAgICAgICAgICAgc2l6ZW9mKHRDc3JCc3NpZCkgKTsKKyAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgCisgICAgICAgICAgICAgIiVzOiAlZDogdXAgPSAlZCwgdGlkID0gJWQiLAorICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywgCisgICAgICAgICAgICAgcFRzcGVjX0luZm8tPnRzX2luZm8udXAsCisgICAgICAgICAgICAgcFRzcGVjX0luZm8tPnRzX2luZm8udGlkKTsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICBpZihwQ3NyU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS5pc0VTRUFzc29jKQorICAgeworICAgICAgcE1zZy0+cmVxLnRzcnNJRS50c2lkID0gcFRzcGVjX0luZm8tPnRzX2luZm8udXA7CisgICAgICBwTXNnLT5yZXEudHNyc1ByZXNlbnQgPSAxOworICAgfQorI2VuZGlmCisgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1MocGFsU2VuZE1CTWVzc2FnZShwTWFjLT5oSGRkLCBwTXNnKSkpCisgICB7CisgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAKKyAgICAgICAgICAgICAgICAiJXM6ICVkOiBzZW50IGRvd24gYSBBR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CByZXF1ZXN0IHRvIFBFIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18pOworICAgICAgdm9zX21lbV9mcmVlKHBNc2cpOworICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICB9CisgICB2b3NfbWVtX2NvcHkoICZwTXNnLT5ic3NJZFsgMCBdLCAKKyAgICAgICAgICAgICAgICAgJnBTZXNzaW9uLT5hc3NvY0luZm8ucEJzc0Rlc2MtPmJzc0lkWyAwIF0sIAorICAgICAgICAgICAgICAgICBzaXplb2YodENzckJzc2lkKSApOworCisgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsIAorICAgICAgICAgICAgICIlczogJWQ6IHVwID0gJWQsIHRpZCA9ICVkIiwKKyAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sIAorICAgICAgICAgICAgIHBUc3BlY0luZm8tPnRzX2luZm8udXAsCisgICAgICAgICAgICAgcFRzcGVjSW5mby0+dHNfaW5mby50aWQpOworICAgdm9zX21lbV96ZXJvKCZwQUNJbmZvLT5jdXJyX1FvU0luZm9bdHNwZWNfbWFzayAtIDFdLCAKKyAgICAgICAgICAgICAgICBzaXplb2Yoc21lX1Fvc1dtbVRzcGVjSW5mbykpOworICAgaWYoSEFMX1NUQVRVU19TVUNDRVNTKHBhbFNlbmRNQk1lc3NhZ2UocE1hYy0+aEhkZCwgcE1zZykpKQorICAgeworICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgCisgICAgICAgICAgICAgICAgIiVzOiAlZDogc21lX1Fvc0RlbFRzUmVxOlRlc3Q6IHNlbnQgZG93biBhIERFTFRTIHJlcSB0byBQRSIsCisgICAgICAgICAgICAgICAgX19mdW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X0xJTkVfXyk7CisgICAgICAgICByZXR1cm4gc3RhdHVzOworICAgICAgfQorICAgICAgaWYoISgoc21lX1Fvc0Fzc29jSW5mbyAqKXBFdmVudF9pbmZvKS0+cEJzc0Rlc2MpCisgICAgICB7CisgICAgICAgICAvL2VyciBtc2cKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBwQnNzRGVzYyBpcyBOVUxMIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18pOworICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgIH0KKyAgICAgIGlmKChwU2Vzc2lvbi0+YXNzb2NJbmZvLnBCc3NEZXNjKSAmJgorICAgICAgICAgKGNzcklzQnNzaWRNYXRjaChwTWFjLCAodENzckJzc2lkICopJnBTZXNzaW9uLT5hc3NvY0luZm8ucEJzc0Rlc2MtPmJzc0lkLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKHRDc3JCc3NpZCAqKSAmKCgoc21lX1Fvc0Fzc29jSW5mbyAqKXBFdmVudF9pbmZvKS0+cEJzc0Rlc2MtPmJzc0lkKSkpKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICIlczogJWQ6IGFzc29jIHdpdGggdGhlIHNhbWUgQlNTLCBubyB1cGRhdGUgbmVlZGVkIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18pOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgc3RhdHVzID0gc21lX1Fvc1NhdmVBc3NvY0luZm8ocFNlc3Npb24sIHBFdmVudF9pbmZvKTsKKyAgICAgIH0KKyAgIH0KKyAgIGVsc2UKKyAgIHsKKyAgIC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NfRURDQV9BQ19NQVg7IGFjKyspIAorICAgICAgeworICAgICAgICAgcEFDSW5mbyA9ICZwU2Vzc2lvbi0+YWNfaW5mb1thY107CisgICAgICAgICBzd2l0Y2gocEFDSW5mby0+Y3Vycl9zdGF0ZSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGNhc2UgU01FX1FPU19JTklUOgorICAgICAgICAgICAgICAgc21lX1Fvc1N0YXRlVHJhbnNpdGlvbihzZXNzaW9uSWQsIGFjLCBTTUVfUU9TX0xJTktfVVApOworICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNNRV9RT1NfTElOS19VUDoKKyAgICAgICAgICAgIGNhc2UgU01FX1FPU19SRVFVRVNURUQ6CisgICAgICAgICAgICBjYXNlIFNNRV9RT1NfUU9TX09OOgorICAgICAgICAgICAgY2FzZSBTTUVfUU9TX0hBTkRPRkY6CisgICAgICAgICAgICBjYXNlIFNNRV9RT1NfQ0xPU0VEOgorICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBPbiBzZXNzaW9uICVkIEFDICVkIGlzIGluIHdyb25nIHN0YXRlICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkLCBhYywgcEFDSW5mby0+Y3Vycl9zdGF0ZSk7CisgICAgICAgICAgICAgICAvL0FTU0VSVAorICAgICAgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgfQorICAgICAgfQorICAgfQorICAgcmV0dXJuIHN0YXR1czsKK30KKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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AgICAgIHN3aXRjaChwQUNJbmZvLT5jdXJyX3N0YXRlKQorICAgICAgeworICAgICAgICAgY2FzZSBTTUVfUU9TX0hBTkRPRkY6CisgICAgICAgICAgICAvLyByZXR1cm4gdG8gb3VyIHByZXZpb3VzIHN0YXRlCisgICAgICAgICAgICBzbWVfUW9zU3RhdGVUcmFuc2l0aW9uKHNlc3Npb25JZCwgYWMsIHBBQ0luZm8tPnByZXZfc3RhdGUpOworICAgICAgICAgICAgLy9mb3Igd2hpY2ggYWMgQVBTRCAoaGVuY2UgdGhlIHJlYXNzb2MpIGlzIHJlcXVlc3RlZAorICAgICAgICAgICAgaWYocEFDSW5mby0+cmVhc3NvY19wZW5kaW5nKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLy91cGRhdGUgdGhlIGFwc2QgbWFzayBpbiBDQiAtIG1ha2Ugc3VyZSB0byB0YWtlIGNhcmUgb2YgdGhlIGNhc2UKKyAgICAgICAgICAgICAgIC8vd2hlcmUgd2UgYXJlIHJlc2V0dGluZyB0aGUgYml0IGluIGFwc2RfbWFzaworICAgICAgICAgICAgICAgaWYocEFDSW5mby0+cmVxdWVzdGVkX1FvU0luZm9bU01FX1FPU19UU1BFQ19JTkRFWF8wXS50c19pbmZvLnBzYikKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5hcHNkTWFzayB8PSAxIDw8IChTTUVfUU9TX0VEQ0FfQUNfVk8gLSBhYyk7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+YXBzZE1hc2sgJj0gfigxIDw8IChTTUVfUU9TX0VEQ0FfQUNfVk8gLSBhYykpOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgcEFDSW5mby0+cmVhc3NvY19wZW5kaW5nID0gVk9TX0ZBTFNFOworICAgICAgICAgICAgICAgLy9kdXJpbmcgc2V0dXAgaXQgZ2V0cyBzZXQgYXMgYWRkdHMgJiByZWFzc29jIGJvdGggZ2V0cyBhIHBlbmRpbmcgZmxhZworICAgICAgICAgICAgICAgLy9wQUNJbmZvLT50c3BlY19wZW5kaW5nID0gMDsKKyAgICAgICAgICAgICAgIHNtZV9Rb3NTdGF0ZVRyYW5zaXRpb24oc2Vzc2lvbklkLCBhYywgU01FX1FPU19RT1NfT04pOworICAgICAgICAgICAgICAgLy8gbm90aWZ5IEhERCB3aXRoIG5ldyBTZXJ2aWNlIEludGVydmFsCisgICAgICAgICAgICAgICBwQUNJbmZvLT5jdXJyX1FvU0luZm9bU01FX1FPU19UU1BFQ19JTkRFWF8wXSA9IAorICAgICAgICAgICAgICAgICAgcEFDSW5mby0+cmVxdWVzdGVkX1FvU0luZm9bU01FX1FPU19UU1BFQ19JTkRFWF8wXTsKKyAgICAgICAgICAgICAgIHZvc19tZW1femVybygmc2VhcmNoX2tleSwgc2l6ZW9mKHNtZV9Rb3NTZWFyY2hJbmZvKSk7CisgICAgICAgICAgICAgICAvL3NldCB0aGUga2V5IHR5cGUgJiB0aGUga2V5IHRvIGJlIHNlYXJjaGVkIGluIHRoZSBGbG93IExpc3QKKyAgICAgICAgICAgICAgIHNlYXJjaF9rZXkua2V5LmFjX3R5cGUgPSBhYzsKKyAgICAgICAgICAgICAgIHNlYXJjaF9rZXkuaW5kZXggPSBTTUVfUU9TX1NFQVJDSF9LRVlfSU5ERVhfMjsKKyAgICAgICAgICAgICAgIHNlYXJjaF9rZXkuc2Vzc2lvbklkID0gc2Vzc2lvbklkOworICAgICAgICAgICAgICAgLy9ub3RpZnkgUE1DIHRoYXQgcmVhc3NvYyBpcyBkb25lIGZvciBBUFNEIG9uIGNlcnRhaW4gQUM/PworCisgICAgICAgICAgICAgICB2b3NfbWVtX3plcm8oJnNlYXJjaF9rZXkxLCBzaXplb2Yoc21lX1Fvc1NlYXJjaEluZm8pKTsKKyAgICAgICAgICAgICAgIC8vc2V0IHRoZSBob1JlbmV3YWwgZmllbGQgaW4gY29udHJvbCBibG9jayBpZiBuZWVkZWQKKyAgICAgICAgICAgICAgIHNlYXJjaF9rZXkxLmluZGV4ID0gU01FX1FPU19TRUFSQ0hfS0VZX0lOREVYXzM7CisgICAgICAgICAgICAgICBzZWFyY2hfa2V5MS5rZXkucmVhc29uID0gU01FX1FPU19SRUFTT05fU0VUVVA7CisgICAgICAgICAgICAgICBzZWFyY2hfa2V5MS5zZXNzaW9uSWQgPSBzZXNzaW9uSWQ7CisgICAgICAgICAgICAgICBmb3IoYWNfaW5kZXggPSBTTUVfUU9TX0VEQ0FfQUNfQkU7IGFjX2luZGV4IDwgU01FX1FPU19FRENBX0FDX01BWDsgYWNfaW5kZXgrKykKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHBFbnRyeSA9IHNtZV9Rb3NGaW5kSW5GbG93TGlzdChzZWFyY2hfa2V5MSk7CisgICAgICAgICAgICAgICAgICBpZihwRW50cnkpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICBmbG93X2luZm8gPSBHRVRfQkFTRV9BRERSKCBwRW50cnksIHNtZV9Rb3NGbG93SW5mb0VudHJ5LCBsaW5rICk7CisgICAgICAgICAgICAgICAgICAgICBpZihmbG93X2luZm8tPmFjX3R5cGUgPT0gYWMpCisgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwQUNJbmZvLT5ob1JlbmV3YWwgPSBmbG93X2luZm8tPmhvUmVuZXdhbDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgLy9ub3RpZnkgSEREIHRoZSBzdWNjZXNzIGZvciB0aGUgcmVxdWVzdGVkIGZsb3cgCisgICAgICAgICAgICAgICAvL25vdGlmeSBhbGwgdGhlIG90aGVyIGZsb3dzIHJ1bm5pbmcgb24gdGhlIEFDIHRoYXQgUW9TIGdvdCBtb2RpZmllZAorICAgICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzbWVfUW9zRmluZEFsbEluRmxvd0xpc3QocE1hYywgc2VhcmNoX2tleSwgc21lX1Fvc1JlYXNzb2NTdWNjZXNzRXZGbnApKSkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBubyBtYXRjaCBmb3VuZCBmb3IgYWMgPSAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlYXJjaF9rZXkua2V5LmFjX3R5cGUpOworICAgICAgICAgICAgICAgICAgLy9BU1NFUlQKKyAgICAgICAgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIHBBQ0luZm8tPmhvUmVuZXdhbCA9IFZPU19GQUxTRTsKKyAgICAgICAgICAgICAgIHZvc19tZW1femVybygmcEFDSW5mby0+cmVxdWVzdGVkX1FvU0luZm9bU01FX1FPU19UU1BFQ19JTkRFWF8wXSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHNtZV9Rb3NXbW1Uc3BlY0luZm8pKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIGNhc2UgU01FX1FPU19JTklUOgorICAgICAgICAgY2FzZSBTTUVfUU9TX0NMT1NFRDoKKyAgICAgICAgICAgIC8vTk9QCisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICBjYXNlIFNNRV9RT1NfTElOS19VUDoKKyAgICAgICAgIGNhc2UgU01FX1FPU19SRVFVRVNURUQ6CisgICAgICAgICBjYXNlIFNNRV9RT1NfUU9TX09OOgorICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBPbiBzZXNzaW9uICVkIEFDICVkIGlzIGluIHdyb25nIHN0YXRlICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkLCBhYywgcEFDSW5mby0+Y3Vycl9zdGF0ZSk7CisgICAgICAgICAgICAvL0FTU0VSVAorICAgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgfQorICAgKHZvaWQpc21lX1Fvc1Byb2Nlc3NCdWZmZXJlZENtZChzZXNzaW9uSWQpOworICAgcmV0dXJuIHN0YXR1czsKK30KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBcYnJpZWYgc21lX1Fvc1Byb2Nlc3NSZWFzc29jRmFpbHVyZUV2KCkgLSBGdW5jdGlvbiB0byBwcm9jZXNzIHRoZQorICBTTUVfUU9TX0NTUl9SRUFTU09DX0ZBSUxVUkUgZXZlbnQgaW5kaWNhdGlvbiBmcm9tIENTUgorICBccGFyYW0gcEV2ZW50X2luZm8gLSBQb2ludGVyIHRvIHJlbGV2YW50IGluZm8gZnJvbSB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B7CisgICAgICAgICBjYXNlIFNNRV9RT1NfSEFORE9GRjoKKyAgICAgICAgICAgIHNtZV9Rb3NTdGF0ZVRyYW5zaXRpb24oc2Vzc2lvbklkLCBhYywgU01FX1FPU19JTklUKTsKKyAgICAgICAgICAgIGlmKHBBQ0luZm8tPnJlYXNzb2NfcGVuZGluZykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHBBQ0luZm8tPnJlYXNzb2NfcGVuZGluZyA9IFZPU19GQUxTRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHZvc19tZW1femVybygmcEFDSW5mby0+Y3Vycl9Rb1NJbmZvW1NNRV9RT1NfVFNQRUNfSU5ERVhfMF0sIAorICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihzbWVfUW9zV21tVHNwZWNJbmZvKSk7CisgICAgICAgICAgICB2b3NfbWVtX3plcm8oJnBBQ0luZm8tPnJlcXVlc3RlZF9Rb1NJbmZvW1NNRV9RT1NfVFNQRUNfSU5ERVhfMF0sIAorICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihzbWVfUW9zV21tVHNwZWNJbmZvKSk7CisgICAgICAgICAgICB2b3NfbWVtX3plcm8oJnBBQ0luZm8tPmN1cnJfUW9TSW5mb1tTTUVfUU9TX1RTUEVDX0lOREVYXzFdLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2Yoc21lX1Fvc1dtbVRzcGVjSW5mbykpOworICAgICAgICAgICAgdm9zX21lbV96ZXJvKCZwQUNJbmZvLT5yZXF1ZXN0ZWRfUW9TSW5mb1tTTUVfUU9TX1RTUEVDX0lOREVYXzFdLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2Yoc21lX1Fvc1dtbVRzcGVjSW5mbykpOworICAgICAgICAgICAgcEFDSW5mby0+dHNwZWNfbWFza19zdGF0dXMgPSBTTUVfUU9TX1RTUEVDX01BU0tfQ0xFQVI7CisgICAgICAgICAgICBwQUNJbmZvLT50c3BlY19wZW5kaW5nID0gMDsKKyAgICAgICAgICAgIHBBQ0luZm8tPm51bV9mbG93c1tTTUVfUU9TX1RTUEVDX0lOREVYXzBdID0gMDsKKyAgICAgICAgICAgIHBBQ0luZm8tPm51bV9mbG93c1tTTUVfUU9TX1RTUEVDX0lOREVYXzFdID0gMDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgY2FzZSBTTUVfUU9TX0lOSVQ6CisgICAgICAgICBjYXNlIFNNRV9RT1NfQ0xPU0VEOgorICAgICAgICAgICAgLy9OT1AKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgY2FzZSBTTUVfUU9TX0xJTktfVVA6CisgICAgICAgICBjYXNlIFNNRV9RT1NfUkVRVUVTVEVEOgorICAgICAgICAgY2FzZSBTTUVfUU9TX1FPU19PTjoKKyAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogT24gc2Vzc2lvbiAlZCBBQyAlZCBpcyBpbiB3cm9uZyBzdGF0ZSAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCwgYWMsIHBBQ0luZm8tPmN1cnJfc3RhdGUpOworICAgICAgICAgICAgLy9BU1NFUlQKKyAgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgIH0KKyAgIC8vbmVlZCB0byBjbGVhbiB1cCBmbG93cworICAgc21lX1Fvc0RlbGV0ZUV4aXN0aW5nRmxvd3MocE1hYywgc2Vzc2lvbklkKTsKKyAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworfQorLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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isgICAgICBwQUNJbmZvID0gJnBTZXNzaW9uLT5hY19pbmZvW2FjXTsKKyAgICAgIHN3aXRjaChwQUNJbmZvLT5jdXJyX3N0YXRlKQorICAgICAgeworICAgICAgICAgY2FzZSBTTUVfUU9TX0xJTktfVVA6CisgICAgICAgICBjYXNlIFNNRV9RT1NfUkVRVUVTVEVEOgorICAgICAgICAgY2FzZSBTTUVfUU9TX1FPU19PTjoKKyAgICAgICAgICAgIHNtZV9Rb3NTdGF0ZVRyYW5zaXRpb24oc2Vzc2lvbklkLCBhYywgU01FX1FPU19IQU5ET0ZGKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgY2FzZSBTTUVfUU9TX0hBTkRPRkY6CisgICAgICAgICAgICAvL3ByaW50IGVycm9yIG1zZworI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCisgICAgICAgICAgICBpZihwU2Vzc2lvbi0+ZnRIYW5kb2ZmSW5Qcm9ncmVzcykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogU01FX1FPU19DU1JfSEFORE9GRl9BU1NPQ19SRVEgcmVjZWl2ZWQgaW4gIgorICAgICAgICAgICAgICAgICAgICAgICAgICJTTUVfUU9TX0hBTkRPRkYgc3RhdGUgd2l0aCBGVCBpbiBwcm9ncmVzcyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAsIF9fZnVuY19fLCBfX0xJTkVfXyk7IAorICAgICAgICAgICAgICAgYnJlYWs7IAorICAgICAgICAgICAgfQorI2VuZGlmICAgICAgICAgICAgCisKKyAgICAgICAgIGNhc2UgU01FX1FPU19DTE9TRUQ6CisgICAgICAgICBjYXNlIFNNRV9RT1NfSU5JVDoKKyAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBWT1NfVFJBQ0UoV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CisgICAgICBzd2l0Y2gocEFDSW5mby0+Y3Vycl9zdGF0ZSkKKyAgICAgIHsKKyAgICAgICAgIGNhc2UgU01FX1FPU19IQU5ET0ZGOgorICAgICAgICAgICAgc21lX1Fvc1N0YXRlVHJhbnNpdGlvbihzZXNzaW9uSWQsIGFjLCBTTUVfUU9TX0lOSVQpOworICAgICAgICAgICAgLy9uZWVkIHRvIGNsZWFuIHVwIGZsb3dzOiBUT0RPCisgICAgICAgICAgICB2b3NfbWVtX3plcm8oJnBBQ0luZm8tPmN1cnJfUW9TSW5mb1tTTUVfUU9TX1RTUEVDX0lOREVYXzBdLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2Yoc21lX1Fvc1dtbVRzcGVjSW5mbykpOworICAgICAgICAgICAgdm9zX21lbV96ZXJvKCZwQUNJbmZvLT5yZXF1ZXN0ZWRfUW9TSW5mb1tTTUVfUU9TX1RTUEVDX0lOREVYXzBdLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2Yoc21lX1Fvc1dtbVRzcGVjSW5mbykpOworICAgICAgICAgICAgdm9zX21lbV96ZXJvKCZwQUNJbmZvLT5jdXJyX1FvU0luZm9bU01FX1FPU19UU1BFQ19JTkRFWF8xXSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHNtZV9Rb3NXbW1Uc3BlY0luZm8pKTsKKyAgICAgICAgICAgIHZvc19tZW1femVybygmcEFDSW5mby0+cmVxdWVzdGVkX1FvU0luZm9bU01FX1FPU19UU1BFQ19JTkRFWF8xXSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHNtZV9Rb3NXbW1Uc3BlY0luZm8pKTsKKyAgICAgICAgICAgIHBBQ0luZm8tPnRzcGVjX21hc2tfc3RhdHVzID0gU01FX1FPU19UU1BFQ19NQVNLX0NMRUFSOworICAgICAgICAgICAgcEFDSW5mby0+dHNwZWNfcGVuZGluZyA9IDA7CisgICAgICAgICAgICBwQUNJbmZvLT5udW1fZmxvd3NbU01FX1FPU19UU1BFQ19JTkRFWF8wXSA9IDA7CisgICAgICAgICAgICBwQUNJbmZvLT5udW1fZmxvd3NbU01FX1FPU19UU1BFQ19JTkRFWF8xXSA9IDA7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIGNhc2UgU01FX1FPU19JTklUOgorICAgICAgICAgY2FzZSBTTUVfUU9TX0NMT1NFRDoKKyAgICAgICAgIGNhc2UgU01FX1FPU19MSU5LX1VQOgorICAgICAgICAgY2FzZSBTTUVfUU9TX1JFUVVFU1RFRDoKKyAgICAgICAgIGNhc2UgU01FX1FPU19RT1NfT046CisgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IE9uIHNlc3Npb24gJWQgQUMgJWQgaXMgaW4gd3Jvbmcgc3RhdGUgJWQiLAorICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uSWQsIGFjLCBwQUNJbmZvLT5jdXJyX3N0YXRlKTsKKyAgICAgICAgICAgIC8vQVNTRVJUCisgICAgICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICB9CisgICAvL25vIGxvbmdlciBpbiBoYW5kb2ZmCisgICBwU2Vzc2lvbi0+aGFuZG9mZlJlcXVlc3RlZCA9IFZPU19GQUxTRTsKKyAgIC8vY2xlYW4gdXAgdGhlIGFzc29jIGluZm8KKyAgIGlmKHBTZXNzaW9uLT5hc3NvY0luZm8ucEJzc0Rlc2MpCisgICB7CisgICAgICB2b3NfbWVtX2ZyZWUocFNlc3Npb24tPmFzc29jSW5mby5wQnNzRGVzYyk7CisgICAgICBwU2Vzc2lvbi0+YXNzb2NJbmZvLnBCc3NEZXNjID0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NRV9RT1NfSEFORE9GRjoKKyAgICAgICAgICAgICAgICAvL3ByaW50IGVycm9yIG1zZworICAgICAgICAgICAgY2FzZSBTTUVfUU9TX0NMT1NFRDoKKyAgICAgICAgICAgIGNhc2UgU01FX1FPU19JTklUOgorICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IE9uIHNlc3Npb24gJWQgQUMgJWQgaXMgaW4gd3Jvbmcgc3RhdGUgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkLCBhYywgcEFDSW5mby0+Y3Vycl9zdGF0ZSk7CisgICAgICAgICAgICAgICAgLy9BU1NFUlQKKyAgICAgICAgICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgICAgcFNlc3Npb24tPmZ0SGFuZG9mZkluUHJvZ3Jlc3MgPSBWT1NfVFJVRTsKKworICAgIC8vIENoZWNrIGlmIGl0cyBhIDExUiByb2FtaW5nIGJlZm9yZSBwcmVwYXJpbmcgdGhlIFJJQyBJRXMKKyAgICBpZiAoY3NyUm9hbUlzMTFyQXNzb2MocE1hYykpIAorICAgIHsKKyAgICAgICAgdl9VMTZfdCByaWNPZmZzZXQgPSAwOworICAgICAgICB2X1UzMl90IHJpY0lFTGVuZ3RoID0gMDsKKyAgICAgICAgdl9VOF90ICAqcmljSUU7CisgICAgICAgIHZfVThfdCAgdHNwZWNfbWFza19zdGF0dXMgPSAwOworICAgICAgICB2X1U4X3QgIHRzcGVjX3BlbmRpbmdfc3RhdHVzID0gMDsKKworICAgICAgICAvKiBBbnkgQmxvY2sgQWNrIGluZm8gdGhlcmUsIHNob3Vs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llciwgU01FX1FPU19UU1BFQ19JTkRFWF9NQVgpOworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgCisgICAgICAgICAgICAgICAgICAgIEZMKCJBQyAlZCA9PT4gVFNQRUMgc3RhdHVzID0gJWQsIHRzcGVjIHBlbmRpbmcgPSAlZCIpLCAKKyAgICAgICAgICAgICAgICAgICAgYWMsIHRzcGVjX21hc2tfc3RhdHVzLCB0c3BlY19wZW5kaW5nX3N0YXR1cyk7CisKKyAgICAgICAgICAgIGRvCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHRzcGVjX21hc2tfc3RhdHVzICYgMHgxKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogSWYgYSB0c3BlYyBzdGF0dXMgaXMgcGVuZGluZywgdGFrZSByZXF1ZXN0ZWRfUW9TSW5mbyBmb3IgUklDIHJlcXVlc3QsIGVsc2UgdXNlIGN1cnJfUW9TSW5mbworICAgICAgICAgICAgICAgICAgICAgICBmb3IgdGhlIFJJQyByZXF1ZXN0ICovCisgICAgICAgICAgICAgICAgICAgIGlmICh0c3BlY19wZW5kaW5nX3N0YXR1cyAmIDB4MSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gc21lX1Fvc0NyZWF0ZVRzcGVjUklDSUUocE1hYywgJnBBQ0luZm8tPnJlcXVlc3RlZF9Rb1NJbmZvW3RzcGVjX2luZGV4XSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmljSUUgKyByaWNPZmZzZXQsICZyaWNJRUxlbmd0aCwgJnBBQ0luZm8tPnJpY0lkZW50aWZpZXJbdHNwZWNfaW5kZXhdKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IHNtZV9Rb3NDcmVhdGVUc3BlY1JJQ0lFKHBNYWMsICZwQUNJbmZvLT5jdXJyX1FvU0luZm9bdHNwZWNfaW5kZXhdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByaWNJRSArIHJpY09mZnNldCwgJnJpY0lFTGVuZ3RoLCAmcEFDSW5mby0+cmljSWRlbnRpZmllclt0c3BlY19pbmRleF0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJpY09mZnNldCArPSByaWNJRUxlbmd0aDsKKyAgICAgICAgICAgICAgICBwTWFjLT5mdC5mdFNtZUNvbnRleHQucHNhdmVkRlRQcmVBdXRoUnNwLT5yaWNfaWVzX2xlbmd0aCArPSByaWNJRUxlbmd0aDsKKworICAgICAgICAgICAgICAgIHRzcGVjX21hc2tfc3RhdHVzID4+PSAxOworICAgICAgICAgICAgICAgIHRzcGVjX3BlbmRpbmdfc3RhdHVzID4+PSAxOworICAgICAgICAgICAgICAgIHRzcGVjX2luZGV4Kys7CisgICAgICAgICAgICB9IHdoaWxlICh0c3BlY19tYXNrX3N0YXR1cyk7CisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30KKworI2VuZGlmCisKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBcYnJpZWYgc21lX1Fvc1Byb2Nlc3NBZGRUc0ZhaWx1cmVSc3AoKSAtIEZ1bmN0aW9uIHRvIHByb2Nlc3MgdGhlCisgIEFkZHRzIHJlcXVlc3QgZmFpbHVyZSByZXNwb25zZSBjYW1lIGZyb20gUEUgCisgIAorICBXZSB3aWxsIG5vdGlmeSBIREQgb25seSBmb3IgdGhlIHJlcXVlc3RlZCBGbG93LCBvdGhlciBGbG93cyBydW5uaW5nIG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WQiLAorICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICBzZXNzaW9uSWQsIHVwKTsKKyAgIGFjID0gc21lX1Fvc1VwVG9BYyh1cCk7CisgICBpZihTTUVfUU9TX0VEQ0FfQUNfTUFYID09IGFjKQorICAgeworICAgICAgLy9lcnIgbXNnCisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgIiVzOiAlZDogaW52YWxpZCBBQyAlZCBmcm9tIFVQICVkIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sIGFjLCB1cCk7CisgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgIH0KKyAgIHBTZXNzaW9uID0gJnNtZV9Rb3NDYi5zZXNzaW9uSW5mb1tzZXNzaW9uSWRdOworICAgcEFDSW5mbyA9ICZwU2Vzc2lvbi0+YWNfaW5mb1thY107CisgICAvLyBpcyB0aGVyZSBhIFRTUEVDIHJlcXVlc3QgcGVuZGluZyBvbiB0aGlzIEFDPworICAgdHNwZWNfcGVuZGluZyA9IHBBQ0luZm8tPnRzcGVjX3BlbmRpbmc7CisgICBpZighdHNwZWNfcGVuZGluZykKKyAgIHsKKyAgICAgIC8vQVNTRVJUCisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgIiVzOiAlZDogT24gc2Vzc2lvbiAlZCBhbiBBZGRUUyBpcyBub3QgcGVuZGluZyBvbiBBQyAlZCIsCisgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgIHNlc3Npb25JZCwgYWMpOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICA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vID0gR0VUX0JBU0VfQUREUiggcEVudHJ5LCBzbWVfUW9zRmxvd0luZm9FbnRyeSwgbGluayApOworCisgICAgICBpZihzZWFyY2hfa2V5LnNlc3Npb25JZCA9PSBmbG93X2luZm8tPnNlc3Npb25JZCkKKyAgICAgIHsKKyAgICAgICAgIGlmKHNlYXJjaF9rZXkuaW5kZXggJiBTTUVfUU9TX1NFQVJDSF9LRVlfSU5ERVhfNCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGlmKChzZWFyY2hfa2V5LmtleS5hY190eXBlID09IGZsb3dfaW5mby0+YWNfdHlwZSkgJiYKKyAgICAgICAgICAgICAgIChzZWFyY2hfa2V5LmRpcmVjdGlvbiA9PSBmbG93X2luZm8tPlFvU0luZm8udHNfaW5mby5kaXJlY3Rpb24pKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLy9tc2cKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogRmxvdyAlZCBtYXRjaGVzIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgICAgICAgICAgZmxvd19pbmZvLT5Rb3NGbG93SUQpOworICAgICAgICAgICAgICAgcEFDSW5mby0+bnVtX2Zsb3dzW2Zsb3dfaW5mby0+dHNwZWNfbWFzayAtIDFdLS07CisgICAgICAgICAgICAgICBwQUNJbmZvLT5udW1fZmxvd3NbbmV3X3RzcGVjX21hc2sgLSAxXSsrOworICAgICAgICAgICAgICAgZmxvd19pbmZvLT50c3BlY19tYXNrID0gbmV3X3RzcGVjX21hc2s7CisgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgICBlbHNlIGlmKHNlYXJjaF9rZXkuaW5kZXggJiBTTUVfUU9TX1NFQVJDSF9LRVlfSU5ERVhfNSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGlmKChzZWFyY2hfa2V5LmtleS5hY190eXBlID09IGZsb3dfaW5mby0+YWNfdHlwZSkgJiYKKyAgICAgICAgICAgICAgIChzZWFyY2hfa2V5LnRzcGVjX21hc2sgPT0gZmxvd19pbmZvLT50c3BlY19tYXNrKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8vbXNnCisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsIAorICAgICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IEZsb3cgJWQgbWF0Y2hlcyIsCisgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgICAgICAgIGZsb3dfaW5mby0+UW9zRmxvd0lEKTsKKyAgICAgICAgICAgICAgIHBBQ0luZm8tPm51bV9mbG93c1tmbG93X2luZm8tPnRzcGVjX21hc2sgLSAxXS0tOworICAgICAgICAgICAgICAgcEFDSW5mby0+bnVtX2Zsb3dzW25ld190c3BlY19tYXNrIC0gMV0rKzsKKyAgICAgICAgICAgICAgIGZsb3dfaW5mby0+dHNwZWNfbWFzayA9IG5ld190c3BlY19tYXNrOworICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICAgfQorCisgICAgICBwRW50cnkgPSBwTmV4dEVudHJ5OworICAgfQorCisgICByZXR1cm4gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKK30KKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgXGJyaWVmIHNtZV9Rb3NQcm9jZXNzQWRkVHNTdWNjZXNzUnNwKCkgLSBGdW5jdGlvbiB0byBwcm9jZXNzIHRoZQorICBBZGR0cyByZXF1ZXN0IHN1Y2Nlc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fcGVuZGluZzsKKyAgIHRMaXN0RWxlbSAqcEVudHJ5PSBOVUxMOworICAgc21lX1Fvc0Zsb3dJbmZvRW50cnkgKmZsb3dfaW5mbyA9IE5VTEw7CisgICBzbWVfUW9zV21tVXBUeXBlIHVwID0gKHNtZV9Rb3NXbW1VcFR5cGUpcFJzcC0+dHNwZWMudHNpbmZvLnRyYWZmaWMudXNlclByaW87CisjaWZkZWYgRkVBVFVSRV9XTEFOX0RJQUdfU1VQUE9SVAorICAgV0xBTl9WT1NfRElBR19FVkVOVF9ERUYocW9zLCB2b3NfZXZlbnRfd2xhbl9xb3NfcGF5bG9hZF90eXBlKTsKKyAgIHZvc19sb2dfcW9zX3RzcGVjX3BrdF90eXBlICpsb2dfcHRyID0gTlVMTDsKKyNlbmRpZiAvL0ZFQVRVUkVfV0xBTl9ESUFHX1NVUFBPUlQKKyAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgCisgICAgICAgICAgICAgIiVzOiAlZDogaW52b2tlZCBvbiBzZXNzaW9uICVkIGZvciBVUCAlZCIsCisgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgIHNlc3Npb25JZCwgdXApOworICAgcFNlc3Npb24gPSAmc21lX1Fvc0NiLnNlc3Npb25JbmZvW3Nlc3Npb25JZF07CisgICBhYyA9IHNtZV9Rb3NVcFRvQWModXApOworICAgaWYoU01FX1FPU19FRENBX0FDX01BWCA9PSBhYykKKyAgIHsKKyAgICAgIC8vZXJyIG1zZworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICIlczogJWQ6IGludmFsaWQgQUMgJWQgZnJvbSBVUCAlZCIsCisgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLCBhYywgdXApOworICAgICAgcmV0dXJuIGVIQUxfU1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gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJzcC0+dHNwZWMudHNpbmZvLnRyYWZmaWMuYWNrUG9saWN5OworICAgcEFDSW5mby0+Y3Vycl9Rb1NJbmZvW3RzcGVjX3BlbmRpbmcgLSAxXS50c19pbmZvLnVwID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSc3AtPnRzcGVjLnRzaW5mby50cmFmZmljLnVzZXJQcmlvOworICAgcEFDSW5mby0+Y3Vycl9Rb1NJbmZvW3RzcGVjX3BlbmRpbmcgLSAxXS50c19pbmZvLnBzYiA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJzcC0+dHNwZWMudHNpbmZvLnRyYWZmaWMucHNiOworICAgcEFDSW5mby0+Y3Vycl9Rb1NJbmZvW3RzcGVjX3BlbmRpbmcgLSAxXS50c19pbmZvLmRpcmVjdGlvbiA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJzcC0+dHNwZWMudHNpbmZvLnRyYWZmaWMuZGlyZWN0aW9uOworICAgcEFDSW5mby0+Y3Vycl9Rb1NJbmZvW3RzcGVjX3BlbmRpbmcgLSAxXS50c19pbmZvLnRpZCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnNwLT50c3BlYy50c2luZm8udHJhZmZpYy50c2lkOworICAgcEFDSW5mby0+Y3Vycl9Rb1NJbmZvW3RzcGVjX3BlbmRpbmcgLSAxXS5ub21pbmFsX21zZHVfc2l6ZSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnNwLT50c3BlYy5ub21Nc2R1U3o7CisgICBwQUNJbmZvLT5jdXJyX1FvU0luZm9bdHNwZWNfcGVuZGluZyAtIDFdLm1heGltdW1fbXNkdV9zaXplID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnNwLT50c3BlYy5tYXhNc2R1U3o7CisgICBwQUNJbmZvLT5jdXJyX1FvU0luZm9bdHNwZWNfcGVuZGluZyAtIDFdLm1pbl9zZXJ2aWNlX2ludGVydmFsID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJzcC0+dHNwZWMubWluU3ZjSW50ZXJ2YWw7CisgICBwQUNJbmZvLT5jdXJyX1FvU0luZm9bdHNwZWNfcGVuZGluZyAtIDFdLm1heF9zZXJ2aWNlX2ludGVydmFsID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJzcC0+dHNwZWMubWF4U3ZjSW50ZXJ2YWw7CisgICBwQUNJbmZvLT5jdXJyX1FvU0luZm9bdHNwZWNfcGVuZGluZyAtIDFdLmluYWN0aXZpdHlfaW50ZXJ2YWwgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJzcC0+dHNwZWMuaW5hY3RJbnRlcnZhbDsKKyAgIHBBQ0luZm8tPmN1cnJfUW9TSW5mb1t0c3BlY19wZW5kaW5nIC0gMV0uc3VzcGVuc2lvbl9pbnRlcnZhbCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJzcC0+dHNwZWMuc3VzcGVuZEludGVydmFsOworICAgcEFDSW5mby0+Y3Vycl9Rb1NJbmZvW3RzcGVjX3BlbmRpbmcgLSAxXS5zdmNfc3RhcnRfdGltZSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJzcC0+dHNwZWMuc3ZjU3RhcnRUaW1lOworICAgcEFDSW5mby0+Y3Vycl9Rb1NJbmZvW3RzcGVjX3BlbmRpbmcgLSAxXS5taW5fZGF0YV9yYXRlID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnNwLT50c3BlYy5taW5EYXRhUmF0ZTsKKyAgIHBBQ0luZm8tPmN1cnJfUW9TSW5mb1t0c3BlY19wZW5kaW5nIC0gMV0ubWVhbl9kYXRhX3JhdGUgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJzcC0+dHNwZWMubWVhbkRhdGFSYXRlOworICAgcEFDSW5mby0+Y3Vycl9Rb1NJbmZvW3RzcGVjX3BlbmRpbmcgLSAxXS5wZWFrX2RhdGFfcmF0ZSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnNwLT50c3BlYy5wZWFrRGF0YVJhdGU7CisgICBwQUNJbmZvLT5jdXJyX1FvU0luZm9bdHNwZWNfcGVuZGluZyAtIDFdLm1heF9idXJzdF9zaXplID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJzcC0+dHNwZWMubWF4QnVyc3RTejsKKyAgIHBBQ0luZm8tPmN1cnJfUW9TSW5mb1t0c3BlY19wZW5kaW5nIC0gMV0uZGVsYXlfYm91bmQgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnNwLT50c3BlYy5kZWxheUJvdW5kOworCisgICBwQUNJbmZvLT5jdXJyX1FvU0luZm9bdHNwZWNfcGVuZGluZyAtIDFdLm1pbl9waHlfcmF0ZSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSc3AtPnRzcGVjLm1pblBoeVJhdGU7CisgICBwQUNJbmZvLT5jdXJyX1FvU0luZm9bdHNwZWNfcGVuZGluZyAtIDFdLnN1cnBsdXNfYndfYWxsb3dhbmNlID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSc3AtPnRzcGVjLnN1cnBsdXNCdzsKKyAgIHBBQ0luZm8tPmN1cnJfUW9TSW5mb1t0c3BlY19wZW5kaW5nIC0gMV0ubWVkaXVtX3RpbWUgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworICAgVHNwZWNJbmZvLm5vbWluYWxfbXNkdV9zaXplID0gVk9TX01BWCgKKyAgICAgIHBDdXJyZW50X1RzcGVjX0luZm8tPm5vbWluYWxfbXNkdV9zaXplICYgflNNRV9RT1NfMTZCSVRfTVNCLAorICAgICAgcElucHV0X1RzcGVjX0luZm8tPm5vbWluYWxfbXNkdV9zaXplICYgflNNRV9RT1NfMTZCSVRfTVNCKTsKKworICAgaWYoICgocEN1cnJlbnRfVHNwZWNfSW5mby0+bm9taW5hbF9tc2R1X3NpemUgPT0gMCkgfHwKKyAgICAgICAgKHBDdXJyZW50X1RzcGVjX0luZm8tPm5vbWluYWxfbXNkdV9zaXplICYgU01FX1FPU18xNkJJVF9NU0IpKSAmJgorICAgICAgICgocElucHV0X1RzcGVjX0luZm8tPm5vbWluYWxfbXNkdV9zaXplID09IDApIHx8CisgICAgICAgIChwSW5wdXRfVHNwZWNfSW5mby0+bm9taW5hbF9tc2R1X3NpemUgJiBTTUVfUU9TXzE2QklUX01TQikpKQorICAgeworICAgICBUc3BlY0luZm8ubm9taW5hbF9tc2R1X3NpemUgfD0gU01FX1FPU18xNkJJVF9NU0I7CisgICB9CisKKyAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICBEYXRhIHJhdGVzOiAKKyAgICAgQWRkIHVwIHRoZSByYXRlcyBmb3IgYWdncmVnYXRpb24KKyAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworICAgU01FX1FPU19CT1VOREVEX1UzMl9BRERfWV9UT19YKCBUc3BlY0luZm8ucGVha19kYXRhX3JhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI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HNwZWNJbmZvLnN1cnBsdXNfYndfYWxsb3dhbmNlID0gU01FX1FPU19TVVJQTFVTX0JXX0FMTE9XQU5DRTsKKyAgIH0KKyAgIC8qIFNldCBhY2tfcG9saWN5IHRvIGJsb2NrIGFjayBldmVuIGlmIG9uZSBzdHJlYW0gcmVxdWVzdHMgYmxvY2sgYWNrIHBvbGljeSAqLworICAgaWYoKHBJbnB1dF9Uc3BlY19JbmZvLT50c19pbmZvLmFja19wb2xpY3kgPT0gU01FX1FPU19XTU1fVFNfQUNLX1BPTElDWV9IVF9JTU1FRElBVEVfQkxPQ0tfQUNLKSB8fAorICAgICAgKHBDdXJyZW50X1RzcGVjX0luZm8tPnRzX2luZm8uYWNrX3BvbGljeSA9PSBTTUVfUU9TX1dNTV9UU19BQ0tfUE9MSUNZX0hUX0lNTUVESUFURV9CTE9DS19BQ0spKQorICAgeworICAgICBUc3BlY0luZm8udHNfaW5mby5hY2tfcG9saWN5ID0gU01FX1FPU19XTU1fVFNfQUNLX1BPTElDWV9IVF9JTU1FRElBVEVfQkxPQ0tfQUNLOworICAgfQorCisgICBpZihwSW5wdXRfVHNwZWNfSW5mby0+dHNfaW5mby5idXJzdF9zaXplX2RlZm4gfHwgcEN1cnJlbnRfVHNwZWNfSW5mby0+dHNfaW5mby5idXJzdF9zaXplX2RlZm4gKQorICAgeworICAgICBUc3BlY0luZm8udHNfaW5mby5idXJzdF9zaXplX2RlZm4gPSAxOworICAgfQorICAgaWYocFVwZGF0ZWRfVHNwZWNfSW5mbykKKyAgIHsKKyAgICAgIHZvc19tZW1fY29weShwVXBkYXRlZF9Uc3BlY19JbmZvLCAmVHNwZWNJbmZvLCAKKyAgICAgICAgICAgICAgICAgICBzaXplb2Yoc21lX1Fvc1dtbVRzcGVjSW5mbykpOworICAgfQorICAgZWxzZQorICAgeworICAgICAgdm9zX21lbV9jb3B5KHBDdXJyZW50X1RzcGVjX0luZm8sICZUc3BlY0luZm8sIAorICAgICAgICAgICAgICAgICAgIHNpemV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lY19tYXNrID09IGZsb3dfaW5mby0+dHNwZWNfbWFzaykpCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsIAorICAgICAgICAgICAgICAgICAgICIlczogJWQ6IEZsb3cgJWQgbWF0Y2hlcyIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgIGZsb3dfaW5mby0+UW9zRmxvd0lEKTsKKyAgICAgICAgIAorICAgICAgICAgaWYoKFNNRV9RT1NfUkVBU09OX1JFTEVBU0UgPT0gZmxvd19pbmZvLT5yZWFzb24gKSB8fAorICAgICAgICAgICAgKFNNRV9RT1NfUkVBU09OX01PRElGWSA9PSBmbG93X2luZm8tPnJlYXNvbikpCisgICAgICAgICB7CisgICAgICAgICAgICAvL21zZworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBTa2lwcGluZyBGbG93ICVkIGFzIGl0IGlzIG1hcmtlZCAiCisgICAgICAgICAgICAgICAgICAgICAgImZvciByZWxlYXNlL21vZGlmeSIsCisgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgICAgIGZsb3dfaW5mby0+UW9zRmxvd0lEKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzbWVfUW9zQWdncmVnYXRlUGFyYW1zKCZmbG93X2luZm8tPlFvU0luZm8sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJlRzcGVjX0luZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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k9TX0ZBTFNFICk7CisgICAgICBmbG93X2luZm8gPSBHRVRfQkFTRV9BRERSKCBwRW50cnksIHNtZV9Rb3NGbG93SW5mb0VudHJ5LCBsaW5rICk7CisgICAgICBpZigoc2VhcmNoX2tleS5zZXNzaW9uSWQgPT0gZmxvd19pbmZvLT5zZXNzaW9uSWQpIHx8CisgICAgICAgICAoc2VhcmNoX2tleS5zZXNzaW9uSWQgPT0gU01FX1FPU19TRUFSQ0hfU0VTU0lPTl9JRF9BTlkpKQorICAgICAgeworICAgICAgICAgaWYoc2VhcmNoX2tleS5pbmRleCAmIFNNRV9RT1NfU0VBUkNIX0tFWV9JTkRFWF8xKQorICAgICAgICAgeworICAgICAgICAgICAgaWYoc2VhcmNoX2tleS5rZXkuUW9zRmxvd0lEID09IGZsb3dfaW5mby0+UW9zRmxvd0lEKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLy9tc2cKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogbWF0Y2ggZm91bmQgb24gZmxvd0lELCBlbmRpbmcgc2VhcmNoIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18pOworICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgICBlbHNlIGlmKHNlYXJjaF9rZXkuaW5kZXggJiBTTUVfUU9TX1NFQVJDSF9LRVlfSU5ERVhfMikKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGlmKHNlYXJjaF9rZXkua2V5LmFjX3R5cGUgPT0gZmxvd19pbmZvLT5hY190eXBlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLy9tc2cKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogbWF0Y2ggZm91bmQgb24gYWMsIGVuZGluZyBzZWFyY2giLAorICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXyk7CisgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UgaWYoc2VhcmNoX2tleS5pbmRleCAmIFNNRV9RT1NfU0VBUkNIX0tFWV9JTkRFWF8zKQorICAgICAgICAgeworICAgICAgICAgICAgaWYoc2VhcmNoX2tleS5rZXkucmVhc29uID09IGZsb3dfaW5mby0+cmVhc29uKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLy9tc2cKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogbWF0Y2ggZm91bmQgb24gcmVhc29uLCBlbmRpbmcgc2VhcmNoIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18pOworICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgICBlbHNlIGlmKHNlYXJjaF9rZXkuaW5kZXggJiBTTUVfUU9TX1NFQVJDSF9LRVlfSU5ERVhfNCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGlmKChzZWFyY2hfa2V5LmtleS5hY190eXBlID09IGZsb3dfaW5mby0+YWNfdHlwZSkgJiYgCisgICAgICAgICAgICAgICAoc2VhcmNoX2tleS5kaXJlY3Rpb24gPT0gZmxvd19pbmZvLT5Rb1NJbmZvLnRzX2luZm8uZGlyZWN0aW9uKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8vbXNnCisgICAgICAgICAgICAgICBWT1Nf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Zsb3dfaW5mbyA9IEdFVF9CQVNFX0FERFIoIHBFbnRyeSwgc21lX1Fvc0Zsb3dJbmZvRW50cnksIGxpbmsgKTsKKyAgICAgIHBTZXNzaW9uID0gJnNtZV9Rb3NDYi5zZXNzaW9uSW5mb1tmbG93X2luZm8tPnNlc3Npb25JZF07CisgICAgICBpZigoc2VhcmNoX2tleS5zZXNzaW9uSWQgPT0gZmxvd19pbmZvLT5zZXNzaW9uSWQpIHx8CisgICAgICAgICAoc2VhcmNoX2tleS5zZXNzaW9uSWQgPT0gU01FX1FPU19TRUFSQ0hfU0VTU0lPTl9JRF9BTlkpKQorICAgICAgeworICAgICAgICAgaWYoc2VhcmNoX2tleS5pbmRleCAmIFNNRV9RT1NfU0VBUkNIX0tFWV9JTkRFWF8xKQorICAgICAgICAgeworICAgICAgICAgICAgaWYoc2VhcmNoX2tleS5rZXkuUW9zRmxvd0lEID09IGZsb3dfaW5mby0+UW9zRmxvd0lEKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLy9tc2cKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogbWF0Y2ggZm91bmQgb24gZmxvd0lELCBlbmRpbmcgc2VhcmNoIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18pOworICAgICAgICAgICAgICAgc3RhdHVzID0gZm5wKHBNYWMsIHBFbnRyeSk7CisgICAgICAgICAgICAgICBpZihlSEFMX1NUQVRVU19GQUlMVVJFID09IHN0YXR1cykKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBGYWlsZWQgdG8gcHJvY2VzcyBlbnRyeSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fKTsKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICAgICAgZWxzZSBpZihzZWFyY2hfa2V5LmluZGV4ICYgU01FX1FPU19TRUFSQ0hfS0VZX0lOREVYXzIpCisgICAgICAgICB7CisgICAgICAgICAgICBpZihzZWFyY2hfa2V5LmtleS5hY190eXBlID09IGZsb3dfaW5mby0+YWNfdHlwZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8vbXNnCisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsIAorICAgICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IG1hdGNoIGZvdW5kIG9uIGFjLCBlbmRpbmcgc2VhcmNoIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18pOworICAgICAgICAgICAgICAgZmxvd19pbmZvLT5ob1JlbmV3YWwgPSBwU2Vzc2lvbi0+YWNfaW5mb1tmbG93X2luZm8tPmFjX3R5cGVdLmhvUmVuZXdhbDsKKyAgICAgICAgICAgICAgIHN0YXR1cyA9IGZucChwTWFjLCBwRW50cnkpOworICAgICAgICAgICAgICAgaWYoZUhBTF9TVEFUVVNfRkFJTFVSRSA9PSBzdGF0dXMpCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogRmFpbGVkIHRvIHByb2Nlc3MgZW50cnkiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBf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UsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgIiVzOiAlZDogcFNpckJzc0Rlc2MgaXMgTlVMTCIsCisgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fKTsKKyAgICAgIHJldHVybiBWT1NfRkFMU0U7CisgICB9CisKKyAgIGlmIChOVUxMICE9IHBJZXMpCisgICB7CisgICAgICAvKiBJRXMgd2VyZSBwcm92aWRlZCBzbyB1c2UgdGhlbSBsb2NhbGx5ICovCisgICAgICBwSWVzTG9jYWwgPSBwSWVzOworICAgfQorICAgZWxzZQorICAgeworICAgICAgLyogSUVzIHdlcmUgbm90IHByb3ZpZGVkIHNvIHBhcnNlIHRoZW0gb3Vyc2VsdmVzICovCisgICAgICBpZiAoIUhBTF9TVEFUVVNfU1VDQ0VTUyhjc3JHZXRQYXJzZWRCc3NEZXNjcmlwdGlvbklFcyhwTWFjLCBwU2lyQnNzRGVzYywgJnBJZXNMb2NhbCkpKQorICAgICAgeworICAgICAgICAgLy9lcnIgbXNnCisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogY3NyR2V0UGFyc2VkQnNzRGVzY3JpcHRpb25JRXMoKSBmYWlsZWQiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXyk7CisgICAgICAgICByZXR1cm4gVk9TX0ZBTFNFOworICAgICAgfQorCisgICAgICAvKiBpZiBzdWNjZXNzIHRoZW4gcEllc0xvY2FsIHdhcyBhbGxvY2F0ZWQgKi8KKyAgIH0KKworICAgaWYoQ1NSX0lTX1FPU19CU1MocEllc0xvY2FsKSkKKyAgIHsKKyAgICAgICBzd2l0Y2goYWMpCisgICAgICAgeworICAgICAgICAgIGNhc2UgU01FX1FPU19FRENBX0FDX0JFOgorICAgICAgICAgICAgIGlmKHBJZXNMb2NhbC0+V01NUGFyYW1zLmFjYmVfYWNtKSByZXRfdmFsID0gVk9TX1RSVUU7CisgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY2FzZSBTTUVfUU9TX0VEQ0FfQUNfQks6CisgICAgICAgICAgICAgaWYocEllc0xvY2FsLT5XTU1QYXJhbXMuYWNia19hY20pIHJldF92YWwgPSBWT1NfVFJVRTsKKyAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlIFNNRV9RT1NfRURDQV9BQ19WSToKKyAgICAgICAgICAgICBpZihwSWVzTG9jYWwtPldNTVBhcmFtcy5hY3ZpX2FjbSkgcmV0X3ZhbCA9IFZPU19UUlVFOworICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgU01FX1FPU19FRENBX0FDX1ZPOgorICAgICAgICAgICAgIGlmKHBJZXNMb2NhbC0+V01NUGFyYW1zLmFjdm9fYWNtKSByZXRfdmFsID0gVk9TX1RSVUU7CisgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IHVua25vd24gQUMgPSAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywgYWMpOworICAgICAgICAgICAgIC8vQXNzZXJ0CisgICAgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgICAgICBicmVhazsKKyAgICAgICB9CisgICB9Ly9JU19RT1NfQlNTCisgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsIAorICAgICAgICAgICAgICIlczogJWQ6IEFDTSA9ICVkIGZvciBBQyA9ICVkIiwKKyAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sIHJld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3NDYi5mbG93X2xpc3QsIFZPU19GQUxTRSApOworICAgaWYoIXBFbnRyeSkKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAiJXM6ICVkOiBGbG93IExpc3QgZW1wdHksIG5vdGhpbmcgdG8gYnVmZmVyIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18pOworICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICB9CisgICB3aGlsZSggcEVudHJ5ICkKKyAgIHsKKyAgICAgIHBOZXh0RW50cnkgPSBjc3JMTE5leHQoICZzbWVfUW9zQ2IuZmxvd19saXN0LCBwRW50cnksIFZPU19GQUxTRSApOworICAgICAgZmxvd19pbmZvID0gR0VUX0JBU0VfQUREUiggcEVudHJ5LCBzbWVfUW9zRmxvd0luZm9FbnRyeSwgbGluayApOworICAgICAgaWYgKGZsb3dfaW5mby0+c2Vzc2lvbklkID09IHNlc3Npb25JZCkKKyAgICAgIHsKKyAgICAgICAgIGlmKChTTUVfUU9TX1JFQVNPTl9SRVFfU1VDQ0VTUyA9PSBmbG93X2luZm8tPnJlYXNvbiApfHwKKyAgICAgICAgICAgIChTTUVfUU9TX1JFQVNPTl9TRVRVUCA9PSBmbG93X2luZm8tPnJlYXNvbiApKQorICAgICAgICAgeworICAgICAgICAgICAgY21kLmNvbW1hbmQgPSBTTUVfUU9TX1NFVFVQX1JFUTsKKyAgICAgICAgICAgIGNtZC5wTWFjID0gcE1hYzsKKyAgICAgICAgICAgIGNtZC5zZXNzaW9uSWQgPSBzZXNzaW9uSWQ7CisgICAgICAgICAgICBjbWQudS5zZXR1cENtZEluZm8uSEREY29udGV4dCA9IGZsb3dfaW5mby0+SEREY29udGV4dDsKKyAgICAgICAgICAgIGNtZC51LnNldHVwQ21kSW5mby5Rb1NJbmZvID0gZmxvd19pbmZvLT5Rb1NJbmZvOworICAgICAgICAgICAgY21kLnUuc2V0dXBDbWRJbmZvLlFvU0NhbGxiYWNrID0gZmxvd19pbmZvLT5Rb1NDYWxsYmFjazsKKyAgICAgICAgICAgIGNtZC51LnNldHVwQ21kSW5mby5VUFR5cGUgPSBTTUVfUU9TX1dNTV9VUF9NQVg7Ly9zaG91bGRuJ3QgYmUgbmVlZGVkCisgICAgICAgICAgICBjbWQudS5zZXR1cENtZEluZm8uUW9zRmxvd0lEID0gZmxvd19pbmZvLT5Rb3NGbG93SUQ7CisgICAgICAgICAgICBpZihTTUVfUU9TX1JFQVNPTl9TRVRVUCA9PSBmbG93X2luZm8tPnJlYXNvbiApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBjbWQudS5zZXR1cENtZEluZm8uaG9SZW5ld2FsID0gVk9TX0ZBTFNFOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgY21kLnUuc2V0dXBDbWRJbmZvLmhvUmVuZXdhbCA9IFZPU19UUlVFOy8vVE9ETzogbWlnaHQgbmVlZCB0aGlzIGZvciBtb2RpZnkKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc21lX1Fvc0J1ZmZlckNtZCgmY21kLCBWT1NfVFJVRSkpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IGNvdWxkbid0IGJ1ZmZlciB0aGUgc2V0dXAgcmVxdWVzdCBmb3IgIgorICAgICAgICAgICAgICAgICAgICAgICAgICJmbG93ICVkIGluIGhhbmRvZmYgc3RhdGUiLAorICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICAgICAgICBmbG93X2luZm8tPlFvc0Zsb3dJRCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsIAorICAgICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IGJ1ZmZlcmVkIGEgc2V0dXAgcmVxdWVzdCBmb3IgIgorICAgICAgICAgICAgICAgICAgICAgICAgICJmbG93ICVkIGluIGhhbmRvZmYgc3RhdGUiLAorICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICAgICAgICBmbG93X2luZm8tPlFvc0Zsb3dJRCk7CisgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgICBlbHNlIGlmKFNNRV9RT1NfUkVBU09OX1JFTEVBU0UgPT0gZmxvd19pbmZvLT5yZWFzb24gKSAKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGNtZC5jb21tYW5kID0gU01FX1FPU19SRUxFQVNFX1JFUTsKKyAgICAgICAgICAgIGNtZC5wTWFjID0gcE1hYzsKKyAgICAgICAgICAgIGNtZC5zZXNzaW9uSWQgPSBzZXNzaW9uSWQ7CisgICAgICAgICAgICBjbWQudS5yZWxlYXNlQ21kSW5mby5Rb3NGbG93SUQgPSBmbG93X2luZm8tPlFvc0Zsb3dJRDsKKyAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc21lX1Fvc0J1ZmZlckNtZCgmY21kLCBWT1NfVFJVRSkpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IGNvdWxkbid0IGJ1ZmZlciB0aGUgcmVsZWFzZSByZXF1ZXN0IGZvciAiCisgICAgICAgICAgICAgICAgICAgICAgICAgImZsb3cgJWQgaW4gaGFuZG9mZiBzdGF0ZSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgICAgICAgIGZsb3dfaW5mby0+UW9zRmxvd0lEKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogYnVmZmVyZWQgYSByZWxlYXNlIHJlcXVlc3QgZm9yICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAiZmxvdyAlZCBpbiBoYW5kb2ZmIHN0YXRlIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgICAgICAgICAgZmxvd19pbmZvLT5Rb3NGbG93SUQpOworICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICAgICAgZWxzZSBpZihTTUVfUU9TX1JFQVNPTl9NT0RJRllfUEVORElORyA9PSBmbG93X2luZm8tPnJlYXNvbikKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGNtZC5jb21tYW5kID0gU01FX1FPU19NT0RJRllfUkVROworICAgICAgICAgICAgY21kLnBNYWMgPSBwTWFjOworICAgICAgICAgICAgY21kLnNlc3Npb25JZCA9IHNlc3Npb25JZDsKKyAgICAgICAgICAgIGNtZC51Lm1vZGlmeUNtZEluZm8uUW9zRmxvd0lEID0gZmxvd19pbmZvLT5Rb3NGbG93SUQ7CisgICAgICAgICAgICBjbWQudS5tb2RpZnlDbWRJbmZvLlFvU0luZm8gPSBmbG93X2luZm8tPlFvU0luZm87CisgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHNtZV9Rb3NCdWZmZXJDbWQoJmNtZCwgVk9TX1RSVUUpKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBjb3VsZG4ndCBidWZmZXIgdGhlIG1vZGlmeSByZXF1ZXN0IGZvciAiCisgICAgICAgICAgICAgICAgICAgICAgICAgImZsb3cgJWQgaW4gaGFuZG9mZiBzdGF0ZSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgICAgICAgIGZsb3dfaW5mby0+UW9zRmxvd0lEKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogYnVmZmVyZWQgYSBtb2RpZnkgcmVxdWVzdCBmb3IgIgorICAgICAgICAgICAgICAgICAgICAgICAgICJmbG93ICVkIGluIGhhbmRvZmYgc3RhdGUiLAorICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICAgICAgICBmbG93X2luZm8tPlFvc0Zsb3dJRCk7CisgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgICAvL2RlbGV0ZSB0aGUgZW50cnkgZnJvbSBGbG93IExpc3QKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgCisgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogRGVsZXRpbmcgb3JpZ2luYWw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ICAgICAgICAgICAgICAgdl9VOF90IHNlc3Npb25JZCkKK3sKKyAgIHRMaXN0RWxlbSAqcEVudHJ5PSBOVUxMLCAqcE5leHRFbnRyeSA9IE5VTEw7CisgICBzbWVfUW9zRmxvd0luZm9FbnRyeSAqZmxvd19pbmZvID0gTlVMTDsKKyAgIHBFbnRyeSA9IGNzckxMUGVla0hlYWQoICZzbWVfUW9zQ2IuZmxvd19saXN0LCBWT1NfVFJVRSApOworICAgaWYoIXBFbnRyeSkKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgIiVzOiAlZDogRmxvdyBMaXN0IGVtcHR5LCBub3RoaW5nIHRvIGRlbGV0ZSIsCisgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fKTsKKyAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgfQorICAgd2hpbGUoIHBFbnRyeSApCisgICB7CisgICAgICBwTmV4dEVudHJ5ID0gY3NyTExOZXh0KCAmc21lX1Fvc0NiLmZsb3dfbGlzdCwgcEVudHJ5LCBWT1NfVFJVRSApOworICAgICAgZmxvd19pbmZvID0gR0VUX0JBU0VfQUREUiggcEVudHJ5LCBzbWVfUW9zRmxvd0luZm9FbnRyeSwgbGluayApOworICAgICAgaWYgKGZsb3dfaW5mby0+c2Vzc2lvbklkID09IHNlc3Npb25JZCkKKyAgICAgIHsKKyAgICAgICAgIGlmKChTTUVfUU9TX1JFQVNPTl9SRVFfU1VDQ0VTUyA9PSBmbG93X2luZm8tPnJlYXNvbiApfHwKKyAgICAgICAgICAgIChTTUVfUU9TX1JFQVNPTl9TRVRVUCA9PSBmbG93X2luZm8tPnJlYXNvbiApfHwKKyAgICAgICAgICAgIChTTUVfUU9TX1JFQVNPTl9SRUxFQVNFID09IGZsb3dfaW5mby0+cmVhc29uICl8fAorICAgICAgICAgICAgKFNNRV9RT1NfUkVBU09OX01PRElGWSA9PSBmbG93X2luZm8tPnJlYXNvbiApKQorICAgICAgICAgeworICAgICAgICAgICAgZmxvd19pbmZvLT5Rb1NDYWxsYmFjayhwTWFjLCBmbG93X2luZm8tPkhERGNvbnRleHQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTTUVfUU9TX1NUQVRVU19SRUxFQVNFX1FPU19MT1NUX0lORCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvd19pbmZvLT5Rb3NGbG93SUQpOworICAgICAgICAgfQorICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICIlczogJWQ6IERlbGV0aW5nIGVudHJ5IGF0ICVwIHdpdGggZmxvd0lEICVkIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgICAgZmxvd19pbmZvLCBmbG93X2luZm8tPlFvc0Zsb3dJRCk7CisgICAgICAgICAvL2RlbGV0ZSB0aGUgZW50cnkgZnJvbSBGbG93IExpc3QKKyAgICAgICAgIGNzckxMUmVtb3ZlRW50cnkoJnNtZV9Rb3NDYi5mbG93X2xpc3QsIHBFbnRyeSwgVk9TX1RSVUUgKTsKKyAgICAgICAgIHZvc19tZW1fZnJlZShmbG93X2luZm8pOworICAgICAgfQorICAgICAgcEVudHJ5ID0gcE5leHRFbnRyeTsKKyAgIH0KKyAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworfQorLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBcYnJpZWYgc21lX1Fvc0J1ZmZlckNtZCgpIC0gVXRpb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JlIGJ1ZmZlcmVkIGNvbW1hbmRzIG9uIHNlc3Npb24gJWQiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICBzZXNzaW9uSWQpOworICAgICAgICAgcFNlc3Npb24tPnJlYWR5Rm9yUG93ZXJTYXZlID0gVk9TX1RSVUU7CisgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgIH0KKyAgICAgIHBjbWQgPSBHRVRfQkFTRV9BRERSKCBwRW50cnksIHNtZV9Rb3NDbWRJbmZvRW50cnksIGxpbmsgKTsKKyAgICAgIHN3aXRjaChwY21kLT5jbWRJbmZvLmNvbW1hbmQpCisgICAgICB7CisgICAgICBjYXNlIFNNRV9RT1NfU0VUVVBfUkVROgorICAgICAgICAgaGRkX3N0YXR1cyA9IHNtZV9Rb3NJbnRlcm5hbFNldHVwUmVxKHBjbWQtPmNtZEluZm8ucE1hYywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGNtZC0+Y21kSW5mby5zZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBjbWQtPmNtZEluZm8udS5zZXR1cENtZEluZm8uUW9TSW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwY21kLT5jbWRJbmZvLnUuc2V0dXBDbWRJbmZvLlFvU0NhbGxiYWNrLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwY21kLT5jbWRJbmZvLnUuc2V0dXBDbWRJbmZvLkhERGNvbnRleHQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBjbWQtPmNtZEluZm8udS5zZXR1cENtZEluZm8uVVBUeXBlLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwY21kLT5jbWRJbmZvLnUuc2V0dXBDbWRJbmZvLlFvc0Zsb3dJRCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSVUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGNtZC0+Y21kSW5mby51LnNldHVwQ21kSW5mby5ob1JlbmV3YWwpOworICAgICAgICAgaWYoU01FX1FPU19TVEFUVVNfU0VUVVBfRkFJTFVSRV9SU1AgPT0gaGRkX3N0YXR1cykKKyAgICAgICAgIHsKKyAgICAgICAgICAgIC8vRXJyIG1zZworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IHNtZV9Rb3NJbnRlcm5hbFNldHVwUmVxIGZhaWxlZCBvbiBzZXNzaW9uICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkKTsKKyAgICAgICAgICAgIGhhbFN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICB9CisgICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgU01FX1FPU19SRUxFQVNFX1JFUToKKyAgICAgICAgIGhkZF9zdGF0dXMgPSBzbWVfUW9zSW50ZXJuYWxSZWxlYXNlUmVxKHBjbWQtPmNtZEluZm8ucE1hYywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwY21kLT5jbWRJbmZvLnUucmVsZWFzZUNtZEluZm8uUW9zRmxvd0lELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSVUUpOworICAgICAgICAgaWYoU01FX1FPU19TVEFUVVNfUkVMRUFTRV9GQUlMVVJFX1JTUCA9PSBoZGRfc3RhdHVzKQorICAgICAgICAgeworICAgICAgICAgICAgLy9FcnIgbXNnCisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogc21lX1Fvc0ludGVybmFsUmVsZWFzZVJlcSBmYWlsZWQgb24gc2Vzc2lvbiAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCk7CisgICAgICAgICAgICBoYWxTdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgfQorICAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIFNNRV9RT1NfTU9ESUZZX1JFUToKKyAgICAgICAgIGhkZF9zdGF0dXMgPSBzbWVfUW9zSW50ZXJuYWxNb2RpZnlSZXEocGNtZC0+Y21kSW5mby5wTWFjLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBjbWQtPmNtZEluZm8udS5tb2RpZnlDbWRJbmZvLlFvU0luZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBjbWQtPmNtZEluZm8udS5tb2RpZnlDbWRJbmZvLlFvc0Zsb3dJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSVUUpOworICAgICAgICAgaWYoU01FX1FPU19TVEFUVVNfTU9ESUZZX1NFVFVQX0ZBSUxVUkVfUlNQID09IGhkZF9zdGF0dXMpCisgICAgICAgICB7CisgICAgICAgICAgICAvL0VyciBtc2cKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBzbWVfUW9zSW50ZXJuYWxNb2RpZnlSZXEgZmFpbGVkIG9uIHNlc3Npb24gJWQiLAorICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uSWQpOworICAgICAgICAgICAgaGFsU3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgIH0KKyAgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBTTUVfUU9TX1JFU0VORF9SRVE6CisgICAgICAgICBoZGRfc3RhdHVzID0gc21lX1Fvc1JlUmVxdWVzdEFkZFRTKHBjbWQtPmNtZEluZm8ucE1hYywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBjbWQtPmNtZEluZm8uc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcGNtZC0+Y21kSW5mby51LnJlc2VuZENtZEluZm8uUW9TSW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGNtZC0+Y21kSW5mby51LnJlc2VuZENtZEluZm8uYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBjbWQtPmNtZEluZm8udS5yZXNlbmRDbWRJbmZvLnRzcGVjTWFzayk7CisgICAgICAgICBpZihTTUVfUU9TX1NUQVRVU19NT0RJRllfU0VUVVBfRkFJTFVSRV9SU1AgPT0gaGRkX3N0YXR1cykKKyAgICAgICAgIHsKKyAgICAgICAgICAgIC8vRXJyIG1zZworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IHNtZV9Rb3NSZVJlcXVlc3RBZGRUUyBmYWlsZWQgb24gc2Vzc2lvbiAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCk7CisgICAgICAgICAgICBoYWxTdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgfQorICAgICAgICAgYnJlYWs7CisgICAgICBkZWZhdWx0OgorICAgICAgICAgLy9lcnIgbXNnCisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogT24gc2Vzc2lvbiAlZCB1bmtub3duIGNtZCA9ICVkIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkLCBwY21kLT5jbWRJbmZvLmNvbW1hbmQpOworICAgICAgICAgLy9BU1NFUlQKKyAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIC8vIGJ1ZmZlcmVkIGNvbW1hbmQgaGFzIGJlZW4gcHJvY2Vzc2VkLCByZWNsYWltIHRoZSBtZW1vcnkKKyAgICAgIHZvc19tZW1fZnJlZShwY21kKTsKKyAgIH0KKyAgIGVsc2UKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwgCisgICAgICAgICAgICAgICAgIiVzOiAlZDogY21kIGJ1ZmZlciBlbXB0eSIsCisgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fKTsKKyAgICAgIHBTZXNzaW9uLT5yZWFkeUZvclBvd2VyU2F2ZSA9IFZPU19UUlVFOworICAgfQorICAgcmV0dXJuIGhhbFN0YXR1czsKK30KKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbik7CisgICAgICAgICAgICAvLyBpZiBQTUMgZG9lc24ndCByZXR1cm4gc3VjY2VzcyByaWdodCBhd2F5IG1lYW5zIGl0IGlzIHlldCB0byBwdXQKKyAgICAgICAgICAgIC8vIHRoZSBtb2R1bGUgaW4gQk1QUyBzdGF0ZSAmIGxhdGVyIHRvIFVBUFNEIHN0YXRlCisgICAgICAgICAKKyAgICAgICAgICAgIGlmKGVIQUxfU1RBVFVTX0ZBSUxVUkUgPT0gcG1jX3N0YXR1cykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGhkZF9zdGF0dXMgPSBTTUVfUU9TX1NUQVRVU19TRVRVUF9TVUNDRVNTX0lORF9BUFNEX1NFVF9GQUlMRUQ7CisgICAgICAgICAgICAgICAvL3dlIG5lZWQgdG8gYWx3YXlzIG5vdGlmeSB0aGlzIGNhc2UKKyAgICAgICAgICAgICAgIGZsb3dfaW5mby0+aG9SZW5ld2FsID0gVk9TX0ZBTFNFOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZihlSEFMX1NUQVRVU19QTUNfUEVORElORyA9PSBwbWNfc3RhdHVzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLy8gbGV0IG90aGVyIGZsb3dzIGtub3cgUE1DIGhhcyBiZWVuIG5vdGlmaWVkCisgICAgICAgICAgICAgICBwU2Vzc2lvbi0+dWFwc2RBbHJlYWR5UmVxdWVzdGVkID0gVk9TX1RSVUU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBmb3IgYW55IG90aGVyIHBtYyBzdGF0dXMgd2UgZGVjbGFyZSBzdWNjZXNzCisgICAgICAgICB9CisgICAgICB9CisgICAgICBicmVhazsKKyAgIGNhc2UgU01FX1FPU19SRUFTT05fUkVMRUFTRToKKyAgICAgIHBBQ0luZm8tPm51bV9mbG93c1tTTUVfUU9TX1RTUEVDX0lOREVYXzBdLS07CisgICAg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ICAgIGlmKGVIQUxfU1RBVFVTX0ZBSUxVUkUgPT0gcG1jX3N0YXR1cykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGhkZF9zdGF0dXMgPSBTTUVfUU9TX1NUQVRVU19NT0RJRllfU0VUVVBfU1VDQ0VTU19JTkRfQVBTRF9TRVRfRkFJTEVEOworICAgICAgICAgICAgICAgLy8gd2UgbmVlZCB0byBhbHdheXMgbm90aWZ5IHRoaXMgY2FzZQorICAgICAgICAgICAgICAgZmxvd19pbmZvLT5ob1JlbmV3YWwgPSBWT1NfRkFMU0U7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKGVIQUxfU1RBVFVTX1BNQ19QRU5ESU5HID09IHBtY19zdGF0dXMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBwU2Vzc2lvbi0+dWFwc2RBbHJlYWR5UmVxdWVzdGVkID0gVk9TX1RSVUU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBmb3IgYW55IG90aGVyIHBtYyBzdGF0dXMgd2UgZGVjbGFyZSBzdWNjZXNzCisgICAgICAgICB9CisgICAgICB9CisgICAgICBicmVhazsKKyAgIGNhc2UgU01FX1FPU19SRUFTT05fUkVRX1NVQ0NFU1M6CisgICAgICBoZGRfc3RhdHVzID0gU01FX1FPU19TVEFUVVNfU0VUVVBfTU9ESUZJRURfSU5EOworICAgICAgLy8gZmFsbCB0aHJvdWdoCisgICBkZWZhdWx0OgorICAgICAgZGVsZXRlX2VudHJ5ID0gVk9TX0ZBTFNFOworICAgICAgYnJlYWs7CisgICB9CisgICBpZighZGVsZXRlX2VudHJ5KQorICAgeworICAgICAgaWYoIWZsb3dfaW5mby0+aG9SZW5ld2FsKQorICAgICAgeworICAgICAgICAgZmxvd19pbmZvLT5Rb1NDYWxsYmFjayhwTWFjLCBmbG93X2luZm8tPkhERGNvbnRleHQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEFDSW5mby0+Y3Vyc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RzcGVjX3BlbmRpbmcgLSAxXSk7CisgICAgICAgIHBBQ0luZm8tPm51bV9mbG93c1twQUNJbmZvLT50c3BlY19wZW5kaW5nIC0gMV0tLTsKKyAgICAgICAgaW5mb3JtX2hkZCA9IFZPU19UUlVFOworICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgIGRlZmF1bHQ6CisgICAgICBpbmZvcm1faGRkID0gVk9TX0ZBTFNFOworICAgICAgYnJlYWs7CisgICB9CisgICBpZihpbmZvcm1faGRkKQorICAgeworICAgICAgLy9ub3RpZnkgSERELCBvbmx5IHRoZSByZXF1ZXN0ZWQgRmxvdywgb3RoZXIgRmxvd3MgcnVubmluZyBvbiB0aGUgQUMgc3RheSAKKyAgICAgIC8vIGludGFjdAorICAgICAgaWYoIWZsb3dfaW5mby0+aG9SZW5ld2FsKQorICAgICAgeworICAgICAgICAgZmxvd19pbmZvLT5Rb1NDYWxsYmFjayhwTWFjLCBmbG93X2luZm8tPkhERGNvbnRleHQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEFDSW5mby0+Y3Vycl9Rb1NJbmZvW3BBQ0luZm8tPnRzcGVjX3BlbmRpbmcgLSAxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGRkX3N0YXR1cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvd19pbmZvLT5Rb3NGbG93SUQpOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgZmxvd19pbmZvLT5Rb1NDYWxsYmFjayhwTWFjLCBmbG93X2luZm8tPkhERGNvbnRleHQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEFDSW5mby0+Y3Vycl9Rb1NJbmZvW3BBQ0luZm8tPnRzcGVjX3BlbmRpbmcgLSAxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU01FX1FPU19TVEFUVVNfUkVMRUFTRV9RT1NfTE9TVF9JTkQsCisgICAgICAgICAgIC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bmcKKyAgICAgICAgIGlmKCFwU2Vzc2lvbi0+dWFwc2RBbHJlYWR5UmVxdWVzdGVkKQorICAgICAgICAgeworICAgICAgICAgICAgLy8gdGhpcyBpcyB0aGUgZmlyc3QgZmxvdyB0byBkZXRlY3Qgd2UgbmVlZCBQTUMgaW4gVUFQU0QgbW9kZQorICAgICAgICAgICAgcG1jX3N0YXR1cyA9IHBtY1N0YXJ0VWFwc2QocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtZV9Rb3NQbWNTdGFydFVhcHNkQ2FsbGJhY2ssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbik7CisgICAgICAgICAgICAvLyBpZiBQTUMgZG9lc24ndCByZXR1cm4gc3VjY2VzcyByaWdodCBhd2F5IG1lYW5zIGl0IGlzIHlldCB0byBwdXQKKyAgICAgICAgICAgIC8vIHRoZSBtb2R1bGUgaW4gQk1QUyBzdGF0ZSAmIGxhdGVyIHRvIFVBUFNEIHN0YXRlCisgICAgICAgICAgICBpZihlSEFMX1NUQVRVU19GQUlMVVJFID09IHBtY19zdGF0dXMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBoZGRfc3RhdHVzID0gU01FX1FPU19TVEFUVVNfU0VUVVBfU1VDQ0VTU19JTkRfQVBTRF9TRVRfRkFJTEVEOworICAgICAgICAgICAgICAgLy8gd2UgbmVlZCB0byBhbHdheXMgbm90aWZ5IHRoaXMgY2FzZQorICAgICAgICAgICAgICAgZmxvd19pbmZvLT5ob1JlbmV3YWwgPSBWT1NfRkFMU0U7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKGVIQUxfU1RBVFVTX1BNQ19QRU5ESU5HID09IHBtY19zdGF0dXMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvLyBsZXQgb3RoZXIgZmxvd3Mga25vdyBQTUMgaGFzIGJlZW4gbm90aWZpZWQKKyAgICAgICAgICAg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worICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZihlSEFMX1NUQVRVU19QTUNfUEVORElORyA9PSBwbWNfc3RhdHVzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLy8gbGV0IG90aGVyIGZsb3dzIGtub3cgUE1DIGhhcyBiZWVuIG5vdGlmaWVkCisgICAgICAgICAgICAgICBwU2Vzc2lvbi0+dWFwc2RBbHJlYWR5UmVxdWVzdGVkID0gVk9TX1RSVUU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBmb3IgYW55IG90aGVyIHBtYyBzdGF0dXMgd2UgZGVjbGFyZSBzdWNjZXNzCisgICAgICAgICB9CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgIGlmKChwQUNJbmZvLT5udW1fZmxvd3NbZmxvd19pbmZvLT50c3BlY19tYXNrIC0gMV0gPT0gMSkgJiYgCisgICAgICAgICAgIChTTUVfUU9TX1RTUEVDX01BU0tfQklUXzFfMl9TRVQgIT0gcEFDSW5mby0+dHNwZWNfbWFza19zdGF0dXMpKQorICAgICAgICB7CisgICAgICAgICAgLy8gdGhpcyBpcyB0aGUgb25seSBUU1BFQyBhY3RpdmUgb24gdGhpcyBBQworICAgICAgICAgIC8vIHNvIGluZGljYXRlIHRoYXQgd2Ugbm8gbG9uZ2VyIHJlcXVpcmUgQVBTRAorICAgICAgICAgIHBTZXNzaW9uLT5hcHNkTWFzayAmPSB+KDEgPDwgKFNNRV9RT1NfRURDQV9BQ19WTyAtIGFjKSk7CisgICAgICAgICAgLy9BbHNvIHVwZGF0ZSBtb2RpZnlQcm9maWxlRmllbGRzLnVhcHNkX21hc2sgaW4gQ1NSIGZvciBjb25zaXN0ZW5jeQorICAgICAgICAgIGNzckdldE1vZGlmeVByb2ZpbGVGaWVsZHMocE1hYywgZmxvd19pbmZvLT5zZXNzaW9uSWQsICZtb2RpZnlQcm9maWxlRmllbGRzKTsKKyAgICAgICAgICBtb2RpZnlQcm9maWxlRmllbGRzLnVhcHNkX21hc2sgPSBwU2Vzc2lvbi0+YXBzZE1hc2s7IAorICAgICAgICAgIGNzclNldE1vZGlmeVByb2ZpbGVGaWVsZHMocE1hYywgZmxvd19pbmZvLT5zZXNzaW9uSWQsICZtb2RpZnlQcm9maWxlRmllbGRzKTsKKyAgICAgICAgICBpZighcFNlc3Npb24tPmFwc2RNYXNrKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICAvLyB0aGlzIHNlc3Npb24gbm8gbG9uZ2VyIG5lZWRzIFVBUFNECisgICAgICAgICAgICAgLy8gZG8gYW55IHNlc3Npb25zIHN0aWxsIHJlcXVpcmUgVUFQU0Q/CisgICAgICAgICAgICAgaWYgKCFzbWVfUW9zSXNVYXBzZEFjdGl2ZSgpKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBObyBzZXNzaW9ucyByZXF1aXJlIFVBUFNEIHNvIHR1cm4gaXQgb2ZmCisgICAgICAgICAgICAgICAgLy8gKHJlYWxseSBkb24ndCBjYXJlIHdoZW4gUE1DIHN0b3BzIGl0KQorICAgICAgICAgICAgICAgICh2b2lkKXBtY1N0b3BVYXBzZChwTWFjKTsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB9CisgICAgICBicmVhazsKKyAgIGNhc2UgU01FX1FPU19SRUFTT05fUkVRX1NVQ0NFU1M6CisgICAgICBoZGRfc3RhdHVzID0gU01FX1FPU19TVEFUVVNfU0VUVVBfTU9ESUZJRURfSU5EOworICAgICAgaW5mb3JtX2hkZCA9IFZPU19UUlVFOworICAgZGVmYXVsdDoKKyAgICAgIGRlbGV0ZV9lbnRyeSA9IFZPU19GQUxTRTsKKyAgICAgIGJyZWFrOworICAgfQorICAgaWYoaW5mb3JtX2hkZCkKKyAgIHsKKyAgICAgIGlmKCFmbG93X2luZm8tPmhvUmVuZXdhbCkKKyAgICAgIHsKKyAgICAgIAorICAgICAgICAgZmxvd19pbmZvLT5Rb1NDYWxsYmFjayhwTWFjLCBmbG93X2luZm8tPkhERGNvbnRleHQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEFDSW5mby0+Y3Vycl9Rb1NJbmZvW3BBQ0luZm8tPnRzcGVjX3BlbmRpbmcgLSAxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGRkX3N0YXR1cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvd19pbmZvLT5Rb3NGbG93SUQpOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgLy9Gb3IgZG93bmdyYWRpbmcgcHVycG9zZSBIZGQgc2V0IFdtbVRzcGVjVmFsaWQgdG8gZmFsc2UgZHVyaW5nIHJvYW1pbmcKKyAgICAgICAgIC8vU28gbmVlZCB0byBzZXQgdGhhdCBmbGFnIHdlIG5lZWQgdG8gY2FsbCB0aGUgaGRkIGluIHN1Y2Nlc3NmdWwgY2FzZS4KKyAgICAgICAgIGlmKGhkZF9zdGF0dXMgPT0gU01FX1FPU19TVEFUVVNfU0VUVVBfU1VDQ0VTU19JTkQpCisgICAgICAgICB7CisgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzIGNhbGxpbmcgaGRkX3dtbV9zbWVjYWxsYmFjayBkdXJpbmcgIHJvYW1pbmcgZm9yIGFjID0gJWQiLCBfX2Z1bmNfXywgYWMpOworICAgICAgICAgICAgIGZsb3dfaW5mby0+UW9TQ2FsbGJhY2socE1hYywgZmxvd19pbmZvLT5IRERjb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBQ0luZm8tPmN1cnJfUW9TSW5mb1twQUNJbmZvLT50c3BlY19wZW5kaW5nIC0gMV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZGRfc3RhdHVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvd19pbmZvLT5Rb3NGbG93SUQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7CisgICAgICAgICB9CisgICAgICAgICBmbG93X2luZm8tPmhvUmVuZXdhbCA9IFZPU19GQUxTRTsKKyAgICAgIH0KKyAgIH0KKworICAgaWYgKHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ucm9hbURlbGF5U3RhdHNFbmFibGVkKQorICAgeworICAgICAgIGlmIChwQUNJbmZvLT5jdXJyX1FvU0luZm9bcEFDSW5mby0+dHNwZWNfcGVuZGluZyAtIDFdLnRzX2luZm8udXAgPT0gIFNNRV9RT1NfV01NX1VQX1ZPIHx8CisgICAgICAgICAgIHBBQ0luZm8tPmN1cnJfUW9TSW5mb1twQUNJbmZvLT50c3BlY19wZW5kaW5nIC0gMV0udHNfaW5mby51cCA9PSAgU01FX1FPU19XTU1fVVBfTkMpCisgICAgICAgeworICAgICAgICAgICB2b3NfcmVjb3JkX3JvYW1fZXZlbnQoZV9TTUVfVk9fQUREVFNfUlNQLCBOVUxMLCAwKTsKKyAgICAgICB9CisKKyAgICAgICBpZiAocEFDSW5mby0+Y3Vycl9Rb1NJbmZvW3BBQ0luZm8tPnRzcGVjX3BlbmRpbmcgLSAxXS50c19pbmZvLnVwID09ICBTTUVfUU9TX1dNTV9VUF9WSSB8fAorICAgICAgICAgICBwQUNJbmZvLT5jdXJyX1FvU0luZm9bcEFDSW5mby0+dHNwZWNfcGVuZGluZyAtIDFdLnRzX2luZm8udXAgPT0gIFNNRV9RT1NfV01NX1VQX0NMKQorICAgICAgIHsKKyAgICAgICAgICAgdm9zX3JlY29yZF9yb2FtX2V2ZW50KGVfU01FX1ZJX0FERFRTX1JTUCwgTlVMTCwgMCk7CisgICAgICAgfQorICAgfQorCisgICBpZihkZWxldGVfZW50cnkpCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UU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gVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICIlczogJWQ6IFNlc3Npb24gJWQgaXMgaW5hY3RpdmUiLAorICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgc2Vzc2lvbklkKTsKKyAgICAgcmV0dXJuIFZPU19GQUxTRTsKKyAgfQorCisgIGlmKCFwU2Vzc2lvbi0+YXNzb2NJbmZvLnBCc3NEZXNjKQorICB7CisgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICIlczogJWQ6IFNlc3Npb24gJWQgaGFzIGFuIEludmFsaWQgQlNTIERlc2NyaXB0b3IiLAorICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgc2Vzc2lvbklkKTsKKyAgICAgcmV0dXJuIFZPU19GQUxTRTsKKyAgfQorCisgIGhzdGF0dXMgPSBjc3JHZXRQYXJzZWRCc3NEZXNjcmlwdGlvbklFcyhwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPmFzc29jSW5mby5wQnNzRGVzYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwSWVzKTsKKyAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhoc3RhdHVzKSkKKyAgeworICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICIlczogJWQ6IE9uIHNlc3Npb24gJWQgdW5hYmxlIHRvIHBhcnNlIEJTUyBJRXMiLAorICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgc2Vzc2lvbklkKTsKKyAgICAgcmV0dXJuIFZPU19GQUxTRTsKKyAg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aWYoIHBBQ0luZm8tPnRzcGVjX21hc2tfc3RhdHVzICkKKyAgICAgeworICAgICAgICAgLy8gWWVzLCBhdCBsZWFzdCAxIFRTUEVDIGlzIGFjdGl2ZS4gIEFyZSB0aGV5IGJvdGggYWN0aXZlPworICAgICAgICAgaWYoIFNNRV9RT1NfVFNQRUNfTUFTS19CSVRfMV8yX1NFVCA9PSBwQUNJbmZvLT50c3BlY19tYXNrX3N0YXR1cyApCisgICAgICAgICB7CisgICAgICAgICAgICAgLy9ib3RoIFRTUEVDUyBhcmUgYWN0aXZlCisgICAgICAgICAgICAgKnBBY3RpdmVUc3BlYyA9IDI7CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICAgLy8gb25seSBvbmUgVFNQRUMgaXMgYWN0aXZlCisgICAgICAgICAgICAgKnBBY3RpdmVUc3BlYyA9IDE7CisgICAgICAgICB9CisgICAgIH0KKyAgICAgZWxzZQorICAgICB7CisgICAgICAgICpwQWN0aXZlVHNwZWMgPSAwOworICAgICB9CisgIH0KKyAgZWxzZQorICB7CisgICAgLy8gSGFyZGNvZGluZyB2YWx1ZSB0byBJTlZBTElEX1RTUEVDIChpbnZhbGlkIG5vbi16ZXJvIGluIHRoaXMgY29udGV4dCwKKyAgICAvLyB2YWxpZCB2YWx1ZXMgYXJlIDAsMSwyKSB0byBpbmRpY2F0ZSB0aGUgY2FsbGVyIG5vdCB0byB1cGRhdGUgVUFQU0QKKyAgICAvLyBwYXJhbWV0ZXJzIGFzIFFPUyBpcyBub3QgYWN0aXZlCisKKyAgICAgKnBBY3RpdmVUc3BlYyA9IElOVkFMSURfVFNQRUM7CisgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICIlczogJWQ6IE9uIHNlc3Npb24gJWQgQUMgJWQgaGFzIG5vIFFvUyBhY3RpdmUiLAorICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLCBzZXNzaW9uSWQsIGFjKTsKKyAgfQorCisgIHJldHVybiBWT1NfVFJVRTsKK30KKwordl9CT09MX3Qgc21lX1Fvc1ZhbGlkYXRlUmVxdWVzdGVkUGFyYW1zKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgc21lX1Fvc1dtbVRzcGVjSW5mbyAqIHBRb1NJbmZvLAorICAgIHZfVThfdCBzZXNzaW9uSWQpCit7CisgICB2X0JPT0xfdCByYyA9IFZPU19GQUxTRTsKKworICAgZG8KKyAgIHsKKyAgICAgIGlmKFNNRV9RT1NfV01NX1RTX0RJUl9SRVNWID09IHBRb1NJbmZvLT50c19pbmZvLmRpcmVjdGlvbikgYnJlYWs7CisgICAgICBpZighc21lX1Fvc0lzVFNJbmZvQWNrUG9saWN5VmFsaWQocE1hYywgcFFvU0luZm8sIHNlc3Npb25JZCkpIGJyZWFrOworCisgICAgICByYyA9IFZPU19UUlVFOworICAgfXdoaWxlKDApOworICAgcmV0dXJuIHJjOworfQorCitzdGF0aWMgZUhhbFN0YXR1cyBxb3NJc3N1ZUNvbW1hbmQoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHZfVThfdCBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTbWVDb21tYW5kVHlwZSBjbWRUeXBlLCBzbWVfUW9zV21tVHNwZWNJbmZvICogcFFvU0luZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtZV9Rb3NFZGNhQWNUeXBlIGFjLCB2X1U4X3QgdHNwZWNfbWFzayApCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19SRVNPVVJDRVM7CisgICAgdFNtZUNtZCAqcENvbW1hbmQgPSBOVUxMOworICAgIGRvCisgICAgeworICAgICAgICBwQ29tbWFuZCA9IHNtZUdldENvbW1hbmRCdWZmZXIoIHBNYWMgKTsKKyAgICAgICAgaWYgKCAhcENvbW1hbmQgKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBmYWlsIHRvIGdldCBjb21tYW5kIGJ1ZmZlciBmb3IgY29tbWFuZCAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLCBjbWRUeXBlKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIHBDb21tYW5kLT5jb21tYW5kID0gY21kVHlwZTsKKyAgICAgICAgcENvbW1hbmQtPnNlc3Npb25JZCA9IHNlc3Npb25JZDsKKyAgICAgICAgc3dpdGNoICggY21kVHlwZSApCisgICAgICAgIHsKKyAgICAgICAgY2FzZSBlU21lQ29tbWFuZEFkZFRzOgorICAgICAgICAgICAgaWYoIHBRb1NJbmZvICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnFvc0NtZC50c3BlY0luZm8gPSAqcFFvU0luZm87CisgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUucW9zQ21kLmFjID0gYWM7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBOVUxMIHBvaW50ZXIgcGFzc2VkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18pOworICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfSU5WQUxJRF9QQVJBTUVURVI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlU21lQ29tbWFuZERlbFRzOgorICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgIHBDb21tYW5kLT51LnFvc0NtZC5hYyA9IGFjOworICAgICAgICAgICAgcENvbW1hbmQtPnUucW9zQ21kLnRzcGVjX21hc2sgPSB0c3BlY19tYXNrOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBpbnZhbGlkIGNvbW1hbmQgdHlwZSAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLCBjbWRUeXBlICk7CisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19JTlZBTElEX1BBUkFNRVRFUjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfSB3aGlsZSggMCApOworICAgIGlmKCBIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICYmIHBDb21tYW5kICkKKyAgICB7CisgICAgICAgIHNtZVB1c2hDb21tYW5kKCBwTWFjLCBwQ29tbWFuZCwgZUFOSV9CT09MRUFOX0ZBTFNFICk7CisgICAgfQorICAgIGVsc2UgaWYoIHBDb21tYW5kICkKKyAgICB7CisgICAgICAgIHFvc1JlbGVhc2VDb21tYW5kKCBwTWFjLCBwQ29tbWFuZCApOworICAgIH0KKyAgICByZXR1cm4oIHN0YXR1cyApOworfQordEFOSV9CT09MRUFOIHFvc1Byb2Nlc3NDb21tYW5kKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0U21lQ21kICpwQ29tbWFuZCApCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIHRBTklfQk9PTEVBTiBmUmVtb3ZlQ21kID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgZG8KKyAgICB7CisgICAgICAgIHN3aXRjaCAoIHBDb21tYW5kLT5jb21tYW5kICkKKyAgICAgICAgeworICAgICAgICBjYXNlIGVTbWVDb21tYW5kQWRkVHM6CisgICAgICAgICAgICBzdGF0dXMgPSBzbWVfUW9zQWRkVHNSZXEoIHBNYWMsICh2X1U4X3QpcENvbW1hbmQtPnNlc3Npb25JZCwgJnBDb21tYW5kLT51LnFvc0NtZC50c3BlY0luZm8sIHBDb21tYW5kLT51LnFvc0NtZC5hYyk7CisgICAgICAgICAgICBpZiggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZlJlbW92ZUNtZCA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBTTUVfUU9TX1NUQVRVU19TRVRVUF9SRVFfUEVORElOR19SU1A7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlU21lQ29tbWFuZERlbFRzOgorICAgICAgICAgICAgc3RhdHVzID0gc21lX1Fvc0RlbFRzUmVxKCBwTWFjLCAodl9VOF90KXBDb21tYW5kLT5zZXNzaW9uSWQsIHBDb21tYW5kLT51LnFvc0NtZC5hYywgcENvbW1hbmQtPnUucW9zQ21kLnRzcGVjX21hc2sgKTsKKyAgICAgICAgICAgIGlmKCBIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBmUmVtb3ZlQ21kID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01P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FDTU9GRl9TVVBQT1JURUQocE1hYyk7CisgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgIiVzOiAlZDogSW52b2tlZCIsCisgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fKTsKKyAgIGZvciAoc2Vzc2lvbklkID0gMDsgc2Vzc2lvbklkIDwgQ1NSX1JPQU1fU0VTU0lPTl9NQVg7ICsrc2Vzc2lvbklkKQorICAgeworICAgICAgcFNlc3Npb24gPSAmc21lX1Fvc0NiLnNlc3Npb25JbmZvW3Nlc3Npb25JZF07CisgICAgICBpZiggIXBTZXNzaW9uLT5zZXNzaW9uQWN0aXZlICkKKyAgICAgIHsKKyAgICAgICAgIGNvbnRpbnVlOworICAgICAgfQorICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICIlczogJWQ6IFNlc3Npb24gJWQgaXMgYWN0aXZlIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgc2Vzc2lvbklkKTsKKyAgICAgIGlmKCBIQUxfU1RBVFVTX1NVQ0NFU1MoY3NyR2V0UGFyc2VkQnNzRGVzY3JpcHRpb25JRXMocE1hYywgcFNlc3Npb24tPmFzc29jSW5mby5wQnNzRGVzYywgJnBJZXNMb2NhbCkpICkKKyAgICAgIHsKKyAgICAgICAgIC8vIGdldCB0aGUgQUNNIG1hc2sKKyAgICAgICAgIGFjbV9tYXNrID0gc21lX1Fvc0dldEFDTU1hc2socE1hYywgcFNlc3Npb24tPmFzc29jSW5mby5wQnNzRGVzYywgcEllc0xvY2FsKTsKKyAgICAgICAgIHZvc19tZW1fZnJlZShwSWVzTG9jYWwpOworICAgICAgICAgLy8gZ2V0IHRoZSB1YXBzZCBtYXNrIGZvciB0aGlzIHNlc3Npb24KKyAgICAgICAgIHVhcHNkX21hc2sgPSBwU2Vzc2lvbi0+YXBzZE1hc2s7CisgICAgICAgICAvLyB1bm1hc2sgdGhlIGJpdHMgd2l0aCBBQ00gb24gdG8gYXZvaWQgcmVhc3NvYyBvbiB0aGVtIAorICAgICAgICAgdWFwc2RfbWFzayAmPSB+YWNtX21hc2s7CisgICAgICAgICAvLyBpdGVyYXRlIHRocm91Z2ggdGhlIEFDcyB0byBkZXRlcm1pbmUgaWYgd2UgbmVlZCB0byByZS1hZGQgYW55IFRTUEVDcworICAgICAgICAgZm9yKGFjID0gU01FX1FPU19FRENBX0FDX0JFOyBhYyA8IFNNRV9RT1NfRURDQV9BQ19NQVg7IGFjKyspCisgICAgICAgICB7CisgICAgICAgICAgICBwQUNJbmZvID0gJnBTZXNzaW9uLT5hY19pbmZvW2FjXTsKKyAgICAgICAgICAgIC8vIERvZXMgdGhpcyBBQyBoYXZlIFFvUyBhY3RpdmU/CisgICAgICAgICAgICBpZiggU01FX1FPU19RT1NfT04gPT0gcEFDSW5mby0+Y3Vycl9zdGF0ZSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvLyBZZXMsIFFvUyBpcyBhY3RpdmUgb24gdGhpcyBBQworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IE9uIHNlc3Npb24gJWQgQUMgJWQgaGFzIFFvUyBhY3RpdmUiLAorICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uSWQsIGFjKTsKKyAgICAgICAgICAgICAgIC8vIERvZXMgdGhpcyBBQyByZXF1aXJlIEFDTT8KKyAgICAgICAgICAgICAgIGlmKCggYWNtX21hc2sgJiAoMSA8PCAoU01FX1FPU19FRENBX0FDX1ZPIC0gYWMpKSApIHx8IGFkZHRzV2hlbkFDTU5vdFNldCApCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvLyBZZXMsIHNvIHdlIG5lZWQgdG8gcmUtYWRkIGFueSBUU1BFQ1MKKyAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBPbiBzZXNzaW9uICVkIEFDICVkIGhhcyBBQ00gZW5hYmxlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCwgYWMpOworICAgICAgICAgICAgICAgICAgLy8gQXJlIGFueSBUU1BFQ3MgYWN0aXZlPworICAgICAgICAgICAgICAgICAgaWYoIHBBQ0luZm8tPnRzcGVjX21hc2tfc3RhdHVzICkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgIC8vIFllcywgYXQgbGVhc3QgMSBUU1BFQyBpcyBhY3RpdmUuICBBcmUgdGhleSBib3RoIGFjdGl2ZT8KKyAgICAgICAgICAgICAgICAgICAgIGlmKCBTTUVfUU9TX1RTUEVDX01BU0tfQklUXzFfMl9TRVQgPT0gcEFDSW5mby0+dHNwZWNfbWFza19zdGF0dXMgKQorICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLy9ib3RoIFRTUEVDUyBhcmUgYWN0aXZlCisgICAgICAgICAgICAgICAgICAgICAgICB0c3BlYzEgPSBTTUVfUU9TX1RTUEVDX01BU0tfQklUXzFfU0VUOworICAgICAgICAgICAgICAgICAgICAgICAgdHNwZWMyID0gU01FX1FPU19UU1BFQ19NQVNLX0JJVF8yX1NFVDsKKyAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9ubHkgb25lIFRTUEVDIGlzIGFjdGl2ZSwgZ2V0IGl0cyBtYXNrCisgICAgICAgICAgICAgICAgICAgICAgICB0c3BlYzEgPSBTTUVfUU9TX1RTUEVDX01BU0tfQklUXzFfMl9TRVQgJiBwQUNJbmZvLT50c3BlY19tYXNrX3N0YXR1czsKKyAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgIC8vIERvZXMgVFNQRUMgMSByZWFsbHkgcmVxdWlyZSBVQVBTRD8KKyAgICAgICAgICAgICAgICAgICAgIGZJc1VhcHNkTmVlZGVkID0gKHZfQk9PTF90KShwQUNJbmZvLT5jdXJyX1FvU0luZm9bdHNwZWMxIC0gMV0udHNfaW5mby5wc2IpOworICAgICAgICAgICAgICAgICAgICAgLy9kb3VibGUgY2hlY2sgd2hldGhlciB3ZSBuZWVkIHRvIGRvIGFueXRoaW5nCisgICAgICAgICAgICAgICAgICAgICBpZiggZklzVWFwc2ROZWVkZWQgKQorICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcEFDSW5mby0+cmVxdWVzdGVkX1FvU0luZm9bdHNwZWMxIC0gMV0gPSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBQ0luZm8tPmN1cnJfUW9TSW5mb1t0c3BlYzEgLSAxXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNtZV9Rb3NSZVJlcXVlc3RBZGRUUyggcE1hYywgc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEFDSW5mby0+cmVxdWVzdGVkX1FvU0luZm9bdHNwZWMxIC0gMV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0c3BlYzEgKTsKKyAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgIC8vIElzIFRTUEVDIDIgYWN0aXZlPworICAgICAgICAgICAgICAgICAgICAgaWYoIHRzcGVjMiApCisgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBEb2VzIFRTUEVDIDIgcmVhbGx5IHJlcXVpcmUgVUFQU0Q/CisgICAgICAgICAgICAgICAgICAgICAgICBmSXNVYXBzZE5lZWRlZCA9ICh2X0JPT0xfdCkocEFDSW5mby0+Y3Vycl9Rb1NJbmZvW3RzcGVjMiAtIDFdLnRzX2luZm8ucHNiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBmSXNVYXBzZE5lZWRlZCApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAvL05vIG5lZWQgdG8gaW5mb3JtIEhERAorICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9wQUNJbmZvLT5ob1JlbmV3YWwgPSBWT1NfVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBQ0luZm8tPnJlcXVlc3RlZF9Rb1NJbmZvW3RzcGVjMiAtIDFdID0gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQUNJbmZvLT5jdXJyX1FvU0luZm9bdHNwZWMyIC0gMV07CisgICAgICAgICAgICAgICAgICAgICAgICAgICBzbWVfUW9zUmVSZXF1ZXN0QWRkVFMoIHBNYWMsIHNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBQ0luZm8tPnJlcXVlc3RlZF9Rb1NJbmZvW3RzcGVjMiAtIDFdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHNwZWMyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgIC8vIFFvUyBpcyBzZXQsIEFDTSBpcyBvbiwgYnV0IG5vIFRTUEVDcyAtLSBpbmNvbnNpc3RlbnQgc3RhdGUKKyAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IE9uIHNlc3Npb24gJWQgQUMgJWQgaGFzIFFvUyBlbmFibGVkIGFuZCBBQ00gaXMgc2V0LCBidXQgbm8gVFNQRUMiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uSWQsIGFjKTsKKyAgICAgICAgICAgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvL1NpbmNlIEFDTSBiaXQgaXMgbm90IHNldCwgdGhlcmUgc2hvdWxkIGJlIG9ubHkgb25lIFFvUyBpbmZvcm1hdGlvbiBmb3IgYm90aCBkaXJlY3Rpb25zLgorICAgICAgICAgICAgICAgICAgZklzVWFwc2ROZWVkZWQgPSAodl9CT09MX3QpKHBBQ0luZm8tPmN1cnJfUW9TSW5mb1swXS50c19pbmZvLnBzYik7CisgICAgICAgICAgICAgICAgICBpZihmSXNVYXBzZE5lZWRlZCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgIC8vIHdlIG5lZWQgVUFQU0Qgb24gdGhpcyBBQyAoYW5kIHdlIG1heSBub3QgY3VycmVudGx5IGhhdmUgaXQpCisgICAgICAgICAgICAgICAgICAgICB1YXBzZF9tYXNrIHw9IDEgPDwgKFNNRV9RT1NfRURDQV9BQ19WTyAtIGFjKTsKKyAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBPbiBzZXNzaW9uICVkIEFDICVkIGhhcyBBQ00gZGlzYWJsZWQsIHVhcHNkIG1hc2sgbm93IDB4JVgiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uSWQsIGFjLCB1YXBzZF9tYXNrKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgICAgIC8vIGRvIHdlIG5lZWQgdG8gcmVhc3NvY2lhdGU/CisgICAgICAgICBpZih1YXBzZF9tYXNrKQorICAgICAgICAgeworICAgICAgICAgICAgdENzclJvYW1Nb2RpZnlQcm9maWxlRmllbGRzIG1vZGlmeVByb2ZpbGVGaWVsZHM7CisgICAgICAgICAgICAvL3dlIG5lZWQgdG8gZG8gYSByZWFzc29jIG9uIHRoZXNlIEFDIAorICAgICAgICAgICAgY3NyR2V0TW9kaWZ5UHJvZmlsZUZpZWxkcyhwTWFjLCBzZXNzaW9uSWQsICZtb2RpZnlQcm9maWxlRmllbGRzKTsKKyAgICAgICAgICAgIGlmKCBidGNJc1JlYWR5Rm9yVWFwc2QocE1hYykgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgbW9kaWZ5UHJvZmlsZUZpZWxkcy51YXBzZF9tYXNrID0gdWFwc2RfbWFzazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsgIAorICAgICAgICAgICAgICAgbW9kaWZ5UHJvZmlsZUZpZWxkcy51YXBzZF9tYXNrID0gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vRG8gd2UgbmVlZCB0byBpbmZvcm0gSEREPworICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzbWVfUW9zUmVxdWVzdFJlYXNzb2MocE1hYywgc2Vzc2lvbklkLCAmbW9kaWZ5UHJvZmlsZUZpZWxkcywgVk9TX1RSVUUpKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8vZXJyIG1zZworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogT24gU2Vzc2lvbiAlZCBSZWFzc29jIGZhaWxlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCk7CisgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBPbiBTZXNzaW9uICVkIGZhaWxlZCB0byBwYXJzZSBJRXMiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICBzZXNzaW9uSWQpOworICAgICAgfQorICAgfQorICAgLy8gcmV0dXJuIHN0YXR1cyBpcyBpZ25vcmVkIGJ5IEJUQworICAgcmV0dXJuIFNNRV9R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AgICAgICAgIiVzOiAlZCBDb25jdXJyZW50IFNlc3Npb25zIHJ1bm5pbmcsIGRvIG5vdGhpbmciLAorICAgICAgICAgICAgICAgICAgX19mdW5jX18sX19MSU5FX18pOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgc2Vzc2lvbklkID0gY3NyR2V0SW5mcmFTZXNzaW9uSWQocE1hYyk7CisgICAgaWYgKC0xID09IHNlc3Npb25JZCkgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogJWQgSW52YWxpZCBzZXNzaW9uSWQiLF9fZnVuY19fLF9fTElORV9fKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHBTZXNzaW9uID0gJnNtZV9Rb3NDYi5zZXNzaW9uSW5mb1tzZXNzaW9uSWRdOworICAgIGlmIChOVUxMID09IHBTZXNzaW9uKSB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiAlZCBwU2Vzc2lvbiBub3QgZm91bmQgc2Vzc2lvbklkOiVkIixfX2Z1bmNfXyxfX0xJTkVfXyxzZXNzaW9uSWQpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaWYoICFwU2Vzc2lvbi0+c2Vzc2lvbkFjdGl2ZSApCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogJWQgU2Vzc2lvbiAlZCBub3QgYWN0aXZlIixfX2Z1bmNfXyxfX0xJTkVfXyxzZXNzaW9uSWQpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAiJXM6ICVkOiBTZXNzaW9uICVkIGlzIGFjdGl2ZSIsIF9fZnVuY19fLCBfX0xJTkVfXywgc2Vzc2lvbklkKTsKKworICAgIGlmKCBIQUxfU1RBVFVTX1NVQ0NFU1MoY3NyR2V0UGFyc2VkQnNzRGVzY3JpcHRpb25JRXMocE1hYywgcFNlc3Npb24tPmFzc29jSW5mby5wQnNzRGVzYywgJnBJZXNMb2NhbCkpICkKKyAgICB7CisgICAgICAgIC8vIGdldCB0aGUgQUNNIG1hc2sKKyAgICAgICAgYWNtX21hc2sgPSBzbWVfUW9zR2V0QUNNTWFzayhwTWFjLCBwU2Vzc2lvbi0+YXNzb2NJbmZvLnBCc3NEZXNjLCBwSWVzTG9jYWwpOworICAgICAgICB2b3NfbWVtX2ZyZWUocEllc0xvY2FsKTsKKworICAgICAgICAvLyBpdGVyYXRlIHRocm91Z2ggdGhlIEFDcyB0byBkZXRlcm1pbmUgaWYgd2UgbmVlZCB0byByZS1hZGQgYW55IFRTUEVDcworICAgICAgICBmb3IoYWMgPSBTTUVfUU9TX0VEQ0FfQUNfQkU7IGFjIDwgU01FX1FPU19FRENBX0FDX01BWDsgYWMrKykKKyAgICAgICAgeworICAgICAgICAgICAgcEFDSW5mbyA9ICZwU2Vzc2lvbi0+YWNfaW5mb1thY107CisKKyAgICAgICAgICAgIC8vIERvZXMgdGhpcyBBQyBoYXZlIFFvUyBhY3RpdmU/CisgICAgICAgICAgICBpZiggU01FX1FPU19RT1NfT04gPT0gcEFDSW5mby0+Y3Vycl9zdGF0ZSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gWWVzLCBRb1MgaXMgYWN0aXZlIG9uIHRoaXMgQUMKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IE9uIHNlc3Npb24gJWQgQUMgJWQgaGFzIFFvUyBhY3RpdmUiLAorICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sIHNlc3Npb25JZCwgYWMpOworICAgICAgICAgICAgICAgIC8vIERvZXMgdGhpcyBBQyByZXF1aXJlIEFDTT8KKyAgICAgICAgICAgICAgICBpZigoIGFjbV9tYXNrICYgKDEgPDwgKFNNRV9RT1NfRURDQV9BQ19WTyAtIGFjKSkgKSB8fCBhZGR0c1doZW5BQ01Ob3RTZXQgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gWWVzLCBzbyB3ZSBuZWVkIHRvIHJlLWFkZCBhbnkgVFNQRUNTCisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogJWQ6IE9uIHNlc3Npb24gJWQgQUMgJWQgaGFzIEFDTSBlbmFibGVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sIHNlc3Npb25JZCwgYWMpOworICAgICAgICAgICAgICAgICAgICAvLyBBcmUgYW55IFRTUEVDcyBhY3RpdmU/CisgICAgICAgICAgICAgICAgICAgIGlmKCBwQUNJbmZvLT50c3BlY19tYXNrX3N0YXR1cyApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFllcywgYXQgbGVhc3QgMSBUU1BFQyBpcyBhY3RpdmUuICBBcmUgdGhleSBib3RoIGFjdGl2ZT8KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBTTUVfUU9TX1RTUEVDX01BU0tfQklUXzFfMl9TRVQgPT0gcEFDSW5mby0+dHNwZWNfbWFza19zdGF0dXMgKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vYm90aCBUU1BFQ1MgYXJlIGFjdGl2ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRzcGVjMSA9IFNNRV9RT1NfVFNQRUNfTUFTS19CSVRfMV9TRVQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHNwZWMyID0gU01FX1FPU19UU1BFQ19NQVNLX0JJVF8yX1NFVDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBvbmx5IG9uZSBUU1BFQyBpcyBhY3RpdmUsIGdldCBpdHMgbWFzaworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRzcGVjMSA9IFNNRV9RT1NfVFNQRUNfTUFTS19CSVRfMV8yX1NFVCAmIHBBQ0luZm8tPnRzcGVjX21hc2tfc3RhdHVzOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAocEFDSW5mby0+Y3Vycl9Rb1NJbmZvW3RzcGVjMSAtIDFdLmV4cGVjX3BzYl9ieWFwcCApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFDSW5mby0+cmVxdWVzdGVkX1FvU0luZm9bdHNwZWMxIC0gMV0gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBQ0luZm8tPmN1cnJfUW9TSW5mb1t0c3BlYzEgLSAxXTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBQ0luZm8tPnJlcXVlc3RlZF9Rb1NJbmZvW3RzcGVjMSAtIDFdLnRzX2luZm8ucHNiID0gMTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFidGNJc1JlYWR5Rm9yVWFwc2QocE1hYykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBQ0luZm8tPnJlcXVlc3RlZF9Rb1NJbmZvW3RzcGVjMSAtIDFdLnRzX2luZm8ucHNiID0gMDsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtZV9Rb3NSZVJlcXVlc3RBZGRUUyAocE1hYywgc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBQ0luZm8tPnJlcXVlc3RlZF9Rb1NJbmZvW3RzcGVjMSAtIDFdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0c3BlYzEpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHNwZWMyKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwQUNJbmZvLT5jdXJyX1FvU0luZm9bdHNwZWMyIC0gMV0uZXhwZWNfcHNiX2J5YXBwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFDSW5mby0+cmVxdWVzdGVkX1FvU0luZm9bdHNwZWMyIC0gMV0gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQUNJbmZvLT5jdXJyX1FvU0luZm9bdHNwZWMyIC0gMV07CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFDSW5mby0+cmVxdWVzdGVkX1FvU0luZm9bdHNwZWMyIC0gMV0udHNfaW5mby5wc2IgPSAxOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFidGNJc1JlYWR5Rm9yVWFwc2QocE1hYykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQUNJbmZvLT5yZXF1ZXN0ZWRfUW9TSW5mb1t0c3BlYzIgLSAxXS50c19pbmZvLnBzYiA9IDA7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21lX1Fvc1JlUmVxdWVzdEFkZFRTIChwTWFjLCBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBQ0luZm8tPnJlcXVlc3RlZF9Rb1NJbmZvW3RzcGVjMiAtIDFdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRzcGVjMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gUW9TIGlzIE9OLCBBQ00gaXMgb24sIGJ1dCBubyBUU1BFQ3MgLS0gSW5jb25zaXN0ZW50IHN0YXRlCisgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBPbiBzZXNzaW9uICVkIEFDICVkIGhhcyBRb1MgZW5hYmxlZCBhbmQgQUNNIGlzIHNldCwgYnV0IG5vIFRTUEVDIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkLCBhYyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBPbiBTZXNzaW9uICVkIGZhaWxlZCB0byBwYXJzZSBJRXMiLAorICAgICAgICAgICAgICAgICAgX19mdW5jX18sIF9fTElORV9fLAorICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkKTsKKyAgICB9Cit9CisKKy8qCisgICAgc21lX1Fvc1JlUmVxdWVzdEFkZFRTIHRvIHJlLXNlbmQgQWRkVFMgZm9yIHRoZSBjb21iaW5lZCBRb1MgcmVxdWVzdAorKi8KK3N0YXRpYyBzbWVfUW9zU3RhdHVzVHlwZSBzbWVfUW9zUmVSZXF1ZXN0QWRkVFModHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90IHNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21lX1Fvc1dtbVRzcGVjSW5mbyAqIHBRb1NJbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbWVfUW9zRWRjYUFjVHlwZSBhYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90IHRzcGVjTWFzaykKK3sKKyAgIHNtZV9Rb3NTZXNzaW9uSW5mbyAqcFNlc3Npb247CisgICBzbWVfUW9zQUNJbmZvICpwQUNJbmZvOworICAgc21lX1Fvc1N0YXR1c1R5cGUgc3RhdHVzID0gU01FX1FPU19TVEFUVVNfTU9ESUZZX1NFVFVQX0ZBSUxVUkVfUlNQOworICAgc21lX1Fvc0NtZEluZm8gIGNtZDsKKyAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1R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isgICAgICAgICAgICAgICAgIChTTUVfUU9TX1NUQVRVU19TRVRVUF9TVUNDRVNTX0lORF9BUFNEX1BFTkRJTkcgPT0gc3RhdHVzKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6ICVkOiBVQVBTRCBpcyBzZXR1cCBhbHJlYWR5IHN0YXR1cyA9ICVkICIKKyAgICAgICAgICAgICAgICAgICAgICAicmV0dXJuZWQgYnkgc21lX1Fvc1NldHVwIiwKKyAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgX19MSU5FX18sCisgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzKTsgIAorICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgLy9lcnIgbXNnCisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiAlZDogdW5leHBlY3RlZCBzdGF0dXMgPSAlZCByZXR1cm5lZCBieSBzbWVfUW9zU2V0dXAiLAorICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBfX0xJTkVfXywKKyAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMpOworICAgICAgICAgfQorICAgICAgfQorICAgICAgYnJlYWs7CisgICBjYXNlIFNNRV9RT1NfSEFORE9GRjoKKyAgIGNhc2UgU01FX1FPU19SRVFVRVNURUQ6CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgIiVzOiAlZDogUmUtQWRkIHJlcXVlc3QgaW4gc3RhdGUgPSAlZCAgYnVmZmVyIHRoZSByZXF1ZXN0IiwKKyA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X1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6ICIKKyAgICAgICAgICAgICAgICJJbnZhbGlkIGNvbm5lY3Rpb24gaGFuZGxlICVkIG9yIGxpbmsgdHlwZSAlZCBmb3IgU3luYyBDb25uZWN0aW9uLiBCVCBldmVudCB3aWxsIGJlIGRyb3BwZWQgIiwKKyAgICAgICAgICAgICAgIF9fZnVuY19fLAorICAgICAgICAgICAgICAgcEJ0RXZlbnQtPnVFdmVudFBhcmFtLmJ0U3luY0Nvbm5lY3Rpb24uY29ubmVjdGlvbkhhbmRsZSwKKyAgICAgICAgICAgICAgIHBCdEV2ZW50LT51RXZlbnRQYXJhbS5idFN5bmNDb25uZWN0aW9uLmxpbmtUeXBlKTsKKyAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICAgICAgIH0KKyAgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBCVF9FVkVOVF9NT0RFX0NIQU5HRUQ6CisgICAgICAgICBpZihwQnRFdmVudC0+dUV2ZW50UGFyYW0uYnRBY2xNb2RlQ2hhbmdlLm1vZGUgPj0gQlRfQUNMX01PREVfTUFYKQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogIgorICAgICAgICAgICAgICAgIkludmFsaWQgbW9kZSAlZCBmb3IgQUNMIENvbm5lY3Rpb24uIEJUIGV2ZW50IHdpbGwgYmUgZHJvcHBlZCAiLAorICAgICAgICAgICAgICAgX19mdW5jX18sCisgICAgICAgICAgICAgICBwQnRFdmVudC0+dUV2ZW50UGFyYW0uYnRBY2xNb2RlQ2hhbmdlLm1vZGUpOworICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgICAgICAgfQorICAgICAgICAgYnJlYWs7CisgICAgIGNhc2UgQlRfRVZFTlRfREVWSUNFX1NXS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KyAgICAgICAgICAgIC8vdHJ5IHRvIG1hdGNoIGFkZHIKKyAgICAgICAgICAgIGlmKCBwUmVwbGF5LT5idGNFdmVudEhpc3QuYnRBY2xDb25uZWN0aW9uRXZlbnRbaV0uYk5leHRFdmVudElkeCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZm9yKGogPSAwOyBqIDwgcFJlcGxheS0+YnRjRXZlbnRIaXN0LmJ0QWNsQ29ubmVjdGlvbkV2ZW50W2ldLmJOZXh0RXZlbnRJZHg7IGorKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmKCB2b3NfbWVtX2NvbXBhcmUocFJlcGxheS0+YnRjRXZlbnRIaXN0LmJ0QWNsQ29ubmVjdGlvbkV2ZW50W2ldLmJ0QWNsQ29ubmVjdGlvbltqXS5iZEFkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICBiZEFkZHIsIDYpICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLy9mb3VuZCBpdAorICAgICAgICAgICAgICAgICAgICAgICAgcFJldCA9ICZwUmVwbGF5LT5idGNFdmVudEhpc3QuYnRBY2xDb25uZWN0aW9uRXZlbnRbaV07CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmKCBCVF9JTlZBTElEX0NPTk5fSEFORExFICE9IGhhbmRsZSApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vdHJ5IHRvIG1hdGNoIGhhbmRsZQorICAgICAgICAgICAgaWYoIHBSZXBsYXktPmJ0Y0V2ZW50SGlzdC5idEFjbENvbm5lY3Rpb25FdmVudFtpXS5iTmV4dEV2ZW50SWR4ICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBmb3IoaiA9IDA7IGogPCBwUmVwbGF5LT5idGNFdmVudEhpc3QuYnRBY2xDb25uZWN0aW9uRXZlbnRbaV0uYk5leHRFdmVudElkeDsgaisrKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoIHBSZXBsYXktPmJ0Y0V2ZW50SGlzdC5idEFjbENvbm5lY3Rpb25FdmVudFtpXS5idEFjbENvbm5lY3Rpb25bal0uY29ubmVjdGlvbkhhbmRsZSA9PQorICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLy9mb3VuZCBpdAorICAgICAgICAgICAgICAgICAgICAgICAgcFJldCA9ICZwUmVwbGF5LT5idGNFdmVudEhpc3QuYnRBY2xDb25uZWN0aW9uRXZlbnRbaV07CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmKCAwID09IHBSZXBsYXktPmJ0Y0V2ZW50SGlzdC5idEFjbENvbm5lY3Rpb25FdmVudFtpXS5iTmV4dEV2ZW50SWR4ICkKKyAgICAgICAgeworICAgICAgICAgICAgcFJldCA9ICZwUmVwbGF5LT5idGNFdmVudEhpc3QuYnRBY2xDb25uZWN0aW9uRXZlbnRbaV07CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gKHBSZXQpOworfQorCisvKgorICAgIGJ0Y0ZpbmRTeW5jRXZlbnRIaXN0IGZpbmQgYSBzdWl0ZWQgU1lOQyBldmVudCBidWZmZXIKKyAgICBQYXJhbTogYmRBZGRyIC0gTlVMTCBtZWFuaW5nIG5vdCBjYXJlLgorICAgICAgICAgICAgICAgICAgICBwb2ludGVyIHRvIGNhbGxlciBhbG9jYXRlZCBidWZmZXIgY29udGFpbmluZyB0aGUgQkQgYWRkcmVzcyB0byBmaW5kIG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bnRbaV0uYk5leHRFdmVudElkeDsgaisrKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoIHZvc19tZW1fY29tcGFyZShwUmVwbGF5LT5idGNFdmVudEhpc3QuYnRTeW5jQ29ubmVjdGlvbkV2ZW50W2ldLmJ0U3luY0Nvbm5lY3Rpb25bal0uYmRBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgYmRBZGRyLCA2KSApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vZm91bmQgaXQKKyAgICAgICAgICAgICAgICAgICAgICAgIHBSZXQgPSAmcFJlcGxheS0+YnRjRXZlbnRIaXN0LmJ0U3luY0Nvbm5lY3Rpb25FdmVudFtpXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UgaWYoIEJUX0lOVkFMSURfQ09OTl9IQU5ETEUgIT0gaGFuZGxlICkKKyAgICAgICAgeworICAgICAgICAgICAgLy90cnkgdG8gbWF0Y2ggaGFuZGxlCisgICAgICAgICAgICBpZiggcFJlcGxheS0+YnRjRXZlbnRIaXN0LmJ0U3luY0Nvbm5lY3Rpb25FdmVudFtpXS5iTmV4dEV2ZW50SWR4ICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBmb3IoaiA9IDA7IGogPCBwUmVwbGF5LT5idGNFdmVudEhpc3QuYnRBY2xDb25uZWN0aW9uRXZlbnRbaV0uYk5leHRFdmVudElkeDsgaisrKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoIHBSZXBsYXktPmJ0Y0V2ZW50SGlzdC5idFN5bmNDb25uZWN0aW9uRXZlbnRbaV0uYnRTeW5jQ29ubmVjdGlvbltqXS5jb25uZWN0aW9uSGFuZGxlID09CisgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGUgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvL2ZvdW5kIGl0CisgICAgICAgICAgICAgICAgICAgICAgICBwUmV0ID0gJnBSZXBsYXktPmJ0Y0V2ZW50SGlzdC5idFN5bmNDb25uZWN0aW9uRXZlbnRbaV07CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmKCAhcFJlcGxheS0+YnRjRXZlbnRIaXN0LmJ0U3luY0Nvbm5lY3Rpb25FdmVudFtpXS5iTmV4dEV2ZW50SWR4ICkKKyAgICAgICAgeworICAgICAgICAgICAgcFJldCA9ICZwUmVwbGF5LT5idGNFdmVudEhpc3QuYnRTeW5jQ29ubmVjdGlvbkV2ZW50W2ldOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIChwUmV0KTsKK30KKworLyoKKyAgICBidGNGaW5kRGlzY29ubkV2ZW50SGlzdCBmaW5kIGEgc2xvdCBmb3IgdGhlIGRlZmVycmVkIGRpc2Nvbm5lY3QgZXZlbnQKKyAgICBJZiBoYW5kbGUgaXMgaW52bGlkLCBpdCByZXR1cm5zIGEgZnJlZSBzbG90LCBpZiBhbnkuIAorICAgIElmIGhhbmRsZSBpcyB2YWxpZCwgaXQgdHJpZXMgdG8gZmluZCBhIG1hdGNoIGZpcnN0IGluIGNhc2Ugc2FtZSBkaXNjb25uZWN0IGV2ZW50IGNvbWVzIGRvd24gYWdhaW4uCisqLworc3RhdGljIHRwU21lQnREaXNjb25uZWN0RXZlbnRIaXN0IGJ0Y0ZpbmREaXNjb25uRXZlbnRIaXN0KCB0cEFuaVNpckdsb2JhbCBwTWFjLCB2X1UxNl90IGhhbmRsZSApCit7CisgICAgdHBTbWVCdERpc2Nvbm5lY3RFdmVudEhpc3QgcFJldCA9IE5VTEw7CisgICAgdFNtZUJ0Y0V2ZW50UmVwbGF5ICpwUmVwbGF5ID0gJnBNYWMtPmJ0Yy5idGNFdmVudFJlcGxheTsKKyAgICBpbnQgaTsKKyAgICBpZiggQlRfSU5WQUxJRF9DT05OX0hBTkRMRSAhPSBoYW5kbGUgKQorICAgIHsKKyAgICAgICAgZm9yKGkgPSAwOyBpIDwgQlRfTUFYX0RJU0NPTk5fU1VQUE9SVDsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICBpZiggcFJlcGxheS0+YnRjRXZlbnRIaXN0LmJ0RGlzY29ubmVjdEV2ZW50W2ldLmZWYWxpZCAmJgorICAgICAgICAgICAgICAgIChoYW5kbGUgPT0gcFJlcGxheS0+YnRjRXZlbnRIaXN0LmJ0RGlzY29ubmVjdEV2ZW50W2ldLmJ0RGlzY29ubmVjdC5jb25uZWN0aW9uSGFuZGxlKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFJldCA9ICZwUmVwbGF5LT5idGNFdmVudEhpc3QuYnREaXNjb25uZWN0RXZlbnRbaV07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgaWYoIE5VTEwgPT0gcFJldCApCisgICAgeworICAgICAgICAvL0ZpbmQgYSBmcmVlIHNsb3QKKyAgICAgICAgZm9yKGkgPSAwOyBpIDwgQlRfTUFYX0RJU0NPTk5fU1VQUE9SVDsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICBpZiggIXBSZXBsYXktPmJ0Y0V2ZW50SGlzdC5idERpc2Nvbm5lY3RFdmVudFtpXS5mVmFsaWQgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBSZXQgPSAmcFJlcGxheS0+YnRjRXZlbnRIaXN0LmJ0RGlzY29ubmVjdEV2ZW50W2ldOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgIC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oreworICAgIHRwU21lQnRTeW5jVXBkYXRlSGlzdCBwUmV0ID0gTlVMTDsKKyAgICB0U21lQnRjRXZlbnRSZXBsYXkgKnBSZXBsYXkgPSAmcE1hYy0+YnRjLmJ0Y0V2ZW50UmVwbGF5OworICAgIGludCBpOworICAgIGlmKCBCVF9JTlZBTElEX0NPTk5fSEFORExFICE9IGhhbmRsZSApCisgICAgeworICAgICAgICBmb3IoaSA9IDA7IGkgPCBCVF9NQVhfU0NPX1NVUFBPUlQ7IGkrKykKKyAgICAgICAgeworICAgICAgICAgICAgaWYoIHBSZXBsYXktPmJ0Y0V2ZW50SGlzdC5idFN5bmNVcGRhdGVFdmVudFtpXS5mVmFsaWQgJiYKKyAgICAgICAgICAgICAgICAoaGFuZGxlID09IHBSZXBsYXktPmJ0Y0V2ZW50SGlzdC5idFN5bmNVcGRhdGVFdmVudFtpXS5idFN5bmNDb25uZWN0aW9uLmNvbm5lY3Rpb25IYW5kbGUpICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwUmV0ID0gJnBSZXBsYXktPmJ0Y0V2ZW50SGlzdC5idFN5bmNVcGRhdGVFdmVudFtpXTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBpZiggTlVMTCA9PSBwUmV0ICkKKyAgICB7CisgICAgICAgIC8vRmluZCBhIGZyZWUgc2xvdAorICAgICAgICBmb3IoaSA9IDA7IGkgPCBCVF9NQVhfU0NPX1NVUFBPUlQ7IGkrKykKKyAgICAgICAgeworICAgICAgICAgICAgaWYoICFwUmVwbGF5LT5idGNFdmVudEhpc3QuYnRTeW5jVXBkYXRlRXZlbnRbaV0uZlZhbGlkICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwUmV0ID0gJnBSZXBsYXktPmJ0Y0V2ZW50SGlzdC5idFN5bmNVcGRhdGVFdmVudFtpXTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgIC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cmVhdGlvbiBldmVudC4KKyAgICBPdGhlcndpc2UsIHNhdmUgdGhpcyBjcmVhdGUgZXZlbnQuCisqLworc3RhdGljIFZPU19TVEFUVVMgYnRjRGVmZXJBY2xDcmVhdGUoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRwU21lQnRFdmVudCBwRXZlbnQgKQoreworICAgIFZPU19TVEFUVVMgc3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgIHRwU21lQnRBY2xFdmVudEhpc3QgcEFjbEV2ZW50SGlzdDsKKyAgICB0U21lQnRBY2xDb25uZWN0aW9uUGFyYW0gKnBBY2xFdmVudCA9IE5VTEw7CisgICAgZG8KKyAgICB7CisgICAgICAgIC8vRmluZCBhIG1hdGNoCisgICAgICAgIHBBY2xFdmVudEhpc3QgPSBidGNGaW5kQWNsRXZlbnRIaXN0KCBwTWFjLCBwRXZlbnQtPnVFdmVudFBhcmFtLmJ0QWNsQ29ubmVjdGlvbi5iZEFkZHIsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQlRfSU5WQUxJRF9DT05OX0hBTkRMRSApOworICAgICAgICBpZiggTlVMTCA9PSBwQWNsRXZlbnRIaXN0ICkKKyAgICAgICAgeworICAgICAgICAgICAgLy9ObyBjYWNoZWQgQUNMIGV2ZW50IG9uIHRoaXMgYWRkcmVzcworICAgICAgICAgICAgLy9GaW5kIGEgZnJlZSBzbG90IGFuZCBzYXZlIGl0CisgICAgICAgICAgICBwQWNsRXZlbnRIaXN0ID0gYnRjRmluZEFjbEV2ZW50SGlzdCggcE1hYywgTlVMTCwgQlRfSU5WQUxJRF9DT05OX0hBTkRMRSApOworICAgICAgICAgICAgaWYoIE5VTEwgIT0gcEFjbEV2ZW50SGlzdCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwQWNsRXZlbnRIaXN0LT5idEFjbENvbm5lY3Rpb25bMF0sICZwRXZlbnQtPnVFdmVudFBhcmFtLmJ0QWNsQ29ubmVjdGlvbiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U21lQnRBY2xDb25uZWN0aW9uUGFyYW0pKTsKKyAgICAgICAgICAgICAgICBwQWNsRXZlbnRIaXN0LT5idEV2ZW50VHlwZVswXSA9IEJUX0VWRU5UX0NSRUFURV9BQ0xfQ09OTkVDVElPTjsKKyAgICAgICAgICAgICAgICBwQWNsRXZlbnRIaXN0LT5iTmV4dEV2ZW50SWR4ID0gMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiBmYWlsZWQgdG8gZmluZCBBQ0wgZXZlbnQgc2xvdCIpKTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX0VfUkVTT1VSQ0VTOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy9kb25lCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vVGhlcmUgaXMgaGlzdG9yeSBvbiB0aGlzIEJEIGFkZHJlc3MKKyAgICAgICAgICAgIGlmICgocEFjbEV2ZW50SGlzdC0+Yk5leHRFdmVudElkeCA8PSAwKSB8fAorICAgICAgICAgICAgICAgIChwQWNsRXZlbnRIaXN0LT5iTmV4dEV2ZW50SWR4ID4gQlRfTUFYX05VTV9FVkVOVF9BQ0xfREVGRVJSRUQpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwQWNsRXZlbnQgPSAmcEFjbEV2ZW50SGlzdC0+YnRBY2xDb25uZWN0aW9uW3BBY2xFdmVudEhpc3QtPmJOZXh0RXZlbnRJZHggLSAxXTsKKyAgICAgICAgICAgIGlmKEJUX0VWRU5UX0NSRUFURV9BQ0xfQ09OTkVDVElPTiA9PSBwQWNsRXZlbnRIaXN0LT5idEV2ZW50VHlwZVtwQWNsRXZlbnRIaXN0LT5iTmV4dEV2ZW50SWR4IC0gMV0pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9UaGUgbGFzdCBjYWNoZWQgZXZlbnQgaXMgY3JlYXRpb24sIHJlcGxhY2UgaXQgd2l0aCB0aGUgbmV3IG9uZQorICAgICAgICAgICAgICAgIGlmIChwQWNsRXZlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocEFjbEV2ZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBFdmVudC0+dUV2ZW50UGFyYW0uYnRBY2xDb25uZWN0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTbWVCdEFjbENvbm5lY3Rpb25QYXJhbSkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvL2RvbmUKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYoQlRfRVZFTlRfQUNMX0NPTk5FQ1RJT05fQ09NUExFVEUgPT0gCisgICAgICAgICAgICAgICAgICAgICAgICBwQWNsRXZlbnRIaXN0LT5idEV2ZW50VHlwZVtwQWNsRXZlbnRIaXN0LT5iTmV4dEV2ZW50SWR4IC0gMV0pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9UaGUgbGFzdCBjYWNoZWQgZXZlbnQgaXMgY29tcGxldGlvbiwgY2hlY2sgdGhlIHN0YXR1cy4KKyAgICAgICAgICAgICAgICBpZihCVF9DT05OX1NUQVRVU19TVUNDRVNTID09IHBBY2xFdmVudC0+c3RhdHVzKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdFNtZUJ0RXZlbnQgYnRFdmVudDsKKyAgICAgICAgICAgICAgICAgICAgLy9UaGUgbGFzdCBldmVudCB3ZSBoYXZlIGlzIHN1Y2Nlc3MgY29tcGxldGlvbiBldmVudC4gCisgICAgICAgICAgICAgICAgICAgIC8vU2hvdWxkIG5vdCBnZXQgYSBjcmVhdGlvbiBldmVudCBiZWZvcmUgY3JlYXRpb24uCisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiICBNaXNzaW5nIGRpc2Nvbm5lY3QgZXZlbnQgb24gaGFuZGxlICVkIiksIHBBY2xFdmVudC0+Y29ubmVjdGlvbkhhbmRsZSk7CisgICAgICAgICAgICAgICAgICAgIC8vRmFrZSBhIGRpc2Nvbm5lY3QgZXZlbnQKKyAgICAgICAgICAgICAgICAgICAgYnRFdmVudC5idEV2ZW50VHlwZSA9IEJUX0VWRU5UX0RJU0NPTk5FQ1RJT05fQ09NUExFVEU7CisgICAgICAgICAgICAgICAgICAgIGJ0RXZlbnQudUV2ZW50UGFyYW0uYnREaXNjb25uZWN0LmNvbm5lY3Rpb25IYW5kbGUgPSBwQWNsRXZlbnQtPmNvbm5lY3Rpb25IYW5kbGU7CisgICAgICAgICAgICAgICAgICAgIGJ0Y0RlZmVyRGlzY29ubkV2ZW50KHBNYWMsICZidEV2ZW50KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvL05lZWQgdG8gc2F2ZSB0aGUgbmV3IGV2ZW50CisgICAgICAgICAgICBpZihwQWNsRXZlbnRIaXN0LT5iTmV4dEV2ZW50SWR4IDwgQlRfTUFYX05VTV9FVkVOVF9BQ0xfREVGRVJSRUQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcEFjbEV2ZW50SGlzdC0+YnRFdmVudFR5cGVbcEFjbEV2ZW50SGlzdC0+Yk5leHRFdmVudElkeF0gPSBCVF9FVkVOVF9DUkVBVEVfQUNMX0NPTk5FQ1RJT047CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwQWNsRXZlbnRIaXN0LT5idEFjbENvbm5lY3Rpb25bcEFjbEV2ZW50SGlzdC0+Yk5leHRFdmVudElkeF0sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEV2ZW50LT51RXZlbnRQYXJhbS5idEFjbENvbm5lY3Rpb24sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNtZUJ0QWNsQ29ubmVjdGlvblBhcmFtKSk7CisgICAgICAgICAgICAgICAgcEFjbEV2ZW50SGlzdC0+Yk5leHRFdmVudElkeCsrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiIEFDTCBldmVudCBvdmVyZmxvdyIpKTsKKyAgICAgICAgICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfXdoaWxlKDApOworICAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qRGVmZXIgYSBBQ0wgY29tcGxldGlvbiBldmVudAorICBJZiB0aGVyZSBpcyBjYWNoZWQgZXZlbnQgb24gdGhpcyBCRCBhZGRyZXNzLCBjaGVjayBjb21wbGV0aW9uIHN0YXR1cy4KKyAgSWYgc3RhdHVzIGlzIGZhaWwgYW5kIGxhc3QgY2FjaGVkIGV2ZW50IGlzIGNyZWF0aW9uLCByZW1vdmUgdGhlIGNyZWF0aW9uIGV2ZW50IGFuZCBkcm9wCisgIHRoaXMgY29tcGxldGlvbiBldmVudC4gT3RoZXJ3aXNlLCBjYWNoZSB0aGlzIGNvbXBsZXRpb24gZXZlbnQgYXMgdGhlIGxhdGVzdCBvbmUuCisqLworc3RhdGljIFZPU19TVEFUVVMgYnRjRGVmZXJBY2xDb21wbGV0ZSggdHBBbmlTaXJHbG9iYWwgcE1hYywgdHBTbWVCdEV2ZW50IHBFdmVudCApCit7CisgICAgVk9TX1NUQVRVUyBzdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICAgdHBTbWVCdEFjbEV2ZW50SGlzdCBwQWNsRXZlbnRIaXN0OworICAgIGRvCisgICAgeworICAgICAgICAvL0ZpbmQgYSBtYXRjaAorICAgICAgICBwQWNsRXZlbnRIaXN0ID0gYnRjRmluZEFjbEV2ZW50SGlzdCggcE1hYywgcEV2ZW50LT51RXZlbnRQYXJhbS5idEFjbENvbm5lY3Rpb24uYmRBZGRyLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJUX0lOVkFMSURfQ09OTl9IQU5ETEUgKTsKKyAgICAgICAgaWYocEFjbEV2ZW50SGlzdCkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX0FTU0VSVChwQWNsRXZlbnRIaXN0LT5iTmV4dEV2ZW50SWR4ID4wKTsKKyAgICAgICAgICAgIC8vRm91bmQgb25lCisgICAgICAgICAgICBpZihCVF9DT05OX1NUQVRVU19TVUNDRVNTICE9IHBFdmVudC0+dUV2ZW50UGFyYW0uYnRBY2xDb25uZWN0aW9uLnN0YXR1cykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvL0lmIGNvbXBsZXRpb24gZmFpbHMsIGFuZCB0aGUgbGFzdCBvbmUgaXMgY3JlYXRpb24sIHJlbW92ZSB0aGUgY3JlYXRpb24gZXZlbnQKKyAgICAgICAgICAgICAgICBpZihCVF9FVkVOVF9DUkVBVEVfQUNMX0NPTk5FQ1RJT04gPT0gcEFjbEV2ZW50SGlzdC0+YnRFdmVudFR5cGVbcEFjbEV2ZW50SGlzdC0+Yk5leHRFdmVudElkeC0xXSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1femVybygmcEFjbEV2ZW50SGlzdC0+YnRBY2xDb25uZWN0aW9uW3BBY2xFdmVudEhpc3QtPmJOZXh0RXZlbnRJZHgtMV0sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTbWVCdEFjbENvbm5lY3Rpb25QYXJhbSkpOworICAgICAgICAgICAgICAgICAgICBwQWNsRXZlbnRIaXN0LT5iTmV4dEV2ZW50SWR4LS07CisgICAgICAgICAgICAgICAgICAgIC8vRG9uZSB3aXRoIHRoaXMgZXZlbnQKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiIEFDTCBjb21wbGV0aW9uIGZhaWwgYnV0IGxhc3QgZXZlbnQoJWQpIG5vdCBjcmVhdGlvbiIpLAorICAgICAgICAgICAgICAgICAgICAgICAgcEFjbEV2ZW50SGlzdC0+YnRFdmVudFR5cGVbcEFjbEV2ZW50SGlzdC0+Yk5leHRFdmVudElkeC0xXSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmKCBOVUxMID09IHBBY2xFdmVudEhpc3QgKQorICAgICAgICB7CisgICAgICAgICAgICBwQWNsRXZlbnRIaXN0ID0gYnRjRmluZEFjbEV2ZW50SGlzdCggcE1hYywgTlVMTCwgQlRfSU5WQUxJRF9DT05OX0hBTkRMRSApOworICAgICAgICB9CisgICAgICAgIGlmKHBBY2xFdmVudEhpc3QpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKHBBY2xFdmVudEhpc3QtPmJOZXh0RXZlbnRJZHggPCBCVF9NQVhfTlVNX0VWRU5UX0FDTF9ERUZFUlJFRCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvL1NhdmUgdGhpcyBldmVudAorICAgICAgICAgICAgICAgIHBBY2xFdmVudEhpc3QtPmJ0RXZlbnRUeXBlW3BBY2xFdmVudEhpc3QtPmJOZXh0RXZlbnRJZHhdID0gQlRfRVZFTlRfQUNMX0NPTk5FQ1RJT05fQ09NUExFVEU7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwQWNsRXZlbnRIaXN0LT5idEFjbENvbm5lY3Rpb25bcEFjbEV2ZW50SGlzdC0+Yk5leHRFdmVudElkeF0sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEV2ZW50LT51RXZlbnRQYXJhbS5idEFjbENvbm5lY3Rpb24sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNtZUJ0QWNsQ29ubmVjdGlvblBhcmFtKSk7CisgICAgICAgICAgICAgICAgcEFjbEV2ZW50SGlzdC0+Yk5leHRFdmVudElkeCsrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiIEFDTCBldmVudCBvdmVyZmxvdyIpKTsKKyAgICAgICAgICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgY2Fubm90IGZpbmQgbWF0Y2ggZm9yIGZhaWxlZCAiCisgICAgICAgICAgICAgICAgICAgIkJUX0VWRU5UX0FDTF9DT05ORUNUSU9OX0NPTVBMRVRFIG9mIGJkQWRkciAiCisgICAgICAgICAgICAgICAgICAgTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwRXZlbnQtPnVFdmVudFBhcmFtLmJ0QWNsQ29ubmVjdGlvbi5iZEFkZHIpKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfRV9FTVBUWTsKKyAgICAgICAgfQorICAgIH13aGlsZSgwKTsKKyAgICByZXR1cm4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AgICAgICAgICAvL05vIGNhY2hlZCBBQ0wgZXZlbnQgb24gdGhpcyBhZGRyZXNzCisgICAgICAgICAgICAvL0ZpbmQgYSBmcmVlIHNsb3QgYW5kIHNhdmUgaXQKKyAgICAgICAgICAgIHBTeW5jRXZlbnRIaXN0ID0gYnRjRmluZFN5bmNFdmVudEhpc3QoIHBNYWMsIE5VTEwsIEJUX0lOVkFMSURfQ09OTl9IQU5ETEUgKTsKKyAgICAgICAgICAgIGlmKCBOVUxMICE9IHBTeW5jRXZlbnRIaXN0ICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnBTeW5jRXZlbnRIaXN0LT5idFN5bmNDb25uZWN0aW9uWzBdLCAmcEV2ZW50LT51RXZlbnRQYXJhbS5idFN5bmNDb25uZWN0aW9uLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTbWVCdFN5bmNDb25uZWN0aW9uUGFyYW0pKTsKKyAgICAgICAgICAgICAgICBwU3luY0V2ZW50SGlzdC0+YnRFdmVudFR5cGVbMF0gPSBCVF9FVkVOVF9DUkVBVEVfU1lOQ19DT05ORUNUSU9OOworICAgICAgICAgICAgICAgIHBTeW5jRXZlbnRIaXN0LT5iTmV4dEV2ZW50SWR4ID0gMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiBmYWlsZWQgdG8gZmluZCBTWU5DIGV2ZW50IHNsb3QiKSk7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX1JFU09VUkNFUzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vZG9uZQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvL1RoZXJlIGlzIGhpc3Rvcnkgb24gdGhpcyBCRCBhZGRyZXNzCisgICAgICAgICAgICBpZiAoKHBTeW5jRXZlbnRIaXN0LT5iTmV4dEV2ZW50SWR4IDw9IDApIHx8CisgICAgICAgICAgICAgICAgKHBTeW5jRXZlbnRIaXN0LT5iTmV4dEV2ZW50SWR4ID4gQlRfTUFYX05VTV9FVkVOVF9TQ09fREVGRVJSRUQpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBTeW5jRXZlbnQgPSAmcFN5bmNFdmVudEhpc3QtPmJ0U3luY0Nvbm5lY3Rpb25bcFN5bmNFdmVudEhpc3QtPmJOZXh0RXZlbnRJZHggLSAxXTsKKyAgICAgICAgICAgIGlmKEJUX0VWRU5UX0NSRUFURV9TWU5DX0NPTk5FQ1RJT04gPT0gCisgICAgICAgICAgICAgICAgcFN5bmNFdmVudEhpc3QtPmJ0RXZlbnRUeXBlW3BTeW5jRXZlbnRIaXN0LT5iTmV4dEV2ZW50SWR4IC0gMV0pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9UaGUgbGFzdCBjYWNoZWQgZXZlbnQgaXMgY3JlYXRpb24sIHJlcGxhY2UgaXQgd2l0aCB0aGUgbmV3IG9uZQorICAgICAgICAgICAgICAgIGlmKHBTeW5jRXZlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocFN5bmNFdmVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwRXZlbnQtPnVFdmVudFBhcmFtLmJ0U3luY0Nvbm5lY3Rpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNtZUJ0U3luY0Nvbm5lY3Rpb25QYXJhbSkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvL2RvbmUKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYoQlRfRVZFTlRfU1lOQ19DT05ORUNUSU9OX0NPTVBMRVRFID09IAorICAgICAgICAgICAgICAgICAgICAgICAgcFN5bmNFdmVudEhpc3QtPmJ0RXZlbnRUeXBlW3BTeW5jRXZlbnRIaXN0LT5iTmV4dEV2ZW50SWR4IC0gMV0pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9UaGUgbGFzdCBjYWNoZWQgZXZlbnQgaXMgY29tcGxldGlvbiwgY2hlY2sgdGhlIHN0YXR1cy4KKyAgICAgICAgICAgICAgICBpZihCVF9DT05OX1NUQVRVU19TVUNDRVNTID09IHBTeW5jRXZlbnQtPnN0YXR1cykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHRTbWVCdEV2ZW50IGJ0RXZlbnQ7CisgICAgICAgICAgICAgICAgICAgIC8vVGhlIGxhc3QgZXZlbnQgd2UgaGF2ZSBpcyBzdWNjZXNzIGNvbXBsZXRpb24gZXZlbnQuIAorICAgICAgICAgICAgICAgICAgICAvL1Nob3VsZCBub3QgZ2V0IGEgY3JlYXRpb24gZXZlbnQgYmVmb3JlIGNyZWF0aW9uLgorICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiAgTWlzc2luZyBkaXNjb25uZWN0IGV2ZW50IG9uIGhhbmRsZSAlZCIpLCBwU3luY0V2ZW50LT5jb25uZWN0aW9uSGFuZGxlKTsKKyAgICAgICAgICAgICAgICAgICAgLy9GYWtlIGEgZGlzY29ubmVjdCBldmVudAorICAgICAgICAgICAgICAgICAgICBidEV2ZW50LmJ0RXZlbnRUeXBlID0gQlRfRVZFTlRfRElTQ09OTkVDVElPTl9DT01QTEVURTsKKyAgICAgICAgICAgICAgICAgICAgYnRFdmVudC51RXZlbnRQYXJhbS5idERpc2Nvbm5lY3QuY29ubmVjdGlvbkhhbmRsZSA9IHBTeW5jRXZlbnQtPmNvbm5lY3Rpb25IYW5kbGU7CisgICAgICAgICAgICAgICAgICAgIGJ0Y0RlZmVyRGlzY29ubkV2ZW50KHBNYWMsICZidEV2ZW50KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvL05lZWQgdG8gc2F2ZSB0aGUgbmV3IGV2ZW50CisgICAgICAgICAgICBpZihwU3luY0V2ZW50SGlzdC0+Yk5leHRFdmVudElkeCA8IEJUX01BWF9OVU1fRVZFTlRfU0NPX0RFRkVSUkVEKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBTeW5jRXZlbnRIaXN0LT5idEV2ZW50VHlwZVtwU3luY0V2ZW50SGlzdC0+Yk5leHRFdmVudElkeF0gPSBCVF9FVkVOVF9DUkVBVEVfU1lOQ19DT05ORUNUSU9OOworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmcFN5bmNFdmVudEhpc3QtPmJ0U3luY0Nvbm5lY3Rpb25bcFN5bmNFdmVudEhpc3QtPmJOZXh0RXZlbnRJZHhdLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBFdmVudC0+dUV2ZW50UGFyYW0uYnRTeW5jQ29ubmVjdGlvbiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U21lQnRTeW5jQ29ubmVjdGlvblBhcmFtKSk7CisgICAgICAgICAgICAgICAgcFN5bmNFdmVudEhpc3QtPmJOZXh0RXZlbnRJZHgrKzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiBTWU5DIGV2ZW50IG92ZXJmbG93IikpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfXdoaWxlKDApO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ZihCVF9DT05OX1NUQVRVU19TVUNDRVNTICE9IHBFdmVudC0+dUV2ZW50UGFyYW0uYnRTeW5jQ29ubmVjdGlvbi5zdGF0dXMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9JZiBjb21wbGV0aW9uIGZhaWxzLCBhbmQgdGhlIGxhc3Qgb25lIGlzIGNyZWF0aW9uLCByZW1vdmUgdGhlIGNyZWF0aW9uIGV2ZW50CisgICAgICAgICAgICAgICAgaWYoQlRfRVZFTlRfQ1JFQVRFX1NZTkNfQ09OTkVDVElPTiA9PSBwU3luY0V2ZW50SGlzdC0+YnRFdmVudFR5cGVbcFN5bmNFdmVudEhpc3QtPmJOZXh0RXZlbnRJZHgtMV0pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX3plcm8oJnBTeW5jRXZlbnRIaXN0LT5idFN5bmNDb25uZWN0aW9uW3BTeW5jRXZlbnRIaXN0LT5iTmV4dEV2ZW50SWR4LTFdLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U21lQnRTeW5jQ29ubmVjdGlvblBhcmFtKSk7CisgICAgICAgICAgICAgICAgICAgIHBTeW5jRXZlbnRIaXN0LT5iTmV4dEV2ZW50SWR4LS07CisgICAgICAgICAgICAgICAgICAgIC8vRG9uZSB3aXRoIHRoaXMgZXZlbnQKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiIFNZTkMgY29tcGxldGlvbiBmYWlsIGJ1dCBsYXN0IGV2ZW50KCVkKSBub3QgY3JlYXRpb24iKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTeW5jRXZlbnRIaXN0LT5idEV2ZW50VHlwZVtwU3luY0V2ZW50SGlzdC0+Yk5leHRFdmVudElkeC0xXSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmKE5VTEwgPT0gcFN5bmNFdmVudEhpc3QpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vSW4gY2FzZSB3ZSBkb24ndCBkZWZlciB0aGUgY3JlYXRpb24gZXZlbnQKKyAgICAgICAgICAgIHBTeW5jRXZlbnRIaXN0ID0gYnRjRmluZFN5bmNFdmVudEhpc3QoIHBNYWMsIE5VTEwsIEJUX0lOVkFMSURfQ09OTl9IQU5ETEUgKTsKKyAgICAgICAgfQorICAgICAgICBpZihwU3luY0V2ZW50SGlzdCkKKyAgICAgICAgeworICAgICAgICAgICAgaWYocFN5bmNFdmVudEhpc3QtPmJOZXh0RXZlbnRJZHggPCBCVF9NQVhfTlVNX0VWRU5UX0FDTF9ERUZFUlJFRCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvL1NhdmUgdGhpcyBldmVudAorICAgICAgICAgICAgICAgIHBTeW5jRXZlbnRIaXN0LT5idEV2ZW50VHlwZVtwU3luY0V2ZW50SGlzdC0+Yk5leHRFdmVudElkeF0gPSBCVF9FVkVOVF9TWU5DX0NPTk5FQ1RJT05fQ09NUExFVEU7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwU3luY0V2ZW50SGlzdC0+YnRTeW5jQ29ubmVjdGlvbltwU3luY0V2ZW50SGlzdC0+Yk5leHRFdmVudElkeF0sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEV2ZW50LT51RXZlbnRQYXJhbS5idFN5bmNDb25uZWN0aW9uLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTbWVCdFN5bmNDb25uZWN0aW9uUGFyYW0pKTsKKyAgICAgICAgICAgICAgICBwU3luY0V2ZW50SGlzdC0+Yk5leHRFdmVudElkeCsrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxz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BldmVudCBoaXN0b3J5IGluZGV4OiVkIG92ZXJmbG93LCByZXNldHRpbmcgdG8gQlRfTUFYX05VTV9FVkVOVF9BQ0xfREVGRVJSRUQiKSwgcEFjbEV2ZW50SGlzdC0+Yk5leHRFdmVudElkeCk7CisgICAgICAgICAgICBwQWNsRXZlbnRIaXN0LT5iTmV4dEV2ZW50SWR4ID0gQlRfTUFYX05VTV9FVkVOVF9BQ0xfREVGRVJSRUQ7CisgICAgICAgIH0KKyAgICAgICAgLy9Mb29raW5nIGJhY2t3b3JkcworICAgICAgICBmb3IoaSA9IHBBY2xFdmVudEhpc3QtPmJOZXh0RXZlbnRJZHggLSAxOyBpID49IDA7IGktLSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYoIEJUX0VWRU5UX0FDTF9DT05ORUNUSU9OX0NPTVBMRVRFID09IHBBY2xFdmVudEhpc3QtPmJ0RXZlbnRUeXBlW2ldICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvL21ha2Ugc3VyZSB3ZSBjYW4gY2FuY2VsIHRoZSBsaW5rCisgICAgICAgICAgICAgICAgaWYoIChpID4gMCkgJiYgKEJUX0VWRU5UX0NSRUFURV9BQ0xfQ09OTkVDVElPTiA9PSBwQWNsRXZlbnRIaXN0LT5idEV2ZW50VHlwZVtpIC0gMV0pICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGZEb25lID0gVk9TX1RSVUU7CisgICAgICAgICAgICAgICAgICAgIGlmKGkgPT0gMSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLy9BbGwgZXZlbnRzIGNhbiBiZSB3aXBlZCBvZmYKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ0Y1JlbGVhc2VBY2xFdmVudEhpc3QocE1hYywgcEFjbEV2ZW50SGlzdCk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvL3dlIGhhdmUgYm90aCBBQ0wgY3JlYXRpb24gYW5kIGNvbXBsZXRpb24sIHdpcGUgb3V0IGFsbCBvZiB0aGVtCisgICAgICAgICAgICAgICAgICAgIHBBY2xFdmVudEhpc3QtPmJOZXh0RXZlbnRJZHggPSAodEFOSV9VOCkoaSAtIDEpOworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX3plcm8oJnBBY2xFdmVudEhpc3QtPmJ0QWNsQ29ubmVjdGlvbltpLTFdLCBzaXplb2YodFNtZUJ0QWNsQ29ubmVjdGlvblBhcmFtKSk7CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1femVybygmcEFjbEV2ZW50SGlzdC0+YnRBY2xDb25uZWN0aW9uW2ldLCBzaXplb2YodFNtZUJ0QWNsQ29ubmVjdGlvblBhcmFtKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfS8vZm9yIGxvb3AKKyAgICAgICAgaWYoIWZEb25lKQorICAgICAgICB7CisgICAgICAgICAgICAvL1NhdmUgdGhpcyBkaXNjb25uZWN0IGV2ZW50CisgICAgICAgICAgICBpZihwQWNsRXZlbnRIaXN0LT5iTmV4dEV2ZW50SWR4IDwgQlRfTUFYX05VTV9FVkVOVF9BQ0xfREVGRVJSRUQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcEFjbEV2ZW50SGlzdC0+YnRFdmVudFR5cGVbcEFjbEV2ZW50SGlzdC0+Yk5leHRFdmVudElkeF0gPSAKKyAgICAgICAgICAgICAgICAgICAgQlRfRVZFTlRfRElTQ09OTkVDVElPTl9DT01QTEVURTsKKyAgICAgICAgICAgICAgICBwQWNsRXZlbnRIaXN0LT5idEFjbENvbm5lY3Rpb25bcEFjbEV2ZW50SGlzdC0+Yk5leHRFdmVudElkeF0uY29ubmVjdGlvbkhhbmRsZSA9CisgICAgICAgICAgICAgICAgICAgIHBFdmVudC0+d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VyZSB3ZSBjYW4gY2FuY2VsIHRoZSBsaW5rCisgICAgICAgICAgICAgICAgaWYoIChpID4gMCkgJiYgKEJUX0VWRU5UX0NSRUFURV9TWU5DX0NPTk5FQ1RJT04gPT0gcFN5bmNFdmVudEhpc3QtPmJ0RXZlbnRUeXBlW2kgLSAxXSkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgZkRvbmUgPSBWT1NfVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgaWYoaSA9PSAxKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvL0FsbCBldmVudHMgY2FuIGJlIHdpcGVkIG9mZgorICAgICAgICAgICAgICAgICAgICAgICAgYnRjUmVsZWFzZVN5bmNFdmVudEhpc3QocE1hYywgcFN5bmNFdmVudEhpc3QpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgLy93ZSBoYXZlIGJvdGggQUNMIGNyZWF0aW9uIGFuZCBjb21wbGV0aW9uLCB3aXBlIG91dCBhbGwgb2YgdGhlbQorICAgICAgICAgICAgICAgICAgICBwU3luY0V2ZW50SGlzdC0+Yk5leHRFdmVudElkeCA9ICh0QU5JX1U4KShpIC0gMSk7CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1femVybygmcFN5bmNFdmVudEhpc3QtPmJ0U3luY0Nvbm5lY3Rpb25baS0xXSwgc2l6ZW9mKHRTbWVCdFN5bmNDb25uZWN0aW9uUGFyYW0pKTsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV96ZXJvKCZwU3luY0V2ZW50SGlzdC0+YnRTeW5jQ29ubmVjdGlvbltpXSwgc2l6ZW9mKHRTbWVCdFN5bmNDb25uZWN0aW9uUGFyYW0pKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9Ly9mb3IgbG9vcAorICAgICAgICBpZighZkRvbmUpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vU2F2ZSB0aGlzIGRpc2Nvbm5lY3QgZXZlbnQKKyAgICAgICAgICAgIGlmKHBTeW5jRXZlbnRIaXN0LT5iTmV4dEV2ZW50SWR4IDwgQlRfTUFYX05VTV9FVkVOVF9TQ09fREVGRVJSRUQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFN5bmNFdmVudEhpc3QtPmJ0RXZlbnRUeXBlW3BTeW5jRXZlbnRIaXN0LT5iTmV4dEV2ZW50SWR4XSA9IAorICAgICAgICAgICAgICAgICAgICBCVF9FVkVOVF9ESVNDT05ORUNUSU9OX0NPTVBMRVRFOworICAgICAgICAgICAgICAgIHBTeW5jRXZlbnRIaXN0LT5idFN5bmNDb25uZWN0aW9uW3BTeW5jRXZlbnRIaXN0LT5iTmV4dEV2ZW50SWR4XS5jb25uZWN0aW9uSGFuZGxlID0KKyAgICAgICAgICAgICAgICAgICAgcEV2ZW50LT51RXZlbnRQYXJhbS5idERpc2Nvbm5lY3QuY29ubmVjdGlvbkhhbmRsZTsKKyAgICAgICAgICAgICAgICBwU3luY0V2ZW50SGlzdC0+Yk5leHRFdmVudElkeCsrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiIFNZTkMgZXZlbnQgb3ZlcmZsb3ciKSk7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0VYSVNUUzsKKyAgICB9CisgICAgLy9XaXBlIG91dCB0aGUgcmVsYXRlZCBtb2RlIGNoYW5nZSBldmVudCBpZiBpdCBpcyB0aGVyZQor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V9JTlZBTCk7CisgICAgfQorICAgIC8vQ2hlY2sgQUNMIGZpcnN0CisgICAgc3RhdHVzID0gYnRjRGVmZXJEaXNjb25uZWN0RXZlbnRGb3JBQ0wocE1hYywgcEV2ZW50KTsKKyAgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgeworICAgICAgICBzdGF0dXMgPSBidGNEZWZlckRpc2Nvbm5lY3RFdmVudEZvclN5bmMocE1hYywgcEV2ZW50KTsKKyAgICB9CisgICAgaWYoICFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSApCisgICAgeworICAgICAgICAvL1NhdmUgdGhlIGRpc2Nvbm5lY3QgZXZlbnQKKyAgICAgICAgcERpc2Nvbm5FdmVudEhpc3QgPSBidGNGaW5kRGlzY29ubkV2ZW50SGlzdCggcE1hYywgCisgICAgICAgICAgICBwRXZlbnQtPnVFdmVudFBhcmFtLmJ0RGlzY29ubmVjdC5jb25uZWN0aW9uSGFuZGxlICk7CisgICAgICAgIGlmKCBwRGlzY29ubkV2ZW50SGlzdCApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBEaXNjb25uRXZlbnRIaXN0LT5mVmFsaWQgPSBWT1NfVFJVRTsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSggJnBEaXNjb25uRXZlbnRIaXN0LT5idERpc2Nvbm5lY3QsICZwRXZlbnQtPnVFdmVudFBhcmFtLmJ0RGlzY29ubmVjdCwKKyAgICAgICAgICAgICAgICBzaXplb2YodFNtZUJ0RGlzY29ubmVjdFBhcmFtKSApOworICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiIGNhbm5vdCBmaW5kIG1hdGNoIGZvciBCVF9FVkVOVF9ESVNDT05ORUNUSU9OX0NPTVBMRVRFIG9mIGhhbmRsZ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ocFN5bmNVcGRhdGVIaXN0KQorICAgICAgICB7CisgICAgICAgICAgICBwU3luY1VwZGF0ZUhpc3QtPmZWYWxpZCA9IFZPU19UUlVFOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwU3luY1VwZGF0ZUhpc3QtPmJ0U3luY0Nvbm5lY3Rpb24sICZwRXZlbnQtPnVFdmVudFBhcmFtLmJ0U3luY0Nvbm5lY3Rpb24sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U21lQnRTeW5jQ29ubmVjdGlvblBhcmFtKSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCIgY2Fubm90IGZpbmQgbWF0Y2ggZm9yIEJUX0VWRU5UX1NZTkNfQ09OTkVDVElPTl9VUERBVEVEIG9mIGhhbmRsZSAoJWQpIiksCisgICAgICAgICAgICAgICAgcEV2ZW50LT51RXZlbnRQYXJhbS5idFN5bmNDb25uZWN0aW9uLmNvbm5lY3Rpb25IYW5kbGUgKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfRV9FTVBUWTsKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICBjYXNlIEJUX0VWRU5UX0RJU0NPTk5FQ1RJT05fQ09NUExFVEU6CisgICAgICAgIHN0YXR1cyA9IGJ0Y0RlZmVyRGlzY29ubkV2ZW50KCBwTWFjLCBwRXZlbnQgKTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBCVF9FVkVOVF9NT0RFX0NIQU5HRUQ6CisgICAgICAgIGlmKCBCVF9JTlZBTElEX0NPTk5fSEFORExFID09IHBFdmVudC0+dUV2ZW50UGFyYW0uYnREaXNjb25uZWN0LmNvbm5lY3Rpb25IYW5kbGUgKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCIgaW52YWxpZCBoYW5kbGUiKSApOworICAgIC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BNYWMtPmJ0Yy5idGNIQkFjdGl2ZSApIAorICAgICAgICB7CisgICAgICAgICAgICBjY21DZmdTZXRJbnQocE1hYywgV05JX0NGR19IRUFSVF9CRUFUX1RIUkVTSE9MRCwgcE1hYy0+YnRjLmJ0Y0hCQ291bnQsIE5VTEwsIGVBTklfQk9PTEVBTl9GQUxTRSk7CisgICAgICAgICAgICBwTWFjLT5idGMuYnRjSEJBY3RpdmUgPSBWT1NfVFJVRTsKKyAgICAgICAgfQorICAgIH0KKyAgICBpZiggcE1hYy0+YnRjLmZSZXBsYXlCVEV2ZW50cyApCisgICAgeworICAgICAgICAvKlNldCB0aGUgZmxhZyB0byBmYWxzZSBoZXJlIHNvIGJ0Y1NpZ25hbEJURXZlbnQgd29uJ3QgZGVmZXIgYW55IGZ1cnRoZXIuCisgICAgICAgICAgVGhpcyB3b3JrcyBiZWNhdXNlIFNNRSBoYXMgaXQgZ2xvYmFsIGxvY2sqLworICAgICAgICBwTWFjLT5idGMuZlJlcGxheUJURXZlbnRzID0gVk9TX0ZBTFNFOworICAgICAgICBpZiggcFJlcGxheS0+ZkJUU3dpdGNoT2ZmICkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV96ZXJvKCAmYnRFdmVudCwgc2l6ZW9mKHRTbWVCdEV2ZW50KSApOworICAgICAgICAgICAgYnRFdmVudC5idEV2ZW50VHlwZSA9IEJUX0VWRU5UX0RFVklDRV9TV0lUQ0hFRF9PRkY7CisgICAgICAgICAgICBidGNTZW5kQlRFdmVudCggcE1hYywgJmJ0RXZlbnQgKTsKKyAgICAgICAgICAgIHBSZXBsYXktPmZCVFN3aXRjaE9mZiA9IFZPU19GQUxTRTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmKCBwUmVwbGF5LT5mQlRTd2l0Y2hPbiApCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1femVybyggJmJ0RXZlbnQsIHNpemVvZih0U21lQnRFdmVudCkgKTsKKyAgICAgICAgICAgIGJ0RXZlbnQuYnRFdmVudFR5cGUgPSBCVF9FVkVOVF9ERVZJQ0VfU1dJVENIRURfT047CisgICAgICAgICAgICBidGNTZW5kQlRFdmVudCggcE1hYywgJmJ0RXZlbnQgKTsKKyAgICAgICAgICAgIHBSZXBsYXktPmZCVFN3aXRjaE9uID0gVk9TX0ZBTFNFOworICAgICAgICB9CisgICAgICAgIC8vRG8gaW5xdWlyZSBmaXJzdAorICAgICAgICBpZiggcFJlcGxheS0+YnRjRXZlbnRIaXN0Lm5JbnF1aXJ5RXZlbnQgPiAwICkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV96ZXJvKCAmYnRFdmVudCwgc2l6ZW9mKHRTbWVCdEV2ZW50KSApOworICAgICAgICAgICAgYnRFdmVudC5idEV2ZW50VHlwZSA9IEJUX0VWRU5UX0lOUVVJUllfU1RBUlRFRDsKKyAgICAgICAgICAgIGkgPSBwUmVwbGF5LT5idGNFdmVudEhpc3QubklucXVpcnlFdmVudDsKKyAgICAgICAgICAgIHdoaWxlKGktLSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBidGNTZW5kQlRFdmVudCggcE1hYywgJmJ0RXZlbnQgKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmKCBwUmVwbGF5LT5idGNFdmVudEhpc3QubklucXVpcnlFdmVudCA8IDAgKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX3plcm8oICZidEV2ZW50LCBzaXplb2YodFNtZUJ0RXZlbnQpICk7CisgICAgICAgICAgICBidEV2ZW50LmJ0RXZlbnRUeXBlID0gQlRfRVZFTlRfSU5RVUlSWV9TVE9QUEVEOworICAgICAgICAgICAgaSA9IHBSZXBsYXktPmJ0Y0V2ZW50SGlzdC5uSW5xdWlyeUV2ZW50OworICAgICAgICAgICAgd2hpbGUoaSsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGJ0Y1NlbmRCVEV2ZW50KCBwTWFjLCAmYnRFdmVudCApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIC8vUGFnZQorICAgICAgICBpZiggcFJlcGxheS0+YnRjRXZlbnRIaXN0Lm5QYWdlRXZlbnQgPiAwICkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV96ZXJvKCAmYnRFdmVudCwgc2l6ZW9mKHRTbWVCdEV2ZW50KSApOworICAgICAgICAgICAgYnRFdmVudC5idEV2ZW50VHlwZSA9IEJUX0VWRU5UX1BBR0VfU1RBUlRFRDsKKyAgICAgICAgICAgIGkgPSBwUmVwbGF5LT5idGNFdmVudEhpc3QublBhZ2VFdmVudDsKKyAgICAgICAgICAgIHdoaWxlKGktLSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBidGNTZW5kQlRFdmVudCggcE1hYywgJmJ0RXZlbnQgKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmKCBwUmVwbGF5LT5idGNFdmVudEhpc3QublBhZ2VFdmVudCA8IDAgKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX3plcm8oICZidEV2ZW50LCBzaXplb2YodFNtZUJ0RXZlbnQpICk7CisgICAgICAgICAgICBidEV2ZW50LmJ0RXZlbnRUeXBlID0gQlRfRVZFTlRfUEFHRV9TVE9QUEVEOworICAgICAgICAgICAgaSA9IHBSZXBsYXktPmJ0Y0V2ZW50SGlzdC5uUGFnZUV2ZW50OworICAgICAgICAgICAgd2hpbGUoaSsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGJ0Y1NlbmRCVEV2ZW50KCBwTWFjLCAmYnRFdmVudCApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIC8vUmVwbGF5IG5vbi1jb21wbGV0aW9uIGRpc2Nvbm5lY3QgZXZlbnRzIGZpcnN0CisgICAgICAgIC8vRGlzY29ubmVjdAorICAgICAgICBmb3IoIGkgPSAwOyBpIDwgQlRfTUFYX0RJU0NPTk5fU1VQUE9SVDsgaSsrICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYoIHBSZXBsYXktPmJ0Y0V2ZW50SGlzdC5idERpc2Nvbm5lY3RFdmVudFtpXS5mVmFsaWQgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1femVybyggJmJ0RXZlbnQsIHNpemVvZih0U21lQnRFdmVudCkgKTsKKyAgICAgICAgICAgICAgICBidEV2ZW50LmJ0RXZlbnRUeXBlID0gQlRfRVZFTlRfRElTQ09OTkVDVElPTl9DT01QTEVURTsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoICZidEV2ZW50LnVFdmVudFBhcmFtLmJ0RGlzY29ubmVjdCwgCisgICAgICAgICAgICAgICAgICAgICZwUmVwbGF5LT5idGNFdmVudEhpc3QuYnREaXNjb25uZWN0RXZlbnRbaV0uYnREaXNjb25uZWN0LCBzaXplb2YodFNtZUJ0RGlzY29ubmVjdFBhcmFtKSApOworICAgICAgICAgICAgICAgIGJ0Y1NlbmRCVEV2ZW50KCBwTWFjLCAmYnRFdmVudCApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIC8vQUNMCisgICAgICAgIGZvciggaSA9IDA7IGkgPCBCVF9NQVhfQUNMX1NVUFBPUlQ7IGkrKyApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKCBwUmVwbGF5LT5idGNFdmVudEhpc3QuYnRBY2xDb25uZWN0aW9uRXZlbnRbaV0uYk5leHRFdmVudElkeCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcEFjbEhpc3QgPSAmcFJlcGxheS0+YnRjRXZlbnRIaXN0LmJ0QWNsQ29ubmVjdGlvbkV2ZW50W2ldOworICAgICAgICAgICAgICAgIC8vUmVwbGF5IGFsbCBBQ0wgZXZlbnRzIGZvciB0aGlzIEJEIGFkZHJlc3MvaGFuZGxlCisgICAgICAgICAgICAgICAgZm9yKGogPSAwOyBqIDwgcEFjbEhpc3QtPmJOZXh0RXZlbnRJZHg7IGorKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1femVybyggJmJ0RXZlbnQsIHNpemVvZih0U21lQnRFdmVudCkgKTsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV96ZXJvKCAmYnRFdmVudCwgc2l6ZW9mKHRTbWVCdEV2ZW50KSApOworICAgICAgICAgICAgICAgICAgICBidEV2ZW50LmJ0RXZlbnRUeXBlID0gcEFjbEhpc3QtPmJ0RXZlbnRUeXBlW2pdOworICAgICAgICAgICAgICAgICAgICBpZihCVF9FVkVOVF9ESVNDT05ORUNUSU9OX0NPTVBMRVRFICE9IGJ0RXZlbnQuYnRFdmVudFR5cGUpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vSXQgbXVzdCBiZSBDUkVBVEUgb3IgQ09OTkVDVElPTl9DT01QTEVURQorICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoICZidEV2ZW50LnVFdmVudFBhcmFtLmJ0QWNsQ29ubmVjdGlvbiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBBY2xIaXN0LT5idEFjbENvbm5lY3Rpb25bal0sIHNpemVvZih0U21lQnRBY2xDb25uZWN0aW9uUGFyYW0pICk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgIGJ0RXZlbnQudUV2ZW50UGFyYW0uYnREaXNjb25uZWN0LmNvbm5lY3Rpb25IYW5kbGUgPSBwQWNsSGlzdC0+YnRBY2xDb25uZWN0aW9uW2pdLmNvbm5lY3Rpb25IYW5kbGU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnRjU2VuZEJURXZlbnQoIHBNYWMsICZidEV2ZW50ICk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIC8vTW9kZSBjaGFuZ2UKKyAgICAgICAgZm9yKCBpID0gMDsgaSA8IEJUX01BWF9BQ0xfU1VQUE9SVDsgaSsrICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYoIHBSZXBsYXktPmJ0Y0V2ZW50SGlzdC5idEFjbE1vZGVDaGFuZ2VFdmVudFtpXS5mVmFsaWQgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1femVybyggJmJ0RXZlbnQsIHNpemVvZih0U21lQnRFdmVudCkgKTsKKyAgICAgICAgICAgICAgICBidEV2ZW50LmJ0RXZlbnRUeXBlID0gQlRfRVZFTlRfTU9ERV9DSEFOR0VEOworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSggJmJ0RXZlbnQudUV2ZW50UGFyYW0uYnRBY2xNb2RlQ2hhbmdlLCAKKyAgICAgICAgICAgICAgICAgICAgJnBSZXBsYXktPmJ0Y0V2ZW50SGlzdC5idEFjbE1vZGVDaGFuZ2VFdmVudFtpXS5idEFjbE1vZGVDaGFuZ2UsIHNpemVvZih0U21lQnRBY2xNb2RlQ2hhbmdlUGFyYW0pICk7CisgICAgICAgICAgICAgICAgYnRjU2VuZEJURXZlbnQoIHBNYWMsICZidEV2ZW50ICk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAvL0EyRFAKKyAgICAgICAgaWYoIHBSZXBsYXktPmJ0Y0V2ZW50SGlzdC5mQTJEUFN0YXJ0ZWQgKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX3plcm8oICZidEV2ZW50LCBzaXplb2YodFNtZUJ0RXZlbnQpICk7CisgICAgICAgICAgICBidEV2ZW50LmJ0RXZlbnRUeXBlID0gQlRfRVZFTlRfQTJEUF9TVFJFQU1fU1RBUlQ7CisgICAgICAgICAgICBidGNTZW5kQlRFdmVudCggcE1hYywgJmJ0RXZlbnQgKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmKCBwUmVwbGF5LT5idGNFdmVudEhpc3QuZkEyRFBTdG9wcGVkICkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV96ZXJvKCAmYnRFdmVudCwgc2l6ZW9mKHRTbWVCdEV2ZW50KSApOworICAgICAgICAgICAgYnRFdmVudC5idEV2ZW50VHlwZSA9IEJUX0VWRU5UX0EyRFBfU1RSRUFNX1NUT1A7CisgICAgICAgICAgICBidGNTZW5kQlRFdmVudCggcE1hYywgJmJ0RXZlbnQgKTsKKyAgICAgICAgfQorICAgICAgICAvL1NDTworICAgICAgICBmb3IoIGkgPSAwOyBpIDwgQlRfTUFYX1NDT19TVVBQT1JUOyBpKysgKQorICAgICAgICB7CisgICAgICAgICAgICBpZiggcFJlcGxheS0+YnRjRXZlbnRIaXN0LmJ0U3luY0Nvbm5lY3Rpb25FdmVudFtpXS5iTmV4dEV2ZW50SWR4ICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwU3luY0hpc3QgPSAmcFJlcGxheS0+YnRjRXZlbnRIaXN0LmJ0U3luY0Nvbm5lY3Rpb25FdmVudFtpXTsKKyAgICAgICAgICAgICAgICAvL1JlcGxheSBhbGwgU1lOQyBldmVudHMgZm9yIHRoaXMgQkQgYWRkcmVzcy9oYW5kbGUKKyAgICAgICAgICAgICAgICBmb3IoaiA9IDA7IGogPCBwU3luY0hpc3QtPmJOZXh0RXZlbnRJZHg7IGorKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1femVybyggJmJ0RXZlbnQsIHNpemVvZih0U21lQnRFdmVudCkgKTsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV96ZXJvKCAmYnRFdmVudCwgc2l6ZW9mKHRTbWVCdEV2ZW50KSApOworICAgICAgICAgICAgICAgICAgICBidEV2ZW50LmJ0RXZlbnRUeXBlID0gcFN5bmNIaXN0LT5idEV2ZW50VHlwZVtqXTsKKyAgICAgICAgICAgICAgICAgICAgaWYoQlRfRVZFTlRfRElTQ09OTkVDVElPTl9DT01QTEVURSAhPSBidEV2ZW50LmJ0RXZlbnRUeXBlKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvL011c3QgYmUgQ1JFQVRJT04gb3IgQ09OTkVDVElPTl9DT01QTEVURQorICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoICZidEV2ZW50LnVFdmVudFBhcmFtLmJ0U3luY0Nvbm5lY3Rpb24sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwU3luY0hpc3QtPmJ0U3luY0Nvbm5lY3Rpb25bal0sIHNpemVvZih0U21lQnRTeW5jQ29ubmVjdGlvblBhcmFtKSApOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgYnRFdmVudC51RXZlbnRQYXJhbS5idERpc2Nvbm5lY3QuY29ubmVjdGlvbkhhbmRsZSA9IHBTeW5jSGlzdC0+YnRTeW5jQ29ubmVjdGlvbltqXS5jb25uZWN0aW9uSGFuZGxlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJ0Y1NlbmRCVEV2ZW50KCBwTWFjLCAmYnRFdmVudCApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAvL1NZTkMgdXBkYXRlCisgICAgICAgIGZvciggaSA9IDA7IGkgPCBCVF9NQVhfU0NPX1NVUFBPUlQ7IGkrKyApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKCBwUmVwbGF5LT5idGNFdmVudEhpc3QuYnRTeW5jVXBkYXRlRXZlbnRbaV0uZlZhbGlkICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX3plcm8oICZidEV2ZW50LCBzaXplb2YodFNt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ICE9IHBNYWMtPmJ0Yy5idGNTY29IYW5kbGVzW2ldKSAmJgorICAgICAgICAgICAgICAgICAgIChwTWFjLT5idGMuYnRjU2NvSGFuZGxlc1tpXSAhPSBwQnRFdmVudC0+dUV2ZW50UGFyYW0uYnREaXNjb25uZWN0LmNvbm5lY3Rpb25IYW5kbGUpICkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAvL1dlIHN0aWxsIGhhdmUgb3V0c3RhbmRpbmcgU0NPIGNvbm5lY3Rpb24KKyAgICAgICAgICAgICAgICAgICBmTW9yZVNDTyA9IFZPU19UUlVFOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgZWxzZSBpZiggcE1hYy0+YnRjLmJ0Y1Njb0hhbmRsZXNbaV0gPT0gcEJ0RXZlbnQtPnVFdmVudFBhcmFtLmJ0RGlzY29ubmVjdC5jb25uZWN0aW9uSGFuZGxlICkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBwTWFjLT5idGMuYnRjU2NvSGFuZGxlc1tpXSA9IEJUX0lOVkFMSURfQ09OTl9IQU5ETEU7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgIH0KKyAgICAgICAgICAgaWYoICFmTW9yZVNDTyAmJiAhcE1hYy0+YnRjLmZBMkRQVXAgKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvL0FsbCBTQ08gaXMgZGlzY29ubmVjdGVkCisgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsICJCVCBldmVudCAoRElTQ09OTkVDVElPTikgaGFwcGVucywgVUFQU0QtYWxsb3dlZCBmbGFnICglZCkgY2hhbmdlIHRvIFRSVUUiLAorICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+YnRjLmJ0Y1VhcHNkT2sgKTsKKyAgICAgICAgICAgICAgIHBNYWMtPmJ0Yy5idGNVYXBzZE9rID0gVk9TX1RSVUU7CisgICAgICAgICAgIH0KKyAgICAgICB9CisgICAg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JyZWFrOworICAgICAgICAgICB9CisgICAgICAgfQorICAgICAgIGlmKCBCVF9NQVhfU0NPX1NVUFBPUlQgPT0gaSApCisgICAgICAgeworICAgICAgICAgICAgcE1hYy0+YnRjLmZBMkRQVHJhZlN0b3AgPSBWT1NfVFJVRTsKKyAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAiQlRfRVZFTlRfQTJEUF9TVFJFQU1fU1RPUDogVUFQU0QtYWxsb3dlZCBmbGFnIGlzIG5vdyAlZCIsCisgICAgICAgICAgICAgICAgICAgcE1hYy0+YnRjLmJ0Y1VhcHNkT2sgKTsKKyAgICAgICB9CisgICAgICAgYnJlYWs7CisKKyAgIGNhc2UgQlRfRVZFTlRfTU9ERV9DSEFOR0VEOgorICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgIkJUIGV2ZW50IChCVF9FVkVOVF9NT0RFX0NIQU5HRUQpIGhhcHBlbnMsIE1vZGUgKCVkKSBVQVBTRC1hbGxvd2VkIGZsYWcgKCVkKSIsCisgICAgICAgICAgICAgICBwQnRFdmVudC0+dUV2ZW50UGFyYW0uYnRBY2xNb2RlQ2hhbmdlLm1vZGUsIHBNYWMtPmJ0Yy5idGNVYXBzZE9rICk7CisgICAgICAgaWYocEJ0RXZlbnQtPnVFdmVudFBhcmFtLmJ0QWNsTW9kZUNoYW5nZS5tb2RlID09IEJUX0FDTF9TTklGRikKKyAgICAgICB7CisgICAgICAgICAgIC8vQ2hlY2sgd2hldGhlciBTQ08gaXMgb24KKyAgICAgICAgICAgZm9yKGk9MDsgaSA8IEJUX01BWF9TQ09fU1VQUE9SVDsgaSsrKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBpZihwTWFjLT5idGMuYnRjU2NvSGFuZGxlc1tpXSAhPSBCVF9JTlZBTElEX0NPTk5fSEFORExFKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICB9CisgICAgICAgICAgIGlmKCBCVF9NQVhfU0NPX1NVUFBPUlQgPT0gaSApCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGlmKFZPU19UUlVFID09IHBNYWMtPmJ0Yy5mQTJEUFRyYWZTdG9wKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIHBNYWMtPmJ0Yy5idGNVYXBzZE9rID0gVk9TX1RSVUU7CisgICAgICAgICAgICAgICAgICAgcE1hYy0+YnRjLmZBMkRQVHJhZlN0b3AgPSBWT1NfRkFMU0U7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsICJCVF9FVkVOVF9NT0RFX0NIQU5HRUQgd2l0aCBNb2RlOiVkIFVBUFNELWFsbG93ZWQgZmxhZyBpcyBub3cgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICBwQnRFdmVudC0+dUV2ZW50UGFyYW0uYnRBY2xNb2RlQ2hhbmdlLm1vZGUscE1hYy0+YnRjLmJ0Y1VhcHNkT2sgKTsKKyAgICAgICAgICAgfQorICAgICAgIH0KKyAgICAgICBicmVhazsKKyAgIGNhc2UgQlRfRVZFTlRfQ1JFQVRFX1NZTkNfQ09OTkVDVElPTjoKKyAgICAgICB7CisgICAgICAgICAgIHBNYWMtPmJ0Yy5idGNVYXBzZE9rID0gVk9TX0ZBTFNFOworICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsICJCVF9FVkVOVF9DUkVBVEVfU1lOQ19DT05ORUNUSU9OICglZCkgaGFwcGVucywgVUFQU0QtYWxsb3dlZCBmbGFnICglZCkgY2hhbmdlIHRvIEZBTFNFIiwKKyAgICAgICAgICAgICAgICAgICBwQnRFdmVudC0+YnRFdmVudFR5cGUsIHBNYWMtPmJ0Yy5idGNVYXBzZE9rICk7CisgICAgICAgfQorICAgICAgIGJyZWFrOworICAgY2FzZSBCVF9FVkVOVF9TWU5DX0NPTk5FQ1RJT05fQ09NUExFVEU6CisgICAgICAgLy9NY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AgICB9CisgICAgICAgfQorICAgICAgIGVsc2UKKyAgICAgICB7CisgICAgICAgICAgICAvL0NoZWNrIHdoZXRoZXIgU0NPIGlzIG9uCisgICAgICAgICAgIGZvcihpPTA7IGkgPCBCVF9NQVhfU0NPX1NVUFBPUlQ7IGkrKykKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgaWYocE1hYy0+YnRjLmJ0Y1Njb0hhbmRsZXNbaV0gIT0gQlRfSU5WQUxJRF9DT05OX0hBTkRMRSkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICB9CisgICAgICAgICAgIC8qSWYgTm8gT3RoZXIgU2NvL0EyRFAgaXMgT04gcmVlbmFibGUgVUFQU0QqLworICAgICAgICAgICBpZiggKEJUX01BWF9TQ09fU1VQUE9SVCA9PSBpKSAgJiYgIXBNYWMtPmJ0Yy5mQTJEUFVwKSAgICAgICAgICAgCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHBNYWMtPmJ0Yy5idGNVYXBzZE9rID0gVk9TX1RSVUU7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJUU1lOQyBjb21wbGV0ZSBmYWlsZWQiKSk7CisgICAgICAgfQorICAgICAgIGJyZWFrOworICAgY2FzZSBCVF9FVkVOVF9BMkRQX1NUUkVBTV9TVEFSVDoKKyAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsICJCVF9FVkVOVF9BMkRQX1NUUkVBTV9TVEFSVCAoJWQpIGhhcHBlbnMsIFVBUFNELWFsbG93ZWQgZmxhZyAoJWQpIGNoYW5nZSB0byBGQUxTRSIsCisgICAgICAgICAgICAgICAgcEJ0RXZlbnQtPmJ0RXZlbnRUeXBlLCBwTWFjLT5idGMuYnRjVWFwc2RPayApOworICAgICAgIHBNYWMtPmJ0Yy5mQTJEUFRyYWZTdG9wID0gVk9TX0ZBTFNFOworICAgIC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kLT5jb2V4SW5kRGF0YVsyXSA+PiA4OworICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLCAiQ29leCBpbmRpY2F0aW9uIGluICVzKCksICIKKyAgICAgICAgICAgICAgICAgICAgInR5cGUgLSBTSVJfQ09FWF9JTkRfVFlQRV9ESVNBQkxFX0FHR1JFR0FUSU9OX0lOXzJwNCAiCisgICAgICAgICAgICAgICAgICAgICJmb3IgQlNTSUQgIk1BQ19BRERSRVNTX1NUUixfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocE1hYy0+YnRjLmJ0Y0Jzc2ZvcmRpc2FibGVhZ2dyKSk7CisgICAgICAgICB9CisgICAgIH0KKyAgICAgZWxzZSBpZiAocFNtZUNvZXhJbmQtPmNvZXhJbmRUeXBlID09IFNJUl9DT0VYX0lORF9UWVBFX0VOQUJMRV9BR0dSRUdBVElPTl9JTl8ycDQpCisgICAgIHsKKyAgICAgICAgIGlmIChwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLmRpc2FibGVBZ2dXaXRoQnRjKQorICAgICAgICAgeworICAgICAgICAgICAgIGNjbUNmZ1NldEludChwTWFjLCBXTklfQ0ZHX0RFTF9BTExfUlhfVFhfQkFfU0VTU0lPTlNfMl80X0dfQlRDLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLCBlQU5JX0JPT0xFQU5fRkFMU0UpOworICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICAgICJDb2V4IGluZGljYXRpb24gaW4gJXMoKSwgdHlwZSAtIFNJUl9DT0VYX0lORF9UWVBFX0VOQUJMRV9BR0dSRUdBVElPTl9JTl8ycDQiLAorICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICB9CisgICAgIH0KKyAgICAgZWxzZSBpZiAocFNtZUNvZXhJbmQtPmNvZXhJbmRUeXBlID09IFNJUl9DT0VYX0lORF9UWVBFX0RJU0FCTEVfVUFQU0QpCisgICAgIHsKKyAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCBGTCgiRElTQUJMRSBVQVBTRCBCVCBFdmVudCByZWNlaXZlZCIpKTsKKyAgICAgICAgIGlmIChWT1NfVElNRVJfU1RBVEVfUlVOTklORyA9PQorICAgICAgICAgICAgIHZvc190aW1lcl9nZXRDdXJyZW50U3RhdGUoJnBNYWMtPmJ0Yy5lbmFibGVVYXBzZFRpbWVyKSkgeworICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCBGTCgiU3RvcCBVYXBzZCBUaW1lciIpKTsKKyAgICAgICAgICAgICB2b3NfdGltZXJfc3RvcCgmcE1hYy0+YnRjLmVuYWJsZVVhcHNkVGltZXIpOworICAgICAgICAgfQorCisgICAgICAgICBpZiAoSVNfRFlOQU1JQ19XTU1fUFNfRU5BQkxFRCkgeworICAgICAgICAgICAgIGlmIChwTWFjLT5idGMuYnRjVWFwc2RPayA9PSBWT1NfVFJVRSkgeworICAgICAgICAgICAgICAgICBwTWFjLT5idGMuYnRjVWFwc2RPayA9IFZPU19GQUxTRTsKKyAgICAgICAgICAgICAgICAgc21lX1FvU1VwZGF0ZVVhcHNkQlRFdmVudChwTWFjKTsKKyAgICAgICAgICAgICB9CisgICAgICAgICB9CisKKyAgICAgICAgIGlmIChwTWFjLT5zbWUucEJ0Q29leFRETFNOb3RpZmljYXRpb24pCisgICAgICAgICB7CisgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsIEZMKCJidENvZXggbm90aWZpY2F0aW9uLCBEaXNhYmxlIFRETFMiKSk7CisgICAgICAgICAgICAgcE1hYy0+c21lLnBCdENvZXhURExTTm90aWZpY2F0aW9uKHBNYWMtPnBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfQ09FWF9JTkRfVFlQRV9URExTX0RJU0FCTEUpOworICAgICAgICAgfQorICAgICB9CisgICAgIGV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ZW1fY29weShidERpYWdFdmVudC5idEFkZHIsIHBCdEV2ZW50LT51RXZlbnRQYXJhbS5idEFjbENvbm5lY3Rpb24uYmRBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoYnREaWFnRXZlbnQuYnRBZGRyKSk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEJUX0VWRU5UX01PREVfQ0hBTkdFRDoKKyAgICAgICAgICAgICAgICBidERpYWdFdmVudC5jb25uSGFuZGxlID0gcEJ0RXZlbnQtPnVFdmVudFBhcmFtLmJ0QWNsTW9kZUNoYW5nZS5jb25uZWN0aW9uSGFuZGxlOworICAgICAgICAgICAgICAgIGJ0RGlhZ0V2ZW50Lm1vZGUgPSBwQnRFdmVudC0+dUV2ZW50UGFyYW0uYnRBY2xNb2RlQ2hhbmdlLm1vZGU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEJUX0VWRU5UX0RJU0NPTk5FQ1RJT05fQ09NUExFVEU6CisgICAgICAgICAgICAgICAgYnREaWFnRXZlbnQuY29ubkhhbmRsZSA9IHBCdEV2ZW50LT51RXZlbnRQYXJhbS5idEFjbE1vZGVDaGFuZ2UuY29ubmVjdGlvbkhhbmRsZTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgfQorICAgfQorICAgV0xBTl9WT1NfRElBR19FVkVOVF9SRVBPUlQoJmJ0RGlhZ0V2ZW50LCBFVkVOVF9XTEFOX0JUQyk7Cit9CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0RJQUdfU1VQUE9SVCAqLworI2VuZGlmIC8qIFdMQU5fTURNX0NPREVfUkVEVUNUSU9OX09QVCovCmRpZmYgLS1naXQgYS93bGFuL3ByaW1hL0NPUkUvU01FL3NyYy9jY20vY2NtQXBpLmMgYi93bGFuL3ByaW1hL0NPUk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Y3B1X3RvX2JlMzIoY2ZnSWQpIDsKKyAgICAqcGwrKyA9IHBhbF9jcHVfdG9fYmUzMihsZW5ndGgpIDsKKyAgICBpZiAodHlwZSA9PSBDQ01fSU5URUdFUl9UWVBFKQorICAgIHsKKyAgICAgICAgKnBsKysgPSBwYWxfY3B1X3RvX2JlMzIodmFsdWUpIDsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgdm9zX21lbV9jb3B5KCh2b2lkICopcGwsICh2b2lkICopcEJ1ZiwgbGVuZ3RoKTsKKyAgICAgICAgcGwgKz0gKENGR09CSl9BTElHTihsZW5ndGgpIC8gQ0ZHT0JKX0FMSUdOVE8pOworICAgIH0KKyAgICByZXR1cm4gcGwgOworfQorCisvKgorICogQ0NNX1NUUklOR19UWVBFICAgICAgICAgICAgICAgICAgICAgICBDQ01fSU5URUdFUl9UWVBFCisgKiB8PC0tLS0tLS0tICA0ICAgLS0tLS0+fCAgICAgICAgICAgICAgIHw8LS0tLS0tLS0gIDQgICAtLS0tLT58ICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAqICstLS0tLS0tLS0tKyAgICAgICAgICAgIDwtLSBtc2cgIC0tPiAgKy0tLS0tLS0tLS0rICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgKiB8dHlwZSAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgIHx0eXBlICAgICAgfCAgICAgICAgICAgCisgKiArLS0tLS0tLS0tLSsgICAgICAgICAgICAgICAgICAgICAgICAgICstLS0tLS0tLS0tKyAgICAgICAgICAgCisgKiB8bXNnTGVuPTI0IHwgICAgICAgICAgICAgICAgICAgICAgICAgIHxtc2dMZW49MTYgfCAgICAgICAgICAgCisgKiArLS0tLS0tLS0tLSstLS0tLS0tLS0tKyAgICAgICAgICAgICAgICstLS0tLS0tLS0tKy0tLS0tLS0tLS0rCisgKiB8IGNmZ0lkICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgIHwgY2ZnSWQgICAgICAgICAgICAgICB8ICAKKyAqICstLS0tLS0tLS0tLS0tLS0tLS0tLS0rICAgICAgICAgICAgICAgKy0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKKyAqIHwgbGVuZ3RoPTExICAgICAgICAgICB8ICAgICAgICAgICAgICAgfCBsZW5ndGg9NCAgICAgICAgICAgIHwgIAorICogKy0tLS0tLS0tLS0tLS0tLS0tLS0tLSsgICAgICAgICAgICAgICArLS0tLS0tLS0tLS0tLS0tLS0tLS0tKworICogfCAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICB8IHZhbHVlICAgICAgICAgICAgICAgfCAgCisgKiB8ICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICstLS0tLS0tLS0tLS0tLS0tLS0tLS0rICAKKyAqIHwgICAgICAgICAgICAgICAgICAgICB8CisgKiB8ICAgICAgICAgICAgICAgICstLS0tKworICogfCAgICAgICAgICAgICAgICB8Ly8vL3wgPC0gcGFkZGluZyB0byA0LWJ5dGUgYm91bmRhcnkKKyAqICstLS0tLS0tLS0tLS0tLS0tKy0tLS0rCisgKi8KK3N0YXRpYyBlSGFsU3RhdHVzIHNlbmRDZmcodHBBbmlTaXJHbG9iYWwgcE1hYywgdEhkZEhhbmRsZSBoSGRkLCB0Q2ZnUmVxICpyZXEsIHRBTklfQk9PTEVBTiBmUnNwKQoreworICAgIHRTaXJNYk1zZyAqbXNnOworICAgIGVIYWxTdGF0dXMgc3RhdHVzOworICAgIHRBTklfUzE2IG1zZ0xlbiA9ICh0QU5JX1UxNikoNCArICAgIC8qIDQgYnl0ZXMgZm9yIG1zZyBoZWFkZXIgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENGR09CSl9JRF9TSVpFICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENGR09CSl9MRU5fU0laRSArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDRkdPQkpfQUxJR04ocmVxLT5sZW5ndGgpKSA7C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b2JhbCBwTWFjLCB0SGRkSGFuZGxlIGhIZGQpCit7CisgICAgdENmZ1JlcSAqcmVxIDsKKworICAgIC8qIFNlbmQgdGhlIGhlYWQgcmVxICovCisgICAgcmVxID0gcE1hYy0+Y2NtLnJlcVEuaGVhZCA7CisgICAgaWYgKHJlcSkKKyAgICB7CisgICAgICAgIGlmIChyZXEtPnN0YXRlID09IGVDQ01fUkVRX1FVRVVFRCkKKyAgICAgICAgeworICAgICAgICAgICAgLyogU2VuZCBXTklfQ0ZHX1NFVF9SRVEgKi8KKyAgICAgICAgICAgIHJlcS0+c3RhdGUgPSBlQ0NNX1JFUV9TRU5UOworICAgICAgICAgICAgaWYgKHNlbmRDZmcocE1hYywgaEhkZCwgcmVxLCBlQU5JX0JPT0xFQU5fVFJVRSkgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCJzZW5kQ2ZnKCkgZmFpbGVkIikpOworICAgICAgICAgICAgICAgIHBhbFNwaW5Mb2NrVGFrZShoSGRkLCBwTWFjLT5jY20ubG9jayk7CisgICAgICAgICAgICAgICAgZGVsX3JlcShyZXEsICZwTWFjLT5jY20ucmVxUSkgOworICAgICAgICAgICAgICAgIHBhbFNwaW5Mb2NrR2l2ZShoSGRkLCBwTWFjLT5jY20ubG9jayk7CisgICAgICAgICAgICAgICAgaWYgKHJlcS0+Y2FsbGJhY2spCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICByZXEtPmNhbGxiYWNrKCh0SGFsSGFuZGxlKXBNYWMsIFdOSV9DRkdfT1RIRVJfRVJST1IpIDsKKyAgICAgICAgICAgICAgICB9CisKKyNpZmRlZiBDQ01fREVCVUcKKyAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywgRkwoImNjbUNvbXBsZXRlKCVwKSIpLCByZXEtPmRvbmUpOworI2VuZGlmCisgICAgICAgICAgICA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WQgPT0gMCkgJiYgKHBNYWMtPmNjbS5yZXFRLmhlYWQgPT0gcmVxKSkKKyAgICAgICAgeworICAgICAgICAgICAgLyogU2VuZCBXTklfQ0ZHX1NFVF9SRVEgKi8KKyAgICAgICAgICAgIHJlcS0+c3RhdGUgPSBlQ0NNX1JFUV9TRU5UOworICAgICAgICAgICAgcGFsU3BpbkxvY2tHaXZlKGhIZGQsIHBNYWMtPmNjbS5sb2NrKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IHNlbmRDZmcocE1hYywgaEhkZCwgcmVxLCBlQU5JX0JPT0xFQU5fVFJVRSkgOworICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBlSEFMX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgRkwoInNlbmRDZmcoKSBmYWlsZWQiKSk7CisgICAgICAgICAgICAgICAgcGFsU3BpbkxvY2tUYWtlKGhIZGQsIHBNYWMtPmNjbS5sb2NrKTsKKyAgICAgICAgICAgICAgICBkZWxfcmVxKHJlcSwgJnBNYWMtPmNjbS5yZXFRKTsKKyAgICAgICAgICAgICAgICBwYWxTcGluTG9ja0dpdmUoaEhkZCwgcE1hYy0+Y2NtLmxvY2spOworICAgICAgICAgICAgICAgIGZyZWVDZmdSZXEoaEhkZCwgcmVxKTsKKyAgICAgICAgICAgICAgICBicmVhayA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcGFsU3BpbkxvY2tUYWtlKGhIZGQsIHBNYWMtPmNjbS5sb2NrKTsKKyAgICAgICAgICAgICAgICBpZihyZXEgIT0gcE1hYy0+Y2NtLnJlcVEuaGVhZCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vV2Ugc2VuZCB0aGUgcmVxdWVzdCBhbmQgaXQgbXVzdCBiZSBkb25lIGFscmVhZHkKKyAgICAgICAg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X2NwdShtc2ctPmRhdGFbMF0pOworICAgIGNmZ0lkICAgPSBwYWxfYmUzMl90b19jcHUobXNnLT5kYXRhWzFdKTsKKworICAgIGlmIChwTWFjLT5jY20ucmVwbGF5LnN0YXJ0ZWQgJiYgY2ZnSWQgPT0gQ0ZHX1VQREFURV9NQUdJQ19EV09SRCkKKyAgICB7CisgICAgICAgIHBNYWMtPmNjbS5yZXBsYXkuaW5fcHJvZ3Jlc3MgPSAxIDsKKyAgICAgICAgcmV0dXJuIDsKKyAgICB9CisKKyAgICBpZiAocE1hYy0+Y2NtLnJlcGxheS5pbl9wcm9ncmVzcykKKyAgICB7CisgICAgICAgIC8qIHNhdmUgZXJyb3IgY29kZSAqLworICAgICAgICBpZiAoIUNDTV9JU19SRVNVTFRfU1VDQ0VTUyhyZXN1bHQpKQorICAgICAgICB7CisgICAgICAgICAgICBwTWFjLT5jY20ucmVwbGF5LnJlc3VsdCA9IHJlc3VsdCA7CisgICAgICAgIH0KKworICAgICAgICBpZiAoLS1wTWFjLT5jY20ucmVwbGF5Lm5yX3BhcmFtID09IDApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBNYWMtPmNjbS5yZXBsYXkuaW5fcHJvZ3Jlc3MgPSAwIDsKKworICAgICAgICAgICAgaWYgKHBNYWMtPmNjbS5yZXBsYXkuY2FsbGJhY2spCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcE1hYy0+Y2NtLnJlcGxheS5jYWxsYmFjayhoSGFsLCBwTWFjLT5jY20ucmVwbGF5LnJlc3VsdCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHBNYWMtPmNjbS5yZXBsYXkuc3RhcnRlZCA9IDAgOworCisgICAgICAgICAgICAvKiBXYWtlIHVwIHRoZSBzbGVlcGluZyBwcm9jZXNzICovCisjaWZkZWYgQ0NNX0RFQlVHCisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywgRkwoImNjbUNvbXBsZXRlKCVwKSIpLCBwTWFjLT5jY20ucmVwbGF5LmRvbmUpOworI2VuZGlmCisgICAgICAgICAgICBjY21Db21wbGV0ZShoSGRkLCBwTWFjLT5jY20ucmVwbGF5LmRvbmUpOworICAgICAgICAgICAgLy9MZXQgZ28gd2l0aCB0aGUgcmVzdCBvZiB0aGUgc2V0IENGR3Mgd2FpdGluZy4KKyAgICAgICAgICAgIHNlbmRRdWV1ZWRSZXFUb01hY1N3KHBNYWMsIGhIZGQpOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIC8qCisgICAgICAgICAqIFRyeSB0byBtYXRjaCB0aGlzIHJlc3BvbnNlIHdpdGggdGhlIHJlcXVlc3QuCisgICAgICAgICAqIFdoYXQgaWYgaSBjb3VsZCBub3QgZmluZCB0aGUgcmVxIGVudHJ5ID8/PworICAgICAgICAgKi8KKyAgICAgICAgcmVxID0gcE1hYy0+Y2NtLnJlcVEuaGVhZCA7CisgICAgICAgIGlmIChyZXEpCisgICAgICAgIHsKKworICAgICAgICAgICAgaWYgKHJlcS0+Y2ZnSWQgPT0gY2ZnSWQgJiYgcmVxLT5zdGF0ZSA9PSBlQ0NNX1JFUV9TRU5UKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBhbFNwaW5Mb2NrVGFrZShoSGRkLCBwTWFjLT5jY20ubG9jayk7CisgICAgICAgICAgICAgICAgZGVsX3JlcShyZXEsICZwTWFjLT5jY20ucmVxUSk7CisgICAgICAgICAgICAgICAgcGFsU3BpbkxvY2tHaXZlKGhIZGQsIHBNYWMtPmNjbS5sb2NrKTsKKyAgICAgICAgICAgICAgICByZXEtPnN0YXRlID0gZUNDTV9SRVFfRE9ORSA7CisKKyAgICAgICAgICAgICAgICBpZiAocmVzdWx0ID09IFdOSV9DRkdfTkVFRF9SRVNUQVJUIHx8CisgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9PSBXTklfQ0ZHX05FRURfUkVMT0FEKQorICAgICAgICAgICAgICAgIHsKKyNpZmRlZiBDQ01fREVCVUcKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csIEZMKCJuZWVkIHJlc3RhcnQvcmVsb2FkLCBjZmdJZD0lZCIpLCByZXEtPmNmZ0lkKSA7CisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgLy9wdXJnZVJlcVEoaEhhbCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLyogaW52b2tlIGNhbGxiYWNrICovCisgICAgICAgICAgICAgICAgaWYgKHJlcS0+Y2FsbGJhY2spCisgICAgICAgICAgICAgICAgeworI2lmZGVmIENDTV9ERUJVRworICAgICAgICAgICAgICAgICAgICByZXEtPmNhbGxiYWNrKGhIYWwsIGNmZ0lkKSA7CisjZWxzZQorICAgICAgICAgICAgICAgICAgICByZXEtPmNhbGxiYWNrKGhIYWwsIHJlc3VsdCkgOworI2VuZGlmCisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLyogV2FrZSB1cCB0aGUgc2xlZXBpbmcgcHJvY2VzcyAqLworI2lmZGVmIENDTV9ERUJVRworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLCBGTCgiY2ZnSWQ9JWxkLCBjYWxsaW5nIGNjbUNvbXBsZXRlKCVwKSIpLCBjZmdJZCwgcmVxLT5kb25lKTsKKyNlbmRpZgorICAgICAgICAgICAgICAgIGNjbUNvbXBsZXRlKGhIZGQsIHJlcS0+ZG9uZSk7CisKKyAgICAgICAgICAgICAgICAvKiBtb3ZlIHRoZSBjb21wbGV0ZWQgcmVxIGZyb20gcmVxUSB0byBjb21wW10gKi8KKyAgICAgICAgICAgICAgICBpZiAocmVxLT50b0JlU2F2ZWQgJiYgKENDTV9JU19SRVNVTFRfU1VDQ0VTUyhyZXN1bHQpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChjZmdJZCA8IENGR19QQVJBTV9NQVhfTlVNKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG9sZCA9IHBNYWMtPmNjbS5jb21wW2NmZ0lkXSkgIT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmVlQ2ZnUmVxKGhIZGQsIG9sZCkgOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+Y2NtLmNvbXBbY2ZnSWRdID0gcmVxIDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBmcmVlQ2ZnUmVxKGhIZGQsIHJlcSkgOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzZW5kUXVldWVkUmVxVG9NYWNTdyhwTWFjLCBoSGRkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR1csIEZMKCJjYW4gbm90IG1hdGNoIFJTUCB3aXRoIFJFUSwgcnNwY2ZnaWQ9JWQgcmVzdWx0PSVkIHJlcWNmZ2lkPSVkIHJlcXN0YXRlPSVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAoaW50KWNmZ0lkLCAoaW50KXJlc3VsdCwgcmVxLT5jZmdJZCwgcmVxLT5zdGF0ZSk7CisKKyNpZmRlZiBDQ01fREVCVUcKKyAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywgRkwoImNjbUNvbXBsZXRlKCVwKSIpLCByZXEtPmRvbmUpOworI2VuZGlmCisgICAgICAgICAgICB9CisKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiA7Cit9CisKK3ZvaWQgY2NtU3RhcnQodEhhbEhhbmRsZSBoSGFsKQoreworICAgIHRwQW5pU2lyR2xvY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7CisgICAgfQorCisgICAgcGFsU3BpbkxvY2tUYWtlKGhIZGQsIHBNYWMtPmNjbS5sb2NrKTsKKworICAgIHBNYWMtPmNjbS5yZXBsYXkuc3RhcnRlZCAgICA9IDEgOworICAgIHBNYWMtPmNjbS5yZXBsYXkubnJfcGFyYW0gICA9IDAgOworCisgICAgcGFsU3BpbkxvY2tHaXZlKGhIZGQsIHBNYWMtPmNjbS5sb2NrKTsKKworICAgIC8qIENhbGN1bGF0ZSBtZXNzYWdlIGxlbmd0aCAqLworICAgIGZvciAoaSA9IDAgOyBpIDwgQ0ZHX1BBUkFNX01BWF9OVU0gOyArK2kpCisgICAgeworICAgICAgICBpZiAoKHJlcSA9IHBNYWMtPmNjbS5jb21wW2ldKSAhPSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgICBtc2dMZW4gKz0gKHRBTklfUzE2KShDRkdPQkpfSURfU0laRSArIENGR09CSl9MRU5fU0laRSArIENGR09CSl9BTElHTihyZXEtPmxlbmd0aCkpIDsKKyAgICAgICAgICAgIHBNYWMtPmNjbS5yZXBsYXkubnJfcGFyYW0gKz0gMSA7CisjaWZkZWYgQ0NNX0RFQlVHCisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywgRkwoImNmZ0lkPSVkIiksIHJlcS0+Y2ZnSWQpOworI2VuZGlmCisgICAgICAgIH0KKyAgICB9CisKKyAgICBpZiAocE1hYy0+Y2NtLnJlcGxheS5ucl9wYXJhbSA9PSAwKQorICAgIHsKKyAgICAgICAgaWYgKGNhbGxiYWNrKQorICAgICAgICB7CisgICAgICAgICAgICBjYWxsYmFjaygodEhhbEhhbmRsZSlwTWFjLCBXTklfQ0ZHX1NVQ0NFU1MpIDsKKyAgICAgICAgfQorICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTIDsKKyAgICAgICAgZ290byBlbmQgOworICAgIH0KKworICAgIHBNYWMtPmNjbS5yZXBsYXkuaW5fcHJvZ3Jlc3MgPSAwIDsKKy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ZWQgPSAwIDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIHdlIGhhdmUgc2VudCB1cGRhdGUgbWVzc2FnZSB0byBNQUMgU1cgKi8KKyAgICAgICAgICAgIHZvaWQgKnNlbSA7CisKKyAgICAgICAgICAgIHN0YXR1cyA9IHBhbE11dGV4QWxsb2NMb2NrZWQoIGhIZGQsICZzZW0gKSA7CisgICAgICAgICAgICBpZiAoc3RhdHVzICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJtdXRleCBhbGxvYyBmYWlsZWQiKSk7CisgICAgICAgICAgICAgICAgcE1hYy0+Y2NtLnJlcGxheS5zdGFydGVkID0gMCA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcE1hYy0+Y2NtLnJlcGxheS5kb25lID0gc2VtIDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHBhbF9sb2NhbF9iaF9lbmFibGUoKSA7CisKKyAgICAvKiBXYWl0aW5nIGhlcmUgLi4uICovCisgICAgaWYgKHN0YXR1cyA9PSBlSEFMX1NUQVRVU19TVUNDRVNTICYmIHBNYWMtPmNjbS5yZXBsYXkuZG9uZSkKKyAgICB7CisjaWZkZWYgQ0NNX0RFQlVHCisgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLCBGTCgiY2NtV2FpdEZvckNvbXBsZXRpb24oJXApIiksIHBNYWMtPmNjbS5yZXBsYXkuZG9uZSk7CisjZW5kaWYKKyAgICAgICAgY2NtV2FpdEZvckNvbXBsZXRpb24oaEhkZCwgcE1hYy0+Y2NtLnJlcGxheS5kb25lKTsKKworI2lmZGVmIENDTV9ERUJVRworICAgICAgICBzbXNMb2cocE1hYywgTE9HVywgRkwoImZyZWUoJXApIiksIHBN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FdBUkUuCisgKi8KKworLyoKKyAqIFRoaXMgZmlsZSB3YXMgb3JpZ2luYWxseSBkaXN0cmlidXRlZCBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKworCisKKy8qKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICogCisgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqICAKKyAgCisgIAorICAgIFxmaWxlIGNzckFwaVJvYW0uYworICAKKyAgICBJbXBsZW1lbnRhdGlvbiBmb3IgdGhlIENvbW1vbiBSb2FtaW5nIGludGVyZmFjZXMuCisgIAorICAgIENvcHlyaWdodCAoQykgMjAwOCBRdWFsY29tbSwgSW5jb3Jwb3JhdGVkCisgIAorIAorICAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKyAgVGhpcyBzZWN0aW9uIGNvbnRhaW5zIGNvbW1lbnRzIGRlc2NyaWJpbmcgY2hhbmdlcyBtYWRlIHRvIHRoZSBtb2R1bGUuCisgIE5vdGljZSB0aGF0IGNoYW5nZXMgYXJlIGxpc3RlZCBpbiByZXZlcnNlIGNocm9ub2xvZ2ljYWwgb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UzMiBzZXNzaW9uSWQsIAorICAgICAgICAgICB0U2lyTWFjQWRkciBwZWVyTWFjQWRkciwgdEFOSV9VOCBudW1LZXlzLCB0QW5pRWRUeXBlIGVkVHlwZSwgCisgICAgICAgICAgIHRBTklfQk9PTEVBTiBmVW5pY2FzdCwgdEFuaUtleURpcmVjdGlvbiBhbmlLZXlEaXJlY3Rpb24sCisgICAgICAgICAgIHRBTklfVTgga2V5SWQsIHRBTklfVTgga2V5TGVuZ3RoLCB0QU5JX1U4ICpwS2V5LCB0QU5JX1U4IHBhZVJvbGUsIAorICAgICAgICAgICB0QU5JX1U4ICpwS2V5UnNjICk7CitzdGF0aWMgZUhhbFN0YXR1cyBjc3JSb2FtSXNzdWVSZWFzc29jaWF0ZSggdHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMzIgc2Vzc2lvbklkLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJCc3NEZXNjcmlwdGlvbiAqcFNpckJzc0Rlc2MsIHREb3QxMWZCZWFjb25JRXMgKnBJZXMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdENzclJvYW1Qcm9maWxlICpwUHJvZmlsZSApOwordm9pZCBjc3JSb2FtU3RhdGlzdGljc1RpbWVySGFuZGxlcih2b2lkICpwdik7Cit2b2lkIGNzclJvYW1TdGF0c0dsb2JhbENsYXNzRFRpbWVySGFuZGxlcih2b2lkICpwdik7CitzdGF0aWMgdm9pZCBjc3JSb2FtTGlua1VwKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRDc3JCc3NpZCBic3NpZCk7CitWT1NfU1RBVFVTIGNzclJvYW1WY2NUcmlnZ2VyUnNzaUluZENhbGxiYWNrKHRIYWxIYW5kbGUgaEhhbCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAgcnNzaU5vdGlmaWNhdGlvbiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg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yAgICAgICAgICAgIC8vc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgfQorICAgICAgICBzbXNMb2coIHBNYWMsIExPRzEsIEZMKCIgY291bnRyeSBDb2RlIGZyb20gbnZSYW0gJS4ycyIpLCBwTWFjLT5zY2FuLmNvdW50cnlDb2RlRGVmYXVsdCApOworCisgICAgICAgIGlmICghKCcwJyA9PSBwTWFjLT5zY2FuLmNvdW50cnlDb2RlRGVmYXVsdFswXSAmJgorICAgICAgICAgICAgJzAnID09IHBNYWMtPnNjYW4uY291bnRyeUNvZGVEZWZhdWx0WzFdKSkKKyAgICAgICAgeworICAgICAgICAgICAgY3NyR2V0UmVndWxhdG9yeURvbWFpbkZvckNvdW50cnkocE1hYywgcE1hYy0+c2Nhbi5jb3VudHJ5Q29kZURlZmF1bHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcmVnSWQsIENPVU5UUllfTlYpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcmVnSWQgPSBSRUdET01BSU5fV09STEQ7CisgICAgICAgIH0KKyAgICAgICAgV0RBX1NldFJlZ0RvbWFpbihwTWFjLCByZWdJZCwgZVNJUl9UUlVFKTsKKyAgICAgICAgcE1hYy0+c2Nhbi5kb21haW5JZERlZmF1bHQgPSByZWdJZDsKKyAgICAgICAgcE1hYy0+c2Nhbi5kb21haW5JZEN1cnJlbnQgPSBwTWFjLT5zY2FuLmRvbWFpbklkRGVmYXVsdDsKKyAgICAgICAgdm9zX21lbV9jb3B5KHBNYWMtPnNjYW4uY291bnRyeUNvZGVDdXJyZW50LCBwTWFjLT5zY2FuLmNvdW50cnlDb2RlRGVmYXVsdCwKKyAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfQ09VTlRSWV9DT0RFX0xFTik7CisgICAgICAgIHN0YXR1cyA9IGNzckluaXRHZXRDaGFubmVscyggcE1hYyApOworI2VuZGl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GVEZWZhdWx0LAorICAgICAgICAgICAgICAgICBXTklfQ0ZHX0NPVU5UUllfQ09ERV9MRU4pOworICAgIHN0YXR1cyA9IGNzckluaXRHZXRDaGFubmVscyggcE1hYyApOworICAgIGNzckNsZWFyVm90ZXNGb3JDb3VudHJ5SW5mbyhwTWFjKTsKKworICAgIHJldHVybiBzdGF0dXM7Cit9CisKKyNpZmRlZiBDT05GSUdfRU5BQkxFX0xJTlVYX1JFRworZUhhbFN0YXR1cyBjc3JJbml0Q2hhbm5lbHNGb3JDQyh0cEFuaVNpckdsb2JhbCBwTWFjLCBkcml2ZXJfbG9hZF90eXBlIGluaXQpCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIHZfUkVHRE9NQUlOX3QgcmVnSWQgPSBSRUdET01BSU5fV09STEQ7CisgICAgdEFOSV9VOCBjY1tXTklfQ0ZHX0NPVU5UUllfQ09ERV9MRU5dOworCisgICAgLyogSW4gY2FzZSBvZiBkcml2ZXIgbG9hZCA7IGRyaXZlciBuZWVkIHRvIGdldCBjaGFubmVsCisgICAgICogbGlzdCB3aXRoIGRlZmF1bHQgQ291bnRyeWNvZGUuCisgICAgICogSW4gY2FzZSBvZiBTU1I7IGRyaXZlciBuZWVkIHRvIGdldCBjaGFubmVsIGxpc3QKKyAgICAgKiB3aXRoIG9sZCBjb3VudHJ5IGNvZGUuIDAgaXMgZm9yIGluaXQgYW5kCisgICAgICogMSBpcyBmb3IgcmVpbml0CisgICAgICovCisgICAgc3dpdGNoIChpbml0KQorICAgIHsKKyAgICAgICAgY2FzZSBJTklUOgorICAgICAgICAgICAgdm9zX21lbV9jb3B5KGNjLCBwTWFjLT5zY2FuLmNvdW50cnlDb2RlRGVmYXVsdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX0NPVU5UUllfQ09ERV9MRU4pOworICAgICAgICAgICAgaWYgKCEoJzAnID09IGNjWzBdICYmCisgICAgICAgICAgICAgICAgICAgJzAnID09IGNjWzFdKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjc3JHZXRSZWd1bGF0b3J5RG9tYWluRm9yQ291bnRyeShwTWFjLCBjYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnJlZ0lkLCBDT1VOVFJZX05WKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gc3RhdHVzOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcE1hYy0+c2Nhbi5kb21haW5JZERlZmF1bHQgPSByZWdJZDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFJFSU5JVDoKKyAgICAgICAgICAgIHZvc19nZXRDdXJyZW50Q291bnRyeUNvZGUoJmNjWzBdKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IGNzckdldFJlZ3VsYXRvcnlEb21haW5Gb3JDb3VudHJ5KHBNYWMsCisgICAgICAgICAgICAgICAgICAgICBjYywgJnJlZ0lkLCBDT1VOVFJZX1FVRVJZKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgIH0KKyAgICBXREFfU2V0UmVnRG9tYWluKHBNYWMsIHJlZ0lkLCBlU0lSX1RSVUUpOworICAgIHBNYWMtPnNjYW4uZG9tYWluSWRDdXJyZW50ID0gcmVnSWQ7CisgICAgdm9zX21lbV9jb3B5KHBNYWMtPnNjYW4uY291bnRyeUNvZGVDdXJyZW50LCBjYywKKyAgICAgICAgICAgICAgICAgV05JX0NGR19DT1VOVFJZX0NPREVfTEVOKTsKKyAgICBzdGF0dXMgPSBjc3JJbml0R2V0Q2hhbm5lbHMoIHBNYWMgKTsKKworICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgIEZMKCJDdXJyZW50IENvdW50cnkg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uLmZFbmFibGVERlNDaG5sU2Nhbik7CisKKyAgICBmb3IgKGkgPSAwOyBpIDwgbnVtQ2hhbjsgaSsrKQorICAgIHsKKyAgICAgICAgY2hhbm5lbF9zdGF0ZSA9CisgICAgICAgICAgICAgICB2b3NfbnZfZ2V0Q2hhbm5lbEVuYWJsZWRTdGF0ZShwTWFjLT5yb2FtLnZhbGlkQ2hhbm5lbExpc3RbaV0pOworCisgICAgICAgIGlmKChwTWFjLT5zY2FuLmZFbmFibGVERlNDaG5sU2NhbiA9PSBERlNfQ0hOTF9TQ0FOX0RJU0FCTEVEKQorICAgICAgICAgICAmJiAoY2hhbm5lbF9zdGF0ZSA9PSBOVl9DSEFOTkVMX0RGUykpCisgICAgICAgIHsKKyAgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKyAgICAgICAgcENoYW5MaXN0LT5jaGFuUGFyYW1bbnVtX2NoYW5uZWxdLmNoYW5JZCA9CisgICAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0udmFsaWRDaGFubmVsTGlzdFtpXTsKKyAgICAgICAgcENoYW5MaXN0LT5jaGFuUGFyYW1bbnVtX2NoYW5uZWxdLnB3ciA9CisgICAgICAgICAgY2ZnR2V0UmVndWxhdG9yeU1heFRyYW5zbWl0UG93ZXIocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Nhbi0+ZGVmYXVsdFBvd2VyVGFibGVbaV0uY2hhbklkKTsKKyAgICAgICAgaWYgKCFwQ2hhbkxpc3QtPmNoYW5QYXJhbVtudW1fY2hhbm5lbF0ucHdyKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIlBvd2VyIGxldmVsIGlzIHplcm8gZm9yIGNoYW5uZWwgJWQgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAic2V0dGluZyB0byBkZWZhdWx0ICVkIiksCisgICAgICAgICAgICAgICAgICAgIC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gIGZvcihqPTA7IGo8IGNmZ251bUNoYW5uZWxzOyBqKyspCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAoQ1NSX0lTX0NIQU5ORUxfREZTKGNmZ0NoYW5uZWxMaXN0W2pdKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgIChwTWFjLT5yb2FtLnZhbGlkQ2hhbm5lbExpc3RbaV0gPT0gY2ZnQ2hhbm5lbExpc3Rbal0pKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwQ2hhbkxpc3QtPmNoYW5QYXJhbVtudW1fY2hhbm5lbF0uZGZzU2V0ID0gVk9TX0ZBTFNFOworICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXMgTWFya2VkIERGUyBjaCAlZCBhcyBhY3RpdmVcbiIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZmdDaGFubmVsTGlzdFtqXSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlcyBjZmdDaGFubmVsTGlzdCBpcyBOVUxMIFxuIiwgX19mdW5jX18pOworICAgICAgICAgfQorCisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgIiVzIFN1cHBvcnRlZCBDaGFubmVsOiAlZCBkZnNTZXQgJWQgcHdyOiAlZCBcbiIsIF9fZn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m9hbWluZ1RpbWVySW5mby5zZXNzaW9uSWQgPSBDU1JfU0VTU0lPTl9JRF9JTlZBTElEOworICAgICAgICB9CisgICAgICAgIHBNYWMtPnJvYW0uV2FpdEZvcktleVRpbWVySW5mby5wTWFjID0gcE1hYzsKKyAgICAgICAgcE1hYy0+cm9hbS5XYWl0Rm9yS2V5VGltZXJJbmZvLnNlc3Npb25JZCA9IENTUl9TRVNTSU9OX0lEX0lOVkFMSUQ7CisgICAgICAgIHN0YXR1cyA9IHZvc190aW1lcl9pbml0KCZwTWFjLT5yb2FtLmhUaW1lcldhaXRGb3JLZXksIFZPU19USU1FUl9UWVBFX1NXLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JSb2FtV2FpdEZvcktleVRpbWVPdXRIYW5kbGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcE1hYy0+cm9hbS5XYWl0Rm9yS2V5VGltZXJJbmZvKTsKKyAgICAgIGlmICghSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICB7CisgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiY2Fubm90IGFsbG9jYXRlIG1lbW9yeSBmb3IgV2FpdEZvcktleSB0aW1lIG91dCB0aW1lciIpKTsKKyAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBzdGF0dXMgPSB2b3NfdGltZXJfaW5pdCgmcE1hYy0+cm9hbS50bFN0YXRzUmVxSW5mby5oVGxTdGF0c1RpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RJTUVSX1RZUEVfU1csIGNzclJvYW1UbFN0YXRzVGltZXJIYW5kbGVyLCBwTWFjKTsKKyAgICAgIGlmICghSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICB7CisgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoImNhbm5vdCBhbGxvY2F0ZSBtZW1vcnkgZm9yIHN1bW1hcnkgU3RhdGl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gTE9HRSwgRkwoIiAgc2Vzc2lvbiAlZCBub3QgZm91bmQgIiksIHNlc3Npb25JZCk7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIH0KKyAgICAKKyAgICBpZihwUHJvZmlsZSkKKyAgICB7CisgICAgICAgIGlmKHBTZXNzaW9uLT5wQ29ubmVjdEJzc0Rlc2MpCisgICAgICAgIHsKKyAgICAgICAgICAgIGRvCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2l6ZSA9IHBTZXNzaW9uLT5wQ29ubmVjdEJzc0Rlc2MtPmxlbmd0aCArIHNpemVvZihwU2Vzc2lvbi0+cENvbm5lY3RCc3NEZXNjLT5sZW5ndGgpOworICAgICAgICAgICAgICAgIGlmKHNpemUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwUHJvZmlsZS0+cEJzc0Rlc2MgPSB2b3NfbWVtX21hbGxvYyhzaXplKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCBOVUxMICE9IHBQcm9maWxlLT5wQnNzRGVzYyApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwUHJvZmlsZS0+cEJzc0Rlc2MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPnBDb25uZWN0QnNzRGVzYywgc2l6ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwUHJvZmlsZS0+cEJzc0Rlc2MgPSBOVUxMOworICAgICAgICAgICAgICAgIH0KKyAgICA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URJRC5tZGllUHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBQcm9maWxlLT5NRElELm1kaWVQcmVzZW50ID0gMTsKKyAgICAgICAgICAgICAgICAgICAgcFByb2ZpbGUtPk1ESUQubW9iaWxpdHlEb21haW4gPSBwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS5NRElELm1vYmlsaXR5RG9tYWluOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwUHJvZmlsZS0+TURJRC5tZGllUHJlc2VudCA9IDA7CisgICAgICAgICAgICAgICAgICAgIHBQcm9maWxlLT5NRElELm1vYmlsaXR5RG9tYWluID0gMDsKKyAgICAgICAgICAgICAgICB9CisjZW5kaWYKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICAgICAgICAgICAgICAgcFByb2ZpbGUtPmlzRVNFQXNzb2MgPSBwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS5pc0VTRUFzc29jOworICAgICAgICAgICAgICAgIGlmIChjc3JJc0F1dGhUeXBlRVNFKHBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlLkF1dGhUeXBlKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSAocFByb2ZpbGUtPmVzZUNja21JbmZvLmtyaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS5lc2VDY2ttSW5mby5rcmssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1NSX0tSS19LRVlfTEVOKTsKKyAgICAgICAgICAgICAgICAgICAgcFByb2ZpbGUtPmVzZUNja21JbmZvLnJlYXNzb2NfcmVxX251bT0KKyAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlLmVzZUNja21JbmZvLnJlYXNzb2NfcmVxX251bTsKKyAgICAgICAgICAgICAgICAgICAgcFByb2ZpbGUtPmVzZUNja21JbmZvLmtya19wbHVtYmVkID0KKyAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlLmVzZUNja21JbmZvLmtya19wbHVtYmVkOworICAgICAgICAgICAgICAgIH0KKyNlbmRpZgorICAgICAgICAgICAgfXdoaWxlKDApOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIHJldHVybiAoc3RhdHVzKTsKK30KKworZUhhbFN0YXR1cyBjc3JSb2FtR2V0Q29ubmVjdFByb2ZpbGUodHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMzIgc2Vzc2lvbklkLCB0Q3NyUm9hbUNvbm5lY3RlZFByb2ZpbGUgKnBQcm9maWxlKQoreworICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKworICAgIGlmKChjc3JJc0Nvbm5TdGF0ZUNvbm5lY3RlZChwTWFjLCBzZXNzaW9uSWQpKSB8fAorICAgICAgIChjc3JJc0Nvbm5TdGF0ZUlic3MocE1hYywgc2Vzc2lvbklkKSkpCisgICAgeworICAgICAgICBpZihwUHJvZmlsZSkKKyAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbUNvcHlDb25uZWN0UHJvZmlsZShwTWFjLCBzZXNzaW9uSWQsIHBQcm9maWxlKTsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gKHN0YXR1cyk7Cit9CisKK2VIYWxTdGF0dXMgY3NyUm9hbUZyZWVDb25uZWN0UHJvZmlsZSh0cEFuaVNpckdsb2JhbCBwTWFjLCB0Q3NyUm9hbUNvbm5lY3RlZFByb2ZpbGUgKnBQcm9maWxlKQoreworICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyA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yAgICAgICAgeworICAgICAgICBjYXNlIGVTbWVDb21tYW5kU2NhbjoKKyAgICAgICAgICAgIC8vIFdlIG5lZWQgdG8gaW5mb3JtIHRoZSByZXF1ZXN0ZXIgYmVmb3JlIGRyb3BwaW5nIHRoZSBzY2FuIGNvbW1hbmQKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HVywgIiVzOiBEcm9wIHNjYW4gcmVhc29uICVkIGNhbGxiYWNrICVwIiwKKyAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHBDb21tYW5kLT51LnNjYW5DbWQucmVhc29uLAorICAgICAgICAgICAgICAgICAgICBwQ29tbWFuZC0+dS5zY2FuQ21kLmNhbGxiYWNrKTsKKyAgICAgICAgICAgIGlmIChOVUxMICE9IHBDb21tYW5kLT51LnNjYW5DbWQuY2FsbGJhY2spCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dXLCAiJXMgY2FsbGJhY2sgc2NhbiByZXF1ZXN0ZXIiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgY3NyU2NhbkNhbGxDYWxsYmFjayhwTWFjLCBwQ29tbWFuZCwgZUNTUl9TQ0FOX0FCT1JUKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGNzclJlbGVhc2VDb21tYW5kU2NhbiggcE1hYywgcENvbW1hbmQgKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVTbWVDb21tYW5kUm9hbToKKyAgICAgICAgICAgIGNzclJlbGVhc2VDb21tYW5kUm9hbSggcE1hYywgcENvbW1hbmQgKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRXbVN0YXR1c0NoYW5nZToKKyAgICAgICAgICAgIGNzclJlbGVhc2VDb21tYW5kV21TdGF0dXNDaGFuZ2UoIHBNYWMsIHBDb21tYW5kICk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjY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Zm9yIChpID0gMDsgaSA8IGluTnVtQ2hhbm5lbHM7IGkrKykKKyAgICAgICAgeworICAgICAgICAgICAgLyogQWRkIDVHIE5vbi1ERlMgY2hhbm5lbCAqLworICAgICAgICAgICAgaWYgKENTUl9JU19DSEFOTkVMXzVHSFooaW5QdHJbaV0pICYmCisgICAgICAgICAgICAgICBjc3JSb2FtSXNDaGFubmVsVmFsaWQocE1hYywgaW5QdHJbaV0pICYmCisgICAgICAgICAgICAgICAhQ1NSX0lTX0NIQU5ORUxfREZTKGluUHRyW2ldKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIENoYW5uZWxMaXN0W291dE51bUNoYW5uZWxzKytdID0gaW5QdHJbaV07CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgY3NyRmx1c2hDZmdCZ1NjYW5Sb2FtQ2hhbm5lbExpc3QocE1hYyk7CisgICAgICAgIGNzckNyZWF0ZUJnU2NhblJvYW1DaGFubmVsTGlzdChwTWFjLCBDaGFubmVsTGlzdCwgb3V0TnVtQ2hhbm5lbHMpOworICAgIH0KKyAgICBlbHNlIGlmIChlQ1NSX0JBTkRfQUxMID09IGVCYW5kKQorICAgIHsKKyAgICAgICAgZm9yIChpID0gMDsgaSA8IGluTnVtQ2hhbm5lbHM7IGkrKykKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKGNzclJvYW1Jc0NoYW5uZWxWYWxpZChwTWFjLCBpblB0cltpXSkgJiYKKyAgICAgICAgICAgICAgICFDU1JfSVNfQ0hBTk5FTF9ERlMoaW5QdHJbaV0pKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgQ2hhbm5lbExpc3Rbb3V0TnVtQ2hhbm5lbHMrK10gPSBpblB0cltpXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBjc3JGbHVzaENmZ0JnU2NhblJvYW1DaGFubmVsTGlzdChwTWFjKTsKKyAgICAgICAgY3NyQ3JlYXRlQmdTY2FuUm9hbUNoYW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RwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcENoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggbnVtQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZUNzckJhbmQgZUJhbmQpCit7CisgICAgZUhhbFN0YXR1cyAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIHRwQ3NyTmVpZ2hib3JSb2FtQ29udHJvbEluZm8gcE5laWdoYm9yUm9hbUluZm8gPSAmcE1hYy0+cm9hbS5uZWlnaGJvclJvYW1JbmZvOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgb3V0TnVtQ2hhbm5lbHMgPSAwOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgaW5OdW1DaGFubmVscyA9IG51bUNoYW5uZWxzOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgKmluUHRyID0gcENoYW5uZWxMaXN0OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgaSA9IDA7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgICBDaGFubmVsTGlzdFtXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU5dID0gezB9OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgdG1wQ2hhbm5lbExpc3RbV05JX0NGR19WQUxJRF9DSEFOTkVMX0xJU1RfTEVOXSA9IHswfTsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgIG1lcmdlZE91dHB1dE51bU9mQ2hhbm5lbHMgPSAwOworICAgIHRwQ3NyQ2hhbm5lbEluZm8gICAgICAgICAgICAgY3VyckNoYW5uZWxMaXN0SW5mbyA9ICZwTmVpZ2hib3JSb2FtSW5m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X0NIQU5ORUxfMjRHSFooaW5QdHJbaV0pICYmIGNzclJvYW1Jc0NoYW5uZWxWYWxpZChwTWFjLCBpblB0cltpXSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgQ2hhbm5lbExpc3Rbb3V0TnVtQ2hhbm5lbHMrK10gPSBpblB0cltpXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmIChlQ1NSX0JBTkRfNUcgPT0gZUJhbmQpCisgICAgeworICAgICAgICBmb3IgKGkgPSAwOyBpIDwgaW5OdW1DaGFubmVsczsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBBZGQgNUcgTm9uLURGUyBjaGFubmVsICovCisgICAgICAgICAgICBpZiAoQ1NSX0lTX0NIQU5ORUxfNUdIWihpblB0cltpXSkgJiYKKyAgICAgICAgICAgICAgIGNzclJvYW1Jc0NoYW5uZWxWYWxpZChwTWFjLCBpblB0cltpXSkgJiYKKyAgICAgICAgICAgICAgICFDU1JfSVNfQ0hBTk5FTF9ERlMoaW5QdHJbaV0pKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgQ2hhbm5lbExpc3Rbb3V0TnVtQ2hhbm5lbHMrK10gPSBpblB0cltpXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmIChlQ1NSX0JBTkRfQUxMID09IGVCYW5kKQorICAgIHsKKyAgICAgICAgZm9yIChpID0gMDsgaSA8IGluTnVtQ2hhbm5lbHM7IGkrKykKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKGNzclJvYW1Jc0NoYW5uZWxWYWxpZChwTWFjLCBpblB0cltpXSkgJiYKKyAgICAgICAgICAgICAgICFDU1JfSVNfQ0hBTk5FTF9ERlMoaW5QdHJbaV0pKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgQ2hhbm5lbExpc3Rbb3V0TnVtQ2hhbm5lbHMrK10gPSBpblB0cltpXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgIkludmFsaWQgYmFuZCwgTm8gb3BlcmF0aW9uIGNhcnJpZWQgb3V0IChCYW5kICVkKSIsIGVCYW5kKTsKKyAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0lOVkFMSURfUEFSQU1FVEVSOworICAgIH0KKworICAgIC8qIGlmIHJvYW1pbmcgd2l0aGluIGJhbmQgaXMgZW5hYmxlZCwgdGhlbiBzZWxlY3Qgb25seSB0aGUKKyAgICAgICAgICAgaW4gYmFuZCBjaGFubmVscyAuCisgICAgICAgICAgIFRoaXMgaXMgcmVxdWlyZWQgb25seSBpZiB0aGUgYmFuZCBjYXBhYmlsaXR5IGlzIHNldCB0byBBTEwsCisgICAgICAgICAgIEUuZy4sIGlmIGJhbmQgY2FwYWJpbGl0eSBpcyBvbmx5IDIuNEcgdGhlbiBhbGwgdGhlIGNoYW5uZWxzIGluIHRoZQorICAgICAgICAgICBsaXN0IGFyZSBhbHJlYWR5IGZpbHRlcmVkIGZvciAyLjRHIGNoYW5uZWxzLCBoZW5jZSBpZ25vcmUgdGhpcyBjaGVjayovCisKKyAgICBpZiAoKGVDU1JfQkFORF9BTEwgPT0gZUJhbmQpICYmIENTUl9JU19ST0FNX0lOVFJBX0JBTkRfRU5BQkxFRChwTWFjKSkKKyAgICB7CisgICAgICAgIGNzck5laWdoYm9yUm9hbUNoYW5uZWxzRmlsdGVyQnlCYW5kKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGFubmVsTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0TnVtQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcENoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb3V0TnVtQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdldFJGQmFuZChwTWFjLT5yb2FtLm5laWdoYm9yUm9hbUluZm8uY3VyckFQb3BlcmF0aW9uQ2hhbm5lbCkpOworICAgICAgICB2b3NfbWVtX2NvcHkoQ2hhbm5lbExpc3QsCisgICAgICAgICAgICAgICAgICAgICB0bXBDaGFubmVsTGlzdCwgb3V0TnVtQ2hhbm5lbHMpOworICAgIH0KKworICAgIC8qIFByZXBhcmUgZmluYWwgcm9hbSBzY2FuIGNoYW5uZWwgbGlzdCAqLworICAgIGlmKG91dE51bUNoYW5uZWxzKQorICAgIHsKKyAgICAgICAgLyogQ2xlYXIgdGhlIGNoYW5uZWwgbGlzdCBmaXJzdCAqLworICAgICAgICBpZiAoTlVMTCAhPSBjdXJyQ2hhbm5lbExpc3RJbmZvLT5DaGFubmVsTGlzdCkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9mcmVlKGN1cnJDaGFubmVsTGlzdEluZm8tPkNoYW5uZWxMaXN0KTsKKyAgICAgICAgICAgIGN1cnJDaGFubmVsTGlzdEluZm8tPkNoYW5uZWxMaXN0ID0gTlVMTDsKKyAgICAgICAgICAgIGN1cnJDaGFubmVsTGlzdEluZm8tPm51bU9mQ2hhbm5lbHMgPSAwOworICAgICAgICB9CisKKyAgICAgICAgY3VyckNoYW5uZWxMaXN0SW5mby0+Q2hhbm5lbExpc3QgPSB2b3NfbWVtX21hbGxvYyhvdXROdW1DaGFubmVscyAqIHNpemVvZih0QU5JX1U4KSk7CisgICAgICAgIGlmIChOVUxMID09IGN1cnJDaGFubmVsTGlzdEluZm8tPkNoYW5uZWxMaXN0KQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICA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gICAgICAgIH0KKyAgICAgICAgaWYgKHBQYXJhbS0+bkFjdGl2ZU1heENoblRpbWUpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ubkFjdGl2ZU1heENoblRpbWUgPSBwUGFyYW0tPm5BY3RpdmVNYXhDaG5UaW1lOworICAgICAgICAgICAgY2ZnU2V0SW50KHBNYWMsIFdOSV9DRkdfQUNUSVZFX01BWElNVU1fQ0hBTk5FTF9USU1FLAorICAgICAgICAgICAgICAgICAgICAgIHBQYXJhbS0+bkFjdGl2ZU1heENoblRpbWUpOworICAgICAgICB9CisgICAgICAgIGlmIChwUGFyYW0tPm5BY3RpdmVNaW5DaG5UaW1lKQorICAgICAgICB7CisgICAgICAgICAgICBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLm5BY3RpdmVNaW5DaG5UaW1lID0gcFBhcmFtLT5uQWN0aXZlTWluQ2huVGltZTsKKyAgICAgICAgICAgIGNmZ1NldEludChwTWFjLCBXTklfQ0ZHX0FDVElWRV9NSU5JTVVNX0NIQU5ORUxfVElNRSwKKyAgICAgICAgICAgICAgICAgICAgICBwUGFyYW0tPm5BY3RpdmVNaW5DaG5UaW1lKTsKKyAgICAgICAgfQorICAgICAgICBpZiAocFBhcmFtLT5uUGFzc2l2ZU1heENoblRpbWUpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ublBhc3NpdmVNYXhDaG5UaW1lID0gcFBhcmFtLT5uUGFzc2l2ZU1heENoblRpbWU7CisgICAgICAgICAgICBjZmdTZXRJbnQocE1hYywgV05JX0NGR19QQVNTSVZFX01BWElNVU1fQ0hBTk5FTF9USU1FLAorICAgICAgICAgICAgICAgICAgICAgIHBQYXJhbS0+blBhc3NpdmVNYXhDaG5UaW1lKTsKKyAgICAgICAgfQorICAgICAgICBpZiAocFBhcmFtLT5uUGFzc2l2ZU1pbkNoblRpbWUpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ublBhc3NpdmVNaW5DaG5UaW1lID0gcFBhcmFtLT5uUGFzc2l2ZU1pbkNoblRpbWU7CisgICAgICAgICAgICBjZmdTZXRJbnQocE1hYywgV05JX0NGR19QQVNTSVZFX01JTklNVU1fQ0hBTk5FTF9USU1FLAorICAgICAgICAgICAgICAgICAgICAgIHBQYXJhbS0+blBhc3NpdmVNaW5DaG5UaW1lKTsKKyAgICAgICAgfQorICAgICAgICBpZiAocFBhcmFtLT5uT0JTU1NjYW5XaWR0aFRyaWdnZXJJbnRlcnZhbCkKKyAgICAgICAgeworICAgICAgICAgICAgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uT0JTU1NjYW5XaWR0aFRyaWdnZXJJbnRlcnZhbCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQYXJhbS0+bk9CU1NTY2FuV2lkdGhUcmlnZ2VySW50ZXJ2YWw7CisgICAgICAgICAgICBjZmdTZXRJbnQocE1hYywgV05JX0NGR19PQlNTX0hUNDBfU0NBTl9XSURUSF9UUklHR0VSX0lOVEVSVkFMLAorICAgICAgICAgICAgICAgICAgICAgIHBQYXJhbS0+bk9CU1NTY2FuV2lkdGhUcmlnZ2VySW50ZXJ2YWwpOworICAgICAgICB9CisgICAgICAgIGlmIChwUGFyYW0tPm5BY3RpdmVNYXhDaG5UaW1lQnRjKQorICAgICAgICB7CisgICAgICAgICAgICBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLm5BY3RpdmVNYXhDaG5UaW1lQnRjID0gcFBhcmFtLT5uQWN0aXZlTWF4Q2huVGltZUJ0YzsKKyAgICAgICAgfQorICAgICAgICBpZiAocFBhcmFtLT5uQWN0aXZlTWluQ2huVGltZUJ0YykKKyAgICAgICAgeworICAgICAgICAgICAgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uQWN0aXZlTWluQ2huVGltZUJ0YyA9IHBQYXJhbS0+bkFjdGl2ZU1pbkNoblRpbWVCdGM7CisgICAgICAgIH0KKyNpZmRlZiBXTEFOX0FQX1NUQV9DT05DVVJSRU5DWQorICAgICAgICBpZiAocFBhcmFtLT5uQWN0aXZlTWF4Q2huVGltZUNvbmMpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ubkFjdGl2ZU1heENoblRpbWVDb25jID0gcFBhcmFtLT5uQWN0aXZlTWF4Q2huVGltZUNvbmM7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHBQYXJhbS0+bkFjdGl2ZU1pbkNoblRpbWVDb25jKQorICAgICAgICB7CisgICAgICAgICAgICBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLm5BY3RpdmVNaW5DaG5UaW1lQ29uYyA9IHBQYXJhbS0+bkFjdGl2ZU1pbkNoblRpbWVDb25jOworICAgICAgICB9CisgICAgICAgIGlmIChwUGFyYW0tPm5QYXNzaXZlTWF4Q2huVGltZUNvbmMpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ublBhc3NpdmVNYXhDaG5UaW1lQ29uYyA9IHBQYXJhbS0+blBhc3NpdmVNYXhDaG5UaW1lQ29uYzsKKyAgICAgICAgfQorICAgICAgICBpZiAocFBhcmFtLT5uUGFzc2l2ZU1pbkNoblRpbWVDb25jKQorICAgICAgICB7CisgICAgICAgICAgICBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLm5QYXNzaXZlTWluQ2huVGltZUNvbmMgPSBwUGFyYW0tPm5QYXNzaXZlTWluQ2huVGltZUNvbmM7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHBQYXJhbS0+blJlc3RUaW1lQ29uYykKKyAgICAgICAgeworICAgICAgICAgICAgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uUmVzdFRpbWVDb25jID0gcFBhcmFtLT5uUmVzdFRpbWVDb25jOworICAgICAgICB9CisgICAgICAgIGlmIChwUGFyYW0tPm5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RlZCggcE1hYyApICkKKyAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzID0gQ3NySW5pdDExZEluZm8ocE1hYywgJnBQYXJhbS0+Q3NyMTFkaW5mbyk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBwTWFjLT5zY2FuLmN1clNjYW5UeXBlID0gZVNJUl9BQ1RJVkVfU0NBTjsKKyAgICAgICAgfQorCisgICAgICAgIC8qIEluaXRpYWxpemUgdGhlIHBvd2VyICsgY2hhbm5lbCBpbmZvcm1hdGlvbiBpZiAxMWggaXMgZW5hYmxlZC4KKyAgICAgICAgSWYgMTFkIGlzIGVuYWJsZWQgdGhpcyBpbmZvcm1hdGlvbiBoYXMgYWxyZWFkeSBiZWVuIGluaXRpYWxpemVkICovCisgICAgICAgIGlmKCBjc3JJczExaFN1cHBvcnRlZCggcE1hYyApICYmICFjc3JJczExZFN1cHBvcnRlZCggcE1hYyApICkKKyAgICAgICAgeworICAgICAgICAgICAgY3NySW5pdENoYW5uZWxQb3dlckxpc3QocE1hYywgJnBQYXJhbS0+Q3NyMTFkaW5mbyk7CisgICAgICAgIH0KKworCisjaWZkZWYgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIKKyAgICAgICAgdm9zX21lbV9jb3B5KCZwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLmNzcjExckNvbmZpZywKKyAgICAgICAgICAgICAgICAgICAgICZwUGFyYW0tPmNzcjExckNvbmZpZywgc2l6ZW9mKHRDc3IxMXJDb25maWdQYXJhbXMpKTsKKyAgICAgICAgc21zTG9nKCBwTWFjLCBMT0cxLCAiSXNGVFJlc291cmNlUmVxU3VwcCA9ICVkIiwgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5jc3IxMXJDb25maWcuSXNGVFJlc291cmNlUmVxU3VwcG9ydGVkKTsKKyNlbmRpZgorI2lmICBkZWZpbmVkIChXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUikgfHwgZGVma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ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmKCgwID09IHBoeU1vZGUpIHx8IChlQ1NSX0RPVDExX01PREVfVEFVUlVTICYgcGh5TW9kZSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIG5ld1BoeU1vZGUgPSBlQ1NSX0RPVDExX01PREVfVEFVUlVTOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYoZUNTUl9ET1QxMV9NT0RFX0FVVE8gJiBwaHlNb2RlKQorICAgICAgICB7CisgICAgICAgICAgICBuZXdQaHlNb2RlID0gZUNTUl9ET1QxMV9NT0RFX0FVVE87CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvL0NoZWNrIGZvciBkdWFsIGJhbmQgYW5kIGhpZ2hlciBjYXBhYmlsaXR5IGZpcnN0CisgICAgICAgICAgICBpZihlQ1NSX0RPVDExX01PREVfMTFuX09OTFkgJiBwaHlNb2RlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKGVDU1JfRE9UMTFfTU9ERV8xMW5fT05MWSAhPSBwaHlNb2RlKSBicmVhazsKKyAgICAgICAgICAgICAgICBuZXdQaHlNb2RlID0gZUNTUl9ET1QxMV9NT0RFXzExbl9PTkxZOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZihlQ1NSX0RPVDExX01PREVfMTFhX09OTFkgJiBwaHlNb2RlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKGVDU1JfRE9UMTFfTU9ERV8xMWFfT05MWSAhPSBwaHlNb2RlKSBicmVhazsKKyAgICAgICAgICAgICAgICBpZihlQ1NSX0JBTkRfMjQgPT0gZUJhbmQpIGJyZWFrOworICAgICAgICAgICAgICAgIG5ld1BoeU1vZGUgPSBlQ1NSX0RPVDExX01PREVfMTFhX09OTFk7CisgICAgICAgICAgICAgICAgZUJhbmQgPSBlQ1NSX0JBTkRfNUc7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKGVDU1JfRE9UMTFfTU9ERV8xMWdfT05MWSAmIHBoeU1vZGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoZUNTUl9ET1QxMV9NT0RFXzExZ19PTkxZICE9IHBoeU1vZGUpIGJyZWFrOworICAgICAgICAgICAgICAgIGlmKGVDU1JfQkFORF81RyA9PSBlQmFuZCkgYnJlYWs7CisgICAgICAgICAgICAgICAgbmV3UGh5TW9kZSA9IGVDU1JfRE9UMTFfTU9ERV8xMWdfT05MWTsKKyAgICAgICAgICAgICAgICBlQmFuZCA9IGVDU1JfQkFORF8yNDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYoZUNTUl9ET1QxMV9NT0RFXzExYl9PTkxZICYgcGh5TW9kZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZihlQ1NSX0RPVDExX01PREVfMTFiX09OTFkgIT0gcGh5TW9kZSkgYnJlYWs7CisgICAgICAgICAgICAgICAgaWYoZUNTUl9CQU5EXzVHID09IGVCYW5kKSBicmVhazsKKyAgICAgICAgICAgICAgICBuZXdQaHlNb2RlID0gZUNTUl9ET1QxMV9NT0RFXzExYl9PTkxZOworICAgICAgICAgICAgICAgIGVCYW5kID0gZUNTUl9CQU5EXzI0OworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZihlQ1NSX0RPVDExX01PREVfMTFuICYgcGh5TW9kZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBuZXdQaHlNb2RlID0gZUNTUl9ET1QxMV9NT0RFXzExbjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYoZUNTUl9ET1QxMV9NT0RFX2FiZyAmIHBoeU1vZGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbmV3UGh5TW9kZSA9IGVDU1JfRE9UMTFfTU9ERV9hYmc7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKGVDU1JfRE9UMTFfTU9ERV8xMWEgJiBwaHlNb2RlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKChlQ1NSX0RPVDExX01PREVfMTFnICYgcGh5TW9kZSkgfHwgKGVDU1JfRE9UMTFfTU9ERV8xMWIgJiBwaHlNb2RlKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmKGVDU1JfQkFORF9BTEwgPT0gZUJhbmQpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ld1BoeU1vZGUgPSBlQ1NSX0RPVDExX01PREVfYWJnOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLy9iYWQgc2V0dGluZworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbmV3UGh5TW9kZSA9IGVDU1JfRE9UMTFfTU9ERV8xMWE7CisgICAgICAgICAgICAgICAgICAgIGVCYW5kID0gZUNTUl9CQU5EXzVHOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYoZUNTUl9ET1QxMV9NT0RFXzExZyAmIHBoeU1vZGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbmV3UGh5TW9kZSA9IGVDU1JfRE9UMTFfTU9ERV8xMWc7CisgICAgICAgICAgICAgICAgZUJhbmQgPSBlQ1NSX0JBTkRfMjQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKGVDU1JfRE9UMTFfTU9ERV8xMWIgJiBwaHlNb2RlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG5ld1BoeU1vZGUgPSBlQ1NSX0RPVDExX01PREVfMTFiOworICAgICAgICAgICAgICAgIGVCYW5kID0gZUNTUl9CQU5EXzI0OworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vV2Ugd2lsbCBuZXZlciBiZSBoZXJlCisgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiIGNhbm5vdCByZWNvZ25pemUgdGhlIHBoeSBtb2RlIDB4JTA4WCIpLCBwaHlNb2RlICk7CisgICAgICAgICAgICAgICAgbmV3UGh5TW9kZSA9IGVDU1JfRE9UMTFfTU9ERV9BVVRPOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIC8vRG9uZSB2YWxpZGF0aW5nCisgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgIC8vTm93IHdlIG5lZWQgdG8gY2hlY2sgd2hldGhlciBhIHJlc3RhcnQgaXMgbmVlZGVkLgorICAgICAgICBpZihlQmFuZCAhPSBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLmVCYW5kKQorICAgICAgICB7CisgICAgICAgICAgICBmUmVzdGFydE5lZWRlZCA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgaWYobmV3UGh5TW9kZSAhPSBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLnBoeU1vZGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGZSZXN0YXJ0TmVlZGVkID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH13aGlsZSgwKTsKKyAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICB7CisgICAgICAgIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uZUJhbmQgPSBlQmFuZDsKKyAgICAgICAgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5waHlNb2RlID0gbmV3UGh5TW9kZTsKKyAgICAgICAgaWYocGZSZXN0YXJ0TmVlZGVkKQorICAgICAgICB7CisgICAgICAgICAgICAqcGZSZXN0YXJ0TmVlZGVkID0gZlJlc3RhcnROZWVkZWQ7CisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIChzdGF0dXMpOworfQorICAgIAordm9pZCBjc3JQcnVuZUNoYW5uZWxMaXN0Rm9yTW9kZSggdHBBbmlTaXJHbG9iYWwgcE1hYywgdENzckNoYW5uZWwgKnBDaGFubmVsTGlzdCApCit7CisgICAgdEFOSV9VOCBJbmRleDsKKyAgICB0QU5JX1U4IGNDaGFubmVsczsKKyAgICAvLyBmb3IgZHVhbCBiYW5kIE5JQ3MsIGRvbid0IG5lZWQgdG8gdHJpbSB0aGUgY2hhbm5lbCBsaXN0Li4uLgorICAgIGlmICggIUNTUl9JU19PUEVBUlRJTkdfRFVBTF9CQU5EKCBwTWFjICkgKQorICAgIHsKKyAgICAgICAgLy8gMi40IEdIeiBiYW5kIG9wZXJhdGlvbiByZXF1aXJlcyB0aGUgY2hhbm5lbCBsaXN0IHRvIGJlIHRyaW1tZWQgdG8KKyAgICAgICAgLy8gdGhlIDIuNCBHSHogY2hhbm5lbHMgb25seS4uLgorICAgICAgICBpZiAoIENTUl9JU18yNF9CQU5EX09OTFkoIHBNYWMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGZvciggSW5kZXggPSAwLCBjQ2hhbm5lbHMgPSAwOyBJbmRleCA8IHBDaGFubmVsTGlzdC0+bnVtQ2hhbm5lbHM7CisgICAgICAgICAgICAgICAgIEluZGV4KysgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICggQ1NSX0lTX0NIQU5ORUxfMjRHSFoocENoYW5uZWxMaXN0LT5jaGFubmVsTGlzdFsgSW5kZXggXSkgKQorIC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Zvc19tZW1fc2V0KCZwQ2hhbm5lbExpc3QtPmNoYW5uZWxMaXN0WyBjQ2hhbm5lbHMgXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCBwQ2hhbm5lbExpc3QtPmNoYW5uZWxMaXN0WyAwIF0gKSAqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIHBDaGFubmVsTGlzdC0+bnVtQ2hhbm5lbHMgLSBjQ2hhbm5lbHMgKSwgMCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHBDaGFubmVsTGlzdC0+bnVtQ2hhbm5lbHMgPSBjQ2hhbm5lbHM7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoIENTUl9JU181R19CQU5EX09OTFkoIHBNYWMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGZvciAoIEluZGV4ID0gMCwgY0NoYW5uZWxzID0gMDsgSW5kZXggPCBwQ2hhbm5lbExpc3QtPm51bUNoYW5uZWxzOyBJbmRleCsrICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoIENTUl9JU19DSEFOTkVMXzVHSFoocENoYW5uZWxMaXN0LT5jaGFubmVsTGlzdFsgSW5kZXggXSkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcENoYW5uZWxMaXN0LT5jaGFubmVsTGlzdFsgY0NoYW5uZWxzIF0gPSBwQ2hhbm5lbExpc3QtPmNoYW5uZWxMaXN0WyBJbmRleCBdOworICAgICAgICAgICAgICAgICAgICBjQ2hhbm5lbHMrKzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBDbGVhbnVwIHRoZSByZXN0IG9mIGNoYW5uZWxzLiAgIE5vdGUgd2Ugb25seSBuZWVkIHRvIGNsZWFuIHVwIHRoZSBjaGFubmVscyBpZiB3ZSBoYWQKKyAgICAgICAgICAgIC8vIHRvIHRyaW0gdGhlIGxpc3QuICBDYWxsaW5nIHBhbFplcm9NZW1vcnkoKSB3aXRoIGEgMCBzaXplIGlzIGdvaW5nIHRvIHRocm93IGFzc2VydHMgb24gCisgICAgICAgICAgICAvLyB0aGUgZGVidWcgYnVpbGRzIHNvIGxldCdzIGJlIGEgYml0IHNtYXJ0ZXIgYWJvdXQgdGhhdC4gIFplcm8gb3V0IHRoZSByZXNldCBvZiB0aGUgY2hhbm5lbHMKKyAgICAgICAgICAgIC8vIG9ubHkgaWYgd2UgbmVlZCB0by4KKyAgICAgICAgICAgIC8vCisgICAgICAgICAgICAvLyBUaGUgYW1vdW50IG9mIG1lbW9yeSB0byBjbGVhciBpcyB0aGUgbnVtYmVyIG9mIGNoYW5uZXNsIHRoYXQgd2UgdHJpbW1lZCAKKyAgICAgICAgICAgIC8vIChwQ2hhbm5lbExpc3QtPm51bUNoYW5uZWxzIC0gY0NoYW5uZWxzKSB0aW1lcyB0aGUgc2l6ZSBvZiBhIGNoYW5uZWwgaW4gdGhlIHN0cnVjdHVyZS4KKyAgICAgICAgICAgIGlmICggcENoYW5uZWxMaXN0LT5udW1DaGFubmVscyA+IGNDaGFubmVscyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9zZXQoJnBDaGFubmVsTGlzdC0+Y2hhbm5lbExpc3RbIGNDaGFubmVscyBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiggcENoYW5uZWxMaXN0LT5jaGFubmVsTGlzdFsgMCBdICkgKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICggcENoYW5uZWxMaXN0LT5udW1DaGFubmVscyAtIGNDaGFubmVscyApLCAwKTsKKyAgICAgICAgICAgIH0gICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIHBDaGFubmVsTGlzdC0+bnVtQ2hhbm5lbHMgPSBjQ2hhbm5lbHM7CisgICAgICAgIH0KKyAgICB9Cit9CisjZGV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AgICAgIHBDaGFuSW5mb1N0YXJ0ID0gcENoYW5JbmZvOworICAgICAgZm9yKGluZGV4ID0gMDsgaW5kZXggPCBwczExZGluZm8tPkNoYW5uZWxzLm51bUNoYW5uZWxzOyBpbmRleCsrKQorICAgICAgeworICAgICAgICBwQ2hhbkluZm8tPmZpcnN0Q2hhbk51bSA9IHBzMTFkaW5mby0+Q2huUG93ZXJbaW5kZXhdLmZpcnN0Q2hhbm5lbDsKKyAgICAgICAgcENoYW5JbmZvLT5udW1DaGFubmVscyAgPSBwczExZGluZm8tPkNoblBvd2VyW2luZGV4XS5udW1DaGFubmVsczsKKyAgICAgICAgcENoYW5JbmZvLT5tYXhUeFBvd2VyICAgPSBDU1JfUk9BTV9NSU4oIHBzMTFkaW5mby0+Q2huUG93ZXJbaW5kZXhdLm1heHR4UG93ZXIsIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ublR4UG93ZXJDYXAgKTsKKyAgICAgICAgcENoYW5JbmZvKys7CisgICAgICAgIGNvdW50Kys7CisgICAgICB9CisgICAgICBpZihjb3VudCkKKyAgICAgIHsKKyAgICAgICAgICBjc3JTYXZlVG9DaGFubmVsUG93ZXIyR181RyggcE1hYywgY291bnQgKiBzaXplb2YodFNpck1hY0NoYW5JbmZvKSwgcENoYW5JbmZvU3RhcnQgKTsKKyAgICAgIH0KKyAgICAgIHZvc19tZW1fZnJlZShwQ2hhbkluZm9TdGFydCk7CisgIH0KKyAgLy9Pbmx5IGFwcGx5IHRoZW0gdG8gQ0ZHIHdoZW4gbm90IGluIFNUT1Agc3RhdGUuIE90aGVyd2lzZSB0aGV5IHdpbGwgYmUgYXBwbGllZCBsYXRlcgorICBpZiggSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykgKQorICB7CisgICAgICBmb3IoIGluZGV4ID0gMDsgaW5kZXggPCBDU1JfUk9BTV9TRVNTSU9OX01BWDsgaW5kZXgrKyApCisgICAgICB7CisgICAgICAgICAgaWYoKENTUl9JU19TRVNTSU9OX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F9MSVNUX0xFTik7CisgIGlmIChwQ2hhbkluZm8gIT0gTlVMTCkKKyAgeworICAgICAgdm9zX21lbV9zZXQocENoYW5JbmZvLAorICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNDaGFuSW5mbykgKiBXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU4sCisgICAgICAgICAgICAgICAgICAwKTsKKyAgICAgIHBDaGFuSW5mb1N0YXJ0ID0gcENoYW5JbmZvOworCisgICAgICBmb3IoaW5kZXggPSAwOyBpbmRleCA8IHBzMTFkaW5mby0+Q2hhbm5lbHMubnVtQ2hhbm5lbHM7IGluZGV4KyspCisgICAgICB7CisgICAgICAgIHBDaGFuSW5mby0+Zmlyc3RDaGFuTnVtID0gcHMxMWRpbmZvLT5DaG5Qb3dlcltpbmRleF0uZmlyc3RDaGFubmVsOworICAgICAgICBwQ2hhbkluZm8tPm51bUNoYW5uZWxzICA9IHBzMTFkaW5mby0+Q2huUG93ZXJbaW5kZXhdLm51bUNoYW5uZWxzOworICAgICAgICBwQ2hhbkluZm8tPm1heFR4UG93ZXIgICA9IENTUl9ST0FNX01JTiggcHMxMWRpbmZvLT5DaG5Qb3dlcltpbmRleF0ubWF4dHhQb3dlciwgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uVHhQb3dlckNhcCApOworICAgICAgICBwQ2hhbkluZm8rKzsKKyAgICAgICAgY291bnQrKzsKKyAgICAgIH0KKyAgICAgIGlmKGNvdW50KQorICAgICAgeworICAgICAgICAgIGNzclNhdmVUb0NoYW5uZWxQb3dlcjJHXzVHKCBwTWFjLCBjb3VudCAqIHNpemVvZih0U2lyTWFjQ2hhbkluZm8pLCBwQ2hhbkluZm9TdGFydCApOworICAgICAgfQorICAgICAgdm9zX21lbV9mcmVlKHBDaGFuSW5mb1N0YXJ0KTsKKyAgfQorCisgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworfQorCisvKioKKyAqIGNzcl9yb2FtX3JlbW92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uIGxpc3QiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgY3NyTExMb2NrKHBMaXN0KTsKKyAgICBwRW50cnkgPSBjc3JMTFBlZWtIZWFkKHBMaXN0LCBMTF9BQ0NFU1NfTk9MT0NLKTsKKyAgICB3aGlsZSAocEVudHJ5KQorICAgIHsKKyAgICAgICAgcE5leHRFbnRyeSA9IGNzckxMTmV4dChwTGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTk9MT0NLKTsKKyAgICAgICAgcER1cENvbW1hbmQgPSBHRVRfQkFTRV9BRERSKHBFbnRyeSwgdFNtZUNtZCwgTGluayk7CisgICAgICAgIC8qCisgICAgICAgICAqIFJlbW92ZSB0aGUgcHJldmlvdXMgY29tbWFuZCBpZi4uCisgICAgICAgICAqIC0gdGhlIG5ldyByb2FtIGNvbW1hbmQgaXMgZm9yIHRoZSBzYW1lIFJvYW1SZWFzb24uLi4KKyAgICAgICAgICogLSB0aGUgbmV3IHJvYW0gY29tbWFuZCBpcyBhIE5ld1Byb2ZpbGVMaXN0LgorICAgICAgICAgKiAtIHRoZSBuZXcgcm9hbSBjb21tYW5kIGlzIGEgRm9yY2VkIERpc3NvYworICAgICAgICAgKiAtIHRoZSBuZXcgcm9hbSBjb21tYW5kIGlzIGZyb20gYW4gODAyLjExIE9JRAorICAgICAgICAgKiAgIChPSURfU1NJRCBvciBPSURfQlNTSUQpLgorICAgICAgICAgKi8KKyAgICAgICAgaWYgKChwQ29tbWFuZCAmJiAocENvbW1hbmQtPnNlc3Npb25JZCA9PSBwRHVwQ29tbWFuZC0+c2Vzc2lvbklkKSAmJgorICAgICAgICAgICAgICAoKHBDb21tYW5kLT5jb21tYW5kID09IHBEdXBDb21tYW5kLT5jb21tYW5kKSAmJgorICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgKiBUaGlzIHBlZXJtYWMgY2hlY2sgaXMgcmVxdXJpZWQgZm9yIFNvZnRhcC9HTyBzY2VuYXJpb3MKKyAgICAgICAgICAgICAgICogRm9yIFNUQSBzY2VuYXJpbyBiZWxvdyBPUiBjaGVjayB3aWxsIHN1ZmZpY2UgYXMgcENvbW1hbmQKKyAgICAgICAgICAgICAgICogd2lsbCBhbHdheXMgYmUgTlVMTCBmb3IgU1RBIHNjZW5hcmlvcworICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICh2b3NfbWVtX2NvbXBhcmUocER1cENvbW1hbmQtPnUucm9hbUNtZC5wZWVyTWFjLAorICAgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUucm9hbUNtZC5wZWVyTWFjLCBzaXplb2Yodl9NQUNBRERSX3QpKSkgJiYKKyAgICAgICAgICAgICAgICAoKHBDb21tYW5kLT51LnJvYW1DbWQucm9hbVJlYXNvbiA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICBwRHVwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1SZWFzb24pIHx8CisgICAgICAgICAgICAgICAgIChlQ3NyRm9yY2VkRGlzYXNzb2MgPT0gcENvbW1hbmQtPnUucm9hbUNtZC5yb2FtUmVhc29uKSB8fAorICAgICAgICAgICAgICAgICAoZUNzckhkZElzc3VlZCA9PSBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1SZWFzb24pKSkpIHx8CisgICAgICAgICAgICAvKiBPUiBpZiBwQ29tbWFuZCBpcyBOVUxMICovCisgICAgICAgICAgICAoKHNlc3Npb25JZCA9PSBwRHVwQ29tbWFuZC0+c2Vzc2lvbklkKSAmJgorICAgICAgICAgICAgIChlU21lQ29tbWFuZFJvYW0gPT0gcER1cENvbW1hbmQtPmNvbW1hbmQpICYmCisgICAgICAgICAgICAgKChlQ3NyRm9yY2VkRGlzYXNzb2MgPT0gZVJvYW1SZWFzb24pIHx8CisgICAgICAgICAgICAgIChlQ3NySGRkSXNzdWVkID09IGVSb2FtUmVhc29uKSkpKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywgRkwoIlJvYW1SZWFzb24gPSAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcER1cENvbW1hbmQtPnUucm9hbUNtZC5yb2FtUmVhc29uKTsKKyAgICAgICAgICAgIC8qIFJlbW92ZSB0aGUgJ3N0YWxlJyByb2FtIGNvbW1hbmQgZnJvbSB0aGUgcGVuZGluZyBsaXN0ICovCisgICAgICAgICAgICBpZiAoY3NyTExSZW1vdmVFbnRyeShwTGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTk9MT0NLKSkKKyAgICAgICAgICAgICAgICBjc3JMTEluc2VydFRhaWwoJmxvY2FsTGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTk9MT0NLKTsKKyAgICAgICAgfQorICAgICAgICBwRW50cnkgPSBwTmV4dEVudHJ5OworICAgIH0KKyAgICBjc3JMTFVubG9jayhwTGlzdCk7CisKKyAgICB3aGlsZSAoKHBFbnRyeSA9IGNzckxMUmVtb3ZlSGVhZCgmbG9jYWxMaXN0LCBMTF9BQ0NFU1NfTk9MT0NLKSkpCisgICAgeworICAgICAgICBwRHVwQ29tbWFuZCA9IEdFVF9CQVNFX0FERFIoIHBFbnRyeSwgdFNtZUNtZCwgTGluayApOworICAgICAgICAvKiBUZWxsIGNhbGxlciB0aGF0IHRoZSBjb21tYW5kIGlzIGNhbmNlbGxlZCAqLworICAgICAgICBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIHBEdXBDb21tYW5kLT5zZXNzaW9uSWQsIE5VTEwsCisgICAgICAgICAgICAgICAgICAgIHBEdXBDb21tYW5kLT51LnJvYW1DbWQucm9hbUlkLAorICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fQ0FOQ0VMTEVELCBlQ1NSX1JPQU1fUkVTVUxUX05PTkUpOworICAgICAgICBjc3JSZWxlYXNlQ29tbWFuZFJvYW0ocE1hYywgcER1cENvbW1hbmQpOworICAgIH0KKyAgICBjc3JMTENsb3NlKCZsb2NhbExpc3QpOworfQorCisvKioKKyAqIGNzclJ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ICAgICAgICAgdEFOSV9VMzIgcmVhc29uKQoreworICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICB0U21lQ21kICpwQ29tbWFuZDsKKworICAgIGRvCisgICAgeworICAgICAgICBwQ29tbWFuZCA9IGNzckdldENvbW1hbmRCdWZmZXIoIHBNYWMgKTsKKyAgICAgICAgaWYgKCAhcENvbW1hbmQgKSAKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiIGZhaWwgdG8gZ2V0IGNvbW1hbmQgYnVmZmVyIikgKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1JFU09VUkNFUzsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIHBDb21tYW5kLT5jb21tYW5kID0gZVNtZUNvbW1hbmRSb2FtOworICAgICAgICBwQ29tbWFuZC0+c2Vzc2lvbklkID0gKHRBTklfVTgpc2Vzc2lvbklkOworICAgICAgICBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1SZWFzb24gPSBlQ3NyRm9yY2VkRGlzYXNzb2NTdGE7CisgICAgICAgIHZvc19tZW1fY29weShwQ29tbWFuZC0+dS5yb2FtQ21kLnBlZXJNYWMsIHBQZWVyTWFjQWRkciwgNik7CisgICAgICAgIHBDb21tYW5kLT51LnJvYW1DbWQucmVhc29uID0gKHRTaXJNYWNSZWFzb25Db2RlcylyZWFzb247CisgICAgICAgIHN0YXR1cyA9IGNzclF1ZXVlU21lQ29tbWFuZChwTWFjLCBwQ29tbWFuZCwgZUFOSV9CT09MRUFOX0ZBTFNFKTsKKyAgICAgICAgaWYoICFIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiIGZhaWwgdG8gc2VuZCBtZXNzYWdlIHN0YXR1cyA9ICVkI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sKKyAgICAgICAgcENvbW1hbmQgPSBjc3JHZXRDb21tYW5kQnVmZmVyKCBwTWFjICk7CisgICAgICAgIGlmICggIXBDb21tYW5kICkgCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgRkwoIiBmYWlsIHRvIGdldCBjb21tYW5kIGJ1ZmZlciIpICk7CisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19SRVNPVVJDRVM7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBwQ29tbWFuZC0+Y29tbWFuZCA9IGVTbWVDb21tYW5kUm9hbTsKKyAgICAgICAgcENvbW1hbmQtPnNlc3Npb25JZCA9ICh0QU5JX1U4KXNlc3Npb25JZDsKKyAgICAgICAgcENvbW1hbmQtPnUucm9hbUNtZC5yb2FtUmVhc29uID0gZUNzckZvcmNlZERlYXV0aFN0YTsKKyAgICAgICAgdm9zX21lbV9jb3B5KHBDb21tYW5kLT51LnJvYW1DbWQucGVlck1hYywgcERlbFN0YVBhcmFtcy0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgcENvbW1hbmQtPnUucm9hbUNtZC5yZWFzb24gPQorICAgICAgICAgICAgICAgICAgICAodFNpck1hY1JlYXNvbkNvZGVzKXBEZWxTdGFQYXJhbXMtPnJlYXNvbl9jb2RlOworICAgICAgICBzdGF0dXMgPSBjc3JRdWV1ZVNtZUNvbW1hbmQocE1hYywgcENvbW1hbmQsIGVBTklfQk9PTEVBTl9GQUxTRSk7CisgICAgICAgIGlmKCAhSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgRkwoIiBmYWlsIHRvIHNlbmQgbWVzc2FnZSBzdGF0dXMgPSAlZCIpLCBzdGF0dXMgKTsKKyAgICAgICAgICAgIGNzcl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tPnBDb25uZWN0QnNzRGVzYykKKyAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwU2Vzc2lvbi0+cENvbm5lY3RCc3NEZXNjLCBwQnNzRGVzYywgc2l6ZSk7CisgICAgIH0KKyAgICByZXR1cm4gKHN0YXR1cyk7Cit9CisKK2VIYWxTdGF0dXMgY3NyUm9hbVByZXBhcmVCc3NDb25maWcodHBBbmlTaXJHbG9iYWwgcE1hYywgdENzclJvYW1Qcm9maWxlICpwUHJvZmlsZSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyQnNzRGVzY3JpcHRpb24gKnBCc3NEZXNjLCB0QnNzQ29uZmlnUGFyYW0gKnBCc3NDb25maWcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmQmVhY29uSUVzICpwSWVzKQoreworICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICBlQ3NyQ2ZnRG90MTFNb2RlIGNmZ0RvdDExTW9kZTsKKyAgICBWT1NfQVNTRVJUKCBwSWVzICE9IE5VTEwgKTsKKyAgICBpZiAocEllcyA9PSBOVUxMKQorICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKworICAgIGRvCisgICAgeworICAgICAgICB2b3NfbWVtX2NvcHkoJnBCc3NDb25maWctPkJzc0NhcCwgJnBCc3NEZXNjLT5jYXBhYmlsaXR5SW5mbywKKyAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQ2FwYWJpbGl0eUluZm8pKTsKKyAgICAgICAgLy9nZXQgcW9zCisgICAgICAgIHBCc3NDb25maWctPnFvc1R5cGUgPSBjc3JHZXRRb1NGcm9tQnNzRGVzYyhwTWFjLCBwQnNzRGVzYywgcEllcyk7CisgICAgICAgIC8vZ2V0IFNTSUQKKyAgICAgICAgaWYocEllcy0+U1NJRC5wcmVzZW50KQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnBCc3NDb25maWctPlNTSUQuc3NJZCwgcEllcy0+U1NJRC5zc2lkLCBwSWVzLT5TU0lELm51bV9zc2lkKTsKKyAgICAgICAgICAgIHBCc3NDb25maWctPlNTSUQubGVuZ3RoID0gcEllcy0+U1NJRC5udW1fc3NpZDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgICBwQnNzQ29uZmlnLT5TU0lELmxlbmd0aCA9IDA7CisgICAgICAgIGlmKGNzcklzTlVMTFNTSUQocEJzc0NvbmZpZy0+U1NJRC5zc0lkLCBwQnNzQ29uZmlnLT5TU0lELmxlbmd0aCkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLCAiICBCU1MgZGVzYyBTU0lEIGlzIGEgd2lsZGNhcmQiKTsKKyAgICAgICAgICAgIC8vUmV0dXJuIGZhaWxlZCBpZiBwcm9maWxlIGRvZXNuJ3QgaGF2ZSBhbiBTU0lEIGVpdGhlci4KKyAgICAgICAgICAgIGlmKHBQcm9maWxlLT5TU0lEcy5udW1PZlNTSURzID09IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csICIgIEJvdGggQlNTIGRlc2MgYW5kIHByb2ZpbGUgZG9lc24ndCBoYXZlIFNTSUQiKTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmKENTUl9JU19DSEFOTkVMXzVHSFoocEJzc0Rlc2MtPmNoYW5uZWxJZCkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBCc3NDb25maWctPmVCYW5kID0gZUNTUl9CQU5EXzVHOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcEJzc0NvbmZpZy0+ZUJhbmQgPSBlQ1NSX0JBTkRfMjQ7CisgICAgICAgIH0KKyAgICAgICAgLy9waHltb2RlCisgICAgICAgIGlmKGNzcklzUGh5TW9kZU1hdGNoKCBwTWFjLCBwUHJvZmlsZS0+cGh5TW9kZSwgcEJzc0Rlc2MsIHBQcm9maWxlLCAmY2ZnRG90MTFNb2RlLCBwSWVzICkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBCc3NDb25maWctPnVDZmdEb3QxMU1vZGUgPSBjZmdEb3QxMU1vZGU7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSAKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csICIgICBDYW4gbm90IGZpbmQgbWF0Y2ggcGh5IG1vZGUiKTsKKyAgICAgICAgICAgIC8vZm9yY2UgaXQKKyAgICAgICAgICAgIGlmKGVDU1JfQkFORF8yNCA9PSBwQnNzQ29uZmlnLT5lQmFuZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwQnNzQ29uZmlnLT51Q2ZnRG90MTFNb2RlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUc7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcEJzc0NvbmZpZy0+dUNmZ0RvdDExTW9kZSA9IGVDU1JfQ0ZHX0RPVDExX01PREVfMTFBOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIC8vUW9zCisgICAgICAgIGlmICgocEJzc0NvbmZpZy0+dUNmZ0RvdDExTW9kZSAhPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExTikgJiYKKyAgICAgICAgICAgICAgICAocE1hYy0+cm9hbS5jb25maWdQYXJhbS5XTU1TdXBwb3J0TW9kZSA9PSBlQ3NyUm9hbVdtbU5vUW9zKSkKKyAgICAgICAgeworICAgICAgICAgICAgLy9Kb2luaW5nIEJTUyBpcyBub3QgMTFuIGNhcGFibGUgYW5kIFdNTSBpcyBkaXNhYmxlZCBvbiBjbGllbnQuCisgICAgICAgICAgICAvL0Rpc2FibGUgUW9TIGFuZCBXTU0KKyAgICAgICAgICAgIHBCc3NDb25maWctPnFvc1R5cGUgPSBlQ1NSX01FRElVTV9BQ0NFU1NfRENGOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCgocEJzc0NvbmZpZy0+dUNmZ0RvdDExTW9kZSA9PSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExTikgIHx8IAorICAgICAgICAgICAgICAgICAgICAgICAgIChwQnNzQ29uZmlnLT51Q2ZnRG90MTFNb2RlID09IGVDU1JfQ0ZHX0RPVDExX01PREVfMTFBQykpICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgKChwQnNzQ29uZmlnLT5xb3NUeXBlICE9IGVDU1JfTUVESVVNX0FDQ0VTU19XTU1fZURDRl9EU0NQKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAocEJzc0NvbmZpZy0+cW9zVHlwZSAhPSBlQ1NSX01FRElVTV9BQ0NFU1NfMTFlX0hDRikgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKHBCc3NDb25maWctPnFvc1R5cGUgIT0gZUNTUl9NRURJVU1fQUNDRVNTXzExZV9lRENGKSApKQorICAgICAgICB7CisgICAgICAgICAgICAvL0pvaW5pbmcgQlNTIGlzIDExbiBjYXBhYmxlIGFuZCBXTU0gaXMgZGlzYWJsZWQgb24gQVAuCisgICAgICAgICAgICAvL0Fzc3VtZSBhbGwgSFQgQVAncyBhcmUgUU9TIEFQJ3MgYW5kIGVuYWJsZSBXTU0KKyAgICAgICAgICAgIHBCc3NDb25maWctPnFvc1R5cGUgPSBlQ1NSX01FRElVTV9BQ0NFU1NfV01NX2VEQ0ZfRFNDUDsKKyAgICAgICAgfQorCisgICAgICAgIC8vYXV0aCB0eXBlCisgICAgICAgIHN3aXRjaCggcFByb2ZpbGUtPm5lZ290aWF0ZWRBdXRoVHlwZSApIAorICAgICAgICB7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgY2FzZSBlQ1NSX0FVVEhfVFlQRV9XUEE6CisgICAgICAgICAgICBjYXNlIGVDU1JfQVVUSF9UWVBFX1dQQV9QU0s6CisgICAgICAgICAgICBjYXNlIGVDU1JfQVVUSF9UWVBFX1dQQV9OT05FOgorICAgICAgICAgICAgY2FzZSBlQ1NSX0FVVEhfVFlQRV9PUEVOX1NZU1RFTToKKyAgICAgICAgICAgICAgICBwQnNzQ29uZmlnLT5hdXRoVHlwZSA9IGVTSVJfT1BFTl9TWVNURU07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDU1JfQVVUSF9UWVBFX1NIQVJFRF9LRVk6CisgICAgICAgICAgICAgICAgcEJzc0NvbmZpZy0+YXV0aFR5cGUgPSBlU0lSX1NIQVJFRF9LRVk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDU1JfQVVUSF9UWVBFX0FVVE9TV0lUQ0g6CisgICAgICAgICAgICAgICAgcEJzc0NvbmZpZy0+YXV0aFR5cGUgPSBlU0lSX0FVVE9fU1dJVENIOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIC8vc2hvcnQgc2xvdCB0aW1lCisgICAgICAgIGlmKCBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQiAhPSBjZmdEb3QxMU1vZGUgKQorICAgICAgICB7CisgICAgICAgICAgICBwQnNzQ29uZmlnLT51U2hvcnRTbG90VGltZSA9IHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uc2hvcnRTbG90VGltZTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHBCc3NDb25maWctPnVTaG9ydFNsb3RUaW1lID0gMDsKKyAgICAgICAgfQorICAgICAgICBpZihwQnNzQ29uZmlnLT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ICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgaWYgKCBwQnNzRGVzYy0+YmVhY29uSW50ZXJ2YWwgKQorICAgICAgICB7CisgICAgICAgICAgICAvL01ha2Ugc3VyZSBpdCBpcyBiaWdnZXIgdGhhbiB0aGUgbWluaW1hbAorICAgICAgICAgICAgcEJzc0NvbmZpZy0+dUpvaW5UaW1lT3V0ID0gQ1NSX1JPQU1fTUFYKDEwICogcEJzc0Rlc2MtPmJlYWNvbkludGVydmFsLCBDU1JfSk9JTl9GQUlMVVJFX1RJTUVPVVRfTUlOKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIAorICAgICAgICB7CisgICAgICAgICAgICBwQnNzQ29uZmlnLT51Sm9pblRpbWVPdXQgPSBDU1JfSk9JTl9GQUlMVVJFX1RJTUVPVVRfREVGQVVMVDsKKyAgICAgICAgfQorICAgICAgICAvL3ZhbGlkYXRlIENCCisgICAgICAgIHBCc3NDb25maWctPmNiTW9kZSA9IGNzckdldENCTW9kZUZyb21JZXMocE1hYywgcEJzc0Rlc2MtPmNoYW5uZWxJZCwgcEllcyk7CisgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCBGTCgiQnNzIENiIGlzICVkLCBqb2luIHRpbWVvdXQgaXMgJWQsIEhCIHRocmVzaCBpcyAlZCwiKSwKKyAgICAgICAgICAgICAgIHBCc3NDb25maWctPmNiTW9kZSwgcEJzc0NvbmZpZy0+dUpvaW5UaW1lT3V0LCAgcEJzc0NvbmZpZy0+dUhlYXJ0QmVhdFRocmVzaCk7CisgICAgfXdoaWxlKDApOworICAgIHJldHVybiAoc3RhdHVzKTsKK30KKworc3RhdGljIGVIYWxTdGF0dXMgY3NyUm9hbVByZXBhcmVCc3NDb25maWdGcm9tUHJvZmlsZSh0cEFuaVNpckdsb2JhbCBwTWFjLCB0Q3NyUm9hbVByb2ZpbGUgKnBQcm9maWxlLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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ICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVDU1JfQVVUSF9UWVBFX1NIQVJFRF9LRVk6CisgICAgICAgICAgICBwQnNzQ29uZmlnLT5hdXRoVHlwZSA9IGVTSVJfU0hBUkVEX0tFWTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVDU1JfQVVUSF9UWVBFX0FVVE9TV0lUQ0g6CisgICAgICAgICAgICBwQnNzQ29uZmlnLT5hdXRoVHlwZSA9IGVTSVJfQVVUT19TV0lUQ0g7CisgICAgICAgICAgICBicmVhazsKKyAgICB9CisgICAgLy9zaG9ydCBzbG90IHRpbWUKKyAgICBpZiggV05JX0NGR19QSFlfTU9ERV8xMUIgIT0gcEJzc0NvbmZpZy0+dUNmZ0RvdDExTW9kZSApCisgICAgeworICAgICAgICBwQnNzQ29uZmlnLT51U2hvcnRTbG90VGltZSA9IHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uc2hvcnRTbG90VGltZTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgcEJzc0NvbmZpZy0+dVNob3J0U2xvdFRpbWUgPSAwOworICAgIH0KKyAgICAvL3Bvd2VyIGNvbnN0cmFpbnQuIFdlIGRvbid0IHN1cHBvcnQgMTFoIG9uIElCU1MKKyAgICBwQnNzQ29uZmlnLT5mMTFoU3VwcG9ydCA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICBwQnNzQ29uZmlnLT51UG93ZXJMaW1pdCA9IDA7CisgICAgLy9oZWFydGJlYXQKKyAgICBpZiAoIGVDU1JfQkFORF81RyA9PSBwQnNzQ29uZmlnLT5lQmFuZCApCisgICAgeworICAgICAgICBwQnNzQ29uZmlnLT51SGVhcnRCZWF0VGhyZXNoID0gcE1hYy0+cm9hbS5jb25maWdQYXJhbS5IZWFydGJlYXRUaHJlc2g1MDsgICAgICAgIAorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBwQnNzQ29uZmlnLT51SGVhcnRCZWF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ZHX1dFUF9ERUZBVUxUX0tFWV8yX0xFTiBdOworICAgIHRBTklfVTggS2V5MlsgV05JX0NGR19XRVBfREVGQVVMVF9LRVlfM19MRU4gXTsKKyAgICB0QU5JX1U4IEtleTNbIFdOSV9DRkdfV0VQX0RFRkFVTFRfS0VZXzRfTEVOIF07CisgICAgCisgICAgc3dpdGNoICggcFByb2ZpbGUtPm5lZ290aWF0ZWRVQ0VuY3J5cHRpb25UeXBlICkKKyAgICB7CisgICAgICAgIGNhc2UgZUNTUl9FTkNSWVBUX1RZUEVfTk9ORToKKyAgICAgICAgCisgICAgICAgICAgICAvLyBmb3IgTk8gZW5jcnlwdGlvbiwgdHVybiBvZmYgUHJpdmFjeSBhbmQgUnNuLgorICAgICAgICAgICAgUHJpdmFjeUVuYWJsZWQgPSAwOyAgICAgICAgICAgCisgICAgICAgICAgICBSc25FbmFibGVkID0gMDsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgLy8gV0VQIGtleSBsZW5ndGggYW5kIFdlcCBEZWZhdWx0IEtleSBJRCBkb24ndCBtYXR0ZXIgaW4gdGhpcyBjYXNlLi4uLgorICAgICAgICAgICAgCisgICAgICAgICAgICAvLyBjbGVhciBvdXQgdGhlIFdFUCBrZXlzIHRoYXQgbWF5IGJlIGhhbmdpbmcgYXJvdW5kLgorICAgICAgICAgICAgS2V5MExlbmd0aCA9IDA7CisgICAgICAgICAgICBLZXkxTGVuZ3RoID0gMDsKKyAgICAgICAgICAgIEtleTJMZW5ndGggPSAwOworICAgICAgICAgICAgS2V5M0xlbmd0aCA9IDA7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgCisgICAgICAgIGNhc2UgZUNTUl9FTkNSWVBUX1RZUEVfV0VQNDBfU1RBVElDS0VZOgorICAgICAgICBjYXNlIGVDU1JfRU5DUllQVF9UWVBFX1dFUDQwOgorICAgICAgICAgICAgCisgICAgICAgICAgICAvLyBQcml2YWN5IGlzIE9OLiAgTk8gUlNOIGZvciBXZXA0MCBzdGF0aWMga2V5LgorICAgICAgICAgICAgUHJpdmFjeUVuYWJsZWQgPSAxOyAgICAgICAgICAgCisgICAgICAgICAgICBSc25FbmFibGVkID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgLy8gU2V0IHRoZSBXZXAgZGVmYXVsdCBrZXkgSUQuCisgICAgICAgICAgICBXZXBEZWZhdWx0S2V5SWQgPSBwUHJvZmlsZS0+S2V5cy5kZWZhdWx0SW5kZXg7CisgICAgICAgICAgICAvLyBXZXAga2V5IHNpemUgaWYgNSBieXRlcyAoNDAgYml0cykuCisgICAgICAgICAgICBXZXBLZXlMZW5ndGggPSBXTklfQ0ZHX1dFUF9LRVlfTEVOR1RIXzU7ICAgICAgICAgICAgCisgICAgICAgICAgICAKKyAgICAgICAgICAgIC8vIHNldCBlbmNyeXB0aW9uIGtleXMgaW4gdGhlIENGRyBkYXRhYmFzZSBvciBjbGVhciB0aG9zZSB0aGF0IGFyZSBub3QgcHJlc2VudCBpbiB0aGlzIHByb2ZpbGUuCisgICAgICAgICAgICBpZiAoIHBQcm9maWxlLT5LZXlzLktleUxlbmd0aFswXSApIAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShLZXkwLCBwUHJvZmlsZS0+S2V5cy5LZXlNYXRlcmlhbFswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19XRVBfS0VZX0xFTkdUSF81KTsKKyAgICAgICAgICAgICAgICBLZXkwTGVuZ3RoID0gV05JX0NGR19XRVBfS0VZX0xFTkdUSF81OworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEtleTBMZW5ndGggPSAwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBpZiAoIHBQcm9maWxlLT5LZXlzLktleUxlbmd0aFsxXSApIAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KEtleTEsIHBQcm9maWxlLT5LZXlzLktleU1hdGVyaWFsWzFdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfV0VQX0tFWV9MRU5HVEhfNSk7CisgICAgICAgICAgICAgICBLZXkxTGVuZ3RoID0gV05JX0NGR19XRVBfS0VZX0xFTkdUSF81OworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEtleTFMZW5ndGggPSAwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBpZiAoIHBQcm9maWxlLT5LZXlzLktleUxlbmd0aFsyXSApIAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShLZXkyLCBwUHJvZmlsZS0+S2V5cy5LZXlNYXRlcmlhbFsyXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19XRVBfS0VZX0xFTkdUSF81KTsKKyAgICAgICAgICAgICAgICBLZXkyTGVuZ3RoID0gV05JX0NGR19XRVBfS0VZX0xFTkdUSF81OyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBLZXkyTGVuZ3RoID0gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKCBwUHJvZmlsZS0+S2V5cy5LZXlMZW5ndGhbM10gKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoS2V5MywgcFByb2ZpbGUtPktleXMuS2V5TWF0ZXJpYWxbM10sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfV0VQX0tFWV9MRU5HVEhfNSk7CisgICAgICAgICAgICAgICAgS2V5M0xlbmd0aCA9IFdOSV9DRkdfV0VQX0tFWV9MRU5HVEhfNTsgICAgICAgICAgICAgICAgCisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgS2V5M0xlbmd0aCA9IDA7CisgICAgICAgICAgICB9ICAgICAgCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgCisgICAgICAgIGNhc2UgZUNTUl9FTkNSWVBUX1RZUEVfV0VQMTA0X1NUQVRJQ0tFWToKKyAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVAxMDQ6CisgICAgICAgICAgICAKKyAgICAgICAgICAgIC8vIFByaXZhY3kgaXMgT04uICBOTyBSU04gZm9yIFdlcDQwIHN0YXRpYyBrZXkuCisgICAgICAgICAgICBQcml2YWN5RW5hYmxlZCA9IDE7ICAgICAgICAgICAKKyAgICAgICAgICAgIFJzbkVuYWJsZWQgPSAwOworICAgICAgICAgICAgCisgICAgICAgICAgICAvLyBTZXQgdGhlIFdlcCBkZWZhdWx0IGtleSBJRC4KKyAgICAgICAgICAgIFdlcERlZmF1bHRLZXlJZCA9IHBQcm9maWxlLT5LZXlzLmRlZmF1bHRJbmRleDsKKyAgICAgICAgICAgCisgICAgICAgICAgICAvLyBXZXAga2V5IHNpemUgaWYgMTMgYnl0ZXMgKDEwNCBiaXRzKS4KKyAgICAgICAgICAgIFdlcEtleUxlbmd0aCA9IFdOSV9DRkdfV0VQX0tFWV9MRU5HVEhfMTM7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIC8vIHNldCBlbmNyeXB0aW9uIGtleXMgaW4gdGhlIENGRyBkYXRhYmFzZSBvciBjbGVhciB0aG9zZSB0aGF0IGFyZSBub3QgcHJlc2VudCBpbiB0aGlzIHByb2ZpbGUuCisgICAgICAgICAgICBpZiAoIHBQcm9maWxlLT5LZXlzLktleUxlbmd0aFswXSApIAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShLZXkwLCBwUHJvZmlsZS0+S2V5cy5LZXlNYXRlcmlhbFsgMCBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX1dFUF9LRVlfTEVOR1RIXzEzKTsKKyAgICAgICAgICAgICAgICBLZXkwTGVuZ3RoID0gV05JX0NGR19XRVBfS0VZX0xFTkdUSF8xMzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBLZXkwTGVuZ3RoID0gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKCBwUHJvZmlsZS0+S2V5cy5LZXlMZW5ndGhbMV0gKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoS2V5MSwgcFByb2ZpbGUtPktleXMuS2V5TWF0ZXJpYWxbIDEgXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19XRVBfS0VZX0xFTkdUSF8xMyk7CisgICAgICAgICAgICAgICAgS2V5MUxlbmd0aCA9IFdOSV9DRkdfV0VQX0tFWV9MRU5HVEhfMTM7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgS2V5MUxlbmd0aCA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmICggcFByb2ZpbGUtPktleXMuS2V5TGVuZ3RoWzJdICkgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KEtleTIsIHBQcm9maWxlLT5LZXlzLktleU1hdGVyaWFsWyAyIF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfV0VQX0tFWV9MRU5HVEhfMTMpOworICAgICAgICAgICAgICAgIEtleTJMZW5ndGggPSBXTklfQ0ZHX1dFUF9LRVlfTEVOR1RIXzEzOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEtleTJMZW5ndGggPSAwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBpZiAoIHBQcm9maWxlLT5LZXlzLktleUxlbmd0aFszXSApIAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShLZXkzLCBwUHJvZmlsZS0+S2V5cy5LZXlNYXRlcmlhbFsgMyBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX1dFUF9LRVlfTEVOR1RIXzEzKTsKKyAgICAgICAgICAgICAgICBLZXkzTGVuZ3RoID0gV05JX0NGR19XRVBfS0VZX0xFTkdUSF8xMzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBLZXkzTGVuZ3RoID0gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgCisgICAgICAgIGNhc2UgZUNTUl9FTkNSWVBUX1RZUEVfVEtJUDoKKyAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9BRVM6CisjaWZkZWYgRkVBVFVSRV9XTEFOX1dBUEkKKyAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9XUEk6CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX1dBUEkgKi8KKyAgICAgICAgICAgIC8vICEhIE5vdGU6ICB0aGlzIGlzIHRoZSBvbmx5IGRpZmZlcmVuY2UgYmV0d2VlbiB0aGlzIGZ1bmN0aW9uIGFuZCB0aGUgY3NyU2V0Q2ZnUHJpdmFjeUZyb21Qcm9maWxlKCkKKyAgICAgICAgICAgIC8vIChzZXR0aW5nIG9mIHRoZSBwcml2YWN5IENGRyBiYXNlZCBvbiB0aGUgYWR2ZXJ0aXNlZCBwcml2YWN5IHNldHRpbmcgZnJvbSB0aGUgQVAgZm9yIFdQQS9XQVBJIGFzc29jaWF0aW9ucyApLiAgICAgICAgCisgICAgICAgICAgICBQcml2YWN5RW5hYmxlZCA9ICgwICE9IGZQcml2YWN5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIC8vIHR1cm4gb24gUlNOIGVuYWJsZWQgZm9yIFdQQSBhc3NvY2lhdGlvbnMgICAKKyAgICAgICAgICAgIFJzbkVuYWJsZWQgPSAxOworICAgICAgICAgICAgCisgICAgICAgICAgICAvLyBXRVAga2V5IGxlbmd0aCBhbmQgV2VwIERlZmF1bHQgS2V5IElEIGRvbid0IG1hdHRlciBpbiB0aGlzIGNhc2UuLi4uCisgICAgICAgICAgICAKKyAgICAgICAgICAgIC8vIGNsZWFyIG91dCB0aGUgc3RhdGljIFdFUCBrZXlzIHRoYXQgbWF5IGJlIGhhbmdpbmcgYXJvdW5kLgorICAgICAgICAgICAgS2V5MExlbmd0aCA9IDA7CisgICAgICAgICAgICBLZXkxTGVuZ3RoID0gMDsKKyAgICAgICAgICAgIEtleTJMZW5ndGggPSAwOworICAgICAgICAgICAgS2V5M0xlbmd0aCA9IDA7ICAgICAgICAKKyAgICAgICAgICAKKyAgICAgICAgICAgIGJyZWFrOyAgICAgCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBQcml2YWN5RW5hYmxlZCA9IDA7CisgICAgICAgICAgICBSc25FbmFibGVkID0gMDsKKyAgICAgICAgICAgIGJyZWFrOyAgICAgICAgICAgIAorICAgIH0gICAgICAgICAgIAorICAgIAorICAgIGNjbUNmZ1NldEludChwTWFjLCBXTklfQ0ZHX1BSSVZBQ1lfRU5BQkxFRCwgUHJpdmFjeUVuYWJsZWQsIE5VTEwsIGVBTklfQk9PTEVBTl9GQUxTRSk7CisgICAgY2NtQ2ZnU2V0SW50KHBNYWMsIFdOSV9DRkdfUlNOX0VOQUJMRUQsIFJzbkVuYWJsZWQsIE5VTEwsIGVBTklfQk9PTEVBTl9GQUxTRSk7CisgICAgY2NtQ2ZnU2V0U3Ry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LyBzdXBwb3J0ZWQgZWFybGllciBpbiB0aGUgcm9hbWluZyBkZWNpc2lvbikuCisgICAgICAgIC8vIEhvd2V2ZXIsIGl0IHR1cm5zIG91dCB0aGF0IHRoaXMgaXMgbm90IGFsd2F5cyB0aGUgY2FzZS4gIFNvbWUgQVAncworICAgICAgICAvLyAoZS5nLiBELUxpbmsgREktNzg0KSByYW0gMTFnIHJhdGVzIGludG8gdGhlIE9wZXJhdGlvbmFsIFJhdGUgc2V0LAorICAgICAgICAvLyB0b28uICBOb3csIHdlJ3JlIGEgbGl0dGxlIG1vcmUgY2FyZWZ1bDoKKyAgICAgICAgcERzdFJhdGUgPSBwT3BSYXRlU2V0LT5yYXRlOworICAgICAgICBpZihwSWVzLT5TdXBwUmF0ZXMucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgZm9yICggaSA9IDA7IGkgPCBwSWVzLT5TdXBwUmF0ZXMubnVtX3JhdGVzOyBpKysgKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoIGNzclJhdGVzSXNEb3QxMVJhdGVTdXBwb3J0ZWQoIHBNYWMsIHBJZXMtPlN1cHBSYXRlcy5yYXRlc1sgaSBdICkgKSAKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmICggIWNzcklzUmF0ZUFscmVhZHlQcmVzZW50KHBJZXMtPlN1cHBSYXRlcy5yYXRlc1sgaSBdLCByYXRlQml0bWFwKSApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNzckFkZFJhdGVCaXRtYXAocEllcy0+U3VwcFJhdGVzLnJhdGVzWyBpIF0sICZyYXRlQml0bWFwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICpwRHN0UmF0ZSsrID0gcEllcy0+U3VwcFJhdGVzLnJhdGVzWyBpIF07CisgICAgICAgICAgICAgICAgICAgICAgICBwT3BSYXRlU2V0LT5udW1SYXRlcysrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIC8qIElmIHRoZXJlIGFyZSBFeHRlbmRlZCBSYXRlcyBpbiB0aGUgYmVhY29uLCB3ZSB3aWxsIHJlZmxlY3QgdGhvc2UKKyAgICAgICAgICogZXh0ZW5kZWQgcmF0ZXMgdGhhdCB3ZSBzdXBwb3J0IGluIG91dCBFeHRlbmRlZCBPcGVyYXRpb25hbCBSYXRlCisgICAgICAgICAqIHNldCovCisgICAgICAgIHBEc3RSYXRlID0gcEV4UmF0ZVNldC0+cmF0ZTsKKyAgICAgICAgaWYocEllcy0+RXh0U3VwcFJhdGVzLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwSWVzLT5FeHRTdXBwUmF0ZXMubnVtX3JhdGVzOyBpKyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGNzclJhdGVzSXNEb3QxMVJhdGVTdXBwb3J0ZWQocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZXMtPkV4dFN1cHBSYXRlcy5yYXRlc1sgaSBdKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmICghY3NySXNSYXRlQWxyZWFkeVByZXNlbnQocEllcy0+RXh0U3VwcFJhdGVzLnJhdGVzW2ldLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmF0ZUJpdG1hcCkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNzckFkZFJhdGVCaXRtYXAocEllcy0+RXh0U3VwcFJhdGVzLnJhdGVzW2ldLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnJhdGVCaXRtYXApOworICAgICAgICAgICAgICAgICAgICAgICAgKnBEc3RSYXRlKysgPSBwSWVzLT5FeHRTdXBwUmF0ZXMucmF0ZXNbaV07CisgICAgICAgICAgICAgICAgICAgICAgICBwRXhSYXRlU2V0LT5udW1SYXRlcysrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgICpwUmF0ZUJpdG1hcCA9IHJhdGVCaXRtYXA7CisgICAgfS8vUGFyc2luZyBCU1NEZXNjCisgICAgZWxzZQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJmYWlsZWQgdG8gcGFyc2UgQnNzRGVzYyIpKTsKKyAgICB9CisgICAgaWYgKHBPcFJhdGVTZXQtPm51bVJhdGVzID4gMCB8fCBwRXhSYXRlU2V0LT5udW1SYXRlcyA+IDApIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgcmV0dXJuIHN0YXR1czsKK30KKyAgICAKK3N0YXRpYyB2b2lkIGNzclNldENmZ1JhdGVTZXQoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIGVDc3JQaHlNb2RlIHBoeU1vZGUsIHRDc3JSb2FtUHJvZmlsZSAqcFByb2ZpbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyQnNzRGVzY3JpcHRpb24gKnBCc3NEZXNjLCB0RG90MTFmQmVhY29uSUVzICpwSWVzKQoreworICAgIGludCBpOworICAgIHRBTklfVTggKnBEc3RSYXRlOworICAgIGVDc3JDZmdEb3QxMU1vZGUgY2ZnRG90MTFNb2RlOworICAgIHRBTklfVTggT3BlcmF0aW9uYWxSYXRlc1sgQ1NSX0RPVDExX1NVUFBPUlRFRF9SQVRFU19NQVggXTsgICAgLy8gbGVhdmUgZW5vdWdoIHJvb20gZm9yIHRoZSBtYXggbnVtYmVyIG9mIHJhdGVzCisgICAgdEFOSV9VMzIgT3BlcmF0aW9uYWxSYXRlc0xlbmd0aCA9ID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AgICAgICAgICAgICAgKnBEc3RSYXRlKysgPSBwSWVzLT5TdXBwUmF0ZXMucmF0ZXNbIGkgXTsKKyAgICAgICAgICAgICAgICAgICAgT3BlcmF0aW9uYWxSYXRlc0xlbmd0aCsrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAoIGVDU1JfQ0ZHX0RPVDExX01PREVfMTFHID09IGNmZ0RvdDExTW9kZSB8fCAKKyAgICAgICAgICAgICBlQ1NSX0NGR19ET1QxMV9NT0RFXzExTiA9PSBjZmdEb3QxMU1vZGUgfHwKKyAgICAgICAgICAgICBlQ1NSX0NGR19ET1QxMV9NT0RFX1RBVVJVUyA9PSBjZmdEb3QxMU1vZGUgfHwKKyAgICAgICAgICAgICBlQ1NSX0NGR19ET1QxMV9NT0RFX0FCRyA9PSBjZmdEb3QxMU1vZGUgKQorICAgICAgICB7CisgICAgICAgICAgICAvLyBJZiB0aGVyZSBhcmUgRXh0ZW5kZWQgUmF0ZXMgaW4gdGhlIGJlYWNvbiwgd2Ugd2lsbCByZWZsZWN0IHRob3NlCisgICAgICAgICAgICAvLyBleHRlbmRlZCByYXRlcyB0aGF0IHdlIHN1cHBvcnQgaW4gb3V0IEV4dGVuZGVkIE9wZXJhdGlvbmFsIFJhdGUKKyAgICAgICAgICAgIC8vIHNldDoKKyAgICAgICAgICAgIHBEc3RSYXRlID0gRXh0ZW5kZWRPcGVyYXRpb25hbFJhdGVzOworICAgICAgICAgICAgaWYocEllcy0+RXh0U3VwcFJhdGVzLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZm9yICggaSA9IDA7IGkgPCBwSWVzLT5FeHRTdXBwUmF0ZXMubnVtX3JhdGVzOyBpKysgKSAKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmICggY3NyUmF0ZXNJc0RvdDExUmF0ZVN1cHBvcnRlZCggcE1hYywgcEllcy0+RXh0U3VwcFJhdGVzLnJhdGVzWyBpIF0gKSAmJgorICAgICAgICAgICAgICAgICAgICAgKCBFeHRlbmRlZE9wZXJhdGlvbmFsUmF0ZXNMZW5ndGggPCBDU1JfRE9UMTFfRVhURU5ERURfU1VQUE9SVEVEX1JBVEVTX01BWCApKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAqcERzdFJhdGUrKyA9IHBJZXMtPkV4dFN1cHBSYXRlcy5yYXRlc1sgaSBdOworICAgICAgICAgICAgICAgICAgICAgICAgRXh0ZW5kZWRPcGVyYXRpb25hbFJhdGVzTGVuZ3RoKys7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgLy8gRW5hYmxlIHByb3ByaWV0YXJ5IE1BQyBmZWF0dXJlcyBpZiBwZWVyIG5vZGUgaXMgQWlyZ28gbm9kZSBhbmQgU1RBCisgICAgICAgIC8vIHVzZXIgd2FudHMgdG8gdXNlIHRoZW0KKyAgICAgICAgaWYoIHBJZXMtPkFpcmdvLnByZXNlbnQgJiYgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5Qcm9wcmlldGFyeVJhdGVzRW5hYmxlZCApCisgICAgICAgIHsKKyAgICAgICAgICAgIFByb3BSYXRlc0VuYWJsZSA9IDE7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBQcm9wUmF0ZXNFbmFibGUgPSAwOworICAgICAgICB9CisgICAgICAgIC8vIEZvciBBTkkgbmV0d29yayBjb21wYW5pb25zLCB3ZSBuZWVkIHRvIHBvcHVsYXRlIHRoZSBwcm9wcmlldGFyeSByYXRlCisgICAgICAgIC8vIHNldCB3aXRoIGFueSBwcm9wcmlldGFyeSByYXRlcyB3ZSBmb3VuZCBpbiB0aGUgYmVhY29uLCBvbmx5IGlmIHVzZXIKKyAgICAgICAgLy8gYWxsb3dzIHRoZW0uLi4KKy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ICAgICAgICB7CisgICAgICAgICAgIGZvciAoIGkgPSAwOyBpIDwgVkFMSURfTUFYX01DU19JTkRFWDsgaSsrICkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoICh1bnNpZ25lZCBpbnQpcEllcy0+SFRDYXBzLnN1cHBvcnRlZE1DU1NldFswXSAmICgxIDw8IGkpICkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBNQ1NSYXRlTGVuZ3RoKys7CisgICAgICAgICAgICAgICAgICpwRHN0UmF0ZSsrID0gaTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgLy8gU2V0IHRoZSBvcGVyYXRpb25hbCByYXRlIHNldCBDRkcgdmFyaWFibGVzLi4uCisgICAgICAgIGNjbUNmZ1NldFN0cihwTWFjLCBXTklfQ0ZHX09QRVJBVElPTkFMX1JBVEVfU0VULCBPcGVyYXRpb25hbFJhdGVzLCAKKyAgICAgICAgICAgICAgICAgICAgICAgIE9wZXJhdGlvbmFsUmF0ZXNMZW5ndGgsIE5VTEwsIGVBTklfQk9PTEVBTl9GQUxTRSk7CisgICAgICAgIGNjbUNmZ1NldFN0cihwTWFjLCBXTklfQ0ZHX0VYVEVOREVEX09QRVJBVElPTkFMX1JBVEVfU0VULCBFeHRlbmRlZE9wZXJhdGlvbmFsUmF0ZXMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dGVuZGVkT3BlcmF0aW9uYWxSYXRlc0xlbmd0aCwgTlVMTCwgZUFOSV9CT09MRUFOX0ZBTFNFKTsKKyAgICAgICAgY2NtQ2ZnU2V0U3RyKHBNYWMsIFdOSV9DRkdfUFJPUFJJRVRBUllfT1BFUkFUSU9OQUxfUkFURV9TRVQsIAorICAgICAgICAgICAgICAgICAgICAgICAgUHJvcHJpZXRhcnlPcGVyYXRpb25hbFJhdGVzLCAKKyAgICAgICAgICAgICAgICAgICAgICAgIFByb3ByaWV0YXJ5T3BlcmF0aW9uYWxSYXRlc0xlbmd0aCwgTlVMTCwgZUFOSV9CT09MRUFOX0ZBTFNFKTsKKyAgICAgICAgY2NtQ2ZnU2V0SW50KHBNYWMsIFdOSV9DRkdfUFJPUFJJRVRBUllfQU5JX0ZFQVRVUkVTX0VOQUJMRUQsIFByb3BSYXRlc0VuYWJsZSwgTlVMTCwgZUFOSV9CT09MRUFOX0ZBTFNFKTsKKyAgICAgICAgY2NtQ2ZnU2V0U3RyKHBNYWMsIFdOSV9DRkdfQ1VSUkVOVF9NQ1NfU0VULCBNQ1NSYXRlSWR4U2V0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgIE1DU1JhdGVMZW5ndGgsIE5VTEwsIGVBTklfQk9PTEVBTl9GQUxTRSk7ICAgICAgICAKKyAgICB9Ly9QYXJzaW5nIEJTU0Rlc2MKKyAgICBlbHNlCisgICAgeworICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoImZhaWxlZCB0byBwYXJzZSBCc3NEZXNjIikpOworICAgIH0KK30KKworc3RhdGljIHZvaWQgY3NyU2V0Q2ZnUmF0ZVNldEZyb21Qcm9maWxlKCB0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Q3NyUm9hbVByb2ZpbGUgKnBQcm9maWxlICApCit7CisgICAgdFNpck1hY1JhdGVTZXRJRSBEZWZhdWx0U3VwcG9ydGVkUmF0ZXMxMWEgPSB7ICBTSVJfTUFDX1JBVEVTRVRfRUlELCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgOCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgU0lSX01BQ19SQVRFXzYsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX01BQ19SQVRFXzksIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX01BQ19SQVRFXzEyLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfUkFURV8xOCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfUkFURV8yNCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfUkFURV8zNiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfUkFURV80OCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX1JBVEVfNTQgIH0gfSB9OworICAgIHRTaXJNYWNSYXRlU2V0SUUgRGVmYXVsdFN1cHBvcnRlZFJhdGVzMTFiID0geyAgU0lSX01BQ19SQVRFU0VUX0VJRCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IFNJUl9NQUNfUkFURV8xLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfUkFURV8yLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfUkFURV81XzUsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfUkFURV8xMSAgfSB9IH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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F0ZXNMZW5ndGggPSBEZWZhdWx0U3VwcG9ydGVkUmF0ZXMxMWEuc3VwcG9ydGVkUmF0ZVNldC5udW1SYXRlcyAqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZigqRGVmYXVsdFN1cHBvcnRlZFJhdGVzMTFhLnN1cHBvcnRlZFJhdGVTZXQucmF0ZSk7CisgICAgICAgIHZvc19tZW1fY29weShPcGVyYXRpb25hbFJhdGVzLAorICAgICAgICAgICAgICAgICAgICAgRGVmYXVsdFN1cHBvcnRlZFJhdGVzMTFhLnN1cHBvcnRlZFJhdGVTZXQucmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgIE9wZXJhdGlvbmFsUmF0ZXNMZW5ndGgpOworICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAvLyBOb3RoaW5nIGluIHRoZSBFeHRlbmRlZCByYXRlIHNldC4KKyAgICAgICAgRXh0ZW5kZWRPcGVyYXRpb25hbFJhdGVzTGVuZ3RoID0gMDsKKyAgICAgICAgLy8gcG9wdWxhdGUgcHJvcHJpZXRhcnkgcmF0ZXMgaWYgdXNlciBhbGxvd3MgdGhlbQorICAgICAgICBpZiAoIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uUHJvcHJpZXRhcnlSYXRlc0VuYWJsZWQgKSAKKyAgICAgICAgeworICAgICAgICAgICAgUHJvcHJpZXRhcnlPcGVyYXRpb25hbFJhdGVzTGVuZ3RoID0gRGVmYXVsdFN1cHBvcnRlZFByb3BSYXRlcy5udW1Qcm9wUmF0ZXMgKiAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZigqRGVmYXVsdFN1cHBvcnRlZFByb3BSYXRlcy5wcm9wUmF0ZSk7ICAgICAgICAgCisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoUHJvcHJpZXRhcnlPcGVyYXRpb25hbFJhdGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgIERlZmF1bHRTdXBwb3J0ZWRQcm9wUmF0ZXMucHJvcFJhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgUHJvcHJpZXRhcnlPcGVyYXRpb25hbFJhdGVzTGVuZ3RoKTsKKyAgICAgICAgfSAgICAKKyAgICAgICAgZWxzZSAKKyAgICAgICAgeyAgICAgICAKKyAgICAgICAgICAgIC8vIE5vIHByb3ByaWV0YXJ5IG1vZGVzCisgICAgICAgICAgICBQcm9wcmlldGFyeU9wZXJhdGlvbmFsUmF0ZXNMZW5ndGggPSAwOyAgICAgICAgIAorICAgICAgICB9ICAgIAorICAgIH0gICAgCisgICAgZWxzZSBpZiAoIGVDU1JfQ0ZHX0RPVDExX01PREVfMTFCID09IGNmZ0RvdDExTW9kZSApIAorICAgIHsgICAgICAgCisgICAgICAgIC8vIDExYiByYXRlcyBpbnRvIHRoZSBPcGVyYXRpb25hbCBSYXRlIFNldC4gICAgICAgICAKKyAgICAgICAgT3BlcmF0aW9uYWxSYXRlc0xlbmd0aCA9IERlZmF1bHRTdXBwb3J0ZWRSYXRlczExYi5zdXBwb3J0ZWRSYXRlU2V0Lm51bVJhdGVzICoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoKkRlZmF1bHRTdXBwb3J0ZWRSYXRlczExYi5zdXBwb3J0ZWRSYXRlU2V0LnJhdGUpOworICAgICAgICB2b3NfbWVtX2NvcHkoT3BlcmF0aW9uYWxSYXRlcywKKyAgICAgICAgICAgICAgICAgICAgIERlZmF1bHRTdXBwb3J0ZWRSYXRlczExYi5zdXBwb3J0ZWRSYXRlU2V0LnJhdGUsCisgICAgICAgICAgICAgICAgICAgICBPcGVyYXRpb25hbFJhdGVzTGVuZ3RoKTsKKyAgICAgICAgLy8gTm90aGluZyBpbiB0aGUgRXh0ZW5kZWQgcmF0ZSBzZXQuCisgICAgICAgIEV4dGVuZGVkT3BlcmF0aW9uYWxSYXRlc0x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vc19tZW1fY29weShFeHRlbmRlZE9wZXJhdGlvbmFsUmF0ZXMsCisgICAgICAgICAgICAgICAgICAgICBEZWZhdWx0U3VwcG9ydGVkUmF0ZXMxMWEuc3VwcG9ydGVkUmF0ZVNldC5yYXRlLAorICAgICAgICAgICAgICAgICAgICAgRXh0ZW5kZWRPcGVyYXRpb25hbFJhdGVzTGVuZ3RoKTsKKyAgICAgICAgCisgICAgICAgIC8vIHBvcHVsYXRlIHByb3ByaWV0YXJ5IHJhdGVzIGlmIHVzZXIgYWxsb3dzIHRoZW0KKyAgICAgICAgaWYgKCBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLlByb3ByaWV0YXJ5UmF0ZXNFbmFibGVkICkgCisgICAgICAgIHsKKyAgICAgICAgICAgIFByb3ByaWV0YXJ5T3BlcmF0aW9uYWxSYXRlc0xlbmd0aCA9IERlZmF1bHRTdXBwb3J0ZWRQcm9wUmF0ZXMubnVtUHJvcFJhdGVzICoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZigqRGVmYXVsdFN1cHBvcnRlZFByb3BSYXRlcy5wcm9wUmF0ZSk7ICAgICAgICAgCisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoUHJvcHJpZXRhcnlPcGVyYXRpb25hbFJhdGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgIERlZmF1bHRTdXBwb3J0ZWRQcm9wUmF0ZXMucHJvcFJhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgUHJvcHJpZXRhcnlPcGVyYXRpb25hbFJhdGVzTGVuZ3RoKTsKKyAgICAgICAgfSAgCisgICAgICAgIGVsc2UgCisgICAgICAgIHsgICAgICAgCisgICAgICAgICAgIC8vIE5vIHByb3ByaWV0YXJ5IG1vZGVzCisgICAgICAgICAgICBQcm9wcmlldGFyeU9wZXJhdGlvbmFsUmF0ZXNMZW5ndGggPSAwOyAgICAgICAgIAorICAgICAgICB9ICA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bHlDb3VudHJ5SW5mb3JtYXRpb24ocE1hYywgVFJVRSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYgKChjc3JJczExZFN1cHBvcnRlZCAocE1hYykpICYmIHBJZXMpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmICghcEllcy0+Q291bnRyeS5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNzclJlc2V0Q291bnRyeUluZm9ybWF0aW9uKHBNYWMsIGVBTklfQk9PTEVBTl9GQUxTRSwgZUFOSV9CT09MRUFOX0ZBTFNFICk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9MZXQncyBhbHNvIHVwZGF0ZSB0aGUgYmVsb3cgdG8gbWFrZSBzdXJlIHdlIGRvbid0IHVwZGF0ZSBDQyB3aGlsZQorICAgICAgICAgICAgICAgIC8vY29ubmVjdGVkIHRvIGFuIEFQIHdoaWNoIGlzIGFkdmVydGlzaW5nIHNvbWUgQ0MKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocE1hYy0+c2Nhbi5jdXJyZW50Q291bnRyeUJzc2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJzc0Rlc2MtPmJzc0lkLCBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICAvL1FvcworICAgIGNzclNldFFvc1RvQ2ZnKCBwTWFjLCBzZXNzaW9uSWQsIHBCc3NDb25maWctPnFvc1R5cGUgKTsKKyAgICAvL1NTSUQKKyAgICBjc3JTZXRDZmdTc2lkKHBNYWMsICZwQnNzQ29uZmlnLT5TU0lEICk7CisgICAgLy9mcmFnbWVudCB0aHJlc2hvbGQKKyAgICAvL2NjbUNmZ1NldEludChwTWFjLCBXTklfQ0ZHX0ZSQUdNRU5UQVRJT05fVEhSRVNIT0xELCBjc3JHZXRGcmF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SU5HICk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIGlmIHdlIGFyZSBpbiBhbiBJbmZyYXN0cnVjdHVyZSBhc3NvY2lhdGlvbi4uLi4KKyAgICAgICAgICAgICAgICBpZiAoIGNzcklzQ29ublN0YXRlSW5mcmEoIHBNYWMsIHNlc3Npb25JZCApICkgCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvLyBhbmQgdGhlIG5ldyBCc3MgaXMgYW4gSWJzcyBPUiB3ZSBhcmUgcm9hbWluZyBmcm9tIEluZnJhIHRvIEluZnJhCisgICAgICAgICAgICAgICAgICAgIC8vIGFjcm9zcyBTU0lEcyAocm9hbWluZyB0byBhIG5ldyBTU0lEKS4uLiAgICAgICAgICAgIC8vICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIC8vTm90IHdvcnJ5IGFib3V0IFdEUyBjb25uZWN0aW9uIGZvciBub3cKKyAgICAgICAgICAgICAgICAgICAgaWYgKCBwQnNzRGVzYyAmJiAoICggY3NySXNJYnNzQnNzRGVzYyggcEJzc0Rlc2MgKSApIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICFjc3JJc1NzaWRFcXVhbCggcE1hYywgcFNlc3Npb24tPnBDb25uZWN0QnNzRGVzYywgcEJzc0Rlc2MsIHBJZXMgKSApICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhlbiB3ZSBuZWVkIHRvIGRpc2Fzc29jaWF0ZSBmcm9tIHRoZSBJbmZyYXN0cnVjdHVyZSBuZXR3b3JrLi4uCisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JSb2FtSXNzdWVEaXNhc3NvY2lhdGUoIHBNYWMsIHNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ST0FNX1NVQlNUQVRFX0RJU0NPTk5FQ1RfQ09OVElOVUVfUk9BTUlORywgRkFMU0UgKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIEluIGFuIEluZnJhc3R1Y3R1cmUgYW5kIGdvaW5nIHRvIGFuIEluZnJhc3RydWN0dXJlIG5ldHdvcmsgd2l0aCB0aGUgc2FtZSBTU0lELiAgVGhpcworICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2FsbHMgZm9yIGEgUmVhc3NvY2lhdGlvbiBzZXF1ZW5jZS4gIFNvIGlzc3VlIHRoZSBDRkcgc2V0cyBmb3IgdGhpcyBuZXcgQVAuCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIHBCc3NEZXNjICkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBTZXQgcGFyYW1ldGVycyBmb3IgdGhpcyBCc3MuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbVNldEJzc0NvbmZpZ0NmZyhwTWFjLCBzZXNzaW9uSWQsIHBQcm9maWxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQnNzRGVzYywgcEJzc0NvbmZpZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVzLCBlQU5JX0JPT0xFQU5fRkFMU0UpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vIE5laWhlciBpbiBJQlNTIG5vciBpbiBJbmZyYS4gIFdlIGNhbiBnbyBhaGVhZCBhbmQgc2V0IHRoZSBDRkcgZm9yIHRuZSBuZXcgbmV0d29yay4uLgorICAgICAgICAgICAgICAgICAgICAvLyBOb3RoaW5nIHRvIHN0b3AuCisgICAgICAgICAgICAgICAgICAgIGlmICggcEJzc0Rlc2MgfHwgQ1NSX0lTX1dEU19BUCggcFByb2ZpbGUgKQorICAgICAgICAgICAgICAgICAgICAgfHwgQ1NSX0lTX0lORlJBX0FQKHBQcm9maWxlKQorICAgICAgICAgICAgICAgICAgICApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfQk9PTEVBTiAgaXMxMXJSb2FtaW5nRmxhZyA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlzMTFyUm9hbWluZ0ZsYWcgPSBjc3JSb2FtSXMxMXJBc3NvYyhwTWFjKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNldCBwYXJhbWV0ZXJzIGZvciB0aGlzIEJzcy4KKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1TZXRCc3NDb25maWdDZmcocE1hYywgc2Vzc2lvbklkLCBwUHJvZmlsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJzc0Rlc2MsIHBCc3NDb25maWcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZXMsIGlzMTFyUm9hbWluZ0ZsYWcpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9Ly9TdWNjZXNzIGdldHRpbmcgQlNTIGNvbmZpZyBpbmZvCisgICAgICAgIHZvc19tZW1fZnJlZShwQnNzQ29uZmlnKTsKKyAgICB9Ly9BbGxvY2F0ZSBtZW1vcnkKKyAgICByZXR1cm4gKHN0YX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isgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHRCc3NDb25maWdQYXJhbSBic3NDb25maWc7CisgICAgICAgICAgICAgICAgICAgIC8vVGhlIGtleSBjaGFuZ2VzCisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fc2V0KCZic3NDb25maWcsIHNpemVvZihic3NDb25maWcpLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbVByZXBhcmVCc3NDb25maWcocE1hYywgcFByb2ZpbGUsIHBCc3NEZXNjLCAmYnNzQ29uZmlnLCBwSWVzTG9jYWwpOworICAgICAgICAgICAgICAgICAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPmJzc1BhcmFtcy51Q2ZnRG90MTFNb2RlID0gYnNzQ29uZmlnLnVDZmdEb3QxMU1vZGU7CisgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+YnNzUGFyYW1zLmNiTW9kZSA9IGJzc0NvbmZpZy5jYk1vZGU7CisgICAgICAgICAgICAgICAgICAgICAgICAvL1JlYXBwbHkgdGhlIGNvbmZpZyBpbmNsdWRpbmcgS2V5cyBzbyByZWFzc29jIGlzIGhhcHBlbmluZy4KKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1TZXRCc3NDb25maWdDZmcocE1hYywgc2Vzc2lvbklkLCBwUHJvZmlsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJzc0Rlc2MsICZic3NDb25maWcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZXNMb2NhbCwgZUFOSV9CT09MRUFOX0ZBTFNFKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlUm9hbVN0YXRlID0gZUNzclN0b3BSb2FtaW5nOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZVJvYW1TdGF0ZSA9IGVDc3JTdG9wUm9hbWluZzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0vL3NhbWUgcHJvZmlsZQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1MoY3NyUm9hbUlzc3VlRGlzYXNzb2NpYXRlKCBwTWFjLCBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfUk9BTV9TVUJTVEFURV9ESVNBU1NPQ19SRVEsIEZBTFNFICkpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgIGZhaWwgdG8gaXNzdWUgZGlzYXNzb2NpYXRlIHdpdGggU2Vzc2lvbiBJRCAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCk7CisgICAgICAgICAgICAgICAgICAgIGVSb2FtU3RhdGUgPSBlQ3NyU3RvcFJvYW1pbmc7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLy8gbm90ZTogIHdlIHVzZWQgdG8gcHJlLWF1dGggaGVyZSB3aXRoIG9wZW4gYXV0aGVudGljYXRpb24gbmV0d29ya3MgYnV0IHRoYXQgd2FzIG5vdCB3b3JraW5nIHNvIHdlbGwuCisgICAgICAgICAgICAvLyBzdG9wIHRoZSBleGlzdGluZyBuZXR3b3JrIGJlZm9yZSBhdHRlbXB0aW5nIHRvIGpvaW4gdGhlIG5ldyBuZXR3b3JrLi4uCisgICAgICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhjc3JSb2FtU3RvcE5ldHdvcmsocE1hYywgc2Vzc2lvbklkLCBwUHJvZmlsZSwgcEJzc0Rlc2MsIHBJZXNMb2NhbCkpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGVSb2FtU3RhdGUgPSBlQ3NyU3RvcFJvYW1pbmc7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgfS8vSW5mcmEKKyAgICBlbHNlCisgICAgeworICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhjc3JSb2FtU3RvcE5ldHdvcmsocE1hYywgc2Vzc2lvbklkLCBwUHJvZmlsZSwgcEJzc0Rlc2MsIHBJZXNMb2NhbCkpKQorICAgICAgICB7CisgICAgICAgICAgICBlUm9hbVN0YXRlID0gZUNzclN0b3BSb2FtaW5nOworICAgICAgICB9CisgICAgfQorICAgICAgICBpZiggcEllc0xvY2FsICYmICFwU2NhblJlc3VsdC0+cHZJZXMgKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocEllc0xvY2FsKTsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4oIGVSb2FtU3RhdGUgKTsKK30KKworZUhhbFN0YXR1cyBjc3JSb2FtU2hvdWxkUm9hbSh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UzMiBzZXNzaW9uSWQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyQnNzRGVzY3JpcH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RW50cnksIExMX0FDQ0VTU19MT0NLKTsKKyAgICAgICAgICAgICAgICAgICAgaWYoTlVMTCA9PSBwQ29tbWFuZC0+dS5yb2FtQ21kLnBSb2FtQnNzRW50cnkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vRG9uZSB3aXRoIGFsbCB0aGUgQlNTcworICAgICAgICAgICAgICAgICAgICAgICAgLy9JbiB0aGlzIGNhc2UsICAgd2lsbCB0ZWxsIEhERCB0aGUgY29tcGxldGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvL1dlIG5lZWQgdG8gaW5kaWNhdGUgdG8gSEREIHRoYXQgd2UgYXJlIGRvbmUgd2l0aCB0aGlzIG9uZS4KKyAgICAgICAgICAgICAgICAgICAgICAgIC8vdm9zX21lbV9zZXQoJnJvYW1JbmZvLCBzaXplb2YodENzclJvYW1JbmZvKSwgMCk7CisgICAgICAgICAgICAgICAgICAgICAgICByb2FtSW5mby5wQnNzRGVzYyA9IHBDb21tYW5kLT51LnJvYW1DbWQucExhc3RSb2FtQnNzOyAgICAgLy90aGlzIHNoYWxsIG5vdCBiZSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICByb2FtSW5mby5zdGF0dXNDb2RlID0gcFNlc3Npb24tPmpvaW5GYWlsU3RhdHVzQ29kZS5zdGF0dXNDb2RlOworICAgICAgICAgICAgICAgICAgICAgICAgcm9hbUluZm8ucmVhc29uQ29kZSA9IHBTZXNzaW9uLT5qb2luRmFpbFN0YXR1c0NvZGUucmVhc29uQ29kZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mbyA9ICZyb2FtSW5mbzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB3aGlsZShwQ29tbWFuZC0+dS5yb2FtQ21kLnBSb2FtQnNzRW50cnkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwU2NhblJlc3VsdCA9IEdFVF9CQVNFX0FERFIocENvbW1hbmQtPnUucm9hbUNtZC5wUm9hbUJzc0VudHJ5LCB0Q3NyU2NhblJlc3VsdCwgTGluayk7CisgICAgICAgICAgICAgICAgICAgIC8qSWYgY29uY3VycmVuY3kgZW5hYmxlZCB0YWtlIHRoZSBjb25jdXJyZW50IGNvbm5lY3RlZCBjaGFubmVsIGZpcnN0LiAqLworICAgICAgICAgICAgICAgICAgICAvKiBWYWxpZCBtdWx0aWNoYW5uZWwgY29uY3VycmVudCBzZXNzaW9ucyBleGVtcHRlZCAqLworICAgICAgICAgICAgICAgICAgICBpZiAodm9zX2NvbmN1cnJlbnRfb3Blbl9zZXNzaW9uc19ydW5uaW5nKCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICFjc3JJc1ZhbGlkTWNDb25jdXJyZW50U2Vzc2lvbihwTWFjLCBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBTY2FuUmVzdWx0LT5SZXN1bHQuQnNzRGVzY3JpcHRvcikpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbmN1cnJlbnRDaGFubmVsID0gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyR2V0Q29uY3VycmVudE9wZXJhdGlvbkNoYW5uZWwocE1hYyk7CisgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsICIlczogIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGNzciBDb25jdXJyZW50IENoYW5uZWwgPSAlZCIsIF9fZnVuY19fLCBjb25jdXJyZW50Q2hhbm5lbCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNvbmN1cnJlbnRDaGFubmVsKSAmJiAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbmN1cnJlbnRDaGFubmVsID09IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjYW5SZXN1bHQtPlJlc3VsdC5Cc3NEZXNjcmlwdG9yLmNoYW5uZWxJZCkpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9tYWtlIHRoaXMgMCBiZWNhdXNlIHdlIGRvIG5vdCB3YW50IHRoZSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2JlbG93IGNoZWNrIHRvIHBhc3MgYXMgd2UgZG9uJ3Qgd2FudCB0byAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2Nvbm5lY3Qgb24gb3RoZXIgY2hhbm5lbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiQ29uY3VycmVudCBjaGFubmVsIG1hdGNoID0lZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uY3VycmVudENoYW5uZWwpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmN1cnJlbnRDaGFubmVsID0gMDsgCisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoIWNvbmN1cnJlbnRDaGFubmVsKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKEhBTF9TVEFUVVNfU1VDQ0VTUyhjc3JSb2FtU2hvdWxkUm9hbShwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCwgJnBTY2FuUmVzdWx0LT5SZXN1bHQuQnNzRGVzY3JpcHRvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1JZCkpKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vT2sgdG8gcm9hbSB0aGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgZVJvYW1TdGF0ZSA9IGVDc3JTdG9wUm9hbWluZ0R1ZVRvQ29uY3VycmVuY3k7CisgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnJvYW1DbWQucFJvYW1Cc3NFbnRyeSA9IGNzckxMTmV4dCgmcEJTU0xpc3QtPkxpc3QsIHBDb21tYW5kLT51LnJvYW1DbWQucFJvYW1Cc3NFbnRyeSwgTExfQUNDRVNTX0xPQ0spOworICAgICAgICAgICAgICAgICAgICBpZihOVUxMID09IHBDb21tYW5kLT51LnJvYW1DbWQucFJvYW1Cc3NFbnRyeSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLy9Eb25lIHdpdGggYWxsIHRoZSBCU1NzCisgICAgICAgICAgICAgICAgICAgICAgICBmRG9uZSA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYoZkRvbmUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgLy9XZSBoYXZlIHNvbWV0aGluZyB0byByb2FtLCB0ZWxsIEhERCB3aGVuIGl0IGlzIGluZnJhLgorICAgICAgICAvL0ZvciBJQlNTLCB0aGUgaW5kaWNhdGlvbiBnb2VzIGJhY2sgdG8gSEREIHZpYSBlQ1NSX1JPQU1fSUJTU19JTkQKKyAgICAgICAgLy9Gb3IgV0RTLCB0aGUgaW5kaWNhdGlvbiBpcyBlQ1NSX1JPQU1fV0RTX0lORAorICAgICAgICBpZiggQ1NSX0lTX0lORlJBU1RSVUNUVVJFKCBwUHJvZmlsZSApICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYocFJvYW1JbmZvKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKHBTZXNzaW9uLT5iUmVmQXNzb2NTdGFydENudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5iUmVmQXNzb2NTdGFydENudC0tOworICAgICAgICAgICAgICAgICAgICAvL0NvbXBsZXRlIHRoZSBsYXN0IGFzc29jaWF0aW9uIGF0dGVtcCBiZWNhdXNlIGEgbmV3IG9uZSBpcyBhYm91dCB0byBiZSB0cmllZAorICAgICAgICAgICAgICAgICAgICBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIHNlc3Npb25JZCwgcFJvYW1JbmZvLCBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fQVNTT0NJQVRJT05fQ09NUExFVElPTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fUkVTVUxUX05PVF9BU1NPQ0lBVEVEKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBJZiB0aGUgcm9hbWluZyBoYXMgc3RvcHBlZCwgbm90IHRvIGNvbnRpbnVlIHRoZSByb2FtaW5nIGNvbW1hbmQqLworICAgICAgICAgICAgaWYgKCAhQ1NSX0lTX1JPQU1JTkcocFNlc3Npb24pICYmIENTUl9JU19ST0FNSU5HX0NPTU1BTkQocENvbW1hbmQpICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvL05vIG5lZWQgdG8gY29tcGxldGUgcm9hbWluZyBoZXJlIGFzIGl0IGFscmVhZHkgY29tcGxldGVzCisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csIEZMKCIgIFJvYW0gY29tbWFuZCAocmVhc29uICVkKSBhYm9ydGVkIGR1ZSB0byByb2FtaW5nIGNvbXBsZXRlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUucm9hbUNtZC5yb2FtUmVhc29uKTsKKyAgICAgICAgICAgICAgICBlUm9hbVN0YXRlID0gZUNzclN0b3BSb2FtaW5nOworICAgICAgICAgICAgICAgIGNzclNldEFib3J0Um9hbWluZ0NvbW1hbmQocE1hYywgcENvbW1hbmQpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdm9zX21lbV9zZXQoJnJvYW1JbmZvLCBzaXplb2Yocm9hbUluZm8pLCAwKTsKKyAgICAgICAgICAgIGlmKHBTY2FuUmVzdWx0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHREb3QxMWZCZWFjb25JRXMgKnBJZXNMb2NhbCA9ICh0RG90MTFmQmVhY29uSUVzICopcFNjYW5SZXN1bHQtPlJlc3VsdC5wdkllczsKKyAgICAgICAgICAgICAgICBpZiggIXBJZXNMb2NhbCAmJiAoIUhBTF9TVEFUVVNfU1VDQ0VTUyhjc3JHZXRQYXJzZWRCc3NEZXNjcmlwdGlvbklFcyhwTWFjLCAmcFNjYW5SZXN1bHQtPlJlc3VsdC5Cc3NEZXNjcmlwdG9yLCAmcEllc0xvY2FsKSkpICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiIGNhbm5vdCBwYXJzZSBJRXMiKSk7CisgICAgICAgICAgICAgICAgICAgIGZEb25lID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICAgICAgICAgIGVSb2FtU3RhdGUgPSBlQ3NyU3RvcFJvYW1pbmc7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByb2FtSW5mby5wQnNzRGVzYyA9ICZwU2NhblJlc3VsdC0+UmVzdWx0LkJzc0Rlc2NyaXB0b3I7CisgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUucm9hbUNtZC5wTGFzdFJvYW1Cc3MgPSByb2FtSW5mby5wQnNzRGVzYzsKKyAgICAgICAgICAgICAgICAvL05vIG5lZWQgdG8gcHV0IHVhcHNkX21hc2sgaW4gaWYgdGhlIEJTUyBkb2Vzbid0IHN1cHBvcnQgdUFQU0QKKyAgICAgICAgICAgICAgICBpZiggcENvbW1hbmQtPnUucm9hbUNtZC5yb2FtUHJvZmlsZS51YXBzZF9tYXNrICYmCisgICAgICAgICAgICAgICAgICAgIENTUl9JU19RT1NfQlNTKHBJZXNMb2NhbCkgJiYKKyAgICAgICAgICAgICAgICAgICAgQ1NSX0lTX1VBUFNEX0JTUyhwSWVzTG9jYWwpICkKKyAgICAgICAgICAgICAgICB7CisjaWZuZGVmIFdMQU5fTURNX0NPREVfUkVEVUNUSU9OX09QVAorICAgICAgICAgICAgICAgICAgICBhY21fbWFzayA9IHNtZV9Rb3NHZXRBQ01NYXNrKHBNYWMsICZwU2NhblJlc3VsdC0+UmVzdWx0LkJzc0Rlc2NyaXB0b3IsIAorICAgICAgICAgICAgICAgICAgICAgICAgIHBJZXNMb2NhbCk7CisjZW5kaWYgLyogV0xBTl9NRE1fQ09ERV9SRURVQ1RJT05fT1BUKi8KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUucm9hbUNtZC5yb2FtUHJvZmlsZS51YXBzZF9tYXNrID0gMDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYoIHBJZXNMb2NhbCAmJiAhcFNjYW5SZXN1bHQtPlJlc3VsdC5wdkllcykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwSWVzTG9jYWwpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1Qcm9maWxlLnVhcHNkX21hc2sgPSAwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcm9hbUluZm8ucFByb2ZpbGUgPSBwUHJvZmlsZTsKKyAgICAgICAgICAgIHBTZXNzaW9uLT5iUmVmQXNzb2NTdGFydENudCsrOworICAgICAgICAgICAgY3NyUm9hbUNhbGxDYWxsYmFjayggcE1hYywgc2Vzc2lvbklkLCAmcm9hbUluZm8sIHBDb21tYW5kLT51LnJvYW1DbWQucm9hbUlkLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfUk9BTV9BU1NPQ0lBVElPTl9TVEFSVCwgZUNTUl9ST0FNX1JFU1VMVF9OT05FICk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKCBOVUxMID09IHBDb21tYW5kLT51LnJvYW1DbWQucFJvYW1Cc3NFbnRyeSApIAorICAgICAgICB7CisgICAgICAgICAgICAvLyBJZiB0aGlzIGlzIGEgc3RhcnQgSUJTUyBwcm9maWxlLCB0aGVuIHdlIG5lZWQgdG8gc3RhcnQgdGhlIElCU1MuCisgICAgICAgICAgICBpZiAoIENTUl9JU19TVEFSVF9JQlNTKHBQcm9maWxlKSApIAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHRBTklfQk9PTEVBTiBmU2FtZUlic3MgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgICAgICAgICAgLy8gQXR0ZW1wdCB0byBzdGFydCB0aGlzIElCU1MuLi4KKyAgICAgICAgICAgICAgICBjc3JSb2FtQXNzaWduRGVmYXVsdFBhcmFtKCBwTWFjLCBwQ29tbWFuZCApOworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1TdGFydElic3MoIHBNYWMsIHNlc3Npb25JZCwgcFByb2ZpbGUsICZmU2FtZUlic3MgKTsKKyAgICAgICAgICAgICAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmICggZlNhbWVJYnNzICkgCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVSb2FtU3RhdGUgPSBlQ3NyU3RhcnRJYnNzU2FtZUlic3M7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBlUm9hbVN0YXRlID0gZUNzckNvbnRpbnVlUm9hbWluZzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvL2l0IHNvbWVob3cgZmFpbCBuZWVkIHRvIHN0b3AKKyAgICAgICAgICAgICAgICAgICAgZVJvYW1TdGF0ZSA9IGVDc3JTdG9wUm9hbWluZzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmICggKENTUl9JU19XRFNfQVAocFByb2ZpbGUpKQorICAgICAgICAgICAgIHx8IChDU1JfSVNfSU5GUkFfQVAocFByb2ZpbGUpKQorICAgICAgICAgICAgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIEF0dGVtcHQgdG8gc3RhcnQgdGhpcyBXRFMuLi4KKyAgICAgICAgICAgICAgICBjc3JSb2FtQXNzaWduRGVmYXVsdFBhcmFtKCBwTWFjLCBwQ29tbWFuZCApOworICAgICAgICAgICAgICAgIC8qIEZvciBBUCBXRFMsIHdlIGRvbnQgaGF2ZSBhbnkgQlNTRGVzY3JpcHRpb24gKi8KKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JSb2FtU3RhcnRXZHMoIHBNYWMsIHNlc3Npb25JZCwgcFByb2ZpbGUsIE5VTEwgKTsKKyAgICAgICAgICAgICAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGVSb2FtU3RhdGUgPSBlQ3NyQ29udGludWVSb2FtaW5nOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy9pdCBzb21laG93IGZhaWwgbmVlZCB0byBzdG9wCisgICAgICAgICAgICAgICAgICAgIGVSb2FtU3RhdGUgPSBlQ3NyU3RvcFJvYW1pbmc7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvL05vdGhpbmcgd2UgY2FuIGRvCisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csIEZMKCJjYW5ub3QgY29udGludWUgd2l0aG91dCBCU1MgbGlzdCIpKTsKKyAgICAgICAgICAgICAgICBlUm9hbVN0YXRlID0gZUNzclN0b3BSb2FtaW5nOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9IAorICAgICAgICBlbHNlIC8vV2UgaGF2ZSBCU1MgCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vTmVlZCB0byBhc3NpZ24gdGhlc2UgdmFsdWUgYmVjYXVzZSB0aGV5IGFyZSB1c2VkIGluIGNzcklzU2FtZVByb2ZpbGUKKyAgICAgICAgICAgIHBTY2FuUmVzdWx0ID0gR0VUX0JBU0VfQUREUihwQ29tbWFuZC0+dS5yb2FtQ21kLnBSb2FtQnNzRW50cnksIHRDc3JTY2FuUmVzdWx0LCBMaW5rKTsKKyAgICAgICAgICAgLyogVGhlIE9TRU4gSUUgZG9lc24ndCBwcm92aWRlIHRoZSBjaXBoZXIgc3VpdGUuCisgICAgICAgICAgICAqIFRoZXJlZm9yZSBzZXQgdG8gY29uc3RhbnQgdmFsdWUgb2YgQUVTICovCisgICAgICAgICAgICBpZihwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1Qcm9maWxlLmJPU0VOQXNzb2NpYXRpb24pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUucm9hbUNtZC5yb2FtUHJvZmlsZS5uZWdvdGlhdGVkVUNFbmNyeXB0aW9uVHlwZSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX0VOQ1JZUFRfVFlQRV9BRVM7CisgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUucm9hbUNtZC5yb2FtUHJvZmlsZS5uZWdvdGlhdGVkTUNFbmNyeXB0aW9uVHlwZSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX0VOQ1JZUFRfVFlQRV9BRVM7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUucm9hbUNtZC5yb2FtUHJvZmlsZS5uZWdvdGlhdGVkVUNFbmNyeXB0aW9uVHlwZSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NhblJlc3VsdC0+dWNFbmNyeXB0aW9uVHlwZTsgLy9OZWdvdGlhdGVkIHdoaWxlIGJ1aWxkaW5nIHNjYW4gcmVzdWx0LgorICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnJvYW1DbWQucm9hbVByb2ZpbGUubmVnb3RpYXRlZE1DRW5jcnlwdGlvblR5cGUgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjYW5SZXN1bHQtPm1jRW5jcnlwdGlvblR5cGU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1Qcm9maWxlLm5lZ290aWF0ZWRBdXRoVHlwZSA9IHBTY2FuUmVzdWx0LT5hdXRoVHlwZTsKKyAgICAgICAgICAgIGlmICggQ1NSX0lTX1NUQVJUX0lCU1MoJnBDb21tYW5kLT51LnJvYW1DbWQucm9hbVByb2ZpbGUpICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZihjc3JJc1NhbWVQcm9maWxlKHBNYWMsICZwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZSwgcFByb2ZpbGUpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgZVJvYW1TdGF0ZSA9IGVDc3JTdGFydElic3NTYW1lSWJzczsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfSAKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmKCBwQ29tbWFuZC0+dS5yb2FtQ21kLmZSZWFzc29jVG9TZWxmTm9DYXBDaGFuZ2UgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vdHJ5aW5nIHRvIGNvbm5lY3QgdG8gdGhlIG9uZSBhbHJlYWR5IGNvbm5lY3RlZAorICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnJvYW1DbWQuZlJlYXNzb2NUb1NlbGZOb0NhcENoYW5nZSA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgICAgICBlUm9hbVN0YXRlID0gZUNzclJlYXNzb2NUb1NlbGZOb0NhcENoYW5nZTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIEF0dGVtcHQgdG8gSm9pbiB0aGlzIEJzcy4uLgorICAgICAgICAgICAgZVJvYW1TdGF0ZSA9IGNzclJvYW1Kb2luKCBwTWFjLCBzZXNzaW9uSWQsICZwU2NhblJlc3VsdC0+UmVzdWx0LCBwUHJvZmlsZSApOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgfSB3aGlsZSggMCApOworICAgIGlmKCAoZUNzclN0b3BSb2FtaW5nID09IGVSb2FtU3RhdGUpICYmIChDU1JfSVNfSU5GUkFTVFJVQ1RVUkUoIHBQcm9maWxlICkpICkKKyAgICB7CisgICAgICAgIC8vTmVlZCB0byBpbmRpY2F0ZSBhc3NvY2lhdGlvbl9jb21wbGV0aW9uIGlmIGFzc29jaWF0aW9uX3N0YXJ0IGhhcyBiZWVuIGRvbmUKKyAgICAgICAgaWYocFNlc3Npb24tPmJSZWZBc3NvY1N0YXJ0Q250ID4gMCkKKyAgICAgICAgeworICAgICAgICAgICAgcFNlc3Npb24tPmJSZWZBc3NvY1N0YXJ0Q250LS07CisgICAgICAgICAgICAvL0NvbXBsZXRlIHRoZSBsYXN0IGFzc29jaWF0aW9uIGF0dGVtcCBiZWNhdXNlIGEgbmV3IG9uZSBpcyBhYm91dCB0byBiZSB0cmllZAorICAgICAgICAgICAgcFJvYW1JbmZvID0gJnJvYW1JbmZvOworICAgICAgICAgICAgY3NyUm9hbUNhbGxDYWxsYmFjayhwTWFjLCBzZXNzaW9uSWQsIHBSb2FtSW5mbywgcENvbW1hbmQtPnUucm9hbUNtZC5yb2FtSWQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfUk9BTV9BU1NPQ0lBVElPTl9DT01QTEVUSU9OLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fUkVTVUxUX05PVF9BU1NPQ0lBVEVEKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiggZVJvYW1TdGF0ZSApOworfQorCitzdGF0aWMgZUhhbFN0YXR1cyBjc3JSb2FtKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0U21lQ21kICpwQ29tbWFuZCApCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIGVDc3JKb2luU3RhdGUgUm9hbVN0YXRlOworICAgIHRBTklfVTMyIHNlc3Npb25JZCA9IHBDb21tYW5kLT5zZXNzaW9uSWQ7CisgICAgCisgICAgLy8qKippZiggaGRkSXNSYWRpb1N0YXRlT24oIHBBZGFwdGVyICkgKQorICAgIHsKKyAgICAgICAgLy8gQXR0ZXB0IHRvIGpvaW4gYSBCc3MuLi4KKyAgICAgICAgUm9hbVN0YXRlID0gY3NyUm9hbUpvaW5OZXh0QnNzKCBwTWFjLCBwQ29tbWFuZCwgZUFOSV9CT09MRUFOX0ZBTFNFICk7CisKKyAgICAgICAgLy8gaWYgbm90aGluZyB0byBqb2luLi4KKyAgICAgICAgaWYgKCggZUNzclN0b3BSb2FtaW5nID09IFJvYW1TdGF0ZSApIHx8ICggZUNzclN0b3BSb2FtaW5nRHVlVG9Db25jdXJyZW5jeSA9PSBSb2FtU3RhdGUpKQorICAgICAgICB7CisgICAgICAgICAgICB0QU5JX0JPT0xFQU4gZkNvbXBsZXRlID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgLy8gYW5kIGlmIGNvbm5lY3RlZCBpbiBJbmZyYXN0cnVjdHVyZSBtb2RlLi4uCisgICAgICAgICAgICBpZiAoIGNzcklzQ29ublN0YXRlSW5mcmEocE1hYywgc2Vzc2lvbklkKSApIAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vLi4uIHRoZW4gd2UgbmVlZCB0byBpc3N1ZSBhIGRpc2Fzc29jaWF0aW9uCisgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbUlzc3VlRGlzYXNzb2NpYXRlKCBwTWFjLCBzZXNzaW9uSWQsIGVDU1JfUk9BTV9TVUJTVEFURV9ESVNBU1NPQ19OT1RISU5HX1RPX0pPSU4sIEZBTFNFICk7CisgICAgICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csIEZMKCIgIGZhaWxlZCB0byBpc3N1ZSBkaXNhc3NvY2lhdGUsIHN0YXR1cyA9ICVkIiksIHN0YXR1cyk7CisgICAgICAgICAgICAgICAgICAgIC8vcm9hbSBjb21tYW5kIGlzIGNvbXBsZXRlZCBieSBjYWxsZXIgaW4gdGhlIGZhaWxlZCBjYXNlCisgICAgICAgICAgICAgICAgICAgIGZDb21wbGV0ZSA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYoIGNzcklzQ29ublN0YXRlSWJzcyhwTWFjLCBzZXNzaW9uSWQpICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JSb2FtSXNzdWVTdG9wQnNzKCBwTWFjLCBzZXNzaW9uSWQsIGVDU1JfUk9BTV9TVUJTVEFURV9TVE9QX0JTU19SRVEgKTsKKyAgICAgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywgRkwoIiAgZmFpbGVkIHRvIGlzc3VlIHN0b3AgYnNzLCBzdGF0dXMgPSAlZCIpLCBzdGF0dXMpOworICAgICAgICAgICAgICAgICAgICAvL3JvYW0gY29tbWFuZCBpcyBjb21wbGV0ZWQgYnkgY2FsbGVyIGluIHRoZSBmYWlsZWQgY2FzZQorICAgICAgICAgICAgICAgICAgICBmQ29tcGxldGUgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChjc3JJc0Nvbm5TdGF0ZUNvbm5lY3RlZEluZnJhQXAocE1hYywgc2Vzc2lvbklkKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JSb2FtSXNzdWVTdG9wQnNzKCBwTWFjLCBzZXNzaW9uSWQsIGVDU1JfUk9BTV9TVUJTVEFURV9TVE9QX0JTU19SRVEgKTsKKyAgICAgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywgRkwoIiAgZmFpbGVkIHRvIGlzc3VlIHN0b3AgYnNzLCBzdGF0dXMgPSAlZCIpLCBzdGF0dXMpOworICAgICAgICAgICAgICAgICAgICAvL3JvYW0gY29tbWFuZCBpcyBjb21wbGV0ZWQgYnkgY2FsbGVyIGluIHRoZSBmYWlsZWQgY2FzZQorICAgICAgICAgICAgICAgICAgICBmQ29tcGxldGUgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7ICAgICAgICAKKyAgICAgICAgICAgICAgICBmQ29tcGxldGUgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmKGZDb21wbGV0ZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIC8vIC4uLiBvdGhlcndpc2UsIHdlIGNhbiBjb21wbGV0ZSB0aGUgUm9hbSBjb21tYW5kIGhlcmUuCisgICAgICAgICAgICAgICBpZihlQ3NyU3RvcFJvYW1pbmdEdWVUb0NvbmN1cnJlbmN5ID09IFJvYW1TdGF0ZSkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBjc3JSb2FtQ29tcGxldGUoIHBNYWMsIGVDc3JKb2luRmFpbHVyZUR1ZVRvQ29uY3VycmVuY3ksIE5VTEwgKTsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBjc3JSb2FtQ29tcGxldGUoIHBNYWMsIGVDc3JOb3RoaW5nVG9Kb2luLCBOVUxMICk7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9ICAgIAorICAgICAgIH0KKyAgICAgICBlbHNlIGlmICggZUNzclJlYXNzb2NUb1NlbGZOb0NhcENoYW5nZSA9PSBSb2FtU3RhdGUgKQorICAgICAgIHsKKyAgICAgICAgICAgY3NyUm9hbUNvbXBsZXRlKCBwTWFjLCBlQ3NyU2lsZW50bHlTdG9wUm9hbWluZ1NhdmVTdGF0ZSwgTlVMTCApOworICAgICAgIH0KKyAgICAgICBlbHNlIGlmICggZUNzclN0YXJ0SWJzc1NhbWVJYnNzID09IFJvYW1TdGF0ZSApCisgICAgICAgeworICAgICAgICAgICBjc3JSb2FtQ29tcGxldGUoIHBNYWMsIGVDc3JTaWxlbnRseVN0b3BSb2FtaW5nLCBOVUxMICk7ICAgICAgICAKKyAgICAgICB9CisgICAgfS8vaGRkSXNSYWRpb1N0YXRlT24KKyAgICAKKyAgICByZXR1cm4gc3RhdHVzOworfQorZUhhbFN0YXR1cyBjc3JQcm9jZX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Sk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcm9hbUluZm8ucmVhc29uQ29kZSA9IGVDc3JSb2FtUmVhc29uU3RhQ2FwYWJpbGl0eUNoYW5nZWQ7CisgICAgICAgICAgICAgICAgY3NyUm9hbUNhbGxDYWxsYmFjayhwTWFjLCBwU2Vzc2lvbi0+c2Vzc2lvbklkLCAmcm9hbUluZm8sIDAsIGVDU1JfUk9BTV9ST0FNSU5HX1NUQVJULCBlQ1NSX1JPQU1fUkVTVUxUX05PTkUpOworICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5yb2FtaW5nUmVhc29uID0gZUNzclJlYXNzb2NSb2FtaW5nOworICAgICAgICAgICAgICAgIHJvYW1JbmZvLnBCc3NEZXNjID0gcFNlc3Npb24tPnBDb25uZWN0QnNzRGVzYzsKKyAgICAgICAgICAgICAgICByb2FtSW5mby5wUHJvZmlsZSA9ICZwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1Qcm9maWxlOworICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5iUmVmQXNzb2NTdGFydENudCsrOworICAgICAgICAgICAgICAgIGNzclJvYW1DYWxsQ2FsbGJhY2soIHBNYWMsIHNlc3Npb25JZCwgJnJvYW1JbmZvLCBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1JZCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ST0FNX0FTU09DSUFUSU9OX1NUQVJULCBlQ1NSX1JPQU1fUkVTVUxUX05PTkUgKTsKKyAgIAorICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCBGTCgiICBjYWxsaW5nIGNzclJvYW1Jc3N1ZVJlYXNzb2NpYXRlIikpOworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1Jc3N1ZVJlYXNzb2NpYXRlKCBwTWFjLCBzZXNzaW9uSWQsIHBTZXNzaW9uLT5wQ29ubmVjdEJzc0Rlc2MsIHBJZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1Qcm9maWxlICk7CisgICAgICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJjc3JSb2FtSXNzdWVSZWFzc29jaWF0ZSBmYWlsZWQgd2l0aCBzdGF0dXMgJWQiKSwgc3RhdHVzKTsKKyAgICAgICAgICAgICAgICAgICAgY3NyUmVsZWFzZUNvbW1hbmRSb2FtKCBwTWFjLCBwQ29tbWFuZCApOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwSWVzKTsKKyAgICAgICAgICAgICAgICBwSWVzID0gTlVMTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBlQ3NyQ2Fwc0NoYW5nZToKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJyZWNlaXZlZCBlQ3NyQ2Fwc0NoYW5nZSAiKSk7CisgICAgICAgIGNzclJvYW1TdGF0ZUNoYW5nZSggcE1hYywgZUNTUl9ST0FNSU5HX1NUQVRFX0pPSU5JTkcsIHNlc3Npb25JZCApOworICAgICAgICBzdGF0dXMgPSBjc3JSb2FtSXNzdWVEaXNhc3NvY2lhdGUoIHBNYWMsIHNlc3Npb25JZCwgZUNTUl9ST0FNX1NVQlNUQVRFX0RJU0NPTk5FQ1RfQ09OVElOVUVfUk9BTUlORywgRkFMU0UpOyAKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBlQ3NyU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gICAgIC8vd2UgbmVlZCB0byBwcm9jZXNzIHRoZSByZXN1bHQgZmlyc3QgYmVmb3JlIHJlbW92aW5nIGl0IGZyb20gYWN0aXZlIGxpc3QgYmVjYXVzZSBzdGF0ZSBjaGFuZ2VzIAorICAgICAgICAgICAgLy9zdGlsbCBoYXBwZW5pbmcgaW5zaWRlcyByb2FtUVByb2Nlc3NSb2FtUmVzdWx0cyBzbyBubyBvdGhlciByb2FtIGNvbW1hbmQgc2hvdWxkIGJlIGlzc3VlZAorICAgICAgICAgICAgZlJlbGVhc2VDb21tYW5kID0gY3NyUm9hbVByb2Nlc3NSZXN1bHRzKCBwTWFjLCBwQ29tbWFuZCwgUmVzdWx0LCBDb250ZXh0ICk7CisgICAgICAgICAgICBpZiggZlJlbGVhc2VDb21tYW5kICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiggY3NyTExSZW1vdmVFbnRyeSggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0LCBwRW50cnksIExMX0FDQ0VTU19MT0NLICkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY3NyUmVsZWFzZUNvbW1hbmRSb2FtKCBwTWFjLCBwQ29tbWFuZCApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsICIgKioqKioqKioqKmNzclJvYW1Db21wbGV0ZSBmYWlsIHRvIHJlbGVhc2UgY29tbWFuZCByZWFzb24gJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUucm9hbUNtZC5yb2FtUmVhc29uICk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgIiAqKioqKioqKioqY3NyUm9hbUNvbXBsZXRlIGZhaWwgdG8gcmVsZWFzZSBjb21tYW5kIHJlYXNvbiAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnJvYW1DbWQucm9hbVJlYXNvbiApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dXLCAiQ1NSOiBSb2FtIENvbXBsZXRpb24gY2FsbGVkIGJ1dCBST0FNIGNvbW1hbmQgaXMgbm90IEFDVElWRSAuLi4iICk7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dXLCAiQ1NSOiBSb2FtIENvbXBsZXRpb24gY2FsbGVkIGJ1dCBOTyBjb21tYW5kcyBhcmUgQUNUSVZFIC4uLiIgKTsKKyAgICB9CisgICAgaWYoIGZSZWxlYXNlQ29tbWFuZCApCisgICAgeworICAgICAgICBzbWVQcm9jZXNzUGVuZGluZ1F1ZXVlKCBwTWFjICk7CisgICAgfQorfQorCit2b2lkIGNzclJlc2V0UE1LSURDYW5kaWRhdGVMaXN0KCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UzMiBzZXNzaW9uSWQgKQoreworICAgIHRDc3JSb2FtU2Vzc2lvbiAqcFNlc3Npb24gPSBDU1JfR0VUX1NFU1NJT04oIHBNYWMsIHNlc3Npb25JZCApOworICAgIGlmKCFwU2Vzc2lvbikKKyAgICB7CisgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiICBzZXNzaW9uICVkIG5vdCBmb3VuZCAiKSwgc2Vzc2lvbklkKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICB2b3NfbWVtX3NldCgmKHBTZXNzaW9uLT5QbWtpZENhbmRpZGF0ZUluZm9bMF0pLAorICAgICAgICAgICAgICAgIHNpemVvZih0UG1raWRDYW5kaWRhdGVJbmZvKSAqIEN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V9SU05fUFNLX1NIQTI1NiA9PSBhdXRoVHlwZSkgfHwKKyAgICAgICAgICAgICAgICAoZUNTUl9BVVRIX1RZUEVfUlNOXzgwMjFYX1NIQTI1NiA9PSBhdXRoVHlwZSkgfHwKKyNlbmRpZgorICAgICAgICAgICAgICAgIChlQ1NSX0FVVEhfVFlQRV9SU05fUFNLID09IGF1dGhUeXBlKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZihwSWVzTG9jYWwtPlJTTi5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy9DYWxjdWxhdGUgdGhlIGFjdHVhbCBsZW5ndGgKKyAgICAgICAgICAgICAgICAgICAgbkllTGVuID0gOCAvL3ZlcnNpb24gKyBncF9jaXBoZXJfc3VpdGUgKyBwd2lzZV9jaXBoZXJfc3VpdGVfY291bnQKKyAgICAgICAgICAgICAgICAgICAgICAgICsgcEllc0xvY2FsLT5SU04ucHdpc2VfY2lwaGVyX3N1aXRlX2NvdW50ICogNCAgICAvL3B3aXNlX2NpcGhlcl9zdWl0ZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICsgMiAvL2FrbV9zdWl0ZV9jb3VudAorICAgICAgICAgICAgICAgICAgICAgICAgKyBwSWVzTG9jYWwtPlJTTi5ha21fc3VpdGVfY291bnQgKiA0IC8vYWttX3N1aXRlcworICAgICAgICAgICAgICAgICAgICAgICAgKyAyOyAvL3Jlc2VydmVkCisgICAgICAgICAgICAgICAgICAgIGlmKCBwSWVzTG9jYWwtPlJTTi5wbWtpZF9jb3VudCApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG5JZUxlbiArPSAyICsgcEllc0xvY2FsLT5SU04ucG1raWRfY291bnQgKiA0OyAgLy9wbWtpZAorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8vbkllTGVuIGRvZXNuJ3QgY291bnQgRUlEIGFuZCBsZW5ndGggZmllbGRzCisgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5wV3BhUnNuUnNwSUUgPSB2b3NfbWVtX21hbGxvYyhuSWVMZW4gKyAyKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKE5VTEwgPT0gcFNlc3Npb24tPnBXcGFSc25Sc3BJRSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9zZXQocFNlc3Npb24tPnBXcGFSc25Sc3BJRSwgbkllTGVuICsgMiwgMCk7CisgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+cFdwYVJzblJzcElFWzBdID0gRE9UMTFGX0VJRF9SU047CisgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+cFdwYVJzblJzcElFWzFdID0gKHRBTklfVTgpbkllTGVuOworICAgICAgICAgICAgICAgICAgICAgICAgLy9jb3B5IHVwdG8gYWttX3N1aXRlcworICAgICAgICAgICAgICAgICAgICAgICAgcEllQnVmID0gcFNlc3Npb24tPnBXcGFSc25Sc3BJRSArIDI7CisgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocEllQnVmLCAmcEllc0xvY2FsLT5SU04udmVyc2lvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YocEllc0xvY2FsLT5SU04udmVyc2lvbikpOworICAgICAgICAgICAgICAgICAgICAgICAgcEllQnVmICs9IHNpemVvZihwSWVzTG9jYWwtPlJTTi52ZXJzaW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwSWVCdWYsICZwSWVzTG9jYWwtPlJTTi5ncF9jaXBoZXJfc3VpdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHBJZXNMb2NhbC0+UlNOLmdwX2NpcGhlcl9zdWl0ZSkpOworICAgICAgICAgICAgICAgICAgICAgICAgcEllQnVmICs9IHNpemVvZihwSWVzTG9jYWwtPlJTTi5ncF9jaXBoZXJfc3VpdGUpOworICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBJZUJ1ZiwgJnBJZXNMb2NhbC0+UlNOLnB3aXNlX2NpcGhlcl9zdWl0ZV9jb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YocEllc0xvY2FsLT5SU04ucHdpc2VfY2lwaGVyX3N1aXRlX2NvdW50KSk7CisgICAgICAgICAgICAgICAgICAgICAgICBwSWVCdWYgKz0gc2l6ZW9mKHBJZXNMb2NhbC0+UlNOLnB3aXNlX2NpcGhlcl9zdWl0ZV9jb3VudCApOworICAgICAgICAgICAgICAgICAgICAgICAgaWYoIHBJZXNMb2NhbC0+UlNOLnB3aXNlX2NpcGhlcl9zdWl0ZV9jb3VudCApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9jb3B5IHB3aXNlX2NpcGhlcl9zdWl0ZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocEllQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVzTG9jYWwtPlJTTi5wd2lzZV9jaXBoZXJfc3VpdGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVzTG9jYWwtPlJTTi5wd2lzZV9jaXBoZXJfc3VpdGVfY291bnQgKiA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVCdWYgKz0gcEllc0xvY2FsLT5SU04ucHdpc2VfY2lwaGVyX3N1aXRlX2NvdW50ICogNDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwSWVCdWYsICZwSWVzTG9jYWwtPlJTTi5ha21fc3VpdGVfY291bnQsIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgcEllQnVmICs9IDI7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiggcEllc0xvY2FsLT5SU04uYWttX3N1aXRlX2NvdW50ICkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2NvcHkgYWttX3N1aXRlcworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwSWVCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZXNMb2NhbC0+UlNOLmFrbV9zdWl0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZXNMb2NhbC0+UlNOLmFrbV9zdWl0ZV9jb3VudCAqIDQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZUJ1ZiArPSBwSWVzTG9jYWwtPlJTTi5ha21fc3VpdGVfY291bnQgKiA0OworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgLy9jb3B5IHRoZSByZXN0CisgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocEllQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZXNMb2NhbC0+UlNOLmFrbV9zdWl0ZXMgKyBwSWVzTG9jYWwtPlJTTi5ha21fc3VpdGVfY291bnQgKiA0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgKyBwSWVzTG9jYWwtPlJTTi5wbWtpZF9jb3VudCAqIDQpOworICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPm5XcGFSc25Sc3BJZUxlbmd0aCA9IG5JZUxlbiArIDI7IAorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZigoZUNTUl9BVVRIX1RZUEVfV1BBID09IGF1dGhUeXBlKSB8fAorICAgICAgICAgICAgICAgIChlQ1NSX0FVVEhfVFlQRV9XUEFfUFNLID09IGF1dGhUeXBlKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZihwSWVzTG9jYWwtPldQQS5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy9DYWxjdWxhdGUgdGhlIGFjdHVhbCBsZW5ndGgKKyAgICAgICAgICAgICAgICAgICAgbkllTGVuID0gMTIgLy9PVUkgKyB2ZXJzaW9uICsgbXVsdGljYXN0X2NpcGhlciArIHVuaWNhc3RfY2lwaGVyX2NvdW50CisgICAgICAgICAgICAgICAgICAgICAgICArIHBJZXNMb2NhbC0+V1BBLnVuaWNhc3RfY2lwaGVyX2NvdW50ICogNCAgICAvL3VuaWNhc3RfY2lwaGVycworICAgICAgICAgICAgICAgICAgICAgICAgKyAyIC8vYXV0aF9zdWl0ZV9jb3VudAorICAgICAgICAgICAgICAgICAgICAgICAgKyBwSWVzTG9jYWwtPldQQS5hdXRoX3N1aXRlX2NvdW50ICogNDsgLy9hdXRoX3N1aXRlcworICAgICAgICAgICAgICAgICAgICAvLyBUaGUgV1BBIGNhcGFiaWxpdGllcyBmb2xsb3dzIHRoZSBBdXRoIFN1aXRlICh0d28gb2N0ZWN0cyktLQorICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGZpZWxkIGlzIG9wdGlvbmFsLCBhbmQgd2UgYWx3YXlzICJzZW5kIiB6ZXJvLCBzbyBqdXN0CisgICAgICAgICAgICAgICAgICAgIC8vIHJlbW92ZSBpdC4gIFRoaXMgaXMgY29uc2lzdGVudCB3aXRoIG91ciBhc3N1bXB0aW9ucyBpbiB0aGUKKyAgICAgICAgICAgICAgICAgICAgLy8gZnJhbWVzIGNvbXBpbGVyOyBjLmYuIGJ1ZyAxNTIzNDoKKyAgICAgICAgICAgICAgICAgICAgLy9uSWVMZW4gZG9lc24ndCBjb3VudCBFSUQgYW5kIGxlbmd0aCBmaWVsZHMKKworICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+cFdwYVJzblJzcElFID0gdm9zX21lbV9tYWxsb2MobkllTGVuICsgMik7CisgICAgICAgICAgICAgICAgICAgIGlmICggTlVMTCA9PSBwU2Vzc2lvbi0+cFdwYVJzblJzcElFICkKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPnBXcGFSc25Sc3BJRVswXSA9IERPVDExRl9FSURfV1BBOworICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPnBXcGFSc25Sc3BJRVsxXSA9ICh0QU5JX1U4KW5JZUxlbjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBJZUJ1ZiA9IHBTZXNzaW9uLT5wV3BhUnNuUnNwSUUgKyAyOworICAgICAgICAgICAgICAgICAgICAgICAgLy9Db3B5IFdQQSBPVUkKKyAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwSWVCdWYsICZjc3JXcGFPdWlbMV0sIDQpOworICAgICAgICAgICAgICAgICAgICAgICAgcEllQnVmICs9IDQ7CisgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocEllQnVmLCAmcEllc0xvY2FsLT5XUEEudmVyc2lvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4ICsgcEllc0xvY2FsLT5XUEEudW5pY2FzdF9jaXBoZXJfY291bnQgKiA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBJZUJ1ZiArPSA4ICsgcEllc0xvY2FsLT5XUEEudW5pY2FzdF9jaXBoZXJfY291bnQgKiA0OworICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBJZUJ1ZiwgJnBJZXNMb2NhbC0+V1BBLmF1dGhfc3VpdGVfY291bnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiArIHBJZXNMb2NhbC0+V1BBLmF1dGhfc3VpdGVfY291bnQgKiA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBJZUJ1ZiArPSBwSWVzTG9jYWwtPldQQS5hdXRoX3N1aXRlX2NvdW50ICogNDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5uV3BhUnNuUnNwSWVMZW5ndGggPSBuSWVMZW4gKyAyOyAKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyNpZmRlZiBGRUFUVVJFX1dMQU5fV0FQSQorICAgICAgICAgIGVsc2UgaWYoKGVDU1JfQVVUSF9UWVBFX1dBUElfV0FJX1BTSyA9PSBhdXRoVHlwZSkgfHwKKyAgICAgICAgICAgICAgICAgIChlQ1NSX0FVVEhfVFlQRV9XQVBJX1dBSV9DRVJUSUZJQ0FURSA9PSBhdXRoVHlwZSkpCisgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKHBJZXNMb2NhbC0+V0FQSS5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAvL0NhbGN1bGF0ZSB0aGUgYWN0dWFsIGxlbmd0aAorICAgICAgICAgICAgICAgICAgIG5JZUxlbiA9IDQgLy92ZXJzaW9uICsgYWttX3N1aXRlX2NvdW50IAorICAgICAgICAgICAgICAgICAgICAgICsgcEllc0xvY2FsLT5XQVBJLmFrbV9zdWl0ZV9jb3VudCAqIDQgLy8gYWttX3N1aXRlcworICAgICAgICAgICAgICAgICAgICAgICsgMiAvL3B3aXNlX2NpcGhlcl9zdWl0ZV9jb3VudAorICAgICAgICAgICAgICAgICAgICAgICsgcEllc0xvY2FsLT5XQVBJLnVuaWNhc3RfY2lwaGVyX3N1aXRlX2NvdW50ICogNCAgICAvL3B3aXNlX2NpcGhlcl9zdWl0ZXMKKyAgICAgICAgICAgICAgICAgICAgICArIDY7IC8vZ3BfY2lwaGVyX3N1aXRlICsgcHJlYXV0aCArIHJlc2VydmVkCisgICAgICAgICAgICAgICAgICAgICAgaWYoIHBJZXNMb2NhbC0+V0FQSS5ia2lkX2NvdW50ICkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICBuSWVMZW4gKz0gMiArIHBJZXNMb2NhbC0+V0FQSS5ia2lkX2NvdW50ICogNDsgIC8vYmtpZAorICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgLy9uSWVMZW4gZG9lc24ndCBjb3VudCBFSUQgYW5kIGxlbmd0aCBmaWVsZHMKKyAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+cFdhcGlSc3BJRSA9IHZvc19tZW1fbWFsbG9jKG5JZUxlbiArIDIpOworICAgICAgICAgICAgICAgICAgIGlmICggTlVMTCA9PSBwU2Vzc2lvbi0+cFdhcGlSc3BJRSApCisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPnBXYXBpUnNwSUVbMF0gPSBET1QxMUZfRUlEX1dBUEk7CisgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPnBXYXBpUnNwSUVbMV0gPSAodEFOSV9VOCluSWVMZW47CisgICAgICAgICAgICAgICAgICAgICAgcEllQnVmID0gcFNlc3Npb24tPnBXYXBpUnNwSUUgKyAyOworICAgICAgICAgICAgICAgICAgICAgIC8vY29weSB1cHRvIGFrbV9zdWl0ZV9jb3VudAorICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwSWVCdWYsICZwSWVzTG9jYWwtPldBUEkudmVyc2lvbiwgMik7CisgICAgICAgICAgICAgICAgICAgICAgcEllQnVmICs9IDQ7CisgICAgICAgICAgICAgICAgICAgICAgaWYoIHBJZXNMb2NhbC0+V0FQSS5ha21fc3VpdGVfY291bnQgKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAvL2NvcHkgYWttX3N1aXRlcworICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwSWVCdWYsIHBJZXNMb2NhbC0+V0FQSS5ha21fc3VpdGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVzTG9jYWwtPldBUEkuYWttX3N1aXRlX2NvdW50ICogNCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgcEllQnVmICs9IHBJZXNMb2NhbC0+V0FQSS5ha21fc3VpdGVfY291bnQgKiA0OworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocEllQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEllc0xvY2FsLT5XQVBJLnVuaWNhc3RfY2lwaGVyX3N1aXRlX2NvdW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKTsKKyAgICAgICAgICAgICAgICAgICAgICBwSWVCdWYgKz0gMjsKKyAgICAgICAgICAgICAgICAgICAgICBpZiggcEllc0xvY2FsLT5XQVBJLnVuaWNhc3RfY2lwaGVyX3N1aXRlX2NvdW50ICkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgLy9jb3B5IHB3aXNlX2NpcGhlcl9zdWl0ZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoIHBJZUJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZXNMb2NhbC0+V0FQSS51bmljYXN0X2NpcGhlcl9zdWl0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVzTG9jYWwtPldBUEkudW5pY2FzdF9jaXBoZXJfc3VpdGVfY291bnQgKiA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICBwSWVCdWYgKz0gcEllc0xvY2FsLT5XQVBJLnVuaWNhc3RfY2lwaGVyX3N1aXRlX2NvdW50ICogNDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgLy9ncF9jaXBoZXJfc3VpdGUKKyAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocEllQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVzTG9jYWwtPldBUEkubXVsdGljYXN0X2NpcGhlcl9zdWl0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCk7CisgICAgICAgICAgICAgICAgICAgICAgcEllQnVmICs9IDQ7CisgICAgICAgICAgICAgICAgICAgICAgLy9wcmVhdXRoICsgcmVzZXJ2ZWQKKyAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocEllQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVzTG9jYWwtPldBUEkubXVsdGljYXN0X2NpcGhlcl9zdWl0ZSArIDQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpOworICAgICAgICAgICAgICAgICAgICAgIHBJZUJ1ZiArPSAyOworICAgICAgICAgICAgICAgICAgICAgIGlmICggcEllc0xvY2FsLT5XQVBJLmJraWRfY291bnQgKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAvL2JraWRfY291bnQKKyAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocEllQnVmLCAmcEllc0xvY2FsLT5XQVBJLmJraWRfY291bnQsIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgIHBJZUJ1ZiArPSAyOworICAgICAgICAgICAgICAgICAgICAgICAgIC8vY29weSBha21fc3VpdGVzCisgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBJZUJ1ZiwgcEllc0xvY2FsLT5XQVBJLmJraWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZXNMb2NhbC0+V0FQSS5ia2lkX2NvdW50ICogNCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgcEllQnVmICs9IHBJZXNMb2NhbC0+V0FQSS5ia2lkX2NvdW50ICogNDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPm5XYXBpUnNwSWVMZW5ndGggPSBuSWVMZW4gKyAyOworICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9XQVBJICovCisgICAgICAgICAgICBpZiggIXBJZXMgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vbG9jYWxseSBhbGxvY2F0ZWQKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocEllc0xvY2FsKTsKKyAgICAgICAgfQorICAgIH0KKyAgICB9CisgICAgcmV0dXJuIChzdGF0dXMpOworfQorCitzdGF0aWMgdm9pZCBjc3JDaGVja0FuZFVwZGF0ZUFDV2VpZ2h0KCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0RG90MTFmQmVhY29uSUVzICpwSUVzICkKK3sKKyAgICB2X1U4X3QgYkFDV2VpZ2h0c1tXTEFOVExfTUFYX0FDXTsKKyAgICB2X1U4X3QgcGFyYW1CaywgcGFyYW1CZSwgcGFyYW1WaSwgcGFyYW1WbzsKKyAgICB2X0JPT0xfdCBmV2VpZ2h0Q2hhbmdlID0gVk9TX0ZBTFNFOworICAgIC8vQ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iArIHBJRXMtPldNTVBhcmFtcy5hY2JlX2Fjd21pbjsKKyAgICAgICAgcGFyYW1WaSA9IHBJRXMtPldNTVBhcmFtcy5hY3ZpX2FpZnNuICsgcElFcy0+V01NUGFyYW1zLmFjdmlfYWN3bWluOworICAgICAgICBwYXJhbVZvID0gcElFcy0+V01NUGFyYW1zLmFjdm9fYWlmc24gKyBwSUVzLT5XTU1QYXJhbXMuYWN2b19hY3dtaW47CisgICAgICAgIGlmKCBTTUVfREVURUNUX0FDX1dFSUdIVF9ESUZGKHBhcmFtQmssIHBhcmFtQmUpICkKKyAgICAgICAgeworICAgICAgICAgICAgYkFDV2VpZ2h0c1tXTEFOVExfQUNfQkVdID0gYkFDV2VpZ2h0c1tXTEFOVExfQUNfQktdOworICAgICAgICAgICAgZldlaWdodENoYW5nZSA9IFZPU19UUlVFOworICAgICAgICB9CisgICAgICAgIGlmKCBTTUVfREVURUNUX0FDX1dFSUdIVF9ESUZGKHBhcmFtQmssIHBhcmFtVmkpICkKKyAgICAgICAgeworICAgICAgICAgICAgYkFDV2VpZ2h0c1tXTEFOVExfQUNfVkldID0gYkFDV2VpZ2h0c1tXTEFOVExfQUNfQktdOworICAgICAgICAgICAgZldlaWdodENoYW5nZSA9IFZPU19UUlVFOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYoIFNNRV9ERVRFQ1RfQUNfV0VJR0hUX0RJRkYocGFyYW1CZSwgcGFyYW1WaSkgKQorICAgICAgICB7CisgICAgICAgICAgICBiQUNXZWlnaHRzW1dMQU5UTF9BQ19WSV0gPSBiQUNXZWlnaHRzW1dMQU5UTF9BQ19CRV07CisgICAgICAgICAgICBmV2VpZ2h0Q2hhbmdlID0gVk9TX1RSVUU7CisgICAgICAgIH0KKyAgICAgICAgaWYoIFNNRV9ERVRFQ1RfQUNfV0VJR0hUX0RJRkYocGFyYW1CaywgcGFyYW1WbykgKQorICAgICAgICB7CisgICAgICAgICAgICBiQUNXZWlnaHRzW1dMQU5UTF9BQ19WT10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jLCBzZXNzaW9uSWQgKTsKKyAgICB0Q3NyUm9hbVByb2ZpbGUgKnBQcm9maWxlID0gJnBDb21tYW5kLT51LnJvYW1DbWQucm9hbVByb2ZpbGU7CisgICAgZVJvYW1DbWRTdGF0dXMgcm9hbVN0YXR1czsKKyAgICBlQ3NyUm9hbVJlc3VsdCByb2FtUmVzdWx0OworICAgIGVIYWxTdGF0dXMgc3RhdHVzOworICAgIHRBTklfVTMyIGtleV90aW1lb3V0X2ludGVydmFsID0gMDsKKyAgICB0U2lyU21lU3RhcnRCc3NSc3AgICpwU21lU3RhcnRCc3NSc3AgPSBOVUxMOworCisgICAgaWYoIXBTZXNzaW9uKQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgIHNlc3Npb24gJWQgbm90IGZvdW5kICIpLCBzZXNzaW9uSWQpOworICAgICAgICByZXR1cm4gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgIH0KKworICAgIHNtc0xvZyggcE1hYywgTE9HMSwgRkwoIlByb2Nlc3NpbmcgUk9BTSByZXN1bHRzLi4uIikpOworICAgIHN3aXRjaCggUmVzdWx0ICkKKyAgICB7CisgICAgICAgIGNhc2UgZUNzckpvaW5TdWNjZXNzOgorICAgICAgICAgICAgLy8gcmVzZXQgdGhlIElETEUgdGltZXIKKyAgICAgICAgICAgIC8vICEhCisgICAgICAgICAgICAvLyAhISBmYWxsIHRocm91Z2ggdG8gdGhlIG5leHQgQ0FTRSBzdGF0ZW1lbnQgaGVyZSBpcyBpbnRlbnRpb25hbCAhIQorICAgICAgICAgICAgLy8gISEKKyAgICAgICAgY2FzZSBlQ3NyUmVhc3NvY1N1Y2Nlc3M6CisgICAgICAgICAgICBpZihlQ3NyUmVhc3NvY1N1Y2Nlc3MgPT0gUmVzdWx0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGluZF9xb3MgPSBTTUVfUU9TX0NTUl9SRUFTU09DX0NPTVBMRVRFOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGluZF9xb3MgPSBTTUVfUU9TX0NTUl9BU1NPQ19DT01QTEVURTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIFN1Y2Nlc3MgSm9pbiBSZXNwb25zZSBmcm9tIExJTS4gIFRlbGwgTkRJUyB3ZSBhcmUgY29ubmVjdGVkIGFuZCBzYXZlIHRoZQorICAgICAgICAgICAgLy8gQ29ubmVjdGVkIHN0YXRlLi4uCisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywgRkwoInJlY2VpdmVzIGFzc29jaWF0aW9uIGluZGljYXRpb24iKSk7CisgICAgICAgICAgICB2b3NfbWVtX3NldCgmcm9hbUluZm8sIHNpemVvZihyb2FtSW5mbyksIDApOworICAgICAgICAgICAgLy9hbHdheXMgZnJlZSB0aGUgbWVtb3J5IGhlcmUKKyAgICAgICAgICAgIGlmKHBTZXNzaW9uLT5wV3BhUnNuUnNwSUUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFNlc3Npb24tPm5XcGFSc25Sc3BJZUxlbmd0aCA9IDA7CisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBTZXNzaW9uLT5wV3BhUnNuUnNwSUUpOworICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5wV3BhUnNuUnNwSUUgPSBOVUxMOworICAgICAgICAgICAgfQorI2lmZGVmIEZFQVRVUkVfV0xBTl9XQVBJCisgICAgICAgICAgICBpZihwU2Vzc2lvbi0+cFdhcGlSc3BJRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+bldhcGlSc3BJZUxlbmd0aCA9IDA7CisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBTZXNzaW9uLT5wV2FwaVJzcElFKTsKKyAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+cFdhcGlSc3BJRSA9IE5VTEw7CisgICAgICAgICAgICB9C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VEFURV9UWVBFX0lORlJBX0FTU09DSUFURUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFNlc3Npb24tPmNvbm5lY3RTdGF0ZSA9IGVDU1JfQVNTT0NfU1RBVEVfVFlQRV9XRFNfQ09OTkVDVEVEOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy9Vc2UgdGhlIGxhc3QgY29ubmVjdGVkIGJzc2Rlc2MgZm9yIHJlYXNzb2MtaW5nIHRvIHRoZSBzYW1lIEFQLgorICAgICAgICAgICAgLy9OT1RFOiBXaGF0IHRvIGRvIHdoZW4gcmVhc3NvYyB0byBhIGRpZmZlcmVudCBBUD8/PworICAgICAgICAgICAgaWYoIChlQ3NySGRkSXNzdWVkUmVhc3NvY1RvU2FtZUFQID09IHBDb21tYW5kLT51LnJvYW1DbWQucm9hbVJlYXNvbikgfHwKKyAgICAgICAgICAgICAgICAoZUNzclNtZUlzc3VlZFJlYXNzb2NUb1NhbWVBUCA9PSBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1SZWFzb24pICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwU2lyQnNzRGVzYyA9IHBTZXNzaW9uLT5wQ29ubmVjdEJzc0Rlc2M7CisgICAgICAgICAgICAgICAgaWYocFNpckJzc0Rlc2MpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnJvYW1JbmZvLmJzc2lkLCAmcFNpckJzc0Rlc2MtPmJzc0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRDc3JCc3NpZCkpOworICAgICAgICAgICAgICAgIH0gCisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgIAorICAgICAgICAgICAgICAgIGlmKHBDb21tYW5kLT51LnJvYW1DbWQucFJvYW1Cc3NFbnRyeSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBTY2FuUmVzdWx0ID0gR0VUX0JBU0VfQUREUihwQ29tbWFuZC0+dS5yb2FtQ21kLnBSb2FtQnNzRW50cnksIHRDc3JTY2FuUmVzdWx0LCBMaW5rKTsKKyAgICAgICAgICAgICAgICAgICAgaWYocFNjYW5SZXN1bHQgIT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcFNpckJzc0Rlc2MgPSAmcFNjYW5SZXN1bHQtPlJlc3VsdC5Cc3NEZXNjcmlwdG9yOworICAgICAgICAgICAgICAgICAgICAgICAgLy90aGlzIGNhbiBiZSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICBwSWVzID0gKHREb3QxMWZCZWFjb25JRXMgKikoIHBTY2FuUmVzdWx0LT5SZXN1bHQucHZJZXMgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmcm9hbUluZm8uYnNzaWQsICZwU2lyQnNzRGVzYy0+YnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRDc3JCc3NpZCkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYoIHBTaXJCc3NEZXNjICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByb2FtSW5mby5zdGFJZCA9IEhBTF9TVEFfSU5WQUxJRF9JRFg7CisgICAgICAgICAgICAgICAgY3NyUm9hbVNhdmVDb25uZWN0ZWRJbmZvbWF0aW9uKHBNYWMsIHNlc3Npb25JZCwgcFByb2ZpbGUsIHBTaXJCc3NEZXNjLCBwSWVzKTsKKyAgICAgICAgICAgICAgICAgICAgLy9TYXZlIFdQQS9SU04gSUUKKyAgICAgICAgICAgICAgICBjc3JSb2FtU2F2ZVNlY3VyaXR5UnNwSUUocE1hYywgc2Vzc2lvbklkLCBwUHJvZmlsZS0+bmVnb3RpYXRlZEF1dGhUeXBlLCBwU2lyQnNzRGVzYywgcEllcyk7CisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRQorICAgICAgICAgICAgICAgIHJvYW1JbmZvLmlzRVNFQXNzb2MgPSBwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS5pc0VTRUFzc29jOworI2VuZGlmCisjaWZkZWYgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIKKyAgICAgICAgICAgICAgICBpZiAocFNpckJzc0Rlc2MtPm1kaWVQcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoY3NySXNBdXRoVHlwZTExcihwUHJvZmlsZS0+bmVnb3RpYXRlZEF1dGhUeXBlLCBWT1NfVFJVRSkKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICAgICAgICAgICAgICAgICAgICAgJiYgISgocFByb2ZpbGUtPm5lZ290aWF0ZWRBdXRoVHlwZSA9PSBlQ1NSX0FVVEhfVFlQRV9PUEVOX1NZU1RFTSkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAocEllcy0+RVNFVmVyc2lvbi5wcmVzZW50KSAmJiAocE1hYy0+cm9hbS5jb25maWdQYXJhbS5pc0VzZUluaUZlYXR1cmVFbmFibGVkKSkKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gaXMxMVJjb25uZWN0aW9uOworICAgICAgICAgICAgICAgICAgICAgICAgcm9hbUluZm8uaXMxMXJBc3NvYyA9IFZPU19UUlVFOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gaXMxMVJjb25uZWN0aW9uOworICAgICAgICAgICAgICAgICAgICAgICAgcm9hbUluZm8uaXMx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ICAvLyB0aGlzIHdhcyBjYXVzaW5nIGlzc3VlcyBpbiB0aGUgMmNfd2xhbl93ZXAgV0hRTCB0ZXN0IHdoZW4gdGhlIFNldENvbnRleHQgd2FzIGlzc3VlZCBhZnRlciB0aGUgbGluaworICAgICAgICAgICAgICAgIC8vIGluZGljYXRpb24uICAoTGluayBJbmRpY2F0aW9uIGhhcHBlbnMgaW4gdGhlIHByb2ZGU01TZXRDb25uZWN0ZWRJbmZyYSBjYWxsKS4KKyAgICAgICAgICAgICAgICAvLworICAgICAgICAgICAgICAgIC8vIHRoaXMgcmVvcmRlcmluZyB3YXMgZG9uZSBvbiB0aXRhbl9wcm9kX3VzYiBicmFuY2ggYW5kIGlzIGJlaW5nIHJlcGxpY2F0ZWQgaGVyZS4KKyAgICAgICAgICAgICAgICAvLworICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgaWYoIENTUl9JU19FTkNfVFlQRV9TVEFUSUMoIHBQcm9maWxlLT5uZWdvdGlhdGVkVUNFbmNyeXB0aW9uVHlwZSApICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIXBQcm9maWxlLT5iV1BTQXNzb2NpYXRpb24pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvLyBJc3N1ZSB0aGUgc2V0IENvbnRleHQgcmVxdWVzdCB0byBMSU0gdG8gZXN0YWJsaXNoIHRoZSBVbmljYXN0IFNUQSBjb250ZXh0CisgICAgICAgICAgICAgICAgICAgIGlmKCAhSEFMX1NUQVRVU19TVUNDRVNTKCBjc3JSb2FtSXNzdWVTZXRDb250ZXh0UmVxKCBwTWFjLCBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUHJvZmlsZS0+bmVnb3RpYXRlZFVDRW5jcnlwdGlvblR5cGUsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNpckJzc0Rlc2MsICYocFNpckJzc0Rlc2MtPmJzc0lkKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZBTFNFLCBUUlVFLCBlU0lSX1RYX1JYLCAwLCAwLCBOVUxMLCAwICkgKSApIC8vIE5PIGtleXMuLi4gdGhlc2Uga2V5IHBhcmFtZXRlcnMgZG9uJ3QgbWF0dGVyLgorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCIgIFNldCBjb250ZXh0IGZvciB1bmljYXN0IGZhaWwiKSApOworICAgICAgICAgICAgICAgICAgICAgICAgY3NyUm9hbVN1YnN0YXRlQ2hhbmdlKCBwTWFjLCBlQ1NSX1JPQU1fU1VCU1RBVEVfTk9ORSwgc2Vzc2lvbklkICk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgLy8gSXNzdWUgdGhlIHNldCBDb250ZXh0IHJlcXVlc3QgdG8gTElNIHRvIGVzdGFibGlzaCB0aGUgQnJvYWRjYXN0IFNUQSBjb250ZXh0CisgICAgICAgICAgICAgICAgICAgIGNzclJvYW1Jc3N1ZVNldENvbnRleHRSZXEoIHBNYWMsIHNlc3Npb25JZCwgcFByb2ZpbGUtPm5lZ290aWF0ZWRNQ0VuY3J5cHRpb25UeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2lyQnNzRGVzYywgJkJyb2FkY2FzdE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkFMU0UsIEZBTFNFLCBlU0lSX1RYX1JYLCAwLCAwLCBOVUxMLCAwICk7IC8vIE5PIGtleXMuLi4gdGhlc2Uga2V5IHBhcmFtZXRlcnMgZG9uJ3QgbWF0dGVyLgorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvL05lZWQgdG8gd2FpdCBmb3Igc3VwcGxpY2FudCBhdXRodGljYXRpb24KKyAgICAgICAgICAgICAgICAgICAgcm9hbUluZm8uZkF1dGhSZXF1aXJlZCA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgICAgICAgICAvL1NldCB0aGUgc3ViZXN0YXRlIHRvIFdhaXRGb3JLZXkgaW4gY2FzZSBhdXRoZW50aWF0aW9uIGlzIG5lZWRlZAorICAgICAgICAgICAgICAgICAgICBjc3JSb2FtU3Vic3RhdGVDaGFuZ2UoIHBNYWMsIGVDU1JfUk9BTV9TVUJTVEFURV9XQUlUX0ZPUl9LRVksIHNlc3Npb25JZCApOworCisgICAgICAgICAgICAgICAgICAgIGlmKHBQcm9maWxlLT5iV1BTQXNzb2NpYXRpb24pCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGtleV90aW1lb3V0X2ludGVydmFsID0gQ1NSX1dBSVRfRk9SX1dQU19LRVlfVElNRU9VVF9QRVJJT0Q7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBrZXlfdGltZW91dF9pbnRlcnZhbCA9IENTUl9XQUlUX0ZPUl9LRVlfVElNRU9VVF9QRVJJT0Q7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIC8vU2F2ZSBzZXNzaW9uSWQgaW4gY2FzZSBvZiB0aW1lb3V0CisgICAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0uV2FpdEZvcktleVRpbWVySW5mby5zZXNzaW9uSWQgPSAodEFOSV9VOClzZXNzaW9uSWQ7CisgICAgICAgICAgICAgICAgICAgIC8vVGhpcyB0aW1lIHNob3VsZCBiZSBsb25nIGVub3VnaCBmb3IgdGhlIHJlc3Qgb2YgdGhlIHByb2Nlc3MgcGx1cyBzZXR0aW5nIGtleQorICAgICAgICAgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKCBjc3JSb2FtU3RhcnRXYWl0Rm9yS2V5VGltZXIoIHBNYWMsIGtleV90aW1lb3V0X2ludGVydmFsICkgKSApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vUmVzZXQgb3VyIHN0YXRlIHNvIG5vdGh0aW5nIGlzIGJsb2NrZWQuCisgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCIgICBGYWlsZWQgdG8gc3RhcnQgcHJlLWF1dGggdGltZXIiKSApOworICAgICAgICAgICAgICAgICAgICAgICAgY3NyUm9hbVN1YnN0YXRlQ2hhbmdlKCBwTWFjLCBlQ1NSX1JPQU1fU1VCU1RBVEVfTk9ORSwgc2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBhc3NvY0luZm8ucEJzc0Rlc2MgPSBwU2lyQnNzRGVzYzsgLy9jb3VsZCBiZSBOVUxMCisgICAgICAgICAgICAgICAgYXNzb2NJbmZvLnBQcm9maWxlID0gcFByb2ZpbGU7CisgICAgICAgICAgICAgICAgaWYoQ29udGV4dCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHRTaXJTbWVKb2luUnNwICpwSm9pblJzcCA9ICh0U2lyU21lSm9pblJzcCAqKUNvbnRleHQ7CisgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIGxlbjsKKyAgICAgICAgICAgICAgICAgICAgY3NyUm9hbUZyZWVDb25uZWN0ZWRJbmZvKCBwTWFjLCAmcFNlc3Npb24tPmNvbm5lY3RlZEluZm8gKTsKKyAgICAgICAgICAgICAgICAgICAgbGVuID0gcEpvaW5Sc3AtPmFzc29jUmVxTGVuZ3RoICsgcEpvaW5Sc3AtPmFzc29jUnNwTGVuZ3RoICsgcEpvaW5Sc3AtPmJlYWNvbkxlbmd0aDsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUgorICAgICAgICAgICAgICAgICAgICBsZW4gKz0gcEpvaW5Sc3AtPnBhcnNlZFJpY1JzcExlbjsKKyNlbmRpZiAvKiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUiAqLyAgICAgICAgICAgICAgICAgICAgCisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRQorICAgICAgICAgICAgICAgICAgICBsZW4gKz0gcEpvaW5Sc3AtPnRzcGVjSWVMZW47CisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgaWYobGVuKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+Y29ubmVjdGVkSW5mby5wYkZyYW1lcyA9IHZvc19tZW1fbWFsbG9jKGxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIHBTZXNzaW9uLT5jb25uZWN0ZWRJbmZvLnBiRnJhbWVzICE9IE5VTEwgKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwU2Vzc2lvbi0+Y29ubmVjdGVkSW5mby5wYkZyYW1lcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEpvaW5Sc3AtPmZyYW1lcywgbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+Y29ubmVjdGVkSW5mby5uQXNzb2NSZXFMZW5ndGggPSBwSm9pblJzcC0+YXNzb2NSZXFMZW5ndGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPmNvbm5lY3RlZEluZm8ubkFzc29jUnNwTGVuZ3RoID0gcEpvaW5Sc3AtPmFzc29jUnNwTGVuZ3RoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5jb25uZWN0ZWRJbmZvLm5CZWFjb25MZW5ndGggPSBwSm9pblJzcC0+YmVhY29uTGVuZ3RoOworI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPmNvbm5lY3RlZEluZm8ublJJQ1JzcExlbmd0aCA9IHBKb2luUnNwLT5wYXJzZWRSaWNSc3BMZW47CisjZW5kaWYgLyogV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIgKi8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorI2lmZGVmIEZFQVRVUkVfV0xBTl9FU0UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+Y29ubmVjdGVkSW5mby5uVHNwZWNJZUxlbmd0aCA9IHBKb2luUnNwLT50c3BlY0llTGVuOworI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm9hbUluZm8ubkFzc29jUmVxTGVuZ3RoID0gcEpvaW5Sc3AtPmFzc29jUmVxTGVuZ3RoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvYW1JbmZvLm5Bc3NvY1JzcExlbmd0aCA9IHBKb2luUnNwLT5hc3NvY1JzcExlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByb2FtSW5mby5uQmVhY29uTGVuZ3RoID0gcEpvaW5Sc3AtPmJlYWNvbkxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByb2FtSW5mby5wYkZyYW1lcyA9IHBTZXNzaW9uLT5jb25uZWN0ZWRJbmZvLnBiRnJhbWVzOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmKHBDb21tYW5kLT51LnJvYW1DbWQuZlJlYXNzb2MpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJvYW1JbmZvLmZSZWFzc29jUmVxID0gcm9hbUluZm8uZlJlYXNzb2NSc3AgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+Y29ubmVjdGVkSW5mby5zdGFJZCA9ICggdEFOSV9VOCApcEpvaW5Sc3AtPnN0YUlkOworICAgICAgICAgICAgICAgICAgICByb2FtSW5mby5zdGFJZCA9ICggdEFOSV9VOCApcEpvaW5Sc3AtPnN0YUlkOworICAgICAgICAgICAgICAgICAgICByb2FtSW5mby51Y2FzdFNpZyA9ICggdEFOSV9VOCApcEpvaW5Sc3AtPnVjYXN0U2lnOworICAgICAgICAgICAgICAgICAgICByb2FtSW5mby5iY2FzdFNpZyA9ICggdEFOSV9VOCApcEpvaW5Sc3AtPmJjYXN0U2lnOworICAgICAgICAgICAgICAgICAgICByb2FtSW5mby5tYXhSYXRlRmxhZ3MgPSBwSm9pblJzcC0+bWF4UmF0ZUZsYWdzOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIGlmKHBDb21tYW5kLT51LnJvYW1DbWQuZlJlYXNzb2MpCisgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICByb2FtSW5mby5mUmVhc3NvY1JlcSA9IHJvYW1JbmZvLmZSZWFzc29jUnNwID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICAgICAgICAgICAgIHJvYW1JbmZvLm5Bc3NvY1JlcUxlbmd0aCA9IHBTZXNzaW9uLT5jb25uZWN0ZWRJbmZvLm5Bc3NvY1JlcUxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgcm9hbUluZm8ubkFzc29jUnNwTGVuZ3RoID0gcFNlc3Npb24tPmNvbm5lY3RlZEluZm8ubkFzc29jUnNwTGVuZ3RoOworICAgICAgICAgICAgICAgICAgICAgICByb2FtSW5mby5uQmVhY29uTGVuZ3RoID0gcFNlc3Npb24tPmNvbm5lY3RlZEluZm8ubkJlYWNvbkxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgcm9hbUluZm8ucGJGcmFtZXMgPSBwU2Vzc2lvbi0+Y29ubmVjdGVkSW5mby5wYkZyYW1lczsKKyAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8qIFVwZGF0ZSB0aGUgc3RhSWQgZnJvbSB0aGUgcHJldmlvdXMgY29ubmVjdGVkIHByb2ZpbGUgaW5mbworICAgICAgICAgICAgICAgICAgIGFzIHRoZSByZWFzc29jaWF0aW9uIGlzIHRyaWdncmVkIGF0IFNNRS9IREQgKi8KKyAgICAgICAgICAgICAgICBpZiggKGVDc3JIZGRJc3N1ZWRSZWFzc29jVG9TYW1lQVAgPT0gcENvbW1hbmQtPnUucm9hbUNtZC5yb2FtUmVhc29uKSB8fAorICAgICAgICAgICAgICAgICAgICAoZUNzclNtZUlzc3VlZFJlYXNzb2NUb1NhbWVBUCA9PSBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1SZWFzb24pICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHJvYW1JbmZvLnN0YUlkID0gcFNlc3Npb24tPmNvbm5lY3RlZEluZm8uc3RhSWQ7CisgICAgICAgICAgICAgICAgfQorI2lmbmRlZiBXTEFOX01ETV9DT0RFX1JFRFVDVElPTl9PUFQKKyAgICAgICAgICAgICAgICAvLyBJbmRpY2F0ZSBTTUUtUU9TIHdpdGggcmVhc3NvYyBzdWNjZXNzIGV2ZW50LCBvbmx5IGFmdGVyIAorICAgICAgICAgICAgICAgIC8vIGNvcHlpbmcgdGhlIGZyYW1lcyAKKyAgICAgICAgICAgICAgICBzbWVfUW9zQ3NyRXZlbnRJbmQocE1hYywgKHZfVThfdClzZXNzaW9uSWQsIGluZF9xb3MsICZhc3NvY0luZm8pOworI2VuZGlmCisgICAgICAgICAgICAgICAgcm9hbUluZm8ucEJzc0Rlc2MgPSBwU2lyQnNzRGVzYzsKKyAgICAgICAgICAgICAgICByb2FtSW5mby5zdGF0dXNDb2RlID0gcFNlc3Npb24tPmpvaW5GYWlsU3RhdHVzQ29kZS5zdGF0dXNDb2RlOworICAgICAgICAgICAgICAgIHJvYW1JbmZvLnJlYXNvbkNvZGUgPSBwU2Vzc2lvbi0+am9pbkZhaWxTdGF0dXNDb2RlLnJlYXNvbkNvZGU7CisjaWZuZGVmIFdMQU5fTURNX0NPREVfUkVEVUNUSU9OX09QVAorICAgICAgICAgICAgICAgIGFjbV9tYXNrID0gc21lX1Fvc0dldEFDTU1hc2socE1hYywgcFNpckJzc0Rlc2MsIE5VTEwpOworI2VuZGlmIC8qIFdMQU5fTURNX0NPREVfUkVEVUNUSU9OX09QVCovCisgICAgICAgICAgICAgICAgcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUuYWNtX21hc2sgPSBhY21fbWFzazsKKyAgICAgICAgICAgICAgICAvL3N0YXJ0IFVBUFNEIGlmIHVhcHNkX21hc2sgaXMgbm90IDAgYmVjYXVzZSBIREQgd2lsbCBjb25maWd1cmUgZm9yIHRyaWdnZXIgZnJhbWUKKyAgICAgICAgICAgICAgICAvL0l0IG1heSBiZSBiZXR0ZXIgdG8gbGV0IFFvUyBkbyB0aGlzPz8/PworICAgICAgICAgICAgICAgIGlmKCBwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS5tb2RpZnlQcm9maWxlRmllbGRzLnVhcHNkX21hc2sgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsICIgdWFwc2RfbWFzayAoMHglWCkgc2V0LCByZXF1ZXN0IFVBUFNEIG5vdyIsCisgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS5tb2RpZnlQcm9maWxlRmllbGRzLnVhcHNkX21hc2spOworICAgICAgICAgICAgICAgICAgICBwbWNTdGFydFVhcHNkKCBwTWFjLCBOVUxMLCBOVUxMICk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlLmRvdDExTW9kZSA9IHBTZXNzaW9uLT5ic3NQYXJhbXMudUNmZ0RvdDExTW9kZTsKKyAgICAgICAgICAgICAgICByb2FtSW5mby51LnBDb25uZWN0ZWRQcm9maWxlID0gJnBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlOworICAgICAgICAgICAgICAgIGlmKCBwU2Vzc2lvbi0+YlJlZkFzc29jU3RhcnRDbnQgPiAwICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5iUmVmQXNzb2NTdGFydENudC0tOworICAgICAgICAgICAgICAgICAgICAvL1JlbW92ZSB0aGlzIGNvZGUgb25jZSBTTE1fU2Vzc2lvbml6YXRpb24gaXMgc3VwcG9ydGVkIAorICAgICAgICAgICAgICAgICAgICAvL0JNUFNfV09SS0FST1VORF9OT1RfTkVFREVECisgICAgICAgICAgICAgICAgICAgIGlmKCFJU19GRUFUVVJFX1NVUFBPUlRFRF9CWV9GVyhTTE1fU0VTU0lPTklaQVRJT04pICYmICggY3NySXNDb25jdXJyZW50U2Vzc2lvblJ1bm5pbmcoIHBNYWMgKSkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5kb0JNUFNXb3JrYXJvdW5kID0gMTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIHNlc3Npb25JZCwgJnJvYW1JbmZvLCBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1JZCwgZUNT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ub3VnaCB0byBsZXQgc2VjdXJpdHkgYW5kIERIQ1AgaGFuZHNoYWtlIHN1Y2NlZWQgYmVmb3JlIGVudHJ5IGludG8gQk1QUworICAgICAgICAgICAgaWYgKHBtY1Nob3VsZEJtcHNUaW1lclJ1bihwTWFjKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBTZXQgcmVtYWluSW5Qb3dlckFjdGl2ZVRpbGxESENQIHRvIG1ha2Ugc3VyZSB3ZSB3YWl0IGZvcgorICAgICAgICAgICAgICAgICAqIHVudGlsIGtleXMgYXJlIHNldCBiZWZvcmUgZ29pbmcgaW50byBCTVBTLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGlmKGVBTklfQk9PTEVBTl9UUlVFID09IHJvYW1JbmZvLmZBdXRoUmVxdWlyZWQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgcE1hYy0+cG1jLnJlbWFpbkluUG93ZXJBY3RpdmVUaWxsREhDUCA9IFRSVUU7CisgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HMSwgRkwoIlNldCByZW1haW5JblBvd2VyQWN0aXZlVGlsbERIQ1AgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0byBtYWtlIHN1cmUgd2Ugd2FpdCB1bnRpbCBrZXlzIGFyZSBzZXQgYmVmb3JlIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgZ29pbmcgdG8gQk1QUyIpKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAocG1jU3RhcnRUcmFmZmljVGltZXIocE1hYywgQk1QU19UUkFGRklDX1RJTUVSX0FMTE9XX1NFQ1VSSVRZX0RIQ1ApCisgICAgICAgICAgICAgICAgICAgICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HUCwgRkwoIkNhbm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BVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICBwU21lU3RhcnRCc3NSc3AgPSAodFNpclNtZVN0YXJ0QnNzUnNwICopQ29udGV4dDsKKyAgICAgICAgICAgIHZvc19tZW1fc2V0KCZyb2FtSW5mbywgc2l6ZW9mKHRDc3JSb2FtSW5mbyksIDApOworICAgICAgICAgICAgaWYoIENTUl9JU19JQlNTKCBwUHJvZmlsZSApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+Y29ubmVjdFN0YXRlID0gZUNTUl9BU1NPQ19TVEFURV9UWVBFX0lCU1NfRElTQ09OTkVDVEVEOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoQ1NSX0lTX0lORlJBX0FQKHBQcm9maWxlKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+Y29ubmVjdFN0YXRlID0gZUNTUl9BU1NPQ19TVEFURV9UWVBFX0lORlJBX0RJU0NPTk5FQ1RFRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+Y29ubmVjdFN0YXRlID0gZUNTUl9BU1NPQ19TVEFURV9UWVBFX1dEU19ESVNDT05ORUNURUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiggIUNTUl9JU19XRFNfU1RBKCBwUHJvZmlsZSApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjc3JSb2FtU3RhdGVDaGFuZ2UoIHBNYWMsIGVDU1JfUk9BTUlOR19TVEFURV9KT0lORUQsIHNlc3Npb25JZCApOworICAgICAgICAgICAgICAgIHBTaXJCc3NEZXNjID0gJnBTbWVTdGFydEJzc1JzcC0+YnNzRGVzY3JpcHRpb247CisgICAgICAgICAgICAgICAgaWYoICFIQUxfU1RBVFVTX1NVQ0NFU1MoY3NyR2V0UGFyc2VkQnNzRGVzY3JpcHRpb25JRXMoIHBNYWMsIHBTaXJCc3NEZXNjLCAmcEllcyApKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywgRkwoImNhbm5vdCBwYXJzZSBJQlNTIElFcyIpKTsKKyAgICAgICAgICAgICAgICAgICAgcm9hbUluZm8ucEJzc0Rlc2MgPSBwU2lyQnNzRGVzYzsKKyAgICAgICAgICAgICAgICAgICAgLy9XZSBuZWVkIHRvIGFzc29jaWF0ZV9jb21wbGV0ZSBpdCBmaXJzdCwgYmVjYXN1ZSBBc3NvY2lhdGVfc3RhcnQgYWxyZWFkeSBpbmRpY2F0ZWQuCisgICAgICAgICAgICAgICAgICAgIGNzclJvYW1DYWxsQ2FsbGJhY2soIHBNYWMsIHNlc3Npb25JZCwgJnJvYW1JbmZvLCBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1JZCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ST0FNX0lCU1NfSU5ELCBlQ1NSX1JPQU1fUkVTVUxUX0lCU1NfU1RBUlRfRkFJTEVEICk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIUNTUl9JU19JTkZSQV9BUChwUHJvZmlsZSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwU2NhblJlc3VsdCA9IGNzclNjYW5BcHBlbmRCc3NEZXNjcmlwdGlvbiggcE1hYywgcFNpckJzc0Rlc2MsIHBJZXMsIEZBTFNFICk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGNzclJvYW1TYXZlQ29ubmVjdGVkQnNzRGVzYyhwTWFjLCBzZXNzaW9uSWQsIHBTaXJCc3NEZXNjKTsKKyAgICAgICAgICAgICAgICBjc3JSb2FtRnJlZUNvbm5lY3RQcm9maWxlKHBNYWMsICZwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZSk7CisgICAgICAgICAgICAgICAgY3NyUm9hbUZyZWVDb25uZWN0ZWRJbmZvKCBwTWFjLCAmcFNlc3Npb24tPmNvbm5lY3RlZEluZm8gKTsKKyAgICAgICAgICAgICAgICBpZihwU2lyQnNzRGVzYykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGNzclJvYW1TYXZlQ29ubmVjdGVkSW5mb21hdGlvbihwTWFjLCBzZXNzaW9uSWQsIHBQcm9maWxlLCBwU2lyQnNzRGVzYywgcEllcyk7CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmcm9hbUluZm8uYnNzaWQsICZwU2lyQnNzRGVzYy0+YnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodENzckJzc2lkKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8vV2UgYXJlIGRvZW4gd2l0aCB0aGUgSUVzIHNvIGZyZWUgaXQKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocEllcyk7CisjaWZkZWYgRkVBVFVSRV9XTEFOX0RJQUdfU1VQUE9SVF9DU1IKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHZvc19sb2dfaWJzc19wa3RfdHlwZSAqcElic3NMb2c7CisgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIGJpOworICAgIAorICAgICAgICAgICAgICAgICAgICBXTEFOX1ZPU19ESUFHX0xPR19BTExPQyhwSWJzc0xvZywgdm9zX2xvZ19pYnNzX3BrdF90eXBlLCBMT0dfV0xBTl9JQlNTX0MpOworICAgICAgICAgICAgICAgICAgICBpZihwSWJzc0xvZykKKyAgICAgICAgICAgICAgICAgICAgeyAKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKENTUl9JTlZBTElEX1NDQU5SRVNVTFRfSEFORExFID09IHBDb21tYW5kLT51LnJvYW1DbWQuaEJTU0xpc3QpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9XZSBzdGFydCB0aGUgSUJTUyAoZGlkbid0IGZpbmQgYW55IG1hdGNoZWQgSUJTUyBvdXQgdGhlcmUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcElic3NMb2ctPmV2ZW50SWQgPSBXTEFOX0lCU1NfRVZFTlRfU1RBUlRfSUJTU19SU1A7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcElic3NMb2ctPmV2ZW50SWQgPSBXTEFOX0lCU1NfRVZFTlRfSk9JTl9JQlNTX1JTUDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBTaXJCc3NEZXNjKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwSWJzc0xvZy0+YnNzaWQsIHBTaXJCc3NEZXNjLT5ic3NJZCwgNik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcElic3NMb2ctPm9wZXJhdGluZ0NoYW5uZWwgPSBwU2lyQnNzRGVzYy0+Y2hhbm5lbElkOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYoSEFMX1NUQVRVU19TVUNDRVNTKGNjbUNmZ0dldEludChwTWFjLCBXTklfQ0ZHX0JFQUNPTl9JTlRFUlZBTCwgJmJpKSkpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8qKipVOCBpcyBub3QgZW5vdWdoIGZvciBiZWFjb24gaW50ZXJ2YWwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWJzc0xvZy0+YmVhY29uSW50ZXJ2YWwgPSAodl9VOF90KWJpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9WT1NfRElBR19MT0dfUkVQT1JUKHBJYnNzTG9nKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyNlbmRpZiAvLyNpZmRlZiBGRUFUVVJFX1dMQU5fRElBR19TVVBQT1JUX0NTUgorICAgICAgICAgICAgICAgIC8vT25seSBzZXQgY29udGV4dCBmb3Igbm9uLVdEU19TVEEuIFdlIGRvbid0IGV2ZW4gbmVlZCBpdCBmb3IgV0RTX0FQLiBCdXQgc2luY2UgdGhlIGVuY3J5cHRpb24KKyAgICAgICAgICAgICAgICAvL2lzIFdQQTItUFNLIHNvIGl0IHdvbid0IG1hdHRlci4KKyAgICAgICAgICAgICAgICBpZiggQ1NSX0lTX0VOQ19UWVBFX1NUQVRJQyggcFByb2ZpbGUtPm5lZ290aWF0ZWRVQ0VuY3J5cHRpb25UeXBlICkgJiYgIUNTUl9JU19JTkZSQV9BUCggcFNlc3Npb24tPnBDdXJSb2FtUHJvZmlsZSApKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gSXNzdWUgdGhlIHNldCBDb250ZXh0IHJlcXVlc3QgdG8gTElNIHRvIGVzdGFibGlzaCB0aGUgQnJvYWRjYXN0IFNUQSBjb250ZXh0IGZvciB0aGUgSWJzcy4KKyAgICAgICAgICAgICAgICAgICAgY3NyUm9hbUlzc3VlU2V0Q29udGV4dFJlcSggcE1hYywgc2Vzc2lvbklkLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUHJvZmlsZS0+bmVnb3RpYXRlZE1DRW5jcnlwdGlvblR5cGUsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTaXJCc3NEZXNjLCAmQnJvYWRjYXN0TWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZBTFNFLCBGQUxTRSwgZVNJUl9UWF9SWCwgMCwgMCwgTlVMTCwgMCApOyAvLyBOTyBrZXlzLi4uIHRoZXNlIGtleSBwYXJhbWV0ZXJzIGRvbid0IG1hdHRlci4KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9LZWVwIHRoZSBzdGF0ZSB0byBlQ1NSX1JPQU1JTkdfU1RBVEVfSk9JTklORworICAgICAgICAgICAgICAgIC8vTmVlZCB0byBzZW5kIGpvaW5fcmVxLgorICAgICAgICAgICAgICAgIGlmKHBDb21tYW5kLT51LnJvYW1DbWQucFJvYW1Cc3NFbnRyeSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmKChwU2NhblJlc3VsdCA9IEdFVF9CQVNFX0FERFIocENvbW1hbmQtPnUucm9hbUNtZC5wUm9hbUJzc0VudHJ5LCB0Q3NyU2NhblJlc3VsdCwgTGluaykpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwU2lyQnNzRGVzYyA9ICZwU2NhblJlc3VsdC0+UmVzdWx0LkJzc0Rlc2NyaXB0b3I7CisgICAgICAgICAgICAgICAgICAgICAgICBwSWVzID0gKHREb3QxMWZCZWFjb25JRXMgKikoIHBTY2FuUmVzdWx0LT5SZXN1bHQucHZJZXMgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNldCB0aGUgcm9hbWluZyBzdWJzdGF0ZSB0byAnam9pbiBhdHRlbXB0Jy4uLgorICAgICAgICAgICAgICAgICAgICAgICAgY3NyUm9hbVN1YnN0YXRlQ2hhbmdlKCBwTWFjLCBlQ1NSX1JPQU1fU1VCU1RBVEVfSk9JTl9SRVEsIHNlc3Npb25JZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JTZW5kSm9pblJlcU1zZyggcE1hYywgc2Vzc2lvbklkLCBwU2lyQnNzRGVzYywgcFByb2ZpbGUsIHBJZXMsIGVXTklfU01FX0pPSU5fUkVRICk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAiIFN0YXJ0QlNTIGZvciBXRFMgc3RhdGlvbiB3aXRoIG5vIEJzc0Rlc2MiICk7CisgICAgICAgICAgICAgICAgICAgIFZPU19BU1NFUlQoIDAgKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvL09ubHkgdGVsbCB1cHBlciBsYXllciBpcyB3ZSBzdGFydCB0aGUgQlNTIGJlY2F1c2UgVmlzdGEgZG9lc24ndCBsaWtlIG11bHRpcGxlIGNvbm5lY3Rpb24KKyAgICAgICAgICAgIC8vaW5kaWNhdGlvbnMuIElmIHdlIGRvbid0IHN0YXJ0IHRoZSBCU1Mgb3Vyc2VsZiwgaGFuZGxlciBvZiBlU0lSX1NNRV9KT0lORURfTkVXX0JTUyB3aWxsIAorICAgICAgICAgICAgLy90cmlnZ2VyIHRoZSBjb25uZWN0aW9uIHN0YXJ0IGluZGljYXRpb24gaW4gVmlzdGEKKyAgICAgICAgICAgIGlmKCAhQ1NSX0lTX0pPSU5fVE9fSUJTUyggcFByb2ZpbGUgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcm9hbVN0YXR1cyA9IGVDU1JfUk9BTV9JQlNTX0lORDsKKyAgICAgICAgICAgICAgICByb2FtUmVzdWx0ID0gZUNTUl9ST0FNX1JFU1VMVF9JQlNTX1NUQVJURUQ7CisgICAgICAgICAgICAgICAgaWYoIENTUl9JU19XRFMoIHBQcm9maWxlICkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcm9hbVN0YXR1cyA9IGVDU1JfUk9BTV9XRFNfSU5EOworICAgICAgICAgICAgICAgICAgICByb2FtUmVzdWx0ID0gZUNTUl9ST0FNX1JFU1VMVF9XRFNfU1RBUlRFRDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYoIENTUl9JU19JTkZSQV9BUCggcFByb2ZpbGUgKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICByb2FtU3RhdHVzID0gZUNTUl9ST0FNX0lORlJBX0lORDsKKyAgICAgICAgICAgICAgICAgICAgcm9hbVJlc3VsdCA9IGVDU1JfUk9BTV9SRVNVTFRfSU5GUkFfU1RBUlRFRDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIC8vT25seSB0ZWxsIHVwcGVyIGxheWVyIGlzIHdlIHN0YXJ0IHRoZSBCU1MgYmVjYXVzZSBWaXN0YSBkb2Vzbid0IGxpa2UgbXVsdGlwbGUgY29ubmVjdGlvbgorICAgICAgICAgICAgICAgIC8vaW5kaWNhdGlvbnMuIElmIHdlIGRvbid0IHN0YXJ0IHRoZSBCU1Mgb3Vyc2VsZiwgaGFuZGxlciBvZiBlU0lSX1NNRV9KT0lORURfTkVXX0JTUyB3aWxsIAorICAgICAgICAgICAgICAgIC8vdHJpZ2dlciB0aGUgY29ubmVjdGlvbiBzdGFydCBpbmRpY2F0aW9uIGluIFZpc3RhCisgICAgICAgICAgICAgICAgdm9zX21lbV9zZXQoJnJvYW1JbmZvLCBzaXplb2YodENzclJvYW1JbmZvKSwgMCk7CisgICAgICAgICAgICAgICAgcm9hbUluZm8uc3RhdHVzQ29kZSA9IHBTZXNzaW9uLT5qb2luRmFpbFN0YXR1c0NvZGUuc3RhdHVzQ29kZTsKKyAgICAgICAgICAgICAgICByb2FtSW5mby5yZWFzb25Db2RlID0gcFNlc3Npb24tPmpvaW5GYWlsU3RhdHVzQ29kZS5yZWFzb25Db2RlOworICAgICAgICAgICAgICAgIC8vV2Ugc3RhcnQgdGhlIElCU1MgKGRpZG4ndCBmaW5kIGFueSBtYXRjaGVkIElCU1Mgb3V0IHRoZXJlKQorICAgICAgICAgICAgICAgIHJvYW1JbmZvLnBCc3NEZXNjID0gcFNpckJzc0Rlc2M7CisgICAgICAgICAgICAgICAgcm9hbUluZm8uc3RhSWQgPSAodEFOSV9VOClwU21lU3RhcnRCc3NSc3AtPnN0YUlkOworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShyb2FtSW5mby5ic3NpZCwgcFNpckJzc0Rlc2MtPmJzc0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodENzckJzc2lkKSk7CisgICAgICAgICAgICAgICAgIC8vUmVtb3ZlIHRoaXMgY29kZSBvbmNlIFNMTV9TZXNzaW9uaXphdGlvbiBpcyBzdXBwb3J0ZWQgCisgICAgICAgICAgICAgICAgIC8vQk1QU19XT1JLQVJPVU5EX05PVF9ORUVERUQKKyAgICAgICAgICAgICAgICBpZighSVNfRkVBVFVSRV9TVVBQT1JURURfQllfRlcoU0xNX1NFU1NJT05JWkFUSU9OKSAmJgorICAgICAgICAgICAgICAgICAgICggY3NySXNDb25jdXJyZW50U2Vzc2lvblJ1bm5pbmcoIHBNYWMgKSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uZG9CTVBTV29ya2Fyb3VuZCA9IDE7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgY3NyUm9hbUNhbGxDYWxsYmFjayggcE1hYywgc2Vzc2lvbklkLCAmcm9hbUluZm8sIHBDb21tYW5kLT51LnJvYW1DbWQucm9hbUlkLCByb2FtU3RhdHVzLCByb2FtUmVzdWx0ICk7CisgICAgICAgICAgICB9CisgICAgCisgICAgICAgICAgICBjc3JTY2FuQ2FuY2VsSWRsZVNjYW4ocE1hYyk7CisKKyAgICAgICAgICAgIGlmKCBDU1JfSVNfV0RTX1NUQSggcFByb2ZpbGUgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9uZWVkIHRvIHNlbmQgc3RvcCBCU1MgYmVjYXVzZSB3ZSBmYWlsIHRvIHNlbmQgam9pbl9yZXEKKyAgICAgICAgICAgICAgICBjc3JSb2FtSXNzdWVEaXNhc3NvY2lhdGVDbWQoIHBNYWMsIHNlc3Npb25JZCwgZUNTUl9ESVNDT05ORUNUX1JFQVNPTl9VTlNQRUNJRklFRCApOworICAgICAgICAgICAgICAgIGNzclJvYW1DYWxsQ2FsbGJhY2soIHBNYWMsIHNlc3Npb25JZCwgJnJvYW1JbmZvLCBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1JZCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ST0FNX1dEU19JTkQsIGVDU1JfUk9BTV9SRVNVTFRfV0RTX1NUT1BQRUQgKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVDc3JTdGFydEJzc0ZhaWx1cmU6CisjaWZkZWYgRkVBVFVSRV9XTEFOX0RJQUdfU1VQUE9SVF9DU1IKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbG9nX2lic3NfcGt0X3R5cGUgKnBJYnNzTG9nOworICAgICAgICAgICAgICAgIFdMQU5fVk9TX0RJQUdfTE9HX0FMTE9DKHBJYnNzTG9nLCB2b3NfbG9nX2lic3NfcGt0X3R5cGUsIExPR19XTEFOX0lCU1NfQyk7CisgICAgICAgICAgICAgICAgaWYocElic3NMb2cpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwSWJzc0xvZy0+c3RhdHVzID0gV0xBTl9JQlNTX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgICAgICAgICBXTEFOX1ZPU19ESUFHX0xPR19SRVBPUlQocElic3NMb2cpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyNlbmRpZiAvLyNpZmRlZiBGRUFUVVJFX1dMQU5fRElBR19TVVBQT1JUX0NTUgorICAgICAgICAgICAgcm9hbVN0YXR1cyA9IGVDU1JfUk9BTV9JQlNTX0lORDsKKyAgICAgICAgICAgIHJvYW1SZXN1bHQgPSBlQ1NSX1JPQU1fUkVTVUxUX0lCU1NfU1RBUlRFRDsKKyAgICAgICAgICAgIGlmKCBDU1JfSVNfV0RTKCBwUHJvZmlsZSApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByb2FtU3RhdHVzID0gZUNTUl9ST0FNX1dEU19JTkQ7CisgICAgICAgICAgICAgICAgcm9hbVJlc3VsdCA9IGVDU1JfUk9BTV9SRVNVTFRfV0RTX1NUQVJURUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiggQ1NSX0lTX0lORlJBX0FQKCBwUHJvZmlsZSApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByb2FtU3RhdHVzID0gZUNTUl9ST0FNX0lORlJBX0lORDsKKyAgICAgICAgICAgICAgICByb2FtUmVzdWx0ID0gZUNTUl9ST0FNX1JFU1VMVF9JTkZSQV9TVEFSVF9GQUlMRUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZihDb250ZXh0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBTaXJCc3NEZXNjID0gKHRTaXJCc3NEZXNjcmlwdGlvbiAqKUNvbnRleHQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFNpckJzc0Rlc2MgPSBOVUxMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdm9zX21lbV9zZXQoJnJvYW1JbmZvLCBzaXplb2YodENzclJvYW1JbmZvKSwgMCk7CisgICAgICAgICAgICByb2FtSW5mby5wQnNzRGVzYyA9IHBTaXJCc3NEZXNjOworICAgICAgICAgICAgLy9XZSBuZWVkIHRvIGFzc29jaWF0ZV9jb21wbGV0ZSBpd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ICAgICAgICAgdm9zX21lbV9jb3B5KCZyb2FtSW5mby5ic3NpZCwgJnJvYW1JbmZvLnBCc3NEZXNjLT5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRDc3JCc3NpZCkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy9TaW5jZSB0aGVyZSBpcyBubyBjaGFuZ2UgaW4gdGhlIGN1cnJlbnQgc3RhdGUsIHNpbXBseSBwYXNzIGJhY2sgbm8gcmVzdWx0IG90aGVyd2lzZQorICAgICAgICAgICAgLy9IREQgbWF5IGJlIG1pc3Rha2VubHkgbWFyayB0byBkaXNjb25uZWN0ZWQgc3RhdGUuCisgICAgICAgICAgICBjc3JSb2FtQ2FsbENhbGxiYWNrKCBwTWFjLCBzZXNzaW9uSWQsICZyb2FtSW5mbywgcENvbW1hbmQtPnUucm9hbUNtZC5yb2FtSWQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfUk9BTV9JQlNTX0lORCwgZUNTUl9ST0FNX1JFU1VMVF9OT05FICk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlQ3NyU2lsZW50bHlTdG9wUm9hbWluZ1NhdmVTdGF0ZToKKyAgICAgICAgICAgIC8vV2UgYXJlIGhlcmUgYmVjYXVzZSB3ZSB0cnkgdG8gY29ubmVjdCB0byB0aGUgc2FtZSBBUAorICAgICAgICAgICAgLy9ObyBtZXNzYWdlIHRvIFBFCisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywgRkwoInJlY2VpdmVzIHNpbGVudGx5IHN0b3Agcm9hbWluZyBpbmRpY2F0aW9uIikpOworICAgICAgICAgICAgdm9zX21lbV9zZXQoJnJvYW1JbmZvLCBzaXplb2Yocm9hbUluZm8pLCAwKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgLy90byBhdmlvZCByZXNldHRpbmcgdGhlIHN1YnN0YXRlIHRvIE5PTkUKKyAg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2luIFdEUyIpKTsKKyAgICAgICAgICAgIGNzckZyZWVDb25uZWN0QnNzRGVzYyhwTWFjLCBzZXNzaW9uSWQpOworICAgICAgICAgICAgY3NyUm9hbUZyZWVDb25uZWN0UHJvZmlsZShwTWFjLCAmcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUpOworICAgICAgICAgICAgY3NyUm9hbUZyZWVDb25uZWN0ZWRJbmZvKCBwTWFjLCAmcFNlc3Npb24tPmNvbm5lY3RlZEluZm8gKTsKKyAgICAgICAgICAgIHZvc19tZW1fc2V0KCZyb2FtSW5mbywgc2l6ZW9mKHRDc3JSb2FtSW5mbyksIDApOworICAgICAgICAgICAgcm9hbUluZm8ucEJzc0Rlc2MgPSBwQ29tbWFuZC0+dS5yb2FtQ21kLnBMYXN0Um9hbUJzczsKKyAgICAgICAgICAgIHJvYW1JbmZvLnN0YXR1c0NvZGUgPSBwU2Vzc2lvbi0+am9pbkZhaWxTdGF0dXNDb2RlLnN0YXR1c0NvZGU7CisgICAgICAgICAgICByb2FtSW5mby5yZWFzb25Db2RlID0gcFNlc3Npb24tPmpvaW5GYWlsU3RhdHVzQ29kZS5yZWFzb25Db2RlOworICAgICAgICAgICAgY3NyUm9hbUNhbGxDYWxsYmFjayhwTWFjLCBzZXNzaW9uSWQsICZyb2FtSW5mbywgcENvbW1hbmQtPnUucm9hbUNtZC5yb2FtSWQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ST0FNX1dEU19JTkQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ST0FNX1JFU1VMVF9XRFNfTk9UX0FTU09DSUFURUQpOworICAgICAgICAgICAgLy9OZWVkIHRvIGlzc3VlIHN0b3BfYnNzCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlQ3NySm9pbkZhaWx1cmU6CisgICAgICAgIGNhc2UgZUNzck5vdGhpbmdUb0pvaW46CisgICAgICAgIGNhc2UgZUNzckpvaW5GYWlsdXJlRHVlVG9Db25jdXJyZW5jeToKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csIEZMKCJyZWNlaXZlcyBubyBhc3NvY2lhdGlvbiBpbmRpY2F0aW9uIikpOworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsIEZMKCJBc3NvYyByZWYgY291bnQgJWQiKSwKKyAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+YlJlZkFzc29jU3RhcnRDbnQpOworICAgICAgICAgICAgaWYoIENTUl9JU19JTkZSQVNUUlVDVFVSRSggJnBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlICkgfHwgCisgICAgICAgICAgICAgICAgQ1NSX0lTX1JPQU1fU1VCU1RBVEVfU1RPUF9CU1NfUkVRKCBwTWFjLCBzZXNzaW9uSWQgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9kbyBub3QgZnJlZSBmb3IgdGhlIG90aGVyIHByb2ZpbGVzIGFzIHdlIG5lZWQgdG8gc2VuZCBkb3duIHN0b3AgQlNTIGxhdGVyCisgICAgICAgICAgICAgICAgY3NyRnJlZUNvbm5lY3RCc3NEZXNjKHBNYWMsIHNlc3Npb25JZCk7CisgICAgICAgICAgICAgICAgY3NyUm9hbUZyZWVDb25uZWN0UHJvZmlsZShwTWFjLCAmcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUpOworICAgICAgICAgICAgICAgIGNzclJvYW1GcmVlQ29ubmVjdGVkSW5mbyggcE1hYywgJnBTZXNzaW9uLT5jb25uZWN0ZWRJbmZvICk7CisgICAgICAgICAgICAgICAgY3NyU2V0RGVmYXVsdERvdDExTW9kZSggcE1hYyApOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBzd2l0Y2goIHBDb21tYW5kLT51LnJvYW1DbWQucm9hbVJlYXNvbiApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8g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CwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwU2Vzc2lvbi0+am9pbkZhaWxTdGF0dXNDb2RlLmJzc0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRDc3JCc3NpZCkpOworCisgICAgICAgICAgICAgICAgICAgIC8qIERlZmVhdHVyaXplIHRoaXMgbGF0ZXIgaWYgbmVlZGVkICovCisjaWZkZWYgV0xBTl9GRUFUVVJFX05FSUdIQk9SX1JPQU1JTkcKKyAgICAgICAgICAgICAgICAgICAgLyogSWYgSm9pbiBmYWlscyB3aGlsZSBIYW5kb2ZmIGlzIGluIHByb2dyZXNzLCBpbmRpY2F0ZSBkaXNhc3NvY2lhdGVkIGV2ZW50IHRvIHN1cHBsaWNhbnQgdG8gcmVjb25uZWN0ICovCisgICAgICAgICAgICAgICAgICAgIGlmIChjc3JSb2FtSXNIYW5kb2ZmSW5Qcm9ncmVzcyhwTWFjKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLyogU2hvdWxkIGluZGljYXRlIG5laWdoYm9yIHJvYW0gYWxnb3JpdGhtIGFib3V0IHRoZSBjb25uZWN0IGZhaWx1cmUgaGVyZSAqLworICAgICAgICAgICAgICAgICAgICAgICAgY3NyTmVpZ2hib3JSb2FtSW5kaWNhdGVDb25uZWN0KHBNYWMsICh0QU5JX1U4KXNlc3Npb25JZCwgVk9TX1NUQVRVU19FX0ZBSUxVUkUpOworICAgICAgICAgICAgICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBTZXNzaW9uLT5iUmVmQXNzb2NTdGFydENudCA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPmJSZWZBc3NvY1N0YXJ0Q250LS07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZUNzckpvaW5GYWlsdXJlRHVlVG9Db25jdXJyZW5jeSA9PSBSZXN1bHQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIHNlc3Npb25JZCwgJnJvYW1JbmZvLCBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1JZCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fQVNTT0NJQVRJT05fQ09NUExFVElPTiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fUkVTVUxUX0FTU09DX0ZBSUxfQ09OX0NIQU5ORUwpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIHNlc3Npb25JZCwgJnJvYW1JbmZvLCBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1JZCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fQVNTT0NJQVRJT05fQ09NUExFVElPTiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fUkVTVUxUX0ZBSUxVUkUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBiUmVmQXNzb2NTdGFydENudCBpcyBub3QgaW5jcmVtZW50ZWQgd2hlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGVSb2FtU3RhdGUgPT0gZUNzclN0b3BSb2FtaW5nRHVlVG9Db25jdXJyZW5jeQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGluIGNzclJvYW1Kb2luTmV4dEJzcyBBUEkuIHNvIGhhbmRsZSB0aGlzIGluCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogZWxzZSBjYXNlIGJ5IHNlbmRpbmcgYXNzb2MgZmFpbHVyZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNzclJvYW1DYWxsQ2FsbGJhY2socE1hYywgc2Vzc2lvbklkLCAmcm9hbUluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ29tbWFuZC0+dS5zY2FuQ21kLnJvYW1JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfUk9BTV9BU1NPQ0lBVElPTl9GQUlMVVJFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ST0FNX1JFU1VMVF9GQUlMVVJFKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsIEZMKCIgIHJvYW0ocmVhc29uICVkKSBmYWlsZWQiKSwgcENvbW1hbmQtPnUucm9hbUNtZC5yb2FtUmVhc29uKTsKKyNpZm5kZWYgV0xBTl9NRE1fQ09ERV9SRURVQ1RJT05fT1BUCisgICAgICAgICAgICAgICAgICAgIHNtZV9Rb3NVcGRhdGVIYW5kT2ZmKCh0QU5JX1U4KXNlc3Npb25JZCwgVk9TX0ZBTFNFKTsKKyAgICAgICAgICAgICAgICAgICAgc21lX1Fvc0NzckV2ZW50SW5kKHBNYWMsICh0QU5JX1U4KXNlc3Npb25JZCwgU01FX1FPU19DU1JfRElTQ09OTkVDVF9JTkQsIE5VTEwpOworI2VuZGlmCisgICAgICAgICAgICAgICAgICAgIGNzclJvYW1Db21wbGV0aW9uKHBNYWMsIHNlc3Npb25JZCwgTlVMTCwgcENvbW1hbmQsIGVDU1JfUk9BTV9SRVNVTFRfRkFJTFVSRSwgZUFOSV9CT09MRUFOX0ZBTFNFKTsKKyAgICAgICAgICAgICAgICAgICAgY3NyU2NhblN0YXJ0SWRsZVNjYW4ocE1hYyk7CisjaWZkZWYgRkVBVFVSRV9XTEFOX0JUQU1QX1VUX1JGCisgICAgICAgICAgICAgICAgICAgIC8vRm9yIFdEUyBTVEEuIFRvIGZpeCB0aGUgaXNzdWUgd2hlcmUgdGhlIFdEUyBBUCBzaWRlIG1heSBiZSB0b28gYnVzeSBieQorICAgICAgICAgICAgICAgICAgICAvL0JUIGFjdGl2aXR5IGFuZCBub3QgYWJsZSB0byByZWNldmllIFdMQU4gdHJhZmZpYy4gUmV0cnkgdGhlIGpvaW4KKyAgICAgICAgICAgICAgICAgICAgaWYoIENTUl9JU19XRFNfU1RBKHBQcm9maWxlKSApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNzclJvYW1TdGFydEpvaW5SZXRyeVRpbWVyKHBNYWMsIHNlc3Npb25JZCwgQ1NSX0pPSU5fUkVUUllfVElNRU9VVF9QRVJJT0QpOworICAgICAgICAgICAgICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBlQ3NySGRkSXNzdWVkUmVhc3NvY1RvU2FtZUFQOgorICAgICAgICAgICAgICAgIGNhc2UgZUNzclNtZUlzc3VlZFJlYXNzb2NUb1NhbWVBUDoKKyAgICAgICAgICAgICAgICAgICAgY3NyUm9hbVN0YXRlQ2hhbmdlKCBwTWFjLCBlQ1NSX1JPQU1JTkdfU1RBVEVfSURMRSwgc2Vzc2lvbklkKTsKKworICAgICAgICAgICAgICAgICAgICBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIHNlc3Npb25JZCwgTlVMTCwgcENvbW1hbmQtPnUucm9hbUNtZC5yb2FtSWQsIGVDU1JfUk9BTV9ESVNBU1NPQ0lBVEVELCBlQ1NSX1JPQU1fUkVTVUxUX0ZPUkNFRCk7CisjaWZuZGVmIFdMQU5fTURNX0NPREVfUkVEVUNUSU9OX09QVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgc21lX1Fvc0NzckV2ZW50SW5kKHBNYWMsICh0QU5JX1U4KXNlc3Npb25JZCwgU01FX1FPU19DU1JfRElTQ09OTkVDVF9JTkQsIE5VTEwpOworI2VuZGlmCisgICAgICAgICAgICAgICAgICAgIGNzclJvYW1Db21wbGV0aW9uKHBNYWMsIHNlc3Npb25JZCwgTlVMTCwgcENvbW1hbmQsIGVDU1JfUk9BTV9SRVNVTFRfRkFJTFVSRSwgZUFOSV9CT09MRUFOX0ZBTFNFKTsKKyAgICAgICAgICAgICAgICAgICAgY3NyU2NhblN0YXJ0SWRsZVNjYW4ocE1hYyk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgZUNzckZvcmNlZERpc2Fzc29jOgorICAgICAgICAgICAgICAgIGNhc2UgZUNzckZvcmNlZERlYXV0aDoKKyAgICAgICAgICAgICAgICBjYXNlIGVDc3JTbWVJc3N1ZWRJYnNzSm9pbkZhaWx1cmU6CisgICAgICAgICAgICAgICAgICAgIGNzclJvYW1TdGF0ZUNoYW5nZSggcE1hYywgZUNTUl9ST0FNSU5HX1NUQVRFX0lETEUsIHNlc3Npb25JZCk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYoZUNzclNtZUlzc3VlZElic3NKb2luRmFpbHVyZSA9PSBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1SZWFzb24pCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5vdGlmeSBIREQgdGhhdCBJQlNTIGpvaW4gZmFpbGVkCisgICAgICAgICAgICAgICAgICAgICAgICBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIHNlc3Npb25JZCwgTlVMTCwgMCwgZUNTUl9ST0FNX0lCU1NfSU5ELCBlQ1NSX1JPQU1fUkVTVUxUX0lCU1NfSk9JTl9GQUlMRUQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgY3NyUm9hbUNhbGxDYWxsYmFjayhwTWFjLCBzZXNzaW9uSWQsIE5VTEwsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1JZCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfUk9BTV9ESVNBU1NPQ0lBVEVELCBlQ1NSX1JPQU1fUkVTVUxUX0ZPUkNFRCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyNpZm5kZWYgV0xBTl9NRE1fQ09ERV9SRURVQ1RJT05fT1BUCisgICAgICAgICAgICAgICAgICAgIHNtZV9Rb3NDc3JFdmVudEluZChwTWFjLCAodEFOSV9VOClzZXNzaW9uSWQsIFNNRV9RT1NfQ1NSX0RJU0NPTk5FQ1RfSU5ELCBOVUxMKTsKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICBjc3JSb2FtTGlua0Rvd24ocE1hYywgc2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgICpEZWxTdGEgbm90IGRvbmUgRlcgc3RpbGwgaW4gY29ubmVjZWQgc3RhdGUgc28gZG9udAorICAgICAgICAgICAgICAgICAgICAgKmlzc3VlIElNUFMgcmVxCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBpZiAocE1hYy0+cm9hbS5kZWF1dGhSc3BTdGF0dXMgPT0gZVNJUl9TTUVfREVBVVRIX1NUQVRVUykKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csIEZMKCJGVyBzdGlsbCBpbiBjb25uZWN0ZWQgc3RhdGUgIikpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgY3NyU2NhblN0YXJ0SWRsZVNjYW4ocE1hYyk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgZUNzckZvcmNlZElic3NMZWF2ZToKKyAgICAgICAgICAgICAgICAgICAgIGNzcklic3NBZ2VCc3MocE1hYyk7CisgICAgICAgICAgICAgICAgICAgICBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIHNlc3Npb25JZCwgTlVMTCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUucm9hbUNtZC5yb2FtSWQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfUk9BTV9JQlNTX0xFQVZFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfUk9BTV9SRVNVTFRfSUJTU19TVE9QKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBlQ3NyRm9yY2VkRGlzYXNzb2NNSUNGYWlsdXJlOgorICAgICAgICAgICAgICAgICAgICBjc3JSb2FtU3RhdGVDaGFuZ2UoIHBNYWMsIGVDU1JfUk9BTUlOR19TVEFURV9JRExFLCBzZXNzaW9uSWQgKTsKKworICAgICAgICAgICAgICAgICAgICBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIHNlc3Npb25JZCwgTlVMTCwgcENvbW1hbmQtPnUucm9hbUNtZC5yb2FtSWQsIGVDU1JfUk9BTV9ESVNBU1NPQ0lBVEVELCBlQ1NSX1JPQU1fUkVTVUxUX01JQ19GQUlMVVJFKTsKKyNpZm5kZWYgV0xBTl9NRE1fQ09ERV9SRURVQ1RJT05fT1BUCisgICAgICAgICAgICAgICAgICAgIHNtZV9Rb3NDc3JFdmVudEluZChwTWFjLCAodEFOSV9VOClzZXNzaW9uSWQsIFNNRV9RT1NfQ1NSX0RJU0NPTk5FQ1RfUkVRLCBOVUxMKTsKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICBjc3JTY2FuU3RhcnRJZGxlU2NhbihwTWFjKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBlQ3NyU3RvcEJzczoKKyAgICAgICAgICAgICAgICAgICAgY3NyUm9hbUNhbGxDYWxsYmFjayhwTWFjLCBzZXNzaW9uSWQsIE5VTEwsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnJvYW1DbWQucm9hbUlkLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fSU5GUkFfSU5ELCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fUkVTVUxUX0lORlJBX1NUT1BQRUQpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIGVDc3JGb3JjZWREaXNhc3NvY1N0YToKKyAgICAgICAgICAgICAgICBjYXNlIGVDc3JGb3JjZWREZWF1dGhTdGE6CisgICAgICAgICAgICAgICAgICAgY3NyUm9hbVN0YXRlQ2hhbmdlKCBwTWFjLCBlQ1NSX1JPQU1JTkdfU1RBVEVfSk9JTkVELCBzZXNzaW9uSWQpOworICAgICAgICAgICAgICAgICAgIGlmKCBDU1JfSVNfU0VTU0lPTl9WQUxJRChwTWFjLCBzZXNzaW9uSWQpICkKKyAgICAgICAgICAgICAgICAgICB7ICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24gPSBDU1JfR0VUX1NFU1NJT04ocE1hYywgc2Vzc2lvbklkKTsKKworICAgICAgICAgICAgICAgICAgICAgICBpZiAoIENTUl9JU19JTkZSQV9BUCgmcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUpICkKKyAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgcm9hbUluZm8udS5wQ29ubmVjdGVkUHJvZmlsZSA9ICZwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShyb2FtSW5mby5wZWVyTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnJvYW1DbWQucGVlck1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvYW1JbmZvLnJlYXNvbkNvZGUgPSBlQ1NSX1JPQU1fUkVTVUxUX0ZPUkNFRDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvYW1JbmZvLnN0YXR1c0NvZGUgPSBlU0lSX1NNRV9TVUNDRVNTOworICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbUNhbGxDYWxsYmFjayhwTWFjLCBzZXNzaW9uSWQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnJvYW1JbmZvLCBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1JZCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fTE9TVExJTkssIGVDU1JfUk9BTV9SRVNVTFRfRk9SQ0VEKTsKKyAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIGVDc3JMb3N0TGluazE6CisgICAgICAgICAgICAgICAgICAgIC8vIGlmIGxvc3QgbGluayByb2FtMSBmYWlsZWQsIHRoZW4gaXNzdWUgbG9zdCBsaW5rIFNjYW4yIC4uLgorICAgICAgICAgICAgICAgICAgICBjc3JTY2FuUmVxdWVzdExvc3RMaW5rMihwTWFjLCBzZXNzaW9uSWQpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIGVDc3JMb3N0TGluazI6CisgICAgICAgICAgICAgICAgICAgIC8vIGlmIGxvc3QgbGluayByb2FtMiBmYWlsZWQsIHRoZW4gaXNzdWUgbG9zdCBsaW5rIHNjYW4zIC4uLgorICAgICAgICAgICAgICAgICAgICBjc3JTY2FuUmVxdWVzdExvc3RMaW5rMyhwTWFjLCBzZXNzaW9uSWQpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIGVDc3JMb3N0TGluazM6CisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgY3NyUm9hbVN0YXRlQ2hhbmdlKCBwTWFjLCBlQ1NSX1JPQU1JTkdfU1RBVEVfSURMRSwgc2Vzc2lvbklkICk7CisKKyAgICAgICAgICAgICAgICAgICAgLy9XZSBhcmUgZG9uZSB3aXRoIG9uZSByb3VuZCBvZiBsb3N0bGluayByb2FtaW5nIGhlcmUKKyAgICAgICAgICAgICAgICAgICAgY3NyU2NhbkhhbmRsZUZhaWxlZExvc3RsaW5rMyhwTWFjLCBzZXNzaW9uSWQpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiAoIGZSZWxlYXNlQ29tbWF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BpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRHN0UHJvZmlsZS0+QlNTSURzLm51bU9mQlNTSURzID0gcFNyY1Byb2ZpbGUtPkJTU0lEcy5udW1PZkJTU0lEczsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwRHN0UHJvZmlsZS0+QlNTSURzLmJzc2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgIHBTcmNQcm9maWxlLT5CU1NJRHMuYnNzaWQsIHNpemUpOworICAgICAgICB9CisgICAgICAgIGlmKHBTcmNQcm9maWxlLT5TU0lEcy5udW1PZlNTSURzKQorICAgICAgICB7CisgICAgICAgICAgICBzaXplID0gc2l6ZW9mKHRDc3JTU0lESW5mbykgKiBwU3JjUHJvZmlsZS0+U1NJRHMubnVtT2ZTU0lEczsKKyAgICAgICAgICAgIHBEc3RQcm9maWxlLT5TU0lEcy5TU0lETGlzdCA9IHZvc19tZW1fbWFsbG9jKHNpemUpOworICAgICAgICAgICAgaWYgKCBOVUxMID09IHBEc3RQcm9maWxlLT5TU0lEcy5TU0lETGlzdCApCisgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgaWYgKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBEc3RQcm9maWxlLT5TU0lEcy5udW1PZlNTSURzID0gcFNyY1Byb2ZpbGUtPlNTSURzLm51bU9mU1NJRHM7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocERzdFByb2ZpbGUtPlNTSURzLlNTSURMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgIHBTcmNQcm9maWxlLT5TU0lEcy5TU0lETGlzdCwgc2l6ZSk7CisgICAgICAgIH0KKyAgICAgICAgaWYocFNyY1Byb2ZpbGUtPm5XUEFSZXFJRUxlbmd0aCkKKyAgICAgICAgeworICAgICAgICAgICAgcERzdFByb2ZpbGUtPnBXUEFSZXFJRSA9IHZvc19tZW1fbWFsbG9jKHBTcmNQcm9maWxlLT5uV1BBUmVxSUVMZW5ndGgpOworICAgICAgICAgICAgaWYgKCBOVUxMID09IHBEc3RQcm9maWxlLT5wV1BBUmVxSUUgKQorICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisKKyAgICAgICAgICAgIGlmICghSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRHN0UHJvZmlsZS0+bldQQVJlcUlFTGVuZ3RoID0gcFNyY1Byb2ZpbGUtPm5XUEFSZXFJRUxlbmd0aDsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwRHN0UHJvZmlsZS0+cFdQQVJlcUlFLCBwU3JjUHJvZmlsZS0+cFdQQVJlcUlFLAorICAgICAgICAgICAgICAgICAgICAgICAgIHBTcmNQcm9maWxlLT5uV1BBUmVxSUVMZW5ndGgpOworICAgICAgICB9CisgICAgICAgIGlmKHBTcmNQcm9maWxlLT5uUlNOUmVxSUVMZW5ndGgpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBEc3RQcm9maWxlLT5wUlNOUmVxSUUgPSB2b3NfbWVtX21hbGxvYyhwU3JjUHJvZmlsZS0+blJTTlJlcUlFTGVuZ3RoKTsKKyAgICAgICAgICAgIGlmICggTlVMTCA9PSBwRHN0UHJvZmlsZS0+cFJTTlJlcUlFICkKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisKKyAgICAgICAgICAgIGlmICghSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRHN0UHJvZmlsZS0+blJTTlJlcUlFTGVuZ3RoID0gcFNyY1Byb2ZpbGUtPm5SU05SZXFJRUxlbmd0aDsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwRHN0UHJvZmlsZS0+cFJTTlJlcUlFLCBwU3JjUHJvZmlsZS0+cFJTTlJlcUlFLAorICAgICAgICAgICAgICAgICAgICAgICAgIHBTcmNQcm9maWxlLT5uUlNOUmVxSUVMZW5ndGgpOworICAgICAgICB9CisjaWZkZWYgRkVBVFVSRV9XTEFOX1dBUEkKKyAgICAgICAgaWYocFNyY1Byb2ZpbGUtPm5XQVBJUmVxSUVMZW5ndGgpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBEc3RQcm9maWxlLT5wV0FQSVJlcUlFID0gdm9zX21lbV9tYWxsb2MocFNyY1Byb2ZpbGUtPm5XQVBJUmVxSUVMZW5ndGgpOworICAgICAgICAgICAgaWYgKCBOVUxMID09IHBEc3RQcm9maWxlLT5wV0FQSVJlcUlFICkKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRHN0UHJvZmlsZS0+bldBUElSZXFJRUxlbmd0aCA9IHBTcmNQcm9maWxlLT5uV0FQSVJlcUlFTGVuZ3RoOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBEc3RQcm9maWxlLT5wV0FQSVJlcUlFLCBwU3JjUHJvZmlsZS0+cFdBUElSZXFJRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBwU3JjUHJvZmlsZS0+bldBUElSZXFJRUxlbmd0aCk7CisgICAgICAgIH0KKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fV0FQSSAqLworICAgICAgICBpZihwU3JjUHJvZmlsZS0+bkFkZElFU2Nhbkxlbmd0aCkKKyAgICAgICAgeworICAgICAgICAgICAgbWVtc2V0KHBEc3RQcm9maWxlLT5hZGRJRVNjYW4sIDAgLCBTSVJfTUFDX01BWF9BRERfSUVfTEVOR1RIKTsKKyAgICAgICAgICAgIGlmICggU0lSX01BQ19NQVhfQUREX0lFX0xFTkdUSCA+PSAgcFNyY1Byb2ZpbGUtPm5BZGRJRVNjYW5MZW5ndGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBEc3RQcm9maWxlLT5hZGRJRVNjYW4sIHBTcmNQcm9maWxlLT5hZGRJRVNjYW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgcFNyY1Byb2ZpbGUtPm5BZGRJRVNjYW5MZW5ndGgpOworICAgICAgICAgICAgICAgIHBEc3RQcm9maWxlLT5uQWRkSUVTY2FuTGVuZ3RoID0gcFNyY1Byb2ZpbGUtPm5BZGRJRVNjYW5MZW5ndGg7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICBGTCgiIEFkZElFU2Nhbkxlbmd0aCBpcyBub3QgdmFsaWQgJXUiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3JjUHJvZmlsZS0+bkFkZElFU2Nhbkxlbmd0aCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYocFNyY1Byb2ZpbGUtPm5BZGRJRUFzc29jTGVuZ3RoKQorICAgICAgICB7CisgICAgICAgICAgICBwRHN0UHJvZmlsZS0+cEFkZElFQXNzb2MgPSB2b3NfbWVtX21hbGxvYyhwU3JjUHJvZmlsZS0+bkFkZElFQXNzb2NMZW5ndGgpOworICAgICAgICAgICAgaWYgKCBOVUxMID09IHBEc3RQcm9maWxlLT5wQWRkSUVBc3NvYyApCisgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworCisgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRHN0UHJvZmlsZS0+bkFkZElFQXNzb2NMZW5ndGggPSBwU3JjUHJvZmlsZS0+bkFkZElFQXNzb2NMZW5ndGg7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocERzdFByb2ZpbGUtPnBBZGRJRUFzc29jLCBwU3JjUHJvZmlsZS0+cEFkZElFQXNzb2MsCisgICAgICAgICAgICAgICAgICAgICAgICAgcFNyY1Byb2ZpbGUtPm5BZGRJRUFzc29jTGVuZ3RoKTsKKyAgICAgICAgfQorICAgICAgICBpZihwU3JjUHJvZmlsZS0+Q2hhbm5lbEluZm8uQ2hhbm5lbExpc3QpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBEc3RQcm9maWxlLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdCA9IHZvc19tZW1fbWFsbG9jKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNyY1Byb2ZpbGUtPkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHMpOworICAgICAgICAgICAgaWYgKCBOVUxMID09IHBEc3RQcm9maWxlLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdCApCisgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcERzdFByb2ZpbGUtPkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHMgPSBwU3JjUHJvZmlsZS0+Q2hhbm5lbEluZm8ubnVtT2ZDaGFubmVsczsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwRHN0UHJvZmlsZS0+Q2hhbm5lbEluZm8uQ2hhbm5lbExpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgcFNyY1Byb2ZpbGUtPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgIHBTcmNQcm9maWxlLT5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzKTsKKyAgICAgICAgfQorICAgICAgICBwRHN0UHJvZmlsZS0+QXV0aFR5cGUgPSBwU3JjUHJvZmlsZS0+QXV0aFR5cGU7CisgICAgICAgIHBEc3RQcm9maWxlLT5FbmNyeXB0aW9uVHlwZSA9IHBTcmNQcm9maWxlLT5FbmNyeXB0aW9uVHlwZTsKKyAgICAgICAgcERzdFByb2ZpbGUtPm1jRW5jcnlwdGlvblR5cGU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2ZpbGUtPkFwVWFwc2RFbmFibGU7ICAgCisgICAgICAgIHBEc3RQcm9maWxlLT5TU0lEcy5TU0lETGlzdFswXS5zc2lkSGlkZGVuID0gcFNyY1Byb2ZpbGUtPlNTSURzLlNTSURMaXN0WzBdLnNzaWRIaWRkZW47CisgICAgICAgIHBEc3RQcm9maWxlLT5wcm90RW5hYmxlZCAgICAgICA9IHBTcmNQcm9maWxlLT5wcm90RW5hYmxlZDsgIAorICAgICAgICBwRHN0UHJvZmlsZS0+b2Jzc1Byb3RFbmFibGVkICAgPSBwU3JjUHJvZmlsZS0+b2Jzc1Byb3RFbmFibGVkOyAgCisgICAgICAgIHBEc3RQcm9maWxlLT5jZmdfcHJvdGVjdGlvbiAgICA9IHBTcmNQcm9maWxlLT5jZmdfcHJvdGVjdGlvbjsKKyAgICAgICAgcERzdFByb2ZpbGUtPndwc19zdGF0ZSAgICAgICAgID0gcFNyY1Byb2ZpbGUtPndwc19zdGF0ZTsKKyAgICAgICAgcERzdFByb2ZpbGUtPmllZWU4MDIxMWQgICAgICAgID0gcFNyY1Byb2ZpbGUtPmllZWU4MDIxMWQ7CisgICAgICAgIHZvc19tZW1fY29weSgmcERzdFByb2ZpbGUtPktleXMsICZwU3JjUHJvZmlsZS0+S2V5cywKKyAgICAgICAgICAgICAgICAgICAgIHNpemVvZihwRHN0UHJvZmlsZS0+S2V5cykpOworI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCisgICAgICAgIGlmIChwU3JjUHJvZmlsZS0+TURJRC5tZGllUHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgcERzdFByb2ZpbGUtPk1ESUQubWRpZVByZXNlbnQgPSAxOworICAgICAgICAgICAgcERzdFByb2ZpbGUtPk1ESUQubW9iaWxpdHlEb21haW4gPSBwU3JjUHJvZmlsZS0+TURJRC5tb2JpbGl0eURvbWFpbjsKKyAgICAgICAgfQorI2VuZGlmCisgICAgfXdoaWxlKDApOworICAgIAorICAgIGlmKCF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gIHsKKyAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgIEZMKCJmYWlsZWQgdG8gYWxsb2NhdGUgbWVtb3J5IGZvciBCU1NJRCIKKyAgICAgICAgICAgICAgICAgICAgIiUwMng6JTAyeDolMDJ4OiUwMng6JTAyeDolMDJ4IiksCisgICAgICAgICAgICAgICAgICAgIHBTcmNQcm9maWxlLT5ic3NpZFswXSwgcFNyY1Byb2ZpbGUtPmJzc2lkWzFdLCBwU3JjUHJvZmlsZS0+YnNzaWRbMl0sCisgICAgICAgICAgICAgICAgICAgIHBTcmNQcm9maWxlLT5ic3NpZFszXSwgcFNyY1Byb2ZpbGUtPmJzc2lkWzRdLCBwU3JjUHJvZmlsZS0+YnNzaWRbNV0pOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcERzdFByb2ZpbGUtPkJTU0lEcy5udW1PZkJTU0lEcyA9IDE7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocERzdFByb2ZpbGUtPkJTU0lEcy5ic3NpZCwgcFNyY1Byb2ZpbGUtPmJzc2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0Q3NyQnNzaWQpKTsKKyAgICAgICAgfQorICAgICAgICBpZihwU3JjUHJvZmlsZS0+U1NJRC5zc0lkKQorICAgICAgICB7CisgICAgICAgICAgICBwRHN0UHJvZmlsZS0+U1NJRHMuU1NJRExpc3QgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodENzclNTSURJbmZvKSk7CisgICAgICAgICAgICBpZiAoIE5VTEwgPT0gcERzdFByb2ZpbGUtPlNTSURzLlNTSURMaXN0ICkKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICBGTCgiZmFpbGVkIHRvIGFsbG9jYXRlIG1lbW9yeSBmb3IgU1NJRExpc3QiCisgICAgICAgICAgICAgICAgICAgICIlMDJ4OiUwMng6JTAyeDolMDJ4OiUwMng6JTAyeCIpLAorICAgICAgICAgICAgICAgICAgICBwU3JjUHJvZmlsZS0+YnNzaWRbMF0sIHBTcmNQcm9maWxlLT5ic3NpZFsxXSwgcFNyY1Byb2ZpbGUtPmJzc2lkWzJdLAorICAgICAgICAgICAgICAgICAgICBwU3JjUHJvZmlsZS0+YnNzaWRbM10sIHBTcmNQcm9maWxlLT5ic3NpZFs0XSwgcFNyY1Byb2ZpbGUtPmJzc2lkWzVdKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBEc3RQcm9maWxlLT5TU0lEcy5udW1PZlNTSURzID0gMTsKKyAgICAgICAgICAgIHBEc3RQcm9maWxlLT5TU0lEcy5TU0lETGlzdFswXS5oYW5kb2ZmUGVybWl0dGVkID0gcFNyY1Byb2ZpbGUtPmhhbmRvZmZQZXJtaXR0ZWQ7CisgICAgICAgICAgICBwRHN0UHJvZmlsZS0+U1NJRHMuU1NJRExpc3RbMF0uc3NpZEhpZGRlbiA9IHBTcmNQcm9maWxlLT5zc2lkSGlkZGVuOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwRHN0UHJvZmlsZS0+U1NJRHMuU1NJRExpc3RbMF0uU1NJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAmcFNyY1Byb2ZpbGUtPlNTSUQsIHNpemVvZih0U2lyTWFjU1NpZCkpOworICAgICAgICB9CisgICAgICAgIGlmKHBTcmNQcm9maWxlLT5uQWRkSUVBc3NvY0xlbmd0aCkKKyAgICAgICAgeworICAgICAgICAgICAgcERzdFByb2ZpbGUtPnBBZGRJRUFzc29jID0gdm9zX21lbV9tYWxsb2MocFNyY1Byb2ZpbGUtPm5BZGRJRUFzc29jTGVuZ3RoKTsKKyAgICAgICAgICAgIGlmICggTlVMTCA9PSBwRHN0UHJvZmlsZS0+cEFkZElFQXNzb2MpCisgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgRkwoIiBmYWlsZWQgdG8gYWxsb2NhdGUgbWVtb3J5IGZvciBhZGRpdGlvbmFsIElFcyAiKSApOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcERzdFByb2ZpbGUtPm5BZGRJRUFzc29jTGVuZ3RoID0gcFNyY1Byb2ZpbGUtPm5BZGRJRUFzc29jTGVuZ3RoOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBEc3RQcm9maWxlLT5wQWRkSUVBc3NvYywgcFNyY1Byb2ZpbGUtPnBBZGRJRUFzc29jLAorICAgICAgICAgICAgICAgICAgICAgICAgIHBTcmNQcm9maWxlLT5uQWRkSUVBc3NvY0xlbmd0aCk7CisgICAgICAgIH0KKyAgICAgICAgcERzdFByb2ZpbGUtPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0ID0gdm9zX21lbV9tYWxsb2MoMSk7CisgICAgICAgIGlmICggTlVMTCA9PSBwRHN0UHJvZmlsZS0+Q2hhbm5lbEluZm8uQ2hhbm5lbExpc3QgKQorICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgIG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Qcm9maWxlKTsKKyAgICAgICAgcERzdFByb2ZpbGUgPSBOVUxMOworICAgIH0KKyAgICAKKyAgICByZXR1cm4gKHN0YXR1cyk7Cit9CisKK2VIYWxTdGF0dXMgY3NyUm9hbUlzc3VlQ29ubmVjdCh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UzMiBzZXNzaW9uSWQsIHRDc3JSb2FtUHJvZmlsZSAqcFByb2ZpbGUsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2NhblJlc3VsdEhhbmRsZSBoQlNTTGlzdCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDc3JSb2FtUmVhc29uIHJlYXNvbiwgdEFOSV9VMzIgcm9hbUlkLCB0QU5JX0JPT0xFQU4gZkltZWRpYXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX0JPT0xFQU4gZkNsZWFyU2NhbikKK3sKKyAgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgdFNtZUNtZCAqcENvbW1hbmQ7CisgICAgCisgICAgcENvbW1hbmQgPSBjc3JHZXRDb21tYW5kQnVmZmVyKHBNYWMpOworICAgIGlmKE5VTEwgPT0gcENvbW1hbmQpCisgICAgeworICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCIgZmFpbCB0byBnZXQgY29tbWFuZCBidWZmZXIiKSApOworICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19SRVNPVVJDRVM7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGlmKCBmQ2xlYXJTY2FuICkKKyAgICAgICAgeworICAgICAgICAgICAgY3NyU2NhbkNhbmNlbElkbGVTY2FuKHBNYWMpOworICAgICAgICAgICAgY3NyU2NhbkFib3J0TWFjU2Nhbk5vdEZvckNvbm5lY3QocE1hYywgc2Vzc2lvbklkKTsKKyAgICAgICAgfQorICAgICAgICBwQ29tbWFuZ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ChwTWFjLCBwQ29tbWFuZCwgZkltZWRpYXRlKTsKKyAgICAgICAgaWYoICFIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiIGZhaWwgdG8gc2VuZCBtZXNzYWdlIHN0YXR1cyA9ICVkIiksIHN0YXR1cyApOworICAgICAgICAgICAgY3NyUmVsZWFzZUNvbW1hbmRSb2FtKCBwTWFjLCBwQ29tbWFuZCApOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIHJldHVybiAoc3RhdHVzKTsKK30KK2VIYWxTdGF0dXMgY3NyUm9hbUlzc3VlUmVhc3NvYyh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UzMiBzZXNzaW9uSWQsIHRDc3JSb2FtUHJvZmlsZSAqcFByb2ZpbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdENzclJvYW1Nb2RpZnlQcm9maWxlRmllbGRzICpwTW1vZFByb2ZpbGVGaWVsZHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNzclJvYW1SZWFzb24gcmVhc29uLCB0QU5JX1UzMiByb2FtSWQsIHRBTklfQk9PTEVBTiBmSW1lZGlhdGUpCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIHRTbWVDbWQgKnBDb21tYW5kOworICAgIAorICAgIHBDb21tYW5kID0gY3NyR2V0Q29tbWFuZEJ1ZmZlcihwTWFjKTsKKyAgICBpZihOVUxMID09IHBDb21tYW5kKQorICAgIHsKKyAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiIGZhaWwgdG8gZ2V0IGNvbW1hbmQgYnVmZmVyIikgKTsKKyAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfUkVTT1VSQ0VTOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBjc3JT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IGxhdGVyCisgICAgICAgICAgICBwQ29tbWFuZC0+Y29tbWFuZCA9IGVTbWVDb21tYW5kUm9hbTsKKyAgICAgICAgICAgIHBDb21tYW5kLT5zZXNzaW9uSWQgPSAodEFOSV9VOClzZXNzaW9uSWQ7CisgICAgICAgICAgICBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1SZWFzb24gPSByZWFzb247CisgICAgICAgICAgICAvL3RoaXMgaXMgdGhlIGltcG9ydGFudCBwYXJhbWV0ZXIKKyAgICAgICAgICAgIC8vaW4gdGhpcyBjYXNlIHdlIGFyZSB1c2luZyB0aGlzIGZpZWxkIGZvciB0aGUgIm5leHQiIEJTUyAKKyAgICAgICAgICAgIHBDb21tYW5kLT51LnJvYW1DbWQucExhc3RSb2FtQnNzID0gcEJzc0Rlc2NyaXB0aW9uOworICAgICAgICAgICAgc3RhdHVzID0gY3NyUXVldWVTbWVDb21tYW5kKHBNYWMsIHBDb21tYW5kLCBmSW1tZWRpYXRlKTsKKyAgICAgICAgICAgIGlmKCAhSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiIGZhaWwgdG8gZW5xdWV1ZSBwcmVhdXRoIGNvbW1hbmQsIHN0YXR1cyA9ICVkIiksIHN0YXR1cyApOworICAgICAgICAgICAgICAgIGNzclJlbGVhc2VDb21tYW5kUHJlYXV0aCggcE1hYywgcENvbW1hbmQgKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgLy9SZXR1cm4gZmFpbHVyZQorICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19SRVNPVVJDRVM7CisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIChzdGF0dXMpOworfQorCitlSGFsU3RhdHVzIGNzclJvYW1EZXF1ZXVlUHJlYXV0aCh0cEFuaVNpckdsb2JhbCBwTWFjKQoreworICAgIHRMaXN0RWxlbSAqcEVudHJ5OworICAgIHRTbWVDbWQgKnBDb21tYW5kOworICAgIHBFbnRyeSA9IGNzckxMUGVla0hlYWQoICZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCwgTExfQUNDRVNTX0xPQ0sgKTsKKyAgICBpZiAoIHBFbnRyeSApCisgICAgeworICAgICAgICBwQ29tbWFuZCA9IEdFVF9CQVNFX0FERFIoIHBFbnRyeSwgdFNtZUNtZCwgTGluayApOworICAgICAgICBpZiAoIChlU21lQ29tbWFuZFJvYW0gPT0gcENvbW1hbmQtPmNvbW1hbmQpICYmIAorICAgICAgICAgICAgICAgIChlQ3NyUGVyZm9ybVByZWF1dGggPT0gcENvbW1hbmQtPnUucm9hbUNtZC5yb2FtUmVhc29uKSkKKyAgICAgICAgeyAgICAgICAgICAgICAKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HMSwgRkwoIkRRLUNvbW1hbmQgPSAlZCwgUmVhc29uID0gJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgcENvbW1hbmQtPmNvbW1hbmQsIHBDb21tYW5kLT51LnJvYW1DbWQucm9hbVJlYXNvbik7CisgICAgICAgICAgICBpZiAoY3NyTExSZW1vdmVFbnRyeSggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0LCBwRW50cnksIExMX0FDQ0VTU19MT0NLICkpIHsKKyAgICAgICAgICAgICAgICBjc3JSZWxlYXNlQ29tbWFuZFByZWF1dGgoIHBNYWMsIHBDb21tYW5kICk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSAgeworICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiQ29tbWFuZCA9ICVkLCBSZWFzb24gPSAlZCAiKSwKKyAgICAgICAgICAgICAgICAgICAgcENvbW1hbmQtPmNvbW1hbmQsIHBDb21tYW5kLT51LnJvYW1DbWQucm9hbVJlYXNvbik7CisgICAg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VEFUVVNfRkFJTFVSRTsKKyAgICB9CisgICAgaWYoIXBTZXNzaW9uKQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgc2Vzc2lvbiAlZCBub3QgZm91bmQgIiksIHNlc3Npb25JZCk7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIH0KKyAgICBzbXNMb2cocE1hYywgTE9HMSwgRkwoImNhbGxlZCAgQlNTVHlwZSA9ICVzICglZCkgYXV0aHR5cGUgPSAlZCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImVuY3J5VHlwZSA9ICVkIiksCisgICAgICAgICAgICAgICAgbGltX0Jzc1R5cGV0b1N0cmluZyhwUHJvZmlsZS0+QlNTVHlwZSksCisgICAgICAgICAgICAgICAgcFByb2ZpbGUtPkJTU1R5cGUsCisgICAgICAgICAgICAgICAgcFByb2ZpbGUtPkF1dGhUeXBlLmF1dGhUeXBlWzBdLAorICAgICAgICAgICAgICAgIHBQcm9maWxlLT5FbmNyeXB0aW9uVHlwZS5lbmNyeXB0aW9uVHlwZVswXSk7CisgICAgaWYoIENTUl9JU19XRFMoIHBQcm9maWxlICkgJiYgCisgICAgICAgICFIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyA9IGNzcklzQlRBTVBBbGxvd2VkKCBwTWFjLCBwUHJvZmlsZS0+b3BlcmF0aW9uQ2hhbm5lbCApICkgKQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJSZXF1ZXN0IGZvciBCVCBBTVAgY29ubmVjdGlvbiBmYWlsZWQsIGNoYW5uZWwgcmVxdWVzdGVkIGlzIGRpZmZlcmVudCB0aGFuIGluZnJhID0gJWQiKSwKKyAgICAgICAgICAgICAgIHBQcm9maWxlLT5vcGVyYXRpb25DaGFubmVsKTsKKyAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICB9CisgICAgL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gICAgICBlbHNlCisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9zZXQocFNjYW5GaWx0ZXIsIHNpemVvZih0Q3NyU2NhblJlc3VsdEZpbHRlciksIDApOworICAgICAgICAgICAgLy9UcnkgdG8gY29ubmVjdCB0byBhbnkgQlNTCisgICAgICAgICAgICBpZihOVUxMID09IHBQcm9maWxlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vTm8gZW5jcnlwdGlvbgorICAgICAgICAgICAgICAgIHBTY2FuRmlsdGVyLT5FbmNyeXB0aW9uVHlwZS5udW1FbnRyaWVzID0gMTsKKyAgICAgICAgICAgICAgICBwU2NhbkZpbHRlci0+RW5jcnlwdGlvblR5cGUuZW5jcnlwdGlvblR5cGVbMF0gPSBlQ1NSX0VOQ1JZUFRfVFlQRV9OT05FOworICAgICAgICAgICAgfS8vd2UgZG9uJ3QgaGF2ZSBhIHByb2ZpbGUKKyAgICAgICAgICAgIGVsc2UgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9IZXJlIGlzIHRoZSBwcm9maWxlIHdlIG5lZWQgdG8gY29ubmVjdCB0bworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1QcmVwYXJlRmlsdGVyRnJvbVByb2ZpbGUocE1hYywgcFByb2ZpbGUsIHBTY2FuRmlsdGVyKTsKKyAgICAgICAgICAgIH0vL1dlIGhhdmUgYSBwcm9maWxlCisgICAgICAgICAgICByb2FtSWQgPSBHRVRfTkVYVF9ST0FNX0lEKCZwTWFjLT5yb2FtKTsKKyAgICAgICAgICAgIGlmKHBSb2FtSWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKnBSb2FtSWQgPSByb2FtSWQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmKEhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qU2F2ZSB0aGUgV1BTIGluZm8qLworICAgICAgICAgICAgICAgIGlmKE5VTEwgIT0gcFByb2ZpbGUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwU2NhbkZpbHRlci0+YldQU0Fzc29jaWF0aW9uID0gcFByb2ZpbGUtPmJXUFNBc3NvY2lhdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgcFNjYW5GaWx0ZXItPmJPU0VOQXNzb2NpYXRpb24gPSBwUHJvZmlsZS0+Yk9TRU5Bc3NvY2lhdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcFNjYW5GaWx0ZXItPmJXUFNBc3NvY2lhdGlvbiA9IDA7CisgICAgICAgICAgICAgICAgICAgIHBTY2FuRmlsdGVyLT5iT1NFTkFzc29jaWF0aW9uID0gMDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZG8KKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmKCAocFByb2ZpbGUgJiYgQ1NSX0lTX1dEU19BUCggcFByb2ZpbGUgKSApCisgICAgICAgICAgICAgICAgICAgICB8fCAocFByb2ZpbGUgJiYgQ1NSX0lTX0lORlJBX0FQICggcFByb2ZpbGUgKSkKKyAgICAgICAgICAgICAgICAgICAgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvL1RoaXMgY2FuIGJlIHN0YXJ0ZWQgcmlnaHQgYXdheQorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbUlzc3VlQ29ubmVjdChwTWFjLCBzZXNzaW9uSWQsIHBQcm9maWxlLCBOVUxMLCBlQ3NySGRkSXNzdWVkLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb2FtSWQsIGVBTklfQk9PTEVBTl9GQUxTRSwgZUFOSV9CT09MRUFOX0ZBTFNFKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiAgIENTUiBmYWlsZWQgdG8gaXNzdWUgc3RhcnQgQlNTIGNvbW1hbmQgd2l0aCBzdGF0dXMgPSAweCUwOFgiKSwgc3RhdHVzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmQ2FsbENhbGxiYWNrID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsIEZMKCJDb25uZWN0IHJlcXVlc3QgdG8gcHJvY2VlZCBmb3IgQU1QL1NvZnRBUCBtb2RlIikpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyU2NhbkdldFJlc3VsdChwTWFjLCBwU2NhbkZpbHRlciwgJmhCU1NMaXN0KTsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsICIqKioqKioqKioqKiogY3NyU2NhbkdldFJlc3VsdCBTdGF0dXMgKioqKioqKioqICVkIiwgc3RhdHVzKTsKKyAgICAgICAgICAgICAgICAgICAgaWYoSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1Jc3N1ZUNvbm5lY3QocE1hYywgc2Vzc2lvbklkLCBwUHJvZmlsZSwgaEJTU0xpc3QsIGVDc3JIZGRJc3N1ZWQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvYW1JZCwgZUFOSV9CT09MRUFOX0ZBTFNFLCBlQU5JX0JPT0xFQU5fRkFMU0UpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiICAgQ1NSIGZhaWxlZCB0byBpc3N1ZSBjb25uZWN0IGNvbW1hbmQgd2l0aCBzdGF0dXMgPSAweCUwOFgiKSwgc3RhdHVzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JTY2FuUmVzdWx0UHVyZ2UocE1hYywgaEJTU0xpc3QpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZDYWxsQ2FsbGJhY2sgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfS8vSGF2ZSBzY2FuIHJlc3VsdAorICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKE5VTEwgIT0gcFByb2ZpbGUpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vQ2hlY2sgd2hldGhlciBpdCBpcyBmb3Igc3RhcnQgaWJzcworICAgICAgICAgICAgICAgICAgICAgICAgaWYoQ1NSX0lTX1NUQVJUX0lCU1MocFByb2ZpbGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1Jc3N1ZUNvbm5lY3QocE1hYywgc2Vzc2lvbklkLCBwUHJvZmlsZSwgTlVMTCwgZUNzckhkZElzc3VlZCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvYW1JZCwgZUFOSV9CT09MRUFOX0ZBTFNFLCBlQU5JX0JPT0xFQU5fRkFMU0UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCAiICAgQ1NSIGZhaWxlZCB0byBpc3N1ZSBzdGFydElCU1MgY29tbWFuZCB3aXRoIHN0YXR1cyA9IDB4JTA4WCIsIHN0YXR1cyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZDYWxsQ2FsbGJhY2sgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9zY2FuIGZvciB0aGlzIFNTSUQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JTY2FuRm9yU1NJRChwTWFjLCBzZXNzaW9uSWQsIHBQcm9maWxlLCByb2FtSWQsIFRSVUUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiICAgQ1NSIGZhaWxlZCB0byBpc3N1ZSBTU0lEIHNjYW4gY29tbWFuZCB3aXRoIHN0YXR1cyA9IDB4JTA4WCIpLCBzdGF0dXMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmQ2FsbENhbGxiYWNrID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCBGTCgiU1NJRCBzY2FuIHJlcXVlc3RlZCBmb3IgSW5mcmEgY29ubmVjdCByZXEiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZkNhbGxDYWxsYmFjayA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7CisgICAgICAgICAgICAgICAgaWYoTlVMTCAhPSBwUHJvZmlsZSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vd2UgbmVlZCB0byBmcmVlIG1lbW9yeSBmb3IgZmlsdGVyIGlmIHByb2ZpbGUgZXhpc3RzCisgICAgICAgICAgICAgICAgICAgIGNzckZyZWVTY2FuRmlsdGVyKHBNYWMsIHBTY2FuRmlsdGVyKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9Ly9Hb3QgdGhlIHNjYW4gZmlsdGVyIGZyb20gcHJvZmlsZQorICAgICAgICAgICAgCisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocFNjYW5GaWx0ZXIpOworICAgICAgICB9Ly9h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m9maWxlLT5TU0lEcykpCisgICAgICAgICB7CisgICAgICAgICAgICBmQ2FsbENhbGxiYWNrID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsIEZMKCJOb3QgY29ubmVjdGVkIHRvIHRoZSBzYW1lIFNTSUQgYXNrZWQgaW4gdGhlIHByb2ZpbGUiKSk7CisgICAgICAgICB9CisgICAgICB9CisgICAgICBlbHNlIGlmICghdm9zX21lbV9jb21wYXJlKCZtb2RQcm9maWxlRmllbGRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUubW9kaWZ5UHJvZmlsZUZpZWxkcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRDc3JSb2FtTW9kaWZ5UHJvZmlsZUZpZWxkcykpKQorICAgICAgeworICAgICAgICAgZkNhbGxDYWxsYmFjayA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCBGTCgiRWl0aGVyIHRoZSBwcm9maWxlIGlzIE5VTEwgb3Igbm9uZSBvZiB0aGUgZmllbGRzICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaW4gdENzclJvYW1Nb2RpZnlQcm9maWxlRmllbGRzIGdvdCBtb2RpZmllZCIpKTsKKyAgICAgIH0KKyAgIH0KKyAgIGVsc2UKKyAgIHsKKyAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCBGTCgiTm90IGNvbm5lY3RlZCEgTm8gbmVlZCB0byByZWFzc29jIikpOworICAgfQorICAgaWYoIWZDYWxsQ2FsbGJhY2spCisgICB7CisgICAgICByb2FtSWQgPSBHRVRfTkVYVF9ST0FNX0lEKCZwTWFjLT5yb2Ft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CFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIHBTY2FuRmlsdGVyID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRDc3JTY2FuUmVzdWx0RmlsdGVyKSk7CisgICAgICAgICAgICBpZiAoIE5VTEwgID09IHBTY2FuRmlsdGVyICkKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisKKyAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHZvc19tZW1fc2V0KHBTY2FuRmlsdGVyLCBzaXplb2YodENzclNjYW5SZXN1bHRGaWx0ZXIpLCAwKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1QcmVwYXJlRmlsdGVyRnJvbVByb2ZpbGUocE1hYywgcFByb2ZpbGUsIHBTY2FuRmlsdGVyKTsKKyAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJvYW1JZCA9IEdFVF9ORVhUX1JPQU1fSUQoJnBNYWMtPnJvYW0pOworICAgICAgICAgICAgc3RhdHVzID0gY3NyU2NhbkdldFJlc3VsdChwTWFjLCBwU2NhbkZpbHRlciwgJmhCU1NMaXN0KTsKKyAgICAgICAgICAgIGlmKEhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vd2Ugd2FudCB0byBwdXQgdGhlIGxhc3QgY29ubmVjdGVkIEJTUyB0byB0aGUgdmVyeSBiZWdpbm5pbmcsIGlmIHBvc3NpYmxlCisgICAgICAgICAgICAgICAgY3NyTW92ZUJzc1RvSGVhZEZyb21CU1NJRChwTWFjLCAmcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUuYnNzaWQsIGhCU1NMaXN0KTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JSb2FtSXNzdWVDb25uZWN0KHBNYWMsIHNlc3Npb25JZCwgcFByb2ZpbGUsIGhCU1NMaXN0LCBlQ3NySGRkSXNzdWVkLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvYW1JZCwgZUFOSV9CT09MRUFOX0ZBTFNFLCBlQU5JX0JPT0xFQU5fRkFMU0UpOworICAgICAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGNzclNjYW5SZXN1bHRQdXJnZShwTWFjLCBoQlNTTGlzdCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvL0RvIGEgc2NhbiBvbiB0aGlzIHByb2ZpbGUKKyAgICAgICAgICAgICAgICAvL3NjYW4gZm9yIHRoaXMgU1NJRCBvbmx5IGluIGNhc2UgdGhlIEFQIHN1cHByZXNzZXMgU1NJRAorICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclNjYW5Gb3JTU0lEKHBNYWMsIHNlc3Npb25JZCwgcFByb2ZpbGUsIHJvYW1JZCwgVFJVRSk7CisgICAgICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9Ly9XZSBoYXZlIGEgcHJvZmlsZQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLCBGTCgiY2Fubm90IGZpbmQgYSByb2FtaW5nIHByb2ZpbGUiKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH13aGlsZSgwKTsKKyAgICBpZihwU2NhbkZpbHRlcikKKyAgICB7CisgICAgICAgIGNzckZyZWVTY2FuRmlsdGVyKHBNYWMsIHBTY2FuRmlsdGVyKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBTY2FuRmlsdGVyKTsKKyAgICB9CisgICAgaWYoTlVMTCAhPSBwUHJvZmlsZSkKKyAgICB7CisgICAgICAgIGNzclJlbGVhc2VQcm9maWxlKHBNYWMsIHBQcm9maWxlKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBQcm9maWxlKTsKKyAgICB9CisgICAgcmV0dXJuIChzdGF0dXMpOworfQorZUhhbFN0YXR1cyBjc3JSb2FtUmVjb25uZWN0KHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTMyIHNlc3Npb25JZCkKK3sKKyAgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgaWYoY3NySXNDb25uU3RhdGVDb25uZWN0ZWQocE1hYywgc2Vzc2lvbklkKSkKKyAgICB7CisgICAgICAgIHN0YXR1cyA9IGNzclJvYW1Jc3N1ZURpc2Fzc29jaWF0ZUNtZChwTWFjLCBzZXNzaW9uSWQsIGVDU1JfRElTQ09OTkVDVF9SRUFTT05fVU5TUEVDSUZJRUQpOworICAgICAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbUp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Qgc3RhdGUKKyAgICAgICAgICAgIC8vIFRoaXMgaGFwcGVucyBmb3IgRVNFIGFuZCAxMXIgRlQgY29ubmVjdGlvbnMgT05MWS4KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUgorICAgICAgICAgICAgaWYgKGNzclJvYW1JczExckFzc29jKHBNYWMpICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjc3JOZWlnaGJvclJvYW1TdGF0ZVByZWF1dGhEb25lKHBNYWMpKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjc3JOZWlnaGJvclJvYW1UcmFuaXN0aW9uUHJlYXV0aERvbmVUb0Rpc2Nvbm5lY3RlZChwTWFjKTsKKyAgICAgICAgICAgIH0KKyNlbmRpZgorI2lmZGVmIEZFQVRVUkVfV0xBTl9FU0UKKyAgICAgICAgICAgIGlmIChjc3JSb2FtSXNFU0VBc3NvYyhwTWFjKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY3NyTmVpZ2hib3JSb2FtU3RhdGVQcmVhdXRoRG9uZShwTWFjKSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY3NyTmVpZ2hib3JSb2FtVHJhbmlzdGlvblByZWF1dGhEb25lVG9EaXNjb25uZWN0ZWQocE1hYyk7CisgICAgICAgICAgICB9CisjZW5kaWYKKyNpZmRlZiBGRUFUVVJFX1dMQU5fTEZSCisgICAgICAgICAgICBpZiAoY3NyUm9hbUlzRmFzdFJvYW1FbmFibGVkKHBNYWMsIHNlc3Npb25JZCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNzck5laWdoYm9yUm9hbVN0YXRlUHJlYXV0aERvbmUocE1hYykpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNzck5laWdoYm9yUm9hbVRyYW5pc3Rpb25QcmVhdXRoRG9uZVRvRGlzY29ubmVjdGVkKHBNYWMpOworICAgICAgICAgICAgfQorI2VuZGlmCisgICAgICAgIH0KKworICAgICAgICBpZiggZkRpc2Fzc29jICkKKyAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbUlzc3VlRGlzYXNzb2NpYXRlKCBwTWFjLCBzZXNzaW9uSWQsIE5ld1N1YnN0YXRlLCBmTUlDRmFpbHVyZSApOworICAgICAgICAgICAgaWYgKHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ucm9hbURlbGF5U3RhdHNFbmFibGVkKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19yZWNvcmRfcm9hbV9ldmVudChlX1NNRV9ESVNBU1NPQ19JU1NVRSwgTlVMTCwgMCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSBjc3JSb2FtSXNzdWVEZWF1dGgoIHBNYWMsIHNlc3Npb25JZCwgZUNTUl9ST0FNX1NVQlNUQVRFX0RFQVVUSF9SRVEgKTsKKyAgICAgICAgfQorICAgICAgICBmQ29tcGxldGUgPSAoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKTsKKyAgICB9CisgICAgZWxzZSBpZiAoIGNzcklzQ29ublN0YXRlV2RzKCBwTWFjLCBzZXNzaW9uSWQgKSApCisgICAgeworICAgICAgICBpZiggQ1NSX0lTX1dEU19BUCggJnBNYWMtPnJvYW0ucm9hbVNlc3Npb25bc2Vzc2lvbklkXS5jb25uZWN0ZWRQcm9maWxlICkgKQorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSBjc3JSb2FtSXNzdWVTdG9wQnNzKCBwTWFjLCBzZXNzaW9uSWQsIGVDU1JfUk9BTV9TVUJTVEFURV9TVE9QX0JTU19SRVEgKTsKKyAgICAgICAgICAgIGZDb21wbGV0ZSA9ICghSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpOworICAgICAgICB9CisgICAgICAgIC8vVGhpcyBoYXMgdG8gYmUgV0RTIHN0YXRpb24KKyAgICAgICAgZWxzZSAgaWYoIGNzcklzQ29ublN0YXRlQ29ubmVjdGVkV2RzKCBwTWFjLCBzZXNzaW9uSWQgKSApIC8vVGhpcyBoYXMgdG8gYmUgV0RTIHN0YXRpb24KKyAgICAgICAgeworIAorICAgICAgICAgICAgcENvbW1hbmQtPnUucm9hbUNtZC5mU3RvcFdkcyA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgaWYoIGZEaXNhc3NvYyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbUlzc3VlRGlzYXNzb2NpYXRlKCBwTWFjLCBzZXNzaW9uSWQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fU1VCU1RBVEVfRElTQ09OTkVDVF9DT05USU5VRV9ST0FNSU5HLCBmTUlDRmFpbHVyZSApOworICAgICAgICAgICAgICAgIGZDb21wbGV0ZSA9ICghSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfSBlbHNlIHsKKyAgICAgICAgLy8gd2UgZ290IGEgZGlzLWFzc29jIHJlcXVlc3Qgd2hpbGUgbm90IGNvbm5lY3RlZCB0byBhbnkgcGVlcgorICAgICAgICAvLyBqdXN0IGNvbXBsZXRlIHRoZSBjb21tYW5kCisgICAgICAgICAgIGZDb21wbGV0ZSA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIH0KKyAgICBpZihmQ29tcGxldGUpCisgICAgeworICAgICAgICBjc3JSb2FtQ29tcGxldGUoIHBNYWMsIGVDc3JOb3RoaW5nVG9Kb2luLCBOVUxMICk7CisgICAgfQorCisgICAgaWYoSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgeworICAgICAgICBpZiAoIGNzc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3Vic3RhdGUgaW4gY2FzZSBpdCBpcyB3YWl0LWZvci1rZXkKKyAgICAgICAgaWYoIENTUl9JU19XQUlUX0ZPUl9LRVkoIHBNYWMsIHNlc3Npb25JZCApICkKKyAgICAgICAgeworICAgICAgICAgICAgY3NyUm9hbVN0b3BXYWl0Rm9yS2V5VGltZXIoIHBNYWMgKTsKKyAgICAgICAgICAgIGNzclJvYW1TdWJzdGF0ZUNoYW5nZSggcE1hYywgZUNTUl9ST0FNX1NVQlNUQVRFX05PTkUsIHNlc3Npb25JZCk7CisgICAgICAgIH0KKyAgICAgICAgcENvbW1hbmQtPmNvbW1hbmQgPSBlU21lQ29tbWFuZFJvYW07CisgICAgICAgIHBDb21tYW5kLT5zZXNzaW9uSWQgPSAodEFOSV9VOClzZXNzaW9uSWQ7CisgICAgICAgIHNtc0xvZyggcE1hYywgTE9HMSwgRkwoIkRpc2Fzc29jaWF0ZSByZWFzb246ICVkLCBzZXNzaW9uSWQ6ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlYXNvbixzZXNzaW9uSWQpOworICAgICAgICBzd2l0Y2ggKCByZWFzb24gKQorICAgICAgICB7CisgICAgICAgIGNhc2UgZUNTUl9ESVNDT05ORUNUX1JFQVNPTl9NSUNfRVJST1I6CisgICAgICAgICAgICBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1SZWFzb24gPSBlQ3NyRm9yY2VkRGlzYXNzb2NNSUNGYWlsdXJlOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZUNTUl9ESVNDT05ORUNUX1JFQVNPTl9ERUFVVEg6CisgICAgICAgICAgICBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1SZWFzb24gPSBlQ3NyRm9yY2VkRGVhdXRoOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZUNTUl9ESVNDT05ORUNUX1JFQVNPTl9IQU5ET0ZGOgorICAgICAgICAgICAgcENvbW1hbmQtPnUucm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QorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR1csIEZMKCJFUlJPUjogQmVhY29uIGludGVydmFsIGlzIFpFUk8iKSk7CisgICAgfQorICAgIHZvc19tZW1fY29weSgmcENvbm5lY3RQcm9maWxlLT5LZXlzLCAmcFByb2ZpbGUtPktleXMsIHNpemVvZih0Q3NyS2V5cykpOworICAgIC8qIHNhdmluZyB0aGUgYWRkaW9uYWwgSUVgcyBsaWtlIEhvdCBzcG90IGluZGljYXRpb24gZWxlbWVudCBhbmQgZXh0ZW5kZWQgY2FwYWJpbGl0aWVzICovCisgICAgaWYocFByb2ZpbGUtPm5BZGRJRUFzc29jTGVuZ3RoKQorICAgIHsKKyAgICAgICAgcENvbm5lY3RQcm9maWxlLT5wQWRkSUVBc3NvYyA9IHZvc19tZW1fbWFsbG9jKHBQcm9maWxlLT5uQWRkSUVBc3NvY0xlbmd0aCk7CisgICAgICAgIGlmICggTlVMTCA9PSAgcENvbm5lY3RQcm9maWxlLT5wQWRkSUVBc3NvYyApCisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICBlbHNlCisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICBpZiAoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBhbGxvY2F0ZSBtZW1vcnkgZm9yIGFkZGl0aW9uYWwgSUVzIikpIDsKKyAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICB9CisgICAgICAgIHBDb25uZWN0UHJvZmlsZS0+bkFkZElFQXNzb2NMZW5ndGggPSBwUHJvZmlsZS0+bkFkZElFQXNzb2NMZW5ndGg7CisgICAgICAgIHZvc19tZW1fY29weShwQ29ubmVjdFByb2ZpbGUtPnBBZGRJRUFzc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mKHBJZXNUZW1wLT5TU0lELnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBDb25uZWN0UHJvZmlsZS0+U1NJRC5sZW5ndGggPSBwSWVzVGVtcC0+U1NJRC5udW1fc3NpZDsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwQ29ubmVjdFByb2ZpbGUtPlNTSUQuc3NJZCwgcEllc1RlbXAtPlNTSUQuc3NpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBwSWVzVGVtcC0+U1NJRC5udW1fc3NpZCk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIC8vU2F2ZSB0aGUgYnNzIGRlc2MKKyAgICAgICAgc3RhdHVzID0gY3NyUm9hbVNhdmVDb25uZWN0ZWRCc3NEZXNjKHBNYWMsIHNlc3Npb25JZCwgcFNpckJzc0Rlc2MpOworICAgICAgICAgICAKKyAgICAgICAgICAgaWYoIENTUl9JU19RT1NfQlNTKHBJZXNUZW1wKSB8fCBwSWVzVGVtcC0+SFRDYXBzLnByZXNlbnQpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLy9Tb21lIEhUIEFQJ3MgZG9udCBzZW5kIFdNTSBJRSBzbyBpbiB0aGF0IGNhc2Ugd2UgYXNzdW1lIGFsbCBIVCBBcCdzIGFyZSBRb3MgRW5hYmxlZCBBUCdzCisgICAgICAgICAgICAgIHBDb25uZWN0UHJvZmlsZS0+cWFwID0gVFJVRTsKKyAgICAgICAgICAgfQorICAgICAgICAgICBlbHNlCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgcENvbm5lY3RQcm9maWxlLT5xYXAgPSBGQUxTRTsKKyAgICAgICAgICAgfQorICAgICAgICBpZiAoIE5VTEwgPT0gcEllcyApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vRnJlZSBtZW1vcnkgaWYgaXQgYWxsb2NhdGVkIGxvY2FsbHkKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwSWVzVGVtcCk7CisgICAgICAgIH0KKyAgICB9CisgICAgLy9TYXZlIFFvcyBjb25uZWN0aW9uCisgICAgcENvbm5lY3RQcm9maWxlLT5xb3NDb25uZWN0aW9uID0gcE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLmZXTU1Db25uZWN0aW9uOworICAgIAorICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICB7CisgICAgICAgIGNzckZyZWVDb25uZWN0QnNzRGVzYyhwTWFjLCBzZXNzaW9uSWQpOworICAgIH0KKyAgICBmb3IoaW5kZXggPSAwOyBpbmRleCA8IHBQcm9maWxlLT5TU0lEcy5udW1PZlNTSURzOyBpbmRleCsrKQorICAgIHsKKyAgICAgICAgaWYgKChwUHJvZmlsZS0+U1NJRHMuU1NJRExpc3RbaW5kZXhdLlNTSUQubGVuZ3RoID09IHBDb25uZWN0UHJvZmlsZS0+U1NJRC5sZW5ndGgpICYmCisgICAgICAgICAgICB2b3NfbWVtX2NvbXBhcmUocFByb2ZpbGUtPlNTSURzLlNTSURMaXN0W2luZGV4XS5TU0lELnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvbm5lY3RQcm9maWxlLT5TU0lELnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvbm5lY3RQcm9maWxlLT5TU0lELmxlbmd0aCkpCisgICAgICAgeworICAgICAgICAgIHBDb25uZWN0UHJvZmlsZS0+aGFuZG9mZlBlcm1pdHRlZCA9IHBQcm9maWxlLT5TU0lEcy5TU0lETGlzdFtpbmRleF0uaGFuZG9mZlBlcm1pdHRlZDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICB9CisgICAgICAgcENvbm5lY3RQcm9maWxlLT5oYW5kb2ZmUGVybWl0dGVkID0gRkFMU0U7CisgICAgfQorICAgIAorICAgIHJldHVybiAoc3RhdHVzKTsKK30KKworc3RhdGljIHZvaWQgY3NyUm9hbUpvaW5Sc3BQcm9jZXNzb3IoIHRwQW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worICAgICAgICBpZighcFNlc3Npb24pCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiIHNlc3Npb24gJWQgbm90IGZvdW5kICIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNtZUpvaW5Sc3AtPnNlc3Npb25JZCk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgcFNlc3Npb24tPmFib3J0Q29ubmVjdGlvbiA9IEZBTFNFOworICAgfQorICAgZWxzZQorICAgeworICAgICAgICB0QU5JX1UzMiByb2FtSWQgPSAwOworICAgICAgICBpZighcFNlc3Npb24pCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiIHNlc3Npb24gJWQgbm90IGZvdW5kICIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNtZUpvaW5Sc3AtPnNlc3Npb25JZCk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgaWYgKHBTZXNzaW9uLT5hYm9ydENvbm5lY3Rpb24pCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCBGTCgiRGlzY29ubmVjdGlvbiBpbiBwcm9nZXNzIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJhYm9ydCBKb2luIHJlcXVlc3QiKSk7CisgICAgICAgICAgICBjc3JSb2FtQ29tcGxldGUoIHBNYWMsIGVDc3JOb3RoaW5nVG9Kb2luLCBOVUxMICk7CisgICAgICAgICAgICBwU2Vzc2lvbi0+YWJvcnRDb25uZWN0aW9uID0gRkFMU0U7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgLy9UaGUgaGVhZCBvZiB0aGUgYWN0aXZlIGxpc3QgaXMgdGhlIHJlcXVlc3Qgd2Ugc2VudAorICAgICAgICAvL1RyeSB0byBnZXQgYmFjayB0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WN0IGZhaWx1cmUgaGVyZSAqLworICAgICAgICAgICAgY3NyTmVpZ2hib3JSb2FtSW5kaWNhdGVDb25uZWN0KHBNYWMsIHBTbWVKb2luUnNwLT5zZXNzaW9uSWQsIFZPU19TVEFUVVNfRV9GQUlMVVJFKTsKKyAgICAgICAgfQorI2VuZGlmCisgICAgICAgIGlmIChwQ29tbWFuZCkKKyAgICAgICAgeworICAgICAgICAgICAgaWYoQ1NSX0lTX1dEU19TVEEoICZwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1Qcm9maWxlICkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHBDb21tYW5kLT51LnJvYW1DbWQuZlN0b3BXZHMgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgICAgcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUuQlNTVHlwZSA9IGVDU1JfQlNTX1RZUEVfV0RTX1NUQTsKKyAgICAgICAgICAgICAgY3NyUm9hbVJlaXNzdWVSb2FtQ29tbWFuZChwTWFjKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYoIENTUl9JU19XRFMoICZwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1Qcm9maWxlICkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNzclJvYW1Db21wbGV0ZSggcE1hYywgZUNzck5vdGhpbmdUb0pvaW4sIE5VTEwgKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjc3JSb2FtKHBNYWMsIHBDb21tYW5kKTsKKyAgICAgICAgICAgIH0gICAgCisgICAgICAgIH0gICAgCisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICBjc3JSb2FtQ29tcGxldGUoIHBNYWMsIGVDc3JOb3RoaW5nVG9Kb2luLCBOVUxMICk7CisgICAgICAgIH0KKyAgICB9IC8qZWxzZTogKCBlU0lSX1NN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FQVNTT0NfUkVRKTsKK30KKwordm9pZCBjc3JSb2FtUmVpc3N1ZVJvYW1Db21tYW5kKHRwQW5pU2lyR2xvYmFsIHBNYWMpCit7CisgICAgdExpc3RFbGVtICpwRW50cnk7CisgICAgdFNtZUNtZCAqcENvbW1hbmQ7CisgICAgdENzclJvYW1JbmZvIHJvYW1JbmZvOworICAgIHRBTklfVTMyIHNlc3Npb25JZDsKKyAgICB0Q3NyUm9hbVNlc3Npb24gKnBTZXNzaW9uOworICAgICAgICAgICAgCisgICAgcEVudHJ5ID0gY3NyTExQZWVrSGVhZCgmcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QsIExMX0FDQ0VTU19MT0NLKTsKKyAgICBpZihwRW50cnkpCisgICAgeworICAgICAgICBwQ29tbWFuZCA9IEdFVF9CQVNFX0FERFIocEVudHJ5LCB0U21lQ21kLCBMaW5rKTsKKyAgICAgICAgaWYgKCBlU21lQ29tbWFuZFJvYW0gPT0gcENvbW1hbmQtPmNvbW1hbmQgKQorICAgICAgICB7CisgICAgICAgICAgICBzZXNzaW9uSWQgPSBwQ29tbWFuZC0+c2Vzc2lvbklkOworICAgICAgICAgICAgcFNlc3Npb24gPSBDU1JfR0VUX1NFU1NJT04oIHBNYWMsIHNlc3Npb25JZCApOworCisgICAgICAgICAgICBpZighcFNlc3Npb24pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgIHNlc3Npb24gJWQgbm90IGZvdW5kICIpLCBzZXNzaW9uSWQpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8qIFdoaWxlIHN3aXRjaGluZyBiZXR3ZWVuIHR3byBBUCwgY3NyIHdpbGwgcmVpc3N1ZSByb2FtIGNvbW1hbmQgYWdhaW4KKyAgICAgICAgICAgICAgIHRvIHRoZSBuZXh0YnNzIGlmIGl0IHdhcyBpbnRlcnJ1cHRlZCBieSB0aGUgZGlzc2Nvbm5lY3QgcmVxIGZvciB0aGUKKyAgICAgICAgICAgICAgIHByZXZpb3VzIGJzcy5EdXJpbmcgdGhpcyBjc3IgaXMgaW5jcmVtZW50aW5nIGJSZWZBc3NvY1N0YXJ0Q250IHR3aWNlLgorICAgICAgICAgICAgICAgc28gcmVzZXQgdGhlIGJSZWZBc3NvY1N0YXJ0Q250LgorICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmKHBTZXNzaW9uLT5iUmVmQXNzb2NTdGFydENudCA+IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFNlc3Npb24tPmJSZWZBc3NvY1N0YXJ0Q250LS07CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiggcENvbW1hbmQtPnUucm9hbUNtZC5mU3RvcFdkcyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9zZXQoJnJvYW1JbmZvLCBzaXplb2YodENzclJvYW1JbmZvKSwgMCk7CisgICAgICAgICAgICAgICAgcm9hbUluZm8ucEJzc0Rlc2MgPSBwQ29tbWFuZC0+dS5yb2FtQ21kLnBMYXN0Um9hbUJzczsKKyAgICAgICAgICAgICAgICByb2FtSW5mby5zdGF0dXNDb2RlID0gcFNlc3Npb24tPmpvaW5GYWlsU3RhdHVzQ29kZS5zdGF0dXNDb2RlOworICAgICAgICAgICAgICAgIHJvYW1JbmZvLnJlYXNvbkNvZGUgPSBwU2Vzc2lvbi0+am9pbkZhaWxTdGF0dXNDb2RlLnJlYXNvbkNvZGU7CisgICAgICAgICAgICAgICAgaWYgKENTUl9JU19XRFMoJnBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlKSl7CisgICAgICAgICAgICAgICAgcFNlc3Npb24tPmNvbm5lY3RTdGF0ZSA9IGVDU1JfQVNTT0NfU1RBVEVfVFlQRV9XRFNfRElTQ09OTkVDVEVEOworICAgICAgICAgICAgICAgIGNzclJvYW1DYWxsQ2FsbGJhY2socE1hYywgc2Vzc2lvbklkLCAmcm9hbUluZm8sIHBDb21tYW5kLT51LnJvYW1DbWQucm9hbUlkLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fV0RTX0lORCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ST0FNX1JFU1VMVF9XRFNfRElTQVNTT0NJQVRFRCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmIChDU1JfSVNfSU5GUkFfQVAoJnBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlKSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPmNvbm5lY3RTdGF0ZSA9IGVDU1JfQVNTT0NfU1RBVEVfVFlQRV9JTkZSQV9ESVNDT05ORUNURUQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyUm9hbUNhbGxDYWxsYmFjayhwTWFjLCBzZXNzaW9uSWQsICZyb2FtSW5mbywgcENvbW1hbmQtPnUucm9hbUNtZC5yb2FtSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfUk9BTV9JTkZSQV9JTkQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfUk9BTV9SRVNVTFRfSU5GUkFfRElTQVNTT0NJQVRFRCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gIAorIAorCisgICAgICAgICAgICAgICAgaWYoICFIQUxfU1RBVFVTX1NVQ0NFU1MoIGNzclJvYW1Jc3N1ZVN0b3BCc3MoIHBNYWMsIHNlc3Npb25JZCwgZUNTUl9ST0FNX1NVQlNUQVRFX1NUT1BfQlNTX1JFUSApICkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsICIgRmFpbGVkIHRvIHJlaXNzdWUgc3RvcF9ic3MgY29tbWFuZCBmb3IgV0RTIGFmdGVyIGRpc2Fzc29jaWF0ZWQiKTsKKyAgICAgICAgICAgICAgICAgICAgY3NyUm9hbUNvbXBsZXRlKCBwTWFjLCBlQ3NyTm90aGluZ1RvSm9pbiwgTlVMTCApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYoZUNzclN0b3BSb2FtaW5nID09IGNzclJvYW1Kb2luTmV4dEJzcyhwTWFjLCBwQ29tbWFuZCwgZUFOSV9CT09MRUFOX1RSVUUpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLCAiIEZhaWxlZCB0byByZWlzc3VlIGpvaW4gY29tbWFuZCBhZnRlciBkaXNhc3NvY2lhdGVkIik7CisgICAgICAgICAgICAgICAgY3NyUm9hbUNvbXBsZXRlKCBwTWFjLCBlQ3NyTm90aGluZ1RvSm9pbiwgTlVMTCApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csICIgIENvbW1hbmQgaXMgbm90IHJvYW1pbmcgYWZ0ZXIgZGlzYXNzb2NpYXRlZCIpOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UgCisgICAgeworICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgIiAgIERpc2Fzc29jIHJzcCBjYW5ub3QgY29udGludWUgYmVjYXVzZSBubyBjb21tYW5kIGlzIGF2YWlsYWJsZSIpOworICAgIH0KK30KKwordEFOSV9CT09MRUFOIGNzcklzUm9hbUNvbW1hbmRXYWl0aW5nRm9yU2Vzc2lvbih0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UzMiBzZXNzaW9uSWQ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bSA9PSBwQ29tbWFuZC0+Y29tbWFuZCApICYmICggc2Vzc2lvbklkID09IHBDb21tYW5kLT5zZXNzaW9uSWQgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZlJldCA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcEVudHJ5ID0gY3NyTExOZXh0KCZwTWFjLT5zbWUuc21lQ21kUGVuZGluZ0xpc3QsIHBFbnRyeSwgTExfQUNDRVNTX05PTE9DSyk7CisgICAgICAgIH0KKyAgICAgICAgY3NyTExVbmxvY2soJnBNYWMtPnNtZS5zbWVDbWRQZW5kaW5nTGlzdCk7CisgICAgfQorICAgIGlmIChlQU5JX0JPT0xFQU5fRkFMU0UgPT0gZlJldCkKKyAgICB7CisgICAgICAgIGNzckxMTG9jaygmcE1hYy0+cm9hbS5yb2FtQ21kUGVuZGluZ0xpc3QpOworICAgICAgICBwRW50cnkgPSBjc3JMTFBlZWtIZWFkKCZwTWFjLT5yb2FtLnJvYW1DbWRQZW5kaW5nTGlzdCwgTExfQUNDRVNTX05PTE9DSyk7CisgICAgICAgIHdoaWxlIChwRW50cnkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBDb21tYW5kID0gR0VUX0JBU0VfQUREUihwRW50cnksIHRTbWVDbWQsIExpbmspOworICAgICAgICAgICAgaWYgKCggZVNtZUNvbW1hbmRSb2FtID09IHBDb21tYW5kLT5jb21tYW5kICkgJiYgKCBzZXNzaW9uSWQgPT0gcENvbW1hbmQtPnNlc3Npb25JZCApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBmUmV0ID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRW50cnkgPSBjc3JMTE5leHQoJnBNYWMtPnJvYW0ucm9hbUNtZFBlbmRpbmdMaXN0LCBwRW50cnksIEx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JuIGVIQUxfU1RBVFVTX1JFU09VUkNFUzsKKyAgICAgICAgfQorICAgICAgICBpZiAoIGVTbWVDb21tYW5kUm9hbSA9PSBwQ29tbWFuZC0+Y29tbWFuZCApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1SZWFzb24gPT0gZUNzclNtZUlzc3VlZEFzc29jVG9TaW1pbGFyQVApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZlJlbW92ZUNtZCA9IGNzckxMUmVtb3ZlRW50cnkoICZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTE9DSyApOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCIgVW5leHBlY3RlZCBhY3RpdmUgcm9hbSBjb21tYW5kIHByZXNlbnQgIikgKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChmUmVtb3ZlQ21kID09IEZBTFNFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIEltcGxpZXMgd2UgZGlkIG5vdCBnZXQgdGhlIHNlcmlhbGl6ZWQgYXNzb2MgY29tbWFuZCB3ZQorICAgICAgICAgICAgICAgIC8vIHdlcmUgZXhwZWN0aW5nCisgICAgICAgICAgICAgICAgcENvbW1hbmQgPSBOVUxMOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIGlmKE5VTEwgPT0gcENvbW1hbmQpCisgICAgeworICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCIgZmFpbCB0byBnZXQgY29tbWFuZCBidWZmZXIgYXMgZXhwZWN0ZWQgYmFzZWQgb24gcHJldmlvdXMgY29ubmVjdCByb2FtIGNvbW1hbmQiKSApOworICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfUkVTT1V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m9pbiwgTlVMTCk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGlmICggQ0NNX0lTX1JFU1VMVF9TVUNDRVNTKHJlc3VsdCkgKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HMSwgIkNmZyBzZXF1ZW5jZSBjb21wbGV0ZSIpOworICAgICAgICAgICAgLy8gU3VjY2Vzc2Z1bGx5IHNldCB0aGUgY29uZmlndXJhdGlvbiBwYXJhbWV0ZXJzIGZvciB0aGUgbmV3IEJzcy4gIEF0dGVtcHQgdG8KKyAgICAgICAgICAgIC8vIGpvaW4gdGhlIHJvYW1pbmcgQnNzLgorICAgICAgICAgICAgaWYocENvbW1hbmQtPnUucm9hbUNtZC5wUm9hbUJzc0VudHJ5KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBTY2FuUmVzdWx0ID0gR0VUX0JBU0VfQUREUihwQ29tbWFuZC0+dS5yb2FtQ21kLnBSb2FtQnNzRW50cnksIHRDc3JTY2FuUmVzdWx0LCBMaW5rKTsKKyAgICAgICAgICAgICAgICBwQnNzRGVzYyA9ICZwU2NhblJlc3VsdC0+UmVzdWx0LkJzc0Rlc2NyaXB0b3I7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoIGNzcklzQnNzVHlwZUlCU1MoIHBDb21tYW5kLT51LnJvYW1DbWQucm9hbVByb2ZpbGUuQlNTVHlwZSApIHx8CisgICAgICAgICAgICAgICAgIENTUl9JU19XRFMoICZwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1Qcm9maWxlICkgCisgICAgICAgICAgICAgICAgICB8fCBDU1JfSVNfSU5GUkFfQVAoJnBDb21tYW5kLT51LnJvYW1DbWQucm9hbVByb2ZpbGUpIAorICAgICAgICAgICAgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1MoY3NyUm9hbUlzc3VlU3RhcnRCc3MoIHBNYWMsIHNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFNlc3Npb24tPmJzc1BhcmFtcywgJnBDb21tYW5kLT51LnJvYW1DbWQucm9hbVByb2ZpbGUsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCc3NEZXNjLCBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1JZCApKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCAiIENTUiBzdGFydCBCU1MgZmFpbGVkIik7CisgICAgICAgICAgICAgICAgICAgIC8vV2UgbmVlZCB0byBjb21wbGV0ZSB0aGUgY29tbWFuZAorICAgICAgICAgICAgICAgICAgICBjc3JSb2FtQ29tcGxldGUocE1hYywgZUNzclN0YXJ0QnNzRmFpbHVyZSwgTlVMTCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICghcENvbW1hbmQtPnUucm9hbUNtZC5wUm9hbUJzc0VudHJ5KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsICIgcFJvYW1Cc3NFbnRyeSBpcyBOVUxMIik7CisgICAgICAgICAgICAgICAgICAgIC8vV2UgbmVlZCB0byBjb21wbGV0ZSB0aGUgY29tbWFuZAorICAgICAgICAgICAgICAgICAgICBjc3JSb2FtQ29tcGxldGUocE1hYywgZUNzckpvaW5GYWlsdXJlLCBOVUxMKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0gCisgICAgICAgICAgICAgICAgLy8gSWYgd2UgYXJlIHJvYW1pbmcgVE8gYW4gSW5mcmFzdHJ1Y3R1cmUgQlNTLi4uCisgICAgICAgICAgICAgICAgVk9TX0FTU0VSVChwU2NhblJlc3VsdCAhPSBOVUxMKTsgCisgICAgICAgICAgICAgICAgaWYgKCBjc3JJc0luZnJhQnNzRGVzYyggcEJzc0Rlc2MgKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB0RG90MTFmQmVhY29uSUVzICpwSWVzTG9jYWwgPSAodERvdDExZkJlYWNvbklFcyAqKXBTY2FuUmVzdWx0LT5SZXN1bHQucHZJZXM7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCAiIFJvYW1pbmcgaW4gYSBJbmZyYSBCU1MiKTsKKyAgICAgICAgICAgICAgICAgICAgaWYocEllc0xvY2FsIHx8IChIQUxfU1RBVFVTX1NVQ0NFU1MoY3NyR2V0UGFyc2VkQnNzRGVzY3JpcHRpb25JRXMocE1hYywgcEJzc0Rlc2MsICZwSWVzTG9jYWwpKSkgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vIC4uYW5kIGN1cnJlbnRseSBpbiBhbiBJbmZyYXN0cnVjdHVyZSBjb25uZWN0aW9uLi4uLgorICAgICAgICAgICAgICAgICAgICBpZiggY3NySXNDb25uU3RhdGVDb25uZWN0ZWRJbmZyYSggcE1hYywgc2Vzc2lvbklkICkgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HMSwgIiBDb25uZWN0ZWQgdG8gaW5mcmEgQlNTIik7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyAuLi5hbmQgdGhlIFNTSURzIGFyZSBlcXVhbCwgdGhlbiB3ZSBSZWFzc29jLgorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCAgY3NySXNTc2lkRXF1YWwoIHBNYWMsIHBTZXNzaW9uLT5wQ29ubmVjdEJzc0Rlc2MsIHBCc3NEZXNjLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVzTG9jYWwgKSApCisgICAgICAgICAgICAgICAgICAgICAgICAvLyAuLmFuZCBjdXJyZW50bHkgaW4gYW4gaW5mcmFzdHJ1Y3R1cmUgY29ubmVjdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoZW4gaXNzdWUgYSBSZWFzc29jLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnJvYW1DbWQuZlJlYXNzb2MgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyUm9hbUlzc3VlUmVhc3NvY2lhdGUoIHBNYWMsIHNlc3Npb25JZCwgcEJzc0Rlc2MsIHBJZXNMb2NhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBDb21tYW5kLT51LnJvYW1DbWQucm9hbVByb2ZpbGUgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gb3RoZXJ3aXNlLCB3ZSBoYXZlIHRvIGlzc3VlIGEgbmV3IEpvaW4gcmVxdWVzdCB0byBMSU0gYmVjYXVzZSB3ZSBkaXNhc3NvY2lhdGVkIGZyb20gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcHJldmlvdXNseSBhc3NvY2lhdGVkIEFQLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1MoY3NyUm9hbUlzc3VlSm9pbiggcE1hYywgc2Vzc2lvbklkLCBwQnNzRGVzYywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVzTG9jYWwsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1Qcm9maWxlLCBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1JZCApKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdHJ5IHNvbWV0aGluZyBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNzclJvYW0oIHBNYWMsIHBDb21tYW5kICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZUhhbFN0YXR1cyAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIFdlIG5lZWQgdG8gY29tZSB3aXRoIG90aGVyIHdheSB0byBmaWd1cmUgb3V0IHRoYXQgdGhpcyBpcyBiZWNhdXNlIG9mIEhPIGluIEJNUAorICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlIGJlbG93IEFQSSB3aWxsIGJlIG9ubHkgYXZhaWxhYmxlIGZvciBBbmRyb2lkIGFzIGl0IHVzZXMgYSBkaWZmZXJlbnQgSE8gYWxnb3JpdGhtICovCisgICAgICAgICAgICAgICAgICAgICAgICAvKiBSZWFzc29jIHJlcXVlc3Qgd2lsbCBiZSB1c2VkIG9ubHkgZm9yIEVTRSBhbmQgMTFyIGhhbmRvZmYgd2hlcmVhcyBvdGhlciBsZWdhY3kgcm9hbWluZyBzaG91bGQKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIHVzZSBqb2luIHJlcXVlc3QgKi8KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUgorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNzclJvYW1Jc0hhbmRvZmZJblByb2dyZXNzKHBNYWMpICYmIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyUm9hbUlzMTFyQXNzb2MocE1hYykpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsICIgSGFuZG9mZkluUHJvZ3Jlc3Mgd2l0aCAxMXIgZW5hYmxlZCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1Jc3N1ZVJlYXNzb2NpYXRlKHBNYWMsIHNlc3Npb25JZCwgcEJzc0Rlc2MsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHREb3QxMWZCZWFjb25JRXMgKikoIHBTY2FuUmVzdWx0LT5SZXN1bHQucHZJZXMgKSwgJnBDb21tYW5kLT51LnJvYW1DbWQucm9hbVByb2ZpbGUpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorI2VuZGlmCisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNzclJvYW1Jc0hhbmRvZmZJblByb2dyZXNzKHBNYWMpICYmIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyUm9hbUlzRVNFQXNzb2MocE1hYykpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsICIgSGFuZG9mZkluUHJvZ3Jlc3Mgd2l0aCBFU0UgZW5hYmxlZCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5vdyBzZXJpYWxpemUgdGhlIHJlYXNzb2MgY29tbWFuZC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JSb2FtSXNzdWVSZWFzc29jaWF0ZUNtZChwTWFjLCBzZXNzaW9uSWQpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorI2VuZGlmCisjaWZkZWYgRkVBVFVSRV9XTEFOX0xGUgorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNzclJvYW1Jc0hhbmRvZmZJblByb2dyZXNzKHBNYWMpICYmIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyUm9hbUlzRmFzdFJvYW1FbmFibGVkKHBNYWMsIHNlc3Npb25JZCkpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsICIgSGFuZG9mZkluUHJvZ3Jlc3Mgd2l0aCBMRlIgIGVuYWJsZWQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBOb3cgc2VyaWFsaXplIHRoZSByZWFzc29jIGNvbW1hbmQuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbUlzc3VlUmVhc3NvY2lhdGVDbWQocE1hYywgc2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgLy8gZWxzZSB3ZSBhcmUgbm90IGNvbm5lY3RlZCBhbmQgYXR0ZW1wdGluZyB0byBKb2luLiAgSXNzdWUgdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBKb2luIHJlcXVlc3QuCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsICIgTm90IGNvbm5lY3RlZCwgQXR0ZW1wdGluZyB0byBKb2luIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbUlzc3VlSm9pbiggcE1hYywgc2Vzc2lvbklkLCBwQnNzRGVzYywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodERvdDExZkJlYWNvbklFcyAqKSggcFNjYW5SZXN1bHQtPlJlc3VsdC5wdkllcyApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBDb21tYW5kLT51LnJvYW1DbWQucm9hbVByb2ZpbGUsIHBDb21tYW5kLT51LnJvYW1DbWQucm9hbUlkICk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy90cnkgc29tZXRoaW5nIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JSb2FtKCBwTWFjLCBwQ29tbWFuZCApOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZiggIXBTY2FuUmVzdWx0LT5SZXN1bHQucHZJZXMgKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vTG9jYWxseSBhbGxvY2F0ZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwSWVzTG9jYWwpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfS8vaWYgKCBjc3JJc0luZnJhQnNzRGVzYyggcEJzc0Rlc2MgKSApCisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csIEZMKCIgIGZvdW5kIEJTU1R5cGUgbWlzbWF0Y2hpbmcgdGhlIG9uZSBpbiBCU1MgZGVzY3JpcHRpb24iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfS8vZWxzZQorICAgICAgICB9Ly9pZiAoIFdOSV9DRkdfU1VDQ0VTUyA9PSByZXN1bHQgKQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIEluIHRoZSBldmVudCB0aGUgY29uZmlndXJhdGlvbiBmYWlsZWQsICBmb3IgaW5mcmEgbGV0IHRoZSByb2FtIHByb2Nlc3NvciAKKyAgICAgICAgICAgIC8vYXR0ZW1wdCB0byBqb2luIHNvbWV0aGluZyBlbHNlLi4uCisgICAgICAgICAgICBpZiggcENvbW1hbmQtPnUucm9hbUNtZC5wUm9hbUJzc0VudHJ5ICYmIENTUl9JU19JTkZSQVNUUlVDVFVSRSggJnBDb21tYW5kLT51LnJvYW1DbWQucm9hbVByb2ZpbGUgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICBjc3JSb2FtKHBNYWMsIHBDb21tYW5kKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvL1dlIG5lZWQgdG8gY29tcGxldGUgdGhlIGNvbW1hbmQKKyAgICAgICAgICAgICAgICBpZiAoIGNzcklzQnNzVHlwZUlCU1MoIHBDb21tYW5kLT51LnJvYW1DbWQucm9hbVByb2ZpbGUuQlNTVHlwZSApICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGNzclJvYW1Db21wbGV0ZShwTWFjLCBlQ3NyU3RhcnRCc3NGYWlsdXJlLCBOVUxMKTsKKyAgICAgICAgICAgICA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sKKyAgICAgICAgcmVzdWx0ID0gZUNzclJlYXNzb2NGYWlsdXJlOworI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCisgICAgICAgIGlmICgoZVNJUl9TTUVfRlRfUkVBU1NPQ19USU1FT1VUX0ZBSUxVUkUgPT0gcFNtZUpvaW5Sc3AtPnN0YXR1c0NvZGUpIHx8CisgICAgICAgICAgICAoZVNJUl9TTUVfRlRfUkVBU1NPQ19GQUlMVVJFID09IHBTbWVKb2luUnNwLT5zdGF0dXNDb2RlKSB8fAorICAgICAgICAgICAgKGVTSVJfU01FX0pPSU5fREVBVVRIX0ZST01fQVBfRFVSSU5HX0FERF9TVEEgPT0gcFNtZUpvaW5Sc3AtPnN0YXR1c0NvZGUpKQorICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gSW5mb3JtIEhERCB0byB0dXJuIG9mZiBGVCBmbGFnIGluIEhERCAKKyAgICAgICAgICAgICAgICBpZiAocE5laWdoYm9yUm9hbUluZm8pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV96ZXJvKCZyb2FtSW5mbywgc2l6ZW9mKHRDc3JSb2FtSW5mbykpOworICAgICAgICAgICAgICAgICAgICAgICAgY3NyUm9hbUNhbGxDYWxsYmFjayhwTWFjLCBwTmVpZ2hib3JSb2FtSW5mby0+Y3NyU2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZyb2FtSW5mbywgcm9hbUlkLCBlQ1NSX1JPQU1fRlRfUkVBU1NPQ19GQUlMRUQsIGVTSVJfU01FX1NVQ0NFU1MpOworICAgICAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIFNpbmNlIHRoZSBhYm92ZSBjYWxsYmFjayBzZW5kcyBhIGRpc2Nvbm5lY3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIHRvIEhERCwgd2Ugc2hvdWxkIGNsZWFuLXVwIG91ciBzdGF0ZSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIG1hY2hpbmUgYXMgd2VsbCB0byBiZSBpbiBzeW5jIHdpdGggdGhlIHVwcGVyCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBsYXllcnMuIFRoZXJlIGlzIG5vIG5lZWQgdG8gc2VuZCBhIGRpc2Fzc29jIAorICAgICAgICAgICAgICAgICAgICAgICAgICogc2luY2U6IDEpIHdlIHdpbGwgbmV2ZXIgcmVhc3NvYyB0byB0aGUgY3VycmVudCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIEFQIGluIExGUiwgYW5kIDIpIHRoZXJlIGlzIG5vIG5lZWQgdG8gaXNzdWUgYSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIGRpc2Fzc29jIHRvIHRoZSBBUCB3aXRoIHdoaWNoIHdlIHdlcmUgdHJ5aW5nIAorICAgICAgICAgICAgICAgICAgICAgICAgICogdG8gcmVhc3NvYy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgICAgY3NyUm9hbUNvbXBsZXRlKCBwTWFjLCBlQ3NySm9pbkZhaWx1cmUsIE5VTEwgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyNlbmRpZgorICAgICAgICAvLyBJbiB0aGUgZXZlbnQgdGhhdCB0aGUgUmVhc3NvY2lhdGlvbiBmYWlscywgdGhlbiB3ZSBuZWVkIHRvIERpc2Fzc29jaWF0ZSB0aGUgY3VycmVudCBhc3NvY2lhdGlvbiBhbmQga2VlcAorICAgICAgICAvLyByb2FtaW5nLiAgTm90ZSB0aGF0IHdlIHdpbGwgYXR0ZW1wdCB0byBKb2luIHRoZSBBUCBpbnN0ZWFkIG9mIGEgUmVhc3NvYyBzaW5jZSB3ZSBtYXkgaGF2ZSBhdHRlbXB0ZWQgYQorICAgICAgICAvLyAnUmVhc3NvYy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VyKTsKKyAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgIiVzOiBmYWlsZWQgdG8gcHJlcGFyZSBzY2FuIGZpbHRlciB3aXRoIHN0YXR1cyAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBzdGF0dXMpOworICAgICAgICAgICAgICAgZ290byBQT1NUX1JPQU1fRkFJTFVSRTsKKyAgICAgICAgICAgfQorICAgICAgICAgICBlbHNlCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclNjYW5HZXRSZXN1bHQocE1hYywgcFNjYW5GaWx0ZXIsICZoQlNTTGlzdCk7CisgICAgICAgICAgICAgICBpZiAoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwiJXM6IGNzclNjYW5HZXRSZXN1bHQgZmFpbGVkIHdpdGggc3RhdHVzICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBzdGF0dXMpOworICAgICAgICAgICAgICAgICAgIGdvdG8gUE9TVF9ST0FNX0ZBSUxVUkU7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgIH0KKyAgICAgICB9CisgICAgICAgZWxzZQorICAgICAgIHsKKyAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCIlczogYWxsb2MgZm9yIHBTY2FuRmlsdGVyIGZhaWxlZCB3aXRoIHN0YXR1cyAlZCIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHN0YXR1cyk7CisgICAgICAgICAgIGdvdG8gUE9TVF9ST0FNX0ZBSUxVUkU7CisgICAgICAgfQorCisgICAgICAgLyoKKyAgICAgICAgKiBBZnRlciBlbnN1cmluZyB0aGF0IHRoZSByb2FtIHByb2ZpbGUgaXMgaW4gdGhlIHNjYW4gcmVzdWx0IGxpc3QsCisgICAgICAgICogZGVxdWV1ZSB0aGUgY29tbWFuZCBmcm9tIHRoZSBhY3RpdmUgbGlzdC4KKyAgICAgICAgKi8KKyAgICAgICAgcEVudHJ5ID0gY3NyTExQZWVrSGVhZCggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0LCBMTF9BQ0NFU1NfTE9DSyApOworICAgICAgICBpZiAoIHBFbnRyeSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBDb21tYW5kID0gR0VUX0JBU0VfQUREUiggcEVudHJ5LCB0U21lQ21kLCBMaW5rICk7CisgICAgICAgICAgICAvKiBJZiB0aGUgaGVhZCBvZiB0aGUgcXVldWUgaXMgQWN0aXZlIGFuZCBpdCBpcyBhIFJPQU0gY29tbWFuZCwgcmVtb3ZlCisgICAgICAgICAgICAgKiBhbmQgcHV0IHRoaXMgb24gdGhlIEZyZWUgcXVldWUuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmICggZVNtZUNvbW1hbmRSb2FtID09IHBDb21tYW5kLT5jb21tYW5kICkKKyAgICAgICAgICAgIHsKKworICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICogd2UgbmVlZCB0byBwcm9jZXNzIHRoZSByZXN1bHQgZmlyc3QgYmVmb3JlIHJlbW92aW5nIGl0IGZyb20gYWN0aXZlIGxpc3QgCisgICAgICAgICAgICAgICAgICogYmVjYXVzZSBzdGF0ZSBjaGFuZ2VzIHN0aWxsIGhhcHBlbmluZyBpbnNpZGVzIHJvYW1RUHJvY2Vzc1JvYW1SZXN1bHRzIHNvCisgICAgICAgICAgICAgICAgICogbm8gb3RoZXIgcm9hbSBjb21tYW5kIHNob3VsZCBiZSBpc3N1ZWQuCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgZlJlbW92ZUNtZCA9IGNzckxMUmVtb3ZlRW50cnkoICZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTE9DSyApOworICAgICAgICAgICAgICAgIGlmKHBDb21tYW5kLT51LnJvYW1DbWQuZlJlbGVhc2VQcm9maWxlKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY3NyUmVsZWFzZVByb2ZpbGUocE1hYywgJnBDb21tYW5kLT51LnJvYW1DbWQucm9hbVByb2ZpbGUpOworICAgICAgICAgICAgICAgICAgICBwQ29tbWFuZC0+dS5yb2FtQ21kLmZSZWxlYXNlUHJvZmlsZSA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYoIGZSZW1vdmVDbWQgKQorICAgICAgICAgICAgICAgICAgICBjc3JSZWxlYXNlQ29tbWFuZFJvYW0oIHBNYWMsIHBDb21tYW5kICk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAiJXM6IGZhaWwgdG8gcmVtb3ZlIGNtZCByZWFzb24gJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1SZWFzb24gKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAiJXM6IHJvYW0gY29tbWFuZCBub3QgYWN0aXZlIiwgX19mdW5jX18gKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgIiVzOiBOTyBjb21tYW5kcyBhcmUgYWN0aXZlIiwgX19mdW5jX18gKTsKKyAgICAgICAgfQorCisgICAg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21lbV9mcmVlKHBTY2FuRmlsdGVyKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCitQT1NUX1JPQU1fRkFJTFVSRToKKyAgICAgICAgaWYgKHBTY2FuRmlsdGVyKQorICAgICAgICB7CisgICAgICAgICAgICBjc3JGcmVlU2NhbkZpbHRlcihwTWFjLCBwU2NhbkZpbHRlcik7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocFNjYW5GaWx0ZXIpOworICAgICAgICB9CisgICAgICAgIGlmIChwQ3VyUm9hbVByb2ZpbGUpCisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocEN1clJvYW1Qcm9maWxlKTsKKworICAgICAgICAvKiBJbmZvcm0gdGhlIHVwcGVyIGxheWVycyB0aGF0IHRoZSByZWFzc29jIGZhaWxlZCAqLworICAgICAgICB2b3NfbWVtX3plcm8oJnJvYW1JbmZvLCBzaXplb2YodENzclJvYW1JbmZvKSk7CisgICAgICAgIGNzclJvYW1DYWxsQ2FsbGJhY2socE1hYywgc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICZyb2FtSW5mbywgMCwgZUNTUl9ST0FNX0ZUX1JFQVNTT0NfRkFJTEVELCBlU0lSX1NNRV9TVUNDRVNTKTsKKworICAgICAgICAvKiAKKyAgICAgICAgICogSXNzdWUgYSBkaXNhc3NvYyByZXF1ZXN0IHNvIHRoYXQgUEUvTElNIHVzZXMgdGhpcyB0byBjbGVhbi11cCB0aGUgRlQgc2Vzc2lvbi4KKyAgICAgICAgICogVXBvbiBzdWNjZXNzLCB3ZSB3b3VsZCByZS1lbnRlciB0aGlzIHJvdXRpbmUgYWZ0ZXIgcmVjZWl2aW5nIHRoZSBkaXNhc3NvYworICAgICAgICAgKiByZXNwb25zZSBhbmQgd2lsbCBmYWxsIGludG8gdGhlIHJlYXNzb2MgZmFpbCBzdWItc3RhdGUuIEFuZCwgZXZlbnR1YWxseQorICAgICAgICAgKiBjYWxsIGNzclJvYW1Db21wbGV0ZSB3aG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CAodFNpclNtZUF1dGhSc3AgKilwU21lUnNwICk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgY2FzZSBlV05JX1NNRV9SRUFTU09DX1JTUDogICAgIC8vIG9yIHRoZSBSZWFzc29jaWF0aW9uIHJlc3BvbnNlIG1lc3NhZ2UuLi4KKyAgICAgICAgICAgIGlmIChDU1JfSVNfUk9BTV9TVUJTVEFURV9SRUFTU09DX1JFUSggcE1hYywgcFNtZVJzcC0+c2Vzc2lvbklkKSApIAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNzclJvYW1Sb2FtaW5nU3RhdGVSZWFzc29jUnNwUHJvY2Vzc29yKCBwTWFjLCAodHBTaXJTbWVKb2luUnNwIClwU21lUnNwICk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgY2FzZSBlV05JX1NNRV9TVE9QX0JTU19SU1A6ICAgIC8vIG9yIHRoZSBTdG9wIEJzcyByZXNwb25zZSBtZXNzYWdlLi4uCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY3NyUm9hbVJvYW1pbmdTdGF0ZVN0b3BCc3NSc3BQcm9jZXNzb3IocE1hYywgcFNtZVJzcCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgY2FzZSBlV05JX1NNRV9ESVNBU1NPQ19SU1A6ICAgIC8vIG9yIHRoZSBEaXNhc3NvY2lhdGUgcmVzcG9uc2UgbWVzc2FnZS4uLgorICAgICAgICAgICAgaWYgKCBDU1JfSVNfUk9BTV9TVUJTVEFURV9ESVNBU1NPQ19SRVEoIHBNYWMsIHBTbWVSc3AtPnNlc3Npb25JZCApICAgICAgfHwKKyAgICAgICAgICAgICAgICAgQ1NSX0lTX1JPQU1fU1VCU1RBVEVfRElTQVNTT0NfTk9fSk9JTiggcE1hYywgcFNtZVJzcC0+c2Vzc2lvbklkICkgIHx8CisgICAgICAgICAgICAgICAgIENTUl9JU19ST0FNX1NVQlNUQVRFX1JFQVNTT0NfRkFJTCggcE1hYywgcFNtZVJzcC0+c2Vzc2lvbklkICkgICAgICB8fAorICAgICAgICAgICAgICAgICBDU1JfSVNfUk9BTV9TVUJTVEFURV9ESVNBU1NPQ19GT1JDRUQoIHBNYWMsIHBTbWVSc3AtPnNlc3Npb25JZCApICAgfHwKKyAgICAgICAgICAgICAgICAgQ1NSX0lTX1JPQU1fU1VCU1RBVEVfRElTQ09OTkVDVF9DT05USU5VRSggcE1hYywgcFNtZVJzcC0+c2Vzc2lvbklkICkgfHwKKy8vSE8KKyAgICAgICAgICAgICAgICAgQ1NSX0lTX1JPQU1fU1VCU1RBVEVfRElTQVNTT0NfSE8oIHBNYWMsIHBTbWVSc3AtPnNlc3Npb25JZCApICAgICAgICAgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCBGTCgiZVdOSV9TTUVfRElTQVNTT0NfUlNQIHN1YlN0YXRlID0gJXMiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgbWFjVHJhY2VHZXRjc3JSb2FtU3ViU3RhdGUoCisgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0uY3VyU3ViU3RhdGVbcFNtZVJzcC0+c2Vzc2lvbklkXSkpOworICAgICAgICAgICAgICAgIGNzclJvYW1Sb2FtaW5nU3RhdGVEaXNhc3NvY1JzcFByb2Nlc3NvciggcE1hYywgKHRTaXJTbWVEaXNhc3NvY1JzcCAqKXBTbWVSc3AgKTsKKyAgICAgICAgICAgICAgICBpZiAocE1hYy0+cm9hbS5jb25maWdQYXJhbS5yb2FtRGVsYXlTdGF0c0VuYWJsZWQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB2b3NfcmVjb3JkX3JvYW1fZXZlbnQoZV9TTUVfRElTQVNTT0NfQ09NUExFVEUsIE5VTEwsIDApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgIAorICAgICAgICBjYXNlIGVXTklfU01FX0RFQVVUSF9SU1A6ICAgIC8vIG9yIHRoZSBEZWF1dGhlbnRpY2F0aW9uIHJlc3BvbnNlIG1lc3NhZ2UuLi4KKyAgICAgICAgICAgIGlmICggQ1NSX0lTX1JPQU1fU1VCU1RBVEVfREVBVVRIX1JFUSggcE1hYywgcFNtZVJzcC0+c2Vzc2lvbklkICkgKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjc3JSb2FtUm9hbWluZ1N0YXRlRGVhdXRoUnNwUHJvY2Vzc29yKCBwTWFjLCAodFNpclNtZURlYXV0aFJzcCAqKXBTbWVSc3AgKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgIAorICAgICAgICBjYXNlIGVXTklfU01FX1NUQVJUX0JTU19SU1A6ICAgICAgLy8gb3IgdGhlIFN0YXJ0IEJTUyByZXNwb25zZSBtZXNzYWdlLi4uCisgICAgICAgICAgICBpZiAoQ1NSX0lTX1JPQU1fU1VCU1RBVEVfU1RBUlRfQlNTX1JFUSggcE1hYywgcFNtZVJzcC0+c2Vzc2lvbklkICkgKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjc3JSb2FtUm9hbWluZ1N0YXRlU3RhcnRCc3NSc3BQcm9jZXNzb3IoIHBNYWMsICh0U2lyU21lU3RhcnRCc3NSc3AgKilwU21lUnNwICk7CisgICAgICAgICAgICB9IAorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgCisgICAgICAgIGNhc2UgV05JX0NGR19TRVRfQ05GOiAgICAvLyBwcm9jZXNzIHRoZSBDb25maWcgQ29uZmlybSBtZXNzYWdlcyB3aGVuIHdlIGFyZSBpbiAnQ29uZmlnJyBzdWJzdGF0ZS4uLgorICAgICAgICAgICAgaWYgKCBDU1JfSVNfUk9BTV9TVUJTVEFURV9DT05GSUcoIHBNYWMsIHBTbWVSc3AtPnNlc3Npb25JZCApICkgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY3NyUm9hbWluZ1N0YXRlQ29uZmlnQ25mUHJvY2Vzc29yKCBwTWFjLCAoKHRDc3JDZmdTZXRSc3AgKilwU21lUnNwKS0+cmVzcFN0YXR1cyApOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIC8vSW4gY2FzZSBDU1IgaXNzdWVzIFNUT1BfQlNTLCB3ZSBuZWVkIHRvIHRlbGwgSEREIGFib3V0IHBlZXIgZGVwYXJ0ZWQgYmVjYXN1ZSBQRSBpcyByZW1vdmluZyB0aGVtCisgICAgICAgIGNhc2UgZVdOSV9TTUVfSUJTU19QRUVSX0RFUEFSVEVEX0lORDoKKyAgICAgICAgICAgIHBJYnNzUGVlckluZCA9ICh0U21lSWJzc1BlZXJJbmQqKXBTbWVSc3A7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgIkNTUjogUGVlciBkZXBhcnRlZCBub3RpZmljYXRpb24gZnJvbSBMSU0gaW4gam9pbmluZyBzdGF0ZSIpOworICAgICAgICAgICAgdm9zX21lbV9zZXQoJnJvYW1JbmZvLCBzaXplb2YodENzclJvYW1JbmZvKSwgMCk7CisgICAgICAgICAgICByb2FtSW5mby5zdGFJZCA9ICh0QU5JX1U4KXBJYnNzUGVlckluZC0+c3RhSWQ7CisgICAgICAgICAgICByb2FtSW5mby51Y2FzdFNpZyA9ICh0QU5JX1U4KXBJYnNzUGVlckluZC0+dWNhc3RTaWc7CisgICAgICAgICAgICByb2FtSW5mby5iY2FzdFNpZyA9ICh0QU5JX1U4KXBJYnNzUGVlckluZC0+YmNhc3RTaWc7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnJvYW1JbmZvLnBlZXJNYWMsIHBJYnNzUGVlckluZC0+cGVlckFkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRDc3JCc3NpZCkpOworICAgICAgICAgICAgY3NyUm9hbUNhbGxDYWxsYmFjayhwTWFjLCBzZXNzaW9uSWQsICZyb2FtSW5mbywgMCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfUk9BTV9DT05ORUNUX1NUQVRVU19VUERBVEUsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fUkVTVUxUX0lCU1NfUEVFUl9ERVBBUlRFRCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9MT1NUX0xJTktfUEFSQU1TX0lORDoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB0cFNpclNtZUxvc3RMaW5rUGFyYW1zSW5kIHBMb3N0TGlua1BhcmFtc0luZCA9ICh0cFNpclNtZUxvc3RMaW5rUGFyYW1zSW5kKXBTbWVSc3A7CisgICAgICAgICAgICAgICAgdENzclJvYW1JbmZvIHJvYW1JbmZvLCAqcFJvYW1JbmZvID0gTlVMTDsKKyAgICAgICAgICAgICAgICBlQ3NyUm9hbVJlc3VsdCByZXN1bHQgPSBlQ1NSX1JPQU1fUkVTVUxUX05PTkU7CisgICAgICAgICAgICAgICAgdm9zX21lbV9zZXQoJnJvYW1JbmZvLCBzaXplb2YodENzclJvYW1JbmZvKSwgMCk7CisgICAgICAgICAgICAgICAgcm9hbUluZm8udS5wTG9zdExpbmtQYXJhbXMgPSAmcExvc3RMaW5rUGFyYW1zSW5kLT5pbmZvOworICAgICAgICAgICAgICAgIHBSb2FtSW5mbyA9ICZyb2FtSW5mbzsKKyAgICAgICAgICAgICAgICBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIHBMb3N0TGlua1BhcmFtc0luZC0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mbywgMCwgZUNTUl9ST0FNX0xPU1RfTElOS19QQVJBTVNfSU5ELCByZXN1bHQpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgICAgRkwoIlVuZXhwZWN0ZWQgbWVzc2FnZSB0eXBlID0gJWRbMHglWF0gcmVjZWl2ZWQgaW4gc3Vic3RhdGUgJXMiKSwKKyAgICAgICAgICAgICAgICAgICBwU21lUnNwLT5tZXNzYWdlVHlwZSwgcFNtZVJzcC0+bWVzc2FnZVR5cGUsCisgICAgICAgICAgICAgICAgICAgbWFjVHJhY2VHZXRjc3JSb2FtU3ViU3RhdGUoCisgICAgICAgICAgICAgICAgICAgcE1hYy0+cm9hbS5jdXJTdWJTdGF0ZVtwU21lUnNwLT5zZXNzaW9uSWRdKSk7CisKKyAgICAgICAgICAgIC8vSWYgd2UgYXJlIGNvbm5lY3RlZCwgY2hlY2sgdGhlIGxpbmsgc3RhdHVzIGNoYW5nZSAKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFjc3JJc0Nvbm5TdGF0ZURpc2Nvbm5lY3RlZChwTWFjLCBzZXNzaW9uSWQpKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JSb2FtQ2hlY2tGb3JMaW5rU3RhdHVzQ2hhbmdlKCBwTWFjLCBwU21lUnNwICk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsgICAgICAgICAgCisgICAgfQorfQorCit2b2lkIGNzclJvYW1Kb2luZWRTdGF0ZU1zZ1Byb2Nlc3NvciggdHBBbmlTaXJHbG9iYWwgcE1hYywgdm9pZCAqcE1zZ0J1ZiApCit7CisgICAgdFNpclNtZVJzcCAqcFNpck1zZyA9ICh0U2lyU21lUnNwICopcE1zZ0J1ZjsKKyAgICBzd2l0Y2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MsICh0Q3NyQnNzaWQgKilwVXBwZXJMYXllckFzc29jQ25mLT5ic3NJZCwgJnNlc3Npb25JZCApOworICAgICAgICAgICAgcFNlc3Npb24gPSBDU1JfR0VUX1NFU1NJT04ocE1hYywgc2Vzc2lvbklkKTsKKworICAgICAgICAgICAgaWYoIXBTZXNzaW9uKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiICBzZXNzaW9uICVkIG5vdCBmb3VuZCAiKSwgc2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHBSb2FtSW5mby0+c3RhdHVzQ29kZSA9IGVTSVJfU01FX1NVQ0NFU1M7IC8vc2VuZCB0aGUgc3RhdHVzIGNvZGUgYXMgU3VjY2VzcyAKKyAgICAgICAgICAgIHBSb2FtSW5mby0+dS5wQ29ubmVjdGVkUHJvZmlsZSA9ICZwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZTsKKyAgICAgICAgICAgIHBSb2FtSW5mby0+c3RhSWQgPSAodEFOSV9VOClwVXBwZXJMYXllckFzc29jQ25mLT5haWQ7CisgICAgICAgICAgICBwUm9hbUluZm8tPnJzbklFTGVuID0gKHRBTklfVTgpcFVwcGVyTGF5ZXJBc3NvY0NuZi0+cnNuSUUubGVuZ3RoOworICAgICAgICAgICAgcFJvYW1JbmZvLT5wcnNuSUUgPSBwVXBwZXJMYXllckFzc29jQ25mLT5yc25JRS5yc25JRWRhdGE7CisgICAgICAgICAgICBwUm9hbUluZm8tPmFkZElFTGVuID0gKHRBTklfVTgpcFVwcGVyTGF5ZXJBc3NvY0NuZi0+YWRkSUUubGVuZ3RoOworICAgICAgICAgICAgcFJvYW1JbmZvLT5wYWRkSUUgPSBwVXBwZXJMYXllckFzc29jQ25mLT5hZGRJRS5hZGRJRWRhdGE7ICAgICAgICAgICAKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwUm9hbUluZm8tPnBlZXJNYWMsIHBVcHBlckxheWVyQXNzb2NDbmYtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwUm9hbUluZm8tPmJzc2lkLCBwVXBwZXJMYXllckFzc29jQ25mLT5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodENzckJzc2lkKSk7CisgICAgICAgICAgICBwUm9hbUluZm8tPndtbUVuYWJsZWRTdGEgPSBwVXBwZXJMYXllckFzc29jQ25mLT53bW1FbmFibGVkU3RhOworI2lmZGVmIFdMQU5fRkVBVFVSRV9BUF9IVDQwXzI0RworICAgICAgICAgICAgcFJvYW1JbmZvLT5IVDQwTUh6SW50b0VuYWJsZWRTdGEgPQorICAgICAgICAgICAgICAgICAgICAgICBwVXBwZXJMYXllckFzc29jQ25mLT5IVDQwTUh6SW50b0VuYWJsZWRTdGE7CisgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR1csIEZMKCJIVDQwTUh6SW50b0VuYWJsZWRTdGE6ICVkIFxuIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPkhUNDBNSHpJbnRvRW5hYmxlZFN0YSk7CisjZW5kaWYKKyAgICAgICAgICAgIGlmKENTUl9JU19JTkZSQV9BUChwUm9hbUluZm8tPnUucENvbm5lY3RlZFByb2ZpbGUpICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0uY29ubmVjdFN0YXRlID0gZUNTUl9BU1NPQ19TVEFURV9UWVBFX0lORlJBX0NPTk5FQ1RFRDsKKyAgICAgICAgICAgICAgICBwUm9hbUluZm8tPmZSZWFzc29jUmVxID0gcFVwcGVyTGF5ZXJBc3NvY0NuZi0+cmVhc3NvY1JlcTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIHNlc3Npb25JZCwgcFJvYW1JbmZvLCAwLCBlQ1NSX1JPQU1fSU5GUkFfSU5ELCBlQ1NSX1JPQU1fUkVTVUxUX0lORlJBX0FTU09DSUFUSU9OX0NORik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZihDU1JfSVNfV0RTX0FQKCBwUm9hbUluZm8tPnUucENvbm5lY3RlZFByb2ZpbGUpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19zbGVlcCggMTAwICk7CisgICAgICAgICAgICAgICAgcE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLmNvbm5lY3RTdGF0ZSA9IGVDU1JfQVNTT0NfU1RBVEVfVFlQRV9XRFNfQ09OTkVDVEVEOy8vU3RhCisgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbUNhbGxDYWxsYmFjayhwTWFjLCBzZXNzaW9uSWQsIHBSb2FtSW5mbywgMCwgZUNTUl9ST0FNX1dEU19JTkQsIGVDU1JfUk9BTV9SRVNVTFRfV0RTX0FTU09DSUFUSU9OX0lORCk7Ly9TdGEKKyAgICAgICAgICAgIH0KKworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgY3NyUm9hbUNoZWNrRm9yTGlua1N0YXR1c0NoYW5nZSggcE1hYywgcFNpck1zZyApOworICAgICAgICAgIGJyZWFrOworICAgIH0KK30KKworZUhhbFN0YXR1cyBjc3JSb2FtSXNzdWVTZXRDb250ZXh0UmVxKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UzMiBzZXNzaW9uSWQsIGVDc3JFbmNyeXB0aW9uVHlwZSBFbmNyeXB0VHlwZSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpckJzc0Rlc2NyaXB0aW9uICpwQnNzRGVzY3JpcHRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNBZGRyICpic3NJZCwgdEFOSV9CT09MRUFOIGFkZEtleSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfQk9PTEVBTiBmVW5pY2FzdCwgdEFuaUtleURpcmVjdGlvbiBhbmlLZXlEaXJlY3Rpb24sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBrZXlJZCwgdEFOSV9VMTYga2V5TGVuZ3RoLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBLZXksIHRBTklfVTggcGFlUm9sZSApCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIHRBbmlFZFR5cGUgZWRUeXBlOworICAgIAorICAgIGlmKGVDU1JfRU5DUllQVF9UWVBFX1VOS05PV04gPT0gRW5jcnlwdFR5cGUpCisgICAgeworICAgICAgICBFbmNyeXB0VHlwZSA9IGVDU1JfRU5DUllQVF9UWVBFX05PTkU7IC8vKioqCisgICAgfQorICAgIAorICAgIGVkVHlwZSA9IGNzclRyYW5zbGF0ZUVuY3J5cHRUeXBlVG9FZFR5cGUoIEVuY3J5cHRUeXBlICk7CisgICAgCisgICAgLy8gQWxsb3cgMCBrZXlzIHRvIGJlIHNldCBmb3IgdGhlIG5vbi1XUEEgZW5jcnlwdCB0eXBlcy4uLiAgRm9yIFdQQSBlbmNyeXB0IHR5cGVzLCB0aGUgbnVtIGtleXMgbXVzdCBiZSBub24temVybworICAgIC8vIG9yIExJTSB3aWxsIHJlamVjdCB0aGUgc2V0IGNvbnRleHQgKGFzc3VtZXMgdGhlIFNFVF9DT05URVhUIGRvZXMgbm90IG9jY3VyIHVudGlsIHRoZSBrZXlzIGFyZSBkaXN0cnVidXRlZCkuCisgICAgaWYgKCBDU1JfSVNfRU5DX1RZUEVfU1RBVElDKCBFbmNyeXB0VHlwZSApIHx8CisgICAgICAgICAgIGFkZEtleSApICAgICAKKyAgICB7CisgICAgICAgIHRDc3JSb2FtU2V0S2V5IHNldEtleTsKKyAgICAgICAgc2V0S2V5LmVuY1R5cGUgPSBFbmNyeXB0VHlwZTsKKyAgICAgICAgc2V0S2V5LmtleURpcmVjdGlvbiA9IGFuaUtleURpcmVjdGlvbjsgICAgLy9UeCwgUnggb3IgVHgtYW5kLVJ4CisgICAgICAgIHZvc19tZW1fY29weSgmc2V0S2V5LnBlZXJNYWMsIGJzc0lkLCBzaXplb2YodENzckJzc2lkKSk7CisgICAgICAgIHNldEtleS5wYWVSb2xlID0gcGFlUm9sZTsgICAgICAvLzAgZm9yIHN1cHBsaWNhbnQKKyAgICAgICAgc2V0S2V5LmtleUlkID0ga2V5SWQ7ICAvLyBLeWUgaW5kZXgKKyAgICAgICAgc2V0S2V5LmtleUxlbmd0aCA9IGtleUxlbmd0aDsgIAorICAgICAgICBpZigga2V5TGVuZ3RoICkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHNldEtleS5LZXksIHBLZXksIGtleUxlbmd0aCk7CisgICAgICAgIH0KKyAgICAgICAgc3RhdHVzID0gY3NyUm9hbUlzc3VlU2V0S2V5Q29tbWFuZCggcE1hYywgc2Vzc2lvbklkLCAmc2V0S2V5LCAwICk7CisgICAgfQorICAgIHJldHVybiAoc3RhdHVzKTsKK30KKworc3RhdGljIGVIYWxTdGF0dXMgY3NyUm9hbUlzc3VlU2V0S2V5Q29tbWFuZCggdHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMzIgc2Vzc2lvbklkLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRDc3JSb2FtU2V0S2V5ICpwU2V0S2V5LCB0QU5JX1UzMiByb2FtSWQgKQoreworICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfSU5WQUxJRF9QQVJBTUVUR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AgICB7CisgICAgICAgICAgICAvL0tleUxlbmd0aCBtYXliZSAwIGZvciBzdGF0aWMgV0VQCisgICAgICAgICAgICBpZiggcFNldEtleS0+a2V5TGVuZ3RoICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoIHBTZXRLZXktPmtleUxlbmd0aCA8IENTUl9XRVA0MF9LRVlfTEVOICkgCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR1csICJJbnZhbGlkIFdFUDQwIGtleWxlbmd0aCBbPSAlZF0gaW4gU2V0Q29udGV4dCBjYWxsIiwgcFNldEtleS0+a2V5TGVuZ3RoICk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOyAgICAgICAgCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnNldEtleUNtZC5rZXlMZW5ndGggPSBDU1JfV0VQNDBfS0VZX0xFTjsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocENvbW1hbmQtPnUuc2V0S2V5Q21kLktleSwgcFNldEtleS0+S2V5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDU1JfV0VQNDBfS0VZX0xFTik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoICggZUNTUl9FTkNSWVBUX1RZUEVfV0VQMTA0ID09IHBTZXRLZXktPmVuY1R5cGUgKSB8fCAKKyAgICAgICAgICAgICAoIGVDU1JfRU5DUllQVF9UWVBFX1dFUDEwNF9TVEFUSUNLRVkgPT0gcFNldEtleS0+ZW5jVHlwZSApICkgCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vS2V5TGVuZ3RoIG1heWJlIDAgZm9yIHN0YXRpYyBXRVAKKyAgICAgICAgICAgIGlmKCBwU2V0S2V5LT5rZXlMZW5ndGggKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICggcFNldEtleS0+a2V5TGVuZ3RoIDwgQ1NSX1dFUDEwNF9LRVlfTEVOICkgCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR1csICJJbnZhbGlkIFdFUDEwNCBrZXlsZW5ndGggWz0gJWRdIGluIFNldENvbnRleHQgY2FsbCIsIHBTZXRLZXktPmtleUxlbmd0aCApOworICAgICAgICAgICAgICAgICAgICBicmVhazsgICAgICAgIAorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBwQ29tbWFuZC0+dS5zZXRLZXlDbWQua2V5TGVuZ3RoID0gQ1NSX1dFUDEwNF9LRVlfTEVOOworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwQ29tbWFuZC0+dS5zZXRLZXlDbWQuS2V5LCBwU2V0S2V5LT5LZXksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENTUl9XRVAxMDRfS0VZX0xFTik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoIGVDU1JfRU5DUllQVF9UWVBFX1RLSVAgPT0gcFNldEtleS0+ZW5jVHlwZSApIAorICAgICAgICB7CisgICAgICAgICAgICBpZiAoIHBTZXRLZXktPmtleUxlbmd0aCA8IENTUl9US0lQX0tFWV9MRU4gKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HVywgIkludmFsaWQgVEtJUCBrZXlsZW5ndGggWz0gJWRdIGluIFNldENvbnRleHQgY2FsbCIsIHBTZXRLZXktPmtleUxlbmd0aCApOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcENvbW1hbmQtPnUuc2V0S2V5Q21kLmtleUxlbmd0aCA9IENTUl9US0lQX0tFWV9MRU47CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocENvbW1hbmQtPnUuc2V0S2V5Q21kLktleSwgcFNldEtleS0+S2V5LAorICAgICAgICAgICAgICAgICAgICAgICAgIENTUl9US0lQX0tFWV9MRU4pOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKCBlQ1NSX0VOQ1JZUFRfVFlQRV9BRVMgPT0gcFNldEtleS0+ZW5jVHlwZSApIAorICAgICAgICB7CisgICAgICAgICAgICBpZiAoIHBTZXRLZXktPmtleUxlbmd0aCA8IENTUl9BRVNfS0VZX0xFTiApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dXLCAiSW52YWxpZCBBRVMvQ0NNUCBrZXlsZW5ndGggWz0gJWRdIGluIFNldENvbnRleHQgY2FsbCIsIHBTZXRLZXktPmtleUxlbmd0aCApOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcENvbW1hbmQtPnUuc2V0S2V5Q21kLmtleUxlbmd0aCA9IENTUl9BRVNfS0VZX0xFTjsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwQ29tbWFuZC0+dS5zZXRLZXlDbWQuS2V5LCBwU2V0S2V5LT5LZXksCisgICAgICAgICAgICAgICAgICAgICAgICAgQ1NSX0FFU19LRVlfTEVOKTsKKyAgICAgICAgfQorI2lmZGVmIEZFQVRVUkVfV0xBTl9XQVBJCisgICAgICAgIGVsc2UgaWYgKCBlQ1NSX0VOQ1JZUFRfVFlQRV9XUEkgPT0gcFNldEtleS0+ZW5jVHlwZSApIAorICAgICAgICB7CisgICAgICAgICAgICBpZiAoIHBTZXRLZXktPmtleUxlbmd0aCA8IENTUl9XQVBJX0tFWV9MRU4gKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HVywgIkludmFsaWQgV0FQSSBrZXlsZW5ndGggWz0gJWRdIGluIFNldENvbnRleHQgY2FsbCIsIHBTZXRLZXktPmtleUxlbmd0aCApOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcENvbW1hbmQtPnUuc2V0S2V5Q21kLmtleUxlbmd0aCA9IENTUl9XQVBJX0tFWV9MRU47CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocENvbW1hbmQtPnUuc2V0S2V5Q21kLktleSwgcFNldEtleS0+S2V5LAorICAgICAgICAgICAgICAgICAgICAgICAgIENTUl9XQVBJX0tFWV9MRU4pOworICAgICAgICB9CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX1dBUEkgKi8KKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICAgICAgIGVsc2UgaWYgKCBlQ1NSX0VOQ1JZUFRfVFlQRV9LUksgPT0gcFNldEtleS0+ZW5jVHlwZSApIAorICAgICAgICB7CisgICAgICAgICAgICBpZiAoIHBTZXRLZXktPmtleUxlbmd0aCA8IENTUl9LUktfS0VZX0xFTiApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dXLCAiSW52YWxpZCBLUksga2V5bGVuZ3RoIFs9ICVkXSBpbiBTZXRDb250ZXh0IGNhbGwiLCBwU2V0S2V5LT5rZXlMZW5ndGggKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHZvc19tZW1fY29weShwU2Vzc2lvbi0+ZXNlQ2NrbUluZm8ua3JrLCBwU2V0S2V5LT5LZXksCisgICAgICAgICAgICAgICAgICAgICAgICAgQ1NSX0tSS19LRVlfTEVOKTsKKyAgICAgICAgICAgIHBTZXNzaW9uLT5lc2VDY2ttSW5mby5yZWFzc29jX3JlcV9udW09MTsKKyAgICAgICAgICAgIHBTZXNzaW9uLT5lc2VDY2ttSW5mby5rcmtfcGx1bWJlZCA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0VTRSAqLworCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgICAgICAvL0NoZWNrIGZvciAxMXcgQklQCisgICAgICAgIGVsc2UgaWYgKGVDU1JfRU5DUllQVF9UWVBFX0FFU19DTUFDID09IHBTZXRLZXktPmVuY1R5cGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChwU2V0S2V5LT5rZXlMZW5ndGggPCBDU1JfQUVTX0tFWV9MRU4pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csICJJbnZhbGlkIEFFUy9DQ01QIGtleWxlbmd0aCBbPSAlZF0gaW4gU2V0Q29udGV4dCBjYWxsIiwgcFNldEtleS0+a2V5TGVuZ3RoKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBDb21tYW5kLT51LnNldEtleUNtZC5rZXlMZW5ndGggPSBDU1JfQUVTX0tFWV9MRU47CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocENvbW1hbmQtPnUuc2V0S2V5Q21kLktleSwgcFNldEtleS0+S2V5LCBDU1JfQUVTX0tFWV9MRU4pOworICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgcENvbW1hbmQtPnUuc2V0S2V5Q21kLnJvYW1JZCA9IHJvYW1JZDsKKyAgICAgICAgcENvbW1hbmQtPnUuc2V0S2V5Q21kLmVuY1R5cGUgPSBwU2V0S2V5LT5lbmNUeXBlOworICAgICAgICBwQ29tbWFuZC0+dS5zZXRLZXlDbWQua2V5RGlyZWN0aW9uID0gcFNldEtleS0+a2V5RGlyZWN0aW9uOyAgICAvL1R4LCBSeCBvciBUeC1hbmQtUngKKyAgICAgICAgdm9zX21lbV9jb3B5KCZwQ29tbWFuZC0+dS5zZXRLZXlDbWQucGVlck1hYywgJnBTZXRLZXktPnBlZXJNYWMsCisg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cyApICkKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICAgICAgICAgICB8fCAoIGVDU1JfRU5DUllQVF9UWVBFX0tSSyA9PSBwU2V0S2V5LT5lbmNUeXBlICkgCisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0VTRSAqLworICAgICAgICAgICApICkKKyAgICB7CisgICAgICAgIGNzclJlbGVhc2VDb21tYW5kU2V0S2V5KCBwTWFjLCBwQ29tbWFuZCApOworICAgIH0KKyAgICByZXR1cm4oIHN0YXR1cyApOworfQorCitlSGFsU3RhdHVzIGNzclJvYW1Jc3N1ZVJlbW92ZUtleUNvbW1hbmQoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTMyIHNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdENzclJvYW1SZW1vdmVLZXkgKnBSZW1vdmVLZXksIHRBTklfVTMyIHJvYW1JZCApCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19JTlZBTElEX1BBUkFNRVRFUjsKKyAgICB0U21lQ21kICpwQ29tbWFuZCA9IE5VTEw7CisgICAgdEFOSV9CT09MRUFOIGZJbWVkaWF0ZSA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgIGRvCisgICAgeworICAgICAgICBpZiggIWNzcklzU2V0S2V5QWxsb3dlZChwTWFjLCBzZXNzaW9uSWQpICkgCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HVywgRkwoIiB3cm9uZyBzdGF0ZSBub3QgYWxsb3dlZCB0byBzZXQga2V5IikgKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0NTUl9XUk9OR19TVEFURTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIHBDb21tYW5kID0gY3NyR2V0Q29tbWFuZEJ1ZmZlcihwTWFjKTsKKyAgICAgICAgaWYoTlVMTCA9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VF9LRVlJRCwgJmRlZktleUlkKSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2V0S2V5RXZlbnQua2V5SWQgPSAodl9VOF90KWRlZktleUlkOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgc2V0S2V5RXZlbnQua2V5SWQgPSBwQ29tbWFuZC0+dS5zZXRLZXlDbWQua2V5SWQ7CisgICAgICAgIH0KKyAgICAgICAgc2V0S2V5RXZlbnQuYXV0aE1vZGUgPSAodl9VOF90KWRpYWdBdXRoVHlwZUZyb21DU1JUeXBlKHBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlLkF1dGhUeXBlKTsKKyAgICAgICAgV0xBTl9WT1NfRElBR19FVkVOVF9SRVBPUlQoJnNldEtleUV2ZW50LCBFVkVOVF9XTEFOX1NFQ1VSSVRZKTsKKyAgICB9CisjZW5kaWYgLy9GRUFUVVJFX1dMQU5fRElBR19TVVBQT1JUX0NTUgorICAgIGlmKCBjc3JJc1NldEtleUFsbG93ZWQocE1hYywgc2Vzc2lvbklkKSApCisgICAgeworICAgICAgICBzdGF0dXMgPSBjc3JTZW5kTUJTZXRDb250ZXh0UmVxTXNnKCBwTWFjLCBzZXNzaW9uSWQsIAorICAgICAgICAgICAgICAgICAgICAoIHRBTklfVTggKikmcENvbW1hbmQtPnUuc2V0S2V5Q21kLnBlZXJNYWMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1LZXlzLCBlZFR5cGUsIGZVbmljYXN0LCBwQ29tbWFuZC0+dS5zZXRLZXlDbWQua2V5RGlyZWN0aW9uLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUuc2V0S2V5Q21kLmtleUlkLCBwQ29tbWFuZC0+dS5zZXRLZXlDbWQua2V5TGVuZ3RoLCAKKyAgICAgICAgICAgICAgICAgICAgcENvbW1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MQU5fU0VDVVJJVFkpOworI2VuZGlmIC8vRkVBVFVSRV9XTEFOX0RJQUdfU1VQUE9SVF9DU1IKKyAgICBpZiggY3NySXNTZXRLZXlBbGxvd2VkKHBNYWMsIHNlc3Npb25JZCkgKQorICAgIHsKKyAgICAgICAgcE1zZyA9IHZvc19tZW1fbWFsbG9jKHdNc2dMZW4pOworICAgICAgICBpZiAoIE5VTEwgPT0gcE1zZyApCisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICBlbHNlCisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBzbXNMb2coIHBNYWMsIExPR1csIEZMKCIgd3Jvbmcgc3RhdGUgbm90IGFsbG93ZWQgdG8gc2V0IGtleSIpICk7CisgICAgICAgIC8vU2V0IHRoZSBlcnJvciBzdGF0dXMgc28gZXJyb3IgaGFuZGxpbmcga2lja3MgaW4gYmVsb3cKKyAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfQ1NSX1dST05HX1NUQVRFOworICAgIH0KKyAgICBpZiggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgeworICAgICAgICB2b3NfbWVtX3NldChwTXNnLCB3TXNnTGVuICwwKTsKKyAgICAgICAgcE1zZy0+bWVzc2FnZVR5cGUgPSBwYWxfY3B1X3RvX2JlMTYoKHRBTklfVTE2KWVXTklfU01FX1JFTU9WRUtFWV9SRVEpOworICAgICAgICAgICAgICAgIHBNc2ctPmxlbmd0aCA9IHBhbF9jcHVfdG9fYmUxNih3TXNnTGVuKTsKKyAgICAgICAgcE1zZy0+c2Vzc2lvbklkID0gKHRBTklfVTgpc2Vzc2lvbklkOworICAgICAgICBwTXNnLT50cmFuc2FjdGlvbklkID0gMDsKKyAgICAgICAgcCA9ICh0QU5JX1U4ICopcE1zZyArIHNpemVvZihwTXNnLT5tZXNzYWdlVHlwZSkgKyBzaXplb2YocE1zZy0+bGVuZ3RoKSArCisgICAgICAgICAgICBzaXplb2YocE1zZy0+c2Vzc2lvbklkKSArIHNpemVvZihwTXNnLT50cmFuc2FjdGlvbklkKTsKKyAgICAgICAgLy8gYnNzSWQgLSBjb3B5IGZyb20gc2Vzc2lvbiBJbmZvCisgICAgICAgIHZvc19tZW1fY29weShwLAorICAgICAgICAgICAgICAgICAgICAgJnBNYWMtPnJvYW0ucm9hbVNlc3Npb25bc2Vzc2lvbklkXS5jb25uZWN0ZWRQcm9maWxlLmJzc2lkLAorICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgIHAgKz0gc2l6ZW9mKHRTaXJNYWNBZGRyKTsKKyAgICAgICAgLy8gcGVlck1hY0FkZHIKKyAgICAgICAgdm9zX21lbV9jb3B5KHAsIHBDb21tYW5kLT51LnJlbW92ZUtleUNtZC5wZWVyTWFjLCBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgcCArPSBzaXplb2YodFNpck1hY0FkZHIpOworICAgICAgICAvLyBlZFR5cGUKKyAgICAgICAgKnAgPSAodEFOSV9VOCljc3JUcmFuc2xhdGVFbmNyeXB0VHlwZVRvRWRUeXBlKCBwQ29tbWFuZC0+dS5yZW1vdmVLZXlDbWQuZW5jVHlwZSApOworICAgICAgICBwKys7CisgICAgICAgIC8vIHdlcHR5cGUKKyAgICAgICAgaWYoICggZUNTUl9FTkNSWVBUX1RZUEVfV0VQNDBfU1RBVElDS0VZID09IHBDb21tYW5kLT51LnJlbW92ZUtleUNtZC5lbmNUeXBlICkgfHwgCisgICAgICAgICAgICAoIGVDU1JfRU5DUllQVF9UWVBFX1dFUDEwNF9TVEFUSUNLRVkgPT0gcENvbW1hbmQtPnUucmVtb3ZlS2V5Q21kLmVuY1R5cGUgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgICpwID0gKHRBTklfVTgpZVNJUl9XRVBfU1RBVElD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hbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIHRBTklfVTMyIHNpemUgPSAwOworICAgIHRBTklfVTggIGluZGV4ID0gMDsKKyAgICAKKyAgICBkbworICAgIHsKKyAgICAgICAgaWYocFByb2ZpbGUtPkJTU0lEcy5udW1PZkJTU0lEcykKKyAgICAgICAgeworICAgICAgICAgICAgc2l6ZSA9IHNpemVvZih0Q3NyQnNzaWQpICogcFByb2ZpbGUtPkJTU0lEcy5udW1PZkJTU0lEczsKKyAgICAgICAgICAgIHBTY2FuRmlsdGVyLT5CU1NJRHMuYnNzaWQgPSB2b3NfbWVtX21hbGxvYyhzaXplKTsKKyAgICAgICAgICAgIGlmICggTlVMTCA9PSBwU2NhbkZpbHRlci0+QlNTSURzLmJzc2lkICkKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwU2NhbkZpbHRlci0+QlNTSURzLm51bU9mQlNTSURzID0gcFByb2ZpbGUtPkJTU0lEcy5udW1PZkJTU0lEczsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwU2NhbkZpbHRlci0+QlNTSURzLmJzc2lkLCBwUHJvZmlsZS0+QlNTSURzLmJzc2lkLCBzaXplKTsKKyAgICAgICAgfQorICAgICAgICBpZihwUHJvZmlsZS0+U1NJRHMubnVtT2ZTU0lEcykKKyAgICAgICAgeworICAgICAgICAgICAgaWYoICFDU1JfSVNfV0RTX1NUQSggcFByb2ZpbGUgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFNjYW5GaWx0ZXItPlNTSURzLm51bU9mU1NJRHMgPSBwUHJvZmlsZS0+U1NJRHMubnVtT2ZTU0lEczsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvL0ZvciBXRFMgc3RhdGlvbgorICAgICAgICAgICAgICAgIC8vV2UgYWx3YXlzIHVzZSBpbmRleCAxIGZvciBzZWxmIFNTSUQuIEluZGV4IDAgZm9yIHBlZXIncyBTU0lEIHRoYXQgd2Ugd2FudCB0byBqb2luCisgICAgICAgICAgICAgICAgcFNjYW5GaWx0ZXItPlNTSURzLm51bU9mU1NJRHMgPSAxOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc2l6ZSA9IHNpemVvZih0Q3NyU1NJREluZm8pICogcFByb2ZpbGUtPlNTSURzLm51bU9mU1NJRHM7CisgICAgICAgICAgICBwU2NhbkZpbHRlci0+U1NJRHMuU1NJRExpc3QgPSB2b3NfbWVtX21hbGxvYyhzaXplKTsKKyAgICAgICAgICAgIGlmICggTlVMTCA9PSBwU2NhbkZpbHRlci0+U1NJRHMuU1NJRExpc3QgKQorICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHZvc19tZW1fY29weShwU2NhbkZpbHRlci0+U1NJRHMuU1NJRExpc3QsIHBQcm9maWxlLT5TU0lEcy5TU0lETGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzaXplKTsKKyAgICAgICAgfQorICAgICAgICBpZighcFByb2ZpbGUtPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0IHx8IChwUHJvZmlsZS0+Q2hhbm5lbEluZm8uQ2hhbm5lbExpc3RbMF0gPT0gMCkgKQorICAgICAgICB7CisgICAgICAgICAgICBwU2NhbkZpbHRlci0+Q2hhbm5lbEluZm8ubnVtT2ZDaGFubmVscyA9IDA7CisgICAgICAgICAgICBwU2NhbkZpbHRlci0+Q2hhbm5lbEluZm8uQ2hhbm5lbExpc3QgPSBOVUxMOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYocFByb2ZpbGUtPkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHMpCisgICAgICAgIHsKKyAgICAgICAgICAgcFNjYW5GaWx0ZXItPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0ID0gdm9zX21lbV9tYWxsb2MoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCpwU2NhbkZpbHRlci0+Q2hhbm5lbEluZm8uQ2hhbm5lbExpc3QpICoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUHJvZmlsZS0+Q2hhbm5lbEluZm8ubnVtT2ZDaGFubmVscyk7CisgICAgICAgICAgIGlmICggTlVMTCA9PSBwU2NhbkZpbHRlci0+Q2hhbm5lbEluZm8uQ2hhbm5lbExpc3QgKQorICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKworICAgICAgICAgICBwU2NhbkZpbHRlci0+Q2hhbm5lbEluZm8ubnVtT2ZDaGFubmVscyA9IDA7CisgICAgICAgICAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZm9yKGluZGV4ID0gMDsgaW5kZXggPCBwUHJvZmlsZS0+Q2hhbm5lbEluZm8ubnVtT2ZDaGFubmVsczsgaW5kZXgrKykKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBpZihjc3JSb2FtSXNDaGFubmVsVmFsaWQocE1hYywgcFByb2ZpbGUtPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0W2luZGV4XSkpCisgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcFNjYW5GaWx0ZXItPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0W3BTY2FuRmlsdGVyLT5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzXSAKKyAgICAgICAgICAgICAgICAgICAgICAgPSBwUHJvZmlsZS0+Q2hhbm5lbEluZm8uQ2hhbm5lbExpc3RbaW5kZXhdOworICAgICAgICAgICAgICAgICAgICBwU2NhbkZpbHRlci0+Q2hhbm5lbEluZm8ubnVtT2ZDaGFubmVscysrOworICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgIGVsc2UgCisgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HMSwgRkwoInByb2Nlc3MgYSBjaGFubmVsICglZCkgdGhhdCBpcyBpbnZhbGlkIiksIHBQcm9maWxlLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdFtpbmRleF0pOworICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZSAKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJDaGFubmVsIGxpc3QgZW1wdHkiKSk7CisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgcFNjYW5GaWx0ZXItPnVhcHNkX21hc2sgPSBwUHJvZmlsZS0+dWFwc2RfbWFzazsKKyAgICAgICAgcFNjYW5GaWx0ZXItPmF1dGhUeXBlID0gcFByb2ZpbGUtPkF1dGhUeXBlOworICAgICAgICBwU2NhbkZpbHRlci0+RW5jcnlwdGlvblR5cGUgPSBwUHJvZmlsZS0+RW5jcnlwdGlvblR5cGU7CisgICAgICAgIHBTY2FuRmlsdGVyLT5tY0VuY3J5cHRpb25UeXBlID0gcFByb2ZpbGUtPm1jRW5jcnlwdGlvblR5cGU7CisgICAgICAgIHBTY2FuRmlsdGVyLT5CU1NUeXBlID0gcFByb2ZpbGUtPkJTU1R5cGU7CisgICAgICAgIHBTY2FuRmlsdGVyLT5waHlNb2RlID0gcFByb2ZpbGUtPnBoeU1vZGU7CisjaWZkZWYgRkVBVFVSRV9XTEFOX1dBUEkKKyAgICAgICAgLy9jaGVjayBpZiB1c2VyIGFza2VkIGZvciBXQVBJIHdpdGggMTFuIG9yIGF1dG8gbW9kZSwgaW4gdGhhdCBjYXNlIG1vZGlmeQorICAgICAgICAvL3RoZSBwaHltb2RlIHRvIDExZworICAgICAgICBpZihjc3JJc1Byb2ZpbGVXYXBpKHBQcm9maWxlKSkKKyAgICAgICAgeworICAgICAgICAgICAgIGlmKHBTY2FuRmlsdGVyLT5waHlNb2RlICYgZUNTUl9ET1QxMV9NT0RFXzExbikKKyAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFNjYW5GaWx0ZXItPnBoeU1vZGUgJj0gfmVDU1JfRE9UMTFfTU9ERV8xMW47CisgICAgICAgICAgICAgfQorICAgICAgICAgICAgIGlmKHBTY2FuRmlsdGVyLT5waHlNb2RlICYgZUNTUl9ET1QxMV9NT0RFX0FVVE8pCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBTY2FuRmlsdGVyLT5waHlNb2RlICY9IH5lQ1NSX0RPVDExX01PREVfQVVUTzsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgICAgaWYoIXBTY2FuRmls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mRCdWZmZXIoIHBNYWMgKTsKKyAgICAgICAgaWYgKCAhcENvbW1hbmQgKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCIgZmFpbCB0byBnZXQgY29tbWFuZCBidWZmZXIiKSApOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgLy9DaGFuZ2UgdGhlIHN1YnN0YXRlIGluIGNhc2UgaXQgaXMgd2FpdGluZyBmb3Iga2V5CisgICAgICAgIGlmKCBDU1JfSVNfV0FJVF9GT1JfS0VZKCBwTWFjLCBzZXNzaW9uSWQgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGNzclJvYW1TdG9wV2FpdEZvcktleVRpbWVyKCBwTWFjICk7CisgICAgICAgICAgICBjc3JSb2FtU3Vic3RhdGVDaGFuZ2UoIHBNYWMsIGVDU1JfUk9BTV9TVUJTVEFURV9OT05FLCBzZXNzaW9uSWQpOworICAgICAgICB9CisgICAgICAgIHBDb21tYW5kLT5jb21tYW5kID0gZVNtZUNvbW1hbmRXbVN0YXR1c0NoYW5nZTsKKyAgICAgICAgcENvbW1hbmQtPnNlc3Npb25JZCA9ICh0QU5JX1U4KXNlc3Npb25JZDsKKyAgICAgICAgcENvbW1hbmQtPnUud21TdGF0dXNDaGFuZ2VDbWQuVHlwZSA9IFR5cGU7CisgICAgICAgIGlmICggZUNzckRpc2Fzc29jaWF0ZWQgPT0gIFR5cGUgKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnBDb21tYW5kLT51LndtU3RhdHVzQ2hhbmdlQ21kLnUuRGlzYXNzb2NJbmRNc2csCisgICAgICAgICAgICAgICAgICAgICAgICAgcFNtZVJzcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoIHBDb21tYW5kLT51LndtU3RhdHVzQ2hhbmdlQ21kLnUuRGlzYXNzb2NJbmRNc2cgKSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnBDb21tYW5kLT51LndtU3RhdHVzQ2hhbmdlQ21kLnUuRGVhdXRoSW5kTXNnLAorICAgICAgICAgICAgICAgICAgICAgICAgIHBTbWVSc3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCBwQ29tbWFuZC0+dS53bVN0YXR1c0NoYW5nZUNtZC51LkRlYXV0aEluZE1zZyApKTsKKyAgICAgICAgfQorICAgICAgICBpZiggSEFMX1NUQVRVU19TVUNDRVNTKCBjc3JRdWV1ZVNtZUNvbW1hbmQocE1hYywgcENvbW1hbmQsIGVBTklfQk9PTEVBTl9UUlVFKSApICkKKyAgICAgICAgeworICAgICAgICAgICAgZkNvbW1hbmRRdWV1ZWQgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgRkwoIiBmYWlsIHRvIHNlbmQgbWVzc2FnZSAiKSApOworICAgICAgICAgICAgY3NyUmVsZWFzZUNvbW1hbmRXbVN0YXR1c0NoYW5nZSggcE1hYywgcENvbW1hbmQgKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qIEFQIGhhcyBpc3N1ZWQgRGlzc2FjL0RlYXV0aCwgU2V0IHRoZSBvcGVyYXRpbmcgbW9kZSB2YWx1ZSB0byBjb25maWd1cmVkIHZhbHVlICovCisgICAgICAgIGNzclNldERlZmF1bHREb3QxMU1vZGUoIHBNYWMgKTsKKyAgICB9IHdoaWxlKCAwICk7CisgICAgcmV0dXJuKCBmQ29tbWFuZFF1ZXVlZCApOworfQorCitzdGF0aWMgdm9pZCBjc3JVcGRhdGVSc3NpKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHZvaWQqIHBNc2cpCit7CisgICAgdl9TN190ICByc3NpID0gMDsKKyAgICB0QW5pR2V0UnNzaVJlcSAqcEdldFJzc2lSZXEgPSAodEFuaUdldFJzc2lSZXEqKXBNc2c7CisgICAgaWYocEdldFJzc2lSZXEpCisgICAgeworICAgICAgICBpZihOVUxMICE9IHBHZXRSc3NpUmVxLT5wVm9zQ29udGV4dCkKKyAgICAgICAgeworICAgICAgICAgICAgV0xBTlRMX0dldFJzc2kocEdldFJzc2lSZXEtPnBWb3NDb250ZXh0LCBwR2V0UnNzaVJlcS0+c3RhSWQsICZyc3NpKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgRkwoInBHZXRSc3NpUmVxLT5wVm9zQ29udGV4dCBpcyBOVUxMIikpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgaWYoTlVMTCAhPSBwR2V0UnNzaVJlcS0+cnNzaUNhbGxiYWNrKQorICAgICAgICB7CisgICAgICAgICAgICAoKHRDc3JSc3NpQ2FsbGJhY2spKHBHZXRSc3NpUmVxLT5yc3NpQ2FsbGJhY2spKShyc3NpLCBwR2V0UnNzaVJlcS0+c3RhSWQsIHBHZXRSc3NpUmVxLT5wRGV2Q29udGV4dCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCJwR2V0UnNzaVJlcS0+cnNzaUNhbGxiYWNrIGlzIE5VTEwiKSk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgicEdldFJzc2lSZXEgaXMgTlVMTCIpKTsKKyAgICB9CisgICAgcmV0dXJuOworfQorCitzdGF0aWMgdm9pZCBjc3JVcGRhdGVTbnIodHBBbmlTaXJHbG9iYWwgcE1hYywgdm9pZCogcE1zZykKK3sKKyAgICB0QU5JX1M4ICBzbnIgPSAwOworICAgIHRBbmlHZXRTbnJSZXEgKnBHZXRTbnJSZXEgPSAodEFuaUdldFNuclJlcSopcE1zZzsKKworICAgIGlmIChwR2V0U25yUmVxKQorICAgIHsKKyAgICAgICAgaWYgKFZPU19TVEFUVVNfU1VDQ0VTUyAhPQorICAgICAgICAgICAgV0RBX0dldFNucihwR2V0U25yUmVxLT5zdGFJZCwgJnNucikpCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiRXJyb3IgaW4gV0xBTlRMX0dldFNuciIpKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChwR2V0U25yUmVxLT5zbnJDYWxsYmFjaykKKyAgICAgICAgeworICAgICAgICAgICAgKCh0Q3NyU25yQ2FsbGJhY2spKHBHZXRTbnJSZXEtPnNuckNhbGxiYWNrKSkoc25yLCBwR2V0U25yUmVxLT5zdGFJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwR2V0U25yUmVxLT5wRGV2Q29udGV4dCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoInBHZXRTbnJSZXEtPnNuckNhbGxiYWNrIGlzIE5VTEwiKSk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJwR2V0U25yUmVxIGlzIE5VTEwiKSk7CisgICAgfQorICAgIHJldHVybjsKK30KKyNpZiBkZWZpbmVkIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSIHx8IGRlZmluZWQgRkVBVFVSRV9XTEFOX0VTRSB8fCBkZWZpbmVkKEZFQVRVUkVfV0xBTl9MRlIpCit2b2lkIGNzclJvYW1Sc3NpUnNwUHJvY2Vzc29yKHRwQW5pU2lyR2xvY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ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHJlcUJrcCk7CisgICAgICAgICAgICAgICAgcFJvYW1Sc3NpUnNwLT5yc3NpUmVxID0gTlVMTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCJwUm9hbVJzc2lSc3AgaXMgTlVMTCIpKTsKKyAgICB9CisgICAgcmV0dXJuOworfQorI2VuZGlmCisKKworI2lmIGRlZmluZWQoRkVBVFVSRV9XTEFOX0VTRSkgJiYgZGVmaW5lZChGRUFUVVJFX1dMQU5fRVNFX1VQTE9BRCkKK3ZvaWQgY3NyVHNtU3RhdHNSc3BQcm9jZXNzb3IodHBBbmlTaXJHbG9iYWwgcE1hYywgdm9pZCogcE1zZykKK3sKKyAgICB0QW5pR2V0VHNtU3RhdHNSc3AqIHBUc21TdGF0c1JzcCA9ICh0QW5pR2V0VHNtU3RhdHNSc3AqKXBNc2c7CisKKyAgICBpZiAoTlVMTCAhPSBwVHNtU3RhdHNSc3ApCisgICAgeworICAgICAgICAvKiBHZXQgcm9hbSBSc3NpIHJlcXVlc3QgaXMgYmFja2VkIHVwIGFuZCBwYXNzZWQgYmFjayB0byB0aGUgcmVzcG9uc2UsCisgICAgICAgICAgICAgICAgICBFeHRyYWN0IHRoZSByZXF1ZXN0IG1lc3NhZ2UgdG8gZmV0Y2ggY2FsbGJhY2sgKi8KKyAgICAgICAgdHBBbmlHZXRUc21TdGF0c1JlcSByZXFCa3AgPSAodEFuaUdldFRzbVN0YXRzUmVxKilwVHNtU3RhdHNSc3AtPnRzbVN0YXRzUmVxOworCisgICAgICAgIGlmIChOVUxMICE9IHJlcUJrcCkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKE5VTEwgIT0gcmVxQmtwLT50c21TdGF0c0NhbGxiYWNrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICgodENzclRzbVN0YXRzQ2FsbGJhY2spKHJlcUJrcC0+dHNtU3RhdHNDYWxsYmFjaykpKHBUc21TdGF0c1JzcC0+dHNtTWV0cmljcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUc21TdGF0c1JzcC0+c3RhSWQsIHJlcUJrcC0+cERldkNvbnRleHQpOworICAgICAgICAgICAgICAgIHJlcUJrcC0+dHNtU3RhdHNDYWxsYmFjayA9IE5VTEw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocmVxQmtwKTsKKyAgICAgICAgICAgIHBUc21TdGF0c1JzcC0+dHNtU3RhdHNSZXEgPSBOVUxMOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgicmVxQmtwIGlzIE5VTEwiKSk7CisgICAgICAgICAgICBpZiAoTlVMTCAhPSByZXFCa3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHJlcUJrcCk7CisgICAgICAgICAgICAgICAgcFRzbVN0YXRzUnNwLT50c21TdGF0c1JlcSA9IE5VTEw7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgicFRzbVN0YXRzUnNwIGlzIE5VTEwiKSk7CisgICAgfQorICAgIHJldHVybjsKK30KKwordm9pZCBjc3JTZW5kRXNlQWRqYWNlbnRBcFJlcEluZCh0cEFuaVNpckdsb2JhbCBwTWFjLCB0Q3NyUm9hbVNlc3Npb24gKnBTZXNzaW9uKQoreworICAgIHRBTklfVTMyIHJvYW1UUzIgPSAwOworICAgIHRDc3JSb2FtSW5mbyByb2FtSW5mbzsKKyAgICB0cFBFU2Vzc2lvbiBwU2Vzc2lvbkVudHJ5ID0gTlVMTDsKKyAgICB0QU5JX1U4IHNlc3Npb25J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NvY0luZDsKKyAgICB2b3NfbWVtX3NldCgmcm9hbUluZm8sIHNpemVvZihyb2FtSW5mbyksIDApOworCisKKyAgICBpZiAoTlVMTCA9PSBwU2lyTXNnKQorICAgIHsgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoInBTaXJNc2cgaXMgTlVMTCIpKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBzd2l0Y2goIHBTaXJNc2ctPm1lc3NhZ2VUeXBlICkgCisgICAgeworICAgICAgICBjYXNlIGVXTklfU01FX0FTU09DX0lORDoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB0Q3NyUm9hbVNlc3Npb24gICpwU2Vzc2lvbjsKKyAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPRzEsIEZMKCJSZWNlaXZlIFdOSV9TTUVfQVNTT0NfSU5EIGZyb20gU01FIikpOworICAgICAgICAgICAgICAgIHBBc3NvY0luZCA9ICh0U2lyU21lQXNzb2NJbmQgKilwU2lyTXNnOworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1HZXRTZXNzaW9uSWRGcm9tQlNTSUQoIHBNYWMsICh0Q3NyQnNzaWQgKilwQXNzb2NJbmQtPmJzc0lkLCAmc2Vzc2lvbklkICk7CisgICAgICAgICAgICAgICAgaWYoIEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24gPSBDU1JfR0VUX1NFU1NJT04ocE1hYywgc2Vzc2lvbklkKTsKKworICAgICAgICAgICAgICAgICAgICBpZighcFNlc3Npb24pCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiICBzZXNzaW9uICVkIG5vdCBmb3VuZCAiKSwgc2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgcFJvYW1JbmZvID0gJnJvYW1JbmZvOworCisgICAgICAgICAgICAgICAgLy8gUmVxdWlyZWQgZm9yIGluZGljYXRpbmcgdGhlIGZyYW1lcyB0byB1cHBlciBsYXllcgorICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+YXNzb2NSZXFMZW5ndGggPSBwQXNzb2NJbmQtPmFzc29jUmVxTGVuZ3RoOworICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+YXNzb2NSZXFQdHIgPSBwQXNzb2NJbmQtPmFzc29jUmVxUHRyOworCisgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT5iZWFjb25QdHIgPSBwQXNzb2NJbmQtPmJlYWNvblB0cjsKKyAgICAgICAgICAgICAgICBwUm9hbUluZm8tPmJlYWNvbkxlbmd0aCA9IHBBc3NvY0luZC0+YmVhY29uTGVuZ3RoOyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBwUm9hbUluZm8tPnN0YXR1c0NvZGUgPSBlU0lSX1NNRV9TVUNDRVNTOyAvL3NlbmQgdGhlIHN0YXR1cyBjb2RlIGFzIFN1Y2Nlc3MgCisgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT51LnBDb25uZWN0ZWRQcm9maWxlID0gJnBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlOworCisgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+c3RhSWQgPSAodEFOSV9VOClwQXNzb2NJbmQtPnN0YUlkOworICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPnJzbklFTGVuID0gKHRBTklfVTgpcEFzc29jSW5kLT5yc25JRS5sZW5ndGg7CisgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+cHJzbklFID0gcEFzc29jSW5kLT5yc25JRS5yc25JRWRhdGE7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT5hZGRJRUxlbiA9ICh0QU5JX1U4KXBBc3NvY0luZC0+YWRkSUUubGVuZ3RoOworICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+cGFkZElFID0gIHBBc3NvY0luZC0+YWRkSUUuYWRkSUVkYXRhOworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocFJvYW1JbmZvLT5wZWVyTWFjLCBwQXNzb2NJbmQtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmcFJvYW1JbmZvLT5ic3NpZCwgcEFzc29jSW5kLT5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0Q3NyQnNzaWQpKTsKKyAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT53bW1FbmFibGVkU3RhID0gcEFzc29jSW5kLT53bW1FbmFibGVkU3RhOworI2lmZGVmIFdMQU5fRkVBVFVSRV9BUF9IVDQwXzI0RworICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPkhUNDBNSHpJbnRvRW5hYmxlZFN0YSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFzc29jSW5kLT5IVDQwTUh6SW50b0VuYWJsZWRTdGE7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLCBGTCgiSFQ0ME1IekludG9FbmFibGVkU3RhOiAlZCBcbiIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT5IVDQwTUh6SW50b0VuYWJsZWRTdGEpOworI2VuZGlmCisgICAgICAgICAgICAgICAgICAgIGlmKENTUl9JU19XRFNfQVAoIHBSb2FtSW5mby0+dS5wQ29ubmVjdGVkUHJvZmlsZSkpCisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIHNlc3Npb25JZCwgcFJvYW1JbmZvLCAwLCBlQ1NSX1JPQU1fV0RTX0lORCwgZUNTUl9ST0FNX1JFU1VMVF9XRFNfQVNTT0NJQVRJT05fSU5EKTsvL1N0YQorICAgICAgICAgICAgICAgICAgICBpZihDU1JfSVNfSU5GUkFfQVAocFJvYW1JbmZvLT51LnBDb25uZWN0ZWRQcm9maWxlKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYoIENTUl9JU19FTkNfVFlQRV9TVEFUSUMoIHBTZXNzaW9uLT5wQ3VyUm9hbVByb2ZpbGUtPm5lZ290aWF0ZWRVQ0VuY3J5cHRpb25UeXBlICkpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyUm9hbUlzc3VlU2V0Q29udGV4dFJlcSggcE1hYywgc2Vzc2lvbklkLCBwU2Vzc2lvbi0+cEN1clJvYW1Qcm9maWxlLT5uZWdvdGlhdGVkVUNFbmNyeXB0aW9uVHlwZSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+cENvbm5lY3RCc3NEZXNjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihwUm9hbUluZm8tPnBlZXJNYWMpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkFMU0UsIFRSVUUsIGVTSVJfVFhfUlgsIDAsIDAsIE5VTEwsIDAgKTsgLy8gTk8ga2V5cy4uLiB0aGVzZSBrZXkgcGFyYW1ldGVycyBkb24ndCBtYXR0ZXIuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT5mQXV0aFJlcXVpcmVkID0gRkFMU0U7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT5mQXV0aFJlcXVpcmVkID0gVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1DYWxsQ2FsbGJhY2socE1hYywgc2Vzc2lvbklkLCBwUm9hbUluZm8sIDAsIGVDU1JfUk9BTV9JTkZSQV9JTkQsIGVDU1JfUk9BTV9SRVNVTFRfSU5GUkFfQVNTT0NJQVRJT05fSU5EKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT5zdGF0dXNDb2RlID0gZVNJUl9TTUVfQVNTT0NfUkVGVVNFRDsvLyBSZWZ1c2VkIGR1ZSB0byBNYWMgZmlsdGVyaW5nIAorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8qIFNlbmQgQXNzb2NpYXRpb24gY29tcGxldGlvbiBtZXNzYWdlIHRvIFBFICovCisgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclNlbmRBc3NvY0NuZk1zZyggcE1hYywgcEFzc29jSW5kLCBzdGF0dXMgKTsvL1N0YQorICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgLyogc2VuZCBhIG1lc3NhZ2UgdG8gQ1NSIGl0c2VsZiBqdXN0IHRvIGF2b2lkIHRoZSBFQVBPTCBmcmFtZXMgZ29pbmcKKyAgICAgICAgICAgICAgICAgICAgICogT1RBIGJlZm9yZSBhc3NvY2lhdGlvbiByZXNwb25zZSAqLworICAgICAgICAgICAgICAgICAgICBpZihDU1JfSVNfV0RTX0FQKCBwUm9hbUluZm8tPnUucENvbm5lY3RlZFByb2ZpbGUpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyU2VuZEFzc29jSW5kVG9VcHBlckxheWVyQ25mTXNnKHBNYWMsIHBBc3NvY0luZCwgc3RhdHVzLCBzZXNzaW9uSWQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmKENTUl9JU19JTkZSQV9BUChwUm9hbUluZm8tPnUucENvbm5lY3RlZFByb2ZpbGUpICYmIChwUm9hbUluZm8tPnN0YXR1c0NvZGUgIT0gZVNJUl9TTUVfQVNTT0NfUkVGVVNFRCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPmZSZWFzc29jUmVxID0gcEFzc29jSW5kLT5yZWFzc29jUmVxOworICAgICAgICAgICAgICAgICAgICAvL3N0YXR1cyA9IGNzclJvYW1DYWxsQ2FsbGJhY2socE1hYywgc2Vzc2lvbklkLCBwUm9hbUluZm8sIDAsIGVDU1JfUk9BTV9JTkZSQV9JTkQsIGVDU1JfUk9BTV9SRVNVTFRfSU5GUkFfQVNTT0NJQVRJT05fQ05GKTsKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyU2VuZEFzc29jSW5kVG9VcHBlckxheWVyQ25mTXNnKHBNYWMsIHBBc3NvY0luZCwgc3RhdHVzLCBzZXNzaW9uSWQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9ESVNBU1NPQ19JTkQ6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gQ2hlY2sgaWYgQVAgZGlzLWFzc29jaWF0ZWQgdXMgYmVjYXVzZSBvZiBNSUMgZmFpbHVyZS4gSWYgc28sCisgICAgICAgICAgICAgICAgLy8gdGhlbiB3ZSBuZWVkIHRvIHRha2UgYWN0aW9uIGltbWVkaWF0ZWx5IGFuZCBub3Qgd2FpdCB0aWxsIHRoZQorICAgICAgICAgICAgICAgIC8vIHRoZSBXbVN0YXR1c0NoYW5nZSByZXF1ZXN0cyBpcyBwdXNoZWQgYW5kIHByb2Nlc3NlZAorICAgICAgICAgICAgICAgIHRTbWVDbWQgKnBDb21tYW5kOworCisgICAgICAgICAgICAgICAgcERpc2Fzc29jSW5kID0gKHRTaXJTbWVEaXNhc3NvY0luZCAqKXBTaXJNc2c7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbUdldFNlc3Npb25JZEZyb21CU1NJRCggcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRDc3JCc3NpZCAqKXBEaXNhc3NvY0luZC0+YnNzSWQsICZzZXNzaW9uSWQgKTsKKyAgICAgICAgICAgICAgICBpZiggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCJESVNBU1NPQ0lBVElPTiBJbmRpY2F0aW9uIGZyb20gTUFDIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBmb3Igc2Vzc2lvbiAlZCAiKSwgc2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiRElTQVNTT0NJQVRJT04gZnJvbSBwZWVyID0iCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSRVNTX1NUUiAiICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiByZWFzb24gPSAlZCBzdGF0dXMgPSAlZCAiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwRGlzYXNzb2NJbmQtPnBlZXJNYWNBZGRyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRGlzYXNzb2NJbmQtPnJlYXNvbkNvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERpc2Fzc29jSW5kLT5zdGF0dXNDb2RlKTsKKyAgICAgICAgICAgICAgICAgICAgLy8gSWYgd2UgYXJlIGluIG5laWdoYm9yIHByZWF1dGggZG9uZSBzdGF0ZSB0aGVuIG9uIHJlY2VpdmluZworICAgICAgICAgICAgICAgICAgICAvLyBkaXNhc3NvYyBvciBkZWF1dGggd2UgZG9udCByb2FtIGluc3RlYWQgd2UganVzdCBkaXNhc3NvYworICAgICAgICAgICAgICAgICAgICAvLyBmcm9tIGN1cnJlbnQgYXAgYW5kIHRoZW4gZ28gdG8gZGlzY29ubmVjdGVkIHN0YXRlCisgICAgICAgICAgICAgICAgICAgIC8vIFRoaXMgaGFwcGVucyBmb3IgRVNFIGFuZCAxMXIgRlQgY29ubmVjdGlvbnMgT05MWS4KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUgorICAgICAgICAgICAgICAgICAgICBpZiAoY3NyUm9hbUlzMTFyQXNzb2MocE1hYykgJiYgKGNzck5laWdoYm9yUm9hbVN0YXRlUHJlYXV0aERvbmUocE1hYykpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBjc3JOZWlnaGJvclJvYW1UcmFuaXN0aW9uUHJlYXV0aERvbmVUb0Rpc2Nvbm5lY3RlZChwTWFjKTsKKyAgICAgICAgICAgICAgICAgICAgfQorI2VuZGlmCisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRQorICAgICAgICAgICAgICAgICAgICBpZiAoY3NyUm9hbUlzRVNFQXNzb2MocE1hYykgJiYgKGNzck5laWdoYm9yUm9hbVN0YXRlUHJlYXV0aERvbmUocE1hYykpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBjc3JOZWlnaGJvclJvYW1UcmFuaXN0aW9uUHJlYXV0aERvbmVUb0Rpc2Nvbm5lY3RlZChwTWFjKTsKKyAgICAgICAgICAgICAgICAgICAgfQorI2VuZGlmCisjaWZkZWYgRkVBVFVSRV9XTEFOX0xGUgorICAgICAgICAgICAgICAgICAgICBpZiAoY3NyUm9hbUlzRmFzdFJvYW1FbmFibGVkKHBNYWMsIHNlc3Npb25JZCkgJiYgKGNzck5laWdoYm9yUm9hbVN0YXRlUHJlYXV0aERvbmUocE1hYykpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBjc3JOZWlnaGJvclJvYW1UcmFuaXN0aW9uUHJlYXV0aERvbmVUb0Rpc2Nvbm5lY3RlZChwTWFjKTsKKyAgICAgICAgICAgICAgICAgICAgfQorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uID0gQ1NSX0dFVF9TRVNTSU9OKCBwTWFjLCBzZXNzaW9uSWQgKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoIXBTZXNzaW9uKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiAgc2Vzc2lvbiAlZCBub3QgZm91bmQgIiksIHNlc3Npb25JZCk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoIGNzcklzQ29ublN0YXRlSW5mcmEoIHBNYWMsIHNlc3Npb25JZCApICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPmNvbm5lY3RTdGF0ZSA9IGVDU1JfQVNTT0NfU1RBVEVfVFlQRV9OT1RfQ09OTkVDVEVEOworICAgICAgICAgICAgICAgICAgICB9CisjaWZuZGVmIFdMQU5fTURNX0NPREVfUkVEVUNUSU9OX09QVAorICAgICAgICAgICAgICAgICAgICBzbWVfUW9zQ3NyRXZlbnRJbmQocE1hYywgKHZfVThfdClzZXNzaW9uSWQsIFNNRV9RT1NfQ1NSX0RJU0NPTk5FQ1RfSU5ELCBOVUxMKTsKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICBjc3JSb2FtTGlua0Rvd24ocE1hYywgc2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICAgICAgY3NyUm9hbUlzc3VlV21TdGF0dXNDaGFuZ2UoIHBNYWMsIHNlc3Npb25JZCwgZUNzckRpc2Fzc29jaWF0ZWQsIHBTaXJNc2cgKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKENTUl9JU19JTkZSQV9BUCgmcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8gPSAmcm9hbUluZm87CisgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPnN0YXR1c0NvZGUgPSBwRGlzYXNzb2NJbmQtPnN0YXR1c0NvZGU7CisgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPnUucENvbm5lY3RlZFByb2ZpbGUgPSAmcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGU7CisgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPnN0YUlkID0gKHRBTklfVTgpcERpc2Fzc29jSW5kLT5zdGFJZDsKKworICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBSb2FtSW5mby0+cGVlck1hYywgcERpc2Fzc29jSW5kLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmcFJvYW1JbmZvLT5ic3NpZCwgcERpc2Fzc29jSW5kLT5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodENzckJzc2lkKSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1DYWxsQ2FsbGJhY2socE1hYywgc2Vzc2lvbklkLCBwUm9hbUluZm8sIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ST0FNX0lORlJBX0lORCwgZUNTUl9ST0FNX1JFU1VMVF9ESVNBU1NPQ19JTkQpOworCisgICAgICAgICAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAgICAgICAgICogIFNUQS9QMlAgY2xpZW50IGdvdCAgZGlzYXNzb2NpYXRlZCBzbyByZW1vdmUgYW55IHBlbmRpbmcgZGVhdXRoCisgICAgICAgICAgICAgICAgICAgICAgICAgKiAgY29tbWFuZHMgaW4gc21lIHBlbmRpbmcgbGlzdAorICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgICAgICBwQ29tbWFuZCA9IGNzckdldENvbW1hbmRCdWZmZXIocE1hYyk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoTlVMTCA9PSBwQ29tbWFuZCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCIgZmFpbCB0byBnZXQgY29tbWFuZCBidWZmZXIiKSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1JFU09VUkNFUzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBwQ29tbWFuZC0+Y29tbWFuZCA9IGVTbWVDb21tYW5kUm9hbTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBDb21tYW5kLT5zZXNzaW9uSWQgPSAodEFOSV9VOClzZXNzaW9uSWQ7CisgICAgICAgICAgICAgICAgICAgICAgICBwQ29tbWFuZC0+dS5yb2FtQ21kLnJvYW1SZWFzb24gPSBlQ3NyRm9yY2VkRGVhdXRoU3RhOworICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBDb21tYW5kLT51LnJvYW1DbWQucGVlck1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRGlzYXNzb2NJbmQtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICAgICAgICAgICAgICAgICAgY3NyUm9hbVJlbW92ZUR1cGxpY2F0ZUNvbW1hbmQocE1hYywgc2Vzc2lvbklkLCBwQ29tbWFuZCwgZUNzckZvcmNlZERlYXV0aFN0YSk7CisgICAgICAgICAgICAgICAgICAgICAgICBjc3JSZWxlYXNlQ29tbWFuZCggcE1hYywgcENvbW1hbmQgKTsKKworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiIFNlc3Npb24gSWQgbm90IGZvdW5kIGZvciBCU1NJRCAiIE1BQ19BRERSRVNTX1NUUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBEaXNhc3NvY0luZC0+YnNzSWQpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9ERUFVVEhfSU5EOgorICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0cxLCBGTCgiREVBVVRIRU5USUNBVElPTiBJbmRpY2F0aW9uIGZyb20gTUFDIikpOworICAgICAgICAgICAgcERlYXV0aEluZCA9ICh0cFNpclNtZURlYXV0aEluZClwU2lyTXNnOworICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbUdldFNlc3Npb25JZEZyb21CU1NJRCggcE1hYywgKHRDc3JC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bm5lY3RlZChwTWFjKTsKKyAgICAgICAgICAgICAgICB9CisjZW5kaWYKKyNpZmRlZiBGRUFUVVJFX1dMQU5fTEZSCisgICAgICAgICAgICAgICAgaWYgKGNzclJvYW1Jc0Zhc3RSb2FtRW5hYmxlZChwTWFjLCBzZXNzaW9uSWQpICYmIChjc3JOZWlnaGJvclJvYW1TdGF0ZVByZWF1dGhEb25lKHBNYWMpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGNzck5laWdoYm9yUm9hbVRyYW5pc3Rpb25QcmVhdXRoRG9uZVRvRGlzY29ubmVjdGVkKHBNYWMpOworICAgICAgICAgICAgICAgIH0KKyNlbmRpZgorICAgICAgICAgICAgICAgIHBTZXNzaW9uID0gQ1NSX0dFVF9TRVNTSU9OKCBwTWFjLCBzZXNzaW9uSWQgKTsKKworICAgICAgICAgICAgICAgIGlmKCFwU2Vzc2lvbikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiICBzZXNzaW9uICVkIG5vdCBmb3VuZCAiKSwgc2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmICggY3NySXNDb25uU3RhdGVJbmZyYSggcE1hYywgc2Vzc2lvbklkICkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPmNvbm5lY3RTdGF0ZSA9IGVDU1JfQVNTT0NfU1RBVEVfVFlQRV9OT1RfQ09OTkVDVEVEOworICAgICAgICAgICAgICAgIH0KKyNpZm5kZWYgV0xBTl9NRE1fQ09ERV9SRURVQ1RJT05fT1BUCisgICAgICAgICAgICAgICAgc21lX1Fvc0NzckV2ZW50SW5kKHBNYWMsICh2X1U4X3Qpc2Vzc2lvbklkLCBTTUVfUU9TX0NTUl9ESVNDT05ORUNUX0lORCwgTlVMTCk7CisjZW5kaWYKKyAgICAgICAgICAgICAgICBjc3JSb2FtTGlua0Rvd24ocE1hYywgc2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICBjc3JSb2FtSXNzdWVXbVN0YXR1c0NoYW5nZSggcE1hYywgc2Vzc2lvbklkLCBlQ3NyRGVhdXRoZW50aWNhdGVkLCBwU2lyTXNnICk7CisgICAgICAgICAgICAgICAgaWYoQ1NSX0lTX0lORlJBX0FQKCZwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZSkpCisgICAgICAgICAgICAgICAgeworCisgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mbyA9ICZyb2FtSW5mbzsKKworICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPnN0YXR1c0NvZGUgPSBwRGVhdXRoSW5kLT5zdGF0dXNDb2RlOworICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPnUucENvbm5lY3RlZFByb2ZpbGUgPSAmcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGU7CisKKyAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT5zdGFJZCA9ICh0QU5JX1U4KXBEZWF1dGhJbmQtPnN0YUlkOworCisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwUm9hbUluZm8tPnBlZXJNYWMsIHBEZWF1dGhJbmQtPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmcFJvYW1JbmZvLT5ic3NpZCwgcERlYXV0aEluZC0+YnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodENzckJzc2lkKSk7CisKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbUNhbGxDYWxsYmFjayhwTWFjLCBzZXNzaW9uSWQsIHBSb2FtSW5mbywgMCwgZUNTUl9ST0FNX0lORlJBX0lORCwgZUNTUl9ST0FNX1JFU1VMVF9ERUFVVEhfSU5EKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgCisgICAgICAgIGNhc2UgZVdOSV9TTUVfU1dJVENIX0NITF9SRVE6ICAgICAgICAvLyBpbiBjYXNlIG9mIFNUQSwgdGhlIFNXSVRDSF9DSEFOTkVMIG9yaWdpbmF0ZXMgZnJvbSBpdHMgQVAKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HVywgRkwoImVXTklfU01FX1NXSVRDSF9DSExfUkVRIGZyb20gU01FIikpOworICAgICAgICAgICAgcFN3aXRjaENobkluZCA9ICh0cFNpclNtZVN3aXRjaENoYW5uZWxJbmQpcFNpck1zZzsKKyAgICAgICAgICAgIC8vVXBkYXRlIHdpdGggdGhlIG5ldyBjaGFubmVsIGlkLgorICAgICAgICAgICAgLy9UaGUgY2hhbm5lbCBpZCBpcyBoaWRkZW4gaW4gdGhlIHN0YXR1c0NvZGUuCisgICAgICAgICAgICBzdGF0dXMgPSBjc3JSb2FtR2V0U2Vzc2lvbklkRnJvbUJTU0lEKCBwTWFjLCAodENzckJzc2lkICopcFN3aXRjaENobkluZC0+YnNzSWQsICZzZXNzaW9uSWQgKTsKKyAgICAgICAgICAgIGlmKCBIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTiggcE1hYywgc2Vzc2lvbklkICk7CisgICAgICAgICAgICAgICAgaWYoIXBTZXNzaW9uKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgIHNlc3Npb24gJWQgbm90IGZvdW5kICIpLCBzZXNzaW9uSWQpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlLm9wZXJhdGlvbkNoYW5uZWwgPSAodEFOSV9VOClwU3dpdGNoQ2huSW5kLT5uZXdDaGFubmVsSWQ7CisgICAgICAgICAgICAgICAgaWYocFNlc3Npb24tPnBDb25uZWN0QnNzRGVzYykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5wQ29ubmVjdEJzc0Rlc2MtPmNoYW5uZWxJZCA9ICh0QU5JX1U4KXBTd2l0Y2hDaG5JbmQtPm5ld0NoYW5uZWxJZDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgY2FzZSBlV05JX1NNRV9ERUFVVEhfUlNQOgorICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dXLCBGTCgiZVdOSV9TTUVfREVBVVRIX1JTUCBmcm9tIFNNRSIpKTsKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB0U2lyU21lRGVhdXRoUnNwKiBwRGVhdXRoUnNwID0gKHRTaXJTbWVEZWF1dGhSc3AgKilwU2lyTXNnOworICAgICAgICAgICAgICAgIHNlc3Npb25JZCA9IHBEZWF1dGhSc3AtPnNlc3Npb25JZDsKKyAgICAgICAgICAgICAgICBpZiggQ1NSX0lTX1NFU1NJT05fVkFMSUQocE1hYywgc2Vzc2lvbklkKSApCisgICAgICAgICAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uID0gQ1NSX0dFVF9TRVNTSU9OKHBNYWMsIHNlc3Npb25JZCk7CisgICAgICAgICAgICAgICAgICAgIGlmICggQ1NSX0lTX0lORlJBX0FQKCZwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZSkgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8gPSAmcm9hbUluZm87CisgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8tPnUucENvbm5lY3RlZFByb2ZpbGUgPSAmcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGU7CisgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocFJvYW1JbmZvLT5wZWVyTWFjLCBwRGVhdXRoUnNwLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+cmVhc29uQ29kZSA9IGVDU1JfUk9BTV9SRVNVTFRfRk9SQ0VEOworICAgICAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT5zdGF0dXNDb2RlID0gcERlYXV0aFJzcC0+c3RhdHVzQ29kZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1DYWxsQ2FsbGJhY2socE1hYywgc2Vzc2lvbklkLCBwUm9hbUluZm8sIDAsIGVDU1JfUk9BTV9MT1NUTElOSywgZUNTUl9ST0FNX1JFU1VMVF9GT1JDRUQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAKKyAgICAgICAgY2FzZSBlV05JX1NNRV9ESVNBU1NPQ19SU1A6CisgICAgICAgICAgICAvKiBzZXNzaW9uIGlkIGlzIGludmFsaWQgaGVyZSBzbyBjYW50IHVzZSBpdCB0byBhY2Nlc3MgdGhlIGFycmF5IGN1clN1YnN0YXRlIGFzIGluZGV4ICovCisgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR1csIEZMKCJlV05JX1NNRV9ESVNBU1NPQ19SU1AgZnJvbSBTTUUgIikpOworICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHRTaXJTbWVEaXNhc3NvY1JzcCAqcERpc2Fzc29jUnNwID0gKHRTaXJTbWVEaXNhc3NvY1JzcCAqKXBTaXJNc2c7CisgICAgICAgICAgICAgICAgc2Vzc2lvbklkID0gcERpc2Fzc29jUnNwLT5zZXNzaW9uSWQ7CisgICAgICAgICAgICAgICAgaWYoIENTUl9JU19TRVNTSU9OX1ZBTElEKHBNYWMsIHNlc3Npb25JZCkgKQorICAgICAgICAgICAgICAgIHsgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTihwTWFjLCBzZXNzaW9uSWQpOworICAgICAgICAgICAgICAgICAgICBpZiAoIENTUl9JU19JTkZSQV9BUCgmcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUpICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvID0gJnJvYW1JbmZvOworICAgICAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT51LnBDb25uZWN0ZWRQcm9maWxlID0gJnBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlOworICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBSb2FtSW5mby0+cGVlck1hYywgcERpc2Fzc29jUnNwLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+cmVhc29uQ29kZSA9IGVDU1JfUk9BTV9SRVNVTFRfRk9SQ0VEOworICAgICAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvLT5zdGF0dXNDb2RlID0gcERpc2Fzc29jUnNwLT5zdGF0dXNDb2RlOworICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbUNhbGxDYWxsYmFjayhwTWFjLCBzZXNzaW9uSWQsIHBSb2FtSW5mbywgMCwgZUNTUl9ST0FNX0xPU1RMSU5LLCBlQ1NSX1JPQU1fUkVTVUxUX0ZPUkNFRCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9MT1NUX0xJTktfUEFSQU1TX0lORDoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB0cFNpclNtZUxvc3RMaW5rUGFyYW1zSW5kIHBMb3N0TGlua1BhcmFtc0luZCA9ICh0cFNpclNtZUxvc3RMaW5rUGFyYW1zSW5kKXBTaXJNc2c7CisgICAgICAgICAgICAgICAgdENzclJvYW1JbmZvIHJvYW1JbmZvLCAqcFJvYW1JbmZvID0gTlVMTDsKKyAgICAgICAgICAgICAgICBlQ3NyUm9hbVJlc3VsdCByZXN1bHQgPSBlQ1NSX1JPQU1fUkVTVUxUX05PTkU7CisgICAgICAgICAgICAgICAgdm9zX21lbV9zZXQoJnJvYW1JbmZvLCBzaXplb2YodENzclJvYW1JbmZvKSwgMCk7CisgICAgICAgICAgICAgICAgcm9hbUluZm8udS5wTG9zdExpbmtQYXJhbXMgPSAmcExvc3RMaW5rUGFyYW1zSW5kLT5pbmZvOworICAgICAgICAgICAgICAgIHBSb2FtSW5mbyA9ICZyb2FtSW5mbzsKKyAgICAgICAgICAgICAgICBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIHBMb3N0TGlua1BhcmFtc0luZC0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8sIDAsIGVDU1JfUk9BTV9MT1NUX0xJTktfUEFSQU1TX0lORCwgcmVzdWx0KTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgY2FzZSBlV05JX1NNRV9NSUNfRkFJTFVSRV9JTkQ6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdHBTaXJTbWVNaWNGYWlsdXJlSW5kIHBNaWNJbmQgPSAodHBTaXJTbWVNaWNGYWlsdXJlSW5kKXBTaXJNc2c7CisgICAgICAgICAgICAgICAgdENzclJvYW1JbmZvIHJvYW1JbmZvLCAqcFJvYW1JbmZvID0gTlVMTDsKKyAgICAgICAgICAgICAgICBlQ3NyUm9hbVJlc3VsdCByZXN1bHQgPSBlQ1NSX1JPQU1fUkVTVUxUX01JQ19FUlJPUl9VTklDQVNUOworCisgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbUdldFNlc3Npb25JZEZyb21CU1NJRCggcE1hYywgKHRDc3JCc3NpZCAqKXBNaWNJbmQtPmJzc0lkLCAmc2Vzc2lvbklkICk7CisgICAgICAgICAgICAgICAgaWYoIEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9zZXQoJnJvYW1JbmZvLCBzaXplb2YodENzclJvYW1JbmZvKSwgMCk7CisgICAgICAgICAgICAgICAgICAgIHJvYW1JbmZvLnUucE1JQ0ZhaWx1cmVJbmZvID0gJnBNaWNJbmQtPmluZm87CisgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mbyA9ICZyb2FtSW5mbzsKKyAgICAgICAgICAgICAgICAgICAgaWYocE1pY0luZC0+aW5mby5tdWx0aWNhc3QpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IGVDU1JfUk9BTV9SRVNVTFRfTUlDX0VSUk9SX0dST1VQOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gZUNTUl9ST0FNX1JFU1VMVF9NSUNfRVJST1JfVU5JQ0FTVDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIHNlc3Npb25JZCwgcFJvYW1JbmZvLCAwLCBlQ1NSX1JPQU1fTUlDX0VSUk9SX0lORCwgcmVzdWx0KTsKKyAgICAgICAgICAgICAgICB9CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRElBR19TVVBQT1JUX0NTUgorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgV0xBTl9WT1NfRElBR19FVkVOVF9ERUYoc2VjRXZlbnQsIHZvc19ldmVudF93bGFuX3NlY3VyaXR5X3BheWxvYWRfdHlwZSk7CisgICAgICAgICAgICAgICAgICAgIHRDc3JSb2FtU2Vzc2lvbiAqcFNlc3Npb24gPSBDU1JfR0VUX1NFU1NJT04oIHBNYWMsIHNlc3Npb25JZCApOworICAgICAgICAgICAgICAgICAgICBpZighcFNlc3Npb24pCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiICBzZXNzaW9uICVkIG5vdCBmb3VuZCAiKSwgc2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fc2V0KCZzZWNFdmVudCwgc2l6ZW9mKHZvc19ldmVudF93bGFuX3NlY3VyaXR5X3BheWxvYWRfdHlwZSksIDApOworICAgICAgICAgICAgICAgICAgICBzZWNFdmVudC5ldmVudElkID0gV0xBTl9TRUNVUklUWV9FVkVOVF9NSUNfRVJST1I7CisgICAgICAgICAgICAgICAgICAgIHNlY0V2ZW50LmVuY3J5cHRpb25Nb2RlTXVsdGljYXN0ID0gCisgICAgICAgICAgICAgICAgICAgICAgICAodl9VOF90KWRpYWdFbmNUeXBlRnJvbUNTUlR5cGUocFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUubWNFbmNyeXB0aW9uVHlwZSk7CisgICAgICAgICAgICAgICAgICAgIHNlY0V2ZW50LmVuY3J5cHRpb25Nb2RlVW5pY2FzdCA9IAorICAgICAgICAgICAgICAgICAgICAgICAgKHZfVThfdClkaWFnRW5jVHlwZUZyb21DU1JUeXBlKHBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlLkVuY3J5cHRpb25UeXBlKTsKKyAgICAgICAgICAgICAgICAgICAgc2VjRXZlbnQuYXV0aE1vZGUgPSAKKyAgICAgICAgICAgICAgICAgICAgICAgICh2X1U4X3QpZGlhZ0F1dGhUeXBlRnJvbUNTUlR5cGUocFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUuQXV0aFR5cGUpOworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoc2VjRXZlbnQuYnNzaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS5ic3NpZCwgNik7CisgICAgICAgICAgICAgICAgICAgIFdMQU5fVk9TX0RJQUdfRVZFTlRfUkVQT1JUKCZzZWNFdmVudCwgRVZFTlRfV0xBTl9TRUNVUklUWSk7CisgICAgICAgICAgICAgICAgfQorI2VuZGlmLy9GRUFUVVJFX1dMQU5fRElBR19TVVBQT1JUX0NTUgorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfV1BTX1BCQ19QUk9CRV9SRVFfSU5EOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHRwU2lyU21lUHJvYmVSZXFJbmQgcFByb2JlUmVxSW5kID0gKHRwU2lyU21lUHJvYmVSZXFJbmQpcFNpck1zZzsKKyAgICAgICAgICAgICAgICB0Q3NyUm9hbUluZm8gcm9hbUluZm87CisgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0cxLCBGTCgiV1BTIFBCQyBQcm9iZSByZXF1ZXN0IEluZGljYXRpb24gZnJvbSBTTUUiKSk7CisgICAgICAgICAgIAorICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1HZXRTZXNzaW9uSWRGcm9tQlNTSUQoIHBNYWMsICh0Q3NyQnNzaWQgKilwUHJvYmVSZXFJbmQtPmJzc0lkLCAmc2Vzc2lvbklkICk7CisgICAgICAgICAgICAgICAgaWYoIEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9zZXQoJnJvYW1JbmZvLCBzaXplb2YodENzclJvYW1JbmZvKSwgMCk7CisgICAgICAgICAgICAgICAgICAgIHJvYW1JbmZvLnUucFdQU1BCQ1Byb2JlUmVxID0gJnBQcm9iZVJlcUluZC0+V1BTUEJDUHJvYmVSZXE7CisgICAgICAgICAgICAgICAgICAgIGNzclJvYW1DYWxsQ2FsbGJhY2socE1hYywgc2Vzc2lvbklkLCAmcm9hbUluZm8sIDAsIGVDU1JfUk9BTV9XUFNfUEJDX1BST0JFX1JFUV9JTkQsIAorICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ST0FNX1JFU1VMVF9XUFNfUEJDX1BST0JFX1JFUV9JTkQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOyAgICAgICAgCisgICAgICAgICAgICAKKyAgICAgICAgY2FzZSBlV05JX1NNRV9XTV9TVEFUVVNfQ0hBTkdFX05URjoKKyAgICAgICAgICAgIHBTdGF0dXNDaGFuZ2VNc2cgPSAodFNpclNtZVdtU3RhdHVzQ2hhbmdlTnRmICopcFNpck1zZzsKKyAgICAgICAgICAgIHN3aXRjaCggcFN0YXR1c0NoYW5nZU1zZy0+c3RhdHVzQ2hhbmdlQ29kZSApIAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNhc2UgZVNJUl9TTUVfSUJTU19BQ1RJVkU6CisgICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCA9IGNzckZpbmRJYnNzU2Vzc2lvbiggcE1hYyApOworICAgICAgICAgICAgICAgICAgICBpZiggQ1NSX1NFU1NJT05fSURfSU5WQUxJRCAhPSBzZXNzaW9uSWQgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTiggcE1hYywgc2Vzc2lvbklkICk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZighcFNlc3Npb24pCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgIHNlc3Npb24gJWQgbm90IGZvdW5kICIpLCBzZXNzaW9uSWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5jb25uZWN0U3RhdGUgPSBlQ1NSX0FTU09DX1NUQVRFX1RZUEVfSUJTU19DT05ORUNURUQ7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihwU2Vzc2lvbi0+cENvbm5lY3RCc3NEZXNjKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmcm9hbUluZm8uYnNzaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5wQ29ubmVjdEJzc0Rlc2MtPmJzc0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodENzckJzc2lkKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm9hbUluZm8udS5wQ29ubmVjdGVkUHJvZmlsZSA9ICZwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8gPSAmcm9hbUluZm87CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsICIgIENTUiBlU0lSX1NNRV9JQlNTX05FV19QRUVSIGNvbm5lY3RlZCBCU1MgaXMgZW1wdHkiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IGVDU1JfUk9BTV9SRVNVTFRfSUJTU19DT05ORUNUOworICAgICAgICAgICAgICAgICAgICAgICAgcm9hbVN0YXR1cyA9IGVDU1JfUk9BTV9DT05ORUNUX1NUQVRVU19VUERBVEU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBlU0lSX1NNRV9JQlNTX0lOQUNUSVZFOgorICAgICAgICAgICAgICAgICAgICBzZXNzaW9uSWQgPSBjc3JGaW5kSWJzc1Nlc3Npb24oIHBNYWMgKTsKKyAgICAgICAgICAgICAgICAgICAgaWYoIENTUl9TRVNTSU9OX0lEX0lOVkFMSUQgIT0gc2Vzc2lvbklkICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24gPSBDU1JfR0VUX1NFU1NJT04oIHBNYWMsIHNlc3Npb25JZCApOworICAgICAgICAgICAgICAgICAgICAgICAgaWYoIXBTZXNzaW9uKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiICBzZXNzaW9uICVkIG5vdCBmb3VuZCAiKSwgc2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+Y29ubmVjdFN0YXRlID0gZUNTUl9BU1NPQ19TVEFURV9UWVBFX0lCU1NfRElTQ09OTkVDVEVEOworICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gZUNTUl9ST0FNX1JFU1VMVF9JQlNTX0lOQUNUSVZFOworICAgICAgICAgICAgICAgICAgICAgICAgcm9hbVN0YXR1cyA9IGVDU1JfUk9BTV9DT05ORUNUX1NUQVRVU19VUERBVEU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBlU0lSX1NNRV9KT0lORURfTkVXX0JTUzogICAgLy8gSUJTUyBjb2FsZXNjaW5nLgorICAgICAgICAgICAgICAgICAgICBzZXNzaW9uSWQgPSBjc3JGaW5kSWJzc1Nlc3Npb24oIHBNYWMgKTsKKyAgICAgICAgICAgICAgICAgICAgaWYoIENTUl9TRVNTSU9OX0lEX0lOVkFMSUQgIT0gc2Vzc2lvbklkICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24gPSBDU1JfR0VUX1NFU1NJT04oIHBNYWMsIHNlc3Npb25JZCApOworICAgICAgICAgICAgICAgICAgICAgICAgaWYoIXBTZXNzaW9uKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiICBzZXNzaW9uICVkIG5vdCBmb3VuZCAiKSwgc2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAvLyB1cGRhdGUgdGhlIGNvbm5lY3Rpb24gc3RhdGUgaW5mb3JtYXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgIHBOZXdCc3MgPSAmcFN0YXR1c0NoYW5nZU1zZy0+c3RhdHVzQ2hhbmdlSW5mby5uZXdCc3NJbmZvOworI2lmZGVmIEZFQVRVUkVfV0xBTl9ESUFHX1NVUFBPUlRfQ1NSCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX2xvZ19pYnNzX3BrdF90eXBlICpwSWJzc0xvZzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBiaTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOX1ZPU19ESUFHX0xPR19BTExPQyhwSWJzc0xvZywgdm9zX2xvZ19pYnNzX3BrdF90eXBlLCBMT0dfV0xBTl9JQlNTX0MpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBJYnNzTG9nKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcElic3NMb2ctPmV2ZW50SWQgPSBXTEFOX0lCU1NfRVZFTlRfQ09BTEVTQ0lORzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocE5ld0JzcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBJYnNzTG9nLT5ic3NpZCwgcE5ld0Jzcy0+YnNzSWQsIDYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocE5ld0Jzcy0+c3NJZC5sZW5ndGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBJYnNzTG9nLT5zc2lkLCBwTmV3QnNzLT5zc0lkLnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBOZXdCc3MtPnNzSWQubGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJYnNzTG9nLT5vcGVyYXRpbmdDaGFubmVsID0gcE5ld0Jzcy0+Y2hhbm5lbE51bWJlcjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1MoY2NtQ2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfQkVBQ09OX0lOVEVSVkFMLCAmYmkpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8qKipVOCBpcyBub3QgZW5vdWdoIGZvciBiZWFjb24gaW50ZXJ2YWwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJYnNzTG9nLT5iZWFjb25JbnRlcnZhbCA9ICh2X1U4X3QpYmk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9WT1NfRElBR19MT0dfUkVQT1JUKHBJYnNzTG9nKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisjZW5kaWYgLy9GRUFUVVJFX1dMQU5fRElBR19TVVBQT1JUX0NTUgorICAgICAgICAgICAgICAgICAgICAgICAgY3NyUm9hbVVwZGF0ZUNvbm5lY3RlZFByb2ZpbGVGcm9tTmV3QnNzKCBwTWFjLCBzZXNzaW9uSWQsIHBOZXdCc3MgKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChlQ1NSX0VOQ1JZUFRfVFlQRV9OT05FID09CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS5FbmNyeXB0aW9uVHlwZSApKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNzclJvYW1Jc3N1ZVNldENvbnRleHRSZXEoIHBNYWMsIHNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS5FbmNyeXB0aW9uVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+cENvbm5lY3RCc3NEZXNjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZCcm9hZGNhc3RhZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZBTFNFLCBGQUxTRSwgZVNJUl9UWF9SWCwgMCwgMCwgTlVMTCwgMCApOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gZUNTUl9ST0FNX1JFU1VMVF9JQlNTX0NPQUxFU0NFRDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJvYW1TdGF0dXMgPSBlQ1NSX1JPQU1fSUJTU19JTkQ7CisgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnJvYW1JbmZvLmJzc2lkLCAmcE5ld0Jzcy0+YnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRDc3JCc3NpZCkpOworICAgICAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvID0gJnJvYW1JbmZvOworICAgICAgICAgICAgICAgICAgICAgICAgLy9UaGlzIEJTU0lEIGlzIHRoIGVyZWFsIEJTU0lELCBsZXQncyBzYXZlIGl0CisgICAgICAgICAgICAgICAgICAgICAgICBpZihwU2Vzc2lvbi0+cENvbm5lY3RCc3NEZXNjKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwU2Vzc2lvbi0+cENvbm5lY3RCc3NEZXNjLT5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBOZXdCc3MtPmJzc0lkLCBzaXplb2YodENzckJzc2lkKSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csICJDU1I6ICBlU0lSX1NNRV9KT0lORURfTkVXX0JTUyByZWNlaXZlZCBmcm9tIFBFIik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIC8vIGRldGVjdGlvbiBieSBMSU0gdGhhdCB0aGUgY2FwYWJpbGl0aWVzIG9mIHRoZSBhc3NvY2lhdGVkIEFQIGhhdmUgY2hhbmdlZC4KKyAgICAgICAgICAgICAgICBjYXNlIGVTSVJfU01FX0FQX0NBUFNfQ0hBTkdFRDoKKyAgICAgICAgICAgICAgICAgICAgcEFwTmV3Q2FwcyA9ICZwU3RhdHVzQ2hhbmdlTXNnLT5zdGF0dXNDaGFuZ2VJbmZvLmFwTmV3Q2FwczsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csICJDU1IgaGFuZGxpbmcgZVNJUl9TTUVfQVBfQ0FQU19DSEFOR0VEIik7CisgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1HZXRTZXNzaW9uSWRGcm9tQlNTSUQoIHBNYWMsICh0Q3NyQnNzaWQgKilwQXBOZXdDYXBzLT5ic3NJZCwgJnNlc3Npb25JZCApOworICAgICAgICAgICAgICAgICAgICBpZiggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZUNTUl9ST0FNSU5HX1NUQVRFX0pPSU5FRCA9PSBwTWFjLT5yb2FtLmN1clN0YXRlW3Nlc3Npb25JZF0pICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZUNTUl9ST0FNX1NVQlNUQVRFX0pPSU5FRF9SRUFMVElNRV9UUkFGRklDID09IHBNYWMtPnJvYW0uY3VyU3ViU3RhdGVbc2Vzc2lvbklkXSkgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlQ1NSX1JPQU1fU1VCU1RBVEVfTk9ORSA9PSBwTWFjLT5yb2FtLmN1clN1YlN0YXRlW3Nlc3Npb25JZF0pIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZUNTUl9ST0FNX1NVQlNUQVRFX0pPSU5FRF9OT05fUkVBTFRJTUVfVFJBRkZJQyA9PSBwTWFjLT5yb2FtLmN1clN1YlN0YXRlW3Nlc3Npb25JZF0pIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZUNTUl9ST0FNX1NVQlNUQVRFX0pPSU5FRF9OT19UUkFGRklDID09IHBNYWMtPnJvYW0uY3VyU3ViU3RhdGVbc2Vzc2lvbklkXSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csICJDYWxsaW5nIGNzclJvYW1EaXNjb25uZWN0SW50ZXJuYWwiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JSb2FtRGlzY29ubmVjdEludGVybmFsKHBNYWMsIHNlc3Npb25JZCwgZUNTUl9ESVNDT05ORUNUX1JFQVNPTl9VTlNQRUNJRklFRCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJTa2lwcGluZyBjc3JTY2FuRm9yQ2FwYWJpbGl0eUNoYW5nZSBhcyAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJDU1IgaXMgaW4gc3RhdGUgJXMgYW5kIHN1Yi1zdGF0ZSAlcyIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWNUcmFjZUdldGNzclJvYW1TdGF0ZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+cm9hbS5jdXJTdGF0ZVtzZXNzaW9uSWRdKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFjVHJhY2VHZXRjc3JSb2FtU3ViU3RhdGUoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0uY3VyU3ViU3RhdGVbc2Vzc2lvbklkXSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFdlIGlnbm9yZSB0aGUgY2FwcyBjaGFuZ2UgZXZlbnQgaWYgQ1NSIGlzIG5vdCBpbiBmdWxsIGNvbm5lY3RlZCBzdGF0ZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBTZW5kIG9uZSBldmVudCB0byBQRSB0byByZXNldCBsaW1TZW50Q2Fwc0NoYW5nZU50ZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIE9uY2UgbGltU2VudENhcHNDaGFuZ2VOdGYgc2V0IDAsIGxpbSBjYW4gc2VuZCBzdWIgc2VxdWVudCBDQVBTIGNoYW5nZSBldmVudAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIG90aGVyd2lzZSBsaW0gY2Fubm90IHNlbmQgYW55IENBUFMgY2hhbmdlIGV2ZW50cyB0byBTTUUgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JTZW5kUmVzZXRBcENhcHNDaGFuZ2VkKHBNYWMsICZwQXBOZXdDYXBzLT5ic3NJZCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICByb2FtU3RhdHVzID0gZUNTUl9ST0FNX0ZBSUxFRDsKKyAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gZUNTUl9ST0FNX1JFU1VMVF9OT05FOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0gIC8vIGVuZCBzd2l0Y2ggb24gc3RhdHVzQ2hhbmdlQ29kZQorICAgICAgICAgICAgaWYoZUNTUl9ST0FNX1JFU1VMVF9OT05FICE9IHJlc3VsdCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIHNlc3Npb25JZCwgcFJvYW1JbmZvLCAwLCByb2FtU3RhdHVzLCByZXN1bHQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfSUJTU19ORVdfUEVFUl9JTkQ6CisgICAgICAgICAgICBwSWJzc1BlZXJJbmQgPSAodFNtZUlic3NQZWVySW5kICopcFNpck1zZzsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRElBR19TVVBQT1JUX0NTUgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19sb2dfaWJzc19wa3RfdHlwZSAqcElic3NMb2c7CisgICAgICAgICAgICAgICAgV0xBTl9WT1NfRElBR19MT0dfQUxMT0MocElic3NMb2csIHZvc19sb2dfaWJzc19wa3RfdHlwZSwgTE9HX1dMQU5fSUJTU19DKTsKKyAgICAgICAgICAgICAgICBpZihwSWJzc0xvZykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBJYnNzTG9nLT5ldmVudElkID0gV0xBTl9JQlNTX0VWRU5UX1BFRVJfSk9JTjsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBJYnNzTG9nLT5wZWVyTWFjQWRkciwgJnBJYnNzUGVlckluZC0+cGVlckFkZHIsIDYpOworICAgICAgICAgICAgICAgICAgICBXTEFOX1ZPU19ESUFHX0xPR19SRVBPUlQocElic3NMb2cpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyNlbmRpZiAvL0ZFQVRVUkVfV0xBTl9ESUFHX1NVUFBPUlRfQ1NSCisgICAgICAgICAgICBzZXNzaW9uSWQgPSBjc3JGaW5kSWJzc1Nlc3Npb24oIHBNYWMgKTsKKyAgICAgICAgICAgIGlmKCBDU1JfU0VTU0lPTl9JRF9JTlZBTElEICE9IHNlc3Npb25JZCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFNlc3Npb24gPSBDU1JfR0VUX1NFU1NJT04oIHBNYWMsIHNlc3Npb25JZCApOworCisgICAgICAgICAgICAgICAgaWYoIXBTZXNzaW9uKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgIHNlc3Npb24gJWQgbm90IGZvdW5kICIpLCBzZXNzaW9uSWQpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gSXNzdWUgdGhlIHNldCBDb250ZXh0IHJlcXVlc3QgdG8gTElNIHRvIGVzdGFibGlzaCB0aGUgVW5pY2FzdCBTVEEgY29udGV4dCBmb3IgdGhlIG5ldyBwZWVyLi4uCisgICAgICAgICAgICAgICAgaWYocFNlc3Npb24tPnBDb25uZWN0QnNzRGVzYykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmcm9hbUluZm8ucGVlck1hYywgcElic3NQZWVySW5kLT5wZWVyQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0Q3NyQnNzaWQpKTsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZyb2FtSW5mby5ic3NpZCwgcFNlc3Npb24tPnBDb25uZWN0QnNzRGVzYy0+YnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodENzckJzc2lkKSk7CisgICAgICAgICAgICAgICAgICAgIGlmKHBJYnNzUGVlckluZC0+bWVzZ0xlbiA+IHNpemVvZih0U21lSWJzc1BlZXJJbmQpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICByb2FtSW5mby5wYkZyYW1lcyA9IHZvc19tZW1fbWFsbG9jKChwSWJzc1BlZXJJbmQtPm1lc2dMZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHNpemVvZih0U21lSWJzc1BlZXJJbmQpKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIE5VTEwgPT0gcm9hbUluZm8ucGJGcmFtZXMgKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByb2FtSW5mby5uQmVhY29uTGVuZ3RoID0gKHBJYnNzUGVlckluZC0+bWVzZ0xlbiAtIHNpemVvZih0U21lSWJzc1BlZXJJbmQpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocm9hbUluZm8ucGJGcmFtZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh0QU5JX1U4ICopcElic3NQZWVySW5kKSArIHNpemVvZih0U21lSWJzc1BlZXJJbmQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb2FtSW5mby5uQmVhY29uTGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHJvYW1JbmZvLnN0YUlkID0gKHRBTklfVTgpcElic3NQZWVySW5kLT5zdGFJZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJvYW1JbmZvLnVjYXN0U2lnID0gKHRBTklfVTgpcElic3NQZWVySW5kLT51Y2FzdFNpZzsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJvYW1JbmZvLmJjYXN0U2lnID0gKHRBTklfVTgpcElic3NQZWVySW5kLT5iY2FzdFNpZzsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJvYW1JbmZvLnBCc3NEZXNjID0gdm9zX21lbV9tYWxsb2MocFNlc3Npb24tPnBDb25uZWN0QnNzRGVzYy0+bGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICggTlVMTCA9PSByb2FtSW5mby5wQnNzRGVzYyApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShyb2FtSW5mby5wQnNzRGVzYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPnBDb25uZWN0QnNzRGVzYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPnBDb25uZWN0QnNzRGVzYy0+bGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKEhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mbyA9ICZyb2FtSW5mbzsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihyb2FtSW5mby5wYkZyYW1lcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShyb2FtSW5mby5wYkZyYW1lcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHJvYW1JbmZvLnBCc3NEZXNjKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHJvYW1JbmZvLnBCc3NEZXNjKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8gPSAmcm9hbUluZm87CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKChlQ1NSX0VOQ1JZUFRfVFlQRV9OT05FID09CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS5FbmNyeXB0aW9uVHlwZSApKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgIGNzclJvYW1Jc3N1ZVNldENvbnRleHRSZXEoIHBNYWMsIHNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS5FbmNyeXB0aW9uVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+cENvbm5lY3RCc3NEZXNjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYocElic3NQZWVySW5kLT5wZWVyQWRkciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkFMU0UsIFRSVUUsIGVTSVJfVFhfUlgsIDAsIDAsIE5VTEwsIDAgKTsgLy8gTk8ga2V5cy4uLiB0aGVzZSBrZXkgcGFyYW1ldGVycyBkb24ndCBtYXR0ZXIuCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csICIgIENTUiBlU0lSX1NNRV9JQlNTX05FV19QRUVSIGNvbm5lY3RlZCBCU1MgaXMgZW1wdHkiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLy9zZW5kIHVwIHRoZSBzZWMgdHlwZSBmb3IgdGhlIG5ldyBwZWVyCisgICAgICAgICAgICAgICAgaWYgKHBSb2FtSW5mbykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBSb2FtSW5mby0+dS5wQ29ubmVjdGVkUHJvZmlsZSA9ICZwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY3NyUm9hbUNhbGxDYWxsYmFjayhwTWFjLCBzZXNzaW9uSWQsIHBSb2FtSW5mbywgMCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ST0FNX0NPTk5FQ1RfU1RBVFVTX1VQREFURSwgZUNTUl9ST0FNX1JFU1VMVF9JQlNTX05FV19QRUVSKTsKKyAgICAgICAgICAgICAgICBpZihwUm9hbUluZm8pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZihyb2FtSW5mby5wYkZyYW1lcykKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHJvYW1JbmZvLnBiRnJhbWVzKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZihyb2FtSW5mby5wQnNzRGVzYykKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHJvYW1JbmZvLnBCc3NEZXNjKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVXTklfU01FX0lCU1NfUEVFUl9ERVBBUlRFRF9JTkQ6CisgICAgICAgICAgICBwSWJzc1BlZXJJbmQgPSAodFNtZUlic3NQZWVySW5kKilwU2lyTXNnOworICAgICAgICAgICAgc2Vzc2lvbklkID0gY3NyRmluZElic3NTZXNzaW9uKCBwTWFjICk7CisgICAgICAgICAgICBpZiggQ1NSX1NFU1NJT05fSURfSU5WQUxJRCAhPSBzZXNzaW9uSWQgKQorICAgICAgICAgICAgeworI2lmZGVmIEZFQVRVUkVfV0xBTl9ESUFHX1NVUFBPUlRfQ1NSCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB2b3NfbG9nX2lic3NfcGt0X3R5cGUgKnBJYnNzTG9nOworIAorICAgICAgICAgICAgICAgICAgICBXTEFOX1ZPU19ESUFHX0xPR19BTExPQyhwSWJzc0xvZywgdm9zX2xvZ19pYnNzX3BrdF90eXBlLCBMT0dfV0xBTl9JQlNTX0MpOworICAgICAgICAgICAgICAgICAgICBpZihwSWJzc0xvZykKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcElic3NMb2ctPmV2ZW50SWQgPSBXTEFOX0lCU1NfRVZFTlRfUEVFUl9MRUFWRTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBJYnNzUGVlckluZCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwSWJzc0xvZy0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBJYnNzUGVlckluZC0+cGVlckFkZHIsIDYpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9WT1NfRElBR19MT0dfUkVQT1JUKHBJYnNzTG9nKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyNlbmRpZiAvL0ZFQVRVUkVfV0xBTl9ESUFHX1NVUFBPUlRfQ1NSCisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csICJDU1I6IFBlZXIgZGVwYXJ0ZWQgbm90aWZpY2F0aW9uIGZyb20gTElNIik7CisgICAgICAgICAgICAgICAgcm9hbUluZm8uc3RhSWQgPSAodEFOSV9VOClwSWJzc1BlZXJJbmQtPnN0YUlkOworICAgICAgICAgICAgICAgIHJvYW1JbmZvLnVjYXN0U2lnID0gKHRBTklfVTgpcElic3NQZWVySW5kLT51Y2FzdFNpZzsKKyAgICAgICAgICAgICAgICByb2FtSW5mby5iY2FzdFNpZyA9ICh0QU5JX1U4KXBJYnNzUGVlckluZC0+YmNhc3RTaWc7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZyb2FtSW5mby5wZWVyTWFjLCBwSWJzc1BlZXJJbmQtPnBlZXJBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodENzckJzc2lkKSk7CisgICAgICAgICAgICAgICAgY3NyUm9hbUNhbGxDYWxsYmFjayhwTWFjLCBzZXNzaW9uSWQsICZyb2FtSW5mbywgMCwgCisgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fQ09OTkVDVF9TVEFUVVNfVVBEQVRFLCBlQ1NSX1JPQU1fUkVTVUxUX0lCU1NfUEVFUl9ERVBBUlRFRCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9TRVRDT05URVhUX1JTUDoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB0U2lyU21lU2V0Q29udGV4dFJzcCAqcFJzcCA9ICh0U2lyU21lU2V0Q29udGV4dFJzcCAqKXBTaXJNc2c7CisgICAgICAgICAgICAgICAgdExpc3RFbGVtICpwRW50cnk7CisgICAgICAgICAgICAgICAgdFNtZUNtZCAqcENvbW1hbmQ7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgcEVudHJ5ID0gY3NyTExQZWVrSGVhZCggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0LCBMTF9BQ0NFU1NfTE9DSyApOworICAgICAgICAgICAgICAgIGlmICggcEVudHJ5ICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBDb21tYW5kID0gR0VUX0JBU0VfQUREUiggcEVudHJ5LCB0U21lQ21kLCBMaW5rICk7CisgICAgICAgICAgICAgICAgICAgIGlmICggZVNtZUNvbW1hbmRTZXRLZXkgPT0gcENvbW1hbmQtPmNvbW1hbmQgKQorICAgICAgICAgICAgICAgICAgICB7ICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkID0gcENvbW1hbmQtPnNlc3Npb25JZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uID0gQ1NSX0dFVF9TRVNTSU9OKCBwTWFjLCBzZXNzaW9uSWQgKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYoIXBTZXNzaW9uKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiICBzZXNzaW9uICVkIG5vdCBmb3VuZCAiKSwgc2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgCisjaWZkZWYgRkVBVFVSRV9XTEFOX0RJQUdfU1VQUE9SVF9DU1IKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKGVDU1JfRU5DUllQVF9UWVBFX05PTkUgIT0gcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUuRW5jcnlwdGlvblR5cGUpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9WT1NfRElBR19FVkVOVF9ERUYoc2V0S2V5RXZlbnQsIHZvc19ldmVudF93bGFuX3NlY3VyaXR5X3BheWxvYWRfdHlwZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9zZXQoJnNldEtleUV2ZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih2b3NfZXZlbnRfd2xhbl9zZWN1cml0eV9wYXlsb2FkX3R5cGUpLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiggcFJzcC0+cGVlck1hY0FkZHJbMF0gJiAweDAxICkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldEtleUV2ZW50LmV2ZW50SWQgPSBXTEFOX1NFQ1VSSVRZX0VWRU5UX1NFVF9HVEtfUlNQOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRLZXlFdmVudC5ldmVudElkID0gV0xBTl9TRUNVUklUWV9FVkVOVF9TRVRfUFRLX1JTUDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIHBSc3AtPnBlZXJNYWNBZGRyWzBdICYgMHgwMSApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5wbWMucmVtYWluSW5Qb3dlckFjdGl2ZVRpbGxESENQID0gRkFMU0U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCBGTCgiUmVzZXQiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyZW1haW5JblBvd2VyQWN0aXZlVGlsbERIQ1AgdG8gYWxsb3cgQk1QUyIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0S2V5RXZlbnQuZW5jcnlwdGlvbk1vZGVNdWx0aWNhc3QgPSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZfVThfdClkaWFnRW5jVHlwZUZyb21DU1JUeXBlKHBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlLm1jRW5jcnlwdGlvblR5cGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldEtleUV2ZW50LmVuY3J5cHRpb25Nb2RlVW5pY2FzdCA9IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodl9VOF90KWRpYWdFbmNUeXBlRnJvbUNTUlR5cGUocFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUuRW5jcnlwdGlvblR5cGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShzZXRLZXlFdmVudC5ic3NpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUuYnNzaWQsIDYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldEtleUV2ZW50LmF1dGhNb2RlID0gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2X1U4X3QpZGlhZ0F1dGhUeXBlRnJvbUNTUlR5cGUocFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUuQXV0aFR5cGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBlU0lSX1NNRV9TVUNDRVNTICE9IHBSc3AtPnN0YXR1c0NvZGUgKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0S2V5RXZlbnQuc3RhdHVzID0gV0xBTl9TRUNVUklUWV9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9WT1NfRElBR19FVkVOVF9SRVBPUlQoJnNldEtleUV2ZW50LCBFVkVOVF9XTEFOX1NFQ1VSSVRZKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyNlbmRpZiAvL0ZFQVRVUkVfV0xBTl9ESUFHX1NVUFBPUlRfQ1NSCisgICAgICAgICAgICAgICAgICAgICAgICBpZiggQ1NSX0lTX1dBSVRfRk9SX0tFWSggcE1hYywgc2Vzc2lvbklkKSApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyUm9hbVN0b3BXYWl0Rm9yS2V5VGltZXIoIHBNYWMgKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vV2UgYXJlIGRvbmUgd2l0aCBhdXRoZW50aWNhdGlvbiwgd2hldGhlcmUgc3VjY2VlZCBvciBub3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JSb2FtU3Vic3RhdGVDaGFuZ2UoIHBNYWMsIGVDU1JfUk9BTV9TVUJTVEFURV9OT05FLCBzZXNzaW9uSWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vV2UgZG8gaXQgaGVyZSBiZWNhdXNlIHRoaXMgbGlua3VwIGZ1bmN0aW9uIGlzIG5vdCBjYWxsZWQgYWZ0ZXIgYXNzb2NpYXRpb24gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy93aGVuIGEga2V5IG5lZWRzIHRvIGJlIHNldC4gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIGNzcklzQ29ublN0YXRlQ29ubmVjdGVkSW5mcmEocE1hYywgc2Vzc2lvbklkKSApIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyUm9hbUxpbmtVcChwTWFjLCBwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS5ic3NpZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYoIGVTSVJfU01FX1NVQ0NFU1MgPT0gcFJzcC0+c3RhdHVzQ29kZSApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZyb2FtSW5mby5wZWVyTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFJzcC0+cGVlck1hY0FkZHIsIHNpemVvZih0Q3NyQnNzaWQpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9NYWtlIHN1cmUgd2UgaW5zdGFsbCB0aGUgR1RLIGJlZm9yZSBpbmRpY2F0aW5nIHRvIEhERCBhcyBhdXRoZW50aWNhdGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vVGhpcyBpcyB0byBwcmV2ZW50IGJyb2FkY2FzdCBwYWNrZXRzIGdvIG91dCBhZnRlciBQVEsgYW5kIGJlZm9yZSBHVEsuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICggdm9zX21lbV9jb21wYXJlKCAmQnJvYWRjYXN0YWRkciwgcFJzcC0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikgKSApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyNpZmRlZiBXTEFOX0FDVElWRU1PREVfT0ZGTE9BRF9GRUFUVVJFCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihJU19BQ1RJVkVNT0RFX09GRkxPQURfRkVBVFVSRV9FTkFCTEUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFNpclNldEFjdGl2ZU1vZGVTZXRCbmNGaWx0ZXJSZXEgcE1zZzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNc2cgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpclNldEFjdGl2ZU1vZGVTZXRCbmNGaWx0ZXJSZXEpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNc2ctPm1lc3NhZ2VUeXBlID0gcGFsX2NwdV90b19iZTE2KCh0QU5JX1UxNillV05JX1NNRV9TRVRfQkNOX0ZJTFRFUl9SRVEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1zZy0+bGVuZ3RoID0gcGFsX2NwdV90b19iZTE2KHNpemVvZiggdEFOSV9VOCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1zZy0+c2Vlc2lvbklkID0gc2Vzc2lvbklkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gcGFsU2VuZE1CTWVzc2FnZShwTWFjLT5oSGRkLCBwTXNnICk7IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgLyogT0JTUyBTQ0FOIEluZGljYXRpb24gd2lsbCBiZSBzZW50IHRvIEZpcm13YXJlIHRvIHN0YXJ0IE9CU1MgU2NhbiAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIENTUl9JU19DSEFOTkVMXzI0R0haKHBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlLm9wZXJhdGlvbkNoYW5uZWwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBJU19IVDQwX09CU1NfU0NBTl9GRUFUVVJFX0VOQUJMRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgKHBTZXNzaW9uLT5jb25uZWN0U3RhdGUgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX0FTU09DX1NUQVRFX1RZUEVfSU5GUkFfQVNTT0NJQVRFRCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHBTZXNzaW9uLT5wQ3VyUm9hbVByb2ZpbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIChWT1NfUDJQX0dPX01PREUgIT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPnBDdXJSb2FtUHJvZmlsZS0+Y3NyUGVyc29uYQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIFZPU19TVEFfU0FQX01PREUgIT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5wQ3VyUm9hbVByb2ZpbGUtPmNzclBlcnNvbmEpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFNpclNtZUhUNDBPQlNTU2NhbkluZCBwTXNnOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTXNnID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRTaXJTbWVIVDQwT0JTU1NjYW5JbmQpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1zZy0+bWVzc2FnZVR5cGUgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhbF9jcHVfdG9fYmUxNigodEFOSV9VMTYpZVdOSV9TTUVfSFQ0MF9PQlNTX1NDQU5fSU5EKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1zZy0+bGVuZ3RoID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhbF9jcHVfdG9fYmUxNihzaXplb2YoIHRTaXJTbWVIVDQwT0JTU1NjYW5JbmQpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBNc2ctPnBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlLmJzc2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBwYWxTZW5kTUJNZXNzYWdlKHBNYWMtPmhIZGQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTXNnICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HMSxGTCgiT0JTUyBTQ0FOIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJJbmRpY2F0aW9uIG5vdCBzZW50IHRvIEZXIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJjaGFubmVsICVkIE9CU1NfU0NBTjogJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcGVyYXRpb25DaGFubmVsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElTX0hUNDBfT0JTU19TQ0FOX0ZFQVRVUkVfRU5BQkxFKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0cxLEZMKCJjb25uZWN0U3RhdGUgJWQiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInBDdXJSb2FtUHJvZmlsZSAlcCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5jb25uZWN0U3RhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPnBDdXJSb2FtUHJvZmlsZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IGVDU1JfUk9BTV9SRVNVTFRfQVVUSEVOVElDQVRFRDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IGVDU1JfUk9BTV9SRVNVTFRfTk9ORTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8gPSAmcm9hbUluZm87CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gZUNTUl9ST0FNX1JFU1VMVF9GQUlMVVJFOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCAiQ1NSOiBSb2FtIENvbXBsZXRpb24gc2V0a2V5ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImNvbW1hbmQgZmFpbGVkKCVkKSBQZWVyTWFjICJNQUNfQUREUkVTU19TVFIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSc3AtPnN0YXR1c0NvZGUsIE1BQ19BRERSX0FSUkFZKHBSc3AtPnBlZXJNYWNBZGRyKSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIHNlc3Npb25JZCwgJnJvYW1JbmZvLCBwQ29tbWFuZC0+dS5zZXRLZXlDbWQucm9hbUlkLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ST0FNX1NFVF9LRVlfQ09NUExFVEUsIHJlc3VsdCk7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBJbmRpY2F0ZSBTTUVfUU9TIHRoYXQgdGhlIFNFVF9LRVkgaXMgY29tcGxldGVkLCBzbyB0aGF0IFNNRV9RT1MKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNhbiBnbyBhaGVhZCBhbmQgaW5pdGlhdGUgdGhlIFRTUEVDIGlmIGFueSBhcmUgcGVuZGluZworICAgICAgICAgICAgICAgICAgICAgICAgc21lX1Fvc0NzckV2ZW50SW5kKHBNYWMsICh2X1U4X3Qpc2Vzc2lvbklkLCBTTUVfUU9TX0NTUl9TRVRfS0VZX1NVQ0NFU1NfSU5ELCBOVUxMKTsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICAgICAgICAgICAgICAgICAgICAgICAvL1NlbmQgQWRqYWNlbnQgQVAgcmVwb3QgdG8gbmV3IEFQLgorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCA9PSBlQ1NSX1JPQU1fUkVTVUxUX0FVVEhFTlRJQ0FURUQgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+aXNQcmV2QXBJbmZvVmFsaWQgJiYgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUuaXNFU0VBc3NvYykKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFX1VQTE9BRAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNzclNlbmRFc2VBZGphY2VudEFwUmVwSW5kKHBNYWMsIHBTZXNzaW9uKTsKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyRXNlU2VuZEFkamFjZW50QXBSZXBNc2cocE1hYywgcFNlc3Npb24pOworI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPmlzUHJldkFwSW5mb1ZhbGlkID0gRkFMU0U7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBjc3JMTFJlbW92ZUVudHJ5KCAmcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QsIHBFbnRyeSwgTExfQUNDRVNTX0xPQ0sgKSApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyUmVsZWFzZUNvbW1hbmRTZXRLZXkoIHBNYWMsIHBDb21tYW5kICk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsICJDU1I6IFJvYW0gQ29tcGxldGlvbiBjYWxsZWQgYnV0IHNldGtleSBjb21tYW5kIGlzIG5vdCBBQ1RJVkUgLi4uIiApOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgIkNTUjogU2V0S2V5IENvbXBsZXRpb24gY2FsbGVkIGJ1dCBOTyBjb21tYW5kcyBhcmUgQUNUSVZFIC4uLiIgKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc21lUHJvY2Vzc1BlbmRpbmdRdWV1ZSggcE1hYyApOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfUkVNT1ZFS0VZX1JTUDoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB0U2lyU21lUmVtb3ZlS2V5UnNwICpwUnNwID0gKHRTaXJTbWVSZW1vdmVLZXlSc3AgKilwU2lyTXNnOworICAgICAgICAgICAgICAgIHRMaXN0RWxlbSAqcEVudHJ5OworICAgICAgICAgICAgICAgIHRTbWVDbWQgKnBDb21tYW5kOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIHBFbnRyeSA9IGNzckxMUGVla0hlYWQoICZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCwgTExfQUNDRVNTX0xPQ0sgKTsKKyAgICAgICAgICAgICAgICBpZiAoIHBFbnRyeSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwQ29tbWFuZCA9IEdFVF9CQVNFX0FERFIoIHBFbnRyeSwgdFNtZUNtZCwgTGluayApOworICAgICAgICAgICAgICAgICAgICBpZiAoIGVTbWVDb21tYW5kUmVtb3ZlS2V5ID09IHBDb21tYW5kLT5jb21tYW5kICkKKyAgICAgICAgICAgICAgICAgICAgeyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCA9IHBDb21tYW5kLT5zZXNzaW9uSWQ7CisgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTiggcE1hYywgc2Vzc2lvbklkICk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFwU2Vzc2lvbikKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiAgc2Vzc2lvbiAlZCBub3QgZm91bmQgIiksIHNlc3Npb25JZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICAgICAgfQorI2lmZGVmIEZFQVRVUkVfV0xBTl9ESUFHX1NVUFBPUlRfQ1NSCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9WT1NfRElBR19FVkVOVF9ERUYocmVtb3ZlS2V5RXZlbnQsIHZvc19ldmVudF93bGFuX3NlY3VyaXR5X3BheWxvYWRfdHlwZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9zZXQoJnJlbW92ZUtleUV2ZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih2b3NfZXZlbnRfd2xhbl9zZWN1cml0eV9wYXlsb2FkX3R5cGUpLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVLZXlFdmVudC5ldmVudElkID0gV0xBTl9TRUNVUklUWV9FVkVOVF9SRU1PVkVfS0VZX1JTUDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVLZXlFdmVudC5lbmNyeXB0aW9uTW9kZU11bHRpY2FzdCA9IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodl9VOF90KWRpYWdFbmNUeXBlRnJvbUNTUlR5cGUocFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUubWNFbmNyeXB0aW9uVHlwZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlS2V5RXZlbnQuZW5jcnlwdGlvbk1vZGVVbmljYXN0ID0gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2X1U4X3QpZGlhZ0VuY1R5cGVGcm9tQ1NSVHlwZShwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS5FbmNyeXB0aW9uVHlwZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCByZW1vdmVLZXlFdmVudC5ic3NpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlLmJzc2lkLCA2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVLZXlFdmVudC5hdXRoTW9kZSA9IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodl9VOF90KWRpYWdBdXRoVHlwZUZyb21DU1JUeXBlKHBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlLkF1dGhUeXBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiggZVNJUl9TTUVfU1VDQ0VTUyAhPSBwUnNwLT5zdGF0dXNDb2RlICkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZUtleUV2ZW50LnN0YXR1cyA9IFdMQU5fU0VDVVJJVFlfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5fVk9TX0RJQUdfRVZFTlRfUkVQT1JUKCZyZW1vdmVLZXlFdmVudCwgRVZFTlRfV0xBTl9TRUNVUklUWSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisjZW5kaWYgLy9GRUFUVVJFX1dMQU5fRElBR19TVVBQT1JUX0NTUgorICAgICAgICAgICAgICAgICAgICAgICAgaWYoIGVTSVJfU01FX1NVQ0NFU1MgPT0gcFJzcC0+c3RhdHVzQ29kZSApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZyb2FtSW5mby5wZWVyTWFjLCAmcFJzcC0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0Q3NyQnNzaWQpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBlQ1NSX1JPQU1fUkVTVUxUX05PTkU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJvYW1JbmZvID0gJnJvYW1JbmZvOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IGVDU1JfUk9BTV9SRVNVTFRfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGNzclJvYW1DYWxsQ2FsbGJhY2socE1hYywgc2Vzc2lvbklkLCAmcm9hbUluZm8sIHBDb21tYW5kLT51LnNldEtleUNtZC5yb2FtSWQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fUkVNT1ZFX0tFWV9DT01QTEVURSwgcmVzdWx0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBjc3JMTFJlbW92ZUVudHJ5KCAmcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QsIHBFbnRyeSwgTExfQUNDRVNTX0xPQ0sgKSApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyUmVsZWFzZUNvbW1hbmRSZW1vdmVLZXkoIHBNYWMsIHBDb21tYW5kICk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR1csICJDU1I6IFJvYW0gQ29tcGxldGlvbiBjYWxsZWQgYnV0IHNldGtleSBjb21tYW5kIGlzIG5vdCBBQ1RJVkUgLi4uIiApOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HVywgIkNTUjogU2V0S2V5IENvbXBsZXRpb24gY2FsbGVkIGJ1dCBOTyBjb21tYW5kcyBhcmUgQUNUSVZFIC4uLiIgKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc21lUHJvY2Vzc1BlbmRpbmdRdWV1ZSggcE1hYyApOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfR0VUX1NUQVRJU1RJQ1NfUlNQOgorICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0cyLCBGTCgiU3RhdHMgcnNwIGZyb20gUEUiKSk7CisgICAgICAgICAgICBjc3JSb2FtU3RhdHNSc3BQcm9jZXNzb3IoIHBNYWMsIHBTaXJNc2cgKTsKKyAgICAgICAgICAgIGJyZWFrOworI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIgfHwgZGVmaW5lZCBGRUFUVVJFX1dMQU5fRVNFIHx8IGRlZmluZWQoRkVBVFVSRV9XTEFOX0xGUikKKyAgICAgICAgY2FzZSBlV05JX1NNRV9HRVRfUk9BTV9SU1NJX1JTUDoKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HMiwgRkwoIlN0YXRzIHJzcCBmcm9tIFBFIikpOworICAgICAgICAgICAgY3NyUm9hbVJzc2lSc3BQcm9jZXNzb3IoIHBNYWMsIHBTaXJNc2cgKTsKKyAgICAgICAgICAgIGJyZWFrOworI2VuZGlmCisjaWYgZGVmaW5lZChGRUFUVVJFX1dMQU5fRVNFKSAmJiBkZWZpbmVkKEZFQVRVUkVfV0xBTl9FU0VfVVBMT0FEKQorICAgICAgICBjYXNlIGVXTklfU01FX0dFVF9UU01fU1RBVFNfUlNQOgorICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0cyLCBGTCgiVFNNIFN0YXRzIHJzcCBmcm9tIFBFIikpOworICAgICAgICAgICAgY3NyVHNtU3RhdHNSc3BQcm9jZXNzb3IoIHBNYWMsIHBTaXJNc2cgKTsKKyAgICAgICAgICAgIGJyZWFrOworI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9FU0UgJiYgRkVBVFVSRV9XTEFOX0VTRV9VUExPQUQgKi8KKyAgICAgICAgY2FzZSBlV05JX1NNRV9HRVRfUlNTSV9SRVE6CisgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPRzIsIEZMKCJHZXRSc3NpUmVxIGZyb20gc2VsZiIpKTsKKyAgICAgICAgICAgIGNzclVwZGF0ZVJzc2koIHBNYWMsIHBTaXJNc2cgKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVdOSV9TTUVfR0VUX1NOUl9SRVE6CisgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPRzIsIEZMKCJHZXRTbnJSZXEgZnJvbSBzZWxmIikpOworICAgICAgICAgICAgY3NyVXBkYXRlU25yKHBNYWMsIHBTaXJNc2cpOworICAgICAgICAgICAgYnJlYWs7CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUgorICAgICAgICBjYXNlIGVXTklfU01FX0ZUX1BSRV9BVVRIX1JTUDoKKyAgICAgICAgICAgIGNzclJvYW1GVFByZUF1dGhSc3BQcm9jZXNzb3IoIHBNYWMsICh0cFNpckZUUHJlQXV0aFJzcClwU2lyTXNnICk7CisgICAgICAgICAgICBicmVhazsKKyNlbmRpZgorICAgICAgICBjYXNlIGVXTklfU01FX01BWF9BU1NPQ19FWENFRURFRDoKKyAgICAgICAgICAgIHBTbWVNYXhBc3NvY0luZCA9ICh0U21lTWF4QXNzb2NJbmQqKXBTaXJNc2c7CisgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPRzEsIEZMKCJzZW5kIGluZGljYXRpb24gdGhhdCBtYXggYXNzb2MgaGF2ZSBiZWVuIHJlYWNoZWQgYW5kIHRoZSBuZXcgcGVlciBjYW5ub3QgYmUgYWNjZXB0ZWQiKSk7CisgICAgICAgICAgICBzZXNzaW9uSWQgPSBwU21lTWF4QXNzb2NJbmQtPnNlc3Npb25JZDsKKyAgICAgICAgICAgIHJvYW1JbmZvLnNlc3Npb25JZCA9IHNlc3Npb25JZDsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSgmcm9hbUluZm8ucGVlck1hYywgcFNtZU1heEFzc29jSW5kLT5wZWVyTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0Q3NyQnNzaWQpKTsKKyAgICAgICAgICAgIGNzclJvYW1DYWxsQ2FsbGJhY2socE1hYywgc2Vzc2lvbklkLCAmcm9hbUluZm8sIDAsIAorICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fSU5GUkFfSU5ELCBlQ1NSX1JPQU1fUkVTVUxUX01BWF9BU1NPQ19FWENFRURFRCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIAorICAgICAgICBjYXNlIGVXTklfU01FX0JUQU1QX0xPR19MSU5LX0lORDoKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HMSwgRkwoIkVzdGFibGlzaCBsb2dpY2FsIGxpbmsgcmVxIGZyb20gSENJIHNlcmlhbGl6ZWQgdGhyb3VnaCBNQyB0aHJlYWQiKSk7CisgICAgICAgICAgICBidGFtcEVzdGFibGlzaExvZ0xpbmtIZGxyKCBwU2lyTXNnICk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9SU1NJX0lORDoKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HMSwgRkwoIlJTU0kgaW5kaWNhdGlvbiBmcm9tIFRMIHNlc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cm9hbWluZ1N0YXR1c0NvZGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcm9hbVJlc3VsdCA9IGVDU1JfUk9BTV9SRVNVTFRfTE9TVExJTks7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKGVDc3JMb3N0bGlua1JvYW1pbmdEaXNhc3NvYyA9PSBwU2Vzc2lvbi0+cm9hbWluZ1JlYXNvbikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByb2FtUmVzdWx0ID0gZUNTUl9ST0FNX1JFU1VMVF9ESVNBU1NPQ19JTkQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKGVDc3JMb3N0bGlua1JvYW1pbmdEZWF1dGggPT0gcFNlc3Npb24tPnJvYW1pbmdSZWFzb24pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcm9hbVJlc3VsdCA9IGVDU1JfUk9BTV9SRVNVTFRfREVBVVRIX0lORDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByb2FtUmVzdWx0ID0gZUNTUl9ST0FNX1JFU1VMVF9MT1NUTElOSzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBjc3JDYWxsUm9hbWluZ0NvbXBsZXRpb25DYWxsYmFjayhwTWFjLCBwU2Vzc2lvbiwgTlVMTCwgMCwgcm9hbVJlc3VsdCk7CisgICAgICAgIHBTZXNzaW9uLT5yb2FtaW5nUmVhc29uID0gZUNzck5vdFJvYW1pbmc7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHBTZXNzaW9uLT5yb2FtUmVzdWx0ID0gcm9hbVJlc3VsdDsKKyAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhjc3JSb2FtU3RhcnRSb2FtaW5nVGltZXIocE1hYywgc2Vzc2lvbklkLCBQQUxfVElNRVJfVE9fU0VDX1VO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k7CisgICAgICAgIH0KKyNlbmRpZgorICAgICAgICBzbXNMb2cocE1hYywgTE9HVywgIiBTTUUgcHJlLWF1dGggc3RhdGUgdGltZW91dC4gIik7CisKKyAgICAgICAgLy9DaGFuZ2UgdGhlIHN1YnN0YXRlIHNvIGNvbW1hbmQgcXVldWUgaXMgdW5ibG9ja2VkLgorICAgICAgICBpZiAoQ1NSX1JPQU1fU0VTU0lPTl9NQVggPiBwSW5mby0+c2Vzc2lvbklkKQorICAgICAgICB7CisgICAgICAgICAgICBjc3JSb2FtU3Vic3RhdGVDaGFuZ2UocE1hYywgZUNTUl9ST0FNX1NVQlNUQVRFX05PTkUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEluZm8tPnNlc3Npb25JZCk7CisgICAgICAgIH0KKworICAgICAgICBpZiAocFNlc3Npb24pCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKCBjc3JJc0Nvbm5TdGF0ZUNvbm5lY3RlZEluZnJhKHBNYWMsIHBJbmZvLT5zZXNzaW9uSWQpICkgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY3NyUm9hbUxpbmtVcChwTWFjLCBwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS5ic3NpZCk7CisgICAgICAgICAgICAgICAgc21lUHJvY2Vzc1BlbmRpbmdRdWV1ZShwTWFjKTsKKyAgICAgICAgICAgICAgICBpZiggKHBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlLkF1dGhUeXBlID09CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9BVVRIX1RZUEVfU0hBUkVEX0tFWSkgJiYKKyAgICAgICAgICAgICAgICAgICAgKCAocFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUuRW5jcnlwdGlvblR5cGUgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVA0MCkgfHwKKyAgICAgICAgICAgICAgICAgICAgICAocFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUuRW5jcnlwdGlvblR5cGUgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVAxMDQpICkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBzbWVfQWNxdWlyZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCBIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgY3NyUm9hbURpc2Nvbm5lY3QoIHBNYWMsIHBJbmZvLT5zZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfRElTQ09OTkVDVF9SRUFTT05fVU5TUEVDSUZJRUQgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNtZV9SZWxlYXNlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLCAiJXM6IGNvdWxkIG5vdCBwb3N0IGxpbmsgdXAiLAorICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csICIlczogc2Vzc2lvbiBub3QgZm91bmQiLCBfX2Z1bmNfXyk7CisgICAgICAgIH0KKyAgICB9CisgICAgCit9CisKK2VIYWxTdGF0dXMgY3NyUm9hbVN0YXJ0V2FpdEZvcktleVRpbWVyKHRw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m9hbSwgb3IgaWYgd2UgYXJlIHVuYWJsZSB0bworICAgICAgIGN1cnJlbnRseSByb2FtLCB0aGVuIG5vdGlmeSBIREQgb2YgdGhlIGxvc3QgbGluayAqLworICAgIGlmKGZUb1JvYW0pCisgICAgeworICAgICAgICAvL09ubHkgcmVtb3ZlIHRoZSBjb25uZWN0ZWQgQlNTIGluIGluZnJhc3RydWN0dXJlIG1vZGUKKyAgICAgICAgY3NyUm9hbVJlbW92ZUNvbm5lY3RlZEJzc0Zyb21TY2FuQ2FjaGUocE1hYywgJnBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlKTsKKyAgICAgICAgLy9Ob3QgdG8gZG8gYW55aW5nIGZvciBsb3N0bGluayB3aXRoIFdEUworICAgICAgICBpZiggcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uUm9hbWluZ1RpbWUgKQorICAgICAgICB7CisgICAgICAgICAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzID0gY3NyUm9hbVN0YXJ0Um9hbWluZyhwTWFjLCBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAoIGVXTklfU01FX0RFQVVUSF9JTkQgPT0gdHlwZSApID8gCisgICAgICAgICAgICAgICAgICAgICAgICBlQ3NyTG9zdGxpbmtSb2FtaW5nRGVhdXRoIDogZUNzckxvc3RsaW5rUm9hbWluZ0Rpc2Fzc29jKSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9zZXQoJnJvYW1JbmZvLCBzaXplb2YodENzclJvYW1JbmZvKSwgMCk7CisgICAgICAgICAgICAgICAgLy9Gb3IgSUJTUywgd2UgbmVlZCB0byBnaXZlIHNvbWUgbW9yZSBpbmZvIHRvIEhERAorICAgICAgICAgICAgICAgIGlmKGNzcklzQnNzVHlwZUlCU1MocFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUuQlNTVHlwZSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICByb2FtSW5mby51LnBDb25uZWN0ZWRQcm9maWxlID0gJnBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlOworICAgICAgICAgICAgICAgICAgICByb2FtSW5mby5zdGF0dXNDb2RlID0gKHRTaXJSZXN1bHRDb2RlcylwU2Vzc2lvbi0+cm9hbWluZ1N0YXR1c0NvZGU7CisgICAgICAgICAgICAgICAgICAgIHJvYW1JbmZvLnJlYXNvbkNvZGUgPSBwU2Vzc2lvbi0+am9pbkZhaWxTdGF0dXNDb2RlLnJlYXNvbkNvZGU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgcm9hbUluZm8ucmVhc29uQ29kZSA9IGVDc3JSb2FtUmVhc29uU21lSXNzdWVkRm9yTG9zdExpbms7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBwUm9hbUluZm8gPSAmcm9hbUluZm87CisgICAgICAgICAgICAgICAgcFNlc3Npb24tPnJvYW1pbmdSZWFzb24gPSAoIGVXTklfU01FX0RFQVVUSF9JTkQgPT0gdHlwZSApID8gCisgICAgICAgICAgICAgICAgICAgICAgICBlQ3NyTG9zdGxpbmtSb2FtaW5nRGVhdXRoIDogZUNzckxvc3RsaW5rUm9hbWluZ0Rpc2Fzc29jOworICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5yb2FtaW5nU3RhcnRUaW1lID0gKHRBTklfVElNRVNUQU1QKXBhbEdldFRpY2tDb3VudChwTWFjLT5oSGRkKTsKKyAgICAgICAgICAgICAgICBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIHNlc3Npb25JZCwgcFJvYW1JbmZvLCAwLCBlQ1NSX1JPQU1fUk9BTUlOR19TVEFSVCwgZUNTUl9ST0FNX1JFU1VMVF9MT1NUTElOSyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csICIgJXMgRmFpbCB0byBzdGFydCByb2FtaW5nLCBzdGF0dXMgPSAlZCIsIF9fZnVuY19fLCBzdGF0dXMpOworICAgICAgICAgICAgICAgIGZUb1JvYW0gPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvL1dlIGFyZSB0b2xkIG5vdCB0byByb2FtLCBpbmRpY2F0ZSBsb3N0bGluaworICAgICAgICAgICAgZlRvUm9hbSA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgfQorICAgIH0KKyAgICBpZighZlRvUm9hbSkKKyAgICB7CisgICAgICAgIC8vVGVsbCBIREQgYWJvdXQgdGhlIGxvc3QgbGluaworICAgICAgICBpZighQ1NSX0lTX0lORlJBX0FQKCZwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIERvbid0IGNhbGwgY3NyUm9hbUNhbGxDYWxsYmFjayBmb3IgR08vU29mdEFwIGNhc2UgYXMgdGhpcyBpbmRpY2F0aW9uCisgICAgICAgICAgICAgKiB3YXMgYWxyZWFkeSBnaXZlbiBhcyBwYXJ0IG9mIGVXTklfU01FX0RJU0FTU09DX0lORCBtc2cgaGFuZGxpbmcgaW4KKyAgICAgICAgICAgICAqIGNzclJvYW1DaGVja0ZvckxpbmtTdGF0dXNDaGFuZ2UgQVBJLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIHNlc3Npb25JZCwgJnJvYW1JbmZvLCAwLCBlQ1NSX1JPQU1fTE9TVExJTkssIHJlc3VsdCk7CisgICAgICAgIH0KKworICAgICAgIC8qTm8gbmVlZCB0byBzdGFydCBpZGxlIHNjYW4gaW4gY2FzZSBvZiBJQlNTL1NBUCAKKyAgICAgICAgIFN0a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c2lvbi0+Y29ubmVjdGVkUHJvZmlsZSk7CisgICAgaWYocE1hYy0+cm9hbS5jb25maWdQYXJhbS5uUm9hbWluZ1RpbWUpCisgICAgeworICAgICAgIGlmKEhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMgPSBjc3JSb2FtU3RhcnRSb2FtaW5nKHBNYWMsc2Vzc2lvbklkLCBwU2Vzc2lvbi0+cm9hbWluZ1JlYXNvbikpKQorICAgICAgIHsKKyAgICAgICAgICAvL2JlZm9yZSBzdGFydGluZyB0aGUgbG9zdCBsaW5rIGxvZ2ljIHJlbGVhc2UgdGhlIHJvYW0gY29tbWFuZCBmb3IgaGFuZG9mZgorICAgICAgICAgIHBFbnRyeSA9IGNzckxMUGVla0hlYWQoJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0LCBMTF9BQ0NFU1NfTE9DSyk7CisgICAgICAgICAgaWYocEVudHJ5KQorICAgICAgICAgIHsKKyAgICAgICAgICAgICAgcENvbW1hbmQgPSBHRVRfQkFTRV9BRERSKHBFbnRyeSwgdFNtZUNtZCwgTGluayk7CisgICAgICAgICAgfQorICAgICAgICAgIGlmKHBDb21tYW5kKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICBpZiAoKCBlU21lQ29tbWFuZFJvYW0gPT0gcENvbW1hbmQtPmNvbW1hbmQgKSAmJgorICAgICAgICAgICAgICAgICAoIGVDc3JTbWVJc3N1ZWRBc3NvY1RvU2ltaWxhckFQID09IHBDb21tYW5kLT51LnJvYW1DbWQucm9hbVJlYXNvbikpCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBpZiggY3NyTExSZW1vdmVFbnRyeSggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0LCBwRW50cnksIExMX0FDQ0VTU19MT0NLICkgKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGNzclJlbGVhc2VDb21tYW5kUm9hbSggcE1hYywgcENvbW1hbmQgKTsKKyAgICAg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KKyAgICAgICAgICAgICAgICBjc3JSZWxlYXNlQ29tbWFuZFdtU3RhdHVzQ2hhbmdlKCBwTWFjLCBwQ29tbWFuZCApOyAgICAgICAgICAgIAorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgIiAqKioqKipjc3JSb2FtV21TdGF0dXNDaGFuZ2VDb21wbGV0ZSBmYWlsIHRvIHJlbGVhc2UgY29tbWFuZCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR1csICJDU1I6IFdtU3RhdHVzQ2hhbmdlIENvbXBsZXRpb24gY2FsbGVkIGJ1dCBMT1NUIExJTksgY29tbWFuZCBpcyBub3QgQUNUSVZFIC4uLiIgKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBzbXNMb2coIHBNYWMsIExPR1csICJDU1I6IFdtU3RhdHVzQ2hhbmdlIENvbXBsZXRpb24gY2FsbGVkIGJ1dCBOTyBjb21tYW5kcyBhcmUgQUNUSVZFIC4uLiIgKTsKKyAgICB9CisgICAgc21lUHJvY2Vzc1BlbmRpbmdRdWV1ZSggcE1hYyApOworfQorCit2b2lkIGNzclJvYW1Qcm9jZXNzV21TdGF0dXNDaGFuZ2VDb21tYW5kKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0U21lQ21kICpwQ29tbWFuZCApCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIHRTaXJTbWVSc3AgKnBTaXJTbWVNc2c7CisgICAgdENzclJvYW1TZXNzaW9uICpwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTiggcE1hYywgcENvbW1hbmQtPnNlc3Npb25JZCApOworCisgICAgaWYoIXBTZXNzaW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WdQYXJhbS51Q2ZnRG90MTFNb2RlKSB8fAorICAgICAgICAgKGVDU1JfQ0ZHX0RPVDExX01PREVfQUJHID09IHBNYWMtPnJvYW0uY29uZmlnUGFyYW0udUNmZ0RvdDExTW9kZSkpKSB8fAorICAgICAgICAoZUNTUl9DRkdfRE9UMTFfTU9ERV9BVVRPID09IGNmZ0RvdDExTW9kZSkgfHwgKGVDU1JfQ0ZHX0RPVDExX01PREVfQUJHID09IGNmZ0RvdDExTW9kZSkgKQorICAgIHsKKyAgICAgICAgc3dpdGNoKCBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLnVDZmdEb3QxMU1vZGUgKQorICAgICAgICB7CisgICAgICAgICAgICBjYXNlIGVDU1JfQ0ZHX0RPVDExX01PREVfMTFBOgorICAgICAgICAgICAgICAgIGNmZ0RvdDExTW9kZSA9IGVDU1JfQ0ZHX0RPVDExX01PREVfMTFBOworICAgICAgICAgICAgICAgIGVCYW5kID0gZUNTUl9CQU5EXzVHOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQjoKKyAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQjsKKyAgICAgICAgICAgICAgICBlQmFuZCA9IGVDU1JfQkFORF8yNDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUc6CisgICAgICAgICAgICAgICAgY2ZnRG90MTFNb2RlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUc7CisgICAgICAgICAgICAgICAgZUJhbmQgPSBlQ1NSX0JBTkRfMjQ7CisgICAgICAgICAgICAgICAgYnJlYWs7ICAgICAgICAgICAgCisgICAgICAgICAgICBjYXNlIGVDU1JfQ0ZHX0RPVDExX01PREVfMTFOOgorICAgICAgICAgICAgICAgIGNmZ0RvdDExTW9kZSA9IGVDU1JfQ0ZHX0RPVDExX01PREVfMTFOOworICAgICAgICAgICAgICAgIGVCYW5kID0gQ1NSX0lTX0NIQU5ORUxfMjRHSFoob3BlcmF0aW9uQ2huKSA/IGVDU1JfQkFORF8yNCA6IGVDU1JfQkFORF81RzsKKyAgICAgICAgICAgICAgICBicmVhazsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgICAgICAgICAgY2FzZSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQUM6CisgICAgICAgICAgICAgICAgaWYgKElTX0ZFQVRVUkVfU1VQUE9SVEVEX0JZX0ZXKERPVDExQUMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogSWYgdGhlIG9wZXJhdGluZyBjaGFubmVsIGlzIGluIDIuNCBHSHogYmFuZCwgY2hlY2sgZm9yCisgICAgICAgICAgICAgICAgICAgICAqIElOSSBpdGVtIHRvIGRpc2FibGUgVkhUIG9wZXJhdGlvbiBpbiAyLjQgR0h6IGJhbmQKKyAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgIGlmIChDU1JfSVNfQ0hBTk5FTF8yNEdIWihvcGVyYXRpb25DaG4pICYmCisgICAgICAgICAgICAgICAgICAgICAgICAhcE1hYy0+cm9hbS5jb25maWdQYXJhbS5lbmFibGVWaHRGb3IyNEdIeikKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAvKiBEaXNhYmxlIDExQUMgb3BlcmF0aW9uICovCisgICAgICAgICAgICAgICAgICAgICAgIGNmZ0RvdDExTW9kZSA9IGVDU1JfQ0ZHX0RPVDExX01PREVfMTFOOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQUM7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZUJhbmQgPSBDU1JfSVNfQ0hBTk5FTF8yNEdIWihvcGVyYXRpb25DaG4pID8gZUNTUl9CQU5EXzI0IDogZUNTUl9CQU5EXzVHOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExTjsKKyAgICAgICAgICAgICAgICAgICAgZUJhbmQgPSBDU1JfSVNfQ0hBTk5FTF8yNEdIWihvcGVyYXRpb25DaG4pID8gZUNTUl9CQU5EXzI0IDogZUNTUl9CQU5EXzVHOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUFDX09OTFk6CisgICAgICAgICAgICAgICAgaWYgKElTX0ZFQVRVUkVfU1VQUE9SVEVEX0JZX0ZXKERPVDExQUMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAvKiBJZiB0aGUgb3BlcmF0aW5nIGNoYW5uZWwgaXMgaW4gMi40IEdIeiBiYW5kLCBjaGVjayBmb3IKKyAgICAgICAgICAgICAgICAgICAgKiBJTkkgaXRlbSB0byBkaXNhYmxlIFZIVCBvcGVyYXRpb24gaW4gMi40IEdIeiBiYW5kCisgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgaWYgKENTUl9JU19DSEFOTkVMXzI0R0haKG9wZXJhdGlvbkNobikgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIXBNYWMtPnJvYW0uY29uZmlnUGFyYW0uZW5hYmxlVmh0Rm9yMjRHSHopCisgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIC8qIERpc2FibGUgMTFBQyBvcGVyYXRpb24gKi8KKyAgICAgICAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExTjsKKyAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQUNfT05MWTsKKyAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgZUJhbmQgPSBDU1JfSVNfQ0hBTk5FTF8yNEdIWihvcGVyYXRpb25DaG4pID8gZUNTUl9CQU5EXzI0IDogZUNTUl9CQU5EXzVHOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBlQmFuZCA9IENTUl9JU19DSEFOTkVMXzI0R0haKG9wZXJhdGlvbkNobikgPyBlQ1NSX0JBTkRfMjQgOiBlQ1NSX0JBTkRfNUc7CisgICAgICAgICAgICAgICAgICAgIGNmZ0RvdDExTW9kZSA9IGVDU1JfQ0ZHX0RPVDExX01PREVfMTFOOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyNlbmRpZgorICAgICAgICAgICAgY2FzZSBlQ1NSX0NGR19ET1QxMV9NT0RFX0FVVE86CisjaWZkZWYgV0xBTl9GRUFUVVJFXzExQUMKKyAgICAgICAgICAgICAgICBpZiAoSVNfRkVBVFVSRV9TVVBQT1JURURfQllfRlcoRE9UMTFBQykpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBJZiB0aGUgb3BlcmF0aW5nIGNoYW5uZWwgaXMgaW4gMi40IEdIeiBiYW5kLCBjaGVjayBmb3IKKyAgICAgICAgICAgICAgICAgICAgICogSU5JIGl0ZW0gdG8gZGlzYWJsZSBWSFQgb3BlcmF0aW9uIGluIDIuNCBHSHogYmFuZAorICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKENTUl9JU19DSEFOTkVMXzI0R0haKG9wZXJhdGlvbkNobikgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAhcE1hYy0+cm9hbS5jb25maWdQYXJhbS5lbmFibGVWaHRGb3IyNEdIeikKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAvKiBEaXNhYmxlIDExQUMgb3BlcmF0aW9uICovCisgICAgICAgICAgICAgICAgICAgICAgIGNmZ0RvdDExTW9kZSA9IGVDU1JfQ0ZHX0RPVDExX01PREVfMTFOOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQUM7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZUJhbmQgPSBDU1JfSVNfQ0hBTk5FTF8yNEdIWihvcGVyYXRpb25DaG4pID8gZUNTUl9CQU5EXzI0IDogZUNTUl9CQU5EXzVHOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgY2ZnRG90MTFNb2RlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV8xMU47CisgICAgICAgICAgICAgICAgICAgICAgICBlQmFuZCA9IENTUl9JU19DSEFOTkVMXzI0R0haKG9wZXJhdGlvbkNobikgPyBlQ1NSX0JBTkRfMjQgOiBlQ1NSX0JBTkRfNUc7CisgICAgICAgICAgICAgICAgfQorI2Vsc2UKKyAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExTjsKKyAgICAgICAgICAgICAgICBlQmFuZCA9IENTUl9JU19DSEFOTkVMXzI0R0haKG9wZXJhdGlvbkNobikgPyBlQ1NSX0JBTkRfMjQgOiBlQ1NSX0JBTkRfNUc7CisjZW5kaWYKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgLy8gR2xvYmFsIGRvdDExIE1vZGUgc2V0dGluZyBpcyAxMWEvYi9nLgorICAgICAgICAgICAgICAgIC8vIHVzZSB0aGUgY2hhbm5lbCBudW1iZXIgdG8gZGV0ZXJtaW5lIHRoZSBNb2RlIHNldHRpbmcuCisgICAgICAgICAgICAgICAgaWYgKCBlQ1NSX09QRVJBVElOR19DSEFOTkVMX0FVVE8gPT0gb3BlcmF0aW9uQ2huICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGVCYW5kID0gcE1hYy0+cm9hbS5jb25maWdQYXJhbS5lQmFuZDsKKyAgICAgICAgICAgICAgICAgICAgaWYoZUNTUl9CQU5EXzI0ID09IGVCYW5kKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvL1NlZSByZWFzb24gaW4gZWxzZSBpZiAoIENTUl9JU19DSEFOTkVMXzI0R0haKG9wZXJhdGlvbkNobikgKSB0byBwaWNrIDExQgorICAgICAgICAgICAgICAgICAgICAgICAgY2ZnRG90MTFNb2RlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUI7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvL3ByZWZlciA1R0h6CisgICAgICAgICAgICAgICAgICAgICAgICBlQmFuZCA9IGVDU1JfQkFORF81RzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNmZ0RvdDExTW9kZSA9IGVDU1JfQ0ZHX0RPVDExX01PREVfMTFBOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQ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ICAgICAgICAgLy8KKyAgICAgICAgICAgICAgICAgICAgLy8gTm90ZTogIHdlIHVzZWQgdG8gaGF2ZSB0aGlzIHN0YXJ0IGFzIGFuIDExZyBJQlNTIGZvciBiZXN0CisgICAgICAgICAgICAgICAgICAgIC8vIHBlcmZvcm1hbmNlLi4uIG5vdyB0byBzcGVjaWZ5IHRoYXQgdGhlIHVzZXIgd2lsbCBoYXZlIHRvCisgICAgICAgICAgICAgICAgICAgIC8vIHNldCB0aGUgZG8xMU1vZGUgaW4gdGhlIHByb3BlcnR5IHBhZ2UgdG8gMTFnIHRvIGZvcmNlIGl0LgorICAgICAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQjsKKyAgICAgICAgICAgICAgICAgICAgZUJhbmQgPSBlQ1NSX0JBTkRfMjQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgCisgICAgICAgICAgICAgICAgeyAgIAorICAgICAgICAgICAgICAgICAgICAvLyBlbHNlLCBpdCdzIGEgNS4wR0h6IGNoYW5uZWwuICBTZXQgbW9kZSB0byAxMWEuCisgICAgICAgICAgICAgICAgICAgIGNmZ0RvdDExTW9kZSA9IGVDU1JfQ0ZHX0RPVDExX01PREVfMTFBOworICAgICAgICAgICAgICAgICAgICBlQmFuZCA9IGVDU1JfQkFORF81RzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0vL3N3aXRjaAorICAgIH0vL2lmKCBlQ1NSX0NGR19ET1QxMV9NT0RFX0FCRyA9PSBjZmdEb3QxMU1vZGUgKQorICAgIGVsc2UKKyAgICB7CisgICAgICAgICAgICAvL2RvdDExIG1vZGUgaXMgc2V0LCBsZXRzIHBpY2sgdGhlIGJhbmQKKyAgICAgICAgICAgIGlmICggZUNTUl9PUEVSQVRJTkdfQ0hBTk5FTF9BVVRPID09IG9wZXJhdGlvbkNobiApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gY2hhbm5lbCBpcyBBdXRvIGFsc28uIAorICAgICAgICAgICAgICAgIGVCYW5kID0gcE1hYy0+cm9hbS5jb25maWdQYXJhbS5lQmFuZDsKKyAgICAgICAgICAgICAgICBpZihlQ1NSX0JBTkRfQUxMID09IGVCYW5kKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy9wcmVmZXIgNUdIegorICAgICAgICAgICAgICAgICAgICBlQmFuZCA9IGVDU1JfQkFORF81RzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmICggQ1NSX0lTX0NIQU5ORUxfMjRHSFoob3BlcmF0aW9uQ2huKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZUJhbmQgPSBlQ1NSX0JBTkRfMjQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIAorICAgICAgICAgICAgeyAgIAorICAgICAgICAgICAgICAgIGVCYW5kID0gZUNTUl9CQU5EXzVHOworICAgICAgICAgICAgfQorICAgIH0KKyAgICBpZihwQmFuZCkKKyAgICB7CisgICAgICAgICpwQmFuZCA9IGVCYW5kOworICAgIH0KKyAgICAKKyAgIGlmIChvcGVyYXRpb25DaG4gPT0gMTQpeyAKKyAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgIFN3aXRjaGluZyB0byBEb3QxMUIgbW9kZSAiKSk7CisgICAgIGNmZ0RvdDExTW9kZSA9IGVDU1JfQ0ZHX0RPVDExX01PREVfMTFCOworICAgfQorCisgICAgLyogSW5jYXNlIG9mIFdFUCBTZWN1cml0eSBlbmNyeXB0aW9uIHR5cGUgaXMgY29taW5nIGFzIHBhcnQgb2YgYWRkIGtleS4gU28gd2hpbGUgU1RhcnQgQlNTIGRvbnQgaGF2ZSBpbmZvcm1hdGlvbiAqLworICAgIGlmKCAoIUNTUl9JU18xMW5fQUxMT1dFRChwUHJvZmlsZS0+RW5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VywgRkwoImNzclNlbmRNQlN0b3BCc3NSZXFNc2cgZmFpbGVkIHdpdGggc3RhdHVzICVkIiksIHN0YXR1cyk7CisgICAgfQorICAgIHJldHVybiAoc3RhdHVzKTsKK30KKworLy9wTnVtQ2hhbiBpcyBhIGNhbGxlciBhbGxvY2F0ZWQgc3BhY2Ugd2l0aCB0aGUgc2l6ZW9mIHBDaGFubmVscworZUhhbFN0YXR1cyBjc3JHZXRDZmdWYWxpZENoYW5uZWxzKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggKnBDaGFubmVscywgdEFOSV9VMzIgKnBOdW1DaGFuKQoreworICAgCisgICAgcmV0dXJuIChjY21DZmdHZXRTdHIocE1hYywgV05JX0NGR19WQUxJRF9DSEFOTkVMX0xJU1QsCisgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKXBDaGFubmVscywKKyAgICAgICAgICAgICAgICAgIHBOdW1DaGFuKSk7Cit9CisKK3RQb3dlcmRCbSBjc3JHZXRDZmdNYXhUeFBvd2VyICh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4IGNoYW5uZWwpCit7CisgICAgdEFOSV9VMzIgICAgY2ZnTGVuZ3RoID0gMDsKKyAgICB0QU5JX1UxNiAgICBjZmdJZCA9IDA7CisgICAgdFBvd2VyZEJtICAgbWF4VHhQd3IgPSAwOworICAgIHRBTklfVTggICAgICpwQ291bnRyeUluZm8gPSBOVUxMOworICAgIGVIYWxTdGF0dXMgIHN0YXR1czsKKyAgICB0QU5JX1U4ICAgICBjb3VudCA9IDA7CisgICAgdEFOSV9VOCAgICAgZmlyc3RDaGFubmVsOworICAgIHRBTklfVTggICAgIG1heENoYW5uZWxzOworCisgICAgaWYgKENTUl9JU19DSEFOTkVMXzVHSFooY2hhbm5lbCkpCisgICAgeworICAgICAgICBjZmdJZCA9IFdOSV9DRkdfTUFYX1RYX1BPV0VSXzU7CisgICAgICAgIGNmZ0xlbmd0aCA9IFdOSV9DRkdfTUFYX1RYX1BPV0VSXzVfTEVOOworICAgIH0KKyAgICBlbHNlIGlmIChDU1JfSVNfQ0hBTk5FTF8yNEdIWihjaGFubmVsKSkKKyAgICB7CisgICAgICAgIGNmZ0lkID0gV05JX0NGR19NQVhfVFhfUE9XRVJfMl80OworICAgICAgICBjZmdMZW5ndGggPSBXTklfQ0ZHX01BWF9UWF9QT1dFUl8yXzRfTEVOOworICAgIH0KKyAgICBlbHNlCisgICAgICAgIHJldHVybiAgbWF4VHhQd3I7CisKKyAgICBwQ291bnRyeUluZm8gPSB2b3NfbWVtX21hbGxvYyhjZmdMZW5ndGgpOworICAgIGlmICggTlVMTCA9PSBwQ291bnRyeUluZm8gKQorICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIGVsc2UKKyAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICBpZiAoc3RhdHVzICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgRkwoIiVzOiBmYWlsZWQgdG8gYWxsb2NhdGUgbWVtb3J5LCBzdGF0dXMgPSAlZCIpLAorICAgICAgICAgICAgICBfX0ZVTkNUSU9OX18sIHN0YXR1cyk7CisgICAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorICAgIHN0YXR1cyA9IGNjbUNmZ0dldFN0cihwTWFjLCBjZmdJZCwgKHRBTklfVTggKilwQ291bnRyeUluZm8sICZjZmdMZW5ndGgpOworICAgIGlmIChzdGF0dXMgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorICAgIC8qIElkZW50aWZ5IHRoZSBjaGFubmVsIGFuZCBtYXh0eHBvd2VyICovCisgICAgd2hpbGUgKGNvdW50IDw9IChjZmdMZW5ndGggLSAoc2l6ZW9mKHRTaXJNYWNDaGFuSW5mbykpKSkKKyAgICB7CisgICAgICAgIGZpcnN0Q2hhbm5lbCA9IHBDb3VudHJ5SW5mb1tjb3VudCsrXTsKKyAgICAgICAgbWF4Q2hhbm5lbHMgPSBwQ291bnRyeUluZm9bY291bnQrK107CisgICAgICAgIG1heFR4UHdyID0gcENvdW50cnlJbmZvW2NvdW50KytdOworCisgICAgICAgIGlmICgoY2hhbm5lbCA+PSBmaXJzdENoYW5uZWwpICYmCisgICAgICAgICAgICAoY2hhbm5lbCA8IChmaXJzdENoYW5uZWwgKyBtYXhDaGFubmVscykpKQorICAgICAgICB7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworZXJyb3I6CisgICAgaWYgKE5VTEwgIT0gcENvdW50cnlJbmZvKQorICAgICAgICB2b3NfbWVtX2ZyZWUocENvdW50cnlJbmZvKTsKKworICAgIHJldHVybiBtYXhUeFB3cjsKK30KKworCit0QU5JX0JPT0xFQU4gY3NyUm9hbUlzQ2hhbm5lbFZhbGlkKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4IGNoYW5uZWwgKQoreworICAgIHRBTklfQk9PTEVBTiBmVmFsaWQgPSBGQUxTRTsKKyAgICB0QU5JX1UzMiBpZHhWYWxpZENoYW5uZWxzOworICAgIHRBTklfVTMyIGxlbiA9IHNpemVvZihwTWFjLT5yb2FtLnZhbGlkQ2hhbm5lbExpc3QpOworICAgIAorICAgIGlmIChIQUxfU1RBVFVTX1NVQ0NFU1MoY3NyR2V0Q2ZnVmFsaWRDaGFubmVscyhwTWFjLCBwTWFjLT5yb2FtLnZhbGlkQ2hhbm5lbExpc3QsICZsZW4pKSkKKyAgICB7CisgICAgICAgIGZvciAoIGlkeFZhbGlkQ2hhbm5lbHMgPSAwOyAoIGlkeFZhbGlkQ2hhbm5lbHMgPCBsZW4gKTsgaWR4VmFsaWRDaGFubmVscysrICkKKyAgICAgICAgeworICA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gICAgICAgICAiXHgwMFx4MGZceGFjXHgwMiIsNCkpCisgICAgICAgICAgICAgICAvL0luIENhc2Ugb25seSBXUEExIGlzIHN1cHBvcnRlZCBhbmQgVEtJUCBpcyB0aGUgb25seSBvbmUgY2lwaGVyIHN1aXRlIGluIFVuaWNhc3QuCisgICAgICAgICAgICAgICB8fCggIXBJZXMtPlJTTi5wcmVzZW50ICYmIChwSWVzLT5XUEEucHJlc2VudCAmJiAocEllcy0+V1BBLnVuaWNhc3RfY2lwaGVyX2NvdW50ID09IDEpICYmCisgICAgICAgICAgICAgICAgICFtZW1jbXAoJihwSWVzLT5XUEEudW5pY2FzdF9jaXBoZXJzWzBdWzBdKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJceDAwXHg1MFx4ZjJceDAyIiw0KSkpKQorCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csICIgTm8gY2hhbm5lbCBib25kaW5nIGluIFRLSVAgbW9kZSAiKTsKKyAgICAgICAgICAgICAgICBlUmV0ID0gUEhZX1NJTkdMRV9DSEFOTkVMX0NFTlRFUkVEOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBlbHNlIGlmKHBJZXMtPkhUSW5mby5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIFRoaXMgaXMgY2FsbGVkIGR1cmluZyBJTkZSQSBTVEEvQ0xJRU5UIGFuZCBzaG91bGQgdXNlIHRoZSBtZXJnZWQgdmFsdWUgb2YgCisgICAgICAgICAgICAgICAgICogc3VwcG9ydGVkIGNoYW5uZWwgd2lkdGggYW5kIHJlY29tbWVuZGVkIHR4IHdpZHRoIGFzIHBlciBzdGFuZGFyZAorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCAic2N3cyAldSBydHdzICV1IHNjbyAldSIsCisgICAgICAgICAgICAgICAgICAgIHBJZXMtPkhUQ2Fwcy5zdXBwb3J0ZWRDaGFubmVsV2lkdGhTZXQsCisgICAgICAgICAgICAgICAgICAgIHBJZXMtPkhUSW5mby5yZWNvbW1lbmRlZFR4V2lkdGhTZXQsCisgICAgICAgICAgICAgICAgICAgIHBJZXMtPkhUSW5mby5zZWNvbmRhcnlDaGFubmVsT2Zmc2V0KTsKKworICAgICAgICAgICAgICAgIGlmIChwSWVzLT5IVEluZm8ucmVjb21tZW5kZWRUeFdpZHRoU2V0ID09IGVIVF9DSEFOTkVMX1dJRFRIXzQwTUhaKQorICAgICAgICAgICAgICAgICAgICBlUmV0ID0gKGVQaHlDaGFuQm9uZFN0YXRlKXBJZXMtPkhUSW5mby5zZWNvbmRhcnlDaGFubmVsT2Zmc2V0OworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgZVJldCA9IFBIWV9TSU5HTEVfQ0hBTk5FTF9DRU5URVJFRDsKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKGVSZXQpIHsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBQSFlfRE9VQkxFX0NIQU5ORUxfTE9XX1BSSU1BUlk6CisgICAgICAgICAgICAgICAgICAgICAgICBjZW50ZXJDaG4gPSBwcmltYXJ5Q2huICsgQ1NSX0NCX0NFTlRFUl9DSEFOTkVMX09GRlNFVDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFBIWV9ET1VCTEVfQ0hBTk5FTF9ISUdIX1BSSU1BUlk6CisgICAgICAgICAgICAgICAgICAgICAgICBjZW50ZXJDaG4gPSBwcmltYXJ5Q2huIC0gQ1NSX0NCX0NFTlRFUl9DSEFOTkVMX09GRlNFVDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFBIWV9TSU5HTEVfQ0hBTk5FTF9DRU5URVJFRDoKKyAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGNlbnRlckNobiA9IHByaW1hcnlDaG47CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYoKFBIWV9TSU5HTEVfQ0hBTk5FTF9DRU5URVJFRCAhPSBlUmV0KSAmJiAhY3NyUm9hbUlzVmFsaWQ0ME1oekNoYW5uZWwocE1hYywgY2VudGVyQ2huKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCAiICBJbnZhbGlkIGNlbnRlciBjaGFubmVsICglZCksIGRpc2FibGUgNDBNSHogbW9kZSIsIGNlbnRlckNobik7CisgICAgICAgICAgICAgICAgICAgIGVSZXQgPSBQSFlfU0lOR0xFX0NIQU5ORUxfQ0VOVEVSRUQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICgoQ1NSX0lTX0NIQU5ORUxfMjRHSFoocHJpbWFyeUNobikpJiYgIUlTX0hUNDBfT0JTU19TQ0FOX0ZFQVRVUkVfRU5BQkxFKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsRkwoIkZXIGRvZXNuJ3Qgc3VwcG9ydCBjaGFubmVsQm9uZGluZ01vZGUyNEdIeiIpKTsKKyAgICAgICAgICAgICAgICAgICAgZVJldCA9IFBIWV9TSU5HTEVfQ0hBTk5FTF9DRU5URVJFRDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIGVSZXQ7Cit9Cit0QU5JX0JPT0xFQU4gY3NySXNFbmNyeXB0aW9uSW5MaXN0KCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0Q3NyRW5jcnlwdGlvbkxpc3QgKnBDaXBoZXJMaXN0LCBlQ3NyRW5jcnlwdGlvblR5cGUgZW5jcnlwdGlvblR5cGUgKQoreworICAgIHRBTklfQk9PTEVBTiBmRm91bmQgPSBGQUxTRTsKKyAgICB0QU5JX1UzMiBpZHg7CisgICAgZm9yKCBpZHggPSAwOyBpZHggPCBwQ2lwaGVyTGlzdC0+bnVtRW50cmllczsgaWR4KysgKQorICAgIHsKKyAgICAgICAgaWYoIHBDaXBoZXJMaXN0LT5lbmNyeXB0aW9uVHlwZVtpZHhdID09IGVuY3J5cHRpb25UeXBlICkKKyAgICAgICAgeworICAgICAgICAgICAgZkZvdW5kID0gVFJVRTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiBmRm91bmQ7Cit9Cit0QU5JX0JPT0xFQU4gY3NySXNBdXRoSW5MaXN0KCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0Q3NyQXV0aExpc3QgKnBBdXRoTGlzdCwgZUNzckF1dGhUeXBlIGF1dGhUeXBlICkKK3sKKyAgICB0QU5JX0JPT0xFQU4gZkZvdW5kID0gRkFMU0U7CisgICAgdEFOSV9VMzIgaWR4OworICAgIGZvciggaWR4ID0gMDsgaWR4IDwgcEF1dGhMaXN0LT5udW1FbnRyaWVzOyBpZHgrKyApCisgICAgeworICAgICAgICBpZiggcEF1dGhMaXN0LT5hdXRoVHlwZVtpZHhdID09IGF1dGhUeXBlICkKKyAgICAgICAgeworICAgICAgICAgICAgZkZvdW5kID0gVFJVRTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiBmRm91bmQ7Cit9Cit0QU5JX0JPT0xFQU4gY3NySXNTYW1lUHJvZmlsZSh0cEFuaVNpckdsb2JhbCBwTWFjLCB0Q3NyUm9hbUNvbm5lY3RlZFByb2ZpbGUgKnBQcm9maWxlMSwgdENzclJvYW1Qcm9maWxlICpwUHJvZmlsZTIpCit7CisgICAgdEFOSV9CT09MRUFOIGZDaGVjayA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICB0Q3NyU2NhblJlc3VsdEZpbHRlciAqcFNjYW5GaWx0ZXIgPSBOVUxMOworICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAKKyAgICBpZihwUHJvZmlsZTEgJiYgcFByb2ZpbGUyKQorICAgIHsKKyAgICAgICAgcFNjYW5GaWx0ZXIgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodENzclNjYW5SZXN1bHRGaWx0ZXIpKTsKKyAgICAgICAgaWYgKCBOVUxMID09IHBTY2FuRmlsdGVyICkKKyAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgZWxzZQorICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9zZXQocFNjYW5GaWx0ZXIsIHNpemVvZih0Q3NyU2NhblJlc3VsdEZpbHRlciksIDApOworICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbVByZXBhcmVGaWx0ZXJGcm9tUHJvZmlsZShwTWFjLCBwUHJvZmlsZTIsIHBTY2FuRmlsdGVyKTsKKyAgICAgICAgICAgIGlmKEhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGZDaGVjayA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgICAgICBkbworICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgaTsKKyAgICAgICAgICAgICAgICAgICAgZm9yKGkgPSAwOyBpIDwgcFNjYW5GaWx0ZXItPlNTSURzLm51bU9mU1NJRHM7IGkrKykKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZkNoZWNrID0gY3NySXNTc2lkTWF0Y2goIHBNYWMsIHBTY2FuRmlsdGVyLT5TU0lEcy5TU0lETGlzdFtpXS5TU0lELnNzSWQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjYW5GaWx0ZXItPlNTSURzLlNTSURMaXN0W2ldLlNTSUQubGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByb2ZpbGUxLT5TU0lELnNzSWQsIHBQcm9maWxlMS0+U1NJRC5sZW5ndGgsIGVBTklfQk9PTEVBTl9GQUxTRSApOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCBmQ2hlY2sgKSBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZighZkNoZWNrKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiggIWNzcklzQXV0aEluTGlzdCggcE1hYywgJnBQcm9maWxlMi0+QXV0aFR5cGUsIHBQcm9maWxlMS0+QXV0aFR5cGUpCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBwUHJvZmlsZTItPkJTU1R5cGUgIT0gcFByb2ZpbGUxLT5CU1NUeXBlCisgICAgICAgICAgICAgICAgICAgICAgICB8fCAhY3NySXNFbmNyeXB0aW9uSW5MaXN0KCBwTWFjLCAmcFByb2ZpbGUyLT5FbmNyeXB0aW9uVHlwZSwgcFByb2ZpbGUxLT5FbmNyeXB0aW9uVHlwZSApCisgICAgICAgICAgICAgICAgICAgICAgICApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZDaGVjayA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisjaWZkZWYgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIKKyAgICAgICAgICAgICAgICAgICAgaWYgKHBQcm9maWxlMS0+TURJRC5tZGllUHJlc2VudCB8fCBwUHJvZmlsZTItPk1ESUQubWRpZVByZXNlbnQpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwUHJvZmlsZTEtPk1ESUQubW9iaWxpdHlEb21haW4gIT0gcFByb2ZpbGUyLT5NRElELm1vYmlsaXR5RG9tYWluKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZDaGVjayA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgIC8vTWF0Y2ggZm91bmQKKyAgICAgICAgICAgICAgICAgICAgZkNoZWNrID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICAgICAgfXdoaWxlKDApOworICAgICAgICAgICAgICAgIGNzckZyZWVTY2FuRmlsdGVyKHBNYWMsIHBTY2FuRmlsdGVyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgdm9zX21lbV9mcmVlKHBTY2FuRmlsdGVyKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICByZXR1cm4gKGZDaGVjayk7Cit9CisKK3RBTklfQk9PTEVBTiBjc3JSb2FtSXNTYW1lUHJvZmlsZUtleXModHBBbmlTaXJHbG9iYWwgcE1hYywgdENzclJvYW1Db25uZWN0ZWRQcm9maWxlICpwQ29ublByb2ZpbGUsIHRDc3JSb2FtUHJvZmlsZSAqcFByb2ZpbGUyKQoreworICAgIHRBTklfQk9PTEVBTiBmQ2hlY2sgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgaW50IGk7CisgICAgZG8KKyAgICB7CisgICAgICAgIC8vT25seSBjaGVjayBmb3Igc3RhdGljIFdFUAorICAgICAgICBpZighY3NySXNFbmNyeXB0aW9uSW5MaXN0KHBNYWMsICZwUHJvZmlsZTItPkVuY3J5cHRpb25UeXBlLCBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVA0MF9TVEFUSUNLRVkpICYmCisgICAgICAgICAgICAhY3NySXNFbmNyeXB0aW9uSW5MaXN0KHBNYWMsICZwUHJvZmlsZTItPkVuY3J5cHRpb25UeXBlLCBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVAxMDRfU1RBVElDS0VZKSkKKyAgICAgICAgeworICAgICAgICAgICAgZkNoZWNrID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBpZighY3NySXNFbmNyeXB0aW9uSW5MaXN0KHBNYWMsICZwUHJvZmlsZTItPkVuY3J5cHRpb25UeXBlLCBwQ29ublByb2ZpbGUtPkVuY3J5cHRpb25UeXBlKSkgYnJlYWs7CisgICAgICAgIGlmKHBDb25uUHJvZmlsZS0+S2V5cy5kZWZhdWx0SW5kZXggIT0gcFByb2ZpbGUyLT5LZXlzLmRlZmF1bHRJbmRleCkgYnJlYWs7CisgICAgICAgIGZvcihpID0gMDsgaSA8IENTUl9NQVhfTlVNX0tFWTsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICBpZihwQ29ublByb2ZpbGUtPktleXMuS2V5TGVuZ3RoW2ldICE9IHBQcm9maWxlMi0+S2V5cy5LZXlMZW5ndGhbaV0pIGJyZWFrOworICAgICAgICAgICAgaWYgKCF2b3NfbWVtX2NvbXBhcmUoJnBDb25uUHJvZmlsZS0+S2V5cy5LZXlNYXRlcmlhbFtpXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBQcm9maWxlMi0+S2V5cy5LZXlNYXRlcmlhbFtpXSwgcFByb2ZpbGUyLT5LZXlzLktleUxlbmd0aFtpXSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg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keCA8IENTUl9OVU1fSUJTU19TVEFSVF9DSEFOTkVMU181MCApICYmICFmRm91bmQ7IGlkeCsrICkgCisgICAgICAgIHsKKyAgICAgICAgICAgIGZvciAoIGlkeFZhbGlkQ2hhbm5lbHMgPSAwOyAoIGlkeFZhbGlkQ2hhbm5lbHMgPCBsZW4gKSAmJiAhZkZvdW5kOyBpZHhWYWxpZENoYW5uZWxzKysgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICggY3NyU3RhcnRJYnNzQ2hhbm5lbHM1MFsgaWR4IF0gPT0gcE1hYy0+cm9hbS52YWxpZENoYW5uZWxMaXN0WyBpZHhWYWxpZENoYW5uZWxzIF0gKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgZkZvdW5kID0gVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgY2hhbm5lbCA9IGNzclN0YXJ0SWJzc0NoYW5uZWxzNTBbIGlkeCBdOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAvLyB0aGlzIGlzIHJhcmUsIGJ1dCBpZiBpdCBkb2VzIGhhcHBlbiwgd2UgZmluZCBhbnlvbmUgaW4gMTFhIGJhbmR3aWR0aCBhbmQgcmV0dXJuIHRoZSBmaXJzdCAxMWEgY2hhbm5lbCBmb3VuZCEKKyAgICAgICAgaWYgKCFmRm91bmQpICAgIAorICAgICAgICB7CisgICAgICAgICAgICBmb3IgKCBpZHhWYWxpZENoYW5uZWxzID0gMDsgaWR4VmFsaWRDaGFubmVscyA8IGxlbiA7IGlkeFZhbGlkQ2hhbm5lbHMrKyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKCBDU1JfSVNfQ0hBTk5FTF81R0haKHBNYWMtPnJvYW0udmFsaWRDaGFubmVsTGlzdFsgaWR4VmFsaWRDaGFubmVscyBdKSApICAgLy8gdGhlIG1heCBjaGFubmVsIyBpbiAxMWcgaXMgMTQKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGNoYW5uZWwgPSBwTWFjLT5yb2FtLnZhbGlkQ2hhbm5lbExpc3RbIGlkeFZhbGlkQ2hhbm5lbHMgXTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfS8vaWYKKyAgICAKKyAgICByZXR1cm4oIGNoYW5uZWwgKTsgICAgCit9CisKK3RBTklfVTggY3NyUm9hbUdldElic3NTdGFydENoYW5uZWxOdW1iZXIyNCggdHBBbmlTaXJHbG9iYWwgcE1hYyApCit7CisgICAgdEFOSV9VOCBjaGFubmVsID0gMTsKKyAgICB0QU5JX1UzMiBpZHg7CisgICAgdEFOSV9VMzIgaWR4VmFsaWRDaGFubmVsczsKKyAgICB0QU5JX0JPT0xFQU4gZkZvdW5kID0gRkFMU0U7CisgICAgdEFOSV9VMzIgbGVuID0gc2l6ZW9mKHBNYWMtPnJvYW0udmFsaWRDaGFubmVsTGlzdCk7CisgICAgCisgICAgaWYoZUNTUl9PUEVSQVRJTkdfQ0hBTk5FTF9BTlkgIT0gcE1hYy0+cm9hbS5jb25maWdQYXJhbS5BZEhvY0NoYW5uZWwyNCkKKyAgICB7CisgICAgICAgIGNoYW5uZWwgPSBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLkFkSG9jQ2hhbm5lbDI0OworICAgICAgICBpZighY3NyUm9hbUlzQ2hhbm5lbFZhbGlkKHBNYWMsIGNoYW5uZWwpKQorICAgICAgICB7CisgICAgICAgICAgICBjaGFubmVsID0gMDsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBpZiAoMCA9PSBjaGFubmVsICYmIEhBTF9TVEFUVVNfU1VDQ0VTUyhjc3JHZXRDZmdWYWxpZENoYW5uZWxzKHBNYWMsICh0QU5JX1U4ICopcE1hYy0+cm9hbS52YWxpZENoYW5uZWxMaXN0LCAmbGVuKSkpCisgICAgeworICAgICAgICBmb3IgKCBpZHggPSAwOyAoIGlkeCA8IENTUl9OVU1fSUJTU19TVEFSVF9DSEFOTkVMU18yNCApICYmICFmRm91bmQ7IGlkeCsrICkgCisgICAgICAgIHsKKyAgICAgICAgICAgIGZvciAoIGlkeFZhbGlkQ2hhbm5lbHMgPSAwOyAoIGlkeFZhbGlkQ2hhbm5lbHMgPCBsZW4gKSAmJiAhZkZvdW5kOyBpZHhWYWxpZENoYW5uZWxzKysgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICggY3NyU3RhcnRJYnNzQ2hhbm5lbHMyNFsgaWR4IF0gPT0gcE1hYy0+cm9hbS52YWxpZENoYW5uZWxMaXN0WyBpZHhWYWxpZENoYW5uZWxzIF0gKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgZkZvdW5kID0gVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgY2hhbm5lbCA9IGNzclN0YXJ0SWJzc0NoYW5uZWxzMjRbIGlkeCBdOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICByZXR1cm4oIGNoYW5uZWwgKTsgICAgCit9CisKK3N0YXRpYyB2b2lkIGNzclJvYW1HZXRCc3NTdGFydFBhcm1zKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0Q3NyUm9hbVByb2ZpbGUgKnBQcm9maWxlLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdENzclJvYW1TdGFydEJzc1BhcmFtcyAqcFBhcmFtICkKK3sKKyAgICBlQ3NyQ2ZnRG90MTFNb2RlIGNmZ0RvdDExTW9kZTsKKyAgICBlQ3NyQmFuZCBlQmFuZDsKKyAgICB0QU5JX1U4IGNoYW5uZWwgPSAwOworICAgIHRTaXJOd1R5cGUgbndUeXBlOworICAgIHRBTklfVTggb3BlcmF0aW9uQ2hhbm5lbCA9IDA7IAorICAgIAorICAgIGlmKHBQcm9maWxlLT5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzICYmIHBQcm9maWxlLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdCkKKyAgICB7CisgICAgICAgb3BlcmF0aW9uQ2hhbm5lbCA9IHBQcm9maWxlLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdFswXTsKKyAgICB9CisgICAgCisgICAgY2ZnRG90MTFNb2RlID0gY3NyUm9hbUdldFBoeU1vZGVCYW5kRm9yQnNzKCBwTWFjLCBwUHJvZmlsZSwgb3BlcmF0aW9uQ2hhbm5lbCwgJmVCYW5kICk7CisgICAgCisgICAgaWYoICggKHBQcm9maWxlLT5jc3JQZXJzb25hID09IFZPU19QMlBfQ0xJRU5UX01PREUpIHx8CisgICAgICAgICAgKHBQcm9maWxlLT5jc3JQZXJzb25hID09IFZPU19QMlBfR09fTU9ERSkgKQorICAgICAmJiAoIGNmZ0RvdDExTW9kZSA9PSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQikKKyAgICAgICkKKyAgICB7CisgICAgICAgIC8qIFRoaXMgc2hvdWxkIG5ldmVyIGhhcHBlbiAqLworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwgCisgICAgICAgICAgICAgIEZMKCJGb3IgUDJQQ2xpZW50L1AyUC1HTyAocGVyc29uYSAlZCkgY2ZnRG90MTFNb2RlIGlzIDExQiIpLAorICAgICAgICAgICAgICBwUHJvZmlsZS0+Y3NyUGVyc29uYSk7CisgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgfQorICAgIHN3aXRjaCggY2ZnRG90MTFNb2RlICkKKyAgICB7CisgICAgICAgIGNhc2UgZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUc6CisgICAgICAgICAgICBud1R5cGUgPSBlU0lSXzExR19OV19UWVBFOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUI6CisgICAgICAgICAgICBud1R5cGUgPSBlU0lSXzExQl9OV19UWVBFOworICAgICAgICAgICAgYnJlYWs7ICAgCisgICAgICAgIGNhc2UgZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUE6CisgICAgICAgICAgICBud1R5cGUgPSBlU0lSXzExQV9OV19UWVBFOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgIGNhc2UgZUNTUl9DRkdfRE9UMTFfTU9ERV8xMU46CisgICAgICAgIGNhc2UgZUNTUl9DRkdfRE9UMTFfTU9ERV9UQVVSVVM6CisgICAgICAgICAgICAvL0JlY2F1c2UgTElNIG9ubHkgdmVyaWZpZXMgaXQgYWdhaW5zdCAxMWEsIDExYiBvciAxMWcsIHNldCBvbmx5IDExZyBvciAxMWEgaGVyZQorICAgICAgICAgICAgaWYoZUNTUl9CQU5EXzI0ID09IGVCYW5kKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG53VHlwZSA9IGVTSVJfMTFHX05XX1RZUEU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbndUeXBlID0gZVNJUl8xMUFfTldfVFlQRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgIH0gICAKKworICAgIHBQYXJhbS0+ZXh0ZW5kZWRSYXRlU2V0Lm51bVJhdGVzID0gMDsKKworICAgIHN3aXRjaCAoIG53VHlwZSApCisgICAgeworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJzZWVzIGFuIHVua25vd24gcFNpck53VHlwZSAoJWQpIiksIG53VHlwZSk7CisgICAgICAgIGNhc2UgZVNJUl8xMUFfTldfVFlQRToKKyAgICAgICAgCisgICAgICAgICAgICBwUGFyYW0tPm9wZXJhdGlvbmFsUmF0ZVNldC5udW1SYXRlcyA9IDg7CisgICAgICAgIAorICA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DExX0JBU0lDX1JBVEVfTUFTSzsKKyAgICAgICAgICAgICAgICAgICBwUGFyYW0tPm9wZXJhdGlvbmFsUmF0ZVNldC5yYXRlWzNdID0gU0lSX01BQ19SQVRFXzExIHwgQ1NSX0RPVDExX0JBU0lDX1JBVEVfTUFTSzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNoYW5uZWwgPSBvcGVyYXRpb25DaGFubmVsOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAKKyAgICAgICAgY2FzZSBlU0lSXzExQl9OV19UWVBFOgorICAgICAgICAgICAgcFBhcmFtLT5vcGVyYXRpb25hbFJhdGVTZXQubnVtUmF0ZXMgPSA0OworICAgICAgICAgICAgcFBhcmFtLT5vcGVyYXRpb25hbFJhdGVTZXQucmF0ZVswXSA9IFNJUl9NQUNfUkFURV8xIHwgQ1NSX0RPVDExX0JBU0lDX1JBVEVfTUFTSzsKKyAgICAgICAgICAgIHBQYXJhbS0+b3BlcmF0aW9uYWxSYXRlU2V0LnJhdGVbMV0gPSBTSVJfTUFDX1JBVEVfMiB8IENTUl9ET1QxMV9CQVNJQ19SQVRFX01BU0s7CisgICAgICAgICAgICBwUGFyYW0tPm9wZXJhdGlvbmFsUmF0ZVNldC5yYXRlWzJdID0gU0lSX01BQ19SQVRFXzVfNSB8IENTUl9ET1QxMV9CQVNJQ19SQVRFX01BU0s7CisgICAgICAgICAgICBwUGFyYW0tPm9wZXJhdGlvbmFsUmF0ZVNldC5yYXRlWzNdID0gU0lSX01BQ19SQVRFXzExIHwgQ1NSX0RPVDExX0JBU0lDX1JBVEVfTUFTSzsKKyAgICAgICAgICAgIGlmICggZUNTUl9PUEVSQVRJTkdfQ0hBTk5FTF9BTlkgPT0gb3BlcmF0aW9uQ2hhbm5lbCApIAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNoYW5uZWwgPSBjc3JSb2FtR2V0SWJzc1N0YXJ0Q2hhbm5lbE51bWJlcjI0KCBwTWFjICk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNoYW5uZWwgPSBvcGVyYXRpb25DaGFubmVsOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBicmVhazsgICAgIAorICAgICAgICBjYXNlIGVTSVJfMTFHX05XX1RZUEU6CisgICAgICAgICAgICAvKiBGb3IgUDJQIENsaWVudCBhbmQgUDJQIEdPLCBkaXNhYmxlIDExYiByYXRlcyAqLyAKKyAgICAgICAgICAgIGlmKCAocFByb2ZpbGUtPmNzclBlcnNvbmEgPT0gVk9TX1AyUF9DTElFTlRfTU9ERSkgfHwKKyAgICAgICAgICAgICAgICAocFByb2ZpbGUtPmNzclBlcnNvbmEgPT0gVk9TX1AyUF9HT19NT0RFKQorICAgICAgICAgICAgICApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFBhcmFtLT5vcGVyYXRpb25hbFJhdGVTZXQubnVtUmF0ZXMgPSA4OworICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgcFBhcmFtLT5vcGVyYXRpb25hbFJhdGVTZXQucmF0ZVswXSA9IFNJUl9NQUNfUkFURV82IHwgQ1NSX0RPVDExX0JBU0lDX1JBVEVfTUFTSzsKKyAgICAgICAgICAgICAgICBwUGFyYW0tPm9wZXJhdGlvbmFsUmF0ZVNldC5yYXRlWzFdID0gU0lSX01BQ19SQVRFXzk7CisgICAgICAgICAgICAgICAgcFBhcmFtLT5vcGVyYXRpb25hbFJhdGVTZXQucmF0ZVsyXSA9IFNJUl9NQUNfUkFURV8xMiB8IENTUl9ET1QxMV9CQVNJQ19SQVRFX01BU0s7CisgICAgICAgICAgICAgICAgcFBhcmFtLT5vcGVyYXRpb25hbFJhdGVTZXQucmF0ZVszXSA9IFNJUl9NQUNfUkFURV8xODsKKyAgICA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ICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGJyZWFrOyAgICAgICAgICAgIAorICAgIH0KKyAgICBwUGFyYW0tPm9wZXJhdGlvbkNobiA9IGNoYW5uZWw7CisgICAgcFBhcmFtLT5zaXJOd1R5cGUgPSBud1R5cGU7Cit9CisKK3N0YXRpYyB2b2lkIGNzclJvYW1HZXRCc3NTdGFydFBhcm1zRnJvbUJzc0Rlc2MoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRTaXJCc3NEZXNjcmlwdGlvbiAqcEJzc0Rlc2MsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZCZWFjb25JRXMgKnBJZXMsIHRDc3JSb2FtU3RhcnRCc3NQYXJhbXMgKnBQYXJhbSApCit7CisgICAgCisgICAgaWYoIHBQYXJhbSApCisgICAgeworICAgICAgICBwUGFyYW0tPnNpck53VHlwZSA9IHBCc3NEZXNjLT5ud1R5cGU7CisgICAgICAgIHBQYXJhbS0+Y2JNb2RlID0gUEhZX1NJTkdMRV9DSEFOTkVMX0NFTlRFUkVEOworICAgICAgICBwUGFyYW0tPm9wZXJhdGlvbkNobiA9IHBCc3NEZXNjLT5jaGFubmVsSWQ7CisgICAgICAgIHZvc19tZW1fY29weSgmcFBhcmFtLT5ic3NpZCwgcEJzc0Rlc2MtPmJzc0lkLCBzaXplb2YodENzckJzc2lkKSk7CisgICAgCisgICAgICAgIGlmKCBwSWVzICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYocEllcy0+U3VwcFJhdGVzLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFBhcmFtLT5vcGVyYXRpb25hbFJhdGVTZXQubnVtUmF0ZXMgPSBwSWVzLT5TdXBwUmF0ZXMubnVtX3JhdGVzOworICAgICAgICAgICAgICAgIGlmKHBJZXMtPlN1cHBSYXRlcy5udW1fcmF0ZXMgPiBTSVJfTUFDX1JBVEVTRVRfRUlEX01BWCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgibnVtX3JhdGVzIDolZCBpcyBtb3JlIHRoYW4gU0lSX01BQ19SQVRFU0VUX0VJRF9NQVgsIHJlc2V0dGluZyB0byBTSVJfTUFDX1JBVEVTRVRfRUlEX01BWCIpLAorICAgICAgICAgICAgICAgICAgICAgIHBJZXMtPlN1cHBSYXRlcy5udW1fcmF0ZXMpOworICAgICAgICAgICAgICAgICAgICBwSWVzLT5TdXBwUmF0ZXMubnVtX3JhdGVzID0gU0lSX01BQ19SQVRFU0VUX0VJRF9NQVg7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwUGFyYW0tPm9wZXJhdGlvbmFsUmF0ZVNldC5yYXRlLCBwSWVzLT5TdXBwUmF0ZXMucmF0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZigqcEllcy0+U3VwcFJhdGVzLnJhdGVzKSAqIHBJZXMtPlN1cHBSYXRlcy5udW1fcmF0ZXMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHBJZXMtPkV4dFN1cHBSYXRlcy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBQYXJhbS0+ZXh0ZW5kZWRSYXRlU2V0Lm51bVJhdGVzID0gcEllcy0+RXh0U3VwcFJhdGVzLm51bV9yYXRlczsKKyAgICAgICAgICAgICAgICBpZihwSWVzLT5FeHRTdXBwUmF0ZXMubnVtX3JhdGVzID4gU0lSX01BQ19SQVRFU0VUX0VJRF9NQVgpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgibnVtX3JhdGVzIDolZCBpcyBtb3JlIHRoYW4gXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX1JBVEVTRVRfRUlEX01BWCwgcmVzZXR0aW5nIHRvIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0lSX01BQ19SQVRFU0VUX0VJRF9NQVgiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllcy0+RXh0U3VwcFJhdGVzLm51bV9yYXRlcyk7CisgICAgICAgICAgICAgICAgICAgcEllcy0+RXh0U3VwcFJhdGVzLm51bV9yYXRlcyA9IFNJUl9NQUNfUkFURVNFVF9FSURfTUFYOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocFBhcmFtLT5leHRlbmRlZFJhdGVTZXQucmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZXMtPkV4dFN1cHBSYXRlcy5yYXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZigqcEllcy0+RXh0U3VwcFJhdGVzLnJhdGVzKSAqIHBJZXMtPkV4dFN1cHBSYXRlcy5udW1fcmF0ZXMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYoIHBJZXMtPlNTSUQucHJlc2VudCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFBhcmFtLT5zc0lkLmxlbmd0aCA9IHBJZXMtPlNTSUQubnVtX3NzaWQ7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBQYXJhbS0+c3NJZC5zc0lkLCBwSWVzLT5TU0lELnNzaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQYXJhbS0+c3NJZC5sZW5ndGgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcFBhcmFtLT5jYk1vZGUgPSBjc3JHZXRDQk1vZGVGcm9tSWVzKHBNYWMsIHBQYXJhbS0+b3BlcmF0aW9uQ2huLCBwSWVzKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHBQYXJhbS0+c3N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dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIGVDc3JCYW5kIGVCYW5kOworICAgIC8vIFNldCB0aGUgcm9hbWluZyBzdWJzdGF0ZSB0byAnU3RhcnQgQlNTIGF0dGVtcHQnLi4uCisgICAgY3NyUm9hbVN1YnN0YXRlQ2hhbmdlKCBwTWFjLCBlQ1NSX1JPQU1fU1VCU1RBVEVfU1RBUlRfQlNTX1JFUSwgc2Vzc2lvbklkICk7CisjaWZkZWYgRkVBVFVSRV9XTEFOX0RJQUdfU1VQUE9SVF9DU1IKKyAgICAvL05lZWQgdG8gZmlndXJlIG91dCB3aGV0aGVyIHdlIG5lZWQgdG8gbG9nIFdEUz8/PworICAgIGlmKCBDU1JfSVNfSUJTUyggcFByb2ZpbGUgKSApCisgICAgeworICAgICAgICB2b3NfbG9nX2lic3NfcGt0X3R5cGUgKnBJYnNzTG9nOworICAgICAgICBXTEFOX1ZPU19ESUFHX0xPR19BTExPQyhwSWJzc0xvZywgdm9zX2xvZ19pYnNzX3BrdF90eXBlLCBMT0dfV0xBTl9JQlNTX0MpOworICAgICAgICBpZihwSWJzc0xvZykKKyAgICAgICAgeworICAgICAgICAgICAgaWYocEJzc0Rlc2MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcElic3NMb2ctPmV2ZW50SWQgPSBXTEFOX0lCU1NfRVZFTlRfSk9JTl9JQlNTX1JFUTsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocElic3NMb2ctPmJzc2lkLCBwQnNzRGVzYy0+YnNzSWQsIDYpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBJYnNzTG9nLT5ldmVudElkID0gV0xBTl9JQlNTX0VWRU5UX1NUQVJUX0lCU1NfUkVROworICAgICAgICAgICAgfQorICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBJYnNzTG9nLT5zc2lkLCBwUGFyYW0tPnNzSWQuc3NJZCwg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BwUHJvZmlsZS0+U1NJRHMuU1NJRExpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNTU2lkKSk7CisgICAgICAgIH0KKyAgICAgICAgLy9Gb3IgV0RTIHN0YXRpb24sIHVzZSBzZWxmTWFjIGFzIHRoZSBzZWxmIEJTU0lECisgICAgICAgIGlmKCBDU1JfSVNfV0RTX1NUQSggcFByb2ZpbGUgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwU2Vzc2lvbi0+YnNzUGFyYW1zLmJzc2lkLCAmcFNlc3Npb24tPnNlbGZNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRDc3JCc3NpZCkpOworICAgICAgICB9CisgICAgICAgIC8vVXNlIHRoZSBmaXJzdCBCU1NJRAorICAgICAgICBlbHNlIGlmKCBwUHJvZmlsZS0+QlNTSURzLm51bU9mQlNTSURzICkKKyAgICAgICAgeworICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnBTZXNzaW9uLT5ic3NQYXJhbXMuYnNzaWQsIHBQcm9maWxlLT5CU1NJRHMuYnNzaWQsCisgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodENzckJzc2lkKSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX3NldCgmcFNlc3Npb24tPmJzc1BhcmFtcy5ic3NpZCwgc2l6ZW9mKHRDc3JCc3NpZCksIDApOworICAgICAgICB9CisgICAgfQorICAgIENoYW5uZWwgPSBwU2Vzc2lvbi0+YnNzUGFyYW1zLm9wZXJhdGlvbkNobjsKKyAgICAvL1NldCBvcGVyYXRpbmcgY2hhbm5lbCBpbiBwUHJvZmlsZSB3aGljaCB3aWxsIGJlIHVzZWQgCisgICAgLy9pbiBjc3JSb2FtU2V0QnNzQ29uZmlnQ2ZnKCkgdG8gZGV0ZXJtaW5lIGNoYW5uZWwgYm9uZGluZ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cFByb2ZpbGUgKSApIAorICAgICAgICB7CisgICAgICAgICAgICBmU2FtZUlic3MgPSBUUlVFOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbUlzc3VlU3RvcEJzcyggcE1hYywgc2Vzc2lvbklkLCBlQ1NSX1JPQU1fU1VCU1RBVEVfRElTQ09OTkVDVF9DT05USU5VRV9ST0FNSU5HICk7CisgICAgICAgIH0gICAgICAgCisgICAgfQorICAgIGVsc2UgaWYgKCBjc3JJc0Nvbm5TdGF0ZUNvbm5lY3RlZEluZnJhKCBwTWFjLCBzZXNzaW9uSWQgKSApIAorICAgIHsKKyAgICAgICAgLy8gRGlzYXNzb2NpYXRlIGZyb20gdGhlIGNvbm5lY3RlZCBJbmZyYXN0cnVjdHVyZSBuZXR3b3JrLi4uCisgICAgICAgIHN0YXR1cyA9IGNzclJvYW1Jc3N1ZURpc2Fzc29jaWF0ZSggcE1hYywgc2Vzc2lvbklkLCBlQ1NSX1JPQU1fU1VCU1RBVEVfRElTQ09OTkVDVF9DT05USU5VRV9ST0FNSU5HLCBGQUxTRSApOworICAgIH0KKyAgICBlbHNlIAorICAgIHsKKyAgICAgICAgdEJzc0NvbmZpZ1BhcmFtICpwQnNzQ29uZmlnOworICAgICAgICAKKyAgICAgICAgcEJzc0NvbmZpZyA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0QnNzQ29uZmlnUGFyYW0pKTsKKyAgICAgICAgaWYgKCBOVUxMID09IHBCc3NDb25maWcgKQorICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICBlbHNlCisgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgIGlmKEhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX3NldChwQnNzQ29uZmlnLCBza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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwgcEJzc0NvbmZpZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsIGVBTklfQk9PTEVBTl9GQUxTRSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwQnNzQ29uZmlnKTsKKyAgICAgICAgfS8vQWxsb2NhdGUgbWVtb3J5CisgICAgfQorICAgIAorICAgIGlmKHBmU2FtZUlic3MpCisgICAgeworICAgICAgICAqcGZTYW1lSWJzcyA9IGZTYW1lSWJzczsKKyAgICB9CisgICAgcmV0dXJuKCBzdGF0dXMgKTsKK30KKworc3RhdGljIHZvaWQgY3NyUm9hbVVwZGF0ZUNvbm5lY3RlZFByb2ZpbGVGcm9tTmV3QnNzKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UzMiBzZXNzaW9uSWQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyU21lTmV3QnNzSW5mbyAqcE5ld0JzcyApCit7CisgICAgdENzclJvYW1TZXNzaW9uICpwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTiggcE1hYywgc2Vzc2lvbklkICk7CisKKyAgICBpZighcFNlc3Npb24pCisgICAgeworICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiAgc2Vzc2lvbiAlZCBub3QgZm91bmQgIiksIHNlc3Npb25JZCk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgCisgICAgaWYoIHBOZXdCc3MgKQorICAgIHsKKyAgICAgICAgLy8gU2V0IHRoZSBvcGVyYXRpbmcgY2hhbm5lbC4KKyAgICAgICAgcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUub3BlcmF0aW9uQ2hhbm5lbCA9IHBOZXdCc3MtPmNoYW5uZWxOdW1iZXI7CisgICAgICAgIC8vIG1vdmUgdGhlIEJT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0NFU1M7CisgICAgICAgLy9udW1JdGVtcyBtYXkgYmUgMCB0byBjbGVhciB0aGUgY2FjaGUKKyAgICAgICBwU2Vzc2lvbi0+TnVtQmtpZENhY2hlID0gKHRBTklfVTE2KW51bUl0ZW1zOworICAgICAgIGlmKG51bUl0ZW1zICYmIHBCS0lEQ2FjaGUpCisgICAgICAgeworICAgICAgICAgICB2b3NfbWVtX2NvcHkocFNlc3Npb24tPkJraWRDYWNoZUluZm8sIHBCS0lEQ2FjaGUsCisgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodEJraWRDYWNoZUluZm8pICogbnVtSXRlbXMpOworICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgIH0KKyAgIH0KKyAgIHJldHVybiAoc3RhdHVzKTsKK30KK2VIYWxTdGF0dXMgY3NyUm9hbUdldEJLSURDYWNoZSh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UzMiBzZXNzaW9uSWQsIHRBTklfVTMyICpwTnVtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QmtpZENhY2hlSW5mbyAqcEJraWRDYWNoZSkKK3sKKyAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfSU5WQUxJRF9QQVJBTUVURVI7CisgICB0Q3NyUm9hbVNlc3Npb24gKnBTZXNzaW9uOworICAgaWYoIUNTUl9JU19TRVNTSU9OX1ZBTElEKCBwTWFjLCBzZXNzaW9uSWQgKSkKKyAgIHsKKyAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiAgSW52YWxpZCBzZXNzaW9uIElEIikpOworICAgICAgIHJldHVybiBzdGF0dXM7CisgICB9CisgICBwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTiggcE1hYywgc2Vzc2lvbklkICk7CisgICBpZihwTnVtICYmIHBCa2lkQ2FjaGUpCisgICB7CisgICAgICAgaWYocFNlc3Npb24tPk51bUJraWRDYWNoZSA9PSAwKQorICAgICAgIHsKKyAgICAgICAgICAgKnBOdW0gPSAwOworICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgIH0KKyAgICAgICBlbHNlIGlmKCpwTnVtID49IHBTZXNzaW9uLT5OdW1Ca2lkQ2FjaGUpCisgICAgICAgeworICAgICAgICAgICBpZihwU2Vzc2lvbi0+TnVtQmtpZENhY2hlID4gQ1NSX01BWF9CS0lEX0FMTE9XRUQpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiTnVtQmtpZENhY2hlIDolZCBpcyBtb3JlIHRoYW4gQ1NSX01BWF9CS0lEX0FMTE9XRUQsIHJlc2V0dGluZyB0byBDU1JfTUFYX0JLSURfQUxMT1dFRCIpLAorICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+TnVtQmtpZENhY2hlKTsKKyAgICAgICAgICAgICAgIHBTZXNzaW9uLT5OdW1Ca2lkQ2FjaGUgPSBDU1JfTUFYX0JLSURfQUxMT1dFRDsKKyAgICAgICAgICAgfQorICAgICAgICAgICB2b3NfbWVtX2NvcHkocEJraWRDYWNoZSwgcFNlc3Npb24tPkJraWRDYWNoZUluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodEJraWRDYWNoZUluZm8pICogcFNlc3Npb24tPk51bUJraWRDYWNoZSk7CisgICAgICAgICAgICpwTnVtID0gcFNlc3Npb24tPk51bUJraWRDYWNoZTsKKyAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICB9CisgICB9CisgICByZXR1cm4gKHN0YXR1cyk7Cit9Cit0QU5JX1UzMiBjc3JSb2FtR2V0TnVtQktJRENhY2hlKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTMyIHNlc3Npb25JZCkKK3sKKyAgIHJldHVybiAocE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZ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FUVVNfU1VDQ0VTUzsKKyAgICAgICAgaWYgKHVwZGF0ZV9lbnRpcmVfY2FjaGUpIHsKKyAgICAgICAgICAgIGlmIChudW1JdGVtcyAmJiBwUE1LSURDYWNoZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+TnVtUG1raWRDYWNoZSA9ICh0QU5JX1UxNiludW1JdGVtczsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocFNlc3Npb24tPlBta2lkQ2FjaGVJbmZvLCBwUE1LSURDYWNoZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRQbWtpZENhY2hlSW5mbykgKiBudW1JdGVtcyk7CisgICAgICAgICAgICAgICAgcFNlc3Npb24tPkN1ckNhY2hlSW5kZXggPSAodEFOSV9VMTYpbnVtSXRlbXM7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICB0QU5JX1UzMiBpID0gMDsKKyAgICAgICAgICAgIHRQbWtpZENhY2hlSW5mbyAqcG1rc2E7CisKKyAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBudW1JdGVtczsgaSsrKSB7CisgICAgICAgICAgICAgICAgcG1rc2EgPSAmcFBNS0lEQ2FjaGVbaV07CisKKyAgICAgICAgICAgICAgICAvKiBEZWxldGUgdGhlIGVudHJ5IGlmIHByZXNlbnQgKi8KKyAgICAgICAgICAgICAgICBjc3JSb2FtRGVsUE1LSURmcm9tQ2FjaGUocE1hYyxzZXNzaW9uSWQscG1rc2EtPkJTU0lELEZBTFNFKTsKKworICAgICAgICAgICAgICAgIC8qIEFkZCBlbnRyeSB0byB0aGUgY2FjaGUgKi8KKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoCisgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPlBta2lkQ2FjaGVJbmZvW3BTZXNzaW9uLT5DdXJDYWNoZUluZGV4XS5CU1NJRCwKKyAgICAgICAgICAgICAgICAgICBwbWtzYS0+QlNTSUQsIFZPU19NQUNfQUREUl9TSVpFKTsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoCisgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPlBta2lkQ2FjaGVJbmZvW3BTZXNzaW9uLT5DdXJDYWNoZUluZGV4XS5QTUtJRCwKKyAgICAgICAgICAgICAgICAgICBwbWtzYS0+UE1LSUQsIENTUl9SU05fUE1LSURfU0laRSk7CisKKyAgICAgICAgICAgICAgICAvKiBJbmNyZW1lbnQgdGhlIENTUiBsb2NhbCBjYWNoZSBpbmRleCAqLworICAgICAgICAgICAgICAgIGlmIChwU2Vzc2lvbi0+Q3VyQ2FjaGVJbmRleCA8IChDU1JfTUFYX1BNS0lEX0FMTE9XRUQgLSAxKSkKKyAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPkN1ckNhY2hlSW5kZXgrKzsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5DdXJDYWNoZUluZGV4ID0gMDsKKworICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5OdW1QbWtpZENhY2hlKys7CisgICAgICAgICAgICAgICAgaWYocFNlc3Npb24tPk51bVBta2lkQ2FjaGUgPiBDU1JfTUFYX1BNS0lEX0FMTE9XRUQpCisgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5OdW1QbWtpZENhY2hlID0gQ1NSX01BWF9QTUtJRF9BTExPV0VEOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIHJldHVybiAoc3RhdHVzKTsKK30KKworZUhhbFN0YXR1cyBjc3JSb2FtRGVsUE1LSURmcm9tQ2FjaGUoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTMyIHNlc3Npb25JZCwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdEFOSV9VOCAqcEJTU0lkLAorI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQlNTSWQsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX0JPT0xFQU4gZmx1c2hfY2FjaGUgKQoreworICAgIHRDc3JSb2FtU2Vzc2lvbiAqcFNlc3Npb24gPSBDU1JfR0VUX1NFU1NJT04oIHBNYWMsIHNlc3Npb25JZCApOworICAgIHRBTklfQk9PTEVBTiBmTWF0Y2hGb3VuZCA9IEZBTFNFOworICAgIHRBTklfVTMyIEluZGV4OworICAgIHRBTklfVTMyIEN1ckluZGV4OworICAgIHRBTklfVTMyIGk7CisKKyAgICBpZighcFNlc3Npb24pCisgICAgeworICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiAgc2Vzc2lvbiAlZCBub3QgZm91bmQgIiksIHNlc3Npb25JZCk7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIH0KKworICAgIC8qIENoZWNrIGlmIHRoZXJlIGFyZSBubyBlbnRyaWVzIHRvIGRlbGV0ZSAqLworICAgIGlmICgwID09IHBTZXNzaW9uLT5OdW1QbWtpZENhY2hlKSB7CisgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCBGTCgiTm8gZW50cmllcyB0byBkZWxldGUvRmx1c2giKSk7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIH0KKworICAgIGlmICghZmx1c2hfY2FjaGUpIHsKKyAgICAgICAgZm9yIChJbmRleCA9IDA7IEluZGV4IDwgQ1NSX01BWF9QTUtJRF9BTExPV0VEOyBJbmRleCsrKSB7CisgICAgICAgICAgICBpZiAodm9zX21lbV9jb21wYXJlKHBTZXNzaW9uLT5QbWtpZENhY2hlSW5mb1tJbmRleF0uQlNTSUQsCisgICAgICAgICAgICAgICAgcEJTU0lkLCBWT1NfTUFDX0FERFJfU0laRSkpIHsKKyAgICAgICAgICAgICAgICBmTWF0Y2hGb3VuZCA9IDE7CisKKyAgICAgICAgICAgICAgICAvKiBDbGVhciB0aGlzIC0gdGhlIG1hdGNoZWQgZW50cnkgKi8KKyAgICAgICAgICAgICAgICB2b3NfbWVtX3plcm8oJnBTZXNzaW9uLT5QbWtpZENhY2hlSW5mb1tJbmRleF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0UG1raWRDYWNoZUluZm8pKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmIChJbmRleCA9PSBDU1JfTUFYX1BNS0lEX0FMTE9XRUQgJiYgIWZNYXRjaEZvdW5kKSB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HMSwgRkwoIk5vIHN1Y2ggUE1LU0EgZW50cnkgZXhpc3RzICJNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBCU1NJZCkpOworICAgICAgICB9CisgICAgICAgIGVsc2UgeworICAgICAgICAgICAgLyogTWF0Y2ggRm91bmQgKi8KKyAgICAgICAgICAgIEN1ckluZGV4ID0gcFNlc3Npb24tPkN1ckNhY2hlSW5kZXg7CisgICAgICAgICAgICBpZihJbmRleCA8IEN1ckluZGV4KSB7CisgICAgICAgICAgICAgICAgZm9yKGkgPSBJbmRleDsgaSA8IChDdXJJbmRleC0xKTsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmcFNlc3Npb24tPlBta2lkQ2FjaGVJbmZvW2ldLAorICAgICAgICAgICAgICAgICAgICAgICAgJnBTZXNzaW9uLT5QbWtpZENhY2hlSW5mb1tpKzFdLHNpemVvZih0UG1raWRDYWNoZUluZm8pKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcFNlc3Npb24tPkN1ckNhY2hlSW5kZXgtLTsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX3plcm8oJnBTZXNzaW9uLT5QbWtpZENhY2hlSW5mb1twU2Vzc2lvbi0+Q3VyQ2FjaGVJbmRleF0sCisgICAgICAgICAgICAgICAgICAgIHNpemVvZih0UG1raWRDYWNoZUluZm8pKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZihJbmRleCA+IEN1ckluZGV4KSB7CisgICAgICAgICAgICAgICAgZm9yKGkgPSBJbmRleDsgaSA+IChDdXJJbmRleCk7IGktLSkgeworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnBTZXNzaW9uLT5QbWtpZENhY2hlSW5mb1tpXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICZwU2Vzc2lvbi0+UG1raWRDYWNoZUluZm9baS0xXSxzaXplb2YodFBta2lkQ2FjaGVJbmZvKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHZvc19tZW1femVybygmcFNlc3Npb24tPlBta2lkQ2FjaGVJbmZvW3BTZXNzaW9uLT5DdXJDYWNoZUluZGV4XSwKKyAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRQbWtpZENhY2hlSW5mbykpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcFNlc3Npb24tPk51bVBta2lkQ2FjaGUtLTsKKyAgICAgICAgfQorICAgIH0gZWxzZSB7CisgICAgICAgIC8qIEZsdXNoIHRoZSBlbnRpcmUgY2FjaGUgKi8KKyAgICAgICAgdm9zX21lbV96ZXJvKHBTZXNzaW9uLT5QbWtpZENhY2hlSW5mbywKKyAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0UG1raWRDYWNoZUluZm8pICogQ1NSX01BWF9QTUtJRF9BTExPV0VEKTsKKyAgICAgICAgcFNlc3Npb24tPk51bVBta2lkQ2FjaGUgPSAwOworICAgICAgICBwU2Vzc2lvbi0+Q3VyQ2FjaGVJbmRleCA9IDA7CisgICAgfQorCisgICAgc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AgICAgICB7CisgICAgICAgICAgICBpZihwU2Vzc2lvbi0+TnVtUG1raWRDYWNoZSA+IENTUl9NQVhfUE1LSURfQUxMT1dFRCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIk51bVBta2lkQ2FjaGUgOiVkIGlzIG1vcmUgdGhhbiBDU1JfTUFYX1BNS0lEX0FMTE9XRUQsIHJlc2V0dGluZyB0byBDU1JfTUFYX1BNS0lEX0FMTE9XRUQiKSwKKyAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5OdW1QbWtpZENhY2hlKTsKKyAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+TnVtUG1raWRDYWNoZSA9IENTUl9NQVhfUE1LSURfQUxMT1dFRDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZm9yKGkgPSAwLGogPSAwOyAoajxwU2Vzc2lvbi0+TnVtUG1raWRDYWNoZSkmJihpPENTUl9NQVhfUE1LSURfQUxMT1dFRCk7IGkrKykgeworICAgICAgICAgICAgICAgIHBta3NhID0gJnBTZXNzaW9uLT5QbWtpZENhY2hlSW5mb1tpXTsKKyAgICAgICAgICAgICAgICBpZighY3NySXNNYWNBZGRyZXNzWmVybyhwTWFjLCAmcG1rc2EtPkJTU0lEKSkgeworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocFBta2lkQ2FjaGUscG1rc2Esc2l6ZW9mKHRQbWtpZENhY2hlSW5mbykpOworICAgICAgICAgICAgICAgICAgICBwUG1raWRDYWNoZSsrOworICAgICAgICAgICAgICAgICAgICBqKys7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAqcE51bSA9IHBTZXNzaW9uLT5OdW1QbWtpZENhY2hlOworICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gKHN0YXR1cyk7Cit9CisKK2VIYWxTdGF0dXMgY3NyUm9hbUdldFdwYVJzblJlcUlFKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTMyIHNlc3Npb25JZCwgdEFOSV9VMzIgKnBMZW4sIHRBTklfVTggKnBCdWYpCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19JTlZBTElEX1BBUkFNRVRFUjsKKyAgICB0QU5JX1UzMiBsZW47CisgICAgdENzclJvYW1TZXNzaW9uICpwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTiggcE1hYywgc2Vzc2lvbklkICk7CisgICAgCisgICAgaWYoIXBTZXNzaW9uKQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgIHNlc3Npb24gJWQgbm90IGZvdW5kICIpLCBzZXNzaW9uSWQpOworICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICB9CisgICAgCisgICAgaWYocExlbikKKyAgICB7CisgICAgICAgIGxlbiA9ICpwTGVuOworICAgICAgICAqcExlbiA9IHBTZXNzaW9uLT5uV3BhUnNuUmVxSWVMZW5ndGg7CisgICAgICAgIGlmKHBCdWYpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKGxlbiA+PSBwU2Vzc2lvbi0+bldwYVJzblJlcUllTGVuZ3RoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwQnVmLCBwU2Vzc2lvbi0+cFdwYVJzblJlcUlFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+bldwYVJzblJlcUllTGVuZ3RoKTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIHJldHVybiAoc3RhdHVzKTsKK30KKworZUhhbFN0YXR1cyBjc3JSb2FtR2V0V3BhUnNuUnNwSUUodH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XFJRSh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UzMiBzZXNzaW9uSWQsIHRBTklfVTMyICpwTGVuLCB0QU5JX1U4ICpwQnVmKQoreworICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfSU5WQUxJRF9QQVJBTUVURVI7CisgICAgdEFOSV9VMzIgbGVuOworICAgIHRDc3JSb2FtU2Vzc2lvbiAqcFNlc3Npb24gPSBDU1JfR0VUX1NFU1NJT04oIHBNYWMsIHNlc3Npb25JZCApOworCisgICAgaWYoIXBTZXNzaW9uKQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgIHNlc3Npb24gJWQgbm90IGZvdW5kICIpLCBzZXNzaW9uSWQpOworICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICB9CisgICAgCisgICAgaWYocExlbikKKyAgICB7CisgICAgICAgIGxlbiA9ICpwTGVuOworICAgICAgICAqcExlbiA9IHBTZXNzaW9uLT5uV2FwaVJlcUllTGVuZ3RoOworICAgICAgICBpZihwQnVmKQorICAgICAgICB7CisgICAgICAgICAgICBpZihsZW4gPj0gcFNlc3Npb24tPm5XYXBpUmVxSWVMZW5ndGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBCdWYsIHBTZXNzaW9uLT5wV2FwaVJlcUlFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+bldhcGlSZXFJZUxlbmd0aCk7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gKHN0YXR1cyk7Cit9CitlSGFsU3RhdHVzIGNzclJvYW1HZXRXYXBpUnNwSUUodHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMzIgc2Vzc2lvbklkLCB0QU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QoreworICAgIGVSb2FtQ21kU3RhdHVzIHJldFN0YXR1cyA9IGVDU1JfUk9BTV9DT05ORUNUX0NPTVBMRVRJT047CisgICAgdENzclJvYW1TZXNzaW9uICpwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTiggcE1hYywgc2Vzc2lvbklkICk7CisKKyAgICBpZighcFNlc3Npb24pCisgICAgeworICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiAgc2Vzc2lvbiAlZCBub3QgZm91bmQgIiksIHNlc3Npb25JZCk7CisgICAgICAgIHJldHVybiAocmV0U3RhdHVzKTsKKyAgICB9CisgICAgCisgICAgaWYoQ1NSX0lTX1JPQU1JTkcocFNlc3Npb24pKQorICAgIHsKKyAgICAgICAgcmV0U3RhdHVzID0gZUNTUl9ST0FNX1JPQU1JTkdfQ09NUExFVElPTjsKKyAgICAgICAgcFNlc3Npb24tPmZSb2FtaW5nID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgIH0KKyAgICByZXR1cm4gKHJldFN0YXR1cyk7Cit9CisKKy8vVGhpcyBmdW5jdGlvbiByZW1vdmUgdGhlIGNvbm5lY3RlZCBCU1MgZnJvbSB0ZSBjYWNoZWQgc2NhbiByZXN1bHQKK2VIYWxTdGF0dXMgY3NyUm9hbVJlbW92ZUNvbm5lY3RlZEJzc0Zyb21TY2FuQ2FjaGUodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdENzclJvYW1Db25uZWN0ZWRQcm9maWxlICpwQ29ublByb2ZpbGUpCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIHRDc3JTY2FuUmVzdWx0RmlsdGVyICpwU2NhbkZpbHRlciA9IE5VTEw7CisgICAgdExpc3RFbGVtICpwRW50cnk7CisgICAgdENzclNjYW5SZXN1bHQgKnBSZXN1bHQ7CisgICAgICAgIHRE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AgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkgYnJlYWs7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocFNjYW5GaWx0ZXItPkJTU0lEcy5ic3NpZCwgJnBDb25uUHJvZmlsZS0+YnNzaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRDc3JCc3NpZCkpOworICAgICAgICAgICAgcFNjYW5GaWx0ZXItPkJTU0lEcy5udW1PZkJTU0lEcyA9IDE7CisgICAgICAgICAgICBpZighY3NySXNOVUxMU1NJRChwQ29ublByb2ZpbGUtPlNTSUQuc3NJZCwgcENvbm5Qcm9maWxlLT5TU0lELmxlbmd0aCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFNjYW5GaWx0ZXItPlNTSURzLlNTSURMaXN0ID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRDc3JTU0lESW5mbykpOworICAgICAgICAgICAgICAgIGlmICggTlVMTCAgPT0gcFNjYW5GaWx0ZXItPlNTSURzLlNTSURMaXN0ICkKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICAgICAgaWYgKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkgYnJlYWs7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwU2NhbkZpbHRlci0+U1NJRHMuU1NJRExpc3RbMF0uU1NJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBDb25uUHJvZmlsZS0+U1NJRCwgc2l6ZW9mKHRTaXJNYWNTU2lkKSk7Cis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sKKyAgICAgICAgICAgIHBTY2FuRmlsdGVyLT5jb3VudHJ5Q29kZVswXSA9IDA7CisgICAgICAgICAgICBwU2NhbkZpbHRlci0+cGh5TW9kZSA9IGVDU1JfRE9UMTFfTU9ERV9UQVVSVVM7CisgICAgICAgICAgICBjc3JMTExvY2soJnBNYWMtPnNjYW4uc2NhblJlc3VsdExpc3QpOworICAgICAgICAgICAgcEVudHJ5ID0gY3NyTExQZWVrSGVhZCggJnBNYWMtPnNjYW4uc2NhblJlc3VsdExpc3QsIExMX0FDQ0VTU19OT0xPQ0sgKTsKKyAgICAgICAgICAgIHdoaWxlKCBwRW50cnkgKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwUmVzdWx0ID0gR0VUX0JBU0VfQUREUiggcEVudHJ5LCB0Q3NyU2NhblJlc3VsdCwgTGluayApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVzID0gKHREb3QxMWZCZWFjb25JRXMgKikoIHBSZXN1bHQtPlJlc3VsdC5wdkllcyApOworICAgICAgICAgICAgICAgIGZNYXRjaCA9IGNzck1hdGNoQlNTKHBNYWMsICZwUmVzdWx0LT5SZXN1bHQuQnNzRGVzY3JpcHRvciwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjYW5GaWx0ZXIsIE5VTEwsIE5VTEwsIE5VTEwsICZwSWVzKTsKKyAgICAgICAgICAgICAgICAvL1JlbGVhc2UgdGhlIElFcyBhbGxvY2F0ZWQgYnkgY3NyTWF0Y2hCU1MgaXMgbmVlZGVkCisgICAgICAgICAgICAgICAgaWYoICFwUmVzdWx0LT5SZXN1bHQucHZJZXMgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy9uZWVkIHRvIGZyZWUgdGhlIElFcyBzaW5jZSBpdCBpcyBhbGxvY2F0ZWQgYnkgY3NyTWF0Y2hCU1MKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBJZXMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZihmTWF0Y2gpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvL1dlIGZvdW5kIHRoZSBvbmUKKyAgICAgICAgICAgICAgICAgICAgaWYoIGNzckxMUmVtb3ZlRW50cnkoJnBNYWMtPnNjYW4uc2NhblJlc3VsdExpc3QsIHBFbnRyeSwgTExfQUNDRVNTX05PTE9DSykgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvL0ZyZWUgdGhlIG1lbW9yeQorICAgICAgICAgICAgICAgICAgICAgICAgY3NyRnJlZVNjYW5SZXN1bHRFbnRyeSggcE1hYywgcFJlc3VsdCApOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwRW50cnkgPSBjc3JMTE5leHQoJnBNYWMtPnNjYW4uc2NhblJlc3VsdExpc3QsIHBFbnRyeSwgTExfQUNDRVNTX05PTE9DSyk7CisgICAgICAgICAgICB9Ly93aGlsZQorICAgICAgICAgICAgY3NyTExVbmxvY2soJnBNYWMtPnNjYW4uc2NhblJlc3VsdExpc3QpOworICAgICAgICB9d2hpbGUoMCk7CisgICAgICAgIGlmKHBTY2FuRmlsdGVyKQorICAgICAgICB7CisgICAgICAgICAgICBjc3JGcmVlU2NhbkZpbHRlcihwTWFjLCBwU2NhbkZpbHRlcik7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocFNjYW5GaWx0ZXIpOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiAoc3RhdHVzKTsKK30KKworLy9CVC1BTVAKK2VIYWxTdGF0dXMgY3NySXNCVEFNUEFsbG93ZWQoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTMyIGNobklkICkKK3sKKyAgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgdEFOSV9VMzIgc2Vzc2lvbklkOworICAgIGZvciggc2Vzc2lvbklkID0gMDsgc2Vzc2lvbklkIDwgQ1NSX1JPQU1fU0VTU0lPTl9NQVg7IHNlc3Npb25JZCsrICkKKyAgICB7CisgICAgICAgIGlmKCBDU1JfSVNfU0VTU0lPTl9WQUxJRCggcE1hYywgc2Vzc2lvbklkICkgKQorICAgICAgICB7CisgICAgICAgICAgICBpZiggY3NySXNDb25uU3RhdGVJYnNzKCBwTWFjLCBzZXNzaW9uSWQgKSB8fCBjc3JJc0JUQU1QKCBwTWFjLCBzZXNzaW9uSWQgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9jby1leGlzdCB3aXRoIElCU1Mgb3IgQlQtQU1QIGlzIG5vdCBzdXBwb3J0ZWQKKyAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR1csICIgQlRBTVAgaXMgbm90IGFsbG93ZWQgZHVlIHRvIElCU1MvQlQtQU1QIGV4aXN0IGluIHNlc3Npb24gJWQiLCBzZXNzaW9uSWQgKTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19DU1JfV1JPTkdfU1RBVEU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiggY3NySXNDb25uU3RhdGVJbmZyYSggcE1hYywgc2Vzc2lvbklkICkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKCBjaG5JZCAmJiAKKyAgICAgICAgICAgICAgICAgICAgKCAodEFOSV9VOCljaG5JZCAhPSBwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0uY29ubmVjdGVkUHJvZmlsZS5vcGVyYXRpb25DaGFubmVsICkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dXLCAiIEJUQU1QIGlzIG5vdCBhbGxvd2VkIGR1ZSB0byBjaGFubmVsICglZCkgZGlmZiB0aGFuIGluZnIgY2hhbm5lbCAoJWQpIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNobklkLCBwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0uY29ubmVjdGVkUHJvZmlsZS5vcGVyYXRpb25DaGFubmVsICk7CisgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0NTUl9XUk9OR19TVEFURTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIHJldHVybiAoIHN0YXR1cyApOworfQorCitzdGF0aWMgZUhhbFN0YXR1cyBjc3JSb2FtU3RhcnRXZHMoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTMyIHNlc3Npb25JZCwgdENzclJvYW1Qcm9maWxlICpwUHJvZmlsZSwgdFNpckJzc0Rlc2NyaXB0aW9uICpwQnNzRGVzYyApCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIHRDc3JSb2FtU2Vzc2lvbiAqcFNlc3Npb24gPSBDU1JfR0VUX1NFU1NJT04oIHBNYWMsIHNlc3Npb25JZCApOworICAgIHRCc3NDb25maWdQYXJhbSBic3NDb25maWc7CisKKyAgICBpZighcFNlc3Npb24pCisgICAgeworICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiAgc2Vzc2lvbiAlZCBub3QgZm91bmQgIiksIHNlc3Npb25JZCk7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIH0KKyAgICAKKyAgICBpZiAoIGNzcklzQ29ublN0YXRlSWJzcyggcE1hYywgc2Vzc2lvbklkICkgKSAKKyAgICB7IAorICAgICAgICBzdGF0dXMgPSBjc3JSb2FtSXNzdWVTdG9wQnNzKCBwTWFjLCB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W1Qcm9maWxlLCBwUHJvZmlsZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvL1ByZXBhcmUgc29tZSBtb3JlIHBhcmFtZXRlcnMgZm9yIHRoaXMgV0RTCisgICAgICAgICAgICBjc3JSb2FtUHJlcGFyZUJzc1BhcmFtcyhwTWFjLCBzZXNzaW9uSWQsIHBQcm9maWxlLCBOVUxMLCAmYnNzQ29uZmlnLCBOVUxMKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1TZXRCc3NDb25maWdDZmcocE1hYywgc2Vzc2lvbklkLCBwUHJvZmlsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwgJmJzc0NvbmZpZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwgZUFOSV9CT09MRUFOX0ZBTFNFKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiggc3RhdHVzICk7Cit9CisKKy8vLy8vLy8vLy8vLy8vLy8vLy8vTWFpbCBib3gKKworLy9wQnVmIGlzIGNhbGxlciBhbGxvY2F0ZWQgbWVtb3J5IHBvaW50IHRvICYodFNpclNtZUpvaW5SZXEtPnJzbklFLnJzbklFZGF0YVsgMCBdKSArIHBNc2ctPnJzbklFLmxlbmd0aDsKKy8vb3IgJih0U2lyU21lUmVhc3NvY1JlcS0+cnNuSUUucnNuSUVkYXRhWyAwIF0pICsgcE1zZy0+cnNuSUUubGVuZ3RoOworc3RhdGljIHZvaWQgY3NyUHJlcGFyZUpvaW5SZWFzc29jUmVxQnVmZmVyKCB0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyQnNzRGVzY3JpcHRpb24gKnBCc3NEZXNjcmlwdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1Ziwg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XRDZmdNYXhUeFBvd2VyIChwTWFjLCBwQnNzRGVzY3JpcHRpb24tPmNoYW5uZWxJZCk7CisgICAgaWYgKDAgIT0gcHdyTGltaXQpCisgICAgeworICAgICAgICAqcEJ1ZisrID0gcHdyTGltaXQ7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgICpwQnVmKysgPSBNQVhfU1RBX1BXUl9DQVBfREJNOworICAgIH0KKyAgICBzaXplID0gc2l6ZW9mKHBNYWMtPnJvYW0udmFsaWRDaGFubmVsTGlzdCk7CisgICAgaWYoSEFMX1NUQVRVU19TVUNDRVNTKGNzckdldENmZ1ZhbGlkQ2hhbm5lbHMocE1hYywgKHRBTklfVTggKilwTWFjLT5yb2FtLnZhbGlkQ2hhbm5lbExpc3QsICZzaXplKSkpCisgICAgeworICAgICAgICB0QU5JX1U4ICphY3R1YWxTaXplID0gcEJ1ZisrOworICAgICAgICAqYWN0dWFsU2l6ZSA9IDA7CisKKyAgICAgICAgZm9yICggaSA9IDA7IGkgPCBzaXplOyBpKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIE9ubHkgYWRkIDVnaHogY2hhbm5lbHMqLworICAgICAgICAgICAgaWYgKENTUl9JU19DSEFOTkVMXzVHSFoocE1hYy0+cm9hbS52YWxpZENoYW5uZWxMaXN0WyBpIF0pKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAqYWN0dWFsU2l6ZSArPTE7CisgICAgICAgICAgICAgICAgICpwQnVmKysgPSBwTWFjLT5yb2FtLnZhbGlkQ2hhbm5lbExpc3RbIGkgXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoImNhbiBub3QgZmluZCBhbnkgdmFsaWQgY2hhbm5lbCIpKTsKKyAgICAgICAgKnBCdWYrKyA9IDA7ICAvL3RTaXJTdXBDaG5sLT5udW1DaG5sCisgICAgfSAgICAgICAgICAg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ICBwQnVmKys7CisgICAgICAgIC8vIHRyYW5zYWN0aW9uSWQKKyAgICAgICAgKnBCdWYgPSAwOworICAgICAgICAqKCBwQnVmICsgMSApID0gMDsKKyAgICAgICAgcEJ1ZiArPSBzaXplb2YodEFOSV9VMTYpOworICAgICAgICAvLyBzc0lkCisgICAgICAgIGlmKCBwSWVzLT5TU0lELnByZXNlbnQgJiYgcEllcy0+U1NJRC5udW1fc3NpZCApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIHNzSWQgbGVuCisgICAgICAgICAgICAqcEJ1ZiA9IHBJZXMtPlNTSUQubnVtX3NzaWQ7CisgICAgICAgICAgICBwQnVmKys7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocEJ1ZiwgcEllcy0+U1NJRC5zc2lkLCBwSWVzLT5TU0lELm51bV9zc2lkKTsKKyAgICAgICAgICAgIHBCdWYgKz0gcEllcy0+U1NJRC5udW1fc3NpZDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgICpwQnVmID0gMDsKKyAgICAgICAgICAgIHBCdWYrKzsKKyAgICAgICAgfQorICAgICAgICAvLyBzZWxmTWFjQWRkcgorICAgICAgICB2b3NfbWVtX2NvcHkoKHRTaXJNYWNBZGRyICopcEJ1ZiwgJnBTZXNzaW9uLT5zZWxmTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICBwQnVmICs9IHNpemVvZih0U2lyTWFjQWRkcik7CisgICAgICAgIC8vIGJzc3R5cGUKKyAgICAgICAgZHdUbXAgPSBwYWxfY3B1X3RvX2JlMzIoIGNzclRyYW5zbGF0ZUJzc3R5cGVUb01hY1R5cGUoIHBQcm9maWxlLT5CU1NUeXBlICkgKTsKKyAgICAgICAgaWYgKGR3VG1wID09IGVTSVJfQlRBTVBfU1RBX01PREUpIGR3VG1wID0gZVNJUl9CVEFNUF9BUF9NT0RFOyAvLyBPdmVycmlk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ICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwQnVmLCBFeFJhdGVTZXQucmF0ZSwgRXhSYXRlU2V0Lm51bVJhdGVzKTsKKyAgICAgICAgICAgICAgICBwQnVmICs9IEV4UmF0ZVNldC5udW1SYXRlczsKKyAgICAgICAgICAgIH0gZWxzZSAqcEJ1ZisrID0gMDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgICpwQnVmKysgPSAwOworICAgICAgICAgICAgKnBCdWYrKyA9IDA7CisgICAgICAgIH0KKworICAgICAgICAvL3JhdGVCaXRtYXAKKyAgICAgICAgdm9zX21lbV9jb3B5KHBCdWYsICZyYXRlQml0bWFwLCBzaXplb2YodEFOSV9VMTYpKTsKKyAgICAgICAgcEJ1ZiArPSBzaXplb2YodEFOSV9VMTYpOworCisgICAgICAgIC8vIHJzbklFCisgICAgICAgIGlmICggY3NySXNQcm9maWxlV3BhKCBwUHJvZmlsZSApICkKKyAgICAgICAgeworICAgICAgICAgICAgLy8gSW5zZXJ0IHRoZSBXcGEgSUUgaW50byB0aGUgam9pbiByZXF1ZXN0CisgICAgICAgICAgICBpZUxlbiA9IGNzclJldHJpZXZlV3BhSWUoIHBNYWMsIHBQcm9maWxlLCBwQnNzRGVzY3JpcHRpb24sIHBJZXMsCisgICAgICAgICAgICAgICAgICAgICh0Q3NyV3BhSWUgKikoIHdwYVJzbklFICkgKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmKCBjc3JJc1Byb2ZpbGVSU04oIHBQcm9maWxlICkgKQorICAgICAgICB7CisgICAgICAgICAgICAvLyBJbnNlcnQgdGhlIFJTTiBJRSBpbnRvIHRoZSBqb2luIHJlcXVlc3QKKyAgICAgICAgICAgIGllTGVuID0gY3NyUmV0cmlldmVSc25JZSggcE1hYywgc2Vzc2lvbklkLCBwUHJvZmlsZSwgcEJzc0Rlc2NyaXB0aW9uLCBwSWVzLAorICAgICAgICAgICAgICAgICAgICAodENzclJTTkllICopKCB3cGFSc25JRSApICk7CisgICAgICAgIH0KKyNpZmRlZiBGRUFUVVJFX1dMQU5fV0FQSQorICAgICAgICBlbHNlIGlmKCBjc3JJc1Byb2ZpbGVXYXBpKCBwUHJvZmlsZSApICkKKyAgICAgICAgeworICAgICAgICAgICAgLy8gSW5zZXJ0IHRoZSBXQVBJIElFIGludG8gdGhlIGpvaW4gcmVxdWVzdAorICAgICAgICAgICAgaWVMZW4gPSBjc3JSZXRyaWV2ZVdhcGlJZSggcE1hYywgc2Vzc2lvbklkLCBwUHJvZmlsZSwgcEJzc0Rlc2NyaXB0aW9uLCBwSWVzLAorICAgICAgICAgICAgICAgICAgICAodENzcldhcGlJZSAqKSggd3BhUnNuSUUgKSApOworICAgICAgICB9CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX1dBUEkgKi8KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBpZUxlbiA9IDA7CisgICAgICAgIH0KKyAgICAgICAgLy9yZW1lbWJlciB0aGUgSUUgZm9yIGZ1dHVyZSB1c2UKKyAgICAgICAgaWYoIGllTGVuICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYoaWVMZW4gPiBET1QxMUZfSUVfUlNOX01BWF9MRU4pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgV1BBIFJTTiBJRSBsZW5ndGggOiVkIGlzIG1vcmUgdGhhbiBET1QxMUZfSUVfUlNOX01BWF9MRU4sIHJlc2V0dGluZyB0byAlZCIpLCBpZUxlbiwgRE9UMTFGX0lFX1JTTl9NQVhfTEVOKTsKKyAgICAgICAgICAgICAgICBpZUxlbiA9IERPVDExRl9JRV9SU05fTUFYX0xFTjsKKyAgICAgICAgICAgIH0KKyNpZmRlZiBGRUFUVVJFX1dMQU5fV0FQSQorICAgICAgICAgICAgaWYoIGNzcklzUHJvZmlsZVdhcGkoIHBQcm9maWxlICkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vQ2hlY2sgd2hldGhlciB3ZSBuZWVkIHRvIGFsbG9jYXRlIG1vcmUgbWVtb3J5CisgICAgICAgICAgICAgICAgaWYoaWVMZW4gPiBwU2Vzc2lvbi0+bldhcGlSZXFJZUxlbmd0aCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmKHBTZXNzaW9uLT5wV2FwaVJlcUlFICYmIHBTZXNzaW9uLT5uV2FwaVJlcUllTGVuZ3RoKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocFNlc3Npb24tPnBXYXBpUmVxSUUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5wV2FwaVJlcUlFID0gdm9zX21lbV9tYWxsb2MoaWVMZW4pOworICAgICAgICAgICAgICAgICAgICBpZiAoTlVMTCA9PSBwU2Vzc2lvbi0+cFdhcGlSZXFJRSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5uV2FwaVJlcUllTGVuZ3RoID0gaWVMZW47CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBTZXNzaW9uLT5wV2FwaVJlcUlFLCB3cGFSc25JRSwgaWVMZW4pOworICAgICAgICAgICAgICAgIHdUbXAgPSBwYWxfY3B1X3RvX2JlMTYoIGllTGVuICk7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBCdWYsICZ3VG1wLCBzaXplb2YodEFOSV9VMTYpKTsKKyAgICAgICAgICAgICAgICBwQnVmICs9IHNpemVvZih0QU5JX1UxNik7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBCdWYsIHdwYVJzbklFLCBpZUxlbik7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSBpZUxlbjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UvL3Nob3VsZCBiZSBXUEEvV1BBMiBvdGhlcndpc2UKKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fV0FQSSAqLworICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vQ2hlY2sgd2hldGhlciB3ZSBuZWVkIHRvIGFsbG9jYXRlIG1vcmUgbWVtb3J5CisgICAgICAgICAgICAgICAgaWYoaWVMZW4gPiBwU2Vzc2lvbi0+bldwYVJzblJlcUllTGVuZ3RoKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYocFNlc3Npb24tPnBXcGFSc25SZXFJRSAmJiBwU2Vzc2lvbi0+bldwYVJzblJlcUllTGVuZ3RoKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocFNlc3Npb24tPnBXcGFSc25SZXFJRSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPnBXcGFSc25SZXFJRSA9IHZvc19tZW1fbWFsbG9jKGllTGVuKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKE5VTEwgPT0gcFNlc3Npb24tPnBXcGFSc25SZXFJRSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5uV3BhUnNuUmVxSWVMZW5ndGggPSBpZUxlbjsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocFNlc3Npb24tPnBXcGFSc25SZXFJRSwgd3BhUnNuSUUsIGllTGVuKTsKKyAgICAgICAgICAgICAgICB3VG1wID0gcGFsX2NwdV90b19iZTE2KCBpZUxlbiApOworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwQnVmLCAmd1RtcCwgc2l6ZW9mKHRBTklfVTE2KSk7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSBzaXplb2YodEFOSV9VMTYpOworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwQnVmLCB3cGFSc25JRSwgaWVMZW4pOworICAgICAgICAgICAgICAgIHBCdWYgKz0gaWVMZW47CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvL2ZyZWUgd2hhdGV2ZXIgb2xkIGluZm8KKyAgICAgICAgICAgIHBTZXNzaW9uLT5uV3BhUnNuUmVxSWVMZW5ndGggPSAwOworICAgICAgICAgICAgaWYocFNlc3Npb24tPnBXcGFSc25SZXFJRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocFNlc3Npb24tPnBXcGFSc25SZXFJRSk7CisgICAgICAgICAgICAgICAgcFNlc3Npb24tPnBXcGFSc25SZXFJRSA9IE5VTEw7CisgICAgICAgICAgICB9CisjaWZkZWYgRkVBVFVSRV9XTEFOX1dBUEkKKyAgICAgICAgICAgIHBTZXNzaW9uLT5uV2FwaVJlcUllTGVuZ3RoID0gMDsKKyAgICAgICAgICAgIGlmKHBTZXNzaW9uLT5wV2FwaVJlcUlFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwU2Vzc2lvbi0+cFdhcGlSZXFJRSk7CisgICAgICAgICAgICAgICAgcFNlc3Npb24tPnBXYXBpUmVxSUUgPSBOVUxMOworICAgICAgICAgICAgfQorI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9XQVBJICovCisgICAgICAgICAgICAvL2xlbmd0aCBpcyB0d28gYnl0ZXMKKyAgICAgICAgICAgICpwQnVmID0gMDsKKyAgICAgICAgICAgICoocEJ1ZiArIDEpID0gMDsKKyAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgfQorI2lmZGVmIEZFQVRVUkVfV0xBTl9FU0UKKyAgICAgICAgaWYoIGVXTklfU01FX0pPSU5fUkVRID09IG1lc3NhZ2VUeXBlICkKKyAgICAgICAgeworICAgICAgICAgICAgLy8gTmV2ZXIgaW5jbHVkZSB0aGUgY2NrbUlFIGluIGFuIEpvaW4gUmVxdWVzdAorICAgICAgICAgICAgLy9sZW5ndGggaXMgdHdvIGJ5dGVzCisgICAgICAgICAgICAqcEJ1ZiA9IDA7CisgICAgICAgICAgICAqKHBCdWYgKyAxKSA9IDA7CisgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZihlV05JX1NNRV9SRUFTU09DX1JFUSA9PSBtZXNzYWdlVHlwZSApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIGNja21JRQorICAgICAgICAgICAgaWYoIGNzcklzUHJvZmlsZUVTRSggcFByb2ZpbGUgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gSW5zZXJ0IHRoZSBDQ0tNIElFIGludG8gdGhlIGpvaW4gcmVxdWVzdAorI2lmZGVmIEZFQVRVUkVfV0xBTl9FU0VfVVBMT0FECisgICAgICAgICAgICAgICAgaWVMZW4gPSBwU2Vzc2lvbi0+c3VwcENja21JZUluZm8uY2NrbUllTGVuOworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgodm9pZCAqKSAod3BhUnNuSUUpLAorICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPnN1cHBDY2ttSWVJbmZvLmNja21JZSwgaWVMZW4pOworI2Vsc2UKKyAgICAgICAgICAgICAgICBpZUxlbiA9IGNzckNvbnN0cnVjdEVzZUNja21JZSggcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByb2ZpbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQnNzRGVzY3JpcHRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+cFdwYVJzblJlcUlFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPm5XcGFSc25SZXFJZUxlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopKCB3cGFSc25JRSApICk7CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0VTRV9VUExPQUQgKi8KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZUxlbiA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvL0lmIHByZXNlbnQsIGNvcHkgdGhlIElFIGludG8gdGhlIGVXTklfU01FX1JFQVNTT0NfUkVRIG1lc3NhZ2UgYnVmZmVyCisgICAgICAgICAgICBpZiggaWVMZW4gKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vQ29weSB0aGUgQ0NLTSBJRSBvdmVyIGZyb20gdGhlIHRlbXAgYnVmZmVyICh3cGFSc25JRSkKKyAgICAgICAgICAgICAgICB3VG1wID0gcGFsX2NwdV90b19iZTE2KCBpZUxlbiApOworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwQnVmLCAmd1RtcCwgc2l6ZW9mKHRBTklfVTE2KSk7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSBzaXplb2YodEFOSV9VMTYpOworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwQnVmLCB3cGFSc25JRSwgaWVMZW4pOworICAgICAgICAgICAgICAgIHBCdWYgKz0gaWVMZW47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9JbmRpY2F0ZSB5b3UgaGF2ZSBubyBDQ0tNIElFCisgICAgICAgICAgICAgICAgLy9sZW5ndGggaXMgdHdvIGJ5dGVzCisgICAgICAgICAgICAgICAgKnBCdWYgPSAwOworICAgICAgICAgICAgICAgICoocEJ1ZiArIDEpID0gMDsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fRVNFICovCisgICAgICAgIC8vIGFkZElFU2NhbgorICAgICAgICBpZiAocFByb2ZpbGUtPm5BZGRJRVNjYW5MZW5ndGgpCisgICAgICAgIHsKKyAgICAgICAgICAgIGllTGVuID0gcFByb2ZpbGUtPm5BZGRJRVNjYW5MZW5ndGg7CisgICAgICAgICAgICBtZW1zZXQocFNlc3Npb24tPmFkZElFU2NhbiwgMCAsIHBTZXNzaW9uLT5uQWRkSUVTY2FuTGVuZ3RoKTsKKyAgICAgICAgICAgIHBTZXNzaW9uLT5uQWRkSUVTY2FuTGVuZ3RoID0gaWVMZW47CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocFNlc3Npb24tPmFkZElFU2NhbiwgcFByb2ZpbGUtPmFkZElFU2NhbiwgaWVMZW4pOworICAgICAgICAgICAgd1RtcCA9IHBhbF9jcHVfdG9fYmUxNiggaWVMZW4gKTsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwQnVmLCAmd1RtcCwgc2l6ZW9mKHRBTklfVTE2KSk7CisgICAgICAgICAgICBwQnVmICs9IHNpemVvZih0QU5JX1UxNik7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocEJ1ZiwgcFByb2ZpbGUtPmFkZElFU2NhbiwgaWVMZW4pOworICAgICAgICAgICAgcEJ1ZiArPSBpZUxlbjsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIG1lbXNldChwU2Vzc2lvbi0+YWRkSUVTY2FuLCAwLCBwU2Vzc2lvbi0+bkFkZElFU2Nhbkxlbmd0aCk7CisgICAgICAgICAgICBwU2Vzc2lvbi0+bkFkZElFU2Nhbkxlbmd0aCA9IDA7CisgICAgICAgICAgICAqcEJ1ZiA9IDA7CisgICAgICAgICAgICAqKHBCdWYgKyAxKSA9IDA7CisgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIH0KKyAgICAgICAgLy8gYWRkSUVBc3NvYworICAgICAgICBpZihwUHJvZmlsZS0+bkFkZElFQXNzb2NMZW5ndGggJiYgcFByb2ZpbGUtPnBBZGRJRUFzc29jKQorICAgICAgICB7CisgICAgICAgICAgICBpZUxlbiA9IHBQcm9maWxlLT5uQWRkSUVBc3NvY0xlbmd0aDsKKyAgICAgICAgICAgIGlmKGllTGVuID4gcFNlc3Npb24tPm5BZGRJRUFzc29jTGVuZ3RoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKHBTZXNzaW9uLT5wQWRkSUVBc3NvYyAmJiBwU2Vzc2lvbi0+bkFkZElFQXNzb2NMZW5ndGgpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocFNlc3Npb24tPnBBZGRJRUFzc29jKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcFNlc3Npb24tPnBBZGRJRUFzc29jID0gdm9zX21lbV9tYWxsb2MoaWVMZW4pOworICAgICAgICAgICAgICAgIGlmIChOVUxMID09IHBTZXNzaW9uLT5wQWRkSUVBc3NvYykKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKSBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBTZXNzaW9uLT5uQWRkSUVBc3NvY0xlbmd0aCA9IGllTGVuOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBTZXNzaW9uLT5wQWRkSUVBc3NvYywgcFByb2ZpbGUtPnBBZGRJRUFzc29jLCBpZUxlbik7CisgICAgICAgICAgICB3VG1wID0gcGFsX2NwdV90b19iZTE2KCBpZUxlbiApOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBCdWYsICZ3VG1wLCBzaXplb2YodEFOSV9VMTYpKTsKKyAgICAgICAgICAgIHBCdWYgKz0gc2l6ZW9mKHRBTklfVTE2KTsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwQnVmLCBwUHJvZmlsZS0+cEFkZElFQXNzb2MsIGllTGVuKTsKKyAgICAgICAgICAgIHBCdWYgKz0gaWVMZW47CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBwU2Vzc2lvbi0+bkFkZElFQXNzb2NMZW5ndGggPSAwOworICAgICAgICAgICAgaWYocFNlc3Npb24tPnBBZGRJRUFzc29jKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwU2Vzc2lvbi0+cEFkZElFQXNzb2MpOworICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5wQWRkSUVBc3NvYyA9IE5VTEw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAqcEJ1ZiA9IDA7CisgICAgICAgICAgICAqKHBCdWYgKyAxKSA9IDA7CisgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIH0KKworICAgICAgICBpZihlV05JX1NNRV9SRUFTU09DX1JFUSA9PSBtZXNzYWdlVHlwZSApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vVW5tYXNrIGFueSBBQyBpbiByZWFzc29jIHRoYXQgaXMgQUNNLXNldAorICAgICAgICAgICAgdWFwc2RfbWFzayA9ICh2X1U4X3QpcFByb2ZpbGUtPnVhcHNkX21hc2s7CisgICAgICAgICAgICBpZiggdWFwc2RfbWFzayAmJiAoIE5VTEwgIT0gcEJzc0Rlc2NyaXB0aW9uICkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKCBDU1JfSVNfUU9TX0JTUyhwSWVzKSAmJiBDU1JfSVNfVUFQU0RfQlNTKHBJZXMpICkKKyAgICAgICAgICAgICAgICB7CisjaWZuZGVmIFdMQU5fTURNX0NPREVfUkVEVUNUSU9OX09QVAorICAgICAgICAgICAgICAgICAgICBhY21fbWFzayA9IHNtZV9Rb3NHZXRBQ01NYXNrKHBNYWMsIHBCc3NEZXNjcmlwdGlvbiwgcEllcyk7CisjZW5kaWYgLyogV0xBTl9NRE1fQ09ERV9SRURVQ1RJT05fT1BUKi8KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdWFwc2RfbWFzayA9IDA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgZHdUbXAgPSBwYWxfY3B1X3RvX2JlMzIoIGNzclRyYW5zbGF0ZUVuY3J5cHRUeXBlVG9FZFR5cGUoIHBQcm9maWxlLT5uZWdvdGlhdGVkVUNFbmNyeXB0aW9uVHlwZSkgKTsKKyAgICAgICAgdm9zX21lbV9jb3B5KHBCdWYsICZkd1RtcCwgc2l6ZW9mKHRBTklfVTMyKSk7CisgICAgICAgIHBCd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gICAgICAgICAocEllcy0+RVNFVmVyc2lvbi5wcmVzZW50KSAmJiAocE1hYy0+cm9hbS5jb25maWdQYXJhbS5pc0VzZUluaUZlYXR1cmVFbmFibGVkKSkKKyNlbmRpZgorICAgICAgICApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIGlzMTFSY29ubmVjdGlvbjsKKyAgICAgICAgICAgIGR3VG1wID0gcGFsX2NwdV90b19iZTMyKFRSVUUpOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBCdWYsICZkd1RtcCwgc2l6ZW9mKHRBbmlCb29sKSkgOworICAgICAgICAgICAgcEJ1ZiArPSBzaXplb2YodEFuaUJvb2wpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLy8gaXMxMVJjb25uZWN0aW9uOworICAgICAgICAgICAgZHdUbXAgPSBwYWxfY3B1X3RvX2JlMzIoRkFMU0UpOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBCdWYsICZkd1RtcCwgc2l6ZW9mKHRBbmlCb29sKSk7CisgICAgICAgICAgICBwQnVmICs9IHNpemVvZih0QW5pQm9vbCk7CisgICAgICAgIH0KKyNlbmRpZgorI2lmZGVmIEZFQVRVUkVfV0xBTl9FU0UKKworICAgICAgICAvLyBpc0VTRUZlYXR1cmVJbmlFbmFibGVkCisgICAgICAgIGlmIChUUlVFID09IHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uaXNFc2VJbmlGZWF0dXJlRW5hYmxlZCkKKyAgICAgICAgeworICAgICAgICAgICAgZHdUbXAgPSBwYWxfY3B1X3RvX2JlMzIoVFJVRSk7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocEJ1ZiwgJmR3VG1wLCBzaXplb2YodEFuaUJvb2wpKTsKKyAgICAgICAgICAgIHBCdWYgKz0gc2l6ZW9mKHRBbmlCb29sKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIGR3VG1wID0gcGFsX2NwdV90b19iZTMyKEZBTFNFKTsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwQnVmLCAmZHdUbXAsIHNpemVvZih0QW5pQm9vbCkpOworICAgICAgICAgICAgcEJ1ZiArPSBzaXplb2YodEFuaUJvb2wpOworICAgICAgICB9CisKKyAgICAgICAgLyogQSBwcm9maWxlIGNhbiBub3QgYmUgYm90aCBFU0UgYW5kIDExUi4gQnV0IGFuIDgwMi4xMVIgQVAKKyAgICAgICAgICogbWF5IGJlIGFkdmVydGlzaW5nIHN1cHBvcnQgZm9yIEVTRSBhcyB3ZWxsLiBTbyBpZiB3ZSBhcmUKKyAgICAgICAgICogYXNzb2NpYXRpbmcgT3BlbiBvciBleHBsaWNpdGx5IEVTRSB0aGVuIHdlIHdpbGwgZ2V0IEVTRS4KKyAgICAgICAgICogSWYgd2UgYXJlIGFzc29jaWF0aW5nIGV4cGxpY3RseSAxMVIgb25seSB0aGVuIHdlIHdpbGwgZ2V0CisgICAgICAgICAqIDExUi4KKyAgICAgICAgICovCisgICAgICAgIGlmICgoY3NySXNQcm9maWxlRVNFKHBQcm9maWxlKSB8fAorICAgICAgICAgICAgICAgICAgKChwSWVzLT5FU0VWZXJzaW9uLnByZXNlbnQpCisgICAgICAgICAgICAgICAgICAgJiYgKChwUHJvZmlsZS0+bmVnb3RpYXRlZEF1dGhUeXBlID09IGVDU1JfQVVUSF9UWVBFX09QRU5fU1lTVEVNKQorICAgICAgICAgICAgICAgICAgICAgICB8fCAocFByb2ZpbGUtPm5lZ290aWF0ZWRBdXRoVHlwZSA9PSBlQ1NSX0FVVEhfVFlQRV9XUEEpCisgICAgICAgICAgICAgICAgICAgICAgIHx8IChwUHJvZmlsZS0+bmVnb3RpYXRlZEF1dGhUeXBlID09IGVDU1JfQVVUSF9UWVBFX1dQQV9QU0spCisgICAgICAgICAgICAgICAgICAgICAgIHx8IChwUHJvZmlsZS0+bmVnb3RpYXRlZEF1dGhUeXBlID09IGVDU1JfQVVUSF9UWVBFX1JTTikKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisgICAgICAgICAgICAgICAgICAgICAgIHx8IChwUHJvZmlsZS0+bmVnb3RpYXRlZEF1dGhUeXBlID09IGVDU1JfQVVUSF9UWVBFX1JTTl9QU0tfU0hBMjU2KQorICAgICAgICAgICAgICAgICAgICAgICB8fCAocFByb2ZpbGUtPm5lZ290aWF0ZWRBdXRoVHlwZSA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX0FVVEhfVFlQRV9SU05fODAyMVhfU0hBMjU2KQorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgIHx8IChwUHJvZmlsZS0+bmVnb3RpYXRlZEF1dGhUeXBlID09IGVDU1JfQVVUSF9UWVBFX1JTTl9QU0spKSkpCisgICAgICAgICAgICAgICAgICYmIChwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLmlzRXNlSW5pRmVhdHVyZUVuYWJsZWQpKQorICAgICAgICB7CisgICAgICAgICAgICAvLyBpc0VTRWNvbm5lY3Rpb247CisgICAgICAgICAgICBkd1RtcCA9IHBhbF9jcHVfdG9fYmUzMihUUlVFKTsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwQnVmLCAmZHdUbXAsIHNpemVvZih0QW5pQm9vbCkpOworICAgICAgICAgICAgcEJ1ZiArPSBzaXplb2YodEFuaUJvb2wpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLy9pc0VTRWNvbm5lY3Rpb247CisgICAgICAgICAgICBkd1RtcCA9IHBhbF9jcHVfdG9fYmUzMihGQUxTRSk7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocEJ1ZiwgJmR3VG1wLCBzaXplb2YodEFuaUJvb2wpKTsKKyAgICAgICAgICAgIHBCdWYgKz0gc2l6ZW9mKHRBbmlCb29sKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChlV05JX1NNRV9KT0lOX1JFU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ZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisgICAgICAgICAgICAgICAgICB8fCAocFByb2ZpbGUtPm5lZ290aWF0ZWRBdXRoVHlwZSA9PSBlQ1NSX0FVVEhfVFlQRV9SU05fUFNLX1NIQTI1NikKKyAgICAgICAgICAgICAgICAgIHx8IChwUHJvZmlsZS0+bmVnb3RpYXRlZEF1dGhUeXBlID09CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfQVVUSF9UWVBFX1JTTl84MDIxWF9TSEEyNTYpCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgIHx8IChwUHJvZmlsZS0+bmVnb3RpYXRlZEF1dGhUeXBlID09IGVDU1JfQVVUSF9UWVBFX1JTTl9QU0spKSkpCisgICAgICAgICAgICAmJiAocE1hYy0+cm9hbS5jb25maWdQYXJhbS5pc0VzZUluaUZlYXR1cmVFbmFibGVkKSkKKyAgICAgICAgeworICAgICAgICAgICB0RVNFVHNwZWNJbmZvIGVzZVRzcGVjOworICAgICAgICAgICAvLyBFU0UgVHNwZWMgaW5mb3JtYXRpb24KKyAgICAgICAgICAgdm9zX21lbV9zZXQoJmVzZVRzcGVjLCBzaXplb2YodEVTRVRzcGVjSW5mbyksIDApOworICAgICAgICAgICBlc2VUc3BlYy5udW1Uc3BlY3MgPSBzbWVfUW9zRVNFUmV0cmlldmVUc3BlY0luZm8ocE1hYywgc2Vzc2lvbklkLCAodFRzcGVjSW5mbyAqKSAmZXNlVHNwZWMudHNwZWNbMF0pOworICAgICAgICAgICAqcEJ1ZiA9IGVzZVRzcGVjLm51bVRzcGVjczsKKyAgICAgICAgICAgcEJ1ZiArPSBzaXplb2YodEFOSV9VOCk7CisgICAgICAgICAgIC8vIENvcHkgdGhlIFRTUEVDIGluZm9ybWF0aW9uIG9ubHkgaWYgcHJlc2VudAorICAgICAgICAgICBpZiAoZXNlVHNwZWMubnVtVHNwZWNzKSB7CisgICAgICAgICAgICAgICB2b3NfbWVtX2N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EZSCisgICAgICAgICB8fCBjc3JSb2FtSXNGYXN0Um9hbUVuYWJsZWQocE1hYywgc2Vzc2lvbklkKQorI2VuZGlmCisgICAgICAgICApCisgICAgICAgIHsKKyAgICAgICAgICAgIGR3VG1wID0gcGFsX2NwdV90b19iZTMyKFRSVUUpOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBCdWYsICZkd1RtcCwgc2l6ZW9mKHRBbmlCb29sKSk7CisgICAgICAgICAgICBwQnVmICs9IHNpemVvZih0QW5pQm9vbCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBkd1RtcCA9IHBhbF9jcHVfdG9fYmUzMihGQUxTRSk7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocEJ1ZiwgJmR3VG1wLCBzaXplb2YodEFuaUJvb2wpKTsKKyAgICAgICAgICAgIHBCdWYgKz0gc2l6ZW9mKHRBbmlCb29sKTsKKyAgICAgICAgfQorI2VuZGlmCisjaWZkZWYgRkVBVFVSRV9XTEFOX0xGUgorICAgICAgICBpZihjc3JSb2FtSXNGYXN0Um9hbUVuYWJsZWQocE1hYywgc2Vzc2lvbklkKSkKKyAgICAgICAgeworICAgICAgICAgICAgLy9sZWdhY3kgZmFzdCByb2FtaW5nIGVuYWJsZWQKKyAgICAgICAgICAgIGR3VG1wID0gcGFsX2NwdV90b19iZTMyKFRSVUUpOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBCdWYsICZkd1RtcCwgc2l6ZW9mKHRBbmlCb29sKSk7CisgICAgICAgICAgICBwQnVmICs9IHNpemVvZih0QW5pQm9vbCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBkd1RtcCA9IHBhbF9jcHVfdG9fYmUzMihGQUxTRSk7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocEJ1ZiwgJmR3VG1wLCBzaXplb2YodEFuaUJvb2wpKTsKKyAgICAgICAgICAgIHBCdWYg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ICAgICAgICAgIHR4QkZDc25WYWx1ZSA9ICh0QU5JX1U4KXBNYWMtPnJvYW0uY29uZmlnUGFyYW0udHhCRkNzblZhbHVlOworICAgICAgICAgICAgaWYgKHBJZXMtPlZIVENhcHMubnVtU291bmRpbmdEaW0pCisgICAgICAgICAgICAgICB0eEJGQ3NuVmFsdWUgPSBDU1JfUk9BTV9NSU4KKyAgICAgICAgICAgICAgICAgICh0eEJGQ3NuVmFsdWUsIHBJZXMtPlZIVENhcHMubnVtU291bmRpbmdEaW0pOworICAgICAgICB9CisgICAgICAgICpwQnVmID0gdHhCRkNzblZhbHVlOworICAgICAgICBwQnVmKys7CisKKyAgICAgICAgLyogT25seSBlbmFibGUgTXVCZiBpZiBubyBvdGhlciBNdUJGIHNlc3Npb24gZXhpc3QKKyAgICAgICAgICogYW5kIEZXIGFuZCBIT1NUIGlzIE11QkYgY2FwYWJsZS4KKyAgICAgICAgICovCisgICAgICAgIGlmICggSVNfTVVNSU1PX0JGT1JNRUVfQ0FQQUJMRSAmJiAoRkFMU0UgPT0gcE1hYy0+aXNNdUJmc2Vzc2lvbmV4aXN0KSApCisgICAgICAgIHsKKyAgICAgICAgICAgKnBCdWYgPSAodEFOSV9VOClwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLnR4TXVCZm9ybWVlOworICAgICAgICAgICBwQnVmKys7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICpwQnVmID0gMDsKKyAgICAgICAgICAgcEJ1ZisrOworICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgKnBCdWYgPSAodEFOSV9VOClwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLmlzQW1zZHVTdXBwb3J0SW5BTVBEVTsKKyAgICAgICAgcEJ1ZisrOworCisgICAgICAgIC8vIFdNRQorICAgICAgICBpZihwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0uZldNTUNvbm5lY3Rpb24pCisgICAgICAgIHsKKyAgICAgICAgICAgLy9XTUUgIGVuYWJsZWQKKyAgICAgICAgICAgIGR3VG1wID0gcGFsX2NwdV90b19iZTMyKFRSVUUpOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBCdWYsICZkd1RtcCwgc2l6ZW9mKHRBbmlCb29sKSk7CisgICAgICAgICAgICBwQnVmICs9IHNpemVvZih0QW5pQm9vbCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBkd1RtcCA9IHBhbF9jcHVfdG9fYmUzMihGQUxTRSk7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocEJ1ZiwgJmR3VG1wLCBzaXplb2YodEFuaUJvb2wpKTsKKyAgICAgICAgICAgIHBCdWYgKz0gc2l6ZW9mKHRBbmlCb29sKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIFFPUworICAgICAgICBpZihwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0uZlFPU0Nvbm5lY3Rpb24pCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vUU9TICBlbmFibGVkCisgICAgICAgICAgICBkd1RtcCA9IHBhbF9jcHVfdG9fYmUzMihUUlVFKTsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwQnVmLCAmZHdUbXAsIHNpemVvZih0QW5pQm9vbCkpOworICAgICAgICAgICAgcEJ1ZiArPSBzaXplb2YodEFuaUJvb2wpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgZHdUbXAgPSBwYWxfY3B1X3RvX2JlMzIoRkFMU0UpOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBCdWYsICZkd1RtcCwgc2l6ZW9mKHRBbmlCb29sKSk7CisgICAgICAgICAgICBwQnVmICs9IHNpemVvZih0QW5pQm9vbCk7CisgICAgICAgIH0KKyAgICAgICAgLy9Cc3NEZXNjCisgICAgICAgIGNzclByZXBhcmVKb2luUmVhc3NvY1JlcUJ1ZmZlciggcE1hYywgcEJzc0Rlc2NyaXB0aW9uLCBwQnVmLAorICAgICAgICAgICAgICAgICh0QU5JX1U4KXBQcm9maWxlLT51YXBzZF9tYXNrKTsKKworICAgICAgICBzdGF0dXMgPSBwYWxTZW5kTUJNZXNzYWdlKHBNYWMtPmhIZGQsIHBNc2cgKTsKKyAgICAgICAgLyogTWVtb3J5IGFsbG9jYXRlZCB0byBwTXNnIHdpbGwgZ2V0IGZyZWUnZCBpbiBwYWxTZW5kTUJNZXNzYWdlICovCisgICAgICAgIHBNc2cgPSBOVUxMOworCisgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgeworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisjaWZuZGVmIFdMQU5fTURNX0NPREVfUkVEVUNUSU9OX09QVAorICAgICAgICAgICAgaWYgKGVXTklfU01FX0pPSU5fUkVRID09IG1lc3NhZ2VUeXBlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vVHVzaC1Rb1M6IG5vdGlmeSBRb1MgbW9kdWxlIHRoYXQgam9pbiBoYXBwZW5pbmcKKyAgICAgICAgICAgICAgICBzbWVfUW9zQ3NyRXZlbnRJbmQocE1hYywgKHZfVThfdClzZXNzaW9uSWQsIFNNRV9RT1NfQ1NSX0pPSU5fUkVRLCBOVUxMKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKGVXTklfU01FX1JFQVNTT0NfUkVRID09IG1lc3NhZ2VUeXBlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vVHVzaC1Rb1M6IG5vdGlmeSBRb1MgbW9kdWxlIHRoYXQgcmVhc3NvYyBoYXBwZW5pbmcKKyAgICAgICAgICAgICAgICBzbWVfUW9zQ3NyRXZlbnRJbmQocE1hYywgKHZfVThfdClzZXNzaW9uSWQsIFNNRV9RT1NfQ1NSX1JFQVNTT0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NTKHN0YXR1cykpCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTXNnKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIC8vIHJlYXNvbkNvZGUKKyAgICAgICAgd1RtcCA9IHBhbF9jcHVfdG9fYmUxNihyZWFzb25Db2RlKTsKKyAgICAgICAgdm9zX21lbV9jb3B5KHBCdWYsICZ3VG1wLCBzaXplb2YodEFOSV9VMTYpKTsKKyAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocE1zZyk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBwQnVmICs9IHNpemVvZih0QU5JX1UxNik7CisgICAgICAgIC8qIFRoZSBzdGF0ZSB3aWxsIGJlIERJU0FTU09DX0hBTkRPRkYgb25seSB3aGVuIHdlIGFyZSBkb2luZyBoYW5kb2ZmLiAKKyAgICAgICAgICAgICAgICAgICAgSGVyZSB3ZSBzaG91bGQgbm90IHNlbmQgdGhlIGRpc2Fzc29jIG92ZXIgdGhlIGFpciB0byB0aGUgQVAgKi8KKyAgICAgICAgaWYgKCBDU1JfSVNfUk9BTV9TVUJTVEFURV9ESVNBU1NPQ19ITyhwTWFjLCBzZXNzaW9uSWQpCisjaWZkZWYgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIKKyAgICAgICAgICAgICAgICAmJiBjc3JSb2FtSXMxMXJBc3NvYyhwTWFjKQorI2VuZGlmCisgICAgICAgICAgICkgICAgICAgICAgICAKKyAgICAgICAgeworICAgICAgICAgICAgKnBCdWYgPSBDU1JfRE9OVF9TRU5EX0RJU0FTU09DX09WRVJfVEhFX0FJUjsgIC8qIFNldCBEb05vdFNlbmRPdmVyVGhlQWlyIGZsYWcgdG8gMSBvb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0gcGFsX2NwdV90b19iZTE2KCh0QU5JX1UxNilzaXplb2YoIHRTaXJTbWVUa2lwQ250ck1lYXNSZXEgKSk7CisgICAgICAgIHBCdWYgPSAmcE1zZy0+c2Vzc2lvbklkOworICAgICAgICAvLyBzZXNzaW9uSWQKKyAgICAgICAgKnBCdWYrKyA9ICh0QU5JX1U4KXNlc3Npb25JZDsKKyAgICAgICAgLy8gdHJhbnNhY3Rpb25JZAorICAgICAgICAqcEJ1ZiA9IDA7CisgICAgICAgICooIHBCdWYgKyAxICkgPSAwOworICAgICAgICBwQnVmICs9IHNpemVvZih0QU5JX1UxNik7CisgICAgICAgIC8vIGJzc2lkCisgICAgICAgIHZvc19tZW1fY29weShwTXNnLT5ic3NJZCwgYnNzSWQsIHNpemVvZiggdFNpck1hY0FkZHIgKSk7CisgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgIHBCdWYgPSBwQnVmICsgc2l6ZW9mICggdFNpck1hY0FkZHIgKTsKKyAgICAgICAgLy8gYkVuYWJsZQorICAgICAgICAqcEJ1ZiA9ICh0QU5JX0JPT0xFQU4pYkVuYWJsZTsKKyAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocE1zZyk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBzdGF0dXMgPSBwYWxTZW5kTUJNZXNzYWdlKCBwTWFjLT5oSGRkLCBwTXNnICk7CisgICAgfSB3aGlsZSggMCApOworICAgIHJldHVybiggc3RhdHVzICk7Cit9CitlSGFsU3RhdHVzCitjc3JTZW5kTUJHZXRBc3NvY2lhdGVkU3Rhc1JlcU1zZyggdHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMzIgc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX01PRFVMRV9JRCBtb2RJZCwgdFNpck1hY0FkZHIgYnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpwVXNyQ29udGV4dCwgdm9pZCAqcGZuU2FwRXZlbnRDYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBBc3NvY1N0YXNCdWYgKQoreworICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICB0U2lyU21lR2V0QXNzb2NTVEFzUmVxICpwTXNnOworICAgIHRBTklfVTggKnBCdWYgPSBOVUxMLCAqd1RtcEJ1ZiA9IE5VTEw7CisgICAgdEFOSV9VMzIgZHdUbXA7CisgICAgZG8KKyAgICB7CisgICAgICAgIHBNc2cgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YoIHRTaXJTbWVHZXRBc3NvY1NUQXNSZXEgKSk7CisgICAgICAgIGlmICggTlVMTCA9PSBwTXNnICkKKyAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgIGlmICghSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpIGJyZWFrOworICAgICAgICB2b3NfbWVtX3NldChwTXNnLCBzaXplb2YoIHRTaXJTbWVHZXRBc3NvY1NUQXNSZXEgKSwgMCk7CisgICAgICAgIHBNc2ctPm1lc3NhZ2VUeXBlID0gcGFsX2NwdV90b19iZTE2KCh0QU5JX1UxNillV05JX1NNRV9HRVRfQVNTT0NfU1RBU19SRVEpOworICAgICAgICBwQnVmID0gKHRBTklfVTggKikmcE1zZy0+YnNzSWQ7CisgICAgICAgIHdUbXBCdWYgPSBwQnVmOworICAgICAgICAvLyBic3NJZAorICAgICAgICB2b3NfbWVtX2NvcHkoKHRTaXJNYWNBZGRyICopcEJ1ZiwgYnNzSWQsIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICBwQnVmICs9IHNpemVvZih0U2lyTWFjQWRkcik7CisgICAgICAgIC8vIG1vZElkIAorICAgICAgICBkd1RtcCA9IHBhbF9jcHVfdG9fYmUxNigodEFOSV9VMTYpbW9kSWQpOworICAgICAgICB2b3NfbWVtX2NvcHkocEJ1ZiwgKHRBTklfVTggKikmZHdUbXAsIHNpemVvZih0QU5JX1UxNikpOworICAgICAgICBwQnVmICs9IHNpemVvZih0QU5JX1UxNik7CisgICAgICAgIC8vIHBVc3JDb250ZXh0CisgICAgICAgIHZvc19tZW1fY29weShwQnVmLCAodEFOSV9VOCAqKXBVc3JDb250ZXh0LCBzaXplb2Yodm9pZCAqKSk7CisgICAgICAgIHBCdWYgKz0gc2l6ZW9mKHZvaWQqKTsKKyAgICAgICAgLy8gcGZuU2FwRXZlbnRDYWxsYmFjaworICAgICAgICB2b3NfbWVtX2NvcHkocEJ1ZiwgKHRBTklfVTggKilwZm5TYXBFdmVudENhbGxiYWNrLCBzaXplb2Yodm9pZCopKTsKKyAgICAgICAgcEJ1ZiArPSBzaXplb2Yodm9pZCopOworICAgICAgICAvLyBwQXNzb2NTdGFzQnVmCisgICAgICAgIHZvc19tZW1fY29weShwQnVmLCBwQXNzb2NTdGFzQnVmLCBzaXplb2Yodm9pZCopKTsKKyAgICAgICAgcEJ1ZiArPSBzaXplb2Yodm9pZCopOworICAgICAgICBwTXNnLT5sZW5ndGggPSBwYWxfY3B1X3RvX2JlMTYoKHRBTklfVTE2KShzaXplb2YodEFOSV9VMzIgKSArIChwQnVmIC0gd1RtcEJ1ZikpKTsvL21zZ19oZWFkZXIgKyBtc2cKKyAgICAgICAgc3RhdHVzID0gcGFsU2VuZE1CTWVzc2FnZSggcE1hYy0+aEhkZCwgcE1zZyApOworICAgIH0gd2hpbGUoIDAgKTsKKyAgICByZXR1cm4oIHN0YXR1cyApOworICAgICAgICB9CitlSGFsU3RhdHVzC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MX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgIHsKKyAgICAgICAgIHZvc19tZW1fc2V0KHBNc2csIHNpemVvZih0U2lyU2V0SFQyMDQwTW9kZSksIDApOworICAgICAgICAgcE1zZy0+bWVzc2FnZVR5cGUgICAgID0gZVdOSV9TTUVfU0VUX0hUXzIwNDBfTU9ERTsKKyAgICAgICAgIHBNc2ctPmxlbmd0aCAgICAgICAgICA9IGxlbjsKKworICAgICAgICAvLyBic3NJZAorICAgICAgICB2b3NfbWVtX2NvcHkoKHRTaXJNYWNBZGRyICopcE1zZy0+YnNzSWQsICZwU2Vzc2lvbi0+c2VsZk1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKworICAgICAgICBzbXNMb2coIHBNYWMsIExPR1csIEZMKCJDU1IgQXR0ZW1wdGluZyB0byBzZXQgIgorICAgICAgICAgICAgICAgICAgICAgICJIVDIwLzQwIG1vZGUgZm9yIEJzc2lkPSAiTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwTXNnLT5ic3NJZCkpOworCisgICAgICAgIHBNc2ctPnNlc3Npb25JZCA9IHNlc3Npb25JZDsKKyAgICAgICAgcE1zZy0+Y2JNb2RlICAgID0gY2JNb2RlOworCisgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLCBGTCgic2Vzc2lvbiAlZCBDaGFubmVsIEJvbmRpbmc6ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCwgY2JNb2RlKTsKKworICAgICAgICBzdGF0dXMgPSBwYWxTZW5kTUJNZXNzYWdlKHBNYWMtPmhIZGQsIHBNc2cpOworICAgICB9CisgICAgIHJldHVybiBzdGF0dXM7Cit9CisjZW5kaWYKKworZUhhbFN0YXR1cyBjc3JTZW5kTUJEZWF1dGhSZXFNc2coIHRwQW5pU2lyR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vL3Nlc3Npb25JZAorICAgICAgICBwQnVmID0gJnBNc2ctPnNlc3Npb25JZDsKKyAgICAgICAgKnBCdWYrKyA9ICh0QU5JX1U4KXNlc3Npb25JZDsKKyAgICAgICAgCisgICAgICAgIC8vdGFuc2FjdGlvbklkCisgICAgICAgICpwQnVmID0gMDsKKyAgICAgICAgKihwQnVmICsgMSApID0gMDsKKyAgICAgICAgcEJ1ZiArPSBzaXplb2YodEFOSV9VMTYpOworICAgICAgICBpZiAoKHBTZXNzaW9uLT5wQ3VyUm9hbVByb2ZpbGUgIT0gTlVMTCkgICYmICgKKyAgICAgICAgICAgICAoQ1NSX0lTX0lORlJBX0FQKHBTZXNzaW9uLT5wQ3VyUm9hbVByb2ZpbGUpKSB8fCAKKyAgICAgICAgICAgICAoQ1NSX0lTX1dEU19BUChwU2Vzc2lvbi0+cEN1clJvYW1Qcm9maWxlKSkpKXsgCisgICAgICAgICAgICAvLyBTZXQgdGhlIEJTU0lEIGJlZm9yZSBzZW5kaW5nIHRoZSBtZXNzYWdlIHRvIExJTQorICAgICAgICAgICAgdm9zX21lbV9jb3B5KCAodFNpck1hY0FkZHIgKilwQnVmLCBwU2Vzc2lvbi0+c2VsZk1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoIHBNc2ctPnBlZXJNYWNBZGRyICkgKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICBwQnVmID0gIHBCdWYgKyBzaXplb2YodFNpck1hY0FkZHIpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLy8gU2V0IHRoZSBCU1NJRCBiZWZvcmUgc2VuZGluZyB0aGUgbWVzc2FnZSB0byBMSU0KKyAgICAgICAgICAgIHZvc19tZW1fY29weSggKHRTaXJNYWNBZGRyICopcEJ1ZiwgYnNzSWQsIHNpemVvZiggcE1zZy0+cGVlck1hY0FkZHIgKSApOworICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgIHBCdWYgPSAgcEJ1ZiArIHNpemVvZih0U2lyTWFjQWRkcik7CisgICAgICAgIH0KKyAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocE1zZyk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfSAgICAgCisgICAgICAgICAgICAgICAgLy8gU2V0IHRoZSBwZWVyIE1BQyBhZGRyZXNzIGJlZm9yZSBzZW5kaW5nIHRoZSBtZXNzYWdlIHRvIExJTQorICAgICAgICB2b3NfbWVtX2NvcHkoICh0U2lyTWFjQWRkciAqKSBwQnVmLCBic3NJZCwgc2l6ZW9mKCBwTXNnLT5wZWVyTWFjQWRkciApICk7CisgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgIHBCdWYgPSAgcEJ1ZiArIHNpemVvZih0U2lyTWFjQWRkcik7CisgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBNc2cpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0gICAgIAorICAgICAgICB3VG1wID0gcGFsX2NwdV90b19iZTE2KHJlYXNvbkNvZGUpOworICAgICAgICB2b3NfbWVtX2NvcHkoIHBCdWYsICZ3VG1wLHNpemVvZiggdEFOSV9VMTYgKSApOworICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTXNnKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIHN0YXR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HZvc19tZW1fY29weShwTXNnLT5wZWVyTWFjQWRkciwgcERpc2Fzc29jSW5kLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgIHNpemVvZihwTXNnLT5wZWVyTWFjQWRkcikpOworICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTXNnKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisvL1RvIHRlc3QgcmVjb25uICAgICAgICAKKyAgICAgICAgdm9zX21lbV9jb3B5KHBNc2ctPmJzc0lkLCBwRGlzYXNzb2NJbmQtPmJzc0lkLCBzaXplb2YocE1zZy0+cGVlck1hY0FkZHIpKTsKKyAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocE1zZyk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorLy9UbyB0ZXN0IHJlY29ubiBlbmRzCisgICAgICAgIHN0YXR1cyA9IHBhbFNlbmRNQk1lc3NhZ2UoIHBNYWMtPmhIZGQsIHBNc2cgKTsKKyAgICB9IHdoaWxlKCAwICk7CisgICAgcmV0dXJuKCBzdGF0dXMgKTsKK30KKworZUhhbFN0YXR1cyBjc3JTZW5kTUJEZWF1dGhDbmZNc2coIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRwU2lyU21lRGVhdXRoSW5kIHBEZWF1dGhJbmQgKQoreworICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICB0U2lyU21lRGVhdXRoQ25mICpwTXNnOworICAgIGRvIHsKKyAgICAgICAgcE1zZyA9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ICAgICAgIHNpemVvZihwTXNnLT5wZWVyTWFjQWRkcikpOworICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTXNnKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIHN0YXR1cyA9IHBhbFNlbmRNQk1lc3NhZ2UoIHBNYWMtPmhIZGQsIHBNc2cgKTsKKyAgICB9IHdoaWxlKCAwICk7CisgICAgcmV0dXJuKCBzdGF0dXMgKTsKK30KK2VIYWxTdGF0dXMgY3NyU2VuZEFzc29jQ25mTXNnKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0cFNpclNtZUFzc29jSW5kIHBBc3NvY0luZCwgZUhhbFN0YXR1cyBIYWxzdGF0dXMgKQoreworICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICB0U2lyU21lQXNzb2NDbmYgKnBNc2c7CisgICAgdEFOSV9VOCAqcEJ1ZjsKKyAgICB0U2lyUmVzdWx0Q29kZXMgc3RhdHVzQ29kZTsKKyAgICB0QU5JX1UxNiB3VG1wOworCisgICAgc21zTG9nKCBwTWFjLCBMT0cxLCBGTCgiUG9zdGluZyBlV05JX1NNRV9BU1NPQ19DTkYgdG8gTElNLiAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiSGFsU3RhdHVzIDogJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBIYWxzdGF0dXMpOworICAgIGRvIHsKKyAgICAgICAgcE1zZyA9IHZvc19tZW1fbWFsbG9jKHNpemVvZiggdFNpclNtZUFzc29jQ25mICkpOworICAgICAgICBpZiAoIE5VTEwgPT0gcE1zZyApCisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICBl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KKyAgICAgICAgcEJ1ZiArPSBzaXplb2YgKHRTaXJNYWNBZGRyKTsKKyAgICAgICAgLy8gcGVlck1hY0FkZHIKKyAgICAgICAgdm9zX21lbV9jb3B5KCh0U2lyTWFjQWRkciAqKXBCdWYsIHBBc3NvY0luZC0+cGVlck1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgIHBCdWYgKz0gc2l6ZW9mICh0U2lyTWFjQWRkcik7CisgICAgICAgIC8vIGFpZAorICAgICAgICB3VG1wID0gcGFsX2NwdV90b19iZTE2KHBBc3NvY0luZC0+YWlkKTsKKyAgICAgICAgdm9zX21lbV9jb3B5KHBCdWYsICZ3VG1wLCBzaXplb2YodEFOSV9VMTYpKTsKKyAgICAgICAgcEJ1ZiArPSBzaXplb2YgKHRBTklfVTE2KTsKKyAgICAgICAgLy8gYWx0ZXJuYXRlQnNzSWQKKyAgICAgICAgdm9zX21lbV9jb3B5KCh0U2lyTWFjQWRkciAqKXBCdWYsIHBBc3NvY0luZC0+YnNzSWQsIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICBwQnVmICs9IHNpemVvZiAodFNpck1hY0FkZHIpOworICAgICAgICAvLyBhbHRlcm5hdGVDaGFubmVsSWQKKyAgICAgICAgKnBCdWYgPSAxMTsKKyAgICAgICAgc3RhdHVzID0gcGFsU2VuZE1CTWVzc2FnZSggcE1hYy0+aEhkZCwgcE1zZyApOworICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vcE1zZyBpcyBmcmVlZCBieSBwYWxTZW5kTUJNZXNzYWdlCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0gd2hpbGUoIDAgKTsKKyAgICByZXR1cm4oIHN0YXR1cyApOworfQorZUhhbFN0YXR1cyBjc3JTZW5kQXNzb2NJbmRUb1VwcGVyTGF5ZXJDbmZNc2coICAgdHBBbmlTaXJHbG9iYWwgcE1hYywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFNpclNtZUFzc29jSW5kIHBBc3NvY0luZCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlSGFsU3RhdHVzIEhhbHN0YXR1cywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IHNlc3Npb25JZCkKK3sKKyAgICB0U2lyTXNnUSAgICAgICAgICAgIG1zZ1E7CisgICAgdFNpclNtZUFzc29jSW5kVG9VcHBlckxheWVyQ25mICpwTXNnOworICAgIHRBTklfVTggKnBCdWY7CisgICAgdFNpclJlc3VsdENvZGVzIHN0YXR1c0NvZGU7CisgICAgdEFOSV9VMTYgd1RtcDsKKyAgICBkbyB7CisgICAgICAgIHBNc2cgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YoIHRTaXJTbWVBc3NvY0luZFRvVXBwZXJMYXllckNuZiApKTsKKyAgICAgICAgaWYgKCBOVUxMID09IHBNc2cgKSByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgdm9zX21lbV9zZXQocE1zZywgc2l6ZW9mKCB0U2lyU21lQXNzb2NJbmRUb1VwcGVyTGF5ZXJDbmYgKSwgMCk7CisKKyAgICAgICAgcE1zZy0+bWVzc2FnZVR5cGUgPSBwYWxfY3B1X3RvX2JlMTYoKHRBTklfVTE2KWVXTklfU01FX1VQUEVSX0xBWUVSX0FTU09DX0NORik7CisgICAgICAgIHBNc2ctPmxlbmd0aCA9IHBhbF9jcHVfdG9fYmUxNigodEFOSV9VMTYpc2l6ZW9mKCB0U2lyU21lQXNzb2NJbmRUb1VwcGVy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YWwubnVtS2V5cyApICsKKyAgICAgICAgICAgICAgICAgICggc2l6ZW9mKCBwTXNnLT5rZXlNYXRlcmlhbC5rZXkgKSApOworICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgIHBNc2cgPSB2b3NfbWVtX21hbGxvYyhtc2dMZW4pOworICAgICAgICBpZiAoIE5VTEwgPT0gcE1zZyApIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICB2b3NfbWVtX3NldChwTXNnLCBtc2dMZW4sIDApOworICAgICAgICAgICAgICAgIHBNc2ctPm1lc3NhZ2VUeXBlID0gcGFsX2NwdV90b19iZTE2KCh0QU5JX1UxNillV05JX1NNRV9TRVRDT05URVhUX1JFUSk7CisgICAgICAgICAgICAgICAgcE1zZy0+bGVuZ3RoID0gcGFsX2NwdV90b19iZTE2KG1zZ0xlbik7CisgICAgICAgIC8vc2Vzc2lvbklkCisgICAgICAgIHBCdWYgPSAmcE1zZy0+c2Vzc2lvbklkOworICAgICAgICAqcEJ1ZiA9ICh0QU5JX1U4KXNlc3Npb25JZDsKKyAgICAgICAgcEJ1ZisrOworICAgICAgICAvLyB0cmFuc2FjdGlvbklkCisgICAgICAgICpwQnVmID0gMDsKKyAgICAgICAgKihwQnVmICsgMSkgPSAwOworICAgICAgICBwQnVmICs9IHNpemVvZih0QU5JX1UxNik7CisgICAgICAgIC8vIHBlZXJNYWNBZGRyCisgICAgICAgIHZvc19tZW1fY29weShwQnVmLCAodEFOSV9VOCAqKXBlZXJNYWNBZGRyLCBzaXplb2YodFNpck1hY0FkZHIpKTsKKworICAgICAgICBwQnVmICs9IHNpemVvZih0U2lyTWFjQWRkcik7CisKKyAgICAgICAgLy8gYnNzSWQKKyAgICAgICAgdm9zX21lbV9jb3B5KHBCdWYsICh0QU5JX1U4ICopJnBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlLmJzc2lkLAorICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisKKyAgICAgICAgcEJ1ZiArPSBzaXplb2YodFNpck1hY0FkZHIpOworCisgICAgICAgIHAgPSBwQnVmOworICAgICAgICAgICAgICAgIC8vIFNldCB0aGUgcE1zZy0+a2V5TWF0ZXJpYWwubGVuZ3RoIGZpZWxkICh0aGlzIGxlbmd0aCBpcyBkZWZpbmVkIGFzIGFsbCBkYXRhIHRoYXQgZm9sbG93cyB0aGUgZWRUeXBlIGZpZWxkCisgICAgICAgICAgICAgICAgLy8gaW4gdGhlIHRTaXJLZXlNYXRlcmlhbCBrZXlNYXRlcmlhbDsgZmllbGQpLgorICAgICAgICAgICAgICAgIC8vCisgICAgICAgICAgICAgICAgLy8gISFOT1RFOiAgVGhpcyBrZXlNYXRlcmlhbC5sZW5ndGggY29udGFpbnMgdGhlIGxlbmd0aCBvZiBhIE1BWCBzaXplIGtleSwgdGhvdWdoIHRoZSBrZXlMZW5ndGggY2FuIGJlIAorICAgICAgICAgICAgICAgIC8vIHNob3J0ZXIgdGhhbiB0aGlzIG1heCBzaXplLiAgSXMgTElNIGludGVycHJldGluZyB0aGlzIG9rID8KKyAgICAgICAgICAgICAgICBwID0gcGFsX3NldF9VMTYoIHAsIHBhbF9jcHVfdG9fYmUxNigodEFOSV9VMTYpKCBzaXplb2YoIHBNc2ctPmtleU1hdGVyaWFsLm51bUtleXMgKSArICggbnVtS2V5cyAqIHNpemVvZiggcE1zZy0+a2V5TWF0ZXJpYWwua2V5ICkgKSApKSApOworICAgICAgICAgICAgICAgIC8vIHNldCBwTXNnLT5rZXlNYXRlcmlhbC5lZFR5cGUKKyAgICAgICAgdG1wRWRUeXBlID0gKHRBbmlFZFR5cGUpcGFsX2NwdV90b19iZTMyKGVkVHlwZSk7CisgICAgICAgIHZvc19tZW1fY29weShwLCAodEFOSV9VOCAqKSZ0bXBFZFR5cGUsIHNpemVvZih0QW5pRWRUeXBlKSk7CisgICAgICAgIHAgKz0gc2l6ZW9mKCBwTXNnLT5rZXlNYXRlcmlhbC5lZFR5cGUgKTsKKyAgICAgICAgLy8gc2V0IHRoZSBwTXNnLT5rZXlNYXRlcmlhbC5udW1LZXlzIGZpZWxkCisgICAgICAgICpwID0gbnVtS2V5czsKKyAgICAgICAgcCArPSBzaXplb2YoIHBNc2ctPmtleU1hdGVyaWFsLm51bUtleXMgKTsgICAKKyAgICAgICAgLy8gc2V0IHBTaXJLZXktPmtleUlkID0ga2V5SWQ7CisgICAgICAgICpwID0ga2V5SWQ7CisgICAgICAgIHAgKz0gc2l6ZW9mKCBwTXNnLT5rZXlNYXRlcmlhbC5rZXlbIDAgXS5rZXlJZCApOworICAgICAgICAvLyBzZXQgcFNpcktleS0+dW5pY2FzdCA9ICh0QU5JX1U4KWZVbmljYXN0OworICAgICAgICAqcCA9ICh0QU5JX1U4KWZVbmljYXN0OworICAgICAgICBwICs9IHNpemVvZiggcE1zZy0+a2V5TWF0ZXJpYWwua2V5WyAwIF0udW5pY2FzdCApOworICAgICAgICAgICAgICAgIC8vIHNldCBwU2lyS2V5LT5rZXlEaXJlY3Rpb24gPSBhbmlLZXlEaXJlY3Rpb247CisgICAgICAgIHRtcERpcmVjdGlvbiA9ICh0QW5pS2V5RGlyZWN0aW9uKXBhbF9jcHVfdG9fYmUzMihhbmlLZXlEaXJlY3Rpb24pOworICAgICAgICB2b3NfbWVtX2NvcHkocCwgKHRBTklfVTggKikmdG1wRGlyZWN0aW9uLCBzaXplb2YodEFuaUtleURpcmVjdGlvbikpOworICAgICAgICBwICs9IHNpemVvZih0QW5pS2V5RGlyZWN0aW9uKTsKKyAgICAgICAgLy8gICAgcFNpcktleS0+a2V5UnNjID0gOzsKKyAgICAgICAgdm9zX21lbV9jb3B5KHAsIHBLZXlSc2MsIENTUl9NQVhfUlNDX0xFTik7CisgICAgICAgIHAgKz0gc2l6ZW9mKCBwTXNnLT5rZXlNYXRlcmlhbC5rZXlbIDAgXS5rZXlSc2MgKTsKKyAgICAgICAgICAgICAgICAvLyBzZXQgcFNpcktleS0+cGFlUm9sZQorICAgICAgICAgICAgICAgICpwID0gcGFlUm9sZTsgICAvLyAwIGlzIFN1cHBsaWNhbnQKKyAgICAgICAgICAgICAgICBwKys7CisgICAgICAgICAgICAgICAgLy8gc2V0IHBTaXJLZXktPmtleUxlbmd0aCA9IGtleUxlbmd0aDsKKyAgICAgICAgICAgICAgICBwID0gcGFsX3NldF9VMTYoIHAsIHBhbF9jcHVfdG9fYmUxNihrZXlMZW5ndGgpICk7CisgICAgICAgIGlmICgga2V5TGVuZ3RoICYmIHBLZXkgKSAKKyAgICAgICAgeyAgIAorICAgICAgICAgICAgdm9zX21lbV9jb3B5KHAsIHBLZXksIGtleUxlbmd0aCk7CisgICAgICAgICAgICBpZihrZXlMZW5ndGggPT0gMTYpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsICIgIFNNRSBTZXQga2V5SWR4ICglZCkgZW5jVHlwZSglZCkga2V5ID0gJTAyWC0lMDJYLSUwMlgtJTAyWC0lMDJYLSUwMlgtJTAyWC0lMDJYLSUwMlgtJTAyWC0lMDJYLSUwMlgtJTAyWC0lMDJYLSUwMlgtJTAyWCIsCisgICAgICAgICAgICAgICAga2V5SWQsIGVkVHlwZSwgcEtleVswXSwgcEtleVsxXSwgcEtleVsyXSwgcEtleVszXSwgcEtleVs0XSwKKyAgICAgICAgICAgICAgICBwS2V5WzVdLCBwS2V5WzZdLCBwS2V5WzddLCBwS2V5WzhdLAorICAgICAgICAgICAgICAgIHBLZXlbOV0sIHBLZXlbMTBdLCBwS2V5WzExXSwgcEtleVsxMl0sIHBLZXlbMTNdLCBwS2V5WzE0XSwgcEtleVsxNV0pOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHN0YXR1cyA9IHBhbFNlbmRNQk1lc3NhZ2UocE1hYy0+aEhkZCwgcE1zZyk7CisgICAgfSB3aGlsZSggMCApOworICAgIHJldHVybiggc3RhdHVzICk7Cit9CisKK2VIYWxTdGF0dXMgY3NyU2VuZE1CU3R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c3NEZXNjLT5iZWFjb25JbnRlcnZhbCApOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYocFBhcmFtLT5iZWFjb25JbnRlcnZhbCkKKyAgICAgICAgeworICAgICAgICAgICAgd1RtcCA9IHBhbF9jcHVfdG9fYmUxNiggcFBhcmFtLT5iZWFjb25JbnRlcnZhbCApOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgd1RtcCA9IHBhbF9jcHVfdG9fYmUxNiggV05JX0NGR19CRUFDT05fSU5URVJWQUxfU1RBREVGICk7CisgICAgICAgIH0KKyAgICAgICAgaWYoY3NySXNjb25jdXJyZW50c2Vzc2lvblZhbGlkIChwTWFjLCBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQYXJhbS0+YnNzUGVyc29uYSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gZUhBTF9TVEFUVVNfU1VDQ0VTUyApCisgICAgICAgIHsgICAgCisgICAgICAgICAgIGNzclZhbGlkYXRlTUNDQmVhY29uSW50ZXJ2YWwocE1hYywgcFBhcmFtLT5vcGVyYXRpb25DaG4sICZ3VG1wLCBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQYXJhbS0+YnNzUGVyc29uYSk7CisgICAgICAgICAgIC8vVXBkYXRlIHRoZSBiZWFjb24gSW50ZXJ2YWwgCisgICAgICAgICAgIHBQYXJhbS0+YmVhY29uSW50ZXJ2YWwgPSB3VG1wOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKCBwTWFjLExPR0UsIEZMKCIqKioqU3RhcnQgQlNTIGZhaWxlZCBwZXJzb25hIGFscmVhZHkgZXhpc3RzKioqIikpOworICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTXNnKTsKKyAgICAgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgICAgIH0KKworICAgICAgICB2b3NfbWVtX2NvcHkocEJ1ZiwgJndUbXAsIHNpemVvZiggdEFOSV9VMTYgKSk7CisgICAgICAgIHBCdWYgKz0gc2l6ZW9mKHRBTklfVTE2KTsKKyAgICAgICAgLy8gZG90MTFtb2RlCisgICAgICAgICpwQnVmID0gKHRBTklfVTgpY3NyVHJhbnNsYXRlVG9XTklDZmdEb3QxMU1vZGUoIHBNYWMsIHBQYXJhbS0+dUNmZ0RvdDExTW9kZSApOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIC8vIGJzc1R5cGUKKyAgICAgICAgZHdUbXAgPSBwYWxfY3B1X3RvX2JlMzIoIGNzclRyYW5zbGF0ZUJzc3R5cGVUb01hY1R5cGUoIGJzc1R5cGUgKSApOworICAgICAgICB2b3NfbWVtX2NvcHkocEJ1ZiwgJmR3VG1wLCBzaXplb2YodFNpckJzc1R5cGUpKTsKKyAgICAgICAgcEJ1ZiArPSBzaXplb2YodFNpckJzc1R5cGUpOworICAgICAgICAvLyBzc0lkCisgICAgICAgIGlmKCBwUGFyYW0tPnNzSWQubGVuZ3RoICkKKyAgICAgICAgeworICAgICAgICAgICAgLy8gc3NJZCBsZW4KKyAgICAgICAgICAgICpwQnVmID0gcFBhcmFtLT5zc0lkLmxlbmd0aDsKKyAgICAgICAgICAgIHBCdWYrKzsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwQnVmLCBwUGFyYW0tPnNzSWQuc3NJZCwgcFBhcmFtLT5zc0lkLmxlbmd0aCk7CisgICAgICAgICAgICBwQnVmICs9IHBQYXJhbS0+c3NJZC5sZW5ndGg7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAqcEJ1ZiA9IDA7CisgICAgICAgICAgICBwQnVmKys7ICAgICAgICAKKyAgICAgICAgfQorICAgICAgICAvLyBzZXQgdGhlIGNoY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byb3RFbmFibGVkOworICAgICAgICBwQnVmKys7CisgICAgICAgIC8vc2V0IGNmZyByZWxhdGVkIHRvIHByb3RlY3Rpb24KKyAgICAgICAgd1RtcCA9IHBhbF9jcHVfdG9fYmUxNiggcFBhcmFtLT5odF9wcm90ZWN0aW9uICk7CisgICAgICAgIHZvc19tZW1fY29weShwQnVmLCAmd1RtcCwgc2l6ZW9mKCB0QU5JX1UxNiApKTsKKyAgICAgICAgcEJ1ZiArPSBzaXplb2YodEFOSV9VMTYpOworICAgICAgICAvLyBTZXQgQXV0aCB0eXBlCisgICAgICAgIGF1dGhUeXBlID0gcGFsX2NwdV90b19iZTMyKHBQYXJhbS0+YXV0aFR5cGUpOworICAgICAgICB2b3NfbWVtX2NvcHkocEJ1ZiwgKHRBTklfVTggKikmYXV0aFR5cGUsIHNpemVvZih0QU5JX1UzMikpOworICAgICAgICBwQnVmICs9IHNpemVvZih0QU5JX1UzMik7CisgICAgICAgIC8vIFNldCBEVElNCisgICAgICAgIGR3VG1wID0gcGFsX2NwdV90b19iZTMyKHBQYXJhbS0+ZHRpbVBlcmlvZCk7CisgICAgICAgIHZvc19tZW1fY29weShwQnVmLCAodEFOSV9VOCAqKSZkd1RtcCwgc2l6ZW9mKHRBTklfVTMyKSk7CisgICAgICAgIHBCdWYgKz0gc2l6ZW9mKHRBTklfVTMyKTsKKyAgICAgICAgLy8gU2V0IHdwc19zdGF0ZQorICAgICAgICAqcEJ1ZiA9IHBQYXJhbS0+d3BzX3N0YXRlOworICAgICAgICBwQnVmKys7CisgICAgICAgIC8vIHNldCBpc0NvYWxlc2luZ0luSUJTU0FsbG93ZWQKKyAgICAgICAgKnBCdWYgPSBwTWFjLT5pc0NvYWxlc2luZ0luSUJTU0FsbG93ZWQ7CisgICAgICAgIHBCdWYrKzsKKyAgICAgICAgLy9QZXJzb25hCisgICAgICAgICpwQnVmID0gKHRBTklfVTgpcFBhcmFtLT5ic3NQZXJzb25hOworICAgICAgICBwQnVmKys7CisgICAgICAgIAorICAgICAgICAvL3R4TGRwY0luaUZlYXR1cmVFbmFibGVkCisgICAgICAgICpwQnVmID0gKHRBTklfVTgpKHRBTklfVTgpcE1hYy0+cm9hbS5jb25maWdQYXJhbS50eExkcGNFbmFibGU7CisgICAgICAgIHBCdWYrKzsKKworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMVcKKyAgICAgICAgLy8gU2V0IE1GUCBjYXBhYmxlL3JlcXVpcmVkCisgICAgICAgICpwQnVmID0gKHRBTklfVTgpcFBhcmFtLT5tZnBDYXBhYmxlOworICAgICAgICBwQnVmKys7CisgICAgICAgICpwQnVmID0gKHRBTklfVTgpcFBhcmFtLT5tZnBSZXF1aXJlZDsKKyAgICAgICAgcEJ1ZisrOworI2VuZGlmCisKKyAgICAgICAgLy8gc2V0IFJTTiBJRQorICAgICAgICBpZiggcFBhcmFtLT5uUlNOSUVMZW5ndGggPiBzaXplb2YocE1zZy0+cnNuSUUucnNuSUVkYXRhKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0lOVkFMSURfUEFSQU1FVEVSOworICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBNc2cpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgd1RtcCA9IHBhbF9jcHVfdG9fYmUxNiggcFBhcmFtLT5uUlNOSUVMZW5ndGggKTsKKyAgICAgICAgdm9zX21lbV9jb3B5KHBCdWYsICZ3VG1wLCBzaXplb2YodEFOSV9VMTYpKTsKKyAgICAgICAgcEJ1ZiArPSBzaXplb2YodEFOSV9VMTYpOworICAgICAgICBpZiggd1RtcCApCisgICAgICAgIHsKKyAgICAgICAgICAgIHdUbXAgPSBwUGFyYW0tPm5SU05JRUxlbmd0aDsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwQnVmLCBwUGFyYW0tPnBSU05JRSwgd1RtcCk7CisgICAgICAgICAgICBwQnVmICs9IHdUbXA7CisgICAgICAgIH0KKyAgIC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pemVvZiggdFNpclNtZVN0b3BCc3NSZXEgKSwgMCk7CisgICAgcE1zZy0+bWVzc2FnZVR5cGUgPSBwYWxfY3B1X3RvX2JlMTYoKHRBTklfVTE2KWVXTklfU01FX1NUT1BfQlNTX1JFUSk7CisgICAgcEJ1ZiA9ICZwTXNnLT5zZXNzaW9uSWQ7CisgICAgLy9zZXNzaW9uSWQKKyAgICAqcEJ1ZiA9ICh0QU5JX1U4KXNlc3Npb25JZDsKKyAgICBwQnVmKys7CisgICAgLy8gdHJhbnNhY3Rpb25JZAorICAgICpwQnVmID0gMDsKKyAgICBwQnVmICs9IHNpemVvZih0QU5JX1UxNik7CisgICAgLy9yZWFzb24gY29kZQorICAgICpwQnVmICA9IDA7CisgICAgcEJ1ZiArPSBzaXplb2YodFNpclJlc3VsdENvZGVzKTsKKyAgICAvLyBic3NpZAorICAgIC8vIGlmIEJTU1R5cGUgaXMgV0RTIHN0YSwgdXNlIHNlbGZtYWNBZGRyIGFzIGJzc2lkLCBlbHNlIHVzZSBic3NpZCBpbiBjb25uZWN0ZWRQcm9maWxlCisgICAgaWYoIENTUl9JU19DT05OX1dEU19TVEEoJnBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlKSApCisgICAgeworICAgICAgICB2b3NfbWVtX2NvcHkocEJ1ZiwgKHRBTklfVTggKikmcFNlc3Npb24tPnNlbGZNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgdm9zX21lbV9jb3B5KHBCdWYsICh0QU5JX1U4ICopJnBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlLmJzc2lkLAorICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICB9CisgICAgcEJ1ZiArPSBzaXplb2YodFNpck1hY0FkZHIpOworICAgIG1zZ0xlbiA9IHNpemVvZih0QU5JX1UxNikgKyBzaXplb2YodEF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bSAgICAgICAgICAgICAgICAgICAgICAgICAgKnBFbnRyeSA9IE5VTEw7CisgICB0U21lQ21kICAgICAgICAgICAgICAgICAgICAgICAgICAgICpwQ29tbWFuZCA9IE5VTEw7CisgICB0U2lyU21lQWRkU3RhU2VsZlJzcCAgICAgICAgICAgICAgICpwUnNwOworICAgZG8KKyAgIHsKKyAgICAgIGlmKHBNc2cgPT0gTlVMTCkKKyAgICAgIHsKKyAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCAiaW4gJXMgbXNnIHB0ciBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgcEVudHJ5ID0gY3NyTExQZWVrSGVhZCggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0LCBMTF9BQ0NFU1NfTE9DSyApOworICAgICAgaWYocEVudHJ5KQorICAgICAgeworICAgICAgICAgcENvbW1hbmQgPSBHRVRfQkFTRV9BRERSKCBwRW50cnksIHRTbWVDbWQsIExpbmsgKTsKKyAgICAgICAgIGlmKGVTbWVDb21tYW5kQWRkU3RhU2Vzc2lvbiA9PSBwQ29tbWFuZC0+Y29tbWFuZCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHBSc3AgPSAodFNpclNtZUFkZFN0YVNlbGZSc3AqKXBNc2c7CisgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPRzEsICJBZGQgU3RhIHJzcCBzdGF0dXMgPSAlZCIsIHBSc3AtPnN0YXR1cyApOworICAgICAgICAgICAgaWYgKHBSc3AtPnN0YXR1cyA9PSBlU0lSX0ZBSUxVUkUpIHsKKyAgICAgICAgICAgICAgICBWT1NfQVNTRVJUKCAwICk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvL05vdGhpbmcgdG8gYmUgZG9uZS4gTWF5IGJlIGluZGljYXRlIHRoZSBzZWxmIHN0YSBhZGRpdGlvbiBzdWNjZXNzIGJ5IGNhbGxpbmcgc2Vzc2lvbiBjYWxsYmFjayAoVE9ETykuCisgICAgICAgICAgICBjc3JSb2FtU2Vzc2lvbk9wZW5lZChwTWFjLCBwQ29tbWFuZC0+c2Vzc2lvbklkKTsKKyAgICAgICAgICAgIC8vUmVtb3ZlIHRoaXMgY29tbWFuZCBvdXQgb2YgdGhlIGFjdGl2ZSBsaXN0CisgICAgICAgICAgICBpZihjc3JMTFJlbW92ZUVudHJ5KCZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTE9DSykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvL05vdyBwdXQgdGhpcyBjb21tYW5kIGJhY2sgb24gdGhlIGF2aWxhYmxlIGNvbW1hbmQgbGlzdAorICAgICAgICAgICAgICAgY3NyUmVsZWFzZUNvbW1hbmQocE1hYywgcENvbW1hbmQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc21lUHJvY2Vzc1BlbmRpbmdRdWV1ZSggcE1hYyApOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsICJpbiAlcyBlV05JX1NNRV9BRERfU1RBX1NFTEZfUlNQIFJlY2VpdmVkIGJ1dCBOTyBBZGQgc3RhIHNlc3Npb24gY29tbWFuZCBhcmUgQUNUSVZFIC4uLiIsCisgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgImluICVzIGVXTklfU01FX0FERF9TVEFfU0VMRl9SU1AgUmVjZWl2ZWQgYnV0IE5PIGNvbW1hbmRzIGFyZSBBQ1RJVkUgLi4uIiwKKy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TMyIGk7CisgICAgdENzclJvYW1TZXNzaW9uICpwU2Vzc2lvbjsKKyAgICAqcGJTZXNzaW9uSWQgPSBDU1JfU0VTU0lPTl9JRF9JTlZBTElEOworICAgIGZvciggaSA9IDA7IGkgPCBDU1JfUk9BTV9TRVNTSU9OX01BWDsgaSsrICkKKyAgICB7CisgICAgICAgIGlmKCAhQ1NSX0lTX1NFU1NJT05fVkFMSUQoIHBNYWMsIGkgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBTZXNzaW9uID0gQ1NSX0dFVF9TRVNTSU9OKCBwTWFjLCBpICk7CisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgcFNlc3Npb24tPnNlc3Npb25BY3RpdmUgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgIHBTZXNzaW9uLT5zZXNzaW9uSWQgPSAodEFOSV9VOClpOworICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5jYWxsYmFjayA9IGNhbGxiYWNrOworICAgICAgICAgICAgcFNlc3Npb24tPnBDb250ZXh0ID0gcENvbnRleHQ7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnBTZXNzaW9uLT5zZWxmTWFjQWRkciwgcFNlbGZNYWNBZGRyLCBzaXplb2YodENzckJzc2lkKSk7CisgICAgICAgICAgICAqcGJTZXNzaW9uSWQgPSAodEFOSV9VOClpOworICAgICAgICAgICAgc3RhdHVzID0gdm9zX3RpbWVyX2luaXQoJnBTZXNzaW9uLT5oVGltZXJSb2FtaW5nLCBWT1NfVElNRVJfVFlQRV9TVywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNzclJvYW1Sb2FtaW5nVGltZXJIYW5kbGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBTZXNzaW9uLT5yb2FtaW5nVGltZXJJbmZvKTsKKyAgICAgICAgICAgIGlmICghSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJjYW5ub3QgYWxsb2NhdGUgbWVtb3J5IGZvciBSb2FtaW5nIHRpbWVyIikpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorI2lmZGVmIEZFQVRVUkVfV0xBTl9CVEFNUF9VVF9SRgorICAgICAgICAgICAgc3RhdHVzID0gdm9zX3RpbWVyX2luaXQoJnBTZXNzaW9uLT5oVGltZXJKb2luUmV0cnksIFZPU19USU1FUl9UWVBFX1NXLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyUm9hbUpvaW5SZXRyeVRpbWVySGFuZGxlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwU2Vzc2lvbi0+am9pblJldHJ5VGltZXJJbmZvKTsKKyAgICAgICAgICAgIGlmICghSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJjYW5ub3QgYWxsb2NhdGUgbWVtb3J5IGZvciBqb2lucmV0cnkgdGltZXIiKSk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgICAgIHN0YXR1cyA9IGNzcklzc3VlQWRkU3RhRm9yU2Vzc2lvblJlcSAocE1hYywgaSwgcFNlbGZNYWNBZGRyKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorICAgIGlmKCBDU1JfUk9BTV9TRVNTSU9OX01BWCA9PSBpICkKKyAgICB7CisgICAgICAgIC8vTm8gc2Vzc2lvbiBpcyBhdmFpbGFibGUKKyAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfUkVTT1VSQ0VTOworICAgIH0KKyAgICByZXR1cm4gKCBzdGF0dXMgKTsKK30KK2VIYWxTdGF0dXMgY3NyUHJvY2Vzc0RlbFN0YVNlc3Npb25Sc3AoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggKnBNc2cpCit7CisgICBlSGFsU3RhdHVzICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICB0TGlzdEVsZW0gICAgICAgICAgICAgICAgICAgICAgICAgICpwRW50cnkgPSBOVUxMOworICAgdFNtZUNtZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAqcENvbW1hbmQgPSBOVUxMOworICAgdFNpclNtZURlbFN0YVNlbGZSc3AgICAgICAgICAgICAgICAqcFJzcDsKKyAgIGRvCisgICB7CisgICAgICBpZihwTXNnID09IE5VTEwpCisgICAgICB7CisgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgImluICVzIG1zZyBwdHIgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIHBFbnRyeSA9IGNzckxMUGVla0hlYWQoICZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCwgTExfQUNDRVNTX0xPQ0sgKTsKKyAgICAgIGlmKHBFbnRyeSkKKyAgICAgIHsKKyAgICAgICAgIHBDb21tYW5kID0gR0VUX0JBU0VfQUREUiggcEVudHJ5LCB0U21lQ21kLCBMaW5rICk7CisgICAgICAgICBpZihlU21lQ29tbWFuZERlbFN0YVNlc3Npb24gPT0gcENvbW1hbmQtPmNvbW1hbmQpCisgICAgICAgICB7CisgICAgICAgICAgICB0QU5JX1U4IHNlc3Npb25JZCA9IHBDb21tYW5kLT5zZXNzaW9uSWQ7CisgICAgICAgICAgICBwUnNwID0gKHRTaXJTbWVEZWxTdGFTZWxmUnNwKilwTXNnOworICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0cxLCAiRGVsIFN0YSByc3Agc3RhdHVzID0gJWQiLCBwUnNwLT5zdGF0dXMgKTsKKyAgICAgICAgICAgIC8vVGhpcyBzZXNzaW9uIGlzIGRvbmUuCisgICAgICAgICAgICBjc3JDbGVhbnVwU2Vzc2lvbihwTWFjLCBzZXNzaW9uSWQpOworICAgICAgICAgICAgaWYocENvbW1hbmQtPnUuZGVsU3RhU2Vzc2lvbkNtZC5jYWxsYmFjaykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgc3RhdHVzID0gc21lX1JlbGVhc2VHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisgICAgICAgICAgICAgICAgaWYgKCBIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LmRlbFN0YVNlc3Npb25DbWQuY2FsbGJhY2soCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LmRlbFN0YVNlc3Npb25DbWQucENvbnRleHQpOworICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBzbWVfQWNxdWlyZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCEgSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dQLCAiJXM6IEZhaWxlZCB0byBBY3F1aXJlIExvY2siLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3RhdHVzOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgIiVzOiBGYWlsZWQgdG8gUmVsZWFzZSBMb2NrIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gCisgICAKKyAgICAgICAgICAgIC8vUmVtb3ZlIHRoaXMgY29tbWFuZCBvdXQgb2YgdGhlIGFjdGl2ZSBsaXN0CisgICAgICAgICAgICBpZihjc3JMTFJlbW92ZUVudHJ5KCZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTE9DSykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvL05vdyBwdXQgdGhpcyBjb21tYW5kIGJhY2sgb24gdGhlIGF2aWxhYmxlIGNvbW1hbmQgbGlzdAorICAgICAgICAgICAgICAgY3NyUmVsZWFzZUNvbW1hbmQocE1hYywgcENvbW1hbmQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc21lUHJvY2Vzc1BlbmRpbmdRdWV1ZSggcE1hYyApOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsICJpbiAlcyBlV05JX1NNRV9ERUxfU1RBX1NFTEZfUlNQIFJlY2VpdmVkIGJ1dCBOTyBEZWwgc3RhIHNlc3Npb24gY29tbWFuZCBhcmUgQUNUSVZFIC4uLiIsCisgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgImluICVzIGVXTklfU01FX0RFTF9TVEFfU0VMRl9SU1AgUmVjZWl2ZWQgYnV0IE5PIGNvbW1hbmRzIGFyZSBBQ1RJVkUgLi4uIiwKKyAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgIH0gd2hpbGUoMCk7CisgICByZXR1cm4gc3RhdHVzOworfQorZUhhbFN0YXR1cyBjc3JTZW5kTUJEZWxTZWxmU3RhUmVxTXNnKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0U2lyTWFjQWRkciBtYWNBZGRyICkKK3sKKyAgIHRTaXJTbWVEZWxTdGFTZWxmUmVxICpwTXNnOworICAgdEFOSV9VMTYgbXNnTGVuOworICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgZG8geworICAgICAgbXNnTGVuICA9IHNpemVvZiggdEFOSV9VMTYgKSArIHNpemVvZiggdEFOSV9VMTYgKSArIHNpemVvZiggdFNpck1hY0FkZHIgKSAvKisKKyAgICAgICAgIHNpemVvZiggdFNpckJzc1R5cGUgKSovOworICAgICAgcE1zZyA9IHZvc19tZW1fbWFsbG9jKG1zZ0xlbik7CisgICAgICBpZiAoIE5VTEwgPT0gcE1zZyApIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgdm9zX21lbV9zZXQocE1zZywgbXNnTGVuLCAwKTsKKyAgICAgIHBNc2ctPm1lc2dUeXBlID0gcGFsX2NwdV90b19iZTE2KCh0QU5JX1UxNillV05JX1NNRV9ERUxfU1RBX1NFTEZfUkVRKTsKKyAgICAgIHBNc2ctPm1lc2dMZW4gPSBwYWxfY3B1X3RvX2JlMTYobXNnTGVuKTsKKyAgICAgIC8vIHNlbGYgc3RhdGlvbiBhZGRyZXNzCisgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKilwTXNnLT5zZWxmTWFjQWRkciwgKHRBTklfVTggKiltYWNBZGRyLAorICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgc3RhdHVzID0gcGFsU2VuZE1CTWVzc2FnZShwTWFjLT5oSGRkLCBwTXNnKTsKKyAgIH0gd2hpbGUoIDAgKTsKKyAgIHJldHVybiggc3RhdHVzICk7Cit9CitlSGFsU3RhdHVzIGNzcklzc3VlRGVsU3RhRm9yU2Vzc2lvblJlcSh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UzMiBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX0JPT0xFQU4gZkhpZ2hQcmlvcml0eSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNBZGRyIHNlc3Npb25NYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyUm9hbVNlc3Npb25DbG9zZUNhbGxiYWNrIGNhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqcENvbnRleHQpCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgdFNtZUNtZCAqcENvbW1hbmQ7CisgICBwQ29tbWFuZCA9IGNzckdldENvbW1hbmRCdWZmZXIocE1hYyk7CisgICBpZihOVUxMID09IHBDb21tYW5kKQorICAgeworICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfUkVTT1VSQ0VTOworICAgfQorICAgZWxzZQorICAgeworICAgICAgcENvbW1hbmQtPmNvbW1hbmQgPSBlU21lQ29tbWFuZERlbFN0YVNlc3Npb247CisgICAgICBwQ29tbWFuZC0+c2Vzc2lvbklkID0gKHRBTklfVTgpc2Vzc2lvbklkOworICAgICAgcENvbW1hbmQtPnUuZGVsU3RhU2Vzc2lvbkNtZC5jYWxsYmFjayA9IGNhbGxiYWNrOworICAgICAgcENvbW1hbmQtPnUuZGVsU3RhU2Vzc2lvbkNtZC5wQ29udGV4dCA9IHBDb250ZXh0OworICAgICAgdm9zX21lbV9jb3B5KHBDb21tYW5kLT51LmRlbFN0YVNlc3Npb25DbWQuc2VsZk1hY0FkZHIsI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JMTE9wZW4ocE1hYy0+aEhkZCwgJmxvY2FsTGlzdCkpKQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgZmFpbGVkIHRvIG9wZW4gbGlzdCIpKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBjc3JMTExvY2socExpc3QpOworICAgIHBFbnRyeSA9IGNzckxMUGVla0hlYWQocExpc3QsIExMX0FDQ0VTU19OT0xPQ0spOworICAgIHdoaWxlKHBFbnRyeSAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgcE5leHQgPSBjc3JMTE5leHQocExpc3QsIHBFbnRyeSwgTExfQUNDRVNTX05PTE9DSyk7CisgICAgICAgIHBDb21tYW5kID0gR0VUX0JBU0VfQUREUiggcEVudHJ5LCB0U21lQ21kLCBMaW5rICk7CisgICAgICAgIGlmKHBDb21tYW5kLT5zZXNzaW9uSWQgPT0gc2Vzc2lvbklkKQorICAgICAgICB7CisgICAgICAgICAgICBpZihjc3JMTFJlbW92ZUVudHJ5KHBMaXN0LCBwRW50cnksIExMX0FDQ0VTU19OT0xPQ0spKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNzckxMSW5zZXJ0VGFpbCgmbG9jYWxMaXN0LCBwRW50cnksIExMX0FDQ0VTU19OT0xPQ0spOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHBFbnRyeSA9IHBOZXh0OworICAgIH0KKyAgICBjc3JMTFVubG9jayhwTGlzdCk7CisKKyAgICB3aGlsZSggKHBFbnRyeSA9IGNzckxMUmVtb3ZlSGVhZCgmbG9jYWxMaXN0LCBMTF9BQ0NFU1NfTk9MT0NLKSkgKQorICAgIHsKKyAgICAgICAgcENvbW1hbmQgPSBHRVRfQkFTRV9BRERSKCBwRW50cnksIHRTbWVDbWQsIExpbmsgKTsKKyAgICAgICAgY3NyQWJvcnRDb21tYW5kKHBNYWMsIHBDb21tYW5kLCBlQU5JX0JPT0xFQU5fVFJVRSk7CisgICAg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OX1ZBTElEKCBwTWFjLCBzZXNzaW9uSWQgKSApCisgICAgeworICAgICAgICB0Q3NyUm9hbVNlc3Npb24gKnBTZXNzaW9uID0gQ1NSX0dFVF9TRVNTSU9OKCBwTWFjLCBzZXNzaW9uSWQgKTsKKyAgICAgICAgaWYoZlN5bmMpCisgICAgICAgIHsKKyAgICAgICAgICAgIGNzckNsZWFudXBTZXNzaW9uKHBNYWMsIHNlc3Npb25JZCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBpZihiUHVyZ2VMaXN0KQorICAgICAgICAgICAgICAgIGNzclB1cmdlU21lQ21kTGlzdChwTWFjLCBzZXNzaW9uSWQpOworICAgICAgICAgICAvKiAgSWYgYlB1cmdlTGlzdCBpcyBGQUxTRSwgaXQgbWVhbnMgSEREIGFscmVhZHkgZnJlZSBhbGwgdGhlCisgICAgICAgICAgICAqICBjbWQgYW5kIGxhdGVyIHF1ZXVlIGZldyBlc3NlbnRpYWwgY21kLiBOb3cgc21lIHNob3VsZCBwcm9jZXNzCisgICAgICAgICAgICAqICB0aGUgY21kIGluICBwZW5kaW5nIHF1ZXVlIG9yZGVyIG9ubHkuSGVuY2Ugd2Ugc2hvdWxkCisgICAgICAgICAgICAqICBhdm9pZCBERUxfU0VMRl9TVEEgYXMgaGlnaCBwcmlvcml0eSBjbWQuCisgICAgICAgICAgICAqLworICAgICAgICAgICAgc3RhdHVzID0gY3NySXNzdWVEZWxTdGFGb3JTZXNzaW9uUmVxKCBwTWFjLCBzZXNzaW9uSWQsIGJQdXJnZUxpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPnNlbGZNYWNBZGRyLCBjYWxsYmFjaywgcENvbnRleHQpOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0lOVkFMSURfUEFSQU1FVEVSOworICAgIH0KKyAg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AgIFNJUl9CQU5EXzJfNF9HSFopCisgICAgICAgICAgKQorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSB2b3NfdGltZXJfc3RhcnQoCisgICAgICAgICAgICAgICAgICAgICAgICAgJnBOZWlnaGJvclJvYW1JbmZvLT5mb3JjZWRJbml0aWFsUm9hbVRvNUdIVGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgSU5JVElBTF9GT1JDRURfUk9BTV9UT181R19USU1FUl9QRVJJT0QpOworICAgICAgICAgICAgaWYgKCBzdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgRkwoImZvcmNlZEluaXRpYWxSb2FtVG81R0hUaW1lciBzdGFydCBmYWlsZWQgc3RhdHVzICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyk7CisgICAgICAgICAgICAgICAgLy9TZW5kIFJTTyBzdGFydCBiZWNhdXNlIGluIGNhc2UgNUcgcm9hbWluZworICAgICAgICAgICAgICAgIC8vaG9zdCBoYXZlIG5vdCBlbmFibGVkIGF0IGluaXRpYWwgY29ubmVjdGlvbgorICAgICAgICAgICAgICAgIGNzclJvYW1PZmZsb2FkU2NhbihwTWFjLFJPQU1fU0NBTl9PRkZMT0FEX1NUQVJULFJFQVNPTl9DT05ORUNUKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HMSwgRkwoIiVzOiBGb3JjZWQgcm9hbSB0byA1RyAgc3RhcnRlZCBUaW1lciIpLAorICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgLyoKKyAgICAgICAgICogTWFraW5nIGluaSB2YWx1ZSB0byBmYWx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hVk9TX0lTX1NUQVRVU19TVUNDRVNTKCB2b3NTdGF0dXMgKSApCisgICAgICB7CisgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoImNzclJvYW1QZVN0YXRzVGltZXJIYW5kbGVyOmZhaWxlZCB0byBkZXN0cm95IGhQZVN0YXRzVGltZXIgdGltZXIiKSk7CisgICAgICB9CisKKyAgICAgIC8vIEZyZWUgdGhlIGVudHJ5CisgICAgICB2b3NfbWVtX2ZyZWUocFBlU3RhdHNSZXFMaXN0RW50cnkpOworICAgICAgcFBlU3RhdHNSZXFMaXN0RW50cnkgPSBOVUxMOworICAgfQorICAgZWxzZQorICAgeworICAgICAgaWYoIXBQZVN0YXRzUmVxTGlzdEVudHJ5LT5yc3BQZW5kaW5nKQorICAgICAgeworICAgICAgICAgc3RhdHVzID0gY3NyU2VuZE1CU3RhdHNSZXFNc2cocE1hYywgcFBlU3RhdHNSZXFMaXN0RW50cnktPnN0YXRzTWFzayAmIH4oMSA8PCBlQ3NyR2xvYmFsQ2xhc3NEU3RhdHMpLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQZVN0YXRzUmVxTGlzdEVudHJ5LT5zdGFJZCk7CisgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoImNzclJvYW1QZVN0YXRzVGltZXJIYW5kbGVyOmZhaWxlZCB0byBzZW5kIGRvd24gc3RhdHMgcmVxIHRvIFBFIikpOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgcFBlU3RhdHNSZXFMaXN0RW50cnktPnJzcFBlbmRpbmcgPSBUUlVFOworICAgICAgICAgfQorICAgICAgfQorCisgICAgICAvL3NlbmQgZG93biBhIHJlcQorICAgICAgaWYocFBlU3RhdHNSZXFMaXN0RW50cnktPnBlcmlvZGljaXR5ICYmIAorICA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FJZCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKikmcE1hYy0+cm9hbS5wZXJTdGFTdGF0c0luZm9bcFNtZVN0YXRzUnNwLT5zdGFJZF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0YXRzLCBzaXplb2YodENzclBlclN0YVN0YXRzSW5mbykpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgRkwoImNzclJvYW1TdGF0c1JzcFByb2Nlc3NvcjpvdXQgYm91bmQgc3RhSWQ6JWQiKSwgcFNtZVN0YXRzUnNwLT5zdGFJZCk7CisgICAgICAgICAgICAgICBWT1NfQVNTRVJUKCAwICk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR1csIEZMKCJjc3JSb2FtU3RhdHNSc3BQcm9jZXNzb3I6ZmFpbGVkIHRvIGNvcHkgUGVyU3RhIHN0YXRzIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcFN0YXRzICs9IHNpemVvZih0Q3NyUGVyU3RhU3RhdHNJbmZvKTsKKyAgICAgICAgICAgIGxlbmd0aCAtPSBzaXplb2YodENzclBlclN0YVN0YXRzSW5mbyk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR1csIEZMKCJjc3JSb2FtU3RhdHNSc3BQcm9jZXNzb3I6dW5rbm93biBzdGF0cyB0eXBlIikpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisgICAgICB9CisgICAgICB0ZW1wTWFz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sYXllciBjbGllbnQocykiKTsKKyAgICAgIHJldHVybiBOVUxMOworICAgfQorICAgd2hpbGUoIHBFbnRyeSApCisgICB7CisgICAgICBwVGVtcFN0YUVudHJ5ID0gR0VUX0JBU0VfQUREUiggcEVudHJ5LCB0Q3NyU3RhdHNDbGllbnRSZXFJbmZvLCBsaW5rICk7CisgICAgICBpZigocFRlbXBTdGFFbnRyeS0+c3RhdHNNYXNrICYgfigxIDw8IGVDc3JHbG9iYWxDbGFzc0RTdGF0cykpICA9PSBzdGF0c01hc2spCisgICAgICB7CisgICAgICAgICBzbXNMb2cocE1hYywgTE9HMywgImNzclJvYW1DaGVja0NsaWVudFJlcUxpc3Q6IG1hdGNoIGZvdW5kIik7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIHBFbnRyeSA9IGNzckxMTmV4dCggJnBNYWMtPnJvYW0uc3RhdHNDbGllbnRSZXFMaXN0LCBwRW50cnksIExMX0FDQ0VTU19OT0xPQ0sgKTsKKyAgIH0KKyAgIHJldHVybiBwRW50cnk7Cit9CitlSGFsU3RhdHVzIGNzclJvYW1SZWdpc3RlckxpbmtRdWFsaXR5SW5kQ2FsbGJhY2sodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JSb2FtTGlua1F1YWxpdHlJbmRDYWxsYmFjayAgIGNhbGxiYWNrLCAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgICAgICAgICpwQ29udGV4dCkKK3sKKyAgIHBNYWMtPnJvYW0ubGlua1F1YWxpdHlJbmRJbmZvLmNhbGxiYWNrID0gY2FsbGJhY2s7CisgICBwTWFjLT5yb2FtLmxpbmtRdWFsaXR5SW5kSW5mby5jb250ZXh0ID0gcENvbnRleHQ7CisgICBpZiggTlVMTCA9PSBjYWxsYmFjayApCisgICB7CisgICAgIHN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gaWYobmV3VmNjTGlua1F1YWxpdHkgIT0gcE1hYy0+cm9hbS52Y2NMaW5rUXVhbGl0eSkKKyAgIHsKKyAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLCAiY3NyUm9hbVZjY1RyaWdnZXI6IGxpbmsgcXVhbGl0eSBjaGFuZ2VkOiB0cmlnZ2VyIG5lY2Vzc2FyeSIpOworICAgICAgaWYoTlVMTCAhPSBwTWFjLT5yb2FtLmxpbmtRdWFsaXR5SW5kSW5mby5jYWxsYmFjaykgCisgICAgICB7CisgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywgImNzclJvYW1WY2NUcmlnZ2VyOiBsaW5rIHF1YWxpdHkgaW5kaWNhdGlvbiAlZCIsCisgICAgICAgICAgICAgICAgbmV3VmNjTGlua1F1YWxpdHkgKTsKKyAgICAgICAgIAorICAgICAgICAgLyogd2Ugbm93IGludm9rZSB0aGUgY2FsbGJhY2sgb25jZSB0byBub3RpZnkgY2xpZW50IG9mIGluaXRpYWwgdmFsdWUgICAqLworICAgICAgICAgcE1hYy0+cm9hbS5saW5rUXVhbGl0eUluZEluZm8uY2FsbGJhY2soIG5ld1ZjY0xpbmtRdWFsaXR5LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5yb2FtLmxpbmtRdWFsaXR5SW5kSW5mby5jb250ZXh0ICk7CisgICAgICAgICAvL2V2ZW50OiBFVkVOVF9XTEFOX1ZDQworICAgICAgfQorICAgfQorICAgcE1hYy0+cm9hbS52Y2NMaW5rUXVhbGl0eSA9IG5ld1ZjY0xpbmtRdWFsaXR5OworCit9CitWT1NfU1RBVFVTIGNzclJvYW1WY2NUcmlnZ2VyUnNzaUluZENhbGxiYWNrKHRIYWxIYW5kbGUgaEhhbCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAgcnNzaU5vdGlmaWNhdGlvbiwgCisgICAgICAgICAgICAgICAgICA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BwTmV3U3RhRW50cnktPnN0YXRzTWFzayA9IHBTdGFFbnRyeS0+c3RhdHNNYXNrOworICAgICAgcE5ld1N0YUVudHJ5LT5wUGVTdGFFbnRyeSA9IHBTdGFFbnRyeS0+cFBlU3RhRW50cnk7CisgICAgICBwTmV3U3RhRW50cnktPnBNYWMgPSBwU3RhRW50cnktPnBNYWM7CisgICAgICBwTmV3U3RhRW50cnktPnN0YUlkID0gcFN0YUVudHJ5LT5zdGFJZDsKKyAgICAgIHBOZXdTdGFFbnRyeS0+dGltZXJFeHBpcmVkID0gcFN0YUVudHJ5LT50aW1lckV4cGlyZWQ7CisgICAgICAKKyAgICAgIGNzckxMSW5zZXJ0VGFpbCggcFN0YUxpc3QsICZwTmV3U3RhRW50cnktPmxpbmssIExMX0FDQ0VTU19MT0NLICApOworICAgfQorICAgcmV0dXJuIHBOZXdTdGFFbnRyeTsKK30KKwordENzclBlU3RhdHNSZXFJbmZvICogY3NyUm9hbUluc2VydEVudHJ5SW50b1BlU3RhdHNSZXFMaXN0KCB0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RGJsTGlua0xpc3QgKnBTdGFMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Q3NyUGVTdGF0c1JlcUluZm8gKnBTdGFFbnRyeSkKK3sKKyAgIHRDc3JQZVN0YXRzUmVxSW5mbyAqcE5ld1N0YUVudHJ5ID0gTlVMTDsKKyAgIHBOZXdTdGFFbnRyeSA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0Q3NyUGVTdGF0c1JlcUluZm8pKTsKKyAgIGlmIChOVUxMID09IHBOZXdTdGFFbnRyeSkKKyAgIHsKKyAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLCAiY3NyUm9hbUluc2VydEVudHJ5SW50b1BlU3RhdHNSZXFMaXN0OiBj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xlZCB0byBzZW5kIGRvd24gZ2V0IHJzc2kgcmVxIikpOworICAgICAgLy9wTXNnIGlzIGZyZWVkIGJ5IHBhbFNlbmRNQk1lc3NhZ2UKKyAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICB9CisgICByZXR1cm4gc3RhdHVzOworfQorI2VuZGlmCisKKworCisjaWYgZGVmaW5lZChGRUFUVVJFX1dMQU5fRVNFKSAmJiBkZWZpbmVkKEZFQVRVUkVfV0xBTl9FU0VfVVBMT0FEKQorZUhhbFN0YXR1cyBjc3JHZXRUc21TdGF0cyh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0Q3NyVHNtU3RhdHNDYWxsYmFjayBjYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBzdGFJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdENzckJzc2lkIGJzc0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpwQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogcFZvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggdGlkKQoreworICAgZUhhbFN0YXR1cyAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgdEFuaUdldFRzbVN0YXRzUmVxICpwTXNnID0gTlVMTDsKKworICAgcE1zZyA9ICh0QW5pR2V0VHNtU3RhdHNSZXEqKXZvc19tZW1fbWFsbG9jKHNpemVvZih0QW5pR2V0VHNtU3RhdHNSZXEpKTsKKyAgIGlmIChOVUxMID09IHBNc2cpCisgICB7CisgICAgICBzbXNMb2cocE1hYywgTE9HRSwgImNzckdldFRzbVN0YXRzOiBmYWlsZWQgdG8gYWxsb2NhdGUgbWVtIGZvciByZXEiKTsKKyAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMRURfQUxMT0M7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QUlMVVJFOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgLy9jbGVhbiB1cCAmIHJldHVybgorICAgICAgICAgcFN0YUVudHJ5ID0gR0VUX0JBU0VfQUREUiggcEVudHJ5LCB0Q3NyU3RhdHNDbGllbnRSZXFJbmZvLCBsaW5rICk7CisgICAgICAgICBpZihOVUxMICE9IHBTdGFFbnRyeS0+cFBlU3RhRW50cnkpCisgICAgICAgICB7CisgICAgICAgICAgICBwU3RhRW50cnktPnBQZVN0YUVudHJ5LT5udW1DbGllbnQtLTsKKyAgICAgICAgICAgIC8vY2hlY2sgaWYgd2UgbmVlZCB0byBkZWxldGUgdGhlIGVudHJ5IGZyb20gcGVTdGF0c1JlcUxpc3QgdG9vCisgICAgICAgICAgICBpZighcFN0YUVudHJ5LT5wUGVTdGFFbnRyeS0+bnVtQ2xpZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgY3NyUm9hbVJlbW92ZUVudHJ5RnJvbVBlU3RhdHNSZXFMaXN0KHBNYWMsIHBTdGFFbnRyeS0+cFBlU3RhRW50cnkpOworICAgICAgICAgICAgfQorICAgICAgICAgfQorCisgICAgICAgICAvL2NoZWNrIGlmIHdlIG5lZWQgdG8gc3RvcCB0aGUgdGwgc3RhdHMgdGltZXIgdG9vIAorICAgICAgICAgcE1hYy0+cm9hbS50bFN0YXRzUmVxSW5mby5udW1DbGllbnQtLTsKKyAgICAgICAgIGlmKCFwTWFjLT5yb2FtLnRsU3RhdHNSZXFJbmZvLm51bUNsaWVudCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGlmKHBNYWMtPnJvYW0udGxTdGF0c1JlcUluZm8udGltZXJSdW5uaW5nKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgc3RhdHVzID0gdm9zX3RpbWVyX3N0b3AoJnBNYWMtPnJvYW0udGxTdGF0c1JlcUluZm8uaFRsU3RhdHNUaW1lcik7CisgICAgICAgICAgICAgICBpZiAoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJjc3JHZXRTdGF0aXN0aWNzOmNhbm5vdCBzdG9wIFRsU3RhdHNUaW1lciB0aW1lciIpKTsKKyAgICAgICAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcE1hYy0+cm9hbS50bFN0YXRzUmVxSW5mby5wZXJpb2RpY2l0eSA9IDA7CisgICAgICAgICAgICBwTWFjLT5yb2FtLnRsU3RhdHNSZXFJbmZvLnRpbWVyUnVubmluZyA9IEZBTFNFOworICAgICAgICAgfQorICAgICAgICAgdm9zX3RpbWVyX3N0b3AoICZwU3RhRW50cnktPnRpbWVyICk7CisgICAgICAgICAvLyBEZXN0cm95IHRoZSB2b3MgdGltZXIuLi4gICAgICAKKyAgICAgICAgIHZvc1N0YXR1cyA9IHZvc190aW1lcl9kZXN0cm95KCAmcFN0YUVudHJ5LT50aW1lciApOworICAgICAgICAgaWYgKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCB2b3NTdGF0dXMgKSApCisgICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoImNzckdldFN0YXRpc3RpY3M6ZmFpbGVkIHRvIGRlc3Ryb3kgQ2xpZW50IHJlcSB0aW1lciIpKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGNzclJvYW1SZW1vdmVTdGF0TGlzdEVudHJ5KHBNYWMsIHBFbnRyeSk7CisgICAgICAgICBwU3RhRW50cnkgPSBOVUxMOworICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICB9CisgICB9CisgICAKKyAgIGlmKGNhY2hlICYmICFwZXJpb2RpY2l0eSkKKyAgIHsKKyAgICAgIC8vcmV0dXJuIHRoZSBjYWNoZ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gICAgICAgICAgICAgICAgICAgICAgICAgcGVyaW9kaWNpdHksICZmb3VuZCwgc3RhSWQpOworICAgICAgICAgICAgaWYoIXBQZVN0YUVudHJ5KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLy9iYWlsIG91dCwgbWF4ZWQgb3V0IG9uIG51bWJlciBvZiByZXEgZm9yIFBFCisgICAgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHN0YUVudHJ5LnBQZVN0YUVudHJ5ID0gcFBlU3RhRW50cnk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAKKyAgICAgICAgIH0KKyAgICAgICAgIC8vcmVxdWVzdCBzdGF0cyBmcm9tIFRMIHJpZ2h0YXdheSBpZiByZXF1ZXN0ZWQgYnkgY2xpZW50LCB1cGRhdGUgdGxTdGF0c1JlcUluZm8gaWYgbmVlZGVkCisgICAgICAgICBpZihzdGF0c01hc2sgJiAoMSA8PCBlQ3NyR2xvYmFsQ2xhc3NEU3RhdHMpKQorICAgICAgICAgeworICAgICAgICAgICAgaWYoY2FjaGUgJiYgcE1hYy0+cm9hbS50bFN0YXRzUmVxSW5mby5udW1DbGllbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoImNzckdldFN0YXRpc3RpY3M6TG9va2luZyBmb3IgY2FjaGVkIHN0YXRzIGZyb20gVEwiKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAKKyAgICAgICAgICAgICAgIC8vdXBkYXRlIHBlcmlvZGljaXR5CisgICAgICAgICAgICAgICBpZihwTWFjLT5yb2FtLnRsU3RhdHNSZXFJbmZvLnBlcmlvZGljaXR5KQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgcE1hYy0+cm9hbS50bFN0YXRzUmVxSW5mby5wZXJpb2RpY2l0eSA9IAorICAgICAgICAgICAgICAgICAgICAgQ1NSX1JPQU1fTUlOKHBlcmlvZGljaXR5LCBwTWFjLT5yb2FtLnRsU3RhdHNSZXFJbmZvLnBlcmlvZGljaXR5KTsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0udGxTdGF0c1JlcUluZm8ucGVyaW9kaWNpdHkgPSBwZXJpb2RpY2l0eTsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIGlmKHBNYWMtPnJvYW0udGxTdGF0c1JlcUluZm8ucGVyaW9kaWNpdHkgPCBDU1JfTUlOX1RMX1NUQVRfUVVFUllfUEVSSU9EKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgcE1hYy0+cm9hbS50bFN0YXRzUmVxSW5mby5wZXJpb2RpY2l0eSA9IENTUl9NSU5fVExfU1RBVF9RVUVSWV9QRVJJT0Q7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgIGlmKCFwTWFjLT5yb2FtLnRsU3RhdHNSZXFJbmZvLnRpbWVyUnVubmluZykKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHBUbFN0YXRzID0gKFdMQU5UTF9UUkFOU0ZFUl9TVEFfVFlQRSAqKXZvc19tZW1fbWFsbG9jKHNpemVvZihXTEFOVExfVFJBTlNGRVJfU1RBX1RZUEUpKTsKKyAgICAgICAgICAgICAgICAgIGlmIChOVUxMICE9IHBUbFN0YXRzKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgLy9yZXEgVEwgZm9yIGNsYXNzIEQgc3RhdHMKKyAgICAgICAgICAgICAgICAgICAgIGlmKFdMQU5UTF9HZXRTdGF0aXN0aWNzKHBNYWMtPnJvYW0uZ1Zvc0NvbnRleHQsIHBUbFN0YXRzLCBzdGFJZCkpCisgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoImNzckdldFN0YXRpc3RpY3M6Y291bGRuJ3QgZ2V0IHRoZSBzdGF0cyBmcm9tIFRMIikpOworICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLy9zYXZlIGluIFNNRQorICAgICAgICAgICAgICAgICAgICAgICAgY3NyUm9hbVNhdmVTdGF0c0Zyb21UbChwTWFjLCBwVGxTdGF0cyk7CisgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocFRsU3RhdHMpOworICAgICAgICAgICAgICAgICAgICAgcFRsU3RhdHMgPSBOVUxMOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJjYW5ub3QgYWxsb2NhdGUgbWVtb3J5IGZvciBUTCBzdGF0IikpOworICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICBpZihwTWFjLT5yb2FtLnRsU3RhdHNSZXFJbmZvLnBlcmlvZGljaXR5KQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgLy9zdGFydCB0aW1lcgorICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gdm9zX3RpbWVyX3N0YXJ0KCZwTWFjLT5yb2FtLnRsU3RhdHNSZXFJbmZvLmhUbFN0YXRzVGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0udGxTdGF0c1JlcUluZm8ucGVyaW9kaWNpdHkpOworICAgICAgICAgICAgICAgICAgICAgaWYgKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiY3NyR2V0U3RhdGlzdGljczpjYW5ub3Qgc3RhcnQgVGxTdGF0c1RpbWVyIHRpbWVyIikpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICBwTWFjLT5yb2FtLnRsU3RhdHNSZXFJbmZvLnRpbWVyUnVubmluZyA9IFRSVUU7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwTWFjLT5yb2FtLnRsU3RhdHNSZXFJbmZvLm51bUNsaWVudCsrOworICAgICAgICAgfQorICAgCisgICAgICAgICBpbnNlcnRJbkNsaWVudExpc3QgPSBUUlVFOworICAgICAgfQorICAgICAgLy9pZiBvbmUgdGltZSByZXBvcnQgcmVxdWVzdGVkIHdpdGggbm9uIGNhY2hlZCByZXN1bHQgZnJvbSBQRS9UTAorICAgICAgZWxzZSBpZighY2FjaGUgJiYgIXBlcmlvZGljaXR5KQorICAgICAgeworICAgICAgICAgaWYoc3RhdHNNYXNrICYgfigxIDw8IGVDc3JHbG9iYWxDbGFzc0RTdGF0cykpCisgICAgICAgICB7CisgICAgICAgICAgICAvL3NlbmQgZG93biBhIHJlcQorICAgICAgICAgICAgc3RhdHVzID0gY3NyU2VuZE1CU3RhdHNSZXFNc2cocE1hYywgc3RhdHNNYXNrICYgfigxIDw8IGVDc3JHbG9iYWxDbGFzc0RTdGF0cyksIHN0YUlkKTsKKyAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiY3NyR2V0U3RhdGlzdGljczpmYWlsZWQgdG8gc2VuZCBkb3duIHN0YXRzIHJlcSB0byBQRSIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vc28gdGhhdCB3aGVuIHRoZSBzdGF0cyByc3AgY29tZXMgYmFjayBmcm9tIFBFIHdlIHJlc3BvbmQgdG8gdXBwZXIgbGF5ZXIKKyAgICAgICAgICAgIC8vcmlnaHQgYXdheQorICAgICAgICAgICAgc3RhRW50cnkudGltZXJFeHBpcmVkID0gVFJVRTsKKyAgICAgICAgICAgIGluc2VydEluQ2xpZW50TGlzdCA9IFRSVUU7CisgICAgICAgICB9CisgICAgICAgICBpZihzdGF0c01hc2sgJiAoMSA8PCBlQ3NyR2xvYmFsQ2xhc3NEU3RhdHMpKQorICAgICAgICAgeworICAgICAgICAgICAgcFRsU3RhdHMgPSAoV0xBTlRMX1RSQU5TRkVSX1NUQV9UWVBFICopdm9zX21lbV9tYWxsb2Moc2l6ZW9mKFdMQU5UTF9UUkFOU0ZFUl9TVEFfVFlQRSkpOworICAgICAgICAgICAgaWYgKE5VTEwgIT0gcFRsU3RhdHMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvL3JlcSBUTCBmb3IgY2xhc3MgRCBzdGF0cworICAgICAgICAgICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyhXTEFOVExfR2V0U3RhdGlzdGljcyhwTWFjLT5yb2FtLmdWb3NDb250ZXh0LCBwVGxTdGF0cywgc3RhSWQpKSkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiY3NyR2V0U3RhdGlzdGljczpjb3VsZG4ndCBnZXQgdGhlIHN0YXRzIGZyb20gVEwiKSk7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvL3NhdmUgaW4gU01FCisgICAgICAgICAgICAgICAgICBjc3JSb2FtU2F2ZVN0YXRzRnJvbVRsKHBNYWMsIHBUbFN0YXRzKTsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwVGxTdGF0cyk7CisgICAgICAgICAgICAgICBwVGxTdGF0cyA9IE5VTEw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoImNhbm5vdCBhbGxvY2F0ZSBtZW1vcnkgZm9yIFRMIHN0YXQiKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgIH0KKyAgICAgICAgIC8vaWYgbG9va2luZyBmb3Igc3RhdHMgZnJvbSBUTCBvbmx5IAorICAgICAgICAgaWYoIWluc2VydEluQ2xpZW50TGlzdCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIC8vcmV0dXJuIHRoZSBzdGF0cworICAgICAgICAgICAgY3NyUm9hbVJlcG9ydFN0YXRpc3RpY3MocE1hYywgc3RhdHNNYXNrLCBjYWxsYmFjaywgc3RhSWQsIHBDb250ZXh0KTsKKyAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIGlmKGluc2VydEluQ2xpZW50TGlzdCkKKyAgICAgIHsKKyAgICAgICAgIHBTdGFFbnRyeSA9IGNzclJvYW1JbnNlcnRFbnRyeUludG9MaXN0KHBNYWMsICZwTWFjLT5yb2FtLnN0YXRzQ2xpZW50UmVxTGlzdCwgJnN0YUVudHJ5KTsgCisgICAgICAgICBpZighcFN0YUVudHJ5KQorICAgICAgICAgeworICAgICAgICAgICAgLy9tc2cKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLCAiY3NyR2V0U3RhdGlzdGljczogRmFpbGVkIHRvIGluc2VydCByZXEgaW4gc3RhdHNDbGllbnRSZXFMaXN0Iik7CisgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgIH0KKyAgICAgICAgIHBTdGFFbnRyeS0+cGVyaW9kaWNpdHkgPSBwZXJpb2RpY2l0eTsKKyAgICAgICAgIC8vSW5pdCAmIHN0YXJ0IHRpbWVyIGlmIG5lZWRlZAorICAgICAgICAgaWYocGVyaW9kaWNpdHkpCisgICAgICAgICB7CisgICAgICAgICAgICB2b3NTdGF0dXMgPSB2b3NfdGltZXJfaW5pdCggJnBTdGFFbnRyeS0+dGltZXIsIFZPU19USU1FUl9UWVBFX1NXLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JSb2FtU3RhdHNDbGllbnRUaW1lckhhbmRsZXIsIHBTdGFFbnRyeSApOworICAgICAgICAgICAgaWYgKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCB2b3NTdGF0dXMgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoImNzckdldFN0YXRpc3RpY3M6Y2Fubm90IGluaXQgU3RhdHNDbGllbnQgdGltZXIiKSk7CisgICAgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHZvc1N0YXR1cyA9IHZvc190aW1lcl9zdGFydCggJnBTdGFFbnRyeS0+dGltZXIsIHBlcmlvZGljaXR5ICk7CisgICAgICAgICAgICBpZiAoICFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIHZvc1N0YXR1cyApICkgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoImNzckdldFN0YXRpc3RpY3M6Y2Fubm90IHN0YXJ0IFN0YXRzQ2xpZW50IHRpbWVyIikpOworICAgICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICB9CisgICB9CisgICByZXR1cm4gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKK30KKworI2lmZGVmIFdMQU5fRkVBVFVSRV9ST0FNX1NDQU5fT0ZGTE9BRAorCitzdGF0aWMgdFNpclJldFN0YXR1cworY3NyUm9hbVNjYW5PZmZsb2FkUG9wdWxhdGVNYWNIZWFkZXIodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTgqIHBCRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggc3ViVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNBZGRyIHBlZXJBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY0FkZHIgc2VsZk1hY0FkZHIpCit7CisgICAgICAgIHRTaXJSZXRTdGF0dXMgICBzdGF0dXNDb2RlID0gZVNJUl9TVUNDRVNTOworICAgICAgICB0cFNpck1hY01nbXRIZHIgcE1hY0hkcjsKKworICAgICAgICAvKiBQcmVwYXJlIE1BQyBtYW5hZ2VtZW50IGhlYWRlciAqLworICAgICAgICBwTWFjSGRyID0gKHRwU2lyTWFjTWdtdEhkcikgKHBCRCk7CisKKyAgICAgICAgLyogUHJlcGFyZSBGQyAqLworICAgICAgICBwTWFjSGRyLT5mYy5wcm90VmVyID0gU0lSX01BQ19QUk9UT0NPTF9WRVJTSU9OOworICAgICAgICBwTWFjSGRyLT5mYy50eXBlICAgID0gdHlwZTsKKyAgICAgICAgcE1hY0hkci0+ZmMuc3ViVHlwZSA9IHN1YlR5cGU7CisKKyAgICAgICAgLyogUHJlcGFyZSBBZGRyZXNzIDEgKi8KKyAgICAgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4ICopIHBNYWNIZHItPmRhLCAodEFOSV9VOCAqKSBwZWVyQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoIHRTaXJNYWNBZGRyICkpOworCisgICAgICAgIHNpckNvcHlNYWNBZGRyKHBNYWNIZHItPnNhLHNlbGZNYWNBZGRyKTsKKworICAgICAgICAvKiBQcmVwYXJlIEFkZHJlc3MgMyAqLworICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKikgcE1hY0hkci0+YnNzSWQsICh0QU5JX1U4ICopIHBlZXJBZGRyLAorICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCB0U2lyTWFjQWRkciApKTsKKyAgICAgICAgcmV0dXJuIHN0YXR1c0NvZGU7Cit9IC8qKiogY3NyUm9hbVNjYW5PZmZsb2FkUG9wdWxhdGVNYWNIZWFkZXIoKSAqKiovCisKK3N0YXRpYyB0U2lyUmV0U3RhdHVzCitjc3JSb2FtU2Nhbk9mZmxvYWRQcmVwYXJlUHJvYmVSZXFUZW1wbGF0ZSh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBuQ2hhbm5lbE51bSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIGRvdDExbW9kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNBZGRyIHNlbGZNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMTYgKnB1c0xlbikKK3sKKyAgICAgICAgdERvdDExZlByb2JlUmVxdWVzdCBwcjsKKyAgICAgICAgdEFOSV9VMzIgICAgICAgICAgICBuU3RhdHVzLCBuQnl0ZXMsIG5QYXlsb2FkOworICAgICAgICB0U2lyUmV0U3RhdHVzICAgICAgIG5TaXJTdGF0dXM7CisgICAgICAgIC8qQmNhc3QgdHgqLworICAgICAgICB0U2lyTWFjQWRkciAgICAgICAgIGJzc0lkID0gezB4RkYsIDB4RkYsIDB4RkYsIDB4RkYsIDB4RkYsIDB4RkZ9OworICAgICAgICAvKi0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAqLworCisKKyAgICAgICAgdm9zX21lbV9zZXQoKCB0QU5JX1U4KiApJnByLCBzaXplb2YoIHByICksIDApOworCisgICAgICAgIFBvcHVsYXRlRG90MTFmU3VwcFJhdGVzKCBwTWFjLCBuQ2hhbm5lbE51bSwgJnByLlN1cHBSYXRlcyxOVUxMKTsKKworICAgICAgICBpZiAoIFdOSV9DRkdfRE9UMTFfTU9ERV8xMUIgIT0gZG90MTFtb2RlICkKKyAgICAgICAgeworICAgICAgICAgICAgICAgIFBvcHVsYXRlRG90MTFmRXh0U3VwcFJhdGVzMSggcE1hYywgbkNoYW5uZWxOdW0sICZwci5FeHRTdXBwUmF0ZXMgKTsKKyAgICAgICAgfQorCisKKyAgICAgICAgaWYgKElTX0RPVDExX01PREVfSFQoZG90MTFtb2RlKSkKKyAgICAgICAgeworICAgICAgICAgICAgICAgIFBvcHVsYXRlRG90MTFmSFRDYXBzKCBwTWFjLCBOVUxMLCAmcHIuSFRDYXBzICk7CisgICAgICAgIH0KKworCisgICAgICAgIG5TdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRQcm9iZVJlcXVlc3RTaXplKCBwTWFjLCAmcHIsICZuUGF5bG9hZCApOworICAgICAgICBpZiAoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkZhaWxlZCB0byBjYWxjdWxhdGUgdGhlIHBhY2tlZCBzaXplIGYiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvciBhIFByb2JlIFJlcXVlc3QgKDB4JTA4eCkuXG4iLCBuU3RhdHVzICk7CisKKworICAgICAgICAgICAgICAgIG5QYXlsb2FkID0gc2l6ZW9mKCB0RG90MTFmUHJvYmVSZXF1ZXN0ICk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoIERPVDExRl9XQVJORUQoIG5TdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlRoZXJlIHdlcmUgd2FybmluZ3Mgd2hpbGUgY2FsY3VsYXRpbmciCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0aGUgcGFja2VkIHNpemUgZm9yIGEgUHJvYmUgUmVxdWVzdCAoIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiMHglMDh4KS5cbiIsIG5TdGF0dXMgKTsKKyAgICAgICAgfQorCisgICAgICAgIG5CeXRlcyA9IG5QYXlsb2FkICsgc2l6ZW9mKCB0U2lyTWFjTWdtdEhkciApOworCisgICAgICAgIC8qIFByZXBhcmUgb3V0Z29pbmcgZnJhbWUqLworICAgICAgICB2b3NfbWVtX3NldChwRnJhbWUsIG5CeXRlcyAsIDApOworCisKKyAgICAgICAgblNpclN0YXR1cyA9IGNzclJvYW1TY2FuT2ZmbG9hZFBvcHVsYXRlTWFjSGVhZGVyKCBwTWFjLCBwRnJhbWUsIFNJUl9NQUNfTUdNVF9GUkFNRSwKKyAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfTUdNVF9QUk9CRV9SRVEsIGJzc0lkLHNlbGZNYWNBZGRyKTsKKworICAgICAgICBpZiAoIGVTSVJfU1VDQ0VTUyAhPSBuU2lyU3RhdHVzICkKKyAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRmFpbGVkIHRvIHBvcHVsYXRlIHRoZSBidWZmZXIgZGVzY3JpcHRvciBmb3IgYSBQcm9iZSBSZXF1ZXN0ICglZCkuXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuU2lyU3RhdHVzICk7CisgICAgICAgICAgICAgICAgcmV0dXJuIG5TaXJTdGF0dXM7CisgICAgICAgIH0KKworCisgICAgICAgIG5TdGF0dXMgPSBkb3QxMWZQYWNrUHJvYmVSZXF1ZXN0KCBwTWFjLCAmcHIsIHBGcmFtZSArCisgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoIHRTaXJNYWNNZ210SGRyICksCisgICAgICAgICAgICAgICAgICAgICAgICBuUGF5bG9hZCwgJm5QYXlsb2FkICk7CisgICAgICAgIGlmICggRE9UMTFGX0ZBSUxFRCggblN0YXR1cyApICkKKyAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRmFpbGVkIHRvIHBhY2sgYSBQcm9iZSBSZXF1ZXN0ICgweCUwOHgpLlxuIiwgblN0YXR1cyApOworICAgICAgICAgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoIERPVDExRl9XQVJORUQoIG5TdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIlRoZXJlIHdlcmUgd2FybmluZ3Mgd2hpbGUgcGFja2luZyBhIFByb2JlIFJlcXVlc3QgKDB4JTA4eCkuXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICBuU3RhdHVzICk7CisgICAgICAgIH0KKworICAgICAgICAqcHVzTGVuID0gblBheWxvYWQgKyBzaXplb2YodFNpck1hY01nbXRIZHIpOworICAgICAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworfQorCisvKgorICogQmVsb3cgVGFibGUgZGVzY3JpYmUgd2hldGhlciBSU08gY29tbWFuZCBjYW4gYmUgc2VuZCBkb3duIHRvIGZpbXJ3YXJlIG9yIG5vdC4KKyAqIEhvc3QgY2hlY2sgaXQgb24gdGhlIGJhc2lzIG9mIHByZXZpb3VzIFJTTyBjb21tYW5kIHNlbnQgZG93biB0byBmaXJtd2FyZS4KK3x8PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09fHwKK3x8IE5ldyBjbWQgICAgICAgIHwgICAgICAgICAgICBMQVNUIFNFTlQgQ09NTUFORCAtLS0+ICAgICAgICAgICAgICAgICAgICAgICAgfHwKK3x8PT09PXw9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09fHwKK3x8ICAgIFYgICAgICAgICAgIHwgIFJTT19TVEFSVCAgfCAgUlNPX1NUT1AgIHwgIFJTT19SRVNUQVJUIHwgUlNPX1VQREFURV9DRkcgfHwKK3x8IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfHwKK3x8IFJTT19TVEFSVCAgICAgIHwgICAgIE5PICAgICAgfCAgIFlFUyAgICAgIHwgICAgIE5PICAgICAgIHwgICAgICBOTyAgICAgICAgfHwKK3x8IFJTT19TVE9QICAgICAgIHwgICAgWUVTICAgICAgfCAgIFlFUyAgICAgIHwgICAgIFlFUyAgICAgIHwgICAgICBZRVMgICAgICAgfHwKK3x8IFJTT19SRVNUQVJUICAgIHwgICAgWUVTICAgICAgfCAgIE5PICAgICAgIHwgICAgIE5PICAgICAgIHwgICAgICBZRVMgICAgICAgfHwKK3x8IFJTT19VUERBVEVfQ0ZHIHwgICAgWUVTICAgICAgfCAgIE5PICAgICAgIHwgICAgIFlFUyAgICAgIHwgICAgICBZRVMgICAgICAgfHwKK3x8PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09fHwKKyovCisKKyNkZWZpbmUgUlNPX1NUQVJUX0JJVCAgICAgICAoMTw8Uk9BTV9TQ0FOX09GRkxPQURfU1RBUlQpCisjZGVmaW5lIFJTT19TVE9QX0JJVCAgICAgICAgKDE8PFJPQU1fU0NBTl9PRkZMT0FEX1NUT1ApCisjZGVmaW5lIFJTT19SRVNUQVJUX0JJVCAgICAgKDE8PFJPQU1fU0NBTl9PRkZMT0FEX1JFU1RBUlQpCisjZGVmaW5lIFJTT19VUERBVEVfQ0ZHX0JJVCAgKDE8PFJPQU1fU0NBTl9PRkZMT0FEX1VQREFURV9DRkcpCisKKyNkZWZpbmUgUlNPX1NUQVJUX0FMTE9XX01BU0sgICAoIFJTT19TVE9QX0JJVCApCisjZGVmaW5lIFJTT19TVE9QX0FMTE9XX01BU0sgICAgKCBSU09fVVBEQVRFX0NGR19CSVQgfCBSU09fUkVTVEFSVF9CSVQgfCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSU09fU1RPUF9CSVQgfCBSU09fU1RBUlRfQklUICkKKyNkZWZpbmUgUlNPX1JFU1RBUlRfQUxMT1dfTUFTSyAoIFJTT19VUERBVEVfQ0ZHX0JJVCB8IFJTT19TVEFSVF9CSVQgKQorI2RlZmluZSBSU09fVVBEQVRFX0NGR19BTExPV19NQVNLICAoUlNPX1VQREFURV9DRkdfQklUIHwgUlNPX1NUT1BfQklUIHwgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUlNPX1NUQVJUX0JJVCkKKwordEFOSV9CT09MRUFOIENzcklzUlNPQ29tbWFuZEFsbG93ZWQodHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VOCBjb21tYW5kKQoreworICAgIHRwQ3NyTmVpZ2hib3JSb2FtQ29udHJvbEluZm8gcE5laWdoYm9yUm9hbUluZm8gPSAmcE1hYy0+cm9hbS5uZWlnaGJvclJvYW1JbmZvOworICAgIHRBTklfVTggZGVzaXJlZE1hc2sgPSAwOworICAgIHN3aXRjaChjb21tYW5kKQorICAgIHsKKyAgICAgICAgY2FzZSBST0FNX1NDQU5fT0ZGTE9BRF9TVEFSVDoKKyAgICAgICAgICAgICBkZXNpcmVkTWFzayA9IFJTT19TVEFSVF9BTExPV19NQVNLOworICAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFJPQU1fU0NBTl9PRkZMT0FEX1NUT1A6CisgICAgICAgICAgICAgZGVzaXJlZE1hc2sgPSBSU09fU1RPUF9BTExPV19NQVNLOworICAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFJPQU1fU0NBTl9PRkZMT0FEX1JFU1RBUlQ6CisgICAgICAgICAgICAgZGVzaXJlZE1hc2sgPSBSU09fUkVTVEFSVF9BTExPV19NQVNLOworICAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFJPQU1fU0NBTl9PRkZMT0FEX1VQREFURV9DRkc6CisgICAgICAgICAgICAgZGVzaXJlZE1hc2sgPSBSU09fVVBEQVRFX0NGR19BTExPV19NQVNLOworICAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICA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gICAgICAgICIlcyA6IHBJZXMgaXMgTnVsbCIsIF9fZnVuY19fKTsKKyAgICAgICAgICB2b3NfbWVtX2ZyZWUocFJlcXVlc3RCdWYpOworICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgIH0KKyAgICAgICBpZiAocEllcy0+U3VwcFJhdGVzLnByZXNlbnQpCisgICAgICAgeworICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sICJOdW1iZXIgXHQgIFJhdGUiKTsKKyAgICAgICAgICAvKkNoZWNrIGZvciBib3RoIGJhc2ljIHJhdGVzIGFuZCBleHRlbmRlZCByYXRlcy4qLworICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwSWVzLT5TdXBwUmF0ZXMubnVtX3JhdGVzOyBpKyspCisgICAgICAgICAgeworICAgICAgICAgICAgICAvKkNoZWNrIGlmIHRoZSBSYXRlIGlzIE1hbmRhdG9yeSBvciBOb3QqLworICAgICAgICAgICAgICBpZiAoY3NyUmF0ZXNJc0RvdDExUmF0ZVN1cHBvcnRlZChwTWFjLCBwSWVzLT5TdXBwUmF0ZXMucmF0ZXNbaV0pCisgICAgICAgICAgICAgICAgICAmJiAocEllcy0+U3VwcFJhdGVzLnJhdGVzW2ldICYgMHg4MCkpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qUmV0cmlldmUgdGhlIGFjdHVhbCBkYXRhIHJhdGUqLworICAgICAgICAgICAgICAgICAgZGF0YVJhdGUgPSAocEllcy0+U3VwcFJhdGVzLnJhdGVzW2ldICYgMHg3RikvMjsKKyAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlZCBcdFx0ICVkIiwgaSwgZGF0YVJhdGUpOworICAgICAgICAgICAgICAgICAgaWYgKG1pblJhdGUgPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgbWluUmF0ZSA9IGRhdGFSYXRlOworICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICBtaW5SYXRlID0gKG1pblJhdGUgPCBkYXRhUmF0ZSkgPyBtaW5SYXRlOmRhdGFSYXRlOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorCisgICAgICAgICAgaWYgKHBJZXMtPkV4dFN1cHBSYXRlcy5wcmVzZW50KQorICAgICAgICAgIHsKKyAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcEllcy0+RXh0U3VwcFJhdGVzLm51bV9yYXRlczsgaSsrKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgLypDaGVjayBpZiB0aGUgUmF0ZSBpcyBNYW5kYXRvcnkgb3IgTm90Ki8KKyAgICAgICAgICAgICAgICAgaWYgKGNzclJhdGVzSXNEb3QxMVJhdGVTdXBwb3J0ZWQocE1hYywgcEllcy0+RXh0U3VwcFJhdGVzLnJhdGVzW2ldKQorICAgICAgICAgICAgICAgICAgICAgICYmIChwSWVzLT5FeHRTdXBwUmF0ZXMucmF0ZXNbaV0gJiAweDgwKSkKKyAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKlJldHJpZXZlIHRoZSBhY3R1YWwgZGF0YSByYXRlKi8KKyAgICAgICAgICAgICAgICAgICAgZGF0YVJhdGUgPSAocEllcy0+RXh0U3VwcFJhdGVzLnJhdGVzW2ldICYgMHg3RikvMjsKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIiVkIFx0XHQgJWQiLCBpLCBkYXRhUmF0ZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChtaW5SYXRlID09IDApCisgICAgICAgICAgICAgICAgICAgICAgbWluUmF0ZSA9IGRhdGFSYXRlOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgbWluUmF0ZSA9IChtaW5SYXRlIDwgZGF0YVJhdGUpID8gbWluUmF0ZTpkYXRhUmF0ZTsKKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0RFQlVHLCAiTWluUmF0ZSA9ICVkIiwgbWluUmF0ZSk7CisgICAgICAgfQorICAgICAgIGVsc2UKKyAgICAgICB7CisgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgIiVzOiBTdXBwIFJhdGVzIG5vdCBwcmVzZW50IGluIHBJZXMiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgdm9zX21lbV9mcmVlKHBSZXF1ZXN0QnVmKTsKKyAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICB9CisgICAgICAgaWYgKE5VTEwgIT0gcEllcykKKyAgICAgICB7CisgICAgICAgICAgdm9zX21lbV9mcmVlKHBJZXMpOworICAgICAgICAgIHBJZXMgPSBOVUxMOworICAgICAgIH0KKyAgICAgICBzd2l0Y2ggKG1pblJhdGUpCisgICAgICAgeworICAgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgIHBSZXF1ZXN0QnVmLT5SeFNlbnNpdGl2aXR5VGhyZXNob2xkID0gTEZSX1NFTlNJVElWSVRZX1RIUl8xTUJQUzsKKyAgICAgICAgICAgIHBSZXF1ZXN0QnVmLT5Mb29rdXBUaHJlc2hvbGQgPSBMRlJfTE9PS1VQX1RIUl8xTUJQUzsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgMjoKKyAgICAgICAgICAgIHBSZXF1ZXN0QnVmLT5SeFNlbnNpdGl2aXR5VGhyZXNob2xkID0gTEZSX1NFTlNJVElWSVRZX1RIUl8yTUJQUzsKKyAgICAgICAgICAgIHBSZXF1ZXN0QnVmLT5Mb29rdXBUaHJlc2hvbGQgPSBMRlJfTE9PS1VQX1RIUl8yTUJQUzsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgNToKKyAgICAgICAgICAgIHBSZXF1ZXN0QnVmLT5SeFNlbnNpdGl2aXR5VGhyZXNob2xkID0gTEZSX1NFTlNJVElWSVRZX1RIUl81XzVNQlBTOworICAgICAgICAgICAgcFJlcXVlc3RCdWYtPkxvb2t1cFRocmVzaG9sZCA9IExGUl9MT09LVVBfVEhSXzVfNU1CUFM7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlIDY6CisgICAgICAgICAgICBpZiAoQ1NSX0lTX0NIQU5ORUxfMjRHSFoob3BlcmF0aW9uQ2hhbm5lbCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBwUmVxdWVzdEJ1Zi0+UnhTZW5zaXRpdml0eVRocmVzaG9sZCA9IExGUl9TRU5TSVRJVklUWV9USFJfNk1CUFNfMkc7CisgICAgICAgICAgICAgICBwUmVxdWVzdEJ1Zi0+TG9va3VwVGhyZXNob2xkID0gTEZSX0xPT0tVUF9USFJfNk1CUFNfMkc7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBwUmVxdWVzdEJ1Zi0+UnhTZW5zaXRpdml0eVRocmVzaG9sZCA9IExGUl9TRU5TSVRJVklUWV9USFJfNk1CUFNfNUc7CisgICAgICAgICAgICAgICBwUmVxdWVzdEJ1Zi0+TG9va3VwVGhyZXNob2xkID0gTEZSX0xPT0tVUF9USFJfNk1CUFNfNUc7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlIDExOgorICAgICAgICAgICAgcFJlcXVlc3RCdWYtPlJ4U2Vuc2l0aXZpdHlUaHJlc2hvbGQgPSBMRlJfU0VOU0lUSVZJVFlfVEhSXzExTUJQUzsKKyAgICAgICAgICAgIHBSZXF1ZXN0QnVmLT5Mb29rdXBUaHJlc2hvbGQgPSBMRlJfTE9PS1VQX1RIUl8xMU1CUFM7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlIDEyOgorICAgICAgICAgICAgaWYgKENTUl9JU19DSEFOTkVMXzI0R0haKG9wZXJhdGlvbkNoYW5uZWwpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgcFJlcXVlc3RCdWYtPlJ4U2Vuc2l0aXZpdHlUaHJlc2hvbGQgPSBMRlJfU0VOU0lUSVZJVFlfVEhSXzEyTUJQU18yRzsKKyAgICAgICAgICAgICAgIHBSZXF1ZXN0QnVmLT5Mb29rdXBUaHJlc2hvbGQgPSBMRlJfTE9PS1VQX1RIUl8xMk1CUFNfMkc7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBwUmVxdWVzdEJ1Zi0+UnhTZW5zaXRpdml0eVRocmVzaG9sZCA9IExGUl9TRU5TSVRJVklUWV9USFJfMTJNQlBTXzVHOworICAgICAgICAgICAgICAgcFJlcXVlc3RCdWYtPkxvb2t1cFRocmVzaG9sZCA9IExGUl9MT09LVVBfVEhSXzEyTUJQU181RzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgMjQ6CisgICAgICAgICAgICBpZiAoQ1NSX0lTX0NIQU5ORUxfMjRHSFoob3BlcmF0aW9uQ2hhbm5lbCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBwUmVxdWVzdEJ1Zi0+UnhTZW5zaXRpdml0eVRocmVzaG9sZCA9IExGUl9TRU5TSVRJVklUWV9USFJfMjRNQlBTXzJHOworICAgICAgICAgICAgICAgcFJlcXVlc3RCdWYtPkxvb2t1cFRocmVzaG9sZCA9IExGUl9MT09LVVBfVEhSXzI0TUJQU18yRzsKK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U5EX0FMTCAhPSBlQmFuZCkpCisgICAgICAgICAgeworICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiSW52YWxpZCBiYW5kLCBObyBvcGVyYXRpb24gY2FycmllZCBvdXQgKEJhbmQgJWQpIiwgZUJhbmQpOworICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwUmVxdWVzdEJ1Zik7CisgICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgfQorICAgICAgICAgIGZvciAoaT0wOyBpPHBOZWlnaGJvclJvYW1JbmZvLT5jZmdQYXJhbXMuY2hhbm5lbEluZm8ubnVtT2ZDaGFubmVsczsgaSsrKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGlmKCgoZUNTUl9CQU5EXzI0ID09IGVCYW5kKSAmJiBDU1JfSVNfQ0hBTk5FTF8yNEdIWigqQ2hhbm5lbExpc3QpKSB8fAorICAgICAgICAgICAgICAoKGVDU1JfQkFORF81RyA9PSBlQmFuZCkgJiYgQ1NSX0lTX0NIQU5ORUxfNUdIWigqQ2hhbm5lbExpc3QpKSB8fAorICAgICAgICAgICAgICAoZUNTUl9CQU5EX0FMTCA9PSBlQmFuZCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgaWYoKkNoYW5uZWxMaXN0ICYmIGNzclJvYW1Jc0NoYW5uZWxWYWxpZChwTWFjLCAqQ2hhbm5lbExpc3QpICYmCisgICAgICAgICAgICAgICAgKChwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLmFsbG93REZTQ2hhbm5lbFJvYW0pIHx8CisgICAgICAgICAgICAgICAgKCFDU1JfSVNfQ0hBTk5FTF9ERlMoKkNoYW5uZWxMaXN0KSkpICYmCisgICAgICAgICAgICAgICAgKG51bV9jaGFubmVscyA8IFNJUl9ST0FNX01BWF9DSEFOTkVMUykpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgcFJlcXVlc3RCdWYtPkNvbm5lY3RlZE5ldHdvcmsuQ2hhbm5lbENhY2hlW251bV9jaGFubmVscysrXSA9ICpDaGFubmVsTGlzdDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgQ2hhbm5lbExpc3QrKzsKKyAgICAgICAgICB9CisgICAgICAgICAgcFJlcXVlc3RCdWYtPkNvbm5lY3RlZE5ldHdvcmsuQ2hhbm5lbENvdW50ID0gbnVtX2NoYW5uZWxzOworICAgICAgICAgIHBSZXF1ZXN0QnVmLT5DaGFubmVsQ2FjaGVUeXBlID0gQ0hBTk5FTF9MSVNUX1NUQVRJQzsKKyAgICAgICB9CisgICAgICAgZWxzZQorICAgICAgIHsKKyAgICAgICAgICBDaGFubmVsTGlzdCA9IHBNYWMtPnNjYW4ub2NjdXBpZWRDaGFubmVscy5jaGFubmVsTGlzdDsKKyAgICAgICAgICBmb3IoaT0wOyBpPHBNYWMtPnNjYW4ub2NjdXBpZWRDaGFubmVscy5udW1DaGFubmVsczsgaSsrKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICAvKkFsbG93IERGUyBjaGFubmVscyBvbmx5IGlmIHRoZSBERlMgY2hhbm5lbCByb2FtIGZsYWcgaXMgZW5hYmxlZCAqLworICAgICAgICAgICAgIGlmKCpDaGFubmVsTGlzdCAmJiAoKHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uYWxsb3dERlNDaGFubmVsUm9hbSkgfHwKKyAgICAgICAgICAgICAgICAoIUNTUl9JU19DSEFOTkVMX0RGUygqQ2hhbm5lbExpc3QpKSkgJiYKKyAgICAgICAgICAgICAgICAobnVtX2NoYW5uZWxzIDwgU0lSX1JPQU1fTUFYX0NIQU5ORUxTKSkKKyAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFJlcXVlc3RCdWYtPkNvbm5lY3RlZE5ldHdvcmsuQ2hhbm5lbENh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yNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICAgZWxzZQorICAgIHsKKyAgICAgIC8qIElmIEVTRSBpcyBlbmFibGVkLCBhbmQgYSBuZWlnaGJvciBSZXBvcnQgaXMgcmVjZWl2ZWQsdGhlbgorICAgICAgICogSWdub3JlIHRoZSBJTkkgQ2hhbm5lbHMgb3IgdGhlIE9jY3VwaWVkIENoYW5uZWwgTGlzdC4gQ29uc2lkZXIKKyAgICAgICAqIHRoZSBjaGFubmVscyBpbiB0aGUgbmVpZ2hib3IgbGlzdCBzZW50IGJ5IHRoZSBFU0UgQVAuKi8KKyAgICAgICBpZiAoY3VyckNoYW5uZWxMaXN0SW5mby0+bnVtT2ZDaGFubmVscyAhPSAwKQorICAgICAgIHsKKyAgICAgICAgICBDaGFubmVsTGlzdCA9IGN1cnJDaGFubmVsTGlzdEluZm8tPkNoYW5uZWxMaXN0OworICAgICAgICAgIGZvciAoaT0wO2k8Y3VyckNoYW5uZWxMaXN0SW5mby0+bnVtT2ZDaGFubmVscztpKyspCisgICAgICAgICAgeworICAgICAgICAgICAgIGlmKCpDaGFubmVsTGlzdCAmJiAoKHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uYWxsb3dERlNDaGFubmVsUm9hbSkgfHwKKyAgICAgICAgICAgICAgICAoIUNTUl9JU19DSEFOTkVMX0RGUygqQ2hhbm5lbExpc3QpKSkpCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBSZXF1ZXN0QnVmLT5Db25uZWN0ZWROZXR3b3JrLkNoYW5uZWxDYWNoZVtudW1fY2hhbm5lbHMrK10gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpDaGFubmVsTGlzdDsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgICAgQ2hhbm5lbExpc3QrKzsKKyAgICAgICAgICB9CisgICAgICAgICAgcFJlcXVlc3RCdWYtPkNvbm5lY3RlZE5ldHdvcmsuQ2hhbm5lbENvdW50ID0gbnVtX2NoYW5uZWxzOworICAgICAgICAgIHBSZXF1ZXN0QnVmLT5DaGFubmVsQ2FjaGVUeXBlID0gQ0hBTk5FTF9MSVNUX0RZTkFNSUNfVVBEQVRFOworICAgICAgIH0KKyAgICAgfQorI2VuZGlmCisgICAgZm9yIChpID0gMCwgaiA9IDA7aiA8IChzaXplb2YoQ2hhbm5lbENhY2hlU3RyKS9zaXplb2YoQ2hhbm5lbENhY2hlU3RyWzBdKSkKKyAgICAgICAgICAgICAgICAgICAgICAmJiBpIDwgcFJlcXVlc3RCdWYtPkNvbm5lY3RlZE5ldHdvcmsuQ2hhbm5lbENvdW50OyBpKyspCisgICAgeworICAgICAgICBpZiAoaiA8IHNpemVvZihDaGFubmVsQ2FjaGVTdHIpKQorICAgICAgICB7CisgICAgICAgICAgICBqICs9IHNucHJpbnRmKENoYW5uZWxDYWNoZVN0ciArIGosIHNpemVvZihDaGFubmVsQ2FjaGVTdHIpIC0gaiwiICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcFJlcXVlc3RCdWYtPkNvbm5lY3RlZE5ldHdvcmsuQ2hhbm5lbENhY2hlW2ldKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0RFQlVHLAorICAgICAgICAgICAgICAiQ2hubENhY2hlVHlwZTolZCwgTm8gb2YgQ2hubHM6JWQsQ2hhbm5lbHM6ICVzIiwKKyAgICAgICAgICAgICAgcFJlcXVlc3RCdWYtPkNoYW5uZWxDYWNoZVR5cGUsCisgICAgICAgICAgICAgIHBSZXF1ZXN0QnVmLT5Db25uZWN0ZWROZXR3b3JrLkNoYW5uZWxDb3VudCwKKyAgICAgICAgICAgICAgQ2hhbm5lbENhY2hlU3RyKTsKKyAgICBudW1fY2hh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gIHsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgdm9zU3RhdHVzID0gdm9zX3RpbWVyX2luaXQoICZwVGVtcFN0YUVudHJ5LT5oUGVTdGF0c1RpbWVyLCBWT1NfVElNRVJfVFlQRV9TVywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyUm9hbVBlU3RhdHNUaW1lckhhbmRsZXIsIHBUZW1wU3RhRW50cnkgKTsKKyAgICAgICAgICAgIGlmICggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyggdm9zU3RhdHVzICkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJjc3JSb2FtQ2hlY2tQZVN0YXRzUmVxTGlzdDpjYW5ub3QgaW5pdCBoUGVTdGF0c1RpbWVyIHRpbWVyIikpOworICAgICAgICAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgICAvL3N0YXJ0IHRpbWVyCisgICAgICAgICBzbXNMb2cocE1hYywgTE9HMSwgImNzclJvYW1DaGVja1BlU3RhdHNSZXFMaXN0OnBlU3RhdHNUaW1lciBwZXJpb2QgJWQiLCBwVGVtcFN0YUVudHJ5LT5wZXJpb2RpY2l0eSk7CisgICAgICAgICB2b3NTdGF0dXMgPSB2b3NfdGltZXJfc3RhcnQoICZwVGVtcFN0YUVudHJ5LT5oUGVTdGF0c1RpbWVyLCBwVGVtcFN0YUVudHJ5LT5wZXJpb2RpY2l0eSApOworICAgICAgICAgaWYgKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCB2b3NTdGF0dXMgKSApIAorICAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJjc3JSb2FtQ2hlY2tQZVN0YXRzUmVxTGlzdDpjYW5ub3Qgc3RhcnQgaFBlU3RhdHNUaW1lciB0aW1lciIpKTsKKyAgICAgICAgICAgIHJldHVybiBOVUxMOwor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BzbXNMb2cocE1hYywgTE9HRSwgRkwoIiBMaXN0IGVtcHR5LCBubyBzdGF0cyByZXEgZm9yIFBFIikpOworICAgICAgcmV0dXJuOworICAgfQorICAgd2hpbGUoIHBFbnRyeSApCisgICB7CisgICAgICBwVGVtcFN0YUVudHJ5ID0gR0VUX0JBU0VfQUREUiggcEVudHJ5LCB0Q3NyUGVTdGF0c1JlcUluZm8sIGxpbmsgKTsKKyAgICAgIGlmKCBwVGVtcFN0YUVudHJ5ICYmIHBUZW1wU3RhRW50cnktPnN0YXRzTWFzayA9PSBwUGVTdGFFbnRyeS0+c3RhdHNNYXNrKQorICAgICAgeworICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csIEZMKCJNYXRjaCBmb3VuZCIpKTsKKyAgICAgICAgIGlmKHBUZW1wU3RhRW50cnktPnRpbWVyUnVubmluZykKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHZvc1N0YXR1cyA9IHZvc190aW1lcl9zdG9wKCAmcFRlbXBTdGFFbnRyeS0+aFBlU3RhdHNUaW1lciApOworICAgICAgICAgICAgLyogSWYgd2UgYXJlIG5vdCBhYmxlIHRvIHN0b3AgdGhlIHRpbWVyIGhlcmUsIGp1c3QgcmVtb3ZlIAorICAgICAgICAgICAgICogdGhlIGVudHJ5IGZyb20gdGhlIGxpbmtlZCBsaXN0LiBEZXN0cm95IHRoZSB0aW1lciBvYmplY3QgCisgICAgICAgICAgICAgKiBhbmQgZnJlZSB0aGUgbWVtb3J5IGluIHRoZSB0aW1lciBDQgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBpZiAoIHZvc1N0YXR1cyA9PSBWT1NfU1RBVFVTX1NVQ0NFU1MgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLyogdGhlIHRpbWVyIGlzIHN1Y2Nlc3NmdWxseSBzdG9wcGVkICovCisgICAgICAgICAgICAgICBwVGVtcFN0YUVudHJ5LT50aW1lclJ1bm5pbmcgPSBGQUxTRTsKKworICAgICAgICAgICAgICAgLyogRGVzdHJveSB0aGUgdGltZXIgKi8KKyAgICAgICAgICAgICAgIHZvc1N0YXR1cyA9IHZvc190aW1lcl9kZXN0cm95KCAmcFRlbXBTdGFFbnRyeS0+aFBlU3RhdHNUaW1lciApOworICAgICAgICAgICAgICAgaWYgKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCB2b3NTdGF0dXMgKSApCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoImNzclJvYW1SZW1vdmVFbnRyeUZyb21QZVN0YXRzUmVxTGlzdDpmYWlsZWQgdG8gZGVzdHJveSBoUGVTdGF0c1RpbWVyIHRpbWVyIikpOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLy8gdGhlIHRpbWVyIGNvdWxkIG5vdCBiZSBzdG9wcGVkLiBIZW5jZSBkZXN0cm95IGFuZCBmcmVlIHRoZSAKKyAgICAgICAgICAgICAgIC8vIG1lbW9yeSBmb3IgdGhlIFBFIHN0YXQgZW50cnkgaW4gdGhlIHRpbWVyIENCLgorICAgICAgICAgICAgICAgcFRlbXBTdGFFbnRyeS0+dGltZXJTdG9wRmFpbGVkID0gVFJVRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0gCisKKyAgICAgICAgIGlmKGNzckxMUmVtb3ZlRW50cnkoJnBNYWMtPnJvYW0ucGVTdGF0c1JlcUxpc3QsIHBFbnRyeSwgTExfQUNDRVNTX0xPQ0spKQorICAgICAgICAgeworICAgICAgICAgICAgLy8gT25seSBmcmVlIHRoZSBtZW1vcnkgaWYgd2UgY291bGQgc3RvcCB0aGUgdGltZXIgc3VjY2Vzc2Z1bGx5CisgICAgICAgICAgICBpZighcFRlbXBTdGFFbnRyeS0+dGltZXJTdG9wRmFpbGVkKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShw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21lbV9jb3B5KCBwU3RhdHMsICh0QU5JX1U4ICopJnBNYWMtPnJvYW0uY2xhc3NBU3RhdHNJbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0Q3NyR2xvYmFsQ2xhc3NBU3RhdHNJbmZvKSk7CisgICAgICAgICAgICBwU3RhdHMgKz0gc2l6ZW9mKHRDc3JHbG9iYWxDbGFzc0FTdGF0c0luZm8pOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICBjYXNlIGVDc3JHbG9iYWxDbGFzc0JTdGF0czoKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HMiwgRkwoIkNsYXNzQiBzdGF0cyIpKTsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSggcFN0YXRzLCAodEFOSV9VOCAqKSZwTWFjLT5yb2FtLmNsYXNzQlN0YXRzSW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodENzckdsb2JhbENsYXNzQlN0YXRzSW5mbykpOworICAgICAgICAgICAgcFN0YXRzICs9IHNpemVvZih0Q3NyR2xvYmFsQ2xhc3NCU3RhdHNJbmZvKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgY2FzZSBlQ3NyR2xvYmFsQ2xhc3NDU3RhdHM6CisgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPRzIsIEZMKCJDbGFzc0Mgc3RhdHMiKSk7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoIHBTdGF0cywgKHRBTklfVTggKikmcE1hYy0+cm9hbS5jbGFzc0NTdGF0c0luZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRDc3JHbG9iYWxDbGFzc0NTdGF0c0luZm8pKTsKKyAgICAgICAgICAgIHBTdGF0cyArPSBzaXplb2YodENzckdsb2JhbENsYXNzQ1N0YXRzSW5mbyk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIGNhc2UgZUNzckdsb2JhbENsYXNzRFN0YXRzOgorICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0cyLCBGTCgiQ2xhc3NEIHN0YXRzIikpOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCBwU3RhdHMsICh0QU5JX1U4ICopJnBNYWMtPnJvYW0uY2xhc3NEU3RhdHNJbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodENzckdsb2JhbENsYXNzRFN0YXRzSW5mbykpOworICAgICAgICAgICAgcFN0YXRzICs9IHNpemVvZih0Q3NyR2xvYmFsQ2xhc3NEU3RhdHNJbmZvKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgY2FzZSBlQ3NyUGVyU3RhU3RhdHM6CisgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPRzIsIEZMKCJQZXJTdGEgc3RhdHMiKSk7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoIHBTdGF0cywgKHRBTklfVTggKikmcE1hYy0+cm9hbS5wZXJTdGFTdGF0c0luZm9bc3RhSWRdLAorICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0Q3NyUGVyU3RhU3RhdHNJbmZvKSk7CisgICAgICAgICAgICBwU3RhdHMgKz0gc2l6ZW9mKHRDc3JQZXJTdGFTdGF0c0luZm8pOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiVW5rbm93biBzdGF0cyB0eXBlIGFuZCBjb3VudGVyICVkIiksIGNvdW50ZXIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisgICAgICB9CisgICAgICB0ZW1wTWFzayA+Pj0xOworICAgICAgY291bnRlcisrOworICAgfQorICAgY2FsbGJhY2soc3RhdHMsIHBDb250ZXh0ICk7Cit9CisKK2VIYWxTdGF0dXMgY3NyUm9hbURlcmVnU3RhdGlzdGljc1JlcSh0cEFuaVNpckdsb2JhbCBwTWFjKQoreworICAgdExpc3RFbGVtICpwRW50cnkgPSBOVUxMOworICAgdExpc3RFbGVtICpwUHJldkVudHJ5ID0gTlVMTDsKKyAgIHRDc3JTdGF0c0NsaWVudFJlcUluZm8gKnBUZW1wU3RhRW50cnkgPSBOVUxMOworICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgVk9TX1NUQVRVUyB2b3NTdGF0dXM7CisgICBwRW50cnkgPSBjc3JMTFBlZWtIZWFkKCAmcE1hYy0+cm9hbS5zdGF0c0NsaWVudFJlcUxpc3QsIExMX0FDQ0VTU19MT0NLICk7CisgICBpZighcEVudHJ5KQorICAgeworICAgICAgLy9saXN0IGVtcHR5CisgICAgICBzbXNMb2cocE1hYywgTE9HVywgImNzclJvYW1EZXJlZ1N0YXRpc3RpY3NSZXE6IExpc3QgZW1wdHksIG5vIHJlcXVlc3QgZnJvbSAiCisgICAgICAgICAgICAgInVwcGVyIGxheWVyIGNsaWVudChzKSIpOworICAgICAgcmV0dXJuIHN0YXR1czsKKyAgIH0KKyAgIHdoaWxlKCBwRW50cnkgKQorICAgeworICAgICAgaWYocFByZXZFbnRyeSkKKyAgICAgIHsKKyAgICAgICAgIHBUZW1wU3RhRW50cnkgPSBHRVRfQkFTRV9BRERSKCBwUHJldkVudHJ5LCB0Q3NyU3RhdHNDbGllbnRSZXFJbmZvLCBsaW5rICk7CisgICAgICAgICAvL3NlbmQgdXAgdGhlIHN0YXRzIHJlcG9ydAorICAgICAgICAgY3NyUm9hbVJlcG9ydFN0YXRpc3RpY3MocE1hYywgcFRlbXBTdGFFbnRyeS0+c3RhdHNNYXNrLCBwVGVtcFN0YUVudHJ5LT5jYWxsYmFjaywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVGVtcFN0YUVudHJ5LT5zdGFJZCwgcFRlbXBTdGFFbnRyeS0+cENvbnRleHQpOworICAgICAgICAgY3NyUm9hbVJlbW92ZVN0YXRMaXN0RW50cnkocE1hYywgcFByZXZFbnRyeSk7Cis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W50IHJlcSB0aW1lciIpKTsKKyAgICAgICAgICB9CisgICAgICB9CisgICAgICAKKyAgICAgIAorICAgICAgcFByZXZFbnRyeSA9IHBFbnRyeTsKKyAgICAgIHBFbnRyeSA9IGNzckxMTmV4dCggJnBNYWMtPnJvYW0uc3RhdHNDbGllbnRSZXFMaXN0LCBwRW50cnksIExMX0FDQ0VTU19OT0xPQ0sgKTsKKyAgIH0KKyAgIC8vdGhlIGxhc3Qgb25lCisgICBpZihwUHJldkVudHJ5KQorICAgeworICAgICAgcFRlbXBTdGFFbnRyeSA9IEdFVF9CQVNFX0FERFIoIHBQcmV2RW50cnksIHRDc3JTdGF0c0NsaWVudFJlcUluZm8sIGxpbmsgKTsKKyAgICAgIC8vc2VuZCB1cCB0aGUgc3RhdHMgcmVwb3J0CisgICAgICBjc3JSb2FtUmVwb3J0U3RhdGlzdGljcyhwTWFjLCBwVGVtcFN0YUVudHJ5LT5zdGF0c01hc2ssIHBUZW1wU3RhRW50cnktPmNhbGxiYWNrLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wU3RhRW50cnktPnN0YUlkLCBwVGVtcFN0YUVudHJ5LT5wQ29udGV4dCk7CisgICAgICBjc3JSb2FtUmVtb3ZlU3RhdExpc3RFbnRyeShwTWFjLCBwUHJldkVudHJ5KTsKKyAgIH0KKyAgIHJldHVybiBzdGF0dXM7CisgICAKK30KKworZUhhbFN0YXR1cyBjc3JJc0Z1bGxQb3dlck5lZWRlZCggdHBBbmlTaXJHbG9iYWwgcE1hYywgdFNtZUNtZCAqcENvbW1hbmQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0UmVxdWVzdEZ1bGxQb3dlclJlYXNvbiAqcFJlYXNvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9CT09MRUFOICpwZk5lZWRQb3dlciApCit7CisgICAgdEFOSV9CT09MRUFOIGZOZWVkRnVsbFBvd2VyID0gZUFOSV9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yU2NhbkdldFJlc3VsdDoKKyAgICAgICAgICAgIGNhc2UgZUNzclNjYW5CR1NjYW5BYm9ydDoKKyAgICAgICAgICAgIGNhc2UgZUNzclNjYW5CR1NjYW5FbmFibGU6CisgICAgICAgICAgICBjYXNlIGVDc3JTY2FuR2V0U2NhbkNobkluZm86CisgICAgICAgICAgICAgICAgLy9JbnRlcm5hbCBwcm9jZXNzLCBubyBuZWVkIGZvciBmdWxsIHBvd2VyCisgICAgICAgICAgICAgICAgZk5lZWRGdWxsUG93ZXIgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIC8vT3RoZXIgc2NhbnMgYXJlIHJlYWwgc2NhbiwgYXNrIGZvciBwb3dlcgorICAgICAgICAgICAgICAgIGZOZWVkRnVsbFBvd2VyID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9IC8vc3dpdGNoCisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvL2FzayBmb3IgcG93ZXIgZm9yIHJvYW0gYW5kIHN0YXR1cyBjaGFuZ2UKKyAgICAgICAgICAgIGZOZWVkRnVsbFBvd2VyID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBSRVFVRVNUX0JNUFM6CisgICAgY2FzZSBCTVBTOgorICAgIGNhc2UgUkVRVUVTVF9TVEFSVF9VQVBTRDoKKyAgICBjYXNlIFVBUFNEOgorICAgIC8vV2UgdHJlYXQgV09XTCBzYW1lIGFzIEJNUFMKKyAgICBjYXNlIFJFUVVFU1RfRU5URVJfV09XTDoKKyAgICBjYXNlIFdPV0w6CisgICAgICAgIGlmKCBlU21lQ29tbWFuZFJvYW0gPT0gcENvbW1hbmQtPmNvbW1hbmQgKQorICAgICAgICB7CisgICAgICAgICAgICB0U2NhblJlc3VsdExpc3QgKnBCU1NMaXN0ID0gKHRTY2FuUmVzdWx0TGlzdCAqKXBDb21tYW5kLT51LnJvYW1DbWQuaEJTU0xpc3Q7CisgICAgICAgICAgICB0Q3NyU2NhblJlc3VsdCAqcFNjYW5SZXN1bHQ7CisgICAgICAgICAgICB0TGlzdEVsZW0gKnBFbnRyeTsKKyAgICAgICAgICAgIHN3aXRjaCAoIHBDb21tYW5kLT51LnJvYW1DbWQucm9hbVJlYXNvbiApCisgICAgICAgICAgICB7CisgICAgICAgICAgICBjYXNlIGVDc3JGb3JjZWREaXNhc3NvYzoKKyAgICAgICAgICAgIGNhc2UgZUNzckZvcmNlZERpc2Fzc29jTUlDRmFpbHVyZToKKyAgICAgICAgICAgICAgICByZWFzb24gPSBlU01FX0xJTktfRElTQ09OTkVDVEVEX0JZX0hERDsKKyAgICAgICAgICAgICAgICBmTmVlZEZ1bGxQb3dlciA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgZUNzclNtZUlzc3VlZERpc2Fzc29jRm9ySGFuZG9mZjoKKyAgICAgICAgICAgIGNhc2UgZUNzckZvcmNlZERlYXV0aDoKKyAgICAgICAgICAgIGNhc2UgZUNzckhkZElzc3VlZFJlYXNzb2NUb1NhbWVBUDoKKyAgICAgICAgICAgIGNhc2UgZUNzclNtZUlzc3VlZFJlYXNzb2NUb1NhbWVBUDoKKyAgICAgICAgICAgICAgICBmTmVlZEZ1bGxQb3dlciA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBlQ3NyQ2Fwc0NoYW5nZToKKyAgICAgICAgICAgICAgICBmTmVlZEZ1bGxQb3dlciA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAvL0NoZWNrIHdoZXRoZXIgdGhlIHByb2ZpbGUgaXMgYWxyZWFkeSBjb25uZWN0ZWQuIElmIHNvLCBubyBuZWVkIGZvciBmdWxsIHBvd2VyCisgICAgICAgICAgICAgICAgLy9Ob3RlOiBJQlNTIGlzIGlnbm9yZWQgZm9yIG5vdyBiZWNhdXNlIHdlIGRvbid0IHN1cHBvcnQgcG93ZXJzYXZlIGluIElCU1MKKyAgICAgICAgICAgICAgICBpZiAoIGNzcklzQ29ublN0YXRlQ29ubmVjdGVkSW5mcmEocE1hYywgc2Vzc2lvbklkKSAmJiBwQlNTTGlzdCApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvL09ubHkgbmVlZCB0byBjaGVjayB0aGUgZmlyc3Qgb25lCisgICAgICAgICAgICAgICAgICAgIHBFbnRyeSA9IGNzckxMUGVla0hlYWQoJnBCU1NMaXN0LT5MaXN0LCBMTF9BQ0NFU1NfTE9DSyk7CisgICAgICAgICAgICAgICAgICAgIGlmKCBwRW50cnkgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwU2NhblJlc3VsdCA9IEdFVF9CQVNFX0FERFIocEVudHJ5LCB0Q3NyU2NhblJlc3VsdCwgTGluayk7CisjaWYgMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ETyA6IFNlc3Npb24gU3BlY2lmaWMgaW5mbyBwQ29ubmVjdEJzc0Rlc2MKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBjc3JJc0Jzc0lkRXF1YWwoIHBNYWMsICZwU2NhblJlc3VsdC0+UmVzdWx0LkJzc0Rlc2NyaXB0b3IsIHBNYWMtPnJvYW0ucENvbm5lY3RCc3NEZXNjICkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JJc1NzaWRFcXVhbCggcE1hYywgcE1hYy0+cm9hbS5wQ29ubmVjdEJzc0Rlc2MsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFNjYW5SZXN1bHQtPlJlc3VsdC5Cc3NEZXNjcmlwdG9yLCAodERvdDExZkJlYWNvbklFcyAqKSggcFNjYW5SZXN1bHQtPlJlc3VsdC5wdkllcyApICkgKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIENoZWNrIHRvIHNlZSBpZiB0aGUgQXV0aCB0eXBlIGhhcyBjaGFuZ2VkIGluIHRoZSBQcm9maWxlLiAgSWYgc28sIHdlIGRvbid0IHdhbnQgdG8gUmVhc3NvY2lhdGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB3aXRoIEF1dGhlbnRpY2F0aW5nIGZpcnN0LiAgVG8gZm9yY2UgdGhpcywgc3RvcCB0aGUgY3VycmVudCBhc3NvY2lhdGlvbiAoRGlzYXNzb2NpYXRlKSBhbmQgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhlbiByZSAnSm9pbicgdGhlIEFQLCB3aWhjaCB3aWxsIGZvcmNlIGFuIEF1dGhlbnRpY2F0aW9uICh3aXRoIHRoZSBuZXcgQXV0aCB0eXBlKSBmb2xsb3dlZCBieSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhIG5ldyBBc3NvY2lhdGlvbi4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihjc3JJc1NhbWVQcm9maWxlKHBNYWMsICZwTWFjLT5yb2FtLmNvbm5lY3RlZFByb2ZpbGUsIHBQcm9maWxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGNzclJvYW1Jc1NhbWVQcm9maWxlS2V5cyhwTWFjLCAmcE1hYy0+cm9hbS5jb25uZWN0ZWRQcm9maWxlLCBwUHJvZmlsZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vRG9uZSwgZXZlbnR1YWxseSwgdGhlIGNvbW1hbmQgcmVhY2hlcyBlQ3NyUmVhc3NvY1RvU2VsZk5vQ2FwQ2hhbmdlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9ObyBuZWVkIGZvciBmdWxsIHBvd2VyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1NldCB0aGUgZmxhZyBzbyB0aGUgY29kZSBsYXRlciBjYW4gYXZvaWQgdG8gZG8gdGhlIGFib3ZlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2NoZWNrIGFnYWluLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUucm9hbUNtZC5mUmVhc3NvY1RvU2VsZk5vQ2FwQ2hhbmdlID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8vSWYgd2UgYXJlIGhlcmUsIGZ1bGwgcG93ZXIgaXMgbmVlZGVkCisgICAgICAgICAgICAgICAgZk5lZWRGdWxsUG93ZXIgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmKCBlU21lQ29tbWFuZFdtU3RhdHVzQ2hhbmdlID09IHBDb21tYW5kLT5jb21tYW5kICkKKyAgICAgICAgeworICAgICAgICAgICAgLy9uZWVkIGZ1bGwgcG93ZXIgZm9yIGFsbAorICAgICAgICAgICAgZk5lZWRGdWxsUG93ZXIgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgIHJlYXNvbiA9IGVTTUVfTElOS19ESVNDT05ORUNURURfQllfT1RIRVI7CisgICAgICAgIH0KKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworICAgICAgICBlbHNlIGlmKCBlU21lQ29tbWFuZFRkbHNBZGRQZWVyID09IHBDb21tYW5kLT5jb21tYW5kICkKKyAgICAgICAgeworICAgICAgICAgICAgLy9URExTIGxpbmsgaXMgZ2V0dGluZyBlc3RhYmxpc2hlZC4gbmVlZCBmdWxsIHBvd2VyIAorICAgICAgICAgICAgZk5lZWRGdWxsUG93ZXIgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgIHJlYXNvbiA9IGVTTUVfRlVMTF9QV1JfTkVFREVEX0JZX1RETFNfUEVFUl9TRVRVUDsKKyAgICAgICAgfQorI2VuZGlmCisgICAgICAgIGVsc2UgaWYgKGVTbWVDb21tYW5kRGVsU3RhU2Vzc2lvbiA9PSBwQ29tbWFuZC0+Y29tbWFuZCkKKyAgICAgICAgeworICAgICAgICAgICAgLy9uZWVkIGZ1bGwgcG93ZXIgZm9yIGFsbAorICAgICAgICAgICAgZk5lZWRGdWxsUG93ZXIgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgfQorCisgICAgICAgIGJyZWFrOworICAgIGNhc2UgUkVRVUVTVF9TVE9QX1VBUFNEOgorICAgIGNhc2UgUkVRVUVTVF9FWElUX1dPV0w6CisgICAgICAgIGlmKCBlU21lQ29tbWFuZFJvYW0gPT0gcENvbW1hbmQtPmNvbW1hbmQgKQorICAgICAgICB7CisgICAgICAgICAgICBmTmVlZEZ1bGxQb3dlciA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgc3dpdGNoICggcENvbW1hbmQtPnUucm9hbUNtZC5yb2FtUmVhc29uICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjYXNlIGVDc3JGb3JjZWREaXNhc3NvYzoKKyAgICAgICAgICAgICAgICBjYXNlIGVDc3JGb3JjZWREaXNhc3NvY01JQ0ZhaWx1cmU6CisgICAgICAgICAgICAgICAgICAgIHJlYXNvbiA9IGVTTUVfTElOS19ESVNDT05ORUNURURfQllfSEREOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgU1RPUFBFRDoKKyAgICBjYXNlIFJFUVVFU1RfU1RBTkRCWToKKyAgICBjYXNlIFNUQU5EQlk6CisgICAgY2FzZSBMT1dfUE9XRVI6CisgICAgICAgIC8vV2UgYXJlIG5vdCBzdXBwb3NlZCB0byBkbyBhbnl0aGluZworICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCAiY2Fubm90IHByb2Nlc3MgYmVjYXVzZSBQTUMgaXMgaW4iCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgc3RvcHBlZC9zdGFuZGJ5IHN0YXRlICVzICglZCkiICksCisgICAgICAgICAgICAgICAgc21lX1BtY1N0YXRldG9TdHJpbmcocG1jU3RhdGUpLCBwbWNTdGF0ZSApOworICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICBicmVhazsKKyAgICBjYXNlIEZVTExfUE9XRVI6CisgICAgY2FzZSBSRVFVRVNUX0ZVTExfUE9XRVI6CisgICAgZGVmYXVsdDoKKyAgICAgICAgLy9ObyBuZWVkIHRvIGFzayBmb3IgZnVsbCBwb3dlci4gVGhpcyBoYXMgdG8gYmUgRlVMTF9QT1dFUiBzdGF0ZQorICAgICAgICBicmVhazsKKyAgICB9IC8vc3dpdGNoCisgICAgaWYoIHBSZWFzb24gKQorICAgIHsKKyAgICAgICAgKnBSZWF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Zmlyc3QKKyAgICAgICAgZk5vQ21kUGVuZGluZyA9IGNzckxMSXNMaXN0RW1wdHkoICZwTWFjLT5yb2FtLnJvYW1DbWRQZW5kaW5nTGlzdCwgZUFOSV9CT09MRUFOX0ZBTFNFICk7CisgICAgICAgIGlmKCBmTm9DbWRQZW5kaW5nICkKKyAgICAgICAgeworICAgICAgICAgICAgc21lUHVzaENvbW1hbmQoIHBNYWMsIHBDb21tYW5kLCBmSGlnaFByaW9yaXR5ICk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvL090aGVyIGNvbW1hbmRzIGFyZSB3YWl0aW5nIGZvciBQTUMgY2FsbGJhY2ssIHF1ZXVlIHRoZSBuZXcgY29tbWFuZCB0byB0aGUgcGVuZGluZyBRCisgICAgICAgICAgICAvL25vIGxpc3QgbG9jayBpcyBuZWVkZWQgc2luY2UgU01FIGxvY2sgaXMgaGVsZAorICAgICAgICAgICAgaWYoICFmSGlnaFByaW9yaXR5ICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjc3JMTEluc2VydFRhaWwoICZwTWFjLT5yb2FtLnJvYW1DbWRQZW5kaW5nTGlzdCwgJnBDb21tYW5kLT5MaW5rLCBlQU5JX0JPT0xFQU5fRkFMU0UgKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgIGNzckxMSW5zZXJ0SGVhZCggJnBNYWMtPnJvYW0ucm9hbUNtZFBlbmRpbmdMaXN0LCAmcENvbW1hbmQtPkxpbmssIGVBTklfQk9PTEVBTl9GQUxTRSApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYoIGVIQUxfU1RBVFVTX1BNQ19QRU5ESU5HID09IHN0YXR1cyApCisgICAgeworICAgICAgICAvL25vIGxpc3QgbG9jayBpcyBuZWVkZWQgc2luY2UgU01FIGxvY2sgaXMgaGVsZAorICAgICAgICBpZiggIWZI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HsKKyAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCggIiAgU2Vzc2lvbiBkb2VzIG5vdCBleGlzdCBmb3Igc2Vzc2lvbiBpZCAlZCIgKSwgc2Vzc2lvbklkKTsKKyAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgfQorICAgIGRvCisgICAgeworICAgICAgICBwTXNnID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRTaXJVcGRhdGVBUFdQQVJTTklFc1JlcSkpOworICAgICAgICBpZiAoIE5VTEwgPT0gcE1zZyApIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICB2b3NfbWVtX3NldChwTXNnLCBzaXplb2YoIHRTaXJVcGRhdGVBUFdQQVJTTklFc1JlcSApLCAwKTsKKyAgICAgICAgcE1zZy0+bWVzc2FnZVR5cGUgPSBwYWxfY3B1X3RvX2JlMTYoKHRBTklfVTE2KWVXTklfU01FX1NFVF9BUFdQQVJTTklFc19SRVEpOworICAgICAgICBwQnVmID0gKHRBTklfVTggKikmcE1zZy0+dHJhbnNhY3Rpb25JZDsKKyAgICAgICAgd1RtcEJ1ZiA9IHBCdWY7CisgICAgICAgIC8vIHRyYW5zYWN0aW9uSWQKKyAgICAgICAgKnBCdWYgPSAwOworICAgICAgICAqKCBwQnVmICsgMSApID0gMDsKKyAgICAgICAgcEJ1ZiArPSBzaXplb2YodEFOSV9VMTYpOworICAgICAgICBWT1NfQVNTRVJUKHBCdWYpOworCisgICAgICAgIC8vIGJzc0lkCisgICAgICAgIHZvc19tZW1fY29weSgodFNpck1hY0FkZHIgKilwQnVmLCAmcFNlc3Npb24tPnNlbGZNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgIHBCdWYgKz0gc2l6ZW9mKHRTaXJNYWNBZGRyKTsKKyAgICAgICAgLy8gc2Vzc2lvbklkCisgICAgICAgICpwQnVm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oJnBNYWMtPmZ0LmZ0U21lQ29udGV4dC5wcmVBdXRoUmVhc3NvY0ludHZsVGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA2MCk7CisgICAgaWYgKHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ucm9hbURlbGF5U3RhdHNFbmFibGVkKQorICAgIHsKKyAgICAgICAgdm9zX3JlY29yZF9yb2FtX2V2ZW50KGVfU01FX1BSRUFVVEhfUkVBU1NPQ19TVEFSVCwgTlVMTCwgMCk7CisgICAgfQorICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHN0YXR1cykKKyAgICB7CisgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiUHJlYXV0aCByZWFzc29jIGludGVydmFsIHRpbWVyIHN0YXJ0IGZhaWxlZCB0byBzdGFydCB3aXRoIHN0YXR1cyAlZCIpLCBzdGF0dXMpOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIC8vIFNhdmUgdGhlIHJlY2VpdmVkIHJlc3BvbnNlCisgICAgdm9zX21lbV9jb3B5KCh2b2lkICopJnBNYWMtPmZ0LmZ0U21lQ29udGV4dC5wcmVBdXRoYnNzSWQsCisgICAgICAgICAgICAgICAgICh2b2lkICopcEZUUHJlQXV0aFJzcC0+cHJlQXV0aGJzc0lkLCBzaXplb2YodENzckJzc2lkKSk7CisgICAgaWYgKGNzclJvYW1JczExckFzc29jKHBNYWMpKQorICAgICAgIGNzclJvYW1DYWxsQ2FsbGJhY2socE1hYywgcEZUUHJlQXV0aFJzcC0+c21lU2Vzc2lvbklkLCBOVUxMLCAwLCAKKyAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfUk9BTV9GVF9SRVNQT05TRSwgZUNTUl9ST0FNX1JFU1VMVF9OT05FKTsKKworI2lmIGRlZmluZWQoRkVBVFVSRV9XTEFOX0VTRSkgJiYgZGVmaW5lZChGRUFUVVJFX1dMQU5fRVN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X1VUX1JGCit2b2lkIGNzclJvYW1Kb2luUmV0cnlUaW1lckhhbmRsZXIodm9pZCAqcHYpCit7CisgICAgdENzclRpbWVySW5mbyAqcEluZm8gPSAodENzclRpbWVySW5mbyAqKXB2OworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBwSW5mby0+cE1hYzsKKyAgICB0QU5JX1UzMiBzZXNzaW9uSWQgPSBwSW5mby0+c2Vzc2lvbklkOworICAgIHRDc3JSb2FtU2Vzc2lvbiAqcFNlc3Npb247CisgICAgCisgICAgaWYoIENTUl9JU19TRVNTSU9OX1ZBTElEKHBNYWMsIHNlc3Npb25JZCkgKQorICAgIHsKKyAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCggIiAgcmV0cnlpbmcgdGhlIGxhc3Qgcm9hbSBwcm9maWxlIG9uIHNlc3Npb24gJWQiICksIHNlc3Npb25JZCApOworICAgICAgICBwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTiggcE1hYywgc2Vzc2lvbklkICk7CisgICAgICAgIGlmKHBTZXNzaW9uLT5wQ3VyUm9hbVByb2ZpbGUgJiYgY3NySXNDb25uU3RhdGVEaXNjb25uZWN0ZWQocE1hYywgc2Vzc2lvbklkKSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYoICFIQUxfU1RBVFVTX1NVQ0NFU1MoY3NyUm9hbUpvaW5MYXN0UHJvZmlsZShwTWFjLCBzZXNzaW9uSWQpKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCAiICBmYWlsIHRvIHJldHJ5IHRoZSBsYXN0IHJvYW0gcHJvZmlsZSIgKSApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorfQorZUhhbFN0YXR1cyBjc3JSb2FtU3RhcnRKb2luUmV0cnlUaW1lcih0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UzMiBzZXNzaW9uSWQsIHRBTklfVTMyIGludGVydmF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ICghSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiY2Fubm90IGFsbG9jYXRlIG1lbW9yeSBmb3IgaFRpbWVyU3RhQXBDb25jVGltZXIgdGltZXIiKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorI2VuZGlmICAgICAgICAKKyAgICAgICAgc3RhdHVzID0gdm9zX3RpbWVyX2luaXQoJnBNYWMtPnNjYW4uaFRpbWVySWRsZVNjYW4sIFZPU19USU1FUl9UWVBFX1NXLCBjc3JTY2FuSWRsZVNjYW5UaW1lckhhbmRsZXIsIHBNYWMpOworICAgICAgICBpZiAoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoImNhbm5vdCBhbGxvY2F0ZSBtZW1vcnkgZm9yIGlkbGVTY2FuIHRpbWVyIikpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgc3RhdHVzID0gdm9zX3RpbWVyX2luaXQoJnBNYWMtPnNjYW4uaFRpbWVyUmVzdWx0Q2ZnQWdpbmcsIFZPU19USU1FUl9UWVBFX1NXLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JTY2FuUmVzdWx0Q2ZnQWdpbmdUaW1lckhhbmRsZXIsIHBNYWMpOworICAgICAgICBpZiAoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoImNhbm5vdCBhbGxvY2F0ZSBtZW1vcnkgZm9yIENGRyBSZXN1bHRBZ2luZyB0aW1lciIpKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfXdoaWxlKDApOworICAgIAorICAgIHJldHVybiAoc3RhdHVzKTsKK30KKworCitlSG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ZChwTWFjKSAmJgorICAgICAgICFjc3JJc1AycFNlc3Npb25Db25uZWN0ZWQocE1hYykpCisgICAgeworICAgICAgbk51bUNoYW5Db21iaW5lZENvbmMgPSBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLm5OdW1TdGFDaGFuQ29tYmluZWRDb25jOworICAgIH0KKyAgICBlbHNlIGlmKGNzcklzUDJwU2Vzc2lvbkNvbm5lY3RlZChwTWFjKSkKKyAgICB7CisgICAgICBuTnVtQ2hhbkNvbWJpbmVkQ29uYyA9IHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ubk51bVAyUENoYW5Db21iaW5lZENvbmM7CisgICAgfQorICAgIGlmICggKGNzcklzU3RhU2Vzc2lvbkNvbm5lY3RlZChwTWFjKSAmJiAKKyNpZmRlZiBGRUFUVVJFX1dMQU5fTEZSCisgICAgICAgICAoY3NySXNDb25jdXJyZW50SW5mcmFDb25uZWN0ZWQocE1hYykgfHwKKyAgICAgICAgICAoKHBTY2FuQ21kLT51LnNjYW5DbWQucmVhc29uICE9IGVDc3JTY2FuQmdTY2FuKSAmJgorICAgICAgICAgICAocE1hYy0+cm9hbS5uZWlnaGJvclJvYW1JbmZvLm5laWdoYm9yUm9hbVN0YXRlICE9IAorICAgICAgICAgICAgZUNTUl9ORUlHSEJPUl9ST0FNX1NUQVRFX0NGR19DSEFOX0xJU1RfU0NBTikpKSAmJgorI2VuZGlmCisgICAgICAgICAocFNjYW5DbWQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LnAycFNlYXJjaCAhPSAxKSkgfHwKKyAgICAgICAgICAgIChjc3JJc1AycFNlc3Npb25Db25uZWN0ZWQocE1hYykpICkKKyAgICB7CisgICAgICAgIHRDc3JTY2FuUmVxdWVzdCBzY2FuUmVxOworICAgICAgICB0QU5JX1U4IG51bUNobiA9IHBTY2FuQ21kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdC5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzOworICAgICAgICB0Q3NyQ2hhbm5lbEluZm8gKnBDaG5JbmZvID0gJnNjYW5SZXEuQ2hhbm5lbEluZm87CisgICAgICAgIHRBTklfVTggICAgY2hhbm5lbFRvU2NhbltXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU5dOworICAgICAgICB0QU5JX0JPT0xFQU4gYk1lbUFsbG9jID0gZUFOSV9CT09MRUFOX0ZBTFNFOworCisgICAgICAgIGlmIChudW1DaG4gPT0gMCkKKyAgICAgICAgeworCisgICAgICAgICAgICBudW1DaG4gPSBwTWFjLT5zY2FuLmJhc2VDaGFubmVscy5udW1DaGFubmVsczsKKworICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0ID0gdm9zX21lbV9tYWxsb2MobnVtQ2huKTsKKyAgICAgICAgICAgIGlmICggTlVMTCA9PSBwU2NhbkNtZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QuQ2hhbm5lbEluZm8uQ2hhbm5lbExpc3QgICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCIgRmFpbGVkIHRvIGdldCBtZW1vcnkgZm9yIGNoYW5uZWwgbGlzdCAiKSApOworICAgICAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYk1lbUFsbG9jID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocFNjYW5DbWQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnNjYW4uYmFzZUNoYW5uZWxzLmNoYW5uZWxMaXN0LCBudW1DaG4pOworICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUV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orCisgICAgICAgICAgICBwQ2huSW5mby0+bnVtT2ZDaGFubmVscyA9IHBTY2FuQ21kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdC5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzIC0gbk51bUNoYW5Db21iaW5lZENvbmM7CisKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICAgIEZMKCIgJmNoYW5uZWxUb1NjYW4gJXAgcFNjYW5DbWQoJXApIHBTY2FuQ21kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdC5DaGFubmVsSW5mby5DaGFubmVsTGlzdCglcCludW1DaG4oJWQpIiksCisgICAgICAgICAgICAgICAgICAgICZjaGFubmVsVG9TY2FuWzBdLCBwU2NhbkNtZCwKKyAgICAgICAgICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0LCBudW1DaG4pOworCisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJmNoYW5uZWxUb1NjYW5bMF0sCisgICAgICAgICAgICAgICAgICAgICAmcFNjYW5DbWQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0WworICAgICAgICAgICAgICAgICAgICAgbk51bUNoYW5Db21iaW5lZENvbmNdLAorICAgICAgICAgICAgICAgICAgICAgcENobkluZm8tPm51bU9mQ2hhbm5lbHMgKiBzaXplb2YodEFOSV9VOCkpOworCisgICAgICAgICAgICBwQ2huSW5mby0+Q2hhbm5lbExpc3QgPSAmY2hhbm5lbFRvU2NhblswXTsKKworICAgICAgICAgICAgc2NhblJlcS5CU1NUeXBlID0gZUNTUl9CU1NfVFlQRV9BTlk7CisKKyAgICAgICAgICAgIC8vVXNlIGNvbmN1cnJlbmN5IHZhbHVlcyBmb3IgbWluL21heENoblRpbWUuCisgICAgICAgICAgICAvL1dlIGtub3cgY3NySXNBbnlTZXNzaW9uQ29ubmVjdGVkKHBNYWMpIHJldHVybnMgVFJVRSBoZXJlCisgICAgICAgICAgICBjc3JTZXREZWZhdWx0U2NhblRpbWluZyhwTWFjLCBzY2FuUmVxLnNjYW5UeXBlLCAmc2NhblJlcSk7CisKKyAgICAgICAgICAgIHN0YXR1cyA9IGNzclNjYW5Db3B5UmVxdWVzdChwTWFjLCAmcFF1ZXVlU2NhbkNtZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QsICZzY2FuUmVxKTsKKworICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChiTWVtQWxsb2MpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocFNjYW5DbWQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0KTsKKyAgICAgICAgICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0ID0gTlVMTDsKKworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiggc2NhblJlcS5wSUVGaWVsZCAhPSBOVUxMKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHNjYW5SZXEucElFRmllbGQpOworICAgICAgICAgICAgICAgICAgICBzY2FuUmVxLnBJRUZpZWxkID0gTlVMTDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiIEZhaWxlZCB0byBnZXQgY29weSBjc3JTY2FuUmVxdWVzdCA9ICVkIiksIHN0YXR1cyApOworICAgICAgICAgICA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gICAgY3NyTExJbnNlcnRUYWlsKCAmcE1hYy0+c2Nhbi5zY2FuQ21kUGVuZGluZ0xpc3QsICZwUXVldWVTY2FuQ21kLT5MaW5rLCBMTF9BQ0NFU1NfTE9DSyApOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAocFNlbmRTY2FuQ21kICE9IE5VTEwpCisgICAgICAgICAgICB7ICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgcmV0dXJuIGNzclF1ZXVlU21lQ29tbWFuZChwTWFjLCBwU2VuZFNjYW5DbWQsIGVBTklfQk9PTEVBTl9GQUxTRSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBpZiAocFNlbmRTY2FuQ21kICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY3NyTExJbnNlcnRUYWlsKCAmcE1hYy0+c2Nhbi5zY2FuQ21kUGVuZGluZ0xpc3QsICZwU2VuZFNjYW5DbWQtPkxpbmssIExMX0FDQ0VTU19MT0NLICk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChwUXVldWVTY2FuQ21kICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY3NyTExJbnNlcnRUYWlsKCAmcE1hYy0+c2Nhbi5zY2FuQ21kUGVuZGluZ0xpc3QsICZwUXVldWVTY2FuQ21kLT5MaW5rLCBMTF9BQ0NFU1NfTE9DSyApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7ICAvL05vIGNvbmN1cnJlbmN5IGNhc2UKKyAgICAgICAgc21zTG9nKCBwTWFjLCBMT0cyLCBGTCgiUXVldWluZyBzY2FuIGNvbW1hbmQgKHJlYXNvbj0lZCwgcm9hbVN0YXRlPSVkIgorICAgICAgICAgICAgICAgICIgbnVtT2ZDaGFubmVscz0lZCkiKSwKKyAgICAgICAgICAgICAgICBwU2NhbkNt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ndGgsCisgICAgICAgICAgICAgICAgICAgICAgICBwU2NhblJlcXVlc3QtPlNTSURzLlNTSURMaXN0LT5TU0lELnNzSWQpOworICAgICAgICAgICAgICAgIHBTY2FuUmVxdWVzdC0+bWF4Q2huVGltZSA9IE1BWF9DSE5fVElNRV9UT19GSU5EX0dPOworICAgICAgICAgICAgICAgIHBTY2FuUmVxdWVzdC0+bWluQ2huVGltZSA9IE1JTl9DSE5fVElNRV9UT19GSU5EX0dPOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgZG8KKyAgICB7CisgICAgICAgIGlmKHBNYWMtPnNjYW4uZlNjYW5FbmFibGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBTY2FuQ21kID0gY3NyR2V0Q29tbWFuZEJ1ZmZlcihwTWFjKTsKKyAgICAgICAgICAgIGlmKHBTY2FuQ21kKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fc2V0KCZwU2NhbkNtZC0+dS5zY2FuQ21kLCBzaXplb2YodFNjYW5DbWQpLCAwKTsKKyAgICAgICAgICAgICAgICBwU2NhbkNtZC0+Y29tbWFuZCA9IGVTbWVDb21tYW5kU2NhbjsgCisgICAgICAgICAgICAgICAgcFNjYW5DbWQtPnNlc3Npb25JZCA9IHNlc3Npb25JZDsKKyAgICAgICAgICAgICAgICBwU2NhbkNtZC0+dS5zY2FuQ21kLmNhbGxiYWNrID0gY2FsbGJhY2s7CisgICAgICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC5wQ29udGV4dCA9IHBDb250ZXh0OworICAgICAgICAgICAgICAgIGlmKGVDU1JfU0NBTl9SRVFVRVNUXzExRF9TQ0FOID09IHBTY2FuUmVxdWVzdC0+cmVxdWVzdFR5cGUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwU2NhbkNtZC0+dS5zY2FuQ21kLnJlYXNvbiA9IGVDc3JTY2FuMTFkMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZigoZUNTUl9TQ0FOX1JFUVVFU1RfRlVMTF9TQ0FOID09IHBTY2FuUmVxdWVzdC0+cmVxdWVzdFR5cGUpIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAoZUNTUl9TQ0FOX1AyUF9ESVNDT1ZFUlkgPT0gcFNjYW5SZXF1ZXN0LT5yZXF1ZXN0VHlwZSkKKyNpZmRlZiBTT0ZUQVBfQ0hBTk5FTF9SQU5HRQorICAgICAgICAgICAgICAgICAgICAgICAgfHwoZUNTUl9TQ0FOX1NPRlRBUF9DSEFOTkVMX1JBTkdFID09IHBTY2FuUmVxdWVzdC0+cmVxdWVzdFR5cGUpCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC5yZWFzb24gPSBlQ3NyU2NhblVzZXJSZXF1ZXN0OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmKGVDU1JfU0NBTl9IT19CR19TQ0FOID09IHBTY2FuUmVxdWVzdC0+cmVxdWVzdFR5cGUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwU2NhbkNtZC0+dS5zY2FuQ21kLnJlYXNvbiA9IGVDc3JTY2FuQmdTY2FuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmKGVDU1JfU0NBTl9IT19QUk9CRV9TQ0FOID09IHBTY2FuUmVxdWVzdC0+cmVxdWVzdFR5cGUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwU2NhbkNtZC0+dS5zY2FuQ21kLnJlYXNvbiA9IGVDc3JTY2FuUHJvYmVCc3M7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYoZUNTUl9TQ0FOX1AyUF9GSU5EX1BFRVIgPT0gcFNjYW5SZXF1ZXN0LT5yZXF1ZXN0VHlwZSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBTY2FuQ21kLT51LnNjYW5DbWQucmVhc29uID0gZUNzclNjYW5QMlBGaW5kUGVlcjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC5yZWFzb24gPSBlQ3NyU2NhbklkbGVTY2FuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZihwU2NhblJlcXVlc3QtPm1pbkNoblRpbWUgPT0gMCAmJiBwU2NhblJlcXVlc3QtPm1heENoblRpbWUgPT0gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vVGhlIGNhbGxlciBkb2Vzbid0IHNldCB0aGUgdGltZSBjb3JyZWN0bHkuIFNldCBpdCBoZXJlCisgICAgICAgICAgICAgICAgICAgIGNzclNldERlZmF1bHRTY2FuVGltaW5nKHBNYWMsIHBTY2FuUmVxdWVzdC0+c2NhblR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NhblJlcXVlc3QpOworICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HMSwgRkwoIlNldHRpbmcgZGVmYXVsdCBtaW4gJWQgYW5kIG1heCAlZCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIENoblRpbWUiKSwgcFNjYW5SZXF1ZXN0LT5taW5DaG5UaW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjYW5SZXF1ZXN0LT5tYXhDaG5UaW1lKTsKKyAgICAgICAgICAgICAgICB9CisjaWZkZWYgV0xBTl9BUF9TVEFfQ09OQ1VSUkVOQ1kKKyAgICAgICAgICAgICAgICBpZihwU2NhblJlcXVlc3QtPnJlc3RUaW1lID09IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvL05lZWQgdG8gc2V0IHJlc3RUaW1lIG9ubHkgaWYgYXQgbGVhc3Qgb25lIHNlc3Npb24gaXMgY29ubmVjdGVkCisgICAgICAgICAgICAgICAgICAgIGlmKGNzcklzQW55U2Vzc2lvbkNvbm5lY3RlZChwTWFjKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcFNjYW5SZXF1ZXN0LT5yZXN0VGltZSA9IHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ublJlc3RUaW1lQ29uYzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyNlbmRpZgorICAgICAgICAgICAgICAgICAvKkZvciBTdGFuZGFsb25lIHdsYW4gOiBjaGFubmVsIHRpbWUgd2lsbCByZW1haW4gdGhlIHNhbWUuCisgICAgICAgICAgICAgICAgICAgRm9yIEJUQyB3aXRoIEEyRFAgdXA6IENoYW5uZWwgdGltZSA9IENoYW5uZWwgdGltZSAqIDIsIGlmIHN0YXRpb24gaXMgbm90IGFscmVhZHkgYXNzb2NpYXRlZC4KKyAgICAgICAgICAgICAgICAgICBUaGlzIGhhcyBiZWVuIGRvbmUgdG8gcHJvdmlkZSBhIGxhcmdlciBzY2FuIHdpbmRvdyBmb3IgZmFzdGVyIGNvbm5lY3Rpb24gZHVyaW5nIGJ0Yy5FbHNlIFNjYW4gaXMgc2VlbgorICAgICAgICAgICAgICAgICAgIHRvIHRha2UgYSBsb25nIHRpbWUuCisgICAgICAgICAgICAgICAgICAgRm9yIEJUQyB3aXRoIEEyRFAgdXA6IENoYW5uZWwgdGltZSB3aWxsIG5vdCBiZSBkb3VibGVkLCBpZiBzdGF0aW9uIGlzIGFscmVhZHkgYXNzb2NpYXRlZC4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JSb2FtR2V0Q29ubmVjdFN0YXRlKHBNYWMsc2Vzc2lvbklkLCZDb25uZWN0U3RhdGUpOworICAgICAgICAgICAgICAgIGlmIChIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSAmJgorICAgICAgICAgICAgICAgICAgICBwTWFjLT5idGMuZkEyRFBVcCAmJgorICAgICAgICAgICAgICAgICAgIChlQ1NSX0FTU09DX1NUQVRFX1RZUEVfSU5GUkFfQVNTT0NJQVRFRCAhPSBDb25uZWN0U3RhdGUpICYmCisgICAgICAgICAgICAgICAgICAgKGVDU1JfQVNTT0NfU1RBVEVfVFlQRV9JQlNTX0NPTk5FQ1RFRCAhPSBDb25uZWN0U3RhdGUpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcFNjYW5SZXF1ZXN0LT5tYXhDaG5UaW1lID0gcFNjYW5SZXF1ZXN0LT5tYXhDaG5UaW1lIDw8IDE7CisgICAgICAgICAgICAgICAgICAgIHBTY2FuUmVxdWVzdC0+bWluQ2huVGltZSA9IHBTY2FuUmVxdWVzdC0+bWluQ2huVGltZSA8PCAxOworICAgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPRzEsIEZMKCJCVEMgQTJEUCB1cCwgZG91YmxpbmcgbWF4IGFuZCBtaW4iCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBDaG5UaW1lIChNYXg9JWQgTWluPSVkKSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuUmVxdWVzdC0+bWF4Q2huVGltZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NhblJlcXVlc3QtPm1pbkNoblRpbWUpOworICAgICAgICAgICAgICAgIH0gIAorCisgICAgICAgICAgICAgICAgcFNjYW5SZXF1ZXN0LT5tYXhDaG5UaW1lQnRjID0gcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uQWN0aXZlTWF4Q2huVGltZUJ0YzsKKyAgICAgICAgICAgICAgICBwU2NhblJlcXVlc3QtPm1pbkNoblRpbWVCdGMgP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xdWVzdFR5cGUpCisjZW5kaWYgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgJiYgKGVBTklfQk9PTEVBTl9GQUxTRSA9PSBwTWFjLT5zY2FuLmZFbmFibGVCeXBhc3MxMWQpCisgICAgICAgICAgICAgICAgICAgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdFNtZUNtZCAqcDExZFNjYW5DbWQ7CisgICAgICAgICAgICAgICAgICAgIHRDc3JTY2FuUmVxdWVzdCBzY2FuUmVxOworICAgICAgICAgICAgICAgICAgICB0Q3NyQ2hhbm5lbEluZm8gKnBDaG5JbmZvID0gJnNjYW5SZXEuQ2hhbm5lbEluZm87CisKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9zZXQoJnNjYW5SZXEsIHNpemVvZih0Q3NyU2NhblJlcXVlc3QpLCAwKTsKKworICAgICAgICAgICAgICAgICAgICBwMTFkU2NhbkNtZCA9IGNzckdldENvbW1hbmRCdWZmZXIocE1hYyk7CisgICAgICAgICAgICAgICAgICAgIGlmIChwMTFkU2NhbkNtZCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbnVtQ2huID0gcE1hYy0+c2Nhbi5iYXNlQ2hhbm5lbHMubnVtQ2hhbm5lbHM7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fc2V0KCZwMTFkU2NhbkNtZC0+dS5zY2FuQ21kLCBzaXplb2YodFNjYW5DbWQpLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBDaG5JbmZvLT5DaGFubmVsTGlzdCA9IHZvc19tZW1fbWFsbG9jKG51bUNobik7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIE5VTEwgPT0gcENobkluZm8tPkNoYW5uZWxMaXN0ICkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBhbGxvY2F0ZSBtZW1vcnkiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwQ2huSW5mby0+Q2hhbm5lbExpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+c2Nhbi5iYXNlQ2hhbm5lbHMuY2hhbm5lbExpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtQ2huKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBDaG5JbmZvLT5udW1PZkNoYW5uZWxzID0gKHRBTklfVTgpbnVtQ2huOworCisgICAgICAgICAgICAgICAgICAgICAgICBwMTFkU2NhbkNtZC0+Y29tbWFuZCA9IGVTbWVDb21tYW5kU2NhbjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHAxMWRTY2FuQ21kLT51LnNjYW5DbWQuY2FsbGJhY2sgPSBwTWFjLT5zY2FuLmNhbGxiYWNrMTFkU2NhbkRvbmU7CisgICAgICAgICAgICAgICAgICAgICAgICBwMTFkU2NhbkNtZC0+dS5zY2FuQ21kLnBDb250ZXh0ID0gTlVMTDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHAxMWRTY2FuQ21kLT51LnNjYW5DbWQuc2NhbklEID0gcE1hYy0+c2Nhbi5uZXh0U2NhbklEOworICAgICAgICAgICAgICAgICAgICAgICAgc2NhblJlcS5CU1NUeXBlID0gZUNTUl9CU1NfVFlQRV9BTlk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICggY3NySXMxMWRTdXBwb3J0ZWQocE1hYykgKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjYW5SZXEuc2NhblR5cGUgPSBlU0lSX1BBU1NJVkVfU0NBTjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FuUmVxLnJlcXVlc3RUeXBlID0gZUNTUl9TQ0FOX1JFUVVFU1RfMTFEX1NDQU47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcDExZFNjYW5DbWQtPnUuc2NhbkNtZC5yZWFzb24gPSBlQ3NyU2NhbjExZDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NhblJlcS5tYXhDaG5UaW1lID0gcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uUGFzc2l2ZU1heENoblRpbWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NhblJlcS5taW5DaG5UaW1lID0gcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uUGFzc2l2ZU1pbkNoblRpbWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NhblJlcS5zY2FuVHlwZSA9IHBTY2FuUmVxdWVzdC0+c2NhblR5cGU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NhblJlcS5yZXF1ZXN0VHlwZSA9IGVDU1JfU0NBTl9JRExFX01PREVfU0NBTjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwMTFkU2NhbkNtZC0+dS5zY2FuQ21kLnJlYXNvbiA9IGVDc3JTY2FuSWRsZVNjYW47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NhblJlcS5tYXhDaG5UaW1lID0gcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uQWN0aXZlTWF4Q2huVGltZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FuUmVxLm1pbkNoblRpbWUgPSBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLm5BY3RpdmVNaW5DaG5UaW1lOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NhblJlcS5tYXhDaG5UaW1lQnRjID0gcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uQWN0aXZlTWF4Q2huVGltZUJ0YzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FuUmVxLm1pbkNoblRpbWVCdGMgPSBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLm5BY3RpdmVNaW5DaG5UaW1lQnRjOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ubkluaXRpYWxEd2VsbFRpbWUpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NhblJlcS5tYXhDaG5UaW1lID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLm5Jbml0aWFsRHdlbGxUaW1lOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCBGTCgiMTFkIHNjYW4sIHVwZGF0aW5nIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZHdlbGwgdGltZSBmb3IgZmlyc3Qgc2NhbiAldSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NhblJlcS5tYXhDaG5UaW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyU2NhbkNvcHlSZXF1ZXN0KHBNYWMsICZwMTFkU2NhbkNtZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QsICZzY2FuUmVxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vRnJlZSB0aGUgY2hhbm5lbCBsaXN0CisgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocENobkluZm8tPkNoYW5uZWxMaXN0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBDaG5JbmZvLT5DaGFubmVsTGlzdCA9IE5VTEw7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+c2Nhbi5zY2FuUHJvZmlsZS5udW1PZkNoYW5uZWxzID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwMTFkU2NhbkNtZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QuQ2hhbm5lbEluZm8ubnVtT2ZDaGFubmVsczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1N0YXJ0IHByb2Nlc3MgdGhlIGNvbW1hbmQKKyNpZmRlZiBXTEFOX0FQX1NUQV9DT05DVVJSRU5DWQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghcE1hYy0+ZlNjYW5PZmZsb2FkKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JRdWV1ZVNjYW5SZXF1ZXN0KHBNYWMsIHAxMWRTY2FuQ21kKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclF1ZXVlU21lQ29tbWFuZChwTWFjLCBwMTFkU2NhbkNtZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVBTklfQk9PTEVBTl9GQUxTRSk7CisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclF1ZXVlU21lQ29tbWFuZChwTWFjLCBwMTFkU2NhbkNtZCwgZUFOSV9CT09MRUFOX0ZBTFNFKTsKKyNlbmRpZiAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiggIUhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gc2VuZCBtZXNzYWdlIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgc3RhdHVzID0gJWQiKSwgc3RhdHVzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSAKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoImNzclNjYW5Db3B5UmVxdWVzdCBmYWlsZWQiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvL2Vycm9yCisgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCJwMTFkU2NhbkNtZCBmYWlsZWQiKSApOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvL1NjYW4gb25seSAyRyBDaGFubmVscyBpZiBzZXQgaW4gaW5pIGZpbGUKKyAgICAgICAgICAgICAgICAvL1RoaXMgaXMgbWFpbmx5IHRvIHJlZHVjZSB0aGUgRmlyc3QgU2NhbiBkdXJhdGlvbgorICAgICAgICAgICAgICAgIC8vT25jZSB3ZSB0dXJuIG9uIFdpZmkKKyAgICAgICAgICAgICAgICBpZihwTWFjLT5zY2FuLmZGaXJzdFNjYW5Pbmx5MkdDaG5sKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0cxLCBGTCgiU2Nhbm5pbmcgb25seSAyRyBDaGFubmVscyBkdXJpbmcgZmlyc3Qgc2NhbiIpKTsKKyAgICAgICAgICAgICAgICAgICAgY3NyU2NhbjJHT255UmVxdWVzdChwTWFjLCBwU2NhbkNtZCwgcFNjYW5SZXF1ZXN0KTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAocE1hYy0+cm9hbS5jb25maWdQYXJhbS5uSW5pdGlhbER3ZWxsVGltZSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBTY2FuUmVxdWVzdC0+bWF4Q2huVGltZSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uSW5pdGlhbER3ZWxsVGltZTsKKyAgICAgICAgICAgICAgICAgICAgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uSW5pdGlhbER3ZWxsVGltZSA9IDA7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoInVwZGF0aW5nIGR3ZWxsIHRpbWUgZm9yIGZpcnN0IHNjYW4gJXUiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuUmVxdWVzdC0+bWF4Q2huVGltZSk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyU2NhbkNvcHlSZXF1ZXN0KHBNYWMsICZwU2NhbkNtZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QsIHBTY2FuUmVxdWVzdCk7CisgICAgICAgICAgICAgICAgaWYoSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB0Q3NyU2NhblJlcXVlc3QgKnBUZW1wU2NhblJlcSA9CisgICAgICAgICAgICAgICAgICAgICAmcFNjYW5DbWQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0OworICAgICAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLnNjYW5Qcm9maWxlLm51bU9mQ2hhbm5lbHMgPQorICAgICAgICAgICAgICAgICAgICAgcFRlbXBTY2FuUmVxLT5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzOworCisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HMSwgRkwoIiBTSWQ9JWQgc2NhbklkPSVkIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIFNjYW4gcmVhc29uPSV1IG51bVNTSURzPSVkIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIG51bUNoYW49JWQgUDJQIHNlYXJjaD0lZCBtaW5DVD0lZCBtYXhDVD0lZCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBtaW5DQnRjPSVkIG1heENCdHg9JWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkLCBwU2NhbkNtZC0+dS5zY2FuQ21kLnNjYW5JRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC5yZWFzb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wU2NhblJlcS0+U1NJRHMubnVtT2ZTU0lEcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRlbXBTY2FuUmVxLT5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVGVtcFNjYW5SZXEtPnAycFNlYXJjaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRlbXBTY2FuUmVxLT5taW5DaG5UaW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVGVtcFNjYW5SZXEtPm1heENoblRpbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wU2NhblJlcS0+bWluQ2huVGltZUJ0YywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRlbXBTY2FuUmVxLT5tYXhDaG5UaW1lQnRjICk7CisgICAgICAgICAgICAgICAgICAgIC8vU3RhcnQgcHJvY2VzcyB0aGUgY29tbWFuZAorI2lmZGVmIFdMQU5fQVBfU1RBX0NPTkNVUlJFTkNZCisgICAgICAgICAgICAgICAgICAgIGlmICghcE1hYy0+ZlNjYW5PZmZsb2FkKQorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyUXVldWVTY2FuUmVxdWVzdChwTWFjLHBTY2FuQ21kKTsKKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyUXVldWVTbWVDb21tYW5kKHBNYWMsIHBTY2FuQ21kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVBTklfQk9PTEVBTl9GQUxTRSk7CisjZWxzZQorICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JRdWV1ZVNtZUNvbW1hbmQocE1hYywgcFNjYW5DbWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUFOSV9CT09MRUFOX0ZBTFNFKTsKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICBpZiggIUhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCIgZmFpbCB0byBzZW5kIG1lc3NhZ2Ugc3RhdHVzID0gJWQiKSwgc3RhdHVzICk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiIGZhaWwgdG8gY29weSByZXF1ZXN0IHN0YXR1cyA9ICVkIiksIHN0YXR1cyApOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgRkwoIiBwU2NhbkNtZCBpcyBOVUxMIikpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiU0lkOiAlZCBTY2FubmluZyBub3QgZW5hYmxlZCIKKyAgICAgICAgICAgICAgICAgICAgICIgU2NhbiB0eXBlPSV1LCBudW1PZlNTSURzPSVkIFAyUCBzZWFyY2g9JWQiKSwKKyAgICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCwgcFNjYW5SZXF1ZXN0LT5yZXF1ZXN0VHlwZSwKKyAgICAgICAgICAgICAgICAgICAgIHBTY2FuUmVxdWVzdC0+U1NJRHMubnVtT2ZTU0lEcywKKyAgICAgICAgICAgICAgICAgICAgIHBTY2FuUmVxdWVzdC0+cDJwU2VhcmNoICk7CisgICAgICAgIH0KKyAgICB9IHdoaWxlKDApOworCisKKyAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykgJiYgcFNjYW5DbWQpCisgICAgeworICAgICAgICBpZiggZUNzclNjYW5JZGxlU2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KKyAgICAgICAgaWYocFNjYW5DbWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBTY2FuQ21kLT5jb21tYW5kID0gZVNtZUNvbW1hbmRTY2FuOworICAgICAgICAgICAgdm9zX21lbV9zZXQoJnBTY2FuQ21kLT51LnNjYW5DbWQsIHNpemVvZih0U2NhbkNtZCksIDApOworICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC5jYWxsYmFjayA9IE5VTEw7CisgICAgICAgICAgICBwU2NhbkNtZC0+dS5zY2FuQ21kLnBDb250ZXh0ID0gTlVMTDsKKyAgICAgICAgICAgIHBTY2FuQ21kLT51LnNjYW5DbWQucmVhc29uID0gZUNzclNjYW5HZXRSZXN1bHQ7CisgICAgICAgICAgICAvL05lZWQgdG8gbWFrZSB0aGUgZm9sbG93aW5nIGF0b21pYworICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC5zY2FuSUQgPSBwTWFjLT5zY2FuLm5leHRTY2FuSUQ7IC8vbGV0IGl0IHdyYXAgYXJvdW5kCisgICAgICAgICAgICBzdGF0dXMgPSBjc3JRdWV1ZVNtZUNvbW1hbmQocE1hYywgcFNjYW5DbWQsIGVBTklfQk9PTEVBTl9GQUxTRSk7CisgICAgICAgICAgICBpZiggIUhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgRkwoIiBmYWlsIHRvIHNlbmQgbWVzc2FnZSBzdGF0dXMgPSAlZCIpLCBzdGF0dXMgKTsKKyAgICAgICAgICAgICAgICBjc3JSZWxlYXNlQ29tbWFuZFNjYW4ocE1hYywgcFNjYW5DbWQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UgCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vbG9nIGVycm9yCisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoImNhbiBub3Qgb2J0YWluIGEgY29tbW9uIGJ1ZmZlciIpKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1JFU09VUkNFUzsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICByZXR1cm4gKHN0YXR1cyk7Cit9CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfUk9BTV9TQ0FOX09GRkxPQUQKK2VIYWxTdGF0dXMgY3NyU2NhblJlcXVlc3RMZnJSZXN1bHQodHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMzIgc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JTY2FuQ29tcGxldGVDYWxsYmFjayBjYWxsYmFjaywgdm9pZCAqcENvbnRleHQpCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIHRTbWVDbWQgKnBTY2FuQ21kOworCisgICAgaWYgKHBNYWMtPnNjYW4uZlNjYW5FbmFibGUpCisgICAgeworICAgICAgICBwU2NhbkNtZCA9IGNzckdldENvbW1hbmRCdWZmZXIocE1hYyk7CisgICAgICAgIGlmIChwU2NhbkNtZCkKKyAgICAgICAgeworICAgICAgICAgICAgcFNjYW5DbWQtPmNvbW1hbmQgPSBlU21lQ29tbWFuZFNjYW47CisgICAgICAgICAgICBwU2NhbkNtZC0+c2Vzc2lvbklkID0gc2Vzc2lvbklkOworICAgICAgICAgICAgdm9zX21lbV9zZXQoJnBTY2FuQ21kLT51LnNjYW5DbWQsIHNpemVvZih0U2NhbkNtZCksIDApOworICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC5jYWxsYmFjayA9IGNhbGxiYWNrOworICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC5wQ29udGV4dCA9IHBDb250ZXh0OworICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC5yZWFzb24gPSBlQ3NyU2NhbkdldExmclJlc3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YWwgcE1hYywgdEFOSV9VMzIgc2Vzc2lvbklkLCBlQ3NyUm9hbVJlYXNvbiByZWFzb24pCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIHRTY2FuUmVzdWx0SGFuZGxlIGhCU1NMaXN0ID0gTlVMTDsKKyAgICB0Q3NyU2NhblJlc3VsdEZpbHRlciAqcFNjYW5GaWx0ZXIgPSBOVUxMOworICAgIHRBTklfVTMyIHJvYW1JZCA9IDA7CisgICAgdENzclJvYW1Qcm9maWxlICpwUHJvZmlsZSA9IE5VTEw7CisgICAgdENzclJvYW1TZXNzaW9uICpwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTiggcE1hYywgc2Vzc2lvbklkICk7CisKKyAgICBpZighcFNlc3Npb24pCisgICAgeworICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiAgc2Vzc2lvbiAlZCBub3QgZm91bmQgIiksIHNlc3Npb25JZCk7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIH0KKworICAgIGRvCisgICAgeworICAgICAgICBzbXNMb2cocE1hYywgTE9HMSwgIiBjc3JJc3N1ZVJvYW1BZnRlckxvc3RsaW5rU2NhbiBjYWxsZWQiKTsKKyAgICAgICAgaWYocFNlc3Npb24tPmZDYW5jZWxSb2FtaW5nKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywgIiBsb3N0bGluayByb2FtaW5nIGlzIGNhbmNlbGxlZCIpOworICAgICAgICAgICAgY3NyU2NhblN0YXJ0SWRsZVNjYW4ocE1hYyk7CisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgLy9IZXJlIGlzIHRoZSBwcm9maWxlIHdlIG5lZWQgdG8gY29ubmVjdCB0bworICAgICAgICBwU2NhbkZpbHRlciA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0Q3NyU2NhblJlc3VsdEZpbHRlcikpOworICAgICAgICBpZiAoIE5VTEwgPT0gcFNjYW5GaWx0ZXIpCisgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgIGlmICghSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgdm9zX21lbV9zZXQocFNjYW5GaWx0ZXIsIHNpemVvZih0Q3NyU2NhblJlc3VsdEZpbHRlciksIDApOworICAgICAgICBpZihOVUxMID09IHBTZXNzaW9uLT5wQ3VyUm9hbVByb2ZpbGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBTY2FuRmlsdGVyLT5FbmNyeXB0aW9uVHlwZS5udW1FbnRyaWVzID0gMTsKKyAgICAgICAgICAgIHBTY2FuRmlsdGVyLT5FbmNyeXB0aW9uVHlwZS5lbmNyeXB0aW9uVHlwZVswXSA9IGVDU1JfRU5DUllQVF9UWVBFX05PTkU7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvL1dlIGhhdmUgdG8gbWFrZSBhIGNvcHkgb2YgcEN1clJvYW1Qcm9maWxlIGJlY2F1c2UgaXQgd2lsbCBiZSBmcmVlIGluc2lkZSBjc3JSb2FtSXNzdWVDb25uZWN0CisgICAgICAgICAgICBwUHJvZmlsZSA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0Q3NyUm9hbVByb2ZpbGUpKTsKKyAgICAgICAgICAgIGlmICggTlVMTCA9PSBwUHJvZmlsZSApCisgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgaWYgKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgdm9zX21lbV9zZXQocFByb2ZpbGUsIHNpemVvZih0Q3NyUm9hbVByb2ZpbGUpLCAwKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1Db3B5UHJvZmlsZShwTWFjLCBwUHJvZmlsZSwgcFNlc3Npb24tPnBDdXJSb2FtUHJvZmlsZSk7CisgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBzdGF0dXMgPSBjc3JSb2FtUHJlcGFyZUZpbHRlckZyb21Qcm9maWxlKHBNYWMsIHBQcm9maWxlLCBwU2NhbkZpbHRlcik7CisgICAgICAgIH0vL1dlIGhhdmUgYSBwcm9maWxlCisgICAgICAgIHJvYW1JZCA9IEdFVF9ORVhUX1JPQU1fSUQoJnBNYWMtPnJvYW0pOworICAgICAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzID0gY3NyU2NhbkdldFJlc3VsdChwTWFjLCBwU2NhbkZpbHRlciwgJmhCU1NMaXN0KTsKKyAgICAgICAgICAgIGlmKEhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKGVDc3JMb3N0TGluazEgPT0gcmVhc29uKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy93ZSB3YW50IHRvIHB1dCB0aGUgbGFzdCBjb25uZWN0ZWQgQlNTIHRvIHRoZSB2ZXJ5IGJlZ2lubmluZywgaWYgcG9zc2libGUKKyAgICAgICAgICAgICAgICAgICAgY3NyTW92ZUJzc1RvSGVhZEZyb21CU1NJRChwTWFjLCAmcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUuYnNzaWQsIGhCU1NMaXN0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbUlzc3VlQ29ubmVjdChwTWFjLCBzZXNzaW9uSWQsIHBQcm9maWxlLCBoQlNTTGlzdCwgcmVhc29uLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvYW1JZCwgZUFOSV9CT09MRUFOX1RSVUUsIGVBTklfQk9PTEVBTl9UUlVFKTsKKyAgICAgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBjc3JTY2FuUmVzdWx0UHVyZ2UocE1hYywgaEJTU0xpc3QpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0vL0hhdmUgc2NhbiByZXN1bHQKKyAgICAgICAgfQorICAgIH13aGlsZSgwKTsKKyAgICBpZihwU2NhbkZpbHRlcikKKyAgICB7CisgICAgICAgIC8vd2UgbmVlZCB0byBmcmVlIG1lbW9yeSBmb3IgZmlsdGVyIGlmIHByb2ZpbGUgZXhpc3RzCisgICAgICAgIGNzckZyZWVTY2FuRmlsdGVyKHBNYWMsIHBTY2FuRmlsdGVyKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBTY2FuRmlsdGVyKTsKKyAgICB9CisgICAgaWYoTlVMTCAhPSBwUHJvZmlsZSkKKyAgICB7CisgICAgICAgIGNzclJlbGVhc2VQcm9maWxlKHBNYWMsIHBQcm9maWxlKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBQcm9maWxlKTsKKyAgICB9CisKKyAgICByZXR1cm4gKHN0YXR1cyk7Cit9CisKKworZUhhbFN0YXR1cyBjc3JTY2FuR2V0U2NhbkNobkluZm8odHBBbmlTaXJHbG9iYWwgcE1hYywgdFNtZUNtZCAqcENvbW1hbmQpCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIHRTbWVDbWQgKnBTY2FuQ21kOworICAgIAorICAgIGlmKHBNYWMtPnNjYW4uZlNjYW5FbmFibGUpCisgICAgeworICAgICAgICBwU2NhbkNtZCA9IGNzckdldENvbW1hbmRCdWZmZXIocE1hYyk7CisgICAgICAgIGlmKHBTY2FuQ21kKQorICAgICAgICB7CisgICAgICAgICAgICBwU2NhbkNtZC0+Y29tbWFuZCA9IGVTbWVDb21tYW5kU2NhbjsKKyAgICAgICAgICAgIHZvc19tZW1fc2V0KCZwU2NhbkNtZC0+dS5zY2FuQ21kLCBzaXplb2YodFNjYW5DbWQpLCAwKTsKKyAgICAgICAgICAgIHBTY2FuQ21kLT51LnNjYW5DbWQucmVhc29uID0gZUNzclNjYW5HZXRTY2FuQ2huSW5mbzsKKyAgICAgICAgICAgIC8vTmVlZCB0byBtYWtlIHRoZSBmb2xsb3dpbmcgYXRvbWljCisgICAgICAgICAgICBwU2NhbkNtZC0+dS5zY2FuQ21kLnNjYW5JRCA9IHBNYWMtPnNjYW4ubmV4dFNjYW5JRCsrOyAvL2xldCBpdCB3cmFwIGFyb3VuZAorICAgICAgICAgICAgcFNjYW5DbWQtPnNlc3Npb25JZCA9IHBDb21tYW5kLT5zZXNzaW9uSWQ7CisgICAgICAgICAgICBpZiggcENvbW1hbmQtPnUuc2NhbkNtZC5yZWFzb24gPT0gZUNzclNjYW5Vc2VyUmVxdWVzdCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC5jYWxsYmFjayA9IE5VTEw7CisgICAgICAgICAgICAgICAgIHBTY2FuQ21kLT51LnNjYW5DbWQucENvbnRleHQgPSBOVUxMOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC5jYWxsYmFjayA9IHBDb21tYW5kLT51LnNjYW5DbWQuY2FsbGJhY2s7CisgICAgICAgICAgICAgICAgIHBTY2FuQ21kLT51LnNjYW5DbWQucENvbnRleHQgPSBwQ29tbWFuZC0+dS5zY2FuQ21kLnBDb250ZXh0OworICAgICAgICAgICAgICAgICBwU2NhbkNtZC0+dS5zY2FuQ21kLmFib3J0U2NhbkluZGljYXRpb24gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUuc2NhbkNtZC5hYm9ydFNjYW5JbmRpY2F0aW9uOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc3RhdHVzID0gY3NyUXVldWVTbWVDb21tYW5kKHBNYWMsIHBTY2FuQ21kLCBlQU5JX0JPT0xFQU5fRkFMU0UpOworICAgICAgICAgICAgaWYoICFIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCIgZmFpbCB0byBzZW5kIG1lc3NhZ2Ugc3RhdHVzID0gJWQiKSwgc3RhdHVzICk7CisgICAgICAgICAgICAgICAgY3NyUmVsZWFzZUNvbW1hbmRTY2FuKHBNYWMsIHBTY2FuQ21kKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlIAorICAgICAgICB7CisgICAgICAgICAgICAvL2xvZyBlcnJvcgorICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJjYW4gbm90IG9idGFpbiBhIGNvbW1vbiBidWZmZXIiKSk7CisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19SRVNPVVJDRVM7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcmV0dXJuIChzdGF0dXMpOworfQorCisKK2VIYWxTdGF0dXMgY3NyU2NhbkhhbmRsZUZhaWxlZExvc3RsaW5rMSh0cEFuaVNpckdsb2Jhb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gICAgICBlbHNlIGlmKCFwU2Vzc2lvbi0+cEN1clJvYW1Qcm9maWxlLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdCB8fCAKKyAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+cEN1clJvYW1Qcm9maWxlLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdFswXSA9PSAwKQorICAgICAgICB7CisgICAgICAgICAgICAvL2dvIHN0cmFpZ2h0IHRvIGxvc3RsaW5rIHNjYW4zCisgICAgICAgICAgICBzdGF0dXMgPSBjc3JTY2FuUmVxdWVzdExvc3RMaW5rMyhwTWFjLCBzZXNzaW9uSWQpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLy93ZSBhcmUgZG9uZSB3aXRoIGxvc3RsaW5rCisgICAgICAgICAgICBpZihjc3JSb2FtQ29tcGxldGVSb2FtaW5nKHBNYWMsIHNlc3Npb25JZCwgZUFOSV9CT09MRUFOX0ZBTFNFLCBlQ1NSX1JPQU1fUkVTVUxUX0ZBSUxVUkUpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNzclNjYW5TdGFydElkbGVTY2FuKHBNYWMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBzdGF0dXMgPSBjc3JTY2FuUmVxdWVzdExvc3RMaW5rMyhwTWFjLCBzZXNzaW9uSWQpOworICAgIH0KKworICAgIHJldHVybiAoc3RhdHVzKTsgICAgCit9CisKKworCitlSGFsU3RhdHVzIGNzclNjYW5IYW5kbGVGYWlsZWRMb3N0bGluazIodHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMzIgc2Vzc2lvbklkKQoreworICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICB0Q3NyUm9hbVNlc3Np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PSB7MHhmZiwgMHhmZiwgMHhmZiwgMHhmZiwgMHhmZiwgMHhmZn07CisgICAgdENzclNjYW5SZXN1bHRGaWx0ZXIgKnBTY2FuRmlsdGVyID0gTlVMTDsKKyAgICB0U2NhblJlc3VsdEhhbmRsZSBoQlNTTGlzdCA9IE5VTEw7CisgICAgdENzclNjYW5SZXN1bHRJbmZvICpwU2NhblJlc3VsdCA9IE5VTEw7CisgICAgdENzclJvYW1TZXNzaW9uICpwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTiggcE1hYywgc2Vzc2lvbklkICk7CisKKyAgICBpZighcFNlc3Npb24pCisgICAgeworICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiAgc2Vzc2lvbiAlZCBub3QgZm91bmQgIiksIHNlc3Npb25JZCk7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIH0KKworICAgIHNtc0xvZyhwTWFjLCBMT0dXLCBGTCgiIGNhbGxlZCIpKTsKKyAgICBkbworICAgIHsKKyAgICAgICAgcENvbW1hbmQgPSBjc3JHZXRDb21tYW5kQnVmZmVyKHBNYWMpOworICAgICAgICBpZighcENvbW1hbmQpCisgICAgICAgIHsKKyAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1JFU09VUkNFUzsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIHZvc19tZW1fc2V0KCZwQ29tbWFuZC0+dS5zY2FuQ21kLCBzaXplb2YodFNjYW5DbWQpLCAwKTsKKyAgICAgICAgcENvbW1hbmQtPmNvbW1hbmQgPSBlU21lQ29tbWFuZFNjYW47CisgICAgICAgIHBDb21tYW5kLT5zZXNzaW9uSWQgPSAodEFOSV9VOClzZXNzaW9uSWQ7CisgICAgICAgIHBDb21tYW5kLT51LnNjYW5DbWQucmVhc29uID0gZUNzclNjYW5Mb3N0TGluazE7CisgICAgICAgIHBDb21tYW5kLT51LnNjYW5DbWQuY2FsbGJh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AgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcENvbW1hbmQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LlNTSURzLm51bU9mU1NJRHMgPSAxOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwQ29tbWFuZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QuU1NJRHMuU1NJRExpc3RbMF0uU1NJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAmcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUuU1NJRCwgc2l6ZW9mKHRTaXJNYWNTU2lkKSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBwQ29tbWFuZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QuU1NJRHMubnVtT2ZTU0lEcyA9IDA7CisgICAgICAgIH0KKyAgICAgICAgaWYocFNlc3Npb24tPnBDdXJSb2FtUHJvZmlsZSkKKyAgICAgICAgeworICAgICAgICAgICAgcFNjYW5GaWx0ZXIgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodENzclNjYW5SZXN1bHRGaWx0ZXIpKTsKKyAgICAgICAgICAgIGlmICggTlVMTCA9PSBwU2NhbkZpbHRlciApCisgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdm9zX21lbV9zZXQocFNjYW5GaWx0ZXIsIHNpemVvZih0Q3NyU2NhblJlc3VsdEZpbHRlciksIDApOworICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbVByZXBhcmVGaWx0ZXJGcm9tUHJvZmlsZShwTWFjLCBwU2Vzc2lvbi0+cEN1clJvYW1Qcm9maWxlLCBwU2NhbkZpbHRlcik7CisgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvL0Rvbid0IGNoYW5nZSB2YXJpYWJsZSBzdGF0dXMgaGVyZSBiZWNhdXNlIHdoZXRoZXIgd2UgY2FuIGdldCByZXN1bHQgb3Igbm90LCB0aGUgY29tbWFuZCBnb2VzIHRvIFBFLgorICAgICAgICAgICAgLy9UaGUgc3RhdHVzIGlzIGFsc28gdXNlZCB0byBpbmRpY2F0ZSB3aGV0aGVyIHRoZSBjb21tYW5kIGlzIHF1ZXVlZC4gTm90IHN1Y2Nlc3MgbWVhbmluZyBub3QgcXVldWUKKyAgICAgICAgICAgIGlmKEhBTF9TVEFUVVNfU1VDQ0VTUygoY3NyU2NhbkdldFJlc3VsdChwTWFjLCBwU2NhbkZpbHRlciwgJmhCU1NMaXN0KSkpICYmIGhCU1NMaXN0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHRBTklfVTggaSwgbkNobiA9IDA7CisgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX21hbGxvYyhXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU4pOworICAgICAgICAgICAgICAgIGlmICggTlVMTCA9PSBwQ29tbWFuZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QuQ2hhbm5lbEluZm8uQ2hhbm5lbExpc3QgKQorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB3aGlsZSgoKHBTY2FuUmVzdWx0ID0gY3NyU2NhblJlc3VsdEdldE5leHQocE1hYywgaEJTU0xpc3QpKSAhPSBOVUxMKSAmJgorICAgICAgICAgICAgICAgICAgICBuQ2huIDwgV05JX0NGR19WQUxJRF9DSEFOTkVMX0xJU1RfTEVOKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgZm9yKGkgPSAwOyBpIDwgbkNobjsgaSsrKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihwQ29tbWFuZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QuQ2hhbm5lbEluZm8uQ2hhbm5lbExpc3RbaV0gPT0gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjYW5SZXN1bHQtPkJzc0Rlc2NyaXB0b3IuY2hhbm5lbElkKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmKGkgPT0gbkNobikKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0W25DaG4rK10gPSBwU2NhblJlc3VsdC0+QnNzRGVzY3JpcHRvci5jaGFubmVsSWQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLy9JbmNsdWRlIHRoZSBsYXN0IGNvbm5lY3RlZCBCU1MnIGNoYW5uZWwKKyAgICAgICAgICAgICAgICBpZihjc3JSb2FtSXNDaGFubmVsVmFsaWQocE1hYywgcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUub3BlcmF0aW9uQ2hhbm5lbCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBmb3IoaSA9IDA7IGkgPCBuQ2huOyBpKyspCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBDb21tYW5kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdC5DaGFubmVsSW5mby5DaGFubmVsTGlzdFtpXSA9PSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS5vcGVyYXRpb25DaGFubmVsKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmKGkgPT0gbkNobikKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0W25DaG4rK10gPSBwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS5vcGVyYXRpb25DaGFubmVsOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdC5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzID0gbkNobjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZihjc3JSb2FtSXNDaGFubmVsVmFsaWQocE1hYywgcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUub3BlcmF0aW9uQ2hhbm5lbCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwQ29tbWFuZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QuQ2hhbm5lbEluZm8uQ2hhbm5lbExpc3QgPSB2b3NfbWVtX21hbGxvYygxKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCBOVUxMID09IHBDb21tYW5kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdC5DaGFubmVsSW5mby5DaGFubmVsTGlzdCApCisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgICAgICAgICAvL2p1c3QgdHJ5IHRoZSBsYXN0IGNvbm5lY3RlZCBjaGFubmVsCisgICAgICAgICAgICAgICAgICAgIGlmKEhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwQ29tbWFuZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QuQ2hhbm5lbEluZm8uQ2hhbm5lbExpc3RbMF0gPSBwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS5vcGVyYXRpb25DaGFubmVsOworICAgICAgICAgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHMgPSAxOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHZvc19tZW1fY29weSgmcENvbW1hbmQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LmJzc2lkLCBiQWRkciwgc2l6ZW9mKHRDc3JCc3NpZCkpOworICAgICAgICBzdGF0dXMgPSBjc3JRdWV1ZVNtZUNvbW1hbmQocE1hYywgcENvbW1hbmQsIGVBTklfQk9PTEVBTl9GQUxTRSk7CisgICAgICAgIGlmKCAhSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgRkwoIiBmYWlsIHRvIHNlbmQgbWVzc2FnZSBzdGF0dXMgPSAlZCIpLCBzdGF0dXMgKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfSB3aGlsZSggMCApOworCisgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR1csICIgY3NyU2NhblJlcXVlc3RMb3N0TGluazEgZmFpbGVkIHdpdGggc3RhdHVzICVkIiwgc3RhdHVzKTsKKyAgICAgICAgaWYocENvbW1hbmQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGNzclJlbGVhc2VDb21tYW5kU2NhbihwTWFjLCBwQ29tbWFuZCk7CisgICAgICAgIH0KKyAgICAg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ICAgdFNtZUNtZCAqcENvbW1hbmQgPSBOVUxMOworICAgIHRDc3JSb2FtU2Vzc2lvbiAqcFNlc3Npb24gPSBDU1JfR0VUX1NFU1NJT04oIHBNYWMsIHNlc3Npb25JZCApOworCisgICAgaWYoIXBTZXNzaW9uKQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgIHNlc3Npb24gJWQgbm90IGZvdW5kICIpLCBzZXNzaW9uSWQpOworICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICB9CisKKyAgICBzbXNMb2cocE1hYywgTE9HVywgRkwoIiBjYWxsZWQiKSk7CisgICAgZG8KKyAgICB7CisgICAgICAgIHBDb21tYW5kID0gY3NyR2V0Q29tbWFuZEJ1ZmZlcihwTWFjKTsKKyAgICAgICAgaWYoIXBDb21tYW5kKQorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19SRVNPVVJDRVM7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICB2b3NfbWVtX3NldCgmcENvbW1hbmQtPnUuc2NhbkNtZCwgc2l6ZW9mKHRTY2FuQ21kKSwgMCk7CisgICAgICAgIHBDb21tYW5kLT5jb21tYW5kID0gZVNtZUNvbW1hbmRTY2FuOworICAgICAgICBwQ29tbWFuZC0+c2Vzc2lvbklkID0gKHRBTklfVTgpc2Vzc2lvbklkOworICAgICAgICBwQ29tbWFuZC0+dS5zY2FuQ21kLnJlYXNvbiA9IGVDc3JTY2FuTG9zdExpbmsyOworICAgICAgICBwQ29tbWFuZC0+dS5zY2FuQ21kLmNhbGxiYWNrID0gTlVMTDsKKyAgICAgICAgcENvbW1hbmQtPnUuc2NhbkNtZC5wQ29udGV4dCA9IE5VTEw7CisgICAgICAgIHBDb21tYW5kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdC5tYXhDaG5UaW1lID0gcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uQ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pLCAwKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1QcmVwYXJlRmlsdGVyRnJvbVByb2ZpbGUocE1hYywgcFNlc3Npb24tPnBDdXJSb2FtUHJvZmlsZSwgcFNjYW5GaWx0ZXIpOworICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc3RhdHVzID0gY3NyU2NhbkdldFJlc3VsdChwTWFjLCBwU2NhbkZpbHRlciwgJmhCU1NMaXN0KTsKKyAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmKGhCU1NMaXN0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHRBTklfVTggaSwgbkNobiA9IDA7CisgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9tYWxsb2MoV05JX0NGR19WQUxJRF9DSEFOTkVMX0xJU1RfTEVOKTsKKyAgICAgICAgICAgICAgICBpZiAoIE5VTEwgPT0gcENvbW1hbmQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0ICkKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgICAgICBpZiAoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHdoaWxlKCgocFNjYW5SZXN1bHQgPSBjc3JTY2FuUmVzdWx0R2V0TmV4dChwTWFjLCBoQlNTTGlzdCkpICE9IE5VTEwpICYmCisgICAgICAgICAgICAgICAgICAgIG5DaG4gPCBXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU4pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBmb3IoaSA9IDA7IGkgPCBuQ2huOyBpKyspCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBDb21tYW5kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdC5DaGFubmVsSW5mby5DaGFubmVsTGlzdFtpXSA9PSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NhblJlc3VsdC0+QnNzRGVzY3JpcHRvci5jaGFubmVsSWQpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYoaSA9PSBuQ2huKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwQ29tbWFuZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QuQ2hhbm5lbEluZm8uQ2hhbm5lbExpc3RbbkNobisrXSA9IHBTY2FuUmVzdWx0LT5Cc3NEZXNjcmlwdG9yLmNoYW5uZWxJZDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwQ29tbWFuZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QuQ2hhbm5lbEluZm8ubnVtT2ZDaGFubmVscyA9IG5DaG47CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgdm9zX21lbV9jb3B5KCZwQ29tbWFuZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QuYnNzaWQsIGJBZGRyLCBzaXplb2YodENzckJzc2lkKSk7CisgICAgICAgIC8vUHV0IHRvIHRoZSBoZWFkIGluIHBlbmRpbmcgcXVldWUKKyAgICAgICAgc3RhdHVzID0gY3NyUXVldWVTbWVDb21tYW5kKHBNYWMsIHBDb21tYW5kLCBlQU5JX0JPT0xFQU5fVFJVRSk7CisgICAgICAgIGlmKCAhSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgRkwoIiBmYWlsIHRvIHNlbmQgbWVzc2FnZSBzdGF0dXMgPSAlZCIpLCBzdGF0dXMgKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfSB3aGlsZSggMCApOworCisgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR1csICIgY3NyU2NhblJlcXVlc3RMb3N0TGluazIgZmFpbGVkIHdpdGggc3RhdHVzICVkIiwgc3RhdHVzKTsKKyAgICAgICAgaWYocENvbW1hbmQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGNzclJlbGVhc2VDb21tYW5kU2NhbihwTWFjLCBwQ29tbWFuZCk7CisgICAgICAgIH0KKyAgICAgICAgc3RhdHVzID0gY3NyU2NhbkhhbmRsZUZhaWxlZExvc3RsaW5rMiggcE1hYywgc2Vzc2lvbklkICk7CisgICAgfQorICAgIGlmKHBTY2FuRmlsdGVyKQorICAgIHsKKyAgICAgICAgY3NyRnJlZVNjYW5GaWx0ZXIocE1hYywgcFNjYW5GaWx0ZXIpOworICA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dGluZ0ZvclNlc3Npb24ocE1hYywgc2Vzc2lvbklkKSkKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csIEZMKCIgYWJvcnRzIGJlY2F1c2Ugcm9hbSBjb21tYW5kIHdhaXRpbmciKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBpZihwUHJvZmlsZSA9PSBOVUxMKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIHBTY2FuRmlsdGVyID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRDc3JTY2FuUmVzdWx0RmlsdGVyKSk7CisgICAgICAgIGlmICggTlVMTCA9PSBwU2NhbkZpbHRlciApCisgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgIGlmICghSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgdm9zX21lbV9zZXQocFNjYW5GaWx0ZXIsIHNpemVvZih0Q3NyU2NhblJlc3VsdEZpbHRlciksIDApOworICAgICAgICBzdGF0dXMgPSBjc3JSb2FtUHJlcGFyZUZpbHRlckZyb21Qcm9maWxlKHBNYWMsIHBQcm9maWxlLCBwU2NhbkZpbHRlcik7CisgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBzdGF0dXMgPSBjc3JTY2FuR2V0UmVzdWx0KHBNYWMsIHBTY2FuRmlsdGVyLCAmaEJTU0xpc3QpOworICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgc3RhdHVzID0gY3NyUm9hbUlzc3VlQ29ubmVjdChwTWFjLCB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bUluZm8gKnBSb2FtSW5mbyA9IE5VTEwsIHJvYW1JbmZvOworICAgICAgICAgICAgICAgIHZvc19tZW1fc2V0KCZyb2FtSW5mbywgc2l6ZW9mKHRDc3JSb2FtSW5mbyksIDApOworICAgICAgICAgICAgICAgIHBSb2FtSW5mbyA9ICZyb2FtSW5mbzsKKyAgICAgICAgICAgICAgICBpZihwQ29tbWFuZC0+dS5yb2FtQ21kLnBSb2FtQnNzRW50cnkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB0Q3NyU2NhblJlc3VsdCAqcFNjYW5SZXN1bHQgPSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR0VUX0JBU0VfQUREUihwQ29tbWFuZC0+dS5yb2FtQ21kLnBSb2FtQnNzRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRDc3JTY2FuUmVzdWx0LCBMaW5rKTsKKyAgICAgICAgICAgICAgICAgICAgcm9hbUluZm8ucEJzc0Rlc2MgPSAmcFNjYW5SZXN1bHQtPlJlc3VsdC5Cc3NEZXNjcmlwdG9yOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByb2FtSW5mby5zdGF0dXNDb2RlID0gcFNlc3Npb24tPmpvaW5GYWlsU3RhdHVzQ29kZS5zdGF0dXNDb2RlOworICAgICAgICAgICAgICAgIHJvYW1JbmZvLnJlYXNvbkNvZGUgPSBwU2Vzc2lvbi0+am9pbkZhaWxTdGF0dXNDb2RlLnJlYXNvbkNvZGU7CisgICAgICAgICAgICAgICAgcFNlc3Npb24tPmJSZWZBc3NvY1N0YXJ0Q250LS07CisgICAgICAgICAgICAgICAgY3NyUm9hbUNhbGxDYWxsYmFjayhwTWFjLCBzZXNzaW9uSWQsIHBSb2FtSW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnNjYW5DbWQucm9hbUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ST0FNX0FTU09DSUFUSU9OX0NPTVBMRVRJT04sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fUkVTVUxUX0ZBSUxVUkUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNzclJvYW1DYWxsQ2FsbGJhY2socE1hYywgc2Vzc2lvbklkLCBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUuc2NhbkNtZC5yb2FtSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fQVNTT0NJQVRJT05fRkFJTFVSRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfUk9BTV9SRVNVTFRfRkFJTFVSRSk7CisgICAgICAgICAgICB9CisjaWZkZWYgRkVBVFVSRV9XTEFOX0JUQU1QX1VUX1JGCisgICAgICAgICAgICAvL0luIGNhc2Ugb2YgV0RTIHN0YXRpb24sIGxldCBpdCByZXRyeS4KKyAgICAgICAgICAgIGlmKCBDU1JfSVNfV0RTX1NUQShwUHJvZmlsZSkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vU2F2ZSB0aGUgcm9tYSBwcm9maWxlIHNvIHdlIGNhbiByZXRyeQorICAgICAgICAgICAgICAgIGNzckZyZWVSb2FtUHJvZmlsZSggcE1hYywgc2Vzc2lvbklkICk7CisgICAgICAgICAgICAgICAgcFNlc3Npb24tPnBDdXJSb2FtUHJvZmlsZSA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0Q3NyUm9hbVByb2ZpbGUpKTsKKyAgICAgICAgICAgICAgICBpZiAoIE5VTEwgIT0gcFNlc3Npb24tPnBDdXJSb2FtUHJvZmlsZSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX3NldChwU2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NjYW5GaWx0ZXIgPSBOVUxMOworICAgIHRBTklfVTMyIHJvYW1JZCA9IDA7CisgICAgdENzclJvYW1Qcm9maWxlICpwUHJvZmlsZSA9IE5VTEw7CisgICAgdENzclJvYW1TZXNzaW9uICpwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTiggcE1hYywgc2Vzc2lvbklkICk7CisKKyAgICBkbworICAgIHsKKyAgICAgICAgLy9IZXJlIGlzIHRoZSBwcm9maWxlIHdlIG5lZWQgdG8gY29ubmVjdCB0bworICAgICAgICBwU2NhbkZpbHRlciA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0Q3NyU2NhblJlc3VsdEZpbHRlcikpOworICAgICAgICBpZiAoIE5VTEwgPT0gcFNjYW5GaWx0ZXIgKQorICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICBpZiAoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIHZvc19tZW1fc2V0KHBTY2FuRmlsdGVyLCBzaXplb2YodENzclNjYW5SZXN1bHRGaWx0ZXIpLCAwKTsKKyAgICAgICAgaWYgKE5VTEwgPT0gcFNlc3Npb24pIGJyZWFrOworICAgICAgICBpZiAoTlVMTCA9PSBwU2Vzc2lvbi0+cEN1clJvYW1Qcm9maWxlKQorICAgICAgICB7CisgICAgICAgICAgICBwU2NhbkZpbHRlci0+RW5jcnlwdGlvblR5cGUubnVtRW50cmllcyA9IDE7CisgICAgICAgICAgICBwU2NhbkZpbHRlci0+RW5jcnlwdGlvblR5cGUuZW5jcnlwdGlvblR5cGVbMF0gPSBlQ1NSX0VOQ1JZUFRfVFlQRV9OT05FOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAg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VNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vd2Ugd2FudCB0byBwdXQgdGhlIGxhc3QgY29ubmVjdGVkIEJTUyB0byB0aGUgdmVyeSBiZWdpbm5pbmcsIGlmIHBvc3NpYmxlCisgICAgICAgICAgICAgICAgY3NyTW92ZUJzc1RvSGVhZEZyb21CU1NJRChwTWFjLCAmcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUuYnNzaWQsIGhCU1NMaXN0KTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JSb2FtSXNzdWVDb25uZWN0KHBNYWMsIHNlc3Npb25JZCwgcFByb2ZpbGUsIGhCU1NMaXN0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNzckNhcHNDaGFuZ2UsIDAsIGVBTklfQk9PTEVBTl9UUlVFLCBlQU5JX0JPT0xFQU5fVFJVRSk7CisgICAgICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY3NyU2NhblJlc3VsdFB1cmdlKHBNYWMsIGhCU1NMaXN0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9Ly9IYXZlIHNjYW4gcmVzdWx0CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csIEZMKCJjYW5ub3QgZmluZCBtYXRjaGluZyBCU1Mgb2YgIgorICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIpLAorICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS5ic3NpZCkpOworICAgICAgICAgICAgICAgIC8vRGlzY29ubmVjdAorICAgICAgICAgICAgICAgIGNzclJvYW1EaXNjb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N0cmljdCBzZWxlY3QgNUdIeiBpcyBub24temVybyB0aGVuIGlnbm9yZSB0aGUgY2FwYWJpbGl0eSBjaGVja2luZyAqLworICAgIGlmIChwSWVzICYmICFDU1JfSVNfU0VMRUNUXzVHSFpfTUFSR0lOKHBNYWMpKQorICAgIHsKKyAgICAgICAgLy9XZSBvbmx5IGNhcmUgYWJvdXQgMTFOIGNhcGFiaWxpdHkKKyAgICAgICAgaWYocEllcy0+SFRDYXBzLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIHJldCArPSBDU1JfQlNTX0NBUF9WQUxVRV9IVDsKKyAgICAgICAgfQorICAgICAgICBpZihDU1JfSVNfUU9TX0JTUyhwSWVzKSkKKyAgICAgICAgeworICAgICAgICAgICAgcmV0ICs9IENTUl9CU1NfQ0FQX1ZBTFVFX1dNTTsKKyAgICAgICAgICAgIC8vR2l2ZSBhZHZhbnRhZ2UgdG8gVUFQU0QKKyAgICAgICAgICAgIGlmKENTUl9JU19VQVBTRF9CU1MocEllcykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmV0ICs9IENTUl9CU1NfQ0FQX1ZBTFVFX1VBUFNEOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIChyZXQpOworfQorCisKKy8vVG8gY2hlY2sgd2h0aGVyIHBCc3MxIGlzIGJldHRlciB0aGFuIHBCc3MyCitzdGF0aWMgdEFOSV9CT09MRUFOIGNzcklzQmV0dGVyQnNzKHRDc3JTY2FuUmVzdWx0ICpwQnNzMSwgdENzclNjYW5SZXN1bHQgKnBCc3MyKQoreworICAgIHRBTklfQk9PTEVBTiByZXQ7CisKKyAgICBpZihDU1JfSVNfQkVUVEVSX1BSRUZFUl9WQUxVRShwQnNzMS0+cHJlZmVyVmFsdWUsIHBCc3MyLT5wcmVmZXJWYWx1ZSkpCisgICAgeworICAgICAgICByZXQgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICB9CisgICAgZWxzZSBpZihDU1JfSVNfRVFVQUxfUFJFRkVSX1ZBTFVFKHBCc3MxLT5wcmVmZXJWYWx1ZSwgcEJzczItPnByZWZlclZhbHVlKSkKKyAgICB7CisgICAgICAgIGlmKENTUl9JU19CRVRURVJfQ0FQX1ZBTFVFKHBCc3MxLT5jYXBWYWx1ZSwgcEJzczItPmNhcFZhbHVlKSkKKyAgICAgICAgeworICAgICAgICAgICAgcmV0ID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICByZXQgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgcmV0ID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgIH0KKworICAgIHJldHVybiAocmV0KTsKK30KKworCisjaWZkZWYgRkVBVFVSRV9XTEFOX0xGUiAKKy8vQWRkIHRoZSBjaGFubmVsIHRvIHRoZSBvY2N1cGllZENoYW5uZWxzIGFycmF5CitzdGF0aWMgdm9pZCBjc3JTY2FuQWRkVG9PY2N1cGllZENoYW5uZWxzKAorICAgICAgICB0cEFuaVNpckdsb2JhbCBwTWFjLCAKKyAgICAgICAgdENzclNjYW5SZXN1bHQgKnBSZXN1bHQsIAorICAgICAgICB0Q3NyQ2hhbm5lbCAqcE9jY3VwaWVkQ2hhbm5lbHMsIAorICAgICAgICB0RG90MTFmQmVhY29uSUVzICpwSWVzKQoreworICAgIGVIYWxTdGF0dXMgc3RhdHVzOworICAgIHRBTklfVTggICBjaGFubmVsOworICAgIHRBTklfVTggbnVtT2NjdXBpZWRDaGFubmVscyA9IHBPY2N1cGllZENoYW5uZWxzLT5udW1DaGFubmVsczsKKyAgICB0QU5JX1U4ICpwT2NjdXBpZWRDaGFubmVsTGlzdCA9IHBPY2N1cGllZENoYW5uZWxzLT5jaGFubmVsTGlzdDsKKworICAgIGNoYW5uZWwgPSBwUmVzdWx0LT5SZXN1bHQuQnNzRGVzY3JpcHRvci5jaGFubmVsSWQ7CisKKyAgICBpZiAoIWNzcklzQ2hhbm5lbFByZXNlbnRJbkxpc3QocE9jY3VwaWVkQ2hhbm5lbExpc3QsIG51bU9jY3VwaWVkQ2hhbm5lbHMsIGNoYW5uZWwpCisgICAgICAgICYmIGNzck5laWdoYm9yUm9hbUNvbm5lY3RlZFByb2ZpbGVNYXRjaChwTWFjLCBwUmVzdWx0LCBwSWVzKSkKKyAgICB7CisgICAgICAgIHN0YXR1cyA9IGNzckFkZFRvQ2hhbm5lbExpc3RGcm9udChwT2NjdXBpZWRDaGFubmVsTGlzdCwgbnVtT2NjdXBpZWRDaGFubmVscywgY2hhbm5lbCk7IAorICAgICAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgeyAKKyAgICAgICAgICAgIHBPY2N1cGllZENoYW5uZWxzLT5udW1DaGFubmVscysrOworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzIsIEZMKCIlczogYWRkZWQgY2hhbm5lbCAlZCB0byB0aGUgbGlzdCAoY291bnQ9JWQpIiksCisgICAgICAgICAgICAgIF9fZnVuY19fLCBjaGFubmVsLCBwT2NjdXBpZWRDaGFubmVscy0+bnVtQ2hhbm5lbHMpOworICAgICAgICAgICAgaWYgKHBPY2N1cGllZENoYW5uZWxzLT5udW1DaGFubmVscyA+IENTUl9CR19TQ0FOX09DQ1VQSUVEX0NIQU5ORUxfTElTVF9MRU4pIAorICAgICAgICAgICAgICAgIHBPY2N1cGllZENoYW5uZWxzLT5udW1DaGFubmVscyA9IENTUl9CR19TQ0FOX09DQ1VQSUVEX0NIQU5ORUxfTElTVF9MRU47IAorICAgICAgICB9IAorICAgIH0KK30KKwordm9pZCBjc3JBZGRDaGFubmVsVG9PY2N1cGllZENoYW5uZWxMaXN0KHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAgIGNoYW5uZWwpCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXM7CisgICAgdENzckNoYW5uZWwgKnBPY2N1cGllZENoYW5uZWxzID0gJnBNYWMtPnNjYW4ub2NjdXBpZWRDaGFubmVsczsKKyAgICB0QU5JX1U4IG51bU9jY3VwaWVkQ2hhbm5lbHMgPSBwT2NjdXBpZWRDaGFubmVscy0+bnVtQ2hhbm5lbHM7CisgICAgdEFOSV9VOCAqcE9jY3VwaWVkQ2hhbm5lbExpc3QgPSBwT2NjdXBpZWRDaGFubmVscy0+Y2hhbm5lbExpc3Q7CisgICAgaWYgKCFjc3JJc0NoYW5uZWxQcmVzZW50SW5MaXN0KHBPY2N1cGllZENoYW5uZWxMaXN0LAorICAgICAgICAgbnVtT2NjdXBpZWRDaGFubmVscywgY2hhbm5lbCkpCisgICAgeworICAgICAgICBzdGF0dXMgPSBjc3JBZGRUb0NoYW5uZWxMaXN0RnJvbnQocE9jY3VwaWVkQ2hhbm5lbExpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1PY2N1cGllZENoYW5uZWxzLCBjaGFubmVsKTsKKyAgICAgICAgaWYoSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBPY2N1cGllZENoYW5uZWxzLT5udW1DaGFubmVscysrOworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzIsIEZMKCJhZGRlZCBjaGFubmVsICVkIHRvIHRoZSBsaXN0IChjb3VudD0lZCkiKSwKKyAgICAgICAgICAgICAgICBjaGFubmVsLCBwT2NjdXBpZWRDaGFubmVscy0+bnVtQ2hhbm5lbHMpOworICAgICAgICAgICAgaWYgKHBPY2N1cGllZENoYW5uZWxzLT5udW1DaGFubmVscyA+CisgICAgICAgICAgICAgICAgQ1NSX0JHX1NDQU5fT0NDVVBJRURfQ0hBTk5FTF9MSVNUX0xFTikKKyAgICAgICAgICAgIHsKK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TiBmTWF0Y2g7CisgICAgdEFOSV9VMTYgaSA9IDA7CisgICAgCisgICAgaWYocGhSZXN1bHQpCisgICAgeworICAgICAgICAqcGhSZXN1bHQgPSBDU1JfSU5WQUxJRF9TQ0FOUkVTVUxUX0hBTkRMRTsKKyAgICB9CisKKyAgICBpZiAocE1hYy0+cm9hbS5jb25maWdQYXJhbS5uU2VsZWN0NUdIek1hcmdpbikKKyAgICB7CisgICAgICAgIHBNYWMtPnNjYW4uaW5TY2FuUmVzdWx0QmVzdEFQUnNzaSA9IC0xMjg7CisgICAgICAgIGNzckxMTG9jaygmcE1hYy0+c2Nhbi5zY2FuUmVzdWx0TGlzdCk7CisKKyAgICAgICAgLyogRmluZCBvdXQgdGhlIGJlc3QgQVAgUnNzaSBnb2luZyB0aHJ1IHRoZSBzY2FuIHJlc3VsdHMgKi8KKyAgICAgICAgcEVudHJ5ID0gY3NyTExQZWVrSGVhZCgmcE1hYy0+c2Nhbi5zY2FuUmVzdWx0TGlzdCwgTExfQUNDRVNTX05PTE9DSyk7CisgICAgICAgIHdoaWxlICggTlVMTCAhPSBwRW50cnkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBCc3NEZXNjID0gR0VUX0JBU0VfQUREUiggcEVudHJ5LCB0Q3NyU2NhblJlc3VsdCwgTGluayApOworICAgICAgICAgICAgZk1hdGNoID0gRkFMU0U7CisKKyAgICAgICAgICAgIGlmIChwRmlsdGVyKQorICAgICAgICAgICAgZm9yKGkgPSAwOyBpIDwgcEZpbHRlci0+U1NJRHMubnVtT2ZTU0lEczsgaSsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGZNYXRjaCA9IGNzcklzU3NpZE1hdGNoKCBwTWFjLCBwRmlsdGVyLT5TU0lEcy5TU0lETGlzdFtpXS5TU0lELnNzSWQsIHBGaWx0ZXItPlNTSURzLlNTSURMaXN0W2ldLlNTSUQubGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCc3NEZXNjLT5SZXN1bHQuc3NJZC5zc0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCc3NEZXNjLT5SZXN1bHQuc3NJZC5sZW5ndGgsIGVBTklfQk9PTEVBTl9UUlVFICk7CisgICAgICAgICAgICAgICAgaWYgKGZNYXRjaCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBJZXMgPSAodERvdDExZkJlYWNvbklFcyAqKSggcEJzc0Rlc2MtPlJlc3VsdC5wdkllcyApOworCisgICAgICAgICAgICAgICAgICAgIC8vQXQgdGhpcyB0aW1lLCBwQnNzRGVzY3JpcHRpb24tPlJlc3VsdC5wdkllcyBtYXkgYmUgTlVMTAorICAgICAgICAgICAgICAgICAgICBpZiggIXBJZXMgJiYgKCFIQUxfU1RBVFVTX1NVQ0NFU1MoY3NyR2V0UGFyc2VkQnNzRGVzY3JpcHRpb25JRXMocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEJzc0Rlc2MtPlJlc3VsdC5Cc3NEZXNjcmlwdG9yLCAmcEllcykpKSApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsIEZMKCJTU0lEIE1hdGNoZWQiKSk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKCBwRmlsdGVyLT5iT1NFTkFzc29jaWF0aW9uICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZk1hdGNoID0gVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisgICAgICAgICAgICAgICAgICAgICAgICBmTWF0Y2ggPSBjc3JJc1NlY3VyaXR5TWF0Y2gocE1hYywgJnBGaWx0ZXItPmF1dGhUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBGaWx0ZXItPkVuY3J5cHRpb25UeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBGaWx0ZXItPm1jRW5jcnlwdGlvblR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEZpbHRlci0+TUZQRW5hYmxlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwRmlsdGVyLT5NRlBSZXF1aXJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwRmlsdGVyLT5NRlBDYXBhYmxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBCc3NEZXNjLT5SZXN1bHQuQnNzRGVzY3JpcHRvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZXMsIE5VTEwsIE5VTEwsIE5VTEwgKTsKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICBmTWF0Y2ggPSBjc3JJc1NlY3VyaXR5TWF0Y2gocE1hYywgJnBGaWx0ZXItPmF1dGhUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBGaWx0ZXItPkVuY3J5cHRpb25UeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBGaWx0ZXItPm1jRW5jcnlwdGlvblR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLCBOVUxMLCBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBCc3NEZXNjLT5SZXN1bHQuQnNzRGVzY3JpcHRvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZXMsIE5VTEwsIE5VTEwsIE5VTEwgKTsKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmICgocEJzc0Rlc2MtPlJlc3VsdC5wdkllcyA9PSBOVUxMKSAmJiBwSWVzKQorICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwSWVzKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoZk1hdGNoKQorICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsIEZMKCIgU2VjdXJpdHkgTWF0Y2hlZCIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChmTWF0Y2ggJiYgKHBCc3NEZXNjLT5SZXN1bHQuQnNzRGVzY3JpcHRvci5yc3NpID4gcE1hYy0+c2Nhbi5pblNjYW5SZXN1bHRCZXN0QVBSc3NpKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HMSwgRkwoIkJlc3QgQVAgUnNzaSBjaGFuZ2VkIGZyb20gJWQgdG8gJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnNjYW4uaW5TY2FuUmVzdWx0QmVzdEFQUnNzaSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCc3NEZXNjLT5SZXN1bHQuQnNzRGVzY3JpcHRvci5yc3NpKTsKKyAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmluU2NhblJlc3VsdEJlc3RBUFJzc2kgPSBwQnNzRGVzYy0+UmVzdWx0LkJzc0Rlc2NyaXB0b3IucnNzaTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHB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TsKKworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cyLCBGTCgiQlNTSUQoIk1BQ19BRERSRVNTX1NUUgorICAgICAgICAgICAgICAgICAgICAgICAiKSBSc3NpKCVkKSBDaG5sKCVkKSBQcmVmVmFsKCV1KSBTU0lEPSUuKnMiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEJzc0Rlc2MtPlJlc3VsdC5Cc3NEZXNjcmlwdG9yLmJzc0lkKSwKKyAgICAgICAgICAgICAgICAgICAgICAgcEJzc0Rlc2MtPlJlc3VsdC5Cc3NEZXNjcmlwdG9yLnJzc2ksCisgICAgICAgICAgICAgICAgICAgICAgIHBCc3NEZXNjLT5SZXN1bHQuQnNzRGVzY3JpcHRvci5jaGFubmVsSWQsCisgICAgICAgICAgICAgICAgICAgICAgIHBCc3NEZXNjLT5wcmVmZXJWYWx1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgcEJzc0Rlc2MtPlJlc3VsdC5zc0lkLmxlbmd0aCwgcEJzc0Rlc2MtPlJlc3VsdC5zc0lkLnNzSWQpOworCisgICAgICAgICAgICAgICAgcEVudHJ5ID0gY3NyTExOZXh0KCZwTWFjLT5zY2FuLnNjYW5SZXN1bHRMaXN0LCBwRW50cnksIExMX0FDQ0VTU19OT0xPQ0spOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgY3NyTExVbmxvY2soJnBNYWMtPnNjYW4uc2NhblJlc3VsdExpc3QpOworICAgIH0KKworICAgIHBSZXRMaXN0ID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRTY2FuUmVzdWx0TGlzdCkpOworICAgIGlmICggTlVMTCA9PSBwUmV0TGlzdCApCisgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgZWxzZQorICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIGlmKEhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9zZXQocFJldExpc3QsIHNpemVvZih0U2NhblJlc3VsdExpc3QpLCAwKTsKKyAgICAgICAgY3NyTExPcGVuKHBNYWMtPmhIZGQsICZwUmV0TGlzdC0+TGlzdCk7CisgICAgICAgIHBSZXRMaXN0LT5wQ3VyRW50cnkgPSBOVUxMOworICAgICAgICAKKyAgICAgICAgY3NyTExMb2NrKCZwTWFjLT5zY2FuLnNjYW5SZXN1bHRMaXN0KTsKKyAgICAgICAgcEVudHJ5ID0gY3NyTExQZWVrSGVhZCggJnBNYWMtPnNjYW4uc2NhblJlc3VsdExpc3QsIExMX0FDQ0VTU19OT0xPQ0sgKTsKKyAgICAgICAgd2hpbGUoIHBFbnRyeSApIAorICAgICAgICB7CisgICAgICAgICAgICBwQnNzRGVzYyA9IEdFVF9CQVNFX0FERFIoIHBFbnRyeSwgdENzclNjYW5SZXN1bHQsIExpbmsgKTsKKyAgICAgICAgICAgIHBJZXMgPSAodERvdDExZkJlYWNvbklFcyAqKSggcEJzc0Rlc2MtPlJlc3VsdC5wdkllcyApOworICAgICAgICAgICAgLy9pZiBwQnNzRGVzYy0+UmVzdWx0LnB2SWVzIGlzIE5VTEwsIHdlIG5lZWQgdG8gZnJlZSBhbnkgbWVtb3J5IGFsbG9jYXRlZCBieSBjc3JNYXRjaEJTUworICAgICAgICAgICAgLy9mb3IgYW55IGVycm9yIGNvbmRpdGlvbiwgb3RoZXJ3aWFzZSwgaXQgd2lsbCBiZSBmcmVlZCBsYXRlci4KKyAgICAgICAgICAgIC8vcmVzZXQKKyAgICAgICAgICAgIGZNYXRjaCA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgIHBOZXdJZXMgPSBOVUxMOworCisgICAgICAgICAgICBpZihwRmlsdGVyKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGZNYXRjaCA9IGNzck1hdGNoQlNTKHBNYWMsICZwQnNzRGVzYy0+UmVzdWx0LkJzc0Rlc2NyaXB0b3IsIHBGaWx0ZXIsICZhdXRoLCAmdWMsICZtYywgJnBJZXMpOworICAgICAgICAgICAgICAgIGlmKCBOVUxMICE9IHBJZXMgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy9Pbmx5IHNhdmUgaXQgd2hlbiBtYXRjaGluZworICAgICAgICAgICAgICAgICAgICBpZihmTWF0Y2gpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCAhcEJzc0Rlc2MtPlJlc3VsdC5wdkllcyApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9jc3JNYXRjaEJTUyBhbGxvY2F0ZXMgdGhlIG1lbW9yeS4gU2ltcGx5IHBhc3MgaXQgYW5kIGl0IGlzIGZyZWVkIGxhdGVyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE5ld0llcyA9IHBJZXM7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9UaGUgcEllcyBpcyBhbGxvY2F0ZWQgYnkgc29tZW9uZSBlbHNlLiBtYWtlIGEgY29weQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vT25seSB0byBzYXZlIHBhcnNlZCBJRXMgaWYgY2FsbGVyIHByb3ZpZGVzIGEgZmlsdGVyLiBNb3N0IGxpa2VseSB0aGUgY2FsbGVyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9pcyB1c2luZyB0byBmb3IgYXNzb2NpYXRpb24sIGhlbmNlIHNhdmUgdGhlIHBhcnNlZCBJRXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTmV3SWVzID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHREb3QxMWZCZWFjb25JRXMpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIE5VTEwgPT0gcE5ld0llcyApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocE5ld0llcywgcEllcywgc2l6ZW9mKCB0RG90MTFmQmVhY29uSUVzICkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiBmYWlsIHRvIGFsbG9jYXRlIG1lbW9yeSBmb3IgSUVzIikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL05lZWQgdG8gZnJlZSBtZW1vcnkgYWxsb2NhdGVkIGJ5IGNzck1hdGNoQlNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCAhcEJzc0Rlc2MtPlJlc3VsdC5wdkllcyApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwSWVzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0vL2ZNYXRjaAorICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKCAhcEJzc0Rlc2MtPlJlc3VsdC5wdkllcyApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwSWVzKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmKE5VTEwgPT0gcEZpbHRlciB8fCBmTWF0Y2gpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYnNzTGVuID0gcEJzc0Rlc2MtPlJlc3VsdC5Cc3NEZXNjcmlwdG9yLmxlbmd0aCArIHNpemVvZihwQnNzRGVzYy0+UmVzdWx0LkJzc0Rlc2NyaXB0b3IubGVuZ3RoKTsKKyAgICAgICAgICAgICAgICBhbGxvY0xlbiA9IHNpemVvZiggdENzclNjYW5SZXN1bHQgKSArIGJzc0xlbjsKKyAgICAgICAgICAgICAgICBwUmVzdWx0ID0gdm9zX21lbV9tYWxsb2MoYWxsb2NMZW4pOworICAgICAgICAgICAgICAgIGlmICggTlVMTCA9PSBwUmVzdWx0ICkKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiAgZmFpbCB0byBhbGxvY2F0ZSBtZW1vcnkgZm9yIHNjYW4gcmVzdWx0LCBsZW49JWQiKSwgYWxsb2NMZW4pOworICAgICAgICAgICAgICAgICAgICBpZihwTmV3SWVzKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocE5ld0llcyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHZvc19tZW1fc2V0KHBSZXN1bHQsIGFsbG9jTGVuLCAwKTsKKyAgICAgICAgICAgICAgICBwUmVzdWx0LT5jYXBWYWx1ZSA9IHBCc3NEZXNjLT5jYXBWYWx1ZTsKKyAgICAgICAgICAgICAgICBwUmVzdWx0LT5wcmVmZXJWYWx1ZSA9IHBCc3NEZXNjLT5wcmVmZXJWYWx1ZTsKKyAgICAgICAgICAgICAgICBwUmVzdWx0LT51Y0VuY3J5cHRpb25UeXBlID0gdWM7CisgICAgICAgICAgICAgICAgcFJlc3VsdC0+bWNFbmNyeXB0aW9uVHlwZSA9IG1jOworICAgICAgICAgICAgICAgIHBSZXN1bHQtPmF1dGhUeXBlID0gYXV0aDsKKyAgICAgICAgICAgICAgICBwUmVzdWx0LT5SZXN1bHQuc3NJZCA9IHBCc3NEZXNjLT5SZXN1bHQuc3NJZDsKKyAgICAgICAgICAgICAgICBwUmVzdWx0LT5SZXN1bHQudGltZXIgPSAwOworICAgICAgICAgICAgICAgIC8vc2F2ZSB0aGUgcEllcyBmb3IgbGF0ZXIgdXNlCisgICAgICAgICAgICAgICAgcFJlc3VsdC0+UmVzdWx0LnB2SWVzID0gcE5ld0llczsKKyAgICAgICAgICAgICAgICAvL3NhdmUgYnNzIGRlc2NyaXB0aW9uCisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwUmVzdWx0LT5SZXN1bHQuQnNzRGVzY3JpcHRvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBCc3NEZXNjLT5SZXN1bHQuQnNzRGVzY3JpcHRvciwgYnNzTGVuKTsKKyAgICAgICAgICAgICAgICAvL05vIG5lZWQgdG8gbG9jayBwUmV0TGlzdCBiZWNhdXNlIGl0IGlzIGxvY2FsbHkgYWxsb2NhdGVkIGFuZCBubyBvdXRzaWRlIGNhbiBhY2Nlc3MgaXQgYXQgdGhpcyB0aW1lCisgICAgICAgICAgICAgICAgaWYoY3NyTExJc0xpc3RFbXB0eSgmcFJldExpc3QtPkxpc3QsIExMX0FDQ0VTU19OT0xPQ0spKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY3NyTExJbnNlcnRUYWlsKCZwUmV0TGlzdC0+TGlzdCwgJnBSZXN1bHQtPkxpbmssIExMX0FDQ0VTU19OT0xPQ0spOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvL1RvIHNvcnQgdGhlIGxpc3QKKyAgICAgICAgICAgICAgICAgICAgdExpc3RFbGVtICpwVG1wRW50cnk7CisgICAgICAgICAgICAgICAgICAgIHRDc3JTY2FuUmVzdWx0ICpwVG1wUmVzdWx0OworICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgcFRtcEVudHJ5ID0gY3NyTExQZWVrSGVhZCgmcFJldExpc3QtPkxpc3QsIExMX0FDQ0VTU19OT0xPQ0spOworICAgICAgICAgICAgICAgICAgICB3aGlsZShwVG1wRW50cnkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUbXBSZXN1bHQgPSBHRVRfQkFTRV9BRERSKCBwVG1wRW50cnksIHRDc3JTY2FuUmVzdWx0LCBMaW5rICk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihjc3JJc0JldHRlckJzcyhwUmVzdWx0LCBwVG1wUmVzdWx0KSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JMTEluc2VydEVudHJ5KCZwUmV0TGlzdC0+TGlzdCwgcFRtcEVudHJ5LCAmcFJlc3VsdC0+TGluaywgTExfQUNDRVNTX05PTE9DSyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9UbyBpbmRpY2F0ZSB3ZSBhcmUgZG9uZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSZXN1bHQgPSBOVUxMOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgcFRtcEVudHJ5ID0gY3NyTExOZXh0KCZwUmV0TGlzdC0+TGlzdCwgcFRtcEVudHJ5LCBMTF9BQ0NFU1NfTk9MT0NLKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZihwUmVzdWx0ICE9IE5VTEwpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vVGhpcyBvbmUgaXMgbm90IGJldHRlciB0aGFuIGFueSBvbmUKKyAgICAgICAgICAgICAgICAgICAgICAgIGNzckxMSW5zZXJ0VGFpbCgmcFJldExpc3QtPkxpc3QsICZwUmVzdWx0LT5MaW5rLCBMTF9BQ0NFU1NfTk9MT0NLKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBjb3VudCsrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcEVudHJ5ID0gY3NyTExOZXh0KCAmcE1hYy0+c2Nhbi5zY2FuUmVzdWx0TGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTk9MT0NLICk7CisgICAgICAgIH0vL3doaWxlCisgICAgICAgIGNzckxMVW5sb2NrKCZwTWFjLT5zY2FuLnNjYW5SZXN1bHRMaXN0KTsKKyAgICAgICAgCisgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cyLCBGTCgicmV0dXJuICVkIEJTUyIpLCBjc3JMTENvdW50KCZwUmV0TGlzdC0+TGlzdCkpOworICAgICAgICAKKyAgICAgICAgaWYoICFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSB8fCAocGhSZXN1bHQgPT0gTlVMTCkgKQorICAgICAgICB7CisgICAgICAgICAgICAvL0ZhaWwgb3IgTm8gb25lIHdhbnRzIHRoZSByZXN1bHQuCisgICAgICAgICAgICBjc3JTY2FuUmVzdWx0UHVyZ2UocE1hYywgKHRTY2FuUmVzdWx0SGFuZGxlKXBSZXRMaXN0KTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKDAgPT0gY291bnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9XZSBhcmUgaGVyZSBtZWFuaW5nIHRoZSB0aGVyZSBpcyBubyBtYXRjaAorICAgICAgICAgICAgICAgIGNzckxMQ2xvc2UoJnBSZXRMaXN0LT5MaXN0KTsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocFJldExpc3QpOworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0VfTlVMTF9WQUxVRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYocGhSZXN1bHQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKnBoUmVzdWx0ID0gcFJldExpc3Q7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Ly9BbGxvY2F0ZWQgcFJldExpc3QKKyAgICAKKyAgICByZXR1cm4gKHN0YXR1cyk7Cit9CisKKy8qCisgKiBOT1RFOiBUaGlzIHJvdXRpbmUgaXMgYmVpbmcgYWRkZWQgdG8gbWFrZQorICogc3VyZSB0aGF0IHNjYW4gcmVzdWx0cyBhcmUgbm90IGJlaW5nIGZsdXNoZWQKKyAqIHdoaWxlIHJvYW1pbmcuIElmIHRoZSBzY2FuIHJlc3VsdHMgYXJlIGZsdXNoZWQsCisgKiB3ZSBhcmU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cEVudHJ5LCpwRnJlZUVsZW07CisgICAgdENzclNjYW5SZXN1bHQgKnBCc3NEZXNjOworICAgIHREYmxMaW5rTGlzdCAqcExpc3QgPSAmcE1hYy0+c2Nhbi5zY2FuUmVzdWx0TGlzdDsKKworICAgIGNzckxMTG9jayhwTGlzdCk7CisKKyAgICBwRW50cnkgPSBjc3JMTFBlZWtIZWFkKCBwTGlzdCwgTExfQUNDRVNTX05PTE9DSyApOworICAgIHdoaWxlKCBwRW50cnkgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIHBCc3NEZXNjID0gR0VUX0JBU0VfQUREUiggcEVudHJ5LCB0Q3NyU2NhblJlc3VsdCwgTGluayApOworICAgICAgICBpZiggZmx1c2hQMlAgPT0gdm9zX21lbV9jb21wYXJlKCBwQnNzRGVzYy0+UmVzdWx0LnNzSWQuc3NJZCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJESVJFQ1QtIiwgNykgKQorICAgICAgICB7CisgICAgICAgICAgICBwRnJlZUVsZW0gPSBwRW50cnk7CisgICAgICAgICAgICBwRW50cnkgPSBjc3JMTE5leHQocExpc3QsIHBFbnRyeSwgTExfQUNDRVNTX05PTE9DSyk7CisgICAgICAgICAgICBjc3JMTFJlbW92ZUVudHJ5KHBMaXN0LCBwRnJlZUVsZW0sIExMX0FDQ0VTU19OT0xPQ0spOworICAgICAgICAgICAgY3NyRnJlZVNjYW5SZXN1bHRFbnRyeSggcE1hYywgcEJzc0Rlc2MgKTsKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9CisgICAgICAgIHBFbnRyeSA9IGNzckxMTmV4dChwTGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTk9MT0NLKTsKKyAgICB9CisKKyAgICBjc3JMTFVubG9jayhwTGlzdCk7CisKKyAgICByZXR1cm4gKHN0YXR1cyk7Cit9CisKKy8qKgorICogY3NyQ2hlY2sxMWRDaGFubmVsCisgKgorICpGVU5DVElPTjoKKyAqIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIGZyb20gY3NyU2NhbkZpbHRlclJlc3VsdHMgZnVuY3Rpb24gYW5kCisgKiBjb21wYXJlIGNoYW5uZWwgbnVtYmVyIHdpdGggZ2l2ZW4gY2hhbm5lbCBsaXN0LgorICoKKyAqTE9HSUM6CisgKiBDaGVjayBTY2FuIHJlc3VsdCBjaGFubmVsIG51bWJlciB3aXRoIENGRyBjaGFubmVsIGxpc3QKKyAqCisgKkFTU1VNUFRJT05TOgorICoKKyAqCisgKk5PVEU6CisgKgorICogQHBhcmFtICBjaGFubmVsSWQgICAgICBjaGFubmVsIG51bWJlcgorICogQHBhcmFtICBwQ2hhbm5lbExpc3QgICBQb2ludGVyIHRvIGNoYW5uZWwgbGlzdAorICogQHBhcmFtICBudW1DaGFubmVscyAgICBOdW1iZXIgb2YgY2hhbm5lbCBpbiBjaGFubmVsIGxpc3QKKyAqCisgKiBAcmV0dXJuIFN0YXR1cworICovCisKK2VIYWxTdGF0dXMgY3NyQ2hlY2sxMWRDaGFubmVsKHRBTklfVTggY2hhbm5lbElkLCB0QU5JX1U4ICpwQ2hhbm5lbExpc3QsIHRBTklfVTMyIG51bUNoYW5uZWxzKQoreworICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICB0QU5JX1U4IGkgPSAwOworCisgICAgZm9yIChpID0gMDsgaSA8IG51bUNoYW5uZWxzOyBpKyspCisgICAgeworICAgICAgICBpZihwQ2hhbm5lbExpc3RbIGkgXSA9PSBjaGFubmVsSWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfQorCisvKioKKyAqIGNzclNjYW5GaWx0ZXJSZXN1bHRzCisgKgorICpGVU5DVElPTjoKKyAqIFRoaXMgZnV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ICAgICAgICAgIHBNYWMtPnJvYW0udmFsaWRDaGFubmVsTGlzdCwgJmxlbikpKQorICAgIHsKKyAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAiRmFpbGVkIHRvIGdldCBDaGFubmVsIGxpc3QgZnJvbSBDRkciKTsKKyAgICB9CisKKyAgICBwRW50cnkgPSBjc3JMTFBlZWtIZWFkKCAmcE1hYy0+c2Nhbi5zY2FuUmVzdWx0TGlzdCwgTExfQUNDRVNTX0xPQ0sgKTsKKyAgICB3aGlsZSggcEVudHJ5ICkKKyAgICB7CisgICAgICAgIHBCc3NEZXNjID0gR0VUX0JBU0VfQUREUiggcEVudHJ5LCB0Q3NyU2NhblJlc3VsdCwgTGluayApOworICAgICAgICBwVGVtcEVudHJ5ID0gY3NyTExOZXh0KCAmcE1hYy0+c2Nhbi5zY2FuUmVzdWx0TGlzdCwgcEVudHJ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTExfQUNDRVNTX0xPQ0sgKTsKKyAgICAgICAgaWYoY3NyQ2hlY2sxMWRDaGFubmVsKHBCc3NEZXNjLT5SZXN1bHQuQnNzRGVzY3JpcHRvci5jaGFubmVsSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5yb2FtLnZhbGlkQ2hhbm5lbExpc3QsIGxlbikpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIFJlbW92ZSBTY2FuIHJlc3VsdCB3aGljaCBkb2VzIG5vdCBoYXZlIDExZCBjaGFubmVsICovCisgICAgICAgICAgICBpZiggY3NyTExSZW1vdmVFbnRyeSggJnBNYWMtPnNjYW4uc2NhblJlc3VsdExpc3QsIHBFbnRyeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTExfQUNDRVNTX0xPQ0sgKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjc3JGcmVlU2NhblJlc3VsdEVudHJ5KCBwTWFjLCBwQnNzRGVzYyApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHBFbnRyeSA9IHBUZW1wRW50cnk7CisgICAgfQorCisgICAgcEVudHJ5ID0gY3NyTExQZWVrSGVhZCggJnBNYWMtPnNjYW4udGVtcFNjYW5SZXN1bHRzLCBMTF9BQ0NFU1NfTE9DSyApOworICAgIHdoaWxlKCBwRW50cnkgKQorICAgIHsKKyAgICAgICAgcEJzc0Rlc2MgPSBHRVRfQkFTRV9BRERSKCBwRW50cnksIHRDc3JTY2FuUmVzdWx0LCBMaW5rICk7CisgICAgICAgIHBUZW1wRW50cnkgPSBjc3JMTE5leHQoICZwTWFjLT5zY2FuLnRlbXBTY2FuUmVzdWx0cywgcEVudHJ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTExfQUNDRVNTX0xPQ0sgKTsKKyAgICAgICAgaWYoY3NyQ2hlY2sxMWRDaGFubmVsKHBCc3NEZXNjLT5SZXN1bHQuQnNzRGVzY3JpcHRvci5jaGFubmVsSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5yb2FtLnZhbGlkQ2hhbm5lbExpc3QsIGxlbikpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIFJlbW92ZSBTY2FuIHJlc3VsdCB3aGljaCBkb2VzIG5vdCBoYXZlIDExZCBjaGFubmVsICovCisgICAgICAgICAgICBpZiggY3NyTExSZW1vdmVFbnRyeSggJnBNYWMtPnNjYW4udGVtcFNjYW5SZXN1bHRzLCBwRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICBMTF9BQ0NFU1NfTE9DSyApKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNzckZyZWVTY2FuUmVzdWx0RW50cnkoIHBNYWMsIHBCc3NEZXNjICk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWx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gcEVudHJ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMTF9BQ0NFU1NfTE9DSyApKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNzckZyZWVTY2FuUmVzdWx0RW50cnkoIHBNYWMsIHBCc3NEZXNjICk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPRzEsIEZMKCIlZCBpcyBhIFZhbGlkIGNoYW5uZWwiKSwKKyAgICAgICAgICAgICAgICAgICAgcEJzc0Rlc2MtPlJlc3VsdC5Cc3NEZXNjcmlwdG9yLmNoYW5uZWxJZCk7CisgICAgICAgIH0KKyAgICAgICAgcEVudHJ5ID0gcFRlbXBFbnRyeTsKKyAgICB9CisKKyAgICBwRW50cnkgPSBjc3JMTFBlZWtIZWFkKCAmcE1hYy0+c2Nhbi50ZW1wU2NhblJlc3VsdHMsIExMX0FDQ0VTU19MT0NLICk7CisgICAgd2hpbGUoIHBFbnRyeSApCisgICAgeworICAgICAgICBwQnNzRGVzYyA9IEdFVF9CQVNFX0FERFIoIHBFbnRyeSwgdENzclNjYW5SZXN1bHQsIExpbmsgKTsKKyAgICAgICAgcFRlbXBFbnRyeSA9IGNzckxMTmV4dCggJnBNYWMtPnNjYW4udGVtcFNjYW5SZXN1bHRzLCBwRW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMTF9BQ0NFU1NfTE9DSyApOworCisgICAgICAgIGlmKChwTWFjLT5zY2FuLmZFbmFibGVERlNDaG5sU2NhbiA9PSBERlNfQ0hOTF9TQ0FOX0RJU0FCTEVEKSAmJgorICAgICAgICAgICAgICAgICAgQ1NSX0lTX0NIQU5ORUxfREZTKHBCc3NEZXNjLT5SZXN1bHQuQnNzRGVzY3JpcHRvci5jaGFubmVsSWQpKQ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SZXRMaXN0LCAqcEluTGlzdCA9ICh0U2NhblJlc3VsdExpc3QgKiloSW47CisgICAgdENzclNjYW5SZXN1bHQgKnBSZXN1bHQsICpwU2NhblJlc3VsdDsKKyAgICB0QU5JX1UzMiBjb3VudCA9IDA7CisgICAgdExpc3RFbGVtICpwRW50cnk7CisgICAgdEFOSV9VMzIgYnNzTGVuLCBhbGxvY0xlbjsKKyAgICAKKyAgICBpZihwaFJlc3VsdCkKKyAgICB7CisgICAgICAgICpwaFJlc3VsdCA9IENTUl9JTlZBTElEX1NDQU5SRVNVTFRfSEFORExFOworICAgIH0KKyAgICBwUmV0TGlzdCA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0U2NhblJlc3VsdExpc3QpKTsKKyAgICBpZiAoIE5VTEwgPT0gcFJldExpc3QgKQorICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIGVsc2UKKyAgICB7CisgICAgICAgIHZvc19tZW1fc2V0KHBSZXRMaXN0LCBzaXplb2YodFNjYW5SZXN1bHRMaXN0KSwgMCk7CisgICAgICAgIGNzckxMT3BlbihwTWFjLT5oSGRkLCAmcFJldExpc3QtPkxpc3QpOworICAgICAgICBwUmV0TGlzdC0+cEN1ckVudHJ5ID0gTlVMTDsKKyAgICAgICAgY3NyTExMb2NrKCZwTWFjLT5zY2FuLnNjYW5SZXN1bHRMaXN0KTsKKyAgICAgICAgY3NyTExMb2NrKCZwSW5MaXN0LT5MaXN0KTsKKyAgICAgICAgCisgICAgICAgIHBFbnRyeSA9IGNzckxMUGVla0hlYWQoICZwSW5MaXN0LT5MaXN0LCBMTF9BQ0NFU1NfTk9MT0NLICk7CisgICAgICAgIHdoaWxlKCBwRW50cnkgKSAKKyAgICAgICAgeworICAgICAgICAgICAgcFNjYW5SZXN1bHQgPSBHRVRfQkFTRV9BRERSKCBwRW50cnksIHRDc3JTY2FuUmVzdWx0LCBMaW5rICk7CisgICAgICAgICAgICBic3NMZW4gPSBwU2NhblJlc3VsdC0+UmVzdWx0LkJzc0Rlc2NyaXB0b3IubGVuZ3RoICsgc2l6ZW9mKHBTY2FuUmVzdWx0LT5SZXN1bHQuQnNzRGVzY3JpcHRvci5sZW5ndGgpOworICAgICAgICAgICAgYWxsb2NMZW4gPSBzaXplb2YoIHRDc3JTY2FuUmVzdWx0ICkgKyBic3NMZW47CisgICAgICAgICAgICBwUmVzdWx0ID0gdm9zX21lbV9tYWxsb2MoYWxsb2NMZW4pOworICAgICAgICAgICAgaWYgKCBOVUxMID09IHBSZXN1bHQgKQorICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgIGlmICghSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY3NyU2NhblJlc3VsdFB1cmdlKHBNYWMsICh0U2NhblJlc3VsdEhhbmRsZSAqKXBSZXRMaXN0KTsKKyAgICAgICAgICAgICAgICBjb3VudCA9IDA7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB2b3NfbWVtX3NldChwUmVzdWx0LCBhbGxvY0xlbiAsIDApOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwUmVzdWx0LT5SZXN1bHQuQnNzRGVzY3JpcHRvciwgJnBTY2FuUmVzdWx0LT5SZXN1bHQuQnNzRGVzY3JpcHRvciwgYnNzTGVuKTsKKyAgICAgICAgICAgIGlmKCBwU2NhblJlc3VsdC0+UmVzdWx0LnB2SWVzICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwUmVzdWx0LT5SZXN1bHQucHZJZXMgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YoIHREb3QxMWZCZWFjb25JRXMgKSk7CisgICAgICAgICAgICAgICAgaWYgKCBOVUxMID09IHBSZXN1bHQtPlJlc3VsdC5wdkllcyApCisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICAgICAgaWYgKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vRnJlZSB0aGUgbWVtb3J5IHdlIGFsbG9jYXRlIGFib3ZlIGZpcnN0CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwUmVzdWx0KTsKKyAgICAgICAgICAgICAgICAgICAgY3NyU2NhblJlc3VsdFB1cmdlKHBNYWMsICh0U2NhblJlc3VsdEhhbmRsZSAqKXBSZXRMaXN0KTsKKyAgICAgICAgICAgICAgICAgICAgY291bnQgPSAwOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBSZXN1bHQtPlJlc3VsdC5wdkllcywgcFNjYW5SZXN1bHQtPlJlc3VsdC5wdkllcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCB0RG90MTFmQmVhY29uSUVzICkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgY3NyTExJbnNlcnRUYWlsKCZwUmV0TGlzdC0+TGlzdCwgJnBSZXN1bHQtPkxpbmssIExMX0FDQ0VTU19MT0NLKTsKKyAgICAgICAgICAgIGNvdW50Kys7CisgICAgICAgICAgICBwRW50cnkgPSBjc3JMTE5leHQoICZwSW5MaXN0LT5MaXN0LCBwRW50cnksIExMX0FDQ0VTU19OT0xPQ0sgKTsKKyAgICAgICAgfS8vd2hpbGUKKyAgICAgICAgY3NyTExVbmxvY2soJnBJbkxpc3QtPkxpc3QpOworICAgICAgICBjc3JMTFVubG9jaygmcE1hYy0+c2Nhbi5zY2FuUmVzdWx0TGlzdCk7CisgICAgICAgIAorICAgICAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYoMCA9PSBjb3VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjc3JMTENsb3NlKCZwUmV0TGlzdC0+TGlzdCk7CisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBSZXRMaXN0KTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19FX05VTExfVkFMVUU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKHBoUmVzdWx0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICpwaFJlc3VsdCA9IHBSZXRMaXN0OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfS8vQWxsb2NhdGVkIHBSZXRMaXN0CisgICAgCisgICAgcmV0dXJuIChzdGF0dXMpOworfQorCisKKyAKK2VIYWxTdGF0dXMgY3NyU2Nhbm5pbmdTdGF0ZU1zZ1Byb2Nlc3NvciggdHBBbmlTaXJHbG9iYWwgcE1hYywgdm9pZCAqcE1zZ0J1ZiApCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIHRTaXJNYk1zZyAqcE1zZyA9ICh0U2lyTWJNc2cgKilwTXNnQnVmOworCisgICAgaWYoKGVXTklfU01FX1NDQU5fUlNQID09IHBNc2ctPnR5cGUpIHx8IChlV05JX1NNRV9HRVRfU0NBTk5FRF9DSEFOTkVMX1JTUCA9PSBwTXNnLT50eXBlKSkKKyAgICB7CisgICAgICAgIHN0YXR1cyA9IGNzclNjYW5TbWVTY2FuUmVzcG9uc2UoIHBNYWMsIHBNc2dCdWYgKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgaWYocE1zZy0+dHlwZSA9PSBlV05JX1NNRV9VUFBFUl9MQVlFUl9BU1NPQ19DTkYpIAorICAgICAgICB7CisgICAgICAgICAgICB0Q3NyUm9hbVNlc3Npb24gICpwU2Vzc2lvbjsKKyAgICAgICAgICAgIHRTaXJTbWVBc3NvY0luZFRvVXBwZXJMYXllckNuZiAqcFVwcGVyTGF5ZXJBc3NvY0NuZjsKKyAgICAgICAgICAgIHRDc3JSb2FtSW5mbyByb2FtSW5mbzsKKyAgICAgICAgICAgIHRDc3JSb2FtSW5mbyAqcFJvYW1JbmZvID0gTlVMTDsKKyAgICAgICAgICAgIHRBTklfVTMyIHNlc3Npb25JZDsKKyAgICAgICAgICAgIGVIYWxTdGF0dXMgc3RhdHVzOworICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0cxLCBGTCgiU2Nhbm5pbmcgOiBBU1NPQ0lBVElPTiBjb25maXJtYXRpb24gY2FuIGJlIGdpdmVuIHRvIHVwcGVyIGxheWVyICIpKTsKKyAgICAgICAgICAgIHZvc19tZW1fc2V0KCZyb2FtSW5mbywgc2l6ZW9mKHRDc3JSb2FtSW5mbyksIDApOworICAgICAgICAgICAgcFJvYW1JbmZvID0gJnJvYW1JbmZvOworICAgICAgICAgICAgcFVwcGVyTGF5ZXJBc3NvY0NuZiA9ICh0U2lyU21lQXNzb2NJbmRUb1VwcGVyTGF5ZXJDbmYgKilwTXNnQnVmOworICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbUdldFNlc3Npb25JZEZyb21CU1NJRCggcE1hYywgKHRDc3JCc3NpZCAqKXBVcHBlckxheWVyQXNzb2NDbmYtPmJzc0lkLCAmc2Vzc2lvbklkICk7CisgICAgICAgICAgICBwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTihwTWFjLCBzZXNzaW9uSWQpOworCisgICAgICAgICAgICBpZighcFNlc3Npb24pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9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BzaXplb2YodENzckJzc2lkKSk7CisgICAgICAgICAgICBwUm9hbUluZm8tPndtbUVuYWJsZWRTdGEgPSBwVXBwZXJMYXllckFzc29jQ25mLT53bW1FbmFibGVkU3RhOworI2lmZGVmIFdMQU5fRkVBVFVSRV9BUF9IVDQwXzI0RworICAgICAgICAgICAgcFJvYW1JbmZvLT5IVDQwTUh6SW50b0VuYWJsZWRTdGEgPQorICAgICAgICAgICAgICAgICAgICAgICBwVXBwZXJMYXllckFzc29jQ25mLT5IVDQwTUh6SW50b0VuYWJsZWRTdGE7CisjZW5kaWYKKyAgICAgICAgICAgIGlmKENTUl9JU19JTkZSQV9BUChwUm9hbUluZm8tPnUucENvbm5lY3RlZFByb2ZpbGUpICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0uY29ubmVjdFN0YXRlID0gZUNTUl9BU1NPQ19TVEFURV9UWVBFX0lORlJBX0NPTk5FQ1RFRDsKKyAgICAgICAgICAgICAgICBwUm9hbUluZm8tPmZSZWFzc29jUmVxID0gcFVwcGVyTGF5ZXJBc3NvY0NuZi0+cmVhc3NvY1JlcTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIHNlc3Npb25JZCwgcFJvYW1JbmZvLCAwLCBlQ1NSX1JPQU1fSU5GUkFfSU5ELCBlQ1NSX1JPQU1fUkVTVUxUX0lORlJBX0FTU09DSUFUSU9OX0NORik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZihDU1JfSVNfV0RTX0FQKCBwUm9hbUluZm8tPnUucENvbm5lY3RlZFByb2ZpbGUpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19zbGVlcCggMTAwICk7CisgICAgICAgICAgICAgICAgcE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLmNvbm5lY3RTdGF0ZSA9IGV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24gKnBOZXdCc3NEZXNjciwgdFNpckJzc0Rlc2NyaXB0aW9uICpwT2xkQnNzRGVzY3IpCit7CisgICAgaW50IGlkeCwgbGVuOworICAgIHRBTklfVTggKnBiSWU7CisKKyAgICAvL0lmIGZhaWxlZCB0byByZW1vdmUsIGFzc3VtaW5nIHNvbWVvbmUgZWxzZSBnb3QgaXQuCisgICAgaWYoKHBOZXdCc3NEZXNjci0+ZlByb2JlUnNwICE9IHBPbGRCc3NEZXNjci0+ZlByb2JlUnNwKSAmJgorICAgICAgICgwID09IHBOZXdCc3NEZXNjci0+V3NjSWVMZW4pKQorICAgIHsKKyAgICAgICAgaWR4ID0gMDsKKyAgICAgICAgbGVuID0gcE9sZEJzc0Rlc2NyLT5sZW5ndGggLSBzaXplb2YodFNpckJzc0Rlc2NyaXB0aW9uKSArIAorICAgICAgICAgICAgICAgIHNpemVvZih0QU5JX1UxNikgKyBzaXplb2YodEFOSV9VMzIpIC0gRE9UMTFGX0lFX1dTQ1BST0JFUkVTX01JTl9MRU4gLSAyOworICAgICAgICBwYkllID0gKHRBTklfVTggKilwT2xkQnNzRGVzY3ItPmllRmllbGRzOworICAgICAgICAvL1NhdmUgV1BTIElFIGlmIGl0IGV4aXN0cworICAgICAgICBwTmV3QnNzRGVzY3ItPldzY0llTGVuID0gMDsKKyAgICAgICAgd2hpbGUoaWR4IDwgbGVuKQorICAgICAgICB7CisgICAgICAgICAgICBpZigoRE9UMTFGX0VJRF9XU0NQUk9CRVJFUyA9PSBwYkllWzBdKSAmJgorICAgICAgICAgICAgICAgICgweDAwID09IHBiSWVbMl0pICYmICgweDUwID09IHBiSWVbM10pICYmICgweGYyID09IHBiSWVbNF0pICYmICgweDA0ID09IHBiSWVbNV0pKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vRm91bnJkIGl0CisgICAgICAgICAgICAgICAgaWYoKERPVDExRl9JRV9XU0NQUk9CRVJFU19NQVhfTEVOIC0gMikgPj0gcGJJZVsxXSkKKyAgICA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UgJ29sZCcgZW50cnkgZnJvbSB0aGUgbGlzdC4uLi4KKyAgICAgICAgICAgIGlmKCBjc3JMTFJlbW92ZUVudHJ5KCAmcE1hYy0+c2Nhbi5zY2FuUmVzdWx0TGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTE9DSyApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyAhd2UgbmVlZCB0byBmcmVlIHRoZSBtZW1vcnkgYXNzb2NpYXRlZCB3aXRoIHRoaXMgbm9kZQorICAgICAgICAgICAgICAgIC8vSWYgZmFpbGVkIHRvIHJlbW92ZSwgYXNzdW1pbmcgc29tZW9uZSBlbHNlIGdvdCBpdC4KKyAgICAgICAgICAgICAgICAqcFNzaWQgPSBwQnNzRGVzYy0+UmVzdWx0LnNzSWQ7CisgICAgICAgICAgICAgICAgKnRpbWVyID0gcEJzc0Rlc2MtPlJlc3VsdC50aW1lcjsKKyAgICAgICAgICAgICAgICBjc3JDaGVja05TYXZlV3NjSWUocE1hYywgcFNpckJzc0Rlc2NyLCAmcEJzc0Rlc2MtPlJlc3VsdC5Cc3NEZXNjcmlwdG9yKTsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBjc3JGcmVlU2NhblJlc3VsdEVudHJ5KCBwTWFjLCBwQnNzRGVzYyApOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HVywgRkwoICIgIGZhaWwgdG8gcmVtb3ZlIGVudHJ5IiApICk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmUkMgPSBUUlVFOworCisgICAgICAgICAgICAvLyBJZiB3ZSBmb3VuZCBhIG1hdGNoLCB3ZSBjYW4gc3RvcCBsb29raW5nIHRocm91Z2ggdGhlIGxpc3QuCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIHBFbnRyeSA9IGNzckxMTmV4dCggJnBNYWMtPnNjYW4uc2NhblJlc3VsdExpc3QsIHBFbnRyeSwgTExfQUNDRVNTX0xPQ0sgKTsKKyAgICB9CisKKyAgICByZXR1cm4gZlJDOworfQorCisKK2VIYWxTdGF0dXMgY3NyQWRkUE1LSURDYW5kaWRhdGVMaXN0KCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UzMiBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpckJzc0Rlc2NyaXB0aW9uICpwQnNzRGVzYywgdERvdDExZkJlYWNvbklFcyAqcEllcyApCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIHRDc3JSb2FtU2Vzc2lvbiAqcFNlc3Npb24gPSBDU1JfR0VUX1NFU1NJT04oIHBNYWMsIHNlc3Npb25JZCApOworCisgICAgaWYoIXBTZXNzaW9uKQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgIHNlc3Npb24gJWQgbm90IGZvdW5kICIpLCBzZXNzaW9uSWQpOworICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICB9CisKKyAgICBzbXNMb2cocE1hYywgTE9HVywgImNzckFkZFBNS0lEQ2FuZGlkYXRlTGlzdCBjYWxsZWQgcE1hYy0+c2Nhbi5OdW1QbWtpZENhbmRpZGF0ZSA9ICVkIiwgcFNlc3Npb24tPk51bVBta2lkQ2FuZGlkYXRlKTsKKyAgICBpZiggcEllcyApCisgICAgeworICAgICAgICAvLyBjaGVjayBpZiB0aGlzIGlzIGEgUlNOIEJTUworICAgICAgICBpZiggcEllcy0+UlNOLnByZXNlbnQgKQorICAgICAgICB7CisgICAgICAgICAgICAvLyBDaGVjayBpZiB0aGUgQlNTIGlzIGNhcGFibGUgb2YgZG9pbmcgcHJlLWF1dGhlbnRpY2F0aW9uCisgICAgICAgICAgICBpZiggcFNlc3Npb24tPk51bVBta2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ICAgICAgICAgICAgICh2X1U4X3QpZGlhZ0F1dGhUeXBlRnJvbUNTUlR5cGUocFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUuQXV0aFR5cGUpOworICAgICAgICAgICAgICAgICAgICBXTEFOX1ZPU19ESUFHX0VWRU5UX1JFUE9SVCgmc2VjRXZlbnQsIEVWRU5UX1dMQU5fU0VDVVJJVFkpOworICAgICAgICAgICAgICAgIH0KKyNlbmRpZi8vI2lmZGVmIEZFQVRVUkVfV0xBTl9ESUFHX1NVUFBPUlRfQ1NSCisKKyAgICAgICAgICAgICAgICAvLyBpZiB5ZXMsIHRoZW4gYWRkIHRvIFBNS0lEQ2FuZGlkYXRlTGlzdAorICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwU2Vzc2lvbi0+UG1raWRDYW5kaWRhdGVJbmZvW3BTZXNzaW9uLT5OdW1QbWtpZENhbmRpZGF0ZV0uQlNTSUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCc3NEZXNjLT5ic3NJZCwgV05JX0NGR19CU1NJRF9MRU4pOworICAgICAgICAgICAgICAgIC8vIEJpdCAwIG9mZmlyc3QgYnl0ZSAtIFByZUF1dGhlbnRpY2F0aW9uIENhcGFiaWxpdHkKKyAgICAgICAgICAgICAgICBpZiAoIChwSWVzLT5SU04uUlNOX0NhcFswXSA+PiAwKSAmIDB4MSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+UG1raWRDYW5kaWRhdGVJbmZvW3BTZXNzaW9uLT5OdW1QbWtpZENhbmRpZGF0ZV0ucHJlQXV0aFN1cHBvcnRlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+UG1raWRDYW5kaWRhdGVJbmZvW3BTZXNzaW9uLT5OdW1QbWtpZENhbmRpZGF0ZV0ucHJlQXV0aFN1cHBvcnRlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcFNlc3Npb24tPk51bVBta2lkQ2FuZGlkYXRlKys7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiAoc3RhdHVzKTsKK30KKworLy9UaGlzIGZ1bmN0aW9uIGNoZWNrcyB3aGV0aGVyIG5ldyBBUCBpcyBmb3VuZCBmb3IgdGhlIGN1cnJlbnQgY29ubmVjdGVkIHByb2ZpbGUKKy8vSWYgaXQgaXMgZm91bmQsIGl0IHJldHVybiB0aGUgc2Vzc2lvbklkLCBlbHNlIGl0IHJldHVybiBpbnZhbGlkIHNlc3Npb25JRAordEFOSV9VMzIgY3NyUHJvY2Vzc0JTU0Rlc2NGb3JQTUtJRExpc3QodHBBbmlTaXJHbG9iYWwgcE1hYywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpckJzc0Rlc2NyaXB0aW9uICpwQnNzRGVzYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmQmVhY29uSUVzICpwSWVzKQoreworICAgIHRBTklfVTMyIGksIGJSZXQgPSBDU1JfU0VTU0lPTl9JRF9JTlZBTElEOworICAgIHRDc3JSb2FtU2Vzc2lvbiAqcFNlc3Npb247CisgICAgdERvdDExZkJlYWNvbklFcyAqcEllc0xvY2FsID0gcEllczsKKworICAgIGlmKCBwSWVzTG9jYWwgfHwgSEFMX1NUQVRVU19TVUNDRVNTKGNzckdldFBhcnNlZEJzc0Rlc2NyaXB0aW9uSUVzKHBNYWMsIHBCc3NEZXNjLCAmcEllc0xvY2FsKSkgKQorICAgIHsKKyAgICAgICAgZm9yKCBpID0gMDsgaSA8IENTUl9ST0FNX1NFU1NJT05fTUFYOyBpKysgKQorICAgICAgICB7CisgICAgICAgICAgICBpZiggQ1NSX0lTX1NFU1NJT05fVkFMSUQoIHBNYWMsIGkgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFNlc3Npb24gPSBDU1JfR0VUX1NFU1NJT04oIHBNYWMsIGkgKTsKKyAgICAgICAgICAgICAgICBpZiggY3NySXNDb25uU3RhdGVDb25uZWN0ZWRJbmZyYSggcE1hYywgaSApICYmIAorICAgICAgICAgICAgICAgICAgICAoIGVDU1JfQVVUSF9UWVBFX1JTTiA9PSBwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS5BdXRoVHlwZSApICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmKGNzck1hdGNoQlNTVG9Db25uZWN0UHJvZmlsZShwTWFjLCAmcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUsIHBCc3NEZXNjLCBwSWVzTG9jYWwpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvL3RoaXMgbmV3IEJTUyBmaXRzIHRoZSBjdXJyZW50IHByb2ZpbGUgY29ubmVjdGVkCisgICAgICAgICAgICAgICAgICAgICAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1MoY3NyQWRkUE1LSURDYW5kaWRhdGVMaXN0KHBNYWMsIGksIHBCc3NEZXNjLCBwSWVzTG9jYWwpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBiUmV0ID0gaTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmKCAhcEllcyApCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwSWVzTG9jYWwpOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuICh0QU5JX1U4KWJSZXQ7Cit9CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fV0FQSQorZUhhbFN0YXR1cyBjc3JBZGRCS0lEQ2FuZGlkYXRlTGlzdCggdHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMzIgc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpckJzc0Rlc2NyaXB0aW9uICpwQnNzRGVzYywgdERvdDExZkJlYWNvbklFcyAqcEllcyApCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIHRDc3JSb2FtU2Vzc2lvbiAqcFNlc3Npb24gPSBDU1JfR0VUX1NFU1NJT04oIHBNYWMsIHNlc3Npb25JZCApOworCisgICAgaWYoIXBTZXNzaW9uKQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgIHNlc3Npb24gJWQgbm90IGZvdW5kICIpLCBzZXNzaW9uSWQpOworICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICB9CisKKyAgICBzbXNMb2cocE1hYywgTE9HVywgImNzckFkZEJLSURDYW5kaWRhdGVMaXN0IGNhbGxlZCBwTWFjLT5zY2FuLk51bUJraWRDYW5kaWRhdGUgPSAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+TnVtQmtpZENhbmRpZGF0ZSk7CisgICAgaWYoIHBJZXMgKQorICAgIHsKKyAgICAgICAgLy8gY2hlY2sgaWYgdGhpcyBpcyBhIFdBUEkgQlNTCisgICAgICAgIGlmKCBwSWVzLT5XQVBJLnByZXNlbnQgKQorICAgICAgICB7CisgICAgICAgICAgICAvLyBDaGVjayBpZiB0aGUgQlNTIGlzIGNhcGFibGUgb2YgZG9pbmcgcHJlLWF1dGhlbnRpY2F0aW9uCisgICAgICAgICAgICBpZiggcFNlc3Npb24tPk51bUJraWRDYW5kaWRhdGUgPCBDU1JfTUFYX0JLSURfQUxMT1dFRCApCisgICAgICAgICAgICB7CisKKyAgICAgICAgICAgICAgICAvLyBpZiB5ZXMsIHRoZW4gYWRkIHRvIEJLSURDYW5kaWRhdGVMaXN0CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBTZXNzaW9uLT5Ca2lkQ2FuZGlkYXRlSW5mb1twU2Vzc2lvbi0+TnVtQmtpZENhbmRpZGF0ZV0uQlNTSUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCc3NEZXNjLT5ic3NJZCwgV05JX0NGR19CU1NJRF9MRU4pOworICAgICAgICAgICAgICAgIGlmICggcEllcy0+V0FQSS5wcmVhdXRoICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5Ca2lkQ2FuZGlkYXRlSW5mb1twU2Vzc2lvbi0+TnVtQmtpZENhbmRpZGF0ZV0ucHJlQXV0aFN1cHBvcnRlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5Ca2lkQ2FuZGlkYXRlSW5mb1twU2Vzc2lvbi0+TnVtQmtpZENhbmRpZGF0ZV0ucHJlQXV0aFN1cHBvcnRlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5OdW1Ca2lkQ2FuZGlkYXRlKys7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiAoc3RhdHVzKTsKK30KKworLy9UaGlzIGZ1bmN0aW9uIGNoZWNrcyB3aGV0aGVyIG5ldyBBUCBpcyBmb3VuZCBmb3IgdGhlIGN1cnJlbnQgY29ubmVjdGVkIHByb2ZpbGUKKy8vaWYgc28gYWRkIHRvIEJLSURDYW5kaWRhdGVMaXN0Cit0QU5JX0JPT0xFQU4gY3NyUHJvY2Vzc0JTU0Rlc2NGb3JCS0lETGlzdCh0cEFuaVNpckdsb2JhbCBwTWFjLCB0U2lyQnNzRGVzY3JpcHRpb24gKnBCc3NEZXNjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkJlYWNvbklFcyAqcEllcykKK3sKKyAgICB0QU5JX0JPT0xFQU4gZlJDID0gRkFMU0U7CisgICAgdERvdDExZkJlYWNvbklFcyAqcEllc0xvY2FsID0gcEllczsKKyAgICB0QU5JX1UzMiBzZXNzaW9uSWQ7CisgICAgdENzclJvYW1TZXNzaW9uICpwU2Vzc2lvbjsKKworICAgIGlmKCBwSWVzTG9jYWwgfHwgSEFMX1NUQVRVU19TVUNDRVNTKGNzckdldFBhcnNlZEJzc0Rlc2NyaXB0aW9uSUVzKHBNYWMsIHBCc3NEZXNjLCAmcEllc0xvY2FsKSkgKQorICAgIHsKKyAgICAgICAgZm9yKCBzZXNzaW9uSWQgPSAwOyBzZXNzaW9uSWQgPCBDU1JfUk9BTV9TRVNTSU9OX01BWDsgc2Vzc2lvbklkKysgKQorICAgICAgICB7CisgICAgICAgICAgICBpZiggQ1NSX0lTX1NFU1NJT05fVkFMSUQoIHBNYWMsIHNlc3Npb25JZCkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBTZXNzaW9uID0gQ1NSX0dFVF9TRVNTSU9OKCBwTWFjLCBzZXNzaW9uSWQgKTsKKyAgICAgICAgICAgICAgICBpZiggY3NySXNDb25uU3RhdGVDb25uZWN0ZWRJbmZyYSggcE1hYywgc2Vzc2lvbklkICkgJiYgCisgICAgICAgICAgICAgICAgICAgIGVDU1JfQVVUSF9UWVBFX1dBUElfV0FJX0NFUlRJRklDQVRFID09IHBTZXNzaW9uLT5jb25uZWN0ZWRQcm9maWxlLkF1dGhUeXBlKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoY3NyTWF0Y2hCU1NUb0Nvbm5lY3RQcm9maWxlKHBNYWMsICZwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZSxwQnNzRGVzYywgcEllc0xvY2FsKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLy90aGlzIG5ldyBCU1MgZml0cyB0aGUgY3VycmVudCBwcm9maWxlIGNvbm5lY3RlZAorICAgICAgICAgICAgICAgICAgICAgICAgaWYoSEFMX1NUQVRVU19TVUNDRVNTKGNzckFkZEJLSURDYW5kaWRhdGVMaXN0KHBNYWMsIHNlc3Npb25JZCwgcEJzc0Rlc2MsIHBJZXNMb2NhbCkpKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZSQyA9IFRSVUU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9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MsICZwQnNzRGVzY3JpcHRpb24tPlJlc3VsdC5Cc3NEZXNjcmlwdG9yLCBwSWVzTG9jYWwsICZ0bXBTc2lkLCAmdGltZXIsIEZBTFNFICk7CisgICAgICAgIC8vQ2hlY2sgd2hldGhlciB3ZSBoYXZlIHJlYWNoIG91dCBsaW1pdCwgYnV0IGRvbid0IGxvc2UgdGhlIExGUiBjYW5kaWRhdGVzIGNhbWUgZnJvbSBGVworICAgICAgICBpZiggQ1NSX1NDQU5fSVNfT1ZFUl9CU1NfTElNSVQocE1hYykKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfUk9BTV9TQ0FOX09GRkxPQUQKKyAgICAgICAgICAgICYmICEoIGVDc3JTY2FuR2V0TGZyUmVzdWx0ID09IHJlYXNvbiApCisjZW5kaWYKKyAgICAgICAgICApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vTGltaXQgcmVhY2gKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLCBGTCgiICBCU1MgbGltaXQgcmVhY2hlZCIpKTsKKyAgICAgICAgICAgIC8vRnJlZSB0aGUgcmVzb3VyY2VzCisgICAgICAgICAgICBpZiggKHBCc3NEZXNjcmlwdGlvbi0+UmVzdWx0LnB2SWVzID09IE5VTEwpICYmIHBJZXNMb2NhbCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBJZXNMb2NhbCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjc3JGcmVlU2NhblJlc3VsdEVudHJ5KHBNYWMsIHBCc3NEZXNjcmlwdGlvbik7CisgICAgICAgICAgICAvL0NvbnRpbnVlIGJlY2F1c2UgdGhlcmUgbWF5IGJlIGR1cGxpY2F0ZWQgQlNTCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorICAgICAgICAvLyBjaGVjayBmb3IgZHVwbGljYXRlIHNjYW4gcmVzdWx0cworICAgICAgICBpZiAoICFmRHVwQnNzICkKKyAgICAgICAgewor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NhdmluZyBTU0lEIHdpdGggb2xkIG9uZSBpcyB0aGF0IGlmIEFQIGNoYW5nZXMgaXRzIFNTSUQgd2hpbGUgcmVtYWluCisgICAgICAgICAgICAgICAgLy9oaWRkZW4sIHdlIG1heSBuZXZlciBzZWUgaXQgYW5kIGFsc28gdG8gYWRkcmVzcyB0aGUgcmVxdWlyZW1lbnQgb2YgCisgICAgICAgICAgICAgICAgLy9XaGVuIHdlIHJlbW92ZSBoaWRkZW4gc3NpZCBmcm9tIHRoZSBwcm9maWxlIGkuZS4sIGZvcmdldCB0aGUgU1NJRCB2aWEgCisgICAgICAgICAgICAgICAgLy8gR1VJIHRoYXQgU1NJRCBzaG91bGRuJ3Qgc2VlIGluIHRoZSBwcm9maWxlCisgICAgICAgICAgICAgICAgaWYoICh2b3NfdGltZXJfZ2V0X3N5c3RlbV90aW1lKCkgLSB0aW1lcikgPD0gSElEREVOX1RJTUVSKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBwQnNzRGVzY3JpcHRpb24tPlJlc3VsdC50aW1lciA9IHRpbWVyOworICAgICAgICAgICAgICAgICAgIHBCc3NEZXNjcmlwdGlvbi0+UmVzdWx0LnNzSWQgPSB0bXBTc2lkOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vRmluZCBhIGdvb2QgQVAgZm9yIDExZCBpbmZvCisgICAgICAgIGlmICggY3NySXMxMWRTdXBwb3J0ZWQoIHBNYWMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIGNoZWNrIGlmIGNvdW50cnkgaW5mb3JtYXRpb24gZWxlbWVudCBpcyBwcmVzZW50CisgICAgICAgICAgICBpZiAocEllc0xvY2FsLT5Db3VudHJ5LnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY3NyQWRkVm90ZUZvckNvdW50cnlJbmZvKHBNYWMsIHBJZXNMb2NhbC0+Q291bnRyeS5jb3VudHJ5KTsKKyAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywgRkwoIjExZCBBUCBCc3NpZCAiIE1BQ19BRERSRVNTX1NUUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGNoYW49ICVkLCByc3NpID0gLSVkLCBjb3VudHJ5Q29kZSAlYyVjIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKCBwQnNzRGVzY3JpcHRpb24tPlJlc3VsdC5Cc3NEZXNjcmlwdG9yLmJzc0lkKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJzc0Rlc2NyaXB0aW9uLT5SZXN1bHQuQnNzRGVzY3JpcHRvci5jaGFubmVsSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCc3NEZXNjcmlwdGlvbi0+UmVzdWx0LkJzc0Rlc2NyaXB0b3IucnNzaSAqICgtMSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZXNMb2NhbC0+Q291bnRyeS5jb3VudHJ5WzBdLHBJZXNMb2NhbC0+Q291bnRyeS5jb3VudHJ5WzFdICk7CisgICAgICAgICAgICAgfQorCisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIC8vIGFwcGVuZCB0byBtYWluIGxpc3QKKyAgICAgICAgY3NyU2NhbkFkZFJlc3VsdChwTWFjLCBwQnNzRGVzY3JpcHRpb24sIHBJZXNMb2NhbCk7CisgICAgICAgIGlmICggKHBCc3NEZXNjcmlwdGlvbi0+UmVzdWx0LnB2SWVzID09IE5VTEwpICYmIHBJZXNMb2NhbCApCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwSWVzTG9jYWwpOworICAgICAgICB9CisgICAgfQorCisgICAgcEVudHJ5ID0gY3NyTExQZWVrSGVhZCggJnBNYWMtPnNjYW4uc2NhblJlc3VsdExpc3QsIExMX0FDQ0VTU19MT0NLICk7CisgICAgaWYgKHBFbnRyeSAmJiAwICE9IHBNYWMtPnNjYW4uc2NhblJlc3VsdENmZ0FnaW5nVGltZSkKKyAgICAgICAgY3NyU2NhblN0YXJ0UmVzdWx0Q2ZnQWdpbmdUaW1lcihwTWFjKTsKKyAgICAvL3dlIGRvbid0IG5lZWQgdG8gdXBkYXRlIENDIHdoaWxlIGNvbm5lY3RlZCB0byBhbiBBUCB3aGljaCBpcyBhZHZlcnRpc2luZyBDQyBhbHJlYWR5CisgICAgaWYgKGNzcklzMTFkU3VwcG9ydGVkKHBNYWMpKQorICAgIHsKKyAgICAgICAgdEFOSV9VMzIgaTsKKyAgICAgICAgdENzclJvYW1TZXNzaW9uICpwU2Vzc2lvbjsKKworICAgICAgICBmb3IgKGkgPSAwOyBpIDwgQ1NSX1JPQU1fU0VTU0lPTl9NQVg7IGkrKyApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChDU1JfSVNfU0VTU0lPTl9WQUxJRCggcE1hYywgaSApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTiggcE1hYywgaSApOworICAgICAgICAgICAgICAgIGlmIChjc3JJc0Nvbm5TdGF0ZUNvbm5lY3RlZChwTWFjLCBpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLCBGTCgiTm8gbmVlZCBmb3IgdXBkYXRpbmcgQ0MgaW4iCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiY29ubmVjdGVkIHN0YXRlIikpOworICAgICAgICAgICAgICAgICAgICBnb3RvIGVuZDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgY3NyRWxlY3RlZENvdW50cnlJbmZvKHBNYWMpOworICAgICAgICBjc3JMZWFybkNvdW50cnlJbmZvcm1hdGlvbiggcE1hYywgTlVMTCwgTlVMTCwgZUFO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lIFNTSUQgdmlhCisgICAgICAgICAgICAvLyBHVUkgdGhhdCBTU0lEIHNob3VsZG4ndCBzZWUgaW4gdGhlIHByb2ZpbGUKKyAgICAgICAgICAgIGlmKCh2b3NfdGltZXJfZ2V0X3N5c3RlbV90aW1lKCktdGltZXIpIDw9IEhJRERFTl9USU1FUikKKyAgICAgICAgICAgIHsgCisgICAgICAgICAgICAgIHBDc3JCc3NEZXNjcmlwdGlvbi0+UmVzdWx0LnNzSWQgPSB0bXBTc2lkOworICAgICAgICAgICAgICBwQ3NyQnNzRGVzY3JpcHRpb24tPlJlc3VsdC50aW1lciA9IHRpbWVyOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisKKyAgICByZXR1cm4oIHBDc3JCc3NEZXNjcmlwdGlvbiApOworfQorCisKKwordm9pZCBjc3JQdXJnZUNoYW5uZWxQb3dlciggdHBBbmlTaXJHbG9iYWwgcE1hYywgdERibExpbmtMaXN0ICpwQ2hhbm5lbExpc3QgKQoreworICAgIHRDc3JDaGFubmVsUG93ZXJJbmZvICpwQ2hhbm5lbFNldDsKKyAgICB0TGlzdEVsZW0gKnBFbnRyeTsKKworICAgIGNzckxMTG9jayhwQ2hhbm5lbExpc3QpOyAKKyAgICAvLyBSZW1vdmUgdGhlIGNoYW5uZWwgc2V0cyBmcm9tIHRoZSBsZWFybmVkIGxpc3QgYW5kIHB1dCB0aGVtIGluIHRoZSBmcmVlIGxpc3QKKyAgICB3aGlsZSggKCBwRW50cnkgPSBjc3JMTFJlbW92ZUhlYWQoIHBDaGFubmVsTGlzdCwgTExfQUNDRVNTX05PTE9DSyApICkgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIHBDaGFubmVsU2V0ID0gR0VUX0JBU0VfQUREUiggcEVudHJ5LCB0Q3NyQ2hhbm5lbFBvd2VySW5mbywgbGluayApOworICAgICAgICBpZiggcENoYW5uZWxTZXQgKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocENoYW5uZW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YodENzckNoYW5uZWxQb3dlckluZm8pKTsKKyAgICAgICAgaWYgKCBOVUxMICE9IHBDaGFubmVsU2V0ICkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9zZXQocENoYW5uZWxTZXQsIHNpemVvZih0Q3NyQ2hhbm5lbFBvd2VySW5mbyksIDApOworICAgICAgICAgICAgcENoYW5uZWxTZXQtPmZpcnN0Q2hhbm5lbCA9IHBDaGFubmVsSW5mby0+Zmlyc3RDaGFuTnVtOworICAgICAgICAgICAgcENoYW5uZWxTZXQtPm51bUNoYW5uZWxzID0gcENoYW5uZWxJbmZvLT5udW1DaGFubmVsczsKKworICAgICAgICAgICAgLy8gTm93IHNldCB0aGUgaW50ZXItY2hhbm5lbCBvZmZzZXQgYmFzZWQgb24gdGhlIGZyZXF1ZW5jeSBiYW5kIHRoZSBjaGFubmVsIHNldCBsaWVzIGluCisgICAgICAgICAgICBpZiggKENTUl9JU19DSEFOTkVMXzI0R0haKHBDaGFubmVsU2V0LT5maXJzdENoYW5uZWwpKSAmJgorICAgICAgICAgICAgICAgICAgICAoKHBDaGFubmVsU2V0LT5maXJzdENoYW5uZWwgKyAocENoYW5uZWxTZXQtPm51bUNoYW5uZWxzIC0gMSkpIDw9IENTUl9NQVhfMjRHSHpfQ0hBTk5FTF9OVU1CRVIpICkKKworICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBDaGFubmVsU2V0LT5pbnRlckNoYW5uZWxPZmZzZXQgPSAxOworICAgICAgICAgICAgICAgIGYyR0h6SW5mb0ZvdW5kID0gVFJVRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKCAoQ1NSX0lTX0NIQU5ORUxfNUdIWihwQ2hhbm5lbFNldC0+Zmlyc3RDaGFubmVsKSkgJiYKKyAgICAgICAgICAgICAgICAoKHBDaGFubmVsU2V0LT5maXJzdENoYW5uZWwgKyAoKHBDaGFubmVsU2V0LT5udW1DaGFubmVscyAtIDEpICogNCkpIDw9IENTUl9NQVhfNUdIel9DSEFOTkVMX05VTUJFUikgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBDaGFubmVsU2V0LT5pbnRlckNoYW5uZWxPZmZzZXQgPSA0OworICAgICAgICAgICAgICAgIGYyR0h6SW5mb0ZvdW5kID0gRkFMU0U7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dXLCBGTCgiSW52YWxpZCBDaGFubmVsICVkIFByZXNlbnQgaW4gQ291bnRyeSBJRSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgcENoYW5uZWxTZXQtPmZpcnN0Q2hhbm5lbCk7CisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBDaGFubmVsU2V0KTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcENoYW5uZWxTZXQtPnR4UG93ZXIgPSBDU1JfUk9BTV9NSU4oIHBDaGFubmVsSW5mby0+bWF4VHhQb3dlciwgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uVHhQb3dlckNhcCApOworCisgICAgICAgICAgICBpZiggZjJHSHpJbmZvRm91bmQgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKCAhZjJHTGlzdFB1cmdlZCApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvLyBwdXJnZSBwcmV2aW91cyByZXN1bHRzIGlmIGZvdW5kIG5ldworICAgICAgICAgICAgICAgICAgICBjc3JQdXJnZUNoYW5uZWxQb3dlciggcE1hYywgJnBNYWMtPnNjYW4uY2hhbm5lbFBvd2VySW5mb0xpc3QyNCApOworICAgICAgICAgICAgICAgICAgICBmMkdMaXN0UHVyZ2VkID0gVFJVRTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZihDU1JfSVNfT1BFUkFUSU5HX0JHX0JBTkQocE1hYykpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvLyBhZGQgdG8gdGhlIGxpc3Qgb2YgMi40IEdIeiBjaGFubmVsIHNldHMKKyAgICAgICAgICAgICAgICAgICAgY3NyTExJbnNlcnRUYWlsKCAmcE1hYy0+c2Nhbi5jaGFubmVsUG93ZXJJbmZvTGlzdDI0LCAmcENoYW5uZWxTZXQtPmxpbmssIExMX0FDQ0VTU19MT0NLICk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR1csIEZMKCJBZGRpbmcgMTFCL0cgY2hhbm5lbHMgaW4gMTFBIG1vZGUgLS0gRmlyc3QgQ2hhbm5lbCBpcyAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2hhbm5lbFNldC0+Zmlyc3RDaGFubmVsKTsKKyAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocENoYW5uZWxTZXQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyA1R0h6IGluZm8gZm91bmQKKyAgICAgICAgICAgICAgICBpZiggIWY1R0xpc3RQdXJnZWQgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gcHVyZ2UgcHJldmlvdXMgcmVzdWx0cyBpZiBmb3VuZCBuZXcKKyAgICAgICAgICAgICAgICAgICAgY3NyUHVyZ2VDaGFubmVsUG93ZXIoIHBNYWMsICZwTWFjLT5zY2FuLmNoYW5uZWxQb3dlckluZm9MaXN0NUcgKTsKKyAgICAgICAgICAgICAgICAgICAgZjVHTGlzdFB1cmdlZCA9IFRSVUU7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYoQ1NSX0lTX09QRVJBVElOR19BX0JBTkQocE1hYykpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvLyBhZGQgdG8gdGhlIGxpc3Qgb2YgNUdIeiBjaGFubmVsIHNldHMKKyAgICAgICAgICAgICAgICAgICAgY3NyTExJbnNlcnRUYWlsKCAmcE1hYy0+c2Nhbi5jaGFubmVsUG93ZXJJbmZvTGlzdDVHLCAmcENoYW5uZWxTZXQtPmxpbmssIExMX0FDQ0VTU19MT0NLICk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR1csIEZMKCJBZGRpbmcgMTFBIGNoYW5uZWxzIGluIEIvRyBtb2RlIC0tIEZpcnN0IENoYW5uZWwgaXMgJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENoYW5uZWxTZXQtPmZpcnN0Q2hhbm5lbCk7CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwQ2hhbm5lbFNldCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcENoYW5uZWxJbmZvKys7ICAgICAgICAgICAgICAgIC8vIG1vdmUgdG8gbmV4dCBlbnRyeQorICAgIH0KKworICAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworfQorCitzdGF0aWMgIHZvaWQgY3NyQ2xlYXJEZnNDaGFubmVsTGlzdCggdHBBbmlTaXJHbG9iYWwgcE1hYyApCit7CisgICAgdFNpck1iTXNnICpwTXNnOworICAgIHRBTklfVTE2IG1zZ0xlbjsKKworICAgIG1zZ0xlbiA9ICh0QU5JX1UxNikoc2l6ZW9mKCB0U2lyTWJNc2cgKSk7CisgICAgcE1zZyA9IHZvc19tZW1fbWFsbG9jKG1zZ0xlbik7CisgICAgaWYgKCBOVUxMICE9IHBNc2cgKQorICAgIHsKKyAgICAgICB2b3NfbWVt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FubmVsIENoYW5uZWxMaXN0OworCisgICAgaWYoIHBDaGFubmVsTGlzdC0+bnVtQ2hhbm5lbHMgKQorICAgIHsKKyAgICAgICAgZm9yKGNvdW50PTA7IGNvdW50IDwgTUFYX0NPVU5UUllfSUdOT1JFOyBjb3VudCsrKQorICAgICAgICB7CisgICAgICAgICAgICBpZih2b3NfbWVtX2NvbXBhcmUoY291bnRyeUNvZGUsIGNvdW50cnlJZ25vcmVMaXN0W2NvdW50XS5jb3VudHJ5Q29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfQ09VTlRSWV9DT0RFX0xFTikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY291bnRyeUluZGV4ID0gY291bnQ7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgdGVtcE51bUNoYW5uZWxzID0gQ1NSX01JTihwQ2hhbm5lbExpc3QtPm51bUNoYW5uZWxzLCBXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU4pOworCisgICAgICAgIGZvcihpPTA7IGkgPCB0ZW1wTnVtQ2hhbm5lbHM7IGkrKykKKyAgICAgICAgeworICAgICAgICAgICAgY2hhbm5lbElnbm9yZSA9IEZBTFNFOworICAgICAgICAgICAgaWYoIGNvdW50cnlJbmRleCAhPSAtMSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZm9yKGo9MDsgaiA8IGNvdW50cnlJZ25vcmVMaXN0W2NvdW50cnlJbmRleF0uY2hhbm5lbENvdW50OyBqKyspCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiggcENoYW5uZWxMaXN0LT5jaGFubmVsTGlzdFtpXSA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50cnlJZ25vcmVMaXN0W2NvdW50cnlJbmRleF0uY2hhbm5lbExpc3Rbal0gKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsSWdub3JlID0gVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYoIEZBTFNFID09IGNoYW5uZWxJZ25vcmUgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIENoYW5uZWxMaXN0LmNoYW5uZWxMaXN0W251bUNoYW5uZWxzXSA9IHBDaGFubmVsTGlzdC0+Y2hhbm5lbExpc3RbaV07CisgICAgICAgICAgICAgICAgbnVtQ2hhbm5lbHMrKzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBDaGFubmVsTGlzdC5udW1DaGFubmVscyA9IG51bUNoYW5uZWxzOworICAgICAgICBjc3JBcHBseVBvd2VyMkN1cnJlbnQoIHBNYWMgKTsgICAgIC8vIFN0b3JlIHRoZSBjaGFubmVsK3Bvd2VyIGluZm8gaW4gdGhlIGdsb2JhbCBwbGFjZTogQ2ZnCisgICAgICAgIGNzclNldENmZ1ZhbGlkQ2hhbm5lbExpc3QocE1hYywgQ2hhbm5lbExpc3QuY2hhbm5lbExpc3QsIENoYW5uZWxMaXN0Lm51bUNoYW5uZWxzKTsKKyAgICAgICAgLy8gZXh0ZW5kIHNjYW4gY2FwYWJpbGl0eQorICAgICAgICAvLyAgYnVpbGQgYSBzY2FuIGxpc3QgYmFzZWQgb24gdGhlIGNoYW5uZWwgbGlzdCA6IGNoYW5uZWwjICsgYWN0aXZlL3Bhc3NpdmUgc2NhbgorICAgICAgICBjc3JTZXRDZmdTY2FuQ29udHJvbExpc3QocE1hYywgY291bnRyeUNvZGUsICZDaGFubmVsTGlzdCk7CisgICAgICAgIC8qU2VuZCBtc2cgdG8gTGltIHRvIGNsZWFyIERGUyBjaGFubmVsIGxpc3QgKi8KKyAgICAgICAgY3NyQ2xlYXJEZnN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AgICAgICAgICAgICAgICAgICAocE1hYy0+c2Nhbi5iYXNlMjBNSHpDaGFubmVscy5jaGFubmVsTGlzdFtpXSA9PSAxMykpKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgicmVtb3ZpbmcgY2hhbm5lbCAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmJhc2UyME1IekNoYW5uZWxzLmNoYW5uZWxMaXN0W2ldKTsKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9CisgICAgICAgIENoYW5uZWxMaXN0LmNoYW5uZWxMaXN0W2NobmxJbmR4XSA9CisgICAgICAgICAgICAgICAgICAgIHBNYWMtPnNjYW4uYmFzZTIwTUh6Q2hhbm5lbHMuY2hhbm5lbExpc3RbaV07CisgICAgICAgIGNobmxJbmR4Kys7CisgICAgfQorICAgIGNzclNldENmZ1ZhbGlkQ2hhbm5lbExpc3QocE1hYywgQ2hhbm5lbExpc3QuY2hhbm5lbExpc3QsIGNobmxJbmR4KTsKKworfQorCit2b2lkIGNzclJlc2V0Q291bnRyeUluZm9ybWF0aW9uKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX0JPT0xFQU4gZkZvcmNlLCB0QU5JX0JPT0xFQU4gdXBkYXRlUml2YSApCit7CisgICAgaWYoIGZGb3JjZSB8fCAoY3NySXMxMWRTdXBwb3J0ZWQoIHBNYWMgKSAmJiAoIXBNYWMtPnNjYW4uZjExZEluZm9SZXNldCkpKQorICAgIHsKKworI2lmZGVmIEZFQVRVUkVfV0xBTl9ESUFHX1NVUFBPUlRfQ1NSCisgICAgeworICAgICAgICB2b3NfbG9nXzgwMl8xMWRfcGt0X3R5cGUgKnAxMWRMb2c7CisgICAgICAgIGludCBJbmRleDsKKworICAgICAgICBXTEFOX1ZPU19ESUFHX0xPR19BTExPQyhwMTFkTG9nLCB2b3NfbG9nXzgwMl8xMWRfcGt0X3R5cGUsIExPR19XTEFOXzgwMjExRF9DKTsKKyAgICAgICAgaWYocDExZExvZykKKyAgICAgICAgeworICAgICAgICAgICAgcDExZExvZy0+ZXZlbnRJZCA9IFdMQU5fODAyMTFEX0VWRU5UX1JFU0VUOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHAxMWRMb2ctPmNvdW50cnlDb2RlLCBwTWFjLT5zY2FuLmNvdW50cnlDb2RlQ3VycmVudCwgMyk7CisgICAgICAgICAgICBwMTFkTG9nLT5udW1DaGFubmVsID0gcE1hYy0+c2Nhbi5iYXNlMjBNSHpDaGFubmVscy5udW1DaGFubmVsczsKKyAgICAgICAgICAgIGlmKHAxMWRMb2ctPm51bUNoYW5uZWwgPD0gVk9TX0xPR19NQVhfTlVNX0NIQU5ORUwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHAxMWRMb2ctPkNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmJhc2UyME1IekNoYW5uZWxzLmNoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwMTFkTG9nLT5udW1DaGFubmVsKTsKKyAgICAgICAgICAgICAgICBmb3IgKEluZGV4PTA7IEluZGV4IDwgcE1hYy0+c2Nhbi5iYXNlMjBNSHpDaGFubmVscy5udW1DaGFubmVsczsgSW5kZXgrKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHAxMWRMb2ctPlR4UHdyW0luZGV4XSA9IENTUl9ST0FNX01JTiggcE1hYy0+c2Nhbi5kZWZhdWx0UG93ZXJUYWJsZVtJbmRleF0ucHdyLCBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLm5UeFBvd2VyQ2FwICk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYoIXBNYWMtPnJvYW0uY29uZmlnUGFyYW0uSXMxMWRTdXBwb3J0RW5hYmxlZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwMTFkTG9nLT5zdXBwb3J0TXVsdGlwbGVEb21haW4gPSBXTEFOXzgwMjExRF9ESVNBQkxFRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYocE1hYy0+cm9hbS5jb25maWdQYXJhbS5mRW5mb3JjZURlZmF1bHREb21haW4pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcDExZExvZy0+c3VwcG9ydE11bHRpcGxlRG9tYWluID0gV0xBTl84MDIxMURfTk9UX1NVUFBPUlRfTVVMVElfRE9NQUlOOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHAxMWRMb2ctPnN1cHBvcnRNdWx0aXBsZURvbWFpbiA9IFdMQU5fODAyMTFEX1NVUFBPUlRfTVVMVElfRE9NQUlOOworICAgICAgICAgICAgfQorICAgICAgICAgICAgV0xBTl9WT1NfRElBR19MT0dfUkVQT1JUKHAxMWRMb2cpOworICAgICAgICB9CisgICAgfQorI2VuZGlmIC8vI2lmZGVmIEZFQVRVUkVfV0xBTl9ESUFHX1NVUFBPUlRfQ1NSCisKKyAgICAgICAgY3NyUHJ1bmVDaGFubmVsTGlzdEZvck1vZGUocE1hYywgJnBNYWMtPnNjYW4uYmFzZUNoYW5uZWxzKTsKKyAgICAgICAgY3NyUHJ1bmVDaGFubmVsTGlzdEZvck1vZGUocE1hYywgJnBNYWMtPnNjYW4uYmFzZTIwTUh6Q2hhbm5lbHMpOworCisgICAgICAgIGNzclNhdmVDaGFubmVsUG93ZXJGb3JCYW5kKHBNYWMsIGVBTklfQk9PTEVBTl9GQUxTRSk7CisgICAgICAgIGNzclNhdmVDaGFubmVsUG93ZXJGb3JCYW5kKHBNYWMsIGVBTklfQk9PTEVBTl9UUlVFKTsKKyAgICA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J5Q29kZVsgMCBdID0gJzAnOworICAgICAgICBwQ291bnRyeUNvZGVbIDEgXSA9ICcwJzsKKyAgICB9CisKKyAgICAvKiBXZSd2ZSBzZWVuIHNvbWUgb2YgdGhlIEFQJ3MgaW1wcm9wZXJseSBwdXQgYSAwIGZvciB0aGUKKyAgICAgKiB0aGlyZCBjaGFyYWN0ZXIgb2YgdGhlIGNvdW50cnkgY29kZS4gc3BlYyBzYXlzIHZhbGlkIGNoYXJjdGVycyBhcmUKKyAgICAgKiAnTycgKGZvciBvdXRkb29yKSwgJ0knIGZvciBJbmRvb3IsIG9yICcgJyAoc3BhY2U7IGZvciBlaXRoZXIpLgorICAgICAqIGlmIHdlIHNlZSBhIDAgaW4gdGhpcyB0aGlyZCBjaGFyYWN0ZXIsIGxldCdzIGNoYW5nZSBpdCB0byBhICcgJy4KKyAgICAgKi8KKyAgICBpZiAoIDAgPT0gcENvdW50cnlDb2RlWyAyIF0gKQorICAgIHsKKyAgICAgICAgcENvdW50cnlDb2RlWyAyIF0gPSAnICc7CisgICAgfQorCisgICAgZm9yIChpID0gMDsgaSA8IHBNYWMtPnNjYW4uY291bnRyeUNvZGVDb3VudDsgaSsrKQorICAgIHsKKyAgICAgICAgbWF0Y2ggPSAodm9zX21lbV9jb21wYXJlKHBNYWMtPnNjYW4udm90ZXMxMWRbaV0uY291bnRyeUNvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBDb3VudHJ5Q29kZSwgMikpOworICAgICAgICBpZihtYXRjaCkKKyAgICAgICAgeworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBpZiAobWF0Y2gpCisgICAgeworICAgICAgICBwTWFjLT5zY2FuLnZvdGVzMTFkW2ldLnZvdGVzKys7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHZvc19tZW1fY29weSggcE1hYy0+c2Nhbi52b3RlczExZFtwTWFjLT5zY2FuLmNvdW50cnlDb2RlQ291bnRdLmNvdW50cnlDb2RlLAorICAgICAgICAgICAgICAgICAgICAgICBwQ291bnRyeUNvZGUsIDMgKTsKKyAgICAgICAgcE1hYy0+c2Nhbi52b3RlczExZFtwTWFjLT5zY2FuLmNvdW50cnlDb2RlQ291bnRdLnZvdGVzID0gMTsKKyAgICAgICAgcE1hYy0+c2Nhbi5jb3VudHJ5Q29kZUNvdW50Kys7CisgICAgfQorCisgICAgcmV0dXJuOworfQorCit0QU5JX0JPT0xFQU4gY3NyRWxlY3RlZENvdW50cnlJbmZvKHRwQW5pU2lyR2xvYmFsIHBNYWMpCit7CisgICAgdEFOSV9CT09MRUFOIGZSZXQgPSBGQUxTRTsKKyAgICB0QU5JX1U4IG1heFZvdGVzID0gMDsKKyAgICB0QU5JX1U4IGksIGo9MDsKKworICAgIGlmICghcE1hYy0+c2Nhbi5jb3VudHJ5Q29kZUNvdW50KQorICAgIHsKKyAgICAgICAgcmV0dXJuIGZSZXQ7CisgICAgfQorICAgIG1heFZvdGVzID0gcE1hYy0+c2Nhbi52b3RlczExZFswXS52b3RlczsKKyAgICBmUmV0ID0gVFJVRTsKKworICAgIGZvcihpID0gMTsgaSA8IHBNYWMtPnNjYW4uY291bnRyeUNvZGVDb3VudDsgaSsrKQorICAgIHsKKyAgICAgICAgLyogSWYgd2UgaGF2ZSBhIHRpZSBmb3IgbWF4IHZvdGVzIGZvciAyIGRpZmZlcmVudCBjb3VudHJ5IGNvZGVzLAorICAgICAgICAgKiBwaWNrIHJhbmRvbS53ZSBjYW4gcHV0IHNvbWUgbW9yZSBpbnRlbGxpZ2VuY2UgLSBUQkQKKyAgICAgICAgICovCisgICAgICAgIGlmIChtYXhWb3RlcyA8IHBNYWMtPnNjYW4udm90ZXMxMWRbaV0udm90ZXMpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgIiBWb3RlcyBmb3IgQ291bnRyeSAlYyVjIDogJWRcbiIsCisgICAgICAgICAgICAgICAgICAgIHBNYWMtPnNjYW4udm90ZXMxMWRbaV0uY291bnRyeUNvZGVbMF0sCisgICAgICAgICAgICAgICAgICAgIHBNYWMtPnNjYW4udm90ZXMxMWRbaV0uY291bnRyeUNvZGVbMV0sCisgICAgICAgICAgICAgICAgICAgIHBNYWMtPnNjYW4udm90ZXMxMWRbaV0udm90ZXMpOworCisgICAgICAgICAgICBtYXhWb3RlcyA9IHBNYWMtPnNjYW4udm90ZXMxMWRbaV0udm90ZXM7CisgICAgICAgICAgICBqID0gaTsKKyAgICAgICAgICAgIGZSZXQgPSBUUlVFOworICAgICAgICB9CisKKyAgICB9CisgICAgaWYgKGZSZXQpCisgICAgeworICAgICAgICB2b3NfbWVtX2NvcHkocE1hYy0+c2Nhbi5jb3VudHJ5Q29kZUVsZWN0ZWQsCisgICAgICAgICAgICBwTWFjLT5zY2FuLnZvdGVzMTFkW2pdLmNvdW50cnlDb2RlLCBXTklfQ0ZHX0NPVU5UUllfQ09ERV9MRU4pOworICAgICAgICB2b3NfbWVtX2NvcHkocE1hYy0+c2Nhbi5jb3VudHJ5Q29kZTExZCwKKyAgICAgICAgICAgIHBNYWMtPnNjYW4udm90ZXMxMWRbal0uY291bnRyeUNvZGUsIFdOSV9DRkdfQ09VTlRSWV9DT0RFX0xFTik7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAiU2VsZWN0ZWQgQ291bnRyeSBpcyAlYyVjIFdpdGggY291bnQgJWRcbiIsCisgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+c2Nhbi52b3RlczExZFtqXS5jb3VudHJ5Q29kZVswXSwKKyAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLnZvdGVzMTFkW2pdLmNvdW50cnlDb2RlWzFdLAorICAgICAgICAgICAgICAgICAgICAgIHB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VU5UUllfQ09ERV9MRU4pOworICAgICAgICAgICAgICAgIGlmKChwZlJlc3RhcnROZWVkZWQgPT0gTlVMTCkgfHwgISgqcGZSZXN0YXJ0TmVlZGVkKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vU2ltcGx5IHNldCBpdCB0byBjZmcuIElmIHdlIG5lZWQgdG8gcmVzdGFydCwgcmVzdGFydCB3aWxsIGFwcGx5IGl0IHRvIHRoZSBDRkcKKyAgICAgICAgICAgICAgICAgICAgY3NyU2V0Q2ZnQ291bnRyeUNvZGUocE1hYywgcENvdW50cnkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiAoc3RhdHVzKTsKK30KKworCisKKy8vY2FsbGVyIGFsbG9jYXRlZCBtZW1vcnkgZm9yIHBOdW1DaG4gYW5kIHBDaG5Qb3dlckluZm8KKy8vQXMgaW5wdXQsICpwTnVtQ2huIGhhcyB0aGUgc2l6ZSBvZiB0aGUgYXJyYXkgb2YgcENoblBvd2VySW5mbworLy9VcG9uIHJldHVybiwgKnBOdW1DaG4gaGFzIHRoZSBudW1iZXIgb2YgY2hhbm5lbHMgYXNzaWduZWQuCit2b2lkIGNzckdldENoYW5uZWxQb3dlckluZm8oIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHREYmxMaW5rTGlzdCAqcExpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwTnVtQ2huLCB0Q2hhbm5lbExpc3RXaXRoUG93ZXIgKnBDaG5Qb3dlckluZm8pCit7CisgICAgdExpc3RFbGVtICpwRW50cnk7CisgICAgdEFOSV9VMzIgY2huSWR4ID0gMCwgaWR4OworICAgIHRDc3JDaGFubmVsUG93ZXJJbmZvICpwQ2hhbm5lbFNldDsKKworICAgIC8vR2V0IDIuNEdoeiBmaXJzdAorICAgIHBFbnRyeSA9IGNzckxMUGVla0hlYWQoIHBMaXN0LCBMTF9BQ0NFU1NfTE9DSyApOworICAgIHdoaWxlKCBwRW50cnkgJiYgKGNobklkeCA8ICpwTnVtQ2huKSApCisgICAgeworICAgICAgICBwQ2hhbm5lbFNldCA9IEdFVF9CQVNFX0FERFIoIHBFbnRyeSwgdENzckNoYW5uZWxQb3dlckluZm8sIGxpbmsgKTsKKyAgICAgICAgaWYgKCAxICE9IHBDaGFubmVsU2V0LT5pbnRlckNoYW5uZWxPZmZzZXQgKQorICAgICAgICB7CisgICAgICAgICAgICBmb3IoIGlkeCA9IDA7IChpZHggPCBwQ2hhbm5lbFNldC0+bnVtQ2hhbm5lbHMpICYmIChjaG5JZHggPCAqcE51bUNobik7IGlkeCsrICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwQ2huUG93ZXJJbmZvW2NobklkeF0uY2hhbklkID0gKHRBTklfVTgpKHBDaGFubmVsU2V0LT5maXJzdENoYW5uZWwgKyAoIGlkeCAqIHBDaGFubmVsU2V0LT5pbnRlckNoYW5uZWxPZmZzZXQgKSk7CisgICAgICAgICAgICAgICAgcENoblBvd2VySW5mb1tjaG5JZHgrK10ucHdyID0gcENoYW5uZWxTZXQtPnR4UG93ZXI7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBmb3IoIGlkeCA9IDA7IChpZHggPCBwQ2hhbm5lbFNldC0+bnVtQ2hhbm5lbHMpICYmIChjaG5JZHggPCAqcE51bUNobik7IGlkeCsrICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwQ2huUG93ZXJJbmZvW2NobklkeF0uY2hhbklkID0gKHRBTklfVTgpKHBDaGFubmVsU2V0LT5maXJzdENoYW5uZWwgKyBpZHgpOworICAgICAgICAgICAgICAgIHBDaG5Qb3dlckluZm9bY2huSWR4KytdLnB3ciA9IHBDaGFubmVsU2V0LT50eFBvd2VyOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcEVudHJ5ID0gY3NyTExOZXh0KCBwTGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTE9DSyApOworICAgIH0KKyAgICAqcE51bUNobiA9IGNobklkeDsKKworICAgIHJldHVybiA7Cit9CisKKworCit2b2lkIGNzckFwcGx5Q291bnRyeUluZm9ybWF0aW9uKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX0JPT0xFQU4gZkZvcmNlICkKK3sKKyAgICB2X1JFR0RPTUFJTl90IGRvbWFpbklkOworICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKworICAgIGRvCisgICAgeworICAgICAgICBpZiggIWNzcklzMTFkU3VwcG9ydGVkKCBwTWFjICkgfHwgMCA9PSBwTWFjLT5zY2FuLmNoYW5uZWxPZjExZEluZm8pIGJyZWFrOworICAgICAgICBpZiggcE1hYy0+c2Nhbi5mQW1iaWd1b3VzMTFkSW5mb0ZvdW5kICkKKyAgICAgICAgeworICAgICAgICAgICAgLy8gYW1iaWd1b3VzIGluZm8gZm91bmQKKyAgICAgICAgICAgIC8vUmVzdG9yZSB0ZSBkZWZhdWx0IGRvbWFpbiBhcyB3ZWxsCisgICAgICAgICAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1MoY3NyR2V0UmVndWxhdG9yeURvbWFpbkZvckNvdW50cnkoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMsIHBNYWMtPnNjYW4uY291bnRyeUNvZGVDdXJyZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZG9tYWluSWQsIENPVU5UUllfUVVFUlkpKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmRvbWFpbklkQ3VycmVudCA9IGRvbWFpbklkOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiIGZhaWxlZCB0byBnZXQgZG9tYWluIGZyb20gY3VycmVudENvdW50cnlDb2RlICUwMlglMDJYIiksCisgICAgICAgICAgICAgICAgICAgIHBNYWMtPnNjYW4uY291bnRyeUNvZGVDdXJyZW50WzBdLCBwTWFjLT5zY2FuLmNvdW50cnlDb2RlQ3VycmVudFsxXSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjc3JSZXNldENvdW50cnlJbmZvcm1hdGlvbiggcE1hYywgZUFOSV9CT09MRUFOX0ZBTFNFLCBlQU5JX0JPT0xFQU5fVFJVRSApOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgaWYgKCBwTWFjLT5zY2FuLmYxMWRJbmZvQXBwbGllZCAmJiAhZkZvcmNlICkgYnJlYWs7CisgICAgICAgIGlmKEhBTF9TVEFUVVNfU1VDQ0VTUyhjc3JHZXRSZWd1bGF0b3J5RG9tYWluRm9yQ291bnRyeSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLCBwTWFjLT5zY2FuLmNvdW50cnlDb2RlMTFkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZkb21haW5JZCwgQ09VTlRSWV9RVUVSWSkpKQorICAgICAgICB7CisgICAgICAgICAgICAvL0NoZWNrIHdoZXRoZXIgd2UgbmVlZCB0byBlbmZvcmNlIGRlZmF1bHQgZG9tYWluCisgICAgICAgICAgICBpZiggKCAhcE1hYy0+cm9hbS5jb25maWdQYXJhbS5mRW5mb3JjZURlZmF1bHREb21haW4gKSB8fAorICAgICAgICAgICAgICAgIChwTWFjLT5zY2FuLmRvbWFpbklkQ3VycmVudCA9PSBkb21haW5JZCkgKQorICAgICAgICAgICAgeworCisjaWZkZWYgRkVBVFVSRV9XTEFOX0RJQUdfU1VQUE9SVF9DU1IKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHZvc19sb2dfODAyXzExZF9wa3RfdHlwZSAqcDExZExvZzsKKyAgICAgICAgICAgICAgICAgICAgdENoYW5uZWxMaXN0V2l0aFBvd2VyIGNoblB3ckluZm9bV05JX0NGR19WQUxJRF9DSEFOTkVMX0xJU1RfTEVOXTsKKyAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkNobkluZm8gPSBXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU4sIG5UbXA7CisKKyAgICAgICAgICAgICAgICAgICAgV0xBTl9WT1NfRElBR19MT0dfQUxMT0MocDExZExvZywgdm9zX2xvZ184MDJfMTFkX3BrdF90eXBlLCBMT0dfV0xBTl84MDIxMURfQyk7CisgICAgICAgICAgICAgICAgICAgIGlmKHAxMWRMb2cpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHAxMWRMb2ctPmV2ZW50SWQgPSBXTEFOXzgwMjExRF9FVkVOVF9DT1VOVFJZX1NFVDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwMTFkTG9nLT5jb3VudHJ5Q29kZSwgcE1hYy0+c2Nhbi5jb3VudHJ5Q29kZTExZCwgMyk7CisgICAgICAgICAgICAgICAgICAgICAgICBwMTFkTG9nLT5udW1DaGFubmVsID0gcE1hYy0+c2Nhbi5jaGFubmVsczExZC5udW1DaGFubmVsczsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHAxMWRMb2ctPm51bUNoYW5uZWwgPD0gVk9TX0xPR19NQVhfTlVNX0NIQU5ORUwpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHAxMWRMb2ctPkNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmNoYW5uZWxzMTFkLmNoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwMTFkTG9nLT5udW1DaGFubmVsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JHZXRDaGFubmVsUG93ZXJJbmZvKHBNYWMsICZwTWFjLT5zY2FuLmNoYW5uZWxQb3dlckluZm9MaXN0MjQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm5DaG5JbmZvLCBjaG5Qd3JJbmZvKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuVG1wID0gbkNobkluZm87CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbkNobkluZm8gPSBXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU4gLSBuVG1wOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNzckdldENoYW5uZWxQb3dlckluZm8ocE1hYywgJnBNYWMtPnNjYW4uY2hhbm5lbFBvd2VySW5mb0xpc3Q1RywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbkNobkluZm8sICZjaG5Qd3JJbmZvW25UbXBdKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IoblRtcCA9IDA7IG5UbXAgPCBwMTFkTG9nLT5udW1DaGFubmVsOyBuVG1wKyspCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IobkNobkluZm8gPSAwOyBuQ2huSW5mbyA8IFdOSV9DRkdfVkFMSURfQ0hBTk5FTF9MSVNUX0xFTjsgbkNobkluZm8rKykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocDExZExvZy0+Q2hhbm5lbHNbblRtcF0gPT0gY2huUHdySW5mb1tuQ2huSW5mb10uY2hhbklkKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAxMWRMb2ctPlR4UHdyW25UbXBdID0gY2huUHdySW5mb1tuQ2huSW5mb10ucHdyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYoIXBNYWMtPnJvYW0uY29uZmlnUGFyYW0uSXMxMWRTdXBwb3J0RW5hYmxlZCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwMTFkTG9nLT5zdXBwb3J0TXVsdGlwbGVEb21haW4gPSBXTEFOXzgwMjExRF9ESVNBQkxFRDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYocE1hYy0+cm9hbS5jb25maWdQYXJhbS5mRW5mb3JjZURlZmF1bHREb21haW4pCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcDExZExvZy0+c3VwcG9ydE11bHRpcGxlRG9tYWluID0gV0xBTl84MDIxMURfTk9UX1NVUFBPUlRfTVVMVElfRE9NQUlOOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAxMWRMb2ctPnN1cHBvcnRNdWx0aXBsZURvbWFpbiA9IFdMQU5fODAyMTFEX1NVUFBPUlRfTVVMVElfRE9NQUlOOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgV0xBTl9WT1NfRElBR19MT0dfUkVQT1JUKHAxMWRMb2cpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorI2VuZGlmIC8vI2lmZGVmIEZFQVRVUkVfV0xBTl9ESUFHX1NVUFBPUlRfQ1NSCisgICAgICAgICAgICAgICAgaWYocE1hYy0+c2Nhbi5kb21haW5JZEN1cnJlbnQgIT0gZG9tYWluSWQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLCBGTCgiRG9tYWluIENoYW5nZWQgT2xkICVzICglZCksIG5ldyAlcyIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NzX0RvbWFpbklkdG9TdHJpbmcocE1hYy0+c2Nhbi5kb21haW5JZEN1cnJlbnQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmRvbWFpbklkQ3VycmVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zc19Eb21haW5JZHRvU3RyaW5nKGRvbWFpbklkKSk7CisgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gV0RBX1NldFJlZ0RvbWFpbihwTWFjLCBkb21haW5JZCwgZVNJUl9UUlVFKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBlSEFMX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiICBmYWlsIHRvIHNldCByZWdJZCAlZCIpLCBkb21haW5JZCApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmRvbWFpbklkQ3VycmVudCA9IGRvbWFpbklkOworI2lmbmRlZiBDT05GSUdfRU5BQkxFX0xJTlVYX1JFRworICAgICAgICAgICAgICAgIGNzckFwcGx5Q2hhbm5lbFBvd2VyQ291bnRyeUluZm8oIHBNYWMsICZwTWFjLT5zY2FuLmJhc2UyME1IekNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnNjYW4uY291bnRyeUNvZGVDdXJyZW50LCBlQU5JX0JPT0xFQU5fVFJVRSApOworI2VuZGlmCisgICAgICAgICAgICAgICAgLy8gc3dpdGNoIHRvIGFjdGl2ZSBzY2FucyB1c2luZyB0aGlzIG5ldyBjaGFubmVsIGxpc3QKKyAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmN1clNjYW5UeXBlID0gZVNJUl9BQ1RJVkVfU0NBTjsKKyAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmYxMWRJbmZvQXBwbGllZCA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgICAgIHBNYWMtPnNjYW4uZjExZEluZm9SZXNldCA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgfSB3aGlsZSggMCApOworCisgICAgcmV0dXJuOworfQorCisKKwordEFOSV9CT09MRUFOIGNzclNhdmUxMWRDb3VudHJ5U3RyaW5nKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4ICpwQ291bnRyeUNvZGUsCisgICAgICAgICAgICAgICAgICAgICB0QU5JX0JPT0xFQU4gZkZvcmNlKQoreworICAgIHRBTklfQk9PTEVBTiBmQ291bnRyeVN0cmluZ0NoYW5nZWQgPSBGQUxTRSwgZlVua25vd25Db3VudHJ5Q29kZSA9IEZBTFNFOworICAgIHRBTklfVTMyIGk7CisgICAgdl9SRUdET01BSU5fdCByZWdkOworICAgIHRBTklfQk9PTEVBTiBmQ291bnRyeU5vdFByZXNlbnRJbkRyaXZlciA9IEZBTFNFOworCisgICAgLy8gY29udmVydCB0byBVUFBFUiBoZXJlIHNvIHdlIGFyZSBhc3N1cmVkIHRoZSBzdHJpbmdzIGFyZSBhbHdheXMgaW4gdXBwZXIgY2FzZS4KKyA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RoaXJkIGNoYXJhY3RlciwgbGV0J3MgY2hhbmdlIGl0IHRvIGEgJyAnLgorICAgIGlmICggMCA9PSBwQ291bnRyeUNvZGVbIDIgXSApCisgICAgeworICAgICAgICBwQ291bnRyeUNvZGVbIDIgXSA9ICcgJzsKKyAgICB9CisKKyAgICBpZiggIWZVbmtub3duQ291bnRyeUNvZGUgKQorICAgIHsKKyAgICAgICAgZkNvdW50cnlTdHJpbmdDaGFuZ2VkID0gKCF2b3NfbWVtX2NvbXBhcmUocE1hYy0+c2Nhbi5jb3VudHJ5Q29kZTExZCwgcENvdW50cnlDb2RlLCAyKSk7CisKKworICAgICAgICBpZigoIDAgPT0gcE1hYy0+c2Nhbi5jb3VudHJ5Q29kZTExZFsgMCBdICYmIDAgPT0gcE1hYy0+c2Nhbi5jb3VudHJ5Q29kZTExZFsgMSBdICkKKyAgICAgICAgICAgICB8fCAoZkZvcmNlKSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKCFmQ291bnRyeU5vdFByZXNlbnRJbkRyaXZlcikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyB0aGlzIGlzIHRoZSBmaXJzdCAuMTFkIGluZm9ybWF0aW9uCisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBNYWMtPnNjYW4uY291bnRyeUNvZGUxMWQsIHBDb3VudHJ5Q29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoIHBNYWMtPnNjYW4uY291bnRyeUNvZGUxMWQgKSk7CisKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmNvdW50cnlDb2RlMTFkWzBdID0gJzAnOworICAgICAgICAgICAgICAgIHBNYWMtPnNjYW4uY291bnRyeUNvZGUxMWRbMV0gPSAnMCc7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4oIGZDb3VudHJ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5ORUxfNUdIWihwTWFjLT5zY2FuLmRlZmF1bHRQb3dlclRhYmxlW0luZGV4XS5jaGFuSWQpKSkgfHwKKyAgICAgICAgICAgICAgICAoIWZQb3B1bGF0ZTVHQmFuZCAmJiAoQ1NSX0lTX0NIQU5ORUxfMjRHSFoocE1hYy0+c2Nhbi5kZWZhdWx0UG93ZXJUYWJsZVtJbmRleF0uY2hhbklkKSkpICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZihjb3VudCA+PSBXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU4pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR1csIEZMKCIgY3NyU2F2ZUNoYW5uZWxQb3dlckZvckJhbmQsIGNvdW50IGV4Y2VlZGVkLCBjb3VudCA9ICAlZCIpLCBjb3VudCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwQ2hhbkluZm8tPmZpcnN0Q2hhbk51bSA9IHBNYWMtPnNjYW4uZGVmYXVsdFBvd2VyVGFibGVbSW5kZXhdLmNoYW5JZDsKKyAgICAgICAgICAgICAgICBwQ2hhbkluZm8tPm51bUNoYW5uZWxzICA9IDE7CisgICAgICAgICAgICAgICAgcENoYW5JbmZvLT5tYXhUeFBvd2VyICAgPSBDU1JfUk9BTV9NSU4oIHBNYWMtPnNjYW4uZGVmYXVsdFBvd2VyVGFibGVbSW5kZXhdLnB3ciwgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uVHhQb3dlckNhcCApOworICAgICAgICAgICAgICAgIHBDaGFuSW5mbysrOworICAgICAgICAgICAgICAgIGNvdW50Kys7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYoY291bnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGNzclNhdmVUb0NoYW5uZWxQb3dlcjJHXzVHKCBwTWFjLCBjb3VudC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gICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvLyBlbHNlLCB3ZSBmb3VuZCBjaGFubmVsIGluZm8gaW4gdGhlIDIuNCBHSHogYmFuZC4gIElmIHRoZSA1LjAgYmFuZCBpcyBlbXB0eQorICAgICAgICAgICAgLy8gc2V0IHRoZSA1LjAgYmFuZCBpbmZvIGZyb20gdGhlIDIuNCBjb3VudHJ5IGNvZGUuCisgICAgICAgICAgICBpZiAoICFjc3JMTElzTGlzdEVtcHR5KCAmcE1hYy0+c2Nhbi5jaGFubmVsUG93ZXJJbmZvTGlzdDVHLCBMTF9BQ0NFU1NfTE9DSyApICkgYnJlYWs7CisgICAgICAgICAgICBmUG9wdWxhdGU1R0JhbmQgPSBUUlVFOworICAgICAgICB9CisgICAgICAgIGNzclNhdmVDaGFubmVsUG93ZXJGb3JCYW5kKCBwTWFjLCBmUG9wdWxhdGU1R0JhbmQgKTsKKworICAgIH0gd2hpbGUoIDAgKTsKK30KKworCit0QU5JX0JPT0xFQU4gY3NySXNTdXBwb3J0ZWRDaGFubmVsKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggY2hhbm5lbElkKQoreworICAgIHRBTklfQk9PTEVBTiBmUmV0ID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgIHRBTklfVTMyIGk7CisKKyAgICAvL01ha2Ugc3VyZSBpdCBpcyBhIGNoYW5uZWwgdGhhdCBpcyBpbiBvdXIgc3VwcG9ydGVkIGxpc3QuCisgICAgZm9yICggaSA9IDA7IGkgPCBwTWFjLT5zY2FuLmJhc2VDaGFubmVscy5udW1DaGFubmVsczsgaSsrICkKKyAgICB7CisgICAgICAgIGlmICggY2hhbm5lbElkID09IHBNYWMtPnNjYW4uYmFzZUNoYW5uZWxzLmNoYW5uZWxMaXN0W2ldICkKKyAgICAgICAgeworICAgICAgICAgICAgZlJldCA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvL0lmIGl0IGlzIGNvbmZpZ3VyZWQgdG8gbGltaXQgYSBzZXQgb2YgdGhlIGNoYW5uZWxzCisgICAgaWYoIGZSZXQgJiYgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5mRW5mb3JjZTExZENoYW5uZWxzICkKKyAgICB7CisgICAgICAgIGZSZXQgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgIGZvciAoIGkgPSAwOyBpIDwgcE1hYy0+c2Nhbi5iYXNlMjBNSHpDaGFubmVscy5udW1DaGFubmVsczsgaSsrICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKCBjaGFubmVsSWQgPT0gcE1hYy0+c2Nhbi5iYXNlMjBNSHpDaGFubmVscy5jaGFubmVsTGlzdFtpXSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZlJldCA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIChmUmV0KTsKK30KKworCisKKy8vYlNpemUgc3BlY2lmeSB0aGUgYnVmZmVyIHNpemUgb2YgcENoYW5uZWxMaXN0Cit0QU5JX1U4IGNzckdldENoYW5uZWxMaXN0RnJvbUNoYW5uZWxTZXQoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggKnBDaGFubmVsTGlzdCwgdEFOSV9VOCBiU2l6ZSwgdENzckNoYW5uZWxQb3dlckluZm8gKnBDaGFubmVsU2V0ICkKK3sKKyAgICB0QU5JX1U4IGksIGogPSAwLCBjaG5JZDsKKworICAgIGJTaXplID0gQ1NSX01JTihiU2l6ZSwgcENoYW5uZWxTZXQtPm51bUNoYW5uZWxzKTsKKyAgICBmb3IoIGkgPSAwOyBpIDwgYlNpemU7IGkrKyApCisgICAgeworICAgICAgICBjaG5JZCA9ICh0QU5JX1U4KShwQ2hhbm5lbFNldC0+Zmlyc3RDaGFubmVsICsgKCBpICogcENoYW5uZWxTZXQtPmludGVyQ2hhbm5lbE9mZnNldCApKTsKKyAgICAgICAgaWYgKCBjc3JJc1N1cHBvcnRlZENoYW5uZWwoIHBNYWMsIGNobklkICkgKQorICAgICAgICB7CisgICAgICAgICAgICBwQ2hhbm5lbExpc3RbaisrXSA9IGNobklkOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIChqKTsKK30KKworCisKKy8vYlNpemUgLS0gc3BlY2lmeSB0aGUgYnVmZmVyIHNpemUgb2YgcENoYW5uZWxMaXN0Cit2b2lkIGNzckNvbnN0cnVjdEN1cnJlbnRWYWxpZENoYW5uZWxMaXN0KCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0RGJsTGlua0xpc3QgKnBDaGFubmVsU2V0TGlzdCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBDaGFubmVsTGlzdCwgdEFOSV9VOCBiU2l6ZSwgdEFOSV9VOCAqcE51bUNoYW5uZWxzICkKK3sKKyAgICB0TGlzdEVsZW0gKnBFbnRyeTsKKyAgICB0Q3NyQ2hhbm5lbFBvd2VySW5mbyAqcENoYW5uZWxTZXQ7CisgICAgdEFOSV9VOCBudW1DaGFubmVsczsKKyAgICB0QU5JX1U4ICpwQ2hhbm5lbHM7CisKKyAgICBpZiggcENoYW5uZWxTZXRMaXN0ICYmIHBDaGFubmVsTGlzdCAmJiBwTnVtQ2hhbm5lbHMgKQorICAgIHsKKyAgICAgICAgcENoYW5uZWxzID0gcENoYW5uZWxMaXN0OworICAgICAgICAqcE51bUNoYW5uZWxzID0gMDsKKyAgICAgICAgcEVudHJ5ID0gY3NyTExQZWVrSGVhZCggcENoYW5uZWxTZXRMaXN0LCBMTF9BQ0NFU1NfTE9DSyApOworICAgICAgICB3aGlsZSggcEVudHJ5ICkKKyAgICAgICAgeworICAgICAgICAgICAgcENoYW5uZWxTZXQgPSBHRVRfQkFTRV9BRERSKCBwRW50cnksIHRDc3JDaGFubmVsUG93ZXJJbmZvLCBsaW5rICk7CisgICAgICAgICAgICBudW1DaGFubmVscyA9IGNzckdldENoYW5uZWxMaXN0RnJvbUNoYW5uZWxTZXQoIHBNYWMsIHBDaGFubmVscywgYlNpemUsIHBDaGFubmVsU2V0ICk7CisgICAgICAgICAgICBwQ2hhbm5lbHMgKz0gbnVtQ2hhbm5lbHM7CisgICAgICAgICAgICAqcE51bUNoYW5uZWxzICs9IG51bUNoYW5uZWxzOworICAgICAgICAgICAgcEVudHJ5ID0gY3NyTExOZXh0KCBwQ2hhbm5lbFNldExpc3QsIHBFbnRyeSwgTExfQUNDRVNTX0xPQ0sgKTsKKyAgICAgICAgfQorICAgIH0KK30KKworCisvKgorICAqIDgwMi4xMUQgb25seTogR2F0aGVyIDExZCBJRSB2aWEgYmVhY29uIG9yIFByb2JlIHJlc3BvbnNlIGFuZCBzdG9yZSB0aGVtIGluIHBBZGFwdGVyLT5jaGFubmVsczExZAorKi8KK3RBTklfQk9PTEVBTiBjc3JMZWFybkNvdW50cnlJbmZvcm1hdGlvbiggdHBBbmlTaXJHbG9iYWwgcE1hYywgdFNpckJzc0Rlc2NyaXB0aW9uICpwU2lyQnNzRGVzYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkJlYWNvbklFcyAqcEllcywgdEFOSV9CT09MRUFOIGZGb3JjZSkKK3sKKyAgICBlSGFsU3RhdHVzIHN0YXR1czsKKyAgICB0QU5JX1U4ICpwQ291bnRyeUNvZGVTZWxlY3RlZDsKKyAgICB0QU5JX0JPT0xFQU4gZlJldCA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICB2X1JFR0RPTUFJTl90IGRvbWFpbklkOworICAgIHREb3QxMWZCZWFjb25JRXMgKnBJZXNMb2NhbCA9IHBJZXM7CisgICAgdEFOSV9CT09MRUFOIHVzZVZvdGluZyA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKworICAgIGlmIChWT1NfU1RBX1NBUF9NT0RFID09IHZvc19nZXRfY29ucGFyYW0gKCkpCisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworCisgICAgaWYgKChOVUxMID09IHBTaXJCc3NEZXNjKSAmJiAoTlVMTCA9PSBwSWVzKSkKKyAgICAgICAgdXNlVm90aW5nID0gZUFOSV9CT09MRUFOX1RSVUU7CisKKyAgICBkbworICAgIHsKKyAgICAgICAgLy8gY2hlY2sgaWYgLjExZCBzdXBwb3J0IGlzIGVuYWJsZWQKKyAgICAgICAgaWYoICFjc3JJczExZFN1cHBvcnRlZCggcE1hYyApICkgYnJlYWs7CisKKyAgICAgICAgaWYgKGVBTklfQk9PTEVBTl9GQUxTRSA9PSB1c2VWb3RpbmcpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKCAhcEllc0xvY2FsICYmCisgICAgICAgICAgICAgICAgKCFIQUxfU1RBVFVTX1NVQ0NFU1MoY3NyR2V0UGFyc2VkQnNzRGVzY3JpcHRpb25JRXMocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2lyQnNzRGVzYywgJnBJZXNMb2NhbCkpKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIGNoZWNrIGlmIGNvdW50cnkgaW5mb3JtYXRpb24gZWxlbWVudCBpcyBwcmVzZW50CisgICAgICAgICAgICBpZighcEllc0xvY2FsLT5Db3VudHJ5LnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9ObyBjb3VudHJ5IGluZm8KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYoIEhBTF9TVEFUVVNfU1VDQ0VTUyhjc3JHZXRSZWd1bGF0b3J5RG9tYWluRm9yQ291bnRyeQorICAgICAgICAgICAgICAgIChwTWFjLCBwSWVzTG9jYWwtPkNvdW50cnkuY291bnRyeSwgJmRvbWFpbklkLAorICAgICAgICAgICAgICAgIENPVU5UUllfUVVFUlkpKSAmJgorICAgICAgICAgICAgICAgICggZG9tYWluSWQgPT0gUkVHRE9NQUlOX1dPUkxEKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSAvL3VzZVZvdGluZyA9PSBlQU5JX0JPT0xFQU5fRkFMU0UKKworICAgICAgICBpZiAoZUFOSV9CT09MRUFOX0ZBTFNFID09IHVzZVZvdGluZykKKyAgICAgICAgICAgIHBDb3VudHJ5Q29kZVNlbGVjdGVkID0gcEllc0xvY2FsLT5Db3VudHJ5LmNvdW50cnk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHBDb3VudHJ5Q29kZVNlbGVjdGVkID0gcE1hYy0+c2Nhbi5jb3VudHJ5Q29kZUVsZWN0ZWQ7CisKKyAgICAgICAgc3RhdHVzID0gY3NyR2V0UmVndWxhdG9yeURvbWFpbkZvckNvdW50cnkocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgcENvdW50cnlDb2RlU2VsZWN0ZWQsICZkb21haW5JZCwgQ09VTlRSWV9JRSk7CisgICAgICAgIGlmICggc3RhdHVzICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MgKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCIgIGZhaWwgdG8gZ2V0IHJlZ0lkICVkIiksIGRvbWFpbklkICk7CisgICAgICAgICAgICBmUmV0ID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICAvKiB1cGRhdGluZyAxMWQgQ291bnRyeSBDb2RlIHdpdGggQ291bnRyeSBjb2RlIHNlbGVjdGVkLiAqLworCisgICAgICAgIHZvc19tZW1fY29weShwTWFjLT5zY2FuLmNvdW50cnlDb2RlMTFkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ291bnRyeUNvZGVTZWxlY3RlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19DT1VOVFJZX0NPREVfTEVOKTsKKworI2lmbmRlZiBDT05GSUdfRU5BQkxFX0xJTlVYX1JFRworICAgICAgICAvLyBDaGVja2luZyBmb3IgRG9tYWluIElkIGNoYW5nZQorICAgICAgICBpZiAoIGRvbWFpbklkICE9IHBNYWMtPnNjYW4uZG9tYWluSWRDdXJyZW50ICkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBNYWMtPnNjYW4uY291bnRyeUNvZGUxMWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvdW50cnlDb2RlU2VsZWN0ZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCBwTWFjLT5zY2FuLmNvdW50cnlDb2RlMTFkICkgKTsKKyAgICAgICAgICAgIC8qIFNldCBDdXJyZW50IENvdW50cnkgY29kZSBhbmQgQ3VycmVudCBSZWd1bGF0b3J5IGRvbWFpbiAqLworICAgICAgICAgICAgc3RhdHVzID0gY3NyU2V0UmVndWxhdG9yeURvbWFpbihwTWFjLCBkb21haW5JZCwgTlVMTCk7CisgICAgICAgICAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsICJTZXQgUmVnIERvbWFpbiBGYWlsICVkIiwgc3RhdHVzKTsKKyAgICAgICAgICAgICAgICBmUmV0ID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgICAgIHJldHVybiBmUmV0OworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy9jc3JTZXRSZWd1bGF0b3J5RG9tYWluIHdpbGwgZmFpbCBpZiB0aGUgY291bnRyeSBkb2Vzbid0IGZpdCBvdXIgZG9tYWluIGNyaXRlcmlhLgorICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBNYWMtPnNjYW4uY291bnRyeUNvZGVDdXJyZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDb3VudHJ5Q29kZVNlbGVjdGVkLCBXTklfQ0ZHX0NPVU5UUllfQ09ERV9MRU4pOworICAgICAgICAgICAgLy9TaW1wbHkgc2V0IGl0IHRvIGNmZy4KKyAgICAgICAgICAgIGNzclNldENmZ0NvdW50cnlDb2RlKHBNYWMsIHBDb3VudHJ5Q29kZVNlbGVjdGVkKTsKKworICAgICAgICAgICAgLyogb3ZlcndyaXRlIHRoZSBkZWZ1YWx0IGNvdW50cnkgY29kZSAqLworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBNYWMtPnNjYW4uY291bnRyeUNvZGVEZWZhdWx0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmNvdW50cnlDb2RlQ3VycmVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19DT1VOVFJZX0NPREVfTEVOKTsKKyAgICAgICAgICAgIC8qIFNldCBDdXJyZW50IFJlZ0RvbWFpbiAqLworICAgICAgICAgICAgc3RhdHVzID0gV0RBX1NldFJlZ0RvbWFpbihwTWFjLCBkb21haW5JZCwgZVNJUl9UUlVFKTsKKyAgICAgICAgICAgIGlmICggc3RhdHVzICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgRkwoIiAgZmFpbCB0byBTZXQgcmVnSWQgJWQiKSwgZG9tYWluSWQgKTsKKyAgICAgICAgICAgICAgICBmUmV0ID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgICAgIHJldHVybiBmUmV0OworICAgICAgICAgICAgfQorICAgICAgICAgICAgIC8qIHNldCB0byBkZWZhdWx0IGRvbWFpbiBJRCAqLworICAgICAgICAgICAgcE1hYy0+c2Nhbi5kb21haW5JZEN1cnJlbnQgPSBkb21haW5JZDsKKyAgICAgICAgICAgIC8qIGdldCB0aGUgY2hhbm5lbHMgYmFzZWQgb24gbmV3IGNjICovCisgICAgICAgICAgICBzdGF0dXMgPSBjc3JJbml0R2V0Q2hhbm5lbHMoIHBNYWMgKTsKKworICAgICAgICAgICAgaWYgKCBzdGF0dXMgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiICBmYWlsIHRvIGdldCBDaGFubmVscyAiKSk7CisgICAgICAgICAgICAgICAgZlJldCA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZlJldDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyogcmVzZXQgaW5mbyBiYXNlZCBvbiBuZXcgY2MsIGFuZCB3ZSBhcmUgZG9uZSAqLworICAgICAgICAgICAgY3NyUmVzZXRDb3VudHJ5SW5mb3JtYXRpb24ocE1hYywgZUFOSV9CT09MRUFOX1RSVUUsIGVBTklfQk9PTEVBTl9UUlVFKTsKKyAgICAgICAgICAgLyogUmVndWxhdG9yeSBEb21haW4gQ2hhbmdlZCwgUHVyZ2UgT25seSBzY2FuIHJlc3VsdAorICAgICAgICAgICAgKiB3aGljaCBkb2VzIG5vdCBoYXZlIGNoYW5uZWwgbnVtYmVyIGJlbG9uZyB0byAxMWQKKyAgICAgICAgICAgICogY2hhbm5lbCBsaXN0CisgICAgICAgICAgICAqLworICAgICAgICAgICAgY3NyU2NhbkZpbHRlclJlc3VsdHMocE1hYyk7CisgICAgICAgIH0KKyNlbmRpZgorICAgICAgICBmUmV0ID0gZUFOSV9CT09MRUFOX1RSVUU7CisKKyAgICB9IHdoaWxlKCAwICk7CisKKyAgICBpZiggIXBJZXMgJiYgcEllc0xvY2FsICkKKyAgICB7CisgICAgICAgIC8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gICAgICB7CisgICAgICAgICAgICAgICAgaWYocE1hYy0+c2Nhbi5jaGFubmVsT2YxMWRJbmZvID09IHBNYWMtPnJvYW0udmFsaWRDaGFubmVsTGlzdFtpbmRleF0pCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy9jaGVjayB3aGV0aGVyIHdlIGZvdW5kIHRoZSBjaGFubmVsIGluZGV4CisgICAgICAgICAgICBpZihpbmRleCA8IGxlbikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBOb3csIGxvb2sgdGhyb3VnaCB0aGUgMTFkIGNoYW5uZWwgbGlzdCBhbmQgY3JlYXRlIGEgbGlzdCBvZiBhbGwgY2hhbm5lbHMgaW4gdGhlIDExZCBsaXN0IHRoYXQgYXJlCisgICAgICAgICAgICAgICAgLy8gTk9UIGluIHRoZSBjdXJyZW50IGNoYW5uZWwgbGlzdC4gIFRoaXMgZ2l2ZXMgdXMgYSBsaXN0IG9mIHRoZSBuZXcgY2hhbm5lbHMgdGhhdCBoYXZlIG5vdCBiZWVuCisgICAgICAgICAgICAgICAgLy8gc2Nhbm5lZC4gIFdlJ2xsIHNjYW4gdGhpcyBuZXcgbGlzdCBzbyB3ZSBoYXZlIGEgY29tcGxldGUgc2V0IG9mIHNjYW4gcmVzdWx0cyBvbiBhbGwgb2YgdGhlIGRvbWFpbiBjaGFubmVscworICAgICAgICAgICAgICAgIC8vIGluaXRpYWxseS4KKyAgICAgICAgICAgICAgICBmb3IgKCBpbmRleDExZENoYW5uZWxzID0gMDsgaW5kZXgxMWRDaGFubmVscyA8IHBNYWMtPnNjYW4uY2hhbm5lbHMxMWQubnVtQ2hhbm5lbHM7IGluZGV4MTFkQ2hhbm5lbHMrKyApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBmQ2hhbm5lbEFscmVhZHlTY2FubmVkID0gZUFOSV9CT09MRUFOX0ZBTFNFOworCisgICAgICAgICAgICAgICAgICAgIGZvciggaW5kZXhDdXJyZW50Q2hhbm5lbHMgPSAwOyBpbmRleEN1cnJlbnRDaGFubmVscyA8IGluZGV4OyBpbmRleEN1cnJlbnRDaGFubmVscysrICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCBwTWFjLT5yb2FtLnZhbGlkQ2hhbm5lbExpc3RbIGluZGV4Q3VycmVudENoYW5uZWxzIF0gPT0gcE1hYy0+c2Nhbi5jaGFubmVsczExZC5jaGFubmVsTGlzdFsgaW5kZXgxMWRDaGFubmVscyBdICkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmQ2hhbm5lbEFscmVhZHlTY2FubmVkID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoICFmQ2hhbm5lbEFscmVhZHlTY2FubmVkICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcENoYW5uZWxzWyAqcGNDaGFubmVscyBdID0gcE1hYy0+c2Nhbi5jaGFubmVsczExZC5jaGFubmVsTGlzdFsgaW5kZXgxMWRDaGFubmVscyBdOworICAgICAgICAgICAgICAgICAgICAgICAgKCAqcGNDaGFubmVscyApKys7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0vL0dldENGRworICAgIH0KKyAgICByZXR1cm4oICpwY0NoYW5uZWxzICk7Cit9CisKKworZUNzclNjYW5Db21wbGV0ZU5leHRDb21tYW5kIGNzclNjYW5HZXROZXh0Q29tbWFuZFN0YXRlKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0U21lQ21kICpwQ29tbWFuZCwgdEFOSV9CT09MRUFOI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UNzclNjYW5Mb3N0TGluazM6CisgICAgICAgICAgICBOZXh0Q29tbWFuZCA9IChmU3VjY2VzcykgPyBlQ3NyTmV4dExvc3RMaW5rU2NhbjNTdWNjZXNzIDogZUNzck5leHRMb3N0TGlua1NjYW4zRmFpbGVkOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZUNzclNjYW5Gb3JTc2lkOgorICAgICAgICAgICAgTmV4dENvbW1hbmQgPSAoZlN1Y2Nlc3MpID8gZUNzck5leHRlU2NhbkZvclNzaWRTdWNjZXNzIDogZUNzck5leHRlU2NhbkZvclNzaWRGYWlsdXJlOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZUNzclNjYW5Gb3JDYXBzQ2hhbmdlOgorICAgICAgICAgICAgTmV4dENvbW1hbmQgPSBlQ3NyTmV4dENhcENoYW5nZVNjYW5Db21wbGV0ZTsgICAgLy9kb24ndCBjYXJlIHN1Y2Nlc3Mgb3Igbm90CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlQ3NyU2NhbklkbGVTY2FuOgorICAgICAgICAgICAgTmV4dENvbW1hbmQgPSBlQ3NyTmV4dElkbGVTY2FuQ29tcGxldGU7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIE5leHRDb21tYW5kID0gZUNzck5leHRTY2FuTm90aGluZzsKKyAgICAgICAgICAgIGJyZWFrOworICAgIH0KKyAgICByZXR1cm4oIE5leHRDb21tYW5kICk7Cit9CisKKworLy9SZXR1cm4gd2hldGhlciB0aGUgcENvbW1hbmQgaXMgZmluaXNoZWQuCit0QU5JX0JPT0xFQU4gY3NySGFuZGxlU2NhbjExZDFGYWlsdXJlKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRTbWVDbWQgKnBDb21tYW5kKQoreworICAgIHRBTklfQk9PTEVBTiBmUmV0ID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgCisgICAgLy9BcHBseS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Yy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QsIExMX0FDQ0VTU19MT0NLKTsKKworICAgIGlmICggcEVudHJ5ICkKKyAgICB7CisgICAgICAgIHBDb21tYW5kID0gR0VUX0JBU0VfQUREUiggcEVudHJ5LCB0U21lQ21kLCBMaW5rICk7CisKKyAgICAgICAgLy8gSWYgdGhlIGhlYWQgb2YgdGhlIHF1ZXVlIGlzIEFjdGl2ZSBhbmQgaXQgaXMgYSBTQ0FOIGNvbW1hbmQsIHJlbW92ZQorICAgICAgICAvLyBhbmQgcHV0IHRoaXMgb24gdGhlIEZyZWUgcXVldWUuCisgICAgICAgIGlmICggZVNtZUNvbW1hbmRTY2FuID09IHBDb21tYW5kLT5jb21tYW5kICkKKyAgICAgICAgeyAgICAgCisgICAgICAgICAgICB0QU5JX1UzMiBzZXNzaW9uSWQgPSBwQ29tbWFuZC0+c2Vzc2lvbklkOworCisgICAgICAgICAgICBpZihlU0lSX1NNRV9TVUNDRVNTICE9IHBTY2FuUnNwLT5zdGF0dXNDb2RlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGZTdWNjZXNzID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vcE1hYy0+c2Nhbi50ZW1wU2NhblJlc3VsdHMgaXMgbm90IGVtcHR5IG1lYW5pbmcgdGhlIHNjYW4gZm91bmQgc29tZXRoaW5nCisgICAgICAgICAgICAgICAgLy9UaGlzIGNoZWNrIG9ubHkgdmFsaWQgaGVyZSBiZWNhdXNlIGNzclNhdmVTY2FucmVzdWx0cyBpcyBub3QgeWV0IGNhbGxlZAorICAgICAgICAgICAgICAgIGZTdWNjZXNzID0gKCFjc3JMTElzTGlzdEVtcHR5KCZwTWFjLT5zY2FuLnRlbXBTY2FuUmVzdWx0cywgTExfQUNDRVNTX0xPQ0spKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChwQ29tbWFuZC0+dS5zY2FuQ21kLmFib3J0U2NhbkluZGljYXRpb24gJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1NDQU5fQUJPUlRfRFVFX1RPX0JBTkRfQ0hBTkdFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICogU2NhbiBhYm9ydGVkIGR1ZSB0byBiYW5kIGNoYW5nZQorICAgICAgICAgICAgICAgICAqIFRoZSBzY2FuIHJlc3VsdHMgbmVlZCB0byBiZSBmbHVzaGVkCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgaWYgKHBDb21tYW5kLT51LnNjYW5DbWQuY2FsbGJhY2sKKyAgICAgICAgICAgICAgICAgICAgIT0gcE1hYy0+c2Nhbi5jYWxsYmFjazExZFNjYW5Eb25lKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsIEZMKCJGaWx0ZXJpbmcgdGhlIHNjYW4gcmVzdWx0cyBhcyB0aGUgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInJlc3VsdHMgbWF5IGJlbG9uZyB0byB3cm9uZyBiYW5kIikpOworICAgICAgICAgICAgICAgICAgICBjc3JTY2FuRmlsdGVyUmVzdWx0cyhwTWFjKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsIEZMKCIxMWRfc2Nhbl9kb25lIHdpbGwgZmx1c2ggdGhlIHNjYW4iCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIHJlc3VsdHMiKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgY3NyU2F2ZVNjYW5SZXN1bHRzKHBNYWMsIHBDb21tYW5kLT51LnNjYW5DbWQucmVhc29uKTsKKworI2lmZGVmIEZFQVRVUkVfV0xBTl9ESUFHX1NVUFBPUlRfQ1NSCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX2xvZ19zY2FuX3BrdF90eXBlICpwU2NhbkxvZyA9IE5VTEw7CisgICAgICAgICAgICAgICAgdFNjYW5SZXN1bHRIYW5kbGUgaFNjYW5SZXN1bHQ7CisgICAgICAgICAgICAgICAgdENzclNjYW5SZXN1bHRJbmZvICpwU2NhblJlc3VsdDsKKyAgICAgICAgICAgICAgICB0RG90MTFmQmVhY29uSUVzICpwSWVzOworICAgICAgICAgICAgICAgIGludCBuID0gMCwgYyA9IDA7CisKKyAgICAgICAgICAgICAgICBXTEFOX1ZPU19ESUFHX0xPR19BTExPQyhwU2NhbkxvZywgdm9zX2xvZ19zY2FuX3BrdF90eXBlLCBMT0dfV0xBTl9TQ0FOX0MpOworICAgICAgICAgICAgICAgIGlmKHBTY2FuTG9nKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoZUNzclNjYW5CZ1NjYW4gPT0gcENvbW1hbmQtPnUuc2NhbkNtZC5yZWFzb24gfHwgCisgICAgICAgICAgICAgICAgICAgICAgICBlQ3NyU2NhblByb2JlQnNzID09IHBDb21tYW5kLT51LnNjYW5DbWQucmVhc29uIHx8CisgICAgICAgICAgICAgICAgICAgICAgICBlQ3NyU2NhblNldEJHU2NhblBhcmFtID09IHBDb21tYW5kLT51LnNjYW5DbWQucmVhc29uKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwU2NhbkxvZy0+ZXZlbnRJZCA9IFdMQU5fU0NBTl9FVkVOVF9IT19TQ0FOX1JTUDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBlU0lSX1BBU1NJVkVfU0NBTiAhPSBwTWFjLT5zY2FuLmN1clNjYW5UeXBlICkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NhbkxvZy0+ZXZlbnRJZCA9IFdMQU5fU0NBTl9FVkVOVF9BQ1RJVkVfU0NBTl9SU1A7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjYW5Mb2ctPmV2ZW50SWQgPSBXTEFOX1NDQU5fRVZFTlRfUEFTU0lWRV9TQ0FOX1JTUDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZihlU0lSX1NNRV9TVUNDRVNTID09IHBTY2FuUnNwLT5zdGF0dXNDb2RlKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1MoY3NyU2NhbkdldFJlc3VsdChwTWFjLCBOVUxMLCAmaFNjYW5SZXN1bHQpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSgoKHBTY2FuUmVzdWx0ID0gY3NyU2NhblJlc3VsdEdldE5leHQocE1hYywgaFNjYW5SZXN1bHQpKSAhPSBOVUxMKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBuIDwgVk9TX0xPR19NQVhfTlVNX0JTU0lEICkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhjc3JHZXRQYXJzZWRCc3NEZXNjcmlwdGlvbklFcyhwTWFjLCAmcFNjYW5SZXN1bHQtPkJzc0Rlc2NyaXB0b3IsICZwSWVzKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgZmFpbCB0byBwYXJzZSBJRXMiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocFNjYW5Mb2ctPmJzc2lkW25dLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuUmVzdWx0LT5Cc3NEZXNjcmlwdG9yLmJzc0lkLCA2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBJZXMgJiYgcEllcy0+U1NJRC5wcmVzZW50ICYmIFZPU19MT0dfTUFYX1NTSURfU0laRSA+PSBwSWVzLT5TU0lELm51bV9zc2lkKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwU2NhbkxvZy0+c3NpZFtuXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllcy0+U1NJRC5zc2lkLCBwSWVzLT5TU0lELm51bV9zc2lkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwSWVzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG4rKzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjKys7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuTG9nLT5udW1Tc2lkID0gKHZfVThfdCluOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuTG9nLT50b3RhbFNzaWQgPSAodl9VOF90KWM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyU2NhblJlc3VsdFB1cmdlKHBNYWMsIGhTY2FuUmVzdWx0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuTG9nLT5zdGF0dXMgPSBXTEFOX1NDQU5fU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgV0xBTl9WT1NfRElBR19MT0dfUkVQT1JUKHBTY2FuTG9nKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisjZW5kaWYgLy8jaWZkZWYgRkVBVFVSRV9XTEFOX0RJQUdfU1VQUE9SVF9DU1IKKworICAgICAgICAgICAgTmV4dENvbW1hbmQgPSBjc3JTY2FuR2V0TmV4dENvbW1hbmRTdGF0ZShwTWFjLCBwQ29tbWFuZCwgZlN1Y2Nlc3MpOworICAgICAgICAgICAgLy9XZSByZXVzZSB0aGUgY29tbWFuZCBoZXJlIGluc3RlYWQgcmVpc3N1ZSBhIG5ldyBjb21tYW5kCisgICAgICAgICAgICBzd2l0Y2goTmV4dENvbW1hbmQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICBjYXNlIGVDc3JOZXh0MTFkU2NhbjFTdWNjZXNzOgorICAgICAgICAgICAgY2FzZSBlQ3NyTmV4dDExZFNjYW4yU3VjY2VzczoKKyAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPRzIsIEZMKCIxMWRTY2FuMS8zIHByb2R1Y2VkIHJlc3VsdHMuICBSZWlzc3VlIEFjdGl2ZSBzY2FuLi4uIikpOworICAgICAgICAgICAgICAgIC8vIGlmIHdlIGZvdW5kIGNvdW50cnkgaW5mb3JtYXRpb24sIG5vIG5lZWQgdG8gY29udGludWUgc2Nhbm5pbmcgZnVydGhlciwgYmFpbCBvdXQKKyAgICAgICAgICAgICAgICBmUmVtb3ZlQ29tbWFuZCA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgICAgIE5leHRDb21tYW5kID0gZUNzck5leHQxMWRTY2FuQ29tcGxldGU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDc3JOZXh0MTFkU2NhbjFGYWlsdXJlOgorICAgICAgICAgICAgICAgIC8vV2UgYXJlIG5vdCBkb25lIHlldC4gMTFkIHNjYW4gZmFpbCBvbmNlLiBXZSB3aWxsIHRyeSB0byByZXNldCBhbnl0aGluZyBhbmQgZG8gaXQgb3ZlciBhZ2FpbgorICAgICAgICAgICAgICAgIC8vVGhlIG9ubHkgbWVhbmluZ2Z1bCB0aGluZyBmb3IgdGhpcyByZXRyeSBpcyB0aGF0IHdlIGNhbm5vdCBmaW5kIDExZCBpbmZvcm1hdGlvbiBhZnRlciBhIHJlc2V0IHNvCisgICAgICAgICAgICAgICAgLy93ZSBjbGVhciB0aGUgIm9sZCIgMTFkIGluZm8gYW5kIGdpdmUgaXQgb25jZSBtb3JlIGNoYW5jZQorICAgICAgICAgICAgICAgIGZSZW1vdmVDb21tYW5kID0gY3NySGFuZGxlU2NhbjExZDFGYWlsdXJlKHBNYWMsIHBDb21tYW5kKTsKKyAgICAgICAgICAgICAgICBpZihmUmVtb3ZlQ29tbWFuZCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIE5leHRDb21tYW5kID0gZUNzck5leHQxMWRTY2FuQ29tcGxldGU7CisgICAgICAgICAgICAgICAgfSAKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNzck5leHRMb3N0TGlua1NjYW4xU3VjY2VzczoKKyAgICAgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKGNzcklzc3VlUm9hbUFmdGVyTG9zdGxpbmtTY2FuKHBNYWMsIHNlc3Npb25JZCwgZUNzckxvc3RMaW5rMSkpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY3NyU2NhbkhhbmRsZUZhaWxlZExvc3RsaW5rMShwTWFjLCBzZXNzaW9uSWQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNzck5leHRMb3N0TGlua1NjYW4yU3VjY2VzczoKKyAgICAgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKGNzcklzc3VlUm9hbUFmdGVyTG9zdGxpbmtTY2FuKHBNYWMsIHNlc3Npb25JZCwgZUNzckxvc3RMaW5rMikpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY3NyU2NhbkhhbmRsZUZhaWxlZExvc3RsaW5rMihwTWFjLCBzZXNzaW9uSWQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNzck5leHRMb3N0TGlua1NjYW4zU3VjY2VzczoKKyAgICAgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKGNzcklzc3VlUm9hbUFmdGVyTG9zdGxpbmtTY2FuKHBNYWMsIHNlc3Npb25JZCwgZUNzckxvc3RMaW5rMykpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY3NyU2NhbkhhbmRsZUZhaWxlZExvc3RsaW5rMyhwTWFjLCBzZXNzaW9uSWQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNzck5leHRMb3N0TGlua1NjYW4xRmFpbGVkOgorICAgICAgICAgICAgICAgIGNzclNjYW5IYW5kbGVGYWlsZWRMb3N0bGluazEocE1hYywgc2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNzck5leHRMb3N0TGlua1NjYW4yRmFpbGVkOgorICAgICAgICAgICAgICAgIGNzclNjYW5IYW5kbGVGYWlsZWRMb3N0bGluazIocE1hYywgc2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNzck5leHRMb3N0TGlua1NjYW4zRmFpbGVkOgorICAgICAgICAgICAgICAgIGNzclNjYW5IYW5kbGVGYWlsZWRMb3N0bGluazMocE1hYywgc2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICBicmVhazsgICAgCisgICAgICAgICAgICBjYXNlIGVDc3JOZXh0ZVNjYW5Gb3JTc2lkU3VjY2VzczoKKyAgICAgICAgICAgICAgICBjc3JTY2FuSGFuZGxlU2VhcmNoRm9yU1NJRChwTWFjLCBwQ29tbWFuZCk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDc3JOZXh0ZVNjYW5Gb3JTc2lkRmFpbHVyZToKKyAgICAgICAgICAgICAgICBjc3JTY2FuSGFuZGxlU2VhcmNoRm9yU1NJREZhaWx1cmUocE1hYywgcENvbW1hbmQpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBlQ3NyTmV4dElkbGVTY2FuQ29tcGxldGU6CisgICAgICAgICAgICAgICAgcE1hYy0+c2Nhbi5mUmVzdGFydElkbGVTY2FuID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDc3JOZXh0Q2FwQ2hhbmdlU2NhbkNvbXBsZXRlOgorICAgICAgICAgICAgICAgIGNzclNjYW5IYW5kbGVDYXBDaGFuZ2VTY2FuQ29tcGxldGUocE1hYywgc2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HVywgRkwoIlNjYW4gQ29tcGxldGlvbiBjYWxsZWQgYnV0IFNDQU4gY29tbWFuZCBpcyBub3QgQUNUSVZFIC4uLiIpKTsKKyAgICAgICAgICAgIGZSZW1vdmVDb21tYW5kID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHNtc0xvZyggcE1hYywgTE9HVywgRkwoIlNjYW4gQ29tcGxldGlvbiBjYWxsZWQgYnV0IE5PIGNvbW1hbmRzIGFyZSBBQ1RJVkUgLi4uIikpOworICAgICAgICBmUmVtb3ZlQ29tbWFuZCA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICB9CisgICAKKyAgICByZXR1cm4oIGZSZW1vdmVDb21tYW5kICk7Cit9CisKKworCitzdGF0aWMgdm9pZCBjc3JTY2FuUmVtb3ZlRHVwQnNzRGVzY3JpcHRpb25Gcm9tSW50ZXJpbUxpc3QoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyQnNzRGVzY3JpcHRpb24gKnBTaXJCc3NEZXNjciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkJlYWNvbklFcyAqcEllcykKK3sKKyAgICB0TGlzdEVsZW0gKnBFbnRyeTsKKyAgICB0Q3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ICAgIGlmIChwQ2FwMS0+ZXNzICYmIAorICAgICAgICAgICAgICAgIGNzcklzTWFjQWRkcmVzc0VxdWFsKCBwTWFjLCAodENzckJzc2lkICopcFNpckJzc0Rlc2MxLT5ic3NJZCwgKHRDc3JCc3NpZCAqKXBTaXJCc3NEZXNjMi0+YnNzSWQpJiYKKyAgICAgICAgICAgIChmRm9yY2VkIHx8ICh2b3NfY2hhbl90b19iYW5kKHBTaXJCc3NEZXNjMS0+Y2hhbm5lbElkKSA9PSB2b3NfY2hhbl90b19iYW5kKChwU2lyQnNzRGVzYzItPmNoYW5uZWxJZCkpKSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGZNYXRjaCA9IFRSVUU7CisgICAgICAgICAgICAvLyBDaGVjayBmb3IgU1NJRCBtYXRjaCwgaWYgZXhpc3RzCisgICAgICAgICAgICBkbworICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1MoY3NyR2V0UGFyc2VkQnNzRGVzY3JpcHRpb25JRXMocE1hYywgcFNpckJzc0Rlc2MxLCAmcEllczEpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiggTlVMTCA9PSBwSWVzVGVtcCApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKGNzckdldFBhcnNlZEJzc0Rlc2NyaXB0aW9uSUVzKHBNYWMsIHBTaXJCc3NEZXNjMiwgJnBJZXNUZW1wKSkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmKHBJZXMxLT5TU0lELnByZXNlbnQgJiYgcEllc1RlbXAtPlNTSUQucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGZNYXRjaCA9IGNzcklzU3NpZE1hdGNoKHBNYWMsIHBJZXMxLT5TU0lELnNzaWQsIHBJZXMxLT5TU0lELm51bV9zc2lkLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllc1RlbXAtPlNTSUQuc3NpZCwgcEllc1RlbXAtPlNTSUQubnVtX3NzaWQsIGVBTklfQk9PTEVBTl9UUlVFKTsKKyAgICAgICAgICAgICAgICB9IAorICAgICAgICAgICAgfXdoaWxlKDApOworCisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocENhcDEtPmlic3MgJiYgKHBTaXJCc3NEZXNjMS0+Y2hhbm5lbElkID09IHBTaXJCc3NEZXNjMi0+Y2hhbm5lbElkKSkKKyAgICAgICAgeworCisgICAgICAgICAgICBkbworICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1MoY3NyR2V0UGFyc2VkQnNzRGVzY3JpcHRpb25JRXMocE1hYywgcFNpckJzc0Rlc2MxLCAmcEllczEpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiggTlVMTCA9PSBwSWVzVGVtcCApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKGNzckdldFBhcnNlZEJzc0Rlc2NyaXB0aW9uSUVzKHBNYWMsIHBTaXJCc3NEZXNjMiwgJnBJZXNUZW1wKSkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8vU2FtZSBjaGFubmVsIGNhbm5vdCBoYXZlIHNhbWUgU1NJRCBmb3IgZGlmZmVyZW50IElCU1MKKyAgICAgICAgICAgICAgICBpZihwSWVzMS0+U1NJRC5wcmVzZW50ICYmIHBJZXNUZW1wLT5TU0lELnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBmTWF0Y2ggPSBjc3JJc1NzaWRNYXRjaChwTWFjLCBwSWVzMS0+U1NJRC5zc2lkLCBwSWVzMS0+U1NJRC5udW1fc3NpZCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZXNUZW1wLT5TU0lELnNzaWQsIHBJZXNUZW1wLT5TU0lELm51bV9zc2lkLCBlQU5JX0JPT0xFQU5fVFJVRSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfXdoaWxlKDApOworICAgICAgICB9CisgICAgICAgIC8qIEluIGNhc2Ugb2YgUDJQIGRldmljZXMsIGVzcyBhbmQgaWJzcyB3aWxsIGJlIHNldCB0byB6ZXJvICovCisgICAgICAgIGVsc2UgaWYgKCFwQ2FwMS0+ZXNzICYmIAorICAgICAgICAgICAgICAgIGNzcklzTWFjQWRkcmVzc0VxdWFsKCBwTWFjLCAodENzckJzc2lkICopcFNpckJzc0Rlc2MxLT5ic3NJZCwgKHRDc3JCc3NpZCAqKXBTaXJCc3NEZXNjMi0+YnNzSWQpKQorICAgICAgICB7CisgICAgICAgICAgICBmTWF0Y2ggPSBUUlVFOworICAgICAgICB9CisgICAgfQorCisgICAgaWYocEllczEpCisgICAgeworICAgICAgICB2b3NfbWVtX2ZyZWUocEllczEpOworICAgIH0KKyAgICAKKyAgICBpZiggKE5VTEwgPT0gcEllczIpICYmIHBJZXNUZW1wICkKKyAgICB7CisgICAgICAgIC8vbG9jYWxseSBhbGxvY2F0ZWQKKyAgICAgICAgdm9zX21lbV9mcmVlKHBJZXNUZW1wKTsKKyAgICB9CisKKyAgICByZXR1cm4oIGZNYXRjaCApOworfQorCisKK3RBTklfQk9PTEVBTiBjc3JJc05ldHdv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ICBicmVhazsKKyAgICAgICAgY2FzZSBlQ1NSX0RPVDExX01PREVfMTFnX09OTFk6CisgICAgICAgICAgICBmQWxsb3dlZCA9ICh0QU5JX0JPT0xFQU4pKGVDU1JfRE9UMTFfTU9ERV8xMWcgPT0gcGh5TW9kZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlQ1NSX0RPVDExX01PREVfMTFhOgorICAgICAgICAgICAgZkFsbG93ZWQgPSAodEFOSV9CT09MRUFOKSgoZUNTUl9ET1QxMV9NT0RFXzExYiAhPSBwaHlNb2RlKSAmJiAoZUNTUl9ET1QxMV9NT0RFXzExZyAhPSBwaHlNb2RlKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlQ1NSX0RPVDExX01PREVfMTFuX09OTFk6CisgICAgICAgICAgICBmQWxsb3dlZCA9ICh0QU5JX0JPT0xFQU4pKChlQ1NSX0RPVDExX01PREVfMTFuID09IHBoeU1vZGUpIHx8IChlQ1NSX0RPVDExX01PREVfVEFVUlVTID09IHBoeU1vZGUpKTsKKyAgICAgICAgICAgIGJyZWFrOworCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExQUMKKyAgICAgICAgIGNhc2UgZUNTUl9ET1QxMV9NT0RFXzExYWNfT05MWToKKyAgICAgICAgICAgICBmQWxsb3dlZCA9ICh0QU5JX0JPT0xFQU4pKChlQ1NSX0RPVDExX01PREVfMTFhYyA9PSBwaHlNb2RlKSB8fCAoZUNTUl9ET1QxMV9NT0RFX1RBVVJVUyA9PSBwaHlNb2RlKSk7CisgICAgICAgICAgICAgYnJlYWs7CisjZW5kaWYKKyAgICAgICAgY2FzZSBlQ1NSX0RPVDExX01PREVfMTFiX09OTFk6CisgICAgICAgICAgICBmQWxsb3dlZCA9ICh0QU5JX0JPT0xFQU4pKGVDU1JfRE9UMTFfTU9ERV8xMWIgPT0gcGh5TW9kZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlQ1NSX0RPVDExX01PREVfMTFhX09OTFk6CisgICAgICAgICAgICBmQWxsb3dlZCA9ICh0QU5JX0JPT0xFQU4pKGVDU1JfRE9UMTFfTU9ERV8xMWEgPT0gcGh5TW9kZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlQ1NSX0RPVDExX01PREVfMTFuOgorI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisgICAgICAgIGNhc2UgZUNTUl9ET1QxMV9NT0RFXzExYWM6CisjZW5kaWYKKyAgICAgICAgY2FzZSBlQ1NSX0RPVDExX01PREVfVEFVUlVTOgorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgZkFsbG93ZWQgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIChmQWxsb3dlZCk7Cit9CisKKworCisvL1JldHVybiBwSWVzIHRvIGNhbGxlciBmb3IgZnV0dXJlIHVzZSB3aGVuIHJldHVybmluZyBUUlVFLgorc3RhdGljIHRBTklfQk9PTEVBTiBjc3JTY2FuVmFsaWRhdGVTY2FuUmVzdWx0KCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4ICpwQ2hhbm5lbHMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IG51bUNobiwgdFNpckJzc0Rlc2NyaXB0aW9uICpwQnNzRGVzYywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZCZWFjb25JRXMgKipwcEllcyApCit7CisgICAgdEFOSV9CT09MRUFOIGZWYWxpZENoYW5uZWwgPSBGQUxTRTsKKyAgICB0RG90MTFmQmVhY29uSUVzICpwSWVzID0gTlVMTDsKKyAgICB0QU5JX1U4IGluZGV4OworCisgICAgZm9yKCBpbmRleCA9IDA7IGluZGV4IDwgbnVtQ2huOyBpbmRleCsrICkKKyAgICB7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mKCBmVmFsaWRDaGFubmVsICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAqcHBJZXMgPSBwSWVzOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwSWVzKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIGZWYWxpZENoYW5uZWwgPSBGQUxTRTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiggZlZhbGlkQ2hhbm5lbCApOyAgIAorfQorCisKKy8vUmV0dXJuIHdoZXRoZXIgbGFzdCBzY2FuIHJlc3VsdCBpcyByZWNlaXZlZAorc3RhdGljIHRBTklfQk9PTEVBTiBjc3JTY2FuUHJvY2Vzc1NjYW5SZXN1bHRzKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0U21lQ21kICpwQ29tbWFuZCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyU21lU2NhblJzcCAqcFNjYW5Sc3AsIHRBTklfQk9PTEVBTiAqcGZSZW1vdmVDb21tYW5kICkKK3sKKyAgICB0QU5JX0JPT0xFQU4gZlJldCA9IGVBTklfQk9PTEVBTl9GQUxTRSwgZlJlbW92ZUNvbW1hbmQgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgdERvdDExZkJlYWNvbklFcyAqcEllcyA9IE5VTEw7CisgICAgdEFOSV9VMzIgY2JQYXJzZWQ7CisgICAgdFNpckJzc0Rlc2NyaXB0aW9uICpwU2lyQnNzRGVzY3JpcHRpb247CisgICAgdEFOSV9VMzIgY2JCc3NEZXNjOworICAgIHRBTklfVTMyIGNiU2NhblJlc3VsdCA9IEdFVF9GSUVMRF9PRkZTRVQoIHRTaXJTbWVTY2FuUnNwLCBic3NEZXNjcmlwdGlvbiApIAorICAgICAgICAgICAgICAgICAgICAgICA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gICAgICAgaWYoIGVDc3JTY2FuR2V0TGZyUmVzdWx0ID09IHBDb21tYW5kLT51LnNjYW5DbWQucmVhc29uICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwQ2hhbm5lbExpc3QgPSBOVUxMOworICAgICAgICAgICAgICAgIGNDaGFubmVscyA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisjZW5kaWYKKyAgICAgICAgICAgIGlmKCBlQ3NyU2NhblNldEJHU2NhblBhcmFtID09IHBDb21tYW5kLT51LnNjYW5DbWQucmVhc29uICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvL2VDc3JTY2FuU2V0QkdTY2FuUGFyYW0gdXNlcyBkaWZmZXJlbnQgc3RydWN0dXJlCisgICAgICAgICAgICAgICAgdENzckJHU2NhblJlcXVlc3QgKnBCZ1NjYW5SZXEgPSAmcENvbW1hbmQtPnUuc2NhbkNtZC51LmJnU2NhblJlcXVlc3Q7CisKKyAgICAgICAgICAgICAgICBjQ2hhbm5lbHMgPSBwQmdTY2FuUmVxLT5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzOworICAgICAgICAgICAgICAgIHBDaGFubmVsTGlzdCA9IHBCZ1NjYW5SZXEtPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0OworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vdGhlIHJlc3QgdXNlIGdlbmVyaWMgc2NhbiByZXF1ZXN0CisgICAgICAgICAgICAgICAgY0NoYW5uZWxzID0gcENvbW1hbmQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHM7CisgICAgICAgICAgICAgICAgcENoYW5uZWxMaXN0ID0gcENvbW1hbmQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0OworICAgICAgICAgIC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KyAgICAgICAgICAgICAgICBpZiAoSEFMX1NUQVRVU19TVUNDRVNTKGNzckdldENmZ1ZhbGlkQ2hhbm5lbHMocE1hYywgKHRBTklfVTggKilwTWFjLT5yb2FtLnZhbGlkQ2hhbm5lbExpc3QsICZsZW4pKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBDaGFubmVsTGlzdCA9IHBNYWMtPnJvYW0udmFsaWRDaGFubmVsTGlzdDsKKyAgICAgICAgICAgICAgICAgICAgY0NoYW5uZWxzID0gKHRBTklfVTgpbGVuOyAKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy9DYW5ub3QgY29udGludWUKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAiQ1NSOiBQcm9jZXNzaW5nIGludGVybmFsIFNDQU4gcmVzdWx0cy4uLmNzckdldENmZ1ZhbGlkQ2hhbm5lbHMgZmFpbGVkIiApOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HMiwgIkNTUjogUHJvY2Vzc2luZyBpbnRlcm5hbCBTQ0FOIHJlc3VsdHMuLi4iICk7CisgICAgICAgICAgICBjYlBhcnNlZCA9IEdFVF9GSUVMRF9PRkZTRVQoIHRTaXJTbWVTY2FuUnNwLCBic3NEZXNjcmlwdGlvbiApOworICAgICAgICAgICAgcFNpckJzc0Rlc2NyaXB0aW9uID0gcFNjYW5Sc3AtPmJzc0Rlc2NyaXB0aW9uOworICAgICAgICAgICAgd2hpbGUoIGNiUGFyc2VkIDwgcFNjYW5Sc3AtPmxlbmd0aCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKCBjc3JTY2FuVmFsaWRhdGVTY2FuUmVzdWx0KCBwTWFjLCBwQ2hhbm5lbExpc3QsIGNDaGFubmVscywgcFNpckJzc0Rlc2NyaXB0aW9uLCAmcEllcyApICkgCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBjc3JTY2FuUmVtb3ZlRHVwQnNzRGVzY3JpcHRpb25Gcm9tSW50ZXJpbUxpc3QocE1hYywgcFNpckJzc0Rlc2NyaXB0aW9uLCBwSWVzKTsKKyAgICAgICAgICAgICAgICAgICAgY3NyU2NhblNhdmVCc3NEZXNjcmlwdGlvblRvSW50ZXJpbUxpc3QoIHBNYWMsIHBTaXJCc3NEZXNjcmlwdGlvbiwgcEllcyApOworICAgICAgICAgICAgICAgICAgICBpZiggZVNJUl9QQVNTSVZFX1NDQU4gPT0gcE1hYy0+c2Nhbi5jdXJTY2FuVHlwZSApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBjc3JJczExZFN1cHBvcnRlZCggcE1hYykgKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vQ2hlY2sgd2hldGhlciB0aGUgQlNTIGlzIGFjY2VwdGFibGUgYmFzZSBvbiAxMWQgaW5mbyBhbmQgb3VyIGNvbmZpZ3MuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIGNzck1hdGNoQ291bnRyeUNvZGUoIHBNYWMsIE5VTEwsIHBJZXMgKSApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0RvdWJsZSBjaGVjayB3aGV0aGVyIHRoZSBjaGFubmVsIGlzIGFjY2VwdGFibGUgYnkgdXMuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBjc3JJc1N1cHBvcnRlZENoYW5uZWwoIHBNYWMsIHBTaXJCc3NEZXNjcmlwdGlvbi0+Y2hhbm5lbElkICkgKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmN1clNjYW5UeXBlID0gZVNJUl9BQ1RJVkVfU0NBTjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmN1clNjYW5UeXBlID0gZVNJUl9BQ1RJVkVfU0NBTjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvL0ZyZWUgdGhlIHJlc291cmNlCisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwSWVzKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLy8gc2tpcCBvdmVyIHRoZSBCU1MgZGVzY3JpcHRpb24gdG8gdGhlIG5leHQgb25lLi4uCisgICAgICAgICAgICAgICAgY2JCc3NEZXNjID0gcFNpckJzc0Rlc2NyaXB0aW9uLT5sZW5ndGggKyBzaXplb2YoIHBTaXJCc3NEZXNjcmlwdGlvbi0+bGVuZ3RoICk7CisKKyAgICAgICAgICAgICAgICBjYlBhcnNlZCArPSBjYkJzc0Rlc2M7CisgICAgICAgICAgICAgICAgcFNpckJzc0Rlc2NyaXB0aW9uID0gKHRTaXJCc3NEZXNjcmlwdGlvbiAqKSgodEFOSV9VOCAqKXBTaXJCc3NEZXNjcmlwdGlvbiArIGNiQnNzRGVzYyApOworCisgICAgICAgICAgICB9IC8vd2hpbGUKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HVywgIiBTY2FucnNwIGZhaWwgKDB4JTA4WCksIGxlb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cmlnZ2VyZWQgYnkgTEZSIChPUikKKyAgICAgICAgICogYW55IHNjYW4gaWYgTEZSIGlzIGluIHRoZSBtaWRkbGUgb2YgYSBCRyBzY2FuLiBTcGxpdHRpbmcKKyAgICAgICAgICogdGhlIHNjYW4gaXMgZGVsYXlpbmcgdGhlIHRpbWUgaXQgdGFrZXMgZm9yIExGUiB0byBmaW5kCisgICAgICAgICAqIGNhbmRpZGF0ZXMgYW5kIHJlc3VsdGluZyBpbiBkaXNjb25uZWN0cy4KKyAgICAgICAgICovCisgICAgICAgIGlmICggKGNzcklzU3RhU2Vzc2lvbkNvbm5lY3RlZChwTWFjKSAmJgorI2lmZGVmIEZFQVRVUkVfV0xBTl9MRlIKKyAgICAgICAgICAgICAgICAgICAgKGNzcklzQ29uY3VycmVudEluZnJhQ29ubmVjdGVkKHBNYWMpIHx8CisgICAgICAgICAgICAgICAgICAgICAoKHBDb21tYW5kLT51LnNjYW5DbWQucmVhc29uICE9IGVDc3JTY2FuQmdTY2FuKSAmJgorICAgICAgICAgICAgICAgICAgICAgIChwTWFjLT5yb2FtLm5laWdoYm9yUm9hbUluZm8ubmVpZ2hib3JSb2FtU3RhdGUgIT0KKyAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ORUlHSEJPUl9ST0FNX1NUQVRFX0NGR19DSEFOX0xJU1RfU0NBTikpKSAmJgorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgIChwQ29tbWFuZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QucDJwU2VhcmNoICE9IDEpKSB8fAorICAgICAgICAgICAgICAgIChjc3JJc1AycFNlc3Npb25Db25uZWN0ZWQocE1hYykpICkKKyAgICAgICAgeworICAgICAgICAgICAgLyogaWYgYWN0aXZlIGNvbm5lY3RlZCBzZXNzaW9ucyBwcmVzZW50IHRoZW4gY29udGludWUgdG8gc3BsaXQgc2NhbgorICAgICAgICAgICAgICogd2l0aCBzcGVjaWZpZWQgaW50ZXJ2YWwgYmV0d2VlbiBjb25zZWN1dGl2ZSBzY2FucyAqLworICAgICAgICAgICAgY3NyU2V0RGVmYXVsdFNjYW5UaW1pbmcocE1hYywgcENvbW1hbmQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LnNjYW5UeXBlLCAmKHBDb21tYW5kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdCkpOworICAgICAgICAgICAgdm9zX3RpbWVyX3N0YXJ0KCZwTWFjLT5zY2FuLmhUaW1lclN0YUFwQ29uY1RpbWVyLAorICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdC5yZXN0VGltZSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvKiBpZiBubyBjb25uZWN0ZWQgc2Vzc2lvbnMgcHJlc2VudCB0aGVuIGluaXRpYXRlIG5leHQgc2NhbiBjb21tYW5kIGltbWVkaWF0ZWx5ICovCisgICAgICAgICAgICAvKiBtaW5pbXVtIHRpbWVyIGdyYW51bGFyaXR5IGlzIDEwbXMgKi8KKyAgICAgICAgICAgIHZvc190aW1lcl9zdGFydCgmcE1hYy0+c2Nhbi5oVGltZXJTdGFBcENvbmNUaW1lciwgMTApOworICAgICAgICB9CisgICAgfQorI2VuZGlmCisgICAgcmV0dXJuIChmUmV0KTsKK30KKworCit0QU5JX0JPT0xFQU4gY3NyU2NhbklzV2lsZENhcmRTY2FuKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0U21lQ21kICpwQ29tbWFuZCApCit7CisgICAgdEFOSV9VOCBic3NpZFtXTklfQ0ZHX0JTU0lEX0xFTl0gPSB7MCwgMCwgMCwgMCwgMCwgMH07CisgICAgdEFOSV9CT09MRUFOIGYgPSB2b3NfbWVtX2NvbXBhcmUocENvbW1hbmQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LmJzc2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJzc2lkLCBzaXplb2YodENzckJzc2lkKSk7CisKK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gPSBjc3JMTFBlZWtIZWFkKCZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCwgTExfQUNDRVNTX0xPQ0spOworCisgICAgaWYgKCBwRW50cnkgKQorICAgIHsKKyAgICAgICAgcENvbW1hbmQgPSBHRVRfQkFTRV9BRERSKCBwRW50cnksIHRTbWVDbWQsIExpbmsgKTsKKyAgICAgICAgaWYgKCBlU21lQ29tbWFuZFNjYW4gPT0gcENvbW1hbmQtPmNvbW1hbmQgKQorICAgICAgICB7CisgICAgICAgICAgICBzY2FuU3RhdHVzID0gKGVTSVJfU01FX1NVQ0NFU1MgPT0gcFNjYW5Sc3AtPnN0YXR1c0NvZGUpID8gZUNTUl9TQ0FOX1NVQ0NFU1MgOiBlQ1NSX1NDQU5fRkFJTFVSRTsKKyAgICAgICAgICAgIHJlYXNvbiA9IHBDb21tYW5kLT51LnNjYW5DbWQucmVhc29uOworICAgICAgICAgICAgc3dpdGNoKHBDb21tYW5kLT51LnNjYW5DbWQucmVhc29uKQorICAgICAgICAgICAgeworICAgICAgICAgICAgY2FzZSBlQ3NyU2NhbkFib3J0QmdTY2FuOgorICAgICAgICAgICAgY2FzZSBlQ3NyU2NhbkFib3J0Tm9ybWFsU2NhbjoKKyAgICAgICAgICAgIGNhc2UgZUNzclNjYW5CR1NjYW5BYm9ydDoKKyAgICAgICAgICAgIGNhc2UgZUNzclNjYW5CR1NjYW5FbmFibGU6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDc3JTY2FuR2V0U2NhbkNobkluZm86CisgICAgICAgICAgICAgICAgcFNjYW5DaG5JbmZvID0gKHRTbWVHZXRTY2FuQ2huUnNwICopcE1zZ0J1ZjsKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAqIHN0YXR1cyBjb2RlIG5vdCBhdmFpbGFibGUgaW4gdFNtZUdldFNjYW5DaG5Sc3AsIHNvIAorICAgICAgICAgICAgICAgICAqIGJ5IGRlZmF1bHQ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B0aGUgc2NhbiBpcyBub3QgYSB3aWxkY2FyZCBzY2FuIGJlY2F1c2UKKyAgICAgICAgICAgICAgICAgICAgLy9pdCBtYXkgY2F1c2Ugc2NhbiByZXN1bHRzIGdvdCBhZ2VkIG91dCBpbmNvcnJlY3RseS4KKyAgICAgICAgICAgICAgICAgICAgaWYoY3NyU2NhbklzV2lsZENhcmRTY2FuKCBwTWFjLCBwQ29tbWFuZCApICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICghcENvbW1hbmQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LnAycFNlYXJjaCkKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfUk9BTV9TQ0FOX09GRkxPQUQKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIChwQ29tbWFuZC0+dS5zY2FuQ21kLnJlYXNvbiAhPSBlQ3NyU2NhbkdldExmclJlc3VsdCkKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgIGNzclNjYW5HZXRTY2FuQ2huSW5mbyhwTWFjLCBwQ29tbWFuZCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9Ly9zd2l0Y2gKKyAgICAgICAgICAgIGlmKGZSZW1vdmVDb21tYW5kKQorICAgICAgICAgICAgeworCisgICAgICAgICAgICAgICAgY3NyUmVsZWFzZVNjYW5Db21tYW5kKHBNYWMsIHBDb21tYW5kLCBzY2FuU3RhdHVzKTsKKworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNtZVByb2Nlc3NQZW5kaW5nUXVldWUoIHBNYWMgKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HVywgIkNTUjogU2NhbiBDb21wbGV0aW9uIGNhbGxlZC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gfQorICAgICAgICBwUmVzdWx0TGlzdC0+cEN1ckVudHJ5ID0gcEVudHJ5OworICAgICAgICBjc3JMTFVubG9jaygmcFJlc3VsdExpc3QtPkxpc3QpOworICAgIH0KKyAgICAKKyAgICByZXR1cm4gcFJldDsKK30KKworCit0Q3NyU2NhblJlc3VsdEluZm8gKmNzclNjYW5SZXN1bHRHZXROZXh0KHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRTY2FuUmVzdWx0SGFuZGxlIGhTY2FuUmVzdWx0KQoreworICAgIHRMaXN0RWxlbSAqcEVudHJ5ID0gTlVMTDsKKyAgICB0Q3NyU2NhblJlc3VsdCAqcFJlc3VsdCA9IE5VTEw7CisgICAgdENzclNjYW5SZXN1bHRJbmZvICpwUmV0ID0gTlVMTDsKKyAgICB0U2NhblJlc3VsdExpc3QgKnBSZXN1bHRMaXN0ID0gKHRTY2FuUmVzdWx0TGlzdCAqKWhTY2FuUmVzdWx0OworICAgIAorICAgIGlmKHBSZXN1bHRMaXN0KQorICAgIHsKKyAgICAgICAgY3NyTExMb2NrKCZwUmVzdWx0TGlzdC0+TGlzdCk7CisgICAgICAgIGlmKE5VTEwgPT0gcFJlc3VsdExpc3QtPnBDdXJFbnRyeSkKKyAgICAgICAgeworICAgICAgICAgICAgcEVudHJ5ID0gY3NyTExQZWVrSGVhZCgmcFJlc3VsdExpc3QtPkxpc3QsIExMX0FDQ0VTU19OT0xPQ0spOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcEVudHJ5ID0gY3NyTExOZXh0KCZwUmVzdWx0TGlzdC0+TGlzdCwgcFJlc3VsdExpc3QtPnBDdXJFbnRyeSwgTExfQUNDRVNTX05PTE9DSyk7CisgICAgICAgIH0KKyAgICAgICAgaWYocEVudHJ5KQorICAgICAgICB7CisgICAgICAgICAgICBwUmVzdWx0ID0gR0VUX0JBU0VfQUREUihwRW50cnksIHRDc3JTY2FuUmVzdWx0LCBMaW5rKTsKKyAgICA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UFOX0ZBTFNFOworICAgIHRBTklfVTMyIGk7CisgICAgdENzclJvYW1TZXNzaW9uICpwU2Vzc2lvbjsKKyAgICB0QU5JX0JPT0xFQU4gaXNDb25uQnNzZm91bmQgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisKKyAgICBmb3IoIGkgPSAwOyBpIDwgQ1NSX1JPQU1fU0VTU0lPTl9NQVg7IGkrKyApCisgICAgeworICAgICAgICBpZiggQ1NSX0lTX1NFU1NJT05fVkFMSUQoIHBNYWMsIGkgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBTZXNzaW9uID0gQ1NSX0dFVF9TRVNTSU9OKCBwTWFjLCBpICk7CisgICAgICAgICAgICAvL05vdCB0byByZW1vdmUgdGhlIEJTUyB3ZSBhcmUgY29ubmVjdGVkIHRvLgorICAgICAgICAgICAgaWYoY3NySXNDb25uU3RhdGVDb25uZWN0ZWRJbmZyYShwTWFjLCBpKSAmJiAoTlVMTCAhPSBwU2Vzc2lvbi0+cENvbm5lY3RCc3NEZXNjKSAmJgorICAgICAgICAgICAgICAoY3NySXNEdXBsaWNhdGVCc3NEZXNjcmlwdGlvbihwTWFjLCAmcFJlc3VsdC0+UmVzdWx0LkJzc0Rlc2NyaXB0b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+cENvbm5lY3RCc3NEZXNjLCBOVUxMLCBGQUxTRSkpCisgICAgICAgICAgICAgICkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlzQ29ubkJzc2ZvdW5kID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIGlmKCBpc0Nvbm5Cc3Nmb3VuZCApCisgICAgeworICAgICAgICAvL1Jlc2V0IHRoZSBjb3VudGVyIHNvIHRoYXQgYWdpbmcgb3V0IG9mIGNvbm5lY3RlZCBCU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5QnNzaWQpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLCAiQWdpbmcgb3V0IDExZCBCU1MgIk1BQ19BRERSRVNTX1NUUiwKKyAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocFJlc3VsdC0+UmVzdWx0LkJzc0Rlc2NyaXB0b3IuYnNzSWQpKTsKKyAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmN1cnJlbnRDb3VudHJ5UlNTSSA9IC0xMjg7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjc3JGcmVlU2NhblJlc3VsdEVudHJ5KHBNYWMsIHBSZXN1bHQpOworICAgICAgICAgICAgZlJldCA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIChmUmV0KTsKK30KKworCitlSGFsU3RhdHVzIGNzclNjYW5BZ2VSZXN1bHRzKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRTbWVHZXRTY2FuQ2huUnNwICpwU2NhbkNobkluZm8pCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIHRMaXN0RWxlbSAqcEVudHJ5LCAqdG1wRW50cnk7CisgICAgdENzclNjYW5SZXN1bHQgKnBSZXN1bHQ7CisgICAgdExpbVNjYW5DaG4gKnBDaG5JbmZvOworICAgIHRBTklfVTggaTsKKworICAgIGNzckxMTG9jaygmcE1hYy0+c2Nhbi5zY2FuUmVzdWx0TGlzdCk7CisgICAgZm9yKGkgPSAwOyBpIDwgcFNjYW5DaG5JbmZvLT5udW1DaG47IGkrKykKKyAgICB7CisgICAgICAgIHBDaG5JbmZvID0gJnBTY2FuQ2huSW5mby0+c2NhbkNobltpXTsKKyAgICAgICAgcEVudHJ5ID0gY3NyTExQZWVrSGVhZCggJnBNYWMtPnNjYW4uc2NhblJlc3VsdExpc3QsIExMX0FDQ0VTU19OT0xPQ0sgKTsKKyAgICAgICAgd2hpbGUoIHBFbnRyeSApIAorICAgICAgICB7CisgICAgICAgICAgICB0bXBFbnRyeSA9IGNzckxMTmV4dCgmcE1hYy0+c2Nhbi5zY2FuUmVzdWx0TGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTk9MT0NLKTsKKyAgICAgICAgICAgIHBSZXN1bHQgPSBHRVRfQkFTRV9BRERSKCBwRW50cnksIHRDc3JTY2FuUmVzdWx0LCBMaW5rICk7CisgICAgICAgICAgICBpZihwUmVzdWx0LT5SZXN1bHQuQnNzRGVzY3JpcHRvci5jaGFubmVsSWQgPT0gcENobkluZm8tPmNoYW5uZWxJZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZihwUmVzdWx0LT5BZ2luZ0NvdW50IDw9IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywgIiBhZ2Ugb3V0IGR1ZSB0byByZWYgY291bnQiKTsKKyAgICAgICAgICAgICAgICAgICAgY3NyU2NhbkFnZU91dEJzcyhwTWFjLCBwUmVzdWx0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcFJlc3VsdC0+QWdpbmdDb3VudC0tOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBFbnRyeSA9IHRtcEVudHJ5OworICAgICAgICB9CisgICAgfQorICAgIGNzckxMVW5sb2NrKCZwTWFjLT5zY2FuLnNjYW5SZXN1bHRMaXN0KTsKKworICAgIHJldHVybiAoc3RhdHVzKTsKK30KKworZUhhbFN0YXR1cyBjc3JJYnNzQWdlQnNzKHRwQW5pU2lyR2xvYmFsIHBNYWMpCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIHRMaXN0RWxlbSAqcEV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3N0eXBlVG9NYWNUeXBlKHBTY2FuUmVxLT5CU1NUeXBlKSk7CisKKyAgICAgICAgICAgIGlmICggQ1NSX0lTX1NFU1NJT05fVkFMSUQoIHBNYWMsIHNlc3Npb25JZCApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgcFNlbGZNYWMgPSAodEFOSV9VOCAqKSZwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0uc2VsZk1hY0FkZHI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8vIFNpbmNlIHdlIGRvbid0IGhhdmUgc2Vzc2lvbiBmb3IgdGhlIHNjYW5uaW5nLCB3ZSBmaW5kIGEgdmFsaWQgc2Vzc2lvbi4gSW4gY2FzZSB3ZSBmYWlsIHRvCisgICAgICAgICAgICAgIC8vIGRvIHNvLCBnZXQgdGhlIFdOSV9DRkdfU1RBX0lECisgICAgICAgICAgICAgIGZvciggaSA9IDA7IGkgPCBDU1JfUk9BTV9TRVNTSU9OX01BWDsgaSsrICkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKCBDU1JfSVNfU0VTU0lPTl9WQUxJRCggcE1hYywgaSApICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBwU2VsZk1hYyA9ICh0QU5JX1U4ICopJnBNYWMtPnJvYW0ucm9hbVNlc3Npb25baV0uc2VsZk1hY0FkZHI7CisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgaWYoIENTUl9ST0FNX1NFU1NJT05fTUFYID09IGkgKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdEFOSV9VMzIgbGVuID0gV05JX0NGR19CU1NJRF9MRU47CisgICAgICAgICAgICAgICAgcFNlbGZNYWMgPSBzZWxmTWFjQWRkcjsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBjY21DZmdHZXRTdHIoIHBNYWMsIFdOSV9DRkdfU1RBX0lELCBwU2VsZk1hYywgJmxlbiApOworICAgICAgICAgICAgICAgIGlmKCAhSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSB8fCAKKyAgICAgICAgICAgICAgICAgICAgKCBsZW4gPCBXTklfQ0ZHX0JTU0lEX0xFTiApICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCIgQ2FuIG5vdCBnZXQgc2VsZiBNQUMgYWRkcmVzcyBmcm9tIENGRyBzdGF0dXMgPSAlZCIpLCBzdGF0dXMgKTsKKyAgICAgICAgICAgICAgICAgIC8vRm9yY2UgZmFpbGVkIHN0YXR1cworICAgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4ICopcE1zZy0+c2VsZk1hY0FkZHIsIHBTZWxmTWFjLCBzaXplb2YodFNpck1hY0FkZHIpKTsKKworICAgICAgICAgICAgLy9zaXJDb3B5TWFjQWRkcgorICAgICAgICAgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4ICopcE1zZy0+YnNzSWQsICh0QU5JX1U4ICopJnBTY2FuUmVxLT5ic3NpZCwgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgICAgICBpZiAoIHZvc19tZW1fY29tcGFyZShwU2NhblJlcS0+YnNzaWQsIGJzc2lkLCBzaXplb2YodENzckJzc2lkKSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9zZXQocE1zZy0+YnNzSWQsIHNpemVvZih0U2lyTWFjQWRkciksIDB4ZmYpOworICAgICAgICAgICAgfQorICA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2Nhbi5jdXJTY2FuVHlwZTsKKyAgICAgICAgICAgICAgICBpZihlU0lSX1BBU1NJVkVfU0NBTiA9PSBwTWFjLT5zY2FuLmN1clNjYW5UeXBlKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYobWluQ2huVGltZSA8IHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ublBhc3NpdmVNaW5DaG5UaW1lKSAKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgbWluQ2huVGltZSA9IHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ublBhc3NpdmVNaW5DaG5UaW1lOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmKG1heENoblRpbWUgPCBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLm5QYXNzaXZlTWF4Q2huVGltZSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgbWF4Q2huVGltZSA9IHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ublBhc3NpdmVNYXhDaG5UaW1lOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcE1zZy0+c2NhblR5cGUgPSBwYWxfY3B1X3RvX2JlMzIoc2NhblR5cGUpOworCisgICAgICAgICAgICBwTXNnLT5udW1Tc2lkID0KKyAgICAgICAgICAgICAocFNjYW5SZXEtPlNTSURzLm51bU9mU1NJRHMgPCBTSVJfU0NBTl9NQVhfTlVNX1NTSUQpID8KKyAgICAgICAgICAgICBwU2NhblJlcS0+U1NJRHMubnVtT2ZTU0lEcyA6IFNJUl9TQ0FOX01BWF9OVU1fU1NJRDsKKyAgICAgICAgICAgIGlmKChwU2NhblJlcS0+U1NJRHMubnVtT2ZTU0lEcyAhPSAwKSAmJiAoIGVTSVJfUEFTU0lWRV9TQ0FOICE9IHNjYW5UeXBlICkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHBNc2ctPm51bVNzaWQ7IGkrKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmcE1zZy0+c3NJZFtpXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwU2NhblJlcS0+U1NJRHMuU1NJRExpc3RbaV0uU1NJRCwgc2l6ZW9mKHRTaXJNYWNTU2lkKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vT3RoZXJ3aXNlIHdlIHNjYW4gYWxsIFNTSUQgYW5kIGxldCB0aGUgcmVzdWx0IGZpbHRlciBsYXRlcgorICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBTSVJfU0NBTl9NQVhfTlVNX1NTSUQ7IGkrKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBNc2ctPnNzSWRbaV0ubGVuZ3RoID0gMDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHBNc2ctPm1pbkNoYW5uZWxUaW1lID0gcGFsX2NwdV90b19iZTMyKG1pbkNoblRpbWUpOworICAgICAgICAgICAgcE1zZy0+bWF4Q2hhbm5lbFRpbWUgPSBwYWxfY3B1X3RvX2JlMzIobWF4Q2huVGltZSk7CisgICAgICAgICAgICBwTXNnLT5taW5DaGFubmVsVGltZUJ0YyA9IHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ubkFjdGl2ZU1pbkNoblRpbWVCdGM7CisgICAgICAgICAgICBwTXNnLT5tYXhDaGFubmVsVGltZUJ0YyA9IHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ubkFjdGl2ZU1heENoblRpbWVCdGM7CisgICAgICAgICAgICAvL2hpZGRlbiBTU0lEIG9wdGlvbgorICAgICAgICAgICAgc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ShwTXNnLT5jaGFubmVsTGlzdC5jaGFubmVsTnVtYmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NhblJlcS0+Q2hhbm5lbEluZm8uQ2hhbm5lbExpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuUmVxLT5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcE1zZy0+dUlFRmllbGRMZW4gPSAodEFOSV9VMTYpIHBTY2FuUmVxLT51SUVGaWVsZExlbjsKKyAgICAgICAgICAgIHBNc2ctPnVJRUZpZWxkT2Zmc2V0ID0gKHRBTklfVTE2KShzaXplb2YoIHRTaXJTbWVTY2FuUmVxICkgLSBzaXplb2YoIHBNc2ctPmNoYW5uZWxMaXN0LmNoYW5uZWxOdW1iZXIgKSArIAorICAgICAgICAgICAgICAgICAgKCBzaXplb2YoIHBNc2ctPmNoYW5uZWxMaXN0LmNoYW5uZWxOdW1iZXIgKSAqIHBTY2FuUmVxLT5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzICkpIDsKKyAgICAgICAgICAgIGlmKHBTY2FuUmVxLT51SUVGaWVsZExlbiAhPSAwKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKilwTXNnK3BNc2ctPnVJRUZpZWxkT2Zmc2V0LCBwU2NhblJlcS0+cElFRmllbGQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NhblJlcS0+dUlFRmllbGRMZW4pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcE1zZy0+cDJwU2VhcmNoID0gcFNjYW5SZXEtPnAycFNlYXJjaDsKKworICAgICAgICAgICAgaWYgKHBTY2FuUmVxLT5yZXF1ZXN0VHlwZSA9PSBlQ1NSX1NDQU5fSE9fQkdfU0NBTikgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcE1zZy0+YmFja2dyb3VuZFNjYW5Nb2RlID0gZVNJUl9ST0FNSU5HX1NDQU47CisgICAgICAgICAgICB9IAorCisgICAgICAgIH13aGlsZSgwKTsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsIEZMKCJkb21haW5JZEN1cnJlbnQgJXMgKCVkKSBzY2FuVHlwZSAlcyAoJWQpIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImJzc1R5cGUgJXMgKCVkKSwgcmVxdWVzdFR5cGUgJXMoJWQpIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm51bUNoYW5uZWxzICVkIiksCisgICAgICAgICAgICAgICB2b3NzX0RvbWFpbklkdG9TdHJpbmcocE1hYy0+c2Nhbi5kb21haW5JZEN1cnJlbnQpLAorICAgICAgICAgICAgICAgcE1hYy0+c2Nhbi5kb21haW5JZEN1cnJlbnQsCisgICAgICAgICAgICAgICBsaW1fU2NhblR5cGV0b1N0cmluZyhwTXNnLT5zY2FuVHlwZSksIHBNc2ctPnNjYW5UeXBlLAorICAgICAgICAgICAgICAgbGltX0Jzc1R5cGV0b1N0cmluZyhwTXNnLT5ic3NUeXBlKSwgcE1zZy0+YnNzVHlwZSwKKyAgICAgICAgICAgICAgIHNtZV9yZXF1ZXN0VHlwZXRvU3RyaW5nKHBTY2FuUmVxLT5yZXF1ZXN0VHlwZSksCisgICAgICAgICAgICAgICBwU2NhblJlcS0+cmVxdWVzdFR5cGUsCisgICAgICAgICAgICAgICBwTXNnLT5jaGFubmVsTGlzdC5udW1DaGFubmVscyk7CisKKyAgICAgICAgZm9yKGkgPSAwOyBpIDwgcE1zZy0+Y2hhbm5lbExpc3QubnVtQ2hhbm5lbHM7IGkrKykKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzMsIEZMKCJjaGFubmVsTnVtYmVyWyVkXT0gJWQiKSwgaSwgcE1zZy0+Y2hhbm5lbExpc3QuY2hhbm5lbE51bWJlcltpXSk7CisgICAgICAgIH0KKworICAgICAgICB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JXMgKCVkKSAiCisgICAgICAgICAgICAgICAgIm51bU9mU1NJRHMgPSAlZCBudW1PZkNoYW5uZWxzID0gJWQgcmVxdWVzdFR5cGUgPSAlcyAoJWQpIgorICAgICAgICAgICAgICAgICIgcDJwU2VhcmNoID0gJWRcbiIpLAorICAgICAgICAgICAgICAgICBsaW1fU2NhblR5cGV0b1N0cmluZyhwU2NhblJlcS0+c2NhblR5cGUpLAorICAgICAgICAgICAgICAgICBwU2NhblJlcS0+c2NhblR5cGUsCisgICAgICAgICAgICAgICAgIGxpbV9Cc3NUeXBldG9TdHJpbmcocFNjYW5SZXEtPkJTU1R5cGUpLAorICAgICAgICAgICAgICAgICBwU2NhblJlcS0+QlNTVHlwZSwKKyAgICAgICAgICAgICAgICAgcFNjYW5SZXEtPlNTSURzLm51bU9mU1NJRHMsCisgICAgICAgICAgICAgICAgIHBTY2FuUmVxLT5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzLAorICAgICAgICAgICAgICAgICBzbWVfcmVxdWVzdFR5cGV0b1N0cmluZyhwU2NhblJlcS0+cmVxdWVzdFR5cGUpLAorICAgICAgICAgICAgICAgICBwU2NhblJlcS0+cmVxdWVzdFR5cGUsCisgICAgICAgICAgICAgICAgIHBTY2FuUmVxLT5wMnBTZWFyY2ggKTsKKworICAgIH0KKworICAgIHJldHVybiggc3RhdHVzICk7Cit9CisKK2VIYWxTdGF0dXMgY3NyU2VuZE1CU2NhblJlc3VsdFJlcSggdHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMzIgc2Vzc2lvbklkLCB0U2NhblJlcVBhcmFtICpwU2NhblJlcVBhcmFtICkKK3sKKyAgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgdFNpclNtZVNjYW5SZXEgKnBNc2c7CisgICAgdEFOSV9VMTYgbXNnTGVuOworCisgICAgbXNnTGVuID0gKHRBTklfVTE2KShzaXplb2YoIHRTaXJTbWVTY2FuUm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cm9iZUJzcyA9PSBwQ29tbWFuZC0+dS5zY2FuQ21kLnJlYXNvbikpCisgICAgICAgIHsKKyAgICAgICAgICAgIHNjYW5SZXEuaGlkZGVuU3NpZCA9IFNJUl9TQ0FOX0hJRERFTl9TU0lEX1BFX0RFQ0lTSU9OOworICAgICAgICB9CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRElBR19TVVBQT1JUX0NTUgorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbG9nX3NjYW5fcGt0X3R5cGUgKnBTY2FuTG9nID0gTlVMTDsKKworICAgICAgICAgICAgV0xBTl9WT1NfRElBR19MT0dfQUxMT0MocFNjYW5Mb2csIHZvc19sb2dfc2Nhbl9wa3RfdHlwZSwgTE9HX1dMQU5fU0NBTl9DKTsKKyAgICAgICAgICAgIGlmKHBTY2FuTG9nKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKGVDc3JTY2FuQmdTY2FuID09IHBDb21tYW5kLT51LnNjYW5DbWQucmVhc29uIHx8IAorICAgICAgICAgICAgICAgICAgICBlQ3NyU2NhblByb2JlQnNzID09IHBDb21tYW5kLT51LnNjYW5DbWQucmVhc29uKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcFNjYW5Mb2ctPmV2ZW50SWQgPSBXTEFOX1NDQU5fRVZFTlRfSE9fU0NBTl9SRVE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmKCAoZVNJUl9QQVNTSVZFX1NDQU4gIT0gcENvbW1hbmQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LnNjYW5UeXBlKSAmJiAKKyAgICAgICAgICAgICAgICAgICAgICAgIChlU0lSX1BBU1NJVkVfU0NBTiAhPSBwTWFjLT5zY2FuLmN1clNjYW5UeXBlKSApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuTG9nLT5ldmVudElkID0gV0xBTl9TQ0FOX0VWRU5UX0FDVElWRV9TQ0FOX1JFUTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuTG9nLT5ldmVudElkID0gV0xBTl9TQ0FOX0VWRU5UX1BBU1NJVkVfU0NBTl9SRVE7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcFNjYW5Mb2ctPm1pbkNoblRpbWUgPSAodl9VOF90KXBDb21tYW5kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdC5taW5DaG5UaW1lOworICAgICAgICAgICAgICAgIHBTY2FuTG9nLT5tYXhDaG5UaW1lID0gKHZfVThfdClwQ29tbWFuZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QubWF4Q2huVGltZTsKKyAgICAgICAgICAgICAgICBwU2NhbkxvZy0+bnVtQ2hhbm5lbCA9ICh2X1U4X3QpcENvbW1hbmQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHM7CisgICAgICAgICAgICAgICAgaWYocFNjYW5Mb2ctPm51bUNoYW5uZWwgJiYgKHBTY2FuTG9nLT5udW1DaGFubmVsIDwgVk9TX0xPR19NQVhfTlVNX0NIQU5ORUwpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBTY2FuTG9nLT5jaGFubmVscywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdC5DaGFubmVsSW5mby5DaGFubmVsTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuTG9nLT5udW1DaGFubmVsKTsKK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Sb2FtU3RhdGVbaV0gPQorICAgICAgICAgICAgICAgIGNzclJvYW1TdGF0ZUNoYW5nZSggcE1hYywgZUNTUl9ST0FNSU5HX1NUQVRFX1NDQU5OSU5HLCBpKTsKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HMywgInN0YXJ0aW5nIFNDQU4gY29tbWFuZCBmcm9tICVkIHN0YXRlLi4uLiIKKyAgICAgICAgICAgICAgICAgICAgIiByZWFzb24gaXMgJWQiLCBwQ29tbWFuZC0+dS5zY2FuQ21kLmxhc3RSb2FtU3RhdGVbaV0sCisgICAgICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnNjYW5DbWQucmVhc29uICk7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgcENvbW1hbmQtPnUuc2NhbkNtZC5sYXN0Um9hbVN0YXRlW3BDb21tYW5kLT5zZXNzaW9uSWRdID0KKyAgICAgICAgICAgIGNzclJvYW1TdGF0ZUNoYW5nZShwTWFjLCBlQ1NSX1JPQU1JTkdfU1RBVEVfU0NBTk5JTkcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvbW1hbmQtPnNlc3Npb25JZCk7CisgICAgICAgIHNtc0xvZyggcE1hYywgTE9HMywKKyAgICAgICAgICAgICAgICAic3RhcnRpbmcgU0NBTiBjb21tYW5kIGZyb20gJWQgc3RhdGUuLi4uIHJlYXNvbiBpcyAlZCIsCisgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUuc2NhbkNtZC5sYXN0Um9hbVN0YXRlW3BDb21tYW5kLT5zZXNzaW9uSWRdLAorICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnNjYW5DbWQucmVhc29uICk7CisgICAgfQorCisgICAgc3dpdGNoKHBDb21tYW5kLT51LnNjYW5DbWQucmVhc29uKQorICAgIHsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfUk9BTV9TQ0FOX09GRkxPQUQKKyAgICBjYXNlIGVDc3JTY2Fu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0d2ljZQorICAgICAgICAgICAgaWYocENvbW1hbmQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHMgJiYKKyAgICAgICAgICAgICAgIChOVUxMICE9IHBDb21tYW5kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdC5DaGFubmVsSW5mby5DaGFubmVsTGlzdCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGVuID0gcENvbW1hbmQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHM7CisgICAgICAgICAgICAgICAgLy9hbGxvY2F0ZSB0d2ljZSB0aGUgY2hhbm5lbAorICAgICAgICAgICAgICAgIG5ld0NoYW5uZWxJbmZvLkNoYW5uZWxMaXN0ID0gKHRBTklfVTggKil2b3NfbWVtX21hbGxvYyhsZW4gKiAyKTsKKyAgICAgICAgICAgICAgICBwQ2hhbm5lbCA9IHBDb21tYW5kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdC5DaGFubmVsSW5mby5DaGFubmVsTGlzdDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvL2dldCB0aGUgdmFsaWQgY2hhbm5lbCBsaXN0IHRvIHNjYW4gYWxsLgorICAgICAgICAgICAgICAgIGxlbiA9IHNpemVvZihwTWFjLT5yb2FtLnZhbGlkQ2hhbm5lbExpc3QpOworCisgICAgICAgICAgICAgICAgaWYgKEhBTF9TVEFUVVNfU1VDQ0VTUyhjc3JHZXRDZmdWYWxpZENoYW5uZWxzKHBNYWMsICh0QU5JX1U4ICopcE1hYy0+cm9hbS52YWxpZENoYW5uZWxMaXN0LCAmbGVuKSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvL2FsbG9jYXRlIHR3aWNlIHRoZSBjaGFubmVsCisgICAgICAgICAgICAgICAgICAgIG5ld0NoYW5uZWxJbmZvLkNoYW5uZWxMaXN0ID0gKHRBTklfVTggKil2b3NfbWVtX21hbGxvYyhsZW4gKiAyKTsKKyAgICAgICAgICAgICAgICAgICAgcENoYW5uZWwgPSBwTWFjLT5yb2FtLnZhbGlkQ2hhbm5lbExpc3Q7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYoTlVMTCA9PSBuZXdDaGFubmVsSW5mby5DaGFubmVsTGlzdCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBuZXdDaGFubmVsSW5mby5udW1PZkNoYW5uZWxzID0gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBqID0gMDsKKyAgICAgICAgICAgICAgICBmb3IoaSA9IDA7IGkgPCBsZW47IGkrKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIG5ld0NoYW5uZWxJbmZvLkNoYW5uZWxMaXN0W2orK10gPSBwQ2hhbm5lbFtpXTsKKyAgICAgICAgICAgICAgICAgICAgaWYoQ1NSX01BWF8yNEdIel9DSEFOTkVMX05VTUJFUiA+PSBwQ2hhbm5lbFtpXSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgbmV3Q2hhbm5lbEluZm8uQ2hhbm5lbExpc3RbaisrXSA9IHBDaGFubmVsW2ldOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmKE5VTEwgIT0gcENvbW1hbmQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy9wQ2hhbm5lbCBwb2ludHMgdG8gdGhlIGNoYW5uZWxsaXN0IGZyb20gdGhlIGNvbW1hbm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BNYWMsIHRDc3JCR1NjYW5SZXF1ZXN0ICpwU2NhblJlcSkKK3sKKyAgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgdFNtZUNtZCAqcENvbW1hbmQgPSBOVUxMOworICAgIAorICAgIGlmKHBTY2FuUmVxKQorICAgIHsKKyAgICAgICAgZG8KKyAgICAgICAgeworICAgICAgICAgICAgcENvbW1hbmQgPSBjc3JHZXRDb21tYW5kQnVmZmVyKHBNYWMpOworICAgICAgICAgICAgaWYoIXBDb21tYW5kKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1JFU09VUkNFUzsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHZvc19tZW1fc2V0KCZwQ29tbWFuZC0+dS5zY2FuQ21kLCBzaXplb2YodFNjYW5DbWQpLCAwKTsKKyAgICAgICAgICAgIHBDb21tYW5kLT5jb21tYW5kID0gZVNtZUNvbW1hbmRTY2FuOworICAgICAgICAgICAgcENvbW1hbmQtPnUuc2NhbkNtZC5yZWFzb24gPSBlQ3NyU2NhblNldEJHU2NhblBhcmFtOworICAgICAgICAgICAgcENvbW1hbmQtPnUuc2NhbkNtZC5jYWxsYmFjayA9IE5VTEw7CisgICAgICAgICAgICBwQ29tbWFuZC0+dS5zY2FuQ21kLnBDb250ZXh0ID0gTlVMTDsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSgmcENvbW1hbmQtPnUuc2NhbkNtZC51LmJnU2NhblJlcXVlc3QsIHBTY2FuUmVxLCBzaXplb2YodENzckJHU2NhblJlcXVlc3QpKTsKKyAgICAgICAgICAgIC8vd2UgaGF2ZSB0byBkbyB0aGUgZm9sbG93CisgICAgICAgICAgICBpZihwU2NhblJlcS0+Q2hhbm5lbEluZm8ubnVtT2ZDaGFubmVscyA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnNjYW5DbWQudS5iZ1NjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0ID0gTlVMTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwQ29tbWFuZC0+dS5zY2FuQ21kLnUuYmdTY2FuUmVxdWVzdC5DaGFubmVsSW5mby5DaGFubmVsTGlzdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSB2b3NfbWVtX21hbGxvYyhwU2NhblJlcS0+Q2hhbm5lbEluZm8ubnVtT2ZDaGFubmVscyk7CisgICAgICAgICAgICAgICAgaWYgKCBOVUxMICE9IHBDb21tYW5kLT51LnNjYW5DbWQudS5iZ1NjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0ICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwQ29tbWFuZC0+dS5zY2FuQ21kLnUuYmdTY2FuUmVxdWVzdC5DaGFubmVsSW5mby5DaGFubmVsTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuUmVxLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuUmVxLT5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJyYW4gb3V0IG9mIG1lbW9yeSIpKTsKKyAgICAgICAgICAgICAgICAgICAgY3NyUmVsZWFzZUNvbW1hbmRTY2FuKHBNYWMsIHBDb21tYW5kKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvL3NjYW4gcmVxIGZvciBTU0lECisgICAgICAgICAgICBpZihwU2NhblJlcS0+U1NJRC5sZW5ndGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocENvbW1hbmQtPnUuc2NhbkNtZC51LmJnU2NhblJlcXVlc3QuU1NJRC5zc0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY2FuUmVxLT5TU0lELnNzSWQsIHBTY2FuUmVxLT5TU0lELmxlbmd0aCk7CisgICAgICAgICAgICAgICBwQ29tbWFuZC0+dS5zY2FuQ21kLnUuYmdTY2FuUmVxdWVzdC5TU0lELmxlbmd0aCA9IHBTY2FuUmVxLT5TU0lELmxlbmd0aDsKKworICAgICAgICAgICAgfQorICAgICAgICAgICAgcENvbW1hbmQtPnUuc2NhbkNtZC51LmJnU2NhblJlcXVlc3QubWF4Q2huVGltZT0gcFNjYW5SZXEtPm1heENoblRpbWU7CisgICAgICAgICAgICBwQ29tbWFuZC0+dS5zY2FuQ21kLnUuYmdTY2FuUmVxdWVzdC5taW5DaG5UaW1lID0gcFNjYW5SZXEtPm1pbkNoblRpbWU7CisgICAgICAgICAgICBwQ29tbWFuZC0+dS5zY2FuQ21kLnUuYmdTY2FuUmVxdWVzdC5zY2FuSW50ZXJ2YWwgPSBwU2NhblJlcS0+c2NhbkludGVydmFsOworCisKKyAgICAgICAgICAgIHN0YXR1cyA9IGNzclF1ZXVlU21lQ29tbWFuZChwTWFjLCBwQ29tbWFuZCwgZUFOSV9CT09MRUFOX0ZBTFNFKTsKKyAgICAgICAgICAgIGlmKCAhSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiIGZhaWwgdG8gc2VuZCBtZXNzYWdlIHN0YXR1cyA9ICVkIiksIHN0YXR1cyApOworICAgICAgICAgICAgICAgIGNzclJlbGVhc2VDb21tYW5kU2NhbiggcE1hYywgcENvbW1hbmQgKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfXdoaWxlKDApOworICAgIH0KKyAgICAKKyAgICByZXR1cm4gKHN0YXR1cyk7Cit9CisKK2VIYWxTdGF0dXMgY3NyU2NhbkJHU2NhbkFib3J0KCB0cEFuaVNpckdsb2JhbCBwTWFjICkKK3sKKyAgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgdFNtZUNtZCAqcENvbW1hbmQgPSBOVUxMOworICAgIAorICAgIGRvCisgICAgeworICAgICAgICBwQ29tbWFuZCA9IGNzckdldENvbW1hbmRCdWZmZXIocE1hYyk7CisgICAgICAgIGlmKCFwQ29tbWFuZCkKKyAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfUkVTT1VSQ0VTOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgdm9zX21lbV9zZXQoJnBDb21tYW5kLT51LnNjYW5DbWQsIHNpemVvZih0U2NhbkNtZCksIDApOworICAgICAgICBwQ29tbWFuZC0+Y29tbWFuZCA9IGVTbWVDb21tYW5kU2NhbjsgCisgICAgICAgIHBDb21tYW5kLT51LnNjYW5DbWQucmVhc29uID0gZUNzclNjYW5CR1NjYW5BYm9ydDsKKyAgICAgICAgcENvbW1hbmQtPnUuc2NhbkNtZC5jYWxsYmFjayA9IE5VTEw7CisgICAgICAgIHBDb21tYW5kLT51LnNjYW5DbWQucENvbnRleHQgPSBOVUxMOworICAgICAgICBzdGF0dXMgPSBjc3JRdWV1ZVNtZUNvbW1hbmQocE1hYywgcENvbW1hbmQsIGVBTklfQk9PTEVBTl9GQUxTRSk7CisgICAgICAgIGlmKCAhSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgRkwoIiBmYWlsIHRvIHNlbmQgbWVzc2FnZSBzdGF0dXMgPSAlZCIpLCBzdGF0dXMgKTsKKyAgICAgICAgICAgIGNzclJlbGVhc2VDb21tYW5kU2NhbiggcE1hYywgcENvbW1hbmQgKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfXdoaWxlKDApOworICAgIAorICAgIHJldHVybiAoc3RhdHVzKTsKK30KKworCisvL1RoaXMgd2lsbCBlbmFibGUgdGhlIGJhY2tncm91bmQgc2NhbiB3aXRoIHRoZSBub24temVybyBpbnRlcnZhbCAKK2VIYWxTdGF0dXMgY3NyU2NhbkJHU2NhbkVuYWJsZSh0cEFuaVNpckdsb2JhbCBwTWFjKQoreworICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICB0U21lQ21kICpwQ29tbWFuZCA9IE5VTEw7CisgICAgCisgICAgaWYocE1hYy0+cm9hbS5jb25maWdQYXJhbS5iZ1NjYW5JbnRlcnZhbCkKKyAgICB7CisgICAgICAgIGRvCisgICAgICAgIHsKKyAgICAgICAgICAgIHBDb21tYW5kID0gY3NyR2V0Q29tbWFuZEJ1ZmZlcihwTWFjKTsKKyAgICAgICAgICAgIGlmKCFwQ29tbWFuZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19SRVNPVVJDRVM7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB2b3NfbWVtX3NldCgmcENvbW1hbmQtPnUuc2NhbkNtZCwgc2l6ZW9mKHRTY2FuQ21kKSwgMCk7CisgICAgICAgICAgICBwQ29tbWFuZC0+Y29tbWFuZCA9IGVTbWVDb21tYW5kU2NhbjsgCisgICAgICAgICAgICBwQ29tbWFuZC0+dS5zY2Fu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biA9IHNpemVvZihwTWFjLT5yb2FtLnZhbGlkQ2hhbm5lbExpc3QpOworICAgIHRBTklfVTMyIGluZGV4ID0gMDsKKyAgICB0QU5JX1UzMiBuZXdfaW5kZXggPSAwOworICAgIGVOVkNoYW5uZWxFbmFibGVkVHlwZSBOVmNoYW5uZWxfc3RhdGU7CisgICAgdEFOSV9VOCAgY2gxNDRfc3VwcG9ydCA9IDA7CisKKyAgICBjaDE0NF9zdXBwb3J0ID0gV0RBX2dldEZ3V2xhbkZlYXRDYXBzKFdMQU5fQ0gxNDQpOworCisgICAgZG8KKyAgICB7CisgICAgICAgIHN0YXR1cyA9IGNzclNjYW5GcmVlUmVxdWVzdChwTWFjLCBwRHN0UmVxKTsKKyAgICAgICAgaWYoSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwRHN0UmVxLCBwU3JjUmVxLCBzaXplb2YodENzclNjYW5SZXF1ZXN0KSk7CisgICAgICAgICAgICAvKiBSZS1pbml0aWFsaXplIHRoZSBwb2ludGVycyB0byBOVUxMIHNpbmNlIHdlIGRpZCBhIGNvcHkgKi8KKyAgICAgICAgICAgIHBEc3RSZXEtPnBJRUZpZWxkID0gTlVMTDsKKyAgICAgICAgICAgIHBEc3RSZXEtPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0ID0gTlVMTDsKKyAgICAgICAgICAgIHBEc3RSZXEtPlNTSURzLlNTSURMaXN0ID0gTlVMTDsKKworICAgICAgICAgICAgaWYocFNyY1JlcS0+dUlFRmllbGRMZW4gPT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwRHN0UmVxLT5wSUVGaWVsZCA9IE5VTEw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcERzdFJlcS0+cElFRmllbGQgPSB2b3NfbWVtX21hbGxvYyhwU3JjUmVxLT51SUVGaWVsZExlbik7CisgICAgICAgICAgICAgICAgaWYgKCBOVUxMID09IHBEc3RSZXEtPnBJRUZpZWxkICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiTm8gbWVtb3J5IGZvciBzY2FubmluZyBJRSBmaWVsZHMiKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocERzdFJlcS0+cElFRmllbGQsIHBTcmNSZXEtPnBJRUZpZWxkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTcmNSZXEtPnVJRUZpZWxkTGVuKTsKKyAgICAgICAgICAgICAgICAgICAgcERzdFJlcS0+dUlFRmllbGRMZW4gPSBwU3JjUmVxLT51SUVGaWVsZExlbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9Ly9BbGxvY2F0ZSBtZW1vcnkgZm9yIElFIGZpZWxkCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYocFNyY1JlcS0+Q2hhbm5lbEluZm8ubnVtT2ZDaGFubmVscyA9PSAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcERzdFJlcS0+Q2hhbm5lbEluZm8uQ2hhbm5lbExpc3QgPSBOVUxMOworICAgICAgICAgICAgICAgICAgICAgICAgcERzdFJlcS0+Q2hhbm5lbEluZm8ubnVtT2ZDaGFubmVscyA9IDA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBEc3RSZXEtPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0ID0gdm9zX21lbV9tYWxsb2MoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTcmNSZXEtPkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBzaXplb2YoKnBEc3RSZXEtPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0KSk7CisgICAgICAgICAgICAgICAgICAgIGlmICggTlVMTCA9PSBwRHN0UmVxLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdCApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgICAgICAgICBwRHN0UmVxLT5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiTm8gbWVtb3J5IGZvciBzY2FubmluZyBDaGFubmVsIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgTGlzdCIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYoKHBTcmNSZXEtPnNjYW5UeXBlID09IGVTSVJfUEFTU0lWRV9TQ0FOKSAmJiAocFNyY1JlcS0+cmVxdWVzdFR5cGUgPT0gZUNTUl9TQ0FOX1JFUVVFU1RfMTFEX1NDQU4pKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgIGZvciAoIGluZGV4ID0gMDsgaW5kZXggPCBwU3JjUmVxLT5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzIDsgaW5kZXgrKyApCisgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU2tpcCBDSCAxNDQgaWYgZmlybXdhcmUgc3VwcG9ydCBub3QgcHJlc2VudCAqLworICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocFNyY1JlcS0+Q2hhbm5lbEluZm8uQ2hhbm5lbExpc3RbaW5kZXhdID09IDE0NCAmJiAhY2gxNDRfc3VwcG9ydCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTa2lwIGNoYW5uZWwgMTIgYW5kIDEzIHdoZW4gRkNDIGNvbnN0cmFpbnQgaXMgdHJ1ZSAqLworICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHBNYWMtPnNjYW4uZmNjX2NvbnN0cmFpbnQpICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHBTcmNSZXEtPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0W2luZGV4XSA9PTEyKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBTcmNSZXEtPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0W2luZGV4XSA9PTEzKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIklnbm9yaW5nIGNoYW5uZWwgOiAlZCAiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3JjUmVxLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdFtpbmRleF0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICBOVmNoYW5uZWxfc3RhdGUgPSB2b3NfbnZfZ2V0Q2hhbm5lbEVuYWJsZWRTdGF0ZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3JjUmVxLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdFtpbmRleF0pOworICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKE5WX0NIQU5ORUxfRU5BQkxFID09IE5WY2hhbm5lbF9zdGF0ZSkgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTlZfQ0hBTk5FTF9ERlMgPT0gTlZjaGFubmVsX3N0YXRlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRHN0UmVxLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdFtuZXdfaW5kZXhdID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTcmNSZXEtPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0W2luZGV4XTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2luZGV4Kys7CisgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICBwRHN0UmVxLT5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzID0gbmV3X2luZGV4OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoSEFMX1NUQVRVU19TVUNDRVNTKGNzckdldENmZ1ZhbGlkQ2hhbm5lbHMocE1hYywgcE1hYy0+cm9hbS52YWxpZENoYW5uZWxMaXN0LCAmbGVuKSkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ld19pbmRleCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5yb2FtLm51bVZhbGlkQ2hhbm5lbHMgPSBsZW47CisKKyAgICAgICAgICAgICAgICAgICAgIC8qIFNpbmNlIGluIENzclNjYW5SZXF1ZXN0LHZhbHVlIG9mIHBNYWMtPnNjYW4ubmV4dFNjYW5JRAorICAgICAgICAgICAgICAgICAgICAgICogaXMgaW5jcmVtZW50ZWQgYmVmb3JlIGNhbGxpbmcgQ3NyU2NhbkNvcHlSZXF1ZXN0LCBhcyBhCisgICAgICAgICAgICAgICAgICAgICAgKiByZXN1bHQgcE1hYy0+c2Nhbi5uZXh0U2NhbklEIGlzIGVxdWFsIHRvIE9ORSBmb3IgdGhlCisgICAgICAgICAgICAgICAgICAgICAgKiBmaXJzdCBzY2FuLgorICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgICBpZiAoKHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uaW5pdGlhbFNjYW5Ta2lwREZTQ2ggJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgPT0gcE1hYy0+c2Nhbi5uZXh0U2NhbklEKSB8fChwTWFjLT5taXJhY2FzdF9tb2RlKSkKKyAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiSW5pdGlhbCBzY2FuLCBzY2FuIG9ubHkgbm9uLURGUyBjaGFubmVscyIpKTsKKworICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGluZGV4ID0gMDsgaW5kZXggPCBwU3JjUmVxLT5DaGFubmVsSW5mby4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bU9mQ2hhbm5lbHMgOyBpbmRleCsrICkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZigoY3NyUm9hbUlzVmFsaWRDaGFubmVsKHBNYWMsIHBTcmNSZXEtPkNoYW5uZWxJbmZvLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGFubmVsTGlzdFtpbmRleF0pKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qU2tpaXBwaW5nIERGUyBDaGFubmVscyBmb3IgMXN0IHNjYW4gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoTlZfQ0hBTk5FTF9ERlMgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX252X2dldENoYW5uZWxFbmFibGVkU3RhdGUocFNyY1JlcS0+Q2hhbm5lbEluZm8uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENoYW5uZWxMaXN0W2luZGV4XSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlIDsKKworICAgICAgICAgICAgICAgICAgICAgICAgICBwRHN0UmVxLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdFtuZXdfaW5kZXhdID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3JjUmVxLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdFtpbmRleF07CisgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19pbmRleCsrOworCisgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uaW5pdGlhbFNjYW5Ta2lwREZTQ2ggPSAwOworICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICBmb3IgKCBpbmRleCA9IDA7IGluZGV4IDwgcFNyY1JlcS0+Q2hhbm5lbEluZm8uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1PZkNoYW5uZWxzIDsgaW5kZXgrKyApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU2tpcCBDSCAxNDQgaWYgZmlybXdhcmUgc3VwcG9ydCBub3QgcHJlc2VudCAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwU3JjUmVxLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdFtpbmRleF0gPT0gMTQ0ICYmICFjaDE0NF9zdXBwb3J0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEFsbG93IHNjYW4gb24gdmFsaWQgY2hhbm5lbHMgb25seS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoICggY3NyUm9hbUlzVmFsaWRDaGFubmVsKHBNYWMsIHBTcmNSZXEtPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0W2luZGV4XSkgKSApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiggKChwU3JjUmVxLT5za2lwRGZzQ2hubEluUDJwU2VhcmNoIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBNYWMtPnNjYW4uZkVuYWJsZURGU0NobmxTY2FuID09CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREZTX0NITkxfU0NBTl9ESVNBQkxFRCkpICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTlZfQ0hBTk5FTF9ERlMgPT0gdm9zX252X2dldENoYW5uZWxFbmFibGVkU3RhdGUocFNyY1JlcS0+Q2hhbm5lbEluZm8uQ2hhbm5lbExpc3RbaW5kZXhdKSkgKQorI2lmZGVmIEZFQVRVUkVfV0xBTl9MRlIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBJZiBMRlIgaXMgcmVxdWVzdGluZyBhIGNvbnRpZ3VvdXMgc2NhbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIChpLmUuIG51bU9mQ2hhbm5lbHMgPiAxKSwgdGhlbiBpZ25vcmUgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogREZTIGNoYW5uZWxzLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIFRPRE86IHZvc19udl9nZXRDaGFubmVsRW5hYmxlZFN0YXRlIGlzIHJldHVybmluZworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIDEyMCwgMTI0IGFuZCAxMjggYXMgbm9uLURGUyBjaGFubmVscy4gSGVuY2UsIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHVzZSBvZiBkaXJlY3QgY2hlY2sgZm9yIGNoYW5uZWxzIGJlbG93LgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICgoZUNTUl9TQ0FOX0hPX0JHX1NDQU4gPT0gcFNyY1JlcS0+cmVxdWVzdFR5cGUpICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwU3JjUmVxLT5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzID4gMSkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKENTUl9JU19DSEFOTkVMX0RGUyhwU3JjUmVxLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdFtpbmRleF0pKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIXBNYWMtPnJvYW0uY29uZmlnUGFyYW0uYWxsb3dERlNDaGFubmVsUm9hbSkKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworI2lmZGVmIEZFQVRVUkVfV0xBTl9MRlIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCIgcmVxVHlwZT0lcyAoJWQpLCBudW1PZkNoYW5uZWxzPSVkLCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGlnbm9yaW5nIERGUyBjaGFubmVsICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21lX3JlcXVlc3RUeXBldG9TdHJpbmcocFNyY1JlcS0+cmVxdWVzdFR5cGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTcmNSZXEtPnJlcXVlc3RUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTcmNSZXEtPkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNyY1JlcS0+Q2hhbm5lbEluZm8uQ2hhbm5lbExpc3RbaW5kZXhdKTsKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEc3RSZXEtPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0W25ld19pbmRleF0gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNyY1JlcS0+Q2hhbm5lbEluZm8uQ2hhbm5lbExpc3RbaW5kZXhdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfaW5kZXgrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgcERzdFJlcS0+Q2hhbm5lbEluZm8ubnVtT2ZDaGFubmVscyA9IG5ld19pbmRleDsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fTEZSCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoICggKCBlQ1NSX1NDQU5fSE9fQkdfU0NBTiA9PSBwU3JjUmVxLT5yZXF1ZXN0VHlwZSApIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCBlQ1NSX1NDQU5fUDJQX0RJU0NPVkVSWSA9PSBwU3JjUmVxLT5yZXF1ZXN0VHlwZSApICkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCAwID09IHBEc3RSZXEtPkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHMgKSApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBObyB2YWxpZCBjaGFubmVscyBmb3VuZCBpbiB0aGUgcmVxdWVzdC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBPbmx5IHBlcmZvcm0gc2NhbiBvbiB0aGUgY2hhbm5lbHMgcGFzc2VkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogcFNyY1JlcSBpZiBpdCBpcyBhIGVDU1JfU0NBTl9IT19CR19TQ0FOIG9yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogZUNTUl9TQ0FOX1AyUF9ESVNDT1ZFUlkuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogUGFzc2luZyAwIHRvIExJTSB3aWxsIHRyaWdnZXIgYSBzY2FuIG9uIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGFsbCB2YWxpZCBjaGFubmVscyB3aGljaCBpcyBub3QgZGVzaXJhYmxlLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiIG5vIHZhbGlkIGNoYW5uZWxzIGZvdW5kIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiAocmVxdWVzdD0lZCkiKSwgcFNyY1JlcS0+cmVxdWVzdFR5cGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoIGluZGV4ID0gMDsgaW5kZXggPCBwU3JjUmVxLT5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzIDsgaW5kZXgrKyApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoInBTcmNSZXEgaW5kZXg9JWQiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBjaGFubmVsPSVkIiksIGluZGV4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTcmNSZXEtPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0W2luZGV4XSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJDb3VsZG4ndCBnZXQgdGhlIHZhbGlkIENoYW5uZWwiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgTGlzdCwga2VlcGluZyByZXF1ZXN0ZXIncyBsaXN0IikpOworICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBEc3RSZXEtPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTcmNSZXEtPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTcmNSZXEtPkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHNpemVvZigqcERzdFJlcS0+Q2hhbm5lbEluZm8uQ2hhbm5lbExpc3QpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBEc3RSZXEtPkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHMgPSBwU3JjUmVxLT5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfS8vQWxsb2NhdGUgbWVtb3J5IGZvciBDaGFubmVsIExpc3QKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmKHBTcmNSZXEtPlNTSURzLm51bU9mU1NJRHMgPT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwRHN0UmVxLT5TU0lEcy5udW1PZlNTSURzID0gMDsKKyAgICAgICAgICAgICAgICBwRHN0UmVxLT5TU0lEcy5TU0lETGlzdCA9IE5VTEw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcERzdFJlcS0+U1NJRHMuU1NJRExpc3QgPSB2b3NfbWVtX21hbGxvYygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTcmNSZXEtPlNTSURzLm51bU9mU1NJRHMgKiBzaXplb2YoKnBEc3RSZXEtPlNTSURzLlNTSURMaXN0KSk7CisgICAgICAgICAgICAgICAgaWYgKCBOVUxMID09IHBEc3RSZXEtPlNTSURzLlNTSURMaXN0ICkKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgICAgICBpZiAoSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRHN0UmVxLT5TU0lEcy5udW1PZlNTSURzID0gcFNyY1JlcS0+U1NJRHMubnVtT2ZTU0lEczsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBEc3RSZXEtPlNTSURzLlNTSURMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNyY1JlcS0+U1NJRHMuU1NJRExpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3JjUmVxLT5TU0lEcy5udW1PZlNTSURzICogc2l6ZW9mKCpwRHN0UmVxLT5TU0lEcy5TU0lETGlzdCkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwRHN0UmVxLT5TU0lEcy5udW1PZlNTSURzID0gMDsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJObyBtZW1vcnkgZm9yIHNjYW5uaW5nIFNTSUQgTGlzdCIpKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfS8vQWxsb2NhdGUgbWVtb3J5IGZvciBTU0lEIExpc3QKKyAgICAgICAgICAgIHBEc3RSZXEtPnAycFNlYXJjaCA9IHBTcmNSZXEtPnAycFNlYXJjaDsKKyAgICAgICAgICAgIH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UVVNfU1VDQ0VTUzsKK30KKworCit2b2lkIGNzclNjYW5DYWxsQ2FsbGJhY2sodHBBbmlTaXJHbG9iYWwgcE1hYywgdFNtZUNtZCAqcENvbW1hbmQsIGVDc3JTY2FuU3RhdHVzIHNjYW5TdGF0dXMpCit7CisgICAgaWYocENvbW1hbmQtPnUuc2NhbkNtZC5jYWxsYmFjaykKKyAgICB7CisgICAgICAgIGlmIChwQ29tbWFuZC0+dS5zY2FuQ21kLmFib3J0U2NhbkluZGljYXRpb24peworICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HMSwgRkwoInNjYW5Eb25lIGR1ZSB0byBhYm9ydCIpKTsKKyAgICAgICAgICAgICBzY2FuU3RhdHVzID0gZUNTUl9TQ0FOX0FCT1JUOworICAgICAgICB9CisvLyAgICAgICAgc21lX1JlbGVhc2VHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisgICAgICAgIHBDb21tYW5kLT51LnNjYW5DbWQuY2FsbGJhY2socE1hYywgcENvbW1hbmQtPnUuc2NhbkNtZC5wQ29udGV4dCwgcENvbW1hbmQtPnUuc2NhbkNtZC5zY2FuSUQsIHNjYW5TdGF0dXMpOyAKKy8vICAgICAgICBzbWVfQWNxdWlyZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKTsKKyAgICB9IGVsc2UgeworICAgICAgICBzbXNMb2coIHBNYWMsIExPRzIsICIlczolZCAtIENhbGxiYWNrIE5VTEwhISEiLCBfX2Z1bmNfXywgX19MSU5FX18pOworICAgIH0KK30KKworCit2b2lkIGNzclNjYW5TdG9wVGltZXJzKHRwQW5pU2lyR2xvYmFsIHBNYWMpCit7CisgICAgY3NyU2NhblN0b3BJZGxlU2NhblRpbWVyKHBNYWMpOworICAgIGNzclNjYW5TdG9wR2V0UmVzdWx0VGltZXIocE1hYyk7CisgICAgaWYoMCAhPSBwTWFjLT5zY2FuLnNjYW5SZXN1bHRDZmdBZ2luZ1RpbWUgKQorICAgIHsKKyAgICAgICAgY3NyU2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hYykpKQorICAgICAgICB7CisgICAgICAgICAgIG5OdW1DaGFuQ29tYmluZWRDb25jID0gcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uTnVtU3RhQ2hhbkNvbWJpbmVkQ29uYzsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmKGNzcklzUDJwU2Vzc2lvbkNvbm5lY3RlZChwTWFjKSkKKyAgICAgICAgeworICAgICAgICAgICBuTnVtQ2hhbkNvbWJpbmVkQ29uYyA9IHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ubk51bVAyUENoYW5Db21iaW5lZENvbmM7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIChudW1DaG4gPiBuTnVtQ2hhbkNvbWJpbmVkQ29uYykgJiYKKyAgICAgICAgICAgICAgICAoKGNzcklzU3RhU2Vzc2lvbkNvbm5lY3RlZChwTWFjKSAmJiAKKyNpZmRlZiBGRUFUVVJFX1dMQU5fTEZSCisgICAgICAgICAgICAgICAgICAoY3NySXNDb25jdXJyZW50SW5mcmFDb25uZWN0ZWQocE1hYykgfHwKKyAgICAgICAgICAgICAgICAgICAoKHBTY2FuQ21kLT51LnNjYW5DbWQucmVhc29uICE9IGVDc3JTY2FuQmdTY2FuKSAmJgorICAgICAgICAgICAgICAgICAgICAocE1hYy0+cm9hbS5uZWlnaGJvclJvYW1JbmZvLm5laWdoYm9yUm9hbVN0YXRlICE9IAorICAgICAgICAgICAgICAgICAgICAgZUNTUl9ORUlHSEJPUl9ST0FNX1NUQVRFX0NGR19DSEFOX0xJU1RfU0NBTikpKSAmJgorI2VuZGlmCisgICAgICAgICAgICAgICAgICAocFNjYW5DbWQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LnAycFNlYXJjaCAhPSAxKSkgfHwKKyAgICAgICAgICAgICAgKGNzcklzUDJwU2Vzc2lvbkNvbm5lY3RlZChwTWFjKSkpKQorICAgICAgICB7CisgICAgICAgICAgICAgdm9zX21lbV9zZXQoJnNjYW5SZXEsIHNpemVvZih0Q3NyU2NhblJlcXVlc3QpLCAwKTsKKworICAgICAgICAgICAgIHBTZW5kU2NhbkNtZCA9IGNzckdldENvbW1hbmRCdWZmZXIocE1hYyk7IC8vb3B0aW1pemUgdGhpcyB0byB1c2UgMiBjb21tYW5kIGJ1ZmZlciBvbmx5CisgICAgICAgICAgICAgaWYgKCFwU2VuZFNjYW5DbWQpCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCIgRmFpbGVkIHRvIGdldCBRdWV1ZSBjb21tYW5kIGJ1ZmZlciIpICk7CisgICAgICAgICAgICAgICAgIGNzckxMVW5sb2NrKCZwTWFjLT5zY2FuLnNjYW5DbWRQZW5kaW5nTGlzdCk7CisgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgICAgcFNlbmRTY2FuQ21kLT5jb21tYW5kID0gcFNjYW5DbWQtPmNvbW1hbmQ7IAorICAgICAgICAgICAgIHBTZW5kU2NhbkNtZC0+c2Vzc2lvbklkID0gcFNjYW5DbWQtPnNlc3Npb25JZDsKKyAgICAgICAgICAgICBwU2VuZFNjYW5DbWQtPnUuc2NhbkNtZC5jYWxsYmFjayA9IE5VTEw7CisgICAgICAgICAgICAgcFNlbmRTY2FuQ21kLT51LnNjYW5DbWQucENvbnRleHQgPSBwU2NhbkNtZC0+dS5zY2FuQ21kLnBDb250ZXh0OworICAgICAgICAgICAgIHBTZW5kU2NhbkNtZC0+dS5zY2FuQ21kLnJlYXNvbiA9IHBTY2FuQ21kLT51LnNjYW5DbWQucmVhc29uOworICAgICAgICAgICAgIHBTZW5kU2NhbkNtZC0+dS5zY2FuQ21kLnNjYW5JRCA9IHBNYWMtPnNjYW4ubmV4dFNjYW5JRCsrOyAvL2xldCBpdCB3cmFwIGFyb3VuZAorCisgICAgICAgICAgICAgLyogRmlyc3QgY29weSBhbGwgdGhlIHBhcmFtZXRlcnMgdG8gbG9jYWwgdmFyaWFibGUg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EFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCIgRmFpbGVkIHRvIGdldCBjb3B5IGNzclNjYW5SZXF1ZXN0ID0gJWQiKSwgc3RhdHVzICk7CisgICAgICAgICAgICAgICAgIGNzckxMVW5sb2NrKCZwTWFjLT5zY2FuLnNjYW5DbWRQZW5kaW5nTGlzdCk7CisgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgICAgLyogQ2xlYW4gdGhlIGxvY2FsIHNjYW4gdmFyaWFibGUgKi8KKyAgICAgICAgICAgICBzY2FuUmVxLkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0ID0gTlVMTDsKKyAgICAgICAgICAgICBzY2FuUmVxLkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHMgPSAwOworICAgICAgICAgICAgIGNzclNjYW5GcmVlUmVxdWVzdChwTWFjLCAmc2NhblJlcSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAgLyogbm8gYWN0aXZlIGNvbm5lY3RlZCBzZXNzaW9uIHByZXNlbnQgb3IgbnVtQ2huID09IDEKKyAgICAgICAgICAgICAgKiBzY2FuIGFsbCByZW1haW5pbmcgY2hhbm5lbHMgKi8KKyAgICAgICAgICAgICBwU2VuZFNjYW5DbWQgPSBwU2NhbkNtZDsKKyAgICAgICAgICAgICAvL3JlbW92ZSB0aGlzIGNvbW1hbmQgZnJvbSBwZW5kaW5nIGxpc3QgCisgICAgICAgICAgICAgaWYgKGNzckxMUmVtb3ZlSGVhZCggJnBNYWMtPnNjYW4uc2NhbkNtZFBlbmRpbmdMaXN0LCBMTF9BQ0NFU1NfTk9MT0NLKSA9PSBOVUxMKQorICAgICAgICAgICAgIHsgLy9JbiBjYXNlIGJldHdlZW4gUGVla0hlYWQgYW5kIGhlcmUsIHRoZS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gICAgICAgIG5SZXQgPSBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLnNjYW5BZ2VUaW1lTkNQUzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBuUmV0ID0gcE1hYy0+cm9hbS5jb25maWdQYXJhbS5zY2FuQWdlVGltZU5DTlBTOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgaWYocG1jSXNQb3dlclNhdmVFbmFibGVkKHBNYWMsIGVQTUNfQkVBQ09OX01PREVfUE9XRVJfU0FWRSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgblJldCA9IHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uc2NhbkFnZVRpbWVDUFM7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgblJldCA9IHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uc2NhbkFnZVRpbWVDTlBTOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIC8vSWYgc3RhdGUtY2hhbmdlIGNhdXNpbmcgYWdpbmcgdGltZSBvdXQgY2hhbmdlLCB3ZSB3YW50IHRvIGRlbGF5IGl0IHNvbWV3aGF0IHRvIGF2b2lkCisgICAgICAgIC8vdW5uZWNlc3NhcnkgcmVtb3ZhbCBvZiBCU1MuIFRoaXMgaXMgbW9zdGx5IGR1ZSB0byB0cmFuc2l0aW9uIGZyb20gY29ubmVjdCB0byBkaXNjb25uZWN0LgorICAgICAgICBpZihwTWFjLT5zY2FuLm5MYXN0QWdlVGltZU91dCA+IG5SZXQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKG5SZXQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcE1hYy0+c2Nhbi5uQWdpbmdDb3VudERvd24gPSAocE1hYy0+c2Nhbi5uTGFzdE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KHBNYWMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csIEZMKCJzdGFydHMgaWRsZSBtb2RlIGZ1bGwgc2NhbiIpKTsKKyAgICAgICAgICAgICAgICAgICAgY3NyU2NhbkFsbENoYW5uZWxzKHBNYWMsIGVDU1JfU0NBTl9JRExFX01PREVfU0NBTik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLCBGTCgiY2Fubm90IHN0YXJ0IGlkbGUgbW9kZSBmdWxsIHNjYW4iKSk7CisgICAgICAgICAgICAgICAgICAgIC8vZXZlbiB0aG91Z2ggd2UgYXJlIGluIHRpbWVyIGhhbmRsZSwgY2FsbGluZyBzdG9wIHRpbWVyIHdpbGwgbWFrZSBzdXJlIHRoZSB0aW1lcgorICAgICAgICAgICAgICAgICAgICAvL2RvZXNuJ3QgZ2V0IHRvIHJlc3RhcnQuCisgICAgICAgICAgICAgICAgICAgIGNzclNjYW5TdG9wSWRsZVNjYW5UaW1lcihwTWFjKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJzZWVzIG5vdCBzdWNjZXNzIHN0YXR1cyAoJWQpIiksIHN0YXR1cyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7Ly93ZSBtaWdodCBuZWVkIGFub3RoZXIgZmxhZyB0byBjaGVjayBpZiBDU1IgbmVlZHMgdG8gcmVxdWVzdCBpbXBzIGF0IGFsbAorICAgICAgIAorICAgICAgICAgICAgdEFOSV9VMzIgblRpbWUgPSAwOworCisgICAgICAgICAgICBwTWFjLT5zY2FuLmZSZXN0YXJ0SWR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c2lvbnMgUnVubmluZyIpICk7CisgICAgICAgIHJldHVybiAoc3RhdHVzKTsKKyAgICB9CisKKyAgICBpZihwVGltZUludGVydmFsKQorICAgIHsKKyAgICAgICAgKnBUaW1lSW50ZXJ2YWwgPSAwOworICAgIH0KKworICAgIHNtc0xvZyhwTWFjLCBMT0czLCBGTCgiY2FsbGVkIikpOworICAgIGlmKCBzbWVDb21tYW5kUGVuZGluZyggcE1hYyApICkKKyAgICB7CisgICAgICAgIHNtc0xvZyggcE1hYywgTE9HMSwgRkwoIiAgQ2Fubm90IHJlcXVlc3QgSU1QUyBiZWNhdXNlIGNvbW1hbmQgcGVuZGluZyIpICk7CisgICAgICAgIC8vTm90IHRvIGVudGVyIElNUFMgYmVjYXVzZSBtb3JlIHdvcmsgdG8gZG8KKyAgICAgICAgaWYocFRpbWVJbnRlcnZhbCkKKyAgICAgICAgeworICAgICAgICAgICAgKnBUaW1lSW50ZXJ2YWwgPSAwOworICAgICAgICB9CisgICAgICAgIC8vcmVzdGFydCB3aGVuIHJlYWR5CisgICAgICAgIHBNYWMtPnNjYW4uZlJlc3RhcnRJZGxlU2NhbiA9IGVBTklfQk9PTEVBTl9UUlVFOworCisgICAgICAgIHJldHVybiAoc3RhdHVzKTsKKyAgICB9CisgICAgaWYgKElzUG1jSW1wc1JlcUZhaWxlZCAocE1hYykpCisgICAgeworICAgICAgICBpZihwVGltZUludGVydmFsKQorICAgICAgICB7CisgICAgICAgICAgICAqcFRpbWVJbnRlcnZhbCA9IDEwMDAwMDA7IC8vdXNlYworICAgICAgICB9CisgICAgICAgIC8vcmVzdGFydCB3aGVuIHJlYWR5CisgICAgICAgIHBNYWMtPnNjYW4uZlJlc3RhcnRJZGxlU2NhbiA9IGVBTklfQk9PTEVBTl9UUlVFOworCisgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgfQorCisgICAgaWYgKCAhcE1hYy0+ZGVmZXJJbXBzICYmIHBNYWMtPmZEZWZlcklNUFNUaW1lICkKKyAgICB7Cis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ElNRVJfVE9fTVNfVU5JVCwgY3NyU2NhbklNUFNDYWxsYmFjaywgcE1hYyk7CisgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYoZUhBTF9TVEFUVVNfUE1DX0FMUkVBRFlfSU5fSU1QUyAhPSBzdGF0dXMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9EbyByZXN0YXJ0IHRoZSB0aW1lciBpZiBDU1IgdGhpbmtzIGl0IGNhbm5vdCBkbyBJTVBTCisgICAgICAgICAgICAgICAgaWYoICFjc3JDaGVja1BTUmVhZHkoIHBNYWMgKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZihwVGltZUludGVydmFsKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICpwVGltZUludGVydmFsID0gMDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8vU2V0IHRoZSByZXN0YXJ0IGZsYWcgdG8gdHJ1ZSBiZWNhdXNlIHRoYXQgaWRsZSBzY2FuIAorICAgICAgICAgICAgICAgICAgICAvL2NhbiBiZSByZXN0YXJ0ZWQgZXZlbiB0aG91Z2ggdGhlIHRpbWVyIHdpbGwgbm90IGJlIHJ1bm5pbmcKKyAgICAgICAgICAgICAgICAgICAgcE1hYy0+c2Nhbi5mUmVzdGFydElkbGVTY2FuID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vRm9yIG5vdCBub3csIHdlIGRvIGEgcXVpY2tlciByZXRyeQorICAgICAgICAgICAgICAgICAgICBpZihwVGltZUludGVydmFsKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICpwVGltZUludGVydmFsID0gQ1NSX0lETEVfU0NBTl9XQUlUX1RJTUU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLCBGTCgiY2FsbCBwbWNSZXF1ZXN0SW1wcyBhbmQgaXQgcmV0dXJucyBzdGF0dXMgY29kZSAoJWQpIiksIHN0YXR1cyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csIEZMKCJhbHJlYWR5IGluIElNUFMiKSk7CisgICAgICAgICAgICAgICAgLy9TaW5jZSBDU1IgaXMgdGhlIG9ubHkgbW9kdWxlIHRvIHJlcXVlc3QgZm9yIElNUFMuIElmIGl0IGlzIGFscmVhZHkgaW4gSU1QUywgQ1NSIGFzc3VtZXMKKyAgICAgICAgICAgICAgICAvL3RoZSBjYWxsYmFjayB3aWxsIGJlIGNhbGxlZCBpbiB0aGUgZnV0dXJlLiBTaG91bGQgbm90IGhhcHBlbiB0aG91Z2guCisgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLm5JZGxlU2NhblRpbWVHYXAgPSAwOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLy9yZXF1ZXN0ZWQgc28gbGV0J3MgcmVzZXQgdGhlIHZhbHVlCisgICAgICAgICAgICBwTWFjLT5zY2FuLm5JZGxlU2NhblRpbWVHYXAgPSAwOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIChzdGF0dXMpOworfQorCisKK2VIYWxTdGF0dXMgY3NyU2NhblN0YXJ0SWRsZVNjYW4odHBBbmlTaXJHbG9iYWwgcE1hYykKK3sKKyAgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0NTUl9XUk9OR19TVEFURTsKK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ICAgICAgICAgIHBNYWMtPnNjYW4ubklkbGVTY2FuVGltZUdhcCA9IDA7CisgICAgICAgICAgICBjc3JTY2FuSU1QU0NhbGxiYWNrKHBNYWMsIGVIQUxfU1RBVFVTX1NVQ0NFU1MpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgY3NyU2NhblN0YXJ0SWRsZVNjYW5UaW1lcihwTWFjLCBuVGltZSk7CisgICAgICAgIH0KKyAgICB9CisgICAgaWYocE1hYy0+ZGVmZXJJbXBzKQorICAgIHsKKyAgICAgICAgcE1hYy0+c2Nhbi5mUmVzdGFydElkbGVTY2FuID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgIHBNYWMtPmRlZmVySW1wcyA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICB9Cit9CisKKworCisKK3RBTklfQk9PTEVBTiBjc3JTY2FuUmVtb3ZlTm90Um9hbWluZ1NjYW5Db21tYW5kKHRwQW5pU2lyR2xvYmFsIHBNYWMpCit7CisgICAgdEFOSV9CT09MRUFOIGZSZXQgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgdExpc3RFbGVtICpwRW50cnksICpwRW50cnlUbXA7CisgICAgdFNtZUNtZCAqcENvbW1hbmQ7CisgICAgdERibExpbmtMaXN0IGxvY2FsTGlzdDsKKyAgICB0RGJsTGlua0xpc3QgKnBDbWRMaXN0OworCisgICAgdm9zX21lbV96ZXJvKCZsb2NhbExpc3QsIHNpemVvZih0RGJsTGlua0xpc3QpKTsKKyAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKGNzckxMT3BlbihwTWFjLT5oSGRkLCAmbG9jYWxMaXN0KSkpCisgICAgeworICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiBmYWlsZWQgdG8gb3BlbiBsaXN0IikpOworICAgICAgICByZXR1cm4gZlJldDsKKyAgICB9CisgICAgaWYgKCFwTWFjLT5mU2Nhbk9mZmxvYWQpCisgICAgICAgIHBDbWRMaXN0ID0gJnBNYWMtPnNtZS5zbWVDbWRQZW5kaW5nTGlzdDsKKyAgICBlbHNlCisgICAgICAgIHBDbWRMaXN0ID0gJnBNYWMtPnNtZS5zbWVTY2FuQ21kUGVuZGluZ0xpc3Q7CisKKyAgICBjc3JMTExvY2socENtZExpc3QpOworICAgIHBFbnRyeSA9IGNzckxMUGVla0hlYWQocENtZExpc3QsIExMX0FDQ0VTU19OT0xPQ0spOworICAgIHdoaWxlKHBFbnRyeSkKKyAgICB7CisgICAgICAgIHBFbnRyeVRtcCA9IGNzckxMTmV4dChwQ21kTGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTk9MT0NLKTsKKyAgICAgICAgcENvbW1hbmQgPSBHRVRfQkFTRV9BRERSKHBFbnRyeSwgdFNtZUNtZCwgTGluayk7CisgICAgICAgIGlmKCBlU21lQ29tbWFuZFNjYW4gPT0gcENvbW1hbmQtPmNvbW1hbmQgKQorICAgICAgICB7CisgICAgICAgICAgICBzd2l0Y2goIHBDb21tYW5kLT51LnNjYW5DbWQucmVhc29uICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgIGNhc2UgZUNzclNjYW5JZGxlU2NhbjoKKyAgICAgICAgICAgICAgICBpZiggY3NyTExSZW1vdmVFbnRyeShwQ21kTGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTk9MT0NLKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBjc3JMTEluc2VydFRhaWwoJmxvY2FsTGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTk9MT0NLKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZlJldCA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfSAvL3N3aXRjaAorICAgICAgICB9CisgICAgICAgIHBFbnRyeSA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MaXN0OworICAgIGVsc2UKKyAgICAgICAgcENtZExpc3QgPSAmcE1hYy0+c21lLnNtZVNjYW5DbWRQZW5kaW5nTGlzdDsKKworICAgIGNzckxMTG9jayhwQ21kTGlzdCk7CisgICAgcEVudHJ5ID0gY3NyTExQZWVrSGVhZChwQ21kTGlzdCwgTExfQUNDRVNTX05PTE9DSyk7CisgICAgd2hpbGUocEVudHJ5KQorICAgIHsKKyAgICAgICAgcEVudHJ5VG1wID0gY3NyTExOZXh0KHBDbWRMaXN0LCBwRW50cnksIExMX0FDQ0VTU19OT0xPQ0spOworICAgICAgICBwQ29tbWFuZCA9IEdFVF9CQVNFX0FERFIocEVudHJ5LCB0U21lQ21kLCBMaW5rKTsKKyAgICAgICAgaWYoIChlU21lQ29tbWFuZFNjYW4gPT0gcENvbW1hbmQtPmNvbW1hbmQpICYmIChzZXNzaW9uSWQgPT0gcENvbW1hbmQtPnNlc3Npb25JZCkgKQorICAgICAgICB7CisgICAgICAgICAgICBzd2l0Y2gocENvbW1hbmQtPnUuc2NhbkNtZC5yZWFzb24pCisgICAgICAgICAgICB7CisjaWZkZWYgV0xBTl9GRUFUVVJFX1JPQU1fU0NBTl9PRkZMT0FECisgICAgICAgICAgICBjYXNlIGVDc3JTY2FuR2V0TGZyUmVzdWx0OgorI2VuZGlmCisgICAgICAgICAgICBjYXNlIGVDc3JTY2FuR2V0UmVzdWx0OgorICAgICAgICAgICAgY2FzZSBlQ3NyU2NhblNldEJHU2NhblBhcmFtOgorICAgICAgICAgICAgY2FzZSBlQ3NyU2NhbkJHU2NhbkFib3J0OgorICAgICAgICAgICAgY2FzZSBlQ3NyU2NhbkJHU2NhbkVuYWJsZToKKyAgICAgICAgICAgIGNhc2UgZUNzclNjYW5HZXRTY2FuQ2huSW5mbzoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgIHNtc0xvZyAocE1hYywgTE9HVywgIiVzOiAtLS0tLS0tLSBhYm9ydCBzY2FuIGNvbW1hbmQgcmVhc29uID0gJWQiLAorICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcENvbW1hbmQtPnUuc2NhbkNtZC5yZWFzb24pOworICAgICAgICAgICAgICAgIC8vVGhlIHJlc3QgYXJlIGZyZXNoIHNjYW4gcmVxdWVzdHMKKyAgICAgICAgICAgICAgICBpZiggY3NyTExSZW1vdmVFbnRyeShwQ21kTGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTk9MT0NLKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBjc3JMTEluc2VydFRhaWwoJmxvY2FsTGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTk9MT0NLKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZlJldCA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHBFbnRyeSA9IHBFbnRyeVRtcDsKKyAgICB9CisKKyAgICBjc3JMTFVubG9jayhwQ21kTGlzdCk7CisKKyAgICB3aGlsZSggKHBFbnRyeSA9IGNzckxMUmVtb3ZlSGVhZCgmbG9jYWxMaXN0LCBMTF9BQ0NFU1NfTk9MT0NLKSkgKQorICAgIHsKKyAgICAgICAgcENvbW1hbmQgPSBHRVRfQkFTRV9BRERSKHBFbnRyeSwgdFNtZUNtZCwgTGluayk7CisgICAgICAgIGlmIChwQ29tbWFuZC0+dS5zY2FuQ21kLmNhbGxiYWNrKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBVc2VyIHNjYW4gcmVxdWVzdCBpcyBwZW5kaW5nLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogc2VuZCByZXNwb25zZSB3aXRoIHN0YXR1cyBlQ1NSX1NDQU5fQUJPUlQqLworICAgICAgICAgICAgcENvbW1hbmQtPnUuc2NhbkNtZC5jYWxsYmFjayhwTWFjLCAKKyAgICAgICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnNjYW5DbWQucENvbnRleHQsIAorICAgICAgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUuc2NhbkNtZC5zY2FuSUQsIAorICAgICAgICAgICAgICAgICAgICAgZUNTUl9TQ0FOX0FCT1JUKTsKKyAgICAgICAgfQorICAgICAgICBjc3JSZWxlYXNlQ29tbWFuZFNjYW4oIHBNYWMsIHBDb21tYW5kICk7CisgICAgfQorICAgIGNzckxMQ2xvc2UoJmxvY2FsTGlzdCk7CisKKyAgICByZXR1cm4gKGZSZXQpOworfQorCisKK3ZvaWQgY3NyUmVsZWFzZVNjYW5Db21tYW5kKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRTbWVDbWQgKnBDb21tYW5kLCBlQ3NyU2NhblN0YXR1cyBzY2FuU3RhdHVzKQoreworICAgIGVDc3JTY2FuUmVhc29uIHJlYXNvbiA9IHBDb21tYW5kLT51LnNjYW5DbWQucmVhc29uOworICAgIHRBTklfQk9PTEVBTiBzdGF0dXM7CisKKyAgICBpZiAoIXBNYWMtPmZTY2FuT2ZmbG9hZCkKKyAgICB7CisgICAgICAgIHRBTklfVTMyIGk7CisgICAgICAgIGZvcihpID0gMDsgaSA8IENTUl9ST0FNX1NFU1NJT05fTUFYOyBpKyspCisgICAgICAgICAgICBjc3JSb2FtU3RhdGVDaGFuZ2UocE1hYywgcENvbW1hbmQtPnUuc2NhbkNtZC5sYXN0Um9hbVN0YXRlW2ldLCBpKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgY3NyUm9hbVN0YXRlQ2hhbmdlKHBNYWMsCisgICAgICAgICAgICAgICAgcENvbW1hbmQtPnUuc2NhbkNtZC5sYXN0Um9hbVN0YXRlW3BDb21tYW5kLT5zZXNzaW9uSWRdLAorICAgICAgICAgICAgICAgIHBDb21tYW5kLT5zZXNzaW9uSWQpOworICAgIH0KKworICAgIGNzclNjYW5DYWxsQ2FsbGJhY2socE1hYywgcENvbW1hbmQsIHNjYW5TdGF0dXMpOworCisgICAgc21zTG9nKHBNYWMsIExPRzMsICIgICBSZW1vdmUgU2NhbiBjb21tYW5kIHJlYXNvbiA9ICVkIiwgcmVhc29uKTsKKyAgICBpZiAocE1hYy0+ZlNjYW5PZmZsb2FkKQorICAgIHsKKyAgICAgICAgc3RhdHVzID0gY3NyTExSZW1vdmVFbnRyeSgmcE1hYy0+c21lLnNtZVNjYW5DbWRBY3RpdmVMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwQ29tbWFuZC0+TGluaywgTExfQUNDRVNTX0xPQ0spOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBzdGF0dXMgPSBjc3JMTFJlbW92ZUVudHJ5KCZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcENvbW1hbmQtPkxpbmssIExMX0FDQ0VTU19MT0NLKTsKKyAgICB9CisKKyAgICBpZihzdGF0dXMpCisgICAgeworICAgICAgICBjc3JSZWxlYXNlQ29tbWFuZFNjYW4oIHBNYWMsIHBDb21tYW5kICk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICIgKioqKioqKipjc3JSZWxlYXNlU2NhbkNvbW1hbmQgY2Fubm90IHJlbGVhc2UgY29tbWFuZCByZWFzb24gJWQiLAorICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnNjYW5DbWQucmVhc29uICk7CisgICAgfQorfQorCisKK2VIYWxTdGF0dXMgY3NyU2NhbkdldFBNS0lEQ2FuZGlkYXRlTGlzdCh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UzMiBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFBta2lkQ2FuZGlkYXRlSW5mbyAqcFBta2lkTGlzdCw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9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9zZXQocFNjYW5GaWx0ZXIsIHNpemVvZih0Q3NyU2NhblJlc3VsdEZpbHRlciksIDApOworICAgICAgICAgICAgLy9IZXJlIGlzIHRoZSBwcm9maWxlIHdlIG5lZWQgdG8gY29ubmVjdCB0bworICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbVByZXBhcmVGaWx0ZXJGcm9tUHJvZmlsZShwTWFjLCBwU2Vzc2lvbi0+cEN1clJvYW1Qcm9maWxlLCBwU2NhbkZpbHRlcik7CisgICAgICAgICAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JTY2FuR2V0UmVzdWx0KHBNYWMsIHBTY2FuRmlsdGVyLCAmaEJTU0xpc3QpOworICAgICAgICAgICAgICAgIGlmKEhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgd2hpbGUoKChwU2NhblJlc3VsdCA9IGNzclNjYW5SZXN1bHRHZXROZXh0KHBNYWMsIGhCU1NMaXN0KSkgIT0gTlVMTCkgJiYgKCBwU2Vzc2lvbi0+TnVtUG1raWRDYW5kaWRhdGUgPCBuSXRlbXMpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvL051bVBta2lkQ2FuZGlkYXRlIGFkZHMgdXAgaGVyZQorICAgICAgICAgICAgICAgICAgICAgICAgY3NyUHJvY2Vzc0JTU0Rlc2NGb3JQTUtJRExpc3QocE1hYywgJnBTY2FuUmVzdWx0LT5Cc3NEZXNjcmlwdG9yLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0RG90MTFmQmVhY29uSUVzICopKCBwU2NhblJlc3VsdC0+cHZJZXMgKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYocFNlc3Npb24tPk51bVBta2lkQ2FuZGlkYXRlKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAqcE51bUl0ZW1zID0gcFNlc3Npb24tPk51bVBta2lkQ2FuZGlkYXRlOworICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBQbWtpZExpc3QsIHBTZXNzaW9uLT5QbWtpZENhbmRpZGF0ZUluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPk51bVBta2lkQ2FuZGlkYXRlICogc2l6ZW9mKHRQbWtpZENhbmRpZGF0ZUluZm8pKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBjc3JTY2FuUmVzdWx0UHVyZ2UocE1hYywgaEJTU0xpc3QpOworICAgICAgICAgICAgICAgIH0vL0hhdmUgc2NhbiByZXN1bHQKKyAgICAgICAgICAgICAgICBjc3JGcmVlU2NhbkZpbHRlcihwTWFjLCBwU2NhbkZpbHRlcik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocFNjYW5GaWx0ZXIpOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIChzdGF0dXMpOworfQorCisKKworI2lmZGVmIEZFQVRVUkVfV0xBTl9XQVBJCitlSGFsU3RhdHVzIGNzclNjYW5HZXRCS0lEQ2FuZGlkYXRlTGlzdCh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UzMiBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QmtpZENhbmRpZGF0ZUluZm8gKnBCa2lkTGlzdCwgdEFOSV9VMzIgKnBOdW1JdGVtcyApCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgP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B2b3NfbWVtX3NldChwU2NhbkZpbHRlciwgc2l6ZW9mKHRDc3JTY2FuUmVzdWx0RmlsdGVyKSwgMCk7CisgICAgICAgICAgICAvL0hlcmUgaXMgdGhlIHByb2ZpbGUgd2UgbmVlZCB0byBjb25uZWN0IHRvCisgICAgICAgICAgICBzdGF0dXMgPSBjc3JSb2FtUHJlcGFyZUZpbHRlckZyb21Qcm9maWxlKHBNYWMsIHBTZXNzaW9uLT5wQ3VyUm9hbVByb2ZpbGUsIHBTY2FuRmlsdGVyKTsKKyAgICAgICAgICAgIGlmKEhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclNjYW5HZXRSZXN1bHQocE1hYywgcFNjYW5GaWx0ZXIsICZoQlNTTGlzdCk7CisgICAgICAgICAgICAgICAgaWYoSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB3aGlsZSgoKHBTY2FuUmVzdWx0ID0gY3NyU2NhblJlc3VsdEdldE5leHQocE1hYywgaEJTU0xpc3QpKSAhPSBOVUxMKSAmJiAoIHBTZXNzaW9uLT5OdW1Ca2lkQ2FuZGlkYXRlIDwgbkl0ZW1zKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLy9wTWFjLT5zY2FuLk51bUJraWRDYW5kaWRhdGUgYWRkcyB1cCBoZXJlCisgICAgICAgICAgICAgICAgICAgICAgICBjc3JQcm9jZXNzQlNTRGVzY0ZvckJLSURMaXN0KHBNYWMsICZwU2NhblJlc3VsdC0+QnNzRGVzY3JpcHRvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0RG90MTFmQmVhY29uSUVzICopKCBwU2NhblJlc3VsdC0+cHZJZXMgKSk7CisKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZihwU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hbkNtZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QsIHNpemVvZih0Q3NyU2NhblJlcXVlc3QpLCAwKTsKKyAgICAgICAgICAgIHBTY2FuQ21kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdC5zY2FuVHlwZSA9IGVTSVJfQUNUSVZFX1NDQU47CisgICAgICAgICAgICBwU2NhbkNtZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QuQlNTVHlwZSA9IHBQcm9maWxlLT5CU1NUeXBlOworICAgICAgICAgICAgLy8gVG8gYXZvaWQgMTFiIHJhdGUgaW4gcHJvYmUgcmVxdWVzdCBTZXQgcDJwU2VhcmNoIGZsYWcgYXMgMSBmb3IgUDJQIENsaWVudCBNb2RlCisgICAgICAgICAgICBpZihWT1NfUDJQX0NMSUVOVF9NT0RFID09IHBQcm9maWxlLT5jc3JQZXJzb25hKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBTY2FuQ21kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdC5wMnBTZWFyY2ggPSAxOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYocFByb2ZpbGUtPm5BZGRJRVNjYW5MZW5ndGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LnBJRUZpZWxkID0gdm9zX21lbV9tYWxsb2MoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByb2ZpbGUtPm5BZGRJRVNjYW5MZW5ndGgpOworICAgICAgICAgICAgICAgIGlmICggTlVMTCA9PSBwU2NhbkNtZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QucElFRmllbGQgKQorICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX3NldChwU2NhbkNtZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QucElFRmllbGQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByb2ZpbGUtPm5BZGRJRVNjYW5MZW5ndGgsIDApOworICAgICAgICAgICAgICAgIGlmIChIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwU2NhbkNtZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QucElFRmllbGQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUHJvZmlsZS0+YWRkSUVTY2FuLCBwUHJvZmlsZS0+bkFkZElFU2Nhbkxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgIHBTY2FuQ21kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdC51SUVGaWVsZExlbiA9IHBQcm9maWxlLT5uQWRkSUVTY2FuTGVuZ3RoOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgIk5vIG1lbW9yeSBmb3Igc2Nhbm5pbmcgSUUgZmllbGRzIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSAvL0FsbG9jYXRlIG1lbW9yeSBmb3IgSUUgZmllbGQKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwU2NhbkNtZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QudUlFRmllbGRMZW4gPSAwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLyogRm9yIG9uZSBjaGFubmVsIGJlIGdvb2QgZW5wdWdoIHRpbWUgdG8gcmVjZWl2ZSBiZWFjb24gYXRsZWFzdCAqLworICAgICAgICAgICAgaWYoICAxID09IHBQcm9maWxlLT5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0Lm1heENoblRpbWUgPSBNQVhfQUNUSVZFX1NDQU5fRk9SX09ORV9DSEFOTkVMOworICAgICAgICAgICAgICAgICBwU2NhbkNtZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QubWluQ2huVGltZSA9IE1JTl9BQ1RJVkVfU0NBTl9GT1JfT05FX0NIQU5ORUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIHBTY2FuQ21kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdC5tYXhDaG5UaW1lID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uQWN0aXZlTWF4Q2huVGltZTsKKyAgICAgICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0Lm1pbkNoblRpbWUgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLm5BY3RpdmVNaW5DaG5UaW1lOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0Lm1heENoblRpbWVCdGMgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLm5BY3RpdmVNYXhDaG5UaW1lQnRjOworICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0Lm1pbkNoblRpbWVCdGMgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLm5BY3RpdmVNaW5DaG5UaW1lQnRjOworICAgICAgICAgICAgaWYocFByb2ZpbGUtPkJTU0lEcy5udW1PZkJTU0lEcyA9PSAxKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwU2NhbkNtZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QuYnNzaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQcm9maWxlLT5CU1NJRHMuYnNzaWQsIHNpemVvZih0Q3NyQnNzaWQpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocFNjYW5DbWQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LmJzc2lkLCBiQWRkciwgNik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZihwUHJvZmlsZS0+Q2hhbm5lbEluZm8ubnVtT2ZDaGFubmVscykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwU2NhbkNtZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QuQ2hhbm5lbEluZm8uQ2hhbm5lbExpc3QgPSB2b3NfbWVtX21hbGxvYygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZigqcFNjYW5DbWQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBwUHJvZmlsZS0+Q2hhbm5lbEluZm8ubnVtT2ZDaGFubmVscyk7CisgICAgICAgICAgICAgICAgaWYgKCBOVUxMID09IHBTY2FuQ21kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdC5DaGFubmVsSW5mby5DaGFubmVsTGlzdCApCisgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgICAgIHBTY2FuQ21kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdC5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzID0gMDsKKyAgICAgICAgICAgICAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBjc3JSb2FtSXNDaGFubmVsVmFsaWQocE1hYywgcFByb2ZpbGUtPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0WzBdKTsKKyAgICAgICAgICAgICAgICAgIGZvcihpbmRleCA9IDA7IGluZGV4IDwgcFByb2ZpbGUtPkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHM7IGluZGV4KyspCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICBpZihjc3JSb2FtSXNWYWxpZENoYW5uZWwocE1hYywgcFByb2ZpbGUtPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0W2luZGV4XSkpCisgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwU2NhbkNtZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QuQ2hhbm5lbEluZm8uQ2hhbm5lbExpc3RbcFNjYW5DbWQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHNdIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgPSBwUHJvZmlsZS0+Q2hhbm5lbEluZm8uQ2hhbm5lbExpc3RbaW5kZXhdOworICAgICAgICAgICAgICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHMrKzsKKyAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgIGVsc2UgCisgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csIEZMKCJwcm9jZXNzIGEgY2hhbm5lbCAoJWQpIHRoYXQgaXMgaW52YWxpZCIpLCBwUHJvZmlsZS0+Q2hhbm5lbEluZm8uQ2hhbm5lbExpc3RbaW5kZXhdKTsKKyAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LkNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHMgPSAwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYocFByb2ZpbGUtPlNTSURzLm51bU9mU1NJRHMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcFNjYW5DbWQtPnUuc2NhbkNtZC51LnNjYW5SZXF1ZXN0LlNTSURzLlNTSURMaXN0ID0gdm9zX21lbV9tYWxsb2MoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByb2ZpbGUtPlNTSURzLm51bU9mU1NJRHMgKiBzaXplb2YodENzclNTSURJbmZvKSk7CisgICAgICAgICAgICAgICAgaWYgKCBOVUxMID09IHBTY2FuQ21kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdC5TU0lEcy5TU0lETGlzdCApCisgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwU2NhbkNtZC0+dS5zY2FuQ21kLnUuc2NhblJlcXVlc3QuU1NJRHMubnVtT2ZTU0lEcyA9IDE7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBTY2FuQ21kLT51LnNjYW5DbWQudS5zY2FuUmVxdWVzdC5TU0lEcy5TU0lETGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByb2ZpbGUtPlNTSURzLlNTSURMaXN0LCBzaXplb2YodENzclNTSURJbmZvKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvL1N0YXJ0IHByb2Nlc3MgdGhlIGNvbW1hbmQKKyAgICAgICAgICAgIHN0YXR1cyA9IGNzclF1ZXVlU21lQ29tbWFuZChwTWFjLCBwU2NhbkNtZCwgZUFOSV9CT09MRUFOX0ZBTFNFKTsKKyAgICAgICAgICAgIGlmKCAhSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiIGZhaWwgdG8gc2VuZCBtZXNzYWdlIHN0YXR1cyA9ICVkIiksIHN0YXR1cyApOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9d2hpbGUoMCk7CisgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYocFNjYW5DbWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY3NyUmVsZWFzZUNvb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Fyb3VuZAorICAgICAgICAgICAgc3RhdHVzID0gY3NyUXVldWVTbWVDb21tYW5kKHBNYWMsIHBTY2FuQ21kLCBlQU5JX0JPT0xFQU5fRkFMU0UpOworICAgICAgICAgICAgaWYoICFIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCIgZmFpbCB0byBzZW5kIG1lc3NhZ2Ugc3RhdHVzID0gJWQiKSwgc3RhdHVzICk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH13aGlsZSgwKTsKKyAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICB7CisgICAgICAgICAgICBpZihwU2NhbkNtZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjc3JSZWxlYXNlQ29tbWFuZFNjYW4ocE1hYywgcFNjYW5DbWQpOworICAgICAgICAgICAgfQorICAgICAgICB9ICAgIAorICAgIH0KKworICAgIHJldHVybiAoc3RhdHVzKTsKK30KKworCisKK3ZvaWQgY3NySW5pdEJHU2NhbkNoYW5uZWxMaXN0KHRwQW5pU2lyR2xvYmFsIHBNYWMpCit7CisgICAgdEFOSV9VMzIgbGVuID0gQ1NSX01JTihzaXplb2YocE1hYy0+cm9hbS52YWxpZENoYW5uZWxMaXN0KSwgc2l6ZW9mKHBNYWMtPnNjYW4uYmdTY2FuQ2hhbm5lbExpc3QpKTsKKworICAgIHZvc19tZW1fc2V0KHBNYWMtPnNjYW4uYmdTY2FuQ2hhbm5lbExpc3QsIGxlbiwgMCk7CisgICAgcE1hYy0+c2Nhbi5udW1CR1NjYW5DaGFubmVsID0gMDsKKworICAgIGlmKEhBTF9TVEFUVVNfU1VDQ0VTUyhjc3JHZXRDZmdWYWxpZENoYW5uZWxzKHBNYWMsIHBNYWMtPnJvYW0udmFsaWRDa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udCA9ICpwTnVtQWRqdXN0Q2hhbm5lbHM7CisKKyAgICBpID0gMDsKKyAgICB3aGlsZShpIDwgY291bnQpCisgICAgeworICAgICAgICBmb3IoaiA9IDA7IGogPCBOdW1DaGFubmVsczsgaisrKQorICAgICAgICB7CisgICAgICAgICAgICBpZihwQ2hhbm5lbExpc3Rbal0gPT0gcEFkanVzdENoYW5uZWxzW2ldKQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGlmKGogPT0gTnVtQ2hhbm5lbHMpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vVGhpcyBjaGFubmVsIGlzIG5vdCBpbiB0aGUgbGlzdCwgcmVtb3ZlIGl0CisgICAgICAgICAgICBmUmV0ID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICBjb3VudC0tOworICAgICAgICAgICAgaWYoY291bnQgLSBpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmcEFkanVzdENoYW5uZWxzW2ldLCAmcEFkanVzdENoYW5uZWxzW2krMV0sIGNvdW50IC0gaSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9hbHJlYWR5IHJlbW92ZSB0aGUgbGFzdCBvbmUuIERvbmUuCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBpKys7CisgICAgICAgIH0KKyAgICB9Ly93aGlsZShpPGNvdW50KQorICAgICpwTnVtQWRqdXN0Q2hhbm5lbHMgPSBjb3VudDsKKworICAgIHJldHVybiAoZlJldCk7Cit9CisKKworLy9HZXQgdGhlIGxpc3Qgb2YgdGhlIGJhc2UgY2hhbm5lbHMgdG8gc2NhbiBmb3IgcGFzc2l2ZWx5IDExZCBpbmZvCitlSGFsU3RhdHVzIGNzclNjYW5HZXRTdXBwb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ZXhwYW5kaW5nIHRoaXMgZW50cnkgd2lsbCBvdmVyZmxvdyBvdXIgYWxsb2NhdGlvbgorICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogQnVmZmVyIG92ZXJmbG93LCBzdGFydCAlZCwgbnVtICVkLCBvZmZzZXQgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2hhbm5lbFNldC0+Zmlyc3RDaGFubmVsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcENoYW5uZWxTZXQtPm51bUNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcENoYW5uZWxTZXQtPmludGVyQ2hhbm5lbE9mZnNldCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGZvciggaWR4ID0gMDsgaWR4IDwgcENoYW5uZWxTZXQtPm51bUNoYW5uZWxzOyBpZHgrKyApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwQ2hhbm5lbFBvd2VyU2V0LT5maXJzdENoYW5OdW0gPSAodFNpck1hY0NoYW5OdW0pKHBDaGFubmVsU2V0LT5maXJzdENoYW5uZWwgKyAoIGlkeCAqIHBDaGFubmVsU2V0LT5pbnRlckNoYW5uZWxPZmZzZXQgKSk7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0czLCAiIFNldHRpbmcgQ2hhbm5lbCBOdW1iZXIgJWQiLCBwQ2hhbm5lbFBvd2VyU2V0LT5maXJzdENoYW5OdW0pOworICAgICAgICAgICAgICAgICAgICBwQ2hhbm5lbFBvd2VyU2V0LT5udW1DaGFubmVscyAgPSAxOworICAgICAgICAgICAgICAgICAgICBwQ2hhbm5lbFBvd2VyU2V0LT5tYXhUeFBvd2VyID0gQ1NSX1JPQU1fTUlOKCBwQ2hhbm5lbFNldC0+dHhQb3dlciwgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uVHhQb3dlckNhcCApOworICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HMywgIiBTZXR0aW5nIE1heCBUcmFuc21pdCBQb3dlciAlZCIsIHBDaGFubmVsUG93ZXJTZXQtPm1heFR4UG93ZXIpOworICAgICAgICAgICAgICAgICAgICBjYkxlbiArPSBzaXplb2YoIHRTaXJNYWNDaGFuSW5mbyApOworICAgICAgICAgICAgICAgICAgICBwQ2hhbm5lbFBvd2VyU2V0Kys7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChjYkxlbiA+PSBkYXRhTGVuKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gdGhpcyBlbnRyeSB3aWxsIG92ZXJmbG93IG91ciBhbGxvY2F0aW9uCisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBCdWZmZXIgb3ZlcmZsb3csIHN0YXJ0ICVkLCBudW0gJWQsIG9mZnNldCAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDaGFubmVsU2V0LT5maXJzdENoYW5uZWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2hhbm5lbFNldC0+bnVtQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2hhbm5lbFNldC0+aW50ZXJDaGFubmVsT2Zmc2V0KTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHBDaGFubmVsUG93ZXJTZXQtPmZpcnN0Q2hhbk51bSA9IHBDaGF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gICAgICAgICAgICAqcGJMZW4gPSAodEFOSV9VOClsZW47CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcmV0dXJuIChzdGF0dXMpOworfQorCisKK3ZvaWQgY3NyU2V0Q2ZnU2NhbkNvbnRyb2xMaXN0KCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4ICpjb3VudHJ5Q29kZSwgdENzckNoYW5uZWwgKnBDaGFubmVsTGlzdCAgKQoreyAgIAorICAgIHRBTklfVTggaSwgaiwgazsKKyAgICB0QU5JX0JPT0xFQU4gZm91bmQ9RkFMU0U7ICAKKyAgICB0QU5JX1U4ICpwQ29udHJvbExpc3QgPSBOVUxMOworICAgIHRBTklfVTMyIGxlbiA9IFdOSV9DRkdfU0NBTl9DT05UUk9MX0xJU1RfTEVOOworICAgIHRBTklfVTggY2ZnQWN0aXZlREZTQ2hhbm5lbHMgPSAwOworICAgIHRBTklfVTggKmNmZ0FjdGl2ZURGU0NoYW5uZWxMSXN0ID0gTlVMTDsKKworICAgIGlmICggKHBDb250cm9sTGlzdCA9IHZvc19tZW1fbWFsbG9jKFdOSV9DRkdfU0NBTl9DT05UUk9MX0xJU1RfTEVOKSkgIT0gTlVMTCApCisgICAgeworICAgICAgICB2b3NfbWVtX3NldCgodm9pZCAqKXBDb250cm9sTGlzdCwgV05JX0NGR19TQ0FOX0NPTlRST0xfTElTVF9MRU4sIDApOworICAgICAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1MoY2NtQ2ZnR2V0U3RyKHBNYWMsIFdOSV9DRkdfU0NBTl9DT05UUk9MX0xJU1QsIHBDb250cm9sTGlzdCwgJmxlbikpKQorICAgICAgICB7CisgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcENoYW5uZWxMaXN0LT5udW1DaGFubmVsczsgaSsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBsZW47IGogKz0gMikgCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAocENvbnRyb2xMaXN0W2pdID09IHBDaGFubmVsTGlzdC0+Y2hhbm5lbExpc3RbaV0pIAorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3VuZCA9IFRSVUU7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBpZiAoZm91bmQpICAgIC8vIGluc2VydCBhIHBhaXIoY2hhbm5lbCMsIGZsYWcpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwQ29udHJvbExpc3RbaisxXSA9IGNzckdldFNjYW5UeXBlKHBNYWMsIHBDb250cm9sTGlzdFtqXSk7CisgICAgICAgICAgICAgICAgICAgIGZvdW5kID0gRkFMU0U7ICAvLyByZXNldCB0aGUgZmxhZworCisgICAgICAgICAgICAgICAgICAgIC8vIFdoZW4gREZTIG1vZGUgaXMgMiwgbWFyayBzdGF0aWMgY2hhbm5lbHMgYXMgYWN0aXZlCisgICAgICAgICAgICAgICAgICAgIGlmIChwTWFjLT5zY2FuLmZFbmFibGVERlNDaG5sU2NhbiA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBERlNfQ0hOTF9TQ0FOX0VOQUJMRURfQUNUSVZFKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBjZmdBY3RpdmVERlNDaGFubmVscyA9CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0ubmVpZ2hib3JSb2FtSW5mby5jZmdQYXJhbXMuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHM7CisgICAgICAgICAgICAgICAgICAgICAgICBjZmdBY3RpdmVERlNDaGFubmVsTElzdCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0ubmVpZ2hib3JSb2FtSW5mby5jZmdQYXJhbXMuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0OworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNmZ0FjdGl2ZURGU0NoYW5uZWxMSXN0KQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChrPTA7IGsgPCBjZmdBY3RpdmVERlNDaGFubmVsczsgaysrKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKENTUl9JU19DSEFOTkVMX0RGUyhjZmdBY3RpdmVERlNDaGFubmVsTElzdFtrXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgKHBDb250cm9sTGlzdFtqXSA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZmdBY3RpdmVERlNDaGFubmVsTElzdFtrXSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ29udHJvbExpc3RbaisxXSA9IGVTSVJfQUNUSVZFX1NDQU47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCBGTCgiTWFya2VkIERGUyBjaCAlZCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgYXMgYWN0aXZlIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZmdBY3RpdmVERlNDaGFubmVsTElzdFtrXSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HMSwgRkwoImZFbmFibGVERlNDaG5sU2NhbiAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+c2Nhbi5mRW5hYmxlREZTQ2hubFNjYW4pOworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IGR1bXAgc2NhbiBjb250cm9sIGxpc3QiLF9fZnVuY19fKTsKKyAgICAgICAgICAgIFZPU19UUkFDRV9IRVhfRFVNUChWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvbnRyb2xMaXN0LCBsZW4pOworCisgICAgICAgICAgICBjY21DZmdTZXRTdHIocE1hYywgV05JX0NGR19TQ0FOX0NPTlRST0xfTElTVCwgcENvbnRyb2xMaXN0LCBsZW4sIE5VTEwsIGVBTklfQk9PTEVBTl9GQUxTRSk7CisgICAgICAgIH0vL1N1Y2Nlc3NmdWxseSBnZXR0aW5nIHNjYW4gY29udHJvbCBsaXN0CisgICAgICAgIHZvc19tZW1fZnJlZShwQ29udHJvbExpc3QpOworICAgIH0vL0FsbG9jYXRlTWVtb3J5Cit9CisKKy8vaWYgYmdQZXJpb2QgaXMgMCwgYmFja2dyb3VuZCBzY2FuIGlzIGRpc2FibGVkLiBJdCBpcyBpbiBtaWxsaXNlY29uZCB1bml0cworZUhhbFN0YXR1cyBjc3JTZXRDZmdCYWNrZ3JvdW5kU2NhblBlcmlvZCh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UzMiBiZ1BlcmlvZCkKK3sKKyAgICByZXR1cm4gKGNjbUNmZ1NldEludChwT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AgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocFNjYW5Mb2ctPmNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjYW5SZXEtPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjYW5Mb2ctPm51bUNoYW5uZWwpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBXTEFOX1ZPU19ESUFHX0xPR19SRVBPUlQocFNjYW5Mb2cpOworICAgICAgICAgICAgfQorICAgICAgICB9CisjZW5kaWYgLy8jaWZkZWYgRkVBVFVSRV9XTEFOX0RJQUdfU1VQUE9SVF9DU1IKKworICAgICAgICBzdGF0dXMgPSBjY21DZmdTZXRJbnQocE1hYywgV05JX0NGR19CQUNLR1JPVU5EX1NDQU5fUEVSSU9ELCBwU2NhblJlcS0+c2NhbkludGVydmFsLCBOVUxMLCBlQU5JX0JPT0xFQU5fRkFMU0UpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAvL05vIG5lZWQgdG8gc3RvcCBhZ2luZyBiZWNhdXNlIElETEUgc2NhbiBpcyBzdGlsbCBydW5uaW5nCisgICAgICAgIHN0YXR1cyA9IGNjbUNmZ1NldEludChwTWFjLCBXTklfQ0ZHX0JBQ0tHUk9VTkRfU0NBTl9QRVJJT0QsIDAsIE5VTEwsIGVBTklfQk9PTEVBTl9GQUxTRSk7CisgICAgfQorICAgIAorICAgIGlmKHBTY2FuUmVxLT5TU0lELmxlbmd0aCA+IFdOSV9DRkdfU1NJRF9MRU4pCisgICAgeworICAgICAgICBwU2NhblJlcS0+U1NJRC5sZW5ndGggPSBXTklfQ0ZHX1NTSURfTEVOOworICAgIH0KKyAgICAKKyAgICBzdGF0dXMgPSBjY21DZmdTZXRTdHIocE1hYywgV05JX0NGR19CR19TQ0FOX0NIQU5ORUxfTElTVCwgcFNjYW5SZXEtPkN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AgICAgIGVTbWVDb21tYW5kU2Nhbik7CisgICAgICAgIHBNYWMtPnNjYW4uZkRyb3BTY2FuQ21kID0gZUFOSV9CT09MRUFOX0ZBTFNFOworCisgICAgICAgIHBFbnRyeSA9IGNzckxMUGVla0hlYWQoJnBNYWMtPnNtZS5zbWVTY2FuQ21kQWN0aXZlTGlzdCwgTExfQUNDRVNTX0xPQ0spOworICAgIH0KKworICAgIC8vV2UgbmVlZCB0byBhYm9ydCBzY2FuIG9ubHkgaWYgd2UgYXJlIHNjYW5uaW5nCisgICAgaWYoTlVMTCAhPSBwRW50cnkpCisgICAgeworICAgICAgICBwQ29tbWFuZCA9IEdFVF9CQVNFX0FERFIoIHBFbnRyeSwgdFNtZUNtZCwgTGluayApOworICAgICAgICBpZihlU21lQ29tbWFuZFNjYW4gPT0gcENvbW1hbmQtPmNvbW1hbmQgJiYKKyAgICAgICAgICAgcENvbW1hbmQtPnNlc3Npb25JZCA9PSBzZXNzaW9uSWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIG1zZ0xlbiA9ICh0QU5JX1UxNikoc2l6ZW9mKHRTaXJTbWVTY2FuQWJvcnRSZXEpKTsKKyAgICAgICAgICAgIHBNc2cgPSB2b3NfbWVtX21hbGxvYyhtc2dMZW4pOworICAgICAgICAgICAgaWYgKCBOVUxMID09IHBNc2cgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gYWxsb2NhdGUgbWVtb3J5IGZvciBTbWVTY2FuQWJvcnRSZXEiKSk7CisgICAgICAgICAgICAgICBhYm9ydFNjYW5TdGF0dXMgPSBlU0lSX0FCT1JUX1NDQU5fRkFJTFVSRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwQ29tbWFuZC0+dS5zY2FuQ21kLmFib3J0U2NhbkluZGljYXRpb24gPSBlQ1NSX1NDQU5fQUJPUlRfREVGQVVMVDsKKyAgICAgICAgICAgICAgICBpZihyZWFzb24gPT0gZUNTUl9TQ0FOX0FCT1JUX0RVRV9UT19CQU5EX0NIQU5HRSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnNjYW5DbWQuYWJvcnRTY2FuSW5kaWNhdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgPSBlQ1NSX1NDQU5fQUJPUlRfRFVFX1RPX0JBTkRfQ0hBTkdFOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB2b3NfbWVtX3NldCgodm9pZCAqKXBNc2csIG1zZ0xlbiwgMCk7CisgICAgICAgICAgICAgICAgcE1zZy0+dHlwZSA9IHBhbF9jcHVfdG9fYmUxNigodEFOSV9VMTYpZVdOSV9TTUVfU0NBTl9BQk9SVF9JTkQpOworICAgICAgICAgICAgICAgIHBNc2ctPm1zZ0xlbiA9IHBhbF9jcHVfdG9fYmUxNihtc2dMZW4pOworICAgICAgICAgICAgICAgIHBNc2ctPnNlc3Npb25JZCA9IHNlc3Npb25JZDsKKyAgICAgICAgICAgICAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSBwYWxTZW5kTUJNZXNzYWdlKHBNYWMtPmhIZGQsIHBNc2cpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiRmFpbGVkIHRvIHBvc3QgZVdOSV9TTUVfU0NBTl9BQk9SVF9JTkQiKSk7CisgICAgICAgICAgICAgICAgICAgIGFib3J0U2NhblN0YXR1cyA9IGVTSVJfQUJPUlRfU0NBTl9GQUlMVVJFOworICAgICAgICAgICAgICAgICAgICBwQ29tbWFuZC0+dS5zY2FuQ21kLmFib3J0U2NhbkluZGljYXRpb24gPSAwOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBhYm9ydFNjYW5TdGF0dXMgPSBlU0lSX0FCT1JUX0FDVElWRV9TQ0FOX0xJU1RfTk9UX0VNUFRZOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybihhYm9ydFNjYW5TdGF0dXMpOworfQorCit2b2lkIGNzclJlbW92ZUNtZFdpdGhTZXNzaW9uSWRGcm9tUGVuZGluZ0xpc3QodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IHNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RGJsTGlua0xpc3QgKnBMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTbWVDb21tYW5kVHlwZSBjb21tYW5kVHlwZSkKK3sKKyAgICB0RGJsTGlua0xpc3QgbG9jYWxMaXN0OworICAgIHRMaXN0RWxlbSAqcEVudHJ5OworICAgIHRTbWVDbWQgICAqcENvbW1hbmQ7CisgICAgdExpc3RFbGVtICAqcEVudHJ5VG9SZW1vdmU7CisKKyAgICB2b3NfbWVtX3plcm8oJmxvY2FsTGlzdCwgc2l6ZW9mKHREYmxMaW5rTGlzdCkpOworICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1MoY3NyTExPcGVuKHBNYWMtPmhIZGQsICZsb2NhbExpc3QpKSkKKyAgICB7CisgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiIGZhaWxlZCB0byBvcGVuIGxpc3QiKSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBjc3JMTExvY2socExpc3QpOworICAgIGlmICgocEVudHJ5ID0gY3NyTExQZWVrSGVhZCggcExpc3QsIExMX0FDQ0VTU19OT0xPQ0spKSkKKyAgICB7CisKKyAgICAgICAgLyogSGF2ZSB0byBtYWtlIHN1cmUgd2UgZG9uJ3QgbG9vcCBiYWNrIHRvIHRoZSBoZWFkIG9mIHRoZSBsaXN0LAorICAgICAgICAgKiB3aGljaCB3aWxsIGhhcHBlbiBpZiB0aGUgZW50cnkgaXMgTk9UIG9uIHRoZSBsaXN0ICovCisgICAgICAgIHdoaWxlIChwRW50cnkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBFbnRyeVRvUmVtb3ZlID0gcEVudHJ5OworICAgICAgICAgICAgcEVudHJ5ID0gY3NyTExOZXh0KHBMaXN0LCBwRW50cnksIExMX0FDQ0VTU19OT0xPQ0spOworICAgICAgICAgICAgcENvbW1hbmQgPSBHRVRfQkFTRV9BRERSKCBwRW50cnlUb1JlbW92ZSwgdFNtZUNtZCwgTGluayApOworICAgICAgICAgICAgaWYgKChwQ29tbWFuZC0+Y29tbWFuZCA9PSBjb21tYW5kVHlwZSkgICYmCisgICAgICAgICAgICAgICAgICAgIChwQ29tbWFuZC0+c2Vzc2lvbklkID09IHNlc3Npb25JZCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogUmVtb3ZlIHRoYXQgZW50cnkgb25seSAqLworICAgICAgICAgICAgICAgIGlmIChjc3JMTFJlbW92ZUVudHJ5KCBwTGlzdCwgcEVudHJ5VG9SZW1vdmUsIExMX0FDQ0VTU19OT0xPQ0spKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY3NyTExJbnNlcnRUYWlsKCZsb2NhbExpc3QsIHBFbnRyeVRvUmVtb3ZlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTExfQUNDRVNTX05PTE9DSyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIGNzckxMVW5sb2NrKHBMaXN0KTsKKworICAgIHdoaWxlICgocEVudHJ5ID0gY3NyTExSZW1vdmVIZWFkKCZsb2NhbExpc3QsIExMX0FDQ0VTU19OT0xPQ0spKSkKKyAgICB7CisgICAgICAgIHBDb21tYW5kID0gR0VUX0JBU0VfQUREUihwRW50cnksIHRTbWVDbWQsIExpbmspOworICAgICAgICBjc3JBYm9ydENvbW1hbmQocE1hYywgcENvbW1hbmQsIGVBTklfQk9PTEVBTl9GQUxTRSk7CisgICAgfQorCisgICAgY3NyTExDbG9zZSgmbG9jYWxMaXN0KTsKK30KKwordm9pZCBjc3JSZW1vdmVDbWRGcm9tUGVuZGluZ0xpc3QodHBBbmlTaXJHbG9iYWwgcE1hYywgdERibExpbmtMaXN0ICpwTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTbWVDb21tYW5kVHlwZSBjb21tYW5kVHlwZSApCit7CisgICAgdERibExpbmtMaXN0IGxvY2FsTGlzdDsKKyAgICB0TGlzdEVsZW0gKnBFbnRyeTsKKyAgICB0U21lQ21kICAgKnBDb21tYW5kOworICAgIHRMaXN0RWxlbSAgKnBFbnRyeVRvUmVtb3ZlOworCisgICAgdm9zX21lbV96ZXJvKCZsb2NhbExpc3QsIHNpemVvZih0RGJsTGlua0xpc3QpKTsKKyAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKGNzckxMT3BlbihwTWFjLT5oSGRkLCAmbG9jYWxMaXN0KSkpCisgICAgeworICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiBmYWlsZWQgdG8gb3BlbiBsaXN0IikpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgY3NyTExMb2NrKHBMaXN0KTsKKyAgICBpZiggIWNzckxMSXNMaXN0RW1wdHkoIHBMaXN0LCBMTF9BQ0NFU1NfTk9MT0NLICkgKQorICAgIHsKKyAgICAgICAgcEVudHJ5ID0gY3NyTExQZWVrSGVhZCggcExpc3QsIExMX0FDQ0VTU19OT0xPQ0spOworCisgICAgICAgIC8vIEhhdmUgdG8gbWFrZSBzdXJlIHdlIGRvbid0IGxvb3AgYmFjayB0byB0aGUgaGVhZCBvZiB0aGUgbGlzdCwgd2hpY2ggd2lsbAorICAgICAgICAvLyBoYXBwZW4gaWYgdGhlIGVudHJ5IGlzIE5PVCBvbiB0aGUgbGlzdC4uLgorICAgICAgICB3aGlsZSggcEVudHJ5ICkKKyAgICAgICAgeworICAgICAgICAgICAgcEVudHJ5VG9SZW1vdmUgPSBwRW50cnk7CisgICAgICAgICAgICBwRW50cnkgPSBjc3JMTE5leHQocExpc3QsIHBFbnRyeSwgTExfQUNDRVNTX05PTE9DSyk7CisgICAgICAgICAgICBwQ29tbWFuZCA9IEdFVF9CQVNFX0FERFIoIHBFbnRyeVRvUmVtb3ZlLCB0U21lQ21kLCBMaW5rICk7CisgICAgICAgICAgICBpZiAoIHBDb21tYW5kLT5jb21tYW5kID09IGNvbW1hbmRUeXBlICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLyBSZW1vdmUgdGhhdCBlbnRyeSBvbmx5CisgICAgICAgICAgICAgICAgaWYoY3NyTExSZW1vdmVFbnRyeSggcExpc3QsIHBFbnRyeVRvUmVtb3ZlLCBMTF9BQ0NFU1NfTk9MT0NLKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGNzckxMSW5zZXJ0VGFpbCgmbG9jYWxMaXN0LCBwRW50cnlUb1JlbW92ZSwgTExfQUNDRVNTX05PTE9DSyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKworICAgIH0KKyAgICBjc3JMTFVubG9jayhwTGlzdCk7CisKKyAgICB3aGlsZSggKHBFbnRyeSA9IGNzckxMUmVtb3ZlSGVhZCgmbG9jYWxMaXN0LCBMTF9BQ0NFU1NfTk9MT0NLKSkgKQorICAgIHsKKyAgICAgICAgcENvbW1hbmQgPSBHRVRfQkFTRV9BRERSKCBwRW50cnksIHRTbWVDbWQsIExpbmsgKTsKKyAgICAgICAgY3NyQWJvcnRDb21tYW5kKCBwTWFjLCB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BNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0LCBMTF9BQ0NFU1NfTE9DSyk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHBNYWMtPnNjYW4uZkRyb3BTY2FuQ21kID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgIGNzclJlbW92ZVNjYW5Gb3JTU0lERnJvbVBlbmRpbmdMaXN0KCBwTWFjLCAmcE1hYy0+c21lLnNtZVNjYW5DbWRQZW5kaW5nTGlzdCwgc2Vzc2lvbklkKTsKKyAgICAgICAgcE1hYy0+c2Nhbi5mRHJvcFNjYW5DbWQgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgIHBFbnRyeSA9IGNzckxMUGVla0hlYWQoJnBNYWMtPnNtZS5zbWVTY2FuQ21kQWN0aXZlTGlzdCwgTExfQUNDRVNTX0xPQ0spOworICAgIH0KKworICAgIGlmKE5VTEwgIT0gcEVudHJ5KQorICAgIHsKKyAgICAgICBwQ29tbWFuZCA9IEdFVF9CQVNFX0FERFIoIHBFbnRyeSwgdFNtZUNtZCwgTGluayApOworCisgICAgICAgaWYgKCAoZVNtZUNvbW1hbmRTY2FuID09IHBDb21tYW5kLT5jb21tYW5kICkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIChzZXNzaW9uSWQgPT0gcENvbW1hbmQtPnNlc3Npb25JZCkpCisgICAgICAgeworICAgICAgICAgIGlmICggZUNzclNjYW5Gb3JTc2lkID09IHBDb21tYW5kLT51LnNjYW5DbWQucmVhc29uKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICBtc2dMZW4gPSAodEFOSV9VMTYpKHNpemVvZiggdFNpclNtZVNjYW5BYm9ydFJlcSApKTsKKyAgICAgICAgICAgICBwTXNnID0gdm9zX21lbV9tYWxsb2MobXNnTGVuKTsKKyAgICAgICAgICAgICBpZiAoIE5VTEwgPT0gcE1zZyApCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gYWxsb2NhdGUgbWVtb3J5IGZvciBTbWVTY2FuQWJvcnRSZXEiKSk7CisgICAgICAgICAgICAgfQorICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV96ZXJvKCh2b2lkICopcE1zZywgbXNnTGVuKTsKKyAgICAgICAgICAgICAgICBwTXNnLT50eXBlID0gcGFsX2NwdV90b19iZTE2KCh0QU5JX1UxNillV05JX1NNRV9TQ0FOX0FCT1JUX0lORCk7CisgICAgICAgICAgICAgICAgcE1zZy0+bXNnTGVuID0gcGFsX2NwdV90b19iZTE2KG1zZ0xlbik7CisgICAgICAgICAgICAgICAgcE1zZy0+c2Vzc2lvbklkID0gc2Vzc2lvbklkOworICAgICAgICAgICAgICAgIHN0YXR1cyA9IHBhbFNlbmRNQk1lc3NhZ2UocE1hYy0+aEhkZCwgcE1zZyk7CisgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgICB9CisgICAgfQorICAgIHJldHVybiggc3RhdHVzICk7Cit9CisKK3ZvaWQgY3NyUmVtb3ZlU2NhbkZvclNTSURGcm9tUGVuZGluZ0xpc3QodHBBbmlTaXJHbG9iYWwgcE1hYywgdERibExpbmtMaXN0ICpwTGlzdCwgdEFOSV9VMzIgc2Vzc2lvbklkKQoreworICAgIHREYmxMaW5rTGlzdCBsb2NhbExpc3Q7CisgICAgdExpc3RFbGVtICpwRW50cnk7CisgICAgdFNtZUNtZCAgICpwQ29tbWFuZDsKKyAgICB0TGlzdEVsZW0gICpwRW50cnlUb1JlbW92ZTsKKworICAgIHZvc19tZW1femVybygmbG9jYWxMaXN0LCBzaXplb2YodERibExpbmtMaXN0KSk7CisgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhjc3JMTE9wZW4ocE1hYy0+aEhkZCwgJmxvY2FsTGlzdCkpKQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgZmFpbGVkIHRvIG9wZW4gbGlzdCIpKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGNzckxMTG9jayhwTGlzdCk7CisgICAgaWYoICFjc3JMTElzTGlzdEVtcHR5KCBwTGlzdCwgTExfQUNDRVNTX05PTE9DSyApICkKKyAgICB7CisgICAgICAgIHBFbnRyeSA9IGNzckxMUGVla0hlYWQoIHBMaXN0LCBMTF9BQ0NFU1NfTk9MT0NLKTsKKworICAgICAgICAvLyBIYXZlIHRvIG1ha2Ugc3VyZSB3ZSBkb24ndCBsb29wIGJhY2sgdG8gdGhlIGhlYWQgb2YgdGhlIGxpc3QsIHdoaWNoIHdpbGwKKyAgICAgICAgLy8gaGFwcGVuIGlmIHRoZSBlbnRyeSBpcyBOT1Qgb24gdGhlIGxpc3QuLi4KKyAgICAgICAgd2hpbGUoIHBFbnRyeSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBFbnRyeVRvUmVtb3ZlID0gcEVudHJ5OworICAgICAgICAgICAgcEVudHJ5ID0gY3NyTExOZXh0KHBMaXN0LCBwRW50cnksIExMX0FDQ0VTU19OT0xPQ0spOworICAgICAgICAgICAgcENvbW1hbmQgPSBHRVRfQkFTRV9BRERSKCBwRW50cnlUb1JlbW92ZSwgdFNtZUNtZCwgTGluayApOworICAgICAgICAgICAgaWYgKCAoZVNtZUNvbW1hbmRTY2FuID09IHBDb21tYW5kLT5jb21tYW5kICkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHNlc3Npb25JZCA9PSBwQ29tbWFuZC0+c2Vzc2lvbklkKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBpZiAoIGVDc3JTY2FuRm9yU3NpZCA9PSBwQ29tbWFuZC0+dS5zY2FuQ21kLnJlYXNvbikKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgLy8gUmVtb3ZlIHRoYXQgZW50cnkgb25seQorICAgICAgICAgICAgICAgICBpZiAoIGNzckxMUmVtb3ZlRW50cnkoIHBMaXN0LCBwRW50cnlUb1JlbW92ZSwgTExfQUNDRVNTX05PTE9DSykpCisgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY3NyTExJbnNlcnRUYWlsKCZsb2NhbExpc3QsIHBFbnRyeVRvUmVtb3ZlLCBMTF9BQ0NFU1NfTk9MT0NLKTsKKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIGNzckxMVW5sb2NrKHBMaXN0KTsKKworICAgIHdoaWxlKCAocEVudHJ5ID0gY3NyTExSZW1vdmVIZWFkKCZsb2NhbExpc3QsIExMX0FDQ0VTU19OT0xPQ0spKSApCisgICAgeworICAgICAgICBwQ29tbWFuZCA9IEdFVF9CQVNFX0FERFIoIHBFbnRyeSwgdFNtZUNtZCwgTGluayApOworICAgICAgICBjc3JBYm9ydENvbW1hbmQoIHBNYWMsIHBDb21tYW5kLCBlQU5JX0JPT0xFQU5fRkFMU0UpOworICAgIH0KKyAgICBjc3JMTENsb3NlKCZsb2NhbExpc3QpOworfQorCitlSGFsU3RhdHVzIGNzclNjYW5BYm9ydE1hY1NjYW5Ob3RGb3JDb25uZWN0KHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggc2Vzc2lvbklkKQoreworICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKworICAgIGlmKCAhY3NySXNTY2FuRm9yUm9hbUNvbW1hbmRBY3RpdmUoIHBNYWMgKSApCisgICAgeworICAgICAgICAvL09ubHkgYWJvcnQgdGhlIHNjYW4gaWYgaXQgaXMgbm90IHVzZWQgZm9yIG90aGVyIHJvYW0vY29ubmVjdCB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FubmVsc0FsbG93ZWQ7IGluZHgrKykKKyAgIHsKKyAgICAgIGlmIChwQnNzRGVzY3ItPmNoYW5uZWxJZCA9PSBjaGFubmVsc0FsbG93ZWRbaW5keF0pCisgICAgICB7CisgICAgICAgICBiRm91bmRvbkFwcGxpZWRDaGFubmVsID0gVFJVRTsKKyAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCBGTCgiIHBubyBpbmQgZm91bmQgb24gYXBwbGllZCBjaGFubmVsID0lZFxuICIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQnNzRGVzY3ItPmNoYW5uZWxJZCk7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgIH0KKyAgIC8qIElnbm9yZSBQTk8gaW5kaWNhdGlvbiBpZiBBUCBpcyBvbiBJbnZhbGlkIGNoYW5uZWwuCisgICAgKi8KKyAgIGlmKEZBTFNFID09IGJGb3VuZG9uQXBwbGllZENoYW5uZWwpCisgICB7CisgICAgICBzbXNMb2cocE1hYywgTE9HVywgRkwoIiBwcmVmZXJlZCBuZXR3b3JrIGZvdW5kIG9uIGludmFsaWQgY2hhbm5lbCA9ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQnNzRGVzY3ItPmNoYW5uZWxJZCk7CisgICAgICBjc3JGcmVlU2NhblJlc3VsdEVudHJ5KHBNYWMsIHBTY2FuUmVzdWx0KTsKKyAgICAgIHZvc19tZW1fdmZyZWUocFBhcnNlZEZyYW1lKTsKKyAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgfQorCisgICBpZiAoKHBCc3NEZXNjci0+Y2hhbm5lbElkID4gMCkgJiYgKHBCc3NEZXNjci0+Y2hhbm5lbElkIDwgMTUpKQorICAgeworICAgICAgaW50IGk7CisgICAgICAvLyAxMWIgb3IgMTFnIHBhY2tldAorICAgICAgLy8gMTFnIGlmZiBleH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cmV2aW91cyAobnVtQ2hhbm5lbHMgPSAlZCkiKSwKKyAgICAgICAgICAgICAgX19mdW5jX18sIHBNYWMtPnNjYW4ub2NjdXBpZWRDaGFubmVscy5udW1DaGFubmVscyk7CisgICAgICByZXR1cm47CisgIH0KKworICAvKiBFbXB0eSBvY2N1cGllZCBjaGFubmVscyBoZXJlICovCisgIHBNYWMtPnNjYW4ub2NjdXBpZWRDaGFubmVscy5udW1DaGFubmVscyA9IDA7CisKKyAgY3NyTExMb2NrKCZwTWFjLT5zY2FuLnNjYW5SZXN1bHRMaXN0KTsKKyAgcEVudHJ5ID0gY3NyTExQZWVrSGVhZCggJnBNYWMtPnNjYW4uc2NhblJlc3VsdExpc3QsIExMX0FDQ0VTU19OT0xPQ0sgKTsKKyAgd2hpbGUoIHBFbnRyeSApCisgIHsKKyAgICAgIHBCc3NEZXNjID0gR0VUX0JBU0VfQUREUiggcEVudHJ5LCB0Q3NyU2NhblJlc3VsdCwgTGluayApOworICAgICAgcEllcyA9ICh0RG90MTFmQmVhY29uSUVzICopKCBwQnNzRGVzYy0+UmVzdWx0LnB2SWVzICk7CisKKyAgICAgIC8vQXQgdGhpcyB0aW1lLCBwQnNzRGVzY3JpcHRpb24tPlJlc3VsdC5wdkllcyBtYXkgYmUgTlVMTAorICAgICAgaWYoICFwSWVzICYmICghSEFMX1NUQVRVU19TVUNDRVNTKGNzckdldFBhcnNlZEJzc0Rlc2NyaXB0aW9uSUVzKHBNYWMsIAorICAgICAgICAgICAgICAgICAgICAmcEJzc0Rlc2MtPlJlc3VsdC5Cc3NEZXNjcmlwdG9yLCAmcEllcykpKSApCisgICAgICB7CisgICAgICAgICAgY29udGludWU7CisgICAgICB9CisKKyAgICAgIGNzclNjYW5BZGRUb09jY3VwaWVkQ2hhbm5lbHMocE1hYywgcEJzc0Rlc2MsICZwTWFjLT5zY2FuLm9jY3VwaWVkQ2hhbm5lbHMsIHBJZXMpOworCisgICAgICAvKgorICAgICAgICogRnJlZSB0aGUgbWV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T0cyLCBGTCgiY3NyU2NhbkNyZWF0ZUVudHJ5SW5TY2FuQ2FjaGU6IEN1cnJlbnQgYnNzaWQ6OiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJFU1NfU1RSKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocFNlc3Npb24tPnBDb25uZWN0QnNzRGVzYy0+YnNzSWQpKTsKKyAgICBzbXNMb2cocE1hYywgTE9HMiwgRkwoImNzclNjYW5DcmVhdGVFbnRyeUluU2NhbkNhY2hlOiBNeSBic3NpZDo6IgorICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIiIGNoYW5uZWwgJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkoYnNzaWQpLCBjaGFubmVsKTsKKworICAgIGRvCisgICAgeworICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKGNzckdldFBhcnNlZEJzc0Rlc2NyaXB0aW9uSUVzKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPnBDb25uZWN0QnNzRGVzYywgJnBOZXdJZXMpKSkKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIlczogRmFpbGVkIHRvIHBhcnNlIElFcyIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIHNpemUgPSBwU2Vzc2lvbi0+cENvbm5lY3RCc3NEZXNjLT5sZW5ndGggKyBzaXplb2YocFNlc3Npb24tPnBDb25uZWN0QnNzRGVzYy0+bGVuZ3RoKTsKKyAgICAgICAgaWYgKHNpemUpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBOZXdCc3NEZXNjcmlwdG9yID0gdm9zX21lbV9tYWxsb2Moc2l6ZSk7CisgICAgICAgICAgICBpZiAoIE5VTEwgPT0gcE5ld0Jzc0Rlc2NyaXB0b3IgKQorICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgIGlmIChIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocE5ld0Jzc0Rlc2NyaXB0b3IsIHBTZXNzaW9uLT5wQ29ubmVjdEJzc0Rlc2MsIHNpemUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiJXM6IG1lbW9yeSBhbGxvY2F0aW9uIGZhaWxlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy9jaGFuZ2UgdGhlIEJTU0lEICYgY2hhbm5lbCBhcyBwYXNzZWQKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwTmV3QnNzRGVzY3JpcHRvci0+YnNzSWQsIGJzc2lkLCBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgICAgIHBOZXdCc3NEZXNjcmlwdG9yLT5jaGFubmVsSWQgPSBjaGFubmVsOworICAgICAgICAgICAgaWYoTlVMTCA9PSBjc3JTY2FuQXBwZW5kQnNzRGVzY3JpcHRpb24oIHBNYWMsIHBOZXdCc3NEZXNjcmlwdG9yLCBwTmV3SWVzLCBUUlVFICkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIlczogY3NyU2NhbkFwcGVuZEJzc0Rlc2NyaXB0aW9uIGZhaWxlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiJXM6IGxlbmd0aCBvZiBic3MgZGVzY3JpcHRvciBpcyAwIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiJXM6IGVudHJ5IHN1Y2Nlc3NmdWxseSBhZGRlZCBpbiBzY2FuIGNhY2hlIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgfXdoaWxlKDApOworCisgICAgaWYocE5ld0llcykKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZShwTmV3SWVzKTsKKyAgICB9CisgICAgaWYocE5ld0Jzc0Rlc2NyaXB0b3IpCisgICAgeworICAgICAgICB2b3NfbWVtX2ZyZWUocE5ld0Jzc0Rlc2NyaXB0b3IpOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfQorCisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRQorLy8gIFVwZGF0ZSB0aGUgVFNGIHdpdGggdGh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Sb2FtSm9pbmVkU3RhdGVNc2dQcm9jZXNzb3IoIHBNYWMsIHBNc2dCdWYgKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBjYXNlIGVDU1JfUk9BTUlOR19TVEFURV9KT0lOSU5HOgorICAgICAgICB7CisgICAgICAgICAgICAvL2FyZSB3ZSBpbiByb2FtaW5nIHN0YXRlcworI2lmIGRlZmluZWQoIEFOSV9FTVVMX0FTU09DICkKKyAgICAgICAgICAgIGVtdWxSb2FtaW5nU3RhdGVNc2dQcm9jZXNzb3IoIHBBZGFwdGVyLCBwTUJCdWZIZHIgKTsKKyNlbmRpZgorICAgICAgICAgICAgY3NyUm9hbWluZ1N0YXRlTXNnUHJvY2Vzc29yKCBwTWFjLCBwTXNnQnVmICk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIC8vRm9yIGFsbCBvdGhlciBtZXNzYWdlcywgd2UgaWdub3JlIGl0ICAgICAgICAKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgeworICAgICAgICAgICAgLypUbyB3b3JrLWFyb3VuZCBhbiBpc3N1ZSB3aGVyZSBjaGVja2luZyBmb3Igc2V0L3JlbW92ZSBrZXkgYmFzZSBvbiBjb25uZWN0aW9uIHN0YXRlIGlzIG5vIGxvbmdlciAKKyAgICAgICAgICAgICogd29ya2FibGUgZHVlIHRvIGZhaWx1cmUgb3IgZmluZGluZyB0aGUgY29uZGl0aW9uIG1lZXRzIGJvdGggU0FQIGFuZCBpbmZyYS9JQlNTIHJlcXVpcmVtZW50LgorICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmKCAoZVdOSV9TTUVfU0VUQ09OVEVYVF9SU1AgPT0gcFNtZVJzcC0+bWVzc2FnZVR5cGUpIHx8CisgICAgICAgICAgICAgICAgKGVXTklfU01FX1JFTU9WRUtFWV9SU1AgPT0gcFNtZVJzcC0+bWVzc2FnZVR5cGUpICkKKyAgICAgICAgICA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lwdGlvbgorLy9XZSBtYXkgbmVlZCB0byBhZGQgV0VQIGJ1dCBmb3Igbm93LCBUS0lQIG9ubHkuCisKKyNkZWZpbmUgQ1NSX0lTXzExbl9BTExPV0VEKCBlbmNUeXBlICkgKCggZUNTUl9FTkNSWVBUX1RZUEVfVEtJUCAhPSAoZW5jVHlwZSkgKSAmJiBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggZUNTUl9FTkNSWVBUX1RZUEVfV0VQNDBfU1RBVElDS0VZICE9IChlbmNUeXBlKSApICYmIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVAxMDRfU1RBVElDS0VZICE9IChlbmNUeXBlKSApICYmIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVA0MCAhPSAoZW5jVHlwZSkgKSAmJiBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggZUNTUl9FTkNSWVBUX1RZUEVfV0VQMTA0ICE9IChlbmNUeXBlKSApICkKKworI2RlZmluZSBDU1JfSVNfRElTQ09OTkVDVF9DT01NQU5EKHBDb21tYW5kKSAoICggZVNtZUNvbW1hbmRSb2FtID09IChwQ29tbWFuZCktPmNvbW1hbmQgKSAmJlwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoICggZUNzckZvcmNlZERpc2Fzc29jID09IChwQ29tbWFuZCktPnUucm9hbUNtZC5yb2FtUmVhc29uICkgfHxcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIGVDc3JGb3JjZWREZWF1dGggPT0gKHBDb21tYW5kKS0+dS5yb2FtQ21kLnJvYW1SZWFzb24gKSB8fFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggZUNzclNt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aXJHbG9iYWwgcE1hYyk7CisvL1RvIHJlbW92ZSBmcmVzaCBzY2FuIGNvbW1hbmRzIGZyb20gdGhlIHBlbmRpbmcgcXVldWUKK3RBTklfQk9PTEVBTiBjc3JTY2FuUmVtb3ZlRnJlc2hTY2FuQ29tbWFuZCh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4IHNlc3Npb25JZCk7Cit0U2lyQWJvcnRTY2FuU3RhdHVzIGNzclNjYW5BYm9ydE1hY1NjYW4odHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IHNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ3NyQWJvcnRSZWFzb24gcmVhc29uKTsKK3ZvaWQgY3NyUmVtb3ZlQ21kRnJvbVBlbmRpbmdMaXN0KHRwQW5pU2lyR2xvYmFsIHBNYWMsIHREYmxMaW5rTGlzdCAqcExpc3QsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTbWVDb21tYW5kVHlwZSBjb21tYW5kVHlwZSApOwordm9pZCBjc3JSZW1vdmVDbWRXaXRoU2Vzc2lvbklkRnJvbVBlbmRpbmdMaXN0KHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERibExpbmtMaXN0ICpwTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU21lQ29tbWFuZFR5cGUgY29tbWFuZFR5cGUpOworZUhhbFN0YXR1cyBjc3JTY2FuQWJvcnRNYWNTY2FuTm90Rm9yQ29ubmVjdCh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAg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R5cGUsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJCc3NEZXNjcmlwdGlvbiAqcEJzc0Rlc2NyaXB0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjQWRkciAqYnNzSWQsIHRBTklfQk9PTEVBTiBhZGRLZXksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX0JPT0xFQU4gZlVuaWNhc3QsIHRBbmlLZXlEaXJlY3Rpb24gYW5pS2V5RGlyZWN0aW9uLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTgga2V5SWQsIHRBTklfVTE2IGtleUxlbmd0aCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwS2V5LCB0QU5JX1U4IHBhZVJvbGUgKTsKK2VIYWxTdGF0dXMgY3NyUm9hbVByb2Nlc3NEaXNhc3NvY0RlYXV0aCggdHBBbmlTaXJHbG9iYWwgcE1hYywgdFNtZUNtZCAqcENvbW1hbmQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX0JPT0xFQU4gZkRpc2Fzc29jLCB0QU5JX0JPT0xFQU4gZk1JQ0ZhaWx1cmUgKTsKK2VIYWxTdGF0dXMgY3NyUm9hbVNhdmVDb25uZWN0ZWRJbmZvbWF0aW9uKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTMyIHNlc3Npb25JZCwgdENzclJvYW1Qcm9maWxlICpwUHJvZmlsZSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyQnNzRGVzY3JpcHRpb24gKnBTaXJCc3NEZXNjLCB0RG90MTFmQmVhY29uSUVzICpwSWVzKTsKK3ZvaWQgY3NyUm9hbUNoZWNrRm9yTGlua1N0YXR1c0NoYW5nZSggdHBBbmlTaXJHbG9iYWwgcE1hYywgdFNpclNtZVJzcCAqcF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IAorICAgIH0KKworICAgIGlmICggcExpc3QgJiYgKCBMSVNUX0ZMQUdfT1BFTiA9PSBwTGlzdC0+RmxhZyApICkgCisgICAgeworICAgICAgICBjID0gcExpc3QtPkNvdW50OworICAgIH0KKworICAgIHJldHVybiggYyApOyAKK30KKworCit2b2lkIGNzckxMTG9jayggdERibExpbmtMaXN0ICpwTGlzdCApIAoreworICAgIAorCisgICAgaWYoICFwTGlzdCkgCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwiJXM6IEVycm9yISEgcExpc3QgaXMgTnVsbCIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIDsgCisgICAgfQorCisgICAgaWYgKCBMSVNUX0ZMQUdfT1BFTiA9PSBwTGlzdC0+RmxhZyApCisgICAgeworICAgICAgICB2b3NfbG9ja19hY3F1aXJlKCZwTGlzdC0+TG9jayk7CisgICAgfQorfQorCisKK3ZvaWQgY3NyTExVbmxvY2soIHREYmxMaW5rTGlzdCAqcExpc3QgKQoreworICAgIAorICAgIGlmKCAhcExpc3QpIAorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsIiVzOiBFcnJvciEhIHBMaXN0IGlzIE51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiA7IAorICAgIH0KKworICAgIGlmICggTElTVF9GTEFHX09QRU4gPT0gcExpc3QtPkZsYWcgKSAKKyAgICB7CisgICAgICAgIHZvc19sb2NrX3JlbGVhc2UoJnBMaXN0LT5Mb2NrKTsKKyAgICB9Cit9CisKKwordEFOSV9CT09MRUFOIGNzckxMSXNMaXN0RW1wdHkoIHREYmxMaW5rTGlzdCAqcExpc3QsIHRBTklfQk9PTEVBTiBmSW50ZXJsb2NrZWQgKQoreworICAgIHRBTklfQk9PTEVBTiBmRW1wdHkgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKworICAgIAorICAgIGlmKCAhcExpc3QpIAorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsIiVzOiBFcnJvciEhIHBMaXN0IGlzIE51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiBmRW1wdHkgOyAKKyAgICB9CisKKyAgICBpZiAoIExJU1RfRkxBR19PUEVOID09IHBMaXN0LT5GbGFnICkgCisgICAgeworICAgICAgICBpZihmSW50ZXJsb2NrZWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGNzckxMTG9jayhwTGlzdCk7CisgICAgICAgIH0KKworICAgICAgICBmRW1wdHkgPSBjc3JJc0xpc3RFbXB0eSggJnBMaXN0LT5MaXN0SGVhZCApOworICAgICAgICAgCisgICAgICAgIGlmKGZJbnRlcmxvY2tlZCkKKyAgICAgICAgeworICAgICAgICAgICAgY3NyTExVbmxvY2socExpc3QpOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiggZkVtcHR5ICk7Cit9CisKKworCit0QU5JX0JPT0xFQU4gY3NyTExGaW5kRW50cnkoIHREYmxMaW5rTGlzdCAqcExpc3QsIHRMaXN0RWxlbSAqcEVudHJ5VG9GaW5kICkKK3sKKyAgICB0QU5JX0JPT0xFQU4gZkZvdW5kID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgIHRMaXN0RWxlbSAqcEVudHJ5OworCisgICAgCisgICAgaWYoICFwTGlzdCkgCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwiJXM6IEVycm9yISEgcExpc3QgaXMgTnVsbCIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIGZGb3VuZCA7IAorICAgIH0KKworICAgIGlmICggTElTVF9GTEFHX09QRU4gPT0gcExpc3QtPkZsYWcgKSAKKyAgICB7CisgICAgICAgIHBFbnRyeSA9IGNzckxMUGVla0hlYWQoIHBMaXN0LCBMTF9BQ0NFU1NfTk9MT0NLKTsKKworICAgICAgICAvLyBIYXZlIHRvIG1ha2Ugc3VyZSB3ZSBkb24ndCBsb29wIGJhY2sgdG8gdGhlIGhlYWQgb2YgdGhlIGxpc3QsIHdoaWNoIHdpbGwKKyAgICAgICAgLy8gaGFwcGVuIGlmIHRoZSBlbnRyeSBpcyBOT1Qgb24gdGhlIGxpc3QuLi4KKyAgICAKKyAgICAgICAgd2hpbGUoIHBFbnRyeSAmJiAoIHBFbnRyeSAhPSAmcExpc3QtPkxpc3RIZWFkICkgKSAKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKCBwRW50cnkgPT0gcEVudHJ5VG9GaW5kICkgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZkZvdW5kID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwRW50cnkgPSBwRW50cnktPm5leHQ7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgfQorICAgIHJldHVybiggZkZvdW5kICk7Cit9CisKKworZUhhbFN0YXR1cyBjc3JMTE9wZW4oIHRIZGRIYW5kbGUgaEhkZCwgdERibExpbmtMaXN0ICpwTGlzdCApCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIFZPU19TVEFUVVMgdm9zU3RhdHVzOworICAgIAorICAgIGlmKCAhcExpc3QpIAorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsIiVzOiBFcnJvciEhIHBMaXN0IGlzIE51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFIDsgCisgICAgfQorICAgIAorICAgIGlmICggTElTVF9GTEFHX09QRU4gIT0gcExpc3QtPkZsYWcgKSAKKyAgICB7CisgICAgICAgIHBMaXN0LT5Db3VudCA9IDA7CisgICAgICAgIHBMaXN0LT5jbWRUaW1lb3V0VGltZXIgPSBOVUxMOworICAgICAgICB2b3NTdGF0dXMgPSB2b3NfbG9ja19pbml0KCZwTGlzdC0+TG9jayk7CisKKyAgICAgICAgaWYoVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpCisgICAgICAgIHsKKyAgICAgICAgICAgIGNzckxpc3RJbml0KCAmcExpc3QtPkxpc3RIZWFkICk7CisgICAgICAgICAgICBwTGlzdC0+RmxhZyA9IExJU1RfRkxBR19PUEVOOworICAgICAgICAgICAgcExpc3QtPmhIZGQgPSBoSGRkOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiAoc3RhdHVzKTsKK30KKwordm9pZCBjc3JMTENsb3NlKCB0RGJsTGlua0xpc3QgKnBMaXN0ICkKK3sKKyAgICBpZiggIXBMaXN0KSAKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCIlczogRXJyb3IhISBwTGlzdCBpcyBOdWxsIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gOyAKKyAgICB9CisKKyAgICBpZiAoIExJU1RfRkxBR19PUEVOID09IHBMaXN0LT5GbGFnICkgCisgICAgeworICAgICAgICAvLyBNYWtlIHN1cmUgdGhlIGxpc3QgaXMgZW1wdHkuLi4KKyAgICAgICAgY3NyTExQdXJnZSggcExpc3QsIExMX0FDQ0VTU19MT0NLICk7CisgICAgICAgIHZvc19sb2NrX2Rlc3Ryb3koICZwTGlzdC0+TG9jayApOworICAgICAgICBwTGlzdC0+RmxhZyA9IExJU1RfRkxBR19DTE9TRTsKKyAgICB9Cit9CisKK3ZvaWQgY3NyTExJbnNlcnRUYWlsKCB0RGJsTGlua0xpc3QgKnBMaXN0LCB0TGlzdEVsZW0gKnBFbnRyeSwgdEFOSV9CT09MRUFOIGZJbnRlcmxvY2tlZCApCit7ICAgIAorICAgIGlmKCAhcExpc3QpIAorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsIiVzOiBFcnJvciEhIHBMaXN0IGlzIE51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybjsgCisgICAgfQorCisgICAgaWYgKCBMSVNUX0ZMQUdfT1BFTiA9PSBwTGlzdC0+RmxhZyApIAorICAgIHsKKyAgICAgICAgaWYoZkludGVybG9ja2VkKQorICAgICAgICB7ICAKKyAgICAgICAgICAgIGNzckxMTG9jayhwTGlzdCk7CisgICAgICAgIH0KKyAgICAgICAgY3NyTGlzdEluc2VydFRhaWwoICZwTGlzdC0+TGlzdEhlYWQsIHBFbnRyeSApOworICAgICAgICBwTGlzdC0+Q291bnQrKzsKKyAgICAgICAgaWYoZkludGVybG9ja2VkKQorICAgICAgICB7ICAKKyAgICAgICAgICAgIGNzckxMVW5sb2NrKHBMaXN0KTsKKyAgICAgICAgfQorICAgIH0KK30KKworCisKK3ZvaWQgY3NyTExJbnNlcnRIZWFkKCB0RGJsTGlua0xpc3QgKnBMaXN0LCB0TGlzdEVsZW0gKnBFbnRyeSwgdEFOSV9CT09MRUFOIGZJbnRlcmxvY2tlZCApCit7CisgICAgCisgICAgaWYoICFwTGlzdCkgCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwiJXM6IEVycm9yISEgcExpc3QgaXMgTnVsbCIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuOyAKKyAgICB9CisKKyAgICBpZiAoIExJU1RfRkxBR19PUEVOID09IHBMaXN0LT5GbGFnICkgCisgICAgeworICAgICAgICBpZihmSW50ZXJsb2NrZWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGNzckxMTG9jayhwTGlzdCk7CisgICAgICAgIH0KKyAgICAgICAgY3NyTGlzdEluc2VydEhlYWQoICZwTGlzdC0+TGlzdEhlYWQsIHBFbnRyeSApOworICAgICAgICBwTGlzdC0+Q291bnQrKzsKKyAgICAgICAgaWYoZkludGVybG9ja2VkKQorICAgICAgICB7CisgICAgICAgICAgICBjc3JMTFVubG9jayhwTGlzdCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKCBwTGlzdC0+Y21kVGltZW91dFRpbWVyICYmIHBMaXN0LT5jbWRUaW1lb3V0RHVyYXRpb24gKQorICAgICAgICB7CisgICAgICAgICAgICAvKiB0aW1lciB0byBkZXRlY3QgcGVuZGluZyBjb21tYW5kIGluIGFjdGl2ZWxpc3QqLworICAgICAgICAgICAgdm9zX3RpbWVyX3N0YXJ0KCBwTGlzdC0+Y21kVGltZW91dFRpbWVyLAorICAgICAgICAgICAgICAgIHBMaXN0LT5jbWRUaW1lb3V0RHVyYXRpb24pOworICAgICAgICB9CisgICAgfQorfQorCisKK3ZvaWQgY3NyTExJbnNlcnRFbnRyeSggdERibExpbmtMaXN0ICpwTGlzdCwgdExpc3RFbGVtICpwRW50cnksIHRMaXN0RWxlbSAqcE5ld0VudHJ5LCB0QU5JX0JPT0xFQU4gZkludGVybG9ja2VkICkKK3sgICAgCisgICAgaWYoICFwTGlzdCkgCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwiJXM6IEVycm9yISEgcExpc3QgaXMgTnVsbCIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIDsgCisgICAgfQorCisgICAgaWYgKCBMSVNUX0ZMQUdfT1BFTiA9PSBwTGlzdC0+RmxhZyApIAorICAgIHsKKyAgICAgICAgaWYoZkludGVybG9ja2VkKQorICAgICAgICB7CisgICAgICAgICAgICBjc3JMTExvY2socExpc3QpOworICAgICAgICB9CisgICAgICAgIGNzckxpc3RJbnNlcnRFbnRyeSggcEVudHJ5LCBwTmV3RW50cnkgKTsKKyAgICAgICAgcExpc3QtPkNvdW50Kys7CisgICAgICAgIGlmKGZJbnRlcmxvY2tlZCkKKyAgICAgICAgeworICAgICAgICAgICAgY3NyTExVbmxvY2socExpc3QpOworICAgICAgICB9CisgICAgfQorfQorCisKKwordExpc3RFbGVtICpjc3JMTFJlbW92ZVRhaWwoIHREYmxMaW5rTGlzdCAqcExpc3QsIHRBTklfQk9PTEVBTiBmSW50ZXJsb2NrZWQgKQoreworICAgIHRMaXN0RWxlbSAqcEVudHJ5ID0gTlVMTDsKKworICAgIGlmKCAhcExpc3QpIAorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsIiVzOiBFcnJvciEhIHBMaXN0IGlzIE51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiBwRW50cnkgOyAKKyAgICB9CisKKyAgICBpZiAoIExJU1RfRkxBR19PUEVOID09IHBMaXN0LT5GbGFnICkgCisgICAgeworICAgICAgICBpZiAoIGZJbnRlcmxvY2tlZCApIAorICAgICAgICB7CisgICAgICAgICAgICBjc3JMTExvY2soIHBMaXN0ICk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoICFjc3JJc0xpc3RFbXB0eSgmcExpc3QtPkxpc3RIZWFkKSApIAorICAgICAgICB7CisKKyAgICAgICAgICAgIHBFbnRyeSA9IGNzckxpc3RSZW1vdmVUYWlsKCAmcExpc3QtPkxpc3RIZWFkICk7CisgICAgICAgICAgICBwTGlzdC0+Q291bnQtLTsKKyAgICAgICAgfQorICAgICAgICBpZiAoIGZJbnRlcmxvY2tlZCApIAorICAgICAgICB7CisgICAgICAgICAgICBjc3JMTFVubG9jayggcExpc3QgKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiggcEVudHJ5ICk7Cit9CisKKwordExpc3RFbGVtICpjc3JMTFBlZWtUYWlsKCB0RGJsTGlua0xpc3QgKnBMaXN0LCB0QU5JX0JPT0xFQU4gZkludGVybG9ja2VkICkKK3sKKyAgICB0TGlzdEVsZW0gKnBFbnRyeSA9IE5VTEw7CisKKyAgICAKKyAgICBpZiggIXBMaXN0KSAKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCIlczogRXJyb3IhISBwTGlzdCBpcyBOdWxsIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gcEVudHJ5IDsgCisgICAgfQorCisgICAgaWYgKCBMSVNUX0ZMQUdfT1BFTiA9PSBwTGlzdC0+RmxhZyApIAorICAgIHsKKyAgICAgICAgaWYgKCBmSW50ZXJsb2NrZWQgKSAKKyAgICAgICAgeyAgCisgICAgICAgICAgICBjc3JMTExvY2soIHBMaXN0ICk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoICFjc3JJc0xpc3RFbXB0eSgmcExpc3QtPkxpc3RIZWFkKSApIAorICAgICAgICB7CisgICAgICAgICAgICBwRW50cnkgPSBwTGlzdC0+TGlzdEhlYWQubGFzdDsgCisgICAgICAgIH0KKyAgICAgICAgaWYgKCBmSW50ZXJsb2NrZWQgKSAKKyAgICAgICAgeworICAgICAgICAgICAgY3NyTExVbmxvY2soIHBMaXN0ICk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4oIHBFbnRyeSApOworfQorCisKKwordExpc3RFbGVtICpjc3JMTFJlbW92ZUhlYWQoIHREYmxMaW5rTGlzdCAqcExpc3QsIHRBTklfQk9PTEVBTiBmSW50ZXJsb2NrZWQgKQoreworICAgIHRMaXN0RWxlbSAqcEVudHJ5ID0gTlVMTDsKKyAgICAKKworICAgIGlmKCAhcExpc3QpIAorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsIiVzOiBFcnJvciEhIHBMaXN0IGlzIE51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiBwRW50cnkgOyAKKyAgICB9CisKKyAgICBpZiAoIExJU1RfRkxBR19PUEVOID09IHBMaXN0LT5GbGFnICkgCisgICAgeworICAgICAgICBpZiAoIGZJbnRlcmxvY2tlZCApIAorICAgICAgICB7ICAKKyAgICAgICAgICAgIGNzckxMTG9jayggcExpc3QgKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmICggIWNzcklzTGlzdEVtcHR5KCZwTGlzdC0+TGlzdEhlYWQpICkgCisgICAgICAgIHsKKyAgICAgICAgICAgIHBFbnRyeSA9IGNzckxpc3RSZW1vdmVIZWFkKCAmcExpc3QtPkxpc3RIZWFkICk7CisgICAgICAgICAgICBwTGlzdC0+Q291bnQtLTsKKyAgICAgICAgfQorCisgICAgICAgIGlmICggZkludGVybG9ja2VkICkgCisgICAgICAgIHsKKyAgICAgICAgICAgIGNzckxMVW5sb2NrKCBwTGlzdCApOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuKCBwRW50cnkgKTsKK30KKworCit0TGlzdEVsZW0gKmNzckxMUGVla0hlYWQoIHREYmxMaW5rTGlzdCAqcExpc3QsIHRBTklfQk9PTEVBTiBmSW50ZXJsb2NrZWQgKQoreworICAgIHRMaXN0RWxlbSAqcEVudHJ5ID0gTlVMTDsKKworICAgIGlmKCAhcExpc3QpIAorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsIiVzOiBFcnJvciEhIHBMaXN0IGlzIE51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiBwRW50cnkgOyAKKyAgICB9CisgICAgIAorICAgIGlmICggTElTVF9GTEFHX09QRU4gPT0gcExpc3QtPkZsYWcgKSAKKyAgICB7CisgICAgICAgIGlmICggZkludGVybG9ja2VkICkgCisgICAgICAgIHsgIAorICAgICAgICAgICAgY3NyTExMb2NrKCBwTGlzdCApOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCAhY3NySXNMaXN0RW1wdHkoJnBMaXN0LT5MaXN0SGVhZCkgKSAKKyAgICAgICAgeworICAgICAgICAgICAgcEVudHJ5ID0gcExpc3QtPkxpc3RIZWFkLm5leHQ7IAorICAgICAgICB9CisgICAgICAgIGlmICggZkludGVybG9ja2VkICkgCisgICAgICAgIHsKKyAgICAgICAgICAgIGNzckxMVW5sb2NrKCBwTGlzdCApOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuKCBwRW50cnkgKTsKK30KKworCisKK3ZvaWQgY3NyTExQdXJnZSggdERibExpbmtMaXN0ICpwTGlzdCwgdEFOSV9CT09MRUFOIGZJbnRlcmxvY2tlZCApCit7CisgICAgdExpc3RFbGVtICpwRW50cnk7CisKKyAgICBpZiggIXBMaXN0KSAKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCIlczogRXJyb3IhISBwTGlzdCBpcyBOdWxsIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gOyAKKyAgICB9CisKKyAgICBpZiAoIExJU1RfRkxBR19PUEVOID09IHBMaXN0LT5GbGFnICkgCisgICAgeworICAgICAgICBpZiAoIGZJbnRlcmxvY2tlZCApIAorICAgICAgICB7ICAKKyAgICAgICAgICAgIGNzckxMTG9jayggcExpc3QgKTsKKyAgICAgICAgfQorICAgICAgICB3aGlsZSggKHBFbnRyeSA9IGNzckxMUmVtb3ZlSGVhZCggcExpc3QsIExMX0FDQ0VTU19OT0xPQ0sgKSkgKSAKKyAgICAgICAgeworICAgICAgICAgICAgLy8ganVzdCByZW1vdmUgZXZlcnl0aGluZyBmcm9tIHRoZSBsaXN0IHVudGlsIAorICAgICAgICAgICAgLy8gbm90aGluZyBsZWZ0IG9uIHRoZSBsaXN0LgorICAgICAgICB9CisgICAgICAgIGlmICggZkludGVybG9ja2VkICkgCisgICAgICAgIHsgIAorICAgICAgICAgICAgY3NyTExVbmxvY2soIHBMaXN0ICk7CisgICAgICAgIH0KKyAgICB9Cit9CisKKwordEFOSV9CT09MRUFOIGNzckxMUmVtb3ZlRW50cnkoIHREYmxMaW5rTGlzdCAqcExpc3QsIHRMaXN0RWxlbSAqcEVudHJ5VG9SZW1vdmUsIHRBTklfQk9PTEVBTiBmSW50ZXJsb2NrZWQgKQoreworICAgIHRBTklfQk9PTEVBTiBmRm91bmQgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgdExpc3RFbGVtICpwRW50cnk7CisKKyAgICBpZiggIXBMaXN0KSAKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCIlczogRXJyb3IhISBwTGlzdCBpcyBOdWxsIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gZkZvdW5kOyAKKyAgICB9CisKKyAgICBpZiAoIExJU1RfRkxBR19PUEVOID09IHBMaXN0LT5GbGFnICkgCisgICAgeworICAgICAgICBpZiAoIGZJbnRlcmxvY2tlZCApIAorICAgICAgICB7CisgICAgICAgICAgICBjc3JMTExvY2soIHBMaXN0ICk7CisgICAgICAgIH0KKworICAgICAgICBwRW50cnkgPSBjc3JMTFBlZWtIZWFkKCBwTGlzdCwgTExfQUNDRVNTX05PTE9DSyApOworCisgICAgICAgIC8vIEhhdmUgdG8gbWFrZSBzdXJlIHdlIGRvbid0IGxvb3AgYmFjayB0byB0aGUgaGVhZCBvZiB0aGUgbGlzdCwgd2hpY2ggd2lsbAorICAgICAgICAvLyBoYXBwZW4gaWYgdGhlIGVudHJ5IGlzIE5PVCBvbiB0aGUgbGlzdC4uLgorICAgICAgICB3aGlsZSggcEVudHJ5ICYmICggcEVudHJ5ICE9ICZwTGlzdC0+TGlzdEhlYWQgKSApIAorICAgICAgICB7CisgICAgICAgICAgICBpZiAoIHBFbnRyeSA9PSBwRW50cnlUb1JlbW92ZSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY3NyTGlzdFJlbW92ZUVudHJ5KCBwRW50cnkgKTsKKyAgICAgICAgICAgICAgICBwTGlzdC0+Q291bnQtLTsKKworICAgICAgICAgICAgICAgIGZGb3VuZCA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBwRW50cnkgPSBwRW50cnktPm5leHQ7IAorICAgICAgICB9CisgICAgICAgIGlmICggZkludGVybG9ja2VkICkgCisgICAgICAgIHsKKyAgICAgICAgICAgIGNzckxMVW5sb2NrKCBwTGlzdCApOworICAgICAgICB9CisgICAgICAgIGlmICggcExpc3QtPmNtZFRpbWVvdXRUaW1lciApCisgICAgICAgIHsKKyAgICAgICAgICAgdm9zX3RpbWVyX3N0b3AocExpc3QtPmNtZFRpbWVvdXRUaW1lcik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4oIGZGb3VuZCApOworfQorCisKKwordExpc3RFbGVtICpjc3JMTE5leHQoIHREYmxMaW5rTGlzdCAqcExpc3QsIHRMaXN0RWxlbSAqcEVudHJ5LCB0QU5JX0JPT0xFQU4gZkludGVybG9ja2VkICkKK3sKKyAgICB0TGlzdEVsZW0gKnBOZXh0RW50cnkgPSBOVUxMOworCisgICAgaWYoICFwTGlzdCkgCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwiJXM6IEVycm9yISEgcExpc3QgaXMgTnVsbCIsIF9fZnVuY19fKTsKKyAgICAgICAgcmV0dXJuIHBOZXh0RW50cnkgOyAKKyAgICB9CisKKyAgICBpZiAoIExJU1RfRkxBR19PUEVOID09IHBMaXN0LT5GbGFnICkgCisgICAgeworICAgICAgICBpZiAoIGZJbnRlcmxvY2tlZCApIAorICAgICAgICB7CisgICAgICAgICAgICBjc3JMTExvY2soIHBMaXN0ICk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoICFjc3JJc0xpc3RFbXB0eSgmcExpc3QtPkxpc3RIZWFkKSAmJiBjc3JMTEZpbmRFbnRyeSggcExpc3QsIHBFbnRyeSApICkgCisgICAgICAgIHsKKyAgICAgICAgICAgIHBOZXh0RW50cnkgPSBwRW50cnktPm5leHQ7CisgICAgICAgICAgICAvL01ha2Ugc3VyZSB3ZSBkb24ndCB3YWxrIHBhc3QgdGhlIGhlYWQKKyAgICAgICAgICAgIGlmICggcE5leHRFbnRyeSA9PSAmcExpc3QtPkxpc3RIZWFkICkgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcE5leHRFbnRyeSA9IE5VTEw7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoIGZJbnRlcmxvY2tlZCApIAorICAgICAgICB7CisgICAgICAgICAgICBjc3JMTFVubG9jayggcExpc3QgKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiggcE5leHRFbnRyeSApOworfQorCisKK3RMaXN0RWxlbSAqY3NyTExQcmV2aW91cyggdERibExpbmtMaXN0ICpwTGlzdCwgdExpc3RFbGVtICpwRW50cnksIHRBTklfQk9PTEVBTiBmSW50ZXJsb2NrZWQgKQoreworICAgIHRMaXN0RWxlbSAqcE5leHRFbnRyeSA9IE5VTEw7CisKKyAgICBpZiggIXBMaXN0KSAKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCIlczogRXJyb3IhISBwTGlzdCBpcyBOdWxsIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gcE5leHRFbnRyeSA7IAorICAgIH0KKworICAgIGlmICggTElTVF9GTEFHX09QRU4gPT0gcExpc3QtPkZsYWcgKSAKKyAgICB7CisgICAgICAgIGlmICggZkludGVybG9ja2VkICkgCisgICAgICAgIHsKKyAgICAgICAgICAgIGNzckxMTG9jayggcExpc3QgKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmICggIWNzcklzTGlzdEVtcHR5KCZwTGlzdC0+TGlzdEhlYWQpICYmIGNzckxMRmluZEVudHJ5KCBwTGlzdCwgcEVudHJ5ICkgKSAKKyAgICAgICAgeworICAgICAgICAgICAgcE5leHRFbnRyeSA9IHBFbnRyeS0+bGFzdDsgCisgICAgICAgICAgICAvL01ha2Ugc3VyZSB3ZSBkb24ndCB3YWxrIHBhc3QgdGhlIGhlYWQKKyAgICAgICAgICAgIGlmICggcE5leHRFbnRyeSA9PSAmcExpc3QtPkxpc3RIZWFkICkgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcE5leHRFbnRyeSA9IE5VTEw7CisgICAgICAgICAgICB9CisgICAgICAgIH0gIAorCisgICAgICAgIGlmICggZkludGVybG9ja2VkICkgCisgICAgICAgIHsKKyAgICAgICAgICAgIGNzckxMVW5sb2NrKCBwTGlzdCApOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuKCBwTmV4dEVudHJ5ICk7Cit9CisKKworCisKZGlmZiAtLWdpdCBhL3dsYW4vcHJpbWEvQ09SRS9TTUUvc3JjL2Nzci9jc3JMb2dEdW1wLmMgYi93bGFuL3ByaW1hL0NPUkUvU01FL3NyYy9jc3IvY3NyTG9nRHVtcC5jCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmEyMTZiYjQKLS0tIC9kZXYvbnVsbAorKysgYi93bGFuL3ByaW1hL0NPUkUvU01FL3NyYy9jc3IvY3NyTG9nRHVtcC5jCkBAIC0wLDAgKzEsMTM2IEBACisvKgorICogQ29weXJpZ2h0IChjKSAyMDEyLTIwMTMgVGhlIExpbnV4IEZvdW5kYXRpb24uIEFsbCBy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FNtZUJ0RXZlbnQpKTsKKyAgICAgICAgYnRFdmVudC5idEV2ZW50VHlwZSA9IGFyZzE7CisgICAgICAgIHN3aXRjaCggYXJnMSApCisgICAgICAgIHsKKyAgICAgICAgY2FzZSBCVF9FVkVOVF9TWU5DX0NPTk5FQ1RJT05fQ09NUExFVEU6CisgICAgICAgIGNhc2UgQlRfRVZFTlRfU1lOQ19DT05ORUNUSU9OX1VQREFURUQ6CisgICAgICAgICAgICBidEV2ZW50LnVFdmVudFBhcmFtLmJ0U3luY0Nvbm5lY3Rpb24uY29ubmVjdGlvbkhhbmRsZSA9ICh2X1UxNl90KWFyZzI7CisgICAgICAgICAgICBidEV2ZW50LnVFdmVudFBhcmFtLmJ0U3luY0Nvbm5lY3Rpb24uc3RhdHVzID0gKHZfVThfdClhcmczOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgQlRfRVZFTlRfRElTQ09OTkVDVElPTl9DT01QTEVURToKKyAgICAgICAgICAgIGJ0RXZlbnQudUV2ZW50UGFyYW0uYnREaXNjb25uZWN0LmNvbm5lY3Rpb25IYW5kbGUgPSAodl9VMTZfdClhcmcyOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgQlRfRVZFTlRfQ1JFQVRFX0FDTF9DT05ORUNUSU9OOgorICAgICAgICBjYXNlIEJUX0VWRU5UX0FDTF9DT05ORUNUSU9OX0NPTVBMRVRFOgorICAgICAgICAgICAgYnRFdmVudC51RXZlbnRQYXJhbS5idEFjbENvbm5lY3Rpb24uY29ubmVjdGlvbkhhbmRsZSA9ICh2X1UxNl90KWFyZzI7CisgICAgICAgICAgICBidEV2ZW50LnVFdmVudFBhcmFtLmJ0QWNsQ29ubmVjdGlvbi5zdGF0dXMgPSAodl9VOF90KWFyZzM7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBCVF9FVkVOVF9NT0RFX0NIQU5HRUQ6CisgICAgICAgICAgICBidEV2ZW50LnVFdmVudFBhcmFtLmJ0QWNsTW9kZUNoYW5nZS5jb25uZWN0aW9uSGFuZGxlID0gKHZfVTE2X3QpYXJnMjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyNpZm5kZWYgV0xBTl9NRE1fQ09ERV9SRURVQ1RJT05fT1BUCisgICAgICAgIGlmKEhBTF9TVEFUVVNfU1VDQ0VTUyhzbWVfQWNxdWlyZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGJ0Y1NpZ25hbEJURXZlbnQocE1hYywgJmJ0RXZlbnQpOworICAgICAgICAgICAgc21lX1JlbGVhc2VHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisgICAgICAgIH0KKyNlbmRpZgorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiBpbnZhbGlkIGV2ZW50ICglZCkiKSwgYXJnMSk7CisgICAgfQorICAgIHJldHVybiBwOworfQorc3RhdGljIGNoYXIqIGR1bXBfY3NyQXBDb25jU2NhblBhcmFtcyggdHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMzIgYXJnMSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgYXJnMiwgdEFOSV9VMzIgYXJnMywgdEFOSV9VMzIgYXJnNCwgY2hhciAqcCApCit7CisgICAgaWYoIGFyZzEgKQorICAgIHsKKyAgICAgICAgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uUmVzdFRpbWVDb25jID0gYXJnMTsKKyAgICB9CisgICAgaWYoIGFyZzIgKQorICAgIHsKKyAgICAgICAgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uQWN0aXZlTWluQ2huVGltZUNvbmMgPSBhcmcyOworICAgIH0KKyAgICBpZiggYXJnMyApCisgICAgeworICAgICAgICBwTWFjLT5yb2FtLmNvbmZpZ1B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dvcml0aG0gZm9yIDgwMi4xMXIgRmFzdCB0cmFuc2l0aW9ucyBhbmQgTGVnYWN5IHJvYW1pbmcgZm9yIEFuZHJvaWQgcGxhdGZvcm0uCisgIAorICAgIENvcHlyaWdodCAoQykgMjAxMCBRdWFsY29tbSwgSW5jb3Jwb3JhdGVkCisgIAorIAorICAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgIEVESVQgSElTVE9SWSBGT1IgRklMRQorCisKKyAgVGhpcyBzZWN0aW9uIGNvbnRhaW5zIGNvbW1lbnRzIGRlc2NyaWJpbmcgY2hhbmdlcyBtYWRlIHRvIHRoZSBtb2R1bGUuCisgIE5vdGljZSB0aGF0IGNoYW5nZXMgYXJlIGxpc3RlZCBpbiByZXZlcnNlIGNocm9ub2xvZ2ljYWwgb3JkZXIuCisKKworCisgIHdoZW4gICAgICAgICAgIHdobyAgICAgICAgICAgICAgICAgd2hhdCwgd2hlcmUsIHdoeQorLS0tLS0tLS0tLSAgICAgICAtLS0gICAgICAgICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKzA4LzAxLzEwICAgICAgICAgIE11cmFsaSAgICAgICAgICAgICBDcmVhdGVkCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisjaWZkZWYgV0xBTl9GRUFUVVJFX05FSUdIQk9SX1JPQU1JTkcKKyNpbmNsdWRlICJ3bGFuX3FjdF93ZGEuaCIKKyNpbmNsdWRlICJwYWxBcGkuaCIKKyNpbmNsdWRlICJjc3JJ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bnRyb2xJbmZvKHRwQW5pU2lyR2xvYmFsIHBNYWMpOworc3RhdGljIHZvaWQgY3NyTmVpZ2hib3JSb2FtRGVyZWdBbGxSc3NpSW5kaWNhdGlvbih0cEFuaVNpckdsb2JhbCBwTWFjKTsKKworVk9TX1NUQVRVUyBjc3JOZWlnaGJvclJvYW1OZWlnaGJvckxvb2t1cFVQQ2FsbGJhY2sgKHZfUFZPSURfdCBwQWRhcHRlciwgdl9VOF90IHJzc2lOb3RpZmljYXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9QVk9JRF90IHBVc2VyQ3R4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1M3X3QgYXZnUnNzaSk7CitWT1NfU1RBVFVTIGNzck5laWdoYm9yUm9hbU5laWdoYm9yTG9va3VwRE9XTkNhbGxiYWNrICh2X1BWT0lEX3QgcEFkYXB0ZXIsIHZfVThfdCByc3NpTm90aWZpY2F0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfUFZPSURfdCBwVXNlckN0eHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9TN190IGF2Z1Jzc2kpOwordm9pZCBjc3JOZWlnaGJvclJvYW1SUk1OZWlnaGJvclJlcG9ydFJlc3VsdCh2b2lkICpjb250ZXh0LCBWT1NfU1RBVFVTIHZvc1N0YXR1cyk7CitlSGFsU3RhdHVzIGNzclJvYW1Db3B5Q29ubmVjdGVkUHJvZmlsZSh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UzMiBzZXNzaW9uSWQsIHRDc3JSb2F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YW1HZXRSb2FtYWJsZUFQTGlzdE5leHRFbnRyeSh0cEFuaVNpckdsb2JhbCBwTWFjLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RGJsTGlua0xpc3QgKnBMaXN0LCB0cENzck5laWdoYm9yUm9hbUJTU0luZm8gcE5laWdoYm9yRW50cnkpCit7CisgICAgdExpc3RFbGVtICpwRW50cnkgPSBOVUxMOworICAgIHRwQ3NyTmVpZ2hib3JSb2FtQlNTSW5mbyBwUmVzdWx0ID0gTlVMTDsKKyAgICAKKyAgICBpZihwTGlzdCkKKyAgICB7CisgICAgICAgIGlmKE5VTEwgPT0gcE5laWdoYm9yRW50cnkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBFbnRyeSA9IGNzckxMUGVla0hlYWQocExpc3QsIExMX0FDQ0VTU19MT0NLKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHBFbnRyeSA9IGNzckxMTmV4dChwTGlzdCwgJnBOZWlnaGJvckVudHJ5LT5MaXN0LCBMTF9BQ0NFU1NfTE9DSyk7CisgICAgICAgIH0KKyAgICAgICAgaWYocEVudHJ5KQorICAgICAgICB7CisgICAgICAgICAgICBwUmVzdWx0ID0gR0VUX0JBU0VfQUREUihwRW50cnksIHRDc3JOZWlnaGJvclJvYW1CU1NJbmZvLCBMaXN0KTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICByZXR1cm4gcFJlc3VsdDsKK30KKworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgICBcZm4gY3NyTmVpZ2hib3JSb2FtRnJlZVJvYW1hYmxlQlNTTGlzdAorCisgICAgXGJyaWVmICAgRW1wdGllcyBhbmQgZnJlZXMgYWxsIHRoZSBub2RlcyBpbiB0aGUgcm9hbWFibGUgQVAg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ICAgICAgICAgICAweEZGKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiMTFSIFJlYXNzb2MgaW5kaWNhdGlvbiByZWNlaXZlZCBpbiIKKyAgICAgICAgICAgICAgICAgICAidW5leHBlY3RlZCBzdGF0ZSAlcyIpLAorICAgICAgICAgICAgICAgICAgIG1hY1RyYWNlR2V0TmVpZ2hib3VyUm9hbVN0YXRlKAorICAgICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5uZWlnaGJvclJvYW1TdGF0ZSkpOworICAgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisjZW5kaWYKKworI2lmZGVmIEZFQVRVUkVfV0xBTl9FU0UKKyAgICAgICAgaWYgKChwTmVpZ2hib3JSb2FtSW5mby0+aXNFU0VBc3NvYykKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfUk9BTV9TQ0FOX09GRkxPQUQKKyAgICAgICAgJiYgIWNzclJvYW1Jc1JvYW1PZmZsb2FkU2NhbkVuYWJsZWQocE1hYykKKyNlbmRpZgorICAgICAgICApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChlQ1NSX05FSUdIQk9SX1JPQU1fU1RBVEVfUkVQT1JUX1NDQU4gPT0gcE5laWdoYm9yUm9hbUluZm8tPm5laWdoYm9yUm9hbVN0YXRlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzck5laWdoYm9yUm9hbUlzc3VlUHJlYXV0aFJlcShwTWFjKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIkVTRSBSZWFzc29jIGluZGljYXRpb24gcmVjZWl2ZWQgaW4gdW5leHBlY3RlZCBzdGF0ZSAlcyIpLAorICAgICAgICAgICAgICAgICAgICAgICBtYWNUcmFjZUdldE5laWdoYm91clJvYW1TdGF0ZShwTmVpZ2hib3JSb2FtSW5mby0+bmVpZ2hib3JSb2FtU3RhdGUpKTsKKyAgICAgICAgICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyNlbmRpZgorI2lmZGVmIEZFQVRVUkVfV0xBTl9MRlIKKyAgICAgICAgICAgIGlmIChjc3JSb2FtSXNGYXN0Um9hbUVuYWJsZWQocE1hYywgQ1NSX1NFU1NJT05fSURfSU5WQUxJRCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKChlQ1NSX05FSUdIQk9SX1JPQU1fU1RBVEVfUkVQT1JUX1NDQU4gPT0gcE5laWdoYm9yUm9hbUluZm8tPm5laWdoYm9yUm9hbVN0YXRlKQorI2lmZGVmIFdMQU5fRkVBVFVSRV9ST0FNX1NDQU5fT0ZGTE9BRAorICAgICAgICAgICAgICAgIHx8IGNzclJvYW1Jc1JvYW1PZmZsb2FkU2NhbkVuYWJsZWQocE1hYykgfHwKKyAgICAgICAgICAgICAgICAoZVNNRV9ST0FNX1RSSUdHRVJfRkFTVF9ST0FNID09IHBOZWlnaGJvclJvYW1JbmZvLT5jZmdSb2FtRW4pCisjZW5kaWYKKyAgICAgICAgICAgICAgICApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JOZWlnaGJvclJvYW1Jc3N1ZVByZWF1dGhSZXEocE1hYyk7CisgICAgICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5jZmdSb2FtRW4gPSBlU01FX1JPQU1fVFJJR0dFUl9OT05FOworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX3NldCgmcE5laWdoYm9yUm9hbUluZm8tPmNmZ1JvYW1ic3NJZFswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHBOZWlnaGJvclJvYW1JbmZvLT5jZmdSb2FtYnNzSWQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEZGKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJMRlIgUmVhc3NvYyBpbmRpY2F0aW9uIHJlY2VpdmVkIGluIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgInVuZXhwZWN0ZWQgc3RhdGUgJXMiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hY1RyYWNlR2V0TmVpZ2hib3VyUm9hbVN0YXRlKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPm5laWdoYm9yUm9hbVN0YXRlKSk7CisgICAgICAgICAgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorI2VuZGlmCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGVDU1JfTkVJR0hCT1JfUk9BTV9TVEFURV9DRkdfQ0hBTl9MSVNUX1NDQU4gPT0gcE5laWdoYm9yUm9hbUluZm8tPm5laWdoYm9yUm9hbVN0YXRlKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY3NyTmVpZ2hib3JSb2FtUmVxdWVzdEhhbmRvZmYocE1hYyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiTm9uLTExUiBSZWFzc29jIGluZGljYXRpb24gcmVjZWl2ZWQgaW4iCisgICAgICAgICAgICAgICAgICAgICAgICAgICAidW5leHBlY3RlZCBzdGF0ZSAlcyBvciBSb2FtaW5nIGlzIGRpc2FibGVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWNUcmFjZUdldE5laWdoYm91clJvYW1TdGF0ZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5uZWlnaGJvclJvYW1TdGF0ZSkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfQorCitWT1NfU1RBVFVTIGNzck5laWdoYm9yUm9hbVVwZGF0ZUZhc3RSb2FtaW5nRW5hYmxlZCh0cEFuaVNpckdsb2JhbCBwTWFjLCBjb25zdCB2X0JPT0xfdCBmYXN0Um9hbUVuYWJsZWQpCit7CisgICAgdHBDc3JOZWlnaGJvclJvYW1Db250cm9sSW5mbyAgICBwTmVpZ2hib3JSb2FtSW5mbyA9ICZwTWFjLT5yb2FtLm5laWdoYm9yUm9hbUluZm87CisgICAgVk9TX1NUQVRVUyB2b3NTdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisKKyAgICBpZiAoZUNTUl9ORUlHSEJPUl9ST0FNX1NUQVRFX0NPTk5FQ1RFRCA9PSBwTmVpZ2hib3JSb2FtSW5mby0+bmVpZ2hib3JSb2FtU3RhdGUpCisgICAgeworICAgICAgICBpZiAoVk9TX1RSVUUgPT0gZmFzdFJvYW1FbmFibGVkKQorICAgICAgICB7CisjaWZkZWYgV0xBTl9GRUFUVVJFX1JPQU1fU0NBTl9PRkZMT0FECisgICAgICAgICAgICBpZiAocE1hYy0+cm9hbS5jb25maWdQYXJhbS5pc1JvYW1PZmZsb2FkU2NhbkVuYWJsZWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY3NyUm9hbU9mZmxvYWRTY2FuKHBNYWMsIFJPQU1fU0NBTl9PRkZMT0FEX1NUQVJULCBSRUFTT05fQ09OTkVDVCk7CisgICAgICAgICAgICB9IGVsc2UgeworI2VuZGlmCisgICAgICAgICAgICBORUlHSEJPUl9ST0FNX0RFQlVHKHBNYWMsIExPRzIsIEZMKCJSZWdpc3RlcmluZyBuZWlnaGJvciBsb29rdXAgRE9XTiBldmVudCB3aXRoIFRMLCBSU1NJID0gJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5jdXJyZW50TmVpZ2hib3JMb29rdXBUaHJlc2hvbGQpOworICAgICAgICAgICAgLyogUmVnaXN0ZXIgTmVpZ2hib3IgTG9va3VwIHRocmVzaG9sZCBjYWxsYmFjayB3aXRoIFRMIGZvciBET1dOIGV2ZW50IG9ubHkgKi8KKyAgICAgICAgICAgIHZvc1N0YXR1cyA9IFdMQU5UTF9SZWdSU1NJSW5kaWNhdGlvbkNCKHBNYWMtPnJvYW0uZ1Zvc0NvbnRleHQsICh2X1M3X3QpcE5laWdoYm9yUm9hbUluZm8tPmN1cnJlbnROZWlnaGJvckxvb2t1cFRocmVzaG9sZCAqICgtMSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfSE9fVEhSRVNIT0xEX0RPV04sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JOZWlnaGJvclJvYW1OZWlnaGJvckxvb2t1cERPV05DYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19NT0RVTEVfSURfU01FLCBwTWFjKTsKKyAgICAgICAgICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9lcnIgbXNnCisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgQ291bGRuJ3QgcmVnaXN0ZXIgY3NyTmVpZ2hib3JSb2FtTmVpZ2hib3JMb29rdXBET1dOQ2FsbGJhY2sgd2l0aCB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ICAgTkVJR0hCT1JfUk9BTV9ERUJVRyhwTWFjLCBMT0cyLCBGTCgiUmVnaXN0ZXJpbmcgbmVpZ2hib3IgbG9va3VwIERPV04gZXZlbnQgd2l0aCBUTCwgUlNTSSA9ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+Y3VycmVudE5laWdoYm9yTG9va3VwVGhyZXNob2xkKTsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfUk9BTV9TQ0FOX09GRkxPQUQKKyAgICAgICAgICAgIGlmIChwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLmlzUm9hbU9mZmxvYWRTY2FuRW5hYmxlZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjc3JSb2FtT2ZmbG9hZFNjYW4ocE1hYywgUk9BTV9TQ0FOX09GRkxPQURfU1RBUlQsIFJFQVNPTl9DT05ORUNUKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisjZW5kaWYKKyAgICAgICAgICAgIC8qIFJlZ2lzdGVyIE5laWdoYm9yIExvb2t1cCB0aHJlc2hvbGQgY2FsbGJhY2sgd2l0aCBUTCBmb3IgRE9XTiBldmVudCBvbmx5ICovCisgICAgICAgICAgICB2b3NTdGF0dXMgPSBXTEFOVExfUmVnUlNTSUluZGljYXRpb25DQihwTWFjLT5yb2FtLmdWb3NDb250ZXh0LCAodl9TN190KXBOZWlnaGJvclJvYW1JbmZvLT5jdXJyZW50TmVpZ2hib3JMb29rdXBUaHJlc2hvbGQgKiAoLTEpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX0hPX1RIUkVTSE9MRF9ET1dOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyTmVpZ2hib3JSb2FtTmVpZ2hib3JMb29rdXBET1dOQ2FsbGJhY2ssCisgICAgICAgICAgICAgICAgICAgICAgIC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lcmVnQWxsUnNzaUluZGljYXRpb24ocE1hYyk7CisKKyAgICAgICAgICAgTkVJR0hCT1JfUk9BTV9ERUJVRyhwTWFjLCBMT0cyLAorICAgICAgICAgICBGTCgiUmVnaXN0ZXJpbmcgbmVpZ2hib3IgbG9va3VwIERPV04gZXZlbnQgd2l0aCBUTCwgUlNTSSA9ICVkIiksCisgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5jdXJyZW50TmVpZ2hib3JMb29rdXBUaHJlc2hvbGQpOworICAgICAgICAgICAvKiBSZWdpc3RlciBOZWlnaGJvciBMb29rdXAgdGhyZXNob2xkIGNhbGxiYWNrIHdpdGggVEwgZm9yIERPV04gZXZlbnQgb25seSAqLworICAgICAgICAgICB2b3NTdGF0dXMgPSBXTEFOVExfUmVnUlNTSUluZGljYXRpb25DQihwTWFjLT5yb2FtLmdWb3NDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAodl9TN190KXBOZWlnaGJvclJvYW1JbmZvLT5jdXJyZW50TmVpZ2hib3JMb29rdXBUaHJlc2hvbGQgKiAoLTEpLAorICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfSE9fVEhSRVNIT0xEX0RPV04sCisgICAgICAgICAgICAgICAgICAgICAgIGNzck5laWdoYm9yUm9hbU5laWdoYm9yTG9va3VwRE9XTkNhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICBWT1NfTU9EVUxFX0lEX1NNRSwgcE1hYyk7CisgICAgICAgICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLy9lcnIgbXNnCisgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiIENvdWxkbid0IHJlZ2lzdGVyIGNzck5laWdoYm9yUm9hbU5laWdoYm9yTG9va3VwRE9XTkNhbGxiYWNrIHdpdGggVEw6IFN0YXR1cyA9ICVkIiksIHZvc1N0YXR1cyk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isgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNzck5laWdoYm9yUm9hbVJlYXNzb2NJbmRDYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX01PRFVMRV9JRF9TTUUpOworICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zU3RhdHVzKSkKKyAgICAgICAgeworICAgICAgICAgICAgLy9lcnIgbXNnCisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywgRkwoIiBDb3VsZG4ndCBkZXJlZ2lzdGVyIGNzck5laWdoYm9yUm9hbVJlYXNzb2NJbmRDYWxsYmFjayB3aXRoIFRMOiBTdGF0dXMgPSAlZCIpLCB2b3NTdGF0dXMpOworICAgICAgICB9CisKKyAgICAgICAgTkVJR0hCT1JfUk9BTV9ERUJVRyhwTWFjLCBMT0cyLCBGTCgiUmN2ZCByZWFzc29jIG5vdGlmaWNhdGlvbi1kZXJlZ2lzdGVyIFVQIGluZGljYXRpb24uIFRocmVzaG9sZCBSU1NJID0gJWQgUmVwb3J0ZWQgUlNTSSA9ICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTkVJR0hCT1JfUk9BTV9MT09LVVBfVVBfVEhSRVNIT0xEICogKC0xKSwgYXZnUnNzaSk7CisgICAgICAgIHZvc1N0YXR1cyA9IFdMQU5UTF9EZXJlZ1JTU0lJbmRpY2F0aW9uQ0IocE1hYy0+cm9hbS5nVm9zQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICh2X1M3X3QpTkVJR0hCT1JfUk9BTV9MT09LVVBfVVBfVEhSRVNIT0xEICogKC0xKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9IT19USFJFU0hPTERfVVAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB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hbm5lbHMpKQorICAgICAgICB7CisgICAgICAgICAgICAgICAgckNoSW5mby0+Y3VycmVudENoYW5JbmRleCA9IENTUl9ORUlHSEJPUl9ST0FNX0lOVkFMSURfQ0hBTk5FTF9JTkRFWDsKKyAgICAgICAgICAgICAgICByQ2hJbmZvLT5jdXJyZW50Q2hhbm5lbExpc3RJbmZvLm51bU9mQ2hhbm5lbHMgPSAwOworCisgICAgICAgICAgICAgICAgaWYgKHJDaEluZm8tPmN1cnJlbnRDaGFubmVsTGlzdEluZm8uQ2hhbm5lbExpc3QpCisgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUockNoSW5mby0+Y3VycmVudENoYW5uZWxMaXN0SW5mby5DaGFubmVsTGlzdCk7CisKKyAgICAgICAgICAgICAgICByQ2hJbmZvLT5jdXJyZW50Q2hhbm5lbExpc3RJbmZvLkNoYW5uZWxMaXN0ID0gTlVMTDsKKyAgICAgICAgICAgICAgICByQ2hJbmZvLT5jaGFuTGlzdFNjYW5JblByb2dyZXNzID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICB9CisgICAgICAgIGVsc2UgCisgICAgICAgIHsKKyAgICAgICAgICAgICAgICByQ2hJbmZvLT5jdXJyZW50Q2hhbkluZGV4ID0gMDsKKyAgICAgICAgICAgICAgICByQ2hJbmZvLT5jaGFuTGlzdFNjYW5JblByb2dyZXNzID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgIH0KK30KKworc3RhdGljIHZvaWQgY3NyTmVpZ2hib3JSb2FtUmVzZXRDZmdMaXN0Q2hhblNjYW5Db250cm9sSW5mbyh0cEFuaVNpckdsb2JhbCBwTWFjKQoreworICAgICAgICB0cENzck5laWdoYm9yUm9hbUNvbnRyb2xJbmZvIHBOZWlnaGJvclJvYW1JbmZvID0gJnBNYWMtPnJvYW0ubmVpZ2hib3JSb2FtSW5mbzsKKworICAgICAgICAvKiBTdG9wIG5laWdoYm9yIHNjYW4gdGltZXIgKi8KKyAg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naXN0ZXIgcmVhc3NvYyBjYWxsYmFjay4gSWdub3JlIHJldHVybiBzdGF0dXMgKi8KKyAgICAgICAgdm9zU3RhdHVzID0gV0xBTlRMX0RlcmVnUlNTSUluZGljYXRpb25DQihwTWFjLT5yb2FtLmdWb3NDb250ZXh0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICh2X1M3X3QpTkVJR0hCT1JfUk9BTV9MT09LVVBfVVBfVEhSRVNIT0xEICogKC0xKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9IT19USFJFU0hPTERfVVAsIAorICAgICAgICAgICAgICAgICAgICAgICAgY3NyTmVpZ2hib3JSb2FtTmVpZ2hib3JMb29rdXBVUENhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgVk9TX01PRFVMRV9JRF9TTUUpOworCisgICAgICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zU3RhdHVzKSkKKyAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiQ291bGRuJ3QgZGVyZWdpc3RlciBjc3JOZWlnaGJvclJvYW1OZWlnaGJvckxvb2t1cFVQQ2FsbGJhY2sgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ3aXRoIFRMOiBTdGF0dXMgPSAlZCIpLCB2b3NTdGF0dXMpOworICAgICAgICB9CisKKyAgICAgICAgTkVJR0hCT1JfUk9BTV9ERUJVRyhwTWFjLCBMT0cyLAorICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkRlcmVnaXN0ZXJpbmcgcmVhc3NvYyBET1dOIGNhbGxiYWNrIHdpdGggVEwuIFJTU0kgPSAlZCIpLCAKKyAgICAgICAgICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5jZmdQYXJhbXMubmVpZ2hib3JSZWFzc29jVGhyZXNob2xkICogKC0xKSk7CisKKyAgICAgICAgLyogRGVyZWdpc3RlciByZWFzc29jIGNhbGxiYWNrLiBJZ25vcmUgcmV0dXJuIHN0YXR1cyAqLworICAgICAgICB2b3NTdGF0dXMgPSBXTEFOVExfRGVyZWdSU1NJSW5kaWNhdGlvbkNCKHBNYWMtPnJvYW0uZ1Zvc0NvbnRleHQsIAorICAgICAgICAgICAgICAgICAgICAgICAgKHZfUzdfdClwTmVpZ2hib3JSb2FtSW5mby0+Y2ZnUGFyYW1zLm5laWdoYm9yUmVhc3NvY1RocmVzaG9sZCAqICgtMSksCisgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfSE9fVEhSRVNIT0xEX0RPV04sIAorICAgICAgICAgICAgICAgICAgICAgICAgY3NyTmVpZ2hib3JSb2FtUmVhc3NvY0luZENhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgVk9TX01PRFVMRV9JRF9TTUUpOworCisgICAgICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zU3RhdHVzKSkKKyAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiIENvdWxkbid0IGRlcmVnaXN0ZXIgY3NyTmVpZ2hib3JSb2FtUmVhc3NvY0luZENhbGxiYWNrIHdpdGggIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJUTDogU3RhdHVzID0gJWQiKSwgdm9zU3RhdHVzKTsKKyAgICAgICAgfQorCisgICAgICAgIE5FSUdIQk9SX1JPQU1fREVCVUcocE1hYywgTE9HMiwKKyAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJEZXJlZ2lzdGVyaW5nIG5laWdoYm9yTG9va3VwIERPV04gY2FsbGJhY2sgd2l0aCBUTC4gUlNTSSA9ICVkIiksIAorICAgICAgICAgICAgICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPmN1cnJlbnROZWlnaGJvckxvb2t1cFRocmVzaG9sZCAqICgtMSkpOworCisgICAgICAgIC8qIERlcmVnaXN0ZXIgbmVpZ2hib3IgbG9va3VwIGNhbGxiYWNrLiBJZ25vcmUgcmV0dXJuIHN0YXR1cyAqLworICAgICAgICB2b3NTdGF0dXMgPSBXTEFOVExfRGVyZWdSU1NJSW5kaWNhdGlvbkNCKHBNYWMtPnJvYW0uZ1Zvc0NvbnRleHQsIAorICAgICAgICAgICAgICAgICAgICAgICAgKHZfUzdfdClwTmVpZ2hib3JSb2FtSW5mby0+Y3VycmVudE5laWdoYm9yTG9va3VwVGhyZXNob2xkICogKC0xKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9IT19USFJFU0hPTERfRE9XTiwgCisgICAgICAgICAgICAgICAgICAgICAgICBjc3JOZWlnaGJvclJvYW1OZWlnaGJvckxvb2t1cERPV05DYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgIFZPU19NT0RVTEVfSURfU01FKTsKKworICAgICAgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpCisgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIiBDb3VsZG4ndCBkZXJlZ2lzdGVyIGNzck5laWdoYm9yUm9hbU5laWdoYm9yTG9va3VwRE9XTkNhbGxiYWNrICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAid2l0aCBUTDogU3RhdHVzID0gJWQiKSwgdm9zU3RhdHVzKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qIFJlc2V0IHRocmVzaG9sZHMgb25seSBhZnRlciBkZXJlZ2lzdGVyaW5nIERPV04gZXZlbnQgZnJvbSBUTCAqLworICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+Y3VycmVudE5laWdoYm9yTG9va3VwVGhyZXNob2xkID0gCisgICAgICAgICAgICAgICAg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TWFjQWRkciBic3NJZCkKK3sKKyAgICB0cENzck5laWdoYm9yUm9hbUNvbnRyb2xJbmZvICAgIHBOZWlnaGJvclJvYW1JbmZvID0gJnBNYWMtPnJvYW0ubmVpZ2hib3JSb2FtSW5mbzsKKworICAgIE5FSUdIQk9SX1JPQU1fREVCVUcocE1hYywgTE9HRSwgRkwoIiBBZGRlZCBCU1NJRCAiTUFDX0FERFJFU1NfU1RSIiB0byBQcmVhdXRoIGZhaWxlZCBsaXN0IiksCisgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShic3NJZCkpOworCisKKyAgICBpZiAoKHBOZWlnaGJvclJvYW1JbmZvLT5GVFJvYW1JbmZvLnByZUF1dGhGYWlsTGlzdC5udW1NQUNBZGRyZXNzICsgMSkgPgorICAgICAgICAgICAgTUFYX05VTV9QUkVBVVRIX0ZBSUxfTElTVF9BRERSRVNTKQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJQcmVhdXRoIGZhaWwgbGlzdCBhbHJlYWR5IGZ1bGwuLiBDYW5ub3QgYWRkIG5ldyBvbmUiKSk7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIH0KKyAgICB2b3NfbWVtX2NvcHkocE5laWdoYm9yUm9hbUluZm8tPkZUUm9hbUluZm8ucHJlQXV0aEZhaWxMaXN0Lm1hY0FkZHJlc3NbCisgICAgICAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+RlRSb2FtSW5mby5wcmVBdXRoRmFpbExpc3QubnVtTUFDQWRkcmVzc10sCisgICAgICAgICAgICAgICAgIGJzc0lkLAorICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICBwTmVpZ2hib3JSb2FtSW5mby0+RlRSb2FtSW5mby5wcmVBdXRoRmFpbExpc3QubnVtTUFDQWRkcmVzcysrOworICAgIAorICAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDR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KyAgICAgICAgcmV0dXJuIGVBTklfQk9PTEVBTl9UUlVFOworICAgIH0KKyNlbmRpZgorICAgIGlmICgwID09IHBOZWlnaGJvclJvYW1JbmZvLT5GVFJvYW1JbmZvLnByZUF1dGhGYWlsTGlzdC5udW1NQUNBZGRyZXNzKQorICAgICAgICByZXR1cm4gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgCisgICAgZm9yIChpID0gMDsgaSA8IHBOZWlnaGJvclJvYW1JbmZvLT5GVFJvYW1JbmZvLnByZUF1dGhGYWlsTGlzdC5udW1NQUNBZGRyZXNzOyBpKyspCisgICAgeworICAgICAgICBpZiAoVk9TX1RSVUUgPT0gdm9zX21lbV9jb21wYXJlKHBOZWlnaGJvclJvYW1JbmZvLT5GVFJvYW1JbmZvLnByZUF1dGhGYWlsTGlzdC5tYWNBZGRyZXNzW2ldLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnNzSWQsIHNpemVvZih0U2lyTWFjQWRkcikpKQorICAgICAgICB7CisgICAgICAgICAgICBORUlHSEJPUl9ST0FNX0RFQlVHKHBNYWMsIExPR0UsIEZMKCJCU1NJRCAiTUFDX0FERFJFU1NfU1RSIiBhbHJlYWR5IHByZXNlbnQgaW4gcHJlYXV0aCBmYWlsIGxpc3QiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKGJzc0lkKSk7CisgICAgICAgICAgICByZXR1cm4gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIGVBTklfQk9PTEVBTl9UUlVFOworfQorCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAgIFxmbiBjc3JOZWlnaGJvclJ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l6ZW9mKHRDc3JSb2FtSW5mbykpOworICAgICAgICBpZiAoTlVMTCA9PSByb2FtSW5mbykKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsIEZMKCJNZW1vcnkgYWxsb2NhdGlvbiBmYWlsZWQhIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCh2b2lkICopcm9hbUluZm8tPmJzc2lkLAorICAgICAgICAgICAgICAgICh2b2lkICopcE5laWdoYm9yQnNzTm9kZS0+cEJzc0Rlc2NyaXB0aW9uLT5ic3NJZCwKKyAgICAgICAgICAgICAgICBzaXplb2YodENzckJzc2lkKSk7CisgICAgICAgICAgICBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIHBOZWlnaGJvclJvYW1JbmZvLT5jc3JTZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvYW1JbmZvLCAwLCBlQ1NSX1JPQU1fUFJFQVVUSF9JTklUX05PVElGWSwgMCk7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocm9hbUluZm8pOworICAgICAgICB9CisjZW5kaWYKKworICAgICAgICBzdGF0dXMgPSBjc3JSb2FtRW5xdWV1ZVByZWF1dGgocE1hYywgcE5laWdoYm9yUm9hbUluZm8tPmNzclNlc3Npb25JZCwgcE5laWdoYm9yQnNzTm9kZS0+cEJzc0Rlc2NyaXB0aW9uLAorICAgICAgICAgICAgICAgIGVDc3JQZXJmb3JtUHJlYXV0aCwgZUFOSV9CT09MRUFOX1RSVUUpOworCisgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCBGTCgiQmVmb3JlIFByZS1BdXRoOiBCU1NJRCAiTUFDX0FERFJFU1NfU1RSIiwgQ2g6JWQiKSwKKyAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBOZWlnaGJvckJzc05vZGUtPnBCc3NEZXNjcmlwdGlvbi0+YnNz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WQgYnkgSEREICovCisjaWZkZWYgV0xBTl9GRUFUVVJFX1JPQU1fU0NBTl9PRkZMT0FECisgICAgICAgICAgICAgICAgaWYoIXBOZWlnaGJvclJvYW1JbmZvLT51T3NSZXF1ZXN0ZWRIYW5kb2ZmKQorI2VuZGlmCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzID0gY3NyTmVpZ2hib3JSb2FtQWRkQnNzSWRUb1ByZWF1dGhGYWlsTGlzdChwTWFjLCBwTmVpZ2hib3JCc3NOb2RlLT5wQnNzRGVzY3JpcHRpb24tPmJzc0lkKTsKKyAgICAgICAgICAgICAgICB9CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fTEZSX01FVFJJQ1MKKyAgICAgICAgICAgICAgICAvKiBMRlIgbWV0cmljcyAtIHByZS1hdXRoIGNvbXBsZXRpb24gbWV0cmljLiBTZW5kIHRoZSBldmVudAorICAgICAgICAgICAgICAgICAgIHRvIHN1cHBsaWNhbnQgdGhhdCBwcmUtYXV0aCBzdWNjZXNzZnVsbHkgY29tcGxldGVkICovCisgICAgICAgICAgICAgICAgcm9hbUluZm8gPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodENzclJvYW1JbmZvKSk7CisgICAgICAgICAgICAgICAgaWYgKE5VTEwgPT0gcm9hbUluZm8pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HMSwgRkwoIk1lbW9yeSBhbGxvY2F0aW9uIGZhaWxlZCEiKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgodm9pZCAqKXJvYW1JbmZvLT5ic3NpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopcE5laWdoYm9yQnNzTm9kZS0+cEJzc0Rlc2NyaXB0aW9uLT5ic3NJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0Q3NyQnNzaWQpKTsKKyAgICAgICAgICAgICAgICAgICAgY3NyUm9hbUNhbGxDYWxsYmFjayhwTWFjLCBwTmVpZ2hib3JSb2FtSW5mby0+Y3NyU2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgcm9hbUluZm8sIDAsIGVDU1JfUk9BTV9QUkVBVVRIX1NUQVRVU19GQUlMVVJFLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHJvYW1JbmZvKTsKKyAgICAgICAgICAgICAgICB9CisjZW5kaWYKKworICAgICAgICAgICAgLyogTm93IHdlIGNhbiBmcmVlIHRoaXMgbm9kZSAqLworICAgICAgICAgICAgY3NyTmVpZ2hib3JSb2FtRnJlZU5laWdoYm9yUm9hbUJTU05vZGUocE1hYywgcE5laWdoYm9yQnNzTm9kZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcFNlc3Npb24gPSBDU1JfR0VUX1NFU1NJT04ocE1hYywgcE5laWdoYm9yUm9hbUluZm8tPmNzclNlc3Npb25JZCk7CisgICAgICAgIGlmICgoTlVMTCAhPSBwU2Vzc2lvbikgJiYgcFNlc3Npb24tPmFib3J0Q29ubmVjdGlvbikKKyAgICAgICAgeworICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiBEZWF1dGggaW4gcHJvZ3Jlc3MgQWJvcnQgcHJlYXV0aCIpKTsKKyAgICAgICAgICAgZ290byBhYm9ydF9wcmVhdXRoOworICAgICAgICB9CisKKyAgICAgICAgLyogSXNzdWUgcHJlYXV0aCByZXF1ZXN0IGZvciB0aGUgc2FtZS9uZXh0IGVudHJ5ICovCisgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTID09IGNzck5laWdoYm9yUm9hbUlzc3VlUHJlYXV0aFJlcShwTWFjKSkKKyAgICAgICAgZ290byBERVFfUFJFQVVUSDsgCisKK2Fib3J0X3ByZWF1dGg6CisjaWZkZWYgV0xBTl9GRUFUVVJFX1JPQU1fU0NBTl9PRkZMT0FECisgICAgICAgIGlmIChjc3JSb2FtSXNSb2FtT2ZmbG9hZFNjYW5FbmFibGVkKHBNYWMpKQorICAgICAgICB7CisgICAgICAgICAgaWYocE5laWdoYm9yUm9hbUluZm8tPnVPc1JlcXVlc3RlZEhhbmRvZmYpCisgICAgICAgICAgeworICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT51T3NSZXF1ZXN0ZWRIYW5kb2ZmID0gMDsKKyAgICAgICAgICAgICBjc3JSb2FtT2ZmbG9hZFNjYW4ocE1hYywgUk9BTV9TQ0FOX09GRkxPQURfU1RBUlQsIFJFQVNPTl9QUkVBVVRIX0ZBSUxFRF9GT1JfQUxMKTsKKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZihwTmVpZ2hib3JSb2FtSW5mby0+aXNGb3JjZWRJbml0aWFsUm9hbVRvNUdIKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+aXNGb3JjZWRJbml0aWFsUm9hbVRvNUdIID0gMDsKKyAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIkZvcmNlZCA1RyByb2FtaW5nIHByZWF1dGggZ290IGZhaWxlZCIKKyAgICAgICAgICAgICAgICAgICAgInNlbmQgUlNPIFNUQVJUIGNtZCB0byBmd3IuIikpOworICAgICAgICAgICAgIGNzclJvYW1PZmZsb2FkU2NhbihwTWFjLFJPQU1fU0NBTl9PRkZMT0FEX1NUQVJULFJFQVNPTl9DT05ORUNUKTsKKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgICBjc3JSb2FtT2ZmbG9hZFNjYW4ocE1hYywgUk9BTV9TQ0FOX09GRkxPQURfUkVTVEFSVCwgUkVBU09OX1BSRUFVVEhfRkFJTEVEX0ZPUl9BTEwpOworICAgICAgICAgIH0KKyAgICAgICAgICBDU1JfTkVJR0hCT1JfUk9BTV9TVEFURV9UUkFOU0lUSU9OKGVDU1JfTkVJR0hCT1JfUk9BTV9TVEFURV9DT05ORUNURUQpOworICAgICAgICB9IGVsc2UKKyAgICAgICAgeworI2VuZGlmCisgICAgICAgICAgQ1NSX05FSUdIQk9SX1JPQU1fU1RBVEVfVFJBTlNJVElPTihlQ1NSX05FSUdIQk9SX1JPQU1fU1RBVEVfUkVQT1JUX1NDQU4pOworCisgICAgICAgICAgLyogUmVnaXN0ZXIgTmVpZ2hib3IgTG9va3VwIHRocmVzaG9sZCBjYWxsYmFjayB3aXRoIFRMIGZvciBVUCBldmVudCBub3cgKi8KKyAgICAgICAgICBORUlHSEJPUl9ST0FNX0RFQlVHKHBNYWMsIExPR0UsIEZMKCJObyBtb3JlIHByZS1hdXRoIGNhbmRpZGF0ZXMtIgorICAgICAgICAgICAgICAgICAgInJlZ2lzdGVyIFVQIGluZGljYXRpb24gd2l0aCBUTC4gUlNTSSA9ICVkLCIpLCBORUlHSEJPUl9ST0FNX0xPT0tVUF9VUF9USFJFU0hPTEQgKiAoLTEpKTsKKworICAgICAgICAgIHZvc1N0YXR1cyA9IFdMQU5UTF9SZWdSU1NJSW5kaWNhdGlvbkNCKHBNYWMtPnJvYW0uZ1Zvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodl9TN190KU5FSUdIQk9SX1JPQU1fTE9PS1VQX1VQX1RIUkVTSE9MRCAqICgtMSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfSE9fVEhSRVNIT0xEX1VQLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyTmVpZ2hib3JSb2FtTmVpZ2hib3JMb29rdXBVUENhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX01PRFVMRV9JRF9TTUUsIHBNYWMpOworICAgICAgICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zU3RhdHVzKSkKK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4gd2UgZG8gbm90IHNlZSB0aGlzIEFQIGluIHRoZSBzY2FuIHJlc3VsdCBmb3Igc29tZSByZWFzb24uSG93ZXZlcixpdCBpcworICAgICAgICBsZXNzIGxpa2VseSB0aGF0IHdlIGFyZSBhc3NvY2lhdGVkIHRvIGFuIEFQIGFuZCBkbyBub3Qgc2VlIGl0IGluIHRoZSBzY2FuIGxpc3QgKi8KKyAgICAgICAgdEFOSV9VMzIgQ3VyckFQUnNzaSA9IC0xMjU7CisjZW5kaWYKKworICAgICAgICB3aGlsZSAoTlVMTCAhPSAocFNjYW5SZXN1bHQgPSBjc3JTY2FuUmVzdWx0R2V0TmV4dChwTWFjLCAqcFNjYW5SZXN1bHRMaXN0KSkpCisgICAgICAgIHsKKworICAgICAgICAgICAgICAgIGlmIChWT1NfVFJVRSA9PSB2b3NfbWVtX2NvbXBhcmUocFNjYW5SZXN1bHQtPkJzc0Rlc2NyaXB0b3IuYnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+Y3VyckFQYnNzaWQsIHNpemVvZih0U2lyTWFjQWRkcikpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIFdlIGdvdCBhIG1hdGNoIHdpdGggdGhlIGN1cnJlbnRseSBhc3NvY2lhdGVkIEFQLgorICAgICAgICAgICAgICAgICAgICAgICAgICogQ2FwdHVyZSB0aGUgUlNTSSB2YWx1ZSBhbmQgY29tcGxldGUgdGhlIHdoaWxlIGxvb3AuCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBUaGUgd2hpbGUgbG9vcCBpcyBjb21wbGV0ZWQgaW4gb3JkZXIgdG8gbWFrZSB0aGUgY3VycmVudCBlbnRyeSBnbyBiYWNrIHRvIE5VTEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBhbmQgaW4gdGhlIG5leHQgd2hpbGUgbG9vcCwgaXQgcHJvcGVyb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URpZmY7CisjZW5kaWYKKyAgICB0QU5JX0JPT0xFQU4gcm9hbU5vdyA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKworICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgKiBGaW5kIG91dCB0aGUgQ3VycmVudCBBUCBSU1NJIGFuZCBrZWVwIGl0IGhhbmR5IHRvIGNoZWNrIGlmCisgICAgICogaXQgaXMgYmV0dGVyIHRoYW4gdGhlIFJTU0kgb2YgdGhlIEFQIHdoaWNoIHdlIGFyZQorICAgICAqIGdvaW5nIHRvIHJvYW0uSWYgc28sIHdlIGFyZSBnb2luZyB0byBjb250aW51ZSB3aXRoIHRoZQorICAgICAqIGN1cnJlbnQgQVAuCisgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAgICBDdXJyQVBSc3NpID0gY3NyR2V0Q3VycmVudEFQUnNzaShwTWFjLCBwU2NhblJlc3VsdExpc3QpOworCisgICAgLyogRXhwZWN0aW5nIHRoZSBzY2FuIHJlc3VsdCBhbHJlYWR5IHRvIGJlIGluIHRoZSBzb3J0ZWQgb3JkZXIgYmFzZWQgb24gdGhlIFJTU0kgKi8KKyAgICAvKiBCYXNlZCBvbiB0aGUgcHJldmlvdXMgc3RhdGUgd2UgbmVlZCB0byBjaGVjayB3aGV0aGVyIHRoZSBsaXN0IHNob3VsZCBiZSBzb3J0ZWQgYWdhaW4gdGFraW5nIG5laWdoYm9yIHNjb3JlIGludG8gY29uc2lkZXJhdGlvbiAqLworICAgIC8qIElmIHByZXZpb3VzIHN0YXRlIGlzIENGR19DSEFOX0xJU1RfU0NBTiwgdGhlcmUgc2hvdWxkIG5vdCBiZSBhbnkgbmVpZ2hib3Igc2NvcmUgYXNzb2NpYXRlZCB3aXRoIGFueSBvZiB0aGUgQlNTLgorICAgICAgIElmIHRoZSBwcmV2aW91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zc0Rlc2NyaXB0b3IuYnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5oYW5kb2ZmUmVxSW5mby5ic3NpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSkpfHwKKyAgICAgICAgICAgIChwU2NhblJlc3VsdC0+QnNzRGVzY3JpcHRvci5jaGFubmVsSWQgIT0gcE5laWdoYm9yUm9hbUluZm8tPmhhbmRvZmZSZXFJbmZvLmNoYW5uZWwpKSkKKworICAgICAgIHsKKyAgICAgICAgICAgVk9TX1RSQUNFIChWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgIlNLSVAtbm90IGEgY2FuZGlkYXRlIEFQIGZvciBPUyByZXF1ZXN0ZWQgcm9hbSIpOworICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICB9CisjZW5kaWYKKyNlbmRpZgorCisjaWZkZWYgRkVBVFVSRV9XTEFOX0xGUgorI2lmZGVmIFdMQU5fRkVBVFVSRV9ST0FNX1NDQU5fT0ZGTE9BRAorICAgICAgIGlmIChwTmVpZ2hib3JSb2FtSW5mby0+aXNGb3JjZWRJbml0aWFsUm9hbVRvNUdIKQorICAgICAgIHsKKyAgICAgICAgICAgIC8vQmVsb3cgY2hlY2sgaXMgcmVxdWlyZWQgYmVjYXVzZSBzY2FubmluZyBmb3IgZm9yY2VkIGluaXRpYWwgcm9hbWluZyB3ZSBoYXZlIG5vdAorICAgICAgICAgICAgLy9mbHVzaCBhbGwgdGhlIDIuNCBHSHogQ2hhbm5lbCwgc28gaXQgbWF5IHBvc3NiaWxlIHdlIG1heSByb2FtIGFnYWluIHRvCisgICAgICAgICAgICAvLzIuNCBHaHogYXAgb25seS4KKyAgICAgICAgICAgIGlmKEdldFJGQmFuZChwU2NhblJlc3VsdC0+QnNzRGVzY3JpcHRvci5jaGFubmVsSWQpICE9IFNJUl9CQU5EXzVfR0haKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRSAoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBGb3JjZWQgUm9hbSB0byA1RyBTa2lwIE5vbiA1RyBTY2FuIHJlc3VsdHMgIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvL3Jzc2kncyBhcmUgLXZlIHZhbHVlLCBzbyBpZiBhYnMgb2YgcnNzaSBpcyBncmVhdGVyCisgICAgICAgICAgICAvL21lYW5zIG5ldyBhcCBpcyBwb29yIHRoZW4gY3VycmVudGx5IGNvbm5lY3RlZCBhcC4KKyAgICAgICAgICAgIC8vQ2hlY2sgaXQgaXMgb25seSBwb29yIHdpdGhpbiBuU2VsZWN0NUdIek1hcmdpbiB2YWx1ZS4KKyAgICAgICAgICAgIGlmIChhYnMocFNjYW5SZXN1bHQtPkJzc0Rlc2NyaXB0b3IucnNzaSkgPiBhYnMoQ3VyckFQUnNzaSkgJiYKKyAgICAgICAgICAgICAgICgoYWJzKHBTY2FuUmVzdWx0LT5Cc3NEZXNjcmlwdG9yLnJzc2kpIC0gYWJzKEN1cnJBUFJzc2kpKQorICAgICAgICAgICAgICAgID4gcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uU2VsZWN0NUdIek1hcmdpbikKKyAgICAgICAgICAgICAgICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UgKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAiJXM6IEZvcmNlZCBSb2FtIHRvIDVHIEN1cnJlbnQgQVAgcnNzaT0lZCBuZXcgYXA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va3VwIHRocmVzaG9sZCwgdGhlbiBjb250aW51ZS4KKyAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICBpZiAoYWJzKHBTY2FuUmVzdWx0LT5Cc3NEZXNjcmlwdG9yLnJzc2kpID4KKyAgICAgICAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+Y3VycmVudE5laWdoYm9yTG9va3VwVGhyZXNob2xkKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UgKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgIiVzOiBbSU5GT0xPR10gbmV3IGFwIHJzc2kgKCVkKSBsb3dlciB0aGFuIGxvb2t1cCB0aHJlc2hvbGQgKCVkKSIsCisgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCAoaW50KXBTY2FuUmVzdWx0LT5Cc3NEZXNjcmlwdG9yLnJzc2kgKiAoLTEpLAorICAgICAgICAgICAgICAgICAgICAoaW50KXBOZWlnaGJvclJvYW1JbmZvLT5jdXJyZW50TmVpZ2hib3JMb29rdXBUaHJlc2hvbGQgKiAoLTEpKTsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgIGlmIChhYnMoQ3VyckFQUnNzaSkgPCBhYnMocFNjYW5SZXN1bHQtPkJzc0Rlc2NyaXB0b3IucnNzaSkpCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgIC8qRG8gbm90IHJvYW0gdG8gYW4gQVAgd2l0aCB3b3JzZSBSU1NJIHRoYW4gdGhlIGN1cnJlbnQqLworICAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UgKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogW0lORk9MT0ddQ3VycmVudCBBUCByc3NpPSVkIG5ldyBhcCByc3NpIHdvcnNlPSVkIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDdXJyQVBSc3NpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludClwU2NhblJlc3VsdC0+QnNzRGVzY3JpcHRvci5yc3NpICogKC0xKSApOworICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgIC8qRG8gbm90IHJvYW0gdG8gYW4gQVAgd2hpY2ggaXMgaGF2aW5nIGJldHRlciBSU1NJIHRoYW4gdGhlIGN1cnJlbnQgQVAsIGJ1dCBzdGlsbCBsZXNzIHRoYW4gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAqIG1hcmdpbiB0aGF0IGlzIHByb3ZpZGVkIGJ5IHVzZXIgZnJvbSB0aGUgaW5pIGZpbGUgKFJvYW1Sc3NpRGlmZikqLworICAgICAgICAgICAgICAgICAgICAgICBpZiAoYWJzKGFicyhDdXJyQVBSc3NpKSAtIGFicyhwU2NhblJlc3VsdC0+QnNzRGVzY3JpcHRvci5yc3NpKSkgPCBSb2FtUnNzaURpZmYpCisgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSAoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBbSU5GT0xPR11DdXJyZW50IEFQIHJzc2k9JWQgbmV3IGFwIHJzc2k9JWQgbm90IGdvb2QgZW5vdWdoLCByb2FtUnNzaURpZmY9JWQiLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEN1cnJBUFJzc2ksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaW50KXBTY2FuUmVzdWx0LT5Cc3NEZXNjcmlwdG9yLnJzc2kgKiAoLTEpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUm9hbVJzc2lEaWZmKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UgKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBbSU5GT0xPR11DdXJyZW50IEFQIHJzc2k9JWQgbmV3IGFwIHJzc2kgYmV0dGVyPSVkIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEN1cnJBUFJzc2ksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpbnQpcFNjYW5SZXN1bHQtPkJzc0Rlc2NyaXB0b3IucnNzaSAqICgtMSkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgfQorICAgICAgIH0KKworI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCisgICAgICAgIGlmIChwTmVpZ2hib3JSb2FtSW5mby0+aXMxMXJBc3NvYykKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKCFjc3JOZWlnaGJvclJvYW1Jc1ByZWF1dGhDYW5kaWRhdGUocE1hYywgcFNjYW5SZXN1bHQtPkJzc0Rlc2NyaXB0b3IuYnNzSWQpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiQlNTSUQgcHJlc2VudCBpbiBwcmUtYXV0aCBmYWlsIGxpc3QuLiBJZ25vcmluZyIpKTsKKyAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorI2VuZGlmIC8qIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSICovCisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisjaWZkZWYgV0xBTl9GRUFUVVJFX1JPQU1fU0NBTl9PRkZMT0FECisgICAgICAgIGlmICghY3NyUm9hbUlzUm9hbU9mZmxvYWRTY2FuRW5hYmxlZChwTWFjKSkKKyAgICAgICAgeworI2VuZGlmCisgICAgICAgICAgaWYgKHBOZWlnaGJvclJvYW1JbmZvLT5pc0VTRUFzc29jKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKCFjc3JOZWlnaGJvclJvYW1Jc1ByZWF1dGhDYW5kaWRhdGUocE1hYywgcFNjYW5SZXN1bHQtPkJzc0Rlc2NyaXB0b3IuYnNzSWQpKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIkJTU0lEIHByZXNlbnQgaW4gcHJlLWF1dGggZmFpbCBsaXN0Li4gSWdub3JpbmciKSk7CisgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgICAgICBpZiAoKHBTY2FuUmVzdWx0LT5Cc3NEZXNjcmlwdG9yLlFCU1NMb2FkX3ByZXNlbnQpICYmCisgICAgICAgICAgICAgICAocFNjYW5SZXN1bHQtPkJzc0Rlc2NyaXB0b3IuUUJTU0xvYWRfYXZhaWwpKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKHBOZWlnaGJvclJvYW1JbmZvLT5pc1ZPQWRtaXR0ZWQpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCBGTCgiTmV3IEFQIGhhcyAleCBCVyBhdmFpbGFibGUiKSwgKHVuc2lnbmVkIGludClwU2NhblJlc3VsdC0+QnNzRGVzY3JpcHRvci5RQlNTTG9hZF9hdmFpbCk7CisgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HMSwgRkwoIldlIG5lZWQgJXggQlcgYXZhaWxhYmxlIiksKHVuc2lnbmVkIGludClwTmVpZ2hib3JSb2FtSW5mby0+TWluUUJzc0xvYWRSZXF1aXJlZCk7CisgICAgICAgICAgICAgICAgICBpZiAocFNjYW5SZXN1bHQtPkJzc0Rlc2NyaXB0b3IuUUJTU0xvYWRfYXZhaWwgPCBwTmVpZ2hib3JSb2FtSW5mby0+TWluUUJzc0xvYWRSZXF1aXJlZCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UgKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIltJTkZPTE9HXUJTU0lEIDogIk1BQ19BRERSRVNTX1NUUiIgaGFzIG5vIGJhbmR3aWR0aCBpZ25vcmluZy4ubm90IGFkZGluZyB0byByb2FtIGxpc3QiLAorICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwU2NhblJlc3VsdC0+QnNzRGVzY3JpcHRvci5ic3NJZCkpOworICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiTm8gUUJzcyAleCAleCIpLCAodW5zaWduZWQgaW50KXBTY2FuUmVzdWx0LT5Cc3NEZXNjcmlwdG9yLlFCU1NMb2FkX2F2YWlsLCAodW5zaWduZWQgaW50KXBTY2FuUmVzdWx0LT5Cc3NEZXNjcmlwdG9yLlFCU1NMb2FkX3ByZXNlbnQpOworICAgICAgICAgICAgICBpZiAocE5laWdoYm9yUm9hbUluZm8tPmlzVk9BZG1pdHRlZCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFIChWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgIltJTkZPTE9HXUJTU0lEIDogIk1BQ19BRERSRVNTX1NUUiIgaGFzIG5vIFFCU1NMb2FkIElFLCBpZ25vcmluZy4ubm90IGFkZGluZyB0byByb2FtIGxpc3QiLAorICAgICAgICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHBTY2FuUmVzdWx0LT5Cc3NEZXNjcmlwdG9yLmJzc0lkKSk7CisgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfUk9BTV9TQ0FOX09GRkxPQUQKKyAgICAgICAgfQorI2VuZGlmCisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0VTRSAqLworCisjaWZkZWYgRkVBVFVSRV9XTEFOX0xGUgorICAgICAgICAvLyBJZiB3ZSBhcmUgc3VwcG9ydGluZyBsZWdhY3kgcm9hbWluZywgYW5kIAorICAgICAgICAvLyBpZiB0aGUgY2FuZGlkYXRlIGlzIG9uIHRoZSAicHJlLWF1dGggZmFpbGVkIiBsaXN0LCBpZ25vcmUgaXQuIAorICAgICAgICBpZiAoY3NyUm9hbUlzRmFzdFJvYW1FbmFibGVkKHBNYWMsIENTUl9TRVNTSU9OX0lEX0lOVkFMSUQpKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoIWNzck5laWdoYm9yUm9hbUlzUHJlYXV0aENhbmRpZGF0ZShwTWFjLCBwU2NhblJlc3VsdC0+QnNzRGVzY3JpcHRvci5ic3NJZCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJCU1NJRCBwcmVzZW50IGluIHByZS1hdXRoIGZhaWwgbGlzdC4uIElnbm9yaW5nIikpOworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0xGUiAqLworCisgICAgICAgIC8qIElmIHRoZSByZWNlaXZlZCB0aW1lc3RhbXAgaW4gQlNTIGRlc2NyaXB0aW9uIGlzIGVhcmxpZXIgdGhhbiB0aGUgc2NhbiByZXF1ZXN0IHRpbWVzdGFtcCwgc2tpcCAKKyAgICAgICAgICogdGhpcyByZXN1bHQgKi8KKyAgICAgICAgaWYgKChwTmVpZ2hib3JSb2FtSW5mby0+c2NhblJlcXVlc3RUaW1lU3RhbXAgPj0gcFNjYW5SZXN1bHQtPkJzc0Rlc2NyaXB0b3IublJlY2VpdmVkVGltZSkKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfUk9BTV9TQ0FOX09GRkxPQUQKKyAgICAgICAgICAgICYmICFjc3JSb2FtSXNSb2FtT2ZmbG9hZFNjYW5FbmFibGVkKHBNYWMpCisjZW5kaWYKKyAgICAgICAgKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIklnbm9yaW5nIEJTUyBhcyBpdCBpcyBvbGRlciB0aGFuIHRoZSBzY2FuIHJlcXVlc3QgdGltZXN0YW1wIikpOworICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKworICAgICAgICBwQnNzSW5mbyA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0Q3NyTmVpZ2hib3JSb2FtQlNTSW5mbykpOworICAgICAgICBpZiAoTlVMTCA9PSBwQnNzSW5mbykKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJNZW1vcnkgYWxsb2NhdGlvbiBmb3IgTmVpZ2hib3IgUm9hbSBCU1MgSW5mbyBmYWlsZWQuLiBKdXN0IGlnbm9yaW5nIikpOworICAgICAgICAgICAgY29udGludWU7C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bGlzdC4gU2NhbiBjeWNsZSBmb2xsb3dpbmcgb25lIHdoaWNoCisgICAgICAgICAgICAgICAgeWllbGRlZCBlbXB0eSByZXN1bHRzIGlzIHNwbGl0IGludG8gdHdvIGhhbHZlczogKGkpIHNjYW4gb24KKyAgICAgICAgICAgICAgICBjaGFubmVscyBpbiB0aGUgb2NjdXBpZWQgbGlzdCwgYW5kIChpaSkgc2NhbiBvbiBjaGFubmVscyBub3QKKyAgICAgICAgICAgICAgICBpbiB0aGUgb2NjdXBpZWQgbGlzdC4gVGhpcyBoZWxwcyBjb252ZXJnaW5nIGZhc3RlciAod2hpbGUKKyAgICAgICAgICAgICAgICBsb29raW5nIGZvciBjYW5kaWRhdGVzIGluIHRoZSBvY2N1cGllZCBsaXN0IGZpcnN0KSwgYW5kIGFsc28sCisgICAgICAgICAgICAgICAgYWRkcyBjaGFubmVscyB0byB0aGUgb2NjdXBpZWQgY2hhbm5lbCBsaXN0IHVwb24gZmluZGluZyBjYW5kaWRhdGVzCisgICAgICAgICAgICAgICAgbWF0Y2hpbmcgU1NJRCBwcm9maWxlIG9mIGludGVyZXN0LgorCisgICAgICAgICAgICAgICAgdUVtcHR5U2NhbkNvdW50ICAgICAgICAgICAgICAgICAgICAgICAgIENvbW1lbnRzCisgICAgICAgICAgICAgICAgZUZpcnN0RW1wdHlTY2FuICAgICBQcmV2aW91cyBzY2FuIHdhcyBkb25lIG9uIGNoYW5uZWxzIGluIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2NjdXBpZWQgbGlzdCBhbmQgeWllbGRlZCBwb3RlbnRpYWwgY2FuZGlkYXRlcy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRoaXMgc2NhbiBjeWNsZSB3YXMgbGlrZWx5IHRyaWdnZXJlZCB0aHJvdWdoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWNlaXB0IG9mIGxvb2t1cCBET1dOIG5vdGlmaWNhdGlvbiBldmVudC4KKyAgICAgICAgICAgICAgICBlU2Vjb25kRW1wdHlTY2FuICAgIFByZXZpb3VzIHNjYW4gd2FzIGRvbmUgb24gY2hhbm5lbHMgaW4gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvY2N1cGllZCBsaXN0IGFuZCB5aWVsZGVkIG5vIGNhbmRpZGF0ZXMuIFRoaXMgc2NhbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3ljbGUgd2FzIHRyaWdnZXJlZCB0aHJvdWdoIFJTU0kgbm90aWZpY2F0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoIG1vZGlmaWVkIGxvb2t1cCB0aHJlc2hvbGQuCisgICAgICAgICAgICAgICAgZVRoaXJkRW1wdHlTY2FuICAgICBQcmV2aW91cyBzY2FuIHdhcyBkb25lIG9uIGNoYW5uZWxzIE5PVCBpbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIG9jY3VwaWVkIGxpc3QgYW5kIHlpZWxkZWQgbm8gY2FuZGlkYXRlcy4gVGhpcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NhbiBjeWNsZSB3YXMgdHJpZ2dlcmVkIGltbWVkaWF0ZWx5IGFmdGVyIHNjYW5uaW5nCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVscyBpbiB0aGUgb2NjdXBpZWQgbGlzdCBhbmQgbm8gY2FuZGlkYXRlcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2VyZSBmb3VuZC4KKyAgICAgICAgICAgICAgICBlRm91cnRoRW1wdHlTY2FuICAgIFByZXZpb3VzIHNjYW4gd2FzIGRvbmUgb24gY2hhbm5lbHMgaW4gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvY2N1cGllZCBsaXN0IGFuZCB5aWVsZGVkIG5vIGNhbmRpZGF0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4pCisgICAgeworICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+dUVtcHR5U2NhbkNvdW50ID0gZUZpZnRoRW1wdHlTY2FuOworICAgIH0KKyAgICBpZiAoKCgwICE9IHBOZWlnaGJvclJvYW1JbmZvLT5jZmdQYXJhbXMuY2hhbm5lbEluZm8ubnVtT2ZDaGFubmVscykgfHwKKyAgICAgICAgIChhYnMocE5laWdoYm9yUm9hbUluZm8tPmxvb2t1cERPV05Sc3NpKSA+CisgICAgICAgICBhYnMocE5laWdoYm9yUm9hbUluZm8tPmNmZ1BhcmFtcy5uZWlnaGJvclJlYXNzb2NUaHJlc2hvbGQpKSkgJiYKKyAgICAgICAgKChwTmVpZ2hib3JSb2FtSW5mby0+dUVtcHR5U2NhbkNvdW50ID09IGVTZWNvbmRFbXB0eVNjYW4pIHx8CisgICAgICAgICAocE5laWdoYm9yUm9hbUluZm8tPnVFbXB0eVNjYW5Db3VudCA9PSBlRm91cnRoRW1wdHlTY2FuKSkpCisgICAgeworICAgICAgICAvKgorICAgICAgICAgKiBJZiB0aGUgc2NhbiB3YXMgdHJpZ2dlcmVkIGR1ZSB0byBsb29rdXBET1dOUnNzaSA+IHJlYXNzb2MgdGhyZXNob2xkLAorICAgICAgICAgKiB0aGVuIGl0IHdvdWxkIGJlIGEgY29udGlndW91cyBzY2FuIG9uIGFsbCB2YWxpZCBub24tREZTIGNoYW5uZWxzLgorICAgICAgICAgKiBJZiBjaGFubmVscyBhcmUgY29uZmlndXJlZCBpbiBJTkksIHRoZW4gb25seSB0aG9zZSBjaGFubmVscyBuZWVkCisgICAgICAgICAqIHRvIGJlIHNjYW5uZWQuCisgICAgICAgICAqIEluIGVpdGhlciBvZiB0aGVzZSBtb2RlcywgdGhlcmUgaXMgbm8gbmVlZCB0byB0cmlnZ2VyIGFuIGltbWVkaWF0ZQorICAgICAgICAgKiBzY2FuIHVwb24gZW1wdHkgc2NhbiByZXN1bHRzIGZvciB0aGUgc2Vjb25kIGFuZCBmb3VydGggdGltZSAod2hpY2gKKyAgICAgICAgICogd291bGQgYmUgZXF1aXZhbGVudCB0byBzY2FubmluZyBvbiBjaGFubmVscyBpbiBub24tb2NjdXBpZWQgbGlzdCkuCisgICAgICAgICAqIEluY3JlbWVudGluZyB1RW1wdHlTY2FuQ291bnQgd2lsbCBjb3JyZXNwb25kIHRvIHNraXBwaW5nIHRoaXMgc3RlcC4KKyAgICAgICAgICogTk9URTogZG91YmxlIGluY3JlbWVudCBvZiB1RW1wdHlTY2FuQ291bnQgY29ycmVzcG9uZHMgdG8gY29tcGxldGlvbgorICAgICAgICAgKiBvZiBzY2FucyBvbiBhbGwgdmFsaWQgY2hhbm5lbHMuCisgICAgICAgICAqLworICAgICAgICArK3BOZWlnaGJvclJvYW1JbmZvLT51RW1wdHlTY2FuQ291bnQ7CisgICAgICAgIE5FSUdIQk9SX1JPQU1fREVCVUcocE1hYywgTE9HMiwgIkV4dHJhIGluY3JlbWVudCBvZiBlbXB0eSBzY2FuIGNvdW50ICg9JWQpIgorICAgICAgICAgICAgIiBpbiBjb250aWd1b3VzIHNjYW4gbW9kZSIsIHBOZWlnaGJvclJvYW1JbmZvLT51RW1wdHlTY2FuQ291bnQpOworICAgIH0KKyNlbmRpZgorICAgIGlmICgoKHBOZWlnaGJvclJvYW1JbmZvLT5jdXJyZW50TmVpZ2hib3JMb29rdXBUaHJlc2hvbGQrMykgPAorICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+Y2ZnUGFyYW1zLm5laWdoYm9yUmVhc3NvY1RocmVzaG9sZCkKKyNpZmRlZiBGRUFUVVJFX1dMQU5fTEZSCisgICAgICAgICYmICgocE5laWdoYm9yUm9hbUluZm8tPnVFbXB0eVNjYW5Db3VudCAlIDIpID09IDEpCisjZW5kaWYKKyAgICAgICAgKQorICAgIHsKKyAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPmN1cnJlbnROZWlnaGJvckxvb2t1cFRocmVzaG9sZCArPSAzOworICAgIH0KKworI2lmZGVmI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pZ2hib3IgbG9va3VwIGNhbGxiYWNrIHdpdGggVEwgZm9yIFJTU0kgPSAlZCIpLAorICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPmN1cnJlbnROZWlnaGJvckxvb2t1cFRocmVzaG9sZCAqICgtMSkpOworCisgICAgICAgIHZvc1N0YXR1cyA9IFdMQU5UTF9SZWdSU1NJSW5kaWNhdGlvbkNCKHBNYWMtPnJvYW0uZ1Zvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAodl9TN190KXBOZWlnaGJvclJvYW1JbmZvLT5jdXJyZW50TmVpZ2hib3JMb29rdXBUaHJlc2hvbGQgKiAoLTEpLAorICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX0hPX1RIUkVTSE9MRF9ET1dOLAorICAgICAgICAgICAgICAgICAgICAgICAgY3NyTmVpZ2hib3JSb2FtTmVpZ2hib3JMb29rdXBET1dOQ2FsbGJhY2ssCisgICAgICAgICAgICAgICAgICAgICAgICBWT1NfTU9EVUxFX0lEX1NNRSwgcE1hYyk7CisKKyAgICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgICAgICAgICBGTCgiQ291bGRuJ3QgcmUtcmVnaXN0ZXIgY3NyTmVpZ2hib3JSb2FtTmVpZ2hib3JMb29rdXBET1dOQ2FsbGJhY2siCisgICAgICAgICAgICAgICAgICAgICAgIiB3aXRoIFRMOiBTdGF0dXMgPSAlZCIpLCBzdGF0dXMpOworICAgICAgICB9CisjaWZkZWYgRkVBVFVSRV9XTEFOX0xGUgorICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+bG9va3VwRE9XTlJzc2kgPSAwOworICAgIH0KKyAgICBlbHNlIGlmICgocE5laWdoYm9yUm9hbUluZm8tPnVFbXB0eVNjYW5Db3VudCA9PSBlU2Vjb25kRW1wdHlTY2FuKSB8fAorICAgICAgICAgICAgIChwTmVpZ2hib3JSb2FtSW5mby0+dUVtcHR5U2NhbkNvdW50ID09IGVGb3VydGhFbXB0eVNjYW4pKQorICAgIHsKKyAgICAgICAgLyogRW1wdHkgc2NhbiByZXN1bHRzIGZvciB0aGUgc2Vjb25kIG9yIGZvdXJ0aCB0aW1lICovCisKKyAgICAgICAgLyogSW1tZWRpYXRlbHkgc2NhbiBvbiBjaGFubmVscyBpbiBub24tb2NjdXBpZWQgbGlzdCAqLworICAgICAgICBjc3JOZWlnaGJvclJvYW1UcmFuc2l0VG9DRkdDaGFuU2NhbihwTWFjKTsKKyAgICB9CisgICAgZWxzZSBpZiAocE5laWdoYm9yUm9hbUluZm8tPnVFbXB0eVNjYW5Db3VudCA+PSBlVGhpcmRFbXB0eVNjYW4pCisgICAgeworICAgICAgICAvKiBFbXB0eSBzY2FuIHJlc3VsdHMgZm9yIHRoZSB0aGlyZCB0aW1lICovCisgICAgICAgIGlmIChwZXJmb3JtUGVyaW9kaWNTY2FuKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIlBlcmZvcm1pbmcgcGVyaW9kaWMgc2NhbiwgdUVtcHR5U2NhbkNvdW50PSVkIiksCisgICAgICAgICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPnVFbXB0eVNjYW5Db3VudCk7CisKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiBTZXQgdUVtcHR5U2NhbkNvdW50IHRvIE1BWCBzbyB0aGF0IHdlIGFsd2F5cyBlbnRlciB0aGlzCisgICAgICAgICAgICAgKiBjb25kaXRpb24gb24gc3Vic2VxdWVudCBlbXB0eSBzY2FuIHJlc3VsdHMKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPnVFbXB0eVNjYW5Db3VudCA9IGVNYXhFbXB0eVNjYW47CisKKyAgICAgICAgICAgIC8qIEZyb20gaGVyZSBvbiwgT05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ICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJFbXB0eSBzY2FuIHJlZnJlc2ggdGltZXIgc3RhcnRlZCAoJWQgbXMpIiksCisgICAgICAgICAgICAgICAgICAgICAgICAocE5laWdoYm9yUm9hbUluZm8tPmNmZ1BhcmFtcy5lbXB0eVNjYW5SZWZyZXNoUGVyaW9kKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoZVRoaXJkRW1wdHlTY2FuID09IHBOZWlnaGJvclJvYW1JbmZvLT51RW1wdHlTY2FuQ291bnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIFN0YXJ0IG5laWdoYm9yIHNjYW4gcmVzdWx0cyByZWZyZXNoIHRpbWVyICovCisgICAgICAgICAgICBpZiAoVk9TX1NUQVRVU19TVUNDRVNTICE9CisgICAgICAgICAgICAgICAgICAgIHZvc190aW1lcl9zdGFydCgmcE5laWdoYm9yUm9hbUluZm8tPm5laWdoYm9yUmVzdWx0c1JlZnJlc2hUaW1lciwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5jZmdQYXJhbXMubmVpZ2hib3JSZXN1bHRzUmVmcmVzaFBlcmlvZCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJOZWlnaGJvciByZXN1bHRzIHJlZnJlc2ggdGltZXIgZmFpbGVkIHRvIHN0YXJ0ICglZCkiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyk7CisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBOZWlnaGJvclJvYW1JbmZvLT5yb2FtQ2hhbm5lbEluZm8uY3VycmVudENoYW5uZWxMaXN0SW5mby5DaGFubmVsTGlzdCk7CisgICAgICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8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Wx0IHN0YXR1cyBjb2RlICVkIiksIGhzdGF0dXMpOworICAgICAgICB9CisgICAgICAgIC8qIFByb2Nlc3MgdGhlIHNjYW4gcmVzdWx0cyBhbmQgdXBkYXRlIHJvYW1hYmxlIEFQIGxpc3QgKi8KKyAgICAgICAgcm9hbU5vdyA9IGNzck5laWdoYm9yUm9hbVByb2Nlc3NTY2FuUmVzdWx0cyhwTWFjLCAmc2NhblJlc3VsdCk7CisKKyAgICAgICAgLyogRnJlZSB0aGUgc2NhbiBmaWx0ZXIgKi8KKyAgICAgICAgY3NyRnJlZVNjYW5GaWx0ZXIocE1hYywgJnNjYW5GaWx0ZXIpOworCisgICAgICAgIHRlbXBWYWwgPSBjc3JMTENvdW50KCZwTmVpZ2hib3JSb2FtSW5mby0+cm9hbWFibGVBUExpc3QpOworCisjaWZkZWYgV0xBTl9GRUFUVVJFX1JPQU1fU0NBTl9PRkZMT0FECisgICAgICAgIGlmKCFjc3JSb2FtSXNSb2FtT2ZmbG9hZFNjYW5FbmFibGVkKHBNYWMpKQorICAgICAgICB7CisjZW5kaWYKKyAgICAgICAgIHN3aXRjaChwTmVpZ2hib3JSb2FtSW5mby0+bmVpZ2hib3JSb2FtU3RhdGUpCisgICAgICAgICB7CisgICAgICAgICAgICBjYXNlIGVDU1JfTkVJR0hCT1JfUk9BTV9TVEFURV9DRkdfQ0hBTl9MSVNUX1NDQU46CisgICAgICAgICAgICAgICAgaWYgKHRlbXBWYWwpCisgICAgICAgICAgICAgICAgeworI2lmZGVmIEZFQVRVUkVfV0xBTl9MRlIKKyAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgICogU2luY2UgdGhlcmUgYXJlIG5vbi16ZXJvIGNhbmRpZGF0ZXMgZm91bmQKKyAgICAgICAgICAgICAgICAgICAgICogYWZ0ZXIgdGhlIHNjYW4sIHJlc2V0IGVtcHR5IHNjYW4gY291bnQuCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+dUVtcHR5U2NhbkNvdW50ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPnVTY2FuTW9kZSA9IERFRkFVTFRfU0NBTjsKKyNlbmRpZgorI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCisgICAgICAgICAgICAgICAgICAgIC8qIElmIHRoaXMgaXMgYSBub24tMTFyIGFzc29jaWF0aW9uLCB0aGVuIHdlIGNhbiByZWdpc3RlciB0aGUgcmVhc3NvYyBjYWxsYmFjayBoZXJlIGFzIHdlIGhhdmUgc29tZSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBUHMgaW4gdGhlIHJvYW1hYmxlIEFQIGxpc3QgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKHBOZWlnaGJvclJvYW1JbmZvLT5pczExckFzc29jKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvKiBWYWxpZCBBUHMgYXJlIGZvdW5kIGFmdGVyIHNjYW4uIE5vdyB3ZSBjYW4gaW5pdGlhdGUgcHJlLWF1dGhlbnRpY2F0aW9uICovCisgICAgICAgICAgICAgICAgICAgICAgICBDU1JfTkVJR0hCT1JfUk9BTV9TVEFURV9UUkFOU0lUSU9OKGVDU1JfTkVJR0hCT1JfUk9BTV9TVEFURV9SRVBPUlRfU0NBTikKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisjZW5kaWYKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICAgICAgICAgICAgICAgICAgIC8qIElmIHRoaXMgaXMgYSBub24tMTFyIGFzc29jaWF0aW9uLCB0aGVuIHdlIGNhbiByZWdpc3RlciB0aGUgcmVhc3NvYyBjYWxsYmFjayBoZXJlIGFzIHdlIGhhdmUgc29tZSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBUHMgaW4gdGhlIHJvYW1hYmxlIEFQIGxpc3QgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKHBOZWlnaGJvclJvYW1JbmZvLT5pc0VTRUFzc29jKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvKiBWYWxpZCBBUHMgYXJlIGZvdW5kIGFmdGVyIHNjYW4uIE5vdyB3ZSBjYW4gaW5pdGlhdGUgcHJlLWF1dGhlbnRpY2F0aW9uICovCisgICAgICAgICAgICAgICAgICAgICAgICBDU1JfTkVJR0hCT1JfUk9BTV9TVEFURV9UUkFOU0lUSU9OKGVDU1JfTkVJR0hCT1JfUk9BTV9TVEFURV9SRVBPUlRfU0NBTikKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisjZW5kaWYKKyNpZmRlZiBGRUFUVVJFX1dMQU5fTEZSCisgICAgICAgICAgICAgICAgICAgIC8qIElmIExGUiBpcyBlbmFibGVkLCB0aGVuIHdlIGNhbiByZWdpc3RlciB0aGUgcmVhc3NvYyBjYWxsYmFjayBoZXJlIGFzIHdlIGhhdmUgc29tZSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBUHMgaW4gdGhlIHJvYW1hYmxlIEFQIGxpc3QgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKGNzclJvYW1Jc0Zhc3RSb2FtRW5hYmxlZChwTWFjLCBDU1JfU0VTU0lPTl9JRF9JTlZBTElEKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLyogVmFsaWQgQVBzIGFyZSBmb3VuZCBhZnRlciBzY2FuLiBOb3cgd2UgY2FuIGluaXRpYXRlIHByZS1hdXRoZW50aWNhdGlvbiAqLworICAgICAgICAgICAgICAgICAgICAgICAgQ1NSX05FSUdIQk9SX1JPQU1fU1RBVEVfVFJBTlNJVElPTihlQ1NSX05FSUdIQk9SX1JPQU1fU1RBVEVfUkVQT1JUX1NDQU4pCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICBORUlHSEJPUl9ST0FNX0RFQlVHKHBNYWMsIExPR0UsIEZMKCJDb21wbGV0ZWQgc2Nhbm5pbmcgb2YgQ0ZHIENIQU4gTElTVCBpbiBub24tMTFyIGFzc29jaWF0aW9uLiBSZWdpc3RlcmluZyByZWFzc29jIGNhbGxiYWNrIikpOworICAgICAgICAgICAgICAgICAgICAgICAgLyogTm90aGluZyBtdWNoIHRvIGRvIG5vdy4gV2lsbCBjb250aW51ZSB0byByZW1haW4gaW4gdGhpcyBzdGF0ZSBpbiBjYXNlIG9mIG5vbi0xMXIgYXNzb2NpYXRpb24gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIFN0b3AgdGhlIHRpbWVyLiBCdXQgaG93IGxvbmcgdGhlIHJvYW1hYmxlIEFQIGxpc3Qgd2lsbCBiZSB2YWxpZCBpbiBoZXJlLiBBdCBzb21lIHBvaW50IG9mIHRpbWUsIHdlIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgbmVlZCB0byByZXN0YXJ0IHRoZSBDRkcgQ0hBTiBsaXN0IHNjYW4gcHJvY2VkdXJlIGlmIHJlYXNzb2MgY2FsbGJhY2sgaXMgbm90IGludm9rZWQgZnJvbSBUTCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhpbiBjZXJ0YWluIGR1cmF0aW9uICovCisgICAgICAgICAgICAgICAgICAgICAgICAKKy8vICAgICAgICAgICAgICAgICAgICAgICAgdm9zX3RpbWVyX3N0b3AoJnBOZWlnaGJvclJvYW1JbmZvLT5uZWlnaGJvclNjYW5UaW1lcik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgTkVJR0hCT1JfUk9BTV9ERUJVRyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICBGTCgiTm8gY2FuZGlkYXRlIGZvdW5kIGFmdGVyIHNjYW5uaW5nIGluIHN0YXRlICVzIC4uICIpLAorICAgICAgICAgICAgICAgICAgICBtYWNUcmFjZUdldE5laWdoYm91clJvYW1TdGF0ZSgKKyAgICAgICAgICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPm5laWdoYm9yUm9hbVN0YXRlKSk7CisgICAgICAgICAgICAgICAgICAgIC8qIEhhbmRsZSBpdCBhcHByb3ByaWF0ZWx5ICovCisgICAgICAgICAgICAgICAgICAgIGNzck5laWdoYm9yUm9hbUhhbmRsZUVtcHR5U2NhblJlc3VsdChwTWFjKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisjaWZkZWYgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIgICAgICAgICAgICAgICAgCisgICAgICAgICAgICBjYXNlIGVDU1JfTkVJR0hCT1JfUk9BTV9TVEFURV9SRVBPUlRfU0NBTjoKKyAgICAgICAgICAgICAgICBpZiAoIXRlbXBWYWwpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIk5vIGNhbmRpZGF0ZSBmb3VuZCBhZnRlciBzY2FubmluZyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJpbiBzdGF0ZSAlcyAuLiAiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hY1RyYWNlR2V0TmVpZ2hib3VyUm9hbVN0YXRlKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPm5laWdoYm9yUm9hbVN0YXRlKSk7CisgICAgICAgICAgICAgICAgICAgIC8qIFN0b3AgdGhlIHRpbWVyIGhlcmUgYXMgdGhlIHNhbWUgdGltZXIgd2lsbCBiZSBzdGFydGVkIGFnYWluIGluIENGR19DSEFOX1NDQU5fU1RBVEUgKi8KKyAgICAgICAgICAgICAgICAgICAgY3NyTmVpZ2hib3JSb2FtVHJhbnNpdFRvQ0ZHQ2hhblNjYW4ocE1hYyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworI2VuZGlmIC8qIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSICovCisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIC8vIENhbiBjb21lIG9ubHkgaW4gSU5JVCBzdGF0ZS4gV2hlcmUgaW4gd2UgYXJlIGFzc29jaWF0ZWQsIHdlIHNlbnQgc2NhbiBhbmQgdXNlcgorICAgICAgICAgICAgICAgIC8vIGluIHRoZSBtZWFudGltZSBkZWNpZGVzIHRvIGRpc2Fzc29jLCB3ZSB3aWxsIGJlIGluIGluaXQgc3RhdGUgYW5kIHN0aWxsIHJlY2VpdmVkIGNhbGwKKyAgICAgICAgICAgICAgICAvLyBiYWNrIGlzc3VlZC4gU2hvdWxkIG5vdCBjb21lIGhlcmUgaW4gYW55IG90aGVyIHN0YXRlLCBwcmludGluZyBqdXN0IGluIGNhc2UKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UgKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiU3RhdGUgJXMiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hY1RyYWNlR2V0TmVpZ2hib3VyUm9hbVN0YXRlKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPm5laWdoYm9yUm9hbVN0YXRlKSk7CisKKyAgICAgICAgICAgICAgICAvLyBMZXRzIGp1c3QgZXhpdCBvdXQgc2lsZW50bHkuCisgICAgICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICB9CisjaWZkZWYgV0xBTl9GRUFUVVJFX1JPQU1fU0NBTl9PRkZMT0FECisgICAgICAgIH0KKyNlbmRpZgorCisgICAgICAgIGlmICh0ZW1wVmFsKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfU1RBVFVTICB2b3NTdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisKKyAgICAgICAgICAgIGlmIChyb2FtTm93KQorICAgICAgICAgICAgeworI2lmZGVmIFdMQU5fRkVBVFVSRV9ST0FNX1NDQU5fT0ZGTE9BRAorICAgICAgICAgICAgICAgIGlmKCFjc3JSb2FtSXNSb2FtT2ZmbG9hZFNjYW5FbmFibGVkKHBNYWMpKQorICAgICAgICAgICAgICAgIHsKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgTkVJR0hCT1JfUk9BTV9ERUJVRyhwTWFjLCBMT0cyLAorICAgICAgICAgICAgICAgICAgICAgIEZMKCJJbW1lZGlhdGUgcm9hbS1kZXJlZ2lzdGVyIFVQIGluZGljYXRpb24uIFJTU0kgPSAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgIE5FSUdIQk9SX1JPQU1fTE9PS1VQX1VQX1RIUkVTSE9MRCAqICgtMSkpOworCisgICAgICAgICAgICAgICAgICB2b3NTdGF0dXMgPSBXTEFOVExfRGVyZWdSU1NJSW5kaWNhdGlvbkNCKHBNYWMtPnJvYW0uZ1Zvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICh2X1M3X3QpTkVJR0hCT1JfUk9BTV9MT09LVVBfVVBfVEhSRVNIT0xEICogKC0xKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX0hPX1RIUkVTSE9MRF9VUCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyTmVpZ2hib3JSb2FtTmVpZ2hib3JMb29rdXBVUENhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfTU9EVUxFX0lEX1NNRSk7CisKKyAgICAgICAgICAgICAgICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zU3RhdHVzKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkNvdWxkbid0IGRlcmVnaXN0ZXIgbG9va3VwIFVQIGNhbGxiYWNrIHdpdGggVEw6IFN0YXR1cyA9ICVkIiksIHZvc1N0YXR1cyk7CisgICAgICAgICAgICAgICAgICB9CisjaWZkZWYgV0xBTl9GRUFUVVJFX1JPQU1fU0NBTl9PRkZMT0FECisgICAgICAgICAgICAgICAgfQorI2VuZGlmCisKKyAgICAgICAgICAgICAgICBoc3RhdHVzID0gY3NyTmVpZ2hib3JSb2FtVHJpZ2dlckhhbmRvZmYocE1hYyxwTmVpZ2hib3JSb2FtSW5mbyk7CisgICAgICAgICAgICAgICAgaWYoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSBoc3RhdHVzKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiY3NyTmVpZ2hib3JSb2FtVHJpZ2dlckhhbmRvZmYgZmFpbCBzdGF0dXMgPSAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgaHN0YXR1cyk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgIH0KKworICAgICAgICBoc3RhdHVzID0gdm9zX3RpbWVyX3N0YXJ0KCZwTmVpZ2hib3JSb2FtSW5mby0+bmVpZ2hib3JSZXN1bHRzUmVm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BlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBORUlHSEJPUl9ST0FNX0RFQlVHKHBNYWMsIExPRzIsIEZMKCJSZWdpc3RlcmluZyBET1dOIGV2ZW50IFJlYXNzb2MgY2FsbGJhY2sgd2l0aCBUTC4gUlNTSSA9ICVkIiksIHBOZWlnaGJvclJvYW1JbmZvLT5jZmdQYXJhbXMubmVpZ2hib3JSZWFzc29jVGhyZXNob2xkICogKC0xKSk7CisgICAgICAgICAgICAvKiBSZWdpc3RlciBhIHJlYXNzb2MgSW5kaWNhdGlvbiBjYWxsYmFjayAqLworICAgICAgICAgICAgdm9zU3RhdHVzID0gV0xBTlRMX1JlZ1JTU0lJbmRpY2F0aW9uQ0IocE1hYy0+cm9hbS5nVm9zQ29udGV4dCwgKHZfUzdfdClwTmVpZ2hib3JSb2FtSW5mby0+Y2ZnUGFyYW1zLm5laWdoYm9yUmVhc3NvY1RocmVzaG9sZCAqICgtMSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9IT19USFJFU0hPTERfRE9XTiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNzck5laWdoYm9yUm9hbVJlYXNzb2NJbmRDYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX01PRFVMRV9JRF9TTUUsIHBNYWMpOworICAgICAgICAgICAgCisgICAgICAgICAgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvL2VyciBtc2cKKyAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLCBGTCgiIENvdWxkbid0IHJlZ2lzdGVyIGNzck5laWdoYm9yUm9hbVJlYXNzb2NJbmRDYWxsYmFjayB3aXRoIFRMOiBTdGF0dXMgPSAlZCIpLCB2b3NTdGF0dXMpOworICAgICAgICAgICAgfQorIAorICAgICAgICB9CisjaWZkZWYgV0xBTl9GRUFUVVJFX1JPQU1fU0NBTl9PRkZMT0FECisgICAgICAgIGlmIChjc3JSb2FtSXNSb2FtT2ZmbG9hZFNjYW5FbmFibGVkKHBNYWMpKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoIXRlbXBWYWwgfHwgIXJvYW1Ob3cpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoKGVTTUVfUk9BTV9UUklHR0VSX1NDQU4gPT0gcE5laWdoYm9yUm9hbUluZm8tPmNmZ1JvYW1FbikgfHwKKyAgICAgICAgICAgICAgICAgICAoZVNNRV9ST0FNX1RSSUdHRVJfRkFTVF9ST0FNID09IHBOZWlnaGJvclJvYW1JbmZvLT5jZmdSb2FtRW4pKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy9UaGlzIGlzIGlvY3RsIGJhc2VkIHJvYW1pbmcgaWYgd2UgZGlkIG5vdCBmaW5kIGFueSByb2FtYWJsZQorICAgICAgICAgICAgICAgICAgICAvL2NhbmRpZGF0ZSB0aGVuIGp1c3QgbG9nIGl0LgorICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgInRlbXBWYWwgPSAldSwgcm9hbU5vdyA9ICVkIHVPc1JlcXVlc3RlZEhhbmRvZmYgPSAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcFZhbCwgcm9hbU5vdywgcE5laWdoYm9yUm9hbUluZm8tPnVPc1JlcXVlc3RlZEhhbmRvZmYpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmIChwTmVpZ2hib3JSb2FtSW5mby0+aXNGb3JjZWRJbml0aWFsUm9hbVRvNUdIKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTm8gNUcgY2FuZGlkYXRlIGZvdW5kIHRlbXBWYWw9JXUsIHJvYW1Ob3c9JWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBWYWwsIHJvYW1Ob3cpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHBOZWlnaGJvclJvYW1JbmZvLT51T3NSZXF1ZXN0ZWRIYW5kb2ZmKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBjc3JSb2FtT2ZmbG9hZFNjYW4ocE1hYywgUk9BTV9TQ0FOX09GRkxPQURfU1RBUlQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVBU09OX05PX0NBTkRfRk9VTkRfT1JfTk9UX1JPQU1JTkdfTk9XKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT51T3NSZXF1ZXN0ZWRIYW5kb2ZmID0gMDsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLyogVGhlcmUgaXMgbm8gY2FuZGlkYXRlIG9yIFdlIGFyZSBub3Qgcm9hbWluZyBOb3cuCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBJbmZvcm0gdGhlIEZXIHRvIHJlc3RhcnQgUm9hbSBPZmZsb2FkIFNjYW4gICovCisgICAgICAgICAgICAgICAgICAgICAgICBjc3JSb2FtT2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KKyNpZmRlZiBGRUFUVVJFX1dMQU5fTEZSCisgICAgdEFOSV9VMzIgc2Vzc2lvbklkID0gQ1NSX1NFU1NJT05fSURfSU5WQUxJRDsKKworICAgIGlmIChOVUxMICE9IHBDb250ZXh0KQorICAgIHsKKyAgICAgICAgc2Vzc2lvbklkID0gKigodEFOSV9VMzIqKXBDb250ZXh0KTsKKworICAgICAgICBpZiAoIWNzclJvYW1Jc1N0YU1vZGUocE1hYywgc2Vzc2lvbklkKSkKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJJZ25vcmluZyBzY2FuIHJlcXVlc3QgY2FsbGJhY2sgb24gbm9uLWluZnJhIgorICAgICAgICAgICAgICAgICAgICJzZXNzaW9uICVkIGluIHN0YXRlICVzIiksCisgICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCwgbWFjVHJhY2VHZXROZWlnaGJvdXJSb2FtU3RhdGUoCisgICAgICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5uZWlnaGJvclJvYW1TdGF0ZSkpOworICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBDb250ZXh0KTsKKyAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCFjc3JSb2FtSXNGYXN0Um9hbUVuYWJsZWQocE1hYyxzZXNzaW9uSWQpKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIlJlY2VpdmVkIHdoZW4gZmFzdCByb2FtIGlzIGRpc2FibGVkLiBJZ25vcmUgaXQiKSk7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocENvbnRleHQpOworICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgIH0KKyAgICB9CisjZW5kaWYKKyAgICBwTWFjLT5yb2FtLm5laWdoYm9yUm9hbUluZm8uc2NhblJzcFB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cmFtLm5QYXNzaXZlTWF4Q2huVGltZTsKKyAgICB9CisKKyAgICBzdGF0dXMgPSBjc3JOZWlnaGJvclJvYW1Jc3N1ZUJnU2NhblJlcXVlc3QocE1hYywgJmJnU2NhblBhcmFtcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkLCBjc3JOZWlnaGJvclJvYW1TY2FuUmVxdWVzdENhbGxiYWNrKTsKKyAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyAhPSBzdGF0dXMpCisgICAgeworICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIklzc3VlIG9mIEJHIFNjYW4gcmVxdWVzdCBmYWlsZWQ6IFN0YXR1cyA9ICVkIiksIHN0YXR1cyk7CisgICAgfQorCisgICAgcE5laWdoYm9yUm9hbUluZm8tPnJvYW1DaGFubmVsSW5mby5jdXJyZW50Q2hhbkluZGV4Kys7CisgICAgaWYgKHBOZWlnaGJvclJvYW1JbmZvLT5yb2FtQ2hhbm5lbEluZm8uY3VycmVudENoYW5JbmRleCA+PSAKKyAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5yb2FtQ2hhbm5lbEluZm8uY3VycmVudENoYW5uZWxMaXN0SW5mby5udW1PZkNoYW5uZWxzKQorICAgIHsgICAgICAKKyAgICAgICAgTkVJR0hCT1JfUk9BTV9ERUJVRyhwTWFjLCBMT0cxLCBGTCgiQ29tcGxldGVkIHNjYW5uaW5nIGNoYW5uZWxzIGluIENoYW5uZWwgTGlzdDogQ3VyckNoYW5JbmRleCA9ICVkLCBOdW0gQ2hhbm5lbHMgPSAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+cm9hbUNoYW5uZWxJbmZvLmN1cnJlbnRDaGFuSW5kZXgsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTmVp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AgICAgICAgICAgICAgICAgKHRBTklfVTggKilwTWFjLT5yb2FtLnZhbGlkQ2hhbm5lbExpc3QsCisgICAgICAgICAgICAgICAgICAgICh0QU5JX1UzMiAqKSAmdGVtcE51bU9mQ2hhbm5lbHMpKSkKKyAgICB7CisgICAgICAgIC8vTWFrZSBzdXJlIHdlIGFyZSBzY2FubmluZyBvbmx5IGZvciA1R2h6IEFQIG9ubHkKKyAgICAgICAgLy9GaWxldHJpbmcgb3V0IHRoZSA1R0haIGJhc2VkIEFQLmZyb20gdmFsaWQgY2hhbm5lbCBsaXN0CisgICAgICAgIGNzck5laWdoYm9yUm9hbUNoYW5uZWxzRmlsdGVyQnlCYW5kKAorICAgICAgICAgICAgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0udmFsaWRDaGFubmVsTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgIHRlbXBOdW1PZkNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgdGVtcENoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgJnRlbXBOdW1PZkNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgU0lSX0JBTkRfNV9HSFoKKyAgICAgICAgICAgICAgICAgICAgICk7CisgICAgICAgIGZvciAoaSA9IDA7IChpIDwgdGVtcE51bU9mQ2hhbm5lbHMgJiYoaSA8IFdOSV9DRkdfVkFMSURfQ0hBTk5FTF9MSVNUX0xFTikpOyBpKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIERGUyBjaGFubmVsIHdpbGwgYmUgYWRkZWQgaW4gdGhlIGxpc3Qgb25seSB3aGVuIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgREZTIFJvYW1pbmcgc2NhbiBmbGFnIGlzIGVuYWJsZWQqLworICAgICAgICAgICAgaWYgKENTUl9JU19DSEFOTkVMX0RGUyh0ZW1wQ2hhbm5lbExpc3RbaV0pKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLmFsbG93REZTQ2hhbm5lbFJvYW0gPT0gVFJVRSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxMaXN0W251bU9mQ2hhbm5lbHMrK10gPSB0ZW1wQ2hhbm5lbExpc3RbaV07CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNoYW5uZWxMaXN0W251bU9mQ2hhbm5lbHMrK10gPSB0ZW1wQ2hhbm5lbExpc3RbaV07CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR1csIEZMKCJjc3JHZXRDZmdWYWxpZENoYW5uZWxzIGdvdCBmYWlsZWQgIikpOworICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICB9CisKKyAgICBpZihudW1PZkNoYW5uZWxzID09IDApCisgICAgeworICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgIEZMKCIgTm8gdmFsaWQgNUdoeiBjaGFubmVsIHByZXNlbnQgc28gc2tpcHBpbmcgSW5pdGlhbCBGb3JjZWQgNUdoIHJvYW1pbmciKSk7CisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRU1QVFk7CisgICAgfQorICAgIGlmIChudW1PZkNoYW5uZWxzID4gV05JX0NGR19WQUxJRF9DSEFOTkVMX0xJU1RfTEVOKQorICAgIHsKKyAgICAgICAgbnVtT2ZDaGFubmVscyA9IFdOSV9DRkdfVkFMSURfQ0hBTk5FTF9MSVNUX0xFTjsKKyAgICB9CisKKyAgICBiZ1NjYW5QYXJhbXMuQ2hhbm5lbEluZm8ubnVtT2ZDaGFubmVscyA9IG51bU9mQ2hhbm5lbHM7CisgICAgYmdTY2Fu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W5uZWxMaXN0OworCisgICAgaWYgKENTUl9JU19ST0FNX0lOVFJBX0JBTkRfRU5BQkxFRChwTWFjKSkKKyAgICB7CisgICAgICAgIGNzck5laWdoYm9yUm9hbUNoYW5uZWxzRmlsdGVyQnlCYW5kKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSW5DaGFubmVsTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtT2ZDaGFubmVscywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wQ2hhbm5lbExpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZudW1PZkNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHZXRSRkJhbmQocE1hYy0+cm9hbS5uZWlnaGJvclJvYW1JbmZvLmN1cnJBUG9wZXJhdGlvbkNoYW5uZWwpKTsKKyAgICAgICAgcEluQ2hhbm5lbExpc3QgPSB0bXBDaGFubmVsTGlzdDsKKyAgICB9CisKKyAgICBjaGFubmVsTGlzdCA9IHZvc19tZW1fbWFsbG9jKG51bU9mQ2hhbm5lbHMpOworICAgIGlmICggTlVMTCA9PSBjaGFubmVsTGlzdCApCisgICAgeworICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoImNvdWxkIG5vdCBhbGxvY2F0ZSBtZW1vcnkgZm9yIGNoYW5uZWxMaXN0IikpOworICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICB9CisgICAgdm9zX21lbV9jb3B5KGNoYW5uZWxMaXN0LCAodEFOSV9VOCAqKXBJbkNoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICBudW1PZkNoYW5uZWxzICogc2l6ZW9mKHRBTklfVTgpKTsKKworICAgIGJnU2NhblBhcmFtcy5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzID0gbnVtT2ZDaGFubmVsczsKKyAgICBiZ1NjYW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JvYW1JbmZvLT5zY2FuUnNwUGVuZGluZykKKyAgICB7CisgICAgICAgLy9tc2cKKyAgICAgICBzbXNMb2cocE1hYywgTE9HVywgRkwoIkFscmVhZHkgQmdTY2FuUnNwIGlzIFBlbmRpbmciKSk7CisgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHN3aXRjaCAocE5laWdoYm9yUm9hbUluZm8tPm5laWdoYm9yUm9hbVN0YXRlKQorICAgIHsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUgorICAgICAgICBjYXNlIGVDU1JfTkVJR0hCT1JfUk9BTV9TVEFURV9SRVBPUlRfU0NBTjoKKyAgICAgICAgICAgIHN3aXRjaChwTmVpZ2hib3JSb2FtSW5mby0+cHJldk5laWdoYm9yUm9hbVN0YXRlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNhc2UgZUNTUl9ORUlHSEJPUl9ST0FNX1NUQVRFX1JFUE9SVF9RVUVSWToKKyAgICAgICAgICAgICAgICAgICAgY3NyTmVpZ2hib3JSb2FtUGVyZm9ybUJnU2NhbihwTWFjLCBwTmVpZ2hib3JSb2FtSW5mby0+Y3NyU2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJOZWlnaGJvciBzY2FuIGNhbGxiYWNrIHJlY2VpdmVkIGluIgorICAgICAgICAgICAgICAgICAgICAgICAgICAic3RhdGUgJXMsIHByZXYgc3RhdGUgPSAlcyIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFjVHJhY2VHZXROZWlnaGJvdXJSb2FtU3RhdGUoCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+bmVpZ2hib3JSb2FtU3RhdGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFjVHJhY2VHZXROZWlnaGJvdXJSb2FtU3RhdGUoCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+cHJldk5laWdoYm9yUm9hbVN0YXRlKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisjZW5kaWYgLyogV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIgKi8KKyAgICAgICAgY2FzZSBlQ1NSX05FSUdIQk9SX1JPQU1fU1RBVEVfQ0ZHX0NIQU5fTElTVF9TQ0FOOiAgICAgCisgICAgICAgICAgICBjc3JOZWlnaGJvclJvYW1QZXJmb3JtQmdTY2FuKHBNYWMsIHBOZWlnaGJvclJvYW1JbmZvLT5jc3JTZXNzaW9uSWQgKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgYnJlYWs7CisgICAgfQorICAgIHJldHVybjsKK30KKwordm9pZCBjc3JOZWlnaGJvclJvYW1FbXB0eVNjYW5SZWZyZXNoVGltZXJDYWxsYmFjayh2b2lkICpjb250ZXh0KQoreworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVCggY29udGV4dCApOworICAgIFZPU19TVEFUVVMgICAgIHZvc1N0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgICB0cENzck5laWdoYm9yUm9hbUNvbnRyb2xJbmZvICBwTmVpZ2hib3JSb2FtSW5mbzsKKyAgICBpZighcE1hYykKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSAoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgRkwoInBNYWMgaXMgTnVsbCIpKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBwTmVpZ2hib3JSb2FtSW5mbyA9ICZwTWFjLT5yb2FtLm5laWdoYm9yUm9hbUluZm87CisKKyAgICAvKiBSZXNldCBhbG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ZWFzc29jVGhyZXNob2xkICogKC0xKSk7CisKKyAgICAvKiBEZXJlZ2lzdGVyIHJlYXNzb2MgY2FsbGJhY2suIElnbm9yZSByZXR1cm4gc3RhdHVzICovCisgICAgdm9zU3RhdHVzID0gV0xBTlRMX0RlcmVnUlNTSUluZGljYXRpb25DQihwTWFjLT5yb2FtLmdWb3NDb250ZXh0LCAodl9TN190KXBOZWlnaGJvclJvYW1JbmZvLT5jZmdQYXJhbXMubmVpZ2hib3JSZWFzc29jVGhyZXNob2xkICogKC0xKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX0hPX1RIUkVTSE9MRF9ET1dOLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyTmVpZ2hib3JSb2FtUmVhc3NvY0luZENhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfTU9EVUxFX0lEX1NNRSk7CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpCisgICAgeworICAgICAgICAvL2VyciBtc2cKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR1csIEZMKCIgQ291bGRuJ3QgZGVyZWdpc3RlciBjc3JOZWlnaGJvclJvYW1SZWFzc29jSW5kQ2FsbGJhY2sgd2l0aCBUTDogU3RhdHVzID0gJWQiKSwgdm9zU3RhdHVzKTsKKyAgICB9CisKKyAgICAvKiBSZXNldCBhbGwgdGhlIHZhcmlhYmxlcyBqdXN0IGFzIG5vIHNjYW4gaGFkIGhhcHBlbmVkIGJlZm9yZSAqLworICAgIGNzck5laWdoYm9yUm9hbVJlc2V0Q29ubmVjdGVkU3RhdGVDb250cm9sSW5mbyhwTWFjKTsKKworI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX1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9VOCogIHBPdXRwdXRDaGFubmVsTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4KiAgcE1lcmdlZE91dHB1dE51bU9mQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgdFNpclJGQmFuZCBiYW5kCisgICAgICAgICAgICAgICAgICAgICAgKQoreworICAgIHRBTklfVTggaSA9IDA7CisgICAgdEFOSV9VOCBudW1DaGFubmVscyA9IDA7CisKKyAgICAvLyBDaGVjayBmb3IgTlVMTCBwb2ludGVyCisgICAgaWYgKCFwSW5wdXRDaGFubmVsTGlzdCkgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKworICAgIC8vIENoZWNrIGZvciBOVUxMIHBvaW50ZXIKKyAgICBpZiAoIXBPdXRwdXRDaGFubmVsTGlzdCkgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKworICAgIGlmIChpbnB1dE51bU9mQ2hhbm5lbHMgPiBXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU4pCisgICAgeworICAgICAgICAgVk9TX1RSQUNFIChWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICIlczogV3JvbmcgTnVtYmVyIG9mIElucHV0IENoYW5uZWxzICVkIiwKKyAgICAgICAgICAgICBfX2Z1bmNfXywgaW5wdXROdW1PZkNoYW5uZWxzKTsKKyAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICAgfQorICAgIGZvciAoaSA9IDA7IGkgPCBpbnB1dE51bU9mQ2hhbm5lbHM7IGkrKykKKyAgICB7CisgICAgICAgIGlmIChiYW5kID09IEdldFJGQmFuZChwSW5wdXRDaGFubmVsTGlzdFtpXSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBPdXRwdXRDaGFubmVsTGlzdFtudW1DaGFubmVsc10gPSBwSW5wdXRDaGFubmVsTGlzdFtpXTsKKyAgICAgIC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worICAgIGZvciAoaSA9IDA7IChpIDwgaW5wdXROdW1PZkNoYW5uZWxzKSAmJiAobnVtQ2hhbm5lbHMgPCBXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU4pOyBpKyspCisgICAgeworICAgICAgICBmb3IgKGogPSAwOyBqIDwgb3V0cHV0TnVtT2ZDaGFubmVsczsgaisrKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAocElucHV0Q2hhbm5lbExpc3RbaV0gPT0gcE91dHB1dENoYW5uZWxMaXN0W2pdKQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGlmIChqID09IG91dHB1dE51bU9mQ2hhbm5lbHMpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChwSW5wdXRDaGFubmVsTGlzdFtpXSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UgKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgCisgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFtJTkZPTE9HXSBBZGRpbmcgZXh0cmEgJWQgdG8gTmVpZ2hib3IgY2hhbm5lbCBsaXN0IiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRDaGFubmVsTGlzdFtpXSk7IAorICAgICAgICAgICAgICAgIHBPdXRwdXRDaGFubmVsTGlzdFtudW1DaGFubmVsc10gPSBwSW5wdXRDaGFubmVsTGlzdFtpXTsgCisgICAgICAgICAgICAgICAgbnVtQ2hhbm5lbHMrKzsgCisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvLyBSZXR1cm4gZmluYWwgbnVtYmVyIG9mIGNoYW5uZWxzCisgICAgKnBNZXJnZWRPdXRwdXROdW1PZkNoYW5uZWxzID0gbnVtQ2hhbm5lbHM7IAorCisgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworLyogLS0tLS0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OZWlnaGJvckJzc0Rlc2NyaXB0aW9uLT5jaGFubmVsID09IGNoYW5uZWxMaXN0W2ldKQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGkgPT0gbnVtQ2hhbm5lbHMpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChwTmVpZ2hib3JCc3NEZXNjLT5wTmVpZ2hib3JCc3NEZXNjcmlwdGlvbi0+Y2hhbm5lbCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoQ1NSX0lTX1JPQU1fSU5UUkFfQkFORF9FTkFCTEVEKHBNYWMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gTWFrZSBzdXJlIHRvIGFkZCBvbmx5IGlmIGl0cyB0aGUgc2FtZSBiYW5kCisgICAgICAgICAgICAgICAgICAgIGlmIChHZXRSRkJhbmQocE5laWdoYm9yUm9hbUluZm8tPmN1cnJBUG9wZXJhdGlvbkNoYW5uZWwpID09CisgICAgICAgICAgICAgICAgICAgICAgICBHZXRSRkJhbmQocE5laWdoYm9yQnNzRGVzYy0+cE5laWdoYm9yQnNzRGVzY3JpcHRpb24tPmNoYW5uZWwpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UgKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBbSU5GT0xPR10gQWRkaW5nICVkIHRvIE5laWdoYm9yIGNoYW5uZWwgbGlzdCAoU2FtZSBiYW5kKVxuIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTmVpZ2hib3JCc3NEZXNjLT5wTmVpZ2hib3JCc3NEZXNjcmlwdGlvbi0+Y2hhbm5lbCk7CisgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsTGlzdFtudW1DaGFubmVsc10gPSBwTmVpZ2hib3JCc3NEZXNjLT5wTmVpZ2hib3JCc3NEZXNjcmlwdGlvbi0+Y2hhbm5lbDsKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bUNoYW5uZWxzKys7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFIChWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogW0lORk9MT0ddIEFkZGluZyAlZCB0byBOZWlnaGJvciBjaGFubmVsIGxpc3RcbiIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTmVpZ2hib3JCc3NEZXNjLT5wTmVpZ2hib3JCc3NEZXNjcmlwdGlvbi0+Y2hhbm5lbCk7CisgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxMaXN0W251bUNoYW5uZWxzXSA9IHBOZWlnaGJvckJzc0Rlc2MtPnBOZWlnaGJvckJzc0Rlc2NyaXB0aW9uLT5jaGFubmVsOworICAgICAgICAgICAgICAgICAgICBudW1DaGFubmVscysrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgIHBOZWlnaGJvckJzc0Rlc2MgPSBzbWVScm1HZXROZXh0QnNzRW50cnlGcm9tTmVpZ2hib3JDYWNoZShwTWFjLCBwTmVpZ2hib3JCc3NEZXNjKTsKKyAgICB9CisKKyAgICBpZiAocE5laWdoYm9yUm9hbUluZm8tPnJvYW1DaGFubmVsSW5mby5jdXJyZW50Q2hhbm5lbExpc3RJbmZvLkNoYW5uZWxMaXN0KQorICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBOZWlnaGJvclJvYW1J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kFMU0U7CisgICAgICAgICAgICBpZiAoVk9TX1NUQVRVU19TVUNDRVNTID09IHZvc1N0YXR1cykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBOZWVkIHRvIGNyZWF0ZSBjaGFubmVsIGxpc3QgYmFzZWQgb24gdGhlIG5laWdoYm9yIEFQIGxpc3QgYW5kIHRyYW5zaXRpb24gdG8gUkVQT1JUX1NDQU4gc3RhdGUgKi8KKyAgICAgICAgICAgICAgICB2b3NTdGF0dXMgPSBjc3JOZWlnaGJvclJvYW1DcmVhdGVDaGFuTGlzdEZyb21OZWlnaGJvclJlcG9ydChwTWFjKTsKKyAgICAgICAgICAgICAgICBpZiAoVk9TX1NUQVRVU19TVUNDRVNTID09IHZvc1N0YXR1cykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIE5FSUdIQk9SX1JPQU1fREVCVUcocE1hYywgTE9HRSwgRkwoIkNoYW5uZWwgTGlzdCBjcmVhdGVkIGZyb20gTmVpZ2hib3IgcmVwb3J0LCBUcmFuc2l0aW9uaW5nIHRvIE5FSUdIQk9SX1NDQU4gc3RhdGUiKSk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLyogV2UgYXJlIGdvbm5hIHNjYW4gbm93LiBSZW1lbWJlciB0aGUgdGltZSBzdGFtcCB0byBmaWx0ZXIgb3V0IHJlc3VsdHMgb25seSBhZnRlciB0aGlzIHRpbWVzdGFtcCAqLworICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5zY2FuUmVxdWVzdFRpbWVTdGFtcCA9ICh0QU5JX1RJTUVTVEFNUClwYWxHZXRUaWNrQ291bnQocE1hYy0+aEhkZCk7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgLyogTm93IHJlYWR5IGZvciBuZWlnaGJvciBzY2FuIGJhc2VkIG9uIHRoZSBjaGFubmVsIGxpc3QgY3JlYXRlZCAqLworICAgICAgICAgICAgICAgIC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bUluZm8tPnJvYW1DaGFubmVsSW5mby5jdXJyZW50Q2hhbm5lbExpc3RJbmZvLm51bU9mQ2hhbm5lbHMgPSAwOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5GVFJvYW1JbmZvLmN1cnJlbnROZWlnaGJvclJwdFJldHJ5TnVtID0gMDsgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgLyogTmVpZ2hib3Igc2NhbiB0aW1lciBzdGFydGVkLiBUcmFuc2l0aW9uIHRvIFJFUE9SVF9TQ0FOIHN0YXRlICovCisgICAgICAgICAgICAgICAgQ1NSX05FSUdIQk9SX1JPQU1fU1RBVEVfVFJBTlNJVElPTihlQ1NSX05FSUdIQk9SX1JPQU1fU1RBVEVfUkVQT1JUX1NDQU4pCisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogTmVpZ2hib3IgcmVwb3J0IHRpbWVvdXQgaGFwcGVuZWQgaW4gU01FIFJSTS4gV2UgY2FuIHRyeSBzZW5kaW5nIG1vcmUgbmVpZ2hib3IgcmVxdWVzdHMgdW50aWwgd2UgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlYWNoIHRoZSBtYXhOZWlnaGJvclJldHJpZXMgb3IgcmVjZWl2aW5nIGEgc3VjY2Vzc2Z1bCBuZWlnaGJvciByZXNwb25zZSAqLworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiTmVpZ2hib3IgcmVwb3J0IHJlc3VsdCBmYWlsZWQgYWZ0ZXIgJWQgcmV0cmllcywgTUFYIFJFVFJJRVMgPSAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPkZUUm9hbUluZm8uY3VycmVudE5laWdoYm9yUnB0UmV0cnlOdW0sIHBOZWlnaGJvclJvYW1JbmZvLT5jZmdQYXJhbXMubWF4TmVpZ2hib3JSZXRyaWVzKTsKKyAgICAgICAgICAgICAgICBpZiAocE5laWdoYm9yUm9hbUluZm8tPkZUUm9hbUluZm8uY3VycmVudE5laWdoYm9yUnB0UmV0cnlOdW0gPj0gCisgICAgICAgICAgICAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+Y2ZnUGFyYW1zLm1heE5laWdoYm9yUmV0cmllcykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiQmFpbGluZyBvdXQgdG8gQ0ZHIENoYW5uZWwgbGlzdCBzY2FuLi4gIikpOworICAgICAgICAgICAgICAgICAgICB2b3NTdGF0dXMgPSBjc3JOZWlnaGJvclJvYW1UcmFuc2l0VG9DRkdDaGFuU2NhbihwTWFjKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKFZPU19TVEFUVVNfU1VDQ0VTUyAhPSB2b3NTdGF0dXMpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiVHJhbnNpdCB0byBDRkcgQ2hhbm5lbCBsaXN0IHNjYW4gc3RhdGUgZmFpbGVkIHdpdGggc3RhdHVzICVkICIpLCB2b3NTdGF0dXMpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8qIFdlIHRyYW5zaXRpb25lZCB0byBkaWZmZXJlbnQgc3RhdGUgbm93LiBSZXNldCB0aGUgTmVpZ2hib3IgcmVwb3J0IHJldHJ5IGNvdW50ICovCisgICAgICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5GVFJvYW1JbmZvLmN1cnJlbnROZWlnaGJvclJwdFJldHJ5TnVtID0gMDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdm9zU3RhdHVzID0gY3NyTmVpZ2hib3JSb2FtSXNzdWVOZWlnaGJvclJwdFJlcXVlc3QocE1hYyk7CisgICAgICAgICAgICAgICAgICAgIGlmIChWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gdm9zU3RhdHVzKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIk5laWdoYm9yIHJlcG9ydCByZXF1ZXN0IGZhaWxlZC4gc3RhdHVzID0gJWQiKSwgdm9zU3RhdHVzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+RlRSb2FtSW5mby5uZWlnaGJvclJwdFBlbmRpbmcgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgLyogSW5jcmVtZW50IHRoZSBuZWlnaGJvciByZXBvcnQgcmV0cnkgY291bnQgYWZ0ZXIgc2VuZGluZyB0aGUgbmVpZ2hib3IgcmVxdWVzdCBzdWNjZXNzZnVsbHkgKi8KKyAgICAgICAgICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPkZUUm9hbUluZm8uY3VycmVudE5laWdoYm9yUnB0UmV0cnlOdW0rKzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiTmVpZ2hib3IgcmVzdWx0IGNhbGxiYWNrIG5vdCBleHBlY3RlZCBpbiIKKyAgICAgICAgICAgICAgICAgICAic3RhdGUgJXMsIElnbm9yaW5nLi4iKSwKKyAgICAgICAgICAgICAgICAgICBtYWNUcmFjZUdldE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5cHRpb25UeXBlOworCisgICAgaWYoIHBJZXMgKQorICAgIHsKKyAgICAgICAgaWYocEllcy0+U1NJRC5wcmVzZW50KQorICAgICAgICB7CisgICAgICAgICAgICBmTWF0Y2ggPSBjc3JJc1NzaWRNYXRjaCggcE1hYywKKyAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilwQ3VyUHJvZmlsZS0+U1NJRC5zc0lkLCBwQ3VyUHJvZmlsZS0+U1NJRC5sZW5ndGgsCisgICAgICAgICAgICAgICAgICAgIHBJZXMtPlNTSUQuc3NpZCwgcEllcy0+U1NJRC5udW1fc3NpZCwKKyAgICAgICAgICAgICAgICAgICAgZUFOSV9CT09MRUFOX1RSVUUgKTsKKyAgICAgICAgICAgIGlmKFRSVUUgPT0gZk1hdGNoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICogZm9yIG5vdyB3ZSBhcmUgc2VuZGluZyBOVUxMIGZvciBhbGwgUE1GIHJlbGF0ZWQgZmlsdGVyCisgICAgICAgICAgICAgICAgICogcGFyYW1ldGVycyBkdXJpbmcgcm9hbSB0byB0aGUgbmVpZ2hib3IgQVAgYmVjYXVzZQorICAgICAgICAgICAgICAgICAqIHNvIGZhciA4MDIxMVcgc3BlYyBkb2Vzbid0IHNwZWNpZnkgYW55dGhpbmcgYWJvdXQKKyAgICAgICAgICAgICAgICAgKiByb2FtaW5nIHNjZW5hcmlvLgorICAgICAgICAgICAgICAgICAqCisgICAgICAgICAgICAgICAgICogT25jZSByb2FtaW5nIHNjZW5hcmlvIGlzIGRlZmluZWQsIHdlIHNob3VsZCByZS12aXNpdAorICAgICAgICAgICAgICAgICAqIHRoaXMgc2VjdGlvbiBhbmQgcmVtb3ZlIHRoaXMgY29tbWVudC4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBmTWF0Y2ggPSBjc3JJc1NlY3VyaXR5TWF0Y2gocE1hYywgJmF1dGhUeXBlLCAmdUNFbmNyeXB0aW9uVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm1DRW5jcnlwdGlvblR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsIE5VTEwsIE5VTEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCc3NEZXNjLCBwSWVzLCBOVUxMLCBOVUxMLCBOVUxMKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gKGZNYXRjaCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmV0dXJuIChmTWF0Y2gpOworICAgICAgICAgICAgfQorCisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICByZXR1cm4gRkFMU0U7ICAvLyBUcmVhdCBhIG1pc3NpbmcgU1NJRCBhcyBhIG5vbi1tYXRjaC4KKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICByZXR1cm4gRkFMU0U7ICAvLyBBZ2FpbiwgdHJlYXQgbWlzc2luZyBwSWVzIGFzIGEgbm9uLW1hdGNoLgorICAgIH0KK30KKwordEFOSV9CT09MRUFOIGNzck5laWdoYm9yUm9hbUlzTmV3Q29ubmVjdGVkUHJvZmlsZSgKKyAgICAgICAgdHBBbmlTaXJHbG9iYWwgcE1hYykKK3sKKyAgICB0cENzck5laWdoYm9yUm9hbUNvbnRyb2xJbmZvICAgIHBOZWlnaGJvclJvYW1JbmZvID0gJnBNYWMtPnJvYW0ubmVpZ2hib3JSb2FtSW5mbzsKKyAgICB0QU5JX1U4IHNlc3Npb25JZCAgID0gKHRBTklfVTgpcE5laWdoYm9yUm9hbUluZm8tPmNzclNlc3Npb25JZDsKKyAgICB0Q3NyUm9hbUNvbm5lY3RlZFByb2ZpbGUgKnBDdXJyUHJvZmlsZSA9IE5VTEw7CisgICAgdENzclJvYW1Db25uZWN0ZWRQcm9maWxlICpwUHJldlByb2ZpbGUgPSBOVUxMOworICAgIHREb3QxMWZCZWFjb25JRXMgKnBJZXMgPSBOVUxMOworICAgIHRTaXJCc3NEZXNjcmlwdGlvbiAqcEJzc0Rlc2MgPSBOVUxMOworICAgIHRBTklfQk9PTEVBTiBmTmV3ID0gVFJVRTsKKworICAgIGlmKCEocE1hYy0+cm9hbS5yb2FtU2Vzc2lvbiAmJiBDU1JfSVNfU0VTU0lPTl9WQUxJRChwTWFjLCBzZXNzaW9uSWQpKSkKKyAgICB7CisgICAgICAgIHJldHVybiAoZk5ldyk7CisgICAgfQorCisgICAgcEN1cnJQcm9maWxlID0gJnBNYWMtPnJvYW0ucm9hbVNlc3Npb25bc2Vzc2lvbklkXS5jb25uZWN0ZWRQcm9maWxlOworICAgIGlmKCAhcEN1cnJQcm9maWxlICkKKyAgICB7CisgICAgICAgIHJldHVybiAoZk5ldyk7Cit9CisKKyAgICBwUHJldlByb2ZpbGUgPSAmcE5laWdoYm9yUm9hbUluZm8tPnByZXZDb25uUHJvZmlsZTsKKyAgICBpZiggIXBQcmV2UHJvZmlsZSApCisgICAgeworICAgICAgICByZXR1cm4gKGZOZXcpOworICAgIH0KKworICAgIHBCc3NEZXNjID0gcFByZXZQcm9maWxlLT5wQnNzRGVzYzsKKyAgICBpZiAocEJzc0Rlc2MpCisgICAgeworICAgICAgICBpZiAoSEFMX1NUQVRVU19TVUNDRVNTKGNzckdldFBhcnNlZEJzc0Rlc2NyaXB0aW9uSUVzKHBNYWMsCisgICAgICAgICAgICBwQnNzRGVzYywgJnBJZXMpKSAmJgorICAgICAgICAgICAgY3NyTmVpZ2hib3JSb2FtSXNTc2lkQW5kU2VjdXJpdHlNYXRjaChwTWFjLCBwQ3VyclByb2ZpbGUsIHBCc3NEZXNjLCBwSWVzKSkKKyAgICAgICAgeworICAgICAgICAgICAgZk5ldyA9IEZBTFNFOworICAgICAgICB9CisgICAgICAgIGlmIChwSWVzKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocEllcyk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBpZiAoZk5ldykKKyAgICB7CisgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCBGTCgiUHJldiByb2FtIHByb2ZpbGUgZGlkIG5vdCBtYXRjaCBjdXJyZW50IikpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBzbXNMb2cocE1hYywgTE9HMSwgRkwoIlByZXYgcm9hbSBwcm9maWxlIG1hdGNoZXMgY3VycmVudCIpKTsKKyAgICB9CisKKyAgICByZXR1cm4gKGZOZXcpOworfQorCit0QU5JX0JPT0xFQU4gY3NyTmVpZ2hib3JSb2FtQ29ubmVjdGVkUHJvZmlsZU1hdGNoKAorICAgICAgICB0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICB0Q3NyU2NhblJlc3VsdCAqcFJlc3VsdCwKKyAgICAgICAgdERvdDExZkJlYWNvbklFcyAqcEllcykKK3sKKyAgICB0cENzck5laWdoYm9yUm9hbUNvbnRyb2xJbmZvICAgIHBOZWlnaGJvclJvYW1JbmZvID0gJnBNYWMtPnJvYW0ubmVpZ2hib3JSb2FtSW5mbzsKKyAgICB0QU5JX1U4IHNlc3Npb25JZCAgID0gKHRBTklfVTgpcE5laWdoYm9yUm9hbUluZm8tPmNzclNlc3Npb25JZDsKKyAgICB0Q3NyUm9hbUNvbm5lY3RlZFByb2ZpbGUgKnBDdXJQcm9maWxlID0gTlVMTDsKKyAgICB0U2lyQnNzRGVzY3JpcHRpb24gKnBCc3NEZXNjID0gJnBSZXN1bHQtPlJlc3VsdC5Cc3NEZXNjcmlwdG9yOworCisgICAgaWYoICEocE1hYy0+cm9hbS5yb2FtU2Vzc2lvbgorICAgICAgICAgICAgJiYgQ1NSX0lTX1NFU1NJT05fVkFMSUQocE1hYywgc2Vzc2lvbklkKSkpCisgICAgeworICAgICAgICByZXR1cm4gRkFMU0U7CisgICAgfQor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ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU4pKTsgaSsrKQorICAgIHsKKyAgICAgICAgaWYgKCFjc3JJc0NoYW5uZWxQcmVzZW50SW5MaXN0KHBPY2N1cGllZENoYW5uZWxMaXN0LCBudW1PY2N1cGllZENoYW5uZWxzLAorICAgICAgICAgICAgIHBJbnB1dENoYW5uZWxMaXN0W2ldKSkKKyAgICAgICAgeworICAgICAgICAgICAvKiBERlMgY2hhbm5lbCB3aWxsIGJlIGFkZGVkIGluIHRoZSBsaXN0IG9ubHkgd2hlbiB0aGUKKyAgICAgICAgICAgICAgREZTIFJvYW1pbmcgc2NhbiBmbGFnIGlzIGVuYWJsZWQqLworICAgICAgICAgICAgaWYgKENTUl9JU19DSEFOTkVMX0RGUyhwSW5wdXRDaGFubmVsTGlzdFtpXSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uYWxsb3dERlNDaGFubmVsUm9hbSA9PSBUUlVFKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcE91dHB1dENoYW5uZWxMaXN0W291dHB1dE51bU9mQ2hhbm5lbHMrK10gPSBwSW5wdXRDaGFubmVsTGlzdFtpXTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcE91dHB1dENoYW5uZWxMaXN0W291dHB1dE51bU9mQ2hhbm5lbHMrK10gPSBwSW5wdXRDaGFubmVsTGlzdFtpXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHNtc0xvZyhwTWFjLCBMT0cyLCBGTCgiTnVtYmVyIG9mIGNoYW5uZWxzIGluIHRoZSB2YWxpZCBjaGFubmVsIGxpc3Q9JWQ7ICIKKyAgICAgICAgICAgIk51bWJlciBvZiBjaGFubmVscyBpbiB0aGUgbm9uLW9jY3VwaWVkIGxp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pbnB1dCBjaGFubmVsIGxpc3QgdG8gdGhlIG91dHB1dCBsaXN0LgorICAgICAgICAgICAgICAgICAgICAmbnVtT2ZDaGFubmVscyApOworCisgICAgICAgICAgICBpZiAoQ1NSX0lTX1JPQU1fSU5UUkFfQkFORF9FTkFCTEVEKHBNYWMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNzck5laWdoYm9yUm9hbUNoYW5uZWxzRmlsdGVyQnlCYW5kKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+Y2ZnUGFyYW1zLmNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+Y2ZnUGFyYW1zLmNoYW5uZWxJbmZvLm51bU9mQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbnVtT2ZDaGFubmVscywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR2V0UkZCYW5kKHBNYWMtPnJvYW0ubmVpZ2hib3JSb2FtSW5mby5jdXJyQVBvcGVyYXRpb25DaGFubmVsKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZihudW1PZkNoYW5uZWxzID4gV05JX0NGR19WQUxJRF9DSEFOTkVMX0xJU1RfTEVOKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiUmVjZWl2ZWQgd3JvbmcgbnVtYmVyIG9mIENoYW5uZWwgbGlzdCIpKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLyogUmVtb3ZlIHRoZSBERlMgY2hhbm5lbHMgZnJvbSBDRkcgY2hhbm5lbCBsaXN0IHdoZW4gJworICAgICAgICAgICAgICAgICAgICAgICAgZ0FsbG93Um9hbVRvREZTIGlzIGRpc2FibGVkICovCisgICAgICAgICAgICBpZiAoIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uYWxsb3dERlNDaGFubmVsUm9hbSA9PSBGQUxTRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBmb3IgKGk9MDsgaTxudW1PZkNoYW5uZWxzOyBpKyspCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAoICEoQ1NSX0lTX0NIQU5ORUxfREZTKGNoYW5uZWxMaXN0W2ldKSkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICBzY2FuQ2hhbm5lbExpc3Rbb3V0cHV0TnVtT2ZDaGFubmVscysrXSA9IGNoYW5uZWxMaXN0W2ldOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeyAgIC8qIE1vdmUgYWxsIHRoZSBjaGFubmVscyB0byByb2FtIHNjYW4gY2hhbm5lbCBsaXN0ICovCisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHNjYW5DaGFubmVsTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbExpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgIG51bU9mQ2hhbm5lbHMgKiBzaXplb2YodEFOSV9VOCkpOworICAgICAgICAgICAgICAgIG91dHB1dE51bU9mQ2hhbm5lbHMgPSBudW1PZkNoYW5uZWxzOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAob3V0cHV0TnVtT2ZDaGFubmVscyA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiTm8gY2hhbm5lbHMgdG8gc2NhbiIpKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjdXJyQ2hhbm5lbExpc3RJbmZvLT5DaGFubmVsTGlzdCA9CisgICAgICAgICAgICAgICAgdm9zX21lbV9tYWxsb2Mob3V0cHV0TnVtT2ZDaGFubmVscypzaXplb2YodEFOSV9VOCkpOworICAgICAgICAgICAgaWYgKE5VTEwgPT0gY3VyckNoYW5uZWxMaXN0SW5mby0+Q2hhbm5lbExpc3QpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJNZW1vcnkgYWxsb2NhdGlvbiBmb3IgQ2hhbm5lbCBsaXN0IGZhaWxlZCIpKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX1JFU09VUkNFUzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGN1cnJDaGFubmVsTGlzdEluZm8tPm51bU9mQ2hhbm5lbHMgPSBvdXRwdXROdW1PZkNoYW5uZWxzOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KGN1cnJDaGFubmVsTGlzdEluZm8tPkNoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgc2NhbkNoYW5uZWxMaXN0LCBvdXRwdXROdW1PZkNoYW5uZWxzICogc2l6ZW9mKHRBTklfVTgpKTsKKyAgICAgICAgfSAKKworCisjaWZkZWYgRkVBVFVSRV9XTEFOX0xGUgorICAgICAgICBlbHNlIGlmICgocE5laWdoYm9yUm9hbUluZm8tPnVTY2FuTW9kZSA9PSBERUZBVUxUX1NDQU4pICYmCisgICAgICAgICAgICAgICAgIChhYnMocE5laWdoYm9yUm9hbUluZm8tPmxvb2t1cERPV05Sc3NpKSA+CisgICAgICAgICAgICAgICAgICBhYnMocE5laWdoYm9yUm9hbUluZm8tPmNmZ1BhcmFtcy5uZWlnaGJvclJlYXNzb2NUaHJlc2hvbGQpKSkKKyAgICAgICAgeworICAgICAgICAgICAgLyogCisgICAgICAgICAgICAgKiBUcmlnZ2VyIGEgY29udGlndW91cyBzY2FuIG9uIGFsbCBjaGFubmVscyB3aGVuIHRoZQorICAgICAgICAgICAgICogUlNTSSBpbiB0aGUgbG9va3VwIERPV04gbm90aWZpY2F0aW9uIGlzIGJlbG93IHJlYXNzb2MgCisgICAgICAgICAgICAgKiB0aHJlc2hvbGQuIFRoaXMgd2lsbCBoZWxwIHVzIGZpbmQgdGhlIGJlc3QgYXZhaWxhYmxlIAorICAgICAgICAgICAgICogY2FuZGlkYXRlIGFuZCBhbHNvIHVwZGF0ZSB0aGUgY2hhbm5lbCBjYWNoZS4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgTkVJR0hCT1JfUk9BTV9ERUJVRyhwTWFjLCBMT0dXLCAiVHJpZ2dlcmluZyBjb250aWd1b3VzIHNjYW4gIgorICAgICAgICAgICAgICAgICIobG9va3VwRE9XTlJzc2k9JWQscmVhc3NvY1RocmVzaG9sZD0lZCkiLAorICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5sb29rdXBET1dOUnNzaSwKKyAgICAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+Y2ZnUGFyYW1zLm5laWdoYm9yUmVhc3NvY1RocmVzaG9sZCooLTEpKTsKKworICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPnNjYW5SZXF1ZXN0VGltZVN0YW1wID0gKHRBTklfVElNRVNUQU1QKXBhbEdldFRpY2tDb3VudChwTWFjLT5oSGRkKTsKKworICAgICAgICAgICAgdm9zX3RpbWVyX3N0b3AoJnBOZWlnaGJvclJvYW1JbmZvLT5uZWlnaGJvclNjYW5UaW1lcik7CisKKyAgICAgICAgICAgIC8qIFdlIGFyZSBhYm91dCB0byBzdGFydCBhIGZyZXNoIHNjYW4gY3ljbGUsIAorICAgICAgICAgICAgICogcHVyZ2Ugbm9uLVAyUCByZXN1bHRzIGZyb20gdGhlIHBhc3QgKi8KKyAgICAgICAgICAgIGNzclNjYW5GbHVzaFNlbGVjdGl2ZVJlc3VsdChwTWFjLCBWT1NfRkFMU0UpOworCisgICAgICAgICAgICBjc3JOZWlnaGJvclJvYW1QZXJmb3JtQ29udGlndW91c0JnU2NhbihwTWFjLCBzZXNzaW9uSWQpOworCisgICAgICAgICAgICAvKiBUcmFuc2l0aW9uIHRvIENGR19DSEFOX0xJU1RfU0NBTiAqLworICAgICAgICAgICAgQ1NSX05FSUdIQk9SX1JPQU1fU1RBVEVfVFJBTlNJVElPTihlQ1NSX05FSUdIQk9SX1JPQU1fU1RBVEVfQ0ZHX0NIQU5fTElTVF9TQ0FOKTsKKworICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgfQorI2VuZGlmCisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgbnVtT2ZDaGFubmVscyA9IHBNYWMtPnNjYW4ub2NjdXBpZWRDaGFubmVscy5udW1DaGFubmVsczsKKyAgICAgICAgICAgIGlmIChudW1PZkNoYW5uZWxzID4gV05JX0NGR19WQUxJRF9DSEFOTkVMX0xJU1RfTEVOKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG51bU9mQ2hhbm5lbHMgPSBXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobnVtT2ZDaGFubmVscworI2lmZGVmIEZFQVRVUkVfV0xBTl9MRlIKKyAgICAgICAgICAgICAgICAmJiAoKHBOZWlnaGJvclJvYW1JbmZvLT51U2Nhbk1vZGUgPT0gU1BMSVRfU0NBTl9PQ0NVUElFRF9MSVNUKSB8fAorICAgICAgICAgICAgICAgICAgICAocE5laWdoYm9yUm9hbUluZm8tPnVFbXB0eVNjYW5Db3VudCA9PSAwKSB8fAorICAgICAgICAgICAgICAgICAgICAoKHBOZWlnaGJvclJvYW1JbmZvLT51RW1wdHlTY2FuQ291bnQgJSAyKSA9PSAxKSkKKyNlbmRpZgorICAgICAgICAgICAgICAgICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAqIEFsd2F5cyBzY2FuIGNoYW5uZWxzIGluIHRoZSBvY2N1cGllZCBjaGFubmVsIGxpc3QKKyAgICAgICAgICAgICAgICAgKiBiZWZvcmUgc2Nhbm5pbmcgb24gdGhlIG5vbi1vY2N1cGllZCBsaXN0LgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIE5FSUdIQk9SX1JPQU1fREVCVUcocE1hYywgTE9HMiwgIlN3aXRjaGluZyB0byBvY2N1cGllZCBjaGFubmVsIGxpc3QiCisjaWZkZWYgRkVBVFVSRV9XTEFOX0xGUgorICAgICAgICAgICAgICAgICAgICAiLXVTY2FuTW9kZT0lZCwgdUVtcHR5U2NhbkNvdW50PSVkIiwKKyAgICAgICAgICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPnVTY2FuTW9kZSwKKyAgICAgICAgICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPnVFbXB0eVNjYW5Db3VudAorI2VuZGlmCisgICAgICAgICAgICAgICAgICk7CisgICAgICAgICAgICAgICAgaWYgKENTUl9JU19ST0FNX0lOVFJBX0JBTkRfRU5BQkxFRChwTWFjKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGNzck5laWdoYm9yUm9hbUNoYW5uZWxzRmlsdGVyQnlCYW5kKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnNjYW4ub2NjdXBpZWRDaGFubmVscy5jaGFubmVsTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bU9mQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZudW1PZkNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR2V0UkZCYW5kKHBNYWMtPnJvYW0ubmVpZ2hib3JSb2FtSW5mby5jdXJyQVBvcGVyYXRpb25DaGFubmVsKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShjaGFubmVsTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLm9jY3VwaWVkQ2hhbm5lbHMuY2hhbm5lbExpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtT2ZDaGFubmVscyAqIHNpemVvZih0QU5JX1U4KSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8qIFJlbW92ZSB0aGUgREZTIGNoYW5uZWxzIGZyb20gQ0ZHIGNoYW5uZWwgbGlzdCB3aGVuICcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdBbGxvd1JvYW1Ub0RGUyBpcyBkaXNhYmxlZCAqLworICAgICAgICAgICAgICAgIGlmICggcE1hYy0+cm9hbS5jb25maWdQYXJhbS5hbGxvd0RGU0NoYW5uZWxSb2FtID09IEZBTFNFKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBmb3IgKGk9MDsgaTxudW1PZkNoYW5uZWxzOyBpKyspCisgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICBpZiAoICEoQ1NSX0lTX0NIQU5ORUxfREZTKGNoYW5uZWxMaXN0W2ldKSkpCisgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FuQ2hhbm5lbExpc3Rbb3V0cHV0TnVtT2ZDaGFubmVscysrXSA9IGNoYW5uZWxMaXN0W2ldOworICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoc2NhbkNoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bU9mQ2hhbm5lbHMgKiBzaXplb2YodEFOSV9VOCkpOworICAgICAgICAgICAgICAgICAgICBvdXRwdXROdW1PZkNoYW5uZWxzID0gbnVtT2ZDaGFubmVsczsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAob3V0cHV0TnVtT2ZDaGFubmVscyA9PSAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJObyBjaGFubmVscyB0byBzY2FuIikpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGN1cnJDaGFubmVsTGlzdEluZm8tPkNoYW5uZWxMaXN0ID0gdm9zX21lbV9tYWxsb2Mob3V0cHV0TnVtT2ZDaGFubmVscyAqIHNpemVvZih0QU5JX1U4KSk7CisgICAgICAgICAgICAgICAgaWYgKE5VTEwgPT0gY3VyckNoYW5uZWxMaXN0SW5mby0+Q2hhbm5lbExpc3QpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIk1lbW9yeSBhbGxvY2F0aW9uIGZvciBDaGFubmVsIGxpc3QgZmFpbGVkIikpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX1JFU09VUkNFUzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY3VyckNoYW5uZWxMaXN0SW5mby0+bnVtT2ZDaGFubmVscyA9IG91dHB1dE51bU9mQ2hhbm5lbHM7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KGN1cnJDaGFubmVsTGlzdEluZm8tPkNoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgc2NhbkNoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgb3V0cHV0TnVtT2ZDaGFubmVscyAqIHNpemVvZih0QU5JX1U4KSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogU2NhbiBhbGwgY2hhbm5lbHMgZnJvbSBub24tb2NjdXBpZWQgbGlzdCAqLworICAgICAgICAgICAgICAgIE5FSUdIQk9SX1JPQU1fREVCVUcocE1hYywgTE9HMiwgIkdldCB2YWxpZCBjaGFubmVsIGxpc3QiKTsKKyAgICAgICAgICAgICAgICBudW1PZkNoYW5uZWxzID0gc2l6ZW9mKHBNYWMtPnJvYW0udmFsaWRDaGFubmVsTGlzdCk7CisKKyAgICAgICAgICAgICAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1MoY3NyR2V0Q2ZnVmFsaWRDaGFubmVscyhwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKXBNYWMtPnJvYW0udmFsaWRDaGFubmVsTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTMyICopICZudW1PZkNoYW5uZWxzKSkpCisgICAgICAgICAgICB7CisjaWZkZWYgRkVBVFVSRV9XTEFOX0xGUgorICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICogUHJlcGFyZSBub24tb2NjdXBpZWQgY2hhbm5lbCBsaXN0IChjaGFubmVsTGlzdCkKKyAgICAgICAgICAgICAgICAgKiBmcm9tIHRoZSBhY3R1YWwgInZhbGlkIGNoYW5uZWwgbGlzdCIgaW5mb3JtYXRpb24KKyAgICAgICAgICAgICAgICAgKiBmb3JtZWQgYnkgQ1NSLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIE5FSUdIQk9SX1JPQU1fREVCVUcocE1hYywgTE9HMSwgIlN3aXRjaGluZyB0byBub24tb2NjdXBpZWQgY2hhbm5lbCBsaXN0Iik7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyTmVpZ2hib3JSb2FtUHJlcGFyZU5vbk9jY3VwaWVkQ2hhbm5lbExpc3QocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKXBNYWMtPnJvYW0udmFsaWRDaGFubmVsTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1PZkNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICZudW1PZkNoYW5uZWxzKTsKKyNlbHNlCisgICAgICAgICAgICAgICAgTkVJR0hCT1JfUk9BTV9ERUJVRyhwTWFjLCBMT0cyLCAiTWVyZ2luZyBjaGFubmVsIGxpc3QiKTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JOZWlnaGJvclJvYW1NZXJnZUNoYW5uZWxMaXN0cyggCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCAqKXBNYWMtPnJvYW0udmFsaWRDaGFubmVsTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1PZkNoYW5uZWxzLCAgIC8vIFRoZSBudW1iZXIgb2YgY2hhbm5lbHMgaW4gdGhlIHZhbGlkQ2hhbm5lbExpc3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCAvL05COiBJZiAwLCBzaW1wbHkgY29weSB0aGUgaW5wdXQgY2hhbm5lbCBsaXN0IHRvIHRoZSBvdXRwdXQgbGlzdC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbnVtT2ZDaGFubmVscyApOyAvLyBUaGUgZmluYWwgbnVtYmVyIG9mIGNoYW5uZWxzIGluIHRoZSBvdXRwdXQgbGlzdC4gV2lsbCBiZSBudW1PZkNoYW5uZWxzCisjZW5kaWYKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIkNvdWxkIG5vdCBnZXQgdmFsaWQgY2hhbm5lbCBsaXN0IikpOworICAgICAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKENTUl9JU19ST0FNX0lOVFJBX0JBTkRfRU5BQkxFRChwTWFjKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY3NyTmVpZ2hib3JSb2FtQ2hhbm5lbHNGaWx0ZXJCeUJhbmQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopcE1hYy0+cm9hbS52YWxpZENoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1PZkNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZudW1PZkNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR2V0UkZCYW5kKHBNYWMtPnJvYW0ubmVpZ2hib3JSb2FtSW5mby5jdXJyQVBvcGVyYXRpb25DaGFubmVsKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChudW1PZkNoYW5uZWxzID4gV05JX0NGR19WQUxJRF9DSEFOTkVMX0xJU1RfTEVOKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG51bU9mQ2hhbm5lbHMgPSBXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChudW1PZkNoYW5uZWxzID09IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJObyBjaGFubmVscyB0byBzY2FuIikpOworICAgICAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGN1cnJDaGFubmVsTGlzdEluZm8tPkNoYW5uZWxMaXN0ID0KKyAgICAgICAgICAgICAgICB2b3NfbWVtX21hbGxvYyhudW1PZkNoYW5uZWxzKnNpemVvZih0QU5JX1U4KSk7CisKKyAgICAgICAgICAgIGlmIChOVUxMID09IGN1cnJDaGFubmVsTGlzdEluZm8tPkNoYW5uZWxMaXN0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiTWVtb3J5IGFsbG9jYXRpb24gZm9yIENoYW5uZWwgbGlzdCBmYWlsZWQiKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9SRVNPVVJDRVM7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjdXJyQ2hhbm5lbExpc3RJbmZvLT5udW1PZkNoYW5uZWxzID0gbnVtT2ZDaGFubmVsczsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fTEZSCisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoY3VyckNoYW5uZWxMaXN0SW5mby0+Q2hhbm5lbExpc3QsCisgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxMaXN0LCBudW1PZkNoYW5uZWxzICogc2l6ZW9mKHRBTklfVTgpKTsKKyNlbHNlCisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoY3VyckNoYW5uZWxMaXN0SW5mby0+Q2hhbm5lbExpc3QsCisgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopcE1hYy0+cm9hbS52YWxpZENoYW5uZWxMaXN0LAorICAgICAgICAgICAgICAgICAgICBudW1PZkNoYW5uZWxzICogc2l6ZW9mKHRBTklfVTgpKTsKKyNlbmRpZgorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgTkVJR0hCT1JfUk9BTV9ERUJVRyhwTWFjLCBMT0dXLCAKKyAgICAgICAgICAgICJOdW1iZXIgb2YgY2hhbm5lbHMgZnJvbSBDRkcgKG9yKSAobm9uLSlvY2N1cGllZCBsaXN0PSVkIiwKKyAgICAgICAgICAgIGN1cnJDaGFubmVsTGlzdEluZm8tPm51bU9mQ2hhbm5lbHMpOworICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY3VyckNoYW5uZWxMaXN0SW5mby0+bnVtT2ZDaGFubmVsczsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICBORUlHSEJPUl9ST0FNX0RFQlVHKHBNYWMsIExPR1csICJDaGFubmVsIExpc3QgZnJvbSBDRkcgKG9yKSAobm9uLSlvY2N1cGllZCBsaXN0IgorICAgICAgICAgICAgICAgICAgICAiPSAlZCIsIGN1cnJDaGFubmVsTGlzdEluZm8tPkNoYW5uZWxMaXN0W2ldKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qIFdlIGFyZSBnb25uYSBzY2FuIG5vdy4gUmVtZW1iZXIgdGhlIHRpbWUgc3RhbXAgdG8gZmlsdGVyIG91dCByZXN1bHRzIG9ubHkgYWZ0ZXIgdGhpcyB0aW1lc3RhbXAgKi8KKyAgICBwTmVpZ2hib3JSb2FtSW5mby0+c2NhblJlcXVlc3RUaW1lU3RhbXAgPSAodEFOSV9USU1FU1RBTVApcGFsR2V0VGlja0NvdW50KHBNYWMtPmhIZGQpOworICAgIAorICAg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AgICAgICAgICBORUlHSEJPUl9ST0FNX0RFQlVHKHBNYWMsIExPRzIsIEZMKCJEZXJlZ2lzdGVyaW5nIERPV04gZXZlbnQgbmVpZ2hib3IgbG9va3VwIGNhbGxiYWNrIHdpdGggVEwuIFJTU0kgPSAlZCwiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5jdXJyZW50TmVpZ2hib3JMb29rdXBUaHJlc2hvbGQgKiAoLTEpKTsKKyAgICAgICAgICAgIC8qIERlLXJlZ2lzdGVyIE5laWdoYm9yIExvb2t1cCB0aHJlc2hvbGQgY2FsbGJhY2sgd2l0aCBUTCAqLworICAgICAgICAgICAgdm9zU3RhdHVzID0gV0xBTlRMX0RlcmVnUlNTSUluZGljYXRpb25DQihwTWFjLT5yb2FtLmdWb3NDb250ZXh0LCAodl9TN190KXBOZWlnaGJvclJvYW1JbmZvLT5jdXJyZW50TmVpZ2hib3JMb29rdXBUaHJlc2hvbGQgKiAoLTEpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfSE9fVEhSRVNIT0xEX0RPV04sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JOZWlnaGJvclJvYW1OZWlnaGJvckxvb2t1cERPV05DYWxsYmFjaywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19NT0RVTEVfSURfU01FKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLy9lcnIgbXNnCisgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywgRkwoIiBDb3VsZG4ndCBEZXJlZ2lzdGVyIGNzck5laWdoYm9yUm9hbU5laWdoYm9yTG9va3VwQ2FsbGJhY2sgRE9XTiBldmVudCBmcm9tIFRMOiBTdGF0dXMgPSAlZCIpLCB2b3NTdGF0dXMpOworICAgICAgICAgICAgfQorI2lmZGVmIEZFQVRVUkVfV0xBTl9MRlIKKyAgICAgICAgICAgIGlmICghY3NyUm9hbUlzRmFzdFJvYW1FbmFibGVkKHBNYWMscE1hYy0+cm9hbS5uZWlnaGJvclJvYW1JbmZvLmNzclNlc3Npb25JZCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJSZWNlaXZlZCB3aGVuIGZhc3Qgcm9hbSBpcyBkaXNhYmxlZC4gSWdub3JlIGl0IikpOworICAgICAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgfQorI2VuZGlmCisgICAgICAgICAgIAorI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIgJiYgZGVmaW5lZCBXTEFOX0ZFQVRVUkVfVk9XSUZJCisgICAgICAgICAgICBpZiAoKHBOZWlnaGJvclJvYW1JbmZvLT5pczExckFzc29jKSAmJiAocE1hYy0+cnJtLnJybVNtZUNvbnRleHQucnJtQ29uZmlnLnJybUVuYWJsZWQpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgTkVJR0hCT1JfUk9BTV9ERUJVRyhwTWFjLCBMT0dFLCBGTCgiMTFSIEFzc29jaWF0aW9uOk5laWdoYm9yIExvb2t1cCBEb3duIGV2ZW50IHJlY2VpdmVkIGluIENPTk5FQ1RFRCBzdGF0ZSIpKTsKKyAgICAgICAgICAgICAgICB2b3NTdGF0dXMgPSBjc3JOZWlnaGJvclJvYW1Jc3N1ZU5laWdoYm9yUnB0UmVxdWVzdChwTWFjKTsKKyAgICAgICAgICAgICAgICBpZiAoVk9TX1NUQVRVU19TVUNDRVNTICE9IHZvc1N0YXR1cykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiTmVpZ2hib3IgcmVwb3J0IHJlcXVlc3QgZmFpbGVkLiBzdGF0dXMgPSAlZCIpLCB2b3NTdGF0dXMpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdm9zU3RhdHVzOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvKiBJbmNyZW1lbnQgdGhlIG5laWdoYm9yIHJlcG9ydCByZXRyeSBjb3VudCBhZnRlciBzZW5kaW5nIHRoZSBuZWlnaGJvciByZXF1ZXN0IHN1Y2Nlc3NmdWxseSAqLworICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5GVFJvYW1JbmZvLmN1cnJlbnROZWlnaGJvclJwdFJldHJ5TnVtKys7CisgICAgICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPkZUUm9hbUluZm8ubmVpZ2hib3JScHRQZW5kaW5nID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICAgICAgQ1NSX05FSUdIQk9SX1JPQU1fU1RBVEVfVFJBTlNJVElPTihlQ1NSX05FSUdIQk9SX1JPQU1fU1RBVEVfUkVQT1JUX1FVRVJZKQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorI2VuZGlmICAgICAgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgTkVJR0hCT1JfUk9BTV9ERUJVRyhwTWFjLCBMT0cyLCBGTCgiTm9uIDExUiBvciBFU0UgQXNzb2NpYXRpb246TmVpZ2hib3IgTG9va3VwIERvd24gZXZlbnQgcmVjZWl2ZWQgaW4gQ09OTkVDVEVEIHN0YXRlIikpOworCisgICAgICAgICAgICAgICAgdm9zU3RhdHVzID0gY3NyTmVpZ2hib3JSb2FtVHJhbnNpdFRvQ0ZHQ2hhblNjYW4ocE1hYyk7CisgICAgICAgICAgICAgICAgaWYgKFZPU19TVEFUVVNfU1VDQ0VTUyAhPSB2b3NTdGF0dXMpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBORUlHSEJPUl9ST0FNX0RFQlVHKHBNYWMsIExPR0UsIEZMKCJjc3JOZWlnaGJvclJvYW1UcmFuc2l0VG9DRkdDaGFuU2NhbiBmYWlsZWQiCisgICAgICAgICAgICAgICAgICAgICAgICAiIHdpdGggc3RhdHVzPSVkIiksIHZvc1N0YXR1cyk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB2b3NTdGF0dXM7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgTkVJR0hCT1JfUk9BTV9ERUJVRyhwTWFjLCBMT0cyLCBGTCgiUmVnaXN0ZXJpbmcgVVAgZXZlbnQgbmVpZ2hib3IgbG9va3VwIGNhbGxiYWNrIHdpdGggVEwuIFJTU0kgPSAlZCwiKSwgTkVJR0hCT1JfUk9BTV9MT09LVVBfVVBfVEhSRVNIT0xEICogKC0xKSk7CisgICAgICAgICAgICAvKiBSZWdpc3RlciBOZWlnaGJvciBMb29rdXAgdGhyZXNob2xkIGNhbGxiYWNrIHdpdGggVEwgZm9yIFVQIGV2ZW50IG5vdyAqLworICAgICAgICAgICAgdm9zU3RhdHVzID0gV0xBTlRMX1JlZ1JTU0lJbmRpY2F0aW9uQ0IocE1hYy0+cm9hbS5nVm9zQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZfUzdfdClORUlHSEJPUl9ST0FNX0xPT0tVUF9VUF9USFJFU0hPTEQgKiAoLTEpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfSE9fVEhSRVNIT0xEX1VQLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyTmVpZ2hib3JSb2FtTmVpZ2hib3JMb29rdXBVUENhbGxiYWNrLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX01PRFVMRV9JRF9TTUUsIHBNYWMpOworICAgICAgICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLy9lcnIgbXNnCisgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiBDb3VsZG4ndCByZWdpc3RlciBjc3JOZWlnaGJvclJvYW1OZWlnaGJvckxvb2t1cENhbGxiYWNrIFVQIGV2ZW50IHdpdGggVEw6IFN0YXR1cyA9ICVkIiksIHN0YXR1cyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiRE9XTiBldmVudCByZWNlaXZlZCBpbiBpbnZhbGlkIgorICAgICAgICAgICAgICAgICAgICJzdGF0ZSAlcyAuLklnbm9yaW5nLi4uIiksCisgICAgICAgICAgICAgICAgICAgbWFjVHJhY2VHZXROZWlnaGJvdXJSb2FtU3RhdGUoCisgICAgICAgICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPm5laWdoYm9yUm9hbVN0YXRlKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIAorICAgIH0KKyAgICByZXR1cm4gdm9zU3RhdHVzOworfQorCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAgIFxmbiBjc3JOZWlnaGJvclJvYW1OZWlnaGJvckxvb2t1cFVQQ2FsbGJhY2sKKworICAgIFxicmllZiAgVGhpcyBmdW5jdGlvbiBpcyByZWdpc3RlcmVkIHdpdGggVEwgdG8gaW5kaWNhdGUgd2hlbmV2ZXIgdGhlIFJTU0kgCisgICAgICAgICAgICBnZXRzIGJldHRlciB0aGFuIHRoZSBuZWlnaGJvckxvb2t1cCBSU1NJIFRocmVzaG9sZAorCisgICAgXHBhcmFtICBwQWRhcHRlciAtIFZPUyBDb250ZXh0CisgICAgICAgICAgICB0cmFmZmljU3RhdHVzIC0gVVAvRE9XTiBpbmRpY2F0aW9uIGZyb20gVEwKKyAgICAgICAgICAgIHBVc2VyQ3R4dCAtIFBhcmFtZXRlciBmb3IgY2FsbGJhY2sgcmVnaXN0ZXJlZCBkdXJpbmcgY2FsbGJhY2sgcmVnaXN0cmF0aW9uLiBTaG91bGQgYmUgcE1hYworCisgICAgXHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1Mgb24gc3VjY2VzcywgY29ycmVzcG9uZGluZyBlcnJvciBjb2RlIG90aGVyd2lzZQorCistLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworVk9TX1NUQVRVUyBjc3JOZWlnaGJvclJvYW1OZWlnaGJvckxvb2t1cFVQQ2FsbGJhY2sgKHZfUFZPSURfdCBwQWRhcHRlciwgdl9VOF90IHJzc2lOb3RpZmljYXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9QVk9JRF90IHBVc2VyQ3R4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1M3X3QgYXZnUnNzaSkKK3sKKyAgICB0cEFuaVNpckdsb2JhbCBwTWFjID0gUE1BQ19TVFJVQ1QoIHBVc2VyQ3R4dCApOworICAgIHRwQ3NyTmVpZ2hib3JSb2FtQ29udHJvbEluZm8gICAgcE5laWdoYm9yUm9hbUluZm8gPSAmcE1hYy0+cm9hbS5uZWlnaGJvclJvYW1JbmZvOworICAgIFZPU19TVEFU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B0aGUgUlNTSSAKKyAgICAgICAgICAgIGZhbGxzIGJlbG93IHRoZSBjdXJyZW50IG5laWdoYm9yTG9va3VwIFJTU0kgVGhyZXNob2xkCisKKyAgICBccGFyYW0gIHBBZGFwdGVyIC0gVk9TIENvbnRleHQKKyAgICAgICAgICAgIHRyYWZmaWNTdGF0dXMgLSBVUC9ET1dOIGluZGljYXRpb24gZnJvbSBUTAorICAgICAgICAgICAgcFVzZXJDdHh0IC0gUGFyYW1ldGVyIGZvciBjYWxsYmFjayByZWdpc3RlcmVkIGR1cmluZyBjYWxsYmFjayByZWdpc3RyYXRpb24uIFNob3VsZCBiZSBwTWFjCisKKyAgICBccmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUyBvbiBzdWNjZXNzLCBjb3JyZXNwb25kaW5nIGVycm9yIGNvZGUgb3RoZXJ3aXNlCisKKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCitWT1NfU1RBVFVTIGNzck5laWdoYm9yUm9hbU5laWdoYm9yTG9va3VwRE9XTkNhbGxiYWNrICh2X1BWT0lEX3QgcEFkYXB0ZXIsIHZfVThfdCByc3NpTm90aWZpY2F0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfUFZPSURfdCBwVXNlckN0eHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9TN190IGF2Z1Jzc2kpCit7CisgICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9IFBNQUNfU1RSVUNUKCBwVXNlckN0eHQgKTsKKyAgICB0cENzck5laWdoYm9yUm9hbUNvbnRyb2xJbmZvICAgIHBOZWlnaGJvclJvYW1JbmZvID0gJnBNYWM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CZwTmVpZ2hib3JSb2FtSW5mby0+bmVpZ2hib3JTY2FuVGltZXIpOworICAgICAgICAgICAgdm9zX3RpbWVyX3N0b3AoJnBOZWlnaGJvclJvYW1JbmZvLT5uZWlnaGJvclJlc3VsdHNSZWZyZXNoVGltZXIpOworICAgICAgICAgICAgdm9zX3RpbWVyX3N0b3AoJnBOZWlnaGJvclJvYW1JbmZvLT5lbXB0eVNjYW5SZWZyZXNoVGltZXIpOworICAgICAgICAgICAgaWYgKCFDU1JfSVNfUk9BTV9TVUJTVEFURV9ESVNBU1NPQ19ITyggcE1hYywgc2Vzc2lvbklkICkpIHsKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAqIERpc2Nvbm5lY3QgaW5kaWNhdGlvbiBkdXJpbmcgRGlzYXNzb2MgSGFuZG9mZiBzdWItc3RhdGUKKyAgICAgICAgICAgICAgICAgKiBpcyByZWNlaXZlZCB3aGVuIHdlIGFyZSB0cnlpbmcgdG8gZGlzY29ubmVjdCB3aXRoIHRoZSBvbGQKKyAgICAgICAgICAgICAgICAgKiBBUCBkdXJpbmcgcm9hbS4gQlVULCBpZiByZWNlaXZlIGEgZGlzY29ubmVjdCBpbmRpY2F0aW9uIAorICAgICAgICAgICAgICAgICAqIG91dHNpZGUgb2YgRGlzYXNzb2MgSGFuZG9mZiBzdWItc3RhdGUsIHRoZW4gaXQgbWVhbnMgdGhhdCAKKyAgICAgICAgICAgICAgICAgKiB0aGlzIGlzIGEgZ2VudWluZSBkaXNjb25uZWN0IGFuZCB3ZSBuZWVkIHRvIGNsZWFuIHVwLgorICAgICAgICAgICAgICAgICAqIE90aGVyd2lzZSwgd2Ugd2lsbCBiZSBzdHVjayBpbiByZWFzc29jIHN0YXRlIHdoaWNoIHdpbGwKKyAgICAgICAgICAgICAgICAgKiBpbi10dXJuIGJsb2NrIHNjYW5zIChzZWUgY3NySXNTY2FuQWxsb3dlZCkuCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgQ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xPQUQKKyAgICAgICAgICAgIH0KKyNlbmRpZgorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIE5FSUdIQk9SX1JPQU1fREVCVUcocE1hYywgTE9HVywgRkwoIlJlY2VpdmVkIGRpc2Nvbm5lY3QgZXZlbnQiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpbiBzdGF0ZSAlcyIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWNUcmFjZUdldE5laWdoYm91clJvYW1TdGF0ZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPm5laWdoYm9yUm9hbVN0YXRlKSk7CisgICAgICAgICAgICBORUlHSEJPUl9ST0FNX0RFQlVHKHBNYWMsIExPR1csIEZMKCJUcmFuc2l0aW9uaW5nIHRvIElOSVQgc3RhdGUiKSk7CisgICAgICAgICAgICBDU1JfTkVJR0hCT1JfUk9BTV9TVEFURV9UUkFOU0lUSU9OKGVDU1JfTkVJR0hCT1JfUk9BTV9TVEFURV9JTklUKQorICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPnJvYW1DaGFubmVsSW5mby5JQVBQTmVpZ2hib3JMaXN0UmVjZWl2ZWQgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgICAgICBicmVhazsKKyAgICB9CisjaWZkZWYgV0xBTl9GRUFUVVJFX1JPQU1fU0NBTl9PRkZMT0FECisgICAgLypJbmZvcm0gdGhlIEZpcm13YXJlIHRvIFNUT1AgU2Nhbm5pbmcgYXMgdGhlIGhvc3QgaGFzIGEgZGlzY29ubmVjdC4qLworICAgIGlmIChjc3JSb2FtSXNTdGFNb2RlKHBNYWMsIHNlc3Npb25JZCkpCisgICAgeworICAgICAgIGNzclJvYW1PZmZsb2FkU2NhbihwTWFjLCBST0FNX1NDQU5fT0ZGTE9BRF9TVE9QLCBSRUFTT05fRElTQ09OTkVD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jb25uZWN0ZWRQcm9maWxlLkF1dGhUeXBlLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLmNvbm5lY3RlZFByb2ZpbGUuTURJRC5tZGllUHJlc2VudCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uaXNGYXN0VHJhbnNpdGlvbkVuYWJsZWQpCisgICAgICAgICAgICAgICAgICAgIGluaXRfZnRfZmxhZyA9IFRSVUU7CisgICAgICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPmlzMTFyQXNzb2MgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+aXMxMXJBc3NvYyA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgIE5FSUdIQk9SX1JPQU1fREVCVUcocE1hYywgTE9HMiwgRkwoIjExckFzc29jIGlzID0gJWQiKSwgcE5laWdoYm9yUm9hbUluZm8tPmlzMTFyQXNzb2MpOworI2VuZGlmCisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICAgICAgICAgICAvLyBCYXNlZCBvbiB0aGUgYXV0aCBzY2hlbWUgdGVsbCBpZiB3ZSBhcmUgMTFyCisgICAgICAgICAgICBpZiAocE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLmNvbm5lY3RlZFByb2ZpbGUuaXNFU0VBc3NvYykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAocE1hYy0+cm9hbS5jb25maWdQYXJhbS5pc0Zhc3RUcmFuc2l0aW9uRW5hYmxlZCkKKyAgICAgICAgICAgICAgICAgICAgaW5pdF9mdF9mbGFnID0gVFJVRTsKKyAgICAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+aXNFU0VBc3NvYyA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5pc0VTRUFzc29jID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgTkVJR0hCT1JfUk9BTV9ERUJVRyhwTWFjLCBMT0cyLCBGTCgiaXNFU0VBc3NvYyBpcyA9ICVkIGZ0ID0gJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPmlzRVNFQXNzb2MsIGluaXRfZnRfZmxhZyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisjZW5kaWYKKworI2lmZGVmIEZFQVRVUkVfV0xBTl9MRlIKKyAgICAgICAgICAgIC8vIElmICJMZWdhY3kgRmFzdCBSb2FtaW5nIiBpcyBlbmFibGVkIAorICAgICAgICAgICAgaWYgKGNzclJvYW1Jc0Zhc3RSb2FtRW5hYmxlZChwTWFjLCBzZXNzaW9uSWQpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGluaXRfZnRfZmxhZyA9IFRSVUU7CisgICAgICAgICAgICB9CisjZW5kaWYKKworI2lmICBkZWZpbmVkIChXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUikgfHwgZGVmaW5lZCAoRkVBVFVSRV9XTEFOX0VTRSkgfHwgZGVmaW5lZChGRUFUVVJFX1dMQU5fTEZSKQorICAgICAgICAgICAgaWYgKCBpbml0X2Z0X2ZsYWcgPT0gVFJVRSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogSW5pdGlhbGl6ZSBhbGwgdGhlIGRhdGEgc3RydWN0dXJlcyBuZWVkZWQgZm9yIHRoZSAxMXIgRlQgUHJlYXV0aCAqLworICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5GVFJvYW1JbmZvLmN1cnJlbnROZWlnaGJvclJwdFJldHJ5TnVtID0gMDsKKyAgICAgICAgICAgICAgICBjc3JOZWlnaGJvclJvYW1QdXJnZVByZWF1dGhGYWlsZWRMaXN0KHBNYWMpOworI2lmZGVmIFdMQU5fRkVBVFVSRV9ST0FNX1NDQU5fT0ZGTE9BRAorICAgICAgICAgICAgICBpZiAoY3NyUm9hbUlzUm9hbU9mZmxvYWRTY2FuRW5hYmxlZChwTWFjKSkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAvKklmIHRoaXMgaXMgbm90IGEgSU5GUkEgdHlwZSBCU1MsIHRoZW4gZG8gbm90IHNlbmQgdGhlIGNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICogZG93biB0byBmaXJtd2FyZS5EbyBub3Qgc2VuZCB0aGUgU1RBUlQgY29tbWFuZCBmb3Igb3RoZXIgc2Vzc2lvbgorICAgICAgICAgICAgICAgICAgKiBjb25uZWN0aW9ucy4qLworICAgICAgICAgICAgICAgICBpZihjc3JSb2FtSXNTdGFNb2RlKHBNYWMsIHNlc3Npb25JZCkpCisgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT51T3NSZXF1ZXN0ZWRIYW5kb2ZmID0gMDsKKyAgICAgICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5pc0ZvcmNlZEluaXRpYWxSb2FtVG81R0ggPSAwOworICAgICAgICAgICAgICAgICAgICAgaWYocE5laWdoYm9yUm9hbUluZm8tPmNmZ1BhcmFtcy5uZWlnaGJvckluaXRpYWxGb3JjZWRSb2FtVG81R2hFbmFibGUgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgKEdldFJGQmFuZChwTmVpZ2hib3JSb2FtSW5mby0+Y3VyckFQb3BlcmF0aW9uQ2hhbm5lbCkgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9CQU5EXzJfNF9HSFopKQorICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICAgICAgICAgICogS2VlcCA1RyBhbmQgRndyIHJvYW1pbmcgbXV0dWFsbHkgZXhjbHVzaXZlIHNvIGRvIG5vdAorICAgICAgICAgICAgICAgICAgICAgICAgICAqIHNlbmQgUlNPIHN0YXJ0IE5vdGUgd2UgaGF2ZSB0byBzZW5kIFJTTyBzdGFydCBpbiBhbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKiBlcnJybyBjYXNlLgorICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiRG8gbm90IHNlbmQgUlNPIHN0YXJ0IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiYmVjYXVzZSA1RyBmb3JjZSByb2FtaW5nIGlzIGVuYWJsZWQiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICBjc3JSb2FtT2ZmbG9hZFNjYW4ocE1hYywgUk9BTV9TQ0FOX09GRkxPQURfU1RBUlQsIFJFQVNPTl9DT05ORUNUKTsKKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB9IGVsc2UgeworI2VuZGlmCisKKyAgICAgICAgICAgICAgICBORUlHSEJPUl9ST0FNX0RFQlVHKHBNYWMsIExPRzIsIEZMKCJSZWdpc3RlcmluZyBuZWlnaGJvciBsb29rdXAgRE9XTiBldmVudCB3aXRoIFRMLCBSU1NJID0gJWQiKSwgcE5laWdoYm9yUm9hbUluZm8tPmN1cnJlbnROZWlnaGJvckxvb2t1cFRocmVzaG9sZCk7CisgICAgICAgICAgICAgICAgLyogUmVnaXN0ZXIgTmVpZ2hib3IgTG9va3VwIHRocmVzaG9sZCBjYWxsYmFjayB3aXRoIFRMIGZvciBET1dOIGV2ZW50IG9ubHkgKi8KKyAgICAgICAgICAgICAgICB2c3RhdHVzID0gV0xBTlRMX1JlZ1JTU0lJbmRpY2F0aW9uQ0IocE1hYy0+cm9hbS5nVm9zQ29udGV4dCwgKHZfUzdfdClwTmVpZ2hib3JSb2FtSW5mby0+Y3VycmVudE5laWdoYm9yTG9va3VwVGhyZXNob2xkICogKC0xKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX0hPX1RIUkVTSE9MRF9ET1dOLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyTmVpZ2hib3JSb2FtTmVpZ2hib3JMb29rdXBET1dOQ2FsbGJhY2ssIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfTU9EVUxFX0lEX1NNRSwgcE1hYyk7CisjaWZkZWYgRkVBVFVSRV9XTEFOX0xGUgorICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5sb29rdXBET1dOUnNzaSA9IDA7CisjZW5kaWYKKyAgICAgICAgICAgICAgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZzdGF0dXMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAvL2VyciBtc2cKKyAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywgRkwoIiBDb3VsZG4ndCByZWdpc3RlciBjc3JOZWlnaGJvclJvYW1OZWlnaGJvckxvb2t1cERPV05DYWxsYmFjayB3aXRoIFRMOiBTdGF0dXMgPSAlZCIpLCB2c3RhdHVzKTsKKyAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgICAgIH0KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfUk9BTV9TQ0FOX09GRkxPQUQKKyAgICAgICAgIC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WxlICpwUHJvZmlsZSA9IE5VTEw7CisgICAgdENzclJvYW1TZXNzaW9uICpwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTiggcE1hYywgcE5laWdoYm9yUm9hbUluZm8tPmNzclNlc3Npb25JZCApOworICAgIHRBTklfVTggaSA9IDA7CisKKyAgICBpZiAoTlVMTCA9PSBwU2Vzc2lvbikKKyAgICB7CisgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgicFNlc3Npb24gaXMgTlVMTCAiKSk7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIH0KKworICAgIGRvCisgICAgeworICAgICAgICByb2FtSWQgPSBHRVRfTkVYVF9ST0FNX0lEKCZwTWFjLT5yb2FtKTsKKyAgICAgICAgcFByb2ZpbGUgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodENzclJvYW1Qcm9maWxlKSk7CisgICAgICAgIGlmICggTlVMTCA9PSBwUHJvZmlsZSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiTWVtb3J5IGFsbG9jIGZhaWxlZCIpKTsKKyAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICB9CisgICAgICAgIHZvc19tZW1fc2V0KHBQcm9maWxlLCBzaXplb2YodENzclJvYW1Qcm9maWxlKSwgMCk7CisgICAgICAgIHN0YXR1cyA9IGNzclJvYW1Db3B5UHJvZmlsZShwTWFjLCBwUHJvZmlsZSwgcFNlc3Npb24tPnBDdXJSb2FtUHJvZmlsZSk7CisgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJQcm9maWxlIGNvcHkgZmFpbGVkIikpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICAvL0FkZCB0aGUgQlNT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lzdCA9CisgICAgICAgIHZvc19tZW1fbWFsbG9jKHNpemVvZigqcFByb2ZpbGUtPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0KSAqCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwUHJvZmlsZS0+Q2hhbm5lbEluZm8ubnVtT2ZDaGFubmVscyk7CisgICAgICAgIGlmIChOVUxMID09IHBQcm9maWxlLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdCkKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJtZW0gYWxsb2MgZmFpbGVkIGZvciBDaGFubmVsTGlzdCIpKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBwUHJvZmlsZS0+Q2hhbm5lbEluZm8uQ2hhbm5lbExpc3RbMF0gPSBwTmVpZ2hib3JSb2FtSW5mby0+aGFuZG9mZlJlcUluZm8uY2hhbm5lbDsKKworICAgICAgICAvL2NsZWFuIHVwIGNzciBjYWNoZSBmaXJzdAorICAgICAgICAvL2NzclNjYW5GbHVzaFNlbGVjdGl2ZVJlc3VsdChwTWFjLCBWT1NfRkFMU0UpOworICAgICAgICAvL2RvIGEgU1NJRCBzY2FuCisgICAgICAgIHN0YXR1cyA9IGNzclNjYW5Gb3JTU0lEKHBNYWMsIHBOZWlnaGJvclJvYW1JbmZvLT5jc3JTZXNzaW9uSWQsIHBQcm9maWxlLCByb2FtSWQsIEZBTFNFKTsKKyAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIlNTSUQgc2NhbiBmYWlsZWQiKSk7CisgICAgICAgIH0KKyAgICB9d2hpbGUoMCk7CisKKyAgICBpZihOVUxMICE9IHBQcm9maWxlKQorICAgIHsKKyAgICAgICAgY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0dXMgICAgICAgICAgICAgICAgICAgICAgaHN0YXR1czsKKworICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiY2FsbGVkICIpKTsKKworICAgIC8qIHdlIG11c3QgYmUgaW4gY29ubmVjdGVkIHN0YXRlLCBpZiBub3QgaWdub3JlIGl0ICovCisgICAgaWYgKGVDU1JfTkVJR0hCT1JfUk9BTV9TVEFURV9DT05ORUNURUQgIT0gcE5laWdoYm9yUm9hbUluZm8tPm5laWdoYm9yUm9hbVN0YXRlKQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJSZWNlaXZlZCBpbiBub3QgQ09OTkVDVEVEIHN0YXRlLiBJZ25vcmUgaXQiKSk7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIH0KKworICAgIC8vaWYgU1NJRCBzY2FuIGZhaWxlZCB0byBmaW5kIG91ciBjYW5kaWRhdGUgYWRkIGFuIGVudHJ5IHRvIGNzciBzY2FuIGNhY2hlIG91cnNlbGYKKyAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgeworICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIkFkZCBhbiBlbnRyeSB0byBjc3Igc2NhbiBjYWNoZSIpKTsKKyAgICAgICAgaHN0YXR1cyA9IGNzclNjYW5DcmVhdGVFbnRyeUluU2NhbkNhY2hlKHBNYWMsIHBOZWlnaGJvclJvYW1JbmZvLT5jc3JTZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+aGFuZG9mZlJlcUluZm8uYnNzaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+aGFuZG9mZlJlcUluZm8uY2hhbm5lbCk7CisgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDR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hhbmRvZmYgaW5mbyBjYW1lIGZyb20gSEREIGFzIHBhcnQgb2YgdGhlIHJlYXNzb2MgcmVxCisgICAgICAgIHBIYW5kb2ZmUmVxSW5mbyA9ICh0QW5pSGFuZG9mZlJlcSAqKXBNc2c7CisgICAgICAgIGlmIChOVUxMICE9IHBIYW5kb2ZmUmVxSW5mbykKKyAgICAgICAgeworICAgICAgICAgICAgLy9zYW5pdHkgY2hlY2sKKyAgICAgICAgICAgIGlmIChWT1NfRkFMU0UgPT0gdm9zX21lbV9jb21wYXJlKHBIYW5kb2ZmUmVxSW5mby0+YnNzaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+Y3VyckFQYnNzaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKSkKKyAgICAgICAgICAgIHsKKworICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5oYW5kb2ZmUmVxSW5mby5jaGFubmVsID0gcEhhbmRvZmZSZXFJbmZvLT5jaGFubmVsOworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwTmVpZ2hib3JSb2FtSW5mby0+aGFuZG9mZlJlcUluZm8uYnNzaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIYW5kb2ZmUmVxSW5mby0+YnNzaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDYpOworICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT51T3NSZXF1ZXN0ZWRIYW5kb2ZmID0gMTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JSb2FtT2ZmbG9hZFNjYW4ocE1hYywgUk9BTV9TQ0FOX09GRkxPQURfU1RPUCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVBU09OX09TX1JFUVVFU1RFRF9ST0FNSU5HX05PVyk7CisgICAgICAgICAgICAgICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gc3RhdHVzKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJjc3JSb2FtT2ZmbG9hZFNjYW4gZmFpbGVkIikpOworICAgICAgICAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+dU9zUmVxdWVzdGVkSGFuZG9mZiA9IDA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiUmVjZWl2ZWQgcmVxIGhhcyBzYW1lIEJTU0lEIGFzIGN1cnJlbnQgQVAhISIpKTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJSZWNlaXZlZCBtc2cgaXMgTlVMTCIpKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gc3RhdHVzOworfQorCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAgIFxmbiBjc3JOZWlnaGJvclJvYW1Qcm9jZWVkV2l0aEhhbmRvZmZSZXEKKworICAgIFxicmllZiAgVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgYnkgQ1NSIGFzIHNvb24gYXMgaXQgZ2V0cyByc3AgYmFjayBmb3IKKyAgICAgICAgICAgIFJPQU1fU0NBTl9PRkZMT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UeXBlKQoreworICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICB0TGlzdEVsZW0gKnBFbnRyeTsKKyAgICB0U21lQ21kICpwQ29tbWFuZDsKKworICAgIHBFbnRyeSA9IGNzckxMUGVla0hlYWQoJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0LCBMTF9BQ0NFU1NfTE9DSyk7CisgICAgaWYoIHBFbnRyeSApCisgICAgeworICAgICAgICBwQ29tbWFuZCA9IEdFVF9CQVNFX0FERFIocEVudHJ5LCB0U21lQ21kLCBMaW5rKTsKKyAgICAgICAgaWYoIGNtZFR5cGUgPT0gcENvbW1hbmQtPmNvbW1hbmQgKQorICAgICAgICB7CisgICAgICAgICAgICBpZiggY3NyTExSZW1vdmVFbnRyeSggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFbnRyeSwgTExfQUNDRVNTX0xPQ0sgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV96ZXJvKCAmcENvbW1hbmQtPnUudGRsc0NtZCwgc2l6ZW9mKCB0VGRsc0NtZCApICk7CisgICAgICAgICAgICAgICAgY3NyUmVsZWFzZUNvbW1hbmQoIHBNYWMsIHBDb21tYW5kICk7CisgICAgICAgICAgICAgICAgc21lUHJvY2Vzc1BlbmRpbmdRdWV1ZSggcE1hYyApOworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1MgOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIHJldHVybiBzdGF0dXMgOworfQorICAgIAorLyoKKyAqIFRETFMgcmVxdWVzdCBBUEksIGNhbGxlZCBmcm9tIEhERCB0byBzZW5kIGEgVERMUyBmcmFtZSAKKyAqIGluIFNNRS9DU1IgYW5kIHNlbmQgbWVzc2FnZSB0byB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ICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiQWxsb2MgRmFpbGVkIikgKTsKKyAgICAgICAgICAgICAgICAgICAgVk9TX0FTU0VSVCgwKSA7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdGF0dXMgOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkodGRsc1NlbmRNZ210Q21kSW5mby0+YnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgdGRsc1NlbmRNZ210LT5idWYsIHRkbHNTZW5kTWdtdC0+bGVuICk7CisgICAgICAgICAgICAgICAgdGRsc1NlbmRNZ210Q21kSW5mby0+bGVuID0gdGRsc1NlbmRNZ210LT5sZW47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdGRsc1NlbmRNZ210Q21kSW5mby0+YnVmID0gTlVMTDsKKyAgICAgICAgICAgICAgICB0ZGxzU2VuZE1nbXRDbWRJbmZvLT5sZW4gPSAwOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB0ZGxzU2VuZE1nbXRDbWQtPmNvbW1hbmQgPSBlU21lQ29tbWFuZFRkbHNTZW5kTWdtdCA7CisgICAgICAgICAgICB0ZGxzU2VuZE1nbXRDbWQtPnUudGRsc0NtZC5zaXplID0gc2l6ZW9mKHRUZGxzU2VuZE1nbXRDbWRJbmZvKSA7CisgICAgICAgICAgICBzbWVQdXNoQ29tbWFuZChwTWFjLCB0ZGxzU2VuZE1nbXRDbWQsIEZBTFNFKSA7CisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTIDsKKyAgICAgICA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YUNtZEluZm8tPmV4dG5DYXBhYmlsaXR5LAorICAgICAgICAgICAgICAgICAgICAgICAgICBwc3RhUGFyYW1zLT5leHRuX2NhcGFiaWxpdHksCisgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihwc3RhUGFyYW1zLT5leHRuX2NhcGFiaWxpdHkpKTsKKworICAgICAgICAgICAgdGRsc0FkZFN0YUNtZEluZm8tPmh0Y2FwX3ByZXNlbnQgPSBwc3RhUGFyYW1zLT5odGNhcF9wcmVzZW50OworICAgICAgICAgICAgaWYocHN0YVBhcmFtcy0+aHRjYXBfcHJlc2VudCkKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoICZ0ZGxzQWRkU3RhQ21kSW5mby0+SFRDYXAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcHN0YVBhcmFtcy0+SFRDYXAsIHNpemVvZihwc3RhUGFyYW1zLT5IVENhcCkpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHZvc19tZW1fc2V0KCZ0ZGxzQWRkU3RhQ21kSW5mby0+SFRDYXAsIHNpemVvZihwc3RhUGFyYW1zLT5IVENhcCksIDApOworCisgICAgICAgICAgICB0ZGxzQWRkU3RhQ21kSW5mby0+dmh0Y2FwX3ByZXNlbnQgPSBwc3RhUGFyYW1zLT52aHRjYXBfcHJlc2VudDsKKyAgICAgICAgICAgIGlmKHBzdGFQYXJhbXMtPnZodGNhcF9wcmVzZW50KQorICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSggJnRkbHNBZGRTdGFDbWRJbmZvLT5WSFRDYXAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcHN0YVBhcmFtcy0+VkhUQ2FwLCBzaXplb2YocHN0YVBhcmFtcy0+VkhUQ2FwKSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgdm9zX21lbV9zZXQoJnRkbHNBZGRTdGFDbWRJbmZvLT5WSFRDYXAsIHNpemVvZihwc3RhUGFyY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CisgKi8KK1ZPU19TVEFUVVMgY3NyVGRsc1NlbmRMaW5rRXN0YWJsaXNoUGFyYW1zKHRIYWxIYW5kbGUgaEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggc2Vzc2lvbklkLAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHRTaXJNYWNBZGRyIHBlZXJNYWMsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY0FkZHIgcGVlck1hYywKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdENzclRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zICp0ZGxzTGlua0VzdGFibGlzaFBhcmFtcykKK3sKKyAgICB0cEFuaVNpckdsb2JhbCBwTWFjID0gUE1BQ19TVFJVQ1QoIGhIYWwgKTsKKyAgICB0U21lQ21kICp0ZGxzTGlua0VzdGFibGlzaENtZDsKKyAgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkUgOworICAgIC8vSWYgY29ubmVjdGVkIGFuZCBpbiBJbmZyYS4gT25seSB0aGVuIGFsbG93IHRoaXMKKyAgICBpZiggQ1NSX0lTX1NFU1NJT05fVkFMSUQoIHBNYWMsIHNlc3Npb25JZCApICYmCisgICAgICAgIGNzcklzQ29ublN0YXRlQ29ubmVjdGVkSW5mcmEoIHBNYWMsIHNlc3Npb25JZCApICYmCisgICAgICAgIChOVUxMICE9IHBlZXJNYWMpICkKKyAgICB7CisgICAgICAgIHRkbHNMaW5rRXN0YWJsaXNoQ21kID0gY3NyR2V0Q29tbWFuZEJ1ZmZlcihwTWFjKSA7CisKKyAgICAgICAgaWYodGRsc0xpbmtFc3RhYmxpc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ZCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zLT5pc09mZkNoYW5uZWxTdXBwb3J0ZWQ7CisKKyAgICAgICAgICAgIHZvc19tZW1fY29weSh0ZGxzTGlua0VzdGFibGlzaENtZEluZm8tPnN1cHBvcnRlZENoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0ZGxzTGlua0VzdGFibGlzaFBhcmFtcy0+c3VwcG9ydGVkQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zLT5zdXBwb3J0ZWRDaGFubmVsc0xlbik7CisgICAgICAgICAgICB0ZGxzTGlua0VzdGFibGlzaENtZEluZm8tPnN1cHBvcnRlZENoYW5uZWxzTGVuID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zLT5zdXBwb3J0ZWRDaGFubmVsc0xlbjsKKworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHRkbHNMaW5rRXN0YWJsaXNoQ21kSW5mby0+c3VwcG9ydGVkT3BlckNsYXNzZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zLT5zdXBwb3J0ZWRPcGVyQ2xhc3NlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdGRsc0xpbmtFc3RhYmxpc2hQYXJhbXMtPnN1cHBvcnRlZE9wZXJDbGFzc2VzTGVuKTsKKyAgICAgICAgICAgIHRkbHNMaW5rRXN0YWJsaXNoQ21kSW5mby0+c3VwcG9ydGVkT3BlckNsYXNzZXNMZW4gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGRsc0xpbmtFc3RhYmxpc2hQYXJhbXMtPnN1cHBvcnRlZE9wZXJDbGFzc2VzTGVuOworICAgICAgICA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FDbWQtPnNlc3Npb25JZCA9IHNlc3Npb25JZDsKKyAgICAgICAgICAgIHRkbHNBZGRTdGFDbWRJbmZvLT50ZGxzQWRkT3BlciA9IFRETFNfT1BFUl9BREQ7CisKKyAgICAgICAgICAgIHZvc19tZW1fY29weSggdGRsc0FkZFN0YUNtZEluZm8tPnBlZXJNYWMsCisgICAgICAgICAgICAgICAgICAgIHBlZXJNYWMsIHNpemVvZih0U2lyTWFjQWRkcikpIDsgCisKKyAgICAgICAgICAgIHRkbHNBZGRTdGFDbWQtPmNvbW1hbmQgPSBlU21lQ29tbWFuZFRkbHNBZGRQZWVyIDsKKyAgICAgICAgICAgIHRkbHNBZGRTdGFDbWQtPnUudGRsc0NtZC5zaXplID0gc2l6ZW9mKHRUZGxzQWRkU3RhQ21kSW5mbykgOworICAgICAgICAgICAgc21lUHVzaENvbW1hbmQocE1hYywgdGRsc0FkZFN0YUNtZCwgRkFMU0UpIDsKKyAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1MgOworICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgICAgICAgICAgRkwoIlN1Y2Nlc3NmdWxseSBwb3N0ZWQgdGRsc0FkZFN0YUNtZCB0byBTTUUiKSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gc3RhdHVzIDsKK30KKworLyoKKyAqIFRETFMgcmVxdWVzdCBBUEksIGNhbGxlZCBmcm9tIEhERCB0byBkZWxldGUgYSBURExTIHBlZXIKKyAqLworZUhhbFN0YXR1cyBjc3JUZGxzRGVsUGVlclN0YSh0SGFsSGFuZGxlIGhIYWwsIHRBTklfVTggc2Vzc2lvbklkLAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdFNpck1hY0FkZHIgcGVlck1hYworI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY0FkZHIgcGVlck1hYworI2VuZGlmCispCit7CisgICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9IFBNQUNfU1RSVUNUKCBoSGFsICk7CisgICAgdFNtZUNtZCAqdGRsc0RlbFN0YUNtZCA7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFIDsKKyAKKyAgICAvL0lmIGNvbm5lY3RlZCBhbmQgaW4gSW5mcmEuIE9ubHkgdGhlbiBhbGxvdyB0aGlzCisgICAgaWYoIENTUl9JU19TRVNTSU9OX1ZBTElEKCBwTWFjLCBzZXNzaW9uSWQgKSAmJiAKKyAgICAgICAgY3NySXNDb25uU3RhdGVDb25uZWN0ZWRJbmZyYSggcE1hYywgc2Vzc2lvbklkICkgJiYKKyAgICAgICAgKE5VTEwgIT0gcGVlck1hYykgKQorICAgIHsKKyAgICAgICAgdGRsc0RlbFN0YUNtZCA9IGNzckdldENvbW1hbmRCdWZmZXIocE1hYykgOworCisgICAgICAgIGlmKHRkbHNEZWxTdGFDbWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIHRUZGxzRGVsU3RhQ21kSW5mbyAqdGRsc0RlbFN0YUNtZEluZm8gPSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdGRsc0RlbFN0YUNtZC0+dS50ZGxzQ21kLnUudGRsc0RlbFN0YUNtZEluZm8gOworCisgICAgICAgICAgICB2b3NfbWVtX3plcm8oJnRkbHNEZWxTdGFDbWQtPnUudGRsc0NtZCwgc2l6ZW9mKHRUZGxzQ21kKSk7CisKKyAgICAgICAgICAgIHRkbHNEZWxTdGFDbWQtPnNlc3Npb25JZCA9IHNlc3Npb25JZDsKKworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHRkbHNEZWxTdGFDbWRJbmZvLT5wZWVyTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZWVyTWFjLCBzaXplb2YodFNpck1hY0FkZHIpKSA7IAorCisgICAgICAgICAgICB0ZGxzRGVsU3RhQ21kLT5jb21tYW5kID0gZVNtZUNvbW1hbmRUZGxzRGVsUGVlciA7CisgICAgICAgICAgICB0ZGxzRGVsU3RhQ21kLT51LnRkbHNDbWQuc2l6ZSA9IHNpemVvZih0VGRsc0RlbFN0YUNtZEluZm8pIDsKKyAgICAgICAgICAgIHNtZVB1c2hDb21tYW5kKHBNYWMsIHRkbHNEZWxTdGFDbWQsIEZBTFNFKSA7CisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTIDsKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJTdWNjZXNzZnVsbHkgcG9zdGVkIHRkbHNEZWxTdGFDbWQgdG8gU01FIikpOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIHN0YXR1cyA7Cit9CisKKy8vdGRsc29mZmNoYW4KKy8qCisgKiBURExTIHJlcXVlc3QgQVBJLCBjYWxsZWQgZnJvbSBIREQgdG8gU2VuZCBDaGFubmVsIFN3aXRjaCBQYXJhbWV0ZXJzCisgKi8KK1ZPU19TVEFUVVMgY3NyVGRsc1NlbmRDaGFuU3dpdGNoUmVxKHRIYWxIYW5kbGUgaEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY0FkZHIgcGVlck1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfUzMyIHRkbHNPZmZDaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfUzMyIHRkbHNPZmZDaEJ3T2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCB0ZGxzU3dNb2RlK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U19TVFIiIHJlcSB0byBQRSIsCisgICAgICAgICBNQUNfQUREUl9BUlJBWSh0ZGxzRGVsU3RhQ21kSW5mby0+cGVlck1hYykpOworICAgIHN0YXR1cyA9IHRkbHNTZW5kTWVzc2FnZShwTWFjLCBlV05JX1NNRV9URExTX0RFTF9TVEFfUkVRLCAKKyAgICAgICAgICAgICh2b2lkICopdGRsc0RlbFN0YVJlcSAsIHNpemVvZih0U2lyVGRsc0RlbFN0YVJlcSkpIDsKKyAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgeworICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gc2VuZCByZXF1ZXN0IHRvIE1BQyIpKTsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30KKy8qCisgKiBjb21tYW5kcyByZWNlaXZlZCBmcm9tIENTUgorICovCitlSGFsU3RhdHVzIGNzclRkbHNQcm9jZXNzQ21kKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRTbWVDbWQgKmNtZCkKK3sKKyAgICBlU21lQ29tbWFuZFR5cGUgIGNtZFR5cGUgPSBjbWQtPmNvbW1hbmQgOworICAgIHRBTklfQk9PTEVBTiBzdGF0dXMgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICBzd2l0Y2goY21kVHlwZSkKKyAgICB7CisgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRUZGxzU2VuZE1nbXQ6CisgICAgICAgIHsKKyAgICAgICAgICAgIHN0YXR1cyA9IGNzclRkbHNQcm9jZXNzU2VuZE1nbXQoIHBNYWMsIGNtZCApOworICAgICAgICAgICAgaWYoSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBzdGF0dXMgPSBlQU5JX0JPT0xFQU5fRkFMU0UgOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGJyZWFrIDsKKyAgICAgICAgY2FzZSBlU21lQ29tbWFuZFRkbHNBZGRQZWVyOgorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSBjc3JUZGxzUHJvY2Vzc0FkZFN0YSggcE1hYywgY21kICk7CisgICAgICAgICAgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHN0YXR1cyA9IGVBTklfQk9PTEVBTl9GQUxTRSA7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRUZGxzRGVsUGVlcjogCisgICAgICAgIHsKKyAgICAgICAgICAgIHN0YXR1cyA9IGNzclRkbHNQcm9jZXNzRGVsU3RhKCBwTWFjLCBjbWQgKTsKKyAgICAgICAgICAgIGlmKEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgc3RhdHVzID0gZUFOSV9CT09MRUFOX0ZBTFNFIDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlU21lQ29tbWFuZFRkbHNMaW5rRXN0YWJsaXNoOgorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSBjc3JUZGxzUHJvY2Vzc0xpbmtFc3RhYmxpc2goIHBNYWMsIGNtZCApOworICAgICAgICAgICAgaWYoSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBzdGF0dXMgPSBlQU5JX0JPT0xFQU5fRkFMU0UgOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGJyZWFrOworLy8gdGRsc29mZmNoYW4KKyAgICAgICAgY2FzZSBlU21lQ29tbWFuZFRkbHNDaGFubmVsU3dpdGNoOgorICAgICAgICB7CisgICAgICAgICAgICAgc3RhdHVzID0gY3NyVGRs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gICAgICB2b2lkICpwTXNnQnVmKQoreworICAgIHN3aXRjaChtc2dUeXBlKQorICAgIHsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9URExTX1NFTkRfTUdNVF9SU1A6CisgICAgICAgIHsKKyAgICAgICAgICAgIHRTaXJTbWVSc3AgKnBNc2cgPSAodFNpclNtZVJzcCopIHBNc2dCdWY7CisgICAgICAgICAgICB0Q3NyUm9hbUluZm8gcm9hbUluZm8gPSB7MH0gOworCisgICAgICAgICAgICAvKiByZW1vdmUgcGVuZGluZyBlU21lQ29tbWFuZFRkbHNEaXNjb3ZlcnkgY29tbWFuZCAqLworICAgICAgICAgICAgY3NyVGRsc1JlbW92ZVNtZUNtZChwTWFjLCBlU21lQ29tbWFuZFRkbHNTZW5kTWdtdCkgOworCisgICAgICAgICAgICBpZiAoZVNJUl9TTUVfU1VDQ0VTUyAhPSBwTXNnLT5zdGF0dXNDb2RlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIFR4IGZhaWxlZCwgc28gdGhlcmUgd29udCBiZSBhbnkgYWNrIGNvbmZpcm1hdGlvbiovCisgICAgICAgICAgICAgICAgLyogSW5kaWNhdGUgYWNrIGZhaWx1cmUgdG8gdXBwZXIgbGF5ZXIgKi8KKyAgICAgICAgICAgICAgICByb2FtSW5mby5yZWFzb25Db2RlID0gMDsKKyAgICAgICAgICAgICAgICBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIHBNc2ctPnNlc3Npb25JZCwgJnJvYW1JbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgMCwgZUNTUl9ST0FNX1JFU1VMVF9NR01UX1RYX0NPTVBMRVRFX0lORCwgMCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfVERMU19BRERfU1RBX1JTUDoKKyAgICAgICAgeworICAgICAgICAgICAgdFNpclRkbHNBZGRTdGFSc3AgKmFkZFN0YVJzcCA9ICh0U2lyVGRsc0FkZFN0YVJzcCAqKSBwTXNnQnVmIDsKKyAgICAgICAgICAgIGVDc3JSb2FtUmVzdWx0IHJvYW1SZXN1bHQgOworICAgICAgICAgICAgdENzclJvYW1JbmZvIHJvYW1JbmZvID0gezB9IDsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSggJnJvYW1JbmZvLnBlZXJNYWMsIGFkZFN0YVJzcC0+cGVlck1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSkgOworICAgICAgICAgICAgcm9hbUluZm8uc3RhSWQgPSBhZGRTdGFSc3AtPnN0YUlkIDsKKyAgICAgICAgICAgIHJvYW1JbmZvLnVjYXN0U2lnID0gYWRkU3RhUnNwLT51Y2FzdFNpZyA7CisgICAgICAgICAgICByb2FtSW5mby5iY2FzdFNpZyA9IGFkZFN0YVJzcC0+YmNhc3RTaWcgOworICAgICAgICAgICAgcm9hbUluZm8uc3RhdHVzQ29kZSA9IGFkZFN0YVJzcC0+c3RhdHVzQ29kZSA7CisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogcmVnaXN0ZXIgcGVlciB3aXRoIFRMLCB3ZSBoYXZlIHRvIGdvIHRocm91Z2ggSEREIGFzIHRoaXMgaXMKKyAgICAgICAgICAgICAqIHRoZSBvbmx5IHdheSB0byByZWdpc3RlciBhbnkgU1RBIHdpdGggVEwuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmIChhZGRTdGFSc3AtPnRkbHNBZGRPcGVyID09IFRETFNfT1BFUl9BREQpCisgICAgICAgICAgICAgICAgcm9hbVJlc3VsdCA9IGVDU1JfUk9BTV9SRVNVTFRfQUREX1RETFNfUEVFUjsKKyAgICAgICAgICAgIGVsc2UgLyogYWRkU3RhUnNwLT50ZGxzQWRkT3BlciBtdXN0IGJlIFRETFNfT1BFUl9VUERBVEUgKi8KKyAgICAgICAgICAgICAgICByb2FtUmVzdWx0ID0gZUNTUl9ST0FNX1JFU1VMVF9VUERBVEVfVERMU19QRUVSOworICAgICAgICAgICAgY3NyUm9hbUNhbGxDYWxsYmFjayhwTWFjLCBhZGRTdGFSc3AtPnNlc3Npb25JZCwgJnJvYW1JbmZvLCAwLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ST0FNX1RETFNfU1RBVFVTX1VQREFURSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm9hbVJlc3VsdCk7CisKKyAgICAgICAgICAgIC8qIHJlbW92ZSBwZW5kaW5nIGVTbWVDb21tYW5kVGRsc0Rpc2NvdmVyeSBjb21tYW5kICovCisgICAgICAgICAgICBjc3JUZGxzUmVtb3ZlU21lQ21kKHBNYWMsIGVTbWVDb21tYW5kVGRsc0FkZFBlZXIpIDsKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlV05JX1NNRV9URExTX0RFTF9TVEFfUlNQOgorICAgICAgICB7CisgICAgICAgICAgICB0U2lyVGRsc0RlbFN0YVJzcCAqZGVsU3RhUnNwID0gKHRTaXJUZGxzRGVsU3RhUnNwICopIHBNc2dCdWYgOworICAgICAgICAgICAgdENzclJvYW1JbmZvIHJvYW1JbmZvID0gezB9IDsKKworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCAmcm9hbUluZm8ucGVlck1hYywgZGVsU3RhUnNwLT5wZWVyTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKSA7CisgICAgICAgICAgICByb2FtSW5mby5zdGFJZCA9IGRlbFN0YVJzcC0+c3RhSWQgOworICAgICAgICAgICAgcm9hbUluZm8uc3RhdHVzQ29kZSA9IGRlbFN0YVJzcC0+c3RhdHVzQ29kZSA7CisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogcmVnaXN0ZXIgcGVlciB3aXRoIFRMLCB3ZSBoYXZlIHRvIGdvIHRocm91Z2ggSEREIGFzIHRoaXMgaXMKKyAgICAgICAgICAgICAqIHRoZSBvbmx5IHdheSB0byByZWdpc3RlciBhbnkgU1RBIHdpdGggVEwuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGNzclJvYW1DYWxsQ2FsbGJhY2socE1hYywgZGVsU3RhUnNwLT5zZXNzaW9uSWQsICZyb2FtSW5mbywgMCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ST0FNX1RETFNfU1RBVFVTX1VQREFURSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ST0FNX1JFU1VMVF9ERUxFVEVfVERMU19QRUVSKTsKKworICAgICAgICAgICAgY3NyVGRsc1JlbW92ZVNtZUNtZChwTWFjLCBlU21lQ29tbWFuZFRkbHNEZWxQZWVyKSA7CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZVdOSV9TTUVfVERMU19ERUxfU1RBX0lORDoKKyAgICAgICAgeworICAgICAgICAgICAgdHBTaXJUZGxzRGVsU3RhSW5kIHBTaXJUZGxzRGVsU3RhSW5kID0gKHRwU2lyVGRsc0RlbFN0YUluZCkgcE1zZ0J1ZiA7CisgICAgICAgICAgICB0Q3NyUm9hbUluZm8gcm9hbUluZm8gPSB7MH0gOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCAmcm9hbUluZm8ucGVlck1hYywgcFNpclRkbHNEZWxTdGFJbmQtPnBlZXJNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpIDsKKyAgICAgICAgICAgIHJvYW1JbmZvLnN0YUlkID0gcFNpclRkbHNEZWxTdGFJbmQtPnN0YUlkIDsKKyAgICAgICAgICAgIHJvYW1JbmZvLnJlYXNvbkNvZGUgPSBwU2lyVGRsc0RlbFN0YUluZC0+cmVhc29uQ29kZSA7CisKKyAgICAgICAgICAgIC8qIFNlbmRpbmcgdGhlIFRFQVJET1dOIGluZGljYXRpb24gdG8gSERELiAqLworICAgICAgICAgICAgY3NyUm9hbUNhbGxDYWxsYmFjayhwTWFjLCBwU2lyVGRsc0RlbFN0YUluZC0+c2Vzc2lvbklkLCAmcm9hbUluZm8sIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ST0FNX1RETFNfU1RBVFVTX1VQREFURSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fUkVTVUxUX1RFQVJET1dOX1RETFNfUEVFUl9JTkQpOworICAgICAgICAgICAgYnJlYWsgOworICAgICAgICB9CisgICAgICAgIGNhc2UgZVdOSV9TTUVfVERMU19ERUxfQUxMX1BFRVJfSU5EOgorICAgICAgICB7CisgICAgICAgICAgICB0cFNpclRkbHNEZWxBbGxQZWVySW5kIHBTaXJUZGxzRGVsQWxsUGVlckluZCA9ICh0cFNpclRkbHNEZWxBbGxQZWVySW5kKSBwTXNnQnVmIDsKKyAgICAgICAgICAgIHRDc3JSb2FtSW5mbyByb2FtSW5mbyA9IHswfSA7CisKKyAgICAgICAgICAgIC8qIFNlbmRpbmcgdGhlIFRFQVJET1dOIGluZGljYXRpb24gdG8gSERELiAqLworICAgICAgICAgICAgY3NyUm9hbUNhbGxDYWxsYmFjayhwTWFjLCBwU2lyVGRsc0RlbEFsbFBlZXJJbmQtPnNlc3Npb25JZCwgJnJvYW1JbmZvLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fVERMU19TVEFUVVNfVVBEQVRFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fUkVTVUxUX0RFTEVURV9BTExfVERMU19QRUVSX0lORCk7CisgICAgICAgICAgICBicmVhayA7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBlV05JX1NNRV9NR01UX0ZSTV9UWF9DT01QTEVUSU9OX0lORDoKKyAgICAgICAgeworICAgICAgICAgICAgdHBTaXJNZ210VHhDb21wbGV0aW9uSW5kIHBTaXJUZGxzRGVsQWxsUGVlckluZCA9ICh0cFNpck1nbXRUeENvbXBsZXRpb25JbmQpIHBNc2dCdWYgOworICAgICAgICAgICAgdENzclJvYW1JbmZvIHJvYW1JbmZvID0gezB9IDsKKyAgICAgICAgICAgIHJvYW1JbmZvLnJlYXNvbkNvZGUgPSBwU2lyVGRsc0RlbEFsbFBlZXJJbmQtPnR4Q29tcGxldGVTdGF0dXM7CisKKyAgICAgICAgICAgIGNzclJvYW1DYWxsQ2FsbGJhY2socE1hYywgcFNpclRkbHNEZWxBbGxQZWVySW5kLT5zZXNzaW9uSWQsICZyb2FtSW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgZUNTUl9ST0FNX1JFU1VMVF9NR01UX1RYX0NPTVBMRVRFX0lORCwgMCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBjYXNlIGVXTklfU01FX1RETFNfTElOS19FU1RBQkxJU0hfUlNQOgorICAgICAgICB7CisgICAgICAgICAgICB0U2lyVGRsc0xpbmtFc3RhYmxpc2hSZXFSc3AgKmxpbmtFc3RhYmxpc2hSZXFSc3AgPSAodFNpclRkbHNMaW5rRXN0YWJsaXNoUmVxUnNwICopIHBNc2dCdWYgOworICAgICAgICAgICAgdENzclJvYW1JbmZvIHJvYW1JbmZvID0gezB9IDsKKyNpZiAwCisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnJvYW1JbmZvLnBlZXJNYWMsIGRlbFN0YVJzcC0+cGVlck1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSkgOworICAgICAgICAgICAgcm9hbUluZm8uc3RhSWQgPSBkZWxTdGFSc3AtPnN0YUlkIDsKKyAgICAgICAgICAgIHJvYW1JbmZvLnN0YXR1c0NvZGUgPSBkZWxTdGFSc3AtPnN0YXR1c0NvZGUgOworI2VuZGlmCisgICAgICAgICAgICBjc3JSb2FtQ2FsbENhbGxiYWNrKHBNYWMsIGxpbmtFc3RhYmxpc2hSZXFSc3AtPnNlc3Npb25JZCwgJnJvYW1JbmZvLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgIGVDU1JfUk9BTV9URExTX1NUQVRVU19VUERBVEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ST0FNX1JFU1VMVF9MSU5LX0VTVEFCTElTSF9SRVFfUlNQKTsKKyAgICAgICAgICAgIC8qIHJlbW92ZSBwZW5kaW5nIGVTbWVDb21tYW5kVGRsc0xpbmtFc3RhYmxpc2ggY29tbWFuZCAqLworICAgICAgICAgICAgY3NyVGRsc1JlbW92ZVNtZUNtZChwTWFjLCBlU21lQ29tbWFuZFRkbHNMaW5rRXN0YWJsaXNoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBlV05JX1NNRV9URExTX0NIQU5ORUxfU1dJVENIX1JTUDoKKyAgICAgICAgeworI2lmIDAKKyAgICAgICAgICAgIHRTaXJUZGxzQ2hhblN3aXRjaFJlcVJzcCAqQ2hhblN3aXRjaFJlcVJzcCA9ICh0U2lyVGRsc0NoYW5Td2l0Y2hSZXFSc3AgKikgcE1zZ0J1ZiA7CisgICAgICAgICAgICB0Q3NyUm9hbUluZm8gcm9hbUluZm8gPSB7MH0gOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZyb2FtSW5mby5wZWVyTWFjLCBkZWxTdGFSc3AtPnBlZXJNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpIDsKKyAgICAgICAgICAgIHJvYW1JbmZvLnN0YUlkID0gZGVsU3RhUnNwLT5zdGFJZCA7CisgICAgICAgICAgICByb2FtSW5mby5zdGF0dXNDb2RlID0gZGVsU3RhUnNwLT5zdGF0dXNDb2RlIDsKKyAgICAgICAgICAgIGNzclJvYW1DYWxsQ2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FNJUl9NQUNfQU5JX1dPUktBUk9VTkRfRUlEX01JTiwgU0lSX01BQ19BTklfV09SS0FST1VORF9FSURfTUFYIH0KK307CisKKyNpZiAwCisvL0Rvbid0IG5vdCBpbnNlcnQgZW50cnkgaW50byB0aGUgdGFibGUsIHB1dCBpdCB0byB0aGUgZW5kLiBJZiB5b3UgaGF2ZSB0byBpbnNlcnQsIG1ha2Ugc3VyZSBpdCBpcyBhbHNvCisvL3JlZmxlY3RlZCBpbiBlQ3NyQ291bnRyeUluZGV4CitzdGF0aWMgdENzckNvdW50cnlJbmZvIGdDc3JDb3VudHJ5SW5mb1tlQ1NSX05VTV9DT1VOVFJZX0lOREVYXSA9Cit7CisgICAge1JFR19ET01BSU5fRkNDLCB7J1UnLCAnUycsICcgJ319LCAgICAgICAvL1VTQS8qKioqKipUaGUgIlVTIiBNVVNUIGJlIGF0IGluZGV4IDAqKioqKioqLworICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0EnLCAnRCcsICcgJ319LCAgICAgLy9BTkRPUlJBCisgICAge1JFR19ET01BSU5fV09STEQsIHsnQScsICdFJywgJyAnfX0sICAgICAgIC8vVUFFCisgICAge1JFR19ET01BSU5fV09STEQsIHsnQScsICdGJywgJyAnfX0sICAgICAvL0FGR0hBTklTVEFOCisgICAge1JFR19ET01BSU5fV09STEQsIHsnQScsICdHJywgJyAnfX0sICAgICAvL0FOVElHVUEgQU5EIEJBUkJVREEKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydBJywgJ0knLCAnICd9fSwgICAgIC8vQU5HVUlMTEEKKyAgICB7UkVHX0RPTUFJTl9ISV81R0haLCB7J0EnLCAnTCcsICcgJ319LCAgICAgLy9BTEJBTklBCisgICAge1JFR19ET01BSU5fV09STEQsIHsnQScsICdNJywgJyAnfX0sICAgICAvL0FSTUVOSUEKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydBJywgJ04nLCAnICd9fSwgICAgIC8vTkVUSEVSTEFORFMgQU5USUxMRVMKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydBJywgJ08nLCAnICd9fSwgICAgIC8vQU5HT0xBCisgICAge1JFR19ET01BSU5fV09STEQsIHsnQScsICdRJywgJyAnfX0sICAgICAvL0FOVEFSQ1RJQ0EKKyAgICB7UkVHX0RPTUFJTl9ISV81R0haLCB7J0EnLCAnUicsICcgJ319LCAgICAvL0FSR0VOVElOQQorICAgIHtSRUdfRE9NQUlOX0ZDQywgeydBJywgJ1MnLCAnICd9fSwgICAgIC8vQU1FUklDQU4gU09NT0EKKyAgICB7UkVHX0RPTUFJTl9FVFNJLCB7J0EnLCAnVCcsICcgJ319LCAgICAgIC8vQVVTVFJJQQorICAgIHtSRUdfRE9NQUlOX0VUU0ksIHsnQScsICdVJywgJyAnfX0sICAgICAgLy9BVVNUUkFMSUEKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydBJywgJ1cnLCAnICd9fSwgICAgIC8vQVJVQkEKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydBJywgJ1gnLCAnICd9fSwgICAgIC8vQUxBTkQgSVNMQU5EUworICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0EnLCAnWicsICcgJ319LCAgICAgLy9BWkVSQkFJSkFOCisgICAge1JFR19ET01BSU5fV09STEQsIHsnQicsICdBJywgJyAnfX0sICAgICAvL0JPU05JQSBBTkQgSEVSWkVHT1ZJTkEKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydCJywgJ0InLCAnICd9fSwgICAgIC8vQkFSQkFET1MKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydCJywgJ0QnLCAnICd9fSwgICAgIC8vQkFOR0xBREVTSAorICAgIHtSRUdfRE9NQUlOX0VUU0ksIHsnQicsICdFJywgJyAnfX0sICAgICAgLy9CRUxHSVVNCisgICAge1JFR19ET01BSU5fV09STEQsIHsnQicsICdGJywgJyAnfX0sICAgICAvL0JVUktJTkEgRkFTTworICAgIHtSRUdfRE9NQUlOX0hJXzVHSFosIHsnQicsICdHJywgJyAnfX0sICAgICAgLy9CVUxHQVJJQQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0InLCAnSCcsICcgJ319LCAgICAgLy9CQUhSQUlOCisgICAge1JFR19ET01BSU5fV09STEQsIHsnQicsICdJJywgJyAnfX0sICAgICAvL0JVUlVOREkKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydCJywgJ0onLCAnICd9fSwgICAgIC8vQkVOSU4KKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydCJywgJ0wnLCAnICd9fSwgICAgIC8vU0FJTlQgQkFSVEhFTEVNWQorICAgIHtSRUdfRE9NQUlOX0VUU0ksIHsnQicsICdNJywgJyAnfX0sICAgICAvL0JFUk1VREEKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydCJywgJ04nLCAnICd9fSwgICAgIC8vQlJVTkVJIERBUlVTU0FMQU0KKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydCJywgJ08nLCAnICd9fSwgICAgIC8vQk9MSVZJQQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0InLCAnUicsICcgJ319LCAgICAgICAvL0JSQVpJTAorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0InLCAnUycsICcgJ319LCAgICAgLy9CQUhBTUFTCisgICAge1JFR19ET01BSU5fV09STEQsIHsnQicsICdUJywgJyAnfX0sICAgICAvL0JIVVRBTgorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0InLCAnVicsICcgJ319LCAgICAgLy9CT1VWRVQgSVNMQU5ECisgICAge1JFR19ET01BSU5fV09STEQsIHsnQicsICdXJywgJyAnfX0sICAgICAvL0JPVFNXQU5BCisgICAge1JFR19ET01BSU5fV09STEQsIHsnQicsICdZJywgJyAnfX0sICAgICAvL0JFTEFSVVMKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydCJywgJ1onLCAnICd9fSwgICAgIC8vQkVMSVpFCisgICAge1JFR19ET01BSU5fRkNDLCB7J0MnLCAnQScsICcgJ319LCAgICAgICAvL0NBTkFEQQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0MnLCAnQycsICcgJ319LCAgICAgLy9DT0NPUyAoS0VFTElORykgSVNMQU5EUworICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0MnLCAnRCcsICcgJ319LCAgICAgLy9DT05HTywgVEhFIERFTU9DUkFUSUMgUkVQVUJMSUMgT0YgVEhFCisgICAge1JFR19ET01BSU5fV09STEQsIHsnQycsICdGJywgJyAnfX0sICAgICAvL0NFTlRSQUwgQUZSSUNBTiBSRVBVQkxJQworICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0MnLCAnRycsICcgJ319LCAgICAgLy9DT05HTworICAgIHtSRUdfRE9NQUlOX0VUU0ksIHsnQycsICdIJywgJyAnfX0sICAgICAgLy9TV0lUWkVSTEFORAorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0MnLCAnSScsICcgJ319LCAgICAgLy9DT1RFIEQnSVZPSVJFCisgICAge1JFR19ET01BSU5fV09STEQsIHsnQycsICdLJywgJyAnfX0sICAgICAvL0NPT0sgSVNMQU5EUworICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0MnLCAnTCcsICcgJ319LCAgICAgICAvL0NISUxFCisgICAge1JFR19ET01BSU5fV09STEQsIHsnQycsICdNJywgJyAnfX0sICAgICAvL0NBTUVST09OCisgICAge1JFR19ET01BSU5fSElfNUdIWiwgeydDJywgJ04nLCAnICd9fSwgICAvL0NISU5BCisgICAge1JFR19ET01BSU5fV09STEQsIHsnQycsICdPJywgJyAnfX0sICAgICAgIC8vQ09MT01CSUEKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydDJywgJ1InLCAnICd9fSwgICAgICAgLy9DT1NUQSBSSUNBCisgICAge1JFR19ET01BSU5fV09STEQsIHsnQycsICdVJywgJyAnfX0sICAgICAvL0NVQkEgIAorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0MnLCAnVicsICcgJ319LCAgICAgLy9DQVBFIFZFUkRFCisgICAge1JFR19ET01BSU5fV09STEQsIHsnQycsICdYJywgJyAnfX0sICAgICAvL0NIUklTVE1BUyBJU0xBTkQKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydDJywgJ1knLCAnICd9fSwgICAgICAvL0NZUFJVUworICAgIHtSRUdfRE9NQUlOX0hJXzVHSFosIHsnQycsICdaJywgJyAnfX0sICAgICAgLy9DWkVDSCBSRVBVQkxJQworICAgIHtSRUdfRE9NQUlOX0VUU0ksIHsnRCcsICdFJywgJyAnfX0sICAgICAgLy9HRVJNQU5ZCisgICAge1JFR19ET01BSU5fV09STEQsIHsnRCcsICdKJywgJyAnfX0sICAgICAvL0RKSUJPVVRJCisgICAge1JFR19ET01BSU5fRVRTSSwgeydEJywgJ0snLCAnICd9fSwgICAgICAvL0RFTk1BUksKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydEJywgJ00nLCAnICd9fSwgICAgIC8vRE9NSU5JQ0EKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydEJywgJ08nLCAnICd9fSwgICAgICAgLy9ET01JTklDQU4gUkVQVUJMSUMKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydEJywgJ1onLCAnICd9fSwgICAgIC8vQUxHRVJJQQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0UnLCAnQycsICcgJ319LCAgICAgICAvL0VDVUFET1IKKyAgICB7UkVHX0RPTUFJTl9ISV81R0haLCB7J0UnLCAnRScsICcgJ319LCAgICAgIC8vRVNUT05JQQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0UnLCAnRycsICcgJ319LCAgICAgLy9FR1lQVAorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0UnLCAnSCcsICcgJ319LCAgICAgLy9XRVNURVJOIFNBSEFSQQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0UnLCAnUicsICcgJ319LCAgICAgLy9FUklUUkVBCisgICAge1JFR19ET01BSU5fRVRTSSwgeydFJywgJ1MnLCAnICd9fSwgICAgICAvL1NQQUlOCisgICAge1JFR19ET01BSU5fV09STEQsIHsnRScsICdUJywgJyAnfX0sICAgICAvL0VUSElPUElBCisgICAge1JFR19ET01BSU5fV09STEQsIHsnRicsICdJJywgJyAnfX0sICAgICAgLy9GSU5MQU5ECisgICAge1JFR19ET01BSU5fV09STEQsIHsnRicsICdKJywgJyAnfX0sICAgICAvL0ZJSkkKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydGJywgJ0snLCAnICd9fSwgICAgIC8vRkFMS0xBTkQgSVNMQU5EUyAoTUFMVklOQVMpCisgICAge1JFR19ET01BSU5fV09STEQsIHsnRicsICdNJywgJyAnfX0sICAgICAvL01JQ1JPTkVTSUEsIEZFREVSQVRFRCBTVEFURVMgT0YKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydGJywgJ08nLCAnICd9fSwgICAgIC8vRkFST0UgSVNMQU5EUworICAgIHtSRUdfRE9NQUlOX0VUU0ksIHsnRicsICdSJywgJyAnfX0sICAgICAgLy9GUkFOQ0UKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydHJywgJ0EnLCAnICd9fSwgICAgIC8vR0FCT04KKyAgICB7UkVHX0RPTUFJTl9FVFNJLCB7J0cnLCAnQicsICcgJ319LCAgICAgIC8vVU5JVEVEIEtJTkdET00KKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydHJywgJ0QnLCAnICd9fSwgICAgIC8vR1JFTkFEQQorICAgIHtSRUdfRE9NQUlOX0hJXzVHSFosIHsnRycsICdFJywgJyAnfX0sICAgICAvL0dFT1JHSUEKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydHJywgJ0YnLCAnICd9fSwgICAgIC8vRlJFTkNIIEdVSUFOQQorICAgIHtSRUdfRE9NQUlOX0VUU0ksIHsnRycsICdHJywgJyAnfX0sICAgICAgLy9HVUVSTlNFWQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0cnLCAnSCcsICcgJ319LCAgICAgLy9HSEFOQQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0cnLCAnSScsICcgJ319LCAgICAgIC8vR0lCUkFMVEFSCisgICAge1JFR19ET01BSU5fV09STEQsIHsnRycsICdMJywgJyAnfX0sICAgICAvL0dSRUVOTEFORAorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0cnLCAnTScsICcgJ319LCAgICAgLy9HQU1CSUEKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydHJywgJ04nLCAnICd9fSwgICAgIC8vR1VJTkVBCisgICAge1JFR19ET01BSU5fV09STEQsIHsnRycsICdQJywgJyAnfX0sICAgICAvL0dVQURFTE9VUEUKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydHJywgJ1EnLCAnICd9fSwgICAgIC8vRVFVQVRPUklBTCBHVUlORUEKKyAgICB7UkVHX0RPTUFJTl9FVFNJLCB7J0cnLCAnUicsICcgJ319LCAgICAgIC8vR1JFRUNFCisgICAge1JFR19ET01BSU5fV09STEQsIHsnRycsICdTJywgJyAnfX0sICAgICAvL1NPVVRIIEdFT1JHSUEgQU5EIFRIRSBTT1VUSCBTQU5EV0lDSCBJU0xBTkRTCisgICAge1JFR19ET01BSU5fV09STEQsIHsnRycsICdUJywgJyAnfX0sICAgICAgIC8vR1VBVEVNQUxBCisgICAge1JFR19ET01BSU5fV09STEQsIHsnRycsICdVJywgJyAnfX0sICAgICAvL0dVQU0KKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydHJywgJ1cnLCAnICd9fSwgICAgIC8vR1VJTkVBLUJJU1NBVQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0cnLCAnWScsICcgJ319LCAgICAgLy9HVVlBTkEKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydIJywgJ0snLCAnICd9fSwgICAgICAvL0hPTkdLT05HCisgICAge1JFR19ET01BSU5fV09STEQsIHsnSCcsICdNJywgJyAnfX0sICAgICAvL0hFQVJEIElTTEFORCBBTkQgTUNET05BTEQgSVNMQU5EUworICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0gnLCAnTicsICcgJ319LCAgICAgICAvL0hPTkRVUkFTCisgICAge1JFR19ET01BSU5fSElfNUdIWiwgeydIJywgJ1InLCAnICd9fSwgICAgICAvL0NST0FUSUEKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydIJywgJ1QnLCAnICd9fSwgICAgIC8vSEFJVEkKKyAgICB7UkVHX0RPTUFJTl9ISV81R0haLCB7J0gnLCAnVScsICcgJ319LCAgICAgIC8vSFVOR0FSWQorICAgIHtSRUdfRE9NQUlOX0FQQUMsIHsnSScsICdEJywgJyAnfX0sICAgICAvL0lORE9ORVNJQQorICAgIHtSRUdfRE9NQUlOX0VUU0ksIHsnSScsICdFJywgJyAnfX0sICAgICAvL0lSRUxBTkQgICAgICAgIAorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0knLCAnTCcsICcgJ319LCAgICAgICAgLy9JU1JFQUwKKyAgICB7UkVHX0RPTUFJTl9FVFNJLCB7J0knLCAnTScsICcgJ319LCAgICAgIC8vSVNMRSBPRiBNQU4KKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydJJywgJ04nLCAnICd9fSwgICAgICAvL0lORElBCisgICAge1JFR19ET01BSU5fRVRTSSwgeydJJywgJ08nLCAnICd9fSwgICAgIC8vQlJJVElTSCBJTkRJQU4gT0NFQU4gVEVSUklUT1JZCisgICAge1JFR19ET01BSU5fV09STEQsIHsnSScsICdRJywgJyAnfX0sICAgICAvL0lSQVEKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydJJywgJ1InLCAnICd9fSwgICAgIC8vSVJBTiwgSVNMQU1JQyBSRVBVQkxJQyBPRgorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0knLCAnUycsICcgJ319LCAgICAgIC8vSUNFTEFORAorICAgIHtSRUdfRE9NQUlOX0VUU0ksIHsnSScsICdUJywgJyAnfX0sICAgICAgLy9JVEFMWQorICAgIHtSRUdfRE9NQUlOX0VUU0ksIHsnSicsICdFJywgJyAnfX0sICAgICAgLy9KRVJTRVkKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydKJywgJ00nLCAnICd9fSwgICAgIC8vSkFNQUlDQQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0onLCAnTycsICcgJ319LCAgICAgLy9KT1JEQU4KKyAgICB7UkVHX0RPTUFJTl9KQVBBTiwgeydKJywgJ1AnLCAnICd9fSwgICAgIC8vSkFQQU4KKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydLJywgJ0UnLCAnICd9fSwgICAgIC8vS0VOWUEKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydLJywgJ0cnLCAnICd9fSwgICAgIC8vS1lSR1laU1RBTgorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0snLCAnSCcsICcgJ319LCAgICAgLy9DQU1CT0RJQQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0snLCAnSScsICcgJ319LCAgICAgLy9LSVJJQkFUSQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0snLCAnTScsICcgJ319LCAgICAgLy9DT01PUk9TCisgICAge1JFR19ET01BSU5fV09STEQsIHsnSycsICdOJywgJyAnfX0sICAgICAvL1NBSU5UIEtJVFRTIEFORCBORVZJUworICAgIHtSRUdfRE9NQUlOX0tPUkVBLCB7J0snLCAnUCcsICcgJ319LCAgICAgLy9LT1JFQSwgREVNT0NSQVRJQyBQRU9QTEUnUyBSRVBVQkxJQyBPRgorICAgIHtSRUdfRE9NQUlOX0tPUkVBLCB7J0snLCAnUicsICcgJ319LCAgICAgLy9LT1JFQSwgUkVQVUJMSUMgT0YgCisgICAge1JFR19ET01BSU5fV09STEQsIHsnSycsICdXJywgJyAnfX0sICAgICAvL0tVV0FJVAorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0snLCAnWScsICcgJ319LCAgICAgLy9DQVlNQU4gSVNMQU5EUworICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0snLCAnWicsICcgJ319LCAgICAgLy9LQVpBS0hTVEFOCisgICAge1JFR19ET01BSU5fV09STEQsIHsnTCcsICdBJywgJyAnfX0sICAgICAvL0xBTyBQRU9QTEUnUyBERU1PQ1JBVElDIFJFUFVCTElDCisgICAge1JFR19ET01BSU5fV09STEQsIHsnTCcsICdCJywgJyAnfX0sICAgICAvL0xFQkFOT04KKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydMJywgJ0MnLCAnICd9fSwgICAgIC8vU0FJTlQgTFVDSUEKKyAgICB7UkVHX0RPTUFJTl9FVFNJLCB7J0wnLCAnSScsICcgJ319LCAgICAgIC8vTElFQ0hURU5TVEVJTgorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0wnLCAnSycsICcgJ319LCAgICAgLy9TUkkgTEFOS0EKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydMJywgJ1InLCAnICd9fSwgICAgIC8vTElCRVJJQQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0wnLCAnUycsICcgJ319LCAgICAgLy9MRVNPVEhPCisgICAge1JFR19ET01BSU5fSElfNUdIWiwgeydMJywgJ1QnLCAnICd9fSwgICAgICAvL0xJVEhVQU5JQQorICAgIHtSRUdfRE9NQUlOX0VUU0ksIHsnTCcsICdVJywgJyAnfX0sICAgICAgLy9MVVhFTUJPVVJHCisgICAge1JFR19ET01BSU5fSElfNUdIWiwgeydMJywgJ1YnLCAnICd9fSwgICAgICAvL0xBVFZJQQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J0wnLCAnWScsICcgJ319LCAgICAgLy9MSUJZQU4gQVJBQiBKQU1BSElSSVlBCisgICAge1JFR19ET01BSU5fV09STEQsIHsnTScsICdBJywgJyAnfX0sICAgICAvL01PUk9DQ08KKyAgICB7UkVHX0RPTUFJTl9FVFNJLCB7J00nLCAnQycsICcgJ319LCAgICAgIC8vTU9OQUNPCisgICAge1JFR19ET01BSU5fV09STEQsIHsnTScsICdEJywgJyAnfX0sICAgICAvL01PTERPVkEsIFJFUFVCTElDIE9GCisgICAge1JFR19ET01BSU5fV09STEQsIHsnTScsICdFJywgJyAnfX0sICAgICAvL01PTlRFTkVHUk8KKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydNJywgJ0cnLCAnICd9fSwgICAgIC8vTUFEQUdBU0NBUgorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J00nLCAnSCcsICcgJ319LCAgICAgLy9NQVJTSEFMTCBJU0xBTkRTCisgICAge1JFR19ET01BSU5fV09STEQsIHsnTScsICdLJywgJyAnfX0sICAgICAvL01BQ0VET05JQSwgVEhFIEZPUk1FUiBZVUdPU0xBViBSRVBVQkxJQyBPRgorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J00nLCAnTCcsICcgJ319LCAgICAgLy9NQUxJCisgICAge1JFR19ET01BSU5fV09STEQsIHsnTScsICdNJywgJyAnfX0sICAgICAvL01ZQU5NQVIKKyAgICB7UkVHX0RPTUFJTl9ISV81R0haLCB7J00nLCAnTicsICcgJ319LCAgICAgLy9NT05HT0xJQQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J00nLCAnTycsICcgJ319LCAgICAgLy9NQUNBTworICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J00nLCAnUCcsICcgJ319LCAgICAgLy9OT1JUSEVSTiBNQVJJQU5BIElTTEFORFMKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydNJywgJ1EnLCAnICd9fSwgICAgIC8vTUFSVElOSVFVRQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J00nLCAnUicsICcgJ319LCAgICAgLy9NQVVSSVRBTklBCisgICAge1JFR19ET01BSU5fV09STEQsIHsnTScsICdTJywgJyAnfX0sICAgICAvL01PTlRTRVJSQVQKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydNJywgJ1QnLCAnICd9fSwgICAgICAvL01BTFRBICAgICAKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydNJywgJ1UnLCAnICd9fSwgICAgIC8vTUFVUklUSVVTCisgICAge1JFR19ET01BSU5fV09STEQsIHsnTScsICdWJywgJyAnfX0sICAgICAvL01BTERJVkVTCisgICAge1JFR19ET01BSU5fV09STEQsIHsnTScsICdXJywgJyAnfX0sICAgICAvL01BTEFXSQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J00nLCAnWCcsICcgJ319LCAgICAgICAvL01FWElDTworICAgIHtSRUdfRE9NQUlOX0hJXzVHSFosIHsnTScsICdZJywgJyAnfX0sICAgICAgIC8vTUFMQVlTSUEKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydNJywgJ1onLCAnICd9fSwgICAgIC8vTU9aQU1CSVFVRQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J04nLCAnQScsICcgJ319LCAgICAgLy9OQU1JQklBCisgICAge1JFR19ET01BSU5fV09STEQsIHsnTicsICdDJywgJyAnfX0sICAgICAvL05FVyBDQUxFRE9OSUEKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydOJywgJ0UnLCAnICd9fSwgICAgIC8vTklHRVIKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydOJywgJ0YnLCAnICd9fSwgICAgIC8vTk9SRk9MRCBJU0xBTkQKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydOJywgJ0cnLCAnICd9fSwgICAgIC8vTklHRVJJQQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J04nLCAnSScsICcgJ319LCAgICAgICAvL05JQ0FSQUdVQQorICAgIHtSRUdfRE9NQUlOX0VUU0ksIHsnTicsICdMJywgJyAnfX0sICAgICAgLy9ORVRIRVJMQU5EUworICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J04nLCAnTycsICcgJ319LCAgICAgIC8vTk9SV0FZCisgICAge1JFR19ET01BSU5fV09STEQsIHsnTicsICdQJywgJyAnfX0sICAgICAvL05FUEFMCisgICAge1JFR19ET01BSU5fV09STEQsIHsnTicsICdSJywgJyAnfX0sICAgICAvL05BVVJVCisgICAge1JFR19ET01BSU5fV09STEQsIHsnTicsICdVJywgJyAnfX0sICAgICAvL05JVUUKKyAgICB7UkVHX0RPTUFJTl9FVFNJLCB7J04nLCAnWicsICcgJ319LCAgICAgIC8vTkVXIFpFQUxBTkQKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydPJywgJ00nLCAnICd9fSwgICAgIC8vT01BTgorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1AnLCAnQScsICcgJ319LCAgICAgICAvL1BBTkFNQQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1AnLCAnRScsICcgJ319LCAgICAgICAvL1BFUlUKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydQJywgJ0YnLCAnICd9fSwgICAgIC8vRlJFTkNIIFBPTFlORVNJQQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1AnLCAnRycsICcgJ319LCAgICAgLy9QQVBVQSBORVcgR1VJTkVBCisgICAge1JFR19ET01BSU5fV09STEQsIHsnUCcsICdIJywgJyAnfX0sICAgICAgLy9QSElMSVBQSU5FUworICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1AnLCAnSycsICcgJ319LCAgICAgLy9QQUtJU1RBTgorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1AnLCAnTCcsICcgJ319LCAgICAgIC8vUE9MQU5ECisgICAge1JFR19ET01BSU5fV09STEQsIHsnUCcsICdNJywgJyAnfX0sICAgICAvL1NBSU5UIFBJRVJSRSBBTkQgTUlRVUVMT04KKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydQJywgJ04nLCAnICd9fSwgICAgIC8vUElUQ0FJUk4KKyAgICB7UkVHX0RPTUFJTl9GQ0MsIHsnUCcsICdSJywgJyAnfX0sICAgICAgIC8vUFVFUlRPIFJJQ08KKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydQJywgJ1MnLCAnICd9fSwgICAgICAgIC8vUEFMRVNUSU5JQU4gVEVSUklUT1JZLCBPQ0NVUElFRAorICAgIHtSRUdfRE9NQUlOX0VUU0ksIHsnUCcsICdUJywgJyAnfX0sICAgICAgLy9QT1JUVUdBTAorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1AnLCAnVycsICcgJ319LCAgICAgLy9QQUxBVQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1AnLCAnWScsICcgJ319LCAgICAgLy9QQVJBR1VBWQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1EnLCAnQScsICcgJ319LCAgICAgLy9RQVRBUgorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1InLCAnRScsICcgJ319LCAgICAgLy9SRVVOSU9OCisgICAge1JFR19ET01BSU5fSElfNUdIWiwgeydSJywgJ08nLCAnICd9fSwgICAgICAvL1JPTUFOSUEKKyAgICB7UkVHX0RPTUFJTl9ISV81R0haLCB7J1InLCAnUycsICcgJ319LCAgICAgIC8vU0VSQklBCisgICAge1JFR19ET01BSU5fV09STEQsIHsnUicsICdVJywgJyAnfX0sICAgICAgIC8vUlVTU0lBCisgICAge1JFR19ET01BSU5fV09STEQsIHsnUicsICdXJywgJyAnfX0sICAgICAvL1JXQU5EQQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1MnLCAnQScsICcgJ319LCAgICAgIC8vU0FVREkgQVJBQklBCisgICAge1JFR19ET01BSU5fV09STEQsIHsnUycsICdCJywgJyAnfX0sICAgICAvL1NPTE9NT04gSVNMQU5EUworICAgIHtSRUdfRE9NQUlOX0VUU0ksIHsnUycsICdDJywgJyAnfX0sICAgICAgLy9TRVlDSEVMTEVTCisgICAge1JFR19ET01BSU5fV09STEQsIHsnUycsICdEJywgJyAnfX0sICAgICAvL1NVREFOCisgICAge1JFR19ET01BSU5fRVRTSSwgeydTJywgJ0UnLCAnICd9fSwgICAgICAvL1NXRURFTgorICAgIHtSRUdfRE9NQUlOX0FQQUMsIHsnUycsICdHJywgJyAnfX0sICAgICAgLy9TSU5HQVBPUkUKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydTJywgJ0gnLCAnICd9fSwgICAgIC8vU0FJTlQgSEVMRU5BCisgICAge1JFR19ET01BSU5fSElfNUdIWiwgeydTJywgJ0knLCAnICd9fSwgICAgICAvL1NMT1ZFTk5JQQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1MnLCAnSicsICcgJ319LCAgICAgLy9TVkFMQkFSRCBBTkQgSkFOIE1BWUVOCisgICAge1JFR19ET01BSU5fSElfNUdIWiwgeydTJywgJ0snLCAnICd9fSwgICAgICAvL1NMT1ZBS0lBCisgICAge1JFR19ET01BSU5fV09STEQsIHsnUycsICdMJywgJyAnfX0sICAgICAvL1NJRVJSQSBMRU9ORSAgICAgIAorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1MnLCAnTScsICcgJ319LCAgICAgLy9TQU4gTUFSSU5PCisgICAge1JFR19ET01BSU5fV09STEQsIHsnUycsICdOJywgJyAnfX0sICAgICAvL1NFTkVHQUwKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydTJywgJ08nLCAnICd9fSwgICAgIC8vU09NQUxJQQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1MnLCAnUicsICcgJ319LCAgICAgLy9TVVJJTkFNRQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1MnLCAnVCcsICcgJ319LCAgICAgLy9TQU8gVE9NRSBBTkQgUFJJTkNJUEUKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydTJywgJ1YnLCAnICd9fSwgICAgICAgLy9FTCBTQUxWQURPUgorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1MnLCAnWScsICcgJ319LCAgICAgLy9TWVJJQU4gQVJBQiBSRVBVQkxJQworICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1MnLCAnWicsICcgJ319LCAgICAgLy9TV0FaSUxBTkQKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydUJywgJ0MnLCAnICd9fSwgICAgIC8vVFVSS1MgQU5EIENBSUNPUyBJU0xBTkRTCisgICAge1JFR19ET01BSU5fV09STEQsIHsnVCcsICdEJywgJyAnfX0sICAgICAvL0NIQUQKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydUJywgJ0YnLCAnICd9fSwgICAgIC8vRlJFTkNIIFNPVVRIRVJOIFRFUlJJVE9SSUVTCisgICAge1JFR19ET01BSU5fV09STEQsIHsnVCcsICdHJywgJyAnfX0sICAgICAvL1RPR08KKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydUJywgJ0gnLCAnICd9fSwgICAgICAgLy9USEFJTEFORAorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1QnLCAnSicsICcgJ319LCAgICAgLy9UQUpJS0lTVEFOCisgICAge1JFR19ET01BSU5fV09STEQsIHsnVCcsICdLJywgJyAnfX0sICAgICAvL1RPS0VMQVUKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydUJywgJ0wnLCAnICd9fSwgICAgIC8vVElNT1ItTEVTVEUKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydUJywgJ00nLCAnICd9fSwgICAgIC8vVFVSS01FTklTVEFOCisgICAge1JFR19ET01BSU5fV09STEQsIHsnVCcsICdOJywgJyAnfX0sICAgICAvL1RVTklTSUEKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydUJywgJ08nLCAnICd9fSwgICAgIC8vVE9OR0EKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydUJywgJ1InLCAnICd9fSwgICAgICAvL1RVUktFWQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1QnLCAnVCcsICcgJ319LCAgICAgLy9UUklOSURBRCBBTkQgVE9CQUdPCisgICAge1JFR19ET01BSU5fV09STEQsIHsnVCcsICdWJywgJyAnfX0sICAgICAvL1RVVkFMVQorICAgIHtSRUdfRE9NQUlOX0hJXzVHSFosIHsnVCcsICdXJywgJyAnfX0sICAgICAgIC8vVEFJV0FOLCBQUk9WSU5DRSBPRiBDSElOQQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1QnLCAnWicsICcgJ319LCAgICAgLy9UQU5aQU5JQSwgVU5JVEVEIFJFUFVCTElDIE9GCisgICAge1JFR19ET01BSU5fSElfNUdIWiwgeydVJywgJ0EnLCAnICd9fSwgICAgICAgLy9VS1JBSU5FCisgICAge1JFR19ET01BSU5fV09STEQsIHsnVScsICdHJywgJyAnfX0sICAgICAvL1VHQU5EQQorICAgIHtSRUdfRE9NQUlOX0ZDQywgeydVJywgJ00nLCAnICd9fSwgICAgICAgLy9VTklURUQgU1RBVEVTIE1JTk9SIE9VVExZSU5HIElTTEFORFMKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydVJywgJ1knLCAnICd9fSwgICAgICAgLy9VUlVHVUFZCisgICAge1JFR19ET01BSU5fSElfNUdIWiwgeydVJywgJ1onLCAnICd9fSwgICAgIC8vVVpCRUtJU1RBTgorICAgIHtSRUdfRE9NQUlOX0VUU0ksIHsnVicsICdBJywgJyAnfX0sICAgICAgLy9IT0xZIFNFRSAoVkFUSUNBTiBDSVRZIFNUQVRFKQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1YnLCAnQycsICcgJ319LCAgICAgLy9TQUlOVCBWSU5DRU5UIEFORCBUSEUgR1JFTkFESU5FUworICAgIHtSRUdfRE9NQUlOX0hJXzVHSFosIHsnVicsICdFJywgJyAnfX0sICAgICAgIC8vVkVORVpVRUxBCisgICAge1JFR19ET01BSU5fRVRTSSwgeydWJywgJ0cnLCAnICd9fSwgICAgICAgLy9WSVJHSU4gSVNMQU5EUywgQlJJVElTSAorICAgIHtSRUdfRE9NQUlOX0ZDQywgeydWJywgJ0knLCAnICd9fSwgICAgICAgLy9WSVJHSU4gSVNMQU5EUywgVVMKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydWJywgJ04nLCAnICd9fSwgICAgICAvL1ZJRVQgTkFNCisgICAge1JFR19ET01BSU5fV09STEQsIHsnVicsICdVJywgJyAnfX0sICAgICAvL1ZBTlVBVFUKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydXJywgJ0YnLCAnICd9fSwgICAgIC8vV0FMTElTIEFORCBGVVRVTkEKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydXJywgJ1MnLCAnICd9fSwgICAgIC8vU09NT0EKKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydZJywgJ0UnLCAnICd9fSwgICAgIC8vWUVNRU4KKyAgICB7UkVHX0RPTUFJTl9XT1JMRCwgeydZJywgJ1QnLCAnICd9fSwgICAgIC8vTUFZT1RURQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1onLCAnQScsICcgJ319LCAgICAgIC8vU09VVEggQUZSSUNBCisgICAge1JFR19ET01BSU5fV09STEQsIHsnWicsICdNJywgJyAnfX0sICAgICAvL1pBTUJJQQorICAgIHtSRUdfRE9NQUlOX1dPUkxELCB7J1onLCAnVycsICcgJ319LCAgICAgLy9aSU1CQUJXRQorCisgICAge1JFR19ET01BSU5fS09SRUEsIHsnSycsICcxJywgJyAnfX0sICAgIC8vS29yZWEgYWx0ZXJuYXRlIDEKKyAgICB7UkVHX0RPTUFJTl9LT1JFQSwgeydLJywgJzInLCAnICd9fSwgICAgLy9Lb3JlYSBhbHRlcm5hdGUgMgorICAgIHtSRUdfRE9NQUlOX0tPUkVBLCB7J0snLCAnMycsICcgJ319LCAgICAvL0tvcmVhIGFsdGVybmF0ZSAzCisgICAge1JFR19ET01BSU5fS09SRUEsIHsnSycsICc0JywgJyAnfX0sICAgIC8vS29yZWEgYWx0ZXJuYXRlIDQKK307CisKKworLy9UaGUgY2hhbm5lbHMgbGlzdGVkIGhlcmUgZG9lc24ndCBtZWFuIHRo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AgICAgICAgezEsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezIsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezMsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezQsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezUsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezYsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezcsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezgsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezksIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezEwLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMSwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTIsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezEzLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxNCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgIH0KKyAgICB9LAorICAgIC8vUkVHX0RPTUFJTl9FVFNJCisgICAgeworICAgICAgICBSRUdfRE9NQUlOX0VUU0ksCisgICAgICAgIDQ1LCAvL051bSBjaGFubmVscworICAgICAgICAvL0NoYW5uZWxzCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vNUdIegorICAgICAgICAgICAgLy81MTgwIC0gNTI0MAorICAgICAgICAgICAgezM2LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs0MCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7NDQsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezQ4LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIC8vNTI1MCB0byA1MzUwCisgICAgICAgICAgICB7NTIsIGVTSVJfUEFTU0lWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs1NiwgZVNJUl9QQVNTSVZFX1NDQU59LAorICAgICAgICAgICAgezYwLCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7NjQsIGVTSVJfUEFTU0lWRV9TQ0FOfSwKKyAgICAgICAgICAgIC8vNTQ3MCB0byA1NzI1CisgICAgICAgICAgICB7MTAwLCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTA0LCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTA4LCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTEyLCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTE2LCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTIwLCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTI0LCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTI4LCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTMyLCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTM2LCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTQwLCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICAvLzU3NDUgLSA1ODI1CisgICAgICAgICAgICB7MTQ5LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxNTMsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezE1NywgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTYxLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxNjUsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgLy80LjlHSHoKKyAgICAgICAgICAgIC8vNDkyMC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fSkFQQU4KKyAgICB7CisgICAgICAgIFJFR19ET01BSU5fSkFQQU4sCisgICAgICAgIDQ1LCAvL051bSBjaGFubmVscworICAgICAgICAvL0NoYW5uZWxzCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vNUdIegorICAgICAgICAgICAgLy81MTgwIC0gNTI0MAorICAgICAgICAgICAgezM2LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs0MCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7NDQsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezQ4LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIC8vNTI1MCB0byA1MzUwCisgICAgICAgICAgICB7NTIsIGVTSVJfUEFTU0lWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs1NiwgZVNJUl9QQVNTSVZFX1NDQU59LAorICAgICAgICAgICAgezYwLCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7NjQsIGVTSVJfUEFTU0lWRV9TQ0FOfSwKKyAgICAgICAgICAgIC8vNTQ3MCB0byA1NzI1CisgICAgICAgICAgICB7MTAwLCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTA0LCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTA4LCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTEyLCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTE2LCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTIwLCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTI0LCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTI4LCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTMyLCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAg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yAgICAgICAgICAgIHs3LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs4LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs5LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTEsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezEyLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMywgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTQsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICB9CisgICAgfSwKKyAgICAvL1JFR19ET01BSU5fV09STEQKKyAgICB7CisgICAgICAgIFJFR19ET01BSU5fV09STEQsCisgICAgICAgIDQ1LCAvL051bSBjaGFubmVscworICAgICAgICAvL0NoYW5uZWxzCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vNUdIegorICAgICAgICAgICAgLy81MTgwIC0gNTI0MAorICAgICAgICAgICAgezM2LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs0MCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7NDQsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezQ4LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIC8vNTI1MCB0byA1MzUwCisgICAgICAgICAgICB7NTIsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezU2LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs2MCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7NjQsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgLy81NDcwIHRvIDU3MjUKKyAgICAgICAgICAgIHsxMDAsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezEwNCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTA4LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMTIsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezExNiwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTIwLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMjQsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezEyOCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTMyLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMzYsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezE0MCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICAvLzU3NDUgLSA1ODI1CisgICAgICAgICAgICB7MTQ5LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxNTMsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezE1NywgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTYxLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxNjUsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgLy80LjlHSHoKKyAgICAgICAgICAgIC8vNDkyMCAtIDUwODAKKyAgICAgICAgICAgIHsyNDAsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezI0NCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MjQ4LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsyNTIsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezIwOCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MjEyLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsyMTYsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgLy8yLDRHSHoKKyAgICAgICAgICAgIHsxLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsyLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHszLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs0LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs1LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs2LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs3LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs4LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs5LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTEsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezEyLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMywgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTQsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICB9CisgICAgfSwKKyAgICAvL1JFR19ET01BSU5fTl9BTUVSX0VYQ19GQ0MKKyAgICB7CisgICAgICAgIFJFR19ET01BSU5fTl9BTUVSX0VYQ19GQ0MsCisgICAgICAgIDQ1LCAvL051bSBjaGFubmVscworICAgICAgICAvL0NoYW5uZWxzCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vNUdIegorICAgICAgICAgICAgLy81MTgwIC0gNTI0MAorICAgICAgICAgICAgezM2LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs0MCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7NDQsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezQ4LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIC8vNTI1MCB0byA1MzUwCisgICAgICAgICAgICB7NTIsIGVTSVJfUEFTU0lWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs1NiwgZVNJUl9QQVNTSVZFX1NDQU59LAorICAgICAgICAgICAgezYwLCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7NjQsIGVTSVJfUEFTU0lWRV9TQ0FOfSwKKyAgICAgICAgICAgIC8vNTQ3MCB0byA1NzI1CisgICAgICAgICAgICB7MTAwLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMDQsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezEwOCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTEyLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMTYsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezEyMCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTI0LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMjgsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezEzMiwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTM2LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxNDAsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgLy81NzQ1IC0gNTgyNQorICAgICAgICAgICAgezE0OSwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTUzLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxNTcsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezE2MSwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTY1LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIC8vNC45R0h6CisgICAgICAgICAgICAvLzQ5MjAgLSA1MDgwCisgICAgICAgICAgICB7MjQwLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsyNDQsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezI0OCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MjUyLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsyMDgsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezIxMiwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MjE2LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIC8vMiw0R0h6CisgICAgICAgICAgICB7MSwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MiwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MywgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7NCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7NSwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7NiwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7NywgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7OCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7OSwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTAsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezExLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMiwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTMsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezE0LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgfQorICAgIH0sCisgICAgLy9SRUdfRE9NQUlOX0FQQUMKKyAgICB7CisgICAgICAgIFJFR19ET01BSU5fQVBBQywKKyAgICAgICAgNDUsIC8vTnVtIGNoYW5uZWxzCisgICAgICAgIC8vQ2hhbm5lbHMKKyAgICAgICAgeworICAgICAgICAgICAgLy81R0h6CisgICAgICAgICAgICAvLzUxODAgLSA1MjQwCisgICAgICAgICAgICB7MzYsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezQwLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs0NCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7NDgsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgLy81MjUwIHRvIDUzNTAKKyAgICAgICAgICAgIHs1MiwgZVNJUl9QQVNTSVZFX1NDQU59LAorICAgICAgICAgICAgezU2LCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7NjAsIGVTSVJfUEFTU0lWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs2NCwgZVNJUl9QQVNTSVZFX1NDQU59LAorICAgICAgICAgICAgLy81NDcwIHRvIDU3MjUKKyAgICAgICAgICAgIHsxMDAsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezEwNCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTA4LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMTIsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezExNiwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTIwLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMjQsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezEyOCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTMyLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMzYsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezE0MCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICAvLzU3NDUgLSA1ODI1CisgICAgICAgICAgICB7MTQ5LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxNTMsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezE1NywgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTYxLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxNjUsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgLy80LjlHSHoKKyAgICAgICAgICAgIC8vNDkyMCAtIDUwODAKKyAgICAgICAgICAgIHsyNDAsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezI0NCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MjQ4LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsyNTIsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezIwOCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MjEyLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsyMTYsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgLy8yLDRHSHoKKyAgICAgICAgICAgIHsxLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsyLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHszLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs0LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs1LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs2LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs3LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs4LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs5LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTEsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezEyLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMywgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTQsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICB9CisgICAgfSwKKyAgICAvL1JFR19ET01BSU5fS09SRUEKKyAgICB7CisgICAgICAgIFJFR19ET01BSU5fS09SRUEsCisgICAgICAgIDQ1LCAvL051bSBjaGFubmVscworICAgICAgICAvL0NoYW5uZWxzCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vNUdIegorICAgICAgICAgICAgLy81MTgwIC0gNTI0MAorICAgICAgICAgICAgezM2LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs0MCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7NDQsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezQ4LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIC8vNTI1MCB0byA1MzUwCisgICAgICAgICAgICB7NTIsIGVTSVJfUEFTU0lWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs1NiwgZVNJUl9QQVNTSVZFX1NDQU59LAorICAgICAgICAgICAgezYwLCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7NjQsIGVTSVJfUEFTU0lWRV9TQ0FOfSwKKyAgICAgICAgICAgIC8vNTQ3MCB0byA1NzI1CisgICAgICAgICAgICB7MTAwLCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTA0LCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTA4LCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTEyLCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTE2LCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTIwLCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTI0LCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTI4LCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTMyLCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTM2LCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTQwLCBlU0lSX1BBU1NJVkVfU0NBTn0sCisgICAgICAgICAgICAvLzU3NDUgLSA1ODI1CisgICAgICAgICAgICB7MTQ5LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxNTMsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezE1NywgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTYxLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxNjUsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgLy80LjlHSHoKKyAgICAgICAgICAgIC8vNDkyMCAtIDUwODAKKyAgICAgICAgICAgIHsyNDAsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezI0NCwgZVNJUl9BQ1RJVkVfU0NBTn0sCis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FubmVscworICAgICAgICB7CisgICAgICAgICAgICAvLzVHSHoKKyAgICAgICAgICAgIC8vNTE4MCAtIDUyNDAKKyAgICAgICAgICAgIHszNiwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7NDAsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezQ0LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs0OCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICAvLzUyNTAgdG8gNTM1MAorICAgICAgICAgICAgezUyLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs1NiwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7NjAsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezY0LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIC8vNTQ3MCB0byA1NzI1CisgICAgICAgICAgICB7MTAwLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMDQsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezEwOCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTEyLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMTYsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezEyMCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTI0LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMjgsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezEzMiwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTM2LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxNDAsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgLy81NzQ1IC0gNTgyNQorICAgICAgICAgICAgezE0OSwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTUzLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxNTcsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezE2MSwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTY1LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIC8vNC45R0h6CisgICAgICAgICAgICAvLzQ5MjAgLSA1MDgwCisgICAgICAgICAgICB7MjQwLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsyNDQsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezI0OCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MjUyLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsyMDgsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezIxMiwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MjE2LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIC8vMiw0R0h6CisgICAgICAgICAgICB7MSwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MiwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MywgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7NCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7NSwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7NiwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7NywgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7OCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7OSwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTAsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezExLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMiwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTMsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezE0LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgfQorICAgIH0sCisgICAgLy9SRUdfRE9NQUlOX05PXzVHSFoKKyAgICB7CisgICAgICAgIFJFR19ET01BSU5fTk9fNUdIWiwKKyAgICAgICAgNDUsIC8vTnVtIGNoYW5uZWxzCisgICAgICAgIC8vQ2hhbm5lbHMKKyAgICAgICAgeworICAgICAgICAgICAgLy81R0h6CisgICAgICAgICAgICAvLzUxODAgLSA1MjQwCisgICAgICAgICAgICB7MzYsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezQwLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs0NCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7NDgsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgLy81MjUwIHRvIDUzNTAKKyAgICAgICAgICAgIHs1MiwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7NTYsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezYwLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHs2NCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICAvLzU0NzAgdG8gNTcyNQorICAgICAgICAgICAgezEwMCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTA0LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMDgsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezExMiwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTE2LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMjAsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezEyNCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTI4LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMzIsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezEzNiwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTQwLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIC8vNTc0NSAtIDU4MjUKKyAgICAgICAgICAgIHsxNDksIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezE1MywgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTU3LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxNjEsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezE2NSwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICAvLzQuOUdIegorICAgICAgICAgICAgLy80OTIwIC0gNTA4MAorICAgICAgICAgICAgezI0MCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MjQ0LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsyNDgsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezI1MiwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MjA4LCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsyMTIsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezIxNiwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICAvLzIsNEdIegorICAgICAgICAgICAgezEsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezIsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezMsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezQsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezUsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezYsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezcsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezgsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezksIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezEwLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxMSwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgICAgICB7MTIsIGVTSVJfQUNUSVZFX1NDQU59LAorICAgICAgICAgICAgezEzLCBlU0lSX0FDVElWRV9TQ0FOfSwKKyAgICAgICAgICAgIHsxNCwgZVNJUl9BQ1RJVkVfU0NBTn0sCisgICAgICAgIH0KKyAgICB9LAorfTsKKyNlbmRpZgorCitleHRlcm4gY29uc3QgdFJmQ2hhbm5lbFByb3BzIHJmQ2hhbm5lbHNbTlVNX1JGX0NIQU5ORUxTXTsKKworLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisKKy8qKgorICogXHZhciBnUGh5UmF0ZXNTdXBwdAorICoKKyAqIFxicmllZiBSYXRlIHN1cHBvcnQgbG9va3VwIHRhYmxlCisgKgorICoKKyAqIFRoaXMgaXMgYSAgbG9va3VwIHRhYmxlIGluZGV4aW5nIHJhdGVzICYgIGNvbmZpZ3VyYXRpb24gcGFyYW1ldGVycyB0bworICogc3VwcG9ydC4gIEdpdmVuIGEgcmF0ZSAoaW4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QU1fU0VTU0lPTl9NQVg7IGkrKyApCisgICAgeworICAgICAgICBpZiggQ1NSX0lTX1NFU1NJT05fVkFMSUQoIHBNYWMsIGkgKSAmJgorICAgICAgICAgICAgKCBjc3JJc0Nvbm5TdGF0ZUluZnJhKCBwTWFjLCBpICkKKyAgICAgICAgICAgIHx8IGNzcklzQ29ublN0YXRlSWJzcyggcE1hYywgaSApCisgICAgICAgICAgICB8fCBjc3JJc0Nvbm5TdGF0ZUFwKCBwTWFjLCBpKSApICkKKyAgICAgICAgeworICAgICAgICAgICAgZlJjID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiAoIGZSYyApOworfQorCit0QU5JX1M4IGNzckdldEluZnJhU2Vzc2lvbklkKCB0cEFuaVNpckdsb2JhbCBwTWFjICkKK3sKKyAgICB0QU5JX1U4IGk7CisgICAgdEFOSV9TOCBzZXNzaW9uaWQgPSAtMTsKKworICAgIGZvciggaSA9IDA7IGkgPCBDU1JfUk9BTV9TRVNTSU9OX01BWDsgaSsrICkKKyAgICB7CisgICAgICAgIGlmKCBDU1JfSVNfU0VTU0lPTl9WQUxJRCggcE1hYywgaSApICYmIGNzcklzQ29ublN0YXRlSW5mcmEoIHBNYWMsIGkgKSAgKQorICAgICAgICB7CisgICAgICAgICAgICBzZXNzaW9uaWQgPSBpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gKCBzZXNzaW9uaWQgKTsKK30KKwordEFOSV9VOCBjc3JHZXRJbmZyYU9wZXJhdGlvbkNoYW5uZWwoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggc2Vzc2lvbklkKQoreworICAgIHRBTklfVTggY2hhbm5lbDsKKworICAgIGlmKCBDU1JfSVNfU0VTU0lPTl9WQUxJRCggcE1hYywgc2Vzc2lvbklkICkpCisgICAgeworICAgICAgICBjaGFubmVsID0gcE1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29uY3VycmVuY3kgbW9kZS4KKy8vSWYgb3RoZXIgQlNTIGlzIG5vdCB1cCBvciBub3QgY29ubmVjdGVkIGl0IHdpbGwgcmV0dXJuIDAgCisKK3RBTklfVTggY3NyR2V0Q29uY3VycmVudE9wZXJhdGlvbkNoYW5uZWwoIHRwQW5pU2lyR2xvYmFsIHBNYWMgKQoreworICB0Q3NyUm9hbVNlc3Npb24gKnBTZXNzaW9uID0gTlVMTDsKKyAgdEFOSV9VOCBpID0gMDsKKworICBmb3IoIGkgPSAwOyBpIDwgQ1NSX1JPQU1fU0VTU0lPTl9NQVg7IGkrKyApCisgIHsKKyAgICAgIGlmKCBDU1JfSVNfU0VTU0lPTl9WQUxJRCggcE1hYywgaSApICkKKyAgICAgIHsKKyAgICAgICAgICBwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTiggcE1hYywgaSApOworCisgICAgICAgICAgaWYgKE5VTEwgIT0gcFNlc3Npb24tPnBDdXJSb2FtUHJvZmlsZSkKKyAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmICgKKyAgICAgICAgICAgICAgICAgICAgICAoKChwU2Vzc2lvbi0+cEN1clJvYW1Qcm9maWxlLT5jc3JQZXJzb25hID09IFZPU19TVEFfTU9ERSkgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgIChwU2Vzc2lvbi0+cEN1clJvYW1Qcm9maWxlLT5jc3JQZXJzb25hID09IFZPU19QMlBfQ0xJRU5UX01PREUpKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAocFNlc3Npb24tPmNvbm5lY3RTdGF0ZSA9PSBlQ1NSX0FTU09DX1NUQVRFX1RZUEVfSU5GUkFfQVNTT0NJQVRFRCkpIAorICAgICAgICAgICAgICAgICAgICAgIHx8IAorICAgICAgICAgICAgICAgICAgICAgICgoKHBTZXNzaW9uLT5wQ3VyUm9hbVByb2ZpbGUtPmNzclBlcnNvbmEgPT0gVk9TX1AyUF9HT19NT0RFKSB8fAorICAgICAgICAgICAgICAgICAgIC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TZXNzaW9uID0gTlVMTDsKKyAgICB0QU5JX1UzMiBjb3VudFN0YSA9IDA7CisKKyAgICBmb3IoIGkgPSAwOyBpIDwgQ1NSX1JPQU1fU0VTU0lPTl9NQVg7IGkrKyApCisgICAgeworICAgICAgICBpZiggQ1NSX0lTX1NFU1NJT05fVkFMSUQoIHBNYWMsIGkgKSAmJiAhY3NySXNDb25uU3RhdGVEaXNjb25uZWN0ZWQoIHBNYWMsIGkgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBTZXNzaW9uID0gQ1NSX0dFVF9TRVNTSU9OKCBwTWFjLCBpICk7CisKKyAgICAgICAgICAgIGlmIChOVUxMICE9IHBTZXNzaW9uLT5wQ3VyUm9hbVByb2ZpbGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHBTZXNzaW9uLT5wQ3VyUm9hbVByb2ZpbGUtPmNzclBlcnNvbmEgPT0gVk9TX1NUQV9NT0RFKSB7CisgICAgICAgICAgICAgICAgICAgIGNvdW50U3RhKys7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyogcmV0dXJuIFRSVUUgaWYgb25lIG9mIHRoZSBmb2xsb3dpbmcgY29uZGl0aW9ucyBpcyBUUlVFOgorICAgICAqIC0gbW9yZSB0aGFuIG9uZSBTVEEgc2Vzc2lvbiBjb25uZWN0ZWQKKyAgICAgKi8KKyAgICBpZiAoIGNvdW50U3RhID4gMCkgeworICAgICAgICBmUmMgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICB9CisKKyAgICByZXR1cm4oIGZSYyApOworfQorCit0QU5JX0JPT0xFQU4gY3NySXNQMnBTZXNzaW9uQ29ubmVjdGVkKCB0cEFuaVNpckdsb2JhbCBwTWFjICkKK3sKKyAgICB0QU5JX1UzMiBpOworICAgIHRBTklfQk9PTEVBTiBmUmMgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgdENzclJvYW1TZXNzaW9uICpwU2Vzc2lvbiA9IE5VTEw7CisgICAgdEFOSV9VMzIgY291bnRQMnBDbGkgPSAwOworICAgIHRBTklfVTMyIGNvdW50UDJwR28gPSAwOworICAgIHRBTklfVTMyIGNvdW50U0FQID0gMDsKKworICAgIGZvciggaSA9IDA7IGkgPCBDU1JfUk9BTV9TRVNTSU9OX01BWDsgaSsrICkKKyAgICB7CisgICAgICAgIGlmKCBDU1JfSVNfU0VTU0lPTl9WQUxJRCggcE1hYywgaSApICYmICFjc3JJc0Nvbm5TdGF0ZURpc2Nvbm5lY3RlZCggcE1hYywgaSApICkKKyAgICAgICAgeworICAgICAgICAgICAgcFNlc3Npb24gPSBDU1JfR0VUX1NFU1NJT04oIHBNYWMsIGkgKTsKKworICAgICAgICAgICAgaWYgKE5VTEwgIT0gcFNlc3Npb24tPnBDdXJSb2FtUHJvZmlsZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAocFNlc3Npb24tPnBDdXJSb2FtUHJvZmlsZS0+Y3NyUGVyc29uYSA9PSBWT1NfUDJQX0NMSUVOVF9NT0RFKSB7CisgICAgICAgICAgICAgICAgICAgIGNvdW50UDJwQ2xpKys7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKHBTZXNzaW9uLT5wQ3VyUm9hbVByb2ZpbGUtPmNzclBlcnNvbmEgPT0gVk9TX1AyUF9HT19NT0RFKSB7CisgICAgICAgICAgICAgICAgICAgIGNvdW50UDJwR28rKzsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAocFNlc3Npb24tPnBDdXJSb2FtUHJvZmlsZS0+Y3NyUGVyc29uYSA9PSBWT1NfU1RBX1NBUF9NT0RFKSB7CisgICAgICAgICAgICAgICAgICAgIGNvdW50U0FQKys7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyogcmV0dXJuIFRSVUUgaWYgb25lIG9mIHRoZS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NYWMgKQoreworICAgIHRBTklfVTMyIGk7CisgICAgdEFOSV9CT09MRUFOIGZSYyA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKworICAgIGZvciggaSA9IDA7IGkgPCBDU1JfUk9BTV9TRVNTSU9OX01BWDsgaSsrICkKKyAgICB7CisgICAgICAgIGlmKCBDU1JfSVNfU0VTU0lPTl9WQUxJRCggcE1hYywgaSApICYmIGNzcklzQ29ublN0YXRlSWJzcyggcE1hYywgaSApICkKKyAgICAgICAgeworICAgICAgICAgICAgZlJjID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiAoIGZSYyApOworfQorCisKK3RBTklfQk9PTEVBTiBjc3JJc0JUQU1QU3RhcnRlZCggdHBBbmlTaXJHbG9iYWwgcE1hYyApCit7CisgICAgdEFOSV9VMzIgaTsKKyAgICB0QU5JX0JPT0xFQU4gZlJjID0gZUFOSV9CT09MRUFOX0ZBTFNFOworCisgICAgZm9yKCBpID0gMDsgaSA8IENTUl9ST0FNX1NFU1NJT05fTUFYOyBpKysgKQorICAgIHsKKyAgICAgICAgaWYoIENTUl9JU19TRVNTSU9OX1ZBTElEKCBwTWFjLCBpICkgJiYgY3NySXNDb25uU3RhdGVDb25uZWN0ZWRXZHMoIHBNYWMsIGkgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGZSYyA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gKCBmUmMgKTsKK30KKwordEFOSV9CT09MRUFOIGNzcklzQ29uY3VycmVudFNlc3Npb25SdW5uaW5nKCB0cEFuaVNpckdsb2JhbCBwTWFjICkKK3sKKyAgICB0QU5JX1UzMiBzZXNzaW9uSWQsIG5vT2ZDb2N1cnJlbnRTZXNzaW9uID0gMDsKKyAgICBlQ3NyQ29ubmVjdFN0YXRlIGNvbm5lY3RTd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YykKK3sKKyAgICB0Q3NyUm9hbVNlc3Npb24gKnBTZXNzaW9uID0gTlVMTDsKKyAgICBlQW5pQm9vbGVhbiBzdGF0dXMgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisKKyAgICAvL0NoZWNrIGZvciBNQ0Mgc3VwcG9ydAorICAgIGlmICghcE1hYy0+cm9hbS5jb25maWdQYXJhbS5mZW5hYmxlTUNDTW9kZSkKKyAgICB7CisgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgfQorCisgICAgLy9WYWxpZGF0ZSBCZWFjb25JbnRlcnZhbAorICAgIGlmKCBDU1JfSVNfU0VTU0lPTl9WQUxJRCggcE1hYywgc2Vzc2lvbklkICkgKQorICAgIHsKKyAgICAgICAgcFNlc3Npb24gPSBDU1JfR0VUX1NFU1NJT04oIHBNYWMsIHNlc3Npb25JZCApOworICAgICAgICBpZiAoTlVMTCAhPSBwU2Vzc2lvbi0+cEN1clJvYW1Qcm9maWxlKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoY3NySXNjb25jdXJyZW50c2Vzc2lvblZhbGlkIChwTWFjLCBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+cEN1clJvYW1Qcm9maWxlLT5jc3JQZXJzb25hKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gZUhBTF9TVEFUVVNfU1VDQ0VTUyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGNzclZhbGlkYXRlTUNDQmVhY29uSW50ZXJ2YWwoIHBNYWMsIHBCc3NEZXNjLT5jaGFubmVsSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBCc3NEZXNjLT5iZWFjb25JbnRlcnZhbCwgc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5wQ3VyUm9hbVByb2ZpbGUtPmNzclBlcnNvbmEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9CisKK3N0YXRpYyB0U2lyTWFjQ2FwYWJpbGl0eUluZm8gY3NyR2V0QnNzQ2FwYWJpbGl0aWVzKCB0U2lyQnNzRGVzY3JpcHRpb24gKnBTaXJCc3NEZXNjICkKK3sKKyAgICB0U2lyTWFjQ2FwYWJpbGl0eUluZm8gZG90MTFDYXBzOworCisgICAgLy90U2lyTWFjQ2FwYWJpbGl0eUluZm8gaXMgMTYtYml0CisgICAgcGFsX2dldF9VMTYoICh0QU5JX1U4ICopJnBTaXJCc3NEZXNjLT5jYXBhYmlsaXR5SW5mbywgKHRBTklfVTE2ICopJmRvdDExQ2FwcyApOworCisgICAgcmV0dXJuKCBkb3QxMUNhcHMgKTsKK30KKwordEFOSV9CT09MRUFOIGNzcklzSW5mcmFCc3NEZXNjKCB0U2lyQnNzRGVzY3JpcHRpb24gKnBTaXJCc3NEZXNjICkKK3sKKyAgICB0U2lyTWFjQ2FwYWJpbGl0eUluZm8gZG90MTFDYXBzID0gY3NyR2V0QnNzQ2FwYWJpbGl0aWVzKCBwU2lyQnNzRGVzYyApOworCisgICAgcmV0dXJuKCAodEFOSV9C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vdW5kLi4uCisgICAgdEFOSV9CT09MRUFOIGZXbWUgPSBUUlVFOworICAgIHREb3QxMWZCZWFjb25JRXMgKnBJZXNUZW1wID0gcEllczsKKworICAgIGRvCisgICAgeworICAgICAgICBpZihwSWVzVGVtcCA9PSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgICBpZiggIUhBTF9TVEFUVVNfU1VDQ0VTUyhjc3JHZXRQYXJzZWRCc3NEZXNjcmlwdGlvbklFcyhwTWFjLCBwU2lyQnNzRGVzYywgJnBJZXNUZW1wKSkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGZXbWUgPSBGQUxTRTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAvLyBpZiB0aGUgQWlyZ29Qcm9wcmlldGFyeSBpbmRpY2F0b3IgaXMgZm91bmQsIHRoZW4gV01FIGlzIHN1cHBvcnRlZC4uLgorICAgICAgICBpZiAoIGNzcklzQW5pV21lU3VwcG9ydGVkKCZwSWVzVGVtcC0+QWlyZ28pICkgYnJlYWs7CisgICAgICAgIC8vIGlmIHRoZSBXbWUgSW5mbyBJRSBpcyBmb3VuZCwgdGhlbiBXTUUgaXMgc3VwcG9ydGVkLi4uCisgICAgICAgIGlmICggQ1NSX0lTX1FPU19CU1MocEllc1RlbXApICkgYnJlYWs7CisgICAgICAgIC8vIGlmIG5vbmUgb2YgdGhlc2UgYXJlIGZvdW5kLCB0aGVuIFdNRSBpcyBOT1Qgc3VwcG9ydGVkLi4uCisgICAgICAgIGZXbWUgPSBGQUxTRTsKKyAgICB9IHdoaWxlKCAwICk7CisgICAgaWYoICFjc3JJc1dtbVN1cHBvcnRlZCggcE1hYyApICYmIGZXbWUpCisgICAgeworICAgICAgICBpZiggIXBJZXNUZW1wLT5IVENhcHMucHJlc2VudCApCisgICAgICAgIHsKKyAgICAgICAgICAgIGZXbWUgPSBGQUxTRTsKKyAgICAgICAgfQorICAgIH0KKyAgICBpZiggKCBwSWVzID09IE5VTEwgKSAmJiAoIE5VTEwgIT0gcEllc1RlbXAgKSApCisgICAgeworICAgICAgICAvL3dlIGFsbG9jYXRlIG1lbW9yeSBoZXJlIHNvIGZyZWUgaXQgYmVmb3JlIHJldHVybmluZworICAgICAgICB2b3NfbWVtX2ZyZWUocEllc1RlbXApOworICAgIH0KKworICAgIHJldHVybiggZldtZSApOworfQorCit0QU5JX0JPT0xFQU4gY3NySXNIY2ZFbmFibGVkKCB0RG90MTFmSUVBaXJnbyAqcEllQWlyZ28gKQoreworICAgIHRBTklfQk9PTEVBTiBmSGNmU3VwcG9ydGVkID0gRkFMU0U7CisKKyAgICBmSGNmU3VwcG9ydGVkID0gKCh0QU5JX0JPT0xFQU4pKFBST1BfQ0FQQUJJTElUWV9HRVQoIFdNRSwgcEllQWlyZ28tPlByb3BDYXBhYmlsaXR5LmNhcGFiaWxpdHkgKSkgfHwKKyAgICAgICAgKHBJZUFpcmdvLT5wcmVzZW50ICYmIHBJZUFpcmdvLT5IQ0YucHJlc2VudCAmJiBwSWVBaXJnby0+SENGLmVuYWJsZWQpKTsKKworICAgIHJldHVybiggZkhjZlN1cHBvcnRlZCApOworfQorCisKK2VDc3JNZWRpYUFjY2Vzc1R5cGUgY3NyR2V0UW9TRnJvbUJzc0Rlc2MoIHRIYWxIYW5kbGUgaEhhbCwgdFNpckJzc0Rlc2NyaXB0aW9uICpwU2lyQnNzRGVzYywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmQmVhY29uSUVzICpwSWVzICkKK3sKKyAgICBlQ3NyTWVkaWFBY2Nlc3NUeXBlIHFvc1R5cGUgPSBlQ1NSX01FRElVTV9BQ0NFU1NfRENGOworCisgICAgVk9TX0FTU0VSVCggcEllcyAhPSBOVUxMICk7CisKKyAgICBkbworICAgeworICAgICAgICAvLyBpZiB3ZSBmaW5kIFdNTSBpbiB0aGUgQnNzIERlc2NyaXB0aW9uLCB0aGVuIHdlIGxldCB0aGlzCisgICAgICAgIC8vIG92ZXJyaWRlIGFuZCB1c2UgV01NLgorICAgICAgICBpZiAoIGNzcklzQnNzRGVzY3JpcHRpb25XbWUoIGhIYWwsIHBTaXJCc3NEZXNjLCBwSWVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICBxb3NUeXBlID0gZUNTUl9NRURJVU1fQUNDRVNTX1dNTV9lRENGX0RTQ1A7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvLyBpZiB0aGUgUW9TIGJpdCBpcyBvbiwgdGhlbiB0aGUgQVAgaXMgYWR2ZXJ0aXNpbmcgMTFFIFFvUy4uLgorICAgICAgICAgICAgaWYgKCBjc3JJc1FvU0Jzc0Rlc2MoIHBTaXJCc3NEZXNjICkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIHdoaWNoIGNvdWxkIGJlIEhDRiBvciBlRENGLgorICAgICAgICAgICAgICAgICAgICBpZiAoIGNzcklzSGNmRW5hYmxlZCggJnBJZXMtPkFpcmdvICkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcW9zVHlwZSA9IGVDU1JfTUVESVVNX0FDQ0VTU18xMWVfSENGOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBxb3NUeXBlID0gZUNTUl9NRURJVU1fQUNDRVNTXzExZV9lRENGOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBxb3NUeXBlID0gZUNTUl9NRURJVU1fQUNDRVNTX0RDRjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIHNjYWxlIGJhY2sgYmFzZWQgb24gdGhlIHR5cGVzIHR1cm5lZCBvbiBmb3IgdGhlIGFkYXB0ZXIuLi4KKyAg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1Y3QpOworICAgICAgICAgICAgICAgICpwcElFU3RydWN0ID0gTlVMTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgRkwoIiBmYWlsZWQgdG8gYWxsb2NhdGUgbWVtb3J5IikgKTsKKyAgICAgICAgICAgIFZPU19BU1NFUlQoIDAgKTsKKyAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIChzdGF0dXMpOworfQorCitlSGFsU3RhdHVzIGNzclByb2Nlc3NHZXRGcmFtZUxvZ0NvbW1hbmQoIHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTbWVDbWQgKnBDb21tYW5kICkKK3sKKyAgIHRBbmlHZXRGcmFtZUxvZ1JlcSAqcE1zZzsKKyAgIHRBTklfVTE2IG1zZ0xlbjsKKyAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKworICAgbXNnTGVuID0gc2l6ZW9mKHRBbmlHZXRGcmFtZUxvZ1JlcSk7CisKKyAgIGlmICggTlVMTCA9PSBwQ29tbWFuZCApCisgICB7CisgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiY2Fubm90IHByb2Nlc3MuIGNtZCBpcyBudWxsIikgKTsKKyAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgIH0KKworICAgcE1zZyA9IHZvc19tZW1fbWFsbG9jKG1zZ0xlbik7CisgICBpZiAoIE5VTEwgPT0gcE1zZyApCisgICB7CisgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiZmFpbCB0byBhbGxvY2F0ZSBtZW1vcnkiKSApOworICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgfQorCisgICBwTXNnLT5tc2dUeXBlPSBwYWxfY3B1X3RvX2JlMTYoKHRBTklfVTE2KVdEQV9HRVRfRlJBTUVfTE9HX1JFUSk7CisgICBwTXNnLT5tc2dMZW49IHBhbF9jcHVfdG9fYmUxNihtc2dMZW4pOworCisgICBwTXNnLT5nZXRGcmFtZUxvZ0NtZEZsYWcgPSBwQ29tbWFuZC0+dS5nZXRGcmFtZWxvZ0NtZC5nZXRGcmFtZUxvZ0NtZEZsYWc7CisKKyAgIHN0YXR1cyA9IHBhbFNlbmRNQk1lc3NhZ2UocE1hYy0+aEhkZCwgcE1zZyk7CisKKyAgIHJldHVybiggc3RhdHVzICk7Cit9CisKK3RBTklfQk9PTEVBTiBjc3JJc05VTExTU0lEKCB0QU5JX1U4ICpwQnNzU3NpZCwgdEFOSV9VOCBsZW4gKQoreworICAgIHRBTklfQk9PTEVBTiBmTnVsbFNzaWQgPSBGQUxTRTsKKworICAgIHRBTklfVTMyIFNzaWRMZW5ndGg7CisgICAgdEFOSV9VOCAqcFNzaWRTdHI7CisKKyAgICBkbworICAgIHsKKyAgICAgICAgaWYgKCAwID09IGxlbiApCisgICAgICAgIHsKKyAgICAgICAgICAgIGZOdWxsU3NpZCA9IFRSVUU7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIC8vQ29uc2lkZXIgMCBvciBzcGFjZSBmb3IgaGlkZGVuIFNTSUQKKyAgICAgICAgaWYgKCAwID09IHBCc3NTc2lkWzBdICkKKyAgICAgICAgeworICAgICAgICAgICAgIGZOdWxsU3NpZCA9IFRSVUU7CisgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBTc2lkTGVuZ3RoID0gbGVuOworICAgICAgICBwU3NpZFN0ciA9IHBCc3NTc2lkOworCisgICAgICAgIHdoaWxlICggU3NpZExlbmd0aCApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKCAqcFNzaWRTdHIgKQorICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBwU3NpZFN0cisrOworICAgICAgICAgICAgU3NpZExlbmd0aC0tOworICAgICAgICB9CisKKyAgICAgICAgaWYoIDAgPT0gU3NpZExlbmd0aCApCisgICAgICAgIHsKKyAgICAgICAgICAgIGZOdWxsU3NpZCA9IFRSVUU7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgICB3aGlsZSggMCApOworCisgICAgcmV0dXJuIGZOdWxsU3NpZDsKK30KKworCit0QU5JX1UzMiBjc3JHZXRGcmFnVGhyZXNoKCB0SGFsSGFuZGxlIGhIYWwgKQoreworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVCggaEhhbCApOworCisgICAgcmV0dXJuIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uRnJhZ21lbnRhdGlvblRocmVzaG9sZDsKK30KKwordEFOSV9VMzIgY3NyR2V0UlRTVGhyZXNoKCB0SGFsSGFuZGxlIGhIYWwgKQoreworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVCggaEhhbCApOworCisgICAgcmV0dXJuIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uUlRTVGhyZXNob2xkOworfQorCitlQ3NyUGh5TW9kZSBjc3JUcmFuc2xhdGVUb1BoeU1vZGVGcm9tQnNzRGVzYyggdFNpckJzc0Rlc2NyaXB0aW9uICpwU2lyQnNzRGVzYyApCit7CisgICAgZUNzclBoeU1vZGUgcGh5TW9kZTsKKworICAgIHN3aXRjaCAoIHBTaXJCc3NEZXNjLT5ud1R5cGUgKQorICAgIHsKKyAgICAgICAgY2FzZSBlU0lSXzExQV9OV19UWVBFOgorICAgICAgICAgICAgcGh5TW9kZSA9IGVDU1JfRE9UMTFfTU9ERV8xMWE7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVTSVJfMTFCX05XX1RZUEU6CisgICAgICAgICAgICBwaHlNb2RlID0gZUNTUl9ET1QxMV9NT0RFXzExYjsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVNJUl8xMUdfTldfVFlQRToKKyAgICAgICAgICAgIHBoeU1vZGUgPSBlQ1NSX0RPVDExX01PREVfMTFnOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlU0lSXzExTl9OV19UWVBFOgorICAgICAgICAgICAgcGh5TW9kZSA9IGVDU1JfRE9UMTFfTU9ERV8xMW47CisgICAgICAgICAgICBicmVhazsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgICAgICBjYXNlIGVTSVJfMTFBQ19OV19UWVBFOgorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgcGh5TW9kZSA9IGVDU1JfRE9UMTFfTU9ERV8xMWFjOworI2Vsc2UKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIHBoeU1vZGUgPSBlQ1NSX0RPVDExX01PREVfMTFuOworI2VuZGlmCisgICAgICAgICAgICBicmVhazsKKyAgICB9CisgICAgcmV0dXJuKCBwaHlNb2RlICk7Cit9CisKKwordEFOSV9VMzIgY3NyVHJhbnNsYXRlVG9XTklDZmdEb3QxMU1vZGUodHBBbmlTaXJHbG9iYWwgcE1hYywgZUNzckNmZ0RvdDExTW9kZSBjc3JEb3QxMU1vZGUpCit7CisgICAgdEFOSV9VMzIgcmV0OworCisgICAgc3dpdGNoKGNzckRvdDExTW9kZSkKKyAgICB7CisgICAgY2FzZSBlQ1NSX0NGR19ET1QxMV9NT0RFX0FVVE86CisgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLCBGTCgiICBXYXJuaW5nOiBzZWVzIGVDU1JfQ0ZHX0RPVDExX01PREVfQVVUTyAiKSk7CisgICAgICAgIC8vV2UgY2Fubm90IGRlY2lkZSB1bnRpbCBub3cuCisgICAgICAgIGlmKHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uUHJvcHJpZXRhcnlSYXRlc0VuYWJsZWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIHJldCA9IFdOSV9DRkdfRE9UMTFfTU9ERV9UQVVSVVM7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisjaWZkZWYgV0xBTl9GRUFUVVJFXzExQUMKKyAgICAgICAgICAgIGlmICggSVNfRkVBVFVSRV9TVVBQT1JURURfQllfRFJJVkVSKERPVDExQUMpICYmCisgICAgICAgICAgICAgICAgICAgICBJU19GRUFUVVJFX1NVUFBPUlRFRF9CWV9GVyhET1QxMUFDKSkKKyAgICAgICAgICAgICAgICByZXQgPSBXTklfQ0ZHX0RPVDExX01PREVfMTFBQzsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICByZXQgPSBXTklfQ0ZHX0RPVDExX01PREVfMTFOOworI2Vsc2UKKyAgICAgICAgICAgIHJldCA9IFdOSV9DRkdfRE9UMTFfTU9ERV8xMU47CisjZW5kaWYKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICBjYXNlIGVDU1JfQ0ZHX0RPVDExX01PREVfVEFVUlVTOgorICAgICAgICByZXQgPSBXTklfQ0ZHX0RPVDExX01PREVfVEFVUlVTOworICAgICAgICBicmVhazsKKyAgICBjYXNlIGVDU1JfQ0ZHX0RPVDExX01PREVfMTFBOgorICAgICAgICByZXQgPSBXTklfQ0ZHX0RPVDExX01PREVfMTFBOworICAgICAgICBicmVhazsKKyAgICBjYXNlIGVDU1JfQ0ZHX0RPVDExX01PREVfMTFCOgorICAgICAgICByZXQgPSBXTklfQ0ZHX0RPVDExX01PREVfMTFCOworICAgICAgICBicmVhazsKKyAgICBjYXNlIGVDU1JfQ0ZHX0RPVDExX01PREVfMTFHOgorICAgICAgICByZXQgPSBXTklfQ0ZHX0RPVDExX01PREVfMTFHOworICAgICAgICBicmVhazsKKyAgICBjYXNlIGVDU1JfQ0ZHX0RPVDExX01PREVfMTFOOgorICAgICAgICByZXQgPSBXTklfQ0ZHX0RPVDExX01PREVfMTFOOworICAgICAgICBicmVhazsKKyAgICBjYXNlIGVDU1JfQ0ZHX0RPVDExX01PREVfUE9MQVJJUzoKKyAgICAgICAgcmV0ID0gV05JX0NGR19ET1QxMV9NT0RFX1BPTEFSSVM7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgZUNTUl9DRkdfRE9UMTFfTU9ERV9USVRBTjoKKyAgICAgICAgcmV0ID0gV05JX0NGR19ET1QxMV9NT0RFX1RJVEFOOworICAgICAgICBicmVhazsKKyAgICBjYXNlIGVDU1JfQ0ZHX0RPVDExX01PREVfMTFHX09OTFk6CisgICAgICAgIHJldCA9IFdOSV9DRkdfRE9UMTFfTU9ERV8xMUdfT05MWTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExTl9PTkxZOgorICAgICAgICByZXQgPSBXTklfQ0ZHX0RPVDExX01PREVfMTFOX09OTFk7CisgICAgICAgIGJyZWFrOworCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExQUMKKyAgICBjYXNlIGVDU1JfQ0ZHX0RPVDExX01PREVfMTFBQ19PTkxZOgorICAgICAgICBpZiAoIElTX0ZFQVRVUkVfU1VQUE9SVEVEX0JZX0RSSVZFUihET1QxMUFDKSAmJgorICAgICAgICAgICAgIElTX0ZFQVRVUkVfU1VQUE9SVEVEX0JZX0ZXKERPVDExQUMpKQorICAgICAgICAgICAgcmV0ID0gV05JX0NGR19ET1QxMV9NT0RFXzExQUNfT05MWTsKKyAgICAgICAgZWxzZQorICAgICAgICAgICAgcmV0ID0gV05JX0NGR19ET1QxMV9NT0RFXzExTjsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQUM6CisgICAgICAgIGlmICggSVNfRkVBVFVSRV9TVVBQT1JURURfQllfRFJJVkVSKERPVDExQUMpICYmCisgICAgICAgICAgICAgSVNfRkVBVFVSRV9TVVBQT1JURURfQllfRlcoRE9UMTFBQykpCisgICAgICAgICAgICAgcmV0ID0gV05JX0NGR19ET1QxMV9NT0RFXzExQUM7CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHJldCA9IFdOSV9DRkdfRE9UMTFfTU9ERV8xMU47CisgICAgICAgIGJyZWFrOworI2VuZGlmCisgICAgZGVmYXVsdDoKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR1csIEZMKCJkb2Vzbid0IGV4cGVjdCAlZCBhcyBjc3JEbzExTW9kZSIpLCBjc3JEb3QxMU1vZGUpOworICAgICAgICBpZihlQ1NSX0JBTkRfMjQgPT0gcE1hYy0+cm9hbS5jb25maWdQYXJhbS5lQmFuZCkKKyAgICAgICAgeworICAgICAgICAgICAgcmV0ID0gV05JX0NGR19ET1QxMV9NT0RFXzExRzsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHJldCA9IFdOSV9DRkdfRE9UMTFfTU9ERV8xMUE7CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgcmV0dXJuIChyZXQpOworfQorCisKKy8vVGhpcyBmdW5jdGlvbiBzaG91bGQgb25seSByZXR1cm4gdGhlIHN1cGVyIHNldCBvZiBzdXBwb3J0ZWQgbW9kZXMuIDExbiBpbXBsaWVzIDExYi9nL2Evbi4KK2VIYWxTdGF0dXMgY3NyR2V0UGh5TW9kZUZyb21Cc3ModHBBbmlTaXJHbG9iYWwgcE1hYywgdFNpckJzc0Rlc2NyaXB0aW9uICpwQlNTRGVzY3JpcHRpb24sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ3NyUGh5TW9kZSAqcFBoeU1vZGUsIHREb3QxMWZCZWFjb25JRXMgKnBJZXMpCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIGVDc3JQaHlNb2RlIHBoeU1vZGUgPSBjc3JUcmFuc2xhdGVUb1BoeU1vZGVGcm9tQnNzRGVzYyhwQlNTRGVzY3JpcHRpb24pOworCisgICAgaWYoIHBJZXMgKQorICAgIHsKKyAgICAgICAgaWYocEllcy0+QWlyZ28ucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgaWYocEllcy0+QWlyZ28uUHJvcENhcGFiaWxpdHkucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiggUFJPUF9DQVBBQklMSVRZX0dFVCggVEFVUlVTLCBwSWVzLT5BaXJnby5Qcm9wQ2FwYWJpbGl0eS5jYXBhYmlsaXR5ICkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwaHlNb2RlID0gZUNTUl9ET1QxMV9NT0RFX1RBVVJVUzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYocEllcy0+SFRDYXBzLnByZXNlbnQgJiYgKGVDU1JfRE9UMTFfTU9ERV9UQVVSVVMgIT0gcGh5TW9kZSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBoeU1vZGUgPSBlQ1NSX0RPVDExX01PREVfMTFuOworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisgICAgICAgICAgICBpZiAoSVNfQlNTX1ZIVF9DQVBBQkxFKHBJZXMtPlZIVENhcHMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBoeU1vZGUgPSBlQ1NSX0RPVDExX01PREVfMTFhYzsKKyAgICAgICAgICAgIH0KKyNlbmRpZgorICAgICAgICB9CisgICAgICAgICpwUGh5TW9kZSA9IHBoeU1vZGU7CisgICAgfQorCisgICAgcmV0dXJuIChzdGF0dXMpOworCit9CisKKworLy9UaGlzIGZ1bmN0aW9uIHJldHVybnMgdGhlIGNvcnJlY3QgZUNTUl9DRkdfRE9UMTFfTU9ERSBpcyB0aGUgdHdvIHBoeU1vZGVzIG1hdGNoZXMKKy8vYnNzUGh5TW9kZSBpcyB0aGUgbW9kZSBkZXJpdmVkIGZyb20gdGhlIEJTUyBkZXNjcmlwdGlvbgorLy9mNUdoekJhbmQgaXMgZGVyaXZlZCBmcm9tIHRoZSBjaGFubmVsIGlkIG9mIEJTUyBkZXNjcmlwdGlvbgordEFOSV9CT09MRUFOIGNzckdldFBoeU1vZGVJblVzZSggZUNzclBoeU1vZGUgcGh5TW9kZUluLCBlQ3NyUGh5TW9kZSBic3NQaHlNb2RlLCB0QU5JX0JPT0xFQU4gZjVHaHpCYW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNzckNmZ0RvdDExTW9kZSAqcENmZ0RvdDExTW9kZVRvVXNlICkKK3sKKyAgICB0QU5JX0JPT0xFQU4gZk1hdGNoID0gRkFMU0U7CisgICAgZUNzckNmZ0RvdDExTW9kZSBjZmdEb3QxMU1vZGU7CisKKyAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExTjsgLy8gdG8gc3VwcHJlc3MgY29tcGlsZXIgd2FybmluZworCisgICAgc3dpdGNoKCBwaHlNb2RlSW4gKQorICAgIHsKKyAgICAgICAgY2FzZSBlQ1NSX0RPVDExX01PREVfYWJnOiAgIC8vMTFhIG9yIDExYiBvciAxMWcKKyAgICAgICAgICAgIGlmKCBmNUdoekJhbmQgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGZNYXRjaCA9IFRSVUU7CisgICAgICAgICAgICAgICAgY2ZnRG90MTFNb2RlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKCBlQ1NSX0RPVDExX01PREVfMTFiID09IGJzc1BoeU1vZGUgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGZNYXRjaCA9IFRSVUU7CisgICAgICAgICAgICAgICAgY2ZnRG90MTFNb2RlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZk1hdGNoID0gVFJVRTsKKyAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExRzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUNTUl9ET1QxMV9NT0RFXzExYTogICAvLzExYQorICAgICAgICAgICAgaWYoIGY1R2h6QmFuZCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZk1hdGNoID0gVFJVRTsKKyAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUNTUl9ET1QxMV9NT0RFXzExYV9PTkxZOiAgIC8vMTFhCisgICAgICAgICAgICBpZiggZUNTUl9ET1QxMV9NT0RFXzExYSA9PSBic3NQaHlNb2RlICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBmTWF0Y2ggPSBUUlVFOworICAgICAgICAgICAgICAgIGNmZ0RvdDExTW9kZSA9IGVDU1JfQ0ZHX0RPVDExX01PREVfMTFBOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlQ1NSX0RPVDExX01PREVfMTFnOgorICAgICAgICAgICAgaWYoIWY1R2h6QmFuZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiggZUNTUl9ET1QxMV9NT0RFXzExYiA9PSBic3NQaHlNb2RlICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGZNYXRjaCA9IFRSVUU7CisgICAgICAgICAgICAgICAgICAgIGNmZ0RvdDExTW9kZSA9IGVDU1JfQ0ZHX0RPVDExX01PREVfMTFCOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBmTWF0Y2ggPSBUUlVFOworICAgICAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExRzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVDU1JfRE9UMTFfTU9ERV8xMWdfT05MWToKKyAgICAgICAgICAgIGlmKCBlQ1NSX0RPVDExX01PREVfMTFnID09IGJzc1BoeU1vZGUgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGZNYXRjaCA9IFRSVUU7CisgICAgICAgICAgICAgICAgY2ZnRG90MTFNb2RlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUc7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVDU1JfRE9UMTFfTU9ERV8xMWI6CisgICAgICAgICAgICBpZiggIWY1R2h6QmFuZCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZk1hdGNoID0gVFJVRTsKKyAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUNTUl9ET1QxMV9NT0RFXzExYl9PTkxZOgorICAgICAgICAgICAgaWYoIGVDU1JfRE9UMTFfTU9ERV8xMWIgPT0gYnNzUGh5TW9kZSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZk1hdGNoID0gVFJVRTsKKyAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZUNTUl9ET1QxMV9NT0RFXzExbjoKKyAgICAgICAgICAgIGZNYXRjaCA9IFRSVUU7CisgICAgICAgICAgICBzd2l0Y2goYnNzUGh5TW9kZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgIGNhc2UgZUNTUl9ET1QxMV9NT0RFXzExZzoKKyAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExRzsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNTUl9ET1QxMV9NT0RFXzExYjoKKyAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNTUl9ET1QxMV9NT0RFXzExYToKKyAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNTUl9ET1QxMV9NT0RFXzExbjoKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgICAgICAgICAgY2FzZSBlQ1NSX0RPVDExX01PREVfMTFhYzoKKyNlbmRpZgorICAgICAgICAgICAgICAgIGNmZ0RvdDExTW9kZSA9IGVDU1JfQ0ZHX0RPVDExX01PREVfMTFOOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIGVDU1JfRE9UMTFfTU9ERV9UQVVSVVM6CisgICAgICAgICAgICBkZWZhdWx0OgorI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisgICAgICAgICAgICAgICAgY2ZnRG90MTFNb2RlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUFDOworI2Vsc2UKKyAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExTjsKKyNlbmRpZgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlQ1NSX0RPVDExX01PREVfMTFuX09OTFk6CisgICAgICAgICAgICBpZigoZUNTUl9ET1QxMV9NT0RFXzExbiA9PSBic3NQaHlNb2RlKSB8fCAoZUNTUl9ET1QxMV9NT0RFX1RBVVJVUyA9PSBic3NQaHlNb2RlKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBmTWF0Y2ggPSBUUlVFOworICAgICAgICAgICAgICAgIGNmZ0RvdDExTW9kZSA9IGVDU1JfQ0ZHX0RPVDExX01PREVfMTFOOworCisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGJyZWFrOworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisgICAgICAgIGNhc2UgZUNTUl9ET1QxMV9NT0RFXzExYWM6CisgICAgICAgICAgICBmTWF0Y2ggPSBUUlVFOworICAgICAgICAgICAgc3dpdGNoKGJzc1BoeU1vZGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICBjYXNlIGVDU1JfRE9UMTFfTU9ERV8xMWc6CisgICAgICAgICAgICAgICAgY2ZnRG90MTFNb2RlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUc7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDU1JfRE9UMTFfTU9ERV8xMWI6CisgICAgICAgICAgICAgICAgY2ZnRG90MTFNb2RlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUI7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDU1JfRE9UMTFfTU9ERV8xMWE6CisgICAgICAgICAgICAgICAgY2ZnRG90MTFNb2RlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUE7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDU1JfRE9UMTFfTU9ERV8xMW46CisgICAgICAgICAgICAgICAgY2ZnRG90MTFNb2RlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV8xMU47CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDU1JfRE9UMTFfTU9ERV8xMWFjOgorICAgICAgICAgICAgY2FzZSBlQ1NSX0RPVDExX01PREVfVEFVUlVTOgorICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQUM7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVDU1JfRE9UMTFfTU9ERV8xMWFjX09OTFk6CisgICAgICAgICAgICBpZigoZUNTUl9ET1QxMV9NT0RFXzExYWMgPT0gYnNzUGh5TW9kZSkgfHwgKGVDU1JfRE9UMTFfTU9ERV9UQVVSVVMgPT0gYnNzUGh5TW9kZSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZk1hdGNoID0gVFJVRTsKKyAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQUM7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyNlbmRpZgorCisgICAgICAgIGNhc2UgZUNTUl9ET1QxMV9NT0RFX1RBVVJVUzoKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGZNYXRjaCA9IFRSVUU7CisgICAgICAgICAgICBzd2l0Y2goYnNzUGh5TW9kZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgIGNhc2UgZUNTUl9ET1QxMV9NT0RFXzExZzoKKyAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExRzsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNTUl9ET1QxMV9NT0RFXzExYjoKKyAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNTUl9ET1QxMV9NT0RFXzExYToKKyAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNTUl9ET1QxMV9NT0RFXzExbjoKKyAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExTjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgICAgICAgICAgY2FzZSBlQ1NSX0RPVDExX01PREVfMTFhYzoKKyAgICAgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQUM7CisgICAgICAgICAgICAgICAgYnJlYWs7CisjZW5kaWYKKyAgICAgICAgICAgIGNhc2UgZUNTUl9ET1QxMV9NT0RFX1RBVVJVUzoKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgY2ZnRG90MTFNb2RlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV9UQVVSVVM7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICBpZiAoIGZNYXRjaCAmJiBwQ2ZnRG90MTFNb2RlVG9Vc2UgKQorICAgIHsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgICAgICBpZihjZmdEb3QxMU1vZGUgPT0gZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUFDICYmICghSVNfRkVBVFVSRV9TVVBQT1JURURfQllfRlcoRE9UMTFBQykpKQorICAgICAgICB7CisgICA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UKKyAgICAgICAgICAgICAgICB7CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgICAgICAgICAgICAgICAgICBwaHlNb2RlID0gZUNTUl9ET1QxMV9NT0RFXzExYWM7CisjZWxzZQorICAgICAgICAgICAgICAgICAgICBwaHlNb2RlID0gZUNTUl9ET1QxMV9NT0RFXzExbjsKKyNlbmRpZgorCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vdXNlcidzIHBpY2sKKyAgICAgICAgICAgICAgICBwaHlNb2RlID0gcE1hYy0+cm9hbS5jb25maWdQYXJhbS5waHlNb2RlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmICggKDAgPT0gcGh5TW9kZSkgfHwgKGVDU1JfRE9UMTFfTU9ERV9BVVRPICYgcGh5TW9kZSkgfHwgKGVDU1JfRE9UMTFfTU9ERV9UQVVSVVMgJiBwaHlNb2RlKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKDAgIT0gcGh5TW9kZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZihlQ1NSX0RPVDExX01PREVfQVVUTyAmIHBoeU1vZGUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwaHlNb2RlMiA9IGVDU1JfRE9UMTFfTU9ERV9BVVRPICYgcGh5TW9kZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcGh5TW9kZTIgPSBlQ1NSX0RPVDExX01PREVfVEFVUlVTICYgcGh5TW9kZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcGh5TW9kZTIgPSBwaHlNb2RlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZk1hdGNoID0gY3NyR2V0UGh5TW9kZUluVXNlKCBwaHlNb2RlMiwgcGh5TW9kZUluQnNzRGVzYywgQ1NSX0lTX0NIQU5ORUxfNUdIWihwU2lyQnNzRGVzYy0+Y2hhbm5lbElkKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZjZmdEb3QxMU1vZGVUb1VzZSApOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgYml0TWFzayA9IDE7CisgICAgICAgICAgICBsb29wQ291bnQgPSAwOworICAgICAgICAgICAgd2hpbGUobG9vcENvdW50IDwgZUNTUl9OVU1fUEhZX01PREUpICAgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoMCAhPSAoIHBoeU1vZGUyID0gKHBoeU1vZGUgJiAoYml0TWFzayA8PCBsb29wQ291bnQrKykpICkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBmTWF0Y2ggPSBjc3JHZXRQaHlNb2RlSW5Vc2UoIHBoeU1vZGUyLCBwaHlNb2RlSW5Cc3NEZXNjLCBDU1JfSVNfQ0hBTk5FTF81R0haKHBTaXJCc3NEZXNjLT5jaGFubmVsSWQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZjZmdEb3QxMU1vZGVUb1VzZSApOworICAgICAgICAgICAgICAgICAgICBpZihmTWF0Y2gpIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAoIGZNYXRjaCAmJiBwUmV0dXJuQ2ZnRG90MTFNb2RlICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYoIHBQcm9maWxlICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBJRUVFIDExbiBzcGVjICg4LjQuMyk6IEhUIFNUQSBzaGFsbCBlbGltaW5hdGUgVEtJUCBhcyBhIAorICAgICAgICAgICAgICAgICAqIGNob2ljZSBmb3IgdGhlIHBhaXJ3aXNlIGNpcGhlciBzdWl0ZSBpZiBDQ01QIGlzIGFkdmVydGlzZWQgCisgICAgICAgICAgICAgICAgICogYnkgdGhlIEFQIG9yIGlmIHRoZSBBUCBpbmNsdWRlZCBhbiBIVCBjYXBhYmlsaXRpZXMgZWxlbWVudCAKKyAgICAgICAgICAgICAgICAgKiBpbiBpdHMgQmVhY29ucyBhbmQgUHJvYmUgUmVzcG9uc2UuCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgaWYoICghQ1NSX0lTXzExbl9BTExPV0VEKCBwUHJvZmlsZS0+bmVnb3RpYXRlZFVDRW5jcnlwdGlvblR5cGUgKSkgJiYKKyAgICAgICAgICAgICAgICAgICAgKChlQ1NSX0NGR19ET1QxMV9NT0RFXzExTiA9PSBjZmdEb3QxMU1vZGVUb1VzZSkgfHwKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgICAgICAgICAgICAgICAgICAgKGVDU1JfQ0ZHX0RPVDExX01PREVfMTFBQyA9PSBjZmdEb3QxMU1vZGVUb1VzZSkgfHwKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgKGVDU1JfQ0ZHX0RPVDExX01PREVfVEFVUlVTID09IGNmZ0RvdDExTW9kZVRvVXNlKSkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy9XZSBjYW5ub3QgZG8gMTFuIGhlcmUKKyAgICAgICAgICAgICAgICAgICAgaWYoICFDU1JfSVNfQ0hBTk5FTF81R0haKHBTaXJCc3NEZXNjLT5jaGFubmVsSWQpICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgY2ZnRG90MTFNb2RlVG9Vc2UgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExRzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNmZ0RvdDExTW9kZVRvVXNlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUE7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAqcFJldHVybkNmZ0RvdDExTW9kZSA9IGNmZ0RvdDExTW9kZVRvVXNlOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuKCBmTWF0Y2ggKTsKK30KKworCitlQ3NyQ2ZnRG90MTFNb2RlIGNzckZpbmRCZXN0UGh5TW9kZSggdHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMzIgcGh5TW9kZSApCit7CisgICAgZUNzckNmZ0RvdDExTW9kZSBjZmdEb3QxMU1vZGVUb1VzZTsKKyAgICBlQ3NyQmFuZCBlQmFuZCA9IHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uZUJhbmQ7CisKKworICAgIGlmICgoMCA9PSBwaHlNb2RlKSB8fAorI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisgICAgICAgIChlQ1NSX0RPVDExX01PREVfMTFhYyAmIHBoeU1vZGUpIHx8CisjZW5kaWYKKyAgICAgICAgKGVDU1JfRE9UMTFfTU9ERV9BVVRPICYgcGh5TW9kZSkpCisgICAgeworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisgICAgICAgIGlmIChJU19GRUFUVVJFX1NVUFBPUlRFRF9CWV9GVyhET1QxMUFDKSkKKyAgICAgICAgeworICAgICAgICAgICBjZmdEb3QxMU1vZGVUb1VzZSA9IGVDU1JfQ0ZHX0RPVDExX01PREVfMTFBQzsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisjZW5kaWYKKyAgICAgICAgeworICAgICAgICAgICAvKiBEZWZhdWx0IHRvIDExTiBtb2RlIGlmIHVzZXIgaGFzIGNvbmZpZ3VyZWQgMTFhYyBtb2RlCisgICAgICAgICAgICAqIGFuZCBGVyBkb2Vzbid0IHN1cHBvcnRzIDExYWMgbW9kZSAuCisgICAgICAgICAgICAqLworICAgICAgICAgICBjZmdEb3QxMU1vZGVUb1VzZSA9IGVDU1JfQ0ZHX0RPVDExX01PREVfMTFOOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGlmKCAoIGVDU1JfRE9UMTFfTU9ERV8xMW4gfCBlQ1NSX0RPVDExX01PREVfMTFuX09OTFkgKSAmIHBoeU1vZGUgKQorICAgICAgICB7CisgICAgICAgICAgICBjZmdEb3QxMU1vZGVUb1VzZSA9IGVDU1JfQ0ZHX0RPVDExX01PREVfMTFOOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKCBlQ1NSX0RPVDExX01PREVfYWJnICYgcGh5TW9kZSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKCBlQ1NSX0JBTkRfMjQgIT0gZUJhbmQgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNmZ0RvdDExTW9kZVRvVXNlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2ZnRG90MTFNb2RlVG9Vc2UgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExRzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmKCAoIGVDU1JfRE9UMTFfTU9ERV8xMWEgfCBlQ1NSX0RPVDExX01PREVfMTFhX09OTFkgKSAmIHBoeU1vZGUgKQorICAgICAgICB7CisgICAgICAgICAgICBjZmdEb3QxMU1vZGVUb1VzZSA9IGVDU1JfQ0ZHX0RPVDExX01PREVfMTFBOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYoICggZUNTUl9ET1QxMV9NT0RFXzExZyB8IGVDU1JfRE9UMTFfTU9ERV8xMWdfT05MWSApICYgcGh5TW9kZSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGNmZ0RvdDExTW9kZVRvVXNlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUc7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBjZmdEb3QxMU1vZGVUb1VzZSA9IGVDU1JfQ0ZHX0RPVDExX01PREVfMTFCOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuICggY2ZnRG90MTFNb2RlVG9Vc2UgKTsKK30KKworCisKKwordEFOSV9VMzIgY3NyR2V0MTFoUG93ZXJDb25zdHJhaW50KCB0SGFsSGFuZGxlIGhIYWwsIHREb3QxMWZJRVBvd2VyQ29uc3RyYWludHMgKnBQb3dlckNvbnN0cmFpbnQgKQoreworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVCggaEhhbCApOworICAgIHRBTklfVTMyIGxvY2FsUG93ZXJDb25zdHJhaW50ID0gMDsKKworICAgIC8vIGNoZWNrIGlmIC4xMWggc3VwcG9ydCBpcyBlbmFibGVkLCBpZiBub3QsIHRoZSBwb3dlciBjb25zdHJhaW50IGlzIDAuCisgICAgaWYocE1hYy0+cm9hbS5jb25maWdQYXJhbS5JczExaFN1cHBvcnRFbmFibGVkICYmIHBQb3dlckNvbnN0cmFpbnQtPnByZXNlbnQpCisgICAgeworICAgICAgICBsb2NhbFBvd2VyQ29uc3RyYWludCA9IHBQb3dlckNvbnN0cmFpbnQtPmxvY2FsUG93ZXJDb25zdHJhaW50czsKKyAgICB9CisKKyAgICByZXR1cm4oIGxvY2FsUG93ZXJDb25zdHJhaW50ICk7Cit9CisKKwordEFOSV9CT09MRUFOIGNzcklzUHJvZmlsZVdwYSggdENzclJvYW1Qcm9maWxlICpwUHJvZmlsZSApCit7CisgICAgdEFOSV9CT09MRUFOIGZXcGFQcm9maWxlID0gRkFMU0U7CisKKyAgICBzd2l0Y2ggKCBwUHJvZmlsZS0+bmVnb3RpYXRlZEF1dGhUeXBlICkKKyAgICB7CisgICAgICAgIGNhc2UgZUNTUl9BVVRIX1RZUEVfV1BBOgorICAgICAgICBjYXNlIGVDU1JfQVVUSF9UWVBFX1dQQV9QU0s6CisgICAgICAgIGNhc2UgZUNTUl9BVVRIX1RZUEVfV1BBX05PTkU6CisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRQorICAgICAgICBjYXNlIGVDU1JfQVVUSF9UWVBFX0NDS01fV1BBOgorI2VuZGlmCisgICAgICAgICAgICBmV3BhUHJvZmlsZSA9IFRSVUU7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgZldwYVByb2ZpbGUgPSBGQUxTRTsKKyAgICAgICAgICAgIGJyZWFrOworICAgIH0KKworICAgIGlmICggZldwYVByb2ZpbGUgKQorICAgIHsKKyAgICAgICAgc3dpdGNoICggcFByb2ZpbGUtPm5lZ290aWF0ZWRVQ0VuY3J5cHRpb25UeXBlICkKKyAgICAgICAgeworICAgICAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVA0MDoKKyAgICAgICAgICAgIGNhc2UgZUNTUl9FTkNSWVBUX1RZUEVfV0VQMTA0OgorICAgICAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9US0lQOgorICAgICAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9BRVM6CisgICAgICAgICAgICAgICAgZldwYVByb2ZpbGUgPSBUUlVFOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIGZXcGFQcm9maWxlID0gRkFMU0U7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuKCBmV3BhUHJvZmlsZSApOworfQorCit0QU5JX0JPT0xFQU4gY3NySXNQcm9maWxlUlNOKCB0Q3NyUm9hbVByb2ZpbGUgKnBQcm9maWxlICkKK3sKKyAgICB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gcXVhbGlmeQorICAgICAgICAgICAgLy8gZXZlbiBpZiBlbmNyeXB0aW9uIHR5cGUgaXMgV0VQIG9yIFRLSVAKKyAgICAgICAgICAgIGNhc2UgZUNTUl9FTkNSWVBUX1RZUEVfV0VQNDA6CisgICAgICAgICAgICBjYXNlIGVDU1JfRU5DUllQVF9UWVBFX1dFUDEwNDoKKyAgICAgICAgICAgIGNhc2UgZUNTUl9FTkNSWVBUX1RZUEVfVEtJUDoKKyAgICAgICAgICAgIGNhc2UgZUNTUl9FTkNSWVBUX1RZUEVfQUVTOgorICAgICAgICAgICAgICAgIGZSU05Qcm9maWxlID0gVFJVRTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBmUlNOUHJvZmlsZSA9IEZBTFNFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiggZlJTTlByb2ZpbGUgKTsKK30KKworZUhhbFN0YXR1cworY3NySXNjb25jdXJyZW50c2Vzc2lvblZhbGlkKHRwQW5pU2lyR2xvYmFsIHBNYWMsdEFOSV9VMzIgY3Vyc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFZPU19DT05fTU9ERSBjdXJyQnNzUGVyc29uYSkKK3sKKyAgICB0QU5JX1UzMiBzZXNzaW9uSWQgPSAwOworCisgICAgZm9yIChzZXNzaW9uSWQgPSAwOyBzZXNzaW9uSWQgPCBDU1JfUk9BTV9TRVNTSU9OX01BWDsgc2Vzc2lvbklkKysgKQorICAgIHsKKyAgICAgICAgaWYgKGN1cnNlc3Npb25JZCAhPSBzZXNzaW9uSWQgKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoIUNTUl9JU19TRVNTSU9OX1ZBTElEKCBwTWFjLCBzZXNzaW9uSWQgKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc3dpdGNoIChjdXJyQnNzUGVyc29uYSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjYXNlIFZPU19TVEFfTU9ERToKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzQsIEZMKCIgU2Vjb25kIHNlc3Npb24gZm9yIHBlcnNvbmEgJWQiKSwgY3VyckJzc1BlcnNvbmEpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIFZPU19TVEFfU0FQX01PREU6CisgICAgICAgICAgICAgICAgICAgIGlmKChwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0uYnNzUGFyYW1zLmJzc1BlcnNvbmEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gVk9TX1NUQV9TQVBfTU9ERSkmJgorICAgICAgICAgICAgICAgICAgICAgICAocE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLmNvbm5lY3RTdGF0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBlQ1NSX0FTU09DX1NUQVRFX1RZUEVfTk9UX0NPTk5FQ1RFRCkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiICoqKipTb2Z0QVAgbW9kZSBhbHJlYWR5IGV4aXN0cyAqKioqIikpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiggKHBNYWMtPnJvYW0ucm9hbVNlc3Npb25bc2Vzc2lvbklkXS5ic3NQYXJhbXMuYnNzUGVyc29uYQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSBWT1NfUDJQX0dPX01PREUgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0ucm9hbVNlc3Npb25bc2Vzc2lvbklkXS5jb25uZWN0U3RhdGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gZUNTUl9BU1NPQ19TVEFURV9UWVBFX05PVF9DT05ORUNURUQpIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0uYnNzUGFyYW1zLmJzc1BlcnNvbmEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gVk9TX0lCU1NfTU9ERSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLmNvbm5lY3RTdGF0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBlQ1NSX0FTU09DX1NUQVRFX1RZUEVfSUJTU19ESVNDT05ORUNURUQpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiAqKioqQ2Fubm90IHN0YXJ0IE11bHRpcGxlIEJlYWNvbmluZyBSb2xlICoqKioiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgVk9TX1AyUF9DTElFTlRfTU9ERToKKyAgICAgICAgICAgICAgICAgICAgaWYocE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLnBDdXJSb2FtUHJvZmlsZSAmJgorICAgICAgICAgICAgICAgICAgICAgIChwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0ucEN1clJvYW1Qcm9maWxlLT5jc3JQZXJzb25hCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IFZPU19QMlBfQ0xJRU5UX01PREUpKSAvL2NoZWNrIGZvciBQMlAgY2xpZW50IG1vZGUKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgKioqKkNMSUVOVCBtb2RlIGFscmVhZHkgZXhpc3RzICoqKioiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgVk9TX1AyUF9HT19NT0RFOgorICAgICAgICAgICAgICAgICAgICBpZigocE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLmJzc1BhcmFtcy5ic3NQZXJzb25hCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IFZPU19QMlBfR09fTU9ERSkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgKHBNYWMtPnJvYW0ucm9hbVNlc3Npb25bc2Vzc2lvbklkXS5jb25uZWN0U3RhdGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gZUNTUl9BU1NPQ19TVEFURV9UWVBFX05PVF9DT05ORUNURUQpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiAqKioqUDJQIEdPIG1vZGUgYWxyZWFkeSBleGlzdHMgKioqKiIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoIChwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0uYnNzUGFyYW1zLmJzc1BlcnNvbmEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gVk9TX1NUQV9TQVBfTU9ERSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLmNvbm5lY3RTdGF0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBlQ1NSX0FTU09DX1NUQVRFX1RZUEVfTk9UX0NPTk5FQ1RFRCkgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBNYWMtPnJvYW0ucm9hbVNlc3Npb25bc2Vzc2lvbklkXS5ic3NQYXJhbXMuYnNzUGVyc29uYQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSBWT1NfSUJTU19NT0RFICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0uY29ubmVjdFN0YXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICE9IGVDU1JfQVNTT0NfU1RBVEVfVFlQRV9JQlNTX0RJU0NPTk5FQ1RFRCkgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiAqKioqQ2Fubm90IHN0YXJ0IE11bHRpcGxlIEJlYWNvbmluZyBSb2xlICoqKioiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFZPU19JQlNTX01PREU6CisgICAgICAgICAgICAgICAgICAgIGlmKChwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0uYnNzUGFyYW1zLmJzc1BlcnNvbmEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gVk9TX0lCU1NfTU9ERSkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgKHBNYWMtPnJvYW0ucm9hbVNlc3Npb25bc2Vzc2lvbklkXS5jb25uZWN0U3RhdGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gZUNTUl9BU1NPQ19TVEFURV9UWVBFX0lCU1NfQ09OTkVDVEVEKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgKioqKklCU1MgbW9kZSBhbHJlYWR5IGV4aXN0cyAqKioqIikpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiggKHBNYWMtPnJvYW0ucm9hbVNlc3Npb25bc2Vzc2lvbklkXS5ic3NQYXJhbXMuYnNzUGVyc29uYQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSBWT1NfUDJQX0dPX01PREUgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0ucm9hbVNlc3Npb25bc2Vzc2lvbklkXS5ic3NQYXJhbXMuYnNzUGVyc29uYQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSBWT1NfU1RBX1NBUF9NT0RFKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLmNvbm5lY3RTdGF0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICE9IGVDU1JfQVNTT0NfU1RBVEVfVFlQRV9OT1RfQ09OTkVDVEVEKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiAqKioqQ2Fubm90IHN0YXJ0IE11bHRpcGxlIEJlYWNvbmluZyBSb2xlICoqKioiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBkZWZhdWx0IDoKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIqKipQZXJzb25hIG5vdCBoYW5kbGVkID0gJWQqKioqKiIpLGN1cnJCc3NQZXJzb25hKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisKK30KKworZUhhbFN0YXR1cyBjc3JVcGRhdGVNQ0NwMnBCZWFjb25JbnRlcnZhbCh0cEFuaVNpckdsb2JhbCBwTWFjKQoreworICAgIHRBTklfVTMyIHNlc3Npb25JZCA9IDA7CisKKyAgICAvL0lmIE1DQyBpcyBub3Qgc3VwcG9ydGVkIGp1c3QgYnJlYWsgYW5kIHJldHVybiBTVUNDRVNTCisgICAgaWYgKCAhcE1hYy0+cm9hbS5jb25maWdQYXJhbS5mZW5hYmxlTUNDTW9kZSl7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIH0KKworICAgIGZvciAoc2Vzc2lvbklkID0gMDsgc2Vzc2lvbklkIDwgQ1NSX1JPQU1fU0VTU0lPTl9NQVg7IHNlc3Npb25JZCsrICkKKyAgICB7CisgICAgICAgIC8qIElmIEdPIGluIE1DQyBzdXBwb3J0IGRpZmZlcmVudCBiZWFjb24gaW50ZXJ2YWwsIAorICAgICAgICAgKiBjaGFuZ2UgdGhlIEJJIG9mIHRoZSBQMlAtR08gKi8KKyAgICAgICAgaWYgKHBNYWMtPnJvYW0ucm9hbVNlc3Npb25bc2Vzc2lvbklkXS5ic3NQYXJhbXMuYnNzUGVyc29uYQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gVk9TX1AyUF9HT19NT0RFKQorICAgICAgICB7CisgICAgICAgICAgIC8qIEhhbmRsZSBkaWZmZXJlbnQgQkkgc2NuZWFyaW8gYmFzZWQgb24gdGhlIGNvbmZpZ3VyYXRpb24gc2V0LgorICAgICAgICAgICAgKiBJZiBDb25maWcgaXMgc2V0IHRvIDB4MDIgdGhlbiBEaXNjb25uZWN0IGFsbCB0aGUgUDJQIGNsaWVudHMKKyAgICAgICAgICAgICogYXNzb2NpYXRlZC4gSWYgY29uZmlnIGlzIHNldCB0byAweDA0IHRoZW4gdXBkYXRlIHRoZSBCSQorICAgICAgICAgICAgKiB3aXRob3V0IGRpc2Nvbm5lY3RpbmcgYWxsIHRoZSBjbGllbnRzCisgICAgICAgICAgICAqLworICAgICAgICAgICBpZiAoKHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uZkFsbG93TUNDR09EaWZmQkkgPT0gMHgwNCkgJiYKKyAgICAgICAgICAgICAgIChwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0uYnNzUGFyYW1zLnVwZGF0ZWJlYWNvbkludGVydmFsKSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgcmV0dXJuIGNzclNlbmRDaG5nTUNDQmVhY29uSW50ZXJ2YWwoIHBNYWMsIHNlc3Npb25JZCk7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgLy9JZiB0aGUgY29uZmlndXJhdGlvbi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bCBiZWFjb24gaW50ZXJ2YWwgd2lsbCBiZSBhbGlnbmVkIHRvIHN0YSBiZWFjb24gaW50ZXJ2YWwsIGJ1dCAKKyAgICAgICAgLy9pbiB0aGUgcmFuZ2Ugb2YgWzEwMCwgMTk5XS4KKyAgICAgICAgc3RhX2NiaSA9IHN0YV9iaSAvIG51bV9iZWFjb25zOworICAgICAgICBnb19mYmkgPSBzdGFfY2JpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAvLyBpZiBTVEEgYmVhY29uIGludGVydmFsIGlzIGxlc3MgdGhhbiAxMDAsIHVzZSBHTydzIGNoYW5nZSBiYWNvbiBpbnRlcnZhbCAKKyAgICAgICAgLy9pbnN0ZWFkIG9mIHVwZGF0aW5nIHRvIFNUQSdzIGJlYWNvbiBpbnRlcnZhbC4KKyAgICAgICAgZ29fZmJpID0gZ29fY2JpOworICAgIH0KKyAgICByZXR1cm4gZ29fZmJpOworfQorCitlSGFsU3RhdHVzIGNzclZhbGlkYXRlTUNDQmVhY29uSW50ZXJ2YWwodHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VOCBjaGFubmVsSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMTYgKmJlYWNvbkludGVydmFsLCB0QU5JX1UzMiBjdXJzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFZPU19DT05fTU9ERSBjdXJyQnNzUGVyc29uYSkKK3sKKyAgICB0QU5JX1UzMiBzZXNzaW9uSWQgPSAwOworICAgIHRBTklfVTE2IG5ld19iZWFjb25JbnRlcnZhbCA9IDA7CisgIAorICAgIC8vSWYgTUNDIGlzIG5vdCBzdXBwb3J0ZWQganVzdCBicmVhaworICAgIGlmICghcE1hYy0+cm9hbS5jb25maWdQYXJhbS5mZW5hYmxlTUNDTW9kZSl7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIH0KKworICAgIGZvciAoc2Vzc2lvbklkID0gMDsgc2Vzc2lvbklkIDwgQ1NSX1JPQU1fU0VTU0lPTl9NQVg7IHNlc3Npb25JZCsrICkKKyAgICB7CisgICAgICAgIGlmIChjdXJzZXNzaW9uSWQgIT0gc2Vzc2lvbklkICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKCFDU1JfSVNfU0VTU0lPTl9WQUxJRCggcE1hYywgc2Vzc2lvbklkICkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHN3aXRjaCAoY3VyckJzc1BlcnNvbmEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2FzZSBWT1NfU1RBX01PREU6CisgICAgICAgICAgICAgICAgICAgIGlmIChwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0ucEN1clJvYW1Qcm9maWxlICYmCisgICAgICAgICAgICAgICAgICAgICAgIChwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0ucEN1clJvYW1Qcm9maWxlLT5jc3JQZXJzb25hCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IFZPU19QMlBfQ0xJRU5UX01PREUpKSAvL2NoZWNrIGZvciBQMlAgY2xpZW50IG1vZGUKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsIEZMKCIgQmVhY29uIEludGVydmFsIFZhbGlkYXRpb24gbm90IHJlcXVpcmVkIGZvciBTVEEvQ0xJRU5UIikpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8vSUYgU0FQIGhhcyBzdGFydGVkIGFuZCBTVEEgd2FudHMgdG8gY29ubmVjdCBvbiBkaWZmZXJlbnQgY2hhbm5lbCBNQ0Mgc2hvdWxkCisgICAgICAgICAgICAgICAgICAgIC8vTUNDIHNob3VsZCBub3QgYmUgZW5hYmxlZCBzbyBtYWtpbmcgaXQgZmFsc2UgdG8gZW5mb3JjZSBvbiBzYW1lIGNoYW5uZWwKKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLmJzc1BhcmFtcy5ic3NQZXJzb25hCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IFZPU19TVEFfU0FQX01PREUpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0uYnNzUGFyYW1zLm9wZXJhdGlvbkNobiAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gY2hhbm5lbElkICkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIioqKiBNQ0Mgd2l0aCBTQVArU1RBIHNlc3Npb25zICoqKioiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLmJzc1BhcmFtcy5ic3NQZXJzb25hCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IFZPU19QMlBfR09fTU9ERSkgLy9DaGVjayBmb3IgUDJQIGdvIHNjZW5hcmlvCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlmIEdPIGluIE1DQyBzdXBwb3J0IGRpZmZlcmVudCBiZWFjb24gaW50ZXJ2YWwsIAorICAgICAgICAgICAgICAgICAgICAgICAgICogY2hhbmdlIHRoZSBCSSBvZiB0aGUgUDJQLUdPICovCisgICAgICAgICAgICAgICAgICAgICAgIGlmICgocE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLmJzc1BhcmFtcy5vcGVyYXRpb25DaG4gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICE9IGNoYW5uZWxJZCApICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAocE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLmJzc1BhcmFtcy5iZWFjb25JbnRlcnZhbCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gKmJlYWNvbkludGVydmFsKSkKKyAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaWYgR08gaW4gTUNDIHN1cHBvcnQgZGlmZmVyZW50IGJlYWNvbiBpbnRlcnZhbCwgcmV0dXJuIHN1Y2Nlc3MgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICggcE1hYy0+cm9hbS5jb25maWdQYXJhbS5mQWxsb3dNQ0NHT0RpZmZCSSA9PSAweDAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gU2VuZCBvbmx5IEJyb2FkY2FzdCBkaXNhc3NvYyBhbmQgdXBkYXRlIGJlYWNvbkludGVydmFsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0lmIGNvbmZpZ3VyYXRpb24gaXMgc2V0IHRvIDB4MDQgdGhlbiBkb250CisgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBkaXNjb25uZWN0IGFsbCB0aGUgc3RhdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoKHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uZkFsbG93TUNDR09EaWZmQkkgPT0gMHgwMikgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uZkFsbG93TUNDR09EaWZmQkkgPT0gMHgwNCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9DaGVjayB0byBwYXNzIHRoZSByaWdodCBiZWFjb24gSW50ZXJ2YWwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfYmVhY29uSW50ZXJ2YWwgPSBjc3JDYWxjdWxhdGVNQ0NCZWFjb25JbnRlcnZhbChwTWFjLCAqYmVhY29uSW50ZXJ2YWwsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLmJzc1BhcmFtcy5iZWFjb25JbnRlcnZhbCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsIEZMKCIgUGVlciBBUCBCSSA6ICVkLCBuZXcgQmVhY29uIEludGVydmFsOiAlZCIpLCpiZWFjb25JbnRlcnZhbCxuZXdfYmVhY29uSW50ZXJ2YWwgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1VwZGF0ZSB0aGUgYmVjb24gSW50ZXJ2YWwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV3X2JlYWNvbkludGVydmFsICE9IHBNYWMtPnJvYW0ucm9hbVNlc3Npb25bc2Vzc2lvbklkXS5ic3NQYXJhbXMuYmVhY29uSW50ZXJ2YWwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1VwZGF0ZSB0aGUgYmVhY29uSW50ZXJ2YWwgbm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiIEJlYWNvbiBJbnRlcnZhbCBnb3QgY2hhbmdlZCBjb25maWcgdXNlZDogJWRcbiIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uZkFsbG93TUNDR09EaWZmQkkpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0ucm9hbVNlc3Npb25bc2Vzc2lvbklkXS5ic3NQYXJhbXMuYmVhY29uSW50ZXJ2YWwgPSBuZXdfYmVhY29uSW50ZXJ2YWw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0ucm9hbVNlc3Npb25bc2Vzc2lvbklkXS5ic3NQYXJhbXMudXBkYXRlYmVhY29uSW50ZXJ2YWwgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjc3JVcGRhdGVNQ0NwMnBCZWFjb25JbnRlcnZhbChwTWFjKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0Rpc2Nvbm5lY3QgdGhlIFAyUCBzZXNzaW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLmZBbGxvd01DQ0dPRGlmZkJJID09IDB4MDMpCisgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLmJzc1BhcmFtcy51cGRhdGViZWFjb25JbnRlcnZhbCA9ICBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNzclJvYW1DYWxsQ2FsbGJhY2socE1hYywgc2Vzc2lvbklkLCBOVUxMLCAwLCBlQ1NSX1JPQU1fU0VORF9QMlBfU1RPUF9CU1MsIGVDU1JfUk9BTV9SRVNVTFRfTk9ORSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJCZWFjb25JbnRlcnZhbCBpcyBkaWZmZXJlbnQgY2Fubm90IGNvbm5lY3QgdG8gcHJlZmVycmVkIEFQLi4uIikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBWT1NfUDJQX0NMSUVOVF9NT0RFOgorICAgICAgICAgICAgICAgICAgICBpZiAocE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLnBDdXJSb2FtUHJvZmlsZSAmJgorICAgICAgICAgICAgICAgICAgICAgIChwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0ucEN1clJvYW1Qcm9maWxlLT5jc3JQZXJzb25hCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gVk9TX1NUQV9NT0RFKSkgLy9jaGVjayBmb3IgUDJQIGNsaWVudCBtb2RlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCBGTCgiIElnbm9yZSBCZWFjb24gSW50ZXJ2YWwgVmFsaWRhdGlvbi4uLiIpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvL0lGIFNBUCBoYXMgc3RhcnRlZCBhbmQgU1RBIHdhbnRzIHRvIGNvbm5lY3Qgb24gZGlmZmVyZW50IGNoYW5uZWwgTUNDIHNob3VsZAorICAgICAgICAgICAgICAgICAgICAvL01DQyBzaG91bGQgbm90IGJlIGVuYWJsZWQgc28gbWFraW5nIGl0IGZhbHNlIHRvIGVuZm9yY2Ugb24gc2FtZSBjaGFubmVsCisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHBNYWMtPnJvYW0ucm9hbVNlc3Npb25bc2Vzc2lvbklkXS5ic3NQYXJhbXMuYnNzUGVyc29uYQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSBWT1NfU1RBX1NBUF9NT0RFKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAocE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLmJzc1BhcmFtcy5vcGVyYXRpb25DaG4gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICE9IGNoYW5uZWxJZCApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIqKipNQ0MgaXMgbm90IGVuYWJsZWQgZm9yIFNBUCArIENMSUVOVCoqKioiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLmJzc1BhcmFtcy5ic3NQZXJzb25hCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSBWT1NfUDJQX0dPX01PREUpIC8vQ2hlY2sgZm9yIFAyUCBnbyBzY2VuYXJpbworICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHBNYWMtPnJvYW0ucm9hbVNlc3Npb25bc2Vzc2lvbklkXS5ic3NQYXJhbXMub3BlcmF0aW9uQ2huIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBjaGFubmVsSWQgKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0uYnNzUGFyYW1zLmJlYWNvbkludGVydmFsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSAqYmVhY29uSW50ZXJ2YWwpKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiQmVhY29uSW50ZXJ2YWwgaXMgZGlmZmVyZW50IGNhbm5vdCBjb25uZWN0IHRvIFAyUF9HTyBuZXR3b3JrIC4uLiIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgVk9TX1AyUF9HT19NT0RFIDoKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0ucEN1clJvYW1Qcm9maWxlICAmJgorICAgICAgICAgICAgICAgICAgICAgICgocE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLnBDdXJSb2FtUHJvZmlsZS0+Y3NyUGVyc29uYQorICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IFZPU19QMlBfQ0xJRU5UX01PREUpIHx8CisgICAgICAgICAgICAgICAgICAgICAgKHBNYWMtPnJvYW0ucm9hbVNlc3Npb25bc2Vzc2lvbklkXS5wQ3VyUm9hbVByb2ZpbGUtPmNzclBlcnNvbmEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSBWT1NfU1RBX01PREUpKSkgLy9jaGVjayBmb3IgUDJQX2NsaWVudCBzY2VuYXJpbworICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHBNYWMtPnJvYW0ucm9hbVNlc3Npb25bc2Vzc2lvbklkXS5jb25uZWN0ZWRQcm9maWxlLm9wZXJhdGlvbkNoYW5uZWwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSAwICkmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBNYWMtPnJvYW0ucm9hbVNlc3Npb25bc2Vzc2lvbklkXS5jb25uZWN0ZWRQcm9maWxlLmJlYWNvbkludGVydmFsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gMCkpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vQXNzZXJ0IGlmIGNvbm5lY3RlZCBwcm9maWxlIGJlYWNvbiBpbnRlcm5hbCBpcyBaRVJPCisgICAgICAgICAgICAgICAgICAgICAgICBpZighcE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLlwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0ZWRQcm9maWxlLmJlYWNvbkludGVydmFsKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgRkwoIiBDb25uZWN0ZWQgcHJvZmlsZSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJiZWFjb24gaW50ZXJ2YWwgaXMgemVybyIpICk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjc3JJc0Nvbm5TdGF0ZUNvbm5lY3RlZEluZnJhKHBNYWMsIHNlc3Npb25JZCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIChwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0uY29ubmVjdGVkUHJvZmlsZS5vcGVyYXRpb25DaGFubmVsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICE9IGNoYW5uZWxJZCApICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAocE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLmNvbm5lY3RlZFByb2ZpbGUuYmVhY29uSW50ZXJ2YWwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gKmJlYWNvbkludGVydmFsKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIFVwZGF0ZWQgYmVhY29uSW50ZXJ2YWwgc2hvdWxkIGJlIHVzZWQgb25seSB3aGVuIHdlIGFyZSBzdGFydGluZyBhIG5ldyBCU1MgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogbm90IGluY2FzZSBvZiBjbGllbnQgb3IgU1RBIGNhc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0NhbGN1bGF0ZSBiZWFjb24gSW50ZXJ2YWwgZm9yIFAyUC1HTyBpbmNhc2Ugb2YgTUNDCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2JlYWNvbkludGVydmFsID0gY3NyQ2FsY3VsYXRlTUNDQmVhY29uSW50ZXJ2YWwocE1hYywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5yb2FtLnJvYW1TZXNzaW9uW3Nlc3Npb25JZF0uYnNzUGFyYW1zLmJlYWNvbkludGVydmFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKmJlYWNvbkludGVydmFsICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoKmJlYWNvbkludGVydmFsICE9IG5ld19iZWFjb25JbnRlcnZhbCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKmJlYWNvbkludGVydmFsID0gbmV3X2JlYWNvbkludGVydmFsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGRlZmF1bHQgOgorICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiBQZXJzb25hIG5vdCBzdXBwb3J0ZWQgOiAlZCIpLGN1cnJCc3NQZXJzb25hKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gZUhBT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gIGZXYXBpUHJvZmlsZSA9IEZBTFNFOworICAgICAgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgaWYgKCBmV2FwaVByb2ZpbGUgKQorICAgIHsKKyAgICAgICAgc3dpdGNoICggcFByb2ZpbGUtPm5lZ290aWF0ZWRVQ0VuY3J5cHRpb25UeXBlICkKKyAgICAgICAgeworICAgICAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9XUEk6CisgICAgICAgICAgICAgICAgZldhcGlQcm9maWxlID0gVFJVRTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBmV2FwaVByb2ZpbGUgPSBGQUxTRTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4oIGZXYXBpUHJvZmlsZSApOworfQorCitzdGF0aWMgdEFOSV9CT09MRUFOIGNzcklzV2FwaU91aUVxdWFsKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4ICpPdWkxLCB0QU5JX1U4ICpPdWkyICkKK3sKKyAgICByZXR1cm4gKHZvc19tZW1fY29tcGFyZShPdWkxLCBPdWkyLCBDU1JfV0FQSV9PVUlfU0laRSkpOworfQorCitzdGF0aWMgdEFOSV9CT09MRUFOIGNzcklzV2FwaU91aU1hdGNoKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4IEFsbEN5cGhlcnNbXVtDU1JfV0FQSV9PVUlfU0laRV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBjQWxsQ3lwaGVycywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IEN5cGhlcltdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggT3VpW10gKQoreworICAgIHRBTklfQk9PTEVBTiBmWWVzID0gRkFMU0U7CisgICAgdEFOSV9VOCBpZHg7CisKKyAgICBmb3IgKCBpZHggPSAwOyBpZHggPCBjQWxsQ3lwaGVyczsgaWR4KysgKQorICAgIHsKKyAgICAgICAgaWYgKCBjc3JJc1dhcGlPdWlFcXVhbCggcE1hYywgQWxsQ3lwaGVyc1sgaWR4IF0sIEN5cGhlciApICkKKyAgICAgICAgeworICAgICAgICAgICAgZlllcyA9IFRSVUU7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIGlmICggZlllcyAmJiBPdWkgKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9jb3B5KE91aSwgQWxsQ3lwaGVyc1sgaWR4IF0sIENTUl9XQVBJX09VSV9TSVpFKTsKKyAgICB9CisKKyAgICByZXR1cm4oIGZZZXMgKTsKK30KKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fV0FQSSAqLworCitzdGF0aWMgdEFOSV9CT09MRUFOIGNzcklzV3BhT3VpRXF1YWwoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggKk91aTEsIHRBTklfVTggKk91aTIgKQoreworICAgIHJldHVybih2b3NfbWVtX2NvbXBhcmUoT3VpMSwgT3VpMiwgQ1NSX1dQQV9PVUlfU0laRSkpOworfQorCitzdGF0aWMgdEFOSV9CT09MRUFOIGNzcklzT3VpTWF0Y2goIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggQWxsQ3lwaGVyc1tdW0NTUl9XUEFfT1VJX1NJWkVdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggY0FsbEN5cGhlcnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBDeXBoZXJbXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IE91aVtdICkKK3sKKyAgICB0QU5JX0JPT0xFQU4gZlllcyA9IEZBTFNFOworICAgIHRBTklfVTggaWR4OworCisgICAgZm9yICggaWR4ID0gMDsgaWR4IDwgY0FsbEN5cGhlcnM7IGlkeCsrICkKKyAgICB7CisgICAgICAgIGlmICggY3NySXNXcGFPdWlFcXVhbCggcE1hYywgQWxsQ3lwaGVyc1sgaWR4IF0sIEN5cGhlciApICkKKyAgICAgICAgeworICAgICAgICAgICAgZlllcyA9IFRSVUU7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIGlmICggZlllcyAmJiBPdWkgKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9jb3B5KE91aSwgQWxsQ3lwaGVyc1sgaWR4IF0sIENTUl9XUEFfT1VJX1NJWkUpOworICAgIH0KKworICAgIHJldHVybiggZlllcyApOworfQorCitzdGF0aWMgdEFOSV9CT09MRUFOIGNzck1hdGNoUlNOT1VJSW5kZXgoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggQWxsQ3lwaGVyc1tdW0NTUl9SU05fT1VJX1NJWkVdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGNBbGxDeXBoZXJzLCB0QU5JX1U4IG91aUluZGV4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IE91aVtdICkKK3sKKyAgICByZXR1cm4oIGNzcklzT3VpTWF0Y2goIHBNYWMsIEFsbEN5cGhlcnMsIGNBbGxDeXBoZXJzLCBjc3JSU05PdWlbb3VpSW5kZXhdLCBPdWkgKSApOworCit9CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fV0FQSQorc3RhdGljIHRBTklfQk9PTEVBTiBjc3JNYXRjaFdhcGlPVUlJbmRleCggdHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VOCBBbGxDeXBoZXJzW11bQ1NSX1dBUElfT1VJX1NJWkVdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGNBbGxDeXBoZXJzLCB0QU5JX1U4IG91aUluZGV4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IE91aVtdICkKK3sKKyAgICBpZiAob3VpSW5kZXggPCBDU1JfV0FQSV9PVUlfUk9XX1NJWkUpLy8gc2luY2UgY3NyV2FwaU91aSByb3cgc2l6ZSBpcyAzIC4KKyAgICAgICAgICByZXR1cm4oIGNzcklzV2FwaU91aU1hdGNoKCBwTWFjLCBBbGxDeXBoZXJzLCBjQWxsQ3lwaGVycywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JXYXBpT3VpW291aUluZGV4XSwgT3VpICkgKTsKKyAgICBlbHNlCisgICAgICAgICAgcmV0dXJuIEZBTFNFIDsKKworfQorI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9XQVBJICovCisKK3N0YXRpYyB0QU5JX0JPT0xFQU4gY3NyTWF0Y2hXUEFPVUlJbmRleCggdHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VOCBBbGxDeXBoZXJzW11bQ1NSX1JTTl9PVUlfU0laRV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggY0FsbEN5cGhlcnMsIHRBTklfVTggb3VpSW5kZXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggT3VpW10gKQoreworICAgIHJldHVybiggY3NySXNPdWlNYXRjaCggcE1hYywgQWxsQ3lwaGVycywgY0FsbEN5cGhlcnMsIGNzcldwYU91aVtvdWlJbmRleF0sIE91aSApICk7CisKK30KKworI2lmIDAKK3N0YXRpYyB0QU5JX0JPT0xFQU4gY3NySXNSU05VbmljYXN0Tm9uZSggdHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VOCBBbGxDeXBoZXJzW11bQ1NSX1JTTl9PVUlfU0laRV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggY0FsbEN5cGhlcnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggT3VpW10gKQoreworICAgIHJldHVybiggY3NySXNPdWlNYXRjaCggcE1hYywgQWxsQ3lwaGVycywgY0FsbEN5cGhlcnMsIGNzclJTTk91aTAwLCBPdWkgKSApOworfQorCitzdGF0aWMgdEFOSV9CT09MRUFOIGNzcklzUlNOTXVsdGljYXN0V2VwKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4IEFsbEN5cGhlcnNbXVtDU1JfUlNOX09VSV9TSVpFXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGNBbGxDeXBoZXJzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggT3VpW10gKQoreworICAgIHRBTklfQk9PTEVBTiBmWWVzID0gRkFMU0U7CisKKyAgICAvLyBDaGVjayBXZXAgMTA0IGZpcnN0LCBpZiBmYWlscywgdGhlbiBjaGVjayBXZXA0MC4KKyAgICBmWWVzID0gY3NySXNPdWlNYXRjaCggcE1hYywgQWxsQ3lwaGVycywgY0FsbEN5cGhlcnMsIGNzclJTTk91aTA1LCBPdWkgKTsKKworICAgIGlmICggIWZZZXMgKQorICAgIHsKKyAgICAgICAgLy8gaWYgbm90IFdlcC0xMDQsIGNoZWNrIFdlcC00MAorICAgICAgICBmWWVzID0gY3NySXNPdWlNYXRjaCggcE1hYywgQWxsQ3lwaGVycywgY0FsbEN5cGhlcnMsIGNzclJTTk91aTAxLCBPdWkgKTsKKyAgICB9CisKKyAgICByZXR1cm4oIGZZZXMgKTsKK30KKworCitzdGF0aWMgdEFOSV9CT09MRUFOIGNzcklzUlNOVW5pY2FzdFRraXAoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggQWxsQ3lwaGVyc1tdW0NTUl9SU05fT1VJX1NJWkVdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBjQWxsQ3lwaGVycywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggT3VpW10gKQoreworICAgIHJldHVybiggY3NySXNPdWlNYXRjaCggcE1hYywgQWxsQ3lwaGVycywgY0FsbEN5cGhlcnMsIGNzclJTTk91aTAyLCBPdWkgKSApOworfQorCisKK3N0YXRpYyB0QU5JX0JPT0xFQU4gY3NySXNSU05NdWx0aWNhc3RUa2lwKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4IEFsbEN5cGhlcnNbXVtDU1JfUlNOX09VSV9TSVpFXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGNBbGxDeXBoZXJzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggT3VpW10gKQoreworICAgIHJldHVybiggY3NySXNPdWlNYXRjaCggcE1hYywgQWxsQ3lwaGVycywgY0FsbEN5cGhlcnMsIGNzclJTTk91aTAyLCBPdWkgKSApOworfQorCitzdGF0aWMgdEFOSV9CT09MRUFOIGNzcklzUlNOVW5pY2FzdEFlcyggdHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VOCBBbGxDeXBoZXJzW11bQ1NSX1JTTl9PVUlfU0laRV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBjQWxsQ3lwaGVycywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IE91aVtdICkKK3sKKyAgICByZXR1cm4oIGNzcklzT3VpTWF0Y2goIHBNYWMsIEFsbEN5cGhlcnMsIGNBbGxDeXBoZXJzLCBjc3JSU05PdWkwNCwgT3VpICkgKTsKK30KKworc3RhdGljIHRBTklfQk9PTEVBTiBjc3JJc1JTTk11bHRpY2FzdEFlcyggdHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VOCBBbGxDeXBoZXJzW11bQ1NSX1JTTl9PVUlfU0laRV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBjQWxsQ3lwaGVycywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IE91aVtdICkKK3sKKyAgICByZXR1cm4oIGNzcklzT3VpTWF0Y2goIHBNYWMsIEFsbEN5cGhlcnMsIGNBbGxDeXBoZXJzLCBjc3JSU05PdWkwNCwgT3VpICkgKTsKK30KKyNlbmRpZgorI2lmZGVmIEZFQVRVUkVfV0xBTl9XQVBJCitzdGF0aWMgdEFOSV9CT09MRUFOIGNzcklzQXV0aFdhcGlDZXJ0KCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4IEFsbFN1aXRlc1tdW0NTUl9XQVBJX09VSV9TSVpFXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGNBbGxTdWl0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBPdWlbXSApCit7CisgICAgcmV0dXJuKCBjc3JJc1dhcGlPdWlNYXRjaCggcE1hYywgQWxsU3VpdGVzLCBjQWxsU3VpdGVzLCBjc3JXYXBpT3VpWzFdLCBPdWkgKSApOworfQorc3RhdGljIHRBTklfQk9PTEVBTiBjc3JJc0F1dGhXYXBpUHNrKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4IEFsbFN1aXRlc1tdW0NTUl9XQVBJX09VSV9TSVpFXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBjQWxsU3VpdGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IE91aVtdICkKK3sKKyAgICByZXR1cm4oIGNzcklzV2FwaU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LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGNBbGxTdWl0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggT3VpW10gKQoreworICAgIHJldHVybiggY3NySXNPdWlNYXRjaCggcE1hYywgQWxsU3VpdGVzLCBjQWxsU3VpdGVzLCBjc3JSU05PdWlbMDRdLCBPdWkgKSApOworfQorCisjZW5kaWYKKworI2lmZGVmIEZFQVRVUkVfV0xBTl9FU0UKKworLyoKKyAqIEZ1bmN0aW9uIGZvciBFU0UgQ0NLTSBBS00gQXV0aGVudGljYXRpb24uIFdlIG1hdGNoIHRoZSBDQ0tNIEFLTSBBdXRoZW50aWNhdGlvbiBLZXkgTWFuYWdlbWVudCBzdWl0ZQorICogaGVyZS4gVGhpcyBtYXRjaGVzIGZvciBDQ0tNIEFLTSBBdXRoIHdpdGggdGhlIDgwMi4xWCBleGNoYW5nZS4KKyAqCisgKi8KK3N0YXRpYyB0QU5JX0JPT0xFQU4gY3NySXNFc2VDY2ttQXV0aFJTTiggdHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VOCBBbGxTdWl0ZXNbXVtDU1JfUlNOX09VSV9TSVpFXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGNBbGxTdWl0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBPdWlbXSApCit7CisgICAgcmV0dXJuKCBjc3JJc091aU1hdGNoKCBwTWFjLCBBbGxTdWl0ZXMsIGNBbGxTdWl0ZXMsIGNzclJTTk91aVswNl0sIE91aSApICk7Cit9CisKK3N0YXRpYyB0QU5JX0JPT0xFQU4gY3NySXNFc2VDY2ttQXV0aFdwYSggdHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VOCBBbGxTdWl0ZXNbXVtDU1JfV1BBX09VSV9TSVpFXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBjQWxsU3VpdGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IE91aVtdICkKK3sKKyAgICByZXR1cm4oIGNzcklzT3VpTWF0Y2goIHBNYWMsIEFsbFN1aXRlcywgY0FsbFN1aXRlcywgY3NyV3BhT3VpWzA2XSwgT3VpICkgKTsKK30KKworI2VuZGlmCisKK3N0YXRpYyB0QU5JX0JPT0xFQU4gY3NySXNBdXRoUlNOKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4IEFsbFN1aXRlc1tdW0NTUl9SU05fT1VJX1NJWkVdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggY0FsbFN1aXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IE91aVtdICkKK3sKKyAgICByZXR1cm4oIGNzcklzT3VpTWF0Y2goIHBNYWMsIEFsbFN1aXRlcywgY0FsbFN1aXRlcywgY3NyUlNOT3VpWzAxXSwgT3VpICkgKTsKK30KK3N0YXRpYyB0QU5JX0JPT0xFQU4gY3NySXNBdXRoUlNOUHNrKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4IEFsbFN1aXRlc1tdW0NTUl9SU05fT1VJX1NJWkVdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGNBbGxTdWl0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggT3VpW10gKQoreworICAgIHJldHVybiggY3NySXNPdWlNYXRjaCggcE1hYywgQWxsU3VpdGVzLCBjQWxsU3VpdGVzLCBjc3JSU05PdWlbMDJdLCBPdWkgKSApOworfQorCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworc3RhdGljIHRBTklfQk9PTEVBTiBjc3JJc0F1dGhSU05Qc2tTaGEyNTYoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggQWxsU3VpdGVzW11bQ1NSX1JTTl9PVUlfU0laRV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggY0FsbFN1aXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBPdWlbXSApCit7CisgICAgcmV0dXJuIGNzcklzT3VpTWF0Y2goIHBNYWMsIEFsbFN1aXRlcywgY0FsbFN1aXRlcywgY3NyUlNOT3VpWzA3XSwgT3VpICk7Cit9CitzdGF0aWMgdEFOSV9CT09MRUFOIGNzcklzQXV0aFJTTjgwMjF4U2hhMjU2KHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggQWxsU3VpdGVzW11bQ1NSX1JTTl9PVUlfU0laRV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggY0FsbFN1aXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBPdWlbXSApCit7CisgICAgcmV0dXJuIGNzcklzT3VpTWF0Y2goIHBNYWMsIEFsbFN1aXRlcywgY0FsbFN1aXRlcywgY3NyUlNOT3VpWzhdLCBPdWkgKTsKK30KKyNlbmRpZgorCitzdGF0aWMgdEFOSV9CT09MRUFOIGNzcklzQXV0aFdwYSggdHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VOCBBbGxTdWl0ZXNbXVtDU1JfV1BBX09VSV9TSVpFXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBjQWxsU3VpdGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IE91aVtdICkKK3sKKyAgICByZXR1cm4oIGNzcklzT3VpTWF0Y2goIHBNYWMsIEFsbFN1aXRlcywgY0FsbFN1aXRlcywgY3NyV3BhT3VpWzAxXSwgT3VpICkgKTsKK30KKworI2lmZGVmIE5PVF9DVVJSRU5UTFlfVVNFRAorc3RhdGljIHRBTklfQk9PTEVBTiBjc3JJc0F1dGg4MDJfMXgoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggQWxsU3VpdGVzW11bQ1NSX1dQQV9PVUlfU0laRV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggY0FsbFN1aXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBPdWlbXSApCit7CisgICAgcmV0dXJuKCBjc3JJc091aU1hdGNoKCBwTWFjLCBBbGxTdWl0ZXMsIGNBbGxTdWl0ZXMsIGNzcldwYU91aVswMF0sIE91aSApICk7Cit9CisjZW5kaWYgLy8gTk9UX0NVUlJFTlRMWV9VU0VECisKK3N0YXRpYyB0QU5JX0JPT0xFQU4gY3NySXNBdXRoV3BhUHNrKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4IEFsbFN1aXRlc1tdW0NTUl9XUEFfT1VJX1NJWkVdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGNBbGxTdWl0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggT3VpW10gKQoreworICAgIHJldHVybiggY3NySXNPdWlNYXRjaCggcE1hYywgQWxsU3VpdGVzLCBjQWxsU3VpdGVzLCBjc3JXcGFPdWlbMDJdLCBPdWkgKSApOworfQorI2lmIDAKK3N0YXRpYyB0QU5JX0JPT0xFQU4gY3NySXNVbmljYXN0Tm9uZSggdHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VOCBBbGxDeXBoZXJzW11bQ1NSX1dQQV9PVUlfU0laRV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggY0FsbEN5cGhlcnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggT3VpW10gKQoreworICAgIHJldHVybiggY3NySXNPdWlNYXRjaCggcE1hYywgQWxsQ3lwaGVycywgY0FsbEN5cGhlcnMsIGNzcldwYU91aTAwLCBPdWkgKSApOworfQorCitzdGF0aWMgdEFOSV9CT09MRUFOIGNzcklzVW5pY2FzdFRraXAoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggQWxsQ3lwaGVyc1tdW0NTUl9XUEFfT1VJX1NJWkVdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGNBbGxDeXBoZXJzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IE91aVtdICkKK3sKKyAgICByZXR1cm4oIGNzcklzT3VpTWF0Y2goIHBNYWMsIEFsbEN5cGhlcnMsIGNBbGxDeXBoZXJzLCBjc3JXcGFPdWkwMiwgT3VpICkgKTsKK30KKworc3RhdGljIHRBTklfQk9PTEVBTiBjc3JJc1VuaWNhc3RBZXMoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggQWxsQ3lwaGVyc1tdW0NTUl9XUEFfT1VJX1NJWkVdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGNBbGxDeXBoZXJzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IE91aVtdICkKK3sKKyAgICByZXR1cm4oIGNzcklzT3VpTWF0Y2goIHBNYWMsIEFsbEN5cGhlcnMsIGNBbGxDeXBoZXJzLCBjc3JXcGFPdWkwNCwgT3VpICkgKTsKK30KKworCitzdGF0aWMgdEFOSV9CT09MRUFOIGNzcklzTXVsdGljYXN0V2VwKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4IEFsbEN5cGhlcnNbXVtDU1JfV1BBX09VSV9TSVpFXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggY0FsbEN5cGhlcnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IE91aVtdICkKK3sKKyAgICB0QU5JX0JPT0xFQU4gZlllcyA9IEZBTFNFOworCisgICAgLy8gQ2hlY2sgV2VwIDEwNCBmaXJzdCwgaWYgZmFpbHMsIHRoZW4gY2hlY2sgV2VwNDAuCisgICAgZlllcyA9IGNzcklzT3VpTWF0Y2goIHBNYWMsIEFsbEN5cGhlcnMsIGNBbGxDeXBoZXJzLCBjc3JXcGFPdWkwNSwgT3VpICk7CisKKyAgICBpZiAoICFmWWVzICkKKyAgICB7CisgICAgICAgIC8vIGlmIG5vdCBXZXAtMTA0LCBjaGVjayBXZXAtNDAKKyAgICAgICAgZlllcyA9IGNzcklzT3VpTWF0Y2goIHBNYWMsIEFsbEN5cGhlcnMsIGNBbGxDeXBoZXJzLCBjc3JXcGFPdWkwMSwgT3VpICk7CisgICAgfQorCisgICAgcmV0dXJuKCBmWWVzICk7Cit9CisKKworc3RhdGljIHRBTklfQk9PTEVBTiBjc3JJc011bHRpY2FzdFRraXAoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggQWxsQ3lwaGVyc1tdW0NTUl9XUEFfT1VJX1NJWkVdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBjQWxsQ3lwaGVycywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggT3VpW10gKQoreworICAgIHJldHVybiggY3NySXNPdWlNYXRjaCggcE1hYywgQWxsQ3lwaGVycywgY0FsbEN5cGhlcnMsIGNzcldwYU91aTAyLCBPdWkgKSApOworfQorCisKK3N0YXRpYyB0QU5JX0JPT0xFQU4gY3NySXNNdWx0aWNhc3RBZXMoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTggQWxsQ3lwaGVyc1tdW0NTUl9XUEFfT1VJX1NJWkVdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBjQWxsQ3lwaGVycywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggT3VpW10gKQoreworICAgIHJldHVybiggY3NySXNPdWlNYXRjaCggcE1hYywgQWxsQ3lwaGVycywgY0FsbEN5cGhlcnMsIGNzcldwYU91aTA0LCBPdWkgKSApOworfQorCisjZW5kaWYKKwordEFOSV9VOCBjc3JHZXRPVUlJbmRleEZyb21DaXBoZXIoIGVDc3JFbmNyeXB0aW9uVHlwZSBlblR5cGUgKQoreworICAgIHRBTklfVTggT1VJSW5kZXg7CisKKyAgICAgICAgc3dpdGNoICggZW5UeXBlICkKKyAgICAgICAgeworICAgICAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVA0MDoKKyAgICAgICAgICAgIGNhc2UgZUNTUl9FTkNSWVBUX1RZUEVfV0VQNDBfU1RBVElDS0VZOgorICAgICAgICAgICAgICAgIE9VSUluZGV4ID0gQ1NSX09VSV9XRVA0MF9PUl8xWF9JTkRFWDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNTUl9FTkNSWVBUX1RZUEVfV0VQMTA0OgorICAgICAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVAxMDRfU1RBVElDS0VZOgorICAgICAgICAgICAgICAgIE9VSUluZGV4ID0gQ1NSX09VSV9XRVAxMDRfSU5ERVg7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDU1JfRU5DUllQVF9UWVBFX1RLSVA6CisgICAgICAgICAgICAgICAgT1VJSW5kZXggPSBDU1JfT1VJX1RLSVBfT1JfUFNLX0lOREVYOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9BRVM6CisgICAgICAgICAgICAgICAgT1VJSW5kZXggPSBDU1JfT1VJX0FFU19JTkRFWDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNTUl9FTkNSWVBUX1RZUEVfTk9ORToKKyAgICAgICAgICAgICAgICBPVUlJbmRleCA9IENTUl9PVUlfVVNFX0dST1VQX0NJUEhFUl9JTkRFWDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fV0FQSQorICAgICAgICAgICBjYXNlIGVDU1JfRU5DUllQVF9UWVBFX1dQSToKKyAgICAgICAgICAgICAgIE9VSUluZGV4ID0gQ1NSX09VSV9XQVBJX1dBSV9DRVJUX09SX1NNUzRfSU5ERVg7CisgICAgICAgICAgICAgICBicmVhazsKKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fV0FQSSAqLworICAgICAgICAgICAgZGVmYXVsdDogLy9IT1dUTyBoYW5kbGUgdGhpcz8KKyAgICAgICAgICAgICAgICBPVUlJbmRleCA9IENTUl9PVUlfUkVTRVJWRURfSU5ERVg7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0vL3N3aXRjaAorCisgICAgICAgIHJldHVybiBPVUlJbmRleDsKK30KKwordEFOSV9CT09MRUFOIGNzckdldFJTTkluZm9ybWF0aW9uKCB0SGFsSGFuZGxlIGhIYWwsIHRDc3JBdXRoTGlzdCAqcEF1dGhUeXBlLCBlQ3NyRW5jcnlwdGlvblR5cGUgZW5UeXBlLCB0Q3NyRW5jcnlwdGlvbkxpc3QgKnBNQ0VuY3J5cHRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVJTTiAqcFJTTkllLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqVW5pY2FzdEN5cGhlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKk11bHRpY2FzdEN5cGhlciwKKyAgICAgICA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gICAgICAgICAgY011bHRpY2FzdEN5cGhlcnMrKzsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShNdWx0aWNhc3RDeXBoZXJzLCBwUlNOSWUtPmdwX2NpcGhlcl9zdWl0ZSwgQ1NSX1JTTl9PVUlfU0laRSk7CisgICAgICAgICAgICBjVW5pY2FzdEN5cGhlcnMgPSAodEFOSV9VOCkocFJTTkllLT5wd2lzZV9jaXBoZXJfc3VpdGVfY291bnQpOworICAgICAgICAgICAgY0F1dGhTdWl0ZXMgPSAodEFOSV9VOCkocFJTTkllLT5ha21fc3VpdGVfY291bnQpOworICAgICAgICAgICAgZm9yKGkgPSAwOyBpIDwgY0F1dGhTdWl0ZXMgJiYgaSA8IENTUl9SU05fTUFYX0FVVEhfU1VJVEVTOyBpKyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCh2b2lkICopJkF1dGhTdWl0ZXNbaV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopJnBSU05JZS0+YWttX3N1aXRlc1tpXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1NSX1JTTl9PVUlfU0laRSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vQ2hlY2sgLSBJcyByZXF1ZXN0ZWQgVW5pY2FzdCBDaXBoZXIgc3VwcG9ydGVkIGJ5IHRoZSBCU1MuCisgICAgICAgICAgICBmQWNjZXB0YWJsZUN5cGhlcnMgPSBjc3JNYXRjaFJTTk9VSUluZGV4KCBwTWFjLCBwUlNOSWUtPnB3aXNlX2NpcGhlcl9zdWl0ZXMsIGNVbmljYXN0Q3lwaGVycywgCisgICAgICAgICAgICAgICAgICAgIGNzckdldE9VSUluZGV4RnJvbUNpcGhlciggZW5UeXBlICksIFVuaWNhc3QgKTsgCisKKyAgICAgICAgICAgIGlmKCAhZkFjY2VwdGFibGVDeXBoZXJzICkgYnJlYWs7CisKKworICAgICAgICAgICAgLy9VbmljYXN0IGlzIHN1cHBvcnRlZC4gUGljayB0aGUgZmlyc3QgbWF0Y2hpbmcgR3JvdXAgY2lwaGVyLCBpZiBhbnkuCisgICAgICAgICAgICBmb3IoIGkgPSAwIDsgaSA8IHBNQ0VuY3J5cHRpb24tPm51bUVudHJpZXMgOyBpKysgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGZBY2NlcHRhYmxlQ3lwaGVycyA9IGNzck1hdGNoUlNOT1VJSW5kZXgoIHBNYWMsIE11bHRpY2FzdEN5cGhlcnMsICBjTXVsdGljYXN0Q3lwaGVycywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyR2V0T1VJSW5kZXhGcm9tQ2lwaGVyKCBwTUNFbmNyeXB0aW9uLT5lbmNyeXB0aW9uVHlwZVtpXSApLCBNdWx0aWNhc3QgKTsKKyAgICAgICAgICAgICAgICBpZihmQWNjZXB0YWJsZUN5cGhlcnMpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiggIWZBY2NlcHRhYmxlQ3lwaGVycyApIGJyZWFrOworCisgICAgICAgICAgICBpZiggcE5lZ290aWF0ZWRNQ0NpcGhlciApCisgICAgICAgICAgICAgICAgKnBOZWdvdGlhdGVkTUNDaXBoZXIgPSBwTUNFbmNyeXB0aW9uLT5lbmNyeXB0aW9uVHlwZVtpXTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgLyogSW5pdGlhbGl6aW5nIHdpdGggRkFMU0UgYXMgaXQgaGFzIFRSVUUgdmFsdWUgYWxyZWFkeSAqLworICAgICAgICAgICAgZkFjY2VwdGFibGVDeXBoZXJzID0gRkFMU0U7CisgICAgICAgICAgICBmb3IgKGkgPSAwIDsgaSA8IHBBdXRoVHlwZS0+bnVtRW50cmllczsgaSsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vQ2lwaGVycyBhcmUgc3VwcG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BlLT5hdXRoVHlwZVtpXSkKKyAgICAgICAgICAgICAgICAgICAgICAgIG5lZ0F1dGhUeXBlID0gZUNTUl9BVVRIX1RZUEVfUlNOX1BTSzsKKyAgICAgICAgICAgICAgICB9CisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgICAgICAgICAgICAgIGlmICgobmVnQXV0aFR5cGUgPT0gZUNTUl9BVVRIX1RZUEVfVU5LTk9XTikgJiYgY3NySXNBdXRoUlNOUHNrU2hhMjU2KCBwTWFjLCBBdXRoU3VpdGVzLCBjQXV0aFN1aXRlcywgQXV0aGVudGljYXRpb24gKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAoZUNTUl9BVVRIX1RZUEVfUlNOX1BTS19TSEEyNTYgPT0gcEF1dGhUeXBlLT5hdXRoVHlwZVtpXSkKKyAgICAgICAgICAgICAgICAgICAgICAgIG5lZ0F1dGhUeXBlID0gZUNTUl9BVVRIX1RZUEVfUlNOX1BTS19TSEEyNTY7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICgobmVnQXV0aFR5cGUgPT0gZUNTUl9BVVRIX1RZUEVfVU5LTk9XTikgJiYKKyAgICAgICAgICAgICAgICAgICAgY3NySXNBdXRoUlNOODAyMXhTaGEyNTYocE1hYywgQXV0aFN1aXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNBdXRoU3VpdGVzLCBBdXRoZW50aWNhdGlvbikpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGVDU1JfQVVUSF9UWVBFX1JTTl84MDIxWF9TSEEyNTYgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEF1dGhUeXBlLT5hdXRoVHlwZVtpXSkKKyAgICAgICAgICAgICAgICAgICAgICAgIG5lZ0F1dGhUeXBlID0gZUNTUl9BVVRIX1RZUEVfUlNOXzgwMjFYX1NIQTI1NjsKKyAgICAgICAgICAgICAgICB9CisjZW5kaWYKKworICAgICAgICAgICAgICAgIC8vIFRoZSAxc3QgYXV0aCB0eXBlIGluIHRoZSBBUHMgUlNOIElFLCB0byBtYXRjaCBzdGF0aW9ucyBjb25uZWN0aW5nCisgICAgICAgICAgICAgICAgLy8gcHJvZmlsZXMgYXV0aCB0eXBlIHdpbGwgY2F1c2UgdXMgdG8gZXhpdCB0aGlzIGxvb3AKKyAgICAgICAgICAgICAgICAvLyBUaGlzIGlzIGFkZGVkIGFzIHNvbWUgQVBzIGFkdmVydGlzZSBtdWx0aXBsZSBha21zIGluIHRoZSBSU04gSUUuCisgICAgICAgICAgICAgICAgaWYgKGVDU1JfQVVUSF9UWVBFX1VOS05PV04gIT0gbmVnQXV0aFR5cGUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBmQWNjZXB0YWJsZUN5cGhlcnMgPSBUUlVFOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IC8vIGZvcgorICAgICAgICB9CisKKyAgICB9d2hpbGUgKDApOworCisgICAgaWYgKCBmQWNjZXB0YWJsZUN5cGhlcnMgKQorICAgIHsKKyAgICAgICAgaWYgKCBNdWx0aWNhc3RDeXBoZXIgKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoTXVsdGljYXN0Q3lwaGVyLCBNdWx0aWNhc3QsIENTUl9SU05fT1VJX1NJWkUpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCBVbmljYXN0Q3lwaGVyICkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KFVuaWNhc3RDeXBoZXIsIFVuaWNhc3QsIENTUl9SU05fT1VJX1NJWkUpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCBBdXRoU3VpdGUgKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoQXV0aFN1aXRlLCBBdXRoZW50aW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CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIGl0IGlzIGRpc2FibGVkIHRoZW4gbWFrZSBub3JtYWwgY29ubmVjdGlvbi4KKyAgICAgICAgICAgcEZpbHRlck1GUFJlcXVpcmVkIC0gZ2l2ZW4gYnkgc3VwcGxpY2FudCBiYXNlZCBvbiBvdXIgY29uZmlndXJhdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiBpdCBpcyAxIHRoZW4gd2Ugd2lsbCByZXF1aXJlIG1hbmRhdG9yeQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQTUYgY29ubmVjdGlvbiBhbmQgaWYgaXQgaXMgMCB0aGVuIHdlIFBNRgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uIGlzIG9wdGlvbmFsLgorICAgICAgICAgICBwRmlsdGVyTUZQQ2FwYWJsZSAgLSBnaXZlbiBieSBzdXBwbGljYW50IGJhc2VkIG9uIG91ciBjb25maWd1cmF0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIGl0IDEgdGhlbiB3ZSBhcmUgUE1GIGNhcGFibGUgYW5kIGlmIGl0IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlbiB3ZSBhcmUgbm90IFBNRiBjYXBhYmxlLgorICAgICAgICAgICBwUlNOSWUgICAgICAgICAgICAgLSBSU05JZSBmcm9tIEJlYWNvbi9wcm9iZSByZXNwb25zZSBvZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZWlnaGJvciBBUCBhZ2FpbnN0IHdoaWNoIHdlIHdpbGwgY29tcGFyZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXIgY2FwYWJpbGl0aWVzLgorCisgICAgXHJldHVybiB0QU5JX0JPT0xFQU4gICAgICAtIGlmIG91ciBQTUYgY2FwYWJpbGl0aWVzIG1hdGNoZXMgd2l0aCBBUCB0aGVuIHdlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbGwgcmV0dXJuIHRydWUgdG8gaW5kaWNhdGUgdGhhdCB3ZSBhcmUgZ29vZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byBtYWtlIGNvbm5lY3Rpb24gd2l0aCBpdC4gRWxzZSB3ZSB3aWxsIHJldHVybgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZS4KKyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCitzdGF0aWMgdEFOSV9CT09MRUFOCitjc3JJc1BNRkNhcGFiaWxpdGllc0luUlNOTWF0Y2goIHRIYWxIYW5kbGUgaEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9CT09MRUFOICpwRmlsdGVyTUZQRW5hYmxlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEZpbHRlck1GUFJlcXVpcmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwRmlsdGVyTUZQQ2FwYWJsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUlNOICpwUlNOSWUpCit7CisgICAgdEFOSV9VOCBhcFByb2ZpbGVNRlBDYXBhYmxlICA9IDA7CisgICAgdEFOSV9VOCBhcFByb2ZpbGVNRlBSZXF1aXJlZCA9IDA7CisgICAgaWYgKHBSU05JZSAmJiBwRmlsdGVyTUZQRW5hYmxlZCAmJiBwRmlsdGVyTUZQQ2FwYWJsZSAmJiBwRmlsdGVyTUZQUmVxdWlyZWQpCisgICAgeworICAgICAgIC8qIEV4dHJhY3RpbmcgTUZQQ2FwYWJsZSBiaXQgZnJvbSBSU04gSWUgKi8KKyAgICAgICBhcFByb2ZpbGVNRlBDYXBhYmxlICA9IChwUlNOSWUtPlJTTl9DYXBbMF0gPj4gNykgJiAweDE7CisgICAgICAgYXBQcm9maWxlTUZQUmVxdWlyZWQgPSAocFJTTkllLT5SU05fQ2FwWzBdID4+IDYpICYgMHgxOworICAgICAgIGlmICgqcEZpbHRlck1GUEVuYWJsZWQgJiYgKnBGaWx0ZXJNRlBDYXBhYmxlICYmICpwRmlsdGVyTUZQUmVxdWlyZWQKKyAgICAgICAgICAgJiYgKGFwUHJvZmlsZU1GUENhcGFibGUgPT0gMCkpCisgICAgICAgeworICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgIkFQIGlzIG5vdCBjYXBhYmxlIHRvIG1ha2UgUE1GIGNvbm5lY3Rpb24iKTsKKyAgICAgICAgICAgcmV0dXJuIFZPU19GQUxTRTsKKyAgICAgICB9CisgICAgICAgZWxzZSBpZiAoKnBGaWx0ZXJNRlBFbmFibGVkICYmICpwRmlsdGVyTUZQQ2FwYWJsZSAmJgorICAgICAgICAgICAgICAgICEoKnBGaWx0ZXJNRlBSZXF1aXJlZCkgJiYgKGFwUHJvZmlsZU1GUENhcGFibGUgPT0gMCkpCisgICAgICAgeworICAgICAgICAgICAvKgorICAgICAgICAgICAgKiBUaGlzIGlzIHRyaWNreSwgYmVjYXVzZSBzdXBwbGljYW50IGFza2VkIHVzIHRvIG1ha2UgbWFuZGF0b3J5CisgICAgICAgICAgICAqIFBNRiBjb25uZWN0aW9uIGV2ZW50aG91Z2ggUE1GIGNvbm5lY3Rpb24gaXMgb3B0aW9uYWwgaGVyZS4KKyAgICAgICAgICAgICogc28gaWYgQVAgaXMgbm90IGNhcGFibGUgb2YgUE1GIHRoZW4gZHJvcCBpdC4gRG9uJ3QgdHJ5IHRvCisgICAgICAgICAgICAqIGNvbm5lY3Qgd2l0aCBpdC4KKyAgICAgICAgICAgICovCisgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICJ3ZSBuZWVkIFBNRiBjb25uZWN0aW9uICYgQVAgaXNuJ3QgY2FwYWJsZSB0byBtYWtlIFBNRiBjb25uZWN0aW9uIik7CisgICAgICAgICAgIHJldHVybiBWT1NfRkFMU0U7CisgICAgICAgfQorICAgICAgIGVsc2UgaWYgKCEoKnBGaWx0ZXJNRlBDYXBhYmxlKSAmJgorICAgICAgICAgICAgICAgIGFwUHJvZmlsZU1GUENhcGFibGUgJiYgYXBQcm9maWxlTUZQUmVxdWlyZWQpCisgICAgICAgeworICAgICAgICAgICAvKgorICAgICAgICAgICAgKiBJbiB0aGlzIGNhc2UsIEFQIHdpdGggd2hvbSB3ZSB0cnlpbmcgdG8gY29ubmVjdCByZXF1aXJlcworICAgICAgICAgICAgKiBtYW5kYXRvcnkgUE1GIGNvbm5lY3Rpb25zIGFuZCB3ZSBhcmUgbm90IGNhcGFibGUgc28gdGhpcyBBUAorICAgICAgICAgICAgKiBpcyBub3QgZ29vZCBjaG9pY2UgdG8gY29ubmVjdAorICAgICAgICAgICAgKi8KKyAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgIkFQIG5lZWRzIFBNRiBjb25uZWN0aW9uIGFuZCB3ZSBhcmUgbm90IGNhcGFibGUgb2YgcG1mIGNvbm5lY3Rpb24iKTsKKyAgICAgICAgICAgcmV0dXJuIFZPU19GQUxTRTsKKyAgICAgICB9CisgICAgICAgZWxzZSBpZiAoISgqcEZpbHRlck1GUEVuYWJsZWQpICYmICpwRmlsdGVyTUZQQ2FwYWJsZSAmJgorICAgICAgICAgICAgICAgIChhcFByb2ZpbGVNRlBDYXBhYmxlID09IDEpKQorICAgICAgIHsKKyAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgIndlIGRvbid0IG5lZWQgUE1GIGNvbm5lY3Rpb24gZXZlbnRob3VnaCBib3RoIHBhcnRpZXMgYXJlIGNhcGFibGUiKTsKKyAgICAgICAgICAgcmV0dXJuIFZPU19GQUxTRTsKKyAgICAgICB9CisgICAgfQorICAgIHJldHVybiBWT1NfVFJVRTsKK30KKyNlbmRpZgorCit0QU5JX0JPT0xFQU4gY3NySXNSU05NYXRjaCggdEhhbEhhbmRsZSBoSGFsLCB0Q3NyQXV0aExpc3QgKnBBdXRoVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ3NyRW5jcnlwdGlvblR5cGUgZW5UeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRDc3JFbmNyeXB0aW9uTGlzdCAqcEVuTWNUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfQk9PTEVBTiAqcE1GUEVuYWJsZWQsIHRBTklfVTggKnBNRlBSZXF1aXJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwTUZQQ2FwYWJsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmQmVhY29uSUVzICpwSWVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDc3JBdXRoVHlwZSAqcE5lZ290aWF0ZWRBdXRoVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ3NyRW5jcnlwdGlvblR5cGUgKnBOZWdvdGlhdGVkTUNDaXBoZXIgKQoreworICAgIHRBTklfQk9PTEVBTiBmUlNOTWF0Y2ggPSBGQUxTRTsKKworICAgICAgICAvLyBTZWUgaWYgdGhlIGN5cGhlcnMgaW4gdGhlIEJzcyBkZXNjcmlwdGlvbiBtYXRjaCB3aXRoIHRoZSBzZXR0aW5ncyBpbiB0aGUgcHJvZmlsZS4KKyAgICBmUlNOTWF0Y2ggPSBjc3JHZXRS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AgeworICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiAgc2Vzc2lvbiAlZCBub3QgZm91bmQgIiksIHNlc3Npb25JZCk7CisgICAgICAgIHJldHVybiBGQUxTRTsKKyAgICB9CisgICAvKiB0byBmb3JjZSB0aGUgQVAgaW5pdGlhdGUgZnJlc2ggODAyLjF4IGF1dGhlbnRpY2F0aW9uIGFmdGVyIHJlLWFzc29jaWF0aW9uIHNob3VsZCBub3QgCisgICAgKiBmaWxsIHRoZSBQTUtJRCBmcm9tIGNhY2hlICB0aGlzIGlzIG5lZWRlZCAKKyAgICAqIGJ5IHRoZSBIUyAyLjAgcGFzc3BvaW50IGNlcnRpZmljYXRpb24gNS4yLmEgYW5kIGIgdGVzdGNhc2VzICovIAorICAgIAorICAgIGlmKHBTZXNzaW9uLT5mSWdub3JlUE1LSURDYWNoZSkKKyAgICB7CisgICAgICAgIHBTZXNzaW9uLT5mSWdub3JlUE1LSURDYWNoZSA9IEZBTFNFOworICAgICAgICByZXR1cm4gZlJDOworICAgIH0KKyAgICAKKyAgICBkbworICAgIHsKKyAgICAgICAgZm9yKCBJbmRleD0wOyBJbmRleCA8IENTUl9NQVhfUE1LSURfQUxMT1dFRDsgSW5kZXgrKyApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKCB2b3NfbWVtX2NvbXBhcmUocEJTU0lkLCBwU2Vzc2lvbi0+UG1raWRDYWNoZUluZm9bSW5kZXhdLkJTU0lELCBzaXplb2YodENzckJzc2lkKSkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIG1hdGNoIGZvdW5kCisgICAgICAgICAgICAgICAgZk1hdGNoRm91bmQgPSBUUlVFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYoICFmTWF0Y2hGb3VuZCApIGJyZWFrOworCisgICAgICAgIHZvc19tZW1fY29weShwUE1LSWQsIHBTZXNzaW9uLT5QbWtpZENhY2hlS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QTUtJRCwgUE1LSWQsIENTUl9SU05fUE1LSURfU0laRSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBwUE1LLT5jUE1LSURzID0gMDsKKyAgICAgICAgfQorCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgICAgICBpZiAoIHBQcm9maWxlLT5NRlBFbmFibGVkICkKKyAgICAgICAgeworICAgICAgICAgICAgcEdyb3VwTWdtdENpcGhlclN1aXRlID0gKHRBTklfVTggKikgcFBNSyArIHNpemVvZiAoIHRBTklfVTE2ICkgKworICAgICAgICAgICAgICAgICggcFBNSy0+Y1BNS0lEcyAqIENTUl9SU05fUE1LSURfU0laRSApOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBHcm91cE1nbXRDaXBoZXJTdWl0ZSwgY3NyUlNOT3VpWzA3XSwgQ1NSX1dQQV9PVUlfU0laRSk7CisgICAgICAgIH0KKyNlbmRpZgorCisgICAgICAgIC8vIEFkZCBpbiB0aGUgZml4ZWQgZmllbGRzIHBsdXMgMSBVbmljYXN0IGN5cGhlciwgbGVzcyB0aGUgSUUgSGVhZGVyIGxlbmd0aAorICAgICAgICAvLyBBZGQgaW4gdGhlIHNpemUgb2YgdGhlIEF1dGggc3VpdGUgKGNvdW50IHBsdXMgYSBzaW5nbGUgT1VJKQorICAgICAgICAvLyBBZGQgaW4gdGhlIFJTTiBjYXBzIGZpZWxkLgorICAgICAgICAvLyBBZGQgUE1LSUQgY291bnQgYW5kIFBNS0lEIChpZiBhbnkpCisgICAgICAgIC8vIEFkZCBncm91cCBtYW5hZ2VtZW50IGNpcGhlciBzdWl0ZQorICAgICAgICBwUlNOSWUtPkllSGVhZGVyLkxlbmd0aCA9ICh0QU5JX1U4KSAoc2l6ZW9mKCAqcFJTTkllICkgLSBzaXplb2YgKCBwUlNOSWUtPkllSGVhZGVyICkgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiggKnBBdXRoU3VpdGUgKSArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCB0Q3NyUlNOQ2FwYWJpbGl0aWVzICkpOworICAgICAgICBpZihwUE1LLT5jUE1LSURzKQorICAgICAgICB7CisgICAgICAgICAgICBwUlNOSWUtPkllSGVhZGVyLkxlbmd0aCArPSAodEFOSV9VOCkoc2l6ZW9mKCB0QU5JX1UxNiApICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocFBNSy0+Y1BNS0lEcyAqIENTUl9SU05fUE1LSURfU0laRSkpOworICAgICAgICB9CisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgICAgICBpZiAoIHBQcm9maWxlLT5NRlBFbmFibGVkICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKCAwID09IHBQTUstPmNQTUtJRHMgKQorICAgICAgICAgICAgICAgIHBSU05JZS0+SWVIZWFkZXIuTGVuZ3RoICs9IHNpemVvZiggdEFOSV9VMTYgKTsKKyAgICAgICAgICAgIHBSU05JZS0+SWVIZWFkZXIuTGVuZ3RoICs9IENTUl9XUEFfT1VJX1NJWkU7CisgICAgICAgIH0KKyNlbmRpZgorCisgICAgICAgIC8vIHJldHVybiB0aGUgc2l6ZSBvZiB0aGUgSUUgaGVhZGVyICh0b3RhbCkgY29uc3RydWN0ZWQuLi4KKyAgICAgICAgY2JSU05JZSA9IHBSU05JZS0+SWVIZWFkZXIuTGVuZ3RoICsgc2l6ZW9mKCBwUlNOSWUtPkllSGVhZGVyICk7CisKKyAgICB9IHdoaWxlKCAwICk7CisKKyAgICBpZiggIXBJZXMgJiYgcEllc0xvY2FsICkKKyAgICB7CisgICAgICAgIC8vbG9jYWxseSBhbGxvY2F0ZWQKKyAgICAgICAgdm9zX21lbV9mcmVlKHBJZXNMb2NhbCk7CisgICAgfQorCisgICAgcmV0dXJuKCBjYlJTTkllICk7Cit9CisKKworI2lmZGVmIEZFQVRVUkVfV0xBTl9XQVBJCit0QU5JX0JPT0xFQU4gY3NyR2V0V2FwaUluZm9ybWF0aW9uKCB0SGFsSGFuZGxlIGhIYWwsIHRDc3JBdXRoTGlzdCAqcEF1dGhUeXBlLCBlQ3NyRW5jcnlwdGlvblR5cGUgZW5UeXBlLCB0Q3NyRW5jcnlwdGlvbkxpc3QgKnBNQ0VuY3J5cHRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdBUEkgKnBXYXBpSWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpVbmljYXN0Q3lwaGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqTXVsdGljYXN0Q3lwaGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqQXV0aFN1aXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNzckF1dGhUeXBlICpwTmVnb3RpYXRlZEF1dGh0eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNzckVuY3J5cHRpb25UeXBlICpwTmVnb3RpYXRlZE1DQ2lwaGVyICkKK3sKKyAgICB0cEFuaVNpckdsb2JhbCBwTWFjID0gUE1BQ19TVFJVQ1QoIGhIYWwgKTsKKyAgICB0QU5JX0JPT0xFQU4gZkFjY2VwdGFibGVDeXBoZXJzID0gRkFMU0U7CisgICAgdEFOSV9VOCBjVW5pY2FzdEN5cGhlcnMgPSAwOworICAgIHRBTklfVTggY011bHRpY2FzdEN5cGhlcnMgPSAwOworICAgIHRBTklfVTggY0F1dGhTdWl0ZXMgPSAwLCBpOworICAgIHRBTklfVTggVW5pY2FzdFsgQ1NSX1dBUElfT1VJX1NJWkUgXTsKKyAgICB0QU5JX1U4IE11bHRpY2FzdFsgQ1NSX1dBUElfT1VJX1NJWkUgXTsKKyAgICB0QU5JX1U4IEF1dGhTdWl0ZXNbIENTUl9XQVBJX01BWF9BVVRIX1NVSVRFUyBdWyBDU1JfV0FQSV9PVUlfU0laRSBdOworICAgIHRBTklfVTggQXV0aGVudGljYXRpb25bIENTUl9XQVBJX09VSV9TSVpFIF07CisgICAgdEFOSV9VOCBNdWx0aWNhc3RDeXBoZXJzWyBDU1JfV0FQSV9NQVhfTVVMVElDQVNUX0NZUEhFUlMgXVsgQ1NSX1dBUElfT1VJX1NJWkUgXTsKKyAgICBlQ3NyQXV0aFR5cGUgbmVnQXV0aFR5cGUgPSBlQ1NSX0FVVEhfVFlQRV9VTktOT1dOOworCisgICAgZG97CisgICAgICAgIGlmICggcFdhcGlJZS0+cHJlc2VudCApCisgICAgICAgIHsKKyAgICAgICAgICAgIGNNdWx0aWNhc3RDeXBoZXJzKys7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoTXVsdGljYXN0Q3lwaGVycywgcFdhcGlJZS0+bXVsdGljYXN0X2NpcGhlcl9zdWl0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBDU1JfV0FQSV9PVUlfU0laRSk7CisgICAgICAgICAgICBjVW5pY2FzdEN5cGhlcnMgPSAodEFOSV9VOCkocFdhcGlJZS0+dW5pY2FzdF9jaXBoZXJfc3VpdGVfY291bnQpOworICAgICAgICAgICAgY0F1dGhTdWl0ZXMgPSAodEFOSV9VOCkocFdhcGlJZS0+YWttX3N1aXRlX2NvdW50KTsKKyAgICAgICAgICAgIGZvcihpID0gMDsgaSA8IGNBdXRoU3VpdGVzICYmIGkgPCBDU1JfV0FQSV9NQVhfQVVUSF9TVUlURVM7IGkrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHZvaWQgKikmQXV0aFN1aXRlc1tpXSwgKHZvaWQgKikmcFdhcGlJZS0+YWttX3N1aXRlc1tpXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1NSX1dBUElfT1VJX1NJWkUpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvL0NoZWNrIC0gSXMgcmVxdWVzdGVkIFVuaWNhc3QgQ2lwaGVyIHN1cHBvcnRlZCBieSB0aGUgQlNTLgorICAgICAgICAgICAgZkFjY2VwdGFibGVDeXBoZXJzID0gY3NyTWF0Y2hXYXBpT1VJSW5kZXgoIHBNYWMsIHBXYXBpSWUtPnVuaWNhc3RfY2lwaGVyX3N1aXRlcywgY1VuaWNhc3RDeXBoZXJzLCAKKyAgICAgICAgICAgICAgICAgICAgY3NyR2V0T1VJSW5kZXhGcm9tQ2lwaGVyKCBlblR5cGUgKSwgVW5pY2FzdCApOyAKKworICAgICAgICAgICAgaWYoICFmQWNjZXB0YWJsZUN5cGhlcnMgKSBicmVhazsKKworCisgICAgICAgICAgICAvL1VuaWNhc3QgaXMgc3VwcG9ydGVkLiBQaWNrIHRoZSBmaXJzdCBtYXRjaGluZyBHcm91cCBjaXBoZXIsIGlmIGFueS4KKyAgICAgICAgICAgIGZvciggaSA9IDAgOyBpIDwgcE1DRW5jcnlwdGlvbi0+bnVtRW50cmllcyA7IGkrKyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZkFjY2VwdGFibGVDeXBoZXJzID0gY3NyTWF0Y2hXYXBpT1VJSW5kZXgoIHBNYWMsIE11bHRpY2FzdEN5cGhlcnMsICBjTXVsdGljYXN0Q3lwaGVycywgCisgICAgICAgICAgICAgICAgY3NyR2V0T1VJSW5kZXhGcm9tQ2lwaGVyKCBwTUNFbmNyeXB0aW9uLT5lbmNyeXB0aW9uVHlwZVtpXSApLCBNdWx0aWNhc3QgKTsKKyAgICAgICAgICAgICAgICBpZihmQWNjZXB0YWJsZUN5cGhlcnMpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiggIWZBY2NlcHRhYmxlQ3lwaGVycyApIGJyZWFrOworCisgICAgICAgICAgICBpZiggcE5lZ290aWF0ZWRNQ0NpcGhlciApCisgICAgICAgICAgICAgICAgKnBOZWdvdGlhdGVkTUNDaXBoZXIgPSBwTUNFbmNyeXB0aW9uLT5lbmNyeXB0aW9uVHlwZVtpXTsKKworICAgICAgICAgICAgLy9DaXBoZXJzIGFyZSBzdXBwb3J0ZWQsIE1hdGNoIGF1dGhlbnRpY2F0aW9uIGFsZ29yaXRobSBhbmQgcGljayBmaXJzdCBtYXRjaGluZyBhdXRodHlwZS4KKyAgICAgICAgICAgIGlmICggY3NySXNBdXRoV2FwaUNlcnQoIHBNYWMsIEF1dGhTdWl0ZXMsIGNBdXRoU3VpdGVzLCBBdXRoZW50aWNhdGlvbiApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBuZWdBdXRoVHlwZSA9IGVDU1JfQVVUSF9UWVBFX1dBUElfV0FJX0NFUlRJRklDQVRFOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoIGNzcklzQXV0aFdhcGlQc2soIHBNYWMsIEF1dGhTdWl0ZXMsIGNBdXRoU3VpdGVzLCBBdXRoZW50aWNhdGlvbiApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBuZWdBdXRoVHlwZSA9IGVDU1JfQVVUSF9UWVBFX1dBUElfV0FJX1BTSzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBmQWNjZXB0YWJsZUN5cGhlcnMgPSBGQUxTRTsKKyAgICAgICAgICAgICAgICBuZWdBdXRoVHlwZSA9IGVDU1JfQVVUSF9UWVBFX1VOS05PV047CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiggKCAwID09IHBBdXRoVHlwZS0+bnVtRW50cmllcyApIHx8ICggRkFMU0UgPT0gZkFjY2VwdGFibGVDeXBoZXJzICkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vQ2FsbGVyIGRvZXNuJ3QgY2FyZSBhYm91dCBhdXRoIHR5cGUsIG9yIEJTUyBkb2Vzbid0IG1hdGNoCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmQWNjZXB0YWJsZUN5cGhlcnMgPSBGQUxTRTsKKyAgICAgICAgICAgIGZvciggaSA9IDAgOyBpIDwgcEF1dGhUeXBlLT5udW1FbnRyaWVzOyBpKysgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKCBwQXV0aFR5cGUtPmF1dGhUeXBlW2ldID09IG5lZ0F1dGhUeXBlICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGZBY2NlcHRhYmxlQ3lwaGVycyA9IFRSVUU7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH13aGlsZSAoMCk7CisKKyAgICBpZiAoIGZBY2NlcHRhYmxlQ3lwaGVycyApCisgICAgeworICAgICAgICBpZiAoIE11bHRpY2FzdEN5cGhlciApCisgICAgICAgIHsKKyAgICAgICAgICAgdm9zX21lbV9jb3B5KE11bHRpY2FzdEN5cGhlciwgTXVsdGljYXN0LCBDU1JfV0FQSV9PVUlfU0laRSk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIFVuaWNhc3RDeXBoZXIgKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoVW5pY2FzdEN5cGhlciwgVW5pY2FzdCwgQ1NSX1dBUElfT1VJX1NJWkUpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCBBdXRoU3VpdGUgKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoQXV0aFN1aXRlLCBBdXRoZW50aWNhdGlvbiwgQ1NSX1dBUElfT1VJX1NJWkUpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCBwTmVnb3RpYXRlZEF1dGh0eXBlICkKKyAgICAgICAgeworICAgICAgICAgICAgKnBOZWd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AgICB0QU5JX0JPT0xFQU4gZlJDID0gRkFMU0UsIGZNYXRjaEZvdW5kID0gRkFMU0U7CisgICAgdEFOSV9VMzIgSW5kZXg7CisgICAgdENzclJvYW1TZXNzaW9uICpwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTiggcE1hYywgc2Vzc2lvbklkICk7CisKKyAgICBpZighcFNlc3Npb24pCisgICAgeworICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiAgc2Vzc2lvbiAlZCBub3QgZm91bmQgIiksIHNlc3Npb25JZCk7CisgICAgICAgIHJldHVybiBGQUxTRTsKKyAgICB9CisKKyAgICBkbworICAgIHsKKyAgICAgICAgZm9yKCBJbmRleD0wOyBJbmRleCA8IHBTZXNzaW9uLT5OdW1Ca2lkQ2FjaGU7IEluZGV4KysgKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywgIm1hdGNoIEJLSUQgIk1BQ19BRERSRVNTX1NUUiIgdG8gIiwKKyAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwQlNTSWQpKTsKKyAgICAgICAgICAgIGlmICh2b3NfbWVtX2NvbXBhcmUocEJTU0lkLCBwU2Vzc2lvbi0+QmtpZENhY2hlSW5mb1tJbmRleF0uQlNTSUQsIHNpemVvZih0Q3NyQnNzaWQpICkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIG1hdGNoIGZvdW5kCisgICAgICAgICAgICAgICAgZk1hdGNoRm91bmQgPSBUUlVFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYoICFmTWF0Y2hGb3VuZCApIGJyZWFrOworCisgICAgICAgIHZvc19tZW1fY29weShwQktJZCwgcFNlc3Npb24tPkJraWRDYWNoZUluZm9bSW5kZXhdLkJLSUQsIENTUl9XQVBJX0JLSURfU0laRSk7CisKKyAgICAgICAgZlJDID0gVFJVRTsKKyAgICB9CisgICA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Xplb2YoIEF1dGhTdWl0ZSApKTsKKworICAgICAgICBwV2FwaSA9ICh0QU5JX1U4ICopICgmcFdhcGlJZS0+QXV0aE91aVsgMSBdKTsKKworICAgICAgICAqcFdhcGkgPSAodEFOSV9VMTYpMTsgLy9jVW5pY2FzdEN5cGhlcnMKKyAgICAgICAgcFdhcGkrPTI7CisgICAgICAgIHZvc19tZW1fY29weShwV2FwaSwgVW5pY2FzdEN5cGhlciwgc2l6ZW9mKCBVbmljYXN0Q3lwaGVyICkpOworICAgICAgICBwV2FwaSArPSBzaXplb2YoIFVuaWNhc3RDeXBoZXIgKTsKKworICAgICAgICB2b3NfbWVtX2NvcHkocFdhcGksIE11bHRpY2FzdEN5cGhlciwgc2l6ZW9mKCBNdWx0aWNhc3RDeXBoZXIgKSk7CisgICAgICAgIHBXYXBpICs9IHNpemVvZiggTXVsdGljYXN0Q3lwaGVyICk7CisKKworICAgICAgICAvLyBXQVBJIGNhcGFiaWxpdGllcyBmb2xsb3dzIHRoZSBBdXRoIFN1aXRlICh0d28gb2N0ZWN0cykKKyAgICAgICAgLy8gd2Ugc2hvdWxkbid0IEVWRVIgYmUgc2VuZGluZyBvdXQgInByZS1hdXRoIHN1cHBvcnRlZCIuICBJdCBpcyBhbiBBUCBvbmx5IGNhcGFiaWxpdHkKKyAgICAgICAgLy8gJiBzaW5jZSB3ZSBhbHJlYWR5IGRpZCBhIG1lbXNldCBwV2FwaUllIHRvIDAsIHNraXAgdGhlc2UgZmllbGRzCisgICAgICAgIHBXYXBpICs9MjsKKworICAgICAgICBmQktJREZvdW5kID0gY3NyTG9va3VwQktJRCggcE1hYywgc2Vzc2lvbklkLCBwU2lyQnNzRGVzYy0+YnNzSWQsICYoQktJZFswXSkgKTsKKworCisgICAgICAgIGlmKCBmQktJREZvdW5kICkKKyAgICAgICAgeworICAgICAgICAgICAgLyogRG8gd2UgbmVlZCB0byBjaGFuZ2UgdGhlIGVuZGlhbm5lc3MgaGVyZSAqLworICAgICAgICAgICAgKnBXYXBpID0gKHRBTklfVTE2KTE7IC8vY0JLSURzCisgICAgICAgICAgICBwV2FwaSs9MjsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwV2FwaSwgQktJZCwgQ1NSX1dBUElfQktJRF9TSVpFKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgICpwV2FwaSA9IDA7CisgICAgICAgICAgICBwV2FwaSs9MTsKKyAgICAgICAgICAgICpwV2FwaSA9IDA7CisgICAgICAgICAgICBwV2FwaSs9MTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIEFkZCBpbiB0aGUgSUUgZmllbGRzIGV4Y2VwdCB0aGUgSUUgaGVhZGVyCisgICAgICAgIC8vIEFkZCBCS0lEIGNvdW50IGFuZCBCS0lEIChpZiBhbnkpCisgICAgICAgIHBXYXBpSWUtPkllSGVhZGVyLkxlbmd0aCA9ICh0QU5JX1U4KSAoc2l6ZW9mKCAqcFdhcGlJZSApIC0gc2l6ZW9mICggcFdhcGlJZS0+SWVIZWFkZXIgKSk7CisKKyAgICAgICAgLyoyIGJ5dGVzIGZvciBCS0lEIENvdW50IGZpZWxkKi8KKyAgICAgICAgcFdhcGlJZS0+SWVIZWFkZXIuTGVuZ3RoICs9IHNpemVvZiggdEFOSV9VMTYgKTsKKworICAgICAgICBpZihmQktJREZvdW5kKQorICAgICAgICB7CisgICAgICAgICAgICBwV2FwaUllLT5JZUhlYWRlci5MZW5ndGggKz0gQ1NSX1dBUElfQktJRF9TSVpFOworICAgICAgICB9CisgICAgICAgIC8vIHJldHVybiB0aGUgc2l6ZSBvZiB0aGUgSUUgaGVhZGVyICh0b3RhbCkgY29uc3RydWN0ZWQuLi4KKyAgICAgICAgY2JXYXBpSWUgPSBwV2FwaUllLT5JZUhlYWRlci5MZW5ndGggKyBzaXplb2YoIHBXYXBpSWUtPkllSGVhZGVyICk7CisKKyAgICB9IHdoaWxlKCAwICk7CisKKyAgICBpZiggIXBJZXMgJiYgcEllc0xvY2FsICkKKyAgICB7CisgICAgICAgIC8vbG9jYWxseSBhbGxvY2F0ZWQKKyAgICAgICAgdm9zX21lbV9mcmVlKHBJZXNMb2NhbCk7CisgICAgfQorCisgICAgcmV0dXJuKCBjYldhcGlJZSApOworfQorI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9XQVBJICovCisKK3RBTklfQk9PTEVBTiBjc3JHZXRXcGFDeXBoZXJzKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0Q3NyQXV0aExpc3QgKnBBdXRoVHlwZSwgZUNzckVuY3J5cHRpb25UeXBlIGVuVHlwZSwgdENzckVuY3J5cHRpb25MaXN0ICpwTUNFbmNyeXB0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdQQSAqcFdwYUllLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqVW5pY2FzdEN5cGhlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKk11bHRpY2FzdEN5cGhlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKkF1dGhTdWl0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDc3JBdXRoVHlwZSAqcE5lZ290aWF0ZWRBdXRodHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDc3JFbmNyeXB0aW9uVHlwZSAqcE5lZ290aWF0ZWRNQ0NpcGhlciApCit7CisgICAgdEFOSV9CT09MRUFOIGZBY2NlcHRhYmxlQ3lwaGVycyA9IEZBTFNFOworICAgIHRBTklfVTggY1VuaWNhc3RDeXBoZXJzID0gMDsKKyAgICB0QU5JX1U4IGNNdWx0aWNhc3RDeXBoZXJzID0gMDsKKyAgICB0QU5JX1U4IGNBdXRoU3VpdGVzID0gMDsKKyAgICB0QU5JX1U4IFVuaWNhc3RbIENTUl9XUEFfT1VJX1NJWkUgXTsKKyAgICB0QU5JX1U4IE11bHRpY2FzdFsgQ1NSX1dQQV9PVUlfU0laRSBdOworICAgIHRBTklfVTggQXV0aGVudGljYXRpb25bIENTUl9XUEFfT1VJX1NJWkUgXTsKKyAgICB0QU5JX1U4IE11bHRpY2FzdEN5cGhlcnNbIDEgXVsgQ1NSX1dQQV9PVUlfU0laRSBdOworICAgIHRBTklfVTggaTsKKyAgICBlQ3NyQXV0aFR5cGUgbmVnQXV0aFR5cGUgPSBlQ1NSX0FVVEhfVFlQRV9VTktOT1dOOworCisgICAgZG8KKyAgICB7CisgICAgICAgIGlmICggcFdwYUllLT5wcmVzZW50ICkKKyAgICAgICAgeworICAgICAgICAgICAgY011bHRpY2FzdEN5cGhlcnMgPSAxOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KE11bHRpY2FzdEN5cGhlcnMsIHBXcGFJZS0+bXVsdGljYXN0X2NpcGhlciwgQ1NSX1dQQV9PVUlfU0laRSk7CisgICAgICAgICAgICBjVW5pY2FzdEN5cGhlcnMgPSAodEFOSV9VOCkocFdwYUllLT51bmljYXN0X2NpcGhlcl9jb3VudCk7CisgICAgICAgICAgICBjQXV0aFN1aXRlcyA9ICh0QU5JX1U4KShwV3BhSWUtPmF1dGhfc3VpdGVfY291bnQpOworCisgICAgICAgICAgICAvL0NoZWNrIC0gSXMgcmVxdWVzdGVkIFVuaWNhc3QgQ2lwaGVyIHN1cHBvcnRlZCBieSB0aGUgQlNTLgorICAgICAgICAgICAgZkFjY2VwdGFibGVDeXBoZXJzID0gY3NyTWF0Y2hXUEFPVUlJbmRleCggcE1hYywgcFdwYUllLT51bmljYXN0X2NpcGhlcnMsIGNVbmljYXN0Q3lwaGVycywgCisgICAgICAgICAgICAgICAgICAgIGNzckdldE9VSUluZGV4RnJvbUNpcGhlciggZW5UeXBlICksIFVuaWNhc3QgKTsKKworICAgICAgICAgICAgaWYoICFmQWNjZXB0YWJsZUN5cGhlcnMgKSBicmVhazsKKworCisgICAgICAgICAgICAvL1VuaWNhc3QgaXMgc3VwcG9ydGVkLiBQaWNrIHRoZSBmaXJzdCBtYXRjaGluZyBHcm91cCBjaXBoZXIsIGlmIGFueS4KKyAgICAgICAgICAgIGZvciggaSA9IDAgOyBpIDwgcE1DRW5jcnlwdGlvbi0+bnVtRW50cmllcyA7IGkrKyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZkFjY2VwdGFibGVDeXBoZXJzID0gY3NyTWF0Y2hXUEFPVUlJbmRleCggcE1hYywgTXVsdGljYXN0Q3lwaGVycywgIGNNdWx0aWNhc3RDeXBoZXJzLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JHZXRPVUlJbmRleEZyb21DaXBoZXIoIHBNQ0VuY3J5cHRpb24tPmVuY3J5cHRpb25UeXBlW2ldKSwgTXVsdGljYXN0ICk7CisgICAgICAgICAgICAgICAgaWYoZkFjY2VwdGFibGVDeXBoZXJzKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYoICFmQWNjZXB0YWJsZUN5cGhlcnMgKSBicmVhazsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYoIHBOZWdvdGlhdGVkTUNDaXBoZXIgKQorICAgICAgICAgICAgICAgICpwTmVnb3RpYXRlZE1DQ2lwaGVyID0gcE1DRW5jcnlwdGlvbi0+ZW5jcnlwdGlvblR5cGVbaV07CisKKyAgICAgICAgICAgICAgICAvKiBJbml0aWFsaXppbmcgd2l0aCBGQUxTRSBhcyBpdCBoYXMgVFJVRSB2YWx1ZSBhbHJlYWR5ICovCisgICAgICAgICAgICBmQWNjZXB0YWJsZUN5cGhlcnMgPSBGQUxTRTsKKyAgICAgICAgICAgIGZvciAoaSA9IDAgOyBpIDwgcEF1dGhUeXBlLT5udW1FbnRyaWVzOyBpKyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAvL0NpcGhlcnMgYXJlIHN1cHBvcnRlZCwgTWF0Y2ggYXV0aGVudGljYXRpb24gYWxnb3JpdGhtIGFuZCBwaWNrIGZpcnN0IG1hdGNoaW5nIGF1dGh0eXBlLgorICAgICAgICAgICAgICAgIGlmICggY3NySXNBdXRoV3BhKCBwTWFjLCBwV3BhSWUtPmF1dGhfc3VpdGVzLCBjQXV0aFN1aXRlcywgQXV0aGVudGljYXRpb24gKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAoZUNTUl9BVVRIX1RZUEVfV1BBID09IHBBdXRoVHlwZS0+YXV0aFR5cGVbaV0pCisgICAgICAgICAgICAgICAgICAgIG5lZ0F1dGhUeXBlID0gZUNTUl9BVVRIX1RZUEVfV1BBOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIChuZWdBdXRoVHlwZSA9PSBlQ1NSX0FVVEhfVFlQRV9VTktOT1dOKSAmJiBjc3JJc0F1dGhXcGFQc2soIHBNYWMsIHBXcGFJZS0+YXV0aF9zdWl0ZXMsIGNBdXRoU3VpdGVzLCBBdXRoZW50aWNhdGlvbiApICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChlQ1NSX0FVVEhfVFlQRV9XUEFfUFNLID09IHBBdXRoVHlwZS0+YXV0aFR5cGVbaV0pCisgICAgICAgICAgICAgICAgICAgIG5lZ0F1dGhUeXBlID0gZUNTUl9BVVRIX1RZUEVfV1BBX1BTSzsKKyAgICAgICAgICAgICAgICB9CisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRQorICAgICAgICAgICAgICAgIGlmICggKG5lZ0F1dGhUeXBlID09IGVDU1JfQVVUSF9UWVBFX1VOS05PV04pICYmIGNzcklzRXNlQ2NrbUF1dGhXcGEoIHBNYWMsIHBXcGFJZS0+YXV0aF9zdWl0ZXMsIGNBdXRoU3VpdGVzLCBBdXRoZW50aWNhdGlvbiApICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChlQ1NSX0FVVEhfVFlQRV9DQ0tNX1dQQSA9PSBwQXV0aFR5cGUtPmF1dGhUeXBlW2ldKQorICAgICAgICAgICAgICAgICAgICAgICAgbmVnQXV0aFR5cGUgPSBlQ1NSX0FVVEhfVFlQRV9DQ0tNX1dQQTsKKyAgICAgICAgICAgICAgICB9CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0VTRSAqLworCisgICAgICAgICAgICAgICAgLy8gVGhlIDFzdCBhdXRoIHR5cGUgaW4gdGhlIEFQcyBXUEEgSUUsIHRvIG1hdGNoIHN0YXRpb25zIGNvbm5lY3RpbmcKKyAgICAgICAgICAgICAgICAvLyBwcm9maWxlcyBhdXRoIHR5cGUgd2lsbCBjYXVzZSB1cyB0byBleGl0IHRoaXMgbG9vcAorICAgICAgICAgICAgICAgIC8vIFRoaXMgaXMgYWRkZWQgYXMgc29tZSBBUHMgYWR2ZXJ0aXNlIG11bHRpcGxlIGFrbXMgaW4gdGhlIFdQQSBJRS4KKyAgICAgICAgICAgICAgICBpZiAoZUNTUl9BVVRIX1RZUEVfVU5LTk9XTiAhPSBuZWdBdXRoVHlwZSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBmQWNjZXB0YWJsZUN5cGhlcnMgPSBUUlVFOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gLy8gZm9yCisgICAgICAgICAgICB9CisgICAgfXdoaWxlKDApOworCisgICAgaWYgKCBmQWNjZXB0YWJsZUN5cGhlcnMgKQorICAgIHsKKyAgICAgICAgaWYgKCBNdWx0aWNhc3RDeXBoZXIgKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKiopTXVsdGljYXN0Q3lwaGVyLCBNdWx0aWNhc3QsIENTUl9XUEFfT1VJX1NJWkUpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCBVbmljYXN0Q3lwaGVyICkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4ICoqKVVuaWNhc3RDeXBoZXIsIFVuaWNhc3QsIENTUl9XUEFfT1VJX1NJWkUpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCBBdXRoU3VpdGUgKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKiopQXV0aFN1aXRlLCBBdXRoZW50aWNhdGlvbiwgQ1NSX1dQQV9PVUlfU0laRSk7CisgICAgICAgIH0KKworICAgICAgICBpZiggcE5lZ290aWF0ZWRBdXRodHlwZSApCisgICAgICAgIHsKKyAgICAgICAgICAgICpwTmVnb3RpYXRlZEF1dGh0eXBlID0gbmVnQXV0aFR5cGU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4oIGZBY2NlcHRhYmxlQ3lwaGVycyApOworfQorCisKKwordEFOSV9CT09MRUFOIGNzcklzV3BhRW5jcnlwdGlvbk1hdGNoKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0Q3NyQXV0aExpc3QgKnBBdXRoVHlwZSwgZUNzckVuY3J5cHRpb25UeXBlIGVuVHlwZSwgdENzckVuY3J5cHRpb25MaXN0ICpwRW5NY1R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkJlYWNvbklFcyAqcEllcywgZUNzckF1dGhUeXBlICpwTmVnb3RpYXRlZEF1dGh0eXBlLCBlQ3NyRW5jcnlwdGlvblR5cGUgKnBOZWdvdGlhdGVkTUNDaXBoZXIgKQoreworICAgIHRBTklfQk9PTEVBTiBmV3BhTWF0Y2ggPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisKKyAgICAgICAgLy8gU2VlIGlmIHRoZSBjeXBoZXJzIGluIHRoZSBCc3MgZGVzY3JpcHRpb24gbWF0Y2ggd2l0aCB0aGUgc2V0dGluZ3MgaW4gdGhlIHByb2ZpbGUuCisgICAgZldwYU1hdGNoID0gY3Ny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KSkpICkKKyAgICAgICAgeworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgLy8gU2VlIGlmIHRoZSBjeXBoZXJzIGluIHRoZSBCc3MgZGVzY3JpcHRpb24gbWF0Y2ggd2l0aCB0aGUgc2V0dGluZ3MgaW4gdGhlIHByb2ZpbGUuCisgICAgICAgIGZXcGFNYXRjaCA9IGNzckdldFdwYUN5cGhlcnMoIGhIYWwsICZwUHJvZmlsZS0+QXV0aFR5cGUsIHBQcm9maWxlLT5uZWdvdGlhdGVkVUNFbmNyeXB0aW9uVHlwZSwgJnBQcm9maWxlLT5tY0VuY3J5cHRpb25UeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEllc0xvY2FsLT5XUEEsIFVuaWNhc3RDeXBoZXIsIE11bHRpY2FzdEN5cGhlciwgQXV0aFN1aXRlLCBOVUxMLCBOVUxMICk7CisgICAgICAgIGlmICggIWZXcGFNYXRjaCApIGJyZWFrOworCisgICAgICAgIHBXcGFJZS0+SWVIZWFkZXIuRWxlbWVudElEID0gU0lSX01BQ19XUEFfRUlEOworCisgICAgICAgIHZvc19tZW1fY29weShwV3BhSWUtPk91aSwgY3NyV3BhT3VpWzAxXSwgc2l6ZW9mKCBwV3BhSWUtPk91aSApKTsKKworICAgICAgICBwV3BhSWUtPlZlcnNpb24gPSBDU1JfV1BBX1ZFUlNJT05fU1VQUE9SVEVEOworCisgICAgICAgIHZvc19tZW1fY29weShwV3BhSWUtPk11bHRpY2FzdE91aSwgTXVsdGljYXN0Q3lwaGVyLCBzaXplb2YoIE11bHRpY2FzdEN5cGhlciApKTsKKworICAgICAgICBwV3BhSWUtPmNVbmljYXN0Q3lwaGVycyA9IDE7CisKKyAgICAgICAgdm9zX21lbV9jb3B5KCZwV3BhSWUtPlVuaWNhc3RPdWlbIDAgXSwgVW5pY2FzdEN5cGhlciwgc2l6ZW9mKCBVbmljYXN0Q3lwaGVyICkpOworCisgICAgICAgIHBBd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BBdXRoU3VpdGUgKTsKKworICAgICAgICAvLyByZXR1cm4gdGhlIHNpemUgb2YgdGhlIElFIGhlYWRlciAodG90YWwpIGNvbnN0cnVjdGVkLi4uCisgICAgICAgIGNiV3BhSWUgPSBwV3BhSWUtPkllSGVhZGVyLkxlbmd0aCArIHNpemVvZiggcFdwYUllLT5JZUhlYWRlciApOworCisgICAgfSB3aGlsZSggMCApOworCisgICAgaWYoICFwSWVzICYmIHBJZXNMb2NhbCApCisgICAgeworICAgICAgICAvL2xvY2FsbHkgYWxsb2NhdGVkCisgICAgICAgIHZvc19tZW1fZnJlZShwSWVzTG9jYWwpOworICAgIH0KKworICAgIHJldHVybiggY2JXcGFJZSApOworfQorCisKK3RBTklfQk9PTEVBTiBjc3JHZXRXcGFSc25JZSggdEhhbEhhbmRsZSBoSGFsLCB0QU5JX1U4ICpwSWVzLCB0QU5JX1UzMiBsZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBXcGFJZSwgdEFOSV9VOCAqcGNiV3BhSWUsIHRBTklfVTggKnBSU05JZSwgdEFOSV9VOCAqcGNiUlNOSWUpCit7CisgICAgdERvdDExSUVIZWFkZXIgKnBJRUhlYWRlcjsKKyAgICB0U2lyTWFjUHJvcElFICpwU2lyTWFjUHJvcElFOworICAgIHRBTklfVTMyIGNiUGFyc2VkOworICAgIHRBTklfVTMyIGNiSUU7CisgICAgaW50IGNFeHBlY3RlZElFcyA9IDA7CisgICAgaW50IGNGb3VuZElFcyA9IDA7CisgICAgaW50IGNiUHJvcElFVG90YWw7CisKKyAgICBwSUVIZWFkZXIgPSAodERvdDExSUVIZWFkZXIgKilwSWVzOworICAgIGlmKHBXcGFJZSkgY0V4cGVjdGVkSUVzKys7CisgICAgaWYocFJTTkllKSBjRXhwZWN0ZWRJRXMrKzsKKworICAgIC8vIGJzcyBkZXNjcmlwdGlvbiBsZW5ndGggaW5jbHVkZXMgYWxsIGZpZWxkcyBvdGhlciB0aGFuIHRoZSBs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b24uCisgICAgICAgICAgICAgICAgY2FzZSBTSVJfTUFDX1dQQV9FSUQ6CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBhbmlPVUk7CisgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBPdWkgPSAodEFOSV9VOCAqKSZhbmlPVUk7CisKKyAgICAgICAgICAgICAgICAgICAgcE91aSsrOworICAgICAgICAgICAgICAgICAgICBhbmlPVUkgPSBBTklfT1VJOworICAgICAgICAgICAgICAgICAgICBhbmlPVUkgPSBpX250b2hsKCBhbmlPVUkgKTsKKworICAgICAgICAgICAgICAgICAgICBwU2lyTWFjUHJvcElFID0gKCB0U2lyTWFjUHJvcElFICopcElFSGVhZGVyOworICAgICAgICAgICAgICAgICAgICBjYlByb3BJRVRvdGFsID0gcFNpck1hY1Byb3BJRS0+bGVuZ3RoOworCisgICAgICAgICAgICAgICAgICAgIC8vIFZhbGlkYXRlIHRoZSBBTkkgT1VJIGlzIGluIHRoZSBPVUkgZmllbGQgaW4gdGhlIHByb3ByaWV0YXJ5IElFLi4uCisgICAgICAgICAgICAgICAgICAgIGlmICggKCBwU2lyTWFjUHJvcElFLT5sZW5ndGggPj0gV05JX0NGR19NQU5VRkFDVFVSRVJfT1VJX0xFTiApICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBPdWlbIDAgXSA9PSBwU2lyTWFjUHJvcElFLT5vdWlbIDAgXSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICBwT3VpWyAxIF0gPT0gcFNpck1hY1Byb3BJRS0+b3VpWyAxIF0gJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcE91aVsgMiBdID09IHBTaXJNYWNQcm9wSUUtPm91aVsgMiBdICApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRDc3JXcGFJZSAgICAgKnBJZSAgICAgICAgPSAoIHRDc3JXcGFJZSAqICAgIClwSUVIZWFkZXI7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFwV3BhSWUgfHwgIXBjYldwYUllKSBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIENoZWNrIGlmIHRoaXMgaXMgYSB2YWxpZCBXUEEgSUUuICBUaGVuIGNoZWNrIHRoYXQgdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBXUEEgT1VJIGlzIGluIHBsYWNlIGFuZCB0aGUgdmVyc2lvbiBpcyBvbmUgdGhhdCB3ZSBzdXBwb3J0LgorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCAoIHBJZS0+SWVIZWFkZXIuTGVuZ3RoID49IFNJUl9NQUNfV1BBX0lFX01JTl9MRU5HVEggKSAgICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggdm9zX21lbV9jb21wYXJlKCBwSWUtPk91aSwgKHZvaWQgKiljc3JXcGFPdWlbMV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoIHBJZS0+T3VpICkgKSApICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggcEllLT5WZXJzaW9uIDw9IENTUl9XUEFfVkVSU0lPTl9TVVBQT1JURUQgKSApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBXcGFJZSwgcEllLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZS0+SWVIZWFkZXIuTGVuZ3RoICsgc2l6ZW9mKCBwSWUtPkllSGVhZGVyICkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICpwY2JXcGFJZSA9IHBJZS0+SWVIZWFkZXIuTGVuZ3RoICsgc2l6ZW9mKCBwSWUtPkllSGVhZGVyICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY0ZvdW5kSUVzKys7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGNhc2UgU0lSX01BQ19SU05fRUlEOgorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdENzclJTTkllICpwSWU7CisKKyAgICAgICAgICAgICAgICAgICAgaWYoIXBjYlJTTkllIHx8ICFwUlNOSWUpIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBwSWUgPSAodENzclJTTkllICopcElFSGVhZGVyOworCisgICAgICAgICAgICAgICAgICAgIC8vIENoZWNrIHRoZSBsZW5ndGggb2YgdGhlIFJTTiBJZSB0byBhc3N1cmUgaXQgaXMgdmFsaWQuICBUaGVuIGNoZWNrIHRoYXQgdGhlCisgICAgICAgICAgICAgICAgICAgIC8vIHZlcnNpb24gaXMgb25lIHRoYXQgd2Ugc3VwcG9ydC4KKworICAgICAgICAgICAgICAgICAgICBpZiAoIHBJZS0+SWVIZWFkZXIuTGVuZ3RoIDwgU0lSX01BQ19SU05fSUVfTUlOX0xFTkdUSCApIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBpZiAoIHBJZS0+VmVyc2lvbiA+IENTUl9SU05fVkVSU0lPTl9TVVBQT1JURUQgKSBicmVhazsKKworICAgICAgICAgICAgICAgICAgICBjRm91bmRJRXMrKzsKKworICAgICAgICAgICAgICAgICAgICAvLyBpZiB0aGVyZSBpcyBlbm91Z2ggcm9vbSBpbiB0aGUgV3BhSUUgcGFzc2VkIGluLCB0aGVuIGNvcHkgdGhlIFdwYSBJRSBpbnRvCisgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBidWZmZXIgcGFzc2VkIGluLgorICAgICAgICAgICAgICAgICAgICBpZiAoICpwY2JSU05JZSA8IHBJZS0+SWVIZWFkZXIuTGVuZ3RoICsgc2l6ZW9mKCBwSWUtPkllSGVhZGVyICkgKSBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBSU05JZSwgcEllLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllLT5JZUhlYWRlci5MZW5ndGggKyBzaXplb2YoIHBJZS0+SWVIZWFkZXIgKSk7CisgICAgICAgICAgICAgICAgICAgICpwY2JSU05JZSA9IHBJZS0+SWVIZWFkZXIuTGVuZ3RoICsgc2l6ZW9mKCBwSWUtPkllSGVhZGVyICk7CisKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gQWRkIHN1cHBvcnQgZm9yIG90aGVyIElFIGhlcmUuLi4KKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGNiUGFyc2VkICs9IGNiSUU7CisKKyAgICAgICAgcElFSGVhZGVyID0gKHREb3QxMUlFSGVhZGVyICopKCAoKHRBTklfVTggKilwSUVIZWFkZXIpICsgY2JJRSApOworCisgICAgfQorCisgICAgLy8gcmV0dXJuIGEgQk9PTCB0aGF0IHRlbGxzIGlmIGFsbCBvZiB0aGUgSUVzIGFza2VkIGZvciB3ZXJlIGZvdW5kLi4uCisgICAgcmV0dXJuKCBjRm91bmRJRXMgPT0gY0V4cGVjdGVkSUVzICk7Cit9CisKKworLy9JZiBhIFdQQUlFIGV4aXN0cyBpbiB0aGUgcHJvZmlsZSwganVzdCB1c2UgaXQuIE9yIGVsc2UgY29uc3RydWN0IG9uZSBmcm9tIHRoZSBCU1MKKy8vQ2FsbGVyIGFsbG9jYXRlZCBtZW1vcnkgZm9yIHBXcGFJZSBhbmQgZ3VhcnJhbnRlZSBpdCBjYW4gY29udGFpbiBhIG1heCBsZW5ndGggV1BBIElFCit0QU5JX1U4IGNzclJldHJpZXZlV3BhSWUoIHRIYWxIYW5kbGUgaEhhbCwgdENzclJvYW1Qcm9maWxlICpwUHJvZmlsZSwgdFNpckJzc0Rlc2NyaXB0aW9uICpwU2lyQnNzRGVzYywgCisgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZCZWFjb25JRXMgKnBJZXMsIHRDc3JXcGFJZSAqcFdwYUllICkKK3sKKyAgICB0cEFuaVNpckdsb2JhbCBwTWFjID0gUE1BQ19TVFJVQ1QoIGhIYWwgKTsKKyAgICB0QU5JX1U4IGNiV3BhSWUgPSAwOworCisgICAgZG8KKyAgICB7CisgICAgICAgIGlmICggIWNzcklzUHJvZmlsZVdwYSggcFByb2ZpbGUgKSApIGJyZWFrOworICAgICAgICBpZihwUHJvZmlsZS0+bldQQVJlcUlFTGVuZ3RoICYmIHBQcm9maWxlLT5wV1BBUmVxSUUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKFNJUl9NQUNfV1BBX0lFX01BWF9MRU5HVEggPj0gcFByb2ZpbGUtPm5XUEFSZXFJRUxlbmd0aCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjYldwYUllID0gKHRBTklfVTgpcFByb2ZpbGUtPm5XUEFSZXFJRUxlbmd0aDsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocFdwYUllLCBwUHJvZmlsZS0+cFdQQVJlcUlFLCBjYldwYUllKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HVywgIiAgY3NyUmV0cmlldmVXcGFJZSBkZXRlY3QgaW52YWxpZCBXUEEgSUUgbGVuZ3RoICglZCkgIiwgcFByb2ZpbGUtPm5XUEFSZXFJRUxlbmd0aCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBj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3JhdGNoLiBTbyBpdCBjb250YWlucyB0aGUgY3VycmVudCBQTUstSURzCisgICAgICAgICAgICBjYlJzbkllID0gY3NyQ29uc3RydWN0UlNOSWUocE1hYywgc2Vzc2lvbklkLCBwUHJvZmlsZSwgcFNpckJzc0Rlc2MsIHBJZXMsIHBSc25JZSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSAKKyNlbmRpZgorICAgICAgICBpZihwUHJvZmlsZS0+blJTTlJlcUlFTGVuZ3RoICYmIHBQcm9maWxlLT5wUlNOUmVxSUUpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIElmIHlvdSBoYXZlIG9uZSBzdGFydGVkIGF3YXksIHJlLXVzZSBpdC4gCisgICAgICAgICAgICBpZihTSVJfTUFDX1dQQV9JRV9NQVhfTEVOR1RIID49IHBQcm9maWxlLT5uUlNOUmVxSUVMZW5ndGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2JSc25JZSA9ICh0QU5JX1U4KXBQcm9maWxlLT5uUlNOUmVxSUVMZW5ndGg7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBSc25JZSwgcFByb2ZpbGUtPnBSU05SZXFJRSwgY2JSc25JZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csICIgIGNzclJldHJpZXZlUnNuSWUgZGV0ZWN0IGludmFsaWQgUlNOIElFIGxlbmd0aCAoJWQpICIsIHBQcm9maWxlLT5uUlNOUmVxSUVMZW5ndGgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgY2JSc25JZSA9IGNzckNvbnN0cnVjdFJTTkllKHBNYWMsIHNlc3Npb25JZCwgcFByb2ZpbGUsIHBTaXJCc3NEZXNjLCBwSWVzLCBwUnNuSWUpOworICAgICAgICB9CisgICAgfXdoaWxlKDApOworCisgICAg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cm9hbS5jaGFubmVsTGlzdDVHLCBMTF9BQ0NFU1NfTE9DSyApOworCisgICAgd2hpbGUgKCBwRW50cnkgKQorICAgIHsKKyAgICAgICAgcENoYW5uZWxHcm91cCA9IEdFVF9CQVNFX0FERFIoIHBFbnRyeSwgdENzckNoYW5uZWxTZXQsIGNoYW5uZWxMaXN0TGluayApOworICAgICAgICBzdGFydGluZ0NoYW5uZWwgPSBwQ2hhbm5lbEdyb3VwLT5maXJzdENoYW5uZWw7CisgICAgICAgIGZvciAoIGkgPSAwOyBpIDwgcENoYW5uZWxHcm91cC0+bnVtQ2hhbm5lbHM7IGkrKyApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmICggc3RhcnRpbmdDaGFubmVsICsgaSAqIHBDaGFubmVsR3JvdXAtPmludGVyQ2hhbm5lbE9mZnNldCA9PSBwQnNzRGVzY3JpcHRpb24tPmNoYW5uZWxJZCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZm91bmQgPSBUUlVFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKCBmb3VuZCApCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShyZXR1cm5DaGFubmVsR3JvdXAsIHBDaGFubmVsR3JvdXAsIHNpemVvZih0Q3NyQ2hhbm5lbFNldCkpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBwRW50cnkgPSBjc3JMTE5leHQoICZwTWFjLT5yb2FtLmNoYW5uZWxMaXN0NUcsIHBFbnRyeSwgTExfQUNDRVNTX0xPQ0sgKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiggZm91bmQgKTsKK30KKwordEFOSV9CT09MRUFOIGNzclJhdGVzSXNEb3QxMVJhdGUxMWJTdXBwb3J0ZWRSYXRlKCB0QU5JX1U4IGRvdDExUmF0ZSApCit7CisgIC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SYXRlXzI0TWJwczoKKyAgICAgICAgY2FzZSBlQ3NyU3VwcFJhdGVfMzZNYnBzOgorICAgICAgICBjYXNlIGVDc3JTdXBwUmF0ZV80OE1icHM6CisgICAgICAgIGNhc2UgZUNzclN1cHBSYXRlXzU0TWJwczoKKyAgICAgICAgICAgIGZTdXBwb3J0ZWQgPSBUUlVFOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGJyZWFrOworICAgIH0KKworICAgIHJldHVybiggZlN1cHBvcnRlZCApOworfQorCisKKwordEFuaUVkVHlwZSBjc3JUcmFuc2xhdGVFbmNyeXB0VHlwZVRvRWRUeXBlKCBlQ3NyRW5jcnlwdGlvblR5cGUgRW5jcnlwdFR5cGUgKQoreworICAgIHRBbmlFZFR5cGUgZWRUeXBlOworCisgICAgc3dpdGNoICggRW5jcnlwdFR5cGUgKQorICAgIHsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9OT05FOgorICAgICAgICAgICAgZWRUeXBlID0gZVNJUl9FRF9OT05FOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVA0MF9TVEFUSUNLRVk6CisgICAgICAgIGNhc2UgZUNTUl9FTkNSWVBUX1RZUEVfV0VQNDA6CisgICAgICAgICAgICBlZFR5cGUgPSBlU0lSX0VEX1dFUDQwOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVAxMDRfU1RBVElDS0VZOgorICAgICAgICBjYXNlIGVDU1JfRU5DUllQVF9UWVBFX1dFUDEwNDoKKyAgICAgICAgICAgIGVkVHlwZSA9IGVTSVJfRURfV0VQMTA0OworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9US0lQOgorICAgICAgICAgICAgZWRUeXBlID0gZVNJUl9FRF9US0lQOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9BRVM6CisgICAgICAgICAgICBlZFR5cGUgPSBlU0lSX0VEX0NDTVA7CisgICAgICAgICAgICBicmVhazsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fV0FQSQorICAgICAgICBjYXNlIGVDU1JfRU5DUllQVF9UWVBFX1dQSToKKyAgICAgICAgICAgIGVkVHlwZSA9IGVTSVJfRURfV1BJOworICAgICAgICAgICAgYnJlYWsgOworI2VuZGlmCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgICAgICAvLzExdyBCSVAKKyAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9BRVNfQ01BQzoKKyAgICAgICAgICAgIGVkVHlwZSA9IGVTSVJfRURfQUVTXzEyOF9DTUFDOworICAgICAgICAgICAgYnJlYWs7CisjZW5kaWYKKyAgICB9CisKKyAgICByZXR1cm4oIGVkVHlwZSApOworfQorCisKKy8vcEllcyBjYW4gYmUgTlVMTAordEFOSV9CT09MRUFOIGNzclZhbGlkYXRlV2VwKCB0cEFuaVNpckdsb2JhbCBwTWFjLCBlQ3NyRW5jcnlwdGlvblR5cGUgdWNFbmNyeXB0aW9uVHlwZSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRDc3JBdXRoTGlzdCAqcEF1dGhMaXN0LCB0Q3NyRW5jcnlwdGlvbkxpc3QgKnBNQ0VuY3J5cHRpb25MaXN0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNzckF1dGhUeXBlICpwTmVnb3RpYXRlZEF1dGhUeXBlLCBlQ3NyRW5jcnlwdGlvblR5cGUgKnBOZWdvdGlhdGVkTUNFbmNyeXB0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyQnNzRGVzY3JpcHRpb24gKnBTaXJCc3NEZXNjL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KiBNdWx0aWNhc3QgbGlzdCBtYXkgY29udGFpbiBXRVA0MC9XRVAxMDQuIENoZWNrIHdoZXRoZXIgaXQgbWF0Y2hlcyBVQy4KKyAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYoIHVjRW5jcnlwdGlvblR5cGUgPT0gcE1DRW5jcnlwdGlvbkxpc3QtPmVuY3J5cHRpb25UeXBlW2lkeF0gKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBmTWF0Y2ggPSBUUlVFOworICAgICAgICAgICAgICAgICAgICAgICAgbmVnb3RpYXRlZE1DQ2lwaGVyID0gcE1DRW5jcnlwdGlvbkxpc3QtPmVuY3J5cHRpb25UeXBlW2lkeF07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgZk1hdGNoID0gRkFMU0U7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYoZk1hdGNoKSBicmVhazsgCisgICAgICAgIH0KKworICAgICAgICBpZighZk1hdGNoKSBicmVhazsKKworICAgICAgICBmb3IoIGlkeCA9IDA7IGlkeCA8IHBBdXRoTGlzdC0+bnVtRW50cmllczsgaWR4KysgKQorICAgICAgICB7CisgICAgICAgICAgICBzd2l0Y2goIHBBdXRoTGlzdC0+YXV0aFR5cGVbaWR4XSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2FzZSBlQ1NSX0FVVEhfVFlQRV9PUEVOX1NZU1RFTToKKyAgICAgICAgICAgICAgICBjYXNlIGVDU1JfQVVUSF9UWVBFX1NIQVJFRF9LRVk6CisgICAgICAgICAgICAgICAgY2FzZSBlQ1NSX0FVVEhfVFlQRV9BVVRPU1dJVENIOgorICAgICAgICAgICAgICAgICAgICBmTWF0Y2ggPSBUUlVFOworICAgICAgICAgICAgICAgICAgICBuZWdvdGlhdGVkQXV0aCA9IHBBdXRoTGlzdC0+YXV0aFR5cGVbaWR4XTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgZk1hdGNoID0gRkFMU0U7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoZk1hdGNoKSBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGlmKCFmTWF0Y2gpIGJyZWFrOworICAgICAgICAvL0luIGNhc2Ugb2YgV1BBIC8gV1BBMiwgY2hlY2sgd2hldGhlciBpdCBzdXBwb3J0cyBXRVAgYXMgd2VsbAorICAgICAgICBpZihwSWVzKQorICAgICAgICB7CisgICAgICAgICAgICAvL1ByZXBhcmUgdGhlIGVuY3J5cHRpb24gdHlwZSBmb3IgV1BBL1dQQTIgZnVuY3Rpb25zCisgICAgICAgICAgICBpZiggZUNTUl9FTkNSWVBUX1RZUEVfV0VQNDBfU1RBVElDS0VZID09IHVjRW5jcnlwdGlvblR5cGUgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHVjRW5jcnlwdGlvblR5cGUgPSBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVA0MDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYoIGVDU1JfRU5DUllQVF9UWVBFX1dFUDEwNCA9PSB1Y0VuY3J5cHRpb25UeXBlICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB1Y0VuY3J5cHRpb25UeXBlID0gZUNTUl9FTkNSWVBUX1RZUEVfV0VQMTA0OworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy9lbHNlIHdlIGNhbiB1c2UgdGhlIGVuY3J5cHRpb24gdHlwZSBkaXJlY3RseQorICAgICAgICAgICAgaWYgKCBwSWVzLT5XUEEucHJlc2VudCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZk1hdGNoID0gdm9zX21lbV9jb21wYXJlKHBJZXMtPldQQS5tdWx0aWNhc3RfY2lwaGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JXcGFPdWlbY3NyR2V0T1VJSW5kZXhGcm9tQ2lwaGVyKCB1Y0VuY3J5cHRpb25UeXBlICldLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDU1JfV1BBX09VSV9TSVpFKTsKKyAgICAgICAgICAgICAgICBpZiggZk1hdGNoICkgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoIHBJZXMtPlJTTi5wcmVzZW50ICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBmTWF0Y2ggPSB2b3NfbWVtX2NvbXBhcmUocEllcy0+UlNOLmdwX2NpcGhlcl9zdWl0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyUlNOT3VpW2NzckdldE9VSUluZGV4RnJvbUNpcGhlciggdWNFbmNyeXB0aW9uVHlwZSApXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1NSX1JTTl9PVUlfU0laRSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgIH13aGlsZSgwKTsKKworICAgIGlmKCBmTWF0Y2ggKQorICAgIHsKKyAgICAgICAgaWYoIHBOZWdvdGlhdGVkQXV0aFR5cGUgKQorICAgICAgICAgICAgKnBOZWdvdGlhdGVkQXV0aFR5cGUgPSBuZWdvdGlhdGVkQXV0aDsKKworICAgICAgICBpZiggcE5lZ290aWF0ZWRNQ0VuY3J5cHRpb24gKQorICAgICAgICAgICAgKnBOZWdvdGlhdGVkTUNFbmNyeXB0aW9uID0gbmVnb3RpYXRlZE1DQ2lwaGVyOworICAgIH0gICAgCisKKworICAgIHJldHVybiBmTWF0Y2g7Cit9CisKKworLy9wSWVzIHNoYWxsIGNvbnRhaW4gSUVzIGZyb20gcFNpckJzc0Rlc2MuIEl0IHNoYWxsIGJlIHJldHVybmVkIGZyb20gZnVuY3Rpb24gY3NyR2V0UGFyc2VkQnNzRGVzY3JpcHRpb25JRXMKK3RBTklfQk9PTEVBTiBjc3JJc1NlY3VyaXR5TWF0Y2goIHRIYWxIYW5kbGUgaEhhbCwgdENzckF1dGhMaXN0ICphdXRoVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRDc3JFbmNyeXB0aW9uTGlzdCAqcFVDRW5jcnlwdGlvblR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Q3NyRW5jcnlwdGlvbkxpc3QgKnBNQ0VuY3J5cHRpb25UeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9CT09MRUFOICpwTUZQRW5hYmxlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBNRlBSZXF1aXJlZCwgdEFOSV9VOCAqcE1GUENhcGFibGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyQnNzRGVzY3JpcHRpb24gKnBTaXJCc3NEZXNjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkJlYWNvbklFcyAqcEllcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDc3JBdXRoVHlwZSAqbmVnb3RpYXRlZEF1dGh0eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNzckVuY3J5cHRpb25UeXBlICpuZWdvdGlhdGVkVUNDaXBoZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlQ3NyRW5jcnlwdGlvblR5cGUgKm5lZ290aWF0ZWRNQ0NpcGhlciApCit7CisgICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9IFBNQUNfU1RSVUNUKCBoSGFsICk7CisgICAgdEFOSV9CT09MRUFOIGZNYXRjaCA9IEZBTFNFOworICAg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HdlIGhhdmUgdG8gcmVqZWN0IHRoaXMgQnNzLgorICAgICAgICAgICAgICAgICAgICBpZiAoIGNzcklzUHJpdmFjeSggcFNpckJzc0Rlc2MgKSApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZNYXRjaCA9IEZBTFNFOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZk1hdGNoID0gVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmICggZk1hdGNoICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZk1hdGNoID0gRkFMU0U7CisgICAgICAgICAgICAgICAgICAgICAgICAvL0NoZWNrIE11bHRpY2FzdCBjaXBoZXIgcmVxdWVzdGVkIGFuZCBBdXRoIHR5cGUgcmVxdWVzdGVkLgorICAgICAgICAgICAgICAgICAgICAgICAgZm9yKCBpZHggPSAwIDsgaWR4IDwgcE1DRW5jcnlwdGlvblR5cGUtPm51bUVudHJpZXMgOyBpZHgrKyApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIGVDU1JfRU5DUllQVF9UWVBFX05PTkUgPT0gcE1DRW5jcnlwdGlvblR5cGUtPmVuY3J5cHRpb25UeXBlW2lkeF0gKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZk1hdGNoID0gVFJVRTsgLy9NdWx0aWNhc3QgY2FuIG9ubHkgYmUgbm9uZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNDaXBoZXIgPSBwTUNFbmNyeXB0aW9uVHlwZS0+ZW5jcnlwdGlvblR5cGVbaWR4XTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFmTWF0Y2gpIGJyZWFrOworCisgICAgICAgICAgICAgICAgICAgICAgICBmTWF0Y2ggPSBGQUxTRTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vQ2hlY2sgQXV0aCBsaXN0LiBJdCBzaG91bGQgY29udGFpbiBBdXRoT3Blbi4KKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciggaWR4ID0gMCA7IGlkeCA8IGF1dGhUeXBlLT5udW1FbnRyaWVzIDsgaWR4KysgKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBlQ1NSX0FVVEhfVFlQRV9PUEVOX1NZU1RFTSA9PSBhdXRoVHlwZS0+YXV0aFR5cGVbaWR4XSApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZNYXRjaCA9IFRSVUU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmVnQXV0aFR5cGUgPSBlQ1NSX0FVVEhfVFlQRV9PUEVOX1NZU1RFTTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9IAorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFmTWF0Y2gpIGJyZWFrOworCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICBjYXNlIGVDU1JfRU5DUllQVF9UWVBFX1dFUDQwX1NUQVRJQ0tFWToKKyAgICAgICAgICAgIGNhc2UgZUNTUl9FTkNSWVBUX1RZUEVfV0VQMTA0X1NUQVRJQ0tFWToKKyA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yAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9US0lQOgorICAgICAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9BRVM6CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZihwSWVzKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBGaXJzdCBjaGVjayBpZiB0aGVyZSBpcyBhIFJTTiBtYXRjaAorICAgICAgICAgICAgICAgICAgICAgICAgZk1hdGNoID0gY3NySXNSU05NYXRjaCggcE1hYywgYXV0aFR5cGUsIHVjQ2lwaGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1DRW5jcnlwdGlvblR5cGUsIHBNRlBFbmFibGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1GUFJlcXVpcmVkLCBwTUZQQ2FwYWJsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZXMsICZuZWdBdXRoVHlwZSwgJm1jQ2lwaGVyICk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiggIWZNYXRjaCApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgbm90IFJTTiwgdGhlbiBjaGVjayBpZiB0aGVyZSBpcyBhIFdQQSBtYXRjaAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZNYXRjaCA9IGNzcklzV3BhRW5jcnlwdGlvbk1hdGNoKCBwTWFjLCBhdXRoVHlwZSwgdWNDaXBoZXIsIHBNQ0VuY3J5cHRpb25UeXBlLCBwSWVzLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm5lZ0F1dGhUeXBlLCAmbWNDaXBoZXIgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZNYXRjaCA9IEZBTFNFOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyNpZmRlZiBGRUFUVVJFX1dMQU5fV0FQSQorICAgICAgICAgICBjYXNlIGVDU1JfRU5DUllQVF9UWVBFX1dQSTovL1dBUEkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBpZihwSWVzKQorICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgZk1hdGNoID0gY3NySXNXYXBpTWF0Y2goIGhIYWwsIGF1dGhUeXBlLCB1Y0NpcGhlciwgcE1DRW5jcnlwdGlvblR5cGUsIHBJZXMsICZuZWdBdXRoVHlwZSwgJm1jQ2lwaGVyICk7CisgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgIGZNYXRjaCA9IEZBTFNFOworICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgIH0KKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fV0FQSSAqLworICAgICAgICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9BTlk6IAorICAgICAgICAgICAgZGVmYXVsdDogCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdEFOSV9CT09MRUFOIGZNYXRjaEFueSA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKworICAgICAgICAgICAgICAgIGZNYXRjaCA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgICAgIC8vSXQgaXMgYWxsb3dlZCB0byBtYXRjaCBhbnl0aGluZy4gVHJ5IHRoZSBtb3JlIHNlY3VyZWQgb25lcyBmaXJzdC4KKyAgICAgICAgICAgICAgICBpZihwSWVzKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy9DaGVjayBBRVMgZmlyc3QKKyAgICAgICAgICAgICAgICAgICAgdWNDaXBoZXIgPSBlQ1NSX0VOQ1JZUFRfVFlQRV9BRVM7CisgICAgICAgICAgICAgICAgICAgIGZNYXRjaEFueSA9IGNzcklzUlNOTWF0Y2goIGhIYWwsIGF1dGhUeXBlLCB1Y0NpcGhlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1DRW5jcnlwdGlvblR5cGUsIHBNRlBFbmFibGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTUZQUmVxdWlyZWQsIHBNRlBDYXBhYmxlLCBwSWVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbmVnQXV0aFR5cGUsICZtY0NpcGhlciApOworICAgICAgICAgICAgICAgICAgICBpZighZk1hdGNoQW55KQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvL0NoZWNrIFRLSVAKKyAgICAgICAgICAgICAgICAgICAgICAgIHVjQ2lwaGVyID0gZUNTUl9FTkNSWVBUX1RZUEVfVEtJUDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZNYXRjaEFueSA9IGNzcklzUlNOTWF0Y2goIGhIYWwsIGF1dGhUeXBlLCB1Y0NpcGhlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNQ0VuY3J5cHRpb25UeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1GUEVuYWJsZWQsIHBNRlBSZXF1aXJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNRlBDYXBhYmxlLCBwSWVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm5lZ0F1dGhUeXBlLCAmbWNDaXBoZXIgKTsKKyAgICAgICAgICAgICAgICAgICAgfQorI2lmZGVmIEZFQVRVUkVfV0xBTl9XQVBJCisgICAgICAgICAgICAgICAgICAgIGlmKCFmTWF0Y2hBbnkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vQ2hlY2sgV0FQSQorICAgICAgICAgICAgICAgICAgICAgICAgdWNDaXBoZXIgPSBlQ1NSX0VOQ1JZUFRfVFlQRV9XUEk7CisgICAgICAgICAgICAgICAgICAgICAgICBmTWF0Y2hBbnkgPSBjc3JJc1dhcGlNYXRjaCggaEhhbCwgYXV0aFR5cGUsIHVjQ2lwaGVyLCBwTUNFbmNyeXB0aW9uVHlwZSwgcEllcywgJm5lZ0F1dGhUeXBlLCAmbWNDaXBoZXIgKTsKKyAgICAgICAgICAgICAgICAgICAgfQorI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9XQVBJICovCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmKCFmTWF0Y2hBbnkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB1Y0NpcGhlciA9IGVDU1JfRU5DUllQVF9UWVBFX1dFUDEwNDsKKyAgICAgICAgICAgICAgICAgICAgaWYoIWNzclZhbGlkYXRlV2VwKCBwTWFjLCB1Y0NpcGhlciwgYXV0aFR5cGUsIHBNQ0VuY3J5cHRpb25UeXBlLCAmbmVnQXV0aFR5cGUsICZtY0NpcGhlciwgcFNpckJzc0Rlc2MsIHBJZXMpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB1Y0NpcGhlciA9IGVDU1JfRU5DUllQVF9UWVBFX1dFUDQwOworICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWNzclZhbGlkYXRlV2VwKCBwTWFjLCB1Y0NpcGhlciwgYXV0aFR5cGUsIHBNQ0VuY3J5cHRpb25UeXBlLCAmbmVnQXV0aFR5cGUsICZtY0NpcGhlciwgcFNpckJzc0Rlc2MsIHBJZXMpKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVjQ2lwaGVyID0gZUNTUl9FTkNSWVBUX1RZUEVfV0VQMTA0X1NUQVRJQ0tFWTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZighY3NyVmFsaWRhdGVXZXAoIHBNYWMsIHVjQ2lwaGVyLCBhdXRoVHlwZSwgcE1DRW5jcnlwdGlvblR5cGUsICZuZWdBdXRoVHlwZSwgJm1jQ2lwaGVyLCBwU2lyQnNzRGVzYywgcEllcykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1Y0NpcGhlciA9IGVDU1JfRU5DUllQVF9UWVBFX1dFUDQwX1NUQVRJQ0tFWTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWNzclZhbGlkYXRlV2VwKCBwTWFjLCB1Y0NpcGhlciwgYXV0aFR5cGUsIHBNQ0VuY3J5cHRpb25UeXBlLCAmbmVnQXV0aFR5cGUsICZtY0NpcGhlciwgcFNpckJzc0Rlc2MsIHBJZXMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0l0IG11c3QgYmUgb3BlbiBhbmQgbm8gZW5jcnlwdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCBjc3JJc1ByaXZhY3koIHBTaXJCc3NEZXNjICkgKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vVGhpcyBpcyBub3QgcmlnaHQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmTWF0Y2ggPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmVnQXV0aFR5cGUgPSBlQ1NSX0FVVEhfVFlQRV9PUEVOX1NZU1RFTTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY0NpcGhlciA9IGVDU1JfRU5DUllQVF9UWVBFX05PTkU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWNDaXBoZXIgPSBlQ1NSX0VOQ1JZUFRfVFlQRV9OT05FOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICB9CisKKyAgICBpZiggZk1hdGNoICkgCisgICAgeworICAgICAgICBpZiggbmVnb3RpYXRlZFVDQ2lwaGVyICkKKyAgICAgICAgICAgICpuZWdvdGlhdGVkVUNDaXBoZXIgPSB1Y0NpcGhlcjsKKyAgIAorICAgICAgICBpZiggbmVnb3RpYXRlZE1DQ2lwaGVyICkKKyAgICAgICAgICAgICpuZWdvdGlhdGVkTUNDaXBoZXIgPSBtY0NpcGhlcjsKKyAgIAorICAgICAgICBpZiggbmVnb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AgIC8vIFNTSUQgY291bGQgYmUgc3VwcHJlc3NlZCBpbiBiZWFjb25zLiBJbiB0aGF0IGNhc2UgU1NJRCBJRSBoYXMgdmFsaWQgbGVuZ3RoCisgICAgICAgIC8vIGJ1dCB0aGUgU1NJRCB2YWx1ZSBpcyBhbGwgTlVMTCBjaGFyYWN0ZXJzLiBUaGF0IGNvbmRpdGlvbiBpcyB0cmF0ZWQgc2FtZQorICAgICAgICAvLyBhcyBOVUxMIFNTSUQKKyAgICAgICAgaWYgKCBjc3JJc05VTExTU0lEKCBic3NTc2lkLCBic3NTc2lkTGVuICkgKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoIGVBTklfQk9PTEVBTl9GQUxTRSA9PSBmU3NpZFJlcXVpcmVkICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBmTWF0Y2ggPSBUUlVFOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBpZihzc2lkMUxlbiAhPSBic3NTc2lkTGVuKSBicmVhazsKKyAgICAgICAgaWYgKHZvc19tZW1fY29tcGFyZShic3NTc2lkLCBzc2lkMSwgYnNzU3NpZExlbikpCisgICAgICAgIHsKKyAgICAgICAgICAgIGZNYXRjaCA9IFRSVUU7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgfSB3aGlsZSggMCApOworCisgICAgcmV0dXJuKCBmTWF0Y2ggKTsKK30KKworCisvL051bGwgc3NpZCBtZWFucyBtYXRjaAordEFOSV9CT09MRUFOIGNzcklzU3NpZEluTGlzdCggdEhhbEhhbmRsZSBoSGFsLCB0U2lyTWFjU1NpZCAqcFNzaWQsIHRDc3JTU0lEcyAqcFNzaWRMaXN0ICkKK3sKKyAgICB0QU5JX0JPT0xFQU4gZk1hdGNoID0gRkFMU0U7CisgICAgdEFOSV9VMzIgaTsKKworICAgIGlmICggcFNzaWRMaXN0ICYmIHBTc2lkICkKKyAgICB7CisgICAgICAgIGZvc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KQoreworICAgIHJldHVybigodEFOSV9CT09MRUFOKShlQ1NSX0JTU19UWVBFX1NUQVJUX0lCU1MgPT0gYnNzVHlwZSB8fCBlQ1NSX0JTU19UWVBFX0lCU1MgPT0gYnNzVHlwZSkpOworfQorCit0QU5JX0JPT0xFQU4gY3NySXNCc3NUeXBlV0RTKGVDc3JSb2FtQnNzVHlwZSBic3NUeXBlKQoreworICAgIHJldHVybigodEFOSV9CT09MRUFOKShlQ1NSX0JTU19UWVBFX1dEU19TVEEgPT0gYnNzVHlwZSB8fCBlQ1NSX0JTU19UWVBFX1dEU19BUCA9PSBic3NUeXBlKSk7Cit9CisKK3RBTklfQk9PTEVBTiBjc3JJc0JTU1R5cGVDYXBzTWF0Y2goIGVDc3JSb2FtQnNzVHlwZSBic3NUeXBlLCB0U2lyQnNzRGVzY3JpcHRpb24gKnBTaXJCc3NEZXNjICkKK3sKKyAgICB0QU5JX0JPT0xFQU4gZk1hdGNoID0gVFJVRTsKKworICAgIGRvCisgICAgeworICAgICAgICBzd2l0Y2goIGJzc1R5cGUgKQorICAgICAgICB7CisgICAgICAgICAgICBjYXNlIGVDU1JfQlNTX1RZUEVfQU5ZOgorICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIGVDU1JfQlNTX1RZUEVfSU5GUkFTVFJVQ1RVUkU6CisgICAgICAgICAgICBjYXNlIGVDU1JfQlNTX1RZUEVfV0RTX1NUQToKKyAgICAgICAgICAgICAgICBpZiggIWNzcklzSW5mcmFCc3NEZXNjKCBwU2lyQnNzRGVzYyApICkKKyAgICAgICAgICAgICAgICAgICAgZk1hdGNoID0gRkFMU0U7CisKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBlQ1NSX0JTU19UWVBFX0lCU1M6CisgICAgICAgICAgICBjYXNlIGVDU1JfQlNTX1RZUEVfU1RBUlRfSUJTUzoKKyAgICAgICAgICAgICAgICBpZiggIWNzcklzSWJzc0Jzc0Rlc2Mo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ID0gVFJVRTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgZlN1cHBvcnRlZCA9IEZBTFNFOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgIH0KKyAgICBlbHNlIGlmKCBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQiA9PSBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLnVDZmdEb3QxMU1vZGUgKQorICAgIHsKKyAgICAgICAgc3dpdGNoICggbmV3UmF0ZSApCisgICAgICAgIHsKKyAgICAgICAgY2FzZSBlQ3NyU3VwcFJhdGVfMU1icHM6CisgICAgICAgIGNhc2UgZUNzclN1cHBSYXRlXzJNYnBzOgorICAgICAgICBjYXNlIGVDc3JTdXBwUmF0ZV81XzVNYnBzOgorICAgICAgICBjYXNlIGVDc3JTdXBwUmF0ZV8xMU1icHM6CisgICAgICAgICAgICBmU3VwcG9ydGVkID0gVFJVRTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgZlN1cHBvcnRlZCA9IEZBTFNFOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoICFwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLlByb3ByaWV0YXJ5UmF0ZXNFbmFibGVkICkKKyAgICB7CisKKyAgICAgICAgc3dpdGNoICggbmV3UmF0ZSApCisgICAgICAgIHsKKyAgICAgICAgY2FzZSBlQ3NyU3VwcFJhdGVfMU1icHM6CisgICAgICAgIGNhc2UgZUNzclN1cHBSYXRlXzJNYnBzOgorICAgICAgICBjYXNlIGVDc3JTdXBwUmF0ZV81XzVNYnBzOgorICAgICAgICBjYXNlIGVDc3JTdXBwUmF0ZV82TWJwczoKKyAgICAgICAgY2FzZSBlQ3NyU3VwcFJhdGVfOU1icHM6CisgICAgICAgIGNhc2UgZUNzclN1cHBSYXRlXzExTWJwczoKKyAgICAgICAgY2FzZSBlQ3NyU3VwcFJhdGVfMTJNYnBzOgorICAgICAgICBjYXNlIGVDc3JTdXBwUmF0ZV8xOE1icHM6CisgICAgICAgIGNhc2UgZUNzclN1cHBSYXRlXzI0TWJwczoKKyAgICAgICAgY2FzZSBlQ3NyU3VwcFJhdGVfMzZNYnBzOgorICAgICAgICBjYXNlIGVDc3JTdXBwUmF0ZV80OE1icHM6CisgICAgICAgIGNhc2UgZUNzclN1cHBSYXRlXzU0TWJwczoKKyAgICAgICAgICAgIGZTdXBwb3J0ZWQgPSBUUlVFOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBmU3VwcG9ydGVkID0gRkFMU0U7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgfQorICAgIGVsc2UgeworCisgICAgICAgIGlmICggZUNzclN1cHBSYXRlXzFNYnBzICAgPT0gbmV3UmF0ZSB8fAorICAgICAgICAgICAgIGVDc3JTdXBwUmF0ZV8yTWJwcyAgID09IG5ld1JhdGUgfHwKKyAgICAgICAgICAgICBlQ3NyU3VwcFJhdGVfNV81TWJwcyA9PSBuZXdSYXRlIHx8CisgICAgICAgICAgICAgZUNzclN1cHBSYXRlXzExTWJwcyAgPT0gbmV3UmF0ZSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGZTdXBwb3J0ZWQgPSBUUlVFOworICAgICAgICB9CisgICAgICAgIGVsc2UgeworICAgICAgICAgICAgaWR4ID0gMHgxOworCisgICAgICAgICAgICBzd2l0Y2ggKCBuZXdSYXRlICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgIGNhc2UgZUNzclN1cHBSYXRlXzZNYnBzOgorICAgICAgICAgICAgICAgIGZTdXBwb3J0ZWQgPSBnUGh5UmF0ZXNTdXBwdFswXVtpZHhdOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBlQ3NyU3VwcFJhdGVfOU1icHM6CisgICAgICAgICAgICAgICAgZlN1cHBvcnRlZCA9IGdQaHlSYXRlc1N1cHB0WzFdW2lkeF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDc3JTdXBwUmF0ZV8xMk1icHM6CisgICAgICAgICAgICAgICAgZlN1cHBvcnRlZCA9IGdQaHlSYXRlc1N1cHB0WzJdW2lkeF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDc3JTdXBwUmF0ZV8xOE1icHM6CisgICAgICAgICAgICAgICAgZlN1cHBvcnRlZCA9IGdQaHlSYXRlc1N1cHB0WzNdW2lkeF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDc3JTdXBwUmF0ZV8yME1icHM6CisgICAgICAgICAgICAgICAgZlN1cHBvcnRlZCA9IGdQaHlSYXRlc1N1cHB0WzRdW2lkeF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDc3JTdXBwUmF0ZV8yNE1icHM6CisgICAgICAgICAgICAgICAgZlN1cHBvcnRlZCA9IGdQaHlSYXRlc1N1cHB0WzVdW2lkeF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDc3JTdXBwUmF0ZV8zNk1icHM6CisgICAgICAgICAgICAgICAgZlN1cHBvcnRlZCA9IGdQaHlSYXRlc1N1cHB0WzZdW2lkeF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDc3JTdXBwUmF0ZV80ME1icHM6CisgICAgICAgICAgICAgICAgZlN1cHBvcnRlZCA9IGdQaHlSYXRlc1N1cHB0WzddW2lkeF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDc3JTdXBwUmF0ZV80Mk1icHM6CisgICAgICAgICAgICAgICAgZlN1cHBvcnRlZCA9IGdQaHlSYXRlc1N1cHB0WzhdW2lkeF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDc3JTdXBwUmF0ZV80OE1icHM6CisgICAgICAgICAgICAgICAgZlN1cHBvcnRlZCA9IGdQaHlSYXRlc1N1cHB0WzldW2lkeF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDc3JTdXBwUmF0ZV81NE1icHM6CisgICAgICAgICAgICAgICAgZlN1cHBvcnRlZCA9IGdQaHlSYXRlc1N1cHB0WzEwXVtpZHhdOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBlQ3NyU3VwcFJhdGVfNzJNYnBzOgorICAgICAgICAgICAgICAgIGZTdXBwb3J0ZWQgPSBnUGh5UmF0ZXNTdXBwdFsxMV1baWR4XTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNzclN1cHBSYXRlXzgwTWJwczoKKyAgICAgICAgICAgICAgICBmU3VwcG9ydGVkID0gZ1BoeVJhdGVzU3VwcHRbMTJdW2lkeF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDc3JTdXBwUmF0ZV84NE1icHM6CisgICAgICAgICAgICAgICAgZlN1cHBvcnRlZCA9IGdQaHlSYXRlc1N1cHB0WzEzXVtpZHhdOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBlQ3NyU3VwcFJhdGVfOTZNYnBzOgorICAgICAgICAgICAgICAgIGZTdXBwb3J0ZWQgPSBnUGh5UmF0ZXNTdXBwdFsxNF1baWR4XTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNzclN1cHBSYXRlXzEwOE1icHM6CisgICAgICAgICAgICAgICAgZlN1cHBvcnRlZCA9IGdQaHlSYXRlc1N1cHB0WzE1XVtpZHhdOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBlQ3NyU3VwcFJhdGVfMTIwTWJwczoKKyAgICAgICAgICAgICAgICBmU3VwcG9ydGVkID0gZ1BoeVJhdGVzU3VwcHRbMTZdW2lkeF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDc3JTdXBwUmF0ZV8xMjZNYnBzOgorICAgICAgICAgICAgICAgIGZTdXBwb3J0ZWQgPSBnUGh5UmF0ZXNTdXBwdFsxN11baWR4XTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNzclN1cHBSYXRlXzE0NE1icHM6CisgICAgICAgICAgICAgICAgZlN1cHBvcnRlZCA9IGdQaHlSYXRlc1N1cHB0WzE4XVtpZHhdOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBlQ3NyU3VwcFJhdGVfMTYwTWJwczoKKyAgICAgICAgICAgICAgICBmU3VwcG9ydGVkID0gZ1BoeVJhdGVzU3VwcHRbMTldW2lkeF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDc3JTdXBwUmF0ZV8xNjhNYnBzOgorICAgICAgICAgICAgICAgIGZTdXBwb3J0ZWQgPSBnUGh5UmF0ZXNTdXBwdFsyMF1baWR4XTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgZUNzclN1cHBSYXRlXzE5Mk1icHM6CisgICAgICAgICAgICAgICAgZlN1cHBvcnRlZCA9IGdQaHlSYXRlc1N1cHB0WzIxXVtpZHhdOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBlQ3NyU3VwcFJhdGVfMjE2TWJwczoKKyAgICAgICAgICAgICAgICBmU3VwcG9ydGVkID0gZ1BoeVJhdGVzU3VwcHRbMjJdW2lkeF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIGVDc3JTdXBwUmF0ZV8yNDBNYnBzOgorICAgICAgICAgICAgICAgIGZTdXBwb3J0ZWQgPSBnUGh5UmF0ZXNTdXBwdFsyM11baWR4XTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgZlN1cHBvcnRlZCA9IEZBTFNFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIGZTdXBwb3J0ZWQ7Cit9CisKKworCitzdGF0aWMgdEFOSV9CT09MRUFOIGNzcklzUmF0ZVNldE1hdGNoKCB0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVN1cHBSYXRlcyAqcEJzc1N1cHBSYXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVFeHRTdXBwUmF0ZXMgKnBCc3NFeHRTdXBwUmF0ZXMgKQoreworICAgIHRBTklfQk9PTEVBTiBmTWF0Y2ggPSBUUlVFOworICAgIHRBTklfVTMyIGk7CisKKworICAgIC8vIFZhbGlkYXRlIHRoYXQgYWxsIG9mIHRoZSBCYXNpYyByYXRlcyBhZHZlcnRpc2VkIGluIHRoZSBCc3MgZGVzY3JpcHRpb24gYXJlIHN1cHBvcnRlZC4KKyAgICBpZiAoIHBCc3NTdXBwUmF0ZXMgKQorICAgIHsKKyAgICAgICAgZm9yKCBpID0gMDsgaSA8IHBCc3NTdXBwUmF0ZXMtPm51bV9yYXRlczsgaSsrICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKCBDU1JfSVNfQkFTSUNfUkFURSggcEJzc1N1cHBSYXRlcy0+cmF0ZXNbIGkgXSApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoICFjc3JJc0FnZ3JlZ2F0ZVJhdGVTdXBwb3J0ZWQoIHBNYWMsIHBCc3NTdXBwUmF0ZXMtPnJhdGVzWyBpIF0gKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBmTWF0Y2ggPSBGQUxTRTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgaWYgKCBmTWF0Y2ggJiYgcEJzc0V4dFN1cHBSYXRlcyApCisgICAgeworICAgICAgICBmb3IoIGkgPSAwOyBpIDwgcEJzc0V4dFN1cHBSYXRlcy0+bnVtX3JhdGVzOyBpKysgKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoIENTUl9JU19CQVNJQ19SQVRFKCBwQnNzRXh0U3VwcFJhdGVzLT5yYXRlc1sgaSBdICkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICggIWNzcklzQWdncmVnYXRlUmF0ZVN1cHBvcnRlZCggcE1hYywgcEJzc0V4dFN1cHBSYXRlcy0+cmF0ZXNbIGkgXSApICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGZNYXRjaCA9IEZBTFNFOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4oIGZNYXRjaCApOworCit9CisKKworLy9wcEllcyBjYW4gYmUgTlVMTC4gSWYgY2FsbGVyIHdhbnQgdG8gZ2V0IHRoZSAqcHBJZXMgYWxsb2NhdGVkIGJ5IHRoaXMgZnVuY3Rpb24sIHBhc3MgaW4gKnBwSWVzID0gTlVMTAordEFOSV9CT09MRUFOIGNzck1hdGNoQlNTKCB0SGFsSGFuZGxlIGhIYWwsIHRTaXJCc3NEZXNjcmlwdGlvbiAqcEJzc0Rlc2MsIHRDc3JTY2FuUmVzdWx0RmlsdGVyICpwRmlsdGVyLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZUNzckF1dGhUeXBlICpwTmVnQXV0aCwgZUNzckVuY3J5cHRpb25UeXBlICpwTmVnVWMsIGVDc3JFbmNyeXB0aW9uVHlwZSAqcE5lZ01jLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmQmVhY29uSUVzICoqcHBJZXMpCit7CisgICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9IFBNQUNfU1RSVUNUKCBoSGFsICk7CisgICAgdEFOSV9CT09MRUFOIGZSQyA9IGVBTklfQk9PTEVBTl9GQUxTRSwgZkNoZWNrOworICAgIHRBTklfVTMyIGk7CisgICAgdERvdDExZkJlYWNvbklFcyAqcEllcyA9IE5VTEw7CisgICAgdEFOSV9VOCAqcGI7CisKKyAgICBkbyB7CisgICAgICAgIGlmKCAoIE5VTEwgPT0gcHBJZXMgKSB8fCAoICpwcEllcyApID09IE5VTEwgKQorICAgICAgICB7CisgICAgICAgICAgICAvL0lmIG5vIElFcyBwYXNzZWQgaW4sIGdldCBvdXIgb3duLgorICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhjc3JHZXRQYXJzZWRCc3NEZXNjcmlwdGlvbklFcyhwTWFjLCBwQnNzRGVzYywgJnBJZXMpKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vU2F2ZSB0aGUgb25lIHBhc3MgaW4gZm9yIGxvY2FsIHVzZQorICAgICAgICAgICAgcEllcyA9ICpwcEllczsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgLy9DaGVjayBpZiBjYWxsZXIgd2FudHMgUDJQCisgICAgICAgIGZDaGVjayA9ICghcEZpbHRlci0+cDJwUmVzdWx0IHx8IHBJZXMtPlAyUEJlYWNvblByb2JlUmVzLnByZXNlbnQpOworICAgICAgICBpZighZkNoZWNrKSBicmVhazsKKworICAgICAgICBpZihwSWVzLT5TU0lELnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGZvcihpID0gMDsgaSA8IHBGaWx0ZXItPlNTSURzLm51bU9mU1NJRHM7IGkrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBmQ2hlY2sgPSBjc3JJc1NzaWRNYXRjaCggcE1hYywgcEZpbHRlci0+U1NJRHMuU1NJRExpc3RbaV0uU1NJRC5zc0lkLCBwRmlsdGVyLT5TU0lEcy5TU0lETGlzdFtpXS5TU0lELmxlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVzLT5TU0lELnNzaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllcy0+U1NJRC5udW1fc3NpZCwgZUFOSV9CT09MRUFOX1RSVUUgKTsKKyAgICAgICAgICAgICAgICBpZiAoIGZDaGVjayApIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYoIWZDaGVjaykgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgZkNoZWNrID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgIGZvcihpID0gMDsgaSA8IHBGaWx0ZXItPkJTU0lEcy5udW1PZkJTU0lEczsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICBmQ2hlY2sgPSBjc3JJc0Jzc2lkTWF0Y2goIHBNYWMsICh0Q3NyQnNzaWQgKikmcEZpbHRlci0+QlNTSURzLmJzc2lkW2ldLCAodENzckJzc2lkICopcEJzc0Rlc2MtPmJzc0lkICk7CisgICAgICAgICAgICBpZiAoIGZDaGVjayApIGJyZWFrOworCisgICAgICAgICAgICBpZiAocEZpbHRlci0+cDJwUmVzdWx0ICYmIHBJZXMtPlAyUEJlYWNvblByb2JlUmVzLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBmQ2hlY2sgPSBjc3JJc0Jzc2lkTWF0Y2goIHBNYWMsICh0Q3NyQnNzaWQgKikmcEZpbHRlci0+QlNTSURzLmJzc2lkW2ldLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0Q3NyQnNzaWQgKilwSWVzLT5QMlBCZWFjb25Qcm9iZVJlcy5QMlBEZXZpY2VJbmZvLlAyUERldmljZUFkZHJlc3MgKTsKKworICAgICAgICAgICAgICAgaWYgKCBmQ2hlY2sgKSBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZighZkNoZWNrKSBicmVhazsKKworICAgICAgICBmQ2hlY2sgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgZm9yKGkgPSAwOyBpIDwgcEZpbHRlci0+Q2hhbm5lbEluZm8ubnVtT2ZDaGFubmVsczsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICBmQ2hlY2sgPSBjc3JJc0NoYW5uZWxCYW5kTWF0Y2goIHBNYWMsIHBGaWx0ZXItPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0W2ldLCBwQnNzRGVzYyApOworICAgICAgICAgICAgaWYgKCBmQ2hlY2sgKSBicmVhazsKKyAgICAgICAgfQorICAgICAgICBpZighZkNoZWNrKQorICAgICAgICAgICAgYnJlYWs7CisjaWYgZGVmaW5lZCBXTEFOX0ZFQVRVUkVfVk9XSUZJCisgICAgICAgIC8qIElmIHRoaXMgaXMgZm9yIG1lYXN1cmVtZW50IGZpbHRlcmluZyAqLworICAgICAgICBpZiggcEZpbHRlci0+Zk1lYXN1cmVtZW50ICkKKyAgICAgICAgeworICAgICAgICAgICBmUkMgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyNlbmRpZgorICAgICAgICBpZiAoICFjc3JJc1BoeU1vZGVNYXRjaCggcE1hYywgcEZpbHRlci0+cGh5TW9kZSwgcEJzc0Rlc2MsIE5VTEwsIE5VTEwsIHBJZXMgKSApIGJyZWFrOworICAgICAgICBpZiAoICghcEZpbHRlci0+YldQU0Fzc29jaWF0aW9uKSAmJiAoIXBGaWx0ZXItPmJPU0VOQXNzb2NpYXRpb24pICYmCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgICAgICAgICAgICFjc3JJc1NlY3VyaXR5TWF0Y2goIHBNYWMsICZwRmlsdGVyLT5hdXRoVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEZpbHRlci0+RW5jcnlwdGlvblR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBGaWx0ZXItPm1jRW5jcnlwdGlvblR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBGaWx0ZXItPk1GUEVuYWJsZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBGaWx0ZXItPk1GUFJlcXVpcmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwRmlsdGVyLT5NRlBDYXBhYmxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBCc3NEZXNjLCBwSWVzLCBwTmVnQXV0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTmVnVWMsIHBOZWdNYyApCisjZWxzZQorICAgICAgICAgICAgICFjc3JJc1NlY3VyaXR5TWF0Y2goIHBNYWMsICZwRmlsdGVyLT5hdXRoVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEZpbHRlci0+RW5jcnlwdGlvblR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBGaWx0ZXItPm1jRW5jcnlwdGlvblR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwgTlVMTCwgTlVMTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQnNzRGVzYywgcEllcywgcE5lZ0F1dGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE5lZ1VjLCBwTmVnTWMgKQorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIGJyZWFrOworICAgICAgICBpZiAoICFjc3JJc0NhcGFiaWxpdGllc01hdGNoKCBwTWFjLCBwRmlsdGVyLT5CU1NUeXBlLCBwQnNzRGVzYyApICkgYnJlYWs7CisgICAgICAgIGlmICggIWNzcklzUmF0ZVNldE1hdGNoKCBwTWFjLCAmcEllcy0+U3VwcFJhdGVzLCAmcEllcy0+RXh0U3VwcFJhdGVzICkgKSBicmVhazsKKyAgICAgICAgLy9UdXNoLVFvUzogdmFsaWRhdGUgZmlyc3QgaWYgYXNrZWQgZm9yIEFQU0Qgb3IgV01NIGFzc29jaWF0aW9uCisgICAgICAgIGlmICggKGVDc3JSb2FtV21tUWJzc09ubHkgPT0gcE1hYy0+cm9hbS5jb25maWdQYXJhbS5XTU1TdXBwb3J0TW9kZSkgJiYKKyAgICAgICAgICAgICAhQ1NSX0lTX1FPU19CU1MocEllcykgKQorICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAvL0NoZWNrIGNvdW50cnkuIGNoZWNrIGV2ZW4gd2hlbiBwYiBpcyBOVUxMIGJlY2F1c2Ugd2UgbWF5IHdhbnQgdG8gbWFrZSBzdXJlCisgICAgICAgIC8vQVAgaGFzIGEgY291bnRyeSBjb2RlIGluIGl0IGlmIGZFbmZvcmNlQ291bnRyeUNvZGVNYXRjaCBpcyBzZXQuCisgICAgICAgIHBiID0gKCBwRmlsdGVyLT5jb3VudHJ5Q29kZVswXSApID8gKCBwRmlsdGVyLT5jb3VudHJ5Q29kZSkgOiBOVUxMOworCisgICAgICAgIGZDaGVjayA9IGNzck1hdGNoQ291bnRyeUNvZGUoIHBNYWMsIHBiLCBwSWVzICk7CisgICAgICAgIGlmKCFmQ2hlY2spCisgICAgICAgICAgICBicmVhazsKKworI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCisgICAgICAgIGlmIChwRmlsdGVyLT5NRElELm1kaWVQcmVzZW50ICYmIGNzclJvYW1JczExckFzc29jKHBNYWMpKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAocEJzc0Rlc2MtPm1kaWVQcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChwRmlsdGVyLT5NRElELm1vYmlsaXR5RG9tYWluICE9IChwQnNzRGVzYy0+bWRpZVsxXSA8PCA4IHwgcEJzc0Rlc2MtPm1kaWVbMF0pKQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorI2VuZGlmCisgICAgICAgIGZSQyA9IGVBTklfQk9PTEVBTl9UUlVFOworCisgICAgfSB3aGlsZSggMCApOworICAgIGlmKCBwcEllcyApCisgICAgeworICAgICAgICAqcHBJZXMgPSBwSWVzOworICAgIH0KKyAgICBlbHNlIGlmKCBwSWVzICkKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZShwSWVzKTsKKyAgICB9CisKKyAgICByZXR1cm4oIGZSQyApOworfQorCit0QU5JX0JPT0xFQU4gY3NyTWF0Y2hDb25uZWN0ZWRCU1NTZWN1cml0eSggdHBBbmlTaXJHbG9iYWwgcE1hYywgdENzclJvYW1Db25uZWN0ZWRQcm9maWxlICpwUHJvZmlsZSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpckJzc0Rlc2NyaXB0aW9uICpwQnNzRGVzYywgdERvdDExZkJlYWNvbklFcyAqcEllcykKK3sKKyAgICB0Q3NyRW5jcnlwdGlvbkxpc3QgdWNFbmNyeXB0aW9uTGlzdCwgbWNFbmNyeXB0aW9uTGlzdDsKKyAgICB0Q3NyQXV0aExpc3QgYXV0aExpc3Q7CisKKyAgICB1Y0VuY3J5cHRpb25MaXN0Lm51bUVudHJpZXMgPSAxOworICAgIHVjRW5jcnlwdGlvbkxpc3QuZW5jcnlwdGlvblR5cGVbMF0gPSBwUHJvZmlsZS0+RW5jcnlwdGlvblR5cGU7CisKKyAgICBtY0VuY3J5cHRpb25MaXN0Lm51bUVudHJpZXMgPSAxOworICAgIG1jRW5jcnlwdGlvbkxpc3QuZW5jcnlwdGlvblR5cGVbMF0gPSBwUHJvZmlsZS0+bWNFbmNyeXB0aW9uVHlwZTsKKworICAgIGF1dGhMaXN0Lm51bUVudHJpZXMgPSAxOworICAgIGF1dGhMaXN0LmF1dGhUeXBlWzBdID0gcFByb2ZpbGUtPkF1dGhUeXBlOworCisgICAgcmV0dXJuKCBjc3JJc1NlY3VyaXR5TWF0Y2goIHBNYWMsICZhdXRoTGlzdCwgJnVjRW5jcnlwdGlvbkxpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZtY0VuY3J5cHRpb25MaXN0LCBOVUxMLCBOVUxMLCBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQnNzRGVzYywgcEllcywgTlVMTCwgTlVMTCwgTlVMTCApKTsKKworfQorCisKK3RBTklfQk9PTEVBTiBjc3JNYXRjaEJTU1RvQ29ubmVjdFByb2ZpbGUoIHRIYWxIYW5kbGUgaEhhbCwgdENzclJvYW1Db25uZWN0ZWRQcm9maWxlICpwUHJvZmlsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJCc3NEZXNjcmlwdGlvbiAqcEJzc0Rlc2MsIHREb3QxMWZCZWFjb25JRXMgKnBJZXMgKQoreworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVCggaEhhbCApOworICAgIHRBTklfQk9PTEVBTiBmUkMgPSBlQU5JX0JPT0xFQU5fRkFMU0UsIGZDaGVjazsKKyAgICB0RG90MTFmQmVhY29uSUVzICpwSWVzTG9jYWwgPSBwSWVzOworCisgICAgZG8geworICAgICAgICBpZiggIXBJZXMgKQorICAgICAgICB7CisgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKGNzckdldFBhcnNlZEJzc0Rlc2NyaXB0aW9uSUVzKHBNYWMsIHBCc3NEZXNjLCAmcEllc0xvY2FsKSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZkNoZWNrID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgIGlmKHBJZXNMb2NhbC0+U1NJRC5wcmVzZW50KQorICAgICAgICB7CisgICAgICAgICAgICB0QU5JX0JPT0xFQU4gZkNoZWNrU3NpZCA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgIGlmKHBQcm9maWxlLT5TU0lELmxlbmd0aCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBmQ2hlY2tTc2lkID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmQ2hlY2sgPSBjc3JJc1NzaWRNYXRjaCggcE1hYywgcFByb2ZpbGUtPlNTSUQuc3NJZCwgcFByb2ZpbGUtPlNTSUQubGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZXNMb2NhbC0+U1NJRC5zc2lkLCBwSWVzTG9jYWwtPlNTSUQubnVtX3NzaWQsIGZDaGVja1NzaWQgKTsKKyAgICAgICAgICAgIGlmKCFmQ2hlY2spIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGlmICggIWNzck1hdGNoQ29ubmVjdGVkQlNTU2VjdXJpdHkoIHBNYWMsIHBQcm9maWxlLCBwQnNzRGVzYywgcEllc0xvY2FsKSApIGJyZWFrOworICAgICAgICBpZiAoICFjc3JJc0NhcGFiaWxpdGllc01hdGNoKCBwTWFjLCBwUHJvZmlsZS0+QlNTVHlwZSwgcEJzc0Rlc2MgKSApIGJyZWFrOworICAgICAgICBpZiAoICFjc3JJc1JhdGVTZXRNYXRjaCggcE1hYywgJnBJZXNMb2NhbC0+U3VwcFJhdGVzLCAmcEllc0xvY2FsLT5FeHRTdXBwUmF0ZXMgKSApIGJyZWFrOworICAgICAgICBmQ2hlY2sgPSBjc3JJc0NoYW5uZWxCYW5kTWF0Y2goIHBNYWMsIHBQcm9maWxlLT5vcGVyYXRpb25DaGFubmVsLCBwQnNzRGVzYyApOworICAgICAgICBpZighZkNoZWNrKQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgZlJDID0gZUFOSV9CT09MRUFOX1RSVUU7CisKKyAgICB9IHdoaWxlKCAwICk7CisKKyAgICBpZiggIXBJZXMgJiYgcEllc0xvY2FsICkKKyAgICB7CisgICAgICAgIC8vbG9jYWxseSBhbGxvY2F0ZWQKKyAgICAgICAgdm9zX21lbV9mcmVlKHBJZXNMb2NhbCk7CisgICAgfQorCisgICAgcmV0dXJuKCBmUkMgKTsKK30KKworCisKK3ZvaWQgY3NyQWRkUmF0ZUJpdG1hcCh0QU5JX1U4IHJhdGUsIHRBTklfVTE2ICpwUmF0ZUJpdG1hcCkKK3sKKyAgICB0QU5JX1UxNiByYXRlQml0bWFwOworICAgIHRBTklfVTE2IG4gPSBCSVRTX09GRiggcmF0ZSwgQ1NSX0RPVDExX0JBU0lDX1JBVEVfTUFTSyApOworICAgIHJhdGVCaXRtYXAgPSAqcFJhdGVCaXRtYXA7CisgICAgc3dpdGNoKG4pCisgICAgeworICAgICAgIGNhc2UgU0lSX01BQ19SQVRFXzE6CisgICAgICAgICAgICByYXRlQml0bWFwIHw9IFNJUl9NQUNfUkFURV8xX0JJVE1BUDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV8yOgorICAgICAgICAgICAgcmF0ZUJpdG1hcCB8PSBTSVJfTUFDX1JBVEVfMl9CSVRNQVA7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTSVJfTUFDX1JBVEVfNV81OgorICAgICAgICAgICAgcmF0ZUJpdG1hcCB8PSBTSVJfTUFDX1JBVEVfNV81X0JJVE1BUDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV8xMToKKyAgICAgICAgICAgIHJhdGVCaXRtYXAgfD0gU0lSX01BQ19SQVRFXzExX0JJVE1BUDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV82OgorICAgICAgICAgICAgcmF0ZUJpdG1hcCB8PSBTSVJfTUFDX1JBVEVfNl9CSVRNQVA7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTSVJfTUFDX1JBVEVfOToKKyAgICAgICAgICAgIHJhdGVCaXRtYXAgfD0gU0lSX01BQ19SQVRFXzlfQklUTUFQOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU0lSX01BQ19SQVRFXzEyOgorICAgICAgICAgICAgcmF0ZUJpdG1hcCB8PSBTSVJfTUFDX1JBVEVfMTJfQklUTUFQOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU0lSX01BQ19SQVRFXzE4OgorICAgICAgICAgICAgcmF0ZUJpdG1hcCB8PSBTSVJfTUFDX1JBVEVfMThfQklUTUFQOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU0lSX01BQ19SQVRFXzI0OgorICAgICAgICAgICAgcmF0ZUJpdG1hcCB8PSBTSVJfTUFDX1JBVEVfMjRfQklUTUFQOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU0lSX01BQ19SQVRFXzM2OgorICAgICAgICAgICAgcmF0ZUJpdG1hcCB8PSBTSVJfTUFDX1JBVEVfMzZfQklUTUFQOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU0lSX01BQ19SQVRFXzQ4OgorICAgICAgICAgICAgcmF0ZUJpdG1hcCB8PSBTSVJfTUFDX1JBVEVfNDhfQklUTUFQOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU0lSX01BQ19SQVRFXzU0OgorICAgICAgICAgICAgcmF0ZUJpdG1hcCB8PSBTSVJfTUFDX1JBVEVfNTRfQklUTUFQOworICAgICAgICAgICAgYnJlYWs7CisgICAgfQorICAgICpwUmF0ZUJpdG1hcCA9IHJhdGVCaXRtYXA7Cit9CisKKworCit0QU5JX0JPT0xFQU4gY3NySXNSYXRlQWxyZWFkeVByZXNlbnQodEFOSV9VOCByYXRlLCB0QU5JX1UxNiByYXRlQml0bWFwKQoreworICAgIHRBTklfVTE2IG4gPSBCSVRTX09GRiggcmF0ZSwgQ1NSX0RPVDExX0JBU0lDX1JBVEVfTUFTSyApOworCisgICAgc3dpdGNoKG4pCisgICAgeworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV8xOgorICAgICAgICAgICAgcmF0ZUJpdG1hcCAmPSBTSVJfTUFDX1JBVEVfMV9CSVRNQVA7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTSVJfTUFDX1JBVEVfMjoKKyAgICAgICAgICAgIHJhdGVCaXRtYXAgJj0gU0lSX01BQ19SQVRFXzJfQklUTUFQOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU0lSX01BQ19SQVRFXzVfNToKKyAgICAgICAgICAgIHJhdGVCaXRtYXAgJj0gU0lSX01BQ19SQVRFXzVfNV9CSVRNQVA7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTSVJfTUFDX1JBVEVfMTE6CisgICAgICAgICAgICByYXRlQml0bWFwICY9IFNJUl9NQUNfUkFURV8xMV9CSVRNQVA7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTSVJfTUFDX1JBVEVfNjoKKyAgICAgICAgICAgIHJhdGVCaXRtYXAgJj0gU0lSX01BQ19SQVRFXzZfQklUTUFQOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU0lSX01BQ19SQVRFXzk6CisgICAgICAgICAgICByYXRlQml0bWFwICY9IFNJUl9NQUNfUkFURV85X0JJVE1BUDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV8xMjoKKyAgICAgICAgICAgIHJhdGVCaXRtYXAgJj0gU0lSX01BQ19SQVRFXzEyX0JJVE1BUDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV8xODoKKyAgICAgICAgICAgIHJhdGVCaXRtYXAgJj0gU0lSX01BQ19SQVRFXzE4X0JJVE1BUDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV8yNDoKKyAgICAgICAgICAgIHJhdGVCaXRtYXAgJj0gU0lSX01BQ19SQVRFXzI0X0JJVE1BUDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV8zNjoKKyAgICAgICAgICAgIHJhdGVCaXRtYXAgJj0gU0lSX01BQ19SQVRFXzM2X0JJVE1BUDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV80ODoKKyAgICAgICAgICAgIHJhdGVCaXRtYXAgJj0gU0lSX01BQ19SQVRFXzQ4X0JJVE1BUDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV81NDoKKyAgICAgICAgICAgIHJhdGVCaXRtYXAgJj0gU0lSX01BQ19SQVRFXzU0X0JJVE1BUDsKKyAgICAgICAgICAgIGJyZWFrOworICAgIH0KKyAgICByZXR1cm4gISFyYXRlQml0bWFwOworfQorCisKKwordEFOSV9CT09MRUFOIGNzclJhdGVzSXNEb3QxMVJhdGVTdXBwb3J0ZWQoIHRIYWxIYW5kbGUgaEhhbCwgdEFOSV9VOCByYXRlICkKK3sKKyAgICB0cEFuaVNpckdsb2JhbCBwTWFjID0gUE1BQ19TVFJVQ1QoIGhIYWwgKTsKKyAgICB0QU5JX1UxNiBuID0gQklUU19PRkYoIHJhdGUsIENTUl9ET1QxMV9CQVNJQ19SQVRFX01BU0sgKTsKKworICAgIHJldHVybiBjc3JJc0FnZ3JlZ2F0ZVJhdGVTdXBwb3J0ZWQoIHBNYWMsIG4gKTsKK30KKworCit0QU5JX1UxNiBjc3JSYXRlc01hY1Byb3BUb0RvdDExKCB0QU5JX1UxNiBSYXRlICkKK3sKKyAgICB0QU5JX1UxNiBDb252ZXJ0ZWRSYXRlID0gUmF0ZTsKKworICAgIHN3aXRjaCggUmF0ZSApCisgICAgeworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV8xOgorICAgICAgICAgICAgQ29udmVydGVkUmF0ZSA9IDI7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTSVJfTUFDX1JBVEVfMjoKKyAgICAgICAgICAgIENvbnZlcnRlZFJhdGUgPSA0OworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU0lSX01BQ19SQVRFXzVfNToKKyAgICAgICAgICAgIENvbnZlcnRlZFJhdGUgPSAxMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV8xMToKKyAgICAgICAgICAgIENvbnZlcnRlZFJhdGUgPSAyMjsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgU0lSX01BQ19SQVRFXzY6CisgICAgICAgICAgICBDb252ZXJ0ZWRSYXRlID0gMTI7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTSVJfTUFDX1JBVEVfOToKKyAgICAgICAgICAgIENvbnZlcnRlZFJhdGUgPSAxODsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV8xMjoKKyAgICAgICAgICAgIENvbnZlcnRlZFJhdGUgPSAyNDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV8xODoKKyAgICAgICAgICAgIENvbnZlcnRlZFJhdGUgPSAzNjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV8yNDoKKyAgICAgICAgICAgIENvbnZlcnRlZFJhdGUgPSA0ODsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV8zNjoKKyAgICAgICAgICAgIENvbnZlcnRlZFJhdGUgPSA3MjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV80MjoKKyAgICAgICAgICAgIENvbnZlcnRlZFJhdGUgPSA4NDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV80ODoKKyAgICAgICAgICAgIENvbnZlcnRlZFJhdGUgPSA5NjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV81NDoKKyAgICAgICAgICAgIENvbnZlcnRlZFJhdGUgPSAxMDg7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV83MjoKKyAgICAgICAgICAgIENvbnZlcnRlZFJhdGUgPSAxNDQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTSVJfTUFDX1JBVEVfODQ6CisgICAgICAgICAgICBDb252ZXJ0ZWRSYXRlID0gMTY4OworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU0lSX01BQ19SQVRFXzk2OgorICAgICAgICAgICAgQ29udmVydGVkUmF0ZSA9IDE5MjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV8xMDg6CisgICAgICAgICAgICBDb252ZXJ0ZWRSYXRlID0gMjE2OworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU0lSX01BQ19SQVRFXzEyNjoKKyAgICAgICAgICAgIENvbnZlcnRlZFJhdGUgPSAyNTI7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTSVJfTUFDX1JBVEVfMTQ0OgorICAgICAgICAgICAgQ29udmVydGVkUmF0ZSA9IDI4ODsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV8xNjg6CisgICAgICAgICAgICBDb252ZXJ0ZWRSYXRlID0gMzM2OworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU0lSX01BQ19SQVRFXzE5MjoKKyAgICAgICAgICAgIENvbnZlcnRlZFJhdGUgPSAzODQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTSVJfTUFDX1JBVEVfMjE2OgorICAgICAgICAgICAgQ29udmVydGVkUmF0ZSA9IDQzMjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNJUl9NQUNfUkFURV8yNDA6CisgICAgICAgICAgICBDb252ZXJ0ZWRSYXRlID0gNDgwOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSAweGZmOgorICAgICAgICAgICAgQ29udmVydGVkUmF0ZSA9IDA7CisgICAgICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICByZXR1cm4gQ29udmVydGVkUmF0ZTsKK30KKworCit0QU5JX1UxNiBjc3JSYXRlc0ZpbmRCZXN0UmF0ZSggdFNpck1hY1JhdGVTZXQgKnBTdXBwUmF0ZXMsIHRTaXJNYWNSYXRlU2V0ICpwRXh0UmF0ZXMsIHRTaXJNYWNQcm9wUmF0ZVNldCAqcFByb3BSYXRlcyApCit7CisgICAgdEFOSV9VOCBpOworICAgIHRBTklfVTE2IG5CZXN0OworCisgICAgbkJlc3QgPSBwU3VwcFJhdGVzLT5yYXRlWyAwIF0gJiAoIH5DU1JfRE9UMTFfQkFTSUNfUkFURV9NQVNLICk7CisKKyAgICBpZihwU3VwcFJhdGVzLT5udW1SYXRlcyA+IFNJUl9NQUNfUkFURVNFVF9FSURfTUFYKQorICAgIHsKKyAgICAgICAgcFN1cHBSYXRlcy0+bnVtUmF0ZXMgPSBTSVJf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Zvc19tZW1fZnJlZShwUHJvZmlsZS0+QlNTSURzLmJzc2lkKTsKKyAgICAgICAgICAgIHBQcm9maWxlLT5CU1NJRHMuYnNzaWQgPSBOVUxMOworICAgICAgICB9CisgICAgICAgIGlmKHBQcm9maWxlLT5TU0lEcy5TU0lETGlzdCkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBQcm9maWxlLT5TU0lEcy5TU0lETGlzdCk7CisgICAgICAgICAgICBwUHJvZmlsZS0+U1NJRHMuU1NJRExpc3QgPSBOVUxMOworICAgICAgICB9CisgICAgICAgIGlmKHBQcm9maWxlLT5wV1BBUmVxSUUpCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwUHJvZmlsZS0+cFdQQVJlcUlFKTsKKyAgICAgICAgICAgIHBQcm9maWxlLT5wV1BBUmVxSUUgPSBOVUxMOworICAgICAgICB9CisgICAgICAgIGlmKHBQcm9maWxlLT5wUlNOUmVxSUUpCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwUHJvZmlsZS0+cFJTTlJlcUlFKTsKKyAgICAgICAgICAgIHBQcm9maWxlLT5wUlNOUmVxSUUgPSBOVUxMOworICAgICAgICB9CisjaWZkZWYgRkVBVFVSRV9XTEFOX1dBUEkKKyAgICAgICAgaWYocFByb2ZpbGUtPnBXQVBJUmVxSUUpCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwUHJvZmlsZS0+cFdBUElSZXFJRSk7CisgICAgICAgICAgICBwUHJvZmlsZS0+cFdBUElSZXFJRSA9IE5VTEw7CisgICAgICAgIH0KKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fV0FQSSAqLworCisgICAgICAgIGlmIChwUHJvZmlsZS0+bkFkZElFU2Nhbkxlbmd0aCkKKyAgICAgICAgeworICAgICAgICAgICBtZW1zZXQocFByb2ZpbGUtPmFkZElFU2NhbiwgMCAsIFNJUl9NQUNfTUFYX0FERF9JRV9MRU5HVEgrMik7CisgICAgICAgICAgIHBQcm9maWxlLT5uQWRkSUVTY2FuTGVuZ3RoID0gMDsKKyAgICAgICAgfQorCisgICAgICAgIGlmKHBQcm9maWxlLT5wQWRkSUVBc3NvYykKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBQcm9maWxlLT5wQWRkSUVBc3NvYyk7CisgICAgICAgICAgICBwUHJvZmlsZS0+cEFkZElFQXNzb2MgPSBOVUxMOworICAgICAgICB9CisgICAgICAgIGlmKHBQcm9maWxlLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdCkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBQcm9maWxlLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdCk7CisgICAgICAgICAgICBwUHJvZmlsZS0+Q2hhbm5lbEluZm8uQ2hhbm5lbExpc3QgPSBOVUxMOworICAgICAgICB9CisgICAgICAgIHZvc19tZW1fc2V0KHBQcm9maWxlLCBzaXplb2YodENzclJvYW1Qcm9maWxlKSwgMCk7CisgICAgfQorfQorCit2b2lkIGNzckZyZWVTY2FuRmlsdGVyKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRDc3JTY2FuUmVzdWx0RmlsdGVyICpwU2NhbkZpbHRlcikKK3sKKyAgICBpZihwU2NhbkZpbHRlci0+QlNTSURzLmJzc2lkKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBTY2FuRmlsdGVyLT5CU1NJRHMuYnNzaWQpOworICAgICAgICBwU2NhbkZpbHRlci0+QlNTSURzLmJzc2lkID0gTlVMTDsKKyAgICB9CisgICAgaWYocFNjYW5GaWx0ZXItPkNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0KQorICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBTY2FuRmlsdGVyLT5DaGFubmVsSW5mby5DaGFubmVsTGlzdCk7CisgICAgICAgIHBTY2FuRmlsdGVyLT5DaGFubmVsSW5mby5DaG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XMgKXJldCApOworfQorCisjaWYgMAordFNpclNjYW5UeXBlIGNzckdldFNjYW5UeXBlKHRBTklfVTggY2huSWQsIGVSZWdEb21haW5JZCBkb21haW5JZCwgdEFOSV9VOCAqY291bnRyeUNvZGUpCit7CisgICAgdFNpclNjYW5UeXBlIHNjYW5UeXBlID0gZVNJUl9QQVNTSVZFX1NDQU47CisgICAgdEFOSV9VOCBjYyA9IDA7CisKKyAgICB3aGlsZSAoY2MrKyA8IGdDc3JEb21haW5DaG5JbmZvW2RvbWFpbklkXS5udW1DaGFubmVscykKKyAgICB7CisgICAgICAgIGlmKGNobklkID09IGdDc3JEb21haW5DaG5JbmZvW2RvbWFpbklkXS5jaG5JbmZvW2NjXS5jaG5JZCkKKyAgICAgICAgeworICAgICAgICAgICAgc2NhblR5cGUgPSBnQ3NyRG9tYWluQ2huSW5mb1tkb21haW5JZF0uY2huSW5mb1tjY10uc2NhblR5cGU7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiAoc2NhblR5cGUpOworfQorI2VuZGlmCisKK3RTaXJTY2FuVHlwZSBjc3JHZXRTY2FuVHlwZSh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4IGNobklkKQoreworICAgIHRTaXJTY2FuVHlwZSBzY2FuVHlwZSA9IGVTSVJfUEFTU0lWRV9TQ0FOOworICAgIGVOVkNoYW5uZWxFbmFibGVkVHlwZSBjaGFubmVsRW5hYmxlZFR5cGU7CisKKyAgICBjaGFubmVsRW5hYmxlZFR5cGUgPSB2b3NfbnZfZ2V0Q2hhbm5lbEVuYWJsZWRTdGF0ZShjaG5JZCk7CisgICAgaWYoIE5WX0NIQU5ORUxfRU5BQkxFID09ICBjaGFubmVsRW5hYmxlZFR5cGUpCisgICAgeworICAgICAgICAgc2NhblR5cGUgPSBlU0lSX0FDVElWRV9TQ0FOOworICAgIH0KKyAgICByZXR1cm4gKHNjYW5UeXBlKTsKK30KKworCit0QU5JX1U4IGNzclRvVXBwZXIoIHRBTklfVTggY2ggKQoreworICAgIHRBTklfVTggY2hPdXQ7CisKKyAgICBpZiAoIGNoID49ICdhJyAmJiBjaCA8PSAneicgKQorICAgIHsKKyAgICAgICAgY2hPdXQgPSBjaCAtICdhJyArICdBJzsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgY2hPdXQgPSBjaDsKKyAgICB9CisgICAgcmV0dXJuKCBjaE91dCApOworfQorCisKK3RTaXJCc3NUeXBlIGNzclRyYW5zbGF0ZUJzc3R5cGVUb01hY1R5cGUoZUNzclJvYW1Cc3NUeXBlIGNzcnR5cGUpCit7CisgICAgdFNpckJzc1R5cGUgcmV0OworCisgICAgc3dpdGNoKGNzcnR5cGUpCisgICAgeworICAgIGNhc2UgZUNTUl9CU1NfVFlQRV9JTkZSQVNUUlVDVFVSRToKKyAgICAgICAgcmV0ID0gZVNJUl9JTkZSQVNUUlVDVFVSRV9NT0RFOworICAgICAgICBicmVhazsKKyAgICBjYXNlIGVDU1JfQlNTX1RZUEVfSUJTUzoKKyAgICBjYXNlIGVDU1JfQlNTX1RZUEVfU1RBUlRfSUJTUzoKKyAgICAgICAgcmV0ID0gZVNJUl9JQlNTX01PREU7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgZUNTUl9CU1NfVFlQRV9XRFNfQVA6CisgICAgICAgIHJldCA9IGVTSVJfQlRBTVBfQVBfTU9ERTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBlQ1NSX0JTU19UWVBFX1dEU19TVEE6CisgICAgICAgIHJldCA9IGVTSVJfQlRBTVBfU1RBX01PREU7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgZUNTUl9CU1NfVFlQRV9JTkZSQV9BUDoKKyAgICAgICAgcmV0ID0gZVNJUl9JTkZSQV9BUF9NT0RFOworICAgICAgICBicmVhazsKKyAgICBjYXNlIGVDU1JfQlNTX1RZUEVfQU5ZOgorICAgIGRlZmF1bHQ6CisgICAgICAgIHJldCA9IG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NfSU5GUkFfQVAocFByb2ZpbGUpKSAmJiAocGh5TW9kZSA9PSBlQ1NSX0RPVDExX01PREVfMTFnX09OTFkpKQorICAgICAgICAgICAgY2ZnRG90MTFNb2RlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUdfT05MWTsKKyAgICAgICAgZWxzZQorICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExRzsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBlQ1NSX0RPVDExX01PREVfMTFuOgorICAgICAgICBpZihmUHJvcHJpZXRhcnkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGNmZ0RvdDExTW9kZSA9IGVDU1JfQ0ZHX0RPVDExX01PREVfVEFVUlVTOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgY2ZnRG90MTFNb2RlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV8xMU47CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBlQ1NSX0RPVDExX01PREVfMTFuX09OTFk6CisgICAgICAgaWYocFByb2ZpbGUgJiYgQ1NSX0lTX0lORlJBX0FQKHBQcm9maWxlKSkKKyAgICAgICAgICAgY2ZnRG90MTFNb2RlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV8xMU5fT05MWTsKKyAgICAgICBlbHNlCisgICAgICAgY2ZnRG90MTFNb2RlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV8xMU47CisgICAgICAgYnJlYWs7CisgICAgY2FzZSBlQ1NSX0RPVDExX01PREVfVEFVUlVTOgorICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFX1RBVVJVUzsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBlQ1NSX0RPVDExX01PREVfYWJnOgorICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFX0FCRzsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBlQ1NSX0RPVDExX01PREVfQVVUTzoKKyAgICAgICAgY2ZnRG90MTFNb2RlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV9BVVRPOworICAgICAgICBicmVhazsKKworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisgICAgY2FzZSBlQ1NSX0RPVDExX01PREVfMTFhYzoKKyAgICAgICAgaWYgKElTX0ZFQVRVUkVfU1VQUE9SVEVEX0JZX0ZXKERPVDExQUMpKQorICAgICAgICB7CisgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExQUM7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExTjsKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICBjYXNlIGVDU1JfRE9UMTFfTU9ERV8xMWFjX09OTFk6CisgICAgICAgIGlmIChJU19GRUFUVVJFX1NVUFBPUlRFRF9CWV9GVyhET1QxMUFDKSkKKyAgICAgICAgeworICAgICAgICAgICAgY2ZnRG90MTFNb2RlID0gZUNTUl9DRkdfRE9UMTFfTU9ERV8xMUFDX09OTFk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBjZmdEb3QxMU1vZGUgPSBlQ1NSX0NGR19ET1QxMV9NT0RFXzExTjsKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyNlbmRpZgorICAgIGRlZmF1bHQ6CisgICAgICAgIC8vTm8gbmVlZCB0byBhc3NpZ24gYW55dGhpbmcgaGVyZQorICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICByZXR1cm4gKGNmZ0RvdDExTW9kZSk7Cit9CisKKworZUhhbFN0YXR1cyBjc3JTZXRSZWd1bGF0b3J5RG9tYWluKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHZf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yeQorKAordHBBbmlTaXJHbG9iYWwgcE1hYywKK3RBTklfVTggKnBDb3VudHJ5LAordl9SRUdET01BSU5fdCAqcERvbWFpbklkLAordl9Db3VudHJ5SW5mb1NvdXJjZV90IHNvdXJjZQorKQoreworICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfSU5WQUxJRF9QQVJBTUVURVI7CisgICAgVk9TX1NUQVRVUyB2b3NTdGF0dXM7CisgICAgdl9DT1VOVFJZQ09ERV90IGNvdW50cnlDb2RlOworICAgIHZfUkVHRE9NQUlOX3QgZG9tYWluSWQ7CisKKyAgICBpZihwQ291bnRyeSkKKyAgICB7CisgICAgICAgIGNvdW50cnlDb2RlWzBdID0gcENvdW50cnlbMF07CisgICAgICAgIGNvdW50cnlDb2RlWzFdID0gcENvdW50cnlbMV07CisgICAgICAgIHZvc1N0YXR1cyA9IHZvc19udl9nZXRSZWdEb21haW5Gcm9tQ291bnRyeUNvZGUoJmRvbWFpbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50cnlDb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZSk7CisKKyAgICAgICAgaWYoIFZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYoIHBEb21haW5JZCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgKnBEb21haW5JZCA9IGRvbWFpbklkOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dXLCBGTCgiIENvdWxkbid0IGZpbmQgZG9tYWluIGZvciBjb3VudHJ5IGNvZGUgICVjJWMiKSwg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worICAgICAgICB9CisgICAgICAgIGlmKCAhcEllcyApCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCBGTCgiICBObyBJRXMiKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBpZiggcE1hYy0+cm9hbS5jb25maWdQYXJhbS5mRW5mb3JjZURlZmF1bHREb21haW4gfHwKKyAgICAgICAgICAgIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uZkVuZm9yY2VDb3VudHJ5Q29kZU1hdGNoICkKKyAgICAgICAgeworICAgICAgICAgICAgLy9NYWtlIHN1cmUgdGhpcyBjb3VudHJ5IGlzIHJlY29nbml6YWJsZQorICAgICAgICAgICAgaWYoIHBJZXMtPkNvdW50cnkucHJlc2VudCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyR2V0UmVndWxhdG9yeURvbWFpbkZvckNvdW50cnkocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVzLT5Db3VudHJ5LmNvdW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmRvbWFpbklkLCBDT1VOVFJZX1FVRVJZKTsKKyAgICAgICAgICAgICAgICBpZiggIUhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzckdldFJlZ3VsYXRvcnlEb21haW5Gb3JDb3VudHJ5KHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+c2Nhbi5jb3VudHJ5Q29kZTExZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodl9SRUdET01BSU5fdCAqKSAmZG9tYWluSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ09VTlRSWV9RVUVSWSk7CisgICAgICAgICAgICAgICAgICAgICBpZiggIUhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgZlJldCA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vY2hlY2sgd2hldGhlciBpdCBpcyBuZWVkZWQgdG8gZW5mb3JjZSB0byB0aGUgZGVmYXVsdCByZWd1bGF0b3J5IGRvbWFpbiBmaXJzdAorICAgICAgICAgICAgaWYoIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uZkVuZm9yY2VEZWZhdWx0RG9tYWluICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiggZG9tYWluSWQgIT0gcE1hYy0+c2Nhbi5kb21haW5JZEN1cnJlbnQgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgZlJldCA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYoIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uZkVuZm9yY2VDb3VudHJ5Q29kZU1hdGNoICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgIGlmKCBkb21haW5JZCA+PSBSRUdET01BSU5fQ09VTlQgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgZlJldCA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmKCBwQ291bnRyeSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHRBTklfVTMyIGk7CisKKyAgICAgICAgICAgIGlmKCAhcEllcy0+Q291bnRyeS5wcmVzZW50ICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBmUmV0ID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gQ29udmVydCB0aGUgQ291bnRyeUNvZGUgY2hhcmFjdGVycyB0byB1cHBlcgorICAgICAgICAgICAgZm9yICggaSA9IDA7IGkgPCBXTklfQ0ZHX0NPVU5UUllfQ09ERV9MRU4gLSAxOyBpKysgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBDb3VudHJ5W2ldID0gY3NyVG9VcHBlciggcENvdW50cnlbaV0gKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghdm9zX21lbV9jb21wYXJlKHBJZXMtPkNvdW50cnkuY291bnRyeSwgcENvdW50cnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfQ09VTlRSWV9DT0RFX0xFTiAtIDEpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGZSZXQgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9IHdoaWxlKDApOworCisgICAgcmV0dXJuIChmUmV0KTsKK30KKworI2lmIDAKK2VIYWxTdGF0dXMgY3NyU2V0Q291bnRyeURvbWFpbk1hcHBpbmcodHBBbmlTaXJHbG9iYWwgcE1hYywgdENzckNvdW50cnlEb21haW5NYXBwaW5nICpwQ291bnRyeURvbWFpbk1hcHBpbmcpCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19JTlZBTElEX1BBUkFNRVRFUjsKKyAgICB0QU5JX1UzMiBpLCBqOworICAgIHRBTklfQk9PTEVBTiBmRG9tYWluQ2hhbmdlZCA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICB0QU5JX1U4IGNvdW50cnlDb2RlW1dOSV9DRkdfQ09VTlRSWV9DT0RFX0xFTl07CisKKyAgICBpID0gV05JX0NGR19DT1VOVFJZX0NPREVfTEVOOworICAgIC8vR2V0IHRoZSBjdXJyZW50bHkgdXNlZCBjb3VudHJ5IGNvZGUKKyAgICBzdGF0dXMgPSBjY21DZmdHZXRTdHIocE1hYywgV05JX0NGR19DT1VOVFJZX0NPREUsIGNvdW50cnlDb2RlLCAmaSk7CisgICAgaWYoSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgeworICAgICAgICBpZihwQ291bnRyeURvbWFpbk1hcHBpbmcgJiYgcENvdW50cnlEb21haW5NYXBwaW5nLT5udW1FbnRyeSkKKyAgICAgICAgeworICAgICAgICAgICAgZm9yKGkgPSAwOyBpIDwgcENvdW50cnlEb21haW5NYXBwaW5nLT5udW1FbnRyeTsgaSsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGZvcihqID0gMDsgaiA8IGVDU1JfTlVNX0NPVU5UUllfSU5ERVg7IGorKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmICh2b3NfbWVtX2NvbXBhcmUoZ0NzckNvdW50cnlJbmZvW2pdLmNvdW50cnlDb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDb3VudHJ5RG9tYWluTWFwcGluZy0+cENvdW50cnlJbmZvW2ldLmNvdW50cnlDb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihnQ3NyQ291bnRyeUluZm9bal0uZG9tYWluSWQgIT0gcENvdW50cnlEb21haW5NYXBwaW5nLT5wQ291bnRyeUluZm9baV0uZG9tYWluSWQpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ0NzckNvdW50cnlJbmZvW2pdLmRvbWFpbklkID0gcENvdW50cnlEb21haW5NYXBwaW5nLT5wQ291bnRyeUluZm9baV0uZG9tYWluSWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9DaGVjayB3aGV0aGVyIGl0IG1hdGNoZXMgdGhlIGN1cnJlbnRseSB1c2VkIGNvdW50cnkgY29kZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vSWYgbWF0Y2hpbmcsIG5lZWQgdG8gdXBkYXRlIGJhc2Ugb24gdGhlIG5ldyBkb21haW4gc2V0dGluZy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodm9zX21lbV9jb21wYXJlKGNvdW50cnlDb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvdW50cnlEb21haW5NYXBwaW5nLT5wQ291bnRyeUluZm9baV0uY291bnRyeUNvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZEb21haW5DaGFuZ2VkID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgaWYoZkRvbWFpbkNoYW5nZWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdENzckNoYW5uZWwgKnBDaGFubmVsTGlzdDsKKworICAgICAgICAgICAgICAgIGlmKHBNYWMtPnNjYW4uZjExZEluZm9BcHBsaWVkKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy8xMWQgaW5mbyBhbHJlYWR5IGFwcGxpZWQuIExldCdzIHJlYXBwbHkgd2l0aCB0aGUgbmV3IGRvbWFpbiBzZXR0aW5nCisgICAgICAgICAgICAgICAgICAgIGlmKHBNYWMtPnNjYW4uY2hhbm5lbHMxMWQubnVtQ2hhbm5lbHMpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBDaGFubmVsTGlzdCA9ICZwTWFjLT5zY2FuLmNoYW5uZWxzMTFkOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcENoYW5uZWxMaXN0ID0gJnBNYWMtPnNjYW4uYmFzZTIwTUh6Q2hhbm5lbHM7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy9ubyAxMWQgc28gd2UgdXNlIHRoZSBiYXNlIGNoYW5uZWxpc3QgZnJvbSBFRVBST00KKyAgICAgICAgICAgICAgICAgICAgcENoYW5uZWxMaXN0ID0gJnBNYWMtPnNjYW4uYmFzZTIwTUh6Q2hhbm5lbHM7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8vc2V0IHRoZSBuZXcgZG9tYWluJ3Mgc2NhbiByZXF1aXJlbWVudCB0byBDRkcKKyAgICAgICAgICAgICAgICBjc3JTZXRDZmdTY2FuQ29udHJvbExpc3QocE1hYywgY291bnRyeUNvZGUsIHBDaGFubmVsTGlzdCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gKHN0YXR1cyk7Cit9CisKK2VIYWxTdGF0dXMgY3NyU2V0RG9tYWluU2NhblNldHRpbmcodHBBbmlTaXJHbG9iYWwgcE1hYywgdENzckRvbWFpbkZyZXFJbmZvICpwRG9tYWluRnJlcUluZm8pCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19JTlZBTElEX1BBUkFNRVRFUjsKKyAgICB0QU5JX1UzMiBpLCBqOworICAgIHRBTklfVTE2IGZyZXE7CisKKyAgICBpZihwRG9tYWluRnJlcUluZm8gJiYgcERvbWFpbkZyZXFJbmZvLT5udW1FbnRyeSAmJiAocERvbWFpbkZyZXFJbmZvLT5kb21haW5JZCA8IE5VTV9SRUdfRE9NQUlOUykpCisgICAgeworICAgICAgICB0Q3NyRG9tYWluQ2huSW5mbyAqcERvbWFpbkNobkluZm8gPSAmZ0NzckRvbWFpbkNobkluZm9bcERvbWFpbkZyZXFJbmZvLT5kb21haW5JZF07CisKKyAgICAgICAgZm9yKGogPSAwOyBqIDwgcERvbWFpbkNobkluZm8tPm51bUNoYW5uZWxzOyBqKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKEhBTF9TVEFUVVNfU1VDQ0VTUyhoYWxQaHlDaElkVG9GcmVxQ29udmVyc2lvbihwRG9tYWluQ2huSW5mby0+Y2huSW5mb1tqXS5jaG5JZCwgJmZyZXEpKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBmb3IoaSA9IDA7IGkgPCBwRG9tYWluRnJlcUluZm8tPm51bUVudHJ5OyBpKyspCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZigocERvbWFpbkZyZXFJbmZvLT5wQ3NyU2NhbkZyZXFJbmZvW2ldLm5TdGFydEZyZXEgPD0gZnJlcSkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIChmcmVxIDw9IHBEb21haW5GcmVxSW5mby0+cENzclNjYW5GcmVxSW5mb1tpXS5uRW5kRnJlcSkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBEb21haW5DaG5JbmZvLT5jaG5JbmZvW2pdLnNjYW5UeXBlID0gcERvbWFpbkZyZXFJbmZvLT5wQ3NyU2NhbkZyZXFJbmZvW2ldLnNjYW5UeXBlOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csICIgICBGYWlsZWQgdG8gZ2V0IGZyZXF1ZW5jeSBvZiBjaGFubmVsICVkIiwgcERvbWFpbkNobkluZm8tPmNobkluZm9bal0uY2huSWQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgfQorCisgICAgcmV0dXJuIChzdGF0dXMpOworfQorI2VuZGlmCisKK2VIYWxTdGF0dXMgY3NyR2V0TW9kaWZ5UHJvZmlsZUZpZWxkcyh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UzMiBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdENzclJvYW1Nb2RpZnlQcm9maWxlRmllbGRzICpwTW9kaWZ5UHJvZmlsZUZpZWxkcykKK3sKKworICAgaWYoIXBNb2RpZnlQcm9maWxlRmllbGRzKQorICAgeworICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICB9CisKKyAgIHZvc19tZW1fY29weShwTW9kaWZ5UHJvZmlsZUZpZWxkcywKKyAgICAgICAgICAgICAgICAmcE1hYy0+cm9hbS5yb2FtU2Vzc2lvbltzZXNzaW9uSWRdLmNvbm5lY3RlZFByb2ZpbGUubW9kaWZ5UHJvZmlsZUZpZWxkcywKKyAgICAgICAgICAgIC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yKXNpemU7CisKKyAgICAvL0lmIHBCdWYgaXMgTlVMTCwgY2FsbGVyIGp1c3Qgd2FudCB0byBnZXQgdGhlIHNpemUsIGNvbnNpZGVyIGl0IHN1Y2Nlc3MKKyAgICBpZihwQnVmKQorICAgIHsKKyAgICAgICAgaWYoIFZPU19JU19TVEFUVVNfU1VDQ0VTUyggdm9zU3RhdHVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICB0QU5JX1UzMiBpLCBuID0gKnBiTGVuIC8gMzsKKworICAgICAgICAgICAgZm9yKCBpID0gMDsgaSA8IG47IGkrKyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcEJ1ZltpKjMgKyAyXSA9ICcgJzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gKHN0YXR1cyk7Cit9CisKKworCisvL1VwcGVyIGxheWVyIHRvIGdldCB0aGUgbGlzdCBvZiB0aGUgYmFzZSBjaGFubmVscyB0byBzY2FuIGZvciBwYXNzaXZlbHkgMTFkIGluZm8gZnJvbSBjc3IKK2VIYWxTdGF0dXMgY3NyU2NhbkdldEJhc2VDaGFubmVscyggdHBBbmlTaXJHbG9iYWwgcE1hYywgdENzckNoYW5uZWxJbmZvICogcENoYW5uZWxJbmZvICkKK3sKKyAgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisKKyAgICBkbworICAgIHsKKyAgICAKKyAgICAgICBpZighcE1hYy0+c2Nhbi5iYXNlQ2hhbm5lbHMubnVtQ2hhbm5lbHMgfHwgIXBDaGFubmVsSW5mbykKKyAgICAgICB7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgfQorICAgICAgIHBDaGFubmVsSW5mby0+Q2hhbm5lbExpc3QgPSB2b3NfbWV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taW5nIEJNUFMKKyAqLworIAorLy9SZW1vdmUgdGhpcyBjb2RlIG9uY2UgU0xNX1Nlc3Npb25pemF0aW9uIGlzIHN1cHBvcnRlZCAKKy8vQk1QU19XT1JLQVJPVU5EX05PVF9ORUVERUQKK3ZvaWQgY3NyRGlzY29ubmVjdEFsbEFjdGl2ZVNlc3Npb25zKHRwQW5pU2lyR2xvYmFsIHBNYWMpCit7CisgICAgdEFOSV9VOCBpOworCisgICAgLyogRGlzY29ubmVjdCBhbGwgdGhlIGFjdGl2ZSBzZXNzaW9ucyAqLworICAgIGZvciAoaT0wOyBpPENTUl9ST0FNX1NFU1NJT05fTUFYOyBpKyspCisgICAgeworICAgICAgICBpZiggQ1NSX0lTX1NFU1NJT05fVkFMSUQoIHBNYWMsIGkgKSAmJiAhY3NySXNDb25uU3RhdGVEaXNjb25uZWN0ZWQoIHBNYWMsIGkgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGNzclJvYW1EaXNjb25uZWN0SW50ZXJuYWwocE1hYywgaSwgZUNTUl9ESVNDT05ORUNUX1JFQVNPTl9VTlNQRUNJRklFRCk7CisgICAgICAgIH0KKyAgICB9Cit9CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fTEZSCit0QU5JX0JPT0xFQU4gY3NySXNDaGFubmVsUHJlc2VudEluTGlzdCgKKyAgICAgICAgdEFOSV9VOCAqcENoYW5uZWxMaXN0LAorICAgICAgICBpbnQgIG51bUNoYW5uZWxzLAorICAgICAgICB0QU5JX1U4ICAgY2hhbm5lbAorICAgICAgICApCit7CisgICAgaW50IGkgPSAwOworCisgICAgLy8gQ2hlY2sgZm9yIE5VTEwgcG9pbnRlcgorICAgIGlmICghcENoYW5uZWxMaXN0IHx8IChudW1DaGFubmVscyA9PSAwKSkKKyAgICB7CisgICAgICAgcmV0dXJuIEZBTFNFOworICAgIH0KKworICAgIC8vIExvb2sgZm9yIHRoZSBjaGFubmVsIGluIHRoZSBsaXN0CisgICAgZm9yIChpID0gMDsg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dBUkUuCisgKi8KKworLyoKKyAqIFRoaXMgZmlsZSB3YXMgb3JpZ2luYWxseSBkaXN0cmlidXRlZCBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKyNpbmNsdWRlICJzbWVfQXBpLmgiCisjaW5jbHVkZSAic21zRGVidWcuaCIKKyNpbmNsdWRlICJjc3JJbnNpZGVBcGkuaCIKKyNpbmNsdWRlICJzbWVJbnNpZGUuaCIKKyNpbmNsdWRlICJsaW1BcGkuaCIKKyNpbmNsdWRlICJjZmdBcGkuaCIKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogRnVuY3Rpb246IHNtZV9OYW5SZWdpc3RlckNhbGxiYWNrCisgKgorICogRGVzY3JpcHRpb246CisgKiBUaGlzIGZ1bmN0aW9uIGdldHMgY2FsbGVkIHdoZW4gSEREIHdhbnRzIHJlZ2lzdGVyIG5hbiByc3AgY2FsbGJhY2sgd2l0aAorICogc21lIGxheWVyLgorICoKKyAqIEFyZ3M6CisgKiBoSGFsIGFuZCBjYWxsYmFjayB3aGljaCBuZWVkcyB0byBiZSByZWdpc3RlcmVkLgorICoKKyAqIFJldHVybnM6CisgKiB2b2lkCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCit2b2lkIHNtZV9OYW5SZWdpc3RlckNhbGxiYWNrKHRIYWxIYW5kbGUgaEhhbCwgTmFuQ2FsbGJhY2sgY2FsbGJhY2spCit7CisgICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9IE5VTEw7CisKKyAgICBpZiAoTlVMTCA9PSBoSGFsKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgRkwoImhIYWwgaXMgbm90IHZhbGlkIikpOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIHBNYWMgPSBQTUFDX1NUUlVDVChoSGFsKTsKKyAgICBwTWFjLT5zbWUubmFuQ2FsbGJhY2sgPSBjYWxsYmFjazsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogRnVuY3Rpb246IHNtZV9OYW5SZXF1ZXN0CisgKgorICogRGVzY3JpcHRpb246CisgKiBUaGlzIGZ1bmN0aW9uIGdldHMgY2FsbGVkIHdoZW4gSEREIHJlY2VpdmVzIE5BTiB2ZW5kb3IgY29tbWFuZAorICogZnJvbSB1c2Vyc3BhY2UKKyAqCisgKiBBcmdzOgorICogaEhhbCwgTmFuIFJlcXVlc3Qgc3RydWN0dXJlIHB0ciBhbmQgc2Vzc2lvbklkCisgKgorICogUmV0dXJuczoKKyAqIFZPU19TVEFUVVMKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK1ZPU19TVEFUVVMgc21lX05hblJlcXVlc3QodEhhbEhhbmRsZSBoSGFsSGFuZGxlLCB0cE5hblJlcXVlc3RSZXEgaW5wdXQsCisgICAgICAgIHRBTklfVTMyIHNlc3Npb25JZCkKK3sKKyAgICB0TmFuUmVxdWVzdCAqcE5hblJlcSA9IE5VTEw7CisgICAgc2l6ZV90IGRhdGFfbGVuOworICAgIHRTbWVDbWQgKnBDb21tYW5kOworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVChoSGFsSGFuZGxlKTsKKworICAgIHBDb21tYW5kID0gY3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W5SZXEtPnJlcXVlc3RfZGF0YSwKKyAgICAgICAgICAgICAgICAgaW5wdXQtPnJlcXVlc3RfZGF0YSwKKyAgICAgICAgICAgICAgICAgaW5wdXQtPnJlcXVlc3RfZGF0YV9sZW4pOworCisgICAgcENvbW1hbmQtPmNvbW1hbmQgPSBlU21lQ29tbWFuZE5hblJlcTsKKyAgICBwQ29tbWFuZC0+c2Vzc2lvbklkID0gc2Vzc2lvbklkOworICAgIHBDb21tYW5kLT51LnBOYW5SZXEgPSBwTmFuUmVxOworCisgICAgaWYgKCFIQUxfU1RBVFVTX1NVQ0NFU1MoY3NyUXVldWVTbWVDb21tYW5kKHBNYWMsIHBDb21tYW5kLCBUUlVFKSkpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgRkwoImZhaWxlZCB0byBwb3N0IGVTbWVDb21tYW5kTmFuUmVxIGNvbW1hbmQiKSk7CisgICAgICAgIGNzclJlbGVhc2VDb21tYW5kKHBNYWMsIHBDb21tYW5kKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBOYW5SZXEpOworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgfQorCisgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogRnVuY3Rpb246IHNtZV9OYW5FdmVudAorICoKKyAqIERlc2NyaXB0aW9uOgorICogVGhpcyBjYWxsYmFjayBmdW5jdGlvbiB3aWxsIGJlIGNhbGxlZCB3aGVuIFNNRSByZWNlaXZlZCBlV05JX1NNRV9OQU5fRVZFTlQKKyAqIGV2ZW50IGZyb20gV01BCisgKgorICogQXJnczoKKyAqIGhIYWwgLSBIQUwgaGFuZGxlIGZvciBkZXZpY2UKKyAqIHBNc2cgLSBNZXNzYWdlIGJvZHkgcGFzc2VkIGZyb20gV0RBOyBpbmNsdWRlcyBOQU4gaGVhZGVyCisgKgorICogUmV0dXJuczoKKyAqIFZPU19TVEFUVVMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK1ZPU19TVEFUVVMgc21lX05hbkV2ZW50KHRIYWxIYW5kbGUgaEhhbCwgdm9pZCogcE1zZykKK3sKKyAgICB0cEFuaVNpckdsb2JhbCBwTWFjID0gUE1BQ19TVFJVQ1QoaEhhbCk7CisgICAgVk9TX1NUQVRVUyBzdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisKKyAgICBpZiAoTlVMTCA9PSBwTXNnKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgRkwoIm1zZyBwdHIgaXMgTlVMTCIpKTsKKyAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fTUVELAorICAgICAgICAgICAgICAgIEZMKCJTTUU6IFJlY2VpdmVkIHNtZV9OYW5FdmVudCIpKTsKKyAgICAgICAgaWYgKHBNYWMtPnNtZS5uYW5DYWxsYmFjaykKKyAgICAgICAgeworICAgICAgICAgICAgcE1hYy0+c21lLm5hbkNhbGxiYWNrKHBNYWMtPmhIZGQsICh0U2lyTmFuRXZlbnQgKilwTXNnKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX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hbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpwQ29udGV4dCkKK3sKKyAgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9IFBNQUNfU1RSVUNUKCBoSGFsICk7CisgICAgdFNtZUNtZCAqcE9lbURhdGFDbWQgPSBOVUxMOworCisgICAgZG8KKyAgICB7CisgICAgICAgIGlmKCAhQ1NSX0lTX1NFU1NJT05fVkFMSUQoIHBNYWMsIHNlc3Npb25JZCApICkKKyAgICAgICAgeworICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIHBNYWMtPm9lbURhdGEub2VtRGF0YVJlcUNvbmZpZy5zZXNzaW9uSWQgPSBzZXNzaW9uSWQ7CisgICAgICAgIHBNYWMtPm9lbURhdGEuY2FsbGJhY2sgPSBjYWxsYmFjazsKKyAgICAgICAgcE1hYy0+b2VtRGF0YS5wQ29udGV4dCA9IHBDb250ZXh0OworICAgICAgICBwTWFjLT5vZW1EYXRhLm9lbURhdGFSZXFJRCA9ICoocE9lbURhdGFSZXFJRCk7CisKKyAgICAgICAgdm9zX21lbV9jb3B5KCh2X1ZPSURfdCopKHBNYWMtPm9lbURhdGEub2VtRGF0YVJlcUNvbmZpZy5vZW1EYXRhUmVxKSwKKyAgICAgICAgICAgICAgICAgICAgICh2X1ZPSURfdCopKG9lbURhdGFSZXFDb25maWctPm9lbURhdGFSZXEpLAorICAgICAgICAgICAgICAgICAgICAgT0VNX0RBVEFfUkVRX1NJWkUpOworCisgICAgICAgIHBNYWMtPm9lbURhdGEub2VtRGF0YVJlcUFjdGl2ZSA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKworICAgICAgICBwT2VtRGF0YUNtZCA9IHNtZUdldENvbW1hbmRCdWZmZXIocE1hYyk7CisKKyAgICAgICAgLy9maWxsIHVwIHRoZSBjb21tYW5kIGJlZm9yZSBwb3N0aW5nIGl0LgorICAgICAgICBpZihwT2VtRGF0YUNtZCkKKyAgICAgICAgeworICAgICAgICAgICAgcE9lbURhdGFDbWQtPmNvbW1hbmQgPSBlU21lQ29tbWFuZE9lbURhdGFSZXE7CisgICAgICAgICAgICBwT2VtRGF0YUNtZC0+dS5vZW1EYXRhQ21kLmNhbGxiYWNrID0gY2FsbGJhY2s7CisgICAgICAgICAgICBwT2VtRGF0YUNtZC0+dS5vZW1EYXRhQ21kLnBDb250ZXh0ID0gcENvbnRleHQ7CisgICAgICAgICAgICBwT2VtRGF0YUNtZC0+dS5vZW1EYXRhQ21kLm9lbURhdGFSZXFJRCA9IHBNYWMtPm9lbURhdGEub2VtRGF0YVJlcUlEOworCisgICAgICAgICAgICAvL3NldCB0aGUgb2VtIGRhdGEgcmVxdWVzdAorICAgICAgICAgICAgcE9lbURhdGFDbWQtPnUub2VtRGF0YUNtZC5vZW1EYXRhUmVxLnNlc3Npb25JZCA9IHBNYWMtPm9lbURhdGEub2VtRGF0YVJlcUNvbmZpZy5zZXNzaW9uSWQ7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHZfVk9JRF90KikocE9lbURhdGFDbWQtPnUub2VtRGF0YUNtZC5vZW1EYXRhUmVxLm9lbURhdGFSZXEpLAorICAgICAgICAgICAgICAgICAgICAgICAgICh2X1ZPSURfdCopKHBNYWMtPm9lbURhdGEub2VtRGF0YVJlcUNvbmZpZy5vZW1EYXRhUmVxKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBPRU1fREFUQV9SRVFfU0laRSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICAvL25vdyBxdWV1ZSB0aGlzIGNvbW1hbmQg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0tLS0qLworZUhhbFN0YXR1cyBzbWVfSGFuZGxlT2VtRGF0YVJzcCh0SGFsSGFuZGxlIGhIYWwsIHRBTklfVTgqIHBNc2cpCit7CisgICAgZUhhbFN0YXR1cyAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIHRwQW5pU2lyR2xvYmFsICAgICAgICAgICAgICAgICAgICAgcE1hYzsKKyAgICB0TGlzdEVsZW0gICAgICAgICAgICAgICAgICAgICAgICAgICpwRW50cnkgPSBOVUxMOworICAgIHRTbWVDbWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgKnBDb21tYW5kID0gTlVMTDsKKyAgICB0U2lyT2VtRGF0YVJzcCogICAgICAgICAgICAgICAgICAgIHBPZW1EYXRhUnNwID0gTlVMTDsKKyAgICBwTWFjID0gUE1BQ19TVFJVQ1QoaEhhbCk7CisKKyAgICBzbXNMb2cocE1hYywgTE9HMSwgIiVzOiBPRU1fREFUQSBFbnRlcmluZyIsIF9fZnVuY19fKTsKKworICAgIGRvCisgICAgeworICAgICAgICBpZihwTXNnID09IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCAiaW4gJXMgbXNnIHB0ciBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgcEVudHJ5ID0gY3NyTExQZWVrSGVhZCggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0LCBMTF9BQ0NFU1NfTE9DSyApOworICAgICAgICBpZihwRW50cnkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBDb21tYW5kID0gR0VUX0JBU0VfQUREUiggcEVudHJ5LCB0U21lQ21kLCBMaW5rICk7CisgICAgICAgICAgICBpZihlU21lQ29tbWFuZE9lbURhdGFSZXEgPT0gcENvbW1hbmQtPmNvbW1hbmQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcE9lbURhdGFSc3AgPSAodFNpck9lbURhdGFSc3AqKXBNc2c7CisKKyAgICAgICAgICAgICAgICAvL21ha2Ugc3VyZSB0byBhY3F1aXJlIHRoZSBsb2NrIGJlZm9yZSBtb2RpZnlpbmcgdGhlIGRhdGEKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBzbWVfQWNxdWlyZUdsb2JhbExvY2soJnBNYWMtPnNtZSk7CisgICAgICAgICAgICAgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYocE1hYy0+b2VtRGF0YS5wT2VtRGF0YVJzcCAhPSBOVUxMKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBNYWMtPm9lbURhdGEucE9lbURhdGFSc3ApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwTWFjLT5vZW1EYXRhLnBPZW1EYXRhUnNwID0gKHRPZW1EYXRhUnNwKil2b3NfbWVtX21hbGxvYyhzaXplb2YodE9lbURhdGFSc3ApKTsKKworICAgICAgICAgICAgICAgIGlmKHBNYWMtPm9lbURhdGEucE9lbURhdGFSc3AgPT0gTlVMTCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtZV9SZWxlYXNlR2xvYmFsTG9jaygmcE1hYy0+c21lKTsKKyAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsICJpbiAlcyB2b3NfbWVtX21hbGxvYyBmYWlsZWQgZm9yIHBNYWMtPm9lbURhdGEucE9lbURhdGFSc3AiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCAiQmVmb3JlIG1lbW9yeSBjb3B5Iik7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCh2X1ZPSURfdCopKHBNYWMtPm9lbURhdGEucE9lbURhdGFSc3ApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodl9WT0lEX3QqKSgmcE9lbURhdGFSc3AtPm9lbURhdGFSc3ApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodE9lbURhdGFSc3ApKTsKKyAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgImFmdGVyIG1lbW9yeSBjb3B5Iik7CisgICAgICAgICAgICAgICAgc21lX1JlbGVhc2VHbG9iYWxMb2NrKCZwTWFjLT5zbWUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCAiaW4gJXMgZVdOSV9TTUVfT0VNX0RBVEFfUlNQIFJlY2VpdmVkIGJ1dCBOTyBSRVFzIGFyZSBBQ1RJVkUgLi4uIiwKKyAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgImluICVzIGVXTklfU01FX09FTV9EQVRBX1JTUCBSZWNlaXZlZCBidXQgTk8gY29tbWFuZHMgYXJlIEFDVElWRSAuLi4iLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRV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Vzc2FnZSBsZW5ndGggaXMgdmVyeSBsYXJnZSwgJWQiKSwKKyAgICAgICAgICAgIGxlbik7CisgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICBnb3RvIGVycm9yOworICAgIH0KKyAgICBwTXNnID0gdm9zX21lbV9tYWxsb2MobGVuKTsKKyAgICBpZiAoIE5VTEwgPT0gcE1zZyApCisgICAgeworICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIk1zZyBtZW1vcnkgYWxsb2MgZmFpbGVkIikpOworICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICBnb3RvIGVycm9yOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXMgY2FsbCIsIF9fZnVuY19fKTsKKyAgICAgICAgdm9zX21lbV9zZXQocE1zZywgc2l6ZW9mKHRTaXJSZW1haW5PbkNoblJlcSksIDApOworICAgICAgICBwTXNnLT5tZXNzYWdlVHlwZSA9IGVXTklfU01FX1JFTUFJTl9PTl9DSEFOTkVMX1JFUTsKKyAgICAgICAgcE1zZy0+bGVuZ3RoID0gKHRBTklfVTE2KWxlbjsKKyAgICAgICAgdm9zX21lbV9jb3B5KHBNc2ctPnNlbGZNYWNBZGRyLCBwU2Vzc2lvbi0+c2VsZk1hY0FkZHIsIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICBwTXNnLT5jaG5OdW0gPSBwMnBSZW1haW5vbkNobi0+dS5yZW1haW5DaGxDbWQuY2huOworICAgICAgICBwTXNnLT5waHlNb2RlID0gcDJwUmVtYWlub25DaG4tPnUucmVtYWluQ2hsQ21kLnBoeU1vZGU7CisgICAgICAgIHBNc2ctPmR1cmF0aW9uID0gcDJwUmVtYWlub25DaG4tPnUucmVtYWluQ2hsQ21kLmR1cmF0aW9uOworICAgICAgICBwTXNnLT5zZXNzaW9uSWQgPSBwMnBSZW1haW5vbkNobi0+c2Vzc2lvbklkOworICAgICAgICBwTXNnLT5pc1Byb2JlUmVxdWVzdEFsbG93ZWQgPSBwMnBSZW1haW5vbkNobi0+dS5yZW1haW5DaGxDbWQuaXNQMlBQcm9iZVJlcUFsbG93ZWQ7CisjaWZkZWYgV0xBTl9GRUFUVVJFX1AyUF9JTlRFUk5BTAorICAgICAgICBwTXNnLT5zZXNzaW9uSWQgPSBwU2Vzc2lvbi0+c2Vzc2lvbklkOworICAgICAgICBpZiggcDJwQ29udGV4dC0+cHJvYmVSc3BJZUxlbmd0aCApCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSgodm9pZCAqKXBNc2ctPnByb2JlUnNwSWUsICh2b2lkICopcDJwQ29udGV4dC0+cHJvYmVSc3BJZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBwMnBDb250ZXh0LT5wcm9iZVJzcEllTGVuZ3RoKTsKKyAgICAgICAgfQorI2Vsc2UKKyAgICAgICAgaWYoIHBNYWMtPnAycENvbnRleHQucHJvYmVSc3BJZUxlbmd0aCApCisgICAgICAgICAgIHZvc19tZW1fY29weSgodm9pZCAqKXBNc2ctPnByb2JlUnNwSWUsICh2b2lkICopcE1hYy0+cDJwQ29udGV4dC5wcm9iZVJzcEllLAorICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+cDJwQ29udGV4dC5wcm9iZVJzcEllTGVuZ3RoKTsKKyNlbmRpZgorICAgICAgICBzdGF0dXMgPSBwYWxTZW5kTUJNZXNzYWdlKHBNYWMtPmhIZGQsIHBNc2cpOworICAgIH0KKyBlcnJvcjoKKyAgICBpZiAoZUhBTF9TVEFUVVNfRkFJTFVSRSA9PSBzdGF0dXMpCisgICAgeworICAgICAgICBjc3JSZWxlYXNlUm9jUmVxQ29tbWFuZChwTWFjKTsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30KKworCisvKi0tLS0tLS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NUQVRVU19TVUNDRVNTKTsKKyAgICAgICAgICAgIH0KKyNlbHNlCisgICAgICAgICAgICAvKiBmb3J3YXJkIHRoZSBpbmRpY2F0aW9uIHRvIEhERCAqLworICAgICAgICAgICAgUm9hbUluZm8ucFJlbWFpbkN0eCA9IHBDb21tYW5kLT51LnJlbWFpbkNobENtZC5jYWxsYmFja0N0eDsKKyAgICAgICAgICAgIGNzclJvYW1DYWxsQ2FsbGJhY2socE1hYywgKCh0U2lyU21lUnNwKilwTXNnKS0+c2Vzc2lvbklkLCAmUm9hbUluZm8sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCBlQ1NSX1JPQU1fUkVNQUlOX0NIQU5fUkVBRFksIDApOworI2VuZGlmCisgICAgICAgIH0KKyAgICB9CisgIAorICAgIHJldHVybiBzdGF0dXM7Cit9CisKKworZUhhbFN0YXR1cyBzbWVfc2VuZEFjdGlvbkNuZiggdEhhbEhhbmRsZSBoSGFsLCB0QU5JX1U4KiBwTXNnKQoreworICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9IFBNQUNfU1RSVUNUKCBoSGFsICk7CisgICBlSGFsU3RhdHVzICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgdENzclJvYW1JbmZvIFJvYW1JbmZvOworICAgdFNpclNtZVJzcCogcFNtZVJzcCA9ICh0U2lyU21lUnNwKilwTXNnOworCisjaWZkZWYgV0xBTl9GRUFUVVJFX1AyUF9JTlRFUk5BTAorICAgdFNpclJlc3VsdENvZGVzIHJzcFN0YXR1cyA9IHBTbWVSc3AtPnN0YXR1c0NvZGU7CisgICB0QU5JX1U4IEhERHNlc3Npb25JZCA9IGdldFAyUFNlc3Npb25JZEZyb21TTUVTZXNzaW9uSWQocE1hYywgcFNtZVJzcC0+c2Vzc2lvbklkKTsKKyAgIHRBTklfVTggKnBCdWYgPSBOVUxMOworICAgdHAycENvbnRleHQgKnBQMnBDb250ZXh0OworCisgICBpZihDU1JfU0VTU0lP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Xyk7CisKKyAgICAgIGlmKE5VTEwgPT0gcFAycENvbnRleHQtPnBOZXh0QWN0aW9uRnJtKQorICAgICAgeworICAgICAgICAgc3RhdHVzID0gdm9zX3RpbWVyX3N0YXJ0KCZwUDJwQ29udGV4dC0+cmV0cnlBY3Rpb25GcmFtZVRpbWVyLCBBQ1RJT05fRlJBTUVfUkVUUllfVElNRU9VVCk7CisgICAgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsICIgJXMgZmFpbCB0byBzdGFydCByZXRyeUFjdGlvbkZyYW1lVGltZXJIYW5kbGVyIiwKKyAgICAgICAgICAgICAgIF9fZnVuY19fLCBwUDJwQ29udGV4dC0+TmV4dEFjdGlvbkZyYW1lVHlwZSk7CisgICAgICAgICB9CisgICAgICAgICByZXR1cm4gc3RhdHVzOworICAgICAgfQorICAgICAgLy9JbiBjYXNlIGlmIHRoZXJlIGlzIG5ldyBmcmFtZSB0byBzZW5kLCBmaW5pc2ggdGhlIGN1cnJlbnQgZnJhbWUKKyAgICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCAiICVzIHNlbmQgbmV4dCBhY3Rpb24gZnJhbWUgdHlwZSAlZCBMYXN0IGZyYW1lIHN0YXR1cyAoJWQpIiwKKyAgICAgICAgICAgIF9fZnVuY19fLCByc3BTdGF0dXMpOworICAgICAgICAgLy9Gb3JjZSBpdCB0byBiZSBzdWNjZXNzCisgICAgICAgICByc3BTdGF0dXMgPSBlU0lSX1NNRV9TVUNDRVNTOworICAgICAgfQorICAgfQorCisgICBpZiAocFAycENvbnRleHQtPmFjdGlvbkZyYW1lVGltZXIpCisgICB7CisgICAgICB2b3NfdGltZXJfc3RvcCgmcFAycENvbnRleHQtPmFjdGlvbkZyYW1lVGltZXIpOworICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1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EwgIT0gcEJ1ZikKKyAgICAgIHsKKyAgICAgICAgIHZvc19tZW1fZnJlZShwQnVmKTsKKyAgICAgICAgIHBCdWYgPSBOVUxMOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwgIiVzIHBTZW50QWN0aW9uRnJhbWUgaXMgbnVsbCAiLCBfX2Z1bmNfXyk7CisgICAgICB9CisgICAgICBpZihwUDJwQ29udGV4dC0+cE5leHRBY3Rpb25Gcm0pCisgICAgICB7CisgICAgICAgICAvL25lZWQgdG8gc2VuZCB0aGUgbmV4dCBhY3Rpb24gZnJhbWUKKyAgICAgICAgIHBQMnBDb250ZXh0LT5wU2VudEFjdGlvbkZyYW1lID0gcFAycENvbnRleHQtPnBOZXh0QWN0aW9uRnJtOworICAgICAgICAgcFAycENvbnRleHQtPkFjdGlvbkZyYW1lTGVuID0gcFAycENvbnRleHQtPm5OZXh0RnJtTGVuOworICAgICAgICAgcFAycENvbnRleHQtPmFjdGlvbkZyYW1lVHlwZSA9IHBQMnBDb250ZXh0LT5OZXh0QWN0aW9uRnJhbWVUeXBlOworICAgICAgICAgcFAycENvbnRleHQtPnBOZXh0QWN0aW9uRnJtID0gTlVMTDsKKyAgICAgICAgIHBQMnBDb250ZXh0LT5BY3Rpb25GcmFtZVNlbmRUaW1lb3V0ID0gcFAycENvbnRleHQtPm5OZXh0RnJhbWVUaW1lT3V0OworICAgICAgfQorICAgfQorICAgZWxzZQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlcyBjYW5ub3QgZ2V0IGxvY2sxIiwgX19mdW5jX18pOworICAgfQorCisgICBpZihOVUxMICE9IHBQMnBDb250ZXh0LT5wU2VudEFjdGlvbkZyYW1lKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIiBzZW5kaW5nIG5leHQgZnJhbWUgJWQgdHlwZSIsCisgICAgICAgICAgICAgICAgICBwUDJwQ29udGV4dC0+TmV4dEFjdGlvbkZyYW1lVHlwZSk7CisgICAgICBzdGF0dXMgPSB2b3NfdGltZXJfc3RhcnQoJnBQMnBDb250ZXh0LT5hY3Rpb25GcmFtZVRpbWVyLCBwUDJwQ29udGV4dC0+QWN0aW9uRnJhbWVTZW5kVGltZW91dCk7CisgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgeworICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgJXMgZmFpbCB0byBzdGFydCB0aW1lciBzdGF0dXMgJWQiKSwgX19mdW5jX18sIHN0YXR1cyk7CisgICAgICAgICAvL1dpdGhvdXQgdGhlIHRpbWVyIHdlIGNhbm5vdCBjb250aW51ZQorICAgICAgICAgY3NyUm9hbUNhbGxDYWxsYmFjaygodHBBbmlTaXJHbG9iYWwpcFAycENvbnRleHQtPmhIYWwsIAorICAgICAgICAgICAgICAgICAgICAgcFAycENvbnRleHQtPlNNRXNlc3Npb25JZCwgJlJvYW1JbmZvLCAwLCAKKyAgICAgICAgICAgICAgICAgICAgIGVDU1JfUk9BTV9TRU5EX0FDVElPTl9DTkYsIAorICAgICAgICAgICAgICAgICAgICAgZUNTUl9ST0FNX1JFU1VMVF9TRU5EX0FDVElPTl9GQUlMKTsKKyAgICAgICAgIHZvc19zcGluX2xvY2tfYWNxdWlyZSgmcFAycENvbnRleHQtPmxTdGF0ZSk7CisgICAgICAgICBwQnVmID0gcFAycENvbnRleHQtPnBTZW50QWN0aW9uRnJhbWU7CisgICAgICAgICBwUDJwQ29udGV4dC0+cFNlbnRBY3Rpb25GcmFtZSA9IE5VTEw7CisgICAgICAgICB2b3Nfc3Bpbl9sb2NrX3JlbGVhc2UoJnBQMnBDb250ZXh0LT5s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cmFtZSk7CisgICAgICAgICBwUDJwQ29udGV4dC0+cFNlbnRBY3Rpb25GcmFtZSA9IE5VTEw7CisgICAgICB9CisgICAgICBpZihwUDJwQ29udGV4dC0+cE5leHRBY3Rpb25Gcm0pCisgICAgICB7CisgICAgICAgICB2b3NfbWVtX2ZyZWUocFAycENvbnRleHQtPnBTZW50QWN0aW9uRnJhbWUpOworICAgICAgICAgcFAycENvbnRleHQtPnBTZW50QWN0aW9uRnJhbWUgPSBOVUxMOworICAgICAgfSAgICAgIAorICAgICAgaWYoIHBQMnBDb250ZXh0LT5wcm9iZVJzcEllICkKKyAgICAgIHsKKyAgICAgICAgIHZvc19tZW1fZnJlZShwUDJwQ29udGV4dC0+cHJvYmVSc3BJZSk7CisgICAgICAgICBwUDJwQ29udGV4dC0+cHJvYmVSc3BJZSA9IE5VTEw7CisgICAgICAgICBwUDJwQ29udGV4dC0+cHJvYmVSc3BJZUxlbmd0aCA9IDA7CisgICAgICB9CisKKyAgICAgIGlmKCBwUDJwQ29udGV4dC0+RGlzY292ZXJSZXFJZUZpZWxkICkKKyAgICAgIHsKKyAgICAgICAgIHZvc19tZW1fZnJlZShwUDJwQ29udGV4dC0+RGlzY292ZXJSZXFJZUZpZWxkKTsKKyAgICAgICAgIHBQMnBDb250ZXh0LT5EaXNjb3ZlclJlcUllRmllbGQgPSBOVUxMOworICAgICAgICAgcFAycENvbnRleHQtPkRpc2NvdmVyUmVxSWVMZW5ndGggPSAwOworICAgICAgfQorCisgICAgICBpZiggcFAycENvbnRleHQtPkdvTmVnb0NuZkllRmllbGQgKQorICAgICAgeworICAgICAgICAgdm9zX21lbV9mcmVlKHBQMnBDb250ZXh0LT5Hb05lZ29DbmZJZUZpZWxkKTsKKyAgICAgICAgIHBQMnBDb250ZXh0LT5Hb05lZ29DbmZJZUZpZWxkID0gTlVMTDsKKyAgICAgICAgIHBQMnBDb250ZXh0LT5Hb05lZ29DbmZJZUxlbmd0aCA9IDA7CisgICAgICB9CisKKyAgICAgIGlmKCBwUDJwQ29udGV4dC0+R29OZWdvUmVxSWVGaWVsZCApCisgICAgICB7CisgICAgICAgICB2b3NfbWVtX2ZyZWUocFAycENvbnRleHQtPkdvTmVnb1JlcUllRmllbGQpOworICAgICAgICAgcFAycENvbnRleHQtPkdvTmVnb1JlcUllRmllbGQgPSBOVUxMOworICAgICAgICAgcFAycENvbnRleHQtPkdvTmVnb1JlcUllTGVuZ3RoID0gMDsKKyAgICAgIH0KKworICAgICAgaWYoIHBQMnBDb250ZXh0LT5Hb05lZ29SZXNJZUZpZWxkICkKKyAgICAgIHsKKyAgICAgICAgIHZvc19tZW1fZnJlZShwUDJwQ29udGV4dC0+R29OZWdvUmVzSWVGaWVsZCk7CisgICAgICAgICBwUDJwQ29udGV4dC0+R29OZWdvUmVzSWVGaWVsZCA9IE5VTEw7CisgICAgICAgICBwUDJwQ29udGV4dC0+R29OZWdvUmVzSWVMZW5ndGggPSAwOworICAgICAgfQorCisgICAgICBpZiggcFAycENvbnRleHQtPlByb3ZEaXNjUmVxSWVGaWVsZCApCisgICAgICB7CisgICAgICAgICB2b3NfbWVtX2ZyZWUocFAycENvbnRleHQtPlByb3ZEaXNjUmVxSWVGaWVsZCk7CisgICAgICAgICBwUDJwQ29udGV4dC0+UHJvdkRpc2NSZXFJZUZpZWxkID0gTlVMTDsKKyAgICAgICAgIHBQMnBDb250ZXh0LT5Qcm92RGlzY1JlcUllTGVuZ3RoID0gMDsKKyAgICAgIH0KKworICAgICAgaWYoIHBQMnBDb250ZXh0LT5Qcm92RGlzY1Jlc0llRmllbGQgKQorICAgICAgeworICAgICAgICAgdm9zX21lbV9mcmVlKHBQMnBDb250ZXh0LT5Qcm92RGlzY1Jlc0llRmllbGQpOworICAgICAgICAgcFAycENvbnRleHQtPlByb3ZEaXNjUmVzSWVMZW5ndGggPSAwOworICAgICAgICAgcFAycENvbnRleHQtPlByb3ZEaXNjUmVzSWVGaWVsZCA9IE5VTEw7CisgICAgICB9CisKKyAgICAgIGlmIChwUDJwQ29udGV4dC0+YWN0aW9uRnJhbWVUaW1lcikKKyAgICAgIHsKKyAgICAgICAgIHZvc190aW1lcl9zdG9wKCZwUDJwQ29udGV4dC0+YWN0aW9uRnJhbWVUaW1lcik7CisgICAgICB9CisKKyAgICAgIGlmIChwUDJwQ29udGV4dC0+ZGlzY292ZXJUaW1lcikKKyAgICAgIHsKKyAgICAgICAgIHZvc190aW1lcl9zdG9wKCZwUDJwQ29udGV4dC0+ZGlzY292ZXJUaW1lcik7CisgICAgICB9CisKKyAgICAgIGlmIChwUDJwQ29udGV4dC0+bGlzdGVuVGltZXJIYW5kbGVyKQorICAgICAgeworICAgICAgICAgdm9zX3RpbWVyX3N0b3AoJnBQMnBDb250ZXh0LT5saXN0ZW5UaW1lckhhbmRsZXIpOworICAgICAgfQorCisgICAgICBpZiAocFAycENvbnRleHQtPldQU1JlZ2lzdHJhckNoZWNrVGltZXJIYW5kbGVyKQorICAgICAgeworICAgICAgICAgdm9zX3RpbWVyX3N0b3AoJnBQMnBDb250ZXh0LT5XUFNSZWdpc3RyYXJDaGVja1RpbWVySGFuZGxlcik7CisgICAgICB9CisKKyAgICAgIGlmIChwUDJwQ29udGV4dC0+ZGlyZWN0ZWREaXNjb3ZlcnlGaWx0ZXIpCisgICAgICB7CisgICAgICAgICBwUDJwQ29udGV4dC0+dU51bURldmljZUZpbHRlckFsbG9jYXRlZCA9IDA7CisgICAgICAgICB2b3NfbWVtX2ZyZWUocFAycENvbnRleHQtPmRpcmVjdGVkRGlzY292ZXJ5RmlsdGVyKTsKKyAgICAgICAgIHBQMnBDb250ZXh0LT5kaXJlY3RlZERpc2NvdmVyeUZpbHRlciA9IE5VTEw7CisgICAgICB9CisKKyAgICAgIHZvc19tZW1femVybyhwUDJwQ29udGV4dC0+cGVlck1hY0FkZHJlc3MsIFAyUF9NQUNfQUREUkVTU19MRU4pOworICAgfQorfQorI2VuZGlmICAgIAorCisKK2VIYWxTdGF0dXMgc21lX3AycE9wZW4oIHRIYWxI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gIHN0YXR1cyA9IHZvc190aW1lcl9pbml0KCZwUDJwQ29udGV4dC0+bGlzdGVuVGltZXJIYW5kbGVyLCBWT1NfVElNRVJfVFlQRV9TVywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwMnBMaXN0ZW5EaXNjb3ZlclRpbWVySGFuZGxlciwgcFAycENvbnRleHQpOworICAgICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgIHsKKyAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCAiICVzIGZhaWwgdG8gYWxsb2MgbGlzdGVuIHRpbWVyIGZvciBzZXNzaW9uICVkIiwgX19mdW5jX18sIGkpOworICAgICAgICAgYnJlYWs7CisgICAgICB9IAorICAgICAgc3RhdHVzID0gdm9zX3RpbWVyX2luaXQoJnBQMnBDb250ZXh0LT5kaXNjb3ZlclRpbWVyLCBWT1NfVElNRVJfVFlQRV9TVywgcDJwRGlzY292ZXJUaW1lckhhbmRsZXIsIHBQMnBDb250ZXh0KTsKKyAgICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICB7CisgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgIiAlcyBmYWlsIHRvIGFsbG9jIGRpc2NvdmVyIHRpbWVyIGZvciBzZXNzaW9uICVkIiwgX19mdW5jX18sIGkpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisKKyAgICAgIHN0YXR1cyA9IHZvc190aW1lcl9pbml0KCZwUDJwQ29udGV4dC0+cmV0cnlBY3Rpb25GcmFtZVRpbWVyLCBWT1NfVElNRVJfVFlQRV9TVywKKyAgICAgICAgICAgICAgICAgICAgIHAycFJldHJ5QWN0aW9uRnJhbWVUaW1lckhhbmRsZXIsIHBQMnBDb250ZXh0KTsKKyAgICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICB7CisgICAgICAgICBzbXNM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gIAorICAgcE1hYy0+cDJwQ29udGV4dC5wcm9iZVJzcEllTGVuZ3RoID0gMDsKKyNlbmRpZgorCisgICByZXR1cm4gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKK30KKworCitlSGFsU3RhdHVzIHNtZV9wMnBDbG9zZSggdEhhbEhhbmRsZSBoSGFsICkKK3sKKyAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVChoSGFsKTsKKworI2lmZGVmIFdMQU5fRkVBVFVSRV9QMlBfSU5URVJOQUwKKyAgIHRwMnBDb250ZXh0ICpwQ29udGV4dDsKKyAgIGludCBpOworCisgICBwMnBTdG9wKGhIYWwpOworCisgICBmb3IgKCBpID0gMDsgaSA8IE1BWF9OT19PRl9QMlBfU0VTU0lPTlM7IGkrKyApIAorICAgeworICAgICAgcDJwQ2xvc2VTZXNzaW9uKHBNYWMsIGkpOworICAgICAgcENvbnRleHQgPSAmcE1hYy0+cDJwQ29udGV4dFtpXTsKKyAgICAgIGlmIChwQ29udGV4dC0+YWN0aW9uRnJhbWVUaW1lcikKKyAgICAgIHsKKyAgICAgICAgIHZvc190aW1lcl9kZXN0cm95KCZwQ29udGV4dC0+YWN0aW9uRnJhbWVUaW1lcik7CisgICAgICAgICBwQ29udGV4dC0+YWN0aW9uRnJhbWVUaW1lciA9IE5VTEw7CisgICAgICB9CisKKyAgICAgIGlmIChwQ29udGV4dC0+ZGlzY292ZXJUaW1lcikKKyAgICAgIHsKKyAgICAgICAgIHZvc190aW1lcl9kZXN0cm95KCZwQ29udGV4dC0+ZGlzY292ZXJUaW1lcik7CisgICAgICAgICBwQ29udGV4dC0+ZGlzY292ZXJUaW1lciA9IE5VTEw7CisgICAgICB9CisKKyAgICAgIGlmIChwQ29udGV4dC0+bGlzdGVuVGltZXJIYW5kbGVyKQorICAgICAgeworICAgICAgICAgdm9zX3RpbWVyX2Rlc3Ryb3koJnBDb250ZXh0LT5saXN0ZW5UaW1lckhhbmRsZXIpOworICAgICAgICAgcENvbnRleHQtPmxpc3RlblRpbWVySGFuZGxlciA9IE5VTEw7CisgICAgICB9CisKKyAgICAgIGlmIChwQ29udGV4dC0+V1BTUmVnaXN0cmFyQ2hlY2tUaW1lckhhbmRsZXIpCisgICAgICB7CisgICAgICAgICB2b3NfdGltZXJfZGVzdHJveSgmcENvbnRleHQtPldQU1JlZ2lzdHJhckNoZWNrVGltZXJIYW5kbGVyKTsKKyAgICAgICAgIHBDb250ZXh0LT5XUFNSZWdpc3RyYXJDaGVja1RpbWVySGFuZGxlciA9IE5VTEw7CisgICAgICB9CisKKyAgICAgIHZvc19zcGluX2xvY2tfZGVzdHJveSgmcENvbnRleHQtPmxTdGF0ZSk7CisgICB9CisjZWxzZSAgCisgICAgaWYoIHBNYWMtPnAycENvbnRleHQucHJvYmVSc3BJZSApCisgICAgeworICAgICAgICB2b3NfbWVtX2ZyZWUocE1hYy0+cDJwQ29udGV4dC5wcm9iZVJzcEllKTsKKyAgICAgICAgcE1hYy0+cDJwQ29udGV4dC5wcm9iZVJzcEllID0gTlVMTDsKKyAgICB9CisgIAorICAgIHBNYWMtPnAycENvbnRleHQucHJvYmVSc3BJZUxlbmd0aCA9IDA7CisjZW5kaWYKKworICAgcmV0dXJuIGVIQUxfU1RBVFVTX1NVQ0NFU1M7Cit9CisKKwordFNpclJGQmFuZCBHZXRSRkJhbmQodEFOSV9VOCBjaGFubmVsKQoreworICAgIGlmICgoY2hhbm5lbCA+PSBTSVJfMTFBX0NIQU5ORUxfQkVHSU4pICYmCisgICAgICAgIChjaGFubmVsIDw9IFNJUl8xMUFfQ0hBTk5FTF9FTkQpKQorICAgICAgICByZXR1cm4gU0lSX0JBTkRfNV9HSFo7CisKKyAgICBpZiAoKGNoYW5uZWwgPj0gU0lSXzExQl9DSEFOTkVMX0JFR0lOKSAmJgorICAgICAgICAoY2hhbm5lbCA8PSBTSVJfMTFCX0NIQU5ORUxfRU5EKSkKKyAgICAgICAgcmV0dXJuIFNJUl9CQU5EXzJfNF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LT5QMlBMaXN0ZW5DaGFubmVsOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgcE1hYy0+cDJwQ29udGV4dFtpXS5QMlBMaXN0ZW5DaGFubmVsID0gUDJQX09QRVJBVElOR19DSEFOTkVMOworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAKKyAgICAgICAgICAgICAgICJJbnZhbGlkIFAyUCBMaXN0ZW4gQ2hhbm5lbCBpbiBjb25maWcuIFN3aXRjaCB0byBkZWZhdWx0IExpc3RlbiBDaGFubmVsICVkIiwKKyAgICAgICAgICAgICAgIF9fZnVuY19fLCBQMlBfT1BFUkFUSU5HX0NIQU5ORUwpOworICAgICAgICAgfQorICAgICAgICAgCisgICAgICAgICBpZihjc3JSb2FtSXNDaGFubmVsVmFsaWQocE1hYywgcFBhcmFtLT5QMlBPcGVyYXRpbmdDaGFubmVsKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHBNYWMtPnAycENvbnRleHRbaV0uUDJQT3BlcmF0aW5nQ2hhbm5lbCA9IHBQYXJhbS0+UDJQT3BlcmF0aW5nQ2hhbm5lbDsKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHBNYWMtPnAycENvbnRleHRbaV0uUDJQT3BlcmF0aW5nQ2hhbm5lbCA9IFAyUF9PUEVSQVRJTkdfQ0hBTk5FTDsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICJJbnZhbGlkIFAyUCBPcGVyYXRpbmcgQ2hhbm5lbCBpbiBjb25maWcuIFN3aXRjaCB0byBkZWZhdWx0IENoYW5uZWwgJWQiLAorICAgICAgICAgICAgICAgX19mdW5jX18sIFAyUF9PUEVSQ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AgICAgICBwTmV4dEJ1ZiA9IHAycENvbnRleHQtPnBOZXh0QWN0aW9uRnJtOworICAgICAgICAgcDJwQ29udGV4dC0+cE5leHRBY3Rpb25Gcm0gPSBOVUxMOworICAgICAgfQorICAgICAgdm9zX3NwaW5fbG9ja19yZWxlYXNlKCZwMnBDb250ZXh0LT5sU3RhdGUpOworCisgICAgICBpZihwQnVmKQorICAgICAgeworICAgICAgICAgdm9zX21lbV9mcmVlKHBCdWYpOworICAgICAgfQorICAgICAgaWYocE5leHRCdWYpCisgICAgICB7CisgICAgICAgICAvL0luZm9ybSB0aGUgZmFpbHVyZSBvZiB0aGUgbmV4dCBmcmFtZS4KKyAgICAgICAgIHAycENvbnRleHQtPnBTZW50QWN0aW9uRnJhbWUgPSBwTmV4dEJ1ZjsKKyAgICAgICAgIHAycENvbnRleHQtPkFjdGlvbkZyYW1lTGVuID0gcDJwQ29udGV4dC0+bk5leHRGcm1MZW47CisgICAgICAgICBwMnBDb250ZXh0LT5hY3Rpb25GcmFtZVR5cGUgPSBwMnBDb250ZXh0LT5OZXh0QWN0aW9uRnJhbWVUeXBlOworICAgICAgICAgdm9zX21lbV96ZXJvKCZyb2FtSW5mbywgc2l6ZW9mKHRDc3JSb2FtSW5mbykpOworICAgICAgICAgY3NyUm9hbUNhbGxDYWxsYmFjaygodHBBbmlTaXJHbG9iYWwpcDJwQ29udGV4dC0+aEhhbCwgcDJwQ29udGV4dC0+U01Fc2Vzc2lvbklkLCAmcm9hbUluZm8sIDAsIAorICAgICAgICAgICAgICAgICAgICAgICAgICBlQ1NSX1JPQU1fU0VORF9BQ1RJT05fQ05GLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9ST0FNX1JFU1VMVF9TRU5EX0FDVElPTl9GQUlMKTsKKyAgICAgICAgIHAycENvbnRleHQtPnBTZW50QWN0aW9uRnJhbWUgPSBOVUxMOworICAgICAgICAgdm9zX21lbV9mcmVlKHBOZXh0QnVmKTsKKyAgICAgIH0KKyAg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Y2FuUmVzdWx0KQorICAgICAgICAgeworCisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPX01FRCwgIiVzIGZvdW5kIG1hdGNoIG9uIGNoYW5uZWwgJWQiLCAKKyAgICAgICAgICAgICAgIF9fZnVuY19fLCBwU2NhblJlc3VsdC0+QnNzRGVzY3JpcHRvci5jaGFubmVsSWQpOworICAgICAgICAgICAgcFAycENvbnRleHQtPmZvcm1hdGlvblJlcS50YXJnZXRMaXN0ZW5DaGFubmVsID0gcFNjYW5SZXN1bHQtPkJzc0Rlc2NyaXB0b3IuY2hhbm5lbElkOworICAgICAgICAgICAgaWYocFAycENvbnRleHQtPlAyUExpc3RlbkNoYW5uZWwgIT0gcFNjYW5SZXN1bHQtPkJzc0Rlc2NyaXB0b3IuY2hhbm5lbElkKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19NRUQsIAorICAgICAgICAgICAgICAgICAgIiVzIGFkYXB0IGxpc3RlbiBjaGFubmVsIHRvICVkIiwgCisgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcFNjYW5SZXN1bHQtPkJzc0Rlc2NyaXB0b3IuY2hhbm5lbElkKTsKKyAgICAgICAgICAgICAgIHAycFNldExpc3RlbkNoYW5uZWwocE1hYywgcFAycENvbnRleHQtPnNlc3Npb25JZCwgcFNjYW5SZXN1bHQtPkJzc0Rlc2NyaXB0b3IuY2hhbm5lbElkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHZvc19tZW1fY29weShwUDJwQ29udGV4dC0+Zm9ybWF0aW9uUmVxLmRldmljZUFkZHJlc3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgcFNjYW5SZXN1bHQtPkJzc0Rlc2NyaXB0b3IuYnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgUDJQX01BQ19BRERSRVNTX0xFTik7CisgICAgICAgICB9CisgICAgICAgICBjc3JTY2FuUmVzdWx0UHVyZ2UocE1hYywgaFNjYW5SZXN1bHQpOworICAgICAgfSAKKyAgICAgIGVsc2UgCisgICAgICB7CisgICAgICAgICB2b3NfbWVtX3plcm8oJmZpbHRlciwgc2l6ZW9mKGZpbHRlcikpOworICAgICAgICAgZmlsdGVyLmJXUFNBc3NvY2lhdGlvbiA9IFRSVUU7CisgICAgICAgICBmaWx0ZXIuQlNTVHlwZSA9IGVDU1JfQlNTX1RZUEVfQU5ZOworICAgICAgICAgZmlsdGVyLlNTSURzLlNTSURMaXN0ID0oIHRDc3JTU0lESW5mbyAqKXZvc19tZW1fbWFsbG9jKHNpemVvZih0Q3NyU1NJREluZm8pKTsKKyAgICAgICAgIGlmICggTlVMTCA9PSBmaWx0ZXIuU1NJRHMuU1NJRExpc3QgKQorICAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dQLCBGTCgibWVtb3J5IGFsbG9jYXRpb24gZmFpbGVkIGZvciBTU0lETGlzdCIpICk7CisgICAgICAgICAgICBwUDJwQ29udGV4dC0+R3JvdXBGb3JtYXRpb25QZW5kaW5nID0gRkFMU0U7CisgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgIH0KKyAgICAgICAgIHZvc19tZW1femVybyggZmlsdGVyLlNTSURzLlNTSURMaXN0LCBzaXplb2YodENzclNTSURJbmZvKSApOworICAgICAgICAgcDJwR2V0U1NJRChzc0lkLCAmc3NJZExlbiwgSEREU2Vzc2lvbklEKTsKKworICAgICAgICAgaWYgKHNzSWRMZW4pCisgICAgICAgICB7CisgICAgICAgICAgICBmaWx0ZXIuU1NJRHMuU1NJRExpc3QtPlNTSUQubGVuZ3RoID0gc3NJZExlbjsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSgmZmlsdGVyLlNTSURzLlNTSURMaXN0WzBdLlNTSUQuc3NJZCwgJnNzSWQsIHNzSWRMZW4pOworICAgICAgICAgICAgZmlsdGVyLlNTSURzLm51bU9mU1NJRHMgPSAxOworICAgICAgICAgICAgc3RhdHVzID0gY3NyU2NhbkdldFJlc3VsdChwTWFjLCAmZmlsdGVyLCAmaFNjYW5SZXN1bHQpOworICAgICAgICAgICAgaWYgKGhTY2FuUmVzdWx0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgcFNjYW5SZXN1bHQgPSBjc3JTY2FuUmVzdWx0R2V0Rmlyc3QocE1hYywgaFNjYW5SZXN1bHQgKTsKKyAgICAgICAgICAgICAgIHBQMnBDb250ZXh0LT5mb3JtYXRpb25SZXEudGFyZ2V0TGlzdGVuQ2hhbm5lbCA9IHBTY2FuUmVzdWx0LT5Cc3NEZXNjcmlwdG9yLmNoYW5uZWxJZDsKKyAgICAgICAgICAgICAgIHZvc19tZW1fY29weShwUDJwQ29udGV4dC0+Zm9ybWF0aW9uUmVxLmRldmljZUFkZHJlc3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjYW5SZXN1bHQtPkJzc0Rlc2NyaXB0b3IuYnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUDJQX01BQ19BRERSRVNTX0xFTik7CisgICAgICAgICAgICAgICBjc3JTY2FuUmVzdWx0UHVyZ2UocE1hYywgaFNjYW5SZXN1bHQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIiVzIG5vdCBmb3VuZCBtYXRjaCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgIHBQMnBDb250ZXh0LT5mb3JtYXRpb25SZXEudGFyZ2V0TGlzdGVuQ2hhbm5lbCA9IDA7CisgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkocFAycENvbnRleHQtPmZvcm1hdGlvblJlcS5kZXZpY2VBZGRyZXNzLCBwUDJwQ29udGV4dC0+cGVlck1hY0FkZHJlc3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUDJQX01BQ19BRERSRVNTX0xFTik7CisgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdm9zX21lbV9mcmVlKGZpbHRlci5TU0lEcy5TU0lETGlzdCk7CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXMgbm90IGZvdW5kIG1hdGNoIiwgX19mdW5jX18pOworICAgICAgICAgICAgcFAycENvbnRleHQtPmZvcm1hdGlvblJlcS50YXJnZXRMaXN0ZW5DaGFubmVsID0gMDsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwUDJwQ29udGV4dC0+Zm9ybWF0aW9uUmVxLmRldmljZUFkZHJlc3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgcFAycENvbnRleHQtPnBlZXJNYWNBZGRyZXNzLCBQMlBfTUFDX0FERFJFU1NfTEVOKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICB9ICAgIAorICAgICAgfQorICAgICAgc21lX0NhbmNlbFJlbWFpbk9uQ2hhbm5lbChwTWFjLCBwUDJwQ29udGV4dC0+U01Fc2Vzc2lvbklkICk7CisgICAgICBwMnBGc20ocFAycENvbnRleHQsIGVQMlBfVFJJR0dFUl9HUk9VUF9GT1JNQVRJT04pOyAgICAgCisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiICVzIHNlbmQgYWN0aW9uIGZyYW1lICVkIHRpbWVvdXQgJWQiLAorICAgICAgICAg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RDc3JSb2FtSW5mbyBSb2FtSW5mbzsKKworICAgICAgICAgdm9zX21lbV96ZXJvKCZSb2FtSW5mbywgc2l6ZW9mKHRDc3JSb2FtSW5mbykpOworICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgJXMgZmFpbCB0byBzdGFydCB0aW1lciBzdGF0dXMgJWQiKSwgX19mdW5jX18sIHN0YXR1cyk7CisgICAgICAgICAvL1dpdGhvdXQgdGhlIHRpbWVyIHdlIGNhbm5vdCBjb250aW51ZQorICAgICAgICAgY3NyUm9hbUNhbGxDYWxsYmFjaygodHBBbmlTaXJHbG9iYWwpcFAycENvbnRleHQtPmhIYWwsIAorICAgICAgICAgICAgICAgICAgICAgcFAycENvbnRleHQtPlNNRXNlc3Npb25JZCwgJlJvYW1JbmZvLCAwLCAKKyAgICAgICAgICAgICAgICAgICAgIGVDU1JfUk9BTV9TRU5EX0FDVElPTl9DTkYsIAorICAgICAgICAgICAgICAgICAgICAgZUNTUl9ST0FNX1JFU1VMVF9TRU5EX0FDVElPTl9GQUlMKTsKKyAgICAgICAgIHZvc19zcGluX2xvY2tfYWNxdWlyZSgmcFAycENvbnRleHQtPmxTdGF0ZSk7CisgICAgICAgICBwQnVmID0gcFAycENvbnRleHQtPnBTZW50QWN0aW9uRnJhbWU7CisgICAgICAgICBwUDJwQ29udGV4dC0+cFNlbnRBY3Rpb25GcmFtZSA9IE5VTEw7CisgICAgICAgICB2b3Nfc3Bpbl9sb2NrX3JlbGVhc2UoJnBQMnBDb250ZXh0LT5sU3RhdGUpOworICAgICAgICAgdm9zX21lbV9mcmVlKHBCdWYpOworICAgICAgICAgcEJ1ZiA9IE5VTEw7CisgICAgICAgICBwMnBGc20ocFAycENvbnRleHQsIGVQMlBfVFJJR0dFUl9ESVNDT05ORUNURUQpOworICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgIH0KKyAgICAgIC8vV2UgY2FuIHNlbmQgdGhpcyBmcmFtZSBub3cKKyAgICAgIHN0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RdLnN0YXRlID09IGVQMlBfU1RBVEVfRElTQ09OTkVDVEVEKQorICAgICAgeworICAgICAgICAgc21lX0NhbmNlbFJlbWFpbk9uQ2hhbm5lbChoSGFsLCBzZXNzaW9uSWQgKTsKKworICAgICAgICAgaWYgKHBNYWMtPnAycENvbnRleHRbc2Vzc2lvbklkXS5saXN0ZW5UaW1lckhhbmRsZXIpCisgICAgICAgICB7CisgICAgICAgICAgICB2b3NfdGltZXJfc3RvcCgmcE1hYy0+cDJwQ29udGV4dFtzZXNzaW9uSWRdLmxpc3RlblRpbWVySGFuZGxlcik7CisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIiVzIFRpbWVyIFN0b3Agc3RhdHVzICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBzdGF0dXMpOworICAgICAgICAgfQorICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19NRUQsICIlcyBQMlBfTk9UX0RJU0NPVkVSQUJMRSBub3QgaW4gcmlnaHQgc3RhdGUgKCVkKSIsCisgICAgICAgICAgICBfX2Z1bmNfXywgcE1hYy0+cDJwQ29udGV4dFtzZXNzaW9uSWRdLnN0YXRlKTsKKyAgICAgIH0KKyAgICAgIGJyZWFrOworCisgICBjYXNlIFAyUF9ERVZJQ0VfQVVUT19BVkFJTEFCSUxJVFk6CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiJXMgUDJQX0FVVE9fQVZBSUxBQklMSVRZIixfX2Z1bmNfXyk7CisgICAgICBwTWFjLT5wMnBDb250ZXh0W3Nlc3Npb25JZF0ubG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VyeUZpbHRlci0+dWNCaXRtYXNrICYgRElTQ09WRVJZX0ZJTFRFUl9CSVRNQVNLX0RFVklDRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHBGaWx0ZXItPkJTU0lEcy5udW1PZkJTU0lEcysrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBpZiAoKGRpcmVjdGVkRGlzY292ZXJ5RmlsdGVyLT51Y0JpdG1hc2sgIT0gUUNXTEFOX1AyUF9ESVNDT1ZFUl9BTlkpIAorICAgICAgICAgICAgICAgJiYgKGRpcmVjdGVkRGlzY292ZXJ5RmlsdGVyLT51Y0JpdG1hc2sgJiBESVNDT1ZFUllfRklMVEVSX0JJVE1BU0tfR08pKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLy9NYXRjaGluZyBEZXZpY2UgSUQgYW5kIEdyb3VwU1NJRAorICAgICAgICAgICAgICAgcEZpbHRlci0+QlNTSURzLm51bU9mQlNTSURzKys7CisgICAgICAgICAgICAgICBpZihkaXJlY3RlZERpc2NvdmVyeUZpbHRlci0+R3JvdXBTU0lELmxlbmd0aCkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHBGaWx0ZXItPlNTSURzLm51bU9mU1NJRHMrKzsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGRpcmVjdGVkRGlzY292ZXJ5RmlsdGVyICs9IHNpemVvZih0cDJwRGlzY292ZXJEZXZpY2VGaWx0ZXIpOworICAgICAgICAgfQorCisgICAgICAgICBkaXJlY3RlZERpc2NvdmVyeUZpbHRlciA9IHBQMnBDb250ZXh0LT5kaXJlY3RlZERpc2NvdmVyeUZpbHRlcjsKKyAgICAgICAgIGlmIChwRmlsdGVyLT5CU1NJRHMubnVtT2ZCU1NJRHMpCisgICAgICAgICB7CisgICAgICAgICAgICBic3NpZCA9ICggdENzckJzc2lkICopIHZvc19tZW1fbWFsbG9jKAorICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoIHRDc3JCc3NpZCApICogcEZpbHRlci0+QlNTSURzLm51bU9mQlNTSURzICk7CisgICAgICAgICAgICBpZiAoTlVMTCA9PSBic3NpZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICIgJXMgZmFpbCB0byBhbGxvY2F0ZSBic3NpZCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1JFU09VUkNFUzsKKyAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBwRmlsdGVyLT5CU1NJRHMuYnNzaWQgPSBic3NpZDsKKworICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHVOdW1EZXZpY2VGaWx0ZXJzOyBpKyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoYnNzaWQsIGRpcmVjdGVkRGlzY292ZXJ5RmlsdGVyLT5EZXZpY2VJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBQMlBfTUFDX0FERFJFU1NfTEVOKTsKKyAgICAgICAgICAgICAgIGJzc2lkICs9IHNpemVvZih0Q3NyQnNzaWQpOworICAgICAgICAgICAgICAgZGlyZWN0ZWREaXNjb3ZlcnlGaWx0ZXIgKz0gc2l6ZW9mKHRwMnBEaXNjb3ZlckRldmljZUZpbHRlcik7CisgICAgICAgICAgICB9CisgICAgICAgICB9CisKKyAgICAgICAgIGRpcmVjdGVkRGlzY292ZXJ5RmlsdGVyID0gcFAycENvbnRleHQtPmRpcmVjdGVkRGlzY292ZXJ5RmlsdGVyOworICAgICAgICAgaWYgKHBGaWx0ZXItPlNTSURzLm51bU9mU1NJRHMpCisgICAgICAgICB7CisgICAgICAgICAgICBwRmlsdGVyLT5TU0lEcy5TU0lETGlzdCA9ICh0Q3NyU1NJREluZm8gKil2b3NfbWVtX21hbGxvYygKKyAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCAqcEZpbHRlci0+U1NJRHMuU1NJRExpc3QgKSAqIHBGaWx0ZXItPlNTSURzLm51bU9mU1NJRHMgKTsKKyAgICAgICAgICAgIGlmIChOVUxMID09IHBGaWx0ZXItPlNTSURzLlNTSURMaXN0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgIiAlcyBmYWlsIHRvIGFsbG9jYXRlIGJzc2lkIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfUkVTT1VSQ0VTOworICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICggcEZpbHRlci0+U1NJRHMuU1NJRExpc3QgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgZm9yICggaSA9IDA7IGkgPCB1TnVtRGV2aWNlRmlsdGVyczsgaSsrICkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChkaXJlY3RlZERpc2NvdmVyeUZpbHRlci0+dWNCaXRtYXNrID09IERJU0NPVkVSWV9GSUxURVJfQklUTUFTS19HTykKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgIGlmKGRpcmVjdGVkRGlzY292ZXJ5RmlsdGVyLT5Hcm91cFNTSUQubGVuZ3RoKQorICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcEZpbHRlci0+U1NJRHMuU1NJRExpc3RbaV0uU1NJRC5sZW5ndGggPSBkaXJlY3RlZERpc2NvdmVyeUZpbHRlci0+R3JvdXBTU0lELmxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSggcEZpbHRlci0+U1NJRHMuU1NJRExpc3RbaV0uU1NJRC5zc0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlyZWN0ZWREaXNjb3ZlcnlGaWx0ZXItPkdyb3VwU1NJRC5zc0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlyZWN0ZWREaXNjb3ZlcnlGaWx0ZXItPkdyb3VwU1NJRC5sZW5ndGggKTsKKyAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGRpcmVjdGVkRGlzY292ZXJ5RmlsdGVyICs9IHNpemVvZih0cDJwRGlzY292ZXJEZXZpY2VGaWx0ZXIpOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICAgfQorCisgICAgICBwRmlsdGVyLT5wMnBSZXN1bHQgPSBUUlVFOworICAgICAgcEZpbHRlci0+YldQU0Fzc29jaWF0aW9uID0gVFJVRTsKKyAgICAgIHBGaWx0ZXItPkJTU1R5cGUgPSBlQ1NSX0JTU19UWVBFX0FOWTsKKyAgIH0gd2hpbGUoMCk7CisKKyAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgIHsKKyAgICAgIGlmKHBGaWx0ZXItPlNTSURzLlNTSURMaXN0KQorICAgICAgeworICAgICAgICAgdm9zX21lbV9mcmVlKHBGaWx0ZXItPlNTSURzLlNTSURMaXN0KTsKKyAgICAgICAgIHBGaWx0ZXItPlNTSURzLlNTSURMaXN0ID0gTlVMTDsKKyAgICAgIH0KKyAgICAgIGlmKCBwRmlsdGVyLT5CU1NJRHMuYnNzaWQgKQorICAgICAgeworICAgICAgICAgdm9zX21lbV9mcmVlKHBGaWx0ZXItPkJTU0lEcy5ic3NpZCk7CisgICAgICAgICBwRmlsdGVyLT5CU1NJRHMuYnNzaWQg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WUocFAycENvbnRleHQtPkRpc2NvdmVyUmVxSWVGaWVsZCk7CisgICAgICBwUDJwQ29udGV4dC0+RGlzY292ZXJSZXFJZUxlbmd0aCA9IDA7CisgICAgICBwUDJwQ29udGV4dC0+RGlzY292ZXJSZXFJZUZpZWxkID0gTlVMTDsKKyAgIH0KKworICAgaWYgKHBEaXNjb3ZlclJlcXVlc3QtPnVJRUxlbikKKyAgIHsKKyAgICAgIHBQMnBDb250ZXh0LT5EaXNjb3ZlclJlcUllRmllbGQgPSAodEFOSV9VOCAqKXZvc19tZW1fbWFsbG9jKHBEaXNjb3ZlclJlcXVlc3QtPnVJRUxlbik7CisgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKilwUDJwQ29udGV4dC0+RGlzY292ZXJSZXFJZUZpZWxkLAorICAgICAgICAgICAgICAgICAgIHBEaXNjb3ZlclJlcXVlc3QtPnBJRUZpZWxkLCBwRGlzY292ZXJSZXF1ZXN0LT51SUVMZW4pOworICAgICAgcFAycENvbnRleHQtPkRpc2NvdmVyUmVxSWVMZW5ndGggPSBwRGlzY292ZXJSZXF1ZXN0LT51SUVMZW47CisgICB9IAorICAgZWxzZQorICAgeworICAgICAgcFAycENvbnRleHQtPkRpc2NvdmVyUmVxSWVMZW5ndGggPSAwOworICAgfQorCisgICB2b3NfbWVtX3plcm8oJmZpbHRlciwgc2l6ZW9mKGZpbHRlcikpOworCisgICBkbworICAgeworICAgICAgaWYgKHBEaXNjb3ZlclJlcXVlc3QtPnVOdW1EZXZpY2VGaWx0ZXJzKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIiVzIGRpcmVjdGVkIiwgX19mdW5jX18pOworICAgICAgICAgZkRpcmVjdCA9IFRSVUU7CisgICAgICAgICB1TnVtRGV2aWNlRmlsdGVycyA9IHBEaXNjb3ZlclJlcXVlc3QtPnVOdW1EZXZpY2VGaWx0ZXJzOworCisgICAgICAgICBwUDJwQ29udGV4dC0+dURpc2NvdmVyVGltZW91dCA9IHBQMnBDb250ZXh0LT51RGlzY292ZXJUaW1lb3V0OworICAgICAgICAgcFAycENvbnRleHQtPnVOdW1EZXZpY2VGaWx0ZXJzID0gcERpc2NvdmVyUmVxdWVzdC0+dU51bURldmljZUZpbHRlcnM7CisgICAgICAgICBpZihwUDJwQ29udGV4dC0+dU51bURldmljZUZpbHRlckFsbG9jYXRlZCA8IHBEaXNjb3ZlclJlcXVlc3QtPnVOdW1EZXZpY2VGaWx0ZXJzKQorICAgICAgICAgeworICAgICAgICAgICAgaWYocFAycENvbnRleHQtPmRpcmVjdGVkRGlzY292ZXJ5RmlsdGVyKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgcFAycENvbnRleHQtPnVOdW1EZXZpY2VGaWx0ZXJBbGxvY2F0ZWQgPSAwOworICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBQMnBDb250ZXh0LT5kaXJlY3RlZERpc2NvdmVyeUZpbHRlcik7CisgICAgICAgICAgICAgICBwUDJwQ29udGV4dC0+ZGlyZWN0ZWREaXNjb3ZlcnlGaWx0ZXIgPSBOVUxMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcFAycENvbnRleHQtPmRpcmVjdGVkRGlzY292ZXJ5RmlsdGVyID0gKHRwMnBEaXNjb3ZlckRldmljZUZpbHRlciAqKQorICAgICAgICAgICAgICAgICAgdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRwMnBEaXNjb3ZlckRldmljZUZpbHRlcikgKiB1TnVtRGV2aWNlRmlsdGVycyk7CisgICAgICAgICAgICBpZiAoTlVMTCA9PSBwUDJwQ29udGV4dC0+ZGlyZWN0ZWREaXNjb3ZlcnlGaWx0ZXIpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgICAiJXMgZmFpbCB0byBhbGxvY2F0ZSBtZW1vcnkgZm9yIGRpc2NvdmVyRmlsdGVyIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfUkVTT1VSQ0VTOworICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwUDJwQ29udGV4dC0+dU51bURldmljZUZpbHRlckFsbG9jYXRlZCA9IHVOdW1EZXZpY2VGaWx0ZXJzOworICAgICAgICAgfQorCisgICAgICAgICBwRGV2aWNlRmlsdGVycyA9IHBEaXNjb3ZlclJlcXVlc3QtPnBEZXZpY2VGaWx0ZXJzOworICAgICAgICAgaWYoTlVMTCAhPSBwRGV2aWNlRmlsdGVycykKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSAocFAycENvbnRleHQtPmRpcmVjdGVkRGlzY292ZXJ5RmlsdGVyLCBwRGV2aWNlRmlsdGVycywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRwMnBEaXNjb3ZlckRldmljZUZpbHRlcikgKiB1TnVtRGV2aWNlRmlsdGVycyk7CisKKyAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzID0gcDJwR2V0UmVzdWx0RmlsdGVyKHBQMnBDb250ZXh0LCAmZmlsdGVyKSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgICAiJXMgZmFpbCB0byBjcmVhdGUgZmlsdGVyIiwgX19mdW5jX18pOworICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICB9Ly9pZihOVUxMICE9IHBEZXZpY2VGaWx0ZXJzKQorCisgICAgICAgICBzdGF0dXMgPSBjc3JTY2FuR2V0UmVzdWx0KHBNYWMsICZmaWx0ZXIsICZoU2NhblJlc3VsdCk7CisgICAgICAgICBpZiAoaFNjYW5SZXN1bHQpCisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAiJXMgY2FsbGluZyBwMnBEaXNjb3ZlckNvbXBsZXRlQ2FsbGJhY2siLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICBpZiAoY2FsbGJhY2spCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBjYWxsYmFjayhoSGFsLCBwQ29udGV4dCwgZVAyUF9ESVJFQ1RFRF9ESVNDT1ZFUik7CisKKyAgICAgICAgICAgIH0gICAgICAgCisgICAgICAgICAgICBzdGF0dXMgPSAgZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgIiVzIERpcmVjdGVkIGZpbmQgZGlkIG5vdCBmaW5kIEJTU0lEIGluIGNhY2hlIiwgX19mdW5jX18pOworICAgICAgICAgICAgcFAycENvbnRleHQtPmZvcm1hdGlvblJlcS50YXJnZXRMaXN0ZW5DaGFubmVsID0gMDsKKyAgICAgICAgICAgIGlmIChwRGlzY292ZXJSZXF1ZXN0LT51TnVtRGV2aWNlRmlsdGVycyA9PSAxICYmIGZpbHRlci5CU1NJRHMubnVtT2ZCU1NJRHMgPT0gMSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmcFAycENvbnRleHQtPmZvcm1hdGlvblJlcS5kZXZpY2VBZGRyZXNzLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRGlzY292ZXJSZXF1ZXN0LT5wRGV2aWNlRmlsdGVycy0+RGV2aWNlSUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUDJQX01BQ19BRERSRVNTX0xFTik7CisgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICB9CisKKyAgICAgIHBQMnBDb250ZXh0LT5wMnBEaXNjb3ZlckNCRnVuYyA9IGNhbGxiYWNrOworICAgICAgcFAycENvbnRleHQtPnBDb250ZXh0ICAgICAgICAgID0gcENvbnRleHQ7CisgICAgICBwUDJwQ29udGV4dC0+ZGlyZWN0ZWREaXNjb3ZlcnkgPSBmRGlyZWN0OworICAgICAgaWYoIXBQMnBDb250ZXh0LT5Hcm91cEZvcm1hdGlvblBlbmRpbmcpCisgICAgICB7CisgICAgICAgICBwMnBGc20oJnBNYWMtPnAycENvbnRleHRbU2Vzc2lvbklEXSwgZVAyUF9UUklHR0VSX0RFVklDRV9NT0RFX0RFVklDRSk7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPX01FRCwgCisgICAgICAgICAgICAgICAiJXMgd2hpbGUgZ3JvdXAgZm9ybWF0aW9uIiwgX19mdW5jX18pOworICAgICAgfQorCisgICAgICBwUDJwQ29udGV4dC0+dURpc2NvdmVyVGltZW91dCA9IHBEaXNjb3ZlclJlcXVlc3QtPnVEaXNjb3ZlclRpbWVvdXQ7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPX01FRCwgIiVzIFN0YXJ0IGRpc2NvdmVyIiwgX19mdW5jX18pOworICAgICAgc3RhdHVzID0gdm9zX3RpbWVyX3N0YXJ0KCZwUDJwQ29udGV4dC0+ZGlzY292ZXJUaW1lciwKKyAgICAgICAgICAgICAgICAgICAgIHBQMnBDb250ZXh0LT51RGlzY292ZXJUaW1lb3V0KTsKKyAgICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAiJXMgZmFpbHQgdG8gc3RhcnQgZGlzY292ZXIgdGltZXIiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICBwUDJwQ29udGV4dC0+cDJwRGlzY292ZXJDQkZ1bmMgPSBOVUxMOworICAgICAgICAgICAgcFAycENvbnRleHQtPnBDb250ZXh0ICAgICAgICAgID0gTlVMTDsKKyAgICAgICAgICAgIGlmKGNhbGxiYWNrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgY2FsbGJhY2socE1hYywgcENvbnRleHQsIGVQMlBfRElTQ09WRVJfRkFJTFVSRSk7CisgICAgICAgICAgICB9CisgICAgICB9CisgICB9d2hpbGUoMCk7CisKKyAgIGlmKGZpbHRlci5TU0lEcy5TU0lETGlzdCkKKyAgIHsKKyAgICAgIHZvc19tZW1fZnJlZShmaWx0ZXIuU1NJRHMuU1NJRExpc3QpOworICAgfQorICAgaWYoIGhTY2FuUmVzdWx0ICkKKyAgIHsKKyAgICAgIHNtZV9TY2FuUmVzdWx0UHVyZ2UoIHBNYWMsIGhTY2FuUmVzdWx0ICk7CisgICB9CisgICBpZiggZmlsdGVyLkJTU0lEcy5ic3NpZCApCisgICB7CisgICAgICB2b3NfbWVtX2ZyZWUoZmlsdGVyLkJTU0lEcy5ic3NpZCk7CisgICB9CisKKyAgIHJldHVybiBzdGF0dXM7Cit9CisKK2VIYWxTdGF0dXMgcDJwU2NhblJlcXVlc3QodHAycENvbnRleHQgKnAycENvbnRleHQsIHAycERpc2NvdmVyQ29tcGxldGVDYWxsYmFjayBjYWxsYmFjaywgdm9pZCAqcENvbnRleHQpCit7CisgICB0Q3NyU2NhblJlcXVlc3Qgc2NhblJlcXVlc3Q7CisgICB2X1UzMl90IH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VQMlBfR1JPVVBfSUQsICZwMnBJZSwgJnAycEllTGVuKTsKKyAgIHZvc19tZW1fY29weShzY2FuUmVxdWVzdC5ic3NpZCwgKCh0UDJQR3JvdXBJZCAqKXAycEllKS0+ZGV2aWNlQWRkcmVzcywKKyAgICAgICAgICAgICAgICBQMlBfTUFDX0FERFJFU1NfTEVOKTsKKworICAgUDJQX0dldElFKHAycENvbnRleHQsIHAycENvbnRleHQtPnNlc3Npb25JZCwgZVAyUF9QUk9CRV9SRVEsICAmc2NhblJlcXVlc3QucElFRmllbGQsICZsZW4pOworCisgICBzY2FuUmVxdWVzdC51SUVGaWVsZExlbiA9IGxlbjsKKworICAgc3RhdHVzID0gY3NyU2NhblJlcXVlc3QoIHAycENvbnRleHQtPmhIYWwsIHAycENvbnRleHQtPlNNRXNlc3Npb25JZCwgJnNjYW5SZXF1ZXN0LCAmc2NhbklkLCBjYWxsYmFjaywgcENvbnRleHQgKTsKKworICAgaWYoc2NhblJlcXVlc3QucElFRmllbGQpCisgICB7CisgICAgICB2b3NfbWVtX2ZyZWUoc2NhblJlcXVlc3QucElFRmllbGQpOworICAgfQorCisgICBpZihwMnBJZSkKKyAgIHsKKyAgICAgIHZvc19tZW1fZnJlZShwMnBJZSk7CisgICB9CisgICByZXR1cm4gc3RhdHVzOworfQorCit0QU5JX1U4IGdldFAyUFNlc3Npb25JZEZyb21TTUVTZXNzaW9uSWQodEhhbEhhbmRsZSBoSGFsLCB0QU5JX1U4IFNlc3Npb25JRCkKK3sKKyAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVChoSGFsKTsKKyAgIHRBTklfVTggbnVtX3Nlc3Npb247CisKKyAgIGZvciAobnVtX3Nlc3Npb24gPSAwOyBudW1fc2Vzc2lvbiA8IE1BWF9OT19PRl9QMlBfU0VTU0lPTlM7IG51bV9zZXNzaW9uKyspCisgICB7CisgICAgICBpZihTZXNzaW9uSUQgPT0gcE1hYy0+cDJwQ29udGV4dFtudW1fc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UHVyZ2VEZXZpY2VMaXN0KHRwQW5pU2lyR2xvYmFsIHBNYWMsIHREYmxMaW5rTGlzdCAqcExpc3QpCit7CisgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICB0TGlzdEVsZW0gKnBFbnRyeSwgKnBOZXh0OworICAgdENzclNjYW5SZXN1bHQgKnBCc3NSZXN1bHQ7CisgICB0RG90MTFmQmVhY29uSUVzICpwSWVzOworICAgIAorICAgY3NyTExMb2NrKHBMaXN0KTsKKyAgIAorICAgcEVudHJ5ID0gY3NyTExQZWVrSGVhZChwTGlzdCwgTExfQUNDRVNTX05PTE9DSyk7CisgICB3aGlsZSggTlVMTCAhPSBwRW50cnkgKQorICAgeworICAgICAgcE5leHQgPSBjc3JMTE5leHQocExpc3QsIHBFbnRyeSwgTExfQUNDRVNTX05PTE9DSyk7CisgICAgICBwQnNzUmVzdWx0ID0gR0VUX0JBU0VfQUREUiggcEVudHJ5LCB0Q3NyU2NhblJlc3VsdCwgTGluayApOworICAgICAgcEllcyA9IE5VTEw7CisgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKGNzckdldFBhcnNlZEJzc0Rlc2NyaXB0aW9uSUVzKHBNYWMsICZwQnNzUmVzdWx0LT5SZXN1bHQuQnNzRGVzY3JpcHRvciwgJnBJZXMpKSkKKyAgICAgIHsKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgIiAlcyBmYWlsIHRvIHBhcnNlIElFcy4gcEVudHJ5ICgweCVYKSIsCisgICAgICAgICAgICBfX2Z1bmNfXywgcEVudHJ5KTsKKyAgICAgICAgIHBFbnRyeSA9IHBOZXh0OworICAgICAgICAgY29udGludWU7CisgICAgICB9CisgICAgICBpZiggcEllcy0+UDJQQmVhY29uUHJvYmVSZXMucHJlc2VudCApCisgICAgICB7CisgICAgICAgICAvL0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aWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogTmFtZTogIHBtYy5jCisqCisqIERlc2NyaXB0aW9uOgorICAgICAgUG93ZXIgTWFuYWdlbWVudCBDb250cm9sIChQTUMpIHByb2Nlc3Npbmcgcm91dGluZXMuCisqCisqCisqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNpbmNsdWRlICJwYWxUeXBlcy5oIgorI2luY2x1ZGUgImFuaUdsb2JhbC5oIgorI2luY2x1ZGUgImNzckxpbmtMaXN0LmgiCisjaW5jbHVkZSAiY3NyQXBpLmgiCisjaW5jbHVkZSAic21lSW5zaWRlLmgiCisjaW5jbHVkZSAic21lX0FwaS5oIgorI2luY2x1ZGUgInNtc0RlYnVnLmgiCisjaW5jbHVkZSAicG1jLmgiCisjaW5jbHVkZSAid2xhbl9xY3Rfd2RhLmgiCisjaW5jbHVkZSAid2xhbl9wc193b3dfZGlhZy5oIgorI2luY2x1ZGUgImNzckluc2lkZUFwaS5oIgorCitzdGF0aWMgdm9pZCBwbWNQcm9jZXNzRGVmZXJyZWRNc2coIHRwQW5pU2lyR2xvYmFsIHBNYWMgKTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKgorKiBOYW1lOiAgcG1jRW50ZXJMb3dQb3dlclN0YXRlCisqCisqIERlc2NyaXB0aW9uOgorKiAgICBIYXZlIHRoZSBkZXZpY2UgZW50ZXIgTG93IFBvd2VyIFN0YXRlLgorKgorKiBQYXJhbWV0ZXJzOgorKiAgICBoSGFsIC0gSEFMIGhhbmRsZSBmb3IgZGV2aWNlCisqCis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kFJTFVSRTsKKyAgICB9CisKKyAgICByZXR1cm4gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKK30KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIE5hbWU6ICBwbWNFbnRlckZ1bGxQb3dlclN0YXRlCisqCisqIERlc2NyaXB0aW9uOgorKiAgICBIYXZlIHRoZSBkZXZpY2UgZW50ZXIgdGhlIEZ1bGwgUG93ZXIgU3RhdGUuCisqCisqIFBhcmFtZXRlcnM6CisqICAgIGhIYWwgLSBIQUwgaGFuZGxlIGZvciBkZXZpY2UKKyoKKyogUmV0dXJuczoKKyogICAgZUhBTF9TVEFUVVNfU1VDQ0VTUyAtIGNoYW5naW5nIHN0YXRlIHN1Y2Nlc3NmdWwKKyogICAgZUhBTF9TVEFUVVNfRkFJTFVSRSAtIGNoYW5naW5nIHN0YXRlIG5vdCBzdWNjZXNzZnVsCisqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitlSGFsU3RhdHVzIHBtY0VudGVyRnVsbFBvd2VyU3RhdGUgKHRIYWxIYW5kbGUgaEhhbCkKK3sKKyAgICB0cEFuaVNpckdsb2JhbCBwTWFjID0gUE1BQ19TVFJVQ1QoaEhhbCk7CisKKyAgICBwbWNMb2cocE1hYywgTE9HMSwgRkwoIlBNQyBzdGF0ZSBpcyAlZCIpLCBwTWFjLT5wbWMucG1jU3RhdGUpOworCisgICAgLyogVGFrZSBhY3Rpb24gYmFzZWQgb24gdGhlIGN1cnJlbnQgc3RhdGUuICovCisgICAgc3dpdGNoIChwTWFjLT5wbWMucG1jU3RhdGUpCisgICAgeworCisgICAgLyogQWxyZWFkeSBpbiBGdWxsIFBvd2VyIFN0YXRlLiAqLworICAgIGNhc2UgRlVMTF9QT1dFUjoKKyAgICAgICAgYnJlYWs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iAocG1jSXNzdWVDb21tYW5kKGhIYWwsIGVTbWVDb21tYW5kRXhpdFdvd2wsICZmdWxsUG93ZXJSZWFzb24sIHNpemVvZih0UmVxdWVzdEZ1bGxQb3dlclJlYXNvbiksIEZBTFNFKSAhPQorICAgICAgICAgICAgZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR0UsIEZMKCJQTUM6IGZhaWx1cmUgdG8gc2VuZCBtZXNzYWdlICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZVdOSV9QTUNfRVhJVF9XT1dMX1JFUSIpKTsKKyAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICB9CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworCisgICAgLyogQ2Fubm90IGdvIGRpcmVjdGx5IHRvIFJlcXVlc3QgRnVsbCBQb3dlciBTdGF0ZSBmcm9tIHRoZXNlIHN0YXRlcy4gKi8KKyAgICBkZWZhdWx0OgorICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgIEZMKCJUcnlpbmcgdG8gZW50ZXIgUmVxdWVzdCBGdWxsIFBvd2VyIFN0YXRlIGZyb20gc3RhdGUgJXMgKCVkKSIpLAorICAgICAgICAgICAgICAgc21lX1BtY1N0YXRldG9TdHJpbmcocE1hYy0+cG1jLnBtY1N0YXRlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnBtYy5wbWNTdGF0ZSk7CisgICAgICAgIFBNQ19BQk9SVDsKKyAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgfQorfQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogTmFtZTogIHBtY0VudG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YWMtPnBtYy5JbXBzUmVxVGltZXJmYWlsQ250KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBtY0VudGVyUmVxdWVzdEZ1bGxQb3dlclN0YXRlKGhIYWwsIGVTTUVfUkVBU09OX09USEVSKTsKKyAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICB9CisgICAgICAgIGlmIChwTWFjLT5wbWMuSW1wc1JlcVRpbWVyZmFpbENudCkKKyAgICAgICAgeworICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgIEZMKCJTdGFydCBJTVBTIHRpbWVyIHdhcyBmYWlsZWQgJWQgdGltZXMgYmVmb3JlIHN1Y2Nlc3MiKSwgcE1hYy0+cG1jLkltcHNSZXFUaW1lcmZhaWxDbnQpOworICAgICAgICB9CisgICAgICAgIHBNYWMtPnBtYy5JbXBzUmVxVGltZXJmYWlsQ250ID0gMDsKKyAgICB9CisKKyAgICBwTWFjLT5wbWMucmZTdXBwbGllc1ZvdGVkT2ZmPSBUUlVFOworCisgICAgcmV0dXJuIGVIQUxfU1RBVFVTX1NVQ0NFU1M7Cit9CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKgorKiBOYW1lOiAgcG1jRW50ZXJSZXF1ZXN0Qm1wc1N0YXRlCisqCisqIERlc2NyaXB0aW9uOgorKiAgICBIYXZlIHRoZSBkZXZpY2UgZW50ZXIgdGhlIFJlcXVlc3QgQk1QUyBTdGF0ZS4KKyoKKyogUGFyYW1ldGVyczoKKyogICAgaEhhbCAtIEhBTCBoYW5kbGUgZm9yIGRldmljZQorKgorKiBSZXR1cm5zOgorKiAgICBlSEFMX1NUQVRVU19TVUNDRVNTIC0gY2hhbmdpbmcgc3RhdGUgc3VjY2Vzc2Z1bAorKiAgICBlSEFMX1NUQVRVU19GQUlMVVJFI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XBzQ29uZmlnLnRyYWZmaWNNZWFzdXJlUGVyaW9kKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHBtY0xvZyhwTWFjLCBMT0cxLCBGTCgiUE1DOiBlbnRlciBCTVBTIGNvbW1hbmQgYWxyZWFkeSBxdWV1ZWQiKSk7CisgICAgICAgIC8vcmVzdGFydCB0aGUgdGltZXIgaWYgbmVlZGVkCisgICAgICAgIGlmKHBtY1Nob3VsZEJtcHNUaW1lclJ1bihwTWFjKSkKKyAgICAgICAgeworICAgICAgICAgICAgKHZvaWQpcG1jU3RhcnRUcmFmZmljVGltZXIoaEhhbCwgcE1hYy0+cG1jLmJtcHNDb25maWcudHJhZmZpY01lYXN1cmVQZXJpb2QpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIH0KKworICAgIHBtY0xvZyhwTWFjLCBMT0cxLCBGTCgiZVdOSV9QTUNfRU5URVJfQk1QU19SRVEgc2VudCB0byBQRSIpKTsKKworICAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworfQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogTmFtZTogIHBtY0VudGVyQm1wc1N0YXRlCisqCisqIERlc2NyaXB0aW9uOgorKiAgICBIYXZlIHRoZSBkZXZpY2UgZW50ZXIgdGhlIEJNUFMgU3RhdGUuCisqCisqIFBhcmFtZXRlcnM6CisqICAgIGhIYWwgLSBIQUwgaGFuZGxlIGZvciBkZXZpY2UKKyoKKyogUmV0dXJuczoKKyogICAgZUhBTF9TVEFUVVNfU1VDQ0VTUyAtIGNoYW5naW5nIHN0YXRlIHN1Y2Nlc3NmdWwKKyogICAgZUhBTF9TVEFU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HBNYWMtPnBtYy53b3dsRW50ZXJQYXJhbXMpKTsKKyAgICB9CisKKyAgICByZXR1cm4gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKK30KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIE5hbWU6ICBwbWNQb3dlclNhdmVDaGVjaworKgorKiBEZXNjcmlwdGlvbjoKKyogICAgQ2hlY2sgaWYgZGV2aWNlIGlzIGFsbG93ZWQgdG8gZW50ZXIgYSBwb3dlciBzYXZlIG1vZGUuCisqCisqIFBhcmFtZXRlcnM6CisqICAgIGhIYWwgLSBIQUwgaGFuZGxlIGZvciBkZXZpY2UKKyoKKyogUmV0dXJuczoKKyogICAgVFJVRSAtIGVudHJ5IGlzIGFsbG93ZWQKKyogICAgRkFMU0UgLSBlbnRyeSBpcyBub3QgYWxsb3dlZCBhdCB0aGlzIHRpbWUKKyoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3RBTklfQk9PTEVBTiBwbWNQb3dlclNhdmVDaGVjayAodEhhbEhhbmRsZSBoSGFsKQoreworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVChoSGFsKTsKKyAgICB0TGlzdEVsZW0gKnBFbnRyeTsKKyAgICB0cFBvd2VyU2F2ZUNoZWNrRW50cnkgcFBvd2VyU2F2ZUNoZWNrRW50cnk7CisgICAgdEFOSV9CT09MRUFOICgqY2hlY2tSb3V0aW5lKSAodm9pZCAqY2hlY2tDb250ZXh0KTsKKyAgICB0QU5JX0JPT0xFQU4gYlJlc3VsdD1GQUxTRTsKKworICAgIHBtY0xvZyhwTWFjLCBMT0cyLCBGTCgiRW50ZXJpbmcgcG1jUG93ZXJTYXZlQ2hlY2siKSk7CisKKyAgICAvKiBDYWxsIHRoZSByb3V0aW5lcyBpbiB0aGUgcG93ZXIgc2F2ZSBjaGVjayByb3V0aW5lIGxpc3QuICBJZiBhbnkKKyAgICAgICByZXR1cm4gRkFMU0UsIHRoZW4gd2UgY2Fubm90IGdvIGludG8gcG93ZXIgc2F2ZSBtb2RlLiAqLworICAgIHBFbnRyeSA9IGNzckxMUGVla0hlYWQoJnBNYWMtPnBtYy5wb3dlclNhdmVDaGVja0xpc3QsIEZBTFNFKTsKKyAgICB3aGlsZSAocEVudHJ5ICE9IE5VTEwpCisgICAgeworICAgICAgICBwUG93ZXJTYXZlQ2hlY2tFbnRyeSA9IEdFVF9CQVNFX0FERFIocEVudHJ5LCB0UG93ZXJTYXZlQ2hlY2tFbnRyeSwgbGluayk7CisgICAgICAgIGNoZWNrUm91dGluZSA9IHBQb3dlclNhdmVDaGVja0VudHJ5LT5jaGVja1JvdXRpbmU7CisKKyAgICAgICAgLyogSWYgdGhlIGNoZWNrUm91dGluZSBpcyBOVUxMIGZvciBhIHBhcmljdWxhciBlbnRyeSwgcHJvY2VlZCB3aXRoIG90aGVyIGVudHJpZXMKKyAgICAgICAgICogaW4gdGhlIGxpc3QgKi8KKyAgICAgICAgaWYgKE5VTEwgIT0gY2hlY2tSb3V0aW5lKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoIWNoZWNrUm91dGluZShwUG93ZXJTYXZlQ2hlY2tFbnRyeS0+Y2hlY2tDb250ZXh0KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwgRkwoInBtY1Bvd2VyU2F2ZUNoZWNrIGZhaWwhIikpOworICAgICAgICAgICAgICAgIGJSZXN1bHQgPSBGQUxTRTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBiUmVzdWx0ID0gVFJVRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBwRW50cnkgPSBjc3JMTE5leHQoJnBNYWMtPnBtYy5wb3dlclNhdmVDaGVja0xpc3QsIHBFbnRyeSwgRkFMU0UpOworICAgIH0KKworICAgIHJldHVybiBiUmVzdWx0OworfQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogTmFtZTogIHBtY1NlbmRQb3dlclNhdmVDb25maWdNZXNzYWdlCisqCisqIERlc2NyaXB0aW9uOgorKiAgICBTZW5kIGEgbWVzc2FnZSB0byBQRS9NQUMgdG8gY29uZmlndXJlIHRoZSBwb3dlciBzYXZpbmcgbW9kZXMuCisqCisqIFBhcmFtZXRlcnM6CisqICAgIGhIYWwgLSBIQUwgaGFuZGxlIGZvciBkZXZpY2UKKyoKKyogUmV0dXJuczoKKyogICAgZUhBTF9TVEFUVVNfU1VDQ0VTUyAtIG1lc3NhZ2Ugc3VjY2Vzc2Z1bHkgc2VudAorKiAgICBlSEFMX1NUQVRVU19GQUlMVVJFIC0gZXJyb3Igd2hpbGUgc2VuZGluZyBtZXNzYWdlCisqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitlSGFsU3RhdHVzIHBtY1NlbmRQb3dlclNhdmVDb25maWdNZXNzYWdlICh0SGFsSGFuZGxlIGhIYWwpCit7CisgICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9IFBNQUNfU1RSVUNUKGhIYWwpOworICAgIHRTaXJQb3dlclNhdmVDZmcgcG93ZXJTYXZlQ29uZmlnOworCisgICAgcG1jTG9nKHBNYWMsIExPRzIsIEZMKCJFbnRlcmluZyBwbWNTZW5kUG93ZXJTYXZlQ29uZmlnTWVzc2FnZSIpKTsKKworICAgIHZvc19tZW1fc2V0KCYocG93ZXJTYXZlQ29uZmlnKSwgc2l6ZW9mKHRTaXJQb3dlclNhdmVDZmcpLCAwKTsKKworICAgIHN3aXRjaCAocE1hYy0+cG1jLmJtcHNDb25maWcuZm9yd2FyZEJlYWNvbnMpCisgICAgeworICAgIGNhc2UgZVBNQ19OT19CRUFDT05TOgorICAgICAgICBwb3dlclNhdmVDb25maWcuYmVhY29uRndkID0gZVBNX0JFQUNPTl9GV0RfTk9ORTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBlUE1DX0JFQUNPTlNfV0lUSF9USU1fU0VUOgorICAgICAgICBwb3dlclNhdmVDb25maWcuYmVhY29uRndkID0gZVBNX0JFQUNPTl9GV0RfVElNOworICAgICAgICBicmVhazsKKyAgICBjYXNlIGVQTUNfQkVBQ09OU19XSVRIX0RUSU1fU0VUOgorICAgICAgICBwb3dlclNhdmVDb25maWcuYmVhY29uRndkID0gZVBNX0JFQUNPTl9GV0RfRFRJTTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBlUE1DX05USF9CRUFDT046CisgICAgICAgIHBvd2VyU2F2ZUNvbmZpZy5iZWFjb25Gd2QgPSBlUE1fQkVBQ09OX0ZXRF9OVEg7CisgICAgICAgIHBvd2VyU2F2ZUNvbmZpZy5udGhCZWFjb25Gd2QgPSAodEFOSV9VMTYpcE1hYy0+cG1jLmJtcHNDb25maWcudmFsdWVPZk47CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgZVBNQ19BTExfQkVBQ09OUzoKKyAgICAgICAgcG93ZXJTYXZlQ29uZmlnLmJlYWNvbkZ3ZCA9IGVQTV9CRUFDT05fRldEX05USDsKKyAgICAgICAgcG93ZXJTYXZlQ29uZmlnLm50aEJlYWNvbkZ3ZCA9IDE7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICBwb3dlclNhdmVDb25maWcuZkVuYWJsZVB3clNhdmVJbW1lZGlhdGVseSA9IHBNYWMtPnBtYy5ibXBzQ29uZmlnLnNldFBtT25MYXN0RnJhbWU7CisgICAgcG93ZXJTYXZlQ29uZmlnLmZQU1BvbGwgPSB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KyAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLy9laXRoZXIgZmFpbCBvciBhbHJlYWR5IGluIGZ1bGwgcG93ZXIKKyAgICAgICAgICAgIGlmKCAhSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmV0dXJuICggc3RhdHVzICk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvL2Vsc2UgbGV0IGl0IHRocm91Z2ggYmVjYXVzZSBpdCBpcyBpbiBmdWxsIHBvd2VyIHN0YXRlCisgICAgICAgIH0KKyAgICB9CisgICAgLyogU2VuZCBhIG1lc3NhZ2Ugc28gdGhhdCBGVyBTeXN0ZW0gY29uZmlnIGlzIGFsc28gdXBkYXRlZCBhbmQgaXMgaW4gc3luYyB3aXRoCisgICAgICAgdGhlIENGRy4qLworICAgIGlmIChwbWNTZW5kTWVzc2FnZShoSGFsLCBlV05JX1BNQ19QV1JfU0FWRV9DRkcsICZwb3dlclNhdmVDb25maWcsIHNpemVvZih0U2lyUG93ZXJTYXZlQ2ZnKSkKKyAgICAgICAgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dFLCBGTCgiU2VuZCBvZiBlV05JX1BNQ19QV1JfU0FWRV9DRkcgdG8gUEUgZmFpbGVkIikpOworICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICB9CisKKyAgICByZXR1cm4gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKK30KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIE5hbWU6ICBwbWNTZW5kTWVzc2FnZQorKgorKiBEZXNjcmlwdGlvbj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Zm9yIGRldmljZQorKiAgICBjYWxsYmFja1N0YXR1cyAtIHN0YXR1cyB0byBwYXNzIHRvIHRoZSBjYWxsYmFjayByb3V0aW5lcworKgorKiBSZXR1cm5zOgorKiAgICBub3RoaW5nCisqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCit2b2lkIHBtY0RvQ2FsbGJhY2tzICh0SGFsSGFuZGxlIGhIYWwsIGVIYWxTdGF0dXMgY2FsbGJhY2tTdGF0dXMpCit7CisgICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9IFBNQUNfU1RSVUNUKGhIYWwpOworICAgIHRMaXN0RWxlbSAqcEVudHJ5OworICAgIHRwUmVxdWVzdEZ1bGxQb3dlckVudHJ5IHBSZXF1ZXN0RnVsbFBvd2VyRW50cnk7CisKKyAgICBwbWNMb2cocE1hYywgTE9HMiwgRkwoIkVudGVyIikpOworCisgICAgLyogQ2FsbCBJTVBTIGNhbGxiYWNrIHJvdXRpbmUuICovCisgICAgaWYgKHBNYWMtPnBtYy5pbXBzQ2FsbGJhY2tSb3V0aW5lICE9IE5VTEwpCisgICAgeworICAgICAgICBwTWFjLT5wbWMuaW1wc0NhbGxiYWNrUm91dGluZShwTWFjLT5wbWMuaW1wc0NhbGxiYWNrQ29udGV4dCwgY2FsbGJhY2tTdGF0dXMpOworICAgICAgICBwTWFjLT5wbWMuaW1wc0NhbGxiYWNrUm91dGluZSA9IE5VTEw7CisgICAgfQorCisgICAgLyogQ2FsbCB0aGUgcm91dGluZXMgaW4gdGhlIHJlcXVlc3QgZnVsbCBwb3dlciBjYWxsYmFjayByb3V0aW5lIGxpc3QuICovCisgICAgd2hpbGUgKE5VTEwgIT0gKHBFbnRyeSA9IGNzckxMUmVtb3ZlSGVhZCgmcE1hYy0+cG1jLnJlcXVlc3RGdWxsUG93ZXJMaXN0LCBUUlVFKSkpCisgICAgeworICAgICAgICBwUmVxdWVzdEZ1bGxQb3dlckVudHJ5ID0gR0VUX0JBU0VfQUREUihwRW50cnksIHRSZXF1ZXN0RnVsbFBvd2VyRW50cnksIGxpbmspOworICAgICAgICBpZiAocFJlcXVlc3RGdWxsUG93ZXJFbnRyeS0+Y2FsbGJhY2tSb3V0aW5lKQorICAgICAgICAgICBwUmVxdWVzdEZ1bGxQb3dlckVudHJ5LT5jYWxsYmFja1JvdXRpbmUocFJlcXVlc3RGdWxsUG93ZXJFbnRyeS0+Y2FsbGJhY2tDb250ZXh0LCBjYWxsYmFja1N0YXR1cyk7CisgICAgICAgIHZvc19tZW1fZnJlZShwUmVxdWVzdEZ1bGxQb3dlckVudHJ5KTsKKyAgICB9CisKK30KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIE5hbWU6ICBwbWNTdGFydFRyYWZmaWNUaW1lcgorKgorKiBEZXNjcmlwdGlvbjoKKyogICAgU3RhcnQgdGhlIHRpbWVyIHVzZWQgaW4gRnVsbCBQb3dlciBTdGF0ZSB0byBtZWFzdXJlIHRyYWZmaWMKKyogICAgbGV2ZWxzIGFuZCBkZXRlcm1pbmUgd2hlbiB0byBlbnRlciBCTVBTLgorKgorKiBQYXJhbWV0ZXJzOgorKiAgICBoSGFsIC0gSEFMIGhhbmRsZSBmb3IgZGV2aWNlCisqCisqIFJldHVybnM6CisqICAgIGVIQUxfU1RBVFVTX1NVQ0NFU1MgLSB0aW1lciBzdWNjZXNzZnVseSBzdGFydGVkCisqICAgIGVIQUxfU1RBVFVTX0ZBSUxVUkUgLSBlcnJvciB3aGlsZSBzdGFydGluZyB0aW1lcgorKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworZUhhbFN0YXR1cyBwbWNTdGFydFRyYWZmaWNUaW1lciAodEhhbEhhbmRsZSBoSGFsLCB0QU5JX1UzMiBleHBpcmF0aW9uVGltZSkKK3sKKyAgICB0cEFuaVNpckdsb2JhbCBwTWFjID0gUE1BQ19TVFJVQ1QoaEhhbCk7CisgICAgVk9TX1NUQVRVUyB2b3NTdGF0dXM7CisKKyAgICBwbWNMb2cocE1hYywgTE9HMSwgRkwoIkVudGVyLiBUaW1lciBkdXJhdGlvbiBpcyAlZCIpLCBleHBpcmF0aW9uVGltZSk7CisKKyAgICB2b3NTdGF0dXMgPSB2b3NfdGltZXJfc3RhcnQoJnBNYWMtPnBtYy5oVHJhZmZpY1RpbWVyLCBleHBpcmF0aW9uVGltZSk7CisgICAgaWYgKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykgKQorICAgIHsKKyAgICAgICAgaWYoIFZPU19TVEFUVVNfRV9BTFJFQURZID09IHZvc1N0YXR1cyApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vQ29uc2lkZXIgdGhpcyBvayBzaW5jZSB0aGUgdGltZXIgaXMgYWxyZWFkeSBzdGFydGVkLgorICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR1csIEZMKCIgIHRyYWZmaWMgdGltZXIgaXMgYWxyZWFkeSBzdGFydGVkIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR1AsIEZMKCJDYW5ub3Qgc3RhcnQgdHJhZmZpYyB0aW1lciIpKTsKKyAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIGVIQUxfU1RBVFVTX1NVQ0NFU1M7Cit9CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKgorKiBOYW1lOiAgcG1jU3RvcFRyYWZmaWNUaW1lcgorKgorKiBEZXNjcmlwdGlvbjoKKyogICAgQ2FuY2VscyB0aGUgdGltZXIgKGlmIHJ1bm5pbmcpIHVzZWQgaW4gRnVsbCBQb3dlciBTdGF0ZSB0byBtZWFzdXJlIHRyYWZmaWMKKyogICAgbGV2ZWxzIGFuZCBkZXRlcm1pbmUgd2hlbiB0byBlbnRlciBCTVBTLgorKgorKiBQYXJhbWV0ZXJzOgorKiAgICBoSGFsIC0gSEFMIGhhbmRsZSBmb3IgZGV2aWNlCisqCisqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCit2b2lkIHBtY1N0b3BUcmFmZmljVGltZXIgKHRIYWxIYW5kbGUgaEhhbCkKK3sKKyAgICB0cEFuaVNpckdsb2JhbCBwTWFjID0gUE1BQ19TVFJVQ1QoaEhhbCk7CisgICAgcG1jTG9nKHBNYWMsIExPRzIsIEZMKCJFbnRlcmluZyBwbWNTdG9wVHJhZmZpY1RpbWVyIikpOworICAgIHZvc190aW1lcl9zdG9wKCZwTWFjLT5wbWMuaFRyYWZmaWNUaW1lcik7Cit9CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKgorKiBOYW1lOiAgcG1jSW1wc1RpbWVyRXhwaXJlZAorKgorKiBEZXNjcmlwdGlvbjoKKyogICAgQ2FsbGVkIHdoZW4gSU1QUyB0aW1lciBleHBpcmVzLgorKgorKiBQYXJhbWV0ZXJzOgorKiAgICBoSGFsIC0gSEFMIGhhbmRsZSBmb3IgZGV2aWNlCisqCisqIFJldHVybnM6CisqICAgIG5vdGhpbmcKKyoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3ZvaWQgcG1jSW1wc1RpbWVyRXhwaXJlZCAodEhhbEhhbmRsZSBoSGFsKQoreworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVChoSGFsKTsKKworICAgIHBtY0xvZyhwTWFjLCBMT0cyLCBGTCgiRW50ZXJpbmcgcG1jSW1wc1RpbWVyRXhwaXJlZCIpKTsKKworICAgIC8qIElmIHRpbWVyIGV4cGlyZXMgYW5kIHdlIGFyZSBpbiBhIHN0YXRlIG90aGVyIHRoYW4gSU1QUyBTdGF0ZSB0aGVuIHNvbWV0aGluZyBpcyB3cm9uZy4gKi8KKyAgICBpZiAocE1hYy0+cG1jLnBtY1N0YXRlICE9IElNUFMpCisgICAgeworICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwgRkwoIkdvdCBJTVBTIHRpbWVyIGV4cGlyYXRpb24gaW4gc3RhdGUgJXMgKCVkKSIpLAorICAgICAgICAgICAgICAgc21lX1BtY1N0YXRldG9TdHJpbmcocE1hYy0+cG1jLnBtY1N0YXRlKSwgcE1hYy0+cG1jLnBtY1N0YXRlKTsKKyAgICAgICAgUE1DX0FCT1JUOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgLyogU3RhcnQgb24gdGhlIHBhdGggb2YgZ29pbmcgYmFjayB0byBmdWxsIHBvd2VyLiAqLworICAgIHBtY0VudGVyUmVxdWVzdEZ1bGxQb3dlclN0YXRlKGhIYWwsIGVTTUVfUkVBU09OX09USEVSKTsKK30KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIE5hbWU6ICBwbWNUcmFmZmljVGltZXJFeHBpcmVkCisqCisqIERlc2NyaXB0aW9uOgorKiAgICBDYWxsZWQgd2hlbiB0cmFmZmljIG1lYXN1cmVtZW50IHRpbWVyIGV4cGlyZXMuCisqCisqIFBhcmFtZXRlcnM6CisqICAgIGhIYWwgLSBIQUwgaGFuZGxlIGZvciBkZXZpY2UKKyoKKyogUmV0dXJuczoKKyogICAgbm90aGluZworKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordm9pZCBwbWNUcmFmZmljVGltZXJFeHBpcmVkICh0SGFsSGFuZGxlIGhIYWwpCit7CisKKyAgICB0cEFuaVNpckdsb2JhbCBwTWFjID0gUE1BQ19TVFJVQ1QoaEhhbCk7CisgICAgVk9TX1NUQVRVUyB2b3NTdGF0dXM7CisKKyAgICBwbWNMb2cocE1hYywgTE9HMiwgRkwoIkJNUFMgVHJhZmZpYyB0aW1lciBleHBpcmVkIikpOworCisgICAgLyogSWYgdGltZXIgZXhwaXJlcyBhbmQgd2UgYXJlIGluIGEgc3RhdGUgb3RoZXIgdGhhbiBGdWxsIFBvd2VyIFN0YXRlIHRoZW4gc29tZXRoaW5nIGlzIHdyb25nLiAqLworICAgIGlmIChwTWFjLT5wbWMucG1jU3RhdGUgIT0gRlVMTF9QT1dFUikKKyAgICB7CisgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dFLCBGTCgiR290IHRyYWZmaWMgdGltZXIgZXhwaXJhdGlvbiBpbiBzdGF0ZSAlcyAoJWQpIiksCisgICAgICAgICAgICAgICBzbWVfUG1jU3RhdGV0b1N0cmluZyhwTWFjLT5wbWMucG1jU3RhdGUpLCBwTWFjLT5wbWMucG1jU3RhdGUpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgLyogVW50aWxsIERIQ1AgaXMgbm90IGNvbXBsZXRlZCByZW1haW4gaW4gcG93ZXIgYWN0aXZlICovCisgICAgaWYocE1hYy0+cG1jLnJlbWFpbkluUG93ZXJBY3RpdmVUaWxsREhDUCkKKyAgICB7CisgICAgICAgIHBtY0xvZyhwTWFjLCBMT0cxLCBGTCgiQk1QUyBUcmFmZmljIFRpbWVyIGV4cGlyZWQgYmVmb3JlIERIQ1AiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGNvbXBsZXRpb24gaWdub3JlIGVudGVyIEJNUFMiK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CBMT0dFLCBGTCgiUG93ZXIgU2F2ZSBjaGVjayBmYWlsZWQuIFJldHJ5IEJNUFMgYWdhaW4gbGF0ZXIiKSk7CisgICAgICAgIC8vU2luY2UgaFRyYWZmaWNUaW1lciBpcyBhIHZvc190aW1lciBub3csIHdlIG5lZWQgdG8gcmVzdGFydCB0aGUgdGltZXIgaGVyZQorICAgICAgICB2b3NTdGF0dXMgPSB2b3NfdGltZXJfc3RhcnQoJnBNYWMtPnBtYy5oVHJhZmZpY1RpbWVyLCBwTWFjLT5wbWMuYm1wc0NvbmZpZy50cmFmZmljTWVhc3VyZVBlcmlvZCk7CisgICAgICAgIGlmICggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpICYmIChWT1NfU1RBVFVTX0VfQUxSRUFEWSAhPSB2b3NTdGF0dXMpICkKKyAgICAgICAgeworICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR1AsIEZMKCJDYW5ub3Qgc3RhcnQgdHJhZmZpYyB0aW1lciIpKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgIH0KK30KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIE5hbWU6ICBwbWNFeGl0UG93ZXJTYXZlVGltZXJFeHBpcmVkCisqCisqIERlc2NyaXB0aW9uOgorKiAgICBDYWxsZWQgd2hlbiB0aW1lciB1c2VkIHRvIHNjaGVkdWxlIGEgZGVmZXJyZWQgcG93ZXIgc2F2ZSBtb2RlIGV4aXQgZXhwaXJlcy4KKyoKKyogUGFyYW1ldGVyczoKKyogICAgaEhhbCAtIEhBTCBoYW5kbGUgZm9yIGRldmljZQorKgorKiBSZXR1cm5zOgorKiAgICBub3RoaW5nCisqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCit2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CZwTWFjLT5wbWMucmVxdWVzdEJtcHNMaXN0LCBGQUxTRSk7CisgICB9CisgICBjc3JMTFVubG9jaygmcE1hYy0+cG1jLnJlcXVlc3RCbXBzTGlzdCk7Cit9CisKKworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogTmFtZTogIHBtY0RvU3RhcnRVYXBzZENhbGxiYWNrcworKgorKiBEZXNjcmlwdGlvbjoKKyogICAgQ2FsbCB0aGUgcmVnaXN0ZXJlZCBVQVBTRCBjYWxsYmFjayByb3V0aW5lcyBiZWNhdXNlIGRldmljZSBpcyB1bmFibGUgdG8KKyogICAgc3RhcnQgVUFQU0Qgc3RhdGUKKyoKKyogUGFyYW1ldGVyczoKKyogICAgaEhhbCAtIEhBTCBoYW5kbGUgZm9yIGRldmljZQorKiAgICBjYWxsYmFja1N0YXR1cyAtIFN1Y2Nlc3Mgb3IgRmFpbHVyZS4KKyoKKyogUmV0dXJuczoKKyogICAgbm90aGluZworKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordm9pZCBwbWNEb1N0YXJ0VWFwc2RDYWxsYmFja3MgKHRIYWxIYW5kbGUgaEhhbCwgZUhhbFN0YXR1cyBjYWxsYmFja1N0YXR1cykKK3sKKyAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVChoSGFsKTsKKyAgIHRMaXN0RWxlbSAqcEVudHJ5OworICAgdHBTdGFydFVhcHNkRW50cnkgcFN0YXJ0VWFwc2RFbnRyeTsKKworICAgcG1jTG9nKHBNYWMsIExPRzEsIEZMKCJFbnRlciIpKTsKKyAgIGNzckxMTG9jaygmcE1hYy0+cG1jLnJlcXVlc3RTdGFydFVhcHNkTGlzdCk7CisgICAvKiBDYWxsIHRoZSByb3V0aW5lcyBpbiB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worICAgICAgICAgICAgLyogTWFrZSBzdXJlIHRoZSBCTVBTIHJldHJ5IHRpbWVyIGlzIHJ1bm5pbmcgKi8KKyAgICAgICAgICAgIGlmKHBtY1Nob3VsZEJtcHNUaW1lclJ1bihwTWFjKSkKKyAgICAgICAgICAgICAgICh2b2lkKXBtY1N0YXJ0VHJhZmZpY1RpbWVyKGhIYWwsIHBNYWMtPnBtYy5ibXBzQ29uZmlnLnRyYWZmaWNNZWFzdXJlUGVyaW9kKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UKKyAgICAgICAgIHsKKyAgICAgICAgICAgIC8qICBQb3dlclNhdmVDaGVjayBwYXNzZWQsIHB1dCB0aGUgZGV2aWNlIGludG8gQk1QUyBmaXJzdCAqLworICAgICAgICAgICAgaWYocG1jRW50ZXJSZXF1ZXN0Qm1wc1N0YXRlKGhIYWwpICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR0UsICJQTUM6IERldmljZSBpbiBGdWxsIFBvd2VyLiBFbnRlciBSZXF1ZXN0IEJtcHMgZmFpbGVkLiAiCisgICAgICAgICAgICAgICAgICAgICAgICAiVUFQU0QgcmVxdWVzdCB3aWxsIGJlIGRyb3BwZWQgIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBCTVBTOgorICAgICAgeworICAgICAgICAgdEFOSV9VOCBzdGF0aWNVYXBzZE1hc2sgPSAwOworICAgICAgICAgY3NyR2V0U3RhdGljVWFwc2RNYXNrKHBNYWMsICZzdGF0aWNVYXBzZE1hc2spOworCisgICAgICAgICAvL0l0IGlzIGFscmVhZHkgaW4gQk1QUyBtb2RlLCBjaGVjayBCVEMgc3RhdGUKKyNpZm5kZWYgV0xBTl9NRE1fQ09ERV9SRURVQ1RJT05fT1BUCisgICAgICAgICBpZiAoYnRjSXNSZWFkeUZvclVhcHNkKHBNYWMpIHx8IHN0YXRpY1VhcHNkTWFzaykKKyNlbmRpZiAvKiBXTEFOX01ETV9DT0RFX1JFRFVDVElPTl9PUFQqLworICAgICAgICAgeworICAgICAgICAgICAgLyogQlRDIGlzIE9LIHdpdGggVWFwc2Qgb3Igc3RhdGljIFVhcHNkIGlzIGNvbmZpZ3VyZWQsIHRoZW4gdGVsbAorICAgICAgICAgICAgICAgTUFDIHRvIGhhdmUgZGV2aWNlIGVudGVyIFVBUFNEIG1vZGUuICovCisgICAgICAgICAgICBpZiAocG1jSXNzdWVDb21tYW5kKGhIYWwsIGVTbWVDb21tYW5kRW50ZXJVYXBzZCwgTlVMTCwgMCwgRkFMU0UpICE9CisgICAgICAgICAgICAgICBlSEFMX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR0UsICJQTUM6IGZhaWx1cmUgdG8gc2VuZCBtZXNzYWdlICIKKyAgICAgICAgICAgICAgICAgICJlV05JX1BNQ19FTlRFUl9CTVBTX1JFUSIpOworICAgICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICB9CisgICAgICAgICB9CisjaWZuZGVmIFdMQU5fTURNX0NPREVfUkVEVUNUSU9OX09QVAorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgLy9Ob3QgcmVhZHkgZm9yIFVBUFNEIGF0IHRoaXMgdGltZSwgc2F2ZSBpdCBmaXJzdCBhbmQgd2FrZSB1cCB0aGUgY2hpcAorICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR0UsICJVYXBzZCBub3QgbmVlZGVkIG5vdywgUE1DIHN0YXRlID0gJWQiCisgICAgICAgICAgICAgICAgICAgImJ0Y0lzVWFwc2RPazolZCBzdGF0aWNVYXBzZE1hc2s6MHgleCIscE1hYy0+cG1jLnBtY1N0YXRlLAorICAgICAgICAgICAgICAgICAgIGJ0Y0lzUmVhZHlGb3JVYXBzZChwTWFjKSwgc3RhdGljVWFwc2RNYXNrKTsKKyAgICAgICAgICAgIHBNYWMtPnBtYy51YXBzZFNlc3Npb25SZXF1aXJlZCA9IFRSVUU7CisgICAgICAgICB9CisjZW5kaWYgLyogV0xBTl9NRE1fQ09ERV9SRURVQ1RJT05fT1BUKi8KKyAgICAgIH0KKyAgICAgIGJyZWFrOworCisgICAgICBjYXNlIFJFUVVFU1RfU1RBUlRfVUFQU0Q6CisgICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwgIlJlcXVlc3QgVWFwc2QgaW4gcHJvZ3Jlc3MiKTsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIFJFUVVFU1RfQk1QUzoKKyAgICAgICAgIC8qIEJ1ZmZlciByZXF1ZXN0IGZvciBVQVBTRCBtb2RlLiAqLworICAgICAgICAgcE1hYy0+cG1jLnVhcHNkU2Vzc2lvblJlcXVpcmVkID0gVFJVRTsKKyAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dFLCAiUmVxdWVzdCBCTVBTIGluIHByb2dyZXNzIik7CisgICAgICAgICBicmVhazsKKworICAgICAgZGVmYXVsdDoKKyAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dFLCAiUE1DOiB0cnlpbmcgdG8gZW50ZXIgVUFQU0QgU3RhdGUgZnJvbSBzdGF0ZSAlZCIsCisgICAgICAgICAgICBwTWFjLT5wbWMucG1jU3RhdGUpOworICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICB9CisKKyAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIE5hbWU6ICBwbWNFbnRlclVhcHNkU3RhdGUKKyoKK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VsbCBNQUMgdG8gaGF2ZSBkZXZpY2UgZXhpdCBVQVBTRCBtb2RlLiAqLworICAgaWYgKHBtY0lzc3VlQ29tbWFuZChoSGFsLCBlU21lQ29tbWFuZEV4aXRVYXBzZCwgTlVMTCwgMCwgRkFMU0UpICE9CisgICAgICBlSEFMX1NUQVRVU19TVUNDRVNTKQorICAgeworICAgICAgcG1jTG9nKHBNYWMsIExPR0UsICJQTUM6IGZhaWx1cmUgdG8gc2VuZCBtZXNzYWdlICIKKyAgICAgICAgICJlV05JX1BNQ19FWElUX1VBUFNEX1JFUSIpOworICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICB9CisKKyAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIE5hbWU6ICBwbWNFbnRlclJlcXVlc3RTdGFuZGJ5U3RhdGUKKyoKKyogRGVzY3JpcHRpb246CisqICAgIEhhdmUgdGhlIGRldmljZSBlbnRlciB0aGUgUmVxdWVzdCBTVEFOREJZIFN0YXRlLgorKgorKiBQYXJhbWV0ZXJzOgorKiAgICBoSGFsIC0gSEFMIGhhbmRsZSBmb3IgZGV2aWNlCisqCisqIFJldHVybnM6CisqICAgIGVIQUxfU1RBVFVTX1NVQ0NFU1MgLSBjaGFuZ2luZyBzdGF0ZSBzdWNjZXNzZnVsCisqICAgIGVIQUxfU1RBVFVTX0ZBSUxVUkUgLSBjaGFuZ2luZyBzdGF0ZSBub3Qgc3VjY2Vzc2Z1bAorKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworZUhhbFN0YXR1cyBwbWNFbnRlclJlcXVlc3RTdGFuZGJ5U3RhdGUgKHRIYWxIYW5kbGUgaEhhbCkKK3sKKyAgIH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ICAgICAgICAgICAgICJlV05JX1BNQ19FTlRFUl9JTVBTX1JFUSIpKTsKKyAgICAgIHBNYWMtPnBtYy5wbWNTdGF0ZSA9IEZVTExfUE9XRVI7CisKKyAgICAgIGlmKHBtY1Nob3VsZEJtcHNUaW1lclJ1bihwTWFjKSkKKyAgICAgICAgICAodm9pZClwbWNTdGFydFRyYWZmaWNUaW1lcihoSGFsLCBwTWFjLT5wbWMuYm1wc0NvbmZpZy50cmFmZmljTWVhc3VyZVBlcmlvZCk7CisgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgIH0KKworICAgcmV0dXJuIGVIQUxfU1RBVFVTX1NVQ0NFU1M7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogTmFtZTogIHBtY0VudGVyU3RhbmRieVN0YXRlCisqCisqIERlc2NyaXB0aW9uOgorKiAgICBIYXZlIHRoZSBkZXZpY2UgZW50ZXIgdGhlIFNUQU5EQlkgU3RhdGUuCisqCisqIFBhcmFtZXRlcnM6CisqICAgIGhIYWwgLSBIQUwgaGFuZGxlIGZvciBkZXZpY2UKKyoKKyogUmV0dXJuczoKKyogICAgZUhBTF9TVEFUVVNfU1VDQ0VTUyAtIGNoYW5naW5nIHN0YXRlIHN1Y2Nlc3NmdWwKKyogICAgZUhBTF9TVEFUVVNfRkFJTFVSRSAtIGNoYW5naW5nIHN0YXRlIG5vdCBzdWNjZXNzZnVsCisqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitlSGFsU3RhdHVzIHBtY0VudGVyU3RhbmRieVN0YXRlICh0SGFsSGFuZGxlIGhIYWwpCit7CisgICB0cEFuaVNpckdsb2JhbCBwTWFjID0gUE1BQ19TVFJVQ1QoaEhhbCk7CisKKyAgIHBtY0xvZyhw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VMTDsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKgorKiBOYW1lOiAgcG1jR2V0UG1jU3RhdGUKKyoKKyogRGVzY3JpcHRpb246CisqICAgIFJldHVybiB0aGUgUE1DIHN0YXRlCisqCisqIFBhcmFtZXRlcnM6CisqICAgIGhIYWwgLSBIQUwgaGFuZGxlIGZvciBkZXZpY2UKKyoKKyogUmV0dXJuczoKKyogICAgdFBtY1N0YXRlIChvbmUgb2YgSU1QUywgUkVRVUVTVF9JTVBTLCBCTVBTLCBSRVFVRVNUX0JNUFMgZXRjKQorKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordFBtY1N0YXRlIHBtY0dldFBtY1N0YXRlICh0SGFsSGFuZGxlIGhIYWwpCit7CisgICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9IFBNQUNfU1RSVUNUKGhIYWwpOworICAgIHJldHVybiBwTWFjLT5wbWMucG1jU3RhdGU7Cit9CisKK2NvbnN0IGNoYXIqIHBtY0dldFBtY1N0YXRlU3RyKHRQbWNTdGF0ZSBzdGF0ZSkKK3sKKyAgICBzd2l0Y2goc3RhdGUpCisgICAgeworICAgICAgICBjYXNlIFNUT1BQRUQ6CisgICAgICAgICAgICByZXR1cm4gIlNUT1BQRUQiOworICAgICAgICBjYXNlIEZVTExfUE9XRVI6CisgICAgICAgICAgICByZXR1cm4gIkZVTExfUE9XRVIiOworICAgICAgICBjYXNlIExPV19QT1dFUjoKKyAgICAgICAgICAgIHJldHVybiAiTE9XX1BPV0VSIjsKKyAgICAgICAgY2FzZSBJTVBTOgorICAgICAgICAgICAgcmV0dXJuICJJTVBTIjsKKyAgICAgICAgY2FzZSBCTVBTOgorICAgICAgICAgICAgcmV0dXJuICJCTVBTIjsKKyAgICAgICAgY2FzZSBVQVBTRDoKKyAgICAgICAgICAgIHJldHVybiAiVUFQU0QiOworICAgICAgICBjYXNlIFNUQU5EQlk6CisgICAgICAgICAgICByZXR1cm4gIlNUQU5EQlkiOworICAgICAgICBjYXNlIFJFUVVFU1RfSU1QUzoKKyAgICAgICAgICAgIHJldHVybiAiUkVRVUVTVF9JTVBTIjsKKyAgICAgICAgY2FzZSBSRVFVRVNUX0JNUFM6CisgICAgICAgICAgICByZXR1cm4gIlJFUVVFU1RfQk1QUyI7CisgICAgICAgIGNhc2UgUkVRVUVTVF9TVEFSVF9VQVBTRDoKKyAgICAgICAgICAgIHJldHVybiAiUkVRVUVTVF9TVEFSVF9VQVBTRCI7CisgICAgICAgIGNhc2UgUkVRVUVTVF9TVE9QX1VBUFNEOgorICAgICAgICAgICAgcmV0dXJuICJSRVFVRVNUX1NUT1BfVUFQU0QiOworICAgICAgICBjYXNlIFJFUVVFU1RfRlVMTF9QT1dFUjoKKyAgICAgICAgICAgIHJldHVybiAiUkVRVUVTVF9GVUxMX1BPV0VSIjsKKyAgICAgICAgY2FzZSBSRVFVRVNUX1NUQU5EQlk6CisgICAgICAgICAgICByZXR1cm4gIlJFUVVFU1RfU1RBTkRCWSI7CisgICAgICAgIGNhc2UgUkVRVUVTVF9FTlRFUl9XT1dMOgorICAgICAgICAgICAgcmV0dXJuICJSRVFVRVNUX0VOVEVSX1dPV0wiOworICAgICAgICBjYXNlIFJFUVVFU1RfRVhJVF9XT1dMOgorICAgICAgICAgICAgcmV0dXJuICJSRVFVRVNUX0VYSVRfV09XTCI7CisgICAgICAgIGNhc2UgV09XTDoKKyAgICAgICAgICAgIHJldHVybiAiV09XTCI7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICByZXR1cm4gIlVOS05PV04iOworfQorCit2b2lkIHBtY0RvRGV2aWNlU3RhdGVVcGRhdGVDYWxsYmFja3MgKHRIYWxIYW5kbGUgaEhhbCwgdFBtY1N0YXRlIHN0YXR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XBkYXRlSW5kTGlzdCwgcEVudHJ5LCBGQUxTRSk7CisgICAgfQorfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIE5hbWU6ICBwbWNSZXF1ZXN0RW50ZXJXb3dsU3RhdGUKKyoKKyogRGVzY3JpcHRpb246CisqICAgIEhhdmUgdGhlIGRldmljZSBlbnRlciB0aGUgV09XTCBTdGF0ZS4KKyoKKyogUGFyYW1ldGVyczoKKyogICAgaEhhbCAtIEhBTCBoYW5kbGUgZm9yIGRldmljZQorKgorKiBSZXR1cm5zOgorKiAgICBlSEFMX1NUQVRVU19TVUNDRVNTIC0gV09XTCBtb2RlIHdpbGwgYmUgZW50ZXJlZAorKiAgICBlSEFMX1NUQVRVU19GQUlMVVJFIC0gV09XTCBtb2RlIGNhbm5vdCBiZSBlbnRlcmVkCisqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitlSGFsU3RhdHVzIHBtY1JlcXVlc3RFbnRlcldvd2xTdGF0ZSh0SGFsSGFuZGxlIGhIYWwsIHRwU2lyU21lV293bEVudGVyUGFyYW1zIHdvd2xFbnRlclBhcmFtcykKK3sKKyAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVChoSGFsKTsKKyAgIHBtY0xvZyhwTWFjLCBMT0cxLCBGTCgiRW50ZXIuIFBNQyBTdGF0ZSBpcyAlZCIpLHBNYWMtPnBtYy5wbWNTdGF0ZSk7CisKKyAgIHN3aXRjaCAocE1hYy0+cG1jLnBtY1N0YXRlKQorICAgeworICAgICAgY2FzZSBGVUxMX1BPV0VSOgorICAgICAgICAgLyogUHV0IGRldmljZSBpbiBCTVBTIG1vZGUgZmlyc3QuIFRoaXMgc3RlcCBzaG91bGQgTkVWRVIgZmFpbC4gKi8KKyAgICAgICAgIGlmKHBtY0VudGVyUmVxdWVzdEJtcHNTdGF0ZShoSGFsKSAhPSBlSEFMX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgeworICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR0UsIEZMKCJQTUM6IERldmljZSBpbiBGdWxsIFBvd2VyLiBwbWNFbnRlclJlcXVlc3RCbXBzU3RhdGUgZmFpbGVkLiAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkNhbm5vdCBlbnRlciBXT1dMIikpOworICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICB9CisgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBSRVFVRVNUX0JNUFM6CisgICAgICAgICBwbWNMb2cocE1hYywgTE9HVywgRkwoIlBNQzogQk1QUyB0cmFuc2FjdGlvbiBnb2luZyBvbi4gV09XTCByZXF1ZXN0ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAid2lsbCBiZSBidWZmZXJlZCIpKTsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIEJNUFM6CisgICAgICBjYXNlIFdPV0w6CisgICAgICAgICAvKiBUZWxsIE1BQyB0byBoYXZlIGRldmljZSBlbnRlciBXT1dMIG1vZGUuIE5vdGU6IFdlIGFjY2VwdCBXT1dMIHJlcXVlc3QKKyAgICAgICAgICAgIHdoZW4gd2UgYXJlIGluIFdPV0wgbW9kZS4gVGhpcyBhbGxvd3MgSEREIHRvIGNoYW5nZSBXT1dMIGNvbmZpZ3VyYXRpb24KKyAgICAgICAgICAgIHdpdGhvdXQgaGF2aW5nIHRvIGV4aXQgV09XTCBtb2RlICovCisgICAgICAgICBpZiAocG1jSXNzdWVDb21tYW5kKGhIYWwsIGVTbWVDb21tYW5kRW50ZXJXb3dsLCB3b3dsRW50ZXJQYXJhbXMsIHNpemVvZih0U2lyU21lV293bEVudGVyUGFyYW1zKSwgRkFMU0UpICE9CisgICAgICAgICAgICBlSEFMX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgeworICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR0UsIEZMKCJQTUM6IGZhaWx1cmUgdG8gc2VuZCBtZXNzYWdlIGVXTklfUE1DX0VOVEVSX1dPV0xfUkVRIikpOworICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICB9CisgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBSRVFVRVNUX0VOVEVSX1dPV0w6CisgICAgICAgICAvL011bHRpcGxlIGVudGVyIFdPV0wgcmVxdWVzdHMgYXQgdGhlIHNhbWUgdGltZSBhcmUgbm90IGFjY2VwdGVkCisgICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwgRkwoIlBNQzogRW50ZXIgV09XTCB0cmFuc2FjdGlvbiBhbHJlYWR5IGdvaW5nIG9uLiBOZXcgV09XTCByZXF1ZXN0ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAid2lsbCBiZSByZWplY3RlZCIpKTsKKyAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworCisgICAgICBjYXNlIFJFUVVFU1RfRVhJVF9XT1dMOgorICAgICAgICAgcG1jTG9nKHBNYWMsIExPR1csIEZMKCJQTUM6IEV4aXQgV09XTCB0cmFuc2FjdGlvbiBnb2luZyBvbi4gTmV3IFdPV0wgcmVxdWVzdCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIndpbGwgYmUgYnVmZmVyZWQiKSk7CisgICAgICAgICBicmVhazsKKworICAgICAgZGVmYXVsdDoKKyAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dFLCBGTCgiUE1DOiBUcnlpbmcgdG8gZW50ZXIgV09XTCBTdGF0ZSBmcm9tIHN0YXRlICVzIiksCisgICAgICAgICAgICBwbWNHZXRQbWNTdGF0ZVN0cihwTWFjLT5wbWMucG1jU3RhdGUpKTsKKyAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgfQorCisgICByZXR1cm4gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKgorKiBOYW1lOiAgcG1jRW50ZXJXb3dsU3RhdGUKKyoKKyogRGVzY3JpcHRpb246CisqICAgIEhhdmUgdGhlIGRldmljZSBlbnRlciB0aGUgV09XTCBTdGF0ZS4KKyoKKyogUGFyYW1ldGVyczoKKyogICAgaEhhbCAtIEhBTCBoYW5kbGUgZm9yIGRldmljZQorKgorKiBSZXR1cm5zOgorKiAgICBlSEFMX1NUQVRVU19TVUNDRVNTIC0gY2hhbmdpbmcgc3RhdGUgc3VjY2Vzc2Z1bAorKiAgICBlSEFMX1NUQVRVU19GQUlMVVJFIC0gY2hhbmdpbmcgc3RhdGUgbm90IHN1Y2Nlc3NmdWwKKyoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK2VIYWxTdGF0dXMgcG1jRW50ZXJXb3dsU3RhdGUgKHRIYWxIYW5kbGUgaEhhbCkKK3sKKyAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVChoSGFsKTsKKworICAgcG1jTG9nKHBNYWMsIExPRzIsICJQTUM6IGVudGVyaW5nIHBtY0VudGVyV293bFN0YXRlIik7CisKKyAgIC8qIENhbiBlbnRlciBXT1dMIFN0YXRlIG9ubHkgZnJvbSBSZXF1ZXN0IFdPV0wgU3RhdGUuICovCisgICBpZiAocE1hYy0+cG1jLnBtY1N0YXRlICE9IFJFUVVFU1RfRU5URVJfV09XTCApCisgICB7CisgICAgICBwbWNMb2cocE1hYywgTE9HRSwgRkwoIlBNQzogdHJ5aW5nIHRvIGVudGVyIFdPV0wgU3RhdGUgZn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aGFuZGxlIGZvciBkZXZpY2UKKyoKKyogUmV0dXJuczoKKyogICAgZUhBTF9TVEFUVVNfU1VDQ0VTUyAtIEV4aXQgV09XTCBzdWNjZXNzZnVsCisqICAgIGVIQUxfU1RBVFVTX0ZBSUxVUkUgLSBFeGl0IFdPV0wgdW5zdWNjZXNzZnVsCisqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitlSGFsU3RhdHVzIHBtY1JlcXVlc3RFeGl0V293bFN0YXRlKHRIYWxIYW5kbGUgaEhhbCkKK3sKKyAgICB0cEFuaVNpckdsb2JhbCBwTWFjID0gUE1BQ19TVFJVQ1QoaEhhbCk7CisKKyAgICBwbWNMb2cocE1hYywgTE9HMiwgIlBNQzogZW50ZXJpbmcgcG1jUmVxdWVzdEV4aXRXb3dsU3RhdGUiKTsKKworICAgIHN3aXRjaCAocE1hYy0+cG1jLnBtY1N0YXRlKQorICAgIHsKKyAgICAgICAgY2FzZSBXT1dMOgorICAgICAgICAgICAgLyogVGVsbCBNQUMgdG8gaGF2ZSBkZXZpY2UgZXhpdCBXT1dMIG1vZGUuICovCisgICAgICAgICAgICBpZiAocG1jSXNzdWVDb21tYW5kKGhIYWwsIGVTbWVDb21tYW5kRXhpdFdvd2wsIE5VTEwsIDAsIEZBTFNFKSAhPQorICAgICAgICAgICAgICAgIGVIQUxfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR1AsIEZMKCJQTUM6IGZhaWx1cmUgdG8gc2VuZCBtZXNzYWdlIGVXTklfUE1DX0VYSVRfV09XTF9SRVEiKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFJFUVVFU1RfRU5URVJfV09XTDoKKyAgICAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dQLCBGTCgiUE1DOiBSY3ZkIGV4aXQgV09XTCBldmVuIGJlZm9yZSBlbnRlciBXT1dMIHdhcyBjb21wbGV0ZWQiKSk7CisgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR1csIEZMKCJQTUM6IEdvdCBleGl0IFdPV0wgaW4gc3RhdGUgJXMoJWQpLiBOb3RoaW5nIHRvIGRvIGFzIGFscmVhZHkgb3V0IG9mIFdPV0wiKSwKKyAgICAgICAgICAgIHBtY0dldFBtY1N0YXRlU3RyKHBNYWMtPnBtYy5wbWNTdGF0ZSksIHBNYWMtPnBtYy5wbWNTdGF0ZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICByZXR1cm4gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKgorKiBOYW1lOiAgcG1jRG9FbnRlcldvd2xDYWxsYmFja3MKKyoKKyogRGVzY3JpcHRpb246CisqICAgIEludm9rZSBFbnRlciBXT1dMIGNhbGxiYWNrcworKgorKiBQYXJhbWV0ZXJzOgorKiAgICBoSGFsIC0gSEFMIGhhbmRsZSBmb3IgZGV2aWNlCisqCisqIFJldHVybnM6IE5vbmUKKyoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3ZvaWQgcG1jRG9FbnRlcldvd2xDYWxsYmFja3MgKHRIYWxIYW5kbGUgaEhhbCwgZUhhbFN0YXR1cyBjYWxsYmFja1N0YXR1cykKK3sKKyAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVD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gJnBEZWZlcnJlZE1zZy0+dS53b3dsQWRkUGF0dGVybiwgc2l6ZW9mKHRTaXJXb3dsQWRkQmNhc3RQdHJuKSkKKyAgICAgICAgICAgICAgICAgICAgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwgRkwoIlNlbmQgb2YgZVdOSV9QTUNfV09XTF9BRERfQkNBU1RfUFRSTiB0byBQRSBmYWlsZWQiKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVXTklfUE1DX1dPV0xfREVMX0JDQVNUX1BUUk46CisgICAgICAgICAgICBWT1NfQVNTRVJUKCBwRGVmZXJyZWRNc2ctPnNpemUgPT0gc2l6ZW9mKHRTaXJXb3dsRGVsQmNhc3RQdHJuKSApOworICAgICAgICAgICAgaWYgKHBtY1NlbmRNZXNzYWdlKHBNYWMsIGVXTklfUE1DX1dPV0xfREVMX0JDQVNUX1BUUk4sCisgICAgICAgICAgICAgICAgICAgICZwRGVmZXJyZWRNc2ctPnUud293bERlbFBhdHRlcm4sIHNpemVvZih0U2lyV293bERlbEJjYXN0UHRybikpCisgICAgICAgICAgICAgICAgICAgICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR0UsIEZMKCJTZW5kIG9mIGVXTklfUE1DX1dPV0xfQUREX0JDQVNUX1BUUk4gdG8gUEUgZmFpbGVkIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlV05JX1BNQ19QV1JfU0FWRV9DRkc6CisgICAgICAgICAgICBWT1NfQVNTRVJUKCBwRGVmZXJyZWRNc2ctPnNpemUgPT0gc2l6ZW9mKHRTaXJQb3dlclNhdmVDZmcpICk7CisgICAgICAgICAgICBpZiAocG1jU2VuZE1lc3NhZ2UocE1hYywgZVdOSV9QTUNfUFdSX1NBVkVfQ0ZHLAorICAgICAgICAgICAgICAgICAgICAmcERlZmVycmVkTXNnLT51LnBvd2VyU2F2ZUNvbmZpZywgc2l6ZW9mKHRTaXJQb3dlclNhdmVDZmcpKQorICAgICAgICAgICAgICAgICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR0UsIEZMKCJTZW5kIG9mIGVXTklfUE1DX1BXUl9TQVZFX0NGRyB0byBQRSBmYWlsZWQiKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR0UsIEZMKCJ1bmtub3duIG1lc3NhZ2UgKCVkKSIpLCBwRGVmZXJyZWRNc2ctPm1lc3NhZ2VUeXBlKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIC8vTmVlZCB0byBmcmVlIHRoZSBtZW1vcnkgaGVyZQorICAgICAgICB2b3NfbWVtX2ZyZWUocERlZmVycmVkTXNnKTsKKyAgICB9IC8vd2hpbGUKK30KKworCitlSGFsU3RhdHVzIHBtY0RlZmVyTXNnKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UxNiBtZXNzYWdlVHlwZSwgdm9pZCAqcERhdGEsIHRBTklfVTMyIHNpemUpCit7CisgICAgdFBtY0RlZmVycmVkTXNnICpwRGVmZXJyZWRNc2c7CisgICAgZUhhbFN0YXR1cyBzdGF0dXM7CisKKyAgICBwRGVmZXJyZWRNc2cgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodFBtY0RlZmVycmVkTXNnKSk7CisgICAgaWYgKCBOVUxMID09IHBEZWZlcnJlZE1zZyApCisgICAgeworICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwgRkwoIkNhbm5vdCBhbGxvY2F0ZSBtZW1vcnk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hlcmUgdG8gdGFrZSBjYXJlIG9mIGNhbGxiYWNrcyBmb3IKKy8vdGhlIGNvbW1hbmQsIGlmIGFwcGxpY2FibGUuCit2b2lkIHBtY0Fib3J0Q29tbWFuZCggdHBBbmlTaXJHbG9iYWwgcE1hYywgdFNtZUNtZCAqcENvbW1hbmQsIHRBTklfQk9PTEVBTiBmU3RvcHBpbmcgKQoreworICAgIGlmKCBlU21lUG1jQ29tbWFuZE1hc2sgJiBwQ29tbWFuZC0+Y29tbWFuZCApCisgICAgeworICAgICAgICBpZiggIWZTdG9wcGluZyApCisgICAgICAgIHsKKyAgICAgICAgICAgIHN3aXRjaCggcENvbW1hbmQtPmNvbW1hbmQgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgY2FzZSBlU21lQ29tbWFuZEVudGVySW1wczoKKyAgICAgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwgRkwoImFib3J0aW5nIHJlcXVlc3QgdG8gZW50ZXIgSU1QUyIpKTsKKyAgICAgICAgICAgICAgICBwbWNFbnRlckZ1bGxQb3dlclN0YXRlKHBNYWMpOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIGVTbWVDb21tYW5kRXhpdEltcHM6CisgICAgICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR0UsIEZMKCJhYm9ydGluZyByZXF1ZXN0IHRvIGV4aXQgSU1QUyAiKSk7CisgICAgICAgICAgICAgICAgcG1jRW50ZXJGdWxsUG93ZXJTdGF0ZShwTWFjKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBlU21lQ29tbWFuZEVudGVyQm1wczoKKyAgICAgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwgRkwoImFib3J0aW5nIHJlcXVlc3QgdG8gZW50ZXIgQk1QUyAiKSk7CisgICAgICAgICAgICAgICAgcE1hYy0+cG1jLmJtcHNSZXF1ZXN0UXVldWVkID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgICAgIHBtY0VudGVyRnVsbFBvd2VyU3RhdGUocE1hYyk7CisgICAgICAgICAgICAgICAgcG1jRG9CbXBzQ2FsbGJhY2tzKHBNYWMsIGVIQUxfU1RBVFVTX0ZBSUxVUkUpOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIGVTbWVDb21tYW5kRXhpdEJtcHM6CisgICAgICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR0UsIEZMKCJhYm9ydGluZyByZXF1ZXN0IHRvIGV4aXQgQk1QUyAiKSk7CisgICAgICAgICAgICAgICAgcG1jRW50ZXJGdWxsUG93ZXJTdGF0ZShwTWFjKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBlU21lQ29tbWFuZEVudGVyVWFwc2Q6CisgICAgICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR0UsIEZMKCJhYm9ydGluZyByZXF1ZXN0IHRvIGVudGVyIFVBUFNEICIpKTsKKyAgICAgICAgICAgICAgICAvL1NpbmNlIHRoZXJlIGlzIG5vIHJldHJ5IGZvciBVQVBTRCwgdGVsbCB0aGUgcmVxdWVzdGVyIGhlcmUgd2UgYXJlIGRvbmUgd2l0aCBmYWlsdXJlCisgICAgICAgICAgICAgICAgcE1hYy0+cG1jLnVhcHNkU2Vzc2lvblJlcXVpcmVkID0gRkFMU0U7CisgICAgICAgICAgICAgICAgcG1jRG9TdGFydFVhcHNkQ2FsbGJhY2tzKHBNYWMsIGVIQUxfU1RBVFVTX0ZBSUxVUkUpOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIGVTbWVDb21tYW5kRXhpdFVhcHNkOgorICAgICAgICAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dFLCBGTCgiYWJvcnRpbmcgcmVxdWVzdCB0byBleGl0IFVBUFNEICIpKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBlU21lQ29tbWFuZEVudGVyV293bDoKKyAgICAgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwgRkwoImFib3J0aW5nIHJlcXVlc3QgdG8gZW50ZXIgV09XTCAiKSk7CisgICAgICAgICAgICAgICAgcG1jRG9FbnRlcldvd2xDYWxsYmFja3MocE1hYywgZUhBTF9TVEFUVVNfRkFJTFVSRSk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRFeGl0V293bDoKKyAgICAgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwgRkwoImFib3J0aW5nIHJlcXVlc3QgdG8gZXhpdCBXT1dMICIpKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBlU21lQ29tbWFuZEVudGVyU3RhbmRieToKKyAgICAgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwgRkwoImFib3J0aW5nIHJlcXVlc3QgdG8gZW50ZXIgU3RhbmRieSAiKSk7CisgICAgICAgICAgICAgICAgcG1jRG9TdGFuZGJ5Q2FsbGJhY2tzKHBNYWMsIGVIQUxfU1RBVFVTX0ZBSUxVUkUpOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dFLCBGTCgiUmVxdWVzdCBmb3IgUE1DIGNvbW1hbmQgKCVkKSBpcyBkcm9wcGVkIiksIHBDb21tYW5kLT5jb21tYW5kKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfS8vICFzdG9wcGluZworICAgICAgICBwbWNSZWxlYXNlQ29tbWFuZCggcE1hYywgcENvbW1hbmQgKTsKKyAgICB9Cit9CisKKworCisvL1RoZXNlIGNvbW1hbmRzIGFyZSBub3Qgc3VwcG9zZWQgdG8gZmFpbCBkdWUgdG8gb3V0IG9mIGNvbW1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21kLmZSZWxlYXNlV2hlbkRvbmUgPSBGQUxTRTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHBtY0xvZyggcE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgRkwoIiBmYWlsIHRvIGdldCBjb21tYW5kIGJ1ZmZlciBmb3IgY29tbWFuZCAweCVYIGN1clN0YXRlID0gJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgY21kVHlwZSwgcE1hYy0+cG1jLnBtY1N0YXRlICk7CisgICAgICAgICAgICAvL0ZvciBjZXJ0YWluIFBNQyBjb21tYW5kLCB3ZSBjYW5ub3QgZmFpbAorICAgICAgICAgICAgaWYoIFBNQ19JU19DT01NQU5EX0NBTk5PVF9GQUlMKGNtZFR5cGUpICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwbWNMb2coIHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICBGTCgiIGNvbW1hbmQgMHglWCAgY2Fubm90IGZhaWwgdHJ5IGFsbG9jYXRpbmcgbWVtb3J5IGZvciBpdCIpLCBjbWRUeXBlICk7CisgICAgICAgICAgICAgICAgcENvbW1hbmQgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YodFNtZUNtZCkpOworICAgICAgICAgICAgICAgIGlmICggTlVMTCA9PSBwQ29tbWFuZCApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzIGZhaWwgdG8gYWxsb2NhdGUgbWVtb3J5IGZvciBjb21tYW5kICgweCVYKSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBjbWRUeXBlKTsKKyAgICAgICAgICAgICAgICAgICAgcENvbW1hbmQgPSBOVUxMOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgdm9zX21lbV9zZXQocENvbW1hbmQsIHNpemVvZih0U21lQ21kKSwgMCk7CisgICAgICAgICAgICAgICAgLy9NYWtlIHN1cmUgaXQgd2lsbCBiZSBmcmVlIHdoZW4gaXQgaXMgZG9uZQorICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnBtY0NtZC5mUmVsZWFzZVdoZW5Eb25lID0gVFJVRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBwQ29tbWFuZC0+Y29tbWFuZCA9IGNtZFR5cGU7CisgICAgICAgIHBDb21tYW5kLT51LnBtY0NtZC5zaXplID0gc2l6ZTsKKyAgICAgICAgLy9Jbml0aWFsaXplIHRoZSByZWFzb24gY29kZSBoZXJlLiBJdCBtYXkgYmUgb3ZlcndyaXR0ZW4gbGF0ZXIgd2hlbgorICAgICAgICAvL2EgcGFydGljdWxhciByZWFzb24gaXMgbmVlZGVkLgorICAgICAgICBwQ29tbWFuZC0+dS5wbWNDbWQuZnVsbFBvd2VyUmVhc29uID0gZVNNRV9SRUFTT05fT1RIRVI7CisgICAgICAgIHN3aXRjaCAoIGNtZFR5cGUgKQorICAgICAgICB7CisgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRFbnRlckltcHM6CisgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRFeGl0SW1wczoKKyAgICAgICAgY2FzZSBlU21lQ29tbWFuZEVudGVyQm1wczoKKyAgICAgICAgY2FzZSBlU21lQ29tbWFuZEVudGVyVWFwc2Q6CisgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRFbnRlclN0YW5kYnk6CisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlU21lQ29tbWFuZEV4aXRVYXBzZDoKKyAgICAgICAgY2FzZSBlU21lQ29tbWFuZEV4aXRXb3dsOgorICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgIGlmKCBwdlBhcmFtICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwQ29tbWFuZC0+dS5wbWNDbWQuZnVsbFBvd2VyUmVhc29uID0gKiggKHRSZXF1ZXN0RnVsbFBvd2VyUmVhc29uICopcHZQYXJhbSApOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlU21lQ29tbWFuZEV4aXRCbXBzOgorICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgIGlmKCBwdlBhcmFtICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwQ29tbWFuZC0+dS5wbWNDbWQudS5leGl0Qm1wc0luZm8gPSAqKCAodEV4aXRCbXBzSW5mbyAqKXB2UGFyYW0gKTsKKyAgICAgICAgICAgICAgICBwQ29tbWFuZC0+dS5wbWNDbWQuZnVsbFBvd2VyUmVhc29uID0gcENvbW1hbmQtPnUucG1jQ21kLnUuZXhpdEJtcHNJbmZvLmV4aXRCbXBzUmVhc29uOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBtY0xvZyggcE1hYywgTE9HRSwgKCIgZXhpdCBCTVBTIG11c3QgaGF2ZSBhIHJlYXNvbiBjb2RlIikgKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRFbnRlcldvd2w6CisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgaWYoIHB2UGFyYW0gKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnBtY0NtZC51LmVudGVyV293bEluZm8gPSAqKCAoIHRTaXJTbWVXb3dsRW50ZXJQYXJhbXMgKiApcHZQYXJhbSApOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIHBtY0xvZyggcE1hYywgTE9HRSwgRkwoIiAgaW52YWxpZCBjb21tYW5kIHR5cGUgJWQiKSwgY21kVHlwZSApOworICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfSU5WQUxJRF9QQVJBTUVURVI7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgfSB3aGlsZSggMCApOworCisgICAgaWYoIEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgJiYgcENvbW1hbmQgKQorICAgIHsKKyAgICAgICAgKnBwQ21kID0gcENvbW1hbmQ7CisgICAgfQorICAgIGVsc2UgaWYoIHBDb21tYW5kICkKKyAgICB7CisgICAgICAgIHBtY1JlbGVhc2VDb21tYW5kKCBwTWFjLCBwQ29tbWFuZCApOworICAgIH0KKworICAgIHJldHVybiAoc3RhdHVzKTsKK30KKworCitlSGFsU3RhdHVzIHBtY0lzc3VlQ29tbWFuZCggdHBBbmlTaXJHbG9iYWwgcE1hYywgZVNtZUNvbW1hbmRUeXBlIGNtZFR5cGUsIHZvaWQgKnB2UGFyYW0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgc2l6ZSwgdEFOSV9CT09MRUFOIGZQdXRUb0xpc3RIZWFkICkKK3sKKyAgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1JFU09VUkNFUzsKKyAgICB0U21lQ21kICpwQ29tbWFuZCA9IE5VTEw7CisKKyAgICBzdGF0dXMgPSBwbWNQcmVwYXJlQ29tbWFuZCggcE1hYywgY21kVHlwZSwgcHZQYXJhbSwgc2l6ZSwgJnBDb21tYW5kICk7CisgICAgaWYoIEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgJiYgcENvbW1hbmQgKQorICAgIHsKKyAgICAgICAgc21lUHVzaENvbW1hbmQoIHBNYWMsIHBDb21tYW5kLCBmUHV0VG9MaXN0SGVhZCApOworICAgIH0KKyAgICBlbHNlIGlmKCBwQ29tbWFuZCApCisgICAgeworICAgICAgICBwbWNSZWxlYXNlQ29tbWFuZCggcE1hYywgcENvbW1hbmQgKTsKKyAgICB9CisKKyAgICByZXR1cm4oIHN0YXR1cyApOworfQorCisKKwordEFOSV9CT09MRUFOIHBtY1Byb2Nlc3NDb21tYW5kKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0U21lQ21kICpwQ29tbWFuZCApCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIHRBTklfQk9PTEVBTiBmUmVtb3ZlQ21kID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgcG1jTG9nKHBNYWMsIExPRzEsIEZMKCJQTUMgY29tbWFuZCBpcyAweCV4IiksIHBDb21tYW5kLT5jb21tYW5kKTsKKyAgICBkbworICAgIHsKKyAgICAgICAgc3dpdGNoICggcENvbW1hbmQtPmNvbW1hbmQgKQorICAgICAgICB7CisgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRFbnRlckltcHM6CisgICAgICAgICAgICBpZiggRlVMTF9QT1dFUiA9PSBwTWFjLT5wbWMucG1jU3RhdGUgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0YXR1cyA9IHBtY0VudGVySW1wc0NoZWNrKCBwTWFjICk7CisgICAgICAgICAgICAgICAgaWYoIEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogQ2hhbmdlIHN0YXRlLiAqLworICAgICAgICAgICAgICAgICAgICBwTWFjLT5wbWMucG1jU3RhdGUgPSBSRVFVRVNUX0lNUFM7CisgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IHBtY1NlbmRNZXNzYWdlKHBNYWMsIGVXTklfUE1DX0VOVEVSX0lNUFNfUkVRLCBOVUxMLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgaWYoIEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvKiBJZiB3ZSBhbHJlYWR5IHdlbnQgYmFjayBGdWxsIFBvd2VyIFN0YXRlIChtZWFuaW5nIHRoYXQgcmVxdWVzdCBkaWQgbm90CisgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXQgYXMgZmFyIGFzIHRoZSBkZXZpY2UpIHRoZW4gd2UgYXJlIG5vdCBzdWNjZXNzZnVsbC4gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICggRlVMTF9QT1dFUiAhPSBwTWFjLT5wbWMucG1jU3RhdGUgKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZSZW1vdmVDbWQgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYoICFIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIlBNQzogZmFpbHVyZSB0byBzZW5kIG1lc3NhZ2UgZVdOSV9QTUNfRU5URVJfSU1QU19SRVEgb3IgcG1jRW50ZXJJbXBzQ2hlY2sgZmFpbGVkIik7CisgICAgICAgICAgICAgICAgICAgIHBtY0VudGVyRnVsbFBvd2VyU3RhdGUoIHBNYWMgKTsKKyAgICAgICAgICAgICAgICAgICAgaWYocG1jU2hvdWxkQm1wc1RpbWVyUnVuKHBNYWMpKQorICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQpcG1jU3RhcnRUcmFmZmljVGltZXIocE1hYywgcE1hYy0+cG1jLmJtcHNDb25maWcudHJhZmZpY01lYXN1cmVQZXJpb2QpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0vL2Z1bGxfcG93ZXIKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRFeGl0SW1wczoKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB0UG1jU3RhdGUgb3JpZ1N0YXRlID0gcE1hYy0+cG1jLnBtY1N0YXRlOworICAgICAgICAgICAgICAgIHBNYWMtPnBtYy5yZXF1ZXN0RnVsbFBvd2VyUGVuZGluZyA9IEZBTFNFOworICAgICAgICAgICAgICAgIGlmKCAoIElNUFMgPT0gcE1hYy0+cG1jLnBtY1N0YXRlICkgfHwgKCBTVEFOREJZID09IHBNYWMtPnBtYy5wbWNTdGF0ZSApICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vQ2hlY2sgc3RhdGUgYmVmb3JlIHNlbmRpbmcgbWVzc2FnZS4gVGhlIHN0YXRlIG1heSBjaGFuZ2UgYWZ0ZXIgdGhhdAorICAgICAgICAgICAgICAgICAgICBpZiggU1RBTkRCWSA9PSBwTWFjLT5wbWMucG1jU3RhdGUgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvL0VuYWJsZSBJZGxlIHNjYW4gaW4gQ1NSCisgICAgICAgICAgICAgICAgICAgICAgICBjc3JTY2FuUmVzdW1lSU1QUyhwTWFjKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIHBNYWMtPnBtYy5wbWNTdGF0ZSA9IFJFUVVFU1RfRlVMTF9QT1dFUjsKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gcG1jU2VuZE1lc3NhZ2UocE1hYywgZVdOSV9QTUNfRVhJVF9JTVBTX1JFUSwgTlVMTCwgMCk7CisgICAgICAgICAgICAgICAgICAgIGlmICggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0cxLCBGTCgiZVdOSV9QTUNfRVhJVF9JTVBTX1JFUSBzZW50IHRvIFBFIikpOworICAgICAgICAgICAgICAgICAgICAgICAgZlJlbW92ZUNtZCA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnBtYy5wbWNTdGF0ZSA9IG9yaWdTdGF0ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJlV05JX1BNQ19FWElUX0lNUFNfUkVRIGZhaWwgdG8gYmUgc2VudCB0byBQRSBzdGF0dXMgJWQiKSwgc3RhdHVzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vQ2FsbGJhY2tzIGFyZSBjYWxsZWQgd2l0aCBzdWNjZXNzIHNyYXJ1cywgZG8gd2UgbmVlZCB0byBwYXNzIGluIHJlYWwgc3RhdHVzPz8KKyAgICAgICAgICAgICAgICAgICAgICAgIHBtY0VudGVyRnVsbFBvd2VyU3RhdGUocE1hYyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIGVTbWVDb21tYW5kRW50ZXJCbXBzOgorICAgICAgICAgICAgaWYoIEZVTExfUE9XRVIgPT0gcE1hYy0+cG1jLnBtY1N0YXRlICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvL1RoaXMgZnVuY3Rpb24gd2lsbCBub3QgcmV0dXJuIHN1Y2Nlc3MgYmVjYXVzZSB0aGUgcG1jIHN0YXRlIGlzIG5vdCBCTVBTCisgICAgICAgICAgICAgICAgc3RhdHVzID0gcG1jRW50ZXJCbXBzQ2hlY2soIHBNYWMgKTsKKyAgICAgICAgICAgICAgICBpZiggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBDaGFuZ2UgUE1DIHN0YXRlICovCisgICAgICAgICAgICAgICAgICAgIHBNYWMtPnBtYy5wbWNTdGF0ZSA9IFJFUVVFU1RfQk1QUzsKKyAgICAgICAgICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPRzEsICJQTUM6IEVudGVyIEJNUFMgcmVxIGRvbmUiKTsKKworICAgICAgICAgICAgICAgICAgICAvKiBUZWxsIE1BQyB0byBoYXZlIGRldmljZSBlbnRlciBCTVBTIG1vZGUuICovCisgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IHBtY1NlbmRNZXNzYWdlKHBNYWMsIGVXTklfUE1DX0VOVEVSX0JNUFNfUkVRLCBOVUxMLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCBIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZlJlbW92ZUNtZCA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dFLCAiRmFpbCB0byBzZW5kIGVudGVyIEJNUFMgbXNnIHRvIFBFIik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYoICFIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIlBNQzogZmFpbHVyZSB0byBzZW5kIG1lc3NhZ2UgZVdOSV9QTUNfRU5URVJfQk1QU19SRVEgc3RhdHVzICVkIiwgc3RhdHVzKTsKKyAgICAgICAgICAgICAgICAgICAgcE1hYy0+cG1jLmJtcHNSZXF1ZXN0UXVldWVkID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgICAgICAgICBwbWNFbnRlckZ1bGxQb3dlclN0YXRlKHBNYWMpOworICAgICAgICAgICAgICAgICAgICAvL0RvIG5vdCBjYWxsIFVBUFNEIGNhbGxiYWNrIGhlcmUgc2luY2UgaXQgbWF5IGJlIHJldHJpZWQKKyAgICAgICAgICAgICAgICAgICAgcG1jRG9CbXBzQ2FsbGJhY2tzKHBNYWMsIGVIQUxfU1RBVFVTX0ZBSUxVUkUpOworICAgICAgICAgICAgICAgICAgICBpZihwbWNTaG91bGRCbXBzVGltZXJSdW4ocE1hYykpCisgICAgICAgICAgICAgICAgICAgICAgICAodm9pZClwbWNTdGFydFRyYWZmaWNUaW1lcihwTWFjLCBwTWFjLT5wbWMuYm1wc0NvbmZpZy50cmFmZmljTWVhc3VyZVBlcmlvZCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlU21lQ29tbWFuZEV4aXRCbXBzOgorICAgICAgICAgICAgaWYgKChCTVBTID09IHBNYWMtPnBtYy5wbWNTdGF0ZSkgfHwgKFVBUFNEID09IHBNYWMtPnBtYy5wbWNTdGF0ZSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdFBtY1N0YXRlIG9yaWdTdGF0ZSA9IHBNYWMtPnBtYy5wbWNTdGF0ZTsKKyAgICAgICAgICAgICAgICBwTWFjLT5wbWMucmVxdWVzdEZ1bGxQb3dlclBlbmRpbmcgPSBGQUxTRTsKKyAgICAgICAgICAgICAgICAvKiBDaGFuZ2UgUE1DIHN0YXRlICovCisgICAgICAgICAgICAgICAgcE1hYy0+cG1jLnBtY1N0YXRlID0gUkVRVUVTVF9GVUxMX1BPV0VSOworICAgICAgICAgICAgICAgIHN0YXR1cyA9IHBtY1NlbmRNZXNzYWdlKCBwTWFjLCBlV05JX1BNQ19FWElUX0JNUFNfUkVRLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwQ29tbWFuZC0+dS5wbWNDbWQudS5leGl0Qm1wc0luZm8sIHNpemVvZih0RXhpdEJtcHNJbmZvKSApOworICAgICAgICAgICAgICAgIGlmICggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBmUmVtb3ZlQ21kID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HMSwgRkwoImVXTklfUE1DX0VYSVRfQk1QU19SRVEgc2VudCB0byBQRSIpKTsKKworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwTWFjLT5wbWMucG1jU3RhdGUgPSBvcmlnU3RhdGU7CisgICAgICAgICAgICAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dFLCBGTCgiZVdOSV9QTUNfRVhJVF9CTVBTX1JFUSBmYWlsIHRvIGJlIHNlbnQgdG8gUEUgc3RhdHVzICVkIiksIHN0YXR1cyk7CisgICAgICAgICAgICAgICAgICAgIHBtY0VudGVyRnVsbFBvd2VyU3RhdGUocE1hYyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBlU21lQ29tbWFuZEVudGVyVWFwc2Q6CisgICAgICAgICAgICBpZiggQk1QUyA9PSBwTWFjLT5wbWMucG1jU3RhdGUgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBNYWMtPnBtYy51YXBzZFNlc3Npb25SZXF1aXJlZCA9IFRSVUU7CisgICAgICAgICAgICAgICAgLyogQ2hhbmdlIFBNQyBzdGF0ZSAqLworICAgICAgICAgICAgICAgIHBNYWMtPnBtYy5wbWNTdGF0ZSA9IFJFUVVFU1RfU1RBUlRfVUFQU0Q7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gcG1jU2VuZE1lc3NhZ2UocE1hYywgZVdOSV9QTUNfRU5URVJfVUFQU0RfUkVRLCBOVUxMLCAwKTsKKyAgICAgICAgICAgICAgICBpZiAoIEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgZlJlbW92ZUNtZCA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcE1hYy0+cG1jLnBtY1N0YXRlID0gQk1QUzsKKyAgICAgICAgICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR0UsICJQTUM6IGZhaWx1cmUgdG8gc2VuZCBtZXNzYWdlICIKKyAgICAgICAgICAgICAgICAgICAgICAgImVXTklfUE1DX0VOVEVSX0JNUFNfUkVRIik7CisgICAgICAgICAgICAgICAgICAgIC8vdGhlcmUgaXMgbm8gcmV0cnkgZm9yIHJlLWVudGVyaW5nIFVBUFNEIHNvIHRlbGwgdGhlIHJlcXVlc3RlciB3ZSBhcmUgZG9uZSB3aXRnaCBmYWlsdXJlLgorICAgICAgICAgICAgICAgICAgICBwTWFjLT5wbWMudWFwc2RTZXNzaW9uUmVxdWlyZWQgPSBGQUxTRTsKKyAgICAgICAgICAgICAgICAgICAgcG1jRG9TdGFydFVhcHNkQ2FsbGJhY2tzKHBNYWMsIGVIQUxfU1RBVFVTX0ZBSUxVUkUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRFeGl0VWFwc2Q6CisgICAgICAgICAgIGlmKCBVQVBTRCA9PSBwTWFjLT5wbWMucG1jU3RhdGUgKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBwTWFjLT5wbWMucmVxdWVzdEZ1bGxQb3dlclBlbmRpbmcgPSBGQUxTRTsKKyAgICAgICAgICAgICAgICAvKiBJZiBhbHJlYWR5IGluIFJFUVVFU1RfU1RPUF9VQVBTRCwgc2ltcGx5IHJldHVybiAqLworICAgICAgICAgICAgICAgaWYgKHBNYWMtPnBtYy5wbWNTdGF0ZSA9PSBSRVFVRVNUX1NUT1BfVUFQU0QpCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgIC8qIENoYW5nZSBzdGF0ZS4gTm90ZSB0aGF0IGRldmljZSB3aWxsIGJlIHB1dCBpbiBCTVBTIHN0YXRlIGF0IHRoZQorICAgICAgICAgICAgICAgICAgZW5kIG9mIFJFUVVFU1RfU1RPUF9VQVBTRCBzdGF0ZSBldmVuIGlmIHJlc3BvbnNlIGlzIGEgZmFpbHVyZSovCisgICAgICAgICAgICAgICBwTWFjLT5wbWMucG1jU3RhdGUgPSBSRVFVRVNUX1NUT1BfVUFQU0Q7CisgICAgICAgICAgICAgICAvKiBUZWxsIE1BQyB0byBoYXZlIGRldmljZSBleGl0IFVBUFNEIG1vZGUuICovCisgICAgICAgICAgICAgICBzdGF0dXMgPSBwbWNTZW5kTWVzc2FnZShwTWFjLCBlV05JX1BNQ19FWElUX1VBUFNEX1JFUSwgTlVMTCwgMCk7CisgICAgICAgICAgICAgICBpZiAoIEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIHBNYWMtPnBtYy5yZXF1ZXN0RnVsbFBvd2VyUGVuZGluZyA9IFRSVUU7CisgICAgICAgICAgICAgICAgICAgcE1hYy0+cG1jLnJlcXVlc3RGdWxsUG93ZXJSZWFzb24gPSBwQ29tbWFuZC0+dS5wbWNDbWQuZnVsbFBvd2VyUmVhc29uOworICAgICAgICAgICAgICAgICAgIGZSZW1vdmVDbWQgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgcE1hYy0+cG1jLnBtY1N0YXRlID0gVUFQU0Q7CisgICAgICAgICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR0UsICJQTUM6IGZhaWx1cmUgdG8gc2VuZCBtZXNzYWdlICIKKyAgICAgICAgICAgICAgICAgICAgICAiZVdOSV9QTUNfRVhJVF9VQVBTRF9SRVEiKTsKKyAgICAgICAgICAgICAgICAgICBwbWNFbnRlckJtcHNTdGF0ZShwTWFjKTsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgfQorCisgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRFbnRlcldvd2w6CisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHRQbWNTdGF0ZSBvcmlnU3RhdGUgPSBwTWFjLT5wbWMucG1jU3RhdGU7CisgICAgICAgICAgICAgICBpZiggKCBCTVBTID09IHBNYWMtPnBtYy5wbWNTdGF0ZSApIHx8ICggV09XTCA9PSBwTWFjLT5wbWMucG1jU3RhdGUgKSApCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgcE1hYy0+cG1jLnBtY1N0YXRlID0gUkVRVUVTVF9FTlRFUl9XT1dMOworICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IHBtY1NlbmRNZXNzYWdlKHBNYWMsIGVXTklfUE1DX0VOVEVSX1dPV0xfUkVRLAorICAgICAgICAgICAgICAgICAgICAgICAgICAmcENvbW1hbmQtPnUucG1jQ21kLnUuZW50ZXJXb3dsSW5mbywgc2l6ZW9mKHRTaXJTbWVXb3dsRW50ZXJQYXJhbXMpKTsKKyAgICAgICAgICAgICAgICAgICBpZiAoIEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgZlJlbW92ZUNtZCA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+cG1jLnBtY1N0YXRlID0gb3JpZ1N0YXRlOworICAgICAgICAgICAgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJQTUM6IGZhaWx1cmUgdG8gc2VuZCBtZXNzYWdlIGVXTklfUE1DX0VOVEVSX1dPV0xfUkVRIGluIHN0YXRlICVkIiwgb3JpZ1N0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgcG1jRG9FbnRlcldvd2xDYWxsYmFja3MocE1hYywgZUhBTF9TVEFUVVNfRkFJTFVSRSk7CisgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIGZSZW1vdmVDbWQgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICB9CisgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRFeGl0V293bDoKKyAgICAgICAgICAgIGlmKCBXT1dMID09IHBNYWMtPnBtYy5wbWNTdGF0ZSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcE1hYy0+cG1jLnJlcXVlc3RGdWxsUG93ZXJQZW5kaW5nID0gRkFMU0U7CisgICAgICAgICAgICAgICAgcE1hYy0+cG1jLnBtY1N0YXRlID0gUkVRVUVTVF9FWElUX1dPV0w7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gcG1jU2VuZE1lc3NhZ2UocE1hYywgZVdOSV9QTUNfRVhJVF9XT1dMX1JFUSwgTlVMTCwgMCk7CisgICAgICAgICAgICAgICAgaWYgKCBIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGZSZW1vdmVDbWQgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgICAgICAgICAgICAgIHBNYWMtPnBtYy5yZXF1ZXN0RnVsbFBvd2VyUGVuZGluZyA9IFRSVUU7CisgICAgICAgICAgICAgICAgICAgIHBNYWMtPnBtYy5yZXF1ZXN0RnVsbFBvd2VyUmVhc29uID0gcENvbW1hbmQtPnUucG1jQ21kLmZ1bGxQb3dlclJlYXNvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcE1hYy0+cG1jLnBtY1N0YXRlID0gV09XTDsKKyAgICAgICAgICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR1AsICJQTUM6IGZhaWx1cmUgdG8gc2VuZCBtZXNzYWdlIGVXTklfUE1DX0VYSVRfV09XTF9SRVEiKTsKKyAgICAgICAgICAgICAgICAgICAgcG1jR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cnRlZChwTWFjKSkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICAgICJXTEFOOiBJQlNTIG9yIEJULUFNUCBzZXNzaW9uIHByZXNlbnQuIENhbm5vdCBob25vciBzdGFuZGJ5IHJlcXVlc3QiKTsKKworICAgICAgICAgICAgICAgICAgcG1jRG9TdGFuZGJ5Q2FsbGJhY2tzKHBNYWMsIGVIQUxfU1RBVFVTX1BNQ19OT1RfTk9XKTsKKyAgICAgICAgICAgICAgICAgIGlmKHBtY1Nob3VsZEJtcHNUaW1lclJ1bihwTWFjKSkKKyAgICAgICAgICAgICAgICAgICAgICAodm9pZClwbWNTdGFydFRyYWZmaWNUaW1lcihwTWFjLCBwTWFjLT5wbWMuYm1wc0NvbmZpZy50cmFmZmljTWVhc3VyZVBlcmlvZCk7CisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8vIFN0b3AgdHJhZmZpYyB0aW1lci4gSnVzdCBtYWtpbmcgc3VyZSB0aW1lciBpcyBub3QgcnVubmluZworICAgICAgICAgICAgICAgIHBtY1N0b3BUcmFmZmljVGltZXIocE1hYyk7CisKKyAgICAgICAgICAgICAgICAvKiBDaGFuZ2Ugc3RhdGUuICovCisgICAgICAgICAgICAgICAgcE1hYy0+cG1jLnBtY1N0YXRlID0gUkVRVUVTVF9TVEFOREJZOworCisgICAgICAgICAgICAgICAgLyogVGVsbCBNQUMgdG8gaGF2ZSBkZXZpY2UgZW50ZXIgU1RBTkRCWSBtb2RlLiBXZSBhcmUgdXNpbmcgdGhlIHNhbWUgbWVzc2FnZQorICAgICAgICAgICAgICAgICAgYXMgSU1QUyBtb2RlIHRvIGF2b2lkIGNvZGUgY2hhbmdlcyBpbiBsYXllciBiZWxvdyAoUEUvSEFMKSovCisgICAgICAgICAgICAgICAgc3RhdHVzID0gcG1jU2VuZE1lc3NhZ2UocE1hYywgZVdOSV9QTUNfRU5URVJfSU1QU19SRVEsIE5VTEwsIDApOworICAgICAgICAgICAgICAgIGlmICggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvL0Rpc2FibGUgSWRsZSBzY2FuIGluIENTUgorICAgICAgICAgICAgICAgICAgICBjc3JTY2FuU3VzcGVuZElNUFMocE1hYyk7CisgICAgICAgICAgICAgICAgICAgIGZSZW1vdmVDbWQgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dFLCAiUE1DOiBmYWlsdXJlIHRvIHNlbmQgbWVzc2FnZSAiCisgICAgICAgICAgICAgICAgICAgICAgICAiZVdOSV9QTUNfRU5URVJfSU1QU19SRVEiKTsKKyAgICAgICAgICAgICAgICAgICAgcE1hYy0+cG1jLnBtY1N0YXRlID0gRlVMTF9QT1dFUjsKKyAgICAgICAgICAgICAgICAgICAgcG1jRW50ZXJGdWxsUG93ZXJTdGF0ZShwTWFjKTsKKyAgICAgICAgICAgICAgICAgICAgcG1jRG9TdGFuZGJ5Q2FsbGJhY2tzKHBNYWMsIGVIQUxfU1RBVFVTX0ZBSUxVUkUpOworICAgICAgICAgICAgICAgICAgICAvKiBTdGFydCB0aGUgdGltZXIgb25seSBpZiBBdXRvIEJNUFMgZmVhdHVyZSBpcyBlbmFibGVkIG9yIGFuIFVBUFNEIHNlc3Npb24gaXMKKyAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVkICovCisgICAgICAgICAgICAgICAgICAgIGlmKHBtY1Nob3VsZEJtcHNUaW1lclJ1bihwTWFjKSkKKyAgICAgICAgICAgICAgICAgICAgIC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nkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIE5hbWU6ICBwbWNBcGkuYworKgorKiBEZXNjcmlwdGlvbjogUm91dGluZXMgdGhhdCBtYWtlIHVwIHRoZSBQb3dlciBNYW5hZ2VtZW50IENvbnRyb2wgKFBNQykgQVBJLgorKgorKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaW5jbHVkZSAicGFsVHlwZXMuaCIKKyNpbmNsdWRlICJhbmlHbG9iYWwuaCIKKyNpbmNsdWRlICJwYWxUaW1lci5oIgorI2luY2x1ZGUgImNzckxpbmtMaXN0LmgiCisjaW5jbHVkZSAic21zRGVidWcuaCIKKyNpbmNsdWRlICJzbWVfVHJhY2UuaCIKKyNpbmNsdWRlICJwbWNBcGkuaCIKKyNpbmNsdWRlICJwbWMuaCIKKyNpbmNsdWRlICJjZmdBcGkuaCIKKyNpbmNsdWRlICJzbWVJbnNpZGUuaCIKKyNpbmNsdWRlICJjc3JJbnNpZGVBcGkuaCIKKyNpbmNsdWRlICJ3bGFuX3BzX3dvd19kaWFnLmgiCisjaW5jbHVkZSAid2xhbl9xY3Rfd2RhLmgiCisjaW5jbHVkZSAibGltU2Vzc2lvblV0aWxzLmgiCisjaW5jbHVkZSAiY3NySW5zaWRlQXBpLmgiCisKK2V4dGVybiB2b2lkIHBtY1JlbGVhc2VDb21tYW5kKCB0cEFuaVNpckdsb2JhbCBwTWFjLCB0U21lQ21kICpwQ29tbWFuZCApOworCit2b2lkIHBtY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KQorICAgIHsKKyAgICAgICAgaWYgKHBNYWMtPnBtYy5zbXBzQ29uZmlnLm1vZGUgPT0gZVBNQ19EWU5BTUlDX1NNUFMpCisgICAgICAgICAgICBodE1pbW9Qb3dlclNhdmVTdGF0ZSA9IGVTSVJfSFRfTUlNT19QU19EWU5BTUlDOworICAgICAgICBpZiAocE1hYy0+cG1jLnNtcHNDb25maWcubW9kZSA9PSBlUE1DX1NUQVRJQ19TTVBTKQorICAgICAgICAgICAgaHRNaW1vUG93ZXJTYXZlU3RhdGUgPSBlU0lSX0hUX01JTU9fUFNfU1RBVElDOworICAgIH0KKyAgICBlbHNlCisgICAgICAgIGh0TWltb1Bvd2VyU2F2ZVN0YXRlID0gZVNJUl9IVF9NSU1PX1BTX05PX0xJTUlUOworICAgIAorICAgIGlmIChwbWNTZW5kTWVzc2FnZShoSGFsLCBlV05JX1BNQ19TTVBTX1NUQVRFX0lORCwgJmh0TWltb1Bvd2VyU2F2ZVN0YXRlLAorICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0hUTUlNT1Bvd2VyU2F2ZVN0YXRlKSkgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisKKyNpZiBkZWZpbmVkKEFOSV9MT0dEVU1QKQorICAgIHBtY0R1bXBJbml0KGhIYWwpOworI2VuZGlmCisKKyAgICByZXR1cm4gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKK30KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIE5hbWU6ICBwbWNTdG9wCisqCisqIERlc2NyaXB0aW9uOgorKiAgICBEb2VzIGEgUE1DIHN0b3Agb3BlcmF0aW9uIG9uIHRoZSBkZXZpY2UuCisqCisqIFBhcmFtZXRlcnM6CisqICAgIGhIYWwgLSBIQUwgaGFuZGxlIGZ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NfU1VDQ0VTUzsKKyNlbmRpZiAvL0dFTjZfT05XQVJEUworICAgIGRlZmF1bHQ6CisgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dFLCBGTCgiSW52YWxpZCBldmVudCAlZCIpLCBldmVudCk7CisgICAgICAgIFBNQ19BQk9SVDsKKyAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgfQorfQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogTmFtZTogIHBtY1NldENvbmZpZ1Bvd2VyU2F2ZQorKgorKiBEZXNjcmlwdGlvbjoKKyogICAgQ29uZmlndXJlcyBvbmUgb2YgdGhlIHBvd2VyIHNhdmluZyBtb2Rlcy4KKyoKKyogUGFyYW1ldGVyczoKKyogICAgaEhhbCAtIEhBTCBoYW5kbGUgZm9yIGRldmljZQorKiAgICBwc01vZGUgLSB0aGUgcG93ZXIgc2F2aW5nIG1vZGUgdG8gY29uZmlndXJlCisqICAgIHBDb25maWdQYXJhbXMgLSBwb2ludGVyIHRvIGNvbmZpZ3VyYXRpb24gcGFyYW1ldGVycyBzcGVjaWZpYyB0byB0aGUKKyogICAgICAgICAgICAgICAgICAgIHBvd2VyIHNhdmluZyBtb2RlCisqCisqIFJldHVybnM6CisqICAgIGVIQUxfU1RBVFVTX1NVQ0NFU1MgLSBjb25maWd1cmF0aW9uIHN1Y2Nlc3NmdWwKKyogICAgZUhBTF9TVEFUVVNfRkFJTFVSRSAtIGNvbmZpZ3VyYXRpb24gbm90IHN1Y2Nlc3NmdWwKKyoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK2VIYWxTdGF0dXMgcG1jU2V0Q29uZmlnUG93ZXJTYXZlICh0SGFsSGFuZGxlIGhIYWwsIHRQbWNQb3dlclNh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lndXJhdGlvbiIpKTsKKyAgICAgICAgcG1jTG9nKHBNYWMsIExPRzMsICIgICAgICAgICAgZW50ZXIgb24gQUM6ICVkIiwKKyAgICAgICAgICAgICAgIHBNYWMtPnBtYy5ibXBzQ29uZmlnLmVudGVyT25BYyk7CisgICAgICAgIHBtY0xvZyhwTWFjLCBMT0czLCAiICAgICAgICAgIFRYIHRocmVzaG9sZDogJWQiLAorICAgICAgICAgICAgICAgcE1hYy0+cG1jLmJtcHNDb25maWcudHhUaHJlc2hvbGQpOworICAgICAgICBwbWNMb2cocE1hYywgTE9HMywgIiAgICAgICAgICBSWCB0aHJlc2hvbGQ6ICVkIiwKKyAgICAgICAgICAgICAgIHBNYWMtPnBtYy5ibXBzQ29uZmlnLnJ4VGhyZXNob2xkKTsKKyAgICAgICAgcG1jTG9nKHBNYWMsIExPRzMsICIgICAgICAgICAgdHJhZmZpYyBtZWFzdXJlbWVudCBwZXJpb2QgKG1zKTogJWQiLAorICAgICAgICAgICAgICAgcE1hYy0+cG1jLmJtcHNDb25maWcudHJhZmZpY01lYXN1cmVQZXJpb2QpOworICAgICAgICBwbWNMb2cocE1hYywgTE9HMywgIiAgICAgICAgICBCTVBTIHBlcmlvZDogJWQiLAorICAgICAgICAgICAgICAgcE1hYy0+cG1jLmJtcHNDb25maWcuYm1wc1BlcmlvZCk7CisgICAgICAgIHBtY0xvZyhwTWFjLCBMT0czLCAiICAgICAgICAgIGJlYWNvbnMgdG8gZm9yd2FyZCBjb2RlOiAlZCIsCisgICAgICAgICAgICAgICBwTWFjLT5wbWMuYm1wc0NvbmZpZy5mb3J3YXJkQmVhY29ucyk7CisgICAgICAgIHBtY0xvZyhwTWFjLCBMT0czLCAiICAgICAgICAgIHZhbHVlIG9mIE46ICVkIiwKKyAgICAgICAgICAgICAgIHBNYWMtPnBtYy5ibXBzQ29uZmlnLnZhbHVlT2ZOKTsKKyAgICAgICAgcG1jTG9nKHBNYWMsIExPRzMsICIgICAgICAgICAgdXNlIFBTIHBv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ndXJlZAorICAgIC8vYW5kIHBtY1JlYWR5IGhhcyBiZWVuIGludm9rZWQKKyAgICBpZihQTUNfSVNfUkVBRFkocE1hYykgJiYgcHNNb2RlID09IGVQTUNfQkVBQ09OX01PREVfUE9XRVJfU0FWRSkKKyAgICB7CisgICAgICAgaWYgKHBtY1NlbmRQb3dlclNhdmVDb25maWdNZXNzYWdlKGhIYWwpICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIH0KKworICAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIE5hbWU6ICBwbWNHZXRDb25maWdQb3dlclNhdmUKKyoKKyogRGVzY3JpcHRpb246CisqICAgIEdldCB0aGUgY29uZmlnIGZvciB0aGUgc3BlY2lmaWVkIHBvd2VyIHNhdmUgbW9kZQorKgorKiBQYXJhbWV0ZXJzOgorKiAgICBoSGFsIC0gSEFMIGhhbmRsZSBmb3IgZGV2aWNlCisqICAgIHBzTW9kZSAtIHRoZSBwb3dlciBzYXZpbmcgbW9kZSB0byBjb25maWd1cmUKKyogICAgcENvbmZpZ1BhcmFtcyAtIHBvaW50ZXIgdG8gY29uZmlndXJhdGlvbiBwYXJhbWV0ZXJzIHNwZWNpZmljIHRvIHRoZQorKiAgICAgICAgICAgICAgICAgICAgcG93ZXIgc2F2aW5nIG1vZGUKKyoKKyogUmV0dXJuczoKKyogICAgZUhBTF9TVEFUVVNfU1VDQ0VTUyAtIGNvbmZpZ3VyYXRpb24gc3VjY2Vzc2Z1bAorKiAgICBlSEFMX1NUQVRVU19GQUlMVVJFIC0gY29uZmlndXJhdGlvbiBub3Qgc3VjY2Vzc2Z1bAorKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworZUhhbFN0YXR1cyBwbWNHZXRDb25maWdQb3dlclNhdmUgKHRIYWxIYW5kbGUgaEhhbCwgdFBtY1Bvd2VyU2F2aW5nTW9kZSBwc01vZGUsIHZvaWQgKnBDb25maWdQYXJhbXMpCit7CisgICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9IFBNQUNfU1RSVUNUKGhIYWwpOworCisgICAgcG1jTG9nKHBNYWMsIExPRzIsIEZMKCJFbnRlcmluZyBwbWNHZXRDb25maWdQb3dlclNhdmUsIHBvd2VyIHNhdmUgbW9kZSAlZCIpLCBwc01vZGUpOworCisgICAgLyogQ29uZmlndXJlIHRoZSBzcGVjaWZpZWQgcG93ZXIgc2F2aW5nIG1vZGUuICovCisgICAgc3dpdGNoIChwc01vZGUpCisgICAgeworICAgIAorICAgIGNhc2UgZVBNQ19JRExFX01PREVfUE9XRVJfU0FWRToKKyAgICAgICAgKih0cFBtY0ltcHNDb25maWdQYXJhbXMpcENvbmZpZ1BhcmFtcyA9IHBNYWMtPnBtYy5pbXBzQ29uZmlnOworICAgICAgICBicmVhazsKKworICAgIGNhc2UgZVBNQ19CRUFDT05fTU9ERV9QT1dFUl9TQVZFOgorICAgICAgICAqKHRwUG1jQm1wc0NvbmZpZ1BhcmFtcylwQ29uZmlnUGFyYW1zID0gcE1hYy0+cG1jLmJtcHNDb25maWc7CisgICAgICAgIGJyZWFrOworCisgICAgY2FzZSBlUE1DX1NQQVRJQUxfTVVMVElQTEVYX1BPV0VSX1NBVkU6CisgICAgICAgICoodHBQbWNTbXBzQ29uZmlnUGFyYW1zKXBDb25maWdQYXJhbXMgPSBwTWFjLT5wbWMuc21wc0NvbmZpZzsKKyAgICAgICAgYnJlYWs7CisKKyAgICBkZWZhdWx0OgorICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwgRkwoIkludmFsaWQgcG93ZXIgc2F2ZSBtb2RlICVkIiksIHBzTW9kZSk7CisgICAgICAg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wbWNTdGF0ZSAhPSBTVE9QUEVEKQorICAgICAgICAgICAgaWYgKHBNYWMtPnBtYy5wb3dlclNvdXJjZSAhPSBBQ19QT1dFUiB8fAorICAgICAgICAgICAgICAgIHBNYWMtPnBtYy5zbXBzQ29uZmlnLmVudGVyT25BYykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAocE1hYy0+cG1jLnNtcHNDb25maWcubW9kZSA9PSBlUE1DX0RZTkFNSUNfU01QUykKKyAgICAgICAgICAgICAgICAgICAgaHRNaW1vUG93ZXJTYXZlU3RhdGUgPSBlU0lSX0hUX01JTU9fUFNfRFlOQU1JQzsKKyAgICAgICAgICAgICAgICBpZiAocE1hYy0+cG1jLnNtcHNDb25maWcubW9kZSA9PSBlUE1DX1NUQVRJQ19TTVBTKQorICAgICAgICAgICAgICAgICAgICBodE1pbW9Qb3dlclNhdmVTdGF0ZSA9IGVTSVJfSFRfTUlNT19QU19TVEFUSUM7CisgICAgICAgICAgICAgICAgaWYgKHBtY1NlbmRNZXNzYWdlKGhIYWwsIGVXTklfUE1DX1NNUFNfU1RBVEVfSU5ELCAmaHRNaW1vUG93ZXJTYXZlU3RhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjSFRNSU1PUG93ZXJTYXZlU3RhdGUpKSAhPSBlSEFMX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisKKyAgICBjYXNlIGVQTUNfVUFQU0RfTU9ERV9QT1dFUl9TQVZFOgorICAgICAgICBwTWFjLT5wbWMudWFwc2RFbmFibGVkID0gVFJVRTsKKyAgICAgICAgYnJlYWs7CisKKyAgICBjYXNlIGVQTUNfU1RBTkRCWV9NT0RFX1BPV0VSX1NBVkU6CisgICAgICAgIHBNYWMtPnBtYy5zdGFuZGJ5RW5h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h0TWltb1Bvd2VyU2F2ZVN0YXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNIVE1JTU9Qb3dlclNhdmVTdGF0ZSkpICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgYnJlYWs7CisKKyAgICBjYXNlIGVQTUNfVUFQU0RfTU9ERV9QT1dFUl9TQVZFOgorICAgICAgICBwTWFjLT5wbWMudWFwc2RFbmFibGVkID0gRkFMU0U7CisgICAgICAgIGJyZWFrOworCisgICAgY2FzZSBlUE1DX1NUQU5EQllfTU9ERV9QT1dFUl9TQVZFOgorICAgICAgICBwTWFjLT5wbWMuc3RhbmRieUVuYWJsZWQgPSBGQUxTRTsKKyAgICAgICAgYnJlYWs7CisKKyAgICBjYXNlIGVQTUNfV09XTF9NT0RFX1BPV0VSX1NBVkU6CisgICAgICAgIHBNYWMtPnBtYy53b3dsRW5hYmxlZCA9IEZBTFNFOworICAgICAgICBicmVhazsKKworICAgIGRlZmF1bHQ6CisgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dFLCBGTCgiSW52YWxpZCBwb3dlciBzYXZlIG1vZGUgJWQiKSwgcHNNb2RlKTsKKyAgICAgICAgUE1DX0FCT1JUOworICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICB9CisKKyAgICByZXR1cm4gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKK30KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIE5hbWU6ICBwbWNRdWVyeVBvd2VyU3RhdGUKKyoKKyogRGVzY3JpcHRpb246CisqICAgIFJldHVybnMgdGhlIGN1cnJlbnQgcG93ZXIgc3RhdGUgb2YgdGhlIGRldmljZS4KKyoKKyogUGFyYW1ldGV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VBvd2VyU3RhdGUiKSk7CisKKyAgICAvKiBSZXR1cm4gY3VycmVudCBwb3dlciBzdGF0ZSBiYXNlZCBvbiBQTUMgc3RhdGUuICovCisgICAgaWYocFBvd2VyU3RhdGUgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIC8qIFJldHVybiBjdXJyZW50IHBvd2VyIHN0YXRlIGJhc2VkIG9uIFBNQyBzdGF0ZS4gKi8KKyAgICAgICAgc3dpdGNoIChwTWFjLT5wbWMucG1jU3RhdGUpCisgICAgICAgIHsKKyAgICAKKyAgICAgICAgY2FzZSBGVUxMX1BPV0VSOgorICAgICAgICAgICAgKnBQb3dlclN0YXRlID0gZVBNQ19GVUxMX1BPV0VSOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICpwUG93ZXJTdGF0ZSA9IGVQTUNfTE9XX1BPV0VSOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKiBSZXR1cm4gY3VycmVudCBzd2l0Y2ggc2V0dGluZ3MuICovCisgICAgaWYocEh3V2xhblN3aXRjaFN0YXRlICE9IE5VTEwpCisgICAgICAgKnBId1dsYW5Td2l0Y2hTdGF0ZSA9IHBNYWMtPnBtYy5od1dsYW5Td2l0Y2hTdGF0ZTsKKyAgICBpZihwU3dXbGFuU3dpdGNoU3RhdGUgIT0gTlVMTCkKKyAgICAgICAqcFN3V2xhblN3aXRjaFN0YXRlID0gcE1hYy0+cG1jLnN3V2xhblN3aXRjaFN0YXRlOworCisgICAgcmV0dXJuIGVIQUxfU1RBVFVTX1NVQ0NFU1M7Cit9CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKgorKiBOYW1lOiAgcG1jSXNQb3dlclNhdmVFbmFibGVkCisqCisqIERlc2NyaXB0aW9uOgorKiAgICBDaGVja3MgaWYgdGhlIG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AlZCIpLCBwc01vZGUpOworICAgICAgICBQTUNfQUJPUlQ7CisgICAgICAgIHJldHVybiBGQUxTRTsKKyAgICB9Cit9CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKgorKiBOYW1lOiAgcG1jUmVxdWVzdEZ1bGxQb3dlcgorKgorKiBEZXNjcmlwdGlvbjoKKyogICAgUmVxdWVzdCB0aGF0IHRoZSBkZXZpY2UgYmUgYnJvdWdodCB0byBmdWxsIHBvd2VyIHN0YXRlLgorKgorKiBQYXJhbWV0ZXJzOgorKiAgICBoSGFsIC0gSEFMIGhhbmRsZSBmb3IgZGV2aWNlCisqICAgIGNhbGxiYWNrUm91dGluZSAtIHJvdXRpbmUgdG8gY2FsbCB3aGVuIGRldmljZSBhY3R1YWxseSBhY2hpZXZlcyBmdWxsCisqICAgICAgICAgICAgICAgICAgICAgIHBvd2VyIHN0YXRlIGlmICJlSEFMX1NUQVRVU19QTUNfUEVORElORyIgaXMgcmV0dXJuZWQKKyogICAgY2FsbGJhY2tDb250ZXh0IC0gdmFsdWUgdG8gYmUgcGFzc2VkIGFzIHBhcmFtZXRlciB0byByb3V0aW5lIHNwZWNpZmllZAorKiAgICAgICAgICAgICAgICAgICAgICBhYm92ZQorKiAgICBmdWxsUG93ZXJSZWFzb24gLSAgUmVhc29uIGZvciByZXF1ZXN0aW5nIGZ1bGwgcG93ZXIgbW9kZS4gVGhpcyBpcyB1c2VkCisqICAgICAgICAgICAgICAgICAgICAgICBieSBQRSB0byBkZWNpZGUgd2hldGhlciBkYXRhIG51bGwgc2hvdWxkIGJlIHNlbnQgdG8KKyogICAgICAgICAgICAgICAgICAgICAgIEFQIHdoZW4gZXhpdGluZyBCTVBTIG1vZGUuIENhbGxlciBzaG91bGQgdXNlIHRoZQorKiAgICAgICAgICAgICAgICAgICAgICAgZVNNRV9MSU5LX0RJU0NPTk5FQ1RFRCByZWFz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VfR0VORVJJQyk7CisjZW5kaWYKKworCisgICAgcG1jTG9nKHBNYWMsIExPRzIsIEZMKCJFbnRlcmluZyBwbWNSZXF1ZXN0SW1wcyIpKTsKKworICAgIHN0YXR1cyA9IHBtY0VudGVySW1wc0NoZWNrKCBwTWFjICk7CisgICAgaWYoIEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgLyogRW50ZXIgUmVxdWVzdCBJTVBTIFN0YXRlLiAqLworICAgICAgICBzdGF0dXMgPSBwbWNFbnRlclJlcXVlc3RJbXBzU3RhdGUoIGhIYWwgKTsKKyAgICAgICAgaWYgKEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkpCisgICAgeworICAgICAgICAgICAgLyogU2F2ZSB0aGUgcGVyaW9kIGFuZCBjYWxsYmFjayByb3V0aW5lIGZvciB3aGVuIHdlIG5lZWQgaXQuICovCisgICAgICAgICAgICBwTWFjLT5wbWMuaW1wc1BlcmlvZCA9IGltcHNQZXJpb2Q7CisgICAgICAgICAgICBwTWFjLT5wbWMuaW1wc0NhbGxiYWNrUm91dGluZSA9IGNhbGxiYWNrUm91dGluZTsKKyAgICAgICAgICAgIHBNYWMtPnBtYy5pbXBzQ2FsbGJhY2tDb250ZXh0ID0gY2FsbGJhY2tDb250ZXh0OworCisgICAgfQorICAgICAgICBlbHNlCisgICAgeworICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfUE1DX1NZU19FUlJPUjsKKyAgICB9CisgICAgfQorCisgICAgcmV0dXJuIHN0YXR1czsKK30KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIE5hbWU6ICBwbWNSZWdpc3RlclBvd2VyU2F2ZUNoZWNrCisqCisqIERlc2NyaXB0aW9uOgorKiAgICBBbGxvd3MgYSByb3V0aW5lIHRvIGJlIHJlZ2lzdGVyZ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mcgcG1jRGVyZWdpc3RlclBvd2VyU2F2ZUNoZWNrIikpOworCisgICAgLyogRmluZCBlbnRyeSBpbiB0aGUgcG93ZXIgc2F2ZSBjaGVjayByb3V0aW5lIGxpc3QgdGhhdCBtYXRjaGVzCisgICAgICAgdGhlIHNwZWNpZmllZCByb3V0aW5lIGFuZCByZW1vdmUgaXQuICovCisgICAgcEVudHJ5ID0gY3NyTExQZWVrSGVhZCgmcE1hYy0+cG1jLnBvd2VyU2F2ZUNoZWNrTGlzdCwgRkFMU0UpOworICAgIHdoaWxlIChwRW50cnkgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIHBQb3dlclNhdmVDaGVja0VudHJ5ID0gR0VUX0JBU0VfQUREUihwRW50cnksIHRQb3dlclNhdmVDaGVja0VudHJ5LCBsaW5rKTsKKyAgICAgICAgaWYgKHBQb3dlclNhdmVDaGVja0VudHJ5LT5jaGVja1JvdXRpbmUgPT0gY2hlY2tSb3V0aW5lKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoY3NyTExSZW1vdmVFbnRyeSgmcE1hYy0+cG1jLnBvd2VyU2F2ZUNoZWNrTGlzdCwgcEVudHJ5LCBGQUxTRSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBQb3dlclNhdmVDaGVja0VudHJ5KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwgRkwoIkNhbm5vdCByZW1vdmUgcG93ZXIgc2F2ZSBjaGVjayByb3V0aW5lIGxpc3QgZW50cnkiKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgfQorICAgICAgICBwRW50cnkgPSBjc3JMTE5leHQoJn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1zZy0+c3RhdHVzQ29kZSk7CisgICAgICAgICAgICBpZiggKGVTbWVDb21tYW5kRW50ZXJJbXBzICE9IHBDb21tYW5kLT5jb21tYW5kKSAmJiAoZVNtZUNvbW1hbmRFbnRlclN0YW5kYnkgIT0gcENvbW1hbmQtPmNvbW1hbmQpICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HVywgRkwoIlJjdmQgZVdOSV9QTUNfRU5URVJfSU1QU19SU1Agd2l0aG91dCByZXF1ZXN0IikpOworICAgICAgICAgICAgICAgIGZSZW1vdmVDb21tYW5kID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICBpZihwTWFjLT5wbWMucG1jU3RhdGUgPT0gUkVRVUVTVF9JTVBTKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBFbnRlciBJTVBTIFN0YXRlIGlmIHJlc3BvbnNlIGluZGljYXRlcyBzdWNjZXNzLiAqLworICAgICAgICAgICAgaWYgKHBNc2ctPnN0YXR1c0NvZGUgPT0gZVNJUl9TTUVfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwTWFjLT5wbWMuSW1wc1JlcUZhaWxlZCA9IFZPU19GQUxTRTsKKyAgICAgICAgICAgICAgICBwbWNFbnRlckltcHNTdGF0ZShwTWFjKTsKKyAgICAgICAgICAgICAgICBpZiAoIShwTWFjLT5wbWMuSW1wc1JlcUZhaWxlZCB8fCBwTWFjLT5wbWMuSW1wc1JlcVRpbWVyRmFpbGVkKSAmJiBwTWFjLT5wbWMuSW1wc1JlcUZhaWxDbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJSZXNwb25zZSBtZXNzYWdlIHRvIHJlcXVlc3QgdG8gZW50ZXIgSU1QUyB3YXMgZmFpbGVkICVkIHRpbWVzIGJlZm9yZSBzdWNjZXNzIiksCisgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnBtYy5JbXBzUmVxRmFpbENudCk7CisgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnBtYy5JbXBzUmVxRmFpbENudCA9IDA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKiBJZiByZXNwb25zZSBpcyBmYWlsdXJlLCB0aGVuIHdlIHN0YXkgaW4gRnVsbCBQb3dlciBTdGF0ZSBhbmQgdGVsbCBldmVyeW9uZSB0aGF0IHdlIGFyZW4ndCBnb2luZyBpbnRvIElNUFMuICovCisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcE1hYy0+cG1jLkltcHNSZXFGYWlsZWQgPSBWT1NfVFJVRTsKKyAgICAgICAgICAgICAgICBpZiAoIShwTWFjLT5wbWMuSW1wc1JlcUZhaWxDbnQgJiAweEYpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiUmVzcG9uc2UgbWVzc2FnZSB0byByZXF1ZXN0IHRvIGVudGVyIElNUFMgaW5kaWNhdGVzIGZhaWx1cmUsIHN0YXR1cyAleCwgRmFpbENudCAtICVkIiksCisgICAgICAgICAgICAgICAgICAgICAgIHBNc2ctPnN0YXR1c0NvZGUsICsrcE1hYy0+cG1jLkltcHNSZXFGYWlsQ250KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcE1hYy0+cG1jLkltcHNSZXFGYWlsQ250Kys7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHBtY0VudGVyRnVsbFBvd2VyU3RhdGUocE1hYyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocE1hYy0+cG1jLnBtY1N0YXRlID09IFJFUVVFU1RfU1RBTkRCWSkKKyAgICAgICAgeworICAgICAgICAgICAgLyogRW50ZXIgU1RBTkRCWSBTdGF0ZSBpZiByZXNwb25zZSBpbmRpY2F0ZXMgc3VjY2Vzcy4gKi8KKyAgICAgICAgICAgIGlmIChwTXNnLT5zdGF0dXNDb2RlID09IGVTSVJfU01FX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcG1jRW50ZXJTdGFuZGJ5U3RhdGUocE1hYyk7CisgICAgICAgICAgICAgICAgcG1jRG9TdGFuZGJ5Q2FsbGJhY2tzKHBNYWMsIGVIQUxfU1RBVFVTX1NVQ0NFU1MpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKiBJZiByZXNwb25zZSBpcyBmYWlsdXJlLCB0aGVuIHdlIHN0YXkgaW4gRnVsbCBQb3dlciBTdGF0ZQorICAgICAgICAgICAgICAgYW5kIHRlbGwgZXZlcnlvbmUgdGhhdCB3ZSBhcmVuJ3QgZ29pbmcgaW50byBTVEFOREJZLiAqLworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dFLCAiUE1DOiByZXNwb25zZSBtZXNzYWdlIHRvIHJlcXVlc3QgdG8gZW50ZXIgIgorICAgICAgICAgICAgICAgICAgICAgICAic3RhbmRieSBpbmRpY2F0ZXMgZmFpbHVyZSwgc3RhdHVzICVkIiwgcE1zZy0+c3RhdHVzQ29kZSk7CisgICAgICAgICAgICAgICAgcG1jRW50ZXJGdWxsUG93ZXJTdGF0ZShwTWFjKTsKKyAgICAgICAgICAgICAgICBwbWNEb1N0YW5kYnlDYWxsYmFja3MocE1hYywgZUhBTF9TVEFUVVNfRkFJTFVSRSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwgIlBNQzogRW50ZXIgSU1QUyByc3AgcmN2ZCB3aGVuIGRldmljZSBpcyAiCisgICAgICAgICAgICAgICAiaW4gJWQgc3RhdGUiLCBwTWFjLT5wbWMucG1jU3RhdGUpOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworCisgICAgLyogV2UgZ290IGEgcmVzcG9uc2UgdG8gb3VyIHdha2UgZnJvbSBJTVBTIHJlcXVlc3QuICovCisgICAgY2FzZSBlV05JX1BNQ19FWElUX0lNUFNfUlNQOgorICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPRzIsIEZMKCJSY3ZkIGVXTklfUE1DX0VYSVRfSU1QU19SU1Agd2l0aCBzdGF0dXMgPSAlZCIpLCBwTXNnLT5zdGF0dXNDb2RlKTsKKyAgICAgICAgICAgIGlmKCBlU21lQ29tbWFuZEV4aXRJbXBzICE9IHBDb21tYW5kLT5jb21tYW5kICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HVywgRkwoIlJjdmQgZVdOSV9QTUNfRVhJVF9JTVBTX1JTUCB3aXRob3V0IHJlcXVlc3QiKSk7CisgICAgICAgICAgICAgICAgZlJlbW92ZUNvbW1hbmQgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBDaGVjayB0aGF0IHdlIGFyZSBpbiB0aGUgY29ycmVjdCBzdGF0ZSBmb3IgdGhpcyBtZXNzYWdlLiAqLworICAgICAgICAgICAgaWYgKHBNYWMtPnBtYy5wbWNTdGF0ZSAhPSBSRVFVRVNUX0ZVTExfUE9XRVIpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR0UsIEZMKCJHb3QgRXhpdCBJTVBTIFJlc3BvbnNlIE1lc3NhZ2Ugd2hpbGUgIgorICAgICAgICAgICAgICAgICAgICJpbiBzdGF0ZSAlZCIpLCBwTWFjLT5wbWMucG1jU3RhdGUpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKiBFbnRlciBGdWxsIFBvd2VyIFN0YXRlLiAqLworICAgICAgICAgICAgaWYgKHBNc2ctPnN0YXR1c0NvZGUgIT0gZVNJUl9TTUVfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwgRkwoIlJlc3BvbnNlIG1lc3NhZ2UgdG8gcmVxdWVzdCB0byBleGl0ICIKKyAgICAgICAgICAgICAgICAgICAiSU1QUyBpbmRpY2F0ZXMgZmFpbHVyZSwgc3RhdHVzICVkIiksIHBNc2ctPnN0YXR1c0NvZGUpOworICAgICAgICAgICAgICAgIGlmICh2b3NfaXNfbG9ncF9pbl9wcm9ncmVzcyhWT1NfTU9EVUxFX0lEX1NNRSwgTlVMTCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwgRkwoIlNTUiBJcyBpbiBwcm9ncmVzcyBkbyBub3Qgc2VuZCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZXhpdCBpbXBzIHJlcSBhZ2FpbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiggKHBNYWMtPnBtYy5JbXBzUnNwRmFpbENudCA8PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgQk1QU19JTVBTX0ZBSUxVUkVfUkVQT1JUX1RIUkVTSE9MRCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwTWFjLT5wbWMuSW1wc1JzcEZhaWxDbnQrKzsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgIHBtY1NlbmRNZXNzYWdlKHBNYWMsIGVXTklfUE1DX0VYSVRfSU1QU19SRVEsIE5VTEwsIDApICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZlJlbW92ZUNvbW1hbmQgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5wbWMucG1jU3RhdGUgPSBSRVFVRVNUX0ZVTExfUE9XRVI7CisgICAgICAgICAgICAgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwgRkwoImVXTklfUE1DX0VYSVRfSU1QU19SRVEgc2VudCBhZ2FpbiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIHRvIFBFIikpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcE1hYy0+cG1jLkltcHNSc3BGYWlsQ250ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBNYWMtPnBtYy5JbXBzUnNwRmFpbENudCA9IDA7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHBtY0VudGVyRnVsbFBvd2VyU3RhdGUocE1hYyk7CisgICAgICAgIGJyZWFrOworCisgICAgLyogV2UgZ290IGEgcmVzcG9uc2UgdG8gb3VyIEJNUFMgcmVxdWVzdC4gICovCisgICAgY2FzZSBlV05JX1BNQ19FTlRFUl9CTVBTX1JTUDoKKyAgICAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0cyLCBGTCgiUmN2ZCBlV05JX1BNQ19FTlRFUl9CTVBTX1JTUCB3aXRoIHN0YXR1cyA9ICVkIiksIHBNc2ctPnN0YXR1c0NvZGUpOworICAgICAgICAgICAgaWYoIGVTbWVDb21tYW5kRW50ZXJCbXBzICE9IHBDb21tYW5kLT5jb21tYW5kICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HVywgRkwoIlJjdmQgZVdOSV9QTUNfRU5URVJfQk1QU19SU1Agd2l0aG91dCByZXF1ZXN0IikpOworICAgICAgICAgICAgICAgIGZSZW1vdmVDb21tYW5kID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcE1hYy0+cG1jLmJtcHNSZXF1ZXN0UXVldWVkID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgLyogQ2hlY2sgdGhhdCB3ZSBhcmUgaW4gdGhlIGNvcnJlY3Qgc3RhdGUgZm9yIHRoaXMgbWVzc2FnZS4gKi8KKyAgICAgICAgICAgIGlmIChwTWFjLT5wbWMucG1jU3RhdGUgIT0gUkVRVUVTVF9CTVBTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICBGTCgiR290IEVudGVyIEJNUFMgUmVzcG9uc2UgTWVzc2FnZSB3aGlsZSBpbiBzdGF0ZSAlZCIpLCBwTWFjLT5wbWMucG1jU3RhdGUpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorCisgICAgICAgIC8qIEVudGVyIEJNUFMgU3RhdGUgaWYgcmVzcG9uc2UgaW5kaWNhdGVzIHN1Y2Nlc3MuICovCisgICAgICAgIGlmIChwTXNnLT5zdGF0dXNDb2RlID09IGVTSVJfU01FX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwbWNFbnRlckJtcHNTdGF0ZShwTWFjKTsKKyAgICAgICAgICAgIC8qIE5vdGU6IElmIEJNUFMgd2FzIHJlcXVlc3RlZCBiZWNhdXNlIG9mIHN0YXJ0IFVBUFNELAorICAgICAgICAgICAgICAgdGhlcmUgd2lsbCBubyBlbnRyaWVzIGZvciBCTVBTIGNhbGxiYWNrIHJvdXRpbmVzIGFuZAorICAgICAgICAgICAgICAgcG1jRG9CbXBzQ2FsbGJhY2tzIHdpbGwgYmUgYSBOby1PcCovCisgICAgICAgICAgICAgICAgcG1jRG9CbXBzQ2FsbGJhY2tzKHBNYWMsIGVIQUxfU1RBVFVTX1NVQ0NFU1MpOworICAgICAgICAgfQorICAgICAgICAvKiBJZiByZXNwb25zZSBpcyBmYWlsdXJlLCB0aGVuIHdlIHN0YXkgaW4gRnVsbCBQb3dlciBTdGF0ZSBhbmQgdGVsbCBldmVyeW9uZSB0aGF0IHdlIGFyZW4ndCBnb2luZyBpbnRvIEJNUFMuICovCisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICBGTCgiUmVzcG9uc2UgbWVzc2FnZSB0byByZXF1ZXN0IHRvIGVudGVyIEJNUFMgaW5kaWNhdGVzIGZhaWx1cmUsIHN0YXR1cyAlZCIpLAorICAgICAgICAgICAgICAgICAgIHBNc2ctPnN0YXR1c0NvZGUpOworICAgICAgICAgICAgICAgIHBtY0VudGVyRnVsbFBvd2VyU3RhdGUocE1hYyk7CisgICAgICAgICAgICAgICAgLy9EbyBub3QgY2FsbCBVQVBTRCBjYWxsYmFjayBoZXJlIHNpbmNlIGl0IG1heSBiZSByZS1lbnRlcmVkCisgICAgICAgICAgICAgICAgcG1jRG9CbXBzQ2FsbGJhY2tzKHBNYWMsIGVIQUxfU1RBVFVTX0ZBSUxVUkUpOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworCisgICAgLyogV2UgZ290IGEgcmV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VJfU01FX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR1AsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJSZXNwb25zZSBtZXNzYWdlIHRvIHJlcXVlc3QgdG8gZXhpdCBCTVBTIGluZGljYXRlcyBmYWlsdXJlLCBzdGF0dXMgJWQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgcE1zZy0+c3RhdHVzQ29kZSk7CisgICAgICAgICAgICAgICAgLypTdGF0dXMgaXMgbm90IHN1Y2Nlcywgc28gc2V0IGJhY2sgdGhlIHBtYyBzdGF0ZSBhcyBCTVBTKi8KKyAgICAgICAgICAgICAgICBwTWFjLT5wbWMucG1jU3RhdGUgPSBCTVBTOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHBtY0VudGVyRnVsbFBvd2VyU3RhdGUocE1hYyk7CisgICAgICAgIGJyZWFrOworCisgICAgICAgIC8qIFdlIGdvdCBhIHJlc3BvbnNlIHRvIG91ciBTdGFydCBVQVBTRCByZXF1ZXN0LiAgKi8KKyAgICAgICAgY2FzZSBlV05JX1BNQ19FTlRFUl9VQVBTRF9SU1A6CisgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HMiwgRkwoIlJjdmQgZVdOSV9QTUNfRU5URVJfVUFQU0RfUlNQIHdpdGggc3RhdHVzID0gJWQiKSwgcE1zZy0+c3RhdHVzQ29kZSk7CisgICAgICAgICAgICBpZiggZVNtZUNvbW1hbmRFbnRlclVhcHNkICE9IHBDb21tYW5kLT5jb21tYW5kICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HVywgRkwoIlJjdmQgZVdOSV9QTUNfRU5URVJfVUFQU0RfUlNQIHdpdGhvdXQgcmVxdWVzdCIpKTsKKyAgICAgICAgICAgICAgICBmUmVtb3ZlQ29tbWFuZCA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8qIENoZWNrIHRoYXQgd2UgYXJlIGluIHRoZSBjb3JyZWN0IHN0YXRlIGZvciB0aGlzIG1lc3NhZ2UuICovCisgICAgICAgICAgICBpZiAocE1hYy0+cG1jLnBtY1N0YXRlICE9IFJFUVVFU1RfU1RBUlRfVUFQU0QpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJHb3QgRW50ZXIgVWFwc2QgcnNwIE1lc3NhZ2Ugd2hpbGUgaW4gc3RhdGUgJWQiKSwgcE1hYy0+cG1jLnBtY1N0YXRlKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyogRW50ZXIgVUFQU0QgU3RhdGUgaWYgcmVzcG9uc2UgaW5kaWNhdGVzIHN1Y2Nlc3MuICovCisgICAgICAgICAgICBpZiAocE1zZy0+c3RhdHVzQ29kZSA9PSBlU0lSX1NNRV9TVUNDRVNTKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwbWNFbnRlclVhcHNkU3RhdGUocE1hYyk7CisgICAgICAgICAgICAgICAgcG1jRG9TdGFydFVhcHNkQ2FsbGJhY2tzKHBNYWMsIGVIQUxfU1RBVFVTX1NVQ0NFU1MpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIElmIHJlc3BvbnNlIGlzIGZhaWx1cmUsIHRoZW4gd2UgdHJ5IHRvIHB1dCB0aGUgY2hpcCBiYWNrIGluCisgICAgICAgICAgICAgICAgICAgQk1QUyBtb2RlKi8KKyAgICAgICAgICAgICAgICB0QU5JX0JPT0xFQU4gT3JpZ1VhcHNkUmVxU3RhdGUgPSBwTWFjLT5wbWMudWFwc2RTZXNzaW9uUmVxdWlyZWQ7CisgICAgICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR0UsICJQTUM6IHJlc3BvbnNlIG1lc3NhZ2UgdG8gcmVxdWVzdCB0byBlbnRlciAiCisgICAgICAgICAgICAgICAgICAgIlVBUFNEIGluZGljYXRlcyBmYWlsdXJlLCBzdGF0dXMgJWQiLCBwTXNnLT5zdGF0dXNDb2RlKTsKKworICAgICAgICAgICAgICAgIC8vTmVlZCB0byByZXNldCB0aGUgVUFQU0QgZmxhZyBzbyBwbWNFbnRlckJtcHNTdGF0ZSB3b24ndCB0cnkgdG8gZW50ZXIgVUFQU0QuCisgICAgICAgICAgICAgICAgcE1hYy0+cG1jLnVhcHNkU2Vzc2lvblJlcXVpcmVkID0gRkFMU0U7CisgICAgICAgICAgICAgICAgcG1jRW50ZXJCbXBzU3RhdGUocE1hYyk7CisKKyAgICAgICAgICAgICAgICBpZiAocE1zZy0+c3RhdHVzQ29kZSAhPSBlU0lSX1NNRV9VQVBTRF9SRVFfSU5WQUxJRCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vVUFQU0Qgd2lsbCBub3QgYmUgcmV0aWVkIGluIHRoaXMgY2FzZSBzbyB0ZWxsIHJlcXVlc3RlciB3ZSBhcmUgZG9uZSB3aXRoIGZhaWx1cmUKKyAgICAgICAgICAgICAgICAgICAgcG1jRG9TdGFydFVhcHNkQ2FsbGJhY2tzKHBNYWMsIGVIQUxfU1RBVFVTX0ZBSUxVUkUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHBNYWMtPnBtYy51YXBzZFNlc3Npb25SZXF1aXJlZCA9IE9yaWdVYXBzZFJlcVN0YXRlOworICAgICAgICAgICAgfQorICAgICAgICAgYnJlYWs7CisKKyAgICAgIC8qIFdlIGdvdCBhIHJlc3BvbnNlIHRvIG91ciBTdG9wIFVBUFNEIHJlcXVlc3QuICAqLworICAgICAgY2FzZSBlV05JX1BNQ19FWElUX1VBUFNEX1JTUDoKKyAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0cyLCBGTCgiUmN2ZCBlV05JX1BNQ19FWElUX1VBUFNEX1JTUCB3aXRoIHN0YXR1cyA9ICVkIiksIHBNc2ctPnN0YXR1c0NvZGUpOworICAgICAgICAgICAgaWYoIGVTbWVDb21tYW5kRXhpdFVhcHNkICE9IHBDb21tYW5kLT5jb21tYW5kICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HVywgRkwoIlJjdmQgZVdOSV9QTUNfRVhJVF9VQVBTRF9SU1Agd2l0aG91dCByZXF1ZXN0IikpOworICAgICAgICAgICAgICAgIGZSZW1vdmVDb21tYW5kID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLyogQ2hlY2sgdGhhdCB3ZSBhcmUgaW4gdGhlIGNvcnJlY3Qgc3RhdGUgZm9yIHRoaXMgbWVzc2FnZS4gKi8KKyAgICAgICAgICAgIGlmIChwTWFjLT5wbWMucG1jU3RhdGUgIT0gUkVRVUVTVF9TVE9QX1VBUFNEKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICBGTCgiR290IEV4aXQgVWFwc2QgcnNwIE1lc3NhZ2Ugd2hpbGUgaW4gc3RhdGUgJWQiKSwgcE1hYy0+cG1jLnBtY1N0YXRlKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgLyogRW50ZXIgQk1QUyBTdGF0ZSAqLworICAgICAgICAgaWYgKHBNc2ctPnN0YXR1c0NvZGUgIT0gZVNJUl9TTUVfU1VDQ0VTUykgeworICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR1AsICJQTUM6IHJlc3BvbnNlIG1lc3NhZ2UgdG8gcmVxdWVzdCB0byBleGl0ICIKKyAgICAgICAgICAgICAgICJVQVBTRCBpbmRpY2F0ZXMgZmFpbHVyZSwgc3RhdHVzICVkIiwgcE1zZy0+c3RhdHVzQ29kZSk7CisgICAgICAgICB9CisgICAgICAgICAgICBwbWNFbnRlckJtcHNTdGF0ZShwTWFjKTsKKyAgICAgICAgIGJyZWFrOworCisgICAgICAvKiBXZSBnb3QgYSByZXNwb25zZSB0byBvdXIgZW50ZXIgV09XTCByZXF1ZXN0LiAgKi8KKyAgICAgIGNhc2UgZVdOSV9QTUNfRU5URVJfV09XTF9SU1A6CisKKyAgICAgICAgICAgIGlmKCBlU21lQ29tbWFuZEVudGVyV293bCAhPSBwQ29tbWFuZC0+Y29tbWFuZCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR1csIEZMKCJSY3ZkIGVXTklfUE1DX0VOVEVSX1dPV0xfUlNQIHdpdGhvdXQgcmVxdWVzdCIpKTsKKyAgICAgICAgICAgICAgICBmUmVtb3ZlQ29tbWFuZCA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8qIENoZWNrIHRoYXQgd2UgYXJlIGluIHRoZSBjb3JyZWN0IHN0YXRlIGZvciB0aGlzIG1lc3NhZ2UuICovCisgICAgICAgICAgICBpZiAocE1hYy0+cG1jLnBtY1N0YXRlICE9IFJFUVVFU1RfRU5URVJfV09XTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwgRkwoIkdvdCBlV05JX1BNQ19FTlRFUl9XT1dMX1JTUCB3aGlsZSBpbiBzdGF0ZSAlcyIpLAorICAgICAgICAgICAgICAgICAgICBwbWNHZXRQbWNTdGF0ZVN0cihwTWFjLT5wbWMucG1jU3RhdGUpKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgLyogRW50ZXIgV09XTCBTdGF0ZSBpZiByZXNwb25zZSBpbmRpY2F0ZXMgc3VjY2Vzcy4gKi8KKyAgICAgICAgIGlmIChwTXNnLT5zdGF0dXNDb2RlID09IGVTSVJfU01FX1NVQ0NFU1MpIHsKKyAgICAgICAgICAgICAgICBwbWNFbnRlcldvd2xTdGF0ZShwTWFjKTsKKyAgICAgICAgICAgICAgICBwbWNEb0VudGVyV293bENhbGxiYWNrcyhwTWFjLCBlSEFMX1NUQVRVU19TVUNDRVNTKTsKKyAgICAgICAgIH0KKworICAgICAgICAgLyogSWYgcmVzcG9uc2UgaXMgZmFpbHVyZSwgdGhlbiB3ZSB0cnkgdG8gcHV0IHRoZSBjaGlwIGJhY2sgaW4KKyAgICAgICAgICAgIEJNUFMgbW9kZSovCisgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dFLCAiUE1DOiByZXNwb25zZSBtZXNzYWdlIHRvIHJlcXVlc3QgdG8gZW50ZXIgIgorICAgICAgICAgICAgICAgIldPV0wgaW5kaWNhdGVzIGZhaWx1cmUsIHN0YXR1cyAlZCIsIHBNc2ctPnN0YXR1c0NvZGUpOworICAgICAgICAgICAgICAgIHBtY0VudGVyQm1wc1N0YXRlKHBNYWMpOworICAgICAgICAgICAgICAgIHBtY0RvRW50ZXJXb3dsQ2FsbGJhY2tzKHBNYWMsIGVIQUxfU1RBVFVTX0ZBSUxVUkUpOworICAgICAgICAgfQorICAgICAgICAgYnJlYWs7CisKKyAgICAgIC8qIFdlIGdvdCBhIHJlc3BvbnNlIHRvIG91ciBleGl0IFdPV0wgcmVxdWVzdC4gICovCisgICAgICBjYXNlIGVXTklfUE1DX0VYSVRfV09XTF9SU1A6CisKKyAgICAgICAgICAgIGlmKCBlU21lQ29tbWFuZEV4aXRXb3dsICE9IHBDb21tYW5kLT5jb21tYW5kICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICA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pdmVkIiksIHBNc2ctPm1lc3NhZ2VUeXBlKTsKKyAgICAgICAgUE1DX0FCT1JUOworICAgICAgICBicmVhazsKKyAgICAgICAgfS8vc3dpdGNoCisKKyAgICAgICAgaWYoIGZSZW1vdmVDb21tYW5kICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYoIGNzckxMUmVtb3ZlRW50cnkoICZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTE9DSyApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwbWNSZWxlYXNlQ29tbWFuZCggcE1hYywgcENvbW1hbmQgKTsKKyAgICAgICAgICAgICAgICBzbWVQcm9jZXNzUGVuZGluZ1F1ZXVlKCBwTWFjICk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgcG1jTG9nKHBNYWMsIExPR0UsIEZMKCJtZXNzYWdlIHR5cGUgJWQgcmVjZWl2ZWQgYnV0IG5vIHJlcXVlc3QgaXMgZm91bmQiKSwgcE1zZy0+bWVzc2FnZVR5cGUpOworICAgIH0KK30KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIE5hbWU6ICBwbWNNZXNzYWdlUHJvY2Vzc29yCisqCisqIERlc2NyaXB0aW9uOgorKiAgICBQcm9jZXNzIGEgbWVzc2FnZSByZWNlaXZlZCBieSBQTUMuCisqCisqIFBhcmFtZXRlcnM6CisqICAgIGhIYWwgLSBIQUwgaGFuZGxlIGZvciBkZXZpY2UKKyogICAgcE1zZyAtIHBvaW50ZXIgdG8gcmVjZWl2ZWQgbWVzc2FnZQorKgorKiBSZXR1cm5zOgorKiAgICBub3RoaW5nCisqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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UX1dPV0w6CisgICAgICAgIGNhc2UgUkVRVUVTVF9GVUxMX1BPV0VSOgorICAgICAgICAgICAgcG1jTG9nKHBNYWMsIExPR1csIEZMKCJHb3QgZVdOSV9QTUNfRVhJVF9CTVBTX0lORCB3aGlsZSBpbiBzdGF0ZSAlZCIpLCBwTWFjLT5wbWMucG1jU3RhdGUpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwgRkwoIkdvdCBlV05JX1BNQ19FWElUX0JNUFNfSU5EIHdoaWxlIGluIHN0YXRlICVkIiksIHBNYWMtPnBtYy5wbWNTdGF0ZSk7CisgICAgICAgICAgICBQTUNfQUJPUlQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIC8qIEVudGVyIEZ1bGwgUG93ZXIgU3RhdGUuICovCisgICAgICAgIGlmIChwTXNnLT5zdGF0dXNDb2RlICE9IGVTSVJfU01FX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0dQLCBGTCgiRXhpdCBCTVBTIGluZGljYXRpb24gaW5kaWNhdGVzIGZhaWx1cmUsIHN0YXR1cyAlZCIpLCBwTXNnLT5zdGF0dXNDb2RlKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHRwU2lyU21lRXhpdEJtcHNJbmQgcEV4aXRCbXBzSW5kID0gKHRwU2lyU21lRXhpdEJtcHNJbmQpcE1zZzsKKyAgICAgICAgICAgIHBtY0VudGVyUmVxdWVzdEZ1bGxQb3dlclN0YXRlKGhIYWwsIHBFeGl0Qm1wc0luZC0+ZXhpdEJtcHNSZWFzb24pOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgIH0KKworICAgIGRlZmF1bHQ6CisgICAgICAgIHBtY1Byb2Nlc3NSZXNwb25zZSggcE1hYywgcE1zZyApOworICAgICAgICBicmVhazsKKyAgICB9CisKK30KKworCit0QU5JX0JPT0xFQU4gcG1jVmFsaWRhdGVDb25uZWN0U3RhdGUoIHRIYWxIYW5kbGUgaEhhbCApCit7CisgICB0cEFuaVNpckdsb2JhbCBwTWFjID0gUE1BQ19TVFJVQ1QoaEhhbCk7CisKKyAgIGlmICggIWNzcklzSW5mcmFDb25uZWN0ZWQoIHBNYWMgKSApCisgICB7CisgICAgICBwbWNMb2cocE1hYywgTE9HVywgIlBNQzogU1RBIG5vdCBhc3NvY2lhdGVkLiBCTVBTIGNhbm5vdCBiZSBlbnRlcmVkIik7CisgICAgICByZXR1cm4gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgfQorCisgICAvL0Nhbm5vdCBoYXZlIG90aGVyIHNlc3Npb24KKyAgIGlmICggY3NySXNJQlNTU3RhcnRlZCggcE1hYyApICkKKyAgIHsKKyAgICAgIHBtY0xvZyhwTWFjLCBMT0dXLCAiUE1DOiBJQlNTIHN0YXJ0ZWQuIEJNUFMgY2Fubm90IGJlIGVudGVyZWQiKTsKKyAgICAgIHJldHVybiBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICB9CisgICBpZiAoIGNzcklzQlRBTVBTdGFydGVkKCBwTWFjICkgKQorICAgeworICAgICAgcG1jTG9nKHBNYWMsIExPR1csICJQTUM6IEJULUFNUCBleGlzdHMuIEJNUFMgY2Fubm90IGJlIGVudGVyZWQiKTsKKyAgICAgIHJldHVybiBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICB9CisgICBpZiAoKHZvc19jb25jdXJyZW50X29wZW5fc2Vzc2lvbnNfcnVubmluZygpKSAmJgorICAgICAgIChjc3JJc0NvbmN1cnJlbnRJbmZyYUNvbm5lY3RlZCggcE1hYyApIHx8CisgICAgICAgKHZvc19nZXRfY29uY3VycmVuY3lfbW9kZSgpJiBWT1NfU0FQKSB8fAorICAgICAgICh2b3NfZ2V0X2NvbmN1cnJlbmN5X21vZGUoKSYgVk9TX1AyUF9HTykpKQorICA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W5lOworICAgICAgICAgcEVudHJ5LT5jYWxsYmFja0NvbnRleHQgPSBjYWxsYmFja0NvbnRleHQ7CisKKyAgICAgICAgIC8qIEFkZCBlbnRyeSB0byBsaXN0LiAqLworICAgICAgICAgY3NyTExJbnNlcnRUYWlsKCZwTWFjLT5wbWMucmVxdWVzdEJtcHNMaXN0LCAmcEVudHJ5LT5saW5rLCBGQUxTRSk7CisKKyAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1BNQ19QRU5ESU5HOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgIH0KKyAgIH0KKyAgIC8qIFJldHJ5IHRvIGVudGVyIHRoZSBCTVBTIGlmIHRoZQorICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfUE1DX05PVF9OT1cgKi8KKyAgIGVsc2UgaWYgKHN0YXR1cyA9PSBlSEFMX1NUQVRVU19QTUNfTk9UX05PVykKKyAgIHsKKyAgICAgIHBtY1N0b3BUcmFmZmljVGltZXIoaEhhbCk7CisgICAgICBwbWNMb2cocE1hYywgTE9HMSwgRkwoIkNhbid0IGVudGVyIEJNUFMrKysiKSk7CisgICAgICBpZiAocG1jU2hvdWxkQm1wc1RpbWVyUnVuKHBNYWMpKQorICAgICAgeworICAgICAgICAgaWYgKHBtY1N0YXJ0VHJhZmZpY1RpbWVyKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+cG1jLmJtcHNDb25maWcudHJhZmZpY01lYXN1cmVQZXJpb2QpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHBtY0xvZyhwTWFjLCBMT0cxLCBGTCgiQ2Fubm90IHN0YXJ0IEJNUFMgUmV0cnkgdGltZXIiKSk7CisgICAgICAgICB9CisgICA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CgmcE1hYy0+cG1jLnJlcXVlc3RTdGFydFVhcHNkTGlzdCwgJnBFbnRyeS0+bGluaywgRkFMU0UpOworICAgfQorCisgICByZXR1cm4gZUhBTF9TVEFUVVNfUE1DX1BFTkRJTkc7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogTmFtZTogIHBtY1N0b3BVYXBzZAorKgorKiBEZXNjcmlwdGlvbjoKKyogICAgUmVxdWVzdCB0aGF0IHRoZSBkZXZpY2UgYmUgcHV0IG91dCBvZiBVQVBTRCBzdGF0ZS4KKyoKKyogUGFyYW1ldGVyczoKKyogICAgaEhhbCAtIEhBTCBoYW5kbGUgZm9yIGRldmljZQorKgorKiBSZXR1cm5zOgorKiAgICBlSEFMX1NUQVRVU19TVUNDRVNTIC0gZGV2aWNlIGlzIHB1dCBvdXQgb2YgVUFQU0QgYW5kIGJhY2sgaW4gQk1QUyBzdGF0ZQorKiAgICBlSEFMX1NUQVRVU19GQUlMVVJFIC0gZGV2aWNlIGNhbm5vdCBiZSBicm91Z2h0IG91dCBvZiBVQVBTRCBzdGF0ZQorKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworZUhhbFN0YXR1cyBwbWNTdG9wVWFwc2QgKHRIYWxIYW5kbGUgaEhhbCkKK3sKKyAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVChoSGFsKTsKKyAgIHRBTklfUzggc2Vzc2lvbklkOworICAgdENzclJvYW1TZXNzaW9uICpwU2Vzc2lvbiA9IE5VTEw7CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRElBR19TVVBQT1JUICAgIAorICAgV0xBTl9WT1NfRElBR19FVkVOVF9ERUYocHNSZXF1ZXN0LCB2b3NfZXZlbnRfd2xhbl9wb3dlcnNh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gICAgaWYoIGVIQUxfU1RBVFVTX1BNQ19QRU5ESU5HID09IHN0YXR1cyApCisgICAgICAgIHsKKyAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICB9CisgICAgICAgIGVsc2UgCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vZWl0aGVyIGZhaWwgb3IgYWxyZWFkeSBpbiBmdWxsIHBvd2VyCisgICAgICAgICAgICBpZiggIUhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHJldHVybiAoIHN0YXR1cyApOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy9lbHNlIGxldCBpdCB0aHJvdWdoIGJlY2F1c2UgaXQgaXMgaW4gZnVsbCBwb3dlciBzdGF0ZQorICAgICAgICB9CisgICAgfQorCisgICAgaWYgKHBtY1NlbmRNZXNzYWdlKGhIYWwsIGVXTklfUE1DX1dPV0xfREVMX0JDQVNUX1BUUk4sIHBhdHRlcm4sIHNpemVvZih0U2lyV293bERlbEJjYXN0UHRybikpCisgICAgICAgICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MpCisgICAgeworICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwgRkwoIlNlbmQgb2YgZVdOSV9QTUNfV09XTF9ERUxfQkNBU1RfUFRSTiB0byBQRSBmYWlsZWQiKSk7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIH0KKworICAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworfQorCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICBcZm4gcG1jRW50ZXJXb3dsCisgICAgXGJyaWVmICBSZXF1ZXN0IHRoYXQgdGhlIGRldmljZSBiZSBicm91Z2h0IHRvIGZ1bGwg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N0YXRlVXBkYXRlSW5kTGlzdCk7Cit9CisKKwordm9pZCBwbWNDbG9zZURlZmVycmVkTXNnTGlzdCh0cEFuaVNpckdsb2JhbCBwTWFjKQoreworICAgIHRMaXN0RWxlbSAqcEVudHJ5OworICAgIHRQbWNEZWZlcnJlZE1zZyAqcERlZmVycmVkTXNnOworCisgICAgY3NyTExMb2NrKCZwTWFjLT5wbWMuZGVmZXJyZWRNc2dMaXN0KTsKKyAgICB3aGlsZSAoIChwRW50cnkgPSBjc3JMTFJlbW92ZUhlYWQoJnBNYWMtPnBtYy5kZWZlcnJlZE1zZ0xpc3QsIEZBTFNFKSkgKQorICAgIHsKKyAgICAgICAgcERlZmVycmVkTXNnID0gR0VUX0JBU0VfQUREUihwRW50cnksIHRQbWNEZWZlcnJlZE1zZywgbGluayk7CisgICAgICAgIHZvc19tZW1fZnJlZShwRGVmZXJyZWRNc2cpOworICAgIH0KKyAgICBjc3JMTFVubG9jaygmcE1hYy0+cG1jLmRlZmVycmVkTXNnTGlzdCk7CisgICAgY3NyTExDbG9zZSgmcE1hYy0+cG1jLmRlZmVycmVkTXNnTGlzdCk7Cit9CisKKworI2lmZGVmIEZFQVRVUkVfV0xBTl9TQ0FOX1BOTworCitzdGF0aWMgdFNpclJldFN0YXR1cyAKK3BtY1BvcHVsYXRlTWFjSGVhZGVyKCB0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTgqIHBCRCwKKyAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IHR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBzdWJUeXBlLAorICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNBZGRyIHBlZXJBZGRyLAorICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNBZGRyIHNlbGZNYWNBZGRyKQoreworICAgIHRTaXJSZXRTdGF0dXMgICBzdGF0dXNDb2RlID0gZVNJUl9TVUNDRVNTOworICAgIHRwU2lyTWFjTWdtdEhkciBwTWFjSGRyOworICAgIAorICAgIC8vLyBQcmVwYXJlIE1BQyBtYW5hZ2VtZW50IGhlYWRlcgorICAgIHBNYWNIZHIgPSAodHBTaXJNYWNNZ210SGRyKSAocEJEKTsKKworICAgIC8vIFByZXBhcmUgRkMKKyAgICBwTWFjSGRyLT5mYy5wcm90VmVyID0gU0lSX01BQ19QUk9UT0NPTF9WRVJTSU9OOworICAgIHBNYWNIZHItPmZjLnR5cGUgICAgPSB0eXBlOworICAgIHBNYWNIZHItPmZjLnN1YlR5cGUgPSBzdWJUeXBlOworCisgICAgLy8gUHJlcGFyZSBBZGRyZXNzIDEKKyAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKikgcE1hY0hkci0+ZGEsICh0QU5JX1U4ICopIHBlZXJBZGRyLCBzaXplb2YoIHRTaXJNYWNBZGRyICkpOworCisgICAgc2lyQ29weU1hY0FkZHIocE1hY0hkci0+c2Esc2VsZk1hY0FkZHIpOworCisgICAgLy8gUHJlcGFyZSBBZGRyZXNzIDMKKyAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKikgcE1hY0hkci0+YnNzSWQsICh0QU5JX1U4ICopIHBlZXJBZGRyLCBzaXplb2YoIHRTaXJNYWNBZGRyICkpOworICAgIHJldHVybiBzdGF0dXNDb2RlOworfSAvKioqIHBtY1BvcHVsYXRlTWFjSGVhZGVyKCkgKioqLworCisKK3N0YXRpYyB0U2lyUmV0U3RhdHVzCitwbWNQcmVwYXJlUHJvYmVSZXFUZW1wbGF0ZSh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAgICAgICAgbkNoYW5uZWxOdW0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAgICAgICBkb3QxMW1vZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjQWRkciAgICBzZWxmTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICA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fQorCisgICAgCisgICAgaWYgKElTX0RPVDExX01PREVfSFQoZG90MTFtb2RlKSkKKyAgICB7CisgICAgICAgUG9wdWxhdGVEb3QxMWZIVENhcHMoIHBNYWMsIE5VTEwsICZwci5IVENhcHMgKTsKKyAgICB9CisgICAgCisgICAgLy8gVGhhdCdzIGl0LS0gbm93IHdlIHBhY2sgaXQuICBGaXJzdCwgaG93IG11Y2ggc3BhY2UgYXJlIHdlIGdvaW5nIHRvCisgICAgLy8gbmVlZD8KKyAgICBuU3RhdHVzID0gZG90MTFmR2V0UGFja2VkUHJvYmVSZXF1ZXN0U2l6ZSggcE1hYywgJnByLCAmblBheWxvYWQgKTsKKyAgICBpZiAoIERPVDExRl9GQUlMRUQoIG5TdGF0dXMgKSApCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICJGYWlsZWQgdG8gY2FsY3VsYXRlIHRoZSBwYWNrZWQgc2l6ZSBmIgorICAgICAgICAgICAgICAgICAgIm9yIGEgUHJvYmUgUmVxdWVzdCAoMHglMDh4KS4iLCBuU3RhdHVzICk7CisKKyAgICAgICAgLy8gV2UnbGwgZmFsbCBiYWNrIG9uIHRoZSB3b3JzdCBjYXNlIHNjZW5hcmlvOgorICAgICAgICBuUGF5bG9hZCA9IHNpemVvZiggdERvdDExZlByb2JlUmVxdWVzdCApOworICAgIH0KKyAgICBlbHNlIGlmICggRE9UMTFGX1dBUk5FRCggblN0YXR1cyApICkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIlRoZXJlIHdlcmUgd2FybmluZ3Mgd2hpbGUgY2FsY3VsYXRpbmciCisgICAgICAgICAgICAgICAgICAidGhlIHBhY2tlZCBzaXplIGZvciBhIFByb2JlIFJlcXVlc3QgKCIKKyAgICAgICAgICAgICAgICAgICIweCUwOHgpLiIsIG5TdGF0dXMgKTsKKyAgICB9CisKKyAgICBuQnl0ZXMgPSBuUGF5bG9hZCArIHNpemVvZiggdFNpck1hY01nbXRIZHIgKTsKKyAgCisgICAgLyogUHJlcGFyZSBvdXRnb2luZyBmcmFtZSovCisgICAgdm9zX21lbV9zZXQocEZyYW1lLCBuQnl0ZXMsIDApOworCisgICAgLy8gTmV4dCwgd2UgZmlsbCBvdXQgdGhlIGJ1ZmZlciBkZXNjcmlwdG9yOgorICAgIG5TaXJTdGF0dXMgPSBwbWNQb3B1bGF0ZU1hY0hlYWRlciggcE1hYywgcEZyYW1lLCBTSVJfTUFDX01HTVRfRlJBTUUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfTUdNVF9QUk9CRV9SRVEsIGJzc0lkLHNlbGZNYWNBZGRyKTsKKworICAgIGlmICggZVNJUl9TVUNDRVNTICE9IG5TaXJTdGF0dXMgKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICJGYWlsZWQgdG8gcG9wdWxhdGUgdGhlIGJ1ZmZlciBkZXNjcmlwdG9yIGZvciBhIFByb2JlIFJlcXVlc3QgKCVkKS4iLAorICAgICAgICAgICAgICAgIG5TaXJTdGF0dXMgKTsKKyAgICAgICAgcmV0dXJuIG5TaXJTdGF0dXM7ICAgICAgLy8gYWxsb2NhdGVkIQorICAgIH0KKworICAgIC8vIFRoYXQgZG9uZSwgcGFjayB0aGUgUHJvYmUgUmVxdWVzdDoKKyAgICBuU3RhdHVzID0gZG90MTFmUGFja1Byb2JlUmVxdWVzdCggcE1hYywgJnByLCBwRnJhbWUgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoIHRTaXJNYWNNZ210SGRyICksCisgICAgICAgICAgICAgICAgICAgICAgICA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FDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICBGTCgiTmV0d29yayBjb3VudCBpcyAwIikpOworICAgICAgICAgICAgY3NyUmVsZWFzZUNvbW1hbmQocE1hYywgcENvbW1hbmQpOworICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgIH0KKyAgICAgICAgLypNdXN0IHRyYW5zbGF0ZSB0aGUgbW9kZSBmaXJzdCovCisgICAgICAgIHVjRG90MTFNb2RlID0gKHRBTklfVTgpIGNzclRyYW5zbGF0ZVRvV05JQ2ZnRG90MTFNb2RlKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JGaW5kQmVzdFBoeU1vZGUoIHBNYWMsIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ucGh5TW9kZSApKTsKKworICAgICAgICBpZiAocFJlcXVlc3RCdWYtPnVzMjRHUHJvYmVUZW1wbGF0ZUxlbiB8fAorICAgICAgICAgICAgICAgICBwUmVxdWVzdEJ1Zi0+dXM1R1Byb2JlVGVtcGxhdGVMZW4pCisgICAgICAgIHsKKyAgICAgICAgICAgIHRtcCA9IHZvc19tZW1fbWFsbG9jKFNJUl9QTk9fTUFYX1BCX1JFUV9TSVpFKTsKKyAgICAgICAgICAgIGlmICh0bXAgPT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgRkwoImZhaWxlZCB0byBhbGxvY2F0ZSBtZW1vcnkiKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBDb250aW51ZSBldmVuIG1lbSBhbGxvYyBmYWlscyBhcyBkcml2ZXIgY2FuIHN0aWxsIGdvIGFoZWFkCisgICAgICAgICAgICAgKiB3aXRob3V0IHN1cHBsaWNhbnQgSUUncyBpbiBwcm9iZSByZXEuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgfQorCisgICAgICAgIGlmIChOVUxMICE9IHRtcCkKKyAgICAgICAgeworICAgICAgICAgICAgbGVuID0gcFJlcXVlc3RCdWYtPnVzMjRHUHJvYmVUZW1wbGF0ZUxlbjsKKyAgICAgICAgICAgIGlmICgwICE9IGxlbiAmJiBsZW4gPD0gU0lSX1BOT19NQVhfUEJfUkVRX1NJWkUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHRtcCwgcFJlcXVlc3RCdWYtPnAyNEdQcm9iZVRlbXBsYXRlLCBsZW4pOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLypQcmVwYXJlIGEgcHJvYmUgcmVxdWVzdCBmb3IgMi40R0h6IGJhbmQgYW5kIG9uZSBmb3IgNUdIeiBiYW5kKi8KKyAgICAgICAgaWYgKGVTSVJfU1VDQ0VTUyA9PSBwbWNQcmVwYXJlUHJvYmVSZXFUZW1wbGF0ZShwTWFjLCBTSVJfUE5PXzI0R19ERUZBVUxUX0NILAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVjRG90MTFNb2RlLCBwU2Vzc2lvbi0+c2VsZk1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJlcXVlc3RCdWYtPnAyNEdQcm9iZVRlbXBsYXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwUmVxdWVzdEJ1Zi0+dXMyNEdQcm9iZVRlbXBsYXRlTGVuKSkKKyAgICAgICAgeworICAgICAgICAgICAgLyogQXBwZW5kIElFIHBhc3NlZCBieSBzdXBwbGljYW50KGlmIGFueSkgdG8gcHJvYmUgcmVxdWVzdCAqLworICAgICAgICAgICAgaWYgKCgwIDwgbGVuKSAmJigocFJlcXVlc3RCdWYtPnVzMjRHUHJvYmVUZW1wbGF0ZUxlbiArIGxlbikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwgU0lSX1BOT19NQVhfUEJfUkVRX1NJWkUgKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKikmcFJlcXVlc3RCdWYtPnAyNEdQcm9iZVRlbXBsYXRlICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSZXF1ZXN0QnVmLT51czI0R1Byb2JlVGVtcGxhdGVMZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bXAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZW4pOworICAgICAgICAgICAgICAgIHBSZXF1ZXN0QnVmLT51czI0R1Byb2JlVGVtcGxhdGVMZW4gKz0gbGVuOworICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAiJXM6IHVzMjRHUHJvYmVUZW1wbGF0ZUxlbiA9ICVkIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgcFJlcXVlc3RCdWYtPnVzMjRHUHJvYmVUZW1wbGF0ZUxlbik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAiJXM6IEV4dHJhIGllIGRpc2NhcmRlZCBvbiAyLjRHLCBJRSBsZW5ndGggPSAlZCBNYXggSUUgbGVuZ3RoIGlzICVkIiwKKyAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcFJlcXVlc3RCdWYtPnVzMjRHUHJvYmVUZW1wbGF0ZUxlbiwgU0lSX1BOT19NQVhfUEJfUkVRX1NJWkUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgbGVuID0gMDsKKyAgICAgICAgaWYgKE5VTEwgIT0gdG1wKQorICAgICAgICB7CisgICAgICAgICAgICBsZW4gPSBwUmVxdWVzdEJ1Zi0+dXM1R1Byb2JlVGVtcGxhdGVMZW47CisgICAgICAgICAgICBpZiAoMCAhPSBsZW4gJiYgbGVuIDw9IFNJUl9QTk9fTUFYX1BCX1JFUV9TSVpFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSh0bXAsIHBSZXF1ZXN0QnVmLT5wNUdQcm9iZVRlbXBsYXRlLCBsZW4pOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKGVTSVJfU1VDQ0VTUyA9PSBwbWNQcmVwYXJlUHJvYmVSZXFUZW1wbGF0ZShwTWFjLCBTSVJfUE5PXzVHX0RFRkFVTFRfQ0gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVjRG90MTFNb2RlLCBwU2Vzc2lvbi0+c2VsZk1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSZXF1ZXN0QnVmLT5wNUdQcm9iZVRlbXBsYXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFJlcXVlc3RCdWYtPnVzNUdQcm9iZVRlbXBsYXRlTGVuKSkKKyAgICAgICAgeworICAgICAgICAgICAgLyogQXBwZW5kIElFIHBhc3NlZCBieSBzdXBwbGljYW50KGlmIGFueSkgdG8gcHJvYmUgcmVxdWVzdCAqLworICAgICAgICAgICAgaWYgKCgwIDwgbGVuKSAmJigocFJlcXVlc3RCdWYtPnVzNUdQcm9iZVRlbXBsYXRlTGVuICsgbGVuKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPCBTSVJfUE5PX01BWF9QQl9SRVFfU0laRSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4ICopJnBSZXF1ZXN0QnVmLT5wNUdQcm9iZVRlbXBsYXRlICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcFJlcXVlc3RCdWYtPnVzNUdQcm9iZVRlbXBsYXRlTGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0bXAsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGxlbik7CisgICAgICAgICAgICAgICAgcFJlcXVlc3RCdWYtPnVzNUdQcm9iZVRlbXBsYXRlTGVuICs9IGxlbjsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAiJXM6IHVzNUdQcm9iZVRlbXBsYXRlTGVuID0gJWQiLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgIHBSZXF1ZXN0QnVmLT51czVHUHJvYmVUZW1wbGF0ZUxlbik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBFeHRyYSBJRSBkaXNjYXJkZWQgb24gNUcsIElFIGxlbmd0aCA9ICVkIE1heCBJRSBsZW5ndGggaXMgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHBSZXF1ZXN0QnVmLT51czVHUHJvYmVUZW1wbGF0ZUxlbiwgU0lSX1BOT19NQVhfUEJfUkVRX1NJWkUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChOVUxMICE9IHRtcCkKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZSh0bXApOworICAgIH0KKyAgICBwQ29tbWFuZC0+Y29tbWFuZCA9IGVTbWVDb21tYW5kUG5vUmVxOworICAgIHBDb21tYW5kLT5zZXNzaW9uSWQgPSAodEFOSV9VOClzZXN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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogTmFtZTogIHBtY0xvZ0R1bXAuYworKgorKiBEZXNjcmlwdGlvbjogSW1wbGVtZW50cyB0aGUgZHVtcCBjb21tYW5kcyBzcGVjaWZpYyB0byBQTUMgbW9kdWxlCisqCisqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNpbmNsdWRlICJwYWxUeXBlcy5oIgorI2luY2x1ZGUgImFuaUdsb2JhbC5oIgorI2luY2x1ZGUgInBtY0FwaS5oIgorI2luY2x1ZGUgInBtYy5oIgorI2luY2x1ZGUgImxvZ0R1bXAuaCIKKyNpbmNsdWRlICJzbXNEZWJ1Zy5oIgorI2luY2x1ZGUgInNtZV9BcGkuaCIKKyNpbmNsdWRlICJjZmdBcGkuaCIKKworI2lmIGRlZmluZWQoQU5JX0xPR0RVTVApCisKK3ZvaWQgZHVtcF9wbWNfY2FsbGJhY2tSb3V0aW5lICh2b2lkICpjYWxsYmFja0NvbnRleHQsIGVIYWxTdGF0dXMgc3RhdHVzKQoreworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSAodHBBbmlTaXJHbG9iYWwpY2FsbGJhY2tDb250ZXh0OworICAgIHBtY0xvZyhwTWFjLCBMT0dXLCAiKioqKioqKioqUmVjZWl2ZWQgY2FsbGJhY2sgZnJvbSBQTUMgd2l0aCBzdGF0dXMgPSAlZFxuKioqKioqKioqIixzdGF0dXMpOworfQorCisjaWZkZWYgV0xBTl9XQUtFVVBfRVZFTlRTCit2b2lkIGR1bXBfcG1jX2NhbGxiYWNrUm91dGluZTIgKHZvaWQgKmNhbGxiYWNrQ29udGV4dCwgdHBTaXJXYWtlUmVhc29uSW5kIHBXYWtlUmVhc29uSW5kKQoreworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWM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ICBpZihhcmcxID09IDEpCisgICAgeworICAgICAgICB3b3dsRW50ZXJQYXJhbXMudWNNYWdpY1BrdEVuYWJsZSA9IDE7CisgICAgICAgIC8qIG1hZ2ljIHBhY2tldCAqLworICAgICAgICBsZW5ndGggPSBTSVJfTUFDX0FERFJfTEVOR1RIOworICAgICAgICBzdGF0dXMgPSB3bGFuX2NmZ0dldFN0cihwTWFjLCBXTklfQ0ZHX1NUQV9JRCwgKHRBTklfVTggKil3b3dsRW50ZXJQYXJhbXMubWFnaWNQdHJuLCAmbGVuZ3RoKTsgCisgICAgICAgIGlmIChlU0lSX1NVQ0NFU1MgIT0gc3RhdHVzKQorICAgICAgICB7CisgICAgICAgICAgICBwbWNMb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAiUmVhZGluZyBvZiBXTklfQ0ZHX1NUQV9JRCBmcm9tIENGRyBmYWlsZWQuIFVzaW5nIGhhcmRjb2RlZCBTVEEgTUFDIEFkZHJcbiIpOworICAgICAgICAgICAgd293bEVudGVyUGFyYW1zLm1hZ2ljUHRyblswXSA9IDB4MDA7CisgICAgICAgICAgICB3b3dsRW50ZXJQYXJhbXMubWFnaWNQdHJuWzFdID0gMHgwYTsKKyAgICAgICAgICAgIHdvd2xFbnRlclBhcmFtcy5tYWdpY1B0cm5bMl0gPSAweGY1OworICAgICAgICAgICAgd293bEVudGVyUGFyYW1zLm1hZ2ljUHRyblszXSA9IDB4MDQ7CisgICAgICAgICAgICB3b3dsRW50ZXJQYXJhbXMubWFnaWNQdHJuWzRdID0gMHgwNTsKKyAgICAgICAgICAgIHdvd2xFbnRlclBhcmFtcy5tYWdpY1B0cm5bNV0gPSAweDA2OworICAgICAgICB9CisgICAgfQorICAgIGlmKGFyZzIgPT0gMSkKKyAgICB7CisgICAgICB3b3dsRW50ZXJQYXJhbXMudWNQYXR0ZXJuRmlsdGVyaW5nRW5hYmxlID0gMTsKKyAgICB9CisKKyAgICBpZihhcmczID09IENTUl9ST0FNX1NFU1NJ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gT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTLiBJTiBOTyBFVkVOVCBTSEFMTCBUSEUKKyAqIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsIElORElSRUNULCBPUiBDT05TRVFVRU5USUFMCisgKiBEQU1BR0VTIE9SIEFOWSBEQU1BR0VTIFdIQVRTT0VWRVIgUkVTVUxUSU5HIEZST00gTE9TUyBPRiBVU0UsIERBVEEgT1IKKyAqIFBST0ZJVFMsIFdIRVRIRVIgSU4gQU4gQUNUSU9OIE9GIENPTlRSQUNULCBORUdMSUdFTkNFIE9SIE9USEVSCisgKiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SCisgKiBQRVJGT1JNQU5DRSBPRiBUSElTIFNPRlRXQVJFLgorICovCisKKy8qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIAorICBcZmlsZSAgc21lX1JybS5jCisgIAorICBcYnJpZWYgaW1wbGVtZW50YXRpb24gZm9yIFNNRSBSUk0gQVBJcworICAKKyAgCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qICRIZWFkZXIkICovCisKKyNpZiBkZWZpbmVkIFdMQU5fRkVBVFVSRV9WT1dJRkkKKy8qLS0tLS0tLS0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JbmQoIHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRDc3JTY2FuUmVzdWx0SW5mbyAqKnBSZXN1bHRBcnIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggbWVhc3VyZW1lbnREb25lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IGJzc19jb3VudCApCit7CisgICB0cFNpckJzc0Rlc2NyaXB0aW9uIHBCc3NEZXNjID0gTlVMTDsKKyAgIHRwU2lyQmVhY29uUmVwb3J0WG1pdEluZCBwQmVhY29uUmVwOworICAgdEFOSV9VMTYgbGVuZ3RoLCBpZV9sZW47CisgICB0QU5JX1U4IGJzc0NvdW50ZXI9MCwgbXNnQ291bnRlcj0wOworICAgdENzclNjYW5SZXN1bHRJbmZvICpwQ3VyUmVzdWx0PU5VTEw7CisgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICB0cFJybVNNRUNvbnRleHQgcFNtZVJybUNvbnRleHQgPSAmcE1hYy0+cnJtLnJybVNtZUNvbnRleHQ7CisKKworI2lmIGRlZmluZWQgV0xBTl9WT1dJRklfREVCVUcKKyAgIHNtc0xvZyggcE1hYywgTE9HRSwgIkJlYWNvbiByZXBvcnQgeG1pdCBJbmQgdG8gUEUiKTsKKyNlbmRpZgorCisgICBpZiggTlVMTCA9PSBwUmVzdWx0QXJyICYmICFtZWFzdXJlbWVudERvbmUgKQorICAgeworICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAiQmVhY29uIHJlcG9ydCB4bWl0IEluZCB0byBQRSBGYWlsZWQiKTsKKyAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgfQorCisgICBpZiAocFJlc3VsdEFycikKKyAgICAgICBwQ3VyUmVzd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XJNYWNBZGRyKSApOworCisgICAgICAgbXNnQ291bnRlcj0wOworICAgICAgIHdoaWxlIChwQ3VyUmVzdWx0KSAKKyAgICAgICB7CisgICAgICAgICAgIHBCc3NEZXNjID0gJnBDdXJSZXN1bHQtPkJzc0Rlc2NyaXB0b3I7CisgICAgICAgICAgIGlmKHBCc3NEZXNjICE9IE5VTEwpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGllX2xlbiA9IEdFVF9JRV9MRU5fSU5fQlNTKCBwQnNzRGVzYy0+bGVuZ3RoICk7CisgICAgICAgICAgICAgICBwQmVhY29uUmVwLT5wQnNzRGVzY3JpcHRpb25bbXNnQ291bnRlcl0gPSB2b3NfbWVtX21hbGxvYyAoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGllX2xlbitzaXplb2YodFNpckJzc0Rlc2NyaXB0aW9uKSk7CisgICAgICAgICAgICAgICBpZiAoTlVMTCA9PSBwQmVhY29uUmVwLT5wQnNzRGVzY3JpcHRpb25bbXNnQ291bnRlcl0pCisgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICB2b3NfbWVtX3plcm8ocEJlYWNvblJlcC0+cEJzc0Rlc2NyaXB0aW9uW21zZ0NvdW50ZXJdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGllX2xlbitzaXplb2YodFNpckJzc0Rlc2NyaXB0aW9uKSk7CisgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoIHBCZWFjb25SZXAtPnBCc3NEZXNjcmlwdGlvblttc2dDb3VudGVyXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJzc0Rlc2MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyQnNzRGVzY3JpcHRpb24pICk7CisgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoICZwQmVhY29uUmVwLT5wQnNzRGVzY3JpcHRpb25bbXNnQ291bnRlcl0tPmllRmllbGRzWzBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQnNzRGVzYy0+aWVGaWVsZHMsIGllX2xlbiAgKTsKKyAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HMSwKKyAgICAgICAgICAgICAgICAgICAiLi4uUlJNIFJlc3VsdCBCc3NpZCA9ICJNQUNfQUREUkVTU19TVFIiIGNoYW49ICVkLCByc3NpID0gLSVkIiwKKyAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwQmVhY29uUmVwLT5wQnNzRGVzY3JpcHRpb25bbXNnQ291bnRlcl0tPmJzc0lkKSwKKyAgICAgICAgICAgICAgICAgICBwQmVhY29uUmVwLT5wQnNzRGVzY3JpcHRpb25bbXNnQ291bnRlcl0tPmNoYW5uZWxJZCwKKyAgICAgICAgICAgICAgICAgICBwQmVhY29uUmVwLT5wQnNzRGVzY3JpcHRpb25bbXNnQ291bnRlcl0tPnJzc2kgKiAoLTEpKTsKKworICAgICAgICAgICAgICAgcEJlYWNvblJlcC0+bnVtQnNzRGVzYysrOworCisgICAgICAgICAgICAgICBpZiAoKyttc2dDb3VudGVyID49IFNJUl9CQ05fUkVQT1JUX01BWF9CU1NfREVTQykKKyAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgcEN1clJlc3VsdCA9IHBSZXN1bHRBcnJbYnNzQ291bnRlciArIG1zZ0NvdW50ZXJdOworICAgICAgICAgICB9CisgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgcEN1clJlc3VsdCA9IE5VTEw7CisgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgfQorICAgICAgIH0KKworICAgICAgIGJzc0NvdW50ZXIrPW1zZ0NvdW50ZXI7IAorICAgICAgIGlmICghcFJlc3VsdEFyciB8fCAocEN1clJlc3VsdCA9PSBOVUxMKSB8fCAoYnNzQ291bnRlciA+PSBic3NfY291bnQpKQorICAgICAgIHsKKyAgICAgICAgICA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mVzdWx0cyh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAgICAgICBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggICAgICAgIGNoYW5uZWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRDc3JTY2FuUmVzdWx0SW5mbyAqKnBSZXN1bHRBcnIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggICAgICAgIG1lYXN1cmVtZW50RG9uZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAgICAgICAgYnNzX2NvdW50KQoreworICAgZUhhbFN0YXR1cyAgICAgICAgICAgICAgc3RhdHVzICAgICAgICAgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgdFNpclJldFN0YXR1cyAgICAgICAgICAgZmlsbEllU3RhdHVzOworICAgdHBTaXJCc3NEZXNjcmlwdGlvbiAgICAgcEJzc0Rlc2MgICAgICAgPSBOVUxMOworICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgaWVfbGVuICAgICAgICAgPSAwOworICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgb3V0SWVMZW4gICAgICAgPSAwOworICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgYnNzQ291bnRlciAgICAgPSAwOworICAgdENzclNjYW5SZXN1bHRJbmZvICAgICAqcEN1clJlc3VsdCAgICAgPSBOVUxMOworICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgbXNnQ291bnRlciAgICAgPSAwOworICAgdHBScm1TTUVDb250ZXh0ICAgICAgICAgcFNtZVJybUNvbnRleHQgPSAmcE1hYy0+cnJtLnJybVNtZUNvbnRleHQ7CisgICB0Q3NyUm9hbUluZm8gICAgICAgICAgICByb2FtSW5mbzsKKyAgIHRTaXJFc2VCY25SZXBvcnRSc3AgICAgIGJjblJlcG9ydDsKKyAgIHRwU2lyRXNlQmNuUmVwb3J0UnNwICAgIHBCY25SZXBvcnQgICAgID0gJmJjblJlcG9ydDsKKyAgIHRwQ3NyRXNlQmVhY29uUmVxUGFyYW1zIHBDdXJNZWFzUmVxSWUgID0gTlVMTDsKKyAgIHRBTklfVTggICAgICAgICAgICAgICAgIGkgICAgICAgICAgICAgID0gMDsKKworICAgaWYgKE5VTEwgPT0gcFNtZVJybUNvbnRleHQpCisgICB7CisgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAicFNtZVJybUNvbnRleHQgaXMgTlVMTCIpOworICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgfQorCisgICBpZiAoTlVMTCA9PSBwUmVzdWx0QXJyICYmICFtZWFzdXJlbWVudERvbmUpCisgICB7CisgICAgICBzbXNMb2coIHBNYWMsIExPR0UsICJCZWFjb24gcmVwb3J0IHhtaXQgSW5kIHRvIEhERCBGYWlsZWQiKTsKKyAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgfQorCisgICBpZiAocFJlc3VsdEFycikKKyAgICAgICBwQ3VyUmVzdWx0PXBSZXN1bHRBcnJbYnNzQ291bnRlcl07CisKKyAgIHZvc19tZW1femVybygmYmNuUmVwb3J0LCBzaXplb2YodFNpckVzZUJjblJlcG9ydFJzcCkpOworICAgZG8KKyAgIHsKKyAgICAgICBwQ3VyTWVhc1JlcUllID0gTlVMTDsKKyAgICAgICBmb3IgKGkgPSAwOyBpIDwgcFNtZVJybUNvbnRleHQtPmVzZUJjblJlcUluZm8ubnVtQmNuUmVxSWU7IGkrKykKKyAgICAgICB7CisgICAgICAgICAgIGlmKHBTbWVScm1Db250ZXh0LT5lc2VCY25SZXFJbmZvLmJjblJlcVtpXS5jaGFubmVsID09IGNoYW5uZWwpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHBDdXJNZWFzUmVxSWUgPSAmcFNtZVJybUNvbnRleHQtPmVzZUJjblJlcUluZm8uYmNuUmVxW2ldOworICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgIH0KKyAgICAgICB9CisgICAgICAgaWYoTlVMTCAhPSBwQ3VyTWVhc1JlcUllKQorICAgICAgICAgICBwQmNuUmVwb3J0LT5tZWFzdXJlbWVudFRva2VuID0gcEN1ck1lYXNSZXFJZS0+bWVhc3VyZW1lbnRUb2tlbjsKKyAgICAgICBzbXNMb2coIHBNYWMsIExPRzEsICJDaGFubmVsKCVkKSBNZWFzVG9rZW4oJWQpIiwgY2hhbm5lbCwgcEJjblJlcG9ydC0+bWVhc3VyZW1lbnRUb2tlbik7CisKKyAgICAgICBtc2dDb3VudGVyPTA7CisgICAgICAgd2hpbGUgKHBDdXJSZXN1bHQpCisgICAgICAgeworICAgICAgICAgICBwQnNzRGVzYyA9ICZwQ3VyUmVzdWx0LT5Cc3NEZXNjcmlwdG9yOworICAgICAgICAgICBpZiAoTlVMTCAhPSBwQnNzRGVzYykKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgaWVfbGVuID0gR0VUX0lFX0xFTl9JTl9CU1MoIHBCc3NEZXNjLT5sZW5ndGggKTsKKyAgICAgICAgICAgICAgIHBCY25SZXBvcnQtPmJjblJlcEJzc0luZm9bbXNnQ291bnRlcl0uYmNuUmVwb3J0RmllbGRzLkNoYW5OdW0gPSBwQnNzRGVzYy0+Y2hhbm5lbElkOworICAgICAgICAgICAgICAgcEJjblJlcG9ydC0+YmNuUmVwQnNzSW5mb1ttc2dDb3VudGVyXS5iY25SZXBvcnRGaWVsZHMuU3BhcmUgPSAwOworICAgICAgICAgICAgICAgaWYoTlVMTCAhPSBwQ3VyTWVhc1JlcUllKQorICAgICAgICAgICAgICAgICAgIHBCY25SZXBvcnQtPmJjblJlcEJzc0luZm9bbXNnQ291bnRlcl0uYmNuUmVwb3J0Rmllb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QmNuUmVwb3J0LT5iY25SZXBCc3NJbmZvW21zZ0NvdW50ZXJdLmJjblJlcG9ydEZpZWxkcy5Cc3NpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJzc0Rlc2MtPmJzc0lkLCBzaXplb2YodFNpck1hY0FkZHIpKTsKKworICAgICAgICAgICAgICAgZmlsbEllU3RhdHVzID0gc2lyRmlsbEJlYWNvbk1hbmRhdG9yeUlFZm9yRXNlQmNuUmVwb3J0KHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTggKilwQnNzRGVzYy0+aWVGaWVsZHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWVfbGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYocEJjblJlcG9ydC0+YmNuUmVwQnNzSW5mb1ttc2dDb3VudGVyXS5wQnVmKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb3V0SWVMZW4pOworICAgICAgICAgICAgICAgaWYgKGVTSVJfRkFJTFVSRSA9PSBmaWxsSWVTdGF0dXMpCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIHBCY25SZXBvcnQtPmJjblJlcEJzc0luZm9bbXNnQ291bnRlcl0uaWVMZW4gPSBvdXRJZUxlbjsKKworICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0cxLCJCc3NpZCgiTUFDX0FERFJFU1NfU1RSIikgQ2hhbm5lbD0lZCBSc3NpPSVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocEJzc0Rlc2MtPmJzc0lkKSwKKyAgICAgICAgICAgICAgICAgICAgICAgcEJzc0Rlc2MtPmNoYW5uZWxJZCwgKC0xKSAqIHBCc3NEZXNjLT5yc3NpKTsKKworICAgICAgICAgICAgICAgcEJjblJlcG9ydC0+bnVtQnNzKys7CisKKyAgICAgICAgICAgICAgIGlmICgrK21zZ0NvdW50ZXIgPj0gU0lSX0JDTl9SRVBPUlRfTUFYX0JTU19ERVNDKQorICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICBwQ3VyUmVzdWx0ID0gcFJlc3VsdEFyclttc2dDb3VudGVyXTsKKyAgICAgICAgICAgfQorICAgICAgICAgICBlbHNlCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHBDdXJSZXN1bHQgPSBOVUxMOworICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgIH0KKyAgICAgICB9CisKKyAgICAgICBic3NDb3VudGVyICs9IG1zZ0NvdW50ZXI7CisgICAgICAgaWYgKCFwUmVzdWx0QXJyIHx8ICFwQ3VyUmVzdWx0IHx8IChic3NDb3VudGVyID49IFNJUl9CQ05fUkVQT1JUX01BWF9CU1NfREVTQykpCisgICAgICAgeworICAgICAgICAgICBwQ3VyUmVzdWx0ID0gTlVMTDsKKyAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAiUmVhY2hlZCB0byB0aGUgbWF4L2xhc3QgQlNTIGluIHBDdXJSZXN1bHQgbGlzdCIpOworICAgICAgIH0KKyAgICAgICBlbHNlCisgICAgICAgeworICAgICAgICAgICBwQ3VyUmVzdWx0ID0gcFJlc3VsdEFycltic3NDb3VudGVyXTsKKyAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAiTW92ZSB0byB0aGUgbmV4dCBCU1Mgc2V0IGluIHBDdXJSZXN1bHQgbGlzdCIpOworICAgICAgIH0KKworICAgICAgI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LS0tLS0tLS0tLS0KKyAgCisgIFxicmllZiBzbWVfUnJtU2VuZFNjYW5SZXF1ZXN0KCkgLSAKKworICAgVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgdG8gZ2V0IHRoZSBzY2FuIHJlc3VsdCBmcm9tIENTUiBhbmQgc2VuZCB0aGUgYmVhY29uIHJlcG9ydAorICAgeG1pdCBpbmQgbWVzc2FnZSB0byBQRS4KKworICBccGFyYW0gIC0gcE1hYyAtIFBvaW50ZXIgdG8gdGhlIEhhbCBIYW5kbGUuCisgICAgICAgICAgICAgIC0gbnVtX2NoYW4gLSBudW1iZXIgb2YgY2hhbm5lbHMuCisgICAgICAgICAgICAgIC0gY2hhbm5lbCBsaXN0IC0gbGlzdCBvZiBjaGFubmVscyB0byBmZXRjaCB0aGUgcmVzdWx0IGZyb20uCisgICAgICAgICAgICAgIC0gbWVhc3VyZW1lbnREb25lIC0gZmxhZyB0byBpbmRpY2F0ZSB0aGF0IHRoZSBtZWFzdXJlbWVudCBpcyBkb25lLiAgICAgICAgCisgIFxyZXR1cm4gLSAwIGZvciBzdWNjZXNzLCBub24gemVybyBmb3IgZmFpbHVyZQorICAKKyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworc3RhdGljIGVIYWxTdGF0dXMgc21lX1JybVNlbmRTY2FuUmVzdWx0KCB0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IG51bV9jaGFuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4KiBjaGFuTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBtZWFzdXJlbWVudERvbmUgKQoreworICAgdENzclNjYW5SZXN1bHRGaWx0ZXIg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G8KKyAgICAgIC8vIHNlbmQgYSB4bWl0IGluZGljYXRpb24gd2l0aCBtb3JlVG9Gb2xsb3cgc2V0IHRvIE1FQVNVUk1FTlRfRE9ORQorICAgICAgLy8gc28gdGhhdCBQRSBjYW4gY2xlYW4gYW55IGNvbnRleHQgYWxsb2NhdGVkLgorICAgICAgaWYoIG1lYXN1cmVtZW50RG9uZSApCisgICAgICB7CisjaWYgZGVmaW5lZChGRUFUVVJFX1dMQU5fRVNFX1VQTE9BRCkKKyAgICAgICAgIGlmIChlUlJNX01TR19TT1VSQ0VfRVNFX1VQTE9BRCA9PSBwU21lUnJtQ29udGV4dC0+bXNnU291cmNlKQorICAgICAgICAgeworICAgICAgICAgICAgIHN0YXR1cyA9IHNtZV9Fc2VTZW5kQmVhY29uUmVxU2NhblJlc3VsdHMocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFuTGlzdFswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVhc3VyZW1lbnREb25lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UKKyNlbmRpZiAvKkZFQVRVUkVfV0xBTl9FU0VfVVBMT0FEKi8KKyAgICAgICAgICAgICBzdGF0dXMgPSBzbWVfUnJtU2VuZEJlYWNvblJlcG9ydFhtaXRJbmQoIHBNYWMsIE5VTEwsIG1lYXN1cmVtZW50RG9uZSwgMCk7CisgICAgICB9CisgICAgICByZXR1cm4gc3RhdHVzOworICAgfQorCisgICBwU2NhblJlc3VsdCA9IHNtZV9TY2FuUmVzdWx0R2V0Rmlyc3QocE1hYywgcFJlc3VsdCk7CisKKyAgIGlmKCBOVUxMID09IHBTY2FuUmVzdWx0ICYmIG1lYXN1cmVtZW50RG9uZSApCisgICB7CisjaWYgZGVmaW5lZChGRUFUVVJFX1dMQU5fRVNFX1VQTE9BRCkKKyAgICAgICBpZiAoZVJSTV9NU0dfU09VUkNFX0VTRV9VUExPQUQgPT0gcFNtZVJybUNvbnRleHQtPm1zZ1NvdXJjZSkKKyAgICAgICB7CisgICAgICAgICAgIHN0YXR1cyA9IHNtZV9Fc2VTZW5kQmVhY29uUmVxU2NhblJlc3VsdHMocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbkxpc3RbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZWFzdXJlbWVudERvbmUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCk7CisgICAgICAgfQorICAgICAgIGVsc2UKKyNlbmRpZiAvKkZFQVRVUkVfV0xBTl9FU0VfVVBMT0FEKi8KKyAgICAgICAgICAgc3RhdHVzID0gc21lX1JybVNlbmRCZWFjb25SZXBvcnRYbWl0SW5kKCBwTWFjLCBOVUxMLCBtZWFzdXJlbWVudERvbmUsIDAgKTsKKyAgIH0KKworICAgY291bnRlcj0wOworICAgd2hpbGUgKHBTY2FuUmVzdWx0KQorICAgeworICAgICAgcE5leHRSZXN1bHQgPSBzbWVfU2NhblJlc3VsdEdldE5leHQocE1hYywgcFJlc3VsdCk7CisgICAgICBwU2NhblJlc3VsdHNBcnJbY291bnRlcisrXSA9IHBTY2FuUmVzdWx0OworICAgICAgcFNjYW5SZXN1bHQgPSBwTmV4dFJlc3VsdDsgLy9zbWVfU2NhblJlc3VsdEdldE5leHQoaEhhbCwgcFJlc3VsdCk7CisgICAgICBpZiAoY291bnRlciA+PSBTSVJfQkNOX1JFUE9SVF9NQVhfQlNTX0RFU0MpCisgICAgICAgICBicmVhazsKKyAgICAgIH0KKworICAgaWYgKGNvdW50ZXIpCisgICB7CisgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsICIgTnVtYmVyIG9mIEJTUyBEZXNjIHdpdGggUlJNIFNjYW4gJWQgIiwgY291bnRlcik7CisjaWYgZGVmaW5lZChGRUFUVVJFX1dMQU5fRVNFX1VQTE9BRCkKKyAgICAgICAgIGlmIChlUlJNX01TR19TT1VSQ0VfRVNFX1VQTE9BRCA9PSBwU21lUnJtQ29udGV4dC0+bXNnU291cmNlKQorICAgICAgICAgeworICAgICAgICAgICAgIHN0YXR1cyA9IHNtZV9Fc2VTZW5kQmVhY29uUmVxU2NhblJlc3VsdHMocE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5MaXN0WzBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjYW5SZXN1bHRzQXJyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVhc3VyZW1lbnREb25lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY291bnRlcik7CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisjZW5kaWYgLypGRUFUVVJFX1dMQU5fRVNFX1VQTE9BRCovCisgICAgICAgICAgICAgc3RhdHVzID0gc21lX1JybVNlbmRCZWFjb25SZXBvcnRYbWl0SW5kKCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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bmd0aCkKKyAgICAgICB7CisgICAgICAgICAgc2NhblJlcXVlc3QuU1NJRHMubnVtT2ZTU0lEcyA9IDE7CisgICAgICAgICAgc2NhblJlcXVlc3QuU1NJRHMuU1NJRExpc3QgPSggdENzclNTSURJbmZvICopdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRDc3JTU0lESW5mbykpOworICAgICAgICAgIGlmIChOVUxMID09IHNjYW5SZXF1ZXN0LlNTSURzLlNTSURMaXN0KQorICAgICAgICAgIHsKKyAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dQLCBGTCgidm9zX21lbV9tYWxsb2MgZmFpbGVkOiIpICk7CisgICAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgIH0KKyNpZiBkZWZpbmVkIFdMQU5fVk9XSUZJX0RFQlVHCisgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiQWxsb2NhdGVkIG1lbW9yeSBmb3IgcFNTSURMaXN0IikpOworI2VuZGlmCisgICAgICAgICAgdm9zX21lbV96ZXJvKCBzY2FuUmVxdWVzdC5TU0lEcy5TU0lETGlzdCwgc2l6ZW9mKHRDc3JTU0lESW5mbykgKTsKKyAgICAgICAgICBzY2FuUmVxdWVzdC5TU0lEcy5TU0lETGlzdC0+U1NJRC5sZW5ndGggPSBwU21lUnJtQ29udGV4dC0+c3NJZC5sZW5ndGg7CisgICAgICAgICAgdm9zX21lbV9jb3B5KHNjYW5SZXF1ZXN0LlNTSURzLlNTSURMaXN0LT5TU0lELnNzSWQsIHBTbWVScm1Db250ZXh0LT5zc0lkLnNzSWQsIHBTbWVScm1Db250ZXh0LT5zc0lkLmxlbmd0aCk7CisgICAgICAgfQorCisgICAgICAgLyogc2V0IG1pbiBhbmQgbWF4IGNoYW5uZWwgdGltZSAqLworICAgICAgIHNjYW5SZXF1ZXN0Lm1pbkNoblRpbWUgPSAwOyAvL3BTbWVScm1Db250ZXh0LT5kdXJhdGlvbjsgRG9udCB1c2UgbWluIHRpbWVvdXQuCisgICAgICAgaWYoIGVSUk1fTVNHX1NPVVJDRV9FU0VfVVBMT0FEID09IHBTbWVScm1Db250ZXh0LT5tc2dTb3VyY2UgfHwKKyAgICAgICAgICAgZVJSTV9NU0dfU09VUkNFX0xFR0FDWV9FU0UgPT0gcFNtZVJybUNvbnRleHQtPm1zZ1NvdXJjZSApCisgICAgICAgICAgc2NhblJlcXVlc3QubWF4Q2huVGltZSA9IHBTbWVScm1Db250ZXh0LT5kdXJhdGlvbltwU21lUnJtQ29udGV4dC0+Y3VycmVudEluZGV4XTsKKyAgICAgICBlbHNlCisgICAgICAgICAgc2NhblJlcXVlc3QubWF4Q2huVGltZSA9IHBTbWVScm1Db250ZXh0LT5kdXJhdGlvblswXTsKKworICAgICAgIHNtc0xvZyggcE1hYywgTE9HMSwgIlNjYW4gVHlwZSglcyAoJWQpKSBNYXggRHdlbGwgVGltZSglZCkiLAorICAgICAgICAgICAgICAgbGltX1NjYW5UeXBldG9TdHJpbmcoc2NhblJlcXVlc3Quc2NhblR5cGUpLAorICAgICAgICAgICAgICAgc2NhblJlcXVlc3Quc2NhblR5cGUsCisgICAgICAgICAgICAgICBzY2FuUmVxdWVzdC5tYXhDaG5UaW1lICk7CisKKyNpZiBkZWZpbmVkIFdMQU5fVk9XSUZJX0RFQlVHCisgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAiRm9yIER1cmF0aW9uICVkICIsIHNjYW5SZXF1ZXN0Lm1heENoblRpbWUgKTsKKyNlbmRpZgorCisgICAgICAgLyogc2V0IEJTU1R5cGUgdG8gZGVmYXVsdCB0eXBlICovCisgICAgICAgc2NhblJlcXVlc3QuQlNTVHlwZSA9IGVDU1JfQlNTX1RZUEVfQU5ZOworCisgICAgICAgLypTY2FuIGFsbCB0aGUgY2hhbm5lbHMgKi8KKyAgICAgICBzY2FuUmVxdWVzdC5DaGFubmVsSW5mby5udW1PZkNoYW5uZWxzID0gMTsKKworICAgICA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sICJjaGFubmVsID09ICVkICAiLCBwQmVhY29uUmVxLT5jaGFubmVsSW5mby5jaGFubmVsTnVtICk7CisjZW5kaWYKKyAgICAgICAgIGlmKGNzclJvYW1Jc0NoYW5uZWxWYWxpZCggcE1hYywgcEJlYWNvblJlcS0+Y2hhbm5lbEluZm8uY2hhbm5lbE51bSApKQorICAgICAgICAgICAgcFNtZVJybUNvbnRleHQtPmNoYW5uZWxMaXN0LkNoYW5uZWxMaXN0W3BTbWVScm1Db250ZXh0LT5jaGFubmVsTGlzdC5udW1PZkNoYW5uZWxzKytdID0gcEJlYWNvblJlcS0+Y2hhbm5lbEluZm8uY2hhbm5lbE51bTsKKyNpZiBkZWZpbmVkIFdMQU5fVk9XSUZJX0RFQlVHCisgICAgICAgICBlbHNlCisgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsICJpcyBJbnZhbGlkIGNoYW5uZWwsIElnbm9yaW5nIHRoaXMgY2hhbm5lbCIgKTsKKyNlbmRpZgorICAgICAgfQorCisgICAgICBmb3IgKCBpID0gMCA7IGkgPCBwQmVhY29uUmVxLT5jaGFubmVsTGlzdC5udW1DaGFubmVsczsgaSsrICkKKyAgICAgIHsKKyAgICAgICAgIGlmKGNzclJvYW1Jc0NoYW5uZWxWYWxpZCggcE1hYywgcEJlYWNvblJlcS0+Y2hhbm5lbExpc3QuY2hhbm5lbE51bWJlcltpXSApKQorICAgICAgICAgeworICAgICAgICAgICAgcFNtZVJybUNvbnRleHQtPmNoYW5uZWxMaXN0LkNoYW5uZWxMaXN0W3BTbWVScm1Db250ZXh0LT5jaGFubmVsTGlzdC5udW1PZkNoYW5uZWxzXSA9IHBCZWFjb25SZXEtPmNoYW5uZWxMaXN0LmNoYW5uZWxOdW1iZXJbaV07CisgICAgICAgICAgICBwU21lUnJtQ29udGV4dC0+Y2hhbm5lbExpc3QubnVtT2ZDaGFubmVscysrOworICAgICAgICAgfQorICAgICAgfQorICAgfQorCisgICAvL0NvcHkgc2Vzc2lvbiBic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BbmlTaXJHbG9iYWwgcE1hYywgdHBScm1OZWlnaGJvclJlcG9ydERlc2MgcE5laWdoYm9yUmVwb3J0RGVzYykKK3sKKyAgICB0cFNpck5laWdoYm9yQnNzRGVzY3JpcHRvbiAgcE5laWdoYm9yQnNzRGVzYzsKKyAgICB0QU5JX1UzMiAgICByb2FtU2NvcmUgPSAwOworICAgIAorICAgIGlmIChOVUxMID09IHBOZWlnaGJvclJlcG9ydERlc2MpCisgICAgeworICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICByZXR1cm47CisgICAgfQorICAgIGlmIChOVUxMID09IHBOZWlnaGJvclJlcG9ydERlc2MtPnBOZWlnaGJvckJzc0Rlc2NyaXB0aW9uKQorICAgIHsKKyAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHBOZWlnaGJvckJzc0Rlc2MgPSBwTmVpZ2hib3JSZXBvcnREZXNjLT5wTmVpZ2hib3JCc3NEZXNjcmlwdGlvbjsKKworICAgIGlmIChwTmVpZ2hib3JCc3NEZXNjLT5ic3NpZEluZm8ucnJtSW5mby5mTW9iaWxpdHlEb21haW4pCisgICAgeworICAgICAgICByb2FtU2NvcmUgKz0gUlJNX1JPQU1fU0NPUkVfTkVJR0hCT1JfUkVQT1JUX01PQklMSVRZX0RPTUFJTjsKKyAgICAgICAgaWYgKHBOZWlnaGJvckJzc0Rlc2MtPmJzc2lkSW5mby5ycm1JbmZvLmZTYW1lU2VjdXJpdHlNb2RlKQorICAgICAgICB7CisgICAgICAgICAgICByb2FtU2NvcmUgKz0gUlJNX1JPQU1fU0NPUkVfTkVJR0hCT1JfUkVQT1JUX1NFQ1VSSVRZOworICAgICAgICAgICAgaWYgKHBOZWlnaGJvckJzc0Rlc2MtPmJzc2lkSW5mby5ycm1JbmZvLmZTYW1lQXV0aGVudGljYXRvcikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByb2FtU2NvcmUgKz0gUlJNX1JPQU1fU0NPUkVfTkVJR0hCT1JfUkVQT1JUX0tFWV9TQ09QRTsKKyAgICAgICAgICAgICAgICBpZiAocE5laWdoYm9yQnNzRGVzYy0+YnNzaWRJbmZvLnJybUluZm8uZkNhcFJhZGlvTWVhc3VyZW1lbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICByb2FtU2NvcmUgKz0gUlJNX1JPQU1fU0NPUkVfTkVJR0hCT1JfUkVQT1JUX0NBUEFCSUxJVFlfUlJNOworICAgICAgICAgICAgICAgICAgICBpZiAocE5laWdoYm9yQnNzRGVzYy0+YnNzaWRJbmZvLnJybUluZm8uZkNhcFNwZWN0cnVtTWVhc3VyZW1lbnQpCisgICAgICAgICAgICAgICAgICAgICAgICByb2FtU2NvcmUgKz0gUlJNX1JPQU1fU0NPUkVfTkVJR0hCT1JfUkVQT1JUX0NBUEFCSUxJVFlfU1BFQ1RSVU1fTUdNVDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHBOZWlnaGJvckJzc0Rlc2MtPmJzc2lkSW5mby5ycm1JbmZvLmZDYXBRb3MpCisgICAgICAgICAgICAgICAgICAgICAgICByb2FtU2NvcmUgKz0gUlJNX1JPQU1fU0NPUkVfTkVJR0hCT1JfUkVQT1JUX0NBUEFCSUxJVFlfUU9TOworICAgICAgICAgICAgICAgICAgICBpZiAocE5laWdoYm9yQnNzRGVzYy0+YnNzaWRJbmZvLnJybUluZm8uZkNhcEFwc2QpCisgICAgICAgICAgICAgICAgICAgICAgICByb2FtU2NvcmUgKz0gUlJNX1JPQU1fU0NPUkVfTkVJR0hCT1JfUkVQT1JUX0NBUEFCSUxJVFlfQVBTRDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHBOZWlnaGJvckJzc0Rlc2MtPmJzc2lkSW5mby5ycm1JbmZvLmZDYXBEZWxheWVkQmxvY2tBY2spCisgICAgICAgICAgICAgICAgICAgICAgICByb2FtU2NvcmUgKz0gUlJNX1JPQU1fU0NPUkVfTkVJR0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3RvIGVuZDsKKyAgICAgICAgICAgIAorICAgICAgIH0KKworICAgICAgIHZvc19tZW1femVybyhwTmVpZ2hib3JSZXBvcnREZXNjLCBzaXplb2YodFJybU5laWdoYm9yUmVwb3J0RGVzYykpOworICAgICAgIHBOZWlnaGJvclJlcG9ydERlc2MtPnBOZWlnaGJvckJzc0Rlc2NyaXB0aW9uID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRTaXJOZWlnaGJvckJzc0Rlc2NyaXB0aW9uKSk7CisgICAgICAgaWYgKE5VTEwgPT0gcE5laWdoYm9yUmVwb3J0RGVzYy0+cE5laWdoYm9yQnNzRGVzY3JpcHRpb24pCisgICAgICAgeworICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsICJGYWlsZWQgdG8gYWxsb2NhdGUgbWVtb3J5IGZvciBSUk0gTmVpZ2hib3IgcmVwb3J0IEJTUyBEZXNjcmlwdGlvbiIpOworICAgICAgICAgICB2b3NfbWVtX2ZyZWUocE5laWdoYm9yUmVwb3J0RGVzYyk7CisgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxFRF9BTExPQzsKKyAgICAgICAgICAgZ290byBlbmQ7CisgICAgICAgfQorICAgICAgIHZvc19tZW1femVybyhwTmVpZ2hib3JSZXBvcnREZXNjLT5wTmVpZ2hib3JCc3NEZXNjcmlwdGlvbiwgc2l6ZW9mKHRTaXJOZWlnaGJvckJzc0Rlc2NyaXB0aW9uKSk7CisgICAgICAgdm9zX21lbV9jb3B5KHBOZWlnaGJvclJlcG9ydERlc2MtPnBOZWlnaGJvckJzc0Rlc2NyaXB0aW9uLCAmcE5laWdoYm9yUnB0LT5zTmVpZ2hib3JCc3NEZXNjcmlwdGlvbltpXSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck5laWdoYm9yQnNzRGVzY3JpcHRpb24pKTsKKworI2lmIGRlZmluZWQgV0xBTl9WT1dJR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9IDUwOyAvL21zCisKKyAgIHZvc1N0YXR1cyA9IHZvc190aW1lcl9pbml0KCAmcFNtZVJybUNvbnRleHQtPkl0ZXJNZWFzVGltZXIsCisKKyAgICAgICAgICAgICAgICAgICAgICBWT1NfVElNRVJfVFlQRV9TVywKKworICAgICAgICAgICAgICAgICAgICAgIHJybUl0ZXJNZWFzVGltZXJIYW5kbGUsCisKKyAgICAgICAgICAgICAgICAgICAgICAodm9pZCopIHBNYWMpOworCisgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKSB7CisKKyAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgInJybU9wZW46IEZhaWwgdG8gaW5pdCB0aW1lciIpOworCisgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgfQorCisgICB2b3NTdGF0dXMgPSB2b3NfdGltZXJfaW5pdCggJnBTbWVScm1Db250ZXh0LT5uZWlnaGJvclJlcUNvbnRyb2xJbmZvLm5laWdoYm9yUnNwV2FpdFRpbWVyLAorCisgICAgICAgICAgICAgICAgICAgICAgVk9TX1RJTUVSX1RZUEVfU1csCisKKyAgICAgICAgICAgICAgICAgICAgICBycm1OZWlnaGJvclJzcFRpbWVvdXRIYW5kbGVyLAorCisgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKSBwTWFjKTsKKworICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zU3RhdHVzKSkgeworCisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJycm1PcGVuOiBGYWlsIHRvIGluaXQgdGltZXIiKTsKKworICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgIH0KKworICAgcFNtZVJybUNvbnRleHQtPm5laWdoYm9yUmVxQ29udHJvbEluZm8ua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OworICAgdHBScm1TTUVDb250ZXh0IHBTbWVScm1Db250ZXh0ID0gJnBNYWMtPnJybS5ycm1TbWVDb250ZXh0OworCisgICBpZiggVk9TX1RJTUVSX1NUQVRFX1JVTk5JTkcgPT0gdm9zX3RpbWVyX2dldEN1cnJlbnRTdGF0ZSggJnBTbWVScm1Db250ZXh0LT5JdGVyTWVhc1RpbWVyICkgKQorICAgeworICAgICAgdm9zU3RhdHVzID0gdm9zX3RpbWVyX3N0b3AoICZwU21lUnJtQ29udGV4dC0+SXRlck1lYXNUaW1lciApOworICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJUaW1lciBzdG9wIGZhaWwiKSApOworICAgICAgfQorICAgfQorCisgICB2b3NTdGF0dXMgPSB2b3NfdGltZXJfZGVzdHJveSggJnBTbWVScm1Db250ZXh0LT5JdGVyTWVhc1RpbWVyICk7CisgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICAgeworCisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIEZMKCJGYWlsIHRvIGRlc3Ryb3kgdGltZXIiKSApOworCisgICB9CisKKyAgIGlmKCBWT1NfVElNRVJfU1RBVEVfUlVOTklORyA9PQorICAgICAgICAgIHZvc190aW1lcl9nZXRDdXJyZW50U3RhdGUoICZwU21lUnJtQ29udGV4dC0+bmVpZ2hib3JSZXFDb250cm9sSW5mby5uZWlnaGJvclJzcFdhaXRUaW1lciApICkKKyAgIHsKKyAgICAgIHZvc1N0YXR1cyA9IHZvc190aW1lcl9zdG9wKCAmcFNtZVJybUNvbnRleHQtPm5laWdoYm9yUmVxQ29udHJvbEluZm8ubmVpZ2hib3JSc3BXYWl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VU0UsIERBVEEgT1IKKyAqIFBST0ZJVFMsIFdIRVRIRVIgSU4gQU4gQUNUSU9OIE9GIENPTlRSQUNULCBORUdMSUdFTkNFIE9SIE9USEVSCisgKiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SCisgKiBQRVJGT1JNQU5DRSBPRiBUSElTIFNPRlRXQVJFLgorICovCisKKy8qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisKKworCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgXGZpbGUgIHNtZUFwaS5jCisKKyAgXGJyaWVmIERlZmluaXRpb25zIGZvciBTTUUgQVBJcworCisKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgIEVESVQgSElTVE9SWSBGT1IgRklMRQorCisKKyAgVGhpcyBzZWN0aW9uIGNvbnRhaW5zIGNvbW1lbnRzIGRlc2NyaWJpbmcgY2hhbmdlcyBtYWRlIHRvIHRoZSBtb2R1bGUuCisgIE5vdGljZSB0aGF0IGNoYW5nZXMgYXJlIGxpc3RlZCBpbiByZXZlcnNlIGNocm9ub2xvZ2ljYWwgb3JkZXIuCisKKworCisgIHdoZ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aykgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gKHN0YXR1cyk7Cit9CisKKworCitzdGF0aWMgZUhhbFN0YXR1cyBpbml0U21lQ21kTGlzdCh0cEFuaVNpckdsb2JhbCBwTWFjKQoreworICAgIGVIYWxTdGF0dXMgc3RhdHVzOworICAgIHRTbWVDbWQgKnBDbWQ7CisgICAgdEFOSV9VMzIgY21kX2lkeDsKKyAgICBWT1NfU1RBVFVTIHZvc1N0YXR1czsKKyAgICB2b3NfdGltZXJfdCogY21kVGltZW91dFRpbWVyID0gTlVMTDsKKworICAgIHBNYWMtPnNtZS50b3RhbFNtZUNtZCA9IFNNRV9UT1RBTF9DT01NQU5EOworICAgIGlmICghSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cyA9IGNzckxMT3BlbihwTWFjLT5oSGRkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0KSkpCisgICAgICAgZ290byBlbmQ7CisKKyAgICBpZiAoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMgPSBjc3JMTE9wZW4ocE1hYy0+aEhkZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICZwTWFjLT5zbWUuc21lQ21kUGVuZGluZ0xpc3QpKSkKKyAgICAgICBnb3RvIGVuZDsKKworICAgIGlmICghSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cyA9IGNzckxMT3BlbihwTWFjLT5oSGRkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBNYWMtPnNtZS5zbWVTY2FuQ21kQWN0aXZlTGlzdCkpKQorICAgICAgIGdvdG8gZW5kOworCisgICAgaWYgKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzID0gY3NyTExPcGVuKHBNYWMtPmhIZGQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwTWFjLT5zbWUuc21lU2NhbkNtZFBlbmRpbmdMaXN0KSkpCisgICAgICAgZ290byBlbmQ7CisKKyAgICBpZiAoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMgPSBjc3JMTE9wZW4ocE1hYy0+aEhkZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwTWFjLT5zbWUuc21lQ21kRnJlZUxpc3QpKSkKKyAgICAgICBnb3RvIGVuZDsKKworICAgIHBDbWQgPSAodFNtZUNtZCAqKSB2b3NfbWVtX3ZtYWxsb2Moc2l6ZW9mKHRTbWVDbWQpICogcE1hYy0+c21lLnRvdGFsU21lQ21kKTsKKyAgICBpZiAoIE5VTEwgPT0gcENtZCApCisgICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICBGTCgiZmFpbCB0byBhbGxvY2F0ZSBtZW1vcnkgJWx1IiksCisgICAgICAgICAgICAgICAgICAgICh1bnNpZ25lZCBsb25nKShzaXplb2YodFNtZUNtZCkgKiBwTWFjLT5zbWUudG90YWxTbWVDbWQpKTsKKyAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisKKyAgICAgICB2b3NfbWVtX3NldChwQ21kLCBzaXplb2YodFNtZUNtZCkgKiBwTWFjLT5zbWUudG90YWxTbWVDbWQsIDApOworICAgICAgIHBNYWMtPnNtZS5wU21lQ21kQnVmQWRkciA9IHBDbWQ7CisKKyAgICAgICBmb3IgKGNtZF9pZHggPSAwOyBjbWRfaWR4IDwgcE1hYy0+c21lLnRvdGFsU21lQ21kOyBjbWRfaWR4KyspCisgICAgICAgeworICAgICAgICAgICBjc3JMTEluc2VydFRhaWwoJnBNYWMtPnNtZS5zbWVDbWRGcmVlTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICZwQ21kW2NtZF9pZHhdLkxpbmssIExMX0FDQ0VTU19MT0NLKTsKKyAgICAgICB9CisgICAgfQorCisgICAgLyogVGhpcyB0aW1lciBpcyBvbmx5IHRvIGRlYnVnIHRoZSBhY3RpdmUgbGlzdCBjb21tYW5kIHRpbWVvdXQgKi8KKworICAgIGNtZFRpbWVvdXRUaW1lciA9ICh2b3NfdGltZXJfdCopdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHZvc190aW1lcl90KSk7CisgICAgaWYgKGNtZFRpbWVvdXRUaW1lcikKKyAgICB7CisgICAgICAgIHBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0LmNtZFRpbWVvdXRUaW1lciA9IGNtZFRpbWVvdXRUaW1lcjsKKyAgICAgICAgdm9zU3RhdHVzID0KKyAgICAgICAgICAgIHZvc190aW1lcl9pbml0KCBwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdC5jbWRUaW1lb3V0VGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVElNRVJfVFlQRV9TVywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZUxpc3RDbWRUaW1lb3V0SGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKSBwTWFjKTsKKworICAgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiSW5pdCBUaW1lciBmYWlsIGZvciBhY3RpdmUgbGlzdCBjb21tYW5kIHByb2Nlc3MgdGltZSBvdXQiKTsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdC5jbWRUaW1lb3V0VGltZXIpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QuY21kVGltZW91dER1cmF0aW9uID0KKyAgICAgICAgICAgICAgICBDU1JfQUNUSVZFX0xJU1RfQ01EX1RJTUVPVVRfVkFMVUU7CisgICAgICAgIH0KKyAgICB9CitlbmQ6CisgICAgaWYgKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgImZhaWxlZCB0byBpbml0aWFsaXplIHNtZSBjb21tYW5kIGxpc3Q6JWRcbiIsCisgICAgICAgICAgICAgIHN0YXR1cyk7CisKKyAgICByZXR1cm4gKHN0YXR1cyk7Cit9CisKKwordm9pZCBzbWVSZWxlYXNlQ29tbWFuZCh0cEFuaVNpckdsb2JhbCBwTWFjLCB0U21lQ21kICpwQ21kKQoreworICAgIHBDbWQtPmNvbW1hbmQgPSBlU21lTm9Db21tYW5kOworICAgIGNzckxMSW5zZXJ0VGFpbCgmcE1hYy0+c21lLnNtZUNtZEZyZWVMaXN0LCAmcENtZC0+TGluaywgTExfQUNDRVNTX0xPQ0spOworfQorCisKKworc3RhdGljIHZvaWQgc21lUmVsZWFzZUNtZExpc3QodHBBbmlTaXJHbG9iYWwgcE1hYywgdERibExpbmtMaXN0ICpwTGlzdCkKK3sKKyAgICB0TGlzdEVsZW0gKnBFbnRyeTsKKyAgICB0U21lQ21kICpwQ29tbWFuZDsKKworICAgIHdoaWxlKChwRW50cnkgPSBjc3JMTFJlbW92ZUhlYWQocExpc3QsIExMX0FDQ0VTU19MT0NLKSkgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIC8vVE9ETzogYmFzZSBvbiBjb21tYW5kIHR5cGUgdG8gY2FsbCByZWxlYXNlIGZ1bmN0aW9ucworICA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lzdDsKKworICAgIHZvc19tZW1femVybygmbG9jYWxMaXN0LCBzaXplb2YodERibExpbmtMaXN0KSk7CisgICAgaWYoIUhBTF9TVEFUVVNfU1VDQ0VTUyhjc3JMTE9wZW4ocE1hYy0+aEhkZCwgJmxvY2FsTGlzdCkpKQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgZmFpbGVkIHRvIG9wZW4gbGlzdCIpKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGNzckxMTG9jayhwTGlzdCk7CisgICAgcEVudHJ5ID0gY3NyTExQZWVrSGVhZChwTGlzdCwgTExfQUNDRVNTX05PTE9DSyk7CisgICAgd2hpbGUocEVudHJ5ICE9IE5VTEwpCisgICAgeworICAgICAgICBwTmV4dCA9IGNzckxMTmV4dChwTGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTk9MT0NLKTsKKyAgICAgICAgcENvbW1hbmQgPSBHRVRfQkFTRV9BRERSKCBwRW50cnksIHRTbWVDbWQsIExpbmsgKTsKKyAgICAgICAgaWYocENvbW1hbmQtPnNlc3Npb25JZCA9PSBzZXNzaW9uSWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKGNzckxMUmVtb3ZlRW50cnkocExpc3QsIHBFbnRyeSwgTExfQUNDRVNTX05PTE9DSykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY3NyTExJbnNlcnRUYWlsKCZsb2NhbExpc3QsIHBFbnRyeSwgTExfQUNDRVNTX05PTE9DSyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcEVudHJ5ID0gcE5leHQ7CisgICAgfQorICAgIGNzckxMVW5sb2NrKHBMaXN0KTsKKworICAgIHdoaWxlKCAocEVudHJ5ID0gY3NyTExSZW1vdmVIZWFkKCZsb2NhbExpc3QsIExMX0FDQ0VTU19OT0xPQ0spKSApCisgICAgeworICAgICAgICBwQ29tbWFuZCA9IEdFVF9CQVNFX0FERFIoIHB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MX1NUQVRVU19TVUNDRVNTKQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICBGTCgiRmFpbGVkIHRvIGFjcXVpcmUgdGhlIGxvY2sgc3RhdHVzID0gJWQiKSwgc3RhdHVzKTsKKyAgICAgICAgZ290byBkb25lOworICAgIH0KKworICAgIGlmKE5VTEwgIT0gcE1hYy0+c21lLnBTbWVDbWRCdWZBZGRyKQorICAgIHsKKyAgICAgICAgdm9zX21lbV92ZnJlZShwTWFjLT5zbWUucFNtZUNtZEJ1ZkFkZHIpOworICAgICAgICBwTWFjLT5zbWUucFNtZUNtZEJ1ZkFkZHIgPSBOVUxMOworICAgIH0KKworICAgIHN0YXR1cyA9IHZvc19sb2NrX3JlbGVhc2UoJnBNYWMtPnNtZS5sa1NtZUdsb2JhbExvY2spOworICAgIGlmKHN0YXR1cyAhPSBlSEFMX1NUQVRVU19TVUNDRVNTKQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICBGTCgiRmFpbGVkIHRvIHJlbGVhc2UgdGhlIGxvY2sgc3RhdHVzID0gJWQiKSwgc3RhdHVzKTsKKyAgICB9Citkb25lOgorICAgIHJldHVybiAoc3RhdHVzKTsKK30KKworCit2b2lkIGR1bXBDc3JDb21tYW5kSW5mbyh0cEFuaVNpckdsb2JhbCBwTWFjLCB0U21lQ21kICpwQ21kKQoreworICAgIHN3aXRjaCggcENtZC0+Y29tbWFuZCApCisgICAgeworICAgIGNhc2UgZVNtZUNvbW1hbmRTY2FuOgorICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsICIgc2NhbiBjb21tYW5kIHJlYXNvbiBpcyAlZCIsIHBDbWQtPnUuc2NhbkNtZC5yZWFzb24gKTsKKyAgICAgICAgYnJlYWs7CisKKyAgICBjYXNlIGVTbWVDb21tYW5kUm9hbToKKyAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAiIHJvYW0gY29tbWFuZCByZWFzb24gaXMgJWQiLCBwQ21kLT51LnJvYW1DbWQucm9hbVJlYXNvbiApOworICAgICAgICBicmVhazsKKworICAgIGNhc2UgZVNtZUNvbW1hbmRXbVN0YXR1c0NoYW5nZToKKyAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAiIFdNU3RhdHVzQ2hhbmdlIGNvbW1hbmQgdHlwZSBpcyAlZCIsIHBDbWQtPnUud21TdGF0dXNDaGFuZ2VDbWQuVHlwZSApOworICAgICAgICBicmVhazsKKworICAgIGNhc2UgZVNtZUNvbW1hbmRTZXRLZXk6CisgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgIiBzZXRLZXkgY29tbWFuZCBhdXRoKCVkKSBlbmMoJWQpIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBDbWQtPnUuc2V0S2V5Q21kLmF1dGhUeXBlLCBwQ21kLT51LnNldEtleUNtZC5lbmNUeXBlICk7CisgICAgICAgIGJyZWFrOworCisgICAgY2FzZSBlU21lQ29tbWFuZFJlbW92ZUtleToKKyAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAiIHJlbW92ZUtleSBjb21tYW5kIGF1dGgoJWQpIGVuYyglZCkiLAorICAgICAgICAgICAgICAgICAgICAgICAgcENtZC0+dS5yZW1vdmVLZXlDbWQuYXV0aFR5cGUsIHBDbWQtPnUucmVtb3ZlS2V5Q21kLmVuY1R5cGUgKTsKKyAgICAgICAgYnJlYWs7CisKKyAgICBkZWZhdWx0OgorICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsICIgZGVmYXVsdDogVW5oYW5kbGVkIGNvbW1hbmQgJWQiLAorICAgICAgICAgICAgICAgIHBDbWQtPmNvbW1hbmQpOworICAgICAgICBicmVhazsKKyAgICB9Cit9CisKK3RTbWVDbWQgKnNtZUdldENvbW1hbmRCdWZmZXIoIHRwQW5pU2lyR2xvYmFsIHBNYWMgKQoreworICAgIHRTbWVDbWQgKnBSZXRDbWQgPSBOVUxMLCAqcFRlbX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3V0IG9mIGNvbW1hbmQgYnVmZmVyLi4uLiBTTUUgcGVuZGluZyBjb21tYW5kICMlZCAoMHglWCkiLAorICAgICAgICAgICAgICAgICAgICBpZHgsIHBUZW1wQ21kLT5jb21tYW5kICk7CisgICAgICAgICAgICBpZHgrKzsKKyAgICAgICAgICAgIGlmKCBlU21lQ3NyQ29tbWFuZE1hc2sgJiBwVGVtcENtZC0+Y29tbWFuZCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9DU1IgY29tbWFuZCBpcyBzdHVjay4gU2VlIHdoYXQgdGhlIHJlYXNvbiBjb2RlIGlzIGZvciB0aGF0IGNvbW1hbmQKKyAgICAgICAgICAgICAgICBkdW1wQ3NyQ29tbWFuZEluZm8ocE1hYywgcFRlbXBDbWQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcEVudHJ5ID0gY3NyTExOZXh0KCAmcE1hYy0+c21lLnNtZUNtZFBlbmRpbmdMaXN0LCBwRW50cnksIExMX0FDQ0VTU19OT0xPQ0sgKTsKKyAgICAgICAgfQorICAgICAgICBjc3JMTFVubG9jaygmcE1hYy0+c21lLnNtZUNtZFBlbmRpbmdMaXN0KTsKKworICAgICAgICBpZHggPSAxOworICAgICAgICAvL1RoZXJlIG1heSBiZSBzb21lIG1vcmUgY29tbWFuZCBpbiBDU1IncyBvd24gcGVuZGluZyBxdWV1ZQorICAgICAgICBjc3JMTExvY2soJnBNYWMtPnJvYW0ucm9hbUNtZFBlbmRpbmdMaXN0KTsKKyAgICAgICAgcEVudHJ5ID0gY3NyTExQZWVrSGVhZCggJnBNYWMtPnJvYW0ucm9hbUNtZFBlbmRpbmdMaXN0LCBMTF9BQ0NFU1NfTk9MT0NLICk7CisgICAgICAgIHdoaWxlKHBFbnRyeSAmJiAhc21lQ29tbWFuZFF1ZXVlRnVsbCkKKyAgICAgICAgeworICAgICAgICAgICAgcFRlbXBDbWQgPSBHRVRfQkFTRV9BRERSKCBwRW50cnksIHRTbWVDbWQsIExpbmsgKTsKKyAgICAgICAgICAgIC8qIFByaW50IG9ubHkgMXN0IGZpdmUgY29tbWFuZHMgZnJvbSBDU1IgcGVuZGluZyBxdWV1ZSAqLworICAgICAgICAgICAgaWYgKGlkeCA8PSA1KQorICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgIk91dCBvZiBjb21tYW5kIGJ1ZmZlci4uLkNTUiBwZW5kaW5nIGNvbW1hbmQgIyVkICgweCVYKSIsCisgICAgICAgICAgICAgICAgICAgICAgICBpZHgsIHBUZW1wQ21kLT5jb21tYW5kICk7CisgICAgICAgICAgICBpZHgrKzsKKyAgICAgICAgICAgIGR1bXBDc3JDb21tYW5kSW5mbyhwTWFjLCBwVGVtcENtZCk7CisgICAgICAgICAgICBwRW50cnkgPSBjc3JMTE5leHQoICZwTWFjLT5yb2FtLnJvYW1DbWRQZW5kaW5nTGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTk9MT0NLICk7CisgICAgICAgIH0KKyAgICAgICAgLyoKKyAgICAgICAgICogSW5jcmVhbWVudCBzdGF0aWMgdmFyaWFibGUgc28gdGhhdCBpdCBwcmludHMgcGVuZGluZyBjb21tYW5kCisgICAgICAgICAqIG9ubHkgb25jZQorICAgICAgICAgKi8KKyAgICAgICAgc21lQ29tbWFuZFF1ZXVlRnVsbCsrOworICAgICAgICBjc3JMTFVubG9jaygmcE1hYy0+cm9hbS5yb2FtQ21kUGVuZGluZ0xpc3QpOworCisgICAgICAgLyogcGFuaWMgd2l0aCBvdXQtb2YtY29tbWFuZCAqLworICAgICAgICBWT1NfQlVHKDApOworICAgIH0KKworICAgIGlmKCBwUmV0Q21kICkKKyAgICB7CisgICAgICAgICB2b3NfbWVtX3NldCgodEFOSV9VOCAqKSZwUmV0Q21kLT5jb21tYW5kLCBzaXplb2YocFJldENtZC0+Y29tbWFuZCksIDApOworICAgICAgICAgdm9zX21lbV9zZXQoKHRBTklfVTggKikmcFJldENt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gdEFOSV9CT09MRUFOIGZGdWxsUG93ZXJOZWVkZWQgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgdFBtY1N0YXRlIHBtY1N0YXRlOworICAgIGVIYWxTdGF0dXMgc3RhdHVzOworCisgICAgZG8KKyAgICB7CisgICAgICAgIHBtY1N0YXRlID0gcG1jR2V0UG1jU3RhdGUocE1hYyk7CisKKyAgICAgICAgc3RhdHVzID0gY3NySXNGdWxsUG93ZXJOZWVkZWQoIHBNYWMsIHBDb21tYW5kLCBOVUxMLCAmZkZ1bGxQb3dlck5lZWRlZCApOworICAgICAgICBpZiggIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpICkKKyAgICAgICAgeworICAgICAgICAgICAgLy9QTUMgc3RhdGUgaXMgbm90IHJpZ2h0IGZvciB0aGUgY29tbWFuZCwgZHJvcCBpdAorICAgICAgICAgICAgcmV0dXJuICggZVNtZURyb3BDb21tYW5kICk7CisgICAgICAgIH0KKyAgICAgICAgaWYoIGZGdWxsUG93ZXJOZWVkZWQgICkgYnJlYWs7CisgICAgICAgIGZGdWxsUG93ZXJOZWVkZWQgPSAoICggZVNtZUNvbW1hbmRBZGRUcyA9PSBwQ29tbWFuZC0+Y29tbWFuZCApIHx8CisgICAgICAgICAgICAgICAgICAgICggZVNtZUNvbW1hbmREZWxUcyA9PSAgcENvbW1hbmQtPmNvbW1hbmQgKSApOworICAgICAgICBpZiggZkZ1bGxQb3dlck5lZWRlZCApIGJyZWFrOworI2lmZGVmIEZFQVRVUkVfT0VNX0RBVEFfU1VQUE9SVAorICAgICAgICBmRnVsbFBvd2VyTmVlZGVkID0gKHBtY1N0YXRlID09IElNUFMgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTbWVDb21tYW5kT2VtRGF0YVJlcSA9PSBwQ29tbWFuZC0+Y29tbWFuZCk7CisgICAgICAgIGlmKGZGdWxsUG93ZXJOZWVkZWQpIGJyZWFrOworI2VuZGlmCisgICAgICAgIGZGdWxsUG93ZXJOZWVkZWQgPSAocG1jU3RhdGUgPT0gSU1QUyAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTbWVDb21tYW5kUmVtYWluT25DaGFubmVsID09IHBDb21tYW5kLT5jb21tYW5kKTsKKyAgICAgICAgaWYoZkZ1bGxQb3dlck5lZWRlZCkgYnJlYWs7CisgICAgfSB3aGlsZSgwKTsKKworICAgIGlmKCBmRnVsbFBvd2VyTmVlZGVkICkKKyAgICB7CisgICAgICAgIHN3aXRjaCggcG1jU3RhdGUgKQorICAgICAgICB7CisgICAgICAgIGNhc2UgSU1QUzoKKyAgICAgICAgY2FzZSBTVEFOREJZOgorICAgICAgICAgICAgcG1jQ29tbWFuZCA9IGVTbWVDb21tYW5kRXhpdEltcHM7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIEJNUFM6CisgICAgICAgICAgICBwbWNDb21tYW5kID0gZVNtZUNvbW1hbmRFeGl0Qm1wczsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgVUFQU0Q6CisgICAgICAgICAgICBwbWNDb21tYW5kID0gZVNtZUNvbW1hbmRFeGl0VWFwc2Q7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFdPV0w6CisgICAgICAgICAgICBwbWNDb21tYW5kID0gZVNtZUNvbW1hbmRFeGl0V293bDsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiAoIHBtY0NvbW1hbmQgKTsKK30KKworCisvL0ZvciBjb21tYW5kcyB0aGF0IG5lZWQgdG8gZG8gZXh0cmEgY2xlYW51cC4KK3N0YXRpYyB2b2lkIHNtZUFib3J0Q29tbWFuZCggdHBBbmlTaXJHbG9iYWwgcE1hYywgdFNtZUNtZCAqcENvbW1hbmQsIHRBTklfQk9PTEVBTiBmU3RvcHBpbmcgKQoreworICAgIGlmKCBlU21lUG1jQ29tbWFuZE1hc2sgJiBwQ29tbWFuZC0+Y29tbWFuZCApCisgICAgeworICAgICAgICBwbWNBYm9ydENvbW1hbmQoIHBNYWMsIHBDb21tYW5kLCBmU3RvcHBpbmcgKTsKKyAgICB9CisgICAgZWxzZSBpZiAoIGVTbWVDc3JDb21tYW5kTWFzayAmIHBDb21tYW5kLT5jb21tYW5kICkKKyAgICB7CisgICAgICAgIGNzckFib3J0Q29tbWFuZCggcE1hYywgcENvbW1hbmQsIGZTdG9wcGluZyApOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBzd2l0Y2goIHBDb21tYW5kLT5jb21tYW5kICkKKyAgICAgICAgeworICAgICAgICAgICAgY2FzZSBlU21lQ29tbWFuZFJlbWFpbk9uQ2hhbm5lbDoKKyAgICAgICAgICAgICAgICBpZiAoTlVMTCAhPSBwQ29tbWFuZC0+dS5yZW1haW5DaGxDbWQuY2FsbGJhY2spCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICByZW1haW5PbkNoYW5DYWxsYmFjayBjYWxsYmFjayA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDb21tYW5kLT51LnJlbWFpbkNobENtZC5jYWxsYmFjazsKKyAgICAgICAgICAgICAgICAgICAgLyogcHJvY2VzcyB0aGUgbXNnICovCisgICAgICAgICAgICAgICAgICAgIGlmKCBjYWxsYmFjayApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrKHBNYWMsIHBDb21tYW5kLT51LnJlbWFpbkNobENtZC5jYWxsYmFja0N0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZUNTUl9TQ0FOX0FCT1JUICk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc21lUmVsZWFzZUNvbW1hbmQoIHBNYWMsIHBDb21tYW5kICk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHNtZVJlbGVhc2VDb21tYW5kKCBwTWFjLCBwQ29tbWFuZCApOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorfQorCit0TGlzdEVsZW0gKmNzckdldENtZFRvUHJvY2Vzcyh0cEFuaVNpckdsb2JhbCBwTWFjLCB0RGJsTGlua0xpc3QgKnBMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBzZXNzaW9uSWQsIHRBTklfQk9PTEVBTiBmSW50ZXJsb2NrZWQpCit7CisgICAgdExpc3RFbGVtICpwQ3VyRW50cnkgPSBOVUxMOworICAgIHRTbWVDbWQgKnBDb21tYW5kOworCisgICAgLyogR28gdGhyb3VnaCB0aGUgbGlzdCBhbmQgcmV0dXJuIHRoZSBjb21tYW5kIHdob3NlIHNlc3Npb24gaWQgaXMgbm90CisgICAgICogbWF0Y2hpbmcgd2l0aCB0aGUgY3VycmVudCBvbmdvaW5nIHNjYW4gY21kIHNlc3Npb25JZCAqLworICAgIHBDdXJFbnRyeSA9IGNzckxMUGVla0hlYWQoIHBMaXN0LCBMTF9BQ0NFU1NfTE9DSyApOworICAgIHdoaWxlIChwQ3VyRW50cnkpCisgICAgeworICAgICAgICBwQ29tbWFuZCA9IEdFVF9CQVNFX0FERFIocEN1ckVudHJ5LCB0U21lQ21kLCBMaW5rKTsKKyAgICAgICAgaWYgKHBDb21tYW5kLT5zZXNzaW9uSWQgIT0gc2Vzc2lvbklkKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HMSwgInNlbGVjdGVkIHRoZSBjb21tYW5kIHdpdGggZGlmZmVyZW50IHNlc3Npb25JZCIpOworICAgICAgICAgICAgcmV0dXJuIHBDdXJFbnRyeTsKKyAgICAgICAgfQorCisgICAgICAgIHBDdXJFbnRyeSA9IGNzckxMTmV4dChwTGlzdCwgcEN1ckVudHJ5LCBmSW50ZXJsb2NrZWQpOworICAgIH0KKworICAgIHNtc0xvZyhwTWFjLCBMT0cxLCAiTm8gY29tbWFuZCBwZW5kaW5nIHdpdGggZGlmZmVyZW50IHNlc3Npb25JZCIpOworICAgIHJldHVybiBOVUxMOworfQorCit0QU5JX0JPT0xFQU4gc21lUHJvY2Vzc1NjYW5RdWV1ZSh0cEFuaVNpckdsb2JhbCBwTWFjKQoreworICAgIHRMaXN0RWxlbSAqcEVudHJ5OworICAgIHRTbWVDbWQgKnBDb21tYW5kOworICAgIHRMaXN0RWxlbSAqcFNtZUVudHJ5OworICAgIHRTbWVDbWQgKnBTbWVDb21tYW5kOworICAgIHRBTklfQk9PTEVBTiBzdGF0dXMgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKworICAgIGNzckxMTG9jayggJnBNYWMtPnNtZS5zbWVTY2FuQ21kQWN0aXZlTGlzdCApOworICAgIGlmIChjc3JMTElzTGlzdEVtcHR5KCAmcE1hYy0+c21lLnNtZVNjYW5DbWRBY3RpdmVMaXN0LAorICAgICAgICAgICAgICAgIExMX0FDQ0VTU19OT0xPQ0sgKSkKKyAgICB7CisgICAgICAgIGlmICghY3NyTExJc0xpc3RFbXB0eSgmcE1hYy0+c21lLnNtZVNjYW5DbWRQZW5kaW5nTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgTExfQUNDRVNTX0xPQ0spKQorICAgICAgICB7CisgICAgICAgICAgICBwRW50cnkgPSBjc3JMTFBlZWtIZWFkKCAmcE1hYy0+c21lLnNtZVNjYW5DbWRQZW5kaW5nTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgTExfQUNDRVNTX0xPQ0sgKTsKKyAgICAgICAgICAgIGlmIChwRW50cnkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcENvbW1hbmQgPSBHRVRfQkFTRV9BRERSKCBwRW50cnksIHRTbWVDbWQsIExpbmsgKTsKKyAgICAgICAgICAgICAgICAvL1dlIGNhbm5vdCBleGVjdXRlIGFueSBjb21tYW5kIGluIHdhaXQtZm9yLWtleSBzdGF0ZSB1bnRpbCBzZXRLZXkgaXMgdGhyb3VnaC4KKyAgICAgICAgICAgICAgICBpZiAoQ1NSX0lTX1dBSVRfRk9SX0tFWSggcE1hYywgcENvbW1hbmQtPnNlc3Npb25JZCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAoIUNTUl9JU19TRVRfS0VZX0NPTU1BTkQocENvbW1hbmQpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiAgQ2Fubm90IHByb2Nlc3MgY29tbWFuZCglZCkgd2hpbGUgd2FpdGluZyBmb3Iga2V5IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvbW1hbmQtPmNvbW1hbmQpOworICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgICAgICAgICAgICAgZ290byBlbmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoKCFjc3JMTElzTGlzdEVtcHR5KCZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExMX0FDQ0VTU19MT0NLICkpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcFNtZUVudHJ5ID0gY3NyTExQZWVrSGVhZCgmcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTExfQUNDRVNTX0xPQ0spOworICAgICAgICAgICAgICAgICAgICBpZiAocEVudHJ5KQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgIHBTbWVDb21tYW5kID0gR0VUX0JBU0VfQUREUihwRW50cnksIHRTbWVDbWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMaW5rKSA7CisKKyAgICAgICAgICAgICAgICAgICAgICAgLyogaWYgc2NhbiBpcyBydW5uaW5nIG9uIG9uZSBpbnRlcmZhY2UgYW5kIFNNRSByZWNlaQorICAgICAgICAgICAgICAgICAgICAgICAgICB2ZXMgdGhlIG5leHQgY29tbWFuZCBvbiB0aGUgc2FtZSBpbnRlcmZhY2UgdGhlbgorICAgICAgICAgICAgICAgICAgICAgICAgICBkb250IHRoZSBhbGxvdyB0aGUgY29tbWFuZCB0byBiZSBxdWV1ZWQgdG8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgc21lQ21kUGVuZGluZ0xpc3QuIElmIG5leHQgc2NhbiBpcyBhbGxvd2VkIG9uCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBzYW1lIGludGVyZmFjZSB0aGUgQ1NSIHN0YXRlIG1hY2hpbmUgd2lsbAorICAgICAgICAgICAgICAgICAgICAgICAgICBnZXQgc2NyZXdlZCB1cC4gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBTbWVDb21tYW5kLT5zZXNzaW9uSWQgPT0gcENvbW1hbmQtPnNlc3Npb25JZCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBlbmQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIGNzckxMUmVtb3ZlRW50cnkoICZwTWFjLT5zbWUuc21lU2NhbkNtZFBlbmRpbmdMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFbnRyeSwgTExfQUNDRVNTX0xPQ0sgKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBjc3JMTEluc2VydEhlYWQoICZwTWFjLT5zbWUuc21lU2NhbkNtZEFjdGl2ZUxpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBDb21tYW5kLT5MaW5rLCBMTF9BQ0NFU1NfTk9MT0NLICk7CisKKyAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChwQ29tbWFuZC0+Y29tbWFuZCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBlU21lQ29tbWFuZFNjYW46CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIFByb2Nlc3Npbmcgc2NhbiBvZmZsb2FkIGNvbW1hbmQgIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyUHJvY2Vzc1NjYW5Db21tYW5kKCBwTWFjLCBwQ29tbWFuZCApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgU29tZXRoaW5nIHdyb25nLCB3cm9uZyBjb21tYW5kIGVucXVldWVkIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiB0byBzbWVTY2FuQ21kUGVuZGluZ0xpc3QiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRW50cnkgPSBjc3JMTFJlbW92ZUhlYWQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcE1hYy0+c21lLnNtZVNjYW5DbWRBY3RpdmVMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTExfQUNDRVNTX05PTE9DSyApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDb21tYW5kID0gR0VUX0JBU0VfQUREUiggcEVudHJ5LCB0U21lQ21kLCBMaW5rICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21lUmVsZWFzZUNvbW1hbmQoIHBNYWMsIHBDb21tYW5kICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CitlbmQ6CisgICAgY3NyTExVbmxvY2soJnBNYWMtPnNtZS5zbWVTY2FuQ21kQWN0aXZlTGlzdCk7CisgICAgcmV0dXJuIHN0YXR1czsKK30KKworZUhhbFN0YXR1cyBzbWVQcm9jZXNzUG5vQ29tbWFuZCh0cEFuaVNpckdsb2JhbCBwTWFjLCB0U21lQ21kICpwQ21kKQoreworICAgIHRwU2lyUE5PU2NhblJlcSBwbm9SZXFCdWY7CisgICAgdFNpck1zZ1EgbXNnUTsKKworICAgIHBub1JlcUJ1ZiA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0U2lyUE5PU2NhblJlcSkpOworICAgIGlmICggTlVMTCA9PSBwbm9SZXFCdWYgKQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJmYWlsZWQgdG8gYWxsb2NhdGUgbWVtb3J5IikpOworICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICB9CisKKyAgICB2b3NfbWVtX2NvcHkocG5vUmVxQnVmLCAmKHBDbWQtPnUucG5vSW5mbyksIHNpemVvZih0U2lyUE5PU2NhblJlcSkpOworCisgICAgc21zTG9nKHBNYWMsIExPRzEsIEZMKCJwb3N0IFdEQV9TRVRfUE5PX1JF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ZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgIH0KKworICAgdm9zX21lbV9jb3B5KG1heF90eF9wYXJhbXMtPmJzc0lkLAorICAgICBjb21tYW5kLT51LnNldF90eF9tYXhfcHdyLmJzc2lkLCBTSVJfTUFDX0FERFJfTEVOR1RIKTsKKyAgIHZvc19tZW1fY29weShtYXhfdHhfcGFyYW1zLT5zZWxmU3RhTWFjQWRkciwKKyAgICAgY29tbWFuZC0+dS5zZXRfdHhfbWF4X3B3ci5zZWxmX3N0YV9tYWNfYWRkciwKKyAgICAgICAgICAgICAgICAgU0lSX01BQ19BRERSX0xFTkdUSCk7CisgICBtYXhfdHhfcGFyYW1zLT5wb3dlciA9CisgICAgICAgICAgICAgIGNvbW1hbmQtPnUuc2V0X3R4X21heF9wd3IucG93ZXI7CisKKyAgIG1zZy50eXBlID0gV0RBX1NFVF9NQVhfVFhfUE9XRVJfUkVROworICAgbXNnLnJlc2VydmVkID0gMDsKKyAgIG1zZy5ib2R5cHRyID0gbWF4X3R4X3BhcmFtczsKKworICAgaWYoVk9TX1NUQVRVU19TVUNDRVNTICE9CisgICAgICAgIHZvc19tcV9wb3N0X21lc3NhZ2UoVk9TX01PRFVMRV9JRF9XREEsICZtc2cpKQorICAgeworICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLAorICAgICAgICBGTCgiTm90IGFibGUgdG8gcG9zdCBXREFfU0VUX01BWF9UWF9QT1dFUl9SRVEgbWVzc2FnZSB0byBXREEiKSk7CisgICAgICAgdm9zX21lbV9mcmVlKG1heF90eF9wYXJhbXMpOworICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgfQorICAgcmV0dXJuIGVIQUxfU1RBVFVTX1NVQ0NFU1M7Cit9CisKK3N0YXRpYyB2b2lkIHNtZVByb2Nlc3NOYW5SZXEodHBBbmlTaXJHbG9iYWwgcE1hYywgdFNtZUNtZCAqcENvbW1hbmQgKQoreworICAgIHRTaXJNc2dRIG1z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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMTF9BQ0NFU1NfTE9DSykpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBTbWVFbnRyeSA9IGNzckxMUGVla0hlYWQoJnBNYWMtPnNtZS5zbWVTY2FuQ21kQWN0aXZlTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgIExMX0FDQ0VTU19MT0NLKTsKKyAgICAgICAgICAgICAgICBpZiAocFNtZUVudHJ5KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcFNtZUNvbW1hbmQgPSBHRVRfQkFTRV9BRERSKHBTbWVFbnRyeSwgdFNtZUNtZCwgTGluayk7CisKKyAgICAgICAgICAgICAgICAgICAgcEVudHJ5ID0gY3NyR2V0Q21kVG9Qcm9jZXNzKHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBNYWMtPnNtZS5zbWVDbWRQZW5kaW5nTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU21lQ29tbWFuZC0+c2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIExMX0FDQ0VTU19MT0NLKTsKKyAgICAgICAgICAgICAgICAgICAgZ290byBzbWVfcHJvY2Vzc19jbWQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvL1BlZWsgdGhlIGNvbW1hbmQKKyAgICAgICAgICAgIHBFbnRyeSA9IGNzckxMUGVla0hlYWQoICZwTWFjLT5zbWUuc21lQ21kUGVuZGluZ0xpc3QsIExMX0FDQ0VTU19MT0NLICk7CitzbWVfcHJvY2Vzc19jbWQ6CisgICAgICAgICAgICBpZiggcEVudHJ5ICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwQ29tbWFuZCA9IEdFVF9CQVNFX0FERFIoIHBFbnRyeSwgdFNtZUNtZCwgTGluayApOworCisgICAgICAgICAgICAgICAgLyogQWxsb3cgb25seSBkaXNjb25uZWN0IGNvbW1hbmQKKyAgICAgICAgICAgICAgICAgKiBpbiB3YWl0LWZvci1rZXkgc3RhdGUgdW50aWwgc2V0S2V5IGlzIHRocm91Z2guCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgaWYoIENTUl9JU19XQUlUX0ZPUl9LRVkoIHBNYWMsIHBDb21tYW5kLT5zZXNzaW9uSWQgKSAmJgorICAgICAgICAgICAgICAgICAgICAhQ1NSX0lTX0RJU0NPTk5FQ1RfQ09NTUFORCggcENvbW1hbmQgKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiggIUNTUl9JU19TRVRfS0VZX0NPTU1BTkQoIHBDb21tYW5kICkgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBjc3JMTFVubG9jayggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0ICk7CisgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIlNlc3Npb25JZCAlZDogIENhbm5vdCBwcm9jZXNzICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiY29tbWFuZCglZCkgd2hpbGUgd2FpdGluZyBmb3Iga2V5IiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvbW1hbmQtPnNlc3Npb25JZCwgcENvbW1hbmQtPmNvbW1hbmQpOworICAgICAgICAgICAgICAgICAgICAgICAgZkNvbnRpbnVlID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgICAgICAgICAgICAgZ290byBzbWVfcHJvY2Vzc19zY2FuX3F1ZXVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHBtY0NvbW1hbmQgPSBzbWVJc0Z1bGxQb3dlck5lZWRlZCggcE1hYywgcENvbW1hbmQgKTsKKyAgICAgICAgICAgICAgICBpZiggZVNtZURyb3BDb21tYW5kID09IHBtY0NvbW1hbmQgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy9UaGlzIGNvbW1hbmQgaXMgbm90IG9rIGZvciBjdXJyZW50IFBNQyBzdGF0ZQorICAgICAgICAgICAgICAgICAgICBpZiggY3NyTExSZW1vdmVFbnRyeSggJnBNYWMtPnNtZS5zbWVDbWRQZW5kaW5nTGlzdCwgcEVudHJ5LCBMTF9BQ0NFU1NfTE9DSyApICkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc21lQWJvcnRDb21tYW5kKCBwTWFjLCBwQ29tbWFuZCwgZUFOSV9CT09MRUFOX0ZBTFNFICk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgY3NyTExVbmxvY2soICZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCApOworICAgICAgICAgICAgICAgICAgICAvL3RlbGwgY2FsbGVyIHRvIGNvbnRpbnVlCisgICAgICAgICAgICAgICAgICAgIGZDb250aW51ZSA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgICAgICAgICBnb3RvIHNtZV9wcm9jZXNzX3NjYW5fcXVldWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYoIGVTbWVOb0NvbW1hbmQgIT0gcG1jQ29tbWFuZCApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB0RXhpdEJtcHNJbmZvIGV4aXRCbXBzSW5mbzsKKyAgICAgICAgICAgICAgICAgICAgdm9pZCAqcHYgPSBOVUxMOworICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBzaXplID0gMDsKKyAgICAgICAgICAgICAgICAgICAgdFNtZUNtZCAqcFBtY0NtZCA9IE5VTEw7CisKKyAgICAgICAgICAgICAgICAgICAgaWYoIGVTbWVDb21tYW5kRXhpdEJtcHMgPT0gcG1jQ29tbWFuZCApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGV4aXRCbXBzSW5mby5leGl0Qm1wc1JlYXNvbiA9IGVTTUVfUkVBU09OX09USEVSOworICAgICAgICAgICAgICAgICAgICAgICAgcHYgPSAodm9pZCAqKSZleGl0Qm1wc0luZm87CisgICAgICAgICAgICAgICAgICAgICAgICBzaXplID0gc2l6ZW9mKHRFeGl0Qm1wc0luZm8pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8vcG1jQ29tbWFuZCBoYXMgdG8gYmUgb25lIG9mIHRoZSBleGl0IHBvd2VyIHNhdmUgY29tbWFuZAorICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBwbWNQcmVwYXJlQ29tbWFuZCggcE1hYywgcG1jQ29tbWFuZCwgcHYsIHNpemUsICZwUG1jQ21kICk7CisgICAgICAgICAgICAgICAgICAgIGlmKCBIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICYmIHBQbWNDbWQgKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvKiBTZXQgdGhlIHRpbWUgb3V0IHRvIDMwIHNlYyAqLworICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QuY21kVGltZW91dER1cmF0aW9uID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENTUl9BQ1RJVkVfTElTVF9DTURfVElNRU9VVF9WQUxVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vRm9yY2UgdGhpcyBjb21tYW5kIHRvIHdha2UgdXAgdGhlIGNoaXAKKyAgICAgICAgICAgICAgICAgICAgICAgIGNzckxMSW5zZXJ0SGVhZCggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0LCAmcFBtY0NtZC0+TGluaywgTExfQUNDRVNTX05PTE9DSyApOworICAgICAgICAgICAgICAgICAgICAgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX1NNRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX1NNRV9DT01NQU5ELHBQbWNDbWQtPnNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUG1jQ21kLT5jb21tYW5kKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBjc3JMTFVubG9jayggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0ICk7CisgICAgICAgICAgICAgICAgICAgICAgICBmQ29udGludWUgPSBwbWNQcm9jZXNzQ29tbWFuZCggcE1hYywgcFBtY0NtZCApOworICAgICAgICAgICAgICAgICAgICAgICAgaWYoIGZDb250aW51ZSApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9UaGUgY29tbWFuZCBmYWlsZWQsIHJlbW92ZSBpdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBjc3JMTFJlbW92ZUVudHJ5KCAmcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QsICZwUG1jQ21kLT5MaW5rLCBMTF9BQ0NFU1NfTk9MT0NLICkgKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG1jUmVsZWFzZUNvbW1hbmQoIHBNYWMsIHBQbWNDbWQgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBjc3JMTFVubG9jayggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0ICk7CisgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCAgIkNhbm5vdCBpc3N1ZSBjb21tYW5kKDB4JVgpIHRvIHdha2UgdXAgdGhlIGNoaXAuIFN0YXR1cyA9ICVkIiksIHBtY0NvbW1hbmQsIHN0YXR1cyApOworICAgICAgICAgICAgICAgICAgICAgICAgLy9MZXQgaXQgcmV0cnkKKyAgICAgICAgICAgICAgICAgICAgICAgIGZDb250aW51ZSA9IGVBTklfQk9PTEVBTl9UUlVFOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGdvdG8gc21lX3Byb2Nlc3Nfc2Nhbl9xdWV1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCBjc3JMTFJlbW92ZUVudHJ5KCAmcE1hYy0+c21lLnNtZUNtZFBlbmRpbmdMaXN0LCBwRW50cnksIExMX0FDQ0VTU19MT0NLICkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gd2UgY2FuIHJldXNlIHRoZSBwQ29tbWFuZAorCisgICAgICAgICAgICAgICAgICAgIC8qIEZvciBST0Mgc2V0IHRpbWVvdCB0byAzMCAqMyBhcyBTdXBwbGljYW50IGNhbiByZXRyeQorICAgICAgICAgICAgICAgICAgICAgKiBQMlAgSW52aXRhdGlvbiBSZXF1ZXN0IDEyMCB0aW1lcyB3aXRoIDUwMG1zIGludGVydmFsLgorICAgICAgICAgICAgICAgICAgICAgKiBGb3Igcm9hbSBjb21tYW5kIHNldCB0aW1lb3V0IHRvIDMwICogMiBzZWMuCisgICAgICAgICAgICAgICAgICAgICAqIFRoZXJlIGFyZSBjYXNlcyB3aGVyZSB3ZSB0cnkgdG8gY29ubmVjdCB0byBkaWZmZXJlbnQKKyAgICAgICAgICAgICAgICAgICAgICogQVBzIHdpdGggc2FtZSBTU0lEIG9uZSBieSBvbmUgdW50aWwgc3VjZXNzZnVsbHkgY29ubmV0ZWQKKyAgICAgICAgICAgICAgICAgICAgICogYW5kIHRodXMgcm9hbSBjb21tYW5kIG1pZ2h0IHRha2UgbW9yZSB0aW1lIGlmIGNvbm5lY3Rpb24KKyAgICAgICAgICAgICAgICAgICAgICogaXMgcmVqZWN0ZWQgYnkgdG9vIG1hbnkgQVBzLgorICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKGVTbWVDb21tYW5kUmVtYWluT25DaGFubmVsID09IHBDb21tYW5kLT5jb21tYW5kKQorICAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QuY21kVGltZW91dER1cmF0aW9uID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1NSX0FDVElWRV9MSVNUX0NNRF9USU1FT1VUX1ZBTFVFICogMzsKKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoKGVTbWVDb21tYW5kUm9hbSA9PSBwQ29tbWFuZC0+Y29tbWFuZCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIChlQ3NySGRkSXNzdWVkID09IHBDb21tYW5kLT51LnJvYW1DbWQucm9hbVJlYXNvbikpCisgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdC5jbWRUaW1lb3V0RHVyYXRpb24gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDU1JfQUNUSVZFX0xJU1RfQ01EX1RJTUVPVVRfVkFMVUUgKiAyOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdC5jbWRUaW1lb3V0RHVyYXRpb24gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1NSX0FDVElWRV9MSVNUX0NNRF9USU1FT1VUX1ZBTFVFOworICAgICAgICAgICAgICAgICAgICAvLyBJbnNlcnQgdGhlIGNvbW1hbmQgb250byB0aGUgQWN0aXZlTGlzdC4uLgorICAgICAgICAgICAgICAgICAgICBjc3JMTEluc2VydEhlYWQoICZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCwgJnBDb21tYW5kLT5MaW5rLCBMTF9BQ0NFU1NfTk9MT0NLICk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYoIHBNYWMtPmRlZmVySW1wcyApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIElNUFMgdGltZXIgaXMgYWxyZWFkeSBydW5uaW5nIHNvIHN0b3AgaXQgYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBpdCB3aWxsIGdldCByZXN0YXJ0ZWQgd2hlbiBubyBjb21tYW5kIGlzIHBlbmRpbmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgICAgY3NyU2NhblN0b3BJZGxlU2NhblRpbWVyKCBwTWFjICk7CisgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmZSZXN0YXJ0SWRsZVNjYW4gPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPmRlZmVySW1wcyA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIC8vIC4uLi4gYW5kIHByb2Nlc3MgdGhlIGNvbW1hbmQuCisKKyAgICAgICAgICAgICAgICAgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX1NNRSwKKyAgICAgICAgICAgICAgICAgICAgICAgVFJBQ0VfQ09ERV9TTUVfQ09NTUFORCwgcENvbW1hbmQtPnNlc3Npb25JZCwgcENvbW1hbmQtPmNvbW1hbmQpKTsKKyAgICAgICAgICAgICAgICAgICAgc3dpdGNoICggcENvbW1hbmQtPmNvbW1hbmQgKQorICAgICAgICAgICAgICAgICAgICB7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRTY2FuOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNzckxMVW5sb2NrKCAmcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JQcm9jZXNzU2NhbkNvbW1hbmQoIHBNYWMsIHBDb21tYW5kICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRSb2FtOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNzckxMVW5sb2NrKCAmcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgID0gY3NyUm9hbVByb2Nlc3NDb21tYW5kKCBwTWFjLCBwQ29tbWFuZCApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBjc3JMTFJlbW92ZUVudHJ5KCAmcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwQ29tbWFuZC0+TGluaywgTExfQUNDRVNTX0xPQ0sgKSApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNzclJlbGVhc2VDb21tYW5kUm9hbSggcE1hYywgcENvbW1hbmQgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBlU21lQ29tbWFuZFdtU3RhdHVzQ2hhbmdlOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNzckxMVW5sb2NrKCAmcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JSb2FtUHJvY2Vzc1dtU3RhdHVzQ2hhbmdlQ29tbWFuZChwTWFjLCBwQ29tbWFuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRTZXRLZXk6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyTExVbmxvY2soICZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1Qcm9jZXNzU2V0S2V5Q29tbWFuZCggcE1hYywgcENvbW1hbmQgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiggY3NyTExSZW1vdmVFbnRyeSggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcENvbW1hbmQtPkxpbmssIExMX0FDQ0VTU19MT0NLICkgKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JSZWxlYXNlQ29tbWFuZFNldEtleSggcE1hYywgcENvbW1hbmQgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBlU21lQ29tbWFuZFJlbW92ZUtleToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JMTFVubG9jayggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0ICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyUm9hbVByb2Nlc3NSZW1vdmVLZXlDb21tYW5kKCBwTWFjLCBwQ29tbWFuZCApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBjc3JMTFJlbW92ZUVudHJ5KCAmcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwQ29tbWFuZC0+TGluaywgTExfQUNDRVNTX0xPQ0sgKSApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNzclJlbGVhc2VDb21tYW5kUmVtb3ZlS2V5KCBwTWFjLCBwQ29tbWFuZCApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGVTbWVDb21tYW5kQWRkU3RhU2Vzc2lvbjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JMTFVubG9jayggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0ICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyUHJvY2Vzc0FkZFN0YVNlc3Npb25Db21tYW5kKCBwTWFjLCBwQ29tbWFuZCApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBlU21lQ29tbWFuZERlbFN0YVNlc3Npb246CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyTExVbmxvY2soICZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNzclByb2Nlc3NEZWxTdGFTZXNzaW9uQ29tbWFuZCggcE1hYywgcENvbW1hbmQgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRNYWNTcG9vZlJlcXVlc3Q6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyTExVbmxvY2soICZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNzclByb2Nlc3NNYWNBZGRyU3Bvb2ZDb21tYW5kKCBwTWFjLCBwQ29tbWFuZCApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vV2UgbmVlZCB0byByZS1ydW4gdGhlIGNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmQ29udGludWUgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5vIFJzcCBleHBlY3RlZCwgZnJlZSBjbWQgZnJvbSBhY3RpdmUgbGlzdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBjc3JMTFJlbW92ZUVudHJ5KCAmcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBDb21tYW5kLT5MaW5rLCBMTF9BQ0NFU1NfTE9DSyApICkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyUmVsZWFzZUNvbW1hbmQoIHBNYWMsIHBDb21tYW5kICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGVTbWVDb21tYW5kR2V0RnJhbWVMb2dSZXF1ZXN0OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNzckxMVW5sb2NrKCAmcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JQcm9jZXNzR2V0RnJhbWVMb2dDb21tYW5kKCBwTWFjLCBwQ29tbWFuZCApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vV2UgbmVlZCB0byByZS1ydW4gdGhlIGNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmQ29udGludWUgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBObyBSc3AgZXhwZWN0ZWQsIGZyZWUgY21kIGZyb20gYWN0aXZlIGxpc3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiggY3NyTExSZW1vdmVFbnRyeSggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwQ29tbWFuZC0+TGluaywgTExfQUNDRVNTX0xPQ0sgKSApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNzclJlbGVhc2VDb21tYW5kKCBwTWFjLCBwQ29tbWFuZCApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRTZXRNYXhUeFBvd2VyOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNzckxMVW5sb2NrKCZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21lX3Byb2Nlc3Nfc2V0X21heF90eF9wb3dlcihwTWFjLCBwQ29tbWFuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogV2UgbmVlZCB0byByZS1ydW4gdGhlIGNvbW1hbmQgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmQ29udGludWUgPSBlQU5JX0JPT0xFQU5fVFJVRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBObyBSc3AgZXhwZWN0ZWQsIGZyZWUgY21kIGZyb20gYWN0aXZlIGxpc3QgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihjc3JMTFJlbW92ZUVudHJ5KCZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcENvbW1hbmQtPkxpbmssIExMX0FDQ0VTU19MT0NLKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyUmVsZWFzZUNvbW1hbmQocE1hYywgcENvbW1hbmQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKworI2lmZGVmIEZFQVRVUkVfT0VNX0RBVEFfU1VQUE9SVAorICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBlU21lQ29tbWFuZE9lbURhdGFSZXE6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyTExVbmxvY2soJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZW1EYXRhX1Byb2Nlc3NPZW1EYXRhUmVxQ29tbWFuZChwTWFjLCBwQ29tbWFuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRSZW1haW5PbkNoYW5uZWw6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyTExVbmxvY2soJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwMnBQcm9jZXNzUmVtYWluT25DaGFubmVsQ21kKHBNYWMsIHBDb21tYW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgZVNtZUNvbW1hbmROb0FVcGRhdGU6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyTExVbmxvY2soICZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAycFByb2Nlc3NOb0FSZXEocE1hYyxwQ29tbWFuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGVTbWVDb21tYW5kRW50ZXJJbXBzOgorICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBlU21lQ29tbWFuZEV4aXRJbXBzOgorICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBlU21lQ29tbWFuZEVudGVyQm1wczoKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRFeGl0Qm1wczoKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRFbnRlclVhcHNkOgorICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBlU21lQ29tbWFuZEV4aXRVYXBzZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRFbnRlcldvd2w6CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGVTbWVDb21tYW5kRXhpdFdvd2w6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyTExVbmxvY2soICZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZDb250aW51ZSA9IHBtY1Byb2Nlc3NDb21tYW5kKCBwTWFjLCBwQ29tbWFuZCApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBmQ29udGludWUgKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9UaGUgY29tbWFuZCBmYWlsZWQsIHJlbW92ZSBpdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiggY3NyTExSZW1vdmVFbnRyeSggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcENvbW1hbmQtPkxpbmssIExMX0FDQ0VTU19MT0NLICkgKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbWNSZWxlYXNlQ29tbWFuZCggcE1hYywgcENvbW1hbmQgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgICAgICAgICAgLy9UcmVhdCBzdGFuZGJ5IGRpZmZlcmVudGx5IGhlcmUgYmVjYXVzZSBjYWxsZXIgbWF5IG5vdCBiZSBhYmxlIHRvIGhhbmRsZQorICAgICAgICAgICAgICAgICAgICAgICAgLy90aGUgZmFpbHVyZSBzbyB3ZSBkbyBvdXIgYmVzdCBoZXJlCisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGVTbWVDb21tYW5kRW50ZXJTdGFuZGJ5OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBjc3JJc0Nvbm5TdGF0ZURpc2Nvbm5lY3RlZCggcE1hYywgcENvbW1hbmQtPnNlc3Npb25JZCApICkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vSXQgY2FuIGNvbnRpbnVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNzckxMVW5sb2NrKCAmcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZkNvbnRpbnVlID0gcG1jUHJvY2Vzc0NvbW1hbmQoIHBNYWMsIHBDb21tYW5kICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBmQ29udGludWUgKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1RoZSBjb21tYW5kIGZhaWxlZCwgcmVtb3ZlIGl0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiggY3NyTExSZW1vdmVFbnRyeSggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBDb21tYW5kLT5MaW5rLCBMTF9BQ0NFU1NfTE9DSyApICkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbWNSZWxlYXNlQ29tbWFuZCggcE1hYywgcENvbW1hbmQgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL05lZWQgdG8gaXNzdWUgYSBkaXNjb25uZWN0IGZpcnN0IGJlZm9yZSBwcm9jZXNzaW5nIHRoaXMgY29tbWFuZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U21lQ21kICpwTmV3Q21kOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vV2UgbmVlZCB0byByZS1ydW4gdGhlIGNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZkNvbnRpbnVlID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vUHVsbCBvZmYgdGhlIHN0YW5kYnkgY29tbWFuZCBmaXJzdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiggY3NyTExSZW1vdmVFbnRyeSggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBDb21tYW5kLT5MaW5rLCBMTF9BQ0NFU1NfTk9MT0NLICkgKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JMTFVubG9jayggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0ICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL05lZWQgdG8gY2FsbCBDU1IgZnVuY3Rpb24gaGVyZSBiZWNhdXNlIHRoZSBkaXNjb25uZWN0IGNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vaXMgaGFuZGxlZCBieSBDU1IKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBOZXdDbWQgPSBjc3JHZXRDb21tYW5kQnVmZmVyKCBwTWFjICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiggTlVMTCAhPSBwTmV3Q21kICkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1B1dCB0aGUgc3RhbmRieSBjb21tYW5kIHRvIHRoZSBoZWFkIG9mIHRoZSBwZW5kaW5nIGxpc3QgZmlyc3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JMTEluc2VydEhlYWQoICZwTWFjLT5zbWUuc21lQ21kUGVuZGluZ0xpc3QsICZwQ29tbWFuZC0+TGluaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTExfQUNDRVNTX0xPQ0sgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTmV3Q21kLT5jb21tYW5kID0gZVNtZUNvbW1hbmRSb2FtOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBOZXdDbWQtPnUucm9hbUNtZC5yb2FtUmVhc29uID0gZUNzckZvcmNlZERpc2Fzc29jOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vUHV0IHRoZSBkaXNhc3NvYyBjb21tYW5kIGJlZm9yZSB0aGUgc3RhbmRieSBjb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyTExJbnNlcnRIZWFkKCAmcE1hYy0+c21lLnNtZUNtZFBlbmRpbmdMaXN0LCAmcE5ld0NtZC0+TGluaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTExfQUNDRVNTX0xPQ0sgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0NvbnRpbnVlIHRoZSBjb21tYW5kIGhlcmUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmQ29udGludWUgPSBwbWNQcm9jZXNzQ29tbWFuZCggcE1hYywgcENvbW1hbmQgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiggZkNvbnRpbnVlICkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vVGhlIGNvbW1hbmQgZmFpbGVkLCByZW1vdmUgaXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIGNzckxMUmVtb3ZlRW50cnkoICZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBDb21tYW5kLT5MaW5rLCBMTF9BQ0NFU1NfTE9DSyApICkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG1jUmVsZWFzZUNvbW1hbmQoIHBNYWMsIHBDb21tYW5kICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JMTFVubG9jayggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0ICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCIgZmFpbGVkIHRvIHJlbW92ZSBzdGFuZGJ5IGNvbW1hbmQiKSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRQbm9SZXE6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3NyTExVbmxvY2soICZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IHNtZVByb2Nlc3NQbm9Db21tYW5kKHBNYWMsIHBDb21tYW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoImZhaWxlZCB0byBwb3N0IFNNRSBQTk8gU0NBTiAlZCIpLCBzdGF0dXMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1dlIG5lZWQgdG8gcmUtcnVuIHRoZSBjb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZkNvbnRpbnVlID0gZUFOSV9CT09MRUFOX1RSVUU7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3NyTExSZW1vdmVFbnRyeSgmcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBDb21tYW5kLT5MaW5rLCBMTF9BQ0NFU1NfTE9DSykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JSZWxlYXNlQ29tbWFuZChwTWFjLCBwQ29tbWFuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBlU21lQ29tbWFuZEFkZFRzOgorICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBlU21lQ29tbWFuZERlbFRzOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNzckxMVW5sb2NrKCAmcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QgKTsKKyNpZm5kZWYgV0xBTl9NRE1fQ09ERV9SRURVQ1RJT05fT1BUCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZkNvbnRpbnVlID0gcW9zUHJvY2Vzc0NvbW1hbmQoIHBNYWMsIHBDb21tYW5kICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIGZDb250aW51ZSApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1RoZSBjb21tYW5kIGZhaWxlZCwgcmVtb3ZlIGl0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBjc3JMTFJlbW92ZUVudHJ5KCAmcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwQ29tbWFuZC0+TGluaywgTExfQUNDRVNTX05PTE9DSyApICkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworLy8jaWZuZGVmIFdMQU5fTURNX0NPREVfUkVEVUNUSU9OX09QVAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcW9zUmVsZWFzZUNvbW1hbmQoIHBNYWMsIHBDb21tYW5kICk7CisvLyNlbmRpZiAvKiBXTEFOX01ETV9DT0RFX1JFRFVDVElPTl9PUFQqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgZVNtZUNvbW1hbmRUZGxzU2VuZE1nbXQ6CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGVTbWVDb21tYW5kVGRsc0FkZFBlZXI6CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGVTbWVDb21tYW5kVGRsc0RlbFBlZXI6CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGVTbWVDb21tYW5kVGRsc0xpbmtFc3RhYmxpc2g6CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGVTbWVDb21tYW5kVGRsc0NoYW5uZWxTd2l0Y2g6IC8vIHRkbHNvZmZjaGFuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJzZW5kaW5nIFRETFMgQ29tbWFuZCAweCV4IHRvIFBFIiwgcENvbW1hbmQtPmNvbW1hbmQpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNzckxMVW5sb2NrKCAmcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyVGRsc1Byb2Nlc3NDbWQoIHBNYWMsIHBDb21tYW5kICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIDsKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBlU21lQ29tbWFuZE5hblJlcToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JMTFVubG9jayggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0ICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21lUHJvY2Vzc05hblJlcSggcE1hYywgcENvbW1hbmQgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3NyTExSZW1vdmVFbnRyeSgmcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBDb21tYW5kLT5MaW5rLCBMTF9BQ0NFU1NfTE9DSykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JSZWxlYXNlQ29tbWFuZChwTWFjLCBwQ29tbWFuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZVNtZUNvbW1hbmROYW5SZXEgcHJvY2Vzc2VkIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZkNvbnRpbnVlID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9zb21ldGhpbmcgaXMgd3JvbmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3JlbW92ZSBpdCBmcm9tIHRoZSBhY3RpdmUgbGlzdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCAiIGNzclByb2Nlc3NDb21tYW5kIHByb2Nlc3NlcyBhbiB1bmtub3duIGNvbW1hbmQgJWQiLCBwQ29tbWFuZC0+Y29tbWFuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEVudHJ5ID0gY3NyTExSZW1vdmVIZWFkKCAmcE1hYy0+c21lLnNtZUNtZEFjdGl2ZUxpc3QsIExMX0FDQ0VTU19OT0xPQ0sgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjc3JMTFVubG9jayggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0ICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvbW1hbmQgPSBHRVRfQkFTRV9BRERSKCBwRW50cnksIHRTbWVDbWQsIExpbmsgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbWVSZWxlYXNlQ29tbWFuZCggcE1hYywgcENvbW1hbmQgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZkNvbnRpbnVlID0gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9Ly9pZihwRW50cnkpCisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy9UaGlzIGlzIG9kZC4gU29tZSBvbmUgZWxzZSBwdWxsIG9mZiB0aGUgY29tbWFuZC4KKyAgICAgICAgICAgICAgICAgICAgY3NyTExVbmxvY2soICZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjc3JMTFVubG9jayggJnBNYWMtPnNtZS5zbWVDbWRBY3RpdmVMaXN0ICk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvL05vIGNvbW1hbmQgd2FpdGluZworICAgICAgICAgICAgY3NyTExVbmxvY2soICZwTWFjLT5zbWUuc21lQ21kQWN0aXZlTGlzdCApOworICAgICAgICAgICAgLy9UaGlzIGlzIG9ubHkgdXNlZCB0byByZXN0YXJ0IGFuIGlkbGUgbW9kZSBzY2FuLCBpdCBtZWFucyBhdCBsZWFzdCBvbmUgb3RoZXIgaWRsZSBzY2FuIGhhcyBmaW5pc2hlZC4KKyAgICAgICAgICAgIGlmKHBNYWMtPnNjYW4uZlJlc3RhcnRJZGxlU2NhbiAmJiBlQU5JX0JPT0xFQU5fRkFMU0UgPT0gcE1hYy0+c2Nhbi5mQ2FuY2VsSWRsZVNjYW4pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdEFOSV9VMzIgblRpbWUgPSAwOworCisgICAgICAgICAgICAgICAgcE1hYy0+c2Nhbi5mUmVzdGFydElkbGVTY2FuID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICAgICAgICAgIGlmKCFIQUxfU1RBVFVTX1NVQ0NFU1MoY3NyU2NhblRyaWdnZXJJZGxlU2NhbihwTWFjLCAmblRpbWUpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGNzclNjYW5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Uyggdm9zX2xvY2tfaW5pdCggJnBNYWMtPnNtZS5sa1NtZUdsb2JhbExvY2sgKSApICkKKyAgICAgIHsKKyAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsICJzbWVfT3BlbiBmYWlsZWQgaW5pdCBsb2NrIiApOworICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgYnJlYWs7CisgICAgICB9CisKKyAgICAgIHN0YXR1cyA9IGNjbU9wZW4oaEhhbCk7CisgICAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApIHsKKyAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgImNjbU9wZW4gZmFpbGVkIGR1cmluZyBpbml0aWFsaXphdGlvbiB3aXRoIHN0YXR1cz0lZCIsIHN0YXR1cyApOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisKKyAgICAgIHN0YXR1cyA9IGNzck9wZW4ocE1hYyk7CisgICAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApIHsKKyAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgImNzck9wZW4gZmFpbGVkIGR1cmluZyBpbml0aWFsaXphdGlvbiB3aXRoIHN0YXR1cz0lZCIsIHN0YXR1cyApOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisKKyAgICAgIHN0YXR1cyA9IHBtY09wZW4oaEhhbCk7CisgICAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApIHsKKyAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgInBtY09wZW4gZmFpbGVkIGR1cmluZyBpbml0aWFsaXphdGlvbiB3aXRoIHN0YXR1cz0lZCIsIHN0YXR1cyApOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworICAgICAgcE1hYy0+aXNUZGxzUG93ZXJTYXZlUHJvaGliaXRlZCA9IDA7CisjZW5kaWYKKworI2lmbmRlZiBXTEFOX01ETV9DT0RFX1JFRFVDVElPTl9PUFQKKyAgICAgIHN0YXR1cyA9IHNtZV9Rb3NPcGVuKHBNYWMpOworICAgICAgaWYgKCAhIEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKSB7CisgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICJRb3Mgb3BlbiBmYWlsZWQgZHVyaW5nIGluaXRpYWxpemF0aW9uIHdpdGggc3RhdHVzPSVkIiwgc3RhdHVzICk7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKworICAgICAgc3RhdHVzID0gYnRjT3BlbihwTWFjKTsKKyAgICAgIGlmICggISBIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkgeworICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAiYnRjT3BlbiBvcGVuIGZhaWxlZCBkdXJpbmcgaW5pdGlhbGl6YXRpb24gd2l0aCBzdGF0dXM9JWQiLCBzdGF0dXMgKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorI2VuZGlmCisjaWZkZWYgRkVBVFVSRV9PRU1fREFUQV9TVVBQT1JUCisgICAgICBzdGF0dXMgPSBvZW1EYXRhX09lbURhdGFSZXFPcGVuKHBNYWMpOworICAgICAgaWYgKCAhIEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKSB7CisgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAib2VtRGF0YV9PZW1EYXRhUmVxT3BlbiBmYWlsZWQgZHVyaW5nIGluaXRpYWxpemF0aW9uIHdpdGggc3RhdHVzPSVkIiwgc3RhdHVzICk7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyNlbmRpZgorCisgICAgICBpZighSEFMX1NUQVRVU19TVUNDRVNTKChzdGF0dXMgPSBpbml0U21lQ21kTGlzdChwTWFjKSkpKQorICAgICAgICAgIGJyZWFrOworCisgICAgICB7CisgICAgICAgICB2X1BWT0lEX3QgcHZvc0dDdHggPSB2b3NfZ2V0X2dsb2JhbF9jb250ZXh0KFZPU19NT0RVTEVfSURfU0FQLCBOVUxMKTsKKyAgICAgICAgIGlmICggTlVMTCA9PSBwdm9zR0N0eCApeworICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAiV0xBTlNBUF9PcGVuIG9wZW4gZmFpbGVkIGR1cmluZyBpbml0aWFsaXphdGlvbiIpOworICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgfQorCisgICAgICAgICBzdGF0dXMgPSBXTEFOU0FQX09wZW4oIHB2b3NHQ3R4ICk7CisgICAgICAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApIHsKKyAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAiV0xBTlNBUF9PcGVuIG9wZW4gZmFpbGVkIGR1cmluZyBpbml0aWFsaXphdGlvbiB3aXRoIHN0YXR1cz0lZCIsIHN0YXR1cyApOworICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgfQorICAgICAgfQorI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX1ZPV0lGSQorICAgICAgc3RhdHVzID0gcnJtT3BlbihwTWFjKTsKKyAgICAgIGlmICggISBIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkgeworICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAicnJtT3BlbiBvcGVuIGZhaWxlZCBkdXJpbmcgaW5pdGlhbGl6YXRpb24gd2l0aCBzdGF0dXM9JWQiLCBzdGF0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hZ2VUeXBlID0gZVdOSV9TTUVfU1lTX1JFQURZX0lORDsKKyAgICAgIE1zZy5sZW5ndGggICAgICA9IHNpemVvZiggdFNpclNtZVJlYWR5UmVxICk7CisKKyAgICAgIGlmIChlU0lSX0ZBSUxVUkUgIT0gdU1hY1Bvc3RDdHJsTXNnKCBoSGFsLCAodFNpck1iTXNnKikmTXNnICkpCisgICAgICB7CisgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAidU1hY1Bvc3RDdHJsTXNnIGZhaWxlZCB0byBzZW5kIGVXTklfU01FX1NZU19SRUFEWV9JTkQiKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorCisgICAgICBzdGF0dXMgPSBwbWNRdWVyeVBvd2VyU3RhdGUoIGhIYWwsICZwb3dlclN0YXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmaHdXbGFuU3dpdGNoU3RhdGUsICZzd1dsYW5Td2l0Y2hTdGF0ZSApOworICAgICAgaWYgKCAhIEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgeworICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAicG1jUXVlcnlQb3dlclN0YXRlIGZhaWxlZCB3aXRoIHN0YXR1cz0lZCIsCisgICAgICAgICAgICAgICAgIHN0YXR1cyApOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisKKyAgICAgIGlmICggKGVQTUNfU1dJVENIX09GRiAhPSBod1dsYW5Td2l0Y2hTdGF0ZSkgJiYKKyAgICAgICAgICAgKGVQTUNfU1dJVENIX09GRiAhPSBzd1dsYW5Td2l0Y2hTdGF0ZSkgKQorICAgICAgeworICAgICAgICAgc3RhdHVzID0gY3NyUmVhZHkocE1hYyk7CisgICAgICAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsICJjc3JSZWFkeSBmYWlsZWQgd2l0aCBzdGF0dXM9JWQiLCBzdGF0dXMgKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgfQorICAgICAgICAgc3RhdHVzID0gcG1jUmVhZHkoaEhhbCk7CisgICAgICAgICBpZiAoICEgSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICB7CisgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAicG1jUmVhZHkgZmFpbGVkIHdpdGggc3RhdHVzPSVkIiwgc3RhdHVzICk7CisgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisjaWZuZGVmIFdMQU5fTURNX0NPREVfUkVEVUNUSU9OX09QVAorICAgICAgICAgaWYoVk9TX1NUQVRVU19TVUNDRVNTICE9IGJ0Y1JlYWR5KGhIYWwpKQorICAgICAgICAgeworICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAiYnRjUmVhZHkgZmFpbGVkIik7CisgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisjZW5kaWYKKworI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX1ZPV0lGSQorICAgICAgICAgaWYoVk9TX1NUQVRVU19TVUNDRVNTICE9IHJybVJlYWR5KGhIYWwpKQorICAgICAgICAgeworICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAicnJtUmVhZHkgZmFpbGVkIik7CisgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisjZW5kaWYKKyAgICAgIH0KKyAgICAgIHBNYWMtPnNtZS5zdGF0ZSA9IFNNRV9TVE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zdGF0dXMgKSApIHsKKyAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgImNzclN0YXJ0IGZhaWxlZCBkdXJpbmcgc21lU3RhcnQgd2l0aCBzdGF0dXM9JWQiLAorICAgICAgICAgICAgICAgICBzdGF0dXMgKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorCisgICAgICBzdGF0dXMgPSBwbWNTdGFydChoSGFsKTsKKyAgICAgIGlmICggISBIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkgeworICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAicG1jU3RhcnQgZmFpbGVkIGR1cmluZyBzbWVTdGFydCB3aXRoIHN0YXR1cz0lZCIsCisgICAgICAgICAgICAgICAgIHN0YXR1cyApOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisKKyAgICAgIHN0YXR1cyA9IFdMQU5TQVBfU3RhcnQodm9zX2dldF9nbG9iYWxfY29udGV4dChWT1NfTU9EVUxFX0lEX1NBUCwgTlVMTCkpOworICAgICAgaWYgKCAhIEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKSB7CisgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsICJXTEFOU0FQX1N0YXJ0IGZhaWxlZCBkdXJpbmcgc21lU3RhcnQgd2l0aCBzdGF0dXM9JWQiLAorICAgICAgICAgICAgICAgICBzdGF0dXMgKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgcE1hYy0+c21lLnN0YXRlID0gU01FX1NUQVRFX1NUQVJUOworICAgfXdoaWxlICgwKTsKKworICAgcmV0dXJuIHN0YXR1czsKK30KKworCisjaWZkZWYgV0xBTl9GRUFUVVJFX1BBQ0tFVF9GSUxURVJJTkcKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogTmFtZTogc21lX1BDRmlsdGVyTWF0Y2hDb3Vud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VRVU19GQUlMVVJFOworICAgICAgICB9CisKKyAgICAgICAgcE1zZyA9ICh0U2lyQmNuTWlzc1JhdGVSZXEgKikgdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRTaXJCY25NaXNzUmF0ZVJlcSkpOworICAgICAgICBpZiAoTlVMTCA9PSBwTXNnKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoImZhaWxlZCB0byBhbGxvY2F0ZWQgbWVtb3J5IikpOworICAgICAgICAgICAgc21lX1JlbGVhc2VHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgfQorCisgICAgICAgIHZvc19tZW1fY29weShwTXNnLT5ic3NpZCwgcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUuYnNzaWQsCisgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworCisgICAgICAgIHBNc2ctPm1zZ0xlbiAgID0gc2l6ZW9mKHRTaXJCY25NaXNzUmF0ZVJlcSk7CisgICAgICAgIHBNc2ctPmNhbGxiYWNrID0gY2FsbGJhY2s7CisgICAgICAgIHBNc2ctPmRhdGEgICAgID0gZGF0YTsKKworICAgICAgICB2b3NNZXNzYWdlLnR5cGUgPSBXREFfR0VUX0JDTl9NSVNTX1JBVEVfUkVROworICAgICAgICB2b3NNZXNzYWdlLmJvZHlwdHIgPSBwTXNnOworICAgICAgICB2b3NNZXNzYWdlLnJlc2VydmVkID0gMDsKKyAgICAgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX1NNRSwKKyAgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfU01FX1RYX1dEQV9NU0csIHNlc3Npb25JZCwgdm9zTWVzc2FnZS50eXBlKSk7CisgICAgICAgIHZvc1N0YXR1cyA9IHZvc19tcV9wb3N0X21lc3NhZ2UoIFZPU19NUV9JRF9XREEsICZ2b3NNZXNzYWdlICk7CisgICAgICAgIGlmICggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpICkKKyAgICAgICAgeworICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICIlczogUG9zdCBTZXQgVE0gTGV2ZWwgTVNHIGZhaWwiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgIHZvc19tZW1fZnJlZShwTXNnKTsKKyAgICAgICAgICAgc21lX1JlbGVhc2VHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICB9CisgICAgICAgIHNtZV9SZWxlYXNlR2xvYmFsTG9jayggJnBNYWMtPnNtZSk7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIH0KKyAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKK30KKworZUhhbFN0YXR1cyBzbWVfRW5jcnlwdE1zZ1Jlc3BvbnNlSGFuZGxlcih0SGFsSGFuZGxlIGhIYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyRW5jcnlwdGVkRGF0YVJzcFBhcmFtcyBwRW5jUnNwUGFyYW1zKQoreworICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9IFBNQUNfU1RSVUNUKCBoSGFsICk7CisKKyAgIGlmIChOVUxMID09IHBNYWMpCisgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICIlczogcE1hYyBpcyBudWxsIiwgX19mdW5jX18pOworICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgfQorICAgaWYgKHBNYWMtPnNtZS5wRW5jTX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zZSBlV05JX1BNQ19FTlRFUl9XT1dMX1JTUDoKKyAgICAgICAgICBjYXNlIGVXTklfUE1DX0VYSVRfV09XTF9SU1A6CisgICAgICAgICAgICAgLy9QTUMKKyAgICAgICAgICAgICBpZiAocE1zZy0+Ym9keXB0cikKKyAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcG1jTWVzc2FnZVByb2Nlc3NvcihoSGFsLCBwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgIkVtcHR5IHJzcCBtZXNzYWdlIGZvciBQTUMsIG5vdGhpbmcgdG8gcHJvY2VzcyIpOworICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgIGNhc2UgV05JX0NGR19TRVRfQ05GOgorICAgICAgICAgIGNhc2UgV05JX0NGR19ETkxEX0NORjoKKyAgICAgICAgICBjYXNlIFdOSV9DRkdfR0VUX1JTUDoKKyAgICAgICAgICBjYXNlIFdOSV9DRkdfQUREX0dSUF9BRERSX0NORjoKKyAgICAgICAgICBjYXNlIFdOSV9DRkdfREVMX0dSUF9BRERSX0NORjoKKyAgICAgICAgICAgICAvL0NDTQorICAgICAgICAgICAgIGlmIChwTXNnLT5ib2R5cHRyKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjY21DZmdDbmZNc2dIYW5kbGVyKGhIYWwsIHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAiRW1wdHkgcnNwIG1lc3NhZ2UgZm9yIENDTSwgbm90aGluZyB0byBwcm9jZXNzIik7CisgICAgICAgICAgICAgfQorICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgY2FzZSBlV05JX1NNRV9BRERUU19SU1A6CisgICAgICAgICAgY2FzZSBlV05JX1NNRV9ERUxUU19SU1A6CisgICAgICAgICAgY2FzZSBlV05JX1NNRV9ERUxUU19JTkQ6CisjaWZkZWYgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIKKyAgICAgICAgICBjYXNlIGVXTklfU01FX0ZUX0FHR1JfUU9TX1JTUDoKKyNlbmRpZgorICAgICAgICAgICAgIC8vUW9TCisgICAgICAgICAgICAgaWYgKHBNc2ctPmJvZHlwdHIpCisgICAgICAgICAgICAgeworI2lmbmRlZiBXTEFOX01ETV9DT0RFX1JFRFVDVElPTl9PUFQKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBzbWVfUW9zTXNnUHJvY2Vzc29yKHBNYWMsIHBNc2ctPnR5cGUsIHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTXNnLT5ib2R5cHRyKTsKKyNlbmRpZgorICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAiRW1wdHkgcnNwIG1lc3NhZ2UgZm9yIFFvUywgbm90aGluZyB0byBwcm9jZXNzIik7CisgICAgICAgICAgICAgfQorICAgICAgICAgICAgIGJyZWFrOworI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX1ZPV0lGSQorICAgICAgICAgIGNhc2UgZVdOSV9TTUVfTkVJR0hCT1JfUkVQT1JUX0lORDoKKyAgICAgICAgICBjYXNlIGVXTklfU01FX0JFQUNPTl9SRVBPUlRfUkVRX0lORDoKKyNpZiBkZWZpbmVkIFdMQU5fVk9XSUZJX0RFQlVHCisgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAiUmVjZWl2ZWQgUlJNIG1lc3NhZ2UuIE1lc3NhZ2UgSWQgPSAlZCIsIHBNc2ctPnR5cGUgKTsKKyNlbmRpZgorICAgICAgICAgICAgIGlmICggcE1zZy0+Ym9keXB0ciApCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0YXR1cyA9IHNtZV9Scm1Nc2dQcm9jZXNzb3IoIHBNYWMsIHBNc2ctPnR5cGUsIHBNc2ctPmJvZHlwdHIgKTsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocE1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgfQorICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCAiRW1wdHkgbWVzc2FnZSBmb3IgUlJNLCBub3RoaW5nIHRvIHByb2Nlc3MiKTsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgICAgYnJlYWs7CisjZW5kaWYKKworI2lmZGVmIEZFQVRVUkVfT0VNX0RBVEFfU1VQUE9SVAorICAgICAgICAgIC8vSGFuZGxlIHRoZSBlV05JX1NNRV9PRU1fREFUQV9SU1A6CisgICAgICAgICAgY2FzZSBlV05JX1NNRV9PRU1fREFUQV9SU1A6CisgICAgICAgICAgICAgICAgaWYocE1zZy0+Ym9keXB0cikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBzbWVfSGFuZGxlT2VtRGF0YVJzcChwTWFjLCBwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgIkVtcHR5IHJzcCBtZXNzYWdlIGZvciBvZW1EYXRhXyAoZVdOSV9TTUVfT0VNX0RBVEFfUlNQKSwgbm90aGluZyB0byBwcm9jZXNzIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNtZVByb2Nlc3NQZW5kaW5nUXVldWUoIHBNYWMgKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyNlbmRpZgorCisgICAgICAgICAgY2FzZSBlV05JX1NNRV9BRERfU1RBX1NFTEZfUlNQOgorICAgICAgICAgICAgICAgIGlmKHBNc2ctPmJvZHlwdHIpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclByb2Nlc3NBZGRTdGFTZXNzaW9uUnNwKHBNYWMsIHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsICJFbXB0eSByc3AgbWVzc2FnZSBmb3IgbWVhcyAoZVdOSV9TTUVfQUREX1NUQV9TRUxGX1JTUCksIG5vdGhpbmcgdG8gcHJvY2VzcyIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlIGVXTklfU01FX0RFTF9TVEFfU0VMRl9SU1A6CisgICAgICAgICAgICAgICAgaWYocE1zZy0+Ym9keXB0cikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gY3NyUHJvY2Vzc0RlbFN0YVNlc3Npb25Sc3AocE1hYywgcE1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgIkVtcHR5IHJzcCBtZXNzYWdlIGZvciBtZWFzIChlV05JX1NNRV9ERUxfU1RBX1NFTEZfUlNQKSwgbm90aGluZyB0byBwcm9jZXNzIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgZVdOSV9TTUVfUkVNQUlOX09OX0NITl9SU1A6CisgICAgICAgICAgICAgICAgaWYocE1zZy0+Ym9keXB0cikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IHNtZV9yZW1haW5PbkNoblJzcChwTWFjLCBwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsICJFbXB0eSByc3AgbWVzc2FnZSBmb3IgbWVhcyAoZVdOSV9TTUVfUkVNQUlOX09OX0NITl9SU1ApLCBub3RoaW5nIHRvIHByb2Nlc3MiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY2FzZSBlV05JX1NNRV9SRU1BSU5fT05fQ0hOX1JEWV9JTkQ6CisgICAgICAgICAgICAgICAgaWYocE1zZy0+Ym9keXB0cikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IHNtZV9yZW1haW5PbkNoblJlYWR5KHBNYWMsIHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocE1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgIkVtcHR5IHJzcCBtZXNzYWdlIGZvciBtZWFzIChlV05JX1NNRV9SRU1BSU5fT05fQ0hOX1JEWV9JTkQpLCBub3RoaW5nIHRvIHByb2Nlc3MiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisjaWZkZWYgV0xBTl9GRUFUVVJFX0FQX0hUNDBfMjRHCisgICAgICAgICAgIGNhc2UgZVdOSV9TTUVfMjA0MF9DT0VYX0lORDoKKyAgICAgICAgICAgICAgICBpZihwTXNnLT5ib2R5cHRyKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21lX0hUMjA0MENvZXhJbmZvSW5kKHBNYWMsIHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocE1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgIkVtcHR5IHJzcCBtZXNzYWdlIGZvciBtZWFzIChlV05JX1NNRV8yMDQwX0NPRVhfSU5EKSwgbm90aGluZyB0byBwcm9jZXNzIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworI2VuZGlmCisgICAgICAgICAgIGNhc2UgZVdOSV9TTUVfQUNUSU9OX0ZSQU1FX1NFTkRfQ05GOgorICAgICAgICAgICAgICAgIGlmKHBNc2ctPmJvZHlwdHIpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBzbWVfc2VuZEFjdGlvbkNuZihwTWFjLCBwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsICJFbXB0eSByc3AgbWVzc2FnZSBmb3IgbWVhcyAoZVdOSV9TTUVfQUNUSU9OX0ZSQU1FX1NFTkRfQ05GKSwgbm90aGluZyB0byBwcm9jZXNzIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgZVdOSV9TTUVfQ09FWF9JTkQ6CisgICAgICAgICAgICAgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX1NNRSwKKyAgICAgICAgICAgICAgICAgICAgICAgVFJBQ0VfQ09ERV9TTUVfUlhfV0RBX01TRywgTk9fU0VTU0lPTiwgcE1zZy0+dHlwZSkpOworICAgICAgICAgICAgICAgIGlmKHBNc2ctPmJvZHlwdHIpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIHRTaXJTbWVDb2V4SW5kICpwU21lQ29leEluZCA9ICh0U2lyU21lQ29leEluZCAqKXBNc2ctPmJvZHlwdHI7CisKKyAgICAgICAgICAgICAgICAgICBpZiAocFNtZUNvZXhJbmQtPmNvZXhJbmRUeXBlID09IFNJUl9DT0VYX0lORF9UWVBFX0RJU0FCTEVfQUdHUkVHQVRJT05fSU5fMnA0KQorICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0cxLCBGTCgiU0lSX0NPRVhfSU5EX1RZUEVfRElTQUJMRV9BR0dSRUdBVElPTl9JTl8ycDQiKSk7CisgICAgICAgICAgICAgICAgICAgICAgIHNtZV9SZXF1ZXN0RnVsbFBvd2VyKGhIYWwsIE5VTEwsIE5VTEwsIGVTTUVfUkVBU09OX09USEVSKTsKKyAgICAgICAgICAgICAgICAgICAgICAgcE1hYy0+aXNDb2V4U2NvSW5kU2V0ID0gMTsKKyAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocFNtZUNvZXhJbmQtPmNvZXhJbmRUeXBlID09IFNJUl9DT0VYX0lORF9UWVBFX0VOQUJMRV9BR0dSRUdBVElPTl9JTl8ycDQpCisgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPRzEsIEZMKCJTSVJfQ09FWF9JTkRfVFlQRV9FTkFCTEVfQUdHUkVHQVRJT05fSU5fMnA0IikpOworICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5pc0NvZXhTY29JbmRTZXQgPSAwOworICAgICAgICAgICAgICAgICAgICAgICBzbWVfUmVxdWVzdEJtcHMoaEhhbCwgTlVMTCwgTlVMTCk7CisgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gYnRjSGFuZGxlQ29leEluZCgodm9pZCAqKXBNYWMsIHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgIkVtcHR5IHJzcCBtZXNzYWdlIGZvciBtZWFzIChlV05JX1NNRV9DT0VYX0lORCksIG5vdGhpbmcgdG8gcHJvY2VzcyIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKworI2lmZGVmIEZFQVRVUkVfV0xBTl9TQ0FOX1BOTworICAgICAgICAgIGNhc2UgZVdOSV9TTUVfUFJFRl9ORVRXT1JLX0ZPVU5EX0lORDoKKyAgICAgICAgICAgICAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfU01FLAorICAgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX1NNRV9SWF9XREFfTVNHLCBOT19TRVNTSU9OLCBwTXNnLT50eXBlKSk7CisgICAgICAgICAgICAgICAgaWYocE1zZy0+Ym9keXB0cikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gc21lX1ByZWZlcnJlZE5ldHdvcmtGb3VuZEluZCgodm9pZCAqKXBNYWMsIHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgIkVtcHR5IHJzcCBtZXNzYWdlIGZvciBtZWFzIChlV05JX1NNRV9QUkVGX05FVFdPUktfRk9VTkRfSU5EKSwgbm90aGluZyB0byBwcm9jZXNzIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworI2VuZGlmIC8vIEZFQVRVUkVfV0xBTl9TQ0FOX1BOTworCisgICAgICAgICAgY2FzZSBlV05JX1NNRV9UWF9QRVJfSElUX0lORDoKKyAgICAgICAgICAgICAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfU01FLAorICAgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX1NNRV9SWF9XREFfTVNHLCBOT19TRVNTSU9OLCBwTXNnLT50eXBlKSk7CisgICAgICAgICAgICAgICAgaWYgKHBNYWMtPnNtZS5wVHhQZXJIaXRDYWxsYmFjaykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgcE1hYy0+c21lLnBUeFBlckhpdENhbGxiYWNrKHBNYWMtPnNtZS5wVHhQZXJIaXRDYkNvbnRleHQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgIGNhc2UgZVdOSV9TTUVfQ0hBTkdFX0NPVU5UUllfQ09ERToKKyAgICAgICAgICAgICAgaWYocE1zZy0+Ym9keXB0cikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gc21lX0hhbmRsZUNoYW5nZUNvdW50cnlDb2RlKCh2b2lkICopcE1hYywgcE1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgIkVtcHR5IHJzcCBtZXNzYWdlIGZvciBtZXNzYWdlIChlV05JX1NNRV9DSEFOR0VfQ09VTlRSWV9DT0RFKSwgbm90aGluZyB0byBwcm9jZXNzIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgY2FzZSBlV05JX1NNRV9HRU5FUklDX0NIQU5HRV9DT1VOVFJZX0NPREU6CisgICAgICAgICAgICAgIGlmIChwTXNnLT5ib2R5cHRyKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gc21lX0hhbmRsZUdlbmVyaWNDaGFuZ2VDb3VudHJ5Q29kZSgodm9pZCAqKXBNYWMsIHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocE1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsICJFbXB0eSByc3AgbWVzc2FnZSBmb3IgbWVzc2FnZSAoZVdOSV9TTUVfR0VORVJJQ19DSEFOR0VfQ09VTlRSWV9DT0RFKSwgbm90aGluZyB0byBwcm9jZXNzIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworCisjaWZkZWYgV0xBTl9GRUFUVVJFX1BBQ0tFVF9GSUxURVJJTkcKKyAgICAgICAgICBjYXNlIGVXTklfUE1DX1BBQ0tFVF9DT0FMRVNDSU5HX0ZJTFRFUl9NQVRDSF9DT1VOVF9SU1A6CisgICAgICAgICAgICAgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX1NNRSwKKyAgICAgICAgICAgICAgICAgICAgICAgVFJBQ0VfQ09ERV9TTUVfUlhfV0RBX01TRywgTk9fU0VTU0lPTiwgcE1zZy0+dHlwZSkpOworICAgICAgICAgICAgICAgIGlmKHBNc2ctPmJvZHlwdHIpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IHNtZV9QQ0ZpbHRlck1hdGNoQ291bnRSZXNwb25zZUhhbmRsZXIoKHZvaWQgKilwTWFjLCBwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocE1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsICJFbXB0eSByc3AgbWVzc2FnZSBmb3IgbWVhcyAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICIoUEFDS0VUX0NPQUxFU0NJTkdfRklMVEVSX01BVENIX0NPVU5UX1JTUCksIG5vdGhpbmcgdG8gcHJvY2VzcyIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyNlbmRpZiAvLyBXTEFOX0ZFQVRVUkVfUEFDS0VUX0ZJTFRFUklORworICAgICAgICAgIGNhc2UgZVdOSV9TTUVfUFJFX1NXSVRDSF9DSExfSU5EOgorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBzbWVfSGFuZGxlUHJlQ2hhbm5lbFN3aXRjaEluZChwTWFjKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICB9CisKKyAgICAgICAgICBjYXNlIGVXTklfU01FX1BPU1RfU1dJVENIX0NITF9JTkQ6CisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0YXR1cyA9IHNtZV9IYW5kbGVQb3N0Q2hhbm5lbFN3aXRjaEluZChwTWFjKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICB9CisKKyNpZmRlZiBXTEFOX1dBS0VVUF9FVkVOVFMKKyAgICAgICAgICBjYXNlIGVXTklfU01FX1dBS0VfUkVBU09OX0lORDoKKyAgICAgICAgICAgICAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfU01FLAorICAgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX1NNRV9SWF9XREFfTVNHLCBOT19TRVNTSU9OLCBwTXNnLT50eXBlKSk7CisgICAgICAgICAgICAgICAgaWYocE1zZy0+Ym9keXB0cikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gc21lX1dha2VSZWFzb25JbmRDYWxsYmFjaygodm9pZCAqKXBNYWMsIHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgIkVtcHR5IHJzcCBtZXNzYWdlIGZvciBtZWFzIChlV05JX1NNRV9XQUtFX1JFQVNPTl9JTkQpLCBub3RoaW5nIHRvIHByb2Nlc3MiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisjZW5kaWYgLy8gV0xBTl9XQUtFVVBfRVZFTlRTCisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworICAgICAgICAgIC8qCisgICAgICAgICAgICogY29tbWFuZCByZXNjaXZlZCBmcm9tIFBFLCBTTUUgdGRscyBtc2cgcHJvY2Vzc29yIHNoYWxsIGJlIGNhbGxlZAorICAgICAgICAgICAqIHRvIHByb2Nlc3MgY29tbWFuZHMgcmVjaWV2ZWQgZnJvbSBQRQorICAgICAgICAgICAqLworICAgICAgICAgIGNhc2UgZVdOSV9TTUVfVERMU19TRU5EX01HTVRfUlNQOgorICAgICAgICAgIGNhc2UgZVdOSV9TTUVfVERMU19BRERfU1RBX1JTUDoKKyAgICAgICAgICBjYXNlIGVXTklfU01FX1RETFNfREVMX1NUQV9SU1A6CisgICAgICAgICAgY2FzZSBlV05JX1NNRV9URExTX0RFTF9TVEFfSU5EOgorICAgICAgICAgIGNhc2UgZVdOSV9TTUVfVERMU19ERUxfQUxMX1BFRVJfSU5EOgorICAgICAgICAgIGNhc2UgZVdOSV9TTUVfTUdNVF9GUk1fVFhfQ09NUExFVElPTl9JTkQ6CisgICAgICAgICAgY2FzZSBlV05JX1NNRV9URExTX0xJTktfRVNUQUJMSVNIX1JTUDoKKyAgICAgICAgICBjYXNlIGVXTklfU01FX1RETFNfQ0hBTk5FTF9TV0lUQ0hfUlNQOgorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAocE1zZy0+Ym9keXB0cikKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gdGRsc01zZ1Byb2Nlc3NvcihwTWFjLCBwTXNnLT50eXBlLCBwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgIkVtcHR5IHJzcCBtZXNzYWdlIGZvciBURExTLCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vdGhpbmcgdG8gcHJvY2VzcyIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyNlbmRpZgorCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworICAgICAgICAgICBjYXNlIGVXTklfU01FX1VOUFJPVF9NR01UX0ZSTV9JTkQ6CisgICAgICAgICAgICAgICAgaWYgKHBNc2ctPmJvZHlwdHIpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzbWVfVW5wcm90ZWN0ZWRNZ210RnJtSW5kKHBNYWMsIHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocE1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCAiRW1wdHkgcnNwIG1lc3NhZ2UgZm9yIG1lYXMgKGVXTklfU01FX1VOUFJPVF9NR01UX0ZSTV9JTkQpLCBub3RoaW5nIHRvIHByb2Nlc3MiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisjZW5kaWYKKyNpZiBkZWZpbmVkKEZFQVRVUkVfV0xBTl9FU0UpICYmIGRlZmluZWQoRkVBVFVSRV9XTEFOX0VTRV9VUExPQUQpCisgICAgICAgICAgIGNhc2UgZVdOSV9TTUVfVFNNX0lFX0lORDoKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChwTXNnLT5ib2R5cHRyKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc21lX1RzbUllSW5kKHBNYWMsIHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocE1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCAiRW1wdHkgcnNwIG1lc3NhZ2UgZm9yIChlV05JX1NNRV9UU01fSUVfSU5EKSwgbm90aGluZyB0byBwcm9jZXNzIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICB9CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0VTRSAmJiBGRUFUVVJFX1dMQU5fRVNFX1VQTE9BRCAqLworI2lmZGVmIFdMQU5fRkVBVFVSRV9ST0FNX1NDQU5fT0ZGTE9BRAorICAgICAgICAgIGNhc2UgZVdOSV9TTUVfUk9BTV9TQ0FOX09GRkxPQURfUlNQOgorICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1PZmZsb2FkU2NhblJzcEhkbHIoKHZvaWQgKilwTWFjLCBwTXNnLT5ib2R5dmFsKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyNlbmRpZiAvLyBXTEFOX0ZFQVRVUkVfUk9BTV9TQ0FOX09GRkxPQUQKKworI2lmZGVmIFdMQU5fRkVBVFVSRV9HVEtfT0ZGTE9BRAorICAgICAgICAgICBjYXNlIGVXTklfUE1DX0dUS19PRkZMT0FEX0dFVElORk9fUlNQOgorICAgICAgICAgICAgICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9TTUUsCisgICAgICAgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfU01FX1JYX1dEQV9NU0csIE5PX1NFU1NJT04sIHBNc2ctPnR5cGUpKTsKKyAgICAgICAgICAgICAgICBpZiAocE1zZy0+Ym9keXB0cikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtZV9Qcm9jZXNzR2V0R3RrSW5mb1JzcChwTWFjLCBwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgICAgICAgICAgdm9zX21lbV96ZXJvKHBNc2ctPmJvZHlwdHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJHdGtPZmZsb2FkR2V0SW5mb1JzcFBhcmFtcykpOworICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocE1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCAiRW1wdHkgcnNwIG1lc3NhZ2UgZm9yIChlV05JX1BNQ19HVEtfT0ZGTE9BRF9HRVRJTkZPX1JTUCksIG5vdGhpbmcgdG8gcHJvY2VzcyIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhayA7CisjZW5kaWYKKworI2lmZGVmIEZFQVRVUkVfV0xBTl9MUEhCCisgICAgICAgICAgLyogTFBIQiB0aW1lb3V0IGluZGljYXRpb24gYXJyaXZlZCwgc2VuZCBJTkQgdG8gY2xpZW50ICovCisgICAgICAgICAgY2FzZSBlV05JX1NNRV9MUEhCX0lORDoKKyAgICAgICAgICAgICAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfU01FLAorICAgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX1NNRV9SWF9XREFfTVNHLCBOT19TRVNTSU9OLCBwTXNnLT50eXBlKSk7CisgICAgICAgICAgICAgICAgaWYgKHBNYWMtPnNtZS5wTHBoYkluZENiKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBwTWFjLT5zbWUucExwaGJJbmRDYihwTWFjLT5wQWRhcHRlciwgcE1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTXNnLT5ib2R5cHRyKTsKKworICAgICAgICAgICAgICAgIGJyZWFrOworI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9MUEhCICovCisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fQ0hfQVZPSUQKKyAgICAgICAgICAvKiBMUEhCIHRpbWVvdXQgaW5kaWNhdGlvbiBhcnJpdmVkLCBzZW5kIElORCB0byBjbGllbnQgKi8KKyAgICAgICAgICBjYXNlIGVXTklfU01FX0NIX0FWT0lEX0lORDoKKyAgICAgICAgICAgICAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfU01FLAorICAgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX1NNRV9SWF9XREFfTVNHLCBOT19TRVNTSU9OLCBwTXNnLT50eXBlKSk7CisgICAgICAgICAgICAgICAgaWYgKHBNYWMtPnNtZS5wQ2hBdm9pZE5vdGlmaWNhdGlvbkNiKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IENIIGF2b2lkIG5vdGlmaWNhdGlvbiIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICAgICBwTWFjLT5zbWUucENoQXZvaWROb3RpZmljYXRpb25DYihwTWFjLT5wQWRhcHRlciwgcE1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTXNnLT5ib2R5cHRyKTsKKworICAgICAgICAgICAgICAgIGJyZWFrOworI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9DSF9BVk9JRCAqLworCisgICAgICAgICAgY2FzZSBlV05JX1NNRV9FTkNSWVBUX01TR19SU1A6CisgICAgICAgICAgICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9TTUUsCisgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX1NNRV9SWF9XREFfTVNHLCBOT19TRVNTSU9OLCBwTXNnLT50eXBlKSk7CisgICAgICAgICAgICAgIGlmIChwTXNnLT5ib2R5cHRyKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBzbWVfRW5jcnlwdE1zZ1Jlc3BvbnNlSGFuZGxlcihwTWFjLCBwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLAorICAgICAgICAgICAgICAgICAgICAgICAgICJFbXB0eSByc3AgbWVzc2FnZSBmb3IgKGVXTklfU01FX0VOQ1JZUFRfTVNHX1JTUCksIgorICAgICAgICAgICAgICAgICAgICAgICAgICIgbm90aGluZyB0byBwcm9jZXNzIik7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgYnJlYWsgOworCisgICAgICAgICAgY2FzZSBlV05JX1NNRV9VUERBVEVfTUFYX1JBVEVfSU5EOgorICAgICAgICAgICAgICBpZiAocE1zZy0+Ym9keXB0cikKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgc21lX1VwZGF0ZU1heFJhdGVJbmQocE1hYywgcE1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocE1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAiRW1wdHkgbWVzc2FnZSBmb3IgKGVXTklfU01FX1VQREFURV9NQVhfUkFURV9JTkQpLCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAiIG5vdGhpbmcgdG8gcHJvY2VzcyIpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgY2FzZSBlV05JX1NNRV9OQU5fRVZFTlQ6CisgICAgICAgICAgICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9TTUUsCisgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX1NNRV9SWF9XREFfTVNHLCBOT19TRVNTSU9OLCBwTXNnLT50eXBlKSk7CisgICAgICAgICAgICAgIGlmIChwTXNnLT5ib2R5cHRyKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBzbWVfTmFuRXZlbnQoaEhhbCwgcE1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocE1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIkVtcHR5IG1lc3NhZ2UgZm9yIChlV05JX1NNRV9OQU5fRVZFTlQpLCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIiBub3RoaW5nIHRvIHByb2Nlc3MiKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgIGRlZmF1bHQ6CisKKyAgICAgICAgICAgICBpZiAoICggcE1zZy0+dHlwZSA+PSBlV05JX1NNRV9NU0dfVFlQRVNfQkVHSU4gKQorICAgICAgICAgICAgICAgICAgJiYgICggcE1zZy0+dHlwZSA8PSBlV05JX1NNRV9NU0dfVFlQRVNfRU5EICkgKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvL0NTUgorICAgICAgICAgICAgICAgIGlmIChwTXNnLT5ib2R5cHRyKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JNc2dQcm9jZXNzb3IoaEhhbCwgcE1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HRSwgIkVtcHR5IHJzcCBtZXNzYWdlIGZvciBDU1IsIG5vdGhpbmcgdG8gcHJvY2VzcyIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICB9CisgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR1csICJVbmtub3duIG1lc3NhZ2UgdHlwZSAlZCwgbm90aGluZyB0byBwcm9jZXNzIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBNc2ctPnR5cGUpOworICAgICAgICAgICAgICAgIGlmIChwTXNnLT5ib2R5cHRyKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocE1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgIH0KKyAgICAgICAgICB9Ly9zd2l0Y2gKKyAgICAgIH0gLy9TTUVfSVNfU1RBUlQKKyAgICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HVywgIm1lc3NhZ2UgdHlwZSAlZCBpbiBzdG9wIHN0YXRlIGlnbm9yZWQiLCBwTXNnLT50eXBlKTsKKyAgICAgICAgIGlmIChwTXNnLT5ib2R5cHRyKQorICAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9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IGhIYWwgKTsKKyAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfU01FLAorICAgICAgICAgICBUUkFDRV9DT0RFX1NNRV9SWF9IRERfTVNHX1NDQU5fUkVRLCBzZXNzaW9uSWQsIHBzY2FuUmVxLT5zY2FuVHlwZSkpOworICAgIHNtc0xvZyhwTWFjLCBMT0cyLCBGTCgiZW50ZXIiKSk7CisgICAgZG8KKyAgICB7CisgICAgICAgIGlmKHBNYWMtPnNjYW4uZlNjYW5FbmFibGUgJiYKKyAgICAgICAgICAgKHBNYWMtPmlzQ29leFNjb0luZFNldCA/IHNjb19pc1NjYW5BbGxvd2VkKHBNYWMsIHBzY2FuUmVxKSA6IFRSVUUpKQorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSBzbWVfQWNxdWlyZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKTsKKyAgICAgICAgICAgIGlmICggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgeworI2lmZGVmIEZFQVRVUkVfV0xBTl9MRlIKKyAgICAgICAgICAgICAgICAgICAgaWYoY3NySXNTY2FuQWxsb3dlZChwTWFjKSkKKyAgICAgICAgICAgICAgICAgICAgeworI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBjc3JTY2FuUmVxdWVzdCggaEhhbCwgc2Vzc2lvbklkLCBwc2NhblJlcSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NhblJlcXVlc3RJRCwgY2FsbGJhY2ssIHBDb250ZXh0ICk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoICFIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoImNzclNjYW5SZXF1ZXN0IGZhaWxlZCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgU0lkPSVkIiksIHNlc3Npb25JZCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisjaWZkZWYgRkVBVFVSRV9XTEFOX0xGUgorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJTY2FuIGRlbmllZCBpbiBzdGF0ZSAlcyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKHN1Yi1zdGF0ZSAlcykiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWNUcmFjZUdldE5laWdoYm91clJvYW1TdGF0ZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5yb2FtLm5laWdoYm9yUm9hbUluZm8ubmVpZ2hib3JSb2FtU3RhdGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hY1RyYWNlR2V0Y3NyUm9hbVN1YlN0YXRlKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0uY3VyU3ViU3RhdGVbc2Vzc2lvbklkXSkpOworICAgICAgICAgICAgICAgICAgICAgICAgLypIYW5kT2ZmIGlzIGluIHByb2dyZXNzLiBTbyBzY2hlZHVsZSB0aGlzIHNjYW4gbGF0ZXIqLworICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfUkVTT1VSQ0VTOworICAgICAgICAgICAgICAgICAgICB9CisjZW5kaWYKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBzbWVfUmVsZWFzZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKTsKKyAgICAgICAgICAgIH0gLy9zbWVfQWNxdWlyZUdsb2JhbExvY2sgc3VjY2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b2FtIHRvLiBJdCBpcyByZXR1cm5lZAorICAgICAgICAgICAgICAgICAgICAgICAgZnJvbSBjc3JTY2FuR2V0UmVzdWx0CisgICAgXHBhcmFtIHBSb2FtSWQgLSB0byBnZXQgYmFjayB0aGUgcmVxdWVzdCBJRAorICAgIFxyZXR1cm4gZUhhbFN0YXR1cworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworZUhhbFN0YXR1cyBzbWVfUm9hbUNvbm5lY3QodEhhbEhhbmRsZSBoSGFsLCB0QU5JX1U4IHNlc3Npb25JZCwgdENzclJvYW1Qcm9maWxlICpwUHJvZmlsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwUm9hbUlkKQoreworICAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICB0cEFuaVNpckdsb2JhbCBwTWFjID0gUE1BQ19TVFJVQ1QoIGhIYWwgKTsKKworICAgIGlmICghcE1hYykKKyAgICB7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIH0KKworICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9TTUUsCisgICAgICAgICAgICAgICAgICAgVFJBQ0VfQ09ERV9TTUVfUlhfSEREX01TR19DT05ORUNULCBzZXNzaW9uSWQsIDApKTsKKyAgICBzbXNMb2cocE1hYywgTE9HMiwgRkwoImVudGVyIikpOworICAgIHN0YXR1cyA9IHNtZV9BY3F1aXJlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICAgIGlmICggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgeworICAgICAgICBpZiggQ1NSX0lTX1NFU1NJT05fVkFMSUQoIHBNYWMsIHNlc3Npb25JZCApICkKKyAgICAgICAgeworICAgICA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c190cmFjZShWT1NfTU9EVUxFX0lEX1NNRSwKKyAgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX1NNRV9SWF9IRERfUk9BTV9SRUFTU09DLCBzZXNzaW9uSWQsIDApKTsKKyAgICBzbXNMb2cocE1hYywgTE9HMiwgRkwoImVudGVyIikpOworICAgIHN0YXR1cyA9IHNtZV9BY3F1aXJlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICAgIGlmICggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgeworICAgICAgICBpZiggQ1NSX0lTX1NFU1NJT05fVkFMSUQoIHBNYWMsIHNlc3Npb25JZCApICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYoKE5VTEwgPT0gcFByb2ZpbGUpICYmIChmRm9yY2UgPT0gMSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdENzclJvYW1TZXNzaW9uICpwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTiggcE1hYywgc2Vzc2lvbklkICk7CisgICAgICAgICAgICAgICAgLyogdG8gZm9yY2UgdGhlIEFQIGluaXRpYXRlIGZyZXNoIDgwMi4xeCBhdXRoZW50aWNhdGlvbiBuZWVkIHRvIGNsZWFyCisgICAgICAgICAgICAgICAgICogdGhlIFBNS0lEIGNhY2hlIGZvciB0aGF0IHNldCB0aGUgZm9sbG93aW5nIGJvb2xlYW4uIHRoaXMgaXMgbmVlZGVkCisgICAgICAgICAgICAgICAgICogYnkgdGhlIEhTIDIuMCBwYXNzcG9pbnQgY2VydGlmaWNhdGlvbiA1LjIuYSBhbmQgYiB0ZXN0Y2FzZXMgKi8KKyAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+Zklnbm9yZVBNS0lEQ2FjaGUgPSBUUlVFOworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNzclJlYXNzb2MoIHBNYWMsIHNlc3Npb25JZCwgJm1vZFByb2ZpbGVGaWVsZHMsIHBSb2FtSWQgLCBmR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MsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0QU5JX1U4ICpwUGVlck1hY0FkZHIKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwUGVlck1hY0FkZHIKKyNlbmRpZgorKQoreworICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9IFBNQUNfU1RSVUNUKCBoSGFsICk7CisKKyAgIGlmICggTlVMTCA9PSBwTWFjICkKKyAgIHsKKyAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgcmV0dXJuIHN0YXR1czsKKyAgIH0KKworICAgc3RhdHVzID0gc21lX0FjcXVpcmVHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisgICBpZiAoIEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgeworICAgICAgaWYoIENTUl9JU19TRVNTSU9OX1ZBTElEKCBwTWFjLCBzZXNzaW9uSWQgKSApCisgICAgICB7CisgICAgICAgICBzdGF0dXMgPSBjc3JSb2FtSXNzdWVEaXNhc3NvY2lhdGVTdGFDbWQoIHBNYWMsIHNlc3Npb25JZCwgcFBlZXJNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX01BQ19ERUFVVEhfTEVBVklOR19CU1NfUkVBU09OKTsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0lOVkFMSURfUEFSQU1FVEVSOworICAgICAgfQorICAgICAgc21lX1JlbGVhc2VHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisgICB9CisKKyAgIHJldHVybiAoc3RhdHVzKTsKK30KKworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KK2VIYWxTdGF0dXMgc21lX1JvYW1HZXRBc3NvY2lhdGVkU3Rhcyh0SGFsSGFuZGxlIGhIYWwsIHRBTklfVTggc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19NT0RVTEVfSUQgbW9kSWQsIHZvaWQgKnBVc3JDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnBmblNhcEV2ZW50Q2FsbGJhY2ssIHRBTklfVTggKnBBc3NvY1N0YXNCdWYpCit7CisgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICB0cEFuaVNpckdsb2JhbCBwTWFjID0gUE1BQ19TVFJVQ1QoIGhIYWwgKTsKKworICAgaWYgKCBOVUxMID09IHBNYWMgKQorICAgeworICAgICBWT1NfQVNTRVJUKDApOworICAgICByZXR1cm4gc3RhdHVzOworICAgfQorCisgICBzdGF0dXMgPSBzbWVfQWNxdWlyZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKTsKKyAgIGlmICggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICB7CisgICAgICAgIGlmKCBDU1JfSVNfU0VTU0lPTl9WQUxJRCggcE1hYywgc2Vzc2lvbklkICkgKQorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSBjc3JSb2FtR2V0QXNzb2NpYXRlZFN0YXMoIHBNYWMsIHNlc3Npb25JZCwgbW9kSWQsIHBVc3JDb250ZXh0LCBwZm5TYXBFdmVudENhbGxiYWNrLCBwQXNzb2NTdGFzQnVmICk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19JTlZBTElEX1BBUkFNRVRFUjsKKyAgICAgICAgfQorICAgICAgICB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DVCggaEhhbCApOworCisgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfU01FLAorICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfU01FX1JYX0hERF9ST0FNX0dFVF9DT05ORUNUUFJPRklMRSwgc2Vzc2lvbklkLCAwKSk7CisgICBzdGF0dXMgPSBzbWVfQWNxdWlyZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKTsKKyAgIGlmICggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICB7CisgICAgICBpZiggQ1NSX0lTX1NFU1NJT05fVkFMSUQoIHBNYWMsIHNlc3Npb25JZCApICkKKyAgICAgIHsKKyAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1HZXRDb25uZWN0UHJvZmlsZSggcE1hYywgc2Vzc2lvbklkLCBwUHJvZmlsZSApOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0lOVkFMSURfUEFSQU1FVEVSOworICAgICAgfQorICAgICAgc21lX1JlbGVhc2VHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisgICB9CisKKyAgIHJldHVybiAoc3RhdHVzKTsKK30KKworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgXGZuIHNtZV9Sb2FtRnJlZUNvbm5lY3RQcm9maWxlCisgICAgXGJyaWVmIGEgd3JhcHBlciBmdW5jdGlvbiB0byByZXF1ZXN0IENTUiB0byBmcmVlIGFuZCByZWluaXRpYWxpemUgdGhlCisgICAgICAgICAgIHByb2ZpbGUgcmV0dXJuZWQgcHJldmlvdXNseSBieSBjc3JSb2FtR2V0Q29ubmVjdFByb2ZpbGUuCisgICAgVGhpcyBpcyBhIHN5bmNocm9ub3VzIGNhbGwuCisgICAgXHBhcmFtIHBQcm9maWx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IGJpZyBlbm91Z2ggYW5kIHBOdW1JdGVtcyBoYXMgdGhlIG51bWJlciBvZgorICAgICAgICAgICAgICAgICAgICAgICAgIHRQbWtpZENhY2hlSW5mby4KKyAgICBcTm90ZTogcE51bUl0ZW1zIGlzIGEgbnVtYmVyIG9mIHRQbWtpZENhY2hlSW5mbywKKyAgICAgICAgICAgbm90IHNpemVvZih0UG1raWRDYWNoZUluZm8pICogc29tZXRoaW5nCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCitlSGFsU3RhdHVzIHNtZV9Sb2FtU2V0UE1LSURDYWNoZSggdEhhbEhhbmRsZSBoSGFsLCB0QU5JX1U4IHNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0UG1raWRDYWNoZUluZm8gKnBQTUtJRENhY2hlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG51bUl0ZW1zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfQk9PTEVBTiB1cGRhdGVfZW50aXJlX2NhY2hlICkKK3sKKyAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVCggaEhhbCApOworCisgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfU01FLAorICAgICAgICAgIFRSQUNFX0NPREVfU01FX1JYX0hERF9ST0FNX1NFVF9QTUtJRENBQ0hFLCBzZXNzaW9uSWQsIG51bUl0ZW1zKSk7CisgICBzdGF0dXMgPSBzbWVfQWNxdWlyZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKTsKKyAgIGlmICggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICB7CisgICAgICBpZiggQ1NSX0lTX1NFU1NJT05fVkFMSUQoIHBNYWMsIHNlc3Npb25JZCApICkKKyAgICAgIHsKKyAgICAgICAgIHN0YXR1cyA9IGNzclJvYW1TZXRQTUtJRENhY2hlKCBwTWFjLCBzZXNzaW9uSWQsIHBQTUtJRENhY2hlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bUl0ZW1zLCB1cGRhdGVfZW50aXJlX2NhY2hlICk7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfSU5WQUxJRF9QQVJBTUVURVI7CisgICAgICB9CisgICAgICBzbWVfUmVsZWFzZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKTsKKyAgIH0KKworICAgcmV0dXJuIChzdGF0dXMpOworfQorCitlSGFsU3RhdHVzIHNtZV9Sb2FtRGVsUE1LSURmcm9tQ2FjaGUoIHRIYWxIYW5kbGUgaEhhbCwgdEFOSV9VOCBzZXNzaW9uSWQsCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE4LDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0QU5JX1U4ICpwQlNTSWQsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQlNTSWQsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9CT09MRUFOIGZsdXNoX2NhY2hlICkKK3sKKyAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVCggaEhhbCApOworICAgc3RhdHVzID0gc21lX0FjcXVpcmVHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisKKyAgIE1UUkFDRSh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bGxiYWNrQ29udGV4dCAtIEEgY29va2llIHBhc3NlZCBieSBIREQsIHRoYXQgaXMgcGFzc2VkIGJhY2sgdG8gSERECisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdCB0aGUgdGltZSBvZiBjYWxsYmFjay4KKyAgICBccGFyYW0gIHdha2VSZWFzb25JbmRDQiAtICBDYWxsYmFjayByb3V0aW5lIHByb3ZpZGVkIGJ5IEhERC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVc2VkIGZvciBXYWtlIFJlYXNvbiBJbmRpY2F0aW9uIGJ5IFNNRQorICAgIFxwYXJhbSAgd2FrZVJlYXNvbkluZENCQ29udGV4dCAtIEEgY29va2llIHBhc3NlZCBieSBIREQsIHRoYXQgaXMgcGFzc2VkIGJhY2sgdG8gSERECisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdCB0aGUgdGltZSBvZiBjYWxsYmFjay4KKyAgICBccmV0dXJuIGVIYWxTdGF0dXMKKyAgICAgICAgICAgIGVIQUxfU1RBVFVTX1NVQ0NFU1MgIERldmljZSBpcyBhbHJlYWR5IGluIFdvV0xBTiBtb2RlCisgICAgICAgICAgICBlSEFMX1NUQVRVU19GQUlMVVJFICBEZXZpY2UgY2Fubm90IGVudGVyIFdvV0xBTiBtb2RlLgorICAgICAgICAgICAgZUhBTF9TVEFUVVNfUE1DX1BFTkRJTkcgIFJlcXVlc3QgYWNjZXB0ZWQuIFNNRSB3aWxsIGVuYWJsZSBXT1dMIGFmdGVyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJNUFMgbW9kZSBpcyBlbnRlcmVkLgorICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworZUhhbFN0YXR1cyBzbWVfRW50ZXJXb3dsICgKKyAgICB0SGFsSGFuZGxlIGhIYWwsCisgICAgdm9pZ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V5RGlyZWN0aW9uID09IGVTSVJfVFhfREVGQVVMVCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGlmICggKCBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVA0MCA9PSBwU2V0S2V5LT5lbmNUeXBlICkgfHwKKyAgICAgICAgICAgICAgICAgKCBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVA0MF9TVEFUSUNLRVkgPT0gcFNldEtleS0+ZW5jVHlwZSApKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgcFNlc3Npb24tPnBDdXJSb2FtUHJvZmlsZS0+bmVnb3RpYXRlZFVDRW5jcnlwdGlvblR5cGUgPSBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVA0MF9TVEFUSUNLRVk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoICggZUNTUl9FTkNSWVBUX1RZUEVfV0VQMTA0ID09IHBTZXRLZXktPmVuY1R5cGUgKSB8fAorICAgICAgICAgICAgICAgICAoIGVDU1JfRU5DUllQVF9UWVBFX1dFUDEwNF9TVEFUSUNLRVkgPT0gcFNldEtleS0+ZW5jVHlwZSApKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgcFNlc3Npb24tPnBDdXJSb2FtUHJvZmlsZS0+bmVnb3RpYXRlZFVDRW5jcnlwdGlvblR5cGUgPSBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVAxMDRfU1RBVElDS0VZOworICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICAgfQorCisgICAgICBzdGF0dXMgPSBjc3JSb2FtU2V0S2V5ICggcE1hYywgc2Vzc2lvbklkLCBwU2V0S2V5LCByb2FtSWQgKTsKKyAgICAgIHNtZV9SZWxlYXNlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICAgfQorICAgaWYgKHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ucm9hbURlbGF5U3RhdHNFbmFibGVkKQorICAgeworICAgICAgIC8vU3RvcmUgc2VudCBQVEsga2V5IHRpb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CB0aGUgY2FsbGJhY2sKKyAgICBccGFyYW0gcFZvc0NvbnRleHQgLSB2b3MgY29udGV4dAorICAgIFxyZXR1cm4gZUhhbFN0YXR1cworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworZUhhbFN0YXR1cyBzbWVfR2V0VHNtU3RhdHModEhhbEhhbmRsZSBoSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Q3NyVHNtU3RhdHNDYWxsYmFjayBjYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBzdGFJZCwgdENzckJzc2lkIGJzc0lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpwQ29udGV4dCwgdm9pZCogcFZvc0NvbnRleHQsIHRBTklfVTggdGlkKQoreworICAgZUhhbFN0YXR1cyAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVCggaEhhbCApOworCisgICBzdGF0dXMgPSBzbWVfQWNxdWlyZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKTsKKyAgIGlmICggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICB7CisgICAgICBzdGF0dXMgPSBjc3JHZXRUc21TdGF0cyggcE1hYywgY2FsbGJhY2ssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFJZCwgYnNzSWQsIHBDb250ZXh0LCBwVm9zQ29udGV4dCwgdGlkKTsKKyAgICAgIHNtZV9SZWxlYXNlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICAgfQorICAgcmV0dXJuIChzdGF0dXMpOworfQorI2VuZGlmCisKKworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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GljaXR5LCBjYWNoZSwgc3RhSWQsIHBDb250ZXh0KTsKKyAgICAgIHNtZV9SZWxlYXNlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICAgfQorCisgICByZXR1cm4gKHN0YXR1cyk7CisKK30KKworZUhhbFN0YXR1cyBzbWVfR2V0RndTdGF0cyh0SGFsSGFuZGxlIGhIYWwsIHRBTklfVTMyIHN0YXRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnBDb250ZXh0LCB0U2lyRldTdGF0c0NhbGxiYWNrIGNhbGxiYWNrKQoreworICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9IFBNQUNfU1RSVUNUKCBoSGFsICk7CisgICB2b3NfbXNnX3QgbXNnOworICAgdFNpckZXU3RhdHNHZXRSZXEgKnBHZXRGV1N0YXRzUmVxOworCisgICBzbXNMb2cocE1hYywgTE9HMSwgRkwoIiBFTlRFUiBzdGF0cyA9ICVkICIpLHN0YXRzKTsKKworICAgaWYgKCBlSEFMX1NUQVRVU19TVUNDRVNTID09ICBzbWVfQWNxdWlyZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKSkKKyAgIHsKKyAgICAgICBwR2V0RldTdGF0c1JlcSA9ICh0U2lyRldTdGF0c0dldFJlcSAqKXZvc19tZW1fbWFsbG9jKHNpemVvZih0U2lyRldTdGF0c0dldFJlcSkpOworICAgICAgIGlmICggTlVMTCA9PSBwR2V0RldTdGF0c1JlcSkKKyAgICAgICB7CisgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJOb3QgYWJsZSB0byBhbGxvY2F0ZSBtZW1vcnkgZm9yICIKKyAgICAgICAgICAgICAgICJXREFfRldfU1RBVFNfR0VUX1JFUSIpKTsKKyAgICAgICAgICBzbWVfUmVsZWFzZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKTsKKyAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICB9CisgICAgICAgcEdldEZX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GFsbCBkb21haW5zIGZvciBub3cKKyAgICBpZiggcE51bURvbWFpbnMgKQorICAgIHsKKyAgICAgICAgaWYoIE5VTV9SRUdfRE9NQUlOUyA8PSAqcE51bURvbWFpbnMgKQorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICB9CisgICAgICAgICpwTnVtRG9tYWlucyA9IE5VTV9SRUdfRE9NQUlOUzsKKyAgICB9CisgICAgaWYoIEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgaWYoIHBEb21haW5zICkKKyAgICAgICAgeworICAgICAgICAgICAgcERvbWFpbnNbMF0gPSBSRUdET01BSU5fRkNDOworICAgICAgICAgICAgcERvbWFpbnNbMV0gPSBSRUdET01BSU5fRVRTSTsKKyAgICAgICAgICAgIHBEb21haW5zWzJdID0gUkVHRE9NQUlOX0pBUEFOOworICAgICAgICAgICAgcERvbWFpbnNbM10gPSBSRUdET01BSU5fV09STEQ7CisgICAgICAgICAgICBwRG9tYWluc1s0XSA9IFJFR0RPTUFJTl9OX0FNRVJfRVhDX0ZDQzsKKyAgICAgICAgICAgIHBEb21haW5zWzVdID0gUkVHRE9NQUlOX0FQQUM7CisgICAgICAgICAgICBwRG9tYWluc1s2XSA9IFJFR0RPTUFJTl9LT1JFQTsKKyAgICAgICAgICAgIHBEb21haW5zWzddID0gUkVHRE9NQUlOX0hJXzVHSFo7CisgICAgICAgICAgICBwRG9tYWluc1s4XSA9IFJFR0RPTUFJTl9OT181R0haOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfSU5WQUxJRF9QQVJBTUVURVI7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gKCBzdGF0dXMgKTsKK30KKworCisvL3NvbWUgc3VwcG9ydCBmdW5jdGlvbnMKK3RBTklfQk9PTEVBTi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oYW5nZUNvdW50cnlDb2RlCisKKyAgICBcYnJpZWYgQ2hhbmdlIENvdW50cnkgY29kZSBmcm9tIHVwcGVybGF5ZXIgZHVyaW5nIFdMQU4gZHJpdmVyIG9wZXJhdGlvbi4KKyAgICAgICAgICAgVGhpcyBpcyBhIHN5bmNocm9ub3VzIEFQSS4KKworICAgIFxwYXJhbSBoSGFsIC0gVGhlIGhhbmRsZSByZXR1cm5lZCBieSBtYWNPcGVuLgorCisgICAgXHBhcmFtIHBDb3VudHJ5IE5ldyBDb3VudHJ5IENvZGUgU3RyaW5nCisKKyAgICBccGFyYW0gc2VuZFJlZ0hpbnQgSWYgd2Ugd2FudCB0byBzZW5kIHJlZyBoaW50IHRvIG5sODAyMTEKKworICAgIFxyZXR1cm4gZUhhbFN0YXR1cyAgU1VDQ0VTUy4KKworICAgICAgICAgICAgICAgICAgICAgICAgIEZBSUxVUkUgb3IgUkVTT1VSQ0VTICBUaGUgQVBJIGZpbmlzaGVkIGFuZCBmYWlsZWQuCisKKyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCitlSGFsU3RhdHVzIHNtZV9DaGFuZ2VDb3VudHJ5Q29kZSggdEhhbEhhbmRsZSBoSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNtZUNoYW5nZUNvdW50cnlDYWxsYmFjayBjYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBDb3VudHJ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqcENvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkKiBwVm9zQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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hdHVzICkgKQorICAgIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsIEZMKCIgY2FsbGVkIikpOworICAgICAgICBwTXNnID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRBbmlHZW5lcmljQ2hhbmdlQ291bnRyeUNvZGVSZXEpKTsKKyAgICAgICAgaWYgKE5VTEwgPT0gcE1zZykKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsICIgc21lX0dlbmVyaWNDaGFuZ2VDb3VudHJ5Q29kZTogZmFpbGVkIHRvIGFsbG9jYXRlIG1lbSBmb3IgcmVxIik7CisgICAgICAgICAgICBzbWVfUmVsZWFzZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKTsKKyAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICB9CisKKyAgICAgICAgcE1zZy0+bXNnVHlwZSA9IHBhbF9jcHVfdG9fYmUxNigodEFOSV9VMTYpZVdOSV9TTUVfR0VORVJJQ19DSEFOR0VfQ09VTlRSWV9DT0RFKTsKKyAgICAgICAgcE1zZy0+bXNnTGVuID0gKHRBTklfVTE2KXNpemVvZih0QW5pR2VuZXJpY0NoYW5nZUNvdW50cnlDb2RlUmVxKTsKKyAgICAgICAgdm9zX21lbV9jb3B5KHBNc2ctPmNvdW50cnlDb2RlLCBwQ291bnRyeSwgMik7CisKKyAgICAgICAgcE1zZy0+Y291bnRyeUNvZGVbMl0gPSAnICc7IC8qIEZvciBBU0NJSSBzcGFjZSAqLworCisgICAgICAgIHBNc2ctPmRvbWFpbl9pbmRleCA9IHJlZ19kb21haW47CisKKyAgICAgICAgbXNnLnR5cGUgPSBlV05JX1NNRV9HRU5FUklDX0NIQU5HRV9DT1VOVFJZX0NPREU7CisgICAgICAgIG1zZy5ib2R5cHRyID0gcE1zZzsKKyAgICAgICAgbXNnLnJlc2VydmVkID0gMDsKKworICAgICAgICBpZiAoVk9TX1NUQVRVU19TVUNDRVN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LgorICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCitlSGFsU3RhdHVzIHNtZV9ESENQU3RhcnRJbmQoIHRIYWxIYW5kbGUgaEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBkZXZpY2VfbW9kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBzZXNzaW9uSWQgKQoreworICAgIGVIYWxTdGF0dXMgICAgICAgICAgc3RhdHVzOworICAgIFZPU19TVEFUVVMgICAgICAgICAgdm9zU3RhdHVzOworICAgIHRwQW5pU2lyR2xvYmFsICAgICAgcE1hYyA9IFBNQUNfU1RSVUNUKCBoSGFsICk7CisgICAgdm9zX21zZ190ICAgICAgICAgICB2b3NNZXNzYWdlOworICAgIHRBbmlESENQSW5kICAgICAgICAgKnBNc2c7CisgICAgdENzclJvYW1TZXNzaW9uICAgICAqcFNlc3Npb247CisKKyAgICBzdGF0dXMgPSBzbWVfQWNxdWlyZUdsb2JhbExvY2soJnBNYWMtPnNtZSk7CisgICAgaWYgKCBlSEFMX1NUQVRVU19TVUNDRVNTID09IHN0YXR1cykKKyAgICB7CisgICAgICAgIHBTZXNzaW9uID0gQ1NSX0dFVF9TRVNTSU9OKCBwTWFjLCBzZXNzaW9uSWQgKTsKKworICAgICAgICBpZiAoIXBTZXNzaW9uKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoInNlc3Npb24gJWQgbm90IGZvdW5kICIpLCBzZXNzaW9uSWQpOworICAgICAgICAgICAgc21lX1JlbGVhc2VHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgfQorCisgICAgICAgIHBNc2cgPSAodEFuaURIQ1BJbmQqKXZvc19tZW1fbWFsbG9jKHNpemVvZih0QW5pREhDUEluZCkpOworICAgICAgICBpZiAoTlVMTCA9PSBwTXNnKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiJXM6IE5vdCBhYmxlIHRvIGFsbG9jYXRlIG1lbW9yeSBmb3IgZGhjcCBzdGFydCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHNtZV9SZWxlYXNlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgIH0KKyAgICAgICAgcE1zZy0+bXNnVHlwZSA9IFdEQV9ESENQX1NUQVJUX0lORDsKKyAgICAgICAgcE1zZy0+bXNnTGVuID0gKHRBTklfVTE2KXNpemVvZih0QW5pREhDUEluZCk7CisgICAgICAgIHBNc2ctPmRldmljZV9tb2RlID0gZGV2aWNlX21vZGU7CisgICAgICAgIHZvc19tZW1fY29weShwTXNnLT5tYWNBZGRyLCBwU2Vzc2lvbi0+Y29ubmVjdGVkUHJvZmlsZS5ic3NpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgIHZvc01lc3NhZ2UudHlwZSA9IFdEQV9ESENQX1NUQVJUX0lORDsKKyAgICAgICAgdm9zTWVzc2FnZS5ib2R5cHRyID0gcE1zZzsKKyAgICAgICAgdm9zTWVzc2FnZS5yZXNlcnZlZCA9IDA7CisKKyAgICAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfU01FLAorICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX1NNRV9UWF9XREFfTVNHLCBzZXNzaW9uSWQsIHZvc01lc3NhZ2UudHlwZSkpOwor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FUyAgVGhlIEFQSSBmaW5pc2hlZCBhbmQgZmFpbGVkLgorICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCitlSGFsU3RhdHVzIHNtZV9ESENQU3RvcEluZCggdEhhbEhhbmRsZSBoSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBkZXZpY2VfbW9kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggc2Vzc2lvbklkICkKK3sKKyAgICBlSGFsU3RhdHVzICAgICAgICAgIHN0YXR1czsKKyAgICBWT1NfU1RBVFVTICAgICAgICAgIHZvc1N0YXR1czsKKyAgICB0cEFuaVNpckdsb2JhbCAgICAgIHBNYWMgPSBQTUFDX1NUUlVDVCggaEhhbCApOworICAgIHZvc19tc2dfdCAgICAgICAgICAgdm9zTWVzc2FnZTsKKyAgICB0QW5pREhDUEluZCAgICAgICAgICpwTXNnOworICAgIHRDc3JSb2FtU2Vzc2lvbiAgICAgKnBTZXNzaW9uOworCisgICAgc3RhdHVzID0gc21lX0FjcXVpcmVHbG9iYWxMb2NrKCZwTWFjLT5zbWUpOworICAgIGlmICggZUhBTF9TVEFUVVNfU1VDQ0VTUyA9PSBzdGF0dXMpCisgICAgeworICAgICAgICBwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTiggcE1hYywgc2Vzc2lvbklkICk7CisKKyAgICAgICAgaWYgKCFwU2Vzc2lvbikKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCJzZXNzaW9uICVkIG5vdCBmb3VuZCAiKSwgc2Vzc2lvbklkKTsKKyAgICAgICAgICAgIHNtZV9SZWxlYXNlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgIH0KKworICAgICAgICBwTXNnID0gKHRBbmlESENQSW5kKil2b3NfbWVtX21hbGxvYyhzaXplb2YodEFuaURIQ1BJbmQpKTsKKyAgICAgICAgaWYgKE5VTEwgPT0gcE1zZykKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAiJXM6IE5vdCBhYmxlIHRvIGFsbG9jYXRlIG1lbW9yeSBmb3IgZGhjcCBzdG9wIiwgX19mdW5jX18pOworICAgICAgICAgICAgc21lX1JlbGVhc2VHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICB9CisKKyAgICAgICBwTXNnLT5tc2dUeXBlID0gV0RBX0RIQ1BfU1RPUF9JTkQ7CisgICAgICAgcE1zZy0+bXNnTGVuID0gKHRBTklfVTE2KXNpemVvZih0QW5pREhDUEluZCk7CisgICAgICAgcE1zZy0+ZGV2aWNlX21vZGUgPSBkZXZpY2VfbW9kZTsKKyAgICAgICB2b3NfbWVtX2NvcHkocE1zZy0+bWFjQWRkciwgcFNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUuYnNzaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworCisgICAgICAgdm9zTWVzc2FnZS50eXBlID0gV0RBX0RIQ1BfU1RPUF9JTkQ7CisgICAgICAgdm9zTWVzc2FnZS5ib2R5cHRyID0gcE1zZzsKKyAgICAgICB2b3NNZXNzYWdlLnJlc2VydmVkID0gMDsKKworICAgICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9TTUUsCisgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfU01FX1RYX1dEQV9NU0csIHNlc3Npb25JZCwgd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Bvd2VyU3RhdGUgUG93ZXJTdGF0ZTsKKyAgIHRBTklfVTMyICAgc2Vzc2lvbklkID0gMDsKKworICAgLyogMSkgVG8gbWFrZSBRdWFya3kgd29yayBpbiBGVE0gbW9kZSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX1NNRSwKKyAgICAgICAgICAgICAgICAgICAgVFJBQ0VfQ09ERV9TTUVfUlhfSEREX0RCR19XUklURVJFRywgTk9fU0VTU0lPTiwgMCkpOworICAgaWYoZURSSVZFUl9UWVBFX01GRyA9PSBwTWFjLT5nRHJpdmVyVHlwZSkKKyAgIHsKKyAgICAgIGlmIChlV0xBTl9QQUxfU1RBVFVTX1NVQ0NFU1MgPT0gd3BhbERiZ1dyaXRlUmVnaXN0ZXIocmVnQWRkciwgcmVnVmFsdWUpKQorICAgICAgeworICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgICAgIH0KKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgIH0KKworICAgLyogMikgTk9OIEZUTSBtb2RlIGRyaXZlciAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisgICAvKiBBY3F1aXJlIFNNRSBnbG9iYWwgbG9jayAqLworICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gc21lX0FjcXVpcmVHbG9iYWxMb2NrKCZwTWFjLT5zbWUpKQorICAgeworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgfQorCisgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1MocG1jUXVlcnlQb3dlclN0YXRlKHBNYWMsICZQb3dlclN0YXRlLCBOVUxMLCBOVUxMKSkpCisgICB7CisgICAgICAvKiBBcmUgd2Ugbm90IGluIElNUFMgbW9kZT8gT3IgYXJlIHdlIGluIGNv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YWwgcE1hYyA9IFBNQUNfU1RSVUNUKCBoSGFsICk7CisgICB0UG1jUG93ZXJTdGF0ZSBQb3dlclN0YXRlOworICAgdEFOSV9VMzIgc2Vzc2lvbklkICA9IDA7CisgICB0QU5JX1UzMiBjbWQgPSBSRUFEX01FTU9SWV9EVU1QX0NNRDsKKyAgIHRBTklfVTMyIGFyZzEgPSBtZW1BZGRyOworICAgdEFOSV9VMzIgYXJnMiA9IG5MZW4vNDsKKyAgIHRBTklfVTMyIGFyZzMgPSA0OworICAgdEFOSV9VMzIgYXJnNCA9IDA7CisgICAvKiAxKSBUbyBtYWtlIFF1YXJreSB3b3JrIGluIEZUTSBtb2RlICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfU01FLAorICAgICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX1NNRV9SWF9IRERfREJHX1JFQURNRU0sIE5PX1NFU1NJT04sIDApKTsKKyAgIGlmKGVEUklWRVJfVFlQRV9NRkcgPT0gcE1hYy0+Z0RyaXZlclR5cGUpCisgICB7CisgICAgICBpZiAoVk9TX1NUQVRVU19TVUNDRVNTID09IFdEQV9IQUxEdW1wQ21kUmVxKHBNYWMsIGNtZCwgYXJnMSwgYXJnMiwgYXJnMywgYXJnNCwgKHRBTklfVTgqKXBCdWYsIDApKQorICAgICAgeworICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgICAgIH0KKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgIH0KKworICAgLyogMikgTk9OIEZUTSBtb2RlIGRyaXZlciAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisgICAvKiBBY3F1aXJlIFNNRSBnbG9iYWwgbG9jayAqLworICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gc21lX0FjcXVpc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TUZHID09IHBNYWMtPmdEcml2ZXJUeXBlKQorICAgeworICAgICAgeworICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgICAgIH0KKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgIH0KKworICAgLyogMikgTk9OIEZUTSBtb2RlIGRyaXZlciAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisgICAvKiBBY3F1aXJlIFNNRSBnbG9iYWwgbG9jayAqLworICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gc21lX0FjcXVpcmVHbG9iYWxMb2NrKCZwTWFjLT5zbWUpKQorICAgeworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgfQorCisgICBpZihIQUxfU1RBVFVTX1NVQ0NFU1MocG1jUXVlcnlQb3dlclN0YXRlKHBNYWMsICZQb3dlclN0YXRlLCBOVUxMLCBOVUxMKSkpCisgICB7CisgICAgICAvKiBBcmUgd2Ugbm90IGluIElNUFMgbW9kZT8gT3IgYXJlIHdlIGluIGNvbm5lY3RlZD8gVGhlbiB3ZSdyZSBzYWZlKi8KKyAgICAgIGlmKCFjc3JJc0Nvbm5TdGF0ZURpc2Nvbm5lY3RlZChwTWFjLCBzZXNzaW9uSWQpIHx8IChlUE1DX0xPV19QT1dFUiAhPSBQb3dlclN0YXRlKSkKKyAgICAgIHsKKyAgICAgICAgIGlmIChlV0xBTl9QQUxfU1RBVFVTX1NVQ0NFU1MgPT0gd3BhbERiZ1dyaXRlTWVtb3J5KG1lbUFkZHIsICh2b2lkICopcEJ1ZiwgbkxlbikpCisgICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX0VfRkFJ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IGZhaWx1cmUKKyAgICAgICAgICAgIFZPU19TVEFUVVNfU1VDQ0VTUyAgc3VjY2VzcworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworVk9TX1NUQVRVUyBzbWVfR2V0V2Nuc3NXbGFuQ29tcGlsZWRWZXJzaW9uKHRIYWxIYW5kbGUgaEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyVmVyc2lvblR5cGUgKnBWZXJzaW9uKQoreworICAgIFZPU19TVEFUVVMgc3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVCggaEhhbCApOworICAgIHZfQ09OVEVYVF90IHZvc0NvbnRleHQgPSB2b3NfZ2V0X2dsb2JhbF9jb250ZXh0KFZPU19NT0RVTEVfSURfU01FLCBOVUxMKTsKKworICAgIGlmICggZUhBTF9TVEFUVVNfU1VDQ0VTUyA9PSBzbWVfQWNxdWlyZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKSApCisgICAgeworICAgICAgICBpZiggcFZlcnNpb24gIT0gTlVMTCApCisgICAgICAgIHsKKyAgICAgICAgICAgIHN0YXR1cyA9IFdEQV9HZXRXY25zc1dsYW5Db21waWxlZFZlcnNpb24odm9zQ29udGV4dCwgcFZlcnNpb24pOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0lOVkFMOworICAgICAgICB9CisgICAgICAgIHNtZV9SZWxlYXNlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICAgIH0KKworICAgIHJldHVybiAoc3RhdHVzKTsKK30KKworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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KworICAgIGlmICggZUhBTF9TVEFUVVNfU1VDQ0VTUyA9PSBzbWVfQWNxdWlyZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKSApCisgICAgeworICAgICAgICBpZiggcFZlcnNpb24gIT0gTlVMTCApCisgICAgICAgIHsKKyAgICAgICAgICAgIHN0YXR1cyA9IFdEQV9HZXRXY25zc1dsYW5SZXBvcnRlZFZlcnNpb24odm9zQ29udGV4dCwgcFZlcnNpb24pOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0lOVkFMOworICAgICAgICB9CisgICAgICAgIHNtZV9SZWxlYXNlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICAgIH0KKworICAgIHJldHVybiAoc3RhdHVzKTsKK30KKworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICBcZm4gc21lX0dldFdjbnNzU29mdHdhcmVWZXJzaW9uCisgICAgXGJyaWVmICBUaGlzIEFQSSByZXR1cm5zIHRoZSB2ZXJzaW9uIHN0cmluZyBvZiB0aGUgV0NOU1MgZHJpdmVyCisgICAgXHBhcmFtICBoSGFsIC0gVGhlIGhhbmRsZSByZXR1cm5lZCBieSBtYWNPcGVuLgorICAgIFxwYXJhbSAgcFZlcnNpb24gLSBQb2ludHMgdG8gdGhlIFZlcnNpb24gc3RyaW5nIGJ1ZmZlciB0byBiZSBmaWxsZWQKKyAgICBccGFyYW0gIHZlcnNpb25CdWZmZXJTaXplIC0gVEhlIHNpemUgb2YgdGhlIFZlcnNpb24gc3RyaW5nIGJ1ZmZlcgorICAgIFxyZXR1cm4gVk9TX1NUQVRVUworICAgICAgICAgICAgVk9TX1NUQVRVU19FX0lOVkFMIC0gZmFpbHVyZQorICAgICAgICAgICAgVk9TX1NUQVRVU19TVUNDRVNTICBzdWNjZXNzCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCitWT1NfU1RBVFVTIHNtZV9HZXRXY25zc1NvZnR3YXJlVmVyc2lvbih0SGFsSGFuZGxlIGhIYWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwVmVyc2lvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIHZlcnNpb25CdWZmZXJTaXplKQoreworICAgIFZPU19TVEFUVVMgc3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVCggaEhhbCApOworICAgIHZfQ09OVEVYVF90IHZvc0NvbnRleHQgPSB2b3NfZ2V0X2dsb2JhbF9jb250ZXh0KFZPU19NT0RVTEVfSURfU01FLCBOVUxMKTsKKworICAgIGlmICggZUhBTF9TVEFUVVNfU1VDQ0VTUyA9PSBzbWVfQWNxdWlyZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKSApCisgICAgeworICAgICAgICBpZiggcFZlcnNpb24gIT0gTlVMTCApCisgICAgICAgIHsKKyAgICAgICAgICAgIHN0YXR1cyA9IFdEQV9HZXRXY25zc1NvZnR3YXJlVmVyc2lvbih2b3NDb250ZXh0LCBwVmVyc2lvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJzaW9uQnVmZmVyU2l6ZSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICAgICAgIH0KKyAgICAgICAgc21lX1JlbGVhc2VHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisgICA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PU19TVEFUVVNfU1VDQ0VTUzsKKyAgICB0cEFuaVNpckdsb2JhbCBwTWFjID0gUE1BQ19TVFJVQ1QoIGhIYWwgKTsKKyAgICB2X0NPTlRFWFRfdCB2b3NDb250ZXh0ID0gdm9zX2dldF9nbG9iYWxfY29udGV4dChWT1NfTU9EVUxFX0lEX1NNRSwgTlVMTCk7CisKKyAgICBpZiAoIGVIQUxfU1RBVFVTX1NVQ0NFU1MgPT0gc21lX0FjcXVpcmVHbG9iYWxMb2NrKCAmcE1hYy0+c21lICkgKQorICAgIHsKKyAgICAgICAgaWYoIHBWZXJzaW9uICE9IE5VTEwgKQorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXMgPSBXREFfR2V0V2Nuc3NIYXJkd2FyZVZlcnNpb24odm9zQ29udGV4dCwgcFZlcnNpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmVyc2lvbkJ1ZmZlclNpemUpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0lOVkFMOworICAgICAgICB9CisgICAgICAgIHNtZV9SZWxlYXNlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICAgIH0KKworICAgIHJldHVybiAoc3RhdHVzKTsKK30KKworCisjaWZkZWYgRkVBVFVSRV9XTEFOX1dBUEkKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgIFxmbiBzbWVfUm9hbVNldEJLSURDYWNoZQorICAgIFxicmllZiBUaGUgU01FIEFQSSBleHBvc2VkIHRvIEhERCB0byBhbGxvdyBIREQgdG8gcHJvdmRlIFNNRSB0aGUgQktJRAorICAgIGNhbmRpZGF0ZSBsaXN0LgorICAgIFxwYXJhbSBoSGFsIC0gSGFuZGxlIHRvIHRo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G9mIHRCa2lkQ2FuZGlkYXRlSW5mbywKKyAgICAgICAgICAgbm90IHNpemVvZih0QmtpZENhbmRpZGF0ZUluZm8pICogc29tZXRoaW5nCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCitlSGFsU3RhdHVzIHNtZV9TY2FuR2V0QktJRENhbmRpZGF0ZUxpc3QodEhhbEhhbmRsZSBoSGFsLCB0QU5JX1UzMiBzZXNzaW9uSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEJraWRDYW5kaWRhdGVJbmZvICpwQmtpZExpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBOdW1JdGVtcyApCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVCggaEhhbCApOworCisgICAgc3RhdHVzID0gc21lX0FjcXVpcmVHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisgICAgaWYgKCBIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgICB7CisgICAgICAgIHN0YXR1cyA9IGNzclNjYW5HZXRCS0lEQ2FuZGlkYXRlTGlzdCggcE1hYywgc2Vzc2lvbklkLCBwQmtpZExpc3QsIHBOdW1JdGVtcyApOworICAgICAgICBzbWVfUmVsZWFzZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKTsKKyAgICB9CisKKyAgICByZXR1cm4gKHN0YXR1cyk7Cit9CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX1dBUEkgKi8KKworI2lmZGVmIEZFQVRVUkVfT0VNX0RBVEFfU1VQUE9SVAorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U21lRmFzdFJvYW1UcmlnZ2VyIGZhc3RSb2FtVHJpZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBjaGFubmVsKQoreworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVCggaEhhbCApOworICAgIHRwQ3NyTmVpZ2hib3JSb2FtQ29udHJvbEluZm8gIHBOZWlnaGJvclJvYW1JbmZvID0gJnBNYWMtPnJvYW0ubmVpZ2hib3JSb2FtSW5mbzsKKyAgICBWT1NfU1RBVFVTICB2b3NTdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICAgZUhhbFN0YXR1cyAgc3RhdHVzICAgID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKworICAgIHN0YXR1cyA9IHNtZV9BY3F1aXJlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICAgIGlmICggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgIiVzOiBpbnZva2VkIiwgX19mdW5jX18pOworCisgICAgICAgIGlmIChlU01FX1JPQU1fVFJJR0dFUl9TQ0FOID09IGZhc3RSb2FtVHJpZykKKyAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPRzEsIEZMKCJDRkcgQ2hhbm5lbCBsaXN0IHNjYW4uLi4gIikpOworICAgICAgICAgICAgcE5laWdoYm9yUm9hbUluZm8tPmNmZ1JvYW1FbiA9IGVTTUVfUk9BTV9UUklHR0VSX1NDQU47CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHZvaWQgKikoJnBOZWlnaGJvclJvYW1JbmZvLT5jZmdSb2FtYnNzSWQpLAorICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKWJzc2lkLCBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCAiQ2FsbGluZyBSb2FtIExvb2sgVXAgZG93biBFdmVudCBCU1NJRCIKKyAgICAgICAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIsIE1BQ19BRERSX0FSUkFZKHBOZWlnaGJvclJvYW1JbmZvLT5jZmdSb2FtYnNzSWQpKTsKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiBBcyBGYXN0UmVhc3NvYyBpcyBiYXNlZCBvbiBhc3N1bXB0aW9uIHRoYXQgcm9hbWFibGUgQVAgc2hvdWxkIGJlCisgICAgICAgICAgICAgKiBwcmVzZW50IGludG8gdGhlIG9jY3VwaWVkIGNoYW5uZWwgbGlzdC5XZSBzaGQgIGFkZCBpL3AgY2hhbm5lbAorICAgICAgICAgICAgICogaW4gb2NjdXBpZWQgY2hhbm5lbCBsaXN0IGlmIHJvYW1hYmxlLWFwKEJTU0lEIGluIGZhc3RyZWFzc29jIGNtZCkKKyAgICAgICAgICAgICAqIGFnZWQgb3V0IHByaW9yIHRvIGNvbm5lY3Rpb24gYW5kIHRoZXJlIGlzIG5vIHNjYW4gZnJvbSBhZ2VkIG91dAorICAgICAgICAgICAgICogdG8gdGlsbCBjb25uZWN0aW9uIGluZGljYXRpb24uCisgICAgICAgICAgICAqLworICAgICAgICAgICAgY3NyQWRkQ2hhbm5lbFRvT2NjdXBpZWRDaGFubmVsTGlzdChwTWFjLCBjaGFubmVsKTsKKyAgICAgICAgICAgIHZvc1N0YXR1cyA9IGNzck5laWdoYm9yUm9hbVRyYW5zaXRUb0NGR0NoYW5TY2FuKHBNYWMpOworICAgICAgICAgICAgaWYgKFZPU19TVEFUVVNfU1VDQ0VTUyAhPSB2b3NTdGF0dXMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsCisgICAgICAgICAgICAgICAgICAgICAgIEZMKCJDRkcgQ2hhbm5lbCBsaXN0IHNjYW4gc3RhdGUgZmFpbGVkIHdpdGggc3RhdHVzICVkICIpLAorICAgICAgICAgICAgICAgICAgICAgICB2b3NTdGF0dXMpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGVTTUVfUk9BTV9UUklHR0VSX0ZBU1RfUk9BTSA9PSBmYXN0Um9hbVRyaWcpCisgICAgICAgIHsKKyAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHZvaWQgKikoJnBOZWlnaGJvclJvYW1JbmZvLT5jZmdSb2FtYnNzSWQpLAorICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKWJzc2lkLCBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+Y2ZnUm9hbUVuID0gZVNNRV9ST0FNX1RSSUdHRVJfRkFTVF9ST0FNOworICAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0cxLCAiUm9hbSB0byBCU1NJRCAiTUFDX0FERFJFU1NfU1RSLAorICAgICAgICAgICAgICAgICAgICBNQUNfQUREUl9BUlJBWShwTmVpZ2hib3JSb2FtSW5mby0+Y2ZnUm9hbWJzc0lkKSk7CisKKyAgICAgICAgICAgICB2b3NTdGF0dXMgPSBjc3JOZWlnaGJvclJvYW1SZWFzc29jSW5kQ2FsbGJhY2socE1hYy0+cm9hbS5nVm9zQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCk7CisKKyAgICAgICAgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3N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KKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgIiVzIEludmFsaWQgU2Vzc2lvbmlkIiwgX19mdW5jX18pOworICAgICAgICAgICAgc21lX1JlbGVhc2VHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgfQorCisgICAgICAgIGxlbiA9IHNpemVvZih0U2lyUmVnaXN0ZXJNZ210RnJhbWUpICsgbWF0Y2hMZW47CisgICAgICAgIAorICAgICAgICBwTXNnID0gdm9zX21lbV9tYWxsb2MobGVuKTsKKyAgICAgICAgaWYgKCBOVUxMID09IHBNc2cgKQorICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fc2V0KHBNc2csIGxlbiwgMCk7CisgICAgICAgICAgICBwTXNnLT5tZXNzYWdlVHlwZSAgICAgPSBlV05JX1NNRV9SRUdJU1RFUl9NR01UX0ZSQU1FX1JFUTsKKyAgICAgICAgICAgIHBNc2ctPmxlbmd0aCAgICAgICAgICA9IGxlbjsKKyAgICAgICAgICAgIHBNc2ctPnNlc3Npb25JZCAgICAgICA9IHNlc3Npb25JZDsKKyAgICAgICAgICAgIHBNc2ctPnJlZ2lzdGVyRnJhbWUgICA9IFZPU19UUlVFOworICAgICAgICAgICAgcE1zZy0+ZnJhbWVUeXBlICAgICAgID0gZnJhbWVUeXBlOworICAgICAgICAgICAgcE1zZy0+bWF0Y2hMZW4gICAgICAgID0gbWF0Y2hMZW47CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocE1zZy0+bWF0Y2hEYXRhLCBtYXRjaERhdGEsIG1hdGNoTGVuKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IH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hMZW4pCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVChoSGFsKTsKKworICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9TTUUsCisgICAgICAgICAgICAgIFRSQUNFX0NPREVfU01FX1JYX0hERF9ERVJFR0lTVEVSX01HTVRGUiwgc2Vzc2lvbklkLCAwKSk7CisgICAgaWYgKCBlSEFMX1NUQVRVU19TVUNDRVNTID09ICggc3RhdHVzID0gc21lX0FjcXVpcmVHbG9iYWxMb2NrKCAmcE1hYy0+c21lICkgKSApCisgICAgeworICAgICAgICB0U2lyUmVnaXN0ZXJNZ210RnJhbWUgKnBNc2c7CisgICAgICAgIHRBTklfVTE2IGxlbjsKKyAgICAgICAgdENzclJvYW1TZXNzaW9uICpwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTiggcE1hYywgc2Vzc2lvbklkICk7CisKKyAgICAgICAgaWYoIXBTZXNzaW9uKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiAgc2Vzc2lvbiAlZCBub3QgZm91bmQgIiksIHNlc3Npb25JZCk7CisgICAgICAgICAgICBzbWVfUmVsZWFzZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKTsKKyAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICB9CisKKyAgICAgICAgaWYoICFwU2Vzc2lvbi0+c2Vzc2lvbkFjdGl2ZSApCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgIiVzIEludmFsaWQgU2Vzc2lvbmlkIiwgX19mdW5jX18pOworICAgICAgICAgICAgc21lX1JlbGVhc2VHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgfQorCisgICAgICAgIGxlbiA9IHNpemVvZih0U2lyUmVnaXN0ZXJNZ210RnJhbWUpICsgbWF0Y2hMZW47CisgICAgICAgIAorICAgICAgICBwTXNnID0gdm9zX21lbV9tYWxsb2MobGVuKTsKKyAgICAgICAgaWYgKCBOVUxMID09IHBNc2cgKQorICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fc2V0KHBNc2csIGxlbiwgMCk7CisgICAgICAgICAgICBwTXNnLT5tZXNzYWdlVHlwZSAgICAgPSBlV05JX1NNRV9SRUdJU1RFUl9NR01UX0ZSQU1FX1JFUTsKKyAgICAgICAgICAgIHBNc2ctPmxlbmd0aCAgICAgICAgICA9IGxlbjsKKyAgICAgICAgICAgIHBNc2ctPnJlZ2lzdGVyRnJhbWUgICA9IFZPU19GQUxTRTsKKyAgICAgICAgICAgIHBNc2ctPmZyYW1lVHlwZSAgICAgICA9IGZyYW1lVHlwZTsKKyAgICAgICAgICAgIHBNc2ctPm1hdGNoTGVuICAgICAgICA9IG1hdGNoTGVuOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBNc2ctPm1hdGNoRGF0YSwgbWF0Y2hEYXRhLCBtYXRjaExlbik7CisgICAgICAgICAgICBzdGF0dXMgPSBwYWxTZW5kTUJNZXNzYWdlKHBNYWMtPmhIZGQsIHBNc2cpOworICAgICAgICB9CisgICAgICAgIHNtZV9SZWxlYXNlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfQorCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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19TVUNDRVNTOworICB0cEFuaVNpckdsb2JhbCBwTWFjID0gUE1BQ19TVFJVQ1QoaEhhbCk7CisKKyAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX1NNRSwKKyAgICAgICAgICAgIFRSQUNFX0NPREVfU01FX1JYX0hERF9SRU1BSU5fT05DSEFOLCBzZXNzaW9uSWQsIDApKTsKKyAgaWYgKCBlSEFMX1NUQVRVU19TVUNDRVNTID09ICggc3RhdHVzID0gc21lX0FjcXVpcmVHbG9iYWxMb2NrKCAmcE1hYy0+c21lICkgKSApCisgIHsKKyAgICBzdGF0dXMgPSBwMnBSZW1haW5PbkNoYW5uZWwgKGhIYWwsIHNlc3Npb25JZCwgY2hhbm5lbCwgZHVyYXRpb24sIGNhbGxiYWNrLCBwQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzUDJQUHJvYmVSZXFBbGxvd2VkCisjaWZkZWYgV0xBTl9GRUFUVVJFX1AyUF9JTlRFUk5BTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAsIGVQMlBSZW1haW5PbkNoblJlYXNvblVua25vd24KKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApOworICAgIHNtZV9SZWxlYXNlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICB9CisgIHJldHVybihzdGF0dXMpOworfQorCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICBcZm4gc21lX1JlcG9ydFByb2JlUmVxCisgICAgXGJyaWVmICBBUEkgdG8gZW5hYmxlL2Rpc2FibGUgZm9yd2FyZGluZyBvZiBwcm9iZVJlcSB0byBhcHBzIGluIHAycC4KKyAgICBccGFyYW0gIGhIYWwgLSBUaGUgaGFuZGxlIHJldHVybmVkIGJ5IG1hY09wZW4uCisgICAgXHBh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zX21lbV9mcmVlKHBNYWMtPnAycENvbnRleHQucHJvYmVSc3BJZSk7CisgICAgICAgICAgICBwTWFjLT5wMnBDb250ZXh0LnByb2JlUnNwSWVMZW5ndGggPSAwOworICAgICAgICB9CisKKyAgICAgICAgcE1hYy0+cDJwQ29udGV4dC5wcm9iZVJzcEllID0gdm9zX21lbV9tYWxsb2MocDJwSWVMZW5ndGgpOworICAgICAgICBpZiAoTlVMTCA9PSBwTWFjLT5wMnBDb250ZXh0LnByb2JlUnNwSWUpCisgICAgICAgIHsKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCAiJXM6IFVuYWJsZSB0byBhbGxvY2F0ZSBQMlAgSUUiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICBwTWFjLT5wMnBDb250ZXh0LnByb2JlUnNwSWVMZW5ndGggPSAwOworICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHBNYWMtPnAycENvbnRleHQucHJvYmVSc3BJZUxlbmd0aCA9IHAycEllTGVuZ3RoOworCisgICAgICAgICAgICBzaXJEdW1wQnVmKCBwTWFjLCBTSVJfTElNX01PRFVMRV9JRCwgTE9HMiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnAycENvbnRleHQucHJvYmVSc3BJZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnAycENvbnRleHQucHJvYmVSc3BJZUxlbmd0aCApOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCh0QU5JX1U4ICopcE1hYy0+cDJwQ29udGV4dC5wcm9iZVJzcEllLCBwMnBJZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBwMnBJZUxlbmd0aCk7CisgICAgICAgIH0KKworICAgICAgICAvL3JlbGVhc2UgdGhlIGxvY2sgZm9yIHRoZSBzbWUgb2JqZWN0CisgICAgICAgIHNtZV9SZW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U1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgZmFpbCB0byBzYXZlIHByZWZlcnJlZCBuZXR3b3JrIikpOworICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR0UsIEZMKCIgbm90IGVub3VnaCBkYXRhIGxlbmd0aCAldSBuZWVkZWQgJXp1IiksCisgICAgICAgICAgICAgICBwUHJlZk5ldHdvcmtGb3VuZEluZC0+bWVzZ0xlbiwgc2l6ZW9mKHRTaXJQcmVmTmV0d29ya0ZvdW5kSW5kKSk7CisgICAgICAgICB9CisKKyAgICAgICAgIC8qIENhbGwgUHJlZmVycmVkIE5ldG93cmsgRm91bmQgSW5kaWNhdGlvbiBjYWxsYmFjayByb3V0aW5lLiAqLworICAgICAgICAgaWYgKEhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpICYmIChwTWFjLT5wbWMucHJlZk5ldHdGb3VuZENCICE9IE5VTEwpKQorICAgICAgICAgeworICAgICAgICAgICAgcE1hYy0+cG1jLnByZWZOZXR3Rm91bmRDQigKKyAgICAgICAgICAgICAgICBwTWFjLT5wbWMucHJlZmVycmVkTmV0d29ya0ZvdW5kSW5kQ2FsbGJhY2tDb250ZXh0LAorICAgICAgICAgICAgICAgIHBQcmVmTmV0d29ya0ZvdW5kSW5kKTsKKyAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgIHNtc0xvZyhwTWFjLCBMT0dFLCAiJXM6IGNhbGxiYWNrIGZhaWxlZCAtIFNTSUQgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICB9CisgICB9CisKKworICAgcmV0dXJuKHN0YXR1cyk7Cit9CisKKyNlb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mVzZXQgU3VwcGxpY2FudCBjb3VudHJ5IGNvZGUgY29tbWFuZCBpcyB0cmlnZ2VyZWQsIGVuYWJsZSAxMUQsIHJlc2V0IHRoZSBOViBjb3VudHJ5IGNvZGUgYW5kIHJldHVybiAqLworICAgaWYoIFZPU19UUlVFID09IHZvc19tZW1fY29tcGFyZShwTXNnLT5jb3VudHJ5Q29kZSwgU01FX0lOVkFMSURfQ09VTlRSWV9DT0RFLCAyKSApCisgICB7CisgICAgICAgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5JczExZFN1cHBvcnRFbmFibGVkID0gcE1hYy0+cm9hbS5jb25maWdQYXJhbS5JczExZFN1cHBvcnRFbmFibGVkT3JpZ2luYWw7CisKKyAgICAgICB2b3NTdGF0dXMgPSB2b3NfbnZfcmVhZERlZmF1bHRDb3VudHJ5VGFibGUoICZudlRhYmxlcyApOworCisgICAgICAgLyogcmVhZCB0aGUgY291bnRyeSBjb2RlIGZyb20gTlYgYW5kIHVzZSBpdCAqLworICAgICAgIGlmICggVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykgKQorICAgICAgIHsKKyAgICAgICAgICAgdm9zX21lbV9jb3B5KHBNc2ctPmNvdW50cnlDb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgbnZUYWJsZXMuZGVmYXVsdENvdW50cnlUYWJsZS5jb3VudHJ5Q29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfQ09VTlRSWV9DT0RFX0xFTik7CisgICAgICAgfQorICAgICAgIGVsc2UKKyAgICAgICB7CisgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgICAgfQorICAgICAgIC8qIFVwZGF0ZSB0aGUgMTFkIGNvdW50cnkgdG8gZGVmYXVsdCBjb3VudHJ5IGZyb20gTlYgYmluIHNvIHRoYXQgd2hlbgorICAgICAgICAqIGNhbGxiYWNrIGlzIHJlY2VpdmVkIGZvciB0aGlzIGRlZmF1bHQgY291bnRyeSwgZHJpdmVyIHdpbGwgbm90CisgICAgICAgICogZGlzYWJsZSB0aGUgMTFkIHRha2luZyBpdCBhcyB2YWxpZCBjb3VudHJ5IGJ5IHVzZXIuCisgICAgICAgICovCisgICAgICAgc21zTG9nKHBNYWMsIExPRzEsCisgICAgICAgICBGTCgiU2V0IGRlZmF1bHQgY291bnRyeSBjb2RlICglYyVjKSBmcm9tIE5WIGFzIGludmFsaWQgY291bnRyeSByZWNlaXZlZCIpLAorICAgICAgICAgcE1zZy0+Y291bnRyeUNvZGVbMF0scE1zZy0+Y291bnRyeUNvZGVbMV0pOworICAgICAgIHZvc19tZW1fY29weShwTWFjLT5zY2FuLmNvdW50cnlDb2RlMTFkLCBwTXNnLT5jb3VudHJ5Q29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfQ09VTlRSWV9DT0RFX0xFTik7CisgICB9CisgICBlbHNlCisgICB7CisgICAgICAgLyogaWYgU3VwcGxpY2FudCBjb3VudHJ5IGNvZGUgaGFzIHByaW9yaXR5LCBkaXNhYmxlIDExZCAqLworICAgICAgIGlmKHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uZlN1cHBsaWNhbnRDb3VudHJ5Q29kZUhhc1ByaW9yaXR5ICYmCisgICAgICAgICBwTXNnLT5jb3VudHJ5RnJvbVVzZXJTcGFjZSkKKyAgICAgICB7CisgICAgICAgICAgIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uSXMxMWRTdXBwb3J0RW5hYmxlZCA9IGVBTklfQk9PTEVBTl9GQUxTRTsKKyAgICAgICB9CisgICB9CisKKyAgIC8qIFdFWFQgc2V0IGNvdW50cnkgY29kZSBtZWFucworICAgICogMTFEIHNob3VsZCBiZSBzdXBwb3J0ZWQ/CisgICAgKiAxMUQgQ2hhbm5lbCBzaG91bGQgYmUgZW5mb3JjZWQ/CisgICAgKiAxMUQgQ291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QuIFNvIGdpdmUgMTFEIHByaW9yaXR5ICovCisgICAgICAgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5JczExZFN1cHBvcnRFbmFibGVkID0gcE1hYy0+cm9hbS5jb25maWdQYXJhbS5JczExZFN1cHBvcnRFbmFibGVkT3JpZ2luYWw7CisgICAgICAgc21zTG9nKHBNYWMsIExPR0UsICJTZXQgQ291bnRyeSBDb2RlIEZhaWwgJWQiLCBzdGF0dXMpOworICAgICAgIHJldHVybiBzdGF0dXM7CisgICB9CisKKyAgIC8qIG92ZXJ3cml0ZSB0aGUgZGVmdWFsdCBjb3VudHJ5IGNvZGUgKi8KKyAgIHZvc19tZW1fY29weShwTWFjLT5zY2FuLmNvdW50cnlDb2RlRGVmYXVsdCwKKyAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmNvdW50cnlDb2RlQ3VycmVudCwKKyAgICAgICAgICAgICAgICBXTklfQ0ZHX0NPVU5UUllfQ09ERV9MRU4pOworCisgICAvKiBHZXQgRG9tYWluIElEIGZyb20gY291bnRyeSBjb2RlICovCisgICBzdGF0dXMgPSBjc3JHZXRSZWd1bGF0b3J5RG9tYWluRm9yQ291bnRyeShwTWFjLAorICAgICAgICAgICAgICAgICAgIHBNYWMtPnNjYW4uY291bnRyeUNvZGVDdXJyZW50LAorICAgICAgICAgICAgICAgICAgICh2X1JFR0RPTUFJTl90ICopICZkb21haW5JZElvY3RsLAorICAgICAgICAgICAgICAgICAgIENPVU5UUllfUVVFUlkpOworICAgaWYgKCBzdGF0dXMgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUyApCisgICB7CisgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiICBmYWlsIHRvIGdldCByZWdJZCAlZCIpLCBkb21haW5JZElvY3RsICk7CisgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgIH0KKyAgIGVsc2UgaWYgKFJFR0RPTUFJTl9XT1JMRCA9PSBkb21haW5JZElvY3RsKQorICAgeworICAgICAgIC8q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YywgTE9HMSwgRkwoInBNc2ctPmNvdW50cnlDb2RlIDogJWMlYywiCisgICAgICAgICAgICAgICAgInBNYWMtPnNjYW4uY291bnRyeUNvZGUxMWQgOiAlYyVjXG4iKSwKKyAgICAgICAgICAgICAgICBwTXNnLT5jb3VudHJ5Q29kZVswXSwgcE1zZy0+Y291bnRyeUNvZGVbMV0sCisgICAgICAgICAgICAgICAgcE1hYy0+c2Nhbi5jb3VudHJ5Q29kZTExZFswXSwgcE1hYy0+c2Nhbi5jb3VudHJ5Q29kZTExZFsxXSk7CisgICAgLyogU2V0IHRoZSBjb3VudHJ5IGNvZGUgZ2l2ZW4gYnkgdXNlcnNwYWNlIHdoZW4gMTFkT3JpZ2luYWwgaXMgRkFMU0UKKyAgICAgKiB3aGVuIDExZG9yaWdpbmFsIGlzIFRydWUsaXMxMWRDb3VudHJ5ID0wIGFuZAorICAgICAqIGZTdXBwbGljYW50Q291bnRyeUNvZGVIYXNQcmlvcml0eSA9IDAsIHRoZW4gcmV2ZXJ0IHRoZSBjb3VudHJ5IGNvZGUsCisgICAgICogYW5kIHJldHVybiBmYWlsdXJlCisgICAgICovCisgICAgaWYgKHBNYWMtPnJvYW0uY29uZmlnUGFyYW0uSXMxMWRTdXBwb3J0RW5hYmxlZE9yaWdpbmFsID09IHRydWUpCisgICAgeworICAgICAgICBpZiAoKCFpczExZENvdW50cnkpICYmICghcE1hYy0+cm9hbS5jb25maWdQYXJhbS5mU3VwcGxpY2FudENvdW50cnlDb2RlSGFzUHJpb3JpdHkpJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICghcE1hYy0+cm9hbS5jb25maWdQYXJhbS5mRW5mb3JjZUNvdW50cnlDb2RlKSApCisgICAgICAgIHsKKworICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dXLCBGTCgiIGluY29ycmVjdCBjb3VudHJ5IGJlaW5nIHNldCwgbnVsbGlmeSB0aGlzIHJlcXVlc3QiKSk7CisKKyAgICAgICAgICAgIHN0YXR1cyA9IGNzckdldFJlZ3VsYXRvcnlEb21haW5Gb3JDb3VudHJ5KHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnNjYW4uY291bnRyeUNvZGUxMWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2X1JFR0RPTUFJTl90ICopICZyZWdfZG9tYWluX2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDT1VOVFJZX0lFKTsKKworICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgIH0KKyAgICB9CisgICAgLyogaWYgU3VwcGxpY2FudCBjb3VudHJ5IGNvZGUgaGFzIHByaW9yaXR5LCBkaXNhYmxlIDExZCAqLworICAgIGlmICgoIWlzMTFkQ291bnRyeSkgJiYKKyAgICAgICAgIChwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLmZTdXBwbGljYW50Q291bnRyeUNvZGVIYXNQcmlvcml0eSkgJiYKKyAgICAgICAgKCFwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLmZFbmZvcmNlQ291bnRyeUNvZGUpKQorICAgIHsKKyAgICAgICAgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5JczExZFN1cHBvcnRFbmFibGVkID0gZUFOSV9CT09MRUFOX0ZBTFNFOworICAgICAgICBzbXNMb2coIHBNYWMsIExPRzEsIEZMKCIgMTFkIGlzIGJlaW5nICBkaXNhYmxlZCIpKTsKKyAgICB9CisKKyAgICBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLmZFbmZvcmNlQ291bnRyeUNvZGUgPSBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgdm9zX21lbV9jb3B5KHBNYWMtPnNjYW4uY291bnRyeUNvZGVDdXJyZW50LCBwTXNnLT5jb3VudHJ5Q29kZSwKKyAgICAgICAgICAgICAgICAgIFdOSV9DRkdfQ09VTlRSWV9DT0RFX0xFTik7CisgICAgdm9zX21lbV9jb3B5KHBNYWMtPnNjYW4uY291bnRyeUNvZGUxMWQsIHBNc2ctPmNvdW50cnlDb2RlLAorICAgICAgICAgICAgICAgICAgV05JX0NGR19DT1VOVFJZX0NPREVfTEVOKTsKKworCisgICAgc3RhdHVzID0gY3NyU2V0UmVndWxhdG9yeURvbWFpbihwTWFjLCByZWdfZG9tYWluX2lkLCBOVUxMKTsKKyAgICBpZiAoc3RhdHVzICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MpCisgICAgeworICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCJmYWlsIHRvIHNldCByZWdJZC5zdGF0dXMgOiAlZCIpLCBzdGF0dXMpOworICAgIH0KKyAgICBzdGF0dXMgPSBXREFfU2V0UmVnRG9tYWluKHBNYWMsIHJlZ19kb21haW5faWQsIGVTSVJfVFJVRSk7CisKKyAgICBpZiAoVk9TX0ZBTFNFID09IGlzMTFkQ291bnRyeSApCisgICAgeworICAgICAgICAvKiBvdmVyd3JpdGUgdGhlIGRlZnVhbHQgY291bnRyeSBjb2RlICovCisgICAgICAgIHZvc19tZW1fY29weShwTWFjLT5zY2FuLmNvdW50cnlDb2RlRGVmYXVsdCwKKyAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5zY2FuLmNvdW50cnlDb2RlQ3VycmVudCwgV05JX0NGR19DT1VOVFJZX0NPREVfTEVOKTsKKyAgICAgICAgLyogc2V0IHRvIGRlZmF1bHQgZG9tYWluIElEICovCisgICAgICAgIHBNYWMtPnNjYW4uZG9tYWluSWREZWZhdWx0ID0gcE1hYy0+c2Nhbi5kb21haW5JZEN1cnJlbnQ7CisgICAgfQorCisgICAgaWYgKCBzdGF0dXMgIT0gZUhBTF9TVEFUVVNfU1VDQ0VTUyApCisgICAgeworICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCIgIGZhaWwgdG8gc2V0IHJlZ0lkICVkIiksIHJlZ19kb21haW5faWQgKTsKKyAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgLy9pZiAxMWQgaGFzIHByaW9yaXR5LCBjbGVhciBjdXJyZW50Q291bnRyeUJzc2lkICYgY291bnRyeUNvZGUxMWQgdG8gZ2V0CisgICAgICAgIC8vc2V0IGFnYWluIGlmIHdlIGZpbmQgQVAgd2l0aCAxMWQgaW5mbyBkdXJpbmcgc2NhbgorICAgICAgICBpZigoIXBNYWMtPnJvYW0uY29uZmlnUGFyYW0uZlN1cHBsaWNhbnRDb3VudHJ5Q29kZUhhc1ByaW9yaXR5KSAmJgorICAgICAgICAgICAoVk9TX0ZBTFNFID09IGlzMTFkQ291bnRyeSApKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR1csIEZMKCJDbGVhcmluZyBjdXJyZW50Q291bnRyeUJzc2lkLCBjb3VudHJ5Q29kZTExZCIpKTsKKyAgICAgICAgICAgIHZvc19tZW1femVybygmcE1hYy0+c2Nhbi5jdXJyZW50Q291bnRyeUJzc2lkLCBzaXplb2YodENzckJzc2lkKSk7CisgICAgICAgICAgICB2b3NfbWVtX3plcm8oIHBNYWMtPnNjYW4uY291bnRyeUNvZGUxMWQsIHNpemVvZiggcE1hYy0+c2Nhbi5jb3VudHJ5Q29kZTExZCApICk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKiBnZXQgdGhlIGNoYW5uZWxzIGJhc2VkIG9uIG5ldyBjYyAqLworICAgIHN0YXR1cyA9IGNzckluaXRHZXRDaGFubmVscyhwTWFjKTsKKworICAgIGlmICggc3RhdHVzICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MgKQorICAgIHsKKyAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiICBmYWlsIHRvIGdldCBDaGFubmVscyAiKSk7CisgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgfQorCisgICAgLyogcmV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cE1zZy0+Y291bnRyeUNvZGVbMF0pICYmICgnMCcgPT0gcE1zZy0+Y291bnRyeUNvZGVbMV0pKQorICAgIHsKKyAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dXLCBGTCgiU2V0dGluZyBjb3VudHJ5Q29kZTExZCAmIGNvdW50cnlDb2RlQ3VycmVudCB0byB3b3JsZCBDQyIpKTsKKyAgICAgICAgdm9zX21lbV9jb3B5KHBNYWMtPnNjYW4uY291bnRyeUNvZGUxMWQsIHBNc2ctPmNvdW50cnlDb2RlLAorICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfQ09VTlRSWV9DT0RFX0xFTik7CisgICAgICAgIHZvc19tZW1fY29weShwTWFjLT5zY2FuLmNvdW50cnlDb2RlQ3VycmVudCwgcE1zZy0+Y291bnRyeUNvZGUsCisgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19DT1VOVFJZX0NPREVfTEVOKTsKKyAgICB9CisKKyAgICBzdGF0dXMgPSBXREFfU2V0UmVnRG9tYWluKHBNYWMsIFJFR0RPTUFJTl9XT1JMRCwgZVNJUl9UUlVFKTsKKworICAgIGlmICggc3RhdHVzICE9IGVIQUxfU1RBVFVTX1NVQ0NFU1MgKQorICAgIHsKKyAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiICBmYWlsIHRvIHNldCByZWdJZCIpICk7CisgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHN0YXR1cyA9IGNzclNldFJlZ3VsYXRvcnlEb21haW4ocE1hYywgUkVHRE9NQUlOX1dPUkxELCBOVUxMKTsKKyAgICAgICAgaWYgKHN0YXR1cyAhPSBlSEFMX1NUQVRVU19TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCJmYWlsIHRvIHNldCByZWdJZC5zdGF0dXMgOiAlZCIpLCBzdGF0dXMpOworICAgICAgICB9CisgICAgICA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xzLm51bUNoYW5uZWxzOyBpKyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHBNYWMtPnNjYW4uYmFzZTIwTUh6Q2hhbm5lbHMuY2hhbm5lbExpc3RbaV0gPT0gY3VyckNoYW5uZWwpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpc0NoYW5Gb3VuZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKCFpc0NoYW5Gb3VuZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBmb3IgKGk9MDsgaSA8IHBNYWMtPnNjYW4uYmFzZTQwTUh6Q2hhbm5lbHMubnVtQ2hhbm5lbHM7IGkrKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChwTWFjLT5zY2FuLmJhc2U0ME1IekNoYW5uZWxzLmNoYW5uZWxMaXN0W2ldID09IGN1cnJDaGFubmVsKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpc0NoYW5Gb3VuZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghaXNDaGFuRm91bmQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc21zTG9nKHBNYWMsIExPR1csICIlcyA6IERpc2Nvbm5lY3QgU2Vzc2lvbiA6JWQiLCBfX2Z1bmNfXywgc2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICBjc3JSb2FtRGlzY29ubmVjdChwTWFjLCBzZXNzaW9uSWQsIGVDU1JfRElTQ09OTkVDVF9SRUFTT05fVU5TUEVDSUZJRUQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorfQorLyogL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LCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIiVzOiAiCisgICAgICAgICAgICAgICAidWxNdWx0aWNhc3RBZGRyQ250PSVkLCBtdWx0aWNhc3RBZGRyWzBdPSVwIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICBwTXVsdGljYXN0QWRkcnMtPnVsTXVsdGljYXN0QWRkckNudCwKKyAgICAgICAgICAgICAgIHBNdWx0aWNhc3RBZGRycy0+bXVsdGljYXN0QWRkclswXSk7CisKKyAgICAvKgorICAgICAqRmluZCB0aGUgY29ubmVjdGVkIEluZnJhIC8gUDJQX2NsaWVudCBjb25uZWN0ZWQgc2Vzc2lvbgorICAgICovCisgICAgaWYgKENTUl9JU19TRVNTSU9OX1ZBTElEKHBNYWMsIHNlc3Npb25JZCkgJiYKKyAgICAgICAgY3NySXNDb25uU3RhdGVJbmZyYShwTWFjLCBzZXNzaW9uSWQpKQorICAgIHsKKyAgICAgICAgcFNlc3Npb24gPSBDU1JfR0VUX1NFU1NJT04oIHBNYWMsIHNlc3Npb25JZCApOworICAgIH0KKworICAgIGlmKHBTZXNzaW9uID09IE5VTEwgKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogVW5hYmxlIHRvIGZpbmQgIgorICAgICAgICAgICAgInRoZSByaWdodCBzZXNzaW9uIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICB9CisKKyAgICBwUmVxdWVzdEJ1ZiA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0U2lyUmN2Rmx0TWNBZGRyTGlzdCkpOworICAgIGlmIChOVUxMID09IHBSZXF1ZXN0QnVmKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogTm90IGFibGUgdG8gIgorICAgICA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ICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIH0KKworICAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworfQorCitlSGFsU3RhdHVzIHNtZV9HZXRGaWx0ZXJNYXRjaENvdW50KHRIYWxIYW5kbGUgaEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsdGVyTWF0Y2hDb3VudENhbGxiYWNrIGNhbGxiYWNrUm91dGluZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqY2FsbGJhY2tDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IHNlc3Npb25JZCkKK3sKKyAgICB0cEFuaVNpckdsb2JhbCBwTWFjID0gUE1BQ19TVFJVQ1QoIGhIYWwgKTsKKyAgICBlSGFsU3RhdHVzIHN0YXR1czsKKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiKyVzIiwgX19mdW5jX18pOworCisgICAgaWYgKCBlSEFMX1NUQVRVU19TVUNDRVNTID09ICggc3RhdHVzID0gc21lX0FjcXVpcmVHbG9iYWxMb2NrKCAmcE1hYy0+c21lKSkpCisgICAgeworICAgICAgICBwbWNHZXRGaWx0ZXJNYXRjaENvdW50KGhIYWwsIGNhbGxiYWNrUm91dGluZSwgY2FsbGJhY2tDb250ZXh0LCBzZXNzaW9uSWQpOworICAgICAgICBzbWVfUmVsZWFzZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKTsKKyAgICB9CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIi0lcyIsIF9fZnVuY19fKTsKKworICAgIHJldHVybiAoc3RhdHVzKTsKK30KKworZUhhbFN0YXR1cyBzbWVfUmVjZWl2ZUZpbHRlckNsZWFyRmlsdGVyKHRI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xMb2NrKCAmcE1hYy0+c21lICk7CisgICBpZiAoIEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgeworICAgICAgKnBCYW5kID0gY3NyR2V0Q3VycmVudEJhbmQoIGhIYWwgKTsKKyAgICAgIHNtZV9SZWxlYXNlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICAgfQorICAgcmV0dXJuIHN0YXR1czsKK30KKworI2lmZGVmIFdMQU5fV0FLRVVQX0VWRU5UUworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICBcZm4gc21lX1dha2VSZWFzb25JbmRDYWxsYmFjaworCisgIFxicmllZgorICBhIGNhbGxiYWNrIGZ1bmN0aW9uIGNhbGxlZCB3aGVuIFNNRSByZWNlaXZlZCBlV05JX1NNRV9XQUtFX1JFQVNPTl9JTkQgZXZlbnQgZnJvbSBXREEKKworICBccGFyYW0gaEhhbCAtIEhBTCBoYW5kbGUgZm9yIGRldmljZQorICBccGFyYW0gcE1zZyAtIE1lc3NhZ2UgYm9keSBwYXNzZWQgZnJvbSBXREE7IGluY2x1ZGVzIFdha2UgUmVhc29uIEluZGljYXRpb24gcGFyYW1ldGVyCisKKyAgXHJldHVybiBlSGFsU3RhdHVzCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitlSGFsU3RhdHVzIHNtZV9XYWtlUmVhc29uSW5kQ2FsbGJhY2sgKHRIYWxIYW5kbGUgaEhhbCwgdm9pZCogcE1zZykKK3sKKyAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVChoSGFsKTsKKyAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgIHRTaXJXYWtlUmVhc29uSW5kICpwV2FrZVJlYXNvbkluZCA9ICh0U2lyV2FrZVJlYXNvbkluZCAqKXBNc2c7CisKKyAgIGlmIChOVUxMID09IHBNc2cpCisgICB7CisgICAgICBzbXNMb2cocE1hYywgTE9HRSwgImluICVzIG1zZyBwdHIgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICB9CisgICBlbHNlCisgICB7CisgICAgICBzbXNMb2cocE1hYywgTE9HMiwgIlNNRTogZW50ZXJpbmcgc21lX1dha2VSZWFzb25JbmRDYWxsYmFjayIpOworCisgICAgICAvKiBDYWxsIFdha2UgUmVhc29uIEluZGljYXRpb24gY2FsbGJhY2sgcm91dGluZS4gKi8KKyAgICAgIGlmIChwTWFjLT5wbWMud2FrZVJlYXNvbkluZENCICE9IE5VTEwpCisgICAgICAgICAgcE1hYy0+cG1jLndha2VSZWFzb25JbmRDQihwTWFjLT5wbWMud2FrZVJlYXNvbkluZENCQ29udGV4dCwgcFdha2VSZWFzb25JbmQpOworCisgICAgICBzbXNMb2cocE1hYywgTE9HMSwgIldha2UgUmVhc29uIEluZGljYXRpb24gaW4gJXMoKSwgcmVhc29uPSVkIiwgX19mdW5jX18sIHBXYWtlUmVhc29uSW5kLT51bFJlYXNvbik7CisgICB9CisKKyAgIHJldHVybihzdGF0dXMpOworfQorI2VuZGlmIC8vIFdMQU5fV0FLRVVQX0VWRU5UUworCisKKy8qKgorICogc21lX1NldE1heFR4UG93ZXIoKSAtIFNldCB0aGUgTWF4aW11bSBUcmFuc21pdCBQb3dlcgorICoKKyAqIEBoSGFsOiBoYWwgcG9pbnRlci4KKyAqIEBic3NpZDogYnNzaWQgdG8gc2V0IHRoZSBwb3dlciBjYXAgZm9yCisgKiBAc2VsZl9tYWNfYWRkcjpzZWxmIG1hYyBhZGRyZXNzCisgKiBAZGI6IHBvd2VyIHRvIHNldCBpbiBkQgorICoKKyAqIFNldCB0aGUgbWF4aW11bSB0cmFuc21pdCBwb3dlciBkeW5hbWljYWxseS4KKyAqCisgKiBSZXR1cm46IGVIYWxTdGF0dXMKKyAqCisgKi8KK2VIYWxTdGF0dXMgc21lX1NldE1heFR4UG93ZXIodEhhbEhhbmRsZSBoSGFsLCB0U2lyTWFjQWRkciBic3NpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY0FkZHIgc2VsZl9tYWNfYWRkciwgdl9TN190IGRiKQoreworICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9IFBNQUNfU1RSVUNUKGhIYWwpOworICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgdFNtZUNtZCAqc2V0X21heF90eF9wd3I7CisKKyAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9TTUUsCisgICAgICAgVFJBQ0VfQ09ERV9TTUVfUlhfSEREX1NFVF9NQVhUWFBPVywgTk9fU0VTU0lPTiwgMCkpOworICAgc21zTG9nKHBNYWMsIExPRzEsCisgICAgIEZMKCJic3NpZCA6IiBNQUNfQUREUkVTU19TVFIgIiBzZWxmIGFkZHI6ICJNQUNfQUREUkVTU19TVFIiIHBvd2VyICVkIERiIiksCisgICAgIE1BQ19BRERSX0FSUkFZKGJzc2lkKSwgTUFDX0FERFJfQVJSQVkoc2VsZl9tYWNfYWRkciksIGRiKTsKKworICAgIHN0YXR1cyA9IHNtZV9BY3F1aXJlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICAgIGlmICggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgeworICAgICAgIHNldF9tYXhfdHhfcHdyID0gY3NyR2V0Q29tbWFuZEJ1ZmZlcihwTWFjKTsKKyAgICAgICBpZiAoc2V0X21heF90eF9wd3IpCisgICAgICAgeworICAgICAgICAgICBzZXRfbWF4X3R4X3B3ci0+Y29tbWFuZCA9IGVTbWVDb21tYW5kU2V0TWF4VHhQb3dlcjsKKyAgICAgICAgICAgdm9zX21lbV9jb3B5KHNldF9tYXhfdHhfcHdyLT51LnNldF90eF9tYXhfcHdyLmJzc2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJzc2lkLCBTSVJfTUFDX0FERFJfTEVOR1RIKTsKKyAgICAgICAgICAgdm9zX21lbV9jb3B5KHNldF9tYXhfdHhfcHdyLT51LnNldF90eF9tYXhfcHdyLnNlbGZfc3RhX21hY19hZGRyLAorICAgICAgICAgICAgICAgICBzZWxmX21hY19hZGRyLCBTSVJfTUFDX0FERFJfTEVOR1RIKTsKKyAgICAgICAgICAgc2V0X21heF90eF9wd3ItPnUuc2V0X3R4X21heF9wd3IucG93ZXIgPSBkYjsKKyAgICAgICAgICAgc3RhdHVzID0gY3NyUXVldWVTbWVDb21tYW5kKHBNYWMsIHNldF9tYXhfdHhfcHdyLCBlQU5JX0JPT0xFQU5fVFJVRSk7CisgICAgICAgICAgIGlmICggIUhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCJmYWlsIHRvIHNlbmQgbXNnIHN0YXR1cyA9ICVkIiksIHN0YXR1cyApOworICAgICAgICAgICAgICAgY3NyUmVsZWFzZUNvbW1hbmRTY2FuKHBNYWMsIHNldF9tYXhfdHhfcHdyKTsKKyAgICAgICAgICAgfQorICAgICAgIH0KKyAgICAgICBlbHNlCisgICAgICAgeworICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoImNhbiBub3Qgb2J0YWluIGEgY29tbW9uIGJ1ZmZlciIpKTsKKyAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfUkVTT1VSQ0VTOworICAgICAgIH0KKyAgICAgICBzbWVfUmVsZWFzZUdsb2JhbExvY2soICZwTWFjLT5zbWUpOworICAgfQorICAgcmV0dXJuIChzdGF0dXMpOworfQorCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0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XJhbXMgcE1zZzsKKyAgICAgICAgdENzclJvYW1TZXNzaW9uICpwU2Vzc2lvbiA9IENTUl9HRVRfU0VTU0lPTiggcE1hYywgc2Vzc2lvbklkICk7CisKKyAgICAgICAgaWYoIXBTZXNzaW9uKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgRkwoIiAgc2Vzc2lvbiAlZCBub3QgZm91bmQgIiksIHNlc3Npb25JZCk7CisgICAgICAgICAgICBzbWVfUmVsZWFzZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKTsKKyAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICB9CisKKyAgICAgICAgaWYoICFwU2Vzc2lvbi0+c2Vzc2lvbkFjdGl2ZSApCisgICAgICAgICAgICBWT1NfQVNTRVJUKDApOworCisgICAgICAgIC8qIENyZWF0ZSB0aGUgbWVzc2FnZSBhbmQgc2VuZCB0byBsaW0gKi8KKyAgICAgICAgbGVuID0gc2l6ZW9mKHRTaXJVcGRhdGVQYXJhbXMpOyAKKyAgICAgICAgcE1zZyA9IHZvc19tZW1fbWFsbG9jKGxlbik7CisgICAgICAgIGlmICggTlVMTCA9PSBwTXNnICkKKyAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX3NldChwTXNnLCBzaXplb2YodFNpclVwZGF0ZVBhcmFtcyksIDApOworICAgICAgICAgICAgcE1zZy0+bWVzc2FnZVR5cGUgICAgID0gZVdOSV9TTUVfSElERV9TU0lEX1JFUTsKKyAgICAgICAgICAgIHBNc2ctPmxlbmd0aCAgICAgICAgICA9IGxlbjsKKyAgICAgICAgICAgIC8qIERhdGEgc3RhcnRzIGZyb20gaGVyZSAqLworICAgICAgICAgICAgcE1zZy0+c2Vzc2lvbklkICAgICAgID0gc2Vzc2lvbklkOworICAgICAgICAgICAgcE1z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W5pU2lyR2xvYmFsICAgICAgcE1hYyAgICAgID0gUE1BQ19TVFJVQ1QoaEhhbCk7CisgICAgdm9zX21zZ190ICAgICAgICAgICB2b3NNZXNzYWdlOworICAgIHRBbmlTZXRUbUxldmVsUmVxICAqc2V0VG1MZXZlbFJlcSA9IE5VTEw7CisKKyAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfU01FLAorICAgICAgICAgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfU01FX1JYX0hERF9TRVRfVE1MRVZFTCwgTk9fU0VTU0lPTiwgMCkpOworICAgIGlmICggZUhBTF9TVEFUVVNfU1VDQ0VTUyA9PSAoIHN0YXR1cyA9IHNtZV9BY3F1aXJlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApICkgKQorICAgIHsKKyAgICAgICAgc2V0VG1MZXZlbFJlcSA9ICh0QW5pU2V0VG1MZXZlbFJlcSAqKXZvc19tZW1fbWFsbG9jKHNpemVvZih0QW5pU2V0VG1MZXZlbFJlcSkpOworICAgICAgICBpZiAoTlVMTCA9PSBzZXRUbUxldmVsUmVxKQorICAgICAgICB7CisgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgIiVzOiBOb3QgYWJsZSB0byBhbGxvY2F0ZSBtZW1vcnkgZm9yIHNtZV9TZXRUbUxldmVsIiwgX19mdW5jX18pOworICAgICAgICAgICBzbWVfUmVsZWFzZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKTsKKyAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgIH0KKworICAgICAgICBzZXRUbUxldmVsUmVxLT50bU1vZGUgICAgID0gdG1Nb2RlOworICAgICAgICBzZXRUbUxldmVsUmVxLT5uZXdUbUxldmVsID0gbmV3VE1MZXZlbDsKKworICAgICAgICAvKiBzZXJpYWxpem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VUNUKCBoSGFsICk7CisgICAgZUhhbFN0YXR1cyAgICAgc3RhdHVzICA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisKKyAgICBzdGF0dXMgPSBzbWVfQWNxdWlyZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKTsKKyAgICBpZiAoIEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgc3RhdHVzID0gY3NyTmVpZ2hib3JSb2FtU2V0TG9va3VwUnNzaVRocmVzaG9sZChwTWFjLCBuZWlnaGJvckxvb2t1cFJzc2lUaHJlc2hvbGQpOworICAgICAgICBpZiAoSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0RFQlVHLAorICAgICAgICAgICAgICAgICAgICAgICAgICJMRlIgcnVudGltZSBzdWNjZXNzZnVsbHkgc2V0IExvb2t1cCB0aHJlc2hvbGQgdG8gJWQiCisgICAgICAgICAgICAgICAgICAgICAgICAgIiAtIG9sZCB2YWx1ZSBpcyAlZCAtIHJvYW0gc3RhdGUgaXMgJXMiLAorICAgICAgICAgICAgICAgICAgICAgICAgIG5laWdoYm9yTG9va3VwUnNzaVRocmVzaG9sZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLm5laWdoYm9yUm9hbUNvbmZpZy5uTmVpZ2hib3JMb29rdXBSc3NpVGhyZXNob2xkLAorICAgICAgICAgICAgICAgICAgICAgICAgIG1hY1RyYWNlR2V0TmVpZ2hib3VyUm9hbVN0YXRlKAorICAgICAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0ubmVpZ2hib3JSb2FtSW5mby5uZWlnaGJvclJvYW1TdGF0ZSkpOworICAgICAgICAgICAgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uZWlna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TdGF0dXMgICAgICAgICAgc3RhdHVzICAgID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKworICAgIHN0YXR1cyA9IHNtZV9BY3F1aXJlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICAgIGlmICggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9ERUJVRywKKyAgICAgICAgICAgICAgICAgICAgICJMRlIgcnVudGltZSBzdWNjZXNzZnVsbHkgc2V0IFJlYXNzb2MgdGhyZXNob2xkIHRvICVkIgorICAgICAgICAgICAgICAgICAgICAgIi0gb2xkIHZhbHVlIGlzICVkIC0gcm9hbSBzdGF0ZSBpcyAlcyIsCisgICAgICAgICAgICAgICAgICAgICBuZWlnaGJvclJlYXNzb2NSc3NpVGhyZXNob2xkLAorICAgICAgICAgICAgICAgICAgICAgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uZWlnaGJvclJvYW1Db25maWcubk5laWdoYm9yUmVhc3NvY1Jzc2lUaHJlc2hvbGQsCisgICAgICAgICAgICAgICAgICAgICBtYWNUcmFjZUdldE5laWdoYm91clJvYW1TdGF0ZSgKKyAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0ubmVpZ2hib3JSb2FtSW5mby5uZWlnaGJvclJvYW1TdGF0ZSkpOworICAgICAgICBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLm5laWdoYm9yUm9hbUNvbmZpZy5uTmVpZ2hib3JSZWFzc29jUnNzaVRocmVzaG9sZCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5laWdoYm9yUmVhc3NvY1Jzc2lUaHJlc2hvbGQ7CisgICAgICAgIHBNYWMtPnJvYW0ubmVpZ2hib3JSb2FtSW5mby5jZmdQYXJhbXMubmVpZ2hib3JSZWFzc29jVGhyZXNob2xkID0KKyAgICAgICA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fREVCVUcsCisgICAgICAgICAgICAgICAgICAgICAiTEZSIHJ1bnRpbWUgc3VjY2Vzc2Z1bGx5IHNldCByb2FtIHNjYW4gcmVmcmVzaCBwZXJpb2QgdG8gJWQiCisgICAgICAgICAgICAgICAgICAgICAiIC0gb2xkIHZhbHVlIGlzICVkIC0gcm9hbSBzdGF0ZSBpcyAlcyIsCisgICAgICAgICAgICAgICAgICAgICBuZWlnaGJvclNjYW5SZXN1bHRzUmVmcmVzaFBlcmlvZCwKKyAgICAgICAgICAgICAgICAgICAgIHBNYWMtPnJvYW0uY29uZmlnUGFyYW0ubmVpZ2hib3JSb2FtQ29uZmlnLm5OZWlnaGJvclJlc3VsdHNSZWZyZXNoUGVyaW9kLAorICAgICAgICAgICAgICAgICAgICAgbWFjVHJhY2VHZXROZWlnaGJvdXJSb2FtU3RhdGUoCisgICAgICAgICAgICAgICAgICAgICBwTWFjLT5yb2FtLm5laWdoYm9yUm9hbUluZm8ubmVpZ2hib3JSb2FtU3RhdGUpKTsKKyAgICAgICAgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5uZWlnaGJvclJvYW1Db25maWcubk5laWdoYm9yUmVzdWx0c1JlZnJlc2hQZXJpb2QgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5laWdoYm9yU2NhblJlc3VsdHNSZWZyZXNoUGVyaW9kOworICAgICAgICBwTWFjLT5yb2FtLm5laWdoYm9yUm9hbUluZm8uY2ZnUGFyYW1zLm5laWdoYm9yUmVzdWx0c1JlZnJlc2hQZXJpb2QgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5laWdoYm9yU2NhblJlc3VsdHNSZWZyZXNoUGVyaW9kOworCisgICAgICAgIHNtZV9SZWxlYXNlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICAgIH0KKworI2lmZGVmIFdMQU5fRkVBVFVSRV9ST0FNX1NDQU5fT0ZGTE9BRAorICAgIGlmIChwTWFjLT5yb2FtLmNvbmZpZ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2hib3JSb2FtSW5mbzsKKyAgICB0QU5JX1U4IG9sZENoYW5uZWxMaXN0W1dOSV9DRkdfVkFMSURfQ0hBTk5FTF9MSVNUX0xFTioyXSA9IHswfTsKKyAgICB0QU5JX1U4IG5ld0NoYW5uZWxMaXN0W1dOSV9DRkdfVkFMSURfQ0hBTk5FTF9MSVNUX0xFTioyXSA9IHswfTsKKyAgICB0QU5JX1U4IGkgPSAwLCBqID0gMDsKKworICAgIHN0YXR1cyA9IHNtZV9BY3F1aXJlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICAgIGlmICggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgeworICAgICAgICBpZiAoTlVMTCAhPSBwTmVpZ2hib3JSb2FtSW5mby0+Y2ZnUGFyYW1zLmNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0KQorICAgICAgICB7CisgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcE5laWdoYm9yUm9hbUluZm8tPmNmZ1BhcmFtcy5jaGFubmVsSW5mby5udW1PZkNoYW5uZWxzOyBpKyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChqIDwgc2l6ZW9mKG9sZENoYW5uZWxMaXN0KSkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBqICs9IHNucHJpbnRmKG9sZENoYW5uZWxMaXN0ICsgaiwgc2l6ZW9mKG9sZENoYW5uZWxMaXN0KSAtIGosIiAlZCIsCisgICAgICAgICAgICAgICAgIHBOZWlnaGJvclJvYW1JbmZvLT5jZmdQYXJhbXMuY2hhbm5lbEluZm8uQ2hhbm5lbExpc3RbaV0pOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGNzckZsdXNoQ2ZnQmdTY2FuUm9hbUNoYW5uZWxMaXN0KHBNYWMpOworICAgICAgICBjc3JDcmVhdGVCZ1NjYW5Sb2FtQ2hhbm5lbExpc3QocE1hYywgcENoYW5uZWxMaXN0LCBudW1DaGFubmVscyk7CisgICAgICAgIHNtZV9TZXRSb2FtU2NhbkNvbnRyb2woaEhhbCwgMSk7CisgICAgICAgIGlmIChOVUxMICE9IHBOZWlnaGJvclJvYW1JbmZvLT5jZmdQYXJhbXMuY2hhbm5lbEluZm8uQ2hhbm5lbExpc3QpCisgICAgICAgIHsKKyAgICAgICAgICAgIGogPSAwOworICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHBOZWlnaGJvclJvYW1JbmZvLT5jZmdQYXJhbXMuY2hhbm5lbEluZm8ubnVtT2ZDaGFubmVsczsgaSsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoaiA8IHNpemVvZihvbGRDaGFubmVsTGlzdCkpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgaiArPSBzbnByaW50ZihuZXdDaGFubmVsTGlzdCArIGosIHNpemVvZihuZXdDaGFubmVsTGlzdCkgLSBqLCIgJWQiLAorICAgICAgICAgICAgICAgICBwTmVpZ2hib3JSb2FtSW5mby0+Y2ZnUGFyYW1zLmNoYW5uZWxJbmZvLkNoYW5uZWxMaXN0W2ldKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0RFQlVHLAorICAgICAgICAgICAgICAgICAgICAgIkxGUiBydW50aW1lIHN1Y2Nlc3NmdWxseSBzZXQgcm9hbSBzY2FuIGNoYW5uZWxzIHRvICVzIgorICAgICAgICAgICAgICAgICAgICAgIi0gb2xkIHZhbHVlIGlzICVzI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NrKCAmcE1hYy0+c21lICk7CisgICAgaWYgKCBIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGlmIChOVUxMICE9IGN1cnJDaGFubmVsTGlzdEluZm8tPkNoYW5uZWxMaXN0KQorICAgICAgICB7CisgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY3VyckNoYW5uZWxMaXN0SW5mby0+bnVtT2ZDaGFubmVsczsgaSsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGogKz0gc25wcmludGYob2xkQ2hhbm5lbExpc3QgKyBqLCBzaXplb2Yob2xkQ2hhbm5lbExpc3QpIC0gaiwiICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICBjdXJyQ2hhbm5lbExpc3RJbmZvLT5DaGFubmVsTGlzdFtpXSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgc3RhdHVzID0gY3NyQ3JlYXRlUm9hbVNjYW5DaGFubmVsTGlzdChwTWFjLCBwQ2hhbm5lbExpc3QsIG51bUNoYW5uZWxzLCBjc3JHZXRDdXJyZW50QmFuZChoSGFsKSk7CisKKyAgICAgICAgaWYgKCBIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoTlVMTCAhPSBjdXJyQ2hhbm5lbExpc3RJbmZvLT5DaGFubmVsTGlzdCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBqID0gMDsKKyAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY3VyckNoYW5uZWxMaXN0SW5mby0+bnVtT2ZDaGFubmVsczsgaSsrKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaiArPSBzbnByaW50ZihuZXdDaGFubmVsTGlzdCArIGosIHNpemVvZihuZXdDaGFubmVsTGlzdCkgLSBqLCIgJWQiLAorICAgICAgICAgICAgICAgICAgICBjdXJyQ2hhbm5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tZXMuCisKKyAgICBccGFyYW0gIHBlZXJNYWMgLSBwZWVyJ3MgTWFjIEFkcmVzcy4KKyAgICBccGFyYW0gIHRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zIC0gVERMUyBQZWVyIExpbmsgRXN0YWJsaXNobWVudCBQYXJhbWV0ZXJzCisgICAgXC0gcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTCisgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCitWT1NfU1RBVFVTIHNtZV9TZW5kVGRsc0xpbmtFc3RhYmxpc2hQYXJhbXModEhhbEhhbmRsZSBoSGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggc2Vzc2lvbklkLAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0U2lyTWFjQWRkciBwZWVyTWFjLAorI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjQWRkciBwZWVyTWFjLAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdENzclRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zICp0ZGxzTGlua0VzdGFibGlzaFBhcmFtcykKK3sKKyAgICBlSGFsU3RhdHVzICAgICAgICAgIHN0YXR1cyAgICA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgdHBBbmlTaXJHbG9iYWwgICAgICBwTWFjICAgICAgPSBQTUFDX1NUUlVDVChoSGFsKTsKKworICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9TTUUsCisgICAgICAgICAgICAgICAgICAgVFJBQ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LS0tLS0qLworVk9TX1NUQVRVUyBzbWVfU2VuZFRkbHNDaGFuU3dpdGNoUmVxKHRIYWxIYW5kbGUgaEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IHNlc3Npb25JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjQWRkciBwZWVyTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfUzMyIHRkbHNPZmZDaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1MzMiB0ZGxzT2ZmQ2hCd09mZnNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IHRkbHNTd01vZGUpCit7CisgICAgZUhhbFN0YXR1cyAgICAgICAgICBzdGF0dXMgICAgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIHRwQW5pU2lyR2xvYmFsICAgICAgcE1hYyAgICAgID0gUE1BQ19TVFJVQ1QoaEhhbCk7CisKKyAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfU01FLAorICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX1NNRV9SWF9IRERfVERMU19DSEFOX1NXSVRDSF9SRVEsCisgICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCwgdGRsc09mZkNoKSk7CisgICAgc3RhdHVzID0gc21lX0FjcXVpcmVHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisKKyAgICBpZiAoIEhBTF9TVEFUVVNfU1VDQ0VTUyggc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgc3RhdHVzID0gY3NyVGRsc1NlbmRDaGFuU3dpdGNoUmVxKGhIYWwsIHNlc3Npb25JZCwgcGVlck1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRkbHNPZmZDaCwgdGRsc09mZkNoQndPZmZz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VFVTIHNtZV9TZW5kVGRsc01nbXRGcmFtZSh0SGFsSGFuZGxlIGhIYWwsIHRBTklfVTggc2Vzc2lvbklkLAorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHRTaXJNYWNBZGRyIHBlZXJNYWMsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY0FkZHIgcGVlck1hYywKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCBmcmFtZV90eXBlLCB0QU5JX1U4IGRpYWxvZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTE2IHN0YXR1c0NvZGUsIHRBTklfVTMyIHBlZXJDYXBhYmlsaXR5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqYnVmLCB0QU5JX1U4IGxlbiwgdEFOSV9VOCByZXNwb25kZXIpCit7CisgICAgZUhhbFN0YXR1cyAgICAgICAgICBzdGF0dXMgICAgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIHRDc3JUZGxzU2VuZE1nbXQgc2VuZFRkbHNSZXEgPSB7ezB9fSA7CisgICAgdHBBbmlTaXJHbG9iYWwgICAgICBwTWFjICAgICAgPSBQTUFDX1NUUlVDVChoSGFsKTsKKworICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9TTUUsCisgICAgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfU01FX1JYX0hERF9URExTX1NFTkRfTUdNVF9GUkFNRSwKKyAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkLCBzdGF0dXNDb2RlKSk7CisgICAgc3RhdHVzID0gc21lX0FjcXVpcmVHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisgICAgaWYgKCBIQUxfU1RBV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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworVk9TX1NUQVRVUyBzbWVfRGVsZXRlVGRsc1BlZXJTdGEodEhhbEhhbmRsZSBoSGFsLCB0QU5JX1U4IHNlc3Npb25JZCwKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0U2lyTWFjQWRkciBwZWVyTWFjCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY0FkZHIgcGVlck1hYworI2VuZGlmCispCit7CisgICAgZUhhbFN0YXR1cyAgICAgICAgICBzdGF0dXMgICAgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIHRwQW5pU2lyR2xvYmFsICAgICAgcE1hYyAgICAgID0gUE1BQ19TVFJVQ1QoaEhhbCk7CisKKyAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfU01FLAorICAgICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX1NNRV9SWF9IRERfVERMU19ERUxfUEVFUl9TVEEsCisgICAgICAgICAgICAgICAgICAgIHNlc3Npb25JZCwgMCkpOworICAgIHN0YXR1cyA9IHNtZV9BY3F1aXJlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICAgIGlmICggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgeworICAgICAgICBzdGF0dXMgPSBjc3JUZGxzRGVsUGVlclN0YShoSGFsLCBzZXNzaW9uSWQsIHBlZXJNYWMpIDsKKyAgICAgICAgc21lX1JlbGVhc2VHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisgICAgfQorCisgICAgcmV0dXJuIHN0YXR1cyA7CisKK30KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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hhbm5lbHMgYWdhaW5zdCB0aGUgcmVndWxhdG9yeSBkb21haW4gKi8KKyAgIHRBTklfQk9PTEVBTiBodDQwUGh5TW9kZSA9IFZPU19GQUxTRTsKKworICAgLyogZ2V0IHRoZSBib25kaW5nIG1vZGUgKi8KKyAgIG1vZGUgPSAoY2hhbm5lbCA8PSAxNCkgPyBzbWVDb25maWctPmNzckNvbmZpZy5jaGFubmVsQm9uZGluZ01vZGUyNEdIeiA6CisgICAgICAgICAgICAgICAgICAgICAgICBzbWVDb25maWctPmNzckNvbmZpZy5jaGFubmVsQm9uZGluZ01vZGU1R0h6OworICAgbmV3TW9kZSA9IG1vZGU7CisKKyAgIC8qIGdldCB0aGUgY2hhbm5lbHMgKi8KKyAgIHN3aXRjaCAobW9kZSkKKyAgIHsKKyAgICAgIGNhc2UgZUNTUl9JTklfU0lOR0xFX0NIQU5ORUxfQ0VOVEVSRUQ6CisgICAgICAgICBzdGFydENoYW4gPSBjaGFubmVsOworICAgICAgICAgY2hhbkNudCA9IDE7CisgICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgZUNTUl9JTklfRE9VQkxFX0NIQU5ORUxfSElHSF9QUklNQVJZOgorICAgICAgICAgc3RhcnRDaGFuID0gY2hhbm5lbCAtIHN0ZXA7CisgICAgICAgICBjaGFuQ250ID0gMjsKKyAgICAgICAgIGNlbnRlckNoYW4gPSBjaGFubmVsIC0gQ1NSX0NCX0NFTlRFUl9DSEFOTkVMX09GRlNFVDsKKyAgICAgICAgIGh0NDBQaHlNb2RlID0gVk9TX1RSVUU7CisgICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgZUNTUl9JTklfRE9VQkxFX0NIQU5ORUxfTE9XX1BSSU1BUlk6CisgICAgICAgICBzdGFydENoYW4gPSBjaGFubmVsOworICAgICAgICAgY2hhbkNudD0yOworICAgICAgICAgY2VudGVyQ2hhbiA9IGNoYW5uZWwgKyBDU1JfQ0JfQ0VOVEVSX0NIQU5ORUxfT0ZGU0VUOworICAgICAgICAgaHQ0MFBoeU1vZGUgPSBWT1NfVFJVRTsKKyAgICAgICAgIGJyZWFrOworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisgICAgICBjYXNlIGVDU1JfSU5JX1FVQURSVVBMRV9DSEFOTkVMXzIwTUhaX0xPV180ME1IWl9MT1c6CisgICAgICAgICBzdGFydENoYW4gPSBjaGFubmVsOworICAgICAgICAgY2hhbkNudCA9IDQ7CisgICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgZUNTUl9JTklfUVVBRFJVUExFX0NIQU5ORUxfMjBNSFpfSElHSF80ME1IWl9MT1c6CisgICAgICAgICBzdGFydENoYW4gPSBjaGFubmVsIC0gc3RlcDsKKyAgICAgICAgIGNoYW5DbnQgPSA0OworICAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIGVDU1JfSU5JX1FVQURSVVBMRV9DSEFOTkVMXzIwTUhaX0xPV180ME1IWl9ISUdIOgorICAgICAgICAgc3RhcnRDaGFuID0gY2hhbm5lbCAtIDIqc3RlcDsKKyAgICAgICAgIGNoYW5DbnQgPSA0OworICAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIGVDU1JfSU5JX1FVQURSVVBMRV9DSEFOTkVMXzIwTUhaX0hJR0hfNDBNSFpfSElHSDoKKyAgICAgICAgIHN0YXJ0Q2hhbiA9IGNoYW5uZWwgLSAzKnN0ZXA7CisgICAgICAgICBjaGFuQ250ID0gNDsKKyAgICAgICAgIGJyZWFrOworI2VuZGlmCisgICAgICBkZWZhdWx0OgorICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgIH0KKworICAgLyogZmluZCB2aW9sYXRpb247IGFsc28gbWFwIHZhbGlkIGNoYW5uZWxzIHRvIGEgYml0bWFwICovCisgICBmb3IgKGkgPSAwOyBpIDwgY2hhbkNudDsgaSsrKQorICAgeworICAgICAgaWYgKGNzcklzVmFsaWRDaGFubmVsK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0lOR0xFX0NIQU5ORUxfQ0VOVEVSRUQ7CisKKyAgICAgIHN3aXRjaCAobW9kZSkKKyAgICAgIHsKKyAgICAgICAgIGNhc2UgZUNTUl9JTklfU0lOR0xFX0NIQU5ORUxfQ0VOVEVSRUQ6CisgICAgICAgICAgICAvKiBmYWxsIHRocnUgKi8KKyAgICAgICAgIGNhc2UgZUNTUl9JTklfRE9VQkxFX0NIQU5ORUxfSElHSF9QUklNQVJZOgorICAgICAgICAgICAgLyogZmFsbCB0aHJ1ICovCisgICAgICAgICBjYXNlIGVDU1JfSU5JX0RPVUJMRV9DSEFOTkVMX0xPV19QUklNQVJZOgorICAgICAgICAgICAgYnJlYWs7CisjaWZkZWYgV0xBTl9GRUFUVVJFXzExQUMKKyAgICAgICAgIGNhc2UgZUNTUl9JTklfUVVBRFJVUExFX0NIQU5ORUxfMjBNSFpfTE9XXzQwTUhaX0xPVzoKKyAgICAgICAgICAgIGlmICgoY2hhbkJpdG1hcCAmIGxvd2VyTWFzaykgPT0gbG93ZXJNYXNrKQorICAgICAgICAgICAgICAgbmV3TW9kZSA9IGVDU1JfSU5JX0RPVUJMRV9DSEFOTkVMX0xPV19QUklNQVJZOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICBjYXNlIGVDU1JfSU5JX1FVQURSVVBMRV9DSEFOTkVMXzIwTUhaX0hJR0hfNDBNSFpfTE9XOgorICAgICAgICAgICAgaWYgKChjaGFuQml0bWFwICYgbG93ZXJNYXNrKSA9PSBsb3dlck1hc2spCisgICAgICAgICAgICAgICBuZXdNb2RlID0gZUNTUl9JTklfRE9VQkxFX0NIQU5ORUxfSElHSF9QUklNQVJZOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICBjYXNlIGVDU1JfSU5JX1FVQURSVVBMRV9DSEFOTkVMXzIwTUhaX0xPV180ME1IWl9ISUdIOgorICAgICAgICAgICAgaWYgKChjaGFuQml0bWFwICYgdXBwZXJNYXNrKSA9PSB1cHBlck1hc2spCisgICAgICAgICAgICAgICBuZXdNb2RlID0gZUNTUl9JTklfRE9VQkxFX0NIQU5ORUxfTE9XX1BSSU1BUlk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIGNhc2UgZUNTUl9JTklfUVVBRFJVUExFX0NIQU5ORUxfMjBNSFpfSElHSF80ME1IWl9ISUdIOgorICAgICAgICAgICAgaWYgKChjaGFuQml0bWFwICYgdXBwZXJNYXNrKSA9PSB1cHBlck1hc2spCisgICAgICAgICAgICAgICBuZXdNb2RlID0gZUNTUl9JTklfRE9VQkxFX0NIQU5ORUxfSElHSF9QUklNQVJZOworICAgICAgICAgICAgYnJlYWs7CisjZW5kaWYKKyAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX05PU1VQUE9SVDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgfQorCisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgRkwoImJvbmRpbmcgbW9kZSBhZGp1c3Q6ICVzIHRvICVzIiksCisgICAgICAgICAgICBzbWVfQ0JNb2RlMlN0cmluZyhtb2RlKSwKKyAgICAgICAgICAgIHNtZV9DQk1vZGUyU3RyaW5nKG5ld01vZGUpKTsKKworICAgfQorCisgICAvKiBjaGVjayBmb3IgbW9kZSBjaGFuZ2UgKi8KKyAgIGlmIChuZXdNb2RlICE9IG1vZGUpCisgICB7CisgICAgICBpZiAoY2hhbm5lbCA8PSAxNCkKKyAgICAgICAgICBzbWVDb25maWctPmNzckNvbmZpZy5jaGFubmVsQm9uZGluZ01vZGUyNEdIeiA9IG5ld01vZGU7CisgICAgICBlbHNlCisgICAgICAgICAgc21lQ29uZmlnLT5jc3JDb25maWcuY2hhbm5lbEJvbmRpbmdNb2RlNUdIeiA9IG5ld01vZGU7CisgICB9CisKKyAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7CisKK30KKwor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0hBTk5FTF8yME1IWl9MT1dfNDBNSFpfTE9XOworICAgICAgICAgfQorICAgICAgICAgZWxzZSBpZiAoY2hhbm5lbCA9PSA0MCB8fCBjaGFubmVsID09IDU2IHx8IGNoYW5uZWwgPT0gMTA0IHx8CisgICAgICAgICAgICAgIGNoYW5uZWwgPT0gMTIwIHx8IGNoYW5uZWwgPT0gMTUzKQorICAgICAgICAgeworICAgICAgICAgICAgc21lQ29uZmlnLmNzckNvbmZpZy5jaGFubmVsQm9uZGluZ01vZGU1R0h6ID0KKyAgICAgICAgICAgICAgZUNTUl9JTklfUVVBRFJVUExFX0NIQU5ORUxfMjBNSFpfSElHSF80ME1IWl9MT1c7CisgICAgICAgICB9CisgICAgICAgICBlbHNlIGlmIChjaGFubmVsID09IDQ0IHx8IGNoYW5uZWwgPT0gNjAgfHwgY2hhbm5lbCA9PSAxMDggfHwKKyAgICAgICAgICAgIGNoYW5uZWwgPT0gMTI0IHx8IGNoYW5uZWwgPT0gMTU3KQorICAgICAgICB7CisgICAgICAgICAgICBzbWVDb25maWcuY3NyQ29uZmlnLmNoYW5uZWxCb25kaW5nTW9kZTVHSHogPQorICAgICAgICAgICAgICBlQ1NSX0lOSV9RVUFEUlVQTEVfQ0hBTk5FTF8yME1IWl9MT1dfNDBNSFpfSElHSDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChjaGFubmVsID09IDQ4IHx8IGNoYW5uZWwgPT0gNjQgfHwgY2hhbm5lbCA9PSAxMTIgfHwKKyAgICAgICAgICAgICBjaGFubmVsID09IDEyOCB8fCBjaGFubmVsID09IDE0NCB8fCBjaGFubmVsID09IDE2MSkKKyAgICAgICAgeworICAgICAgICAgICAgc21lQ29uZmlnLmNzckNvbmZpZy5jaGFubmVsQm9uZGluZ01vZGU1R0h6ID0KKyAgICAgICAgICAgICAgZUNTUl9JTklfUVVBRFJVUExFX0NIQU5ORUxfMjBNSFpfSElHSF80ME1IWl9ISUdIOworICAgICAgICB9CisgICAgICAgIGVs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gMTQ5IHx8IGNoYW5uZWwgPT0gMTU3KQorICAgICAgICB7CisgICAgICAgICAgICBzbWVDb25maWcuY3NyQ29uZmlnLmNoYW5uZWxCb25kaW5nTW9kZTVHSHogPQorICAgICAgICAgICAgICAgIGVDU1JfSU5JX0RPVUJMRV9DSEFOTkVMX0xPV19QUklNQVJZOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGNoYW5uZWwgPT0gMTY1KQorICAgICAgICB7CisgICAgICAgICAgICBzbWVDb25maWcuY3NyQ29uZmlnLmNoYW5uZWxCb25kaW5nTW9kZTVHSHogPQorICAgICAgICAgICAgICAgIGVDU1JfSU5JX1NJTkdMRV9DSEFOTkVMX0NFTlRFUkVEOworICAgICAgICB9CisgICAgICB9CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfQVBfSFQ0MF8yNEcKKyAgICAgIGlmIChzbWVDb25maWcuY3NyQ29uZmlnLmFwSFQ0MF8yNEdFbmFibGVkKQorICAgICAgeworICAgICAgICAgIGlmIChjaGFubmVsID49IDEgJiYgY2hhbm5lbCA8PSA3KQorICAgICAgICAgICAgIHNtZUNvbmZpZy5jc3JDb25maWcuY2hhbm5lbEJvbmRpbmdBUE1vZGUyNEdIeiA9CisgICAgICAgICAgICAgICAgZUNTUl9JTklfRE9VQkxFX0NIQU5ORUxfTE9XX1BSSU1BUlk7CisgICAgICAgICAgZWxzZSBpZiAoY2hhbm5lbCA+PSA4ICYmIGNoYW5uZWwgPD0gMTMpCisgICAgICAgICAgICAgc21lQ29uZmlnLmNzckNvbmZpZy5jaGFubmVsQm9uZGluZ0FQTW9kZTI0R0h6ID0KKyAgICAgICAgICAgICAgICBlQ1NSX0lOSV9ET1VCTEVfQ0hBTk5FTF9ISUdIX1BSSU1BUlk7CisgICAgICAgICAgZWxzZSBpZiAoY2hhbm5lbCA9PTE0KQorICAgICAgICAgICAgIHNtZUNvbmZpZy5jc3JDb25maWcuY2hhbm5lbEJvbmRpbmdBUE1vZGUyNEdIeiA9C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NTcgKQorICAgICAgeworICAgICAgICAgc21lQ29uZmlnLmNzckNvbmZpZy5jaGFubmVsQm9uZGluZ01vZGU1R0h6ID0KKyAgICAgICAgICAgICAgICBlQ1NSX0lOSV9ET1VCTEVfQ0hBTk5FTF9MT1dfUFJJTUFSWTsKKyAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCBjaGFubmVsID09IDE2NSApCisgICAgICB7CisgICAgICAgICBzbWVDb25maWcuY3NyQ29uZmlnLmNoYW5uZWxCb25kaW5nTW9kZTVHSHogPQorICAgICAgICAgICAgICAgIGVDU1JfSU5JX1NJTkdMRV9DSEFOTkVMX0NFTlRFUkVEOworICAgICAgfQorCisjaWZkZWYgV0xBTl9GRUFUVVJFX0FQX0hUNDBfMjRHCisgICAgICBpZiAoc21lQ29uZmlnLmNzckNvbmZpZy5hcEhUNDBfMjRHRW5hYmxlZCkKKyAgICAgIHsKKyAgICAgICAgICBpZiAoY2hhbm5lbCA+PSAxICYmIGNoYW5uZWwgPD0gNykKKyAgICAgICAgICAgICBzbWVDb25maWcuY3NyQ29uZmlnLmNoYW5uZWxCb25kaW5nQVBNb2RlMjRHSHogPQorICAgICAgICAgICAgICAgIGVDU1JfSU5JX0RPVUJMRV9DSEFOTkVMX0xPV19QUklNQVJZOworICAgICAgICAgIGVsc2UgaWYgKGNoYW5uZWwgPj0gOCAmJiBjaGFubmVsIDw9IDEzKQorICAgICAgICAgICAgIHNtZUNvbmZpZy5jc3JDb25maWcuY2hhbm5lbEJvbmRpbmdBUE1vZGUyNEdIeiA9CisgICAgICAgICAgICAgICAgZUNTUl9JTklfRE9VQkxFX0NIQU5ORUxfSElHSF9QUklNQVJZOworICAgICAgICAgIGVsc2UgaWYgKGNoYW5uZWwgPT0xNCkKKyAgICAgICAgICAgICBzbWVDb25maWcuY3NyQ29uZmlnLmNoYW5uZWxCb25kaW5nQVBNb2RlMjRHSHogPQorICAgICAgICAgICAgICAgIGVDU1JfSU5JX1NJTkdMRV9DSEFOTkVMX0NF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MX1NUQVRVU19TVUNDRVNTID09IHN0YXR1cykKKyAgICB7CisgICAgICAgIGlmICgoTFBIQl9TRVRfRU5fUEFSQU1TX0lORElEID09IGxwaGRSZXEtPmNtZCkgJiYKKyAgICAgICAgICAgIChOVUxMID09IHBDYWxsYmFja2ZuKSAmJgorICAgICAgICAgICAgKE5VTEwgPT0gcE1hYy0+c21lLnBMcGhiSW5kQ2IpKQorICAgICAgICB7CisgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgIiVzOiBJbmRpY2F0aW9uIENhbGwgYmFjayBkaWQgbm90IHJlZ2lzdGVyZWQiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgIHNtZV9SZWxlYXNlR2xvYmFsTG9jaygmcE1hYy0+c21lKTsKKyAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoTlVMTCAhPSBwQ2FsbGJhY2tmbikKKyAgICAgICAgeworICAgICAgICAgICBwTWFjLT5zbWUucExwaGJJbmRDYiA9IHBDYWxsYmFja2ZuOworICAgICAgICB9CisKKyAgICAgICAgLyogc2VyaWFsaXplIHRoZSByZXEgdGhyb3VnaCBNQyB0aHJlYWQgKi8KKyAgICAgICAgdm9zTWVzc2FnZS5ib2R5cHRyID0gbHBoZFJlcTsKKyAgICAgICAgdm9zTWVzc2FnZS50eXBlICAgID0gV0RBX0xQSEJfQ09ORl9SRVE7CisgICAgICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9TTUUsCisgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfU01FX1RYX1dEQV9NU0csIE5PX1NFU1NJT04sIHZvc01lc3NhZ2UudHlwZSkpOworICAgICAgICB2b3NTdGF0dXMgPSB2b3NfbXFfcG9zdF9tZXNzYWdlKFZPU19NU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NUeFB0cm5QYXJhbXMpCit7CisgICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9IFBNQUNfU1RSVUNUKGhIYWwpOworICAgIGVIYWxTdGF0dXMgc3RhdHVzOworICAgIHZvc19tc2dfdCBtc2c7CisKKyAgICBpZiAoZUhBTF9TVEFUVVNfU1VDQ0VTUyA9PSAoc3RhdHVzID0gc21lX0FjcXVpcmVHbG9iYWxMb2NrKCZwTWFjLT5zbWUpKSkKKyAgICB7CisgICAgICAgIG1zZy50eXBlICAgICA9IFdEQV9ERUxfUEVSSU9ESUNfVFhfUFRSTl9JTkQ7CisgICAgICAgIG1zZy5ib2R5cHRyICA9IGRlbFBlcmlvZGljVHhQdHJuUGFyYW1zOworCisgICAgICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9TTUUsCisgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfU01FX1RYX1dEQV9NU0csIE5PX1NFU1NJT04sIG1zZy50eXBlKSk7CisgICAgICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc19tcV9wb3N0X21lc3NhZ2UoVk9TX01PRFVMRV9JRF9XREEsICZtc2cpKSkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCIlczogTm90IGFibGUgIgorICAgICAgICAgICAgICAgICAgICAgICAidG8gcG9zdCBXREFfREVMX1BFUklPRElDX1RYX1BUUk5fSU5EIHRvIFdEQSEiLAorICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisKKyAgICAgICAgICAgIHNtZV9SZWxlYXNlR2xvYmFsTG9jaygmcE1hYy0+c21lKTsKKyAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICB9CisKKyAgICAgICAgc21lX1JlbGVhc2VHbG9iYWxMb2NrKCZwTWFjLT5zbWUpOworICAgICAg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sIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IE5vdCBhYmxlIHRvIGFsbG9jYXRlIG1lbW9yeSBmb3IgIgorICAgICAgICAgICAgICAgICJXREFfTElOS19MQVlFUl9TVEFUU19HRVRfUkVRIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIH0KKyAgICAqcEdldFN0YXRzUmVxID0gKnBMaW5rTGF5ZXJTdGF0c0dldFJlcTsKKworICAgIGlmICggZUhBTF9TVEFUVVNfU1VDQ0VTUyA9PSAoIHN0YXR1cyA9IHNtZV9BY3F1aXJlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApKSkKKyAgICB7CisgICAgICAgIG1zZy50eXBlID0gV0RBX0xJTktfTEFZRVJfU1RBVFNfR0VUX1JFUTsKKyAgICAgICAgbXNnLnJlc2VydmVkID0gMDsKKyAgICAgICAgbXNnLmJvZHlwdHIgPSBwR2V0U3RhdHNSZXE7CisgICAgICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9TTUUsCisgICAgICAgICAgICAgICAgIFRSQUNFX0NPREVfU01FX1RYX1dEQV9NU0csIE5PX1NFU1NJT04sIG1zZy50eXBlKSk7CisgICAgICAgIGlmKFZPU19TVEFUVVNfU1VDQ0VTUyAhPSB2b3NfbXFfcG9zdF9tZXNzYWdlKFZPU19NT0RVTEVfSURfV0RBLCAmbXNnKSkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogIgorICAgICAgICAgICAgICAgICAgICAiTm90IGFibGUgdG8gcG9zdCBTSVJfSEFMX0xMX1NUQVRTX0dFVCBtZXNzYWdlIHRvIEhBTCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwR2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fU1VDQ0VTUzsKKyAgICB2X1U4X3QgaSwgaiwgcGVTZXNzaW9uSWQ7CisgICAgdENzclJvYW1TZXNzaW9uICpwQ3NyU2Vzc2lvbiA9IE5VTEw7CisgICAgdHBQRVNlc3Npb24gcFNlc3Npb24gPSBOVUxMOworCisgICAgc3RhdHVzID0gc21lX0FjcXVpcmVHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisgICAgaWYgKCBIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGlmICghQ1NSX0lTX1NFU1NJT05fVkFMSUQoIHBNYWMsIHNlc3Npb25JZCApKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICIlczogSW52YWxpZCBzZXNzaW9uIElkICV1IiwgX19mdW5jX18sIHNlc3Npb25JZCk7CisgICAgICAgICAgICBzbWVfUmVsZWFzZUdsb2JhbExvY2soICZwTWFjLT5zbWUpOworICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgIH0KKyAgICAgICAgcENzclNlc3Npb24gPSBDU1JfR0VUX1NFU1NJT04oIHBNYWMsIHNlc3Npb25JZCApOworCisgICAgICAgIGlmIChwQ3NyU2Vzc2lvbiA9PSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICIlczogQ1NSIFNlc3Npb24gbG9va3VwIGZhaWxzICV1IiwgX19mdW5jX18sIHNlc3Npb25JZCk7CisgICAgICAgICAgICBzbWVfUmVsZWFzZUdsb2JhbExvY2soICZwTWFjLT5zbWUpOworICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgIH0KKworICAgICAgICBwU2Vzc2lvbiA9IHBlRmluZFNlc3Npb25CeUJzc2lkKCBwTWFjLAorICAgICAgICAgICAgcENzclNlc3Npb24tPmNvbm5lY3RlZFByb2ZpbGUuYnNzaWQsICZwZVNlc3Npb25JZCApOworCisgICAgICAgIGlmIChwU2Vzc2lvbiA9PSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICIlczogU2Vzc2lvbiBsb29rdXAgZmFpbHMgZm9yIEJTU0lEIiwgX19mdW5jX18pOworICAgICAgICAgICAgc21lX1JlbGVhc2VHbG9iYWxMb2NrKCAmcE1hYy0+c21lKTsKKyAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCAhcFNlc3Npb24tPlFvc01hcFNldC5wcmVzZW50ICkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICIlczogUU9TIE1hcHBpbmcgSUUgbm90IHByZXNlbnQiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICBzbWVfUmVsZWFzZUdsb2JhbExvY2soICZwTWFjLT5zbWUpOworICAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgU01FX1FPU19XTU1fVVBfTUFYOyBpKyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZm9yIChqID0gcFNlc3Npb24tPlFvc01hcFNldC5kc2NwX3JhbmdlW2ldWzBdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPD0gcFNlc3Npb24tPlFvc01hcFNldC5kc2NwX3JhbmdlW2ldWzFdOyBqKyspCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIGlmICgocFNlc3Npb24tPlFvc01hcFNldC5kc2NwX3JhbmdlW2ldWzBdID09IDI1NSkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBTZXNzaW9uLT5Rb3NNYXBTZXQuZHNjcF9yYW5nZVtpXVsxXSA9PSAyNTUpKQorICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgZHNjcG1hcHBpbmdbal09IDA7CisgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFVzZXIgUHJpb3JpdHkgJWQgaXMgbm90IHVzZWQgaW4gbWFwcGluZyIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIGkpOworICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgZHNjcG1hcHBpbmdbal09IGk7CisgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGZvciAoaSA9IDA7IGk8IHBTZXNzaW9uLT5Rb3NNYXBTZXQubnVtX2RzY3BfZXhjZXB0aW9uczsgaSsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChwU2Vzc2lvbi0+UW9zTWFwU2V0LmRzY3BfZXhjZXB0aW9uc1tpXVswXSAhPSAyNTUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBkc2NwbWFwcGluZ1twU2Vzc2lvbi0+UW9zTWFwU2V0LmRzY3BfZXhjZXB0aW9uc1tpXVswXSBdID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPlFvc01hcFNldC5kc2NwX2V4Y2VwdGlvbnNbaV1bMV07CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIHNtZV9SZWxlYXNlR2xvYmFsTG9jayggJnBNYWMtPnNtZSk7CisgICAgcmV0dXJuIHN0YXR1czsKK30KKwordEFOSV9CT09MRUFOICBzbWVfSXMxMWRDb3VudHJ5Y29kZSh0SGFsSGFuZGxlIGhIYWwpCit7CisgICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9IFBNQUNfU1RSVUNUKCBoSGFsICk7CisKKyAgICBpZiAoVk9TX1RSVUUgPT0gdm9zX21lbV9jb21wYXJlKHBNYWMtPnNjYW4uY291bnRyeUNvZGVDdXJyZW50LAorICAgICAgICAgICAgICAgICAgcE1hYy0+c2Nhbi5jb3VudHJ5Q29kZTExZCwgMikpCisgICAgeworICAgICAgICByZXR1cm4gZUFOSV9CT09MRUFOX1RSVUU7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHJldHVybiBlQU5JX0JPT0xFQU5fRkFMU0U7CisgICAgfQorfQorCitlSGFsU3RhdHVzIHNtZV9TcG9vZk1hY0FkZHJSZXEodEhhbEhhbmRsZSBoSGFsLCB2X01BQ0FERFJfdCAqbWFjYWRkcikKK3sKKyAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVChoSGFsKTsKKyAgIGVIYWxTdGF0dXMgc3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgIHRTbWVDbWQgKnBNYWNTcG9vZkNtZDsKKworICAgIHN0YXR1cyA9IHNtZV9BY3F1aXJlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICAgIGlmICggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICAgeworICAgICAgIHBNYWNTcG9vZkNtZCA9IGNzckdldENvbW1hbmRCdWZmZXIocE1hYyk7CisgICAgICAgaWYgKHBNYWNTcG9vZkNtZCkKKyAgICAgICB7CisgICAgICAgICAgIHBNYWNTcG9vZkNtZC0+Y29tbWFuZCA9IGVTbWVDb21tYW5kTWFjU3Bvb2ZSZXF1ZXN0OworICAgICAgICAgICB2b3NfbWVtX3NldCgmcE1hY1Nwb29mQ21kLT51Lm1hY0FkZHJTcG9vZkNtZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpclNwb29mTWFjQWRkclJlcSksIDApOworICAgICAgICAgICB2b3NfbWVtX2NvcHkocE1hY1Nwb29mQ21kLT51Lm1hY0FkZHJTcG9vZkNtZC5tYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWNhZGRyLT5ieXRlcywgVk9TX01BQ19BRERSRVNTX0xFTik7CisKKyAgICAgICAgICAgc3RhdHVzID0gY3NyUXVldWVTbWVDb21tYW5kKHBNYWMsIHBNYWNTcG9vZkNtZCwgZUFOSV9CT09MRUFOX1RSVUUpOworICAgICAgICAgICBpZiAoICFIQUxfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiZmFpbCB0byBzZW5kIG1zZyBzdGF0dXMgPSAlZFxuIiksIHN0YXR1cyApOworICAgICAgICAgICAgICAgY3NyUmVsZWFzZUNvbW1hbmRTY2FuKHBNYWMsIHBNYWNTcG9vZkNtZCk7CisgICAgICAgICAgIH0KKyAgICAgICB9CisgICAgICAgZWxzZQorICAgICAgIHsKKyAgICAgICAgICAgLy9sb2cgZXJyb3IKK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KQoreworICAgIGVIYWxTdGF0dXMgc3RhdHVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgdEFOSV9VOCBjaGFuTGlzdFtXTklfQ0ZHX1ZBTElEX0NIQU5ORUxfTElTVF9MRU5dICAgID0gezB9OworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IFBNQUNfU1RSVUNUKGhIYWwpOworICAgIHRBTklfVTggbnVtQ2hhbm5lbHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IDA7CisgICAgdEFOSV9VOCBpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gMDsKKyAgICB0QU5JX1UzMiB0b3RWYWxpZENoYW5uZWxzICAgICAgICAgICAgICAgICA9IFdOSV9DRkdfVkFMSURfQ0hBTk5FTF9MSVNUX0xFTjsKKworICAgIGlmICghYVZhbGlkQ2hhbm5lbHMgfHwgIXBOdW1DaGFubmVscykgeworICAgICAgICBzbXNMb2cocE1hYywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgRkwoIk91dHB1dCBjaGFubmVsIGxpc3QvTnVtQ2hhbm5lbHMgaXMgTlVMTCIpKTsKKyAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0lOVkFMSURfUEFSQU1FVEVSOworICAgIH0KKworICAgIGlmICgod2lmaUJhbmQgPCBXSUZJX0JBTkRfVU5TUEVDSUZJRUQpIHx8ICh3aWZpQmFuZCA+PSBXSUZJX0JBTkRfTUFYKSkgeworICAgICAgICBzbXNMb2cocE1hYywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgRkwoIkludmFsaWQgd2lmaUJhbmQgKCVkKSIpLCB3aWZpQmFuZCk7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19JTlZBTElEX1BBUkFNRVRFUjsKKyAgICB9CisKKyAgICBzdGF0dXMgPSBzbWVfR2V0Q2ZnVmFsaWRDaGFubmVscyhoSGFsLCAmY2hhbkxpc3RbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnRvdFZhbGlkQ2hhbm5lbHMpOworICAgIGlmICghSEFMX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpIHsKKyAgICAgICAgc21zTG9nKHBNYWMsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIEZMKCJGYWlsZWQgdG8gZ2V0IHZhbGlkIGNoYW5uZWwgbGlzdCAoZXJyPSVkKSIpLCBzdGF0dXMpOworICAgICAgICByZXR1cm4gc3RhdHVzOworICAgIH0KKworICAgIHN3aXRjaCAod2lmaUJhbmQpIHsKKyAgICBjYXNlIFdJRklfQkFORF9VTlNQRUNJRklFRDoKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgRkwoIlVuc3BlY2lmaWVkIHdpZmlCYW5kLCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgInJldHVybiBhbGwgKCVkKSB2YWxpZCBjaGFubmVscyIpLCB0b3RWYWxpZENoYW5uZWxzKTsKKyAgICAgICAgICAgIG51bUNoYW5uZWxzID0gdG90VmFsaWRDaGFubmVsczsKKyAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBudW1DaGFubmVsczsgaSsrKQorICAgICAgICAgICAgICAgIGFWYWxpZENoYW5uZWxzW2ldID0gdm9zX2NoYW5fdG9fZnJlcShjaGFuTGlzdFtpXSk7CisgICAgICAgICAgICBicmVhazsKKworICAgIGNhc2UgV0lGSV9CQU5EX0JHOgorICAgICAgICAgICAgc21zTG9nKHBNYWMsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCBGTCgiV0lGSV9CQU5EX0JHICgyLjQgR0h6KSIpKTsKKyAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCB0b3RWYWxpZENoYW5uZWxzOyBpKyspCisgICAgICAgICAgICAgICAgaWYgKENTUl9JU19DSEFOTkVMXzI0R0haKGNoYW5MaXN0W2ldKSkKKyAgICAgICAgICAgICAgICAgICAgYVZhbGlkQ2hhbm5lbHNbbnVtQ2hhbm5lbHMrK10gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19jaGFuX3RvX2ZyZXEoY2hhbkxpc3RbaV0pOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICBjYXNlIFdJRklfQkFORF9BOgorICAgICAgICAgICAgc21zTG9nKHBNYWMsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiV0lGSV9CQU5EX0EgKDUgR0h6IHdpdGhvdXQgREZTKSIpKTsKKyAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCB0b3RWYWxpZENoYW5uZWxzOyBpKyspCisgICAgICAgICAgICAgICAgaWYgKENTUl9JU19DSEFOTkVMXzVHSFooY2hhbkxpc3RbaV0pICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICFDU1JfSVNfQ0hBTk5FTF9ERlMoY2hhbkxpc3RbaV0pKQorICAgICAgICAgICAgICAgICAgICBhVmFsaWRDaGFubmVsc1tudW1DaGFubmVscysrXSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX2NoYW5fdG9fZnJlcShjaGFuTGlzdFtpXSk7CisgICAgICAgICAgICBicmVhazsKKworICAgIGNhc2UgV0lGSV9CQU5EX0FCRzoKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIldJRklfQkFORF9BQkcgKDIuNCBHSHogKyA1IEdIejsgbm8gREZTKSIpKTsKKyAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCB0b3RWYWxpZENoYW5uZWxzOyBpKyspCisgICAgICAgICAgICAgICAgaWYgKChDU1JfSVNfQ0hBTk5FTF8yNEdIWihjaGFuTGlzdFtpXSkgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1NSX0lTX0NIQU5ORUxfNUdIWihjaGFuTGlzdFtpXSkpICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICFDU1JfSVNfQ0hBTk5FTF9ERlMoY2hhbkxpc3RbaV0pKQorICAgICAgICAgICAgICAgICAgICBhVmFsaWRDaGFubmVsc1tudW1DaGFubmVscysrXSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX2NoYW5fdG9fZnJlcShjaGFuTGlzdFtpXSk7CisgICAgICAgICAgICBicmVhazsKKworICAgIGNhc2UgV0lGSV9CQU5EX0FfREZTX09OTFk6CisgICAgICAgICAgICBzbXNMb2cocE1hYywgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJXSUZJX0JBTkRfQV9ERlMgKDUgR0h6IERGUyBvbmx5KSIpKTsKKyAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCB0b3RWYWxpZENoYW5uZWxzOyBpKyspCisgICAgICAgICAgICAgICAgaWYgKENTUl9JU19DSEFOTkVMXzVHSFooY2hhbkxpc3RbaV0pICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENTUl9JU19DSEFOTkVMX0RGUyhjaGFuTGlzdFtpXSkpCisgICAgICAgICAgICAgICAgICAgIGFWYWxpZENoYW5uZWxzW251bUNoYW5uZWxzKytdID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfY2hhbl90b19mcmVxKGNoYW5MaXN0W2ldKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgY2FzZSBXSUZJX0JBTkRfQV9XSVRIX0RGUzoKKyAgICAgICAgICAgIHNtc0xvZyhwTWFjLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIldJRklfQkFORF9BX1dJVEhfREZTICg1IEdIeiB3aXRoIERGUykiKSk7CisgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgdG90VmFsaWRDaGFubmVsczsgaSsrKQorICAgICAgICAgICAgICAgIGlmIChDU1JfSVNfQ0hBTk5FTF81R0haKGNoYW5MaXN0W2ldKSkKKyAgICAgICAgICAgICAgICAgICAgYVZhbGlkQ2hhbm5lbHNbbnVtQ2hhbm5lbHMrK10gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19jaGFuX3RvX2ZyZXEoY2hhbkxpc3RbaV0pOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICBjYXNlIFdJRklfQkFORF9BQkdfV0lUSF9ERlM6CisgICAgICAgICAgICBzbXNMb2cocE1hYywgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICBGTCgiV0lGSV9CQU5EX0FCR19XSVRIX0RGUyAoMi40IEdIeiArIDUgR0h6IHdpdGggREZTKSIpKTsKKyAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCB0b3RWYWxpZENoYW5uZWxzOyBpKyspCisgICAgICAgICAgICAgICAgaWYgKENTUl9JU19DSEFOTkVMXzI0R0haKGNoYW5MaXN0W2ldKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDU1JfSVNfQ0hBTk5FTF81R0haKGNoYW5MaXN0W2ldKSkKKyAgICAgICAgICAgICAgICAgICAgYVZhbGlkQ2hhbm5lbHNbbnVtQ2hhbm5lbHMrK10gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19jaGFuX3RvX2ZyZXEoY2hhbkxpc3RbaV0pOworICAgICAgICAgICAgYnJlYWs7CisKKyA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gdGhyb3VnaCBNQyB0aHJlYWQgKi8KKyAgICAgICAgdm9zTWVzc2FnZS5ib2R5cHRyID0gcEdldEVYVFNjYW5DYXBhYmlsaXRpZXNSZXE7CisgICAgICAgIHZvc01lc3NhZ2UudHlwZSAgICA9IFdEQV9FWFRTQ0FOX0dFVF9DQVBBQklMSVRJRVNfUkVROworICAgICAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfU01FLAorICAgICAgICAgICAgICAgICBUUkFDRV9DT0RFX1NNRV9UWF9XREFfTVNHLCBOT19TRVNTSU9OLCB2b3NNZXNzYWdlLnR5cGUpKTsKKyAgICAgICAgdm9zU3RhdHVzID0gdm9zX21xX3Bvc3RfbWVzc2FnZShWT1NfTVFfSURfV0RBLCAmdm9zTWVzc2FnZSk7CisgICAgICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpIHsKKyAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfU01FLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogIgorICAgICAgICAgICAgICAgICAgICAiZmFpbGVkIHRvIHBvc3QgV0RBX0VYVFNDQU5fR0VUX0NBUEFCSUxJVElFU19SRVEgIiwKKyAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICB2b3NfbWVtX2ZyZWUocEdldEVYVFNjYW5DYXBhYmlsaXRpZXNSZXEpOworICAgICAgICAgICBzdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgICAgICB9CisKKyAgICAgICAgc21lX1JlbGVhc2VHbG9iYWxMb2NrKCZwTWFjLT5zbWUpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiAiCisgICAgICAgICAgICAgICAgInNtZV9BY3F1aXJlR2xvYmFsTG9jayBlcnJ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MgICAgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIFZPU19TVEFUVVMgdm9zU3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgID0gUE1BQ19TVFJVQ1QoaEhhbCk7CisgICAgdm9zX21zZ190IHZvc01lc3NhZ2U7CisgICAgdFNpckVYVFNjYW5SZXNldFNpZ25pZmljYW50Q2hhbmdlUmVxUGFyYW1zICpwRVhUU2NhblJlc2V0U2lnbmlmaWNhbnRSZXE7CisKKyAgICBwRVhUU2NhblJlc2V0U2lnbmlmaWNhbnRSZXEgPQorICAgICAgICB2b3NfbWVtX21hbGxvYyhzaXplb2YoKnBFWFRTY2FuUmVzZXRTaWduaWZpY2FudFJlcSkpOworICAgIGlmICggIXBFWFRTY2FuUmVzZXRTaWduaWZpY2FudFJlcSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogTm90IGFibGUgdG8gYWxsb2NhdGUgbWVtb3J5IGZvciAiCisgICAgICAgICAgICAgICAgIldEQV9FWFRTQ0FOX1JFU0VUX1NJR05GX1JTU0lfQ0hBTkdFX1JFUSIsCisgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICB9CisKKyAgICAqcEVYVFNjYW5SZXNldFNpZ25pZmljYW50UmVxID0gKnBSZXNldFJlcTsKKworICAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9TTUUsCisgICAgICAgICAgIFRSQUNFX0NPREVfU01FX1JYX0hERF9FWFRTQ0FOX1JFU0VUX1NJR05GX0NIQU5HRSwgTk9fU0VTU0lPTiwgMCkpOworICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTID09IChzdGF0dXMgPSBzbWVfQWNxdWl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G1zZ3NlbmQgKHRIYWxIYW5kbGUgaEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCAqcENtZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFbmNyeXB0TXNnUlNQQ2IgZW5jTXNnQ2JrKQoreworICAgIGVIYWxTdGF0dXMgc3RhdHVzICAgID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICBWT1NfU1RBVFVTIHZvc1N0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgICB0cEFuaVNpckdsb2JhbCBwTWFjICA9IFBNQUNfU1RSVUNUKGhIYWwpOworICAgIHZvc19tc2dfdCB2b3NNZXNzYWdlOworICAgIHU4ICpwRW5jcnlwdE1zZzsKKworICAgIHBFbmNyeXB0TXNnID0gdm9zX21lbV9tYWxsb2MobGVuZ3RoKTsKKyAgICBpZiAoICFwRW5jcnlwdE1zZykKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogTm90IGFibGUgdG8gYWxsb2NhdGUgbWVtb3J5IGZvciAiCisgICAgICAgICAgICAgICAgIlNJUl9IQUxfRU5DUllQVF9NU0dfUkVRIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgIH0KKworICAgIHZvc19tZW1fY29weShwRW5jcnlwdE1zZywgcENtZCwgbGVuZ3RoKTsKKworICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTID09IChzdGF0dXMgPSBzbWVfQWNxdWlyZUdsb2JhbExvY2soJnBNYWMtPnNtZSkpKSB7CisKKyAgICAgICAgcE1hYy0+c21lLnBFbmNNc2dJbmZvUGFyYW1zLnBFbmNNc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hbCApOworCisgICBzdGF0dXMgPSBzbWVfQWNxdWlyZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKTsKKyAgIGlmICggSEFMX1NUQVRVU19TVUNDRVNTKCBzdGF0dXMgKSApCisgICB7CisgICAgICAvKiBjaGVjayB3aGV0aGVyIG9mZiBjaGFubmVsIGlzIHZhbGlkIGFuZCBub24gREZTICovCisgICAgICBpZiAoY3NyUm9hbUlzQ2hhbm5lbFZhbGlkKHBNYWMsIGNoYW5uZWwpKQorICAgICAgeworICAgICAgICAgIGlmICghQ1NSX0lTX0NIQU5ORUxfREZTKGNoYW5uZWwpKQorICAgICAgICAgICAgICB2YWxpZCA9IFRSVUU7CisgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBjb25maWd1cmVkIGNoYW5uZWwgaXMgREZTIiwgX19mdW5jX18pOworICAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIGVsc2UgeworICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NNRSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiJXM6IGNvbmZpZ3VyZWQgY2hhbm5lbCBpcyBub3QgdmFsaWQiLCBfX2Z1bmNfXyk7CisgICAgICB9CisgICAgICBzbWVfUmVsZWFzZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKTsKKyAgIH0KKyAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TTUUsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAiJXM6IGN1cnJlbnQgY291bnRyeSBjb2RlICVjJWMgY2hhbm5lbCAlZCB2YWxpZCAlZCIsCisgICAgICAgICAgICAgIF9fZnVuY19fLCBwTWFjLT5zY2FuLmNvdW50cnlDb2RlQ3Vycm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X1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAiJXM6IGlzMjA0MEJTU0NvZXhFbmFibGVkICVkICIsCisgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgaXNUZGxzMjA0MEJTU0NvZXhFbmFibGVkKTsKKyAgICAgICAgcE1zZyA9IHZvc19tZW1fbWFsbG9jKHNpemVvZih0QW5pU2V0VGRsczIwNDBCU1NDb2V4KSk7CisgICAgICAgIGlmIChOVUxMID09IHBNc2cgKQorICAgICAgICB7CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HRSwgImZhaWxlZCB0byBhbGxvY2F0ZSBtZW0gZm9yIFNldFRkbHMyMDQwQlNTQ29leCIpOworICAgICAgICAgICAgc21lX1JlbGVhc2VHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisgICAgICAgICAgICByZXR1cm4gZUhBTF9TVEFUVVNfRkFJTFVSRTsKKyAgICAgICAgfQorCisgICAgICAgIHBNc2ctPm1zZ1R5cGUgPSBwYWxfY3B1X3RvX2JlMTYoCisgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VMTYpZVdOSV9TTUVfU0VUX1RETFNfMjA0MF9CU1NDT0VYX1JFUSk7CisgICAgICAgIHBNc2ctPm1zZ0xlbiA9ICh0QU5JX1UxNilzaXplb2YodEFuaVNldFRkbHMyMDQwQlNTQ29leCk7CisgICAgICAgIHBNc2ctPlNldFRkbHMyMDQwQlNTQ29leCA9IGlzVGRsczIwNDBCU1NDb2V4RW5hYmxlZDsKKworICAgICAgICBtc2cudHlwZSA9IGVXTklfU01FX1NFVF9URExTXzIwNDBfQlNTQ09FWF9SRVE7CisgICAgICAgIG1zZy5yZXNlcnZlZCA9IDA7CisgICAgICAgIG1zZy5ib2R5cHRyID0gcE1zZzsKKyAgICAgICAgbXNnLmJvZHl2YWwgPSAwOworCisgICAgICAgIGlmKFZPU19TVEFUVVNfU1VDQ0VTUyAhPSB2b3NfbXFfcG9zdF9tZXNzYWdlK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XVpcmVHbG9iYWxMb2NrKCZwTWFjLT5zbWUpOworCisgICAgaWYgKGVIQUxfU1RBVFVTX1NVQ0NFU1MgPT0gc3RhdHVzICYmCisgICAgICAgICAgICAgICAgICghc21lX0lzMTFkU3VwcG9ydGVkKGhIYWwpKSApCisgICAgeworICAgICAgICAgICBwTWFjLT5zY2FuLmZjY19jb25zdHJhaW50ID0gIWZjY19jb25zdHJhaW50OworICAgICAgICAgICAvKiB1cGRhdGUgdGhlIGNoYW5uZWwgbGlzdCB0byB0aGUgZmlybXdhcmUgKi8KKyAgICAgICAgICAgY3NyVXBkYXRlRkNDQ2hhbm5lbExpc3QocE1hYyk7CisKKyAgICB9CisKKyAgICAgICAgc21lX1JlbGVhc2VHbG9iYWxMb2NrKCZwTWFjLT5zbWUpOworCisgICAgcmV0dXJuIHN0YXR1czsKK30KKworZUhhbFN0YXR1cyBzbWVfZW5hYmxlRGlzYWJsZUNoYW5Bdm9pZEluZEV2ZW50KHRIYWxIYW5kbGUgaEhhbCwgdEFOSV9VOCBzZXRfdmFsdWUpCit7CisgICAgZUhhbFN0YXR1cyBzdGF0dXMgPSBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgIFZPU19TVEFUVVMgdm9zU3RhdHVzOworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSBQTUFDX1NUUlVDVChoSGFsKTsKKyAgICB2b3NfbXNnX3QgbXNnOworCisgICAgc21zTG9nKHBNYWMsIExPRzEsIEZMKCJzZXRfdmFsdWU6ICVkIiksIHNldF92YWx1ZSk7CisgICAgaWYgKCBlSEFMX1NUQVRVU19TVUNDRVNTID09ICBzbWVfQWNxdWlyZUdsb2JhbExvY2soICZwTWFjLT5zbWUgKSkKKyAgICB7CisgICAgICAgIHZvc19tZW1femVybygmbXNnLCBzaXplb2Yodm9zX21zZ190KSk7CisgICAgICAgIG1zZy50eXBlID0gV0RBX1NFTkRfRlJFUV9SQU5HRV9DT05UUk9MX0lORDsKKyAgICAgICAgbXNnLnJlc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AgIHsKKyAgICAgICAgICAgICAgICAvLyBGcmVlIHRoZSBvbmUgd2UgcmVjZWl2ZWQgbGFzdCBmcm9tIHRoZSBzdXBwbGljYW50CisgICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBNYWMtPmZ0LmZ0U21lQ29udGV4dC5hdXRoX2Z0X2llcyk7CisgICAgICAgICAgICAgICAgcE1hYy0+ZnQuZnRTbWVDb250ZXh0LmF1dGhfZnRfaWVzX2xlbmd0aCA9IDA7IAorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBTYXZlIHRoZSBGVCBJRXMKKyAgICAgICAgICAgIHBNYWMtPmZ0LmZ0U21lQ29udGV4dC5hdXRoX2Z0X2llcyA9IHZvc19tZW1fbWFsbG9jKGZ0X2llc19sZW5ndGgpOworICAgICAgICAgICAgaWYgKCBOVUxMID09IHBNYWMtPmZ0LmZ0U21lQ29udGV4dC5hdXRoX2Z0X2llcyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsIEZMKCJNZW1vcnkgYWxsb2NhdGlvbiBmYWlsZWQgZm9yICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImF1dGhfZnRfaWVzIikpOworICAgICAgICAgICAgICAgc21lX1JlbGVhc2VHbG9iYWxMb2NrKCAmcE1hYy0+c21lICk7CisgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwTWFjLT5mdC5mdFNtZUNvbnRleHQuYXV0aF9mdF9pZXNfbGVuZ3RoID0gZnRfaWVzX2xlbmd0aDsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSgodEFOSV9VOCAqKXBNYWMtPmZ0LmZ0U21lQ29udGV4dC5hdXRoX2Z0X2llcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZnRfaWVzLGZ0X2llc19sZW5ndGgpOworICAgICAgICAgICAgcE1hYy0+ZnQuZnRTbWVDb250ZXh0LkZUU3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dF9pZXMpOworICAgICAgICAgICAgICAgIHBNYWMtPmZ0LmZ0U21lQ29udGV4dC5yZWFzc29jX2Z0X2llc19sZW5ndGggPSAwOyAKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gU2F2ZSB0aGUgRlQgSUVzCisgICAgICAgICAgICBwTWFjLT5mdC5mdFNtZUNvbnRleHQucmVhc3NvY19mdF9pZXMgPSB2b3NfbWVtX21hbGxvYyhmdF9pZXNfbGVuZ3RoKTsKKyAgICAgICAgICAgIGlmICggTlVMTCA9PSBwTWFjLT5mdC5mdFNtZUNvbnRleHQucmVhc3NvY19mdF9pZXMgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0dFLCBGTCgiTWVtb3J5IGFsbG9jYXRpb24gZmFpbGVkIGZvciAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyZWFzc29jX2Z0X2llcyIpKTsKKyAgICAgICAgICAgICAgIHNtZV9SZWxlYXNlR2xvYmFsTG9jayggJnBNYWMtPnNtZSApOworICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcE1hYy0+ZnQuZnRTbWVDb250ZXh0LnJlYXNzb2NfZnRfaWVzX2xlbmd0aCA9IGZ0X2llc19sZW5ndGg7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoKHRBTklfVTggKilwTWFjLT5mdC5mdFNtZUNvbnRleHQucmVhc3NvY19mdF9pZXMsIGZ0X2llcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZnRfaWVzX2xlbmd0aCk7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICBwTWFjLT5mdC5mdFNtZUNvbnRleHQuRlRTdGF0ZSA9IGVGVF9TRVRfS0VZX1dBSVQ7CisjaWYgZGVmaW5lZCBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUl9ERUJVRworICAgICAgICAgICAgc21zTG9nKCBwTWFjLCBMT0cx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ZV9HZXRGVFByZUF1dGhTdGF0ZSAoaEhhbCkgPT0gVFJVRSkKKyAgICAgIHsKKyAgICAgICAgICBzdGF0dXMgPSBzbWVfRlRTZW5kVXBkYXRlS2V5SW5kKHBNYWMsIHBGVEtleUluZm8pOworICAgICAgICAgIGlmIChzdGF0dXMgIT0gMCApCisgICAgICAgICAgeworICAgICAgICAgICAgICBzbXNMb2coIHBNYWMsIExPR0UsICIlczogS2V5IHNldCBmYWlsdXJlICVkIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzKTsKKyAgICAgICAgICAgICAgcE1hYy0+ZnQuZnRTbWVDb250ZXh0LnNldEZUUFRLU3RhdGUgPSBGQUxTRTsKKyAgICAgICAgICAgICAgc3RhdHVzID0gZUhBTF9TVEFUVVNfRlRfUFJFQVVUSF9LRVlfRkFJTEVEOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgICBwTWFjLT5mdC5mdFNtZUNvbnRleHQuc2V0RlRQVEtTdGF0ZSA9IFRSVUU7CisgICAgICAgICAgICAgIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZUX1BSRUFVVEhfS0VZX1NVQ0NFU1M7CisgICAgICAgICAgICAgIHNtc0xvZyggcE1hYywgTE9HMSwgIiVzOiBLZXkgc2V0IHN1Y2Nlc3MiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgfQorICAgICAgICAgIHNtZV9TZXRGVFByZUF1dGhTdGF0ZShoSGFsLCBGQUxTRSk7CisgICAgICB9CisgICAgICBwTWFjLT5mdC5mdFNtZUNvbnRleHQuRlRTdGF0ZSA9IGVGVF9TVEFSVF9SRUFEWTsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUl9ERUJVRworICAgICAgc21zTG9nKCBwTWFjLCBMT0cxLCAiJXM6IHN0YXRlIGNoYW5nZWQgdG8gJWQgc3RhdHVzICVkIiwgX19mdW5jX18sCisgICAgICA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FTkNFIE9SIE9USEVSCisgKiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SCisgKiBQRVJGT1JNQU5DRSBPRiBUSElTIFNPRlRXQVJFLgorICovCisKKy8qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICBzbWVUcmFjZS5jCisKKyAgXGJyaWVmIGltcGxlbWVudGF0aW9uIGZvciB0cmFjZSByZWxhdGVkIEFQSXMKKworICBcYXV0aG9yIEtpcmFuIEt1bWFyIFJlZGR5IENIIEwgVgorCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisjaW5jbHVkZSAiYW5pR2xvYmFsLmgiIC8vZm9yIHRwQW5pU2lyR2xvYmFsCisjaW5jbHVkZSAic21zRGVidWcuaCIKKyNpbmNsdWRlICJtYWNUcmFjZS5oIgorI2luY2x1ZGUgInNtZV9UcmFjZS5oIgorI2luY2x1ZGUgInNtZUludGVybmFsLmgiCisjaWZuZGVmIFNNRV9UUkFDRV9SRUNPUkQKK3ZvaWQgc21lVHJhY2VJbml0KHRwQW5pU2lyR2xvYmFsIHBNYWMpCit7CisgICAgcmV0dXJuOworfQorI2VuZGlmCisjaWZkZWYgU01FX1RSQUNFX1JFQ09SRAorCisKK3N0YXRpYyB0QU5JX1U4KiBzbWVUcmFjZUdldFJ4TXNnU3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29tbWFuZE5vQVVwZGF0ZSk7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICByZXR1cm4oICJVTktOT1dOIiApOworICAgICAgICAgICAgYnJlYWs7CisgICAgfQorfQorc3RhdGljIHZvaWQgc21lVHJhY2VEdW1wKHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRwdm9zVHJhY2VSZWNvcmQgcFJlY29yZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTE2IHJlY0luZGV4KQoreworICAgIHN3aXRjaCAocFJlY29yZC0+Y29kZSkgeworICAgICAgICBjYXNlIFRSQUNFX0NPREVfU01FX0NPTU1BTkQ6CisgICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HMSwgIiUwNGQgJTAxMnUgUyVkICUtMTRzICUtMzBzKDB4JXgpIiwKKyAgICAgICAgICAgICAgICByZWNJbmRleCwgcFJlY29yZC0+dGltZSwgcFJlY29yZC0+c2Vzc2lvbiwgIlNNRSBDT01NQU5EOiIsCisgICAgICAgICAgICAgICAgIHNtZVRyYWNlR2V0Q29tbWFuZFN0cmluZyhwUmVjb3JkLT5kYXRhKSwgcFJlY29yZC0+ZGF0YSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBUUkFDRV9DT0RFX1NNRV9UWF9XREFfTVNHOgorICAgICAgICAgICBzbXNMb2cocE1hYywgTE9HMSwgIiUwNGQgJTAxMnUgUyVkICUtMTRzICUtMzBzKDB4JXgpIiwKKyAgICAgICAgICAgICAgICByZWNJbmRleCwgcFJlY29yZC0+dGltZSwgcFJlY29yZC0+c2Vzc2lvbiwgIlRYIFdEQSBNc2c6IiwKKyAgICAgICAgICAgICAgICBtYWNUcmFjZUdldFdkYU1zZ1N0cmluZygodEFOSV9VMTYpcFJlY29yZC0+ZGF0YSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJlY29yZC0+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AgICAgdWludDMyIGluZGljYXRvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzIgcmVhc29uX2NvZGUpOwordm9pZCB3bGFuX2dldF9sb2dfY29tcGxldGlvbih1aW50MzIgKmlzX2ZhdGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzIgKmluZGljYXRvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyICpyZWFzb25fY29kZSk7Citib29sIHdsYW5faXNfbG9nX3JlcG9ydF9pbl9wcm9ncmVzcyh2b2lkKTsKK3ZvaWQgd2xhbl9yZXNldF9sb2dfcmVwb3J0X2luX3Byb2dyZXNzKHZvaWQpOworCit2b2lkIHdsYW5fZGVpbml0X2xvZ19jb21wbGV0aW9uKHZvaWQpOworCit2b2lkIHdsYW5fbG9nZ2luZ19zZXRfbG9nX2xldmVsKHZvaWQpOworCitib29sIHdsYW5faXNfbG9nZ2VyX3RocmVhZChpbnQgdGhyZWFkSWQpOworI2VuZGlmIC8qIFdMQU5fTE9HR0lOR19TT0NLX1NWQ19IICovCmRpZmYgLS1naXQgYS93bGFuL3ByaW1hL0NPUkUvU1ZDL2luYy93bGFuX25saW5rX3Nydi5oIGIvd2xhbi9wcmltYS9DT1JFL1NWQy9pbmMvd2xhbl9ubGlua19zcnYuaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zNjkzMzJkCi0tLSAvZGV2L251bGwKKysrIGIvd2xhbi9wcmltYS9DT1JFL1NWQy9pbmMvd2xhbl9ubGlua19zcnYuaApAQCAtMCwwICsxLDY2IEBACisvKgorICogQ29weXJpZ2h0IChjKSAyMDEyLTIwMTUgVGhlIExpbnV4IEZvdW5kYXRpb24uIEFsbCByaWdodHMgcmVzZXJ2ZWQuCisgKgorICogUHJldmlvdXNseSBsaWNlbnNlZCB1bmRlciB0aGUgSVNDIGxpY2Vuc2UgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICoK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1lc3NhZ2UKKyAqLwordHlwZWRlZiBzdHJ1Y3Qgc0FuaU5sTXNnIHsKKyAgICBzdHJ1Y3QgIG5sbXNnaGRyIG5saDsgICAgICAgICAgICAgLy8gTmV0bGluayBIZWFkZXIKKyAgICBpbnQgcmFkaW87ICAgICAgICAgICAgICAgICAgICAgICAgLy8gdW5pdCBudW1iZXIgb2YgdGhlIHJhZGlvCisgICAgdEFuaUhkciB3bXNnOyAgICAgICAgICAgICAgICAgICAgIC8vIEFpcmdvIE1lc3NhZ2UgSGVhZGVyCit9IHRBbmlObEhkcjsKK3R5cGVkZWYgc3RydWN0IHNBbmlObE1nbXRMb2dNc2cgeworICAgIHN0cnVjdCAgbmxtc2doZHIgbmxoOworICAgIGludCByYWRpbzsKKyAgICB0QW5pSGRyIHdtc2c7CisgICAgdWludDMyIGZyYW1lU2l6ZTsKK30gdEFuaU5sTG9nSGRyOwordHlwZWRlZiBzdHJ1Y3Qgc0FuaUFwcFJlZ1JlcSB7CisgICAgdEFuaU5sTW9kVHlwZXMgdHlwZTsgICAgICAgICAgICAgIC8vIG1vZHVsZSBpZAorICAgIGludCBwaWQ7ICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBwcm9jZXNzIGlkCit9IHRBbmlObEFwcFJlZ1JlcTsKK3R5cGVkZWYgc3RydWN0IHNBbmlObEFwcFJlZ1JzcCB7CisgICAgc3RydWN0IG5sbXNnaGRyIG5saDsgICAgICAgICAgICAgIC8vIE5ldExpbmsgTXNnIEhlYWRlcgorICAgIGludCByYWRpbzsgICAgICAgICAgICAgICAgICAgICAgICAvLyBSYWRpbyB1bml0CisgICAgdEFuaUhkciB3bmlIZHI7ICAgICAgICAgICAgICAgICAgIC8vIEdlbmVyaWMgV05JIG1zZyBoZWFkZXIKKyAgICB0QW5pTmxBcHBSZWdSZXEgcmVnUmVxOyAgICAgICAgICAgLy8gVGhlIG9yaWdpbmFsIHJlcXVlc3QgbXNnCisgICAgaW50IHJldDsgICAgICAgICAgICAgICAgIC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SERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAgICAgICAgICJXaUZpIHVuYXNzb2NpYXRlZDsgZ0FtcENoYW5uZWwgJWQgZ1dpRmlDaGFubmVsICVkIiwgZ0FtcENoYW5uZWwsIGdXaUZpQ2hhbm5lbCk7CisKKyAgICAgICAgIC8qIElmIEFNUCBpcyB1c2luZyBhIGNoYW5uZWwgKG5vbi16ZXJvKSwgbm8gbWVzc2FnZSBzZW50LgorICAgICAgICAgICAgT3IsIGlmIFdpRmkgd2Fzbid0IHVzaW5nIGEgY2hhbm5lbCBiZWZvcmUsIG5vIG1lc3NhZ2Ugc2VudC4KKyAgICAgICAgICAgIExvZ2ljIHByZXN1bWVzIHNhbWUgY2hhbm5lbCBoYXMgdG8gYmUgdXNlZCBmb3IgV2lGaSBhbmQgQU1QIGlmIGJvdGggYXJlIGFjdGl2ZS4KKyAgICAgICAgICAgIEluIGFueSBjYXNlLCB0cmFjayB0aGUgV2lGaSBjaGFubmVsIGluIHVzZSAobm9uZSkgKi8KKyAgICAgICAgIGlmKChnQW1wQ2hhbm5lbCAhPSAwKSB8fCAoZ1dpRmlDaGFubmVsID09IDApKQorICAgICAgICAgeworICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAgICAgICAgICAgIk5vIG1zZyBmb3IgQUZIIHdpbGwgYmUgc2VudCIpOworICAgICAgICAgICAgZ1dpRmlDaGFubmVsID0gMDsKKyAgICAgICAgICAgIGtmcmVlX3NrYihza2IpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgfQorICAgICAgICAgZ1dpRmlDaGFubmVsID0gMDsKKworICAgICAgICAgLyogTm8gQnJlYWs6IEZhbGwgaW50byBuZXh0IGNhc2VzICovCisKKyAgICAgIGNhc2UgV0xBTl9NT0RVTEVfVVBfSU5EOgorICAgICAgY2FzZSBXTEFOX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gIC8qIElmIFdpRmkgaGFzIGZpbmlzaGVkIGFzc29jaWF0aW5nICovCisgICAgICAgICBpZih0eXBlID09IFdMQU5fU1RBX0FTU09DX0RPTkVfSU5EKQorICAgICAgICAgeworICAgICAgICAgICAvKiBJZiBBTVAgaXMgdXNpbmcgYSBjaGFubmVsIChub24temVybyksIG5vIG1lc3NhZ2Ugc2VudC4KKyAgICAgICAgICAgICAgT3IsIGlmIHRoZSBXaUZpIGNoYW5uZWwgZGlkIG5vdCBjaGFuZ2UsIG5vIG1lc3NhZ2Ugc2VudC4KKyAgICAgICAgICAgICAgTG9naWMgcHJlc3VtZXMgc2FtZSBjaGFubmVsIGhhcyB0byBiZSB1c2VkIGZvciBXaUZpIGFuZCBBTVAgaWYgYm90aCBhcmUgYWN0aXZlLgorICAgICAgICAgICAgICBJbiBhbnkgY2FzZSwgdHJhY2sgdGhlIFdpRmkgY2hhbm5lbCBpbiB1c2UgKDEtMTMgb3Igbm9uZSwgaW4gYXNzb2NEYXRhLT5jaGFubmVsKSAqLworICAgICAgICAgICBpZigoZ0FtcENoYW5uZWwgIT0gMCkgfHwgKGFzc29jRGF0YS0+Y2hhbm5lbCA9PSBnV2lGaUNoYW5uZWwpKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgICAgICAgICAgICAgIk5vIG1zZyBmb3IgQUZIIHdpbGwgYmUgc2VudCIpOworICAgICAgICAgICAgIGdXaUZpQ2hhbm5lbCA9IGFzc29jRGF0YS0+Y2hhbm5lbDsKKyAgICAgICAgICAgICBrZnJlZV9za2Ioc2tiKTsKKyAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgICAgIGlmKHR5cGUgPT0gV0xBTl9CVENfU09GVEFQX0JTU19TVEFSVCkKKyAgICAgICAgIHsKKyAgICAgICAgIC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oY2hhciopYW5pSGRyICsgc2l6ZW9mKHRBbmlNc2dIZHIpKTsKKyAgICAgICAgICAgYXNzb2NEYXRhLT5jaGFubmVsID0gZGVzdF9waWQ7CisgICAgICAgICAgIHNrYl9wdXQoc2tiLCBOTE1TR19TUEFDRSgoc2l6ZW9mKHRBbmlNc2dIZHIpKyBzaXplb2YodFdsYW5Bc3NvY0RhdGEpKSkpOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICBhbmlIZHItPnR5cGUgPSBXTEFOX1NUQV9ESVNBU1NPQ19ET05FX0lORDsKKyAgICAgICAgICAgYW5pSGRyLT5sZW5ndGggPSAwOworICAgICAgICAgICBubGgtPm5sbXNnX2xlbiA9IE5MTVNHX0xFTkdUSCgoc2l6ZW9mKHRBbmlNc2dIZHIpKSk7CisgICAgICAgICAgIHNrYl9wdXQoc2tiLCBOTE1TR19TUEFDRShzaXplb2YodEFuaU1zZ0hkcikpKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGRlc3RfcGlkID0gMDsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBkZWZhdWx0OgorICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICJCVEM6IEF0dGVtcHQgdG8gc2VuZCB1bmtub3duIG5saW5rIG1lc3NhZ2UgJWRcbiIsIHR5cGUpOworICAgICAgICAga2ZyZWVfc2tiKHNrYik7CisgICAgICAgICByZXR1cm47CisgICB9CisgICBpZihkZXN0X3BpZCA9PSAwKQorICAgICAgKHZvaWQpbmxfc3J2X2JjYXN0KHNrYik7CisgICBlbHNlCisgICAgICAodm9pZClubF9zcnZfdWNhc3Qoc2tiLCBkZXN0X3BpZCwgTVNHX0RPTlRXQUlUKTsKK30KKy8qCisgKiBBY3RpdmF0ZSBCVEMgaGFuZGxlci4gVGhpcyB3aWxsIHJlZ2lzdGVyIGEgaGF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FTF9JTkZPLCAKKyAgICAgICAgICAgICJCVEM6IFJlY2VpdmVkIHByb2JlIGZyb20gQlRDIFNlcnZpY2VcbiIpOworICAgICAgICAgc2VuZF9idGNfbmxpbmtfbXNnKFdMQU5fQlRDX1FVRVJZX1NUQVRFX1JTUCwgbmxoLT5ubG1zZ19waWQpOworICAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIFdMQU5fQlRDX0JUX0VWRU5UX0lORDoKKyAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCAKKyAgICAgICAgICAgICJCVEM6IFJlY2VpdmVkIEJsdWV0b290aCBldmVudCBpbmRpY2F0aW9uXG4iKTsKKyAgICAgICAgIGlmKG1zZ19oZHItPmxlbmd0aCAhPSBzaXplb2YodFNtZUJ0RXZlbnQpKSB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiQlRDOiBTaXplIG1pc21hdGNoIGluIEJUIGV2ZW50IGRhdGFcbiIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisgICAgICAgICBidEV2ZW50ID0gKHRTbWVCdEV2ZW50KikoKGNoYXIqKW1zZ19oZHIgKyBzaXplb2YodEFuaU1zZ0hkcikpOworICAgICAgICAgKHZvaWQpc21lX0J0Y1NpZ25hbEJ0RXZlbnQocEhkZEN0eC0+aEhhbCwgYnRFdmVudCk7CisgICAgICAgICBicmVhazsKKyAgICAgIGRlZmF1bHQ6CisgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAiQlRDOiBSZWNlaXZlZCBJbnZhbGlkIE1zZyB0eXBlIFslZF1cbiIsIG1zZ19oZHItPnR5cGUpOworICAgICAgICAgYnJlYWs7CisgICB9CisgIC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1QsIE9SIENPTlNFUVVFTlRJQUwKKyAqIERBTUFHRVMgT1IgQU5ZIERBTUFHRVMgV0hBVFNPRVZFUiBSRVNVTFRJTkcgRlJPTSBMT1NTIE9GIFVTRSwgREFUQSBPUgorICogUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1IgT1RIRVIKKyAqIFRPUlRJT1VTIEFDVElPTiwgQVJJU0lORyBPVVQgT0YgT1IgSU4gQ09OTkVDVElPTiBXSVRIIFRIRSBVU0UgT1IKKyAqIFBFUkZPUk1BTkNFIE9GIFRISVMgU09GVFdBUkUuCisgKi8KKworLyoKKyAqIFRoaXMgZmlsZSB3YXMgb3JpZ2luYWxseSBkaXN0cmlidXRlZCBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogd2xhbl9ubGlua19zcnYuYworKgorKiBUaGlzIGZpbGUgY29udGFpbnMgdGhlIGRlZmluaXRpb25zIHNwZWNpZmljIHRvIHRoZSB3bGFuX25saW5rX3NydgorKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaW5jbHVkZSA8bGludXgvdmVyc2lvbi5oPgorI2luY2x1ZGUgPGxpbnV4L2tlcm5lbC5oPgorI2luY2x1ZGUgPGxpbnV4L21vZHVsZS5oPgorI2luY2x1ZGUgPGxpbnV4L2luaXQuaD4KKyNpbmNsdWRlIDxsaW51eC9uZXRkZXZpY2UuaD4KKyNpbmN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2tfYnVmZiAqc2spCit7CisgICBtdXRleF9sb2NrKCZubF9zcnZfc2VtKTsKKyAgIG5sX3Nydl9yY3Zfc2tiKHNrKTsKKyAgIG11dGV4X3VubG9jaygmbmxfc3J2X3NlbSk7Cit9CisKKy8qCisgKiBFYWNoIHNrYiBjb3VsZCBjb250YWluIG11bHRpcGxlIE5ldGxpbmsgbWVzc2FnZXMuIFByb2Nlc3MgYWxsIHRoZQorICogbWVzc2FnZXMgaW4gb25lIHNrYiBhbmQgZGlzY2FyZCBtYWxmb3JtZWQgc2tiJ3Mgc2lsZW50bHkuCisgKi8KK3N0YXRpYyB2b2lkIG5sX3Nydl9yY3Zfc2tiIChzdHJ1Y3Qgc2tfYnVmZiAqc2tiKQoreworICAgc3RydWN0IG5sbXNnaGRyICogbmxoOworCisgICB3aGlsZSAoc2tiLT5sZW4gPj0gTkxNU0dfU1BBQ0UoMCkpIHsKKyAgICAgIHUzMiBybGVuOworCisgICAgICBubGggPSAoc3RydWN0IG5sbXNnaGRyICopc2tiLT5kYXRhOworCisgICAgICBpZiAobmxoLT5ubG1zZ19sZW4gPCBzaXplb2YoKm5saCkgfHwgc2tiLT5sZW4gPCBubGgtPm5sbXNnX2xlbikgeworICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sICJOTElOSzogSW52YWxpZCAiCisgICAgICAgICAgICAiTmV0bGluayBtZXNzYWdlOiBza2JbJXBdLCBsZW5bJWRdLCBubGhkclslcF0sIG5sbXNnX2xlblslZF0iLAorICAgICAgICAgICAgc2tiLCBza2ItPmxlbiwgbmxoLCBubGgtPm5sbXNnX2xlbik7CisgICAgICAgICByZXR1cm47CisgICAgICB9CisKKyAgICAgIHJsZW4gPSBOTE1TR19BTElHTihubGgtPm5sbXNnX2xlbik7CisgICAgICBpZiAocmxlbiA+IHNrYi0+bGVuKQorICAgICAgICAgcmxlbiA9IHNrYi0+bGVuOworICAgICAgbmx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yAgICAgICAgIGNhc2UgUFRUX01TR19SRUFEX1JFR0lTVEVSOgorICAgICAgICAgICAgcmVnX2FkZHIgPSAqKHZfVTMyX3QqKSAoKGNoYXIqKXdtc2cgKyA4KTsKKyAgICAgICAgICAgIFBUVF9UUkFDRShWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIiVzOiBQVFRfTVNHX1JFQURfUkVHSVNURVIgWzB4JTA4WF1cbiIsCisgICAgICAgICAgICAgICBfX2Z1bmNfXywgcmVnX2FkZHIpOworICAgICAgICAgICAgdm9zU3RhdHVzID0gc21lX0RiZ1JlYWRSZWdpc3RlcihwQWRhcHRlckhhbmRsZS0+aEhhbCwgcmVnX2FkZHIsICZyZWdfdmFsKTsKKyAgICAgICAgICAgICoodl9VMzJfdCopICgoY2hhciopd21zZyArIDEyKSA9IHJlZ192YWw7CisgICAgICAgICAgICBpZih2b3NTdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgICAgUFRUX1RSQUNFKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiBSZWFkIFJlZ2lzdGVyIFsweCUwOFhdIGZhaWxlZCEhXG4iLAorICAgICAgICAgICAgICAgX19mdW5jX18sIHJlZ19hZGRyKTsKKyAgICAgICAgICAgIHB0dF9zb2NrX3NlbmRfbXNnX3RvX2FwcCh3bXNnLCAwLCBBTklfTkxfTVNHX1BVTUFDLCB3bmwtPm5saC5ubG1zZ19waWQsIE1TR19ET05UV0FJVCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIGNhc2UgUFRUX01TR19XUklURV9SRUdJU1RFUjoKKyAgICAgICAgICAgIHJlZ19hZGRyID0gKih2X1UzMl90KikgKChjb25zdCB1bnNpZ25lZCBjaGFyKil3bXNnICsgOCk7CisgICAgICAgICAgICByZWdfdmFsID0gKih2X1UzMl90KikoKGNvbnN0IHVuc2lnbmVkIGNoYXIqKXdtc2cgKyAxMik7CisgICAgICAgICAgICBQVFRfVFJBQ0UoVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczogUFRUX01TR19XUklURV9SRUdJU1RFUiBBZGRyIFsweCUwOFhdIHZhbHVlIFsweCUwOFhdXG4iLAorICAgICAgICAgICAgICAgX19mdW5jX18sIHJlZ19hZGRyLCByZWdfdmFsKTsKKyAgICAgICAgICAgIHZvc1N0YXR1cyA9IHNtZV9EYmdXcml0ZVJlZ2lzdGVyKHBBZGFwdGVySGFuZGxlLT5oSGFsLCByZWdfYWRkciwgcmVnX3ZhbCk7CisgICAgICAgICAgICBpZih2b3NTdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgUFRUX1RSQUNFKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiBXcml0ZSBSZWdpc3RlciBbMHglMDhYXSB2YWx1ZSBbMHglMDhYXSBmYWlsZWQhIVxuIiwKKyAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCByZWdfYWRkciwgcmVnX3ZhbCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvL3NlbmQgbWVzc2FnZSB0byB0aGUgYXBwCisgICAgICAgICAgICBwdHRfc29ja19zZW5kX21zZ190b19hcHAod21zZywgMCwgQU5JX05MX01TR19QVU1BQywgd25sLT5ubGgubmxtc2dfcGlkLCBNU0dfRE9OVFdBSVQpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICBjYXNlIFBUVF9NU0dfUkVBRF9NRU1PUlk6CisgICAgICAgICAgICByZWdfYWRkciA9ICoodl9VMzJfdCopICgoY2hhciopd21zZyArIDgpOworICAgICAgICAgICAgbGVuX3BheWxvYWQgPSAqKHZfVTMyX3QqKSAoKGNoYXIqKXdtc2cgKyAxMik7CisgICAgICAgICAgICBQVFRfVFJBQ0UoVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczogUFRUX01TR19SRUFEX01FTU9SWSBhZGRyIFsweCUwOFhdIGJ5dGVzIFsweCUwOFhdXG4iLAorICAgICAgICAgICAgICAgX19mdW5jX18sIHJlZ19hZGRyLCBsZW5fcGF5bG9hZCk7CisgICAgICAgICAgICBidWYgPSAodl9VOF90Kil3bXNnICsgMTY7CisgICAgICAgICAgICB2b3NTdGF0dXMgPSBzbWVfRGJnUmVhZE1lbW9yeShwQWRhcHRlckhhbmRsZS0+aEhhbCwgcmVnX2FkZHIsIGJ1ZiwgbGVuX3BheWxvYWQpOworICAgICAgICAgICAgaWYodm9zU3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUykgeworICAgICAgICAgICAgICAgUFRUX1RSQUNFKFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiBNZW1vcnkgcmVhZCBmYWlsZWQgZm9yIFsweCUwOFhdISFcbiIsCisgICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcmVnX2FkZHIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcHR0X3NvY2tfc3dhcF8zMihidWYsIGxlbl9wYXlsb2FkKTsKKyAgICAgICAgICAgIC8vc2VuZCBtZXNzYWdlIHRvIHRoZSBhcHAKKyAgICAgICAgICAgIHB0dF9zb2NrX3NlbmRfbXNnX3RvX2FwcCh3bXNnLCAwLCBBTklfTkxfTVNHX1BVTUFDLCB3bmwtPm5saC5ubG1zZ19waWQsIE1TR19ET05UV0FJVCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIGNhc2UgUFRUX01TR19XUklURV9NRU1PUlk6CisgICAgICAgICAgICByZWdfYWRkciA9ICoodl9VMzJfdCopICgoY2hhciopd21zZyArIDgpOworICAgICAgICAgICAgbGVuX3BheWxvYWQgPSAqKHZfVTMyX3QqKSAoKGNoYXIqKXdtc2cgKyAxMik7CisgICAgICAgICAgICBQVFRfVFJBQ0UoVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczogUFRUX01TR19EQkdfV1JJVEVfTUVNT1JZIGFkZHIgWzB4JTA4WF0gYnl0ZXMgWzB4JTA4WF1cbiIsCisgICAgICAgICAgICAgICBfX2Z1bmNfXywgcmVnX2FkZHIsIGxlbl9wYXlsb2FkKTsKKyAgICAgICAgICAgIGJ1ZiA9ICh2X1U4X3QqKXdtc2cgKyAxNjsKKyAgICAgICAgICAgIHB0dF9zb2NrX3N3YXBfMzIoYnVmLCBsZW5fcGF5bG9hZCk7CisgICAgICAgICAgICB2b3NTdGF0dXMgPSBzbWVfRGJnV3JpdGVNZW1vcnkocEFkYXB0ZXJIYW5kbGUtPmhIYWwsIHJlZ19hZGRyLCBidWYsIGxlbl9wYXlsb2FkKTsKKyAgICAgICAgICAgIGlmKHZvc1N0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBQVFRfVFJBQ0UoVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IE1lbW9yeSB3cml0ZSBmYWlsZWQgZm9yIGFkZHIgWzB4JTA4WF0hIVxuIiwKKyAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCByZWdfYWRkcik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvL3NlbmQgbWVzc2FnZSB0byB0aGUgYXBwCisgICAgICAgICAgICBwdHRfc29ja19zZW5kX21zZ190b19hcHAod21zZywgMCwgQU5JX05MX01TR19QVU1BQywgd25sLT5ubGgubmxtc2dfcGlkLCBNU0dfRE9OVFdBSVQpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICBjYXNlIFBUVF9NU0dfTE9HX0RVTVBfREJHOgorICAgICAgICAgICAgY21kID0gKih1bnNpZ25lZCBpbnQgKikgKChjaGFyICopd21zZyArIDgpOworICAgICAgICAgICAgYXJnMSA9ICoodW5zaWduZWQgaW50ICopICgoY2hhciAqKXdtc2cgKyAxMik7CisgICAgICAgICAgICBhcmcyID0gKih1bnNpZ25lZCBpbnQgKikgKChjaGFyICopd21zZyArIDE2KTsKKyAgICAgICAgICAgIGFyZzMgPSAqKHVuc2lnbmVkIGludCAqKSAoKGNoYX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5rX21zZyAoc3RydWN0IHNrX2J1ZmYgKiBza2IpCit7CisgICB0QW5pTmxIZHIgKndubDsKKyAgIGludCByYWRpbzsKKyAgIGludCB0eXBlOworICAgd25sID0gKHRBbmlObEhkciAqKSBza2ItPmRhdGE7CisgICByYWRpbyA9IHdubC0+cmFkaW87CisgICB0eXBlID0gd25sLT5ubGgubmxtc2dfdHlwZTsKKyAgIHN3aXRjaCAodHlwZSkgeworICAgICAgY2FzZSBBTklfTkxfTVNHX1BVTUFDOiAgLy9NZXNzYWdlIGZyb20gdGhlIFBUVCBzb2NrZXQgQVBQCisgICAgICAgICBQVFRfVFJBQ0UoVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczogUmVjZWl2ZWQgQU5JX05MX01TR19QVU1BQyBNc2cgWzB4JVhdXG4iLAorICAgICAgICAgICAgX19mdW5jX18sIHR5cGUpOworICAgICAgICAgcHR0X3Byb2NfcHVtYWNfbXNnKHNrYiwgJndubC0+d21zZywgcmFkaW8pOworICAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIEFOSV9OTF9NU0dfUFRUOiAvL01lc3NhZ2UgZnJvbSBRdWFya3kgR1VJCisgICAgICAgICBQVFRfVFJBQ0UoVk9TX1RSQUNFX0xFVkVMX0lORk8sICIlczogUmVjZWl2ZWQgQU5JX05MX01TR19QVFQgTXNnIFsweCVYXVxuIiwKKyAgICAgICAgICAgIF9fZnVuY19fLCB0eXBlKTsKKyAgICAgICAgIHB0dF9wcm9jX3F1YXJreV9tc2cod25sLCAmd25sLT53bXNnLCByYWRpbyk7CisgICAgICAgICBicmVhazsKKyAgICAgIGRlZmF1bHQ6CisgICAgICAgICBQVFRfVFJBQ0UoVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IFVua25vd24gTkwgTXNnIFsweCVYXVxuIixfX2Z1bmNfXywgdHlwZSk7CisgICAgICAgICBicmVhazsKKyAgIH0KKyAgIHJldHVybiAwOworfQoraW50IHB0dF9zb2NrX2FjdGl2YXRlX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91bmRhdGlvbi4KKyAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICBXIEwgQSBOICAgUyBZIFMgVCBFIE0gICBNIE8gRCBVIEwgRQorCisKK0RFU0NSSVBUSU9OCisgIFRoaXMgZmlsZSBjb250YWlucyB0aGUgc3lzdGVtIG1vZHVsZSB0aGF0IGltcGxlbWVudHMgdGhlICdleGVjdHV0aW9uIG1vZGVsJworICBpbiB0aGUgR2VuNiBob3N0IHNvZnR3YXJlLgorCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICBFRElUIEhJU1RPUlkgRk9SIEZJTEUKKworCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLgorICBOb3RpY2UgdGhhdCBjaGFuZ2VzIGFyZSBsaXN0ZWQgaW4gcmV2ZXJzZSBjaHJvbm9sb2dpY2FsIG9yZGVyLgorCisKKyAgJEhlYWRlcjokICREYXRlVGltZTogJCAkQXV0aG9yOiAkCisKKword2hlbiAgICAgICAgd2hvICAgICAgICAgd2hhdCwgd2hlcmUsIHdoeQorLS0tLS0tLS0gICAgLS0tICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKzEyLzE1LzA4ICAgIHNobyAgICAgICAgIFJlc29sdmVkIEFNU1MgY29tcGlsZXIgZXJyb3JzIGFuZCB3YXJuaW5ncyB3aGVuIHRoaXMKKyAgICAgIC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9sRmlsZUNoa1N1bSggKCB2X1UxNl90ICopcEltYWdlLCBjYkZpbGUgLyBzaXplb2YoIHZfVTE2X3QgKSApICkKKyAgICAgIHsKKyAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TWVMsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIkZhaWxlZCB0byB2YWxpZGF0ZSB0aGUgY2hlY2tzdW0gZm9yIENGRyBiaW5hcnkiICApOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisKKyAgICAgIHBGaWxlSGVhZGVyID0gKHRQb2xGaWxlSGVhZGVyICopcEltYWdlOworCisgICAgICAqcHBTdGFDb25maWcgPSBOVUxMOworICAgICAgKnBjYlN0YUNvbmZpZyA9IDA7CisKKyAgICAgIHBEaXJFbnRyeSA9ICggdFBvbEZpbGVEaXJFbnRyeSogKSAoIHBGaWxlSGVhZGVyICsgMSApOworCisgICAgICBmb3IgKCBpZHggPSAwOyBpZHggPCBwRmlsZUhlYWRlci0+TnVtRGlyZWN0b3J5RW50cmllczsgKytpZHggKQorICAgICAgeworICAgICAgICAgaWYgKCBlUE9MX0RJUl9UWVBFX1NUQV9DT05GSUcgPT0gcERpckVudHJ5WyBpZHggXS5EaXJFbnRyeVR5cGUgKQorICAgICAgICAgeworICAgICAgICAgICAgKnBwU3RhQ29uZmlnID0gcERpckVudHJ5WyBpZHggXS5EaXJFbnRyeUZpbGVPZmZzZXQgKyAoIHZfVThfdCAqIClwRmlsZUhlYWRlcjsKKworICAgICAgICAgICAgKnBjYlN0YUNvbmZpZyA9IHBEaXJFbnRyeVsgaWR4IF0uRGlyRW50cnlMZW5ndGg7CisKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgfQorCisgICAgICB9IC8vIEVuZCBpdGVyYXRpb24gb3ZlciB0aGUgaGVhZGVyJ3MgZW50cmllcworCisgICAgICBpZiAoIE5VTEwgIT0gKnBwU3RhQ29uZmlnICApCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU1lTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAgICAgICAgICJGb3VuZCB0aGUgU3RhdGlvbiBDRkcgaW4gdGhlIENGRyBiaW5hcnkhISIgKTsKKworICAgICAgICAgZkZvdW5kID0gVk9TX1RSVUU7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU1lTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICJGYWlsZWQgdG8gZmluZCBTdGF0aW9uIENGRyBpbiB0aGUgQ0ZHIGJpbmFyeSIgKTsKKyAgICAgIH0KKworICAgfSB3aGlsZSggMCApOworCisgICBWT1NfQVNTRVJUKCBWT1NfVFJVRSA9PSBmRm91bmQgKTsKKworICAgcmV0dXJuKCBmRm91bmQgKTsKK30KKworCisKKworCisKKworCisKKworVk9TX1NUQVRVUyBzeXNNY1Byb2Nlc3NNc2coIHZfQ09OVEVYVF90IHBWb3NDb250ZXh0LCB2b3NfbXNnX3QgKnBNc2cgKQoreworICAgVk9TX1NUQVRVUyB2b3NTdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICB2X1ZPSURfdCAqaEhhbDsKKworICAgaWYgKE5VTEwgPT0gcE1zZykKKyAgIHsKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TWVMsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICIlczogTlVMTCBwb2ludGVyIHRvIHZvc19tc2dfdCIsIF9fZnVuY19fKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICB9CisKKyAgIC8vIEFsbCAnbmV3JyBTWVMgbWVzc2FnZXMgYXJlIGlkZW50aWZpZWQgYnkgY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AgICAgICAgICAgIGJyZWFrOworICAgICAgICAgfQorCisgICAgICAgICBjYXNlIFNZU19NU0dfSURfTUNfU1RPUDoKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TWVMsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAiUHJvY2Vzc2luZyBTWVMgTUMgU1RPUCIgKTsKKworICAgICAgICAgICAgLy8gZ2V0IHRoZSBIQUwgY29udGV4dC4uLgorICAgICAgICAgICAgaEhhbCA9IHZvc19nZXRfY29udGV4dCggVk9TX01PRFVMRV9JRF9QRSwgcFZvc0NvbnRleHQgKTsKKyAgICAgICAgICAgIGlmIChOVUxMID09IGhIYWwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU1lTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogSW52YWxpZCBoSGFsIiwgX19mdW5jX18gKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHZvc1N0YXR1cyA9IHNtZV9TdG9wKCBoSGFsLCBIQUxfU1RPUF9UWVBFX1NZU19ERUVQX1NMRUVQKTsKKyAgICAgICAgICAgICAgIFZPU19BU1NFUlQoIFZPU19JU19TVEFUVVNfU1VDQ0VTUyggdm9zU3RhdHVzICkgKTsKKworICAgICAgICAgICAgICAgdm9zU3RhdHVzID0gbWFjU3RvcCggaEhhbCwgSEFMX1NUT1BfVFlQRV9TWVNfREVFUF9TTEVFUCApOworICAgICAgICAgICAgICAgVk9TX0FTU0VSVCggVk9TX0lTX1NUQVRVU19TVUNDRVNTKCB2b3NTdGF0dXMgKSApOworCisgICAgICAgICAgICAgICAoKHN5c1Jlc3BvbnNlQ2JhY2spcE1zZy0+Y2FsbGJhY2spKCh2X1ZPSURfdCAqKXBNc2ctPmJvZHlwdHIpOworCisgICAgICAgICAgICAgICB2b3NTdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIH0KKworICAgICAgICAgLy8gUHJvY2VzcyBNQyB0aHJlYWQgcHJvYmUuICBKdXN0IGNhbGxiYWNrIHRvIHRoZQorICAgICAgICAgLy8gZnVuY3Rpb24gdGhhdCBpcyBpbiB0aGUgbWVzc2FnZS4KKyAgICAgICAgIGNhc2UgU1lTX01TR19JRF9NQ19USFJfUFJPQkU6CisgICAgICAgICB7CisjaWZkZWYgV0xBTl9MT0dHSU5HX1NPQ0tfU1ZDX0VOQUJMRQorICAgICAgICAgICAgIGlmKHBNc2ctPmNhbGxiYWNrKQorICAgICAgICAgICAgICAgICgoc3lzVGhyZWFkUHJvYmVDYmFjaylwTXNnLT5jYWxsYmFjaykoY3VycmVudC0+cGlkKTsKKyNlbmRpZgorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisKKyAgICAgICAgIGNhc2UgU1lTX01TR19JRF9NQ19USU1FUjoKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHZvc190aW1lcl9jYWxsYmFja190IHRpbWVyQ0IgPSBwTXNnLT5jYWxsYmFjazsKKworICAgICAgICAgICAgaWYgKE5VTEwgIT0gdGltZXJDQikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICB0aW1lckNCKHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgICAgdm9zX3Nzcl91bnByb3RlY3QoX19mdW5jX18pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisgICAgICAgICBjYXNlIFNZU19NU0dfSURfRlRNX1JTUDoKKyAgICAgICAgIHsKKyAgICAgICAgICAgICBXTEFORlRNX01jUHJvY2Vzc01zZygodl9WT0lEX3QgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIH0KKyAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU1lTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICJVbmtub3duIG1lc3NhZ2UgdHlwZSBpbiBzeXNNY1Byb2Nlc3NNc2coKSBtc2dUeXBlPSAlZCBbMHglMDh4XSIsCisgICAgICAgICAgICAgICAgICAgICAgIHBNc2ctPnR5cGUsIHBNc2ctPnR5cGUgKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgIH0gICAvLyBlbmQgc3dpdGNoIG9uIG1lc3NhZ2UgdHlwZQorCisgICB9ICAgLy8gZW5kIGlmIGNvb2tpZSBzZXQKKyAgIGVsc2UKKyAgIHsKKyAgICAgIC8vIFByb2Nlc3MgYWxsICdsZWdhY3knIG1lc3NhZ2VzCisgICAgICBzd2l0Y2goIHBNc2ctPnR5cGUgKQorICAgICAgeworCisgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgeworICAgICAgICAgICAgVk9TX0FTU0VSVCggMCApOworCisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU1lTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICJSZWNlaXZlZCBTWVMgbWVzc2FnZSBjb29raWUgd2l0aCB1bmlkZW50aWZpZWQgIgorICAgICAgICAgICAgICAgICAgICAgICAiTUMgbWVzc2FnZSB0eXBlPSAlZCBbMHglMDhYXSIsIHBNc2ctPnR5cGUsIHBNc2ctPnR5cGUgKTsKKworICAgICAgICAgICAgdm9zU3RhdHVzID0gVk9TX1NUQVRVU19FX0JBRE1TRzsKKyAgICAgICAgICAgIGlmIChwTXNnLT5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RoaXMgY29va2llIGluIHRoZSByZXNlcnZlZCBmaWVsZAorICAgaWYgKCBTWVNfTVNHX0NPT0tJRSA9PSBwTXNnLT5yZXNlcnZlZCApCisgICB7CisgICAgICAvLyBQcm9jZXNzIGFsbCB0aGUgbmV3IFNZUyBtZXNzYWdlcy4uCisgICAgICBzd2l0Y2goIHBNc2ctPnR5cGUgKQorICAgICAgeworICAgICAgICAgLy8gUHJvY2VzcyBUWCB0aHJlYWQgcHJvYmUuICBKdXN0IGNhbGxiYWNrIHRvIHRoZQorICAgICAgICAgLy8gZnVuY3Rpb24gdGhhdCBpcyBpbiB0aGUgbWVzc2FnZS4KKyAgICAgICAgIGNhc2UgU1lTX01TR19JRF9UWF9USFJfUFJPQkU6CisgICAgICAgICB7CisjaWZkZWYgV0xBTl9MT0dHSU5HX1NPQ0tfU1ZDX0VOQUJMRQorICAgICAgICAgICAgaWYocE1zZy0+Y2FsbGJhY2spCisgICAgICAgICAgICAgICAoKHN5c1RocmVhZFByb2JlQ2JhY2spcE1zZy0+Y2FsbGJhY2spKGN1cnJlbnQtPnBpZCk7CisjZW5kaWYKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgfQorCisgICAgICAgICBjYXNlIFNZU19NU0dfSURfVFhfVElNRVI6CisgICAgICAgICB7CisgICAgICAgICAgICB2b3NfdGltZXJfY2FsbGJhY2tfdCB0aW1lckNCID0gcE1zZy0+Y2FsbGJhY2s7CisKKyAgICAgICAgICAgIGlmIChOVUxMICE9IHRpbWVyQ0IpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICB0aW1lckNCKHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisKKyAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU1lTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICA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190IiwgX19mdW5jX18pOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgIH0KKworICAgLy8gQWxsICduZXcnIFNZUyBtZXNzYWdlcyBhcmUgaWRlbnRpZmllZCBieSBhIGNvb2tpZSBpbiB0aGUgcmVzZXJ2ZWQKKyAgIC8vIGZpZWxkIG9mIHRoZSBtZXNzYWdlIGFzIHdlbGwgYXMgdGhlIG1lc3NhZ2UgdHlwZS4gIFRoaXMgcHJldmVudHMKKyAgIC8vIHRoZSBwb3NzaWJpbGl0eSBvZiBvdmVybGFwIGluIHRoZSBtZXNzYWdlIHR5cGVzIGRlZmluZWQgZm9yIG5ldworICAgLy8gU1lTIG1lc3NhZ2VzIHdpdGggdGhlICdsZWdhY3knIG1lc3NhZ2UgdHlwZXMuICBUaGUgbGVnYWN5IG1lc3NhZ2VzCisgICAvLyB3aWxsIG5vdCBoYXZlIHRoaXMgY29va2llIGluIHRoZSByZXNlcnZlZCBmaWVsZAorICAgaWYgKCBTWVNfTVNHX0NPT0tJRSA9PSBwTXNnLT5yZXNlcnZlZCApCisgICB7CisgICAgICAvLyBQcm9jZXNzIGFsbCB0aGUgbmV3IFNZUyBtZXNzYWdlcy4uCisgICAgICBzd2l0Y2goIHBNc2ctPnR5cGUgKQorICAgICAgeworICAgICAgICAgY2FzZSBTWVNfTVNHX0lEX1JYX1RJTUVSOgorICAgICAgICAgeworICAgICAgICAgICAgdm9zX3RpbWVyX2NhbGxiYWNrX3QgdGltZXJDQiA9IHBNc2ctPmNhbGxiYWNrOworCisgICAgICAgICAgICBpZiAoTlVMTCAhPSB0aW1lckNCKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgdGltZXJDQihwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgfQorCisgICAgICAgICBjYXNlIFNZU19NU0dfSURfUlhfVEhSX1BST0JFOgorICAgICAgICAgeworI2lmZGVmIFdMQU5fTE9HR0lOR19TT0NLX1NWQ19FTkFCTEUKKyAgICAgICAgICAgIGlmKHBNc2ctPmNhbGxiYWNrKQorICAgICAgICAgICAgICAgICgoc3lzVGhyZWFkUHJvYmVDYmFjaylwTXNnLT5jYWxsYmFjaykoY3VycmVudC0+cGlkKTsKKyNlbmRpZgorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisKKyAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfU1lTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICJVbmtub3duIG1lc3NhZ2UgdHlwZSBpbiBzeXNSeFByb2Nlc3NNc2coKSBtc2dUeXBlPSAlZCBbMHglMDh4XSIsCisgICAgICAgICAgICAgICAgICAgICAgIHBNc2ctPnR5cGUsIHBNc2ctPnR5cGUgKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgIH0gICAvLyBlbmQgc3dpdGNoIG9uIG1lc3NhZ2UgdHlwZQorICAgfSAgIC8vIGVuZCBpZiBjb29raWUgc2V0CisgICBlbHNlCisgICB7CisgICAgICBWT1NfQVNTRVJUKCAwICk7CisKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9TWVMsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIlJlY2VpdmVkIFNZUyBtZXNzYWdlIGNvb2tpZSB3aXRoIHVuaWRlbnRpZmllZCBSWCBtZXNzYWdlICIKKyAgICAgICAgICAgICAgICAgIiB0eXBlPSAlZCBbMHglMDhYXSIsIHBNc2ctPnR5cGUsIHBNc2ctPnR5cGUgKTsKKworICAgICAgdm9zU3RhdHVzID0gVk9TX1NUQVRVU19FX0JBRE1TRzsKKyAgIH0gICAvLyBlbmQgZWxzZQorCisgICByZXR1cm4oIHZvc1N0YXR1cyApOworfQorCisKK3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AgICBjYXNlIGVXTklfU01FX1NXSVRDSF9DSExfUkVROiAqLyAvL1Rha2VuIGNhcmUgYnkgdGhlIGNoZWNrIGluIGRlZmF1bHQgY2FzZQorICAgIHsKKyAgICAgICAvKiBGb3J3YXJkIHRoaXMgbWVzc2FnZSB0byB0aGUgU01FIG1vZHVsZSAqLworICAgICAgdGFyZ2V0TVEgPSBWT1NfTVFfSURfU01FOworICAgICAgYnJlYWs7CisgICAgfQorCisgICAgZGVmYXVsdDoKKyAgICB7CisKKyAgICAgIGlmICggKCBwTXNnLT50eXBlID49IGVXTklfU01FX01TR19UWVBFU19CRUdJTiApICAmJiAgKCBwTXNnLT50eXBlIDw9IGVXTklfU01FX01TR19UWVBFU19FTkQgKSApCisgICAgICB7CisgICAgICAgICB0YXJnZXRNUSA9IFZPU19NUV9JRF9TTUU7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1NZUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiTWVzc2FnZSBvZiBJRCAlZCBpcyBub3QgeWV0IGhhbmRsZWQgYnkgU1lTXHJcbiIsCisgICAgICAgICAgICAgICAgIHBNc2ctPnR5cGUpOworCisgICAgICBWT1NfQVNTRVJUKDApOworICAgIH0KKworICB9CisKKworICAvKgorICAqKiBQb3N0IG5vdyB0aGUgbWVzc2FnZSB0byB0aGUgYXBwcm9wcmlhdGUgbW9kdWxlIGZvciBoYW5kbGluZworICAqLworICBpZihWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gdm9zX21xX3Bvc3RfbWVzc2FnZSh0YXJnZXRNUSwgKHZvc19tc2dfdCopcE1zZykpCisgIHsKKyAgICAvL0NhbGxlciBkb2Vzbid0IGFsbG9jYXRlIG1lbW9yeSBmb3IgdGhlIHBNc2cuIEl0IGFsbG9jYXRlIG1lbW9yeSBmb3IgYm9keXB0cgorICAgIC8qIGZyZWUgdGhlIG1lbSBhbmQgcmV0dXJuICovCisgICAgaWYocE1zZy0+Ym9keXB0cikKKyAgICB7CisgICAgICB2b3NfbWVtX2ZyZWUoIHBNc2ctPmJvZHlwdHIpOworICAgIH0KKyAgfQorCit9IC8qIFN5c1Byb2Nlc3NNbWhNc2coKSAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5fRlRNX1NZU19GVE0KKworICBERVNDUklQVElPTgorICAgIENhbGxlZCBieSBWT1NTIHRvIGZyZWUgYSBnaXZlbiBGVE0gbWVzc2FnZSBvbiB0aGUgTWFpbiB0aHJlYWQgd2hlbiB0aGVyZQorICAgIGFyZSBtZXNzYWdlcyBwZW5kaW5nIGluIHRoZSBxdWV1ZSB3aGVuIHRoZSB3aG9sZSBzeXN0ZW0gaXMgYmVlbiByZXNldC4KKworICBERVBFTkRFTkNJRVMKKyAgICAgRlRNICBtdXN0IGJlIGluaXRpYWxpemVkIGJlZm9yZSB0aGlzIGZ1bmN0aW9uIGNhbiBiZSBjYWxsZWQuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICBwdm9zR0N0eDogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZSB0byBGVE0ncworICAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICAgIG1lc3NhZ2U6ICAgICAgICB0eXBlIGFuZCBjb250ZW50IG9mIHRoZSBtZXNzYWdlCisKKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOgorCisgIFNJREUgRUZGRUNUUworICAgICAgTk9ORQorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKK3ZvaWQgd2xhbl9zeXNfZnRtKHZvaWQgKnBNc2dQdHIpCit7CisgICAgdm9zX21zZ190ICB2b3NNZXNzYWdlOworCisKKworICAgIHZvc01lc3NhZ2UucmVzZXJ2ZWQgPSBGVE1fU1lTX01TR19DT09LSUU7CisgICAgdm9zTWVzc2FnZS50eXBlICAgICA9IFNZU19NU0dfSURfRlRNX1JTUDsKKyAgICB2b3NNZXNzYWdlLmJvZHlwdHIgID0gcE1zZ1B0cjsKKworICAgIHZvc19tcV9wb3N0X21lc3NhZ2UoVk9TX01RX0lEX1NZUywgJnZvc01lc3NhZ2UpOworCisgICAgcmV0dXJuOworfQorCisKKwordm9pZCB3bGFuX3N5c19wcm9iZSh2b2lkKQoreworICAgIHZvc19tc2dfdCAgdm9zTWVzc2FnZTsKKworICAgIHZvc01lc3NhZ2UucmVzZXJ2ZWQgPSBGVE1fU1lTX01TR19DT09LSUU7CisgICAgdm9zTWVzc2FnZS50eXBlICAgICA9IFNZU19NU0dfSURfTUNfVEhSX1BST0JFOworICAgIHZvc01lc3NhZ2UuYm9keXB0ciAgPSBOVUxMOworCisgICAgdm9zX21xX3Bvc3RfbWVzc2FnZShWT1NfTVFfSURfU1lTLCAmdm9zTWVzc2FnZSk7CisKKyAgICByZXR1cm47Cit9CisKZGlmZiAtLWdpdCBhL3dsYW4vcHJpbWEvQ09SRS9TWVMvbGVnYWN5L3NyYy9wYWwvaW5jL3BhbEFwaS5oIGIvd2xhbi9wcmltYS9DT1JFL1NZUy9sZWdhY3kvc3JjL3BhbC9pbmMvcGFsQXBpLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNzFlMTI3OAotLS0gL2Rldi9udWxsCisrKyBiL3dsYW4vcHJpbWEvQ09SRS9TWVMvbGVnYWN5L3NyYy9wYWwvaW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JFOworICAgVk9TX1NUQVRVUyB2b3NTdGF0dXM7CisgICB2b3NfbG9ja190ICpwTG9jazsKKyAgIAorICAgZG8KKyAgIHsKKyAgICAgIHBMb2NrID0gdm9zX21lbV9tYWxsb2MoIHNpemVvZiggdm9zX2xvY2tfdCApICk7CisgICAKKyAgICAgIGlmICggTlVMTCA9PSBwTG9jayApIGJyZWFrOworCisgICAgICB2b3NfbWVtX3NldChwTG9jaywgc2l6ZW9mKCB2b3NfbG9ja190ICksIDApOworCisgICAgICB2b3NTdGF0dXMgPSB2b3NfbG9ja19pbml0KCBwTG9jayApOworICAgICAgaWYgKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCB2b3NTdGF0dXMgKSApCisgICAgICB7CisgICAgICAgICB2b3NfbWVtX2ZyZWUoIHBMb2NrICk7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIAorICAgICAgKnBIYW5kbGUgPSAodFBhbFNwaW5Mb2NrSGFuZGxlKXBMb2NrOworICAgICAgaGFsU3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgIAorICAgfSB3aGlsZSggMCApOworICAgCisgICByZXR1cm4oIGhhbFN0YXR1cyApOyAgIAorfQorCisKK2VIYWxTdGF0dXMgcGFsU3BpbkxvY2tGcmVlKCB0SGRkSGFuZGxlIGhIZGQsIHRQYWxTcGluTG9ja0hhbmRsZSBoU3BpbkxvY2sgKQoreworICAgZUhhbFN0YXR1cyBoYWxTdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgdm9zX2xvY2tfdCAqcExvY2sgPSAodm9zX2xvY2tfdCAqKWhTcGluTG9jazsKKyAgIFZPU19TVEFUVVMgdm9zU3RhdHVzOworICAgCisgICB2b3NTdGF0dXMgPSB2b3NfbG9ja19kZXN0cm95KCBwTG9jayApOworICAgaWYgKCBWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIHZvc1N0YXR1cyApICkKKyAgIHsKKyAgICAgIC8vI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SLAorICAgICAgICAgICAgICAgICIlczogaW52YWxpZCB2b3NDb250ZXh0IiwgX19mdW5jX18pOworICAgfQorICAgZWxzZQorICAgeworICAgICAgaEhhbCA9IHZvc19nZXRfY29udGV4dCggVk9TX01PRFVMRV9JRF9TTUUsIHZvc0NvbnRleHQgKTsKKyAgICAgIGlmIChOVUxMID09IGhIYWwpCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9TWVMsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiJXM6IGludmFsaWQgaEhhbCIsIF9fZnVuY19fKTsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgIHNpclN0YXR1cyA9IHVNYWNQb3N0Q3RybE1zZyggaEhhbCwgcEJ1ZiApOworICAgICAgICAgaWYgKCBlU0lSX1NVQ0NFU1MgPT0gc2lyU3RhdHVzICkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGhhbFN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICB9CisgICAgICB9CisgICB9CisKKyAgIHZvc19tZW1fZnJlZSggcEJ1ZiApOworCisgICByZXR1cm4oIGhhbFN0YXR1cyApOworfQorICAKKworCisvL0FsbCBzZW1vcGhvcmUgZnVuY3Rpb25zIGFyZSBuby1vcCBoZXJlCisvL1BBTCBzZW1hcGhvcmUgZnVuY3Rpb25zCisvL0FsbCBmdW5jdGlvbnMgTVVTVCByZXR1cm4gc3VjY2Vzcy4gSWYgY2hhbmdlIG5lZWRzIHRvIGJlIG1hZGUsIHBsZWFzZSBjaGVjayBhbGwgY2FsbGVycycgbG9naWMKK2VIYWxTdGF0dXMgcGFsU2VtYXBob3JlQWxsb2MoIHRIZGRIYW5kbGUgaEhkZCwgdFBhbFNlbWFwaG9yZUhhbmRsZSAqcEhhbmRsZSwgdEFOSV9TMzIgY291bnQgKQoreworICAgICh2b2lkKWhIZGQ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vbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisvKgorCisgICAgVGhpcyBmaWxlIGNvbnRhaW5zIGZ1bmN0aW9uIGltcGxlbWVudGF0aW9ucyBmb3IgdGhlIFBsYXRmb3JtCisgICAgQWJzdHJhdGlvbiBMYXllci4KKworICovCisKKyNpbmNsdWRlIDxoYWxUeXBlcy5oPgorI2luY2x1ZGUgPHBhbFRpbWVyLmg+CisjaW5jbHVkZSA8dm9zX3RpbWVyLmg+CisjaW5jbHVkZSA8dm9zX21lbW9yeS5oPgorCisjaWZuZGVmIEZFQVRVUkVfV0xBTl9QQUxfVElNRVJfRElTQUJMRQordHlwZWRlZiBzdHJ1Y3Qgc1BhbFRpbWVyCit7ICAgCisgICAgcGFsVGltZXJDYWxsYmFjayB0aW1lckNhbGxiYWNrOworICAgIHZvaWQgKnBDb250ZXh0OworICAgIHRIZGRIYW5kbGUgaEhkZDsgICAgICAgICAvLyBub3QgcmVhbGx5IG5lZWRlZCB3aGVuIG1hcHBpbmcgdG8gdm9zIHRpbWVycyAgIAorICAgIHRBTklfVTMyIHVUaW1lckludGVydmFsOyAvL21lYW5pbmdmdWwgb25seSBpcyBmUmVzdGFydCBpcyB0cnVlCisgICAgdEFOSV9CT09MRUFOIGZSZXN0YXJ0OworICAgIAorICAgIHZvc190aW1lcl90IHZvc1RpbWVyOworICAgIAorfSB0UGFsVGltZXIsICp0cFBhbFRpbWVyOworCisKKwordl9WT0lEX3QgaW50ZXJuYWxUaW1lckNhbGxiYWNrKCB2X1BWT0lEX3QgdXNlckRhdGEgKQoreworICAgIHRQYWxUaW1lciAqcFBhbFRpbWVyID0gKHRQYWxUaW1lciAqKXVzZXJEYXRhOworICAgIAorICAgIGlmICggcFBhbFRpbWVyICkKKyAgICB7CisgICAgICAgIGlmICggcFBhbFRpbWVyLT50aW1lckNhbGxiYWNrICkKKyAgICAgICAgeworICAgICAgICAgICAgcFBhbFRpbWVyLT50aW1lckNhbGxiYWNrKCBwUGFsVGltZXItPnBDb250ZXh0ICk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmICggcFBhbFRpbWVyLT5mUmVzdGFydCApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBhbFRpbWVyU3RhcnQoIHBQYWxUaW1lci0+aEhkZCwgcFBhbFRpbWVyLCBwUGFsVGltZXItPnVUaW1lckludGVydmFsLCBlQU5JX0JPT0xFQU5fVFJVRSApOworICAgICAgICB9CisgICAgfQorfQorCisjaWZkZWYgVElNRVJfTUFOQUdFUgorZUhhbFN0YXR1cyBwYWxUaW1lckFsbG9jX2RlYnVnKCB0SGRkSGFuZGxlIGhIZGQsIHRQYWxUaW1lckhhbmRsZSAqcGhQYWxUaW1lciwgCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBhbFRpbWVyQ2FsbGJhY2sgcENhbGxiYWNrLCB2b2lkICpwQ29udGV4dCwgY2hhciogZmlsZU5hbWUsIHZfVTMyX3QgbGluZU51bSAgKQoreworICAgZUhhbFN0YXR1cyBoYWxTdGF0dXMgPSBlSEFMX1NUQVRVU19GQUlMVVJFOworICAgdFBhbFRpbWVyICpwUGFsVGltZXIgPSBOVUxMOworICAgVk9TX1NUQVRVUyB2b3NTdGF0dXM7CisgICAgCisgICBkbworICAgeworICAgICAgLy8gYWxsb2NhdGUgdGhlIGludGVybmFsIHRpbWVyIHN0cnVjdHVyZS4KKyAgICAgIHBQYWxUaW1lciA9IHZvc19tZW1fbWFsbG9jKCBzaXplb2YoIHRQYWxUaW1lciApICk7CisgICAgICBpZiAoIE5VTEwgPT0gcFBhbFRpbWVyICkgYnJlYWs7CisgICAgICAgCisgICAgICAvLyBpbml0aWFsaXplIHRoZSB2b3MgVGltZXIgdGhhdCB1bmRlcmxpZXMgdGhlIHBhbCBUaW1lci4KKyAgICAgIHZvc1N0YXR1cyA9IHZvc190aW1lcl9pbml0X2RlYnVnKCAmcFBhbFRpbWVyLT52b3NUaW1lciwgVk9TX1RJTUVSX1RZUEVfU1csIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlcm5hbFRpbWVyQ2FsbGJhY2ssIHBQYWxUaW1lciwgZmlsZU5hbWUsIGxpbmVOdW0gKTsKKyAgICAgIGlmICggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyggdm9zU3RhdHVzICkgKQorICAgICAgeworICAgICAgICAgLy8gaWYgZmFpbCB0byBpbml0IHRoZSB2b3MgdGltZXIsIGZyZWUgdGhlIG1lbW9yeSBhbmQgYmFpbCBvdXQuCisgICAgICAgICB2b3NfbWVtX2ZyZWUoIHBQYWxUaW1lciApOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICAKKyAgICAgIC8vIGluaXRpYWxpemUgdGhlIGluZm8gaW4gdGhlIGludGVybmFsIHBhbFRpbWVyIHN0cnVjdCBzbyB3ZSBjYW4gCisgICAgICBwUGFsVGltZXItPnRpbWVyQ2FsbGJhY2sgPSBwQ2FsbGJhY2s7CisgICAgICBwUGFsVGltZXItPnBDb250ZXh0ICAgICAgPSBwQ29udGV4dDsKKyAgICAgIHBQYWxUaW1lci0+aEhkZCAgICAgICAgICA9IGhIZGQ7CisgICAgICAKKyAgICAgIC8vIHJldHVybiBhICdoYW5kbGUnIHRvIHRoZSBjYWxsZXIuCisgICAgICAqcGhQYWxUaW1lciA9IHBQYWxUaW1lcjsKKyAgICAgIAorICAgICAgaGFsU3RhdHVzID0gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKKyAgICAgIAorICAgfSB3aGlsZSggMCApOyAgIAorICAgICAgIAorICAgIHJldHVybiggaGFsU3RhdHVzICk7Cit9CisjZWxzZQorZUhhbFN0YXR1cyBwYWxUaW1lckFsbG9jKCB0SGRkSGFuZGxlIGhIZGQsIHRQYWxUaW1lckhhbmRsZSAqcGhQYWxUaW1lciwgCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBhbFRpbWVyQ2FsbGJhY2sgcENhbGxiYWNrLCB2b2lkICpwQ29udGV4dCApCit7CisgICBlSGFsU3RhdHVzIGhhbFN0YXR1cyA9IGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICB0UGFsVGltZXIgKnBQYWxUaW1lciA9IE5VTEw7CisgICBWT1NfU1RBVFVTIHZvc1N0YXR1czsKKyAgICAKKyAgIGRvCisgICB7CisgICAgICAvLyBhbGxvY2F0ZSB0aGUgaW50ZXJuYWwgdGltZXIgc3RydWN0dXJlLgorICAgICAgcFBhbFRpbWVyID0gdm9zX21lbV9tYWxsb2MoIHNpemVvZiggdFBhbFRpbWVyICkgKTsKKyAgICAgIGlmICggTlVMTCA9PSBwUGFsVGltZXIgKSBicmVhazsKKyAgICAgICAKKyAgICAgIC8vIGluaXRpYWxpemUgdGhlIHZvcyBUaW1lciB0aGF0IHVuZGVybGllcyB0aGUgcGFsIFRpbWVyLgorICAgICAgdm9zU3RhdHVzID0gdm9zX3RpbWVyX2luaXQoICZwUGFsVGltZXItPnZvc1RpbWVyLCBWT1NfVElNRVJfVFlQRV9TVywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVybmFsVGltZXJDYWxsYmFjaywgcFBhbFRpbWVyICk7CisgICAgICBpZiAoICFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIHZvc1N0YXR1cyApICkKKyAgICAgIHsKKyAgICAgICAgIC8vIGlmIGZhaWwgdG8gaW5pdCB0aGUgdm9zIHRpbWVyLCBmcmVlIHRoZSBtZW1vcnkgYW5kIGJhaWwgb3V0LgorICAgICAgICAgdm9zX21lbV9mcmVlKCBwUGFsVGltZXIgKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgCisgICAgICAvLyBpbml0aWFsaXplIHRoZSBpbmZvIGluIHRoZSBpbnRlcm5hbCBwYWxUaW1lciBzdHJ1Y3Qgc28gd2UgY2FuIAorICAgICAgcFBhbFRpbWVyLT50aW1lckNhbGxiYWNrID0gcENhbGxiYWNrOworICAgICAgcFBhbFRpbWVyLT5wQ29udGV4dCAgICAgID0gcENvbnRleHQ7CisgICAgICBwUGFsVGltZXItPmhIZGQgICAgICAgICAgPSBoSGRkOworICAgICAgCisgICAgICAvLyByZXR1cm4gYSAnaGFuZGxlJyB0byB0aGUgY2FsbGVyLgorICAgICAgKnBoUGFsVGltZXIgPSBwUGFsVGltZXI7CisgICAgICAKKyAgICAgIGhhbFN0YXR1cyA9IGVIQUxfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAKKyAgIH0gd2hpbGUoIDAgKTsgICAKKyAgICAgICAKKyAgICByZXR1cm4oIGhhbFN0YXR1cyApOworfQorI2VuZGlmCisKKworZUhhbFN0YXR1cyBwYWxUaW1lckZyZWUoIHRIZGRIYW5kbGUgaEhkZCwgdFBhbFRpbWVySGFuZGxlIGhQYWxUaW1lciApCit7CisgICBlSGFsU3RhdHVzIHN0YXR1cyA9IGVIQUxfU1RBVFVTX0lOVkFMSURfUEFSQU1FVEVSOworICAgVk9TX1NUQVRVUyB2b3NTdGF0dXM7CisgICB0UGFsVGltZXIgKnBQYWxUaW1lciA9ICh0UGFsVGltZXIgKiloUGFsVGltZXI7CisgICAgCisgICBkbworICAgeworICAgICAgaWYgKCBOVUxMID09IHBQYWxUaW1lciApIGJyZWFrOworICAgCisgICAgICAvLyBEZXN0cm95IHRoZSB2b3MgdGltZXIuLi4gICAgICAKKyAgICAgIHZvc1N0YXR1cyA9IHZvc190aW1lcl9kZXN0cm95KCAmcFBhbFRpbWVyLT52b3NUaW1lciApOworICAgICAgaWYgKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCB2b3NTdGF0dXMgKSApIGJyZWFrOworICAgICAgCisgICAgICAvLyBGcmVlIHRoZSBtZW1vcnkgZm9yIHRoZSBpbnRybmFsIHRpbWVyIHN0cnVjdC4uLgorICAgICAgdm9zX21lbV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Y29udGFpbnMgdGhlIHZhcmlvdXMgc3RydWN0dXJlIGRlZmluaXRpb25zIGFuZAorICBmdW5jdGlvbiBwcm90b3R5cGVzIGZvciB0aGUgUlRPUyBhYnN0cmFjdGlvbiBsYXllciwgaW1wbGVtZW50ZWQgZm9yIFZPU1MKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgICBFRElUIEhJU1RPUlkgRk9SIEZJTEUKKworCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLgorICBOb3RpY2UgdGhhdCBjaGFuZ2VzIGFyZSBsaXN0ZWQgaW4gcmV2ZXJzZSBjaHJvbm9sb2dpY2FsIG9yZGVyLgorCisKKyAgJEhlYWRlcjokICREYXRlVGltZTogJCAkQXV0aG9yOiAkCisKKworICB3aGVuICAgICAgICB3aG8gICAgd2hhdCwgd2hlcmUsIHdoeQorICAtLS0tLS0tLSAgICAtLS0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgMTIvMTUvMDggICAgc2hvICAgIFJlc29sdmVkIHdhcm5pbmdzIGFuZCBlcnJvcnMgZnJvbSBBTVNTIGNvbXBpbGVyIHdoZW4KKyAgICAgICAgICAgICAgICAgICAgIHRoaXMgaXMgcG9ydGVkIHRvIFdNCisgIDExLzIwLzA4ICAgIHNobyAgICBSZW5hbWVkIHRoaXMgdG8gVm9zc1dyYXBwZXIuaDsgcmVtb3ZlIGFsbCBkZXBlbmRlbmNpZXMKKyAgICAgICAgICAgICAgICAgICAgIG9uI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HIEZST00gTE9TUyBPRiBVU0UsIERBVEEgT1IKKyAqIFBST0ZJVFMsIFdIRVRIRVIgSU4gQU4gQUNUSU9OIE9GIENPTlRSQUNULCBORUdMSUdFTkNFIE9SIE9USEVSCisgKiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SCisgKiBQRVJGT1JNQU5DRSBPRiBUSElTIFNPRlRXQVJFLgorICovCisKKy8qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBAZmlsZSBWb3NzV3JhcHBlci5jCisKKyAgQGJyaWVmIFRoaXMgc291cmNlIGZpbGUgY29udGFpbnMgdGhlIHZhcmlvdXMgZnVuY3Rpb24gZGVmaW5pdGlvbnMgZm9yIHRoZSAKKyAgUlRPUyBhYnN0cmFjdGlvbiBsYXllciwgaW1wbGVtZW50ZWQgZm9yIFZPU1MKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gCisgICAgCisgICAgICAgICAgICAgICAgICAgICAgIEVESVQgSElTVE9SWSBGT1IgRklMRSAKKyAgIAorICAgCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNj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VjayBmb3IgdGhlIGZyZWUgYnVpbGRzCisgICBpZiAoVFhfQUlSR09fVE1SX1NJR05BVFVSRSAhPSB0aW1lcl9wdHItPnRtclNpZ25hdHVyZSkgeworICAgICAgIFZPU19BU1NFUlQoIHRpbWVyX3B0ci0+dG1yU2lnbmF0dXJlID09IDAgKTsKKworICAgICAgIHJldHVybiBUWF9USU1FUl9FUlJPUjsgICAgICAKKyAgIH0KKworICAgIC8vIGNoYW5nZXMgY2Fubm90IGJlIGFwcGxpZWQgdW50aWwgdGltZXIgc3RvcHMgcnVubmluZworICAgIGlmIChWT1NfVElNRVJfU1RBVEVfU1RPUFBFRCA9PSB2b3NfdGltZXJfZ2V0Q3VycmVudFN0YXRlKCZ0aW1lcl9wdHItPnZvc1RpbWVyKSkKKyAgICB7CisgICAgICAgdGltZXJfcHRyLT5pbml0U2NoZWR1bGVUaW1lSW5Nc2VjcyA9IFRYX01TRUNTX0lOXzFfVElDSyAqIGluaXRTY2hlZHVsZVRpbWVJblRpY2tzOworICAgICAgIHRpbWVyX3B0ci0+cmVzY2hlZHVsZVRpbWVJbk1zZWNzID0gVFhfTVNFQ1NfSU5fMV9USUNLICogcmVzY2hlZHVsZVRpbWVJblRpY2tzOworICAgICAgIHJldHVybiBUWF9TVUNDRVNTOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgIHJldHVybiBUWF9USU1FUl9FUlJPUjsKKyAgICB9Cit9IC8qKiogdHhfdGltZXJfY2hhbmdlKCkgKioqLworCisvKiotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAqIHR4X3RpbWVyX2NoYW5nZV9jb250ZXh0KCkgCisgKgorICogRlVOQ1RJT046CisgKgorICogTE9HSUM6CisgKgorICogQVNTVU1QVElPTlM6CisgKgorICogTk9URToKKyAqCisgKiBAcGFyYW0gIAorICoKKyAqIEByZXR1cm4gVFhfU1VD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hY3RpdmF0ZSh0aW1lcl9wdHIpOworICAgIH0KKworICAgIHJldHVybiBUWF9TVUNDRVNTOworCit9IC8vKiogdHhfdGltZXJfY3JlYXRlKCkgKioqLworI2Vsc2UKK3ZfVUlOVF90IHR4X3RpbWVyX2NyZWF0ZV9pbnRlcm4oIHZfUFZPSURfdCBwTWFjR2xvYmFsLCBUWF9USU1FUiAqdGltZXJfcHRyLAorICAgY2hhciAqbmFtZV9wdHIsIAorICAgdl9WT0lEX3QgKCAqZXhwaXJhdGlvbl9mdW5jdGlvbiApKCB2X1BWT0lEX3QsIHRBTklfVTMyICksCisgICB0QU5JX1UzMiBleHBpcmF0aW9uX2lucHV0LCB2X1VMT05HX3QgaW5pdFNjaGVkdWxlVGltZUluVGlja3MsIAorICAgdl9VTE9OR190IHJlc2NoZWR1bGVUaW1lSW5UaWNrcywgdl9VTE9OR190IGF1dG9fYWN0aXZhdGUgKQoreworICAgIFZPU19TVEFUVVMgc3RhdHVzOworCisgICAgaWYoKE5VTEwgPT0gbmFtZV9wdHIpIHx8IChOVUxMID09IGV4cGlyYXRpb25fZnVuY3Rpb24pKQorICAgICAgICByZXR1cm4gVFhfVElNRVJfRVJST1I7CisKKyAgICBpZiAoIWluaXRTY2hlZHVsZVRpbWVJblRpY2tzKQorICAgICAgICByZXR1cm4gVFhfVElDS19FUlJPUjsKKworICAgIGlmICghdGltZXJfcHRyKQorICAgICAgICByZXR1cm4gVFhfVElNRVJfRVJST1I7CisKKyAgICAvLyBJbml0aWFsaXplIHRpbWVyIHN0cnVjdHVyZQorICAgIHRpbWVyX3B0ci0+cEV4cGlyZUZ1bmMgPSBleHBpcmF0aW9uX2Z1bmN0aW9uOworICAgIHRpbWVyX3B0ci0+ZXhwaXJlSW5wdXQgPSBleHBpcmF0aW9uX2lucHV0OworICAgIHRpbWVyX3B0ci0+aW5pdFNjaGVkdWxlVGltZUluTXNlY3MgPQorICAgICAgICBUWF9NU0VDU19JTl8xX1RJQ0sgKiBpbml0U2NoZW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reworICAgIHRTaXJSZXRTdGF0dXMgcmV0OworICAgIHZvaWQqICAgICAgICAgcEJkOworICAgIHRNZ210RnJtRHJvcFJlYXNvbiBkcm9wUmVhc29uOworICAgIHZvc19wa3RfdCAgKnBWb3NQa3QgPSAodm9zX3BrdF90ICopcE1zZy0+Ym9keXB0cjsKKyAgICBWT1NfU1RBVFVTICB2b3NTdGF0dXMgPQorICAgICAgICAgICAgICBXREFfRFNfUGVla1J4UGFja2V0SW5mbyggcFZvc1BrdCwgKHZfUFZPSURfdCAqKSZwQmQsIFZPU19GQUxTRSApOworICAgIHBNYWMtPnN5cy5nU3lzQmJ0UmVjZWl2ZWQrKzsKKworICAgIGlmICggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpICkKKyAgICB7CisgICAgICAgIGdvdG8gZmFpbDsKKyAgICB9CisKKyAgICBQRUxPRzMoc3lzTG9nKHBNYWMsIExPRzMsIEZMKCJSeCBNZ210IEZyYW1lIFN1YnR5cGU6ICVkXG4iKSwgc3ViVHlwZSk7CisgICAgc2lyRHVtcEJ1ZihwTWFjLCBTSVJfU1lTX01PRFVMRV9JRCwgTE9HMywgKHRBTklfVTggKilXREFfR0VUX1JYX01BQ19IRUFERVIocEJkKSwgV0RBX0dFVF9SWF9NUERVX0xFTihwQmQpKTsKKyAgICBzaXJEdW1wQnVmKHBNYWMsIFNJUl9TWVNfTU9EVUxFX0lELCBMT0czLCBXREFfR0VUX1JYX01QRFVfREFUQShwQmQpLCBXREFfR0VUX1JYX1BBWUxPQURfTEVOKHBCZCkpOykKKworICAgIHBNYWMtPnN5cy5nU3lzRnJhbWVDb3VudFt0eXBlXVtzdWJUeXBlXSsrOworCisgICAgaWYodHlwZSA9PSBTSVJfTUFDX01HTVRfRlJBTUUpCisgICAgeworICAgICAgICAgICAgaWYgKChzdWJUeXBlID09IFNJUl9NQUNfTUdNVF9ERUFVVEggfHwKKyAgICAgICAgICAgICAgICAgc3ViVHlwZSA9PSBTSVJfTUFDX01HTVRfRElTQVNTT0MpJiYKKyAgICAgICAgICAgICAgICBsaW1Jc0RlYXV0aERpYXNzb2NGb3JEcm9wKHBNYWMsIHBCZCkpCisgICAgICAgICAgICAgICAgZ290byBmYWlsOworCisgICAgICAgICAgICBpZiggKGRyb3BSZWFzb24gPSBsaW1Jc1BrdENhbmRpZGF0ZUZvckRyb3AocE1hYywgcEJkLCBzdWJUeXBlKSkgIT0gZU1HTVRfRFJPUF9OT19EUk9QKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFBFTE9HMShzeXNMb2cocE1hYywgTE9HMSwgRkwoIk1nbXQgRnJhbWUgJWQgYmVpbmcgZHJvcHBlZCwgcmVhc29uOiAlZFxuIiksIHN1YlR5cGUsIGRyb3BSZWFzb24pOykKKyAgICAgICAgICAgICAgICBNVFJBQ0UobWFjVHJhY2UocE1hYywgICBUUkFDRV9DT0RFX1JYX01HTVRfRFJPUCwgTk9fU0VTU0lPTiwgZHJvcFJlYXNvbik7KQorICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vUG9zdCB0aGUgbWVzc2FnZSB0byBQRSBRdWV1ZQorICAgICAgICAgICAgcmV0ID0gKHRTaXJSZXRTdGF0dXMpIGxpbVBvc3RNc2dBcGkocE1hYywgcE1zZyk7CisgICAgICAgICAgICBpZiAocmV0ICE9IGVTSVJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBQRUxPR0Uoc3lzTG9nKHBNYWMsIExPR0UsIEZMKCJwb3N0aW5nIHRvIExJTTIgZmFpbGVkLCByZXQgJWRcbiIpLCByZXQpOykKKyAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwTWFjLT5zeXMuZ1N5c0JidFBvc3RlZFRvTGltKys7CisgICAgfQorICAgIGVsc2UgaWYgKHR5cGUgPT0gU0lSX01BQ19EQVRBX0ZSQU1FKQorICAgIHsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICAgICAgIFBFTE9HVyhzeXNMb2cocE1hYywgTE9HVywgRkwoIklBUFAgRnJhbWUuLi5cbiIpKTspOworICAgICAgICAvL1Bvc3QgdGhlIG1lc3NhZ2UgdG8gUEUgUXVldWUKKyAgICAgICAgcmV0ID0gKHRTaXJSZXRTdGF0dXMpIGxpbVBvc3RNc2dBcGkocE1hYywgcE1zZyk7CisgICAgICAgIGlmIChyZXQgIT0gZVNJUl9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICBQRUxPR0Uoc3lzTG9nKHBNYWMsIExPR0UsIEZMKCJwb3N0aW5nIHRvIExJTTIgZmFpbGVkLCByZXQgJWRcbiIpLCByZXQpOykKKyAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgfQorICAgICAgICBwTWFjLT5zeXMuZ1N5c0JidFBvc3RlZFRvTGltKys7CisjZW5kaWYKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgUEVMT0czKHN5c0xvZyhwTWFjLCBMT0czLCAiQkJUIHJlY2VpdmVkIEludmFsaWQgdHlwZSAlZCBzdWJUeXBlICVkICIKKyAgICAgICAgICAgICAgICAgICAiTElNIHN0YXRlICVYLiBCRCBkdW1wIGlzOlxuIiwKKyAgICAgICAgICAgICAgICAgICB0eXBlLCBzdWJUeXBlLCBsaW1HZXRTbWVTdGF0ZShwTWFjKSk7CisgICAgICAgIHNpckR1bXBCdWYocE1hYywgU0lSX1NZU19NT0RVTEVfSUQsIExPRzMsCisgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopIHBCZCwgV0xBTkhBTF9SWF9CRF9IRUFERVJfU0laRSk7KQorCisgICAgICAgIGdvdG8gZmFpbDsKKyAgICB9CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworCitmYWlsOgorCisgICAgcE1hYy0+c3lzLmdTeXNCYnREcm9wcGVkKys7CisgICAgcmV0dXJu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fTE9HR0lORyApCisKKyMgICAgICAgZGVmaW5lIERPVDExRl9IQVZFX0xPR19NQUNST1MKKworIyAgICAgICBkZWZpbmUgRlJBTUVTX0xPRzAoY3R4LCBzZXYsIGZtdCkgXAorICAgICAgICAgICAgZG90MTFmTG9nKChjdHgpLCAoc2V2KSwgKGZtdCkpOworCisjICAgICAgIGRlZmluZSBGUkFNRVNfTE9HMShjdHgsIHNldiwgZm10LCBwMSkgXAorICAgICAgICAgICAgZG90MTFmTG9nKChjdHgpLCAoc2V2KSwgKGZtdCksIChwMSkpOworCisjICAgICAgIGRlZmluZSBGUkFNRVNfTE9HMihjdHgsIHNldiwgZm10LCBwMSwgcDIpIFwKKyAgICAgICAgICAgIGRvdDExZkxvZygoY3R4KSwgKHNldiksIChmbXQpLCAocDEpLCAocDIpKTsKKworIyAgICAgICBkZWZpbmUgRlJBTUVTX0xPRzMoY3R4LCBzZXYsIGZtdCwgcDEsIHAyLCBwMykgXAorICAgICAgICAgICAgZG90MTFmTG9nKChjdHgpLCAoc2V2KSwgKGZtdCksIChwMSksIChwMiksIChwMykpOworCisjICAgICAgIGRlZmluZSBGUkFNRVNfRFVNUChjdHgsIHNldiwgcCwgbikgXAorICAgICAgICAgICAgc2lyRHVtcEJ1ZigocEN0eCksIFNJUl9EQkdfTU9EVUxFX0lELCAoc2V2KSwgKHApLCAobikpOworCisgICAgICAgICNlbmRpZiAvLyNpZiBkZWZpbmVkKCBET1QxMUZfRU5BQkxFX0xPR0dJTkcgKQorCisjICAgZWxzZQorCisjICAgICAgIHVuZGVmIERPVDExRl9FTkFCTEVfTE9HR0lORworIyAgICAgICB1bmRlZiBET1QxMUZfRFVNUF9GUkFNRVMKKyMgICAgICAgZGVmaW5lIERPVDExRl9MT0dfR0FURSAoIDEgKQorCisjICAgZW5kaWYKKworCisvLyAjZGVmaW5lIERPVDExRl9FTkFCTEVfREJHX0JSRUFLICggMSApCisKKy8vIExvY2FsIFZhcmlhYmxlczoKKy8vIGZpbGwtY29sd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K3ZvaWQgICAgICAgICAgQ29udmVydFRJTSAgICAgICAgICAgICh0cEFuaVNpckdsb2JhbCwgdFNpck1hY1RpbSosICAgICAgICAgICAgICAgIHREb3QxMWZJRVRJTSopOwordm9pZCAgICAgICAgICBDb252ZXJ0Q291bnRyeSAgICAgICAgKHRwQW5pU2lyR2xvYmFsLCB0U2lyQ291bnRyeUluZm9ybWF0aW9uKiwgICAgdERvdDExZklFQ291bnRyeSopOwordm9pZCAgICAgICAgICBDb252ZXJ0V01NUGFyYW1zICAgICAgKHRwQW5pU2lyR2xvYmFsLCB0U2lyTWFjRWRjYVBhcmFtU2V0SUUqLCAgICAgdERvdDExZklFV01NUGFyYW1zKik7Cit2b2lkICAgICAgICAgIENvbnZlcnRFUlBJbmZvICAgICAgICAodHBBbmlTaXJHbG9iYWwsIHRTaXJNYWNFcnBJbmZvKiwgICAgICAgICAgICB0RG90MTFmSUVFUlBJbmZvKik7Cit2b2lkICAgICAgICAgIENvbnZlcnRFRENBUGFyYW0gICAgICAodHBBbmlTaXJHbG9iYWwsIHRTaXJNYWNFZGNhUGFyYW1TZXRJRSosICAgICB0RG90MTFmSUVFRENBUGFyYW1TZXQqKTsKK3ZvaWQgICAgICAgICAgQ29udmVydFRTUEVDICAgICAgICAgICh0cEFuaVNpckdsb2JhbCwgdFNpck1hY1RzcGVjSUUqLCAgICAgICAgICAgIHREb3QxMWZJRVRTUEVDKik7Cit0U2lyUmV0U3RhdHVzIENvbnZlcnRUQ0xBUyAgICAgICAgICAodHBBbmlTaXJHbG9iYWwsIHRTaXJUY2xhc0luZm8qLCAgICAgICAgICAgICB0RG90MTFmSUVUQ0xBUyopOwordm9pZCAgICAgICAgICBDb252ZXJ0V01NVFNQRUMgICAgICAgKHRwQW5pU2lyR2xvYmFsLCB0U2lyTWFjVHNwZWNJRSosICAgICAgICAgICAgdERvdDExZklFV01NVFNQRUMqKTsKK3RTaXJSZXRTdGF0dXMgQ29udmVydFdNTVRDTEFTICAgICAgICh0cEFuaVNpckdsb2JhbCwgdFNpclRjbGFzSW5mbyosICAgICAgICAgICAgIHREb3QxMWZJRVdNTVRDTEFTKik7Cit2b2lkICAgICAgICAgIENvbnZlcnRUU0RlbGF5ICAgICAgICAodHBBbmlTaXJHbG9iYWwsIHRTaXJNYWNUc0RlbGF5SUUqLCAgICAgICAgICB0RG90MTFmSUVUU0RlbGF5Kik7Cit2b2lkICAgICAgICAgIENvbnZlcnRTY2hlZHVsZSAgICAgICAodHBBbmlTaXJHbG9iYWwsIHRTaXJNYWNTY2hlZHVsZUlFKiwgICAgICAgICB0RG90MTFmSUVTY2hlZHVsZSopOwordm9pZCAgICAgICAgICBDb252ZXJ0V01NU2NoZWR1bGUgICAgKHRwQW5pU2lyR2xvYmFsLCB0U2lyTWFjU2NoZWR1bGVJRSosICAgICAgICAgdERvdDExZklFV01NU2NoZWR1bGUqKTsKK3RTaXJSZXRTdGF0dXMgQ29udmVydFdzY09wYXF1ZSAgICAgICh0cEFuaVNpckdsb2JhbCwgdFNpckFkZGllKiwgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdzY0lFT3BhcXVlKik7Cit0U2lyUmV0U3RhdHVzIENvbnZlcnRQMlBPcGFxdWUgICAgICAodHBBbmlTaXJHbG9iYWwsIHRTaXJBZGRpZSosICAgICAgICAgICAgICAgICB0RG90MTFmSUVQMlBJRU9wYXF1ZSopOworI2lmZGVmIFdMQU5fRkVBVFVSRV9XRkQKK3RTaXJSZXRTdGF0dXMgQ29udmVydFdGRE9wYXF1ZSAgICAgICh0cEFuaVNpckdsb2JhbCwgdFNpckFkZGllKiwgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdGRElFT3BhcXVlKik7CisjZW5kaWYKK3ZvaWQgICAgICAgICAgQ29udmVydFFvc01hcHNldEZyYW1lKHRwQW5pU2lyR2xvYmFsLCB0U2lyUW9zTWFwU2V0KiwgICAgIHREb3QxMWZJRVFvc01hcFNldCopOworCisKKyNlbmRpZgpkaWZmIC0tZ2l0IGEvd2xhb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TEFOX0RFQlVHCisgICAgY2hhciBidWZmZXJbMzVdOworICAgIGludCBpLCBvZmZzZXQ7CisgICAgcEN0eDsKKyAgICBvZmZzZXQgPSAwOworICAgIGlmICggblNldiA+IERPVDExRl9MT0dfR0FURSApIHJldHVybjsKKyAgICBmb3IgKGkgPSAwOyBpIDwgbkJ1Zi84OyArK2kpCisgICAgeworICAgICAgICBfc25wcmludGYoYnVmZmVyLCAzNSwgIiUwOHg6ICUwMnggJTAyeCAlMDJ4ICUwMnggJTAyeCAlMDJ4ICUwMnggJTAyeFxuIiwgb2Zmc2V0LCAqcEJ1ZiwgKihwQnVmICsgMSksICoocEJ1ZiArIDIpLCAqKHBCdWYgKyAzKSwgKihwQnVmICsgNCksICoocEJ1ZiArIDUpLCAqKHBCdWYgKyA2KSwgKihwQnVmICsgNykpOworICAgICAgICBwQnVmICs9IDg7IG9mZnNldCArPSA4OworICAgICAgICBEQkdQUklOVChidWZmZXIpOworICAgIH0KKyAgICBfc25wcmludGYoYnVmZmVyLCAzNSwgIiUwOHg6ICIsIG9mZnNldCk7CisgICAgREJHUFJJTlQoYnVmZmVyKTsKKyAgICBmb3IgKGkgPSAwOyBpIDwgbkJ1ZiAlIDg7ICsraSkKKyAgICB7CisgICAgICAgIF9zbnByaW50ZihidWZmZXIsIDM1LCAiJTAyeCAiLCAqcEJ1Zik7CisgICAgICAgICsrcEJ1ZjsKKyAgICAgICAgREJHUFJJTlQoYnVmZmVyKTsKKyAgICB9CisgICAgREJHUFJJTlQoIlxuIik7CisjZW5kaWYKK30KKworI2VsaWYgZGVmaW5lZCBPU19YIC8qIE5vdCBXSU4zMiAqLworc3RhdGljIHZvaWQgZnJhbWVzTG9nKHRwQW5pU2lyR2xvYmFsIHBDdHgsIGludCBuU2V2LAorICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKmxwc3pGb3JtYXQsIC4uLikKK3svLyBUbyBmaWxsIGluIHdoZW4gbmVlZGVkIHVzaW5nIElPTG9nCisKK30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ihwQnVmICsgNCksICoocEJ1ZiArIDUpLCAqKHBCdWYgKyA2KSwgKihwQnVmICsgNykpOworICAgICAgICBwQnVmICs9IDg7IG9mZnNldCArPSA4OworICAgIH0KKyAgICBwcmludGYoIiUwOHg6ICIsIG9mZnNldCk7CisgICAgZm9yIChpID0gMDsgaSA8IG5CdWYgJSA4OyArK2kpCisgICAgeworICAgICAgICBwcmludGYoIiUwMnggIiwgKnBCdWYpOworICAgICAgICArK3BCdWY7CisgICAgfQorICAgIHByaW50ZigiXG4iKTsKKyNlbmRpZgorfQorCisjZW5kaWYgLyogV0lOMzIgKi8KKworI2RlZmluZSBGUkFNRVNfTE9HMChjdHgsIHNldiwgZm10KSBcCisgICAgIGZyYW1lc0xvZygoY3R4KSwgKHNldiksIChmbXQpKTsKKyNkZWZpbmUgRlJBTUVTX0xPRzEoY3R4LCBzZXYsIGZtdCwgcDEpIFwKKyAgICAgZnJhbWVzTG9nKChjdHgpLCAoc2V2KSwgKGZtdCksIChwMSkpOworI2RlZmluZSBGUkFNRVNfTE9HMihjdHgsIHNldiwgZm10LCBwMSwgcDIpIFwKKyAgICAgZnJhbWVzTG9nKChjdHgpLCAoc2V2KSwgKGZtdCksIChwMSksIChwMikpOworI2RlZmluZSBGUkFNRVNfTE9HMyhjdHgsIHNldiwgZm10LCBwMSwgcDIsIHAzKSBcCisgICAgIGZyYW1lc0xvZygoY3R4KSwgKHNldiksIChmbXQpLCAocDEpLCAocDIpLCAocDMpKTsKKyNkZWZpbmUgRlJBTUVTX0RVTVAoY3R4LCBzZXYsIHAsIG4pIFwKKyAgICAgZnJhbWVzRHVtcCgoY3R4KSwgKHNldiksIChwKSwgKG4pKTsKKyNpZm5kZWYgRlJBTUVTX1NFVl9GT1JfRlJBTUUKKyMgICBkZWZpbmUgRlJBTUVTX1NFVl9GT1JfRlJBTUUoY3R4LCBzaWcpIEZSTE9HMworI2VuZGlmCisKKyNlbmRpZiAvKiBFbmQgRE9UMTFGX0hBVkVfTE9HX01BQ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IERPVDExRl9CQURfT1VUUFVUX0JVRkZFUjsgXAorICAgICAgICBpZiAoIXBuQ29uc3VtZWQpIHJldHVybiBET1QxMUZfQkFEX09VVFBVVF9CVUZGRVIgXAorCisjICAgZW5kaWYKKyNlbmRpZgorCitzdGF0aWMgdm9pZCBmcmFtZXNudG9ocyh0cEFuaVNpckdsb2JhbCAgICBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMTYgKnBPdXQsCisgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICAqcEluLAorICAgICAgICAgICAgICAgICAgICAgICAgdEZSQU1FU19CT09MICBmTXNiKQoreworICAgICh2b2lkKXBDdHg7CisjICAgaWYgZGVmaW5lZCAoIERPVDExRl9MSVRUTEVfRU5ESUFOX0hPU1QgKQorICAgIGlmICggIWZNc2IgKQorICAgIHsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCAoIHRBTklfVTE2KiApcE91dCwgcEluLCAyKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgKnBPdXQgPSAoIHRBTklfVTE2ICkoICpwSW4gPDwgOCApIHwgKiggcEluICsgMSApOworICAgIH0KKyMgICBlbHNlCisgICAgaWYgKCAhZk1zYiApCisgICAgeworICAgICAgICAqcE91dCA9ICggdEFOSV9VMTYgKSggKnBJbiB8ICggKiggcEluICsgMSApIDw8IDggKSApOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsICggdEFOSV9VMTYqIClwT3V0LCBwSW4sIDIpOworICAgIH0KKyMgICBlbmRpZgorfQorCitzdGF0aWMgdm9pZCBmcmFtZXNudG9obCh0cEFuaVNpckdsb2JhbCAgICBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBPdXQsCisgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICAqcEluLAorICAgICAgICAgICAgICAgICAgICAgICAgdEZSQU1FU19CT09MICBmTXNiKQoreworICAgICh2b2lkKXBDdHg7CisjICAgaWYgZGVmaW5lZCAoIERPVDExRl9MSVRUTEVfRU5ESUFOX0hPU1QgKQorICAgIGlmICggIWZNc2IgKQorICAgIHsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCAoIHRBTklfVTMyKiApcE91dCwgcEluLCA0KTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgKnBPdXQgPSAoIHRBTklfVTMyICkoICpwSW4gICAgICAgICA8PCAyNCApIHwKKyAgICAgICAgICAgICAgICAoICooIHBJbiArIDEgKSA8PCAxNiApIHwKKyAgICAgICAgICAgICAgICAoICooIHBJbiArIDIgKSA8PCAgOCApIHwKKyAgICAgICAgICAgICAgICAoICooIHBJbiArIDMgKSApOworICAgIH0KKyMgICBlbHNlCisgICAgaWYgKCAhZk1zYiApCisgICAgeworICAgICAgICAqcE91dCA9ICggdEFOSV9VMzIgKSggKiggcEluICsgMyApIDw8IDI0ICkgfAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoICooIHBJbiArIDIgKSA8PCAxNiApIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCAqKCBwSW4gKyAxICkgPDwgIDggKSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggKiggcEluICkgKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgKnBPdXQgPSAqICggdEFOSV9VMzIqIClwSW47CisgICAgfQorIyAgIGVuZGlmCit9CisKK3N0YXRpYyB2b2lkIGZyYW1lc250b2hxKHRwQW5pU2lyR2xvYmFsICAgIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICB0RE9UMTFGX1U2NCAqcE91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggICpwSW4sCisgICAgICAgICAgICAgICAgICAgICAgICB0RlJBTUVTX0JPT0wgIGZNc2IpCit7CisjICAgaWYgZGVmaW5lZCAoIERPVDExRl9MSVRUTEVfRU5ESUFOX0hPU1QgKQorICAgIGZyYW1lc250b2hsKCBwQ3R4LCAmKCgqcE91dClbMF0pLCBwSW4sIGZNc2IpOworICAgIGZyYW1lc250b2hsKCBwQ3R4LCAmKCgqcE91dClbMV0pLCBwSW4gKyA0LCBmTXNiKTsKKyMgICBlbHNlCisgICAgZnJhbWVzbnRvaGwoIHBDdHgsICYoKCpwT3V0KVsxXSksIHBJbiwgZk1zYik7CisgICAgZnJhbWVzbnRvaGwoIHBDdHgsICYoKCpwT3V0KVswXSksIHBJbiArIDQsIGZNc2IpOworIyAgIGVuZGlmCit9CisKK3N0YXRpYyB2b2lkIGZyYW1lc2h0b25zKHRwQW5pU2lyR2xvYmFsICAgIHBDdHgKKywgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICAqcE91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTE2ICBwSW4sCisgICAgICAgICAgICAgICAgICAgICAgICB0RlJBTUVTX0JPT0wgIGZNc2IpCit7CisgICAgKHZvaWQpcEN0eDsKKyMgICBpZiBkZWZpbmVkICggRE9UMTFGX0xJVFRMRV9FTkRJQU5fSE9TVCApCisgICAgaWYgKCAhZk1zYiApCisgICAgeworICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBPdXQsICZwSW4sIDIpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAqcE91dCAgICAgICAgID0gKCBwSW4gJiAweGZmMDAgKSA+PiA4OworICAgICAgICAqKCBwT3V0ICsgMSApID0gcEluICYgMHhmZjsKKyAgICB9CisjICAgZWxzZQorICAgIGlmICggIWZNc2IgKQorICAgIHsKKyAgICAgICAgKnBPdXQgICAgICAgICA9IHBJbiAmIDB4ZmY7CisgICAgICAgICooIHBPdXQgKyAxICkgPSAoIHBJbiAmIDB4ZmYwMCApID4+IDg7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcE91dCwgJnBJbiwgMik7CisgICAgfQorIyAgIGVuZGlmCit9CisKK3N0YXRpYyB2b2lkIGZyYW1lc2h0b25sKHRwQW5pU2lyR2xvYmFsICAgIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICAqcE91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICBwSW4sCisgICAgICAgICAgICAgICAgICAgICAgICB0RlJBTUVTX0JPT0wgIGZNc2IpCit7CisgICAgKHZvaWQpcEN0eDsKKyMgICBpZiBkZWZpbmVkICggRE9UMTFGX0xJVFRMRV9FTkRJQU5fSE9TVCApCisgICAgaWYgKCAhZk1zYiApCisgICAgeworICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBPdXQsICZwSW4sIDQpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAqcE91dCAgICAgICAgID0gKCBwSW4gJiAweGZmMDAwMDAwICkgPj4gMjQ7CisgICAgICAgICooIHBPdXQgKyAxICkgPSAoIHBJbiAmIDB4MDBmZjAwMDAgKSA+PiAxNjsKKyAgICAgICAgKiggcE91dCArIDIgKSA9ICggcEluICYgMHgwMDAwZmYwMCApID4+ICA4OworICAgICAgICAqKCBwT3V0ICsgMyApID0gKCBwSW4gJiAweDAwMDAwMGZmICk7CisgICAgfQorIyAgIGVsc2UKKyAgICBpZiAoICFmTXNiICkKKyAgICB7CisgICAgICAgICooIHBPdXQgICAgICkgPSAoIHBJbiAmIDB4MDAwMDAwZmYgKTsKKyAgICAgICAgKiggcE91dCArIDEgKSA9ICggcEluICYgMHgwMDAwZmYwMCApID4+ICA4OworICAgICAgICAqKCBwT3V0ICsgMiApID0gKCBwSW4gJiAweDAwZmYwMDAwICkgPj4gMTY7CisgICAgICAgICooIHBPdXQgKyAzICkgPSAoIHBJbiAmIDB4ZmYwMDAwMDAgKSA+PiAyNDsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwT3V0LCAmcEluLCA0KTsKKyAgICB9CisjICAgZW5kaWYKK30KKworc3RhdGljIHZvaWQgZnJhbWVzaHRvbnEodHBBbmlTaXJHbG9iYWwgICAgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggICpwT3V0LAorICAgICAgICAgICAgICAgICAgICAgICAgdERPVDExRl9VNjQgIHBJbiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRGUkFNRVNfQk9PTCAgZk1zYikKK3sKKyMgICBpZiBkZWZpbmVkICggRE9UMTFGX0xJVFRMRV9FTkRJQU5fSE9TVCApCisgICAgZnJhbWVzaHRvbmwoIHBDdHgsIHBPdXQsIHBJblswXSwgZk1zYik7CisgICAgZnJhbWVzaHRvbmwoIHBDdHgsIHBPdXQgKyA0LCBwSW5bMV0sIGZNc2IpOworIyAgIGVsc2UKKyAgICBmcmFtZXNodG9ubCggcEN0eCwgcE91dCArIDQsIHBJblsxXSwgZk1zYik7CisgICAgZnJhbWVzaHRvbmwoIHBDdHgsIHBPdXQsIHBJblswXSwgZk1zYik7CisjICAgZW5kaWYKK30KK3N0YXRpYyBjb25zdCB0SUVEZWZuKiBGaW5kSUVEZWZuKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHRJRURlZm4gIElFc1tdKQoreworICAgIGNvbnN0IHRJRURlZm4gKnBJZTsKKworICAgICh2b2lkKXBDdHg7CisKKyAgICBwSWUgPSAmKElFc1swXSk7CisgICAgd2hpbGUgKDB4ZmYgIT0gcEllLT5laWQpCisgICAgeworICAgICAgICBpZiAoKnBCdWYgPT0gcEllLT5laWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmICgwID09IHBJZS0+bm91aSkgcmV0dXJuIHBJZTsKKworICAgICAgICAgICAgaWYgKCAoIG5CdWYgPiAodEFOSV9VMzIpKHBJZS0+bm91aSArIDIpICkgJiYKKyAgICAgICAgICAgICAgICAgKCAhRE9UMTFGX01FTUNNUChwQ3R4LCBwQnVmICsgMiwgcEllLT5vdWksIHBJZS0+bm91aSkgKSApCisgICAgICAgICAgICAgICAgcmV0dXJuIHBJZTsKKyAgICAgICAgfQorCisgICAgICAgICsrcEllOworICAgIH0KKworICAgIHJldHVybiBOVUxMOworfQorCitzdGF0aWMgdEFOSV9VMzIgR2V0Q29udGFpbmVySWVzTGVuKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwbkNvbnN1bWVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0SUVEZWZuICBJRXNbXSkKK3sKKyAgICBjb25zdCB0SUVEZWZuICpwSWUsICpwSWVGaXJzdDsKKyAgICB0QU5JX1U4ICpwQnVmUmVtYWluaW5nID0gcEJ1ZjsKKyAgICB0QU5JX1U4IGxlbiA9IDA7CisKKyAgICAodm9pZClwQ3R4OworCisgICAgcEllRmlyc3QgPSAmKElFc1swXSk7CisKKyAgICBpZiggKnBCdWZSZW1haW5pbmcgIT0gcEllRmlyc3QtPmVpZCApCisgICAgICAgICByZXR1cm4gRE9UMTFGX0lOVEVSTkFMX0VSUk9SOworICAgIGxlbiArPSAqKHBCdWZSZW1haW5pbmcrMSk7CisgICAgcEJ1ZlJlbWFpbmluZyArPSBsZW4gKyAyOworICAgIGxlbiArPSAyOworICAgIHdoaWxlICggbGVuIDwgbkJ1ZiApCisgICAgeworICAgICAgICBpZiggTlVMTCA9PSAocEllID0gIEZpbmRJRURlZm4ocEN0eCwgcEJ1ZlJlbWFpbmluZywgbkJ1ZiArIGxlbiwgSUVzKSkpCisgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGlmKCBwSWUtPmVpZCA9PSBwSWVGaXJzdC0+ZWlkICkKKyAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgbGVuICs9ICoocEJ1ZlJlbWFpbmluZyArIDEpICsgMjsKKyAgICAgICAgcEJ1ZlJlbWFpbmluZyArPSAqKHBCdWZSZW1haW5pbmcgKyAxKSArIDI7CisgICAgfQorCisgICAgKnBuQ29uc3VtZWQgPSBsZW47CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworCit9CisKKworCitzdGF0aWMgdEFOSV9VMzIgVW5wYWNrQ29yZSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0RkZEZWZuICBGRnNbXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHRJRURlZm4gIElFc1tdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEZybSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCAgIG5Gcm0pOworc3RhdGljIHRBTklfVTMyIFBhY2tDb3JlKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdEZGRGVmbiAgRkZzW10sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHRJRURlZm4gIElFc1tdKTsKK3N0YXRpYyB0QU5JX1UzMiBHZXRQYWNrZWRTaXplQ29yZSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwRnJtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5OZWVkZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHRJRURlZm4gIElFc1tdKTsKKworCit0QU5JX1UzMiBkb3QxMWZVbnBhY2tUbHZDb21tb25GdW5jKHRwQW5pU2lyR2xvYmFsIHBDdHgsIHRBTklfVTggKnBCdWYsIHRBTklfVTE2IHRsdmxlbiwgdEFOSV9VOCAqcERzdFByZXNlbnQsIHRBTklfVTggKnBEc3RGaWVsZCkKK3sKKyAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgICh2b2lkKXRsdmxlbjsgLyogU2h1dHVwIHRoZSBjb21waWxlciAqLworCisgICAgKnBEc3RQcmVzZW50ID0gMTsKKyAgICAqcERzdEZpZWxkID0gKnBCdWY7CisgICAgKHZvaWQpcEN0eDsKKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmVW5wYWNrVGx2Q29tbW9uRnVuYy4gKi8KKwordEFOSV9VMzIgZG90MTFmVW5wYWNrVGx2Q29tbW9uRnVuYzIodHBBbmlTaXJHbG9iYWwgIHBDdHgsIHRBTklfVTggKnBCdWYsIHRBTklfVTE2IHRsdmxlbiwgdEFOSV9VOCAqcERzdFByZXNlbnQsIHRBTklfVTE2ICpwRHN0U3RhdGUpCit7CisgICAgdEFOSV9VMzIgc3RhdHVzID0gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7CisgICAgKHZvaWQpdGx2bGVuOyAvKiBTaHV0dXAgdGhlIGNvbXBpbGVyICovCisKKyAgICAqcERzdFByZXNlbnQgPSAxOworICAgIGZyYW1lc250b2hzKHBDdHgsIHBEc3RTdGF0ZSwgcEJ1ZiwgMSk7CisgICAgKHZvaWQpcEN0eDsKKyAgICByZXR1cm4gc3RhdHVzOworCit9IC8qIEVuZCBkb3QxMWZVbnBhY2tUbHZDb21tb25GdW5jMi4gKi8KKwordm9pZCBkb3QxMWZVbnBhY2tGZkNvbW1vbkZ1bmModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLCB0QU5JX1UxNiAqcERzdEZpZWxkKQoreworICAgIGZyYW1lc250b2hzKHBDdHgsIHBEc3RGaWVsZCwgcEJ1ZiwgMCk7CisgICAgKHZvaWQpcEN0eDsKK30gLyogRW5kIGRvdDExZlVucGFja0ZmQ29tbW9uRnVuYy4gKi8KKwordEFOSV9VMzIgZG90MTFmVW5wYWNrSWVDb21tb25GdW5jKHRwQW5pU2lyR2xvYmFsIHBDdHgsIHRBTklfVTggKnBCdWYsIHRBTklfVTggaWVsZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBEc3RQcmVzZW50ICwgdEFOSV9VOCAqcERzdEZpZWxkKQoreworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgICh2b2lkKWllbGVuOworICAgICh2b2lkKXBCdWY7CisgICAgaWYgKCgqcERzdFByZXNlbnQpKSBzdGF0dXMgPSBET1QxMUZfRFVQTElDQVRFX0lFOworICAgICpwRHN0UHJlc2VudCA9IDE7CisgICAgKnBEc3RGaWVsZCA9ICpwQnVmOworICAgICh2b2lkKXBDdHg7CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlVucGFja0llQ29tb25GdW5jLiAqLwordHlwZWRlZiBzdHJ1Y3Qgc1RMVkRlZm4geworICAgIHRBTklfVTMyICAgb2Zmc2V0OworICAgIHRBTklfVTMyICAgcHJlc2VuY2VPZmZzZXQ7CisgICAgY29uc3QgY2hhciAqICAgbmFtZTsKKyAgICB0QU5JX1UxNiAgIHNpZzsKKyAgICB0QU5JX1UzMiAgIGlkOworICAgIHRBTklfVTMyICAgcGVjOworICAgIHRBTklfVTMyICAgbWluU2l6ZTsKKyAgICB0QU5JX1UzMiAgIG1heFNpemU7CisgICAgdEFOSV9VOCAgICBmTWFuZGF0b3J5OworICAgIHRBTklfVTggICAgc1R5cGU7CisgICAgdEFOSV9VOCAgICBzTGVuOworICAgIHRBTklfVTggICAgZk1zYjsKK30gdFRMVkRlZm47CisKK3N0YXRpYyBjb25zdCB0VExWRGVmbiogRmluZFRMVkRlZm4oIHRwQW5pU2lyR2xvYmFsICAgIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdFRMVkRlZm4gICAgICBUTFZzWyBdICkKK3sKKyAgICBjb25zdCB0VExWRGVmbiAqcFRsdjsKKyAgICB0QU5JX1UzMiAgIHBlYzsKKyAgICB0QU5JX1UxNiAgIGlkOworCisgICAgcFRsdiA9ICYoIFRMVnNbIDAgXSApOworICAgICh2b2lkKXBDdHg7CisgICAgaWYgKCBwVGx2LT5zVHlwZSA9PSAyICkKKyAgICAgICBmcmFtZXNudG9ocyggcEN0eCwgJmlkLCBwQnVmLCAxICk7CisgICAgZWxzZQorICAgICAgIGlkID0gKnBCdWY7CisKKyAgICB3aGlsZSAoIDB4ZmZmZiAhPSBwVGx2LT5pZCApCisgICAgeworICAgICAgICBpZiAoIGlkID09IHBUbHYtPmlkICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKCAwID09IHBUbHYtPnBlYyApIHJldHVybiBwVGx2OworCisgICAgICAgICAgICBpZiggbkJ1ZiA+IDUgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBlYyA9ICAoICggKiAoIHBCdWYgKyA0ICkgKSA8PCAxNiApIHwKKyAgICAgICAgICAgICAgICAgICAgICAgKCAoICogKCBwQnVmICsgNSApICkgPDwgIDggKSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAqICggcEJ1ZiArIDYgKTsKKyAgICAgICAgICAgICAgICBpZiAoIHBlYyA9PSBwVGx2LT5wZWMgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBUbHY7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgKytwVGx2OworICAgIH0KKworICAgIHJldHVybiBOVUxMOworfQorCitzdGF0aWMgdEFOSV9VMzIgVW5wYWNrVGx2Q29yZSggdHBBbmlTaXJHbG9iYWwgICBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0VExWRGVmbiAgICAgVExWc1sgXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwRnJtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCAgICAgICBuRnJtICk7CitzdGF0aWMgdEFOSV9VMzIgUGFja1RsdkNvcmUodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0VExWRGVmbiAgVExWc1tdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcGlkeCk7CitzdGF0aWMgdEFOSV9VMzIgR2V0UGFja2VkU2l6ZVRsdkNvcmUodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEZybSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuTmVlZGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0VExWRGVmbiAgVExWc1tdKTsKKworI2RlZmluZSBTaWdGZkFJRCAoIDB4MDAwMSApCisKK3ZvaWQgZG90MTFmVW5wYWNrRmZBY3Rpb24odHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkZmQWN0aW9uICpwRHN0KQoreworICAgIHBEc3QtPmFjdGlvbiA9ICpwQnVmOworICAgICh2b2lkKXBDdHg7Cit9IC8qIEVuZCBkb3QxMWZVbnBhY2tGZkFjdGlvbi4gKi8KKworI2RlZmluZSBTaWdGZkFjdGlvbiAoIDB4MDAwMiApCisKK3ZvaWQgZG90MTFmVW5wYWNrRmZBZGRCQVBhcmFtZXRlclNldCh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkZmQWRkQkFQYXJhbWV0ZXJTZXQgKnBEc3QpCit7CisgICAgdEFOSV9VMTYgdG1wMF9fOworICAgIGZyYW1lc250b2hzKHBD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2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZGZkxpbmtNYXJnaW4gKnBEc3QpCit7CisgICAgcERzdC0+bGlua01hcmdpbiA9ICpwQnVmOworICAgICh2b2lkKXBDdHg7Cit9IC8qIEVuZCBkb3QxMWZVbnBhY2tGZkxpbmtNYXJnaW4uICovCisKKyNkZWZpbmUgU2lnRmZMaW5rTWFyZ2luICggMHgwMDBlICkKKworI2RlZmluZSBTaWdGZkxpc3RlbkludGVydmFsICggMHgwMDBmICkKKwordm9pZCBkb3QxMWZVbnBhY2tGZk1heFR4UG93ZXIodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmRmZNYXhUeFBvd2VyICpwRHN0KQoreworICAgIHBEc3QtPm1heFR4UG93ZXIgPSAqcEJ1ZjsKKyAgICAodm9pZClwQ3R4OworfSAvKiBFbmQgZG90MTFmVW5wYWNrRmZNYXhUeFBvd2VyLiAqLworCisjZGVmaW5lIFNpZ0ZmTWF4VHhQb3dlciAoIDB4MDAxMCApCisKK3ZvaWQgZG90MTFmVW5wYWNrRmZOdW1PZlJlcGV0aXRpb25zKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkZmTnVtT2ZSZXBldGl0aW9ucyAqcERzdCkKK3sKKyAgICBmcmFtZXNudG9ocyhwQ3R4LCAmcERzdC0+cmVwZXRpdGlvbnMsIHBCdWYsIDApOworICAgICh2b2lkKXBDdHg7Cit9IC8qIEVuZCBkb3QxMWZVbnBhY2tGZk51bU9mUmVwZXRpdGlvbnMuICovCisKKyNkZWZpbmUgU2lnRmZOdW1PZlJlcGV0aXRpb25zICggMHgwMDExICkKKwordm9pZCBkb3QxMWZVbnBhY2tGZk9wZXJhdGluZ01vZGUodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmRmZPcGVyYXRpbmdNb2RlICpwRHN0KQoreworICAgIHRBTklfVTggdG1wNF9fOworICAgIHRtcDRfXyA9ICpwQnVmOworICAgIHBEc3QtPmNoYW5XaWR0aCA9IHRtcDRfXyA+PiAwICYgMHgzOworICAgIHBEc3QtPnJlc2VydmVkID0gdG1wNF9fID4+IDIgJiAweDM7CisgICAgcERzdC0+cnhOU1MgPSB0bXA0X18gPj4gNCAmIDB4NzsKKyAgICBwRHN0LT5yeE5TU1R5cGUgPSB0bXA0X18gPj4gNyAmIDB4MTsKKyAgICAodm9pZClwQ3R4OworfSAvKiBFbmQgZG90MTFmVW5wYWNrRmZPcGVyYXRpbmdNb2RlLiAqLworCisjZGVmaW5lIFNpZ0ZmT3BlcmF0aW5nTW9kZSAoIDB4MDAxMiApCisKK3ZvaWQgZG90MTFmVW5wYWNrRmZQMlBPVUkodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkZmUDJQT1VJICpwRHN0KQoreworICAgIGZyYW1lc250b2hsKHBDdHgsICZwRHN0LT5vdWksIHBCdWYsIDApOworICAgICh2b2lkKXBDdHg7Cit9IC8qIEVuZCBkb3QxMWZVbnBhY2tGZlAyUE9VSS4gKi8KKworI2RlZmluZSBTaWdGZlAyUE9VSSAoIDB4MDAxMyApCisKK3ZvaWQgZG90MTFmVW5wYWNrRmZQMlBPVUlTdWJUeXBlKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkZmUDJQT1VJU3ViVHlwZSAqcERzdCkKK3sKKyAgICBwRHN0LT5vdWlTdWJ0eXBlID0gKnBCdWY7CisgICAgKHZvaWQpcEN0eDsKK30gLyogRW5kIGRvdDExZlVucGFja0ZmUDJQT1VJU3ViVHlwZS4gKi8KKworI2RlZmluZSBTaWdGZlAyUE9VSVN1YlR5cGUgKCAweDAwMTQgKQorCit2b2lkIGRvdDExZlVucGFja0ZmUkNQSSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZGZlJDUEkgKnBEc3QpCit7CisgICAgcERzdC0+cmNwaSA9ICpwQnVmOworICAgICh2b2lkKXBDdHg7Cit9IC8qIEVuZCBkb3QxMWZVbnBhY2tGZlJDUEkuICovCisKKyNkZWZpbmUgU2lnRmZSQ1BJICggMHgwMDE1ICkKKwordm9pZCBkb3QxMWZVbnBhY2tGZlJTTkkodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmRmZSU05JICpwRHN0KQoreworICAgIHBEc3QtPnJzbmkgPSAqcEJ1ZjsKKyAgICAodm9pZClwQ3R4OworfSAvKiBFbmQgZG90MTFmVW5wYWNrRmZSU05JLiAqLworCisjZGVmaW5lIFNpZ0ZmUlNOSSAoIDB4MDAxNiApCisKKyNkZWZpbmUgU2lnRmZSZWFzb24gKCAweDAwMTcgKQorCit2b2lkIGRvdDExZlVucGFja0ZmUnhBbnRlbm5hSWQodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZGZlJ4QW50ZW5uYUlkICpwRHN0KQoreworICAgIHBEc3QtPmFudGVubmFJZCA9ICpwQnVmOworICAgICh2b2lkKXBDdHg7Cit9IC8qIEVuZCBkb3QxMWZVbnBhY2tGZlJ4QW50ZW5uYUlkLiAqLworCisjZGVmaW5lIFNpZ0ZmUnhBbnRlbm5hSWQgKCAweDAwMTggKQorCit2b2lkIGRvdDExZlVucGFja0ZmU01Qb3dlck1vZGVTZXQodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZGZlNNUG93ZXJNb2RlU2V0ICpwRHN0KQoreworICAgIHRBTklfVTggdG1wNV9fOworICAgIHRtcDVfXyA9ICpwQnVmOworICAgIHBEc3QtPlBvd2VyU2F2ZV9FbiA9IHRtcDVfXyA+PiAwICYgMHgxOworICAgIHBEc3QtPk1vZGUgPSB0bXA1X18gPj4gMSAmIDB4MTsKKyAgICBwRHN0LT5yZXNlcnZlZCA9IHRtcDVfXyA+PiAyICYgMHgzZjsKKyAgICAodm9pZClwQ3R4OworfSAvKiBFbmQgZG90MTFmVW5wYWNrRmZTTVBvd2VyTW9kZVNldC4gKi8KKworI2RlZmluZSBTaWdGZlNNUG93ZXJNb2RlU2V0ICggMHgwMDE5ICkKKworI2RlZmluZSBTaWdGZlN0YXR1cyAoIDB4MDAxYSApCisKK3ZvaWQgZG90MTFmVW5wYWNrRmZTdGF0dXNDb2RlKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkZmU3RhdHVzQ29kZSAqcERzdCkKK3sKKyAgICBwRHN0LT5zdGF0dXNDb2RlID0gKnBCdWY7CisgICAgKHZvaWQpcEN0eDsKK30gLyogRW5kIGRvdDExZlVucGFja0ZmU3RhdHVzQ29kZS4gKi8KKworI2RlZmluZSBTaWdGZlN0YXR1c0NvZGUgKCAweDAwMWIgKQorCit2b2lkIGRvdDExZlVucGFja0ZmVFBDRWxlSUQodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZGZlRQQ0VsZUlEICpwRHN0KQoreworICAgIHBEc3QtPlRQQ0lkID0gKnBCdWY7CisgICAgKHZvaWQpcEN0eDsKK30gLyogRW5kIGRvdDExZlVucGFja0ZmVFBDRWxlSUQuICovCisKKyNkZWZpbmUgU2lnRmZUUENFbGVJRCAoIDB4MDAxYyApCisKK3ZvaWQgZG90MTFmVW5wYWNrRmZUUENFbGVMZW4odHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkZmVFBDRWxlTGVuICpwRHN0KQoreworICAgIHBEc3QtPlRQQ0xlbiA9ICpwQnVmOworICAgICh2b2lkKXBDdHg7Cit9IC8qIEVuZCBkb3QxMWZVbnBhY2tGZlRQQ0VsZUxlbi4gKi8KKworI2RlZmluZSBTaWdGZlRQQ0VsZUxlbiAoIDB4MDAxZCApCisKK3ZvaWQgZG90MTFmVW5wYWNrRmZUU0luZm8odHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkZmVFNJbmZvICpwRHN0KQoreworICAgIHRBTklfVTMyIHRtcDZfXzsKKyAgICBm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AoIDB4MDAxZiApCisKK3ZvaWQgZG90MTFmVW5wYWNrRmZUcmFuc2FjdGlvbklkKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkZmVHJhbnNhY3Rpb25JZCAqcERzdCkKK3sKKyAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBEc3QtPnRyYW5zSWQsIHBCdWYsIDIpOworICAgICh2b2lkKXBDdHg7Cit9IC8qIEVuZCBkb3QxMWZVbnBhY2tGZlRyYW5zYWN0aW9uSWQuICovCisKKyNkZWZpbmUgU2lnRmZUcmFuc2FjdGlvbklkICggMHgwMDIwICkKKwordm9pZCBkb3QxMWZVbnBhY2tGZlR4QW50ZW5uYUlkKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmRmZUeEFudGVubmFJZCAqcERzdCkKK3sKKyAgICBwRHN0LT5hbnRlbm5hSWQgPSAqcEJ1ZjsKKyAgICAodm9pZClwQ3R4OworfSAvKiBFbmQgZG90MTFmVW5wYWNrRmZUeEFudGVubmFJZC4gKi8KKworI2RlZmluZSBTaWdGZlR4QW50ZW5uYUlkICggMHgwMDIxICkKKwordm9pZCBkb3QxMWZVbnBhY2tGZlR4UG93ZXIodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmRmZUeFBvd2VyICpwRHN0KQoreworICAgIHBEc3QtPnR4UG93ZXIgPSAqcEJ1ZjsKKyAgICAodm9pZClwQ3R4OworfSAvKiBFbmQgZG90MTFmVW5wYWNrRmZUeFBvd2VyLiAqLworCisjZGVmaW5lIFNpZ0ZmVHhQb3dlciAoIDB4MDAyMiApCisKK3ZvaWQgZG90MTFmVW5wYWNrRmZWaHRNZW1iZXJzaGlwU3RhdHVzQXJyYXkodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkZmVmh0TWVtYmVyc2hpcFN0YXR1c0FycmF5ICpwRHN0KQoreworICAgIERPVDExRl9NRU1DUFkocEN0eCwgcERzdC0+bWVtYmVyc2hpcFN0YXR1c0FycmF5LCBwQnVmLCA4KTsKKyAgICAodm9pZClwQ3R4OworfSAvKiBFbmQgZG90MTFmVW5wYWNrRmZWaHRNZW1iZXJzaGlwU3RhdHVzQXJyYXkuICovCisKKyNkZWZpbmUgU2lnRmZWaHRNZW1iZXJzaGlwU3RhdHVzQXJyYXkgKCAweDAwMjMgKQorCit2b2lkIGRvdDExZlVucGFja0ZmVmh0VXNlclBvc2l0aW9uQXJyYXkodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZGZlZodFVzZXJQb3NpdGlvbkFycmF5ICpwRHN0KQoreworICAgIERPVDExRl9NRU1DUFkocEN0eCwgcERzdC0+dXNlclBvc2l0aW9uQXJyYXksIHBCdWYsIDE2KTsKKyAgICAodm9pZClwQ3R4OworfSAvKiBFbmQgZG90MTFmVW5wYWNrRmZWaHRVc2VyUG9zaXRpb25BcnJheS4gKi8KKworI2RlZmluZSBTaWdGZlZodFVzZXJQb3NpdGlvbkFycmF5ICggMHgwMDI0ICkKKwordEFOSV9VMzIgZG90MTFmVW5wYWNrVGx2QXV0aG9yaXpl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wgcEJ1ZiwgMCk7CisgICAgcEJ1ZiArPSAyOworICAgIHRsdmxlbiAtPSAodEFOSV9VOCkyOworICAgIERPVDExRl9NRU1DUFkocEN0eCwgcERzdC0+cHJpbWFyeURldmljZVR5cGUsIHBCdWYsIDgpOworICAgIHBCdWYgKz0gODsKKyAgICB0bHZsZW4gLT0gKHRBTklfVTgpODsKKyAgICAodm9pZClwQ3R4OworICAgIHN0YXR1cyB8PSBVbnBhY2tUbHZDb3JlKHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICBwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgdGx2bGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgVExWU19QMlBEZXZpY2VJbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgKCB0QU5JX1U4KiApcERzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZigqcERzdCkpOworICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZVbnBhY2tUbHZQMlBEZXZpY2VJbmZvLiAqLworCisjZGVmaW5lIFNpZ1RsdlAyUERldmljZUluZm8gKCAweDAwMTkgKQorCisKK3RBTklfVTMyIGRvdDExZlVucGFja1RsdlAyUEdyb3VwQnNzaWQodHBBbmlTaXJHbG9iYWwgcEN0eCwgdEFOSV9VOCAqcEJ1ZiwgdEFOSV9VMTYgdGx2bGVuLCB0RG90MTFmVExWUDJQR3JvdXBCc3NpZCAqcERzdCkKK3sKKyAgICB0QU5JX1UzMiBzdGF0dXMgPSBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKKyAgICBwRHN0LT5wcmVzZW50ID0gMTsKKyAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBEc3QtPlAyUEdyb3VwQnNzaWQsIHBCdWYsIDYpOworICAgIHBCdWYgKz0gNjsKKyAgICB0bHZsZW4gLT0gKHRBTklfVTgpNjsKKyAgICAodm9pZClwQ3R4OworICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZ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N0KQoreworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgIHBEc3QtPnByZXNlbnQgPSAxOworICAgIERPVDExRl9NRU1DUFkocEN0eCwgcERzdC0+dmVuZG9ySWQsIHBCdWYsIDMpOworICAgIHBCdWYgKz0gMzsKKyAgICB0bHZsZW4gLT0gKHRBTklfVTgpMzsKKyAgICAodm9pZClwQ3R4OworICAgIHN0YXR1cyB8PSBVbnBhY2tUbHZDb3JlKHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICBwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgdGx2bGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgVExWU19WZW5kb3JFeHRlbnNpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAoIHRBTklfVTgqIClwRHN0LAorICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCpwRHN0KSk7CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlVucGFja1RsdlZlbmRvckV4dGVuc2lvbi4gKi8KKworI2RlZmluZSBTaWdUbHZWZW5kb3JFeHRlbnNpb24gKCAweDAwMjggKQorCisKK3RBTklfVTMyIGRvdDExZlVucGFja1RsdlZlcnNpb24odHBBbmlTaXJHbG9iYWwgcEN0eCwgdEFOSV9VOCAqcEJ1ZiwgdEFOSV9VMTYgdGx2bGVuLCB0RG90MTFmVExWVmVyc2lvbiAqcERzdCkKK3sKKyAgICB0QU5JX1UzMiBzdGF0dXMgPSBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKKyAgICB0QU5JX1U4IHRtcDhfXzsKKyAgICBwRHN0LT5wcmVzZW50ID0gMTsKKyAgICB0bXA4X18gPSAqcEJ1ZjsKKyAgICBwQnVmICs9IDE7CisgICAgdGx2bGVuIC09IDE7CisgICAgcERzdC0+bWlub3IgPSB0bXA4X18gPj4gMCAmIDB4ZjsKKyAgICBwRHN0LT5tYWpvciA9IHRtcDhfXyA+Pi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1ZjsKKyAgICBwQnVmICs9IDE7CisgICAgaWVsZW4gLT0gKHRBTklfVTgpMTsKKyAgICBwRHN0LT5udW1fYnVpbGRfdmVyc2lvbiA9ICh0QU5JX1U4KSggaWVsZW4gKTsKKyAgICBpZiAoaWVsZW4gPiAyMCl7CisgICAgICAgIHBEc3QtPnByZXNlbnQgPSAwOworICAgICAgICByZXR1cm4gRE9UMTFGX1NLSVBQRURfQkFEX0lFOworICAgIH0KKworICAgIERPVDExRl9NRU1DUFkocEN0eCwgcERzdC0+YnVpbGRfdmVyc2lvbiwgcEJ1ZiwgKCBpZWxlbiApICk7CisgICAgKHZvaWQpcEN0eDsKKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmVW5wYWNrSWVWZXJzaW9uLiAqLworCisjZGVmaW5lIFNpZ0llVmVyc2lvbiAoIDB4MDAxNiApCisKKwordEFOSV9VMzIgZG90MTFmVW5wYWNrSWVXRFModHBBbmlTaXJHbG9iYWwgcEN0eCwgdEFOSV9VOCAqcEJ1ZiwgdEFOSV9VOCBpZWxlbiwgdERvdDExZklFV0RTICpwRHN0KQoreworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgICh2b2lkKSBwQnVmOyAodm9pZClpZWxlbjsgLyogU2h1dHVwIHRoZSBjb21waWxlciAqLworICAgIGlmIChwRHN0LT5wcmVzZW50KSBzdGF0dXMgPSBET1QxMUZfRFVQTElDQVRFX0lFOworICAgIHBEc3QtPnByZXNlbnQgPSAxOworICAgIHBEc3QtPm51bV93ZHNEYXRhID0gKHRBTklfVTgpKCBpZWxlbiApOworICAgIGlmIChpZWxlbiA+IDY0KXsKKyAgICAgICAgcERzdC0+cHJlc2VudCA9IDA7CisgICAgICAgIHJldHVybiBET1QxMUZfU0tJUFBFRF9CQURfSUU7CisgICAgfQorCisgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwRHN0LT53ZHNEYXRhLCBwQnVmLCAoIGllbGVuICkgKTsKKyAgICAodm9pZClwQ3R4OworICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZVbnBhY2tJZVdEUy4gKi8KKworI2RlZmluZSBTaWdJZVdEUyAoIDB4MDAxNyApCisKKwordEFOSV9VMzIgZG90MTFmVW5wYWNrSWVBUENoYW5uZWxSZXBvcnQodHBBbmlTaXJHbG9iYWwgcEN0eCwgdEFOSV9VOCAqcEJ1ZiwgdEFOSV9VOCBpZWxlbiwgdERvdDExZklFQVBDaGFubmVsUmVwb3J0ICpwRHN0KQoreworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgICh2b2lkKSBwQnVmOyAodm9pZClpZWxlbjsgLyogU2h1dHVwIHRoZSBjb21waWxlciAqLworICAgIGlmIChwRHN0LT5wcmVzZW50KSBzdGF0dXMgPSBET1QxMUZfRFVQTElDQVRFX0lFOworICAgIHBEc3QtPnByZXNlbnQgPSAxOworICAgIHBEc3QtPnJlZ3VsYXRvcnlDbGFzcyA9ICpwQnVmOworICAgIHBCdWYgKz0gMTsKKyAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgIHBEc3QtPm51bV9jaGFubmVsTGlzdCA9ICh0QU5JX1U4KSggaWVsZW4gKTsKKyAgICBpZiAoaWVsZW4gPiA1MCl7CisgICAgICAgIHBEc3QtPnByZXNlbnQgPSAwOworICAgICAgICByZXR1cm4gRE9UMTFGX1NLSVBQRURfQkFEX0lFOworICAgIH0KKworICAgIERPVDExRl9NRU1DUFkocEN0eCwgcERzdC0+Y2hhbm5lbExpc3QsIHBCdWYsICggaWVsZW4gKSApOworICAgICh2b2lkKXBDdHg7CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlVucGFja0llQVBDaGFubmVsUmVwb3J0LiAqLworCisjZGVmaW5lIFNpZ0llQVBDaGFubmVsUmVwb3J0ICggMHgwMDE4ICkKKworCit0QU5JX1UzMiBkb3Q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ID0gKnBCdWY7CisgICAgcEJ1ZiArPSAxOworICAgIGllbGVuIC09ICh0QU5JX1U4KTE7CisgICAgZnJhbWVzbnRvaHMocEN0eCwgJnBEc3QtPnN0YXR1c0NvZGUsIHBCdWYsIDApOworICAgICh2b2lkKXBDdHg7CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlVucGFja0llUklDRGF0YS4gKi8KKworI2RlZmluZSBTaWdJZVJJQ0RhdGEgKCAweDAwMWUgKQorCisKK3RBTklfVTMyIGRvdDExZlVucGFja0llUklDRGVzY3JpcHRvcih0cEFuaVNpckdsb2JhbCBwQ3R4LCB0QU5JX1U4ICpwQnVmLCB0QU5JX1U4IGllbGVuLCB0RG90MTFmSUVSSUNEZXNjcmlwdG9yICpwRHN0KQoreworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgICh2b2lkKSBwQnVmOyAodm9pZClpZWxlbjsgLyogU2h1dHVwIHRoZSBjb21waWxlciAqLworICAgIGlmIChwRHN0LT5wcmVzZW50KSBzdGF0dXMgPSBET1QxMUZfRFVQTElDQVRFX0lFOworICAgIHBEc3QtPnByZXNlbnQgPSAxOworICAgIHBEc3QtPnJlc291cmNlVHlwZSA9ICpwQnVmOworICAgIHBCdWYgKz0gMTsKKyAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgIHBEc3QtPm51bV92YXJpYWJsZURhdGEgPSAodEFOSV9VOCkoIGllbGVuICk7CisgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwRHN0LT52YXJpYWJsZURhdGEsIHBCdWYsICggaWVsZW4gKSApOworICAgICh2b2lkKXBDdHg7CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlVucGFja0llUklDRGVzY3JpcHRvci4gKi8KKworI2RlZmluZSBTaWdJZVJJQ0Rlc2NyaXB0b3IgKCAweDAwMWYgKQorCisKK3RBTklfVTMyIGRvdDExZlVucGFja0llUlJ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dGhQYXJhbXMuc291cmNlLCBwQnVmLCA2KTsKKyAgICAgICAgICAgIHBCdWYgKz0gNjsKKyAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTY7CisgICAgICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBEc3QtPmluZm8uRXRoUGFyYW1zLmRlc3QsIHBCdWYsIDYpOworICAgICAgICAgICAgcEJ1ZiArPSA2OworICAgICAgICAgICAgaWVsZW4gLT0gKHRBTklfVTgpNjsKKyAgICAgICAgICAgIGZyYW1lc250b2hzKHBDdHgsICZwRHN0LT5pbmZvLkV0aFBhcmFtcy50eXBlLCBwQnVmLCAwKTsKKyAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTI7CisgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICBwRHN0LT5pbmZvLklwUGFyYW1zLnZlcnNpb24gPSAqcEJ1ZjsKKyAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTE7CisgICAgICAgICAgICBzd2l0Y2ggKHBEc3QtPmluZm8uSXBQYXJhbXMudmVyc2lvbikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICAgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcERzdC0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5zb3VyY2UsIHBCdWYsIDQpOworICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDQ7CisgICAgICAgICAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTQ7CisgICAgICAgICAgICAgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcERzdC0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5kZXN0LCBwQnVmLCA0KTsKKyAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSA0OworICAgICAgICAgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCk0OworICAgICAgICAgICAgICAgICAgICBmcmFtZXNudG9ocyhwQ3R4LCAmcERzdC0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5zcmNfcG9ydCwgcEJ1ZiwgMCk7CisgICAgICAgICAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgICAgICAgICAgICAgaWVsZW4gLT0gKHRBTklfVTgpMjsKKyAgICAgICAgICAgICAgICAgICAgZnJhbWVzbnRvaHMocEN0eCwgJnBEc3QtPmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuZGVzdF9wb3J0LCBwQnVmLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkyOworICAgICAgICAgICAgICAgICAgICBwRHN0LT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLkRTQ1AgPSAqcEJ1ZjsKKyAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgICAgICAgICAgICAgICAgICBwRHN0LT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLnByb3RvID0gKnBCdWY7CisgICAgICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgaWVsZW4gLT0gKHRBTklfVTgpMTsKKyAgICAgICAgICAgICAgICAgICAgcERzdC0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5yZXNlcnZlZCA9ICpwQnVmOworICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTE7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSA2OgorICAgICAgICAgICAgICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBEc3QtPmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuc291cmNlLCBwQnVmLCAxNik7CisgICAgICAgICAgICAgICAgICAgIHBCdWYgKz0gMTY7CisgICAgICAgICAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTE2OworICAgICAgICAgICAgICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBEc3QtPmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZGVzdCwgcEJ1ZiwgMTYpOworICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDE2OworICAgICAgICAgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkxNjsKKyAgICAgICAgICAgICAgICAgICAgZnJhbWVzbnRvaHMocEN0eCwgJnBEc3QtPmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuc3JjX3BvcnQsIHBCdWYsIDApOworICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTI7CisgICAgICAgICAgICAgICAgICAgIGZyYW1lc250b2hzKHBDdHgsICZwRHN0LT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmRlc3RfcG9ydCwgcEJ1ZiwgMCk7CisgICAgICAgICAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgICAgICAgICAgICAgaWVsZW4gLT0gKHRBTklfVTgpMjsKKyAgICAgICAgICAgICAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwRHN0LT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmZsb3dfbGFiZWwsIHBCdWYsIDMpOworICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDM7CisgICAgICAgICAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTM7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIDI6CisgICAgICAgICAgICBmcmFtZXNudG9ocyhwQ3R4LCAmcERzdC0+aW5mby5QYXJhbXM4MDIxZHEudGFnX3R5cGUsIHBCdWYsIDApOworICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgaWVsZW4gLT0gKHRBTklfVTgpMjsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlVucGFja0llVENMQVMuICovCisKKyNkZWZpbmUgU2lnSWVUQ0xBUyAoIDB4MDAyNCApCisKKworI2RlZmluZSBTaWdJZVRDTEFTU1BST0MgKCAweDAwMjUgKQorCisKK3RBTklfVTMyIGRvdDExZlVucGFja0llVFNEZWxheSh0cEFuaVNpckdsb2JhbCBwQ3R4LCB0QU5JX1U4ICpwQnVmLCB0QU5JX1U4IGllbGVuLCB0RG90MTFmSUVUU0RlbGF5ICpwRHN0KQoreworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgICh2b2lkKSBwQnVmOyAodm9pZClpZWxlbjsgLyogU2h1dHVwIHRoZSBjb21waWxlciAqLworICAgIGlmIChwRHN0LT5wcmVzZW50KSBzdGF0dXMgPSBET1QxMUZfRFVQTElDQVRFX0lFOworICAgIHBEc3QtPnByZXNlbnQgPSAxOworICAgIGZyYW1lc250b2hsKHBDdHgsICZwRHN0LT5kZWxheSwgcEJ1ZiwgMCk7CisgICAgKHZvaWQpcEN0eDsKKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmVW5wYWNrSWVUU0RlbGF5LiAqLworCisjZGVmaW5lIFNpZ0llVFNEZWxheSAoIDB4MDAyNiApCisKKwordEFOSV9VMzIgZG90MTFmVW5wYWNrSWVUU1BFQy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nQgPSAwOworICAgICAgICAgICAgcmV0dXJuICggc3RhdHVzIHwgRE9UMTFGX0JBRF9GSVhFRF9WQUxVRSApOworICAgIH0KKyAgICBwRHN0LT51c2VyX3ByaW9yaXR5ID0gKnBCdWY7CisgICAgcEJ1ZiArPSAxOworICAgIGllbGVuIC09ICh0QU5JX1U4KTE7CisgICAgcERzdC0+Y2xhc3NpZmllcl90eXBlID0gKnBCdWY7CisgICAgcEJ1ZiArPSAxOworICAgIGllbGVuIC09ICh0QU5JX1U4KTE7CisgICAgcERzdC0+Y2xhc3NpZmllcl9tYXNrID0gKnBCdWY7CisgICAgcEJ1ZiArPSAxOworICAgIGllbGVuIC09ICh0QU5JX1U4KTE7CisgICAgc3dpdGNoIChwRHN0LT5jbGFzc2lmaWVyX3R5cGUpCisgICAgeworICAgICAgICBjYXNlIDA6CisgICAgICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBEc3QtPmluZm8uRXRoUGFyYW1zLnNvdXJjZSwgcEJ1ZiwgNik7CisgICAgICAgICAgICBwQnVmICs9IDY7CisgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCk2OworICAgICAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwRHN0LT5pbmZvLkV0aFBhcmFtcy5kZXN0LCBwQnVmLCA2KTsKKyAgICAgICAgICAgIHBCdWYgKz0gNjsKKyAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTY7CisgICAgICAgICAgICBmcmFtZXNudG9ocyhwQ3R4LCAmcERzdC0+aW5mby5FdGhQYXJhbXMudHlwZSwgcEJ1ZiwgMCk7CisgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkyOworICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgcERzdC0+aW5mby5JcFBhcmFtcy52ZXJzaW9uID0gKnBCdWY7CisgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgICAgICAgICAgc3dpdGNoIChwRHN0LT5pbmZvLklwUGFyYW1zLnZlcnNpb24pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2FzZSA0OgorICAgICAgICAgICAgICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBEc3QtPmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuc291cmNlLCBwQnVmLCA0KTsKKyAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSA0OworICAgICAgICAgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCk0OworICAgICAgICAgICAgICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBEc3QtPmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuZGVzdCwgcEJ1ZiwgNCk7CisgICAgICAgICAgICAgICAgICAgIHBCdWYgKz0gNDsKKyAgICAgICAgICAgICAgICAgICAgaWVsZW4gLT0gKHRBTklfVTgpNDsKKyAgICAgICAgICAgICAgICAgICAgZnJhbWVzbnRvaHMocEN0eCwgJnBEc3QtPmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuc3JjX3BvcnQsIHBCdWYsIDApOworICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTI7CisgICAgICAgICAgICAgICAgICAgIGZyYW1lc250b2hzKHBDdHgsICZwRHN0LT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLmRlc3RfcG9ydCwgcEJ1ZiwgMCk7CisgICAgICAgICAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgICAgICAgICAgICAgaWVsZW4gLT0gKHRBTklfVTgpMjsKKyAgICAgICAgICAgICAgICAgICAgcERzdC0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5EU0NQID0gKnBCdWY7CisgICAgICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgaWVsZW4gLT0gKHRBTklfVTgpMTsKKyAgICAgICAgICAgICAgICAgICAgcERzdC0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5wcm90byA9ICpwQnVmOworICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTE7CisgICAgICAgICAgICAgICAgICAgIHBEc3QtPmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMucmVzZXJ2ZWQgPSAqcEJ1ZjsKKyAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgNjoKKyAgICAgICAgICAgICAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwRHN0LT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLnNvdXJjZSwgcEJ1ZiwgMTYpOworICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDE2OworICAgICAgICAgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkxNjsKKyAgICAgICAgICAgICAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwRHN0LT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmRlc3QsIHBCdWYsIDE2KTsKKyAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSAxNjsKKyAgICAgICAgICAgICAgICAgICAgaWVsZW4gLT0gKHRBTklfVTgpMTY7CisgICAgICAgICAgICAgICAgICAgIGZyYW1lc250b2hzKHBDdHgsICZwRHN0LT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLnNyY19wb3J0LCBwQnVmLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkyOworICAgICAgICAgICAgICAgICAgICBmcmFtZXNudG9ocyhwQ3R4LCAmcERzdC0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5kZXN0X3BvcnQsIHBCdWYsIDApOworICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTI7CisgICAgICAgICAgICAgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcERzdC0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5mbG93X2xhYmVsLCBwQnVmLCAzKTsKKyAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSAzOworICAgICAgICAgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkzOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgZnJhbWVzbnRvaHMocEN0eCwgJnBEc3QtPmluZm8uUGFyYW1zODAyMWRxLnRhZ190eXBlLCBwQnVmLCAwKTsKKyAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTI7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZVbnBhY2tJZVdNTVRDTEFTLiAqLworCisjZGVmaW5lIFNpZ0llV01NVENMQVMgKCAweDAwMjkgKQorCisKK3RBTklfVTMyIGRvdDExZlVucGFja0llV01NVENMQVNQUk9DKHRwQW5pU2lyR2xvYmFsIHBDdHgsIHRBTklfVTggKnBCdWYsIHRBTklfVTggaWVsZW4sIHREb3QxMWZJRVdNTVRDTEFTUFJPQyAqcERz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AgICAgICAgICAgICBwRHN0LT5wcmVzZW50ID0gMDsKKyAgICAgICAgICAgICAgICByZXR1cm4gRE9UMTFGX1NLSVBQRURfQkFEX0lFOworICAgICAgICB9CisKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwRHN0LT50cmlwbGV0cywgcEJ1ZiwgKCBpZWxlbiApICk7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlVucGFja0llQ291bnRyeS4gKi8KKworI2RlZmluZSBTaWdJZUNvdW50cnkgKCAweDAwMzIgKQorCisKKyNkZWZpbmUgU2lnSWVEU1BhcmFtcyAoIDB4MDAzMyApCisKKwordEFOSV9VMzIgZG90MTFmVW5wYWNrSWVFRENBUGFyYW1TZXQodHBBbmlTaXJHbG9iYWwgcEN0eCwgdEFOSV9VOCAqcEJ1ZiwgdEFOSV9VOCBpZWxlbiwgdERvdDExZklFRURDQVBhcmFtU2V0ICpwRHN0KQoreworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgIHRBTklfVTggdG1wMzJfXzsKKyAgICB0QU5JX1U4IHRtcDMzX187CisgICAgdEFOSV9VOCB0bXAzNF9fOworICAgIHRBTklfVTggdG1wMzVfXzsKKyAgICB0QU5JX1U4IHRtcDM2X187CisgICAgdEFOSV9VOCB0bXAzN19fOworICAgIHRBTklfVTggdG1wMzhfXzsKKyAgICB0QU5JX1U4IHRtcDM5X187CisgICAgKHZvaWQpIHBCdWY7ICh2b2lkKWllbGVuOyAvKiBTaHV0dXAgdGhlIGNvbXBpbGVyICovCisgICAgaWYgKHBEc3QtPnByZXNlbnQpIHN0YXR1cyA9IERPVDExRl9EVVBMSUNBVEVfSUU7CisgICAgcERzdC0+cHJlc2VudCA9IDE7CisgICAgcERzdC0+cW9zID0gKnBCdWY7CisgICAgcEJ1ZiArPSAxOworICAgIGllbGVuIC09ICh0QU5JX1U4KTE7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3ID0gdG1wNDRfXyA+PiAxNSAmIDB4MTsKKyAgICAodm9pZClwQ3R4OworICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZVbnBhY2tJZUV4dENhcC4gKi8KKworI2RlZmluZSBTaWdJZUV4dENhcCAoIDB4MDAzYyApCisKKworI2RlZmluZSBTaWdJZUV4dENoYW5Td2l0Y2hBbm4gKCAweDAwM2QgKQorCisKK3RBTklfVTMyIGRvdDExZlVucGFja0llRXh0U3VwcFJhdGVzKHRwQW5pU2lyR2xvYmFsIHBDdHgsIHRBTklfVTggKnBCdWYsIHRBTklfVTggaWVsZW4sIHREb3QxMWZJRUV4dFN1cHBSYXRlcyAqcERzdCkKK3sKKyAgICB0QU5JX1U4IGk7CisgICAgdEFOSV9VOCByYXRlX2luZHggPSAwOworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgICh2b2lkKSBwQnVmOyAodm9pZClpZWxlbjsgLyogU2h1dHVwIHRoZSBjb21waWxlciAqLworICAgIGlmIChwRHN0LT5wcmVzZW50KSBzdGF0dXMgPSBET1QxMUZfRFVQTElDQVRFX0lFOworICAgIHBEc3QtPnByZXNlbnQgPSAxOworICAgIGZvciAoaSA9IDA7IGkgPCBpZWxlbjsgaSsrKSB7CisgICAgICAgIGlmICgoRE9UMTFGX0lTX0JHX1JBVEUocEJ1ZltpXSAmIDB4N0YpKSAmJgorICAgICAgICAgICAgKHJhdGVfaW5keCA8IDEyKSkgeworICAgICAgICAgICAgcERzdC0+cmF0ZXNbcmF0ZV9pbmR4KytdID0gcEJ1ZltpXTsKKyAgICAgICAgfQorICAgIH0KKworICAgIGlmKHJhdGVfaW5keCA9PSAwKSB7CisgICAgICAgIHBEc3QtPnByZXNlbnQgPSAwOworICAgICAgICByZXR1cm4gRE9UMTFGX1NLSVBQRURfQkFEX0lFOworICAgIH0KKworICAgIHBEc3QtPm51bV9yYXRlcyA9IHJhdGVfaW5keDsKK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lbiAtPSAodEFOSV9VOCkxOworICAgIHBEc3QtPm5zZXRzID0gKnBCdWY7CisgICAgcEJ1ZiArPSAxOworICAgIGllbGVuIC09ICh0QU5JX1U4KTE7CisgICAgcERzdC0+bW9kdWx1cyA9ICpwQnVmOworICAgIHBCdWYgKz0gMTsKKyAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgIHBEc3QtPm9mZnNldCA9ICpwQnVmOworICAgIHBCdWYgKz0gMTsKKyAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgIHBEc3QtPm51bV9yYW5kdGFibGUgPSAodEFOSV9VOCkoIGllbGVuICk7CisgICAgaWYgKGllbGVuID4gMjUxKXsKKyAgICAgICAgcERzdC0+cHJlc2VudCA9IDA7CisgICAgICAgIHJldHVybiBET1QxMUZfU0tJUFBFRF9CQURfSUU7CisgICAgfQorCisgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwRHN0LT5yYW5kdGFibGUsIHBCdWYsICggaWVsZW4gKSApOworICAgICh2b2lkKXBDdHg7CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlVucGFja0llRkhQYXR0VGFibGUuICovCisKKyNkZWZpbmUgU2lnSWVGSFBhdHRUYWJsZSAoIDB4MDA0MSApCisKKworICAgIHN0YXRpYyBjb25zdCB0RkZEZWZuIEZGU19GVEluZm9bIF0gPSB7CisgICAgICAgIHsgTlVMTCwgMCwgMCwgMCx9LAorICAgIH07CisKKyAgICBzdGF0aWMgY29uc3QgdElFRGVmbiBJRVNfRlRJbmZvWyBdID0geworICAgICAgICB7b2Zmc2V0b2YodERvdDExZklFRlRJbmZvLCBSMUtIX0lEKSwgb2Zmc2V0b2YodERvdDExZklFUjFLSF9JRCwgcHJlc2VudCksIDAsICJSMUtIX0lEIiAsIDAsIDgsIDgsIFNpZ0llUjFLSF9JRCwgezAsIDAsIDAsIDAsIDB9LCAwLCBET1QxMUZfRUlEX1IxS0hfSUQsIDAsIH0sCisgICAgICAgIHtv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ICAgcERzdC0+cHJlc2VudCA9IDE7CisgICAgZnJhbWVzbnRvaHMocEN0eCwgJnRtcDQ1X18sIHBCdWYsIDApOworICAgIHBCdWYgKz0gMjsKKyAgICBpZWxlbiAtPSAyOworICAgIHBEc3QtPnJlc2VydmVkID0gdG1wNDVfXyA+PiAwICYgMHhmZjsKKyAgICBwRHN0LT5JRUNvdW50ID0gdG1wNDVfXyA+PiA4ICYgMHhmZjsKKyAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBEc3QtPk1JQywgcEJ1ZiwgMTYpOworICAgIHBCdWYgKz0gMTY7CisgICAgaWVsZW4gLT0gKHRBTklfVTgpMTY7CisgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwRHN0LT5Bbm9uY2UsIHBCdWYsIDMyKTsKKyAgICBwQnVmICs9IDMyOworICAgIGllbGVuIC09ICh0QU5JX1U4KTMyOworICAgIERPVDExRl9NRU1DUFkocEN0eCwgcERzdC0+U25vbmNlLCBwQnVmLCAzMik7CisgICAgcEJ1ZiArPSAzMjsKKyAgICBpZWxlbiAtPSAodEFOSV9VOCkzMjsKKyAgICAodm9pZClwQ3R4OworICAgIHN0YXR1cyB8PSBVbnBhY2tDb3JlKHBDdHgsCisgICAgICAgICAgICAgICAgICAgICBwQnVmLAorICAgICAgICAgICAgICAgICAgICAgaWVsZW4sCisgICAgICAgICAgICAgICAgICAgICBGRlNfRlRJbmZvLAorICAgICAgICAgICAgICAgICAgICAgSUVTX0ZUSW5mbywKKyAgICAgICAgICAgICAgICAgICAgICggdEFOSV9VOCogKXBEc3QsCisgICAgICAgICAgICAgICAgICAgICBzaXplb2YoKnBEc3QpKTsKKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmVW5wYWNrSWVGVEluZm8uICovCisKKyNkZWZpbmUgU2lnSWVGVEluZm8gKCAweDAwNDIgKQorCisKK3RBTklfVTMyIGRvdDExZlVucGFja0llSFQyMDQwQlNTQ29leGlzdGVuY2UodHBBbmlTa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BlID0gKnBCdWY7CisgICAgcEJ1ZiArPSAxOworICAgIGllbGVuIC09ICh0QU5JX1U4KTE7CisgICAgaWYgKCAhIGllbGVuICkKKyAgICB7CisgICAgICAgIHJldHVybiAwVTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgc3dpdGNoIChwRHN0LT50eXBlKQorICAgICAgICB7CisgICAgICAgICAgICBjYXNlIDA6CisgICAgICAgICAgICAgICAgcERzdC0+cmVwb3J0LkJhc2ljLmNoYW5uZWwgPSAqcEJ1ZjsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgaWVsZW4gLT0gKHRBTklfVTgpMTsKKyAgICAgICAgICAgICAgICBmcmFtZXNudG9ocShwQ3R4LCAmcERzdC0+cmVwb3J0LkJhc2ljLm1lYXNfc3RhcnRfdGltZSwgcEJ1ZiwgMCk7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSA4OworICAgICAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTg7CisgICAgICAgICAgICAgICAgZnJhbWVzbnRvaHMocEN0eCwgJnBEc3QtPnJlcG9ydC5CYXNpYy5tZWFzX2R1cmF0aW9uLCBwQnVmLCAwKTsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICAgICAgaWVsZW4gLT0gKHRBTklfVTgpMjsKKyAgICAgICAgICAgICAgICB0bXA1Nl9fID0gKnBCdWY7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgIGllbGVuIC09IDE7CisgICAgICAgICAgICAgICAgcERzdC0+cmVwb3J0LkJhc2ljLmJzcyA9IHRtcDU2X18gPj4gMCAmIDB4MTsKKyAgICAgICAgICAgICAgICBwRHN0LT5yZXBvcnQuQmFzaWMub2ZkbV9wcmVhbWJsZSA9IHRtcDU2X18gPj4gMSAmIDB4MTsKKyAgICAgICAgICAgICAgICBwRHN0LT5yZXBvcnQuQmFzaWMudW5pZF9zaWduYWwgPSB0bXA1Nl9fID4+IDIgJiAweDE7CisgICAgICAgICAgICAgICAgcERzdC0+cmVwb3J0LkJhc2ljLnJhZGVyID0gdG1wNTZfXyA+PiAzICYgMHgxOworICAgICAgICAgICAgICAgIHBEc3QtPnJlcG9ydC5CYXNpYy51bm1lYXN1cmVkID0gdG1wNTZfXyA+PiA0ICYgMHgxOworICAgICAgICAgICAgICAgIHBEc3QtPnJlcG9ydC5CYXNpYy51bnVzZWQgPSB0bXA1Nl9fID4+IDUgJiAweDc7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgICAgICBwRHN0LT5yZXBvcnQuQ0NBLmNoYW5uZWwgPSAqcEJ1ZjsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgaWVsZW4gLT0gKHRBTklfVTgpMTsKKyAgICAgICAgICAgICAgICBmcmFtZXNudG9ocShwQ3R4LCAmcERzdC0+cmVwb3J0LkNDQS5tZWFzX3N0YXJ0X3RpbWUsIHBCdWYsIDApOworICAgICAgICAgICAgICAgIHBCdWYgKz0gODsKKyAgICAgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCk4OworICAgICAgICAgICAgICAgIGZyYW1lc250b2hzKHBDdHgsICZwRHN0LT5yZXBvcnQuQ0NBLm1lYXNfZHVyYXRpb24sIHBCdWYsIDApOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkyOworICAgICAgICAgICAgICAgIHBEc3QtPnJlcG9ydC5DQ0EuY2NhX2J1c3lfZnJhY3Rpb24gPSAqcEJ1ZjsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgaWVsZW4gLT0gKHRBTklfVTgpMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICAgIHBEc3QtPnJlcG9ydC5SUElIaXN0b2dyYW0uY2hhbm5lbCA9ICpwQnVmOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgICAgICAgICAgICAgIGZyYW1lc250b2hxKHBDdHgsICZwRHN0LT5yZXBvcnQuUlBJSGlzdG9ncmFtLm1lYXNfc3RhcnRfdGltZSwgcEJ1ZiwgMCk7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSA4OworICAgICAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTg7CisgICAgICAgICAgICAgICAgZnJhbWVzbnRvaHMocEN0eCwgJnBEc3QtPnJlcG9ydC5SUElIaXN0b2dyYW0ubWVhc19kdXJhdGlvbiwgcEJ1ZiwgMCk7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTI7CisgICAgICAgICAgICAgICAgcERzdC0+cmVwb3J0LlJQSUhpc3RvZ3JhbS5ycGkwX2RlbnNpdHkgPSAqcEJ1ZjsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgaWVsZW4gLT0gKHRBTklfVTgpMTsKKyAgICAgICAgICAgICAgICBwRHN0LT5yZXBvcnQuUlBJSGlzdG9ncmFtLnJwaTFfZGVuc2l0eSA9ICpwQnVmOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgICAgICAgICAgICAgIHBEc3QtPnJlcG9ydC5SUElIaXN0b2dyYW0ucnBpMl9kZW5zaXR5ID0gKnBCdWY7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTE7CisgICAgICAgICAgICAgICAgcERzdC0+cmVwb3J0LlJQSUhpc3RvZ3JhbS5ycGkzX2RlbnNpdHkgPSAqcEJ1ZjsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgaWVsZW4gLT0gKHRBTklfVTgpMTsKKyAgICAgICAgICAgICAgICBwRHN0LT5yZXBvcnQuUlBJSGlzdG9ncmFtLnJwaTRfZGVuc2l0eSA9ICpwQnVmOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgICAgICAgICAgICAgIHBEc3QtPnJlcG9ydC5SUElIaXN0b2dyYW0ucnBpNV9kZW5zaXR5ID0gKnBCdWY7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTE7CisgICAgICAgICAgICAgICAgcERzdC0+cmVwb3J0LlJQSUhpc3RvZ3JhbS5ycGk2X2RlbnNpdHkgPSAqcEJ1ZjsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgaWVsZW4gLT0gKHRBTklfVTgpMTsKKyAgICAgICAgICAgICAgICBwRHN0LT5yZXBvcnQuUlBJSGlzdG9ncmFtLnJwaTdfZGVuc2l0eSA9ICpwQnVmOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDU6CisgICAgICAgICAgICAgICAgcERzdC0+cmVwb3J0LkJlYWNvbi5yZWdDbGFzcyA9ICpwQnVmOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgICAgICAgICAgICAgIHBEc3QtPnJlcG9ydC5CZWFjb24uY2hhbm5lbCA9ICpwQnVmOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgICAgICAgICAgICAgIGZyYW1lc250b2hxKHBDdHgsICZwRHN0LT5yZXBvcnQuQmVhY29uLm1lYXNfc3RhcnRfdGltZSwgcEJ1ZiwgMCk7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSA4OworICAgICAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTg7CisgICAgICAgICAgICAgICAgZnJhbWVzbnRvaHMocEN0eCwgJnBEc3QtPnJlcG9ydC5CZWFjb24ubWVhc19kdXJhdGlvbiwgcEJ1ZiwgMCk7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTI7CisgICAgICAgICAgICAgICAgdG1wNTdfXyA9ICpwQnVmOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBpZWxlbiAtPSAxOworICAgICAgICAgICAgICAgIHBEc3QtPnJlcG9ydC5CZWFjb24uY29uZGVuc2VkX1BIWSA9IHRtcDU3X18gPj4gMCAmIDB4N2Y7CisgICAgICAgICAgICAgICAgcERzdC0+cmVwb3J0LkJlYWNvbi5yZXBvcnRlZF9mcmFtZV90eXBlID0gdG1wNTdfXyA+PiA3ICYgMHgxOworICAgICAgICAgICAgICAgIHBEc3QtPnJlcG9ydC5CZWFjb24uUkNQSSA9ICpwQnVmOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgICAgICAgICAgICAgIHBEc3QtPnJlcG9ydC5CZWFjb24uUlNOSSA9ICpwQnVmOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgICAgICAgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcERzdC0+cmVwb3J0LkJlYWNvbi5CU1NJRCwgcEJ1ZiwgNik7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSA2OworICAgICAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTY7CisgICAgICAgICAgICAgICAgcERzdC0+cmVwb3J0LkJlYWNvbi5hbnRlbm5hX2lkID0gKnBCdWY7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTE7CisgICAgICAgICAgICAgICAgZnJhbWVzbnRvaGwocEN0eCwgJnBEc3QtPnJlcG9ydC5CZWFjb24ucGFyZW50X1RTRiwgcEJ1ZiwgMCk7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSA0OworICAgICAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTQ7CisgICAgICAgICAgICBzdGF0dXMgfD0gVW5wYWNrQ29yZShwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgIGllbGVuLAorICAgICAgICAgICAgICAgICAgICAgRkZTX3JlcG9ydEJlYWNvbiwKKyAgICAgICAgICAgICAgICAgICAgIElFU19yZXBvcnRCZWFjb24sCisgICAgICAgICAgICAgICAgICAgICAoIHRBTklfVTgqIClwRHN0LAorICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCpwRHN0KSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZVbnBhY2tJZU1lYXN1cmVtZW50UmVwb3J0LiAqLworCisjZGVmaW5lIFNpZ0llTWVhc3VyZW1lbnRSZXBvcnQgKCAweDAwNDkgKQorCisKK3N0YXRpYyBjb25zdCB0RkZEZWZuIEZGU19tZWFzdXJlbWVudF9yZXF1ZXN0QmVhY29uWyBdID0geworeyBOVUxMLCAwLCAwLCAwLH0sCit9OworCitzdGF0aWMgY29uc3QgdElFRGVmbiBJRVNfbWVhc3VyZW1lbnRfcmVxdWVzdEJl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9IERPVDExRl9EVVBMSUNBVEVfSUU7CisgICAgcERzdC0+cHJlc2VudCA9IDE7CisgICAgcERzdC0+bWVhc3VyZW1lbnRfdG9rZW4gPSAqcEJ1ZjsKKyAgICBwQnVmICs9IDE7CisgICAgaWVsZW4gLT0gKHRBTklfVTgpMTsKKyAgICB0bXA1OF9fID0gKnBCdWY7CisgICAgcEJ1ZiArPSAxOworICAgIGllbGVuIC09IDE7CisgICAgcERzdC0+cGFyYWxsZWwgPSB0bXA1OF9fID4+IDAgJiAweDE7CisgICAgcERzdC0+ZW5hYmxlID0gdG1wNThfXyA+PiAxICYgMHgxOworICAgIHBEc3QtPnJlcXVlc3QgPSB0bXA1OF9fID4+IDIgJiAweDE7CisgICAgcERzdC0+cmVwb3J0ID0gdG1wNThfXyA+PiAzICYgMHgxOworICAgIHBEc3QtPmR1cmF0aW9uTWFuZGF0b3J5ID0gdG1wNThfXyA+PiA0ICYgMHgxOworICAgIHBEc3QtPnVudXNlZCA9IHRtcDU4X18gPj4gNSAmIDB4NzsKKyAgICBwRHN0LT5tZWFzdXJlbWVudF90eXBlID0gKnBCdWY7CisgICAgcEJ1ZiArPSAxOworICAgIGllbGVuIC09ICh0QU5JX1U4KTE7CisgICAgc3dpdGNoIChwRHN0LT5tZWFzdXJlbWVudF90eXBlKQorICAgIHsKKyAgICAgICAgY2FzZSAwOgorICAgICAgICAgICAgcERzdC0+bWVhc3VyZW1lbnRfcmVxdWVzdC5CYXNpYy5jaGFubmVsX25vID0gKnBCdWY7CisgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgICAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwRHN0LT5tZWFzdXJlbWVudF9yZXF1ZXN0LkJhc2ljLm1lYXNfc3RhcnRfdGltZSwgcEJ1ZiwgOCk7CisgICAgICAgICAgICBwQnVmICs9IDg7CisgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCk4OworICAgICAgICAgICAgZnJhbWVzbnRvaHMocEN0eCwgJnBEc3QtPm1lYXN1cmVtZW50X3JlcXVlc3QuQmFzaWMubWVhc19kdXJhdGlvbiwgcEJ1ZiwgMCk7CisgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkyOworICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgcERzdC0+bWVhc3VyZW1lbnRfcmVxdWVzdC5DQ0EuY2hhbm5lbF9ubyA9ICpwQnVmOworICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgaWVsZW4gLT0gKHRBTklfVTgpMTsKKyAgICAgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcERzdC0+bWVhc3VyZW1lbnRfcmVxdWVzdC5DQ0EubWVhc19zdGFydF90aW1lLCBwQnVmLCA4KTsKKyAgICAgICAgICAgIHBCdWYgKz0gODsKKyAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTg7CisgICAgICAgICAgICBmcmFtZXNudG9ocyhwQ3R4LCAmcERzdC0+bWVhc3VyZW1lbnRfcmVxdWVzdC5DQ0EubWVhc19kdXJhdGlvbiwgcEJ1ZiwgMCk7CisgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkyOworICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgcERzdC0+bWVhc3VyZW1lbnRfcmVxdWVzdC5SUElIaXN0b2dyYW0uY2hhbm5lbF9ubyA9ICpwQnVmOworICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgaWVsZW4gLT0gKHRBTklfVTgpMTsKKyAgICAgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcERzdC0+bWVhc3VyZW1lbnRfcmVxdWVzdC5SUElIaXN0b2dyYW0ubWVhc19zdGFydF90aW1lLCBwQnVmLCA4KTsKKyAgICAgICAgICAgIHBCdWYgKz0gODsKKyAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTg7CisgICAgICAgICAgICBmcmFtZXNudG9ocyhwQ3R4LCAmcERzdC0+bWVhc3VyZW1lbnRfcmVxdWVzdC5SUElIaXN0b2dyYW0ubWVhc19kdXJhdGlvbiwgcEJ1ZiwgMCk7CisgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkyOworICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSA1OgorICAgICAgICAgICAgcERzdC0+bWVhc3VyZW1lbnRfcmVxdWVzdC5CZWFjb24ucmVnQ2xhc3MgPSAqcEJ1ZjsKKyAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTE7CisgICAgICAgICAgICBwRHN0LT5tZWFzdXJlbWVudF9yZXF1ZXN0LkJlYWNvbi5jaGFubmVsID0gKnBCdWY7CisgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgICAgICAgICAgZnJhbWVzbnRvaHMocEN0eCwgJnBEc3QtPm1lYXN1cmVtZW50X3JlcXVlc3QuQmVhY29uLnJhbmRvbWl6YXRpb24sIHBCdWYsIDApOworICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgaWVsZW4gLT0gKHRBTklfVTgpMjsKKyAgICAgICAgICAgIGZyYW1lc250b2hzKHBDdHgsICZwRHN0LT5tZWFzdXJlbWVudF9yZXF1ZXN0LkJlYWNvbi5tZWFzX2R1cmF0aW9uLCBwQnVmLCAwKTsKKyAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTI7CisgICAgICAgICAgICBwRHN0LT5tZWFzdXJlbWVudF9yZXF1ZXN0LkJlYWNvbi5tZWFzX21vZGUgPSAqcEJ1ZjsKKyAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTE7CisgICAgICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBEc3QtPm1lYXN1cmVtZW50X3JlcXVlc3QuQmVhY29uLkJTU0lELCBwQnVmLCA2KTsKKyAgICAgICAgICAgIHBCdWYgKz0gNjsKKyAgICAgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTY7CisgICAgICAgIHN0YXR1cyB8PSBVbnBhY2tDb3JlKHBDdHgsCisgICAgICAgICAgICAgICAgICAgICBwQnVmLAorICAgICAgICAgICAgICAgICAgICAgaWVsZW4sCisgICAgICAgICAgICAgICAgICAgICBGRlNfbWVhc3VyZW1lbnRfcmVxdWVzdEJlYWNvbiwKKyAgICAgICAgICAgICAgICAgICAgIElFU19tZWFzdXJlbWVudF9yZXF1ZXN0QmVhY29uLAorICAgICAgICAgICAgICAgICAgICAgKCB0QU5JX1U4KiApcERzdCwKKyAgICAgICAgICAgICAgICAgICAgIHNpemVvZigqcERzdCkpOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmVW5wYWNrSWVNZWFzdXJlbWVudFJlcXVlc3QuICovCisKKyNkZWZpbmUgU2lnSWVNZWFzdXJlbWVudFJlcXVlc3QgKCAweDAwNGEgKQorCisKK3RBTklfVTMyIGRvdDExZlVucGFja0llTW9iaWxpdHlEb21haW4odHBBbmlTaXJHbG9iYWwgcEN0eCwgdEFOSV9VOCAqcEJ1ZiwgdEFOSV9VOCBpZWxlbiwgdERvdDExZklFTW9iaWxpdHlEb21haW4gKnBEc3QpCit7CisgICAgdEFOSV9VMzIgc3RhdHVzID0gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7CisgICAgdEFOSV9VOCB0bXA1OV9fOworICAgICh2b2lkKSBwQnVmOyAodm9pZClpZWxlbjsgLyogU2h1dHVw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XA2MF9fID4+IDcgJiAweDE7CisgICAgdG1wNjFfXyA9ICpwQnVmOworICAgIHBCdWYgKz0gMTsKKyAgICBpZWxlbiAtPSAxOworICAgIHBEc3QtPkRlbGF5ZWRCQSA9IHRtcDYxX18gPj4gMCAmIDB4MTsKKyAgICBwRHN0LT5JbW1CQSA9IHRtcDYxX18gPj4gMSAmIDB4MTsKKyAgICBwRHN0LT5Nb2JpbGl0eURvbWFpbiA9IHRtcDYxX18gPj4gMiAmIDB4MTsKKyAgICBwRHN0LT5yZXNlcnZlZCA9IHRtcDYxX18gPj4gMyAmIDB4MWY7CisgICAgZnJhbWVzbnRvaHMocEN0eCwgJnBEc3QtPnJlc2VydmVkMSwgcEJ1ZiwgMCk7CisgICAgcEJ1ZiArPSAyOworICAgIGllbGVuIC09ICh0QU5JX1U4KTI7CisgICAgcERzdC0+cmVndWxhdG9yeUNsYXNzID0gKnBCdWY7CisgICAgcEJ1ZiArPSAxOworICAgIGllbGVuIC09ICh0QU5JX1U4KTE7CisgICAgcERzdC0+Y2hhbm5lbCA9ICpwQnVmOworICAgIHBCdWYgKz0gMTsKKyAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgIHBEc3QtPlBoeVR5cGUgPSAqcEJ1ZjsKKyAgICBwQnVmICs9IDE7CisgICAgaWVsZW4gLT0gKHRBTklfVTgpMTsKKyAgICAodm9pZClwQ3R4OworICAgIHN0YXR1cyB8PSBVbnBhY2tDb3JlKHBDdHgsCisgICAgICAgICAgICAgICAgICAgICBwQnVmLAorICAgICAgICAgICAgICAgICAgICAgaWVsZW4sCisgICAgICAgICAgICAgICAgICAgICBGRlNfTmVpZ2hib3JSZXBvcnQsCisgICAgICAgICAgICAgICAgICAgICBJRVNfTmVpZ2hib3JSZXBvcnQsCisgICAgICAgICAgICAgICAgICAgICAoIHRBTklfVTgqIClwRHN0LAorICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCpwRHN0KSk7CisgICAgcmV0dXJuIHN0YXR1czsKK30g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yAoIDB4MDA2NSApCisKKwordEFOSV9VMzIgZG90MTFmVW5wYWNrSWVQb3dlckNhcHModHBBbmlTaXJHbG9iYWwgcEN0eCwgdEFOSV9VOCAqcEJ1ZiwgdEFOSV9VOCBpZWxlbiwgdERvdDExZklFUG93ZXJDYXBzICpwRHN0KQoreworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgICh2b2lkKSBwQnVmOyAodm9pZClpZWxlbjsgLyogU2h1dHVwIHRoZSBjb21waWxlciAqLworICAgIGlmIChwRHN0LT5wcmVzZW50KSBzdGF0dXMgPSBET1QxMUZfRFVQTElDQVRFX0lFOworICAgIHBEc3QtPnByZXNlbnQgPSAxOworICAgIHBEc3QtPm1pblR4UG93ZXIgPSAqcEJ1ZjsKKyAgICBwQnVmICs9IDE7CisgICAgaWVsZW4gLT0gKHRBTklfVTgpMTsKKyAgICBwRHN0LT5tYXhUeFBvd2VyID0gKnBCdWY7CisgICAgKHZvaWQpcEN0eDsKKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmVW5wYWNrSWVQb3dlckNhcHMuICovCisKKyNkZWZpbmUgU2lnSWVQb3dlckNhcHMgKCAweDAwNjYgKQorCisKK3RBTklfVTMyIGRvdDExZlVucGFja0llUG93ZXJDb25zdHJhaW50cyh0cEFuaVNpckdsb2JhbCBwQ3R4LCB0QU5JX1U4ICpwQnVmLCB0QU5JX1U4IGllbGVuLCB0RG90MTFmSUVQb3dlckNvbnN0cmFpbnRzICpwRHN0KQoreworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgICh2b2lkKSBwQnVmOyAodm9pZClpZWxlbjsgLyogU2h1dHVwIHRoZSBjb21waWxlciAqLworICAgIGlmIChwRHN0LT5wcmVzZW50KSBzdGF0dXMgPSBET1QxMUZfRFVQTElDQVRFX0lFOworICAgIHBEc3QtPnByZXNlbnQgPSAxOworICAgIHBEc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0LT5wcmVzZW50ID0gMTsKKyAgICBwRHN0LT5udW1fZHNjcF9leGNlcHRpb25zID0gKHRBTklfVTgpKCBpZWxlbiApOworICAgIGlmIChpZWxlbiA+IDYwKXsKKyAgICAgICAgcERzdC0+cHJlc2VudCA9IDA7CisgICAgICAgIHJldHVybiBET1QxMUZfU0tJUFBFRF9CQURfSUU7CisgICAgfQorCisgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwRHN0LT5kc2NwX2V4Y2VwdGlvbnMsIHBCdWYsICggaWVsZW4gKSApOworICAgICh2b2lkKXBDdHg7CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlVucGFja0llUW9zTWFwU2V0LiAqLworCisjZGVmaW5lIFNpZ0llUW9zTWFwU2V0ICggMHgwMDZiICkKKworCit0QU5JX1UzMiBkb3QxMWZVbnBhY2tJZVF1aWV0KHRwQW5pU2lyR2xvYmFsIHBDdHgsIHRBTklfVTggKnBCdWYsIHRBTklfVTggaWVsZW4sIHREb3QxMWZJRVF1aWV0ICpwRHN0KQoreworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgICh2b2lkKSBwQnVmOyAodm9pZClpZWxlbjsgLyogU2h1dHVwIHRoZSBjb21waWxlciAqLworICAgIGlmIChwRHN0LT5wcmVzZW50KSBzdGF0dXMgPSBET1QxMUZfRFVQTElDQVRFX0lFOworICAgIHBEc3QtPnByZXNlbnQgPSAxOworICAgIHBEc3QtPmNvdW50ID0gKnBCdWY7CisgICAgcEJ1ZiArPSAxOworICAgIGllbGVuIC09ICh0QU5JX1U4KTE7CisgICAgcERzdC0+cGVyaW9kID0gKnBCdWY7CisgICAgcEJ1ZiArPSAxOworICAgIGllbGVuIC09ICh0QU5JX1U4KTE7CisgICAgZnJhbWVzbnRvaHMocEN0eCwgJnBEc3QtPmR1cmF0aW9uLCBwQnVmLCAwKTsKKyAgICBwQnVmICs9IDI7CisgICAgaWVsZW4gLT0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R1cCB0aGUgY29tcGlsZXIgKi8KKyAgICBpZiAocERzdC0+cHJlc2VudCkgc3RhdHVzID0gRE9UMTFGX0RVUExJQ0FURV9JRTsKKyAgICBwRHN0LT5wcmVzZW50ID0gMTsKKyAgICAodm9pZClwQ3R4OworICAgIHN0YXR1cyB8PSBVbnBhY2tDb3JlKHBDdHgsCisgICAgICAgICAgICAgICAgICAgICBwQnVmLAorICAgICAgICAgICAgICAgICAgICAgaWVsZW4sCisgICAgICAgICAgICAgICAgICAgICBGRlNfUklDRGF0YURlc2MsCisgICAgICAgICAgICAgICAgICAgICBJRVNfUklDRGF0YURlc2MsCisgICAgICAgICAgICAgICAgICAgICAoIHRBTklfVTgqIClwRHN0LAorICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCpwRHN0KSk7CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlVucGFja0llUklDRGF0YURlc2MuICovCisKKyNkZWZpbmUgU2lnSWVSSUNEYXRhRGVzYyAoIDB4MDA2ZSApCisKKwordEFOSV9VMzIgZG90MTFmVW5wYWNrSWVSU04odHBBbmlTaXJHbG9iYWwgcEN0eCwgdEFOSV9VOCAqcEJ1ZiwgdEFOSV9VOCBpZWxlbiwgdERvdDExZklFUlNOICpwRHN0KQoreworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgICh2b2lkKSBwQnVmOyAodm9pZClpZWxlbjsgLyogU2h1dHVwIHRoZSBjb21waWxlciAqLworICAgIGlmIChwRHN0LT5wcmVzZW50KSBzdGF0dXMgPSBET1QxMUZfRFVQTElDQVRFX0lFOworICAgIHBEc3QtPnByZXNlbnQgPSAxOworICAgIGZyYW1lc250b2hzKHBDdHgsICZwRHN0LT52ZXJzaW9uLCBwQnVmLCAwKTsKKyAgICBwQnVmICs9IDI7CisgICAgaWVsZW4gLT0gKHRBTklfVTgpMjsKKyAgICBpZiAocERzdC0+dmVyc2lvbiAhPSAweDEpCisgICAgeworICAgICAgICAgICAgcERzdC0+cHJlc2VudCA9IDA7CisgICAgICAgICAgICByZXR1cm4gKCBzdGF0dXMgfCBET1QxMUZfQkFEX0ZJWEVEX1ZBTFVFICk7CisgICAgfQorICAgIERPVDExRl9NRU1DUFkocEN0eCwgcERzdC0+Z3BfY2lwaGVyX3N1aXRlLCBwQnVmLCA0KTsKKyAgICBwQnVmICs9IDQ7CisgICAgaWVsZW4gLT0gKHRBTklfVTgpNDsKKyAgICBpZiAoICEgaWVsZW4gKQorICAgIHsKKyAgICAgICAgcERzdC0+cHdpc2VfY2lwaGVyX3N1aXRlX2NvdW50ID0gMFU7CisgICAgICAgIHBEc3QtPmFrbV9zdWl0ZV9jb3VudCA9IDBVOworICAgICAgICBwRHN0LT5wbWtpZF9jb3VudCA9IDBVOworICAgICAgICByZXR1cm4gMFU7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGZyYW1lc250b2hzKHBDdHgsICZwRHN0LT5wd2lzZV9jaXBoZXJfc3VpdGVfY291bnQsIHBCdWYsIDApOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTI7CisgICAgfQorICAgIGlmIChwRHN0LT5wd2lzZV9jaXBoZXJfc3VpdGVfY291bnQgPiA0KXsKKyAgICAgICAgcERzdC0+cHJlc2VudCA9IDA7CisgICAgICAgIHJldHVybiBET1QxMUZfU0tJUFBFRF9CQURfSUU7CisgICAgfQorCisgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwRHN0LT5wd2lzZV9jaXBoZXJfc3VpdGVzLCBwQnVmLCAoIHBEc3QtPnB3aXNlX2NpcGhlcl9zdWl0ZV9jb3VudCAqIDQgKSApOworICAgIHBCdWYgKz0gKCBwRHN0LT5wd2lzZV9jaXBoZXJfc3VpdGVfY291bnQgKiA0ICk7CisgICAgaWVsZW4gLT0gKCBwRHN0LT5wd2lzZV9jaXBoZXJfc3VpdGVfY291bnQgKiA0ICk7CisgICAgaWYgKCAhIGllbGVuICkKKyAgICB7CisgICAgICAgIHBEc3QtPmFrbV9zdWl0ZV9jb3VudCA9IDBVOworICAgICAgICBwRHN0LT5wbWtpZF9jb3VudCA9IDBVOworICAgICAgICByZXR1cm4gMFU7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGZyYW1lc250b2hzKHBDdHgsICZwRHN0LT5ha21fc3VpdGVfY291bnQsIHBCdWYsIDApOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTI7CisgICAgfQorICAgIGlmIChwRHN0LT5ha21fc3VpdGVfY291bnQgPiA0KXsKKyAgICAgICAgcERzdC0+cHJlc2VudCA9IDA7CisgICAgICAgIHJldHVybiBET1QxMUZfU0tJUFBFRF9CQURfSUU7CisgICAgfQorCisgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwRHN0LT5ha21fc3VpdGVzLCBwQnVmLCAoIHBEc3QtPmFrbV9zdWl0ZV9jb3VudCAqIDQgKSApOworICAgIHBCdWYgKz0gKCBwRHN0LT5ha21fc3VpdGVfY291bnQgKiA0ICk7CisgICAgaWVsZW4gLT0gKCBwRHN0LT5ha21fc3VpdGVfY291bnQgKiA0ICk7CisgICAgaWYgKCAhIGllbGVuICkKKyAgICB7CisgICAgICAgIHBEc3QtPnBta2lkX2NvdW50ID0gMFU7CisgICAgICAgIHJldHVybiAwVTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwRHN0LT5SU05fQ2FwLCBwQnVmLCAyKTsKKyAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCkyOworICAgIH0KKyAgICBpZiAoICEgaWVsZW4gKQorICAgIHsKKyAgICAgICAgcERzdC0+cG1raWRfY291bnQgPSAwVTsKKyAgICAgICAgcmV0dXJuIDBVOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBmcmFtZXN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gICAgICAgICAocmF0ZV9pbmR4IDwgMTIpKSB7CisgICAgICAgICAgICBwRHN0LT5yYXRlc1tyYXRlX2luZHgrK10gPSBwQnVmW2ldOworICAgICAgICB9CisgICAgfQorCisgICAgaWYocmF0ZV9pbmR4ID09IDApIHsKKyAgICAgICAgcERzdC0+cHJlc2VudCA9IDA7CisgICAgICAgIHJldHVybiBET1QxMUZfU0tJUFBFRF9CQURfSUU7CisgICAgfQorCisgICAgcERzdC0+bnVtX3JhdGVzID0gcmF0ZV9pbmR4OworICAgICh2b2lkKXBDdHg7CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlVucGFja0llU3VwcFJhdGVzLiAqLworCisjZGVmaW5lIFNpZ0llU3VwcFJhdGVzICggMHgwMDc0ICkKKworCit0QU5JX1UzMiBkb3QxMWZVbnBhY2tJZVRJTSh0cEFuaVNpckdsb2JhbCBwQ3R4LCB0QU5JX1U4ICpwQnVmLCB0QU5JX1U4IGllbGVuLCB0RG90MTFmSUVUSU0gKnBEc3QpCit7CisgICAgdEFOSV9VMzIgc3RhdHVzID0gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7CisgICAgKHZvaWQpIHBCdWY7ICh2b2lkKWllbGVuOyAvKiBTaHV0dXAgdGhlIGNvbXBpbGVyICovCisgICAgaWYgKHBEc3QtPnByZXNlbnQpIHN0YXR1cyA9IERPVDExRl9EVVBMSUNBVEVfSUU7CisgICAgcERzdC0+cHJlc2VudCA9IDE7CisgICAgcERzdC0+ZHRpbV9jb3VudCA9ICpwQnVmOworICAgIHBCdWYgKz0gMTsKKyAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgIHBEc3QtPmR0aW1fcGVyaW9kID0gKnBCdWY7CisgICAgcEJ1ZiArPSAxOworICAgIGllbGVuIC09ICh0QU5JX1U4KTE7CisgICAgcERzdC0+Ym1wY3RsID0gKnBCdWY7CisgICAgcEJ1ZiArPSAxOworICAgIGllbGVuIC09ICh0QU5JX1U4KTE7C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ZfTUVNQ1BZKHBDdHgsIHBEc3QtPm11bHRpY2FzdF9jaXBoZXJfc3VpdGUsIHBCdWYsIDQpOworICAgIHBCdWYgKz0gNDsKKyAgICBpZWxlbiAtPSAodEFOSV9VOCk0OworICAgIGZyYW1lc250b2hzKHBDdHgsICZ0bXA2OV9fLCBwQnVmLCAwKTsKKyAgICBwQnVmICs9IDI7CisgICAgaWVsZW4gLT0gMjsKKyAgICBwRHN0LT5wcmVhdXRoID0gdG1wNjlfXyA+PiAwICYgMHgxOworICAgIHBEc3QtPnJlc2VydmVkID0gdG1wNjlfXyA+PiAxICYgMHg3ZmZmOworICAgIGlmICggISBpZWxlbiApCisgICAgeworICAgICAgICBwRHN0LT5ia2lkX2NvdW50ID0gMFU7CisgICAgICAgIHJldHVybiAwVTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgZnJhbWVzbnRvaHMocEN0eCwgJnBEc3QtPmJraWRfY291bnQsIHBCdWYsIDApOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIGllbGVuIC09ICh0QU5JX1U4KTI7CisgICAgfQorICAgIGlmIChwRHN0LT5ia2lkX2NvdW50ID4gNCl7CisgICAgICAgIHBEc3QtPnByZXNlbnQgPSAwOworICAgICAgICByZXR1cm4gRE9UMTFGX1NLSVBQRURfQkFEX0lFOworICAgIH0KKworICAgIERPVDExRl9NRU1DUFkocEN0eCwgcERzdC0+YmtpZCwgcEJ1ZiwgKCBwRHN0LT5ia2lkX2NvdW50ICogMTYgKSApOworICAgICh2b2lkKXBDdHg7CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlVucGFja0llV0FQSS4gKi8KKworI2RlZmluZSBTaWdJZVdBUEkgKCAweDAwN2MgKQorCisKK3RBTklfVTMyIGRvdDExZlVucGFja0llV0FQSU9wYXF1ZSh0cEFuaVNpckdsb2JhbCBwQ3R4LCB0QU5JX1U4ICpwQnVmLCB0QU5JX1U4IGllbGVuLCB0RG90MTFmSUVXQVBJT3BhcXVlICpwRHN0KQoreworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgICh2b2lkKSBwQnVmOyAodm9pZClpZWxlbjsgLyogU2h1dHVwIHRoZSBjb21waWxlciAqLworICAgIGlmIChwRHN0LT5wcmVzZW50KSBzdGF0dXMgPSBET1QxMUZfRFVQTElDQVRFX0lFOworICAgIHBEc3QtPnByZXNlbnQgPSAxOworICAgIHBEc3QtPm51bV9kYXRhID0gKHRBTklfVTgpKCBpZWxlbiApOworICAgIGlmIChpZWxlbiA+IDI1Myl7CisgICAgICAgIHBEc3QtPnByZXNlbnQgPSAwOworICAgICAgICByZXR1cm4gRE9UMTFGX1NLSVBQRURfQkFEX0lFOworICAgIH0KKworICAgIERPVDExRl9NRU1DUFkocEN0eCwgcERzdC0+ZGF0YSwgcEJ1ZiwgKCBpZWxlbiApICk7CisgICAgKHZvaWQpcEN0eDsKKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmVW5wYWNrSWVXQVBJT3BhcXVlLiAqLworCisjZGVmaW5lIFNpZ0llV0FQSU9wYXF1ZSAoIDB4MDA3ZCApCisKKwordEFOSV9VMzIgZG90MTFmVW5wYWNrSWVXRkFUUEModHBBbmlTaXJHbG9iYWwgcEN0eCwgdEFOSV9VOCAqcEJ1ZiwgdEFOSV9VOCBpZWxlbiwgdERvdDExZklFV0ZBVFBDICpwRHN0KQoreworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgICh2b2lkKSBwQnVmOyAodm9pZClpZWxlbjsgLyogU2h1dHVwIHRoZSBjb21waWxlciAqLworICAgIGlmIChwRHN0LT5wcmVzZW50KSBzdGF0dXMgPSBET1QxMUZfRFVQTElDQVRFX0lFOworICAgIHBEc3QtPnByZXNlbnQgPSAxOworICAgIHBEc3QtPnR4UG93ZXIgPSAqcEJ1ZjsKKyAgICBwQnVmICs9IDE7Cisg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JX1U4IHRtcDc0X187CisgICAgdEFOSV9VOCB0bXA3NV9fOworICAgIHRBTklfVTggdG1wNzZfXzsKKyAgICB0QU5JX1U4IHRtcDc3X187CisgICAgdEFOSV9VOCB0bXA3OF9fOworICAgIHRBTklfVTggdG1wNzlfXzsKKyAgICB0QU5JX1U4IHRtcDgwX187CisgICAgKHZvaWQpIHBCdWY7ICh2b2lkKWllbGVuOyAvKiBTaHV0dXAgdGhlIGNvbXBpbGVyICovCisgICAgaWYgKHBEc3QtPnByZXNlbnQpIHN0YXR1cyA9IERPVDExRl9EVVBMSUNBVEVfSUU7CisgICAgcERzdC0+cHJlc2VudCA9IDE7CisgICAgcERzdC0+dmVyc2lvbiA9ICpwQnVmOworICAgIHBCdWYgKz0gMTsKKyAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgIGlmIChwRHN0LT52ZXJzaW9uICE9IDB4MSkKKyAgICB7CisgICAgICAgICAgICBwRHN0LT5wcmVzZW50ID0gMDsKKyAgICAgICAgICAgIHJldHVybiAoIHN0YXR1cyB8IERPVDExRl9CQURfRklYRURfVkFMVUUgKTsKKyAgICB9CisgICAgcERzdC0+cW9zSW5mbyA9ICpwQnVmOworICAgIHBCdWYgKz0gMTsKKyAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgIHBEc3QtPnJlc2VydmVkMiA9ICpwQnVmOworICAgIHBCdWYgKz0gMTsKKyAgICBpZWxlbiAtPSAodEFOSV9VOCkxOworICAgIHRtcDczX18gPSAqcEJ1ZjsKKyAgICBwQnVmICs9IDE7CisgICAgaWVsZW4gLT0gMTsKKyAgICBwRHN0LT5hY2JlX2FpZnNuID0gdG1wNzNfXyA+PiAwICYgMHhmOworICAgIHBEc3QtPmFjYmVfYWNtID0gdG1wNzNfXyA+PiA0ICYgMHgxOworICAgIHBEc3QtPmFjYmVfYWNpID0gdG1wNzNfXyA+PiA1ICYgMHgzOworICAgIHBEc3QtPnVudXNlZDEgPSB0bXA3M19fID4+IDcgJiAweDE7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HN0LT5tdWx0aWNhc3RfY2lwaGVyLCBwQnVmLCA0KTsKKyAgICAgICAgcEJ1ZiArPSA0OworICAgICAgICBpZWxlbiAtPSAodEFOSV9VOCk0OworICAgIH0KKyAgICBpZiAoICEgaWVsZW4gKQorICAgIHsKKyAgICAgICAgcERzdC0+dW5pY2FzdF9jaXBoZXJfY291bnQgPSAwVTsKKyAgICAgICAgcERzdC0+YXV0aF9zdWl0ZV9jb3VudCA9IDBVOworICAgICAgICByZXR1cm4gMFU7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGZyYW1lc250b2hzKHBDdHgsICZwRHN0LT51bmljYXN0X2NpcGhlcl9jb3VudCwgcEJ1ZiwgMCk7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgaWVsZW4gLT0gKHRBTklfVTgpMjsKKyAgICB9CisgICAgaWYgKHBEc3QtPnVuaWNhc3RfY2lwaGVyX2NvdW50ID4gNCl7CisgICAgICAgIHBEc3QtPnByZXNlbnQgPSAwOworICAgICAgICByZXR1cm4gRE9UMTFGX1NLSVBQRURfQkFEX0lFOworICAgIH0KKworICAgIERPVDExRl9NRU1DUFkocEN0eCwgcERzdC0+dW5pY2FzdF9jaXBoZXJzLCBwQnVmLCAoIHBEc3QtPnVuaWNhc3RfY2lwaGVyX2NvdW50ICogNCApICk7CisgICAgcEJ1ZiArPSAoIHBEc3QtPnVuaWNhc3RfY2lwaGVyX2NvdW50ICogNCApOworICAgIGllbGVuIC09ICggcERzdC0+dW5pY2FzdF9jaXBoZXJfY291bnQgKiA0ICk7CisgICAgaWYgKCAhIGllbGVuICkKKyAgICB7CisgICAgICAgIHBEc3QtPmF1dGhfc3VpdGVfY291bnQgPSAwVTsKKyAgICAgICAgcmV0dXJuIDBVOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBmcmFtZXNudG9ocyhwQ3R4LCAmcERzdC0+YXV0aF9zdWl0ZV9jb3VudCwgcEJ1ZiwgMCk7CisgICAgICAgIH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IERPVDExRl9BRERUU1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+VENMQVNbaV0uaW5mby5JcFBhcmFtcy52ZXJzaW9uLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAocEZybS0+VENMQVNbaV0uaW5mby5JcFBhcmFtcy52ZXJzaW9uKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLnNvdXJjZSwgNCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+VENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5kZXN0LCA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLnNyY19wb3J0LCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLmRlc3RfcG9ydCwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+VENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5EU0NQLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLnByb3RvLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLnJlc2VydmVkLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDY6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+VENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5zb3VyY2UsIDE2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmRlc3QsIDE2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLnNyY19wb3J0LCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmRlc3RfcG9ydCwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+VENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5mbG93X2xhYmVsLCAzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgMjoKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+VENMQVNbaV0uaW5mby5QYXJhbXM4MDIxZHEudGFnX3R5cGUsIDIpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksIEZSRkwoIlRDTEFTU1BST0M6XG4iKSk7CisgICAgICAgIGlmICghcEZybS0+VENMQVNTUFJPQy5wcmVzZW50KQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVFVRVNUKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlRDTEFTU1BST0MucHJvY2Vzc2luZywgMSk7CisgICAgICAgIH0KKyAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksIEZSRkwoIldNTVRTUEVDOlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPldNTVRTUEVDLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICA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klfVTgqICkmcEZybS0+V01NVFNQRUMubWluX3BoeV9yYXRlLCA0KTsKKyAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+V01NVFNQRUMuc3VycGx1c19id19hbGxvd2FuY2UsIDIpOworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5XTU1UU1BFQy5tZWRpdW1fdGltZSwgMik7CisgICAgICAgIH0KKyAgICAgICAgZm9yIChpID0gMDsgaSA8IHBGcm0tPm51bV9XTU1UQ0xBUzsgKytpKQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVFVRVNUKSwgRlJGTCgiV01NVENMQVNbJWRdOlxuIiksIGkpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5XTU1UQ0xBU1tpXS5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPldNTVRDTEFTW2ldLnZlcnNpb24sIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+V01NVENMQVNbaV0udXNlcl9wcmlvcml0eSwgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5XTU1UQ0xBU1tpXS5jbGFzc2lmaWVyX3R5cGUsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+V01NVENMQVNbaV0uY2xhc3NpZmllcl9tYXNrLCAxKTsKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKHBGcm0tPldNTVRDTEFTW2ldLmNsYXNzaWZpZXJfdHlwZSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgMDoKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+V01NVENMQVNbaV0uaW5mby5FdGhQYXJhbXMuc291cmNlLCA2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+V01NVENMQVNbaV0uaW5mby5FdGhQYXJhbXMuZGVzdCwgNik7CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPldNTVRDTEFTW2ldLmluZm8uRXRoUGFyYW1zLnR5cGUsIDIpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5XTU1UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnZlcnNpb24sIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChwRnJtLT5XTU1UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnZlcnNpb24pCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA0OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuc291cmNlLCA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5XTU1UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLmRlc3QsIDQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkF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UkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5XTU1UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmZsb3dfbGFiZWwsIDMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5XTU1UQ0xBU1tpXS5pbmZvLlBhcmFtczgwMjFkcS50YWdfdHlwZSwgMik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVFVRVNUKSwgRlJGTCgiV01NVENMQVNQUk9DOlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPldNTVRDTEFTUFJPQy5wcmVzZW50KQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVFVRVNUKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPldNTVRDTEFTUFJPQy52ZXJzaW9uLCAxKTsKKy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AgICAgICAgICAgICAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+VENMQVNbaV0uaW5mby5JcFBhcmFtcy52ZXJzaW9uLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAocEZybS0+VENMQVNbaV0uaW5mby5JcFBhcmFtcy52ZXJzaW9uKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+VENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5zb3VyY2UsIDQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLmRlc3QsIDQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLnNyY19wb3J0LCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIC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AgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgMjoKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlRDTEFTW2ldLmluZm8uUGFyYW1zODAyMWRxLnRhZ190eXBlLCAyKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgRlJGTCgiVENMQVNTUFJPQzpcbiIpKTsKKyAgICAgICAgaWYgKCFwRnJtLT5UQ0xBU1NQUk9DLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5UQ0xBU1NQUk9DLnByb2Nlc3NpbmcsIDEpOworICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgRlJGTCgiU2NoZWR1bGU6XG4iKSk7CisgICAgICAgIGlmICghcEZybS0+U2NoZWR1bGUucHJlc2VudCkKKyAgICAgICA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BGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPldNTVRDTEFTW2ldLnZlcnNpb24sIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPldNTVRDTEFTW2ldLnVzZXJfcHJpb3JpdHksIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPldNTVRDTEFTW2ldLmNsYXNzaWZpZXJfdHlwZSwgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+V01NVENMQVNbaV0uY2xhc3NpZmllcl9tYXNrLCAxKTsKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKHBGcm0tPldNTVRDTEFTW2ldLmNsYXNzaWZpZXJfdHlwZSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgMDoKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPldNTVRDTEFTW2ldLmluZm8uRXRoUGFyYW1zLnNvdXJjZSwgNik7CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5XTU1UQ0xBU1tpXS5pbmZvLkV0aFBhcmFtcy5kZXN0LCA2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPldNTVRDTEFTW2ldLmluZm8uRXRoUGFyYW1zLnR5cGUsIDIpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+V01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy52ZXJzaW9uLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAocEZybS0+V01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy52ZXJzaW9uKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+V01NVENMQVNbaV0uaW5mby5Jc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cmFtcy5zcmNfcG9ydCwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZGVzdF9wb3J0LCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+V01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5mbG93X2xhYmVsLCAzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgMjoKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPldNTVRDTEFTW2ldLmluZm8uUGFyYW1zODAyMWRxLnRhZ190eXBlLCAyKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgRlJGTCgiV01NVENMQVNQUk9DOlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPldNTVRDTEFTUFJPQ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AgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVRVUVTVCksIEZSRkwoIkhDRjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uSENGLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uSENGLmVuYWJsZWQsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVRVUVTVCksIEZSRkwoIldEUzpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uV0RTLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFUVVFU1QpLCBGUkZMKCJudW1fd2RzRGF0YTogJWQuXG4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sIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFUVVFU1QpLCBGUkZMKCJMb2FkSW5mbzpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uTG9hZEluZm8ucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVFVRVNUKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5Mb2FkSW5mby5udW1fc3RhcywgMik7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5Mb2FkSW5mby5jaGFubmVsX3V0aWwsIDIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVRVUVTVCksIEZSRkwoIkxvYWRCYWxhbmNlOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5Mb2FkQmFsYW5jZS5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFUVVFU1QpLCBGUkZMKCJOb3QgcHJlc2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0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVRVUVTVCksIEZSRkwoIkxMQXR0cjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uTExBdHRyLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uTExBdHRyLmRlZmVyX3RocmVzaG9sZCwgNCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVFVRVNUKSwgRlJGTCgiUHJvcENhcGFiaWxpdHk6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLlByb3BDYXBhYmlsaXR5LnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ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klfVTgqICkmcEZybS0+RlRJbmZvLkFub25jZSwgMzIpOworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLlNub25jZSwgMzIpOworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJSMUtIX0lEOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5GVEluZm8uUjFLSF9JRC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLlIxS0hfSUQuUE1LX1IxX0lELCA2KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiR1RLOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5GVEluZm8uR1RLLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFG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IklHVEs6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkZUSW5mby5JR1RLLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5GVEluZm8uSUdUSy5rZXlJRCwgMik7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLklHVEsuSVBOLCA2KTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5GVEluZm8uSUdUSy5rZXlMZW5ndGgsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPkZUSW5mby5JR1RLLmtleSwgMjQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwRnJtLT5udW1fUklDRGF0YURlc2M7ICsraSkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJSSUNEYXRhRGVzY1slZF06XG4iKSwgaSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPlJJQ0RhdGFEZXNjW2ldLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIlJJQ0RhdGE6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5SSUNEYXRhRGVzY1tpXS5SSUNEYXRhLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5SSUNEYXRhLklkZW50aWZpZXIsIDEpOworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5SSUNEYXRhLnJlc291cmNlRGVzY0NvdW50LCAxKTsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uUklDRGF0YS5zdGF0dXNDb2RlLCAyKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJSSUNEZXNjcmlwdG9yOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uUklDRGVzY3JpcHRvci5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uUklDRGVzY3JpcHRvci5yZXNvdXJjZVR5cGUsIDEpOworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMSh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ByZXNlbnQpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS51c2VyX3ByaW9yaXR5LCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmNsYXNzaWZpZXJfdHlwZSwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5jbGFzc2lmaWVyX21hc2ssIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5jbGFzc2lmaWVyX3R5cGUpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLkV0aFBhcmFtcy5zb3VyY2UsIDYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLkV0aFBhcmFtcy5kZXN0LCA2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5FdGhQYXJhbXMudHlwZSwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnZlcnNpb24sIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uSXBQYXJhbXMudmVyc2lvbikKKyAgICAgICAgICAgICAgICAg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J0LCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLkRTQ1AsIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMucHJvdG8sIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMucmVzZXJ2ZWQsIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDY6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5JcFBhcmFtcy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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLlBhcmFtczgwMjFkcS50YWdfdHlwZSwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJUQ0xBU1NQUk9DOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNTUFJPQy5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNTUFJPQy5wcm9jZXNzaW5nLCAxKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJUU0RlbGF5OlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uVFNEZWxheS5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVFNEZWxheS5kZWxheSwgNCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiU2NoZWR1bGU6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5SSUNEYXRhRGVzY1tpXS5TY2hlZHVsZS5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU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ICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UU1BFQy5tZWRpdW1fdGltZSwgMik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwRnJtLT5SSUNEYXRhRGVzY1tpXS5udW1fV01NVENMQVM7ICsraSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiV01NVENMQVNbJWRdOlxuIiksIGkpOworICAgICAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLnByZXNlbnQpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS52ZXJzaW9uLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9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FU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uRXRoUGFyYW1zLmRlc3QsIDYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5pbmZvLkV0aFBhcmFtcy50eXBlLCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMudmVyc2lvbiwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAocEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy52ZXJzaW9uKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5zb3VyY2UsIDQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuZGVzdCwgNCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5zcmNfcG9ydCwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5kZXN0X3BvcnQsIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuRFNDUCwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5wcm90bywgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5yZXNlcnZlZCwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLnNvdXJjZSwgMTYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZGVzdCwgMTYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuc3JjX3BvcnQsIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZGVzdF9wb3J0LCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmZsb3dfbGFiZWwsIDMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDI6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uUGFyYW1zODAyMWRxLnRhZ190eXBlLCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIldNTVRDTEFTUFJPQzpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTUFJPQy5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNQUk9DLnZlcnNpb24sIDEpOworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1BST0MucHJvY2Vzc2luZywgMSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiV01NVFNEZWxheTpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRTRGVsYXkucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRTRGVsYXkudmVyc2lvbiwgMSk7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRTRGVsYXkuZGVsYXksIDQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIldNTVNjaGVkdWxlOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0Y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RShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLkhDRi5lbmFibGVkLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiV0RTOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5XRFMucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgibnVtX3dkc0RhdGE6ICVkLlxuIiksIHBGcm0tPkFpcmdvLldEUy5udW1fd2RzRGF0YSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkgcEZybS0+QWlyZ28uV0RTLndkc0RhdGEsIHBGcm0tPkFpcmdvLldEUy5udW1fd2RzRGF0YSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIkJQSW5kaWNhdG9yOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5CUEluZGljYXRvci5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uQlBJbmRpY2F0b3IuaW5kaWNhdG9yLCAxKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5CUEluZGljYXRvci50eXBlLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTG9hZEluZm86XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLkxvYWRJbmZvLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9G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by5Mb2FkQmFsYW5jZS5ic3NpZCwgNik7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uTG9hZEJhbGFuY2UuY2hhbm5lbCwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIlByb3BBc3NvY1R5cGU6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLlByb3BBc3NvY1R5cGUucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLlByb3BBc3NvY1R5cGUudHlwZSwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIkxMQXR0cjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uTExBdHRyLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPR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Xh0ZW5zaW9uLlZlcnNpb24yLm1ham9yKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJBdXRob3JpemVkTUFDczpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPldzY0Fzc29jUmVzLlZlbmRvckV4dGVuc2lvbi5BdXRob3JpemVkTUFDcy5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQXNzb2NSZXMuVmVuZG9yRXh0ZW5zaW9uLkF1dGhvcml6ZWRNQUNzLm1hYywgNik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiUmVxdWVzdFRvRW5yb2xsOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+V3NjQXNzb2NSZXMuVmVuZG9yRXh0ZW5zaW9uLlJlcXVlc3RUb0Vucm9sbC5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQXNzb2NSZXMuVmVuZG9yRXh0ZW5zaW9uLlJlcXVlc3RUb0Vucm9sbC5yZXEsIDEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIlAyUEFzc29jUmVzOlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPlAyUEFzc29jUmVzLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIlAyUFN0YXR1czpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+UDJQQXNzb2NSZXMuUDJQU3RhdHVzLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVT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RJQ0FUSU9OKSwgRlJGTCgibnVtX2tleTogJWQuXG4iKSwgcEZybS0+RlRJbmZvLkdUSy5udW1fa2V5KTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkgcEZybS0+RlRJbmZvLkdUSy5rZXksIHBGcm0tPkZUSW5mby5HVEsubnVtX2tleSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCBGUkZMKCJSMEtIX0lEOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5GVEluZm8uUjBLSF9JRC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksIEZSRkwoIm51bV9QTUtfUjBfSUQ6ICVkLlxuIiksIHBGcm0tPkZUSW5mby5SMEtIX0lELm51bV9QTUtfUjBfSUQpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSBwRnJtLT5GVEluZm8uUjBLSF9JRC5QTUtfUjBfSUQsIHBGcm0tPkZUSW5mby5SMEtIX0lELm51bV9QTUtfUjBfSUQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgRlJGTCgiSUdUSzpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+RlRJbmZvLklHVEsucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLklHVEsua2V5SUQsIDIpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5GVEluZm8uSUdUSy5JUE4sIDYpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5GVEluZm8uSUdUSy5rZXlMZW5ndGgsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5GV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FEZXNjW2ldLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgRlJGTCgiUklDRGF0YTpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPlJJQ0RhdGFEZXNjW2ldLlJJQ0RhdGEucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uUklDRGF0YS5JZGVudGlmaWVyLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlJJQ0RhdGEucmVzb3VyY2VEZXNjQ291bnQsIDEpOworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uUklDRGF0YS5zdGF0dXNDb2RlLCAyKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgRlJGTCgiUklDRGVzY3JpcHRvcjpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPlJJQ0RhdGFEZXNjW2ldLlJJQ0Rlc2NyaXB0b3IucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uUklDRGVzY3JpcHRvci5yZXNvdXJjZVR5cGUsIDEpOworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCBGUkZMKCJudW1fdmFyaWFibGVEYXRhOiAlZC5cbiIpLCBwRnJtLT5SSUNEYXRhRGVzY1tpXS5SSUNEZXNjcmlwdG9yLm51bV92YXJpYWJsZURhdGEpOworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkgcEZybS0+UklDRGF0YURlc2NbaV0uUklDRGVzY3JpcHRvci52YXJpYWJsZURhdGEsIHBGcm0tPlJJQ0RhdGFEZXNjW2ldLlJJQ0Rlc2NyaXB0b3IubnVtX3ZhcmlhYmxlRGF0YSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksIEZSRkwoIlRTUEVDOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uVFNQRUMucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCBGUkZMKCJ0cmFmZmljX3R5cGUgKDEpOiAlZFxuIiksIHBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRTUEVDLnRyYWZmaWNfdHlwZSk7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDEx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UZfQVVUSEVOVElDQVRJT04pLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS51c2VyX3ByaW9yaXR5LCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5jbGFzc2lmaWVyX3R5cGUsIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmNsYXNzaWZpZXJfbWFzaywgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmNsYXNzaWZpZXJfdHlwZSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDA6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLkV0aFBhcmFtcy5zb3VyY2UsIDYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5FdGhQYXJhbXMuZGVzdCwgNik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLkV0aFBhcmFtcy50eXBlLCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnZlcnNpb24sIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uSXBQYXJhbXMudmVyc2lvbikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA0OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHg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TlRJQ0FUSU9OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuRFNDUCwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMucHJvdG8sIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLnJlc2VydmVkLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA2OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLnNvdXJjZSwgMTYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmRlc3QsIDE2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5zcmNfcG9ydCwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZGVzdF9wb3J0LCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5mbG93X2xhYmVsLCAzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5QYXJhbXM4MDIxZHEudGFnX3R5cGUsIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksIEZSRkwoIlRDTEFTU1BST0M6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1NQUk9DLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTU1BST0MucHJvY2Vzc2luZywgMSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksIEZSRkwoIlRTRGVsYXk6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5SSUNEYXRhRGVzY1tpXS5UU0RlbGF5LnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRTRGVsYXkuZGVsYXksIDQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCBGUkZMKCJTY2hlZHVsZTpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPlJJQ0RhdGFEZXNjW2ldLlNjaGVkdWxlLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICA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NfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVFNQRUMubWVkaXVtX3RpbWUsIDIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcEZybS0+UklDRGF0YURlc2NbaV0ubnVtX1dNTVRDTEFTOyArK2kpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCBGUkZMKCJXTU1UQ0xBU1slZF06XG4iKSwgaSk7CisgICAgICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0ucHJlc2VudCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0udmVyc2lvbiwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0udXNlcl9wcmlvcml0eSwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uY2xhc3NpZmllcl90eXBlLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5jbGFzc2lmaWVyX21hc2ssIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5jbGFzc2lmaWVyX3R5cGUpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5FdGhQYXJhbXMuc291cmNlLCA2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uRXRoUGFyYW1zLmRlc3QsIDYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5FdGhQYXJhbXMudHlwZSwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy52ZXJzaW9uLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnZlcnNpb24pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5zb3VyY2UsIDQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZS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dHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLnByb3RvLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5yZXNlcnZlZCwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5zb3VyY2UsIDE2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5kZXN0LCAxNik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuc3JjX3BvcnQsIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmRlc3RfcG9ydCwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZmxvd19sYWJlbCwgMyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uUGFyYW1zODAyMWRxLnRhZ190eXBlLCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCBGUkZMKCJXTU1UQ0xBU1BST0M6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1BST0MucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNQUk9DLnZlcnNpb24sIDEpOworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNQUk9DLnByb2Nlc3NpbmcsIDEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCBGUkZMKCJXTU1UU0RlbGF5OlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uV01NVFNEZWxheS5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UU0RlbGF5LnZlcnNpb24sIDEpOworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVFNEZWxheS5kZWxheSwgNCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksIEZSRkwoIldNTVNjaGVkdWxlOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uV01NU2NoZWR1bGUucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZ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AgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJFeHRDaGFuU3dpdGNoQW5uOlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPkV4dENoYW5Td2l0Y2hBbm4ucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksICggdEFOSV9VOCogKSZwRnJtLT5FeHRDaGFuU3dpdGNoQW5uLnNlY29uZGFyeUNoYW5uZWxPZmZzZXQsIDEpOworICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJXTU1JbmZvQXA6XG4iKSk7CisgICAgICAgIGlmICghcEZybS0+V01NSW5mb0FwLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCAoIHRBTklfVTgqICkmcEZybS0+V01NSW5mb0FwLnZlcnNpb24sIDEpOworICAgIC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UkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgiSENGOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5IQ0YucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5IQ0YuZW5hYmxlZCwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgiV0RTOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5XRFMucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIm51bV93ZHNEYXRhOiAlZC5cbiIpLCBwRnJtLT5BaXJnby5XRFMubnVtX3dkc0RhdGEpOworICAgICAgICAgIC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XJzaW9uOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5WZXJzaW9uLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uVmVyc2lvbi5jaGlwX3JldiwgNCk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5WZXJzaW9uLmNhcmRfdHlwZSwgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIm51bV9idWlsZF92ZXJzaW9uOiAlZC5cbiIpLCBwRnJtLT5BaXJnby5WZXJzaW9uLm51bV9idWlsZF92ZXJzaW9uKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgKCB0QU5JX1U4KiApIHBGcm0tPkFpcmdvLlZlcnNpb24uYnVpbGRfdmVyc2lvbiwgcEZybS0+QWlyZ28uVmVyc2lvbi5udW1fYnVpbGRfdmVyc2lvbik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFN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DT04pLCBGUkZMKCJiYUJ1ZmZlclNpemUgKDEyKTogJWRcbiIpLCBwRnJtLT5BaXJnby5UYXVydXMuYmFCdWZmZXJTaXplKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgicnN2ZCAoNCk6ICVkXG4iKSwgcEZybS0+QWlyZ28uVGF1cnVzLnJzdmQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJXc2NCZWFjb246XG4iKSk7CisgICAgICAgIGlmICghcEZybS0+V3NjQmVhY29uLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJWZXJzaW9uOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NCZWFjb24uVmVyc2lvbi5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShw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CZWFjb24uQVBTZXR1cExvY2tlZC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgKCB0QU5JX1U4KiApJnBGcm0tPldzY0JlYWNvbi5BUFNldHVwTG9ja2VkLmZMb2NrZWQsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIlNlbGVjdGVkUmVnaXN0cmFyOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NCZWFjb24uU2VsZWN0ZWRSZWdpc3RyYXIucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksICggdEFOSV9VOCogKSZwRnJtLT5Xc2NCZWFjb24uU2VsZWN0ZWRSZWdpc3RyYXIuc2VsZWN0ZWQsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIkRldmljZVBhc3N3b3JkSUQ6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPldzY0JlYWNvbi5EZXZpY2VQYXNzd29yZElELnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQmVhY29uLkRldmljZVBhc3N3b3JkSUQuaWQsIDIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIlNlbGVjdGVkUmVnaXN0cmFyQ29uZmlnTWV0aG9kczpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+V3NjQmVhY29uLlNlbGVjdGVkUmVnaXN0cmFyQ29uZmlnTWV0aG9kcy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgKCB0QU5JX1U4KiApJnBGcm0tPldzY0JlYWNvbi5TZWxlY3RlZFJlZ2lzdHJhckNvbmZpZ01ldGhvZHMubWV0aG9kcywgMik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgiVVVJRF9FOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NCZWFjb24uVVVJRF9FLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQmVhY29uLlVVSURfRS51dWlkLCAxNik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgiUkZCYW5kczpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+V3NjQmVhY29uLlJGQmFuZHMucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksICggdEFOSV9VOCogKSZwRnJtLT5Xc2NCZWFjb24uUkZCYW5kcy5iYW5kcywgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgiVmVuZG9yRXh0ZW5zaW9uOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NCZWFjb24uVmVuZG9yRXh0ZW5zaW9uLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQmVhY29uLlZlbmRvckV4dGVuc2lvbi52ZW5kb3JJZCwgMyk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIlZlcnNpb24yOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+V3NjQmVhY29uLlZlbmRvckV4dGVuc2lvbi5WZXJzaW9uMi5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgibWlub3IgKDQpOiAlZFxuIiksIHBGcm0tPldzY0JlYWNvbi5WZW5kb3JFeHRlbnNpb24uVmVyc2lvbjIubWlub3IpOworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgibWFqb3IgKDQpOiAlZFxuIiksIHBGcm0tPldzY0JlYWNvbi5WZW5kb3JFeHRlbnNpb24uVmVyc2lvbjIubWFqb3IpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgiQXV0aG9yaXplZE1BQ3M6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NCZWFjb24uVmVuZG9yRXh0ZW5zaW9uLkF1dGhvcml6ZWRNQUNzLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQmVhY29uLlZlbmRvckV4dGVuc2lvbi5BdXRob3JpemVkTUFDcy5tYWMsIDYpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgiUmVxdWVzdFRvRW5yb2xsOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+V3NjQmVhY29uLlZlbmRvckV4dGVuc2lvbi5SZXF1ZXN0VG9FbnJvbGwucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksICggdEFOSV9VOCogKSZwRnJtLT5Xc2NCZWFjb24uVmVuZG9yRXh0ZW5zaW9uLlJlcXVlc3RUb0Vucm9sbC5yZXEsIDEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgiUDJQQmVhY29uOlxuIikpOworICAgICAgICBpZiAoIXBGcm0tP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ICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5IQ0YucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgKCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLkhDRi5lbmFibGVkLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgRlJGTCgiV0RTOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5XRFMucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgRlJGTCgibnVtX3dkc0RhdGE6ICVkLlxuIiksIHBGcm0tPkFpcmdvLldEUy5udW1fd2RzRGF0YSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCAoIHRBTklfVTgqICkgcEZybS0+QWlyZ28uV0RTLndkc0RhdGEsIHBGcm0tPkFpcmdvLldEUy5udW1fd2RzRGF0YSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksIEZSRkwoIkJQSW5kaWNhdG9yOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5CUEluZGljYXRvci5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uQlBJbmRpY2F0b3IuaW5kaWNhdG9yLCAxKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5CUEluZGljYXRvci50eXBlLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgRlJGTCgiTG9hZEluZm86XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLkxvYWRJbmZvLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICA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2FkQmFsYW5jZS5ic3NpZCwgNik7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uTG9hZEJhbGFuY2UuY2hhbm5lbCwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksIEZSRkwoIlByb3BBc3NvY1R5cGU6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLlByb3BBc3NvY1R5cGUucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgKCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLlByb3BBc3NvY1R5cGUudHlwZSwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksIEZSRkwoIkxMQXR0cjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uTExBdHRyLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eC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VDExRl9CRUFDT04yKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uVHJpZ2dlclN0YUJnU2Nhbi5lbmFibGUsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCBGUkZMKCJUYXVydXM6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLlRhdXJ1cy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uVGF1cnVzLmJhVElEQml0bWFwLCAyKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5UYXVydXMuYmFQb2xpY3ksIDIpOworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKH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2VkOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NCZWFjb24uQVBTZXR1cExvY2tlZC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQmVhY29uLkFQU2V0dXBMb2NrZWQuZkxvY2tlZCwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksIEZSRkwoIlNlbGVjdGVkUmVnaXN0cmFyOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NCZWFjb24uU2VsZWN0ZWRSZWdpc3RyYXIucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgKCB0QU5JX1U4KiApJnBGcm0tPldzY0JlYWNvbi5TZWxlY3RlZFJlZ2lzdHJhci5zZWxlY3RlZCwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksIEZSRkwoIkRldmljZVBhc3N3b3JkSUQ6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPldzY0JlYWNvbi5EZXZpY2VQYXNzd29yZElELnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksICggdEFOSV9VOCogKSZwRnJtLT5Xc2NCZWFjb24uRGV2aWNlUGFzc3dvcmRJRC5pZCwgMik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksIEZSRkwoIlNlbGVjdGVkUmVnaXN0cmFyQ29uZmlnTWV0aG9kczpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+V3NjQmVhY29uLlNlbGVjdGVkUmVnaXN0cmFyQ29uZmlnTWV0aG9kcy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlC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ICghcEZybS0+V3NjQmVhY29uLlZlbmRvckV4dGVuc2lvbi5WZXJzaW9uMi5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCBGUkZMKCJtaW5vciAoNCk6ICVkXG4iKSwgcEZybS0+V3NjQmVhY29uLlZlbmRvckV4dGVuc2lvbi5WZXJzaW9uMi5taW5vcik7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgRlJGTCgibWFqb3IgKDQpOiAlZFxuIiksIHBGcm0tPldzY0JlYWNvbi5WZW5kb3JFeHRlbnNpb24uVmVyc2lvbjIubWFqb3IpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksIEZSRkwoIkF1dGhvcml6ZWRNQUNzOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+V3NjQmVhY29uLlZlbmRvckV4dGVuc2lvbi5BdXRob3JpemVkTUFDcy5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQmVhY29uLlZlbmRvckV4dGVuc2lvbi5BdXRob3JpemVkTUFDcy5tYWMsIDYpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksIEZSRkwoIlJlcXVlc3RUb0Vucm9sbDpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPldzY0JlYWNvbi5WZW5kb3JFeHRlbnNpb24uUmVxdWVzdFRvRW5yb2xsLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksICggdEFOSV9VOCogKSZwRnJtLT5Xc2NCZWFjb24uVmVuZG9yRXh0ZW5zaW9uLlJlcXVlc3RUb0Vucm9sbC5yZXEsIDEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksIEZSRkwoIldBUEk6XG4iKSk7CisgICAgICAg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AgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksICggdEFOSV9VOCogKSZwRnJtLT5QMlBCZWFjb24uUDJQQ2FwYWJpbGl0eS5ncm91cENhcGFiaWxpdHksIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCBGUkZMKCJQMlBEZXZpY2VJZDpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+UDJQQmVhY29uLlAyUERldmljZUlkLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksICggdEFOSV9VOCogKSZwRnJtLT5QMlBCZWFjb24uUDJQRGV2aWNlSWQuUDJQRGV2aWNlQWRkcmVzcywgNik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksIEZSRkwoIk5vdGljZU9mQWJzZW5jZTpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+UDJQQmVhY29uLk5vdGljZU9mQWJzZW5jZS5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQ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bm4ucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksICggdEFOSV9VOCogKSZwRnJtLT5DaGFuU3dpdGNoQW5uLnN3aXRjaE1vZGUsIDEpOworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksICggdEFOSV9VOCogKSZwRnJtLT5DaGFuU3dpdGNoQW5uLm5ld0NoYW5uZWwsIDEpOworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksICggdEFOSV9VOCogKSZwRnJtLT5DaGFuU3dpdGNoQW5uLnN3aXRjaENvdW50LCAxKTsKKyAgICAgICAgfQorICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiUXVpZXQ6XG4iKSk7CisgICAgICAgIGlmICghcEZybS0+UXVpZXQucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0RVT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SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJFeHRDaGFuU3dpdGNoQW5uOlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPkV4dENoYW5Td2l0Y2hBbm4ucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksICggdEFOSV9VOCogKSZwRnJtLT5FeHRDaGFuU3dpdGNoQW5uLnNlY29uZGFyeUNoYW5uZWxPZmZzZXQsIDEpOworICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJXTU1JbmZvQXA6XG4iKSk7CisgICAgICAgIGlmICghcEZybS0+V01NSW5mb0FwLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkmcEZybS0+V01NSW5mb0FwLnZlcnNpb24sIDEpOworICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBT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iTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5IQ0YuZW5hYmxlZCwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiV0RTOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5XRFMucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIm51bV93ZHNEYXRhOiAlZC5cbiIpLCBwRnJtLT5BaXJnby5XRFMubnVtX3dkc0RhdGEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkgcEZybS0+QWlyZ28uV0RTLndkc0RhdGEsIHBGcm0tPkFpcmdvLldEUy5udW1fd2RzRGF0YSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiQlBJbmRpY2F0b3I6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLkJQSW5kaWNhdG9yLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uQlBJbmRpY2F0b3IuaW5kaWNhdG9yLCAxKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgKCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLkJQSW5kaWNhdG9yLnR5cGUsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIkxvYWRJbmZvOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5Mb2FkSW5mby5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgIC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QuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5Qcm9wUXVpZXRCU1MucXVpZXRfY291bnQsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uUHJvcFF1aWV0QlNTLnF1aWV0X3BlcmlvZCwgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5Qcm9wUXVpZXRCU1MucXVpZXRfZHVyYXRpb24sIDIpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uUHJvcFF1aWV0QlNTLnF1aWV0X29mZnNldCwgMik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiVHJpZ2dlclN0YUJnU2NhbjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uVHJpZ2dlclN0YUJnU2Nhbi5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX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ERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgibWlub3IgKDQpOiAlZFxuIiksIHBGcm0tPldzY0JlYWNvblByb2JlUmVzLlZlcnNpb24ubWlub3IpOworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJtYWpvciAoNCk6ICVkXG4iKSwgcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuVmVyc2lvbi5tYWpvcik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiV1BTU3RhdGU6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPldzY0JlYWNvblByb2JlUmVzLldQU1N0YXRlLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuV1BTU3RhdGUuc3RhdGUsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIkFQU2V0dXBMb2NrZWQ6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPldzY0JlYWNvblByb2JlUmVzLkFQU2V0dXBMb2NrZWQucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksICggdEFOSV9VOCogKSZwRnJtLT5Xc2NCZWFjb25Qcm9iZVJlcy5BUFNldHVwTG9ja2VkLmZMb2NrZWQsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIlNlbGVjdGVkUmVnaXN0cmFyOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NCZWFjb25Qcm9iZVJlcy5TZWxlY3RlZFJlZ2lzdHJhci5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgKCB0QU5JX1U4KiApJnBGcm0tPldzY0JlYWNvblByb2JlUmVzLlNlbGVjdGVkUmVnaXN0cmFyLnNlbGVjdGVkLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJEZXZpY2VQYXNzd29yZElEOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NCZWFjb25Qcm9iZVJlcy5EZXZpY2VQYXNzd29yZElELnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuRGV2aWNlUGFzc3dvcmRJRC5pZCwgMik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiU2VsZWN0ZWRSZWdpc3RyYXJDb25maWdNZXRob2RzOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NCZW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b25Qcm9iZVJlcy5SZXNwb25zZVR5cGUucmVzVHlwZSwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiVVVJRF9FOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NCZWFjb25Qcm9iZVJlcy5VVUlEX0UucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksICggdEFOSV9VOCogKSZwRnJtLT5Xc2NCZWFjb25Qcm9iZVJlcy5VVUlEX0UudXVpZCwgMTYpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk1hbnVmYWN0dXJlcjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuTWFudWZhY3R1cmVyLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJudW1fbmFtZTogJWQuXG4iKSwgcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuTWFudWZhY3R1cmVyLm51bV9uYW1lKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgKCB0QU5JX1U4KiApIHBGcm0tPldzY0JlYWNvblByb2JlUmVzLk1hbnVmYWN0dXJlci5uYW1lLCBwRnJtLT5Xc2NCZWFjb25Qcm9iZVJlcy5NYW51ZmFjdHVyZXIubnVtX25hbWUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk1vZGVsTmFtZTpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuTW9kZWxOYW1lLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJudW1fdGV4dDogJWQuXG4iKSwgcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuTW9kZWxOYW1lLm51bV90ZXh0KTs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29uUHJvYmVSZXMuVmVuZG9yRXh0ZW5zaW9uLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuVmVuZG9yRXh0ZW5zaW9uLnZlbmRvcklkLCAzKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiVmVyc2lvbjI6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NCZWFjb25Qcm9iZVJlcy5WZW5kb3JFeHRlbnNpb24uVmVyc2lvbjIucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIm1pbm9yICg0KTogJWRcbiIpLCBwRnJtLT5Xc2NCZWFjb25Qcm9iZVJlcy5WZW5kb3JFeHRlbnNpb24uVmVyc2lvbjIubWlub3IpOworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgibWFqb3IgKDQpOiAlZFxuIiksIHBGcm0tPldzY0JlYWNvblByb2JlUmVzLlZlbmRvckV4dGVuc2lvbi5WZXJzaW9uMi5tYWpvcik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJBdXRob3JpemVkTUFDczpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPldzY0JlYWNvblByb2JlUmVzLlZlbmRvckV4dGVuc2lvbi5BdXRob3JpemVkTUFDcy5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgKCB0QU5JX1U4KiApJnBGcm0tPldzY0JlYWNvblByb2JlUmVzLlZlbmRvckV4dGVuc2lvbi5BdXRob3JpemVkTUFDcy5tYWMsIDYpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiUmVxdWVzdFRvRW5yb2xsOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuVmVuZG9yRXh0ZW5zaW9uLlJlcXVlc3RUb0Vucm9sbC5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgKCB0QU5JX1U4KiApJnBGcm0tPldzY0JlYWNvblByb2JlUmVzLlZlbmRvckV4dGVuc2lvbi5SZXF1ZXN0VG9FbnJvbGwucmVxLCAxKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIlAyUEJlYWNvblByb2JlUmVzOlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPlAyUEJlYWNvblByb2JlUmVzLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU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isgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkgcEZybS0+UDJQQmVhY29uUHJvYmVSZXMuUDJQRGV2aWNlSW5mby5EZXZpY2VOYW1lLnRleHQsIHBGcm0tPlAyUEJlYWNvblByb2JlUmVzLlAyUERldmljZUluZm8uRGV2aWNlTmFtZS5udW1fdGV4dCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIlAyUEdyb3VwSW5mbzpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+UDJQQmVhY29uUHJvYmVSZXMuUDJQR3JvdXBJbmZvLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJudW1fUDJQQ2xpZW50SW5mb0Rlc2M6ICVkLlxuIiksIHBGcm0tPlAyUEJlYWNvblByb2JlUmVzLlAyUEdyb3VwSW5mby5udW1fUDJQQ2xpZW50SW5mb0Rlc2MpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfV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ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9ERVZJQ0VESVNDT1ZFUkFCSUxJVFlSRVEpLCAoIHRBTklfVTgqICkmcEZybS0+UDJQRGV2aWNlRGlzY292ZXJhYmlsaXR5UmVxLlAyUERldmljZUlkLlAyUERldmljZUFkZHJlc3MsIDYpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0RFVklDRURJU0NPVkVSQUJJTElUWVJFUSksIEZSRkwoIlAyUEdyb3VwSWQ6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPlAyUERldmljZURpc2NvdmVyYWJpbGl0eVJlcS5QMlBHcm91cElkLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0RFVklDRURJU0NPVkVSQUJJTElUWVJFUSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9ERVZJQ0VESVNDT1ZFUkFCSUxJVFlSRVEpLCAoIHRBTklfVTgqICkmcEZybS0+UDJQRGV2aWNlRGlzY292ZXJhYmlsaXR5UmVxLlAyUEdyb3VwSWQuZGV2aWNlQWRkcmVzcywgNik7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0RFVklDRURJU0NPVkVSQUJJ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geworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUSksICggdEFOSV9VOCogKSZwRnJtLT5QMlBHT05lZ1dQUy5EZXZpY2VQYXNzd29yZElELmlkLCAyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfR09ORUdSRVEpLCBGUkZMKCJQMlBHT05lZ1JlcTpcbiIpKTsKKyAgICAgICAgaWYgKCFwRnJtLT5QMlBHT05lZ1JlcS5wcmVzZW50KQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfR09ORUdSRVEpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUSksIEZSRkwoIlAyUENhcGFiaWxpdHk6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPlAyUEdPTmVnUmVxLlAyUENhcGFiaWxpdHkucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxM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W50ZW50LCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUSksIEZSRkwoIkNvbmZpZ3VyYXRpb25UaW1lb3V0OlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5QMlBHT05lZ1JlcS5Db25maWd1cmF0aW9uVGltZW91dC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUSksICggdEFOSV9VOCogKSZwRnJtLT5QMlBHT05lZ1JlcS5Db25maWd1cmF0aW9uVGltZW91dC5HT0NvbmZpZ1RpbWVvdXQsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUSksICggdEFOSV9VOCogKSZwRnJtLT5QMlBHT05lZ1JlcS5Db25maWd1cmF0aW9uVGltZW91dC5DTENvbmZpZ1RpbWVvdXQsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0dPTkVHUkVRKSwgRlJGTCgiTGlzdGVuQ2hhbm5lbDpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+UDJQR09OZWdSZXEuTGlzdGVuQ2hhbm5lbC5wcmVzZW50KQorIC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UdSRVEpLCAoIHRBTklfVTgqICkmcEZybS0+UDJQR09OZWdSZXEuUDJQRGV2aWNlSW5mby5wcmltYXJ5RGV2aWNlVHlwZSwgOCk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0dPTkVHUkVRKSwgRlJGTCgiRGV2aWNlTmFtZTpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPlAyUEdPTmVnUmVxLlAyUERldmljZUluZm8uRGV2aWNlTmFtZS5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0dPTkVHUkVRKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUSksIEZSRkwoIm51bV90ZXh0OiAlZC5cbiIpLCBwRnJtLT5QMlBHT05lZ1JlcS5QMlBEZXZpY2VJbmZvLkRldmljZU5hbWUubnVtX3RleHQpOworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfR09ORUdSRVEpLCAoIHRBTklfVTgqICkgcEZybS0+UDJQR09OZWdSZXEuUDJQRGV2aWNlSW5mby5EZXZpY2VOYW1lLnRleHQsIHBGcm0tPlAyUEdPTmVnUmVxLlAyUERldmljZUluZm8uRGV2aWNlTmFtZS5udW1fdGV4dCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICA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ICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUyksIEZSRkwoIm1pbm9yICg0KTogJWRcbiIpLCBwRnJtLT5QMlBHT05lZ1dQUy5WZXJzaW9uLm1pbm9yKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfR09ORUdSRVMpLCBGUkZMKCJtYWpvciAoNCk6ICVkXG4iKSwgcEZybS0+UDJQR09OZWdXUFMuVmVyc2lvbi5tYWpvcik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfR09ORUdSRVMpLCBGUkZMKCJEZXZpY2VQYXNzd29yZElEOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5QMlBHT05lZ1dQUy5EZXZpY2VQYXNzd29yZElELnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0dPTkVHUkVTKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0dPTkVHUkVTKSwgKCB0QU5JX1U4KiApJnBGcm0tPlAyUEdPTmVnV1BTLkRldmljZVBhc3N3b3JkSUQuaWQsIDIpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUyksIEZSRkwoIlAyUEdPTmVnUmVzOlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPlAyUEdPTmVnUmVzLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0dPTkVHUkVTKSwgRlJGTCgiUDJQU3RhdHVzOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5QMlBHT05lZ1Jlcy5QMlBTdGF0dXMucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfR09ORUdSRVMpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfR09ORUdSRVMpLCAoIHRBTklfVTgqICkmcEZybS0+UDJQR09OZWdSZXMuUDJQU3RhdHVzLnN0YXR1cywgMSk7CisgICAgICAgICAgICB9CisgICAg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U1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUyksICggdEFOSV9VOCogKSZwRnJtLT5QMlBHT05lZ1Jlcy5HT0ludGVudC5HT0ludGVudCwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfR09ORUdSRVMpLCBGUkZMKCJDb25maWd1cmF0aW9uVGltZW91dDpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+UDJQR09OZWdSZXMuQ29uZmlndXJhdGlvblRpbWVvdXQucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfR09ORUdSRVMpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfR09ORUdSRVMpLCAoIHRBTklfVTgqICkmcEZybS0+UDJQR09OZWdSZXMuQ29uZmlndXJhdGlvblRpbWVvdXQuR09Db25maWdUaW1lb3V0LCAxKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfR09ORUdSRVMpLCAoIHRBTklf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ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUyksIEZSRkwoIm51bV90ZXh0OiAlZC5cbiIpLCBwRnJtLT5QMlBHT05lZ1Jlcy5QMlBEZXZpY2VJbmZvLkRldmljZU5hbWUubnVtX3RleHQpOworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfR09ORUdSRVMpLCAoIHRBTklfVTgqICkgcEZybS0+UDJQR09OZWdSZXMuUDJQRGV2aWNlSW5mby5EZXZpY2VOYW1lLnRleHQsIHBGcm0tPlAyUEdPTmVnUmVzLlAyUERldmljZUluZm8uRGV2aWNlTmFtZS5udW1fdGV4dCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0dPTkVHUkVTKSwgRlJGTCgiUDJQR3JvdXBJZDpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+UDJQR09OZWdSZXMuUDJQR3JvdXBJZC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUyksICggdEFOSV9VOCogKSZwRnJtLT5QMlBHT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ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfSU5WSVRBVElPTlJFUSksICggdEFOSV9VOCogKSZwRnJtLT5QMlBJbnZpdGF0aW9uUmVxLk9wZXJhdGluZ0NoYW5uZWwuY2hhbm5lbCwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfSU5WSVRBVElPTlJFUSksIEZSRkwoIlAyUEdyb3VwQnNzaWQ6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPlAyUEludml0YXRpb25SZXEuUDJQR3JvdXBCc3NpZC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9JTlZJVEFUSU9OUkVRKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0lOVklUQVRJT05SRVEpLCAoIHRBTklfVTgqICkmcEZybS0+UDJQSW52aXRhdGlvblJlcS5QMlBHcm91cEJzc2lkLlAyUEdyb3VwQnNzaWQsIDYpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0lOVklUQVRJT05SRVEpLCBGUkZMKCJDaGFubmVsTGlzdDpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+UDJQSW52aXRhdGlvblJlcS5DaGFubmVsTGlzdC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZ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AgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0lOVklUQVRJT05SRVEpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0lOVklUQVRJT05SRVEpLCBGUkZMKCJudW1fdGV4dDogJWQuXG4iKSwgcEZybS0+UDJQSW52aXRhdGlvblJlcS5QMlBEZXZpY2VJbmZvLkRldmljZU5hbWUubnVtX3RleHQpOworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfSU5WSVRBVElPTlJFUSksICggdEFOSV9VOCogKSBwRnJtLT5QMlBJbnZpdGF0aW9uUmVxLlAyUERldmljZUluZm8uRGV2aWNlTmFtZS50ZXh0LCBwRnJtLT5QMlBJbnZpdGF0aW9uUmVxLlAyUERldmljZUluZm8uRGV2aWNlTmFtZS5udW1fdGV4dCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorIyAgIGVuZGlmIC8vIERPVDExRl9EVU1QX0ZSQU1FUworICAgIHJldHVybiBzdGF0dXM7CisKK30gLyogRW5kIGRvdDExZlVucGFja0ludml0YXRpb25SZXEuICovCisKKyAgICBzdGF0aWMgY29uc3QgdEZGRGVmbiBGRlNfSW52aXRhdGlvblJlc1tdID0geworICAgICAgICB7ICJDYXRlZ29yeSIsIG9mZnNldG9mKHREb3QxMWZJbnZpdGF0aW9uUmVzLCBDYXRlZ29yeSksIFNpZ0ZmQ2F0ZWdvcnkgLCBET1QxMUZf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wQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfSU5WSVRBVElPTlJFUyksIEZSRkwoIlAyUEdyb3VwQnNzaWQ6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPlAyUEludml0YXRpb25SZXMuUDJQR3JvdXBCc3NpZC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9JTlZJVEFUSU9OUkVTKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0lOVklUQVRJT05SRVMpLCAoIHRBTklfVTgqICkmcEZybS0+UDJQSW52aXRhdGlvblJlcy5QMlBHcm91cEJzc2lkLlAyUEdyb3VwQnNzaWQsIDYpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0lOVklUQVRJT05SRVMpLCBGUkZMKCJDaGFubmVsTGlzdDpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+UDJQSW52aXRhdGlvblJlcy5DaGFubmVsTGlzdC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9JTlZJVEFUSU9OUkVTKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocE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0tPkRpYWxvZ1Rva2VuLnRva2VuLCAxKTsKKyAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BSRVNFTkNFUkVTKSwgRlJGTCgiUDJQUHJlc2VuY2VSZXNwb25zZTpcbiIpKTsKKyAgICAgICAgaWYgKCFwRnJtLT5QMlBQcmVzZW5jZVJlc3BvbnNlLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUkVTRU5DRVJFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BSRVNFTkNFUkVTKSwgRlJGTCgiUDJQU3RhdHVzOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5QMlBQcmVzZW5jZVJlc3BvbnNlLlAyUFN0YXR1cy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUkVTRU5DRVJFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUkVTRU5DRVJFUyksICggdEFOSV9VOCogKSZwRnJtLT5QMlBQcmVzZW5jZVJlc3BvbnNlLlAyUFN0YXR1cy5zdGF0dXMsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUV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AgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVFVRVNUKSwgRlJGTCgiUkZCYW5kczpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+V3NjUHJvYmVSZXEuUkZCYW5kcy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFUVVFU1QpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPldzY1Byb2JlUmVxLlJGQmFuZHMuYmFuZHMsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksIEZSRkwoIkFzc29jaWF0aW9uU3RhdGU6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPldzY1Byb2JlUmVxLkFzc29jaWF0aW9uU3RhdGUucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVFVRVNUKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgR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AgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFUVVFU1QpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPldzY1Byb2JlUmVxLkRldmljZVBhc3N3b3JkSUQuaWQsIDIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksIEZSRkwoIk1hbnVmYWN0dXJlcjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+V3NjUHJvYmVSZXEuTWFudWZhY3R1cmVyLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFUVVFU1QpLCBGUkZMKCJudW1fbmFtZTogJWQuXG4iKSwgcEZybS0+V3NjUHJvYmVSZXEuTWFudWZhY3R1cmVyLm51bV9uYW1lKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNf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AgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFUVVFU1QpLCBGUkZMKCJudW1fdGV4dDogJWQuXG4iKSwgcEZybS0+V3NjUHJvYmVSZXEuRGV2aWNlTmFtZS5udW1fdGV4dCk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksICggdEFOSV9VOCogKSBwRnJtLT5Xc2NQcm9iZVJlcS5EZXZpY2VOYW1lLnRleHQsIHBGcm0tPldzY1Byb2JlUmVxLkRldmljZU5hbWUubnVtX3RleHQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksIEZSRkwoIlZlbmRvckV4dGVuc2lvbjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+V3NjUHJvYmVSZXEuVmVuZG9yRXh0ZW5zaW9uLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1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gICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFUVVFU1QpLCBGUkZMKCJBdXRob3JpemVkTUFDczpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPldzY1Byb2JlUmVxLlZlbmRvckV4dGVuc2lvbi5BdXRob3JpemVkTUFDcy5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPldzY1Byb2JlUmVxLlZlbmRvckV4dGVuc2lvbi5BdXRob3JpemVkTUFDcy5tYWMsIDYpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVFVRVNUKSwgRlJGTCgiUmVxdWVzdFRvRW5yb2xsOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+V3NjUHJvYmVSZXEuVmVuZG9yRXh0ZW5zaW9uLlJlcXVlc3RUb0Vucm9sbC5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPldzY1Byb2JlUmVxLlZlbmRvckV4dGVuc2lvbi5SZXF1ZXN0VG9FbnJvbGwucmVxLCAxKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVFVRVNUKSwgRlJGTCgiUmVxdWVzdERldmljZVR5cGU6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPldzY1Byb2JlUmVxLlJlcXVlc3REZXZpY2VUeXBlLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjUHJvYmVSZXEuUmVxdWVzdERldmljZVR5cGUucHJpbWFyeV9jYXRlZ29yeSwgMik7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0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4KiApJnBGcm0tPlAyUFByb2JlUmVxLk9wZXJhdGluZ0NoYW5uZWwuY291bnRyeVN0cmluZywgMyk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5QMlBQcm9iZVJlcS5PcGVyYXRpbmdDaGFubmVsLnJlZ3VsYXRvcnlDbGFzcywgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5QMlBQcm9iZVJlcS5PcGVyYXRpbmdDaGFubmVsLmNoYW5uZWwsIDEpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFUVVFU1QpLCBGUkZMKCJWSFRDYXBzOlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPlZIVENhcHMucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksIEZSRkwoIm1heE1QRFVMZW4gKDIpOiAlZFxuIiksIHBGcm0tPlZIVENhcHMubWF4TVBEVUxlbik7CisgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0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VDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uSENGLmVuYWJsZWQsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCBGUkZMKCJXRFM6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLldEUy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCBGUkZMKCJudW1fd2RzRGF0YTogJWQuXG4iKSwgcEZybS0+QWlyZ28uV0RTLm51bV93ZHNEYXRhKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksICggdEFOSV9VOCogKSBwRnJtLT5BaXJnby5XRFMud2RzRGF0YSwgcEZybS0+QWlyZ28uV0RTLm51bV93ZHNEYXRhKTsKKyAgICAg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Ul9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLkxvYWRJbmZvLm51bV9zdGFzLCAyKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5Mb2FkSW5mby5jaGFubmVsX3V0aWwsIDIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCBGUkZMKCJMb2FkQmFsYW5jZTpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uTG9hZEJhbGFuY2UucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLkxvYWRCYWxhbmNlLmJzc2lkLCA2KTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5Mb2FkQmFsYW5jZS5jaGFubmVsLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiUHJvcEFzc29jVHlwZTpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uUHJvcEFzc29jVHlwZS5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uUHJvcEFzc29jVHlwZS50eXBlLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiTExBdHRyOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5MTEF0dHIucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLkxMQXR0ci5kZWZlcl90aHJlc2hvbGQsIDQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCBGUkZMKCJQcm9wQ2FwYWJpbGl0eTpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uUHJvcENhcGFiaWxpdHkucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLlByb3BDYXBhYmlsaXR5LmNhcGFiaWxpdHksIDIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCBGUkZMKC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ICAgICAgICBpZiAoIXBGcm0tPldzY1Byb2JlUmVzLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksIEZSRkwoIlZlcnNpb246XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPldzY1Byb2JlUmVzLlZlcnNpb24ucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgibWlub3IgKDQpOiAlZFxuIiksIHBGcm0tPldzY1Byb2JlUmVzLlZlcnNpb24ubWlub3IpOworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgibWFqb3IgKDQpOiAlZFxuIiksIHBGcm0tPldzY1Byb2JlUmVzLlZlcnNpb24ubWFqb3IpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCBGUkZMKCJXUFNTdGF0ZTpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+V3NjUHJvYmVSZXMuV1BTU3RhdGUucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPldzY1Byb2JlUmVzLldQU1N0YXRlLnN0YXRlLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiQVBTZXR1cExvY2tlZDpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+V3NjUHJvYmVSZXMuQVBTZXR1cExvY2tlZC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUU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3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPldzY1Byb2JlUmVzLkRldmljZVBhc3N3b3JkSUQuaWQsIDIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCBGUkZMKCJTZWxlY3RlZFJlZ2lzdHJhckNvbmZpZ01ldGhvZHM6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPldzY1Byb2JlUmVzLlNlbGVjdGVkUmVnaXN0cmFyQ29uZmlnTWV0aG9kcy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjUHJvYmVSZXMuU2VsZWN0ZWRSZWdpc3RyYXJDb25maWdNZXRob2RzLm1ldGhvZHMsIDIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCBGUkZMKCJSZXNwb25zZVR5cGU6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPldzY1Byb2JlUmVzLlJlc3BvbnNlVHlwZS5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjUHJvYmVSZXMuUmVzcG9uc2VUeXBlLnJlc1R5cGUsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCBGUkZMKCJVVUlEX0U6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPldzY1Byb2JlUmVzLlVVSURfRS5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJB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7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NQcm9iZVJlcy5WZW5kb3JFeHRlbnNpb24uVmVyc2lvbjIucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgibWlub3IgKDQpOiAlZFxuIiksIHBGcm0tPldzY1Byb2JlUmVzLlZlbmRvckV4dGVuc2lvbi5WZXJzaW9uMi5taW5vcik7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgibWFqb3IgKDQpOiAlZFxuIiksIHBGcm0tPldzY1Byb2JlUmVzLlZlbmRvckV4dGVuc2lvbi5WZXJzaW9uMi5tYWpvcik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiQXV0aG9yaXplZE1BQ3M6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NQcm9iZVJlcy5WZW5kb3JFeHRlbnNpb24uQXV0aG9yaXplZE1BQ3MucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPldzY1Byb2JlUmVzLlZlbmRvckV4dGVuc2lvbi5BdXRob3JpemVkTUFDcy5tYWMsIDYpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksIEZSRkwoIlJlcXVlc3RUb0Vucm9sbDpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPldzY1Byb2JlUmVzLlZlbmRvckV4dGVuc2lvbi5SZXF1ZXN0VG9FbnJvbGwucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPldzY1Byb2JlUmVzLlZlbmRvck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MF9JRCwgcEZybS0+RlRJbmZvLlIwS0hfSUQubnVtX1BNS19SMF9JRCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCBGUkZMKCJJR1RLOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5GVEluZm8uSUdUSy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5GVEluZm8uSUdUSy5rZXlJRCwgMik7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPkZUSW5mby5JR1RLLklQTiwgNik7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPkZUSW5mby5JR1RLLmtleUxlbmd0aCwgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPkZUSW5mby5JR1RLLmtleSwgMjQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwRnJtLT5udW1fUklDRGF0YURlc2M7ICsraSkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgRlJGTCgiUklDRGF0YURlc2NbJWRdOlxuIiksIGkpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5SSUNEYXRhRGVzY1tpXS5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIlJJQ0RhdGE6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5SSUNEYXRhRGVzY1tpXS5SSUNEYXRhLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0e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wgcEZybS0+UklDRGF0YURlc2NbaV0ubnVtX1RDTEFTOyArK2kpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCBGUkZMKCJUQ0xBU1slZF06XG4iKSwgaSk7CisgICAgICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0ucHJlc2VudCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0udXNlcl9wcmlvcml0eSwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uY2xhc3NpZmllcl90eXBlLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5jbGFzc2lmaWVyX21hc2ssIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5jbGFzc2lmaWVyX3R5cGUpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5FdGhQYXJhbXMuc291cmNlLCA2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uRXRoUGFyYW1zLmRlc3QsIDYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5FdGhQYXJhbXMudHlwZSwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5JcFBhcmFtcy52ZXJzaW9uLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnZlcnNpb24pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5zb3VyY2UsIDQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLmRlc3QsIDQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnB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2UGFyYW1zLmRlc3RfcG9ydCwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZmxvd19sYWJlbCwgMyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uUGFyYW1zODAyMWRxLnRhZ190eXBlLCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCBGUkZMKCJUQ0xBU1NQUk9DOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNTUFJPQy5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1NQUk9DLnByb2Nlc3NpbmcsIDEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCBGUkZMKCJUU0RlbGF5OlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uVFNEZWxheS5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UU0RlbGF5LmRlbGF5LCA0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg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FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIldNTVRTUEVDOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uV01NVFNQRUMucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVFNQRUMudmVyc2lvbiwgMSk7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoInRyYWZmaWNfdHlwZSAoMSk6ICVkXG4iKSwgcEZybS0+UklDRGF0YURlc2NbaV0uV01NVFNQRUMudHJhZmZpY190eXBlKTsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgRlJGTCgidHNpZCAoNCk6ICVkXG4iKSwgcEZybS0+UklDRGF0YURlc2NbaV0uV01NVFNQRUMudHNpZCk7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIER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dCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLnZlcnNpb24sIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLnVzZXJfcHJpb3JpdHksIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmNsYXNzaWZpZXJfdHlwZSwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uY2xhc3NpZmllcl9tYXNrLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAocEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uY2xhc3NpZmllcl90eXBlKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIC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aV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy52ZXJzaW9uKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuc291cmNlLCA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5kZXN0LCA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5zcmNfcG9ydCwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuZGVzdF9wb3J0LCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5EU0NQLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5wcm90bywgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMucmVzZXJ2ZWQsIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDY6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE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KSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmZsb3dfbGFiZWwsIDMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDI6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5pbmZvLlBhcmFtczgwMjFkcS50YWdfdHlwZSwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgRlJGTCgiV01NVENMQVNQUk9DOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNQUk9DLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgIC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RVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5IQ0YuZW5hYmxlZCwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCBGUkZMKCJXRFM6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLldEUy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIm51bV93ZHNEYXRhOiAlZC5cbiIpLCBwRnJtLT5BaXJnby5XRFMubnVtX3dkc0RhdGEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSBwRnJtLT5BaXJnby5XRFMud2RzRGF0YSwgcEZybS0+QWlyZ28uV0RTLm51bV93ZHNEYXRhKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIkJQSW5kaWNhdG9yOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5CUEluZGljYXRvci5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5CUEluZGljYXRvci5pbmRpY2F0b3IsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5CUEluZGljYXRvci50eXBlLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIkxvYWRJbmZvOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5Mb2FkSW5mby5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0Z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BUGFyYW1zOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5Qcm9wRURDQVBhcmFtcy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5Qcm9wRURDQVBhcmFtcy5xb3MsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5Qcm9wRURDQVBhcmFtcy5yZXNlcnZlZCwgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgRlJGTCgiYWNiZV9haWZzbiAoNCk6ICVkXG4iKSwgcEZybS0+QWlyZ28uUHJvcEVEQ0FQYXJhbXMuYWNiZV9haWZzbik7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgRlJGTCgiYWNiZV9hY20gKDEpOiAlZFxuIiksIHBGcm0tPkFpcmdvLlByb3BFRENBUGFyYW1zLmFjYmVfYWNtKTsKKyAgICAgICAgICAgICAgICBGUkF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1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SQ1BJSUUucmNwaSwgMSk7CisgICAgICAgIH0KKyAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIlJTTklJRTpcbiIpKTsKKyAgICAgICAgaWYgKCFwRnJtLT5SU05JSUUucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SU05JSUUucnNuaSwgMSk7CisgICAgICAgIH0KKyAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIlJSTUVuYWJsZWRDYXA6XG4iKSk7CisgICAgICAgIGlmICghcEZybS0+UlJNRW5hYmxlZENhcC5wcmVzZW50KQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU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zY1tpXS5UU1BFQy5zdXJwbHVzX2J3X2FsbG93YW5jZSwgMik7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVFNQRUMubWVkaXVtX3RpbWUsIDIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcEZybS0+UklDRGF0YURlc2NbaV0ubnVtX1RDTEFTOyArK2kpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgRlJGTCgiVENMQVNbJWRdOlxuIiksIGkpOworICAgICAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLnByZXNlbnQpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0udXNlcl9wcmlvcml0eSwgMSk7CisgICAgICAgICAgICA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X0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLkV0aFBhcmFtcy50eXBlLCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5JcFBhcmFtcy52ZXJzaW9uLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnZlcnNpb24pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuc291cmNlLCA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JF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YXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLnByb3RvLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMucmVzZXJ2ZWQsIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDY6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLnNvdXJjZSwgMTYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5kZXN0LCAxNik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLnNyY19wb3J0LCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZGVzdF9wb3J0LCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZmxvd19sYWJlbCwgMyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLlBhcmFtczgwMjFkcS50YWdfdHlwZSwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIlRDTEFTU1BST0M6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1NQUk9DLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNTUFJPQy5wcm9jZXNzaW5nLCAxKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIlRTRGVsYXk6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5SSUNEYXRhRGVzY1tpXS5UU0RlbGF5LnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVFNEZWxheS5kZWxheSwgNCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCBGUkZMKCJTY2hlZHVsZTpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPlJJQ0RhdGFEZXNjW2ldLlNjaGVkdWxlLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCBGUkZMKCJhZ2dyZWdhdGlvbiAoMSk6ICVkXG4iKSwgcEZybS0+UklDRGF0YURlc2NbaV0uU2NoZWR1bGUuYWdncmVnYXRpb24pOworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HM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KHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uU2NoZWR1bGUubWF4X3NlcnZpY2VfZHVyLCAyKTsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5TY2hlZHVsZS5zcGVjX2ludGVydmFsLCAyKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIldNTVRTUEVDOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uV01NVFNQRUMucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UU1BFQy52ZXJzaW9uLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTF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VM7ICsraSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCBGUkZMKCJXTU1UQ0xBU1slZF06XG4iKSwgaSk7CisgICAgICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0ucHJlc2VudCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS52ZXJzaW9uLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0udXNlcl9wcmlvcml0eSwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJ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zY1tpXS5XTU1UQ0xBU1tpXS5pbmZvLkV0aFBhcmFtcy50eXBlLCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy52ZXJzaW9uLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnZlcnNpb24pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuc291cmNlLCA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVj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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMucmVzZXJ2ZWQsIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDY6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLnNvdXJjZSwgMTYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5kZXN0LCAxNik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLnNyY19wb3J0LCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZGVzdF9wb3J0LCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZmxvd19sYWJlbCwgMyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5pbmZvLlBhcmFtczgwMjFkcS50YWdfdHlwZSwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIldNTVRDTEFTUFJPQzpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTUFJPQy5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTUFJPQy52ZXJzaW9uLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1BST0MucHJvY2Vzc2luZywgMSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCBGUkZMKCJXTU1UU0RlbGF5OlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uV01NVFNEZWxheS5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRTRGVsYXkudmVyc2lvbiwgMSk7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVFNEZWxheS5kZWxheSwgNCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCBGUkZMKCJXTU1TY2hlZHVsZTpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVNjaGVkdWxlLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgRl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ICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCBGUkZMKCJCUEluZGljYXRvcjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uQlBJbmRpY2F0b3IucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5CUEluZGljYXRvci5pbmRpY2F0b3IsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uQlBJbmRpY2F0b3IudHlwZSwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTG9hZEluZm86XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLkxvYWRJbmZvLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uTG9hZEluZm8ubnVtX3N0YXMsIDIpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uTG9hZEluZm8uY2hhbm5lbF91dGlsLCAyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCBGUkZMKCJMb2FkQmFsYW5jZTpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uTG9hZEJhbGFuY2UucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5Mb2FkQmFsYW5jZS5ic3NpZCwgNik7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5Mb2FkQmFsYW5jZS5jaGFubmVsLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCBGUkZMKCJQcm9wQXNzb2NUeXBlOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5Qcm9wQXNzb2NUeXBlLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uUHJvcEFzc29jVHlwZS50eXBlLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCBGUkZMKCJMTEF0dHI6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLkxMQXR0ci5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU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1Jlcy5WZW5kb3JFeHRlbnNpb24ucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5Xc2NSZWFzc29jUmVzLlZlbmRvckV4dGVuc2lvbi52ZW5kb3JJZCwgMyk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIlZlcnNpb24yOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+V3NjUmVhc3NvY1Jlcy5WZW5kb3JFeHRlbnNpb24uVmVyc2lvbjIucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIm1pbm9yICg0KTogJWRcbiIpLC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Rl9URExTRElTUlNQKSwgKCB0QU5JX1U4KiApJnBGcm0tPkZUSW5mby5Tbm9uY2UsIDMyKTsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTRElTUlNQKSwgRlJGTCgiUjFLSF9JRDpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+RlRJbmZvLlIxS0hfSUQucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU0RJU1JTUCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTRElTUlNQKSwgKCB0QU5JX1U4KiApJnBGcm0tPkZUSW5mby5SMUtIX0lELlBNS19SMV9JRCwgNik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU0RJU1JTUCksIEZSRkwoIkdUSzpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+RlRJbmZvLkdUSy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTRElTUlNQKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJB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UMTFGX1RETFNESVNSU1ApLCBGUkZMKCJSMEtIX0lEOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5GVEluZm8uUjBLSF9JRC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTRElTUlNQKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNESVNSU1ApLCBGUkZMKCJudW1fUE1LX1IwX0lEOiAlZC5cbiIpLCBwRnJtLT5GVEluZm8uUjBLSF9JRC5udW1fUE1LX1IwX0lEKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU0RJU1JTUCksICggdEFOSV9VOCogKSBwRnJtLT5GVEluZm8uUjBLSF9JRC5QTUtfUjBfSUQsIHBGcm0tPkZUSW5mby5SMEtIX0lELm51bV9QTUtfUjBfSUQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNESVNSU1ApLCBGUkZMKCJJR1RLOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5GVEluZm8uSUdUSy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTRElTUlNQKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAg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VTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUENORiksIEZSRkwoImFjdm9fYWN3bWluICg0KTogJWRcbiIpLCBwRnJtLT5FRENBUGFyYW1TZXQuYWN2b19hY3dtaW4pOworICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUENORiksIEZSRkwoImFjdm9fYWN3bWF4ICg0KTogJWRcbiIpLCBwRnJtLT5FRENBUGFyYW1TZXQuYWN2b19hY3dtYXgpOworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUENORiksICggdEFOSV9VOCogKSZwRnJtLT5FRENBUGFyYW1TZXQuYWN2b190eG9wbGltaXQsIDIpOworICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBDTkYpLCBGUkZMKCJGVEluZm86XG4iKSk7CisgICAgICAgIGlmICghcEZybS0+RlRJbmZvLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBDTkYpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBDTkYpLCBGUkZMKCJyZXNlcnZlZCAoOCk6ICVkXG4iKSwgcEZybS0+RlRJbmZvLnJlc2VydmVkKTsKKyAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQ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X1RETFNTRVRVUENORiksICggdEFOSV9VOCogKSZwRnJtLT5GVEluZm8uUjFLSF9JRC5QTUtfUjFfSUQsIDYpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUENORiksIEZSRkwoIkdUSzpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+RlRJbmZvLkdUSy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBDTkYpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1NFVFVQQ05GKSwgRlJGTCgia2V5SWQgKDIpOiAlZFxuIiksIHBGcm0tPkZUSW5mby5HVEsua2V5SWQpOworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBDTkYpLCBGUkZMKCJyZXNlcnZlZCAoMTQpOiAlZFxuIiksIHBGcm0tPkZUSW5mby5HVEsucmVzZXJ2ZWQpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBDTkYpLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLkdUSy5rZXlMZW5ndGgsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBDTkYpLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLkdUSy5SU0MsIDgpOworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBDTkYpLCBGUkZMKCJudW1fa2V5OiAlZC5cbiIpLCBwRnJtLT5GVEluZm8uR1RLLm51bV9rZXkpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBDTkYpLCAoIHRBTklfVTgqICkgcEZybS0+RlRJbmZvLkdUSy5rZXksIHBGcm0tPkZUSW5mby5HVEsubnVtX2tleSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1NFVFVQQ05GKSwgRlJGTCgiUjBLSF9JRDpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+RlRJbmZvLlIwS0hfSUQucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1NFVFVQQ05GKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUENORiksIEZSRkwoIm51bV9QTUtfUjBfSUQ6ICVkLlxuIiksIHBGcm0tPkZUSW5mby5SMEtIX0lELm51bV9QTUtfUjBfSUQpOworICAgICA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tLT5GVEluZm8uSUdUSy5rZXlMZW5ndGgsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBDTkYpLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLklHVEsua2V5LCAyNCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUENORiksIEZSRkwoIlRpbWVvdXRJbnRlcnZhbDpcbiIpKTsKKyAgICAgICAgaWYgKCFwRnJtLT5UaW1lb3V0SW50ZXJ2YWwucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUENORiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUENORiksICggdEFOSV9VOCogKSZwRnJtLT5UaW1lb3V0SW50ZXJ2YWwudGltZW91dFR5cGUsIDEpOworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUENORiksICggdEFOSV9VOCogKSZwRnJtLT5UaW1lb3V0SW50ZXJ2YWwudGltZW91dFZhbHVlLCA0KTsKKyAgICAgICAgfQorICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1NFVFVQQ05GKSwgRlJGTCgiSFRJbmZ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ApJnBGcm0tPkZUSW5mby5SMUtIX0lELlBNS19SMV9JRCwgNik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1NFVFVQUkVRKSwgRlJGTCgiR1RLOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5GVEluZm8uR1RLLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJFUSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSRVEpLCBGUkZMKCJrZXlJZCAoMik6ICVkXG4iKSwgcEZybS0+RlRJbmZvLkdUSy5rZXlJZCk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJFUSksIEZSRkwoInJlc2VydmVkICgxNCk6ICVkXG4iKSwgcEZybS0+RlRJbmZvLkdUSy5yZXNlcnZlZCk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJFUSksICggdEFOSV9VOCogKSZwRnJtLT5GVEluZm8uR1RLLmtleUxlbmd0aCwgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJFUSksICggdEFOSV9VOCogKSZwRnJtLT5GVEluZm8uR1RLLlJTQywgOCk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJFUSksIEZSRkwoIm51bV9rZXk6ICVkLlxuIiksIHBGcm0tPkZUSW5mby5HVEsubnVtX2tleSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJFUSksICggdEFOSV9VOCogKSBwRnJtLT5GVEluZm8uR1RLLmtleSwgcEZybS0+RlRJbmZvLkdUSy5udW1fa2V5KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSRVEpLCBGUkZMKCJSMEtIX0lEOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5GVEluZm8uUjBLSF9JRC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSRVEpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1NFVFVQUkVRKSwgRlJGTCgibnVtX1BNS19SMF9JRDogJWQuXG4iKSwgcEZybS0+RlRJbmZvLlIwS0hfSUQubnVtX1BNS19SMF9JRCk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJFUSksICggdEFOSV9VOCogKSBwRnJtLT5GVEluZm8uUjBLSF9JRC5QTUtfUjBfSUQsIHBGcm0tPkZUSW5mby5SMEtIX0lELm51bV9QTUtfUjBfSUQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJFUSksIEZSRkwoIklHVEs6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkZUSW5mby5JR1RLLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJFUSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSRVEpLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLklHVEsua2V5SUQsIDIpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSRVEpLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLklHVEsuSVBOLCA2KTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1NFVFVQUkVRKSwgKCB0QU5JX1U4KiApJnBGcm0tPkZUSW5mby5JR1RLLmtleUxlbmd0aCwgMSk7CisgICAgICAgICAg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lJJQ0RhdGEucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJFUSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJFUSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhLklkZW50aWZpZXIsIDEpOworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJFUSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhLnJlc291cmNlRGVzY0NvdW50LCAxKTsKKyAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSRVEpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YS5zdGF0dXNDb2RlLCAyKTsKKyAgICAgICAgfQorICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1NFVFVQUkVRKSwgRlJGTCgiSFRDYXBzOlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPkhUQ2Fwcy5wcmVzZW50KQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1NFVFVQUkVRKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAg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MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSRVEpLCBGUkZMKCJBSUQ6XG4iKSk7CisgICAgICAgIGlmICghcEZybS0+QUlELnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSRVEpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSRVEpLCAoIHRBTklfVTgqICkmcEZybS0+QUlELmFzc29jSWQsIDIpOworICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSRVEpLCBGUkZMKCJWSFRDYXBzOlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPlZIVENhcHMucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJFUSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJFUSksIEZSRkwoIm1heE1QRFVMZW4gKDIpOiAlZFxuIiksIHBGcm0tPlZIVENhcHMubWF4TVBEVUxlbik7CisgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0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USy5rZXlMZW5ndGgsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSU1ApLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLkdUSy5SU0MsIDgpOworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSU1ApLCBGUkZMKCJudW1fa2V5OiAlZC5cbiIpLCBwRnJtLT5GVEluZm8uR1RLLm51bV9rZXkpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSU1ApLCAoIHRBTklfVTgqICkgcEZybS0+RlRJbmZvLkdUSy5rZXksIHBGcm0tPkZUSW5mby5HVEsubnVtX2tleSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1NFVFVQUlNQKSwgRlJGTCgiUjBLSF9JRDpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+RlRJbmZvLlIwS0hfSUQucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1NFVFVQUlNQKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJTUCksIEZSRkw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QxMUZfVERMU1RFQVJET1dOKSwgKCB0QU5JX1U4KiApJnBGcm0tPkZUSW5mby5NSUMsIDE2KTsKKyAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTVEVBUkRPV04pLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLkFub25jZSwgMzIpOworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNURUFSRE9XTiksICggdEFOSV9VOCogKSZwRnJtLT5GVEluZm8uU25vbmNlLCAzMik7CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1RFQVJET1dOKSwgRlJGTCgiUjFLSF9JRDpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+RlRJbmZvLlIxS0hfSUQucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1RFQVJET1dOKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNURUFSRE9XTiksICggdEFOSV9VOCogKSZwRnJtLT5GVEluZm8uUjFLSF9JRC5QTUtfUjFfSUQsIDYpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNURUFSRE9XTiksIEZSRkwoIkdUSzpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+RlRJbmZvLkdUSy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTVEVBUkRPV04pLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1RFQVJET1dOKSwgRlJGTCgia2V5SWQgKDIpOiAlZFxuIiksIHBGcm0tPkZUSW5mby5HVEsua2V5SWQpOworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTVEVBUkRPV04pLCBGUkZMKCJyZXNlcnZlZCAoMTQpOiAlZFxuIiksIHBGcm0tPkZUSW5mby5HVEsucmVzZXJ2ZWQpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTVEVBUkRPV04pLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLkdUSy5rZXlMZW5ndGgsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTVEVBUkRPV04pLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLkdUSy5SU0MsIDgpOworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTVEVBUkRPV04pLCBGUkZMKCJudW1fa2V5OiAlZC5cbiIpLCBwRnJtLT5GVEluZm8uR1RLLm51bV9rZXkpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTVEVBUkRPV04pLCAoIHRBTklfVTgqICkgcEZybS0+RlRJbmZvLkdUSy5rZXksIHBGcm0tPkZUSW5mby5HVEsubnVtX2tleSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1RFQVJET1dOKSwgRlJGTCgiUjBLSF9JRDpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+RlRJbmZvLlIwS0hfSUQucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1RFQVJET1dOKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNURUFSRE9XTiksIEZSRkwoIm51bV9QTUtfUjBfSUQ6ICVkLlxuIiksIHBGcm0tPkZUSW5mby5SMEtIX0lELm51bV9QTUtfUjBfSUQpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTVEVBUkRPV04pLCAoIHRBTklfVTgqICkgcEZybS0+RlRJbmZvLlIwS0hfSUQuUE1LX1IwX0lELCBwRnJtLT5GVEluZm8uUjBLSF9JRC5udW1fUE1LX1IwX0lEKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTVEVBUkRPV04pLCBGUkZMKCJJR1RLOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5GVEluZm8uSUdUSy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTVEVBUkRPV04pLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1RFQVJET1dOKSwgKCB0QU5JX1U4KiApJnBGcm0tPkZUSW5mby5JR1RLLmtleUlELCAyKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1RFQVJET1dOKSwgKCB0QU5JX1U4KiApJnBGcm0tPkZUSW5mby5JR1RLLklQTiwgNik7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNURUFSRE9XTiksICggdEFOSV9VOCogKSZwRnJtLT5GVEluZm8uSUdUSy5rZXlMZW5ndGgsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTVEVBUkRPV04pLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLklHVEsua2V5LCAyNCk7CisgICAgICAgICAgICB9CisgICAgICA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gRE9UMTFGX0RVTVBfRlJBTUVTCisgICAgcmV0dXJuIHN0YXR1czsKKworfSAvKiBFbmQgZG90MTFmVW5wYWNrV01NRGVsVFMuICovCisKK3N0YXRpYyB0QU5JX1UzMiBVbnBhY2tDb3JlKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHRGRkRlZm4gIEZGc1tdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdElFRGVmbiAgSUVzW10sCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwRnJtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90ICAgbkZybSkKK3sKKyAgICBjb25zdCB0RkZEZWZuICpwRmY7CisgICAgY29uc3QgdElFRGVmbiAqcEllOworICAgIHRBTklfVTggICAqcEJ1ZlJlbWFpbmluZzsKKyAgICB0QU5JX1UzMiAgbkJ1ZlJlbWFpbmluZywgc3RhdHVzOworICAgIHRBTklfVTggICBlaWQsIGxlbjsKKyAgICB0RlJBTUVTX0JPT0wgICpwZkZvdW5kOworICAgIHRBTklfVTMyICBjb3VudE9mZnNldCA9IDA7CisKKyAgICBET1QxMUZfUEFSQU1FVEVSX0NIRUNLKHBCdWYsIG5CdWYsIHBGcm0sIG5Gcm0pOworICAgICh2b2lkKW5Gcm07CisKKyAgICAodm9pZClwQ3R4OworICAgIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgIHBCdWZSZW1haW5pbmcgPSBwQnVmOworICAgIG5CdWZSZW1haW5pbmcgPSBuQnVmOworCisgICAgcEllID0gJklFc1swXTsKKyAgICB3aGlsZSAoMHhmZiAhPSBwSWUtPmVpZCkKKyAgICB7CisgICAgICAgIHBmRm91bmQgPSAodEZSQU1FU19CT09MKikocEZybSArIHBJZS0+b2Zmc2V0ICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWUtPnByZXNlbmNlT2Zmc2V0KTsKKyAgICAgICAgKnBmRm91bmQgPSAwVTsKKyAgICAgICAgaWYgKHBJZS0+Y291bnRPZmZzZXQpCisgICAgICAgIHsKKyAgICAgICAgICAgICooIHRBTklfVTE2KiApKHBGcm0gKyBwSWUtPmNvdW50T2Zmc2V0KSA9IDBVOworICAgICAgICB9CisgICAgICAgICsrcEllOworICAgIH0KKworICAgIHBGZiA9ICZGRnNbMF07CisgICAgd2hpbGUgKHBGZi0+c2l6ZSkKKyAgICB7CisgICAgICAgIGlmIChwRmYtPnNpemUgPiBuQnVmUmVtYWluaW5nKQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMyhwQ3R4LCBGUkxPR0UsIEZSRkwoIkZpeGVkIGZpZWxkICVzIGlzICVkIGIiCisgICAgICAgICAgICAgICAgInl0ZXMgaW4gc2l6ZSwgYnV0IHRoZXJlIGFyZSBvbmx5ICVkIGJ5dGVzIGxlZnQgaSIKKyAgICAgICAgICAgICAgICAibiB0aGlzIGZyYW1lLlxuIiksIHBGZi0+bmFtZSwgcEZmLT5zaXplLAorICAgICAgICAgICAgICAgICBuQnVmUmVtYWluaW5nKTsKKyAgICAgICAgICAgIEZSQU1FU19EQkdfQlJFQUsoKTsKKyAgICAgICAgICAgIHJldHVybiBET1QxMUZfTUlTU0lOR19GSVhFRF9GSUVMRDsKKyAgICAgICAgfQorCisgICAgICAgIHN3aXRjaCAocEZmLT5zaWcpCisgICAgICAgIHsKKworICAgICAgICBjYXNlIFNpZ0ZmQUlEOgorICAgICAgICAgICAgZG90MTFmVW5wYWNrRmZDb21tb25GdW5jKHBDdHgsIHBCdWZSZW1haW5pbmcsICh0QU5JX1UxNiopJigoKCB0RG90MTFmRmZBSUQqICkocEZybSArIHBGZi0+b2Zmc2V0ICkpLT5hc3NvY2lkKS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ja0ZmTWF4VHhQb3dlcihwQ3R4LCBwQnVmUmVtYWluaW5nLCAoIHREb3QxMWZGZk1heFR4UG93ZXIqICkocEZybSArIHBGZi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU2lnRmZOdW1PZlJlcGV0aXRpb25zOgorICAgICAgICAgICAgZG90MTFmVW5wYWNrRmZOdW1PZlJlcGV0aXRpb25zKHBDdHgsIHBCdWZSZW1haW5pbmcsICggdERvdDExZkZmTnVtT2ZSZXBldGl0aW9ucyogKShwRnJtICsgcEZmLT5vZmZzZXQgKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTaWdGZk9wZXJhdGluZ01vZGU6CisgICAgICAgICAgICBkb3QxMWZVbnBhY2tGZk9wZXJhdGluZ01vZGUocEN0eCwgcEJ1ZlJlbWFpbmluZywgKCB0RG90MTFmRmZPcGVyYXRpbmdNb2RlKiApKHBGcm0gKyBwRmYtPm9mZnNldCApKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNpZ0ZmUDJQT1VJOgorICAgICAgICAgICAgZG90MTFmVW5wYWNrRmZQMlBPVUkocEN0eCwgcEJ1ZlJlbWFpbmluZywgKCB0RG90MTFmRmZQMlBPVUkqICkocEZybSArIHBGZi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU2lnRmZQMlBPVUlTdWJUeXBlOgorICAgICAgICAgICAgZG90MTFmVW5wYWNrRmZQMlBPVUlTdWJUeXBlKHBDdHgsIHBCdWZSZW1haW5pbmcsICggdERvdDExZkZmUDJQT1VJU3ViVHlwZSogKShwRnJtICsgcEZmLT5vZmZzZXQgKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTaWdGZlJDUEk6CisgICAgICAgICAgICBkb3QxMWZVbnBhY2tGZlJDUEkocEN0eCwgcEJ1ZlJlbWFpbmluZywgKCB0RG90MTFmRmZSQ1BJKiApKHBGcm0gKyBwRmYtPm9mZnNldCApKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNpZ0ZmUlNOSToKKyAgICAgICAgICAgIGRvdDExZlVucGFja0ZmUlNOSShwQ3R4LCBwQnVmUmVtYWluaW5nLCAoIHREb3QxMWZGZlJTTkkqICkocEZybSArIHBGZi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU2lnRmZSZWFzb246CisgICAgICAgICAgICBkb3QxMWZVbnBhY2tGZkNvbW1vbkZ1bmMocEN0eCwgcEJ1ZlJlbWFpbmluZywgKHRBTklfVTE2KikmKCgoIHREb3QxMWZGZlJlYXNvbiogKShwRnJtICsgcEZmLT5vZmZzZXQgKSktPmNvZGUpKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNpZ0ZmUnhBbnRlbm5hSWQ6CisgICAgICAgICAgICBkb3QxMWZVbnBhY2tGZlJ4QW50ZW5uYUlkKHBDdHgsIHBCdWZSZW1haW5pbmcsICggdERvdDExZkZmUnhBbnRlbm5hSWQqICkocEZybSArIHBGZi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU2lnRmZTTVBvd2VyTW9kZVNldDoKKyAgICAgICAgICAgIGRvdDExZlVucGFja0ZmU01Qb3dlck1vZGVTZXQocEN0eCwgcEJ1ZlJlbWFpbmluZywgKCB0RG90MTFmRmZTTVBvd2VyTW9kZVNldCogKShwRnJtICsgcEZmLT5vZmZzZXQgKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTaWdGZlN0YXR1czoKKyAgICAgICAgICAgIGRvdDExZlVucGFja0ZmQ29tbW9uRnVuYyhwQ3R4LCBwQnVmUmVtYWluaW5nLCAodEFOSV9VMTYqKSYoKCggdERvdDExZkZmU3RhdHVzKiApKHBGcm0gKyBwRmYtPm9mZnNldCApKS0+c3RhdHVzKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTaWdGZlN0YXR1c0NvZGU6CisgICAgICAgICAgICBkb3QxMWZVbnBhY2tGZlN0YXR1c0NvZGUocEN0eCwgcEJ1ZlJlbWFpbmluZywgKCB0RG90MTFmRmZTdGF0dXNDb2RlKiApKHBGcm0gKyBwRmYtPm9mZnNldCApKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNpZ0ZmVFBDRWxlSUQ6CisgICAgICAgICAgICBkb3QxMWZVbnBhY2tGZlRQQ0VsZUlEKHBDdHgsIHBCdWZSZW1haW5pbmcsICggdERvdDExZkZmVFBDRWxlSUQqICkocEZybSArIHBGZi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU2lnRmZUUENFbGVMZW46CisgICAgICAgICAgICBkb3QxMWZVbnBhY2tGZlRQQ0VsZUxlbihwQ3R4LCBwQnVmUmVtYWluaW5nLCAoIHREb3QxMWZGZlRQQ0VsZUxlbiogKShwRnJtICsgcEZmLT5vZmZzZXQgKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTaWdGZlRTSW5mbzoKKyAgICAgICAgICAgIGRvdDExZlVucGFja0ZmVFNJbmZvKHBDdHgsIHBCdWZSZW1haW5pbmcsICggdERvdDExZkZmVFNJbmZvKiApKHBGcm0gKyBwRmYtPm9mZnNldCApKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNpZ0ZmVGltZVN0YW1wOgorICAgICAgICAgICAgZG90MTFmVW5wYWNrRmZUaW1lU3RhbXAocEN0eCwgcEJ1ZlJlbWFpbmluZywgKCB0RG90MTFmRmZUaW1lU3RhbXAqICkocEZybSArIHBGZi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU2lnRmZUcmFuc2FjdGlvbklkOgorICAgICAgICAgICAgZG90MTFmVW5wYWNrRmZUcmFuc2FjdGlvbklkKHBDdHgsIHBCdWZSZW1haW5pbmcsICggdERvdDExZkZmVHJhbnNhY3Rpb25JZCogKShwRnJtICsgcEZmLT5vZmZzZXQgKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTaWdGZlR4QW50ZW5uYUlkOgorICAgICAgICAgICAgZG90MTFmVW5wYWNrRmZUeEFudGVubmFJZChwQ3R4LCBwQnVmUmVtYWluaW5nLCAoIHREb3QxMWZGZlR4QW50ZW5uYUlkKiApKHBGcm0gKyBwRmYtPm9mZnNldCApKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFNpZ0ZmVHhQb3dlcjoKKyAgICAgICAgICAgIGRvdDExZlVucGFja0ZmVHhQb3dlcihwQ3R4LCBwQnVmUmVtYWluaW5nLCAoIHREb3QxMWZGZlR4UG93ZXIqICkocEZybSArIHBGZi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU2lnRmZWaHRNZW1iZXJzaGlwU3RhdHVzQXJyYXk6CisgICAgICAgICAgICBkb3QxMWZVbnBhY2tGZlZodE1lbWJlcnNoaXBTdGF0dXNBcnJheShwQ3R4LCBwQnVmUmVtYWluaW5nLCAoIHREb3QxMWZGZlZodE1lbWJlcnNoaXBTdGF0dXNBcnJheSogKShwRnJtICsgcEZmLT5vZmZzZXQgKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTaWdGZlZodFVzZXJQb3NpdGlvbkFycmF5OgorICAgICAgICAgICAgZG90MTFmVW5wYWNrRmZWaHRVc2VyUG9zaXRpb25BcnJheShwQ3R4LCBwQnVmUmVtYWluaW5nLCAoIHREb3QxMWZGZlZodFVzZXJQb3NpdGlvbkFycmF5KiApKHBGcm0gKyBwRmYtPm9mZnNldCApKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJMT0dFLCBGUkZMKCJJTlRFUk5BTCBFUlJPUjogSSBkb24nIgorICAgICAgICAgICAgICAgICJ0IGtub3cgYWJvdXQgdGhlIEZGIHNpZ25hdHVyZSAlZC0tIHRoaXMgaXMgbW9zdCAiCisgICAgICAgICAgICAgICAgImxpa2VseSBhICdmcmFtZXNjJyBidWcuXG4iKSwgcEZmLT5zaWcpOworICAgICAgICAgICAgcmV0dXJuIERPVDExRl9JTlRFUk5BTF9FUlJPUjsKKyAgICAgICAgfQorCisgICAgICAgIHBCdWZSZW1haW5pbmcgKz0gcEZmLT5zaXplOworICAgICAgICBuQnVmUmVtYWluaW5nIC09IHBGZi0+c2l6ZTsKKyAgICAgICAgKytwRmY7CisgICAgfQorCisgICAgd2hpbGUgKG5CdWZSZW1haW5pbmcpCisgICAgeworICAgICAgICBpZiAoMSA9PSBuQnVmUmVtYWluaW5nKQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkxPR0UsIEZSRkwoIlRoaXMgZnJhbWUgcmVwb3J0cyAiCisgICAgICAgICAgICAgICAgIm9ubHkgb25lIGJ5dGUgcmVtYWluaW5nIGFmdGVyIGl0J3MgZml4ZWQgZmllbGRzLlxuIikpOworICAgICAgICAgICAgc3RhdHVzIHw9IERPVDExRl9JTkNPTVBMRVRFX0lFOworICAgICAgICAgICAgRlJBTUVTX0RCR19CUkVBSygpOworICAgICAgICAgICAgZ290byBNYW5kYXRvcnlDaGVjazsKKyAgICAgICAgfQorCisgICAgICAgIHBJZSA9IEZpbmRJRURlZm4ocEN0eCwgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgSUVzKTsKKworICAgICAgICBlaWQgPSAqcEJ1ZlJlbWFpbmluZysrOyAtLW5CdWZSZW1haW5pbmc7CisgICAgICAgIGxlbiA9ICpwQnVmUmVtYWluaW5nKys7IC0tbkJ1ZlJlbWFpbmluZzsKKworICAgICAgICBpZiAocEllICYmIHBJZS0+bm91aSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKHBJZS0+bm91aSA+IG5CdWZSZW1haW5pbmcpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzMocEN0eCwgRlJMT0dXLCBGUkZMKCJJRSAlZCByZXBvcnRzICIKKyAgICAgICAgICAgICAgICAgICAgImxlbmd0aCAlZCwgYnV0IGl0IGhhcyBhbiBPVUkgb2YgJWQgYnl0ZXMuXG4iKSwKKyAgICAgICAgICAgICAgICAgICAgZWlkLCBsZW4sIHBJZS0+bm91aSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJMT0cxLCBwQnVmLCBuQnVmKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMihwQ3R4LCBGUkxPRzEsIEZSRkwoIldlJ3ZlIHBhcnNlZCAlZCBieSIKKyAgICAgICAgICAgICAgICAgICAgInRlcyBvZiB0aGlzIGJ1ZmZlciwgYW5kIHNob3cgJWQgbGVmdC5cbiIpLCAgICAgICAgICAgICAgICAgICAgcEJ1ZlJlbWFpbmluZyAtIHBCdWYsIG5CdWZSZW1haW5pbmcpOworICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBET1QxMUZfSU5DT01QTEVURV9JRTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfREJHX0JSRUFLKCk7CisgICAgICAgICAgICAgICAgZ290byBNYW5kYXRvcnlDaGVjazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBCdWZSZW1haW5pbmcgKz0gcEllLT5ub3VpOworICAgICAgICAgICAgbkJ1ZlJlbWFpbmluZyAtPSBwSWUtPm5vdWk7CisgICAgICAgICAgICBsZW4gICAgICAgICAgIC09IHBJZS0+bm91aTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChsZW4gPiBuQnVmUmVtYWluaW5nKQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMyhwQ3R4LCBGUkxPR1csIEZSRkwoIklFICVkIHJlcG9ydHMgbGVuZ3RoICUiCisgICAgICAgICAgICAgICAgImQsIGJ1dCB0aGVyZSBhcmUgb25seSAlZCBieXRlcyByZW1haW5pbmcgaW4gdGhpcyIKKyAgICAgICAgICAgICAgICAiIGZyYW1lLlxuIiksIGVpZCwgbGVuLCBuQnVmUmVtYWluaW5nKTsKKyAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSTE9HMSwgcEJ1ZiwgbkJ1Zik7CisgICAgICAgICAgICBGUkFNRVNfTE9HMihwQ3R4LCBGUkxPRzEsIEZSRkwoIldlJ3ZlIHBhcnNlZCAlZCBieSIKKyAgICAgICAgICAgICAgICAidGVzIG9mIHRoaXMgYnVmZmVyLCBhbmQgc2hvdyAlZCBsZWZ0LlxuIiksICAgICAgICAgICAgICAgIHBCdWZSZW1haW5pbmcgLSBwQnVmLCBuQnVmUmVtYWluaW5nKTsKKyAgICAgICAgICAgIHN0YXR1cyB8PSBET1QxMUZfSU5DT01QTEVURV9JRTsKKyAgICAgICAgICAgIEZSQU1FU19EQkdfQlJFQUsoKTsKKyAgICAgICAgICAgIGdvdG8gTWFuZGF0b3J5Q2hlY2s7CisgICAgICAgIH0KKworICAgICAgICBpZiAocEllKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAobkJ1ZlJlbWFpbmluZyA8IHBJZS0+bWluU2l6ZSAtIHBJZS0+bm91aSAtIDJVKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0czKHBDdHgsIEZSTE9HVywgRlJGTCgiVGhlIElFICVzIG11c3QgYmUgIgorICAgICAgICAgICAgICAgICAgICAiYXQgbGVhc3QgJWQgYnl0ZXMgaW4gc2l6ZSwgYnV0IHRoZXJlIGFyZSBvbmwiCisgICAgICAgICAgICAgICAgICAgICJ5ICVkIGJ5dGVzIHJlbWFpbmluZyBpbiB0aGlzIGZyYW1lLlxuIiksCisgICAgICAgICAgICAgICAgICAgIHBJZS0+bmFtZSwgcEllLT5taW5TaXplLCBuQnVmUmVtYWluaW5nKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkxPRzEsIHBCdWYsIG5CdWYpOworICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBET1QxMUZfSU5DT01QTEVURV9JRTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfREJHX0JSRUFLKCk7CisgICAgICAgICAgICAgICAgZ290byBNYW5kYXRvcnlDaGVjazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAobGVuID4gcEllLT5tYXhTaXplIC0gcEllLT5ub3VpIC0gMlUpeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSTE9HVywgRlJGTCgiVGhlIElFICVzIHJlcG9ydHMgIgorICAgICAgICAgICAgICAgICAgICAiYW4gdW5leHBlY3RlZGx5IGxhcmdlIHNpemU7IGl0IGlzIHByZXN1bWFibHkgIgorICAgICAgICAgICAgICAgICAgICAibW9yZSB1cC10by1kYXRlIHRoYW4gdGhpcyBwYXJzZXIsIGJ1dCB0aGlzIHdhIgorICAgICAgICAgICAgICAgICAgICAicm5pbmcgbWF5IGFsc28gaW5kaWNhdGUgYSBjb3JydXB0IGZyYW1lLlxuIiksCisgICAgICAgICAgICAgICAgICAgIHBJZS0+bmFtZSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJMT0cxLCBwQnVmLCBuQnVmKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgY291bnRPZmZzZXQgPSAoICgwICE9IHBJZS0+YXJyYXlib3VuZCkgKiAoICoodEFOSV9VMTYqICkocEZybSArIHBJZS0+Y291bnRPZmZzZXQpKSk7CisgICAgICAgICAgICAgICAgc3dpdGNoIChwSWUtPnNpZykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUFQTmFtZToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZUFQTmFtZShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFQVBOYW1lKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVBUE5hbWUpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVCUEluZGljYXRvcjoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZUJQSW5kaWNhdG9yKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVCUEluZGljYXRvciogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFQlBJbmRpY2F0b3IpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVDb25kZW5zZWRDb3VudHJ5U3RyOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llQ29uZGVuc2VkQ291bnRyeVN0cihwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFQ29uZGVuc2VkQ291bnRyeVN0ciogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFQ29uZGVuc2VkQ291bnRyeVN0cikqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUdUSzoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZUdUSyhwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFR1RLKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVHVEspKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVIQ0Y6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVDb21tb25GdW5jKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4KikgJigoKCAgdERvdDExZklFSENGKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZiggdERvdDExZklFSENGKSpjb3VudE9mZnNldCApICktPnByZXNlbnQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTgqKSAmKCgoIHREb3QxMWZJRUhDRiogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFSENGKSpjb3VudE9mZnNldCApICktPmVuYWJsZWQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUlHVEs6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVJR1RLKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVJR1RLKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVJR1RLKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llTExBdHRyOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llTExBdHRyKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVMTEF0dHIqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUxMQXR0cikqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUxvYWRCYWxhbmNlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llTG9hZEJhbGFuY2UocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRUxvYWRCYWxhbmNlKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVMb2FkQmFsYW5jZSkqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUxvYWRJbmZvOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llTG9hZEluZm8ocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRUxvYWRJbmZvKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVMb2FkSW5mbykqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVByb3BBc3NvY1R5cGU6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVDb21tb25GdW5jKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4KikgJigoKCAgdERvdDExZklFUHJvcEFzc29jVHlwZSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YoIHREb3QxMWZJRVByb3BBc3NvY1R5cGUpKmNvdW50T2Zmc2V0ICkgKS0+cHJlc2VudCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCopICYoKCggdERvdDExZklFUHJvcEFzc29jVHlwZSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUHJvcEFzc29jVHlwZSkqY291bnRPZmZzZXQgKSApLT50eXBlKSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVQcm9wQ2FwYWJpbGl0eToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVByb3BDYXBhYmlsaXR5KHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVQcm9wQ2FwYWJpbGl0eSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUHJvcENhcGFiaWxpdHkpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVQcm9wQ2hhbm5Td2l0Y2hBbm46CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVQcm9wQ2hhbm5Td2l0Y2hBbm4ocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVByb3BDaGFublN3aXRjaEFubiogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUHJvcENoYW5uU3dpdGNoQW5uKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUHJvcEVEQ0FQYXJhbXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVQcm9wRURDQVBhcmFtcyhwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFUHJvcEVEQ0FQYXJhbXMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVByb3BFRENBUGFyYW1zKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUHJvcFF1aWV0QlNTOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llUHJvcFF1aWV0QlNTKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVQcm9wUXVpZXRCU1MqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVByb3BRdWlldEJTUykqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVByb3BTdXBwUmF0ZXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVQcm9wU3VwcFJhdGVzKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVQcm9wU3VwcFJhdGVzKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVQcm9wU3VwcFJhdGVzKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUjBLSF9JRDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVIwS0hfSUQocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVIwS0hfSUQqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVIwS0hfSUQpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVSMUtIX0lEOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llUjFLSF9JRChwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFUjFLSF9JRCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUjFLSF9JRCkqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVRTRkluZm86CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVUU0ZJbmZvKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVUU0ZJbmZvKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVUU0ZJbmZvKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llVGF1cnVzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llVGF1cnVzKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVUYXVydXMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVRhdXJ1cykqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVRpdGFuOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llVGl0YW4ocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVRpdGFuKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVUaXRhbikqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVRyaWdnZXJTdGFCZ1NjYW46CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVDb21tb25GdW5jKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4KikgJigoKCAgdERvdDExZklFVHJpZ2dlclN0YUJnU2NhbiogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YoIHREb3QxMWZJRVRyaWdnZXJTdGFCZ1NjYW4pKmNvdW50T2Zmc2V0ICkgKS0+cHJlc2VudCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCopICYoKCggdERvdDExZklFVHJpZ2dlclN0YUJnU2NhbiogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFVHJpZ2dlclN0YUJnU2NhbikqY291bnRPZmZzZXQgKSApLT5lbmFibGUpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVZlcnNpb246CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVWZXJzaW9uKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVWZXJzaW9uKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVWZXJzaW9uKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV0RTOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llV0RTKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVXRFMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVdEUykqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUFQQ2hhbm5lbFJlcG9ydDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZUFQQ2hhbm5lbFJlcG9ydChwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFQVBDaGFubmVsUmVwb3J0KiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVBUENoYW5uZWxSZXBvcnQpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVCY25SZXBvcnRpbmdEZXRhaWw6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVCY25SZXBvcnRpbmdEZXRhaWwocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRUJjblJlcG9ydGluZ0RldGFpbCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFQmNuUmVwb3J0aW5nRGV0YWlsKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llQmVhY29uUmVwb3J0RnJtQm9keToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZUJlYWNvblJlcG9ydEZybUJvZHkocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRUJlYWNvblJlcG9ydEZybUJvZHkqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUJlYWNvblJlcG9ydEZybUJvZHkpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVCZWFjb25SZXBvcnRpbmc6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVCZWFjb25SZXBvcnRpbmcocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRUJlYWNvblJlcG9ydGluZyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFQmVhY29uUmVwb3J0aW5nKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llTWVhc3VyZW1lbnRQaWxvdDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZU1lYXN1cmVtZW50UGlsb3QocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRU1lYXN1cmVtZW50UGlsb3QqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRU1lYXN1cmVtZW50UGlsb3QpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVNdWx0aUJzc2lkOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llTXVsdGlCc3NpZChwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFTXVsdGlCc3NpZCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFTXVsdGlCc3NpZCkqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVJJQ0RhdGE6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVSSUNEYXRhKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVSSUNEYXRhKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVSSUNEYXRhKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUklDRGVzY3JpcHRvcjoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVJJQ0Rlc2NyaXB0b3IocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVJJQ0Rlc2NyaXB0b3IqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVJJQ0Rlc2NyaXB0b3IpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVSUk1FbmFibGVkQ2FwOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llUlJNRW5hYmxlZENhcChwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFUlJNRW5hYmxlZENhcCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUlJNRW5hYmxlZENhcCkqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVJlcXVlc3RlZEluZm86CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVSZXF1ZXN0ZWRJbmZvKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVSZXF1ZXN0ZWRJbmZvKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVSZXF1ZXN0ZWRJbmZvKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llU1NJRDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVNTSUQocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVNTSUQqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVNTSUQpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVTY2hlZHVsZToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVNjaGVkdWxlKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVTY2hlZHVsZSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFU2NoZWR1bGUpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVUQ0xBUzoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVRDTEFTKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVUQ0xBUyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFVENMQVMpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVUQ0xBU1NQUk9DOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llQ29tbW9uRnVuYyhwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodEFOSV9VOCopICYoKCggIHREb3QxMWZJRVRDTEFTU1BST0MqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKCB0RG90MTFmSUVUQ0xBU1NQUk9DKSpjb3VudE9mZnNldCApICktPnByZXNlbnQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTgqKSAmKCgoIHREb3QxMWZJRVRDTEFTU1BST0MqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVRDTEFTU1BST0MpKmNvdW50T2Zmc2V0ICkgKS0+cHJvY2Vzc2luZykgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llVFNEZWxheToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVRTRGVsYXkocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVRTRGVsYXkqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVRTRGVsYXkpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVUU1BFQzoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVRTUEVDKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVUU1BFQyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFVFNQRUMpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXTU1TY2hlZHVsZToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVdNTVNjaGVkdWxlKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVXTU1TY2hlZHVsZSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFV01NU2NoZWR1bGUpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXTU1UQ0xBUzoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVdNTVRDTEFTKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVXTU1UQ0xBUyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFV01NVENMQVMpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXTU1UQ0xBU1BST0M6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVXTU1UQ0xBU1BST0MocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVdNTVRDTEFTUFJPQyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFV01NVENMQVNQUk9DKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV01NVFNEZWxheToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVdNTVRTRGVsYXkocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVdNTVRTRGVsYXkqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVdNTVRTRGVsYXkpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXTU1UU1BFQzoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVdNTVRTUEVDKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVXTU1UU1BFQyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFV01NVFNQRUMpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVBSUQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVBSUQocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRUFJRCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFQUlEKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llQWlyZ286CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVBaXJnbyhwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFQWlyZ28qICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUFpcmdvKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llQ0ZQYXJhbXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVDRlBhcmFtcyhwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFQ0ZQYXJhbXMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUNGUGFyYW1zKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llQ2hhbGxlbmdlVGV4dDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZUNoYWxsZW5nZVRleHQocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRUNoYWxsZW5nZVRleHQqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUNoYWxsZW5nZVRleHQpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVDaGFuU3dpdGNoQW5uOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llQ2hhblN3aXRjaEFubihwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFQ2hhblN3aXRjaEFubiogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFQ2hhblN3aXRjaEFubikqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUNvdW50cnk6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVDb3VudHJ5KHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVDb3VudHJ5KiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVDb3VudHJ5KSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llRFNQYXJhbXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVDb21tb25GdW5jKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4KikgJigoKCAgdERvdDExZklFRFNQYXJhbXMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKCB0RG90MTFmSUVEU1BhcmFtcykqY291bnRPZmZzZXQgKSApLT5wcmVzZW50KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4KikgJigoKCB0RG90MTFmSUVEU1BhcmFtcyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFRFNQYXJhbXMpKmNvdW50T2Zmc2V0ICkgKS0+Y3Vycl9jaGFubmVsKSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVFRENBUGFyYW1TZXQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVFRENBUGFyYW1TZXQocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRUVEQ0FQYXJhbVNldCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFRURDQVBhcmFtU2V0KSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llRVJQSW5mbzoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZUVSUEluZm8ocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRUVSUEluZm8qICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUVSUEluZm8pKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVFU0VDY2ttT3BhcXVlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llRVNFQ2NrbU9wYXF1ZShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFRVNFQ2NrbU9wYXF1ZSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFRVNFQ2NrbU9wYXF1ZSkqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUVTRVJhZE1nbXRDYXA6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVFU0VSYWRNZ210Q2FwKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVFU0VSYWRNZ210Q2FwKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVFU0VSYWRNZ210Q2FwKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llRVNFVHJhZlN0cm1NZXQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVFU0VUcmFmU3RybU1ldChwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFRVNFVHJhZlN0cm1NZXQqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUVTRVRyYWZTdHJtTWV0KSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llRVNFVHJhZlN0cm1SYXRlU2V0OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llRVNFVHJhZlN0cm1SYXRlU2V0KHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVFU0VUcmFmU3RybVJhdGVTZXQqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUVTRVRyYWZTdHJtUmF0ZVNldCkqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUVTRVR4bWl0UG93ZXI6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVFU0VUeG1pdFBvd2VyKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVFU0VUeG1pdFBvd2VyKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVFU0VUeG1pdFBvd2VyKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llRVNFVmVyc2lvbjoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZUVTRVZlcnNpb24ocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRUVTRVZlcnNpb24qICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUVTRVZlcnNpb24pKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVFeHRDYXA6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVFeHRDYXAocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRUV4dENhcCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFRXh0Q2FwKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llRXh0Q2hhblN3aXRjaEFubjoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZUNvbW1vbkZ1bmMocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfVTgqKSAmKCgoICB0RG90MTFmSUVFeHRDaGFuU3dpdGNoQW5uKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZiggdERvdDExZklFRXh0Q2hhblN3aXRjaEFubikqY291bnRPZmZzZXQgKSApLT5wcmVzZW50KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4KikgJigoKCB0RG90MTFmSUVFeHRDaGFuU3dpdGNoQW5uKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVFeHRDaGFuU3dpdGNoQW5uKSpjb3VudE9mZnNldCApICktPnNlY29uZGFyeUNoYW5uZWxPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUV4dFN1cHBSYXRlczoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZUV4dFN1cHBSYXRlcyhwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFRXh0U3VwcFJhdGVzKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVFeHRTdXBwUmF0ZXMpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVGSFBhcmFtU2V0OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llRkhQYXJhbVNldChwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFRkhQYXJhbVNldCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFRkhQYXJhbVNldCkqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUZIUGFyYW1zOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llRkhQYXJhbXMocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRUZIUGFyYW1zKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVGSFBhcmFtcykqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUZIUGF0dFRhYmxlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llRkhQYXR0VGFibGUocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRUZIUGF0dFRhYmxlKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVGSFBhdHRUYWJsZSkqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUZUSW5mbzoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZUZUSW5mbyhwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFRlRJbmZvKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVGVEluZm8pKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVIVDIwNDBCU1NDb2V4aXN0ZW5jZToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZUhUMjA0MEJTU0NvZXhpc3RlbmNlKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVIVDIwNDBCU1NDb2V4aXN0ZW5jZSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFSFQyMDQwQlNTQ29leGlzdGVuY2UpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVIVDIwNDBCU1NJbnRvbGVyYW50UmVwb3J0OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llSFQyMDQwQlNTSW50b2xlcmFudFJlcG9ydChwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFSFQyMDQwQlNTSW50b2xlcmFudFJlcG9ydCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFSFQyMDQwQlNTSW50b2xlcmFudFJlcG9ydCkqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUhUQ2FwczoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZUhUQ2FwcyhwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFSFRDYXBzKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVIVENhcHMpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVIVEluZm86CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVIVEluZm8ocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRUhUSW5mbyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFSFRJbmZvKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llSUJTU1BhcmFtczoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZUlCU1NQYXJhbXMocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRUlCU1NQYXJhbXMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUlCU1NQYXJhbXMpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVMaW5rSWRlbnRpZmllcjoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZUxpbmtJZGVudGlmaWVyKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVMaW5rSWRlbnRpZmllciogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFTGlua0lkZW50aWZpZXIpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVNZWFzdXJlbWVudFJlcG9ydDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZU1lYXN1cmVtZW50UmVwb3J0KHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVNZWFzdXJlbWVudFJlcG9ydCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFTWVhc3VyZW1lbnRSZXBvcnQpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVNZWFzdXJlbWVudFJlcXVlc3Q6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVNZWFzdXJlbWVudFJlcXVlc3QocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRU1lYXN1cmVtZW50UmVxdWVzdCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFTWVhc3VyZW1lbnRSZXF1ZXN0KSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llTW9iaWxpdHlEb21haW46CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVNb2JpbGl0eURvbWFpbihwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFTW9iaWxpdHlEb21haW4qICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRU1vYmlsaXR5RG9tYWluKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llTmVpZ2hib3JSZXBvcnQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVOZWlnaGJvclJlcG9ydChwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFTmVpZ2hib3JSZXBvcnQqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRU5laWdoYm9yUmVwb3J0KSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llT0JTU1NjYW5QYXJhbWV0ZXJzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llT0JTU1NjYW5QYXJhbWV0ZXJzKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVPQlNTU2NhblBhcmFtZXRlcnMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRU9CU1NTY2FuUGFyYW1ldGVycykqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZU9wZXJhdGluZ01vZGU6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVPcGVyYXRpbmdNb2RlKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVPcGVyYXRpbmdNb2RlKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVPcGVyYXRpbmdNb2RlKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQQXNzb2NSZXE6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVQMlBBc3NvY1JlcShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFUDJQQXNzb2NSZXEqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVAyUEFzc29jUmVxKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQQXNzb2NSZXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVQMlBBc3NvY1JlcyhwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFUDJQQXNzb2NSZXMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVAyUEFzc29jUmVzKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQQmVhY29uOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llUDJQQmVhY29uKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVQMlBCZWFjb24qICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVAyUEJlYWNvbikqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUEJlYWNvblByb2JlUmVzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llUDJQQmVhY29uUHJvYmVSZXMocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVAyUEJlYWNvblByb2JlUmVzKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVQMlBCZWFjb25Qcm9iZVJlcykqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUERlQXV0aDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVAyUERlQXV0aChwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFUDJQRGVBdXRoKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVQMlBEZUF1dGgpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVQMlBEZXZpY2VEaXNjb3ZlcmFiaWxpdHlSZXE6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVQMlBEZXZpY2VEaXNjb3ZlcmFiaWxpdHlSZXEocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVAyUERldmljZURpc2NvdmVyYWJpbGl0eVJlcSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUDJQRGV2aWNlRGlzY292ZXJhYmlsaXR5UmVxKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQRGV2aWNlRGlzY292ZXJhYmlsaXR5UmVzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llUDJQRGV2aWNlRGlzY292ZXJhYmlsaXR5UmVzKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVQMlBEZXZpY2VEaXNjb3ZlcmFiaWxpdHlSZXMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVAyUERldmljZURpc2NvdmVyYWJpbGl0eVJlcykqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUERpc0Fzc29jOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llUDJQRGlzQXNzb2MocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVAyUERpc0Fzc29jKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVQMlBEaXNBc3NvYykqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUEdPTmVnQ25mOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llUDJQR09OZWdDbmYocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVAyUEdPTmVnQ25mKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVQMlBHT05lZ0NuZikqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUEdPTmVnUmVxOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llUDJQR09OZWdSZXEocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVAyUEdPTmVnUmVxKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVQMlBHT05lZ1JlcSkqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUEdPTmVnUmVzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llUDJQR09OZWdSZXMocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVAyUEdPTmVnUmVzKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVQMlBHT05lZ1JlcykqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUEdPTmVnV1BTOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llUDJQR09OZWdXUFMocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVAyUEdPTmVnV1BTKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVQMlBHT05lZ1dQUykqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUElFT3BhcXVlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llUDJQSUVPcGFxdWUocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVAyUElFT3BhcXVlKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVQMlBJRU9wYXF1ZSkqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUEludml0YXRpb25SZXE6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVQMlBJbnZpdGF0aW9uUmVxKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVQMlBJbnZpdGF0aW9uUmVxKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVQMlBJbnZpdGF0aW9uUmVxKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQSW52aXRhdGlvblJlczoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVAyUEludml0YXRpb25SZXMocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVAyUEludml0YXRpb25SZXMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVAyUEludml0YXRpb25SZXMpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVQMlBOb3RpY2VPZkFic2VuY2U6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVQMlBOb3RpY2VPZkFic2VuY2UocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVAyUE5vdGljZU9mQWJzZW5jZSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUDJQTm90aWNlT2ZBYnNlbmNlKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQUHJlc2VuY2VSZXNwb25zZToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVAyUFByZXNlbmNlUmVzcG9uc2UocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVAyUFByZXNlbmNlUmVzcG9uc2UqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVAyUFByZXNlbmNlUmVzcG9uc2UpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVQMlBQcm9iZVJlcToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVAyUFByb2JlUmVxKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVQMlBQcm9iZVJlcSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUDJQUHJvYmVSZXEpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVQMlBQcm9iZVJlczoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVAyUFByb2JlUmVzKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVQMlBQcm9iZVJlcyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUDJQUHJvYmVSZXMpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVQMlBQcm92aXNpb25EaXNjb3ZlcnlSZXE6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVQMlBQcm92aXNpb25EaXNjb3ZlcnlSZXEocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVAyUFByb3Zpc2lvbkRpc2NvdmVyeVJlcSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUDJQUHJvdmlzaW9uRGlzY292ZXJ5UmVxKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQV1NDUHJvdmlzaW9uRGlzY292ZXJ5UmVzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llUDJQV1NDUHJvdmlzaW9uRGlzY292ZXJ5UmVzKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVQMlBXU0NQcm92aXNpb25EaXNjb3ZlcnlSZXMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVAyUFdTQ1Byb3Zpc2lvbkRpc2NvdmVyeVJlcykqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVBUSUNvbnRyb2w6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVQVElDb250cm9sKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVQVElDb250cm9sKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVQVElDb250cm9sKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUFVCdWZmZXJTdGF0dXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVQVUJ1ZmZlclN0YXR1cyhwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFUFVCdWZmZXJTdGF0dXMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVBVQnVmZmVyU3RhdHVzKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUG93ZXJDYXBzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llUG93ZXJDYXBzKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVQb3dlckNhcHMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVBvd2VyQ2FwcykqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVBvd2VyQ29uc3RyYWludHM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVQb3dlckNvbnN0cmFpbnRzKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVQb3dlckNvbnN0cmFpbnRzKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVQb3dlckNvbnN0cmFpbnRzKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUUJTU0xvYWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVRQlNTTG9hZChwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFUUJTU0xvYWQqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVFCU1NMb2FkKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUU9TQ2Fwc0FwOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llUU9TQ2Fwc0FwKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVRT1NDYXBzQXAqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVFPU0NhcHNBcCkqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVFPU0NhcHNTdGF0aW9uOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llUU9TQ2Fwc1N0YXRpb24ocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVFPU0NhcHNTdGF0aW9uKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVRT1NDYXBzU3RhdGlvbikqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVFvc01hcFNldDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVFvc01hcFNldChwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFUW9zTWFwU2V0KiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVRb3NNYXBTZXQpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVRdWlldDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVF1aWV0KHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVRdWlldCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUXVpZXQpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVSQ1BJSUU6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVSQ1BJSUUocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVJDUElJRSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUkNQSUlFKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUklDRGF0YURlc2M6CisgICAgICAgICAgICAgICAgICAgICAgICAvL3Jlc2V0IHRoZSBwb2ludGVycyBiYWNrIHNpbmNlIHRoaXMgaXMgYSBjb250YWluZXIgSUUgYW5kIGl0IGRvZXNudCBoYXZlIGl0cyBvd24gRUlEIGFuZCBMZW4uCisgICAgICAgICAgICAgICAgICAgICAgICBwQnVmUmVtYWluaW5nIC09IDI7IG5CdWZSZW1haW5pbmcgKz0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICggcEllICYmIHBJZS0+bm91aSApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQnVmUmVtYWluaW5nIC09IHBJZS0+bm91aTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbkJ1ZlJlbWFpbmluZyArPSBwSWUtPm5vdWk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlbiArPSBwSWUtPm5vdWk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IEdldENvbnRhaW5lckllc0xlbihwQ3R4LCBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuLCBJRVNfUklDRGF0YURlc2MpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBET1QxMUZfUEFSU0VfU1VDQ0VTUyAmJiBzdGF0dXMgIT0gRE9UMTFGX1VOS05PV05fSUVTICkgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVSSUNEYXRhRGVzYyhwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFUklDRGF0YURlc2MqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVJJQ0RhdGFEZXNjKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUlNOOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llUlNOKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVSU04qICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVJTTikqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVJTTklJRToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVJTTklJRShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFUlNOSUlFKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVSU05JSUUpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVSU05PcGFxdWU6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVSU05PcGFxdWUocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVJTTk9wYXF1ZSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUlNOT3BhcXVlKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llU3VwcENoYW5uZWxzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llU3VwcENoYW5uZWxzKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVTdXBwQ2hhbm5lbHMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVN1cHBDaGFubmVscykqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVN1cHBPcGVyYXRpbmdDbGFzc2VzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llU3VwcE9wZXJhdGluZ0NsYXNzZXMocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVN1cHBPcGVyYXRpbmdDbGFzc2VzKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVTdXBwT3BlcmF0aW5nQ2xhc3NlcykqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVN1cHBSYXRlczoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVN1cHBSYXRlcyhwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFU3VwcFJhdGVzKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVTdXBwUmF0ZXMpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVUSU06CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVUSU0ocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVRJTSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFVElNKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llVFBDUmVwb3J0OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llVFBDUmVwb3J0KHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVUUENSZXBvcnQqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVRQQ1JlcG9ydCkqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVRQQ1JlcXVlc3Q6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVUUENSZXF1ZXN0KHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVUUENSZXF1ZXN0KiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVUUENSZXF1ZXN0KSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llVGltZW91dEludGVydmFsOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llVGltZW91dEludGVydmFsKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVUaW1lb3V0SW50ZXJ2YWwqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVRpbWVvdXRJbnRlcnZhbCkqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVZIVENhcHM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVWSFRDYXBzKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVWSFRDYXBzKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVWSFRDYXBzKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llVkhURXh0QnNzTG9hZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVZIVEV4dEJzc0xvYWQocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVZIVEV4dEJzc0xvYWQqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVZIVEV4dEJzc0xvYWQpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVWSFRPcGVyYXRpb246CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVWSFRPcGVyYXRpb24ocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVZIVE9wZXJhdGlvbiogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFVkhUT3BlcmF0aW9uKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV0FQSToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVdBUEkocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVdBUEkqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVdBUEkpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXQVBJT3BhcXVlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llV0FQSU9wYXF1ZShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFV0FQSU9wYXF1ZSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFV0FQSU9wYXF1ZSkqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdGQVRQQzoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVdGQVRQQyhwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFV0ZBVFBDKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVXRkFUUEMpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXRkRJRU9wYXF1ZToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVdGRElFT3BhcXVlKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVXRkRJRU9wYXF1ZSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFV0ZESUVPcGFxdWUpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXTU1DYXBzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llV01NQ2FwcyhwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFV01NQ2FwcyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFV01NQ2FwcykqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdNTUluZm9BcDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVdNTUluZm9BcChwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFV01NSW5mb0FwKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVXTU1JbmZvQXApKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXTU1JbmZvU3RhdGlvbjoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVdNTUluZm9TdGF0aW9uKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVXTU1JbmZvU3RhdGlvbiogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFV01NSW5mb1N0YXRpb24pKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXTU1QYXJhbXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVXTU1QYXJhbXMocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVdNTVBhcmFtcyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFV01NUGFyYW1zKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV1BBOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llV1BBKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVXUEEqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVdQQSkqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdQQU9wYXF1ZToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tJZVdQQU9wYXF1ZShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFV1BBT3BhcXVlKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVXUEFPcGFxdWUpKmNvdW50T2Zmc2V0KSApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXU0M6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVXU0MocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVdTQyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFV1NDKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV2lkZXJCV0NoYW5Td2l0Y2hBbm46CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVXaWRlckJXQ2hhblN3aXRjaEFubihwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFV2lkZXJCV0NoYW5Td2l0Y2hBbm4qICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVdpZGVyQldDaGFuU3dpdGNoQW5uKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV3NjQXNzb2NSZXE6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVXc2NBc3NvY1JlcShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFV3NjQXNzb2NSZXEqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVdzY0Fzc29jUmVxKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV3NjQXNzb2NSZXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVXc2NBc3NvY1JlcyhwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZklFV3NjQXNzb2NSZXMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVdzY0Fzc29jUmVzKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV3NjQmVhY29uOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llV3NjQmVhY29uKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVXc2NCZWFjb24qICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVdzY0JlYWNvbikqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdzY0JlYWNvblByb2JlUmVzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llV3NjQmVhY29uUHJvYmVSZXMocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVdzY0JlYWNvblByb2JlUmVzKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVXc2NCZWFjb25Qcm9iZVJlcykqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdzY0lFT3BhcXVlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llV3NjSUVPcGFxdWUocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVdzY0lFT3BhcXVlKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVXc2NJRU9wYXF1ZSkqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdzY1Byb2JlUmVxOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llV3NjUHJvYmVSZXEocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVdzY1Byb2JlUmVxKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVXc2NQcm9iZVJlcSkqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdzY1Byb2JlUmVzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja0llV3NjUHJvYmVSZXMocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZJRVdzY1Byb2JlUmVzKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVXc2NQcm9iZVJlcykqY291bnRPZmZzZXQpICk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdzY1JlYXNzb2NSZXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrSWVXc2NSZWFzc29jUmVzKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmSUVXc2NSZWFzc29jUmVzKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVXc2NSZWFzc29jUmVzKSpjb3VudE9mZnNldCkgKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkxPR0UsIEZSRkwoIklOVEVSTkFMIEVSUk9SIgorICAgICAgICAgICAgICAgICAgICAgICAgIjogSSBkb24ndCBrbm93IGFib3V0IHRoZSBJRSBzaWduYXR1cmUgJWQiCisgICAgICAgICAgICAgICAgICAgICAgICAiLS0gdGhpcyBpcyBtb3N0IGxpa2VseSBhICdmcmFtZXNjJyBidWcuXG4iKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBJZS0+c2lnKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfREJHX0JSRUFLKCk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBET1QxMUZfSU5URVJOQUxfRVJST1I7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHBJZS0+YXJyYXlib3VuZCkgKCsrKCAqKHRBTklfVTE2KikocEZybSArIHBJZS0+Y291bnRPZmZzZXQpICkpOworICAgICAgICAgICAgfQorCisKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cyKHBDdHgsIEZSTE9HMywgRlJGTCgiU2tpcHBpbmcgdW5rbm93biBJRSAlZCIKKyAgICAgICAgICAgICAgICAiIChsZW5ndGggJWQpXG4iKSwgZWlkLCBsZW4pOworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJMT0czLCBwQnVmUmVtYWluaW5nIC0gMiwgbGVuKTsKKyAgICAgICAgICAgIHN0YXR1cyB8PSBET1QxMUZfVU5LTk9XTl9JRVM7CisgICAgICAgIH0KKworICAgICAgICBwQnVmUmVtYWluaW5nICs9IGxlbjsKKworICAgICAgICAgaWYgKGxlbiA+IG5CdWZSZW1haW5pbmcpCisgICAgICAgICB7CisgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJMT0dXLCBGUkZMKCJUaGlzIElFIGV4dGVuZHMgcGFzdCAiCisgICAgICAgICAgICAgICAgICJ0aGUgYnVmZmVyIGFzIGl0IHdhcyBkZWZpbmVkIHRvIHVzLiAgVGhpcyBjb3VsZCIKKyAgICAgICAgICAgICAgICAgIm1lYW4gYSBjb3JydXB0IGZyYW1lLCBvciBqdXN0IGFuIGluY29ycmVjdCBsZW5nIgorICAgICAgICAgICAgICAgICAidGggcGFyYW1ldGVyLlxuIikpOworICAgICAgICAgICAgIEZSQU1FU19EQkdfQlJFQUsoKTsKKyAgICAgICAgICAgICBzdGF0dXMgfD0gRE9UMTFGX0xBU1RfSUVfVE9PX0xPTkc7CisgICAgICAgICAgICAgZ290byBNYW5kYXRvcnlDaGVjazsKKyAgICAgICAgIH0KKworICAgICAgICBuQnVmUmVtYWluaW5nIC09IGxlbjsKKworICAgIH0KKworTWFuZGF0b3J5Q2hlY2s6CisgICAgcEllID0gJklFc1swXTsKKyAgICB3aGlsZSAoMHhmZiAhPSBwSWUtPmVpZCkKKyAgICB7CisgICAgICAgIGlmIChwSWUtPmZNYW5kYXRvcnkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBmRm91bmQgPSAodEZSQU1FU19CT09MKikocEZybSArIHBJZS0+b2Zmc2V0ICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllLT5wcmVzZW5jZU9mZnNldCk7CisgICAgICAgICAgICBpZiAoISpwZkZvdW5kKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSTE9HVywgRlJGTCgiRVJST1I6IFRoZSBtYW5kYXRvIgorICAgICAgICAgICAgICAgICAgICAicnkgSUUgJXMgd2Fzbid0IHNlZW4uXG4iKSwKKyAgICAgICAgICAgICAgICAgICAgcEllLT5uYW1lKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfREJHX0JSRUFLKCk7CisgICAgICAgICAgICAgICAgc3RhdHVzIHw9IERPVDExRl9NQU5EQVRPUllfSUVfTUlTU0lORzsKKyAgICAgICAgICAgIH0KKworICAgICAgICB9CisgICAgICAgICsrcEllOworICAgIH0KKworICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBVbnBhY2tDb3JlLiAqLworCitzdGF0aWMgdEFOSV9VMzIgVW5wYWNrVGx2Q29yZSggdHBBbmlTaXJHbG9iYWwgICBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0VExWRGVmbiAgICAgVExWc1sgXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwRnJtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCAgICAgICBuRnJtICkKK3sKKyAgICBjb25zdCB0VExWRGVmbiAqcFRsdjsKKyAgICB0QU5JX1UzMiAgICAgIG5CdWZSZW1haW5pbmcsIHN0YXR1cywgbnBlYzsKKyAgICB0QU5JX1UxNiAgICAgIGlkLCBsZW47CisgICAgdEFOSV9VOCAgICAgICpwQnVmUmVtYWluaW5nLCAqcGZGb3VuZDsKKworICAgICh2b2lkKXBDdHg7ICAgICAgICAgICAgICAgICAvLyBTaHV0dXAgdGhlIGNvbXBpbGVyCisgICAgKHZvaWQpbkZybTsKKyAgICBzdGF0dXMgPSBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKKyAgICBwQnVmUmVtYWluaW5nID0gcEJ1ZjsKKyAgICBuQnVmUmVtYWluaW5nID0gbkJ1ZjsKKworICAgIC8vIFdoaWxlIHdlIGhhdmUgZGF0YS4uLgorICAgIHdoaWxlICggbkJ1ZlJlbWFpbmluZyApCisgICAgeworICAgICAgICBpZiAoIDMgPiBuQnVmUmVtYWluaW5nICkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAoIHBDdHgsIEZSTE9HRSwgRlJGTCggIlRoaXMgZnJhbWUgcmVwb3J0cyAiCisgICAgICAgICAgICAgICAgICAgICAgICAgImZld2VyIHRocmVlIGJ5dGUocykgcmVtYWluaW5nLlxuIiApICk7CisgICAgICAgICAgICBzdGF0dXMgfD0gRE9UMTFGX0lOQ09NUExFVEVfVExWOworICAgICAgICAgICAgRlJBTUVTX0RCR19CUkVBSygpOworICAgICAgICAgICAgZ290byBNYW5kYXRvcnlDaGVjazsKKyAgICAgICAgfQorCisgICAgICAgIG5wZWMgPSAwVTsKKworICAgICAgICAvLyBMb29rIGZvciBhIG1hdGNoaW5nIFRMViBkZWZpbml0aW9uLAorICAgICAgICBwVGx2ID0gRmluZFRMVkRlZm4oIHBDdHgsIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsIFRMVnMgKTsKKyAgICAgICAgLy8gY29uc3VtZSB0aGUgdHlwZSwKKyAgICAgICAgaWYgKCBwVGx2ICkKKyAgICAgICAgeworICAgICAgICAgICBpZiAoIHBUbHYtPnNUeXBlID09IDIpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZnJhbWVzbnRvaHMocEN0eCwgJmlkLCBwQnVmUmVtYWluaW5nLCBwVGx2LT5mTXNiKTsKKyAgICAgICAgICAgICAgcEJ1ZlJlbWFpbmluZyArPSAyOworICAgICAgICAgICAgICBuQnVmUmVtYWluaW5nIC09IDI7CisgICAgICAgICAgIH1lbHNlCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWQgPSAqcEJ1ZlJlbWFpbmluZzsKKyAgICAgICAgICAgICAgcEJ1ZlJlbWFpbmluZyArPSAxOworICAgICAgICAgICAgICBuQnVmUmVtYWluaW5nIC09IDE7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgLy8gJiBsZW5ndGgsCisgICAgICAgICAgIGlmICggcFRsdi0+c0xlbiA9PSAyKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgIGZyYW1lc250b2hzKHBDdHgsICZsZW4sIHBCdWZSZW1haW5pbmcsIHBUbHYtPmZNc2IpOworICAgICAgICAgICAgICBpZiAoIDIgPiBuQnVmUmVtYWluaW5nICkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAoIHBDdHgsIEZSTE9HRSwgRlJGTCgiVGhpcyBmcmFtZSByZXBvcnRzICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImZld2VyIHR3byBieXRlKHMpIHJlbWFpbmluZy5cbiIpICk7CisgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gRE9UMTFGX0lOQ09NUExFVEVfVExWOworICAgICAgICAgICAgICAgICAgRlJBTUVTX0RCR19CUkVBSygpOworICAgICAgICAgICAgICAgICAgZ290byBNYW5kYXRvcnlDaGVjazsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBwQnVmUmVtYWluaW5nICs9IDI7CisgICAgICAgICAgICAgIG5CdWZSZW1haW5pbmcgLT0gMjsKKyAgICAgICAgICAgfWVsc2UKKyAgICAgICAgICAgeworICAgICAgICAgICAgICBsZW4gPSAqcEJ1ZlJlbWFpbmluZzsKKyAgICAgICAgICAgICAgcEJ1ZlJlbWFpbmluZyArPSAxOworICAgICAgICAgICAgICBuQnVmUmVtYWluaW5nIC09IDE7CisgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgcEJ1ZlJlbWFpbmluZyArPSBUTFZzWzBdLnNUeXBlOworICAgICAgICAgICBuQnVmUmVtYWluaW5nIC09IFRMVnNbMF0uc1R5cGU7CisgICAgICAgICAgIGZyYW1lc250b2hzKHBDdHgsICZsZW4sIHBCdWZSZW1haW5pbmcsIChUTFZzWzBdLnNUeXBlID09IDIpKTsKKyAgICAgICAgICAgaWYgKCAyID4gbkJ1ZlJlbWFpbmluZyApCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgRlJBTUVTX0xPRzAoIHBDdHgsIEZSTE9HRSwgRlJGTCgiVGhpcyBmcmFtZSByZXBvcnRzICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAiZmV3ZXIgdHdvIGJ5dGUocykgcmVtYWluaW5nLlxuIikgKTsKKyAgICAgICAgICAgICAgc3RhdHVzIHw9IERPVDExRl9JTkNPTVBMRVRFX1RMVjsKKyAgICAgICAgICAgICAgRlJBTUVTX0RCR19CUkVBSygpOworICAgICAgICAgICAgICBnb3RvIE1hbmRhdG9yeUNoZWNrOworICAgICAgICAgICB9CisgICAgICAgICAgIHBCdWZSZW1haW5pbmcgKz0gMjsKKyAgICAgICAgICAgbkJ1ZlJlbWFpbmluZyAtPSAyOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCBwVGx2ICYmIHBUbHYtPnBlYyApCisgICAgICAgIHsKKyAgICAgICAgICAgIG5wZWMgPSAzVTsKKyAgICAgICAgICAgIGlmICggMyA+IG5CdWZSZW1haW5pbmcgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cyKHBDdHgsIEZSTE9HVywgRlJGTCgiVExWICVkIHJlcG9ydHMgbGVuZ3RoIgorICAgICAgICAgICAgICAgICAgICAiJWQsIGJ1dCBpdCBoYXMgYSBQcml2YXRlIEVudGVycHJpc2UgQ29kZSAoMyBieXRlIgorICAgICAgICAgICAgICAgICAgICAicy5cbiIpLCBpZCwgbGVuKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkxPRzEsIHBCdWYsIG5CdWYpOworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cyKHBDdHgsIEZSTE9HMSwgRlJGTCgiV2UndmUgcGFyc2VkICVkIGJ5dGVzIgorICAgICAgICAgICAgICAgICAgICAib2YgdGhpcyBidWZmZXIsIGFuZCBzaG93ICVkIGxlZnQuXG4iKSwKKyAgICAgICAgICAgICAgICBwQnVmUmVtYWluaW5nIC0gcEJ1ZiwgbkJ1ZlJlbWFpbmluZyk7CisgICAgICAgICAgICAgICAgc3RhdHVzIHw9IERPVDExRl9JTkNPTVBMRVRFX1RMVjsKKyAgICAgICAgICAgICAgICBGUkFNRVNfREJHX0JSRUFLKCk7CisgICAgICAgICAgICAgICAgZ290byBNYW5kYXRvcnlDaGVjazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBCdWZSZW1haW5pbmcgKz0gMzsKKyAgICAgICAgICAgIG5CdWZSZW1haW5pbmcgLT0gMzsKKyAgICAgICAgICAgIGxlbiAgICAgICAgICAgLT0gMzsKKyAgICAgICAgfQorCisgICAgICAgIC8vIFdoZXRoZXIgd2UgZm91bmQgYSBoaXQgb3Igbm90LCB3ZSBjYW4gdmFsaWRhdGUgdGhlIHJlcG9ydGVkCisgICAgICAgIC8vIGxlbmd0aCBvZiB0aGlzIFRMVjoKKyAgICAgICAgaWYgKCBsZW4gPiBuQnVmUmVtYWluaW5nICkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzMocEN0eCwgRlJMT0dXLCBGUkZMKCJUTFYgJWQgcmVwb3J0cyBsZW5ndGggJSIKKyAgICAgICAgICAgICAgICAiZCwgYnV0IHRoZXJlIGFyZSBvbmx5ICVkIGJ5dGVzIHJlbWFpbmluZyBpbiB0aGlzIGYiCisgICAgICAgICAgICAgICAgInJhbWUuXG4iKSwgaWQsIGxlbiwgbkJ1ZlJlbWFpbmluZyApOworICAgICAgICAgICAgRlJBTUVTX0RVTVAoIHBDdHgsIEZSTE9HMSwgcEJ1ZiwgbkJ1ZiApOworICAgICAgICAgICAgRlJBTUVTX0xPRzIoIHBDdHgsIEZSTE9HMSwgRlJGTCggIldlJ3ZlIHBhcnNlZCAlZCBieXRlcyIKKyAgICAgICAgICAgICAgICAiIG9mIHRoaXMgYnVmZmVyLCBhbmQgc2hvdyAlZCBsZWZ0LlxuIiksCisgICAgICAgICAgICAgICAgcEJ1ZlJlbWFpbmluZyAtIHBCdWYsIG5CdWZSZW1haW5pbmcpOworICAgICAgICAgICAgc3RhdHVzIHw9IERPVDExRl9JTkNPTVBMRVRFX1RMVjsKKyAgICAgICAgICAgIEZSQU1FU19EQkdfQlJFQUsoKTsKKyAgICAgICAgICAgIGdvdG8gTWFuZGF0b3J5Q2hlY2s7CisgICAgICAgIH0KKworICAgICAgICAvLyBOb3csICppZiogd2UgZm91bmQgYSBoaXQuLi4KKyAgICAgICAgaWYgKCBwVGx2ICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKCBsZW4gPCBwVGx2LT5taW5TaXplIC0gbnBlYyApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzMoIHBDdHgsIEZSTE9HVywgRlJGTCgiVGhlIElFICVzIG11c3QgYmUgIgorICAgICAgICAgICAgICAgICAgICAiYXQgbGVhc3QgJWQgYnl0ZXMgaW4gc2l6ZSwgYnV0IHRoZSBzaXplIGlzIG9ubHkgIgorICAgICAgICAgICAgICAgICAgICAiJWQgYnl0ZXMuXG4iKSwKKyAgICAgICAgICAgICAgICAgICAgIHBUbHYtPm5hbWUsIHBUbHYtPm1pblNpemUsIGxlbiApOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKCBwQ3R4LCBGUkxPRzEsIHBCdWYsIG5CdWYgKTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgfD0gRE9UMTFGX0lOQ09NUExFVEVfVExWOworICAgICAgICAgICAgICAgIEZSQU1FU19EQkdfQlJFQUsoICk7CisgICAgICAgICAgICAgICAgZ290byBNYW5kYXRvcnlDaGVjazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICggbkJ1ZlJlbWFpbmluZyA8IHBUbHYtPm1pblNpemUgLSBucGVjIC0gKHBUbHYtPnNUeXBlICsgcFRsdi0+c0xlbikgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0czKCBwQ3R4LCBGUkxPR1csIEZSRkwoIlRoZSBJRSAlcyBtdXN0IGJlICIKKyAgICAgICAgICAgICAgICAgICAgImF0IGxlYXN0ICVkIGJ5dGVzIGluIHNpemUsIGJ1dCB0aGVyZSBhcmUgb25seSAiCisgICAgICAgICAgICAgICAgICAgICIlZCBieXRlcyByZW1haW5pbmcgaW4gdGhpcyBmcmFtZS5cbiIpLAorICAgICAgICAgICAgICAgICAgICAgcFRsdi0+bmFtZSwgcFRsdi0+bWluU2l6ZSwgbkJ1ZlJlbWFpbmluZyApOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKCBwQ3R4LCBGUkxPRzEsIHBCdWYsIG5CdWYgKTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgfD0gRE9UMTFGX0lOQ09NUExFVEVfVExWOworICAgICAgICAgICAgICAgIEZSQU1FU19EQkdfQlJFQUsoICk7CisgICAgICAgICAgICAgICAgZ290byBNYW5kYXRvcnlDaGVjazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKCBsZW4gPiBwVGx2LT5tYXhTaXplIC0gbnBlYyAtIChwVGx2LT5zVHlwZSArIHBUbHYtPnNMZW4pICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMSggcEN0eCwgRlJMT0dXLCBGUkZMKCJUaGUgVExWICVzIHJlcG9ydHMgIgorICAgICAgICAgICAgICAgICAgICAiYW4gaWxsZWdhbGx5IGxhcmdlIHNpemU7IHRoaXMgVExWIGlzIHByZXN1bWFibHkiCisgICAgICAgICAgICAgICAgICAgICJjb3JydXB0IG9yIG90aGVyd2lzZSBpbnZhbGlkICYgd2lsbCBiZSBza2lwcGVkICIKKyAgICAgICAgICAgICAgICAgICAgImlwcGVkLlxuIiksIHBUbHYtPm5hbWUgKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUCggcEN0eCwgRlJMT0cxLCBwQnVmLCBuQnVmICk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzIoIHBDdHgsIEZSTE9HMSwgRlJGTCgiV2UndmUgcGFyc2VkICVkIGJ5IgorICAgICAgICAgICAgICAgICAgICAidGVzIG9mIHRoaXMgYnVmZmVyLCBhbmQgc2hvdyAlZCBsZWZ0LlxuIiksCisgICAgICAgICAgICAgICAgICAgIHBCdWZSZW1haW5pbmcgLSBwQnVmLCBuQnVmUmVtYWluaW5nKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfREJHX0JSRUFLKCk7CisgICAgICAgICAgICAgICAgc3RhdHVzIHw9IERPVDExRl9TS0lQUEVEX0JBRF9UTFY7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3dpdGNoIChwVGx2LT5zaWcpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2QXV0aG9yaXplZE1BQ3M6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrVGx2QXV0aG9yaXplZE1BQ3MocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZUTFZBdXRob3JpemVkTUFDcyogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlJlcXVlc3RUb0Vucm9sbDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tUbHZDb21tb25GdW5jKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKHRBTklfVTgqKSYoKCggdERvdDExZlRMVlJlcXVlc3RUb0Vucm9sbCogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpLT5wcmVzZW50KSwgKHRBTklfVTgqKSYoKCggdERvdDExZlRMVlJlcXVlc3RUb0Vucm9sbCopKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSktPnJlcSkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlZlcnNpb24yOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja1RsdlZlcnNpb24yKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmVExWVmVyc2lvbjIqICkocEZybSArIHBUbHYtPm9mZnNldCApKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZBUFNldHVwTG9ja2VkOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja1RsdkNvbW1vbkZ1bmMocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAodEFOSV9VOCopJigoKCB0RG90MTFmVExWQVBTZXR1cExvY2tlZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpLT5wcmVzZW50KSwgKHRBTklfVTgqKSYoKCggdERvdDExZlRMVkFQU2V0dXBMb2NrZWQqKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpLT5mTG9ja2VkKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2QXNzb2NpYXRpb25TdGF0ZToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tUbHZDb21tb25GdW5jMihwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICh0QU5JX1U4KikmKCgoIHREb3QxMWZUTFZBc3NvY2lhdGlvblN0YXRlKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSktPnByZXNlbnQpLCAodEFOSV9VMTYqKSYoKCggdERvdDExZlRMVkFzc29jaWF0aW9uU3RhdGUqKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpLT5zdGF0ZSkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdkNoYW5uZWxMaXN0OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja1RsdkNoYW5uZWxMaXN0KHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmVExWQ2hhbm5lbExpc3QqICkocEZybSArIHBUbHYtPm9mZnNldCApKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZDb25maWdNZXRob2RzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja1RsdkNvbW1vbkZ1bmMyKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKHRBTklfVTgqKSYoKCggdERvdDExZlRMVkNvbmZpZ01ldGhvZHMqICkocEZybSArIHBUbHYtPm9mZnNldCApKS0+cHJlc2VudCksICh0QU5JX1UxNiopJigoKCB0RG90MTFmVExWQ29uZmlnTWV0aG9kcyopKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSktPm1ldGhvZHMpKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZDb25maWd1cmF0aW9uRXJyb3I6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrVGx2Q29tbW9uRnVuYzIocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAodEFOSV9VOCopJigoKCB0RG90MTFmVExWQ29uZmlndXJhdGlvbkVycm9yKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSktPnByZXNlbnQpLCAodEFOSV9VMTYqKSYoKCggdERvdDExZlRMVkNvbmZpZ3VyYXRpb25FcnJvciopKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSktPmVycm9yKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2Q29uZmlndXJhdGlvblRpbWVvdXQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrVGx2Q29uZmlndXJhdGlvblRpbWVvdXQocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZUTFZDb25maWd1cmF0aW9uVGltZW91dCogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdkRldmljZU5hbWU6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrVGx2RGV2aWNlTmFtZShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZlRMVkRldmljZU5hbWUqICkocEZybSArIHBUbHYtPm9mZnNldCApKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZEZXZpY2VQYXNzd29yZElEOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja1RsdkNvbW1vbkZ1bmMyKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKHRBTklfVTgqKSYoKCggdERvdDExZlRMVkRldmljZVBhc3N3b3JkSUQqICkocEZybSArIHBUbHYtPm9mZnNldCApKS0+cHJlc2VudCksICh0QU5JX1UxNiopJigoKCB0RG90MTFmVExWRGV2aWNlUGFzc3dvcmRJRCopKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSktPmlkKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2RXh0ZW5kZWRMaXN0ZW5UaW1pbmc6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrVGx2RXh0ZW5kZWRMaXN0ZW5UaW1pbmcocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZUTFZFeHRlbmRlZExpc3RlblRpbWluZyogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdkdPSW50ZW50OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja1RsdkNvbW1vbkZ1bmMocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAodEFOSV9VOCopJigoKCB0RG90MTFmVExWR09JbnRlbnQqICkocEZybSArIHBUbHYtPm9mZnNldCApKS0+cHJlc2VudCksICh0QU5JX1U4KikmKCgoIHREb3QxMWZUTFZHT0ludGVudCopKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSktPkdPSW50ZW50KSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2SW50ZW5kZWRQMlBJbnRlcmZhY2VBZGRyZXNzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja1RsdkludGVuZGVkUDJQSW50ZXJmYWNlQWRkcmVzcyhwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZlRMVkludGVuZGVkUDJQSW50ZXJmYWNlQWRkcmVzcyogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1Rsdkludml0YXRpb25GbGFnczoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tUbHZDb21tb25GdW5jKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKHRBTklfVTgqKSYoKCggdERvdDExZlRMVkludml0YXRpb25GbGFncyogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpLT5wcmVzZW50KSwgKHRBTklfVTgqKSYoKCggdERvdDExZlRMVkludml0YXRpb25GbGFncyopKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSktPmludml0YXRpb25GbGFncykpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1Rsdkxpc3RlbkNoYW5uZWw6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrVGx2TGlzdGVuQ2hhbm5lbChwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZlRMVkxpc3RlbkNoYW5uZWwqICkocEZybSArIHBUbHYtPm9mZnNldCApKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZNYW51ZmFjdHVyZXI6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrVGx2TWFudWZhY3R1cmVyKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmVExWTWFudWZhY3R1cmVyKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2TWlub3JSZWFzb25Db2RlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja1RsdkNvbW1vbkZ1bmMocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAodEFOSV9VOCopJigoKCB0RG90MTFmVExWTWlub3JSZWFzb25Db2RlKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSktPnByZXNlbnQpLCAodEFOSV9VOCopJigoKCB0RG90MTFmVExWTWlub3JSZWFzb25Db2RlKikocEZybSArIHBUbHYtPm9mZnNldCApKS0+bWlub3JSZWFzb25Db2RlKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2TW9kZWxOYW1lOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja1Rsdk1vZGVsTmFtZShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZlRMVk1vZGVsTmFtZSogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1Rsdk1vZGVsTnVtYmVyOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja1Rsdk1vZGVsTnVtYmVyKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmVExWTW9kZWxOdW1iZXIqICkocEZybSArIHBUbHYtPm9mZnNldCApKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZOb3RpY2VPZkFic2VuY2U6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrVGx2Tm90aWNlT2ZBYnNlbmNlKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmVExWTm90aWNlT2ZBYnNlbmNlKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2T3BlcmF0aW5nQ2hhbm5lbDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tUbHZPcGVyYXRpbmdDaGFubmVsKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmVExWT3BlcmF0aW5nQ2hhbm5lbCogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlAyUENhcGFiaWxpdHk6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrVGx2UDJQQ2FwYWJpbGl0eShwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZlRMVlAyUENhcGFiaWxpdHkqICkocEZybSArIHBUbHYtPm9mZnNldCApKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZQMlBEZXZpY2VJZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tUbHZQMlBEZXZpY2VJZChwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZlRMVlAyUERldmljZUlkKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2UDJQRGV2aWNlSW5mbzoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tUbHZQMlBEZXZpY2VJbmZvKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmVExWUDJQRGV2aWNlSW5mbyogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlAyUEdyb3VwQnNzaWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrVGx2UDJQR3JvdXBCc3NpZChwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZlRMVlAyUEdyb3VwQnNzaWQqICkocEZybSArIHBUbHYtPm9mZnNldCApKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZQMlBHcm91cElkOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja1RsdlAyUEdyb3VwSWQocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZUTFZQMlBHcm91cElkKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2UDJQR3JvdXBJbmZvOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja1RsdlAyUEdyb3VwSW5mbyhwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZlRMVlAyUEdyb3VwSW5mbyogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlAyUFN0YXR1czoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tUbHZDb21tb25GdW5jKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKHRBTklfVTgqKSYoKCggdERvdDExZlRMVlAyUFN0YXR1cyogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpLT5wcmVzZW50KSwgKHRBTklfVTgqKSYoKCggdERvdDExZlRMVlAyUFN0YXR1cyopKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSktPnN0YXR1cykpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlByaW1hcnlEZXZpY2VUeXBlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja1RsdlByaW1hcnlEZXZpY2VUeXBlKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmVExWUHJpbWFyeURldmljZVR5cGUqICkocEZybSArIHBUbHYtPm9mZnNldCApKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZSRkJhbmRzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja1RsdkNvbW1vbkZ1bmMocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAodEFOSV9VOCopJigoKCB0RG90MTFmVExWUkZCYW5kcyogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpLT5wcmVzZW50KSwgKHRBTklfVTgqKSYoKCggdERvdDExZlRMVlJGQmFuZHMqKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpLT5iYW5kcykpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlJlcXVlc3REZXZpY2VUeXBlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja1RsdlJlcXVlc3REZXZpY2VUeXBlKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmVExWUmVxdWVzdERldmljZVR5cGUqICkocEZybSArIHBUbHYtPm9mZnNldCApKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZSZXF1ZXN0VHlwZToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tUbHZDb21tb25GdW5jKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKHRBTklfVTgqKSYoKCggdERvdDExZlRMVlJlcXVlc3RUeXBlKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSktPnByZXNlbnQpLCAodEFOSV9VOCopJigoKCB0RG90MTFmVExWUmVxdWVzdFR5cGUqKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpLT5yZXFUeXBlKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2UmVzcG9uc2VUeXBlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja1RsdkNvbW1vbkZ1bmMocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAodEFOSV9VOCopJigoKCB0RG90MTFmVExWUmVzcG9uc2VUeXBlKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSktPnByZXNlbnQpLCAodEFOSV9VOCopJigoKCB0RG90MTFmVExWUmVzcG9uc2VUeXBlKikocEZybSArIHBUbHYtPm9mZnNldCApKS0+cmVzVHlwZSkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlNlbGVjdGVkUmVnaXN0cmFyOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja1RsdkNvbW1vbkZ1bmMocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAodEFOSV9VOCopJigoKCB0RG90MTFmVExWU2VsZWN0ZWRSZWdpc3RyYXIqICkocEZybSArIHBUbHYtPm9mZnNldCApKS0+cHJlc2VudCksICh0QU5JX1U4KikmKCgoIHREb3QxMWZUTFZTZWxlY3RlZFJlZ2lzdHJhciopKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSktPnNlbGVjdGVkKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2U2VsZWN0ZWRSZWdpc3RyYXJDb25maWdNZXRob2RzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja1RsdkNvbW1vbkZ1bmMyKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKHRBTklfVTgqKSYoKCggdERvdDExZlRMVlNlbGVjdGVkUmVnaXN0cmFyQ29uZmlnTWV0aG9kcyogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpLT5wcmVzZW50KSwgKHRBTklfVTE2KikmKCgoIHREb3QxMWZUTFZTZWxlY3RlZFJlZ2lzdHJhckNvbmZpZ01ldGhvZHMqKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpLT5tZXRob2RzKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2U2VyaWFsTnVtYmVyOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja1RsdlNlcmlhbE51bWJlcihwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZlRMVlNlcmlhbE51bWJlciogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlVVSURfRToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tUbHZVVUlEX0UocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZUTFZVVUlEX0UqICkocEZybSArIHBUbHYtPm9mZnNldCApKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZVVUlEX1I6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrVGx2VVVJRF9SKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKCB0RG90MTFmVExWVVVJRF9SKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2VmVuZG9yRXh0ZW5zaW9uOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja1RsdlZlbmRvckV4dGVuc2lvbihwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZlRMVlZlbmRvckV4dGVuc2lvbiogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlZlcnNpb246CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmVW5wYWNrVGx2VmVyc2lvbihwQ3R4LCBwQnVmUmVtYWluaW5nLCBsZW4sICggdERvdDExZlRMVlZlcnNpb24qICkocEZybSArIHBUbHYtPm9mZnNldCApKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZXUFNTdGF0ZToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tUbHZDb21tb25GdW5jKHBDdHgsIHBCdWZSZW1haW5pbmcsIGxlbiwgKHRBTklfVTgqKSYoKCggdERvdDExZlRMVldQU1N0YXRlKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQgKSktPnByZXNlbnQpLCAodEFOSV9VOCopJigoKCB0RG90MTFmVExWV1BTU3RhdGUqKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpLT5zdGF0ZSkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlAyUEludGVyZmFjZToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZVbnBhY2tUbHZQMlBJbnRlcmZhY2UocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAoIHREb3QxMWZUTFZQMlBJbnRlcmZhY2UqICkocEZybSArIHBUbHYtPm9mZnNldCApKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZQMlBNYW5hZ2VhYmlsaXR5OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlVucGFja1RsdkNvbW1vbkZ1bmMocEN0eCwgcEJ1ZlJlbWFpbmluZywgbGVuLCAodEFOSV9VOCopJigoKCB0RG90MTFmVExWUDJQTWFuYWdlYWJpbGl0eSogKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpLT5wcmVzZW50KSwgKHRBTklfVTgqKSYoKCggdERvdDExZlRMVlAyUE1hbmFnZWFiaWxpdHkqKShwRnJtICsgcFRsdi0+b2Zmc2V0ICkpLT5tYW5hZ2VhYmlsaXR5KSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSTE9HRSwgRlJGTCgiSU5URVJOQUwgRVJST1I6IEkiCisgICAgICAgICAgICAgICAgICAgICAgICAiIGRvbid0IGtub3cgYWJvdXQgdGhlIFRMViBzaWduYXR1cmUgJWQtLSB0aGkiCisgICAgICAgICAgICAgICAgICAgICAgICAicyBpcyBtb3N0IGxpa2VseSBhICdmcmFtZXNjJyBidWcuXG4iKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUbHYtPnNpZyk7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EQkdfQlJFQUsoKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIERPVDExRl9JTlRFUk5BTF9FUlJPUjsKKyAgICAgICAgICAgICAgICB9IC8vIEVuZCBzd2l0Y2ggb24gc2lnLgorICAgICAgICAgICAgfSAvLyBFbmQgaWYgb24gbGVuZ3RoIGNoZWNrLgorCisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMihwQ3R4LCBGUkxPRzMsIEZSRkwoIlNraXBwaW5nIHVua25vd24gVExWICVkICgiCisgICAgICAgICAgICAgICAgImxlbmd0aCAlZClcbiIpLCBpZCwgbGVuKTsKKyAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSTE9HMywgcEJ1ZlJlbWFpbmluZyAtIChwVGx2LT5zVHlwZSArIHBUbHYtPnNMZW4pLCBsZW4pOworICAgICAgICAgICAgc3RhdHVzIHw9IERPVDExRl9VTktOT1dOX1RMVlM7CisgICAgICAgIH0KKworICAgICAgICAvLyBBZHZhbmNlIHRvIHRoZSBuZXh0IFRMVgorICAgICAgICBwQnVmUmVtYWluaW5nICs9IGxlbjsKKworICAgICAgICBpZiAobGVuID4gbkJ1ZlJlbWFpbmluZykKKyAgICAgICAgIHsKKyAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkxPR1csIEZSRkwoIlRoaXMgVExWIGV4dGVuZHMgcGFzdCB0aCIKKyAgICAgICAgICAgICAgICAgImUgYnVmZmVyIGFzIGl0IHdhcyBkZWZpbmVkIHRvIHVzLiAgVGhpcyBjb3VsZCBtZWFuICIKKyAgICAgICAgICAgICAgICAgImEgY29ycnVwdCBmcmFtZSwgb3IganVzdCBhbiBpbmNvcnJlY3QgbGVuZ3RoIHBhcmFtZSIKKyAgICAgICAgICAgICAgICAgInRlci5cbiIpKTsKKyAgICAgICAgICAgICBGUkFNRVNfREJHX0JSRUFLKCk7CisgICAgICAgICAgICAgc3RhdHVzIHw9IERPVDExRl9MQVNUX1RMVl9UT09fTE9ORzsKKyAgICAgICAgICAgICBnb3RvIE1hbmRhdG9yeUNoZWNrOworICAgICAgICAgfQorCisgICAgICAgIG5CdWZSZW1haW5pbmcgLT0gbGVuOworCisgICAgfSAvLyBFbmQgaXRlcmF0aW9uIG92ZXIgVExWcy4KKworTWFuZGF0b3J5Q2hlY2s6CisgICAgcFRsdiA9ICZUTFZzWzBdOworICAgIHdoaWxlICgweGZmZmYgIT0gcFRsdi0+aWQpCisgICAgeworICAgICAgICBpZiAocFRsdi0+Zk1hbmRhdG9yeSkKKyAgICAgICAgeworICAgICAgICAgICAgcGZGb3VuZCA9ICh0QU5JX1U4KikocEZybSArIHBUbHYtPm9mZnNldCArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUbHYtPnByZXNlbmNlT2Zmc2V0KTsKKyAgICAgICAgICAgIGlmICghKnBmRm91bmQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJMT0dXLCBGUkZMKCJFUlJPUjogVGhlIG1hbmRhdG9yeSAiCisgICAgICAgICAgICAgICAgICAgICJUTFYgJXMgd2Fzbid0IHNlZW4uXG4iKSwKKyAgICAgICAgICAgICAgICAgICAgcFRsdi0+bmFtZSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RCR19CUkVBSygpOworICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBET1QxMUZfTUFOREFUT1JZX1RMVl9NSVNTSU5HOworICAgICAgICAgICAgfQorCisgICAgICAgIH0KKyAgICAgICAgKytwVGx2OworICAgIH0KKworICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBVbnBhY1RsdmtDb3JlLiAqLwordEFOSV9VMzIgZG90MTFmR2V0UGFja2VkSUVUQ0xBUyh0cEFuaVNpckdsb2JhbCBwQ3R4LCB0RG90MTFmSUVUQ0xBUyAqcEllLCB0QU5JX1UzMiAqcG5OZWVkZWQpCit7CisgICAgdEFOSV9VMzIgc3RhdHVzID0gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7CisgICAgKHZvaWQpcEN0eDsKKyAgICB3aGlsZSAoIHBJZS0+cHJlc2VudCApCisgICAgeworICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICBzd2l0Y2ggKHBJZS0+Y2xhc3NpZmllcl90eXBlKQorICAgICAgICB7CisgICAgICAgICAgICBjYXNlIDA6CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDY7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDY7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDI7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKHBJZS0+aW5mby5JcFBhcmFtcy52ZXJzaW9uKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSA0OgorICAgICAgICAgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDQ7CisgICAgICAgICAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gNDsKKyAgICAgICAgICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICAgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDI7CisgICAgICAgICAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIDY6CisgICAgICAgICAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTY7CisgICAgICAgICAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTY7CisgICAgICAgICAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICAgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDM7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZHZXRQYWNrZWRJRVRDTEFTLiAqLworCit0QU5JX1UzMiBkb3QxMWZHZXRQYWNrZWRJRVdNTVRDTEFTKHRwQW5pU2lyR2xvYmFsIHBDdHgsIHREb3QxMWZJRVdNTVRDTEFTICpwSWUsIHRBTklfVTMyICpwbk5lZWRlZCkKK3sKKyAgICB0QU5JX1UzMiBzdGF0dXMgPSBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKKyAgICAodm9pZClwQ3R4OworICAgIHdoaWxlICggcEllLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICBzd2l0Y2ggKHBJZS0+Y2xhc3NpZmllcl90eXBlKQorICAgICAgICB7CisgICAgICAgICAgICBjYXNlIDA6CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDY7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDY7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDI7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKHBJZS0+aW5mby5JcFBhcmFtcy52ZXJzaW9uKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSA0OgorICAgICAgICAgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDQ7CisgICAgICAgICAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gNDsKKyAgICAgICAgICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICAgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDI7CisgICAgICAgICAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIDY6CisgICAgICAgICAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTY7CisgICAgICAgICAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTY7CisgICAgICAgICAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICAgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDM7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZHZXRQYWNrZWRJRVdNTVRDTEFTLiAqLworCit0QU5JX1UzMiBkb3QxMWZHZXRQYWNrZWRJRUFpcmdvKHRwQW5pU2lyR2xvYmFsIHBDdHgsIHREb3QxMWZJRUFpcmdvICpwSWUsIHRBTklfVTMyICpwbk5lZWRlZCkKK3sKKyAgICB0QU5JX1UzMiBzdGF0dXMgPSBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKKyAgICAodm9pZClwQ3R4OworICAgIHdoaWxlICggcEllLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHN0YXR1cyA9IEdldFBhY2tlZFNpemVDb3JlKHBDdHgsICggdEFOSV9VOCogKXBJZSwgcG5OZWVkZWQsIElFU19BaXJnbyk7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmR2V0UGFja2VkSUVBaXJnby4gKi8KKwordEFOSV9VMzIgZG90MTFmR2V0UGFja2VkSUVDb3VudHJ5KHRwQW5pU2lyR2xvYmFsIHBDdHgsIHREb3QxMWZJRUNvdW50cnkgKnBJZSwgdEFOSV9VMzIgKnBuTmVlZGVkKQoreworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgICh2b2lkKXBDdHg7CisgICAgd2hpbGUgKCBwSWUtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgKnBuTmVlZGVkICs9IDM7CisgICAgICAgIGlmICggcEllLT5udW1fdHJpcGxldHMgKQorICAgICAgICB7CisgICAgICAgICAgICAqcG5OZWVkZWQgKz0gKCBwSWUtPm51bV90cmlwbGV0cyAqIDMgKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGJyZWFrOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZkdldFBhY2tlZElFQ291bnRyeS4gKi8KKwordEFOSV9VMzIgZG90MTFmR2V0UGFja2VkSUVGVEluZm8odHBBbmlTaXJHbG9iYWwgcEN0eCwgdERvdDExZklFRlRJbmZvICpwSWUsIHRBTklfVTMyICpwbk5lZWRlZCkKK3sKKyAgICB0QU5JX1UzMiBzdGF0dXMgPSBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKKyAgICAodm9pZClwQ3R4OworICAgIHdoaWxlICggcEllLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICAqcG5OZWVkZWQgKz0gMTY7CisgICAgICAgICpwbk5lZWRlZCArPSAzMjsKKyAgICAgICAgKnBuTmVlZGVkICs9IDMyOworICAgICAgICBzdGF0dXMgPSBHZXRQYWNrZWRTaXplQ29yZShwQ3R4LCAoIHRBTklfVTgqIClwSWUsIHBuTmVlZGVkLCBJRVNfRlRJbmZvKTsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZHZXRQYWNrZWRJRUZUSW5mby4gKi8KKwordEFOSV9VMzIgZG90MTFmR2V0UGFja2VkSUVNZWFzdXJlbWVudFJlcG9ydCh0cEFuaVNpckdsb2JhbCBwQ3R4LCB0RG90MTFmSUVNZWFzdXJlbWVudFJlcG9ydCAqcEllLCB0QU5JX1UzMiAqcG5OZWVkZWQpCit7CisgICAgdEFOSV9VMzIgc3RhdHVzID0gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7CisgICAgKHZvaWQpcEN0eDsKKyAgICB3aGlsZSAoIHBJZS0+cHJlc2VudCApCisgICAgeworICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICBpZiAoIHBJZS0+dHlwZSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHN3aXRjaCAocEllLT50eXBlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNhc2UgMDoKKyAgICAgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSA4OworICAgICAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMjsKKyAgICAgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDg7CisgICAgICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIDI6CisgICAgICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gODsKKyAgICAgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDI7CisgICAgICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIDU6CisgICAgICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDg7CisgICAgICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gNjsKKyAgICAgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSA0OworICAgICAgICAgICAgICAgIHN0YXR1cyA9IEdldFBhY2tlZFNpemVDb3JlKHBDdHgsICggdEFOSV9VOCogKXBJZSwgcG5OZWVkZWQsIElFU19yZXBvcnRCZWFjb24pOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UgYnJlYWs7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmR2V0UGFja2VkSUVNZWFzdXJlbWVudFJlcG9ydC4gKi8KKwordEFOSV9VMzIgZG90MTFmR2V0UGFja2VkSUVNZWFzdXJlbWVudFJlcXVlc3QodHBBbmlTaXJHbG9iYWwgcEN0eCwgdERvdDExZklFTWVhc3VyZW1lbnRSZXF1ZXN0ICpwSWUsIHRBTklfVTMyICpwbk5lZWRlZCkKK3sKKyAgICB0QU5JX1UzMiBzdGF0dXMgPSBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKKyAgICAodm9pZClwQ3R4OworICAgIHdoaWxlICggcEllLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgIHN3aXRjaCAocEllLT5tZWFzdXJlbWVudF90eXBlKQorICAgICAgICB7CisgICAgICAgICAgICBjYXNlIDA6CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDg7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDI7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gODsKKyAgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSA4OworICAgICAgICAgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDU6CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDI7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDI7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IDY7CisgICAgICAgICAgICBzdGF0dXMgPSBHZXRQYWNrZWRTaXplQ29yZShwQ3R4LCAoIHRBTklfVTgqIClwSWUsIHBuTmVlZGVkLCBJRVNfbWVhc3VyZW1lbnRfcmVxdWVzdEJlYWNvbik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZkdldFBhY2tlZElFTWVhc3VyZW1lbnRSZXF1ZXN0LiAqLworCit0QU5JX1UzMiBkb3QxMWZHZXRQYWNrZWRJRU5laWdoYm9yUmVwb3J0KHRwQW5pU2lyR2xvYmFsIHBDdHgsIHREb3QxMWZJRU5laWdoYm9yUmVwb3J0ICpwSWUsIHRBTklfVTMyICpwbk5lZWRlZCkKK3sKKyAgICB0QU5JX1UzMiBzdGF0dXMgPSBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKKyAgICAodm9pZClwQ3R4OworICAgIHdoaWxlICggcEllLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgICpwbk5lZWRlZCArPSA2OworICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICAqcG5OZWVkZWQgKz0gMTsKKyAgICAgICAgKnBuTmVlZGVkICs9IDE7CisgICAgICAgICpwbk5lZWRlZCArPSAxOworICAgICAgICBzdGF0dXMgPSBHZXRQYWNrZWRTaXplQ29yZShwQ3R4LCAoIHRBTklfVTgqIClwSWUsIHBuTmVlZGVkLCBJRVNfTmVpZ2hib3JSZXBvcnQpOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZkdldFBhY2tlZElFTmVpZ2hib3JSZXBvcnQuICovCisKK3RBTklfVTMyIGRvdDExZkdldFBhY2tlZElFUDJQQXNzb2NSZXEodHBBbmlTaXJHbG9iYWwgcEN0eCwgdERvdDExZklFUDJQQXNzb2NSZXEgKnBJZSwgdEFOSV9VMzIgKnBuTmVlZGVkKQoreworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgICh2b2lkKXBDdHg7CisgICAgd2hpbGUgKCBwSWUtPnByZXNlbnQgKQorICAgIHsKKyAgICBzdGF0dXMgPSBHZXRQYWNrZWRTaXplVGx2Q29yZShwQ3R4LCh0QU5JX1U4KilwSWUscG5OZWVkZWQsVExWU19QMlBBc3NvY1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AgICAqcG5OZWVkZWQgKz0gKCBwSWUtPnB3aXNlX2NpcGhlcl9zdWl0ZV9jb3VudCAqIDQgKTsKKyAgICAgICAgaWYgKCBwSWUtPmFrbV9zdWl0ZV9jb3VudCApCisgICAgICAgIHsKKyAgICAgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICB9CisgICAgICAgIGVsc2UgYnJlYWs7CisgICAgICAgICpwbk5lZWRlZCArPSAoIHBJZS0+YWttX3N1aXRlX2NvdW50ICogNCApOworICAgICAgICBpZiAoIHBJZS0+UlNOX0NhcCApCisgICAgICAgIHsKKyAgICAgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICB9CisgICAgICAgIGVsc2UgYnJlYWs7CisgICAgICAgIGlmICggcEllLT5wbWtpZF9jb3VudCApCisgICAgICAgIHsKKyAgICAgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICB9CisgICAgICAgIGVsc2UgYnJlYWs7CisgICAgICAgICpwbk5lZWRlZCArPSAoIHBJZS0+cG1raWRfY291bnQgKiAxNiApOworICAgICAgICBpZiAoIHBJZS0+Z3BfbWdtdF9jaXBoZXJfc3VpdGUgKQorICAgICAgICB7CisgICAgICAgICAgICAqcG5OZWVkZWQgKz0gNDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGJyZWFrOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZkdldFBhY2tlZElFUlNOLiAqLworCit0QU5JX1UzMiBkb3QxMWZHZXRQYWNrZWRJRVdBUEkodHBBbmlTaXJHbG9iYWwgcEN0eCwgdERvdDExZklFV0FQSSAqcEllLCB0QU5JX1UzMiAqcG5OZWVkZWQpCit7CisgICAgdEFOSV9VMzIgc3RhdHVzID0gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7CisgICAgKHZvaWQpcEN0eDsKKyAgICB3aGlsZSAoIHBJZS0+cHJlc2VudCApCisgICAgeworICAgICAgICAqcG5OZWVkZWQgKz0gMjsKKyAgICAgICAgKnBuTmVlZGVkICs9IDI7CisgICAgICAgICpwbk5lZWRlZCArPSAoIHBJZS0+YWttX3N1aXRlX2NvdW50ICogNCApOworICAgICAgICAqcG5OZWVkZWQgKz0gMjsKKyAgICAgICAgKnBuTmVlZGVkICs9ICggcEllLT51bmljYXN0X2NpcGhlcl9zdWl0ZV9jb3VudCAqIDQgKTsKKyAgICAgICAgKnBuTmVlZGVkICs9IDQ7CisgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICBpZiAoIHBJZS0+YmtpZF9jb3VudCApCisgICAgICAgIHsKKyAgICAgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICB9CisgICAgICAgIGVsc2UgYnJlYWs7CisgICAgICAgICpwbk5lZWRlZCArPSAoIHBJZS0+YmtpZF9jb3VudCAqIDE2ICk7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmR2V0UGFja2VkSUVXQVBJLiAqLworCit0QU5JX1UzMiBkb3QxMWZHZXRQYWNrZWRJRVdQQSh0cEFuaVNpckdsb2JhbCBwQ3R4LCB0RG90MTFmSUVXUEEgKnBJZSwgdEFOSV9VMzIgKnBuTmVlZGVkKQoreworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgICh2b2lkKXBDdHg7CisgICAgd2hpbGUgKCBwSWUtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgKnBuTmVlZGVkICs9IDI7CisgICAgICAgIGlmICggcEllLT5tdWx0aWNhc3RfY2lwaGVyX3ByZXNlbnQgKQorICAgICAgICB7CisgICAgICAgICAgICAqcG5OZWVkZWQgKz0gNDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGJyZWFrOworICAgICAgICBpZiAoIHBJZS0+dW5pY2FzdF9jaXBoZXJfY291bnQgKQorICAgICAgICB7CisgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMjsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGJyZWFrOworICAgICAgICAqcG5OZWVkZWQgKz0gKCBwSWUtPnVuaWNhc3RfY2lwaGVyX2NvdW50ICogNCApOworICAgICAgICBpZiAoIHBJZS0+YXV0aF9zdWl0ZV9jb3VudCApCisgICAgICAgIHsKKyAgICAgICAgICAgICpwbk5lZWRlZCArPSAyOworICAgICAgICB9CisgICAgICAgIGVsc2UgYnJlYWs7CisgICAgICAgICpwbk5lZWRlZCArPSAoIHBJZS0+YXV0aF9zdWl0ZV9jb3VudCAqIDQgKTsKKyAgICAgICAgaWYgKCBwSWUtPmNhcHMgKQorICAgICAgICB7CisgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMjsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGJyZWFrOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZkdldFBhY2tlZElFV1BBLiAqLworCit0QU5JX1UzMiBkb3QxMWZHZXRQYWNrZWRJRVdTQyh0cEFuaVNpckdsb2JhbCBwQ3R4LCB0RG90MTFmSUVXU0MgKnBJZSwgdEFOSV9VMzIgKnBuTmVlZGVkKQoreworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgICh2b2lkKXBDdHg7CisgICAgd2hpbGUgKCBwSWUtPnByZXNlbnQgKQorICAgIHsKKyAgICBzdGF0dXMgPSBHZXRQYWNrZWRTaXplVGx2Q29yZShwQ3R4LCh0QU5JX1U4KilwSWUscG5OZWVkZWQsVExWU19XU0MpOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZkdldFBhY2tlZElFV1NDLiAqLworCit0QU5JX1UzMiBkb3QxMWZHZXRQYWNrZWRJRVdzY0Fzc29jUmVxKHRwQW5pU2lyR2xvYmFsIHBDdHgsIHREb3QxMWZJRVdzY0Fzc29j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NSZXF1ZXN0U2l6ZS4gKi8KKwordEFOSV9VMzIgZG90MTFmR2V0UGFja2VkV01NQWRkVFNSZXNwb25zZVNpemUodHBBbmlTaXJHbG9iYWwgcEN0eCwgdERvdDExZldNTUFkZFRTUmVzcG9uc2UgKnBGcm0sIHRBTklfVTMyICpwbk5lZWRlZCkKK3sKKyAgICB0QU5JX1UzMiBzdGF0dXMgPSAwOworICAgICpwbk5lZWRlZCA9IDQ7CisgICAgc3RhdHVzID0gR2V0UGFja2VkU2l6ZUNvcmUocEN0eCwgKCB0QU5JX1U4KiApcEZybSwgcG5OZWVkZWQsIElFU19XTU1BZGRUU1Jlc3BvbnNlKTsKKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmR2V0UGFja2VkV01NQWRkVFNSZXNwb25zZVNpemUuICovCisKK3RBTklfVTMyIGRvdDExZkdldFBhY2tlZFdNTURlbFRTU2l6ZSh0cEFuaVNpckdsb2JhbCBwQ3R4LCB0RG90MTFmV01NRGVsVFMgKnBGcm0sIHRBTklfVTMyICpwbk5lZWRlZCkKK3sKKyAgICB0QU5JX1UzMiBzdGF0dXMgPSAwOworICAgICpwbk5lZWRlZCA9IDQ7CisgICAgc3RhdHVzID0gR2V0UGFja2VkU2l6ZUNvcmUocEN0eCwgKCB0QU5JX1U4KiApcEZybSwgcG5OZWVkZWQsIElFU19XTU1EZWxUUyk7CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZkdldFBhY2tlZFdNTURlbFRTU2l6ZS4gKi8KKworc3RhdGljIHRBTklfVTMyIEdldFBhY2tlZFNpemVDb3JlKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBGcm0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbk5lZWRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdElFRGVmbiAgSUVzW10pCit7CisgICAgY29uc3QgdElFRGVmbiAqcEllOworICAgIHRBTklfVTE2ICBpLCBuOworICAgIHRBTklfVTMyICBzdGF0dXM7CisgICAgdEZSQU1FU19CT09MICpwZkZvdW5kOworICAgIHRBTklfVTMyIGNvdW50T2Zmc2V0ID0gMDsKKyAgICB0QU5JX1UzMiBieXRlQ291bnQgPSAwOworICAgIHRBTklfVTggIHBJZVByZXNlbnQgPSAwOworICAgIHRBTklfVTMyIG9mZnNldCA9IDA7CisKKyAgICBzdGF0dXMgPSBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKKworICAgICh2b2lkKXBDdHg7IC8qIFNodXR1cCB0aGUgY29tcGlsZXIgaWYgd2UgaGF2ZSBubyBGRnMgbm9yIElFcy4uLiAqLworICAgIGk9MDsgbj0wOworICAgIHBJZSA9ICYoIElFc1swXSApOworICAgIHdoaWxlICggMHhmZiAhPSBwSWUtPmVpZCApCisgICAgeworICAgICAgICBwZkZvdW5kID0gKHRGUkFNRVNfQk9PTCopKHBGcm0gKyBwSWUtPm9mZnNldCArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllLT5wcmVzZW5jZU9mZnNldCk7CisgICAgICAgIGlmICggKnBmRm91bmQgKQorICAgICAgICB7CisgICAgICAgICAgICBjb3VudE9mZnNldCA9ICgoMCA9PSBwSWUtPmFycmF5Ym91bmQpID8gMSA6ICgqKCB0QU5JX1UxNiogKShwRnJtICsgcEllLT5jb3VudE9mZnNldCkpICk7CisgICAgICAgICAgICBmb3IgKGkgPSAwVTsgaSA8IGNvdW50T2Zmc2V0OyArK2kpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gMlUgKyBwSWUtPm5vdWk7CisgICAgICAgICAgICAgICBieXRlQ291bnQgPSAwOworICAgICAgICAgICAgICAgc3dpdGNoIChwSWUtPnNpZykKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llQVBOYW1lOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVBUE5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9ICgodERvdDExZklFQVBOYW1lKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVBUE5hbWUpICogaSApKS0+bnVtX25hbWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRUFQTmFtZSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llQlBJbmRpY2F0b3I6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRUJQSW5kaWNhdG9yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVCUEluZGljYXRvciogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llQ29uZGVuc2VkQ291bnRyeVN0cjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFQ29uZGVuc2VkQ291bnRyeVN0cik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFQ29uZGVuc2VkQ291bnRyeVN0ciogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llR1RLOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVHVEspOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9ICgodERvdDExZklFR1RLKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVHVEspICogaSApKS0+bnVtX2tleSArIDExOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVHVEsqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUhDRjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFSENGKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVIQ0YqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUlHVEs6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRUlHVEspOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDMzOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVJR1RLKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVMTEF0dHI6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRUxMQXR0cik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gNDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFTExBdHRyKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVMb2FkQmFsYW5jZToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFTG9hZEJhbGFuY2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRUxvYWRCYWxhbmNlKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVMb2FkSW5mbzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFTG9hZEluZm8pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRUxvYWRJbmZvKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVQcm9wQXNzb2NUeXBlOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVQcm9wQXNzb2NUeXBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVQcm9wQXNzb2NUeXBlKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVQcm9wQ2FwYWJpbGl0eToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFUHJvcENhcGFiaWxpdHkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVByb3BDYXBhYmlsaXR5KiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVQcm9wQ2hhbm5Td2l0Y2hBbm46CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVByb3BDaGFublN3aXRjaEFubik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gNDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFUHJvcENoYW5uU3dpdGNoQW5uKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVQcm9wRURDQVBhcmFtczoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFUHJvcEVEQ0FQYXJhbXMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDE4OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVQcm9wRURDQVBhcmFtcyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUHJvcFF1aWV0QlNTOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVQcm9wUXVpZXRCU1MpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDY7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVByb3BRdWlldEJTUyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUHJvcFN1cHBSYXRlczoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFUHJvcFN1cHBSYXRlcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gKCh0RG90MTFmSUVQcm9wU3VwcFJhdGVzKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVQcm9wU3VwcFJhdGVzKSAqIGkgKSktPm51bV9yYXRlczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFUHJvcFN1cHBSYXRlcyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUjBLSF9JRDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFUjBLSF9JRCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gKCh0RG90MTFmSUVSMEtIX0lEKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVSMEtIX0lEKSAqIGkgKSktPm51bV9QTUtfUjBfSUQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVIwS0hfSUQqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVIxS0hfSUQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVIxS0hfSUQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDY7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVIxS0hfSUQqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVRTRkluZm86CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVRTRkluZm8pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVRTRkluZm8qICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVRhdXJ1czoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFVGF1cnVzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSA2OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVUYXVydXMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVRpdGFuOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVUaXRhbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gNDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFVGl0YW4qICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVRyaWdnZXJTdGFCZ1NjYW46CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVRyaWdnZXJTdGFCZ1NjYW4pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVRyaWdnZXJTdGFCZ1NjYW4qICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVZlcnNpb246CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVZlcnNpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9ICgodERvdDExZklFVmVyc2lvbiogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFVmVyc2lvbikgKiBpICkpLT5udW1fYnVpbGRfdmVyc2lvbiArIDU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVZlcnNpb24qICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdEUzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFV0RTKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAoKHREb3QxMWZJRVdEUyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFV0RTKSAqIGkgKSktPm51bV93ZHNEYXRhOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVXRFMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUFQQ2hhbm5lbFJlcG9ydDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFQVBDaGFubmVsUmVwb3J0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAoKHREb3QxMWZJRUFQQ2hhbm5lbFJlcG9ydCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFQVBDaGFubmVsUmVwb3J0KSAqIGkgKSktPm51bV9jaGFubmVsTGlzdCArIDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRUFQQ2hhbm5lbFJlcG9ydCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llQmNuUmVwb3J0aW5nRGV0YWlsOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVCY25SZXBvcnRpbmdEZXRhaWwpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRUJjblJlcG9ydGluZ0RldGFpbCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llQmVhY29uUmVwb3J0RnJtQm9keToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFQmVhY29uUmVwb3J0RnJtQm9keSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gKCh0RG90MTFmSUVCZWFjb25SZXBvcnRGcm1Cb2R5KiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVCZWFjb25SZXBvcnRGcm1Cb2R5KSAqIGkgKSktPm51bV9yZXBvcnRlZEZpZWxkczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFQmVhY29uUmVwb3J0RnJtQm9keSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llQmVhY29uUmVwb3J0aW5nOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVCZWFjb25SZXBvcnRpbmcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRUJlYWNvblJlcG9ydGluZyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llTWVhc3VyZW1lbnRQaWxvdDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFTWVhc3VyZW1lbnRQaWxvdCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gKCh0RG90MTFmSUVNZWFzdXJlbWVudFBpbG90KiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVNZWFzdXJlbWVudFBpbG90KSAqIGkgKSktPm51bV92ZW5kb3JTcGVjaWZpYyArIDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRU1lYXN1cmVtZW50UGlsb3QqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZU11bHRpQnNzaWQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRU11bHRpQnNzaWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9ICgodERvdDExZklFTXVsdGlCc3NpZCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFTXVsdGlCc3NpZCkgKiBpICkpLT5udW1fdmVuZG9yU3BlY2lmaWMgKyAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVNdWx0aUJzc2lkKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVSSUNEYXRhOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVSSUNEYXRhKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSA0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVSSUNEYXRhKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVSSUNEZXNjcmlwdG9yOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVSSUNEZXNjcmlwdG9yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAoKHREb3QxMWZJRVJJQ0Rlc2NyaXB0b3IqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVJJQ0Rlc2NyaXB0b3IpICogaSApKS0+bnVtX3ZhcmlhYmxlRGF0YSArIDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVJJQ0Rlc2NyaXB0b3IqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVJSTUVuYWJsZWRDYXA6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVJSTUVuYWJsZWRDYXApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVJSTUVuYWJsZWRDYXAqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVJlcXVlc3RlZEluZm86CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVJlcXVlc3RlZEluZm8pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9ICgodERvdDExZklFUmVxdWVzdGVkSW5mbyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUmVxdWVzdGVkSW5mbykgKiBpICkpLT5udW1fcmVxdWVzdGVkX2VpZHM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVJlcXVlc3RlZEluZm8qICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVNTSUQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVNTSUQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9ICgodERvdDExZklFU1NJRCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFU1NJRCkgKiBpICkpLT5udW1fc3NpZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFU1NJRCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llU2NoZWR1bGU6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVNjaGVkdWxlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAxNDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFU2NoZWR1bGUqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVRDTEFTOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVUQ0xBUyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZkdldFBhY2tlZElFVENMQVMocEN0eCwgKCB0RG90MTFmSUVUQ0xBUyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICksIHBuTmVlZGVkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llVENMQVNTUFJPQzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFVENMQVNTUFJPQyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFVENMQVNTUFJPQyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llVFNEZWxheToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFVFNEZWxheSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gNDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFVFNEZWxheSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llVFNQRUM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVRTUEVDKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSA1NTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFVFNQRUMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdNTVNjaGVkdWxlOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVXTU1TY2hlZHVsZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMTU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVdNTVNjaGVkdWxlKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXTU1UQ0xBUzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFV01NVENMQVMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZHZXRQYWNrZWRJRVdNTVRDTEFTKHBDdHgsICggdERvdDExZklFV01NVENMQVMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSApLCBwbk5lZWRlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdNTVRDTEFTUFJPQzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFV01NVENMQVNQUk9DKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVXTU1UQ0xBU1BST0MqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdNTVRTRGVsYXk6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVdNTVRTRGVsYXkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVdNTVRTRGVsYXkqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdNTVRTUEVDOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVXTU1UU1BFQyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gNTY7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVdNTVRTUEVDKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVBSUQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRUFJRCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFQUlEKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVBaXJnbzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFQWlyZ28pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZHZXRQYWNrZWRJRUFpcmdvKHBDdHgsICggdERvdDExZklFQWlyZ28qICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSApLCBwbk5lZWRlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUNGUGFyYW1zOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVDRlBhcmFtcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gNjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFQ0ZQYXJhbXMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUNoYWxsZW5nZVRleHQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRUNoYWxsZW5nZVRleHQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9ICgodERvdDExZklFQ2hhbGxlbmdlVGV4dCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFQ2hhbGxlbmdlVGV4dCkgKiBpICkpLT5udW1fdGV4dDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFQ2hhbGxlbmdlVGV4dCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llQ2hhblN3aXRjaEFubjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFQ2hhblN3aXRjaEFubik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFQ2hhblN3aXRjaEFubiogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llQ291bnRyeToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFQ291bnRyeSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZkdldFBhY2tlZElFQ291bnRyeShwQ3R4LCAoIHREb3QxMWZJRUNvdW50cnkqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSApLCBwbk5lZWRlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZURTUGFyYW1zOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVEU1BhcmFtcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFRFNQYXJhbXMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUVEQ0FQYXJhbVNldDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFRURDQVBhcmFtU2V0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAxODsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFRURDQVBhcmFtU2V0KiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVFUlBJbmZvOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVFUlBJbmZvKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVFUlBJbmZvKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVFU0VDY2ttT3BhcXVlOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVFU0VDY2ttT3BhcXVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAoKHREb3QxMWZJRUVTRUNja21PcGFxdWUqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUVTRUNja21PcGFxdWUpICogaSApKS0+bnVtX2RhdGE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRUVTRUNja21PcGFxdWUqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUVTRVJhZE1nbXRDYXA6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRUVTRVJhZE1nbXRDYXApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRUVTRVJhZE1nbXRDYXAqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUVTRVRyYWZTdHJtTWV0OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVFU0VUcmFmU3RybU1ldCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gNDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFRVNFVHJhZlN0cm1NZXQqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUVTRVRyYWZTdHJtUmF0ZVNldDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFRVNFVHJhZlN0cm1SYXRlU2V0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAoKHREb3QxMWZJRUVTRVRyYWZTdHJtUmF0ZVNldCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFRVNFVHJhZlN0cm1SYXRlU2V0KSAqIGkgKSktPm51bV90c3JhdGVzICsgMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFRVNFVHJhZlN0cm1SYXRlU2V0KiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVFU0VUeG1pdFBvd2VyOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVFU0VUeG1pdFBvd2VyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVFU0VUeG1pdFBvd2VyKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVFU0VWZXJzaW9uOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVFU0VWZXJzaW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVFU0VWZXJzaW9uKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVFeHRDYXA6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRUV4dENhcCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gODsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFRXh0Q2FwKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVFeHRDaGFuU3dpdGNoQW5uOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVFeHRDaGFuU3dpdGNoQW5uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVFeHRDaGFuU3dpdGNoQW5uKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVFeHRTdXBwUmF0ZXM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRUV4dFN1cHBSYXRlcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gKCh0RG90MTFmSUVFeHRTdXBwUmF0ZXMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUV4dFN1cHBSYXRlcykgKiBpICkpLT5udW1fcmF0ZXM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRUV4dFN1cHBSYXRlcyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llRkhQYXJhbVNldDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFRkhQYXJhbVNldCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gNTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFRkhQYXJhbVNldCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llRkhQYXJhbXM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRUZIUGFyYW1zKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVGSFBhcmFtcyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llRkhQYXR0VGFibGU6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRUZIUGF0dFRhYmxlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAoKHREb3QxMWZJRUZIUGF0dFRhYmxlKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVGSFBhdHRUYWJsZSkgKiBpICkpLT5udW1fcmFuZHRhYmxlICsgNDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFRkhQYXR0VGFibGUqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUZUSW5mbzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFRlRJbmZvKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmR2V0UGFja2VkSUVGVEluZm8ocEN0eCwgKCB0RG90MTFmSUVGVEluZm8qICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSApLCBwbk5lZWRlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUhUMjA0MEJTU0NvZXhpc3RlbmNlOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVIVDIwNDBCU1NDb2V4aXN0ZW5jZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFSFQyMDQwQlNTQ29leGlzdGVuY2UqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUhUMjA0MEJTU0ludG9sZXJhbnRSZXBvcnQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRUhUMjA0MEJTU0ludG9sZXJhbnRSZXBvcnQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9ICgodERvdDExZklFSFQyMDQwQlNTSW50b2xlcmFudFJlcG9ydCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFSFQyMDQwQlNTSW50b2xlcmFudFJlcG9ydCkgKiBpICkpLT5udW1fY2hhbm5lbExpc3QgKyAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVIVDIwNDBCU1NJbnRvbGVyYW50UmVwb3J0KiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVIVENhcHM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRUhUQ2Fwcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gKCh0RG90MTFmSUVIVENhcHMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUhUQ2FwcykgKiBpICkpLT5udW1fcnN2ZCArIDI2OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVIVENhcHMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUhUSW5mbzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFSFRJbmZvKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAoKHREb3QxMWZJRUhUSW5mbyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFSFRJbmZvKSAqIGkgKSktPm51bV9yc3ZkICsgMjI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRUhUSW5mbyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llSUJTU1BhcmFtczoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFSUJTU1BhcmFtcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFSUJTU1BhcmFtcyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llTGlua0lkZW50aWZpZXI6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRUxpbmtJZGVudGlmaWVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAxODsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFTGlua0lkZW50aWZpZXIqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZU1lYXN1cmVtZW50UmVwb3J0OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVNZWFzdXJlbWVudFJlcG9ydCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZkdldFBhY2tlZElFTWVhc3VyZW1lbnRSZXBvcnQocEN0eCwgKCB0RG90MTFmSUVNZWFzdXJlbWVudFJlcG9ydCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICksIHBuTmVlZGVkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llTWVhc3VyZW1lbnRSZXF1ZXN0OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVNZWFzdXJlbWVudFJlcXVlc3QpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZHZXRQYWNrZWRJRU1lYXN1cmVtZW50UmVxdWVzdChwQ3R4LCAoIHREb3QxMWZJRU1lYXN1cmVtZW50UmVxdWVzdCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICksIHBuTmVlZGVkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llTW9iaWxpdHlEb21haW46CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRU1vYmlsaXR5RG9tYWluKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAzOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVNb2JpbGl0eURvbWFpbiogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llTmVpZ2hib3JSZXBvcnQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRU5laWdoYm9yUmVwb3J0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmR2V0UGFja2VkSUVOZWlnaGJvclJlcG9ydChwQ3R4LCAoIHREb3QxMWZJRU5laWdoYm9yUmVwb3J0KiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgKSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVPQlNTU2NhblBhcmFtZXRlcnM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRU9CU1NTY2FuUGFyYW1ldGVycyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMTQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRU9CU1NTY2FuUGFyYW1ldGVycyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llT3BlcmF0aW5nTW9kZToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFT3BlcmF0aW5nTW9kZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFT3BlcmF0aW5nTW9kZSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQQXNzb2NSZXE6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVAyUEFzc29jUmVxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmR2V0UGFja2VkSUVQMlBBc3NvY1JlcShwQ3R4LCAoIHREb3QxMWZJRVAyUEFzc29jUmVxKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgKSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVQMlBBc3NvY1JlczoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFUDJQQXNzb2NSZXMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZHZXRQYWNrZWRJRVAyUEFzc29jUmVzKHBDdHgsICggdERvdDExZklFUDJQQXNzb2NSZXMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSApLCBwbk5lZWRlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUEJlYWNvbjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFUDJQQmVhY29uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmR2V0UGFja2VkSUVQMlBCZWFjb24ocEN0eCwgKCB0RG90MTFmSUVQMlBCZWFjb24qICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSApLCBwbk5lZWRlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUEJlYWNvblByb2JlUmVzOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVQMlBCZWFjb25Qcm9iZVJlcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZkdldFBhY2tlZElFUDJQQmVhY29uUHJvYmVSZXMocEN0eCwgKCB0RG90MTFmSUVQMlBCZWFjb25Qcm9iZVJlcyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICksIHBuTmVlZGVkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQRGVBdXRoOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVQMlBEZUF1dGgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZHZXRQYWNrZWRJRVAyUERlQXV0aChwQ3R4LCAoIHREb3QxMWZJRVAyUERlQXV0aCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICksIHBuTmVlZGVkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQRGV2aWNlRGlzY292ZXJhYmlsaXR5UmVxOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVQMlBEZXZpY2VEaXNjb3ZlcmFiaWxpdHlSZXEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZHZXRQYWNrZWRJRVAyUERldmljZURpc2NvdmVyYWJpbGl0eVJlcShwQ3R4LCAoIHREb3QxMWZJRVAyUERldmljZURpc2NvdmVyYWJpbGl0eVJlcSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICksIHBuTmVlZGVkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQRGV2aWNlRGlzY292ZXJhYmlsaXR5UmVzOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVQMlBEZXZpY2VEaXNjb3ZlcmFiaWxpdHlSZXMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZHZXRQYWNrZWRJRVAyUERldmljZURpc2NvdmVyYWJpbGl0eVJlcyhwQ3R4LCAoIHREb3QxMWZJRVAyUERldmljZURpc2NvdmVyYWJpbGl0eVJlcyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICksIHBuTmVlZGVkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQRGlzQXNzb2M6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVAyUERpc0Fzc29jKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmR2V0UGFja2VkSUVQMlBEaXNBc3NvYyhwQ3R4LCAoIHREb3QxMWZJRVAyUERpc0Fzc29jKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgKSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVQMlBHT05lZ0NuZjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFUDJQR09OZWdDbmYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZHZXRQYWNrZWRJRVAyUEdPTmVnQ25mKHBDdHgsICggdERvdDExZklFUDJQR09OZWdDbmYqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSApLCBwbk5lZWRlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUEdPTmVnUmVxOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVQMlBHT05lZ1JlcSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZkdldFBhY2tlZElFUDJQR09OZWdSZXEocEN0eCwgKCB0RG90MTFmSUVQMlBHT05lZ1JlcSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICksIHBuTmVlZGVkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQR09OZWdSZXM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVAyUEdPTmVnUmVzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmR2V0UGFja2VkSUVQMlBHT05lZ1JlcyhwQ3R4LCAoIHREb3QxMWZJRVAyUEdPTmVnUmVzKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgKSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVQMlBHT05lZ1dQUzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFUDJQR09OZWdXUFMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZHZXRQYWNrZWRJRVAyUEdPTmVnV1BTKHBDdHgsICggdERvdDExZklFUDJQR09OZWdXUFMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSApLCBwbk5lZWRlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUElFT3BhcXVlOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVQMlBJRU9wYXF1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gKCh0RG90MTFmSUVQMlBJRU9wYXF1ZSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUDJQSUVPcGFxdWUpICogaSApKS0+bnVtX2RhdGE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVAyUElFT3BhcXVlKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVQMlBJbnZpdGF0aW9uUmVxOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVQMlBJbnZpdGF0aW9uUmVxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmR2V0UGFja2VkSUVQMlBJbnZpdGF0aW9uUmVxKHBDdHgsICggdERvdDExZklFUDJQSW52aXRhdGlvblJlcSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICksIHBuTmVlZGVkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQSW52aXRhdGlvblJlczoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFUDJQSW52aXRhdGlvblJlcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZkdldFBhY2tlZElFUDJQSW52aXRhdGlvblJlcyhwQ3R4LCAoIHREb3QxMWZJRVAyUEludml0YXRpb25SZXMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSApLCBwbk5lZWRlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUE5vdGljZU9mQWJzZW5jZToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFUDJQTm90aWNlT2ZBYnNlbmNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmR2V0UGFja2VkSUVQMlBOb3RpY2VPZkFic2VuY2UocEN0eCwgKCB0RG90MTFmSUVQMlBOb3RpY2VPZkFic2VuY2UqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSApLCBwbk5lZWRlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUFByZXNlbmNlUmVzcG9uc2U6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVAyUFByZXNlbmNlUmVzcG9uc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZHZXRQYWNrZWRJRVAyUFByZXNlbmNlUmVzcG9uc2UocEN0eCwgKCB0RG90MTFmSUVQMlBQcmVzZW5jZVJlc3BvbnNlKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgKSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVQMlBQcm9iZVJlcToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFUDJQUHJvYmVSZXEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZHZXRQYWNrZWRJRVAyUFByb2JlUmVxKHBDdHgsICggdERvdDExZklFUDJQUHJvYmVSZXEqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSApLCBwbk5lZWRlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUFByb2JlUmVzOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVQMlBQcm9iZVJlcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZkdldFBhY2tlZElFUDJQUHJvYmVSZXMocEN0eCwgKCB0RG90MTFmSUVQMlBQcm9iZVJlcyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICksIHBuTmVlZGVkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQUHJvdmlzaW9uRGlzY292ZXJ5UmVxOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVQMlBQcm92aXNpb25EaXNjb3ZlcnlSZXEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZHZXRQYWNrZWRJRVAyUFByb3Zpc2lvbkRpc2NvdmVyeVJlcShwQ3R4LCAoIHREb3QxMWZJRVAyUFByb3Zpc2lvbkRpc2NvdmVyeVJlcSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICksIHBuTmVlZGVkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQV1NDUHJvdmlzaW9uRGlzY292ZXJ5UmVzOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVQMlBXU0NQcm92aXNpb25EaXNjb3ZlcnlSZXMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZHZXRQYWNrZWRJRVAyUFdTQ1Byb3Zpc2lvbkRpc2NvdmVyeVJlcyhwQ3R4LCAoIHREb3QxMWZJRVAyUFdTQ1Byb3Zpc2lvbkRpc2NvdmVyeVJlcyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICksIHBuTmVlZGVkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUFRJQ29udHJvbDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFUFRJQ29udHJvbCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFUFRJQ29udHJvbCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUFVCdWZmZXJTdGF0dXM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVBVQnVmZmVyU3RhdHVzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVQVUJ1ZmZlclN0YXR1cyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUG93ZXJDYXBzOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVQb3dlckNhcHMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVBvd2VyQ2FwcyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUG93ZXJDb25zdHJhaW50czoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFUG93ZXJDb25zdHJhaW50cyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFUG93ZXJDb25zdHJhaW50cyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUUJTU0xvYWQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVFCU1NMb2FkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSA1OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVRQlNTTG9hZCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUU9TQ2Fwc0FwOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVRT1NDYXBzQXApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVFPU0NhcHNBcCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUU9TQ2Fwc1N0YXRpb246CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVFPU0NhcHNTdGF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVRT1NDYXBzU3RhdGlvbiogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUW9zTWFwU2V0OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVRb3NNYXBTZXQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9ICgodERvdDExZklFUW9zTWFwU2V0KiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVRb3NNYXBTZXQpICogaSApKS0+bnVtX2RzY3BfZXhjZXB0aW9uczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFUW9zTWFwU2V0KiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVRdWlldDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFUXVpZXQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDY7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVF1aWV0KiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVSQ1BJSUU6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVJDUElJRSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFUkNQSUlFKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVSSUNEYXRhRGVzYzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFUklDRGF0YURlc2MpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBuTmVlZGVkIC09IDIgIDsgLy9TdWJ0cmFjdCB0aGUgbGVuZ3RoIGFuZCBPdWkgYXMgdGhpcyBpcyBvdXIgY29udGFpbmVyIElFIHRvIGdyb3VwIEllcyBhbmQgaXQgZG9lc250IGhhdmUgaXRzIG93biBsZW5ndGggYW5kIE9VSS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmR2V0UGFja2VkSUVSSUNEYXRhRGVzYyhwQ3R4LCAoIHREb3QxMWZJRVJJQ0RhdGFEZXNjKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgKSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVSU046CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVJTTik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZkdldFBhY2tlZElFUlNOKHBDdHgsICggdERvdDExZklFUlNOKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgKSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVSU05JSUU6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVJTTklJRSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFUlNOSUlFKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVSU05PcGFxdWU6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVJTTk9wYXF1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gKCh0RG90MTFmSUVSU05PcGFxdWUqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVJTTk9wYXF1ZSkgKiBpICkpLT5udW1fZGF0YTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFUlNOT3BhcXVlKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVTdXBwQ2hhbm5lbHM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVN1cHBDaGFubmVscyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gKCh0RG90MTFmSUVTdXBwQ2hhbm5lbHMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVN1cHBDaGFubmVscykgKiBpICkpLT5udW1fYmFuZHMgKiAyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVTdXBwQ2hhbm5lbHMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVN1cHBPcGVyYXRpbmdDbGFzc2VzOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVTdXBwT3BlcmF0aW5nQ2xhc3Nlcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gKCh0RG90MTFmSUVTdXBwT3BlcmF0aW5nQ2xhc3NlcyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFU3VwcE9wZXJhdGluZ0NsYXNzZXMpICogaSApKS0+bnVtX2NsYXNzZXM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVN1cHBPcGVyYXRpbmdDbGFzc2VzKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVTdXBwUmF0ZXM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVN1cHBSYXRlcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gKCh0RG90MTFmSUVTdXBwUmF0ZXMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVN1cHBSYXRlcykgKiBpICkpLT5udW1fcmF0ZXM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVN1cHBSYXRlcyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llVElNOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVUSU0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9ICgodERvdDExZklFVElNKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVUSU0pICogaSApKS0+bnVtX3ZibXAgKyAzOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVUSU0qICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVRQQ1JlcG9ydDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFVFBDUmVwb3J0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVUUENSZXBvcnQqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVRQQ1JlcXVlc3Q6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVRQQ1JlcXVlc3QpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVRQQ1JlcXVlc3QqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVRpbWVvdXRJbnRlcnZhbDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFVGltZW91dEludGVydmFsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSA1OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVUaW1lb3V0SW50ZXJ2YWwqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVZIVENhcHM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVZIVENhcHMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDEyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVWSFRDYXBzKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVWSFRFeHRCc3NMb2FkOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVWSFRFeHRCc3NMb2FkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSA1OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVWSFRFeHRCc3NMb2FkKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVWSFRPcGVyYXRpb246CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVZIVE9wZXJhdGlvbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gNTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFVkhUT3BlcmF0aW9uKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXQVBJOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVXQVBJKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmR2V0UGFja2VkSUVXQVBJKHBDdHgsICggdERvdDExZklFV0FQSSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICksIHBuTmVlZGVkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV0FQSU9wYXF1ZToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFV0FQSU9wYXF1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gKCh0RG90MTFmSUVXQVBJT3BhcXVlKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVXQVBJT3BhcXVlKSAqIGkgKSktPm51bV9kYXRhOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVXQVBJT3BhcXVlKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXRkFUUEM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVdGQVRQQyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFV0ZBVFBDKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXRkRJRU9wYXF1ZToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFV0ZESUVPcGFxdWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9ICgodERvdDExZklFV0ZESUVPcGFxdWUqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVdGRElFT3BhcXVlKSAqIGkgKSktPm51bV9kYXRhOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVXRkRJRU9wYXF1ZSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV01NQ2FwczoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFV01NQ2Fwcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFV01NQ2FwcyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV01NSW5mb0FwOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVXTU1JbmZvQXApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVdNTUluZm9BcCogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV01NSW5mb1N0YXRpb246CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVdNTUluZm9TdGF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVXTU1JbmZvU3RhdGlvbiogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICApKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV01NUGFyYW1zOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVXTU1QYXJhbXMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDE5OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVXTU1QYXJhbXMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdQQToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFV1BBKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmR2V0UGFja2VkSUVXUEEocEN0eCwgKCB0RG90MTFmSUVXUEEqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSApLCBwbk5lZWRlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdQQU9wYXF1ZToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFV1BBT3BhcXVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAoKHREb3QxMWZJRVdQQU9wYXF1ZSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFV1BBT3BhcXVlKSAqIGkgKSktPm51bV9kYXRhOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZVByZXNlbnQgPSAoICh0RG90MTFmSUVXUEFPcGFxdWUqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdTQzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFV1NDKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmR2V0UGFja2VkSUVXU0MocEN0eCwgKCB0RG90MTFmSUVXU0MqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSApLCBwbk5lZWRlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdpZGVyQldDaGFuU3dpdGNoQW5uOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVXaWRlckJXQ2hhblN3aXRjaEFubik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSWVQcmVzZW50ID0gKCAodERvdDExZklFV2lkZXJCV0NoYW5Td2l0Y2hBbm4qICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSAgKSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdzY0Fzc29jUmVxOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVXc2NBc3NvY1JlcSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZkdldFBhY2tlZElFV3NjQXNzb2NSZXEocEN0eCwgKCB0RG90MTFmSUVXc2NBc3NvY1JlcSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICksIHBuTmVlZGVkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV3NjQXNzb2NSZXM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVdzY0Fzc29jUmVzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmR2V0UGFja2VkSUVXc2NBc3NvY1JlcyhwQ3R4LCAoIHREb3QxMWZJRVdzY0Fzc29jUmVzKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgKSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXc2NCZWFjb246CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2l6ZW9mKHREb3QxMWZJRVdzY0JlYWNvbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZkdldFBhY2tlZElFV3NjQmVhY29uKHBDdHgsICggdERvdDExZklFV3NjQmVhY29uKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgKSwgcG5OZWVkZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXc2NCZWFjb25Qcm9iZVJlczoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFV3NjQmVhY29uUHJvYmVSZXMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZHZXRQYWNrZWRJRVdzY0JlYWNvblByb2JlUmVzKHBDdHgsICggdERvdDExZklFV3NjQmVhY29uUHJvYmVSZXMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSApLCBwbk5lZWRlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdzY0lFT3BhcXVlOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVXc2NJRU9wYXF1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gKCh0RG90MTFmSUVXc2NJRU9wYXF1ZSogKShwRnJtICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFV3NjSUVPcGFxdWUpICogaSApKS0+bnVtX2RhdGE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEllUHJlc2VudCA9ICggKHREb3QxMWZJRVdzY0lFT3BhcXVlKiApKHBGcm0gKyBwSWUtPm9mZnNldCArIG9mZnNldCAqIGkgICkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXc2NQcm9iZVJlcToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFV3NjUHJvYmVSZXEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZHZXRQYWNrZWRJRVdzY1Byb2JlUmVxKHBDdHgsICggdERvdDExZklFV3NjUHJvYmVSZXEqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSApLCBwbk5lZWRlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdzY1Byb2JlUmVzOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IHNpemVvZih0RG90MTFmSUVXc2NQcm9iZVJlcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZkdldFBhY2tlZElFV3NjUHJvYmVSZXMocEN0eCwgKCB0RG90MTFmSUVXc2NQcm9iZVJlcyogKShwRnJtICsgcEllLT5vZmZzZXQgKyBvZmZzZXQgKiBpICksIHBuTmVlZGVkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV3NjUmVhc3NvY1JlczoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplb2YodERvdDExZklFV3NjUmVhc3NvY1Jlcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZkdldFBhY2tlZElFV3NjUmVhc3NvY1JlcyhwQ3R4LCAoIHREb3QxMWZJRVdzY1JlYXNzb2NSZXMqICkocEZybSArIHBJZS0+b2Zmc2V0ICsgb2Zmc2V0ICogaSApLCBwbk5lZWRlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSTE9HRSwgRlJGTCgiSU5URVJOQUwgRVJST1ItLSBJIGRvbiIKKyAgICAgICAgICAgICAgICAgICAgICAgIid0IGtub3cgYWJvdXQgdGhlIElFIHNpZ25hdHVyZSAlZDsgdGhpcyBpcyBtb3N0IGwiCisgICAgICAgICAgICAgICAgICAgICAgICJpa2VseSBhIGJ1ZyBpbiAnZnJhbWVzYycuXG4iKSwgcEllLT5zaWcpOworICAgICAgICAgICAgICAgICAgIHJldHVybiBET1QxMUZfSU5URVJOQUxfRVJST1I7CisgICAgICAgICAgICAgICB9LypFbmQgb2Ygc3dpdGNoIENhc2UqLworICAgICAgICAgICAgICAgaWYoIGJ5dGVDb3VudCAmJiBwSWVQcmVzZW50ICkKKyAgICAgICAgICAgICAgICAgKnBuTmVlZGVkICs9IGJ5dGVDb3VudDsKKyAgICAgICAgICAgfSAvKkVuZCBvZiBmb3IgbG9vcCovCisgICAgICAgIH0KKyAgICAgICAgKytwSWU7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7CisKK30KKworc3RhdGljIHRBTklfVTMyIEdldFBhY2tlZFNpemVUbHZDb3JlKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwRnJtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuTmVlZGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdFRMVkRlZm4gIFRMVnNbXSkKK3sKKyAgICBjb25zdCB0VExWRGVmbiAqcFRsdjsKKyAgICB0QU5JX1UzMiAgIHN0YXR1czsKKyAgICB0RlJBTUVTX0JPT0wgICAqcGZGb3VuZDsKKyAgICB0QU5JX1UzMiAgIGJ5dGVDb3VudCA9IDA7CisgICAgdEFOSV9VOCAgICBwVGx2UHJlc2VudCA9IDA7CisKKyAgICBzdGF0dXMgPSBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKKworICAgIHBUbHYgPSAmKCBUTFZzWzBdICk7CisgICAgd2hpbGUgKCAweGZmZmYgIT0gcFRsdi0+aWQgKQorICAgIHsKKyAgICAgICAgcGZGb3VuZCA9ICh0RlJBTUVTX0JPT0wqKShwRnJtICsgcFRsdi0+b2Zmc2V0ICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVGx2LT5wcmVzZW5jZU9mZnNldCk7CisgICAgICAgIGlmICggKnBmRm91bmQgKQorICAgICAgICB7CisgICAgICAgICAgICAqcG5OZWVkZWQgKz0gKHBUbHYtPnNUeXBlICsgcFRsdi0+c0xlbik7CisgICAgICAgICAgICBpZiAoIHBUbHYtPnBlYyApICpwbk5lZWRlZCArPSAzVTsKKyAgICAgICAgICAgIHN3aXRjaCAocFRsdi0+c2lnKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2QXV0aG9yaXplZE1BQ3M6CisgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDY7CisgICAgICAgICAgICAgICAgICAgICAgICBwVGx2UHJlc2VudCA9ICgoIHREb3QxMWZUTFZBdXRob3JpemVkTUFDcyogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2UmVxdWVzdFRvRW5yb2xsOgorICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgcFRsdlByZXNlbnQgPSAoKCB0RG90MTFmVExWUmVxdWVzdFRvRW5yb2xsKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQpKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZWZXJzaW9uMjoKKyAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUbHZQcmVzZW50ID0gKCggdERvdDExZlRMVlZlcnNpb24yKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQpKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZBUFNldHVwTG9ja2VkOgorICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgcFRsdlByZXNlbnQgPSAoKCB0RG90MTFmVExWQVBTZXR1cExvY2tlZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2QXNzb2NpYXRpb25TdGF0ZToKKyAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUbHZQcmVzZW50ID0gKCggdERvdDExZlRMVkFzc29jaWF0aW9uU3RhdGUqICkocEZybSArIHBUbHYtPm9mZnNldCkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdkNoYW5uZWxMaXN0OgorICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAoKHREb3QxMWZUTFZDaGFubmVsTGlzdCopKHBGcm0gKyBwVGx2LT5vZmZzZXQpKS0+bnVtX2NoYW5uZWxMaXN0KzM7CisgICAgICAgICAgICAgICAgICAgICAgICBwVGx2UHJlc2VudCA9ICgoIHREb3QxMWZUTFZDaGFubmVsTGlzdCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2Q29uZmlnTWV0aG9kczoKKyAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUbHZQcmVzZW50ID0gKCggdERvdDExZlRMVkNvbmZpZ01ldGhvZHMqICkocEZybSArIHBUbHYtPm9mZnNldCkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdkNvbmZpZ3VyYXRpb25FcnJvcjoKKyAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUbHZQcmVzZW50ID0gKCggdERvdDExZlRMVkNvbmZpZ3VyYXRpb25FcnJvciogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2Q29uZmlndXJhdGlvblRpbWVvdXQ6CisgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDI7CisgICAgICAgICAgICAgICAgICAgICAgICBwVGx2UHJlc2VudCA9ICgoIHREb3QxMWZUTFZDb25maWd1cmF0aW9uVGltZW91dCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2RGV2aWNlTmFtZToKKyAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gKCh0RG90MTFmVExWRGV2aWNlTmFtZSopKHBGcm0gKyBwVGx2LT5vZmZzZXQpKS0+bnVtX3RleHQ7CisgICAgICAgICAgICAgICAgICAgICAgICBwVGx2UHJlc2VudCA9ICgoIHREb3QxMWZUTFZEZXZpY2VOYW1lKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQpKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZEZXZpY2VQYXNzd29yZElEOgorICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAyOworICAgICAgICAgICAgICAgICAgICAgICAgcFRsdlByZXNlbnQgPSAoKCB0RG90MTFmVExWRGV2aWNlUGFzc3dvcmRJRCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2RXh0ZW5kZWRMaXN0ZW5UaW1pbmc6CisgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDQ7CisgICAgICAgICAgICAgICAgICAgICAgICBwVGx2UHJlc2VudCA9ICgoIHREb3QxMWZUTFZFeHRlbmRlZExpc3RlblRpbWluZyogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2R09JbnRlbnQ6CisgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICBwVGx2UHJlc2VudCA9ICgoIHREb3QxMWZUTFZHT0ludGVudCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2SW50ZW5kZWRQMlBJbnRlcmZhY2VBZGRyZXNzOgorICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSA2OworICAgICAgICAgICAgICAgICAgICAgICAgcFRsdlByZXNlbnQgPSAoKCB0RG90MTFmVExWSW50ZW5kZWRQMlBJbnRlcmZhY2VBZGRyZXNzKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQpKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZJbnZpdGF0aW9uRmxhZ3M6CisgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICBwVGx2UHJlc2VudCA9ICgoIHREb3QxMWZUTFZJbnZpdGF0aW9uRmxhZ3MqICkocEZybSArIHBUbHYtPm9mZnNldCkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1Rsdkxpc3RlbkNoYW5uZWw6CisgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDU7CisgICAgICAgICAgICAgICAgICAgICAgICBwVGx2UHJlc2VudCA9ICgoIHREb3QxMWZUTFZMaXN0ZW5DaGFubmVsKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQpKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZNYW51ZmFjdHVyZXI6CisgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9ICgodERvdDExZlRMVk1hbnVmYWN0dXJlciopKHBGcm0gKyBwVGx2LT5vZmZzZXQpKS0+bnVtX25hbWU7CisgICAgICAgICAgICAgICAgICAgICAgICBwVGx2UHJlc2VudCA9ICgoIHREb3QxMWZUTFZNYW51ZmFjdHVyZXIqICkocEZybSArIHBUbHYtPm9mZnNldCkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1Rsdk1pbm9yUmVhc29uQ29kZToKKyAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUbHZQcmVzZW50ID0gKCggdERvdDExZlRMVk1pbm9yUmVhc29uQ29kZSogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2TW9kZWxOYW1lOgorICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAoKHREb3QxMWZUTFZNb2RlbE5hbWUqKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPm51bV90ZXh0OworICAgICAgICAgICAgICAgICAgICAgICAgcFRsdlByZXNlbnQgPSAoKCB0RG90MTFmVExWTW9kZWxOYW1lKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQpKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZNb2RlbE51bWJlcjoKKyAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gKCh0RG90MTFmVExWTW9kZWxOdW1iZXIqKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPm51bV90ZXh0OworICAgICAgICAgICAgICAgICAgICAgICAgcFRsdlByZXNlbnQgPSAoKCB0RG90MTFmVExWTW9kZWxOdW1iZXIqICkocEZybSArIHBUbHYtPm9mZnNldCkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1Rsdk5vdGljZU9mQWJzZW5jZToKKyAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gKCh0RG90MTFmVExWTm90aWNlT2ZBYnNlbmNlKikocEZybSArIHBUbHYtPm9mZnNldCkpLT5udW1fTm9BRGVzYysyOworICAgICAgICAgICAgICAgICAgICAgICAgcFRsdlByZXNlbnQgPSAoKCB0RG90MTFmVExWTm90aWNlT2ZBYnNlbmNlKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQpKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZPcGVyYXRpbmdDaGFubmVsOgorICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSA1OworICAgICAgICAgICAgICAgICAgICAgICAgcFRsdlByZXNlbnQgPSAoKCB0RG90MTFmVExWT3BlcmF0aW5nQ2hhbm5lbCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2UDJQQ2FwYWJpbGl0eToKKyAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUbHZQcmVzZW50ID0gKCggdERvdDExZlRMVlAyUENhcGFiaWxpdHkqICkocEZybSArIHBUbHYtPm9mZnNldCkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlAyUERldmljZUlkOgorICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSA2OworICAgICAgICAgICAgICAgICAgICAgICAgcFRsdlByZXNlbnQgPSAoKCB0RG90MTFmVExWUDJQRGV2aWNlSWQqICkocEZybSArIHBUbHYtPm9mZnNldCkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlAyUERldmljZUluZm86CisgICAgICAgIHN0YXR1cyA9IEdldFBhY2tlZFNpemVUbHZDb3JlKHBDdHgsICggdEFOSV9VOCogKXBGcm0gKyBwVGx2LT5vZmZzZXQsIHBuTmVlZGVkLCBUTFZTX1AyUERldmljZUluZm8pOworICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAxNjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUbHZQcmVzZW50ID0gKCggdERvdDExZlRMVlAyUERldmljZUluZm8qICkocEZybSArIHBUbHYtPm9mZnNldCkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlAyUEdyb3VwQnNzaWQ6CisgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDY7CisgICAgICAgICAgICAgICAgICAgICAgICBwVGx2UHJlc2VudCA9ICgoIHREb3QxMWZUTFZQMlBHcm91cEJzc2lkKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQpKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZQMlBHcm91cElkOgorICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAoKHREb3QxMWZUTFZQMlBHcm91cElkKikocEZybSArIHBUbHYtPm9mZnNldCkpLT5udW1fc3NpZCs2OworICAgICAgICAgICAgICAgICAgICAgICAgcFRsdlByZXNlbnQgPSAoKCB0RG90MTFmVExWUDJQR3JvdXBJZCogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2UDJQR3JvdXBJbmZvOgorICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAoKHREb3QxMWZUTFZQMlBHcm91cEluZm8qKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPm51bV9QMlBDbGllbnRJbmZvRGVzYzsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUbHZQcmVzZW50ID0gKCggdERvdDExZlRMVlAyUEdyb3VwSW5mbyogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2UDJQU3RhdHVzOgorICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgcFRsdlByZXNlbnQgPSAoKCB0RG90MTFmVExWUDJQU3RhdHVzKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQpKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZQcmltYXJ5RGV2aWNlVHlwZToKKyAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gODsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUbHZQcmVzZW50ID0gKCggdERvdDExZlRMVlByaW1hcnlEZXZpY2VUeXBlKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQpKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZSRkJhbmRzOgorICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgcFRsdlByZXNlbnQgPSAoKCB0RG90MTFmVExWUkZCYW5kcyogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2UmVxdWVzdERldmljZVR5cGU6CisgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDg7CisgICAgICAgICAgICAgICAgICAgICAgICBwVGx2UHJlc2VudCA9ICgoIHREb3QxMWZUTFZSZXF1ZXN0RGV2aWNlVHlwZSogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2UmVxdWVzdFR5cGU6CisgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICBwVGx2UHJlc2VudCA9ICgoIHREb3QxMWZUTFZSZXF1ZXN0VHlwZSogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2UmVzcG9uc2VUeXBlOgorICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgcFRsdlByZXNlbnQgPSAoKCB0RG90MTFmVExWUmVzcG9uc2VUeXBlKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQpKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZTZWxlY3RlZFJlZ2lzdHJhcjoKKyAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUbHZQcmVzZW50ID0gKCggdERvdDExZlRMVlNlbGVjdGVkUmVnaXN0cmFyKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQpKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZTZWxlY3RlZFJlZ2lzdHJhckNvbmZpZ01ldGhvZHM6CisgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDI7CisgICAgICAgICAgICAgICAgICAgICAgICBwVGx2UHJlc2VudCA9ICgoIHREb3QxMWZUTFZTZWxlY3RlZFJlZ2lzdHJhckNvbmZpZ01ldGhvZHMqICkocEZybSArIHBUbHYtPm9mZnNldCkpLT5wcmVzZW50OworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlNlcmlhbE51bWJlcjoKKyAgICAgICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gKCh0RG90MTFmVExWU2VyaWFsTnVtYmVyKikocEZybSArIHBUbHYtPm9mZnNldCkpLT5udW1fdGV4dDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUbHZQcmVzZW50ID0gKCggdERvdDExZlRMVlNlcmlhbE51bWJlciogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2VVVJRF9FOgorICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAxNjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUbHZQcmVzZW50ID0gKCggdERvdDExZlRMVlVVSURfRSogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2VVVJRF9SOgorICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAxNjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUbHZQcmVzZW50ID0gKCggdERvdDExZlRMVlVVSURfUiogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2VmVuZG9yRXh0ZW5zaW9uOgorICAgICAgICBzdGF0dXMgPSBHZXRQYWNrZWRTaXplVGx2Q29yZShwQ3R4LCAoIHRBTklfVTgqIClwRnJtICsgcFRsdi0+b2Zmc2V0LCBwbk5lZWRlZCwgVExWU19WZW5kb3JFeHRlbnNpb24pOworICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAzOworICAgICAgICAgICAgICAgICAgICAgICAgcFRsdlByZXNlbnQgPSAoKCB0RG90MTFmVExWVmVuZG9yRXh0ZW5zaW9uKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQpKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZWZXJzaW9uOgorICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgcFRsdlByZXNlbnQgPSAoKCB0RG90MTFmVExWVmVyc2lvbiogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2V1BTU3RhdGU6CisgICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICBwVGx2UHJlc2VudCA9ICgoIHREb3QxMWZUTFZXUFNTdGF0ZSogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2UDJQSW50ZXJmYWNlOgorICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSA2OworICAgICAgICAgICAgICAgICAgICAgICAgcFRsdlByZXNlbnQgPSAoKCB0RG90MTFmVExWUDJQSW50ZXJmYWNlKiApKHBGcm0gKyBwVGx2LT5vZmZzZXQpKS0+cHJlc2VudDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZQMlBNYW5hZ2VhYmlsaXR5OgorICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgcFRsdlByZXNlbnQgPSAoKCB0RG90MTFmVExWUDJQTWFuYWdlYWJpbGl0eSogKShwRnJtICsgcFRsdi0+b2Zmc2V0KSktPnByZXNlbnQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkxPR0UsIEZSRkwoIklOVEVSTkFMIEVSUk9SLS0gSSBkb24iCisgICAgICAgICAgICAgICAgICAgICIndCBrbm93IGFib3V0IHRoZSBUTFYgc2lnbmF0dXJlICVkOyB0aGlzIGlzIG1vc3QgbCIKKyAgICAgICAgICAgICAgICAgICAgImlrZWx5IGEgYnVnIGluICdmcmFtZXNjJy5cbiIpLCBwVGx2LT5zaWcpOworICAgICAgICAgICAgICAgIHJldHVybiBET1QxMUZfSU5URVJOQUxfRVJST1I7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZihwVGx2UHJlc2VudCkgeworICAgICAgICAgICAgICAqcG5OZWVkZWQgKz0gYnl0ZUNvdW50OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgICsrcFRsdjsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30KK3ZvaWQgZG90MTFmUGFja0ZmQUlEKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICB0RG90MTFmRmZBSUQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmKQoreworICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmFzc29jaWQsIDApOworICAgICh2b2lkKXBDdHg7Cit9IC8qIEVuZCBkb3QxMWZQYWNrRmZBSUQuICovCisKK3ZvaWQgZG90MTFmUGFja0ZmQWN0aW9uKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmRmZBY3Rpb24gKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmKQoreworICAgICpwQnVmID0gcFNyYy0+YWN0aW9uOworICAgICh2b2lkKXBDdHg7Cit9IC8qIEVuZCBkb3QxMWZQYWNrRmZBY3Rpb24uICovCisKK3ZvaWQgZG90MTFmUGFja0ZmQWRkQkFQYXJhbWV0ZXJTZXQodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkZmQWRkQkFQYXJhbWV0ZXJTZXQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYpCit7CisgICAgdEFOSV9VMTYgdG1wODFfXzsKKyAgICB0bXA4MV9fID0gMFU7CisgICAgdG1wODFfXyB8PSAoIHBTcmMtPmFtc2R1U3VwcG9ydGVkIDw8IDAgKTsKKyAgICB0bXA4MV9fIHw9ICggcFNyYy0+cG9saWN5IDw8IDEgKTsKKyAgICB0bXA4MV9fIHw9ICggcFNyYy0+dGlkIDw8IDIgKTsKKyAgICB0bXA4MV9fIHw9ICggcFNyYy0+YnVmZmVyU2l6ZSA8PCA2ICk7CisgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgdG1wODFfXywgMCk7CisgICAgKHZvaWQpcEN0eDsKK30gLyogRW5kIGRvdDExZlBhY2tGZkFkZEJBUGFyYW1ldGVyU2V0LiAqLworCit2b2lkIGRvdDExZlBhY2tGZkF1dGhBbGdvKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZGZkF1dGhBbGdvICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmKQoreworICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmFsZ28sIDApOworICAgICh2b2lkKXBDdHg7Cit9IC8qIEVuZCBkb3QxMWZQYWNrRmZBdXRoQWxnby4gKi8KKwordm9pZCBkb3QxMWZQYWNrRmZBdXRoU2VxTm8odHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZGZkF1dGhTZXFObyAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYpCit7CisgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+bm8sIDApOworICAgICh2b2lkKXBDdHg7Cit9IC8qIEVuZCBkb3QxMWZQYWNrRmZBdXRoU2VxTm8uICovCisKK3ZvaWQgZG90MTFmUGFja0ZmQkFTdGFydGluZ1NlcXVlbmNlQ29udHJvbCh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZGZkJBU3RhcnRpbmdTZXF1ZW5jZUNvbnRyb2wgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZikKK3sKKyAgICB0QU5JX1UxNiB0bXA4Ml9fOworICAgIHRtcDgyX18gPSAwVTsKKyAgICB0bXA4Ml9fIHw9ICggcFNyYy0+ZnJhZ051bWJlciA8PCAwICk7CisgICAgdG1wODJfXyB8PSAoIHBTcmMtPnNzbiA8PCA0ICk7CisgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgdG1wODJfXywgMCk7CisgICAgKHZvaWQpcEN0eDsKK30gLyogRW5kIGRvdDExZlBhY2tGZkJBU3RhcnRpbmdTZXF1ZW5jZUNvbnRyb2wuICovCisKK3ZvaWQgZG90MTFmUGFja0ZmQkFUaW1lb3V0KHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmRmZCQVRpbWVvdXQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmKQoreworICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPnRpbWVvdXQsIDApOworICAgICh2b2lkKXBDdHg7Cit9IC8qIEVuZCBkb3QxMWZQYWNrRmZCQVRpbWVvdXQuICovCisKK3ZvaWQgZG90MTFmUGFja0ZmQmVhY29uSW50ZXJ2YWwodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkZmQmVhY29uSW50ZXJ2YWwgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYpCit7CisgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+aW50ZXJ2YWwsIDApOworICAgICh2b2lkKXBDdHg7Cit9IC8qIEVuZCBkb3QxMWZQYWNrRmZCZWFjb25JbnRlcnZhbC4gKi8KKwordm9pZCBkb3QxMWZQYWNrRmZDYXBhYmlsaXRpZXModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZGZkNhcGFiaWxpdGllcyAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYpCit7CisgICAgdEFOSV9VMTYgdG1wODNfXzsKKyAgICB0bXA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AgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmRmZDYXRlZ29yeSAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZikKK3sKKyAgICAqcEJ1ZiA9IHBTcmMtPmNhdGVnb3J5OworICAgICh2b2lkKXBDdHg7Cit9IC8qIEVuZCBkb3QxMWZQYWNrRmZDYXRlZ29yeS4gKi8KKwordm9pZCBkb3QxMWZQYWNrRmZDdXJyZW50QVBBZGRyZXNzKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkZmQ3VycmVudEFQQWRkcmVzcyAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmKQoreworICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+bWFjLCA2KTsKKyAgICAodm9pZClwQ3R4OworfSAvKiBFbmQgZG90MTFmUGFja0ZmQ3VycmVudEFQQWRkcmVzcy4gKi8KKwordm9pZCBkb3QxMWZQYWNrRmZEZWxCQVBhcmFtZXRlclNldCh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmRmZEZWxCQVBhcmFtZXRlclNldCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZikKK3sKKyAgICB0QU5JX1UxNiB0bXA4NF9fOworICAgIHRtcDg0X18gPSAwVTsKKyAgICB0bXA4NF9fIHw9ICggcFNyYy0+cmVzZXJ2ZWQgPDwgMCApOworICAgIHRtcDg0X18gfD0gKCBwU3JjLT5pbml0aWF0b3IgPDwgMTEgKTsKKyAgICB0bXA4NF9fIHw9ICggcFNyYy0+dGlkIDw8IDEyICk7CisgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgdG1wODRfXywgMCk7CisgICAgKHZvaWQpcEN0eDsKK30gLyogRW5kIGRvdDExZlBhY2tGZkRlbEJBUGFyYW1ldGVyU2V0LiAqLworCit2b2lkIGRvdDExZlBhY2tGZkRpYWxvZ1Rva2VuKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZGZkRpYWxvZ1Rva2VuICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmKQoreworICAgICpwQnVmID0gcFNyYy0+dG9rZW47CisgICAgKHZvaWQpcEN0eDsKK30gLyogRW5kIGRvdDExZlBhY2tGZkRpYWxvZ1Rva2VuLiAqLworCit2b2lkIGRvdDExZlBhY2tGZkxpbmtNYXJnaW4odHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmRmZMaW5rTWFyZ2luICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYpCit7CisgICAgKnBCdWYgPSBwU3JjLT5saW5rTWFyZ2luOworICAgICh2b2lkKXBDdHg7Cit9IC8qIEVuZCBkb3QxMWZQYWNrRmZMaW5rTWFyZ2luLiAqLworCit2b2lkIGRvdDExZlBhY2tGZkxpc3RlbkludGVydmFsKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZGZkxpc3RlbkludGVydmFsICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmKQoreworICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmludGVydmFsLCAwKTsKKyAgICAodm9pZClwQ3R4OworfSAvKiBFbmQgZG90MTFmUGFja0ZmTGlzdGVuSW50ZXJ2YWwuICovCisKK3ZvaWQgZG90MTFmUGFja0ZmTWF4VHhQb3dlcih0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZGZk1heFR4UG93ZXIgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZikKK3sKKyAgICAqcEJ1ZiA9IHBTcmMtPm1heFR4UG93ZXI7CisgICAgKHZvaWQpcEN0eDsKK30gLyogRW5kIGRvdDExZlBhY2tGZk1heFR4UG93ZXIuICovCisKK3ZvaWQgZG90MTFmUGFja0ZmTnVtT2ZSZXBldGl0aW9ucyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZGZk51bU9mUmVwZXRpdGlvbnMgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZikKK3sKKyAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5yZXBldGl0aW9ucywgMCk7CisgICAgKHZvaWQpcEN0eDsKK30gLyogRW5kIGRvdDExZlBhY2tGZk51bU9mUmVwZXRpdGlvbnMuICovCisKK3ZvaWQgZG90MTFmUGFja0ZmT3BlcmF0aW5nTW9kZSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZGZk9wZXJhdGluZ01vZGUgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZikKK3sKKyAgICB0QU5JX1U4IHRtcDg1X187CisgICAgdG1wODVfXyA9IDBVOworICAgIHRtcDg1X18gfD0gKCBwU3JjLT5jaGFuV2lkdGggPDwgMCApOworICAgIHRtcDg1X18gfD0gKCBwU3JjLT5yZXNlcnZlZCA8PCAyICk7CisgICAgdG1wODVfXyB8PSAoIHBTcmMtPnJ4TlNTIDw8IDQgKTsKKyAgICB0bXA4NV9fIHw9ICggcFNyYy0+cnhOU1NUeXBlIDw8IDcgKTsKKyAgICAqcEJ1ZiA9IHRtcDg1X187CisgICAgKHZvaWQpcEN0eDsKK30gLyogRW5kIGRvdDExZlBhY2tGZk9wZXJhdGluZ01vZGUuICovCisKK3ZvaWQgZG90MTFmUGFja0ZmUDJQT1VJKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmRmZQMlBPVUkgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmKQoreworICAgIGZyYW1lc2h0b25sKHBDdHgsIHBCdWYsIHBTcmMtPm91aSwgMCk7CisgICAgKHZvaWQpcEN0eDsKK30gLyogRW5kIGRvdDExZlBhY2tGZlAyUE9VSS4gKi8KKwordm9pZCBkb3QxMWZQYWNrRmZQMlBPVUlTdWJUeXBlKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkZmUDJQT1VJU3ViVHlwZSAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmKQoreworICAgICpwQnVmID0gcFNyYy0+b3VpU3VidHlwZTsKKyAgICAodm9pZClwQ3R4OworfSAvKiBFbmQgZG90MTFmUGFja0ZmUDJQT1VJU3ViVHlwZS4gKi8KKwordm9pZCBkb3QxMWZQYWNrRmZSQ1BJKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkZmUkNQSSAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmKQoreworICAgICpwQnVmID0gcFNyYy0+cmNwaTsKKyAgICAodm9pZClwQ3R4OworfSAvKiBFbmQgZG90MTFmUGFja0ZmUkNQSS4gKi8KKwordm9pZCBkb3QxMWZQYWNrRmZSU05JKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkZmUlNOSSAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmKQoreworICAgICpwQnVmID0gcFNyYy0+cnNuaTsKKyAgICAodm9pZClwQ3R4OworfSAvKiBFbmQgZG90MTFmUGFja0ZmUlNOSS4gKi8KKwordm9pZCBkb3QxMWZQYWNrRmZSZWFzb24odHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZGZlJlYXNvbiAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYpCit7CisgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+Y29kZSwgMCk7CisgICAgKHZvaWQpcEN0eDsKK30gLyogRW5kIGRvdDExZlBhY2tGZlJlYXNvbi4gKi8KKwordm9pZCBkb3QxMWZQYWNrRmZSeEFudGVubmFJZCh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmRmZSeEFudGVubmFJZCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZikKK3sKKyAgICAqcEJ1ZiA9IHBTcmMtPmFudGVubmFJZDsKKyAgICAodm9pZClwQ3R4OworfSAvKiBFbmQgZG90MTFmUGFja0ZmUnhBbnRlbm5hSWQuICovCisKK3ZvaWQgZG90MTFmUGFja0ZmU01Qb3dlck1vZGVTZXQodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkZmU01Qb3dlck1vZGVTZXQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYpCit7CisgICAgdEFOSV9VOCB0bXA4Nl9fOworICAgIHRtcDg2X18gPSAwVTsKKyAgICB0bXA4Nl9fIHw9ICggcFNyYy0+UG93ZXJTYXZlX0VuIDw8IDAgKTsKKyAgICB0bXA4Nl9fIHw9ICggcFNyYy0+TW9kZSA8PCAxICk7CisgICAgdG1wODZfXyB8PSAoIHBTcmMtPnJlc2VydmVkIDw8IDIgKTsKKyAgICAqcEJ1ZiA9IHRtcDg2X187CisgICAgKHZvaWQpcEN0eDsKK30gLyogRW5kIGRvdDExZlBhY2tGZlNNUG93ZXJNb2RlU2V0LiAqLworCit2b2lkIGRvdDExZlBhY2tGZlN0YXR1cyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkZmU3RhdHVzICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZikKK3sKKyAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5zdGF0dXMsIDApOworICAgICh2b2lkKXBDdHg7Cit9IC8qIEVuZCBkb3QxMWZQYWNrRmZTdGF0dXMuICovCisKK3ZvaWQgZG90MTFmUGFja0ZmU3RhdHVzQ29kZSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZGZlN0YXR1c0NvZGUgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZikKK3sKKyAgICAqcEJ1ZiA9IHBTcmMtPnN0YXR1c0NvZGU7CisgICAgKHZvaWQpcEN0eDsKK30gLyogRW5kIGRvdDExZlBhY2tGZlN0YXR1c0NvZGUuICovCisKK3ZvaWQgZG90MTFmUGFja0ZmVFBDRWxlSUQodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZkZmVFBDRWxlSUQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYpCit7CisgICAgKnBCdWYgPSBwU3JjLT5UUENJZDsKKyAgICAodm9pZClwQ3R4OworfSAvKiBFbmQgZG90MTFmUGFja0ZmVFBDRWxlSUQuICovCisKK3ZvaWQgZG90MTFmUGFja0ZmVFBDRWxlTGVuKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmRmZUUENFbGVMZW4gKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmKQoreworICAgICpwQnVmID0gcFNyYy0+VFBDTGVuOworICAgICh2b2lkKXBDdHg7Cit9IC8qIEVuZCBkb3QxMWZQYWNrRmZUUENFbGVMZW4uICovCisKK3ZvaWQgZG90MTFmUGFja0ZmVFNJbmZvKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmRmZUU0luZm8gKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmKQoreworICAgIHRBTklfVTMyIHRtcDg3X187CisgICAgdG1wODdfXyA9IDBVOworICAgIHRtcDg3X18gfD0gKCBwU3JjLT50cmFmZmljX3R5cGUgPDwgMCApOworICAgIHRtcDg3X18gfD0gKCBwU3JjLT50c2lkIDw8IDEgKTsKKyAgICB0bXA4N19fIHw9ICggcFNyYy0+ZGlyZWN0aW9uIDw8IDUgKTsKKyAgICB0bXA4N19fIHw9ICggcFNyYy0+YWNjZXNzX3BvbGljeSA8PCA3ICk7CisgICAgdG1wODdfXyB8PSAoIHBTcmMtPmFnZ3JlZ2F0aW9uIDw8IDkgKTsKKyAgICB0bXA4N19fIHw9ICggcFNyYy0+cHNiIDw8IDEwICk7CisgICAgdG1wODdfXyB8PSAoIHBTcmMtPnVzZXJfcHJpb3JpdHkgPDwgMTEgKTsKKyAgICB0bXA4N19fIHw9ICggcFNyYy0+dHNpbmZvX2Fja19wb2wgPDwgMTQgKTsKKyAgICB0bXA4N19fIHw9ICggcFNyYy0+c2NoZWR1bGUgPDwgMTYgKTsKKyAgICB0bXA4N19fIHw9ICggcFNyYy0+dW51c2VkIDw8IDE3ICk7CisgICAgZnJhbWVzaHRvbmwocEN0eCwgcEJ1ZiwgdG1wODdfXywgMCk7CisgICAgKHZvaWQpcEN0eDsKK30gLyogRW5kIGRvdDExZlBhY2tGZlRTSW5mby4gKi8KKwordm9pZCBkb3QxMWZQYWNrRmZUaW1lU3RhbXAodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZGZlRpbWVTdGFtcCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYpCit7CisgICAgZnJhbWVzaHRvbnEocEN0eCwgcEJ1ZiwgcFNyYy0+dGltZXN0YW1wLCAwKTsKKyAgICAodm9pZClwQ3R4OworfSAvKiBFbmQgZG90MTFmUGFja0ZmVGltZVN0YW1wLiAqLworCit2b2lkIGRvdDExZlBhY2tGZlRyYW5zYWN0aW9uSWQodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmRmZUcmFuc2FjdGlvbklkICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYpCit7CisgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCBwU3JjLT50cmFuc0lkLCAyKTsKKyAgICAodm9pZClwQ3R4OworfSAvKiBFbmQgZG90MTFmUGFja0ZmVHJhbnNhY3Rpb25JZC4gKi8KKwordm9pZCBkb3QxMWZQYWNrRmZUeEFudGVubmFJZCh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmRmZUeEFudGVubmFJZCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZikKK3sKKyAgICAqcEJ1ZiA9IHBTcmMtPmFudGVubmFJZDsKKyAgICAodm9pZClwQ3R4OworfSAvKiBFbmQgZG90MTFmUGFja0ZmVHhBbnRlbm5hSWQuICovCisKK3ZvaWQgZG90MTFmUGFja0ZmVHhQb3dlcih0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZGZlR4UG93ZXIgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZikKK3sKKyAgICAqcEJ1ZiA9IHBTcmMtPnR4UG93ZXI7CisgICAgKHZvaWQpcEN0eDsKK30gLyogRW5kIGRvdDExZlBhY2tGZlR4UG93ZXIuICovCisKK3ZvaWQgZG90MTFmUGFja0ZmVmh0TWVtYmVyc2hpcFN0YXR1c0FycmF5KHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmRmZWaHRNZW1iZXJzaGlwU3RhdHVzQXJyYXkgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmKQoreworICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+bWVtYmVyc2hpcFN0YXR1c0FycmF5LCA4KTsKKyAgICAodm9pZClwQ3R4OworfSAvKiBFbmQgZG90MTFmUGFja0ZmVmh0TWVtYmVyc2hpcFN0YXR1c0FycmF5LiAqLworCit2b2lkIGRvdDExZlBhY2tGZlZodFVzZXJQb3NpdGlvbkFycmF5KHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZGZlZodFVzZXJQb3NpdGlvbkFycmF5ICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmKQoreworICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+dXNlclBvc2l0aW9uQXJyYXksIDE2KTsKKyAgICAodm9pZClwQ3R4OworfSAvKiBFbmQgZG90MTFmUGFja0ZmVmh0VXNlclBvc2l0aW9uQXJyYXkuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tUbHZBdXRob3JpemVkTUFDcyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZUTFZBdXRob3JpemVkTUFDcyAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcFRsdkxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICs9IDg7CisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICAqcEJ1ZiA9IDE7CisgICAgICAgIHBCdWYgKz0gMTsgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcFRsdkxlbiA9IHBCdWY7CisgICAgICAgIHBCdWYgKz0gMTsgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCBwU3JjLT5tYWMsIDYpOworICAgICAgICAqcG5Db25zdW1lZCArPSA2OworICAgICAgICBwQnVmICs9IDY7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwVGx2TGVuKQorICAgIHsKKyAgICAgICAgKnBUbHZMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrVGx2QXV0aG9yaXplZE1BQ3MuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tUbHZSZXF1ZXN0VG9FbnJvbGwodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZlRMVlJlcXVlc3RUb0Vucm9sbCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcFRsdkxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICs9IDM7CisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICAqcEJ1ZiA9IDM7CisgICAgICAgIHBCdWYgKz0gMTsgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcFRsdkxlbiA9IHBCdWY7CisgICAgICAgIHBCdWYgKz0gMTsgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5yZXE7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBUbHZMZW4pCisgICAgeworICAgICAgICAqcFRsdkxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tUbHZSZXF1ZXN0VG9FbnJvbGwuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tUbHZWZXJzaW9uMih0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZUTFZWZXJzaW9uMiAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcFRsdkxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICB0QU5JX1U4IHRtcDg4X187CisgICAgbk5lZWRlZCArPSAzOworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgKnBCdWYgPSAwOworICAgICAgICBwQnVmICs9IDE7ICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBUbHZMZW4gPSBwQnVmOworICAgICAgICBwQnVmICs9IDE7ICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHRtcDg4X18gPSAwVTsKKyAgICAgICAgdG1wODhfXyB8PSAoIHBTcmMtPm1pbm9yIDw8IDAgKTsKKyAgICAgICAgdG1wODhfXyB8PSAoIHBTcmMtPm1ham9yIDw8IDQgKTsKKyAgICAgICAgKnBCdWYgPSB0bXA4OF9fOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIG5CdWYgLT0gIDEgOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocFRsdkxlbikKKyAgICB7CisgICAgICAgICpwVGx2TGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja1RsdlZlcnNpb24yLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrVGx2QVBTZXR1cExvY2tlZCh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZlRMVkFQU2V0dXBMb2NrZWQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBUbHZMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCArPSA1OworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBCdWYsIDQxODMsIDEpOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBUbHZMZW4gPSBwQnVmOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgICpwQnVmID0gcFNyYy0+ZkxvY2tlZDsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocFRsdkxlbikKKyAgICB7CisgICAgICAgIGZyYW1lc2h0b25zKCBwQ3R4LCBwVGx2TGVuLCAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSA0LCAxKTsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja1RsdkFQU2V0dXBMb2NrZWQuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tUbHZBc3NvY2lhdGlvblN0YXRlKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmVExWQXNzb2NpYXRpb25TdGF0ZSAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcFRsdkxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICs9IDY7CisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcEJ1ZiwgNDA5OCwgMSk7CisgICAgICAgIHBCdWYgKz0gMjsgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgcFRsdkxlbiA9IHBCdWY7CisgICAgICAgIHBCdWYgKz0gMjsgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+c3RhdGUsIDEpOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwVGx2TGVuKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBUbHZMZW4sICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDQsIDEpOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrVGx2QXNzb2NpYXRpb25TdGF0ZS4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja1RsdkNoYW5uZWxMaXN0KHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZlRMVkNoYW5uZWxMaXN0ICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwVGx2TGVuID0gMDsK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hhbm5lbExpc3QuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tUbHZDb25maWdNZXRob2RzKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmVExWQ29uZmlnTWV0aG9kcyAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcFRsdkxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICs9IDY7CisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcEJ1ZiwgNDEwNCwgMSk7CisgICAgICAgIHBCdWYgKz0gMjsgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgcFRsdkxlbiA9IHBCdWY7CisgICAgICAgIHBCdWYgKz0gMjsgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+bWV0aG9kcywgMSk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBUbHZMZW4pCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcFRsdkxlbiwgKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gNCwgMSk7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tUbHZDb25maWdNZXRob2RzLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrVGx2Q29uZmlndXJhdGlvbkVycm9yKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZUTFZDb25maWd1cmF0aW9uRXJyb3IgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBUbHZMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCArPSA2OworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBCdWYsIDQxMDUsIDEpOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBUbHZMZW4gPSBwQnVmOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmVycm9yLCAxKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocFRsdkxlbikKKyAgICB7CisgICAgICAgIGZyYW1lc2h0b25zKCBwQ3R4LCBwVGx2TGVuLCAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSA0LCAxKTsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja1RsdkNvbmZpZ3VyYXRpb25FcnJvci4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja1RsdkNvbmZpZ3VyYXRpb25UaW1lb3V0KHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZlRMVkNvbmZpZ3VyYXRpb25UaW1lb3V0ICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwVGx2TGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgKz0gNTsKKyAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgICpwQnVmID0gNTsKKyAgICAgICAgcEJ1ZiArPSAxOyAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwVGx2TGVuID0gcEJ1ZjsKKyAgICAgICAgcEJ1ZiArPSAyOyAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPkdPQ29uZmlnVGltZW91dDsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPkNMQ29uZmlnVGltZW91dDsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocFRsdkxlbikKKyAgICB7CisgICAgICAgIGZyYW1lc2h0b25zKCBwQ3R4LCBwVGx2TGVuLCAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAzLCAwKTsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja1RsdkNvbmZpZ3VyYXRpb25UaW1lb3V0LiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrVGx2RGV2aWNlTmFtZSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZlRMVkRldmljZU5hbWUgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBUbHZMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCArPSAoIHBTcmMtPm51bV90ZXh0ICsgNCkgOworCisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcEJ1ZiwgNDExMywgMSk7CisgICAgICAgIHBCdWYgKz0gMjsgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgcFRsdkxlbiA9IHBCdWY7CisgICAgICAgIHBCdWYgKz0gMjsgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCAmKCBwU3JjLT50ZXh0ICksIHBTcmMtPm51bV90ZXh0KTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gcFNyYy0+bnVtX3RleHQ7CisgICAgICAgIHBCdWYgKz0gcFNyYy0+bnVtX3RleHQ7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwVGx2TGVuKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBUbHZMZW4sICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDQsIDEpOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrVGx2RGV2aWNlTmFtZS4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja1RsdkRldmljZVBhc3N3b3JkSUQodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZUTFZEZXZpY2VQYXNzd29yZElEICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAg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lTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmVExWRXh0ZW5kZWRMaXN0ZW5UaW1pbmcgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBUbHZMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCArPSA3OworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgKnBCdWYgPSA4OworICAgICAgICBwQnVmICs9IDE7ICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBUbHZMZW4gPSBwQnVmOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmF2YWlsaWJpbGl0eVBlcmlvZCwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+YXZhaWxpYmlsaXR5SW50ZXJ2YWwsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwVGx2TGVuKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBUbHZMZW4sICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDMsIDApOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrVGx2RXh0ZW5kZWRMaXN0ZW5UaW1pbmcuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tUbHZHT0ludGVudCh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZUTFZHT0ludGVudCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcFRsdkxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICs9IDQ7CisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICAqcEJ1ZiA9IDQ7CisgICAgICAgIHBCdWYgKz0gMTsgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcFRsdkxlbiA9IHBCdWY7CisgICAgICAgIHBCdWYgKz0gMjsgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5HT0ludGVudDsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocFRsdkxlbikKKyAgICB7CisgICAgICAgIGZyYW1lc2h0b25zKCBwQ3R4LCBwVGx2TGVuLCAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAzLCAwKTsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja1RsdkdPSW50ZW50LiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrVGx2SW50ZW5kZWRQMlBJbnRlcmZhY2VBZGRyZXNzKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZUTFZJbnRlbmRlZFAyUEludGVyZmFjZUFkZHJlc3MgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBUbHZMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCArPSA5OworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgKnBCdWYgPSA5OworICAgICAgICBwQnVmICs9IDE7ICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBUbHZMZW4gPSBwQnVmOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+UDJQSW50ZXJmYWNlQWRkcmVzcywgNik7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDY7CisgICAgICAgIHBCdWYgKz0gNjsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBUbHZMZW4pCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcFRsdkxlbiwgKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMywgMCk7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tUbHZJbnRlbmRlZFAyUEludGVyZmFjZUFkZHJlc3MuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tUbHZJbnZpdGF0aW9uRmxhZ3ModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZlRMVkludml0YXRpb25GbGFncyAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcFRsdkxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICs9IDQ7CisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICAqcEJ1ZiA9IDE4OworICAgICAgICBwQnVmICs9IDE7ICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBUbHZMZW4gPSBwQnVmOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgICpwQnVmID0gcFNyYy0+aW52aXRhdGlvbkZsYWdzOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwVGx2TGVuKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBUbHZMZW4sICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDMsIDApOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrVGx2SW52aXRhdGlvbkZsYWdzLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrVGx2TGlzdGVuQ2hhbm5lbCh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZlRMVkxpc3RlbkNoYW5uZWwgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBUbHZMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCArPSA4OworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgKnBCdWYgPSA2OworICAgICAgICBwQnVmICs9IDE7ICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBUbHZMZW4gPSBwQnVmOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+Y291bnRyeVN0cmluZywgMyk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDM7CisgICAgICAgIHBCdWYgKz0gMzsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5yZWd1bGF0b3J5Q2xhc3M7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5jaGFubmVsOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwVGx2TGVuKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBUbHZMZW4sICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDMsIDApOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrVGx2TGlzdGVuQ2hhbm5lbC4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja1Rsdk1hbnVmYWN0dXJlcih0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmVExWTWFudWZhY3R1cmVyICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwVGx2TGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgKz0gKCBwU3JjLT5udW1fbmFtZSArIDQpIDsKKworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBCdWYsIDQxMjksIDEpOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBUbHZMZW4gPSBwQnVmOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+bmFtZSApLCBwU3JjLT5udW1fbmFtZSk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IHBTcmMtPm51bV9uYW1lOworICAgICAgICBwQnVmICs9IHBTcmMtPm51bV9uYW1lOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocFRsdkxlbikKKyAgICB7CisgICAgICAgIGZyYW1lc2h0b25zKCBwQ3R4LCBwVGx2TGVuLCAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSA0LCAxKTsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja1Rsdk1hbnVmYWN0dXJlci4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja1Rsdk1pbm9yUmVhc29uQ29kZSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmVExWTWlub3JSZWFzb25Db2RlICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwVGx2TGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgKz0gNDsKKyAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgICpwQnVmID0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOyAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwVGx2TGVuID0gcEJ1ZjsKKyAgICAgICAgcEJ1ZiArPSAyOyAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPm1pbm9yUmVhc29uQ29kZTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocFRsdkxlbikKKyAgICB7CisgICAgICAgIGZyYW1lc2h0b25zKCBwQ3R4LCBwVGx2TGVuLCAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAzLCAwKTsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja1Rsdk1pbm9yUmVhc29uQ29kZS4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja1Rsdk1vZGVsTmFtZSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmVExWTW9kZWxOYW1lICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwVGx2TGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgKz0gKCBwU3JjLT5udW1fdGV4dCArIDQpIDsKKworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBCdWYsIDQxMzEsIDEpOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBUbHZMZW4gPSBwQnVmOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+dGV4dCApLCBwU3JjLT5udW1fdGV4dCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IHBTcmMtPm51bV90ZXh0OworICAgICAgICBwQnVmICs9IHBTcmMtPm51bV90ZXh0OworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocFRsdkxlbikKKyAgICB7CisgICAgICAgIGZyYW1lc2h0b25zKCBwQ3R4LCBwVGx2TGVuLCAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSA0LCAxKTsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja1Rsdk1vZGVsTmFtZS4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja1Rsdk1vZGVsTnVtYmVyKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZlRMVk1vZGVsTnVtYmVyICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwVGx2TGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgKz0gKCBwU3JjLT5udW1fdGV4dCArIDQpIDsKKworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBCdWYsIDQxMzIsIDEpOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBUbHZMZW4gPSBwQnVmOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+dGV4dCApLCBwU3JjLT5udW1fdGV4dCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IHBTcmMtPm51bV90ZXh0OworICAgICAgICBwQnVmICs9IHBTcmMtPm51bV90ZXh0OworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocFRsdkxlbikKKyAgICB7CisgICAgICAgIGZyYW1lc2h0b25zKCBwQ3R4LCBwVGx2TGVuLCAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSA0LCAxKTsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja1Rsdk1vZGVsTnVtYmVyLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrVGx2Tm90aWNlT2ZBYnNlbmNlKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZUTFZOb3RpY2VPZkFic2VuY2UgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBUbHZMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCArPSAoIHBTcmMtPm51bV9Ob0FEZXNjICsgNSkgOworCisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICAqcEJ1ZiA9IDEyOworICAgICAgICBwQnVmICs9IDE7ICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBUbHZMZW4gPSBwQnVmOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgICpwQnVmID0gcFNyYy0+aW5kZXg7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5DVFNXaW5kb3dPcHBQUzsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsICYoIHBTcmMtPk5vQURlc2MgKSwgcFNyYy0+bnVtX05vQURlc2MpOworICAgICAgICAqcG5Db25zdW1lZCArPSBwU3JjLT5udW1fTm9BRGVzYzsKKyAgICAgICAgcEJ1ZiArPSBwU3JjLT5udW1fTm9BRGVzYzsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBUbHZMZW4pCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcFRsdkxlbiwgKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMywgMCk7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tUbHZOb3RpY2VPZkFic2VuY2UuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tUbHZPcGVyYXRpbmdDaGFubmVsKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmVExWT3BlcmF0aW5nQ2hhbm5lbCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcFRsdkxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICs9IDg7CisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICAqcEJ1ZiA9IDE3OworICAgICAgICBwQnVmICs9IDE7ICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBUbHZMZW4gPSBwQnVmOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+Y291bnRyeVN0cmluZywgMyk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDM7CisgICAgICAgIHBCdWYgKz0gMzsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5yZWd1bGF0b3J5Q2xhc3M7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5jaGFubmVsOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwVGx2TGVuKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBUbHZMZW4sICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDMsIDApOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrVGx2T3BlcmF0aW5nQ2hhbm5lbC4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja1RsdlAyUENhcGFiaWxpdHkodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZUTFZQMlBDYXBhYmlsaXR5ICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwVGx2TGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgKz0gNTsKKyAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgICpwQnVmID0gMjsKKyAgICAgICAgcEJ1ZiArPSAxOyAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwVGx2TGVuID0gcEJ1ZjsKKyAgICAgICAgcEJ1ZiArPSAyOyAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPmRldmljZUNhcGFiaWxpdHk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5ncm91cENhcGFiaWxpdHk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBUbHZMZW4pCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcFRsdkxlbiwgKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMywgMCk7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tUbHZQMlBDYXBhYmlsaXR5LiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrVGx2UDJQRGV2aWNlSWQodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmVExWUDJQRGV2aWNlSWQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBUbHZMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCArPSA5OworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgKnBCdWYgPSAzOworICAgICAgICBwQnVmICs9IDE7ICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBUbHZMZW4gPSBwQnVmOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+UDJQRGV2aWNlQWRkcmVzcywgNik7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDY7CisgICAgICAgIHBCdWYgKz0gNjsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBUbHZMZW4pCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcFRsdkxlbiwgKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMywgMCk7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tUbHZQMlBEZXZpY2VJZC4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja1RsdlAyUERldmljZUluZm8odHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZUTFZQMlBEZXZpY2VJbmZvICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwVGx2TG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CisgICAgICAgICAgcG5Db25zdW1lZCwKKyAgICAgICAgICBUTFZTX1AyUERldmljZUluZm8sICZpZHgpOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocFRsdkxlbikKKyAgICB7CisgICAgICAgIGZyYW1lc2h0b25zKCBwQ3R4LCBwVGx2TGVuLCAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAzLCAwKTsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlBhY2tUbHZQMlBEZXZpY2VJbmZvLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrVGx2UDJQR3JvdXBCc3NpZCh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZlRMVlAyUEdyb3VwQnNzaWQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBUbHZMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCArPSA5OworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgKnBCdWYgPSA3OworICAgICAgICBwQnVmICs9IDE7ICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBUbHZMZW4gPSBwQnVmOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+UDJQR3JvdXBCc3NpZCwgNik7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDY7CisgICAgICAgIHBCdWYgKz0gNjsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBUbHZMZW4pCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcFRsdkxlbiwgKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMywgMCk7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tUbHZQMlBHcm91cEJzc2lkLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrVGx2UDJQR3JvdXBJZCh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZlRMVlAyUEdyb3VwSWQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBUbHZMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCArPSAoIHBTcmMtPm51bV9zc2lkICsgOSkgOworCisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICAqcEJ1ZiA9IDE1OworICAgICAgICBwQnVmICs9IDE7ICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBUbHZMZW4gPSBwQnVmOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+ZGV2aWNlQWRkcmVzcywgNik7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDY7CisgICAgICAgIHBCdWYgKz0gNjsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCAmKCBwU3JjLT5zc2lkICksIHBTcmMtPm51bV9zc2lkKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gcFNyYy0+bnVtX3NzaWQ7CisgICAgICAgIHBCdWYgKz0gcFNyYy0+bnVtX3NzaWQ7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwVGx2TGVuKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBUbHZMZW4sICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDMsIDApOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrVGx2UDJQR3JvdXBJZC4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja1RsdlAyUEdyb3VwSW5mbyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmVExWUDJQR3JvdXBJbmZvICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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ZG90MTFmUGFja1RsdlAyUFN0YXR1cyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmVExWUDJQU3RhdHVzICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwVGx2TGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgKz0gNDsKKyAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgICpwQnVmID0gMDsKKyAgICAgICAgcEJ1ZiArPSAxOyAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwVGx2TGVuID0gcEJ1ZjsKKyAgICAgICAgcEJ1ZiArPSAyOyAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnN0YXR1czsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocFRsdkxlbikKKyAgICB7CisgICAgICAgIGZyYW1lc2h0b25zKCBwQ3R4LCBwVGx2TGVuLCAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAzLCAwKTsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja1RsdlAyUFN0YXR1cy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja1RsdlByaW1hcnlEZXZpY2VUeXBlKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZlRMVlByaW1hcnlEZXZpY2VUeXBlICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwVGx2TGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgKz0gMTI7CisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcEJ1ZiwgNDE4MCwgMSk7CisgICAgICAgIHBCdWYgKz0gMjsgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgcFRsdkxlbiA9IHBCdWY7CisgICAgICAgIHBCdWYgKz0gMjsgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+cHJpbWFyeV9jYXRlZ29yeSwgMSk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCBwU3JjLT5vdWksIDQpOworICAgICAgICAqcG5Db25zdW1lZCArPSA0OworICAgICAgICBwQnVmICs9IDQ7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPnN1Yl9jYXRlZ29yeSwgMSk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBUbHZMZW4pCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcFRsdkxlbiwgKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gNCwgMSk7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tUbHZQcmltYXJ5RGV2aWNlVHlwZS4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja1RsdlJGQmFuZHModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZUTFZSRkJhbmRzICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwVGx2TGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgKz0gNTsKKyAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGZyYW1lc2h0b25zKCBwQ3R4LCBwQnVmLCA0MTU2LCAxKTsKKyAgICAgICAgcEJ1ZiArPSAyOyAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwVGx2TGVuID0gcEJ1ZjsKKyAgICAgICAgcEJ1ZiArPSAyOyAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPmJhbmRzOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwVGx2TGVuKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBUbHZMZW4sICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDQsIDEpOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrVGx2UkZCYW5kcy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja1RsdlJlcXVlc3REZXZpY2VUeXBlKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZlRMVlJlcXVlc3REZXZpY2VUeXBlICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwVGx2TGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9V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XVlc3RUeXBlKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZlRMVlJlcXVlc3RUeXBlICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwVGx2TGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgKz0gNTsKKyAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGZyYW1lc2h0b25zKCBwQ3R4LCBwQnVmLCA0MTU0LCAxKTsKKyAgICAgICAgcEJ1ZiArPSAyOyAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwVGx2TGVuID0gcEJ1ZjsKKyAgICAgICAgcEJ1ZiArPSAyOyAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnJlcVR5cGU7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBUbHZMZW4pCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcFRsdkxlbiwgKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gNCwgMSk7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tUbHZSZXF1ZXN0VHlwZS4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja1RsdlJlc3BvbnNlVHlwZSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmVExWUmVzcG9uc2VUeXBlICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwVGx2TGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgKz0gNTsKKyAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGZyYW1lc2h0b25zKCBwQ3R4LCBwQnVmLCA0MTU1LCAxKTsKKyAgICAgICAgcEJ1ZiArPSAyOyAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwVGx2TGVuID0gcEJ1ZjsKKyAgICAgICAgcEJ1ZiArPSAyOyAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnJlc1R5cGU7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBUbHZMZW4pCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcFRsdkxlbiwgKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gNCwgMSk7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tUbHZSZXNwb25zZVR5cGUuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tUbHZTZWxlY3RlZFJlZ2lzdHJhcih0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZUTFZTZWxlY3RlZFJlZ2lzdHJhciAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcFRsdkxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICs9IDU7CisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcEJ1ZiwgNDE2MSwgMSk7CisgICAgICAgIHBCdWYgKz0gMjsgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgcFRsdkxlbiA9IHBCdWY7CisgICAgICAgIHBCdWYgKz0gMjsgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5zZWxlY3RlZDsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocFRsdkxlbikKKyAgICB7CisgICAgICAgIGZyYW1lc2h0b25zKCBwQ3R4LCBwVGx2TGVuLCAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSA0LCAxKTsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja1RsdlNlbGVjdGVkUmVnaXN0cmFyLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrVGx2U2VsZWN0ZWRSZWdpc3RyYXJDb25maWdNZXRob2RzKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZUTFZTZWxlY3RlZFJlZ2lzdHJhckNvbmZpZ01ldGhvZHMgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBUbHZMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCArPSA2OworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBCdWYsIDQxNzksIDEpOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBUbHZMZW4gPSBwQnVmOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPm1ldGhvZHMsIDEpOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwVGx2TGVuKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBUbHZMZW4sICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDQsIDEpOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrVGx2U2VsZWN0ZWRSZWdpc3RyYXJDb25maWdNZXRob2RzLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrVGx2U2VyaWFsTnVtYmVyKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZUTFZTZXJpYWxOdW1iZXIgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBUbHZMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsK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gIHREb3QxMWZUTFZVVUlEX1IgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBUbHZMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCArPSAyMDsKKyAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGZyYW1lc2h0b25zKCBwQ3R4LCBwQnVmLCA0MTY4LCAxKTsKKyAgICAgICAgcEJ1ZiArPSAyOyAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwVGx2TGVuID0gcEJ1ZjsKKyAgICAgICAgcEJ1ZiArPSAyOyAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsIHBTcmMtPnV1aWQsIDE2KTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTY7CisgICAgICAgIHBCdWYgKz0gMTY7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwVGx2TGVuKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBUbHZMZW4sICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDQsIDEpOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrVGx2VVVJRF9SLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrVGx2VmVuZG9yRXh0ZW5zaW9uKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZUTFZWZW5kb3JFeHRlbnNpb24gKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBUbHZMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBzdGF0dXMgPSBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgdEFOSV9VMzIgaWR4ID0gMDsKKyAgICBuTmVlZGVkICs9IDc7CisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcEJ1ZiwgNDE2OSwgMSk7CisgICAgICAgIHBCdWYgKz0gMjsgbkJ1ZiAtPSAyOyAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwVGx2TGVuID0gcEJ1ZjsKKyAgICAgICAgcEJ1ZiArPSAyOyBuQnVmIC09IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+dmVuZG9ySWQsIDMpOworICAgICAgICAqcG5Db25zdW1lZCArPSAzOworICAgICAgICBwQnVmICs9IDM7CisgICAgICAgIHN0YXR1cyB8PSBQYWNrVGx2Q29yZShwQ3R4LAorICAgICAgICAgICh0QU5JX1U4KilwU3JjLAorICAgICAgICAgIHBCdWYsCisgICAgICAgICAgbkJ1ZiwKKyAgICAgICAgICBwbkNvbnN1bWVkLAorICAgICAgICAgIFRMVlNfVmVuZG9yRXh0ZW5zaW9uLCAmaWR4KTsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBUbHZMZW4pCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcFRsdkxlbiwgKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gNCwgMSk7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZQYWNrVGx2VmVuZG9yRXh0ZW5zaW9uLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrVGx2VmVyc2lvbih0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZlRMVlZlcnNpb24gKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBUbHZMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgdEFOSV9VOCB0bXA4OV9fOworICAgIG5OZWVkZWQgKz0gNTsKKyAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGZyYW1lc2h0b25zKCBwQ3R4LCBwQnVmLCA0MTcwLCAxKTsKKyAgICAgICAgcEJ1ZiArPSAyOyAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwVGx2TGVuID0gcEJ1ZjsKKyAgICAgICAgcEJ1ZiArPSAyOyAqcG5Db25zdW1lZCArPSAyOworICAgICAgICB0bXA4OV9fID0gMFU7CisgICAgICAgIHRtcDg5X18gfD0gKCBwU3JjLT5taW5vciA8PCAwICk7CisgICAgICAgIHRtcDg5X18gfD0gKCBwU3JjLT5tYWpvciA8PCA0ICk7CisgICAgICAgICpwQnVmID0gdG1wODlfXzsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBuQnVmIC09ICAxIDsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBUbHZMZW4pCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcFRsdkxlbiwgKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gNCwgMSk7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tUbHZWZXJzaW9uLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrVGx2V1BTU3RhdGUodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmVExWV1BTU3RhdGUgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBUbHZMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCArPSA1OworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBCdWYsIDQxNjQsIDEpOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBUbHZMZW4gPSBwQnVmOworICAgICAgICBwQnVmICs9IDI7ICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgICpwQnVmID0gcFNyYy0+c3RhdGU7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBUbHZMZW4pCisgICAgeworICAgICAgICBmcmFtZXNodG9ucyggcEN0eCwgcFRsdkxlbiwgKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gNCwgMSk7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tUbHZXUFNTdGF0ZS4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja1RsdlAyUEludGVyZmFjZSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmVExWUDJQSW50ZXJmYWNlICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgIC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Z2VhYmlsaXR5ICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwVGx2TGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgKz0gNDsKKyAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgICpwQnVmID0gMTA7CisgICAgICAgIHBCdWYgKz0gMTsgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcFRsdkxlbiA9IHBCdWY7CisgICAgICAgIHBCdWYgKz0gMjsgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5tYW5hZ2VhYmlsaXR5OworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwVGx2TGVuKQorICAgIHsKKyAgICAgICAgZnJhbWVzaHRvbnMoIHBDdHgsIHBUbHZMZW4sICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDMsIDApOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrVGx2UDJQTWFuYWdlYWJpbGl0eS4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llQVBOYW1lKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFQVBOYW1lICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gIHBTcmMtPm51bV9uYW1lOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gMTsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsICYoIHBTcmMtPm5hbWUgKSwgcFNyYy0+bnVtX25hbWUpOworICAgICAgICAqcG5Db25zdW1lZCArPSBwU3JjLT5udW1fbmFtZTsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVBUE5hbWUuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZUJQSW5kaWNhdG9yKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVCUEluZGljYXRvciAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9IDI7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSA0OworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gcFNyYy0+aW5kaWNhdG9yOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICpwQnVmID0gcFNyYy0+dHlwZTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVCUEluZGljYXRvci4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llQ29uZGVuc2VkQ291bnRyeVN0cih0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVDb25kZW5zZWRDb3VudHJ5U3RyICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gMjsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDI7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCBwU3JjLT5jb3VudHJ5U3RyLCAyKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVDb25kZW5zZWRDb3VudHJ5U3RyLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVHVEsodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVHVEsgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICB0QU5JX1UxNiB0bXA5MF9fOworICAgIG5OZWVkZWQgICs9ICAocFNyYy0+bnVtX2tleSArIDExKTsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDI7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgdG1wOTBfXyA9IDBVOworICAgICAgICB0bXA5MF9fIHw9ICggcFNyYy0+a2V5SWQgPDwgMCApOworICAgICAgICB0bXA5MF9fIHw9ICggcFNyYy0+cmVzZXJ2ZWQgPDwgMiApOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCB0bXA5MF9fLCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICBuQnVmIC09ICAyIDsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5rZXlMZW5ndGg7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCBwU3JjLT5SU0MsIDgpOworICAgICAgICAqcG5Db25zdW1lZCArPSA4OworICAgICAgICBwQnVmICs9IDg7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+a2V5ICksIHBTcmMtPm51bV9rZXkpOworICAgICAgICAqcG5Db25zdW1lZCArPSBwU3JjLT5udW1fa2V5OworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZUdUSy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llSENGKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFSENGICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gMTsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDI7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5lbmFibGVkOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZUhDRi4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llSUdUSyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVJR1RLICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gMzM7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSA0OworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+a2V5SUQsIDIpOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+SVBOLCA2KTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gNjsKKyAgICAgICAgcEJ1ZiArPSA2OworICAgICAgICAqcEJ1ZiA9IHBTcmMtPmtleUxlbmd0aDsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsIHBTcmMtPmtleSwgMjQpOworICAgICAgICAqcG5Db25zdW1lZCArPSAyNDsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVJR1RLLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVMTEF0dHIodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVMTEF0dHIgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICArPSA0OworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gOTsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBmcmFtZXNodG9ubChwQ3R4LCBwQnVmLCBwU3JjLT5kZWZlcl90aHJlc2hvbGQsIDEpOworICAgICAgICAqcG5Db25zdW1lZCArPSA0OworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZUxMQXR0ci4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llTG9hZEJhbGFuY2UodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUxvYWRCYWxhbmNlICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gNzsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDg7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCBwU3JjLT5ic3NpZCwgNik7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDY7CisgICAgICAgIHBCdWYgKz0gNjsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5jaGFubmVsOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZUxvYWRCYWxhbmNlLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVMb2FkSW5mbyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFTG9hZEluZm8gKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICArPSA0OworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gNjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5udW1fc3RhcywgMSk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+Y2hhbm5lbF91dGlsLCAxKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVMb2FkSW5mby4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llUHJvcEFzc29jVHlwZSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVQcm9wQXNzb2NUeXBlICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gMTsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDc7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT50eXBlOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVByb3BBc3NvY1R5cGUuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVByb3BDYXBhYmlsaXR5KHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVQcm9wQ2FwYWJpbGl0eSAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9IDI7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAxMDsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5jYXBhYmlsaXR5LCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVQcm9wQ2FwYWJpbGl0eS4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llUHJvcENoYW5uU3dpdGNoQW5uKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUHJvcENoYW5uU3dpdGNoQW5uICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gNDsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDE1OworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gcFNyYy0+bW9kZTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnByaW1hcnlfY2hhbm5lbDsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnN1Yl9iYW5kOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICpwQnVmID0gcFNyYy0+Y2hhbm5lbF9zd2l0Y2hfY291bnQ7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llUHJvcENoYW5uU3dpdGNoQW5uLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVQcm9wRURDQVBhcmFtcyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUHJvcEVEQ0FQYXJhbXMgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICB0QU5JX1U4IHRtcDkxX187CisgICAgdEFOSV9VOCB0bXA5Ml9fOworICAgIHRBTklfVTggdG1wOTNfXzsKKyAgICB0QU5JX1U4IHRtcDk0X187CisgICAgdEFOSV9VOCB0bXA5NV9fOworICAgIHRBTklfVTggdG1wOTZfXzsKKyAgICB0QU5JX1U4IHRtcDk3X187CisgICAgdEFOSV9VOCB0bXA5OF9fOworICAgIG5OZWVkZWQgICs9IDE4OworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gMTI7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5xb3M7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAg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KCBwU3JjLT5hY2JrX2FjaSA8PCA1ICk7CisgICAgICAgIHRtcDkzX18gfD0gKCBwU3JjLT51bnVzZWQyIDw8IDcgKTsKKyAgICAgICAgKnBCdWYgPSB0bXA5M19fOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIG5CdWYgLT0gIDEgOworICAgICAgICB0bXA5NF9fID0gMFU7CisgICAgICAgIHRtcDk0X18gfD0gKCBwU3JjLT5hY2JrX21pbiA8PCAwICk7CisgICAgICAgIHRtcDk0X18gfD0gKCBwU3JjLT5hY2JrX21heCA8PCA0ICk7CisgICAgICAgICpwQnVmID0gdG1wOTRfXzsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBuQnVmIC09ICAxIDsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+YWNia190eG9wbGltaXQsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIHRtcDk1X18gPSAwVTsKKyAgICAgICAgdG1wOTVfXyB8PSAoIHBTcmMtPmFjdmlfYWlmc24gPDwgMCApOworICAgICAgICB0bXA5NV9fIHw9ICggcFNyYy0+YWN2aV9hY20gPDwgNCApOworICAgICAgICB0bXA5NV9fIHw9ICggcFNyYy0+YWN2aV9hY2kgPDwgNSApOworICAgICAgICB0bXA5NV9fIHw9ICggcFNyYy0+dW51c2VkMyA8PCA3ICk7CisgICAgICAgICpwQnVmID0gdG1wOTVfXzsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBuQnVmIC09ICAxIDsKKyAgICAgICAgdG1wOTZfXyA9IDBVOworICAgICAgICB0bXA5Nl9fIHw9ICggcFNyYy0+YWN2aV9taW4gPDwgMCApOworICAgICAgICB0bXA5Nl9fIHw9ICggc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sYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llUHJvcEVEQ0FQYXJhbXMuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVByb3BRdWlldEJTUyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVByb3BRdWlldEJTUyAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9IDY7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAxNjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnF1aWV0X2NvdW50OworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICpwQnVmID0gcFNyYy0+cXVpZXRfcGVyaW9kOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPnF1aWV0X2R1cmF0aW9uLCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5xdWlldF9vZmZzZXQsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVByb3BRdWlldEJTUy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llUHJvcFN1cHBSYXRlcyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVQcm9wU3VwcFJhdGVzICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gIHBTcmMtPm51bV9yYXRlczsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDA7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCAmKCBwU3JjLT5yYXRlcyApLCBwU3JjLT5udW1fcmF0ZXMpOworICAgICAgICAqcG5Db25zdW1lZCArPSBwU3JjLT5udW1fcmF0ZXM7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llUHJvcFN1cHBSYXRlcy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llUjBLSF9JRCh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVSMEtIX0lEICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gIHBTcmMtPm51bV9QTUtfUjBfSUQ7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAzOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+UE1LX1IwX0lEICksIHBTcmMtPm51bV9QTUtfUjBfSUQpOworICAgICAgICAqcG5Db25zdW1lZCArPSBwU3JjLT5udW1fUE1LX1IwX0lEOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVIwS0hfSUQuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVIxS0hfSUQodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUjFLSF9JRCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIC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MWZJRVRTRkluZm8gKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICArPSA0OworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gMTsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5Uc2ZPZmZzZXQsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPkJlYWNvbkludHZsLCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVUU0ZJbmZvLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVUYXVydXModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVUYXVydXMgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICB0QU5JX1UxNiB0bXA5OV9fOworICAgIG5OZWVkZWQgICs9IDY7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAxODsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5iYVRJREJpdG1hcCwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+YmFQb2xpY3ksIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIHRtcDk5X18gPSAwVTsKKyAgICAgICAgdG1wOTlfXyB8PSAoIHBTcmMtPmJhQnVmZmVyU2l6ZSA8PCAwICk7CisgICAgICAgIHRtcDk5X18gfD0gKCBwU3JjLT5yc3ZkIDw8IDEyICk7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHRtcDk5X18sIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnICA9IDEKKyAgICAgICAgbkJ1ZiAtPSAgMiA7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llVGF1cnVzLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVUaXRhbih0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFVGl0YW4gKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICArPSA0OworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gMTQ7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5jb25jYXRfdGNpZF9iaXRtYXA7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5jb21wcmVzc2lvbl90Y2lkX2JpdG1hcDsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNiX3N0YXRlOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICpwQnVmID0gcFNyYy0+cmV2X2Zjc19zdGF0ZTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVUaXRhbi4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llVHJpZ2dlclN0YUJnU2Nhbih0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVUcmlnZ2VyU3RhQmdTY2FuICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gMTsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDE3OworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gcFNyYy0+ZW5hYmxlOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVRyaWdnZXJTdGFCZ1NjYW4uICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVZlcnNpb24odHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFVmVyc2lvbiAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICA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AgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVWZXJzaW9uLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVXRFModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVXRFMgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICArPSAgcFNyYy0+bnVtX3dkc0RhdGE7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAzOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+d2RzRGF0YSApLCBwU3JjLT5udW1fd2RzRGF0YSk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IHBTcmMtPm51bV93ZHNEYXRhOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVdEUy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llQVBDaGFubmVsUmVwb3J0KHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFQVBDaGFubmVsUmVwb3J0ICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gIChwU3JjLT5udW1fY2hhbm5lbExpc3QgKyAxKTsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDUxOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gcFNyYy0+cmVndWxhdG9yeUNsYXNzOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+Y2hhbm5lbExpc3QgKSwgcFNyYy0+bnVtX2NoYW5uZWxMaXN0KTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gcFNyYy0+bnVtX2NoYW5uZWxMaXN0OworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZUFQQ2hhbm5lbFJlcG9ydC4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llQmNuUmVwb3J0aW5nRGV0YWlsKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFQmNuUmVwb3J0aW5nRGV0YWlsICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gMTsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDI7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5yZXBvcnRpbmdEZXRhaWw7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llQmNuUmVwb3J0aW5nRGV0YWlsLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVCZWFjb25SZXBvcnRGcm1Cb2R5KHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUJlYWNvblJlcG9ydEZybUJvZHkgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICArPSAgcFNyYy0+bnVtX3JlcG9ydGVkRmllbGRzOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gMTsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsICYoIHBTcmMtPnJlcG9ydGVkRmllbGRzICksIHBTcmMtPm51bV9yZXBvcnRlZEZpZWxkcyk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IHBTcmMtPm51bV9yZXBvcnRlZEZpZWxkczsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVCZWFjb25SZXBvcnRGcm1Cb2R5LiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVCZWFjb25SZXBvcnRpbmcodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVCZWFjb25SZXBvcnRpbmcgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICArPSAyOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gMTsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnJlcG9ydGluZ0NvbmRpdGlvbjsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnRocmVzaG9sZDsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVCZWFjb25SZXBvcnRpbmcuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZU1lYXN1cmVtZW50UGlsb3QodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFTWVhc3VyZW1lbnRQaWxvdCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9ICAocFNyYy0+bnVtX3ZlbmRvclNwZWNpZmljICsgMSk7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSA2NjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPm1lYXN1cmVtZW50UGlsb3Q7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCAmKCBwU3JjLT52ZW5kb3JTcGVjaWZpYyApLCBwU3JjLT5udW1fdmVuZG9yU3BlY2lmaWMpOworICAgICAgICAqcG5Db25zdW1lZCArPSBwU3JjLT5udW1fdmVuZG9yU3BlY2lmaWM7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llTWVhc3VyZW1lbnRQaWxvdC4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llTXVsdGlCc3NpZCh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVNdWx0aUJzc2lkICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gIChwU3JjLT5udW1fdmVuZG9yU3BlY2lmaWMgKyAxKTsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDcxOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gcFNyYy0+bWF4QlNTSURJbmRpY2F0b3I7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCAmKCBwU3JjLT52ZW5kb3JTcGVjaWZpYyApLCBwU3JjLT5udW1fdmVuZG9yU3BlY2lmaWMpOworICAgICAgICAqcG5Db25zdW1lZCArPSBwU3JjLT5udW1fdmVuZG9yU3BlY2lmaWM7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llTXVsdGlCc3NpZC4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llUklDRGF0YSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVSSUNEYXRhICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gNDsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDU3OworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gcFNyYy0+SWRlbnRpZmllcjsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnJlc291cmNlRGVzY0NvdW50OworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPnN0YXR1c0NvZGUsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVJJQ0RhdGEuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVJJQ0Rlc2NyaXB0b3IodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUklDRGVzY3JpcHRvciAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9ICAocFNyYy0+bnVtX3ZhcmlhYmxlRGF0YSArIDEpOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gNzU7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5yZXNvdXJjZVR5cGU7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCAmKCBwU3JjLT52YXJpYWJsZURhdGEgKSwgcFNyYy0+bnVtX3ZhcmlhYmxlRGF0YSk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IHBTcmMtPm51bV92YXJpYWJsZURhdGE7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llUklDRGVzY3JpcHRvci4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llUlJNRW5hYmxlZENhcCh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVSUk1FbmFibGVkQ2FwICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgdEFOSV9VOCB0bXAxMDBfXzsKKyAgICB0QU5JX1U4IHRtcDEwMV9fOworICAgIHRBTklfVTggdG1wMTAyX187CisgICAgdEFOSV9VOCB0bXAxMDNfXzsKKyAgICB0QU5JX1U4IHRtcDEwNF9fOworICAgIG5OZWVkZWQgICs9IDU7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSA3MDsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICB0bXAxMD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w9ICggcFNyYy0+QnNzQXZnQWNjZXNzRGVsYXkgPDwgNyApOworICAgICAgICAqcEJ1ZiA9IHRtcDEwM19fOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIG5CdWYgLT0gIDEgOworICAgICAgICB0bXAxMDRfXyA9IDBVOworICAgICAgICB0bXAxMDRfXyB8PSAoIHBTcmMtPkJTU0F2YWlsQWRtaXNzaW9uIDw8IDAgKTsKKyAgICAgICAgdG1wMTA0X18gfD0gKCBwU3JjLT5BbnRlbm5hSW5mb3JtYXRpb24gPDwgMSApOworICAgICAgICB0bXAxMDRfXyB8PSAoIHBTcmMtPnJlc2VydmVkIDw8IDIgKTsKKyAgICAgICAgKnBCdWYgPSB0bXAxMDRfXzsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyAgPSAxCisgICAgICAgIG5CdWYgLT0gIDEgOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVJSTUVuYWJsZWRDYXAuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVJlcXVlc3RlZEluZm8odHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUmVxdWVzdGVkSW5mbyAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgIC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AgICAgICAgICAgICAgIHREb3QxMWZJRVNTSUQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICArPSAgcFNyYy0+bnVtX3NzaWQ7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAwOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+c3NpZCApLCBwU3JjLT5udW1fc3NpZCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IHBTcmMtPm51bV9zc2lkOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVNTSUQuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVNjaGVkdWxlKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVTY2hlZHVsZSAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIHRBTklfVTE2IHRtcDEwNV9fOworICAgIG5OZWVkZWQgICs9IDE0OworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gMTU7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgdG1wMTA1X18gPSAwVTsKKyAgICAgICAgdG1wMTA1X18gfD0gKCBwU3JjLT5hZ2dyZWdhdGlvbiA8PCAwICk7CisgICAgICAgIHRtcDEwNV9fIHw9ICggcFNyYy0+dHNpZCA8PCAxICk7CisgICAgICAgIHRtcDEwNV9fIHw9ICggcFNyYy0+ZGlyZWN0aW9uIDw8IDUgKTsKKyAgICAgICAgdG1wMTA1X18gfD0gKCBwU3JjLT5yZXNlcnZlZCA8PCA3ICk7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHRtcDEwNV9fLCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICBuQnVmIC09ICAyIDsKKyAgICAgICAgZnJhbWVzaHRvbmwocEN0eCwgcEJ1ZiwgcFNyYy0+c2VydmljZV9zdGFydF90aW1lLCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gNDsKKyAgICAgICAgcEJ1ZiArPSA0OworICAgICAgICBmcmFtZXNodG9ubChwQ3R4LCBwQnVmLCBwU3JjLT5zZXJ2aWNlX2ludGVydmFsLCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gNDsKKyAgICAgICAgcEJ1ZiArPSA0OworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5tYXhfc2VydmljZV9kdXIsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPnNwZWNfaW50ZXJ2YWwsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVNjaGVkdWxlLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVUQ0xBUyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFVENMQVMgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICB0QU5JX1UzMiBzdGF0dXMgPSBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKKyAgICBzdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRJRVRDTEFTKHBDdHgsIHBTcmMsICZuTmVlZGVkKTsKKyAgICBpZiAoICEgRE9UMTFGX1NVQ0NFRURFRCggc3RhdHVzICkgKSByZXR1cm4gc3RhdHVzOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gMTQ7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT51c2VyX3ByaW9yaXR5OworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICpwQnVmID0gcFNyYy0+Y2xhc3NpZmllcl90eXBlOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICpwQnVmID0gcFNyYy0+Y2xhc3NpZmllcl9tYXNrOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIHN3aXRjaCAocFNyYy0+Y2xhc3NpZmllcl90eXBlKQorICAgICAgICB7CisgICAgICAgICAgICBjYXNlIDA6CisgICAgICAgICAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCBwU3JjLT5pbmZvLkV0aFBhcmFtcy5zb3VyY2UsIDYpOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDY7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSA2OworICAgICAgICAgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+aW5mby5FdGhQYXJhbXMuZGVzdCwgNik7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gNjsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDY7CisgICAgICAgICAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+aW5mby5FdGhQYXJhbXMudHlwZSwgMCk7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5pbmZvLklwUGFyYW1zLnZlcnNpb247CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgc3dpdGNoIChwU3JjLT5pbmZvLklwUGFyYW1zLnZlcnNpb24pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICAgICAgICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsIHBTcmMtPmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuc291cmNlLCA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDQ7CisgICAgICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDQ7CisgICAgICAgICAgICAgICAgICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsIHBTcmMtPmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuZGVzdCwgNCk7CisgICAgICAgICAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSA0OworICAgICAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSA0OworICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5zcmNfcG9ydCwgMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5kZXN0X3BvcnQsIDApOworICAgICAgICAgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5EU0NQOworICAgICAgICAgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5wcm90bzsKKyAgICAgICAgICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMucmVzZXJ2ZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgNjoKKyAgICAgICAgICAgICAgICAgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5zb3VyY2UsIDE2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE2OworICAgICAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSAxNjsKKyAgICAgICAgICAgICAgICAgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5kZXN0LCAxNik7CisgICAgICAgICAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxNjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBCdWYgKz0gMTY7CisgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLnNyY19wb3J0LCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmRlc3RfcG9ydCwgMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgICAgICAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCBwU3JjLT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmZsb3dfbGFiZWwsIDMpOworICAgICAgICAgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMzsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmluZm8uUGFyYW1zODAyMWRxLnRhZ190eXBlLCAwKTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVUQ0xBUy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llVENMQVNTUFJPQyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVUQ0xBU1NQUk9DICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gMTsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDQ0OworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gcFNyYy0+cHJvY2Vzc2luZzsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVUQ0xBU1NQUk9DLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVUU0RlbGF5KHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVRTRGVsYXkgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICArPSA0OworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gNDM7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgZnJhbWVzaHRvbmwocEN0eCwgcEJ1ZiwgcFNyYy0+ZGVsYXksIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSA0OworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVRTRGVsYXkuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVRTUEVDKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVUU1BFQyAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgIC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SApOworICAgICAgICB0bXAxMDZfXyB8PSAoIHBTcmMtPnRzaW5mb19hY2tfcG9sIDw8IDE0ICk7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHRtcDEwNl9fLCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICBuQnVmIC09ICAyIDsKKyAgICAgICAgdG1wMTA3X18gPSAwVTsKKyAgICAgICAgdG1wMTA3X18gfD0gKCBwU3JjLT5zY2hlZHVsZSA8PCAwICk7CisgICAgICAgIHRtcDEwN19fIHw9ICggcFNyYy0+dW51c2VkIDw8IDEgKTsKKyAgICAgICAgKnBCdWYgPSB0bXAxMDdfXzsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBuQnVmIC09ICAxIDsKKyAgICAgICAgdG1wMTA4X18gPSAwVTsKKyAgICAgICAgdG1wMTA4X18gfD0gKCBwU3JjLT5zaXplIDw8IDAgKTsKKyAgICAgICAgdG1wMTA4X18gfD0gKCBwU3JjLT5maXhlZCA8PCAxNSApOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCB0bXAxMDhfXywgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgbkJ1ZiAtPSAgMiA7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPm1heF9tc2R1X3NpemUsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIGZyYW1lc2h0b25sKHBDdHgsIHBCdWYsIHBTcmMtPm1pbl9zZXJ2aWNlX2ludCwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDQ7CisgICAgICAgIHBCdWYgKz0gNDsKKyAgICAgICAgZnJhbWVzaHRvbmwocEN0e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mcmFtZXNodG9ubChwQ3R4LCBwQnVmLCBwU3JjLT5kZWxheV9ib3VuZCwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDQ7CisgICAgICAgIHBCdWYgKz0gNDsKKyAgICAgICAgZnJhbWVzaHRvbmwocEN0eCwgcEJ1ZiwgcFNyYy0+bWluX3BoeV9yYXRlLCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gNDsKKyAgICAgICAgcEJ1ZiArPSA0OworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5zdXJwbHVzX2J3X2FsbG93YW5jZSwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+bWVkaXVtX3RpbWUsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVRTUEVDLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVXTU1TY2hlZHVsZSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFV01NU2NoZWR1bGUgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICB0QU5JX1UxNiB0bXAxMDlfXzsKKyAgICBuTmVlZGVkICArPSAxNTsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDIyMTsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4MDsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHg1MDsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHhmMjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHgyOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDk7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnZlcnNpb247CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgdG1wMTA5X18gPSAwVTsKKyAgICAgICAgdG1wMTA5X18gfD0gKCBwU3JjLT5hZ2dyZWdhdGlvbiA8PCAwICk7CisgICAgICAgIHRtcDEwOV9fIHw9ICggcFNyYy0+d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NTVNjaGVkdWxlLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVXTU1UQ0xBUyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFV01NVENMQVMgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICB0QU5JX1UzMiBzdGF0dXMgPSBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKKyAgICBzdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRJRVdNTVRDTEFTKHBDdHgsIHBTcmMsICZuTmVlZGVkKTsKKyAgICBpZiAoICEgRE9UMTFGX1NVQ0NFRURFRCggc3RhdHVzICkgKSByZXR1cm4gc3RhdHVzOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gMjIxOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHgwOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDUwOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweGYyOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDI7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4NjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gcFNyYy0+dmVyc2lvbjsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnVzZXJfcHJpb3JpdHk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5jbGFzc2lmaWVyX3R5cGU7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5jbGFzc2lmaWVyX21hc2s7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgc3dpdGNoIChwU3JjLT5jbGFzc2lmaWVyX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGNhc2UgMDoKKyAgICAgICAgICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsIHBTcmMtPmluZm8uRXRoUGFyYW1zLnNvdXJjZSwgNik7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gNjsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDY7CisgICAgICAgICAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCBwU3JjLT5pbmZvLkV0aFBhcmFtcy5kZXN0LCA2KTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSA2OworICAgICAgICAgICAgICAgIHBCdWYgKz0gNjsKKyAgICAgICAgICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5pbmZvLkV0aFBhcmFtcy50eXBlLCAwKTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPmluZm8uSXBQYXJhbXMudmVyc2lvbjsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKHBTcmMtPmluZm8uSXBQYXJhbXMudmVyc2lvbikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgNDoKKyAgICAgICAgICAgICAgICAgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5zb3VyY2UsIDQpOworICAgICAgICAgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gNDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBCdWYgKz0gNDsKKyAgICAgICAgICAgICAgICAgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5kZXN0LCA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDQ7CisgICAgICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDQ7CisgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLnNyY19wb3J0LCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLmRlc3RfcG9ydCwgMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLkRTQ1A7CisgICAgICAgICAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLnByb3RvOworICAgICAgICAgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5yZXNlcnZlZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSA2OgorICAgICAgICAgICAgICAgICAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCBwU3JjLT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLnNvdXJjZSwgMTApOworICAgICAgICAgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTA7CisgICAgICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDEwOworICAgICAgICAgICAgICAgICAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCBwU3JjLT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmRlc3QsIDEwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDEwOworICAgICAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSAxMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuc3JjX3BvcnQsIDApOworICAgICAgICAgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZGVzdF9wb3J0LCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICAgICAgICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsIHBTcmMtPmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZmxvd19sYWJlbCwgMyk7CisgICAgICAgICAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAzOworICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDI6CisgICAgICAgICAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+aW5mby5QYXJhbXM4MDIxZHEudGFnX3R5cGUsIDApOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgICAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlBhY2tJZVdNTVRDTEFTLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVXTU1UQ0xBU1BST0ModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVXTU1UQ0xBU1BST0MgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICArPSAyOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gMjIxOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHgwOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDUwOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweGYyOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDI7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4NzsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gcFNyYy0+dmVyc2lvbjsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnByb2Nlc3Npbmc7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llV01NVENMQVNQUk9DLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVXTU1UU0RlbGF5KHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdNTVRTRGVsYXkgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICArPSA1OworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gMjIxOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHgwOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDUwOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweGYyOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDI7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4ODsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gcFNyYy0+dmVyc2lvbjsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBmcmFtZXNodG9ubChwQ3R4LCBwQnVmLCBwU3JjLT5kZWxheSwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDQ7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llV01NVFNEZWxheS4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llV01NVFNQRUModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdNTVRTUEVDICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgdEFOSV9VMTYgdG1wMTEwX187CisgICAgdEFOSV9VOCB0bXAxMTFfXzsKKyAgICB0QU5JX1UxNiB0bXAxMTJfXzsKKyAgICBuTmVlZGVkICArPSAzODsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDIyMTsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4MDsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHg1MDsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHhmMjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHgyOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDI7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnZlcnNpb247CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgdG1wMTEwX18gPSAwVTsKKyAgICAgICAgdG1wMTEwX18gfD0gKCBwU3JjLT50cmFmZmljX3R5cGUgPDwgMCApOworICAgICAgICB0bXAxMTBfXyB8PSAoIHBTcmMtPnRzaWQgPDwgMSApOworICAgICAgICB0bXAxMTBfXyB8PSAoIHBTcmMtPmRpcmVjdGlvbiA8PCA1ICk7CisgICAgICAgIHRtcDExMF9fIHw9ICggcFNyYy0+YWNjZXNzX3BvbGljeSA8PCA3ICk7CisgICAgICAgIHRtcDExMF9fIHw9ICggcFNyYy0+YWdncmVnYXRpb24gPDwgOSApOworICAgICAgICB0bXAxMTBfXyB8PSAoIHBTcmMtPnBzYiA8PCAxMCApOworICAgICAgICB0bXAxMTBfXyB8PSAoIHBTcmMtPnVzZXJfcHJpb3JpdHkgPDwgMTEgKTsKKyAgICAgICAgdG1wMTEwX18gfD0gKCBwU3JjLT50c2luZm9fYWNrX3BvbCA8PCAxNCApOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCB0bXAxMTBfXywgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgbkJ1ZiAtPSAgMiA7CisgICAgICAgIHRtcDExMV9fID0gMFU7CisgICAgICAgIHRtcDExMV9fIHw9ICggcFNyYy0+dHNpbmZvX3JzdmQgPDwgMCApOworICAgICAgICB0bXAxMTFfXyB8PSAoIHBTcmMtPmJ1cnN0X3NpemVfZGVmbiA8PCA3ICk7CisgICAgICAgICpwQnVmID0gdG1wMTExX187CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgbkJ1ZiAtPSAgMSA7CisgICAgICAgIHRtcDExMl9fID0gMFU7CisgICAgICAgIHRtcDExMl9fIHw9ICggcFNyYy0+c2l6ZSA8PCAwICk7CisgICAgICAgIHRtcDExMl9fIHw9ICggcFNyYy0+Zml4ZWQgPDwgMTUgKTsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgdG1wMTEyX18sIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIG5CdWYgLT0gIDIgOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5tYXhfbXNkdV9zaXplLCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICBmcmFtZXNodG9ubChwQ3R4LCBwQnVmLCBwU3JjLT5taW5fc2VydmljZV9pbnQsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSA0OworICAgICAgICBwQnVmICs9IDQ7CisgICAgICAgIGZyYW1lc2h0b25sKHBDdHgsIHBCdWYsIHBTcmMtPm1heF9zZXJ2aWNlX2ludCwgMCk7CisgICAgICAg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worICAgICAgICAqcG5Db25zdW1lZCArPSA0OworICAgICAgICBwQnVmICs9IDQ7CisgICAgICAgIGZyYW1lc2h0b25sKHBDdHgsIHBCdWYsIHBTcmMtPm1pbl9waHlfcmF0ZSwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDQ7CisgICAgICAgIHBCdWYgKz0gNDsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+c3VycGx1c19id19hbGxvd2FuY2UsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPm1lZGl1bV90aW1lLCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVXTU1UU1BFQy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llQUlEKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFQUlEICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gMjsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDE5NzsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5hc3NvY0lkLCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVBSUQuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZUFpcmdvKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVBaXJnbyAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgIHN0YXR1cyA9IGRvdDExZkdldFBhY2tlZElFQWlyZ28ocEN0eCwgcFNyYywgJm5OZWVkZWQpOworICAgIGlmICggISBET1QxMUZfU1VDQ0VFREVEKCBzdGF0dXMgKSApIHJldHVybiBzdGF0dXM7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAyMjE7CisgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHgwOworICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4YTsKKyAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweGY1OworICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBzdGF0dXMgPSBQYWNrQ29yZShwQ3R4LAorICAgICAgICAgICh0QU5JX1U4KilwU3JjLAorICAgICAgICAgIHBCdWYsCisgICAgICAgICAgbkJ1ZiwKKyAgICAgICAgICBwbkNvbnN1bWVkLAorICAgICAgICAgIEZGU19BaXJnbywKKyAgICAgICAgICBJRVNfQWlyZ28pOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVBaXJnby4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llQ0ZQYXJhbXModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUNGUGFyYW1zICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gNjsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDQ7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5jZnBfY291bnQ7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5jZnBfcGVyaW9kOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmNmcF9tYXhkdXJhdGlvbiwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+Y2ZwX2R1cnJlbWFpbmluZywgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llQ0ZQYXJhbXMuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZUNoYWxsZW5nZVRleHQodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFQ2hhbGxlbmdlVGV4dCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9ICBwU3JjLT5udW1fdGV4dDsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDE2OworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+dGV4dCApLCBwU3JjLT5udW1fdGV4dCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IHBTcmMtPm51bV90ZXh0OworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZUNoYWxsZW5nZVRleHQuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZUNoYW5Td2l0Y2hBbm4odHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFQ2hhblN3aXRjaEFubiAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9IDM7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAzNzsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnN3aXRjaE1vZGU7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5uZXdDaGFubmVsOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICpwQnVmID0gcFNyYy0+c3dpdGNoQ291bnQ7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llQ2hhblN3aXRjaEFubi4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llQ291bnRyeSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVDb3VudHJ5ICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgdEFOSV9VMzIgc3RhdHVzID0gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7CisgICAgc3RhdHVzID0gZG90MTFmR2V0UGFja2VkSUVDb3VudHJ5KHBDdHgsIHBTcmMsICZuTmVlZGVkKTsKKyAgICBpZiAoICEgRE9UMTFGX1NVQ0NFRURFRCggc3RhdHVzICkgKSByZXR1cm4gc3RhdHVzOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gNzsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsIHBTcmMtPmNvdW50cnksIDMpOworICAgICAgICAqcG5Db25zdW1lZCArPSAzOworICAgICAgICBwQnVmICs9IDM7CisgICAgICAgIGlmICggcFNyYy0+bnVtX3RyaXBsZXRzICkgICAgICAgIHsKKyAgICAgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+dHJpcGxldHMgKSwgKCBwU3JjLT5udW1fdHJpcGxldHMgKiAzICkpOworICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gKCBwU3JjLT5udW1fdHJpcGxldHMgKiAzICk7CisgICAgICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICB9CisgICAgICAgIGVsc2UgYnJlYWs7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlBhY2tJZUNvdW50cnkuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZURTUGFyYW1zKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVEU1BhcmFtcyAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9IDE7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAzOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gcFNyYy0+Y3Vycl9jaGFubmVsOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZURTUGFyYW1zLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVFRENBUGFyYW1TZXQodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVFRENBUGFyYW1TZXQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICB0QU5JX1U4IHRtcDExM19fOworICAgIHRBTklfVTggdG1wMTE0X187CisgICAgdEFOSV9VOCB0bXAxMTVfXzsKKyAgICB0QU5JX1U4IHRtcDExNl9fOworICAgIHRBTklfVTggdG1wMTE3X187CisgICAgdEFOSV9VOCB0bXAxMThfXzsKKyAgICB0QU5JX1U4IHRtcDExOV9fOworICAgIHRBTklfVTggdG1wMTIwX187CisgICAgbk5lZWRlZCAgKz0gMTg7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAxMjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnFvczsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnJlc2VydmVkOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIHRtcDExM19fID0gMFU7CisgICAgICAgIHRtcDExM19fIHw9ICggcFNyYy0+YWNiZV9haWZzbiA8PCAwICk7CisgICAgICAgIHRtcDExM19fIHw9ICggcFNyYy0+YWNiZV9hY20gPDwgNCApOworICAgICAgICB0bXAxMTNfXyB8PSAoIHBTcmMtPmFjYmVfYWNpIDw8IDUgKTsKKyAgICAgICAgdG1wMTEzX18gfD0gKCBwU3JjLT51bnVzZWQxIDw8IDcgKTsKKyAgICAgICAgKnBCdWYgPSB0bXAxMTNfXzsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBuQnVmIC09ICAxIDsKKyAgICAgICAgdG1wMTE0X18gPSAwVTsKKyAgICAgICAgdG1wMTE0X18gfD0gKCBwU3JjLT5hY2JlX2Fjd21pbiA8PCAwICk7CisgICAgICAgIHRtcDExNF9fIHw9ICggcFNyYy0+YWNiZV9hY3dtYXggPDwgNCApOworICAgICAgICAqcEJ1ZiA9IHRtcDExNF9fOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIG5CdWYgLT0gIDEgOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5hY2JlX3R4b3BsaW1pdCwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgdG1wMTE1X18gPSAwVTsKKyAgICAgICAgdG1wMTE1X18gfD0gKCBwU3JjLT5hY2JrX2FpZnNuIDw8IDAgKTsKKyAgICAgICAgdG1wMTE1X18gfD0gKCBwU3JjLT5hY2JrX2FjbSA8PCA0ICk7CisgICAgICAgIHRtcDExNV9fIHw9ICggcFNyYy0+YWNia19hY2kgPDwgNSApOworICAgICAgICB0bXAxMTVfXyB8PSAoIHBTcmMtPnVudXNlZDIgPDwgNyApOworICAgICAgICAqcEJ1ZiA9IHRtcDExNV9fOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIG5CdWYgLT0gIDEgOworICAgICAgICB0bXAxMTZfXyA9IDBVOworICAgICAgICB0bXAxMTZfXyB8PSAoIHBTcmMtPmFjYmtfYWN3bWluIDw8IDAgKTsKKyAgICAgICAgdG1wMTE2X18gfD0gKCBwU3JjLT5hY2JrX2Fjd21heCA8PCA0ICk7CisgICAgICAgICpwQnVmID0gdG1wMTE2X187CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgbkJ1ZiAtPSAgMSA7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmFjYmtfdHhvcGxpbWl0LCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICB0bXAxMTdfXyA9IDBVOworICAgICAgICB0bXAxMTdfXyB8PSAoIHBTcmMtPmFjdmlfYWlmc24gPDwgMCApOworICAgICAgICB0bXAxMTdfXyB8PSAoIHBTcmMtPmFjdmlfYWNtIDw8IDQgKTsKKyAgICAgICAgdG1wMTE3X18gfD0gKCBwU3JjLT5hY3ZpX2FjaSA8PCA1ICk7CisgICAgICAgIHRtcDExN19fIHw9ICggcFNyYy0+dW51c2VkMyA8PCA3ICk7CisgICAgICAgICpwQnVmID0gdG1wMTE3X187CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgbkJ1ZiAtPSAgMSA7CisgICAgICAgIHRtcDExOF9fID0gMFU7CisgICAgICAgIHRtcDExOF9fIHw9ICggcFNyYy0+YWN2aV9hY3dtaW4gPDwgMCApOworICAgICAgICB0bXAxMThfXyB8PSAoIHBTcmMtPmFjdmlfYWN3bWF4IDw8IDQgKTsKKyAgICAgICAgKnBCdWYgPSB0bXAxMThfXzsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBuQnVmIC09ICAxIDsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+YWN2aV90eG9wbGltaXQsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIHRtcDExOV9fID0gMFU7CisgICAgICAgIHRtcDExOV9fIHw9ICggcFNyYy0+YWN2b19haWZzbiA8PCAwICk7CisgICAgICAgIHRtcDExOV9fIHw9ICggcFNyYy0+YWN2b19hY20gPDwgNCApOworICAgICAgICB0bXAxMTlfXyB8PSAoIHBTcmMtPmFjdm9fYWNpIDw8IDUgKTsKKyAgICAgICAgdG1wMTE5X18gfD0gKCBwU3JjLT51bnVzZWQ0IDw8IDcgKTsKKyAgICAgICAgKnBCdWYgPSB0bXAxMTlfXzsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBuQnVmIC09ICAxIDsKKyAgICAgICAgdG1wMTIwX18gPSAwVTsKKyAgICAgICAgdG1wMTIwX18gfD0gKCBwU3JjLT5hY3ZvX2Fjd21pbiA8PCAwICk7CisgICAgICAgIHRtcDEyMF9fIHw9ICggcFNyYy0+YWN2b19hY3dtYXggPDwgNCApOworICAgICAgICAqcEJ1ZiA9IHRtcDEyMF9fOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIG5CdWYgLT0gIDEgOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5hY3ZvX3R4b3BsaW1pdCwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llRURDQVBhcmFtU2V0LiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVFUlBJbmZvKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUVSUEluZm8gKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICB0QU5JX1U4IHRtcDEyMV9fOworICAgIG5OZWVkZWQgICs9IDE7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSA0MjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICB0bXAxMjFfXyA9IDBVOworICAgICAgICB0bXAxMjFfXyB8PSAoIHBTcmMtPm5vbl9lcnBfcHJlc2VudCA8PCAwICk7CisgICAgICAgIHRtcDEyMV9fIHw9ICggcFNyYy0+dXNlX3Byb3QgPDwgMSApOworICAgICAgICB0bXAxMjFfXyB8PSAoIHBTcmMtPmJhcmtlcl9wcmVhbWJsZSA8PCAyICk7CisgICAgICAgIHRtcDEyMV9fIHw9ICggcFNyYy0+dW51c2VkIDw8IDMgKTsKKyAgICAgICAgKnBCdWYgPSB0bXAxMjFfXzsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyAgPSAxCisgICAgICAgIG5CdWYgLT0gIDEgOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZUVSUEluZm8uICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZUVTRUNja21PcGFxdWUodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFRVNFQ2NrbU9wYXF1ZSAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9ICBwU3JjLT5udW1fZGF0YTsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDE1NjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4MDsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHg0MDsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHg5NjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHgwOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCAmKCBwU3JjLT5kYXRhICksIHBTcmMtPm51bV9kYXRhKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gcFNyYy0+bnVtX2RhdGE7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llRVNFQ2NrbU9wYXF1ZS4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llRVNFUmFkTWdtdENhcCh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVFU0VSYWRNZ210Q2FwICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgdEFOSV9VOCB0bXAxMjJfXzsKKyAgICBuTmVlZGVkICArPSAyOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gMjIxOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHgwOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDQwOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDk2OworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDE7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPm1nbXRfc3RhdGU7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgdG1wMTIyX18gPSAwVTsKKyAgICAgICAgdG1wMTIyX18gfD0gKCBwU3JjLT5tYnNzaWRfbWFzayA8PCAwICk7CisgICAgICAgIHRtcDEyMl9fIHw9ICggcFNyYy0+cmVzZXJ2ZWQgPDwgMyApOworICAgICAgICAqcEJ1ZiA9IHRtcDEyMl9fOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnICA9IDEKKyAgICAgICAgbkJ1ZiAtPSAgMSA7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llRVNFUmFkTWdtdENhcC4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llRVNFVHJhZlN0cm1NZXQodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUVTRVRyYWZTdHJtTWV0ICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gNDsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDIyMTsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4MDsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHg0MDsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHg5NjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHg3OworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT50c2lkOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICpwQnVmID0gcFNyYy0+c3RhdGU7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+bXNtdF9pbnRlcnZhbCwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llRVNFVHJhZlN0cm1NZXQuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZUVTRVRyYWZTdHJtUmF0ZVNldCh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUVTRVRyYWZTdHJtUmF0ZVNldCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9ICAocFNyYy0+bnVtX3RzcmF0ZXMgKyAxKTsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDIyMTsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4MDsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHg0MDsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHg5NjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHg4OworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT50c2lkOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+dHNyYXRlcyApLCBwU3JjLT5udW1fdHNyYXRlcyk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IHBTcmMtPm51bV90c3JhdGVzOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZUVTRVRyYWZTdHJtUmF0ZVNldC4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llRVNFVHhtaXRQb3dlcih0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVFU0VUeG1pdFBvd2VyICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gMjsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDE1MDsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4MDsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHg0MDsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHg5NjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHgwOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5wb3dlcl9saW1pdDsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnJlc2VydmVkOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZUVTRVR4bWl0UG93ZXIuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZUVTRVZlcnNpb24odHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFRVNFVmVyc2lvbiAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9IDE7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAyMjE7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDA7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4NDA7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4OTY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4MzsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gcFNyYy0+dmVyc2lvbjsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVFU0VWZXJzaW9uLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVFeHRDYXAodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVFeHRDYXAgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgIC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QnVmIC09ICAyIDsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVFeHRDYXAuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZUV4dENoYW5Td2l0Y2hBbm4odHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFRXh0Q2hhblN3aXRjaEFubiAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9IDE7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSA2MjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnNlY29uZGFyeUNoYW5uZWxPZmZzZXQ7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llRXh0Q2hhblN3aXRjaEFubi4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llRXh0U3VwcFJhdGVzKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFRXh0U3VwcFJhdGVzICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gIHBTcmMtPm51bV9yYXRlczsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDUwOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+cmF0ZXMgKSwgcFNyYy0+bnVtX3JhdGVzKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gcFNyYy0+bnVtX3JhdGVzOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZUV4dFN1cHBSYXRlcy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llRkhQYXJhbVNldCh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVGSFBhcmFtU2V0ICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gNTsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDI7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+ZHdlbGxfdGltZSwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5ob3Bfc2V0OworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICpwQnVmID0gcFNyYy0+aG9wX3BhdHRlcm47CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5ob3BfaW5kZXg7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llRkhQYXJhbVNldC4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llRkhQYXJhbXModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUZIUGFyYW1zICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gMjsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDg7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5yYWRpeDsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPm5jaGFubmVsczsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVGSFBhcmFtcy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llRkhQYXR0VGFibGUodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUZIUGF0dFRhYmxlICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gIChwU3JjLT5udW1fcmFuZHRhYmxlICsgNCk7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSA5OworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gcFNyYy0+ZmxhZzsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPm5zZXRzOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICpwQnVmID0gcFNyYy0+bW9kdWx1czsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPm9mZnNldDsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsICYoIHBTcmMtPnJhbmR0YWJsZSApLCBwU3JjLT5udW1fcmFuZHRhYmxlKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gcFNyYy0+bnVtX3JhbmR0YWJsZTsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVGSFBhdHRUYWJsZS4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llRlRJbmZvKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFRlRJbmZvICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgdEFOSV9VMTYgdG1wMTI2X187CisgICAgdEFOSV9VMzIgc3RhdHVzID0gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7CisgICAgc3RhdHVzID0gZG90MTFmR2V0UGFja2VkSUVGVEluZm8ocEN0eCwgcFNyYywgJm5OZWVkZWQpOworICAgIGlmICggISBET1Q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KKyAgICAgICAgICAodEFOSV9VOCopcFNyYywKKyAgICAgICAgICBwQnVmLAorICAgICAgICAgIG5CdWYsCisgICAgICAgICAgcG5Db25zdW1lZCwKKyAgICAgICAgICBGRlNfRlRJbmZvLAorICAgICAgICAgIElFU19GVEluZm8pOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVGVEluZm8uICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZUhUMjA0MEJTU0NvZXhpc3RlbmNlKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVIVDIwNDBCU1NDb2V4aXN0ZW5jZSAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIHRBTklfVTggdG1wMTI3X187CisgICAgbk5lZWRlZCAgKz0gMTsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDcyOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHRtcDEyN19fID0gMFU7CisgICAgICAgIHRtcDEyN19fIHw9ICggcFNyYy0+aW5mb1JlcXVlc3QgPDwgMCApOworICAgICAgICB0bXAxMjdfXyB8PSAoIHBTcmMtPmZvcnR5TUh6SW50b2xlcmFudCA8PCAxICk7CisgICAgICAgIHRtcDEyN19fIHw9ICggcFNyYy0+dHdlbnR5TUh6QnNzV2lkdGhSZXEgPDwgMiApOworICAgICAgICB0bXAxMjdfXyB8PSAoIHBTcmMtPm9ic3NTY2FuRXhlbXB0aW9uUmVxIDw8IDMgKTsKKyAgICAgICAgdG1wMTI3X18gfD0gKCBwU3JjLT5vYnNzU2NhbkV4ZW1wdGlvbkdyYW50IDw8IDQgKTsKKyAgICAgICAgdG1wMTI3X18gfD0gKCBwU3JjLT51bnVzZWQgPDwgNSApOworICAgICAgICAqcEJ1ZiA9IHRtcDEyN19fOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnICA9IDEKKyAgICAgICAgbkJ1ZiAtPSAgMSA7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llSFQyMDQwQlNTQ29leGlzdGVuY2UuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZUhUMjA0MEJTU0ludG9sZXJhbnRSZXBvcnQodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFSFQyMDQwQlNTSW50b2xlcmFudFJlcG9ydCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9ICAocFNyYy0+bnVtX2NoYW5uZWxMaXN0ICsgMSk7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSA3MzsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPm9wZXJhdGluZ0NsYXNzOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+Y2hhbm5lbExpc3QgKSwgcFNyYy0+bnVtX2NoYW5uZWxMaXN0KTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gcFNyYy0+bnVtX2NoYW5uZWxMaXN0OworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZUhUMjA0MEJTU0ludG9sZXJhbnRSZXBvcnQuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZUhUQ2Fwcyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUhUQ2FwcyAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIHRBTklfVTE2IHRtcDEyOF9fOworICAgIHRBTklfVTggdG1wMTI5X187CisgICAgdEFOSV9VMTYgdG1wMTMwX187CisgICAgdEFOSV9VMzIgdG1wMTMxX187CisgICAgdEFOSV9VOCB0bXAxMzJfXzsKKyAgICBuTmVlZGVkICArPSAgKHBTcmMtPm51bV9yc3ZkICsgMjYpOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gN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IDE7CisgICAgICAgIG5CdWYgLT0gIDEgOworICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsICYoIHBTcmMtPnJzdmQgKSwgcFNyYy0+bnVtX3JzdmQpOworICAgICAgICAqcG5Db25zdW1lZCArPSBwU3JjLT5udW1fcnN2ZDsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVIVENhcHMuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZUhUSW5mbyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUhUSW5mbyAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIHRBTklfVTggdG1wMTMzX187CisgICAgdEFOSV9VMTYgdG1wMTM0X187CisgICAgdEFOSV9VMTYgdG1wMTM1X187CisgICAgbk5lZWRlZCAgKz0gIChwU3JjLT5udW1fcnN2ZCArIDIyKTsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDYxOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gcFNyYy0+cHJpbWFyeUNoYW5uZWw7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgdG1wMTMzX18gPSAwVTsKKyAgICAgICAgdG1wMTMzX18gfD0gKCBwU3JjLT5zZWNvbmRhcnlDaGFubmVsT2Zmc2V0IDw8IDAgKTsKKyAgICAgICAgdG1wMTMzX18gfD0gKCBwU3JjLT5yZWNvbW1lbmRlZFR4V2lkdGhTZXQgPDwgMiApOworICAgICAgICB0bXAxMzNfXyB8PSAoIHBTcmMtPnJpZnNNb2RlIDw8IDMgKTsKKyAgICAgICAgdG1wMTMzX18gfD0gKCBwU3JjLT5jb250cm9sbGVkQWNjZXNzT25seSA8PCA0ICk7CisgICAgICAgIHRtcDEzM19fIHw9ICggcFNyYy0+c2VydmljZUludGVydmFsR3JhbnVsYXJpdHkgPDwgNSApOworICAgICAgICAqcEJ1ZiA9IHRtcDEzM19fOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIG5CdWYgLT0gIDEgOworICAgICAgICB0bXAxMzRfXyA9IDBVOworICAgICAgICB0bXAxMzRfXyB8PSAoIHBTcmMtPm9wTW9kZSA8PCAwICk7CisgICAgICAgIHRtcDEzNF9fIHw9ICggcFNyYy0+bm9uR0ZEZXZpY2VzUHJlc2VudCA8PCAyICk7CisgICAgICAgIHRtcDEzNF9fIHw9ICggcFNyYy0+dHJhbnNtaXRCdXJzdExpbWl0IDw8IDMgKTsKKyAgICAgICAg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CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+cnN2ZCApLCBwU3JjLT5udW1fcnN2ZCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IHBTcmMtPm51bV9yc3ZkOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZUhUSW5mby4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llSUJTU1BhcmFtcyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVJQlNTUGFyYW1zICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gMjsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+YXRpbSwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llSUJTU1BhcmFtcy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llTGlua0lkZW50aWZpZXIodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUxpbmtJZGVudGlmaWVyICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gMTg7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAxMDE7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCBwU3JjLT5ic3NpZCwgNik7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDY7CisgICAgICAgIHBCdWYgKz0gNjsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCBwU3JjLT5Jbml0U3RhQWRkciwgNik7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDY7CisgICAgICAgIHBCdWYgKz0gNjsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCBwU3JjLT5SZXNwU3RhQWRkciwgNik7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDY7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llTGlua0lkZW50aWZpZXIuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZU1lYXN1cmVtZW50UmVwb3J0KHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVNZWFzdXJlbWVudFJlcG9ydCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIHRBTklfVTggdG1wMTM2X187CisgICAgdEFOSV9VOCB0bXAxMzdfXzsKKyAgICB0QU5JX1U4IHRtcDEzOF9fOworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgIHN0YXR1cyA9IGRvdDExZkdldFBhY2tlZElFTWVhc3VyZW1lbnRSZXBvcnQocEN0eCwgcFNyYywgJm5OZWVkZWQpOworICAgIGlmICggISBET1QxMUZfU1VDQ0VFREVEKCBzdGF0dXMgKSApIHJldHVybiBzdGF0dXM7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAzOTsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnRva2VuOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIHRtcDEzNl9fID0gMFU7CisgICAgICAgIHRtcDEzNl9fIHw9ICggcFNyYy0+bGF0ZSA8PCAwICk7CisgICAgICAgIHRtcDEzNl9fIHw9ICggcFNyYy0+aW5jYXBhYmxlIDw8IDEgKTsKKyAgICAgICAgdG1wMTM2X18gfD0gKCBwU3JjLT5yZWZ1c2VkIDw8IDIgKTsKKyAgICAgICAgdG1wMTM2X18gfD0gKCBwU3JjLT51bnVzZWQgPDwgMyApOworICAgICAgICAqcEJ1ZiA9IHRtcDEzNl9fOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIG5CdWYgLT0gIDEgOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnR5cGU7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgaWYgKCBwU3JjLT50eXBlICkgICAgICAgIHsKKyAgICAgICAgICAgIHN3aXRjaCAocFNyYy0+dHlwZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjYXNlIDA6CisgICAgICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+cmVwb3J0LkJhc2ljLmNoYW5uZWw7CisgICAgICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgZnJhbWVzaHRvbnEocEN0eCwgcEJ1ZiwgcFNyYy0+cmVwb3J0LkJhc2ljLm1lYXNfc3RhcnRfdGltZSwgMCk7CisgICAgICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDg7CisgICAgICAgICAgICAgICAgICAgIHBCdWYgKz0gODsKKyAgICAgICAgICAgICAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+cmVwb3J0LkJhc2ljLm1lYXNfZHVyYXRpb24sIDApOworICAgICAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICAgICAgICAgIHRtcDEzN19fID0gMFU7CisgICAgICAgICAgICAgICAgICAgIHRtcDEzN19fIHw9ICggcFNyYy0+cmVwb3J0LkJhc2ljLmJzcyA8PCAwICk7CisgICAgICAgICAgICAgICAgICAgIHRtcDEzN19fIHw9ICggcFNyYy0+cmVwb3J0LkJhc2ljLm9mZG1fcHJlYW1ibGUgPDwgMSApOworICAgICAgICAgICAgICAgICAgICB0bXAxMzdfXyB8PSAoIHBTcmMtPnJlcG9ydC5CYXNpYy51bmlkX3NpZ25hbCA8PCAyICk7CisgICAgICAgICAgICAgICAgICAgIHRtcDEzN19fIHw9ICggcFNyYy0+cmVwb3J0LkJhc2ljLnJhZGVyIDw8IDMgKTsKKyAgICAgICAgICAgICAgICAgICAgdG1wMTM3X18gfD0gKCBwU3JjLT5yZXBvcnQuQmFzaWMudW5tZWFzdXJlZCA8PCA0ICk7CisgICAgICAgICAgICAgICAgICAgIHRtcDEzN19fIHw9ICggcFNyYy0+cmVwb3J0LkJhc2ljLnVudXNlZCA8PCA1ICk7CisgICAgICAgICAgICAgICAgICAgICpwQnVmID0gdG1wMTM3X187CisgICAgICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgID0gMQorICAgICAgICAgICAgICAgICAgICBuQnVmIC09ICAxIDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+cmVwb3J0LkNDQS5jaGFubmVsOworICAgICAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgICAgIGZyYW1lc2h0b25xKHBDdHgsIHBCdWYsIHBTcmMtPnJlcG9ydC5DQ0EubWVhc19zdGFydF90aW1lLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gODsKKyAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSA4OworICAgICAgICAgICAgICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5yZXBvcnQuQ0NBLm1lYXNfZHVyYXRpb24sIDApOworICAgICAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+cmVwb3J0LkNDQS5jY2FfYnVzeV9mcmFjdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIDI6CisgICAgICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+cmVwb3J0LlJQSUhpc3RvZ3JhbS5jaGFubmVsOworICAgICAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgICAgIGZyYW1lc2h0b25xKHBDdHgsIHBCdWYsIHBTcmMtPnJlcG9ydC5SUElIaXN0b2dyYW0ubWVhc19zdGFydF90aW1lLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gODsKKyAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSA4OworICAgICAgICAgICAgICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5yZXBvcnQuUlBJSGlzdG9ncmFtLm1lYXNfZHVyYXRpb24sIDApOworICAgICAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+cmVwb3J0LlJQSUhpc3RvZ3JhbS5ycGkwX2RlbnNpdHk7CisgICAgICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5yZXBvcnQuUlBJSGlzdG9ncmFtLnJwaTFfZGVuc2l0eTsKKyAgICAgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPnJlcG9ydC5SUElIaXN0b2dyYW0ucnBpMl9kZW5zaXR5OworICAgICAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+cmVwb3J0LlJQSUhpc3RvZ3JhbS5ycGkzX2RlbnNpdHk7CisgICAgICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5yZXBvcnQuUlBJSGlzdG9ncmFtLnJwaTRfZGVuc2l0eTsKKyAgICAgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPnJlcG9ydC5SUElIaXN0b2dyYW0ucnBpNV9kZW5zaXR5OworICAgICAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+cmVwb3J0LlJQSUhpc3RvZ3JhbS5ycGk2X2RlbnNpdHk7CisgICAgICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5yZXBvcnQuUlBJSGlzdG9ncmFtLnJwaTdfZGVuc2l0eTsKKyAgICAgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIDU6CisgICAgICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+cmVwb3J0LkJlYWNvbi5yZWdDbGFzczsKKyAgICAgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPnJlcG9ydC5CZWFjb24uY2hhbm5lbDsKKyAgICAgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgICAgICBmcmFtZXNodG9ucShwQ3R4LCBwQnVmLCBwU3JjLT5yZXBvcnQuQmVhY29uLm1lYXNfc3RhcnRfdGltZSwgMCk7CisgICAgICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDg7CisgICAgICAgICAgICAgICAgICAgIHBCdWYgKz0gODsKKyAgICAgICAgICAgICAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+cmVwb3J0LkJlYWNvbi5tZWFzX2R1cmF0aW9uLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICAgICAgICAgICAgICB0bXAxMzhfXyA9IDBVOworICAgICAgICAgICAgICAgICAgICB0bXAxMzhfXyB8PSAoIHBTcmMtPnJlcG9ydC5CZWFjb24uY29uZGVuc2VkX1BIWSA8PCAwICk7CisgICAgICAgICAgICAgICAgICAgIHRtcDEzOF9fIHw9ICggcFNyYy0+cmVwb3J0LkJlYWNvbi5yZXBvcnRlZF9mcmFtZV90eXBlIDw8IDcgKTsKKyAgICAgICAgICAgICAgICAgICAgKnBCdWYgPSB0bXAxMzhfXzsKKyAgICAgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgICAgICBuQnVmIC09ICAxIDsKKyAgICAgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5yZXBvcnQuQmVhY29uLlJDUEk7CisgICAgICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5yZXBvcnQuQmVhY29uLlJTTkk7CisgICAgICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCBwU3JjLT5yZXBvcnQuQmVhY29uLkJTU0lELCA2KTsKKyAgICAgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gNjsKKyAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSA2OworICAgICAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPnJlcG9ydC5CZWFjb24uYW50ZW5uYV9pZDsKKyAgICAgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgICAgICBmcmFtZXNodG9ubChwQ3R4LCBwQnVmLCBwU3JjLT5yZXBvcnQuQmVhY29uLnBhcmVudF9UU0YsIDApOworICAgICAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSA0OworICAgICAgICAgICAgICAgICAgICBwQnVmICs9IDQ7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gUGFja0NvcmUocEN0eCwKKyAgICAgICAgICAodEFOSV9VOCopcFNyYywKKyAgICAgICAgICBwQnVmLAorICAgICAgICAgIG5CdWYsCisgICAgICAgICAgcG5Db25zdW1lZCwKKyAgICAgICAgICBGRlNfcmVwb3J0QmVhY29uLAorICAgICAgICAgIElFU19yZXBvcnRCZWFjb24pOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UgYnJlYWs7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlBhY2tJZU1lYXN1cmVtZW50UmVwb3J0LiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVNZWFzdXJlbWVudFJlcXVlc3QodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVNZWFzdXJlbWVudFJlcXVlc3QgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICB0QU5JX1U4IHRtcDEzOV9fOworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgIHN0YXR1cyA9IGRvdDExZkdldFBhY2tlZElFTWVhc3VyZW1lbnRSZXF1ZXN0KHBDdHgsIHBTcmMsICZuTmVlZGVkKTsKKyAgICBpZiAoICEgRE9UMTFGX1NVQ0NFRURFRCggc3RhdHVzICkgKSByZXR1cm4gc3RhdHVzOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gMzg7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5tZWFzdXJlbWVudF90b2tlbjsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICB0bXAxMzlfXyA9IDBVOworICAgICAgICB0bXAxMzlfXyB8PSAoIHBTcmMtPnBhcmFsbGVsIDw8IDAgKTsKKyAgICAgICAgdG1wMTM5X18gfD0gKCBwU3JjLT5lbmFibGUgPDwgMSApOworICAgICAgICB0bXAxMzlfXyB8PSAoIHBTcmMtPnJlcXVlc3QgPDwgMiApOworICAgICAgICB0bXAxMzlfXyB8PSAoIHBTcmMtPnJlcG9ydCA8PCAzICk7CisgICAgICAgIHRtcDEzOV9fIHw9ICggcFNyYy0+ZHVyYXRpb25NYW5kYXRvcnkgPDwgNCApOworICAgICAgICB0bXAxMzlfXyB8PSAoIHBTcmMtPnVudXNlZCA8PCA1ICk7CisgICAgICAgICpwQnVmID0gdG1wMTM5X187CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgbkJ1ZiAtPSAgMSA7CisgICAgICAgICpwQnVmID0gcFNyYy0+bWVhc3VyZW1lbnRfdHlwZTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBzd2l0Y2ggKHBTcmMtPm1lYXN1cmVtZW50X3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGNhc2UgMDoKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPm1lYXN1cmVtZW50X3JlcXVlc3QuQmFzaWMuY2hhbm5lbF9ubzsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsIHBTcmMtPm1lYXN1cmVtZW50X3JlcXVlc3QuQmFzaWMubWVhc19zdGFydF90aW1lLCA4KTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSA4OworICAgICAgICAgICAgICAgIHBCdWYgKz0gODsKKyAgICAgICAgICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5tZWFzdXJlbWVudF9yZXF1ZXN0LkJhc2ljLm1lYXNfZHVyYXRpb24sIDApOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgICAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+bWVhc3VyZW1lbnRfcmVxdWVzdC5DQ0EuY2hhbm5lbF9ubzsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsIHBTcmMtPm1lYXN1cmVtZW50X3JlcXVlc3QuQ0NBLm1lYXNfc3RhcnRfdGltZSwgOCk7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gODsKKyAgICAgICAgICAgICAgICBwQnVmICs9IDg7CisgICAgICAgICAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+bWVhc3VyZW1lbnRfcmVxdWVzdC5DQ0EubWVhc19kdXJhdGlvbiwgMCk7CisgICAgICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDI6CisgICAgICAgICAgICAgICAgKnBCdWYgPSBwU3JjLT5tZWFzdXJlbWVudF9yZXF1ZXN0LlJQSUhpc3RvZ3JhbS5jaGFubmVsX25vOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+bWVhc3VyZW1lbnRfcmVxdWVzdC5SUElIaXN0b2dyYW0ubWVhc19zdGFydF90aW1lLCA4KTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSA4OworICAgICAgICAgICAgICAgIHBCdWYgKz0gODsKKyAgICAgICAgICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5tZWFzdXJlbWVudF9yZXF1ZXN0LlJQSUhpc3RvZ3JhbS5tZWFzX2R1cmF0aW9uLCAwKTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgNToKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPm1lYXN1cmVtZW50X3JlcXVlc3QuQmVhY29uLnJlZ0NsYXNzOworICAgICAgICAgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgICAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAgICAgICAgICpwQnVmID0gcFNyYy0+bWVhc3VyZW1lbnRfcmVxdWVzdC5CZWFjb24uY2hhbm5lbDsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5tZWFzdXJlbWVudF9yZXF1ZXN0LkJlYWNvbi5yYW5kb21pemF0aW9uLCAwKTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5tZWFzdXJlbWVudF9yZXF1ZXN0LkJlYWNvbi5tZWFzX2R1cmF0aW9uLCAwKTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgICAgICAgICAqcEJ1ZiA9IHBTcmMtPm1lYXN1cmVtZW50X3JlcXVlc3QuQmVhY29uLm1lYXNfbW9kZTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsIHBTcmMtPm1lYXN1cmVtZW50X3JlcXVlc3QuQmVhY29uLkJTU0lELCA2KTsKKyAgICAgICAgICAgICAgICAqcG5Db25zdW1lZCArPSA2OworICAgICAgICAgICAgICAgIHBCdWYgKz0gNjsKKyAgICAgICAgICAgIHN0YXR1cyA9IFBhY2tDb3JlKHBDdHgsCisgICAgICAgICAgKHRBTklfVTgqKXBTcmMsCisgICAgICAgICAgcEJ1ZiwKKyAgICAgICAgICBuQnVmLAorICAgICAgICAgIHBuQ29uc3VtZWQsCisgICAgICAgICAgRkZTX21lYXN1cmVtZW50X3JlcXVlc3RCZWFjb24sCisgICAgICAgICAgSUVTX21lYXN1cmVtZW50X3JlcXVlc3RCZWFjb24pOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmUGFja0llTWVhc3VyZW1lbnRSZXF1ZXN0LiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVNb2JpbGl0eURvbWFpbih0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFTW9iaWxpdHlEb21haW4gKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICB0QU5JX1U4IHRtcDE0MF9fOworICAgIG5OZWVkZWQgICs9IDM7CisgICAgd2hpbGUgKCBwU3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ICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFTmVpZ2hib3JSZXBvcnQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICB0QU5JX1U4IHRtcDE0MV9fOworICAgIHRBTklfVTggdG1wMTQyX187CisgICAgdEFOSV9VMzIgc3RhdHVzID0gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7CisgICAgc3RhdHVzID0gZG90MTFmR2V0UGFja2VkSUVOZWlnaGJvclJlcG9ydChwQ3R4LCBwU3JjLCAmbk5lZWRlZCk7CisgICAgaWYgKCAhIERPVDExRl9TVUNDRUVERUQoIHN0YXR1cyApICkgcmV0dXJuIHN0YXR1czsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDUyOworICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsIHBTcmMtPmJzc2lkLCA2KTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gNjsKKyAgICAgICAgcEJ1ZiArPSA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AgICAgcEJ1ZiArPSAyOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnJlZ3VsYXRvcnlDbGFzczsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNoYW5uZWw7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5QaHlUeXBlOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIHN0YXR1cyA9IFBhY2tDb3JlKHBDdHgsCisgICAgICAgICAgKHRBTklfVTgqKXBTcmMsCisgICAgICAgICAgcEJ1ZiwKKyAgICAgICAgICBuQnVmLAorICAgICAgICAgIHBuQ29uc3VtZWQsCisgICAgICAgICAgRkZTX05laWdoYm9yUmVwb3J0LAorICAgICAgICAgIElFU19OZWlnaGJvclJlcG9ydCk7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlBhY2tJZU5laWdoYm9yUmVwb3J0LiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVPQlNTU2NhblBhcmFtZXRlcnModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVPQlNTU2NhblBhcmFtZXRlcnMgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U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gICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPm9ic3NTY2FuQWN0aXZlVG90YWxQZXJDaGFubmVsLCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5ic3NXaWR0aENoYW5uZWxUcmFuc2l0aW9uRGVsYXlGYWN0b3IsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPm9ic3NTY2FuQWN0aXZpdHlUaHJlc2hvbGQsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZU9CU1NTY2FuUGFyYW1ldGVycy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llT3BlcmF0aW5nTW9kZSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVPcGVyYXRpbmdNb2RlICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgdEFOSV9VOCB0bXAxNDNfXzsKKyAgICBuTmVlZGVkICArPSAxOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gMTk5OworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHRtcDE0M19fID0gMFU7CisgICAgICAgIHRtcDE0M19fIHw9ICggcFNyYy0+Y2hhbldpZHRoIDw8IDAgKTsKKyAgICAgICAgdG1wMTQzX18gfD0gKCBwU3JjLT5yZXNlcnZlZCA8PCAyICk7CisgICAgICAgIHRtcDE0M19fIHw9ICggcFNyYy0+cnhOU1MgPDwgNCApOworICAgICAgICB0bXAxNDNfXyB8PSAoIHBTcmMtPnJ4TlNTVHlwZSA8PCA3ICk7CisgICAgICAgICpwQnVmID0gdG1wMTQzX187CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgID0gMQorICAgICAgICBuQnVmIC09ICAxIDsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVPcGVyYXRpbmdNb2RlLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVQMlBBc3NvY1JlcSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUDJQQXNzb2NSZXEgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbiwgaWR4ID0gMCxpZHhsYXN0OworICAgIHRBTklfVTMyIG5Db25zdW1lZFNvRmFyLCBuQ29uc3VtZWROb3c7CisgICAgdEFOSV9VMzIgc3RhdHVzID0gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIHN0YXR1cyA9IGRvdDExZkdldFBhY2tlZElFUDJQQXNzb2NSZXEocEN0eCwgcFNyYywgJm5OZWVkZWQpOworICAgIGlmICggISBET1QxMUZfU1VDQ0VFREVEKCBzdGF0dXMgKSApIHJldHVybiBzdGF0dXM7CisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBTcmMtPnByZXNlbnQpIHsKKyAgICAgICAgZG8geworICAgICAgICBuQ29uc3VtZWRTb0Zhcj0qcG5Db25zdW1lZDsKKyAgICAgICAgICAgICpwQnVmID0gMjIxOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDUwOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg2ZjsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4OWE7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDk7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgbiA9ICggMjU1IC0gNCkgPCBuQnVmID8gKCAyNTUgLSA0KSA6IG5CdWY7CisgICAgICAgICAgICBuQ29uc3VtZWROb3c9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICBpZHhsYXN0PWlkeDsKKyAgICAgICAgICAgIHN0YXR1cyA9IFBhY2tUbHZDb3JlKHBDdHgsKHRBTklfVTgqKXBTcmMscEJ1ZixuLHBuQ29uc3VtZWQsVExWU19QMlBBc3NvY1JlcStpZHgsJmlkeCk7CisgICAgICAgICAgICBuQ29uc3VtZWROb3c9KnBuQ29uc3VtZWQtbkNvbnN1bWVkTm93OworICAgICAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkU29GYXIgLSAyOworICAgICAgICAgICAgcEJ1Zis9bkNvbnN1bWVkTm93OworICAgICAgICAgICAgbkJ1Zi09bkNvbnN1bWVkTm93OworICAgICAgICB9IHdoaWxlIChET1QxMUZfQlVGRkVSX09WRVJGTE9XID09IHN0YXR1cyAmJiBpZHhsYXN0ICE9IGlkeCk7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVQMlBBc3NvY1JlcS4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llUDJQQXNzb2NSZXModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVAyUEFzc29jUmVzICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG4sIGlkeCA9IDAsaWR4bGFzdDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRTb0ZhciwgbkNvbnN1bWVkTm93OworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBzdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRJRVAyUEFzc29jUmVzKHBDdHgsIHBTcmMsICZuTmVlZGVkKTsKKyAgICBpZiAoICEgRE9UMTFGX1NVQ0NFRURFRCggc3RhdHVzICkgKSByZXR1cm4gc3RhdHVzOworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwU3JjLT5wcmVzZW50KSB7CisgICAgICAgIGRvIHsKKyAgICAgICAgbkNvbnN1bWVkU29GYXI9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICAqcEJ1ZiA9IDIyMTsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg1MDsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4NmY7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDlhOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg5OworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgIG4gPSAoIDI1NSAtIDQpIDwgbkJ1ZiA/ICggMjU1IC0gNCkgOiBuQnVmOworICAgICAgICAgICAgbkNvbnN1bWVkTm93PSpwbkNvbnN1bWVkOworICAgICAgICAgICAgaWR4bGFzdD1pZHg7CisgICAgICAgICAgICBzdGF0dXMgPSBQYWNrVGx2Q29yZShwQ3R4LCh0QU5JX1U4KilwU3JjLHBCdWYsbixwbkNvbnN1bWVkLFRMVlNfUDJQQXNzb2NSZXMraWR4LCZpZHgpOworICAgICAgICAgICAgbkNvbnN1bWVkTm93PSpwbkNvbnN1bWVkLW5Db25zdW1lZE5vdzsKKyAgICAgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZFNvRmFyIC0gMjsKKyAgICAgICAgICAgIHBCdWYrPW5Db25zdW1lZE5vdzsKKyAgICAgICAgICAgIG5CdWYtPW5Db25zdW1lZE5vdzsKKyAgICAgICAgfSB3aGlsZSAoRE9UMTFGX0JVRkZFUl9PVkVSRkxPVyA9PSBzdGF0dXMgJiYgaWR4bGFzdCAhPSBpZHgpOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmUGFja0llUDJQQXNzb2NSZXMuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVAyUEJlYWNvbih0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVAyUEJlYWNvbiAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuLCBpZHggPSAwLGlkeGxhc3Q7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkU29GYXIsIG5Db25zdW1lZE5vdzsKKyAgICB0QU5JX1UzMiBzdGF0dXMgPSBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgc3RhdHVzID0gZG90MTFmR2V0UGFja2VkSUVQMlBCZWFjb24ocEN0eCwgcFNyYywgJm5OZWVkZWQpOworICAgIGlmICggISBET1QxMUZfU1VDQ0VFREVEKCBzdGF0dXMgKSApIHJldHVybiBzdGF0dXM7CisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBTcmMtPnByZXNlbnQpIHsKKyAgICAgICAgZG8geworICAgICAgICBuQ29uc3VtZWRTb0Zhcj0qcG5Db25zdW1lZDsKKyAgICAgICAgICAgICpwQnVmID0gMjIxOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDUwOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg2ZjsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4OWE7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDk7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgbiA9ICggMjU1IC0gNCkgPCBuQnVmID8gKCAyNTUgLSA0KSA6IG5CdWY7CisgICAgICAgICAgICBuQ29uc3VtZWROb3c9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICBpZHhsYXN0PWlkeDsKKyAgICAgICAgICAgIHN0YXR1cyA9IFBhY2tUbHZDb3JlKHBDdHgsKHRBTklfVTgqKXBTcmMscEJ1ZixuLHBuQ29uc3VtZWQsVExWU19QMlBCZWFjb24raWR4LCZpZHgpOworICAgICAgICAgICAgbkNvbnN1bWVkTm93PSpwbkNvbnN1bWVkLW5Db25zdW1lZE5vdzsKKyAgICAgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZFNvRmFyIC0gMjsKKyAgICAgICAgICAgIHBCdWYrPW5Db25zdW1lZE5vdzsKKyAgICAgICAgICAgIG5CdWYtPW5Db25zdW1lZE5vdzsKKyAgICAgICAgfSB3aGlsZSAoRE9UMTFGX0JVRkZFUl9PVkVSRkxPVyA9PSBzdGF0dXMgJiYgaWR4bGFzdCAhPSBpZHgpOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmUGFja0llUDJQQmVhY29uLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVQMlBCZWFjb25Qcm9iZVJlcyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUDJQQmVhY29uUHJvYmVSZXMgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbiwgaWR4ID0gMCxpZHhsYXN0OworICAgIHRBTklfVTMyIG5Db25zdW1lZFNvRmFyLCBuQ29uc3VtZWROb3c7CisgICAgdEFOSV9VMzIgc3RhdHVzID0gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIHN0YXR1cyA9IGRvdDExZkdldFBhY2tlZElFUDJQQmVhY29uUHJvYmVSZXMocEN0eCwgcFNyYywgJm5OZWVkZWQpOworICAgIGlmICggISBET1QxMUZfU1VDQ0VFREVEKCBzdGF0dXMgKSApIHJldHVybiBzdGF0dXM7CisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBTcmMtPnByZXNlbnQpIHsKKyAgICAgICAgZG8geworICAgICAgICBuQ29uc3VtZWRTb0Zhcj0qcG5Db25zdW1lZDsKKyAgICAgICAgICAgICpwQnVmID0gMjIxOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDUwOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg2ZjsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4OWE7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDk7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgbiA9ICggMjU1IC0gNCkgPCBuQnVmID8gKCAyNTUgLSA0KSA6IG5CdWY7CisgICAgICAgICAgICBuQ29uc3VtZWROb3c9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICBpZHhsYXN0PWlkeDsKKyAgICAgICAgICAgIHN0YXR1cyA9IFBhY2tUbHZDb3JlKHBDdHgsKHRBTklfVTgqKXBTcmMscEJ1ZixuLHBuQ29uc3VtZWQsVExWU19QMlBCZWFjb25Qcm9iZVJlcytpZHgsJmlkeCk7CisgICAgICAgICAgICBuQ29uc3VtZWROb3c9KnBuQ29uc3VtZWQtbkNvbnN1bWVkTm93OworICAgICAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkU29GYXIgLSAyOworICAgICAgICAgICAgcEJ1Zis9bkNvbnN1bWVkTm93OworICAgICAgICAgICAgbkJ1Zi09bkNvbnN1bWVkTm93OworICAgICAgICB9IHdoaWxlIChET1QxMUZfQlVGRkVSX09WRVJGTE9XID09IHN0YXR1cyAmJiBpZHhsYXN0ICE9IGlkeCk7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVQMlBCZWFjb25Qcm9iZVJlcy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llUDJQRGVBdXRoKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUDJQRGVBdXRoICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG4sIGlkeCA9IDAsaWR4bGFzdDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRTb0ZhciwgbkNvbnN1bWVkTm93OworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBzdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRJRVAyUERlQXV0aChwQ3R4LCBwU3JjLCAmbk5lZWRlZCk7CisgICAgaWYgKCAhIERPVDExRl9TVUNDRUVERUQoIHN0YXR1cyApICkgcmV0dXJuIHN0YXR1czsKKyAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocFNyYy0+cHJlc2VudCkgeworICAgICAgICBkbyB7CisgICAgICAgIG5Db25zdW1lZFNvRmFyPSpwbkNvbnN1bWVkOworICAgICAgICAgICAgKnBCdWYgPSAyMjE7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4NTA7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDZmOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg5YTsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4OTsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICBuID0gKCAyNTUgLSA0KSA8IG5CdWYgPyAoIDI1NSAtIDQpIDogbkJ1ZjsKKyAgICAgICAgICAgIG5Db25zdW1lZE5vdz0qcG5Db25zdW1lZDsKKyAgICAgICAgICAgIGlkeGxhc3Q9aWR4OworICAgICAgICAgICAgc3RhdHVzID0gUGFja1RsdkNvcmUocEN0eCwodEFOSV9VOCopcFNyYyxwQnVmLG4scG5Db25zdW1lZCxUTFZTX1AyUERlQXV0aCtpZHgsJmlkeCk7CisgICAgICAgICAgICBuQ29uc3VtZWROb3c9KnBuQ29uc3VtZWQtbkNvbnN1bWVkTm93OworICAgICAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkU29GYXIgLSAyOworICAgICAgICAgICAgcEJ1Zis9bkNvbnN1bWVkTm93OworICAgICAgICAgICAgbkJ1Zi09bkNvbnN1bWVkTm93OworICAgICAgICB9IHdoaWxlIChET1QxMUZfQlVGRkVSX09WRVJGTE9XID09IHN0YXR1cyAmJiBpZHhsYXN0ICE9IGlkeCk7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVQMlBEZUF1dGguICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVAyUERldmljZURpc2NvdmVyYWJpbGl0eVJlcSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVAyUERldmljZURpc2NvdmVyYWJpbGl0eVJlcSAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuLCBpZHggPSAwLGlkeGxhc3Q7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkU29GYXIsIG5Db25zdW1lZE5vdzsKKyAgICB0QU5JX1UzMiBzdGF0dXMgPSBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgc3RhdHVzID0gZG90MTFmR2V0UGFja2VkSUVQMlBEZXZpY2VEaXNjb3ZlcmFiaWxpdHlSZXEocEN0eCwgcFNyYywgJm5OZWVkZWQpOworICAgIGlmICggISBET1QxMUZfU1VDQ0VFREVEKCBzdGF0dXMgKSApIHJldHVybiBzdGF0dXM7CisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBTcmMtPnByZXNlbnQpIHsKKyAgICAgICAgZG8geworICAgICAgICBuQ29uc3VtZWRTb0Zhcj0qcG5Db25zdW1lZDsKKyAgICAgICAgICAgICpwQnVmID0gMjIxOworICAgICAgICAgICAgKytwQ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RkxPVyA9PSBzdGF0dXMgJiYgaWR4bGFzdCAhPSBpZHgpOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmUGFja0llUDJQRGV2aWNlRGlzY292ZXJhYmlsaXR5UmVxLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVQMlBEZXZpY2VEaXNjb3ZlcmFiaWxpdHlSZXModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVQMlBEZXZpY2VEaXNjb3ZlcmFiaWxpdHlSZXMgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbiwgaWR4ID0gMCxpZHhsYXN0OworICAgIHRBTklfVTMyIG5Db25zdW1lZFNvRmFyLCBuQ29uc3VtZWROb3c7CisgICAgdEFOSV9VMzIgc3RhdHVzID0gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIHN0YXR1cyA9IGRvdDExZkdldFBhY2tlZElFUDJQRGV2aWNlRGlzY292ZXJhYmlsaXR5UmVzKHBDdHgsIHBTcmMsICZuTmVlZGVkKTsKKyAgICBpZiAoICEgRE9UMTFGX1NVQ0NFRURFRCggc3RhdHVzICkgKSByZXR1cm4gc3RhdHVzOworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwU3JjLT5wcmVzZW50KSB7CisgICAgICAgIGRvIHsKKyAgICAgICAgbkNvbnN1bWVkU29GYXI9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICAqcEJ1ZiA9IDIyMTsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg1MDsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4NmY7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDlhOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg5OworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgIG4gPSAoIDI1NSAtIDQpIDwgbkJ1ZiA/ICggMjU1IC0gNCkgOiBuQnVmOworICAgICAgICAgICAgbkNvbnN1bWVkTm93PSpwbkNvbnN1bWVkOworICAgICAgICAgICAgaWR4bGFzdD1pZHg7CisgICAgICAgICAgICBzdGF0dXMgPSBQYWNrVGx2Q29yZShwQ3R4LCh0QU5JX1U4KilwU3JjLHBCdWYsbixwbkNvbnN1bWVkLFRMVlNfUDJQRGV2aWNlRGlzY292ZXJhYmlsaXR5UmVzK2lkeCwmaWR4KTsKKyAgICAgICAgICAgIG5Db25zdW1lZE5vdz0qcG5Db25zdW1lZC1uQ29uc3VtZWROb3c7CisgICAgICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRTb0ZhciAtIDI7CisgICAgICAgICAgICBwQnVmKz1uQ29uc3VtZWROb3c7CisgICAgICAgICAgICBuQnVmLT1uQ29uc3VtZWROb3c7CisgICAgICAgIH0gd2hpbGUgKERPVDExRl9CVUZGRVJfT1ZFUkZMT1cgPT0gc3RhdHVzICYmIGlkeGxhc3QgIT0gaWR4KTsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlBhY2tJZVAyUERldmljZURpc2NvdmVyYWJpbGl0eVJlcy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llUDJQRGlzQXNzb2ModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVAyUERpc0Fzc29jICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG4sIGlkeCA9IDAsaWR4bGFzdDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRTb0ZhciwgbkNvbnN1bWVkTm93OworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBzdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRJRVAyUERpc0Fzc29jKHBDdHgsIHBTcmMsICZuTmVlZGVkKTsKKyAgICBpZiAoICEgRE9UMTFGX1NVQ0NFRURFRCggc3RhdHVzICkgKSByZXR1cm4gc3RhdHVzOworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwU3JjLT5wcmVzZW50KSB7CisgICAgICAgIGRvIHsKKyAgICAgICAgbkNvbnN1bWVkU29GYXI9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICAqcEJ1ZiA9IDIyMTsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg1MDsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4NmY7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDlhOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg5OworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgIG4gPSAoIDI1NSAtIDQpIDwgbkJ1ZiA/ICggMjU1IC0gNCkgOiBuQnVmOworICAgICAgICAgICAgbkNvbnN1bWVkTm93PSpwbkNvbnN1bWVkOworICAgICAgICAgICAgaWR4bGFzdD1pZHg7CisgICAgICAgICAgICBzdGF0dXMgPSBQYWNrVGx2Q29yZShwQ3R4LCh0QU5JX1U4KilwU3JjLHBCdWYsbixwbkNvbnN1bWVkLFRMVlNfUDJQRGlzQXNzb2MraWR4LCZpZHgpOworICAgICAgICAgICAgbkNvbnN1bWVkTm93PSpwbkNvbnN1bWVkLW5Db25zdW1lZE5vdzsKKyAgICAgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZFNvRmFyIC0gMjsKKyAgICAgICAgICAgIHBCdWYrPW5Db25zdW1lZE5vdzsKKyAgICAgICAgICAgIG5CdWYtPW5Db25zdW1lZE5vdzsKKyAgICAgICAgfSB3aGlsZSAoRE9UMTFGX0JVRkZFUl9PVkVSRkxPVyA9PSBzdGF0dXMgJiYgaWR4bGFzdCAhPSBpZHgpOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmUGFja0llUDJQRGlzQXNzb2MuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVAyUEdPTmVnQ25mKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVQMlBHT05lZ0NuZiAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuLCBpZHggPSAwLGlkeGxhc3Q7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkU29GYXIsIG5Db25zdW1lZE5vdzsKKyAgICB0QU5JX1UzMiBzdGF0dXMgPSBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgc3RhdHVzID0gZG90MTFmR2V0UGFja2VkSUVQMlBHT05lZ0NuZihwQ3R4LCBwU3JjLCAmbk5lZWRlZCk7CisgICAgaWYgKCAhIERPVDExRl9TVUNDRUVERUQoIHN0YXR1cyApICkgcmV0dXJuIHN0YXR1czsKKyAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocFNyYy0+cHJlc2VudCkgeworICAgICAgICBkbyB7CisgICAgICAgIG5Db25zdW1lZFNvRmFyPSpwbkNvbnN1bWVkOworICAgICAgICAgICAgKnBCdWYgPSAyMjE7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4NTA7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDZmOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg5YTsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4OTsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICBuID0gKCAyNTUgLSA0KSA8IG5CdWYgPyAoIDI1NSAtIDQpIDogbkJ1ZjsKKyAgICAgICAgICAgIG5Db25zdW1lZE5vdz0qcG5Db25zdW1lZDsKKyAgICAgICAgICAgIGlkeGxhc3Q9aWR4OworICAgICAgICAgICAgc3RhdHVzID0gUGFja1RsdkNvcmUocEN0eCwodEFOSV9VOCopcFNyYyxwQnVmLG4scG5Db25zdW1lZCxUTFZTX1AyUEdPTmVnQ25mK2lkeCwmaWR4KTsKKyAgICAgICAgICAgIG5Db25zdW1lZE5vdz0qcG5Db25zdW1lZC1uQ29uc3VtZWROb3c7CisgICAgICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRTb0ZhciAtIDI7CisgICAgICAgICAgICBwQnVmKz1uQ29uc3VtZWROb3c7CisgICAgICAgICAgICBuQnVmLT1uQ29uc3VtZWROb3c7CisgICAgICAgIH0gd2hpbGUgKERPVDExRl9CVUZGRVJfT1ZFUkZMT1cgPT0gc3RhdHVzICYmIGlkeGxhc3QgIT0gaWR4KTsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlBhY2tJZVAyUEdPTmVnQ25mLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVQMlBHT05lZ1JlcSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUDJQR09OZWdSZXEgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbiwgaWR4ID0gMCxpZHhsYXN0OworICAgIHRBTklfVTMyIG5Db25zdW1lZFNvRmFyLCBuQ29uc3VtZWROb3c7CisgICAgdEFOSV9VMzIgc3RhdHVzID0gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIHN0YXR1cyA9IGRvdDExZkdldFBhY2tlZElFUDJQR09OZWdSZXEocEN0eCwgcFNyYywgJm5OZWVkZWQpOworICAgIGlmICggISBET1QxMUZfU1VDQ0VFREVEKCBzdGF0dXMgKSApIHJldHVybiBzdGF0dXM7CisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBTcmMtPnByZXNlbnQpIHsKKyAgICAgICAgZG8geworICAgICAgICBuQ29uc3VtZWRTb0Zhcj0qcG5Db25zdW1lZDsKKyAgICAgICAgICAgICpwQnVmID0gMjIxOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDUwOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg2ZjsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4OWE7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDk7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgbiA9ICggMjU1IC0gNCkgPCBuQnVmID8gKCAyNTUgLSA0KSA6IG5CdWY7CisgICAgICAgICAgICBuQ29uc3VtZWROb3c9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICBpZHhsYXN0PWlkeDsKKyAgICAgICAgICAgIHN0YXR1cyA9IFBhY2tUbHZDb3JlKHBDdHgsKHRBTklfVTgqKXBTcmMscEJ1ZixuLHBuQ29uc3VtZWQsVExWU19QMlBHT05lZ1JlcStpZHgsJmlkeCk7CisgICAgICAgICAgICBuQ29uc3VtZWROb3c9KnBuQ29uc3VtZWQtbkNvbnN1bWVkTm93OworICAgICAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkU29GYXIgLSAyOworICAgICAgICAgICAgcEJ1Zis9bkNvbnN1bWVkTm93OworICAgICAgICAgICAgbkJ1Zi09bkNvbnN1bWVkTm93OworICAgICAgICB9IHdoaWxlIChET1QxMUZfQlVGRkVSX09WRVJGTE9XID09IHN0YXR1cyAmJiBpZHhsYXN0ICE9IGlkeCk7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVQMlBHT05lZ1JlcS4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llUDJQR09OZWdSZXModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVAyUEdPTmVnUmVzICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG4sIGlkeCA9IDAsaWR4bGFzdDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRTb0ZhciwgbkNvbnN1bWVkTm93OworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBzdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRJRVAyUEdPTmVnUmVzKHBDdHgsIHBTcmMsICZuTmVlZGVkKTsKKyAgICBpZiAoICEgRE9UMTFGX1NVQ0NFRURFRCggc3RhdHVzICkgKSByZXR1cm4gc3RhdHVzOworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwU3JjLT5wcmVzZW50KSB7CisgICAgICAgIGRvIHsKKyAgICAgICAgbkNvbnN1bWVkU29GYXI9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICAqcEJ1ZiA9IDIyMTsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg1MDsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4NmY7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDlhOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg5OworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgIG4gPSAoIDI1NSAtIDQpIDwgbkJ1ZiA/ICggMjU1IC0gNCkgOiBuQnVmOworICAgICAgICAgICAgbkNvbnN1bWVkTm93PSpwbkNvbnN1bWVkOworICAgICAgICAgICAgaWR4bGFzdD1pZHg7CisgICAgICAgICAgICBzdGF0dXMgPSBQYWNrVGx2Q29yZShwQ3R4LCh0QU5JX1U4KilwU3JjLHBCdWYsbixwbkNvbnN1bWVkLFRMVlNfUDJQR09OZWdSZXMraWR4LCZpZHgpOworICAgICAgICAgICAgbkNvbnN1bWVkTm93PSpwbkNvbnN1bWVkLW5Db25zdW1lZE5vdzsKKyAgICAgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZFNvRmFyIC0gMjsKKyAgICAgICAgICAgIHBCdWYrPW5Db25zdW1lZE5vdzsKKyAgICAgICAgICAgIG5CdWYtPW5Db25zdW1lZE5vdzsKKyAgICAgICAgfSB3aGlsZSAoRE9UMTFGX0JVRkZFUl9PVkVSRkxPVyA9PSBzdGF0dXMgJiYgaWR4bGFzdCAhPSBpZHgpOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmUGFja0llUDJQR09OZWdSZXMuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVAyUEdPTmVnV1BTKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVQMlBHT05lZ1dQUyAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuLCBpZHggPSAwLGlkeGxhc3Q7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkU29GYXIsIG5Db25zdW1lZE5vdzsKKyAgICB0QU5JX1UzMiBzdGF0dXMgPSBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgc3RhdHVzID0gZG90MTFmR2V0UGFja2VkSUVQMlBHT05lZ1dQUyhwQ3R4LCBwU3JjLCAmbk5lZWRlZCk7CisgICAgaWYgKCAhIERPVDExRl9TVUNDRUVERUQoIHN0YXR1cyApICkgcmV0dXJuIHN0YXR1czsKKyAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocFNyYy0+cHJlc2VudCkgeworICAgICAgICBkbyB7CisgICAgICAgIG5Db25zdW1lZFNvRmFyPSpwbkNvbnN1bWVkOworICAgICAgICAgICAgKnBCdWYgPSAyMjE7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4MDsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4NTA7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweGYyOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg0OworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgIG4gPSAoIDI1NSAtIDQpIDwgbkJ1ZiA/ICggMjU1IC0gNCkgOiBuQnVmOworICAgICAgICAgICAgbkNvbnN1bWVkTm93PSpwbkNvbnN1bWVkOworICAgICAgICAgICAgaWR4bGFzdD1pZHg7CisgICAgICAgICAgICBzdGF0dXMgPSBQYWNrVGx2Q29yZShwQ3R4LCh0QU5JX1U4KilwU3JjLHBCdWYsbixwbkNvbnN1bWVkLFRMVlNfUDJQR09OZWdXUFMraWR4LCZpZHgpOworICAgICAgICAgICAgbkNvbnN1bWVkTm93PSpwbkNvbnN1bWVkLW5Db25zdW1lZE5vdzsKKyAgICAgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZFNvRmFyIC0gMjsKKyAgICAgICAgICAgIHBCdWYrPW5Db25zdW1lZE5vdzsKKyAgICAgICAgICAgIG5CdWYtPW5Db25zdW1lZE5vdzsKKyAgICAgICAgfSB3aGlsZSAoRE9UMTFGX0JVRkZFUl9PVkVSRkxPVyA9PSBzdGF0dXMgJiYgaWR4bGFzdCAhPSBpZHgpOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmUGFja0llUDJQR09OZWdXUFMuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVAyUElFT3BhcXVlKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVQMlBJRU9wYXF1ZSAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9ICBwU3JjLT5udW1fZGF0YTsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDIyMTsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4NTA7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4NmY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4OWE7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4OTsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+ZGF0YSApLCBwU3JjLT5udW1fZGF0YSk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IHBTcmMtPm51bV9kYXRhOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVAyUElFT3BhcXVlLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVQMlBJbnZpdGF0aW9uUmVxKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVAyUEludml0YXRpb25SZXEgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbiwgaWR4ID0gMCxpZHhsYXN0OworICAgIHRBTklfVTMyIG5Db25zdW1lZFNvRmFyLCBuQ29uc3VtZWROb3c7CisgICAgdEFOSV9VMzIgc3RhdHVzID0gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIHN0YXR1cyA9IGRvdDExZkdldFBhY2tlZElFUDJQSW52aXRhdGlvblJlcShwQ3R4LCBwU3JjLCAmbk5lZWRlZCk7CisgICAgaWYgKCAhIERPVDExRl9TVUNDRUVERUQoIHN0YXR1cyApICkgcmV0dXJuIHN0YXR1czsKKyAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocFNyYy0+cHJlc2VudCkgeworICAgICAgICBkbyB7CisgICAgICAgIG5Db25zdW1lZFNvRmFyPSpwbkNvbnN1bWVkOworICAgICAgICAgICAgKnBCdWYgPSAyMjE7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4NTA7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDZmOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg5YTsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4OTsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICBuID0gKCAyNTUgLSA0KSA8IG5CdWYgPyAoIDI1NSAtIDQpIDogbkJ1ZjsKKyAgICAgICAgICAgIG5Db25zdW1lZE5vdz0qcG5Db25zdW1lZDsKKyAgICAgICAgICAgIGlkeGxhc3Q9aWR4OworICAgICAgICAgICAgc3RhdHVzID0gUGFja1RsdkNvcmUocEN0eCwodEFOSV9VOCopcFNyYyxwQnVmLG4scG5Db25zdW1lZCxUTFZTX1AyUEludml0YXRpb25SZXEraWR4LCZpZHgpOworICAgICAgICAgICAgbkNvbnN1bWVkTm93PSpwbkNvbnN1bWVkLW5Db25zdW1lZE5vdzsKKyAgICAgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZFNvRmFyIC0gMjsKKyAgICAgICAgICAgIHBCdWYrPW5Db25zdW1lZE5vdzsKKyAgICAgICAgICAgIG5CdWYtPW5Db25zdW1lZE5vdzsKKyAgICAgICAgfSB3aGlsZSAoRE9UMTFGX0JVRkZFUl9PVkVSRkxPVyA9PSBzdGF0dXMgJiYgaWR4bGFzdCAhPSBpZHgpOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmUGFja0llUDJQSW52aXRhdGlvblJlcS4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llUDJQSW52aXRhdGlvblJlcyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVQMlBJbnZpdGF0aW9uUmVzICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG4sIGlkeCA9IDAsaWR4bGFzdDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRTb0ZhciwgbkNvbnN1bWVkTm93OworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBzdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRJRVAyUEludml0YXRpb25SZXMocEN0eCwgcFNyYywgJm5OZWVkZWQpOworICAgIGlmICggISBET1QxMUZfU1VDQ0VFREVEKCBzdGF0dXMgKSApIHJldHVybiBzdGF0dXM7CisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBTcmMtPnByZXNlbnQpIHsKKyAgICAgICAgZG8geworICAgICAgICBuQ29uc3VtZWRTb0Zhcj0qcG5Db25zdW1lZDsKKyAgICAgICAgICAgICpwQnVmID0gMjIxOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDUwOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg2ZjsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4OWE7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDk7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgbiA9ICggMjU1IC0gNCkgPCBuQnVmID8gKCAyNTUgLSA0KSA6IG5CdWY7CisgICAgICAgICAgICBuQ29uc3VtZWROb3c9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICBpZHhsYXN0PWlkeDsKKyAgICAgICAgICAgIHN0YXR1cyA9IFBhY2tUbHZDb3JlKHBDdHgsKHRBTklfVTgqKXBTcmMscEJ1ZixuLHBuQ29uc3VtZWQsVExWU19QMlBJbnZpdGF0aW9uUmVzK2lkeCwmaWR4KTsKKyAgICAgICAgICAgIG5Db25zdW1lZE5vdz0qcG5Db25zdW1lZC1uQ29uc3VtZWROb3c7CisgICAgICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRTb0ZhciAtIDI7CisgICAgICAgICAgICBwQnVmKz1uQ29uc3VtZWROb3c7CisgICAgICAgICAgICBuQnVmLT1uQ29uc3VtZWROb3c7CisgICAgICAgIH0gd2hpbGUgKERPVDExRl9CVUZGRVJfT1ZFUkZMT1cgPT0gc3RhdHVzICYmIGlkeGxhc3QgIT0gaWR4KTsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlBhY2tJZVAyUEludml0YXRpb25SZXMuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVAyUE5vdGljZU9mQWJzZW5jZSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVAyUE5vdGljZU9mQWJzZW5jZSAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuLCBpZHggPSAwLGlkeGxhc3Q7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkU29GYXIsIG5Db25zdW1lZE5vdzsKKyAgICB0QU5JX1UzMiBzdGF0dXMgPSBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgc3RhdHVzID0gZG90MTFmR2V0UGFja2VkSUVQMlBOb3RpY2VPZkFic2VuY2UocEN0eCwgcFNyYywgJm5OZWVkZWQpOworICAgIGlmICggISBET1QxMUZfU1VDQ0VFREVEKCBzdGF0dXMgKSApIHJldHVybiBzdGF0dXM7CisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBTcmMtPnByZXNlbnQpIHsKKyAgICAgICAgZG8geworICAgICAgICBuQ29uc3VtZWRTb0Zhcj0qcG5Db25zdW1lZDsKKyAgICAgICAgICAgICpwQnVmID0gMjIxOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDUwOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg2ZjsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4OWE7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDk7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgbiA9ICggMjU1IC0gNCkgPCBuQnVmID8gKCAyNTUgLSA0KSA6IG5CdWY7CisgICAgICAgICAgICBuQ29uc3VtZWROb3c9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICBpZHhsYXN0PWlkeDsKKyAgICAgICAgICAgIHN0YXR1cyA9IFBhY2tUbHZDb3JlKHBDdHgsKHRBTklfVTgqKXBTcmMscEJ1ZixuLHBuQ29uc3VtZWQsVExWU19QMlBOb3RpY2VPZkFic2VuY2UraWR4LCZpZHgpOworICAgICAgICAgICAgbkNvbnN1bWVkTm93PSpwbkNvbnN1bWVkLW5Db25zdW1lZE5vdzsKKyAgICAgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZFNvRmFyIC0gMjsKKyAgICAgICAgICAgIHBCdWYrPW5Db25zdW1lZE5vdzsKKyAgICAgICAgICAgIG5CdWYtPW5Db25zdW1lZE5vdzsKKyAgICAgICAgfSB3aGlsZSAoRE9UMTFGX0JVRkZFUl9PVkVSRkxPVyA9PSBzdGF0dXMgJiYgaWR4bGFzdCAhPSBpZHgpOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmUGFja0llUDJQTm90aWNlT2ZBYnNlbmNlLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVQMlBQcmVzZW5jZVJlc3BvbnNlKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVAyUFByZXNlbmNlUmVzcG9uc2UgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbiwgaWR4ID0gMCxpZHhsYXN0OworICAgIHRBTklfVTMyIG5Db25zdW1lZFNvRmFyLCBuQ29uc3VtZWROb3c7CisgICAgdEFOSV9VMzIgc3RhdHVzID0gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIHN0YXR1cyA9IGRvdDExZkdldFBhY2tlZElFUDJQUHJlc2VuY2VSZXNwb25zZShwQ3R4LCBwU3JjLCAmbk5lZWRlZCk7CisgICAgaWYgKCAhIERPVDExRl9TVUNDRUVERUQoIHN0YXR1cyApICkgcmV0dXJuIHN0YXR1czsKKyAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocFNyYy0+cHJlc2VudCkgeworICAgICAgICBkbyB7CisgICAgICAgIG5Db25zdW1lZFNvRmFyPSpwbkNvbnN1bWVkOworICAgICAgICAgICAgKnBCdWYgPSAyMjE7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4NTA7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDZmOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg5YTsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4OTsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICBuID0gKCAyNTUgLSA0KSA8IG5CdWYgPyAoIDI1NSAtIDQpIDogbkJ1ZjsKKyAgICAgICAgICAgIG5Db25zdW1lZE5vdz0qcG5Db25zdW1lZDsKKyAgICAgICAgICAgIGlkeGxhc3Q9aWR4OworICAgICAgICAgICAgc3RhdHVzID0gUGFja1RsdkNvcmUocEN0eCwodEFOSV9VOCopcFNyYyxwQnVmLG4scG5Db25zdW1lZCxUTFZTX1AyUFByZXNlbmNlUmVzcG9uc2UraWR4LCZpZHgpOworICAgICAgICAgICAgbkNvbnN1bWVkTm93PSpwbkNvbnN1bWVkLW5Db25zdW1lZE5vdzsKKyAgICAgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZFNvRmFyIC0gMjsKKyAgICAgICAgICAgIHBCdWYrPW5Db25zdW1lZE5vdzsKKyAgICAgICAgICAgIG5CdWYtPW5Db25zdW1lZE5vdzsKKyAgICAgICAgfSB3aGlsZSAoRE9UMTFGX0JVRkZFUl9PVkVSRkxPVyA9PSBzdGF0dXMgJiYgaWR4bGFzdCAhPSBpZHgpOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmUGFja0llUDJQUHJlc2VuY2VSZXNwb25zZS4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llUDJQUHJvYmVSZXEodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVAyUFByb2JlUmVxICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG4sIGlkeCA9IDAsaWR4bGFzdDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRTb0ZhciwgbkNvbnN1bWVkTm93OworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBzdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRJRVAyUFByb2JlUmVxKHBDdHgsIHBTcmMsICZuTmVlZGVkKTsKKyAgICBpZiAoICEgRE9UMTFGX1NVQ0NFRURFRCggc3RhdHVzICkgKSByZXR1cm4gc3RhdHVzOworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwU3JjLT5wcmVzZW50KSB7CisgICAgICAgIGRvIHsKKyAgICAgICAgbkNvbnN1bWVkU29GYXI9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICAqcEJ1ZiA9IDIyMTsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg1MDsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4NmY7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDlhOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg5OworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgIG4gPSAoIDI1NSAtIDQpIDwgbkJ1ZiA/ICggMjU1IC0gNCkgOiBuQnVmOworICAgICAgICAgICAgbkNvbnN1bWVkTm93PSpwbkNvbnN1bWVkOworICAgICAgICAgICAgaWR4bGFzdD1pZHg7CisgICAgICAgICAgICBzdGF0dXMgPSBQYWNrVGx2Q29yZShwQ3R4LCh0QU5JX1U4KilwU3JjLHBCdWYsbixwbkNvbnN1bWVkLFRMVlNfUDJQUHJvYmVSZXEraWR4LCZpZHgpOworICAgICAgICAgICAgbkNvbnN1bWVkTm93PSpwbkNvbnN1bWVkLW5Db25zdW1lZE5vdzsKKyAgICAgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZFNvRmFyIC0gMjsKKyAgICAgICAgICAgIHBCdWYrPW5Db25zdW1lZE5vdzsKKyAgICAgICAgICAgIG5CdWYtPW5Db25zdW1lZE5vdzsKKyAgICAgICAgfSB3aGlsZSAoRE9UMTFGX0JVRkZFUl9PVkVSRkxPVyA9PSBzdGF0dXMgJiYgaWR4bGFzdCAhPSBpZHgpOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmUGFja0llUDJQUHJvYmVSZXEuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVAyUFByb2JlUmVzKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVQMlBQcm9iZVJlcyAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuLCBpZHggPSAwLGlkeGxhc3Q7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkU29GYXIsIG5Db25zdW1lZE5vdzsKKyAgICB0QU5JX1UzMiBzdGF0dXMgPSBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgc3RhdHVzID0gZG90MTFmR2V0UGFja2VkSUVQMlBQcm9iZVJlcyhwQ3R4LCBwU3JjLCAmbk5lZWRlZCk7CisgICAgaWYgKCAhIERPVDExRl9TVUNDRUVERUQoIHN0YXR1cyApICkgcmV0dXJuIHN0YXR1czsKKyAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocFNyYy0+cHJlc2VudCkgeworICAgICAgICBkbyB7CisgICAgICAgIG5Db25zdW1lZFNvRmFyPSpwbkNvbnN1bWVkOworICAgICAgICAgICAgKnBCdWYgPSAyMjE7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4NTA7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDZmOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg5YTsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4OTsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICBuID0gKCAyNTUgLSA0KSA8IG5CdWYgPyAoIDI1NSAtIDQpIDogbkJ1ZjsKKyAgICAgICAgICAgIG5Db25zdW1lZE5vdz0qcG5Db25zdW1lZDsKKyAgICAgICAgICAgIGlkeGxhc3Q9aWR4OworICAgICAgICAgICAgc3RhdHVzID0gUGFja1RsdkNvcmUocEN0eCwodEFOSV9VOCopcFNyYyxwQnVmLG4scG5Db25zdW1lZCxUTFZTX1AyUFByb2JlUmVzK2lkeCwmaWR4KTsKKyAgICAgICAgICAgIG5Db25zdW1lZE5vdz0qcG5Db25zdW1lZC1uQ29uc3VtZWROb3c7CisgICAgICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRTb0ZhciAtIDI7CisgICAgICAgICAgICBwQnVmKz1uQ29uc3VtZWROb3c7CisgICAgICAgICAgICBuQnVmLT1uQ29uc3VtZWROb3c7CisgICAgICAgIH0gd2hpbGUgKERPVDExRl9CVUZGRVJfT1ZFUkZMT1cgPT0gc3RhdHVzICYmIGlkeGxhc3QgIT0gaWR4KTsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlBhY2tJZVAyUFByb2JlUmVzLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVQMlBQcm92aXNpb25EaXNjb3ZlcnlSZXEodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVQMlBQcm92aXNpb25EaXNjb3ZlcnlSZXEgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbiwgaWR4ID0gMCxpZHhsYXN0OworICAgIHRBTklfVTMyIG5Db25zdW1lZFNvRmFyLCBuQ29uc3VtZWROb3c7CisgICAgdEFOSV9VMzIgc3RhdHVzID0gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIHN0YXR1cyA9IGRvdDExZkdldFBhY2tlZElFUDJQUHJvdmlzaW9uRGlzY292ZXJ5UmVxKHBDdHgsIHBTcmMsICZuTmVlZGVkKTsKKyAgICBpZiAoICEgRE9UMTFGX1NVQ0NFRURFRCggc3RhdHVzICkgKSByZXR1cm4gc3RhdHVzOworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwU3JjLT5wcmVzZW50KSB7CisgICAgICAgIGRvIHsKKyAgICAgICAgbkNvbnN1bWVkU29GYXI9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICAqcEJ1ZiA9IDIyMTsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg1MDsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAg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dHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUDJQV1NDUHJvdmlzaW9uRGlzY292ZXJ5UmVzICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG4sIGlkeCA9IDAsaWR4bGFzdDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRTb0ZhciwgbkNvbnN1bWVkTm93OworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBzdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRJRVAyUFdTQ1Byb3Zpc2lvbkRpc2NvdmVyeVJlcyhwQ3R4LCBwU3JjLCAmbk5lZWRlZCk7CisgICAgaWYgKCAhIERPVDExRl9TVUNDRUVERUQoIHN0YXR1cyApICkgcmV0dXJuIHN0YXR1czsKKyAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocFNyYy0+cHJlc2VudCkgeworICAgICAgICBkbyB7CisgICAgICAgIG5Db25zdW1lZFNvRmFyPSpwbkNvbnN1bWVkOworICAgICAgICAgICAgKnBCdWYgPSAyMjE7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgcEllTGVuID0gcEJ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0YXR1czsKK30gLyogRW5kIGRvdDExZlBhY2tJZVAyUFdTQ1Byb3Zpc2lvbkRpc2NvdmVyeVJlcy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llUFRJQ29udHJvbCh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVQVElDb250cm9sICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gMzsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDEwNTsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnRpZDsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5zZXF1ZW5jZV9jb250cm9sLCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVQVElDb250cm9sLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVQVUJ1ZmZlclN0YXR1cyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUFVCdWZmZXJTdGF0dXMgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICB0QU5JX1U4IHRtcDE0NF9fOworICAgIG5OZWVkZWQgICs9IDE7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAxMDY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgdG1wMTQ0X18gPSAwVTsKKyAgICAgICAgdG1wMTQ0X18gfD0gKCBwU3JjLT5hY19ia190cmFmZmljX2F2YWwgPDwgMCApOworICAgICAgICB0bXAxNDRfXyB8PSAoIHBTcmMtPmFjX2JlX3RyYWZmaWNfYXZhbCA8PCAxICk7CisgICAgICAgIHRtcDE0NF9fIHw9ICggcFNyYy0+YWNfdmlfdHJhZmZpY19hdmFsIDw8IDIgKTsKKyAgICAgICAgdG1wMTQ0X18gfD0gKCBwU3JjLT5hY192b190cmFmZmljX2F2YWwgPDwgMyApOworICAgICAgICB0bXAxNDRfXyB8PSAoIHBTcmMtPnJlc2VydmVkIDw8IDQgKTsKKyAgICAgICAgKnBCdWYgPSB0bXAxNDRfXzsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyAgPSAxCisgICAgICAgIG5CdWYgLT0gIDEgOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVBVQnVmZmVyU3RhdHVzLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVQb3dlckNhcHModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVQb3dlckNhcHMgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICArPSAyOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gMzM7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5taW5UeFBvd2VyOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICpwQnVmID0gcFNyYy0+bWF4VHhQb3dlcjsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVQb3dlckNhcHMuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVBvd2VyQ29uc3RyYWludHModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUG93ZXJDb25zdHJhaW50cyAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOS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gICAgICAgdERvdDExZklFUUJTU0xvYWQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICArPSA1OworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gMTE7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+c3RhY291bnQsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgICpwQnVmID0gcFNyYy0+Y2hhdXRpbDsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5hdmFpbCwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llUUJTU0xvYWQuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVFPU0NhcHNBcCh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVFPU0NhcHNBcCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIHRBTklfVTggdG1wMTQ1X187CisgICAgbk5lZWRlZCAgKz0gMTsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDQ2OworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHRtcDE0NV9fID0gMFU7CisgICAgICAgIHRtcDE0NV9fIHw9ICggcFNyYy0+Y291bnQgPDwgMCApOworICAgICAgICB0bXAxNDVfXyB8PSAoIHBTcmMtPnFhY2sgPDwgNCApOworICAgICAgICB0bXAxNDVfXyB8PSAoIHBTcmMtPnFyZXEgPDwgNSApOworICAgICAgICB0bXAxNDVfXyB8PSAoIHBTcmMtPnR4b3ByZXEgPDwgNiApOworICAgICAgICB0bXAxNDVfXyB8PSAoIHBTcmMtPnJlc2VydmVkIDw8IDcgKTsKKyAgICAgICAgKnBCdWYgPSB0bXAxNDVfXzsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyAgPSAxCisgICAgICAgIG5CdWYgLT0gIDEgOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVFPU0NhcHNBcC4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llUU9TQ2Fwc1N0YXRpb24odHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVFPU0NhcHNTdGF0aW9uICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgdEFOSV9VOCB0bXAxNDZfXzsKKyAgICBuTmVlZGVkICArPSAxOworICAgIH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0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVFPU0NhcHNTdGF0aW9uLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVRb3NNYXBTZXQodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVRb3NNYXBTZXQgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICArPSAgcFNyYy0+bnVtX2RzY3BfZXhjZXB0aW9uczsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDExMDsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsICYoIHBTcmMtPmRzY3BfZXhjZXB0aW9ucyApLCBwU3JjLT5udW1fZHNjcF9leGNlcHRpb25zKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gcFNyYy0+bnVtX2RzY3BfZXhjZXB0aW9uczsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVRb3NNYXBTZXQuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVF1aWV0KHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVRdWlldCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9IDY7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSA0MDsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPmNvdW50OworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICpwQnVmID0gcFNyYy0+cGVyaW9kOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmR1cmF0aW9uLCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5vZmZzZXQsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVF1aWV0LiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVSQ1BJSUUodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVSQ1BJSUUgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICArPSAxOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gNTM7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5yY3BpOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVJDUElJRS4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llUklDRGF0YURlc2ModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVJJQ0RhdGFEZXNjICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgdEFOSV9VMzIgc3RhdHVzID0gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7CisgICAgc3RhdHVzID0gZG90MTFmR2V0UGFja2VkSUVSSUNEYXRhRGVzYyhwQ3R4LCBwU3JjLCAmbk5lZWRlZCk7CisgICAgaWYgKCAhIERPVDExRl9TVUNDRUVERUQoIHN0YXR1cyApICkgcmV0dXJuIHN0YXR1czsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICBzdGF0dXMgPSBQYWNrQ29yZShwQ3R4LAorICAgICAgICAgICh0QU5JX1U4KilwU3JjLAorICAgICAgICAgIHBCdWYsCisgICAgICAgICAgbkJ1ZiwKKyAgICAgICAgICBwbkNvbnN1bWVkLAorICAgICAgICAgIEZGU19SSUNEYXRhRGVzYywKKyAgICAgICAgICBJRVNfUklDRGF0YURlc2MpOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmUGFja0llUklDRGF0YURlc2MuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVJTTih0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVJTTiAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgIHN0YXR1cyA9IGRvdDExZkdldFBhY2tlZElFUlNOKHBDdHgsIHBTcmMsICZuTmVlZGVkKTsKKyAgICBpZiAoICEgRE9UMTFGX1NVQ0NFRURFRCggc3RhdHVzICkgKSByZXR1cm4gc3RhdHVzOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gNDg7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+dmVyc2lvbiwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCBwU3JjLT5ncF9jaXBoZXJfc3VpdGUsIDQpOworICAgICAgICAqcG5Db25zdW1lZCArPSA0OworICAgICAgICBwQnVmICs9IDQ7CisgICAgICAgIGlmICggcFNyYy0+cHdpc2VfY2lwaGVyX3N1aXRlX2NvdW50ICkgICAgICAgIHsKKyAgICAgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPnB3aXNlX2NpcGhlcl9zdWl0ZV9jb3VudCwgMCk7CisgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICB9CisgICAgICAgIGVsc2UgYnJlYWs7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+cHdpc2VfY2lwaGVyX3N1aXRlcyApLCAoIHBTcmMtPnB3aXNlX2NpcGhlcl9zdWl0ZV9jb3VudCAqIDQgKSk7CisgICAgICAgICpwbkNvbnN1bWVkICs9ICggcFNyYy0+cHdpc2VfY2lwaGVyX3N1aXRlX2NvdW50ICogNCApOworICAgICAgICBwQnVmICs9ICggcFNyYy0+cHdpc2VfY2lwaGVyX3N1aXRlX2NvdW50ICogNCApOworICAgICAgICBpZiAoIHBTcmMtPmFrbV9zdWl0ZV9jb3VudCApICAgICAgICB7CisgICAgICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5ha21fc3VpdGVfY291bnQsIDApOworICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGJyZWFrOworICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsICYoIHBTcmMtPmFrbV9zdWl0ZXMgKSwgKCBwU3JjLT5ha21fc3VpdGVfY291bnQgKiA0ICkpOworICAgICAgICAqcG5Db25zdW1lZCArPSAoIHBTcmMtPmFrbV9zdWl0ZV9jb3VudCAqIDQgKTsKKyAgICAgICAgcEJ1ZiArPSAoIHBTcmMtPmFrbV9zdWl0ZV9jb3VudCAqIDQgKTsKKyAgICAgICAgaWYgKCBwU3JjLT5SU05fQ2FwICkgICAgICAgIHsKKyAgICAgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+UlNOX0NhcCwgMik7CisgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICB9CisgICAgICAgIGVsc2UgYnJlYWs7CisgICAgICAgIGlmICggcFNyYy0+cG1raWRfY291bnQgKSAgICAgICAgeworICAgICAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+cG1raWRfY291bnQsIDApOworICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGJyZWFrOworICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsICYoIHBTcmMtPnBta2lkICksICggcFNyYy0+cG1raWRfY291bnQgKiAxNiApKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gKCBwU3JjLT5wbWtpZF9jb3VudCAqIDE2ICk7CisgICAgICAgIHBCdWYgKz0gKCBwU3JjLT5wbWtpZF9jb3VudCAqIDE2ICk7CisgICAgICAgIGlmICggcFNyYy0+Z3BfbWdtdF9jaXBoZXJfc3VpdGUgKSAgICAgICAgeworICAgICAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCBwU3JjLT5ncF9tZ210X2NpcGhlcl9zdWl0ZSwgNCk7CisgICAgICAgICAgICAqcG5Db25zdW1lZCArPSA0OworICAgICAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgfQorICAgICAgICBlbHNlIGJyZWFrOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVSU04uICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVJTTklJRSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVJTTklJRSAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9IDE7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSA2NTsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnJzbmk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llUlNOSUlFLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVSU05PcGFxdWUodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVSU05PcGFxdWUgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICArPSAgcFNyYy0+bnVtX2RhdGE7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSA0ODsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsICYoIHBTcmMtPmRhdGEgKSwgcFNyYy0+bnVtX2RhdGEpOworICAgICAgICAqcG5Db25zdW1lZCArPSBwU3JjLT5udW1fZGF0YTsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVSU05PcGFxdWUuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVN1cHBDaGFubmVscyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVN1cHBDaGFubmVscyAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9ICBwU3JjLT5udW1fYmFuZHMgKiAyOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gMzY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCAmKCBwU3JjLT5iYW5kcyApLCAoIHBTcmMtPm51bV9iYW5kcyAqIDIgKSk7CisgICAgICAgICpwbkNvbnN1bWVkICs9ICggcFNyYy0+bnVtX2JhbmRzICogMiApOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVN1cHBDaGFubmVscy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llU3VwcE9wZXJhdGluZ0NsYXNzZXModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVN1cHBPcGVyYXRpbmdDbGFzc2VzICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gIHBTcmMtPm51bV9jbGFzc2VzOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gNTk7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgRE9UMTFGX01FTUNQWShwQ3R4LCBwQnVmLCAmKCBwU3JjLT5jbGFzc2VzICksIHBTcmMtPm51bV9jbGFzc2VzKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gcFNyYy0+bnVtX2NsYXNzZXM7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llU3VwcE9wZXJhdGluZ0NsYXNzZXMuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVN1cHBSYXRlcyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVN1cHBSYXRlcyAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9ICBwU3JjLT5udW1fcmF0ZXM7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAxOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+cmF0ZXMgKSwgcFNyYy0+bnVtX3JhdGVzKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gcFNyYy0+bnVtX3JhdGVzOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVN1cHBSYXRlcy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llVElNKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFVElNICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gIChwU3JjLT5udW1fdmJtcCArIDMpOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gNTsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPmR0aW1fY291bnQ7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5kdGltX3BlcmlvZDsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPmJtcGN0bDsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsICYoIHBTcmMtPnZibXAgKSwgcFNyYy0+bnVtX3ZibXApOworICAgICAgICAqcG5Db25zdW1lZCArPSBwU3JjLT5udW1fdmJtcDsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVUSU0uICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVRQQ1JlcG9ydCh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVRQQ1JlcG9ydCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9IDI7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAzNTsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnR4X3Bvd2VyOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICpwQnVmID0gcFNyYy0+bGlua19tYXJnaW47CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llVFBDUmVwb3J0LiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVUUENSZXF1ZXN0KHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVRQQ1JlcXVlc3QgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICArPSAwOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gMzQ7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVUUENSZXF1ZXN0LiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVUaW1lb3V0SW50ZXJ2YWwodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVUaW1lb3V0SW50ZXJ2YWwgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICArPSA1OworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gNTY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT50aW1lb3V0VHlwZTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBmcmFtZXNodG9ubChwQ3R4LCBwQnVmLCBwU3JjLT50aW1lb3V0VmFsdWUsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSA0OworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVRpbWVvdXRJbnRlcnZhbC4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llVkhUQ2Fwcyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVWSFRDYXBzICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBw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cEJ1ZiArPSAyOworICAgICAgICB0bXAxNDhfXyA9IDBVOworICAgICAgICB0bXAxNDhfXyB8PSAoIHBTcmMtPnJ4SGlnaFN1cERhdGFSYXRlIDw8IDAgKTsKKyAgICAgICAgdG1wMTQ4X18gfD0gKCBwU3JjLT5yZXNlcnZlZDIgPDwgMTMgKTsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgdG1wMTQ4X18sIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIG5CdWYgLT0gIDIgOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT50eE1DU01hcCwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgdG1wMTQ5X18gPSAwVTsKKyAgICAgICAgdG1wMTQ5X18gfD0gKCBwU3JjLT50eFN1cERhdGFSYXRlIDw8IDAgKTsKKyAgICAgICAgdG1wMTQ5X18gfD0gKCBwU3JjLT5yZXNlcnZlZDMgPDwgMTMgKTsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgdG1wMTQ5X18sIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnICA9IDEKKyAgICAgICAgbkJ1ZiAtPSAgMiA7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llVkhUQ2Fwcy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llVkhURXh0QnNzTG9hZCh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVWSFRFeHRCc3NMb2FkICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gNTsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDE5MzsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPm11TUlNT0NhcFN0YUNvdW50OworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICpwQnVmID0gcFNyYy0+c3NVbmRlclV0aWw7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5Gb3J0eU1IelV0aWw7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5FaWdodHlNSHpVdGlsOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICpwQnVmID0gcFNyYy0+T25lU2l4dHlNSHpVdGlsOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVZIVEV4dEJzc0xvYWQuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVZIVE9wZXJhdGlvbih0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVZIVE9wZXJhdGlvbiAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9IDU7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAxOTI7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5jaGFuV2lkdGg7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5jaGFuQ2VudGVyRnJlcVNlZzE7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT5jaGFuQ2VudGVyRnJlcVNlZzI7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+YmFzaWNNQ1NTZXQsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVZIVE9wZXJhdGlvbi4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llV0FQSSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVXQVBJICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0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gIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmJraWRfY291bnQsIDApOworICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGJyZWFrOworICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsICYoIHBTcmMtPmJraWQgKSwgKCBwU3JjLT5ia2lkX2NvdW50ICogMTYgKSk7CisgICAgICAgICpwbkNvbnN1bWVkICs9ICggcFNyYy0+YmtpZF9jb3VudCAqIDE2ICk7CisgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlBhY2tJZVdBUEkuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVdBUElPcGFxdWUodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFV0FQSU9wYXF1ZSAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9ICBwU3JjLT5udW1fZGF0YTsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDY4OworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+ZGF0YSApLCBwU3JjLT5udW1fZGF0YSk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IHBTcmMtPm51bV9kYXRhOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVdBUElPcGFxdWUuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVdGQVRQQyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdGQVRQQyAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9IDI7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAyMjE7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDA7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4NTA7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4ZjI7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4ODsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHgwOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT50eFBvd2VyOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICpwQnVmID0gcFNyYy0+bGlua01hcmdpbjsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVXRkFUUEMuICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tJZVdGRElFT3BhcXVlKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVXRkRJRU9wYXF1ZSAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQpCit7CisgICAgdEFOSV9VOCogcEllTGVuID0gMDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRPbkVudHJ5ID0gKnBuQ29uc3VtZWQ7CisgICAgdEFOSV9VMzIgbk5lZWRlZCA9IDBVOworICAgIG5OZWVkZWQgICs9ICBwU3JjLT5udW1fZGF0YTsKKyAgICB3aGlsZSAoIHBTcmMtPnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICAgICAqcEJ1ZiA9IDIyMTsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4NTA7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4NmY7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4OWE7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4YTsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+ZGF0YSApLCBwU3JjLT5udW1fZGF0YSk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IHBTcmMtPm51bV9kYXRhOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVdGRElFT3BhcXVlLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVXTU1DYXBzKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdNTUNhcHMgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICB0QU5JX1U4IHRtcDE1MV9fOworICAgIG5OZWVkZWQgICs9IDI7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAyMjE7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDA7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4NTA7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4ZjI7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4MjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHg1OworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT52ZXJzaW9uOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIHRtcDE1MV9fID0gMFU7CisgICAgICAgIHRtcDE1MV9fIHw9ICggcFNyYy0+cmVzZXJ2ZWQgPDwgMCApOworICAgICAgICB0bXAxNTFfXyB8PSAoIHBTcmMtPnFhY2sgPDwgNCApOworICAgICAgICB0bXAxNTFfXyB8PSAoIHBTcmMtPnF1ZXVlX3JlcXVlc3QgPDwgNSApOworICAgICAgICB0bXAxNTFfXyB8PSAoIHBTcmMtPnR4b3BfcmVxdWVzdCA8PCA2ICk7CisgICAgICAgIHRtcDE1MV9fIHw9ICggcFNyYy0+bW9yZV9hY2sgPDwgNyApOworICAgICAgICAqcEJ1ZiA9IHRtcDE1MV9fOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnICA9IDEKKyAgICAgICAgbkJ1ZiAtPSAgMSA7CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwSWVMZW4pCisgICAgeworICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRPbkVudHJ5IC0gMjsKKyAgICB9CisgICAgcmV0dXJuIERPVDExRl9QQVJTRV9TVUNDRVNTOworfSAvKiBFbmQgZG90MTFmUGFja0llV01NQ2Fwcy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llV01NSW5mb0FwKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFV01NSW5mb0FwICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgdEFOSV9VOCB0bXAxNTJfXzsKKyAgICBuTmVlZGVkICArPSAyOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gMjIxOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHgwOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDUwOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweGYyOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDI7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4MDsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gcFNyYy0+dmVyc2lvbjsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICB0bXAxNTJfXyA9IDBVOworICAgICAgICB0bXAxNTJfXyB8PSAoIHBTcmMtPnBhcmFtX3NldF9jb3VudCA8PCAwICk7CisgICAgICAgIHRtcDE1Ml9fIHw9ICggcFNyYy0+cmVzZXJ2ZWQgPDwgNCApOworICAgICAgICB0bXAxNTJfXyB8PSAoIHBTcmMtPnVhcHNkIDw8IDcgKTsKKyAgICAgICAgKnBCdWYgPSB0bXAxNTJfXzsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyAgPSAxCisgICAgICAgIG5CdWYgLT0gIDEgOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVdNTUluZm9BcC4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llV01NSW5mb1N0YXRpb24odHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdNTUluZm9TdGF0aW9uICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgdEFOSV9VOCB0bXAxNTNfXzsKKyAgICBuTmVlZGVkICArPSAyOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gMjIxOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHgwOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDUwOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweGYyOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDI7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4MDsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVm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mMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICB0QU5JX1U4IHRtcDE1NF9fOworICAgIHRBTklfVTggdG1wMTU1X187CisgICAgdEFOSV9VOCB0bXAxNTZfXzsKKyAgICB0QU5JX1U4IHRtcDE1N19fOworICAgIHRBTklfVTggdG1wMTU4X187CisgICAgdEFOSV9VOCB0bXAxNTlfXzsKKyAgICB0QU5JX1U4IHRtcDE2MF9fOworICAgIHRBTklfVTggdG1wMTYxX187CisgICAgbk5lZWRlZCAgKz0gMTk7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAyMjE7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDA7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4NTA7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4ZjI7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4MjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHgxOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSBwU3JjLT52ZXJzaW9uOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgICpwQnVmID0gcFNyYy0+cW9zSW5mbzsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICAqcEJ1ZiA9IHBTcmMtPnJlc2VydmVkMjsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICB0bXAxNTRfXyA9IDBVOworICAgICAgICB0bXAxNTRfXyB8PSAoIHBTcmMtPmFjYmVfYWlmc24gPDwgMCApOworICAgICAgICB0bXAxNTRfXyB8PSAoIHBTcmMtPmFjYmVfYWNtIDw8IDQgKTsKKyAgICAgICAgdG1wMTU0X18gfD0gKCBwU3JjLT5hY2JlX2FjaSA8PCA1ICk7CisgICAgICAgIHRtcDE1NF9fIHw9ICggcFNyYy0+dW51c2VkMSA8PCA3ICk7CisgICAgICAgICpwQnVmID0gdG1wMTU0X187CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgbkJ1ZiAtPSAgMSA7CisgICAgICAgIHRtcDE1NV9fID0gMFU7CisgICAgICAgIHRtcDE1NV9fIHw9ICggcFNyYy0+YWNiZV9hY3dtaW4gPDwgMCApOworICAgICAgICB0bXAxNTVfXyB8PSAoIHBTcmMtPmFjYmVfYWN3bWF4IDw8IDQgKTsKKyAgICAgICAgKnBCdWYgPSB0bXAxNTVfXzsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBuQnVmIC09ICAxIDsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+YWNiZV90eG9wbGltaXQsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIHRtcDE1Nl9fID0gMFU7CisgICAgICAgIHRtcDE1Nl9fIHw9ICggcFNyYy0+YWNia19haWZzbiA8PCAwICk7CisgICAgICAgIHRtcDE1Nl9fIHw9ICggcFNyYy0+YWNia19hY20gPDwgNCApOworICAgICAgICB0bXAxNTZfXyB8PSAoIHBTcmMtPmFjYmtfYWNpIDw8IDUgKTsKKyAgICAgICAgdG1wMTU2X18gfD0gKCBwU3JjLT51bnVzZWQyIDw8IDcgKTsKKyAgICAgICAgKnBCdWYgPSB0bXAxNTZfXzsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBuQnVmIC09ICAxIDsKKyAgICAgICAgdG1wMTU3X18gPSAwVTsKKyAgICAgICAgdG1wMTU3X18gfD0gKCBwU3JjLT5hY2JrX2Fjd21pbiA8PCAwICk7CisgICAgICAgIHRtcDE1N19fIHw9ICggcFNyYy0+YWNia19hY3dtYXggPDwgNCApOworICAgICAgICAqcEJ1ZiA9IHRtcDE1N19fOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIG5CdWYgLT0gIDEgOworICAgICAgICBmcmFtZXNodG9ucyhwQ3R4LCBwQnVmLCBwU3JjLT5hY2JrX3R4b3BsaW1pdCwgMCk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IDI7CisgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgdG1wMTU4X18gPSAwVTsKKyAgICAgICAgdG1wMTU4X18gfD0gKCBwU3JjLT5hY3ZpX2FpZnNuIDw8IDAgKTsKKyAgICAgICAgdG1wMTU4X18gfD0gKCBwU3JjLT5hY3ZpX2FjbSA8PCA0ICk7CisgICAgICAgIHRtcDE1OF9fIHw9ICggcFNyYy0+YWN2aV9hY2kgPDwgNSApOworICAgICAgICB0bXAxNThfXyB8PSAoIHBTcmMtPnVudXNlZDMgPDwgNyApOworICAgICAgICAqcEJ1ZiA9IHRtcDE1OF9fOworICAgICAgICAqcG5Db25zdW1lZCArPSAxOworICAgICAgICBwQnVmICs9IDE7CisgICAgICAgIG5CdWYgLT0gIDEgOworICAgICAgICB0bXAxNTlfXyA9IDBVOworICAgICAgICB0bXAxNTlfXyB8PSAoIHBTcmMtPmFjdmlfYWN3bWluIDw8IDAgKTsKKyAgICAgICAgdG1wMTU5X18gfD0gKCBwU3JjLT5hY3ZpX2Fjd21heCA8PCA0ICk7CisgICAgICAgICpwQnVmID0gdG1wMTU5X187CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgbkJ1ZiAtPSAgMSA7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmFjdmlfdHhvcGxpbWl0LCAwKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICB0bXAxNjBfXyA9IDBVOworICAgICAgICB0bXAxNjBfXyB8PSAoIHBTcmMtPmFjdm9fYWlmc24gPDwgMCApOworICAgICAgICB0bXAxNjBfXyB8PSAoIHBTcmMtPmFjdm9fYWNtIDw8IDQgKTsKKyAgICAgICAgdG1wMTYwX18gfD0gKCBwU3JjLT5hY3ZvX2FjaSA8PCA1ICk7CisgICAgICAgIHRtcDE2MF9fIHw9ICggcFNyYy0+dW51c2VkNCA8PCA3ICk7CisgICAgICAgICpwQnVmID0gdG1wMTYwX187CisgICAgICAgICpwbkNvbnN1bWVkICs9IDE7CisgICAgICAgIHBCdWYgKz0gMTsKKyAgICAgICAgbkJ1ZiAtPSAgMSA7CisgICAgICAgIHRtcDE2MV9fID0gMFU7CisgICAgICAgIHRtcDE2MV9fIHw9ICggcFNyYy0+YWN2b19hY3dtaW4gPDwgMCApOworICAgICAgICB0bXAxNjFfXyB8PSAoIHBTcmMtPmFjdm9fYWN3bWF4IDw8IDQgKTsKKyAgICAgICAgKnBCdWYgPSB0bXAxNjFfXzsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gMTsKKyAgICAgICAgcEJ1ZiArPSAxOworICAgICAgICBuQnVmIC09ICAxIDsKKyAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+YWN2b190eG9wbGltaXQsIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVdNTVBhcmFtcy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llV1BBKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFV1BBICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgdEFOSV9VMzIgc3RhdHVzID0gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7CisgICAgc3RhdHVzID0gZG90MTFmR2V0UGFja2VkSUVXUEEocEN0eCwgcFNyYywgJm5OZWVkZWQpOworICAgIGlmICggISBET1QxMUZfU1VDQ0VFREVEKCBzdGF0dXMgKSApIHJldHVybiBzdGF0dXM7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAyMjE7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDA7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4NTA7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4ZjI7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4MTsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPnZlcnNpb24sIDApOworICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICBwQnVmICs9IDI7CisgICAgICAgIGlmICggcFNyYy0+bXVsdGljYXN0X2NpcGhlcl9wcmVzZW50ICkgICAgICAgIHsKKyAgICAgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgcFNyYy0+bXVsdGljYXN0X2NpcGhlciwgNCk7CisgICAgICAgICAgICAqcG5Db25zdW1lZCArPSA0OworICAgICAgICAgICAgcEJ1ZiArPSA0OworICAgICAgICB9CisgICAgICAgIGVsc2UgYnJlYWs7CisgICAgICAgIGlmICggcFNyYy0+dW5pY2FzdF9jaXBoZXJfY291bnQgKSAgICAgICAgeworICAgICAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+dW5pY2FzdF9jaXBoZXJfY291bnQsIDApOworICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgICAgIHBCdWYgKz0gMjsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGJyZWFrOworICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsICYoIHBTcmMtPnVuaWNhc3RfY2lwaGVycyApLCAoIHBTcmMtPnVuaWNhc3RfY2lwaGVyX2NvdW50ICogNCApKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gKCBwU3JjLT51bmljYXN0X2NpcGhlcl9jb3VudCAqIDQgKTsKKyAgICAgICAgcEJ1ZiArPSAoIHBTcmMtPnVuaWNhc3RfY2lwaGVyX2NvdW50ICogNCApOworICAgICAgICBpZiAoIHBTcmMtPmF1dGhfc3VpdGVfY291bnQgKSAgICAgICAgeworICAgICAgICAgICAgZnJhbWVzaHRvbnMocEN0eCwgcEJ1ZiwgcFNyYy0+YXV0aF9zdWl0ZV9jb3VudCwgMCk7CisgICAgICAgICAgICAqcG5Db25zdW1lZCArPSAyOworICAgICAgICAgICAgcEJ1ZiArPSAyOworICAgICAgICB9CisgICAgICAgIGVsc2UgYnJlYWs7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+YXV0aF9zdWl0ZXMgKSwgKCBwU3JjLT5hdXRoX3N1aXRlX2NvdW50ICogNCApKTsKKyAgICAgICAgKnBuQ29uc3VtZWQgKz0gKCBwU3JjLT5hdXRoX3N1aXRlX2NvdW50ICogNCApOworICAgICAgICBwQnVmICs9ICggcFNyYy0+YXV0aF9zdWl0ZV9jb3VudCAqIDQgKTsKKyAgICAgICAgaWYgKCBwU3JjLT5jYXBzICkgICAgICAgIHsKKyAgICAgICAgICAgIGZyYW1lc2h0b25zKHBDdHgsIHBCdWYsIHBTcmMtPmNhcHMsIDApOworICAgICAgICAgICAgKnBuQ29uc3VtZWQgKz0gMjsKKyAgICAgICAgICAgIC8vIGZpZWxkc0VuZEZsYWcgPSAxCisgICAgICAgIH0KKyAgICAgICAgZWxzZSBicmVhazsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gc3RhdHVzOworfSAvKiBFbmQgZG90MTFmUGFja0llV1BBLiAqLworCit0QU5JX1UzMiBkb3QxMWZQYWNrSWVXUEFPcGFxdWUodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVXUEFPcGFxdWUgKnBTcmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTgqIHBJZUxlbiA9IDA7CisgICAgdEFOSV9VMzIgbkNvbnN1bWVkT25FbnRyeSA9ICpwbkNvbnN1bWVkOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBuTmVlZGVkICArPSAgcFNyYy0+bnVtX2RhdGE7CisgICAgd2hpbGUgKCBwU3JjLT5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgKnBCdWYgPSAyMjE7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDA7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4NTA7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4ZjI7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAqcEJ1ZiA9IDB4MTsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgIERPVDExRl9NRU1DUFkocEN0eCwgcEJ1ZiwgJiggcFNyYy0+ZGF0YSApLCBwU3JjLT5udW1fZGF0YSk7CisgICAgICAgICpwbkNvbnN1bWVkICs9IHBTcmMtPm51bV9kYXRhOworICAgICAgICAvLyBmaWVsZHNFbmRGbGFnID0gMQorICAgICAgICBicmVhazsKKyAgICB9CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocEllTGVuKQorICAgIHsKKyAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkT25FbnRyeSAtIDI7CisgICAgfQorICAgIHJldHVybiBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKK30gLyogRW5kIGRvdDExZlBhY2tJZVdQQU9wYXF1ZS4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llV1NDKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFV1NDICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX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QnVmID0gMHg0OworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgIG4gPSAoIDI1NSAtIDQpIDwgbkJ1ZiA/ICggMjU1IC0gNCkgOiBuQnVmOworICAgICAgICAgICAgbkNvbnN1bWVkTm93PSpwbkNvbnN1bWVkOworICAgICAgICAgICAgaWR4bGFzdD1pZHg7CisgICAgICAgICAgICBzdGF0dXMgPSBQYWNrVGx2Q29yZShwQ3R4LCh0QU5JX1U4KilwU3JjLHBCdWYsbixwbkNvbnN1bWVkLFRMVlNfV1NDK2lkeCwmaWR4KTsKKyAgICAgICAgICAgIG5Db25zdW1lZE5vdz0qcG5Db25zdW1lZC1uQ29uc3VtZWROb3c7CisgICAgICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRTb0ZhciAtIDI7CisgICAgICAgICAgICBwQnVmKz1uQ29uc3VtZWROb3c7CisgICAgICAgICAgICBuQnVmLT1uQ29uc3VtZWROb3c7CisgICAgICAgIH0gd2hpbGUgKERPVDExRl9CVUZGRVJfT1ZFUkZMT1cgPT0gc3RhdHVzICYmIGlkeGxhc3QgIT0gaWR4KTsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlBhY2tJZVdTQy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llV2lkZXJCV0NoYW5Td2l0Y2hBbm4odHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdpZGVyQldDaGFuU3dpdGNoQW5uICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAg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ckJXQ2hhblN3aXRjaEFubi4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llV3NjQXNzb2NSZXEodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdzY0Fzc29jUmVxICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG4sIGlkeCA9IDAsaWR4bGFzdDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRTb0ZhciwgbkNvbnN1bWVkTm93OworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBzdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRJRVdzY0Fzc29jUmVxKHBDdHgsIHBTcmMsICZuTmVlZGVkKTsKKyAgICBpZiAoICEgRE9UMTFGX1NVQ0NFRURFRCggc3RhdHVzICkgKSByZXR1cm4gc3RhdHVzOworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwU3JjLT5wcmVzZW50KSB7CisgICAgICAgIGRvIHsKKyAgICAgICAgbkNvbnN1bWVkU29GYXI9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICAqcEJ1ZiA9IDIyMTsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHgwOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg1MDsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4ZjI7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDQ7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgbiA9ICggMjU1IC0gNCkgPCBuQnVmID8gKCAyNTUgLSA0KSA6IG5CdWY7CisgICAgICAgICAgICBuQ29uc3VtZWROb3c9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICBpZHhsYXN0PWlkeDsKKyAgICAgICAgICAgIHN0YXR1cyA9IFBhY2tUbHZDb3JlKHBDdHgsKHRBTklfVTgqKXBTcmMscEJ1ZixuLHBuQ29uc3VtZWQsVExWU19Xc2NBc3NvY1JlcStpZHgsJmlkeCk7CisgICAgICAgICAgICBuQ29uc3VtZWROb3c9KnBuQ29uc3VtZWQtbkNvbnN1bWVkTm93OworICAgICAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkU29GYXIgLSAyOworICAgICAgICAgICAgcEJ1Zis9bkNvbnN1bWVkTm93OworICAgICAgICAgICAgbkJ1Zi09bkNvbnN1bWVkTm93OworICAgICAgICB9IHdoaWxlIChET1QxMUZfQlVGRkVSX09WRVJGTE9XID09IHN0YXR1cyAmJiBpZHhsYXN0ICE9IGlkeCk7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVXc2NBc3NvY1JlcS4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llV3NjQXNzb2NSZXModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdzY0Fzc29jUmVzICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG4sIGlkeCA9IDAsaWR4bGFzdDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRTb0ZhciwgbkNvbnN1bWVkTm93OworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBzdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRJRVdzY0Fzc29jUmVzKHBDdHgsIHBTcmMsICZuTmVlZGVkKTsKKyAgICBpZiAoICEgRE9UMTFGX1NVQ0NFRURFRCggc3RhdHVzICkgKSByZXR1cm4gc3RhdHVzOworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwU3JjLT5wcmVzZW50KSB7CisgICAgICAgIGRvIHsKKyAgICAgICAgbkNvbnN1bWVkU29GYXI9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICAqcEJ1ZiA9IDIyMTsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHgwOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg1MDsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4ZjI7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDQ7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgbiA9ICggMjU1IC0gNCkgPCBuQnVmID8gKCAyNTUgLSA0KSA6IG5CdWY7CisgICAgICAgICAgICBuQ29uc3VtZWROb3c9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICBpZHhsYXN0PWlkeDsKKyAgICAgICAgICAgIHN0YXR1cyA9IFBhY2tUbHZDb3JlKHBDdHgsKHRBTklfVTgqKXBTcmMscEJ1ZixuLHBuQ29uc3VtZWQsVExWU19Xc2NBc3NvY1JlcytpZHgsJmlkeCk7CisgICAgICAgICAgICBuQ29uc3VtZWROb3c9KnBuQ29uc3VtZWQtbkNvbnN1bWVkTm93OworICAgICAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkU29GYXIgLSAyOworICAgICAgICAgICAgcEJ1Zis9bkNvbnN1bWVkTm93OworICAgICAgICAgICAgbkJ1Zi09bkNvbnN1bWVkTm93OworICAgICAgICB9IHdoaWxlIChET1QxMUZfQlVGRkVSX09WRVJGTE9XID09IHN0YXR1cyAmJiBpZHhsYXN0ICE9IGlkeCk7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVXc2NBc3NvY1Jlcy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llV3NjQmVhY29uKHRwQW5pU2lyR2xvYmFsIHBDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFV3NjQmVhY29uICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG4sIGlkeCA9IDAsaWR4bGFzdDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRTb0ZhciwgbkNvbnN1bWVkTm93OworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBzdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRJRVdzY0JlYWNvbihwQ3R4LCBwU3JjLCAmbk5lZWRlZCk7CisgICAgaWYgKCAhIERPVDExRl9TVUNDRUVERUQoIHN0YXR1cyApICkgcmV0dXJuIHN0YXR1czsKKyAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgKHZvaWQpcEN0eDsKKyAgICBpZiAocFNyYy0+cHJlc2VudCkgeworICAgICAgICBkbyB7CisgICAgICAgIG5Db25zdW1lZFNvRmFyPSpwbkNvbnN1bWVkOworICAgICAgICAgICAgKnBCdWYgPSAyMjE7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4MDsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4NTA7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweGYyOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg0OworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgIG4gPSAoIDI1NSAtIDQpIDwgbkJ1ZiA/ICggMjU1IC0gNCkgOiBuQnVmOworICAgICAgICAgICAgbkNvbnN1bWVkTm93PSpwbkNvbnN1bWVkOworICAgICAgICAgICAgaWR4bGFzdD1pZHg7CisgICAgICAgICAgICBzdGF0dXMgPSBQYWNrVGx2Q29yZShwQ3R4LCh0QU5JX1U4KilwU3JjLHBCdWYsbixwbkNvbnN1bWVkLFRMVlNfV3NjQmVhY29uK2lkeCwmaWR4KTsKKyAgICAgICAgICAgIG5Db25zdW1lZE5vdz0qcG5Db25zdW1lZC1uQ29uc3VtZWROb3c7CisgICAgICAgICAgICAqcEllTGVuID0gKnBuQ29uc3VtZWQgLSBuQ29uc3VtZWRTb0ZhciAtIDI7CisgICAgICAgICAgICBwQnVmKz1uQ29uc3VtZWROb3c7CisgICAgICAgICAgICBuQnVmLT1uQ29uc3VtZWROb3c7CisgICAgICAgIH0gd2hpbGUgKERPVDExRl9CVUZGRVJfT1ZFUkZMT1cgPT0gc3RhdHVzICYmIGlkeGxhc3QgIT0gaWR4KTsKKyAgICB9CisgICAgcmV0dXJuIHN0YXR1czsKK30gLyogRW5kIGRvdDExZlBhY2tJZVdzY0JlYWNvbi4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llV3NjQmVhY29uUHJvYmVSZXModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdzY0JlYWNvblByb2JlUmVzICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG4sIGlkeCA9IDAsaWR4bGFzdDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRTb0ZhciwgbkNvbnN1bWVkTm93OworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBzdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRJRVdzY0JlYWNvblByb2JlUmVzKHBDdHgsIHBTcmMsICZuTmVlZGVkKTsKKyAgICBpZiAoICEgRE9UMTFGX1NVQ0NFRURFRCggc3RhdHVzICkgKSByZXR1cm4gc3RhdHVzOworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwU3JjLT5wcmVzZW50KSB7CisgICAgICAgIGRvIHsKKyAgICAgICAgbkNvbnN1bWVkU29GYXI9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICAqcEJ1ZiA9IDIyMTsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHgwOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg1MDsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4ZjI7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDQ7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgbiA9ICggMjU1IC0gNCkgPCBuQnVmID8gKCAyNTUgLSA0KSA6IG5CdWY7CisgICAgICAgICAgICBuQ29uc3VtZWROb3c9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICBpZHhsYXN0PWlkeDsKKyAgICAgICAgICAgIHN0YXR1cyA9IFBhY2tUbHZDb3JlKHBDdHgsKHRBTklfVTgqKXBTcmMscEJ1ZixuLHBuQ29uc3VtZWQsVExWU19Xc2NCZWFjb25Qcm9iZVJlcytpZHgsJmlkeCk7CisgICAgICAgICAgICBuQ29uc3VtZWROb3c9KnBuQ29uc3VtZWQtbkNvbnN1bWVkTm93OworICAgICAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkU29GYXIgLSAyOworICAgICAgICAgICAgcEJ1Zis9bkNvbnN1bWVkTm93OworICAgICAgICAgICAgbkJ1Zi09bkNvbnN1bWVkTm93OworICAgICAgICB9IHdoaWxlIChET1QxMUZfQlVGRkVSX09WRVJGTE9XID09IHN0YXR1cyAmJiBpZHhsYXN0ICE9IGlkeCk7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVXc2NCZWFjb25Qcm9iZVJlcy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llV3NjSUVPcGFxdWUodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdzY0lFT3BhcXVlICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG5Db25zdW1lZE9uRW50cnkgPSAqcG5Db25zdW1lZDsKKyAgICB0QU5JX1UzMiBuTmVlZGVkID0gMFU7CisgICAgbk5lZWRlZCAgKz0gIHBTcmMtPm51bV9kYXRhOworICAgIHdoaWxlICggcFNyYy0+cHJlc2VudCApCisgICAgeworICAgICAgICBpZiAoIG5OZWVkZWQgPiBuQnVmICkgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgICpwQnVmID0gMjIxOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgcEllTGVuID0gcEJ1ZjsKKyAgICAgICAgKytwQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICpwQnVmID0gMHgwOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDUwOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweGYyOworICAgICAgICArK3BCdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgKnBCdWYgPSAweDQ7CisgICAgICAgICsrcEJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICBET1QxMUZfTUVNQ1BZKHBDdHgsIHBCdWYsICYoIHBTcmMtPmRhdGEgKSwgcFNyYy0+bnVtX2RhdGEpOworICAgICAgICAqcG5Db25zdW1lZCArPSBwU3JjLT5udW1fZGF0YTsKKyAgICAgICAgLy8gZmllbGRzRW5kRmxhZyA9IDEKKyAgICAgICAgYnJlYWs7CisgICAgfQorICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBJZUxlbikKKyAgICB7CisgICAgICAgICpwSWVMZW4gPSAqcG5Db25zdW1lZCAtIG5Db25zdW1lZE9uRW50cnkgLSAyOworICAgIH0KKyAgICByZXR1cm4gRE9UMTFGX1BBUlNFX1NVQ0NFU1M7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVXc2NJRU9wYXF1ZS4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llV3NjUHJvYmVSZXEodHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdzY1Byb2JlUmVxICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG4sIGlkeCA9IDAsaWR4bGFzdDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRTb0ZhciwgbkNvbnN1bWVkTm93OworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBzdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRJRVdzY1Byb2JlUmVxKHBDdHgsIHBTcmMsICZuTmVlZGVkKTsKKyAgICBpZiAoICEgRE9UMTFGX1NVQ0NFRURFRCggc3RhdHVzICkgKSByZXR1cm4gc3RhdHVzOworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwU3JjLT5wcmVzZW50KSB7CisgICAgICAgIGRvIHsKKyAgICAgICAgbkNvbnN1bWVkU29GYXI9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICAqcEJ1ZiA9IDIyMTsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHgwOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg1MDsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4ZjI7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDQ7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgbiA9ICggMjU1IC0gNCkgPCBuQnVmID8gKCAyNTUgLSA0KSA6IG5CdWY7CisgICAgICAgICAgICBuQ29uc3VtZWROb3c9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICBpZHhsYXN0PWlkeDsKKyAgICAgICAgICAgIHN0YXR1cyA9IFBhY2tUbHZDb3JlKHBDdHgsKHRBTklfVTgqKXBTcmMscEJ1ZixuLHBuQ29uc3VtZWQsVExWU19Xc2NQcm9iZVJlcStpZHgsJmlkeCk7CisgICAgICAgICAgICBuQ29uc3VtZWROb3c9KnBuQ29uc3VtZWQtbkNvbnN1bWVkTm93OworICAgICAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkU29GYXIgLSAyOworICAgICAgICAgICAgcEJ1Zis9bkNvbnN1bWVkTm93OworICAgICAgICAgICAgbkJ1Zi09bkNvbnN1bWVkTm93OworICAgICAgICB9IHdoaWxlIChET1QxMUZfQlVGRkVSX09WRVJGTE9XID09IHN0YXR1cyAmJiBpZHhsYXN0ICE9IGlkeCk7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVXc2NQcm9iZVJlcS4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llV3NjUHJvYmVSZXModHBBbmlTaXJHbG9iYWwgcEN0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdzY1Byb2JlUmVzICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcEJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIG5CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG4sIGlkeCA9IDAsaWR4bGFzdDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRTb0ZhciwgbkNvbnN1bWVkTm93OworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBzdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRJRVdzY1Byb2JlUmVzKHBDdHgsIHBTcmMsICZuTmVlZGVkKTsKKyAgICBpZiAoICEgRE9UMTFGX1NVQ0NFRURFRCggc3RhdHVzICkgKSByZXR1cm4gc3RhdHVzOworICAgIGlmICggbk5lZWRlZCA+IG5CdWYgKSByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAodm9pZClwQ3R4OworICAgIGlmIChwU3JjLT5wcmVzZW50KSB7CisgICAgICAgIGRvIHsKKyAgICAgICAgbkNvbnN1bWVkU29GYXI9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICAqcEJ1ZiA9IDIyMTsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICBwSWVMZW4gPSBwQnVmOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHgwOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHg1MDsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4ZjI7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDQ7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgbiA9ICggMjU1IC0gNCkgPCBuQnVmID8gKCAyNTUgLSA0KSA6IG5CdWY7CisgICAgICAgICAgICBuQ29uc3VtZWROb3c9KnBuQ29uc3VtZWQ7CisgICAgICAgICAgICBpZHhsYXN0PWlkeDsKKyAgICAgICAgICAgIHN0YXR1cyA9IFBhY2tUbHZDb3JlKHBDdHgsKHRBTklfVTgqKXBTcmMscEJ1ZixuLHBuQ29uc3VtZWQsVExWU19Xc2NQcm9iZVJlcytpZHgsJmlkeCk7CisgICAgICAgICAgICBuQ29uc3VtZWROb3c9KnBuQ29uc3VtZWQtbkNvbnN1bWVkTm93OworICAgICAgICAgICAgKnBJZUxlbiA9ICpwbkNvbnN1bWVkIC0gbkNvbnN1bWVkU29GYXIgLSAyOworICAgICAgICAgICAgcEJ1Zis9bkNvbnN1bWVkTm93OworICAgICAgICAgICAgbkJ1Zi09bkNvbnN1bWVkTm93OworICAgICAgICB9IHdoaWxlIChET1QxMUZfQlVGRkVSX09WRVJGTE9XID09IHN0YXR1cyAmJiBpZHhsYXN0ICE9IGlkeCk7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9IC8qIEVuZCBkb3QxMWZQYWNrSWVXc2NQcm9iZVJlcy4gKi8KKwordEFOSV9VMzIgZG90MTFmUGFja0llV3NjUmVhc3NvY1Jlcyh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVXc2NSZWFzc29jUmVzICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAqcG5Db25zdW1lZCkKK3sKKyAgICB0QU5JX1U4KiBwSWVMZW4gPSAwOworICAgIHRBTklfVTMyIG4sIGlkeCA9IDAsaWR4bGFzdDsKKyAgICB0QU5JX1UzMiBuQ29uc3VtZWRTb0ZhciwgbkNvbnN1bWVkTm93OworICAgIHRBTklfVTMyIHN0YXR1cyA9IERPVDExRl9QQVJTRV9TVUNDRVNTOworICAgIHRBTklfVTMyIG5OZWVkZWQgPSAwVTsKKyAgICBzdGF0dXMgPSBkb3QxMWZHZXRQYWNrZWRJRVdzY1JlYXNzb2NSZXMocEN0eCwgcFNyYywgJm5OZWVkZWQpOworICAgIGlmICggISBET1QxMUZfU1VDQ0VFREVEKCBzdGF0dXMgKSApIHJldHVybiBzdGF0dXM7CisgICAgaWYgKCBuTmVlZGVkID4gbkJ1ZiApIHJldHVybiBET1QxMUZfQlVGRkVSX09WRVJGTE9XOworICAgICh2b2lkKXBDdHg7CisgICAgaWYgKHBTcmMtPnByZXNlbnQpIHsKKyAgICAgICAgZG8geworICAgICAgICBuQ29uc3VtZWRTb0Zhcj0qcG5Db25zdW1lZDsKKyAgICAgICAgICAgICpwQnVmID0gMjIxOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgIHBJZUxlbiA9IHBCdWY7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDA7CisgICAgICAgICAgICArK3BCdWY7IC0tbkJ1ZjsgKysoKnBuQ29uc3VtZWQpOworICAgICAgICAgICAgKnBCdWYgPSAweDUwOworICAgICAgICAgICAgKytwQnVmOyAtLW5CdWY7ICsrKCpwbkNvbnN1bWVkKTsKKyAgICAgICAgICAgICpwQnVmID0gMHhmMjsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICAqcEJ1ZiA9IDB4NDsKKyAgICAgICAgICAgICsrcEJ1ZjsgLS1uQnVmOyArKygqcG5Db25zdW1lZCk7CisgICAgICAgICAgICBuID0gKCAyNTUgLSA0KSA8IG5CdWYgPyAoIDI1NSAtIDQpIDogbkJ1ZjsKKyAgICAgICAgICAgIG5Db25zdW1lZE5vdz0qcG5Db25zdW1lZDsKKyAgICAgICAgICAgIGlkeGxhc3Q9aWR4OworICAgICAgICAgICAgc3RhdHVzID0gUGFja1RsdkNvcmUocEN0eCwodEFOSV9VOCopcFNyYyxwQnVmLG4scG5Db25zdW1lZCxUTFZTX1dzY1JlYXNzb2NSZXMraWR4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VAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5UU1BFQy5taW5fcGh5X3JhdGUsIDQpOworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5UU1BFQy5zdXJwbHVzX2J3X2FsbG93YW5jZSwgMik7CisgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlRTUEVDLm1lZGl1bV90aW1lLCAyKTsKKyAgICAgICAgfQorICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcEZybS0+bnVtX1RDTEFTOyArK2kpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCBGUkZMKCJUQ0xBU1slZF06XG4iKSwgaSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPlRDTEFTW2ldLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+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AgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnZlcnNpb24sIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChwRnJtLT5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnZlcnNpb24pCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA0OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuc291cmNlLCA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLmRlc3QsIDQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuc3JjX3BvcnQsIDIpOworICAgICAgIC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AgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5UQ0xBU1tpXS5pbmZvLlBhcmFtczgwMjFkcS50YWdfdHlwZSwgMik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVFVRVNUKSwgRlJGTCgiVENMQVNTUFJPQzpcbiIpKTsKKyAgICAgICAgaWYgKCFwRnJtLT5UQ0xBU1NQUk9DLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+VENMQVNTUFJPQy5wcm9jZXNzaW5nLCAxKTsKKyAgICAgICAgfQorICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVFVRVNUKSwgRlJGTCgiV01NVFNQRUM6XG4iKSk7CisgICAgICAgIGlmICghcEZybS0+V01NVFNQRUMucHJlc2VudCk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MuZGVsYXlfYm91bmQsIDQpOworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5XTU1UU1BFQy5taW5fcGh5X3JhdGUsIDQpOworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5XTU1UU1BFQy5zdXJwbHVzX2J3X2FsbG93YW5jZSwgMik7CisgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPldNTVRTUEVDLm1lZGl1bV90aW1lLCAyKTsKKyAgICAgICAgfQorICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcEZybS0+bnVtX1dNTVRDTEFTOyArK2kpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCBGUkZMKCJXTU1UQ0xBU1slZF06XG4iKSwgaSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPldNTVRDTEFTW2ldLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfR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OSV9VOCogKSZwRnJtLT5XTU1UQ0xBU1tpXS5pbmZvLkV0aFBhcmFtcy5kZXN0LCA2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+V01NVENMQVNbaV0uaW5mby5FdGhQYXJhbXMudHlwZSwgMik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMudmVyc2lvbiwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHBGcm0tPldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMudmVyc2lvbikKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+V01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5zb3VyY2UsIDQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPldNTVRDTEFTW2ldLmluZ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BTklfVTgqICkmcEZybS0+V01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5yZXNlcnZlZCwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA2OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuc291cmNlLCAxNik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+V01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5kZXN0LCAxNik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+V01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5zcmNfcG9ydCwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+V01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5kZXN0X3BvcnQsIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZmxvd19sYWJlbCwgMyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIDI6CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPldNTVRDTEFTW2ldLmluZm8uUGFyYW1zODAyMWRxLnRhZ190eXBlLCAyKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCBGUkZMKCJXTU1UQ0xBU1BST0M6XG4iKSk7CisgICAgICAgIGlmICghcEZybS0+V01NVENMQVNQUk9DLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFUVVFU1QpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9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VDExRl9BRERUU1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlRDTEFTW2ldLmNsYXNzaWZpZXJfbWFzaywgMSk7CisgICAgICAgICAgICAgICAgc3dpdGNoIChwRnJtLT5UQ0xBU1tpXS5jbGFzc2lmaWVyX3R5cGUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBjYXNlIDA6CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5UQ0xBU1tpXS5pbmZvLkV0aFBhcmFtcy5zb3VyY2UsIDYpOworICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+VENMQVNbaV0uaW5mby5FdGhQYXJhbXMuZGVzdCwgNik7CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5UQ0xBU1tpXS5pbmZvLkV0aFBhcmFtcy50eXBlLCAyKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlRDTEFTW2ldLmluZm8uSXBQYXJhbXMudmVyc2lvbiwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHBGcm0tPlRDTEFTW2ldLmluZm8uSXBQYXJhbXMudmVyc2lvbikKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuc291cmNlLCA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+VENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5kZXN0LCA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+VENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5zcmNfcG9ydCwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuZGVzdF9wb3J0LCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN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V0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5kZXN0LCAxNik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuc3JjX3BvcnQsIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmRlc3RfcG9ydCwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZmxvd19sYWJlbCwgMyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIDI6CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5UQ0xBU1tpXS5pbmZvLlBhcmFtczgwMjFkcS50YWdfdHlwZSwgMik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVNQT05TRSksIEZSRkwoIlRDTEFTU1BST0M6XG4iKSk7CisgICAgICAgIGlmICghcEZybS0+VENMQVNTUFJPQy5wcmVzZW50KQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+VENMQVNTUFJPQy5wcm9jZXNzaW5nLCAxKTsKKyAgICAgICAgfQorICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVNQT05TRSksIEZSRkwoIlNjaGVkdWxlOlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPlNjaGVkdWxlLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZf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NRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5XTU1UU1BFQy5taW5fcGh5X3JhdGUsIDQpOworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+V01NVFNQRUMuc3VycGx1c19id19hbGxvd2FuY2UsIDIpOworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+V01NVFNQRUMubWVkaXVtX3RpbWUsIDIpOworICAgICAgICB9CisgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwRnJtLT5udW1fV01NVENMQVM7ICsraSkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVTUE9OU0UpLCBGUkZMKCJXTU1UQ0xBU1slZF06XG4iKSwgaSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPldNTVRDTEFTW2ldLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVNQT05TRSksICggdEFOSV9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dGhQYXJhbXMuZGVzdCwgNik7CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5XTU1UQ0xBU1tpXS5pbmZvLkV0aFBhcmFtcy50eXBlLCAyKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMudmVyc2lvbiwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHBGcm0tPldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMudmVyc2lvbikKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuc291cmNlLCA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+V01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtc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RDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMucmVzZXJ2ZWQsIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+V01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5zb3VyY2UsIDE2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+V01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5kZXN0LCAxNik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuc3JjX3BvcnQsIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5XTU1UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmRlc3RfcG9ydCwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BRERUU1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZmxvd19sYWJlbCwgMyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIDI6CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5XTU1UQ0xBU1tpXS5pbmZvLlBhcmFtczgwMjFkcS50YWdfdHlwZSwgMik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQUREVFNSRVNQT05TRSksIEZSRkwoIldNTVRDTEFTUFJPQzpcbiIpKTsKKyAgICAgICAgaWYgKCFwRnJtLT5XTU1UQ0xBU1BST0MucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FERFRTUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0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EZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiUkNQSUlFOlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPlJDUElJRS5wcmVzZW50KQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UkNQSUlFLnJjcGksIDEpOworICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiUlNOSUlFOlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPlJTTklJRS5wcmVzZW50KQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UlNOSUlFLnJzbmksIDEpOworICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FK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ICAgICAgICAgICAgaWYgKCFwRnJtLT5GVEluZm8uUjFLSF9JRC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLlIxS0hfSUQuUE1LX1IxX0lELCA2KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiR1RLOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5GVEluZm8uR1RLLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoImtleUlkICgyKTogJWRcbiIpLCBwRnJtLT5GVEluZm8uR1RLLmtleUlkKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ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QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIlJJQ0RhdGE6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5SSUNEYXRhRGVzY1tpXS5SSUNEYXRhLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5SSUNEYXRhLklkZW50aWZpZXIsIDEpOworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5SSUNEYXRhLnJlc291cmNlRGVzY0NvdW50LCAxKTsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uU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YXRlLCA0KTsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVFNQRUMuc3VycGx1c19id19hbGxvd2FuY2UsIDIpOworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UU1BFQy5tZWRpdW1fdGltZSwgMik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwRnJtLT5SSUNEYXRhRGVzY1tpXS5udW1fVENMQVM7ICsraSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiVENMQVNbJWRdOlxuIiksIGkpOworICAgICAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLnByZXNlbnQpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVN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ksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLkV0aFBhcmFtcy5kZXN0LCA2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5FdGhQYXJhbXMudHlwZSwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnZlcnNpb24sIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uSXBQYXJhbXMudmVyc2lvbikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA0OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuc291cmNlLCA0KTsKKyAgICAgIC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ICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLnNyY19wb3J0LCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmRlc3RfcG9ydCwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5mbG93X2xhYmVsLCAzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLlBhcmFtczgwMjFkcS50YWdfdHlwZSwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJUQ0xBU1NQUk9DOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNTUFJPQy5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNTUFJPQy5wcm9jZXNzaW5nLCAxKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJUU0RlbGF5OlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uVFNEZWxheS5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVFNEZWxheS5kZWxheSwgNCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiU2NoZWR1bGU6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5SSUNEYXRhRGVzY1tpXS5TY2hlZHVsZS5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJhZ2dyZWdhdGlvbiAoMSk6ICVkXG4iKSwgcEZybS0+UklDRGF0YURlc2NbaV0uU2NoZWR1bGUuYWdncmVnYXRp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JBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uU2NoZWR1bGUubWF4X3NlcnZpY2VfZHVyLCAyKTsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uU2NoZWR1bGUuc3BlY19pbnRlcnZhbCwgMik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiV01NVFNQRUM6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UU1BFQy5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVFNQRUMudmVyc2lvbiwgMSk7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQ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yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMudmVyc2lvbiwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAocEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy52ZXJzaW9uKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5zb3VyY2UsIDQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuZGVzdCwgNCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX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FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5yZXNlcnZlZCwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLnNvdXJjZSwgMTYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZGVzdCwgMTYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuc3JjX3BvcnQsIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZGVzdF9wb3J0LCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmZsb3dfbGFiZWwsIDMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDI6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uUGFyYW1zODAyMWRxLnRhZ190eXBlLCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIldNTVRDTEFTUFJPQzpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTUFJPQy5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNQUk9DLnZlcnNpb24sIDEpOworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1BST0MucHJvY2Vzc2luZywgMSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiV01NVFNEZWxheTpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRTRGVsYXkucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRTRGVsYXkudmVyc2lvbiwgMSk7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRTRGVsYXkuZGVsYXksIDQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIldNTVNjaGVkdWxlOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uV01NU2NoZWR1bGUucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19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iTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJudW1fbmFtZTogJWQuXG4iKSwgcEZybS0+QWlyZ28uQVBOYW1lLm51bV9uYW1lKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSBwRnJtLT5BaXJnby5BUE5hbWUubmFtZSwgcEZybS0+QWlyZ28uQVBOYW1lLm51bV9uYW1lKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiSENGOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5IQ0YucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLkhDRi5lbmFibGVkLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiV0RTOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5XRFMucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgibnVtX3dkc0RhdGE6ICVkLlxuIiksIHBGcm0tPkFpcmdvLldEUy5udW1fd2RzRGF0YSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkgcEZybS0+QWlyZ28uV0RTLndkc0RhdGEsIHBGcm0tPkFpcmdvLldEUy5udW1fd2RzRGF0YSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIkJQSW5kaWNhdG9yOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5CUEluZGljYXRvci5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExR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RSksIEZSRkwoIlByb3BBc3NvY1R5cGU6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLlByb3BBc3NvY1R5cGUucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLlByb3BBc3NvY1R5cGUudHlwZSwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksIEZSRkwoIkxMQXR0cjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uTExBdHRyLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5MTEF0dHIuZGVmZ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IERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiVHJpZ2dlclN0YUJnU2NhbjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uVHJpZ2dlclN0YUJnU2Nhbi5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uVHJpZ2dlclN0YUJnU2Nhbi5lbmFibGUsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJUYXVydXM6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLlRhdXJ1cy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTg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gICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQXNzb2NSZXMuVmVuZG9yRXh0ZW5zaW9uLkF1dGhvcml6ZWRNQUNzLm1hYywgNik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BU1NPQ1JFU1BPTlNFKSwgRlJGTCgiUmVxdWVzdFRvRW5yb2xsOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+V3NjQXNzb2NSZXMuVmVuZG9yRXh0ZW5zaW9uLlJlcXVlc3RUb0Vucm9sbC5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQ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xMUZfQVVUSEVOVElDQVRJT04pLCBGUkZMKCJSMUtIX0lEOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5GVEluZm8uUjFLSF9JRC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5GVEluZm8uUjFLSF9JRC5QTUtfUjFfSUQsIDYpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgRlJGTCgiR1RLOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5GVEluZm8uR1RLLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgRlJGTCgia2V5SWQgKDIpOiAlZFxuIiksIHBGcm0tPkZUSW5mby5HVEsua2V5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gICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5UaW1lb3V0SW50ZXJ2YWwudGltZW91dFR5cGUsIDEpOworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlRpbWVvdXRJbnRlcnZhbC50aW1lb3V0VmFsdWUsIDQpOworICAgICAgICB9CisgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwRnJtLT5udW1fUklDRGF0YURlc2M7ICsraSkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgRlJGTCgiUklDRGF0YURlc2NbJWRdOlxuIiksIGkpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5SSUNEYXRhRGVzY1tpXS5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksIEZSRkwoIlJJQ0RhdGE6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5SSUNEYXRhRGVz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id19hbGxvd2FuY2UsIDIpOworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVFNQRUMubWVkaXVtX3RpbWUsIDIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcEZybS0+UklDRGF0YURlc2NbaV0ubnVtX1RDTEFTOyArK2kpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCBGUkZMKCJUQ0xBU1slZF06XG4iKSwgaSk7CisgICAgICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0ucHJlc2VudCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0udXNlcl9wcmlvcml0eSwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uY2xhc3NpZmllcl90eXBlLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5jbGFzc2lmaWVyX21hc2ssIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5jbGFzc2lmaWVyX3R5cGUpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5FdGhQYXJhbXMuc291cmNlLCA2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uRXRoUGFyYW1zLmRlc3QsIDYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5FdGhQYXJhbXMudHlwZSwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5JcFBhcmFtcy52ZXJzaW9uLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnZlcnNpb24pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5zb3VyY2UsIDQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLmRlc3QsIDQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLnNyY19wb3J0LCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5kZXN0X3BvcnQsIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLkRTQ1AsIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLnByb3RvLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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sIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmRlc3RfcG9ydCwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZmxvd19sYWJlbCwgMyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uUGFyYW1zODAyMWRxLnRhZ190eXBlLCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCBGUkZMKCJUQ0xBU1NQUk9DOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNTUFJPQy5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1NQUk9DLnByb2Nlc3NpbmcsIDEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCBGUkZMKCJUU0RlbGF5OlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uVFNEZWxheS5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg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kFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uU2NoZWR1bGUuc3BlY19pbnRlcnZhbCwgMik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksIEZSRkwoIldNTVRTUEVDOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uV01NVFNQRUMucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVFNQRUMudmVyc2lvbiwgMSk7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksIEZSRkwoInRyYWZmaWNfdHlwZSAoMSk6ICVkXG4iKSwgcEZybS0+UklDRGF0YURlc2NbaV0uV01NVFNQRUMudHJhZmZpY190eXBlKTsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBT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baV0uV01NVENMQVNbaV0uY2xhc3NpZmllcl9tYXNrLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAocEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uY2xhc3NpZmllcl90eXBlKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uRXRoUGFyYW1zLnNvdXJjZSwgNik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5pbmZvLkV0aFBhcmFtcy5kZXN0LCA2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uRXRoUGFyYW1zLnR5cGUsIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMudmVyc2lvbiwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAocEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy52ZXJzaW9uKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuc291cmNlLCA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5kZXN0LCA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWN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AgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDY6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuc291cmNlLCAxNik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZGVzdCwgMTYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLnNyY19wb3J0LCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQVVUSEVOVElDQVRJT04pLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5kZXN0X3BvcnQsIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmZsb3dfbGFiZWwsIDMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDI6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9BVVRIRU5USUNBVElPTiksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5pbmZvLlBhcmFtczgwMjFkcS50YWdfdHlwZSwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0FVVEhFTlRJQ0FUSU9OKSwgRlJGTCgiV01NVENMQVNQUk9DOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNQUk9DLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGU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G4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLldEUy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgibnVtX3dkc0RhdGE6ICVkLlxuIiksIHBGcm0tPkFpcmdvLldEUy5udW1fd2RzRGF0YSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksICggdEFOSV9VOCogKSBwRnJtLT5BaXJnby5XRFMud2RzRGF0YSwgcEZybS0+QWlyZ28uV0RTLm51bV93ZHNEYXRhKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJCUEluZGljYXRvcjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uQlBJbmRpY2F0b3IucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5CUEluZGljYXRvci5pbmRpY2F0b3IsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uQlBJbmRpY2F0b3IudHlwZSwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgiTG9hZEluZm86XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLkxvYWRJbmZvLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uTG9hZEluZm8ubnVtX3N0YXMsIDIpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uTG9hZEluZm8uY2hhbm5lbF91dGlsLCAyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0c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ICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uUHJvcEFzc29jVHlwZS50eXBlLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJMTEF0dHI6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLkxMQXR0ci5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgKCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLkxMQXR0ci5kZWZlcl90aHJlc2hvbGQsIDQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIlByb3BDYXBhYmlsaXR5OlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5Qcm9wQ2FwYWJpbGl0eS5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9S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RlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIlByb3BDaGFublN3aXRjaEFubjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uUHJvcENoYW5uU3dpdGNoQW5uLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uUHJvcENoYW5uU3dpdGNoQW5uLm1vZGUsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uUHJvcENoYW5uU3dpdGNoQW5uLnByaW1hcnlfY2hhbm5lbCwgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5Qcm9wQ2hhbm5Td2l0Y2hBbm4uc3ViX2JhbmQsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uUHJvcENoYW5uU3dpdGN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TFGX0JFQUNPTiksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5Qcm9wUXVpZXRCU1MucXVpZXRfb2Zmc2V0LCAyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJUcmlnZ2VyU3RhQmdTY2FuOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5UcmlnZ2VyU3RhQmdTY2FuLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uVHJpZ2dlclN0YUJnU2Nhbi5lbmFibGUsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIlRhdXJ1czpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uVGF1cnVzLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAg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AgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIlZlcnNpb246XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPldzY0JlYWNvbi5WZXJzaW9uLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJtaW5vciAoNCk6ICVkXG4iKSwgcEZybS0+V3NjQmVhY29uLlZlcnNpb24ubWlub3IpOworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJtYWpvciAoNCk6ICVkXG4iKSwgcEZybS0+V3NjQmVhY29uLlZlcnNpb24ubWFqb3IpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIldQU1N0YXRlOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NCZWFjb24uV1BTU3RhdGUucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksICggdEFOSV9VOCogKSZwRnJtLT5Xc2NCZWFjb24uV1BTU3RhdGUuc3RhdGUsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIkFQU2V0dXBMb2NrZWQ6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPldzY0JlYWNvbi5BUFNldHVwTG9ja2VkLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQmVhY29uLkFQU2V0dXBMb2NrZWQuZkxvY2tlZCwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgiU2VsZWN0ZWRSZWdpc3RyYXI6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPldzY0JlYWNvbi5TZWxlY3RlZFJlZ2lzdHJhci5wcmVzZW50KQorICAgICAgICAgICAgeworICAgIC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xMUZfQkVBQ09OKSwgRlJGTCgiU2VsZWN0ZWRSZWdpc3RyYXJDb25maWdNZXRob2RzOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NCZWFjb24uU2VsZWN0ZWRSZWdpc3RyYXJDb25maWdNZXRob2RzLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQmVhY29uLlNlbGVjdGVkUmVnaXN0cmFyQ29uZmlnTWV0aG9kcy5tZXRob2RzLCAyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJVVUlEX0U6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPldzY0JlYWNvbi5VVUlEX0UucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksICggd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U1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJBdXRob3JpemVkTUFDczpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPldzY0JlYWNvbi5WZW5kb3JFeHRlbnNpb24uQXV0aG9yaXplZE1BQ3MucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksICggdEFOSV9VOCogKSZwRnJtLT5Xc2NCZWFjb24uVmVuZG9yRXh0ZW5zaW9uLkF1dGhvcml6ZWRNQUNzLm1hYywgNik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJSZXF1ZXN0VG9FbnJvbGw6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NCZWFjb24uVmVuZG9yRXh0ZW5zaW9uLlJlcXVlc3RUb0Vucm9sbC5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgKCB0QU5JX1U4KiApJnBGcm0tPldzY0JlYWNvbi5WZW5kb3JFeHRlbnNpb24uUmVxdWVzdFRvRW5yb2xsLnJlcSwgMSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJQMlBCZWFjb246XG4iKSk7CisgICAgICAgIGlmICghcEZybS0+UDJQQmVhY29uLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJQMlBDYXBhYmlsaXR5OlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5QMlBCZWFjb24uUDJQQ2FwYWJpbGl0eS5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OKSwgKCB0QU5JX1U4KiApJnBGcm0tPlAyUEJlYWNvbi5QMlBDYXBhYmlsaXR5LmRldmljZUNhcGFiaWxpdHksIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCAoIHRBTklfVTgqICkmcEZybS0+UDJQQmVhY29uLlAyUENhcGFiaWxpdHkuZ3JvdXBDYXBhYmlsaXR5LCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCBGUkZMKCJQMlBEZXZpY2VJZDpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+UDJQQmVhY29uLlAyUERldmljZUlkLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04pLCAoIHRBTklfVTgqICkmcEZybS0+UDJQQmVhY29uLlAyUERldmljZUlkLlAyUERldmljZUFkZHJlc3MsIDYpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTiksIEZSRkwoIk5vdGljZU9mQW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gfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgRlJGTCgibnVtX3JhdGVzOiAlZC5cbiIpLCBwRnJtLT5BaXJnby5Qcm9wU3VwcFJhdGVzLm51bV9yYXRlcyk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCAoIHRBTklfVTgqICkgcEZybS0+QWlyZ28uUHJvcFN1cHBSYXRlcy5yYXRlcywgcEZybS0+QWlyZ28uUHJvcFN1cHBSYXRlcy5udW1fcmF0ZXMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCBGUkZMKCJBUE5hbWU6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLkFQTmFtZS5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCBGUkZMKCJudW1fbmFtZTogJWQuXG4iKSwgcEZybS0+QWlyZ28uQVBOYW1lLm51bV9uYW1lKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksICggdEFOSV9VOCogKSBwRnJtLT5BaXJnby5BUE5hbWUubmFtZSwgcEZybS0+QWlyZ28uQVBOYW1lLm51bV9uYW1lKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgRlJGTCgiSENGOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5IQ0YucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgKCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLkhDRi5lbmFibGVkLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgRlJGTCgiV0RTOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5XRFMucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworIC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mdvLlByb3BDaGFublN3aXRjaEFubi5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uUHJvcENoYW5uU3dpdGNoQW5uLm1vZGUsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgKCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLlByb3BDaGFublN3aXRjaEFubi5wcmltYXJ5X2NoYW5uZWwsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgKCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLlByb3BDaGFublN3aXRjaEFubi5zdWJfYmFuZCwgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uUHJvcENoYW5uU3dpdGNoQW5uLmNoYW5uZWxfc3dpdGNoX2NvdW50LCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT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IEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgRlJGTCgiVHJpZ2dlclN0YUJnU2NhbjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uVHJpZ2dlclN0YUJnU2Nhbi5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uVHJpZ2dlclN0YUJnU2Nhbi5lbmFibGUsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCBGUkZMKCJUYXVydXM6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLlRhdXJ1cy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCAoIHRBTklfVTgqICkmcEZybS0+QWly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AgICAgIGlmICghcEZybS0+V3NjQmVhY29uLlNlbGVjdGVkUmVnaXN0cmFyQ29uZmlnTWV0aG9kcy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQmVhY29uLlNlbGVjdGVkUmVnaXN0cmFyQ29uZmlnTWV0aG9kcy5tZXRob2RzLCAyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgRlJGTCgiVVVJRF9FOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NCZWFjb24uVVVJRF9FLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksICggdEFOSV9VOCogKSZwRnJtLT5Xc2NCZWFjb24uVVVJRF9FLnV1aWQsIDE2KTsKKyAgICAgIC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BET1QxMUZfQkVBQ09OMiksIEZSRkwoIkF1dGhvcml6ZWRNQUNzOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+V3NjQmVhY29uLlZlbmRvckV4dGVuc2lvbi5BdXRob3JpemVkTUFDcy5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQmVhY29uLlZlbmRvckV4dGVuc2lvbi5BdXRob3JpemVkTUFDcy5tYWMsIDYpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksIEZSRkwoIlJlcXVlc3RUb0Vucm9sbDpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPldzY0JlYWNvbi5WZW5kb3JFeHRlbnNpb24uUmVxdWVzdFRvRW5yb2xsLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAg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iksICggdEFOSV9VOCogKSZwRnJtLT5QMlBCZWFjb24uUDJQRGV2aWNlSWQuUDJQRGV2aWNlQWRkcmVzcywgNik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OMiksIEZSRkwoIk5vdGljZU9mQWJzZW5jZTpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+UDJQQmVhY29uLk5vdGljZU9mQWJzZW5jZS5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT04yKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCAoIHRBTklfVTgqICkmcEZybS0+UDJQQmVhY29uLk5vdGljZU9mQWJzZW5jZS5pbmRleCwgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCAoIHRBTklfVTgqICkmcEZybS0+UDJQQmVhY29uLk5vdGljZU9mQWJzZW5jZS5DVFNXaW5kb3dPcHBQUywgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTjIpLCBGUkZMKCJudW1fTm9BRGVzYzogJWQuXG4iKSwgcEZybS0+UDJQQmVhY29uLk5vdGljZU9mQWJzZW5jZS5udW1fTm9BRGVzYyk7CisgIC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GFyYW1zLmNmcF9kdXJyZW1haW5pbmcsIDIpOworICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJJQlNTUGFyYW1zOlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPklCU1NQYXJhbXMucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksICggdEFOSV9VOCogKSZwRnJtLT5JQlNTUGFyYW1zLmF0aW0sIDIpOworICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJUSU06XG4iKSk7CisgICAgICAgIGlmICghcEZybS0+VElNLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkmcEZybS0+VElNLmR0aW1fY291bnQsIDEpOworICAgICAgICAgICAgRlJB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MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJCUEluZGljYXRvcjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uQlBJbmRpY2F0b3IucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5CUEluZGljYXRvci5pbmRpY2F0b3IsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uQlBJbmRpY2F0b3IudHlwZSwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiTG9hZEluZm86XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLkxvYWRJbmZvLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uTG9hZEluZm8ubnVtX3N0YXMsIDIpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uTG9hZEluZm8uY2hhbm5lbF91dGlsLCAyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJMb2FkQmFsYW5jZTpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uTG9hZEJhbGFuY2UucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5Mb2FkQmFsYW5jZS5ic3NpZCwgNik7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5Mb2FkQmFsYW5jZS5jaGFubmVsLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJQcm9wQXNzb2NUeXBlOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5Qcm9wQXNzb2NUeXBlLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uUHJvcEFzc29jVHlwZS50eXBlLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJMTEF0dHI6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLkxMQXR0ci5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyA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FQYXJhbXMudW51c2VkNCk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoImFjdm9fbWluICg0KTogJWRcbiIpLCBwRnJtLT5BaXJnby5Qcm9wRURDQVBhcmFtcy5hY3ZvX21pbik7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoImFjdm9fbWF4ICg0KTogJWRcbiIpLCBwRnJtLT5BaXJnby5Qcm9wRURDQVBhcmFtcy5hY3ZvX21heCk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5Qcm9wRURDQVBhcmFtcy5hY3ZvX3R4b3BsaW1pdCwgMik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiVGl0YW46XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLlRpdGFuLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9C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RlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uVHJpZ2dlclN0YUJnU2Nhbi5lbmFibGUsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIlRhdXJ1czpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uVGF1cnVzLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uVGF1cnVzLmJhVElEQml0bWFwLCAyKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgKCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLlRhdXJ1cy5iYVBvbGljeSwgMik7CisgICAgICAgICAgICAgICAgRlJ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xzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuU2VsZWN0ZWRSZWdpc3RyYXIuc2VsZWN0ZWQsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIkRldmljZVBhc3N3b3JkSUQ6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPldzY0JlYWNvblByb2JlUmVzLkRldmljZVBhc3N3b3JkSUQucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksICggdEFOSV9VOCogKSZwRnJtLT5Xc2NCZWFjb25Qcm9iZVJlcy5EZXZpY2VQYXNzd29yZElELmlkLCAyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJTZWxlY3RlZFJlZ2lzdHJhckNvbmZpZ01ldGhvZHM6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPldzY0JlYWNvblByb2JlUm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bE5hbWUubnVtX3RleHQpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkgcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuTW9kZWxOYW1lLnRleHQsIHBGcm0tPldzY0JlYWNvblByb2JlUmVzLk1vZGVsTmFtZS5udW1fdGV4dCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiTW9kZWxOdW1iZXI6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPldzY0JlYWNvblByb2JlUmVzLk1vZGVsTnVtYmVyLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJudW1fdGV4dDogJWQuXG4iKSwgcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuTW9kZWxOdW1iZXIubnVtX3RleHQpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkgcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuTW9kZWxOdW1iZXIudGV4dCwgcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuTW9kZWxOdW1iZXIubnVtX3RleHQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIlNlcmlhbE51bWJlcjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuU2VyaWFsTnVtYmVyLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJudW1fdGV4dDogJWQuXG4iKSwgcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuU2VyaWFsTnVtYmVyLm51bV90ZXh0KTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgKCB0QU5JX1U4KiApIHBGcm0tPldzY0JlYWNvblByb2JlUmVzLlNlcmlhbE51bWJlci50ZXh0LCBwRnJtLT5Xc2NCZWFjb25Qcm9iZVJlcy5TZXJpYWxOdW1iZXIubnVtX3RleHQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIlByaW1hcnlEZXZpY2VUeXBlOlxuIikpOworICAg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ikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuQ29uZmlnTWV0aG9kcy5tZXRob2RzLCAyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJSRkJhbmRzOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NCZWFjb25Qcm9iZVJlcy5SRkJhbmRzLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuUkZCYW5kcy5iYW5kcywgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiVmVuZG9yRXh0ZW5zaW9uOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NCZWFjb25Qcm9iZVJlcy5WZW5kb3JFeHRlbnNpb24ucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksICggdEFOSV9VOCogKSZwRnJtLT5Xc2NCZWFjb25Qcm9iZVJlcy5WZW5kb3JFeHRlbnNpb24udmVuZG9ySWQsIDMpOworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJWZXJzaW9uMjpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPldzY0JlYWNvblByb2JlUmVzLlZlbmRvckV4dGVuc2lvbi5WZXJzaW9uMi5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgibWlub3IgKDQpOiAlZFxuIiksIHBGcm0tPldzY0JlYWNvblByb2JlUmVzLlZlbmRvckV4dGVuc2lvbi5WZXJzaW9uMi5taW5vcik7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJtYWpvciAoNCk6ICVkXG4iKSwgcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuVmVuZG9yRXh0ZW5zaW9uLlZlcnNpb24yLm1ham9yKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIkF1dGhvcml6ZWRNQUNzOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuVmVuZG9yRXh0ZW5zaW9uLkF1dGhvcml6ZWRNQUNzLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuVmVuZG9yRXh0ZW5zaW9uLkF1dGhvcml6ZWRNQUNzLm1hYywgNik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJSZXF1ZXN0VG9FbnJvbGw6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NCZWFjb25Qcm9iZVJlcy5WZW5kb3JFeHRlbnNpb24uUmVxdWVzdFRvRW5yb2xsLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjQmVhY29uUHJvYmVSZXMuVmVuZG9yRXh0ZW5zaW9uLlJlcXVlc3RUb0Vucm9sbC5yZXEsIDEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiUDJQQmVhY29uUHJvYmVSZXM6XG4iKSk7CisgICAgICAgIGlmICghcEZybS0+UDJQQmVhY29uUHJvYmVSZXMucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIlAyUENhcGFiaWxpdHk6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPlAyUEJlYWNvblByb2JlUmVzLlAyUENhcGFiaWxpdHkucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksICggdEFOSV9VOCogKSZwRnJtLT5QMlBCZWFjb25Qcm9iZVJlcy5QMlBDYXBhYmlsaXR5LmRldmljZUNhcGFiaWxpdHksIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCAoIHRBTklfVTgqICkmcEZybS0+UDJQQmVhY29uUHJvYmVSZXMuUDJQQ2FwYWJpbGl0eS5ncm91cENhcGFiaWxpdHksIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0JFQUNPTklFUyksIEZSRkwoIlAyUERldmljZUlkOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5QMlBCZWFjb25Qcm9iZVJlcy5QMlBEZXZpY2VJZC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FK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ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgKCB0QU5JX1U4KiApJnBGcm0tPlAyUEJlYWNvblByb2JlUmVzLlAyUERldmljZUluZm8uY29uZmlnTWV0aG9kLCAyKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgKCB0QU5JX1U4KiApJnBGcm0tPlAyUEJlYWNvblByb2JlUmVzLlAyUERldmljZUluZm8ucHJpbWFyeURldmljZVR5cGUsIDgpOworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJEZXZpY2VOYW1lOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UDJQQmVhY29uUHJvYmVSZXMuUDJQRGV2aWNlSW5mby5EZXZpY2VOYW1lLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfQkVBQ09OSUVTKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9CRUFDT05JRVMpLCBGUkZMKCJudW1fdGV4dDogJWQuXG4iKSwgcEZybS0+UDJQQmVhY29uUHJvYmVSZXMuUDJQRGV2aWNlSW5mby5EZXZpY2VOYW1lLm51bV90ZXh0KTsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX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VVRIKSwgRlJGTCgiTWlub3JSZWFzb25Db2RlOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5QMlBEZUF1dGguTWlub3JSZWFzb25Db2RlLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0RFQVVUSCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9ERUFVVEgpLCAoIHRBTklfVTgqICkmcEZybS0+UDJQRGVBdXRoLk1pbm9yUmVhc29uQ29kZS5taW5vclJlYXNvbkNvZGUsIDEpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9ERUFVVEgpLCBGUkZMKCJ0bzpcbiIpKTsKKyAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0RFQVVUSCksIHBCdWYsIG5CdWYpOworICAgIH0KKyMgICBlbmRpZiAvLyBET1QxMUZfRFVNUF9GUkFNRVMKKyAgICByZXR1cm4gc3RhdHVzOworCit9IC8qIEVuZCBkb3QxMWZVbnBhY2tEZUF1dGguICovCisKK3RBTklfVTMyIGRvdDExZlBhY2tEZWxCQUluZCh0cEFuaVNpckdsb2JhbCBwQ3R4LCB0RG90MTFmRGVsQkFJbmQgKnBGcm0sIHRBTklfVTggKnBCdWYsIHRBTklfVTMyIG5CdWYsIHRBTklfVTMyICpwbkNvbnN1bWVkKQoreworICAgIHRBTklfVTMyIGkgPSAwOworICAgIHRB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PlAyUEdPTmVnQ25mLlAyUFN0YXR1cy5zdGF0dXMsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0dPTkVHQ05GKSwgRlJGTCgiUDJQQ2FwYWJpbGl0eTpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+UDJQR09OZWdDbmYuUDJQQ2FwYWJpbGl0eS5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR0NORiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR0NORiksICggdEFOSV9VOCogKSZwRnJtLT5QMlBHT05lZ0NuZi5QMlBDYXBhYmlsaXR5LmRldmljZUNhcGFiaWxpdHksIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR0NORiksICggdEFOSV9VOCogKSZwRnJtLT5QMlBHT05lZ0NuZi5QMlBDYXBhYmlsaXR5Lmdyb3VwQ2FwYWJpbGl0eSwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfR09ORUdDTkYpLCBGUkZMKCJPcGVyYXRpbmdDaGFubmVsOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5QMlBHT05lZ0NuZi5PcGVyYXRpbmdDaGFubmVsLnByZ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OlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPlAyUEdPTmVnV1BTLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0dPTkVHUkVRKSwgRlJGTCgiVmVyc2lvbjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+UDJQR09OZWdXUFMuVmVyc2lvbi5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUSksIEZSRkwoIm1pbm9yICg0KTogJWRcbiIpLCBwRnJtLT5QMlBHT05lZ1dQUy5WZXJzaW9uLm1pbm9yKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfR09ORUdSRVEpLCBGUkZMKCJtYWpvciAoNCk6ICVkXG4iKSwgcEZybS0+UDJQR09OZWdXUFMuVmVyc2lvbi5tYWpvcik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfR09ORUdSRVEpLCBGUkZMKCJEZXZpY2VQYXNzd29yZElEOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5QMlBHT05lZ1dQUy5EZXZpY2VQYXNzd29yZElELnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0dPTkVHUkVRKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0dPTkVHUkVRKSwgKCB0QU5JX1U4KiApJnBGcm0tPlAyUEdPTmVnV1BTLkRldmljZVBhc3N3b3JkSUQuaWQsIDIpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUSksIEZSRkwoIlAyUEdPTmVnUmVxOlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPlAyUEdPTmVnUmVxLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0dPTkVHUkVRKSwgRlJGTCgiUDJQQ2FwYWJpbGl0eTpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+UDJQR09OZWdSZXEuUDJQQ2FwYWJpbGl0eS5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUSksICggdEFOSV9VOCogKSZwRnJtLT5QMlBHT05lZ1JlcS5QMlBDYXBhYmlsaXR5LmRldmljZUNhcGFiaWxpdHksIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUSksICggdEFOSV9VOCogKSZwRnJtLT5QMlBHT05lZ1JlcS5QMlBDYXBhYmlsaXR5Lmdyb3VwQ2FwYWJpbGl0eSwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfR09ORUdSRVEpLCBGUkZMKCJHT0ludGVudDpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+UDJQR09OZWdSZXEuR09JbnRlbnQucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfR09ORUdSRVEpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICA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lzdGVuVGltaW5nOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5QMlBHT05lZ1JlcS5FeHRlbmRlZExpc3RlblRpbWluZy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUSksICggdEFOSV9VOCogKSZwRnJtLT5QMlBHT05lZ1JlcS5FeHRlbmRlZExpc3RlblRpbWluZy5hdmFpbGliaWxpdHlQZXJpb2QsIDIpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUSksICggdEFOSV9VOCogKSZwRnJtLT5QMlBHT05lZ1JlcS5FeHRlbmRlZExpc3RlblRpbWluZy5hdmFpbGliaWxpdHlJbnRlcnZhbCwgMik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfR09ORUdSRVEpLCBGUkZMKCJJbnRlbmRlZFAyUEludGVyZmFjZUFkZHJlc3M6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPlAyUEdPTmVnUmVxLkludGVuZGVkUDJQSW50ZXJmYWNlQWRkcmVzcy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR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2aWNlSW5mby5jb25maWdNZXRob2QsIDIpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUSksICggdEFOSV9VOCogKSZwRnJtLT5QMlBHT05lZ1JlcS5QMlBEZXZpY2VJbmZvLnByaW1hcnlEZXZpY2VUeXBlLCA4KTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfR09ORUdSRVEpLCBGUkZMKCJEZXZpY2VOYW1lOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UDJQR09OZWdSZXEuUDJQRGV2aWNlSW5mby5EZXZpY2VOYW1lLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfR09ORUdSRVEpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0dPTkVHUkVRKSwgRlJGTCgibnVtX3RleHQ6ICVkLlxuIiksIHBGcm0tPlAyUEdPTmVnUmVxLlAyUERldmljZUluZm8uRGV2aWNlTmFtZS5udW1fdGV4dCk7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUSksICggdEFOSV9VOCogKSBwRnJtLT5QMlBHT05lZ1JlcS5QMlBEZXZpY2VJbmZvLkRldmljZU5hbWUudGV4dC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lTdWJ0eXBlLCAxKTsKKyAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0dPTkVHUkVTKSwgRlJGTCgiRGlhbG9nVG9rZW46XG4iKSk7CisgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUyksICggdEFOSV9VOCogKSZwRnJtLT5EaWFsb2dUb2tlbi50b2tlbiwgMSk7CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUyksIEZSRkwoIlAyUEdPTmVnV1BTOlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPlAyUEdPTmVnV1BTLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0dPTkVHUkVTKSwgRlJGTCgiVmVyc2lvbjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+UDJQR09OZWdXUFMuVmVyc2lvbi5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19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bnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0dPTkVHUkVTKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0dPTkVHUkVTKSwgKCB0QU5JX1U4KiApJnBGcm0tPlAyUEdPTmVnUmVzLlAyUENhcGFiaWxpdHkuZGV2aWNlQ2FwYWJpbGl0eSwgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0dPTkVHUkVTKSwgKCB0QU5JX1U4KiApJnBGcm0tPlAyUEdPTmVnUmVzLlAyUENhcGFiaWxpdHkuZ3JvdXBDYXBhYmlsaXR5LCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUyksIEZSRkwoIkdPSW50ZW50OlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5QMlBHT05lZ1Jlcy5HT0ludGVudC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZS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y5QMlBEZXZpY2VJbmZvLkRldmljZU5hbWUubnVtX3RleHQpOworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfR09ORUdSRVMpLCAoIHRBTklfVTgqICkgcEZybS0+UDJQR09OZWdSZXMuUDJQRGV2aWNlSW5mby5EZXZpY2VOYW1lLnRleHQsIHBGcm0tPlAyUEdPTmVnUmVzLlAyUERldmljZUluZm8uRGV2aWNlTmFtZS5udW1fdGV4dCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0dPTkVHUkVTKSwgRlJGTCgiUDJQR3JvdXBJZDpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+UDJQR09OZWdSZXMuUDJQR3JvdXBJZC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUyksICggdEFOSV9VOCogKSZwRnJtLT5QMlBHT05lZ1Jlcy5QMlBHcm91cElkLmRldmljZUFkZHJlc3MsIDYpOworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9HT05FR1JFUyksIEZSRkwoIm51bV9zc2lkOiAlZC5cbiIpLCBwRnJtLT5QMlBHT05lZ1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yAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0lOVklUQVRJT05SRVEpLCBGUkZMKCJDb25maWd1cmF0aW9uVGltZW91dDpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+UDJQSW52aXRhdGlvblJlcS5Db25maWd1cmF0aW9uVGltZW91dC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9JTlZJVEFUSU9OUkVRKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0lOVklUQVRJT05SRVEpLCAoIHRBTklfVTgqICkmcEZybS0+UDJQSW52aXRhdGlvblJlcS5Db25maWd1cmF0aW9uVGltZW91dC5HT0NvbmZpZ1RpbWVvdXQsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9JTlZJVEFUSU9OUkVRKSwgKCB0QU5JX1U4KiApJnBGcm0tPlAyUEludml0YXRpb25SZXEuQ29uZmlndXJhdGlvblRpbWVvdXQuQ0xDb25maWdUaW1lb3V0LCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9JTlZJVEFUSU9OUkVRKSwgRlJGTCgiSW52aXRhdGlvbkZsYWdzOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5QMlBJbnZpdGF0aW9uUmVxLkludml0YXRpb25GbGFncy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9JTlZJVEFUSU9OUkVRKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0lOVklUQVRJT05SRVEpLCAoIHRBTklfVTgqICkmcEZybS0+UDJQSW52aXRhdGlvblJlcS5JbnZpdGF0aW9uRmxhZ3MuaW52aXRhdGlvbkZsYWdzLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9JTlZJVEFUSU9OUkVRKSwgRlJGTCgiT3BlcmF0aW5nQ2hhbm5lbDpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+UDJQSW52aXRhdGlvblJlcS5PcGVyYXRpbmdDaGFubmVsLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0lOVklUQVRJT05SRVEpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfSU5WSVRBVElPTlJFUSksICggdEFOSV9VOCogKSZwRnJtLT5QMlBJbnZpdGF0aW9uUmVxLk9wZXJhdGluZ0NoYW5uZWwuY291bnRyeVN0cmluZywgMyk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0lOVklUQVRJT05SRVEpLCAoIHRBTklfVTgqICkmcEZybS0+UDJQSW52aXRhdGlvblJlcS5PcGVyYXRpbmdDaGFubmVsLnJlZ3VsYXRvcnlDbGFzcywgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0lOVklUQVRJT05SRVEpLCAoIHRBTklfVTgqICkmcEZybS0+UDJQSW52aXRhdGlvblJlcS5PcGVyYXRpbmdDaGFubmVsLmNoYW5uZWwsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0lOVklUQVRJT05SRVEpLCBGUkZMKCJQMlBHcm91cEJzc2lkOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5QMlBJbnZpdGF0aW9uUmVxLlAyUEdyb3VwQnNzaWQucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfSU5WSVRBVElPTlJFUSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9JTlZJVEFUSU9OUkVRKSwgKCB0QU5JX1U4KiApJnBGcm0tPlAyUEludml0YXRpb25SZXEuUDJQR3JvdXBCc3NpZC5QM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0LCBwRnJtLT5QMlBJbnZpdGF0aW9uUmVxLkNoYW5uZWxMaXN0Lm51bV9jaGFubmVsTGlzdCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfSU5WSVRBVElPTlJFUSksIEZSRkwoIlAyUEdyb3VwSWQ6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPlAyUEludml0YXRpb25SZXEuUDJQR3JvdXBJZC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9JTlZJVEFUSU9OUkVRKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0lOVklUQVRJT05SRVEpLCAoIHRBTklfVTgqICkmcEZybS0+UDJQSW52aXRhdGlvblJlcS5QMlBHcm91cElkLmRldmljZUFkZHJlc3MsIDYpOworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9JTlZJVEFUSU9OUkVRKSwgRlJGTCgibnVtX3NzaWQ6ICVkLlxuIiksIHBGcm0tPlAyUEludml0YXRpb25SZXEuUDJQR3JvdXBJZC5udW1fc3NpZCk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0lOVklUQVRJT05SRVEpLCAoIHRBTklfVTgqICkgcEZybS0+UDJQSW52aXRhdGlvblJlcS5QMlBHcm91cElkLnNzaWQsIHBGcm0tPlAyUEludml0YXRpb25SZXEuUDJQR3JvdXBJZC5udW1fc3NpZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfSU5WSVRBVElPTlJFUSksIEZSRkwoIlAyUERldmljZUluZm86XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPlAyUEludml0YXRpb25SZXEuUDJQRGV2aWNlSW5mby5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9JTlZJVEFUSU9OUkVRKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0lOVklUQVRJT05SRVEpLCAoIHRBTklfVTgqICkmcEZybS0+UDJQSW52aXRhdGlvblJlcS5QMlBEZXZpY2VJbmZvLlAyUERldmljZUFkZHJlc3MsIDYpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9JTlZJVEFUSU9OUkVRKSwgKCB0QU5JX1U4KiApJnBGcm0tPlAyUEludml0YXRpb25SZXEuUDJQRGV2aWNlSW5mby5jb25maWdNZXRob2QsIDIpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9JTlZJVEFUSU9OUkVRKSwgKCB0QU5JX1U4KiApJnBGcm0tPlAyUEludml0YXRpb25SZXEuUDJQRGV2aWNlSW5mby5wcmltYXJ5RGV2aWNlVHlwZSwgOCk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0lOVklUQVRJT05SRVEpLCBGUkZMKCJEZXZpY2VOYW1lOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UDJQSW52aXRhdGlvblJlcS5QMlBEZXZpY2VJbmZvLkRldmljZU5hbWUucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9JTlZJVEFUSU9OUkVRKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9JTlZJVEFUSU9OUkVRKSwgRlJGTCgibnVtX3RleHQ6ICVkLlxuIiksIHBGcm0tPlAyUEludml0YXRpb25SZXEuUDJQRGV2aWNlSW5mby5EZXZpY2VOYW1lLm51bV90ZXh0KTsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0lOVklUQVRJT05SRVEpLCAoIHRBTklfVTgqICkgcEZybS0+UDJQSW52aXRhdGlvblJlcS5QMlBEZXZpY2VJbmZvLkRldmljZU5hbWUudGV4dCwgcEZybS0+UDJQSW52aXRhdGlvblJlcS5QMlBEZXZpY2VJbmZvLkRldmljZU5hbWUubnVtX3RleHQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBGUkFNRVNfTE9HMChw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Sk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX0lOVklUQVRJT05SRVMpLCAoIHRBTklfVTgqICkmcEZybS0+UDJQSW52aXRhdGlvblJlcy5QMlBTdGF0dXMuc3RhdHVzLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9JTlZJVEFUSU9OUkVTKSwgRlJGTCgiQ29uZmlndXJhdGlvblRpbWVvdXQ6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPlAyUEludml0YXRpb25SZXMuQ29uZmlndXJhdGlvblRpbWVvdXQucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfSU5WSVRBVElPTlJFUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9JTlZJVEFUSU9OUkVTKSwgKCB0QU5JX1U4KiApJnBGcm0tPlAyUEludml0YXRpb25SZXMuQ29uZmlndXJhdGlvblRpbWVvdXQuR09Db25maWdUaW1lb3V0LCAxKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfSU5WSVRBVElPTlJFUyksICggdEFOSV9VOCogKSZwRnJtLT5QMlBJbnZpdGF0aW9uUmVz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NQT05TRSksIEZSRkwoIlRTRkluZm86XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5OZWlnaGJvclJlcG9ydFtpXS5UU0ZJbmZvLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfTkVJR0hCT1JSRVBPUlRSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfTkVJR0hCT1JSRVBPUlRSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5OZWlnaGJvclJlcG9ydFtpXS5UU0ZJbmZvLlRzZk9mZnNldCwgMik7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9ORUlHSEJPUlJFUE9SVFJFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPk5laWdoYm9yUmVwb3J0W2ldLlRTRkluZm8uQmVhY29uSW50dmwsIDIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfTkVJR0hCT1JSRVBPUlRSRVNQT05TRSksIEZSRkwoIkNvbmRlbnNlZENvdW50cnlTdHI6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5OZWlnaGJvclJlcG9ydFtpXS5Db25kZW5zZWRDb3VudHJ5U3RyLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfTkVJR0hCT1JSRVBPUlRSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfTkVJR0hCT1JSRVBPUlRSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5OZWlnaGJvclJlcG9ydFtpXS5Db25kZW5zZWRDb3VudHJ5U3RyLmNvdW50cnlTdHIsIDIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfTkVJR0hCT1JSRVBPUlRSRVNQT05TRSksIEZSRkwoIk1lYXN1cmVtZW50UGlsb3Q6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5OZWlnaGJvclJlcG9ydFtpXS5NZWFzdXJlbWVudFBpbG90LnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfTkVJR0hCT1JSRVBPUlRSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfTkVJR0hCT1JSRV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cEZybS0+RGlhbG9nVG9rZW4udG9rZW4sIDEpOworICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfTk9USUNFT0ZBQlMpLCBGUkZMKCJQMlBOb3RpY2VPZkFic2VuY2U6XG4iKSk7CisgICAgICAgIGlmICghcEZybS0+UDJQTm90aWNlT2ZBYnNlbmNlLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9OT1RJQ0VPRkFCUyksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX05PVElDRU9GQUJTKSwgRlJGTCgiTm90aWNlT2ZBYnNlbmNlOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5QMlBOb3RpY2VPZkFic2VuY2UuTm90aWNlT2ZBYnNlbmNlLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX05PVElDRU9GQUJTKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX05PVElDRU9GQUJTKSwgKCB0QU5JX1U4KiApJnBGcm0tPlAyUE5vdGljZU9mQWJzZW5jZS5Ob3RpY2VPZkFic2VuY2UuaW5kZXgsIDEpOworICAgICAgICAgICAgICAgIE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X0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVFVRVNUKSwgRlJGTCgiRGV2aWNlUGFzc3dvcmRJRDpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+V3NjUHJvYmVSZXEuRGV2aWNlUGFzc3dvcmRJRC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFUVVFU1QpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPldzY1Byb2JlUmVxLkRldmljZVBhc3N3b3JkSUQuaWQsIDIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksIEZSRkwoIk1hbnVmYWN0dXJlcjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+V3NjUHJvYmVSZXEuTWFudWZhY3R1cmVyLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQ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FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFUVVFU1QpLCBGUkZMKCJEZXZpY2VOYW1lOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NQcm9iZVJlcS5EZXZpY2VOYW1lLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFUVVFU1QpLCBGUkZMKCJudW1fdGV4dDogJWQuXG4iKSwgcEZybS0+V3NjUHJvYmVSZXEuRGV2aWNlTmFtZS5udW1fdGV4dCk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksICggdEFOSV9VOCogKSBwRnJtLT5Xc2NQcm9iZVJlcS5EZXZpY2VOYW1lLnRleHQsIHBGcm0tPldzY1Byb2JlUmVxLkRldmljZU5hbWUubnVtX3RleHQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksIEZSRkwoIlZlbmRvckV4dGVuc2lvbjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+V3NjUHJvYmVSZXEuVmVuZG9yRXh0ZW5zaW9uLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjUHJvYmVSZXEuVmVuZG9yRXh0ZW5zaW9uLnZlbmRvcklkLCAzKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVFVRVNUKSwgRlJGTCgiVmVyc2lvbjI6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5Xc2NQcm9iZVJlcS5WZW5kb3JFeHRlbnNpb24uVmVyc2lvbjIucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFUVVFU1QpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksIEZSRkwoIm1pbm9yICg0KTogJWRcbiIpLCBwRnJtLT5Xc2NQcm9iZVJlcS5WZW5kb3JFeHRlbnNpb24uVmVyc2lvbjIubWlub3IpOworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVFVRVNUKSwgRlJGTCgibWFqb3IgKDQpOiAlZFxuIiksIHBGcm0tPldzY1Byb2JlUmVxLlZlbmRvckV4dGVuc2lvbi5WZXJzaW9uMi5tYWpvcik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFUVVFU1QpLCBGUkZMKCJBdXRob3JpemVkTUFDczpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPldzY1Byb2JlUmVxLlZlbmRvckV4dGVuc2lvbi5BdXRob3JpemVkTUFDcy5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPldzY1Byb2JlUmVxLlZlbmRvckV4dGVuc2lvbi5BdXRob3JpemVkTUFDcy5tYWMsIDYpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVFVRVNUKSwgRlJGTCgiUmVxdWVzdFRvRW5yb2xsOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+V3NjUHJvYmVSZXEuVmVuZG9yRXh0ZW5zaW9uLlJlcXVlc3RUb0Vucm9sbC5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPldzY1Byb2JlUmVxLlZlbmRvckV4dGVuc2lvbi5SZXF1ZXN0VG9FbnJvbGwucmVxLCAxKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVFVRVNUKSwgRlJGTCgiUmVxdWVzdERldmljZVR5cGU6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPldzY1Byb2JlUmVxLlJlcXVlc3REZXZpY2VUeXBlLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QU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sKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlAyUFByb2JlUmVxLk9wZXJhdGluZ0NoYW5uZWwuY291bnRyeVN0cmluZywgMyk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5QMlBQcm9iZVJlcS5PcGVyYXRpbmdDaGFubmVsLnJlZ3VsYXRvcnlDbGFzcywgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5QMlBQcm9iZVJlcS5PcGVyYXRpbmdDaGFubmVsLmNoYW5uZWwsIDEpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFUVVFU1QpLCBGUkZMKCJWSFRDYXBzOlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPlZIVENhcHMucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTU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GX1BST0JFUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uQlBJbmRpY2F0b3IudHlwZSwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksIEZSRkwoIkxvYWRJbmZvOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5Mb2FkSW5mby5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uTG9hZEluZm8ubnVtX3N0YXMsIDIpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLkxvYWRJbmZvLmNoYW5uZWxfdXRpbCwgMik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksIEZSRkwoIkxvYWRCYWxhbmNlOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5Mb2FkQmFsYW5jZS5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uTG9hZEJhbGFuY2UuYnNzaWQsIDYpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLkxvYWRCYWxhbmNlLmNoYW5uZWwsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCBGUkZMKCJQcm9wQXNzb2NUeXBlOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5Qcm9wQXNzb2NUeXBlLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5Qcm9wQXNzb2NUeXBlLnR5cGUsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCBGUkZMKCJMTEF0dHI6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLkxMQXR0ci5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uTExBdHRyLmRlZmVyX3RocmVzaG9sZCwgNCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksIEZSRkwoIlByb3BDYXBhYmlsaXR5OlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5Qcm9wQ2FwYWJpbGl0eS5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uUHJvcENhcGFiaWxpdHkuY2FwYWJpbGl0eSwgMik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksIEZSRkwoIlZlcnNpb246XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLlZlcnNpb24ucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLlZlcnNpb24uY2hpcF9yZXYsIDQpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLlZlcnNpb24uY2FyZF90eXBlLCAxKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkF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QU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgicnN2ZCAoNCk6ICVkXG4iKSwgcEZybS0+QWlyZ28uVGF1cnVzLnJzdmQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiV3NjUHJvYmVSZXM6XG4iKSk7CisgICAgICAgIGlmICghcEZybS0+V3NjUHJvYmVSZXMucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiVmVyc2lvbjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+V3NjUHJvYmVSZXMuVmVyc2lvbi5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9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TsKKyAgICAgICAgICAgIGlmICghcEZybS0+V3NjUHJvYmVSZXMuVVVJRF9FLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5Xc2NQcm9iZVJlcy5VVUlEX0UudXVpZCwgMTYpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCBGUkZMKCJNYW51ZmFjdHVyZXI6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPldzY1Byb2JlUmVzLk1hbnVmYWN0dXJlci5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCBGUkZMKCJudW1fbmFtZTogJWQuXG4iKSwgcEZybS0+V3NjUHJvYmVSZXMuTWFudWZhY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0ZW5zaW9uLlZlcnNpb24yLm1ham9yKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCBGUkZMKCJBdXRob3JpemVkTUFDczpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPldzY1Byb2JlUmVzLlZlbmRvckV4dGVuc2lvbi5BdXRob3JpemVkTUFDcy5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjUHJvYmVSZXMuVmVuZG9yRXh0ZW5zaW9uLkF1dGhvcml6ZWRNQUNzLm1hYywgNik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiUmVxdWVzdFRvRW5yb2xsOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+V3NjUHJvYmVSZXMuVmVuZG9yRXh0ZW5zaW9uLlJlcXVlc3RUb0Vucm9sbC5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjUHJvYmVSZXMuVmVuZG9yRXh0ZW5zaW9uLlJlcXVlc3RUb0Vucm9sbC5yZXEsIDEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksIEZSRkwoIlAyUFByb2JlUmVzOlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPlAyUFByb2JlUmVzLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksIEZSRkwoIlAyUENhcGFiaWxpdHk6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPlAyUFByb2JlUmVzLlAyUENhcGFiaWxpdHkucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlAyUFByb2JlUmVzLlAyUENhcGFiaWxpdHkuZGV2aWNlQ2FwYWJpbGl0eSwgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UDJQUHJvYmVSZXMuUDJQQ2FwYWJpbGl0eS5ncm91cENhcGFiaWxpdHksIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCBGUkZMKCJFeHRlbmRlZExpc3RlblRpbWluZzpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+UDJQUHJvYmVSZXMuRXh0ZW5kZWRMaXN0ZW5UaW1pbmcucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgs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U0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5QMlBQcm9iZVJlcy5Ob3RpY2VPZkFic2VuY2UuQ1RTV2luZG93T3BwUFMsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgibnVtX05vQURlc2M6ICVkLlxuIiksIHBGcm0tPlAyUFByb2JlUmVzLk5vdGljZU9mQWJzZW5jZS5udW1fTm9BRGVzYyk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCAoIHRBTklfVTgqICkgcEZybS0+UDJQUHJvYmVSZXMuTm90aWNlT2ZBYnNlbmNlLk5vQURlc2MsIHBGcm0tPlAyUFByb2JlUmVzLk5vdGljZU9mQWJzZW5jZS5udW1fTm9BRGVzYyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksIEZSRkwoIlAyUERldmljZUluZm86XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPlAyUFByb2JlUmVzLlAyUERldmljZUluZm8ucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUFJPQkVSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlAyUFByb2JlUmVzLlAyUERldmljZUluZm8uUDJQRGV2aWNlQWRkcmVzcywgNik7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UDJQUHJvYmVSZXMuUDJQRGV2aWNlSW5mby5jb25maWdNZXRob2QsIDIpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlAyUFByb2JlUmVzLlAyUERldmljZUluZm8ucHJpbWFyeURldmljZVR5cGUsIDgpOworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9QUk9CRVJFU1BPTlNFKSwgRlJGTCgiRGV2aWNlTmFtZTpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPlAyUFByb2JlUmVzLlAyUERldmljZUluZm8uRGV2aWNlTmFtZS5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1BST0JFUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFV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ybS0+TnVtT2ZSZXBldGl0aW9ucy5yZXBldGl0aW9ucywgMik7CisgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwRnJtLT5udW1fTWVhc3VyZW1lbnRSZXF1ZXN0OyArK2kpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SQURJT01FQVNVUkVNRU5UUkVRVUVTVCksIEZSRkwoIk1lYXN1cmVtZW50UmVxdWVzdFslZF06XG4iKSwgaSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPk1lYXN1cmVtZW50UmVxdWVzdFtpXS5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SQURJT01FQVNVUkVNRU5UUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SQURJT01FQVNVUkVNRU5UUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5NZWFzdXJlbWVudFJlcXVlc3RbaV0ubWVhc3VyZW1lbnRfdG9rZW4sIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SQURJT01FQVNVUkVNRU5UUkVRVUVTVCksIEZSRkwoInBhcmFsbGVsICgxKTogJWRcbiIpLCBwRnJtLT5NZWFzdXJlbWVudFJlcXVlc3RbaV0ucGFyYWxsZWwpOworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZS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RJbmZvLlIwS0hfSUQubnVtX1BNS19SMF9JRCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCBGUkZMKCJJR1RLOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5GVEluZm8uSUdUSy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5GVEluZm8uSUdUSy5rZXlJRCwgMik7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPkZUSW5mby5JR1RLLklQTiwgNik7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPkZUSW5mby5JR1RLLmtleUxlbmd0aCwgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPkZUSW5mby5JR1RLLmtleSwgMjQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwRnJtLT5udW1fUklDRGF0YURlc2M7ICsraSkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgRlJGTCgiUklDRGF0YURlc2NbJWRdOlxuIiksIGkpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5SSUNEYXRhRGVzY1tpXS5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIlJJQ0RhdGE6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5SSUNEYXRhRGVzY1tpXS5SSUNEYXRhLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl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URlc2NbaV0ubnVtX1RDTEFTOyArK2kpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCBGUkZMKCJUQ0xBU1slZF06XG4iKSwgaSk7CisgICAgICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0ucHJlc2VudCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0udXNlcl9wcmlvcml0eSwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uY2xhc3NpZmllcl90eXBlLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5jbGFzc2lmaWVyX21hc2ssIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5jbGFzc2lmaWVyX3R5cGUpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5FdGhQYXJhbXMuc291cmNlLCA2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uRXRoUGFyYW1zLmRlc3QsIDYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5FdGhQYXJhbXMudHlwZSwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5JcFBhcmFtcy52ZXJzaW9uLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnZlcnNpb24pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5zb3VyY2UsIDQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLmRlc3QsIDQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFy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cG9ydCwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZmxvd19sYWJlbCwgMyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uUGFyYW1zODAyMWRxLnRhZ190eXBlLCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCBGUkZMKCJUQ0xBU1NQUk9DOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNTUFJPQy5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1NQUk9DLnByb2Nlc3NpbmcsIDEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCBGUkZMKCJUU0RlbGF5OlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uVFNEZWxheS5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UU0RlbGF5LmRlbGF5LCA0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRz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QU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIldNTVRTUEVDOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uV01NVFNQRUMucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVFNQRUMudmVyc2lvbiwgMSk7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoInRyYWZmaWNfdHlwZSAoMSk6ICVkXG4iKSwgcEZybS0+UklDRGF0YURlc2NbaV0uV01NVFNQRUMudHJhZmZpY190eXBlKTsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgRlJGTCgidHNpZCAoNCk6ICVkXG4iKSwgcEZybS0+UklDRGF0YURlc2NbaV0uV01NVFNQRUMudHNpZCk7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUk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pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLnZlcnNpb24sIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLnVzZXJfcHJpb3JpdHksIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmNsYXNzaWZpZXJfdHlwZSwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uY2xhc3NpZmllcl9tYXNrLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAocEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uY2xhc3NpZmllcl90eXBlKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgM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uaW5mby5JcFBhcmFtcy52ZXJzaW9uKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuc291cmNlLCA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5kZXN0LCA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5zcmNfcG9ydCwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuZGVzdF9wb3J0LCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5EU0NQLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5wcm90bywgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMucmVzZXJ2ZWQsIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDY6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0N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XRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmZsb3dfbGFiZWwsIDMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDI6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS5pbmZvLlBhcmFtczgwMjFkcS50YWdfdHlwZSwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgRlJGTCgiV01NVENMQVNQUk9DOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNQUk9DLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgIC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KHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5IQ0YuZW5hYmxlZCwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFUVVFU1QpLCBGUkZMKCJXRFM6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLldEUy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIm51bV93ZHNEYXRhOiAlZC5cbiIpLCBwRnJtLT5BaXJnby5XRFMubnVtX3dkc0RhdGEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSBwRnJtLT5BaXJnby5XRFMud2RzRGF0YSwgcEZybS0+QWlyZ28uV0RTLm51bV93ZHNEYXRhKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIkJQSW5kaWNhdG9yOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5CUEluZGljYXRvci5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5CUEluZGljYXRvci5pbmRpY2F0b3IsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5CUEluZGljYXRvci50eXBlLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIkxvYWRJbmZvOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5Mb2FkSW5mby5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPV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worICAgICAgICAgICAgaWYgKCFwRnJtLT5BaXJnby5Qcm9wRURDQVBhcmFtcy5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5Qcm9wRURDQVBhcmFtcy5xb3MsIDEpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVRVUVTVCksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5Qcm9wRURDQVBhcmFtcy5yZXNlcnZlZCwgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgRlJGTCgiYWNiZV9haWZzbiAoNCk6ICVkXG4iKSwgcEZybS0+QWlyZ28uUHJvcEVEQ0FQYXJhbXMuYWNiZV9haWZzbik7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVFVRVNUKSwgRlJGTCgiYWNiZV9hY20gKDEpOiAlZFxuIiksIHBGcm0tPkFpcmdvLlByb3BFRENBUGFyYW1zLmFjYmVfYWNtKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4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gRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIklHVEs6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkZUSW5mby5JR1RLLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLklHVEsua2V5SUQsIDIpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLklHVEsuSVBOLCA2KTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPkZUSW5mby5JR1RLLmtleUxlbmd0aCwgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5GVEluZm8uSUdUSy5rZXksIDI0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcEZybS0+bnVtX1JJQ0RhdGFEZXNjOyArK2kpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCBGUkZMKCJSSUNEYXRhRGVzY1slZF06XG4iKSwgaSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPlJJQ0RhdGFEZXNjW2ldLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCBGUkZMKCJSSUNEYXRhOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uUklDRGF0YS5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlJJQ0RhdGEuSWRlbnRpZmllciwgMSk7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uUklDRGF0YS5yZXNvdXJjZURlc2NDb3VudCwgMSk7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uUklDRGF0YS5zdGF0dXNDb2RlLCAyKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIlJJQ0Rlc2NyaXB0b3I6XG4iKSk7CisgICAgICAgICAgICAgICAgaWYgKCFwRnJtLT5SSUNEYXRhRGVzY1tpXS5SSUNEZXNjcmlwdG9yLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uUklDRGVzY3JpcHRvci5yZXNvdXJjZVR5cGUsIDEpOworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgRlJGTCgibnVtX3ZhcmlhYmxlRGF0YTogJWQuXG4iKSwgcEZybS0+UklDRGF0YURlc2NbaV0uUklDRGVzY3JpcHRvci5udW1fdmFyaWFibGVEYXRhKTsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSBwRnJtLT5SSUNEYXRhRGVzY1tpXS5SSUNEZXNjcmlwdG9yLnZhcmlhYmxlRGF0YSwgcEZybS0+UklDRGF0YURlc2NbaV0uUklDRGVzY3JpcHRvci5udW1fdmFyaWFibGVEYXRhKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIlRTUEVDOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uVFNQRUMucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0e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SRUFTU09DUkVTUE9OU0UpLCBGUkZMKCJUQ0xBU1slZF06XG4iKSwgaSk7CisgICAgICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0ucHJlc2VudCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS51c2VyX3ByaW9yaXR5LCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uY2xhc3NpZmllcl90eXBlLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uY2xhc3NpZmllcl9tYXNrLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAocEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uY2xhc3NpZmllcl90eXBlKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLkV0aFBhcmFtcy5zb3VyY2UsIDYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uRXRoUGFyYW1zLmRlc3QsIDYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uRXRoUGFyYW1zLnR5cGUsIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1tpXS5pbmZvLklwUGFyYW1zLnZlcnNpb24sIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uSXBQYXJhbXMudmVyc2lvbikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA0OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5zb3VyY2UsIDQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5kZXN0LCA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuc3JjX3BvcnQsIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5kZXN0X3BvcnQsIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5EU0NQLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMucHJvdG8sIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5yZXNlcnZlZCwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0V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E9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5mbG93X2xhYmVsLCAzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTW2ldLmluZm8uUGFyYW1zODAyMWRxLnRhZ190eXBlLCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgRlJGTCgiVENMQVNTUFJPQzpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRDTEFTU1BST0MucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UQ0xBU1NQUk9DLnByb2Nlc3NpbmcsIDEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgRlJGTCgiVFNEZWxheTpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPlJJQ0RhdGFEZXNjW2ldLlRTRGVsYXkucHJlc2VudCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5UU0RlbGF5LmRlbGF5LCA0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIlNjaGVkdWxlOlxuIikpOworICAgICAg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gICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLnZlcnNpb24sIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5SSUNEYXRhRGVzY1tpXS5XTU1UQ0xBU1tpXS51c2VyX3ByaW9yaXR5LCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uY2xhc3NpZmllcl90eXBlLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uY2xhc3NpZmllcl9tYXNrLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAocEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uY2xhc3NpZmllcl90eXBlKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMDoKKyAgICAg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LmluZm8uSXBQYXJhbXMudmVyc2lvbikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA0OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5zb3VyY2UsIDQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5kZXN0LCA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuc3JjX3BvcnQsIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5kZXN0X3BvcnQsIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5EU0NQLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMucHJvdG8sIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5yZXNlcnZlZCwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNF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lc2NbaV0uV01NVENMQVNbaV0uaW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5mbG93X2xhYmVsLCAzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGFEZXNjW2ldLldNTVRDTEFTW2ldLmluZm8uUGFyYW1zODAyMWRxLnRhZ190eXBlLCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgRlJGTCgiV01NVENMQVNQUk9DOlxuIikpOworICAgICAgICAgICAgICAgIGlmICghcEZybS0+UklDRGF0YURlc2NbaV0uV01NVENMQVNQUk9DLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7Cisg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HByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIm51bV9yYXRlczogJWQuXG4iKSwgcEZybS0+QWlyZ28uUHJvcFN1cHBSYXRlcy5udW1fcmF0ZXMpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkgcEZybS0+QWlyZ28uUHJvcFN1cHBSYXRlcy5yYXRlcywgcEZybS0+QWlyZ28uUHJvcFN1cHBSYXRlcy5udW1fcmF0ZXMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIkFQTmFtZTpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uQVBOYW1lLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCBGUkZMKCJudW1fbmFtZTogJWQuXG4iKSwgcEZybS0+QWlyZ28uQVBOYW1lLm51bV9uYW1lKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApIHBGcm0tPkFpcmdvLkFQTmFtZS5uYW1lLCBwRnJtLT5BaXJnby5BUE5hbWUubnVtX25hbWUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIkhDRjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uSENGLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uSENGLmVuYWJsZWQsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIldEUzpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uV0RTLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJ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KCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLkJQSW5kaWNhdG9yLmluZGljYXRvciwgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5CUEluZGljYXRvci50eXBlLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCBGUkZMKCJMb2FkSW5mbzpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uTG9hZEluZm8ucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5Mb2FkSW5mby5udW1fc3RhcywgMik7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5Mb2FkSW5mby5jaGFubmVsX3V0aWwsIDIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwg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R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksICggdEFOSV9VOCogKSZwRnJtLT5BaXJnby5Qcm9wQXNzb2NUeXBlLnR5cGUsIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIkxMQXR0cjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uTExBdHRyLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uTExBdHRyLmRlZmVyX3RocmVzaG9sZCwgNCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgRlJGTCgiUHJvcENhcGFiaWxpdHk6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkFpcmdvLlByb3BDYXBhYmlsaXR5LnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+QWlyZ28uUHJvcENhcGFiaWxpdHkuY2FwYWJpbGl0eSwgMik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgRlJGTCgiVmVyc2lvbjpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+QWlyZ28uVmVyc2lvbi5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPkFpcmdvLlZlcnNpb24uY2hpcF9yZXYsIDQpOworICAgICAgICAgICAg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0ZW5zaW9uLkF1dGhvcml6ZWRNQUNzLnByZXNlbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9SRUFTU09DUkVTUE9OU0UpLCAoIHRBTklfVTgqICkmcEZybS0+V3NjUmVhc3NvY1Jlcy5WZW5kb3JFeHRlbnNpb24uQXV0aG9yaXplZE1BQ3MubWFjLCA2KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIlJlcXVlc3RUb0Vucm9sbDpcbiIpKTsKKyAgICAgICAgICAgICAgICBpZiAoIXBGcm0tPldzY1JlYXNzb2NSZXMuVmVuZG9yRXh0ZW5zaW9uLlJlcXVlc3RUb0Vucm9sbC5wcmVzZW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgKCB0QU5JX1U4KiApJnBGcm0tPldzY1JlYXNzb2NSZXMuVmVuZG9yRXh0ZW5zaW9uLlJlcXVlc3RUb0Vucm9sbC5yZXEsIDEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfUkVBU1NPQ1JFU1BPTlNFKSwgRlJGTCgiUDJQQXNzb2NSZXM6XG4iKSk7CisgICAgICAgIGlmICghcEZybS0+UDJQQXNzb2NSZXMucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIlAyUFN0YXR1czpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+UDJQQXNzb2NSZXMuUDJQU3RhdHVzLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1JFQVNTT0NSRVNQT05TRSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0Z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UZfVERMU0RJU1JTUCksICggdEFOSV9VOCogKSBwRnJtLT5GVEluZm8uR1RLLmtleSwgcEZybS0+RlRJbmZvLkdUSy5udW1fa2V5KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTRElTUlNQKSwgRlJGTCgiUjBLSF9JRDpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+RlRJbmZvLlIwS0hfSUQucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU0RJU1JTUCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTRElTUlNQKSwgRlJGTCgibnVtX1BNS19SMF9JRDogJWQuXG4iKSwgcEZybS0+RlRJbmZvLlIwS0hfSUQubnVtX1BNS19SMF9JRCk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNESVNSU1ApLCAoIHRBTklfVTgqICkgcEZybS0+RlRJbmZvLlIwS0hfSUQuUE1LX1IwX0lELCBwRnJtLT5GVEluZm8uUjBLSF9JRC5udW1fUE1LX1IwX0lEKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTRElTUlNQKSwgRlJGTCgiSUdUSzpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+RlRJbmZvLklHVEsucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU0RJU1JTUCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTRElTUlNQKSwgKCB0QU5JX1U4KiApJnBGcm0tPkZUSW5mby5JR1RLLmtleUlELCAyKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU0RJU1JTUCksICggdEFOSV9VOCogKSZwRnJtLT5GVEluZm8uSUdUSy5JUE4sIDYpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTRElTUlNQKSwgKCB0QU5JX1U4KiApJnBGcm0tPkZUSW5mby5JR1RLLmtleUxlbmd0aCwgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNESVNSU1ApLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLklHVEsua2V5LCAyNCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNESVNSU1ApLCBGUkZMKCJUaW1lb3V0SW50ZXJ2YWw6XG4iKSk7CisgICAgICAgIGlmICghcEZybS0+VGltZW91dEludGVydmFsLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTRElTUlNQKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU0RJU1JTUCksICggdEFOSV9VOCogKSZwRnJtLT5UaW1lb3V0SW50ZXJ2YWwudGltZW91dFR5cGUsIDEpOworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNESVNSU1ApLCAoIHRBTklfVTgqICkmcEZybS0+VGltZW91dEludGVydmFsLnRpbWVvdXRWYWx1ZSwgNCk7CisgICAgICAgIH0KKyAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNESVNSU1ApLCBGUkZMKCJSSUNEYXRhOlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPlJJQ0RhdGEucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNESVNSU1ApLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTRElTUlNQKSwgKCB0QU5JX1U4KiApJnBGcm0tPlJJQ0RhdGEuSWRlbnRpZmllciwgMSk7CisgICAgIC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SWRlbnRpZmllci5wcmVzZW50KQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU0RJU1JTUCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNESVNSU1ApLCAoIHRBTklfVTgqICkmcEZybS0+TGlua0lkZW50aWZpZXIuYnNzaWQsIDYpOworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNESVNSU1ApLCAoIHRBTklfVTgqICkmcEZybS0+TGlua0lkZW50aWZpZXIuSW5pdFN0YUFkZHIsIDYpOworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNESVNSU1ApLCAoIHRBTklfVTgqICkmcEZybS0+TGlua0lkZW50aWZpZXIuUmVzcFN0YUFkZHIsIDYpOworICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTRElTUlNQKSwgRlJGTCgiVkhUQ2FwczpcbiIpKTsKKyAgICAgICAgaWYgKCFwRnJtLT5WSFRDYXBzLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTRElTUlNQKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICA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RVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1NFVFVQQ05GKSwgRlJGTCgiR1RLOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5GVEluZm8uR1RLLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUENORiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBDTkYpLCBGUkZMKCJrZXlJZCAoMik6ICVkXG4iKSwgcEZybS0+RlRJbmZvLkdUSy5rZXlJZCk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUENORiksIEZSRkwoInJlc2VydmVkICgxNCk6ICVkXG4iKSwgcEZybS0+RlRJbmZvLkdUSy5yZXNlcnZlZCk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUENORiksICggdEFOSV9VOCogKSZwRnJtLT5GVEluZm8uR1RLLmtleUxlbmd0aCwgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUENORiksICggdEFOSV9VOCogKSZwRnJtLT5GVEluZm8uR1RLLlJTQywgOCk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUENORiksIEZSRkwoIm51bV9rZXk6ICVkLlxuIiksIHBGcm0tPkZUSW5mby5HVEsubnVtX2tleSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUENORiksICggdEFOSV9VOCogKSBwRnJtLT5GVEluZm8uR1RLLmtleSwgcEZybS0+RlRJbmZvLkdUSy5udW1fa2V5KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBDTkYpLCBGUkZMKCJSMEtIX0lEOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5GVEluZm8uUjBLSF9JRC5wcmVzZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBDTkYpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1NFVFVQQ05GKSwgRlJGTCgibnVtX1BNS19SMF9JRDogJWQuXG4iKSwgcEZybS0+RlRJbmZvLlIwS0hfSUQubnVtX1BNS19SMF9JRCk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUENORiksICggdEFOSV9VOCogKSBwRnJtLT5GVEluZm8uUjBLSF9JRC5QTUtfUjBfSUQsIHBGcm0tPkZUSW5mby5SMEtIX0lELm51bV9QTUtfUjBfSUQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUENORiksIEZSRkwoIklHVEs6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkZUSW5mby5JR1RLLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUENORiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBDTkYpLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLklHVEsua2V5SUQsIDIpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBDTkYpLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLklHVEsuSVBOLCA2KTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1NFVFVQQ05GKSwgKCB0QU5JX1U4KiApJnBGcm0tPkZUSW5mby5JR1RLLmtleUxlbmd0aCwgMSk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUENORiksICggdEFOSV9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URExTU0VUVVBSRVEpLCBGUkZMKCJDb3VudHJ5OlxuIikpOworICAgICAgICBpZiAoIXBGcm0tPkNvdW50cnkucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJFUSksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJFUSksICggdEFOSV9VOCogKSZwRnJtLT5Db3VudHJ5LmNvdW50cnksIDMpOworICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJFUSksIEZSRkwoIm51bV90cmlwbGV0czogJWQuXG4iKSwgcEZybS0+Q291bnRyeS5udW1fdHJpcGxldHMpOworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJFUSksICggdEFOSV9VOCogKSBwRnJtLT5Db3VudHJ5LnRyaXBsZXRzLCAzICogcEZybS0+Q291bnRyeS5udW1fdHJpcGxldHMpOworICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSRVEpLCBGUkZMKCJFeHRTdXBwUmF0ZXM6XG4iKSk7CisgICAgICAgIGlmICghcEZybS0+RXh0U3VwcFJhdGVzLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBD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gICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSRVEpLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLklHVEsua2V5TGVuZ3RoLCAxKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1NFVFVQUkVRKSwgKCB0QU5JX1U4KiApJnBGcm0tPkZUSW5mby5JR1RLLmtleSwgMjQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSRVEpLCBGUkZMKCJUaW1lb3V0SW50ZXJ2YWw6XG4iKSk7CisgICAgICAgIGlmICghcEZybS0+VGltZW91dEludGVydmFsLnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSRVEpLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSRVEpLCAoIHRBTklfVTgqICkmcEZybS0+VGltZW91dEludGVydmFsLnRpbWVvdXRUeXBlLCAxKTsKKyAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSRVEpLCAoIHRBTklfVTgqICkmcEZybS0+VGltZW91dEludGVydmFsLnRpbWVvdXRWYWx1ZSwgNCk7CisgICA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KHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSU1ApLCBGUkZMKCJOb3QgcHJlc2VudC5cbiIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1NFVFVQUlNQKSwgKCB0QU5JX1U4KiApJnBGcm0tPkZUSW5mby5SMUtIX0lELlBNS19SMV9JRCwgNik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1NFVFVQUlNQKSwgRlJGTCgiR1RLOlxuIikpOworICAgICAgICAgICAgaWYgKCFwRnJtLT5GVEluZm8uR1RLLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJTUCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSU1ApLCBGUkZMKCJrZXlJZCAoMik6ICVkXG4iKSwgcEZybS0+RlRJbmZvLkdUSy5rZXlJZCk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJTUCksIEZSRkwoInJlc2VydmVkICgxNCk6ICVkXG4iKSwgcEZybS0+RlRJbm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gICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1NFVFVQUlNQKSwgRlJGTCgibnVtX1BNS19SMF9JRDogJWQuXG4iKSwgcEZybS0+RlRJbmZvLlIwS0hfSUQubnVtX1BNS19SMF9JRCk7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJTUCksICggdEFOSV9VOCogKSBwRnJtLT5GVEluZm8uUjBLSF9JRC5QTUtfUjBfSUQsIHBGcm0tPkZUSW5mby5SMEtIX0lELm51bV9QTUtfUjBfSUQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJTUCksIEZSRkwoIklHVEs6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkZUSW5mby5JR1RLLnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNTRVRVUFJTUCksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTU0VUVVBSU1ApLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLklHVEsua2V5SUQsIDIpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU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ybS0+RlRJbmZvLklFQ291bnQpOworICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNURUFSRE9XTiksICggdEFOSV9VOCogKSZwRnJtLT5GVEluZm8uTUlDLCAxNik7CisgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1RFQVJET1dOKSwgKCB0QU5JX1U4KiApJnBGcm0tPkZUSW5mby5Bbm9uY2UsIDMyKTsKKyAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTVEVBUkRPV04pLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLlNub25jZSwgMzIpOworICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNURUFSRE9XTiksIEZSRkwoIlIxS0hfSUQ6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkZUSW5mby5SMUtIX0lELnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNURUFSRE9XTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTVEVBUkRPV04pLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLlIxS0hfSUQuUE1LX1IxX0lELCA2KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICA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ICAgICAgICAgICAgICBGUkFNRVNfTE9HMShwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1RFQVJET1dOKSwgRlJGTCgibnVtX2tleTogJWQuXG4iKSwgcEZybS0+RlRJbmZvLkdUSy5udW1fa2V5KTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1RFQVJET1dOKSwgKCB0QU5JX1U4KiApIHBGcm0tPkZUSW5mby5HVEsua2V5LCBwRnJtLT5GVEluZm8uR1RLLm51bV9rZXkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNURUFSRE9XTiksIEZSRkwoIlIwS0hfSUQ6XG4iKSk7CisgICAgICAgICAgICBpZiAoIXBGcm0tPkZUSW5mby5SMEtIX0lELnByZXNlbnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNURUFSRE9XTiksIEZSRkwoIk5vdCBwcmVzZW50LlxuIikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEZSQU1FU19MT0cxKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTVEVBUkRPV04pLCBGUkZMKCJudW1fUE1LX1IwX0lEOiAlZC5cbiIpLCBwRnJtLT5GVEluZm8uUjBLSF9JRC5udW1fUE1LX1IwX0lEKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1RFQVJET1dOKSwgKCB0QU5JX1U4KiApIHBGcm0tPkZUSW5mby5SMEtIX0lELlBNS19SMF9JRCwgcEZybS0+RlRJbmZvLlIwS0hfSUQubnVtX1BNS19SMF9JRCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1RFQVJET1dOKSwgRlJGTCgiSUdUSzpcbiIpKTsKKyAgICAgICAgICAgIGlmICghcEZybS0+RlRJbmZvLklHVEsucHJlc2VudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBGUkFNRVNfTE9HMChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfVERMU1RFQVJET1dOKSwgRlJGTCgiTm90IHByZXNlbnQuXG4iKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNURUFSRE9XTiksICggdEFOSV9VOCogKSZwRnJtLT5GVEluZm8uSUdUSy5rZXlJRCwgMik7CisgICAgICAgICAgICAgICAgRlJBTUVTX0RVTVAocEN0eCwgRlJBTUVTX1NFVl9GT1JfRlJBTUUocEN0eCwgRE9UMTFGX1RETFNURUFSRE9XTiksICggdEFOSV9VOCogKSZwRnJtLT5GVEluZm8uSUdUSy5JUE4sIDYpOworICAgICAgICAgICAgICAgIEZSQU1FU19EVU1QKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9URExTVEVBUkRPV04pLCAoIHRBTklfVTgqICkmcEZybS0+RlRJbmZvLklHVEsua2V5TGVuZ3RoLCAxKTsKKyAgICAgICAgICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkF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IDIpOworICAgICAgICB9CisgICAgICAgIEZSQU1FU19MT0cwKHBDdHgsIEZSQU1FU19TRVZfRk9SX0ZSQU1FKHBDdHgsIERPVDExRl9XTU1ERUxUUyksIEZSRkwoInRvOlxuIikpOworICAgICAgICBGUkFNRVNfRFVNUChwQ3R4LCBGUkFNRVNfU0VWX0ZPUl9GUkFNRShwQ3R4LCBET1QxMUZfV01NREVMVFMpLCBwQnVmLCBuQnVmKTsKKyAgICB9CisjICAgZW5kaWYgLy8gRE9UMTFGX0RVTVBfRlJBTUVTCisgICAgcmV0dXJuIHN0YXR1czsKKworfSAvKiBFbmQgZG90MTFmVW5wYWNrV01NRGVsVFMuICovCisKK3N0YXRpYyB0QU5JX1UzMiBQYWNrQ29yZSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwU3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgKnBuQ29uc3VtZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHRGRkRlZm4gIEZGc1tdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0SUVEZWZuICBJRXNbXSkKK3sKKyAgICBjb25zdCB0RkZEZWZuICpwRmY7CisgICAgY29uc3QgdElFRGVmbiAqcEllOworICAgIHRGUkFNRVNfQk9PTCAgKnBmRm91bmQ7CisgICAgdEFOSV9VOCAgICpwQnVmUmVtYWluaW5nOworICAgIHRBTklfVTE2ICBpOworICAgIHRBTklfVTMyICBuQnVmUmVtYWluaW5nLCBzdGF0dXMsIGxlbjsKKyAgICB0QU5JX1UzMiAgY291bnRPZmZzZXQgPSAwOworCisgICAgKHZvaWQpcEN0eDsgLyogU2h1dHVwIHRoZSBjb21waWxlciBpZiB3ZSBoYXZlIG5vIEZGcyBub3IgSUVzLi4uICovCisgICAgaT0wOworCisgICAgRE9UMTFGX1BBUkFNRVRFUl9DSEVDSzIocFNyYywgcEJ1ZiwgbkJ1ZiwgcG5Db25zdW1lZCk7CisKKyAgICBzdGF0dXMgPSBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKKyAgICBwQnVmUmVtYWluaW5nID0gcEJ1ZjsKKyAgICBuQnVmUmVtYWluaW5nID0gbkJ1ZjsKKworICAgIHBGZiA9ICYoIEZGc1swXSApOworICAgIHdoaWxlICggcEZmLT5zaXplICkKKyAgICB7CisgICAgICAgIGlmICggcEZmLT5zaXplID4gbkJ1ZlJlbWFpbmluZyApCisgICAgICAgIHsKKyAgICAgICAgICAgIEZSQU1FU19MT0czKHBDdHgsIEZSTE9HRSwgRlJGTCgiVGhlIEZpeGVkIEZpZWxkICVzIHJlcSIKKyAgICAgICAgICAgICAgICAidWlyZXMgJWQgYnl0ZXMsIGJ1dCB0aGVyZSBhcmUgb25seSAlZCByZW1haW5pbmcuXG4iKSwKKyAgICAgICAgICAgICAgICBwRmYtPm5hbWUsIHBGZi0+c2l6ZSwgbkJ1ZlJlbWFpbmluZyk7CisgICAgICAgICAgICByZXR1cm4gRE9UMTFGX0JVRkZFUl9PVkVSRkxPVzsKKyAgICAgICAgfQorCisgICAgICAgIHN3aXRjaCAoIHBGZi0+c2lnICkKKyAgICAgICAgeworICAgICAgICAgICAgY2FzZSBTaWdGZkFJRDoKKyAgICAgICAgICAgICAgICBkb3QxMWZQYWNrRmZBSUQocEN0eCwgKHREb3QxMWZGZkFJRCogKShwU3JjICsgcEZmLT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU2lnRmZBY3Rpb246CisgICAgICAgICAgICAgICAgZG90MTFmUGFja0ZmQWN0aW9uKHBDdHgsICh0RG90MTFmRmZBY3Rpb24qICkocFNyYyArIHBGZi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZyk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNpZ0ZmQWRkQkFQYXJhbWV0ZXJTZXQ6CisgICAgICAgICAgICAgICAgZG90MTFmUGFja0ZmQWRkQkFQYXJhbWV0ZXJTZXQocEN0eCwgKHREb3QxMWZGZkFkZEJBUGFyYW1ldGVyU2V0KiApKHBTcmMgKyBwRmYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTaWdGZkF1dGhBbGdvOgorICAgICAgICAgICAgICAgIGRvdDExZlBhY2tGZkF1dGhBbGdvKHBDdHgsICh0RG90MTFmRmZBdXRoQWxnbyogKShwU3JjICsgcEZmLT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU2lnRmZBdXRoU2VxTm86CisgICAgICAgICAgICAgICAgZG90MTFmUGFja0ZmQXV0aFNlcU5vKHBDdHgsICh0RG90MTFmRmZBdXRoU2VxTm8qICkocFNyYyArIHBGZi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZyk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNpZ0ZmQkFTdGFydGluZ1NlcXVlbmNlQ29udHJvbDoKKyAgICAgICAgICAgICAgICBkb3QxMWZQYWNrRmZCQVN0YXJ0aW5nU2VxdWVuY2VDb250cm9sKHBDdHgsICh0RG90MTFmRmZCQVN0YXJ0aW5nU2VxdWVuY2VDb250cm9sKiApKHBTcmMgKyBwRmYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTaWdGZkJBVGltZW91dDoKKyAgICAgICAgICAgICAgICBkb3QxMWZQYWNrRmZCQVRpbWVvdXQocEN0eCwgKHREb3QxMWZGZkJBVGltZW91dCogKShwU3JjICsgcEZmLT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU2lnRmZCZWFjb25JbnRlcnZhbDoKKyAgICAgICAgICAgICAgICBkb3QxMWZQYWNrRmZCZWFjb25JbnRlcnZhbChwQ3R4LCAodERvdDExZkZmQmVhY29uSW50ZXJ2YWwqICkocFNyYyArIHBGZi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZyk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNpZ0ZmQ2FwYWJpbGl0aWVzOgorICAgICAgICAgICAgICAgIGRvdDExZlBhY2tGZkNhcGFiaWxpdGllcyhwQ3R4LCAodERvdDExZkZmQ2FwYWJpbGl0aWVzKiApKHBTcmMgKyBwRmYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTaWdGZkNhdGVnb3J5OgorICAgICAgICAgICAgICAgIGRvdDExZlBhY2tGZkNhdGVnb3J5KHBDdHgsICh0RG90MTFmRmZDYXRlZ29yeSogKShwU3JjICsgcEZmLT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU2lnRmZDdXJyZW50QVBBZGRyZXNzOgorICAgICAgICAgICAgICAgIGRvdDExZlBhY2tGZkN1cnJlbnRBUEFkZHJlc3MocEN0eCwgKHREb3QxMWZGZkN1cnJlbnRBUEFkZHJlc3MqICkocFNyYyArIHBGZi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZyk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNpZ0ZmRGVsQkFQYXJhbWV0ZXJTZXQ6CisgICAgICAgICAgICAgICAgZG90MTFmUGFja0ZmRGVsQkFQYXJhbWV0ZXJTZXQocEN0eCwgKHREb3QxMWZGZkRlbEJBUGFyYW1ldGVyU2V0KiApKHBTcmMgKyBwRmYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTaWdGZkRpYWxvZ1Rva2VuOgorICAgICAgICAgICAgICAgIGRvdDExZlBhY2tGZkRpYWxvZ1Rva2VuKHBDdHgsICh0RG90MTFmRmZEaWFsb2dUb2tlbiogKShwU3JjICsgcEZmLT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU2lnRmZMaW5rTWFyZ2luOgorICAgICAgICAgICAgICAgIGRvdDExZlBhY2tGZkxpbmtNYXJnaW4ocEN0eCwgKHREb3QxMWZGZkxpbmtNYXJnaW4qICkocFNyYyArIHBGZi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZyk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNpZ0ZmTGlzdGVuSW50ZXJ2YWw6CisgICAgICAgICAgICAgICAgZG90MTFmUGFja0ZmTGlzdGVuSW50ZXJ2YWwocEN0eCwgKHREb3QxMWZGZkxpc3RlbkludGVydmFsKiApKHBTcmMgKyBwRmYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTaWdGZk1heFR4UG93ZXI6CisgICAgICAgICAgICAgICAgZG90MTFmUGFja0ZmTWF4VHhQb3dlcihwQ3R4LCAodERvdDExZkZmTWF4VHhQb3dlciogKShwU3JjICsgcEZmLT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU2lnRmZOdW1PZlJlcGV0aXRpb25zOgorICAgICAgICAgICAgICAgIGRvdDExZlBhY2tGZk51bU9mUmVwZXRpdGlvbnMocEN0eCwgKHREb3QxMWZGZk51bU9mUmVwZXRpdGlvbnMqICkocFNyYyArIHBGZi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZyk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNpZ0ZmT3BlcmF0aW5nTW9kZToKKyAgICAgICAgICAgICAgICBkb3QxMWZQYWNrRmZPcGVyYXRpbmdNb2RlKHBDdHgsICh0RG90MTFmRmZPcGVyYXRpbmdNb2RlKiApKHBTcmMgKyBwRmYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTaWdGZlAyUE9VSToKKyAgICAgICAgICAgICAgICBkb3QxMWZQYWNrRmZQMlBPVUkocEN0eCwgKHREb3QxMWZGZlAyUE9VSSogKShwU3JjICsgcEZmLT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU2lnRmZQMlBPVUlTdWJUeXBlOgorICAgICAgICAgICAgICAgIGRvdDExZlBhY2tGZlAyUE9VSVN1YlR5cGUocEN0eCwgKHREb3QxMWZGZlAyUE9VSVN1YlR5cGUqICkocFNyYyArIHBGZi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZyk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNpZ0ZmUkNQSToKKyAgICAgICAgICAgICAgICBkb3QxMWZQYWNrRmZSQ1BJKHBDdHgsICh0RG90MTFmRmZSQ1BJKiApKHBTcmMgKyBwRmYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTaWdGZlJTTkk6CisgICAgICAgICAgICAgICAgZG90MTFmUGFja0ZmUlNOSShwQ3R4LCAodERvdDExZkZmUlNOSSogKShwU3JjICsgcEZmLT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU2lnRmZSZWFzb246CisgICAgICAgICAgICAgICAgZG90MTFmUGFja0ZmUmVhc29uKHBDdHgsICh0RG90MTFmRmZSZWFzb24qICkocFNyYyArIHBGZi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZyk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNpZ0ZmUnhBbnRlbm5hSWQ6CisgICAgICAgICAgICAgICAgZG90MTFmUGFja0ZmUnhBbnRlbm5hSWQocEN0eCwgKHREb3QxMWZGZlJ4QW50ZW5uYUlkKiApKHBTcmMgKyBwRmYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTaWdGZlNNUG93ZXJNb2RlU2V0OgorICAgICAgICAgICAgICAgIGRvdDExZlBhY2tGZlNNUG93ZXJNb2RlU2V0KHBDdHgsICh0RG90MTFmRmZTTVBvd2VyTW9kZVNldCogKShwU3JjICsgcEZmLT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU2lnRmZTdGF0dXM6CisgICAgICAgICAgICAgICAgZG90MTFmUGFja0ZmU3RhdHVzKHBDdHgsICh0RG90MTFmRmZTdGF0dXMqICkocFNyYyArIHBGZi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZyk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNpZ0ZmU3RhdHVzQ29kZToKKyAgICAgICAgICAgICAgICBkb3QxMWZQYWNrRmZTdGF0dXNDb2RlKHBDdHgsICh0RG90MTFmRmZTdGF0dXNDb2RlKiApKHBTcmMgKyBwRmYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTaWdGZlRQQ0VsZUlEOgorICAgICAgICAgICAgICAgIGRvdDExZlBhY2tGZlRQQ0VsZUlEKHBDdHgsICh0RG90MTFmRmZUUENFbGVJRCogKShwU3JjICsgcEZmLT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU2lnRmZUUENFbGVMZW46CisgICAgICAgICAgICAgICAgZG90MTFmUGFja0ZmVFBDRWxlTGVuKHBDdHgsICh0RG90MTFmRmZUUENFbGVMZW4qICkocFNyYyArIHBGZi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZyk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNpZ0ZmVFNJbmZvOgorICAgICAgICAgICAgICAgIGRvdDExZlBhY2tGZlRTSW5mbyhwQ3R4LCAodERvdDExZkZmVFNJbmZvKiApKHBTcmMgKyBwRmYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTaWdGZlRpbWVTdGFtcDoKKyAgICAgICAgICAgICAgICBkb3QxMWZQYWNrRmZUaW1lU3RhbXAocEN0eCwgKHREb3QxMWZGZlRpbWVTdGFtcCogKShwU3JjICsgcEZmLT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU2lnRmZUcmFuc2FjdGlvbklkOgorICAgICAgICAgICAgICAgIGRvdDExZlBhY2tGZlRyYW5zYWN0aW9uSWQocEN0eCwgKHREb3QxMWZGZlRyYW5zYWN0aW9uSWQqICkocFNyYyArIHBGZi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZyk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNpZ0ZmVHhBbnRlbm5hSWQ6CisgICAgICAgICAgICAgICAgZG90MTFmUGFja0ZmVHhBbnRlbm5hSWQocEN0eCwgKHREb3QxMWZGZlR4QW50ZW5uYUlkKiApKHBTcmMgKyBwRmYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTaWdGZlR4UG93ZXI6CisgICAgICAgICAgICAgICAgZG90MTFmUGFja0ZmVHhQb3dlcihwQ3R4LCAodERvdDExZkZmVHhQb3dlciogKShwU3JjICsgcEZmLT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU2lnRmZWaHRNZW1iZXJzaGlwU3RhdHVzQXJyYXk6CisgICAgICAgICAgICAgICAgZG90MTFmUGFja0ZmVmh0TWVtYmVyc2hpcFN0YXR1c0FycmF5KHBDdHgsICh0RG90MTFmRmZWaHRNZW1iZXJzaGlwU3RhdHVzQXJyYXkqICkocFNyYyArIHBGZi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZyk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNpZ0ZmVmh0VXNlclBvc2l0aW9uQXJyYXk6CisgICAgICAgICAgICAgICAgZG90MTFmUGFja0ZmVmh0VXNlclBvc2l0aW9uQXJyYXkocEN0eCwgKHREb3QxMWZGZlZodFVzZXJQb3NpdGlvbkFycmF5KiApKHBTcmMgKyBwRmYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJMT0dFLCBGUkZMKCJJTlRFUk5BTCBFUlJPUi0tIEkgZG9uIgorICAgICAgICAgICAgICAgICIndCBrbm93IGFib3V0IHRoZSBGaXhlZCBGaWVsZCAlZDsgdGhpcyBpcyBtb3N0IGwiCisgICAgICAgICAgICAgICAgImlrZWx5IGEgYnVnIGluICdmcmFtZXNnJy5cbiIpLCBwRmYtPnNpZyk7CisgICAgICAgICAgICByZXR1cm4gRE9UMTFGX0lOVEVSTkFMX0VSUk9SOworICAgICAgICB9CisKKyAgICAgICAgcEJ1ZlJlbWFpbmluZyArPSBwRmYtPnNpemU7CisgICAgICAgIG5CdWZSZW1haW5pbmcgLT0gcEZmLT5zaXplOworICAgICAgICAqcG5Db25zdW1lZCAgICs9IHBGZi0+c2l6ZTsKKyAgICAgICAgKytwRmY7CisKKyAgICB9CisKKyAgICBwSWUgPSAmKCBJRXNbMF0gKTsKKyAgICB3aGlsZSAoIDB4ZmYgIT0gcEllLT5laWQgKQorICAgIHsKKyAgICAgICAgcGZGb3VuZCA9ICh0RlJBTUVTX0JPT0wqKShwU3JjICsgcEllLT5vZmZzZXQgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJZS0+cHJlc2VuY2VPZmZzZXQpOworICAgICAgICBpZiAoICpwZkZvdW5kICYmIHBJZS0+bWluU2l6ZSA+IG5CdWZSZW1haW5pbmcgKQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMyhwQ3R4LCBGUkxPR0UsIEZSRkwoIlRoZSBJRSAlcyB0YWtlcyBhdCBsZSIKKyAgICAgICAgICAgICAgICAiYXN0ICVkIGJ5dGVzLCBidXQgdGhlcmUgYXJlIG9ubHkgJWQgbGVmdCBpbiB0aGUgYiIKKyAgICAgICAgICAgICAgICAidWZmZXIuXG4iKSwgcEllLT5uYW1lLCBwSWUtPm1pblNpemUsIG5CdWZSZW1haW5pbmcpOworICAgICAgICAgICAgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgIH0KKworCisgICAgICAgIGNvdW50T2Zmc2V0ID0gKCAoMCA9PSBwSWUtPmFycmF5Ym91bmQpID8gIDE6ICoodEFOSV9VMTYqICkocFNyYyArIHBJZS0+Y291bnRPZmZzZXQpICk7CisgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBjb3VudE9mZnNldDsgKytpKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBsZW4gPSAwVTsKKyAgICAgICAgICAgICAgIHN3aXRjaCAoIHBJZS0+c2lnICkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUFQTmFtZToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVBUE5hbWUocEN0eCwgKCB0RG90MTFmSUVBUE5hbWUqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUFQTmFtZSkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llQlBJbmRpY2F0b3I6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llQlBJbmRpY2F0b3IocEN0eCwgKCB0RG90MTFmSUVCUEluZGljYXRvciogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFQlBJbmRpY2F0b3IpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUNvbmRlbnNlZENvdW50cnlTdHI6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llQ29uZGVuc2VkQ291bnRyeVN0cihwQ3R4LCAoIHREb3QxMWZJRUNvbmRlbnNlZENvdW50cnlTdHIqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUNvbmRlbnNlZENvdW50cnlTdHIpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUdUSzoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVHVEsocEN0eCwgKCB0RG90MTFmSUVHVEsqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUdUSykgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llSENGOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZUhDRihwQ3R4LCAoIHREb3QxMWZJRUhDRiogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFSENGKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVJR1RLOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZUlHVEsocEN0eCwgKCB0RG90MTFmSUVJR1RLKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVJR1RLKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVMTEF0dHI6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llTExBdHRyKHBDdHgsICggdERvdDExZklFTExBdHRyKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVMTEF0dHIpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUxvYWRCYWxhbmNlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZUxvYWRCYWxhbmNlKHBDdHgsICggdERvdDExZklFTG9hZEJhbGFuY2UqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUxvYWRCYWxhbmNlKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVMb2FkSW5mbzoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVMb2FkSW5mbyhwQ3R4LCAoIHREb3QxMWZJRUxvYWRJbmZvKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVMb2FkSW5mbykgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUHJvcEFzc29jVHlwZToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVQcm9wQXNzb2NUeXBlKHBDdHgsICggdERvdDExZklFUHJvcEFzc29jVHlwZSogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUHJvcEFzc29jVHlwZSkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUHJvcENhcGFiaWxpdHk6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llUHJvcENhcGFiaWxpdHkocEN0eCwgKCB0RG90MTFmSUVQcm9wQ2FwYWJpbGl0eSogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUHJvcENhcGFiaWxpdHkpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVByb3BDaGFublN3aXRjaEFubjoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVQcm9wQ2hhbm5Td2l0Y2hBbm4ocEN0eCwgKCB0RG90MTFmSUVQcm9wQ2hhbm5Td2l0Y2hBbm4qICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVByb3BDaGFublN3aXRjaEFubikgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUHJvcEVEQ0FQYXJhbXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llUHJvcEVEQ0FQYXJhbXMocEN0eCwgKCB0RG90MTFmSUVQcm9wRURDQVBhcmFtcyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUHJvcEVEQ0FQYXJhbXMpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVByb3BRdWlldEJTUzoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVQcm9wUXVpZXRCU1MocEN0eCwgKCB0RG90MTFmSUVQcm9wUXVpZXRCU1MqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVByb3BRdWlldEJTUykgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUHJvcFN1cHBSYXRlczoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVQcm9wU3VwcFJhdGVzKHBDdHgsICggdERvdDExZklFUHJvcFN1cHBSYXRlcyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUHJvcFN1cHBSYXRlcykgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUjBLSF9JRDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVSMEtIX0lEKHBDdHgsICggdERvdDExZklFUjBLSF9JRCogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUjBLSF9JRCkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUjFLSF9JRDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVSMUtIX0lEKHBDdHgsICggdERvdDExZklFUjFLSF9JRCogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUjFLSF9JRCkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llVFNGSW5mbzoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVUU0ZJbmZvKHBDdHgsICggdERvdDExZklFVFNGSW5mbyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFVFNGSW5mbykgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llVGF1cnVzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVRhdXJ1cyhwQ3R4LCAoIHREb3QxMWZJRVRhdXJ1cyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFVGF1cnVzKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVUaXRhbjoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVUaXRhbihwQ3R4LCAoIHREb3QxMWZJRVRpdGFuKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVUaXRhbikgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llVHJpZ2dlclN0YUJnU2NhbjoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVUcmlnZ2VyU3RhQmdTY2FuKHBDdHgsICggdERvdDExZklFVHJpZ2dlclN0YUJnU2NhbiogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFVHJpZ2dlclN0YUJnU2NhbikgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llVmVyc2lvbjoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVWZXJzaW9uKHBDdHgsICggdERvdDExZklFVmVyc2lvbiogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFVmVyc2lvbikgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV0RTOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVdEUyhwQ3R4LCAoIHREb3QxMWZJRVdEUyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFV0RTKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVBUENoYW5uZWxSZXBvcnQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llQVBDaGFubmVsUmVwb3J0KHBDdHgsICggdERvdDExZklFQVBDaGFubmVsUmVwb3J0KiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVBUENoYW5uZWxSZXBvcnQpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUJjblJlcG9ydGluZ0RldGFpbDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVCY25SZXBvcnRpbmdEZXRhaWwocEN0eCwgKCB0RG90MTFmSUVCY25SZXBvcnRpbmdEZXRhaWwqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUJjblJlcG9ydGluZ0RldGFpbCkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llQmVhY29uUmVwb3J0RnJtQm9keToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVCZWFjb25SZXBvcnRGcm1Cb2R5KHBDdHgsICggdERvdDExZklFQmVhY29uUmVwb3J0RnJtQm9keSogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFQmVhY29uUmVwb3J0RnJtQm9keSkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llQmVhY29uUmVwb3J0aW5nOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZUJlYWNvblJlcG9ydGluZyhwQ3R4LCAoIHREb3QxMWZJRUJlYWNvblJlcG9ydGluZyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFQmVhY29uUmVwb3J0aW5nKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVNZWFzdXJlbWVudFBpbG90OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZU1lYXN1cmVtZW50UGlsb3QocEN0eCwgKCB0RG90MTFmSUVNZWFzdXJlbWVudFBpbG90KiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVNZWFzdXJlbWVudFBpbG90KSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVNdWx0aUJzc2lkOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZU11bHRpQnNzaWQocEN0eCwgKCB0RG90MTFmSUVNdWx0aUJzc2lkKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVNdWx0aUJzc2lkKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVSSUNEYXRhOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVJJQ0RhdGEocEN0eCwgKCB0RG90MTFmSUVSSUNEYXRhKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVSSUNEYXRhKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVSSUNEZXNjcmlwdG9yOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVJJQ0Rlc2NyaXB0b3IocEN0eCwgKCB0RG90MTFmSUVSSUNEZXNjcmlwdG9yKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVSSUNEZXNjcmlwdG9yKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVSUk1FbmFibGVkQ2FwOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVJSTUVuYWJsZWRDYXAocEN0eCwgKCB0RG90MTFmSUVSUk1FbmFibGVkQ2FwKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVSUk1FbmFibGVkQ2FwKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVSZXF1ZXN0ZWRJbmZvOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVJlcXVlc3RlZEluZm8ocEN0eCwgKCB0RG90MTFmSUVSZXF1ZXN0ZWRJbmZvKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVSZXF1ZXN0ZWRJbmZvKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVTU0lEOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVNTSUQocEN0eCwgKCB0RG90MTFmSUVTU0lEKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVTU0lEKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVTY2hlZHVsZToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVTY2hlZHVsZShwQ3R4LCAoIHREb3QxMWZJRVNjaGVkdWxlKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVTY2hlZHVsZSkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llVENMQVM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llVENMQVMocEN0eCwgKCB0RG90MTFmSUVUQ0xBUyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFVENMQVMpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVRDTEFTU1BST0M6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llVENMQVNTUFJPQyhwQ3R4LCAoIHREb3QxMWZJRVRDTEFTU1BST0MqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVRDTEFTU1BST0MpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVRTRGVsYXk6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llVFNEZWxheShwQ3R4LCAoIHREb3QxMWZJRVRTRGVsYXkqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVRTRGVsYXkpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVRTUEVDOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVRTUEVDKHBDdHgsICggdERvdDExZklFVFNQRUMqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVRTUEVDKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXTU1TY2hlZHVsZToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVXTU1TY2hlZHVsZShwQ3R4LCAoIHREb3QxMWZJRVdNTVNjaGVkdWxlKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVXTU1TY2hlZHVsZSkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV01NVENMQVM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llV01NVENMQVMocEN0eCwgKCB0RG90MTFmSUVXTU1UQ0xBUyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFV01NVENMQVMpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdNTVRDTEFTUFJPQzoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVXTU1UQ0xBU1BST0MocEN0eCwgKCB0RG90MTFmSUVXTU1UQ0xBU1BST0MqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVdNTVRDTEFTUFJPQykgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV01NVFNEZWxheToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVXTU1UU0RlbGF5KHBDdHgsICggdERvdDExZklFV01NVFNEZWxheSogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFV01NVFNEZWxheSkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV01NVFNQRUM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llV01NVFNQRUMocEN0eCwgKCB0RG90MTFmSUVXTU1UU1BFQyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFV01NVFNQRUMpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUFJRDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVBSUQocEN0eCwgKCB0RG90MTFmSUVBSUQqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUFJRCkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llQWlyZ286CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llQWlyZ28ocEN0eCwgKCB0RG90MTFmSUVBaXJnbyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFQWlyZ28pICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUNGUGFyYW1zOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZUNGUGFyYW1zKHBDdHgsICggdERvdDExZklFQ0ZQYXJhbXMqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUNGUGFyYW1zKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVDaGFsbGVuZ2VUZXh0OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZUNoYWxsZW5nZVRleHQocEN0eCwgKCB0RG90MTFmSUVDaGFsbGVuZ2VUZXh0KiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVDaGFsbGVuZ2VUZXh0KSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVDaGFuU3dpdGNoQW5uOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZUNoYW5Td2l0Y2hBbm4ocEN0eCwgKCB0RG90MTFmSUVDaGFuU3dpdGNoQW5uKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVDaGFuU3dpdGNoQW5uKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVDb3VudHJ5OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZUNvdW50cnkocEN0eCwgKCB0RG90MTFmSUVDb3VudHJ5KiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVDb3VudHJ5KSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVEU1BhcmFtczoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVEU1BhcmFtcyhwQ3R4LCAoIHREb3QxMWZJRURTUGFyYW1zKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVEU1BhcmFtcykgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llRURDQVBhcmFtU2V0OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZUVEQ0FQYXJhbVNldChwQ3R4LCAoIHREb3QxMWZJRUVEQ0FQYXJhbVNldCogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFRURDQVBhcmFtU2V0KSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVFUlBJbmZvOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZUVSUEluZm8ocEN0eCwgKCB0RG90MTFmSUVFUlBJbmZvKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVFUlBJbmZvKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVFU0VDY2ttT3BhcXVlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZUVTRUNja21PcGFxdWUocEN0eCwgKCB0RG90MTFmSUVFU0VDY2ttT3BhcXVlKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVFU0VDY2ttT3BhcXVlKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVFU0VSYWRNZ210Q2FwOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZUVTRVJhZE1nbXRDYXAocEN0eCwgKCB0RG90MTFmSUVFU0VSYWRNZ210Q2FwKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVFU0VSYWRNZ210Q2FwKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVFU0VUcmFmU3RybU1ldDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVFU0VUcmFmU3RybU1ldChwQ3R4LCAoIHREb3QxMWZJRUVTRVRyYWZTdHJtTWV0KiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVFU0VUcmFmU3RybU1ldCkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llRVNFVHJhZlN0cm1SYXRlU2V0OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZUVTRVRyYWZTdHJtUmF0ZVNldChwQ3R4LCAoIHREb3QxMWZJRUVTRVRyYWZTdHJtUmF0ZVNldCogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFRVNFVHJhZlN0cm1SYXRlU2V0KSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVFU0VUeG1pdFBvd2VyOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZUVTRVR4bWl0UG93ZXIocEN0eCwgKCB0RG90MTFmSUVFU0VUeG1pdFBvd2VyKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVFU0VUeG1pdFBvd2VyKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVFU0VWZXJzaW9uOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZUVTRVZlcnNpb24ocEN0eCwgKCB0RG90MTFmSUVFU0VWZXJzaW9uKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVFU0VWZXJzaW9uKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVFeHRDYXA6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llRXh0Q2FwKHBDdHgsICggdERvdDExZklFRXh0Q2FwKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVFeHRDYXApICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUV4dENoYW5Td2l0Y2hBbm46CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llRXh0Q2hhblN3aXRjaEFubihwQ3R4LCAoIHREb3QxMWZJRUV4dENoYW5Td2l0Y2hBbm4qICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUV4dENoYW5Td2l0Y2hBbm4pICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUV4dFN1cHBSYXRlczoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVFeHRTdXBwUmF0ZXMocEN0eCwgKCB0RG90MTFmSUVFeHRTdXBwUmF0ZXMqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUV4dFN1cHBSYXRlcykgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llRkhQYXJhbVNldDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVGSFBhcmFtU2V0KHBDdHgsICggdERvdDExZklFRkhQYXJhbVNldCogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFRkhQYXJhbVNldCkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llRkhQYXJhbXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llRkhQYXJhbXMocEN0eCwgKCB0RG90MTFmSUVGSFBhcmFtcyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFRkhQYXJhbXMpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUZIUGF0dFRhYmxlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZUZIUGF0dFRhYmxlKHBDdHgsICggdERvdDExZklFRkhQYXR0VGFibGUqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUZIUGF0dFRhYmxlKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVGVEluZm86CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llRlRJbmZvKHBDdHgsICggdERvdDExZklFRlRJbmZvKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVGVEluZm8pICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUhUMjA0MEJTU0NvZXhpc3RlbmNlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZUhUMjA0MEJTU0NvZXhpc3RlbmNlKHBDdHgsICggdERvdDExZklFSFQyMDQwQlNTQ29leGlzdGVuY2UqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUhUMjA0MEJTU0NvZXhpc3RlbmNlKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVIVDIwNDBCU1NJbnRvbGVyYW50UmVwb3J0OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZUhUMjA0MEJTU0ludG9sZXJhbnRSZXBvcnQocEN0eCwgKCB0RG90MTFmSUVIVDIwNDBCU1NJbnRvbGVyYW50UmVwb3J0KiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVIVDIwNDBCU1NJbnRvbGVyYW50UmVwb3J0KSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVIVENhcHM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llSFRDYXBzKHBDdHgsICggdERvdDExZklFSFRDYXBzKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVIVENhcHMpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZUhUSW5mbzoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVIVEluZm8ocEN0eCwgKCB0RG90MTFmSUVIVEluZm8qICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRUhUSW5mbykgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llSUJTU1BhcmFtczoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVJQlNTUGFyYW1zKHBDdHgsICggdERvdDExZklFSUJTU1BhcmFtcyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFSUJTU1BhcmFtcykgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llTGlua0lkZW50aWZpZXI6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llTGlua0lkZW50aWZpZXIocEN0eCwgKCB0RG90MTFmSUVMaW5rSWRlbnRpZmllciogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFTGlua0lkZW50aWZpZXIpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZU1lYXN1cmVtZW50UmVwb3J0OgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZU1lYXN1cmVtZW50UmVwb3J0KHBDdHgsICggdERvdDExZklFTWVhc3VyZW1lbnRSZXBvcnQqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRU1lYXN1cmVtZW50UmVwb3J0KSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVNZWFzdXJlbWVudFJlcXVlc3Q6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llTWVhc3VyZW1lbnRSZXF1ZXN0KHBDdHgsICggdERvdDExZklFTWVhc3VyZW1lbnRSZXF1ZXN0KiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVNZWFzdXJlbWVudFJlcXVlc3QpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZU1vYmlsaXR5RG9tYWluOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZU1vYmlsaXR5RG9tYWluKHBDdHgsICggdERvdDExZklFTW9iaWxpdHlEb21haW4qICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRU1vYmlsaXR5RG9tYWluKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVOZWlnaGJvclJlcG9ydDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVOZWlnaGJvclJlcG9ydChwQ3R4LCAoIHREb3QxMWZJRU5laWdoYm9yUmVwb3J0KiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVOZWlnaGJvclJlcG9ydCkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llT0JTU1NjYW5QYXJhbWV0ZXJzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZU9CU1NTY2FuUGFyYW1ldGVycyhwQ3R4LCAoIHREb3QxMWZJRU9CU1NTY2FuUGFyYW1ldGVycyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFT0JTU1NjYW5QYXJhbWV0ZXJzKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVPcGVyYXRpbmdNb2RlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZU9wZXJhdGluZ01vZGUocEN0eCwgKCB0RG90MTFmSUVPcGVyYXRpbmdNb2RlKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVPcGVyYXRpbmdNb2RlKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVQMlBBc3NvY1JlcToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVQMlBBc3NvY1JlcShwQ3R4LCAoIHREb3QxMWZJRVAyUEFzc29jUmVxKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVQMlBBc3NvY1JlcSkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQQXNzb2NSZXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llUDJQQXNzb2NSZXMocEN0eCwgKCB0RG90MTFmSUVQMlBBc3NvY1JlcyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUDJQQXNzb2NSZXMpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUEJlYWNvbjoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVQMlBCZWFjb24ocEN0eCwgKCB0RG90MTFmSUVQMlBCZWFjb24qICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVAyUEJlYWNvbikgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQQmVhY29uUHJvYmVSZXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llUDJQQmVhY29uUHJvYmVSZXMocEN0eCwgKCB0RG90MTFmSUVQMlBCZWFjb25Qcm9iZVJlcyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUDJQQmVhY29uUHJvYmVSZXMpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUERlQXV0aDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVQMlBEZUF1dGgocEN0eCwgKCB0RG90MTFmSUVQMlBEZUF1dGgqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVAyUERlQXV0aCkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQRGV2aWNlRGlzY292ZXJhYmlsaXR5UmVxOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVAyUERldmljZURpc2NvdmVyYWJpbGl0eVJlcShwQ3R4LCAoIHREb3QxMWZJRVAyUERldmljZURpc2NvdmVyYWJpbGl0eVJlcSogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUDJQRGV2aWNlRGlzY292ZXJhYmlsaXR5UmVxKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVQMlBEZXZpY2VEaXNjb3ZlcmFiaWxpdHlSZXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llUDJQRGV2aWNlRGlzY292ZXJhYmlsaXR5UmVzKHBDdHgsICggdERvdDExZklFUDJQRGV2aWNlRGlzY292ZXJhYmlsaXR5UmVzKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVQMlBEZXZpY2VEaXNjb3ZlcmFiaWxpdHlSZXMpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUERpc0Fzc29jOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVAyUERpc0Fzc29jKHBDdHgsICggdERvdDExZklFUDJQRGlzQXNzb2MqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVAyUERpc0Fzc29jKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVQMlBHT05lZ0NuZjoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVQMlBHT05lZ0NuZihwQ3R4LCAoIHREb3QxMWZJRVAyUEdPTmVnQ25mKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVQMlBHT05lZ0NuZikgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQR09OZWdSZXE6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llUDJQR09OZWdSZXEocEN0eCwgKCB0RG90MTFmSUVQMlBHT05lZ1JlcSogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUDJQR09OZWdSZXEpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUEdPTmVnUmVzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVAyUEdPTmVnUmVzKHBDdHgsICggdERvdDExZklFUDJQR09OZWdSZXMqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVAyUEdPTmVnUmVzKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVQMlBHT05lZ1dQUzoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVQMlBHT05lZ1dQUyhwQ3R4LCAoIHREb3QxMWZJRVAyUEdPTmVnV1BTKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVQMlBHT05lZ1dQUykgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQSUVPcGFxdWU6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llUDJQSUVPcGFxdWUocEN0eCwgKCB0RG90MTFmSUVQMlBJRU9wYXF1ZSogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUDJQSUVPcGFxdWUpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUEludml0YXRpb25SZXE6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llUDJQSW52aXRhdGlvblJlcShwQ3R4LCAoIHREb3QxMWZJRVAyUEludml0YXRpb25SZXEqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVAyUEludml0YXRpb25SZXEpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUEludml0YXRpb25SZXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llUDJQSW52aXRhdGlvblJlcyhwQ3R4LCAoIHREb3QxMWZJRVAyUEludml0YXRpb25SZXMqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVAyUEludml0YXRpb25SZXMpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUE5vdGljZU9mQWJzZW5jZToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVQMlBOb3RpY2VPZkFic2VuY2UocEN0eCwgKCB0RG90MTFmSUVQMlBOb3RpY2VPZkFic2VuY2UqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVAyUE5vdGljZU9mQWJzZW5jZSkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQUHJlc2VuY2VSZXNwb25zZToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVQMlBQcmVzZW5jZVJlc3BvbnNlKHBDdHgsICggdERvdDExZklFUDJQUHJlc2VuY2VSZXNwb25zZSogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUDJQUHJlc2VuY2VSZXNwb25zZSkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUDJQUHJvYmVSZXE6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llUDJQUHJvYmVSZXEocEN0eCwgKCB0RG90MTFmSUVQMlBQcm9iZVJlcSogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUDJQUHJvYmVSZXEpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUFByb2JlUmVzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVAyUFByb2JlUmVzKHBDdHgsICggdERvdDExZklFUDJQUHJvYmVSZXMqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVAyUFByb2JlUmVzKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVQMlBQcm92aXNpb25EaXNjb3ZlcnlSZXE6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llUDJQUHJvdmlzaW9uRGlzY292ZXJ5UmVxKHBDdHgsICggdERvdDExZklFUDJQUHJvdmlzaW9uRGlzY292ZXJ5UmVxKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVQMlBQcm92aXNpb25EaXNjb3ZlcnlSZXEpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVAyUFdTQ1Byb3Zpc2lvbkRpc2NvdmVyeVJlczoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVQMlBXU0NQcm92aXNpb25EaXNjb3ZlcnlSZXMocEN0eCwgKCB0RG90MTFmSUVQMlBXU0NQcm92aXNpb25EaXNjb3ZlcnlSZXMqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVAyUFdTQ1Byb3Zpc2lvbkRpc2NvdmVyeVJlcykgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUFRJQ29udHJvbDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVQVElDb250cm9sKHBDdHgsICggdERvdDExZklFUFRJQ29udHJvbCogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUFRJQ29udHJvbCkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUFVCdWZmZXJTdGF0dXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llUFVCdWZmZXJTdGF0dXMocEN0eCwgKCB0RG90MTFmSUVQVUJ1ZmZlclN0YXR1cyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUFVCdWZmZXJTdGF0dXMpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVBvd2VyQ2FwczoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVQb3dlckNhcHMocEN0eCwgKCB0RG90MTFmSUVQb3dlckNhcHMqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVBvd2VyQ2FwcykgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUG93ZXJDb25zdHJhaW50czoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVQb3dlckNvbnN0cmFpbnRzKHBDdHgsICggdERvdDExZklFUG93ZXJDb25zdHJhaW50cyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUG93ZXJDb25zdHJhaW50cykgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUUJTU0xvYWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llUUJTU0xvYWQocEN0eCwgKCB0RG90MTFmSUVRQlNTTG9hZCogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUUJTU0xvYWQpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVFPU0NhcHNBcDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVRT1NDYXBzQXAocEN0eCwgKCB0RG90MTFmSUVRT1NDYXBzQXAqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVFPU0NhcHNBcCkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUU9TQ2Fwc1N0YXRpb246CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llUU9TQ2Fwc1N0YXRpb24ocEN0eCwgKCB0RG90MTFmSUVRT1NDYXBzU3RhdGlvbiogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUU9TQ2Fwc1N0YXRpb24pICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVFvc01hcFNldDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVRb3NNYXBTZXQocEN0eCwgKCB0RG90MTFmSUVRb3NNYXBTZXQqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVFvc01hcFNldCkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUXVpZXQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llUXVpZXQocEN0eCwgKCB0RG90MTFmSUVRdWlldCogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUXVpZXQpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVJDUElJRToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVSQ1BJSUUocEN0eCwgKCB0RG90MTFmSUVSQ1BJSUUqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVJDUElJRSkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUklDRGF0YURlc2M6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llUklDRGF0YURlc2MocEN0eCwgKCB0RG90MTFmSUVSSUNEYXRhRGVzYyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUklDRGF0YURlc2MpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVJTTjoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVSU04ocEN0eCwgKCB0RG90MTFmSUVSU04qICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVJTTikgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llUlNOSUlFOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVJTTklJRShwQ3R4LCAoIHREb3QxMWZJRVJTTklJRSogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFUlNOSUlFKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVSU05PcGFxdWU6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llUlNOT3BhcXVlKHBDdHgsICggdERvdDExZklFUlNOT3BhcXVlKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVSU05PcGFxdWUpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVN1cHBDaGFubmVsczoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVTdXBwQ2hhbm5lbHMocEN0eCwgKCB0RG90MTFmSUVTdXBwQ2hhbm5lbHMqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVN1cHBDaGFubmVscykgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llU3VwcE9wZXJhdGluZ0NsYXNzZXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llU3VwcE9wZXJhdGluZ0NsYXNzZXMocEN0eCwgKCB0RG90MTFmSUVTdXBwT3BlcmF0aW5nQ2xhc3NlcyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFU3VwcE9wZXJhdGluZ0NsYXNzZXMpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVN1cHBSYXRlczoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVTdXBwUmF0ZXMocEN0eCwgKCB0RG90MTFmSUVTdXBwUmF0ZXMqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVN1cHBSYXRlcykgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llVElNOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVRJTShwQ3R4LCAoIHREb3QxMWZJRVRJTSogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFVElNKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVUUENSZXBvcnQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llVFBDUmVwb3J0KHBDdHgsICggdERvdDExZklFVFBDUmVwb3J0KiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVUUENSZXBvcnQpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVRQQ1JlcXVlc3Q6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llVFBDUmVxdWVzdChwQ3R4LCAoIHREb3QxMWZJRVRQQ1JlcXVlc3QqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVRQQ1JlcXVlc3QpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVRpbWVvdXRJbnRlcnZhbDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVUaW1lb3V0SW50ZXJ2YWwocEN0eCwgKCB0RG90MTFmSUVUaW1lb3V0SW50ZXJ2YWwqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVRpbWVvdXRJbnRlcnZhbCkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llVkhUQ2FwczoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVWSFRDYXBzKHBDdHgsICggdERvdDExZklFVkhUQ2FwcyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFVkhUQ2FwcykgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llVkhURXh0QnNzTG9hZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVWSFRFeHRCc3NMb2FkKHBDdHgsICggdERvdDExZklFVkhURXh0QnNzTG9hZCogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFVkhURXh0QnNzTG9hZCkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llVkhUT3BlcmF0aW9uOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVZIVE9wZXJhdGlvbihwQ3R4LCAoIHREb3QxMWZJRVZIVE9wZXJhdGlvbiogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFVkhUT3BlcmF0aW9uKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXQVBJOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVdBUEkocEN0eCwgKCB0RG90MTFmSUVXQVBJKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVXQVBJKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXQVBJT3BhcXVlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVdBUElPcGFxdWUocEN0eCwgKCB0RG90MTFmSUVXQVBJT3BhcXVlKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVXQVBJT3BhcXVlKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXRkFUUEM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llV0ZBVFBDKHBDdHgsICggdERvdDExZklFV0ZBVFBDKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVXRkFUUEMpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdGRElFT3BhcXVlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVdGRElFT3BhcXVlKHBDdHgsICggdERvdDExZklFV0ZESUVPcGFxdWUqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVdGRElFT3BhcXVlKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXTU1DYXBzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVdNTUNhcHMocEN0eCwgKCB0RG90MTFmSUVXTU1DYXBzKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVXTU1DYXBzKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXTU1JbmZvQXA6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llV01NSW5mb0FwKHBDdHgsICggdERvdDExZklFV01NSW5mb0FwKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVXTU1JbmZvQXApICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdNTUluZm9TdGF0aW9uOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVdNTUluZm9TdGF0aW9uKHBDdHgsICggdERvdDExZklFV01NSW5mb1N0YXRpb24qICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVdNTUluZm9TdGF0aW9uKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXTU1QYXJhbXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llV01NUGFyYW1zKHBDdHgsICggdERvdDExZklFV01NUGFyYW1zKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVXTU1QYXJhbXMpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdQQToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVXUEEocEN0eCwgKCB0RG90MTFmSUVXUEEqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVdQQSkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV1BBT3BhcXVlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVdQQU9wYXF1ZShwQ3R4LCAoIHREb3QxMWZJRVdQQU9wYXF1ZSogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFV1BBT3BhcXVlKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXU0M6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llV1NDKHBDdHgsICggdERvdDExZklFV1NDKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVXU0MpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdpZGVyQldDaGFuU3dpdGNoQW5uOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVdpZGVyQldDaGFuU3dpdGNoQW5uKHBDdHgsICggdERvdDExZklFV2lkZXJCV0NoYW5Td2l0Y2hBbm4qICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVdpZGVyQldDaGFuU3dpdGNoQW5uKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXc2NBc3NvY1JlcToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVXc2NBc3NvY1JlcShwQ3R4LCAoIHREb3QxMWZJRVdzY0Fzc29jUmVxKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVXc2NBc3NvY1JlcSkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV3NjQXNzb2NSZXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llV3NjQXNzb2NSZXMocEN0eCwgKCB0RG90MTFmSUVXc2NBc3NvY1JlcyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFV3NjQXNzb2NSZXMpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdzY0JlYWNvbjoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVXc2NCZWFjb24ocEN0eCwgKCB0RG90MTFmSUVXc2NCZWFjb24qICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVdzY0JlYWNvbikgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV3NjQmVhY29uUHJvYmVSZXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llV3NjQmVhY29uUHJvYmVSZXMocEN0eCwgKCB0RG90MTFmSUVXc2NCZWFjb25Qcm9iZVJlcyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFV3NjQmVhY29uUHJvYmVSZXMpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdzY0lFT3BhcXVlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tJZVdzY0lFT3BhcXVlKHBDdHgsICggdERvdDExZklFV3NjSUVPcGFxdWUqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVdzY0lFT3BhcXVlKSAqIGkgKSwgIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU2lnSWVXc2NQcm9iZVJlcToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrSWVXc2NQcm9iZVJlcShwQ3R4LCAoIHREb3QxMWZJRVdzY1Byb2JlUmVxKiApKHBTcmMgKyBwSWUtPm9mZnNldCArIHNpemVvZih0RG90MTFmSUVXc2NQcm9iZVJlcSkgKiBpICksICBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFNpZ0llV3NjUHJvYmVSZXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llV3NjUHJvYmVSZXMocEN0eCwgKCB0RG90MTFmSUVXc2NQcm9iZVJlcyogKShwU3JjICsgcEllLT5vZmZzZXQgKyBzaXplb2YodERvdDExZklFV3NjUHJvYmVSZXMpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTaWdJZVdzY1JlYXNzb2NSZXM6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja0llV3NjUmVhc3NvY1JlcyhwQ3R4LCAoIHREb3QxMWZJRVdzY1JlYXNzb2NSZXMqICkocFNyYyArIHBJZS0+b2Zmc2V0ICsgc2l6ZW9mKHREb3QxMWZJRVdzY1JlYXNzb2NSZXMpICogaSApLCAgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgRlJBTUVTX0xPRzEocEN0eCwgRlJMT0dFLCBGUkZMKCJJTlRFUk5BTCBFUlJPUi0tIEkgZG9uIgorICAgICAgICAgICAgICAgICAgICIndCBrbm93IGFib3V0IHRoZSBJRSAlZDsgdGhpcyBpcyBtb3N0IGxpa2VseSBhIGIiCisgICAgICAgICAgICAgICAgICAgInVnIGluICdmcmFtZXNjJy5cbiIpLCBwRmYtPnNpZyk7CisgICAgICAgICAgICAgICAgICAgcmV0dXJuIERPVDExRl9JTlRFUk5BTF9FUlJPUjsKKyAgICAgICAgICAgfQorCisgICAgICAgIHBCdWZSZW1haW5pbmcgKz0gbGVuOworICAgICAgICBuQnVmUmVtYWluaW5nIC09IGxlbjsKKyAgICAgICAgKnBuQ29uc3VtZWQgICArPSBsZW47CisgICAgfQorCisgICAgKytwSWU7CisKKyAgICB9CisKKyAgICByZXR1cm4gc3RhdHVzOworCit9CisKK3N0YXRpYyB0QU5JX1UzMiBQYWNrVGx2Q29yZSh0cEFuaVNpckdsb2JhbCBwQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcFNyYywKKyAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBCdWYsCisgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAgbkJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwbkNvbnN1bWVkLAorICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdFRMVkRlZm4gIFRMVnNbXSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpwaWR4KQoreworICAgIGNvbnN0IHRUTFZEZWZuICpwVGx2OworICAgIHRGUkFNRVNfQk9PTCAgICpwZkZvdW5kOworICAgIHRBTklfVTggICAgKnBCdWZSZW1haW5pbmc7CisgICAgdEFOSV9VMzIgICBuQnVmUmVtYWluaW5nLCBzdGF0dXMsIGxlbjsKKworICAgIERPVDExRl9QQVJBTUVURVJfQ0hFQ0syKHBTcmMsIHBCdWYsIG5CdWYsIHBuQ29uc3VtZWQpOworCisgICAgKHZvaWQpcEN0eDsKKyAgICBzdGF0dXMgPSBET1QxMUZfUEFSU0VfU1VDQ0VTUzsKKyAgICBwQnVmUmVtYWluaW5nID0gcEJ1ZjsKKyAgICBuQnVmUmVtYWluaW5nID0gbkJ1ZjsKKworICAgIHBUbHYgPSAmKCBUTFZzWzBdICk7CisgICAgd2hpbGUgKCAweGZmZmYgIT0gcFRsdi0+aWQgKQorICAgIHsKKyAgICAgICAgcGZGb3VuZCA9ICh0RlJBTUVTX0JPT0wqKShwU3JjICsgcFRsdi0+b2Zmc2V0ICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVGx2LT5wcmVzZW5jZU9mZnNldCk7CisgICAgICAgIGlmICggKnBmRm91bmQgJiYgcFRsdi0+bWluU2l6ZSA+IG5CdWZSZW1haW5pbmcgKQorICAgICAgICB7CisgICAgICAgICAgICBGUkFNRVNfTE9HMyhwQ3R4LCBGUkxPR0UsIEZSRkwoIlRoZSBUTFYgJXMgdGFrZXMgYXQgbGVhc3QiCisgICAgICAgICAgICAgICAgIiAlZCBieXRlcywgYnV0IHRoZXJlIGFyZSBvbmx5ICVkIGxlZnQgaW4gdGhlIGJ1ZmZlci4iCisgICAgICAgICAgICAgICAgIlxuIiksIHBUbHYtPm5hbWUsIHBUbHYtPm1pblNpemUsIG5CdWZSZW1haW5pbmcpOworICAgICAgICAgICAgcmV0dXJuIERPVDExRl9CVUZGRVJfT1ZFUkZMT1c7CisgICAgICAgIH0KKworICAgICAgICBsZW4gPSAwVTsKKworICAgICAgICBpZiAoICpwZkZvdW5kICkgeworICAgICAgICBzd2l0Y2ggKCBwVGx2LT5zaWcgKQorICAgICAgICB7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZBdXRob3JpemVkTUFDczoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrVGx2QXV0aG9yaXplZE1BQ3MocEN0eCwgKCB0RG90MTFmVExWQXV0aG9yaXplZE1BQ3MqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlJlcXVlc3RUb0Vucm9sbDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrVGx2UmVxdWVzdFRvRW5yb2xsKHBDdHgsICggdERvdDExZlRMVlJlcXVlc3RUb0Vucm9sbCogKShwU3JjICsgcFRsdi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2VmVyc2lvbjI6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja1RsdlZlcnNpb24yKHBDdHgsICggdERvdDExZlRMVlZlcnNpb24yKiApKHBTcmMgKyBwVGx2LT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZBUFNldHVwTG9ja2VkOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tUbHZBUFNldHVwTG9ja2VkKHBDdHgsICggdERvdDExZlRMVkFQU2V0dXBMb2NrZWQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdkFzc29jaWF0aW9uU3RhdGU6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja1RsdkFzc29jaWF0aW9uU3RhdGUocEN0eCwgKCB0RG90MTFmVExWQXNzb2NpYXRpb25TdGF0ZSogKShwU3JjICsgcFRsdi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2Q2hhbm5lbExpc3Q6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja1RsdkNoYW5uZWxMaXN0KHBDdHgsICggdERvdDExZlRMVkNoYW5uZWxMaXN0KiApKHBTcmMgKyBwVGx2LT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZDb25maWdNZXRob2RzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tUbHZDb25maWdNZXRob2RzKHBDdHgsICggdERvdDExZlRMVkNvbmZpZ01ldGhvZHMqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdkNvbmZpZ3VyYXRpb25FcnJvcjoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrVGx2Q29uZmlndXJhdGlvbkVycm9yKHBDdHgsICggdERvdDExZlRMVkNvbmZpZ3VyYXRpb25FcnJvciogKShwU3JjICsgcFRsdi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2Q29uZmlndXJhdGlvblRpbWVvdXQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja1RsdkNvbmZpZ3VyYXRpb25UaW1lb3V0KHBDdHgsICggdERvdDExZlRMVkNvbmZpZ3VyYXRpb25UaW1lb3V0KiApKHBTcmMgKyBwVGx2LT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZEZXZpY2VOYW1lOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tUbHZEZXZpY2VOYW1lKHBDdHgsICggdERvdDExZlRMVkRldmljZU5hbWUqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdkRldmljZVBhc3N3b3JkSUQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja1RsdkRldmljZVBhc3N3b3JkSUQocEN0eCwgKCB0RG90MTFmVExWRGV2aWNlUGFzc3dvcmRJRCogKShwU3JjICsgcFRsdi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2RXh0ZW5kZWRMaXN0ZW5UaW1pbmc6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja1RsdkV4dGVuZGVkTGlzdGVuVGltaW5nKHBDdHgsICggdERvdDExZlRMVkV4dGVuZGVkTGlzdGVuVGltaW5nKiApKHBTcmMgKyBwVGx2LT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZHT0ludGVudDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrVGx2R09JbnRlbnQocEN0eCwgKCB0RG90MTFmVExWR09JbnRlbnQqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdkludGVuZGVkUDJQSW50ZXJmYWNlQWRkcmVzczoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrVGx2SW50ZW5kZWRQMlBJbnRlcmZhY2VBZGRyZXNzKHBDdHgsICggdERvdDExZlRMVkludGVuZGVkUDJQSW50ZXJmYWNlQWRkcmVzcyogKShwU3JjICsgcFRsdi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2SW52aXRhdGlvbkZsYWdzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tUbHZJbnZpdGF0aW9uRmxhZ3MocEN0eCwgKCB0RG90MTFmVExWSW52aXRhdGlvbkZsYWdzKiApKHBTcmMgKyBwVGx2LT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZMaXN0ZW5DaGFubmVsOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tUbHZMaXN0ZW5DaGFubmVsKHBDdHgsICggdERvdDExZlRMVkxpc3RlbkNoYW5uZWwqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1Rsdk1hbnVmYWN0dXJlcjoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrVGx2TWFudWZhY3R1cmVyKHBDdHgsICggdERvdDExZlRMVk1hbnVmYWN0dXJlciogKShwU3JjICsgcFRsdi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2TWlub3JSZWFzb25Db2RlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tUbHZNaW5vclJlYXNvbkNvZGUocEN0eCwgKCB0RG90MTFmVExWTWlub3JSZWFzb25Db2RlKiApKHBTcmMgKyBwVGx2LT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZNb2RlbE5hbWU6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja1Rsdk1vZGVsTmFtZShwQ3R4LCAoIHREb3QxMWZUTFZNb2RlbE5hbWUqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1Rsdk1vZGVsTnVtYmVyOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tUbHZNb2RlbE51bWJlcihwQ3R4LCAoIHREb3QxMWZUTFZNb2RlbE51bWJlciogKShwU3JjICsgcFRsdi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2Tm90aWNlT2ZBYnNlbmNlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tUbHZOb3RpY2VPZkFic2VuY2UocEN0eCwgKCB0RG90MTFmVExWTm90aWNlT2ZBYnNlbmNlKiApKHBTcmMgKyBwVGx2LT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZPcGVyYXRpbmdDaGFubmVsOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tUbHZPcGVyYXRpbmdDaGFubmVsKHBDdHgsICggdERvdDExZlRMVk9wZXJhdGluZ0NoYW5uZWwqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlAyUENhcGFiaWxpdHk6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja1RsdlAyUENhcGFiaWxpdHkocEN0eCwgKCB0RG90MTFmVExWUDJQQ2FwYWJpbGl0eSogKShwU3JjICsgcFRsdi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2UDJQRGV2aWNlSWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja1RsdlAyUERldmljZUlkKHBDdHgsICggdERvdDExZlRMVlAyUERldmljZUlkKiApKHBTcmMgKyBwVGx2LT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZQMlBEZXZpY2VJbmZvOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tUbHZQMlBEZXZpY2VJbmZvKHBDdHgsICggdERvdDExZlRMVlAyUERldmljZUluZm8qICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlAyUEdyb3VwQnNzaWQ6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja1RsdlAyUEdyb3VwQnNzaWQocEN0eCwgKCB0RG90MTFmVExWUDJQR3JvdXBCc3NpZCogKShwU3JjICsgcFRsdi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2UDJQR3JvdXBJZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrVGx2UDJQR3JvdXBJZChwQ3R4LCAoIHREb3QxMWZUTFZQMlBHcm91cElkKiApKHBTcmMgKyBwVGx2LT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZQMlBHcm91cEluZm86CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja1RsdlAyUEdyb3VwSW5mbyhwQ3R4LCAoIHREb3QxMWZUTFZQMlBHcm91cEluZm8qICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlAyUFN0YXR1czoKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrVGx2UDJQU3RhdHVzKHBDdHgsICggdERvdDExZlRMVlAyUFN0YXR1cyogKShwU3JjICsgcFRsdi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2UHJpbWFyeURldmljZVR5cGU6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja1RsdlByaW1hcnlEZXZpY2VUeXBlKHBDdHgsICggdERvdDExZlRMVlByaW1hcnlEZXZpY2VUeXBlKiApKHBTcmMgKyBwVGx2LT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZSRkJhbmRzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tUbHZSRkJhbmRzKHBDdHgsICggdERvdDExZlRMVlJGQmFuZHMqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlJlcXVlc3REZXZpY2VUeXBlOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tUbHZSZXF1ZXN0RGV2aWNlVHlwZShwQ3R4LCAoIHREb3QxMWZUTFZSZXF1ZXN0RGV2aWNlVHlwZSogKShwU3JjICsgcFRsdi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2UmVxdWVzdFR5cGU6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja1RsdlJlcXVlc3RUeXBlKHBDdHgsICggdERvdDExZlRMVlJlcXVlc3RUeXBlKiApKHBTcmMgKyBwVGx2LT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZSZXNwb25zZVR5cGU6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja1RsdlJlc3BvbnNlVHlwZShwQ3R4LCAoIHREb3QxMWZUTFZSZXNwb25zZVR5cGUqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlNlbGVjdGVkUmVnaXN0cmFyOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tUbHZTZWxlY3RlZFJlZ2lzdHJhcihwQ3R4LCAoIHREb3QxMWZUTFZTZWxlY3RlZFJlZ2lzdHJhciogKShwU3JjICsgcFRsdi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2U2VsZWN0ZWRSZWdpc3RyYXJDb25maWdNZXRob2RzOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tUbHZTZWxlY3RlZFJlZ2lzdHJhckNvbmZpZ01ldGhvZHMocEN0eCwgKCB0RG90MTFmVExWU2VsZWN0ZWRSZWdpc3RyYXJDb25maWdNZXRob2RzKiApKHBTcmMgKyBwVGx2LT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZTZXJpYWxOdW1iZXI6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja1RsdlNlcmlhbE51bWJlcihwQ3R4LCAoIHREb3QxMWZUTFZTZXJpYWxOdW1iZXIqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlVVSURfRToKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyB8PSBkb3QxMWZQYWNrVGx2VVVJRF9FKHBDdHgsICggdERvdDExZlRMVlVVSURfRSogKShwU3JjICsgcFRsdi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2VVVJRF9SOgorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzIHw9IGRvdDExZlBhY2tUbHZVVUlEX1IocEN0eCwgKCB0RG90MTFmVExWVVVJRF9SKiApKHBTcmMgKyBwVGx2LT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZWZW5kb3JFeHRlbnNpb246CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja1RsdlZlbmRvckV4dGVuc2lvbihwQ3R4LCAoIHREb3QxMWZUTFZWZW5kb3JFeHRlbnNpb24qICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlZlcnNpb246CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja1RsdlZlcnNpb24ocEN0eCwgKCB0RG90MTFmVExWVmVyc2lvbiogKShwU3JjICsgcFRsdi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZywgbkJ1ZlJlbWFpbmluZywgJmxlbik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU2lnVGx2V1BTU3RhdGU6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja1RsdldQU1N0YXRlKHBDdHgsICggdERvdDExZlRMVldQU1N0YXRlKiApKHBTcmMgKyBwVGx2LT5vZmZzZXQpLCBwQnVmUmVtYWluaW5nLCBuQnVmUmVtYWluaW5nLCAmbGVuKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTaWdUbHZQMlBJbnRlcmZhY2U6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja1RsdlAyUEludGVyZmFjZShwQ3R4LCAoIHREb3QxMWZUTFZQMlBJbnRlcmZhY2UqICkocFNyYyArIHBUbHYtPm9mZnNldCksIHBCdWZSZW1haW5pbmcsIG5CdWZSZW1haW5pbmcsICZsZW4pOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNpZ1RsdlAyUE1hbmFnZWFiaWxpdHk6CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgfD0gZG90MTFmUGFja1RsdlAyUE1hbmFnZWFiaWxpdHkocEN0eCwgKCB0RG90MTFmVExWUDJQTWFuYWdlYWJpbGl0eSogKShwU3JjICsgcFRsdi0+b2Zmc2V0KSwgcEJ1ZlJlbWFpbmluZywgbk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ggbWFya2VyICk7ICAgICAgICAgICAgICAvKiBSZXNldCB2YXJpYWJsZSBhcmd1bWVudHMuICAgICAgKi8KKyAgICB9CisjZW5kaWYKK30KKworVk9TX1RSQUNFX0xFVkVMIGdldFZvc0RlYnVnTGV2ZWwodEFOSV9VMzIgZGVidWdMZXZlbCkKK3sKKyAgICBzd2l0Y2goZGVidWdMZXZlbCkKKyAgICB7CisgICAgICAgIGNhc2UgTE9HUDoKKyAgICAgICAgICAgIHJldHVybiBWT1NfVFJBQ0VfTEVWRUxfRkFUQUw7CisgICAgICAgIGNhc2UgTE9HRToKKyAgICAgICAgICAgIHJldHVybiBWT1NfVFJBQ0VfTEVWRUxfRVJST1I7CisgICAgICAgIGNhc2UgTE9HVzoKKyAgICAgICAgICAgIHJldHVybiBWT1NfVFJBQ0VfTEVWRUxfV0FSTjsKKyAgICAgICAgY2FzZSBMT0cxOgorICAgICAgICAgICAgcmV0dXJuIFZPU19UUkFDRV9MRVZFTF9JTkZPOworICAgICAgICBjYXNlIExPRzI6CisgICAgICAgICAgICByZXR1cm4gVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSDsKKyAgICAgICAgY2FzZSBMT0czOgorICAgICAgICAgICAgcmV0dXJuIFZPU19UUkFDRV9MRVZFTF9JTkZPX01FRDsKKyAgICAgICAgY2FzZSBMT0c0OgorICAgICAgICAgICAgcmV0dXJuIFZPU19UUkFDRV9MRVZFTF9JTkZPX0xPVzsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIHJldHVybiBWT1NfVFJBQ0VfTEVWRUxfSU5GT19MT1c7CisgICAgfQorfQorCitzdGF0aWMgaW5saW5lIFZPU19NT0RVTEVfSUQgZ2V0Vm9zTW9kdWxlSWQodEFOSV9VOCBtb2RJZCkKK3sKKyAgICBzd2l0Y2gobW9kSWQpCisgICAgeworICAgICAgICBjYXNlIFNJUl9IQUxfTU9EVUxFX0lEOgorICAgICAgICBjYXNlIFNJUl9IQUxfRVhUX01PRFVMRV9J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aWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKK2xvZ0R1bXAuYworKi8KKworLyoKKyAqIFRoaXMgZmlsZSBjb250YWlucyB0aGUgdXRpbGl0eSBmdW5jdGlvbnMgdG8gZHVtcCB2YXJpb3VzCisgKiBNQUMgc3RhdGVzIGFuZCB0byBlbmFibGUvZGlzYWJsZSBjZXJ0YWluIGZlYXR1cmVzIGR1cmluZworICogZGVidWdnaW5nLgorICogQXV0aG9yOiAgICAgICAgU2FuZGVzaCBHb2VsCisgKiBEYXRlOiAgICAgICAgICAwMi8yNy8wMgorICogSGlzdG9yeTotCisgKiAwMi8xMS8wMiAgICAgICBDcmVhdGVkLgorICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAqCisgKi8KKworLyogCisgKiBAbm90ZSA6IEJ5dGVzIGlzIHRvIHByaW50IG92ZXJmbG93IG1lc3NhZ2UgaW5mb3JtYXRpb24uCisgKi8KKworI2luY2x1ZGUgInBhbFR5cGVzLmgiCisKKyNpZmRlZiBBTklfTE9HRFVNUAorCisjZGVmaW5lIE1BWF9PVkVSRkxPV19NU0cgICAgNDAwCisjZGVmaW5lIE1BWF9MT0dEVU1QX1NJWkUgICAgKCg0KjEwMjQpIC0gTUFYX09WRVJGTE9XX01TRykKKworI2lmICAgZGVmaW5lZChBTklfT1NfVFlQRV9BTkRST0lEKQorCisjaW5jbHVkZSA8bGludXgva2VybmVsLmg+CisKKyNl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VhfTE9HRFVNUF9TSVpFOworCisjaWYgICAgZGVmaW5lZCAoQU5JX09TX1RZUEVfQU5EUk9JRCkKKyAgICAgICAgcmV0ID0gc25wcmludGYocEJ1ZiwgTUFYX09WRVJGTE9XX01TRywgIlxuLT4gKioqKioqKioqKioiCisgICAgICAgICAgICAgICAgIlxuT3V0cHV0IEV4Y2VlZGVkIHRoZSBCdWZmZXIgU2l6ZSwgbWVzc2FnZSB0cnVuY2F0ZWQhIVxuPC0gKioqKioqKioqKipcbiIpOworI2VuZGlmCisgICAgICAgIC8qIElmIGFuIG91dHB1dCBlcnJvciBpcyBlbmNvdW50ZXJlZCwgYSBuZWdhdGl2ZSB2YWx1ZSBpcyByZXR1cm5lZCBieSBzbnByaW50ZiAqLworICAgICAgICBpZiAocmV0IDwgMCkKKyAgICAgICAgICAgIHJldHVybiAwOworCisgICAgICAgIGlmIChyZXQgPiBNQVhfT1ZFUkZMT1dfTVNHKQorICAgICAgICAgICAgcmV0ID0gTUFYX09WRVJGTE9XX01TRzsKKyAgICB9CisKKyAgICBwTWFjLT5nQ3VycmVudExvZ1NpemUgKz0gcmV0OworCisKKyNlbmRpZiAvL2ZvciAjaWZkZWYgV0xBTl9ERUJVRworICAgIHJldHVybiByZXQ7Cit9CisKKworY2hhciogZHVtcExPRyggdHBBbmlTaXJHbG9iYWwgcE1hYywgY2hhciAqcCApCit7CisgICAgdEFOSV9VMzIgaTsKKworICAgIGZvciggaSA9IFNJUl9GSVJTVF9NT0RVTEVfSUQ7IGkgPD0gU0lSX0xBU1RfTU9EVUxFX0lEOyBpKysgKSB7CisgICAgICAgIHAgKz0gbG9nX3NwcmludGYocE1hYywgcCwgIlsweCUyeF0iLCBpKTsKKyAgICAgICAgc3dpdGNoIChpKQorICAgICAgICB7CisgICAgICAgICAgICBjYXNlIFNJUl9IQUxfTU9EVUxFX0lEOiBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLCBwLCAiSEFMICIpOyBicmVhazsKKyAgICAgICAgICAgIG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bG9nX3NwcmludGYoIHBNYWMsIHAsICJQSFkgIik7IGJyZWFrOworICAgICAgICAgICAgY2FzZSBTSVJfRFZUX01PRFVMRV9JRDogcCArPSBsb2dfc3ByaW50ZiggcE1hYywgcCwgIkRWVCAiKTsgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNJUl9TTVNfTU9EVUxFX0lEOiBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLCBwLCAiU01TICIpOyBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6IHAgKz0gbG9nX3NwcmludGYoIHBNYWMsIHAsICJVTksgIiwgaSk7IGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYywgcCwKKyAgICAgICAgICAgICAgICAiOiBkZWJ1ZyBsZXZlbCBpcyBbMHgleF0gIiwKKyAgICAgICAgICAgICAgICBwTWFjLT51dGlscy5nTG9nRGJnTGV2ZWxbaSAtIFNJUl9GSVJTVF9NT0RVTEVfSURdKTsKKworICAgICAgICBzd2l0Y2goIHBNYWMtPnV0aWxzLmdMb2dEYmdMZXZlbFtpIC0gU0lSX0ZJUlNUX01PRFVMRV9JRF0gKQorICAgICAgICB7CisgICAgICAgICAgICBjYXNlIExPR09GRjogcCArPSBsb2dfc3ByaW50ZiggcE1hYywgcCwgIkxPRyBkaXNhYmxlZFxuIik7IGJyZWFrOworICAgICAgICAgICAgY2FzZSBMT0dQOiBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLCBwLCAiTE9HUChQYW5pYyBvbmx5KVxuIik7IGJyZWFrOworICAgICAgICAgICAgY2FzZSBMT0dFOiBwICs9IGxvZ19zcHJpbnRmKCBwTWFjLCBwLCAiTE9HRShFcnJvcnMgb25seSlcbiIpOyBicmVhazsKKyAgICAgICAgICAgIGNhc2UgTE9HVzogcCArPSBsb2dfc3ByaW50ZiggcE1hYywgcCwgIkxPR1coV2FybmluZ3MpXG4iKTsgYnJlYWs7CisgICAgICAgICAgICBjYXNlI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9IHBNYWMtPmR1bXBUYWJsZUVudHJ5W2ldLT5uSXRlbXM7CisKKyAgICAgICAgZm9yIChqID0gMDsgaiA8IG5JdGVtczsgaisrLCBwRW50cnkrKykgeworICAgICAgICAgICAgaWYgKHBFbnRyeS0+ZGVzY3JpcHRpb24gPT0gTlVMTCkgCisgICAgICAgICAgICAgICAgY29udGludWU7CisKKyAgICAgICAgICAgIGlmIChwRW50cnktPmlkID09IDApIHsKKyAgICAgICAgICAgICAgICByZXQgPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiLS0tLSAlc1xuIiwgcEVudHJ5LT5kZXNjcmlwdGlvbik7IAorCisgICAgICAgICAgICAgICAgaWYgKHJldCA8PSAwKQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIHAgKz0gcmV0OworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAocEVudHJ5LT5pZCA8IHN0YXJ0SWQpCisgICAgICAgICAgICAgICAgY29udGludWU7CisKKyAgICAgICAgICAgIHJldCA9IGxvZ19zcHJpbnRmKHBNYWMsIHAsICIlNGRcdCVzXG4iLCBwRW50cnktPmlkLCBwRW50cnktPmRlc2NyaXB0aW9uKTsKKworICAgICAgICAgICAgaWYgKHJldCA8PSAwKQorICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjdXJyZW50SWQgPSBwRW50cnktPmlkOworICAgICAgICAgICAgcCArPSByZXQ7CisgICAgICAgIH0KKworICAgICAgICBpZiAocmV0IDw9IDApCisgICAgICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICByZXR1cm4gY3VycmVudElkOworfQorCitpbnQgbG9nUnRhaUR1bXAoIHRwQW5pU2lyR2xvYmFsIHBNYWMsIHRBTklfVTMyIGNtZCwgdEFOSV9VMzIgYXJnMSwgdEFOSV9VMzIgYXJnMiwgdEFOSV9VMzIgYXJnMywgdEFOSV9VMzIgYXJnNCwgdEFOSV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AgICAgICAgICAgICAgIG5JdGVtcyA9IHBNYWMtPmR1bXBUYWJsZUVudHJ5W2ldLT5uSXRlbXM7CisgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICB9CisgICAgICAgfQorICAgICAgIAorICAgICAgIGlmKChuSXRlbXMgPiAwKSAmJiAocEVudHJ5ICE9IE5VTEwpKSB7CisgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBuSXRlbXM7IGkrKywgcEVudHJ5KyspIHsKKyAgICAgICAgICAgICAgIGlmKCBjbWQgPT0gcEVudHJ5LT5pZCApIHsKKyAgICAgICAgICAgICAgICAgICBpZiAoIHBFbnRyeS0+ZnVuYyAhPSBOVUxMICkgeworICAgICAgICAgICAgICAgICAgICAgICBwRW50cnktPmZ1bmMocE1hYywgYXJnMSwgYXJnMiwgYXJnMywgYXJnNCwgcCk7CisgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiQ21kIG5vdCBzdXBwb3J0ZWRcbiIpOworICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgfQorICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgIHAgKz0gbG9nX3NwcmludGYoIHBNYWMscCwgIkNtZCBub3QgZm91bmQgXG4iKTsKKyAgICAgICB9CisgICAgfQorICAgIGlmIChkZWJ1ZykKKyAgICAgICAgcCArPSBsb2dfc3ByaW50ZiggcE1hYyxwLCAiUmV0dXJuZWQgJWQgYnl0ZXNcbiIsIHBNYWMtPmdDdXJyZW50TG9nU2l6ZSk7CisKKyAgICByZXR1cm4gcE1hYy0+Z0N1cnJlbnRMb2dTaXplOworCit9CisKKyNlbmRpZgpkaWZmIC0tZ2l0IGEvd2xhbi9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KyAgICAgICAgQ0FTRV9SRVRVUk5fU1RSSU5HKGVXTklfU01FX1RETFNfREVMX1NUQV9SRVEpOworICAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoZVdOSV9TTUVfVERMU19ERUxfU1RBX1JTUCk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhlV05JX1NNRV9URExTX0RFTF9TVEFfSU5EKTsKKyAgICAgICAgQ0FTRV9SRVRVUk5fU1RSSU5HKGVXTklfU01FX1RETFNfREVMX0FMTF9QRUVSX0lORCk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhlV05JX1NNRV9NR01UX0ZSTV9UWF9DT01QTEVUSU9OX0lORCk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhlV05JX1NNRV9URExTX0xJTktfRVNUQUJMSVNIX1JFUSk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhlV05JX1NNRV9URExTX0xJTktfRVNUQUJMSVNIX1JTUCk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhlV05JX1NNRV9URExTX0NIQU5ORUxfU1dJVENIX1JFUSk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhlV05JX1NNRV9URExTX0NIQU5ORUxfU1dJVENIX1JTUCk7CisjZW5kaWYKKyAgICAgICAgQ0FTRV9SRVRVUk5fU1RSSU5HKGVXTklfU01FX1NFVF9CQ05fRklMVEVSX1JFUSk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhlV05JX1NNRV9SRVNFVF9BUF9DQVBTX0NIQU5HRUQpOworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMVcKKyAgICAgICAgQ0FTRV9SRVRVUk5fU1RSSU5HKGVXTklfU01FX1VOUFJPVF9NR01UX0ZSTV9JTkQpOworI2VuZGlmCisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhlV05JX1NNRV9DQU5ESURBVEVfRk9VTkRfSU5EKTsKKyAgICAgICAgQ0FTRV9SRVRVUk5f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ICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhTSVJfTElNX1VQREFURV9CRUFDT04pOworICAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoU0lSX0xJTV9NSU5fQ0hBTk5FTF9USU1FT1VUKTsKKyAgICAgICAgQ0FTRV9SRVRVUk5fU1RSSU5HKFNJUl9MSU1fTUFYX0NIQU5ORUxfVElNRU9VVCk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhTSVJfTElNX0pPSU5fRkFJTF9USU1FT1VUICk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhTSVJfTElNX0FVVEhfRkFJTF9USU1FT1VUICk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhTSVJfTElNX0FVVEhfUlNQX1RJTUVPVVQpOworICAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoU0lSX0xJTV9BU1NPQ19GQUlMX1RJTUVPVVQpOworICAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoU0lSX0xJTV9SRUFTU09DX0ZBSUxfVElNRU9VVCk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhTSVJfTElNX0hFQVJUX0JFQVRfVElNRU9VVCk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhTSVJfTElNX0NIQU5ORUxfU0NBTl9USU1FT1VUICk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhTSVJfTElNX1BST0JFX0hCX0ZBSUxVUkVfVElNRU9VVCk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhTSVJfTElNX0FERFRTX1JTUF9USU1FT1VUICk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhTSVJfTElNX0xJTktfVEVTVF9EVVJBVElPTl9USU1FT1VUICk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhTSVJfTElNX0NORl9XQUlUX1RJTUVPVVQgICAgICAgICApOworICAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoU0lSX0xJTV9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TV9NTE1fQVVUSF9DTkYpOworICAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoTElNX01MTV9BVVRIX0lORCk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhMSU1fTUxNX0FTU09DX1JFUSk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhMSU1fTUxNX0FTU09DX0NORik7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhMSU1fTUxNX0FTU09DX0lORCk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhMSU1fTUxNX0RJU0FTU09DX1JFUSk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhMSU1fTUxNX0RJU0FTU09DX0NORik7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhMSU1fTUxNX0RJU0FTU09DX0lORCk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhMSU1fTUxNX1JFQVNTT0NfUkVRKTsKKyAgICAgICAgQ0FTRV9SRVRVUk5fU1RSSU5HKExJTV9NTE1fUkVBU1NPQ19DTkYpOworICAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoTElNX01MTV9SRUFTU09DX0lORCk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhMSU1fTUxNX0RFQVVUSF9SRVEpOworICAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoTElNX01MTV9ERUFVVEhfQ05GKTsKKyAgICAgICAgQ0FTRV9SRVRVUk5fU1RSSU5HKExJTV9NTE1fREVBVVRIX0lORCk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhMSU1fTUxNX1RTUEVDX1JFUSk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhMSU1fTUxNX1RTUEVDX0NORik7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhMSU1fTUxNX1NFVEtFWVNfUkVRKTsKKyAgICAgICAgQ0FTRV9SRVRVUk5fU1RSSU5HKExJTV9NTE1fU0VUS0VZU19DTkYpO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0FTRV9SRVRVUk5fU1RSSU5HKFdOSV9DRkdfRE5MRF9DTkYpOworICAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoV05JX0NGR19HRVRfUlNQKTsKKyAgICAgICAgQ0FTRV9SRVRVUk5fU1RSSU5HKFdOSV9DRkdfU0VUX0NORik7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhTSVJfQ0ZHX1BBUkFNX1VQREFURV9JTkQpOworICAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoU0lSX0NGR19ET1dOTE9BRF9DT01QTEVURV9JTkQpOworICAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoV05JX0NGR19ETkxEX1JTUCk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhXTklfQ0ZHX0dFVF9SRVEpOworICAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoV05JX0NGR19TRVRfUkVRKTsKKyAgICAgICAgQ0FTRV9SRVRVUk5fU1RSSU5HKFdOSV9DRkdfU0VUX1JFUV9OT19SU1ApOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgcmV0dXJuKCAodEFOSV9VOCopIlVOS05PV04iICk7CisgICAgICAgICAgICBicmVhazsKKyAgICB9Cit9CisKK3RBTklfVTgqIG1hY1RyYWNlR2V0SW5mb0xvZ1N0cmluZyggdEFOSV9VMTYgaW5mb0xvZyApCit7CisgICAgc3dpdGNoKCBpbmZvTG9nICkKKyAgICB7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhlTE9HX05PRFJPUF9NSVNTRURfQkVBQ09OX1NDRU5BUklPKTsKKyAgICAgICAgQ0FTRV9SRVRVUk5fU1RSSU5HKGVMT0dfUFJPQ19ERUFVVEhfRlJBTUVfU0NFTkFSSU8pOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgcmV0dXJuKCAodEFOSV9VOCopIlVOS05PV04iICk7CisgICAgICAgICAgICBicmVhazsKKyAgICB9Cit9CisKK3RBTklfVTgqIG1hY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B4ODAwMCApID4+IDE1ICkgfAorICAgICAgICAgICAoICggaW4gJiAweDQwMDAgKSA+PiAxMyApIHwKKyAgICAgICAgICAgKCAoIGluICYgMHgyMDAwICkgPj4gMTEgKSB8CisgICAgICAgICAgICggKCBpbiAmIDB4MTAwMCApID4+ICA5ICkgfAorICAgICAgICAgICAoICggaW4gJiAweDA4MDAgKSA+PiAgNyApIHwKKyAgICAgICAgICAgKCAoIGluICYgMHgwNDAwICkgPj4gIDUgKSB8CisgICAgICAgICAgICggKCBpbiAmIDB4MDIwMCApID4+ICAzICkgfAorICAgICAgICAgICAoICggaW4gJiAweDAxMDAgKSA+PiAgMSApIHwKKyAgICAgICAgICAgKCAoIGluICYgMHgwMDgwICkgPDwgIDEgKSB8CisgICAgICAgICAgICggKCBpbiAmIDB4MDA0MCApIDw8ICAzICkgfAorICAgICAgICAgICAoICggaW4gJiAweDAwMjAgKSA8PCAgNSApIHwKKyAgICAgICAgICAgKCAoIGluICYgMHgwMDEwICkgPDwgIDcgKSB8CisgICAgICAgICAgICggKCBpbiAmIDB4MDAwOCApIDw8ICA5ICkgfAorICAgICAgICAgICAoICggaW4gJiAweDAwMDQgKSA8PCAxMSApIHwKKyAgICAgICAgICAgKCAoIGluICYgMHgwMDAyICkgPDwgMTMgKSB8CisgICAgICAgICAgICggKCBpbiAmIDB4MDAwMSApIDw8IDE1ICk7CisjICAgZW5kaWYgLy8gQU5JX0xJVFRMRV9CSVRfRU5ESUFOCit9CisKK3ZvaWQKK3N3YXBCaXRGaWVsZDMyKHRBTklfVTMyIGluLCB0QU5JX1UzMiAqb3V0KQoreworIyAgIGlmZGVmIEFOSV9MSVRUTEVfQklUX0VORElBTgorICAgICpvdXQgPSBpbjsKKyMgICBlbHNlIC8vIEJpZy1FbmRpYW4uLi4KKyAgICAqb3V0ID0gKCAoIGluICYgMHg4MDAwMDAwMCApID4+IDMxICkgfAorICAgICAgICAgICAoICggaW4gJiAweDQwMDAwMDAwICkgPj4gMjkgKSB8CisgICAgICAgICAgICggKCBpbiAmIDB4MjAwMDAwMDAgKSA+PiAyNyApIHwKKyAgICAgICAgICAgKCAoIGluICYgMHgxMDAwMDAwMCApID4+IDI1ICkgfAorICAgICAgICAgICAoICggaW4gJiAweDA4MDAwMDAwICkgPj4gMjMgKSB8CisgICAgICAgICAgICggKCBpbiAmIDB4MDQwMDAwMDAgKSA+PiAyMSApIHwKKyAgICAgICAgICAgKCAoIGluICYgMHgwMjAwMDAwMCApID4+IDE5ICkgfAorICAgICAgICAgICAoICggaW4gJiAweDAxMDAwMDAwICkgPj4gMTcgKSB8CisgICAgICAgICAgICggKCBpbiAmIDB4MDA4MDAwMDAgKSA+PiAxNSApIHwKKyAgICAgICAgICAgKCAoIGluICYgMHgwMDQwMDAwMCApID4+IDEzICkgfAorICAgICAgICAgICAoICggaW4gJiAweDAwMjAwMDAwICkgPj4gMTEgKSB8CisgICAgICAgICAgICggKCBpbiAmIDB4MDAxMDAwMDAgKSA+PiAgOSApIHwKKyAgICAgICAgICAgKCAoIGluICYgMHgwMDA4MDAwMCApID4+ICA3ICkgfAorICAgICAgICAgICAoICggaW4gJiAweDAwMDQwMDAwICkgPj4gIDUgKSB8CisgICAgICAgICAgICggKCBpbiAmIDB4MDAwMjAwMDAgKSA+PiAgMyApIHwKKyAgICAgICAgICAgKCAoIGluICYgMHgwMDAxMDAwMCApID4+ICAxICkgfAorICAgICAgICAgICAoICggaW4gJiAweDAwMDA4MDAwICkgPDwgIDEgKSB8CisgICAgICAgICAgICggKCBpbiAmIDB4MDAwMDQwMDAgKSA8PCAgMyApIHwKKyAgICAgICAgICAgKCAoIGluICYgMHgwMDAwMjAwMCApIDw8ICA1ICkgfAorICAgICAgICAgICAoICggaW4gJiAweDAwMDAxMDAwICkgPDwgIDcgKSB8CisgICAgICAgICAgICggKCBpbiAmIDB4MDAwMDA4MDAgKSA8PCAgOSApIHwKKyAgICAgICAgICAgKCAoIGluICYgMHgwMDAwMDQwMCApIDw8IDExICkgfAorICAgICAgICAgICAoICggaW4gJiAweDAwMDAwMjAwICkgPDwgMTMgKSB8CisgICAgICAgICAgICggKCBpbiAmIDB4MDAwMDAxMDAgKSA8PCAxNSApIHwKKyAgICAgICAgICAgKCAoIGluICYgMHgwMDAwMDA4MCApIDw8IDE3ICkgfAorICAgICAgICAgICAoICggaW4gJiAweDAwMDAwMDQwICkgPDwgMTkgKSB8CisgICAgICAgICAgICggKCBpbiAmIDB4MDAwMDAwMjAgKSA8PCAyMSApIHwKKyAgICAgICAgICAgKCAoIGluICYgMHgwMDAwMDAxMCApIDw8IDIzICkgfAorICAgICAgICAgICAoICggaW4gJiAweDAwMDAwMDA4ICkgPDwgMjUgKSB8CisgICAgICAgICAgICggKCBpbiAmIDB4MDAwMDAwMDQgKSA8PCAyNyApIHwKKyAgICAgICAgICAgKCAoIGluICYgMHgwMDAwMDAwMiApIDw8IDI5ICkgfAorICAgICAgICAgICAoICggaW4gJiAweDAwMDAwMDAxICkgPDwgMzEgKTsKKyMgICBlbmRpZiAvLyBBTklfTElUVExFX0JJVF9FTkRJQU4KK30KKworaW5saW5lIHN0YXRpYyB2b2lkIF9fcHJpbnRXTU1QYXJhbXModHBBbmlTaXJHbG9iYWwgIHBNYWMsIHREb3QxMWZJRVdNTVBhcmFtcyAqcFdtbSkKK3sKKyAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoIldNTSBQYXJhbWV0ZXJzIFJlY2VpdmVkOiAiKSk7CisgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJCRTogYWlmc24gJWQsIGFjbSAlZCwgYWNpICVkLCBjd21pbiAlZCwgY3dtYXggJWQsIHR4b3AgJWQgIiksCisgICAgICAgICAgIHBXbW0tPmFjYmVfYWlmc24sIHBXbW0tPmFjYmVfYWNtLCBwV21tLT5hY2JlX2FjaSwgcFdtbS0+YWNiZV9hY3dtaW4sIHBXbW0tPmFjYmVfYWN3bWF4LCBwV21tLT5hY2JlX3R4b3BsaW1pdCk7CisKKyAgICBsaW1Mb2coc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IHRoZSBJRSBpbiByc25JRWRhdGEgaW5zaWRlIHRTaXJSU05pZQorLy8gICAgICAgICA8IDAsIGNhbm5vdCBmaW5kCitpbnQgRmluZElFTG9jYXRpb24oIHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFNpclJTTmllIHBSc25JZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggRUlEKQoreworICAgIGludCBpZHgsIGllTGVuLCBieXRlc0xlZnQ7CisgICAgaW50IHJldF92YWwgPSAtMTsKKworICAgIC8vIEhlcmUncyB3aGF0J3MgZ29pbmcgb246ICdyc25JZScgbG9va3MgbGlrZSB0aGlzOgorCisgICAgLy8gICAgIHR5cGVkZWYgc3RydWN0IHNTaXJSU05pZQorICAgIC8vICAgICB7CisgICAgLy8gICAgICAgICB0QU5JX1UxNiAgICAgICBsZW5ndGg7CisgICAgLy8gICAgICAgICB0QU5JX1U4ICAgICAgICByc25JRWRhdGFbU0lSX01BQ19NQVhfSUVfTEVOR1RIKzJdOworICAgIC8vICAgICB9IHRTaXJSU05pZSwgKnRwU2lyUlNOaWU7CisKKyAgICAvLyBvdGhlciBjb2RlIHJlY29yZHMgYm90aCB0aGUgV1BBICYgUlNOIElFcyAoaW5jbHVkaW5nIHRoZWlyIEVJRHMgJgorICAgIC8vIGxlbmd0aHMpIGludG8gdGhlIGFycmF5ICdyc25JRWRhdGEnLiAgV2UgbWF5IGhhdmU6CisKKyAgICAvLyAgICAgV2l0aCBXQVBJIHN1cHBvcnQsIHRoZXJlIG1heSBiZSAzIElFcyBoZXJlCisgICAgLy8gICAgIEl0IGNhbiBiZSBvbmx5IFdQQSBJRSwgb3Igb25seSBSU04gSUUgb3Igb25seSBXQVBJIElFCisgICAgLy8gICAgIE9yIHR3byBvciBhbGwgdGhyZWUgb2YgdGhlbSB3aXRoIG5vIHBhcnRpY3VsYXIgb3JkZXJpbmcKKworICAgIC8vIFRoZSBpZi90aGVuL2V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EFuaVNpckdsb2JhbCAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmRmZDYXBhYmlsaXRpZXMgKnBEb3QxMWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiAgICAgICAgICAgIHBzZXNzaW9uRW50cnkpCit7CisgICAgdEFOSV9VMTYgICAgICAgICAgIGNmZzsKKyAgICB0U2lyUmV0U3RhdHVzIG5TaXJTdGF0dXM7CisKKyAgICBuU2lyU3RhdHVzID0gY2ZnR2V0Q2FwYWJpbGl0eUluZm8oIHBNYWMsICZjZmcscHNlc3Npb25FbnRyeSApOworICAgIGlmICggZVNJUl9TVUNDRVNTICE9IG5TaXJTdGF0dXMgKQorICAgIHsKKyAgICAgICAgZG90MTFmTG9nKCBwTWFjLCBMT0dQLCBGTCgiRmFpbGVkIHRvIHJldHJpZXZlIHRoZSBDYXBhYmlsaXRpZXMgYiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaXRmaWVsZCBmcm9tIENGRyAoJWQpLiIpLCBuU2lyU3RhdHVzICk7CisgICAgICAgIHJldHVybiBuU2lyU3RhdHVzOworICAgIH0KKworI2lmIDAKKyAgICBpZiAoIHNpcklzUHJvcENhcGFiaWxpdHlFbmFibGVkKCBwTWFjLCBTSVJfTUFDX1BST1BfQ0FQQUJJTElUWV8xMUVRT1MgKSApCisgICAgeworICAgICAgICBTSVJfTUFDX0NMRUFSX0NBUEFCSUxJVFkoIGNmZywgUU9TICk7CisgICAgfQorI2VuZGlmCisgICAgc3dhcEJpdEZpZWxkMTYoIGNmZywgKCB0QU5JX1UxNiogKXBEb3QxMWYgKTsKKworICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7Cit9IC8vIEVuZCBQb3B1bGF0ZURvdDExZkNhcGFiaWxpdGllcy4KKwordFNpclJldFN0YXR1cworUG9wdWxhdGVEb3QxMWZDYXBhYmlsaXRpZXMyKHRwQW5pU2lyR2xvYmFsICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmRmZDYXBhYmlsaXRpZXMgKnBEb3QxMWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBEcGhIYXNoTm9kZSAgICAgICAgICBwU3RhLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiAgICAgICAgICAgIHBzZXNzaW9uRW50cnkpCit7CisgICAgdEFOSV9VMTYgICAgICAgICAgIGNmZzsKKyAgICB0U2lyUmV0U3RhdHVzIG5TaXJTdGF0dXM7CisgICAgblNpclN0YXR1cyA9IGNmZ0dldENhcGFiaWxpdHlJbmZvKCBwTWFjLCAmY2ZnICxwc2Vzc2lvbkVudHJ5KTsKKyAgICBpZiAoIGVTSVJfU1VDQ0VTUyAhPSBuU2lyU3RhdHVzICkKKyAgICB7CisgICAgICAgIGRvdDExZkxvZyggcE1hYywgTE9HUCwgRkwoIkZhaWxlZCB0byByZXRyaWV2ZSB0aGUgQ2FwYWJpbGl0aWVzIGIiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIml0ZmllbGQgZnJvbSBDRkcgKCVkKS4iKSwgblNpclN0YXR1cyApOworICAgICAgICByZXR1cm4gblNpclN0YXR1czsKKyAgICB9CisKKyAgICBpZiAoICggTlVMTCAhPSBwU3RhICkgJiYgcFN0YS0+YW5pUGVlciAmJgorICAgICAgICAgUFJPUF9DQVBBQklMSVRZX0dFVCggMTFFUU9TLCBwU3RhLT5wcm9wQ2FwYWJpbGl0eSApICkKKyAgICB7CisgICAgICAgIFNJUl9NQUNfQ0xFQVJfQ0FQQUJJTElUWSggY2ZnLCBRT1MgKTsKKyAgICB9CisKKyAgICBzd2FwQml0RmllbGQxNiggY2ZnLCAoIHRBTklfVTE2KiApcERvdDExZiApOworCisgICAgcmV0dXJuIGVTSVJfU1VDQ0VTUzsKKworfSAvLyBFbmQgUG9wdWxhdGVEb3QxMWZDYXBhYmlsaXRpZXMyLgorCit2b2lkCitQb3B1bGF0ZURvdDExZkNoYW5Td2l0Y2hBbm4odHBBbmlTaXJHbG9iYWwgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVDaGFuU3dpdGNoQW5uICpwRG90MTFmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpCit7CisgICAgcERvdDExZi0+c3dpdGNoTW9kZSA9IHBzZXNzaW9uRW50cnktPmdMaW1DaGFubmVsU3dpdGNoLnN3aXRjaE1vZGU7CisgICAgcERvdDExZi0+bmV3Q2hhbm5lbCA9IHBzZXNzaW9uRW50cnktPmdMaW1DaGFubmVsU3dpdGNoLnByaW1hcnlDaGFubmVsOworICAgIHBEb3QxMWYtPnN3aXRjaENvdW50ID0gKCB0QU5JX1U4ICkgcHNlc3Npb25FbnRyeS0+Z0xpbUNoYW5uZWxTd2l0Y2guc3dpdGNoQ291bnQ7CisKKyAgICBwRG90MTFmLT5wcmVzZW50ID0gMTsKK30gLy8gRW5kIFBvcHVsYXRlRG90MTFmQ2hhblN3aXRjaEFubi4KKwordm9pZAorUG9wdWxhdGVEb3QxMWZFeHRDaGFuU3dpdGNoQW5uKHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFRXh0Q2hhblN3aXRjaEFubiAqcERvdDExZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KQoreworICAgIC8vSGFzIHRvIGJlIHVwZGF0ZWQgb24gdGhlIGNiIHN0YXRlIGJhc2lzCisgICAgcERvdDExZi0+c2Vjb25kYXJ5Q2hhbm5lbE9mZnNldCA9IAorICAgICAgICAgICAgIHBzZXNzaW9uRW50cnktPmdMaW1DaGFubmVsU3dpdGNoLnNlY29uZGFyeVN1YkJhbmQ7CisKKyAgICBwRG90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IHRTaXJSRkJhbmQgICAgICAgICByZkJhbmQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgIHRlbXBbQ0ZHX01BWF9TVFJfTEVOXSwgY29kZVszXTsKKworICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5saW0xMWRFbmFibGVkICkKKyAgICB7CisgICAgICAgIGxpbUdldFJmQmFuZChwTWFjLCAmcmZCYW5kLCBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgaWYgKHJmQmFuZCA9PSBTSVJfQkFORF81X0dIWikKKyAgICAgICAgeworICAgICAgICAgICAgaXRlbSAgID0gV05JX0NGR19NQVhfVFhfUE9XRVJfNTsKKyAgICAgICAgICAgIG1heGxlbiA9IFdOSV9DRkdfTUFYX1RYX1BPV0VSXzVfTEVOOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgaXRlbSAgID0gV05JX0NGR19NQVhfVFhfUE9XRVJfMl80OworICAgICAgICAgICAgbWF4bGVuID0gV05JX0NGR19NQVhfVFhfUE9XRVJfMl80X0xFTjsKKyAgICAgICAgfQorCisgICAgICAgIENGR19HRVRfU1RSKCBuU2lyU3RhdHVzLCBwTWFjLCBpdGVtLCB0ZW1wLCBsZW4sIG1heGxlbiApOworCisgICAgICAgIGlmICggMyA+IGxlbiApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIG5vIGxpbWl0IG9uIHR4IHBvd2VyLCBjYW5ub3QgaW5jbHVkZSB0aGUgSUUgYmVjYXVzZSBhdCBsZWFzdAorICAgICAgICAgICAgLy8gb25lIChjaGFubmVsLG51bSx0eCBwb3dlcikgbXVzdCBiZSBwcmVzZW50CisgICAgICAgICAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworICAgICAgICB9CisKKyAgICAgICAgQ0ZHX0dFVF9TVFIoIG5TaXJTdGF0dXMsIHBNYWMsIFdOSV9DRkdfQ09VTlRSWV9DT0RFLAorICAgICAgICAgICAgICAgICAgICAgY29kZSwgY29kZWxlbiwgMyApOworCisgICAgICAgIHZvc19tZW1fY29weSggcERvdDExZi0+Y291bnRyeSwgY29kZSwgY29kZWxlbiApOworCisgICAgICAgIGlmKGxlbiA+IE1BWF9TSVpFX09GX1RSSVBMRVRTX0lOX0NPVU5UUllfSUUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGRvdDExZkxvZyggcE1hYywgTE9HRSwgRkwoImxlbjolZCBpcyBvdXQgb2YgYm91bmRzLCByZXNldHRpbmcuIiksIGxlbik7CisgICAgICAgICAgICBsZW4gPSBNQVhfU0laRV9PRl9UUklQTEVUU19JTl9DT1VOVFJZX0lFOworICAgICAgICB9CisKKyAgICAgICAgcERvdDExZi0+bnVtX3RyaXBsZXRzID0gKCB0QU5JX1U4ICkgKCBsZW4gLyAzICk7CisgICAgICAgIHZvc19tZW1fY29weSggKCB0QU5JX1U4KiApcERvdDExZi0+dHJpcGxldHMsIHRlbXAsIGxlbiApOworCisgICAgICAgIHBEb3QxMWYtPnByZXNlbnQgPSAxOworICAgIH0KKworICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7Cit9IC8vIEVuZCBQb3B1bGF0ZURvdDExZkNvdW50cnkuCisKK3RTaXJSZXRTdGF0dXMKK1BvcHVsYXRlRG90MTFmRFNQYXJhbXModHBBbmlTaXJHbG9iYWwgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRURTUGFyYW1zICpwRG90MTFmLCB0QU5JX1U4IGNoYW5uZWwsCisgICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpCit7CisgICAgaWYgKElTXzI0R19DSChjaGFubmVsKSkKKyAgICB7CisgICAgICAgIC8vIC4xMWIvZyBtb2RlIFBIWSA9PiBJbmNsdWRlIHRoZSBEUyBQYXJhbWV0ZXIgU2V0IElFOgorICAgICAgICBwRG90MTFmLT5jdXJyX2NoYW5uZWwgPSBjaGFubmVsOworICAgICAgICBwRG90MTFmLT5wcmVzZW50ID0gMTsKKyAgICB9CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworfSAvLyBFbmQgUG9wdWxhdGVEb3QxMWZEU1BhcmFtcy4KKworI2RlZmluZSBTRVRfQUlGU04oYWlmc24pICgoKGFpZnNuKSA8IDIpID8gMiA6IChhaWZzbikpCisKKwordm9pZAorUG9wdWxhdGVEb3QxMWZFRENBUGFyYW1TZXQodHBBbmlTaXJHbG9iYWwgICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFRURDQVBhcmFtU2V0ICpwRG90MTFmLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpCit7CisKKyAgICBpZiAoICBwc2Vzc2lvbkVudHJ5LT5saW1Rb3NFbmFibGVkICkKKyAgICB7CisgICAgICAgIC8vY2hhbmdlIHRvIGJpdHdpc2Ugb3BlcmF0aW9uLCBhZnRlciB0aGlzIGlzIGZpeGVkIGluIGZyYW1lcy4KKyAgICAgICAgcERvdDExZi0+cW9zID0gKHRBTklfVTgpKDB4ZjAgJiAocHNlc3Npb25FbnRyeS0+Z0xpbUVkY2FQYXJhbVNldENvdW50IDw8IDQpICk7CisKKyAgICAgICAgLy8gRmlsbCBlYWNoIEVEQ0EgcGFyYW1ldGVyIHNldCBpbiBvcmRlcjogYmUsIGJrLCB2aSwgdm8KKyAgICAgICAgcERvdDExZi0+YWNiZV9haWZzbiAgICAgPSAoIDB4ZiAmIFNFVF9BSUZTTihwc2Vzc2lvbkVudHJ5LT5nTGltRWRjYVBhcmFtc0JDWzBdLmFjaS5haWZzbikgKTsKKyAgICAgICAgcERvdDExZi0+YWNiZV9hY20gICAgICAgPSAoIDB4MSAmIHBzZXNzaW9uRW50cnktPmdMaW1FZGNhUGFyYW1zQkNbMF0uYWNpLmFjbSApOworICAgICAgICBwRG90MTFmLT5hY2JlX2FjaSAgICAgICA9ICggMHgzICYgU0lSX01BQ19FRENB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KTsKKyAgICAgICAgcERvdDExZi0+YWN2b19hY3dtYXggICAgPSAoIDB4ZiAmIHBzZXNzaW9uRW50cnktPmdMaW1FZGNhUGFyYW1zQkNbM10uY3cubWF4ICk7CisgICAgICAgIHBEb3QxMWYtPmFjdm9fdHhvcGxpbWl0ID0gcHNlc3Npb25FbnRyeS0+Z0xpbUVkY2FQYXJhbXNCQ1szXS50eG9wbGltaXQ7CisKKyAgICAgICAgcERvdDExZi0+cHJlc2VudCA9IDE7CisgICAgfQorCit9IC8vIEVuZCBQb3BsdWF0ZURvdDExZkVEQ0FQYXJhbVNldC4KKwordFNpclJldFN0YXR1cworUG9wdWxhdGVEb3QxMWZFUlBJbmZvKHRwQW5pU2lyR2xvYmFsICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFRVJQSW5mbyAqcERvdDExZiwKKyAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiAgICBwc2Vzc2lvbkVudHJ5KQoreworICAgIHRTaXJSZXRTdGF0dXMgblNpclN0YXR1czsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgIHZhbDsKKyAgICB0U2lyUkZCYW5kICAgICAgICAgIHJmQmFuZCA9IFNJUl9CQU5EX1VOS05PV047CisKKyAgICBsaW1HZXRSZkJhbmQocE1hYywgJnJmQmFuZCwgcHNlc3Npb25FbnRyeSk7CisgICAgaWYoU0lSX0JBTkRfMl80X0dIWiA9PSByZkJhbmQpCisgICAgeworICAgICAgICBwRG90MTFmLT5wcmVzZW50ID0gMTsKKworICAgICAgICB2YWwgID0gcHNlc3Npb25FbnRyeS0+Y2ZnUHJvdGVjdGlvbi5mcm9tbGxiOworICAgICAgICBpZighdmFsICl7CisgICAgICAgICAgICBkb3QxMWZMb2coIHBNYWMsIExPR0UsIEZMKCIxMUIgcHJvdGVjdGlvbiBub3QgZW5hYmxlZC4gTm90IHBvcHVsYXRpbmcgRVJQIElFICVkIiApLHZhbCApOworICAgICAgICAgICAgcmV0dXJuIGVTSVJfU1VDQ0VTUzsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChwc2Vzc2lvbkVudHJ5LT5nTGltMTFiUGFyYW1zLnByb3RlY3Rpb25FbmFibGVkKQorICAgICAgICB7CisgICAgICAgICAgICBwRG90MTFmLT5ub25fZXJwX3ByZXNlbnQgPSAxOworICAgICAgICAgICAgcERvdDExZi0+dXNlX3Byb3QgICAgICAgID0gMTsKKyAgICAgICAgfQorCisgICAgICAgIGlmICggcHNlc3Npb25FbnRyeS0+Z0xpbU9sYmNQYXJhbXMucHJvdGVjdGlvbkVuYWJsZWQgKQorICAgICAgICB7CisgICAgICAgICAgICAvL0ZJWE1FX1BST1RFQ1RJT046IHdlIHNob3VsZCBiZSBzZXR0aW5nIG5vbl9lcnAgcHJlc2VudCBhbHNvLgorICAgICAgICAgICAgLy9jaGVjayB0aGUgdGVzdCBwbGFuIGZpcnN0LgorICAgICAgICAgICAgcERvdDExZi0+dXNlX3Byb3QgPSAxOworICAgICAgICB9CisKKworICAgICAgICBpZigocHNlc3Npb25FbnRyeS0+Z0xpbU5vU2hvcnRQYXJhbXMubnVtTm9uU2hvcnRQcmVhbWJsZVN0YSkgCisgICAgICAgICAgICAgICAgIHx8ICFwc2Vzc2lvbkVudHJ5LT5iZWFjb25QYXJhbXMuZlNob3J0UHJlYW1ibGUpeyAKKyAgICAgICAgICAgICAgICBwRG90MTFmLT5iYXJrZXJfcHJlYW1ibGUgPSAxOworICAgICAgICAgCisgICAgICAgIH0KKyAgICAgICAgLy8gaWYgcHJvdGVjdGlvbiBhbHdheXMgZmxhZyBpcyBzZXQsIGFkdmVydGlzZSBwcm90ZWN0aW9uIGVuYWJsZWQKKyAgICAgICAgLy8gcmVnYXJkbGVzcyBvZiBsZWdhY3kgc3RhdGlvbnMgcHJlc2VuY2UKKyAgICAgICAgQ0ZHX0dFVF9JTlQoIG5TaXJTdGF0dXMsIHBNYWMsIFdOSV9DRkdfMTFHX1BST1RFQ1RJT05fQUxXQVlTL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JBVElPTkFMID09IG5DaGFubmVsTnVtICkKKyAgICB7CisgICAgICAgIGlmKHBzZXNzaW9uRW50cnkgIT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgICAgblJhdGVzID0gcHNlc3Npb25FbnRyeS0+ZXh0UmF0ZVNldC5udW1SYXRlczsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSggcmF0ZXMsIHBzZXNzaW9uRW50cnktPmV4dFJhdGVTZXQucmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgblJhdGVzKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIGRvdDExZkxvZyggcE1hYywgTE9HRSwgRkwoIm5vIHNlc3Npb24gY29udGV4dCBleGlzdHMgd2hpbGUiCisgICAgICAgICAgICAgICAgICAgICAgICAiIHBvcHVsYXRpbmcgT3BlcmF0aW9uYWwgUmF0ZSBTZXQiKSk7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoIEhJR0hFU1RfMjRHSFpfQ0hBTk5FTF9OVU0gPj0gbkNoYW5uZWxOdW0gKQorICAgIHsKKyAgICAgICAgQ0ZHX0dFVF9TVFIoIG5TaXJTdGF0dXMsIHBNYWMsIFdOSV9DRkdfRVhURU5ERURfT1BFUkFUSU9OQUxfUkFURV9TRVQsCisgICAgICAgICAgICAgICAgICAgICByYXRlcywgblJhdGVzLCBXTklfQ0ZHX0VYVEVOREVEX09QRVJBVElPTkFMX1JBVEVfU0VUX0xFTiApOworICAgIH0KKworICAgIGlmICggMCAhPSBuUmF0ZXMgKQorICAgIHsKKyAgICAgICAgcERvdDExZi0+bnVtX3JhdGVzID0gKCB0QU5JX1U4ICluUmF0ZXM7CisgICAgICAgIHZvc19tZW1fY29weSggcERvdDExZi0+cmF0ZXMsIHJhdGVzLCBuUmF0ZXMgKTsKKyAgICAgICAgcERvdDExZi0+cHJlc2VudCAgID0gMTsKKyAgICB9CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworCit9IC8vIEVuZCBQb3B1bGF0ZURvdDExZkV4dFN1cHBSYXRlcy4KKwordFNpclJldFN0YXR1cworUG9wdWxhdGVEb3QxMWZFeHRTdXBwUmF0ZXMxKHRwQW5pU2lyR2xvYmFsICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgbkNoYW5uZWxOdW0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFRXh0U3VwcFJhdGVzICpwRG90MTFmKQoreworICAgIHRBTklfVTMyICAgICAgICAgICBuUmF0ZXM7CisgICAgdFNpclJldFN0YXR1cyBuU2lyU3RhdHVzOworICAgIHRBTklfVTggICAgICAgICAgICByYXRlc1tTSVJfTUFDX01BWF9OVU1CRVJfT0ZfUkFURVNdOworCisgICAgaWYgKCAxNCA8IG5DaGFubmVsTnVtICkKKyAgICB7CisgICAgICAgIHBEb3QxMWYtPnByZXNlbnQgPSAwOworICAgICAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworICAgIH0KKworICAgIC8vIE4uQi4gSSBoYXZlICpubyogaWRlYSB3aHkgd2UncmUgY2FsbGluZyAnd2xhbl9jZmdHZXRTdHInIHdpdGggYW4gYXJndW1lbnQKKyAgICAvLyBvZiBXTklfQ0ZHX1NVUFBPUlRFRF9SQVRFU18xMUEgaGVyZSwgYnV0IHRoYXQncyB3aGF0IHdhcyBkb25lCisgICAgLy8gcHJldmlvdXNseSAmIEknbSBhZnJhaWQgdG8gY2hhbmdlIGl0IQorICAgIENGR19HRVRfU1RSKCBuU2lyU3RhdHVzLCBwTWFjLCBXTklfQ0ZHX1NVUFBPUlRFRF9SQVRFU18xMUEsCisgICAgICAgICAgICAgICAgIHJhdGVzLCBuUmF0ZXMsIFNJUl9NQUNfTUFYX05VTUJFUl9PRl9SQVRFUyApOworCisgICAgaWYgKCAwICE9IG5SYXRlcyApCisgICAgeworICAgICAgICBwRG90MTFmLT5udW1fcmF0ZXMgPSAoIHRBTklfVTggKSBuUmF0ZXM7CisgICAgICAgIHZvc19tZW1fY29weSggcERvdDExZi0+cmF0ZXMsIHJhdGVzLCBuUmF0ZXMgKTsKKyAgICAgICAgcERvdDExZi0+cHJlc2VudCAgID0gMTsKKyAgICB9CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworfSAvLyBQb3B1bGF0ZURvdDExZkV4dFN1cHBSYXRlczEuCisKK3RTaXJSZXRTdGF0dXMKK1BvcHVsYXRlRG90MTFmSFRDYXBzKHRwQW5pU2lyR2xvYmFsICAgICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gICAgICBwc2Vzc2lvbkVudHJ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFSFRDYXBzICpwRG90MTFmKQoreworICAgIHRBTklfVTMyICAgICAgICAgICAgICAgICAgICAgICAgIG5DZmdWYWx1ZSwgbkNmZ0xlbjsKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgICAgICBuQ2ZnVmFsdWU4OworICAgIHRTaXJSZXRTdGF0dXMgICAgICAgICAgICAgICAgICAgIG5TaXJTdGF0dXM7CisgICAgdFNpck1hY0hUUGFyYW1ldGVyc0luZm8gICAgICAgICAqcEhUUGFyYW1ldGVyc0luZm87CisgICAgdW5pb24geworICAgICAgICB0QU5JX1UxNiAgICAgICAgICAgICAgICAgICAgICAgIG5DZmdWYWx1ZTE2OworICAgICAgICB0U2lyTWFjSFRDYXBhYmlsaXR5SW5mbyAgICAgICAgIGh0Q2FwSW5mbzsKKyAgICAgICAgdFNpck1hY0V4dGVuZGVkSFRDYXBhYmlsaXR5SW5mbyBleHRIdENhcEluZm87CisgICAgfSB1SFRDYXBhYmlsaXR5SW5mbzsKKworICAgIHRTaXJNYWNUeEJGQ2FwYWJpbGl0eUluZm8gICAgICAgKnBUeEJGQ2FwYWJpbGl0eUluZm87CisgICAgdFNpck1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dHlJbmZvLm5DZmdWYWx1ZTE2ID0gbkNmZ1ZhbHVlICYgMHhGRkZGOworCisgICAgcERvdDExZi0+cGNvICAgICAgICAgICAgPSB1SFRDYXBhYmlsaXR5SW5mby5leHRIdENhcEluZm8ucGNvOworICAgIHBEb3QxMWYtPnRyYW5zaXRpb25UaW1lID0gdUhUQ2FwYWJpbGl0eUluZm8uZXh0SHRDYXBJbmZvLnRyYW5zaXRpb25UaW1lOworICAgIHBEb3QxMWYtPm1jc0ZlZWRiYWNrICAgID0gdUhUQ2FwYWJpbGl0eUluZm8uZXh0SHRDYXBJbmZvLm1jc0ZlZWRiYWNrOworCisKKyAgICBDRkdfR0VUX0lOVCggblNpclN0YXR1cywgcE1hYywgV05JX0NGR19UWF9CRl9DQVAsIG5DZmdWYWx1ZSApOworCisgICAgcFR4QkZDYXBhYmlsaXR5SW5mbyA9ICggdFNpck1hY1R4QkZDYXBhYmlsaXR5SW5mbyogKSAmbkNmZ1ZhbHVlOworICAgIHBEb3QxMWYtPnR4QkYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IHBUeEJGQ2FwYWJpbGl0eUluZm8tPnR4QkY7CisgICAgcERvdDExZi0+cnhTdGFnZ2VyZWRTb3VuZGluZyAgICAgICAgICAgICAgICAgICAgICAgID0gcFR4QkZDYXBhYmlsaXR5SW5mby0+cnhTdGFnZ2VyZWRTb3VuZGluZzsKKyAgICBwRG90MTFmLT50eFN0YWdnZXJlZFNvdW5kaW5nICAgICAgICAgICAgICAgICAgICAgICAgPSBwVHhCRkNhcGFiaWxpdHlJbmZvLT50eFN0YWdnZXJlZFNvdW5kaW5nOworICAgIHBEb3QxMWYtPnJ4WkxGICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IHBUeEJGQ2FwYWJpbGl0eUluZm8tPnJ4WkxGOworICAgIHBEb3QxMWYtPnR4WkxGICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IHBUeEJGQ2F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AgICAgICAgICAgICAgICAgIHBRb3NNYXBTZXQtPm51bV9kc2NwX2V4Y2VwdGlvbnMpOworICAgIGZvciAoaT0wOyBpIDwgcFFvc01hcFNldC0+bnVtX2RzY3BfZXhjZXB0aW9uczsgaSsrKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJkc2NwIHZhbHVlOiAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFFvc01hcFNldC0+ZHNjcF9leGNlcHRpb25zW2ldWzBdKTsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJVc2VyIHByaW9yaXR5IHZhbHVlOiAlZCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFFvc01hcFNldC0+ZHNjcF9leGNlcHRpb25zW2ldWzFdKTsKKyAgICB9CisgICAgZm9yIChpPTA7aTw4O2krKykKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiZHNjcCBsb3cgZm9yIHVwICVkOiAlZCIpLGksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBRb3NNYXBTZXQtPmRzY3BfcmFuZ2VbaV1bMF0pOworICAgICAgICBsaW1Mb2cocE1hYywgTE9HMSwgRkwoImRzY3AgaGlnaCBmb3IgdXAgJWQ6ICVkIiksaSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFFvc01hcFNldC0+ZHNjcF9yYW5nZVtpXVsxXSk7CisgICAgfQorfQorCit0U2lyUmV0U3RhdHVzCitQb3B1bGF0ZURvdDExZlZIVENhcHModHBBbmlTaXJHbG9iYWwgICAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFVkhUQ2FwcyAqcERvdDExZiwKKyAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IG5DaGFubmVsTnVtLAorICAgICAgICAgICAgICAgICAgICAgIHRBbmlCb29sIGlzU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5TdGF0dXMsIHBNYWMsIFdOSV9DRkdfVkhUX1RYX0hJR0hFU1RfU1VQUE9SVEVEX0RBVEFfUkFURSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5DZmdWYWx1ZSApOworICAgIHBEb3QxMWYtPnR4U3VwRGF0YVJhdGUgPSAobkNmZ1ZhbHVlICYgMHgwMDAwMUZGRik7CisKKyAgICBwRG90MTFmLT5yZXNlcnZlZDM9IDA7CisKKyAgICBsaW1Mb2dWSFRDYXAocE1hYywgcERvdDExZik7CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworCit9CisKK3RTaXJSZXRTdGF0dXMKK1BvcHVsYXRlRG90MTFmVkhUT3BlcmF0aW9uKHRwQW5pU2lyR2xvYmFsICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVWSFRPcGVyYXRpb24gICpwRG90MTFmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggbkNoYW5uZWxOdW0pCit7CisgICAgdFNpclJldFN0YXR1cyAgICAgICAgblN0YXR1czsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICBuQ2ZnVmFsdWU9MDsKKyAgICB0QW5pQm9vbCAgICAgICAgICAgICBkaXNhYmxlTWNzOSA9IGVTSVJfRkFMU0U7CisKKyAgICBpZiAobkNoYW5uZWxOdW0gPD0gU0lSXzExQl9DSEFOTkVMX0VORCkKKyAgICAgICAgZGlzYWJsZU1jczkgPSAgcE1hYy0+cm9hbS5jb25maWdQYXJhbS5jaGFubmVsQm9uZGluZ01vZGUyNEdIej8KKyAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9GQUxTRTplU0lSX1RSVUU7CisgICAgZWxzZQorICAgICAgICBkaXNhYmxlTWNzOSA9CisgICAgICAgICAgICBwTWFjLT5yb2FtLmNvbmZpZ1BhcmFtLmNoYW5uZWxCb25kaW5nTW9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MWYtPmJzc0NvZXhpc3RNZ210U3VwcG9ydCA9IDE7CisgICAgICAgICAgIHBEb3QxMWYtPnByZXNlbnQgPSAxOworICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIGVTSVJfU1VDQ0VTUzsKK30KKwordFNpclJldFN0YXR1cworUG9wdWxhdGVEb3QxMWZPcGVyYXRpbmdNb2RlKHRwQW5pU2lyR2xvYmFsICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRU9wZXJhdGluZ01vZGUgICpwRG90MTFmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gICBwc2Vzc2lvbkVudHJ5KQoreworICAgIHBEb3QxMWYtPnByZXNlbnQgPSAxOworICAgIAorICAgIHBEb3QxMWYtPmNoYW5XaWR0aCA9IHBzZXNzaW9uRW50cnktPmdMaW1PcGVyYXRpbmdNb2RlLmNoYW5XaWR0aDsKKyAgICBwRG90MTFmLT5yeE5TUyA9IHBzZXNzaW9uRW50cnktPmdMaW1PcGVyYXRpbmdNb2RlLnJ4TlNTOworICAgIHBEb3QxMWYtPnJ4TlNTVHlwZSA9IHBzZXNzaW9uRW50cnktPmdMaW1PcGVyYXRpbmdNb2RlLnJ4TlNTVHlwZTsKKyAgICAKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworfQorCisjZW5kaWYKK3RTaXJSZXRTdGF0dXMKK1BvcHVsYXRlRG90MTFmSFRJbmZvKHRwQW5pU2lyR2xvYmFsICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUhUSW5mbyAqcERvdDExZiwKKyAgICAgICAgICAgICAgICAgICAgIHRwUEVTZXNzaW9uICAgICAgcHNlc3Npb25FbnRyeSApCit7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgbkNmZ1ZhbHVlLCBuQ2ZnTGVuOworICAgIHRBTklfVTggICAgICAgICAgICAgIGh0SW5mb0ZpZWxkMTsKKyAgICB0QU5J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VEluZm9GaWVsZC5pbmZvRmllbGQzLnJlc2VydmVkICAgICAgICAgICAgICAgICAgICAgID0gMDsKKworCisgICAgcERvdDExZi0+c2Vjb25kYXJ5Q2hhbm5lbE9mZnNldCAgICAgICAgPSBwSFRJbmZvRmllbGQxLT5zZWNvbmRhcnlDaGFubmVsT2Zmc2V0OworICAgIHBEb3QxMWYtPnJlY29tbWVuZGVkVHhXaWR0aFNldCAgICAgICAgID0gcEhUSW5mb0ZpZWxkMS0+cmVjb21tZW5kZWRUeFdpZHRoU2V0OworICAgIHBEb3QxMWYtPnJpZnNNb2RlICAgICAgICAgICAgICAgICAgICAgID0gcEhUSW5mb0ZpZWxkMS0+cmlmc01vZGU7CisgICAgcERvdDExZi0+Y29udHJvbGxlZEFjY2Vzc09ubHkgICAgICAgICAgPSBwSFRJbmZvRmllbGQxLT5jb250cm9sbGVkQWNjZXNzT25seTsKKyAgICBwRG90MTFmLT5zZXJ2aWNlSW50ZXJ2YWxHcmFudWxhcml0eSAgICA9IHBIVEluZm9GaWVsZDEtPnNlcnZpY2VJbnRlcnZhbEdyYW51bGFyaXR5OworCisgICAgcERvdDExZi0+b3BNb2RlICAgICAgICAgICAgICAgICAgICAgICAgPSB1SFRJbmZvRmllbGQyLmluZm9GaWVsZDIub3BNb2RlOworICAgIHBEb3QxMWYtPm5vbkdGRGV2aWNlc1ByZXNlbnQgICAgICAgICAgID0gdUhUSW5mb0ZpZWxkMi5pbmZvRmllbGQyLm5vbkdGRGV2aWNlc1ByZXNlbnQ7CisgICAgcERvdDExZi0+b2Jzc05vbkhUU3RhUHJlc2VudCAgICAgICAgICAgPSB1SFRJbmZvRmllbGQyLmluZm9GaWVsZDIub2Jzc05vbkhUU3RhUHJlc2VudDsKKyAgICBwRG90MTFmLT5yZXNlcnZlZCAgICAgICAgICAgICAgICAgICAgICA9IHVIVEluZm9GaWVsZDIuaW5mb0ZpZWxkMi5yZXNlcnZlZDsKKworCisgICAgcERvdDExZi0+YmFzaWNTVEJDTU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DExZklCU1NQYXJhbXModHBBbmlTaXJHbG9iYWwgICAgICAgcE1hYywKKyAgICAgICB0RG90MTFmSUVJQlNTUGFyYW1zICpwRG90MTFmLCB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KQoreworICAgIGlmICggZUxJTV9TVEFfSU5fSUJTU19ST0xFID09IHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgKQorICAgIHsKKyAgICAgICAgcERvdDExZi0+cHJlc2VudCA9IDE7CisgICAgICAgIC8vIEFUSU0gZHVyYXRpb24gaXMgYWx3YXlzIHNldCB0byAwCisgICAgICAgIHBEb3QxMWYtPmF0aW0gPSAwOworICAgIH0KKworfSAvLyBFbmQgUG9wdWxhdGVEb3QxMWZJQlNTUGFyYW1zLgorCisKKyNpZmRlZiBBTklfU1VQUE9SVF8xMUgKK3RTaXJSZXRTdGF0dXMKK1BvcHVsYXRlRG90MTFmTWVhc3VyZW1lbnRSZXBvcnQwKHRwQW5pU2lyR2xvYmFsICAgICAgICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJNYWNNZWFzUmVxQWN0aW9uRnJhbWUgIHBSZXEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVNZWFzdXJlbWVudFJlcG9ydCAqcERvdDExZikKK3sKKyAgICBwRG90MTFmLT50b2tlbiAgICAgPSBwUmVxLT5tZWFzUmVxSUUubWVhc1Rva2VuOworICAgIHBEb3QxMWYtPmxhdGUgICAgICA9IDA7CisgICAgcERvdDExZi0+aW5jYXBhYmxlID0gMDsKKyAgICBwRG90MTFmLT5yZWZ1c2VkICAgPSAxOworICAgIHBEb3QxMWYtPnR5cGUgICAgICA9IFNJUl9NQUNfQkFTSUNfTUVBU1VSRU1FTlRfVFlQRTsKKworICAgIHBEb3QxMWYtPnByZXNlbnQgICA9IDE7CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworCit9IC8vIEVuZCBQb3B1bGF0ZWREb3QxMWZNZWFzdXJlbWVudFJlcG9ydDAuCisKK3RTaXJSZXRTdGF0dXMKK1BvcHVsYXRlRG90MTFmTWVhc3VyZW1lbnRSZXBvcnQxKHRwQW5pU2lyR2xvYmFsICAgICAgICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyTWFjTWVhc1JlcUFjdGlvbkZyYW1lICBwUmVxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRU1lYXN1cmVtZW50UmVwb3J0ICpwRG90MTFmKQoreworICAgIHBEb3QxMWYtPnRva2VuICAgICA9IHBSZXEtPm1lYXNSZXFJRS5tZWFzVG9rZW47CisgICAgcERvdDExZi0+bGF0ZSAgICAgID0gMDsKKyAgICBwRG90MTFmLT5pbmNhcGFibGUgPSAwOworICAgIHBEb3QxMWYtPnJlZnVzZWQgICA9IDE7CisgICAgcERvdDExZi0+dHlwZSAgICAgID0gU0lSX01BQ19DQ0FfTUVBU1VSRU1FTlRfVFlQRTsKKworICAgIHBEb3QxMWYtPnByZXNlbnQgICA9IDE7CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworCit9IC8vIEVuZCBQb3B1bGF0ZWREb3QxMWZNZWFzdXJlbWVudFJlcG9ydDEuCisKK3RTaXJSZXRTdGF0dXMKK1BvcHVsYXRlRG90MTFmTWVhc3VyZW1lbnRSZXBvcnQyKHRwQW5pU2lyR2xvYmFsICAgICAgICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJNYWNNZWFzUmVxQWN0aW9uRnJhbWUgIHBSZXEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVNZWFzdXJlbWVudFJlcG9ydCAqcERvdDExZikKK3sKKyAgICBwRG90MTFmLT50b2tlbiAgICAgPSBwUmVxLT5tZWFzUmVxSUUubWVhc1Rva2VuOworICAgIHBEb3Qx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sKKworICAgIH0KKyAgICAKKyAgICBwQ2Fwcy0+cHJlc2VudCAgICA9IDE7Cit9IC8vIEVuZCBQb3B1bGF0ZURvdDExZlBvd2VyQ2Fwcy4KKwordFNpclJldFN0YXR1cworUG9wdWxhdGVEb3QxMWZQb3dlckNvbnN0cmFpbnRzKHRwQW5pU2lyR2xvYmFsICAgICAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUG93ZXJDb25zdHJhaW50cyAqcERvdDExZikKK3sKKyAgICB0QU5JX1UzMiAgICAgICAgICAgY2ZnOworICAgIHRTaXJSZXRTdGF0dXMgblNpclN0YXR1czsKKworICAgIENGR19HRVRfSU5UKCBuU2lyU3RhdHVzLCBwTWFjLCBXTklfQ0ZHX0xPQ0FMX1BPV0VSX0NPTlNUUkFJTlQsIGNmZyApOworCisgICAgcERvdDExZi0+bG9jYWxQb3dlckNvbnN0cmFpbnRzID0gKCB0QU5JX1U4ICljZmc7CisgICAgcERvdDExZi0+cHJlc2VudCA9IDE7CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworfSAvLyBFbmQgUG9wdWxhdGVEb3QxMWZQb3dlckNvbnN0cmFpbnRzLgorCit2b2lkCitQb3B1bGF0ZURvdDExZlFPU0NhcHNBcCh0cEFuaVNpckdsb2JhbCAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVRT1NDYXBzQXAgKnBEb3QxMWYsIHRwUEVTZXNzaW9uIHBzZXNzaW9uRW50cnkpCit7CisgICAgcERvdDExZi0+Y291bnQgICAgPSBwc2Vzc2lvbkVudHJ5LT5nTGltRWRjYVBhcmFtU2V0Q291bnQ7CisgICAgcERvdDExZi0+cmVzZXJ2ZWQgPSAwOworICAgIHBEb3QxMWYtPnR4b3ByZXEgID0gMDsKKyAgICBwRG90MTFmLT5xcmVxICAgICA9IDA7CisgICAgcERvdDExZi0+cWFjayAgICAgPSAwOworICAgIHBEb3Qx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1hc2spOworICAgIH0gICAKKyAgICBwRG90MTFmLT5wcmVzZW50ID0gMTsKK30gLy8gRW5kIFBvcHVsYXRlZERvdDExZlFPU0NhcHMuCisKK3RTaXJSZXRTdGF0dXMKK1BvcHVsYXRlRG90MTFmUlNOKHRwQW5pU2lyR2xvYmFsICBwTWFjLAorICAgICAgICAgICAgICAgICAgdHBTaXJSU05pZSAgICAgIHBSc25JZSwKKyAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVJTTiAgICpwRG90MTFmKQoreworICAgIHRBTklfVTMyICAgICAgICBzdGF0dXM7CisgICAgaW50ICBpZHg7CisKKyAgICBpZiAoIHBSc25JZS0+bGVuZ3RoICkKKyAgICB7CisgICAgICAgIGlmKCAwIDw9ICggaWR4ID0gRmluZElFTG9jYXRpb24oIHBNYWMsIHBSc25JZSwgRE9UMTFGX0VJRF9SU04gKSApICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgc3RhdHVzID0gZG90MTFmVW5wYWNrSWVSU04oIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnNuSWUtPnJzbklFZGF0YSArIGlkeCArIDIsIC8vRUlELCBsZW5ndGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSc25JZS0+cnNuSUVkYXRhWyBpZHggKyAxIF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRG90MTFmICk7CisgICAgICAgIGlmICggRE9UMTFGX0ZBSUxFRCggc3RhdHVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICBkb3QxMWZMb2coIHBNYWMsIExPR0UsIEZMKCJQYXJzZSBmYWlsdXJlIGluIFBvcHVsYXRlRG90MTFmUlMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgICAgICBzdGF0dXMgKTsKKyAgICAgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgICAgIH0KKyAgICAgICAgZG90MTFmTG9nKCBwTWFjLCBMT0cyLCBGTCgiZG90MTFmVW5wYWNrSWVSU04gcmV0dXJuZWQgMHglMDh4IGluICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiUG9wdWxhdGVEb3QxMWZSU04uIiksIHN0YXR1cyApOworICAgICAgICB9CisKKyAgICB9CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworfSAvLyBFbmQgUG9wdWxhdGVEb3QxMWZSU04uCisKK3RTaXJSZXRTdGF0dXMgUG9wdWxhdGVEb3QxMWZSU05PcGFxdWUoIHRwQW5pU2lyR2xvYmFsICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyUlNOaWUgICAgICAgICAgcFJzbkllLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFUlNOT3BhcXVlICpwRG90MTFmICkKK3sKKyAgICBpbnQgaWR4OworCisgICAgaWYgKCBwUnNuSWUtPmxlbmd0aCApCisgICAgeworICAgICAgICBpZiggMCA8PSAoIGlkeCA9IEZpbmRJRUxvY2F0aW9uKCBwTWFjLCBwUnNuSWUsIERPVDExRl9FSURfUlNOICkgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBEb3QxMWYtPnByZXNlbnQgID0gMTsKKyAgICAgICAgICAgIHBEb3QxMWYtPm51bV9kYXRhID0gcFJzbkllLT5yc25JRWRhdGFbIGlkeCArIDEgXTsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSggIHBEb3QxMWYtPmRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnNuSWUtPnJzbklFZGF0YSArIGlkeCArIDIsICAgIC8vIEVJRCwgbGVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnNuSWUtPnJzbklFZGF0YVsgaWR4ICsgMSBdICk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworCit9IC8vIEVuZCBQb3B1bGF0ZURvdDExZlJTTk9wYXF1ZS4KKworCisKKyNpZiBkZWZpbmVkKEZFQVRVUkVfV0xBTl9XQVBJKQorCit0U2lyUmV0U3RhdHVzCitQb3B1bGF0ZURvdDExZldBUEkodHBBbmlTaXJHbG9iYWwgIHBNYWMsCisgICAgICAgICAgICAgICAgICB0cFNpclJTTmllICAgICAgcFJzbkllLAorICAgICAgICAgICAgICAgICAgdERvdDExZklFV0FQSSAgICpwRG90MTFmKQorICAgICAgICB7CisgICAgdEFOSV9VMzIgICAgICAgIHN0YXR1czsKKyAgICBpbnQgIGlkeDsKKworICAgIGlmICggcFJzbkllLT5sZW5ndGggKQorICAgICAgICB7CisgICAgICAgIGlmKCAwIDw9ICggaWR4ID0gRmluZElFTG9jYXRpb24oIHBNYWMsIHBSc25JZSwgRE9UMTFGX0VJRF9XQVBJICkgKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIHN0YXR1cyA9IGRvdDExZlVucGFja0llV0FQSSggcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnNuSWUtPnJzbklFZGF0YSArIGlkeCArIDIsIC8vRUlELCBsZW5ndGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnNuSWUtPnJzbklFZGF0YVsgaWR4ICsgMSBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEb3QxMWYgKTsKKyAgICAgICAgICAgIGlmICggRE9UMTFGX0ZBSUxFRCggc3RhdHVzICkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGRvdDExZkxvZyggcE1hYywgTE9HRSwgRkwoIlBhcnNlIGZhaWx1cmUgaW4gUG9wdWxhdGVEb3QxMWZXQVBJICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzICk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGRvdDExZkxvZyggcE1hYywgTE9HMiwgRkwoImRvdDExZlVucGFja0llUlNOIHJldHVybmVkIDB4JTA4eCBpbiAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlBvcHVsYXRlRG90MTFmV0FQSS4iKSwgc3RhdHVzICk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworfSAvLyBFbmQgUG9wdWxhdGVEb3QxMWZXQVBJLgorCit0U2lyUmV0U3RhdHVzIFBvcHVsYXRlRG90MTFmV0FQSU9wYXF1ZSggdHBBbmlTaXJHbG9iYWwgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJSU05pZSAgICAgICAgICBwUnNuSWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVXQVBJT3BhcXVlICpwRG90MTFmICkKK3sKKyAgICBpbnQgaWR4OworCisgICAgaWYgKCBwUnNuSWUtPmxlbmd0aCApCisgICAgeworICAgICAgICBpZiggMCA8PSAoIGlkeCA9IEZpbmRJRUxvY2F0aW9uKCBwTWFjLCBwUnNuSWUsIERPVDExRl9FSURfV0FQSSApICkgKQorICAgICAgICB7CisgICAgICAgIHBEb3QxMWYtPnByZXNlbnQgID0gMTsKKyAgICAgICAgcERvdDExZi0+bnVtX2RhdGEgPSBwUnNuSWUtPnJzbklFZGF0YVsgaWR4ICsgMSBdOworICAgICAgICB2b3NfbWVtX2NvcHkgKCBwRG90MTFmLT5kYXRhLAorICAgICAgICAgICAgICAgICAgICAgICBwUnNuSWUtPnJzbklFZGF0YSArIGlkeCArIDIsICAgIC8vIEVJRCwgbGVuCisgICAgICAgICAgICAgICAgICAgICAgIHBSc25JZS0+cnNuSUVkYXRhWyBpZHggKyAxIF0gKTsKKyAgICB9CisgICAgfQorCisgICAgcmV0dXJuIGVTSVJfU1VDQ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gRW5kIFBvcHVsYXRlRG90MTFmU1NJRDIuCisKK3ZvaWQKK1BvcHVsYXRlRG90MTFmU2NoZWR1bGUodFNpck1hY1NjaGVkdWxlSUUgKnBTY2hlZHVsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFU2NoZWR1bGUgKnBEb3QxMWYpCit7CisgICAgcERvdDExZi0+YWdncmVnYXRpb24gICAgICAgID0gcFNjaGVkdWxlLT5pbmZvLmFnZ3JlZ2F0aW9uOworICAgIHBEb3QxMWYtPnRzaWQgICAgICAgICAgICAgICA9IHBTY2hlZHVsZS0+aW5mby50c2lkOworICAgIHBEb3QxMWYtPmRpcmVjdGlvbiAgICAgICAgICA9IHBTY2hlZHVsZS0+aW5mby5kaXJlY3Rpb247CisgICAgcERvdDExZi0+cmVzZXJ2ZWQgICAgICAgICAgID0gcFNjaGVkdWxlLT5pbmZvLnJzdmQ7CisgICAgcERvdDExZi0+c2VydmljZV9zdGFydF90aW1lID0gcFNjaGVkdWxlLT5zdmNTdGFydFRpbWU7CisgICAgcERvdDExZi0+c2VydmljZV9pbnRlcnZhbCAgID0gcFNjaGVkdWxlLT5zdmNJbnRlcnZhbDsKKyAgICBwRG90MTFmLT5tYXhfc2VydmljZV9kdXIgICAgPSBwU2NoZWR1bGUtPm1heFN2Y0R1cmF0aW9uOworICAgIHBEb3QxMWYtPnNwZWNfaW50ZXJ2YWwgICAgICA9IHBTY2hlZHVsZS0+c3BlY0ludGVydmFsOworCisgICAgcERvdDExZi0+cHJlc2VudCA9IDE7Cit9IC8vIEVuZCBQb3B1bGF0ZURvdDExZlNjaGVkdWxlLgorCit2b2lkCitQb3B1bGF0ZURvdDExZlN1cHBDaGFubmVscyh0cEFuaVNpckdsb2JhbCAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVTdXBwQ2hhbm5lbHMgKnBEb3QxMWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IG5Bc3NvY1R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KQoreworICAgIHRBTklfVTggIGk7CisgICAgdEFOSV9VOCAqcDsKKworICAgIGlmIChuQXNzb2NUeXBlID09IExJTV9SRUFTU09DKQorICAgIHsKKyAgICAgICAgcCA9ICggdEFOSV9VOCogKXBzZXNzaW9uRW50cnktPnBMaW1SZUFzc29jUmVxLT5zdXBwb3J0ZWRDaGFubmVscy5jaGFubmVsTGlzdDsKKyAgICAgICAgcERvdDExZi0+bnVtX2JhbmRzID0gcHNlc3Npb25FbnRyeS0+cExpbVJlQXNzb2NSZXEtPnN1cHBvcnRlZENoYW5uZWxzLm51bUNobmw7CisgICAgfWVsc2UKKyAgICB7CisgICAgICAgIHAgPSAoIHRBTklfVTgqIClwc2Vzc2lvbkVudHJ5LT5wTGltSm9pblJlcS0+c3VwcG9ydGVkQ2hhbm5lbHMuY2hhbm5lbExpc3Q7CisgICAgICAgIHBEb3QxMWYtPm51bV9iYW5kcyA9IHBzZXNzaW9uRW50cnktPnBMaW1Kb2luUmVxLT5zdXBwb3J0ZWRDaGFubmVscy5udW1DaG5sOworICAgIH0KKyAgICBmb3IgKCBpID0gMFU7IGkgPCBwRG90MTFmLT5udW1fYmFuZHM7ICsraSwgKytwKQorICAgIHsKKyAgICAgICAgcERvdDExZi0+YmFuZHNbaV1bMF0gPSAqcDsKKyAgICAgICAgcERvdDExZi0+YmFuZHNbaV1bMV0gPSAxOworICAgIH0KKworICAgIHBEb3QxMWYtPnByZXNlbnQgPSAxOworCit9IC8vIEVuZCBQb3B1bGF0ZURvdDExZlN1cHBDaGFubmVscy4KKwordFNpclJldFN0YXR1cworUG9wdWxhdGVEb3QxMWZTdXBwUmF0ZXModHBBbmlTaXJHbG9iYWwgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgIG5DaGFubmVsTnVtLAorICA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ICAgICAgICBuUmF0ZXMgPSBwc2Vzc2lvbkVudHJ5LT5yYXRlU2V0Lm51bVJhdGVzOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCByYXRlcywgcHNlc3Npb25FbnRyeS0+cmF0ZVNldC5yYXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICBuUmF0ZXMpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgZG90MTFmTG9nKCBwTWFjLCBMT0dFLCBGTCgibm8gc2Vzc2lvbiBjb250ZXh0IGV4aXN0cyB3aGlsZSBwb3B1bGF0aW5nIE9wZXJhdGlvbmFsIFJhdGUgU2V0IikpOworICAgICAgICAgICAgblJhdGVzID0gMDsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmICggMTQgPj0gbkNoYW5uZWxOdW0gKQorICAgIHsKKyAgICAgICAgQ0ZHX0dFVF9TVFIoIG5TaXJTdGF0dXMsIHBNYWMsIFdOSV9DRkdfU1VQUE9SVEVEX1JBVEVTXzExQiwKKyAgICAgICAgICAgICAgICAgICAgIHJhdGVzLCBuUmF0ZXMsIFNJUl9NQUNfTUFYX05VTUJFUl9PRl9SQVRFUyApOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBDRkdfR0VUX1NUUiggblNpclN0YXR1cywgcE1hYywgV05JX0NGR19TVVBQT1JURURfUkFURVNfMTFBLAorICAgICAgICAgICAgICAgICAgICAgcmF0ZXMsIG5SYXRlcywgU0lSX01BQ19NQVhfTlVNQkVSX09GX1JBVEVTICk7CisgICAgfQorCisgICAgaWYgKCAwICE9IG5SYXRlcyApCisgICAgeworICAgICAgICBwRG90MTFmLT5udW1fcmF0ZXMgPSAoIHRBTklfVTggKW5SYXRlczsKKyAgICAgICAgdm9zX21lbV9jb3B5KCBwRG90MTFmLT5yYXRlcywgcmF0ZXMsIG5SYXRlcyApOworICAgICAgICBwRG90MTFmLT5wcmVzZW50ICAgPSAxOworICAgIH0KKworICAg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klfVTggKikmdGVtcF9yYXRlc2V0LnJhdGUsICZ2YWwpOworICAgICAgICAgICAgdGVtcF9yYXRlc2V0Lm51bVJhdGVzID0gKHRBTklfVTgpIHZhbDsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgICAgIHRlbXBfcmF0ZXNldC5udW1SYXRlcyA9IDA7CisgICAgfQorCisgICAgLyogSW5jbHVkZSAxMWEgcmF0ZXMgd2hlbiB0aGUgZGV2aWNlIGNvbmZpZ3VyZWQgaW4gbm9uLTExYiBtb2RlICovCisgICAgaWYgKCFJU19ET1QxMV9NT0RFXzExQihzZWxmX2RvdDExbW9kZSkpCisgICAgeworICAgICAgICAgICAgdmFsID0gV05JX0NGR19TVVBQT1JURURfUkFURVNfMTFBX0xFTjsKKyAgICAgICAgICAgIHdsYW5fY2ZnR2V0U3RyKHBfbWFjLCBXTklfQ0ZHX1NVUFBPUlRFRF9SQVRFU18xMUEsCisgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopJnRlbXBfcmF0ZXNldDIucmF0ZSwgJnZhbCk7CisgICAgICAgICAgICB0ZW1wX3JhdGVzZXQyLm51bVJhdGVzID0gKHRBTklfVTgpIHZhbDsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgICAgIHRlbXBfcmF0ZXNldDIubnVtUmF0ZXMgPSAwOworICAgIH0KKworICAgIGlmICgodGVtcF9yYXRlc2V0Lm51bVJhdGVzICsgdGVtcF9yYXRlc2V0Mi5udW1SYXRlcykgPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfTUFYX05VTUJFUl9PRl9SQVRFUykKKyAgICB7CisgICAgICAgICAgICBsaW1Mb2cocF9tYWMsIExPR1AsIEZMKCJtb3JlIHRoYW4gJWQgcmF0ZXMgaW4gQ0ZHIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfTUFYX05VTUJFUl9PRl9SQVRFUyk7CisgICAgICA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GVzLCB0ZW1wX3JhdGVzZXQucmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBwX3N1cHBfcmF0ZXMtPm51bV9yYXRlcyk7CisgICAgICAgICAgICBwX3N1cHBfcmF0ZXMtPnByZXNlbnQgPSAxOworICAgICAgICAgICAgcF9leHRfc3VwcF9yYXRlcy0+bnVtX3JhdGVzID0gdGVtcF9yYXRlc2V0Lm51bVJhdGVzIC0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BWF9OVU1fU1VQUE9SVEVEX1JBVEVTOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBfZXh0X3N1cHBfcmF0ZXMtPnJhdGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopdGVtcF9yYXRlc2V0LnJhdGUgKworICAgICAgICAgICAgICAgICAgICAgICAgIE1BWF9OVU1fU1VQUE9SVEVEX1JBVEVTLAorICAgICAgICAgICAgICAgICAgICAgICAgIHBfZXh0X3N1cHBfcmF0ZXMtPm51bV9yYXRlcyk7CisgICAgICAgICAgICBwX2V4dF9zdXBwX3JhdGVzLT5wcmVzZW50ID0gMTsKKyAgICB9CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworCit9IC8qIEVuZCBQb3B1bGF0ZURvdDExZlJhdGVzVGRscyAqLworCit0U2lyUmV0U3RhdHVzCitQb3B1bGF0ZURvdDExZlRQQ1JlcG9ydCh0cEFuaVNpckdsb2JhbCAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVUUENSZXBvcnQgKnBEb3QxMWYsCisgICAgICAgICAgICAgICAgICAgICAgICB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KQoreworICAgIHRBTklfVTE2IHN0YWlkLCB0eFBvd2VyOworICAgIHRTaXJSZXRTdGF0dXMgblNpclN0YXR1czsKKworICAgIG5TaXJTdGF0dXMgPSBsaW1HZXRNZ210U3RhaWQoIHBNYWMsICZzdGFpZCwgcHNlc3Npb25FbnRyeSk7CisgICAgaWYgKCBlU0lSX1NVQ0NFU1MgIT0gblNpclN0YXR1cyApCisgICAgeworICAgICAgICBkb3QxMWZMb2coIHBNYWMsIExPRzEsIEZMKCJGYWlsZWQgdG8gZ2V0IHRoZSBTVEFJRCBpbiBQb3B1bGF0IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJlRG90MTFmVFBDUmVwb3J0OyBsaW1HZXRNZ210U3RhaWQgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyZXR1cm5lZCBzdGF0dXMgJWQuIiksCisgICAgICAgICAgICAgICAgICAgblNpclN0YXR1cyApOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKworICAgIC8vIEZyYW1lc1RvRG86IFRoaXMgZnVuY3Rpb24gd2FzICJtaXNwbGFjZWQiIGluIHRoZSBtb3ZlIHRvIEdlbjRfVFZNLi4uCisgICAgLy8gdHhQb3dlciA9IGhhbEdldFJhdGVUb1B3clZhbHVlKCBwTWFjLCBzdGFpZCwgcE1hYy0+bGltLmdMaW1DdXJyZW50Q2hhbm5lbElkLCBpc0JlYWNvbiApOworICAgIHR4UG93ZXIgPSAwOworICAgIHBEb3QxMWYtPnR4X3Bvd2VyICAgID0gKCB0QU5JX1U4ICl0eFBvd2VyOworICAgIHBEb3QxMWYtPmxpbmtfbWFyZ2luID0gMDsKKyAgICBwRG90MTFmLT5wcmVzZW50ICAgICA9IDE7CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworfSAvLyBFbmQgUG9wdWxhdGVEb3QxMWZUUENSZXBvcnQuCisKKwordm9pZCBQb3B1bGF0ZURvdDExZlRTSW5mbyh0U2lyTWFjVFNJbmZvICAgKnBJbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmRmZUU0luZm8gKnBEb3QxMWYpCit7CisgICAgcERvdDExZi0+dHJhZmZpY190eXBlICAgPSBwSW5mby0+dHJhZmZpYy50cmFmZmljVHlwZTsKKyAgICBwRG90MTFmLT50c2lkICAgICAgICAgICA9IHBJbmZvLT50cmFmZmljLnRzaWQ7CisgICAgcERvdDExZi0+ZGlyZWN0aW9uICAgICAgPSBwSW5mby0+dHJhZmZpYy5kaXJlY3Rpb247CisgICAgcERvdDExZi0+YWNjZXNzX3BvbGljeSAgPSBwSW5mby0+dHJhZmZpYy5hY2Nlc3NQb2xpY3k7CisgICAgcERvdDExZi0+YWdncmVnYXRpb24gICAgPSBwSW5mby0+dHJhZmZpYy5hZ2dyZWdhdGlvbjsKKyAgICBwRG90MTFmLT5wc2IgICAgICAgICAgICA9IHBJbmZvLT50cmFmZmljLnBzYjsKKyAgICBwRG90MTFmLT51c2VyX3ByaW9yaXR5ICA9IHBJbmZvLT50cmFmZmljLnVzZXJQcmlvOworICAgIHBEb3QxMWYtPnRzaW5mb19hY2tfcG9sID0gcEluZm8tPnRyYWZmaWMuYWNrUG9saWN5OworICAgIHBEb3QxMWYtPnNjaGVkdWxlICAgICAgID0gcEluZm8tPnNjaGVkdWxlLnNjaGVkdWxlOworfSAvLyBFbmQgUG9wdWxhdGVkRG90MTFmVFNJbmZvLgorCit2b2lkIFBvcHVsYXRlRG90MTFmV01NKHRwQW5pU2lyR2xvYmFsICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFV01NSW5mb0FwICAqcEluZm8sCisgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdNTVBhcmFtcyAqcFBhcmFtcywKKyAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFV01NQ2FwcyAgICpwQ2FwcywKKyAgICAgICAgICAgICAgICAgICAgICAgdHBQRVNlc3Npb24gICAgICAgIHBzZXNzaW9uRW50cnkpCit7CisgICAgaWYgKCBwc2Vzc2lvbkVudHJ5LT5saW1XbWVFbmFibGVkICkKKyAgICB7CisgICAgICAgIGlmICggZUxJTV9TVEFfSU5fSUJTU19ST0xFID09IHBzZXNzaW9uRW50cnktPmxpbVN5c3RlbVJvbGUgKQorICAgICAgICB7CisgICAgICAgICAgICAvL2lmICggISBzaXJJc1Byb3BDYXBhYmlsaXR5RW5hYmxlZCggcE1hYywgU0lSX01BQ19QUk9QX0NBUEFCSUxJVFlfV01FICkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFBvcHVsYXRlRG90MTFmV01NSW5mb0FwKCBwTWFjLCBwSW5mbywgcHNlc3Npb25FbnRyeSApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFBvcHVsYXRlRG90MTFmV01NUGFyYW1zKCBwTWFjLCBwUGFyYW1zLCBwc2Vzc2lvbkVudHJ5KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICBpZiAoIHBzZXNzaW9uRW50cnktPmxpbVdzbUVuYWJsZWQgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFBvcHVsYXRlRG90MTFmV01NQ2FwcyggcENhcHMgKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KK30gLy8gRW5kIFBvcHVsYXRlRG90MTFmV01NLgorCit2b2lkIFBvcHVsYXRlRG90MTFmV01NQ2Fwcyh0RG90MTFmSUVXTU1DYXBzICpwQ2FwcykKK3sKKyAgICBwQ2Fwcy0+dmVyc2lvbiAgICAgICA9IFNJUl9NQUNfT1VJX1ZFUlNJT05fMTsKKyAgICBwQ2Fwcy0+cWFjayAgICAgICAgICA9IDA7CisgICAgcENhcHMtPnF1ZXVlX3JlcXVlc3QgPSAxOworICAgIHBDYXBzLT50eG9wX3JlcXVlc3QgID0gMDsKKyAgICBwQ2Fwcy0+bW9yZV9hY2sgICAgICA9IDA7CisgICAgcENhcHMtPnByZXNlbnQgICAgICAgPSAxOworfSAvLyBFbmQgUG9wdWxhdGVEb3QxMWZXbW1DYXBzLgorCisjaWZkZWYgRkVBVFVSRV9XTEFOX0V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c3BlY0ludGVydmFsOworCisgICAgcERvdDExZi0+cHJlc2VudCA9IDE7Cit9IC8vIEVuZCBQb3B1bGF0ZURvdDExZldNTVNjaGVkdWxlLgorCit0U2lyUmV0U3RhdHVzCitQb3B1bGF0ZURvdDExZldQQSh0cEFuaVNpckdsb2JhbCAgcE1hYywKKyAgICAgICAgICAgICAgICAgIHRwU2lyUlNOaWUgICAgICBwUnNuSWUsCisgICAgICAgICAgICAgICAgICB0RG90MTFmSUVXUEEgICAqcERvdDExZikKK3sKKyAgICB0QU5JX1UzMiAgICAgICAgc3RhdHVzOworICAgIGludCBpZHg7CisKKyAgICBpZiAoIHBSc25JZS0+bGVuZ3RoICkKKyAgICB7CisgICAgICAgIGlmKCAwIDw9ICggaWR4ID0gRmluZElFTG9jYXRpb24oIHBNYWMsIHBSc25JZSwgRE9UMTFGX0VJRF9XUEEgKSApICkKKyAgICAgICAgeworICAgICAgICBzdGF0dXMgPSBkb3QxMWZVbnBhY2tJZVdQQSggcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSc25JZS0+cnNuSUVkYXRhICsgaWR4ICsgMiArIDQsICAvLyBFSUQsIGxlbmd0aCwgT1VJCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnNuSWUtPnJzbklFZGF0YVsgaWR4ICsgMSBdIC0gNCwgLy8gT1VJCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRG90MTFmICk7CisgICAgICAgIGlmICggRE9UMTFGX0ZBSUxFRCggc3RhdHVzICkgKQorICAgICAgICB7CisgICAgICAgICAgICBkb3QxMWZMb2coIHBNYWMsIExPR0UsIEZMKCJQYXJzZSBmYWlsdXJlIGluIFBvcHVsYXRlRG90MTFmV1AiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJBICgweCUwOHgpLiIpLAorICAgICAgICAgICAgICAgICAgICBzdGF0dXMgKTsKKyAgICAgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgICAgIH0KKyAgICB9CisgICAgfQorCisgICAgcmV0dXJuIGVTSVJfU1VDQ0VTUzsKK30gLy8gRW5kIFBvcHVsYXRlRG90MTFmV1BBLgorCisKKwordFNpclJldFN0YXR1cyBQb3B1bGF0ZURvdDExZldQQU9wYXF1ZSggdHBBbmlTaXJHbG9iYWwgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJSU05pZSAgICAgICAgICBwUnNuSWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVXUEFPcGFxdWUgKnBEb3QxMWYgKQoreworICAgIGludCBpZHg7CisKKyAgICBpZiAoIHBSc25JZS0+bGVuZ3RoICkKKyAgICB7CisgICAgICAgIGlmKCAwIDw9ICggaWR4ID0gRmluZElFTG9jYXRpb24oIHBNYWMsIHBSc25JZSwgRE9UMTFGX0VJRF9XUEEgKSApICkKKyAgICAgICAgeworICAgICAgICBwRG90MTFmLT5wcmVzZW50ICA9IDE7CisgICAgICAgIHBEb3QxMWYtPm51bV9kYXRhID0gcFJzbkllLT5yc25JRWRhdGFbIGlkeCArIDEgXSAtIDQ7CisgICAgICAgIHZvc19tZW1fY29weSggIHBEb3QxMWYtPmRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgIHBSc25JZS0+cnNuSUVkYXRhICsgaWR4ICsgMiArIDQsICAgIC8vIEVJRCwgbGVuLCBPVUkKKyAgICAgICAgICAgICAgICAgICAgICAgcFJzbkllLT5yc25JRWRhdGFbIGlkeCArIDEgXSAtIDQgKTsgLy8gT1VJCisgICAgfQorICAgIH0KKworICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7CisKK30gLy8gRW5kIFBvcHVsYXRlRG90MTFmV1BBT3BhcXVlLgorCisvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KKwordFNpclJldFN0YXR1cworc2lyR2V0Q2ZnUHJvcENhcHModHBBbmlTaXJHbG9iYWwgcE1hYywgdEFOSV9VMTYgKmNhcHMpCit7CisjaWYgMAorICAgIHRBTklfVTMyIHZhbDsKKworICAgICpjYXBzID0gMDsKKyAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19QUk9QUklFVEFSWV9BTklfRkVBVFVSRVNfRU5BQkxFRCwgJnZhbCkKKyAgICAgICAgIT0gZVNJUl9TVUNDRVNTKQorICAgIHsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJjb3VsZCBub3QgcmV0cmlldmUgUHJvcEZlYXR1cmUgZW5hYmxlZCBmbGFnIikpOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKyAgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19QUk9QX0NBUEFCSUxJVFksICZ2YWwpICE9IGVTSVJfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiY291bGQgbm90IHJldHJpZXZlIFBST1BfQ0FQQUJMSVRZIGZsYWciKSk7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorCisgICAgKmNhcHMgPSAodEFOSV9VMTYpIHZhbDsKKyNlbmRpZgorICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7Cit9CisKK3RTaXJSZXRTdGF0dXMKK3NpckNvbnZlcnRQcm9iZVJlcUZyYW1lMlN0cnVjdCh0cEFuaVNpckdsb2JhbCAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICAgICAgICAgICAgICpwRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgICAgICAgICAgICAgbkZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyUHJvY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nJhbWUpOykKKyAgICB9CisKKyAgICAvLyAmICJ0cmFuc2xpdGVyYXRlIiBmcm9tIGEgJ3REb3QxMWZQcm9iZVJlcXVlc3R0bycgYSAndFNpclByb2JlUmVxJy4uLgorICAgIGlmICggISBwci5TU0lELnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgUEVMT0dXKGxpbUxvZyhwTWFjLCBMT0dXLCBGTCgiTWFuZGF0b3J5IElFIFNTSUQgbm90IHByZXNlbnQhIikpOykKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgcFByb2JlUmVxLT5zc2lkUHJlc2VudCA9IDE7CisgICAgICAgIENvbnZlcnRTU0lEKCBwTWFjLCAmcFByb2JlUmVxLT5zc0lkLCAmcHIuU1NJRCApOworICAgIH0KKworICAgIGlmICggISBwci5TdXBwUmF0ZXMucHJlc2VudCApCisgICAgeworICAgICAgICBQRUxPR1cobGltTG9nKHBNYWMsIExPR1csIEZMKCJNYW5kYXRvcnkgSUUgU3VwcG9ydGVkIFJhdGVzIG5vdCBwcmVzZW50ISIpKTspCisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHBQcm9iZVJlcS0+c3VwcFJhdGVzUHJlc2VudCA9IDE7CisgICAgICAgIENvbnZlcnRTdXBwUmF0ZXMoIHBNYWMsICZwUHJvYmVSZXEtPnN1cHBvcnRlZFJhdGVzLCAmcHIuU3VwcFJhdGVzICk7CisgICAgfQorCisgICAgaWYgKCBwci5FeHRTdXBwUmF0ZXMucHJlc2VudCApCisgICAgeworICAgICAgICBwUHJvYmVSZXEtPmV4dGVuZGVkUmF0ZXNQcmVzZW50ID0gMTsKKyAgICAgICAgQ29udmVydEV4dFN1cHBSYXRlcyggcE1hYywgJnBQcm9iZVJlcS0+ZXh0ZW5kZWRSYXRlcywgJnByLkV4dFN1cHBSYXRlcyApOworICAgIH0KKworICAgIGlmICggcHIuSFRDYXBzLnByZXNlbnQ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GVuZ3RoIGFuZCBkYXRhLiBUYWcgbGVuZ3RoIGluZGljYXRlcworICogdGhlIHNpemUgb2YgZGF0YSBpbiBieXRlcy4KKyAqIFRoaXMgZnVuY3Rpb24gY2hlY2tzIGZvciBzaXplIG9mIEZyYW1lIHJlY2l2ZWQgd2l0aCB0aGUgc3VtIG9mIGFsbCBJRXMuCisgKiBBbmQgYWxzbyByZWN0aWZpZXMgbWlzc2luZyBvcHRpb25hbCBmaWVsZHMgaW4gSUUuCisgKgorICogTk9URSA6IFByZXNlbnRseSB0aGlzIGZ1bmN0aW9uIHJlY3RpZmllcyBSU04gY2FwYWJpbGl0eSBpbiBSU04gSUUsIGNhbgorICogZXh0ZW5kZWQgdG8gcmVjdGlmeSBvdGhlciBvcHRpb25hbCBmaWVsZHMgaW4gb3RoZXIgSUVzLgorICoKKyAqLwordFNpclJldFN0YXR1cyBWYWxpZGF0ZUFuZFJlY3RpZnlJRXModHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBNZ210RnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBuRnJhbWVCeXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICpuTWlzc2luZ1JzbkJ5dGVzKQoreworICAgIHRBTklfVTMyIGxlbmd0aCA9IFNJWkVfT0ZfRklYRURfUEFSQU07CisgICAgdEFOSV9VOCAqcmVmRnJhbWU7CisKKyAgICAvLyBGcmFtZSBjb250YWlucyBhdGxlYXN0IG9uZSBJRQorICAgIGlmIChuRnJhbWVCeXRlcyA+IChTSVpFX09GX0ZJWEVEX1BBUkFNICsgMikpCisgICAgeworICAgICAgICB3aGlsZSAobGVuZ3RoIDwgbkZyYW1lQnl0ZXMpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qcmVmRnJhbWUgcG9pbnRzIHRvIG5leHQgSUUgKi8KKyAgICAgICAgICAgIHJlZkZyYW1lID0gcE1nbXRGcmFtZSArIGxlbmd0aDsKKyAgICAgICAgICAgIGxlbmd0aCArPSAodEFOSV9VMzIpKFNJWkVfT0ZfVEFHX1BBUkFNX05VTSArIFNJWkVfT0ZfVEFHX1BBUkFNX0xFTgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAoKihyZWZGcmFtZSArIFNJWkVfT0ZfVEFHX1BBUkFNX05VTSkpKTsKKyAgICAgICAgfQorICAgICAgICBpZiAobGVuZ3RoICE9IG5GcmFtZUJ5dGVzKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBXb3JrYXJvdW5kIDogU29tZSBBUHMgbWF5IG5vdCBpbmNsdWRlIFJTTiBDYXBhYmlsaXR5IGJ1dAorICAgICAgICAgICAgICogdGhlIGxlbmd0aCBvZiB3aGljaCBpcyBpbmNsdWRlZCBpbiBSU04gSUUgbGVuZ3RoLgorICAgICAgICAgICAgICogdGhpcyBtYXkgY2F1c2UgaW4gdXBkYXRpbmcgUlNOIENhcGFiaWxpdHkgd2l0aCBqdW5rIHZhbHVlLgorICAgICAgICAgICAgICogVG8gYXZvaWQgdGhpcywgYWRkIFJTTiBDYXBhYmlsaXR5IHZhbHVlIHdpdGggZGVmYXVsdCB2YWx1ZS4KKyAgICAgICAgICAgICAqIEdvaW5nIGZ1cnRoZXIgd2UgY2FuIGhhdmUgc3VjaCB3b3JrYXJvdW5kIGZvciBvdGhlciBJRXMKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgaWYgKCgqcmVmRnJhbWUgPT0gUlNOSUVJRCkgJiYKKyAgICAgICAgICAgICAgICAobGVuZ3RoID09IChuRnJhbWVCeXRlcyArIFJTTklFX0NBUEFCSUxJVFlfTEVOKSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9Bc3N1bWUgUlNOIENhcGFiaWxpdHkgYXMgMDAKKyAgICAgICAgICAgICAgICB2b3NfbWVtX3NldCggKCB0QU5JX1U4KiApIChwTWdtdEZyYW1lICsgKG5GcmFtZUJ5dGVzKSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJTTklFX0NBUEFCSUxJVFlfTEVOLCBERUZBVUxUX1JTTklFX0NBUF9WQUwgKTsKKyAgICAgICAgICAgICAgICAqbk1pc3NpbmdSc25CeXRlcyA9IFJTTklFX0NBUEFCSUxJVFlfTEVOOworICAgICAgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgICAgICAgICBGTCgiQWRkZWQgUlNOIENhcGFiaWxpdHkgdG8gdGhlIFJTTklFIGFzIDB4MDAgMHgwMCIpKTsKKworICAgICAgICAgICAgICAgIHJldHVybiBlSEFMX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gZUhBTF9TVEFUVVNfU1VDQ0VTUzsKK30KKwordFNpclJldFN0YXR1cyBzaXJDb252ZXJ0UHJvYmVGcmFtZTJTdHJ1Y3QodHBBbmlTaXJHbG9iYWwgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggICAgICAgICAgICAgKnBGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICAgICAgICAgICAgIG5GcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyUHJvYmVSZXNwQmVhY29uIHBQcm9iZVJlc3ApCit7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgc3RhdHVzOworICAgIHREb3QxMWZQcm9iZVJlc3BvbnNlICpwcjsKKworICAgIC8vIE9rLCB6ZXJvLWluaXQgb3VyIFtvdXRdIHBhcmFtZXRlciwKKyAgICB2b3NfbWVtX3NldCggKCB0QU5JX1U4KiApcFByb2J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wTWFjLCAmcFByb2JlUmVzcC0+ZXh0ZW5kZWRSYXRlcywgJnByLT5FeHRTdXBwUmF0ZXMgKTsKKyAgICB9CisKKworICAgIGlmICggcHItPkNGUGFyYW1zLnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgcFByb2JlUmVzcC0+Y2ZQcmVzZW50ID0gMTsKKyAgICAgICAgQ29udmVydENGUGFyYW1zKCBwTWFjLCAmcFByb2JlUmVzcC0+Y2ZQYXJhbVNldCwgJnByLT5DRlBhcmFtcyApOworICAgIH0KKworICAgIGlmICggcHItPkNvdW50cnkucHJlc2VudCApCisgICAgeworICAgICAgICBwUHJvYmVSZXNwLT5jb3VudHJ5SW5mb1ByZXNlbnQgPSAxOworICAgICAgICBDb252ZXJ0Q291bnRyeSggcE1hYywgJnBQcm9iZVJlc3AtPmNvdW50cnlJbmZvUGFyYW0sICZwci0+Q291bnRyeSApOworICAgIH0KKworICAgIGlmICggcHItPkVEQ0FQYXJhbVNldC5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHBQcm9iZVJlc3AtPmVkY2FQcmVzZW50ID0gMTsKKyAgICAgICAgQ29udmVydEVEQ0FQYXJhbSggcE1hYywgJnBQcm9iZVJlc3AtPmVkY2FQYXJhbXMsICZwci0+RURDQVBhcmFtU2V0ICk7CisgICAgfQorCisgICAgaWYgKCBwci0+Q2hhblN3aXRjaEFubi5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHBQcm9iZVJlc3AtPmNoYW5uZWxTd2l0Y2hQcmVzZW50ID0gMTsKKyAgICAgICAgdm9zX21lbV9jb3B5KCAmcFByb2JlUmVzcC0+Y2hhbm5lbFN3aXRjaElFLCAmcHItPkNoYW5Td2l0Y2hBbm4sCisgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0RG90MTFmSUVFeHRDaGFuU3dpdGNoQW5uKSApOworICAgIH0KKworICAgICAgIGlmICggcHItPkV4dENoYW5Td2l0Y2hBbm4ucHJlc2VudCApCisgICAgeworICAgICAgICBwUHJvYmVSZXNwLT5leHRDaGFubmVsU3dpdGNoUHJlc2VudCA9IDE7CisgICAgICAgIHZvc19tZW1fY29weSAoICZwUHJvYmVSZXNwLT5leHRDaGFubmVsU3dpdGNoSUUsICZwci0+RXh0Q2hhblN3aXRjaEFubiwKKyAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHREb3QxMWZJRUV4dENoYW5Td2l0Y2hBbm4pICk7CisgICAgfQorCisgICAgaWYoIHByLT5UUENSZXBvcnQucHJlc2VudCkKKyAgICB7CisgICAgICAgIHBQcm9iZVJlc3AtPnRwY1JlcG9ydFByZXNlbnQgPSAxOworICAgICAgICB2b3NfbWVtX2NvcHkoICZwUHJvYmVSZXNwLT50cGNSZXBvcnQsICZwci0+VFBDUmVwb3J0LCBzaXplb2YodERvdDExZklFVFBDUmVwb3J0KSk7CisgICAgfQorCisgICAgaWYoIHByLT5Qb3dlckNvbnN0cmFpbnRzLnByZXNlbnQpCisgICAgeworICAgICAgICBwUHJvYmVSZXNwLT5wb3dlckNvbnN0cmFpbnRQcmVzZW50ID0gMTsKKyAgICAgICAgdm9zX21lbV9jb3B5KCAmcFByb2JlUmVzcC0+bG9jYWxQb3dlckNvbnN0cmFpbnQsICZwci0+UG93ZXJDb25zdHJhaW50cywKKyAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodERvdDExZklFUG93ZXJDb25zdHJhaW50cykpOworICAgIH0KKworICAgIGlmICggcHItPlF1aWV0LnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgcFByb2JlUmVzcC0+cXVpZXRJRVByZXNlbnQgPSAxOworICAgICAgICB2b3NfbWVtX2NvcHkoICZwUHJvYmVSZXNwLT5xdWlldElFLCAmcHItPlF1aWV0LCBzaXplb2YodERvdDExZklFUXVpZXQpICk7CisgICAgfQorCisgICAgaWYgKCBwci0+SFRDYXBzLnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9jb3B5KCAmcFByb2JlUmVzcC0+SFRDYXBzLCAmcHItPkhUQ2Fwcywgc2l6ZW9mKCB0RG90MTFmSUVIVENhcHMgKSApOworICAgIH0KKworICAgIGlmICggcHItPkhUSW5mby5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHZvc19tZW1fY29weSggJnBQcm9iZVJlc3AtPkhUSW5mbywgJnByLT5IVEluZm8sIHNpemVvZiggdERvdDExZklFSFRJbmZvICkgKTsKKyAgICB9CisKKyAgICBpZiAoIHByLT5EU1BhcmFtcy5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHBQcm9iZVJlc3AtPmRzUGFyYW1zUHJlc2VudCA9IDE7CisgICAgICAgIHBQcm9iZVJlc3AtPmNoYW5uZWxOdW1iZXIgPSBwci0+RFNQYXJhbXMuY3Vycl9jaGFubmVsOworICAgIH0KKyAgICBlbHNlIGlmKHByLT5IVEluZm8ucHJlc2VudCkKKyAgICB7CisgICAgICAgIHBQcm9iZVJlc3AtPmNoYW5uZWxOdW1iZXIgPSBwci0+SFRJbmZvLnByaW1hcnlDaGFubmVsOworICAgIH0KKworICAgIGlmICggcHItPlJTTk9wYXF1ZS5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHBQcm9iZVJlc3AtPnJzblByZXNlbnQgPSAxOworICAgICAgICBDb252ZXJ0UlNOT3BhcXVlKCBwTWFjLCAmcFByb2JlUmVzcC0+cnNuLCAmcHItPlJTTk9wYXF1ZSApOworICAgIH0KKworICAgIGlmICggcHItPldQQS5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHBQcm9iZVJlc3AtPndwYVByZXNlbnQgPSAxOworICAgICAgICBDb252ZXJ0V1BBKCBwTWFjLCAmcFByb2JlUmVzcC0+d3BhLCAmcHItPldQQSApOworICAgIH0KKworICAgIGlmICggcHItPldNTVBhcmFtcy5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHBQcm9iZVJlc3AtPndtZUVkY2FQcmVzZW50ID0gMTsKKyAgICAgICAgQ29udmVydFdNTVBhcmFtcyggcE1hYywgJnBQcm9iZVJlc3AtPmVkY2FQYXJhbXMsICZwci0+V01NUGFyYW1zICk7CisgICAgICAgIFBFTE9HMShsaW1Mb2cocE1hYywgTE9HMSwgRkwoIldNTSBQYXJhbWV0ZXIgcHJlc2VudCBpbiBQcm9iZSBSZXNwb25zZSBGcmFtZSEiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fcHJpbnRXTU1QYXJhbXMocE1hYywgJnByLT5XTU1QYXJhbXMpOykKKyAgICB9CisKKyAgICBpZiAoIHByLT5XTU1JbmZvQXAucHJlc2VudCApCisgICAgeworICAgICAgICBwUHJvYmVSZXNwLT53bWVJbmZvUHJlc2VudCA9IDE7CisgICAgICAgIFBFTE9HMShsaW1Mb2cocE1hYywgTE9HMSwgRkwoIldNTSBJbmZvcm1hdGlvbiBFbGVtZW50IHByZXNlbnQgaW4gUHJvYmUgUmVzcG9uc2UgRnJhbWUhIikpOykKKyAgICB9CisKKyAgICBpZiAoIHByLT5XTU1DYXBzLnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgcFByb2JlUmVzcC0+d3NtQ2FwYWJsZVByZXNlbnQgPSAxOworICAgIH0KKworCisgICAgaWYgKCBwci0+RVJQSW5mby5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHBQcm9iZVJlc3AtPmVycFByZXNlbnQgPSAxOworICAgICAgICBDb252ZXJ0RVJQSW5mbyggcE1hYywgJnBQcm9iZVJlc3AtPmVycElFSW5mbywgJnByLT5FUlBJbmZvICk7CisgICAgfQorCisjaWZkZWYgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIKKyAgICBpZiAocHItPk1vYmlsaXR5RG9tYWluLnByZXNlbnQpCisgICAgeworICAgICAgICAvLyBNb2JpbGl0eURvbWFpbgorICAgICAgICBwUHJvYmVSZXNwLT5tZGllUHJlc2VudCA9IDE7CisgICAgICAgIHZvc19tZW1fY29weSggKHRBTklfVTggKikmKHBQcm9iZVJlc3AtPm1kaWVbMF0pLCAodEFOSV9VOCA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ZXNlbnQgKQorICAgIHsKKyAgICAgICB2b3NfbWVtX2NvcHkoICZwUHJvYmVSZXNwLT5WSFRDYXBzLCAmcHItPlZIVENhcHMsIHNpemVvZiggdERvdDExZklFVkhUQ2FwcyApICk7CisgICAgfQorICAgIGlmICggcHItPlZIVE9wZXJhdGlvbi5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHZvc19tZW1fY29weSggJnBQcm9iZVJlc3AtPlZIVE9wZXJhdGlvbiwgJnByLT5WSFRPcGVyYXRpb24sIHNpemVvZiggdERvdDExZklFVkhUT3BlcmF0aW9uKSApOworICAgIH0KKyAgICBpZiAoIHByLT5WSFRFeHRCc3NMb2FkLnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9jb3B5KCAmcFByb2JlUmVzcC0+VkhURXh0QnNzTG9hZCwgJnByLT5WSFRFeHRCc3NMb2FkLCBzaXplb2YoIHREb3QxMWZJRVZIVEV4dEJzc0xvYWQpICk7CisgICAgfQorI2VuZGlmCisKKyAgICB2b3NfbWVtX3ZmcmVlKHByKTsKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworCit9IC8vIEVuZCBzaXJDb252ZXJ0UHJvYmVGcmFtZTJTdHJ1Y3QuCisKK3RTaXJSZXRTdGF0dXMKK3NpckNvbnZlcnRBc3NvY1JlcUZyYW1lMlN0cnVjdCh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggICAgICAgICAgICAqcEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICAgICAgICAgICAgbkZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyQXNzb2NSZXEgIHBBc3NvY1JlcSkKK3sKKyAgICB0RG90MTFmQXNzb2NSZXF1ZXN0ICphcjsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICAgc3RhdHVzOworCisgICAgYXIgPSB2b3Nfb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JlcS0+cW9zQ2FwYWJpbGl0eVByZXNlbnQgPSAxOworICAgICAgICBDb252ZXJ0UU9TQ2Fwc1N0YXRpb24oIHBNYWMsICZwQXNzb2NSZXEtPnFvc0NhcGFiaWxpdHksICZhci0+UU9TQ2Fwc1N0YXRpb24gKTsKKyAgICB9CisKKyAgICAvLyBXUEEKKyAgICBpZiAoIGFyLT5XUEFPcGFxdWUucHJlc2VudCApCisgICAgeworICAgICAgICBwQXNzb2NSZXEtPndwYVByZXNlbnQgPSAxOworICAgICAgICBDb252ZXJ0V1BBT3BhcXVlKCBwTWFjLCAmcEFzc29jUmVxLT53cGEsICZhci0+V1BBT3BhcXVlICk7CisgICAgfQorCisgICAgLy8gUlNOCisgICAgaWYgKCBhci0+UlNOT3BhcXVlLnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgcEFzc29jUmVxLT5yc25QcmVzZW50ID0gMTsKKyAgICAgICAgQ29udmVydFJTTk9wYXF1ZSggcE1hYywgJnBBc3NvY1JlcS0+cnNuLCAmYXItPlJTTk9wYXF1ZSApOworICAgIH0KKworICAgIC8vIFdTQyBJRQorICAgIGlmIChhci0+V3NjSUVPcGFxdWUucHJlc2VudCkgCisgICAgeworICAgICAgICBwQXNzb2NSZXEtPmFkZElFUHJlc2VudCA9IDE7CisgICAgICAgIENvbnZlcnRXc2NPcGFxdWUocE1hYywgJnBBc3NvY1JlcS0+YWRkSUUsICZhci0+V3NjSUVPcGFxdWUpOworICAgIH0KKyAgICAKKworICAgIGlmKGFyLT5QMlBJRU9wYXF1ZS5wcmVzZW50KQorICAgIHsKKyAgICAgICAgcEFzc29jUmVxLT5hZGRJRVByZXNlbnQgPSAxOworICAgICAgICBDb252ZXJ0UDJQT3BhcXVlKCBwTWFjLCAmcEFzc29jUmVxLT5hZGRJRSwgJmFyLT5QMlBJRU9wYXF1ZSk7CisgICAgfQorI2lmZGVmIFdMQU5fRkVBVFVSRV9XRkQKKyAgICBpZihhci0+V0ZESUVPcGFxdWUucHJlc2VudCkKKyAgICB7CisgICAgICAgIHBBc3NvY1JlcS0+YWRkSUVQcmVzZW50ID0gMTsKKyAgICAgICAgQ29udmVydFdGRE9wYXF1ZSggcE1hYywgJnBBc3NvY1JlcS0+YWRkSUUsICZhci0+V0ZESUVPcGFxdWUpOworICAgIH0KKyNlbmRpZgorCisgICAgLy8gUG93ZXIgQ2FwYWJpbGl0aWVzCisgICAgaWYgKCBhci0+UG93ZXJDYXBzLnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgcEFzc29jUmVxLT5wb3dlckNhcGFiaWxpdHlQcmVzZW50ICAgICA9IDE7CisgICAgICAgIENvbnZlcnRQb3dlckNhcHMoIHBNYWMsICZwQXNzb2NSZXEtPnBvd2VyQ2FwYWJpbGl0eSwgJmFyLT5Qb3dlckNhcHMgKTsKKyAgICB9CisKKyAgICAvLyBTdXBwb3J0ZWQgQ2hhbm5lbHMKKyAgICBpZiAoIGFyLT5TdXBwQ2hhbm5lbHMucHJlc2VudCApCisgICAgeworICAgICAgICBwQXNzb2NSZXEtPnN1cHBvcnRlZENoYW5uZWxzUHJlc2VudCA9IDE7CisgICAgICAgIENvbnZlcnRTdXBwQ2hhbm5lbHMoIHBNYWMsICZwQXNzb2NSZXEtPnN1cHBvcnRlZENoYW5uZWxzLCAmYXItPlN1cHBDaGFubmVscyApOworICAgIH0KKworICAgIGlmICggYXItPkhUQ2Fwcy5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHZvc19tZW1fY29weSggJnBBc3NvY1JlcS0+SFRDYXBzLCAmYXItPkhUQ2Fwcywgc2l6ZW9mKCB0RG90MTFmSUVIVENhcHMgKSApOworICAgIH0KKworICAgIGlmICggYXItPldNTUluZm9TdGF0aW9uLnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgcEFzc29jUmVxLT53bWVJbmZvUHJlc2VudCA9IDE7CisgICAgICAgIHZvc19tZW1fY29weSggJnBBc3NvY1JlcS0+V01NSW5mb1N0YXRpb24sICZhci0+V01NSW5mb1N0YXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCB0RG90MTFmSUVXTU1JbmZvU3RhdGlvbiApICk7CisKKyAgICB9CisKKworICAgIGlmICggYXItPldNTUNhcHMucHJlc2VudCApIHBBc3NvY1JlcS0+d3NtQ2FwYWJsZVByZXNlbnQgPSAxOworCisgICAgaWYgKCAhIHBBc3NvY1JlcS0+c3NpZFByZXNlbnQgKQorICAgIHsKKyAgICAgICAgUEVMT0cyKGxpbUxvZyhwTWFjLCBMT0cyLCBGTCgiUmVjZWl2ZWQgQXNzb2Mgd2l0aG91dCBTU0lEIElFLiIpKTspCisgICAgICAgIHZvc19tZW1fZnJlZShhcik7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorCisgICAgaWYgKCAhcEFzc29jUmVxLT5zdXBwUmF0ZXNQcmVzZW50ICYmICFwQXNzb2NSZXEtPmV4dGVuZGVkUmF0ZXNQcmVzZW50ICkKKyAgICB7CisgICAgICAgIFBFTE9HMihsaW1Mb2cocE1hYywgTE9HMiwgRkwoIlJlY2VpdmVkIEFzc29jIHdpdGhvdXQgc3VwcCByYXRlIElFLiIpKTspCisgICAgICAgIHZvc19tZW1fZnJlZShhcik7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExQUMKKyAgICBpZiAoIGFyLT5WSFRDYXBzLnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9jb3B5KCAmcEFzc29jUmVxLT5WSFRDYXBzLCAmYXItPlZIVENhcHMsIHNpemVvZiggdERvdDExZklFVkhUQ2FwcyApICk7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HVywgRkwoIlJlY2VpdmVkIEFzc29jIFJlcSB3aXRoIFZIVCBDYXAiKSk7CisgICAgICAgIGxpbUxvZ1ZIVENhcCggcE1hYywgJnBBc3NvY1JlcS0+VkhUQ2Fwcyk7CisgICAgfQorICAgIGlmICggYXItPk9wZXJhdGluZ01vZGUucHJlc2VudCApCisgICAgeworICAgICAgICB2b3NfbWVtX2NvcHkoICZwQXNzb2NSZXEtPm9wZXJNb2RlLCAmYXItPk9wZXJhdGluZ01vZGUsIHNpemVvZiAodERvdDExZklFT3BlcmF0aW5nTW9kZSkpOworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csIEZMKCJSZWNlaXZlZCBBc3NvYyBSZXEgd2l0aCBPcGVyYXRpbmcgTW9kZSBJRSIpKTsKKyAgICAgICAgbGltTG9nT3BlcmF0aW5nTW9kZSggcE1hYywgJnBBc3NvY1JlcS0+b3Blck1vZGUpOworICAgIH0KKyNlbmRpZgorICAgIHZvc19tZW1fZnJlZShhcik7CisgICAgcmV0dXJuIGVTSVJfU1VDQ0VTUzsKKworfSAvLyBFbmQgc2lyQ29udmVydEFzc29jUmVxRnJhbWUyU3RydWN0LgorCit0U2lyUmV0U3RhdHVzCitzaXJDb252ZXJ0QXNzb2NSZXNwRnJhbWUyU3RydWN0KHRwQW5pU2lyR2xvYmFsIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggICAgICAgICAgICAqcEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAgICAgICAgICAgIG5GcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJBc3NvY1JzcCAgcEFzc29jUnNwKQoreworICAgIHN0YXRpYyB0RG90MTFmQXNzb2NSZXNwb25zZSBhcjsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICAgIHN0YXR1czsKKyAgICB0QU5JX1U4ICBjbnQgPTA7CisKKyAgICAvLyBaZXJvLWluaXQgb3VyIFtvdXRdIHBhcmFtZXRlciwKKyAgICB2b3NfbWVtX3NldCggKCB0QU5JX1U4KiApcEFzc29jUnNwLCBzaXplb2YodFNpckFzc29jUnNwKSwgMCApOworCisgICAgLy8gZGVsZWd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ZXJ0RXh0U3VwcFJhdGVzKCBwTWFjLCAmcEFzc29jUnNwLT5leHRlbmRlZFJhdGVzLCAmYXIuRXh0U3VwcFJhdGVzICk7CisgICAgfQorCisgICAgaWYgKCBhci5FRENBUGFyYW1TZXQucHJlc2VudCApCisgICAgeworICAgICAgICBwQXNzb2NSc3AtPmVkY2FQcmVzZW50ID0gMTsKKyAgICAgICAgQ29udmVydEVEQ0FQYXJhbSggcE1hYywgJnBBc3NvY1JzcC0+ZWRjYSwgJmFyLkVEQ0FQYXJhbVNldCApOworICAgIH0KKyAgICBpZiAoYXIuRXh0Q2FwLnByZXNlbnQpCisgICAgeworICAgICAgICB2b3NfbWVtX2NvcHkoJnBBc3NvY1JzcC0+RXh0Q2FwLCAmYXIuRXh0Q2FwLCBzaXplb2YodERvdDExZklFRXh0Q2FwKSk7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLAorICAgICAgICAgICAgICAgRkwoIkV4dENhcCBpcyBwcmVzZW50LCBURExTQ2hhblN3aXRQcm9oaWJpdGVkOiAlZCIpLAorICAgICAgICAgICAgICAgYXIuRXh0Q2FwLlRETFNDaGFuU3dpdFByb2hpYml0ZWQpOworICAgIH0KKyAgICBpZiAoIGFyLldNTVBhcmFtcy5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHBBc3NvY1JzcC0+d21lRWRjYVByZXNlbnQgPSAxOworICAgICAgICBDb252ZXJ0V01NUGFyYW1zKCBwTWFjLCAmcEFzc29jUnNwLT5lZGNhLCAmYXIuV01NUGFyYW1zKTsKKyAgICAgICAgbGltTG9nKHBNYWMsIExPRzEsIEZMKCJXTU0gUGFyYW1ldGVyIEVsZW1lbnQgcHJlc2VudCBpbiBBc3NvY2lhdGlvbiBSZXNwb25zZSBGcmFtZSEiKSk7CisgICAgICAgIF9fcHJpbnRXTU1QYXJhbXMocE1hYywgJmFyLldNTVBhcmFtcyk7CisgICAgfQorCisgICAgaWYgKCBhci5IVENhcHMucHJlc2VudCApCisgICAgewor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wgKHVuc2lnbmVkIGludClwQXNzb2NSc3AtPm1kaWVbMF0sCisgICAgICAgICAgICAgICAodW5zaWduZWQgaW50KXBBc3NvY1JzcC0+bWRpZVsxXSwgKHVuc2lnbmVkIGludClwQXNzb2NSc3AtPm1kaWVbMl0pOworI2VuZGlmCisgICAgfQorCisgICAgaWYgKCBhci5GVEluZm8ucHJlc2VudCApCisgICAgeworI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSX0RFQlVHCisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiRlQgSW5mbyBwcmVzZW50ICVkICVkICVkIiksIGFyLkZUSW5mby5SMEtIX0lELm51bV9QTUtfUjBfSUQsCisgICAgICAgICAgICAgICAgYXIuRlRJbmZvLlIwS0hfSUQucHJlc2VudCwKKyAgICAgICAgICAgICAgICBhci5GVEluZm8uUjFLSF9JRC5wcmVzZW50KTsKKyNlbmRpZgorICAgICAgICBwQXNzb2NSc3AtPmZ0aW5mb1ByZXNlbnQgPSAxOworICAgICAgICB2b3NfbWVtX2NvcHkoICZwQXNzb2NSc3AtPkZUSW5mbywgJmFyLkZUSW5mbywgc2l6ZW9mKHREb3QxMWZJRUZUSW5mbykgKTsKKyAgICB9CisjZW5kaWYKKworI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCisgICAgaWYgKGFyLm51bV9SSUNEYXRhRGVzYykgeworICAgICAgICBmb3IgKGNudD0wOyBjbnQgPCBhci5udW1fUklDRGF0YURlc2M7IGNudCsrKSB7CisgICAgICAgICAgICBpZiAoYXIuUklDRGF0YURlc2NbY250XS5wcmVzZW50KSB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCAmcEFzc29jUnNwLT5SSUNEYXRhW2NudF0sICZhci5SSUNEYXRhRGVzY1tjbnRdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHREb3QxMWZJRVJJQ0RhdGFEZXNjKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcEFzc29jUnNwLT5udW1fUklDRGF0YSA9IGFyLm51bV9SSUNEYXRhRGVzYzsKKyAgICAgICAgcEFzc29jUnNwLT5yaWNQcmVzZW50ID0gVFJVRTsKKyAgICB9CisjZW5kaWYgICAgCisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICAgaWYgKGFyLm51bV9XTU1UU1BFQykgeworICAgICAgICBwQXNzb2NSc3AtPm51bV90c3BlY3MgPSBhci5udW1fV01NVFNQRUM7CisgICAgICAgIGZvciAoY250PTA7IGNudCA8IGFyLm51bV9XTU1UU1BFQzsgY250KyspIHsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSggJnBBc3NvY1JzcC0+VFNQRUNJbmZvW2NudF0sICZhci5XTU1UU1BFQ1tjbnRdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAoc2l6ZW9mKHREb3QxMWZJRVdNTVRTUEVDKSphci5udW1fV01NVFNQRUMpKTsKKyAgICAgICAgfQorICAgICAgICBwQXNzb2NSc3AtPnRzcGVjUHJlc2VudCA9IFRSVUU7CisgICAgfQorICAgCisgICAgaWYoYXIuRVNFVHJhZlN0cm1NZXQucHJlc2VudCkKKyAgICB7CisgICAgICAgIHBBc3NvY1JzcC0+dHNtUHJlc2VudCA9IDE7CisgICAgICAgIHZvc19tZW1fY29weSgmcEFzc29jUnNwLT50c21JRS50c2lkLAorICAgICAgICAgICAgICAgICZhci5FU0VUcmFmU3RybU1ldC50c2lkLHNpemVvZih0U2lyTWFjRVNFVFNNSUUpKTsKKyAgICB9ICAgIAorI2VuZGlmCisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgIGlmICggYXIuVkhUQ2Fwcy5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHZvc19tZW1fY29weSggJnBBc3NvY1JzcC0+VkhUQ2FwcywgJmFyLlZIVENhcHMsIHNpemVvZiggdERvdDExZklFVkhUQ2FwcyApICk7CisgICAgICAgIG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NSZXEtPlZIVENhcHMsICZhci5WSFRDYXBzLCBzaXplb2YoIHREb3QxMWZJRVZIVENhcHMgKSApOworICAgIH0KKyAgICBpZiAoIGFyLk9wZXJhdGluZ01vZGUucHJlc2VudCApCisgICAgeworICAgICAgICB2b3NfbWVtX2NvcHkoICZwQXNzb2NSZXEtPm9wZXJNb2RlLCAmYXIuT3BlcmF0aW5nTW9kZSwgc2l6ZW9mKCB0RG90MTFmSUVPcGVyYXRpbmdNb2RlICApICk7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HVywgRkwoIlJlY2VpdmVkIEFzc29jIFJlcSB3aXRoIE9wZXJhdGluZyBNb2RlIElFIikpOworICAgICAgICBsaW1Mb2dPcGVyYXRpbmdNb2RlKCBwTWFjLCAmcEFzc29jUmVxLT5vcGVyTW9kZSk7CisgICAgfQorI2VuZGlmCisgICAgcmV0dXJuIGVTSVJfU1VDQ0VTUzsKKworfSAvLyBFbmQgc2lyQ29udmVydFJlYXNzb2NSZXFGcmFtZTJTdHJ1Y3QuCisKKworI2lmIGRlZmluZWQoRkVBVFVSRV9XTEFOX0VTRV9VUExPQUQpCit0U2lyUmV0U3RhdHVzCitzaXJGaWxsQmVhY29uTWFuZGF0b3J5SUVmb3JFc2VCY25SZXBvcnQodHBBbmlTaXJHbG9iYWwgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggICAgICAgICAqcFBheWxvYWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdEFOSV9VMzIgICBuUGF5bG9hZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICAgICAgICAqKm91dEllQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICAgICAgICAqcE91dEllTGVuKQoreworICAgIHREb3QxMWZCZWFjb25JRXMgICAgICAgICAgICAqcEJpZXMgPSB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tZXNjLWdlbmVyYXRlZCBjb2RlLAorICAgIHN0YXR1cyA9IGRvdDExZlVucGFja0JlYWNvbklFcyggcE1hYywgcFBheWxvYWQsIG5QYXlsb2FkLCBwQmllcyApOworCisgICAgaWYgKCBET1QxMUZfRkFJTEVEKCBzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBwYXJzZSBCZWFjb24gSUVzICgweCUwOHgsICVkIGJ5dGVzKSIpLAorICAgICAgICAgICAgICAgICAgc3RhdHVzLCBuUGF5bG9hZCk7CisgICAgICAgIHZvc19tZW1fZnJlZShwQmllcyk7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBzdGF0dXMgKSApCisgICAgeworICAgICAgbGltTG9nKCBwTWFjLCBMT0dXLCBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSB1bnBhY2tpbmcgQmVhY29uIElFcyAoMHglMDh4LCAlZCBieXRlcykiKSwKKyAgICAgICAgICAgICAgICAgc3RhdHVzLCBuUGF5bG9hZCApOworICAgICAgICBQRUxPRzIoc2lyRHVtcEJ1ZihwTWFjLCBTSVJfREJHX01PRFVMRV9JRCwgTE9HMiwgcFBheWxvYWQsIG5QYXlsb2FkKTspCisgICAgfQorCisgICAgLy8gJiAidHJhbnNsaXRlcmF0ZSIgZnJvbSBhICd0RG90MTFmQmVhY29uSUVzJyB0byBhICdlc2VCY25SZXBvcnRNYW5kYXRvcnlJZScuLi4KKyAgICBpZiAoICFwQmllcy0+U1NJRC5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIFBFTE9HVyhsaW1Mb2cocE1hYywgTE9HVywgRkwoIk1hbmRhdG9yeSBJRSBTU0lEIG5vdCBwcmVzZW50ISIpKTspCisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGVzZUJjblJlcG9ydE1hbmRhdG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gICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJJbnN1ZmZpY2llbnQgbWVtb3J5IHRvIGNvcHkgRFMgSUUiKSk7CisgICAgICAgICAgIHJldFN0YXR1cyA9IGVTSVJfRkFJTFVSRTsKKyAgICAgICAgICAgZ290byBlcnJfYmNucmVwOworICAgICAgIH0KKyAgICAgICAqcG9zID0gU0lSX01BQ19EU19QQVJBTV9TRVRfRUlEOworICAgICAgIHBvcysrOworICAgICAgICpwb3MgPSBTSVJfTUFDX0RTX1BBUkFNX1NFVF9FSURfTUFYOworICAgICAgIHBvcysrOworICAgICAgICpwb3MgPSBlc2VCY25SZXBvcnRNYW5kYXRvcnlJZS5kc1BhcmFtU2V0LmNoYW5uZWxOdW1iZXI7CisgICAgICAgcG9zICs9IFNJUl9NQUNfRFNfUEFSQU1fU0VUX0VJRF9NQVg7CisgICAgICAgZnJlZUJ5dGVzIC09ICgxICsgMSArIFNJUl9NQUNfRFNfUEFSQU1fU0VUX0VJRF9NQVgpOworICAgIH0KKworICAgIC8qIEZpbGwgQ0YgUGFyYW1ldGVyIHNldCAqLworICAgIGlmIChlc2VCY25SZXBvcnRNYW5kYXRvcnlJZS5jZlByZXNlbnQpCisgICAgeworICAgICAgIGlmIChmcmVlQnl0ZXMgPCAoMSArIDEgKyBTSVJfTUFDX0NGX1BBUkFNX1NFVF9FSURfTUFYKSkKKyAgICAgICB7CisgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiSW5zdWZmaWNpZW50IG1lbW9yeSB0byBjb3B5IENGIElFIikpOworICAgICAgICAgICByZXRTdGF0dXMgPSBlU0lSX0ZBSUxVUkU7CisgICAgICAgICAgIGdvdG8gZXJyX2JjbnJlcDsKKyAgICAgICB9CisgICAgICAgKnBvcyA9IFNJUl9NQUNfQ0ZfUEFSQU1fU0VUX0VJRDsKKyAgICAgICBwb3MrKzsKKyAgICAgICAqcG9zID0gU0lSX01BQ19DRl9QQVJBTV9TRVRfRUlEX01BWDsKKyAgICAgICBwb3MrKzsKKyAgICAgICB2b3NfbWVtX2NvcHkocG9zLCAodEFOSV9VOCopJmVzZUJjblJlcG9ydE1hbmRhdG9yeUllLmNmUGFyYW1TZXQsCisgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfQ0ZfUEFSQU1fU0VUX0VJRF9NQVgpOworICAgICAgIHBvcyArPSBTSVJfTUFDX0NGX1BBUkFNX1NFVF9FSURfTUFYOworICAgICAgIGZyZWVCeXRlcyAtPSAoMSArIDEgKyBTSVJfTUFDX0NGX1BBUkFNX1NFVF9FSURfTUFYKTsKKyAgICB9CisKKyAgICAvKiBGaWxsIElCU1MgUGFyYW1ldGVyIHNldCBJRSAqLworICAgIGlmIChlc2VCY25SZXBvcnRNYW5kYXRvcnlJZS5pYnNzUGFyYW1QcmVzZW50KQorICAgIHsKKyAgICAgICBpZiAoZnJlZUJ5dGVzIDwgKDEgKyAxICsgU0lSX01BQ19JQlNTX1BBUkFNX1NFVF9FSURfTUFYKSkKKyAgICAgICB7CisgICAgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dQLCBGTCgiSW5zdWZmaWNpZW50IG1lbW9yeSB0byBjb3B5IElCU1MgSUUiKSk7CisgICAgICAgICAgIHJldFN0YXR1cyA9IGVTSVJfRkFJTFVSRTsKKyAgICAgICAgICAgZ290byBlcnJfYmNucmVwOworICAgICAgIH0KKyAgICAgICAqcG9zID0gU0lSX01BQ19JQlNTX1BBUkFNX1NFVF9FSUQ7CisgICAgICAgcG9zKys7CisgICAgICAgKnBvcyA9IFNJUl9NQUNfSUJTU19QQVJBTV9TRVRfRUlEX01BWDsKKyAgICAgICBwb3MrKzsKKyAgICAgICB2b3NfbWVtX2NvcHkocG9zLCAodEFOSV9VOCopJmVzZUJjblJlcG9ydE1hbmRhdG9yeUllLmlic3NQYXJhbVNldC5hdGltLAorICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX0lCU1NfUEFSQU1fU0VUX0VJRF9NQVgpOworICAgICAgIHBvcyArPSBTSVJfTUFDX0lCU1NfUEFSQU1fU0VUX0VJRF9NQVg7CisgICAgICAgZnJlZUJ5dGVzIC09ICgxICsgMSArIFNJUl9NQUNfSUJTU19QQVJBTV9TRVRfRUlEX01BWCk7CisgICAgfQorCisgICAgLyogRmlsbCBUSU0gSUUgKi8KKyAgICBpZiAoZXNlQmNuUmVwb3J0TWFuZGF0b3J5SWUudGltUHJlc2VudCkKKyAgICB7CisgICAgICAgaWYgKGZyZWVCeXRlcyA8ICgxICsgMSArIFNJUl9NQUNfVElNX0VJRF9NSU4pKQorICAgICAgIHsKKyAgICAgICAgICAgbGltTG9nKHBNYWMsIExPR1AsIEZMKCJJbnN1ZmZpY2llbnQgbWVtb3J5IHRvIGNvcHkgVElNIElFIikpOworICAgICAgICAgICByZXRTdGF0dXMgPSBlU0lSX0ZBSUxVUkU7CisgICAgICAgICAgIGdvdG8gZXJyX2JjbnJlcDsKKyAgICAgICB9CisgICAgICAgKnBvcyA9IFNJUl9NQUNfVElNX0VJRDsKKyAgICAgICBwb3MrKzsKKyAgICAgICAqcG9zID0gU0lSX01BQ19USU1fRUlEX01JTjsKKyAgICAgICBwb3MrKzsKKyAgICAgICB2b3NfbWVtX2NvcHkocG9zLCAodEFOSV9VOCopJmVzZUJjblJlcG9ydE1hbmRhdG9yeUllLnRpbSwKKyAgICAgICAgICAgICAgICAgICAgU0lSX01BQ19USU1fRUlEX01JTik7CisgICAgICAgcG9zICs9IFNJUl9NQUNfVElNX0VJRF9NSU47CisgICAgICAgZnJlZUJ5dGVzIC09ICgxICsgMSArIFNJUl9NQUNfVElNX0VJRF9NSU4pOworICAgIH0KKworICAgIC8qIEZpbGwgUk0gQ2FwYWJpbGl0eSBJRSAqLworICAgIGlmIChlc2VCY25SZXBvcnRNYW5kYXRvcnlJZS5ycm1QcmVzZW50KQorICAgIHsKKyAgICAgICBpZiAoZnJlZUJ5dGVzIDwgKDEgKyAxICsgU0lSX01BQ19STV9FTkFCTEVEX0NBUEFCSUxJVFlfRUlEX01BWCkpCisgICAgICAgeworICAgICAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoIkluc3VmZmljaWVudCBtZW1vcnkgdG8gY29weSBSUk0gSUUiKSk7CisgICAgICAgICAgIHJldFN0YXR1cyA9IGVTSVJfRkFJTFVSRTsKKyAgICAgICAgICAgZ290byBlcnJfYmNucmVwOworICAgICAgIH0KKyAgICAgICAqcG9zID0gU0lSX01BQ19STV9FTkFCTEVEX0NBUEFCSUxJVFlfRUlEOworICAgICAgIHBvcysrOworICAgICAgICpwb3MgPSBTSVJfTUFDX1JNX0VOQUJMRURfQ0FQQUJJTElUWV9FSURfTUFYOworICAgICAgIHBvcysrOworICAgICAgIHZvc19tZW1fY29weShwb3MsICh0QU5JX1U4KikmZXNlQmNuUmVwb3J0TWFuZGF0b3J5SWUucm1FbmFibGVkQ2FwYWJpbGl0aWVzLAorICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX1JNX0VOQUJMRURfQ0FQQUJJTElUWV9FSURfTUFYKTsKKyAgICAgICBmcmVlQnl0ZXMgLT0gKDEgKyAxICsgU0lSX01BQ19STV9FTkFCTEVEX0NBUEFCSUxJVFlfRUlEX01BWCk7CisgICAgfQorCisgICAgaWYgKGZyZWVCeXRlcyAhPSAwKQorICAgIHsKKyAgICAgICBsaW1Mb2cocE1hYywgTE9HUCwgRkwoIk1pc21hdGNoIGluIGFsbG9jYXRpb24gYW5kIGNvcHlpbmcgb2YgSUUgaW4gQmNuIFJlcCIpKTsKKyAgICAgICByZXRTdGF0dXMgPSBlU0lSX0ZBSUxVUkU7CisgICAgfQorCitlcnJfYmNucmVwOgorICAgIC8qIFRoZSBtZXNzYWdlIGNvdW50ZXIgd291bGQgbm90IGJlIGluY3JlbWVudGVkIGluIGNhc2Ugb2YKKyAgICAgKiByZXR1cm5pbmcgZmFpbHVyZSBhbmQgaGVuY2UgbmV4dCB0aW1lLCB0aGlzIGZ1bmN0aW9uIGdldHMKKyAgICAgKiBjYWxsZWQsIGl0IHdvdWxkIGJlIHVzaW5nIHRoZSBzYW1lIG1zZyBjdHIgZm9yIGEgZGlmZmVyZW50CisgICAgICogQlNTLlNvLCBpdCBpcyBnb29kIHRvIGNsZWFyIHRoZSBtZW1vcnkgYWxsb2NhdGVkIGZvciBhIEJTUworICAgICAqIHRoYXQgaXMgcmV0dXJuaW5nIGZhaWx1cmUuT24gc3VjY2VzcywgdGhlIGNhbGxlciB3b3VsZCB0YWtlCisgICAgICogY2FyZSBvZiBmcmVlaW5nIHVwIHRoZSBtZW1vcnkqLworICAgIGlmIChyZXRTdGF0dXMgPT0gZVNJUl9GQUlMVVJFKQorICAgIHsKKyAgICAgICB2b3NfbWVtX2ZyZWUoKm91dEllQnVmKTsKKyAgICAgICAqb3V0SWVCdWYgPSBOVUxMOworICAgIH0KKyAgICB2b3NfbWVtX2ZyZWUocEJpZXMpOworICAgIHJldHVybiByZXRTdGF0dXM7Cit9CisKKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fRVNFX1VQTE9BRCAqLworCit0U2lyUmV0U3RhdHVzCitzaXJQYXJzZUJlYWNvbklFKHRwQW5pU2lyR2xvYmFsICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICB0cFNpclByb2JlUmVzcEJlYWNvbiAgcEJlYWNvblN0cnVjdCwKKyAgICAgICAgICAgICAgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAqcFBheWxvYWQsCisgICAgICAgICAgICAgICAgIHRBTklfVTMyICAgICAgICAgICAgICAgICAgIG5QYXlsb2FkKQoreworICAgIHREb3QxMWZCZWFjb25JRXMgKnBCaWVzOworICAgIHRBTklfVTMyICAgICAgICAgICAgICBzdGF0dXM7CisKKyAgICAvLyBaZXJvLWluaXQgb3VyIFtvdXRdIHBhcmFtZXRlciwKKyAgICB2b3NfbWVtX3NldCggKCB0QU5JX1U4KiApcEJlYWNvblN0cnVjdCwgc2l6ZW9mKHRTaXJQcm9iZVJlc3BCZWFjb24pLCAwICk7CisKKy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y5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHBCZWFjb25TdHJ1Y3QtPmV4dGVuZGVkUmF0ZXNQcmVzZW50ID0gMTsKKyAgICAgICAgQ29udmVydEV4dFN1cHBSYXRlcyggcE1hYywgJnBCZWFjb25TdHJ1Y3QtPmV4dGVuZGVkUmF0ZXMsICZwQmllcy0+RXh0U3VwcFJhdGVzICk7CisgICAgfQorCisgICAgaWYgKCBwQmllcy0+Q0ZQYXJhbXMucHJlc2VudCApCisgICAgeworICAgICAgICBwQmVhY29uU3RydWN0LT5jZlByZXNlbnQgPSAxOworICAgICAgICBDb252ZXJ0Q0ZQYXJhbXMoIHBNYWMsICZwQmVhY29uU3RydWN0LT5jZlBhcmFtU2V0LCAmcEJpZXMtPkNGUGFyYW1zICk7CisgICAgfQorCisgICAgaWYgKCBwQmllcy0+VElNLnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgcEJlYWNvblN0cnVjdC0+dGltUHJlc2VudCA9IDE7CisgICAgICAgIENvbnZlcnRUSU0oIHBNYWMsICZwQmVhY29uU3RydWN0LT50aW0sICZwQmllcy0+VElNICk7CisgICAgfQorCisgICAgaWYgKCBwQmllcy0+Q291bnRyeS5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHBCZWFjb25TdHJ1Y3QtPmNvdW50cnlJbmZvUHJlc2VudCA9IDE7CisgICAgICAgIENvbnZlcnRDb3VudHJ5KCBwTWFjLCAmcEJlYWNvblN0cnVjdC0+Y291bnRyeUluZm9QYXJhbSwgJnBCaWVzLT5Db3VudHJ5ICk7CisgICAgfQorCisgICAgLy8gMTFoIElFcworICAgIGlmKHBCaWVzLT5UUENSZXBvcnQucHJlc2VudCkKKyAgICB7CisgICAgICAgIHBCZWFjb25TdHJ1Y3QtPnRwY1JlcG9ydFByZXNlbnQgPSAxOworICAgICAgICB2b3NfbWVtX2NvcHkoICZwQmVhY29uU3RydWN0LT50cGNSZXBvcnQsCisgICAgICAgICAgICAgICAgICAgICAgJnBCaWVzLT5UUENSZXBvcnQsCisgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCB0RG90MTFmSUVUUENSZXBvcnQpKTsKKyAgICB9CisKKyAgICBpZihwQmllcy0+UG93ZXJDb25zdHJhaW50cy5wcmVzZW50KQorICAgIHsKKyAgICAgICAgcEJlYWNvblN0cnVjdC0+cG93ZXJDb25zdHJhaW50UHJlc2VudCA9IDE7CisgICAgICAgIHZvc19tZW1fY29weSggJnBCZWFjb25TdHJ1Y3QtPmxvY2FsUG93ZXJDb25zdHJhaW50LAorICAgICAgICAgICAgICAgICAgICAgICZwQmllcy0+UG93ZXJDb25zdHJhaW50cywKKyAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodERvdDExZklFUG93ZXJDb25zdHJhaW50cykpOworICAgIH0KKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICAgaWYocEJpZXMtPkVTRVR4bWl0UG93ZXIucHJlc2VudCkKKyAgICB7CisgICAgICAgIHBCZWFjb25TdHJ1Y3QtPmVzZVR4UHdyLnByZXNlbnQgPSAxOworICAgICAgICBwQmVhY29uU3RydWN0LT5lc2VUeFB3ci5wb3dlcl9saW1pdCA9IHBCaWVzLT5FU0VUeG1pdFBvd2VyLnBvd2VyX2xpbWl0OworICAgIH0KKyAgICBpZiAocEJpZXMtPlFCU1NMb2FkLnByZXNlbnQpCisgICAgeworICAgICAgICB2b3NfbWVtX2NvcHkoICZwQmVhY29uU3RydWN0LT5RQlNTTG9hZCwgJnBCaWVzLT5RQlNTTG9hZCwgc2l6ZW9mKHREb3QxMWZJRVFCU1NMb2FkKSk7CisgICAgfQorI2VuZGlmCisKKyAgICBpZiAoIHBCaWVzLT5FRENBUGFyYW1TZXQucHJlc2VudCApCisgICAgeworICAgICAgICBwQmVhY29uU3RydWN0LT5lZGNhUHJlc2VudCA9IDE7CisgICAgICAgIENvbnZlcnRFRENBUGFyYW0oIHBNYWMsICZwQmVhY29uU3RydWN0LT5lZGNhUGFyYW1zLCAmcEJpZXMtPkVEQ0FQYXJhbVNldCApOworICAgIH0KKworICAgIC8vIFFPUyBDYXBhYmlsaXRpZXM6CisgICAgaWYgKCBwQmllcy0+UU9TQ2Fwc0FwLnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgcEJlYWNvblN0cnVjdC0+cW9zQ2FwYWJpbGl0eVByZXNlbnQgPSAxOworICAgICAgICBDb252ZXJ0UU9TQ2FwcyggcE1hYywgJnBCZWFjb25TdHJ1Y3QtPnFvc0NhcGFiaWxpdHksICZwQmllcy0+UU9TQ2Fwc0FwICk7CisgICAgfQorCisKKworICAgIGlmICggcEJpZXMtPkNoYW5Td2l0Y2hBbm4ucHJlc2VudCApCisgICAgeworICAgICAgICBwQmVhY29uU3RydWN0LT5jaGFubmVsU3dpdGNoUHJlc2VudCA9IDE7CisgICAgICAgIHZvc19tZW1fY29weSggJnBCZWFjb25TdHJ1Y3QtPmNoYW5uZWxTd2l0Y2hJRSwgJnBCaWVzLT5DaGFuU3dpdGNoQW5uLAorICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0RG90MTFmSUVDaGFuU3dpdGNoQW5uKSk7CisgICAgfQorCisgICAgaWYgKCBwQmllcy0+RXh0Q2hhblN3aXRjaEFubi5wcmVzZW50KQorICAgIHsKKyAgICAgICAgcEJlYWNvblN0cnVjdC0+ZXh0Q2hhbm5lbFN3aXRjaFByZXNlbnQ9IDE7CisgICAgICAgIHZvc19tZW1fY29weSggJnBCZWFjb25TdHJ1Y3QtPmV4dENoYW5uZWxTd2l0Y2hJRSwgJnBCaWVzLT5FeHRDaGFuU3dpdGNoQW5uLAorICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0RG90MTFmSUVFeHRDaGFuU3dpdGNoQW5uKSk7CisgICAgfQorCisgICAgaWYgKCBwQmllcy0+UXVpZXQucHJlc2VudCApCisgICAgeworICAgICAgICBwQmVhY29uU3RydWN0LT5xdWlldElFUHJlc2VudCA9IDE7CisgICAgICAgIHZvc19tZW1fY29weSggJnBCZWFjb25TdHJ1Y3QtPnF1aWV0SUUsICZwQmllcy0+UXVpZXQsIHNpemVvZih0RG90MTFmSUVRdWlldCkgKTsKKyAgICB9CisKKyAgICBpZiAoIHBCaWVzLT5IVENhcHMucHJlc2VudCApCisgICAgeworICAgICAgICB2b3NfbWVtX2NvcHkoICZwQmVhY29uU3RydWN0LT5IVENhcHMsICZwQmllcy0+SFRDYXBzLCBzaXplb2YoIHREb3QxMWZJRUhUQ2FwcyApICk7CisgICAgfQorCisgICAgaWYgKCBwQmllcy0+SFRJbmZvLnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9jb3B5KCAmcEJlYWNvblN0cnVjdC0+SFRJbmZvLCAmcEJpZXMtPkhUSW5mbywgc2l6ZW9mKCB0RG90MTFmSUVIVEluZm8gKSApOworICAgIH0KKworICAgIGlmICggcEJpZXMtPkRTUGFyYW1zLnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgcEJlYWNvblN0cnVjdC0+ZHNQYXJhbXNQcmVzZW50ID0gMTsKKyAgICAgICAgcEJlYWNvblN0cnVjdC0+Y2hhbm5lbE51bWJlciA9IHBCaWVzLT5EU1BhcmFtcy5jdXJyX2NoYW5uZWw7CisgICAgfQorICAgIGVsc2UgaWYocEJpZXMtPkhUSW5mby5wcmVzZW50KQorICAgIHsKKyAgICAgICAgcEJlYWNvblN0cnVjdC0+Y2hhbm5lbE51bWJlciA9IHBCaWVzLT5IVEluZm8ucHJpbWFyeUNoYW5uZWw7CisgICAgfQorICAgIAorICAgIGlmICggcEJpZXMtPlJTTi5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHBCZWFjb25TdHJ1Y3QtPnJzblByZXNlbnQgPSAxOworICAgICAgICBDb252ZXJ0UlNOKCBwTWFjLCAmcEJlYWNvblN0cnVjdC0+cnNuLCAmcEJpZXMtPlJTTiApOworICAgIH0KKworICAgIGlmICggcEJpZXMtPldQQS5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHBCZWFjb25TdHJ1Y3QtPndwYVByZXNlbnQgPSAxOworICAgICAgICBDb252ZXJ0V1BBKCBwTWFjLCAmcEJlYWNvblN0cnVjdC0+d3BhLCAmcEJpZXMtPldQQSApOworICAgIH0KKworICAgIGlmICggcEJpZXMtPldNTVBhcmFtcy5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHBCZWFjb25TdHJ1Y3QtPndtZUVkY2FQcmVzZW50ID0gMTsKKyAgICAgICAgQ29udmVydFdNTVBhcmFtcyggcE1hYywgJnBCZWFjb25TdHJ1Y3QtPmVkY2FQYXJhbXMsICZwQmllcy0+V01NUGFyYW1zICk7CisgICAgfQorCisgICAgaWYgKCBwQmllcy0+V01NSW5mb0FwLnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgcEJlYWNvblN0cnVjdC0+d21lSW5mb1ByZXNlbnQgPSAxOworICAgIH0KKworICAgIGlmICggcEJpZXMtPldNTUNhcHMucHJlc2VudCApCisgICAgeworICAgICAgICBwQmVhY29uU3RydWN0LT53c21DYXBhYmxlUHJlc2VudCA9IDE7CisgICAgfQorCisKKyAgICBpZiAoIHBCaWVzLT5FUlBJbmZvLnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgcEJlYWNvblN0cnVjdC0+ZXJwUHJlc2VudCA9IDE7CisgICAgICAgIENvbnZlcnRFUlBJbmZvKCBwTWFjLCAmcEJlYWNvblN0cnVjdC0+ZXJwSUVJbmZvLCAmcEJpZXMtPkVSUEluZm8gKTsKKyAgICB9CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgIGlmICggcEJpZXMtPlZIVENhcHMucHJlc2VudCApCisgICAgeworICAgICAgICAgcEJlYWNvblN0cnVjdC0+VkhUQ2Fwcy5wcmVzZW50ID0gMTsKKyAgICAgICAgIHZvc19tZW1fY29weSggJnBCZWFjb25TdHJ1Y3QtPlZIVENhcHMsICZwQmllcy0+VkhUQ2Fwcywgc2l6ZW9mKCB0RG90MTFmSUVWSFRDYXBzICkgKTsKKyAgICB9CisgICAgaWYgKCBwQmllcy0+VkhUT3BlcmF0aW9uLnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgIHBCZWFjb25TdHJ1Y3QtPlZIVE9wZXJhdGlvbi5wcmVzZW50ID0gMTsKKyAgICAgICAgIHZvc19tZW1fY29weSggJnBCZWFjb25TdHJ1Y3QtPlZIVE9wZXJhdGlvbiwgJnBCaWVzLT5WSFRPcGVyYXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiggdERvdDExZklFVkhUT3BlcmF0aW9uKSApOworICAgIH0KKyAgICBpZiAoIHBCaWVzLT5WSFRFeHRCc3NMb2FkLnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgIHBCZWFjb25TdHJ1Y3QtPlZIVEV4dEJzc0xvYWQucHJlc2VudCA9IDE7CisgICAgICAgICB2b3NfbWVtX2NvcHkoICZwQmVhY29uU3RydWN0LT5WSFRFeHRCc3NMb2FkLCAmcEJpZXMtPlZIVEV4dEJzc0xvYWQsCisgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiggdERvdDExZklFVkhURXh0QnNzTG9hZCkgKTsKKyAgICB9CisgICAgaWYoIHBCaWVzLT5PcGVyYXRpbmdNb2RlLnByZXNlbnQpCisgICAgeworICAgICAgICBwQmVhY29uU3RydWN0LT5PcGVyYXRpbmdNb2RlLnByZXNlbnQgPSAxOworICAgICAgICB2b3NfbWVtX2NvcHkoICZwQmVhY29uU3RydWN0LT5PcGVyYXRpbmdNb2RlLCAmcEJpZXMtPk9wZXJhdGluZ01vZGUsCisgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCB0RG90MTFmSUVPcGVyYXRpbmdNb2RlKSApOworICAgIH0KKworI2VuZGlmCisgICAgaWYgKHBCaWVzLT5FeHRDYXAucHJlc2VudCApCisgICAgeworICAgICAgICBwQmVhY29uU3RydWN0LT5FeHRDYXAucHJlc2VudCA9IDE7CisgICAgICAgIHZvc19tZW1fY29weSggJnBCZWFjb25TdHJ1Y3QtPkV4dENhcCwgJnBCaWVzLT5FeHRDYXAsCisgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodERvdDExZklFRXh0Q2FwKSk7CisgICAgfQorICAgIHZvc19tZW1fZnJlZShwQmllcyk7CisKKworICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7CisKK30gLy8gRW5kIHNpclBhcnNlQmVhY29uSUUuCisKK3RTaXJSZXRTdGF0dXMKK3NpckNvbnZlcnRCZWFjb25GcmFtZTJTdHJ1Y3QodHBBbmlTaXJHbG9iYWwgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAgICAgICAgICAgICAqcEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFNpclByb2JlUmVzcEJlYWNvbiBwQmVhY29uU3RydWN0KQoreworICAgIHREb3QxMWZCZWFjb24gICpwQmVhY29uOworICAgIHRBTklfVTMyICAgICAgICBzdGF0dXMsIG5QYXlsb2FkOworICAgIHRBTklfVTggICAgICAgICpwUGF5bG9hZDsKKyAgICB0cFNpck1hY01nbXRIZHIgcEhkcjsKKyAgICB0QU5JX1U4ICAgICAgICAgbWFwcGVkUlhDaDsKKyAgICB0QU5JX1U4ICAgICAgICAgcmZCYW5kOworCisgICAgcFBheWxvYWQgPSBXREFfR0VUX1JYX01QRFVfREFUQSggcEZyYW1lICk7CisgICAgblBheWxvYWQgPSBXREFfR0VUX1JYX1BBWUxPQURfTEVOKCBwRnJhbWUgKTsKKyAgICBwSGRyICAgICA9IFdEQV9HRVRfUlhfTUFDX0hFQURFUiggcEZyYW1lICk7CisgICAgbWFwcGVkUlhDaCA9IFdEQV9HRVRfUlhfQ0goIHBGcmFtZSApOworICAgIHJmQmFuZCA9IFdEQV9HRVRfUlhfUkZCQU5EKCBwRnJhbWUgKTsKKyAgICAKKyAgICAvLyBaZXJvLWluaXQgb3VyIFtvdXRdIHBhcmFtZXRlciwKKyAgICB2b3NfbWVtX3NldCggKCB0QU5JX1U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sICZwQmVhY29uU3RydWN0LT5jb3VudHJ5SW5mb1BhcmFtLCAmcEJlYWNvbi0+Q291bnRyeSApOworICAgIH0KKworICAgIC8vIFFPUyBDYXBhYmlsaXRpZXM6CisgICAgaWYgKCBwQmVhY29uLT5RT1NDYXBzQXAucHJlc2VudCApCisgICAgeworICAgICAgICBwQmVhY29uU3RydWN0LT5xb3NDYXBhYmlsaXR5UHJlc2VudCA9IDE7CisgICAgICAgIENvbnZlcnRRT1NDYXBzKCBwTWFjLCAmcEJlYWNvblN0cnVjdC0+cW9zQ2FwYWJpbGl0eSwgJnBCZWFjb24tPlFPU0NhcHNBcCApOworICAgIH0KKworICAgIGlmICggcEJlYWNvbi0+RURDQVBhcmFtU2V0LnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgcEJlYWNvblN0cnVjdC0+ZWRjYVByZXNlbnQgPSAxOworICAgICAgICBDb252ZXJ0RURDQVBhcmFtKCBwTWFjLCAmcEJlYWNvblN0cnVjdC0+ZWRjYVBhcmFtcywgJnBCZWFjb24tPkVEQ0FQYXJhbVNldCApOworICAgIH0KKworICAgIGlmICggcEJlYWNvbi0+Q2hhblN3aXRjaEFubi5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHBCZWFjb25TdHJ1Y3QtPmNoYW5uZWxTd2l0Y2hQcmVzZW50ID0gMTsKKyAgICAgICAgdm9zX21lbV9jb3B5KCAmcEJlYWNvblN0cnVjdC0+Y2hhbm5lbFN3aXRjaElFLCAmcEJlYWNvbi0+Q2hhblN3aXRjaEFubiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodERvdDExZklFQ2hhblN3aXRjaEFubikgKTsKKyAgICB9CisKKyAgICBpZiAoIHBCZWFjb24tPkV4dENoYW5Td2l0Y2hBbm4ucHJlc2VudCApCisgICAgeworICAgICAgICBwQmVhY29uU3RydWN0LT5leHRDaGFubmVsU3dpdGNoUHJlc2VudCA9IDE7CisgICAgICAgIHZvc19tZW1fY29weSggJnBCZWFjb25TdHJ1Y3QtPmV4dENoYW5uZWxTd2l0Y2hJRSwgJnBCZWFjb24tPkV4dENoYW5Td2l0Y2hBbm4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHREb3QxMWZJRUV4dENoYW5Td2l0Y2hBbm4pICk7CisgICAgfQorCisgICAgaWYoIHBCZWFjb24tPlRQQ1JlcG9ydC5wcmVzZW50KQorICAgIHsKKyAgICAgICAgcEJlYWNvblN0cnVjdC0+dHBjUmVwb3J0UHJlc2VudCA9IDE7CisgICAgICAgIHZvc19tZW1fY29weSggJnBCZWFjb25TdHJ1Y3QtPnRwY1JlcG9ydCwgJnBCZWFjb24tPlRQQ1JlcG9ydCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHREb3QxMWZJRVRQQ1JlcG9ydCkpOworICAgIH0KKworICAgIGlmKCBwQmVhY29uLT5Qb3dlckNvbnN0cmFpbnRzLnByZXNlbnQpCisgICAgeworICAgICAgICBwQmVhY29uU3RydWN0LT5wb3dlckNvbnN0cmFpbnRQcmVzZW50ID0gMTsKKyAgICAgICAgdm9zX21lbV9jb3B5KCAmcEJlYWNvblN0cnVjdC0+bG9jYWxQb3dlckNvbnN0cmFpbnQsICZwQmVhY29uLT5Qb3dlckNvbnN0cmFpbnRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHREb3QxMWZJRVBvd2VyQ29uc3RyYWludHMpKTsKKyAgICB9CisKKyAgICBpZiAoIHBCZWFjb24tPlF1aWV0LnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgcEJlYWNvblN0cnVjdC0+cXVpZXRJRVByZXNlbnQgPSAxOworICAgICAgICB2b3NfbWVtX2NvcHkoICZwQmVhY29uU3RydWN0LT5xdWlldElFLCAmcEJlYWNvbi0+UXVpZXQsIHNpemVvZih0RG90MTFmSUVRdWlldCkpOworICAgIH0KKworICAgIGlmICggcEJlYWNvbi0+SFRDYXBzLnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9jb3B5KCAmcEJlYWNvblN0cnVjdC0+SFRDYXBzLCAmcEJlYWNvbi0+SFRDYXBzLCBzaXplb2YoIHREb3QxMWZJRUhUQ2FwcyApICk7CisgICAgfQorCisgICAgaWYgKCBwQmVhY29uLT5IVEluZm8ucHJlc2VudCApCisgICAgeworICAgICAgICB2b3NfbWVtX2NvcHkoICZwQmVhY29uU3RydWN0LT5IVEluZm8sICZwQmVhY29uLT5IVEluZm8sIHNpemVvZiggdERvdDExZklFSFRJbmZvKSApOworCisgICAgfQorCisgICAgaWYgKCBwQmVhY29uLT5EU1BhcmFtcy5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHBCZWFjb25TdHJ1Y3QtPmRzUGFyYW1zUHJlc2VudCA9IDE7CisgICAgICAgIHBCZWFjb25TdHJ1Y3QtPmNoYW5uZWxOdW1iZXIgPSBwQmVhY29uLT5EU1BhcmFtcy5jdXJyX2NoYW5uZWw7CisgICAgfQorICAgIGVsc2UgaWYocEJlYWNvbi0+SFRJbmZvLnByZXNlbnQpCisgICAgeworICAgICAgICBwQmVhY29uU3RydWN0LT5jaGFubmVsTnVtYmVyID0gcEJlYWNvbi0+SFRJbmZvLnByaW1hcnlDaGFubmVsOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgIGlmICgoIXJmQmFuZCkgfHwgSVNfNUdfQkFORChyZkJhbmQpKQorICAgICAgICAgICBwQmVhY29uU3RydWN0LT5jaGFubmVsTnVtYmVyID0gbGltVW5tYXBDaGFubmVsKG1hcHBlZFJYQ2gpOworICAgICAgIGVsc2UgaWYgKElTXzI0R19CQU5EKHJmQmFuZCkpCisgICAgICAgICAgIHBCZWFjb25TdHJ1Y3QtPmNoYW5uZWxOdW1iZXIgPSBtYXBwZWRSWENoOworICAgICAgIGVsc2UKKyAgICAgICB7CisgICAgICAgICAgIC8qT25seSAwLCAxLCAyIGFyZSBleHBlY3RlZCB2YWx1ZXMgZm9yIFJGIGJhbmQgZnJvbSBGVworICAgICAgICAgICAgKiBpZiBGVyBmaXhlcyBhcmUgbm90IHByZXNlbnQgdGhlbiByZiBiYW5kIHZhbHVlIHdpbGwKKyAgICAgICAgICAgICogYmUgMCwgZWxzZSBlaXRoZXIgMSBvciAyIGFyZSBleHBlY3RlZCBmcm9tIEZXLCAzIGlzCisgICAgICAgICAgICAqIG5vdCBleHBlY3RlZCBmcm9tIEZXICovCisgICAgICAgICAgIFBFTE9HRShsaW1Mb2cocE1hYywgTE9HRSwKKyAgICAgICAgICAgRkwoIkNoYW5uZWwgaW5mbyBpcyBub3QgcHJlc2VudCBpbiBCZWFjb24gYW5kIgorICAgICAgICAgICAgICAgICAgICIgbWFwcGluZyBpcyBub3QgZG9uZSBjb3JyZWN0bHkiKSk7KQorICAgICAgICAgICBwQmVhY29uU3RydWN0LT5jaGFubmVsTnVtYmVyID0gbWFwcGVkUlhDaDsKKyAgICAgICB9CisgICAgfQorCisgICAgaWYgKCBwQmVhY29uLT5SU04ucHJlc2VudCApCisgICAgeworICAgICAgICBwQmVhY29uU3RydWN0LT5yc25QcmVzZW50ID0gMTsKKyAgICAgICAgQ29udmVydFJTTiggcE1hYywgJnBCZWFjb25TdHJ1Y3QtPnJzbiwgJnBCZWFjb24tPlJTTiApOworICAgIH0KKworICAgIGlmICggcEJlYWNvbi0+V1BBLnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgcEJlYWNvblN0cnVjdC0+d3BhUHJlc2VudCA9IDE7CisgICAgICAgIENvbnZlcnRXUEEoIHBNYWMsICZwQmVhY29uU3RydWN0LT53cGEsICZwQmVhY29uLT5XUEEgKTsKKyAgICB9CisKKyAgICBpZiAoIHBCZWFjb24tPldNTVBhcmFtcy5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHBCZWFjb25TdHJ1Y3QtPndtZUVkY2FQcmVzZW50ID0gMTsKKyAgICAgICAgQ29udmVydFdNTVBhcmFtcyggcE1hYywgJnBCZWFjb25TdHJ1Y3QtPmVkY2FQYXJhbXMsICZwQmVhY29uLT5XTU1QYXJhbXMgKTsKKyAgICAgICAgUEVMT0cxKGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiV01NIFBhcmFtZXRlciBwcmVzZW50IGluIEJlYWNvbiBGcmFtZSEiKSk7CisgICAgICAgIF9fcHJpbnRXTU1QYXJhbXMocE1hYywgJnBCZWFjb24tPldNTVBhcmFtcyk7ICkKKyAgICB9CisKKyAgICBpZiAoIHBCZWFjb24tPldNTUluZm9BcC5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHBCZWFjb25TdHJ1Y3QtPndtZUluZm9QcmVzZW50ID0gMTsKKyAgICAgICAgUEVMT0cxKGxpbUxvZyhwTWFjLCBMT0cxLCBGTCgiV01NIEluZm8gcHJlc2VudCBpbiBCZWFjb24gRnJhbWUhIikpOykKKyAgICB9CisKKyAgICBpZiAoIHBCZWFjb24tPldNTUNhcHMucHJlc2VudCApCisgICAgeworICAgICAgICBwQmVhY29uU3RydWN0LT53c21DYXBhYmxlUHJlc2VudCA9IDE7CisgICAgfQorCisgICAgaWYgKCBwQmVhY29uLT5FUlBJbmZvLnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgcEJlYWNvblN0cnVjdC0+ZXJwUHJlc2VudCA9IDE7CisgICAgICAgIENvbnZlcnRFUlBJbmZvKCBwTWFjLCAmcEJlYWNvblN0cnVjdC0+ZXJwSUVJbmZvLCAmcEJlYWNvbi0+RVJQSW5mbyApOworICAgIH0KKworI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRklfMTFSCisgICAgaWYgKHBCZWFjb24tPk1vYmlsaXR5RG9tYWluLnByZXNlbnQpCisgICAgeworICAgICAgICAvLyBNb2JpbGl0eURvbWFpbgorICAgICAgICBwQmVhY29uU3RydWN0LT5tZGllUHJlc2VudCA9IDE7CisgICAgICAgIHZvc19tZW1fY29weSggKHRBTklfVTggKikmKHBCZWFjb25TdHJ1Y3QtPm1kaWVbMF0pLAorICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1U4ICopJihwQmVhY29uLT5Nb2JpbGl0eURvbWFpbi5NRElEKSwgc2l6ZW9mKHRBTklfVTE2KSApOworICAgICAgICBwQmVhY29uU3RydWN0LT5tZGllWzJdID0gKChwQmVhY29uLT5Nb2JpbGl0eURvbWFpbi5vdmVyRFNDYXAgPDwgMCkgfCAocEJlYWNvbi0+TW9iaWxpdHlEb21haW4ucmVzb3VyY2VSZXFDYXAgPDwgMSkpOworCisgICAgfQorI2VuZGlmCisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICAgaWYgKHBCZWFjb24tPkVTRVR4bWl0UG93ZXIucHJlc2VudCkKKyAgICB7CisgICAgICAgIC8vRVNFIFR4IFBvd2VyCisgICAgICAgIHBCZWFjb25TdHJ1Y3QtPmVzZVR4UHdyLnByZXNlbnQgPSAxOworICAgICAgICB2b3NfbWVtX2NvcHkoJnBCZWFjb25TdHJ1Y3QtPmVzZVR4UHdyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEJlYWNvbi0+RVNFVHhtaXRQb3dlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHREb3QxMWZJRUVTRVR4bWl0UG93ZXIpKTsKKyAgICB9CisjZW5kaWYKKworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisgICAgaWYgKCBwQmVhY29uLT5WSFRDYXBzLnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9jb3B5KCAmcEJlYWNvblN0cnVjdC0+VkhUQ2FwcywgJnBCZWFjb24tPlZIVENhcHMsIHNpemVvZiggdERvdDExZklFVkhUQ2FwcyApICk7CisgICAgfQorICAgIGlmICggcEJlYWNvbi0+VkhUT3BlcmF0aW9uLnByZXNlbnQgKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9jb3B5KCAmcEJlYWNvblN0cnVjdC0+VkhUT3BlcmF0aW9uLCAmcEJlYWNvbi0+VkhUT3BlcmF0aW9uLAorICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiggdERvdDExZklFVkhUT3BlcmF0aW9uKSApOworICAgIH0KKyAgICBpZiAoIHBCZWFjb24tPlZIVEV4dEJzc0xvYWQucHJlc2VudCApCisgICAgeworICAgICAgICB2b3NfbWVtX2NvcHkoICZwQmVhY29uU3RydWN0LT5WSFRFeHRCc3NMb2FkLCAmcEJlYWNvbi0+VkhURXh0QnNzTG9hZCwKKyAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoIHREb3QxMWZJRVZIVEV4dEJzc0xvYWQpICk7CisgICAgfQorICAgIGlmKHBCZWFjb24tPk9wZXJhdGluZ01vZGUucHJlc2VudCkKKyAgICB7CisgICAgICAgIHZvc19tZW1fY29weSggJnBCZWFjb25TdHJ1Y3QtPk9wZXJhdGluZ01vZGUsICZwQmVhY29uLT5PcGVyYXRpbmdNb2RlLAorICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiggdERvdDExZklFT3BlcmF0aW5nTW9kZSkgKTsKKyAgICB9CisgICAgaWYocEJlYWNvbi0+V2lkZXJCV0NoYW5Td2l0Y2hBbm4ucHJlc2VudCkKKyAgICB7CisgICAgICAgIHBCZWFjb25TdHJ1Y3QtPldpZGVyQldDaGFuU3dpdGNoQW5uUHJlc2VudCA9IDE7CisgICAgICAgIHZvc19tZW1fY29weSggJnBCZWFjb25TdHJ1Y3QtPldpZGVyQldDaGFuU3dpdGNoQW5uLCAmcEJlYWNvbi0+V2lkZXJCV0NoYW5Td2l0Y2hBbm4sCisgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCB0RG90MTFmSUVXaWRlckJXQ2hhblN3aXRjaEFubikpOworICAgIH0gICAgICAKKyNlbmRpZgorICAgIGlmKHBCZWFjb24tPk9CU1NTY2FuUGFyYW1ldGVycy5wcmVzZW50KQorICAgIHsKKyAgICAgICB2b3NfbWVtX2NvcHkoICZwQmVhY29uU3RydWN0LT5PQlNTU2NhblBhcmFtZXRlcnMsCisgICAgICAgICAgICAgICAgICAgICAmcEJlYWNvbi0+T0JTU1NjYW5QYXJhbWV0ZXJzLAorICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCB0RG90MTFmSUVPQlNTU2NhblBhcmFtZXRlcnMpKTsKKyAgICB9CisKKyAgICB2b3NfbWVtX3ZmcmVlKHBCZWFjb24pOworICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7CisKK30gLy8gRW5kIHNpckNvbnZlcnRCZWFjb25GcmFtZTJTdHJ1Y3QuCisKK3RTaXJSZXRTdGF0dXMKK3NpckNvbnZlcnRBdXRoRnJhbWUyU3RydWN0KHRwQW5pU2lyR2xvYmFsICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAqcEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgICAgbkZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJNYWNBdXRoRnJhbWVCb2R5IHBBdXRoKQoreworICAgIHN0YXRpYyB0RG90MTFmQXV0aGVudGljYXRpb24gYXV0aDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgICAgICAgICBzdGF0dXM7CisKKyAgICAvLyBaZXJvLWluaXQgb3VyIFtvdXRdIHBhcmFtZXRlciwKKyAgICB2b3NfbWVtX3NldCggKCB0QU5JX1U4KiApcEF1dGgsIHNpemVvZih0U2lyTWFjQXV0aEZyYW1lQm9keSksIDAgKTsKKworICAgIC8vIGRlbGVnYXRlIHRvIHRoZSBmcmFtZXNjLWdlbmVyYXRlZCBjb2RlLAorICAgIHN0YXR1cyA9IGRvdDExZlVucGFja0F1dGhlbnRpY2F0aW9uKCBwTWFj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AgPSBhdXRoLlN0YXR1cy5zdGF0dXM7CisKKyAgICBpZiAoIGF1dGguQ2hhbGxlbmdlVGV4dC5wcmVzZW50ICkKKyAgICB7CisgICAgICAgIHBBdXRoLT50eXBlICAgPSBTSVJfTUFDX0NIQUxMRU5HRV9URVhUX0VJRDsKKyAgICAgICAgcEF1dGgtPmxlbmd0aCA9IGF1dGguQ2hhbGxlbmdlVGV4dC5udW1fdGV4dDsKKyAgICAgICAgdm9zX21lbV9jb3B5KCBwQXV0aC0+Y2hhbGxlbmdlVGV4dCwgYXV0aC5DaGFsbGVuZ2VUZXh0LnRleHQsIGF1dGguQ2hhbGxlbmdlVGV4dC5udW1fdGV4dCApOworICAgIH0KKworICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7CisKK30gLy8gRW5kIHNpckNvbnZlcnRBdXRoRnJhbWUyU3RydWN0LgorCit0U2lyUmV0U3RhdHVzCitzaXJDb252ZXJ0QWRkdHNSZXEyU3RydWN0KHRwQW5pU2lyR2xvYmFsICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggICAgICAgICAgICAgICAqcEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAgICAgICAgICAgICAgIG5GcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpckFkZHRzUmVxSW5mbyAqcEFkZFRzKQoreworICAgIHREb3QxMWZBZGRUU1JlcXVlc3QgICAgYWRkdHMgPSB7ezB9fTsKKyAgICB0RG90MTFmV01NQWRkVFNSZXF1ZXN0IHdtbWFkZHRzID0ge3swfX07CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgIGo7CisgICAgdEFOSV9VMTYgICAgICAgICAgICAgICAgICAgIGk7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgICAgIHN0YXR1czsKKworICAgIGlmICggU0lSX01BQ19RT1NfQUREX1RTX1JFUSAhPSAqKCBwRnJhbWUgKyAxICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgic2lyQ29udmVydEFkZHRzUmVxMlN0cnVjdCBpbnZva2VkICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAid2l0aCBhbiBBY3Rpb24gb2YgJWQ7IHRoaXMgaXMgbm90ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAic3VwcG9ydGVkICYgaXMgcHJvYmFibHkgYW4gZXJyb3IuIiksCisgICAgICAgICAgICAgICAgICAgKiggcEZyYW1lICsgMSApICk7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorCisgICAgLy8gWmVyby1pbml0IG91ciBbb3V0XSBwYXJhbWV0ZXIsCisgICAgdm9zX21lbV9zZXQoICggdEFOSV9VOCogKXBBZGRUcywgc2l6ZW9mKHRTaXJBZGR0c1JlcUluZm8pLCAwICk7CisKKyAgICAvLyBkZWxlZ2F0ZSB0byB0aGUgZnJhbWVzYy1nZW5lcmF0ZWQgY29kZSwKKyAgICBzd2l0Y2ggKCAqcEZyYW1lICkKKyAgICB7CisgICAgY2FzZSBTSVJfTUFDX0FDVElPTl9RT1NfTUdNVDoKKyAgICAgICAgc3RhdHVzID0gZG90MTFmVW5wYWNrQWRkVFNSZXF1ZXN0KCBwTWFjLCBwRnJhbWUsIG5GcmFtZSwgJmFkZHRzICk7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgU0lSX01BQ19BQ1RJT05fV01FOgorICAgICAgICBzdGF0dXMgPSBkb3QxMWZVbnBhY2tXTU1BZGRUU1JlcXVlc3QoIHBNYWMsIHBGcmFtZSwgbkZyYW1lLCAmd21tYWRkdHMgKTsKKyAgICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgic2lyQ29udmVydEFkZHRzUmVxMlN0cnVjdCBpbnZva2VkICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAid2l0aCBhIENhdGVnb3J5IG9mICVkOyB0aGlzIGlzIG5vdCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIHN1cHBvcnRlZCAmIGlzIHByb2JhYmx5IGFuIGVycm9yLiIpLAorICAgICAgICAgICAgICAgICAgICpwRnJhbWUgKTsKKyAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICB9CisKKyAgICBpZiAoIERPVDExRl9GQUlMRUQoIHN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyhwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIHBhcnNlIGFuIEFkZCBUUyBSZXF1ZXN0IGYiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAicmFtZSAoMHglMDh4LCAlZCBieXRlcykiKSwKKyAgICAgICAgICAgICAgICAgIHN0YXR1cywgbkZyYW1lKTsKKyAgICAgICAgUEVMT0cyKHNpckR1bXBCdWYocE1hYywgU0lSX0RCR19NT0RVTEVfSUQsIExPRzIsIHBGcmFtZSwgbkZyYW1lKTspCisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorICAgIGVsc2UgaWYgKCBET1QxMUZfV0FSTkVEKCBzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csIEZMKCJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIHVucGFja2luIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJnIGFuIEFkZCBUUyBSZXF1ZXN0IGZyYW1lICgweCUwOHgsIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlZCBieXRlcykiKSwKKyAgICAgICAgICAgICAgICAgICBzdGF0dXMsIG5GcmFtZSApOworICAgICAgICBQRUxPRzIoc2lyRHVtcEJ1ZihwTWFjLCBTSVJfREJHX01PRFVMRV9JRCwgTE9HMiwgcEZyYW1lLCBuRnJhbWUpOykKKyAgICB9CisKKyAgICAvLyAmICJ0cmFuc2xpdGVyYXRlIiBmcm9tIGEgJ3REb3QxMWZBZGRUU1JlcXVlc3QnIG9yIGEKKyAgICAvLyAndERvdDExV01NQWRkVFNSZXF1ZXN0JyB0byBhICd0U2lyTWFjQWRkdHNSZXFJbmZvJy4uLgorICAgIGlmICggU0lSX01BQ19BQ1RJT05fUU9TX01HTVQgPT0gKnBGcmFtZSApCisgICAgeworICAgICAgICBwQWRkVHMtPmRpYWxvZ1Rva2VuID0gYWRkdHMuRGlhbG9nVG9rZW4udG9rZW47CisKKyAgICAgICAgaWYgKCBhZGR0cy5UU1BFQy5wcmVzZW50ICkKKyAgICAgICAgeworICAgICAgICAgICAgQ29udmVydFRTUEVDKCBwTWFjLCAmcEFkZFRzLT50c3BlYywgJmFkZHRzLlRTUEVDICk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJNYW5kYXRvcnkgVFNQRUMgZWxlbWVudCBtaXNzaW5nIGluIEFkZCBUUyBSZXF1ZXN0LiIpICk7CisgICAgICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCBhZGR0cy5udW1fVENMQVMgKQorICAgICAgICB7CisgICAgICAgICAgICBwQWRkVHMtPm51bVRjbGFzID0gKHRBTklfVTgpYWRkdHMubnVtX1RDTEFTOworCisgICAgICAgICAgICBmb3IgKCBpID0gMFU7IGkgPCBhZGR0cy5udW1fVENMQVM7ICsraSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKCBlU0lSX1NVQ0NFU1MgIT0gQ29udmVydFRDTEFTKCBwTWFjLCAmKCBwQWRkVHMtPnRjbGFzSW5mb1tpXSApLCAmKCBhZGR0cy5UQ0xBU1tpXSApICkgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgiRmFpbGVkIHRvIGNvbnZlcnQgYSBUQ0xBUyBJRS4iKSApOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmICggYWRkdHMuVENMQVNTUFJPQy5wcmVzZW50ICkKKyAgICAgICAgeworICAgICAgICAgICAgcEFkZFRzLT50Y2xhc1Byb2NQcmVzZW50ID0gMTsKKyAgICAgICAgICAgIHBBZGRUcy0+dGNsYXNQcm9jID0gYWRkdHMuVENMQVNTUFJPQy5wcm9jZXNzaW5nOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCBhZGR0cy5XTU1UU1BFQy5wcmVzZW50ICkKKyAgICAgICAgeworICAgICAgICAgICAgcEFkZFRzLT53c21Uc3BlY1ByZXNlbnQgPSAxOworICAgICAgICAgICAgQ29udmVydFdNTVRTUEVDKCBwTWFjLCAmcEFkZFRzLT50c3BlYywgJmFkZHRzLldNTVRTUEVDICk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIGFkZHRzLm51bV9XTU1UQ0xBUyApCisgICAgICAgIHsKKyAgICAgICAgICAgIGogPSAodEFOSV9VOCkocEFkZFRzLT5udW1UY2xhcyArIGFkZHRzLm51bV9XTU1UQ0xBUyk7CisgICAgICAgICAgICBpZiAoIFNJUl9NQUNfVENMQVNJRV9NQVhOVU0gPiBqICkgaiA9IFNJUl9NQUNfVENMQVNJRV9NQVhOVU07CisKKyAgICAgICAgICAgIGZvciAoIGkgPSBwQWRkVHMtPm51bVRjbGFzOyBpIDwgajsgKytpICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoIGVTSVJfU1VDQ0VTUyAhPSBDb252ZXJ0V01NVENMQVMoIHBNYWMsICYoIHBBZGRUcy0+dGNsYXNJbmZvW2ldICksICYoIGFkZHRzLldNTVRDTEFTW2ldICkgKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gY29udmVydCBhIFRDTEFTIElFLiIpICk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKCBhZGR0cy5XTU1UQ0xBU1BST0MucHJlc2VudCApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBBZGRUcy0+dGNsYXNQcm9jUHJlc2VudCA9IDE7CisgICAgICAgICAgICBwQWRkVHMtPnRjbGFzUHJvYyA9IGFkZHRzLldNTVRDTEFTUFJPQy5wcm9jZXNzaW5nOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCAxIDwgcEFkZFRzLT5udW1UY2xhcyAmJiAoICEgcEFkZFRzLT50Y2xhc1Byb2NQcmVzZW50ICkgKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCIlZCBUQ0xBUyBJRSBidXQgbm90IFRDTEFTUFJPQyBJRS4iKSwKKyAgICAgICAgICAgICAgICAgICAgICAgcEFkZFRzLT5udW1UY2xhcyApOworICAgICAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBwQWRkVHMtPmRpYWxvZ1Rva2VuID0gd21tYWRkdHMuRGlhbG9nVG9rZW4udG9rZW47CisKKyAgICAgICAgaWYgKCB3bW1hZGR0cy5XTU1UU1BFQy5wcmVzZW50ICkKKyAgICAgICAgeworICAgICAgICAgICAgcEFkZFRzLT53bWVUc3BlY1ByZXNlbnQgPSAxOworICAgICAgICAgICAgQ29udmVydFdNTVRTUEVDKCBwTWFjLCAmcEFkZFRzLT50c3BlYywgJndtbWFkZHRzLldNTVRTUEVDICk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJNYW5kYXRvcnkgV01FIFRTUEVDIGVsZW1lbnQgbWlzc2luZyEiKSApOworICAgICAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7CisKK30gLy8gRW5kIHNpckNvbnZlcnRBZGR0c1JlcTJTdHJ1Y3QuCisKK3RTaXJSZXRTdGF0dXMKK3NpckNvbnZlcnRBZGR0c1JzcDJTdHJ1Y3QodHBBbmlTaXJHbG9iYWwgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAgICAgICAgICAgICAgICpwRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICAgICAgICAgICAgICAgbkZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyQWRkdHNSc3BJbmZvICpwQWRkVHMpCit7CisgICAgdERvdDExZkFkZFRTUmVzcG9uc2UgICAgYWRkdHMgPSB7ezB9fTsKKyAgICB0RG90MTFmV01NQWRkVFNSZXNwb25zZSB3bW1hZGR0cyA9IHt7MH19OworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgajsKKyAgICB0QU5JX1UxNiAgICAgICAgICAgICAgICAgICAgIGk7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgICAgICBzdGF0dXM7CisKKyAgICBpZiAoIFNJUl9NQUNfUU9TX0FERF9UU19SU1AgIT0gKiggcEZyYW1lICsgMSApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoInNpckNvbnZlcnRBZGR0c1JzcDJTdHJ1Y3QgaW52b2tlZCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIndpdGggYW4gQWN0aW9uIG9mICVkOyB0aGlzIGlzIG5vdCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInN1cHBvcnRlZCAmIGlzIHByb2JhYmx5IGFuIGVycm9yLiIpLAorICAgICAgICAgICAgICAgICAgICooIHBGcmFtZSArIDEgKSApOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKworICAgIC8vIFplcm8taW5pdCBvdXIgW291dF0gcGFyYW1ldGVyLAorICAgIHZvc19tZW1fc2V0KCAoIHRBTklfVTgqIClwQWRkVHMsIHNpemVvZih0U2lyQWRkdHNSc3BJbmZvKSwgMCApOworICAgIHZvc19tZW1fc2V0KCAoIHRBTklfVTgqICkmYWRkdHMsIHNpemVvZih0RG90MTFmQWRkVFNSZXNwb25zZSksIDAgKTsKKyAgICB2b3NfbWVtX3NldCggKCB0QU5JX1U4KiApJndtbWFkZHRzLCBzaXplb2YodERvdDExZldNTUFkZFRTUmVzcG9uc2UpLCAwICk7CisKKworICAgIC8vIGRlbGVnYXRlIHRvIHRoZSBmcmFtZXNjLWdlbmVyYXRlZCBjb2RlLAorICAgIHN3aXRjaCAoICpwRnJhbWUgKQorICAgIHsKKyAgICBjYXNlIFNJUl9NQUNfQUNUSU9OX1FPU19NR01UOgorICAgICAgICBzdGF0dXMgPSBkb3QxMWZVbnBhY2tBZGRUU1Jlc3BvbnNlKCBwTWFjLCBwRnJhbWUsIG5GcmFtZSwgJmFkZHRzICk7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgU0lSX01BQ19BQ1RJT05fV01FOgorICAgICAgICBzdGF0dXMgPSBkb3QxMWZVbnBhY2tXTU1BZGRUU1Jlc3BvbnNlKCBwTWFjLCBwRnJhbWUsIG5GcmFtZSwgJndtbWFkZHRzICk7CisgICAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoInNpckNvbnZlcnRBZGR0c1JzcDJTdHJ1Y3QgaW52b2tlZCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIndpdGggYSBDYXRlZ29yeSBvZiAlZDsgdGhpcyBpcyBub3QiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBzdXBwb3J0ZWQgJiBpcyBwcm9iYWJseSBhbiBlcnJvci4iKSwKKyAgICAgICAgICAgICAgICAgICAqcEZyYW1lICk7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorCisgICAgaWYgKCBET1QxMUZfRkFJTEVEKCBzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBwYXJzZSBhbiBBZGQgVFMgUmVzcG9uc2UgZiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyYW1lICgweCUwOHgsICVkIGJ5dGVzKSIpLAorICAgICAgICAgICAgICAgICAgc3RhdHVzLCBuRnJhbWUpOworICAgICAgICBQRUxPRzIoc2lyRHVtcEJ1ZihwTWFjLCBTSVJfREJHX01PRFVMRV9JRCwgTE9HMiwgcEZyYW1lLCBuRnJhbWUpOykKKyAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICB9CisgICAgZWxzZSBpZiAoIERPVDExRl9XQVJORUQoIHN0YXR1cyApICkKKyAgICB7CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HVywgRkwoIlRoZXJlIHdlcmUgd2FybmluZ3Mgd2hpbGUgdW5wYWNraW4iCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImcgYW4gQWRkIFRTIFJlc3BvbnNlIGZyYW1lICgweCUwOHgsIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlZCBieXRlcykiKSwKKyAgICAgICAgICAgICAgICAgICBzdGF0dXMsIG5GcmFtZSApOworICAgICAgICBQRUxPRzIoc2lyRHVtcEJ1ZihwTWFjLCBTSVJfREJHX01PRFVMRV9JRCwgTE9HMiwgcEZyYW1lLCBuRnJhbWUpOykKKyAgICB9CisKKyAgICAvLyAmICJ0cmFuc2xpdGVyYXRlIiBmcm9tIGEgJ3REb3QxMWZBZGRUU1Jlc3BvbnNlJyBvciBhCisgICAgLy8gJ3REb3QxMVdNTUFkZFRTUmVzcG9uc2UnIHRvIGEgJ3RTaXJNYWNBZGR0c1JzcEluZm8nLi4uCisgICAgaWYgKCBTSVJfTUFDX0FDVElPTl9RT1NfTUdNVCA9PSAqcEZyYW1lICkKKyAgICB7CisgICAgICAgIHBBZGRUcy0+ZGlhbG9nVG9rZW4gPSBhZGR0cy5EaWFsb2dUb2tlbi50b2tlbjsKKyAgICAgICAgcEFkZFRzLT5zdGF0dXMgICAgICA9ICggdFNpck1hY1N0YXR1c0NvZGVzIClhZGR0cy5TdGF0dXMuc3RhdHVzOworCisgICAgICAgIGlmICggYWRkdHMuVFNEZWxheS5wcmVzZW50ICkKKyAgICAgICAgeworICAgICAgICAgICAgQ29udmVydFRTRGVsYXkoIHBNYWMsICZwQWRkVHMtPmRlbGF5LCAmYWRkdHMuVFNEZWxheSApOworICAgICAgICB9CisKKyAgICAgICAgLy8gVFMgRGVsYXkgaXMgcHJlc2VudCBpZmYgc3RhdHVzIGluZGljYXRlcyBpdHMgcHJlc2VuY2UKKyAgICAgICAgaWYgKCBlU0lSX01BQ19UU19OT1RfQ1JFQVRFRF9TVEFUVVMgPT0gcEFkZFRzLT5zdGF0dXMgJiYgISBhZGR0cy5UU0RlbGF5LnByZXNlbnQgKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR1csIEZMKCJNaXNzaW5nIFRTRGVsYXkgSUUuIikgKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmICggYWRkdHMuVFNQRUMucHJlc2VudCApCisgICAgICAgIHsKKyAgICAgICAgICAgIENvbnZlcnRUU1BFQyggcE1hYywgJnBBZGRUcy0+dHNwZWMsICZhZGR0cy5UU1BFQyApOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgiTWFuZGF0b3J5IFRTUEVDIGVsZW1lbnQgbWlzc2luZyBpbiBBZGQgVFMgUmVzcG9uc2UuIikgKTsKKyAgICAgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIGFkZHRzLm51bV9UQ0xBUyApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBBZGRUcy0+bnVtVGNsYXMgPSAodEFOSV9VOClhZGR0cy5udW1fVENMQVM7CisKKyAgICAgICAgICAgIGZvciAoIGkgPSAwVTsgaSA8IGFkZHRzLm51bV9UQ0xBUzsgKytpICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoIGVTSVJfU1VDQ0VTUyAhPSBDb252ZXJ0VENMQVMoIHBNYWMsICYoIHBBZGRUcy0+dGNsYXNJbmZvW2ldICksICYoIGFkZHRzLlRDTEFTW2ldICkgKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gY29udmVydCBhIFRDTEFTIElFLiIpICk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKCBhZGR0cy5UQ0xBU1NQUk9DLnByZXNlbnQgKQorICAgICAgICB7CisgICAgICAgICAgICBwQWRkVHMtPnRjbGFzUHJvY1ByZXNlbnQgPSAxOworICAgICAgICAgICAgcEFkZFRzLT50Y2xhc1Byb2MgPSBhZGR0cy5UQ0xBU1NQUk9DLnByb2Nlc3Npbmc7CisgICAgICAgIH0KKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICAgICAgIGlmKGFkZHRzLkVTRVRyYWZTdHJtTWV0LnByZXNlbnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBBZGRUcy0+dHNtUHJlc2VudCA9IDE7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnBBZGRUcy0+dHNtSUUudHNpZCwKKyAgICAgICAgICAgICAgICAgICAgICAmYWRkdHMuRVNFVHJhZlN0cm1NZXQudHNpZCxzaXplb2YodFNpck1hY0VTRVRTTUlFKSk7CisgICAgICAgIH0KKyNlbmRpZgorICAgICAgICBpZiAoIGFkZHRzLlNjaGVkdWxlLnByZXNlbnQgKQorICAgICAgICB7CisgICAgICAgICAgICBwQWRkVHMtPnNjaGVkdWxlUHJlc2VudCA9IDE7CisgICAgICAgICAgICBDb252ZXJ0U2NoZWR1bGUoIHBNYWMsICZwQWRkVHMtPnNjaGVkdWxlLCAmYWRkdHMuU2NoZWR1bGUgKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmICggYWRkdHMuV01NU2NoZWR1bGUucHJlc2VudCApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBBZGRUcy0+c2NoZWR1bGVQcmVzZW50ID0gMTsKKyAgICAgICAgICAgIENvbnZlcnRXTU1TY2hlZHVsZSggcE1hYywgJnBBZGRUcy0+c2NoZWR1bGUsICZhZGR0cy5XTU1TY2hlZHVsZSApOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCBhZGR0cy5XTU1UU1BFQy5wcmVzZW50ICkKKyAgICAgICAgeworICAgICAgICAgICAgcEFkZFRzLT53c21Uc3BlY1ByZXNlbnQgPSAxOworICAgICAgICAgICAgQ29udmVydFdNTVRTUEVDKCBwTWFjLCAmcEFkZFRzLT50c3BlYywgJmFkZHRzLldNTVRTUEVDICk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIGFkZHRzLm51bV9XTU1UQ0xBUyApCisgICAgICAgIHsKKyAgICAgICAgICAgIGogPSAodEFOSV9VOCkocEFkZFRzLT5udW1UY2xhcyArIGFkZHRzLm51bV9XTU1UQ0xBUyk7CisgICAgICAgICAgICBpZiAoIFNJUl9NQUNfVENMQVNJRV9NQVhOVU0gPiBqICkgaiA9IFNJUl9NQUNfVENMQVNJRV9NQVhOVU07CisKKyAgICAgICAgICAgIGZvciAoIGkgPSBwQWRkVHMtPm51bVRjbGFzOyBpIDwgajsgKytpICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoIGVTSVJfU1VDQ0VTUyAhPSBDb252ZXJ0V01NVENMQVMoIHBNYWMsICYoIHBBZGRUcy0+dGNsYXNJbmZvW2ldICksICYoIGFkZHRzLldNTVRDTEFTW2ldICkgKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gY29udmVydCBhIFRDTEFTIElFLiIpICk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKCBhZGR0cy5XTU1UQ0xBU1BST0MucHJlc2VudCApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBBZGRUcy0+dGNsYXNQcm9jUHJlc2VudCA9IDE7CisgICAgICAgICAgICBwQWRkVHMtPnRjbGFzUHJvYyA9IGFkZHRzLldNTVRDTEFTUFJPQy5wcm9jZXNzaW5nOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCAxIDwgcEFkZFRzLT5udW1UY2xhcyAmJiAoICEgcEFkZFRzLT50Y2xhc1Byb2NQcmVzZW50ICkgKQorICAgICAgICB7CisgICAgICAgICAgICBsaW1Mb2coIHBNYWMsIExPR0UsIEZMKCIlZCBUQ0xBUyBJRSBidXQgbm90IFRDTEFTUFJPQyBJRS4iKSwKKyAgICAgICAgICAgICAgICAgICAgICAgcEFkZFRzLT5udW1UY2xhcyApOworICAgICAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBwQWRkVHMtPmRpYWxvZ1Rva2VuID0gd21tYWRkdHMuRGlhbG9nVG9rZW4udG9rZW47CisgICAgICAgIHBBZGRUcy0+c3RhdHVzICAgICAgPSAoIHRTaXJNYWNTdGF0dXNDb2RlcyApd21tYWRkdHMuU3RhdHVzQ29kZS5zdGF0dXNDb2RlOworCisgICAgICAgIGlmICggd21tYWRkdHMuV01NVFNQRUMucHJlc2VudCApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBBZGRUcy0+d21lVHNwZWNQcmVzZW50ID0gMTsKKyAgICAgICAgICAgIENvbnZlcnRXTU1UU1BFQyggcE1hYywgJnBBZGRUcy0+dHNwZWMsICZ3bW1hZGR0cy5XTU1UU1BFQyApOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgiTWFuZGF0b3J5IFdNRSBUU1BFQyBlbGVtZW50IG1pc3NpbmchIikgKTsKKyAgICAgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgICAgIH0KKworI2lmZGVmIEZFQVRVUkVfV0xBTl9FU0UKKyAgICAgICAgaWYod21tYWRkdHMuRVNFVHJhZlN0cm1NZXQucHJlc2VudCkKKyAgICAgICAgeworICAgICAgICAgICAgcEFkZFRzLT50c21QcmVzZW50ID0gMTsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSgmcEFkZFRzLT50c21JRS50c2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICZ3bW1hZGR0cy5FU0VUcmFmU3RybU1ldC50c2lkLHNpemVvZih0U2lyTWFjRVNFVFNNSUUpKTsKKyAgICAgICAgfQorI2VuZGlmCisKKyAgICB9CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworCit9IC8vIEVuZCBzaXJDb252ZXJ0QWRkdHNSc3AyU3RydWN0LgorCit0U2lyUmV0U3RhdHVzCitzaXJDb252ZXJ0RGVsdHNSZXEyU3RydWN0KHRwQW5pU2lyR2xvYmFsICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggICAgICAgICAgICAgICAqcEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAgICAgICAgICAgICAgIG5GcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpckRlbHRzUmVxSW5mbyAqcERlbFRzKQoreworICAgIHREb3QxMWZEZWxUUyAgICBkZWx0cyA9IHt7MH19OworICAgIHREb3QxMWZXTU1EZWxUUyB3bW1kZWx0cyA9IHt7MH19OworICAgIHRBTklfVTMyICAgICAgICAgICAgIHN0YXR1czsKKworICAgIGlmICggU0lSX01BQ19RT1NfREVMX1RTX1JFUSAhPSAqKCBwRnJhbWUgKyAxICkgKQorICAgIHsKKyAgICAgICAgbGltTG9nKCBwTWFjLCBMT0dFLCBGTCgic2lyQ29udmVydERlbHRzUnNwMlN0cnVjdCBpbnZva2VkICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAid2l0aCBhbiBBY3Rpb24gb2YgJWQ7IHRoaXMgaXMgbm90ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAic3VwcG9ydGVkICYgaXMgcHJvYmFibHkgYW4gZXJyb3IuIiksCisgICAgICAgICAgICAgICAgICAgKiggcEZyYW1lICsgMSApICk7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorCisgICAgLy8gWmVyby1pbml0IG91ciBbb3V0XSBwYXJhbWV0ZXIsCisgICAgdm9zX21lbV9zZXQoICggdEFOSV9VOCogKXBEZWxUcywgc2l6ZW9mKHRTaXJEZWx0c1JlcUluZm8pLCAwICk7CisKKyAgICAvLyBkZWxlZ2F0ZSB0byB0aGUgZnJhbWVzYy1nZW5lcmF0ZWQgY29kZSwKKyAgICBzd2l0Y2ggKCAqcEZyYW1lICkKKyAgICB7CisgICAgY2FzZSBTSVJfTUFDX0FDVElPTl9RT1NfTUdNVDoKKyAgICAgICAgc3RhdHVzID0gZG90MTFmVW5wYWNrRGVsVFMoIHBNYWMsIHBGcmFtZSwgbkZyYW1lLCAmZGVsdHMgKTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBTSVJfTUFDX0FDVElPTl9XTUU6CisgICAgICAgIHN0YXR1cyA9IGRvdDExZlVucGFja1dNTURlbFRTKCBwTWFjLCBwRnJhbWUsIG5GcmFtZSwgJndtbWRlbHRzICk7CisgICAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoInNpckNvbnZlcnREZWx0c1JzcDJTdHJ1Y3QgaW52b2tlZCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIndpdGggYSBDYXRlZ29yeSBvZiAlZDsgdGhpcyBpcyBub3QiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBzdXBwb3J0ZWQgJiBpcyBwcm9iYWJseSBhbiBlcnJvci4iKSwKKyAgICAgICAgICAgICAgICAgICAqcEZyYW1lICk7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorCisgICAgaWYgKCBET1QxMUZfRkFJTEVEKCBzdGF0dXMgKSApCisgICAgeworICAgICAgICBsaW1Mb2cocE1hYywgTE9HRSwgRkwoIkZhaWxlZCB0byBwYXJzZSBhbiBEZWwgVFMgUmVxdWVzdCBmIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInJhbWUgKDB4JTA4eCwgJWQgYnl0ZXMpIiksCisgICAgICAgICAgICAgICAgICBzdGF0dXMsIG5GcmFtZSk7CisgICAgICAgIFBFTE9HMihzaXJEdW1wQnVmKHBNYWMsIFNJUl9EQkdfTU9EVUxFX0lELCBMT0cyLCBwRnJhbWUsIG5GcmFtZSk7KQorICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKyAgICBlbHNlIGlmICggRE9UMTFGX1dBUk5FRCggc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgZG90MTFmTG9nKCBwTWFjLCBMT0dXLCBGTCgiVGhlcmUgd2VyZSB3YXJuaW5ncyB3aGlsZSB1bnBhY2tpbiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZyBhbiBEZWwgVFMgUmVxdWVzdCBmcmFtZSAoMHglMDh4LCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJWQgYnl0ZXMpOiIpLAorICAgICAgICAgICAgICAgICAgIHN0YXR1cywgbkZyYW1lICk7CisgICAgICAgIFBFTE9HMihzaXJEdW1wQnVmKHBNYWMsIFNJUl9EQkdfTU9EVUxFX0lELCBMT0cyLCBwRnJhbWUsIG5GcmFtZSk7KQorICAgIH0KKworICAgIC8vICYgInRyYW5zbGl0ZXJhdGUiIGZyb20gYSAndERvdDExZkRlbFRTUmVzcG9uc2UnIG9yIGEKKyAgICAvLyAndERvdDExV01NRGVsVFNSZXNwb25zZScgdG8gYSAndFNpck1hY0RlbHRzUmVxSW5mbycuLi4KKyAgICBpZiAoIFNJUl9NQUNfQUNUSU9OX1FPU19NR01UID09ICpwRnJhbWUgKQorICAgIHsKKyAgICAgICAgcERlbFRzLT50c2luZm8udHJhZmZpYy50cmFmZmljVHlwZSAgPSAodEFOSV9VMTYpZGVsdHMuVFNJbmZvLnRyYWZmaWNfdHlwZTsKKyAgICAgICAgcERlbFRzLT50c2luZm8udHJhZmZpYy50c2lkICAgICAgICAgPSAodEFOSV9VMTYpZGVsdHMuVFNJbmZvLnRzaWQ7CisgICAgICAgIHBEZWxUcy0+dHNpbmZvLnRyYWZmaWMuZGlyZWN0aW9uICAgID0gKHRBTklfVTE2KWRlbHRzLlRTSW5mby5kaXJlY3Rpb247CisgICAgICAgIHBEZWxUcy0+dHNpbmZvLnRyYWZmaWMuYWNjZXNzUG9saWN5ID0gKHRBTklfVTE2KWRlbHRzLlRTSW5mby5hY2Nlc3NfcG9saWN5OworICAgICAgICBwRGVsVHMtPnRzaW5mby50cmFmZmljLmFnZ3JlZ2F0aW9uICA9ICh0QU5JX1UxNilkZWx0cy5UU0luZm8uYWdncmVnYXRpb247CisgICAgICAgIHBEZWxUcy0+dHNpbmZvLnRyYWZmaWMucHNiICAgICAgICAgID0gKHRBTklfVTE2KWRlbHRzLlRTSW5mby5wc2I7CisgICAgICAgIHBEZWxUcy0+dHNpbmZvLnRyYWZmaWMudXNlclByaW8gICAgID0gKHRBTklfVTE2KWRlbHRzLlRTSW5mby51c2VyX3ByaW9yaXR5OworICAgICAgICBwRGVsVHMtPnRzaW5mby50cmFmZmljLmFja1BvbGljeSAgICA9ICh0QU5JX1UxNilkZWx0cy5UU0luZm8udHNpbmZvX2Fja19wb2w7CisKKyAgICAgICAgcERlbFRzLT50c2luZm8uc2NoZWR1bGUuc2NoZWR1bGUgICAgPSAodEFOSV9VOClkZWx0cy5UU0luZm8uc2NoZWR1bGU7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGlmICggd21tZGVsdHMuV01NVFNQRUMucHJlc2VudCApCisgICAgICAgIHsKKyAgICAgICAgICAgIHBEZWxUcy0+d21lVHNwZWNQcmVzZW50ID0gMTsKKyAgICAgICAgICAgIENvbnZlcnRXTU1UU1BFQyggcE1hYywgJnBEZWxUcy0+dHNwZWMsICZ3bW1kZWx0cy5XTU1UU1BFQyApOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgZG90MTFmTG9nKCBwTWFjLCBMT0dFLCBGTCgiTWFuZGF0b3J5IFdNRSBUU1BFQyBlbGVtZW50IG1pc3NpbmchIikgKTsKKyAgICAgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworCit9IC8vIEVuZCBzaXJDb252ZXJ0RGVsdHNSZXEyU3RydWN0LgorCit0U2lyUmV0U3RhdHVzCitzaXJDb252ZXJ0UW9zTWFwQ29uZmlndXJlRnJhbWUyU3RydWN0KHRwQW5pU2lyR2xvYmFsICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggICAgICAgICAgICAgICAqcEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiAgICAgICAgICAgICAgIG5GcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpclFvc01hcFNldCAgICAgICpwUW9zTWFwU2V0KQoreworICAgIHREb3QxMWZRb3NNYXBDb25maWd1cmUgbWFwQ29uZmlndXJlOworICAgIHRBTklfVTMyIHN0YXR1czsKKyAgICBzdGF0dXMgPSBkb3QxMWZVbnBhY2tRb3NNYXBDb25maWd1cmUocE1hYywgcEZyYW1lLCBuRnJhbWUsICZtYXBDb25maWd1cmUpOworICAgIGlmICggRE9UMTFGX0ZBSUxFRCggc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgZG90MTFmTG9nKHBNYWMsIExPR0UsIEZMKCJGYWlsZWQgdG8gcGFyc2UgUW9zIE1hcCBDb25maWd1cmUgZnJhbWUgKDB4JTA4eCwgJWQgYnl0ZXMpOiIpLAorICAgICAgICAgICAgICAgICAgc3RhdHVzLCBuRnJhbWUpOworICAgICAgICBQRUxPRzIoc2lyRHVtcEJ1ZihwTWFjLCBTSVJfREJHX01PRFVMRV9JRCwgTE9HMiwgcEZyYW1lLCBuRnJhbWUpOykKKyAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICB9CisgICAgZWxzZSBpZiAoIERPVDExRl9XQVJORUQoIHN0YXR1cyApICkKKyAgICB7CisgICAgICBkb3QxMWZMb2coIHBNYWMsIExPR1csIEZMKCJUaGVyZSB3ZXJlIHdhcm5pbmdzIHdoaWxlIHVucGFja2luZyBRb3MgTWFwIENvbmZpZ3VyZSBmcmFtZSAoMHglMDh4LCAlZCBieXRlcyk6IiksCisgICAgICAgICAgICAgICAgIHN0YXR1cywgbkZyYW1lICk7CisgICAgICAgIFBFTE9HMihzaXJEdW1wQnVmKHBNYWMsIFNJUl9EQkdfTU9EVUxFX0lELCBMT0cyLCBwRnJhbWUsIG5GcmFtZSk7KQorICAgIH0KKyAgICBwUW9zTWFwU2V0LT5wcmVzZW50ID0gbWFwQ29uZmlndXJlLlFvc01hcFNldC5wcmVzZW50OworICAgIENvbnZlcnRRb3NNYXBzZXRGcmFtZShwTWFjLT5oSGRkLCBwUW9zTWFwU2V0LCAmbWFwQ29uZmlndXJlLlFvc01hcFNldCk7CisgICAgbGltTG9nUW9zTWFwU2V0KHBNYWMsIHBRb3NNYXBTZXQpOworICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7Cit9CisKKyNpZmRlZiBBTklfU1VQUE9SVF8xMUgKK3RTaXJSZXRTdGF0dXMKK3NpckNvbnZlcnRUcGNSZXFGcmFtZTJTdHJ1Y3QodHBBbmlTaXJHbG9iYWwgICAgICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgICAgICAqcEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFNpck1hY1RwY1JlcUFjdGlvbkZyYW1lIHBUcGNSZXFGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgICAgICAgIG5GcmFtZSkKK3sKKyAgICB0RG90MTFmVFBDUmVxdWVzdCAgICAgcmVxOworICAgIHRBTklfVTMyICAgICAgICAgICAgICAgICAgIHN0YXR1czsKKworICAgIC8vIFplcm8taW5pdCBvdXIgW291dF0gcGFyYW1ldGVyLAorICAgIHZvc19tZW1fc2V0KCAoIHRBTklfVTgqIClwVHBjUmVxRnJhbWUsIHNpemVvZih0U2lyTWFjVHBjUmVxQWN0aW9uRnJhbWUpLCAwICk7CisKKyAgICAvLyBkZWxlZ2F0ZSB0byB0aGUgZnJhbWVzYy1nZW5lcmF0ZWQgY29kZSwKKyAgICBzdGF0dXMgPSBkb3QxMWZVbn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HJlcS5BY3Rpb24uYWN0aW9uOworICAgIHBUcGNSZXFGcmFtZS0+YWN0aW9uSGVhZGVyLmRpYWxvZ1Rva2VuID0gcmVxLkRpYWxvZ1Rva2VuLnRva2VuOworICAgIGlmICggcmVxLlRQQ1JlcXVlc3QucHJlc2VudCApCisgICAgeworICAgICAgICBwVHBjUmVxRnJhbWUtPnR5cGUgICA9IERPVDExRl9FSURfVFBDUkVRVUVTVDsKKyAgICAgICAgcFRwY1JlcUZyYW1lLT5sZW5ndGggPSAwOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBkb3QxMWZMb2coIHBNYWMsIExPR1csIEZMKCIhISFSY3YgVFBDIFJlcSBvZiBpbmFsaWQgdHlwZSEiKSApOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKworICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7CisKK30gLy8gRW5kIHNpckNvbnZlcnRUcGNSZXFGcmFtZTJTdHJ1Y3QuCisKKwordFNpclJldFN0YXR1cworc2lyQ29udmVydE1lYXNSZXFGcmFtZTJTdHJ1Y3QodHBBbmlTaXJHbG9iYWwgICAgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgICAqcEZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJNYWNNZWFzUmVxQWN0aW9uRnJhbWUgcE1lYXNSZXFGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyICAgICAgICAgICAgICAgICAgICAgICAgbkZyYW1lKQoreworICAgIHREb3QxMWZNZWFzdXJlbWVudFJlcXVlc3QgbXI7CisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1czsKKworICAgIC8vIFplcm8taW5pdCBvdXIgW291dF0gcGFyYW1ldGVyLAorICAgIHZvc19tZW1fc2V0KCAoIHRBTklfVTgqIClw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HJ1Y3QuCisjZW5kaWYKKworCit2b2lkCitQb3B1bGF0ZURvdDExZlRTUEVDKHRTaXJNYWNUc3BlY0lFICAqcE9sZCwKKyAgICAgICAgICAgICAgICAgICAgdERvdDExZklFVFNQRUMgICpwRG90MTFmKQoreworICAgIHBEb3QxMWYtPnRyYWZmaWNfdHlwZSAgICAgICAgID0gcE9sZC0+dHNpbmZvLnRyYWZmaWMudHJhZmZpY1R5cGU7CisgICAgcERvdDExZi0+dHNpZCAgICAgICAgICAgICAgICAgPSBwT2xkLT50c2luZm8udHJhZmZpYy50c2lkOworICAgIHBEb3QxMWYtPmRpcmVjdGlvbiAgICAgICAgICAgID0gcE9sZC0+dHNpbmZvLnRyYWZmaWMuZGlyZWN0aW9uOworICAgIHBEb3QxMWYtPmFjY2Vzc19wb2xpY3kgICAgICAgID0gcE9sZC0+dHNpbmZvLnRyYWZmaWMuYWNjZXNzUG9saWN5OworICAgIHBEb3QxMWYtPmFnZ3JlZ2F0aW9uICAgICAgICAgID0gcE9sZC0+dHNpbmZvLnRyYWZmaWMuYWdncmVnYXRpb247CisgICAgcERvdDExZi0+cHNiICAgICAgICAgICAgICAgICAgPSBwT2xkLT50c2luZm8udHJhZmZpYy5wc2I7CisgICAgcERvdDExZi0+dXNlcl9wcmlvcml0eSAgICAgICAgPSBwT2xkLT50c2luZm8udHJhZmZpYy51c2VyUHJpbzsKKyAgICBwRG90MTFmLT50c2luZm9fYWNrX3BvbCAgICAgICA9IHBPbGQtPnRzaW5mby50cmFmZmljLmFja1BvbGljeTsKKyAgICBwRG90MTFmLT5zY2hlZHVsZSAgICAgICAgICAgICA9IHBPbGQtPnRzaW5mby5zY2hlZHVsZS5zY2hlZHVsZTsKKyAgICAvKiBBcyBkZWZpbmVkIGluIElFRUUgODAyLjExLTIwMDcsIHNlY3Rpb24gNy4zLjIuMzAKKyAgICAgKiBOb21pbmFsIE1TRFUgc2l6ZTogQml0WzA6MTRdPVNpemUsIEJpdFsxNV09Rml4ZWQKKyA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YtPnN1cnBsdXNfYndfYWxsb3dhbmNlID0gcE9sZC0+c3VycGx1c0J3OworICAgIHBEb3QxMWYtPm1lZGl1bV90aW1lICAgICAgICAgID0gcE9sZC0+bWVkaXVtVGltZTsKKworICAgIHBEb3QxMWYtPnByZXNlbnQgPSAxOworCit9IC8vIEVuZCBQb3B1bGF0ZURvdDExZlRTUEVDLgorCit2b2lkCitQb3B1bGF0ZURvdDExZldNTVRTUEVDKHRTaXJNYWNUc3BlY0lFICAgICAqcE9sZCwKKyAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFV01NVFNQRUMgICpwRG90MTFmKQoreworICAgIHBEb3QxMWYtPnRyYWZmaWNfdHlwZSAgICAgICAgID0gcE9sZC0+dHNpbmZvLnRyYWZmaWMudHJhZmZpY1R5cGU7CisgICAgcERvdDExZi0+dHNpZCAgICAgICAgICAgICAgICAgPSBwT2xkLT50c2luZm8udHJhZmZpYy50c2lkOworICAgIHBEb3QxMWYtPmRpcmVjdGlvbiAgICAgICAgICAgID0gcE9sZC0+dHNpbmZvLnRyYWZmaWMuZGlyZWN0aW9uOworICAgIHBEb3QxMWYtPmFjY2Vzc19wb2xpY3kgICAgICAgID0gcE9sZC0+dHNpbmZvLnRyYWZmaWMuYWNjZXNzUG9saWN5OworICAgIHBEb3QxMWYtPmFnZ3JlZ2F0aW9uICAgICAgICAgID0gcE9sZC0+dHNpbmZvLnRyYWZmaWMuYWdncmVnYXRpb247CisgICAgcERvdDExZi0+cHNiICAgICAgICAgICAgICAgICAgPSBwT2xkLT50c2luZm8udHJhZmZpYy5wc2I7CisgICAgcERvdDExZi0+dXNlcl9wcmlvcml0eSAgICAgICAgPSBwT2xkLT50c2luZm8udHJhZmZpYy51c2VyUHJpbzsKKyAgICBwRG90MTFmLT50c2luZm9fYWNrX3BvbCAgICAgICA9IHBPbGQtPnRzaW5mby50cmFmZmljLmFja1BvbGljeTsKKyAgICBwRG90MTFmLT5idXJzdF9zaXplX2RlZm4gICAgICA9IHBPbG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GUgPSBSTV9TVEFURV9OT1JNQUw7CisgICAgcEVTRVJhZE1nbXRDYXAtPm1ic3NpZF9tYXNrID0gMDsKKyAgICBwRVNFUmFkTWdtdENhcC0+cmVzZXJ2ZWQgPSAwOworfQorCit0U2lyUmV0U3RhdHVzIFBvcHVsYXRlRG90MTFmRVNFQ2NrbU9wYXF1ZSggdHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cFNpckNDS01pZSAgICBwQ0NLTWllLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUVTRUNja21PcGFxdWUgKnBEb3QxMWYgKQoreworICAgIGludCBpZHg7CisKKyAgICBpZiAoIHBDQ0tNaWUtPmxlbmd0aCApCisgICAgeworICAgICAgICBpZiggMCA8PSAoIGlkeCA9IEZpbmRJRUxvY2F0aW9uKCBwTWFjLCAodHBTaXJSU05pZSlwQ0NLTWllLCBET1QxMUZfRUlEX0VTRUNDS01PUEFRVUUgKSApICkKKyAgICAgICAgeworICAgICAgICAgICAgcERvdDExZi0+cHJlc2VudCAgPSAxOworICAgICAgICAgICAgcERvdDExZi0+bnVtX2RhdGEgPSBwQ0NLTWllLT5jY2ttSUVkYXRhWyBpZHggKyAxIF0gLSA0OyAvLyBEb250IGluY2x1ZGUgT1VJCisgICAgICAgICAgICB2b3NfbWVtX2NvcHkocERvdDExZi0+ZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDQ0tNaWUtPmNja21JRWRhdGEgKyBpZHggKyAyICsgNCwgICAgLy8gRUlELCBsZW4sIE9VSQorICAgICAgICAgICAgICAgICAgICAgICAgICAgcENDS01pZS0+Y2NrbUlFZGF0YVsgaWR4ICsgMSBdIC0gNCApOyAvLyBTa2lwIE9VSQorICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIGVTSVJfU1VDQ0VTUzsKKworfSAvLyBFbmQgUG9wdWxhdGVEb3QxMWZFU0VDY2ttT3BhcXVlLgorCit2b2lkIFBvcHVsYXRlRG90MTFUU1JTSUUodHBBbmlTaXJHbG9iYWwgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY0VTRVRTUlNJRSAgICAgKnBPbGQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFRVNFVHJhZlN0cm1SYXRlU2V0ICAqcERvdDExZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4IHJhdGVfbGVuZ3RoKQoreworICAgIHBEb3QxMWYtPnRzaWQgPSBwT2xkLT50c2lkOworICAgIHZvc19tZW1fY29weShwRG90MTFmLT50c3JhdGVzLCBwT2xkLT5yYXRlcyxyYXRlX2xlbmd0aCk7CisgICAgcERvdDExZi0+bnVtX3RzcmF0ZXMgPSByYXRlX2xlbmd0aDsKKyAgICBwRG90MTFmLT5wcmVzZW50ID0gMTsKK30KKyNlbmRpZgorCisKK3RTaXJSZXRTdGF0dXMKK1BvcHVsYXRlRG90MTFmVENMQVModHBBbmlTaXJHbG9iYWwgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgIHRTaXJUY2xhc0luZm8gICpwT2xkLAorICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVUQ0xBUyAqcERvdDExZikKK3sKKyAgICBwRG90MTFmLT51c2VyX3ByaW9yaXR5ICAgPSBwT2xkLT50Y2xhcy51c2VyUHJpbzsKKyAgICBwRG90MTFmLT5jbGFzc2lmaWVyX3R5cGUgPSBwT2xkLT50Y2xhcy5jbGFzc2lmaWVyVHlwZTsKKyAgICBwRG90MTFmLT5jbGFzc2lmaWVyX21hc2sgPSBwT2xkLT50Y2xhcy5jbGFzc2lmaWVyTWFzazsKKworICAgIHN3aXRjaCAoIHBEb3QxMWYtPmNsYXNzaWZpZXJfdHlwZSApCisgICAgeworICAgIGNhc2UgU0lSX01BQ19UQ0xBU1RZUEVfRVRIRVJORVQ6CisgICAgICAgIHZvc19tZW1fY29weSggKCB0QU5JX1U4KiApJnBEb3QxMWYtPmluZm8uRXRoUGFyYW1zLnNvdXJjZSwKKyAgICAgICAgICAgICAgICAgICAgICAoIHRBTklfVTgqICkmcE9sZC0+dGNsYXNQYXJhbXMuZXRoLnNyY0FkZHIsIDYgKTsKKyAgICAgICAgdm9zX21lbV9jb3B5KCAoIHRBTklfVTgqICkmcERvdDExZi0+aW5mby5FdGhQYXJhbXMuZGVzdCwKKyAgICAgICAgICAgICAgICAgICAgICAoIHRBTklfVTgqICkmcE9sZC0+dGNsYXNQYXJhbXMuZXRoLmRzdEFkZHIsIDYgKTsKKyAgICAgICAgcERvdDExZi0+aW5mby5FdGhQYXJhbXMudHlwZSA9IHBPbGQtPnRjbGFzUGFyYW1zLmV0aC50eXBlOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFNJUl9NQUNfVENMQVNUWVBFX1RDUFVEUElQOgorICAgICAgICBwRG90MTFmLT5pbmZvLklwUGFyYW1zLnZlcnNpb24gPSBwT2xkLT52ZXJzaW9uOworICAgICAgICBpZiAoIFNJUl9NQUNfVENMQVNfSVBWNCA9PSBwRG90MTFmLT5pbmZvLklwUGFyYW1zLnZlcnNpb24gKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoIHBEb3QxMWYtPmluZm8uSXBQYXJhbXMucGFyYW1zLgorICAgICAgICAgICAgICAgICAgICAgICAgICBJcFY0UGFyYW1zLnNvdXJjZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcE9sZC0+dGNsYXNQYXJhbXMuaXB2NC5zcmNJcEFkZHIsIDQgKTsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSggcERvdDExZi0+aW5mby5JcFBhcmFtcy5wYXJhbXMuCisgICAgICAgICAgICAgICAgICAgICAgICAgIElwVjRQYXJhbXMuZGVzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcE9sZC0+dGNsYXNQYXJhbXMuaXB2NC5kc3RJcEFkZHIsIDQgKTsKKyAgICAgICAgICAgIHBEb3QxMWYtPmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuc3JjX3BvcnQgID0KKyAgICAgICAgICAgICAgcE9sZC0+dGNsYXNQYXJhbXMuaXB2NC5zcmNQb3J0OworICAgICAgICAgICAgcERvdDExZi0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5kZXN0X3BvcnQgPQorICAgICAgICAgICAgICBwT2xkLT50Y2xhc1BhcmFtcy5pcHY0LmRzdFBvcnQ7CisgICAgICAgICAgICBwRG90MTFmLT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLkRTQ1AgICAgICA9CisgICAgICAgICAgICAgIHBPbGQtPnRjbGFzUGFyYW1zLmlwdjQuZHNjcDsKKyAgICAgICAgICAgIHBEb3QxMWYtPmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMucHJvdG8gICAgID0KKyAgICAgICAgICAgICAgcE9sZC0+dGNsYXNQYXJhbXMuaXB2NC5wcm90b2NvbDsKKyAgICAgICAgICAgIHBEb3QxMWYtPmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMucmVzZXJ2ZWQgID0KKyAgICAgICAgICAgICAgcE9sZC0+dGNsYXNQYXJhbXMuaXB2NC5yc3ZkOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCAgKCB0QU5JX1U4KiApJnBEb3QxMWYtPmluZm8uSXBQYXJhbXMucGFyYW1zLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgSXBWNlBhcmFtcy5zb3VyY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAoIHRBTklfVTgqIClwT2xkLT50Y2xhc1BhcmFtcy5pcHY2LnNyY0lwQWRkciwgMTYgKTsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSggICggdEFOSV9VOCogKSZwRG90MTFmLT5pbmZvLklwUGFyYW1zLnBhcmFtcy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIElwVjZQYXJhbXMuZGVzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICggdEFOSV9VOCogKXBPbGQtPnRjbGFzUGFyYW1zLmlwdjYuZHN0SXBBZGRyLCAxNiApOworICAgICAgICAgICAgcERvdDExZi0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5zcmNfcG9ydCAgPQorICAgICAgICAgICAgICBwT2xkLT50Y2xhc1BhcmFtcy5pcHY2LnNyY1BvcnQ7CisgICAgICAgICAgICBwRG90MTFmLT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmRlc3RfcG9ydCA9CisgICAgICAgICAgICAgIHBPbGQtPnRjbGFzUGFyYW1zLmlwdjYuZHN0UG9ydDsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSggICggdEFOSV9VOCogKSZwRG90MTFmLT5pbmZvLklwUGFyYW1zLnBhcmFtcy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIElwVjZQYXJhbXMuZmxvd19sYWJlbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICggdEFOSV9VOCogKXBPbGQtPnRjbGFzUGFyYW1zLmlwdjYuZmxvd0xhYmVsLCAzICk7CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBTSVJfTUFDX1RDTEFTVFlQRV84MDIxRFE6CisgICAgICAgIHBEb3QxMWYtPmluZm8uUGFyYW1zODAyMWRxLnRhZ190eXBlID0gcE9sZC0+dGNsYXNQYXJhbXMudDgwMjFkcS50YWc7CisgICAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICAgIGxpbUxvZyggcE1hYywgTE9HRSwgRkwoIkJhZCBUQ0xBUyB0eXBlICVkIGluIFBvcHVsYXRlRG90MTFmVENMQVMuIiksCisgICAgICAgICAgICAgICAgcERvdDExZi0+Y2xhc3NpZmllcl90eXBlICk7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorCisgICAgcERvdDExZi0+cHJlc2VudCA9IDE7CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworCit9IC8vIEVuZCBQb3B1bGF0ZURvdDExZlRDTEFTLgorCit0U2lyUmV0U3RhdHVzCitQb3B1bGF0ZURvdDExZldNTVRDTEFTKHRwQW5pU2lyR2xvYmFsICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICB0U2lyVGNsYXNJbmZvICAgICAqcE9sZCwKKyAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFV01NVENMQVMgKnBEb3QxMWYpCit7CisgICAgcERvdDExZi0+dmVyc2lvbiAgICAgICAgID0gMTsKKyAgICBwRG90MTFmLT51c2VyX3ByaW9yaXR5ICAgPSBwT2xkLT50Y2xhcy51c2VyUHJpbzsKKyAgICBwRG90MTFmLT5jbGFzc2lmaWVyX3R5cGUgPSBwT2xkLT50Y2xhcy5jbGFzc2lmaWVyVHlwZTsKKyAgICBwRG90MTFmLT5jbGFzc2lmaWVyX21hc2sgPSBwT2xkLT50Y2xhcy5jbGFzc2lmaWVyTWFzazsKKworICAgIHN3aXRjaCAoIHBEb3QxMWYtPmNsYXNzaWZpZXJfdHlwZSApCisgICAgeworICAgIGNhc2UgU0lSX01BQ19UQ0xBU1RZUEVfRVRIRVJORVQ6CisgICAgICAgIHZvc19tZW1fY29weSggICggdEFOSV9VOCogKSZwRG90MTFmLT5pbmZvLkV0aFBhcmFtcy5zb3VyY2UsCisgICAgICAgICAgICAgICAgICAgICAgICggdEFOSV9VOCogKSZwT2xkLT50Y2xhc1BhcmFtcy5ldGguc3JjQWRkciwgNiApOworICAgICAgICB2b3NfbWVtX2NvcHkoICAoIHRBTklfVTgqICkmcERvdDExZi0+aW5mby5FdGhQYXJhbXMuZGVzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgKCB0QU5JX1U4KiApJnBPbGQtPnRjbGFzUGFyYW1zLmV0aC5kc3RBZGRyLCA2ICk7CisgICAgICAgIHBEb3QxMWYtPmluZm8uRXRoUGFyYW1zLnR5cGUgPSBwT2xkLT50Y2xhc1BhcmFtcy5ldGgudHlwZTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBTSVJfTUFDX1RDTEFTVFlQRV9UQ1BVRFBJUDoKKyAgICAgICAgcERvdDExZi0+aW5mby5JcFBhcmFtcy52ZXJzaW9uID0gcE9sZC0+dmVyc2lvbjsKKyAgICAgICAgaWYgKCBTSVJfTUFDX1RDTEFTX0lQVjQgPT0gcERvdDExZi0+aW5mby5JcFBhcmFtcy52ZXJzaW9uICkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCAgKCB0QU5JX1U4KiApJnBEb3QxMWYtPmluZm8uSXBQYXJhbXMucGFyYW1zLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgSXBWNFBhcmFtcy5zb3VyY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAoIHRBTklfVTgqIClwT2xkLT50Y2xhc1BhcmFtcy5pcHY0LnNyY0lwQWRkciwgNCApOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCAgKCB0QU5JX1U4KiApJnBEb3QxMWYtPmluZm8uSXBQYXJhbXMucGFyYW1zLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgSXBWNFBhcmFtcy5kZXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKCB0QU5JX1U4KiApcE9sZC0+dGNsYXNQYXJhbXMuaXB2NC5kc3RJcEFkZHIsIDQgKTsKKyAgICAgICAgICAgIHBEb3QxMWYtPmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMuc3JjX3BvcnQgID0KKyAgICAgICAgICAgICAgcE9sZC0+dGNsYXNQYXJhbXMuaXB2NC5zcmNQb3J0OworICAgICAgICAgICAgcERvdDExZi0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNFBhcmFtcy5kZXN0X3BvcnQgPQorICAgICAgICAgICAgICBwT2xkLT50Y2xhc1BhcmFtcy5pcHY0LmRzdFBvcnQ7CisgICAgICAgICAgICBwRG90MTFmLT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY0UGFyYW1zLkRTQ1AgICAgICA9CisgICAgICAgICAgICAgIHBPbGQtPnRjbGFzUGFyYW1zLmlwdjQuZHNjcDsKKyAgICAgICAgICAgIHBEb3QxMWYtPmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMucHJvdG8gICAgID0KKyAgICAgICAgICAgICAgcE9sZC0+dGNsYXNQYXJhbXMuaXB2NC5wcm90b2NvbDsKKyAgICAgICAgICAgIHBEb3QxMWYtPmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjRQYXJhbXMucmVzZXJ2ZWQgID0KKyAgICAgICAgICAgICAgcE9sZC0+dGNsYXNQYXJhbXMuaXB2NC5yc3ZkOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCAoIHRBTklfVTgqICkmcERvdDExZi0+aW5mby5JcFBhcmFtcy5wYXJhbXMuCisgICAgICAgICAgICAgICAgICAgICAgICAgICBJcFY2UGFyYW1zLnNvdXJjZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICggdEFOSV9VOCogKXBPbGQtPnRjbGFzUGFyYW1zLmlwdjYuc3JjSXBBZGRyLCAxNiApOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCAgKCB0QU5JX1U4KiApJnBEb3QxMWYtPmluZm8uSXBQYXJhbXMucGFyYW1zLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgSXBWNlBhcmFtcy5kZXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKCB0QU5JX1U4KiApcE9sZC0+dGNsYXNQYXJhbXMuaXB2Ni5kc3RJcEFkZHIsIDE2ICk7CisgICAgICAgICAgICBwRG90MTFmLT5pbmZvLklwUGFy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JhckNvbmZpZ01ldGhvZHMucHJlc2VudCA9IDE7CisgICAgICAgIHBEb3QxMWYtPlNlbGVjdGVkUmVnaXN0cmFyQ29uZmlnTWV0aG9kcy5tZXRob2RzID0gcFNpcldQU1Byb2JlUnNwSUUtPlNlbGVjdGVkUmVnaXN0cmFDZmdNZXRob2Q7CisgICAgfQorICAgIGVsc2UKKyAgICAgICAgcERvdDExZi0+U2VsZWN0ZWRSZWdpc3RyYXJDb25maWdNZXRob2RzLnByZXNlbnQgPSAwOworICAgICAgICAKKyAgICBpZihwU2lyV1BTUHJvYmVSc3BJRS0+RmllbGRQcmVzZW50ICYgU0lSX1dQU19QUk9CUlNQX1JFU1BPTlNFVFlQRV9QUkVTRU5UKQorICAgIHsKKyAgICAgICAgcERvdDExZi0+UmVzcG9uc2VUeXBlLnByZXNlbnQgPSAxOworICAgICAgICBwRG90MTFmLT5SZXNwb25zZVR5cGUucmVzVHlwZSA9IHBTaXJXUFNQcm9iZVJzcElFLT5SZXNwb25zZVR5cGU7CisgICAgfQorICAgIGVsc2UKKyAgICAgICAgcERvdDExZi0+UmVzcG9uc2VUeXBlLnByZXNlbnQgPSAwOworICAgICAgICAKKyAgICBpZihwU2lyV1BTUHJvYmVSc3BJRS0+RmllbGRQcmVzZW50ICYgU0lSX1dQU19QUk9CUlNQX1VVSURFX1BSRVNFTlQpCisgICAgeworICAgICAgICBwRG90MTFmLT5VVUlEX0UucHJlc2VudCA9IDE7CisgICAgICAgIHZvc19tZW1fY29weShwRG90MTFmLT5VVUlEX0UudXVpZCwgcFNpcldQU1Byb2JlUnNwSUUtPlVVSURfRSwgV05JX0NGR19XUFNfVVVJRF9MRU4pOworICAgIH0KKyAgICBlbHNlCisgICAgICAgIHBEb3QxMWYtPlVVSURfRS5wcmVzZW50ID0gMDsKKyAgICAKKyAgICBpZihwU2lyV1BTUHJvYmVSc3BJRS0+RmllbGRQcmVzZW50ICYgU0lSX1dQU19QUk9CUlNQX01BTlVGQUNUVVJFX1BSRVNF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TlQpCisgICAgeworICAgICAgICBwRG90MTFmLT5Nb2RlbE51bWJlci5wcmVzZW50ID0gMTsKKyAgICAgICAgcERvdDExZi0+TW9kZWxOdW1iZXIubnVtX3RleHQgPSBwU2lyV1BTUHJvYmVSc3BJRS0+TW9kZWxOdW1iZXIubnVtX3RleHQ7CisgICAgICAgIHZvc19tZW1fY29weShwRG90MTFmLT5Nb2RlbE51bWJlci50ZXh0LCBwU2lyV1BTUHJvYmVSc3BJRS0+TW9kZWxOdW1iZXIudGV4dCwKKyAgICAgICAgICAgICAgICAgICAgIHBEb3QxMWYtPk1vZGVsTnVtYmVyLm51bV90ZXh0KTsKKyAgICB9CisgICAgZWxzZQorICAgICAgICBwRG90MTFmLT5Nb2RlbE51bWJlci5wcmVzZW50ID0gMDsKKyAgICAKKyAgICBpZihwU2lyV1BTUHJvYmVSc3BJRS0+RmllbGRQcmVzZW50ICYgU0lSX1dQU19QUk9CUlNQX1NFUklBTE5VTUJFUl9QUkVTRU5UKQorICAgIHsKKyAgICAgICAgcERvdDExZi0+U2VyaWFsTnVtYmVyLnByZXNlbnQgPSAxOworICAgICAgICBwRG90MTFmLT5TZXJpYWxOdW1iZXIubnVtX3RleHQgPSBwU2lyV1BTUHJvYmVSc3BJRS0+U2VyaWFsTnVtYmVyLm51bV90ZXh0OworICAgICAgICB2b3NfbWVtX2NvcHkocERvdDExZi0+U2VyaWFsTnVtYmVyLnRleHQsIHBTaXJXUFNQcm9iZVJzcElFLT5TZXJpYWxOdW1iZXIudGV4dCwKKyAgICAgICAgICAgICAgICAgICAgIHBEb3QxMWYtPlNlcmlhbE51bWJlci5udW1fdGV4dCk7CisgICAgfQorICAgIGVsc2UKKyAgICAgICAgcERvdDExZi0+U2VyaWFsTnVtYmVyLnByZXNlbnQgPSAwOworICAgIAorICAgIGlmKHBTaXJXUFNQcm9iZVJzcElFLT5GaWVsZFByZXNlbnQgJiBTSVJfV1BTX1BST0JSU1BfUFJJTUFSWURFVklDRVRZUEVfUFJFU0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0lFcy5TaXJXUFNQcm9iZVJzcElFOworICAgCisgICAgaWYocFNpcldQU1Byb2JlUnNwSUUtPkZpZWxkUHJlc2VudCAmIFNJUl9XUFNfUFJPQlJTUF9WRVJfUFJFU0VOVCkKKyAgICB7CisgICAgICAgIHBEb3QxMWYtPnByZXNlbnQgPSAxOworICAgICAgICBwRG90MTFmLT5WZXJzaW9uLnByZXNlbnQgPSAxOworICAgICAgICBwRG90MTFmLT5WZXJzaW9uLm1ham9yID0gKHRBTklfVTgpICgocFNpcldQU1Byb2JlUnNwSUUtPlZlcnNpb24gJiAweEYwKT4+NCk7CisgICAgICAgIHBEb3QxMWYtPlZlcnNpb24ubWlub3IgPSAodEFOSV9VOCkgKHBTaXJXUFNQcm9iZVJzcElFLT5WZXJzaW9uICYgMHgwRik7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHBEb3QxMWYtPnByZXNlbnQgPSAwOworICAgICAgICBwRG90MTFmLT5WZXJzaW9uLnByZXNlbnQgPSAwOworICAgIH0KKyAgICAKKyAgICBpZihwU2lyV1BTUHJvYmVSc3BJRS0+RmllbGRQcmVzZW50ICYgU0lSX1dQU19QUk9CUlNQX1JFU1BPTlNFVFlQRV9QUkVTRU5UKQorICAgIHsKKyAgICAgICAgcERvdDExZi0+UmVzcG9uc2VUeXBlLnByZXNlbnQgPSAxOworICAgICAgICBwRG90MTFmLT5SZXNwb25zZVR5cGUucmVzVHlwZSA9IHBTaXJXUFNQcm9iZVJzcElFLT5SZXNwb25zZVR5cGU7CisgICAgfQorICAgIGVsc2UKKyAgICAgICAgcERvdDExZi0+UmVzcG9uc2VUeXBlLnByZXNlbnQgPSAwOyAgICAKKworICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7Cit9CisKK3RTaXJSZXRTdGF0dXMgUG9wdWxhdGVEb3QxMWZCZWFjb25XUFNJRXModHBBbmlTaXJHbG9iYWwgcE1hYywgdERvdDExZklFV3NjQmVhY29uICpwRG90MTFmLCB0cFBFU2Vzc2lvbiBwc2Vzc2lvbkVudHJ5KQoreworIAorICAgdFNpcldQU0JlYWNvbklFICpwU2lyV1BTQmVhY29uSUU7CisKKyAgIHBTaXJXUFNCZWFjb25JRSA9ICZwc2Vzc2lvbkVudHJ5LT5BUFdQU0lFcy5TaXJXUFNCZWFjb25JRTsKKyAgIAorICAgIAorICAgIGlmKHBTaXJXUFNCZWFjb25JRS0+RmllbGRQcmVzZW50ICYgU0lSX1dQU19QUk9CUlNQX1ZFUl9QUkVTRU5UKQorICAgIHsKKyAgICAgICAgcERvdDExZi0+cHJlc2VudCA9IDE7CisgICAgICAgIHBEb3QxMWYtPlZlcnNpb24ucHJlc2VudCA9IDE7CisgICAgICAgIHBEb3QxMWYtPlZlcnNpb24ubWFqb3IgPSAodEFOSV9VOCkgKChwU2lyV1BTQmVhY29uSUUtPlZlcnNpb24gJiAweEYwKT4+NCk7CisgICAgICAgIHBEb3QxMWYtPlZlcnNpb24ubWlub3IgPSAodEFOSV9VOCkgKHBTaXJXUFNCZWFjb25JRS0+VmVyc2lvbiAmIDB4MEYpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBwRG90MTFmLT5wcmVzZW50ID0gMDsKKyAgICAgICAgcERvdDExZi0+VmVyc2lvbi5wcmVzZW50ID0gMDsKKyAgICB9CisgICAgCisgICAgaWYocFNpcldQU0JlYWNvbklFLT5GaWVsZFByZXNlbnQgJiBTSVJfV1BTX0JFQUNPTl9TVEFURV9QUkVTRU5UKQorICAgIHsKKyAgICAgICAgCisgICAgICAgIHBEb3QxMWYtPldQU1N0YXRlLnByZXNlbnQgPSAxOworICAgICAgICBwRG90MTFmLT5XUFNTdGF0ZS5zdGF0ZSA9ICh0QU5JX1U4KXBTaXJXUFNCZWFjb25JRS0+d3BzU3RhdGU7CisgICAgfQorICAgIGVsc2UKKyAgICAgICAgcERvdDExZi0+V1BTU3RhdGUucHJlc2VudCA9IDA7CisgICAgICAgIAorICAgIGlmKHBTaXJXUFNCZWFjb25JRS0+RmllbGRQcmVzZW50ICYgU0lSX1dQU19CRUFDT05fQVBTRVRVUExPQ0tfUFJFU0VOVCkKKyAgICB7CisgICAgICAgIHBEb3QxMWYtPkFQU2V0dXBMb2NrZWQucHJlc2VudCA9IDE7CisgICAgICAgIHBEb3QxMWYtPkFQU2V0dXBMb2NrZWQuZkxvY2tlZCA9IHBTaXJXUFNCZWFjb25JRS0+QVBTZXR1cExvY2tlZDsKKyAgICB9CisgICAgZWxzZQorICAgICAgICBwRG90MTFmLT5BUFNldHVwTG9ja2VkLnByZXNlbnQgPSAwOworICAgICAgICAKKyAgICBpZihwU2lyV1BTQmVhY29uSUUtPkZpZWxkUHJlc2VudCAmIFNJUl9XUFNfQkVBQ09OX1NFTEVDVEVEUkVHSVNUUkFfUFJFU0VOVCkKKyAgICB7CisgICAgICAgIHBEb3QxMWYtPlNlbGVjdGVkUmVnaXN0cmFyLnByZXNlbnQgPSAxOworICAgICAgICBwRG90MTFmLT5TZWxlY3RlZFJlZ2lzdHJhci5zZWxlY3RlZCA9IHBTaXJXUFNCZWFjb25JRS0+U2VsZWN0ZWRSZWdpc3RyYTsKKyAgICB9CisgICAgZWxzZQorICAgICAgICAgcERvdDExZi0+U2VsZWN0ZWRSZWdpc3RyYXIucHJlc2VudCA9IDA7CisgICAgCisgICAgaWYocFNpcldQU0JlYWNvbklFLT5GaWVsZFByZXNlbnQgJiBTSVJfV1BTX0JFQUNPTl9ERVZJQ0VQQVNTV09SRElEX1BSRVNFTlQpCisgICAgeworICAgICAgICBwRG90MTFmLT5EZXZpY2VQYXNzd29yZElELnByZXNlbnQgPSAxOworICAgICAgICBwRG90MTFmLT5EZXZpY2VQYXNzd29yZElELmlkID0gcFNpcldQU0JlYWNvbklFLT5EZXZpY2VQYXNzd29yZElEOworICAgIH0KKyAgICBlbHNlCisgICAgICAgIHBEb3QxMWYtPkRldmljZVBhc3N3b3JkSUQucHJlc2VudCA9IDA7CisgICAgICAgIAorICAgIGlmKHBTaXJXUFNCZWFj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gICAgICAgICAgJmNmZ1N0ckxlbikgIT0gZVNJUl9TVUNDRVNTKQorICAgIHsKKyAgICAgICAgKihwRG90MTFmLT5VVUlEX0UudXVpZCkgPSAnXDAnOworICAgIH0KKworICAgIHBEb3QxMWYtPk1hbnVmYWN0dXJlci5wcmVzZW50ID0gMTsKKyAgICBjZmdTdHJMZW4gPSBXTklfQ0ZHX01BTlVGQUNUVVJFUl9OQU1FX0xFTiAtIDE7CisgICAgaWYgKHdsYW5fY2ZnR2V0U3RyKHBNYWMsCisgICAgICAgICAgICAgICAgICBXTklfQ0ZHX01BTlVGQUNUVVJFUl9OQU1FLAorICAgICAgICAgICAgICAgICAgcERvdDExZi0+TWFudWZhY3R1cmVyLm5hbWUsCisgICAgICAgICAgICAgICAgICAmY2ZnU3RyTGVuKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgeworICAgICAgICBwRG90MTFmLT5NYW51ZmFjdHVyZXIubnVtX25hbWUgPSAwOworICAgICAgICAqKHBEb3QxMWYtPk1hbnVmYWN0dXJlci5uYW1lKSA9ICdcMCc7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHBEb3QxMWYtPk1hbnVmYWN0dXJlci5udW1fbmFtZSA9ICh0QU5JX1U4KSAoY2ZnU3RyTGVuICYgMHgwMDAwMDBGRik7CisgICAgICAgIHBEb3QxMWYtPk1hbnVmYWN0dXJlci5uYW1lW2NmZ1N0ckxlbiAtIDFdID0gJ1wwJzsKKyAgICB9CisKKyAgICBwRG90MTFmLT5Nb2RlbE5hbWUucHJlc2VudCA9IDE7CisgICAgY2ZnU3RyTGVuID0gV05JX0NGR19NT0RFTF9OQU1FX0xFTiAtIDE7CisgICAgaWYgKHdsYW5fY2ZnR2V0U3RyKHBNYWMsCisgICAgICAgICAgICAgICAgICBXTklfQ0ZHX01PREVMX05BTUUsCisgICAgICAgICAgICAgICAgICBwRG90MTFmLT5Nb2RlbE5hbWUudGV4dCwKKyAgICAgICAgICAgICAgICAgICZjZmdTdHJMZW4pICE9IGVTSVJfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIHBEb3QxMWYtPk1vZGVsTmFtZS5udW1fdGV4dCA9IDA7CisgICAgICAgICoocERvdDExZi0+TW9kZWxOYW1lLnRleHQpID0gJ1wwJzsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgcERvdDExZi0+TW9kZWxOYW1lLm51bV90ZXh0ID0gKHRBTklfVTgpIChjZmdTdHJMZW4gJiAweDAwMDAwMEZGKTsKKyAgICAgICAgcERvdDExZi0+TW9kZWxOYW1lLnRleHRbY2ZnU3RyTGVuIC0gMV0gPSAnXDAnOworICAgIH0KKworICAgIHBEb3QxMWYtPk1vZGVsTnVtYmVyLnByZXNlbnQgPSAxOworICAgIGNmZ1N0ckxlbiA9IFdOSV9DRkdfTU9ERUxfTlVNQkVSX0xFTiAtIDE7CisgICAgaWYgKHdsYW5fY2ZnR2V0U3RyKHBNYWMsCisgICAgICAgICAgICAgICAgICBXTklfQ0ZHX01PREVMX05VTUJFUiwKKyAgICAgICAgICAgICAgICAgIHBEb3QxMWYtPk1vZGVsTnVtYmVyLnRleHQsCisgICAgICAgICAgICAgICAgICAmY2ZnU3RyTGVuKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgeworICAgICAgICBwRG90MTFmLT5Nb2RlbE51bWJlci5udW1fdGV4dCA9IDA7CisgICAgICAgICoocERvdDExZi0+TW9kZWxOdW1iZXIudGV4dCkgPSAnXDAnOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBwRG90MTFmLT5Nb2RlbE51bWJlci5udW1fdGV4dCA9ICh0QU5JX1U4KSAoY2ZnU3RyTGVuICYgMHgwMDAwMDBGRik7CisgICAgICAgIHBEb3QxMWYtPk1vZGVsTnVtYmVyLnRleHRbY2ZnU3RyTGVuIC0gMV0gPSAnXDAnOworICAgIH0KKworICAgIHBEb3QxMWYtPlNlcmlhbE51bWJlci5wcmVzZW50ID0gMTsKKyAgICBjZmdTdHJ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ICAgICAgICAgICAgICAgICAgV05JX0NGR19NQU5VRkFDVFVSRVJfUFJPRFVDVF9OQU1FLAorICAgICAgICAgICAgICAgICAgcERvdDExZi0+RGV2aWNlTmFtZS50ZXh0LAorICAgICAgICAgICAgICAgICAgJmNmZ1N0ckxlbikgIT0gZVNJUl9TVUNDRVNTKQorICAgIHsKKyAgICAgICAgcERvdDExZi0+RGV2aWNlTmFtZS5udW1fdGV4dCA9IDA7CisgICAgICAgICoocERvdDExZi0+RGV2aWNlTmFtZS50ZXh0KSA9ICdcMCc7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHBEb3QxMWYtPkRldmljZU5hbWUubnVtX3RleHQgPSAodEFOSV9VOCkgKGNmZ1N0ckxlbiAmIDB4MDAwMDAwRkYpOworICAgICAgICBwRG90MTFmLT5EZXZpY2VOYW1lLnRleHRbY2ZnU3RyTGVuIC0gMV0gPSAnXDAnOworICAgIH0KKworICAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLAorICAgICAgICAgICAgICAgICAgV05JX0NGR19XUFNfQ0ZHX01FVEhPRCwKKyAgICAgICAgICAgICAgICAgICZjZmdNZXRob2RzKSAhPSBlU0lSX1NVQ0NFU1MpCisgICAgeworICAgICAgICBwRG90MTFmLT5Db25maWdNZXRob2RzLnByZXNlbnQgPSAwOworICAgICAgICBwRG90MTFmLT5Db25maWdNZXRob2RzLm1ldGhvZHMgPSAwOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBwRG90MTFmLT5Db25maWdNZXRob2RzLnByZXNlbnQgPSAxOworICAgICAgICBwRG90MTFmLT5Db25maWdNZXRob2RzLm1ldGhvZHMgPSAodEFOSV9VMTYpIChjZmdNZXRob2RzICYgMHgwMDAwRkZGRik7CisgICAgfQorCisgICAgcERvdDExZi0+UkZCYW5kcy5wcmVzZW50ID0gMDsKKworICAgIHBEb3QxMWYtPnByZXNlbnQgPSAxOworICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7Cit9CisK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mVnaXN0cmFyQ29uZmlnTWV0aG9kcy5wcmVzZW50ID0gMTsKKyAgICBwRG90MTFmLT5TZWxlY3RlZFJlZ2lzdHJhckNvbmZpZ01ldGhvZHMubWV0aG9kcyA9IHBXc2NJZUluZm8tPnNlbGVjdGVkUmVnaXN0cmFyQ29uZmlnTWV0aG9kczsKKworICAgIC8vIFVVSURfRSBhbmQgUkYgQmFuZHMgYXJlIGFwcGxpY2FibGUgb25seSBmb3IgZHVhbCBiYW5kIEFQCisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworfQorCit0U2lyUmV0U3RhdHVzIERlUG9wdWxhdGVEb3QxMWZXc2NSZWdpc3RyYXJJbmZvSW5Qcm9iZVJlcyh0cEFuaVNpckdsb2JhbCBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFV3NjUHJvYmVSZXMgKnBEb3QxMWYpCit7CisgICAgcERvdDExZi0+QVBTZXR1cExvY2tlZC5wcmVzZW50ID0gMDsKKyAgICBwRG90MTFmLT5TZWxlY3RlZFJlZ2lzdHJhci5wcmVzZW50ID0gMDsKKyAgICBwRG90MTFmLT5EZXZpY2VQYXNzd29yZElELnByZXNlbnQgPSAwOworICAgIHBEb3QxMWYtPlNlbGVjdGVkUmVnaXN0cmFyQ29uZmlnTWV0aG9kcy5wcmVzZW50ID0gMDsKKworICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7Cit9CisKK3RTaXJSZXRTdGF0dXMgUG9wdWxhdGVEb3QxMWZBc3NvY1Jlc1dzY0lFKHRwQW5pU2lyR2xvYmFsIHBNYWMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFV3NjQXNzb2NSZXMgKnBEb3QxMWYsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJBc3NvY1JlcSBwUmN2ZEFzc29jUmVxKQoreworICAgIHREb3QxMWZJRVdzY0Fzc29jUmVxIHBhcnNlZFdzY0Fzc29jUmVxID0geyAwLCB9OworICAgIHRBTklfVTggICAgICAgICAqd3NjSWU7CisgICAgCisKKyAgICB3c2NJZSA9IGxpbUdldFdzY0lFUHRyKHBNYWMsIHBSY3ZkQXNzb2NSZXEtPmFkZElFLmFkZElFZGF0YSwgcFJjdmRBc3NvY1JlcS0+YWRkSUUubGVuZ3RoKTsKKyAgICBpZih3c2NJZSAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgLy8gcmV0cmVpdmUgV1NDIElFIGZyb20gZ2l2ZW4gQXNzb2NSZXEgCisgICAgICAgIGRvdDExZlVucGFja0llV3NjQXNzb2NSZXEoIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3c2NJZSArIDIgKyA0LCAgLy8gRUlELCBsZW5ndGgsIE9VSQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3NjSWVbIDEgXSAtIDQsIC8vIGxlbmd0aCB3aXRob3V0IE9VSQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBhcnNlZFdzY0Fzc29jUmVxICk7CisgICAgICAgIHBEb3QxMWYtPnByZXNlbnQgPSAxOworICAgICAgICAvLyB2ZXJzaW9uIGhhcyB0byBiZSAweDEwCisgICAgICAgIHBEb3QxMWYtPlZlcnNpb24ucHJlc2VudCA9IDE7CisgICAgICAgIHBEb3QxMWYtPlZlcnNpb24ubWFqb3IgPSAweDE7CisgICAgICAgIHBEb3QxMWYtPlZlcnNpb24ubWlub3IgPSAweDA7CisKKyAgICAgICAgcERvdDExZi0+UmVzcG9uc2VUeXBlLnByZXNlbnQgPSAxOworICAgICAgICAKKyAgICAgICAgaWYgKChwYXJzZWRXc2NBc3NvY1JlcS5SZXF1ZXN0VHlwZS5yZXFUeXBlID09IFJFUV9UWVBFX1JFR0lTVFJBUikgfHwKKyAgICAgICAgICAgIChwYXJzZWRXc2NBc3NvY1JlcS5SZXF1ZXN0VHlwZS5yZXFUeXBlID09IFJFUV9UWVBFX1dMQU5fTUFOQUdFUl9SRUdJU1RSQVIpKQorICAgICAgICB7CisgICAgICAgICAgICBwRG90MTFmLT5SZXNwb25zZVR5cGUucmVzVHlwZSA9IFJFU1BfVFlQRV9FTlJPTExFRV9PUEVOXzgwMjFYOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgIHBEb3QxMWYtPlJlc3BvbnNlVHlwZS5yZXNUeXBlID0gUkVTUF9UWVBFX0FQOworICAgICAgICB9CisgICAgICAgIC8vIFZlcnNpb24gaW5mb21yYXRpb24gc2hvdWxkIGJlIHRha2VuIGZyb20gb3VyIGNhcGFiaWxpdHkgYXMgd2VsbCBhcyBwZWVycworICAgICAgICAvLyBUT0RPOiBjdXJyZW50bHkgaXQgdGFrZXMgZnJvbSBwZWVycyBvbmx5CisgICAgICAgIGlmKHBhcnNlZFdzY0Fzc29jUmVxLlZlbmRvckV4dGVuc2lvbi5wcmVzZW50ICYmCisgICAgICAgICAgIHBhcnNlZFdzY0Fzc29jUmVxLlZlbmRvckV4dGVuc2lvbi5WZXJzaW9uMi5wcmVzZW50KQorICAgICAgICB7ICAgCisgICAgICAgICAgICBwRG90MTFmLT5WZW5kb3JFeHRlbnNpb24ucHJlc2VudCA9IDE7CisgICAgICAgICAgICBwRG90MTFmLT5WZW5kb3JFeHRlbnNpb24udmVuZG9ySWRbMF0gPSAweDAwOworICAgICAgICAgICAgcERvdDExZi0+VmVuZG9yRXh0ZW5zaW9uLnZlbmRvcklkWzFdID0gMHgzNzsKKyAgICAgICAgICAgIHBEb3QxMWYtPlZlbmRvckV4dGVuc2lvbi52ZW5kb3JJZFsyXSA9IDB4MkE7CisgICAgICAgICAgICBwRG90MTFmLT5WZW5kb3JFeHRlbnNpb24uVmVyc2lvbjIucHJlc2VudCA9IDE7CisgICAgICAgICAgICBwRG90MTFmLT5WZW5kb3JFeHRlbnNpb24uVmVyc2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UEhZID0gcEJlYWNvblJlcG9ydC0+cGh5VHlwZTsKKyAgICAgcERvdDExZi0+cmVwb3J0LkJlYWNvbi5yZXBvcnRlZF9mcmFtZV90eXBlID0gIXBCZWFjb25SZXBvcnQtPmJjblByb2JlUnNwOworICAgICBwRG90MTFmLT5yZXBvcnQuQmVhY29uLlJDUEkgPSBwQmVhY29uUmVwb3J0LT5yY3BpOworICAgICBwRG90MTFmLT5yZXBvcnQuQmVhY29uLlJTTkkgPSBwQmVhY29uUmVwb3J0LT5yc25pOworICAgICB2b3NfbWVtX2NvcHkoIHBEb3QxMWYtPnJlcG9ydC5CZWFjb24uQlNTSUQsIHBCZWFjb25SZXBvcnQtPmJzc2lkLCBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgcERvdDExZi0+cmVwb3J0LkJlYWNvbi5hbnRlbm5hX2lkID0gcEJlYWNvblJlcG9ydC0+YW50ZW5uYUlkOworICAgICBwRG90MTFmLT5yZXBvcnQuQmVhY29uLnBhcmVudF9UU0YgPSBwQmVhY29uUmVwb3J0LT5wYXJlbnRUU0Y7CisKKyAgICAgaWYoIHBCZWFjb25SZXBvcnQtPm51bUllcyApCisgICAgIHsKKyAgICAgICAgICBwRG90MTFmLT5yZXBvcnQuQmVhY29uLkJlYWNvblJlcG9ydEZybUJvZHkucHJlc2VudCA9IDE7CisgICAgICAgICAgdm9zX21lbV9jb3B5KCBwRG90MTFmLT5yZXBvcnQuQmVhY29uLkJlYWNvblJlcG9ydEZybUJvZHkucmVwb3J0ZWRGaWVsZHMsCisgICAgICAgICAgICAgICAgICAgICAgICBwQmVhY29uUmVwb3J0LT5JZXMsIHBCZWFjb25SZXBvcnQtPm51bUllcyApOworICAgICAgICAgIHBEb3QxMWYtPnJlcG9ydC5CZWFjb24uQmVhY29uUmVwb3J0RnJtQm9keS5udW1fcmVwb3J0ZWRGaWVsZHMgPSBwQmVhY29uUmVwb3J0LT5udW1JZXM7CisgICAgIH0KKworICAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworCit9CisKK3RTaXJSZXRTdGF0dXMgUG9wdWxhdGVEb3QxMWZSUk1JZSggdHBBbmlTaXJHbG9iYWwgcE1hYywgdERvdDExZklFUlJNRW5hYmxlZENhcCAqcERvdDExZiwgdHBQRVNlc3Npb24gICAgcHNlc3Npb25FbnRyeSApCit7ICAKKyAgIHRwUlJNQ2FwcyBwUnJtQ2FwczsKKworICAgcFJybUNhcHMgPSBycm1HZXRDYXBhYmlsaXRpZXMoIHBNYWMsIHBzZXNzaW9uRW50cnkgKTsKKworICAgcERvdDExZi0+TGlua01lYXN1cmVtZW50ICAgICAgICAgPSBwUnJtQ2Fwcy0+TGlua01lYXN1cmVtZW50IDsKKyAgIHBEb3QxMWYtPk5laWdoYm9yUnB0ICAgICAgICAgICAgID0gcFJybUNhcHMtPk5laWdoYm9yUnB0IDsKKyAgIHBEb3QxMWYtPnBhcmFsbGVsICAgICAgICAgICAgICAgID0gcFJybUNhcHMtPnBhcmFsbGVsIDsKKyAgIHBEb3QxMWYtPnJlcGVhdGVkICAgICAgICAgICAgICAgID0gcFJybUNhcHMtPnJlcGVhdGVkIDsKKyAgIHBEb3QxMWYtPkJlYWNvblBhc3NpdmUgICAgICAgICAgID0gcFJybUNhcHMtPkJlYWNvblBhc3NpdmUgOworICAgcERvdDExZi0+QmVhY29uQWN0aXZlICAgICAgICAgICAgPSBwUnJtQ2Fwcy0+QmVhY29uQWN0aXZlIDsKKyAgIHBEb3QxMWYtPkJlYWNvblRhYmxlICAgICAgICAgICAgID0gcFJybUNhcHMtPkJlYWNvblRhYmxlIDsKKyAgIHBEb3QxMWYtPkJlYWNvblJlcENvbmQgICAgICAgICAgID0gcFJybUNhcHMtPkJlYWNvblJlcENvbmQgOworICAgcERvdDExZi0+RnJhbWVNZWFzdXJlbWVudCAgICAgICAgPSBwUnJtQ2Fwcy0+RnJhbWVNZWFzdXJlbWVudCA7CisgICBwRG90MTFmLT5DaGFubmVsTG9hZCAgICAgICAgICAgICA9IHBScm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JVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKy8vCisvLyAgRmlsZTogICAgICAgICB1dGlsc0FwaS5jYworLy8KKy8vICBEZXNjcmlwdGlvbjogIEltcGxlbWVudGlvbiBvZiBhIGZldyB1dGlsaXR5IHJvdXRpbmVzLiAKKy8vCisvLyAgQXV0aG9yOiAgICAgICBOZWVsYXkgRGFzCisvLworLy8KKy8vCisvLyAgQ2hhbmdlIGdIaXN0b3J5OgorLy8gIDEyLzE1LzIwMDMgLSBOREEgLSBJbml0aWFsIHZlcnNpb24uCisvLworLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworI2luY2x1ZGUgInV0aWxzQXBpLmgiCisKKworCisKKworLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorLyoqCisgKiBzaXJEdW1wQnVmKCkKKyAqCisgKiBGVU5DVElPTjoKKyAqIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIHRvIGR1bXAgYSBidWZmZXIgd2l0aCBhIGNlcnRhaW4gbGV2ZWwKKyAqCisgKiBMT0dJQzoKKyAqCisgKiBBU1NVTVBUSU9OUzoKKyAqIE5vbmUuCisgKgorICogTk9URToKKyAqCisgKiBAcGFyYW0gcEJ1ZjogYnVmZmVyIHBvaW50ZXIKKyAqIEByZXR1cm4gTm9uZS4KKyAqLwordm9pZAorc2lyRHVtcEJ1Zih0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1U4IG1vZElkLCB0QU5JX1UzMiBsZXZlbCwgdEFOSV9VOCAqYnVmLCB0QU5JX1UzMiBzaXplKQoreworICAgIHRBTklfVTMyIGk7CisKKyAgICBpZiAobGV2ZWwgPiBwTWFjLT51dGlscy5nTG9nRGJnTGV2ZWxbTE9HX0lOREVYX0ZPUl9NT0RVTEUobW9kSWQpXSkKKyAgICAgICAgcmV0dXJuOworCisgICAgbG9nRGJnKHBNYWMsIG1vZElkLCBsZXZlbCwgRkwoIkR1bXBpbmcgJWQgYnl0ZXMgaW4gaG9zdCBvcmRlclxuIiksIHNpemUpOworCisgICAgZm9yIChpPTA7IChpKzcpPHNpemU7IGkrPTgpCisgICAgeworICAgICAgICBsb2dEYmcocE1hYywgbW9kSWQsIGxldmVsLAorICAgICAgICAgICAgICAgICAiJTAyeCAlMDJ4ICUwMnggJTAyeCAlMDJ4ICUwMnggJTAyeCAlMDJ4IFxuIiwKKyAgICAgICAgICAgICAgICAgYnVmW2ldLAorICAgICAgICAgICAgICAgICBidWZbaSsxXSwKKyAgICAgICAgICAgICAgICAgYnVmW2krMl0sCisgICAgICAgICAgICAgICAgIGJ1ZltpKzNdLAorICAgICAgICAgICAgICAgICBidWZbaSs0XSwKKyAgICAgICAgICAgICAgICAgYnVmW2krNV0sCisgICAgICAgICAgICAgICAgIGJ1ZltpKzZdLAorICAgICAgICAgICAgICAgICBidWZbaSs3XSk7CisgICAgfQorCisgICAgLy8gRHVtcCB0aGUgYnl0ZXMgaW4gdGhlIGxhc3QgbGluZQorICAgIGZvciAoOyBpIDwgc2l6ZTsgaSsrKQorICAgIHsKKyAgICAgICAgbG9nRGJnKHBNYWMsIG1vZElkLCBsZXZlbCwgIiUwMnggIiwg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TotCisgKiBEYXRlICAgICAgICAgICBNb2RpZmllZCBieSAgICBNb2RpZmljYXRpb24gSW5mb3JtYXRpb24KKyAqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKgorICovCisKKyNpbmNsdWRlICJhbmlHbG9iYWwuaCIKKyNpbmNsdWRlICJ1dGlsc1BhcnNlci5oIgorI2luY2x1ZGUgImxpbVNlckRlc1V0aWxzLmgiCisKK3ZvaWQgQ29udmVydFNTSUQodHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY1NTaWQgICAqcE9sZCwKKyAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFU1NJRCAgICAqcE5ldykKK3sKKyAgICBwT2xkLT5sZW5ndGggPSBwTmV3LT5udW1fc3NpZDsKKyAgICB2b3NfbWVtX2NvcHkoIHBPbGQtPnNzSWQsIHBOZXctPnNzaWQsIHBOZXctPm51bV9zc2lkICk7Cit9CisKK3ZvaWQgQ29udmVydFN1cHBSYXRlcyh0cEFuaVNpckdsb2JhbCAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY1JhdGVTZXQgICpwT2xkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVN1cHBSYXRlcyAqcE5ldykKK3sKKyAgICBwT2xkLT5udW1SYXRlcyA9IHBOZXctPm51bV9yYXRlczsKKyAgICB2b3NfbWVtX2NvcHkoIHBPbGQtPnJhdGUsIHBOZXctPnJhdGVzLCBwTmV3LT5udW1fcmF0ZXMgKTsKK30KKwordm9pZCBDb252ZXJ0RXh0U3VwcFJhdGVzKHRwQW5pU2lyR2xvYmFsICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjUmF0ZVNldCAgICAgKnBPbGQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFRXh0U3VwcFJhdGVzICpwTmV3KQoreworICAgIHBPbGQtPm51bVJhdGVzID0gcE5ldy0+bnVtX3JhdGVzOworICAgIHZvc19tZW1fY29weSggIHBPbGQtPnJhdGUsIHBOZXctPnJhdGVzLCBwTmV3LT5udW1fcmF0ZXMgKTsKK30KKworCit2b2lkIENvbnZlcnRRT1NDYXBzKHRwQW5pU2lyR2xvYmFsICAgICAgICAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNRb3NDYXBhYmlsaXR5SUUgKnBPbGQsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVFPU0NhcHNBcCAgICAgKnBOZXcpCit7CisgICAgcE9sZC0+dHlwZSAgICA9IDQ2OworICAgIHBPbGQtPmxlbmd0aCAgPSAxOworCisgICAgcE9sZC0+cW9zSW5mby5jb3VudCAgID0gcE5ldy0+Y291bnQ7ICAgCit9CisKKwordm9pZCBDb252ZXJ0UU9TQ2Fwc1N0YXRpb24odHBBbmlTaXJHbG9iYWwgICAgICAgICAgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjUW9zQ2FwYWJpbGl0eVN0YUlFICAqcE9sZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVFPU0NhcHNTdGF0aW9uICAgICpwTmV3KQoreworICAgIHBPbGQtPnR5cGUgICAgPSA0NjsKKyAgICBwT2xkLT5sZW5ndGggID0gMTsKKworICAgIHBPbGQtPnFvc0luZm8ubW9yZURhdGFBY2sgPSBwTmV3LT5tb3JlX2RhdGFfYWNrOworICAgIHBPbGQtPnFvc0luZm8ubWF4U3BMZW4gICAgPSBwTmV3LT5tYXhfc3BfbGVuZ3RoOworICAgIHBPbGQtPnFvc0luZm8ucWFjayAgICAgICAgPSBwTmV3LT5xYWNrOworICAgIHBPbGQtPnFvc0luZm8uYWNiZV91YXBzZCAgPSBwTmV3LT5hY2JlX3VhcHNkOworICAgIHBPbGQtPnFvc0luZm8uYWNia191YXBzZCAgPSBwTmV3LT5hY2JrX3VhcHNkOworICAgIHBPbGQtPnFvc0luZm8uYWN2aV91YXBzZCAgPSBwTmV3LT5hY3ZpX3VhcHNkOworICAgIHBPbGQtPnFvc0luZm8uYWN2b191YXBzZCAgPSBwTmV3LT5hY3ZvX3VhcHNkOyAgICAKK30KKwordFNpclJldFN0YXR1cyBDb252ZXJ0V1BBKHRwQW5pU2lyR2xvYmFsICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNXcGFJbmZvICpwT2xkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdQQSAgICAgICpwTmV3KQoreworICAgIC8vIFRoaXMgaXMgYXdmdWwsIEkga25vdywgYnV0IHRoZSBvbGQgY29kZSBqdXN0IHJhbW1lZCB0aGUgSUUgaW50byBhbgorICAgIC8vIGFycmF5Li4uCisgICAgdEFOSV9VOCBidWZmZXJbMjU3XTsKKyAgICB0QU5JX1UzMiBzdGF0dXMsIHdyaXR0ZW4gPSAwLCBuYnVmZmVyID0gMjU3OworICAgIHN0YXR1cyA9IGRvdDExZlBhY2tJZVdQQSggcE1hYywgcE5ldywgYnVmZmVyLCBuYnVmZmVyLCAmd3JpdHRlbiApOworICAgIGlmICggRE9UMTFGX0ZBSUxFRCggc3RhdHVzICkgKQorICAgIHsKKyAgICAgICAgZG90MTFmTG9nKHBNYWMsIExPRzIsIEZMKCJGYWlsZWQgdG8gcmUtcGFjayB0aGUgV1BBIElFICgweCUweCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICI4KS5cbiIpLCBzdGF0dXMpOworICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgIH0KKworICAgIHBPbGQtPmxlbmd0aCA9ICh0QU5JX1U4KXdyaXR0ZW4gLSAyOworICAgIHZvc19tZW1fY29weSggcE9sZC0+aW5mbywgYnVmZmVyICsgMiwgcE9sZC0+bGVuZ3RoICk7CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworfQorCit0U2lyUmV0U3RhdHVzIENvbnZlcnRXUEFPcGFxdWUoIHRwQW5pU2lyR2xvYmFsICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY1dwYUluZm8gICAgICpwT2xkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVXUEFPcGFxdWUgKnBOZXcgKQoreworICAgIC8vIFRoaXMgaXMgYXdmdWwsIEkga25vdywgYnV0IHRoZSBvbGQgY29kZSBqdXN0IHJhbW1lZCB0aGUgSUUgaW50bworICAgIC8vIGFuIG9wYXF1ZSBhcnJheS4gIE5vdGUgdGhhdCB3ZSBuZWVkIHRvIGV4cGxpY2l0bHkgYWRkIHRoZSBPVUkhCisgICAgcE9sZC0+bGVuZ3RoICAgID0gcE5ldy0+bnVtX2RhdGEgKyA0OworICAgIHBPbGQtPmluZm9bIDAgXSA9IDB4MDA7CisgICAgcE9sZC0+aW5mb1sgMSBdID0gMHg1MDsKKyAgICBwT2xkLT5pbmZvWyAyIF0gPSAweGYyOworICAgIHBPbGQtPmluZm9bIDMgXSA9IDB4MDE7CisgICAgdm9zX21lbV9jb3B5KCBwT2xkLT5pbmZvICsgNCwgcE5ldy0+ZGF0YSwgcE5ldy0+bnVtX2RhdGEgKTsKKworICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7Cit9CisKK3RTaXJSZXRTdGF0dXMgQ29udmVydFdzY09wYXF1ZSggdHBBbmlTaXJHbG9iYWwgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyQWRkaWUgICAgICAgICAgICpwT2xkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVXc2NJRU9wYXF1ZSAqcE5ldyApCit7CisgICAgLy8gVGhpcyBpcyBhd2Z1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SUVSU04gICAgICAqcE5ldykKK3sKKyAgICB0QU5JX1U4IGJ1ZmZlclsyNTddOworICAgIHRBTklfVTMyIHN0YXR1cywgd3JpdHRlbiA9IDAsIG5idWZmZXIgPSAyNTc7CisgICAgc3RhdHVzID0gZG90MTFmUGFja0llUlNOKCBwTWFjLCBwTmV3LCBidWZmZXIsIG5idWZmZXIsICZ3cml0dGVuICk7CisgICAgaWYgKCBET1QxMUZfRkFJTEVEKCBzdGF0dXMgKSApCisgICAgeworICAgICAgICBkb3QxMWZMb2cocE1hYywgTE9HMiwgRkwoIkZhaWxlZCB0byByZS1wYWNrIHRoZSBSU04gSUUgKDB4JTB4IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIjgpLlxuIiksIHN0YXR1cyk7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorCisgICAgcE9sZC0+bGVuZ3RoID0gKHRBTklfVTgpd3JpdHRlbiAtIDI7CisgICAgdm9zX21lbV9jb3B5KCBwT2xkLT5pbmZvLCBidWZmZXIgKyAyLCBwT2xkLT5sZW5ndGggKTsKKworICAgIHJldHVybiBlU0lSX1NVQ0NFU1M7Cit9CisKK3RTaXJSZXRTdGF0dXMgQ29udmVydFJTTk9wYXF1ZSggdHBBbmlTaXJHbG9iYWwgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjUnNuSW5mbyAgICAgKnBPbGQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVJTTk9wYXF1ZSAqcE5ldyApCit7CisgICAgLy8gVGhpcyBpcyBhd2Z1bCwgSSBrbm93LCBidXQgdGhlIG9sZCBjb2RlIGp1c3QgcmFtbWVkIHRoZSBJRSBpbnRvCisgICAgLy8gYW4gb3BhcXVlIGFycmF5LgorICAgIHBPbGQtPmxlbmd0aCA9IHBOZXctPm51bV9kYXRhOworICAgIHZvc19tZW1fY29weSggcE9sZC0+aW5mbywgcE5ldy0+ZGF0YSwgcE9sZC0+bGVuZ3RoICk7CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworfQorCit2b2lkIENvbnZlcnRQb3dlckNhcHModHBBbmlTaXJHbG9iYWwgICAgICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNQb3dlckNhcGFiaWxpdHlJRSAqcE9sZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVQb3dlckNhcHMgICAgICAgICAgKnBOZXcpCit7CisgICAgcE9sZC0+dHlwZSAgICAgICA9IDMzOworICAgIHBPbGQtPmxlbmd0aCAgICAgPSAyOworICAgIHBPbGQtPm1pblR4UG93ZXIgPSBwTmV3LT5taW5UeFBvd2VyOworICAgIHBPbGQtPm1heFR4UG93ZXIgPSBwTmV3LT5tYXhUeFBvd2VyOworfQorCit2b2lkIENvbnZlcnRTdXBwQ2hhbm5lbHModHBBbmlTaXJHbG9iYWwgICAgICAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjU3VwcG9ydGVkQ2hhbm5lbElFICpwT2xkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVN1cHBDaGFubmVscyAgICAgICAgKnBOZXcpCit7CisgICAgcE9sZC0+dHlwZSAgID0gMzY7CisgICAgcE9sZC0+bGVuZ3RoID0gKCBwTmV3LT5udW1fYmFuZHMgKiAyICk7CisgICAgdm9zX21lbV9jb3B5KCAoIHRBTklfVTgqIClwT2xkLT5zdXBwb3J0ZWRDaGFubmVscywgKCB0QU5JX1U4KiApcE5ldy0+YmFuZHMsIHBPbGQtPmxlbmd0aCApOworfQorCit2b2lkIENvbnZlcnRDRlBhcmFtcyh0cEFuaVNpckdsb2JhbCAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNDZlBhcmFtU2V0ICpwT2xkLAorICAgICAgICAgICAgICAg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BwT2xkLT5iaXRtYXBMZW5ndGggID0gcE5ldy0+bnVtX3ZibXA7CisKKyAgICB2b3NfbWVtX2NvcHkoIHBPbGQtPmJpdG1hcCwgcE5ldy0+dmJtcCwgcE5ldy0+bnVtX3ZibXAgKTsKK30KKwordm9pZCBDb252ZXJ0Q291bnRyeSh0cEFuaVNpckdsb2JhbCAgICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyQ291bnRyeUluZm9ybWF0aW9uICpwT2xkLAorICAgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVDb3VudHJ5ICAgICAgICAgICpwTmV3KQoreworICAgIGludCBpOworCisgICAgdm9zX21lbV9jb3B5KCBwT2xkLT5jb3VudHJ5U3RyaW5nLCBwTmV3LT5jb3VudHJ5LCBDT1VOVFJZX1NUUklOR19MRU5HVEggKTsKKworICAgIHBPbGQtPm51bUludGVydmFscyA9IHBOZXctPm51bV90cmlwbGV0czsKKworICAgIGZvciAoaSA9IDA7IGkgPCBwTmV3LT5udW1fdHJpcGxldHM7ICsraSkKKyAgICB7CisgICAgICAgIHBPbGQtPmNoYW5uZWxUcmFuc21pdFBvd2VyW2ldLmNoYW5uZWxOdW1iZXIgICAgPSBwTmV3LT50cmlwbGV0c1tpXVswXTsKKyAgICAgICAgcE9sZC0+Y2hhbm5lbFRyYW5zbWl0UG93ZXJbaV0ubnVtQ2hhbm5lbCAgICAgICA9IHBOZXctPnRyaXBsZXRzW2ldWzFdOworICAgICAgICBwT2xkLT5jaGFubmVsVHJhbnNtaXRQb3dlcltpXS5tYXhUcmFuc21pdFBvd2VyID0gcE5ldy0+dHJpcGxldHNbaV1bMl07CisgICAgfQorfQorCit2b2lkIENvbnZlcnRXTU1QYXJhbXModHBBbmlTaXJHbG9iYWwgICAgICAgICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNFZGNhUGFyYW1TZXRJRSAqcE9sZCwKKyAgICAgICAgICAgICAgICAgICA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hY207CisgICAgcE9sZC0+YWN2aS5hY2kuYWNpICAgID0gcE5ldy0+YWN2aV9hY2k7CisgICAgcE9sZC0+YWN2aS5jdy5taW4gICAgID0gcE5ldy0+YWN2aV9hY3dtaW47CisgICAgcE9sZC0+YWN2aS5jdy5tYXggICAgID0gcE5ldy0+YWN2aV9hY3dtYXg7CisgICAgcE9sZC0+YWN2aS50eG9wbGltaXQgID0gcE5ldy0+YWN2aV90eG9wbGltaXQ7CisKKyAgICBwT2xkLT5hY3ZvLmFjaS5haWZzbiAgPSBwTmV3LT5hY3ZvX2FpZnNuOworICAgIHBPbGQtPmFjdm8uYWNpLmFjbSAgICA9IHBOZXctPmFjdm9fYWNtOworICAgIHBPbGQtPmFjdm8uYWNpLmFjaSAgICA9IHBOZXctPmFjdm9fYWNpOworICAgIHBPbGQtPmFjdm8uY3cubWluICAgICA9IHBOZXctPmFjdm9fYWN3bWluOworICAgIHBPbGQtPmFjdm8uY3cubWF4ICAgICA9IHBOZXctPmFjdm9fYWN3bWF4OworICAgIHBPbGQtPmFjdm8udHhvcGxpbWl0ICA9IHBOZXctPmFjdm9fdHhvcGxpbWl0OworfQorCit2b2lkIENvbnZlcnRFUlBJbmZvKHRwQW5pU2lyR2xvYmFsICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNFcnBJbmZvICAgKnBPbGQsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRUVSUEluZm8gICAgKnBOZXcpCit7CisgICAgcE9sZC0+bm9uRXJwUHJlc2VudCA9IHBOZXctPm5vbl9lcnBfcHJlc2VudDsKKyAgICBwT2xkLT51c2VQcm90ZWN0aW9uID0gcE5ldy0+dXNlX3Byb3Q7CisgICAgcE9sZC0+YmFya2VyUHJlYW1ibGVNb2RlID0gcE5ldy0+YmFya2VyX3ByZWFtYmxlOworfQorCit2b2lkIENvbnZlcnRFRENBUGFyYW0odHBBbmlTaXJHbG9iYWwgICAgICAgICBwTWFjLAorIC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YWNpLmFpZnNuICA9IHBOZXctPmFjdmlfYWlmc247CisgICAgcE9sZC0+YWN2aS5hY2kuYWNtICAgID0gcE5ldy0+YWN2aV9hY207CisgICAgcE9sZC0+YWN2aS5hY2kuYWNpICAgID0gcE5ldy0+YWN2aV9hY2k7CisgICAgcE9sZC0+YWN2aS5jdy5taW4gICAgID0gcE5ldy0+YWN2aV9hY3dtaW47CisgICAgcE9sZC0+YWN2aS5jdy5tYXggICAgID0gcE5ldy0+YWN2aV9hY3dtYXg7CisgICAgcE9sZC0+YWN2aS50eG9wbGltaXQgID0gcE5ldy0+YWN2aV90eG9wbGltaXQ7CisKKyAgICBwT2xkLT5hY3ZvLmFjaS5haWZzbiAgPSBwTmV3LT5hY3ZvX2FpZnNuOworICAgIHBPbGQtPmFjdm8uYWNpLmFjbSAgICA9IHBOZXctPmFjdm9fYWNtOworICAgIHBPbGQtPmFjdm8uYWNpLmFjaSAgICA9IHBOZXctPmFjdm9fYWNpOworICAgIHBPbGQtPmFjdm8uY3cubWluICAgICA9IHBOZXctPmFjdm9fYWN3bWluOworICAgIHBPbGQtPmFjdm8uY3cubWF4ICAgICA9IHBOZXctPmFjdm9fYWN3bWF4OworICAgIHBPbGQtPmFjdm8udHhvcGxpbWl0ICA9IHBOZXctPmFjdm9fdHhvcGxpbWl0OworCit9CisKK3ZvaWQgQ29udmVydFRTUEVDKHRwQW5pU2lyR2xvYmFsICBwTWFjLAorICAgICAgICAgICAgICAgICAgICAgICAgdFNpck1hY1RzcGVjSUUgKnBPbGQsCisgICAgICAgICAgICAgICAgICAgICAgICB0RG90MTFmSUVUU1BFQyAqcE5ldykKK3sKKyAgICBwT2xkLT50c2luZm8udHJhZmZpYy50cmFmZmljVHlwZSAgPSAodEFOSV9VMTYpcE5ldy0+dHJhZmZpY190eXBlOworICAgIHBPbGQtPnRzaW5mby50cmFmZmljLnRzaWQgICAgICAgICA9ICh0QU5JX1UxNilwTmV3LT50c2lkOworICAgIHBPbGQtPnRzaW5mby50cmFmZmljLmRpcmVjdGlvbiAgICA9ICh0QU5JX1UxNilwTmV3LT5kaXJlY3Rpb247CisgICAgcE9sZC0+dHNpbmZvLnRyYWZmaWMuYWNjZXNzUG9saWN5ID0gKHRBTklfVTE2KXBOZXctPmFjY2Vzc19wb2xpY3k7CisgICAgcE9sZC0+dHNpbmZvLnRyYWZmaWMuYWdncmVnYXRpb24gID0gKHRBTklfVTE2KXBOZXctPmFnZ3JlZ2F0aW9uOworICAgIHBPbGQtPnRzaW5mby50cmFmZmljLnBzYiAgICAgICAgICA9ICh0QU5JX1UxNilwTmV3LT5wc2I7CisgICAgcE9sZC0+dHNpbmZvLnRyYWZmaWMudXNlclByaW8gICAgID0gKHRBTklfVTE2KXBOZXctPnVzZXJfcHJpb3JpdHk7CisgICAgcE9sZC0+dHNpbmZvLnRyYWZmaWMuYWNrUG9saWN5ICAgID0gKHRBTklfVTE2KXBOZXctPnRzaW5mb19hY2tfcG9sOworCisgICAgcE9sZC0+dHNpbmZvLnNjaGVkdWxlLnNjaGVkdWxlICAgID0gKHRBTklfVTgpcE5ldy0+c2NoZWR1bGU7CisKKyAgICBwT2xkLT5ub21Nc2R1U3ogICAgICAgICAgICAgICAgICAgPSBwTmV3LT5zaXplOworICAgIHBPbGQtPm1heE1zZHVTeiAgICAgICAgICAgICAgICAgICA9IHBOZXctPm1heF9tc2R1X3NpemU7CisgICAgcE9sZC0+bWluU3ZjSW50ZXJ2YWwgICAgICAgICAgICAgID0gcE5ldy0+bWluX3NlcnZpY2VfaW50OworICAgIHBPbGQtPm1heFN2Y0ludGVydmFsICAgICAgICAgICAgICA9IHBOZXctPm1heF9zZXJ2aWNlX2ludDsKKyAgICBwT2xkLT5pbmFjdEludGVydmFsICAgICAgICAgICAgICAgPSBwTmV3LT5pbmFjdGl2aXR5X2ludDsKKyAgICBwT2xkLT5zdXNwZW5kSW50ZXJ2YWwgICAgICAgICAgICAgPSBwTmV3LT5zdXNwZW5zaW9uX2ludDsKKyAgICBwT2xkLT5zdmNTdGFydFRpbWUgICAgICAgICAgICAgICAgPSBwTmV3LT5zZXJ2aWNlX3N0YXJ0X3RpbWU7CisgICAgcE9sZC0+bWluRGF0YVJhdGUgICAgICAgICAgICAgICAgID0gcE5ldy0+bWluX2RhdGFfcmF0ZTsKKyAgICBwT2xkLT5tZWFuRGF0YVJhdGUgICAgICAgICAgICAgICAgPSBwTmV3LT5tZWFuX2RhdGFfcmF0ZTsKKyAgICBwT2xkLT5wZWFrRGF0YVJhdGUgICAgICAgICAgICAgICAgPSBwTmV3LT5wZWFrX2RhdGFfcmF0ZTsKKyAgICBwT2xkLT5tYXhCdXJzdFN6ICAgICAgICAgICAgICAgICAgPSBwTmV3LT5idXJzdF9zaXplOworICAgIHBPbGQtPmRlbGF5Qm91bmQgICAgICAgICAgICAgICAgICA9IHBOZXctPmRlbGF5X2JvdW5kOworICAgIHBPbGQtPm1pblBoeVJhdGUgICAgICAgICAgICAgICAgICA9IHBOZXctPm1pbl9waHlfcmF0ZTsKKyAgICBwT2xkLT5zdXJwbHVzQncgICAgICAgICAgICAgICAgICAgPSBwTmV3LT5zdXJwbHVzX2J3X2FsbG93YW5jZTsKKyAgICBwT2xkLT5tZWRpdW1UaW1lICAgICAgICAgICAgICAgICAgPSBwTmV3LT5tZWRpdW1fdGltZTsKK30KKwordFNpclJldFN0YXR1cyBDb252ZXJ0VENMQVModHBBbmlTaXJHbG9iYWwgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyVGNsYXNJbmZvICAqcE9sZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVRDTEFTICpwTmV3KQoreworICAgIHRBTklfVTMyIGxlbmd0aCA9IDA7CisKKyAgICBpZiAoIERPVDExRl9GQUlMRUQoIGRvdDExZkdldFBhY2tlZElFVENMQVMoIHBNYWMsIHBOZXcsICZsZW5ndGggKSApICkKKyAgICB7CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU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T50Y2xhc1BhcmFtcy5pcHY2LnNyY0lwQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKCB0QU5JX1U4KiApcE5ldy0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5zb3VyY2UsIDE2ICk7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkoICggdEFOSV9VOCogKXBPbGQtPnRjbGFzUGFyYW1zLmlwdjYuZHN0SXBBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAoIHRBTklfVTgqIClwTmV3LT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmRlc3QsIDE2ICk7CisgICAgICAgICAgICBwT2xkLT50Y2xhc1BhcmFtcy5pcHY2LnNyY1BvcnQgID0gcE5ldy0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5zcmNfcG9ydDsKKyAgICAgICAgICAgIHBPbGQtPnRjbGFzUGFyYW1zLmlwdjYuZHN0UG9ydCAgPSBwTmV3LT5pbmZvLklwUGFyYW1zLnBhcmFtcy5JcFY2UGFyYW1zLmRlc3RfcG9ydDsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSggKCB0QU5JX1U4KiApcE9sZC0+dGNsYXNQYXJhbXMuaXB2Ni5mbG93TGFiZWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICggdEFOSV9VOCogKXBOZXctPmluZm8uSXBQYXJhbXMucGFyYW1zLklwVjZQYXJhbXMuZmxvd19sYWJlbCwgMyApOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICBjYXNlIDI6CisgICAgICAgIHBPbGQtPnRjbGFzUGFyYW1zLnQ4MDIxZHEudGFnID0gcE5ldy0+aW5mby5QYXJhbXM4MDIxZHEudGFnX3R5cGU7CisgICAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICAgIHJldHVybiBlU0lSX0ZBSUxVUkU7CisgICAgfQorCisgICAgcmV0dXJuIGVTSVJfU1VDQ0VTUzsKK30KKwordm9pZCBDb252ZXJ0V01NVFNQRUModHBBbmlTaXJHbG9iYWwgICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTWFjVHNwZWNJRSAgICAqcE9sZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVdNTVRTUEVDICpwTmV3KQoreworICAgIHBPbGQtPnRzaW5mby50cmFmZmljLnRyYWZmaWNUeXBlICA9ICh0QU5JX1UxNilwTmV3LT50cmFmZmljX3R5cGU7CisgICAgcE9sZC0+dHNpbmZvLnRyYWZmaWMudHNpZCAgICAgICAgID0gKHRBTklfVTE2KXBOZXctPnRzaWQ7CisgICAgcE9sZC0+dHNpbmZvLnRyYWZmaWMuZGlyZWN0aW9uICAgID0gKHRBTklfVTE2KXBOZXctPmRpcmVjdGlvbjsKKyAgICBwT2xkLT50c2luZm8udHJhZmZpYy5hY2Nlc3NQb2xpY3kgPSAodEFOSV9VMTYpcE5ldy0+YWNjZXNzX3BvbGljeTsKKyAgICBwT2xkLT50c2luZm8udHJhZmZpYy5hZ2dyZWdhdGlvbiAgPSAodEFOSV9VMTYpcE5ldy0+YWdncmVnYXRpb247CisgICAgcE9sZC0+dHNpbmZvLnRyYWZmaWMucHNiICAgICAgICAgID0gKHRBTklfVTE2KXBOZXctPnBzYjsKKyAgICBwT2xkLT50c2luZm8udHJhZmZpYy51c2VyUHJpbyAgICAgPSAodEFOSV9VMTYpcE5ldy0+dXNlcl9wcmlvcml0eTsKKyAgICBwT2xkLT50c2luZm8udHJhZmZpYy5hY2tQb2xpY3kgICAgPSAodEFOSV9VMTYpcE5ldy0+dHNpbmZvX2Fja19wb2w7CisgICAgcE9sZC0+bm9tTXNkdVN6ICAgICAgICAgICAgICAgICAgID0gKHBOZXctPmZpeGVkIDw8IDE1KSB8IHBOZXctPnNpemU7CisgICAgcE9sZC0+bWF4TXNkdVN6ICAgICAgICAgICAgICAgICAgID0gcE5ldy0+bWF4X21zZHVfc2l6ZTsKKyAgICBwT2xkLT5taW5TdmNJbnRlcnZhbCAgICAgICAgICAgICAgPSBwTmV3LT5taW5fc2VydmljZV9pbnQ7CisgICAgcE9sZC0+bWF4U3ZjSW50ZXJ2YWwgICAgICAgICAgICAgID0gcE5ldy0+bWF4X3NlcnZpY2VfaW50OworICAgIHBPbGQtPmluYWN0SW50ZXJ2YWwgICAgICAgICAgICAgICA9IHBOZXctPmluYWN0aXZpdHlfaW50OworICAgIHBPbGQtPnN1c3BlbmRJbnRlcnZhbCAgICAgICAgICAgICA9IHBOZXctPnN1c3BlbnNpb25faW50OworICAgIHBPbGQtPnN2Y1N0YXJ0VGltZSAgICAgICAgICAgICAgICA9IHBOZXctPnNlcnZpY2Vfc3RhcnRfdGltZTsKKyAgICBwT2xkLT5taW5EYXRhUmF0ZSAgICAgICAgICAgICAgICAgPSBwTmV3LT5taW5fZGF0YV9yYXRlOworICAgIHBPbGQtPm1lYW5EYXRhUmF0ZSAgICAgICAgICAgICAgICA9IHBOZXctPm1lYW5fZGF0YV9yYXRlOworICAgIHBPbGQtPnBlYWtEYXRhUmF0ZSAgICAgICAgICAgICAgICA9IHBOZXctPnBlYWtfZGF0YV9yYXRlOworICAgIHBPbGQtPm1heEJ1cnN0U3ogICAgICAgICAgICAgICAgICA9IHBOZXctPmJ1cnN0X3NpemU7CisgICAgcE9sZC0+ZGVsYXlCb3VuZCAgICAgICAgICAgICAgICAgID0gcE5ldy0+ZGVsYXlfYm91bmQ7CisgICAgcE9sZC0+bWluUGh5UmF0ZSAgICAgICAgICAgICAgICAgID0gcE5ldy0+bWluX3BoeV9yYXRlOworICAgIHBPbGQtPnN1cnBsdXNCdyAgICAgICAgICAgICAgICAgICA9IHBOZXctPnN1cnBsdXNfYndfYWxsb3dhbmNlOworICAgIHBPbGQtPm1lZGl1bVRpbWU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XJhbXMuZGVzdF9wb3J0OworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCAoIHRBTklfVTgqIClwT2xkLT50Y2xhc1BhcmFtcy5pcHY2LmZsb3dMYWJlbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKCB0QU5JX1U4KiApcE5ldy0+aW5mby5JcFBhcmFtcy5wYXJhbXMuSXBWNlBhcmFtcy5mbG93X2xhYmVsLCAzICk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICByZXR1cm4gZVNJUl9GQUlMVVJFOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgMjoKKyAgICAgICAgcE9sZC0+dGNsYXNQYXJhbXMudDgwMjFkcS50YWcgPSBwTmV3LT5pbmZvLlBhcmFtczgwMjFkcS50YWdfdHlwZTsKKyAgICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgICAgcmV0dXJuIGVTSVJfRkFJTFVSRTsKKyAgICB9CisKKyAgICByZXR1cm4gZVNJUl9TVUNDRVNTOworfQorCit2b2lkIENvbnZlcnRUU0RlbGF5KHRwQW5pU2lyR2xvYmFsICAgIHBNYWMsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNUc0RlbGF5SUUgKnBPbGQsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHREb3QxMWZJRVRTRGVsYXkgKnBOZXcpCit7CisgICAgcE9sZC0+dHlwZSAgID0gRE9UMTFGX0VJRF9UU0RFTEFZOworICAgIHBPbGQtPmxlbmd0aCA9IDRVOworICAgIHBPbGQtPmRlbGF5ICA9IHBOZXctPmRlbGF5OworfQorCit2b2lkIENvbnZlcnRTY2hlZHVsZSh0cEFuaVNpckdsb2JhbCAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNTY2hlZHVsZUlFICpwT2xkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFU2NoZWR1bGUgKnBOZXcpCit7CisgICAgcE9sZC0+dHlwZSAgICAgICAgICAgICA9IERPVDExRl9FSURfU0NIRURVTEU7CisgICAgcE9sZC0+bGVuZ3RoICAgICAgICAgICA9IERPVDExRl9JRV9TQ0hFRFVMRV9NSU5fTEVOOworCisgICAgcE9sZC0+aW5mby5hZ2dyZWdhdGlvbiA9IHBOZXctPmFnZ3JlZ2F0aW9uOworICAgIHBPbGQtPmluZm8udHNpZCAgICAgICAgPSBwTmV3LT50c2lkOworICAgIHBPbGQtPmluZm8uZGlyZWN0aW9uICAgPSBwTmV3LT5kaXJlY3Rpb247CisKKyAgICBwT2xkLT5zdmNTdGFydFRpbWUgICAgID0gcE5ldy0+c2VydmljZV9zdGFydF90aW1lOworICAgIHBPbGQtPnN2Y0ludGVydmFsICAgICAgPSBwTmV3LT5zZXJ2aWNlX2ludGVydmFsOworICAgIHBPbGQtPnNwZWNJbnRlcnZhbCAgICAgPSBwTmV3LT5zcGVjX2ludGVydmFsOworfQorCit2b2lkIENvbnZlcnRXTU1TY2hlZHVsZSh0cEFuaVNpckdsb2JhbCAgICAgICAgcE1hYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJNYWNTY2hlZHVsZUlFICAgICpwT2xkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERvdDExZklFV01NU2NoZWR1bGUgKnBOZXcpCit7CisgICAgcE9sZC0+dHlwZSAgICAgICAgICAgICA9IERPVDExRl9FSURfV01NU0NIRURVTEU7CisgICAgcE9sZC0+bGVuZ3RoICAgICAgICAgICA9IERPVDExRl9JRV9XTU1TQ0hFRFVMRV9NSU5fTEVOOworCisgICAgcE9sZC0+aW5mby5hZ2dyZWdhdGlvbiA9IHBOZXctPmFnZ3JlZ2F0aW9uOworICAgIHBPbGQtPmluZm8udHNpZCAgICAgICAgPSBwTmV3LT50c2lkOworICAgIHBPbGQtPmluZm8uZGlyZWN0aW9uICAgPSBwTmV3LT5kaXJlY3Rpb247CisKKyAgIC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KKyAgICB2b3NfbWVtX2NvcHkoICh2b2lkICopJm1hY01nbXRIZHItPmRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilic3NpZCwgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgdm9zX21lbV9jb3B5KCAodm9pZCAqKSZtYWNNZ210SGRyLT5zYSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopc2VsZk1hY0FkZHIsIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgIHZvc19tZW1fY29weSggKHZvaWQgKikmbWFjTWdtdEhkci0+YnNzSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKWJzc2lkLCBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAKKyAgICByZXR1cm47Cit9CisKKwordm9pZCBDcmVhdGVTY2FuQ3RzRnJhbWUodHBBbmlTaXJHbG9iYWwgcE1hYywgdFNpck1hY01nbXRIZHIgKm1hY01nbXRIZHIsIHRTaXJNYWNBZGRyIHNlbGZNYWMpCit7CisgICAgbWFjTWdtdEhkci0+ZmMudHlwZSA9IFNJUl9NQUNfQ1RSTF9GUkFNRTsKKyAgICBtYWNNZ210SGRyLT5mYy5zdWJUeXBlID0gU0lSX01BQ19DVFJMX0NUUzsKKyAgICBtYWNNZ210SGRyLT5mYy5vcmRlciA9IDA7CisgICAgbWFjTWdtdEhkci0+ZmMud2VwID0gMDsKKyAgICBtYWNNZ210SGRyLT5mYy5tb3JlRGF0YSA9MDsKKyAgICBtYWNNZ210SGRyLT5mYy5wb3dlck1nbXQgPSAwOyAgCisgICAgbWFjTWdtdEhkci0+ZmMucmV0cnkgPSAwOworICAgIG1hY01nbXRIZHItPmZjLm1vcmVGcmFnID0gMDsKKyAgICBtYWNNZ210SGRyLT5mYy5mcm9tRFMgPSAwOworICAgIG1hY01nbXRIZHItPmZjLnRvRFMgPSAwOworICAgIG1hY01nbXRIZHItPmR1cmF0aW9uTG8gPSAod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VkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmbmRlZiBfX1RMX0RFQlVHX0hfXworI2RlZmluZSBfX1RMX0RFQlVHX0hfXworI2lmICAhZGVmaW5lZCAoQU5JX09TX1RZUEVfQU5EUk9JRCkKKyNpbmNsdWRlIDxzdGRpby5oPgorI2VuZGlmCisjaW5jbHVkZSA8c3RkYXJnLmg+CisjaW5jbHVkZSAidm9zX3RyYWNlLmgiCisjaWZkZWYgV0xBTl9ERUJVRworI2lmZGVmIFdMQU5fTURNX0RBVEFQQVRIX09QVAorI2RlZmluZSBUTExPR1AoeDApICB4MAorI2RlZmluZSBUTExPR0UoeDApICB4MAorI2RlZmluZSBUTExPR1coeDApICB4MAorI2RlZmluZSBUTExPRzEoeCkgIHt9CisjZGVmaW5lIFRMTE9HMih4KSAge30KKyNkZWZpbmUgVExMT0czKHgpICB7fQorI2RlZmluZSBUTExPRzQoeCkgIHt9CisKKyNlbHNlIC8qV0xBTl9NRE1fREFUQVBBVEhfT1BUKi8KKworI2RlZmluZSBUTExPR1AoeDApICB4MAorI2RlZmluZSBUTExPR0UoeDApICB4MAorI2RlZmluZSBUTExPR1coeDApICB4MAorI2RlZmluZSBUTExPRzEoeDApICB4MAorCisjaWZkZWYgVExfREVCVUdfTE9HMgorI2RlZmluZSBUTExPRzIoeDApICB4MAorI2Vsc2UKKyAjZGVmaW5lIFRMTE9HMih4MCkKKyNlbmRpZgorCisjaWZkZWYgVExfREVCVUdfTE9HMworI2RlZmluZSBUTExPRzMoeDApICB4MAorI2Vsc2UKKyAjZGVmaW5lIFRMTE9HMyh4MCkKKyNlbmRpZgorCisjaWZkZWYgVExfREVCVUdfTE9HNAorI2RlZmluZSBUTExPRzQoeDApICB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xBTl9RQ1RfV0xBTlRMX0gKKyNkZWZpbmUgV0xBTl9RQ1RfV0xBTlRMX0gKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgVyBMIEEgTiAgIFQgUiBBIE4gUyBQIE8gUiBUICAgTCBBIFkgRSBSCisgICAgICAgICAgICAgICAgICAgICAgIEUgWCBUIEUgUiBOIEEgTCAgQSBQIEkKKworCitERVNDUklQVElPTgorICBUaGlzIGZpbGUgY29udGFpbnMgdGhlIGV4dGVybmFsIEFQSSBleHBvc2VkIGJ5IHRoZSB3bGFuIHRyYW5zcG9ydCBsYXllcgorICBtb2R1bGUuCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICBFRElUIEhJU1RPUlkgRk9SIEZJTEUKKworCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLgorICBOb3RpY2UgdGhhdCBjaGFuZ2VzIGFyZSBsaXN0ZWQgaW4gcmV2ZXJzZSBjaHJvbm9sb2dpY2FsIG9yZGVyLgorCisKKyAgJEhlYWRlcjokICREYXRlVGltZTogJCAkQXV0aG9yOiAkCisKKword2hlbiAgICAgICAgd2hvICAgIHdoYXQsIHdoZXJlLCB3aHkKKy0tLS0tLS0tICAgIC0tLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiswMS8wOC8xMCAgICBsdGkgICAgIEFkZGVkIFRMIERhdGEgQ2FjaGluZyAKKzEwLzE1LzA5ICAgIHJuYWlyICAgTW9kaWZ5aW5nIFNUQURlc2NUeXBlIHN0cnVjdAorMTAvMDYvMDkgICAgcm5haXIgICBBZGRpbmcgc3VwcG9ydCBmb3IgV0FQSSAKKzA5LzIyLzA5ICAgIGx0aSAgICAgQWRkIGRlcmVnaXN0cmF0aW9uIEFQSSBmb3IgbWFuYWdlbWVudCBjbGllbnQKKzAyLzAyLzA5ICAgIHNjaCAgICAgQWRkIEhhbmRvZmYgc3VwcG9ydAorMTIvMDkvMDggICAgbHRpICAgICBGaXhlcyBmb3IgQU1TUyBjb21waWxhdGlvbiAKKzA5LzA1LzA4ICAgIGx0aSAgICAgRml4ZXMgYWZ0ZXIgUU9TIHVuaXQgdGVzdGluZyAKKzA4LzA2LzA4ICAgIGx0aSAgICAgQWRkZWQgUU9TIHN1cHBvcnQgCiswNS8wMS8wOCAgICBsdGkgICAgIENyZWF0ZWQgbW9kdWxlLgorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgICAgICBJTkNMVURFIEZJTEVTIEZPUiBNT0RVTEUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKiBJbmNsdWRlIEZpbGVzCisgKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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9RVUVVRVMgaW4gSEREICovCisjZGVmaW5lIFdMQU5UTF9OVU1fVFhfUVVFVUVTICAgICAgICAgICAgICAgICAgNQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICAgICBHRU5FUklDIFNUUlVDVFVSRVMgLSBub3QgYmVsb25naW5nIHRvIFRMIAorICogICAgIFRPIEJFIE1PVkVEIFRPIEEgR0xPQkFMIEhFQURFUgorID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworLypNYXhpbXVtIG51bWJlciBvZiBBQ3MgKi8KKyNkZWZpbmUgV0xBTlRMX01BWF9BQyAgICAgICAgICAgICAgICAgICAgICAgICA0CisKKy8qIE1heGltdW0gbnVtYmVyIG9mIHN0YXRpb24gc3VwcG9ydGVkIGJ5IFRMLCBpbmNsdWRpbmcgQkMuICovCisjZGVmaW5lIFdMQU5fTUFYX1NUQV9DT1VOVCAgKEhBTF9OVU1fU1RBKQorI2RlZmluZSBXTEFOX05PTjMyX1NUQV9DT1VOVCAgIDE0CisvKiBUaGUgc3ltYm9saWMgc3RhdGlvbiBJRCByZXR1cm4gdG8gSEREIHRvIHNwZWNpZnkgdGhlIHBhY2tldCBpcyBiYy9tYyAqLworI2RlZmluZSBXTEFOX1JYX0JDTUNfU1RBX0lEIChXTEFOX01BWF9TVEFfQ09VTlQgKyAxKQorCisvKiBUaGUgc3ltYm9saWMgc3RhdGlvbiBJRCByZXR1cm4gdG8gSEREIHRvIHNwZWNpZnkgdGhlIHBhY2tldCBpcyB0byBzb2Z0LUFQIGl0c2VsZiAqLworI2RlZmluZSBXTEFOX1JYX1NBUF9TRUxGX1NUQV9JRCAoV0xBTl9NQVhfU1RBX0NPVU5UICsgMikKKworLyogVXNlZCBieSBIRFMgc3lzdG1lLiBUaGlzIHN0YXRpb24gSUQga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KyAgV0xBTlRMX0JJX0RJUiA9IDIsCit9V0xBTlRMX1RTRGlyVHlwZTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiAgICAgR0VORVJJQyBTVFJVQ1RVUkVTIC0gRU5ECisgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAqICBUeXBlIERlY2xhcmF0aW9ucworICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgIFRMIEVycm9yIFR5cGUgCistLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLyAgICAgIAordHlwZWRlZiBlbnVtCit7CisgIC8qIEdlbmVyaWMgZXJyb3IgKi8KKyAgV0xBTlRMX0VSUk9SID0gMCwgICAgICAKKworICAvKiBObyByeCBjYWxsYmFjayByZWdpc3RlcmVkIGZvciBkYXRhIHBhdGggKi8KKyAgV0xBTlRMX05PX1JYX0RBVEFfQ0IsICAKKworICAvKiBObyByeCBjYWxsYmFjayByZWdpc3RlcmVkIGZvciBtYW5hZ2VtZW50IHBhdGgqLworICBXTEFOVExfTk9fUlhfTUdNVF9DQiwgIAorCisgIC8qI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RhbCBudW1iZXIgb2YgZGF0YSBwa3QgcmV0cmllcyAqLworICB2X1UzMl90ICAgICAgICAgICByZXRyaWVzOworCisgIC8qIG51bWJlciBvZiBzaG9ydCBkYXRhIHBrdCByZXRyaWVzICovCisgIHZfVTMyX3QgICAgICAgICAgIHJldHJpZXNTaG9ydDsKKworICAvKiBudW1iZXIgb2YgbG9uZyBkYXRhIHBrdCByZXRyaWVzICovCisgIHZfVTMyX3QgICAgICAgICAgIHJldHJpZXNMb25nOworCisgIC8qIGRhdGEgcGt0IG1pbiBjb250ZW50aW9uIHRpbWUgKHVzZWNzKSAqLworICB2X1UzMl90ICAgICAgICAgICBjb250ZW50aW9uVGltZU1pbjsKKworICAvKiBkYXRhIHBrdCBtYXggY29udGVudGlvbiB0aW1lICh1c2VjcykgKi8KKyAgdl9VMzJfdCAgICAgICAgICAgY29udGVudGlvblRpbWVNYXg7CisKKyAgLyogZGF0YSBwa3QgYXZnIGNvbnRlbnRpb24gdGltZSAodXNlY3MpICovCisgIHZfVTMyX3QgICAgICAgICAgIGNvbnRlbnRpb25UaW1lQXZnOworCisgIC8qIG51bSBvZiBkYXRhIHBrdHMgdXNlZCBmb3IgY29udGVudGlvbiBzdGF0aXN0aWNzICovCisgIHZfVTMyX3QgICAgICAgICAgIGNvbnRlbnRpb25OdW1TYW1wbGVzOworfVdMQU5UTF9BY2Nlc3NDYXRlZ29yeVN0YXRzVHlwZTsKKworLyogcGVyIGludGVyZmFjZSBzdGF0aXN0aWNzICovCit0eXBlZGVmIFBBQ0tFRF9QUkUgc3RydWN0IFBBQ0tFRF9QT1NUCit7CisgIC8qIGFjY2VzcyBwb2ludCBiZWFjb24gcmVjZWl2ZWQgY291bnQgZnJvbSBjb25uZWN0ZWQgQVAgKi8KKyAgdl9VMzJfdCAgICAgICAgICAgICAgIGJlYWNvblJ4OworCisgIC8qIGFjY2VzcyBwb2ludCBtZ210IGZyYW1lcyByZWNlaXZlZCBjb3VudCBmcm9tIGNvbm5lY3RlZCB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ZSAKKyAgICBwdWNBQzogICAgICAgICAgYWNjZXNzIGNhdGVnb3J5IHJlcXVlc3RlZCBieSBUTCwgaWYgSEREIGRvZXMgbm90IGhhdmUgCisgICAgICAgICAgICAgICAgICAgIHBhY2tldHMgb24gdGhpcyBBQyBpdCBjYW4gY2hvb3NlIHRvIHNlcnZpY2UgYW5vdGhlciBBQyAKKyAgICAgICAgICAgICAgICAgICAgcXVldWUgaW4gdGhlIG9yZGVyIG9mIHByaW9yaXR5CisKKyAgICBPVVQKKyAgICB2b3NEYXRhQnVmZjogICBwb2ludGVyIHRvIHRoZSBWT1NTIGRhdGEgYnVmZmVyIHRoYXQgd2FzIHRyYW5zbWl0dGVkIAorICAgIHRsTWV0YUluZm86ICAgIG1ldGEgaW5mbyByZWxhdGVkIHRvIHRoZSBkYXRhIGZyYW1lCisKKworICAKKyAgUkVUVVJOIFZBTFVFIAorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uCisKKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwordHlwZWRlZiBWT1NfU1RBVFVTICgqV0xBTlRMX1NUQUZldGNoUGt0Q0JUeXBlKSggCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfUFZPSURfdCAgICAgICAgICAgICBwdm9zR0N0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90KiAgICAgICAgICAgICAgIHB1Y1NUQUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfQUNFbnVtVHlwZSAgICAgdWNBQywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX3BrdF90KiogICAgICAgICAgIHZvc0RhdGFCdWZmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfTWV0YUluZm9UeXBlKiAgdGxNZXRhSW5mbyk7CisKK3R5cGVkZWYgVk9TX1NUQVRVUyAoKldMQU5UTF9Nb25SeENCVHlwZSkoIHZfUFZPSURfdCAgICAgICAgICAgICAgcHZvc0dDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfcGt0X3QqICAgICAgICAgICAgIHZvc0RhdGFCdWZmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ICAgICAgICAgICAgICAgICAgICBjb252ZXJzaW9uKTsKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIERFU0NSSVBUSU9OICAgCisgICAgVHlwZSBvZiB0aGUgcmVjZWl2ZSBjYWxsYmFjayByZWdpc3RlcmVkIHdpdGggVEwuIAorICAgIAorICAgIFRMIHdpbGwgY2FsbCB0aGlzIHRvIG5vdGlmeSB0aGUgY2xpZW50IHdoZW4gYSBwYWNrZXQgd2FzIHJlY2VpdmVkIAorICAgIGZvciBhIHJlZ2lzdGVyZWQgU1RBLgorCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgIHB2b3NHQ3R4OiAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFuZGxlIHRvIAorICAgICAgICAgICAgICAgICAgICBUTCdzIG9yIEhERCdzIGNvbnRyb2wgYmxvY2sgY2FuIGJlIGV4dHJhY3RlZCBmcm9tIAorICAgICAgICAgICAgICAgICAgICBpdHMgY29udGV4dCAKKyAgICB2b3NEYXRhQnVmZjogICBwb2ludGVyIHRvIHRoZSBWT1NTIGRhdGEgYnVmZmVyIHRoYXQgd2FzIHJlY2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RvIHRoZSBzdXNwZW5kIHJlc3VsdCBub3RpZmljYXRpb24gaW4gY2FzZSB0aGUgCisgICAgICAgICAgICAgICAgICAgIGNhbGwgaXMgYXN5bmNocm9ub3VzCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorICAKKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwordHlwZWRlZiBWT1NfU1RBVFVTICgqV0xBTlRMX1N1c3BlbmRDQlR5cGUpKCB2X1BWT0lEX3QgICAgICBwdm9zR0N0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90KiAgICAgICAgdWNTVEFJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1NUQVRVUyAgICAgdm9zU3RhdHVzKTsKKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgREVTQ1JJUFRJT04gCisgICAgVHJhZmZpYyBzdGF0dXMgY2hhbmdlZCBjYWxsYmFjayBmdW5jdGlvbgorICAgIFNob3VsZCBiZSByZWdpc3RlcmVkIHRvIGxldCBjbGllbnQga25vdyB0aGF0IHRyYWZmaWMgc3RhdHVzIGlzIGNoYW5nZWQKKyAgICBSRUYgV0xBTlRMX1JlZ0dldFRyYWZmaWNTdGF0dXMKKworICBQQVJBTUVURVJTIAorICAgIHBBZGFwdGVyICAgICAgIEdsb2JhbCBoYW5kbGUgcG9pbnRlcgorICAgIHRyYWZmaWNTdGF0dXMgIFJUIGFuZCBOUlQgY3VycmVudCB0cmFmZmljIHN0YXR1cworICAgIHBVc2VyQ3R4dCAgICAgIHByZSByZWdpc3RlcmVkIGNsaWVudCBjb250ZXh0CisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVk9TX1NUQVRVUworCisgIFNJREUgRUZGRUNUUyAKKyAgICBOT05FCisgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKy8qIElGIHRyYWZmaWMgc3RhdHVzIGlzIGNoYW5nZWQsIHNlbmQgbm90aWZpY2F0aW9uIHRvIFNNRSAqLwordHlwZWRlZiBWT1NfU1RBVFVTICgqV0xBTlRMX1RyYWZmaWNTdGF0dXNDaGFuZ2VkQ0JUeXBlKQorKAorICAgdl9QVk9JRF90ICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXIsCisgICBXTEFOVExfSE9fVFJBRkZJQ19TVEFUVVNfVFlQRSB0cmFmZmljU3RhdHVzLAorICAgdl9QVk9JRF90ICAgICAgICAgICAgICAgICAgICAgcFVzZXJDdHh0CispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgREVTQ1JJUFRJT04gCisgICAgUlNTSSB0aHJlc2hvbGQgY3Jvc3NlZCBub3RpZmljYXRpb24gY2FsbGJhY2sgZnVuY3Rpb24KKyAgICBSRUYgV0xBTlRMX1JlZ1JTU0lJbmRpY2F0aW9uQ0IKKworICBQQVJBTUVURVJTIAorICAgIHBBZGFwdGVyICAgICAgICAgIEdsb2JhbCBoYW5kbGUgcG9pbnRlcgorICAgIHJzc2lOb3RpZmljYXRpb24gIE5vdGlmaWNhdGlvbiBldmVudCB0eXBlCisgICAgcFVzZXJDdHh0ICAgICAgICAgcHJlIHJlZ2lzdGVyZWQgY2xpZW50IGNvbnRleHQKKworICBSRVRVUk4gVkFMVUUKKworICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisvKiBJZiBSU1NJIHJlYWxtIGlzIGNoYW5nZWQsIHNlbmQgbm90aWZpY2F0aW9uIHRvIENsaWVudHMsIFNNRSwgSEREICovCit0eXBlZGVmIFZPU19TVEFUVVMgKCpXTEFOVExfUlNTSUNyb3NzVGhyZXNob2xkQ0JUeXBlKQorKAorICAgdl9QVk9JRF90ICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlciwKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICAgICAgcnNzaU5vdGlmaWNhdGlvbiwKKyAgIHZfUFZPSURfdCAgICAgICAgICAgICAgICAgICAgICAgcFVzZXJDdHh0LAorICAgdl9TN190ICAgICAgICAgICAgICAgICAgICAgICAgICBhdmdSc3NpCispOworCit0eXBlZGVmIHN0cnVjdAoreworICAgIC8vIENvbW1vbiBmb3IgYWxsIHR5cGVzIGFyZSByZXF1ZXN0cworICAgIHZfVTE2X3QgICAgICAgICAgICAgICAgICAgICAgICAgbXNnVHlwZTsgICAgLy8gbWVzc2FnZSB0eXBlIGlzIHNhbWUgYXMgdGhlIHJlcXVlc3QgdHlwZQorICAgIHZfVTE2X3QgICAgICAgICAgICAgICAgICAgICAgICAgbXNnTGVuOyAgLy8gbGVuZ3RoIG9mIHRoZSBlbnRpcmUgcmVxdWVzdAorICAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkOyAvL3NtZSBTZXNzaW9uIElkCisgICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgICAgICByc3NpTm90aWZpY2F0aW9uOyAgICAKKyAgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgICAgIGF2Z1Jzc2k7CisgICAgdl9QVk9JRF90ICAgICAgICAgICAgICAgICAgICAgICB0bENhbGxiYWNrOworICAgIHZfUFZPSURfdCAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXI7CisgICAgdl9QVk9JRF90ICAgICAgICAgICAgICAgICAgICAgICBwVXNlckN0eHQ7Cit9IFdMQU5UTF9UbEluZGljYXRpb25SZXE7CisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICogRnVuY3Rpb24gRGVjbGFyYXRpb25zIGFuZCBEb2N1bWVudGF0aW9uCisgKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5UTF9PcGVuCisKKyAgREVTQ1JJUFRJT04gCisgICAgQ2FsbGVkIGJ5IEhERCBhdCBkcml2ZXIgaW5pdGlhbGl6YXRpb24uIFRMIHdpbGwgaW5pdGlhbGl6ZSBhbGwgaXRzIAorICAgIGludGVybmFsIHJlc291cmNlcyBhbmQgd2lsbCB3YWl0IGZvciB0aGUgY2FsbCB0byBzdGFydCB0byByZWdpc3RlciAKKyAgICB3aXRoIHRoZSBvdGhlciBtb2R1bGVzLiAKKyAgICAKKyAgREVQRU5ERU5DSUVTIAorICAgIAorICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICBwdm9zR0N0eDogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZSB0byBUTCdzIAorICAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dCAKKyAgICBwVExDb25maWc6ICAgICAgVEwgQ29uZmlndXJhdGlvbiAKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbiAgCisKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6ICBwb2ludGVyIHRvIFRMIGNiIGlzIE5VTEwgOyBhY2Nlc3Mgd291bGQgY2F1c2UgYSBwYWdlIAorICAgICAgICAgICAgICAgICAgICAgICAgIGZhdWx0ICAKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikgCisKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyAKK1dMQU5UTF9PcGVuCisoIAorICB2X1BWT0lEX3QgICAgICAgICAgICAgICBwdm9zR0N0eCwKKyAgV0xBTlRMX0NvbmZpZ0luZm9UeXBlKiAgcFRMQ29uZmlnCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX1N0YXJ0CisKKyAgREVTQ1JJUFRJT04gCisgICAgQ2FsbGVkIGJ5IEhERCBhcyBwYXJ0IG9mIHRoZSBvdmVyYWxsIHN0YXJ0IHByb2NlZHVyZS4gVEwgd2lsbCB1c2UgdGhpcyAKKyAgICBjYWxsIHRvIHJlZ2lzdGVyIHdpdGggQkFMIGFzIGEgdHJhbnNwb3J0IGxheWVyIGVudGl0eS4gCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncyAKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQgCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgcG9pbnRlciB0byBUTCBjYiBpcyBOVUxMIDsgYWNjZXNzIHdvdWxkIGNhdXNlIGEgcGFnZSAKKyAgICAgICAgICAgICAgICAgICAgICAgICBmYXVsdCAgCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgRXZlcnl0aGluZyBpcyBnb29kIDopIAorCisgICAgT3RoZXIgY29kZXMgY2FuIGJlIHJldHVybmVkIGFzIGEgcmVzdWx0IG9mIGEgQkFMIGZhaWx1cmU7IHNlZSBCQUwgQVBJIAorICAgIGZvciBtb3JlIGluZm8KKyAgICAKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyAKK1dMQU5UTF9TdGFydAorKCAKKyAgdl9QVk9JRF90ICBwdm9zR0N0eCAKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfU3RvcAorCisgIERFU0NSSVBUSU9OIAorICAgIENhbGxlZCBieSBIREQgdG8gc3RvcCBvcGVyYXRpb24gaW4gVEwsIGJlZm9yZSBjbG9zZS4gVEwgd2lsbCBzdXNwZW5kIGFsbCAKKyAgICBmcmFtZSB0cmFuc2ZlciBvcGVyYXRpb24gYW5kIHdpbGwgd2FpdCBmb3IgdGhlIGNsb3NlIHJlcXVlc3QgdG8gY2xlYW4gdXAgCisgICAgaXRzIHJlc291cmNlcy4gCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncyAKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQgCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgcG9pbnRlciB0byBUTCBjYiBpcyBOVUxMIDsgYWNjZXNzIHdvdWxkIGNhdXNlIGEgcGFnZSAKKyAgICAgICAgICAgICAgICAgICAgICAgICBmYXVsdCAgCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgRXZlcnl0aGluZyBpcyBnb29kIDopIAorCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgCitXTEFOVExfU3RvcAorKCAKKyAgdl9QVk9JRF90ICBwdm9zR0N0eCAKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfQ2xvc2UKKworICBERVNDUklQVElPTiAKKyAgICBDYWxsZWQgYnkgSEREIGR1cmluZyBnZW5lcmFsIGRyaXZlciBjbG9zZSBwcm9jZWR1cmUuIFRMIHdpbGwgY2xlYW4gdXAgCisgICAgYWxsIHRoZSBpbnRlcm5hbCByZXNvdXJjZXMuIAorICAgIAorICBERVBFTkRFTkNJRVMgCisgICAgCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgIHB2b3NHQ3R4OiAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFuZGxlIHRvIFRMJ3MgCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wgYmxvY2sgY2FuIGJlIGV4dHJhY3RlZCBmcm9tIGl0cyBjb250ZXh0IAorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfRV9GQVVMVDogIHBvaW50ZXIgdG8gVEwgY2IgaXMgTlVMTCA7IGFjY2VzcyB3b3VsZCBjYXVzZSBhIHBhZ2UgCisgICAgICAgICAgICAgICAgICAgICAgICAgZmF1bHQgIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KSAKKworICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIAorV0xBTlRMX0Nsb3NlCisoIAorICB2X1BWT0lEX3QgIHB2b3NHQ3R4IAorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfU3RhcnRGb3J3YXJkaW5nCisKKyAgREVTQ1JJUFRJT04KKworICAgIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCB0byBhc2sgc2VyaWFsaXphdGlvbiB0aHJvdWdoIFRYIHRocmVhZCBvZiB0aGUKKyAgICBjYWNoZWQgZnJhbWUgZm9yd2FyZGluZyAoaWYgc3RhdGF0aW9uIG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ibGUgZnJhbWUgdHJhbnNsYXRpb24gZm9yIGFsbCBhc3NvY2lhdGlvbiBzdGF0aW9ucy4KKworICBERVBFTkRFTkNJRVMKKworICBQQVJBTUVURVJTCisgICBJTgorICAgIHB2b3NHQ3R4OiAgICAgICAgICAgVk9TIGNvbnRleHQgCisgICAgRW5hYmxlRnJhbWVYbGF0aW9uIFRSVUUgbWVhbnMgZW5hYmxlIFNXIHRyYW5zbGF0aW9uIGZvciBhbGwgc3RhdGlvbnMuCisgICAgLgorCisgIFJFVFVSTiBWQUxVRQorCisgICB2b2lkLgorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQKK1dMQU5UTF9Db25maWd1cmVTd0ZyYW1lVFhYbGF0aW9uRm9yQWxsCisoCisgIHZfUFZPSURfdCBwdm9zR0N0eCwgCisgIHZfQk9PTF90IGVuYWJsZUZyYW1lWGxhdGlvbgorKTsKKworVk9TX1NUQVRVUyBXTEFOVExfU2V0TW9uUnhDYmsodl9QVk9JRF90IHB2b3NHQ3R4LCBXTEFOVExfTW9uUnhDQlR5cGUgcGZuTW9uUngpOwordm9pZCBXTEFOVExfU2V0SXNDb252ZXJzaW9uUmVxKHZfUFZPSURfdCBwdm9zR0N0eCwgdl9CT09MX3QgaXNDb252ZXJzaW9uUmVxKTsKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX1JlZ2lzdGVyU1RBQ2xpZW50CisKKyAgREVTQ1JJUFRJT04gCisKKyAgICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgYnkgSEREIHRvIHJlZ2lzdGVyIGFzIGEgY2xpZW50IGZvciBkYXRhIHNlcnZpY2VzIAorICAgIHdpdGggVEwuIEhERCB3aWxsIGNhbGwgdGhpcyBBUE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JUeXBlICAgICAgIHBmblNUQVR4Q29tcCwgIAorICBXTEFOVExfU1RBRmV0Y2hQa3RDQlR5cGUgIHBmblNUQUZldGNoUGt0LAorICBXTEFOX1NUQURlc2NUeXBlKiAgICAgICAgIHdTVEFEZXNjVHlwZSAsCisgIHZfUzdfdCAgICAgICAgICAgICAgICAgICAgcnNzaQorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfVXBkYXRlVGRsc1NUQUNsaWVudAorCisgIERFU0NSSVBUSU9OCisKKyAgICBIREQgd2lsbCBjYWxsIHRoaXMgQVBJIHdoZW4gRU5BQkxFX0xJTksgaGFwcGVucyBhbmQgIEhERCB3YW50IHRvCisgICAgcmVnaXN0ZXIgUW9TIG9yIG90aGVyIHBhcmFtcyBmb3IgVERMUyBwZWVycy4KKworICBERVBFTkRFTkNJRVMKKworICAgIEEgc3RhdGlvbiBtdXN0IGhhdmUgYmVlbiByZWdpc3RlcmVkIGJlZm9yZSB0aGUgV01NL1FPUyByZWdpc3RyYXRpb24gaXMKKyAgICBjYWxsZWQuCisKKyAgUEFSQU1FVEVSUworCisgICBwdm9zR0N0eDogICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICAgd1NUQURlc2NUeXBlOiAgICBTVEEgRGVzY3JpcHRvciwgY29udGFpbnMgaW5mb3JtYXRpb24gcmVsYXRlZCB0byB0aGUKKyAgICAgICAgICAgICAgICAgICAgbmV3IGFkZGVkIFNUQQorCisgIFJFVFVSTiBWQUxVRQorCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICAgIFZPU19TVEFUVVNfRV9GQVVMVDogU3RhdGlvbiBJRCBpcyBvdXRzaWRlIGFycmF5IGJvdW5kYXJpZXMgb3IgcG9pbnRlciB0bworICAgICAgICAgICAgICAgICAgICAgICAgVEwgY2IgaXMgTlVMTCA7IGFjY2VzcyB3b3VsZCBjYXVzZSBhIHBhZ2UgZmF1bHQKKyAgICBWT1NfU1RBVFVTX0VfRVhJU1RTOiBTdGF0aW9uIHdhcyBub3QgcmVnaXN0ZXJlZAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworVk9TX1NUQVRVUworV0xBTlRMX1VwZGF0ZVRkbHNTVEFDbGllbnQKKygKKyB2X1BWT0lEX3QgICAgICAgICAgICAgICAgIHB2b3NHQ3R4LAorIFdMQU5fU1RBRGVzY1R5cGUqICAgICAgICAgd1NUQURlc2NUeXBlCispOworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX0NsZWFyU1RBQ2xpZW50CisKKyAgREVTQ1JJUFRJT04gCisKKyAgICBIREQgd2lsbCBjYWxsIHRoaXMgQVBJIHdoZW4gaXQgbm8gbG9uZ2VyIG5lZWRzIGRhdGEgc2VydmljZXMgZm9yIHRoZSAKKyAgICBwYXJ0aWN1bGFyIHN0YXRpb24uIAorCisgIERFUEVOREVOQ0lFUyAKKworICAgIEEgc3RhdGlvbiBtdXN0IGhhdmUgYmVlbiByZWdpc3RlcmVkIGJlZm9yZSB0aGUgY2xlYXIgcmVnaXN0cmF0aW9uIGlzIAorICAgIGNhbGxlZC4gCisKKyAgUEFSQU1FVEVSUyAKKworICAgcHZvc0dDdHg6ICAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFuZGxlIHRvIFRMJ3MgCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wgYmxvY2sgY2FuIGJlIGV4dHJhY3RlZCBmcm9tIGl0cyBjb250ZXh0IAorICAgdWNTVEFJZDogICAgICAgICBpZGVudGlmaWVyIGZvciB0aGUgU1RBIHRvIGJlIGNsZWFyZWQKKyAgIAorICBSRVRVUk4gVkFMVUUKKworICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKyAgICAKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6IFN0YXRpb24gSUQgaXMgb3V0c2lkZSBhcnJheSBib3VuZGFyaWVzIG9yIHBvaW50ZXIgdG8gCisgICAgICAgICAgICAgICAgICAgICAgICBUTCBjYiBpcyBOVUxMIDsgYWNjZXNzIHdvdWxkIGNhdXNlIGEgcGFnZSBmYXVsdCAgCisgICAgVk9TX1NUQVRVU19FX0VYSVNUUzogU3RhdGlvbiB3YXMgbm90IHJlZ2lzdGVyZWQgCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgRXZlcnl0aGluZyBpcyBnb29kIDopIAorICAgIAorICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTICAKK1dMQU5UTF9DbGVhclNUQUNsaWVudCAKKyggCisgIHZfUFZPSURfdCAgICAgICAgcHZvc0dDdHgsCisgIHZfVThfdCAgICAgICAgICAgdWNTVEFJZCAKKyk7CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfTElOS19MQVlFUl9TVEFUUworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5UTF9Db2xsZWN0U3RhdHMKKworICBERVNDUklQVElPTgorICAgIFV0aWxpdHkgZnVuY3Rpb24gdXNlZCBieSBUTCB0byBzZW5kIHRoZSBzdGF0aXRpY3MKKworICBERVBFTkRFTkNJRVMKKworCisgIFBBUkFNRVRFUlMKKworICAgIElOCisKKyAgICB1Y1NUQUlkOiAgICBzdGF0aW9uIGZvciB3aGljaCB0aGUgc3RhdGlzdGljcyBuZWVkIHRvIGNvbGxlY3RlZAorCisgICAgdm9zRGF0YUJ1ZmY6IGl0IHdpbGwgY29udGFpbiB0aGUgcG9pbnRlciB0byB0aGUgY29ycmVzcG9uZGluZworICAgICAgICAgICAgICAgIHN0cnVjdHVyZQorCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uCisKKyAgICBWT1NfU1RBVFVTX0VfSU5WQUw6ICAgSW5wdXQgcGFyYW1ldGVycyBhcmUgaW52YWxpZAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfQ29sbGVjdEludGVyZmFjZVN0YXRzCisoCisgIHZfUFZPSURfdCAgICAgICBwdm9zR0N0eCwKKyAgdl9VOF90ICAgICAgICAgIHVjU1RBSWQsCisgIFdMQU5UTF9JbnRlcmZhY2VTdGF0c1R5cGUgICp2b3NEYXRhQnVmZgorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5UTF9DbGVhckludGVyZmFjZVN0YXRzCisKKyAgREVTQ1JJUFRJT04KKyAgICBVdGlsaXR5IGZ1bmN0aW9uIHVzZWQgYnkgVEwgdG8gY2xlYXIgdGhlIHN0YXRpdGljcworCisgIERFUEVOREVOQ0lFUworCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKworICAgIHVjU1RBSWQ6ICAgIHN0YXRpb24gZm9yIHdoaWNoIHRoZSBzdGF0aXN0aWNzIG5lZWQgdG8gY29sbGVjdGVkCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICAgIFZPU19TVEFUVVNfRV9JTlZBTDogICBJbnB1dCBwYXJhbWV0ZXJzIGFyZSBpbnZhbGlkCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5UTF9DbGVhckludGVyZmFjZVN0YXRzCisoCisgIHZfUFZPSURfdCAgICAgICBwdm9zR0N0eCwKKyAgdl9VOF90ICAgICAgICAgIHVjU1RBSWQsCisgIHZfVThfdCAgICAgICAgICBzdGF0c0NsZWFyUmVxTWFzaworKTsKKyNlbmRpZgorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5UTF9DaGFuZ2VTVEFTdGF0ZQorCisgIERFU0NSSVBUSU9OIAorCisgICAgSEREIHdpbGwgbWFrZSB0aGlzIG5vdGlmaWNhdGlvbiB3aGVuZ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QgaXMgcGVuZGluZyB0cmFuc21pc3Npb24KKyAgIHRsU1RBU3RhdGU6ICAgICB0aGUgbmV3IHN0YXRlIG9mIHRoZSBjb25uZWN0aW9uIHRvIHRoZSBnaXZlbiBzdGF0aW9uCisKKyAgIAorICBSRVRVUk4gVkFMVUUKKworICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKyAgICAKKyAgICBWT1NfU1RBVFVTX0VfSU5WQUw6ICBJbnB1dCBwYXJhbWV0ZXJzIGFyZSBpbnZhbGlkIAorICAgIFZPU19TVEFUVVNfRV9GQVVMVDogIFN0YXRpb24gSUQgaXMgb3V0c2lkZSBhcnJheSBib3VuZGFyaWVzIG9yIHBvaW50ZXIgdG8gCisgICAgICAgICAgICAgICAgICAgICAgICAgVEwgY2IgaXMgTlVMTCA7IGFjY2VzcyB3b3VsZCBjYXVzZSBhIHBhZ2UgZmF1bHQgIAorICAgIFZPU19TVEFUVVNfRV9FWElTVFM6IFN0YXRpb24gd2FzIG5vdCByZWdpc3RlcmVkIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KSAKKworICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTICAKK1dMQU5UTF9DaGFuZ2VTVEFTdGF0ZSAKKyggCisgIHZfUFZPSURfdCAgICAgICAgICAgICBwdm9zR0N0eCwKKyAgdl9VOF90ICAgICAgICAgICAgICAgIHVjU1RBSWQsCisgIFdMQU5UTF9TVEFTdGF0ZVR5cGUgICB0bFNUQVN0YXRlIAorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5D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KyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlRMX1NUQVB0a0luc3RhbGxlZAorKAorICB2X1BWT0lEX3QgICAgICAgICAgICAgcHZvc0dDdHgsCisgIHZfVThfdCAgICAgICAgICAgICAgICB1Y1NUQUlkCispOworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfR2V0U1RBU3RhdGUKKworICBERVNDUklQVElPTgorCisgICAgUmV0dXJucyBjb25uZWN0aXZpdHkgc3RhdGUgb2YgYSBwYXJ0aWN1bGFyIFNUQS4KKworICBERVBFTkRFTkNJRVMKKworICAgIEEgc3RhdGlvbiBtdXN0IGhhdmUgYmVlbiByZWdpc3RlcmVkIGJlZm9yZSBpdHMgc3RhdGUgY2FuIGJlIHJldHJpZXZlZC4KKworCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICAgIHVjU1RBSWQ6ICAgICAgICBpZGVudGlmaWVyIG9mIHRoZSBzdGF0aW9uCisKKyAgICBPVVQKKyAgICBwdGxTVEFTdGF0ZTogICAgdGhlIGN1cnJlbnQgc3RhdGUgb2YgdGhlIGNvbm5lY3Rpb24gdG8gdGhlIGdpdmVuIHN0YXRpb24KKworCisgIFJFVFVSTiBWQUxVRQorCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICAgIFZPU19TVEFUVVNfRV9JTlZBTDogIElucHV0IHBhcmFtZXRlcnMgYXJlIGludmFsaWQKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6ICBTdGF0aW9uIElEIGlzIG91dHNpZGUgYXJyYXkgYm91bmRhcmllcyBvciBwb2ludGVyIHRvCisgICAgICAgICAgICAgICAgICAgICAgICAgVEwgY2IgaXMgTlVMTCA7IGFjY2VzcyB3b3VsZCBjYXVzZSBhIHBhZ2UgZmF1bHQKKyAgICBWT1NfU1RBVFVTX0VfRVhJU1RTOiBTdGF0aW9uIHdhcyBub3QgcmVnaXN0ZXJlZAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5UTF9HZXRTVEFTdGF0ZQorKAorICB2X1BWT0lEX3QgICAgICAgICAgICAgcHZvc0dDdHgsCisgIHZfVThfdCAgICAgICAgICAgICAgICB1Y1NUQUlkLAorICBXTEFOVExfU1RBU3RhdGVUeXBlICAgKnB0bFNUQVN0YXRlCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5UTF9TVEFQa3RQZW5kaW5nCisKKyAgREVTQ1JJUFRJT04gCisKKyAgICBIREQgd2lsbCBjYWxsIHRoaXMgQVBJIHdoZW4gYSBwYWNrZXQgaXMgcGVuZGluZyB0cmFuc21pc3Npb24gaW4gaXRzIAorICAgIHF1ZXVlcy4gCisKKyAgREVQRU5ERU5DSUVTIAorCisgICAgQSBzdGF0aW9uIG11c3QgaGF2ZSBiZWVuIHJlZ2lzdGVyZWQg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VUxUOiAgU3RhdGlvbiBJRCBpcyBvdXRzaWRlIGFycmF5IGJvdW5kYXJpZXMgb3IgcG9pbnRlciAKKyAgICAgICAgICAgICAgICAgICAgICAgICB0byBUTCBjYiBpcyBOVUxMIDsgYWNjZXNzIHdvdWxkIGNhdXNlIGEgcGFnZSBmYXVsdCAgCisgICAgVk9TX1NUQVRVU19FX0VYSVNUUzogU3RhdGlvbiB3YXMgbm90IHJlZ2lzdGVyZWQgCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgRXZlcnl0aGluZyBpcyBnb29kIDopIAorCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5UTF9TVEFQa3RQZW5kaW5nIAorKCAKKyAgdl9QVk9JRF90ICAgICAgICAgICAgcHZvc0dDdHgsCisgIHZfVThfdCAgICAgICAgICAgICAgIHVjU1RBSWQsCisgIFdMQU5UTF9BQ0VudW1UeXBlICAgIHVjQWMKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfU2V0U1RBUHJpb3JpdHkKKworICBERVNDUklQVElPTiAKKworICAgIFRMIGV4cG9zZXMgdGhpcyBBUEkgdG8gYWxsb3cgdXBwZXIgbGF5ZXJzIGEgcm91Z2ggY29udHJvbCBvdmVyIHRoZSAKKyAgICBwcmlvcml0eSBvZiB0cmFuc21pc3Npb24gZm9yIGEgZ2l2ZW4gc3RhdGlvbiB3aGVuIHN1cHBvcnRpbmcgbXVsdGlwbGUgCisgICAgY29ubmVjdGlvbnMuCisKKyAgREVQRU5ERU5DSUVTIAorCisgICAgQSBzdGF0aW9uIG11c3QgaGF2ZSBiZWVuIHJlZ2lzdGVyZWQgYmVm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b3V0aW5lIGZvciBub24tZGF0YSAKKyAgICAgICAgICAgICAgICAgICAgQlQtQU1QIHBhY2tldHMKKyAgICBwZm5GbHVzaE9wQ29tcGxldGVDYjogCisgICAgICAgICAgICAgICAgICAgIHBvaW50ZXIgdG8gdGhlIGZ1bmN0aW9uIHRoYXQgd2lsbCBpbmZvcm0gQkFQIHRoYXQgdGhlIAorICAgICAgICAgICAgICAgICAgICBmbHVzaCBvcGVyYXRpb24gaXMgY29tcGxldGUuCisgICAKKyAgUkVUVVJOIFZBTFVFCisgIAorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKyAgICAKKyAgICBWT1NfU1RBVFVTX0VfSU5WQUw6ICBJbnB1dCBwYXJhbWV0ZXJzIGFyZSBpbnZhbGlkIAorICAgIFZPU19TVEFUVVNfRV9GQVVMVDogIFN0YXRpb24gSUQgaXMgb3V0c2lkZSBhcnJheSBib3VuZGFyaWVzIG9yIHBvaW50ZXIgCisgICAgICAgICAgICAgICAgICAgICAgICAgdG8gVEwgY2IgaXMgTlVMTCA7IGFjY2VzcyB3b3VsZCBjYXVzZSBhIHBhZ2UgZmF1bHQgIAorICAgIFZPU19TVEFUVVNfRV9FWElTVFM6IEJBTCBjbGllbnQgd2FzIGFscmVhZHkgcmVnaXN0ZXJlZAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KSAKKworICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTICAKK1dMQU5UTF9SZWdpc3RlckJBUENsaWVudCAKKyggCisgIHZfUFZPSURfdCAgICAgICAgICAgICAgICAgICBwdm9zR0N0eCwKKyAgV0xBTlRMX0JBUFJ4Q0JUeXBlICAgICAgICAgIHBmblRsQkFQUngsCisgIFdMQU5UTF9GbHVzaE9wQ29tcENCVHlwZSAgICBwZm5GbHVzaE9wQ29tcGxldGVDYgorKTsKKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX1R4QkFQRnJtCisKKyAgREVTQ1JJUFRJT04gCisgICAgQkFQIGNhbGxzIHRoaXMgd2hlbiBpdCB3YW50cyB0byBzZW5kIGEgZnJhbWUgdG8gdGhlIG1vZHVsZQorCisgIERFUEVOREVOQ0lFUyAKKyAgICBCQVAgbXVzdCBiZSByZWdpc3RlcmVkIHdpdGggVEwgYmVmb3JlIHRoaXMgZnVuY3Rpb24gY2FuIGJlIGNhbGxlZC4gCisKKyAgICBSRVNUUklDVElPTjogQkFQIENBTk5PVCBwdXNoIGFueSBwYWNrZXRzIHRvIFRMIHVudGlsIGl0IGRpZCBub3QgcmVjZWl2ZSAKKyAgICAgICAgICAgICAgICAgYSB0eCBjb21wbGV0ZSBmcm9tIHRoZSBwcmV2aW91cyBwYWNrZXQsIHRoYXQgbWVhbnMgQkFQCisgICAgICAgICAgICAgICAgIHNlbmRzIG9uZSBwYWNrZXQsIHdhaXQgZm9yIHR4IGNvbXBsZXRlIGFuZCB0aGVuIAorICAgICAgICAgICAgICAgICBzZW5kcyBhbm90aGVyIG9uZQorCisgICAgICAgICAgICAgICAgIElmIEJBUCBzZW5kcyBhbm90aGVyIHBhY2tldCBiZWZvcmUgVEwgbWFuYWdlcyB0byBwcm9jZXNzIHRoZQorICAgICAgICAgICAgICAgICBwcmV2aW91c2x5IHNlbnQgcGFja2V0IGNhbGwgd2lsbCBlbmQgaW4gZmFpbHVyZSAgIAorCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgIHB2b3NHQ3R4OiAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaG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m5lZCBmcm9tIHRoZSBCRCBoZWFkZXIgaGFuZGxpbmcgCisgICAgcm91dGluZXMsIHBsZWFzZSBjaGVjayBhcHJvcHJpYXRlIEFQSSBmb3IgbW9yZSBpbmZvLiAKKyAgICAKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyAgCitXTEFOVExfVHhCQVBGcm0gCisoIAorICB2X1BWT0lEX3QgICAgICAgICAgICAgICBwdm9zR0N0eCwKKyAgdm9zX3BrdF90KiAgICAgICAgICAgICAgdm9zRGF0YUJ1ZmYsICAKKyAgV0xBTlRMX01ldGFJbmZvVHlwZSogICAgcE1ldGFJbmZvLCAgIAorICBXTEFOVExfVHhDb21wQ0JUeXBlICAgICBwZm5UbEJBUFR4Q29tcAorKTsKKworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICBJTlRFUkFDVElPTiBXSVRIIFNNRQorIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfR2V0UnNzaQorCisgIERFU0NSSVBUSU9OIAorICAgIFRMIHdpbGwgZXh0cmFjdCB0aGUgUlNTSSBpbmZvcm1hdGlvbiBmcm9tIGV2ZXJ5IGRhdGEgcGFja2V0IGZyb20gdGhlIAorICAgIG9uZ29pbmcgdHJhZmZpYyBhbmQgd2lsbCBzdG9yZSBpdC4gSXQgd2lsbCBw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ZXNzIHdvdWxkIGNhdXNlIGEgcGFnZSBmYXVsdCAgCisgICAgVk9TX1NUQVRVU19FX0VYSVNUUzogU1RBIHdhcyBub3QgeWV0IHJlZ2lzdGVyZWQKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikgCisgICAgCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgIAorV0xBTlRMX0dldFJzc2kgCisoIAorICB2X1BWT0lEX3QgICAgICAgICAgICAgcHZvc0dDdHgsCisgIHZfVThfdCAgICAgICAgICAgICAgICB1Y1NUQUlkLAorICB2X1M3X3QqICAgICAgICAgICAgICAgcHVSc3NpCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX0dldFNucgorCisgIERFU0NSSVBUSU9OCisgICAgVEwgd2lsbCBleHRyYWN0IHRoZSBTTlIgaW5mb3JtYXRpb24gZnJvbSBldmVyeSBkYXRhIHBhY2tldCBmcm9tIHRoZQorICAgIG9uZ29pbmcgdHJhZmZpYyBhbmQgd2lsbCBzdG9yZSBpdC4gSXQgd2lsbCBwcm92aWRlIHRoZSByZXN1bHQgdG8gU01FCisgICAgdXBvbiByZXF1ZXN0LgorCisgIERFUEVOREVOQ0lFUworCisgICAgV0FSTklORzogdGhlIHJlYWQgYW5kIHdyaXRlIG9mIHRoaXMgdmFsdWUgd2lsbCBub3QgYmUgcHJvdGVjdGVkCisgICAgICAgICAgICAgYnkgbG9ja3MsIHRoZXJlZm9yZSB0aGUgaW5mb3JtYXRpb24gb2J0YWluZWQgYWZ0ZXIgYSByZWFkCisgICAgICAgICAgICAgbWlnaHQgbm90IGFsd2F5cyBiZSBjb25zaXN0ZW50LgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgICBvciBTTUUncyBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICAgIHVjU1RBSWQ6ICAgICAgICBzdGF0aW9uIGlkZW50aWZpZXIgZm9yIHRoZSByZXF1ZXN0ZWQgdmFsdWUKKworICAgIE9VVAorICAgIHB1U25yOiAgICAgICAgIHRoZSBhdmVyYWdlIHZhbHVlIG9mIHRoZSBTTlIKKworCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uCisKKyAgICBWT1NfU1RBVFVTX0VfSU5WQUw6ICBJbnB1dCBwYXJhbWV0ZXJzIGFyZSBpbnZhbGlkCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgU3RhdGlvbiBJRCBpcyBvdXRzaWRlIGFycmF5IGJvdW5kYXJpZXMgb3IgcG9pbnRlcgorICAgICAgICAgICAgICAgICAgICAgICAgIHRvIFRMIGNiIGlzIE5VTEwgOyBhY2Nlc3Mgd291bGQgY2F1c2UgYSBwYWdlIGZhdWx0CisgICAgVk9TX1NUQVRVU19FX0VYSVNUUzogU1RBIHdhcyBub3QgeWV0IHJlZ2lzdGVyZWQKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfR2V0U25yCisoCisgIHRBTklfVTggICAgICAgICAgIHVjU1RBSWQsCisgIHRBTklfUzgqICAgICAgICAgIHBTbnIKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfR2V0TGlua1F1YWxpdHkKKworICBERVNDUklQVElPTiAKKyAgICBUTCB3aWxsIGV4dHJhY3QgdGhlIExpbmtRdWFsaXR5IGluZm9ybWF0aW9uIGZyb20gZXZlcnkgZGF0YSBwYWNrZXQgZnJvbSB0aGUgCisgICAgb25nb2luZyB0cmFmZmljIGFuZCB3aWxsIHN0b3JlIGl0LiBJdCB3aWxsIHByb3ZpZGUgdGhlIHJlc3VsdCB0byBTTUUgCisgICAgdXBvbiByZXF1ZXN0LgorCisgIERFUEVOREVOQ0lFUyAKKworICAgIFdBUk5JTkc6IHRoZSByZWFkIGFuZCB3cml0ZSBvZiB0aGlzIHZhbHVlIHdpbGwgbm90IGJlIHByb3RlY3RlZCAKKyAgICAgICAgICAgICBieSBsb2NrcywgdGhlcmVmb3JlIHRoZSBpbmZvcm1hdGlvbiBvYnRhaW5lZCBhZnRlciBhIHJlYWQgCisgICAgICAgICAgICAgbWlnaHQgbm90IGFsd2F5cyBiZSBjb25zaXN0ZW50LiAgCisgICAgCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgIHB2b3NHQ3R4OiAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFuZGxlIHRvIFRMJ3MgCisgICAgICAgICAgICAgICAgICAgIG9yIFNNRSdzIGNvbnRyb2wgYmxvY2sgY2FuIGJlIGV4dHJhY3RlZCBmcm9tIGl0cyBjb250ZXh0IAorICAgIHVjU1RBSWQ6ICAgICAgICBzdGF0aW9uIGlkZW50aWZpZXIgZm9yIHRoZSByZXF1ZXN0ZWQgdmFsdWUKKworICAgIE9VVAorICAgIHB1TGlua1F1YWxpdHk6ICAgICAgICAgdGhlIGF2ZXJhZ2UgdmFsdWUgb2YgdGhlIExpbmtRdWFsaXR5CisKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbiAgCisKKyAgICBWT1NfU1RBVFVTX0VfSU5WQUw6ICBJbnB1dCBwYXJhbWV0ZXJzIGFyZSBpbnZhbGlkIAorICAgIFZPU19TVEFUVVNfRV9GQVVMVDogIFN0YXRpb24gSUQgaXMgb3V0c2lkZSBhcnJheSBib3VuZGFyaWVzIG9yIHBvaW50ZXIgCisgICAgICAgICAgICAgICAgICAgICAgICAgdG8gVEwgY2IgaXMgTlVMTCA7IGFjY2VzcyB3b3VsZCBjYXVzZSBhIHBhZ2UgZmF1bHQgIAorICAgIFZPU19TVEFUVVNfRV9FWElTVFM6IFNUQSB3YXMgbm90IHlldCByZWdpc3RlcmVkCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgRXZlcnl0aGluZyBpcyBnb29kIDopIAorICAgIAorICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTICAKK1dMQU5UTF9HZXRMaW5rUXVhbGl0eSAKKyggCisgIHZfUFZPSURfdCAgICAgICAgICAgICBwdm9zR0N0eCwKKyAgdl9VOF90ICAgICAgICAgICAgICAgIHVjU1RBSWQsCisgIHZfVTMyX3QqICAgICAgICAgICAgICBwdUxpbmtRdWFsaXR5CispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX0ZsdXNoU3RhVElECisKKyAgREVTQ1JJUFRJT04gCisgICAgVEwgc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mb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICAgIFZPU19TVEFUVVNfRV9JTlZBTDogIElucHV0IHBhcmFtZXRlcnMgYXJlIGludmFsaWQKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6ICBwb2ludGVyIHRvIFRMIGNiIGlzIE5VTEwgOyBhY2Nlc3Mgd291bGQgY2F1c2UgYQorICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2UgZmF1bHQKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfdXBkYXRlU3Bvb2ZNYWNBZGRyCisoCisgIHZfUFZPSURfdCAgICAgICAgICAgICAgIHB2b3NHQ3R4LAorICB2X01BQ0FERFJfdCogICAgICAgICAgICBzcG9vZk1hY0FkZHIsCisgIHZfTUFDQUREUl90KiAgICAgICAgICAgIHNlbGZNYWNBZGRyCispOworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5UTF9SZWdpc3Rlck1nbXRGcm1DbGllbnQKKworICBERVNDUklQVElPTiAKKyAgICBDYWxsZWQgYnkgUEUgdG8gcmVnaXN0ZXIgYXMgYSBjbGllbnQgZm9yIG1hbmFnZW1lbnQgZnJhbWVzIGRlbGl2ZXJ5LiAKKworICBERVBFTkRFTkNJRVMgCisgICAgVEwgbXVzdCBiZSBpbml0aWFsaXplZCBiZWZvcmUgdGhpcyBBUEkgY2FuIGJlIGNhbGxlZC4gCisgICAgCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgIHB2b3NHQ3R4OiAgICAgICAgICAgcG9pbnRlciB0byB0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ispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX0RlUmVnaXN0ZXJNZ210RnJtQ2xpZW50CisKKyAgREVTQ1JJUFRJT04KKyAgICBDYWxsZWQgYnkgUEUgdG8gZGVyZWdpc3RlciBhcyBhIGNsaWVudCBmb3IgbWFuYWdlbWVudCBmcmFtZXMgZGVsaXZlcnkuCisKKyAgREVQRU5ERU5DSUVTCisgICAgVEwgbXVzdCBiZSBpbml0aWFsaXplZCBiZWZvcmUgdGhpcyBBUEkgY2FuIGJlIGNhbGxlZC4KKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHB2b3NHQ3R4OiAgICAgICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZSB0bworICAgICAgICAgICAgICAgICAgICAgICAgVEwncyBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgcG9pbnRlciB0byBUTCBjYiBpcyBOVUxMIDsgYWNjZXNzIHdvdWxkIGNhdXNlIGEKKyAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlIGZhdWx0CisgICAgVk9TX1NUQVRVU19FX0VYSVNUUzogTWdtdCBGcmFtZSBjbGllbnQgd2FzIG5ldmVyIHJlZ2lzdGVyZWQKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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X1NUQVRVU19FX0JVU1k6ICAgVGhlIHByZXZpb3VzIE1nbXQgcGFja2V0IHdhcyBub3QgeWV0IHRyYW5zbWl0dGVkCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgRXZlcnl0aGluZyBpcyBnb29kIDopIAorCisgICAgT3RoZXIgZmFpbHVyZSBtZXNzYWdlcyBtYXkgYmUgcmV0dXJuZWQgZnJvbSB0aGUgQkQgaGVhZGVyIGhhbmRsaW5nIAorICAgIHJvdXRpbmVzLCBwbGVhc2UgY2hlY2sgYXByb3ByaWF0ZSBBUEkgZm9yIG1vcmUgaW5mby4gCisgICAgCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgCitXTEFOVExfVHhNZ210RnJtCisoIAorICB2X1BWT0lEX3QgICAgICAgICAgICBwdm9zR0N0eCwgIAorICB2b3NfcGt0X3QqICAgICAgICAgICB2b3NGcm1CdWYsCisgIHZfVTE2X3QgICAgICAgICAgICAgIHVzRnJtTGVuLAorICB2X1U4X3QgICAgICAgICAgICAgICB1Y0ZybVR5cGUsIAorICB2X1U4X3QgICAgICAgICAgICAgICB0aWQsCisgIFdMQU5UTF9UeENvbXBDQlR5cGUgIHBmbkNvbXBUeEZ1bmMsCisgIHZfUFZPSURfdCAgICAgICAgICAgIHZvb3NCREhlYWRlciwKKyAgdl9VMzJfdCAgICAgICAgICAgICAgdWNBY2tSZXNwb25zZSwKKyAgdl9VMzJfdCAgICAgICAgICAgICAgdWNUeEJkVG9rZW4KKyk7CisKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgSU5URVJBQ1RJT04gV0lUSCBIQUwKKyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX1Jlc2V0Tm90aWZpY2F0aW9uCisKKyAgREVTQ1JJUFRJT04gCisgICAgSEFMIG5vdGlmaWVzIFRMIHdoZW4gdGhlIG1vZHVsZSBpcyBiZWluZyByZXNldC4KKyAgICBDdXJyZW50bHkgbm90IHVzZWQuCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncyAKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQgCisKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbiAgCisKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6ICBwb2ludGVyIHRvIFRMIGNiIGlzIE5VTEwgOyBhY2Nlc3Mgd291bGQgY2F1c2UgYSAKKyAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlIGZhdWx0ICAKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikgCisgICAgCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5UTF9SZXNldE5vdGlmaWNhdGlvbgorKCAKKyAgdl9QVk9JRF90ICAgcHZvc0dDdHggCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX1N1c3BlbmREYXRhVHgKKworICBERVNDUklQVElPTiAKKyAgICBIQUwgY2FsbHMgdGhpcyBBUEkgd2hlbiBpdCB3aXNoZXMgdG8gc3VzcGVuZCB0cmFuc21pc3Npb24gZm9yIGEgCisgICAgcGFydGljdWxhciBTVEEuCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICBUaGUgU1RBIGZvciB3aGljaCB0aGUgcmVxdWVzdCBpcyBtYWRlIG11c3QgYmUgZmlyc3QgcmVnaXN0ZXJlZCB3aXRoIAorICAgIFRMIGJ5IEhERC4gCisKKyAgICBSRVNUUklDVElPTjogIEluIGNhc2Ugb2YgYSBzdXNwZW5kLCB0aGUgZmxhZyB3cml0ZSBhbmQgcmVhZCB3aWxsIG5vdCBiZSAKKyAgICAgICAgICAgICAgICAgIGxvY2tlZDogd29yc3QgY2FzZSBzY2VuYXJpbyBvbmUgbW9yZSBwYWNrZXQgY2FuIGdldCAKKyAgICAgICAgICAgICAgICAgIHRocm91Z2ggYmVmb3JlIHRoZSBmbGFnIGdldHMgdXBkYXRlZCAod2UgY2FuIG1ha2UgdGhpcyAKKyAgICAgICAgICAgICAgICAgIHdyaXRlIGF0b21pYyBhcyB3ZWxsIHRvIGd1YXJhbnRlZSBjb25zaXN0ZW5jeSkKKworICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICBwdm9zR0N0eDogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZSB0byBUTCdzIAorICAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dCAKKyAgICBwdWNTVEFJZDogICAgICAgaWRlbnRpZmllciBvZiB0aGUgc3RhdGlvbiBmb3Igd2hpY2ggdGhlIHJlcXVlc3QgaXMgbWFkZTsgCisgICAgICAgICAgICAgICAgICAgIGEgdmFsdWUgb2YgTlVMTCBhc3N1bWVzIHN1c3BlbmQgb24gYWxsIGFjdGl2ZSBzdGF0aW9uCisgICAgcGZuU3VzcGVuZFR4Q0I6IHBvaW50ZXIgdG8gdGhlIHN1c3BlbmQgcmVzdWx0IG5vdGlmaWNhdGlvbiBpbiBjYXNlIHRoZSAKKyAgICAgICAgICAgICAgICAgICAgY2FsbCBpcyBhc3luY2hyb25vdXMKKworICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfRV9GQVVMVDogICBTdGF0aW9uIElEIGlzIG91dHNpZGUgYXJyYXkgYm91bmRhcmllcyBvciBwb2ludGVyIAorICAgICAgICAgICAgICAgICAgICAgICAgICB0byBUTCBjYiBpcyBOVUxMIDsgYWNjZXNzIHdvdWxkIGNhdXNlIGEgcGFnZSBmYXVsdCAgCisgICAgVk9TX1NUQVRVU19FX0VYSVNUUzogIFN0YXRpb24gd2FzIG5vdCByZWdpc3RlcmVkIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKyAgICAKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlRMX1N1c3BlbmREYXRhVHgKKyggCisgIHZfUFZPSURfdCAgICAgICAgICAgICAgIHB2b3NHQ3R4LAorICB2X1U4X3QqICAgICAgICAgICAgICAgICB1Y1NUQUlkLA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5IGJvdW5kYXJpZXMgb3IgcG9pbnRlciAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdG8gVEwgY2IgaXMgTlVMTCA7IGFjY2VzcyB3b3VsZCBjYXVzZSBhIHBhZ2UgZmF1bHQgIAorICAgIFZPU19TVEFUVVNfRV9FWElTVFM6ICBTdGF0aW9uIHdhcyBub3QgcmVnaXN0ZXJlZCAKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICAgRXZlcnl0aGluZyBpcyBnb29kIDopCisgICAgCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5UTF9SZXN1bWVEYXRhVHgKKyggCisgIHZfUFZPSURfdCAgICAgIHB2b3NHQ3R4LAorICB2X1U4X3QqICAgICAgICBwdWNTVEFJZCAKKyk7CisKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgQ0xJRU5UIElOREVQRU5ERU5UIElOVEVSRkFDRQorIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfR2V0VHhQa3RDb3VudAorCisgIERFU0NSSVBUSU9OIAorICAgIFRMIHdpbGwgcHJvdmlkZSB0aGUgbnVtYmVyIG9mIHRyYW5zbWl0dGVkIHBhY2tldHMgY291bnRlZCBwZXIgCisgICAgU1RBIHBlciBUSUQuIAorICAgIAorICBERVBFTkRFTkNJRVMgCisgICAgCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgIHB2b3NHQ3R4OiAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFuZGxlIHRvIFRMJ3MgCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wgYmxvY2sgY2FuIGJlIGV4dHJhY3RlZCBmcm9tIGl0cyBjb250ZXh0IAorICAgIHVjU1RBSWQ6ICAgICAgICBpZGVudGlmaWVyIG9mIHRoZSBzdGF0aW9uIAorICAgIHVjVGlkOiAgICAgICAgICBpZGVudGlmaWVyIG9mIHRoZSB0c3BlYyAKKworICAgIE9VVAorICAgIHB1VHhQa3RDb3VudDogICB0aGUgbnVtYmVyIG9mIHBhY2tldHMgdHggcGFja2V0IGZvciB0aGlzIFNUQSBhbmQgVElECisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorICAgIAorICAgIFZPU19TVEFUVVNfRV9JTlZBTDogICBJbnB1dCBwYXJhbWV0ZXJzIGFyZSBpbnZhbGlkIAorICAgIFZPU19TVEFUVVNfRV9GQVVMVDogICBTdGF0aW9uIElEIGlzIG91dHNpZGUgYXJyYXkgYm91bmRhcmllcyBvciBwb2ludGVyIAorICAgICAgICAgICAgICAgICAgICAgICAgICB0byBUTCBjYiBpcyBOVUxMIDsgYWNjZXNzIHdvdWxkIGNhdXNlIGEgcGFnZSBmYXVsdCAgCisgICAgVk9TX1NUQVRVU19FX0VYSVNUUzogIFN0YXRpb24gd2FzIG5vdCByZWdpc3RlcmVkIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKyAgICAKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlRMX0dldFR4UGt0Q291bnQKKyggCisgIHZfUFZPSURfdCAgICAgIHB2b3NHQ3R4LAorICB2X1U4X3QgICAgICAgICB1Y1NUQUlkLAorICB2X1U4X3QgICAgICAgICB1Y1RpZCwKKyAgdl9VMzJfdCogICAgICAgcHVUeFBrdENvdW50CispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX0dldFJ4UGt0Q291bnQKKworICBERVNDUklQVElPTiAKKyAgICBUTCB3aWxsIHByb3ZpZGUgdGhlIG51bWJlciBvZiByZWNlaXZlZCBwYWNrZXRzIGNvdW50ZWQgcGVyIAorICAgIFNUQSBwZXIgVElELiAKKyAgICAKKyAgREVQRU5ERU5DSUVTIAorICAgIAorICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICBwdm9zR0N0eDogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZSB0byBUTCdzIAorICAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dCAKKyAgICB1Y1NUQUlkOiAgICAgICAgaWRlbnRpZmllciBvZiB0aGUgc3RhdGlvbiAKKyAgICB1Y1RpZDogICAgICAgICAgaWRlbnRpZmllciBvZiB0aGUgdHNwZWMgCisgICAKKyAgIE9VVAorICAgIHB1VHhQa3RDb3VudDogICB0aGUgbnVtYmVyIG9mIHBhY2tldHMgcnggcGFja2V0IGZvciB0aGlzIFNUQSBhbmQgVElECisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19FX0lOVkFMOiAgIElucHV0IHBhcmFtZXRlcnMgYXJlIGludmFsaWQgCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgIFN0YXRpb24gSUQgaXMgb3V0c2lkZSBhcnJheSBib3VuZGFyaWVzIG9yIHBvaW50ZXIgCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRvIFRMIGNiIGlzIE5VTEwgOyBhY2Nlc3Mgd291bGQgY2F1c2UgYSBwYWdlIGZhdWx0ICAKKyAgICBWT1NfU1RBVFVTX0VfRVhJU1RTOiAgU3RhdGlvbiB3YXMgbm90IHJlZ2lzdGVyZWQgCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorICAgIAorICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfR2V0UnhQa3RDb3VudAorKCAKKyAgdl9QVk9JRF90ICAgICAgcHZvc0dDdHgsCisgIHZfVThfdCAgICAgICAgIHVjU1RBSWQsCisgIHZfVThfdCAgICAgICAgIHVjVGlkLAorICB2X1UzMl90KiAgICAgICBwdVJ4UGt0Q291bnQKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfSXNFQVBPTFBlbmRpbmcKKworICBERVNDUklQVElPTgorCisgICAgSEREIGNhbGxzIHRoaXMgZnVuY3Rpb24gd2hlbiBoZGRfdHhfdGltZW91dCBvY2N1cnMuIFRoaXMgY2hlY2tzIHdoZXRoZXIKKyAgICBFQVBPTCBpcyBwZW5kaW5nLgorCisgIERFUEVOREVOQ0lFUworCisgICAgSEREIG11c3QgaGF2ZSByZWdpc3RlcmVkIHdpdGggVEwgYXQgbGVhc3Qgb25lIFNUQSBiZWZvcmUgdGhpcyBmdW5jdGlvbgorICAgIGNhbiBiZSBjYWxsZWQuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICBwdm9zR0N0eDogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0CisKKyAgUkVUVVJOIFZBTFVFCisKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorCisgICAgU3VjY2VzcyA6IEluZGljYXRlcyBFQVBPTCBmcmFtZSBpcyBwZW5kaW5nIGFuZCBzdGEgaXMgaW4gY29ubmVjdGVkIHN0YXRlCisKKyAgICBGYWlsdXJlIDogRUFQT0wgZnJhbWUgaXMgbm90IHBlbmRpbmcKKworICBTSURFIEVGRkVDVFMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlRMX0lzRUFQT0xQZW5kaW5nCisoCisgIHZfUFZPSURfdCAgICAgcHZvc0dDdHgKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICBWT1NTIFNDSEVEVUxFUiBJTlRFUkFDVElPTgorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlRMX01jUHJvY2Vzc01zZworCisgIERFU0NSSVBUSU9OIAorICAgIENhbGxlZCBieSBWT1NTIHdoZW4gYSBtZXNzYWdlIHdhcyBzZXJpYWxpemVkIGZvciBUTCB0aHJvdWdoIHRoZQorICAgIG1haW4gdGhyZWFkL3Rhc2suIAorCisgIERFUEVOREVOQ0lFUyAKKyAgICBUaGUgVEwgbXVzdCBiZSBpbml0aWFsaXplZCBiZWZvcmUgdGhpcyBmdW5jdGlvbiBjYW4gYmUgY2FsbGVkLiAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncyAKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQgCisgICAgbWVzc2FnZTogICAgICAgIHR5cGUgYW5kIGNvbnRlbnQgb2YgdGhlIG1lc3NhZ2UgCisgICAgICAgICAgICAgICAgICAgIAorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfRV9JTlZBTDogICBpbnZhbGlkIGlucHV0IHBhcmFtZXRlcnMKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6ICAgcG9pbnRlciB0byBUTCBjYiBpcyBOVUxMIDsgYWNjZXNzIHdvdWxkIGNhdXNlIGEgCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2UgZmF1bHQgIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKyAgIAorICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfTWNQcm9jZXNzTXNnCisoCisgIHZfUFZPSURfdCAgICAgICAgcHZvc0dDdHgsCisgIHZvc19tc2dfdCogICAgICAgbWVzc2FnZQorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOVExfUnhQcm9jZXNzTXNnCisKKyAgREVTQ1JJUFRJT04KKyAgICBDYWxsZWQgYnkgVk9TUyB3aGVuIGEgbWVzc2FnZSB3YXMgc2VyaWFsaXplZCBmb3IgVEwgdGhyb3VnaCB0aGUKKyAgICByeCB0aHJlYWQvdGFzay4KKworICBERVBFTkRFTkNJRVMKKyAgICBUaGUgVEwgbXVzdCBiZSBpbml0aWFsaXplZCBiZWZvcmUgdGhpcyBmdW5jdGlvbiBjYW4gYmUgY2FsbGVkLgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICAgIG1lc3NhZ2U6ICAgICAgICB0eXBlIGFuZCBjb250ZW50IG9mIHRoZSBtZXNzYWdlCisKKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorCisgICAgVk9TX1NUQVRVU19FX0lOVkFMOiAgIGludmFsaWQgaW5wdXQgcGFyYW1ldGVycworICAgIFZPU19TVEFUVVNfRV9GQVVMVDogICBwb2ludGVyIHRvIFRMIGNiIGlzIE5VTEwgOyBhY2Nlc3Mgd291bGQgY2F1c2UgYQorICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlIGZhdWx0CisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisgIE90aGVyIHZhbHVlcyBjYW4gYmUgcmV0dXJuZWQgYXMgYSByZXN1bHQgb2YgYSBmdW5jdGlvbiBjYWxsLCBwbGVhc2UgY2hlY2sKKyAgY29ycmVzcG9uZGluZyBBUEkgZm9yIG1vcmUgaW5mby4KKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlRMX1J4UHJvY2Vzc01zZworKAorICB2X1BWT0lEX3QgICAgICAgIHB2b3NHQ3R4LAorICB2b3NfbXNnX3QqICAgICAgIG1lc3NhZ2UKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlRMX01jRnJlZU1zZworCisgIERFU0NSSVBUSU9OIAorICAgIENhbGxlZCBieSBWT1NTIHRvIGZyZWUgYSBnaXZlbiBUTCBtZXNzYWdlIG9uIHRoZSBNYWluIHRocmVhZCB3aGVuIHRoZXJlIAorICAgIGFyZSBtZXNzYWdlcyBwZW5kaW5nIGluIHRoZSBxdWV1ZSB3aGVuIHRoZSB3aG9sZSBzeXN0ZW0gaXMgYmVlbiByZXNldC4gCisgICAgRm9yIG5vdywgVEwgZG9lcyBub3QgYWxsb2NhdGUgYW55IGJvZHkgc28gdGhpcyBmdW5jdGlvbiBzaG91dCB0cmFuc2xhdGUgCisgICAgaW50byBhIE5PT1AKKworICBERVBFTkRFTkNJRVMgCisgICAgVGhlIFRMIG11c3QgYmUgaW5pdGlhbGl6ZWQgYmVmb3JlIHRoaXMgZnVuY3Rpb24gY2FuIGJlIGNhbGxlZC4gCisgICAgCisgIFBBUkFNRVRFUlMgCisKKyAgICBJTgorICAgIHB2b3NHQ3R4OiAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFuZGxlIHRvIFRMJ3MgCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wgYmxvY2sgY2FuIGJlIGV4dHJhY3RlZCBmcm9tIGl0cyBjb250ZXh0IAorICAgIG1lc3NhZ2U6ICAgICAgICB0eXBlIGFuZCBjb250ZW50IG9mIHRoZSBtZXNzYWdlIAorICAgICAgICAgICAgICAgICAgICAKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbiAgCisKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICAgRXZlcnl0aGluZyBpcyBnb29kIDopCisKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlRMX01jRnJlZU1zZworKAorICB2X1BWT0lEX3QgICAgICAgIHB2b3NHQ3R4LAorICB2b3NfbXNnX3QqICAgICAgIG1lc3NhZ2UKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlRMX1R4UHJvY2Vzc01zZworCisgIERFU0NSSVBUSU9OIAorICAgIENhbGxlZCBieSBWT1NTIHdoZW4gYSBtZXNzYWdlIHdhcyBzZXJpYWxpemVkIGZvciBUTCB0aHJvdWdoIHRoZQorICAgIHR4IHRocmVhZC90YXNrLiAKKworICBERVBFTkRFTkNJRVMgCisgICAgVGhlIFRMIG11c3QgYmUgaW5pdGlhbGl6ZWQgYmVmb3JlIHRoaXMgZnVuY3Rpb24gY2FuIGJlIGNhbGxlZC4gCisgICAg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0eCwKKyAgdm9zX21zZ190KiAgICAgICBtZXNzYWdlCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5UTF9NY0ZyZWVNc2cKKworICBERVNDUklQVElPTiAKKyAgICBDYWxsZWQgYnkgVk9TUyB0byBmcmVlIGEgZ2l2ZW4gVEwgbWVzc2FnZSBvbiB0aGUgTWFpbiB0aHJlYWQgd2hlbiB0aGVyZSAKKyAgICBhcmUgbWVzc2FnZXMgcGVuZGluZyBpbiB0aGUgcXVldWUgd2hlbiB0aGUgd2hvbGUgc3lzdGVtIGlzIGJlZW4gcmVzZXQuIAorICAgIEZvciBub3csIFRMIGRvZXMgbm90IGFsbG9jYXRlIGFueSBib2R5IHNvIHRoaXMgZnVuY3Rpb24gc2hvdXQgdHJhbnNsYXRlIAorICAgIGludG8gYSBOT09QCisKKyAgREVQRU5ERU5DSUVTIAorICAgIFRoZSBUTCBtdXN0IGJlIGluaXRpYWxpemVkIGJlZm9yZSB0aGlzIGZ1bmN0aW9uIGNhbiBiZSBjYWxsZWQuIAorICAgIAorICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICBwdm9zR0N0eDogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZSB0byBUTCdzIAorICAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dCAKKyAgICBtZXNzYWdlOiAgICAgICAgdHlwZSBhbmQgY29udGVudCBvZiB0aGUgbWVzc2FnZSAKKyAgICAgICAgICAgICAgICAgICAgCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5UTF9UeEZyZWVNc2cKKygKKyAgdl9QVk9JRF90ICAgICAgICBwdm9zR0N0eCwKKyAgdm9zX21zZ190KiAgICAgICBtZXNzYWdlCispOworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlRMX0VuYWJsZVVBUFNERm9yQUMKKworICBERVNDUklQVElPTiAKKyAgIENhbGxlZCBieSBIREQgdG8gZW5hYmxlIFVBUFNEIGluIFRMLiBUTCBpcyBpbiBjaGFyZ2UgZm9yIHNlbmRpbmcgdHJpZ2dlciAKKyAgIGZyYW1lcy4gCisKKyAgREVQRU5ERU5DSUVTIAorICAgIFRoZSBUTCBtdXN0IGJlIGluaXRpYWxpemVkIGJlZm9yZSB0aGlzIGZ1bmN0aW9uIGNhbiBiZSBjYWxsZWQuIAorICAgIAorICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICBwdm9zR0N0eDogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZSB0byBUTCdzIAorICAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dCAKKyAgICB1Y1NUQUlkOiAgICAgICAgc3RhdGlvbiBJZCAKKyAgICB1Y0FDSWQ6ICAgICAgICAgQUMgZm9yIHdoaWNoIFUtQVBTRCBpcyBiZWluZyBlbmFibGVkICAKKyAgICB1Y1RpZCAgICAgICAgICAgVFNwZWMgSWQgICAgIAorICAgIHVTZXJ2aWNlSW50OiAgICBzZXJ2aWNlIGludGVydmFsIHVzZWQgYnkgVEwgdG8gc2VuZCB0cmlnZ2VyIGZyYW1lcworICAgIHVTdXNwZW5kSW50OiAgICBzdXNwZW5kIGludGVydmFsIHVzZWQgYnkgVEwgdG8gZGV0ZXJtaW5lIHRoYXQgYW4gCisgICAgICAgICAgICAgICAgICAgIGFwcCBpcyBpZGxlIGFuZCBzaG91bGQgc3RhcnQgc2VuZGluZyB0cmlnZyBmcm1zIGxlc3Mgb2Z0ZW4KKyAgICB3VFNEaXI6ICAgICAgICAgZGlyZWN0aW9uIG9mIFRTcGVjIAorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfRW5hYmxlVUFQU0RGb3JBQworKAorICB2X1BWT0lEX3QgICAgICAgICAgcHZvc0dDdHgsCisgIHZfVThfdCAgICAgICAgICAgICB1Y1NUQUlkLAorICBXTEFOVExfQUNFbnVtVHlwZSAgdWNBQ0lkLAorICB2X1U4X3QgICAgICAgICAgICAgdWNUaWQsCisgIHZfVThfdCAgICAgICAgICAgICB1Y1VQLAorICB2X1UzMl90ICAgICAgICAgICAgdVNlcnZpY2VJbnQsCisgIHZfVTMyX3QgICAgICAgICAgICB1U3VzcGVuZEludCwKKyAgV0xBTlRMX1RTRGlyVHlwZSAgIHdUU0RpcgorKTsKKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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F90ICAgICAgICAgICAgIHVjU1RBSWQsCisgIFdMQU5UTF9BQ0VudW1UeXBlICB1Y0FDSWQKKyk7CisKKyNpZiBkZWZpbmVkIFdMQU5fRkVBVFVSRV9ORUlHSEJPUl9ST0FNSU5HCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgICBXTEFOVExfUmVnUlNTSUluZGljYXRpb25DQgorCisgIERFU0NSSVBUSU9OICBSZWdpc3RyYXRpb24gZnVuY3Rpb24gdG8gZ2V0IG5vdGlmaWNhdGlvbiBpZiBSU1NJIGNyb3NzCisgICAgICAgICAgICAgICB0aHJlc2hvbGQuCisgICAgICAgICAgICAgICBDbGllbnQgc2hvdWxkIHJlZ2lzdGVyIHRocmVzaG9sZCwgZGlyZWN0aW9uLCBhbmQgbm90aWZpY2F0aW9uCisgICAgICAgICAgICAgICBjYWxsYmFjayBmdW5jdGlvbiBwb2ludGVyCisKKyAgREVQRU5ERU5DSUVTIE5PTkUKKyAgICAKKyAgUEFSQU1FVEVSUyAgIGluIHBBZGFwdGVyIC0gR2xvYmFsIGhhbmRsZQorICAgICAgICAgICAgICAgaW4gcnNzaVZhbHVlIC0gUlNTSSB0aHJlc2hvbGQgdmFsdWUKKyAgICAgICAgICAgICAgIGluIHRyaWdnZXJFdmVudCAtIENyb3NzIGRpcmVjdGlvbiBzaG91bGQgYmUgbm90aWZpZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQLCBET1dOLCBhbmQgQ1JPU1MKKyAgICAgICAgICAgICAgIGluIGNyb3NzQ0JGdW5jdGlvbiAtIE5vdGlmaWNhdGlvbiBDQiBGdW5jdGlvbgorICAgICAgICAgICAgICAgaW4gdXNyQ3R4dCAtIHVzZXIgY29udGV4dAorCisgIFJFVFVSTiBWQUxVRSBWT1NfU1RBVFVTCisKKyAgU0lERSBFRkZFQ1RTIE5PTkUKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgV0xBTlRMX1JlZ1JTU0lJbmRpY2F0aW9uQ0IKKygKKyAgIHZfUFZPSURfdCAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXIsCisgICB2X1M3X3QgICAgICAgICAgICAgICAgICAgICAgICAgIHJzc2lWYWx1ZSwKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICAgICAgdHJpZ2dlckV2ZW50LAorICAgV0xBTlRMX1JTU0lDcm9zc1RocmVzaG9sZENCVHlwZSBjcm9zc0NCRnVuY3Rpb24sCisgICBWT1NfTU9EVUxFX0lEICAgICAgICAgICAgICAgICAgIG1vZHVsZUlELAorICAgdl9QVk9JRF90ICAgICAgICAgICAgICAgICAgICAgICB1c3JDdHh0CispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgICBXTEFOVExfRGVyZWdSU1NJSW5kaWNhdGlvbkNCCisKKyAgREVTQ1JJUFRJT04gIFJlbW92ZSBzcGVjaWZpYyB0aHJlc2hvbGQgZnJvbSBsaXN0CisKKyAgREVQRU5ERU5DSUVTIE5PTkUKKyAgICAKKyAgUEFSQU1FVEVSUyAgIGluIHBBZGFwdGVyIC0gR2xvYmFsIGhhbmRsZQorICAgICAgICAgICAgICAgaW4gcnNzaVZhbHVlIC0gUlNTSSB0aHJlc2hvbGQgdmFsdWUKKyAgICAgICAgICAgICAgIGluIHRyaWdnZXJFdmVudCAtIENyb3NzIGRpcmVjdGlvbiBzaG91bGQgYmUgbm90aWZpZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQLCBET1dOLCBhbmQgQ1JPU1MKKyAgIAorICBSRVRVUk4gVkFMVUUgVk9TX1NUQVRVUworCisgIFNJREUgRUZGRUNUUyBOT05FCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9EZXJlZ1JTU0lJbmRpY2F0aW9uQ0IKKygKKyAgIHZfUFZPSURfdCAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXIsCisgICB2X1M3X3QgICAgICAgICAgICAgICAgICAgICAgICAgIHJzc2lWYWx1ZSwKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICAgICAgdHJpZ2dlckV2ZW50LAorICAgV0xBTlRMX1JTU0lDcm9zc1RocmVzaG9sZENCVHlwZSBjcm9zc0NCRnVuY3Rpb24sCisgICBWT1NfTU9EVUxFX0lEICAgICAgICAgICAgICAgICAgIG1vZHVsZUlECispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OCisKKyAgIERFU0NSSVBUSU9OIAorICAgIAorICAgUEFSQU1FVEVSUyAKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfQk1QU1JTU0lSZWdpb25DaGFuZ2VkTm90aWZpY2F0aW9uCisoCisgICB2X1BWT0lEX3QgICAgICAgICAgICAgcEFkYXB0ZXIsCisgICB0cFNpclJTU0lOb3RpZmljYXRpb24gcFJTU0lOb3RpZmljYXRpb24KKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgIFdMQU5UTF9TZXRBbHBoYQorCisgIERFU0NSSVBUSU9OICBBTFBMQSBpcyB3ZWlnaHQgdmFsdWUgdG8gY2FsY3VsYXRlIEFWRyBSU1NJCisgICAgICAgICAgICAgICBhdmdSU1NJID0gKEFMUEhBICogaGlzdG9yeVJTU0kpICsgKCgxMCAtIEFMUEhBKSAqIG5ld1JTU0kpCisgICAgICAgICAgICAgICBhdmdSU1NJIGhhcyAoQUxQSEEgKiAxMCklIG9mIGhpc3RvcnkgUlNTSSB3ZWlnaHQgYW5kCisgICAgICAgICAgICAgICAoMTAgLSBBTFBIQSklIG9mIG5ld1JTU0kgd2VpZ2h0CisgICAgICAgICAgICAgICBUaGlzIHBvcnRpb24gaXMgZHluYW1pY2FsbHkgY29uZmlndXJhYmxlLgorICAgICAgICAgICAgICAgRGVmYXVsdCBpcyA/CisKKyAgREVQRU5ERU5DSUVTIE5PTkUKKyAgICAKKyAgUEFSQU1FVEVSUyAgIGluIHBBZGFwdGVyIC0gR2xvYmFsIGhhbmRsZQorICAgICAgICAgICAgICAgaW4gdmFsdWVBbHBhaCAtIEFMUEhBCisgICAKKyAgUkVUVVJOIFZBTFVFIFZPU19TVEFUVVMKKworICBTSURFIEVGRkVDVFMgTk9ORQorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfU2V0QWxwaGEKKygKKyAgIHZfUFZPSURfdCBwQWRhcHRlciwKKyAgIHZfVThfdCAgICB2YWx1ZUFscGhhCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgICBXTEFOVExfUmVnR2V0VHJhZmZpY1N0YXR1cworCisgIERFU0NSSVBUSU9OICBSZWdpc3RyYXRpb24gZnVuY3Rpb24gZm9yIHRyYWZmaWMgc3RhdHVzIG1vbml0b3JpbmcKKyAgICAgICAgICAgICAgIER1cmluZyBtZWFzdXJlIHBlcmlvZCBjb3VudCBkYXRhIGZyYW1lcy4KKyAgICAgICAgICAgICAgIElmIGZyYW1lIGNvdW50IGlzIGxhcmdlciB0aGVuIElETEUgdGhyZXNob2xkIHNldCBhcyB0cmFmZmljIE9OCisgICAgICAgICAgICAgICBvciBPRkYuCisgICAgICAgICAgICAgICBBbmQgdHJhZmZpYyBzdGF0dXMgaXMgY2hhbmdlZCBzZW5kIHJlcG9ydCB0byBjbGllbnQgd2l0aAorICAgICAgICAgICAgICAgcmVnaXN0ZXJlZCBjYWxsYmFjayBmdW5jdGlvbgorCisgIERFUEVOREVOQ0lFUyBOT05FCisgICAgCisgIFBBUkFNRVRFUlMgICBpbiBwQWRhcHRlciAtIEdsb2JhbCBoYW5kbGUKKyAgICAgICAgICAgICAgIGluIGlkbGVUaHJlc2hvbGQgLSBUcmFmZmljIG9uIG9yIG9mZiB0aHJlc2hvbGQKKyAgICAgICAgICAgICAgIGluIG1lYXN1cmVQZXJpb2QgLSBUcmFmZmljIHN0YXRlIGNoZWNrIHBlcmlvZAorICAgICAgICAgICAgICAgaW4gdHJmZmljU3RhdHVzQ0IgLSB0cmFmZmljIHN0YXR1cyBjaGFuZ2VkIG5vdGlmaWNhdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDQiBmdW5jdGlvbgorICAgICAgICAgICAgICAgaW4gdXNyQ3R4dCAtIHVzZXIgY29udGV4dAorICAgCisgIFJFVFVSTiBWQUxVRSBWT1NfU1RBVFVTCisKKyAgU0lERSBFRkZFQ1RTIE5PTkUKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgV0xBTlRMX1JlZ0dldFRyYWZmaWNTdGF0dXMKKygKKyAgIHZfUFZPSURfdCAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXIsCisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkbGVUaHJlc2hvbGQsCisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lYXN1cmVQZXJpb2QsCisgICBXTEFOVExfVHJhZmZpY1N0YXR1c0NoYW5nZWRDQlR5cGUgIHRyZmZpY1N0YXR1c0NCLAorICAgdl9QVk9JRF90ICAgICAgICAgICAgICAgICAgICAgICAgICB1c3JDdHh0CispOworI2VuZGlmCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgICAgV0xBTlRMX0dldFN0YXRpc3RpY3MKKworICBERVNDUklQVElPTiAgIEdldCB0cmFmZmljIHN0YXRpc3RpY3MgZm9yIGlkZW50aWZpZWQgc3RhdGlvbiAKKworICBERVBFTkRFTkNJRVMgIE5PTkUKKyAgICAKKyAgUEFSQU1FVEVSUyAgICBpbiBwQWRhcHRlciAtIEdsb2JhbCBoYW5kbGUKKyAgICAgICAgICAgICAgICBpbiBzdGF0VHlwZSAtIHNwZWNpZmljIHN0YXRpc3RpY3MgZmllbGQgdG8gcmVzZXQKKyAgICAgICAgICAgICAgICBvdXQgc3RhdEJ1ZmZlciAtIHRyYWZmaWMgc3RhdGlzdGljcyBidWZmZXIKKyAgIAorICBSRVRVUk4gVkFMVUUgIFZPU19TVEFUVVMKKworICBTSURFIEVGRkVDVFMgIE5PTkUKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgV0xBTlRMX0dldFN0YXRpc3RpY3MKKygKKyAgIHZfUFZPSURfdCAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLAorICAgV0xBTlRMX1RSQU5TRkVSX1NUQV9UWVBFICAqc3RhdEJ1ZmZlciwKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgIFNUQWlkCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgICAgV0xBTlRMX1Jlc2V0U3RhdGlzdGljcworCisgIERFU0NSSVBUSU9OICAgUmVzZXQgc3RhdGlzdGljcyBzdHJ1Y3R1cmUgZm9yIGlkZW50aWZpZWQgc3RhdGlvbiBJRAorICAgICAgICAgICAgICAgIFJlc2V0IG1lYW5zIHNldCB2YWx1ZXMgYXMgMAorCisgIERFUEVOREVOQ0lFUyAgTk9ORQorICAgIAorICBQQVJBTUVURVJTICAgIGluIHBBZGFwdGVyIC0gR2xvYmFsIGhhbmRsZQorICAgICAgICAgICAgICAgIGluIHN0YXRUeXBlIC0gc3BlY2lmaWMgc3RhdGlzdGljcyBmaWVsZCB0byByZXNldAorICAgCisgIFJFVFVSTiBWQUxVRSAgVk9TX1NUQVRVUworCisgIFNJREUgRUZGRUNUUyAgTk9ORQorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfUmVzZXRTdGF0aXN0aWNzCisoCisgICB2X1BWT0lEX3QgICAgICAgICAgICAgICAgICBwQWRhcHRlciwKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgIFNUQWlkCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgICAgV0xBTlRMX0dldFNwZWNTdGF0aXN0aWMKKworICBERVNDUklQVElPTiAgIEdldCBzcGVjaWZpYyBmaWVsZCB3aXRoaW4gc3RhdGlzdGljcyBzdHJ1Y3R1cmUgZm9yCisgICAgICAgICAgICAgICAgaWRlbnRpZmllZCBzdGF0aW9uIElEIAorCisgIERFUEVOREVOQ0lFUyAgTk9ORQorCisgIFBBUkFNRVRFUlMgICAgaW4gcEFkYXB0ZXIgLSBHbG9iYWwgaGFuZGxlCisgICAgICAgICAgICAgICAgaW4gc3RhdFR5cGUgLSBzcGVjaWZpYyBzdGF0aXN0aWNzIGZpZWxkIHRvIHJlc2V0CisgICAgICAgICAgICAgICAgaW4gU1RBaWQgICAgLSBTdGF0aW9uIElECisgICAgICAgICAgICAgICAgb3V0IGJ1ZmZlciAgLSBTdGF0aXN0aWMgdmFsdWUKKyAgIAorICBSRVRVUk4gVkFMVUUgIFZPU19TVEFUVVMKKworICBTSURFIEVGRkVDVFMgIE5PTkUKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgV0xBTlRMX0dldFNwZWNTdGF0aXN0aWMKKygKKyAgIHZfUFZPSURfdCAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXIsCisgICBXTEFOVExfVFJBTlNGRVJfU1RBVElDX1RZUEUgIHN0YXRUeXBlLAorICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgICpidWZmZXIsCisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgIFNUQWlkCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgICAgV0xBTlRMX1Jlc2V0U3BlY1N0YXRpc3RpYworCisgIERFU0NSSVBUSU9OICAgUmVzZXQgc3BlY2lmaWMgZmllbGQgd2l0aGluIHN0YXRpc3RpY3Mgc3RydWN0dXJlIGZvcgorICAgICAgICAgICAgICAgIGlkZW50aWZpZWQgc3RhdGlvbiBJRAorICAgICAgICAgICAgICAgIFJlc2V0IG1lYW5zIHNldCBhcyAwCisKKyAgREVQRU5ERU5DSUVTICBOT05FCisgICAgCisgIFBBUkFNRVRFUlMgICAgaW4gcEFkYXB0ZXIgLSBHbG9iYWwgaGFuZGxlCisgICAgICAgICAgICAgICAgaW4gc3RhdFR5cGUgLSBzcGVjaWZpYyBzdGF0aXN0aWNzIGZpZWxkIHRvIHJlc2V0CisgICAgICAgICAgICAgICAgaW4gU1RBaWQgICAgLSBTdGF0aW9uIElECisKKyAgUkVUVVJOIFZBTFVFICBWT1NfU1RBVFVTCisKKyAgU0lERSBFRkZFQ1RTICBOT05FCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9SZXNldFNwZWNTdGF0aXN0aWMKKygKKyAgIHZfUFZPSURfdCAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXIsCisgICBXTEFOVExfVFJBTlNGRVJfU1RBVElDX1RZUEUgIHN0YXRUeXBlLAorICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgICBTVEFpZAorKTsKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICAgIFdMQU5UTF9Jc1JlcGxheVBhY2tldAorICAgCisgIERFU0NSSVBUSU9OICAgVGhpcyBmdW5jdGlvbiBkb2VzIHJlcGxheSBjaGVjayBmb3IgdmFsaWQgc3RhdGlvbnMKKworICBERVBFTkRFTkNJRVMgIFZhbGlkaXR5IG9mIHJlcGxheSBjaGVjayBtdXN0IGJlIGRvbmUgYmVmb3JlIHRoZSBmdW5jdGlvbiAKKyAgICAgICAgICAgICAgICBpcyBjYWxsZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICBQQVJBTUVURVJTICAgIGN1cnJlbnRSZXBsYXlDb3VudGVyICAgIGN1cnJlbnQgcmVwbGF5IGNvdW50ZXIgdGFrZW4gZnJvbSBSWCBCRCAKKyAgICAgICAgICAgICAgICBwcmV2aW91c1JlcGxheUNvdW50ZXIgICBwcmV2aW91cyByZXBsYXkgY291bnRlciB0YWtlbiBmcm9tIFRMIENCCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgUkVUUlVOICAgICAgICBWT1NfVFJVRSAgICBwYWNrZXQgaXMgYSByZXBsYXkgcGFja2V0CisgICAgICAgICAgICAgICAgVk9TX0ZBTFNFICAgcGFja2V0IGlzIG5vdCBhIHJlcGxheSBwYWNrZXQKKworICBTSURFIEVGRkVDVFMgICBub25lCisgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2X0JPT0xfdCBXTEFOVExfSXNSZXBsYXlQYWNrZXQKKygKKyAgICB2X1U2NF90ICAgIGN1cnJlbnRSZXBsYXlDb3VudGVyLAorICAgIHZfVTY0X3QgICAgcHJldmlvdXNSZXBsYXlDb3VudGVyCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgICBXTEFOVExfR2V0UmVwbGF5Q291bnRlckZyb21SeEJECisgICAgIAorICBERVNDUklQVElPTiAgIFRoaXMgZnVuY3Rpb24gZXh0cmFjdHMgNDgtYml0IHJlcGxheSBwYWNrZXQgbnVtYmVyIGZyb20gUlggQkQgCisgCisgIERFUEVOREVOQ0lFUyAgVmFsaWRpdHkgb2YgcmVwbGF5IGNoZWNrIG11c3QgYmUgZG9uZSBiZWZvcmUgdGhlIGZ1bmN0aW9uIAorICAgICAgICAgICAgICAgIGlzIGNhbGxlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgUEFSQU1FVEVSUyAgICBwdWNSeEhlYWRlciBwb2ludGVyIHRvIFJYIEJEIGhlYWRlcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgIFJFVFJVTiAgICAgICAgdl9VNjRfdCAgICBQYWNrZXQgbnVtYmVyIGV4dGFyY3RlZCBmcm9tIFJYIEJECisKKyAgU0lERSBFRkZFQ1RTICAgbm9uZQorID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordl9VNjRfdAorV0xBTlRMX0dldFJlcGxheUNvdW50ZXJGcm9tUnhCRAorKAorICAgdl9VOF90ICpwdWNSeEJESGVhZGVyCispOworCisKKworLyoKKyBERVNDUklQVElPTiAKKyAgICBUTCByZXR1cm5zIHRoZSB3ZWlnaHQgY3VycmVudGx5IG1haW50YWluZWQgaW4gVEwuCisgSU4KKyAgICBwdm9zR0N0eDogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZSB0byBUTCdzIAorICAgICAgICAgICAgICAgICAgICBvciBTTUUncyBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dCAKKworIE9VVAorICAgIHBBQ1dlaWdodHM6ICAgICBDYWxsZXIgYWxsb2NhdGVkIG1lbW9yeSBmb3IgZmlsbGluZyBpbiB3ZWlnaHRzCisKKyBSRVRVUk4gVkFMVUUgIFZPU19TVEFUVVMKKyovCitWT1NfU1RBVFVTICAKK1dMQU5UTF9HZXRBQ1dlaWdodHMgCisoIAorICB2X1BWT0lEX3QgICAgICAgICAgICAgcHZvc0dDdHgsCisgIHZfVThfdCogICAgICAgICAgICAgICBwQUNXZWlnaHRzCispOworCisKKy8qCisgREVTQ1JJUFRJT04gCisgICAgQ2hhbmdlIHRoZSB3ZWlnaHQgY3VycmVudGx5IG1haW50YWluZWQgYnkgVEwuCisgSU4KKyAgICBwdm9zR0N0eDogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZS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yAgU0lERSBFRkZFQ1RTICBOT05FCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfR2V0U29mdEFQU3RhdGlzdGljcyh2X1BWT0lEX3QgcEFkYXB0ZXIsIFdMQU5UTF9UUkFOU0ZFUl9TVEFfVFlQRSAqc3RhdHNTdW0sIHZfQk9PTF90IGJSZXNldCk7CisKKyNpZmRlZiBfX2NwbHVzcGx1cworIH0KKyNlbmRpZiAKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfRW5hYmxlQ2FjaGluZworCisgIERFU0NSSVBUSU9OCisKKyAgICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgdG8gZW5hYmxlIGNhY2hpbmcgb25seSB3aGVuIGFzc29jL3JlYXNzb2MgcmVxIGlzIHNlbmQuCisgICAgdGhhdCBpcyBjYWNoZSBwYWNrZXRzIG9ubHkgZm9yIHN1Y2ggU1RBIElELgorCisKKyAgREVQRU5ERU5DSUVTCisKKyAgICBUTCBtdXN0IGhhdmUgYmVlbiBpbml0aWFsaXplZCBiZWZvcmUgdGhpcyBnZXRzIGNhbGxlZC4KKworCisgIFBBUkFNRVRFUlMKKworICAgc3RhSWQ6ICAgc3RhdGlvbiBpZC4KKworICBSRVRVUk4gVkFMVUUKKworICAgbm9uZQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgV0xBTlRMX0VuYWJsZUNhY2hpbmcodl9VOF90IHN0YUlkKTsKKworIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIFdMQU5UTF9Bc3NvY0ZhaWxlZCh2X1U4X3Qgc3RhSWQpOworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICAgIFdMQU5UTF9Qb3N0UmVzTmVlZGVkCisgICAgIAorICBERVNDUklQVElPTiAgIFRoaXMgZnVuY3Rpb24gcG9zdHMgbWVzc2FnZSB0byBUTCB0byByZXNlcnZlIEJEL1BEVSBtZW1vcnkKKyAKKyAgREVQRU5ERU5DSUVTICBOb25lCisgICAgICAgICAgICAgICAgICAgICAgICAgIAorICBQQVJBTUVURVJTICAgIHB2b3NHQ3R4CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgUkVUVVJOICAgICAgICBOb25lCisKKyAgU0lERSBFRkZFQ1RTICAgbm9uZQorID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCit2b2lkIFdMQU5UTF9Qb3N0UmVzTmVlZGVkKHZfUFZPSURfdCBwdm9zR0N0eCk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX0ZpbmlzaF9VTEEKKworICBERVNDUklQVElPTgorICAgICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgYnkgSEREIHRvIG5vdGlmeSBUTCB0byBmaW5pc2ggVXBwZXIgbGF5ZXIgYXV0aGVudGljYXRpb24KKyAgICAgaW5jYXNlIHRoZSBsYXN0IEVBUE9MIHBhY2tldCBpcyBwZW5kaW5nIGluIHRoZSBUTCBxdWV1ZS4KKyAgICAgVG8gYXZvaWQgdGhlIHJhY2UgY29uZGl0aW9uIGJldHdlZW4gc21lIHNldCBrZXkgYW5kIHRoZSBsYXN0IEVBUE9MIHBhY2tldAorICAgICB0aGUgSEREIG1vZHVsZSBjYWxscyB0aGlzIGZ1bmN0aW9uIGp1c3QgYmVmb3JlIGNhbGxpbmcgdGhlIHNtZV9Sb2FtU2V0S2V5LgorCisgIERFUEVOREVOQ0lFUworCisgICAgVEwgbXVzdCBoYXZlIGJlZW4gaW5pdGlhbGl6ZWQgYmVmb3JlIHRoaXMgZ2V0cyBjYWxsZWQuCisKKworICBQQVJBTUVURVJTCisKKyAgIGNhbGxiYWNrUm91dGluZTogICBIREQgQ2FsbGJhY2sgZnVuY3Rpb24uCisgICBjYWxsYmFja0NvbnRleHQgOiBIREQgdXNlcmRhdGEgY29udGV4dC4KKworICBSRVRVUk4gVkFMVUUKKworICAgVk9TX1NUQVRVU19TVUNDRVNTL1ZPU19TVEFUVVNfRkFJTFVSRQorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworVk9TX1NUQVRVUyBXTEFOVExfRmluaXNoX1VMQSggdm9pZCAoKmNhbGxiYWNrUm91dGluZSkgKHZvaWQgKmNhbGxiYWNrQ29udGV4dCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpjYWxsYmFja0NvbnRleHQpOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgICAgV0xBTlRMX1VwZGF0ZVJzc2lCbXBzCisKKyAgREVTQ1JJUFRJT04gICAgVGhpcyBmdW5jdGlvbiB1cGRhdGVzIHRoZSBUTCdzIFJTU0kgKGluIEJNUFMgbW9kZSkKKworICBERVBFTkRFTkNJRVMgICBOb25lCisKKyAgUEFSQU1FVEVSUworCisgICAgcHZvc0dDdHggICAgICAgICBWT1MgY29udGV4dCAgICAgICAgICBWT1MgR2xvYmFsIGNvbnRleHQKKyAgICBzdGFJZCAgICAgICAgICAgIFN0YXRpb24gSUQgICAgICAgICAgIFN0YXRpb24gSUQKKyAgICByc3NpICAgICAgICAgICAgIFJTU0kgKEJNUFMgbW9kZSkgICAgIFJTU0kgaW4gQk1QUyBtb2RlCisKKyAgUkVUVVJOICAgICAgICAgTm9uZQorCisgIFNJREUgRUZGRUNUUyAgIG5vbmUKKyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKwordm9pZCBXTEFOVExfVXBkYXRlUnNzaUJtcHModl9QVk9JRF90IHB2b3NHQ3R4LCB2X1U4X3Qgc3RhSWQsIHZfUzdfdCByc3NpKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgICAgIFdMQU5UTF9VcGRhdGVTbnJCbXBzCisKKyAgREVTQ1JJUFRJT04gICAgVGhpcyBmdW5jdGlvbiB1cGRhdGVzIHRoZSBUTCdzIFNOUiAoaW4gQk1QUyBtb2RlKQorCisgIERFUEVOREVOQ0lFUyAgIE5vbmUKKworICBQQVJBTUVURVJTCisKKyAgICBwdm9zR0N0eCAgICAgICAgIFZPUyBjb250ZXh0ICAgICAgICAgIFZPUyBHbG9iYWwgY29udGV4dAorICAgIHN0YUlkICAgICAgICAgICAgU3RhdGlvbiBJRCAgICAgICAgICAgU3RhdGlvbiBJRAorICAgIHNuciAgICAgICAgICAgICBTTlIgKEJNUFMgbW9kZSkgICAgIFNOUiBpbiBCTVBTIG1vZGUKKworICBSRVRVUk4gICAgICAgICBOb25lCisKKyAgU0lERSBFRkZFQ1RTICAgbm9uZQorID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCit2b2lkIFdMQU5UTF9VcGRhdGVTbnJCbXBzKHZfUFZPSURfdCBwdm9zR0N0eCwgdl9VOF90IHN0YUlkLCB2X1M3X3Qgc25yKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgIFdMQU5UTF9TZXRUeFhtaXRQZW5kaW5nCisKKyAgREVTQ1JJUFRJT04KKyAgICBDYWxsZWQgYnkgdGhlIFdEQSB3aGVuIGl0IHdhbnRzIHRvIGluZGljYXRlIHRoYXQgV0RBX0RTX1RYX1NUQVJUX1hNSVQgbXNnCisgICAgaXMgcGVuZGluZyBpbiBUTCBtc2cgcXVldWUgCisKKyAgREVQRU5ERU5DSUVTCisgICAgVGhlIFRMIG11c3QgYmUgcmVnaXN0ZXJlZCB3aXRoIFdEQSBiZWZvcmUgdGhpcyBmdW5jdGlvbiBjYW4gYmUgY2FsbGVkLgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgICBvciBXREEncyBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorCisgIFJFVFVSTiBWQUxVRSAgICAgIE5vbmUKKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKK3ZfVk9JRF90CitXTEFOVExfU2V0VHhYbWl0UGVuZGluZworKAorICB2X1BWT0lEX3QgICAgICAgcHZvc0dDdHgKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgIFdMQU5UTF9DbGVhclR4WG1pdFBlbmRpbmcKKworICBERVNDUklQVElPTgorICAgIENhbGxlZCBieSB0aGUgV0RBIHdoZW4gaXQgd2FudHMgdG8gaW5kaWNhdGUgdGhhdCBubyBXREFfRFNfVFhfU1RBUlRfWE1JVCBtc2cKKyAgICBpcyBwZW5kaW5nIGluIFRMIG1zZyBxdWV1ZSAKKworICBERVBFTkRFTkNJRVMKKyAgICBUaGUgVEwgbXVzdCBiZSByZWdpc3RlcmVkIHdpdGggV0RBIGJlZm9yZSB0aGlzIGZ1bmN0aW9uIGNhbiBiZSBjYWxsZWQuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICBwdm9zR0N0eDogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZSB0byBUTCdzCisgICAgICAgICAgICAgICAgICAgIG9yIFdEQSdzIGNvbnRyb2wgYmxvY2sgY2FuIGJlIGV4dHJhY3RlZCBmcm9tIGl0cyBjb250ZXh0CisKKyAgUkVUVVJOIFZBTFVFICAgICAgTm9uZQorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKwordl9WT0lEX3QKK1dMQU5UTF9DbGVhclR4WG1pdFBlbmRpbmcKKygKKyAgdl9QVk9JRF90ICAgICAgIHB2b3NHQ3R4CispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgV0xBTlRMX1VwZGF0ZVNUQUJzc0lkZm9ySUJTUworCisgIERFU0NSSVBUSU9OCisgICAgSEREIHdpbGwgY2F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kIDopCisKKyAgU0lERSBFRkZFQ1RTCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworVk9TX1NUQVRVUworV0xBTlRMX1VwZGF0ZVNUQUJzc0lkZm9ySUJTUworKAorICB2X1BWT0lEX3QgICAgICAgICAgICAgcHZvc0dDdHgsCisgIHZfVThfdCAgICAgICAgICAgICAgICB1Y1NUQUlkLAorICB2X1U4X3QgICAgICAgICAgICAgICAqcEJzc2lkCispOworCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgICAgIFdMQU5UTF9VcGRhdGVMaW5rQ2FwYWNpdHkKKworICBERVNDUklQVElPTiAgICBUaGlzIGZ1bmN0aW9uIHVwZGF0ZXMgdGhlIFNUQSdzIExpbmsgQ2FwYWNpdHkgaW4gVEwKKworICBERVBFTkRFTkNJRVMgICBOb25lCisKKyAgUEFSQU1FVEVSUworCisgICAgcHZvc0dDdHggICAgICAgICBWT1MgY29udGV4dCAgICAgICAgICBWT1MgR2xvYmFsIGNvbnRleHQKKyAgICBzdGFJZCAgICAgICAgICAgIFN0YXRpb24gSUQgICAgICAgICAgIFN0YXRpb24gSUQKKyAgICBsaW5rQ2FwYWNpdHkgICAgIGxpbmtDYXBhY2l0eSAgICAgICAgIExpbmsgQ2FwYWNpdHkKKworICBSRVRVUk4gICAgICAgICBOb25lCisKKyAgU0lERSBFRkZFQ1RTICAgbm9uZQorID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCit2b2lkCitXTEFOVExfVXBkYXRlTGlua0NhcGFjaXR5CisoCisgIHZfUFZPSURfdCBwdm9zR0N0eCwKKyAgdl9VOF90IHN0YUlkLAorICB2X1UzMl90I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ludGVyIHRvCisgICAgICAgICAgICAgICAgICAgICAgICAgVEwgY2IgaXMgTlVMTCA7IGFjY2VzcyB3b3VsZCBjYXVzZSBhIHBhZ2UgZmF1bHQKKyAgICBWT1NfU1RBVFVTX0VfRVhJU1RTOiBTdGF0aW9uIHdhcyBub3QgcmVnaXN0ZXJlZAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworVk9TX1NUQVRVUworV0xBTlRMX0dldFNUQUxpbmtDYXBhY2l0eQorKAorICB2X1BWT0lEX3QgICAgICAgICAgICAgcHZvc0dDdHgsCisgIHZfVThfdCAgICAgICAgICAgICAgICB1Y1NUQUlkLAorICB2X1UzMl90ICAgICAgICAgICAgICAgKnBsaW5rQ2FwYWNpdHkKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgV0xBTlRMX1R4VGhyZWFkRGVidWdIYW5kbGVyCisKKyAgREVTQ1JJUFRJT04KKyAgICBQcmludGluZyBUTCBTbmFwc2hvdCBkdW1wLCBwcm9jZXNzZWQgdW5kZXIgVHhUaHJlYWQgY29udGV4dCwgY3VycmVudGx5CisgICAgaW5mb3JtYXRpb24gcmVnYXJkaW5nIHRoZSBnbG9iYWwgVGxDYiBzdHJ1dHVyZS4gRHVtcHMgaW5mb3JtYXRpb24gcmVsYXRlZAorICAgIHRvIHBlciBhY3RpdmUgU1RBIGNvbm5lY3Rpb24gY3VycmVudGx5IGluIHVzZSBieSBUTC4KKworICBERVBFTkRFTkNJRVMKKyAgICBUaGUgVEwgbXVzdCBiZSBpbml0aWFsaXplZCBiZWZvcmUgdGhpcyBnZXRzIGNhbGxlZC4KKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHB2b3NHQ3R4OiAgICBQb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFuZGxlIHRvIFRMJ3MKKyAgICAgICAgICAgICAgICAgICAgb3IgV0RBJ3MgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQKKworICBSRVRVUk4gVkFMVUUgICBOb25lCisKKyAgU0lERSBFRkZFQ1RTCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKwordl9WT0lEX3QKK1dMQU5UTF9UeFRocmVhZERlYnVnSGFuZGxlcgorKAorICB2X1BWT0lEX3QgICAgICAgKnB2b3NHQ3R4CispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgV0xBTlRMX1RMRGVidWdNZXNzYWdlCisKKyAgREVTQ1JJUFRJT04KKyAgICBQb3N0IGEgVEwgU25hcHNob3QgcmVxdWVzdCwgcG9zdHMgbWVzc2FnZSBpbiBUeFRocmVhZC4KKworICBERVBFTkRFTkNJRVMKKyAgICBUaGUgVEwgbXVzdCBiZSBpbml0aWFsaXplZCBiZWZvcmUgdGhpcyBnZXRzIGNhbGxlZC4KKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIGRpc3BsYXlTbmFwc2hvdCBCb29sZWFuIHNob3dpbmcgd2hldGhlciB0byBkdW1wIHRoZSBzbmFwc2hvdCBvciBub3QuCisKKyAgUkVUVVJOIFZBTFVFICAgICAgTm9uZQorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKwordl9WT0lEX3QKK1dMQU5UTF9UTERlYnVnTWVzc2FnZQorKAorICB2X1UzMl90IGRlYnVnRmxhZ3MKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICBXTEFOVExfRmF0YWxFcnJvcgorCisgIERFU0NSSVBUSU9OCisgICAgRmF0YWwgZXJyb3IgcmVwb3J0ZWQgaW4gVFggcGF0aCwgcG9zdCBhbiBldmVudCB0byBUWCBUaHJlYWQgZm9yIGZ1cnRoZXIKKyAgICBoYW5kbGluZworCisgIERFUEVOREVOQ0lFUworICAgIFRoZSBUTCBtdXN0IGJlIGluaXRpYWxpemVkIGJlZm9yZSB0aGlzIGdldHMgY2FsbGVkLgorCisgIFBBUkFNRVRFUlMKKworICAgIFZPSUQKKworICBSRVRVUk4gVkFMVUUgICAgICBOb25lCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordl9WT0lEX3QKK1dMQU5UTF9GYXRhbEVycm9yCisoCisgdl9WT0lEX3QKKyk7CisKKyNlbmRpZiAvKiAjaWZuZGVmIFdMQU5fUUNUX1dMQU5UTF9IICovCmRpZmYgLS1naXQgYS93bGFuL3ByaW1hL0NPUkUvVEwvaW5jL3dsYW5fcWN0X3RsX3RyYWNlLmggYi93bGFuL3ByaW1hL0NPUkUvVEwvaW5jL3dsYW5fcWN0X3RsX3RyYWNlLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMDY2ZGIyZAotLS0gL2Rldi9udWxsCisrKyBiL3dsYW4vcHJpbWEvQ09SRS9UTC9pbmMvd2xhbl9xY3RfdGxfdHJhY2UuaApAQCAtMCwwICsxLDYzIEBACisvKgorICogQ29weXJpZ2h0IChjKSAyMDE0I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Vyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgICAgICAgICAgICAgICAgICAgICAgIFcgTCBBIE4gXyBRIEMgVCBfIFQgTCAuIEMKKworICBPVkVSVklFVzoKKworICBUaGlzIHNvZnR3YXJlIHVuaXQgaG9sZHMgdGhlIGltcGxlbWVudGF0aW9uIG9mIHRoZSBXTEFOIFRyYW5zcG9ydCBMYXllci4KKworICBUaGUgZnVuY3Rpb25zIGV4dGVybmFsaXplZCBieSB0aGlzIG1vZHVsZSBhcmUgdG8gYmUgY2FsbGVkIE9OTFkgYnkgb3RoZXIKKyAgV0xBTiBtb2R1bGVzIHRoYXQgcHJvcGVybHkgcmVnaXN0ZXIgd2l0aCB0aGUgVHJhbnNwb3J0IExheWVyIGluaXRpYWxseS4KKworICBERVBFTkRFTkNJRVM6CisKKyAgQXJlIGxpc3RlZCBmb3IgZWFjaCBBUEkgYmVsb3cuCisKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgIEVESVQgSElTVE9SWSBGT1IgRklMRQorCisKKyAgVGhpcyBzZWN0aW9uIGNvbnRhaW5zIGNvbW1lbnRzIGRlc2NyaWJpbmcgY2hhbmdlcyBtYWRlIHRvIHRoZSBtb2R1bGUuCisgIE5vdGljZSB0aGF0IGNoYW5nZXMgYXJlIGxpc3Rl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QKKzIwMDgtMDctMjMgICAgbHRpICAgICBGaXggZm9yIHZvcyBwYWNrZXQgZHJhaW5pbmcKKzIwMDgtMDctMTcgICAgbHRpICAgICBGaXggZm9yIGRhdGEgdHlwZSB2YWx1ZQorICAgICAgICAgICAgICAgICAgICAgIEFkZGVkIGZyYW1lIHRyYW5zbGF0aW9uIGNvZGUgaW4gVEwKKyAgICAgICAgICAgICAgICAgICAgICBBdm9pZCByZXR1cm5pbmcgZmFpbHVyZSB0byBQRSBpbiBjYXNlIHByZXZpb3VzIGZyYW1lIGlzCisgICAgICAgICAgICAgICAgICAgICAgc3RpbGwgcGVuZGluZzsgZmFpbCBwcmV2aW91cyBhbmQgY2FjaGUgbmV3IG9uZSBmb3IgdHgKKyAgICAgICAgICAgICAgICAgICAgICBHZXQgZnJhbWVzIHJldHVybmluZyBib29sZWFuIHRydWUgaWYgbW9yZSBmcmFtZXMgYXJlIHBlbmRpbmcKKzIwMDgtMDctMDMgICAgbHRpICAgICBGaXhlcyBmb2xsb3dpbmcgcHJlLWludGVncmF0aW9uIHRlc3RpbmcKKzIwMDgtMDYtMjYgICAgbHRpICAgICBGaXhlcyBmb2xsb3dpbmcgdW5pdCB0ZXN0aW5nCisgICAgICAgICAgICAgICAgICAgICAgQWRkZWQgYWxsb2MgYW5kIGZyZWUgZm9yIFRMIGNvbnRleHQKKyAgICAgICAgICAgICAgICAgICAgICBVc2luZyBhdG9taWMgc2V0IHU4IGluc3RlYWQgb2YgdTMyCisyMDA4LTA1LTE2ICAgIGx0aSAgICAgQ3JlYXRlZCBtb2R1bGUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKiBJbmNsdWRlIEZpbGVzCisg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KworLyogVEwgQkQvUERVIHRocmVzaG9sZCB0byBlbmFibGUgaW50ZXJydXB0ICovCitpbnQgYmRQZHVJbnRlcnJ1cHRFbmFibGVUaHJlc2hvbGQgPSBXTEFOVExfQkRfUERVX0lOVEVSUlVQVF9FTkFCTEVfVEhSRVNIT0xEOworaW50IGJkUGR1SW50ZXJydXB0R2V0VGhyZXNob2xkID0gV0xBTlRMX0JEX1BEVV9JTlRFUlJVUFRfR0VUX1RIUkVTSE9MRDsKKyNlbmRpZiAvKiBWT0xBTlNfUEVSRiAqLworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgorIHwgICBUeXBlKDJiKSAgIHwgICAgIFN1Yi10eXBlKDRiKSAgIHwKKyAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworI2RlZmluZSBXTEFOVExfSVNfREFUQV9GUkFNRShfdHlwZV9zdWIpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICggV0xBTlRMX0RBVEFfRlJBTUVfVFlQRSA9PSAoIChfdHlwZV9zdWIpICYgMHgzMCApKQorCisjZGVmaW5lIFdMQU5UTF9JU19RT1NfREFUQV9GUkFNRShfdHlwZV9zdWIpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAoKCBXTEFOVExfREFUQV9GUkFNRV9UWVBFID09ICggKF90eXBlX3N1YikgJiAweDMwICkpICYmICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgKCBXTEFOVExfODAyMTFfREFUQV9RT1NfU1VCVFlQRSA9PSAoIChfdHlwZV9zdWIpICYgMHhGICkpKSAKKworI2RlZmluZSBXTEFOVExfSVNfTUdNVF9GUkFNRShfdHlwZV9zdWIpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICggV0xBTlRMX01HTVRfRlJBTUVfVFlQRSA9PSAoIChfdHlwZV9zdWIpICYgMHgzMCApKQorCisjZGVmaW5lIFdMQU5UTF9JU19NR01UX0FDVElPTl9GUkFNRShfdHlwZV9zdWIpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgKCggV0xBTlRMX01HTVRfRlJBTUVfVFlQRSA9PSAoIChfdHlwZV9zdWIpICYgMHgzMCApKSAmJiAgICBcCisgICAgICggKCBXTEFOVExfODAyMTFfTUdNVF9BQ1RJT05fU1VCVFlQRSA9PSAoIChfdHlwZV9zdWIpICYgMHhGICkpIHx8IFwKKyAgICAgICAoIFdMQU5UTF84MDIxMV9NR01UX0FDVElPTl9OT19BQ0tfU1VCVFlQRSA9PSAoIChfdHlwZV9zdWIpICYgMHhGICkpKSkKKworI2RlZmluZSBXTEFOVExfSVNfUFJPQkVfUkVRKF90eXBlX3N1YikgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgKCBXTEFOVExfTUdNVF9QUk9CRV9SRVFfRlJBTUVfVFlQRSA9PSAoIChfdHlwZV9zdWIpICYgMHgzRiApKQorCisjZGVmaW5lIFdMQU5UTF9JU19DVFJMX0ZSQU1FKF90eXBlX3N1YikgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgKCBXTEFOVExfQ1RSTF9GUkFNRV9UWVBFID09ICggKF90eXBlX3N1YikgJiAweDMwICkpCisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworI2RlZmluZSBXTEFOVExfSVNfVERMU19GUkFNRShfZXRoX3R5cGUpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICggV0xBTlRMX0xMQ19URExTX1RZUEUgPT0gKCBfZXRoX3R5cGUpKQorI2VuZGlmCisKKy8qTUFYIEFsbG93ZWQgbGVuIHByb2Nlc3NlZCBieSBUT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EgZmllbGQgICovCisgdl9VOF90ICAgdkExW1ZPU19NQUNfQUREUl9TSVpFXTsKKworIC8qIEFkZHJlc3MgMiBmaWVsZCAqLworIHZfVThfdCAgIHZBMltWT1NfTUFDX0FERFJfU0laRV07CisKKyAvKiBBZGRyZXNzIDMgZmllbGQgKi8KKyB2X1U4X3QgICB2QTNbVk9TX01BQ19BRERSX1NJWkVdOworCisgLyogU2VxdWVuY2UgY29udHJvbCBmaWVsZCAqLworIHZfVTE2X3QgIHVzU2VxQ3RybDsKKworIC8vIEZpbmQgdGhlIHNpemUgb2YgdGhlIG1hbmRhdG9yeSBoZWFkZXIgc2l6ZS4KKyNkZWZpbmUgV0xBTjgwMjExX01BTkRBVE9SWV9IRUFERVJfU0laRSBcCisgICAgKHNpemVvZihXTEFOVExfTUFDRkNUeXBlKSArIHNpemVvZih2X1UxNl90KSArIFwKKyAgICAoMyAqIChzaXplb2Yodl9VOF90KSAqIFZPU19NQUNfQUREUl9TSVpFKSkgICsgXAorICAgIHNpemVvZih2X1UxNl90KSkKKworIC8qIE9wdGlvbmFsIEE0IGFkZHJlc3MgKi8KKyB2X1U4X3QgICBvcHR2QTRbVk9TX01BQ19BRERSX1NJWkVdOworCisgLyogT3B0aW9uYWwgUU9TIGNvbnRyb2wgZmllbGQgKi8KKyB2X1UxNl90ICB1c1Fvc0N0cmw7Cit9V0xBTlRMXzgwMjExSGVhZGVyVHlwZTsKKworLyogODAyLjMgaGVhZGVyICovCit0eXBlZGVmIHN0cnVjdAoreworIC8qIERlc3RpbmF0aW9uIGFkZHJlc3MgZmllbGQgKi8KKyB2X1U4X3QgICB2REFbVk9TX01BQ19BRERSX1NJWkVdOworCisgLyogU291cmNlIGFkZHJlc3MgZmllbGQgKi8KKyB2X1U4X3QgICB2U0FbVk9TX01BQ19BRERSX1NJWkVdOworCisgLyogTGVuZ3RoIGZpZWxkICovCisgdl9VMTZfdCAgdXNMZW5UeXBlOworfVdMQU5UTF84MDIzSGVhZGVyVHlwZTsKK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LS0tLS0tLS0tLS0tLS0tLS0tLSovCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgICAgIFdMQU5UTF9GcmVlQ2xpZW50TWVtb3J5CisKKyAgREVTQ1JJUFRJT04KKyAgSXQgZnJlZXMgdXAgdGhlIG1lbW9yeSBhbGxvY2F0ZWQgdG8gYWxsIHRoZSBTVEEgY2xpZW50cyBpbiBUTENCIGJsb2NrCisgIENhbiBiZSBjYWxsZWQgaW5zaWRlIENsb3NlLCBTdG9wIG9yIHdoZW4gc29tZSBGQVVMVCBvY2N1cnMKKworICBERVBFTkRFTkNJRVMKKworICBQQVJBTUVURVJTCisKKyAgSU4KKyAgcENsaWVudFNUQTogICAgUG9pbnRlciB0byB0aGUgZ2xvYmFsIGNsaWVudCBwb2ludGVyIGFycmF5CisKKyAgUkVUVVJOIFZBTFVFCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBXTEFOVExfRnJlZUNsaWVudE1lbW9yeQorKFdMQU5UTF9TVEFDbGllbnRUeXBlKiBwQ2xpZW50U1RBW1dMQU5fTUFYX1NUQV9DT1VOVF0pCit7CisgICAgdl9VMzJfdCBpID0gMDsKKyAgICBmb3IoaSA9MDsgaSA8IFdMQU5fTUFYX1NUQV9DT1VOVDsgaSsrKQorICAgIHsKKyAgICAgICAgaWYoIE5VTEwgIT0gcENsaWVudFNUQVtpXSApCisgICAgICAgIHsKKyAgICAgICAgICAgdm9zX21lbV9mcmVlKHBDbGllbnRTVEFbaV0pOworICAgICAgICB9CisgICAgICAgIHBDbGllbnRTVEFbaV0gPSBOVUxMOworICAgIH0KKyAgICByZXR1cm47Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfT3BlbgorCisgIERFU0NSSVBUSU9OCisgICAgQ2FsbGVkIGJ5IEhERCBhdCBkcml2ZXIgaW5pdGlhbGl6YXRpb24uIFRMIHdpbGwgaW5pdGlhbGl6ZSBhbGwgaXRzCisgICAgaW50ZXJuYWwgcmVzb3VyY2VzIGFuZCB3aWxsIHdhaXQgZm9yIHRoZSBjYWxsIHRvIHN0YXJ0IHRvIHJlZ2lzdGVyCisgICAgd2l0aCB0aGUgb3RoZXIgbW9kdWxlcy4KKworICBERVBFTkRFTkNJRVMKKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHB2b3NHQ3R4OiAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFuZGxlIHRvIFRMJ3MKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQKKyAgICBwVExDb25maWc6ICAgICAgVEwgQ29uZmlndXJhdGlvbgorCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uCisKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6ICBwb2ludGVyIHRvIFRMIGNiIGlzIE5VTEwgOyBhY2Nlc3Mgd291bGQgY2F1c2UgYSBwYWdlCisgICAgICAgICAgICAgICAgICAgICAgICAgZmF1bHQKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfT3Blbg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RzKTsKKyAgICB2b3NfbWVtX3ZmcmVlKHBUTENiLT5yZW9yZGVyQnVmZmVyUG9vbCk7CisgICAgdm9zX2ZyZWVfY29udGV4dChwdm9zR0N0eCwgVk9TX01PRFVMRV9JRF9UTCwgcFRMQ2IpOworICAgIHJldHVybiBzdGF0dXM7CisgIH0KKyNlbmRpZgorCisgIHBUTENiLT5pc0JNUFMgPSBWT1NfRkFMU0U7CisgIHBtY1JlZ2lzdGVyRGV2aWNlU3RhdGVVcGRhdGVJbmQoIHNtZUNvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9Qb3dlclN0YXRlQ2hhbmdlZENCLCBwdm9zR0N0eCApOworCisgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9LyogV0xBTlRMX09wZW4gKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5UTF9TdGFydAorCisgIERFU0NSSVBUSU9OCisgICAgQ2FsbGVkIGJ5IEhERCBhcyBwYXJ0IG9mIHRoZSBvdmVyYWxsIHN0YXJ0IHByb2NlZHVyZS4gVEwgd2lsbCB1c2UgdGhpcworICAgIGNhbGwgdG8gcmVnaXN0ZXIgd2l0aCBCQUwgYXMgYSB0cmFuc3BvcnQgbGF5ZXIgZW50aXR5LgorCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdG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RnJhbWVzLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX1Jlc291cmNlQ0IsCisgICAgICAgICAgICAgICAgICAgICAgICAgIFdEQV9UTElfTUlOX1JFU19EQVRBLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcHZvc0dDdHgsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAmdVJlc0NvdW50ICk7IAorCisgIGlmICggVk9TX1NUQVRVU19TVUNDRVNTICE9IHZvc1N0YXR1cyApCisgIHsKKyAgICBUTExPR0UoVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgIldMQU4gVEw6VEwgZmFpbGVkIHRvIHJlZ2lzdGVyIHdpdGggQkFML1dEQSwgRXJyOiAlZCIsCisgICAgICAgICAgICAgICB2b3NTdGF0dXMpKTsKKyAgICByZXR1cm4gdm9zU3RhdHVzOworICB9CisKKyAgLyogRW5hYmxlIHRyYW5zbWlzc2lvbiAqLworICB2b3NfYXRvbWljX3NldF9VOCggJnBUTENiLT51Y1R4U3VzcGVuZGVkLCAwKTsKKworICBwVExDYi0+dVJlc0NvdW50ID0gdVJlc0NvdW50OworICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfS8qIFdMQU5UTF9TdGFydCAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX1N0b3AKKworICBERVNDUklQVElPTgorICAgIENhbGxlZCBieSBIREQgdG8gc3RvcCBvcGVyYXRpb24gaW4gVEwsIGJlZm9yZSBjbG9zZS4gVEwgd2lsbCBzdXNwZW5kIGFsbAorICAgIGZyYW1lIHRyYW5zZmVyIG9wZXJhdGlvbiBhbmQgd2lsbCB3YWl0IGZvciB0aGUgY2xvc2UgcmVxdWVzdCB0byBjbGVh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ykKKyAgeworICAgIGlmICggTlVMTCAhPSBwVExDYi0+YXRsU1RBQ2xpZW50c1t1Y0luZGV4XSApCisgICAgeworICAgICAgICBXTEFOVExfQ2xlYW5TVEEocFRMQ2ItPmF0bFNUQUNsaWVudHNbdWNJbmRleF0sIDEgLyplbXB0eSBhbGwgcXVldWVzKi8pOworICAgIH0KKyAgfQorCisKKyAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30vKiBXTEFOVExfU3RvcCAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX0Nsb3NlCisKKyAgREVTQ1JJUFRJT04KKyAgICBDYWxsZWQgYnkgSEREIGR1cmluZyBnZW5lcmFsIGRyaXZlciBjbG9zZSBwcm9jZWR1cmUuIFRMIHdpbGwgY2xlYW4gdXAKKyAgICBhbGwgdGhlIGludGVybmFsIHJlc291cmNlcy4KKworICBERVBFTkRFTkNJRVMKKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHB2b3NHQ3R4OiAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFuZGxlIHRvIFRMJ3MKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQKKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgcG9pbnRlciB0byBUTCBjYiBpcyBOVUxMIDsgYWNjZXNzIHdvdWxkIGNhdXNlIGEgcGFnZQorICAgICAgICAgICAgICAgICAgICAgICAgIGZhdWx0CisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgRX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1ZmZlciBleGhhc3V0aW9uLiAKKworICAgIEl0J3MgYW4gdXBwZXIgbGF5ZXIncyByZXNwb25zaWJpbGl0eSB0byBjYWxsIHRoaXMgZnVuY3Rpb24gaW4gY2FzZSBvZgorICAgIGZsdXNoaW5nCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCitWT1NfU1RBVFVTIAorV0xBTlRMX1N0YXJ0Rm9yd2FyZGluZworKAorICB2X1U4X3QgdWNTVEFJZCwKKyAgdl9VOF90IHVjVWNhc3RTaWcsIAorICB2X1U4X3QgdWNCY2FzdFNpZyAKKykKK3sKKyAgdm9zX21zZ190ICAgICAgc01lc3NhZ2U7CisgIHZfVTMyX3QgICAgICAgIHVEYXRhOyAgICAgICAgICAgICAKKyAvKi0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAqLworCisgIC8qIFNpZ25hbCB0aGUgT1MgdG8gc2VyaWFsaXplIG91ciBldmVudCAqLworICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICJTZXJpYWxpemluZyBUTCBTdGFydCBGb3J3YXJkaW5nIENhY2hlZCBmb3IgY29udHJvbCBTVEEgJWQiLCAKKyAgICAgICAgICAgICAgdWNTVEFJZCApOworCisgIHZvc19tZW1femVybyggJnNNZXNzYWdlLCBzaXplb2Yodm9zX21zZ190KSApOworCisgIHVEYXRhID0gdWNTVEFJZCB8ICh1Y1VjYXN0U2lnIDw8IDggKSB8ICh1Y0JjYXN0U2lnIDw8IDE2KTsgCisgIHNNZXNzYWdlLmJvZHl2YWwgPSB1RGF0YTsKKyAgc01lc3NhZ2UudHlwZSAgICA9IFdMQU5UTF9SWF9GV0RfQ0FDSEVEOworCisgIHJldHVybiB2b3NfcnhfbXFfc2VyaWFsaXplKFZPU19NUV9JRF9UTCwgJnNNZXNzYWdlKTsKKworfSAvKiBXTEFOVExfU3RhcnRGb3J3YXJkaW5nKCkgKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfRW5hYmxlQ2FjaGluZworCisgIERFU0NSSVBUSU9OCisKKyAgICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgdG8gZW5hYmxlIGNhY2hpbmcgb25seSB3aGVuIGFzc29jL3JlYXNzb2MgcmVxIGlzIHNlbmQuCisgICAgdGhhdCBpcyBjYWNoZSBwYWNrZXRzIG9ubHkgZm9yIHN1Y2ggU1RBIElELgorCisKKyAgREVQRU5ERU5DSUVTCisKKyAgICBUTCBtdXN0IGhhdmUgYmVlbiBpbml0aWFsaXplZCBiZWZvcmUgdGhpcyBnZXRzIGNhbGxlZC4KKworCisgIFBBUkFNRVRFUlMKKworICAgc3RhSWQ6ICAgc3RhdGlvbiBpZAorCisgIFJFVFVSTiBWQUxVRQorCisgICBub25lCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBXTEFOVExfRW5hYmxlQ2FjaGluZyh2X1U4X3Qgc3RhSWQpCit7CisgIHZfUFZPSURfdCBwdm9zR0N0eD0gdm9zX2dldF9nbG9iYWxfY29udGV4dChWT1NfTU9EVUxFX0lEX1RMLE5VTEwpOworICBXTEFOVExfQ2JUeXBlKiBwVExDYiA9IFZPU19HRVRfVExfQ0IocHZvc0dDdHgpOworICBpZiAoIE5VTEwgPT0gcFRMQ2IgKQorICB7CisgICAgVExMT0dFKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAg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QUlMVVJFCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCitWT1NfU1RBVFVTIFdMQU5UTF9GaW5pc2hfVUxBKCB2b2lkICgqY2FsbGJhY2tSb3V0aW5lKSAodm9pZCAqY2FsbGJhY2tDb250ZXh0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKmNhbGxiYWNrQ29udGV4dCkKK3sKKyAgIHJldHVybiBXREFfRFNfRmluaXNoVUxBKCBjYWxsYmFja1JvdXRpbmUsIGNhbGxiYWNrQ29udGV4dCk7Cit9CisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfUmVnaXN0ZXJTVEFDbGllbnQKKworICBERVNDUklQVElPTgorCisgICAgVGhpcyBmdW5jdGlvbiBpcyB1c2VkIGJ5IEhERCB0byByZWdpc3RlciBhcyBhIGNsaWVudCBmb3IgZGF0YSBzZXJ2aWNlcworICAgIHdpdGggVEwuIEhERCB3aWxsIGNhbGwgdGhpcyBBUEkgZm9yIGVhY2ggbmV3IHN0YXRpb24gdGhhdCBpdCBhZGRzLAorICAgIHRodXMgaGF2aW5nIHRoZSBmbGV4aWJpbGl0eSBvZiByZWdpc3RlcmluZyBkaWZmZXJlbnQgY2FsbGJhY2sgZm9yIGVhY2gKKyAgICBTVEEgaXQgc2VydmljZXMuCisKKyAgREVQRU5ERU5DSUVTCisKKyAgICBUTCBtdXN0IGhhdmUgYmVlbiBpbml0aWFsaXplZCBiZWZvcmUgdGhpcyBnZXRzIGNhbGxlZC4KKworICAgIFJlc3RyaWN0aW9uOgorICAgICAgTWFpbiB0aHJlYWQgd2lsbCBoYXZlIGhpZ2hlciBwcmlvcml0eSB0aGF0IFR4IGFuZ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FVTX0VfRkFVTFQ6IFN0YXRpb24gSUQgaXMgb3V0c2lkZSBhcnJheSBib3VuZGFyaWVzIG9yIHBvaW50ZXIgdG8KKyAgICAgICAgICAgICAgICAgICAgICAgIFRMIGNiIGlzIE5VTEwgOyBhY2Nlc3Mgd291bGQgY2F1c2UgYSBwYWdlIGZhdWx0CisgICAgVk9TX1NUQVRVU19FX0VYSVNUUzogU3RhdGlvbiB3YXMgYWxyZWFkeSByZWdpc3RlcmVkCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgRXZlcnl0aGluZyBpcyBnb29kIDopCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlRMX1JlZ2lzdGVyU1RBQ2xpZW50CisoCisgIHZfUFZPSURfdCAgICAgICAgICAgICAgICAgcHZvc0dDdHgsCisgIFdMQU5UTF9TVEFSeENCVHlwZSAgICAgICAgcGZuU1RBUngsCisgIFdMQU5UTF9UeENvbXBDQlR5cGUgICAgICAgcGZuU1RBVHhDb21wLAorICBXTEFOVExfU1RBRmV0Y2hQa3RDQlR5cGUgIHBmblNUQUZldGNoUGt0LAorICBXTEFOX1NUQURlc2NUeXBlKiAgICAgICAgIHB3U1RBRGVzY1R5cGUsCisgIHZfUzdfdCAgICAgICAgICAgICAgICAgICAgcnNzaQorKQoreworICBXTEFOVExfQ2JUeXBlKiAgcFRMQ2IgPSBOVUxMOworICBXTEFOVExfU1RBQ2xpZW50VHlwZSogcENsaWVudFNUQSA9IE5VTEw7CisgIHZfVThfdCAgICB1Y1RpZCA9IDA7LypMb2NhbCB2YXJpYWJsZSB0byBjbGVhciBwcmV2aW91cyByZXBsYXkgY291bnRlcnMgb2YgU1RBIG9uIGFsbCBUSURzKi8KKyAgdl9VMzJfdCAgIGlzdG9nZ2xlQXJwRW5iID0gMDsKKyAgdHBBbm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VEVSUworCisgICBwdm9zR0N0eDogICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICAgd1NUQURlc2NUeXBlOiAgICBTVEEgRGVzY3JpcHRvciwgY29udGFpbnMgaW5mb3JtYXRpb24gcmVsYXRlZCB0byB0aGUKKyAgICAgICAgICAgICAgICAgICAgbmV3IGFkZGVkIFNUQQorCisgIFJFVFVSTiBWQUxVRQorCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICAgIFZPU19TVEFUVVNfRV9GQVVMVDogU3RhdGlvbiBJRCBpcyBvdXRzaWRlIGFycmF5IGJvdW5kYXJpZXMgb3IgcG9pbnRlciB0bworICAgICAgICAgICAgICAgICAgICAgICAgVEwgY2IgaXMgTlVMTCA7IGFjY2VzcyB3b3VsZCBjYXVzZSBhIHBhZ2UgZmF1bHQKKyAgICBWT1NfU1RBVFVTX0VfRVhJU1RTOiBTdGF0aW9uIHdhcyBub3QgcmVnaXN0ZXJlZAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworVk9TX1NUQVRVUworV0xBTlRMX1VwZGF0ZVRkbHNTVEFDbGllbnQKKygKKyB2X1BWT0lEX3QgICAgICAgICAgICAgICAgIHB2b3NHQ3R4LAorIFdMQU5fU1RBRGVzY1R5cGUqICAgICAgICAgcHdTVEFEZXNjVHlwZQorKQoreworICBXTEFOVExfQ2JUeXBlKiBwVExDYiA9IE5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CBUTCBwb2ludGVyIGZyb20gcHZvc0dDdHggb24gV0xBTlRMX1JlZ2lzdGVyU1RBQ2xpZW50IikpOworICAgIHJldHVybjsKKyAgfQorICBwVExDYi0+aXNDb252ZXJzaW9uUmVxID0gaXNDb252ZXJzaW9uUmVxOworICByZXR1cm47Cit9CisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfU1RBUHRrSW5zdGFsbGVkCisKKyAgREVTQ1JJUFRJT04KKworICAgIEhERCB3aWxsIG1ha2UgdGhpcyBub3RpZmljYXRpb24gd2hlbmV2ZXIgUFRLIGlzIGluc3RhbGxlZCBmb3IgdGhlIFNUQQorCisgIERFUEVOREVOQ0lFUworCisgICAgQSBzdGF0aW9uIG11c3QgaGF2ZSBiZWVuIHJlZ2lzdGVyZWQgYmVmb3JlIHRoZSBjaGFuZ2Ugc3RhdGUgY2FuIGJlCisgICAgY2FsbGVkLgorCisgIFBBUkFNRVRFUlMKKworICAgcHZvc0dDdHg6ICAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFuZGxlIHRvIFRMJ3MKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQKKyAgIHVjU1RBSWQ6ICAgICAgICAgaWRlbnRpZmllciBmb3IgdGhlIFNUQSBmb3Igd2hpY2ggUGFpcndpc2Uga2V5IGlzCisgICAgICAgICAgICAgICAgICAgIGluc3RhbGxlZAorCisgIFJFVFVSTiBWQUxVRQorCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICAgIFZPU19TVEFUVVNfRV9GQVVMVDogIFN0YXRpb24gSUQgaXMgb3V0c2lkZSBh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RShWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgRkwoIldMQU4gVEw6U3RhdGlvbiB3YXMgbm90IHByZXZpb3VzbHkgcmVnaXN0ZXJlZCIpKSk7CisgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9FWElTVFM7CisgIH0KKworICBwVExDYi0+YXRsU1RBQ2xpZW50c1t1Y1NUQUlkXS0+cHRrSW5zdGFsbGVkID0gMTsKKworICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfS8qIFdMQU5UTF9TVEFQdGtJbnN0YWxsZWQgKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfR2V0U1RBU3RhdGUKKworICBERVNDUklQVElPTgorCisgICAgUmV0dXJucyBjb25uZWN0aXZpdHkgc3RhdGUgb2YgYSBwYXJ0aWN1bGFyIFNUQS4KKworICBERVBFTkRFTkNJRVMKKworICAgIEEgc3RhdGlvbiBtdXN0IGhhdmUgYmVlbiByZWdpc3RlcmVkIGJlZm9yZSBpdHMgc3RhdGUgY2FuIGJlIHJldHJpZXZlZC4KKworCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICAgIHVjU1RBSWQ6ICAgICAgICBpZGVudGlmaWVyIG9mIHRoZSBzdGF0aW9uCisKKyAgICBPVVQKKyAgICBwdGxTVEFTdGF0ZTogICAgdGhlIGN1cnJlbnQgc3RhdGUgb2YgdGhlIGNvbm5lY3Rpb24gdG8gdGhlIGd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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgIElOVEVSQUNUSU9OIFdJVEggQkFQCisgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5UTF9SZWdpc3RlckJBUENsaWVudAorCisgIERFU0NSSVBUSU9OCisgICAgQ2FsbGVkIGJ5IFNNRSB0byByZWdpc3RlciBpdHNlbGYgYXMgY2xpZW50IGZvciBub24tZGF0YSBCVC1BTVAgcGFja2V0cy4KKworICBERVBFTkRFTkNJRVMKKyAgICBUTCBtdXN0IGJlIGluaXRpYWxpemVkIGJlZm9yZSB0aGlzIGZ1bmN0aW9uIGNhbiBiZSBjYWxsZWQuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICBwdm9zR0N0eDogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZSB0byBUTCdzCisgICAgICAgICAgICAgICAgICAgIG9yIFNNRSdzIGNvbnRyb2wgYmxvY2sgY2FuIGJlIGV4dHJhY3RlZCBmcm9tIGl0cyBjb250ZXh0CisgICAgcGZuVGxCQVBSeEZybTogIHBvaW50ZXIgdG8gdGhlIHJlY2VpdmUgcHJvY2Vzc2luZyByb3V0aW5lIGZvciBub24tZGF0YQorICAgICAgICAgICAgICAgICAgICBCVC1BTVAgcGFja2V0cworICAgIHBmbkZsdXNoT3BDb21wbGV0ZUNiOgorICAgICAgICAgICAgICAgICAgICBwb2ludGVyIHRvIHRoZSBjYWxsIGJhY2sgZnVuY3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biB3aXRoIFRMCisgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworICBUTExPRzIoVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICJXTEFOIFRMOlJlZ2lzdGVyaW5nIEJBUCBDbGllbnQiICkpOworCisgIHBUTENiLT50bEJBUENsaWVudC51Y0V4aXN0cysrOworCisgIGlmICggTlVMTCAhPSBwZm5UbEJBUFJ4RnJtICkgCisgIHsKKyAgICBwVExDYi0+dGxCQVBDbGllbnQucGZuVGxCQVBSeCAgICAgICAgICAgICA9IHBmblRsQkFQUnhGcm07CisgIH0KKworICBwVExDYi0+dGxCQVBDbGllbnQucGZuRmx1c2hPcENvbXBsZXRlQ2IgICA9IHBmbkZsdXNoT3BDb21wbGV0ZUNiOworCisgIHBUTENiLT50bEJBUENsaWVudC52b3NQZW5kaW5nRGF0YUJ1ZmYgICAgID0gTlVMTDsKKworICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfS8qIFdMQU5UTF9SZWdpc3RlckJBUENsaWVudCAqLworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfVHhCQVBGcm0KKworICBERVNDUklQVElPTgorICAgIEJBUCBjYWxscyB0aGlzIHdoZW4gaXQgd2FudHMgdG8gc2VuZCBhIGZyYW1lIHRvIHRoZSBtb2R1bGUKKworICBERVBFTkRFTkNJRVMKKyAgICBCQVAgbXVzdCBiZSByZWdpc3RlcmVkIHdpdGggVEwgYmVmb3JlIHRoaXMgZnVuY3Rpb24gY2FuIGJlIGNhbGxlZC4KKworICAgIFJFU1RSSUNUSU9OOiBCQVAgQ0FOTk9UIHB1c2ggYW55IHBhY2tldHMgdG8gVEwgdW50aWwgaXQgZGlkIG5vdCByZWNlaXZlCisgICAgICAgICAgICAgICAgIGEgdHggY29tcGxldGUgZnJvbSB0aGUgcHJldmlvdXMgcGFja2V0LCB0aGF0IG1lYW5zIEJBUAorICAgICAgICAgICAgICAgICBzZW5kcyBvbmUgcGFja2V0LCB3YWl0IGZvciB0eCBjb21wbGV0ZSBhbmQgdGhlbgorICAgICAgICAgICAgICAgICBzZW5kcyBhbm90aGVyIG9uZQorCisgICAgICAgICAgICAgICAgIElmIEJBUCBzZW5kcyBhbm90aGVyIHBhY2tldCBiZWZvcmUgVEwgbWFuYWdlcyB0byBwcm9jZXNzIHRoZQorICAgICAgICAgICAgICAgICBwcmV2aW91c2x5IHNlbnQgcGFja2V0IGNhbGwgd2lsbCBlbmQgaW4gZmFpbHVyZQorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgICBvciBCQVAncyBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICAgIHZvc0RhdGFCdWZmOiAgIHBvaW50ZXIgdG8gdGhlIHZPU1MgYnVmZmVyIGNvbnRhaW5pbmcgdGhlIHBhY2tldCB0byBiZQorICAgICAgICAgICAgICAgICAgICB0cmFuc21pdHRlZAorICAgIHBNZXRhSW5mbzogICAgICBtZXRhIGluZm9ybWF0aW9uIGFib3V0IHRoZSBwYWNrZXQKKyAgICBwZm5UbEJBUFR4Q29tcDogcG9pbnRlciB0byBhIHRyYW5zbWl0IGNvbXBsZXRlIHJvdXRpbmUgZm9yIG5vdGlmeWluZworICAgICAgICAgICAgICAgICAgICB0aGUgcmVzdWx0IG9mIHRoZSBvcGVyYXRpb24gb3ZlciB0aGUgYnVzCisKKyA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AgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgIH0KKyAgaWYgKCggMCA9PSBwTWV0YUluZm8tPnVjRGlzYWJsZUZybVh0bCApICYmIAorICAgICAgKCAwICE9IHBUTENiLT5hdGxTVEFDbGllbnRzW3VjU3RhSWRdLT53U1RBRGVzYy51Y1N3RnJhbWVUWFhsYXRpb24gKSkKKyAgeworICAgIHZvc1N0YXR1cyA9ICBXTEFOVExfVHJhbnNsYXRlODAyM1RvODAyMTFIZWFkZXIoIHZvc0RhdGFCdWZmLCAmdm9zU3RhdHVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUTENiLCAmdWNTdGFJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWV0YUluZm8sICZ1Y1dEU0VuYWJsZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmV4dHJhSGVhZFNwYWNlKTsKKworICAgIGlmICggVk9TX1NUQVRVU19TVUNDRVNTICE9IHZvc1N0YXR1cyApCisgICAgeworICAgICAgVExMT0dFKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICJXTEFOIFRMOkVycm9yIHdoZW4gdHJhbnNsYXRpbmcgaGVhZGVyIFdMQU5UTF9UeEJBUEZybSIpKTsKKworICAgICAgcmV0dXJuIHZvc1N0YXR1czsKKyAgICB9CisKKyAgICBwTWV0YUluZm8tPnVjRGlzYWJsZUZybVh0bCA9IDE7CisgIH0KKworICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICBDYWxsIEhBTCB0byBmaWxsIEJEIGhlYWRlcgorICAgLS0tLS0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U1RBOiAlZCBSU1NJOiAlZCVzIiwKKyAgICAgICAgICAgICAgICAgICAgdWNTVEFJZCwgKnBSc3NpLAorICAgICAgICAgICAgICAgICAgICBwVExDYi0+aXNCTVBTID8gIiBpbiBCTVBTIiA6ICIiKSk7CisKKyAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30vKiBXTEFOVExfR2V0UnNzaSAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX0dldFNucgorCisgIERFU0NSSVBUSU9OCisgICAgVEwgd2lsbCBleHRyYWN0IHRoZSBTTlIgaW5mb3JtYXRpb24gZnJvbSBldmVyeSBkYXRhIHBhY2tldCBmcm9tIHRoZQorICAgIG9uZ29pbmcgdHJhZmZpYyBhbmQgd2lsbCBzdG9yZSBpdC4gSXQgd2lsbCBwcm92aWRlIHRoZSByZXN1bHQgdG8gU01FCisgICAgdXBvbiByZXF1ZXN0LgorCisgIERFUEVOREVOQ0lFUworCisgICAgV0FSTklORzogdGhlIHJlYWQgYW5kIHdyaXRlIG9mIHRoaXMgdmFsdWUgd2lsbCBub3QgYmUgcHJvdGVjdGVkCisgICAgICAgICAgICAgYnkgbG9ja3MsIHRoZXJlZm9yZSB0aGUgaW5mb3JtYXRpb24gb2J0YWluZWQgYWZ0ZXIgYSByZWFkCisgICAgICAgICAgICAgbWlnaHQgbm90IGFsd2F5cyBiZSBjb25zaXN0ZW50LgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgICBvciBTTUUncyBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICAgIHVjU1RB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pb25zIGNhbiBrbm93IHRoYXQKKyAgICAgKiB0aGUgU05SIGhhcyBub3QgYmVlbiBjb21wdXRlZCB5ZXQgYmVjYXVzZSBlbm91Z2ggZGF0YSB3YXMgbm90CisgICAgICogYXZhaWxhYmxlIGZvciBTTlIgY2FsY3VsYXRpb24KKyAgICAgKi8KKyAgICBpZiAocENsaWVudFNUQS0+c25ySWR4ID4gKFdMQU5UTF9NQVhfU05SX0RBVEFfU0FNUExFUy8yKQorICAgICAgICB8fCAhKHBDbGllbnRTVEEtPnByZXZTbnJBdmcpKQorICAgIHsKKyAgICAgICAqcFNuciA9IHBDbGllbnRTVEEtPnNuclN1bSAvIHBDbGllbnRTVEEtPnNucklkeDsKKyAgICB9CisgICAgZWxzZSBpZiAocENsaWVudFNUQS0+cHJldlNuckF2ZykKKyAgICB7CisgICAgICAgKnBTbnIgPSBwQ2xpZW50U1RBLT5wcmV2U25yQXZnOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICpwU25yID0gU05SX0hBQ0tfQk1QUzsKKyAgICB9CisgIH0KKworICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICJXTEFOIFRMOldMQU5UTF9HZXRTbnIgZm9yIFNUQTogJWQgU05SOiAlZCVzIiwKKyAgICAgICAgICAgIHVjU1RBSWQsICpwU25yLAorICAgICAgICAgICAgcFRMQ2ItPmlzQk1QUyA/ICIgaW4gQk1QUyIgOiAiIik7CisKKyAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30vKiBXTEFOVExfR2V0U25yICovCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX0dldExpbmtRdWFsaXR5CisKKyAgREVTQ1JJUFRJT04KKyAgICBUTCB3aWxsIGV4dHJh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QVVMVDogIFN0YXRpb24gSUQgaXMgb3V0c2lkZSBhcnJheSBib3VuZGFyaWVzIG9yIHBvaW50ZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICB0byBUTCBjYiBpcyBOVUxMIDsgYWNjZXNzIHdvdWxkIGNhdXNlIGEgcGFnZSBmYXVsdAorICAgIFZPU19TVEFUVVNfRV9FWElTVFM6IFNUQSB3YXMgbm90IHlldCByZWdpc3RlcmVkCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgRXZlcnl0aGluZyBpcyBnb29kIDopCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlRMX0dldExpbmtRdWFsaXR5CisoCisgIHZfUFZPSURfdCAgICAgICAgICAgICBwdm9zR0N0eCwKKyAgdl9VOF90ICAgICAgICAgICAgICAgIHVjU1RBSWQsCisgIHZfVTMyX3QqICAgICAgICAgICAgICBwdUxpbmtRdWFsaXR5CispCit7CisgIFdMQU5UTF9DYlR5cGUqICBwVExDYiA9IE5VTEw7CisgIFdMQU5UTF9TVEFDbGllbnRUeXBlKiBwQ2xpZW50U1RBID0gTlVMTDsKKworICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgIFNhbml0eSBjaGVjaworICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyAgaWYgKCBOVUxMID09IHB1TGlua1F1YWxpdHkgKQorICB7CisgICAgVExMT0dFKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgIC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qLworICBwVExDYiA9IFZPU19HRVRfVExfQ0IocHZvc0dDdHgpOworICBpZiAoIE5VTEwgPT0gcFRMQ2IgKQorICB7CisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgIldMQU4gVEw6SW52YWxpZCBUTCBwb2ludGVyIGZyb20gcHZvc0dDdHggb24gV0xBTlRMX0NoYW5nZVNUQVN0YXRlIik7CisgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgfQorCisgIHZvc19tZW1fY29weShwVExDYi0+c3Bvb2ZNYWNBZGRyLnNlbGZNYWMuYnl0ZXMsIHNlbGZNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX01BQ19BRERSRVNTX0xFTik7CisgIHZvc19tZW1fY29weShwVExDYi0+c3Bvb2ZNYWNBZGRyLnNwb29mTWFjLmJ5dGVzLCBzcG9vZk1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfTUFDX0FERFJFU1NfTEVOKTsKKworICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICAgICAiVEw6IFNlbGZTVEEgbWFjIEFkZHIgZm9yIGN1cnJlbnQgU2NhbiAiTUFDX0FERFJFU1NfU1RSLAorICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocFRMQ2ItPnNwb29mTWFjQWRkci5zZWxmTWFjLmJ5dGVzKSk7CisKKyAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30vKiBXTEFOVExfdXBkYXRlU3Bvb2ZNYWNBZGRyICovCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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8gZGVyZWdpc3RlciBhcyBhIGNsaWVudCBmb3IgbWFuYWdlbWVudCBmcmFtZXMgZGVsaXZlcnkuCisKKyAgREVQRU5ERU5DSUVTCisgICAgVEwgbXVzdCBiZSBpbml0aWFsaXplZCBiZWZvcmUgdGhpcyBBUEkgY2FuIGJlIGNhbGxlZC4KKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHB2b3NHQ3R4OiAgICAgICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZSB0bworICAgICAgICAgICAgICAgICAgICAgICAgVEwncyBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgcG9pbnRlciB0byBUTCBjYiBpcyBOVUxMIDsgYWNjZXNzIHdvdWxkIGNhdXNlIGEKKyAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlIGZhdWx0CisgICAgVk9TX1NUQVRVU19FX0VYSVNUUzogTWdtdCBGcmFtZSBjbGllbnQgd2FzIG5ldmVyIHJlZ2lzdGVyZWQKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfRGVSZWdpc3Rlck1nbXRGcm1DbGllbnQKKygKKyAgdl9QVk9JRF90ICAgICAgICAgICAgICAgcHZvc0dDdHgKKykKK3sKKyAgV0xBTlRMX0NiVHlwZSogIHBUTENiID0gTlVMTDsKKyAgLyotIC0gLS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V9FWElTVFM6IE1nbXQgRnJhbWUgY2xpZW50IHdhcyBub3QgeWV0IHJlZ2lzdGVyZWQKKyAgICBWT1NfU1RBVFVTX0VfQlVTWTogICBUaGUgcHJldmlvdXMgTWdtdCBwYWNrZXQgd2FzIG5vdCB5ZXQgdHJhbnNtaXR0ZWQKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICAgIE90aGVyIGZhaWx1cmUgbWVzc2FnZXMgbWF5IGJlIHJldHVybmVkIGZyb20gdGhlIEJEIGhlYWRlciBoYW5kbGluZworICAgIHJvdXRpbmVzLCBwbGVhc2UgY2hlY2sgYXByb3ByaWF0ZSBBUEkgZm9yIG1vcmUgaW5mby4KKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfVHhNZ210RnJtCisoCisgIHZfUFZPSURfdCAgICAgICAgICAgIHB2b3NHQ3R4LAorICB2b3NfcGt0X3QqICAgICAgICAgICB2b3NGcm1CdWYsCisgIHZfVTE2X3QgICAgICAgICAgICAgIHVzRnJtTGVuLAorICB2X1U4X3QgICAgICAgICAgICAgICB3RnJtVHlwZSwKKyAgdl9VOF90ICAgICAgICAgICAgICAgdWNUaWQsCisgIFdMQU5UTF9UeENvbXBDQlR5cGUgIHBmbkNvbXBUeEZ1bmMsCisgIHZfUFZPSURfdCAgICAgICAgICAgIHB2QkRIZWFkZXIsCisgIHZfVTMyX3QgICAgICAgICAgICAgIHVjQWNrUmVzcG9uc2UsCisgIHZfVTMyX3QgICAgICAgICAgICAgICB1Y1R4QmRUb2tlbgorKQoreworICBXTEFOVExfQ2JUeXBlKiAgcFRMQ2IgPSBOVUxMOworICB2X01BQ0FERFJfdCAgICAgdkRlc3RNYWNBZGRyOworICBWT1NfU1RBVFVTICAgICAgdm9zU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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgSU5URVJBQ1RJT04gV0lUSCBIQUwKKyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX1Jlc2V0Tm90aWZpY2F0aW9uCisKKyAgREVTQ1JJUFRJT04KKyAgICBIQUwgbm90aWZpZXMgVEwgd2hlbiB0aGUgbW9kdWxlIGlzIGJlaW5nIHJlc2V0LgorICAgIEN1cnJlbnRseSBub3QgdXNlZC4KKworICBERVBFTkRFTkNJRVMKKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHB2b3NHQ3R4OiAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFuZGxlIHRvIFRMJ3MKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQKKworCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uCisKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6ICBwb2ludGVyIHRvIFRMIGNiIGlzIE5VTEwgOyBhY2Nlc3Mgd291bGQgY2F1c2UgYQorICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2UgZmF1bHQKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfU3VzcGVuZERhdGFUeAorCisgIERFU0NSSVBUSU9OCisgICAgSEFMIGNhbGxzIHRoaXMgQVBJIHdoZW4gaXQgd2lzaGVzIHRvIHN1c3BlbmQgdHJhbnNtaXNzaW9uIGZvciBhCisgICAgcGFydGljdWxhciBTVEEuCisKKyAgREVQRU5ERU5DSUVTCisgICAgVGhlIFNUQSBmb3Igd2hpY2ggdGhlIHJlcXVlc3QgaXMgbWFkZSBtdXN0IGJlIGZpcnN0IHJlZ2lzdGVyZWQgd2l0aAorICAgIFRMIGJ5IEhERC4KKworICAgIFJFU1RSSUNUSU9OOiAgSW4gY2FzZSBvZiBhIHN1c3BlbmQsIHRoZSBmbGFnIHdyaXRlIGFuZCByZWFkIHdpbGwgbm90IGJlCisgICAgICAgICAgICAgICAgICBsb2NrZWQ6IHdvcnN0IGNhc2Ugc2NlbmFyaW8gb25lIG1vcmUgcGFja2V0IGNhbiBnZXQKKyAgICAgICAgICAgICAgICAgIHRocm91Z2ggYmVmb3JlIHRoZSBmbGFnIGdldHMgdXBkYXRlZCAod2UgY2FuIG1ha2UgdGhpcworICAgICAgICAgICAgICAgICAgd3JpdGUgYXRvbWljIGFzIHdlbGwgdG8gZ3VhcmFudGVlIGNvbnNpc3RlbmN5KQorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICAgIHB1Y1NUQUlkOiAgICAgICBpZGVudGlmaWVyIG9mIHRoZSBzdGF0aW9uIGZvciB3aGljaCB0aGUgcmVxdWVzdCBpcyBtYWRlOworICAgICAgICAgICAgICAgICAgICBhIHZhbHVlIG9mIE5VTEwgYXNzdW1lcyBzdXNwZW5kIG9uIGFsbCBhY3RpdmUgc3RhdGlvbgorICAgIHBmblN1c3BlbmRUeENCOiBwb2ludGVyIHRvIHRoZSBzdXNwZW5kIHJlc3VsdCBub3RpZmljYXRpb24gaW4gY2FzZSB0aGUKKyAgICAgICAgICAgICAgICAgICAgY2FsbCBpcyBhc3luY2hyb25vdXMKKworCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uCisKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6ICAgU3RhdGlvbiBJRCBpcyBvdXRzaWRlIGFycmF5IGJvdW5kYXJpZXMgb3IgcG9pbnRlcgorICAgICAgICAgICAgICAgICAgICAgICAgICB0byBUTCBjYiBpcyBOVUxMIDsgYWNjZXNzIHdvdWxkIGNhdXNlIGEgcGFnZSBmYXVsdAorICAgIFZPU19TVEFUVVNfRV9FWElTVFM6ICBTdGF0aW9uIHdhcyBub3QgcmVnaXN0ZXJlZAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKK1ZPU19TVEFUVVMKK1dMQU5UTF9TdXNwZW5kRGF0YVR4CisoCisgIHZfUFZPSURfdCAgICAgICAgICAgICAgcHZvc0dDdHgsCisgIHZfVThfdCogICAgICAgICAgICAgICAgcHVjU1RBSWQsCisgIFdMQU5UTF9TdXNwZW5kQ0JUeXBlICAgcGZuU3VzcGVuZFR4CispCit7CisgIFdMQU5UTF9DYlR5cGUqICBwVExDYiA9IE5VTEw7CisgIHZvc19tc2dfdCAgIC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BmblN1c3BlbmRUeDsKKworICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfVEwsIFRSQUNFX0NPREVfVExfU1VTUEVORF9EQVRBX1RYLAorICAgICAgICAgICAgICAgICAgICB2b3NNc2cucmVzZXJ2ZWQgLCAwICkpOworCisgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zX3R4X21xX3NlcmlhbGl6ZSggVk9TX01RX0lEX1RMLCAmdm9zTXNnKSkpCisgIHsKKyAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICIgJXMgZmFpbHMgdG8gcG9zdCBtZXNzYWdlIiwgX19mdW5jX18pOworICB9CisKKyAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30vKiBXTEFOVExfU3VzcGVuZERhdGFUeCAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX1Jlc3VtZURhdGFUeAorCisgIERFU0NSSVBUSU9OCisgICAgQ2FsbGVkIGJ5IEhBTCB0byByZXN1bWUgZGF0YSB0cmFuc21pc3Npb24gZm9yIGEgZ2l2ZW4gU1RBLgorCisgICAgV0FSTklORzogSWYgYSBzdGF0aW9uIHdhcyBpbmRpdmlkdWFsbHkgc3VzcGVuZGVkIGEgZ2xvYmFsIHJlc3VtZSB3aWxsCisgICAgICAgICAgICAgbm90IHJlc3VtZSB0aGF0IHN0YXRpb24KKworICBERVBFTkRFTkNJRVMKKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHB2b3NHQ3R4OiAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFuZGxlIHRvIFRMJ3MKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBj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gICAgICAgICAgIldMQU4gVEw6UmVzdW1pbmcgdHJhbnNtaXNzaW9uIikpOworICAgIHJldHVybiBXREFfRFNfU3RhcnRYbWl0KHB2b3NHQ3R4KTsKKyAgfQorCisgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9LyogV0xBTlRMX1Jlc3VtZURhdGFUeCAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5UTF9TdXNwZW5kQ0IKKworICBERVNDUklQVElPTgorICAgIENhbGxiYWNrIGZ1bmN0aW9uIGZvciBzZXJpYWxpemluZyBTdXNwZW5kIHNpZ25hbCB0aHJvdWdoIFR4IHRocmVhZAorCisgIERFUEVOREVOQ0lFUworICAgIEp1c3Qgbm90aWZ5IEhBTCB0aGF0IHN1c3BlbmQgaW4gVEwgaXMgY29tcGxldGUuCisKKyAgUEFSQU1FVEVSUworCisgICBJTgorICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgIGNvbnRyb2wgYmxvY2sgY2FuIGJlIGV4dHJhY3RlZCBmcm9tIGl0cyBjb250ZXh0CisgICBwVXNlckRhdGE6ICAgICAgdXNlciBkYXRhIHNlbnQgd2l0aCB0aGUgY2FsbGJhY2sKKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorCisgICAgVk9TX1NUQVRVU19FX0lOVkFMOiAgIGludmFsaWQgaW5wdXQgcGFyYW1ldGVycworICAgIFZPU19TVEFUVVNfRV9GQVVMVDogICBwb2ludGVyIHRvIFRMIGNiIGlzIE5VTEwgOyBhY2Nlc3Mgd291bGQgY2F1c2Ug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tLS0tCisgICAgQ0xJRU5UIElOREVQRU5ERU5UIElOVEVSRkFDRQorIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfR2V0VHhQa3RDb3VudAorCisgIERFU0NSSVBUSU9OCisgICAgVEwgd2lsbCBwcm92aWRlIHRoZSBudW1iZXIgb2YgdHJhbnNtaXR0ZWQgcGFja2V0cyBjb3VudGVkIHBlcgorICAgIFNUQSBwZXIgVElELgorCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICAgIHVjU1RBSWQ6ICAgICAgICBpZGVudGlmaWVyIG9mIHRoZSBzdGF0aW9uCisgICAgdWNUaWQ6ICAgICAgICAgIGlkZW50aWZpZXIgb2YgdGhlIHRzcGVjCisKKyAgICBPVVQKKyAgICBwdVR4UGt0Q291bnQ6ICAgdGhlIG51bWJlciBvZiBwYWNrZXRzIHR4IHBhY2tldCBmb3IgdGhpcyBTVEEgYW5kIFRJRAorCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uCisKKyAgICBWT1NfU1RBVFVTX0VfSU5WQUw6ICAgSW5wdXQgcGFyYW1ldGVycyBhcmUgaW52YWxpZAorICAgIFZPU19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UUkFDRV9MRVZFTF9JTkZPX01FRCwKKyAgICAvLyAgICAgICAgICJXTEFOIFRMOlJlcXVlc3RlZCB0eCBwYWNrZXQgY291bnQgZm9yIFNUQTogJWQsIFRJRDogJWQiLCAKKyAgICAgIC8vICAgICAgICAgdWNTVEFJZCwgdWNUaWQpOworCisgICpwdVR4UGt0Q291bnQgPSBwVExDYi0+YXRsU1RBQ2xpZW50c1t1Y1NUQUlkXS0+YXVUeENvdW50W3VjVGlkXTsKKworICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfS8qIFdMQU5UTF9HZXRUeFBrdENvdW50ICovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfR2V0UnhQa3RDb3VudAorCisgIERFU0NSSVBUSU9OCisgICAgVEwgd2lsbCBwcm92aWRlIHRoZSBudW1iZXIgb2YgcmVjZWl2ZWQgcGFja2V0cyBjb3VudGVkIHBlcgorICAgIFNUQSBwZXIgVElELgorCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICAgIHVjU1RBSWQ6ICAgICAgICBpZGVudGlmaWVyIG9mIHRoZSBzdGF0aW9uCisgICAgdWNUaWQ6ICAgICAgICAgIGlkZW50aWZpZXIgb2YgdGhlIHRzcGVjCisKKyAgIE9VVAorICAgIHB1VHhQa3RDb3VudDogICB0aGUgbnVtYmVyIG9mIHBhY2tldHMgcnggcGFja2V0IGZvciB0aGlzIFNUQSBhbmQgVElECisKKyAgUkVUVVJOIFZBTFVFCisg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PT09PT0KKyAgICAgICAgICAgICAgICAgICAgICBUTCBJTlRFUk5BTCBBUEkgREVGSU5JVElPTgorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfR2V0RnJhbWVzCisKKyAgREVTQ1JJUFRJT04KKworICAgIEJBTCBjYWxscyB0aGlzIGZ1bmN0aW9uIGF0IHRoZSByZXF1ZXN0IG9mIHRoZSBsb3dlciBidXMgaW50ZXJmYWNlLgorICAgIFdoZW4gdGhpcyByZXF1ZXN0IGlzIGJlaW5nIHJlY2VpdmVkIFRMIHdpbGwgcmV0cmlldmUgcGFja2V0cyBmcm9tIEhERAorICAgIGluIGFjY29yZGFuY2Ugd2l0aCB0aGUgcHJpb3JpdHkgcnVsZXMgYW5kIHRoZSBjb3VudCBzdXBwbGllZCBieSBCQUwuCisKKyAgREVQRU5ERU5DSUVTCisKKyAgICBIREQgbXVzdCBoYXZlIHJlZ2lzdGVyZWQgd2l0aCBUTCBhdCBsZWFzdCBvbmUgU1RBIGJlZm9yZSB0aGlzIGZ1bmN0aW9uCisgICAgY2FuIGJlIGNhbGxlZC4KKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHB2b3NHQ3R4OiAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFuZGxlIHRvIFRMJ3MKKyAgICAgICAgICAgICAgICAgICAgb3IgQkFMJ3MgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQKKyAgICB1U2l6ZTogICAgICAgICAgbWF4aW11bSBzaXplIGFjY2VwdGVkIGJ5IHRoZSBsb3dlciBsYXllcgorICAgIHVGbG93TWFzay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2X1UzMl90ICAgICAgICAgdVNpemUsCisgIHZfVThfdCAgICAgICAgICB1Rmxvd01hc2ssCisgIHZfQk9PTF90KiAgICAgICBwYlVyZ2VudAorKQoreworICAgdm9zX3BrdF90KiogICAgICAgICBwdm9zRGF0YUJ1ZmYgPSAodm9zX3BrdF90KiopcHBGcmFtZURhdGFCdWZmOworICAgV0xBTlRMX0NiVHlwZSogICAgICBwVExDYiA9IE5VTEw7CisgICBXTEFOVExfU1RBQ2xpZW50VHlwZSogcENsaWVudFNUQSA9IE5VTEw7CisgICB2X1UzMl90ICAgICAgICAgICAgIHVSZW1haW5pbmcgPSB1U2l6ZTsKKyAgIHZvc19wa3RfdCogICAgICAgICAgdm9zUm9vdDsKKyAgIHZvc19wa3RfdCogICAgICAgICAgdm9zVGVtcEJ1ZjsKKyAgIFdMQU5UTF9TVEFGdW5jVHlwZSAgcGZuU1RBRnNtOworICAgdl9VMTZfdCAgICAgICAgICAgICB1c1BrdExlbjsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgdVJlc0xlbjsKKyAgIHZfVThfdCAgICAgICAgICAgICAgdWNTVEFJZDsKKyAgIHZfVThfdCAgICAgICAgICAgICAgdWNBQzsKKyAgIHZvc19wa3RfdCogICAgICAgICAgdm9zRGF0YUJ1ZmY7CisgICB2X1UzMl90ICAgICAgICAgICAgIHVUb3RhbFBrdExlbjsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgaT0wOworICAgdl9VMzJfdCAgICAgICAgICAgICBqPTA7CisgICB2X1UzMl90ICAgICAgICAgICAgIHVjUmVzdWx0ID0gMDsKKyAgIFZPU19TVEFUVVMgICAgICAgICAgdm9zU3RhdHVzOworICAgV0xBTlRMX1NUQUV2ZW50VHlwZSAgIHdTVEFFdmVudDsKKyAgIHRCc3NTeXN0ZW1Sb2xlICAgICAgIHN5c3RlbVJvbGU7CisgICB0cEFuaVNpckdsb2JhbCBwTWFjOworICAvKi0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLS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gMSAvKnRydWUqLyApOworCisgICAgICAgICAgdm9zX2F0b21pY19zZXQoICh1aW50cHRyX3QqKSZwVExDYi0+dm9zVHhGQ0J1ZiwgKHVpbnRwdHJfdCkgTlVMTCk7CisKKyAgICAgICAgICAvKkZDIGZyYW1lcyBjYW5ub3QgYmUgZGVsYXllZCovCisgICAgICAgICAgcFRMQ2ItPmJVcmdlbnQgICAgICA9IFRSVUU7CisKKyAgICAgICAgICAvKlVwZGF0ZSByZW1haW5pbmcgbGVuIGZyb20gU1NDICovCisgICAgICAgICAgdVJlbWFpbmluZyAgICAgICAgLT0gKHVzUGt0TGVuICsgV0RBX0RYRV9IRUFERVJfU0laRSk7CisKKyAgICAgICAgICAvKlVwZGF0ZSByZXNvdXJjZSBjb3VudCAqLworICAgICAgICAgIHBUTENiLT51UmVzQ291bnQgLT0gdVJlc0xlbjsKKyAgICAgICB9CisgICAgICAgZWxzZQorICAgICAgIHsKKyAgICAgICAgICBUTExPR1coVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgICAiV0xBTiBUTDpzZW5kIGZjIG91dCBvZiBzb3VyY2UgJXMiLCBfX2Z1bmNfXykpOworICAgICAgICAgIHVjUmVzdWx0ID0gKCBwVExDYi0+dVJlc0NvdW50ID4gdVJlc0xlbiApP1ZPU19UUlVFOlZPU19GQUxTRTsKKyAgICAgICAgICBicmVhazsgLyogT3V0IG9mIHJlc291cmNlcyBvciByZWFjaGVkIG1heCBsZW4gKi8KKyAgICAgICB9CisgICB9CisgICBlbHNlIAorI2VuZGlmIC8vV0xBTl9TT0ZUQVBfRkxPV0NUUkxfRU4KKworICAgIGlmICgoIE5VTEwgIT0gcFRMQ2ItPnRsTWdtdEZybUNsaWVudC52b3NQZW5kaW5nRGF0YUJ1ZmYgKSAmJgorICAgICAgICAoIHVGbG93TWFzayAmICggMSA8PCBXREFfVFhGTE9XX01HTVQgKSApICkKKyAgICB7CisgICAgICBXREFfVExJX1BST0NFU1NfRlJBTUVfTEVOKCBwVExDYi0+dGxNZ210RnJtQ2xpZW50LnZvc1BlbmRpbmdEYXRhQnVmZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdXNQa3RMZW4sIHVSZXNMZW4sIHVUb3RhbFBrdExlbik7CisKKyAgICAgIGlmICh1c1BrdExlbiA+IFdMQU5UTF9NQVhfQUxMT1dFRF9MRU4pCisgICAgICB7CisgICAgICAgICAgdXNQa3RMZW4gPSBXTEFOVExfTUFYX0FMTE9XRURfTEVOOworICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICB9CisKKyAgICAgIGlmICggKCBwVExDYi0+dVJlc0NvdW50ID4gdVJlc0xlbiApICYmCisgICAgICAgICAgICggdVJlbWFpbmluZyA+IHVUb3RhbFBrdExlbiApICYmCisgICAgICAgICAgICggdUZsb3dNYXNrICYgKCAxIDw8IFdEQV9UWEZMT1dfTUdNVCApICkgKQorICAgICAgeworICAgICAgICBUTExPRzIoVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICJXTEFOIFRMOkNoYWluaW5nIG1hbmFnZW1lbnQgZnJhbWUgb24gR2V0RnJhbWUiKSk7CisKKyAgICAgICAgdm9zX3BrdF9jaGFpbl9wYWNrZXQoIHZvc0RhdGFCdWZmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRMQ2ItPnRsTWdtdEZybUNsaWVudC52b3NQZW5kaW5nRGF0YUJ1ZmYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIC8qdHJ1ZSovICk7CisKKyAgICAgICAgdm9zX2F0b21pY19zZXQoICh1aW50cHRyX3QqKSZwVExDYi0+dGxNZ210RnJtQ2xpZW50LgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc1BlbmRpbmdEYXRhQnVmZiwgKHVpbnRwdHJfdClOVUxMKTsKKworICAgICAgICAvKm1hbmFnZW1lbnQgZnJhbWVzIGNhbm5vdCBiZSBkZWxheWVkKi8KKyAgICAgICAgcFRMQ2ItPmJVcmdlbnQgICAgICA9IFRSVUU7CisKKyAgICAgICAgLypVcGRhdGUgcmVtYWluaW5nIGxlbiBmcm9tIFNTQyAqLworICAgICAgICB1UmVtYWluaW5nICAgICAgICAtPSAodXNQa3RMZW4gKyBXREFfRFhFX0hFQURFUl9TSVpFKTsKKworICAgICAgICAvKlVwZGF0ZSByZXNvdXJjZSBjb3VudCAqLworICAgICAgICBwVExDYi0+dVJlc0NvdW50IC09IHVSZXNMZW47CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgIHVjUmVzdWx0ID0gKCBwVExDYi0+dVJlc0NvdW50ID4gdVJlc0xlbiApP1ZPU19UUlVFOlZPU19GQUxTRTsKKyAgICAgICAgYnJlYWs7IC8qIE91dCBvZiByZXNvdXJjZXMgb3IgcmVhY2hlZCBtYXggbGVuICovCisgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYgKCggcFRMQ2ItPnRsQkFQQ2xpZW50LnZvc1BlbmRpbmdEYXRhQnVmZiApICYmCisgICAgICAgICAgICAgKCBXREFfVExJX01JTl9SRVNfQkFQIDw9IHBUTENiLT51UmVzQ291bnQgKSAmJgorICAgICAgICAgICAgICggMCA9PSBwVExDYi0+dWNUeFN1c3BlbmRlZCApICAgICAgICAgICkKKyAgICB7CisgICAgICBXREFfVExJX1BST0NFU1NfRlJBTUVfTEVOKCBwVExDYi0+dGxCQVBDbGllbnQudm9zUGVuZGluZ0RhdGFCdWZmLAorICAgICAgICAgICAgICAgICAgICAgICAgICB1c1BrdExlbiwgdVJlc0xlbiwgdVRvdGFsUGt0TGVuKTsKKworICAgICAgaWYgKHVzUGt0TGVuID4gV0xBTlRMX01BWF9BTExPV0VEX0xFTikKKyAgICAgIHsKKyAgICAgICAgICB1c1BrdExlbiA9IFdMQU5UTF9NQVhfQUxMT1dFRF9MRU47CisgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIH0KKworICAgICAgaWYgKCAoIHBUTENiLT51UmVzQ291bnQgPiAodVJlc0xlbiArIFdEQV9UTElfTUlOX1JFU19NRiApICkgJiYKKyAgICAgICAgICAgKCB1UmVtYWluaW5nID4gdVRvdGFsUGt0TGVuICkpCisgICAgICB7CisgICAgICAgIFRMTE9HMihWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICAgIldMQU4gVEw6Q2hhaW5pbmcgQlQtQU1QIGZyYW1lIG9uIEdldEZyYW1lIikpOworCisgICAgICAgIHZvc19wa3RfY2hhaW5fcGFja2V0KCB2b3NEYXRhQnVmZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUTENiLT50bEJBUENsaWVudC52b3NQZW5kaW5nRGF0YUJ1ZmYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIC8qdHJ1ZSovICk7CisKKyAgICAgICAgLypCQVAgZnJhbWVzIGNhbm5vdCBiZSBkZWxheWVkKi8KKyAgICAgICAgcFRMQ2ItPmJVcmdlbnQgICAgICA9IFRSVUU7CisKKyAgICAgICAgdm9zX2F0b21pY19zZXQoICh1aW50cHRyX3QqKSZwVExDYi0+dGxCQVBDbGllbnQudm9zUGVuZGluZ0RhdGFCdWZmLAorICAgICAgICAgICAgICAgICAgICAgICAgKHVpbnRwdHJfdCkgTlVMTCk7CisKKyAgICAgICAgLypVcGRhdGUgcmVtYWluaW5nIGxlbiBmcm9tIFNTQyAqLworICAgICAgICB1UmVtYWluaW5nICAgICAgICAtPSAgKHVzUGt0TGVuICsgV0RBX0RYRV9IRUFERVJfU0laRSk7CisKKyAgICAgICAgLypVcGRhdGUgcmVzb3VyY2UgY291bnQgKi8KKyAgICAgICAgcFRMQ2ItPnVSZXNDb3VudCAgLT0gdVJ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gICAgKQorICAgIHsKKyAgICAgICAgdm9zVGVtcEJ1ZiA9IE5VTEw7CisgICAgICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAgICBDaGVjayB0byBzZWUgaWYgdGhlcmUgd2FzIGFueSBFQVBPTCBwYWNrZXQgaXMgcGVuZGluZworICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyAgICAgICAgZm9yICggaSA9IDA7IGkgPCBXTEFOX01BWF9TVEFfQ09VTlQ7IGkrKykKKyAgICAgICAgeworICAgICAgICAgICBpZiAoKE5VTEwgIT0gcFRMQ2ItPmF0bFNUQUNsaWVudHNbaV0pICYmCisgICAgICAgICAgICAgICAocFRMQ2ItPmF0bFNUQUNsaWVudHNbaV0tPnVjRXhpc3RzKSAmJgorICAgICAgICAgICAgICAgKDAgPT0gcFRMQ2ItPmF0bFNUQUNsaWVudHNbaV0tPnVjVHhTdXNwZW5kZWQpICYmCisgICAgICAgICAgICAgICAoV0xBTlRMX1NUQV9DT05ORUNURUQgPT0gcFRMQ2ItPmF0bFNUQUNsaWVudHNbaV0tPnRsU3RhdGUpICYmCisgICAgICAgICAgICAgICAocFRMQ2ItPmF0bFNUQUNsaWVudHNbaV0tPnVjUGt0UGVuZGluZykKKyAgICAgICAgICAgICAgICkKKyAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGkgPj0gV0xBTl9NQVhfU1RBX0NPVU5UKQorICAgICAgICB7CisgICAgICAgICAgIC8qIE5vIE1vcmUgdG8gU2VydmUgRXhpdCBHZXQgRnJhbWVzICovCisgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIC8qIFNlcnZlIEVBUE9MIGZyYW1lIHdpdGggSElfRkxPV19NQVNLICovCisgICAgICAgIHVjU1RBSWQgPSBpOworCisgICAgICAgIHBDbGllbnRTVEEgPSBwVExDYi0+YXRsU1RBQ2xpZW50c1t1Y1NUQUlkXTsKKworICAgICAgICBNVFJBQ0Uodm9zX3RyYWNlKFZPU19NT0RVTEVfSURfVEwsCisgICAgICAgICAgICAgICBUUkFDRV9DT0RFX1RMX0dFVF9GUkFNRVNfRUFQT0wsIHVjU1RBSWQsIHBDbGllbnRTVEEtPnRsU3RhdGUpKTsKKworICAgICAgICBpZiAocENsaWVudFNUQS0+d1NUQURlc2Mud1NUQVR5cGUgPT0gV0xBTl9TVEFfSU5GUkEpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKDAgIT0gcENsaWVudFNUQS0+YXVjQUNNYXNrW1dMQU5UTF9BQ19ISUdIX1BSSU9dKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBwQ2xpZW50U1RBLT51Y0N1cnJlbnRBQyA9IFdMQU5UTF9BQ19ISUdIX1BSSU87CisgICAgICAgICAgICAgIHBUTENiLT51Q3VyU2VydmVkQUMgPSBXTEFOVExfQUNfSElHSF9QUklPOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgZm9yIChqID0gV0xBTlRMX01BWF9BQyA7IGogPiAwOyBqLS0pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmICgwICE9IHBDbGllbnRTVEEtPmF1Y0FDTWFza1tqLTFdKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcENsaWVudFNUQS0+dWNDdXJyZW50QUMgPSBqLTE7CisgICAgICAgICAgICAgICAgcFRMQ2ItPnVDdXJTZXJ2ZWRBQyA9IGotMTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgd1NUQUV2ZW50ID0gV0xBTlRMX1RYX0VWRU5UOworCisgICAgICAgIHBmblNUQUZzbSA9IHRsU1RBRnNtW3BDbGllbnRTVEEtPnRsU3RhdGVdLgorICAgICAgICAgICAgICAgICAgICAgICAgcGZuU1RBVGJsW3dTVEFFdmVudF07CisKKyAgICAgICAgaWYgKCBOVUxMICE9IHBmblNUQUZzbSApCisgICAgICAgIHsKKyAgICAgICAgICBwQ2xpZW50U1RBLT51Y05vTW9yZURhdGEgPSAwOworICAgICAgICAgIHZvc1N0YXR1cyAgPSBwZm5TVEFGc20oIHB2b3NHQ3R4LCB1Y1NUQUlkLCAmdm9zVGVtcEJ1ZiwgVk9TX0ZBTFNFKTsKKworICAgICAgICAgIGlmICgoIFZPU19TVEFUVVNfU1VDQ0VTUyAhPSB2b3NTdGF0dXMgKSAmJgorICAgICAgICAgICAgICAoIE5VTEwgIT0gdm9zVGVtcEJ1ZiApKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHBDbGllbnRTVEEtPnBmblNUQVR4Q29tcCggcHZvc0dDdHgsIHZvc1RlbXBCdWYsIHZvc1N0YXR1cyApOworICAgICAgICAgICAgICAgdm9zVGVtcEJ1ZiA9IE5VTEw7CisgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICB9Lyogc3RhdHVzIHN1Y2Nlc3MqLworICAgICAgICB9CisKKyAgICAgICAgaWYgKE5VTEwgIT0gdm9zVGVtcEJ1ZikKKyAgICAgICAgeworICAgICAgICAgICAgV0RBX1RMSV9QUk9DRVNTX0ZSQU1FX0xFTiggdm9zVGVtcEJ1ZiwgdXNQa3RMZW4sIHVSZXNMZW4sIHVUb3RhbFBrdExlbik7CisKKyAgICAgICAgICAgIGlmICh1c1BrdExlbiA+IFdMQU5UTF9NQVhfQUxMT1dFRF9MRU4pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdXNQa3RMZW4gPSBXTEFOVExfTUFYX0FMTE9XRURfTEVOOworICAgICAgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFRMTE9HNChWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICAgICAgICAgICAiV0xBTiBUTDpSZXNvdXJjZXMgbmVlZGVkIGJ5IGZyYW1lOiAlZCIsIHVSZXNMZW4pKTsKKworICAgICAgICAgICAgaWYgKCAoIHBUTENiLT51UmVzQ291bnQgPj0gKHVSZXNMZW4gKyBXREFfVExJX01JTl9SRVNfTUYgKSApICYmCisgICAgICAgICAgICAgICAoIHVSZW1haW5pbmcgPiB1VG90YWxQa3RMZW4gKQorICAgICAgICAgICAgICAgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBUTExPRzIoVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgIldMQU4gVEw6Q2hhaW5pbmcgZGF0YSBmcmFtZSBvbiBHZXRGcmFtZSIpKTsKKworICAgICAgICAgICAgICB2b3NfcGt0X2NoYWluX3BhY2tldCggdm9zRGF0YUJ1ZmYsIHZvc1RlbXBCdWYsIDEgLyp0cnVlKi8gKTsKKworICAgICAgICAgICAgICAvKkVBUE9MIGZyYW1lIGNhbm5vdCBiZSBkZWxheWVkKi8KKyAgICAgICAgICAgICAgcFRMQ2ItPmJVcmdlbnQgICAgICA9IFRSVUU7CisKKyAgICAgICAgICAgICAgdm9zVGVtcEJ1ZiA9ICBOVUxMOworCisgICAgICAgICAgICAgIC8qVXBkYXRlIHJlbWFpbmluZyBsZW4gZnJvbSBTU0MgKi8KKyAgICAgICAgICAgICAgdVJlbWFpbmluZyAgLT0gKHVzUGt0TGVuICsgV0RBX0RYRV9IRUFERVJfU0laRSk7CisKKyAgICAgICAgICAgICAgIC8qVXBkYXRlIHJlc291cmNlIGNvdW50ICovCisgICAgICAgICAgICAgIHBUTENiLT51UmVzQ291bnQgIC09IHVSZXNMZW47CisKKyAgICAgICAgICAgICAgLy9mb3cgY29udHJvbCB1cGRhdGUKKyAgICAgICAgICAgICAgcENsaWVudFNUQS0+dUluZ3Jlc3NfbGVuZ3RoICs9IHVSZXNMZW47CisgICAgICAgICAgICAgIHBDbGllbnRTVEEtPnVCdWZmVGhyZXNob2xkTWF4ID0gKHBDbGllbnRTVEEtPnVCdWZmVGhyZXNob2xkTWF4ID49IHVSZXNMZW4pID8KKyAgICAgICAgICAgICAgICAocENsaWVudFNUQS0+dUJ1ZmZUaHJlc2hvbGRNYXggLSB1UmVzTGVuKSA6IDA7CisgICAgICAgICAgICAgIHBDbGllbnRTVEEtPnVjRWFwb2xQa3RQZW5kaW5nID0gMDsKKyAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICJXTEFOIFRMOkdldEZyYW1lcyBTVEE6ICVkIEVBUE9MUGt0UGVuZGluZyAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgdWNTVEFJZCwgcENsaWVudFNUQS0+dWNFYXBvbFBrdFBlbmRpbmcpOworICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeyAgLy8gbm8gRUFQT0wgZnJhbWVzIGV4aXQgR2V0IGZyYW1lcworICAgICAgICAgICAgVExMT0cyKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICJXTEFOIFRMOkdldEZyYW1lcyBTVEE6ICVkLCBubyBFQVBPTCBmcmFtZSwgY29udGludWUuIiwKKyAgICAgICAgICAgICAgICAgICB1Y1NUQUlkKSk7CisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICA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VZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiV0xBTiBUTDpDbGllbnQgTWVtb3J5IHdhcyBub3QgYWxsb2NhdGVkIG9uICVzIiwgX19mdW5jX18pKTsKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9CisKKyAgICAgICAgcFRMQ2ItPmF0bFNUQUNsaWVudHNbdWNTVEFJZF0tPnVjTm9Nb3JlRGF0YSA9IDA7CisgICAgICAgIHBDbGllbnRTVEEgPSBwVExDYi0+YXRsU1RBQ2xpZW50c1t1Y1NUQUlkXTsKKworICAgICAgICBUTExPRzIoVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICJXTEFOIFRMOkNoYWluaW5nIGNhY2hlZCBkYXRhIGZyYW1lIG9uIEdldEZyYW1lIikpOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICBXTEFOX1RMR2V0TmV4dFR4SWRzKCBwdm9zR0N0eCwgJnVjU1RBSWQpOworICAgICAgICBpZiAodWNTVEFJZCA+PSBXTEFOX01BWF9TVEFfQ09VTlQpCisgICAgICAgIHsKKyAgICAgICAgIC8qIFBhY2tldHMgc3RhcnQgY29taW5nIGluIGV2ZW4gYWZ0ZXIgaW5zbW9kIFdpdGhvdXQgKgorICAgICAgICAgICAgc3RhcnRpbmcgSG9zdGFwZCBvciBJbnRlcmZhY2UgYmVpbmcgdXAgICAgICAgICAgICAqCisgICAgICAgICAgICBEdXJpbmcgd2hpY2ggY2FzZXMgU1RBSUQgaXMgaW52YWxlZCBhbmQgaGVuY2UgCisgICAgICAgICAgICB0aGUgY2hlY2suIEhhbE1zZ19TY25hQ29tcGxldGUgVHJpZ2dlcnMgKi8KKworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgLyogdWNDdXJyZW50QUMgc2hvdWxkIGhhdmUgY29ycmVjdCBBQyB0byBiZ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1NUQV9JRF9JTlZBTElEKCB1Y1NUQUlkICkgKSAmJgorICAgICAgICAgICAoIDAgPT0gcENsaWVudFNUQS0+dWNUeFN1c3BlbmRlZCApICYmCisgICAgICAgICAgICggMCA9PSBwQ2xpZW50U1RBLT5mY1N0YVR4RGlzYWJsZWQpICkKKyAgICAgICAgeworICAgICAgICAgIFRMTE9HNChWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICAgICAgICAiV0xBTiBUTDogJXMgc3RhIGlkIHZhbGlkIGFuZCBub3Qgc3VzcGVuZGVkICIsX19mdW5jX18pKTsKKyAgICAgICAgICB3U1RBRXZlbnQgPSBXTEFOVExfVFhfRVZFTlQ7CisKKyAgICAgICAgICBwZm5TVEFGc20gPSB0bFNUQUZzbVtwQ2xpZW50U1RBLT50bFN0YXRlXS4KKyAgICAgICAgICAgICAgICAgICAgICAgIHBmblNUQVRibFt3U1RBRXZlbnRdOworCisgICAgICAgICAgaWYgKCBOVUxMICE9IHBmblNUQUZzbSApCisgICAgICAgICAgeworICAgICAgICAgICAgcENsaWVudFNUQS0+dWNOb01vcmVEYXRhID0gMDsKKyAgICAgICAgICAgIHZvc1N0YXR1cyAgPSBwZm5TVEFGc20oIHB2b3NHQ3R4LCB1Y1NUQUlkLCAmdm9zVGVtcEJ1ZiwgVk9TX0ZBTFNFKTsKKworICAgICAgICAgICAgaWYgKCggVk9TX1NUQVRVU19TVUNDRVNTICE9IHZvc1N0YXR1cyApICYmCisgICAgICAgICAgICAgICAgKCBOVUxMICE9IHZvc1RlbXBCdWYgKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgcENsaWVudFNUQS0+cGZuU1RBVHhDb21wKCBwdm9zR0N0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NUZW1wQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc1N0YXR1cyApOworICAgICAgICAgICAgICAgICB2b3NUZW1wQnVmID0gTlVMTDsKKyAgICAgICAgICAgIH0vKiBzdGF0dXMgc3VjY2VzcyovCisgICAgICAgICAgfS8qTlVMTCBmdW5jdGlvbiBzdGF0ZSovCisgICAgICAgIH0vKiB2YWxpZCBTVEEgaWQgYW5kICEgc3VzcGVuZGVkKi8KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgIGlmICggISBXTEFOVExfU1RBX0lEX0lOVkFMSUQoIHVjU1RBSWQgKSApIAorICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVExMT0dFKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIldMQU4gVEw6Tm90IGZldGNoaW5nIGZyYW1lIGJlY2F1c2Ugc3VzcGVuZGVkIGZvciBzdGEgSUQgJWQiLCAKKyAgICAgICAgICAgICAgICAgICB1Y1NUQUlkKSk7CisgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgfS8qIGRhdGEgKi8KKworICAgICAgaWYgKCBOVUxMICE9IHZvc1RlbXBCdWYgKQorICAgICAgeworICAgICAgICBXREFfVExJX1BST0NFU1NfRlJBTUVfTEVOKCB2b3NUZW1wQnVmLCB1c1BrdExlbiwgdVJlc0xlbiwgdVRvdGFsUGt0TGVuKTsKKworICAgICAgICBpZiAodXNQa3RMZW4gPiBXTEFOVExfTUFYX0FMTE9XRURfTEVOKQorICAgICAgICB7CisgICAgICAgICAgICB1c1BrdExlbiA9IFdMQU5UTF9NQVhfQUxMT1dFRF9MRU47CisgICAgICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICB9CisKKyAgICAgICAgVExMT0c0KFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fTE9XLAorICAgICAgICAgICAgICAgICAgIldMQU4gVEw6UmVzb3VyY2VzIG5lZWRlZCBieSBmcmFtZTogJWQiLCB1UmVzTGVuKSk7CisKKyAgICAgICAgaWYgKCAoIHBUTENiLT51UmVzQ291bnQgPj0gKHVSZXNMZW4gKyBXREFfVExJX01JTl9SRVNfQkFQICkgKSAmJgorICAgICAgICAgICAgICggdVJlbWFpbmluZyA+IHVUb3RhbFBrdExlbiApICYmCisgICAgICAgICAgICAgKCB1Rmxvd01hc2sgJiBXTEFOVExfREFUQV9GTE9XX01BU0sgKSApCisgICAgICAgIHsKKyAgICAgICAgICBUTExPRzIoVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAiV0xBTiBUTDpDaGFpbmluZyBkYXRhIGZyYW1lIG9uIEdldEZyYW1lIikpOworCisgICAgICAgICAgdm9zX3BrdF9jaGFpbl9wYWNrZXQoIHZvc0RhdGFCdWZmLCB2b3NUZW1wQnVmLCAxIC8qdHJ1ZSovICk7CisgICAgICAgICAgdm9zVGVtcEJ1ZiA9ICBOVUxMOworCisgICAgICAgICAgLypVcGRhdGUgcmVtYWluaW5nIGxlbiBmcm9tIFNTQyAqLworICAgICAgICAgIHVSZW1haW5pbmcgICAgICAgIC09ICh1c1BrdExlbiArIFdEQV9EWEVfSEVBREVSX1NJWkUpOworCisgICAgICAgICAgIC8qVXBkYXRlIHJlc291cmNlIGNvdW50ICovCisgICAgICAgICAgcFRMQ2ItPnVSZXNDb3VudCAgLT0gdVJlc0xlbjsKKworICAgICAgICAgIC8vZm93IGNvbnRyb2wgdXBkYXRlCisgICAgICAgICAgcENsaWVudFNUQS0+dUluZ3Jlc3NfbGVuZ3RoICs9IHVSZXNMZW47CisgICAgICAgICAgcENsaWVudFNUQS0+dUJ1ZmZUaHJlc2hvbGRNYXggPSAocENsaWVudFNUQS0+dUJ1ZmZUaHJlc2hvbGRNYXggPj0gdVJlc0xlbikgPworICAgICAgICAgICAgKHBDbGllbnRTVEEtPnVCdWZmVGhyZXNob2xkTWF4IC0gdVJlc0xlbikgOiAwOworCisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgLyogU3RvcmUgdGhpcyBmb3IgbGF0ZXIgdHggLSBhbHJlYWR5IGZldGNoZWQgZnJvbSBIREQgKi8KKyAgICAgICAgICBwVExDYi0+dm9zVGVtcEJ1ZiA9IHZvc1RlbXBCdWY7CisgICAgICAgICAgcFRMQ2ItPnVjQ2FjaGVkU1RBSWQgPSB1Y1NUQUlkOworICAgICAgICAgIHBUTENiLT51Y0NhY2hlZEFDICAgID0gdWNBQzsKKyAgICAgICAgICB1Y1Jlc3VsdCA9IHVSZXNMZW4gKyBXREFfVExJX01JTl9SRVNfQkFQOworICAgICAgICAgIFRMTE9HMihWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAibWluICVkIHJlcyByZXF1aXJlZCBieSBUTC4iLCB1Y1Jlc3VsdCApKTsKKyAgICAgICAgICBicmVhazsgLyogT3V0IG9mIHJlc291cmNlcyBvciByZWFjaGVkIG1heCBsZW4gKi8KKyAgICAgICAgfQorICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgICBmb3IgKCBpID0gMDsgaSA8IFdMQU5fTUFYX1NUQV9DT1VOVDsgaSsrKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChOVUxMICE9IHBUTENiLT5hdGxTVEFDbGllbnRzW2ldICYmIChwVExDYi0+YXRsU1RBQ2xpZW50c1tpXS0+dWNFeGlzdHMpICYmCisgICAgICAgICAgICAgICAgICAocFRMQ2ItPmF0bFNUQUNsaWVudHNbaV0tPnVjUGt0UGVuZGluZykpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIFRoZXJlIGlzIHN0YXRpb24gdG8gYmUgU2VydmVkICovCisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICB9CisgICAgICAgICAgIGlmIChpID49IFdMQU5fTUFYX1NUQV9DT1VOVCkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBObyBNb3JlIHRvIFNlcnZlIEV4aXQgR2V0IEZyYW1lcyAqLworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgfQorICAgICAgICAgICBlbHNlCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogTW9yZSB0byBiZSBTZXJ2ZWQgKi8KKyAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgIH0KKyAgICAgICAgfSAKKyAgICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgVExMT0cyKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAiV0xBTiBUTDpSZXR1cm5pbmcgZnJvbSBHZXRGcmFtZTogcmVzb3VyY2VzID0gJWQgc3VzcGVuZGVkID0gJWQiLAorICAgICAgICAgICAgICAgICBwVExDYi0+dVJlc0NvdW50LCBwVExDYi0+dWNUeFN1c3BlbmRlZCkpOworICAgICAgLyogVEwgaXMgc3RhcnZpbmcgZXZlbiB3aGVuIERYRSBpcyBub3QgaW4gbG93IHJlc291cmNlIGNvbmRpdGlvbiAKKyAgICAgICAgIFJldHVybiBtaW4gcmVzb3VyY2UgbnVtYmVyIHJlcXVpcmVkIGFuZCBMZXQgRFhFIGRlY2VpZGUgd2hhdCB0byBkbyAqLworICAgICAgaWYoKCAwID09IHBUTENiLT51Y1R4U3VzcGVuZGVkICkgJiYgCisgICAgICAgICAoIHVGbG93TWFzayAmIFdMQU5UTF9EQVRBX0ZMT1dfTUFTSyApICkKKyAgICAgIHsKKyAgICAgICAgIFRMTE9HMShWT1NfVFJBQ0UoVk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VjUmVzdWx0OworfS8qIFdMQU5UTF9HZXRGcmFtZXMgKi8KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX1R4Q29tcAorCisgIERFU0NSSVBUSU9OCisgICAgSXQgaXMgYmVpbmcgY2FsbGVkIGJ5IEJBTCB1cG9uIGFzeW5jaHJvbm91cyBub3RpZmljYXRpb24gb2YgdGhlIHBhY2tldAorICAgIG9yIHBhY2tldHMgIGJlaW5nIHNlbnQgb3ZlciB0aGUgYnVzLgorCisgIERFUEVOREVOQ0lFUworICAgIFR4IGNvbXBsZXRlIGNhbm5vdCBiZSBjYWxsZWQgd2l0aG91dCBhIHByZXZpb3VzIHRyYW5zbWl0LgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgICBvciBCQUwncyBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICAgIHZvc0RhdGFCdWZmOiAgIGl0IHdpbGwgY29udGFpbiBhIHBvaW50ZXIgdG8gdGhlIGZpcnN0IGJ1ZmZlciBmb3Igd2hpY2gKKyAgICAgICAgICAgICAgICAgICAgdGhlIEJBTCByZXBvcnQgaXMgYmVpbmcgbWFkZSwgaWYgdGhlcmUgaXMgbW9yZSB0aGVuIG9uZQorICAgICAgICAgICAgICAgICAgICBwYWNrZXQgdGhleSB3aWxsIGJlIGNoYWluZWQgdXNpbmcgdk9TUyBidWZmZXJzLgorICAgIHdUeFN0YXR1czogICAgICB0aGUgc3RhdHVzIG9mIHRoZSB0cmFuc21pdHRlZCBwYWNrZXQsIHNlZSBhYm92ZSBjaGFwdGVyCisgICAgICAgICAgIC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b3IgcGt0ICVwIGluIGZ1bmN0aW9uICVwIiwKKyAgICAgICAgICAgICAgIHZvc0RhdGFCdWZmLCBwZm5UeENvbXApKTsKKworICAgIHZvc1RlbXBUeCA9IHZvc0RhdGFCdWZmOworICAgIHZvc1N0YXR1cyA9IHZvc19wa3Rfd2Fsa19wYWNrZXRfY2hhaW4oIHZvc0RhdGFCdWZmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ2b3NEYXRhQnVmZiwgMS8qdHJ1ZSovKTsKKworICAgIHBmblR4Q29tcCggcHZvc0dDdHgsIHZvc1RlbXBUeCwgd1R4U3RhdHVzICk7CisKKyAgICBwVExDYi0+dXNQZW5kaW5nVHhDb21wbGV0ZUNvdW50LS07CisgIH0KKworIAorICBUTExPRzIoVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgIldMQU4gVEw6IGN1cnJlbnQgVEwgdmFsdWVzIGFyZTogcmVzb3VyY2VzID0gJWQgIgorICAgICAgICAgICAgInBUTENiLT51c1BlbmRpbmdUeENvbXBsZXRlQ291bnQgPSAlZCIsCisgICAgICAgICAgICAgIHBUTENiLT51UmVzQ291bnQsIHBUTENiLT51c1BlbmRpbmdUeENvbXBsZXRlQ291bnQpKTsKKworICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfS8qIFdMQU5UTF9UeENvbXAgKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5UTF9DYWNoZVNUQUZyYW1lCisKKyAgREVTQ1JJUFRJT04KKyAgICBJbnRlcm5hbCB1dGlsaXR5IGZ1bmN0aW9uIGZvciBmb3IgY2FjaGluZyBpbmNvbWluZyBkYXRhIGZyYW1lcyB0aGF0IGRvIAorICAgIG5vdCB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PU19TVEFUVVNfU1VDQ0VTUzogICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitzdGF0aWMgVk9TX1NUQVRVUworV0xBTlRMX0NhY2hlU1RBRnJhbWUKKygKKyAgV0xBTlRMX0NiVHlwZSogICAgcFRMQ2IsCisgIHZfVThfdCAgICAgICAgICAgIHVjU1RBSWQsCisgIHZvc19wa3RfdCogICAgICAgIHZvc1RlbXBCdWZmLAorICB2X1UzMl90ICAgICAgICAgICB1RFBVU2lnLAorICB2X1U4X3QgICAgICAgICAgICBiQmNhc3QsCisgIHZfVThfdCAgICAgICAgICAgIHVjRnJtVHlwZQorKQoreworICB2X1U4X3QgICAgdWNVY2FzdFNpZzsKKyAgdl9VOF90ICAgIHVjQmNhc3RTaWc7CisgIHZfQk9PTF90ICBiT2xkU1RBUGt0OworICBXTEFOVExfU1RBQ2xpZW50VHlwZSogcENsaWVudFNUQSA9IE5VTEw7CisgIC8qLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtICovCisKKyAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICAKKyAgICAgU2FuaXR5IGNoZWNrIAorICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovIAorICBpZiAoKCBOVUxMID09IHBUTENiICkgfHwgKCBOVUxMID09IHZvc1RlbXBCdWZmICkgKQorICB7CisgICAgVExMT0dFKFZPU19UUkFDRSggVk9TX01PRFVMRV9JR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UgPQorICAgICAgICAgICAgICBwQ2xpZW50U1RBLT50bENhY2hlSW5mby5jYWNoZUluaXRUaW1lOworICAgICAgcENsaWVudFNUQS0+dGxDYWNoZUluZm8uY2FjaGVTaXplID0gMTsKKworICAgICAgTVRSQUNFKHZvc190cmFjZShWT1NfTU9EVUxFX0lEX1RMLCBUUkFDRV9DT0RFX1RMX0NBQ0hFX0ZSQU1FLAorICAgICAgICAgICAgICAgICAgICAgICB1Y1NUQUlkLCBwQ2xpZW50U1RBLT50bENhY2hlSW5mby5jYWNoZVNpemUpKTsKKworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgLyp0aGlzIGlzIGEgc3Vic2VxdWVudCBmcmFtZSB0aGF0IHdlIGFyZSBjYWNoaW5nOiBjaGFpbiB0byB0aGUgZW5kICovCisgICAgICB2b3NfcGt0X2NoYWluX3BhY2tldChwQ2xpZW50U1RBLT52b3NFbmRDYWNoZWRGcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc1RlbXBCdWZmLCBWT1NfVFJVRSk7CisKKyAgICAgIHBDbGllbnRTVEEtPnRsQ2FjaGVJbmZvLmNhY2hlRG9uZVRpbWUgPSB2b3NfdGltZXJfZ2V0X3N5c3RlbV90aW1lKCk7CisgICAgICBwQ2xpZW50U1RBLT50bENhY2hlSW5mby5jYWNoZVNpemUgKys7CisKKyAgICAgIGlmIChwQ2xpZW50U1RBLT50bENhY2hlSW5mby5jYWNoZVNpemUgJSBXTEFOVExfQ0FDSEVfVFJBQ0VfV0FURVJNQVJLID09IDApCisgICAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IENhY2hlIEhpZ2ggd2F0ZXJtYXJrIGZvciBzdGFpZDolZCAoJWQpIiwKKyAgICAgICAgICAgICAgICAgIF9fZnVuY19fLHVjU1RBSWQsIHBDbGllbnRTVEEtPnR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QU1FVEVSUworCisgICAgSU4KKyAgICAKKyAgICBwdkJESGVhZGVyOiAgICAgICAgICAgICBwb2ludGVyIHRvIHRoZSBCRCBoZWFkZXIKKyAgICB2b3NUZW1wQnVmZjogICAgICAgICAgICB0aGUgZGF0YSBwYWNrZXQKKyAgICBwVExDYjogICAgICAgICAgICAgICAgICBUTCBjb250cm9sIGJsb2NrCisgICAgdWNTVEFJZDogICAgICAgICAgICAgICAgc3RhdGlvbiBpZAorCisgICAgSU4vT1VUCisgICAgcEZpcnN0RGF0YVBrdEFycml2ZWQ6ICAgc3RhdGljIGZyb20gY2FsbGVyIGZ1bmN0aW9uOyB1c2VkIGZvciByc3NpIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbXB1dGF0aW9uCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uCisKKyAgICBWT1NfU1RBVFVTX0VfSU5WQUw6ICAgSW5wdXQgcGFyYW1ldGVycyBhcmUgaW52YWxpZAorICAgIFZPU19TVEFUVVNfRV9GQVVMVDogICBwb2ludGVyIHRvIFRMIGNiIGlzIE5VTEwgOyBhY2Nlc3Mgd291bGQgY2F1c2UgYQorICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlIGZhdWx0CisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZfQk9PTF90CitXTEFOVExfUHJvY2Vzc0JBUEZyYW1lCisoCisgIHZfUFZPSURfdCAgICAgICAgIHB2QkRIZWFkZXIsCisgIHZvc19wa3RfdCogICAgICAgIHZvc1RlbXBCdWZmLAorICBXTEFOVExfQ2JUeXBlKiAgICBwVExD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QgcmVjZWl2ZWQgb3ZlciBCVC1BTVAgbGluazogU2VuZGluZyBpdCBmb3IgIgorICAgICAgICAgICJmcmFtZSBUcmFuc2xhdGlvbiIpKTsKKworICAgICAgaWYgKHVzTVBEVURPZmZzZXQgPiB1Y01QRFVIT2Zmc2V0KQorICAgICAgeworICAgICAgICB1c0FjdHVhbEhMZW4gPSB1c01QRFVET2Zmc2V0IC0gdWNNUERVSE9mZnNldDsKKyAgICAgIH0KKworICAgICAgLyogc29mdHdhcmUgZnJhbWUgdHJhbnNsYXRpb24gZm9yIEJUQU1QIFdEUy4qLworICAgICAgV0xBTlRMX1RyYW5zbGF0ZTgwMjExVG84MDIzSGVhZGVyKCB2b3NUZW1wQnVmZiwgJnZvc1N0YXR1cywgdXNBY3R1YWxITGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1Y01QRFVITGVuLCBwVExDYix1Y1NUQUlkLCBWT1NfRkFMU0UpOworICAgICAgCisgICAgfQorICAgIGlmIChwVExDYi0+dGxCQVBDbGllbnQucGZuVGxCQVBSeCkKKyAgICAgICAgcFRMQ2ItPnRsQkFQQ2xpZW50LnBmblRsQkFQUngoIHZvc19nZXRfZ2xvYmFsX2NvbnRleHQoVk9TX01PRFVMRV9JRF9UTCxwVExDYiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NUZW1wQnVmZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXTEFOVExfQkFQRnJhbWVFbnVtVHlwZSl1c1R5cGUgKTsKKyAgICBlbHNlCisgICAgeworICAgICAgICBWT1NfQVNTRVJUKDApOworICAgIH0KKworICAgIHJldHVybiBWT1NfVFJVRTsKKyAgfQorICBlbHNlCisgIHsKKyAgICBUTExPRzIoVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgIldMQU4gVEw6IEJBUCB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VF9SU1NJX0FWRVJBR0UoIHB2QkRIZWFkZXIgKSArIAorICAgICAgICAgICBwVExDYi0+YXRsU1RBQ2xpZW50c1t1Y1NUQUlkXS5yc3NpQXZnKS8yOworICAgICAgcFRMQ2ItPmF0bFNUQUNsaWVudHNbdWNTVEFJZF0udUxpbmtRdWFsaXR5QXZnID0KKyAgICAgICAgICAoV0xBTkhBTF9SWF9CRF9HRVRfU05SKCBwdkJESGVhZGVyICkgKyAgCisgICAgICAgICAgIHBUTENiLT5hdGxTVEFDbGllbnRzW3VjU1RBSWRdLnVMaW5rUXVhbGl0eUF2ZykvMjsKKyAgICB9LypFbHNlLCBmaXJzdCBkYXRhIHBhY2tldCovCisgI2VuZGlmCisgIH0vKkJULUFNUCBkYXRhIHBhY2tldCovCisKKyAgcmV0dXJuIFZPU19GQUxTRTsgCit9LypXTEFOVExfUHJvY2Vzc0JBUEZyYW1lKi8KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX1Byb2Nlc3NGQ0ZyYW1lCisKKyAgREVTQ1JJUFRJT04KKyAgICBJbnRlcm5hbCB1dGlsaXR5IGZ1bmN0aW9uIGZvciBwcm9jZXNzaW5nIGluY29taW5nIEZsb3cgQ29udHJvbCBmcmFtZXMuIEVuYWJsZQorICAgIG9yIGRpc2FibGUgTFdNIG1vZGUgYmFzZWQgb24gdGhlIGluZm9ybWF0aW9uLgorCisgIERFUEVOREVOQ0lFUworICAgIFRMIG11c3QgYmUgaW5pdGlhaWxpemVkIGJlZm9yZSB0aGlzIGZ1bmN0aW9uIGdldHMgY2FsbGVkLgorICAgIEZXIHNlbmRzIHVwIHNwZWNpYWwgZmxvdyBjb250cm9sIGZyYW1lLgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcHZvc0dDdHggICAgICAgICAgICAgICAgcG9pbnRlciB0byB2b3MgZ2xvYmFsIGNvbnRleHQKKyAgICBwdkJESGVhZGVyOiAgICAgICAgICAgICBwb2ludGVyIHRvIHRoZSBCRCBoZWFkZXIKKyAgICBwVExDYjogICAgICAgICAgICAgICAgICBUTCBjb250cm9sIGJsb2NrCisgICAgcHZCREhlYWRlciAgICAgICAgICAgICAgcG9pbnRlciB0byBCRCBoZWFkZXIuCisKKyAgICBJTi9PVVQKKyAgICBwRmlyc3REYXRhUGt0QXJyaXZlZDogICBzdGF0aWMgZnJvbSBjYWxsZXIgZnVuY3Rpb247IHVzZWQgZm9yIHJzc2kgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcHV0YXRpb24KKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICAgIFZPU19TVEFUVVNfRV9JTlZBTDogICBJbnB1dCBmcmFtZSBhcmUgaW52YWxpZAorICAgIFZPU19TVEFUVVNfRV9GQVVMVDogICBwb2ludGVyIHRvIFRMIGNiIGlzIE5VTEwgOyBhY2Nlc3Mgd291bGQgY2F1c2UgYQorICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlIGZhdWx0CisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisgIFNJREUgRUZGRUNUUworICAgIFRoZSBpbmdyZXNzIGFuZCBlZ3Jlc3Mgb2YgZWFjaCBzdGF0aW9uIHdpbGwgYmUgdXBkYXRlZC4gSWYgbmVlZGVkLCBMV00gbW9kZSB3aWxsCisgICAgYmUgZW5hYmxlZCBvciBkaXNhYmxlZCBiYXNlZCBvbiB0aGUgZmxvdyBjb250cm9sIGFsZ29yaXRobS4KKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2X0JPT0xfdAorV0xBTl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bGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgICBvciBCQUwncyBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorCisgICAgdm9zRGF0YUJ1ZmY6ICAgaXQgd2lsbCBjb250YWluIGEgcG9pbnRlciB0byB0aGUgZmlyc3QgYnVmZmVyIHJlY2VpdmVkLAorICAgICAgICAgICAgICAgICAgICBpZiB0aGVyZSBpcyBtb3JlIHRoZW4gb25lIHBhY2tldCB0aGV5IHdpbGwgYmUgY2hhaW5lZAorICAgICAgICAgICAgICAgICAgICB1c2luZyB2T1NTIGJ1ZmZlcnMuCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICAgIFZPU19TVEFUVVNfRV9JTlZBTDogICBJbnB1dCBwYXJhbWV0ZXJzIGFyZSBpbnZhbGlkCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgIHBvaW50ZXIgdG8gVEwgY2IgaXMgTlVMTCA7IGFjY2VzcyB3b3VsZCBjYXVzZSBhCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2UgZmF1bHQKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICAgRXZlcnl0aGluZyBpcyBnb29kIDopCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlRMX1J4RnJhbWVzCisoCisgIHZfUFZPSURfdCAgICAgIHB2b3NHQ3R4LAorICB2b3NfcGt0X3QgICAgICpwRnJhbWVEYXRhQnVmZgorKQoreworICB2b3NfcGt0X3QqICAgICAgICAgIHZvc0RhdGFCdWZmID0gKHZvc19wa3RfdCopcEZyYW1lRGF0YUJ1ZmY7CisgI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AgICAgLyogUmVhZCBSU1NJIGFuZCB1cGRhdGUgKi8KKyAgICAgIGlmKCFXTEFOVExfU1RBX0lEX0lOVkFMSUQodWNTVEFJZCkpCisgICAgICB7CisjaWYgZGVmaW5lZCBXTEFOX0ZFQVRVUkVfTkVJR0hCT1JfUk9BTUlORworICAgICAgICAvKiBSZWFkIFJTU0kgYW5kIHVwZGF0ZSAqLworICAgICAgICB2b3NTdGF0dXMgPSBXTEFOVExfSFNIYW5kbGVSWEZyYW1lKHB2b3NHQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9NR01UX0ZSQU1FX1RZUEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHZCREhlYWRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1Y1NUQUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19GQUxTRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMKTsKKyNlbHNlCisgICAgICAgIHZvc1N0YXR1cyA9IFdMQU5UTF9SZWFkUlNTSShwdm9zR0N0eCwgcHZCREhlYWRlciwgdWNTVEFJZCk7CisjZW5kaWYKKyAgICAgICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zU3RhdHVzKSkKKyAgICAgICAgeworICAgICAgICAgIFRMTE9HVyhWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiSGFuZGxlIFJYIE1hbmFnZW1lbnQgRnJhbWUgZmFpbCB3aXRoaW4gSGFuZG9mZiAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAic3VwcG9ydCBtb2R1bGUiKSk7CisgICAgICAgICAgLyogRG8gTm90IERyb3AgcGFja2V0IGF0IGhlcmUKKyAgICAgICAgICAgKiBSZXZpc2l0IHdoeSBITyBtb2R1bGUgcmV0dXJuIGZhaWwKKyAgICAgICAgICAgKiAgIHZvc19wa3RfcmV0dXJuX3BhY2tldCh2b3NUZW1wQnVmZik7CisgICAgICAgICAgICogICB2b3NUZW1wQnVmZiA9IHZvc0RhdGFCdWZmOworICAgICAgICAgICAqICAgY29udGludWU7CisgICAgICAgICAgICovCisgICAgICAgIH0KKyAgICAgICAgdm9zU3RhdHVzID0gV0xBTlRMX1JlYWRTTlIocHZvc0dDdHgsIHB2QkRIZWFkZXIsIHVjU1RBSWQpOworCisgICAgICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpCisgICAgICAgIHsKKyAgICAgICAgICBUTExPR1coVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZMKCJGYWlsZWQgdG8gUmVhZCBTTlIiKSkpOworICAgICAgICB9CisjaWZkZWYgV0xBTl9GRUFUVVJFX0xJTktfTEFZRVJfU1RBVFMKKyAgICAgICAgcENsaWVudFNUQSA9IHBUTENiLT5hdGxTVEFDbGllbnRzW3VjU1RBSWRdOworICAgICAgICBpZiAoIE5VTEwgIT0gcENsaWVudFNUQSkKKyAgICAgICAgeworICAgICAgICAgICAgcENsaWVudFNUQS0+aW50ZXJmYWNlU3RhdHMubWdtdFJ4Kys7CisgICAgICAgIH0KKyNlbmRpZgorICAgICAgfQorCisgICAgICBwVExDYi0+dGxNZ210RnJtQ2xpZW50LnBmblRsTWdtdEZybVJ4KCBwdm9zR0N0eCwgdm9zVGVtcEJ1ZmYpOyAKKyAgICB9CisgICAgZWxzZSAvKiBEYXRhIEZyYW1lICovCisgICAgeworICAgICAgdWNTVEFJZCA9ICh2X1U4X3QpV0RBX0dFVF9SWF9TVEFJRCggcHZCREhlYWRlciApOworICAgICAgdWNUaWQgICA9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IFRMTE9HVyhWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICJXTEFOIFRMOlNUQSBub3QgYWxsb2NhdGVkIG1lbW9yeS4gRHJvcHBpbmcgcGFja2V0IikpOworICAgICAgICAgIHZvc19wa3RfcmV0dXJuX3BhY2tldCh2b3NUZW1wQnVmZik7CisgICAgICAgICAgdm9zVGVtcEJ1ZmYgPSB2b3NEYXRhQnVmZjsKKyAgICAgICAgICBjb250aW51ZTsKKyAgICAgIH0KKworI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgICAgICBpZiAoKCBwQ2xpZW50U1RBLT51Y0V4aXN0cyApICYmCisgICAgICAgICAgIChXTEFOX1NUQV9URExTID09IHBDbGllbnRTVEEtPndTVEFEZXNjLndTVEFUeXBlKSAmJgorICAgICAgICAgICAocENsaWVudFNUQS0+dWNUeFN1c3BlbmRlZCkpCisgICAgICAgICAgdm9zX2F0b21pY19zZXRfVTgoICZwQ2xpZW50U1RBLT51Y1R4U3VzcGVuZGVkLCAwICk7CisgICAgICBlbHNlIGlmICggIWJyb2FkY2FzdCAmJiAocENsaWVudFNUQS0+dWNFeGlzdHMgPT0gMCApICkKKyAgICAgIHsKKyAgICAgICAgICB0cFNpck1hY01nbXRIZHIgcE1hY0hlYWRlciA9IFdEQV9HRVRfUlhfTUFDX0hFQURFUiggcHZCREhlYWRlciApOworCisgICAgICAgICAgLyogZnJvbSB0aGUgZGlyZWN0IHBlZXIgd2hpbGUgaXQgaXMgbm90IHJlZ2lzdGVyZWQgdG8gVEwgeWV0ICovCisgICAgICAgICAgaWYgKCAocE1hY0hlYWRlci0+ZmMuZnJvbURTID09IDApICYmCisgICAgICAgICAgICAgICAocE1hY0hlYWRlci0+ZmMudG9EUyA9PSAwKSApCisgICAgICAgICAgeworICAgICAgICAgICAgICB2X1U4X3QgdWNBZGRyM1NUQUlkOworCisgICAgICAgICAgICAgIHVjQWRkcjNTVEFJZCA9IFdEQV9HRVRfUlhfQUREUjNfSURYKHB2QkRIZWFkZXIpOworCisgICAgICAgICAgICAgIGlmICggV0xBTlRMX1NUQV9JRF9JTlZBTElEKHVjQWRkcjNTVEFJZCkgKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVExMT0dXKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiV0xBTiBUTDpTVEEgSUQgJWQgaW52YWxpZCAtIGRyb3BwaW5nIHBrdCIsIHVjQWRkcjNTVEFJZCkpOworICAgICAgICAgICAgICAgIC8qIERyb3AgcGFja2V0ICovCisgICAgICAgICAgICAgICAgdm9zX3BrdF9yZXR1cm5fcGFja2V0KHZvc1RlbXBCdWZmKTsKKyAgICAgICAgICAgICAgICB2b3NUZW1wQnVmZiA9IHZvc0RhdGFCdWZmOworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgaWYgKCEocFRMQ2ItPmF0bFNUQUNsaWVudHNbdWNBZGRyM1NUQUlkXSAmJiBwVExDYi0+YXRsU1RBQ2xpZW50c1t1Y0FkZHIzU1RBSWRdLT51Y0V4aXN0cyAmJgorICAgICAgICAgICAgICAgICAgKFdMQU5fU1RBX0lORlJBID09IHBUTENiLT5hdGxTVEFDbGllbnRzW3VjQWRkcjNTVEFJZF0tPndTVEFEZXNjLndTVEFUeXBlKSAmJgorICAgICAgICAgICAgICAgICAgKFdMQU5UTF9TVEFfQVVUSEVOVElDQVRFRCA9PSBwVExDYi0+YXRsU1RBQ2xpZW50c1t1Y0FkZHIzU1RBSWRdLT50bFN0YXRlKSkpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIFRMTE9HVyhWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBzdGFJZCAlZCBhZGRyM0lkICVkIHRsU3RhdGUgJWQuIFVua293biBSZWNlaXZlci9UcmFuc21pdHRlciBEcm9wcGluZyBwYWNrZXQiLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHVjU1RBSWQsIHVjQWRkcjNTVEFJZCwgcFRMQ2ItPmF0bFNUQUNsaWVudHNbdWNBZGRyM1NUQUlkXS0+dGxTdGF0ZSkpOworICAgICAgICAgICAgICAgICAgdm9zX3BrdF9yZXR1cm5fcGFja2V0KHZvc1RlbXBCdWZmKTsKKyAgICAgICAgICAgICAgICAgIHZvc1RlbXBCdWZmID0gdm9zRGF0YUJ1ZmY7CisgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIFRMTE9HVyhWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBzdGFJZCAlZCBkb2Vzbid0IGV4aXN0LCBidXQgbWFwcGVkIHRvIEFQIHN0YUlkICVkIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgICAgICAgICAgICB1Y1NUQUlkLCB1Y0FkZHIzU1RBSWQpKTsKKyAgICAgICAgICAgICAgICAgIHVjU1RBSWQgPSB1Y0FkZHIzU1RBSWQ7CisgICAgICAgICAgICAgICAgICBwQ2xpZW50U1RBID0gcFRMQ2ItPmF0bFNUQUNsaWVudHNbdWNBZGRyM1NUQUlkXTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgIH0KKyNlbmRpZgorCisgICAgICBpZiAoKCBwQ2xpZW50U1RBLT5lbmFibGVDYWNoaW5nID09IDEgKSAmJgorICAgICAgICAgICAgLypEb250IGJ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WT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAiV0xBTiBUTDpDYW5ub3QgZmxhdHRlbiBwYWNrZXQgLSBkcm9wcGluZyIpKTsKKyAgICAgICAgICAgICAgIC8qIERyb3AgcGFja2V0ICovCisgICAgICAgICAgICAgICB2b3NfcGt0X3JldHVybl9wYWNrZXQodm9zVGVtcEJ1ZmYpOworICAgICAgICAgICAgfSBlbHNlIHsKKworICAgICAgICAgICAgICAgVExMT0dFKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAiV0xBTiBUTDogUmVjZWl2ZWQgRVNFIElBUFAgRnJhbWUiKSk7CisKKyAgICAgICAgICAgICAgIHBUTENiLT50bE1nbXRGcm1DbGllbnQucGZuVGxNZ210RnJtUngoIHB2b3NHQ3R4LCB2b3NUZW1wQnVmZik7IAorICAgICAgICAgICAgfQorICAgICAgICAgICAgdm9zVGVtcEJ1ZmYgPSB2b3NEYXRhQnVmZjsKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9CisgICAgICB9CisjZW5kaWYgIC8qIGRlZmluZWQoRkVBVFVSRV9XTEFOX0VTRSkgJiYgIWRlZmluZWQoRkVBVFVSRV9XTEFOX0VTRV9VUExPQUQpICovCisKKyAgICAgIGlmICggV0xBTl9TVEFfQlRfQU1QID09IHBDbGllbnRTVEEtPndTVEFEZXNjLndTVEFUeXBlICkKKyAgICAgIHsKKyAgICAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgICAgIFByb2Nlc3MgdGhlIGN0cmwgQkFQIGZyYW1lOyBpZiBkYXRhIGl0IHdpbGwgcmV0dXJuIGZhbHNlIGFuZCBpdCAKKyAgICAgICAgICB3aWxsIGJlIHJvdXRlZCB0aHJvdWdoIHRoZSByZWd1bGFyIGRhdGEgcGF0aAorICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisgICAgICAgIGlmICggV0xBTlRMX1Byb2Nlc3NCQVBGcmFtZSggcHZCREhlYWRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NUZW1wQnVmZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVExDYiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZmaXJzdF9kYXRhX3BrdF9hcnJpdmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVjU1RBSWQpKQorICAgICAgICB7CisgICAgICAgICAgdm9zVGVtcEJ1ZmYgPSB2b3NEYXRhQnVmZjsKKyAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorICAgICAgfS8qaWYgQlQtQU1QIHN0YXRpb24qLworICAgICAgZWxzZSBpZihzZWxmQmNhc3RMb29wYmFjayA9PSBWT1NfVFJVRSkKKyAgICAgIHsgCisgICAgICAgIC8qIERyb3AgcGFja2V0ICovIAorICAgICAgICB2b3NfcGt0X3JldHVybl9wYWNrZXQodm9zVGVtcEJ1ZmYpOyAKKyAgICAgICAgdm9zVGVtcEJ1ZmYgPSB2b3NEYXRhQnVmZjsgCisgICAgICAgIGNvbnRpbnVlOyAKKyAgICAgIH0gCisgICAgICAKKyAgICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAgIERhdGEgcGFja2V0IHJlY2VpdmVkLCBzZW5kIHRvIHN0YXRlIG1hY2hpbmUKKyAgICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisgICAgICB3U1RBRXZlbnQgPSBXTEFOVExfUlhfRVZFTlQ7CisKKyAgICAgIHBmblNUQUZzbSA9IHRsU1RBRnNtW3BDbGllbnRTVEEtPnRsU3RhdGVdLgorICAgICAgICAgICAgICAgICAgICAgIHBmblNUQVRibFt3U1RBRXZlbnRdOworCisgICAgICBpZiAoIE5VTEwgIT0gcGZuU1RBRnNtICkKKyAgICAgIHsKKyNpZiBkZWZpbmVkIFdMQU5fRkVBVFVSRV9ORUlHSEJPUl9ST0FNSU5HCisgICAgICAgIC8qIFJlYWQgUlNTSSBhbmQgdXBkYXRlICovCisgICAgICAgIHZvc1N0YXR1cyA9IFdMQU5UTF9IU0hhbmRsZVJYRnJhbWUocHZvc0dDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX0RBVEFfRlJBTUVfVFlQRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdkJESGVhZGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVjU1RBSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJvYWRjYXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc1RlbXBCdWZmKTsKKyAgICAgICAgYnJvYWRjYXN0ID0gVk9TX0ZBTFNFOworI2Vsc2UKKyAgICAgICAgdm9zU3RhdHVzID0gV0xBTlRMX1JlYWRSU1NJKHB2b3NHQ3R4LCBwdkJESGVhZGVyLCB1Y1NUQUlkKTsKKyNlbmRpZgorICAgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICAgICAgICB7CisgICAgICAgICAgVExMT0dXKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAiSGFuZGxlIFJYIERhdGEgRnJhbWUgZmFpbCB3aXRoaW4gSGFuZG9mZiBzdXBwb3J0IG1vZHVsZSIpKTsKKyAgICAgICAgICAvKiBEbyBOb3QgRHJvcCBwYWNrZXQgYXQgaGVyZSAKKyAgICAgICAgICAgKiBSZXZpc2l0IHdoeSBITyBtb2R1bGUgcmV0dXJuIGZhaWwKKyAgICAgICAgICAgKiB2b3NfcGt0X3JldHVybl9wYWNrZXQodm9zVGVtcEJ1ZmYpOworICAgICAgICAgICAqIHZvc1RlbXBCdWZmID0gdm9zRGF0YUJ1ZmY7CisgICAgICAgICAgICogY29udGludWU7CisgICAgICAgICAgICovCisgICAgICAgIH0KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfTElOS19MQVlFUl9TVEFUUworICAgICAgICBwQ2xpZW50U1RBID0gcFRMQ2ItPmF0bFNUQUNsaWVudHNbdWNTVEFJZF07CisgICAgICAgIGlmICggTlVMTCAhPSBwQ2xpZW50U1RBKQorICAgICAgICB7CisgICAgICAgICAgICB0cFNpck1hY01nbXRIZHIgcE1hY0hlYWRlciA9IFdEQV9HRVRfUlhfTUFDX0hFQURFUiggcHZCREhlYWRlciApOworICAgICAgICAgICAgaWYgKCFJU19CUk9BRENBU1RfQUREKHBNYWNIZWFkZXItPmRhKSAmJiBJU19NVUxUSUNBU1RfQUREKHBNYWNIZWFkZXItPmRhKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwQ2xpZW50U1RBLT5pbnRlcmZhY2VTdGF0cy5hY2Nlc3NDYXRlZ29yeVN0YXRzW2FjXS5yeE1jYXN0Kys7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFdMQU5UTF9IU0dldERhdGFSU1NJKHB2b3NHQ3R4LCBwdkJESGVhZGVyLCB1Y1NUQUlkLAorICAgICAgICAgICAgICAgICAgICAmY3VycmVudEF2Z1JTU0kpOworICAgICAgICAgICAgcENsaWVudFNUQS0+aW50ZXJmYWNlU3RhdHMucnNzaURhdGEgPSBjdXJyZW50QXZnUlNTSTsKKworICAgICAgICAgICAgcENsaWVudFNUQS0+aW50ZXJmYWNlU3RhdHMuYWNjZXNzQ2F0ZWdvcnlTdGF0c1thY10ucnhNcGR1Kys7CisgICAgICAgICAgICBpZiAoV0RBX0lTX1JYX0FOX0FNUERVIChwdkJESGVhZGVyKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwQ2xpZW50U1RBLT5pbnRlcmZhY2VTdGF0cy5hY2Nlc3NDYXRlZ29yeVN0YXRzW2FjXS5yeEFtcGR1Kys7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworCisjZW5kaWYKKyAgICAgICAgdm9zU3RhdHVzID0gV0xBTlRMX1JlYWRTTlIocHZvc0dDdHgsIHB2QkRIZWFkZXIsIHVjU1RBSWQpOworCisgICAgICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpCisgICAgICAgIHsKKyAgICAgICAgICBUTExPR1coVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkZhaWxlZCB0byBSZWFkIFNOUiIpKSk7CisgICAgICAgIH0KKworICAgICAgICBwZm5TVEFGc20oIHB2b3NHQ3R4LCB1Y1NUQUlkLCAmdm9zVGVtcEJ1ZmYsIGJGb3J3YXJkSUFQUHdpdGhMTEMpOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgVExMT0dXKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAiV0xBTiBUTDpOVUxMIHN0YXRlIGZ1bmN0aW9uLCBTVEE6JWQsIFN0YXRlOiAlZC0gZHJvcHBpbmcgcGFja2V0IiwKKyAgICAgICAgICAgICAgICAgICB1Y1NUQUlkLCBwQ2xpZW50U1RBLT50bFN0YXRlKSk7CisgICAgICAgICAgLyogRHJvcCBwYWNrZXQgKi8KKyAgICAgICAgICB2b3NfcGt0X3JldHVybl9wYWNrZXQodm9zVGVtcEJ1ZmYpOworICAgICAgICAgIHZvc1RlbXBCdWZmID0gdm9zRGF0YUJ1ZmY7CisgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKyAgICB9LyogZWxzZSBkYXRhIGZyYW1lKi8KKworICAgIHZvc1RlbXBCdWZmID0gdm9zRGF0YUJ1ZmY7CisgIH0vKndoaWxlIGNoYWluKi8KKworICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfS8qIFdMQU5UTF9SeEZyYW1lcyAqLworCisjaWZkZWYgV0xBTl9GRUFUVVJFX0xJTktfTEFZRVJfU1RBVFMKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfQ29sbGVjdEludGVyZmFjZVN0YXRzCisKKyAgREVTQ1JJUFRJT04KKyAgICBVdGlsaXR5IGZ1bmN0aW9uIHVzZWQgYnkgVEwgdG8gc2VuZCB0aGUgc3RhdGl0aWNzCisKKyAgREVQRU5ERU5DSUVTCisKKworICBQQVJBTUVURVJTCisKKyAgICBJTgorCisgICAgdWNTVEFJZDogICAgc3RhdGlvbiBmb3Igd2hpY2ggdGhlIHN0YXRpc3RpY3MgbmVlZCB0byBjb2xsZWN0ZWQKKworICAgIHZvc0RhdGFCdWZmOiBpdCB3aWxsIGNvbnRhaW4gdGhlIHBvaW50ZXIgdG8gdGhlIGNvcnJlc3BvbmRpbmcKKyAgICAgICAgICAgICAgICBzdHJ1Y3R1cmUKKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRo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mF0bFNUQUNsaWVudHNbdWNTVEFJZF0tPmludGVyZmFjZVN0YXRzLAorICAgICAgICAgIHNpemVvZihXTEFOVExfSW50ZXJmYWNlU3RhdHNUeXBlKSk7CisgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfQ2xlYXJJbnRlcmZhY2VTdGF0cworCisgIERFU0NSSVBUSU9OCisgICAgVXRpbGl0eSBmdW5jdGlvbiB1c2VkIGJ5IFRMIHRvIGNsZWFyIHRoZSBzdGF0aXRpY3MKKworICBERVBFTkRFTkNJRVMKKworCisgIFBBUkFNRVRFUlMKKworICAgIElOCisKKyAgICB1Y1NUQUlkOiAgICBzdGF0aW9uIGZvciB3aGljaCB0aGUgc3RhdGlzdGljcyBuZWVkIHRvIGNvbGxlY3RlZAorCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uCisKKyAgICBWT1NfU1RBVFVTX0VfSU5WQUw6ICAgSW5wdXQgcGFyYW1ldGVycyBhcmUgaW52YWxpZAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfQ2xlYXJJbnRlcmZhY2VTdGF0cworKAorICB2X1BWT0lEX3QgICAgICAgcHZvc0dDdHgsCisgIHZfVThfdCAgICAgICAgICB1Y1NUQUlkLAorICB2X1U4X3QgICAgICAgICAgc3RhdHNDbGVhclJlcU1hc2sKKykKK3sKKyAg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IZWFkZXIsIDAgKTsKKworICAgIGlmICggTlVMTCA9PSBwdkJESGVhZGVyICkKKyAgICAgICAgICB7CisgICAgICAgICAgICBUTExPR0UoVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICJXTEFOIFRMOkNhbm5vdCBleHRyYWN0IEJEIGhlYWRlciIpKTsKKyAgICAgICAgICAvKiBEcm9wIHBhY2tldCAqLworICAgICAgICAgIHZvc19wa3RfcmV0dXJuX3BhY2tldCh2b3NUZW1wQnVmZik7CisgICAgICAgICAgdm9zVGVtcEJ1ZmYgPSB2b3NEYXRhQnVmZjsKKyAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorCisgICAgdURQVVNpZyA9IFdEQV9HRVRfUlhfRFBVU0lHKCBwdkJESGVhZGVyICk7CisKKyAgICAvKiBBTVNEVSBIVyBidWcgZml4CisgICAgICogQWZ0ZXIgMm5kIEFNU0RVIHN1YmZyYW1lIEhXIGNvdWxkIG5vdCBoYW5kbGUgQkQgY29ycmVjdGx5CisgICAgICogSEFMIHdvcmthcm91bmQgaXMgbmVlZGVkICovCisgICAgaWYoV0RBX0dFVF9SWF9BU0YocHZCREhlYWRlcikpCisgICAgeworICAgICAgV0RBX0RTX1J4QW1zZHVCZEZpeCh2b3NfZ2V0X2dsb2JhbF9jb250ZXh0KFZPU19NT0RVTEVfSURfVEwscFRMQ2IpLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHB2QkRIZWFkZXIpOworICAgIH0KKworICAgIHVjVGlkICAgPSAodl9VOF90KVdEQV9HRVRfUlhfVElEKCBwdkJESGVhZGVyICk7CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAiV0xBTiBUTDpEYXRhIHBhY2tldCBjYWNoZWQgZm9yIFNUQSAlZC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AgICAgICAgICAgICB2b3NUZW1wQnVmZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRMQ2IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmZpcnN0X2RhdGFfcGt0X2Fycml2ZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVjU1RBSWQpKQorICAgICAgeworICAgICAgICAgIHZvc1RlbXBCdWZmID0gdm9zRGF0YUJ1ZmY7CisgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKyAgICAgIH0vKmlmIEJULUFNUCBzdGF0aW9uKi8KKyAgICAgIGVsc2UgaWYoc2VsZkJjYXN0TG9vcGJhY2sgPT0gVk9TX1RSVUUpCisgICAgICB7IAorICAgICAgICAvKiBEcm9wIHBhY2tldCAqLyAKKyAgICAgICAgdm9zX3BrdF9yZXR1cm5fcGFja2V0KHZvc1RlbXBCdWZmKTsgCisgICAgICAgIHZvc1RlbXBCdWZmID0gdm9zRGF0YUJ1ZmY7IAorICAgICAgICBjb250aW51ZTsgCisgICAgICB9IAorICAgICAgCisgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgICBEYXRhIHBhY2tldCByZWNlaXZlZCwgc2VuZCB0byBzdGF0ZSBtYWNoaW5lCisgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworICAgICAgd1NUQUV2ZW50ID0gV0xBTlRMX1JYX0VWRU5UOworCisgICAgICBwZm5TVEFGc20gPSB0bFNUQUZzbVtwQ2xpZW50U1RBLT50bFN0YXRlXS4KKyAgICAgICAgICAgICAgICAgICAgICBwZm5TVEFUYmxbd1NUQUV2ZW50XTsKKworICAgICAgaWYgKCBOVUxMICE9IHBmblNUQUZzbSApCisgICAgICB7CisjaWYgZGVmaW5lZCBXTEFOX0ZFQVRVUkVfTkVJR0hCT1JfUk9BTUlORworICAgICAgICAvKiBSZWFkIFJTU0kgYW5kIHVwZGF0ZSAqLworICAgICAgICB2b3NTdGF0dXMgPSBXTEFOVExfSFNIYW5kbGVSWEZyYW1lKHZvc19nZXRfZ2xvYmFsX2NvbnRleHQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19NT0RVTEVfSURfVEwscFRMQ2IpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9EQVRBX0ZSQU1FX1RZUEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHZCREhlYWRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1Y1NUQUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyb2FkY2FzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NUZW1wQnVmZik7CisgICAgICAgIGJyb2FkY2FzdCA9IFZPU19GQUxTRTsKKyNlbHNlCisgICAgICAgIHZvc1N0YXR1cyA9IFdMQU5UTF9SZWFkUlNTSSh2b3NfZ2V0X2dsb2JhbF9jb250ZXh0KFZPU19NT0RVTEVfSURfVEwscFRMQ2IpLCBwdkJESGVhZGVyLCB1Y1NUQUlkKTsKKyNlbmRpZgorICAgICAgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpCisgICAgICAgIHsKKyAgICAgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICJIYW5kbGUgUlggRGF0YSBGcmFtZSBmYWlsIHdpdGhpbiBIYW5kb2ZmIHN1cHBvcnQgbW9kdWxlIikpOworICAgICAgICAgIC8qIERvIE5vdCBEcm9wIHBhY2tldCBhdCBoZXJlIAorICAgICAgICAgICAqIFJldmlzaXQgd2h5IEhPIG1vZHVsZSByZXR1cm4gZmFpbAorICAgICAgICAgIHZvc19wa3RfcmV0dXJuX3BhY2tldCh2b3NUZW1wQnVmZik7CisgICAgICAgICAgdm9zVGVtcEJ1ZmYgPSB2b3NEYXRhQnVmZjsKKyAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgKi8KKyAgICAgICAgfQorICAgICAgICBwZm5TVEFGc20oIHZvc19nZXRfZ2xvYmFsX2NvbnRleHQoVk9TX01PRFVMRV9JRF9UTCxwVExDYiksIHVjU1RBSWQsIAorICAgICAgICAgICAgICAgICAmdm9zVGVtcEJ1ZmYsIFZPU19GQUxTRSk7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICJXTEFOIFRMOk5VTEwgc3RhdGUgZnVuY3Rpb24sIFNUQTolZCwgU3RhdGU6ICVkLSBkcm9wcGluZyBwYWNrZXQiLAorICAgICAgICAgICAgICAgICAgIHVjU1RBSWQsIHBDbGllbnRTVEEtPnRsU3RhdGUpKTsKKyAgICAgICAgLyogRHJvcCBwYWNrZXQgKi8KKyAgICAgICAgdm9zX3BrdF9yZXR1cm5fcGFja2V0KHZvc1RlbXBCdWZmKTsKKyAgICAgICAgdm9zVGVtcEJ1ZmYgPSB2b3NEYXRhQnVmZjsKKyAgICAgICAgY29udGludWU7CisgICAgICB9CisKKyAgICB2b3NUZW1wQnVmZiA9IHZvc0RhdGFCdWZmOworICB9Lyp3aGlsZSBjaGFpbiovCisKKyAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30vKiBXTEFOVExfUnhDYWNoZWRGcmFtZXMgKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOVExfUnhQcm9jZXNzTXNnCisKKyAgREVTQ1JJUFRJT04KKyAgICBDYWxsZWQgYnkgVk9TUyB3aGVuIGEgbWVzc2FnZSB3YXMgc2VyaWFsaXplZCBmb3IgVEwgdGhyb3VnaCB0aGUKKyAgICByeCB0aHJlYWQvdGFzay4KKworICBERVBFTkRFTkNJRVMKKyAgICBUaGUgVEwgbXVzdCBiZSBpbml0aWFsaXplZCBiZWZvcmUgdGhpcyBmdW5jdGlvbiBjYW4gYmUgY2FsbGVkLgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICAgIG1lc3NhZ2U6ICAgICAgICB0eXBlIGFuZCBjb250ZW50IG9mIHRoZSBtZXNzYWdlCisKKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorCisgICAgVk9TX1NUQVRVU19FX0lOVkFMOiAgIGludmFsaWQgaW5wdXQgcGFyYW1ldGVycworICAgIFZPU19TVEFUVVNfRV9GQVVMVDogICBwb2ludGVyIHRvIFRMIGNiIGlzIE5VTEwgOyBhY2Nlc3Mgd291bGQgY2F1c2UgYQorICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlIGZhdWx0CisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisgIE90aGVyIHZhbHVlcyBjYW4gYmUgcmV0dXJuZWQg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YXN0U2lnICA9ICggdURhdGEgJiAweDAwMDBGRjAwKT4+ODsKKyAgICB1Y0JjYXN0U2lnICA9ICh2X1U4X3QpKCggdURhdGEgJiAweDAwRkYwMDAwKT4+MTYpOworICAgIHZvc1N0YXR1cyAgID0gV0xBTlRMX0ZvcndhcmRTVEFGcmFtZXMoIHB2b3NHQ3R4LCB1Y1NUQUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVjVWNhc3RTaWcsIHVjQmNhc3RTaWcpOworICAgIGJyZWFrOworCisgIGRlZmF1bHQ6CisgICAgLypubyBwcm9jZXNzaW5nIGZvciBub3cqLworICAgIGJyZWFrOworICB9CisKKyAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5UTF9SZXNvdXJjZUNCCisKKyAgREVTQ1JJUFRJT04KKyAgICBDYWxsZWQgYnkgdGhlIFRMIHdoZW4gaXQgaGFzIHBhY2tldHMgYXZhaWxhYmxlIGZvciB0cmFuc21pc3Npb24uCisKKyAgREVQRU5ERU5DSUVTCisgICAgVGhlIFRMIG11c3QgYmUgcmVnaXN0ZXJlZCB3aXRoIEJBTCBiZWZvcmUgdGhpcyBmdW5jdGlvbiBjYW4gYmUgY2FsbGVkLgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgICBvciBCQUwncyBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIH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IFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgIldMQU4gVEw6SW52YWxpZCBUTCBwb2ludGVyIGZyb20gcHZvc0dDdHggaW4gV0xBTlRMX1NldFR4WG1pdFBlbmRpbmciKSk7CisgICAgcmV0dXJuOworICB9CisKKyAgcFRMQ2ItPmlzVHhUcmFubWl0TXNnUGVuZGluZyA9IDE7CisgIHJldHVybjsKKworfS8qV0xBTlRMX1NldFR4WG1pdFBlbmRpbmcgICovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICBXTEFOVExfQ2xlYXJUeFhtaXRQZW5kaW5nCisKKyAgREVTQ1JJUFRJT04KKyAgICBDYWxsZWQgYnkgdGhlIFdEQSB3aGVuIGl0IHdhbnRzIHRvIGluZGljYXRlIHRoYXQgbm8gV0RBX0RTX1RYX1NUQVJUX1hNSVQgbXNnCisgICAgaXMgcGVuZGluZyBpbiBUTCBtc2cgcXVldWUgCisKKyAgREVQRU5ERU5DSUVTCisgICAgVGhlIFRMIG11c3QgYmUgcmVnaXN0ZXJlZCB3aXRoIFdEQSBiZWZvcmUgdGhpcyBmdW5jdGlvbiBjYW4gYmUgY2FsbGVkLgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgICBvciBXREEncyBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorCisgIFJFVFVSTiBWQUxVRSAgICAgTm9uZQorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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WFkRGVidWdIYW5kbGVyCisKKyAgREVTQ1JJUFRJT04KKyAgICBQcmludGluZyBUTCBTbmFwc2hvdCBkdW1wLCBwcm9jZXNzZWQgdW5kZXIgVHhUaHJlYWQgY29udGV4dCwgY3VycmVudGx5CisgICAgaW5mb3JtYXRpb24gcmVnYXJkaW5nIHRoZSBnbG9iYWwgVGxDYiBzdHJ1dHVyZS4gRHVtcHMgaW5mb3JtYXRpb24gcmVsYXRlZAorICAgIHRvIHBlciBhY3RpdmUgU1RBIGNvbm5lY3Rpb24gY3VycmVudGx5IGluIHVzZSBieSBUTC4KKworICBERVBFTkRFTkNJRVMKKyAgICBUaGUgVEwgbXVzdCBiZSBpbml0aWFsaXplZCBiZWZvcmUgdGhpcyBnZXRzIGNhbGxlZC4KKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHB2b3NHQ3R4OiAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFuZGxlIHRvIFRMJ3MKKyAgICAgICAgICAgICAgICAgICAgb3IgV0RBJ3MgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQKKworICBSRVRVUk4gVkFMVUUgICAgICBOb25lCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCit2X1ZPSURfdAorV0xBTlRMX1R4VGhyZWFkRGVidWdIYW5kbGVyCisoCisgdl9QVk9JRF90ICpwVm9zQ29udGV4dAorKQoreworICAgV0xBTlRMX0NiVHlwZSogcFRMQ2IgPSBOVUxMOworICAgV0xBTlRMX1NUQUNsaWVudFR5cGUqIHBDbGllbnRTVEEgPSBOVUxMOworICAgaW50IGkgPSAwOworICAgdl9VOF90IHVGbG93TWFzazsgLy8gVFggRmxvd01hc2sgZnJvbSBXREEKKworICAgVExMT0dFKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAiV0xBTiBUTDogJXMgRW50ZXIgIiwgX19mdW5jX18pKTsKKworICAgcFRMQ2IgPSBWT1NfR0VUX1RMX0NCKHBWb3NDb250ZXh0KTsKKworICAgaWYgKCBOVUxMID09IHBWb3NDb250ZXh0IHx8IE5VTEwgPT0gcFRMQ2IgKQorICAgeworICAgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJHbG9iYWwgVm9TIENvbnRleHQgb3IgVEwgQ29udGV4dCBhcmUgTlVMTCIpKTsKKyAgICAgICAgcmV0dXJuOworICAgfQorCisgICBpZiAoVk9TX1NUQVRVU19TVUNDRVNTID09IFdEQV9EU19HZXRUeEZsb3dNYXNrKHBWb3NDb250ZXh0LCAmdUZsb3dNYXNrKSkKKyAgIHsKKyAgICAgICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICJXREEgdVR4Rmxvd01hc2s6IDB4JXgiLCB1Rmxvd01hc2spKTsKKyAgIH0KKworICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgIioqKioqKioqKioqKioqKioqKioqKioqKlRMIERVTVAgSU5GT1JNQVRJT04qKioqKioqKioqKioqKiIpKTsKKworICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgInVEZWxheWVkVHJpZ2dlckZybUludDolZFx0dU1pbkZyYW1lc1Byb2NUaHJlczolZCIsCisgICAgICAgICAgcFRMQ2ItPnRsQ29u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Fx0YXVjQWNNYXNrWzNdOiAlZFx0IiwKKyAgICAgICAgICAgICAgcENsaWVudFNUQS0+YXVjQUNNYXNrWzBdLCBwQ2xpZW50U1RBLT5hdWNBQ01hc2tbMV0sCisgICAgICAgICAgICAgIHBDbGllbnRTVEEtPmF1Y0FDTWFza1syXSwgcENsaWVudFNUQS0+YXVjQUNNYXNrWzNdKSk7CisgICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorCisgICAgICAgICAgICAgICAidWNDdXJyZW50V2VpZ2h0OiAlZCIsIHBDbGllbnRTVEEtPnVjQ3VycmVudFdlaWdodCkpOworCisgICAgICAgIGlmKCBXTEFOX1NUQV9TT0ZUQVAgPT0gcENsaWVudFNUQS0+d1NUQURlc2Mud1NUQVR5cGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIFRMTE9HMShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAiVHJhZmZpY1N0YXRpc3RpY3MgZm9yIFNPRlRBUCBTdGF0aW9uOiIpKTsKKyAgICAgICAgICAgIFRMTE9HMShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAiUlVGPSVkXHRSTUY9JWRcdFJCRj0lZCIsIHBDbGllbnRTVEEtPnRyYWZmaWNTdGF0aXN0aWNzLnJ4VUNGY250LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2xpZW50U1RBLT50cmFmZmljU3RhdGlzdGljcy5yeE1DRmNudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENsaWVudFNUQS0+dHJhZmZpY1N0YXRpc3RpY3MucnhCQ0ZjbnQpKTsKKyAgICAgICAgICAgIFRMTE9HMShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAiUlVCPSVkXHRSTUI9JWRcdFJCQj0lZCIsIHBDbGllbnRTVEEtPnRyYWZmaWNTdGF0aXN0aWNzLnJ4VUNCY250LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2xpZW50U1RBLT50cmFmZmljU3RhdGlzdGljcy5yeE1DQmNudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENsaWVudFNUQS0+dHJhZmZpY1N0YXRpc3RpY3MucnhCQ0JjbnQpKTsKKyAgICAgICAgICAgIFRMTE9HMShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAiVFVGPSVkXHRUTUY9JWRcdFRCRj0lZCIsIHBDbGllbnRTVEEtPnRyYWZmaWNTdGF0aXN0aWNzLnR4VUNGY250LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2xpZW50U1RBLT50cmFmZmljU3RhdGlzdGljcy50eE1DRmNudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENsaWVudFNUQS0+dHJhZmZpY1N0YXRpc3RpY3MudHhCQ0ZjbnQpKTsKKyAgICAgICAgICAgIFRMTE9HMShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAiVFVCPSVkXHRUTUI9JWRcdFRCQj0lZCIsIHBDbGllbnRTVEEtPnRyYWZmaWNTdGF0aXN0aWNzLnR4VUNCY250LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2xpZW50U1RBLT50cmFmZmljU3RhdGlzdGljcy50eE1DQmNudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENsaWVudFNUQS0+dHJhZmZpY1N0YXRpc3RpY3MudHhCQ0JjbnQpKTsKKyAgICAgICAgfQorCisgICAgfQorICAgcmV0dXJuOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgV0xBTlRMX0ZhdGFsRXJyb3JIYW5kbGVyCisKKyAgREVTQ1JJUFRJT04KKyAgICBIYW5kbGUgRmF0YWwgZXJyb3JzIGRldGVjdGVkIG9uIHRoZSBUWCBwYXRoLgorICAgIEN1cnJlbnRseSBpc3N1ZXMgU1NSIHRvIHJlY292ZXIgZnJvbSB0aGUgZXJyb3IuCisKKyAgREVQRU5ERU5DSUVTCisgICAgVGhlIFRMIG11c3QgYmUgaW5pdGlhbGl6ZWQgYmVmb3JlIHRoaXMgZ2V0cyBjYWxsZWQuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICBwdm9zR0N0eDogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZSB0byBUTCdzCisgICAgICAgICAgICAgICAgICAgIG9yIFdEQSdzIGNvbnRyb2wgYmxvY2sgY2FuIGJlIGV4dHJhY3RlZCBmcm9tIGl0cyBjb250ZXh0CisKKyAgUkVUVVJOIFZBTFVFICAgICAgTm9uZQorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZfVk9JRF90CitXTEFOVExfRmF0YWxFcnJvckhhbmRsZXIKKygKKyB2X1BWT0lEX3QgKnBWb3NDb250ZXh0CispCit7CisKKyAgIFRMTE9HRShWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgIldMQU4gVEw6ICVzIEVudGVyICIsIF9fZnVuY19fKSk7CisKKyAgIGlmICggTlVMTCA9PSBwVm9zQ29udGV4dCApCisgICB7CisgICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBHbG9iYWwgVm9TIENvbnRleHQgb3IgVEwgQ29udGV4dCBhcmUgTlVMTCIsCisgICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXykpOworICAgICAgICByZXR1cm47CisgICB9CisKKyAgIC8qCisgICAgKiBJc3N1ZSBTU1IuIHZvc193bGFuUmVzdGFydCBoYXMgdGlnaHQgY2hlY2tzIHRvIG1ha2Ugc3VyZSB0aGF0CisgICAgKiB3ZSBkbyBub3Qgc2VuZCBhbiBGSVEgaWYgcHJldmlvdXMgRklRIGlzIG5vdCBwcm9jZXNzZWQKKyAgICAqLworICAgdm9zX3dsYW5SZXN0YXJ0KCk7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICBXTEFOVExfVExEZWJ1Z01lc3NhZ2UKKworICBERVNDUklQVElPTgorICAgIFBvc3QgYSBUTCBTbmFwc2hvdCByZXF1ZXN0LCBwb3N0cyBtZXNzYWdlIGluIFR4VGhyZWFkLgorCisgIERFUEVOREVOQ0lFUworICAgIFRoZSBUTCBtdXN0IGJlIGluaXRpYWxpemVkIGJlZm9yZSB0aGlzIGdldHMgY2FsbGVkLgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgZGlzcGxheVNuYXBzaG90IEJvb2xlYW4gc2hvd2luZyB3aGV0aGVyIHRvIGR1bXAgdGhlIHNuYXBzaG90IG9yIG5vdC4KKworICBSRVRVUk4gVkFMVUUgICAgICBOb25lCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCit2X1ZPSURfdAorV0xBTlRMX1RMRGVidWdNZXNzYWdlCisoCisgdl9VMzJfdCBkZWJ1Z0ZsYWdzCispCit7CisgICB2b3NfbXNnX3Qgdm9zTXNnOworICAgVk9TX1NUQVRVUyBzdGF0dXM7CisKKyAgIGlmKGRlYnVnRmxhZ3MgJiBXTEFOVExfREVCVUdfVFhfU05BUFNIT1QpCisgICB7CisgICAgICAgIHZvc01zZy5yZXNlcnZlZCA9IDA7CisgICAgICAgIHZvc01zZy5ib2R5cHRyICA9IE5VTEw7CisgICAgICAgIHZvc01zZy50eXBlICAgICA9IFdMQU5UTF9UWF9TTkFQU0hPVDsKKworICAgICAgICBzdGF0dXMgPSB2b3NfdHhfbXFfc2VyaWFsaXplKCBWT1NfTU9EVUxFX0lEX1RMLCAmdm9zTXNnKTsKKyAgICAgICAgaWYoc3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJUWCBNc2cgUG9zdGluZyBGYWlsZWQgd2l0aCBzdGF0dXM6ICVkIixzdGF0dXMpKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgfQorICAgaWYgKGRlYnVnRmxhZ3MgJiBXTEFOVExfREVCVUdfRldfQ0xFQU5VUCkKKyAgIHsKKyAgICAgICAgdm9zTXNnLnJlc2VydmVkID0gMDsKKyAgICAgICAgdm9zTXNnLmJvZHlwdHIgID0gTlVMTDsKKyAgICAgICAgdm9zTXNnLnR5cGUgICAgID0gV0xBTlRMX1RYX0ZXX0RFQlVHOworCisgICAgICAgIHN0YXR1cyA9IHZvc190eF9tcV9zZXJpYWxpemUoIFZPU19NT0RVTEVfSURfVEwsICZ2b3NNc2cpOworICAgICAgICBpZihzdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIlRYIE1zZyBQb3N0aW5nIEZhaWxlZCB3aXRoIHN0YXR1czogJWQiLHN0YXR1cykpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICB9CisgICBpZihkZWJ1Z0ZsYWdzICYgV0xBTlRMX0RFQlVHX0tJQ0tEWEUpCisgICB7CisgICAgICAgIHZvc01zZy5yZXNlcnZlZCA9IDA7CisgICAgICAgIHZvc01zZy5ib2R5cHRyICA9IE5VTEw7CisgICAgICAgIHZvc01zZy50eXBlICAgICA9IFdMQU5UTF9UWF9LSUNLRFhFOworCisgICAgICAgIHN0YXR1cyA9IHZvc190eF9tcV9zZXJpYWxpemUoIFZPU19NT0RVTEVfSURfVEwsICZ2b3NNc2cpOworICAgICAgICBpZihzdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIlRYIE1zZyBQb3N0aW5nIEZhaWxlZCB3aXRoIHN0YXR1czogJWQiLHN0YXR1cykpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICB9CisgICByZXR1cm47Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICBXTEFOVExfRmF0YWxFcnJvcgorCisgIERFU0NSSVBUSU9OCisgICAgRmF0YWwgZXJyb3IgcmVwb3J0ZWQgaW4gVFggcGF0aCwgcG9zdCBhbiBldmVudCB0byBUWCBUaHJlYWQgZm9yIGZ1cnRoZXIKKyAgICBoYW5kbGluZworCisgIERFUEVOREVOQ0lFUworICAgIFRoZSBUTCBtdXN0IGJlIGluaXRpYWxpemVkIGJlZm9yZSB0aGlzIGdldHMgY2FsbGVkLgorCisgIFBBUkFNRVRFUlMKKworICAgIFZPSUQKKworICBSRVRVUk4gVkFMVUUgICAgICBOb25lCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCit2X1ZPSURfdAorV0xBTlRMX0ZhdGFsRXJyb3IKKygKKyB2X1ZPSURfdAorKQoreworICAgdm9zX21zZ190IHZvc01zZzsKKyAgIFZPU19TVEFUVVMgc3RhdHVzOworCisgICB2b3NNc2cucmVzZXJ2ZWQgPSAwOworICAgdm9zTXNnLmJvZHlwdHIgID0gTlVMTDsKKyAgIHZvc01zZy50eXBlICAgICA9IFdMQU5UTF9UWF9GQVRBTF9FUlJPUjsKKworICAgc3RhdHVzID0gdm9zX3R4X21xX3NlcmlhbGl6ZSggVk9TX01PRFVMRV9JRF9UTCwgJnZvc01zZyk7CisgICBpZihzdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgeworICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBUWCBNc2cgUG9zdGluZyBGYWlsZWQgd2l0aCBzdGF0dXM6ICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLHN0YXR1cykpOworICAgfQorICAgcmV0dXJuOworfQorLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAgICAgICAgICAgICAgICAgICAgICBUTCBTVEFURSBNQUNISU5FCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOVExfU1RBVHhDb25uCisKKyAgREVTQ1JJUFRJT04KKyAgICBUcmFuc21pdCBpbiBjb25uZWN0ZWQgc3RhdGUgLSBvbmx5IEVBUE9MIGFuZCBXQUkgcGFja2V0cyBhbGxvd2VkCisKKyAgREVQRU5ERU5DSUVTCisgICAgVGhlIFNUQSBtdXN0IGJlIHJlZ2lzdGVyZWQgd2l0aCBUTCBiZWZvcmUgdGhpcyBmdW5jdGlvbiBjYW4gYmUgY2FsbGVkLgorCisgIFBBUkFNRVRFUlMKKworICAgSU4KKyAgIHB2b3NHQ3R4OiAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFuZGxlIHRvIFRMJ3MKKyAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICAgdWNTVEFJZDogICAgICAgIGlkZW50aWZpZXIgb2YgdGhlIHN0YXRpb24gYmVpbmcgcHJvY2Vzc2VkCisgICB2b3NEYXRhQnVmZjogICBwb2ludGVyIHRvIHRoZSB0eCB2b3MgYnVmZmVyCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICAgIFZPU19TVEFUVVNfRV9GQVVMVDogICBwb2ludGVyIHRvIFRMIGNiIGlzIE5VTEwgOyBhY2Nlc3Mgd291bGQgY2F1c2UgYQorICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlIGZhdWx0CisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisgICBPdGhlciByZXR1cm4gdmFsdWVzIGFyZSBwb3NzaWJsZSBjb21pbmcgZnJvbSB0aGUgY2FsbGVkIGZ1bmN0aW9ucy4KKyAgIFBsZWFzZSBjaGVjayBBUEkgZm9yIGFkZGl0aW9uYWwgaW5mby4KKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfU1RBVHhDb25uCisoCisgIHZfUFZPSURfdCAgICAgcHZvc0dDdHgsCisgIHZfVThfdCAgICAgICAgdWNTVEFJZCwKKyAgdm9zX3BrdF90KiogICBwdm9zRGF0YUJ1ZmYsCisgIHZfQk9PTF90ICAgICAgYkZvcndhcmRJQVBQd2l0aExMQworKQoreworICAgdl9VMTZfdCAgICAgICAgICAgICAgdXNQa3RMZW47CisgICBWT1NfU1RBVFVTICAgICAgICAgICB2b3NTdGF0dXM7CisgICB2X01BQ0FERFJfdCAgICAgICAgICB2RGVzdE1hY0FkZHI7CisgICB2b3NfcGt0X3QqICAgICAgICAgICB2b3NEYXRhQnVmZiA9IE5VTEw7CisgICBXTEFOVExfQ2JUeXBlKiAgICAgICBwVExDYiAgICAgICA9IE5VTEw7CisgICBXTEFOVExfU1RBQ2xpZW50VHlwZSogcENsaWVudFNUQSA9IE5VTEw7CisgICBXTEFOVExfTWV0YUluZm9UeXBlICB0bE1ldGFJbmZvOworICAgdl9VOF90ICAgICAgICAgICAgICAgdWNUeXBlU3VidHlwZSA9IDA7CisgICB2X1U4X3QgICAgICAgICAgICAgICB1Y1RpZDsKKyAgIHZfVThfdCAgICAgICAgICAgICAgIGV4dHJhSGVhZFNwYWNlID0gMDsKKyAgIH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TWV0YUluZm8udWNJc0VhcG9sICYmIDAgPT0gdGxNZXRhSW5mby51Y0lzV2FpICkKKyAgIHsKKyAgICAgVExMT0dFKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgIldMQU4gVEw6T25seSBFQVBPTCBvciBXQUkgcGFja2V0cyBhbGxvd2VkIGJlZm9yZSBhdXRoZW50aWNhdGlvbiIpKTsKKworICAgICAvKiBGYWlsIHR4IGZvciBwYWNrZXQgKi8KKyAgICAgcENsaWVudFNUQS0+cGZuU1RBVHhDb21wKCBwdm9zR0N0eCwgdm9zRGF0YUJ1ZmYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfU1RBVFVTX0VfQkFETVNHKTsKKyAgICAgdm9zRGF0YUJ1ZmYgPSBOVUxMOworICAgICAqcHZvc0RhdGFCdWZmID0gTlVMTDsKKyAgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgfQorI2Vsc2UKKyAgIGlmICggMCA9PSB0bE1ldGFJbmZvLnVjSXNFYXBvbCApCisgIHsKKyAgICAgVExMT0cyKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAiV0xBTiBUTDpSZWNlaXZlZCBub24gRUFQT0wgcGFja2V0IGJlZm9yZSBhdXRoZW50aWNhdGlvbiIpKTsKKworICAgIC8qIEZhaWwgdHggZm9yIHBhY2tldCAqLworICAgIHBDbGllbnRTVEEtPnBmblNUQVR4Q29tcCggcHZvc0dDdHgsIHZvc0RhdGFCdWZmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1NUQVRVU19FX0JBRE1TRyk7CisgICAgdm9zRGF0YUJ1ZmYgPSBOVUxMOworICAgICpwdm9zRGF0YU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oZSBjYWxsZWQgZnVuY3Rpb25zLgorICAgUGxlYXNlIGNoZWNrIEFQSSBmb3IgYWRkaXRpb25hbCBpbmZvLgorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5UTF9TVEFUeEF1dGgKKygKKyAgdl9QVk9JRF90ICAgICBwdm9zR0N0eCwKKyAgdl9VOF90ICAgICAgICB1Y1NUQUlkLAorICB2b3NfcGt0X3QqKiAgIHB2b3NEYXRhQnVmZiwKKyAgdl9CT09MX3QgICAgICBiRm9yd2FyZElBUFB3aXRoTExDCispCit7CisgICB2X1UxNl90ICAgICAgICAgICAgICAgdXNQa3RMZW47CisgICBWT1NfU1RBVFVTICAgICAgICAgICAgdm9zU3RhdHVzOworICAgdl9NQUNBRERSX3QgICAgICAgICAgIHZEZXN0TWFjQWRkcjsKKyAgIHZvc19wa3RfdCogICAgICAgICAgICB2b3NEYXRhQnVmZiA9IE5VTEw7CisgICBXTEFOVExfQ2JUeXBlKiAgICAgICAgcFRMQ2IgICAgICAgPSBOVUxMOworICAgV0xBTlRMX01ldGFJbmZvVHlwZSAgIHRsTWV0YUluZm87CisgICB2X1U4X3QgICAgICAgICAgICAgICAgdWNUeXBlU3VidHlwZSA9IDA7CisgICBXTEFOVExfQUNFbnVtVHlwZSAgICAgdWNBQzsKKyAgIFdMQU5UTF9BQ0VudW1UeXBlICAgICB1Y05leHRBQzsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICB1Y1RpZDsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICB1Y1N3RnJtWHRsID0gMDsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICBleHRyYUhlYWRTcGFjZSA9IDA7CisgICBXTEFOVExfU1RBQ2xpZW50VHlwZSAqcFN0YUNsaWVudCA9IE5VTEw7CisgICB2X1U4X3QgICAgICAgICA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tb3JlIGRhdGEgYW5kIGlmIHRoZSAKKyAgICAgIGFzc3VtcHRpb24gd2FzIHdyb25nIHlvdSByZXNldCB0aGUgZmxhZ3MgdG8gdGhlaXIgb3JpZ2luYWwgc3RhdGUKKyAgICAgVGhpcyB3aWxsIHByZXZlbnQgZnJvbSBleHBvc2luZyBhIHJhY2UgY29uZGl0aW9uIGJldHdlZW4gY2hlY2tpbmcgd2l0aCBIREQgCisgICAgIGZvciBwYWNrZXRzIGFuZCBzZXR0aW5nIHRoZSBmbGFncyB0byBmYWxzZSovCisgIGlmICggMCA9PSB1Y0FDTWFzayApCisgIHsKKyAgICB2b3NfYXRvbWljX3NldF9VOCggJnBTdGFDbGllbnQtPnVjUGt0UGVuZGluZywgMCk7CisgICAgcFN0YUNsaWVudC0+dWNOb01vcmVEYXRhID0gMTsKKyAgfQorCisgIHZvc1N0YXR1cyA9IHBTdGFDbGllbnQtPnBmblNUQUZldGNoUGt0KCBwdm9zR0N0eCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnVjU1RBSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWNBQywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdm9zRGF0YUJ1ZmYsICZ0bE1ldGFJbmZvICk7CisKKworICBpZiAoKCBWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gdm9zU3RhdHVzICkgfHwgKCBOVUxMID09IHZvc0RhdGFCdWZmICkpCisgIHsKKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAiV0xBTiBUTDpGYWlsZWQgd2hpbGUgYXR0ZW1wdGluZyB0byBmZXRjaCBwa3QgZnJvbSBIREQgUUlkOiVkIHN0YXR1czolZCIsCisgICAgICAgICAgICAgICB1Y0FDLCB2b3NTdGF0dXMpOworICAgICpwdm9zRGF0YUJ1ZmYgPSBOVUxMOworICAgIC8qLS0tL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RBQyA9IFdMQU5UTF9BQ19ISUdIX1BSSU87CisgICAgICBlbHNlCisgICAgICAgICB1Y05leHRBQyA9ICh0ZW1wQUMgLSAxKTsKKworICAgICAgaWYgKCAwICE9IHBTdGFDbGllbnQtPmF1Y0FDTWFza1t1Y05leHRBQ10gKQorICAgICAgeworICAgICAgICAgcFN0YUNsaWVudC0+dWNDdXJyZW50QUMgICAgID0gdWNOZXh0QUM7CisgICAgICAgICBwU3RhQ2xpZW50LT51Y0N1cnJlbnRXZWlnaHQgPSBwVExDYi0+dGxDb25maWdJbmZvLnVjQWNXZWlnaHRzW3VjTmV4dEFDXTsKKworICAgICAgICAgVExMT0cyKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICAgIldMQU4gVEw6IENoYW5naW5nIHNlcnZpY2VkIEFDIHRvOiAlZCB3aXRoIFdlaWdodDogJWQiLAorICAgICAgICAgICAgICAgICAgICBwU3RhQ2xpZW50LT51Y0N1cnJlbnRBQyAsIAorICAgICAgICAgICAgICAgICAgICBwU3RhQ2xpZW50LT51Y0N1cnJlbnRXZWlnaHQpKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgdGVtcEFDID0gdWNOZXh0QUM7CisgICAgfQorICB9CisgIH0KKworICBUTExPRzIoVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICJXTEFOIFRMOkF0dGFjaGluZyBCRCBoZWFkZXIgdG8gcGt0IG9uIFdMQU5UTF9TVEFUeEF1dGgiKSk7CisKKyAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICBUcmFuc2xhdGUgODAyLjMgZnJhbWUgdG8gODAyLj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Agdl9VMzJfdCB1RmFzdEZ3ZE9LID0gMDsKKworICAgICAgICAvKiBIVyBiYXNlZCB0cmFuc2xhdGlvbi4gU2VlIGlmIHRoZSBmcmFtZSBjb3VsZCBiZSBmYXN0IGZvcndhcmRlZCAqLworICAgICAgICBXREFfVExJX0Zhc3RId0Z3ZERhdGFGcmFtZSggcHZvc0dDdHgsIHZvc0RhdGFCdWZmICwgJnZvc1N0YXR1cywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ1RmFzdEZ3ZE9LLCAmdGxNZXRhSW5mbywgJnBTdGFDbGllbnQtPndTVEFEZXNjKTsKKworICAgICAgICBpZiggVk9TX1NUQVRVU19TVUNDRVNTID09IHZvc1N0YXR1cyApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKHVGYXN0RndkT0spCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogUGFja2V0IGNvdWxkIGJlIGZhc3QgZm9yd2FyZGVkIG5vdyAqLworICAgICAgICAgICAgICAgIHZvc19wa3Rfc2V0X3VzZXJfZGF0YV9wdHIoIHZvc0RhdGFCdWZmLCBWT1NfUEtUX1VTRVJfREFUQV9JRF9UTCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZfUFZPSURfdClwU3RhQ2xpZW50LT5wZm5TVEFUeENvbXAgKTsKKworICAgICAgICAgICAgICAgICpwdm9zRGF0YUJ1ZmYgPSB2b3NEYXRhQnVmZjsKKworICAgICAgICAgICAgICAgIC8qIFRPRE86IERvIHdlIHJlYWxseSBuZWVkIHRvIHVwZGF0ZSBXTEFOVExfSFNIYW5kbGVUWEZyYW1lKCkgCisgICAgICAgICAgICAgICAgICAgc3RhdHMgZm9yIGV2ZXJ5IHBrdD8gKi8KKyAgICAgICAgICAgICAgICBwU3RhQ2xpZW50LT5hdVR4Q291bnRbdGxNZXRhSW5mby51Y1RJRF0rKzsKKyAgICAgICAgICAgICAgICByZXR1cm4gdm9zU3RhdHVzOworICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAvKiBjYW4ndCBiZSBmYXN0IGZvcndhcmRlZCwgZmFsbCB0aHJvdWdoIG5vcm1hbCAoc2xvdykgcGF0aC4gKi8KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKworICAgICAgICAgICAgVExMT0dFKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiV0xBTiBUTDpGYWlsZWQgd2hpbGUgYXR0ZW1wdGluZyB0byBmYXN0RndkIEJEICVkIiwgdm9zU3RhdHVzKSk7CisgICAgICAgICAgICAqcHZvc0RhdGFCdWZmID0gTlVMTDsKKyAgICAgICAgICAgIHJldHVybiB2b3NTdGF0dXM7CisgICAgICAgIH0KKyNlbmRpZiAvKldMQU5fUEVSRiovCisgICAgIH0KKyAgICAgZWxzZQorICAgICB7CisgICAgICAgIC8qIFNXIGJhc2VkIHRyYW5zbGF0aW9uICovCisKKyAgICAgICB2b3NTdGF0dXMgPSAgV0xBTlRMX1RyYW5zbGF0ZTgwMjNUbzgwMjExSGVhZGVyKCB2b3NEYXRhQnVmZiwgJnZvc1N0YXR1cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVExDYiwgJnVjU1RBSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnRsTWV0YUluZm8sICZ1Y1dEU0VuYWJsZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmV4dHJhSGVhZFNwYWNlKTsKKyAgICAgICBpZiAoIFZPU19TVEFUVVNfU1VDQ0VTUyAhPSB2b3NTdGF0dXMgKQorICAgICAgIHsKKyAgICAgICAgICBUTExPR0UoVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0Vf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ZvKCBwdm9zR0N0eCwgCisgICAgICAgICAgICAgICAgICAgICB2b3NEYXRhQnVmZiAsICZ2RGVzdE1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICB0bE1ldGFJbmZvLnVjRGlzYWJsZUZybVh0bCwgJnVzUGt0TGVuLAorICAgICAgICAgICAgICAgICAgICAgcFN0YUNsaWVudC0+d1NUQURlc2MudWNRb3NFbmFibGVkLCB1Y1dEU0VuYWJsZWQsIAorICAgICAgICAgICAgICAgICAgICAgZXh0cmFIZWFkU3BhY2UsCisgICAgICAgICAgICAgICAgICAgICB1Y1R5cGVTdWJ0eXBlLCAmcFN0YUNsaWVudC0+d1NUQURlc2MudlNlbGZNQUNBZGRyZXNzLAorICAgICAgICAgICAgICAgICAgICAgdWNUaWQsIHVjVHhGbGFnLCB0bE1ldGFJbmZvLnVzVGltZVN0YW1wLCAKKyAgICAgICAgICAgICAgICAgICAgIHRsTWV0YUluZm8udWNJc0VhcG9sLCB0bE1ldGFJbmZvLnVjVVAsCisgICAgICAgICAgICAgICAgICAgICB0bE1ldGFJbmZvLnVjVHhCZFRva2VuKTsKKworICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpCisgIHsKKyAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIkZpbGwgVFggQkQgRXJyb3Igc3RhdHVzICVkIiwgdm9zU3RhdHVzKSk7CisKKyAgICByZXR1cm4gdm9zU3RhdHVzOworICB9CisKKyAgLyogVFggU3RhdGlzdGljcyAqLworICBpZiAoISh0bE1ldGFJbmZvLnVjQmNhc3QgfHwgdGxNZXRhSW5mby51Y01jYXN0KSkKKyAgeworICAgIC8qIFRoaXMgaXMgVFggVUMgZnJhbWUgKi8KKyAgICBwU3RhQ2xpZW50LT50cmFmZmljU3RhdGlzdGljcy50eFVDRmNudCsrOworICAgIHBTdGFDbGllbn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01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIldMQU4gVEw6RmFpbGVkIHdoaWxlIGF0dGVtcHRpbmcgdG8gZmlsbCBCRCAlZCIsIHZvc1N0YXR1cykpOworICAgICpwdm9zRGF0YUJ1ZmYgPSBOVUxMOworICAgIHJldHVybiB2b3NTdGF0dXM7CisgIH0KKworICB2b3NfcGt0X3NldF91c2VyX2RhdGFfcHRyKCB2b3NEYXRhQnVmZiwgVk9TX1BLVF9VU0VSX0RBVEFfSURfVEwsCisgICAgICAgICAgICAgICAgICAgKHZfUFZPSURfdClwU3RhQ2xpZW50LT5wZm5TVEFUeENvbXAgKTsKKworICAqcHZvc0RhdGFCdWZmID0gdm9zRGF0YUJ1ZmY7CisKKyAgLypCRSAmIEJLIGNhbiBiZSBkZWxheWVkLCBWTyBhbmQgVkkgbm90IGZyYW1lcyBjYW5ub3QgYmUgZGVsYXllZCovCisgIGlmICggcFN0YUNsaWVudC0+dWNTZXJ2aWNlZEFDID4gV0xBTlRMX0FDX0JFICkgCisgIHsKKyAgICBwVExDYi0+YlVyZ2VudD0gVFJVRTsKKyAgfQorCisgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9LyogV0xBTlRMX1NUQVR4QXV0aCAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5UTF9TVEFUeERpc2MKKworICBERVNDUklQVElPTgorICAgIFRyYW5zbWl0IGluIGRpc2Nvbm5lY3RlZCBzdGF0ZSAtIG5vIGRhdGEgYWxsb3dlZAorCisgIERFUEVOREVOQ0lFUworICAgIFRoZSBTVEEgbXVzdCBiZSByZWdpc3RlcmVkIHdpdGggVEwgYmVmb3JlIHRoaXMgZnVuY3Rpb24gY2FuIGJlIGNhbGxlZC4KKworICBQQVJBTUVURVJTCisKK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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisgIFRMTE9HMihWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgIldMQU4gVEw6UGFja2V0IHNob3VsZCBub3QgYmUgdHJhbnNtaXR0ZWQgaW4gc3RhdGUgZGlzY29ubmVjdGVkIGlnbm9yaW5nIgorICAgICAgICAgICAgIiByZXF1ZXN0IikpOworCisgICpwdm9zRGF0YUJ1ZmYgPSBOVUxMOworICAgcENsaWVudFNUQS0+dWNOb01vcmVEYXRhID0gMTsKKyAgIAorICAgLy9TaG91bGQgbm90IGJlIGFueXRoaW5nIHBlbmRpbmcgaW4gZGlzY29ubmVjdCBzdGF0ZQorICAgdm9zX2F0b21pY19zZXRfVTgoICZwQ2xpZW50U1RBLT51Y1BrdFBlbmRpbmcsIDApOworCisgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9LyogV0xBTlRMX1NUQVR4RGlzYyAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5UTF9TVEFSeENvbm4KKworICBERVNDUklQVElPTgorICAgIFJlY2VpdmUgaW4gY29ubmVjdGVkIHN0YXRlIC0gb25seSBFQVBPTAorCisgIERFUEVOREVOQ0lFUworICAgIFRoZSBTVEEgbXVzdCBiZSByZWdpc3RlcmVkIHdpdGggVEwgYmVmb3JlIHRoaXMgZnVuY3Rpb24gY2FuIGJlIGNhbGxlZC4KKworICBQQVJBTUVURVJTCisKKyAgIElOCisgICBwdm9zR0N0eDogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZSB0byBUTCdzCisgICA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ICAgICAgICAgICAgdXNFdGhlclR5cGUgPSAwOworICAgdl9VMTZfdCAgICAgICAgICAgICAgICAgIHVzUGt0TGVuOworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgIHVjTVBEVUhPZmZzZXQ7CisgICB2X1UxNl90ICAgICAgICAgICAgICAgICAgdXNNUERVRE9mZnNldDsKKyAgIHZfVTE2X3QgICAgICAgICAgICAgICAgICB1c01QRFVMZW47CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgdWNNUERVSExlbjsKKyAgIHZfVTE2X3QgICAgICAgICAgICAgICAgICB1c0FjdHVhbEhMZW4gPSAwOworICAgVk9TX1NUQVRVUyAgICAgICAgICAgICAgIHZvc1N0YXR1cyAgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICB2b3NfcGt0X3QqICAgICAgICAgICAgICAgdm9zRGF0YUJ1ZmY7CisgICB2X1BWT0lEX3QgICAgICAgICAgICAgICAgYXVjQkRIZWFkZXI7CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgdWNUaWQ7CisgICBXTEFOVExfUnhNZXRhSW5mb1R5cGUgICAgd1J4TWV0YUluZm87CisgIC8qLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0qLworCisgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgU2FuaXR5IGNoZWNrCisgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworICBpZiAoKCBOVUxMID09IHB2b3NEYXRhQnVmZiApIHx8ICggTlVMTCA9PSAoIHZvc0RhdGFCdWZmID0gKnB2b3NEYXRhQnVmZiApKSkKKyA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ICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgIHBvaW50ZXIgdG8gVEwgY2IgaXMgTlVMTCA7IGFjY2VzcyB3b3VsZCBjYXVzZSBhCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2UgZmF1bHQKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICAgRXZlcnl0aGluZyBpcyBnb29kIDopCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCitWT1NfU1RBVFVTCitXTEFOVExfRndkUGt0VG9IREQKKygKKyAgdl9QVk9JRF90ICAgICAgIHB2b3NHQ3R4LAorICB2b3NfcGt0X3QqICAgICBwdm9zRGF0YUJ1ZmYsCisgIHZfVThfdCAgICAgICAgICB1Y1NUQUlkCispCit7CisgICB2X01BQ0FERFJfdCAgICAgICAgICAgICAgRGVzdE1hY0FkZHJlc3M7CisgICB2X01BQ0FERFJfdCAgICAgICAgICAgICAgKnBEZXN0TWFjQWRkcmVzcyA9ICZEZXN0TWFjQWRkcmVzczsKKyAgIHZfU0laRV90ICAgICAgICAgICAgICAgICB1c01hY0FkZFNpemUgPSBWT1NfTUFDX0FERFJfU0laRTsKKyAgIFdMQU5UTF9DYlR5cGUqICAgICAgICAgICBwVExDYiA9IE5VTEw7CisgICBXTEFOVExfU1RBQ2xpZW50VHlwZSogICAgcENsaWVudFNUQSA9IE5VTEw7CisgICB2b3NfcGt0X3QqICAgICAgICAgICAgICAgdm9zRGF0YUJ1ZmYgOworICAgVk9TX1NUQVRVUyAgICAgICAgICAgICAgIHZvc1N0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgIHZfVTMyX3QqICAgICAgICAgICAgICAgICBTVEFNZXRhSW5mb1B0cjsKKyAgIHZvc19wa3RfdCogICAgICAgICAgICAgICB2b3NOZXh0RGF0YUJ1ZmYgOworICAgdl9VO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w6IHJlY3YgY29ycnVwdGVkIGRhdGEgcGFja2V0IikpOworICAgICAgICAgdm9zX3BrdF9yZXR1cm5fcGFja2V0KHZvc0RhdGFCdWZmKTsKKyAgICAgICAgIHJldHVybiB2b3NTdGF0dXM7CisgICAgICB9CisKKyAgICAgIFRMTE9HNChWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICAgICAgICAgICAgICJzdGF0aW9uIG1hYyAiTUFDX0FERFJFU1NfU1RSLAorICAgICAgICAgICAgICAgICAgICAgICAgTUFDX0FERFJfQVJSQVkocERlc3RNYWNBZGRyZXNzLT5ieXRlcykpKTsKKworICAgICAgaWYgKHZvc19pc19tYWNhZGRyX2Jyb2FkY2FzdCggcERlc3RNYWNBZGRyZXNzICkgfHwgdm9zX2lzX21hY2FkZHJfZ3JvdXAocERlc3RNYWNBZGRyZXNzKSkKKyAgICAgIHsKKyAgICAgICAgICAvLyBkZXN0aW5hdGlvbiBpcyBtYy9iYyBzdGF0aW9uCisgICAgICAgICAgdWNEZXNTVEFJZCA9IFdMQU5fUlhfQkNNQ19TVEFfSUQ7CisgICAgICAgICAgVExMT0c0KFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IRERfU09GVEFQLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAgICAgICAgICIlczogQkMvTUMgcGFja2V0LCBpZCAlZCIsIF9fZnVuY19fLCBXTEFOX1JYX0JDTUNfU1RBX0lEKSk7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICBpZiAodm9zX2lzX21hY2FkZHJfZXF1YWwocERlc3RNYWNBZGRyZXNzLCAmcENsaWVudFNUQS0+d1NUQURlc2MudlNlbGZNQUNBZGRyZXNzKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIC8vIGRlc3RpbmF0aW9uIGlzIEFQIGl0c2VsZgorICAgICAgICAg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01BU0spOworICAgICAgd1J4TWV0YUluZm8udWNEZXNTVEFJZCA9IHVjRGVzU1RBSWQ7CisgICAgIAorICAgICAgdm9zU3RhdHVzID0gcENsaWVudFNUQS0+cGZuU1RBUngoIHB2b3NHQ3R4LCB2b3NEYXRhQnVmZiwgdWNEZXNTVEFJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJndSeE1ldGFJbmZvICk7CisgICAgICBpZiAoIFZPU19TVEFUVVNfU1VDQ0VTUyAhPSB2b3NTdGF0dXMgKQorICAgICAgeworICAgICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiV0xBTiBUTDogZmFpbGVkIHRvIHNlbmQgcGt0IHRvIEhERCIpKTsKKyAgICAgICAgICB2b3NfcGt0X3JldHVybl9wYWNrZXQodm9zRGF0YUJ1ZmYpOworCisgICAgICAgICAgcmV0dXJuIHZvc1N0YXR1czsKKyAgICAgIH0KKyAgICAgIHZvc0RhdGFCdWZmID0gdm9zTmV4dERhdGFCdWZmOworICAgfQorICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOVExfU1RBUnhBdXRoCisKKyAgREVTQ1JJUFRJT04KKyAgICBSZWNlaXZlIGluIGF1dGhlbnRpY2F0ZWQgc3RhdGUgLSBhbGwgZGF0YSBhbGxvd2VkCisKKyAgREVQRU5ERU5DSUVTCisgICAgVGhlIFNUQSBtdXN0IGJlIHJlZ2lzdGVyZWQgd2l0aCBUTCBiZWZvcmUgdGhpcyBmdW5jdGlvbiBjYW4gYmUgY2FsbGVkLgorCisgIFBBUkFNRVRFUlMKKworICAgSU4KKyAgIHB2b3NHQ3R4OiAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFuZGxlIHRvIFRMJ3MKKyAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICAgdWNTVEFJZDogICAgICAgIGlkZW50aWZpZXIgb2YgdGhlIHN0YXRpb24gYmVpbmcgcHJvY2Vzc2VkCisgICB2b3NEYXRhQnVmZjogICBwb2ludGVyIHRvIHRoZSByeCB2b3MgYnVmZmVyCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICAgIFZPU19TVEFUVVNfRV9JTlZBTDogICBpbnZhbGlkIGlucHV0IHBhcmFtZXRlcnMKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6ICAgcG9pbnRlciB0byBUTCBjYiBpcyBOVUxMIDsgYWNjZXNzIHdvdWxkIGNhdXNlIGEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZSBmYXVsdAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfU1RBUnhBdXRoCisoCisgIHZfUFZPSURfdCAgICAgcHZvc0dDdHgsCisgIHZfVThfdCAgICAgICAgdWNTVEFJZCwKKyAgdm9zX3BrdF90KiogICBwdm9zRGF0YUJ1ZmYsCisgIHZfQk9PTF90ICAgICAgYkZvcndhcmRJQVBQd2l0aExMQworKQoreworICAgV0xBTlRMX0NiVHlwZSogICAgICAgICAgIHBUTENiID0gTlVMTDsKKyAgIFdMQU5UTF9TVEFDbGllbnRUeXBlKiAgICBwQ2xpZW50U1RBID0gTlVMTDsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICB1Y0FzZjsgLyogQU1TRFUgc3ViIGZyYW1lICovCisgICB2X1UxNl90ICAgICAgICAgICAgICAgICAgdXNNUERVRE9mZnNldDsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICB1Y01QRFVIT2Zmc2V0OworICAgdl9VMTZfdCAgICAgICAgICAgICAgICAgIHVzTVBEVUxlbjsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICB1Y01QRFVITGVuOworICAgdl9VMTZfdCAgICAgICAgICAgICAgICAgIHVzQWN0dWFsSExlbiA9IDA7ICAgCisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgdWNUaWQ7CisjaWZkZWYgRkVBVFVSRV9XTEFOX1dBUEkKKyAgIHZfVTE2X3QgICAgICAgICAgICAgICAgICB1c0V0aGVyVHlwZSA9IDA7CisgICB0U2lyTWFjTWdtdEhkciAgICAgICAgICAgKmhkcjsKKyNlbmRpZgorICAgdl9VMTZfdCAgICAgICAgICAgICAgICAgIHVzUGt0TGVuOworICAgdm9zX3BrdF90KiAgICAgICAgICAgICAgIHZvc0RhdGFCdWZmIDsKKyAgIHZfUFZPSURfdCAgICAgICAgICAgICAgICBhdWNCREhlYWRlcjsKKyAgIFZPU19TVEFUVVMgICAgICAgICAgICAgICB2b3NTdGF0dXM7CisgICBXTEFOVExfUnhNZXRhSW5mb1R5cGUgICAgd1J4TWV0YUluZm87CisgICBzdGF0aWMgdl9VOF90ICAgICAgICAgICAgdWNQTVBEVUhMZW47CisgICB2X1UzMl90KiAgICAgICAgICAgICAgICAgU1RBTWV0YUluZm9QdHI7CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgdWNFc2Y9MDsgLyogZmlyc3Qgc3ViZnJhbWUgb2YgQU1TRFUgZmxhZyAqLworICAgdl9VNjRfdCAgICAgICAgICAgICAgICAgIHVsbGN1cnJlbnRS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U3RhICkKKyAgeworICAgIHZvc1N0YXR1cyA9IFdMQU5UTF9HZXRFdGhlclR5cGUoYXVjQkRIZWFkZXIsIHZvc0RhdGFCdWZmLCB1Y01QRFVITGVuLCAmdXNFdGhlclR5cGUpOworICAgIGlmKCBWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zU3RhdHVzKSApCisgICAgeworICAgICAgaWYgKCBXTEFOVExfTExDX1dBSV9UWVBFICA9PSB1c0V0aGVyVHlwZSApCisgICAgICB7CisgICAgICAgIGhkciA9IFdEQV9HRVRfUlhfTUFDX0hFQURFUihhdWNCREhlYWRlcik7CisgICAgICAgIGlmICggaGRyLT5mYy53ZXAgKQorICAgICAgICB7CisgICAgICAgICAgVExMT0dFKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgIldMQU4gVEw6V0FJIGZyYW1lIHdhcyByZWNlaXZlZCBlbmNyeXB0ZWQgLSBkcm9wcGluZyIpKTsKKyAgICAgICAgICAvKiBEcm9wIHBhY2tldCAqLworICAgICAgICAgIC8qVGVtcG9yYXJ5IGZpeCBhZGRlZCB0byBmaXggd2FwaSByZWtleSBpc3N1ZSovCisgICAgICAgICAgdm9zX3BrdF9yZXR1cm5fcGFja2V0KHZvc0RhdGFCdWZmKTsKKyAgICAgICAgICByZXR1cm4gdm9zU3RhdHVzOyAvL3JldHVybmluZyBzdWNjZXNzCisgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgaWYgKCAgV0xBTkhBTF9SWF9JU19VTlBST1RFQ1RFRF9XUElfRlJBTUUoYXVjQkRIZWFkZXIpICkgCisgICAgICAgIHsKKyAgICAgICAgICBUTExPR0UoVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAiV0xBT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gb3Igbm90ICovCisgIGlmKFZPU19UUlVFID09IHBDbGllbnRTVEEtPnVjSXNSZXBsYXlDaGVja1ZhbGlkKQorICB7CisgICAgICAvKiByZXBsYXkgY2hlY2sgaXMgbmVlZGVkIGZvciB0aGUgc3RhdGlvbiAqLworCisgICAgICAvKiBjaGVjayB3aGV0aGVyIGZyYW1lIGlzIEFNU0RVIGZyYW1lICovCisgICAgICBpZiAoIDAgIT0gdWNBc2YgKQorICAgICAgeworICAgICAgICAgIC8qIFNpbmNlIHZpcmdvIGNhbid0IHNlbmQgQU1TRFUgZnJhbWVzIHRoaXMgbGVnIG9mIHRoZSBjb2RlIAorICAgICAgICAgICAgIHdhcyBub3QgdGVzdGVkIHByb3Blcmx5LCBpdCBuZWVkcyB0byBiZSB0ZXN0ZWQgcHJvcGVybHkqLworICAgICAgICAgIC8qIEZyYW1lIGlzIEFNU0RVIGZyYW1lLiBBcyBwZXIgODAyLjExbiBvbmx5IGZpcnN0CisgICAgICAgICAgICAgc3ViZnJhbWUgd2lsbCBoYXZlIHJlcGxheSBjb3VudGVyICovCisgICAgICAgICAgdWNFc2YgPSAgV0RBX0dFVF9SWF9FU0YoIGF1Y0JESGVhZGVyICk7CisgICAgICAgICAgaWYoIDAgIT0gdWNFc2YgKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdl9CT09MX3Qgc3RhdHVzOworICAgICAgICAgICAgICAvKiBHZXR0aW5nIDQ4LWJpdCByZXBsYXkgY291bnRlciBmcm9tIHRoZSBSWCBCRCAqLworICAgICAgICAgICAgICB1bGxjdXJyZW50UmVwbGF5Q291bnRlciA9IFdEQV9EU19HZXRSZXBsYXlDb3VudGVyKGF1Y0JESGVhZGVyKTsKKyAKKyAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICJXTEFOIFRMOiBBTVNEVSBjdXJyZW50UmVwbGF5Q291bnRlciBbMHglbGxYXSIsdWxsY3VycmVudFJlcGxheUNvdW50ZXIpOworICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgLyogR2V0dGluZyA0OC1iaXQgcHJldmlvdXMgcmVwbGF5IGNvdW50ZXIgZnJvbSBUTCBjb250cm9sICBibG9jayAqLworICAgICAgICAgICAgICB1bGxwcmV2aW91c1JlcGxheUNvdW50ZXIgPSBwQ2xpZW50U1RBLT51bGxSZXBsYXlDb3VudGVyW3VjVGlkXTsKKworICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgIldMQU4gVEw6IEFNU0RVIHByZXZpb3VzUmVwbGF5Q291bnRlciBbMHglbGxYXSIsdWxscHJldmlvdXNSZXBsYXlDb3VudGVyKTsKKworICAgICAgICAgICAgICAvKiBJdCBpcyBmaXJzdCBzdWJmcmFtZSBvZiBBTVNEVSB0aHVzIGl0CisgICAgICAgICAgICAgICAgIGNvbmF0YWlucyByZXBsYXkgY291bnRlciBwZXJmb3JtIHRoZQorICAgICAgICAgICAgICAgICByZXBsYXkgY2hlY2sgZm9yIHRoaXMgZmlyc3Qgc3ViZnJhbWUqLworICAgICAgICAgICAgICBzdGF0dXMgPSAgV0xBTlRMX0lzUmVwbGF5UGFja2V0KCB1bGxjdXJyZW50UmVwbGF5Q291bnRlciwgdWxscHJldmlvdXNSZXBsYXlDb3VudGVyKTsKKyAgICAgICAgICAgICAgaWYoVk9TX0ZBTFNFID09IHN0YXR1cykKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIC8qIE5vdCBhIHJlcGxheSBwYWtldCwgdXBkYXRlIHByZXZpb3VzIHJlcGxheSBjb3VudGVyIGluIFRMIENCICovICAgIAorICAgICAgICAgICAgICAgICAgIHBDbGllbnRTVEEtPnVsbFJlcGxheUNvdW50ZXJbdWNUaWRdID0gdWxsY3VycmVudFJlcGxheUNvdW50ZXI7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICJXTEFOIFRMOiBBTVNEVSBEcm9wIHRoZSByZXBsYXkgcGFja2V0IHdpdGggUE4gOiBbMHglbGxYXSIsdWxsY3VycmVudFJlcGxheUNvdW50ZXIpOworCisgICAgICAgICAgICAgICAgICBwQ2xpZW50U1RBLT51bFRvdGFsUmVwbGF5UGFja2V0c0RldGVjdGVkKys7CisgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICJXTEFOIFRMOiBBTVNEVSB0b3RhbCBkcm9wcGVkIHJlcGxheSBwYWNrZXRzIG9uIFNUQSBJRCAlWCBpcyBbMHglWF0iLAorICAgICAgICAgICAgICAgICAgdWNTVEFJZCwgIHBDbGllbnRTVEEtPnVsVG90YWxSZXBsYXlQYWNrZXRzRGV0ZWN0ZWQpOworCisgICAgICAgICAgICAgICAgICAvKiBEcm9wIHRoZSBwYWNrZXQgKi8KKyAgICAgICAgICAgICAgICAgIHZvc19wa3RfcmV0dXJuX3BhY2tldCh2b3NEYXRhQnVmZik7CisgICAgICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgICB2X0JPT0xfdCBzdGF0dXM7CisKKyAgICAgICAgICAgLyogR2V0dGluZyA0OC1iaXQgcmVwbGF5IGNvdW50ZXIgZnJvbSB0aGUgUlggQkQgKi8KKyAgICAgICAgICAgdWxsY3VycmVudFJlcGxheUNvdW50ZXIgPSBXREFfRFNfR2V0UmVwbGF5Q291bnRlcihhdWNCREhlYWRlcik7CisKKyAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAiV0xBTiBUTDogTm9uLUFNU0RVIGN1cnJlbnRSZXBsYXlDb3VudGVyIFsweCVsbFhdIix1bGxjdXJyZW50UmVwbGF5Q291bnRlcik7CisKKyAgICAgICAgICAgLyogR2V0dGluZyA0OC1iaXQgcHJldmlvdXMgcmVwbGF5IGNvdW50ZXIgZnJvbSBUTCBjb250cm9sICBibG9jayAqLworICAgICAgICAgICB1bGxwcmV2aW91c1JlcGxheUNvdW50ZXIgPSBwQ2xpZW50U1RBLT51bGxSZXBsYXlDb3VudGVyW3VjVGlkXTsKKworICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgIldMQU4gVEw6IE5vbi1BTVNEVSBwcmV2aW91c1JlcGxheUNvdW50ZXIgWzB4JWxsWF0iLHVsbHByZXZpb3VzUmVwbGF5Q291bnRlcik7CisKKyAgICAgICAgICAgLyogSXQgaXMgbm90IEFNU0RVIGZyYW1lIHNvIHBlcmZvcm0gCisgICAgICAgICAgICAgIHJlYXBseSBjaGVjayBmb3IgZWFjaCBwYWNrZXQsIGFzCisgICAgICAgICAgICAgIGVhY2ggcGFja2V0IGNvbnRhaW5zIHZhbGlkIHJlcGxheSBjb3VudGVyKi8gCisgICAgICAgICAgIHN0YXR1cyA9ICBXTEFOVExfSXNSZXBsYXlQYWNrZXQoIHVsbGN1cnJlbnRSZXBsYXlDb3VudGVyLCB1bGxwcmV2aW91c1JlcGxheUNvdW50ZXIpOworICAgICAgICAgICBpZihWT1NfRkFMU0UgPT0gc3RhdHVzKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogTm90IGEgcmVwbGF5IHBha2V0LCB1cGRhdGUgcHJldmlvdXMgcmVwbGF5IGNvdW50ZXIgaW4gVEwgQ0IgKi8gICAgCisgICAgICAgICAgICAgICAgcENsaWVudFNUQS0+dWxsUmVwbGF5Q291bnRlclt1Y1RpZF0gPSB1bGxjdXJyZW50UmVwbGF5Q291bnRlcjsKKyAgICAgICAgICAgfQorICAgICAgICAgICBlbHNlCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiV0xBTiBUTDogTm9uLUFNU0RVIERyb3AgdGhlIHJlcGxheSBwYWNrZXQgd2l0aCBQTiA6IFsweCVsbFhdIix1bGxjdXJyZW50UmVwbGF5Q291bnRlcik7CisKKyAgICAgICAgICAgICAgIHBDbGllbnRTVEEtPnVsVG90YWxSZXBsYXlQYWNrZXRzRGV0ZWN0ZWQrKzsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICJXTEFOIFRMOiBOb24tQU1TRFUgdG90YWwgZHJvcHBlZCByZXBsYXkgcGFja2V0cyBvbiBTVEEgSUQgJVggaXMgWzB4JVhdIiwKKyAgICAgICAgICAgICAgICB1Y1NUQUlkLCBwQ2xpZW50U1RBLT51bFRvdGFsUmVwbGF5UGFja2V0c0RldGVjdGVkKTsKKworICAgICAgICAgICAgICAgLyogUmVwYWx5IHBhY2tldCwgZHJvcCB0aGUgcGFja2V0ICovCisgICAgICAgICAgICAgICB2b3NfcGt0X3JldHVybl9wYWNrZXQodm9zRGF0YUJ1ZmYpOworICAgICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgfQorICAgICAgfQorICB9Cit9CisvKkl0IGlzIGEgYnJvYWRhc3QgcGFja2V0IERQVSBoYXMgYWxyZWFkeSBkb25lIHJlcGxheSBjaGVjayBmb3IgCisgIGJyb2FkY2FzdCBwYWNrZXRzIG5vIG5lZWQgdG8gZG8gcmVwbGF5IGNoZWNrIG9mIHRoZXNlIHBhY2tldHMqLworCisgIGlmICggTlVMTCAhPSB2b3NEYXRhQnVmZiApCisgIHsKKyAgICBpZiggV0xBTl9TVEFfU09GVEFQID09IHBDbGllbnRTVEEtPndTVEFEZXNjLndTVEFUeXBlKQorICAgIHsKKyAgICAgIFdMQU5UTF9Gd2RQa3RUb0hERCggcHZvc0dDdHgsIHZvc0RhdGFCdWZmLCB1Y1NUQUlkICk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICB3UnhNZXRhSW5mby51Y1VQID0gdWNUaWQ7CisgICAgICB3UnhNZXRhSW5mby5yc3NpQXZnID0gcENsaWVudFNUQS0+cnNzaUF2ZzsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworICAgICAgaWYgKFdMQU5fU1RBX1RETFMgPT0gcENsaWVudFNUQS0+d1NUQURlc2Mud1NUQVR5cGUpCisgICAgICB7CisgICAgICAgICAgd1J4TWV0YUluZm8uaXNTdGFUZGxzID0gVFJVRTsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgICB3UnhNZXRhSW5mby5pc1N0YVRkbHMgPSBGQUxTRTsKKyAgICAgIH0KKyNlbmRpZgorICAgICAgcENsaWVudFNUQS0+cGZuU1RBUngoIHB2b3NHQ3R4LCB2b3NEYXRhQnVmZiwgdWNTVEFJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJndSeE1ldGFJbmZvICk7CisgICAgfQorICB9LyogaWYgbm90IE5VTEwgKi8KKworICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfS8qIFdMQU5UTF9TVEFSeEF1dGggKi8KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5UTF9TVEFSeERpc2MKKworICBERVNDUklQVElPTgorICAgIFJlY2VpdmUgaW4gZGlzY29ubmVjdGVkIHN0YXRlIC0gbm8gZGF0YSBhbGxvd2VkCisKKyAgREVQRU5ERU5DSUVTCisgICAgVGhlIFNUQSBtdXN0IGJlIHJlZ2lzdGVyZWQgd2l0aCBUTCBiZWZvcmUgdGhpcyBmdW5jdGlvbiBjYW4gYmUgY2FsbGVkLgorCisgIFBBUkFNRVRFUlMKKworICAgSU4KKyAgIHB2b3NHQ3R4OiAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFuZGxlIHRvIFRMJ3MKKyAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICAgdWNTVEFJZDogICAgICAgIGlkZW50aWZpZXIgb2YgdGhlIHN0YXRpb24gYmVpbmcgcHJvY2Vzc2VkCisgICB2b3NEYXRhQnVmZjogICBwb2ludGVyIHRvIHRoZSByeCB2b3MgYnVmZmVyCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfU1RBUnhEaXNjCisoCisgIHZfUFZPSURfdCAgICAgcHZvc0dDdHgsCisgIHZfVThfdCAgICAgICAgdWNTVEFJZCwKKyAgdm9zX3BrdF90KiogICBwdm9zRGF0YUJ1ZmYsCisgIH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NrZXQgc2hvdWxkIG5vdCBiZSByZWNlaXZlZCBpbiBzdGF0ZSBkaXNjb25uZWN0ZWQiCisgICAgICAgICAgICAgIiAtIGRyb3BwaW5nIikpOworICB2b3NfcGt0X3JldHVybl9wYWNrZXQoKnB2b3NEYXRhQnVmZik7CisgICpwdm9zRGF0YUJ1ZmYgPSBOVUxMOworCisgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9LyogV0xBTlRMX1NUQVJ4RGlzYyAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICBQcm9jZXNzaW5nIG1haW4gbG9vcHMgZm9yIE1BSU4gYW5kIFRYIHRocmVhZHMKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5UTF9NY1Byb2Nlc3NNc2cKKworICBERVNDUklQVElPTgorICAgIENhbGxlZCBieSBWT1NTIHdoZW4gYSBtZXNzYWdlIHdhcyBzZXJpYWxpemVkIGZvciBUTCB0aHJvdWdoIHRoZQorICAgIG1haW4gdGhyZWFkL3Rhc2suCisKKyAgREVQRU5ERU5DSUVTCisgICAgVGhlIFRMIG11c3QgYmUgaW5pdGlhbGl6ZWQgYmVmb3JlIHRoaXMgZnVuY3Rpb24gY2FuIGJlIGNhbGxlZC4KKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHB2b3NHQ3R4OiAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFuZGxlIHRvIFRMJ3MKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQKKyAgICBtZXNzYWdlOiAgICAgICAgdHlwZSBhbmQgY29udGVudCBvZiB0aGUgbWVzc2FnZQorCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICAgIFZPU19TVEFUVVNfRV9JTlZBTDogICBpbnZhbGlkIGlucHV0IHBhcmFtZXRlcnMKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6ICAgcG9pbnRlciB0byBUTCBjYiBpcyBOVUxMIDsgYWNjZXNzIHdvdWxkIGNhdXNlIGEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZSBmYXVsdAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfTWNQcm9jZXNzTXNnCisoCisgIHZfUFZPSURfdCAgICAgICAgcHZvc0dDdHgsCisgIHZvc19tc2dfdCogICAgICAgbWVzc2FnZQorKQoreworICAgV0xBTlRMX0NiVHlwZSogIHBUTENiID0gTlVMTDsKKyAgIHRBZGRCQUluZCogICAgICBwdEFkZEJhSW5kID0gTlVMTDsKKyAgIHREZWxCQUluZCogICAgICBwdERlbEJhSW5kID0gTlVMTDsKKyAgIHRBZGRCQVJzcCogICAgICBwdEFkZEJhUnNwID0gTlVMTDsKKyAgIHZvc19tc2dfdCAgICAgICB2b3NNZXNzYWdlOworICAgVk9TX1NUQVRVUyAgICAgIHZvc1N0YXR1czsKKyAgIHRwRmx1c2hBQ1JzcCBGbHVzaEFDUnNwUHRyOworICAvKi0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAt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mJhU2Vzc2lvbi5TVEFJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdEFkZEJhSW5kLT5iYVNlc3Npb24uYmFUSUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodl9VMzJfdClwdEFkZEJhSW5kLT5iYVNlc3Npb24uYmFCdWZmZXJTaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRBZGRCYUluZC0+YmFTZXNzaW9uLndpblNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdEFkZEJhSW5kLT5iYVNlc3Npb24uU1NOKTsKKyAgICBwdEFkZEJhUnNwID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKCpwdEFkZEJhUnNwKSk7CisKKyAgICBpZiAoIE5VTEwgPT0gcHRBZGRCYVJzcCApCisgICAgeworICAgICAgVExMT0dFKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICJXTEFOIFRMOiBmYXRhbCBmYWlsdXJlLCBjYW5ub3QgYWxsb2NhdGUgQkEgUnNwIHN0cnVjdHVyZSIpKTsKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX05PTUVNOworICAgIH0KKworICAgIGlmICggVk9TX1NUQVRVU19TVUNDRVNTID09IHZvc1N0YXR1cyApCisgICAgeworICAgICAgVExMT0cyKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAiV0xBTiBUTDogU2VuZGluZyBzdWNjZXNzIGluZGljYXRpb24gdG8gSEFMIGZvciBBREQgQkEiKSk7CisgICAgICAvKlNlbmQgc3VjY2VzcyovCisgICAgICBwdEFkZEJhUnNwLT5tZXNnVHlwZSAgICA9IFdEQV9IRERfQUREQkFfUlNQOwor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U3RhdHVzICA9IFdMQU5UTF9CYVNlc3Npb25EZWwocHZvc0dDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdERlbEJhSW5kLT5zdGFJZHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdERlbEJhSW5kLT5iYVRJRCk7CisKKyAgICBpZiAoIFZPU19TVEFUVVNfU1VDQ0VTUyAhPSB2b3NTdGF0dXMgKQorICAgIHsKKyAgICAgIFRMTE9HRShWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIldMQU4gVEw6IEZhaWxlZCB0byBkZWwgQkEgc2Vzc2lvbiBTVEE6JWQgVElEOiVkIFN0YXR1cyA6JWQiLAorICAgICAgICAgICAgICAgcHREZWxCYUluZC0+c3RhSWR4LAorICAgICAgICAgICAgICAgcHREZWxCYUluZC0+YmFUSUQsCisgICAgICAgICAgICAgICB2b3NTdGF0dXMpKTsKKyAgICB9CisgICAgV0xBTlRMX01jRnJlZU1zZyAocHZvc0dDdHgsIG1lc3NhZ2UpOworICAgIGJyZWFrOworICBkZWZhdWx0OgorICAgIC8qbm8gcHJvY2Vzc2luZyBmb3Igbm93Ki8KKyAgICBicmVhazsKKyAgfQorCisgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9LyogV0xBTlRMX1Byb2Nlc3NNYWluTWVzc2FnZSAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5UTF9NY0ZyZWVNc2cKKworICBERVNDUklQVElPTgorICAgIENhbGxlZCBieSBWT1NTIHRvIGZyZWUgYSBnaXZlbiBUTCBtZXNzYWdlIG9uIHRoZSBNYWluIHRocmVhZCB3aGVuIHRoZXJlCisgICAgYXJlIG1lc3NhZ2VzIHBlbmRpbm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ICAgICAgICAgICAiV0xBTiBUTDpSZWNlaXZlZCBtZXNzYWdlOiAlZCB0aHJvdWdoIHR4IGZsb3ciLCBtZXNzYWdlLT50eXBlKSk7CisKKyAgc3dpdGNoKCBtZXNzYWdlLT50eXBlICkKKyAgeworICBjYXNlIFdMQU5UTF9UWF9TSUdfU1VTUEVORDoKKyAgICB2b3NTdGF0dXMgPSBXTEFOVExfU3VzcGVuZENCKCBwdm9zR0N0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXTEFOVExfU3VzcGVuZENCVHlwZSltZXNzYWdlLT5ib2R5cHRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZS0+cmVzZXJ2ZWQpOworICAgIGJyZWFrOworICBjYXNlIFdMQU5UTF9UWF9SRVNfTkVFREVEOgorICAgIHZvc1N0YXR1cyA9IFdMQU5UTF9HZXRUeFJlc291cmNlc0NCKCBwdm9zR0N0eCApOworICAgICBicmVhazsKKworICBjYXNlIFdEQV9EU19UWF9TVEFSVF9YTUlUOgorICAgICAgV0xBTlRMX0NsZWFyVHhYbWl0UGVuZGluZyhwdm9zR0N0eCk7CisgICAgICB2b3NTdGF0dXMgPSBXREFfRFNfVHhGcmFtZXMoIHB2b3NHQ3R4ICk7CisgICAgICBicmVhazsKKworICBjYXNlIFdEQV9EU19GSU5JU0hfVUxBOgorICAgIGNhbGxiYWNrQ29udGV4dCA9IG1lc3NhZ2UtPmJvZHlwdHI7CisgICAgY2FsbGJhY2tSb3V0aW5lID0gbWVzc2FnZS0+Y2FsbGJhY2s7CisgICAgaWYgKCBOVUxMICE9IGNhbGxiYWNrUm91dGluZSApCisgICAgeworICAgICAgY2FsbGJhY2tSb3V0aW5lKGNhbGxiYWNrQ29udGV4dCk7CisgICAgfQorICAgIGJyZWFrOworCisgIGNhc2UgV0xBTlRMX1RYX1NOQVBTSE9UOgorICAgIC8qRHVtcGluZyBUTCBTdGF0ZSBhbmQgdGhlbiBjb250aW51aW5nIHRvIHByaW50CisgICAgICB0aGUgRFhFIER1bXAqLworICAgIFdMQU5UTF9UeFRocmVhZERlYnVnSGFuZGxlcihwdm9zR0N0eCk7CisgICAgV0RBX1RyYW5zcG9ydENoYW5uZWxEZWJ1ZyhOVUxMLCBWT1NfVFJVRSwgVk9TX0ZBTFNFKTsKKyAgICBicmVhazsKKworICBjYXNlIFdMQU5UTF9UWF9GQVRBTF9FUlJPUjoKKyAgICBXTEFOVExfRmF0YWxFcnJvckhhbmRsZXIocHZvc0dDdHgpOworICAgIGJyZWFrOworCisgIGNhc2UgV0xBTlRMX1RYX0ZXX0RFQlVHOgorICAgIHZvc19md0R1bXBSZXEoMjc0LCAwLCAwLCAwLCAwLCAxKTsgLy9Bc3luYyBldmVudAorICAgIGJyZWFrOworCisgIGNhc2UgV0xBTlRMX1RYX0tJQ0tEWEU6CisgICAgV0RBX1RyYW5zcG9ydEtpY2tEeGUoKTsKKyAgICBicmVhazsKKworICBkZWZhdWx0OgorICAgIC8qbm8gcHJvY2Vzc2luZyBmb3Igbm93Ki8KKyAgICBicmVhazsKKyAgfQorCisgIHJldHVybiB2b3NTdGF0dXM7Cit9LyogV0xBTlRMX1R4UHJvY2Vzc01zZyAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5UTF9NY0ZyZWVNc2cKKworICBERVNDUklQVElPTgorICAgIENhbGxlZCBieSBWT1NTIHRvIGZyZWUgYSBnaXZlbiBUTCBtZXNzYWdlIG9uIHRoZSBNYWluIHRocmVhZCB3aGVuIHRoZXJlCisgICAgYXJlIG1lc3NhZ2VzIHBlbmRpbmcgaW4gdGhlIHF1ZXVlIHdoZW4gdGhlIHdob2xlIHN5c3RlbSBpcyBiZWVuIHJlc2V0LgorICAgIEZvciBub3csIFRMIGRvZXMgbm90IGFsbG9jYXRlIGFueSBib2R5IHNvIHRoaXM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cmFuc21pdHRlZC4gUHJldmlvdXNseSB1bnNlbnQgZnJhbWUgd2lsbAorICAgIGJlIHJlbGVhc2VkLgorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5UTF9UeEZDRnJhbWUKKygKKyAgdl9QVk9JRF90ICAgICAgIHB2b3NHQ3R4CispCit7CisjaWYgMAorICBXTEFOVExfQ2JUeXBlKiAgICAgIHBUTENiID0gTlVMTDsKKyAgVk9TX1NUQVRVUyAgICAgICAgICB2b3NTdGF0dXM7CisgIHRwSGFsRmNUeEJkICAgICAgICAgcHZGY1R4QmQgPSBOVUxMOworICB2b3NfcGt0X3QgKiAgICAgICAgIHBQYWNrZXQgPSBOVUxMOworICB2X1U4X3QgICAgICAgICAgICAgIHVjU1RBSWQgPSAwOworICB2X1U4X3QgICAgICAgICAgICAgIHVjQml0Q2hlY2sgPSAxOworCisgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAiV0xBTiBUTDogU2VuZCBGQyBmcmFtZSAlcyIsIF9fZnVuY19fKTsKKworICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgIFNhbml0eSBjaGVjaworICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisgIGlmICggTlVMTCA9PSBwdm9zR0N0eCApCisgIHsKKyAgICBUTExPR0UoVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiV0xBTi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ZiAoTlVMTCAhPSBwVExDYi0+dm9zVHhGQ0J1ZikKKyAgeworICAgIFRMTE9HMihWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICIlczogUHJldmlvdXMgRkMgVFggQkQgbm90IHNlbnRcbiIsIF9fZnVuY19fKSk7CisgICAgdm9zX3BrdF9yZXR1cm5fcGFja2V0KHBUTENiLT52b3NUeEZDQnVmKTsKKyAgfQorCisgIHBUTENiLT52b3NUeEZDQnVmID0gcFBhY2tldDsKKworICB2b3NfcGt0X3NldF91c2VyX2RhdGFfcHRyKCBwUGFja2V0LCBWT1NfUEtUX1VTRVJfREFUQV9JRF9UTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodl9QVk9JRF90KVdMQU5UTF9UeENvbXBEZWZhdWx0Q2IpOworICB2b3NTdGF0dXMgPSBXREFfRFNfU3RhcnRYbWl0KHB2b3NHQ3R4KTsKKworICBUTExPRzIoVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgIldMQU4gVEw6IHNlbmQgRkMgZnJhbWUgbGVhdmUgJXMiLCBfX2Z1bmNfXykpOworI2VuZGlmCisgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9CisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOVExfR2V0VHhSZXNvdXJjZXNDQgorCisgIERFU0NSSVBUSU9OCisgICAgUHJvY2Vzc2luZyBmdW5jdGlvbiBmb3IgUmVzb3VyY2UgbmVlZGVkIHNpZ25hbC4gQSByZXF1ZXN0IHdpbGwgYmUgaXNzdWVkCisgICAgdG8gQkFMIHRvIGdldCBtb3JlIHR4IHJlc291cmNlcy4KKworICBERVBFTkRFTkNJRVMKKyAgICBUaGUgVEwgbXVzdCBiZSBpbml0aWFsaXplZCBiZWZvcmUgdGhpcyBmdW5jdGlvbiBjYW4gYmUgY2FsbGVkLgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICAgIFZPU19TVEFUVVNfRV9GQVVMVDogICBwb2ludGVyIHRvIFRMIGNiIGlzIE5VTEwgOyBhY2Nlc3Mgd291bGQgY2F1c2UgYQorICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlIGZhdWx0CisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisgIE90aGVyIHZhbHVlcyBjYW4gYmUgcmV0dXJuZWQgYXMgYSByZXN1bHQgb2YgYSBmdW5jdGlvbiBjYWxsLCBwbGVhc2UgY2hlY2sKKyAgY29ycmVzcG9uZGluZyBBUEkgZm9yIG1vcmUgaW5mby4KKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlRMX0dldFR4UmVzb3VyY2VzQ0IKKygKKyAgdl9QVk9JRF90ICAgICAgICBwdm9zR0N0eAorKQoreworICBXTEFOVExfQ2JUeXBlKiAgcFRMQ2IgICAgICA9IE5VTEw7CisgIHZfVTMyX3QgIC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kMiKSk7CisgICAgdm9zU3RhdHVzID1XREFfRFNfU3RhcnRYbWl0KHB2b3NHQ3R4KTsKKyAgfQorICByZXR1cm4gdm9zU3RhdHVzOworfS8qV0xBTlRMX0dldFR4UmVzb3VyY2VzQ0IqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICBVdGlsaXR5IGZ1bmN0aW9ucworICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlRMX1RyYW5zbGF0ZTgwMjNUbzgwMjExSGVhZGVyCisKKyAgREVTQ1JJUFRJT04KKyAgICBJbmxpbmUgZnVuY3Rpb24gZm9yIHRyYW5zbGF0aW5nIGFuZCA4MDIuMTEgaGVhZGVyIGludG8gYW4gODAyLjMgaGVhZGVyLgorCisgIERFUEVOREVOQ0lFUworCisKKyAgUEFSQU1FVEVSUworCisgICBJTgorICAgIHBUTENiOiAgICAgICAgICAgIFRMIGNvbnRyb2wgYmxvY2sKKyAgIElOL09VVCAKKyAgICB1Y1N0YUlkOiAgICAgICAgICBzdGF0aW9uIElELiBJbmNhc2Ugb2YgVERMUywgdGhpcyByZXR1cm5zIGFjdHVhbCBURExTCisgICAgICAgICAgICAgICAgICAgICAgc3RhdGlvbiBJRCB1c2VkCisKKyAgIElOL09VVAorICAgIHZvc0RhdGFCdWZmOiAgICAgIHZvcyBkYXRhIGJ1ZmZlciwgd2lsbCBjb250YWluIHRoZSBuZXcgaGVhZGVyIG9uIG91dHB1dAorCisgICBPVVQKKyAgICBwdm9zU3RhdHVzOiAgICAgICBzdGF0dXMgb2YgdGhlIG9wZXJhdGlvbgorCisgIFJ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clNpemUgPSAwOworICB2X1ZPSURfdCAgICAgICAgICAgICAgICpwcHZCREhlYWRlciA9IE5VTEw7CisgIFdMQU5UTF9TVEFDbGllbnRUeXBlKiAgcENsaWVudFNUQSA9IE5VTEw7CisgIHZfVThfdCAgICAgICAgICAgICAgICAgdWNRb1NPZmZzZXQgPSBXTEFOODAyMTFfTUFOREFUT1JZX0hFQURFUl9TSVpFOworICB2X1U4X3QgICAgICAgICAgICAgICAgIHVjU3RhSWQ7CisjaWZkZWYgRkVBVFVSRV9XTEFOX0VTRV9VUExPQUQKKyAgdl9CT09MX3QgICAgICAgICAgICAgICBiSUFQUFR4d2l0aExMQyA9IFZPU19GQUxTRTsKKyAgdl9TSVpFX3QgICAgICAgICAgICAgICB3SUFQUFNuYXBTaXplID0gV0xBTlRMX0xMQ19IRUFERVJfTEVOOworICB2X1U4X3QgICAgICAgICAgICAgICAgIHdJQVBQU25hcFtXTEFOVExfTExDX0hFQURFUl9MRU5dID0gezB9OworI2VuZGlmCisgICp1Y1dEU0VuYWJsZWQgPSAwOyAvLyBkZWZhdWx0IFdEUyBvZmYuCisgIHZvc1N0YXR1cyA9IHZvc19wa3RfcG9wX2hlYWQoIHZvc0RhdGFCdWZmLCAmdzgwMjNIZWFkZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih3ODAyM0hlYWRlcikpOworCisgIGlmICggVk9TX1NUQVRVU19TVUNDRVNTICE9IHZvc1N0YXR1cyApCisgIHsKKyAgICAgVExMT0dFKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAiV0xBTiBUTDogUGFja2V0IHBvcCBoZWFkZXIgZmFpbHMgb24gV0xBTlRMX1RyYW5zbGF0ZTgwMjNUbzgwMjExSGVhZGVyIikpOworICAgICByZXR1cm4gdm9zU3RhdHVzOworICB9CisKKyAgaWYoIE5VTEwgPT0gcHVjU3RhSWQgKQorICB7CisgICAgIF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3RhdGUgPT0gV0xBTlRMX1NUQV9BVVRIRU5USUNBVEVEKSAmJgorICAgICAgICAgICghcFRMQ2ItPmF0bFNUQUNsaWVudHNbdWNJbmRleF0tPnVjVHhTdXNwZW5kZWQpICYmCisgICAgICAgICAgdm9zX21lbV9jb21wYXJlKCAodm9pZCopcFRMQ2ItPmF0bFNUQUNsaWVudHNbdWNJbmRleF0tPndTVEFEZXNjLnZTVEFNQUNBZGRyZXNzLmJ5dGVzLAorICAgICAgICAgICAgKHZvaWQqKXc4MDIzSGVhZGVyLnZEQSwgNikgKQorICAgICAgeworICAgICAgICBUTExPR0UoVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAgICJXTEFOIFRMOiBHb3QgYSBURExTIHN0YXRpb24uIFVzaW5nIHRoYXQgaW5kZXgiKSk7CisgICAgICAgIHVjU3RhSWQgPSB1Y0luZGV4OworICAgICAgICAqcHVjU3RhSWQgPSB1Y1N0YUlkOworICAgICAgICBwQ2xpZW50U1RBID0gcFRMQ2ItPmF0bFNUQUNsaWVudHNbdWNTdGFJZF07CisgICAgICAgIGlmICggTlVMTCA9PSBwQ2xpZW50U1RBICkKKyAgICAgICAgeworICAgICAgICAgICAgVExMT0dFKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICJXTEFOIFRMOkNsaWVudCBNZW1vcnkgd2FzIG5vdCBhbGxvY2F0ZWQgb24gJXMiLCBfX2Z1bmNfXykpOworICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgICAgfQorICAgIH0KKyAgfQorI2VuZGlmCisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFX1VQTE9BRAoraWYgKCgwID09IHc4MDIzSGVhZGVyLnVzTG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RlciBmYWlscyBvbiIKKyAgICAgICAgICAgICAgICAgICIgV0xBTlRMX1RyYW5zbGF0ZTgwMjNUbzgwMjExSGVhZGVyIikpOworICAgICAgIHJldHVybiB2b3NTdGF0dXM7CisgICAgfQorICAgIH0KKyNlbHNlCisgICAgdm9zU3RhdHVzID0gdm9zX3BrdF9wdXNoX2hlYWQodm9zRGF0YUJ1ZmYsIFdMQU5UTF9MTENfSEVBREVSLAorICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoV0xBTlRMX0xMQ19IRUFERVIpKTsKKworICAgIGlmICggVk9TX1NUQVRVU19TVUNDRVNTICE9IHZvc1N0YXR1cyApCisgICAgeworICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIldMQU4gVEw6IFBhY2tldCBwdXNoIExMQyBoZWFkZXIgZmFpbHMgb24iCisgICAgICAgICAgICAgICAgICAiIFdMQU5UTF9UcmFuc2xhdGU4MDIzVG84MDIxMUhlYWRlciIpKTsKKyAgICAgICByZXR1cm4gdm9zU3RhdHVzOworICAgIH0KKyNlbmRpZgorICB9LypJZiBhZGQgTExDIGlzIGVuYWJsZWQqLworICBlbHNlCisgIHsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFX1VQTE9BRAorICAgICAgYklBUFBUeHdpdGhMTEMgPSBWT1NfRkFMU0U7IC8qUmVzZXQgdGhlIEZsYWcgaGVyZSB0byBzdGFydCBhZnJlc2ggd2l0aCB0aGUgbmV4dCBUWCBwa3QqLworI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9FU0VfVVBMT0FEICovCisgICAgICAgVExMT0cyKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgIldMQU4gVEw6IFNUQSBDbGllbnQgcmVnaXN0ZXJlZC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ICAgICAgcHc4MDIxMUhlYWRlci0+d0ZybUN0cmwuZnJvbURTICAgICAgICA9IDA7CisKKyAgICAgICAgdm9zX2NvcHlfbWFjYWRkciggKHZfTUFDQUREUl90KikmcHc4MDIxMUhlYWRlci0+dkExLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodl9NQUNBRERSX3QqKSZ3ODAyM0hlYWRlci52REEpOworICAgICAgICB2b3NfbWVtX2NvcHkoIHB3ODAyMTFIZWFkZXItPnZBMywKKyAgICAgICAgICAgICAgJnBDbGllbnRTVEEtPndTVEFEZXNjLnZCU1NJRGZvcklCU1MgLAorICAgICAgICAgICAgICBWT1NfTUFDX0FERFJfU0laRSk7CisgICAgICAgIGJyZWFrOworCisgICAgIGNhc2UgV0xBTl9TVEFfQlRfQU1QOgorICAgICAgICAqdWNXRFNFbmFibGVkID0gMTsgLy8gV0RTIG9uLgorICAgICAgICBwdzgwMjExSGVhZGVyLT53RnJtQ3RybC50b0RTICAgICAgICAgID0gMTsKKyAgICAgICAgcHc4MDIxMUhlYWRlci0+d0ZybUN0cmwuZnJvbURTICAgICAgICA9IDE7CisgICAgICAgIHZvc19jb3B5X21hY2FkZHIoICh2X01BQ0FERFJfdCopJnB3ODAyMTFIZWFkZXItPnZBMSwKKyAgICAgICAgICAgICAgJnBDbGllbnRTVEEtPndTVEFEZXNjLnZTVEFNQUNBZGRyZXNzKTsKKyAgICAgICAgdm9zX21lbV9jb3B5KCBwdzgwMjExSGVhZGVyLT52QTIsCisgICAgICAgICAgICAgIHc4MDIzSGVhZGVyLnZTQSwgVk9TX01BQ19BRERSX1NJWkUpOworICAgICAgICB2b3NfY29weV9tYWNhZGRyKCAodl9NQUNBRERSX3QqKSZwdzgwMjExSGVhZGVyLT52QTMsCisgICAgICAgICAgICAgICZwQ2xpZW50U1RBLT53U1RBRGVzYy52U1RBTUFDQWRkcmVzcyk7CisgICAgICAgIC8qIGZpbGwgdGhlIG9wdGlvbmFsIEE0IGhlYWRlciAqLworICAgICAgICB2b3NfbWVtX2NvcHkoIHB3ODAyMTFIZWFkZXItPm9wdHZBNCwKKyAgICAgICAgICAgICAgdzgwMjNIZWFkZXIudlNBLCBWT1NfTUFDX0FERFJfU0laRSk7CisgICAgICAgIFRMTE9HMihWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICJCVEFNUCBDQVNFIE5PVyAtLS0tLS0tLS1zdGFpZD0lZCIsCisgICAgICAgICAgICAgICAgIHVjU3RhSWQpKTsKKyAgICAgICAgYnJlYWs7CisKKyAgICAgY2FzZSBXTEFOX1NUQV9TT0ZUQVA6CisgICAgICAgICp1Y1dEU0VuYWJsZWQgPSAwOyAvLyBXRFMgb2ZmLgorICAgICAgICBwdzgwMjExSGVhZGVyLT53RnJtQ3RybC50b0RTICAgICAgICAgID0gMDsKKyAgICAgICAgcHc4MDIxMUhlYWRlci0+d0ZybUN0cmwuZnJvbURTICAgICAgICA9IDE7CisgICAgICAgIC8qQ29weSB0aGUgREEgdG8gQTEqLworICAgICAgICB2b3NfbWVtX2NvcHkoIHB3ODAyMTFIZWFkZXItPnZBMSwgdzgwMjNIZWFkZXIudkRBICwgVk9TX01BQ19BRERSX1NJWkUpOyAgIAorICAgICAgICB2b3NfY29weV9tYWNhZGRyKCAodl9NQUNBRERSX3QqKSZwdzgwMjExSGVhZGVyLT52QTIsCisgICAgICAgICAgICAgICZwQ2xpZW50U1RBLT53U1RBRGVzYy52U2VsZk1BQ0FkZHJlc3MpOworICAgICAgICB2b3NfbWVtX2NvcHkoIHB3ODAyMTFIZWFkZXItPnZBMywKKyAgICAgICAgICAgICAgdzgwMjNIZWFkZXIudlNBLCBWT1NfTUFDX0FERFJfU0laRSk7CisgICAgICAgIFRMTE9HMihWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICJzdyA4MDIgdG8gODAyMTEgc29mdGFwIGNhc2UgIC0tLS0tLS0tLXN0YWlkPSVkIiwKKyAgICAgICAgICAgICAgICAgdWNTdGFJZCkpOworICAgICAgICBicmVhazsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworICAgICBjYXNlIFdMQU5fU1RBX1RETFM6CisgICAgICAgIHB3ODAyMTFIZWFkZXItPndGcm1DdHJsLnRvRFMgICAgICAgICAgPSAwOworICAgICAgICBwdzgwMjExSGVhZGVyLT53RnJtQ3RybC5mcm9tRFMgICAgICAgID0gMDsKKyAgICAgICAgLypGaXggbWUqLworICAgICAgICB2b3NfY29weV9tYWNhZGRyKCAodl9NQUNBRERSX3QqKSZwdzgwMjExSGVhZGVyLT52QTEsCisgICAgICAgICAgICAgICZwQ2xpZW50U1RBLT53U1RBRGVzYy52U1RBTUFDQWRkcmVzcyk7CisgICAgICAgIHZvc19tZW1fY29weSggcHc4MDIxMUhlYWRlci0+dkEzLAorICAgICAgICAgICAgICAmcENsaWVudFNUQS0+d1NUQURlc2MudkJTU0lEZm9ySUJTUyAsCisgICAgICAgICAgICAgIFZPU19NQUNfQUREUl9TSVpFKTsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAoIlRMOlRETFMgQ0FTRSBOT1cgLS0tLS0tLS0tc3RhaWQ9JWQiKSwgdWNTdGFJZCk7CisgICAgICAgIGJyZWFrOworI2VuZGlmCisgICAgIGNhc2UgV0xBTl9TVEFfSU5GUkE6CisgICAgIGRlZmF1bHQ6CisgICAgICAgIHB3ODAyMTFIZWFkZXItPndGcm1DdHJsLnRvRFMgICAgICAgICAgPSAxOworICAgICAgICBwdzgwMjExSGVhZGVyLT53RnJtQ3RybC5mcm9tRFMgICAgICAgID0gMDsKKyAgICAgICAgdm9zX2NvcHlfbWFjYWRkciggKHZfTUFDQUREUl90KikmcHc4MDIxMUhlYWRlci0+dkExLAorICAgICAgICAgICAgICAmcENsaWVudFNUQS0+d1NUQURlc2MudlNUQU1BQ0FkZHJlc3MpOworICAgICAgICB2b3NfbWVtX2NvcHkoIHB3ODAyMTFIZWFkZXItPnZBMywgdzgwMjNIZWFkZXIudkRBICwgVk9TX01BQ19BRERSX1NJWkUpOworICAgICAgICBUTExPRzIoVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAiUkVHVUxBUiBJTkZSQSBMSU5LIENBU0UtLS0tLS0tLS1zdGFpZD0lZCIsCisgICAgICAgICAgICAgICAgIHVjU3RhSWQpKTsKKyAgICAgICAgYnJlYWs7CisgIH0KKyAgLy8gT0sgbm93IHdlIGhhdmUgdGhlIHNwYWNlLiBGaWxsIHRoZSA4MDIxMSBoZWFkZXIKKyAgLyogRmlsbCBBMiAqLworICBwdzgwMjExSGVhZGVyID0gKFdMQU5UTF84MDIxMUhlYWRlclR5cGUgKikocHB2QkRIZWFkZXIpOworICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfS8qV0xBTlRMX1RyYW5zbGF0ZTgwMjNUbzgwMjExSGVhZGVyKi8KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICBCRUdJTiBMT0cgRlVOQ1RJT04gICAgISEhIFJlbW92ZSBtZSBvciBjbGVhbiBtZQorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworI2lmIDAgLy9kZWYgV0xBTlRMX0RFQlVHCisKKyNkZWZpbmUgV0xBTlRMX0RFQlVHX0ZSQU1FX0JZVEVfUEVSX0xJTkUgICAgMTYKKyNkZWZpbmUgV0xBTlRMX0RFQlVHX0ZSQU1FX0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QU4gVEw6MHglMnggMHglMnggMHglMnggMHglMngiLAorICAgICAgICAgICAgICAgIGxpbmVCdWZmZXJbaWR4ICogV0xBTlRMX0RFQlVHX0ZSQU1FX0JZVEVfUEVSX0JZVEVdLCBsaW5lQnVmZmVyWzEgKyBpZHggKiBXTEFOVExfREVCVUdfRlJBTUVfQllURV9QRVJfQllURV0sCisgICAgICAgICAgICAgICAgbGluZUJ1ZmZlclsyICsgaWR4ICogV0xBTlRMX0RFQlVHX0ZSQU1FX0JZVEVfUEVSX0JZVEVdLCBsaW5lQnVmZmVyWzMgKyBpZHggKiBXTEFOVExfREVCVUdfRlJBTUVfQllURV9QRVJfQllURV0pKTsKKyAgICAgIGlmKCgoaWR4ICsgMSkgKiBXTEFOVExfREVCVUdfRlJBTUVfQllURV9QRVJfQllURSkgPj0gbnVtQnl0ZXMpCisgICAgICAgICBicmVhazsKKyAgIH0KKworICAgcmV0dXJuOworfQorI2VuZGlmCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgIEVORCBMT0cgRlVOQ1RJT04KKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOVExfVHJhbnNsYXRlODAyMTFUbzgwMjNIZWFkZXIKKworICBERVNDUklQVElPTgorICAgIElubGluZSBmdW5jdGlvbiBmb3IgdHJhbnNsYXRpbmcgYW5kIDgwMi4xMSBoZWFkZXIgaW50byBhbiA4MDIuMyBoZWFkZXIuCisKKyAgREVQRU5ERU5DSUVTCisKKworICBQQVJBTUVURVJTCisKKyAgIElOCisgICAgcFRMQ2I6ICAgICAgICAgICAgVEwgY29udHJvb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sIHVjSGVhZGVyTGVuKTsKKworICBpZiAoIFZPU19TVEFUVVNfU1VDQ0VTUyAhPSB2b3NTdGF0dXMgKQorICB7CisgICAgIFRMTE9HRShWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiV0xBTiBUTDogRmFpbGVkIHRvIHBvcCA4MDIxMSBoZWFkZXIgZnJvbSBwYWNrZXQgJWQiLAorICAgICAgICAgICAgICAgIHZvc1N0YXR1cykpOworCisgICAgIHJldHVybiB2b3NTdGF0dXM7CisgIH0KKworICBzd2l0Y2ggKCB3ODAyMTFIZWFkZXIud0ZybUN0cmwuZnJvbURTICkKKyAgeworICBjYXNlIDA6CisgICAgaWYgKCB3ODAyMTFIZWFkZXIud0ZybUN0cmwudG9EUyApCisgICAgeworICAgICAgLy9Tb2Z0QVAgQVAgbW9kZQorICAgICAgdm9zX21lbV9jb3B5KCB3ODAyM0hlYWRlci52REEsIHc4MDIxMUhlYWRlci52QTMsIFZPU19NQUNfQUREUl9TSVpFKTsKKyAgICAgIHZvc19tZW1fY29weSggdzgwMjNIZWFkZXIudlNBLCB3ODAyMTFIZWFkZXIudkEyLCBWT1NfTUFDX0FERFJfU0laRSk7CisgICAgICBUTExPRzIoVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgIldMQU4gVEwgU29mdEFQOiA4MDIgMyBEQSAlMDh4IFNBICUwOHgiLAorICAgICAgICAgICAgICAgICAgdzgwMjNIZWFkZXIudkRBLCB3ODAyM0hlYWRlci52U0EpKTsKKyAgICB9CisgICAgZWxzZSAKKyAgICB7CisgICAgICAvKiBJQlNTICovCisgICAgICB2b3NfbWVtX2NvcHkoIHc4MDIzSGVhZGVyLnZEQSwgdzgwMjExSGVhZGVyLnZBMSwgVk9TX01BQ19BRERSX1NJWkUpOwor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9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgIldMQU4gVEw6IEZhaWxlZCB0byBwb3AgTExDIGhlYWRlciBmcm9tIHBhY2tldCAlZCIsCisgICAgICAgICAgICAgICAgICB2b3NTdGF0dXMpKTsKKworICAgICAgIHJldHVybiB2b3NTdGF0dXM7CisgICAgfQorCisgICAgLy9FeHRyYWN0IHRoZSBsZW5ndGgKKyAgICB2b3NfbWVtX2NvcHkoJnc4MDIzSGVhZGVyLnVzTGVuVHlwZSwKKyAgICAgICZhdWNMTENIZWFkZXJbV0xBTlRMX0xMQ19IRUFERVJfTEVOIC0gc2l6ZW9mKHc4MDIzSGVhZGVyLnVzTGVuVHlwZSldLAorICAgICAgc2l6ZW9mKHc4MDIzSGVhZGVyLnVzTGVuVHlwZSkgKTsKKyAgfQorICBlbHNlCisgIHsKKyAgICB2b3NTdGF0dXMgPSB2b3NfcGt0X2dldF9wYWNrZXRfbGVuZ3RoKHZvc0RhdGFCdWZmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ3ODAyM0hlYWRlci51c0xlblR5cGUpOworCisgICAgaWYgKCBWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gdm9zU3RhdHVzICkKKyAgICB7CisgICAgICAgVExMT0dFKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIldMQU4gVEw6IEZhaWxlZCB0byBnZXQgcGFja2V0IGxlbmd0aCAlZCIsCisgICAgICAgICAgICAgICAgICB2b3NTdGF0dXMpKTsKKworICAgICAgIHJldHVybiB2b3NTdGF0dXM7CisgICAgfQorCisgICAgVExMT0cyKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgIldMQU4gVEw6IEJUQU1QIGxlbiAoZXRoZXJ0eXBlKSBmbGQgPSAlZCIs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pOworICAgICAgdm9zX21lbV9jb3B5KCB3ODAyM0hlYWRlci52U0EsIHc4MDIxMUhlYWRlci52QTIsIFZPU19NQUNfQUREUl9TSVpFKTsKKyAgICAgIFRMTE9HMihWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICAiV0xBTiBUTCBTb2Z0QVA6IDgwMiAzIERBICUwOHggU0EgJTA4eCIsCisgICAgICAgICAgICAgICAgICB3ODAyM0hlYWRlci52REEsIHc4MDIzSGVhZGVyLnZTQSkpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgdm9zX21lbV9jb3B5KCB3ODAyM0hlYWRlci52REEsIHc4MDIxMUhlYWRlci52QTEsIFZPU19NQUNfQUREUl9TSVpFKTsKKyAgICAgIHZvc19tZW1fY29weSggdzgwMjNIZWFkZXIudlNBLCB3ODAyMTFIZWFkZXIudkEyLCBWT1NfTUFDX0FERFJfU0laRSk7CisgICAgfQorICAgIGJyZWFrOworICBjYXNlIDE6CisgICAgaWYgKCB3ODAyMTFIZWFkZXIud0ZybUN0cmwudG9EUyApCisgICAgeworICAgICAgdm9zX21lbV9jb3B5KCB3ODAyM0hlYWRlci52REEsIHc4MDIxMUhlYWRlci52QTEsIFZPU19NQUNfQUREUl9TSVpFKTsKKyAgICAgIHZvc19tZW1fY29weSggdzgwMjNIZWFkZXIudlNBLCB3ODAyMTFIZWFkZXIudkEyLCBWT1NfTUFDX0FERFJfU0laRSk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICB2b3NfbWVtX2NvcHkoIHc4MDIzSGVhZGVyLnZEQSwgdzgwMjExSGVhZGVyLnZBMSwgVk9TX01BQ19BRERSX1NJWkUpOworICAgICAgdm9zX21lbV9jb3B5KCB3ODAyM0hlYWRlci52U0EsIHc4MDIxMUhlYWRlci52QTMsIFZPU19NQUNfQUREUl9TSVpFKTsKKyAgICB9CisgICAgYnJl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AgICAgIHJldHVybiB2b3NTdGF0dXM7CisgICB9CisKKyAgIC8vRXh0cmFjdCB0aGUgbGVuZ3RoCisgICB2b3NfbWVtX2NvcHkoJnc4MDIzSGVhZGVyLnVzTGVuVHlwZSwKKyAgICAgJmF1Y0xMQ0hlYWRlcltXTEFOVExfTExDX0hFQURFUl9MRU4gLSBzaXplb2YodzgwMjNIZWFkZXIudXNMZW5UeXBlKV0sCisgICAgIHNpemVvZih3ODAyM0hlYWRlci51c0xlblR5cGUpICk7CisKKyAgIHZvc19wa3RfcHVzaF9oZWFkKHZvc0RhdGFCdWZmLCAmdzgwMjNIZWFkZXIsIHNpemVvZih3ODAyM0hlYWRlcikpOworICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOVExfRmluZEZyYW1lVHlwZUJjTWNVYworCisgIERFU0NSSVBUSU9OCisgICAgVXRpbGl0eSBmdW5jdGlvbiB0byBmaW5kIHdoZXRoZXIgcmVjZWl2ZWQgZnJhbWUgaXMgYnJvYWRjYXN0LCBtdWx0aWNhc3QKKyAgICBvciB1bmljYXN0LgorCisgIERFUEVOREVOQ0lFUworICAgIFRoZSBTVEEgbXVzdCBiZSByZWdpc3RlcmVkIHdpdGggVEwgYmVmb3JlIHRoaXMgZnVuY3Rpb24gY2FuIGJlIGNhbGxlZC4KKworICBQQVJBTUVURVJTCisKKyAgIElOCisgICBwVExDYjogICAgICAgICAgcG9pbnRlciB0byB0aGUgVEwncyBjb250cm9sIGJsb2NrCisgICB1Y1NUQUlkOiAgICAgICAgaWRlbnRpZmllciBvZiB0aGUgc3RhdGlvbiBiZWluZyBwcm9jZXNzZWQKKyAgIHZvc0RhdGFCdWZmOiAgICBwb2ludGVyIHRvIHRoZSB2b3MgYnVmZmVyCisKKyAgIElOL09VVAorICAg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GQgYmUgdGFnZ2VkIGludG8gQkQgaW4gdGhpcworICAgIFZPU1MgcGFja2V0IGxhdGVyIGJ5IHRoZSBXTEFOSEFMX0ZpbGxUeEJkKCkgZnVuY3Rpb24uCisKKyAgREVQRU5ERU5DSUVTIAorICAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgSU4KKyAgICAgICAgcHZvc0dDdHggICAgVk9TIGNvbnRleHQKKyAgICAgICAgdm9zRGF0YUJ1ZmYgUHRyIHRvIFZPU1MgcGFja2V0CisgICAgICAgIHBNZXRhSW5mbyAgIEZvciBnZXR0aW5nIGZyYW1lJ3MgVElECisgICAgICAgIHBTdGFJbmZvICAgIEZvciBjaGVja2luZyBTVEEgdHlwZQorICAgIAorICAgT1VUCisgICAgICAgIHB2b3NTdGF0dXMgIHJldHVybmVkIHN0YXR1cworICAgICAgICBwdUZhc3RGd2RPSyBGbGFnIHRvIGluZGljYXRlIHdoZXRoZXIgZnJhbWUgY291bGQgYmUgZmFzdCBmb3J3YXJkZWQKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBObyByZXR1cm4uICAgCisKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworc3RhdGljIHZvaWQKK1dMQU5UTF9GYXN0SHdGd2REYXRhRnJhbWUKKyggCisgIHZfUFZPSURfdCAgICAgcHZvc0dDdHgsCisgIHZvc19wa3RfdCogICAgdm9zRGF0YUJ1ZmYsCisgIFZPU19TVEFUVVMqICAgcHZvc1N0YXR1cywKKyAgdl9VMzJfdCogICAgICAgcHVGYXN0RndkT0ssCisgIFdMQU5UTF9NZXRhSW5mb1R5cGUqICBwTWV0YUluZm8sCisgIFdMQU5fU1RBRGVzY1R5cGUqICBwU3RhSW5mbworIAorKQoreworICAgIHZfUFZPSURfdCAgIHB2UGVla0RhdGE7CisgICAgdl9VOF90ICAgICAgdWNEeE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3RMZW4gKTsKKyAgICAKKyAgICAgIC8qIENhbid0IGJlIGZhc3QgZm9yd2FyZGVkLiBUcmltIHRoZSBWT1MgaGVhZCBiYWNrIHRvIG9yaWdpbmFsIGxvY2F0aW9uLiAqLworICAgICAgaWYoISAqcHVGYXN0RndkT0speworICAgICAgICAgIHZvc19wa3RfdHJpbV9oZWFkKHZvc0RhdGFCdWZmLCB1Y0R4RUJEV0xBTkhlYWRlckxlbik7CisgICAgICB9ZWxzZXsKKyAgICAgICAgLyogY291bGQgYmUgZmFzdCBmb3J3YXJkZWQuIE5vdyBub3RpZnkgQkFMIER4RSBoZWFkZXIgZmlsbGluZyBjb3VsZCBiZSBjb21wbGV0ZWx5IHNraXBwZWQKKyAgICAgICAgICovCisgICAgICAgIHZfVTMyX3QgdVBhY2tldFNpemUgPSBXTEFOVExfQkRfSEVBREVSX0xFTigwKSArIHVzUGt0TGVuOworICAgICAgICB2b3NfcGt0X3NldF91c2VyX2RhdGFfcHRyKCB2b3NEYXRhQnVmZiwgVk9TX1BLVF9VU0VSX0RBVEFfSURfQkFMLCAKKyAgICAgICAgICAgICAgICAgICAgICAgKHZfUFZPSURfdCl1UGFja2V0U2l6ZSk7CisgICAgICAgIHBEeEVIZWFkZXItPnNpemUgID0gU1dBUF9FTkRJQU5fVUlOVDMyKHVQYWNrZXRTaXplKTsKKyAgICAgIH0KKyAgICAgKnB2b3NTdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICAgICByZXR1cm47Cit9CisjZW5kaWYgLypXTEFOX1BFUkYqLworI2VuZGlmCisKKyNpZiAwCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICBGVU5DVElPTiAgICBXTEFOVExfUHJlcGFyZUJESGVhZGVyCisKKyAgREVTQ1JJUFRJT04KKyAgICBJbmxpbmUgZnVuY3Rpb24gZm9yIHByZXBhcmluZyBCRCBoZWFkZXIgYmVmb3JlIEhBTCBwcm9jZXNzaW5nLgorCisgIERFUEVOREVOQ0lFUworICAgIEp1c3Qgbm90aWZ5IEhBTCB0aGF0IHN1c3BlbmQgaW4gVEwgaXMgY29tcGxldGUuCisKKyAgUEFSQU1FVEVSUworCisgICBJTgorICAgIHZvc0RhdGFCdWZmOiAgICAgIHZvcyBkYXRhIGJ1ZmZlcgorICAgIHVjRGlzYWJsZUZybVh0bDogIGlzIGZyYW1lIHh0bCBkaXNhYmxlZAorCisgICBPVVQKKyAgICBwcHZCREhlYWRlcjogICAgICBpdCB3aWxsIGNvbnRhaW4gdGhlIEJEIGhlYWRlcgorICAgIHB2RGVzdE1hY0FkZGRyOiAgIGl0IHdpbGwgY29udGFpbiB0aGUgZGVzdGluYXRpb24gTUFDIGFkZHJlc3MKKyAgICBwdm9zU3RhdHVzOiAgICAgICBzdGF0dXMgb2YgdGhlIGNvbWJpbmVkIHByb2Nlc3NpbmcKKyAgICBwdXNQa3RMZW46ICAgICAgICBwYWNrZXQgbGVuLgorCisgIFJFVFVSTiBWQUxVRQorICAgIE5vIHJldHVybi4KKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkCitXTEFOVExfUHJlcGFyZUJESGVhZGVyCisoCisgIHZvc19wa3RfdCogICAgICB2b3NEYXRhQnVmZiwKKyAgdl9QVk9JRF90KiAgICAgIHBwdkJESGVhZGVyLAorICB2X01BQ0FERFJfdCogICAgcHZEZXN0TWFjQWRkZHIsCisgIHZfVThfdCAgICAgICAgICB1Y0Rpc2FibGVGcm1YdGwsCisgIFZPU19TVEFUVVMqICAgICBwdm9zU3RhdHVzLAorICB2X1UxNl90KiAgICAgICAgcHVzUGt0TGVuLAorICB2X1U4X3QgICAgICAgICAgdWNRb3NFbmFibGVkLAorICB2X1U4X3QgICAgICAgICAgdWNXRFNFbmFibGVkLAorICB2X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FibGVkICkKKyAgICAgIHsKKyAgICAgICAgdWNIZWFkZXJMZW4gKz0gV0xBTlRMXzgwMl8xMV9IRUFERVJfUU9TX0NUTDsKKyAgICAgIH0KKworICAgICAgLy8gU2ltaWxhciB0byBRb3Mgd2UgbmVlZCBzb21ldGhpbmcgZm9yIFdEUyBmb3JtYXQgIQorICAgICAgaWYgKCB1Y1dEU0VuYWJsZWQgIT0gMCApCisgICAgICB7CisgICAgICAgIC8vIElmIHdlIGhhdmUgZnJhbWUgdHJhbnNsYXRpb24gZW5hYmxlZAorICAgICAgICB1Y0hlYWRlckxlbiAgICArPSBXTEFOVExfODAyXzExX0hFQURFUl9BRERSNF9MRU47CisgICAgICB9CisgICAgICBpZiAoIGV4dHJhSGVhZFNwYWNlICE9IDAgKQorICAgICAgeworICAgICAgICAvLyBEZWNyZWFzZSB0aGUgcGFja2V0IGxlbmd0aCB3aXRoIHRoZSBleHRyYSBwYWRkaW5nIGFmdGVyIHRoZSBoZWFkZXIKKyAgICAgICAgKnB1c1BrdExlbiA9ICpwdXNQa3RMZW4gLSBleHRyYUhlYWRTcGFjZTsKKyAgICAgIH0KKyAgICB9CisKKyAgICBXTEFOSEFMX1RYX0JEX1NFVF9NUERVX0hFQURFUl9MRU4oICpwcHZCREhlYWRlciwgdWNIZWFkZXJMZW4pOworICAgIFdMQU5IQUxfVFhfQkRfU0VUX01QRFVfSEVBREVSX09GRlNFVCggKnBwdkJESGVhZGVyLCB1Y0hlYWRlck9mZnNldCk7CisgICAgV0xBTkhBTF9UWF9CRF9TRVRfTVBEVV9EQVRBX09GRlNFVCggKnBwdkJESGVhZGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWNIZWFkZXJPZmZzZXQgKyB1Y0hlYWRlckxlbiArIGV4dHJhSGVhZFNwYWNlKTsKKyAgICBXTEFOSEFMX1RYX0JEX1NFVF9NUERVX0xFTiggKnBwdkJESGVhZGVyLCAqcHVzUGt0TGVuKTsKKworICAgI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UQKKworCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uCisKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICAgRXZlcnl0aGluZyBpcyBnb29kIDopCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTl9UTEdldE5leHRUeElkcworKAorICB2X1BWT0lEX3QgICAgcHZvc0dDdHgsCisgIHZfVThfdCogICAgICBwdWNTVEFJZAorKQoreworICBXTEFOVExfQ2JUeXBlKiAgcFRMQ2I7CisgIHZfVThfdCAgICAgICAgICB1Y05leHRBQzsKKyAgdl9VOF90ICAgICAgICAgIHVjTmV4dFNUQTsgCisgIHZfVThfdCAgICAgICAgICB1Y0NvdW50OyAKKyAgdl9VOF90ICAgICAgICAgIHVGbG93TWFzazsgLy8gVFggRmxvd01hc2sgZnJvbSBXREEKKyAgdl9VOF90ICAgICAgICAgIHVjQUNNYXNrID0gMDsKKyAgdl9VOF90ICAgICAgICAgIGkgPSAwOyAKKworICB0QnNzU3lzdGVtUm9sZSBzeXN0ZW1Sb2xlOyAvL1JHIEhBQ0sgdG8gYmUgcmVtb3ZlZAorICB0cEFuaVNpckdsb2JhbCBwTWFjOworCisgIHBNYWMgPSB2b3NfZ2V0X2NvbnRleHQoVk9TX01PRFVMRV9JRF9QRSwgcHZvc0dDdHgpOworICBpZiAoIE5VTEwgPT0gcE1hYyApCisgIHsKKyAgICBUTExPR0UoVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIHBNYWMiLCBfX2Z1bmNfXykpOworICAgIHJldHVybiBWT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BBQyBNYXNrOiAlZCBOZXh0OiAlZCBSZXMgOiAlZCIsCisgICAgICAgICAgICAgICB1Y0FDTWFzaywgKCAxIDw8IHVjTmV4dEFDICksICggdWNBQ01hc2sgJiAoIDEgPDwgdWNOZXh0QUMgKSkpKTsKKworICAgIGlmICggMCAhPSAoIHVjQUNNYXNrICYgKCAxIDw8IHVjTmV4dEFDICkpKQorICAgIHsKKyAgICAgICBwVExDYi0+YXRsU1RBQ2xpZW50c1sqcHVjU1RBSWRdLT51Y0N1cnJlbnRBQyAgICAgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV0xBTlRMX0FDRW51bVR5cGUpdWNOZXh0QUM7CisgICAgICAgcFRMQ2ItPmF0bFNUQUNsaWVudHNbKnB1Y1NUQUlkXS0+dWNDdXJyZW50V2VpZ2h0ID0KKyAgICAgICAgICAgICAgICAgICAgICAgcFRMQ2ItPnRsQ29uZmlnSW5mby51Y0FjV2VpZ2h0c1t1Y05leHRBQ107CisKKyAgICAgICAgVExMT0cyKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICAgICJXTEFOIFRMOiBTd2l0Y2hpbmcgc2VydmljZWQgQUMgdG86ICVkIHdpdGggV2VpZ2h0OiAlZCIsCisgICAgICAgICAgICAgICAgICBwVExDYi0+YXRsU1RBQ2xpZW50c1sqcHVjU1RBSWRdLT51Y0N1cnJlbnRBQyAsCisgICAgICAgICAgICAgICAgICBwVExDYi0+YXRsU1RBQ2xpZW50c1sqcHVjU1RBSWRdLT51Y0N1cnJlbnRXZWlnaHQpKTsKKyAgICAgICBicmVhazsKKyAgICB9CisKKyAgICBpZiAodWNOZXh0QUMgPT0gV0xBTlRMX0FDX0JLKQorICAgICAgICB1Y05leHRBQyA9IFdMQU5UTF9BQ19ISUdIX1BSSU87CisgICAgZWxzZQorICAgICAgICB1Y05leHRBQy0tOworCisgICAgVExMT0cyKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICJOZXh0IEFDICVkIiwgdWNOZXh0QUMpKTsKKyAgfQorCisgIFRMTE9HMihWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgIiBDIEFDOiAlZCBDIFc6ICVkIiwKKyAgICAgICAgICAgICBwVExDYi0+YXRsU1RBQ2xpZW50c1sqcHVjU1RBSWRdLT51Y0N1cnJlbnRBQywKKyAgICAgICAgICAgICBwVExDYi0+YXRsU1RBQ2xpZW50c1sqcHVjU1RBSWRdLT51Y0N1cnJlbnRXZWlnaHQpKTsKKworICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfS8qIFdMQU5fVExHZXROZXh0VHhJZHMgKi8KKworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICAgIERFRkFVTFQgSEFORExFUlM6IFJlZ2lzdGVyZWQgYXQgaW5pdGlhbGl6YXRpb24gd2l0aCBUTAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfTWdtdEZybVJ4RGVmYXVsdENiCisKKyAgREVTQ1JJUFRJT04KKyAgICBEZWZhdWx0IE1nbXQgRnJtIHJ4IGNhbGxiYWNrOiBhc3NlcnRzIGFsbCB0aGUgdGltZS4gSWYgdGhpcyBmdW5jdGlvbiBnZXRzCisgICAgY2FsbGVkICBpdCBtZWFucyB0aGVyZSBpcyBubyByZWdpc3RlcmVkIHJ4IGNiIHBvaW50ZXIgZm9yIE1nbXQgRnJtLgorCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKyAgICBOb3QgdXNlZC4KKworICBSRVRVUk4gVkFMVUUKKworICAgVk9TX1NUQVRVU19FX0ZBSUxVUkU6IEFsd2F5cyBGQUlMVVJFLgorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5UTF9NZ210RnJtUnhEZWZhdWx0Q2IKKygKKyAgdl9QVk9JRF90ICBwdm9zR0N0eCwKKyAgdl9QVk9JRF90ICB2b3NCdWZmCispCit7CisgIGlmICggTlVMTCAhPSB2b3NCdWZmICkKKyAgeworICAgIFRMTE9HUChWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAiV0xBTiBUTDpGYXRhbCBmYWlsdXJlOiBObyByZWdpc3RlcmVkIE1nbXQgRnJtIGNsaWVudCBvbiBwa3QgUlgiKSk7CisgICAgLyogRHJvcCBwYWNrZXQgKi8KKyAgICB2b3NfcGt0X3JldHVybl9wYWNrZXQoKHZvc19wa3RfdCAqKXZvc0J1ZmYpOworICB9CisKKyAgICAgIFRMTE9HMihWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICJXTEFOIFRMOiBObyByZWdpc3RlcmVkIE1nbXQgRnJtIGNsaWVudCBvbiBwa3QgUlguIExvYWQvVW5sb2FkIGluIHByb2dyZXNzLCBJZ25vcmUiKSk7CisKKyAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworfS8qV0xBTlRMX01nbXRGcm1SeERlZmF1bHRDYiovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgIFdMQU5UTF9CQVBSeERlZmF1bHRDYgorCisgIERFU0NSSVBUSU9OCisgICAgRGVmYXVsdCBCQVAgcnggY2FsbGJhY2s6IGFzc2VydHMgYWxsIHRoZSB0aW1lLiBJZiB0aGlzIGZ1bmN0aW9uIGdldHMKKyAgICBjYWxsZWQgIGl0IG1lYW5zIHRoZXJlIGlzIG5vIHJlZ2lzdGVyZWQgcnggY2IgcG9pbnRlciBmb3IgQkFQLgorCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKyAgICBOb3QgdXNlZC4KKworICBSRVRVUk4gVkFMVUUKKworICAgVk9TX1NUQVRVU19FX0ZBSUxVUkU6IEFsd2F5cyBGQUlMVVJFLgorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5UTF9CQVBSeERlZmF1bHRDYgorKAorICB2X1BWT0lEX3QgIHB2b3NHQ3R4LAorICB2b3NfcGt0X3QqICAgICAgIHZvc0RhdGFCdWZmLAorICBXTEFOVExfQkFQRnJhbWVFbnVtVHlwZSBmcmFtZVR5cGUKKykKK3sKKyAgVExMT0dQKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICJXTEFOIFRMOkZhdGFsIGZhaWx1cmU6IE5vIHJlZ2lzdGVyZWQgQkFQIGNsaWVudCBvbiBCQVAgcGt0IFJYIikpOworI2lmbmRlZiBCVEFNUF9URVNUCisgIFZPU19BU1NFUlQoMCk7CisjZW5kaWYKKyAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworfS8qV0xBTlRMX01nbXRGcm1SeERlZmF1bHRDYiovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfU1RBUnhEZWZhdWx0Q2IKKworICBERVNDUklQVElPTgorICAgIERlZmF1bHQgU1RBIHJ4IGNhbGxiYWNrOiBhc3NlcnRzIGFsbCB0aGUgdGltZS4gSWYgdGhpcyBmdW5jdGlvbiBnZXRzCisgICAgY2FsbGVkICBpdCBtZWFucyB0aGVyZSBpcyBubyByZWdpc3RlcmVkIHJ4IGNiIHBvaW50ZXIgZm9yIHN0YXRpb24uCisgICAgKE1lbSBjb3JydXB0aW9uIG1vc3QgbGlrZWx5LCBpdCBzaG91bGQgbmV2ZXIgaGFwcGVuKQorCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKyAgICBOb3QgdXNlZC4KKworICBSRVRVUk4gVkFMVUUKKworICAgIFZPU19TVEFUVVNfRV9GQUlMVVJFOiBBbHdheXMgRkFJTFVSRS4KKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfU1RBUnhEZWZhdWx0Q2IKKygKKyAgdl9QVk9JRF90ICAgICAgICAgICAgICAgcHZvc0dDdHgsCisgIHZvc19wa3RfdCogICAgICAgICAgICAgIHZvc0RhdGFCdWZmLAorICB2X1U4X3QgICAgICAgICAgICAgICAgICB1Y1NUQUlkLAorICBXTEFOVExfUnhNZXRhSW5mb1R5cGUqICBwUnhNZXRhSW5mbworKQoreworICBUTExPR0UoVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgIldMQU4gVEw6IE5vIHJlZ2lzdGVyZWQgU1RBIGNsaWVudCByeCBjYiBmb3IgU1RBSUQ6ICVkIGRyb3BwaW5nIHBrdCIsCisgICAgICAgICAgICAgICB1Y1NUQUlkKSk7CisgIHZvc19wa3RfcmV0dXJuX3BhY2tldCh2b3NEYXRhQnVmZik7CisgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9LypXTEFOVExfTWdtdEZybVJ4RGVmYXVsdENiKi8KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX1NUQUZldGNoUGt0RGVmYXVsdENiCisKKyAgREVTQ1JJUFRJT04KKyAgICBEZWZhdWx0IGZldGNoIGNhbGxiYWNrOiBhc3NlcnRzIGFsbCB0aGUgdGltZS4gSWYgdGhpcyBmdW5jdGlvbiBnZXRzCisgICAgY2FsbGVkICBpdCBtZWFucyB0aGVyZSBpcyBubyByZWdpc3RlcmVkIGZldGNoIGNiIHBvaW50ZXIgZm9yIHN0YXRpb24uCisgICAgKE1lbSBjb3JydXB0aW9uIG1vc3QgbGlrZWx5LCBpdCBzaG91bGQgbmV2ZXIgaGFwcGVuKQorCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKyAgICBOb3QgdXNlZC4KKworICBSRVRVUk4gVkFMVUUKKworICAgIFZPU19TVEFUVVNfRV9GQUlMVVJFOiBBbHdheXMgRkFJTFVSRS4KKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfU1RBRmV0Y2hQa3REZWZhdWx0Q2IKKygKKyAgdl9QVk9JRF90ICAgICAgICAgICAgICBwdm9zR0N0eCwKKyAgdl9VOF90KiAgICAgICAgICAgICAgICBwdWNTVEFJZCwKKyAgV0xBTlRMX0FDRW51bVR5cGUgICAgICB1Y0FDLAorICB2b3NfcGt0X3QqKiAgICAgICAgICAgIHZvc0RhdGFCdWZmLAorICBXTEFOVExfTWV0YUluZm9UeXBlKiAgIHRsTWV0YUluZm8KKykKK3sKKyAgVExMT0dQKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICJXTEFOIFRMOkZhdGFsIGZhaWx1cmU6IE5vIHJlZ2lzdGVyZWQgU1RBIGNsaWVudCBvbiBkYXRhIHBrdCBSWCIpKTsKKyAgVk9TX0FTU0VSVCgwKTsKKyAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworfS8qV0xBTlRMX01nbXRGcm1SeERlZmF1bHRDYiovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfVHhDb21wRGVmYXVsdENiCisKKyAgREVTQ1JJUFRJT04KKyAgICBEZWZhdWx0IHR4IGNvbXBsZXRlIGhhbmRsZXIuIEl0IHdpbGwgcmVsZWFzZSB0aGUgY29tcGxldGVkIHBrdCB0bworICAgIHByZXZlbnQgbWVtb3J5IGxlYWtzLgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8KKyAgICAgICAgICAgICAgICAgICAgVEwvSEFML1BFL0JBUC9IREQgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20KKyAgICAgICAgICAgICAgICAgICAgaXRzIGNvbnRleHQKKyAgICB2b3NEYXRhQnVmZjogICBwb2ludGVyIHRvIHRoZSBWT1NTIGRhdGEgYnVmZmVyIHRoYXQgd2FzIHRyYW5zbWl0dGVkCisgICAgd1R4U1RBdHVzOiAgICAgIHN0YXR1cyBvZiB0aGUgdHJhbnNtaXNzaW9uCisKKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbjsgcGxlYXNlCisgICAgY2hlY2sgdm9zX3BrdF9yZXR1cm5fcGFja2V0IGZvciBwb3NzaWJsZSBlcnJvciBjb2Rlcy4KKworICAgIFBsZWFzZSBjaGVjayAgdm9zX3BrdF9yZXR1cm5fcGFja2V0IEFQSSBmb3IgcG9zc2libGUgcmV0dXJuIHZhbHVlcy4KKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfVHhDb21wRGVmYXVsdENiCisoCisgdl9QVk9JRF90ICAgICAgcHZvc0dDdHgsCisgdm9zX3BrdF90KiAgICAgdm9zRGF0YUJ1ZmYsCisgVk9TX1NUQVRVUyAgICAgd1R4U1RBdHVzCispCit7CisgIFRMTE9HMihWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAiV0xBTiBUTDpUWENvbXAgbm90IHJlZ2lzdGVyZWQsIHJlbGVhc2luZyBwa3QgdG8gcHJldmVudCBtZW0gbGVhayIpKTsKKyAgcmV0dXJuIHZvc19wa3RfcmV0dXJuX3BhY2tldCh2b3NEYXRhQnVmZik7Cit9LypXTEFOVExfVHhDb21wRGVmYXVsdENiKi8KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICBDbGVhbnVwIGZ1bmN0aW9ucworICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfQ2xlYW5TVEEKKworICBERVNDUklQVElPTgorICAgIENsZWFucyBhIHN0YXRpb24gY29udHJvbCBibG9jay4KKworICBERVBFTkRFTkNJRVMKKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHB2b3NHQ3R4OiAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFuZGxlIHRvIFRMJ3MKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQKKyAgICB1Y0VtcHR5OiAgICAgICAgaWYgc2V0IHRoZSBxdWV1ZXMgYW5kIHBlbmRpbmcgcGt0cyB3aWxsIGJlIGVtcHR5ZWQKKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorCisgICAgVk9TX1NUQVRVU19FX0lOVkFMOiAgIGludmFsaWQgaW5wdXQgcGFyYW1ldGVycworICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfQ2xlYW5TVEEKKygKKyAgV0xBTlRMX1NUQUNsaWVudFR5cGUqICBwdGxTVEFDbGllbnQsCisgIHZfVThfdCAgICAgICAgICAgICB1Y0VtcHR5CispCit7CisgIHZfVThfdCAgdWNJbmRleDsKKyAgLyotIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSA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lZCBieSBUTCB0byBzZW5kIHRyaWdnZXIgZnJhbWVzCisgICAgdWNTdXNwZW5kSW50OiAgIHN1c3BlbmQgaW50ZXJ2YWwgdXNlZCBieSBUTCB0byBkZXRlcm1pbmUgdGhhdCBhbgorICAgICAgICAgICAgICAgICAgICBhcHAgaXMgaWRsZSBhbmQgc2hvdWxkIHN0YXJ0IHNlbmRpbmcgdHJpZ2cgZnJtcyBsZXNzIG9mdGVuCisgICAgd1RTRGlyOiAgICAgICAgIGRpcmVjdGlvbiBvZiBUU3BlYworCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uCisKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICAgRXZlcnl0aGluZyBpcyBnb29kIDopCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlRMX0VuYWJsZVVBUFNERm9yQUMKKygKKyAgdl9QVk9JRF90ICAgICAgICAgIHB2b3NHQ3R4LAorICB2X1U4X3QgICAgICAgICAgICAgdWNTVEFJZCwKKyAgV0xBTlRMX0FDRW51bVR5cGUgIHVjQUMsCisgIHZfVThfdCAgICAgICAgICAgICB1Y1RpZCwKKyAgdl9VOF90ICAgICAgICAgICAgIHVjVVAsCisgIHZfVTMyX3QgICAgICAgICAgICB1U2VydmljZUludCwKKyAgdl9VMzJfdCAgICAgICAgICAgIHVTdXNwZW5kSW50LAorICBXTEFOVExfVFNEaXJUeXBlICAgd1RTRGlyCispCit7CisKKyAgV0xBTlRMX0NiVHlwZSogICAgICBwVExDYiAgICAgID0gTlVMTDsKKyAgVk9TX1NUQVRVUyAgICAgICAgICB2b3NTdGF0dXMgICA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgdF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VkVMX0VSUk9SLAorICAgICAgICAgICJXTEFOIFRMOkNsaWVudCBNZW1vcnkgd2FzIG5vdCBhbGxvY2F0ZWQgb24gJXMiLCBfX2Z1bmNfXykpOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICB9CisKKyAgLypTZXQgdGhpcyBmbGFnIGluIG9yZGVyIHRvIHJlbWVtYmVyIHRoYXQgdGhpcyBpcyBhIHRyaWdnZXIgZW5hYmxlZCBBQyovCisgIHBUTENiLT5hdGxTVEFDbGllbnRzW3VjU1RBSWRdLT53VUFQU0RJbmZvW3VjQUNdLnVjU2V0ID0gMTsKKworI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgIGlmKHBUTENiLT5hdGxTVEFDbGllbnRzW3VjU1RBSWRdLT53U1RBRGVzYy53U1RBVHlwZSAhPSBXTEFOX1NUQV9URExTKQorI2VuZGlmCisgIHsKKyAgICBpZiggMCA9PSB1U2VydmljZUludCApCisgICAgeworICAgICAgVExMT0dFKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIldMQU4gVEw6SW5wdXQgcGFyYW1zIG9uIFdMQU5UTF9FbmFibGVVQVBTREZvckFDIgorICAgICAgICAgICAgICAgIiBTSTogJWQiLCB1U2VydmljZUludCApKTsKKyAgICB9CisKKyAgICBUTExPRzIoVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgIldMQU4gVEw6RW5hYmxpbmcgVS1BUFNEIGluIEZXIGZvciBTVEE6ICVkIEFDOiAlZCBTSTogJWQgU1BJOiAlZCAiCisgICAgICAgICAgICAgICAiREk6ICVkIiwKKyAgICAgICAgICAgICAgIHVjU1RBSWQsIHVjQUMsIHVTZXJ2aWNlSW50LCB1U3VzcGVuZEludCwKKyAgICAgICAgICAgICAgIHBUTENiLT50bENvbmZpZ0luZm8udURlbGF5ZWRUcmlnZ2VyRnJtSW50KSk7CisKKyAgICAvKlNhdmUgYWxsIGluZm8gZm9yIEhBTCovCisgICAgaGFsVUFQU0RJbmZvLnN0YWlkeCAgICAgICAgID0gdWNTVEFJZDsKKyAgICBoYWxVQVBTREluZm8uYWMgICAgICAgICAgICAgPSB1Y0FDOworICAgIGhhbFVBUFNESW5mby51cCAgICAgICAgICAgICA9IHVjVVA7CisgICAgaGFsVUFQU0RJbmZvLnNydkludGVydmFsICAgID0gdVNlcnZpY2VJbnQ7CisgICAgaGFsVUFQU0RJbmZvLnN1c0ludGVydmFsICAgID0gdVN1c3BlbmRJbnQ7CisgICAgaGFsVUFQU0RJbmZvLmRlbGF5SW50ZXJ2YWwgID0gcFRMQ2ItPnRsQ29uZmlnSW5mby51RGVsYXllZFRyaWdnZXJGcm1JbnQ7CisKKyAgICAvKk5vdGlmeSBIQUwqLworICAgIHZvc1N0YXR1cyA9IFdEQV9FbmFibGVVYXBzZEFjUGFyYW1zKHB2b3NHQ3R4LCB1Y1NUQUlkLCAmaGFsVUFQU0RJbmZvKTsKKyAgfQorICByZXR1cm4gdm9zU3RhdHVzOworCit9LypXTEFOVExfRW5hYmxlVUFQU0RGb3JBQyovCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOVExfRGlzYWJsZVVBUFNERm9yQUMKKworICBERVNDUklQVElPTgorICAgQ2FsbGVkIGJ5IEhERCB0byBkaXNhYmxlIFVBUFNELiBUTCBpbiB0dXJuIGNhbGxzIFdEQSBBUEkgdG8gZGlzYWJsZSB0aGUKKyAgIGxvZ2ljIGluIEZXL1NMTSB0byBzdG9wIHNlbmRpbmcgdHJpZ2dlciBmcmFtZXMuIFByZXZpb3VzbHkgVEwgaGFkIHRoZQorICAgdHJpZ2dlciBmcmFtZSBsb2dpY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G5vdGlmaWNhdGlvbgorICAgICAgICAgICAgICAgY2FsbGJhY2sgZnVuY3Rpb24gcG9pbnRlcgorCisgIERFUEVOREVOQ0lFUyBOT05FCisgICAgCisgIFBBUkFNRVRFUlMgICBpbiBwQWRhcHRlciAtIEdsb2JhbCBoYW5kbGUKKyAgICAgICAgICAgICAgIGluIHJzc2lWYWx1ZSAtIFJTU0kgdGhyZXNob2xkIHZhbHVlCisgICAgICAgICAgICAgICBpbiB0cmlnZ2VyRXZlbnQgLSBDcm9zcyBkaXJlY3Rpb24gc2hvdWxkIGJlIG5vdGlmaWVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVUCwgRE9XTiwgYW5kIENST1NTCisgICAgICAgICAgICAgICBpbiBjcm9zc0NCRnVuY3Rpb24gLSBOb3RpZmljYXRpb24gQ0IgRnVuY3Rpb24KKyAgICAgICAgICAgICAgIGluIHVzckN0eHQgLSB1c2VyIGNvbnRleHQKKworICBSRVRVUk4gVkFMVUUgVk9TX1NUQVRVUworCisgIFNJREUgRUZGRUNUUyBOT05FCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9SZWdSU1NJSW5kaWNhdGlvbkNCCisoCisgICB2X1BWT0lEX3QgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLAorICAgdl9TN190ICAgICAgICAgICAgICAgICAgICAgICAgICByc3NpVmFsdWUsCisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgICAgIHRyaWdnZXJFdmVudCwKKyAgIFdMQU5UTF9SU1NJQ3Jvc3NUaHJlc2hvbGRDQlR5cGUgY3Jvc3NDQkZ1bmN0aW9uLAorICAgVk9TX01PRFVMRV9JRCAgICAgICAgICAgICAgICAgICBtb2R1bGVJRCwKKyAgIHZfUFZPSURfdCAgICAgICAgICAgICAgICAgICAgICAgdXNyQ3R4dAorKQoreworICAgVk9TX1NUQVRVUyAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKworICAgc3RhdHVzID0gV0xBTlRMX0hTUmVnUlNTSUluZGljYXRpb25DQihwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnNzaVZhbHVlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmlnZ2VyRXZlbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNyb3NzQ0JGdW5jdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kdWxlSUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzckN0eHQpOworCisgICByZXR1cm4gc3RhdHVzOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgICBXTEFOVExfRGVyZWdSU1NJSW5kaWNhdGlvbkNCCisKKyAgREVTQ1JJUFRJT04gIFJlbW92ZSBzcGVjaWZpYyB0aHJlc2hvbGQgZnJvbSBsaXN0CisKKyAgREVQRU5ERU5DSUVTIE5PTkUKKyAgICAKKyAgUEFSQU1FVEVSUyAgIGluIHBBZGFwdGVyIC0gR2xvYmFsIGhhbmRsZQorICAgICAgICAgICAgICAgaW4gcnNzaVZhbHVlIC0gUlNTSSB0aHJlc2hvbGQgdmFsdWUKKyAgICAgICAgICAgICAgIGluIHRyaWdnZXJFdmVudCAtIENyb3NzIGRpcmVjdGlvbiBzaG91bGQgYmUgbm90aWZpZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQLCBET1dOLCBhbmQgQ1JPU1MKKyAgIAorICBSRVRVUk4gVkFMVUUgVk9TX1NUQVRVUworCisgIFNJREUgRUZGRUNUUyBOT05FCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9EZXJlZ1JTU0lJbmRpY2F0aW9uQ0IKKygKKyAgIHZfUFZPSURfdCAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXIsCisgICB2X1M3X3QgICAgICAgICAgICAgICAgICAgICAgICAgIHJzc2lWYWx1ZSwKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICAgICAgdHJpZ2dlckV2ZW50LAorICAgV0xBTlRMX1JTU0lDcm9zc1RocmVzaG9sZENCVHlwZSBjcm9zc0NCRnVuY3Rpb24sCisgICBWT1NfTU9EVUxFX0lEICAgICAgICAgICAgICAgICAgIG1vZHVsZUlECispCit7CisgICBWT1NfU1RBVFVTICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworCisgICBzdGF0dXMgPSBXTEFOVExfSFNEZXJlZ1JTU0lJbmRpY2F0aW9uQ0IocEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnNzaVZhbHVlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyaWdnZXJFdmVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjcm9zc0NCRnVuY3Rpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kdWxlSUQpOworICAgcmV0dXJuIHN0YXR1czsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICAgV0xBTlRMX1NldEFscGhhCisKKyAgREVTQ1JJUFRJT04gIEFMUExBIGlzIHdlaWdodCB2YWx1ZSB0byBjYWxjdWxhdGUgQVZHIFJTU0kKKyAgICAgICAgICAgICAgIGF2Z1JTU0kgPSAoQUxQSEEgKiBoaXN0b3J5UlNTSSkgKyAoKDEwIC0gQUxQSEEpICogbmV3UlNTSSkKKyAgICAgICAgICAgICAgIGF2Z1JTU0kgaGFzIChBTFBIQSAqIDEwKSUgb2YgaGlzdG9yeSBSU1NJIHdlaWdodCBhbmQKKyAgICAgICAgICAgICAgICgxMCAtIEFMUEhBKSUgb2YgbmV3UlNTSSB3ZWlnaHQKKyAgICAgICAgICAgICAgIFRoaXMgcG9ydGlvbiBpcyBkeW5hbWljYWxseSBjb25maWd1cmFibGUuCisgICAgICAgICAgICAgICBEZWZhdWx0IGlzID8KKworICBERVBFTkRFTkNJRVMgTk9ORQorICAgIAorICBQQVJBTUVURVJTICAgaW4gcEFkYXB0ZXIgLSBHbG9iYWwgaGFuZGxlCisgICAgICAgICAgICAgICBpbiB2YWx1ZUFscGFoIC0gQUxQSEEKKyAgIAorICBSRVRVUk4gVkFMVUUgVk9TX1NUQVRVUworCisgIFNJREUgRUZGRUNUUyBOT05FCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9TZXRBbHBoYQorKAorICAgdl9QVk9JRF90IHBBZGFwdGVyLAorICAgdl9VOF90ICAgIHZhbHVlQWxwaGEKKykKK3sKKyAgIFZPU19TVEFUVVMgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisKKyAgIHN0YXR1cyA9IFdMQU5UTF9IU1NldEFscGhhKHBBZGFwdGVyLCB2YWx1ZUFscGhhKTsKKyAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgRlVOQ1RJT04KKworICAgREVTQ1JJUFRJT04gCisgICAgCisgICBQQVJBTUVURVJTIAorCisgICBSRVRVUk4gVkFMVUUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9CTVBTUlNTSVJlZ2lvbkNoYW5nZWROb3RpZmljYXRpb24KKygKKyAgIHZfUFZPSURfdCAgICAgICAgICAgICBwQWRhcHRlciwKKyAgIHRwU2lyUlNTSU5vdGlmaWNhdGlvbiBwUlNTSU5vdGlmaWNhdGlvbgorKQoreworICAgVk9TX1NUQVRVUyAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKworICAgc3RhdHVzID0gV0xBTlRMX0hTQk1QU1JTU0lSZWdpb25DaGFuZ2VkTm90aWZpY2F0aW9uKHBBZGFwdGVyLCBwUlNTSU5vdGlmaWNhdGlvbik7CisgICByZXR1cm4gc3RhdHVzOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgICBXTEFOVExfUmVnR2V0VHJhZmZpY1N0YXR1cworCisgIERFU0NSSVBUSU9OICBSZWdpc3RyYXRpb24gZnVuY3Rpb24gZm9yIHRyYWZmaWMgc3RhdHVzIG1vbml0b3JpbmcKKyAgICAgICAgICAgICAgIER1cmluZyBtZWFzdXJlIHBlcmlvZCBjb3VudCBkYXRhIGZyYW1lcy4KKyAgICAgICAgICAgICAgIElmIGZyYW1lIGNvdW50IGlzIGxhcmdlciB0aGVuIElETEUgdGhyZXNob2xkIHNldCBhcyB0cmFmZmljIE9OCisgICAgICAgICAgICAgICBvciBPRkYuCisgICAgICAgICAgICAgICBBbmQgdHJhZmZpYyBzdGF0dXMgaXMgY2hhbmdlZCBzZW5kIHJlcG9ydCB0byBjbGllbnQgd2l0aAorICAgICAgICAgICAgICAgcmVnaXN0ZXJlZCBjYWxsYmFjayBmdW5jdGlvbgorCisgIERFUEVOREVOQ0lFUyBOT05FCisgICAgCisgIFBBUkFNRVRFUlMgICBpbiBwQWRhcHRlciAtIEdsb2JhbCBoYW5kbGUKKyAgICAgICAgICAgICAgIGluIGlkbGVUaHJlc2hvbGQgLSBUcmFmZmljIG9uIG9yIG9mZiB0aHJlc2hvbGQKKyAgICAgICAgICAgICAgIGluIG1lYXN1cmVQZXJpb2QgLSBUcmFmZmljIHN0YXRlIGNoZWNrIHBlcmlvZAorICAgICAgICAgICAgICAgaW4gdHJmZmljU3RhdHVzQ0IgLSB0cmFmZmljIHN0YXR1cyBjaGFuZ2VkIG5vdGlmaWNhdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDQiBmdW5jdGlvbgorICAgICAgICAgICAgICAgaW4gdXNyQ3R4dCAtIHVzZXIgY29udGV4dAorICAgCisgIFJFVFVSTiBWQUxVRSBWT1NfU1RBVFVTCisKKyAgU0lERSBFRkZFQ1RTIE5PTkUKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgV0xBTlRMX1JlZ0dldFRyYWZmaWNTdGF0dXMKKygKKyAgIHZfUFZPSURfdCAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXIsCisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkbGVUaHJlc2hvbGQsCisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lYXN1cmVQZXJpb2QsCisgICBXTEFOVExfVHJhZmZpY1N0YXR1c0NoYW5nZWRDQlR5cGUgIHRyZmZpY1N0YXR1c0NCLAorICAgdl9QVk9JRF90ICAgICAgICAgICAgICAgICAgICAgICAgICB1c3JDdHh0CispCit7CisgICBWT1NfU1RBVFVTICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworCisgICBzdGF0dXMgPSBXTEFOVExfSFNSZWdHZXRUcmFmZmljU3RhdHVzKHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZGxlVGhyZXNob2xkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZWFzdXJlUGVyaW9kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmZmaWNTdGF0dXNDQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNyQ3R4dCk7CisgICByZXR1cm4gc3RhdHVzOworfQorI2VuZGlmCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgICAgV0xBTlRMX0dldFN0YXRpc3RpY3MKKworICBERVNDUklQVElPTiAgIEdldCB0cmFmZmljIHN0YXRpc3RpY3MgZm9yIGlkZW50aWZpZWQgc3RhdGlvbiAKKworICBERVBFTkRFTkNJRVMgIE5PTkUKKyAgICAKKyAgUEFSQU1FVEVSUyAgICBpbiBwQWRhcHRlciAtIEdsb2JhbCBoYW5kbGUKKyAgICAgICAgICAgICAgICBpbiBzdGF0VHlwZSAtIHNwZWNpZmljIHN0YXRpc3RpY3MgZmllbGQgdG8gcmVzZXQKKyAgICAgICAgICAgICAgICBvdXQgc3RhdEJ1ZmZlciAtIHRyYWZmaWMgc3RhdGlzdGljcyBidWZmZXIKKyAgIAorICBSRVRVUk4gVkFMVUUgIFZPU19TVEFUVVMKKworICBTSURFIEVGRkVDVFMgIE5PTkUKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgV0xBTlRMX0dld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MQU5UTF9SZXNldFN0YXRpc3RpY3MKKworICBERVNDUklQVElPTiAgIFJlc2V0IHN0YXRpc3RpY3Mgc3RydWN0dXJlIGZvciBpZGVudGlmaWVkIHN0YXRpb24gSUQKKyAgICAgICAgICAgICAgICBSZXNldCBtZWFucyBzZXQgdmFsdWVzIGFzIDAKKworICBERVBFTkRFTkNJRVMgIE5PTkUKKyAgICAKKyAgUEFSQU1FVEVSUyAgICBpbiBwQWRhcHRlciAtIEdsb2JhbCBoYW5kbGUKKyAgICAgICAgICAgICAgICBpbiBzdGF0VHlwZSAtIHNwZWNpZmljIHN0YXRpc3RpY3MgZmllbGQgdG8gcmVzZXQKKyAgIAorICBSRVRVUk4gVkFMVUUgIFZPU19TVEFUVVMKKworICBTSURFIEVGRkVDVFMgIE5PTkUKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgV0xBTlRMX1Jlc2V0U3RhdGlzdGljcworKAorICAgdl9QVk9JRF90ICAgICAgICAgICAgICAgICAgcEFkYXB0ZXIsCisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICBTVEFpZAorKQoreworICBXTEFOVExfQ2JUeXBlICAgICAgICAgICAgKnBUTENiICA9IFZPU19HRVRfVExfQ0IocEFkYXB0ZXIpOworICBXTEFOVExfU1RBQ2xpZW50VHlwZSogICAgIHBDbGllbnRTVEEgPSBOVUxMOworICBWT1NfU1RBVFVTICAgICAgICAgICAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgV0xBTlRMX1RSQU5TRkVSX1NUQV9UWVBFICpzdGF0aXN0aWNzID0gTlVMTDsKKworICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgIFNhbml0eSBjaGV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JRF90ICopc3RhdGlzdGljcywgc2l6ZW9mKFdMQU5UTF9UUkFOU0ZFUl9TVEFfVFlQRSkpOworCisgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgICBXTEFOVExfR2V0U3BlY1N0YXRpc3RpYworCisgIERFU0NSSVBUSU9OICAgR2V0IHNwZWNpZmljIGZpZWxkIHdpdGhpbiBzdGF0aXN0aWNzIHN0cnVjdHVyZSBmb3IKKyAgICAgICAgICAgICAgICBpZGVudGlmaWVkIHN0YXRpb24gSUQgCisKKyAgREVQRU5ERU5DSUVTICBOT05FCisKKyAgUEFSQU1FVEVSUyAgICBpbiBwQWRhcHRlciAtIEdsb2JhbCBoYW5kbGUKKyAgICAgICAgICAgICAgICBpbiBzdGF0VHlwZSAtIHNwZWNpZmljIHN0YXRpc3RpY3MgZmllbGQgdG8gcmVzZXQKKyAgICAgICAgICAgICAgICBpbiBTVEFpZCAgICAtIFN0YXRpb24gSUQKKyAgICAgICAgICAgICAgICBvdXQgYnVmZmVyICAtIFN0YXRpc3RpYyB2YWx1ZQorICAgCisgIFJFVFVSTiBWQUxVRSAgVk9TX1NUQVRVUworCisgIFNJREUgRUZGRUNUUyAgTk9ORQorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfR2V0U3BlY1N0YXRpc3RpYworKAorICAgdl9QVk9JRF90ICAgICAgICAgICAgICAgICAgICBwQWRhcHRlciwKKyAgIFdMQU5UTF9UUkFOU0ZFUl9TVEFUSUNfVFlQRSAgc3RhdFR5cGUsCisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgKmJ1ZmZlciwKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAg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19SWF9CQ05UOgorICAgICAgKmJ1ZmZlciA9IHN0YXRpc3RpY3MtPnJ4QmNudDsKKyAgICAgIGJyZWFrOworCisgICAgY2FzZSBXTEFOVExfU1RBVElDX1JYX0JDTlRfQ1JDX09LOgorICAgICAgKmJ1ZmZlciA9IHN0YXRpc3RpY3MtPnJ4QmNudENSQ29rOworICAgICAgYnJlYWs7CisKKyAgICBjYXNlIFdMQU5UTF9TVEFUSUNfUlhfUkFURToKKyAgICAgICpidWZmZXIgPSBzdGF0aXN0aWNzLT5yeFJhdGU7CisgICAgICBicmVhazsKKworICAgIGRlZmF1bHQ6CisgICAgICAqYnVmZmVyID0gMDsKKyAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgICAgIGJyZWFrOworICB9CisKKworICByZXR1cm4gc3RhdHVzOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgICAgV0xBTlRMX1Jlc2V0U3BlY1N0YXRpc3RpYworCisgIERFU0NSSVBUSU9OICAgUmVzZXQgc3BlY2lmaWMgZmllbGQgd2l0aGluIHN0YXRpc3RpY3Mgc3RydWN0dXJlIGZvcgorICAgICAgICAgICAgICAgIGlkZW50aWZpZWQgc3RhdGlvbiBJRAorICAgICAgICAgICAgICAgIFJlc2V0IG1lYW5zIHNldCBhcyAwCisKKyAgREVQRU5ERU5DSUVTICBOT05FCisgICAgCisgIFBBUkFNRVRFUlMgICAgaW4gcEFkYXB0ZXIgLSBHbG9iYWwgaGFuZGxlCisgICAgICAgICAgICAgICAgaW4gc3RhdFR5cGUgLSBzcGVjaWZpYyBzdGF0aXN0aWNzIGZpZWxkIHRvIHJlc2V0CisgICAgICAgICAgICAgICAgaW4gU1RBaWQgICAgLSBTdGF0aW9uIElECisKKyAgUkVUVVJOIFZBTFVFICBWT1NfU1RBVFVTCisKKyAgU0lERSBFRkZFQ1RTICBOT05FCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9SZXNldFNwZWNTdGF0aXN0aWMKKygKKyAgIHZfUFZPSURfdCAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXIsCisgICBXTEFOVExfVFJBTlNGRVJfU1RBVElDX1RZUEUgIHN0YXRUeXBlLAorICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgICBTVEFpZAorKQoreworICBXTEFOVExfQ2JUeXBlICAgICAgICAgICAgKnBUTENiICA9IFZPU19HRVRfVExfQ0IocEFkYXB0ZXIpOworICBXTEFOVExfU1RBQ2xpZW50VHlwZSogICAgIHBDbGllbnRTVEEgPSBOVUxMOworICBWT1NfU1RBVFVTICAgICAgICAgICAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgV0xBTlRMX1RSQU5TRkVSX1NUQV9UWVBFICpzdGF0aXN0aWNzID0gTlVMTDsKKworICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgIFNhbml0eSBjaGVjaworICAgIEV4dHJhY3QgVEwgY29udHJvbCBibG9jayAKKyAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisgIGlmIChOVUxMID09IHBUTENiKSAKKyAgeworICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgIldMQU4gVEw6SW52YWxpZCBUTCBwb2ludGVyIG9uIFdMQU5UTF9HZXRTdGF0aXN0aWNzIikpOworICAg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1NUQVRJQ19SWF9CQ05UX0NSQ19PSzoKKyAgICAgIHN0YXRpc3RpY3MtPnJ4QmNudENSQ29rID0gMDsKKyAgICAgIGJyZWFrOworCisgICAgY2FzZSBXTEFOVExfU1RBVElDX1JYX1JBVEU6CisgICAgICBzdGF0aXN0aWNzLT5yeFJhdGUgPSAwOworICAgICAgYnJlYWs7CisKKyAgICBkZWZhdWx0OgorICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0lOVkFMOworICAgICAgYnJlYWs7CisgIH0KKworICByZXR1cm4gc3RhdHVzOworfQorCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgRlVOQ1RJT04KKworICAgREVTQ1JJUFRJT04gICBSZWFkIFJTU0kgdmFsdWUgb3V0IG9mIGEgUlggQkQKKyAgICAKKyAgIFBBUkFNRVRFUlM6ICBDYWxsZXIgbXVzdCB2YWxpZGF0ZSBhbGwgcGFyYW1ldGVycyAKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfUmVhZFJTU0kKKygKKyAgIHZfUFZPSURfdCAgICAgICAgcEFkYXB0ZXIsCisgICB2X1BWT0lEX3QgICAgICAgIHBCREhlYWRlciwKKyAgIHZfVThfdCAgICAgICAgICAgU1RBaWQKKykKK3sKKyAgIFdMQU5UTF9DYlR5cGUgICAqdGxDdHh0ID0gVk9TX0dFVF9UTF9DQihwQWRhcHRlcik7CisgICB2X1M3X3QgICAgICAgICAgIGN1cnJlbnRSU1NJLCBjdXJyZW50UlNTSTAsIGN1cnJlbnRSU1NJMTsKKworCisgICBpZihOVUxMID09IHRsQ3R4dCkKKyAgIHsKKyAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9SZWFkU05SCisoCisgICB2X1BWT0lEX3QgICAgICAgIHBBZGFwdGVyLAorICAgdl9QVk9JRF90ICAgICAgICBwQkRIZWFkZXIsCisgICB2X1U4X3QgICAgICAgICAgIFNUQWlkCispCit7CisgICBXTEFOVExfQ2JUeXBlICAgKnRsQ3R4dCA9IFZPU19HRVRfVExfQ0IocEFkYXB0ZXIpOworICAgdl9TN190ICAgICAgICAgICBjdXJyZW50U05SOworCisKKyAgIGlmIChOVUxMID09IHRsQ3R4dCkKKyAgIHsKKyAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXMgSW52YWxpZCBUTCBoYW5kbGUiLCBfX2Z1bmNfXykpOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgIH0KKworICAgaWYgKE5VTEwgPT0gdGxDdHh0LT5hdGxTVEFDbGllbnRzW1NUQWlkXSkKKyAgIHsKKyAgICAgICBUTExPR0UoVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICJXTEFOIFRMOkNsaWVudCBNZW1vcnkgd2FzIG5vdCBhbGxvY2F0ZWQgb24gJXMiLCBfX2Z1bmNfXykpOworICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgIH0KKworICAgY3VycmVudFNOUiA9IFdMQU5UTF9HRVRTTlIocEJESGVhZGVyKTsKKworICAgLyogU05SIHJlcG9ydGVkIGluIHRoZSBCdWZmZXIgRGVzY3JpcHRvciBpcyBzY2FsZWQgdXAgYnkgMihTTlIqMiksCisgICAgKiBHZXQgdGhl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LS0tLS0tLS0tLS0tLS0tLS0tLQorICAgIEV4dHJhY3QgVEwgY29udHJvbCBibG9jayBhbmQgY2hlY2sgZXhpc3RhbmNlCisgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworICBwVExDYiA9IFZPU19HRVRfVExfQ0IocHZvc0dDdHgpOworICBpZiAoIE5VTEwgPT0gcFRMQ2IgKQorICB7CisgICAgVExMT0dFKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAiV0xBTiBUTDpJbnZhbGlkIFRMIHBvaW50ZXIgZnJvbSBwdm9zR0N0eCBvbiBXTEFOVExfR2V0QUNXZWlnaHRzIikpOworICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgIH0KKyAgZm9yICggdWNJbmRleCA9IDA7IHVjSW5kZXggPCBXTEFOVExfTUFYX0FDIDsgdWNJbmRleCsrKQorICB7CisgICAgcFRMQ2ItPnRsQ29uZmlnSW5mby51Y0FjV2VpZ2h0c1t1Y0luZGV4XSA9IHBBQ1dlaWdodHNbdWNJbmRleF07CisgIH0KKworICBwVExDYi0+dGxDb25maWdJbmZvLnVjQWNXZWlnaHRzW1dMQU5UTF9BQ19ISUdIX1BSSU9dID0gcEFDV2VpZ2h0c1tXTEFOVExfQUNfVk9dOworICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfQorCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgRlVOQ1RJT04KKworICAgREVTQ1JJUFRJT04gCisgICAgCisgICBQQVJBTUVURVJTIAorCisgICBSRVRVUk4gVkFMVUUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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NUX0ZVTExfUE9XRVI6CisgICAgICBjYXNlIFJFUVVFU1RfSU1QUzoKKyAgICAgIGNhc2UgU1RPUFBFRDoKKyAgICAgIGNhc2UgUkVRVUVTVF9TVEFSVF9VQVBTRDoKKyAgICAgIGNhc2UgUkVRVUVTVF9TVE9QX1VBUFNEOgorICAgICAgY2FzZSBVQVBTRDoKKyAgICAgIGNhc2UgUkVRVUVTVF9TVEFOREJZOgorICAgICAgY2FzZSBTVEFOREJZOgorICAgICAgY2FzZSBSRVFVRVNUX0VOVEVSX1dPV0w6CisgICAgICBjYXNlIFJFUVVFU1RfRVhJVF9XT1dMOgorICAgICAgY2FzZSBXT1dMOgorICAgICAgICAgVExMT0dXKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sICJOb3QgaGFuZGxlIHRoaXMgZXZlbnRzICVkIiwgbmV3U3RhdGUgKSk7CisgICAgICAgICBicmVhazsKKworICAgICAgZGVmYXVsdDoKKyAgICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIk5vdCBhIHZhbGlkIGV2ZW50ICVkIiwgbmV3U3RhdGUgKSk7CisgICAgICAgICBicmVhazsKKyAgIH0KKworICAgcmV0dXJuOworfQorLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICAgIFdMQU5UTF9HZXRFdGhlclR5cGUKKworICBERVNDUklQVElPTiAgIEV4dHJhY3QgRXRoZXIgdHlwZSBpbmZvcm1hdGlvbiBmcm9tIHRoZSBCRAorCisgIERFUEVOREVOQ0lFUyAgTk9ORQorICAgIAorICBQQVJBTUVURVJTICAgIGluIGF1Y0JESGVhZGVyIC0gQkQgaGVhZGVyCisgICAgICAgICAgICAgICAgaW4gdm9zRGF0YUJ1ZmYgLSBkYXRhIGJ1ZmZlcgorICAgICAgICAgICAgICAgIGluIHVjTVBEVUhMZW4gIC0gTVBEVSBoZWFkZXIgbGVuZ3RoCisgICAgICAgICAgICAgICAgb3V0IHBVc0V0aGVyVHlwZSAtIHBvaW50ZXIgdG8gRXRoZXJ0eXBlCisKKyAgUkVUVVJOIFZBTFVFICBWT1NfU1RBVFVTX1NVQ0NFU1MgOiBpZiB0aGUgRXRoZXJUeXBlIGlzIHN1Y2Nlc3NmdWxseSBleHRyYWN0ZWQKKyAgICAgICAgICAgICAgICBWT1NfU1RBVFVTX0ZBSUxVUkUgOiBpZiB0aGUgRXRoZXJUeXBlIGV4dHJhY3Rpb24gZmFpbGVkIGFuZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBwYWNrZXQgd2FzIGRyb3BwZWQKKworICBTSURFIEVGRkVDVFMgIE5PTkUKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3N0YXRpYyBWT1NfU1RBVFVTIFdMQU5UTF9HZXRFdGhlclR5cGUKKygKKyAgIHZfVThfdCAgICAgICAgICAgICAgICogYXVjQkRIZWFkZXIsCisgICB2b3NfcGt0X3QgICAgICAgICAgICAqIHZvc0RhdGFCdWZmLAorICAgdl9VOF90ICAgICAgICAgICAgICAgICB1Y01QRFVITGVuLAorICAgdl9VMTZfdCAgICAgICAgICAgICAgKiBwVXNFdGhlclR5cGUKKykKK3sKKyAgdl9VOF90ICAgICAgICAgICAgICAgICAgIHVjT2Zmc2V0OworICB2X1UxNl90ICAgICAgICAgICAgICAgICAgdXNFdGhlclR5cGUgPSAqcFVzRXRoZXJUeXBlOworICB2X1NJWkVfdCAgICAgICAgICAgICAgICAgdXNMTENTaXplID0gc2l6ZW9mKHVzRXRoZXJUeXBlKTsKKyAgVk9TX1NUQVRVUyAgICAgICAgICAgICAgIHZvc1N0YXR1cyAg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TUyAhPSB2b3NTdGF0dXMgKSB8fCAKKyAgICAgICggc2l6ZW9mKHVzRXRoZXJUeXBlKSAhPSB1c0xMQ1NpemUgKSkKKyAgICAgIAorICB7CisgICAgVExMT0dFKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIldMQU4gVEw6RXJyb3IgZXh0cmFjdGluZyBFdGhlciB0eXBlIGZyb20gZGF0YSBwYWNrZXQiKSk7CisgICAgLyogRHJvcCBwYWNrZXQgKi8KKyAgICB2b3NfcGt0X3JldHVybl9wYWNrZXQodm9zRGF0YUJ1ZmYpOworICAgIHZvc1N0YXR1cyA9IFZPU19TVEFUVVNfRV9GQUlMVVJFOworICB9CisgIGVsc2UKKyAgeworICAgIFRMTE9HMihWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAiV0xBTiBUTDpFdGhlciB0eXBlIHJldHJpZXZlZCBiZWZvcmUgZW5kaWFuZXNzIGNvbnY6ICVkIiwgCisgICAgICAgICAgICAgICB1c0V0aGVyVHlwZSkpOworCisgICAgdXNFdGhlclR5cGUgPSB2b3NfYmUxNl90b19jcHUodXNFdGhlclR5cGUpOworICAgICpwVXNFdGhlclR5cGUgPSB1c0V0aGVyVHlwZTsKKworICAgIFRMTE9HMihWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAiV0xBTiBUTDpFdGhlciB0eXBlIHJldHJpZXZlZDogJWQiLCB1c0V0aGVyVHlwZSkpOworICB9CisgIAorICByZXR1cm4gdm9zU3RhdHVzOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgICAgV0xBTlRMX0dldFNvZnRBUFN0YXRpc3RpY3MKKworICBERVNDUklQVElPTiAgIENvbGxlY3QgdGhlIGN1bXVsYXRpdmUgc3RhdGlzdGljcyBmb3IgYWxsIFNvZnRhcCBzdGF0aW9ucworCisgIERFUEVOREVOQ0lFUyAgTk9ORQorICAgIAorICBQQVJBTUVURVJTICAgIGluIHB2b3NHQ3R4ICAtIFBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dAorICAgICAgICAgICAgICAgICAgIGJSZXNldCAgICAtIElmIHNldCBUTCBzdGF0aXN0aWNzIHdpbGwgYmUgY2xlYXJlZCBhZnRlciByZWFkaW5nCisgICAgICAgICAgICAgICAgb3V0IHN0YXRzU3VtIC0gcG9pbnRlciB0byBjb2xsZWN0ZWQgc3RhdGlzdGljcworCisgIFJFVFVSTiBWQUxVRSAgVk9TX1NUQVRVU19TVUNDRVNTIDogaWYgdGhlIFN0YXRpc3RpY3MgYXJlIHN1Y2Nlc3NmdWxseSBleHRyYWN0ZWQKKworICBTSURFIEVGRkVDVFMgIE5PTkUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9HZXRTb2Z0QVBTdGF0aXN0aWNzKHZfUFZPSURfdCBwQWRhcHRlciwgV0xBTlRMX1RSQU5TRkVSX1NUQV9UWVBFICpzdGF0c1N1bSwgdl9CT09MX3QgYlJlc2V0KQoreworICAgIHZfVThfdCBpID0gMDsKKyAgICBWT1NfU1RBVFVTICB2b3NTdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICAgV0xBTlRMX0NiVHlwZSAqcFRMQ2IgID0gVk9TX0dFVF9UTF9DQihwQWRhcHRlcik7CisgICAgV0xBTlRMX1RSQU5TRkVSX1NUQV9UWVBFIHN0YXRCdWZmZXJUZW1wOworICAgIHZvc19tZW1femVybygodl9WT0lEX3QgKikmc3RhdEJ1ZmZlclRlbXAsIHNpemVvZihXTEFOVExfVFJBTlNGRVJfU1RBX1RZUEUpKTsKKyAgICB2b3NfbWVtX3plcm8oKHZfVk9JRF90ICopc3RhdHNTdW0sIHNpemVvZihXTEFOVExfVFJBTlNGRVJfU1RBX1RZUEUpKTsKKworCisgICAgaWYgKCBOVUxMID09IHBUTENiICkKKyAgICB7CisgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICB9IAorCisgICAgLy8gU3VtIHVwIGFsbCB0aGUgc3RhdGlzdGljcyBmb3Igc3RhdGlvbnMgb2YgU29mdCBBUCBmcm9tIFRMCisgICAgZm9yIChpID0gMDsgaSA8IFdMQU5fTUFYX1NUQV9DT1VOVDsgaSsrKQorICAgIHsKKyAgICAgICAgaWYgKCBOVUxMID09IHBUTENiLT5hdGxTVEFDbGllbnRzW2ldKQorICAgICAgICB7CisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorICAgICAgICBpZiAocFRMQ2ItPmF0bFNUQUNsaWVudHNbaV0tPndTVEFEZXNjLndTVEFUeXBlID09IFdMQU5fU1RBX1NPRlRBUCkKKyAgICAgICAgeworICAgICAgICAgICB2b3NTdGF0dXMgPSBXTEFOVExfR2V0U3RhdGlzdGljcyhwQWRhcHRlciwgJnN0YXRCdWZmZXJUZW1wLCBpKTsvLyBDYW4gaW5jbHVkZSBzdGFJZCAxIGJlY2F1c2Ugc3RhdGlzdGljcyBub3QgY29sbGVjdGVkIGZvciBpdAorCisgICAgICAgICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpCisgICAgICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKworICAgICAgICAgICAgLy8gQWRkIHRvIHRoZSBjb3VudGVycworICAgICAgICAgICBzdGF0c1N1bS0+dHhVQ0ZjbnQgKz0gc3RhdEJ1ZmZlclRlbXAudHhVQ0Zj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TVEFUVVNfRV9GQVVMVDsgICAgICAgICAgICAgICAKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gdm9zU3RhdHVzOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgICBXTEFOVExfSXNSZXBsYXlQYWNrZXQKKyAgICAgCisgIERFU0NSSVBUSU9OICAgVGhpcyBmdW5jdGlvbiBkb2VzIHJlcGxheSBjaGVjayBmb3IgdmFsaWQgc3RhdGlvbnMKKyAKKyAgREVQRU5ERU5DSUVTICBWYWxpZGl0eSBvZiByZXBsYXkgY2hlY2sgbXVzdCBiZSBkb25lIGJlZm9yZSB0aGUgZnVuY3Rpb24gCisgICAgICAgICAgICAgICAgaXMgY2FsbGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgIAorICBQQVJBTUVURVJTICAgIGN1cnJlbnRSZXBsYXlDb3VudGVyICAgIGN1cnJlbnQgcmVwbGF5IGNvdW50ZXIgdGFrZW4gZnJvbSBSWCBCRCAKKyAgICAgICAgICAgICAgICBwcmV2aW91c1JlcGxheUNvdW50ZXIgICBwcmV2aW91cyByZXBsYXkgY291bnRlciB0YWtlbiBmcm9tIFRMIENCCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgUkVUUlVOICAgICAgICBWT1NfVFJVRSAgICBwYWNrZXQgaXMgYSByZXBsYXkgcGFja2V0CisgICAgICAgICAgICAgICAgVk9TX0ZBTFNFICAgcGFja2V0IGlzIG5vdCBhIHJlcGxheSBwYWNrZXQKKworICBTSURFIEVGRkVDVFMgICBub25lCisgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2X0JPT0xfdAorV0xBTlRMX0lzUmVwbGF5UGFja2V0CisoCisgIHZfVTY0X3QgICAgdWxsY3VycmVudFJlcGxheUNvdW50ZXIsCisgIHZfVTY0X3QgICAgdWxscHJldmlvdXNSZXBsYXlDb3VudGVyCispCit7CisgICAvKiBEbyB0aGUgcmVwbGF5IGNoZWNrIGJ5IGNvbXBhcmluZyBwcmV2aW91cyByZWNlaXZlZCByZXBsYXkgY291bnRlciB3aXRoCisgICAgICBjdXJyZW50IHJlY2VpdmVkIHJlcGxheSBjb3VudGVyKi8KKyAgICBpZih1bGxwcmV2aW91c1JlcGxheUNvdW50ZXIgPCB1bGxjdXJyZW50UmVwbGF5Q291bnRlcikKKyAgICB7CisgICAgICAgIC8qIFZhbGlkIHBhY2tldCBub3QgcmVwbGF5ICovCisgICAgICAgIHJldHVybiBWT1NfRkFMU0U7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisKKyAgICAgICAgLyogQ3VycmVudCBwYWNrZXQgbnVtYmVyIGlzIGxlc3MgdGhhbiBvciBlcXVhbCB0byBwcmV2aXVvcyByZWNlaXZlZCAKKyAgICAgICAgICAgcGFja2V0IG5vLCB0aGlzIG1lYW5zIGN1cnJlbnQgcGFja2V0IGlzIHJlcGxheSBwYWNrZXQgKi8KKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICJXTEFOIFRMOiBSZXBsYXkgcGFja2V0IGZvdW5kIHdpdGggcmVwbGF5IGNvdW50ZXIgOlsweCVsbFhdIix1bGxjdXJyZW50UmVwbGF5Q291bnRlcik7CisgICAgICAgICAgIAorICAgICAgICByZXR1cm4gVk9TX1RSVUU7CisgICAgfQorfQorCisjaWYgMAorLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgICAgV0xBTlRMX0dldFJlcGxheUNvdW50ZXJGcm9tUnhCRAorICAgICAKKyAgREVTQ1JJUFRJT04gICBUaGlzIGZ1bmN0aW9uIGV4dHJhY3RzIDQ4LWJpdCByZXBsYXkgcGFja2V0IG51bWJlciBmcm9tIFJYIEJEIAorIAorICBERVBFTkRFTkNJRVMgIFZhbGlkaXR5IG9mIHJlcGxheSBjaGVjayBtdXN0IGJlIGRvbmUgYmVmb3JlIHRoZSBmdW5jdGlvbiAKKyAgICAgICAgICAgICAgICBpcyBjYWxsZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgCisgIFBBUkFNRVRFUlMgICAgcHVjUnhIZWFkZXIgcG9pbnRlciB0byBSWCBCRCBoZWFkZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICBSRVRSVU4gICAgICAgIHZfVTY0X3QgICAgUGFja2V0IG51bWJlciBleHRhcmN0ZWQgZnJvbSBSWCBCRAorCisgIFNJREUgRUZGRUNUUyAgIG5vbmUKKyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZfVTY0X3QKK1dMQU5UTF9HZXRSZXBsYXlDb3VudGVyRnJvbVJ4QkQKKygKKyAgIHZfVThfdCAqcHVjUnhCREhlYWRlcgorKQoreworLyogNDgtYml0IHJlcGxheSBjb3VudGVyIGlzIGNyZWF0ZWQgYXMgZm9sbG93cworICAgZnJvbSBSWCBCRCA2IGJ5dGUgUE1JIGNvbW1hbmQ6CisgICBBZGRyIDogQUVTL1RLSVAKKyAgIDB4MzggOiBwbjMvdHNjMworICAgMHgzOSA6IHBuMi90c2MyCisgICAweDNhIDogcG4xL3RzYzEKKyAgIDB4M2IgOiBwbjAvdHNjMAorCisgICAweDNjIDogcG41L3RzYzUKKyAgIDB4M2QgOiBwbjQvdHNjNCAqLworCisjaWZkZWYgQU5JX0JJR19CWVRFX0VORElBTgorICAgIHZfVTY0X3QgdWxsY3VycmVudFJlcGxheUNvdW50ZXIgPSAwOworICAgIC8qIEdldHRpbmcgNDgtYml0IHJlcGxheSBjb3VudGVyIGZyb20gdGhlIFJYIEJEICovCisgICAgdWxsY3VycmVudFJlcGxheUNvdW50ZXIgPSBXTEFOSEFMX1JYX0JEX0dFVF9QTUlDTURfMjBUTzIzKHB1Y1J4QkRIZWFkZXIpOyAKKyAgICB1bGxjdXJyZW50UmVwbGF5Q291bnRlciA8PD0gMTY7CisgICAgdWxsY3VycmVudFJlcGxheUNvdW50ZXIgfD0gKCggV0xBTkhBTF9SWF9CRF9HRVRfUE1JQ01EXzI0VE8yNShwdWNSeEJESGVhZGVyKSAmIDB4RkZGRjAwMDApID4+IDE2KTsKKyAgICByZXR1cm4gdWxsY3VycmVudFJlcGxheUNvdW50ZXI7CisjZWxzZQorICAgIHZfVTY0X3QgdWxsY3VycmVudFJlcGxheUNvdW50ZXIgPSAwOworICAgIC8qIEdldHRpbmcgNDgtYml0IHJlcGxheSBjb3VudGVyIGZyb20gdGhlIFJYIEJEICovCisgICAgdWxsY3VycmVudFJlcGxheUNvdW50ZXIgPSAoV0xBTkhBTF9SWF9CRF9HRVRfUE1JQ01EXzI0VE8yNShwdWNSeEJESGVhZGVyKSAmIDB4MDAwMEZGRkYpOyAKKyAgICB1bGxjdXJyZW50UmVwbGF5Q291bnRlciA8PD0gMzI7IAorICAgIHVsbGN1cnJlbnRSZXBsYXlDb3VudGVyIHw9IFdMQU5IQUxfUlhfQkRfR0VUX1BNSUNNRF8yMFRPMjMocHVjUnhCREhlYWRlcik7IAorICAgIHJldHVybiB1bGxjdXJyZW50UmVwbGF5Q291bnRlcjsKKyNlbmRpZgorfQorI2VuZGlmCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICAgIFdMQU5UTF9Qb3N0UmVzTmVlZGVkCisgICAgIAorICBERVNDUklQVElPTiAgIFRoaXMgZnVuY3Rpb24gcG9zdHMgbWVzc2FnZSB0byBUTCB0byByZXNlcnZlIEJEL1BEVSBtZW1vcnkKKyAKKyAgREVQRU5ERU5DSUVTICBOb25lCisgICAgICAgICAgICAgICAgICAgICAgICAgIAorICBQQVJBTUVURVJTICAgIHB2b3NHQ3R4CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgUkVUVVJOICAgICAgICBOb25lCisKKyAgU0lERSBFRkZFQ1RTICAgbm9uZQorID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCit2b2lkIFdMQU5UTF9Qb3N0UmVzTmVlZGVkKHZfUFZPSURfdCBwdm9zR0N0eCkKK3sKKyAgdm9zX21zZ190ICAgICAgICAgICAgdm9zTXNnOworCisgIHZvc01zZy5yZXNlcnZlZCA9IDA7CisgIHZvc01zZy5ib2R5cHRyICA9IE5VTEw7CisgIHZvc01zZy50eXBlICAgICA9IFdMQU5UTF9UWF9SRVNfTkVFREVEOworICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICJXTEFOIFRMOiBCRC9QRFUgYXZhaWxhYmxlIGludGVycnVwdCByZWNlaXZlZCwgUG9zdGluZyBtZXNzYWdlIHRvIFRMIik7CisgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zX3R4X21xX3NlcmlhbGl6ZSggVk9TX01RX0lEX1RMLCAmdm9zTXNnKSkpCisgIHsKKyAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICIgJXMgZmFpbHMgdG8gcG9zdCBtZXNzYWdlIiwgX19mdW5jX18pOworICB9Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICAgICBXTEFOVExfVXBkYXRlUnNzaUJtcHMKKworICBERVNDUklQVElPTiAgICBUaGlzIGZ1bmN0aW9uIHVwZGF0ZXMgdGhlIFRMJ3MgUlNTSSAoaW4gQk1QUyBtb2RlKQorCisgIERFUEVOREVOQ0lFUyAgIE5vbmUKKworICBQQVJBTUVURVJTCisKKyAgICBwdm9zR0N0eCAgICAgICAgIFZPUyBjb250ZXh0ICAgICAgICAgIFZPUyBHbG9iYWwgY29udGV4dAorICAgIHN0YUlkICAgICAgICAgICAgU3RhdGlvbiBJRCAgICAgICAgICAgU3RhdGlvbiBJRAorICAgIHJzc2kgICAgICAgICAgICAgUlNTSSAoQk1QUyBtb2RlKSAgICAgUlNTSSBpbiBCTVBTIG1vZGUKKworICBSRVRVUk4gICAgICAgICBOb25lCisKKyAgU0lERSBFRkZFQ1RTICAgbm9uZQorID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCit2b2lkIFdMQU5UTF9VcGRhdGVSc3NpQm1wcyh2X1BWT0lEX3QgcHZvc0dDdHgsIHZfVThfdCBzdGFJZCwgdl9TN190IHJzc2kpCit7CisgIFdMQU5UTF9DYlR5cGUqIHBUTENiID0gVk9TX0dFVF9UTF9DQihwdm9zR0N0eCk7CisKKyAgaWYgKE5VTEwgIT0gcFRMQ2IgJiYgTlVMTCAhPSBwVExDYi0+YXRsU1RBQ2xpZW50c1tzdGFJZF0pCisgIHsKKyAgICBwVExDYi0+YXRsU1RBQ2xpZW50c1tzdGFJZF0tPnJzc2lBdmdCbXBzID0gcnNzaTsKKyAgfQorfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgICAgV0xBTlRMX1VwZGF0ZVNuckJtcHMKKworICBERVNDUklQVElPTiAgICBUaGlzIGZ1bmN0aW9uIHVwZGF0ZXMgdGhlIFRMJ3MgU05SIChpbiBCTVBTIG1vZGUpCisKKyAgREVQRU5ERU5DSUVTICAgTm9uZQorCisgIFBBUkFNRVRFUlMKKworICAgIHB2b3NHQ3R4ICAgICAgICAgVk9TIGNvbnRleHQgICAgICAgICAgVk9TIEdsb2JhbCBjb250ZXh0CisgICAgc3RhSWQgICAgICAgICAgICBTdGF0aW9uIElEICAgICAgICAgICBTdGF0aW9uIElECisgICAgc25yICAgICAgICAgICAgIFNOUiAoQk1QUyBtb2RlKSAgICAgU05SIGluIEJNUFMgbW9kZQorCisgIFJFVFVSTiAgICAgICAgIE5vbmUKKworICBTSURFIEVGRkVDVFMgICBub25lCisgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKK3ZvaWQgV0xBTlRMX1VwZGF0ZVNuckJtcHModl9QVk9JRF90IHB2b3NHQ3R4LCB2X1U4X3Qgc3RhSWQsIHZfUzdfdCBzbnIpCit7CisgIFdMQU5UTF9DYlR5cGUqIHBUTENiID0gVk9TX0dFVF9UTF9DQihwdm9zR0N0eCk7CisKKyAgaWYgKE5VTEwgIT0gcFRMQ2IgJiYgTlVMTCAhPSBwVExDYi0+YXRsU1RBQ2xpZW50c1tzdGFJZF0pCisgIHsKKyAgICBwVExDYi0+YXRsU1RBQ2xpZW50c1tzdGFJZF0tPnNuckF2Z0JtcHMgPSBzbnI7CisgIH0KK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgICAgIFdMQU5UTF9VcGRhdGVMaW5rQ2FwYWNpdHkKKworICBERVNDUklQVElPTiAgICBUaGlzIGZ1bmN0aW9uIHVwZGF0ZXMgdGhlIFNUQSdzIExpbmsgQ2FwYWNpdHkgaW4gVEwKKworICBERVBFTkRFTkNJRVMgICBOb25lCisKKyAgUEFSQU1FVEVSUworCisgICAgcHZvc0dDdHggICAgICAgICBWT1MgY29udGV4dCAgICAgICAgICBWT1MgR2xvYmFsIGNvbnRleHQKKyAgICBzdGFJZCAgICAgICAgICAgIFN0YXRpb24gSUQgICAgICAgICAgIFN0YXRpb24gSUQKKyAgICBsaW5rQ2FwYWNpdHkgICAgIGxpbmtDYXBhY2l0eSAgICAgICAgIExpbmsgQ2FwYWNpdHkKKworICBSRVRVUk4gICAgICAgICBOb25lCisKKyAgU0lERSBFRkZFQ1RTICAgbm9uZQorID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCit2b2lkIFdMQU5UTF9VcGRhdGVMaW5rQ2FwYWNpdHkodl9QVk9JRF90IHB2b3NHQ3R4LCB2X1U4X3Qgc3RhSWQsIHZfVTMyX3QgbGlua0NhcGFjaXR5KQoreworICAgIFdMQU5UTF9DYlR5cGUqIHBUTENiID0gVk9TX0dFVF9UTF9DQihwdm9zR0N0eCk7CisKKyAgICBpZiAoTlVMTCAhPSBwVExDYiAmJiBOVUxMICE9IHBUTENiLT5hdGxTVEFDbGllbnRzW3N0YUlkXSkKKyAgICB7CisgICAgICAgIHBUTENiLT5hdGxTVEFDbGllbnRzW3N0YUlkXS0+bGlua0NhcGFjaXR5ID0gbGlua0NhcGFjaXR5OworICAgIH0KK30KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5UTF9HZXRTVEFMaW5rQ2FwYWNpdHkKKworICBERVNDUklQVElPTgorCisgICAgUmV0dXJucyBMaW5rIENhcGFjaXR5IG9mIGEgcGFydGljdWxhciBTVEEuCisKKyAgREVQRU5ERU5DSUVTCisK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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5UTF9HZXRTVEFMaW5rQ2FwYWNpdHkKKygKKyAgICB2X1BWT0lEX3QgICAgICAgICAgICAgcHZvc0dDdHgsCisgICAgdl9VOF90ICAgICAgICAgICAgICAgIHVjU1RBSWQsCisgICAgdl9VMzJfdCAgICAgICAgICAgICAgICpwbGlua0NhcGFjaXR5CispCit7CisgICAgV0xBTlRMX0NiVHlwZSogIHBUTENiID0gTlVMTDsKKyAgICAvKi0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtKi8KKworICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICBTYW5pdHkgY2hlY2sKKyAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyAgICBpZiAoIE5VTEwgPT0gcGxpbmtDYXBhY2l0eSApCisgICAgeworICAgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiV0xBTiBUTDpJbnZhbGlkIHBhcmFtZXRlciIpKSk7CisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICAgfQorCisgICAgaWYgKCBXTEFOVExfU1RBX0lEX0lOVkFMSUQoIHVjU1RBSWQgKSApCisgICAgeworICAgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEw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G93LiAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICBFRElUIEhJU1RPUlkgRk9SIEZJTEUKKworCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLgorICBOb3RpY2UgdGhhdCBjaGFuZ2VzIGFyZSBsaXN0ZWQgaW4gcmV2ZXJzZSBjaHJvbm9sb2dpY2FsIG9yZGVyLgorCisKKyAgICRIZWFkZXIkJERhdGVUaW1lJCRBdXRob3IkCisKKworICB3aGVuICAgICAgICB3aG8gICAgIHdoYXQsIHdoZXJlLCB3aHkKKy0tLS0tLS0tLS0gICAgLS0tICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisyMDEwLTEwLXh4ICAgIGRsaSAgICAgQ2hhbmdlIHVjQ0luZGV4IHRvIHBvaW50IHRvIHRoZSBzbG90IHRoZSBuZXh0IGZyYW1lIHRvIGJlIGV4cGVjdGVkIHRvIGZ3ZAorMjAwOC0wOC0yMiAgICBzY2ggICAgIFVwZGF0ZSBiYXNlZCBvbiB1bml0IHRlc3QKKzIwMDgtMDctMzEgICAgbHRpICAgICBDcmVhdGVkIG1vZHVsZQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0K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ORF9USFJFU0hPTEQgICAgICAgICAgMzAwMCAvKiBDU04gd3JhcCBhcm91bmQgdGhyZXNob2xkICovCisKKworY29uc3Qgdl9VOF90ICBXTEFOVExfVElEXzJfQUNbV0xBTl9NQVhfVElEXSA9IHsgICBXTEFOVExfQUNfQkUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9BQ19CSywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX0FDX0JLLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfQUNfQkUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9BQ19WSSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX0FDX1ZJLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfQUNfVk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9BQ19WTyB9OworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OICAgIHRsUmVvcmRlcmluZ0FnaW5nVGltZXJFeHBpZXJDQgorCisgICBERVNDUklQVElPTiAKKyAgICAgIEFmdGVyIGFnaW5nIHRpbWVyIGV4cGllcmVkLCBhbGwgUWVkIGZyYW1lcyBoYXZlIHRvIGJlIHJvdXRlZCB0byB1cHBlcgorICAgICAgbGF5ZXIuIE90aGVyd2lzZSwgdGhlcmUgaXMgcG9zc2liaWxpdGllZCB0aGF0IGFobmcgc29tZSBmcmFtZXMKKyAgICAKKyAgIFBBUkFNRVRFUlMgCisgICAgICB2X1BWT0lEX3QgIHRpbWVyVWRhdGEgICAgVGltZXIgY2FsbGJhY2sgdXNlciBkYXRhCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSGFzIGluZm9ybWF0aW9uIGFib3V0IHdoZXJlIGZyYW1lcyBzaG91bGQgYmUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3V0ZWQKKyAgIAorICAgUkVUVVJOIFZBTFVFCisgICAgICBWT1NfU1RBVFVTX1NVQ0NFU1MgICAgICAgR2VuZXJhbCBzdWNjZXNzCisgICAgICBWT1NfU1RBVFVTX0VfSU5WQUwgICAgICAgSW52YWxpZCBmcmFtZSBoYW5kbGUKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZfVk9JRF90IFdMQU5UTF9SZW9yZGVyaW5nQWdpbmdUaW1lckV4cGllckNCCisoCisgICB2X1BWT0lEX3QgIHRpbWVyVWRhdGEKKykKK3sKKyAgIFdMQU5UTF9USU1FUl9FWFBJRVJfVURBVEFfVCAqZXhwaXJlSGFuZGxlOworICAgV0xBTlRMX0JBUmVvcmRlclR5cGUgICAgICAgICpSZW9yZGVySW5mbzsKKyAgIFdMQU5UTF9DYlR5cGUgICAgICAgICAgICAgICAqcFRMSGFuZGxlOworICAgV0xBTlRMX1NUQUNsaWVudFR5cGUqICAgICAgIHBDbGllbnRTVEEgPSBOVUxMOworICAgdm9zX3BrdF90ICAgICAgICAgICAgICAgICAgICp2b3NEYXRhQnVmZjsKKyAgIFZPU19TVEFUVVMgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgICB1Y1NUQUlEOworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgICB1Y1RJRDsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICAgb3BDb2RlOworICAgV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dWNUSURdLnVjRXhpc3RzKQorICAgeworICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJSZW9yZGVyIHNlc3Npb24gZG9lc24ndCBleGlzdCBTSUQgJWQsIFRJRCAlZCIsIAorICAgICAgICAgICAgICAgICAgIHVjU1RBSUQsIHVjVElEKSk7CisgICAgICAgcmV0dXJuOworICAgfQorCisgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc19sb2NrX2FjcXVpcmUoJlJlb3JkZXJJbmZvLT5yZW9yZGVyTG9jaykpKQorICAgeworICAgICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIldMQU5UTF9SZW9yZGVyaW5nQWdpbmdUaW1lckV4cGllckNCLCBHZXQgTE9DSyBGYWlsIikpOworICAgICAgcmV0dXJuOworICAgfQorCisgICBpZiggMCA9PSBwQ2xpZW50U1RBLT5hdGxCQVJlb3JkZXJJbmZvW3VjVElEXS51Y0V4aXN0cyApCisgICB7CisgICAgICB2b3NfbG9ja19yZWxlYXNlKCZSZW9yZGVySW5mby0+cmVvcmRlckxvY2spOworICAgICAgcmV0dXJuOworICAgfQorCisgICBvcENvZGUgICAgICA9IFdMQU5UTF9PUENPREVfRldEQUxMX0RST1BDVVI7CisgICB2b3NEYXRhQnVmZiA9IE5VTEw7CisKKyAgIE1UUkFDRSh2b3NfdHJhY2UoVk9TX01PRFVMRV9JRF9UTCwgVFJBQ0VfQ09ERV9UTF9SRU9SREVSX1RJTUVSX0VYUF9DQiwKKyAgICAgICAgICAgICAgICAgICAgICB1Y1NUQUlEICwgb3BDb2RlICkpOworCisKKyAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sIkJBIHRpbWVvdXQgd2l0aCAlZCBwZW5k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4X3QgICAgIHVjbG9vcENvdW50ZXIgPSAwOworICAgICAgIHZfQk9PTF90ICAgc3RhdHVzID0gMDsKKworICAgICAgIC8qRG8gcmVwbGF5IGNoZWNrIGZvciBhbGwgcGFja2V0cyB3aGljaCBhcmUgaW4gUmVvcmRlciBidWZmZXIgKi8KKyAgICAgICBmb3IodWNsb29wQ291bnRlciA9IDA7IHVjbG9vcENvdW50ZXIgPCBXTEFOVExfTUFYX1dJTlNJWkU7IHVjbG9vcENvdW50ZXIrKykKKyAgICAgICB7CisgICAgICAgICAvKkdldCBwcmV2aW91cyByZXBseSBjb3VudGVyKi8KKyAgICAgICAgIHVsbHByZXZpb3VzUmVwbGF5Q291bnRlciA9IHBDbGllbnRTVEEtPnVsbFJlcGxheUNvdW50ZXJbdWNUSURdOworCisgICAgICAgICAvKkdldCBjdXJyZW50IHJlcGxheSBjb3VudGVyIG9mIHBhY2tldCBpbiByZW9yZGVyIGJ1ZmZlciovCisgICAgICAgICB1bGxjdXJyZW50UmVwbGF5Q291bnRlciA9IFJlb3JkZXJJbmZvLT5yZW9yZGVyQnVmZmVyLT51bGxSZXBsYXlDb3VudGVyW3VjbG9vcENvdW50ZXJdOworCisgICAgICAgICAvKkNoZWNrIGZvciBob2xlcywgaWYgYSBob2xlIGlzIGZvdW5kIGluIFJlb3JkZXIgYnVmZmVyIHRoZW4KKyAgICAgICAgICAgbm8gbmVlZCB0byBkbyByZXBsYXkgY2hlY2sgb24gaXQsIHNraXAgdGhlIGN1cnJlbnQKKyAgICAgICAgICAgaG9sZSBhbmQgZG8gcmVwbGF5IGNoZWNrIG9uIG90aGVyIHBhY2tldHMqLworICAgICAgICAgaWYoTlVMTCAhPSAoUmVvcmRlckluZm8tPnJlb3JkZXJCdWZmZXItPmFycmF5QnVmZmVyW3VjbG9vcENvdW50ZXJdKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgc3RhdHVzID0gV0xBTlRMX0lzUmVwbGF5UGFja2V0KHVsbGN1cnJlbnRSZXBsYXlDb3VudGVyLCB1bGxwcmV2aW91c1JlcGxheUNvdW50ZXIpOyAKKyAgICAgICAgICAgaWYoVk9TX1RSVUUgPT0gc3RhdHVzKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICAvKkluY3JlbWVudCB0aGUgZGVidWcgY291bnRlciovCisgICAgICAgICAgICAgICBwQ2xpZW50U1RBLT51bFRvdGFsUmVwbGF5UGFja2V0c0RldGVjdGVkKys7CisKKyAgICAgICAgICAgICAgIC8qQSByZXBsYXkgcGFja2V0IGZvdW5kKi8KKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICJXTEFOVExfUmVvcmRlcmluZ0FnaW5nVGltZXJFeHBpZXJDQjogdG90YWwgZHJvcHBlZCByZXBsYXkgcGFja2V0cyBvbiBTVEEgSUQgJVggaXMgWzB4JVhdIiwKKyAgICAgICAgICAgICAgICB1Y1NUQUlELCBwQ2xpZW50U1RBLT51bFRvdGFsUmVwbGF5UGFja2V0c0RldGVjdGVkKTsKKworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIldMQU5UTF9SZW9yZGVyaW5nQWdpbmdUaW1lckV4cGllckNCOiByZXBsYXkgcGFja2V0IGZvdW5kIHdpdGggUE4gOiBbMHglbGxYXSIsCisgICAgICAgICAgICAgICAgdWxsY3VycmVudFJlcGxheUNvdW50ZXIpOworCisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiV0xBTlRMX1Jlb3JkZXJpbmdBZ2luZ1RpbWVyRXhwaWVyQ0I6IERyb3AgdGhlIHJlcGxheSBwYWNrZXQgd2l0aCBQTiA6IFsweCVsbFhdIiwKKyAgICAgICAgICAgICAgICB1bGxjdXJyZW50UmVwbGF5Q291bnRlcik7CisKKyAgICAgICAgICAgICAgIFJlb3JkZXJJbmZvLT5yZW9yZGVyQnVmZmVyLT5hcnJheUJ1ZmZlclt1Y2xvb3BDb3VudGVyXSA9IE5VTEw7CisgICAgICAgICAgICAgICBSZW9yZGVySW5mby0+cmVvcmRlckJ1ZmZlci0+dWxsUmVwbGF5Q291bnRlclt1Y2xvb3BDb3VudGVyXSA9IDA7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgZWxzZQorICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qTm90IGEgcmVwbGF5IHBhY2tldCB1cGRhdGUgcHJldmlvdXMgcmVwbGF5IGNvdW50ZXIqLworICAgICAgICAgICAgICBwQ2xpZW50U1RBLT51bGxSZXBsYXlDb3VudGVyW3VjVElEXSA9IHVsbGN1cnJlbnRSZXBsYXlDb3VudGVyOworICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIEEgaG9sZSBkZXRlY3RlZCBpbiBSZW9yZGVyIGJ1ZmZlciovCisgICAgICAgICAgICAgIC8vQkFNU0dFUlJPUigiV0xBTlRMX1Jlb3JkZXJpbmdBZ2luZ1RpbWVyRXhwaWVyQ0IsaG9sZSBkZXRlY3RlZFxuIiwwLDAsMCk7CisgICAgICAgICAgICAgICAKKyAgICAgICAgIH0KKyAgICAgICB9IAorICAgfQorCisgICBjSW5kZXggPSBSZW9yZGVySW5mby0+dWNDSW5kZXg7CisgICBzdGF0dXMgPSBXTEFOVExfQ2hhaW5Gcm9udFBrdHMoZndJZHgsIG9wQ29kZSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnZvc0RhdGFCdWZmLCBSZW9yZGVySW5mbywgTlVMTCk7CisgICBSZW9yZGVySW5mby0+dWNDSW5kZXggPSBjSW5kZXg7CisgICBpZighVk9TX0lTX1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KyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICBGVU5DVElPTiAgICBXTEFOVExfSW5pdEJBUmVvcmRlckJ1ZmZlcgorCisgICBERVNDUklQVElPTiAKKyAgICAgIEluaXQgUmVvcmRlciBidWZmZXIgYXJyYXkKKyAgICAKKyAgIFBBUkFNRVRFUlMgCisgICAgICB2X1BWT0lEX3QgICBwdm9zR0N0eCBHbG9iYWwgY29udGV4dAorCisgICBSRVRVUk4gVkFMVUUKKyAgICAgIE5PTkUKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKwordm9pZCBXTEFOVExfSW5pdEJBUmVvcmRlckJ1ZmZlcgorKAorICAgdl9QVk9JRF90ICAgcHZvc0dDdHgKKykKK3sKKyAgIFdMQU5UTF9DYlR5cGUgICAgICAgICpwVExDYjsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgIGlkeDsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgIHBJZHg7CisKKyAgIHBUTENiID0gVk9TX0dFVF9UTF9DQihwdm9zR0N0eCk7CisgICBpZiAoTlVMTCA9PSBwVExDYikKKyAgIHsKKyAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgVEwgQ29udHJvbCBCbG9jayIsIF9fZnVuY19fKSk7CisgICAgICByZXR1cm47CisgICB9CisKKyAgIGZvcihpZHggPSAwOyBpZHggPCBXTEFOVExfTUFYX0JBX1NFU1NJT047IGlkeCsrKQorICAgeworICAgICAgcFRMQ2ItPnJlb3JkZXJCdWZmZXJQb29sW2lkeF0uaXNBdmFpbGFibGUgPSBWT1NfVFJVRTsKKyAgICAgIGZvcihwSWR4ID0gMDsgcElkeCA8IFdMQU5UTF9NQVhfV0lOU0laRTsgcElkeCsrKQorICAgICAgeworICAgICAgICAgcFRMQ2ItPnJlb3JkZXJCdWZmZXJQb29sW2lkeF0uYXJyYXlCdWZmZXJbcElkeF0gPSBOVUxMOworICAgICAgICAgcFRMQ2ItPnJlb3JkZXJCdWZmZXJQb29sW2lkeF0udWxsUmVwbGF5Q291bnRlcltwSWR4XSA9IDA7IAorICAgICAgfQorICAgfQorCisgICBUTExPRzQoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0xPVywiQkEgcmVvcmRlciBidWZmZXIgaW5pdCIpKTsKKyAgIHJldHVybjsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5UTF9CYVNlc3Npb25BZGQKKworICBERVNDUklQVElPTiAKKyAgICBIQUwgbm90aWZpZXMgVEwgd2hlbiBhIG5ldyBCbG9jayBBY2sgc2Vzc2lvbiBpcyBiZWluZyBhZGRlZC4gCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICBBIEJBIHNlc3Npb24gb24gUnggbmVlZHMgdG8gYmUgYWRkZWQgaW4gVEwgYmVmb3JlIHRoZSByZXNwb25zZSBpcyAKKyAgICBiZWluZyBzZW50IG91dCAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncyAKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQgCisgICAgdWNTVEFJZDogICAgICAgIGlkZW50aWZpZXIgb2YgdGhlIHN0YXRpb24gZm9yIHdoaWNoIHJlcXVlc3RlZCB0aGUgQkEgCisgICAgICAgICAgICAgICAgICAgIHNlc3Npb24KKyAgICB1Y1RpZDogICAgICAgICAgVHNwZWMgSUQgZm9yIHRoZSBuZXcgQkEgc2Vzc2lvbgorICAgIHVTaXplOiAgICAgICAgICBzaXplIG9mIHRoZSByZW9yZGVyaW5nIHdpbmRvdworCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24gIAorCisgICAgVk9TX1NUQVRVU19FX0lOVkFMOiAgICAgIElucHV0IHBhcmFtZXRlcnMgYXJlIGludmFsaWQgCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgICAgIFN0YXRpb24gSUQgaXMgb3V0c2lkZSBhcnJheSBib3VuZGFyaWVzIG9yIHBvaW50ZXIgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvIFRMIGNiIGlzIE5VTEwgOyBhY2Nlc3Mgd291bGQgY2F1c2UgYSBwYWdlIGZhdWx0ICAKKyAgICBWT1NfU1RBVFVTX0VfRVhJU1RTOiAgICAgU3RhdGlvbiB3YXMgbm90IHJlZ2lzdGVyZWQgb3IgQkEgc2Vzc2lvbiBhbHJlYWR5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4aXN0cworICAgIFZPU19TVEFUVVNfRV9OT1NVUFBPUlQ6ICBOb3QgeWV0IHN1cHBvcnRlZAorICAgIAorICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfQmFTZXNza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mlzQXZhaWxhYmxlID0gVk9TX0ZBTFNFOworICAgICAgVExMT0c0KFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19MT1csIiVkdGggYnVmZmVyIGF2YWlsYWJsZSwgYnVmZmVyIFBUUiAweCVwIiwKKyAgICAgICAgICAgICAgICAgIGlkeCwKKyAgICAgICAgICAgICAgICAgIHBDbGllbnRTVEEtPmF0bEJBUmVvcmRlckluZm9bdWNUaWRdLnJlb3JkZXJCdWZmZXIKKyAgICAgICAgICAgICAgICAgICkpOworICAgICAgYnJlYWs7CisgICAgfQorICB9CisKKyAgCisgIGlmIChXTEFOX1NUQV9TT0ZUQVAgPT0gcENsaWVudFNUQS0+d1NUQURlc2Mud1NUQVR5cGUpCisgIHsKKyAgICAgIGlmIChXTEFOVExfTUFYX0JBX1NFU1NJT04gPT0gaWR4KQorICAgICAgeworICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAiTnVtYmVyIG9mIEFkZCBCQSByZXF1ZXN0IHJlY2VpdmVkIG1vcmUgdGhhbiBhbGxvd2VkIik7CisgICAgICAgICAgdm9zX2xvY2tfcmVsZWFzZSgmcmVvcmRlckluZm8tPnJlb3JkZXJMb2NrKTsKKyAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX05PU1VQUE9SVDsKKyAgICAgIH0KKyAgfQorICByZW9yZGVySW5mby0+dGltZXJVZGF0YS5wQWRhcHRlciAgICAgPSBwdm9zR0N0eDsKKyAgcmVvcmRlckluZm8tPnRpbWVyVWRhdGEucFRMSGFuZGxlICAgID0gKHZfUFZPSURfdClwVExDYjsKKyAgcmVvcmRlckluZm8tPnRpbWVyVWRhdGEuU1RBSUQgICAgICAgID0gdWNTVEFJZDsKKyAgcmVvcmRlckluZm8tPnRpbWVyVWRhdGEuVElEICAgICAgICAgID0gdWNUaWQ7CisKKyAgLyogQkEgYWdpbmcgdGltZXIgKi8KKyAgc3RhdHVzID0gdm9zX3RpbWVyX2luaXQoJnJlb3JkZXJJbmZvLT5hZ2luZ1RpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVElNRVJfVFlQRV9TVywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX1Jlb3JkZXJpbmdBZ2luZ1RpbWVyRXhwaWVyQ0IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICh2X1BWT0lEX3QpKCZyZW9yZGVySW5mby0+dGltZXJVZGF0YSkpOworICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgIHsKKyAgICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAiJXM6IFRpbWVyIEluaXQgRmFpbCIsIF9fZnVuY19fKSk7CisgICAgIHZvc19sb2NrX3JlbGVhc2UoJnJlb3JkZXJJbmZvLT5yZW9yZGVyTG9jayk7CisgICAgIHJldHVybiBzdGF0dXM7CisgIH0KKworICBwQ2xpZW50U1RBLT5hdGxCQVJlb3JkZXJJbmZvW3VjVGlkXS51Y0V4aXN0cysrOworICBwQ2xpZW50U1RBLT5hdGxCQVJlb3JkZXJJbmZvW3VjVGlkXS51c0NvdW50ICAgPSAwOworICBwQ2xpZW50U1RBLT5hdGxCQVJlb3JkZXJJbmZvW3VjVGlkXS51Y0NJbmRleCAgPSAwOworICBpZigwID09IHdpblNpemUpCisgIHsKKyAgICBwQ2xpZW50U1RBLT5hdGxCQVJlb3JkZXJJbmZvW3VjVGlkXS53aW5TaXplID0gV0xBTlRMX01BWF9XSU5TSVpFOworICB9CisgIGVsc2UKKyAgeworICAgIHBDbGllbnRTVEEtPmF0bEJBUmVvcmRlckluZm9bdWNUaWRdLndpblNpemUgICA9IHdpblNpemU7CisgIH0KKyAgcENsaWVudFNUQS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RMIHdoZW4gYSBuZXcgQmxvY2sgQWNrIHNlc3Npb24gaXMgYmVpbmcgZGVsZXRlZC4gCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncyAKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQgCisgICAgdWNTVEFJZDogICAgICAgIGlkZW50aWZpZXIgb2YgdGhlIHN0YXRpb24gZm9yIHdoaWNoIHJlcXVlc3RlZCB0aGUgQkEgCisgICAgICAgICAgICAgICAgICAgIHNlc3Npb24KKyAgICB1Y1RpZDogICAgICAgICAgVHNwZWMgSUQgZm9yIHRoZSBuZXcgQkEgc2Vzc2lvbgorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfRV9JTlZBTDogICAgICBJbnB1dCBwYXJhbWV0ZXJzIGFyZSBpbnZhbGlkIAorICAgIFZPU19TVEFUVVNfRV9GQVVMVDogICAgICBTdGF0aW9uIElEIGlzIG91dHNpZGUgYXJyYXkgYm91bmRhcmllcyBvciBwb2ludGVyIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byBUTCBjYiBpcyBOVUxMIDsgYWNjZXNzIHdvdWxkIGNhdXNlIGEgcGFnZSBmYXVsdCAgCisgICAgVk9TX1NUQVRVU19FX0VYSVNUUzogICAgIFN0YXRpb24gd2FzIG5vdCByZWdpc3RlcmVkIG9yIEJBIHNlc3Npb24gYWxyZWFkeQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleGlzdHMKKyAgICBWT1NfU1RBVFVTX0VfTk9TVVBQT1JUOiAgTm90IHlldCBzdXBwb3J0ZWQKKyAgICAKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlRMX0JhU2Vzc2lvbkRlbCAKKyggCisgIHZfUFZPSURfdCAgICAgIHB2b3NHQ3R4LCAKKyAgdl9VMTZfdCAgICAgICAgdWNTVEFJZCwKKyAgdl9VOF90ICAgICAgICAgdWNUaWQKKykKK3sKKyAgV0xBTlRMX0NiVHlwZSogICAgICAgICAgcFRMQ2IgICAgICAgPSBOVUxMOworICBXTEFOVExfU1RBQ2xpZW50VHlwZSAgICAqcENsaWVudFNUQSAgID0gTlVMTDsKKyAgdm9zX3BrdF90KiAgICAgICAgICAgICAgdm9zRGF0YUJ1ZmYgPSBOVUxMOworICBWT1NfU1RBVFVTICAgICAgICAgICAgICB2b3NTdGF0dXMgICA9IFZPU19TVEFUVVNfRV9GQUlMVVJFOworICBWT1NfU1RBVFVTICAgICAgICAgICAgICBsb2NrU3RhdHVzID0gVk9TX1NUQVRVU19FX0ZBSUxVUkU7ICAKKyAgV0xBTlRMX0JBUmVvcmRlclR5cGUqICAgcmVPcmRlckluZm8gPSBOVUxMOworICBXTEFOVExfUnhNZXRhSW5mb1R5cGUgICB3UnhNZXRhSW5mbzsKKyAgdl9VMzJfdCAgICAgICAgICAgICAgICAgZndJZHggPSAwOworICAvKi0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAqLworCisgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgIFNhbml0eSBjaGVjaworICAgLS0tLS0tLS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1czsKKyAgfQorICBwQ2xpZW50U1RBLT5hdGxCQVJlb3JkZXJJbmZvW3VjVGlkXS51Y0V4aXN0cyA9IDA7CisKKyAgVExMT0cyKFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICJXTEFOIFRMOiBGd2QgYWxsIHBhY2tldHMgdG8gSEREIG9uIFdMQU5UTF9CYVNlc3Npb25EZWwiKSk7CisKKyAgaWYoMCA9PSByZU9yZGVySW5mby0+dWNDSW5kZXgpCisgIHsKKyAgICAgZndJZHggPSByZU9yZGVySW5mby0+d2luU2l6ZTsKKyAgfQorICBlbHNlCisgIHsKKyAgICAgZndJZHggPSByZU9yZGVySW5mby0+dWNDSW5kZXggLSAxOworICB9CisKKyAgaWYoMCAhPSByZU9yZGVySW5mby0+cGVuZGluZ0ZyYW1lc0NvdW50KQorICB7CisgICAgdm9zU3RhdHVzID0gV0xBTlRMX0NoYWluRnJvbnRQa3RzKGZ3SWR4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfT1BDT0RFX0ZXREFMTF9EUk9QQ1VSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdm9zRGF0YUJ1ZmYsIHJlT3JkZXJJbmZvLCBwVExDYik7CisgIH0KKworICBpZiAoKFZPU19TVEFUVVNfU1VDQ0VTUyA9PSB2b3NTdGF0dXMpICYmIChOVUxMICE9IHZvc0RhdGFCdWZmKSkKKyAgeworICAgIFRMTE9HMihWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgIldMQU4gVEw6IENoYWluaW5nIHdhcyBzdWNjZXNzZnVsIHNlbmRpbmcgYWxsIHBrdHMgdG8gSEREIDogJXgiLAorICAgICAgICAgICAgICB2b3NEYXRhQnVmZiApKTsKKworICAgIGl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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgIElOVEVSQUNUSU9OIFdJVEggVEwgbWFpbiBtb2R1bGUKKyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICBBTVNEVSBzdWItZnJhbWUgcHJvY2Vzc2luZyBtb2R1bGUKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOVExfQU1TRFVQcm9jZXNzCisKKyAgREVTQ1JJUFRJT04gCisgICAgUHJvY2VzcyBBLU1TRFUgc3ViLWZyYW1lLiBTdGFydCBvZiBjaGFpbiBpZiBtYXJrZWQgYXMgZmlyc3QgZnJhbWUuIAorICAgIExpbmtlZCBhdCB0aGUgZW5kIG9mIHRoZSBleGlzdGluZyBBTVNEVSBjaGFpbi4gCisKKyAgREVQRU5ERU5DSUVTIAorICAgICAgICAgCisgIFBBUkFNRVRFUlMgCisKKyAgIElOL09VVDoKKyAgIHZvc0RhdGFCdWZmOiB2b3MgcGFja2V0IGZvciB0aGUgcmVjZWl2ZWQgZGF0YQorICAgICAgICAgICAgICAgICBvdXRnb2luZyBjb250YWlucyB0aGUgcm9vdCBvZiB0aGUgY2hhaW4gZm9yIHRoZSByeCAKKyAgICAgICAgICAgICAgICAgYWdncmVnYXRlZCBNU0RVIGlmIHRoZSBmcmFtZSBpcyBtYXJrZWQgYXM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VVByb2Nlc3MgKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgUmUtb3JkZXJpbmcgbW9kdWxlCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOVExfTVNEVVJlb3JkZXIKKworICBERVNDUklQVElPTiAKKyAgICBNU0RVIHJlb3JkZXJpbmcgCisKKyAgREVQRU5ERU5DSUVTIAorICAgICAgICAgCisgIFBBUkFNRVRFUlMgCisKKyAgIElOCisgICAKKyAgIHZvc0RhdGFCdWZmOiB2b3MgcGFja2V0IGZvciB0aGUgcmVjZWl2ZWQgZGF0YQorICAgcHZCREhlYWRlcjogcG9pbnRlciB0byB0aGUgQkQgaGVhZGVyCisgICB1Y1NUQUlkOiAgICBTdGF0aW9uIElEIAorICAgICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9NU0RVUmVvcmRlcgorKCAKKyAgIFdMQU5UTF9DYlR5cGUgICAgKnBUTENiLAorICAgdm9zX3BrdF90ICAgICAgICAqKnZvc0RhdGFCdWZmLCAKKyAgIHZfUFZPSURfdCAgICAgICAgcHZCREhlYWRlciwKKyAgIHZfVThfdCAgICAgICAgICAgdWNTVEFJZCwKKyAgIHZfVThfdCAgICAgICAgICAgdWNUaWQKKykKK3sKKyAgIFdMQU5UTF9CQVJlb3JkZXJUeXBlICpjdXJyZW50UmVvcmRlckluZm87CisgICBXTEFOVExfU1RBQ2xpZW50VHlwZSAqcENsaWVudFNUQSA9IE5VTEw7CisgICB2b3NfcGt0X3QgICAgICAgICAgICAqdm9zUGt0SWR4OworICAgdl9VOF90ICAgICAgICAgICAgICAgdWNPcENvZGU7IAorICAgdl9VOF90ICAgICAgICAgICAgICAgdWNTbG90SWR4OworICAgdl9VOF90ICAgICAgICAgICAgICAgdWNGd2RJZHg7CisgICB2X1UxNl90ICAgICAgICAgICAgICBDU047CisgICB2X1UzMl90ICAgICAgICAgICAgICB1Y0NJbmRleE9yaWc7CisgICBWT1NfU1RBVFVTICAgICAgICAgICBzdGF0dXMgICAgICA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgIFZPU19TVEFUVVMgICAgICAgICAgIGxvY2tTdGF0dXMgID0gVk9TX1NUQVRVU19TVUNDRVNTOyAKKyAgIFZPU19TVEFUVVMgICAgICAgICAgIHRpbWVyU3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOyAKKyAgIFZPU19USU1FUl9TVEFURSAgICAgIHRpbWVyU3RhdGU7CisgICB2X1NJWkVfdCAgICAgICAgICAgICByeEZyZWU7CisgICB2X1U2NF90ICAgICAgICAgICAgICB1bGxyZXBsYXlDb3VudGVyID0gMDsgLyogNDgtYml0IHJlcGxheSBjb3VudGVyICovCisgICB2X1U4X3QgICAgICAgICAgICAgICBhYzsKKyAgIHZfVTE2X3QgICAgICAgICAgICAgIHJlb3JkZXJUaW1lOworICAgaWYoKE5VTEwgPT0gcFRMQ2IpIHx8ICgqdm9zRGF0YUJ1ZmYgPT0gTlVMTCkpCisgICB7CisgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UU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UxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIihRQ1VSX0ZXREJVRikgZHJvcHBpbmcgb2xkIGZyYW1lLCBTTj0lZCBMYXN0U049JWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICBDU04sIGN1cnJlbnRSZW9yZGVySW5mby0+TGFzdFNOKSk7CisgICAgICAgICAgICAgICAgIHN0YXR1cyA9IHZvc19wa3RfcmV0dXJuX3BhY2tldCgqdm9zRGF0YUJ1ZmYpOworICAgICAgICAgICAgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIoUUNVUl9GV0RCVUYpIGRyb3Agb2xkIGZyYW1lIGZhaWwgJWQiLCBzdGF0dXMpKTsKKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAqdm9zRGF0YUJ1ZmYgPSBOVUxMOworICAgICAgICAgICAgICAgICBsb2NrU3RhdHVzID0gdm9zX2xvY2tfcmVsZWFzZSgmY3VycmVudFJlb3JkZXJJbmZvLT5yZW9yZGVyTG9jayk7CisgICAgICAgICAgICAgICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKGxvY2tTdGF0dXMpKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiV0xBTlRMX01TRFVSZW9yZGVyLCBSZWxlYXNlIExPQ0sgRmFpbCIpKTsKKyAgICAgICAgICAgICAgICAgICAgIHJldHVybiBsb2NrU3RhdHVzOworICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICAgICAgY3VycmVudFJlb3JkZXJJbmZvLT5MYXN0U04gPSBDU047CisgICAgICAgICBpZigwID09IGN1cnJlbnRSZW9yZGVySW5mby0+cGVuZGluZ0ZyYW1lc0NvdW50KQorICAgICAgICAgeworICAgICAgICAgICAgLy9UaGlzIGZyYW1lIHdpbGwgYmUgZndkJ2VkIHRvIHRoZSBPUy4gVGhlIG5leHQgc2xvdCBpcyB0aGUgb25lIHdlIGV4cGVjdCBuZXh0CisgICAgICAgICAgICBjdXJyZW50UmVvcmRlckluZm8tPnVjQ0luZGV4ID0gKHVjU2xvdElkeCArIDEpICUgY3VycmVudFJlb3JkZXJJbmZvLT53aW5TaXplOworICAgICAgICAgICAgbG9ja1N0YXR1cyA9IHZvc19sb2NrX3JlbGVhc2UoJmN1cnJlbnRSZW9yZGVySW5mby0+cmVvcmRlckxvY2spOworICAgICAgICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyhsb2NrU3RhdHVzKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJXTEFOVExfTVNEVVJlb3JkZXIsIFJlbGVhc2UgTE9DSyBGYWlsIikpOworICAgICAgICAgICAgICAgcmV0dXJuIGxvY2tTdGF0dXM7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gc3RhdHVzOworICAgICAgICAgfQorICAgICAgICAgc3RhdHVzID0gV0xBTlRMX1F1ZXVlQ3VycmVudChjdXJyZW50UmVvcmRlckluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc0RhdGFCdWZmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1Y1Nsb3RJZHgpOworICAgICAgICAgaWYoVk9TX1RSVUUgPT0gcENsaWVudFNUQS0+dWNJc1JlcGxheUNoZWNrVmFsaWQpCisgICAgICAgICB7CisgICAgICAgICAgICAgV0xBTlRMX0ZpbGxSZXBsYXlDb3VudGVyKGN1cnJlbnRSZW9yZGVySW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bGxyZXBsYXlDb3VudGVyLCB1Y1Nsb3RJZHgpOworICAgICAgICAgfQorICAgICAgICAgaWYoVk9TX1NUQVRVU19FX1JFU09VUkNFUyA9PSBzdGF0dXMpCisgICAgICAgICB7CisgICAgICAgICAgICAvKiBUaGlzIGlzIHRoZSBjYXNlIHNsb3QgaW5kZXggaXMgYWxyZWFkeSBjeWNsZSBvbmUgcm91dGUsIHJvdXRlIGFsbCB0aGUgZnJhbWVzIFFlZCAqLworICAgICAgICAgICAgdm9zUGt0SWR4ID0gTlVMTDsKKyAgICAgICAgICAgIHN0YXR1cyA9IFdMQU5UTF9DaGFpbkZyb250UGt0cyh1Y0Z3ZElkeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfT1BDT0RFX0ZXREFMTF9RQ1VSLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdm9zUGt0SWR4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRSZW9yZGVySW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVExDYik7CisgICAgICAgICAgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiTWFrZSBmcmFtZSBjaGFpbiBmYWlsICVkIiwgc3RhdHVzKSk7CisgICAgICAgICAgICAgICBsb2NrU3RhdHVzID0gdm9zX2xvY2tfcmVsZWFzZSgmY3VycmVudFJlb3JkZXJJbmZvLT5yZW9yZGVyTG9jayk7CisgICAgICAgICAgICAgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKGxvY2tTdGF0dXMpKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIldMQU5UTF9NU0RVUmVvcmRlciwgUmVsZWFzZSBMT0NLIEZhaWwiKSk7CisgICAgICAgICAgICAgICAgICByZXR1cm4gbG9ja1N0YXR1czsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzdGF0dXMgPSB2b3NfcGt0X2NoYWluX3BhY2tldCh2b3NQa3RJZHgsICp2b3NEYXRhQnVmZiwgMSk7CisgICAgICAgICAgICAqdm9zRGF0YUJ1ZmYgPSB2b3NQa3RJZHg7CisgICAgICAgICAgICBjdXJyZW50UmVvcmRlckluZm8tPnBlbmRpbmdGcmFtZXNDb3VudCA9IDA7CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICB2b3NQa3RJZHggPSBOVUxMOworICAgICAgICAgICAgc3RhdHVzID0gV0xBTlRMX0NoYWluRnJvbnRQa3RzKHVjRndkSWR4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9PUENPREVfUUNVUl9GV0RCVUYsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ2b3NQa3RJZHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudFJlb3JkZXJJbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUTENiKTsKKyAgICAgICAgICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJNYWtlIGZyYW1lIGNoYWluIGZhaWwgJWQiLCBzdGF0dXMpKTsKKyAgICAgICAgICAgICAgIGxvY2tTdGF0dXMgPSB2b3NfbG9ja19yZWxlYXNlKCZjdXJyZW50UmVvcmRlckluZm8tPnJlb3JkZXJMb2NrKTsKKyAgICAgICAgICAgICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MobG9ja1N0YXR1cykpCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiV0xBTlRMX01TRFVSZW9yZGVyLCBSZWxlYXNlIExPQ0sgRmFpbCIpKTsKKyAgICAgICAgICAgICAgICAgIHJldHVybiBsb2NrU3RhdHVzOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGN1cnJlbnRSZW9yZGVySW5mby0+dWNDSW5kZXggPSB1Y0Z3ZElkeDsKKyAgICAgICAgICAgICp2b3NEYXRhQnVmZiA9IHZvc1BrdElkeDsKKyAgICAgICAgIH0KKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIFdMQU5UTF9PUENPREVfRldEQlVGX0ZXRENVUjoKKyAgICAgICAgIHZvc1BrdElkeCA9IE5VTEw7CisgICAgICAgICBzdGF0dXMgPSBXTEFOVExfQ2hhaW5Gcm9udFBrdHModWNGd2RJZHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX09QQ09ERV9GV0RCVUZfRldEQ1VSLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdm9zUGt0SWR4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRSZW9yZGVySW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVExDYik7CisgICAgICAgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICB7CisgICAgICAgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiTWFrZSBmcmFtZSBjaGFpbiBmYWlsICVkIiwgc3RhdHVzKSk7CisgICAgICAgICAgICBsb2NrU3RhdHVzID0gdm9zX2xvY2tfcmVsZWFzZSgmY3VycmVudFJlb3JkZXJJbmZvLT5yZW9yZGVyTG9jayk7CisgICAgICAgICAgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKGxvY2tTdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIldMQU5UTF9NU0RVUmVvcmRlciwgUmVsZWFzZSBMT0NLIEZhaWwiKSk7CisgICAgICAgICAgICAgICByZXR1cm4gbG9ja1N0YXR1czsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgICAgICB9CisKKyAgICAgICAgIGlmKE5VTEwgPT0gdm9zUGt0SWR4KQorICAgICAgICAgeworICAgICAgICAgICAgVExMT0c0KFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19MT1csIk5vdGhpbmcgdG8gY2hhaW4sIGp1c3Qgc2VuZCBjdXJyZW50IGZyYW1lIikpOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzID0gdm9zX3BrdF9jaGFpbl9wYWNrZXQodm9zUGt0SWR4LCAqdm9zRGF0YUJ1ZmYsIDEpOworICAgICAgICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIk1ha2UgZnJhbWUgY2hhaW4gd2l0aCBDVVIgZnJhbWUgZmFpbCAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMpKTsKKyAgICAgICAgICAgICAgIGxvY2tTdGF0dXMgPSB2b3NfbG9ja19yZWxlYXNlKCZjdXJyZW50UmVvcmRlckluZm8tPnJlb3JkZXJMb2NrKTsKKyAgICAgICAgICAgICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MobG9ja1N0YXR1cykpCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiV0xBTlRMX01TRFVSZW9yZGVyLCBSZWxlYXNlIExPQ0sgRmFpbCIpKTsKKyAgICAgICAgICAgICAgICAgIHJldHVybiBsb2NrU3RhdHVzOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgICp2b3NEYXRhQnVmZiA9IHZvc1BrdElkeDsKKyAgICAgICAgIH0KKyAgICAgICAgIC8vdWNGd2RJZHggaXMgdGhlIHNsb3QgdGhpcyBwYWNrZXQgc3VwcG9zZXMgdG8gdGFrZSBidXQgdGhlcmUgaXMgYSBob2xlIHRoZXJlCisgICAgICAgICAvL0l0IGxvb2tzIHRoYXQgdGhlIGNoaXAgd2lsbCBwdXQgdGhlIG5leHQgcGFja2V0IGludG8gdGhlIHNsb3QgdWNGd2RJZHguCisgICAgICAgICBjdXJyZW50UmVvcmRlckluZm8tPnVjQ0luZGV4ID0gdWNGd2RJZHg7CisgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBXTEFOVExfT1BDT0RFX1FDVVI6CisgICAgICAgIGlmIChjdXJyZW50UmVvcmRlckluZm8tPkxhc3RTTiA+IENTTikKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKChjdXJyZW50UmVvcmRlckluZm8tPkxhc3RTTiAtIENTTikgPCBDU05fV1JBUF9BUk9VTkRfVEhSRVNIT0xEKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vIHRoaXMgZnJhbWUgaXMgcmVjZWl2ZWQgYWZ0ZXIgQkEgdGltZXIgaXMgZXhwaXJlZCwgc28gZGlzYXJkIGl0CisgICAgICAgICAgICAgICAgVExMT0cxKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIihRQ1VSKSBkcm9wcGluZyBvbGQgZnJhbWUsIFNOPSVkIExhc3RTTj0lZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENTTiwgY3VycmVudFJlb3JkZXJJbmZvLT5MYXN0U04pKTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSB2b3NfcGt0X3JldHVybl9wYWNrZXQoKnZvc0RhdGFCdWZmKTsKKyAgICAgICAgICAgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIioqKiAoUUNVUikgZHJvcCBvbGQgZnJhbWUgZmFpbCAlZCIsIHN0YXR1cykpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAqdm9zRGF0YUJ1ZmYgPSBOVUxMOworICAgICAgICAgICAgICAgIGxvY2tTdGF0dXMgPSB2b3NfbG9ja19yZWxlYXNlKCZjdXJyZW50UmVvcmRlckluZm8tPnJlb3JkZXJMb2NrKTsKKyAgICAgICAgICAgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyhsb2NrU3RhdHVzKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiV0xBTlRMX01TRFVSZW9yZGVyLCBSZWxlYXNlIExPQ0sgRmFpbCIpKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxvY2tTdGF0dXM7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAgc3RhdHVzID0gV0xBTlRMX1F1ZXVlQ3VycmVudChjdXJyZW50UmVvcmRlckluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc0RhdGFCdWZmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1Y1Nsb3RJZHgpOworICAgICAgICAgICBpZihWT1NfVFJVRSA9PSBwQ2xpZW50U1RBLT51Y0lzUmVwbGF5Q2hlY2tWYWxpZCkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgV0xBTlRMX0ZpbGxSZXBsYXlDb3VudGVyKGN1cnJlbnRSZW9yZGVySW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVsbHJlcGxheUNvdW50ZXIsIHVjU2xvdElkeCk7CisgICAgICAgICAgIH0KKyAgICAgICAgIGlmKFZPU19TVEFUVVNfRV9SRVNPVVJDRVMgPT0gc3RhdHVzKQorICAgICAgICAgeworICAgICAgICAgICAgLyogVGhpcyBpcyB0aGUgY2FzZSBzbG90IGluZGV4IGlzIGFscmVhZHkgY3ljbGUgb25lIHJvdXRlLCByb3V0ZSBhbGwgdGhlIGZyYW1lcyBRZWQgKi8KKyAgICAgICAgICAgIHZvc1BrdElkeCA9IE5VTEw7CisgICAgICAgICAgICBzdGF0dXMgPSBXTEFOVExfQ2hhaW5Gcm9udFBrdHModWNGd2RJZHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX09QQ09ERV9GV0RBTExfUUNVUiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnZvc1BrdElkeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50UmVvcmRlckluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRMQ2IpOworICAgICAgICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIk1ha2UgZnJhbWUgY2hhaW4gZmFpbCAlZCIsIHN0YXR1cykpOworICAgICAgICAgICAgICAgbG9ja1N0YXR1cyA9IHZvc19sb2NrX3JlbGVhc2UoJmN1cnJlbnRSZW9yZGVySW5mby0+cmVvcmRlckxvY2spOworICAgICAgICAgICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyhsb2NrU3RhdHVzKSkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJXTEFOVExfTVNEVVJlb3JkZXIsIFJlbGVhc2UgTE9DSyBGYWlsIikpOworICAgICAgICAgICAgICAgICAgcmV0dXJuIGxvY2tTdGF0dXM7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICByZXR1cm4gc3RhdHVzOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc3RhdHVzID0gdm9zX3BrdF9jaGFpbl9wYWNrZXQodm9zUGt0SWR4LCAqdm9zRGF0YUJ1ZmYsIDEpOworICAgICAgICAgICAgKnZvc0RhdGFCdWZmID0gdm9zUGt0SWR4OworICAgICAgICAgICAgY3VycmVudFJlb3JkZXJJbmZvLT5wZW5kaW5nRnJhbWVzQ291bnQgPSAwOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgLyogU2luY2UgY3VycmVudCBGcmFtZSBpcyBRZWQsIG5vIGZyYW1lIHdpbGwgYmUgcm91dGVkICovCisgICAgICAgICAgICAqdm9zRGF0YUJ1ZmYgPSBOVUxMOyAKKyAgICAgICAgIH0KKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIFdMQU5UTF9PUENPREVfRldEQlVGX1FVRVVFQ1VSOgorICAgICAgICAgdm9zUGt0SWR4ID0gTlVMTDsKKyAgICAgICAgIHN0YXR1cyA9IFdMQU5UTF9DaGFpbkZyb250UGt0cyh1Y0Z3ZElkeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfT1BDT0RFX0ZXREJVRl9RVUVVRUNVUiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnZvc1BrdElkeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50UmVvcmRlckluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRMQ2IpOworICAgICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgeworICAgICAgICAgICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIk1ha2UgY2hhaW4gd2l0aCBidWZmZXJlZCBmcmFtZSBmYWlsICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cykpOworICAgICAgICAgICAgbG9ja1N0YXR1cyA9IHZvc19sb2NrX3JlbGVhc2UoJmN1cnJlbnRSZW9yZGVySW5mby0+cmVvcmRlckxvY2spOworICAgICAgICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyhsb2NrU3RhdHVzKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJXTEFOVExfTVNEVVJlb3JkZXIsIFJlbGVhc2UgTE9DSyBGYWlsIikpOworICAgICAgICAgICAgICAgcmV0dXJuIGxvY2tTdGF0dXM7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gc3RhdHVzOworICAgICAgICAgfQorICAgICAgICAgLy9UaGlzIG9wQ29kZSBtZWFucyB0aGUgd2luZG93IHNoaWZ0LiBFbmZvcmNlIHRoZSBjdXJyZW50IEluZGV4CisgICAgICAgICBjdXJyZW50UmVvcmRlckluZm8tPnVjQ0luZGV4ID0gdWNGd2RJZHg7CisKKyAgICAgICAgIHN0YXR1cyA9IFdMQU5UTF9RdWV1ZUN1cnJlbnQoY3VycmVudFJlb3JkZXJJbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NEYXRhQnVmZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWNTbG90SWR4KTsKKyAgICAgICAgICAgaWYoVk9TX1RSVUUgPT0gcENsaWVudFNUQS0+dWNJc1JlcGxheUNoZWNrVmFsaWQpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFdMQU5UTF9GaWxsUmVwbGF5Q291bnRlcihjdXJyZW50UmVvcmRlckluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bGxyZXBsYXlDb3VudGVyLCB1Y1Nsb3RJZHgpOworICAgICAgICAgICB9CisgICAgICAgICBpZihWT1NfU1RBVFVTX0VfUkVTT1VSQ0VTID09IHN0YXR1cykKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19wa3RfcmV0dXJuX3BhY2tldCh2b3NQa3RJZHgpOyAKKyAgICAgICAgICAgIC8qIFRoaXMgaXMgdGhlIGNhc2Ugc2xvdCBpbmRleCBpcyBhbHJlYWR5IGN5Y2xlIG9uZSByb3V0ZSwgcm91dGUgYWxsIHRoZSBmcmFtZXMgUWVkICovCisgICAgICAgICAgICB2b3NQa3RJZHggPSBOVUxMOworICAgICAgICAgICAgc3RhdHVzID0gV0xBTlRMX0NoYWluRnJvbnRQa3RzKHVjRndkSWR4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9PUENPREVfRldEQUxMX1FDVVIsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ2b3NQa3RJZHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudFJlb3JkZXJJbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUTENiKTsKKyAgICAgICAgICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJNYWtlIGZyYW1lIGNoYWluIGZhaWwgJWQiLCBzdGF0dXMpKTsKKyAgICAgICAgICAgICAgIGxvY2tTdGF0dXMgPSB2b3NfbG9ja19yZWxlYXNlKCZjdXJyZW50UmVvcmRlckluZm8tPnJlb3JkZXJMb2NrKTsKKyAgICAgICAgICAgICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MobG9ja1N0YXR1cykpCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiV0xBTlRMX01TRFVSZW9yZGVyLCBSZWxlYXNlIExPQ0sgRmFpbCIpKTsKKyAgICAgICAgICAgICAgICAgIHJldHVybiBsb2NrU3RhdHVzOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHN0YXR1cyA9IHZvc19wa3RfY2hhaW5fcGFja2V0KHZvc1BrdElkeCwgKnZvc0RhdGFCdWZmLCAxKTsKKyAgICAgICAgICAgICp2b3NEYXRhQnVmZiA9IHZvc1BrdElkeDsKKyAgICAgICAgICAgIGN1cnJlbnRSZW9yZGVySW5mby0+cGVuZGluZ0ZyYW1lc0NvdW50ID0gMDsKKyAgICAgICAgIH0KKyAgICAgICAgICp2b3NEYXRhQnVmZiA9IHZvc1BrdElkeDsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIFdMQU5UTF9PUENPREVfRldEQlVGX0RST1BDVVI6CisgICAgICAgICB2b3NQa3RJZHggPSBOVUxMOworICAgICAgICAgc3RhdHVzID0gV0xBTlRMX0NoYWluRnJvbnRQa3RzKHVjRndkSWR4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9PUENPREVfRldEQlVGX0RST1BDVVIsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ2b3NQa3RJZHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudFJlb3JkZXJJbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUTENiKTsKKyAgICAgICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJNYWtlIGNoYWluIHdpdGggYnVmZmVyZWQgZnJhbWUgZmFpbCAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMpKTsKKyAgICAgICAgICAgIGxvY2tTdGF0dXMgPSB2b3NfbG9ja19yZWxlYXNlKCZjdXJyZW50UmVvcmRlckluZm8tPnJlb3JkZXJMb2NrKTsKKyAgICAgICAgICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MobG9ja1N0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiV0xBTlRMX01TRFVSZW9yZGVyLCBSZWxlYXNlIExPQ0sgRmFpbCIpKTsKKyAgICAgICAgICAgICAgIHJldHVybiBsb2NrU3RhdHVzOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgIH0KKworICAgICAgICAgLy9TaW5jZSBCQVIgZnJhbWUgcmVjZWl2ZWQsIHNldCB0aGUgaW5kZXggdG8gdGhlIHJpZ2h0IGxvY2F0aW9uCisgICAgICAgICBjdXJyZW50UmVvcmRlckluZm8tPnVjQ0luZGV4ID0gdWNGd2RJZHg7CisKKyAgICAgICAgIC8qIEN1cnJlbnQgZnJhbWUgaGFzIHRvIGJlIGRyb3BwZWQsIEJBUiBmcmFtZSAqLworICAgICAgICAgc3RhdHVzID0gdm9zX3BrdF9yZXR1cm5fcGFja2V0KCp2b3NEYXRhQnVmZik7CisgICAgICAgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICB7CisgICAgICAgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiRHJvcCBCQVIgZnJhbWUgZmFpbCAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMpKTsKKyAgICAgICAgICAgIGxvY2tTdGF0dXMgPSB2b3NfbG9ja19yZWxlYXNlKCZjdXJyZW50UmVvcmRlckluZm8tPnJlb3JkZXJMb2NrKTsKKyAgICAgICAgICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MobG9ja1N0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiV0xBTlRMX01TRFVSZW9yZGVyLCBSZWxlYXNlIExPQ0sgRmFpbCIpKTsKKyAgICAgICAgICAgICAgIHJldHVybiBsb2NrU3RhdHVzOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgIH0KKyAgICAgICAgICp2b3NEYXRhQnVmZiA9IHZvc1BrdElkeDsKKyAgICAgICAgIGJyZWFrOworIAorICAgICAgY2FzZSBXTEFOVExfT1BDT0RFX0ZXREFMTF9EUk9QQ1VSOgorICAgICAgICAgdm9zUGt0SWR4ID0gTlVMTDsKKyAgICAgICAgIHN0YXR1cyA9IFdMQU5UTF9DaGFpbkZyb250UGt0cyh1Y0Z3ZElkeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfT1BDT0RFX0ZXREFMTF9EUk9QQ1VSLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdm9zUGt0SWR4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRSZW9yZGVySW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVExDYik7CisgICAgICAgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICAgICAgICB7CisgICAgICAgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiTWFrZSBjaGFpbiB3aXRoIGJ1ZmZlcmVkIGZyYW1lIGZhaWwgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzKSk7CisgICAgICAgICAgICBsb2NrU3RhdHVzID0gdm9zX2xvY2tfcmVsZWFzZSgmY3VycmVudFJlb3JkZXJJbmZvLT5yZW9yZGVyTG9jayk7CisgICAgICAgICAgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKGxvY2tTdGF0dXMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIldMQU5UTF9NU0RVUmVvcmRlciwgUmVsZWFzZSBMT0NLIEZhaWwiKSk7CisgICAgICAgICAgICAgICByZXR1cm4gbG9ja1N0YXR1czsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgICAgICB9CisKKyAgICAgICAgIC8vU2luY2UgQkFSIGZyYW1lIHJlY2VpdmVkIGFuZCBiZXlvbmQgY3VyIHdpbmRvdywgc2V0IHRoZSBpbmRleCB0byB0aGUgcmlnaHQgbG9jYXRpb24KKyAgICAgICAgIGN1cnJlbnRSZW9yZGVySW5mby0+dWNDSW5kZXggPSAwOworCisgICAgICAgICBzdGF0dXMgPSB2b3NfcGt0X3JldHVybl9wYWNrZXQoKnZvc0RhdGFCdWZmKTsKKyAgICAgICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJEcm9wIEJBUiBmcmFtZSBmYWlsICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cykpOworICAgICAgICAgICAgbG9ja1N0YXR1cyA9IHZvc19sb2NrX3JlbGVhc2UoJmN1cnJlbnRSZW9yZGVySW5mby0+cmVvcmRlckxvY2spOworICAgICAgICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyhsb2NrU3RhdHVzKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJXTEFOVExfTVNEVVJlb3JkZXIsIFJlbGVhc2UgTE9DSyBGYWlsIikpOworICAgICAgICAgICAgICAgcmV0dXJuIGxvY2tTdGF0dXM7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gc3RhdHVzOworICAgICAgICAgfQorCisgICAgICAgICAqdm9zRGF0YUJ1ZmYgPSB2b3NQa3RJZHg7CisgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBXTEFOVExfT1BDT0RFX0ZXREFMTF9RQ1VSOgorICAgICAgICAgdm9zUGt0SWR4ID0gTlVMTDsKKyAgICAgICAgIHN0YXR1cyA9IFdMQU5UTF9DaGFpbkZyb250UGt0cyhjdXJyZW50UmVvcmRlckluZm8tPndpblNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX09QQ09ERV9GV0RBTExfRFJPUENVUiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnZvc1BrdElkeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50UmVvcmRlckluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRMQ2IpOworICAgICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgICAgeworICAgICAgICAgICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIk1ha2UgY2hhaW4gd2l0aCBidWZmZXJlZCBmcmFtZSBmYWlsICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cykpOworICAgICAgICAgICAgbG9ja1N0YXR1cyA9IHZvc19sb2NrX3JlbGVhc2UoJmN1cnJlbnRSZW9yZGVySW5mby0+cmVvcmRlckxvY2spOworICAgICAgICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyhsb2NrU3RhdHVzKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJXTEFOVExfTVNEVVJlb3JkZXIsIFJlbGVhc2UgTE9DSyBGYWlsIikpOworICAgICAgICAgICAgICAgcmV0dXJuIGxvY2tTdGF0dXM7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gc3RhdHVzOworICAgICAgICAgfQorICAgICAgICAgc3RhdHVzID0gV0xBTlRMX1F1ZXVlQ3VycmVudChjdXJyZW50UmVvcmRlckluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc0RhdGFCdWZmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1Y1Nsb3RJZHgpOworICAgICAgICA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VmZmVyIGNvdW50IGlzIHRvbyBsb3csIFBlbmRpbmcgZnJhbWUgY291bnQgaXMgJWQiLAorICAgICAgICAgICAgICAgICAgY3VycmVudFJlb3JkZXJJbmZvLT5wZW5kaW5nRnJhbWVzQ291bnQpKTsKKyAgICAgIHZvc1BrdElkeCA9IE5VTEw7CisgICAgICBzdGF0dXMgPSBXTEFOVExfQ2hhaW5Gcm9udFBrdHModWNGd2RJZHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX09QQ09ERV9GV0RBTExfRFJPUENVUiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnZvc1BrdElkeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50UmVvcmRlckluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRMQ2IpOworICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgICAgeworICAgICAgICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIk1ha2UgZnJhbWUgY2hhaW4gZmFpbCAlZCIsIHN0YXR1cykpOworICAgICAgICAgbG9ja1N0YXR1cyA9IHZvc19sb2NrX3JlbGVhc2UoJmN1cnJlbnRSZW9yZGVySW5mby0+cmVvcmRlckxvY2spOworICAgICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyhsb2NrU3RhdHVzKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJXTEFOVExfTVNEVVJlb3JkZXIsIFJlbGVhc2UgTE9DSyBGYWlsIikpOworICAgICAgICAgICAgcmV0dXJuIGxvY2tTdGF0dXM7CisgICAgICAgICB9CisgICAgICAgICBy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09IHRpbWVyU3RhdGUpCisgICAgICB7CisgICAgICAgICBUTExPRzQoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0xPVywiVGhlcmUgaXMgYSBuZXcgSE9MRSwgUGVuZGluZyBGcmFtZXMgQ291bnQgJWQiLAorICAgICAgICAgICAgICAgICAgICBjdXJyZW50UmVvcmRlckluZm8tPnBlbmRpbmdGcmFtZXNDb3VudCkpOworICAgICAgICAgYWMgPSBXTEFOVExfVElEXzJfQUNbdWNUaWRdOworICAgICAgICAgaWYgKFdMQU5UTF9BQ19JTlZBTElEKGFjKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgICByZW9yZGVyVGltZSA9IFdMQU5UTF9CQV9SRU9SREVSSU5HX0FHSU5HX1RJTUVSOworICAgICAgICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJJbnZhbGlkIEFDICVkIHVzaW5nIGRlZmF1bHQgcmVvcmRlciB0aW1lICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjLCByZW9yZGVyVGltZSkpOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgIHJlb3JkZXJUaW1lID0gcFRMQ2ItPnRsQ29uZmlnSW5mby51Y1Jlb3JkZXJBZ2luZ1RpbWVbYWNdOworICAgICAgICAgfQorICAgICAgICAgdGltZXJTdGF0dXMgPSB2b3NfdGltZXJfc3RhcnQoJmN1cnJlbnRSZW9yZGVySW5mby0+YWdpbmdUaW1lciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlb3JkZXJUaW1lKTsKKyAgICAgICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1ModGltZXJTdGF0dXMpKQorICAgICAgICAgeworICAgICAgICAgICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIlRpbWVyIHN0YXJ0IGZhaWw6ICVkIiwgdGltZXJTdGF0dXMpKTsKKyAgICAgICAgICAgIGxvY2tTdGF0dXMgPSB2b3NfbG9ja19yZWxlYXNlKCZjdXJyZW50UmVvcmRlckluZm8tPnJlb3JkZXJMb2NrKTsKKyAgICAgICAgICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MobG9ja1N0YXR1cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiV0xBTlRMX01TRFVSZW9yZGVyLCBSZWxlYXNlIExPQ0sgRmFpbCIpKTsKKyAgICAgICAgICAgICAgIHJldHVybiBsb2NrU3RhdHVzOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHRpbWVyU3RhdHVzOworICAgICAgICAgfQorICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgLy8gd2UgZGlkbid0IGZvcndhcmQgYW55IHBhY2tldHMgYW5kIHRoZSB0aW1lciB3YXMgYWxyZWFkeQorICAgICAgICAgLy8gcnVubmluZyBzbyB3ZSdyZSBzdGlsbCBhZ2luZyB0aGUgc2FtZSBob2xlCisgICAgICAgICBUTExPRzQoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0xPVywiU3RpbGwgSE9MRSwgUGVuZGluZyBGcmFtZXMgQ291bnQgJWQiLAorICAgICAgICAgICAgICAgICAgICBjdXJyZW50UmVvcmRlckluZm8tPnBlbmRpbmdGcmFtZXNDb3VudCkpOworICAgICAgfQorICAgfQorCisgICBsb2NrU3RhdHVzID0gdm9zX2xvY2tfcmVsZWFzZSgmY3VycmVudFJlb3JkZXJJbmZvLT5yZW9yZGVyTG9jayk7CisgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKGxvY2tTdGF0dXMpKQorICAgeworICAgICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIldMQU5UTF9NU0RVUmVvcmRlciwgUmVsZWFzZSBMT0NLIEZhaWwiKSk7CisgICAgICByZXR1cm4gbG9ja1N0YXR1czsKKyAgIH0KKyAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9LyogV0xBTlRMX01TRFVSZW9yZGVyICovCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICBVdGlsaXR5IGZ1bmN0aW9ucyAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX1F1ZXVlQ3VycmVudAorCisgIERFU0NSSVBUSU9OIAorICAgIEl0IHdpbGwgcXVldWUgYSBwYWNrZXQgYXQgYSBnaXZlbiBzbG90IGluZGV4IGluIHRoZSBNU0RVIHJlb3JkZXJpbmcgbGlzdC4gCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcHdCYVJlb3JkZXI6ICAgcG9pbnRlciB0byB0aGUgQkEgcmVvcmRlcmluZyBzZXNzaW9uIGluZm8gCisgICAgdm9zRGF0YUJ1ZmY6ICAgZGF0YSBidWZmZXIgdG8gYmUgcXVldWVkCisgICAgdWNTbG90SW5kZXg6ICAgc2xvdCBpbmRleCAKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0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5kIGNoYWluIAorICAgIHRoZW0gdG8gYSB2b3MgcGt0IC4gCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgdWNDb3VudDogICAgICAgbnVtYmVyIG9mIHBhY2tldHMgdG8gZXh0cmFjdAorICAgIHB3QmFSZW9yZGVyOiAgIHBvaW50ZXIgdG8gdGhlIEJBIHJlb3JkZXJpbmcgc2Vzc2lvbiBpbmZvIAorCisgICAgT1VUCisgICAgdm9zRGF0YUJ1ZmY6ICAgZGF0YSBidWZmZXIgY29udGFpbmluZyB0aGUgZXh0cmFjdGVkIGNoYWluIG9mIHBhY2tldHMKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbiAgCisKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICAgICBFdmVyeXRoaW5nIGlzIE9LCisKKyAgICAKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfQ2hhaW5Gcm9udFBrdHMKKyggCisgICB2X1UzMl90ICAgICAgICAgICAgICAgIGZ3ZEluZGV4LAorICAgdl9VOF90ICAgICAgICAgICAgICAgICBvcENvZGUsCisgICB2b3NfcGt0X3QgICAgICAgICAgICAgICoqdm9zRGF0YUJ1ZmYsCisgICBXTEFOVExfQkFSZW9yZGVyVHlwZSAgICpwd0JhUmVvcmRlciwKKyAgIFdMQU5UTF9DYlR5cGUgICAgICAgICAgKnBUTENiCispCit7CisgICBWT1NfU1RBVFVTICAgICAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgaWR4OyAKKyAgIHZfUFZPSURfdCAgICAgICAgICAgY3VycmVudERhdGFQdHIgPSBOVUxMOworICAgaW50ICAgICAgICAgICAgICAgICBuZWdEZXRlY3Q7CisjaWZkZWYgV0xBTlRMX1JFT1JERVJfREVCVUdfTVNHX0VOQUJMRQorI2RlZmluZSBXTEFOVExfT1VUX09GX1dJTkRPV19JRFggICAgNjUKKyAgIHZfVTMyX3QgZnJhbWVJZHhbMl0gPSB7MCwgMH0sIGZmaWR4ID0gZndkSW5kZXgsIGlkeDIgPSBXTEFOVExfT1VUX09GX1dJTkRPV19JRFg7CisgICBpbnQgcGVuZGluZyA9IHB3QmFSZW9yZGVyLT5wZW5kaW5nRnJhbWVzQ291bnQsIHN0YXJ0ID0gV0xBTlRMX09VVF9PRl9XSU5ET1dfSURYLCBlbmQ7CisjZW5kaWYKKworICAgaWYocHdCYVJlb3JkZXItPnVjQ0luZGV4ID49IGZ3ZEluZGV4KQorICAgeworICAgICAgZndkSW5kZXggKz0gcHdCYVJlb3JkZXItPndpblNpemU7CisgICB9CisKKyAgIGlmKChXTEFOVExfT1BDT0RFX0ZXREFMTF9EUk9QQ1VSID09IG9wQ29kZSkgfHwKKyAgICAgIChXTEFOVExfT1BDT0RFX0ZXREFMTF9RQ1VSID09IG9wQ29kZSkpCisgICB7CisgICAgICBmd2RJbmRleCA9IHB3QmFSZW9yZGVyLT51Y0NJbmRleCArIHB3QmFSZW9yZGVyLT53aW5TaXplOworICAgfQorCisgICBUTExPRzQoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0xPVywiQ3VycmVudCBJbmRleCAlZCwgRldEIEluZGV4ICVkLCByZW9yZGVyQnVmZmVyIDB4JXAiLAorICAgICAgICAgICAgICAgcHdCYVJlb3JkZXItPnVjQ0luZGV4ICUgcHdCYVJlb3JkZXItPndpblNpemUsCisgICAgICAgICAgICAgICBmd2RJbmRleCAlIHB3QmFSZW9yZGVyLT53aW5TaXplLAorICAgICAgICAgICAgICAgcHdCYVJlb3JkZXItPnJlb3JkZXJCdWZmZXIpKTsKKworICAgbmVnRGV0ZWN0ID0gcHdCYVJlb3JkZXItPnBlbmRpbmdGcmFtZXNDb3VudDsKKyAgIGZvcihpZHggPSBwd0JhUmVvcmRlci0+dWNDSW5kZXg7IGlkeCA8PSBmd2RJbmRleDsgaWR4KyspCisgICB7CisgICAgICBjdXJyZW50RGF0YVB0ciA9IAorICAgICAgcHdCYVJlb3JkZXItPnJlb3JkZXJCdWZmZXItPmFycmF5QnVmZmVyW2lkeCAlIHB3QmFSZW9yZGVyLT53aW5TaXplXTsKKyAgICAgIGlmKE5VTEwgIT0gY3VycmVudERhdGFQdHIpCisgICAgICB7CisjaWZkZWYgV0xBTlRMX1JFT1JERVJfREVCVUdfTVNHX0VOQUJMRQorICAgICAgICAgaWR4MiA9IChpZHggPj0gIHB3QmFSZW9yZGVyLT53aW5TaXplKSA/IChpZHggLSAgcHdCYVJlb3JkZXItPndpblNpemUpIDogaWR4OworICAgICAgICAgZnJhbWVJZHhbaWR4MiAvIDMyXSB8PSAxIDw8IChpZHgyICUgMzIpOworICAgICAgICAgaWYoc3RhcnQgPT0gV0xBTlRMX09VVF9PRl9XSU5ET1dfSURYKSBzdGFydCA9IGlkeDI7CisjZW5kaWYKKyAgICAgICAgIFRMTE9HNChWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fTE9XLCJUaGVyZSBpcyBidWZmZXJlZCBmcmFtZSAlZCIsCisgICAgICAgICAgICAgICAgICAgICBpZHggJSBwd0JhUmVvcmRlci0+d2luU2l6ZSkpOworICAgICAgICAgaWYoTlVMTCA9PSAqdm9zRGF0YUJ1ZmYpCisgICAgICAgICB7CisgICAgICAgICAgICAqdm9zRGF0YUJ1ZmYgPSAodm9zX3BrdF90ICopY3VycmVudERhdGFQdHI7CisgICAgICAgICAgICBUTExPRzQoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0xPVywiVGhpcyBpcyBuZXcgaGVhZCAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICBpZHggJSBwd0JhUmVvcmRlci0+d2luU2l6ZSkpOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgVExMT0c0KFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19MT1csIlRoZXJlIGlzIGJ1ZmVyZWQgSnVzdCBhZGQgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgaWR4ICUgcHdCYVJlb3JkZXItPndpblNpemUpKTsKKyAgICAgICAgICAgIHZvc19wa3RfY2hhaW5fcGFja2V0KCp2b3NEYXRhQnVmZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b3NfcGt0X3QgKiljdXJyZW50RGF0YVB0ciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUlVFKTsKKyAgICAgICAgIH0KKyAgICAgICAgIHB3QmFSZW9yZGVyLT5yZW9yZGVyQnVmZmVyLT5hcnJheUJ1ZmZlcltpZHggICUgcHdCYVJlb3JkZXItPndpblNpemVdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gTlVMTDsKKyAgICAgICAgIHB3QmFSZW9yZGVyLT5wZW5kaW5nRnJhbWVzQ291bnQtLTsKKyAgICAgICAgIG5lZ0RldGVjdC0tOworICAgICAgICAgaWYobmVnRGV0ZWN0IDwgMCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJUaGlzIGlzIG5vdCBwb3NzaWJsZSwgc29tZSBiYWxhbmNlIGhhcyBwcm9ibGVtIikpOworICAgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICAgICAgICB9CisgICAgICAgICBUTExPRzQoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0xPVywiU2xvdCBJbmRleCAlZCwgc2V0IGFzIE5VTEwsIFBlbmRpbmcgRnJhbWVzICVkIiwKKyAgICAgICAgICAgICAgICAgICAgIGlkeCAgJSBwd0JhUmVvcmRlci0+d2luU2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgIHB3QmFSZW9yZGVyLT5wZW5kaW5nRnJhbWVzQ291bnQKKyAgICAgICAgICAgICAgICAgICAgICkpOworICAgICAgICAgcHdCYVJlb3JkZXItPnVjQ0luZGV4ID0gKGlkeCArIDEpICUgcHdCYVJlb3JkZXItPndpblNpemU7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICBUTExPRzQoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0xPVywiRW1wdHkgQXJyYXkgJWQiLAorICAgICAgICAgICAgICAgICAgICAgaWR4ICUgcHdCYVJlb3JkZXItPndpblNpemUpKTsKKyAgICAgIH0KKyAgICAgIFRMTE9HNChWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk9fTE9XLCJDdXJyZW50IEluZGV4ICVkLCB3aW5TaXplICVkIiwKKyAgICAgICAgICAgICAgICAgIHB3QmFSZW9yZGVyLT51Y0NJbmRleCwKKyAgICAgICAgICAgICAgICAgIHB3QmFSZW9yZGVyLT53aW5TaXplCisgICAgICAgICAgICAgICAgICApKTsKKyAgIH0KKworI2lmZGVmIFdMQU5UTF9SRU9SREVSX0RFQlVHX01TR19FTkFCTEUKKyAgIGVuZCA9IGlkeDI7CisKKyAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJGd2QgMHglMDhYLSUwOFggb3BDb2RlICVkIGZ3ZElkeCAlZCB3aW5kb3dTaXplICVkIHBlbmRpbmcgZnJhbWUgJWQgZncgbm8uICVkIGZyb20gaWR4ICVkIHRvICVkIiwKKyAgICAgICAgICAgICAgICAgICAgIGZyYW1lSWR4WzFdLCBmcmFtZUlkeFswXSwgb3BDb2RlLCBmZmlkeCwgcHdCYVJlb3JkZXItPndpblNpemUsIHBlbmRpbmcsIHBlbmRpbmcgLSBuZWdEZXRlY3QsIHN0YXJ0LCBlbmQpKTsKKyNlbmRpZgorCisgICByZXR1cm4gc3RhdHVzOyAKK30vKldMQU5UTF9DaGFpbkZyb250UGt0cyovCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgCisgIEZVTkNUSU9OICAgIFdMQU5UTF9GaWxsUmVwbGF5Q291bnRlcgorIAorICBERVNDUklQVElPTiAKKyAgICBJdCB3aWxsIGZpbGwgcmVwYWx5IGNvdW50ZXIgYXQgYSBnaXZlbiBzbG90IGluZGV4IGluIHRoZSBNU0RVIHJlb3JkZXJpbmcgbGlzdC4gCisgICAgICAgICAgICAKKyAgREVQRU5ERU5DSUVTIAorICAgICAgICAgICAgICAgICAgICAKKyAgUEFSQU1FVEVSUyAKKworICBJTgorICAgICAgcHdCYVJlb3JkZXIgIDogICBwb2ludGVyIHRvIHRoZSBCQSByZW9yZGVyaW5nIHNlc3Npb24gaW5mbyAKKyAgICAgIHJlcGxheUNvdW50ZXI6ICAgcmVwbGF5IGNvdW50ZXIgdG8gYmUgZmlsbGVkCisgICAgICB1Y1Nsb3RJbmRleCAgOiAgIHNsb3QgaW5kZXggCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICBSRVRVUk4gVkFMVUUKKyAgICAgTk9ORSAKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICBTSURFIEVGRkVDVFMgCisgICAgIE5PTkUKKyAgICAgICAgCisgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIFdMQU5UTF9GaWxsUmVwbGF5Q291bnRlcgorKAorICAgV0xBTlRMX0JBUmVvcmRlclR5cGUqICBwd0JhUmVvcmRlciwKKyAgIHZfVTY0X3QgICAgICAgICAgICAgICAgdWxscmVwbGF5Q291bnRlciwKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgdWNTbG90SW5kZXgKKykKK3sKKworICAgLy9CQU1TR0RFQlVHKCJyZXBsYXkgY291bnRlciB0byBiZSBmaWxsZWQgaW4gUWVkIGZyYW1lcyAlbGx1IiwKKyAgICAgICAgICAgICAgIC8vcmVwbGF5Q291bnRlciwgMCwgMCk7CisKKyAgIHB3QmFSZW9yZGVyLT5yZW9yZGVyQnVmZmVyLT51bGxSZXBsYXlDb3VudGVyW3VjU2xvdEluZGV4XSA9IHVsbHJlcGxheUNvdW50ZXI7CisgICAvL0JBTVNHREVCVUcoIkFzc2lnbmVkLCByZXBsYXkgY291bnRlciBQZW5kaW5nIEZyYW1lcyAlZCBhdCBzbG90ICVkLCByZXBsYXkgY291bnRlclsweCVsbFhdXG4iLAorICAgICAgICAgICAgICAgLy9wd0JhUmVvcmRlci0+cGVuZGluZ0ZyYW1lc0NvdW50LAorICAgICAgICAgICAgICAgLy91Y1Nsb3RJbmRleCwKKyAgICAgICAgICAgICAgIC8vcHdCYVJlb3JkZXItPnJlb3JkZXJCdWZmZXItPnVsbFJlcGxheUNvdW50ZXIpOworICAgcmV0dXJuOworfS8qV0xBTlRMX0ZpbGxSZXBsYXlDb3VudGVyKi8KKwpkaWZmIC0tZ2l0IGEvd2xhbi9wcmltYS9DT1JFL1RML3NyYy93bGFuX3FjdF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TEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsIElORElSRUNULCBPUiBDT05TRVFVRU5USUFMCisgKiBEQU1BR0VTIE9SIEFOWSBEQU1BR0VTIFdIQVRTT0VWRVIgUkVTVUxUSU5HIEZST00gTE9TUyBPRiBVU0UsIERBVEEgT1IKKyAqIFBST0ZJVFMsIFdIRVRIRVIgSU4gQU4gQUNUSU9OIE9GIENPTlRSQUNULCBORUdMSUdFTkNFIE9SIE9USEVSCisgKiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SCisgKiBQRVJGT1JNQU5DRSBPRiBUSElTIFNPRlRXQVJFLgorICovCisKKy8qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgIFcgTCBBIE4gXyBRIEMgVCBfIFQgTCBfIEhPU1VQUE9SVC4gQworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgT1ZFUlZJRVc6CisgIAorICBERVBFTkRFTkNJRVM6IAorCisgIEFyZSBsaXN0ZWQgZm9yIGVhY2ggQVBJIGJlbG93LiAKKyAgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworI2luY2x1ZGUgIndsYW5fcWN0X3RsX2hvc3VwcG9ydC5oIgorI2luY2x1ZGUgIndsYW5fcWN0X3RsaS5oIgorI2luY2x1ZGUgInRsRGVidWcuaCIKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICogUHJlcHJvY2Vzc29yIERlZmluaXRpb25zIGFuZCBDb25zdGFudHMKKyAqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworLy8jZGVmaW5lIFdMQU5UTF9IT19ERUJVR19NU0cKKy8vI2RlZmluZSBXTEFOVExfSE9fVVRFU1QKKworI2RlZmluZSBXTEFOVExfSE9fREVGQVVMVF9SU1NJICAgICAgMHhGRgorI2RlZmluZSBXTEFOVExfSE9fSU5WQUxJRF9SU1NJICAgICAgLTEwMAorLyogUlNTSSBzYW1wbGluZyBwZXJpb2QsIHVzZWMgYmFzZWQKKyAqIFRvIHJlZHVjZSBwZXJmb3JtYW5jZSBvdmVyaGVhZAorICogQ3VycmVudCBkZWZhdWx0IDUwMG1zZWMgKi8KKyNkZWZpbmUgV0xBTlRMX0hPX1NBTVBMSU5HX1BFUklPRCAgIDUwMDAwMAorCisKKworLyogR2V0IGFuZCByZWxlYXNlIGxvY2sgKi8KKyNkZWZpbmUgVEhTR0VUTE9DSyhhLCBiKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICBkbyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NfbG9ja19hY3F1aXJlKGIpKSkgICAgXAorICAgICAgICAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCIlcyBHZXQgTG9jayBGYWlsIiwgYSkpOyAgICAgIFwKKyAgICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOyAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgIH13aGlsZSgwKQorCisjZGVmaW5lIFRIU1JFTEVBU0VMT0NLKGEsIGIpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgZG8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgIGlmKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zX2xvY2tfcmVsZWFzZShiKSkpICAgIFwKKyAgICAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiJXMgUmVsZWFzZSBMb2NrIEZhaWwiLCBhKSk7ICBcCisgICAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICB9d2hpbGUoMCkKKworY29uc3Qgdl9VOF90ICBXTEFOVExfSE9fVElEXzJfQUNbV0xBTl9NQVhfVElEXSA9IHtXTEFOVExfQUNfQkUsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfQUNfQkssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9BQ19CSywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9BQ19CRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX0FDX1ZJLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0xBTlRMX0FDX1ZJLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXTEFOVExfQUNfVk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdMQU5UTF9BQ19WT307CisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAqICBUeXBlIERlY2xhcmF0aW9ucworICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisvKiBUZW1wb3JhcnkgdGhyZXNob2xkIHN0b3JlIHBsYWNlIGZvciBCTVBTICovCit0eXBlZGVmIHN0cnVjdAoreworICAgdl9TN190ICByc3NpOworICAgdl9VOF90ICBldmVudDsKK30gV0xBTlRMX0hTVGVtcFBTSW5kVHlwZTsKKworI2lmZGVmIFJTU0lfSEFDSworLyogVGhpcyBpcyBhIGR1bW15IGF2ZXJhZ2VkIFJTU0kgdmFsdWUgdGhhdCBjYW4gYmUgY29udHJvbGxlZCB1c2luZyBkdW1wIGNvbW1hbmRzIAorICogdG8gdHJpZ2dlciBUTCB0byBpc3N1ZSBoYW5kb2ZmIHJlbGF0ZWQgZXZlbnRzLiBXZSB3aWxsIGJlIHVzaW5nIGR1bXAgMzYyIDxhdmVyYWdlIFJTU0k+IAorICogdmFsdWUgdG8gY2hhbmdlIGl0cyB2YWx1ZSAqLworaW50ICBkdW1wQ21kUlNTSSA9IC00ODsKKyNlbmRpZgorCisjaWZkZWYgV0xBTlRMX0hPX1VURVNUCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OCisKKyAgIERFU0NSSVBUSU9OIAorICAgIAorICAgUEFSQU1FVEVSUyAKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworc3RhdGljIHZfUzdfdCAgIHJzc2k7CitzdGF0aWMgdl9TN190ICAgZGlyZWN0aW9uOwordm9pZCBUTEhTX1V0ZXN0SGFuZGxlTmV3UlNTSSh2X1M3X3QgKm5ld1JTU0ksIHZfUFZPSURfdCBwQWRhcHRlcikKK3sKKyAgIGlmKDAgPT0gcnNzaSkKKyAgIHsKKyAgICAgIGRpcmVjdGlvbiA9IC0xOworICAgfQorICAgZWxzZSBpZigtOTAgPT0gcnNzaSkKKyAgIHsKKyAgICAgIGRpcmVjdGlvbiA9IDE7CisgICB9CisKKyAgICpuZXdSU1NJID0gcnNzaTsKKyAgIHJzc2kgKz0gZGlyZWN0aW9uOworCisgICByZXR1cm47Cit9CisjZW5kaWYgLyogV0xBTlRMX0hPX1VURVNUICovCisKKyNpZmRlZiBXTEFOVExfSE9fREVCVUdfTVNHCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OCisKKyAgIERFU0NSSVBUSU9OIAorICAgIAorICAgUEFSQU1FVEVSUyAKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBXTEFOVExfU3RhdERlYnVnRGlzcGxheQorKAorICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICBTVEFpZCwKKyAgIFdMQU5UTF9UUkFOU0ZFUl9TVEFfVFlQRSAqc3RhdGlzdGljcworKQoreworICAgVExMT0cxKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSIpKTsKKyAgIFRMTE9HMShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sIlN0YXRpc3RpY3MgZm9yIFNUQSAlZCIsIFNUQWlkKSk7CisgICBUTExPRzEoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCJSWCBVQyBGY250ICU1ZCwgTUMgRmNudCAlNWQsIEJDIEZjbnQgJTVkIiwKKyAgICAgICAgICAgICAgICBzdGF0aXN0aWNzLT5yeFVDRmNudCwgc3RhdGlzdGljcy0+cnhNQ0ZjbnQsIHN0YXRpc3RpY3MtPnJ4QkNGY250KSk7CisgICBUTExPRzEoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCJSWCBVQyBCY250ICU1ZCwgTUMgQmNudCAlNWQsIEJDIE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RVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgImZsdXNoZWQgcmF0ZUlkeCBjb3VudGVycyIpKTsKKworICAgICAgICBmb3IoaWkgPSAwOyBpaSA8IE1BWF9SQVRFX0lOREVYOyBpaSsrKQorICAgICAgICAgICAgdGxDdHh0LT5hdGxTVEFDbGllbnRzW3N0YUlkXS0+dHJhZmZpY1N0YXRpc3RpY3MucGt0Q291bnRlclJhdGVJZHhbaWldID0gMDsKKworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgVExMT0cxKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJwa3RzIHBlciByYXRlIEluZGV4IikpOworCisgICAgZm9yKGlpID0gMDsgaWkgPCBNQVhfUkFURV9JTkRFWDsgaWkrKykKKyAgICB7CisgICAgICAgIC8qIHByaW50aW5nIGludCB0aGUgYmVsb3cgZm9ybWF0CisgICAgICAgICAqICIgcmF0ZUluZGV4ID0gcGt0Q291bnQgIiovCisgICAgICAgIFRMTE9HMShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICIlZCA9ICVkIiwgaWkrMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0bEN0eHQtPmF0bFNUQUNsaWVudHNbc3RhSWRdLT50cmFmZmljU3RhdGlzdGljcy5wa3RDb3VudGVyUmF0ZUlkeFtpaV0pKTsKKyAgICB9CisKKyAgICByZXR1cm47Cit9CisKK3ZvaWQgV0xBTlRMUHJpbnRQa3RzUmN2ZFBlclJzc2kodl9QVk9JRF90IHBBZGFwdGVyLCB2X1U4X3Qgc3RhSWQsIHZfQk9PTF90IGZsdXNoKQoreworICAgIHZfVTE2X3QgaWksamo7CisgICAgdl9VMzJfdCBjb3VudCA9IDA7CisgICAgV0xBTlRMX0NiVHlwZSAgKnRsQ3R4dCA9IFZPU19HRVR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XJSc3NpW2lpXSA9IDA7CisKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIFRMTE9HMShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAicGt0cyBwZXIgUlNTSSIpKTsKKworICAgIGZvcihpaSA9IDA7IGlpIDwgTUFYX05VTV9SU1NJOyBpaSArPSBNQVhfUlNTSV9JTlRFUlZBTCkKKyAgICB7CisgICAgICAgIGNvdW50ID0gMDsKKworICAgICAgICBmb3IoamogPSBpaTsgamogPCAoaWkgKyBNQVhfUlNTSV9JTlRFUlZBTCk7IGpqKyspCisgICAgICAgICAgICBjb3VudCArPSB0bEN0eHQtPmF0bFNUQUNsaWVudHNbc3RhSWRdLT50cmFmZmljU3RhdGlzdGljcy5wa3RDb3VudGVyUnNzaVtqal07CisKKyAgICAgICAgLyogcHJpbnRzIGFyZSBpbiB0aGUgYmVsb3cgZm9ybWF0CisgICAgICAgICAqICIgZnJvbVJTU0kgLSB0b1JTU0kgPSBwa3RDb3VudCAiICovCisgICAgICAgIFRMTE9HMShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICIgJWQgLSAlZCA9ICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBpaSwgaWkrKE1BWF9SU1NJX0lOVEVSVkFMIC0gMSksIGNvdW50KSk7CisgICAgfQorICAgIHJldHVybjsKK30KKyNlbmRpZgorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OCisKKyAgIERFU0NSSVBUSU9OIAorICAgIAorICAgUEFSQU1FVEVSUyAKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBXTEFOVExfSFNEZWJ1Z0Rpc3BsYXkKKygKKyAgIHZfUFZPSURfdCBwQWRhcHRlcgorKQoreworICAgV0xBTlRMX0NiVHlwZSAgICAgICAgICAgICAgICAgICp0bEN0eHQgPSBWT1NfR0VUX1RMX0NCKHBBZGFwdGVyKTsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICAgICAgaWR4LCBzSWR4OworICAgdl9CT09MX3QgICAgICAgICAgICAgICAgICAgICAgICByZWdpb25Gb3VuZCA9IFZPU19GQUxTRTsKKyAgIFdMQU5UTF9DVVJSRU5UX0hPX1NUQVRFX1RZUEUgICAqY3VycmVudEhPOworICAgV0xBTlRMX0hPX1NVUFBPUlRfVFlQRSAgICAgICAgICpob1N1cHBvcnQ7CisKKyAgIGlmIChOVUxMID09IHRsQ3R4dCkKKyAgIHsKKyAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgVEwgQ29udGV4dCIsCisgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fKSk7CisgICAgICByZXR1cm47CisgICB9CisKKyAgIGN1cnJlbnRITyA9ICYodGxDdHh0LT5ob1N1cHBvcnQuY3VycmVudEhPU3RhdGUpOworICAgaG9TdXBwb3J0ID0gJih0bEN0eHQtPmhvU3VwcG9ydCk7CisKKworICAgZm9yKGlkeCA9IDA7IGlkeCA8IGN1cnJlbnRITy0+bnVtVGhyZXNob2xkOyBpZHgrKykKKyAgIHsKKyAgICAgIGlmKGlkeCA9PSBjdXJyZW50SE8tPnJlZ2lvbk51bWJlcikKKyAgICAgIHsKKyAgICAgICAgIHJlZ2lvbkZvdW5kID0gVk9TX1RSVUU7CisgICAgICAgICBpZihWT1NfVFJVRSA9PSB0bEN0eHQtPmlzQk1QUykKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFRMTE9HMShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sIiAtLS0tPiBDUmVnaW9uICVkLCBoUlNTSTpOQSwgQk1QUywgQWxwaGEgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRITy0+cmVnaW9uTnVtYmVyLCBjdXJyZW50SE8tPmFscGhhKSk7CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICBUTExPRzEoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCIgLS0tLT4gQ1JlZ2lvbiAlZCwgaFJTU0kgJWQsIEFscGhhICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50SE8tPnJlZ2lvbk51bWJlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50SE8tPmhpc3RvcnlSU1NJLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRITy0+YWxwaGEpKTsKKyAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIGZvcihzSWR4ID0gMDsgc0lkeCA8IFdMQU5UTF9IU19OVU1fQ0xJRU5UOyBzSWR4KyspCisgICAgICB7CisgICAgICAgICBpZihOVUxMICE9IGhvU3VwcG9ydC0+cmVnaXN0ZXJlZEluZFtpZHhdLmNyb3NzQ0JGdW5jdGlvbltzSWR4XSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGlmKFZPU19NT0RVTEVfSURfSEREID09IGhvU3VwcG9ydC0+cmVnaXN0ZXJlZEluZFtpZHhdLndob0lzQ2xpZW50W3NJZHhdKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgVExMT0cxKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywiQ2xpZW50IEhERCBwQ0IgJXAsIHRyaWdnZXJFdnQgJWQsIFJTU0kgJWQiLAorICAgICAgICAgICAgICAgICAgIGhvU3VwcG9ydC0+cmVnaXN0ZXJlZEluZFtpZHhdLmNyb3NzQ0JGdW5jdGlvbltzSWR4XSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaG9TdXBwb3J0LT5yZWdpc3RlcmVkSW5kW2lkeF0udHJpZ2dlckV2ZW50W3NJZHhdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBob1N1cHBvcnQtPnJlZ2lzdGVyZWRJbmRbaWR4XS5yc3NpVmFsdWUpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFRMTE9HMShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sIkNsaWVudCBTTUUgcENCICVwLCB0cmlnZ2VyRXZ0ICVkLCBSU1NJICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaG9TdXBwb3J0LT5yZWdpc3RlcmVkSW5kW2lkeF0uY3Jvc3NDQkZ1bmN0aW9uW3NJZHhdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBob1N1cHBvcnQtPnJlZ2lzdGVyZWRJbmRbaWR4XS50cmlnZ2VyRXZlbnRbc0lkeF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhvU3VwcG9ydC0+cmVnaXN0ZXJlZEluZFtpZHhdLnJzc2lWYWx1ZSkpOworICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICAgfQorICAgfQorCisgICBpZihWT1NfRkFMU0UgPT0gcmVnaW9uRm91bmQpCisgICB7CisgICAgICBpZihWT1NfVFJVRSA9PSB0bEN0eHQtPmlzQk1QUykKKyAgICAgIHsKKyAgICAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sIiAtLS0tPiBDUmVnaW9uICVkLCBoUlNTSTpOQSwgQk1QUywgQWxwaGEgJWQiLAorICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRITy0+cmVnaW9uTnVtYmVyLCBjdXJyZW50SE8tPmFscGhhKSk7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCIgLS0tLT4gQ1JlZ2lvbiAlZCwgaFJTU0kgJWQsIEFscGhhICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50SE8tPnJlZ2lvbk51bWJlciwKKyAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50SE8tPmhpc3RvcnlSU1NJLAorICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRITy0+YWxwaGEpKTsKKyAgICAgIH0KKyAgIH0KKworICAgcmV0dXJuOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OCisKKyAgIERFU0NSSVBUSU9OIAorICAgIAorICAgUEFSQU1FVEVSUyAKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfU2V0RldSU1NJVGhyZXNob2xkcworKAorICAgdl9QVk9JRF90ICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlcgorKQoreworICAgV0xBTlRMX0NiVHlwZSAgICAgICAgICAgICAgICAgICp0bEN0eHQgPSBWT1NfR0VUX1RMX0NCKHBBZGFwdGVyKTsKKyAgIFZPU19TVEFUVVMgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVN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mb3IoYm1wc0xvb3AgPSAwOyBibXBzTG9vcCA8IFdMQU5UTF9NQVhfQVZBSUxfVEhSRVNIT0xEOyBibXBzTG9vcCsrKQorICAgeworICAgICAgZm9yKGNsaWVudExvb3AgPSAwOyBjbGllbnRMb29wIDwgV0xBTlRMX0hTX05VTV9DTElFTlQ7IGNsaWVudExvb3ArKykKKyAgICAgIHsKKyAgICAgICAgIGlmKDAgIT0gaG9TdXBwb3J0LT5yZWdpc3RlcmVkSW5kW2JtcHNMb29wXS50cmlnZ2VyRXZlbnRbY2xpZW50TG9vcF0pCisgICAgICAgICB7CisgICAgICAgICAgICBpZihibXBzSW5kID09IFdMQU5UTF9TSU5HTEVfQ0xOVF9USFJFU0hPTEQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiU2luZ2xlIENsaWVudCBUaHJlc2hvbGQgc2hvdWxkIGJlIGxlc3MgdGhhbiAlZCIsIFdMQU5UTF9TSU5HTEVfQ0xOVF9USFJFU0hPTEQpKTsKKyAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdGVtcEluZFNldFtibXBzSW5kXS5yc3NpICA9IGhvU3VwcG9ydC0+cmVnaXN0ZXJlZEluZFtibXBzTG9vcF0ucnNzaVZhbHVlOworICAgICAgICAgICAgdGVtcEluZFNldFtibXBzSW5kXS5ldmVudCA9IGhvU3VwcG9ydC0+cmVnaXN0ZXJlZEluZFtibXBzTG9vcF0udHJpZ2dlckV2ZW50W2NsaWVudExvb3BdOworICAgICAgICAgICAgYm1wc0luZCsrOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisgICAgICB9CisgICB9CisKKyAgIGJtcHNUaHJlc2hvbGRzLnVjUnNzaVRocmVzaG9sZDEgPSB0ZW1wSW5kU2V0WzBdLnJzc2k7CisgICBpZigoV0xBTlRMX0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dMQU5UTF9IT19USFJFU0hPTERfRE9XTiA9PSB0ZW1wSW5kU2V0WzJdLmV2ZW50KSB8fAorICAgICAgKFdMQU5UTF9IT19USFJFU0hPTERfQ1JPU1MgPT0gdGVtcEluZFNldFsyXS5ldmVudCkpCisgICB7CisgICAgICBibXBzVGhyZXNob2xkcy5iUnNzaVRocmVzM05lZ05vdGlmeSA9IDE7CisgICB9CisgICBpZigoV0xBTlRMX0hPX1RIUkVTSE9MRF9VUCA9PSB0ZW1wSW5kU2V0WzJdLmV2ZW50KSB8fAorICAgICAgKFdMQU5UTF9IT19USFJFU0hPTERfQ1JPU1MgPT0gdGVtcEluZFNldFsyXS5ldmVudCkpCisgICB7CisgICAgICBibXBzVGhyZXNob2xkcy5iUnNzaVRocmVzM1Bvc05vdGlmeSA9IDE7CisgICB9CisKKyAgIFdEQV9TZXRSU1NJVGhyZXNob2xkcyhob1N1cHBvcnQtPm1hY0N0eHQsICZibXBzVGhyZXNob2xkcyk7CisgICByZXR1cm4gc3RhdHVzOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OCisKKyAgIERFU0NSSVBUSU9OIAorICAgIAorICAgUEFSQU1FVEVSUyAKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfU3RhdEhhbmRsZVJYRnJhbWUKKygKKyAgIHZfUFZPSURfdCAgICAgICAgcEFkYXB0ZXIsCisgICB2X1BWT0lEX3QgICAgICAgIHBCREhlYWRlciwKKyAgIHZfVThfdCAgICAgICAgICAgU1RBaWQsCisgICB2X0JPT0xfdCAgICAgICAgIGlzQnJvYWRjYXN0LAorICAgdm9zX3BrdF90ICAgICAgICpkYXRhQnVmZmVyICAgCispC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VEFpZCwgc3RhdGlzdGljcyk7CisjZW5kaWYgLyogV0xBTlRMX0hPX0RFQlVHX01TRyAqLworCisgICByZXR1cm4gc3RhdHVzOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OCisKKyAgIERFU0NSSVBUSU9OIAorICAgIAorICAgUEFSQU1FVEVSUyAKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfU3RhdEhhbmRsZVRYRnJhbWUKKygKKyAgIHZfUFZPSURfdCAgICAgICAgcEFkYXB0ZXIsCisgICB2X1U4X3QgICAgICAgICAgIFNUQWlkLAorICAgdm9zX3BrdF90ICAgICAgICpkYXRhQnVmZmVyLAorICAgdl9QVk9JRF90ICAgICAgICBwQkRIZWFkZXIsCisgICBXTEFOVExfTWV0YUluZm9UeXBlICp0eE1ldGFJbmZvCispCit7CisgICBXTEFOVExfQ2JUeXBlICAgICAgICAgICAgKnRsQ3R4dCA9IFZPU19HRVRfVExfQ0IocEFkYXB0ZXIpOworICAgVk9TX1NUQVRVUyAgICAgICAgICAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICBXTEFOVExfVFJBTlNGRVJfU1RBX1RZUEUgKnN0YXRpc3RpY3M7CisgICB2X1UxNl90ICAgICAgICAgICAgICAgICAgIHBhY2tldFNpemU7CisKKyAgIGlmKChOVUxMID09IHRsQ3R4dCkgfHwgKE5VTEwgPT0gZGF0YUJ1ZmZlcikpCisgICB7CisgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiSW52YWxpZCBUTCBoYW5kbGUiKSk7CisgICA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F0aXN0aWNzLT50eEJDQmNudCArPSBwYWNrZXRTaXplOworICAgfQorICAgZWxzZSBpZih0eE1ldGFJbmZvLT51Y01jYXN0KQorICAgeworICAgICAgVExMT0cxKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywiVGhpcyBUWCBpcyBNQyBmcmFtZSIpKTsKKyAgICAgIHN0YXRpc3RpY3MtPnR4TUNGY250Kys7CisgICAgICBzdGF0aXN0aWNzLT50eE1DQmNudCArPSBwYWNrZXRTaXplOworICAgfQorICAgZWxzZQorICAgeworICAgICAgVExMT0cxKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywiVGhpcyBpcyBUWCBVQyBmcmFtZSIpKTsKKyAgICAgIHN0YXRpc3RpY3MtPnR4VUNGY250Kys7CisgICAgICBzdGF0aXN0aWNzLT50eFVDQmNudCArPSBwYWNrZXRTaXplOworICAgfQorCisjaWZkZWYgV0xBTlRMX0hPX0RFQlVHX01TRworICAgV0xBTlRMX1N0YXREZWJ1Z0Rpc3BsYXkoU1RBaWQsIHN0YXRpc3RpY3MpOworI2VuZGlmIC8qIFdMQU5UTF9IT19ERUJVR19NU0cgKi8KKworICAgcmV0dXJuIHN0YXR1czsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICBGVU5DVElPTiAgV0xBTlRMX0hTVHJhZmZpY1N0YXR1c1RpbWVyRXhwaXJlZAorCisgICBERVNDUklQVElPTiAgSWYgdHJhZmZpYyBzdGF0dXMgbW9uaXRvcmluZyB0aW1lciBpcyBleHBpZXJlZCwKKyAgICAgICAgICAgICAgICBDb3VudCBob3cgbWF5IGZyYW1lcyBoYXZlIHNlbnQgYW5kIHJlY2VpdmVkIGR1cmluZyAKKyAgICAgICAgICAgICAgICBtZWFzdXJlIHBlcmlvZCBhbmQgaWYgdHJhZmZpYyBzdGF0dXMgaXMgY2hhbmdlZAorICAgICAgICAgICAgICAgIHNlbmQgbm90aWZpY2F0aW9uIHRvIENsaWVudChTTUUpCisgICAgCisgICBQQVJBTUVURVJTIHBBZGFwdGVyCisgICAgICAgICAgICAgIEdsb2JhbCBoYW5kbGUKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordl9WT0lEX3QgV0xBTlRMX0hTVHJhZmZpY1N0YXR1c1RpbWVyRXhwaXJlZAorKAorICAgdl9QVk9JRF90IHBBZGFwdGVyCispCit7CisgICBXTEFOVExfQ2JUeXBlICAgICAgICAgICAgICAgICAgICAgICAgKnRsQ3R4dCA9IFZPU19HRVRfVExfQ0IocEFkYXB0ZXIpOworICAgV0xBTlRMX0hPX1RSQUZGSUNfU1RBVFVTX0hBTkRMRV9UWVBFICp0cmFmZmljSGFuZGxlID0gTlVMTDsKKyAgIFdMQU5UTF9IT19UUkFGRklDX1NUQVRVU19UWVBFICAgICAgICAgbmV3VHJhZmZpYzsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnRGcmFtZUNvdW50OworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBucnRGcmFtZUNvdW50OworICAgdl9CT09MX3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFmZmljU3RhdHVzQ2hhbmdlZCA9IFZPU19GQUxTRTsKKworICAgaWYoTlVMTCA9PSB0bEN0eHQpCisgICB7CisgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiSW52YWxpZCBUTCBoYW5kbGUiKSk7CisgICAgICByZXR1cm47CisgICB9CisKKyAgIC8qIEdldCBydCBhbmQgbnJ0IGZyYW1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VMTCAhPSB0cmFmZmljSGFuZGxlLT50cmFmZmljQ0IpCisgICB7CisgICAgICAvKiByZXN0YXJ0IHRpbWVyICBvbmx5IHdoZW4gdGhlIGNhbGxiYWNrIGlzIG5vdCBOVUxMICovCisgICAgICB2b3NfdGltZXJfc3RhcnQoJnRyYWZmaWNIYW5kbGUtPnRyYWZmaWNUaW1lciwgdHJhZmZpY0hhbmRsZS0+bWVhc3VyZVBlcmlvZCk7CisgICB9CisgICAKKyAgIHJldHVybjsKK30KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OCisKKyAgIERFU0NSSVBUSU9OIAorICAgIAorICAgUEFSQU1FVEVSUyAKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfSFNHZXRSU1NJCisoCisgICB2X1BWT0lEX3QgICAgICAgIHBBZGFwdGVyLAorICAgdl9QVk9JRF90ICAgICAgICBwQkRIZWFkZXIsCisgICB2X1U4X3QgICAgICAgICAgIFNUQWlkLAorICAgdl9TN190ICAgICAgICAgICpjdXJyZW50QXZnUlNTSQorKQoreworICAgV0xBTlRMX0NiVHlwZSAgICp0bEN0eHQgPSBWT1NfR0VUX1RMX0NCKHBBZGFwdGVyKTsKKyAgIFZPU19TVEFUVVMgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgdl9TN190ICAgICAgICAgICBjdXJyZW50UlNTSSwgY3VycmVudFJTU0kwLCBjdXJyZW50UlNTSTE7CisgICBXTEFOVExfQ1VSUkVOVF9IT19TVEFURV9UWVBFICpjdXJyZW50SE8gPSBOVUxMOworCisKKyAgIGlmKE5VTEwgPT0gdGxDdHh0KQorICAgeworICAgICAgVExMT0dFK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F0dXM7Cit9CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfTElOS19MQVlFUl9TVEFUUworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OIFdMQU5UTF9IU0dldERhdGFSU1NJCisKKyAgIERFU0NSSVBUSU9OCisKKyAgIFBBUkFNRVRFUlMKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfSFNHZXREYXRhUlNTSQorKAorICAgdl9QVk9JRF90ICAgICAgICBwQWRhcHRlciwKKyAgIHZfUFZPSURfdCAgICAgICAgcEJESGVhZGVyLAorICAgdl9VOF90ICAgICAgICAgICBTVEFpZCwKKyAgIHZfUzdfdCAgICAgICAgICAqY3VycmVudEF2Z1JTU0kKKykKK3sKKyAgIFdMQU5UTF9DYlR5cGUgICAqdGxDdHh0ID0gVk9TX0dFVF9UTF9DQihwQWRhcHRlcik7CisgICBWT1NfU1RBVFVTICAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgIHZfUzdfdCAgICAgICAgICAgY3VycmVudFJTU0ksIGN1cnJlbnRSU1NJMCwgY3VycmVudFJTU0kxOworICAgV0xBTlRMX0NVUlJFTlRfSE9fU1RBVEVfVFlQRSAqY3VycmVudEhPID0gTlVMTDsKKworCisgICBpZihOVUxMID09IHRsQ3R4dCkKKyAgIHsKKyAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIkludmFsaWQgVEwgaGFuZGxlIikpOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgIH0K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MSFNfVXRlc3RIYW5kbGVOZXdSU1NJKCZjdXJyZW50UlNTSSwgcEFkYXB0ZXIpOworI2VuZGlmIC8qIFdMQU5UTF9IT19VVEVTVCAqLworCisgICBpZigwID09IHRsQ3R4dC0+YXRsU1RBQ2xpZW50c1tTVEFpZF0tPnJzc2lEYXRhQXZnKQorICAgeworICAgICAgKmN1cnJlbnRBdmdSU1NJID0gY3VycmVudFJTU0k7CisgICB9CisgICBlbHNlCisgICB7CisgICAgICAqY3VycmVudEF2Z1JTU0kgPSAoKHRsQ3R4dC0+YXRsU1RBQ2xpZW50c1tTVEFpZF0tPnJzc2lEYXRhQXZnICAqCisgICAgICAgICAgICAgICAgICAgICAgICAgIHRsQ3R4dC0+YXRsU1RBQ2xpZW50c1tTVEFpZF0tPnJzc2lEYXRhQWxwaGEpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAoY3VycmVudFJTU0kgKgorICAgICAgICAgICAgICAgICAgICAgKDEwIC0gdGxDdHh0LT5hdGxTVEFDbGllbnRzW1NUQWlkXS0+cnNzaURhdGFBbHBoYSkpKSAvIDEwOworICAgfQorCisKKyAgIHRsQ3R4dC0+YXRsU1RBQ2xpZW50c1tTVEFpZF0tPnJzc2lEYXRhQXZnID0gKmN1cnJlbnRBdmdSU1NJOworCisgICBUTExPRzEoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICJDdXJyZW50IG5ldyBEYXRhIFJTU0kgaXMgJWQsIGF2ZXJhZ2VkIERhdGEgUlNTSSBpcyAlZCIsCisgICAgICAgICAgY3VycmVudFJTU0ksICpjdXJyZW50QXZnUlNTSSkpOworICAgcmV0dXJuIHN0YXR1czsKK30KKyNlbmRpZgorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OCisKKyAgIERFU0NSSVBUSU9OCisKKyAgIFBBUkFNRVRFUlMKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfSFNCTVBTUlNTSVJlZ2lvbkNoYW5nZWROb3RpZmljYXRpb24KKygKKyAgIHZfUFZPSURfdCAgICAgICAgICAgICBwQWRhcHRlciwKKyAgIHRwU2lyUlNTSU5vdGlmaWNhdGlvbiBwUlNTSU5vdGlmaWNhdGlvbgorKQoreworICAgV0xBTlRMX0NiVHlwZSAgICAgICAgICAgICAgICAgICp0bEN0eHQgPSBWT1NfR0VUX1RMX0NCKHBBZGFwdGVyKTsKKyAgIFZPU19TVEFUVVMgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgV0xBTlRMX0NVUlJFTlRfSE9fU1RBVEVfVFlQRSAgICpjdXJyZW50SE87CisgICBXTEFOVExfSE9fU1VQUE9SVF9UWVBFICAgICAgICAgKmhvU3VwcG9ydDsKKyAgIFdMQU5UTF9SU1NJQ3Jvc3NUaHJlc2hvbGRDQlR5cGUgY2JGdW5jdGlvbiA9IE5VTEw7CisgICB2X1BWT0lEX3QgICAgICAgICAgICAgICAgICAgICAgIHVzckN0eHQgPSBOVUxMOworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgICAgICBldnRUeXBlID0gV0xBTlRMX0hPX1RIUkVTSE9MRF9OQTsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICAgICAgcHJlRldOb3RpZmljYXRpb24gPSAwOworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgICAgICBjdXJGV05vdGlmaWNhdGlvbiA9IDA7CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld1JlZ2lvbk51bWJlciA9IDA7CisgICB2X1U4X3QgICAgICAgICAgICAgICA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gICAgICB7CisgICAgICAgICAgICAgICAgICBjYkZ1bmN0aW9uID0gaG9TdXBwb3J0LT5yZWdpc3RlcmVkSW5kW2lkeF0uY3Jvc3NDQkZ1bmN0aW9uW3NJZHhdOworICAgICAgICAgICAgICAgICAgdXNyQ3R4dCA9IGhvU3VwcG9ydC0+cmVnaXN0ZXJlZEluZFtpZHhdLnVzckN0eHRbc0lkeF07CisKKyAgICAgICAgICAgICAgICAgIGV2dFR5cGUgPSBXTEFOVExfSE9fVEhSRVNIT0xEX0RPV047CisgICAgICAgICAgICAgICAgICBUTExPRzEoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCJUcmlnZ2VyIEV2ZW50ICVkLCByZWdpb24gaW5kZXggJWQiLCBob1N1cHBvcnQtPnJlZ2lzdGVyZWRJbmRbaWR4XS50cmlnZ2VyRXZlbnRbc0lkeF0sIGlkeCkpOworICAgICAgICAgICAgICAgICAgY3VycmVudEhPLT5yZWdpb25OdW1iZXIgPSBuZXdSZWdpb25OdW1iZXI7CisgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBjYkZ1bmN0aW9uKHBBZGFwdGVyLCBldnRUeXBlLCB1c3JDdHh0LCBwUlNTSU5vdGlmaWNhdGlvbi0+YXZnUnNzaSk7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICB9CisgICB9CisgICBlbHNlCisgICB7CisgICAgICBUTExPRzEoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCJSZWdpb24gRGVjcmVhc2UgQmV0dGVyIFJTU0kiKSk7CisgICAgICBpZHggPSAoY3VycmVudEhPLT5yZWdpb25OdW1iZXIpPyhjdXJyZW50SE8tPnJlZ2lvbk51bWJlci0xKTowOworICAgICAgd2hpbGUgKGlkeCA+PSBuZXdSZWdpb25OdW1iZXIpCisgICAgICB7CisgICAgICAgICBmb3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jYkZ1bmN0aW9uKHBBZGFwdGVyLCBldnRUeXBlLCB1c3JDdHh0LCBwUlNTSU5vdGlmaWNhdGlvbi0+YXZnUnNzaSk7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgICBpZiAoIWlkeC0tKQorICAgICAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgfQorCisgICBUTExPRzEoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCJCTVBTIFN0YXRlLCBNU0cgZnJvbSBGVywgVHJpZ2dlciBFdmVudCAlZCwgcmVnaW9uIGluZGV4ICVkIiwKKyAgICAgICAgICAgICAgICAgZXZ0VHlwZSwgY3VycmVudEhPLT5yZWdpb25OdW1iZXIpKTsKKworICAgVEhTUkVMRUFTRUxPQ0soIldMQU5UTF9IU0JNUFNSU1NJUmVnaW9uQ2hhbmdlZE5vdGlmaWNhdGlvbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdGxDdHh0LT5ob1N1cHBvcnQuaG9zTG9jayk7CisgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OCisKKyAgIERFU0NSSVBUSU9OIAorICAgIAorICAgUEFSQU1FVEVSUyAKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfSFNIYW5kbGVSU1NJQ2hhbmdlCisoCisgICB2X1BWT0lEX3QgICBwQWRhcHRlciwKKyAgIHZfUzdfdCAgICAgIGN1cnJlbnRSU1NJCispCit7CisgICBXTEFOVExfQ2JUeXBlICAgICAgICAgICAgICAgICAgKnRsQ3R4dCA9IFZPU19HRVRfVExfQ0IocEFkYXB0ZXIpOworICAgVk9TX1NUQVRVUyAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRSZWdpb24gPSAwOworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgICAgICBpZHgsIHNJZHg7CisgICBXTEFOVExfQ1VSUkVOVF9IT19TVEFURV9UWVBFICAgKmN1cnJlbnRITzsKKyAgIFdMQU5UTF9IT19TVVBQT1JUX1RZUEUgICAgICAgICAqaG9TdXBwb3J0OworICAgV0xBTlRMX1JTU0lDcm9zc1RocmVzaG9sZENCVHlwZSBjYkZ1bmN0aW9uID0gTlVMTDsKKyAgIHZfUFZPSURfdCAgICAgICAgICAgICAgICAgICAgICAgdXNyQ3R4dCA9IE5VTEw7CisgICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgICAgIGV2dFR5cGUgPSBXTEFOVExfSE9fVEhSRVNIT0xEX05BOworCisgICBpZihOVUxMID09IHRsQ3R4dCkKKyAgIHsKKyAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJJbnZhbGlkIFRMIGhhbmRsZSIpKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICB9CisKKyAgIGN1cnJlbnRITyA9ICYodGxDdHh0LT5ob1N1cHBvcnQuY3VycmVudEhPU3RhdGUpOworICAgaG9TdXBwb3J0ID0gJih0bEN0eHQtPmhvU3VwcG9ydCk7CisgICBUTExPRzEoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCJDUmVnaW9uICVkLCBOVGhyZXNob2xkICVkLCBIUlNTSSAlZCIsCisgICAgICAgICAgICAgICAgY3VycmVudEhPLT5yZWdpb25OdW1iZXIsCisgICAgICAgICAgICAgICAgY3VycmVudEhPLT5udW1UaHJlc2hvbGQsCisgICAgICAgICAgICAgICAgY3VycmVudEhPLT5oaXN0b3J5UlNTSSkpOworCisgICAvKiBGaW5kIHdoZXJlIGlzIGN1cnJlbnQgcmVnaW9uICovCisgICBmb3IoaWR4ID0gMDsgaWR4IDwgY3VycmVudEhPLT5udW1UaHJlc2hvbGQ7IGlkeCsrKQorICAgeworICAgICAgaWYoaG9TdXBwb3J0LT5yZWdpc3RlcmVkSW5kW2lkeF0ucnNzaVZhbHVlIDwgY3VycmVudFJTU0kpCisgICAgICB7CisgICAgICAgICBjdXJyZW50UmVnaW9uID0gaWR4OworICAgICAgICAgVExMT0cxKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywiRm91bmQgcmVnaW9uICVkLCBub3QgYm90dG9tIiwgY3VycmVudFJlZ2lvbikpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICB9CisKKyAgIC8qIElmIGNvdWxkIG5vdCBmaW5kIHRoZW4gbmV3IFJTU0kgaXMgYmVsb25nIHRvIGJvdHRvbSByZWdpb24gKi8KKyAgIGlmKGlkeCA9PSBjdXJyZW50SE8tPm51bVRocmVzaG9sZCkKKyAgIHsKKyAgICAgIGN1cnJlbnRSZWdpb24gPSBpZHg7CisgICAgICBUTExPRzEoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCJDdXJyZW50IHJlZ2lvbiBpcyBib3R0b20gJWQiLCBpZHgpKTsKKyAgIH0KKworICAgLyogVGhpcyBpcyBhIGhhY2suIEFjdHVhbCBhc3NpZ25tZW50IHdhcyBoYXBwZW5pbmcgYWZ0ZXIgdGhlIGJlbG93IGNoZWNrcy4gVGhpcyBoYWNrIGlzIG5lZWRlZCB0aWxsIFRMCisgICAg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24ocEFkYXB0ZXIsIGV2dFR5cGUsIHVzckN0eHQsIGNiRnVuY3Rpb24sIGN1cnJlbnRSU1NJKTsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgIH0KKyAgIH0KKworICAgY3VycmVudEhPLT5oaXN0b3J5UlNTSSA9IGN1cnJlbnRSU1NJOworICAgY3VycmVudEhPLT5yZWdpb25OdW1iZXIgPSBjdXJyZW50UmVnaW9uOworICAgV0xBTlRMX0hTRGVidWdEaXNwbGF5KHBBZGFwdGVyKTsKKworICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgeworICAgICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIkNsaWVudCBmYWlsIHRvIGhhbmRsZSByZWdpb24gY2hhbmdlIGluIG5vcm1hbCBtb2RlICVkIiwgc3RhdHVzKSk7CisgICB9CisgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OCisKKyAgIERFU0NSSVBUSU9OIAorICAgIAorICAgUEFSQU1FVEVSUyAKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfSFNIYW5kbGVSWEZyYW1lCisoCisgICB2X1BWT0lEX3QgICAgICAgIHBBZGFwdGVyLAorICAgdl9VOF90ICAgICAgICAgICBmcmFtZVR5cGUsCisgICB2X1BWT0lEX3QgICAgICAgIHBCREhlYWRlciwKKyAgIHZfVThfdCAgICAgICAgICAgU1RBaWQsCisgICB2X0JPT0xfdCAgICAg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5UTF9IU0hhbmRsZVJYRnJhbWUiLCAmdGxDdHh0LT5ob1N1cHBvcnQuaG9zTG9jayk7CisgICByZXR1cm4gc3RhdHVzOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OCisKKyAgIERFU0NSSVBUSU9OIAorICAgIAorICAgUEFSQU1FVEVSUyAKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfSFNIYW5kbGVUWEZyYW1lCisoCisgICB2X1BWT0lEX3QgICAgICAgIHBBZGFwdGVyLAorICAgdl9VOF90ICAgICAgICAgICBhYywKKyAgIHZfVThfdCAgICAgICAgICAgU1RBaWQsCisgICB2b3NfcGt0X3QgICAgICAgKmRhdGFCdWZmZXIsCisgICB2X1BWT0lEX3QgICAgICAgIGJkSGVhZGVyCispCit7CisgICBXTEFOVExfQ2JUeXBlICAgICAgICAgICAgICAgICAgKnRsQ3R4dCA9IFZPU19HRVRfVExfQ0IocEFkYXB0ZXIpOworICAgVk9TX1NUQVRVUyAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisKKyAgIGlmKE5VTEwgPT0gdGxDdHh0KQorICAgeworICAgICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIkludmFsaWQgVEwgaGFuZGxlIikpOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgIH0KKworICAgLyogVHJhZmZpYyBzdGF0dXMgcmVwb3J0IGlzIG5vdCByZWdpc3RlcmVkLCBKVVNUIERPIE5PVEhJTkcgKi8KKyAgIGlmKDAgPT0gdGxDdHh0LT5ob1N1cHBvcnQuY3VycmVudFRyYWZmaWMuaWRsZVRocmVzaG9sZCkKKyAgIHsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICB9CisKKworICAgLyogT25seSBWb2ljZSB0cmFmZmljIGlzIGhhbmRsZWQgYXMgcmVhbCB0aW1lIHRyYWZmaWMgKi8KKyAgIGlmKFdMQU5UTF9BQ19WTyA9PSBhYykKKyAgIHsKKyAgICAgIHRsQ3R4dC0+aG9TdXBwb3J0LmN1cnJlbnRUcmFmZmljLnJ0VFhGcmFtZUNvdW50Kys7CisgICB9CisgICBlbHNlCisgICB7CisgICAgICB0bEN0eHQtPmhvU3VwcG9ydC5jdXJyZW50VHJhZmZpYy5ucnRUWEZyYW1lQ291bnQrKzsKKyAgIH0KKyAgIFRMTE9HMShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sIlRYIGZyYW1lIEFDICVkLCBSVCBGcmFtZSBDb3VudCAlZCwgTlJUIEZyYW1lIENvdW50ICVkIiwKKyAgICAgICAgICAgICAgICBhYywKKyAgICAgICAgICAgICAgICB0bEN0eHQtPmhvU3VwcG9ydC5jdXJyZW50VHJhZmZpYy5ydFRYRnJhbWVDb3VudCwKKyAgICAgICAgICAgICAgICB0bEN0eHQtPmhvU3VwcG9ydC5jdXJyZW50VHJhZmZpYy5ucnRUWEZyYW1lQ291bnQpKTsKKworICAgcmV0dXJuIHN0YXR1czsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICBGVU5DVElPTgorCisgICBERVNDUklQVElPTiAKKyAgICAKKyAgIFBBUkFNRVRFUlMgCisKKyAgIFJFVFVSTiBWQUxVRQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgV0xBTlRMX0hTUmVnUlNTSUluZGljYXRpb25DQgorKAorICAgdl9QVk9JRF90ICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlciwKKyAgIHZfUzdfdCAgICAgICAgICAgICAgICAgICAgICAgICAgcnNzaVZhbHVlLAorICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgICAgICB0cmlnZ2VyRXZlbnQsCisgICBXTEFOVExfUlNTSUNyb3NzVGhyZXNob2xkQ0JUeXBlIGNyb3NzQ0JGdW5jdGlvbiwKKyAgIFZPU19NT0RVTEVfSUQgICAgICAgICAgICAgICAgICAgbW9kdWxlSUQsCisgICB2X1BWT0lEX3QgICAgICAgICAgICAgICAgICAgICAgIHVzckN0eHQKKykKK3sKKyAgIFdMQU5UTF9DYlR5cGUgICAgICAgICAgICAgICAgICAqdGxDdHh0ID0gVk9TX0dFVF9UTF9DQihwQWRhcHRlcik7CisgICBWT1NfU1RBVFVTICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICAgICAgaWR4LCBzSWR4OworICAgV0xBTlRMX0hPX1NVUFBPUlRfVFlQRSAgICAgICAgICpob1N1cHBvcnQ7CisgICBXTEFOVExfQ1VSUkVOVF9IT19TVEFURV9UWVBFICAgKmN1cnJlbnRITzsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICAgICAgY2xpZW50T3JkZXIgPSAwOworCisgICBpZihOVUxMID09IHRsQ3R4dCkKKyAgIHsKKyAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJJbnZhbGlkIFRMIGhhbmRsZSIpKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICB9CisKKyAgIGlmKCgtMSA8IHJzc2lW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sgc0lkeCsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgaWYoTlVMTCA9PSBob1N1cHBvcnQtPnJlZ2lzdGVyZWRJbmRbaWR4XS5jcm9zc0NCRnVuY3Rpb25bc0lkeF0pCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBjbGllbnRPcmRlciA9IHNJZHg7CisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGhvU3VwcG9ydC0+cmVnaXN0ZXJlZEluZFtpZHhdLnRyaWdnZXJFdmVudFtjbGllbnRPcmRlcl0gICAgPSB0cmlnZ2VyRXZlbnQ7CisgICAgICAgICAgICBob1N1cHBvcnQtPnJlZ2lzdGVyZWRJbmRbaWR4XS5jcm9zc0NCRnVuY3Rpb25bY2xpZW50T3JkZXJdID0gY3Jvc3NDQkZ1bmN0aW9uOworICAgICAgICAgICAgaG9TdXBwb3J0LT5yZWdpc3RlcmVkSW5kW2lkeF0udXNyQ3R4dFtjbGllbnRPcmRlcl0gICAgICAgICA9IHVzckN0eHQ7CisgICAgICAgICAgICBob1N1cHBvcnQtPnJlZ2lzdGVyZWRJbmRbaWR4XS53aG9Jc0NsaWVudFtjbGllbnRPcmRlcl0gICAgID0gbW9kdWxlSUQ7CisgICAgICAgICAgICBob1N1cHBvcnQtPnJlZ2lzdGVyZWRJbmRbaWR4XS5udW1DbGllbnQrKzsKKyAgICAgICAgICAgIFdMQU5UTF9IU0RlYnVnRGlzcGxheShwQWRhcHRlcik7CisgICAgICAgICAgICBUSFNSRUxFQVNFTE9DSygiV0xBTlRMX0hTUmVnUlNTSUluZGljYXRpb25DQiIsICZ0bEN0eHQtPmhvU3VwcG9ydC5ob3NMb2NrKTsKKyAgICAgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgICAgICB9CisgICAgICB9CisgICAgICBmb3IoaWR4ID0gMDsgaWR4IDwgY3VycmVudEhPLT5udW1UaHJlc2hvbGQ7IGlkeCsrKQorICAgICAgeworICAgICAgICAgaWYocnNzaVZhbHVlID4gaG9TdXBwb3J0LT5yZWdpc3RlcmVkSW5kW2lkeF0ucnNzaVZhbHVlKQorICAgICAgICAgeworICAgICAgICAgICAgZm9yKHNJZHggPSAoY3VycmVudEhPLT5udW1UaHJlc2hvbGQgLSAxKTsgKHNJZHggPiBpZHgpIHx8IChzSWR4ID09IGlkeCk7IHNJZHgtLSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFRMTE9HMShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sICJTaGlmdCAlZCBhcnJheSB0byAlZCIsIHNJZHgsIHNJZHggKyAxKSk7CisgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJmhvU3VwcG9ydC0+cmVnaXN0ZXJlZEluZFtzSWR4ICsgMV0sICZob1N1cHBvcnQtPnJlZ2lzdGVyZWRJbmRbc0lkeF0sIHNpemVvZihXTEFOVExfSE9fUlNTSV9JTkRJQ0FUSU9OX1RZUEUpKTsKKyAgICAgICAgICAgICAgIG1lbXNldCgmaG9TdXBwb3J0LT5yZWdpc3RlcmVkSW5kW3NJZHhdLCAwLCBzaXplb2YoV0xBTlRMX0hPX1JTU0lfSU5ESUNBVElPTl9UWVBFKSk7CisgICAgICAgICAgICAgICBpZigwID09IHNJZHgpCisgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIFRMTE9HMShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sIlB1dCBpbiBIZXJlICVkIiwgaWR4KSk7CisgICAgICAgICAgICBob1N1cHBvcnQtPnJlZ2lzdGVyZWRJbmRbaWR4XS5yc3NpVmFsdWUgICAgPSByc3NpVmFsdWU7CisgICAgICAgICA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0LT5ob1N1cHBvcnQuaG9zTG9jayk7CisgICB9CisKKyAgIFdMQU5UTF9IU0RlYnVnRGlzcGxheShwQWRhcHRlcik7CisgICBUSFNSRUxFQVNFTE9DSygiV0xBTlRMX0hTUmVnUlNTSUluZGljYXRpb25DQiIsICZ0bEN0eHQtPmhvU3VwcG9ydC5ob3NMb2NrKTsKKyAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgRlVOQ1RJT04KKworICAgREVTQ1JJUFRJT04gCisgICAgCisgICBQQVJBTUVURVJTIAorCisgICBSRVRVUk4gVkFMVUUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9IU0RlcmVnUlNTSUluZGljYXRpb25DQgorKAorICAgdl9QVk9JRF90ICAgICAgICAgICAgICAgICAgICAgICBwQWRhcHRlciwKKyAgIHZfUzdfdCAgICAgICAgICAgICAgICAgICAgICAgICAgcnNzaVZhbHVlLAorICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgICAgICB0cmlnZ2VyRXZlbnQsCisgICBXTEFOVExfUlNTSUNyb3NzVGhyZXNob2xkQ0JUeXBlIGNyb3NzQ0JGdW5jdGlvbiwKKyAgIFZPU19NT0RVTEVfSUQgICAgICAgICAgICAgICAgICAgbW9kdWxlSUQKKykKK3sKKyAgIFdMQU5UTF9DYlR5cGUgICAgICAgICAgICAgICAgICAqdGxDdHh0ID0gVk9TX0dFVF9UTF9DQihwQWRhcHRlcik7CisgICBWT1NfU1RBVFVTICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICAgICAgaWR4LCBzSWR4OworICA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+aG9TdXBwb3J0LnJlZ2lzdGVyZWRJbmRbaWR4XS51c3JDdHh0W3NJZHhdICAgICAgICAgPSBOVUxMOworICAgICAgICAgICAgICAgdGxDdHh0LT5ob1N1cHBvcnQucmVnaXN0ZXJlZEluZFtpZHhdLndob0lzQ2xpZW50W3NJZHhdICAgICA9IDA7CisgICAgICAgICAgICAgICB0bEN0eHQtPmhvU3VwcG9ydC5yZWdpc3RlcmVkSW5kW2lkeF0ubnVtQ2xpZW50LS07CisgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgICBpZigwICE9IHRsQ3R4dC0+aG9TdXBwb3J0LnJlZ2lzdGVyZWRJbmRbaWR4XS5udW1DbGllbnQpCisgICAgICAgICB7CisgICAgICAgICAgICBUTExPRzEoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCJGb3VuZCBNdWx0aXBsZSBpZHggaXMgJWQiLCBpZHgpKTsKKyAgICAgICAgICAgIFdMQU5UTF9IU0RlYnVnRGlzcGxheShwQWRhcHRlcik7CisgICAgICAgICAgICBUSFNSRUxFQVNFTE9DSygiV0xBTlRMX0hTRGVyZWdSU1NJSW5kaWNhdGlvbkNCIiwgJnRsQ3R4dC0+aG9TdXBwb3J0Lmhvc0xvY2spOworICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFRMTE9HMShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sIkZvdW5kIFNpbmdsZSBpZHggaXMgJWQiLCBpZHgpKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgfQorICAgICAgfQorICAgfQorICAgaWYoaWR4ID09IGN1cnJlbnRITy0+bnVtVGhyZXNob2xkKQorICAgeworICAgICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywiQ291bGQgbm90IGZpbmQgZW50cnksIG1heWJlIGludmFsaWQgYXJnIikpOworICAgICAgVEhTUkVMRUFTRUxPQ0soIldMQU5UTF9IU0RlcmVnUlNTSUluZGljYXRpb25DQiIsICZ0bEN0eHQtPmhvU3VwcG9ydC5ob3NMb2NrKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICB9CisKKyAgIGZvcihpZHggPSAwOyBpZHggPCBjdXJyZW50SE8tPm51bVRocmVzaG9sZDsgaWR4KyspCisgICB7CisgICAgICBpZihyc3NpVmFsdWUgPT0gaG9TdXBwb3J0LT5yZWdpc3RlcmVkSW5kW2lkeF0ucnNzaVZhbHVlKQorICAgICAgeworICAgICAgICAgaWYoKGN1cnJlbnRITy0+bnVtVGhyZXNob2xkIC0gMSkgPT0gaWR4KQorICAgICAgICAgeworICAgICAgICAgICAgVExMT0cxKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywiUmVtb3ZlIHRhcmdldCBpcyBsYXN0IG9uZSIpKTsKKyAgICAgICAgICAgIC8qIERvZXMgbm90IG5lZWQgbW92ZSBhbnkgZWxlbWVudCwganVzdCByZW1vdmUgbGFzdCBhcnJheSBlbnRyeSAqLworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgZm9yKHNJZHggPSBpZHg7IHNJZHggPCAoY3VycmVudEhPLT5udW1UaHJlc2hvbGQgLSAxKTsgc0lkeCsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgVExMT0cxKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywiU2hpZnQgdXAgZnJvbSAlZCB0byAlZCIsIHNJZHggKyAxLCBzSWR4KSk7CisgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJmhvU3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Pm51bVRocmVzaG9sZCAtIDFdLm51bUNsaWVudCAgICAgICAgICAgID0gMDsKKyAgIH0KKworICAgaWYoICgoVk9TX0ZBTFNFID09IHRsQ3R4dC0+aXNCTVBTKSAmJiAocnNzaVZhbHVlID49IGN1cnJlbnRITy0+aGlzdG9yeVJTU0kpKQorICAgIHx8ICgoVk9TX1RSVUUgPT0gdGxDdHh0LT5pc0JNUFMpICYmIChWT1NfVFJVRSA9PSBibXBzQWJvdmUpKSApCisgICB7CisgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAiUmVtb3ZlZCBUaHJlc2hvbGQgYWJvdmUgY3VycmVudCBSU1NJIGxldmVsLCBvbGQgUk4gJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudEhPLT5yZWdpb25OdW1iZXIpKTsKKyAgICAgIGlmKDAgPCBjdXJyZW50SE8tPnJlZ2lvbk51bWJlcikKKyAgICAgIHsKKyAgICAgICAgIGN1cnJlbnRITy0+cmVnaW9uTnVtYmVyLS07CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAiQ3VycmVudCBSZWdpb24gbnVtYmVyIGlzIDAsIGNhbm5vdCBkZWNyZWFzZSBhbnltb3JlIikpOworICAgICAgfQorICAgICAgVExMT0cxKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgIkRlY3JlYXNlIHJlZ2lvbiBudW1iZXIgd2l0aG91dCBub3RpZmljYXRpb24gJWQiLAorICAgICAgICAgICAgICAg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worICAgfQorCisgICAvKiBCYXNlZCBvbiBuZXcgdGhyZXNob2xkIHNldCByZWNhbGN1bGF0ZWQgY3VycmVudCBSU1NJIHN0YXR1cyAqLworICAgaWYoMCA8IHRsQ3R4dC0+aG9TdXBwb3J0LmN1cnJlbnRIT1N0YXRlLm51bVRocmVzaG9sZCkKKyAgIHsKKyAgIH0KKyAgIGVsc2UgaWYoMCA9PSB0bEN0eHQtPmhvU3VwcG9ydC5jdXJyZW50SE9TdGF0ZS5udW1UaHJlc2hvbGQpCisgICB7CisgICAgICBjdXJyZW50SE8tPnJlZ2lvbk51bWJlciA9IDA7CisgICAgICBUTExPR1coVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9XQVJOLCJObyByZWdpc3RlcmVkIFRocmVzaG9sZCIpKTsKKyAgICAgIC8qIFdoYXQgc2hvdWxkIGRvPyAqLworICAgfQorCisgICBXTEFOVExfSFNEZWJ1Z0Rpc3BsYXkocEFkYXB0ZXIpOworICAgVEhTUkVMRUFTRUxPQ0soIldMQU5UTF9IU0RlcmVnUlNTSUluZGljYXRpb25DQiIsICZ0bEN0eHQtPmhvU3VwcG9ydC5ob3NMb2NrKTsKKyAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgRlVOQ1RJT04KKworICAgREVTQ1JJUFRJT04gCisgICAgCisgICBQQVJBTUVURVJTIAorCisgICBSRVRVUk4gVkFMVUUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9IU1NldEFscGhhCisoCisgICB2X1BWT0lEX3QgcEFkYXB0ZXIsCisgICBpbnQgICAgICAgdmFsdWVBbHBoYQorKQoreworICAgV0xBTlRMX0NiVHlwZSAgICp0bEN0eHQgPSBWT1NfR0VUX1RMX0NCKHBBZGFwdGVyKTsKKyAgIFZPU19TVEFUVVMgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworCisgICBpZihOVUxMID09IHRsQ3R4dCkKKyAgIHsKKyAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJJbnZhbGlkIFRMIGhhbmRsZSIpKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICB9CisKKyAgIFRIU0dFVExPQ0soIldMQU5UTF9IU1NldEFscGhhIiwgJnRsQ3R4dC0+aG9TdXBwb3J0Lmhvc0xvY2spOworICAgdGxDdHh0LT5ob1N1cHBvcnQuY3VycmVudEhPU3RhdGUuYWxwaGEgPSAodl9VOF90KXZhbHVlQWxwaGE7CisgICBUSFNSRUxFQVNFTE9DSygiV0xBTlRMX0hTU2V0QWxwaGEiLCAmdGxDdHh0LT5ob1N1cHBvcnQuaG9zTG9jayk7CisgICByZXR1cm4gc3RhdHVzOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OCisKKyAgIERFU0NSSVBUSU9OIAorICAgIAorICAgUEFSQU1FVEVSUyAKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfSFNSZWdHZXRUcmFmZmljU3RhdHVzCisoCisgICB2X1BWT0lEX3QgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLAorICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZGxlVGhyZXNob2xkLAorICAgdl9VMzJfd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B0bEN0eHQtPmhvU3VwcG9ydC5jdXJyZW50VHJhZmZpYy51c3JDdHh0ICAgICAgID0gdXNyQ3R4dDsKKworICAgdm9zX3RpbWVyX3N0YXJ0KCZ0bEN0eHQtPmhvU3VwcG9ydC5jdXJyZW50VHJhZmZpYy50cmFmZmljVGltZXIsCisgICAgICAgICAgICAgICAgICAgdGxDdHh0LT5ob1N1cHBvcnQuY3VycmVudFRyYWZmaWMubWVhc3VyZVBlcmlvZCk7CisKKyAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgRlVOQ1RJT04KKworICAgREVTQ1JJUFRJT04gCisgICAgCisgICBQQVJBTUVURVJTIAorCisgICBSRVRVUk4gVkFMVUUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9IU0luaXQKKygKKyAgIHZfUFZPSURfdCAgIHBBZGFwdGVyCispCit7CisgICBXTEFOVExfQ2JUeXBlICAgKnRsQ3R4dCA9IFZPU19HRVRfVExfQ0IocEFkYXB0ZXIpOworICAgVk9TX1NUQVRVUyAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICB2X1U4X3QgICAgICAgICAgIGlkeCwgc0lkeDsKKworICAgaWYoTlVMTCA9PSB0bEN0eHQpCisgICB7CisgICAgICBUTExPR0UoVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwiSW52YWxpZCBUTCBoYW5kbGUiKSk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworICAgfQorI2lmZGVmIFdMQU5UTF9IT19VVEVTVAorICAgcnNzaSA9IDA7CisgICBkaXJlY3Rpb24gPSAtM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5ob1N1cHBvcnQucmVnaXN0ZXJlZEluZFtpZHhdLnJzc2lWYWx1ZSAgICAgICAgICA9IFdMQU5UTF9IT19ERUZBVUxUX1JTU0k7CisgICAgICB0bEN0eHQtPmhvU3VwcG9ydC5yZWdpc3RlcmVkSW5kW2lkeF0ubnVtQ2xpZW50ICAgICAgICAgID0gMDsKKyAgIH0KKworICAgdm9zX3RpbWVyX2luaXQoJnRsQ3R4dC0+aG9TdXBwb3J0LmN1cnJlbnRUcmFmZmljLnRyYWZmaWNUaW1lciwKKyAgICAgICAgICAgICAgICAgIFZPU19USU1FUl9UWVBFX1NXLAorICAgICAgICAgICAgICAgICAgV0xBTlRMX0hTVHJhZmZpY1N0YXR1c1RpbWVyRXhwaXJlZCwKKyAgICAgICAgICAgICAgICAgIHBBZGFwdGVyKTsKKworCisgICB2b3NfbG9ja19pbml0KCZ0bEN0eHQtPmhvU3VwcG9ydC5ob3NMb2NrKTsKKyAgIHRsQ3R4dC0+aG9TdXBwb3J0Lm1hY0N0eHQgPSB2b3NfZ2V0X2NvbnRleHQoVk9TX01PRFVMRV9JRF9TTUUsIHBBZGFwdGVyKTsKKworICAgcmV0dXJuIHN0YXR1czsKK30KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OICAgIFdMQU5UTF9IU0RlSW5pdAorCisgICBERVNDUklQVElPTiAKKyAgICAKKyAgIFBBUkFNRVRFUlMgCisKKyAgIFJFVFVSTiBWQUxVRQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworVk9TX1NUQVRVUyBXTEFOVExfSFNEZUluaXQKKygKKyAgIHZfUFZPSURfdCAgIHBBZGFwdGVyCispCit7CisgICBXTEFOVExfQ2JUeXBlICAgKnRsQ3R4dCA9IFZPU19HRVRfVExfQ0IocEFkYXB0ZXIpOworICAgVk9TX1NUQVRVUyAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisKKyAgIGlmKE5VTEwgPT0gdGxDdHh0KQorICAgeworICAgICAgVExMT0dFKFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIkludmFsaWQgVEwgaGFuZGxlIikpOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgIH0KKworICAgLy8gRGVzdHJveSB0aGUgdGltZXIuLi4gICAgICAKKyAgIHN0YXR1cyA9IHZvc190aW1lcl9kZXN0cm95KCAmdGxDdHh0LT5ob1N1cHBvcnQuY3VycmVudFRyYWZmaWMudHJhZmZpY1RpbWVyICk7CisgICBpZiAoICFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIHN0YXR1cyApICkKKyAgIHsKKyAgICAgIFRMTE9HRShWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCJXTEFOVExfSFNTdG9wOiBUaW1lciBEZXN0cm95IEZhaWwgU3RhdHVzICVkIiwgc3RhdHVzKSk7CisgICB9CisgICByZXR1cm4gc3RhdHVzOyAgIAorfQorCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgRlVOQ1RJT04KKworICAgREVTQ1JJUFRJT04gCisgICAgCisgICBQQVJBTUVURVJTIAorCisgICBSRVRVUk4gVkFMVUUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9IU1N0b3AKKygKKyAgIHZfUFZPSURfdCAgIHBBZGFwdGVyCispCit7CisgICBXTEFOVExfQ2JUeXBlICAgKnRsQ3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ycmVudFRyYWZmaWMuaWRsZVRocmVzaG9sZCA9IDA7CisgICB0bEN0eHQtPmhvU3VwcG9ydC5jdXJyZW50VHJhZmZpYy5tZWFzdXJlUGVyaW9kID0gMDsKKyAgIHRsQ3R4dC0+aG9TdXBwb3J0LmN1cnJlbnRUcmFmZmljLnRyYWZmaWNDQiAgICAgPSBOVUxMOworICAgdGxDdHh0LT5ob1N1cHBvcnQuY3VycmVudFRyYWZmaWMudXNyQ3R4dCAgICAgICA9IE5VTEw7CisKKyAgIHJldHVybiBzdGF0dXM7ICAgCit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgRlVOQ1RJT04KKworICAgREVTQ1JJUFRJT04gCisgICAgCisgICBQQVJBTUVURVJTIAorCisgICBSRVRVUk4gVkFMVUUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9IU1NlcmlhbGl6ZVRsSW5kaWNhdGlvbgorKAorICAgdl9QVk9JRF90ICAgcEFkYXB0ZXIsCisgICB2X1U4X3QgICAgICByc3NpTm90aWZpY2F0aW9uLAorICAgdl9QVk9JRF90ICAgcFVzZXJDdHh0LAorICAgV0xBTlRMX1JTU0lDcm9zc1RocmVzaG9sZENCVHlwZSBjYkZ1bmN0aW9uLAorICAgdl9VOF90ICAgICAgYXZnUnNzaQorKQoreworICAgVk9TX1NUQVRVUyAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICB2b3NfbXNnX3QgICAgICAgIG1zZzsKKyAgIFdMQU5UTF9UbEluZGljYXRpb25SZXEgKnBNc2c7CisKKyAgIHBNc2cgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YoV0xBTlRMX1RsSW5kaWNhdGlvblJlcSkpOworICAgaWYgKCBOV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AgTCBBIFkgRSBSIAorICAgICAgICAgICAgICAgSE8gU1VQUE9SVCAgICBJIE4gVCBFIFIgTiBBIEwgIEEgUCBJCisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgCitERVNDUklQVElPTgorICAgICAgICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgIEVESVQgSElTVE9SWSBGT1IgRklMRQorCisKKyAgVGhpcyBzZWN0aW9uIGNvbnRhaW5zIGNvbW1lbnRzIGRlc2NyaWJpbmcgY2hhbmdlcyBtYWRlIHRvIHRoZSBtb2R1bGUuCisgIE5vdGljZSB0aGF0IGNoYW5nZXMgYXJlIGxpc3RlZCBpbiByZXZlcnNlIGNocm9ub2xvZ2ljYWwgb3JkZXIuCisKKworICAkSGVhZGVyOiQgJERhdGVUaW1lOiAkICRBdXRob3I6ICQKKworCit3aGVuICAgICAgICB3aG8gICAgd2hhdCwgd2hlcmUsIHdoeQorLS0tLS0tLS0gICAgLS0tICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKzEyLzExLzA4ICAgICAgc2NoICAgICBJbml0aWFsIGNyZWF0aW9uCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgICAgIElOQ0xVREUgRklMRVMgRk9SIE1PRFVMRQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworI2luY2x1ZGUgIndsYW5fcWN0X3RsLmgiIAorCisjaWZkZWYgV0xBTl9GRUFUVVJFX0xJTktfTEFZRVJfU1RBVFMKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgRlVOQ1RJT04KKworICAgREVTQ1JJUFRJT04KKworICAgUEFSQU1FVEVSUworCisgICBSRVRVUk4gVkFMVUUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9IU0dldERhdGFSU1NJCisoCisgICB2X1BWT0lEX3QgICAgICAgIHBBZGFwdGVyLAorICAgdl9QVk9JRF90ICAgICAgICBwQkRIZWFkZXIsCisgICB2X1U4X3QgICAgICAgICAgIFNUQWlkLAorICAgdl9TN190ICAgICAgICAgICpjdXJyZW50QXZnUlNTSQorKTsKKyNlbmRpZgorCisjaWYgZGVmaW5lZCBXTEFOX0ZFQVRVUkVfTkVJR0hCT1JfUk9BTUlORworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKiBJbmNsdWRlIEZpbGVzCisgKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgRlVOQ1RJT04KKworICAgREVTQ1JJUFRJT04gCisgICAgCisgICBQQVJBTUVURVJTIAorCisgICBSRVRVUk4gVkFMVUUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9IU0hhbmRsZVJYRnJhbWUKKygKKyAgIHZfUFZPSURfdCAgICAgICAgcEFkYXB0ZXIsCisgICB2X1U4X3QgICAgICAgICAgIGZyYW1lVHlwZSwKKyAgIHZfUFZPSURfdCAgICAgICAgcEJESGVhZGVyLAorICAgdl9VOF90ICAgICAgICAgICBTVEFpZCwKKyAgIHZfQk9PTF90ICAgICAgICAgaXNCcm9hZGNhc3QsCisgICB2b3NfcGt0X3QgICAgICAgKmRhdGFCdWZmZXIKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgRlVOQ1RJT04KKworICAgREVTQ1JJUFRJT04gCisgICAgCisgICBQQVJBTUVURVJTIAorCisgICBSRVRVUk4gVkFMVUUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9IU0hhbmRsZVRYRnJhbWUKKygKKyAgIHZfUFZPSURfdCAgICAgICAgcEFkYXB0ZXIsCisgICB2X1U4X3QgICAgICAgICAgIGFjLAorICAgdl9VOF90ICAgICAgICAgICBTVEFpZCwKKyAgIHZvc19wa3RfdCAgICAgICAqZGF0YUJ1ZmZlciwKKyAgIHZfUFZPSURfdCAgICAgICAgYmRIZWFkZXIKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgRlVOQ1RJT04KKworICAgREVTQ1JJUFRJT04gCisgICAgCisgICBQQVJBTUVURVJTIAorCisgICBSRVRVUk4gVkFMVUUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9IU1JlZ1JTU0lJbmRpY2F0aW9uQ0IKKygKKyAgIHZfUFZPSURfdCAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXIsCisgICB2X1M3X3QgICAgICAgICAgICAgICAgICAgICAgICAgIHJzc2lWYWx1ZSwKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICAgICAgdHJpZ2dlckV2ZW50LAorICAgV0xBTlRMX1JTU0lDcm9zc1RocmVzaG9sZENCVHlwZSBjcm9zc0NCRnVuY3Rpb24sCisgICBWT1NfTU9EVUxFX0lEICAgICAgICAgICAgICAgICAgIG1vZHVsZUlELAorICAgdl9QVk9JRF90ICAgICAgICAgICAgICAgICAgICAgICB1c3JDdHh0CispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OCisKKyAgIERFU0NSSVBUSU9OIAorICAgIAorICAgUEFSQU1FVEVSUyAKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfSFNEZXJlZ1JTU0lJbmRpY2F0aW9uQ0IKKygKKyAgIHZfUFZPSURfdCAgICAgICAgICAgICAgICAgICAgICAgcEFkYXB0ZXIsCisgICB2X1M3X3QgICAgICAgICAgICAgICAgICAgICAgICAgIHJzc2lWYWx1ZSwKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICAgICAgdHJpZ2dlckV2ZW50LAorICAgV0xBTlRMX1JTU0lDcm9zc1RocmVzaG9sZENCVHlwZSBjcm9zc0NCRnVuY3Rpb24sCisgICBWT1NfTU9EVUxFX0lEICAgICAgICAgICAgICAgICAgIG1vZHVsZUlECispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OCisKKyAgIERFU0NSSVBUSU9OIAorICAgIAorICAgUEFSQU1FVEVSUyAKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfSFNCTVBTUlNTSVJlZ2lvbkNoYW5nZWROb3RpZmljYXRpb24KKygKKyAgIHZfUFZPSURfdCAgICAgICAgICAgICBwQWRhcHRlciwKKyAgIHRwU2lyUlNTSU5vdGlmaWNhdGlvbiBwUlNTSU5vdGlmaWNhdGlvbgorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICBGVU5DVElPTgorCisgICBERVNDUklQVElPTiAKKyAgICAKKyAgIFBBUkFNRVRFUlMgCisKKyAgIFJFVFVSTiBWQUxVRQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgV0xBTlRMX0hTU2V0QWxwaGEKKygKKyAgIHZfUFZPSURfdCBwQWRhcHRlciwKKyAgIGludCAgICAgICB2YWx1ZUFscGhhCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OCisKKyAgIERFU0NSSVBUSU9OIAorICAgIAorICAgUEFSQU1FVEVSUyAKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfSFNSZWdHZXRUcmFmZmljU3RhdHVzCisoCisgICB2X1BWT0lEX3QgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyLAorICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZGxlVGhyZXNob2xkLAorICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZXJpb2QsCisgICBXTEFOVExfVHJhZmZpY1N0YXR1c0NoYW5nZWRDQlR5cGUgIHRyZmZpY1N0YXR1c0NCLAorICAgdl9QVk9JRF90ICAgICAgICAgICAgICAgICAgICAgICAgICB1c3JDdHh0CispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OCisKKyAgIERFU0NSSVBUSU9OIAorICAgIAorICAgUEFSQU1FVEVSUyAKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfSFNJbml0CisoCisgICB2X1BWT0lEX3QgICBwQWRhcHRlcgorKTsKKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OICAgIFdMQU5UTF9IU0RlSW5pdAorCisgICBERVNDUklQVElPTiAKKyAgICAKKyAgIFBBUkFNRVRFUlMgCisKKyAgIFJFVFVSTiBWQUxVRQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworVk9TX1NUQVRVUyBXTEFOVExfSFNEZUluaXQKKygKKyAgIHZfUFZPSURfdCAgIHBBZGFwdGVyCispOworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgRlVOQ1RJT04KKworICAgREVTQ1JJUFRJT04gCisgICAgCisgICBQQVJBTUVURVJTIAorCisgICBSRVRVUk4gVkFMVUUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9IU1N0b3AKKygKKyAgIHZfUFZPSURfdCAgIHBBZGFwdGVyCispOworCitWT1NfU1RBVFVTIFdMQU5UTF9TZXRGV1JTU0lUaHJlc2hvbGRzCisoCisgICB2X1BWT0lEX3QgICAgICAgICAgICAgICAgICAgICAgIHBBZGFwdGVyCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEZVTkNUSU9OCisKKyAgIERFU0NSSVBUSU9OIAorICAgIAorICAgUEFSQU1FVEVSUyAKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfSFNTZXJpYWxpemVUbEluZGljYXRpb24KKygKKyAgIHZfUFZPSURfdCAgIHBBZGFwdGVyLAorICAgdl9VOF90ICAgICAgcnNzaU5vdGlmaWNhdGlvbiwKKyAgIHZfUFZPSURfdCAgIHBVc2VyQ3R4dCwKKyAgIFdMQU5UTF9SU1NJQ3Jvc3NUaHJlc2hvbGRDQlR5cGUgY2JGdW5jdGlvbiwKKyAgIHZfVThfdCAgICAgIGF2Z1Jzc2kKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgRlVOQ1RJT04KKworICAgREVTQ1JJUFRJT04gCisgICAgCisgICBQQVJBTUVURVJTIAorCisgICBSRVRVUk4gVkFMVUUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9TdGF0SGFuZGxlVFhGcmFtZQorKAorICAgdl9QVk9JRF90ICAgICAgICBwQWRhcHRlciwKKyAgIHZfVThfdCAgICAgICAgICAgU1RBaWQsCisgICB2b3NfcGt0X3QgICAgICAgKmRhdGFCdWZmZXIsCisgICB2X1BWT0lEX3QgICAgICAgIHBCREhlYWRlciwKKyAgIFdMQU5UTF9NZXRhSW5mb1R5cGUgKnR4TWV0YUluZm8KKyk7CisKKyNlbmRpZgorCisjZW5kaWYgLyogV0xBTl9RQ1RfVExfSE9TVVBQT1JUX0ggKi8KZGlmZiAtLWdpdCBhL3dsYW4vcHJpbWEvQ09SRS9UTC9zcmMvd2xhbl9xY3RfdGxfdHJhY2UuYyBiL3dsYW4vcHJpbWEvQ09SRS9UTC9zcmMvd2xhbl9xY3RfdGxfdHJhY2UuYwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zOWI0YTVmCi0tLSAvZGV2L251bGwKKysrIGIvd2xhbi9wcmltYS9DT1JFL1RML3NyYy93bGFuX3FjdF90bF90cmFjZS5jCkBAIC0wLDAgKzEsNzggQEAKKy8qCisgKiBDb3B5cmlnaHQgKGMpIDIwMTQtMjAxNSBUaGUgTGludXggRm91bmRhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KKyAqCisgKiBQcmV2aW91c2x5IGxpY2Vuc2VkIHVuZGVyIHRoZSBJU0MgbGljZW5zZSBieSBRdWFsY29t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kaXN0cmlidXRlZCBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgIHdsYW5fcWN0X3RsX3RyYWNlLmMKKworICBcYnJpZWYgaW1wbGVtZW50YXRpb24gZm9yIHRyYWNlIHJlbGF0ZWQgQVBJcworCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKyNpbmNsdWRlICJ2b3NfdHJhY2UuaCIKKyNpbmNsdWRlICJ2b3NfdHlwZXMuaCIKKyNpbmNsdWRlICJ3bGFuX3FjdF90bF90cmFjZS5oIgorI2luY2x1ZGUgInRsRGVidWcuaCIKKworc3RhdGljIHZfVThfdCogdGxUcmFjZUdldEV2ZW50U3RyaW5nKHZfVTMyX3QgY29kZSkKK3sKKyAgICBzd2l0Y2goY29kZSkKKyAgICB7CisgICAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoVFJBQ0VfQ09ERV9UTF9TVEFfU1RBVEUpOworICAgICAgICAgQ0FTRV9SRVRVUk5fU1RSSU5HKFRSQUNFX0NPREVfVExfRUFQT0xfUEtUX1BFTkRJTkcpOworICAgICAgICAgQ0FTRV9SRVRVUk5fU1RSSU5HKFRSQUNFX0NPREVfVExfR0VUX0ZSQU1FU19FQVBPTCk7CisgICAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoVFJBQ0VfQ09ERV9UTF9SWF9DT05OX0VBUE9MKTsKKyAgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyhUUkFDRV9DT0RFX1RMX1JFR0lTVEVSX1NU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bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKworCisKKyNpZm5kZWYgV0xBTl9RQ1RfVExJX0gKKyNkZWZpbmUgV0xBTl9RQ1RfVExJX0gKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgVyBMIEEgTiAgIFQgUiBBIE4gUyBQIE8gUiBUICAgTCBBIFkgRSBSCisgICAgICAgICAgICAgICAgICAgICBJIE4gVCBFIFIgTiBBIEwgICBBIFAgSQorCisKK0RFU0NSSVBUSU9OCisgIFRoaXMgZmlsZSBjb250YWlucyB0aGUgaW50ZXJuYWwgZGVjbGFyYXRpb25zIHVzZWQgd2l0aGluIHdsYW4gdHJhbnNwb3J0CisgIGxheWVyIG1vZHVsZS4KKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisgICRIZWFkZXI6JCAkRGF0ZVRpbWU6ICQgJEF1dGhvcjogJAorCisKK3doZW4gICAgICAgIHdobyAgICB3aGF0LCB3aGVyZSwgd2h5CistLS0tLS0tLSAgICAtLS0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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PT09PT09PT0qLworCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgICAgICBJTkNMVURFIEZJTEVTIEZPUiBNT0RVTEUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKiBJbmNsdWRlIEZpbGVzCisgKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyNpbmNsdWRlICJ2b3NfcGFja2V0LmgiCisjaW5jbHVkZSAidm9zX2FwaS5oIgorI2luY2x1ZGUgInZvc190aW1lci5oIgorI2luY2x1ZGUgInZvc19tcS5oIgorI2luY2x1ZGUgInZvc19saXN0LmgiCisjaW5jbHVkZSAid2xhbl9xY3RfdGwuaCIKKyNpbmNsdWRlICJwbWNBcGkuaCIKKyNpbmNsdWRlICJ3bGFuX3FjdF9oYWwuaCIKKworCisjZGVmaW5lIFNUQVRJQyAgc3RhdGljCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAqIFByZXByb2Nlc3NvciBEZWZpbml0aW9ucyBhbmQgQ29uc3RhbnRzCisgKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKworLypNYXhpbXVtIG51bWJlciBvZiBUSURzICovCisjZGVmaW5lIFdMQU5fTUFYX1RJRCAgICAgICAgICAgICAgICAgICAgICAgICAgOAorCisvKk9mZnNldCBvZiB0aGUgT1VJIGZpZWxkIGluc2lkZSB0aGUgTExDL1NOQVAgaGVhZGVyKi8KKyNkZWZpbmUgV0xBTlRMX0xMQ19PVUlfT0ZGU0VUICAgICAgICAgICAgICAgICAzCisKKy8qU2l6ZSBvZiB0aGUgT1VJIHR5cGUgZmllbGQgaW5zaWRlIHRoZSBMTEMvU05BUCBoZWFkZXIqLworI2RlZmluZSBXTEFOVExfTExDX09VSV9TSVpFICAgICAgICAgICAgICAgICAgIDMKKworLypPZmZzZXQgb2YgdGhlIHByb3RvY29sIHR5cGUgZmllbGQgaW5zaWRlIHRoZSBMTEMvU05BUCBoZWFkZXIqLworI2RlZmluZSBXTEFOVExfTExDX1BST1RPX1RZUEVfT0ZGU0VUICAoV0xBTlRMX0xMQ19PVUlfT0ZGU0VUICsgIFdMQU5UTF9MTENfT1VJX1NJWkUpCisKKy8qU2l6ZSBvZiB0aGUgcHJvdG9jb2wgdHlwZSBmaWVsZCBpbnNpZGUgdGhlIExMQy9TTkFQIGhlYWRlciovCisjZGVmaW5lIFdMQU5UTF9MTENfUFJPVE9fVFlQRV9TSVpFICAgICAgICAgICAgMgorCisvKjgwMi4xeCBwcm90b2NvbCB0eXBlICovCisjZGVmaW5lIFdMQU5UTF9MTENfODAyMVhfVFlQRSAgICAgICAgICAgIDB4ODg4RQorCisvKldBUEkgcHJvdG9jb2wgdHlwZSAqLworI2RlZmluZSBXTEFOVExfTExDX1dBSV9UWVBFICAgICAgICAgICAgICAweDg4YjQKKyNkZWZpbmUgV0xBTlRMX0VUSEVSVFlQRV9BUlAgICAgICAgICAgICAgMHgwODA2CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworI2RlZmluZSBXTEFOVExfTExDX1RETFNfVFlQRSAgICAgICAgICAgICAweDg5MGQKKyNlbmRpZgorCisvKkxlbm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xJRCggX3RpZCApICAgICAoIF90aWQgPj0gV0xBTl9NQVhfVElEICkKKworLypDaGVja3MgQUMgdmFsaWRpdHkqLworI2RlZmluZSBXTEFOVExfQUNfSU5WQUxJRCggX3RpZCApICAgICAoIF90aWQgPj0gV0xBTlRMX01BWF9BQyApCisKKy8qRGV0ZXJtaW5lcyB0aGUgYWRkciBmaWVsZCBvZmZzZXQgYmFzZWQgb24gdGhlIGZyYW1lIHh0bCBiaXQqLworI2RlZmluZSBXTEFOVExfTUFDX0FERFJfQUxJR04oIF9keHRsICkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAoICggMCA9PSBfZHh0bCApID8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgIFdMQU5UTF84MDJfM19IRUFERVJfREFfT0ZGU0VUOiBXTEFOVExfODAyXzExX0hFQURFUl9BRERSMV9PRkZTRVQgKQorCisvKkRldGVybWluZXMgdGhlIGhlYWRlciBsZW4gYmFzZWQgb24gdGhlIGRpc2FibGUgeHRsIGZpZWxkKi8KKyNkZWZpbmUgV0xBTlRMX01BQ19IRUFERVJfTEVOKCBfZHh0bCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgKCAoIDAgPT0gX2R4dGwgKT8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgV0xBTlRMXzgwMl8zX0hFQURFUl9MRU46V0xBTlRMXzgwMl8xMV9IRUFERVJfTEVOICkKKworLypEZXRlcm1pbmVzIHRoZSBuZWNlc2FyeSBsZW5ndGggb2YgdGhlIEJEIGhlYWRlciAtIGluIGNhc2UKKyAgVU1BIHRyYW5zbGF0aW9uIGlzIGVuYWJsZWQgZW5vdWdoIHJvb20gbmVlZHMgdG8gYmUgbGVmdCBpbiBmcm9udCBvZiB0aGUKKyAgcGFja2V0IGZvciB0aGUgODAyLjExIGhlYWRlciB0byBiZSBpbnNlcnRlZCovCisjZGVmaW5lIFdMQ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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgIFNUQSBGU00gRW50cnkgdHlwZQorLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KK3R5cGVkZWYgc3RydWN0Cit7CisgIFdMQU5UTF9TVEFGdW5jVHlwZSAgcGZuU1RBVGJsW1dMQU5UTF9NQVhfRVZFTlRdOworfSBXTEFOVExfU1RBRnNtRW50cnlUeXBlOworCisvKiBSZWNlaXZlIGluIGNvbm5lY3RlZCBzdGF0ZSAtIG9ubHkgRUFQT0wgb3IgV0FJKi8KK1ZPU19TVEFUVVMgV0xBTlRMX1NUQVJ4Q29ubiggdl9QVk9JRF90ICAgICBwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICAgICAgICB1Y1NUQUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfcGt0X3QqKiAgIHB2b3NEYXRhQnVmZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9CT09MX3QgICAgICBiRm9yd2FyZElBUFB3aXRoTExDKTsKKworLyogVHJhbnNtaXQgaW4gY29ubmVjdGVkIHN0YXRlIC0gb25seSBFQVBPTCBvciBXQUkqLworVk9TX1NUQVRVUyBXTEFOVExfU1RBVHhDb25uKCB2X1BWT0lEX3QgICAgIHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgICAgICAgIHVjU1RBSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19wa3RfdCoqICAgcHZvc0RhdGFCdWZmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X0JPT0xfdCAgICAgIGJGb3J3YXJkSUFQUHdpdGhMTEMpOworCisvKiBSZWNlaXZlIGluIGF1dGhlbnRpY2F0ZWQgc3RhdGUgLSBhbGwgZGF0YSBhbGxvd2VkKi8KK1ZPU19TVEFUVVMgV0xBTlRMX1NUQVJ4QXV0aCggdl9QVk9JRF90ICAgICBwQWRhcHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICAgICAgICB1Y1NUQUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfcGt0X3QqKiAgIHB2b3NEYXRhQnVmZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9CT09MX3QgICAgICBiRm9yd2FyZElBUFB3aXRoTExDKTsKKworLyogVHJhbnNtaXQgaW4gYXV0aGVudGljYXRlZCBzdGF0ZSAtIGFsbCBkYXRhIGFsbG93ZWQqLworVk9TX1NUQVRVUyBXTEFOVExfU1RBVHhBdXRoKCB2X1BWT0lEX3QgICAgIHBBZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgICAgICAgIHVjU1RBSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19wa3RfdCoqICAgcHZvc0RhdGFCdWZmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X0JPT0xfdCAgICAgIGJGb3J3YXJkSUFQUHdpdGhMTEMpOworCisvKiBSZWNlaXZlIGluIGRpc2Nvbm5lY3RlZCBzdGF0ZSAtIG5vIGRhdGEgYWxsb3dlZCovCitWT1NfU1RBVFVTIFdMQU5UTF9TVEFSeERpc2MoIHZfUFZPSURfdCAgICAgcEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVThfdCAgICAgICAgdWNTVEFJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX3BrdF90KiogICBwdm9zRGF0YUJ1ZmYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfQk9PTF90ICAgICAgYkZvcndhcmRJQVBQd2l0aExMQyk7CisKKy8qIF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RnJhbWUgUSBhZ2luZywgdGltZXIgaXMgbmVlZGVkCisgKiBBZnRlciB0aW1lciBleHBpcmVkLCBRZWQgZnJhbWVzIGhhdmUgdG8gYmUgcm91dGVkIHRvIHVwcGVyIGxheWVyCisgKiBXTEFOVExfVElNRVJfRVhQSUVSX1VEQVRBX1QgaXMgdXNlciBkYXRhIHR5cGUgZm9yIHRpbWVyIGNhbGxiYWNrCisgKi8KK3R5cGVkZWYgc3RydWN0Cit7CisgICAvKiBHbG9iYWwgY29udGVjdCwgSEFMLCBIREQgbmVlZCB0aGlzICovCisgICB2X1BWT0lEX3QgICAgICAgICAgcEFkYXB0ZXI7CisKKyAgIC8qIFRMIGNvbnRleHQgaGFuZGxlICovCisgICB2X1BWT0lEX3QgICAgICAgICAgcFRMSGFuZGxlOworCisgICAvKiBDdXJyZW50IFNUQUlELCB0byBrbm93IFNUQSBjb250ZXh0ICovCisgICB2X1UzMl90ICAgICAgICAgICAgU1RBSUQ7CisKKyAgIHZfVThfdCAgICAgICAgICAgICBUSUQ7Cit9IFdMQU5UTF9USU1FUl9FWFBJRVJfVURBVEFfVDsKKwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgLypzcGVjaWZpZXMgaWYgcmUtb3JkZXIgc2Vzc2lvbiBleGlzdHMqLworICB2X1U4X3QgICAgICAgICAgICAgdWNFeGlzdHM7CisKKyAgLyogQ3VycmVudCBJbmRleCAqLworICB2X1UzMl90ICAgICAgICAgICAgIHVjQ0luZGV4OworCisgIC8qIENvdW50IG9mIHRoZSB0b3RhbCBwYWNrZXRzIGluIGxpc3QqLworICB2X1UxNl90ICAgICAgICAgICAgdXNDb3VudDsKKworICAvKiB2b3MgdHRpbWVyIHRvIGhhbmRsZSBRZWQgZnJhbWVzIGFnaW5nICovCisgIHZvc190aW1lcl90ICAgICAgICBhZ2luZ1RpbWVyOworCisgIC8qIFEgd2luZG9lIHNpemUgKi8KKyAgdl9VMzJfdCAgICAgICAgICAgIHdpblNpemU7CisKKyAgLy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eXBlICAgICAgICAgICAgcGZuU1RBUng7CisKKyAgLyogRnVuY3Rpb24gcG9pbnRlciB0byB0aGUgdHJhbnNtaXQgY29tcGxldGUgY29uZmlybWF0aW9uIGhhbmRsZXIKKyAgICBmcm9tIEhERCAqLworICBXTEFOVExfVHhDb21wQ0JUeXBlICAgICAgICAgICBwZm5TVEFUeENvbXA7CisKKyAgLyogRnVuY3Rpb24gcG9pbnRlciB0byB0aGUgcGFja2V0IHJldHJpZXZhbCByb3V0aW5lIGluIEhERCAqLworICBXTEFOVExfU1RBRmV0Y2hQa3RDQlR5cGUgICAgICBwZm5TVEFGZXRjaFBrdDsKKworICAvKiBSZW9yZGVyaW5nIGluZm9ybWF0aW9uIGZvciB0aGUgU1RBICovCisgIFdMQU5UTF9CQVJlb3JkZXJUeXBlICAgICAgICAgIGF0bEJBUmVvcmRlckluZm9bV0xBTl9NQVhfVElEXTsKKworICAvKiBTVEEgRGVzY3JpcHRvciwgY29udGFpbnMgaW5mb3JtYXRpb24gcmVsYXRlZCB0byB0aGUgbmV3IGFkZGVkIFNUQSAqLworICBXTEFOX1NUQURlc2NUeXBlICAgICAgICAgICAgICB3U1RBRGVzYzsKKworICAvKiBDdXJyZW50IGNvbm5lY3Rpdml0eSBzdGF0ZSBvZiB0aGUgU1RBICovCisgIFdMQU5UTF9TVEFTdGF0ZVR5cGUgICAgICAgICAgIHRsU3RhdGU7CisKKyAgLyogU3RhdGlvbiBwcmlvcml0eSAqLworICBXTEFOVExfU1RBUHJpb3JpdHlUeXBlICAgICAgICB0bFByaTsKKworICAvKiBWYWx1ZSBvZiB0aGUgYXZlcmFnZWQgUlNTSSBmb3IgdGhpcyBzdGF0aW9uICovCisgIHZfUzdfdCAgICAgICAgICAgICAgICAgICAgICAgIHJzc2lBdmc7CisKKyAgLyogVmFsdWUgb2YgdGhlIGF2ZXJhZ2VkIFJTU0kgZm9yIHRoaXMgc3RhdGlvbiBpbiBCTVBTICovCisgIHZfUzdfdCAgICAgICAgICAgICAgICAgICAgICAgIHJzc2lBdmdCbXBzOworCisgIC8qIFZhbHVlIG9mIHRoZSBBbHBoYSB0byBjYWxjdWxhdGUgUlNTSSBhdmVyYWdlICovCisgIHZfUzdfdCAgICAgICAgICAgICAgICAgICAgICAgIHJzc2lBbHBoYTsKKworICAvKiBWYWx1ZSBvZiB0aGUgYXZlcmFnZWQgUlNTSSBmb3IgdGhpcyBzdGF0aW9uICovCisgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICAgIHVMaW5rUXVhbGl0eUF2ZzsKKworICAvKiBTdW0gb2YgU05SIGZvciBzbnJJZHggbnVtYmVyIG9mIGNvbnNlY3V0aXZlIGZyYW1lcyAqLworICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgICBzbnJTdW07CisKKyAgLyogTnVtYmVyIG9mIGNvbnNlY3V0aXZlIGZyYW1lcyBvdmVyIHdoaWNoIHNuclN1bSBpcyBjYWxjdWxhdGVkICovCisgIHZfUzdfdCAgICAgICAgICAgICAgICAgICAgICAgIHNucklkeDsKKworICAvKiBBdmVyYWdlIFNOUiBvZiBwcmV2aW91cyAyMCBmcmFtZXMgKi8KKyAgdl9TN190ICAgICAgICAgICAgICAgICAgICAgICAgcHJldlNuckF2ZzsKKworICAvKiBBdmVyYWdlIFNOUiByZXR1cm5lZCBieSBmdyAqLworICB2X1M3X3QgICAgICAgICAgICAgICAgICAgICAgICBzbnJBdmdCbXBzOworCisgIC8qIFR4IHBhY2tldCBjb3VudCBwZXIgc3RhdGlvbiBwZXIgVElEICovCisgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICAgIGF1VHhDb3VudFtXTEFOX01BWF9USURdOworCisgIC8qIFJ4IHBhY2tldCBjb3VudCBwZXIgc3RhdGlvbiBwZXIgVElEICovCisgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICAgIGF1UnhDb3VudFtXTEFOX01BWF9USURdOworCisgIC8qIFN1c3BlbmQgZmxhZyAqLworICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgICB1Y1R4U3VzcGVuZGVkOworCisgIC8qIFBvaW50ZXIgdG8gdGhlIEFNU0RVIGNoYWluIG1haW50YWluZWQgYnkgdGhlIEFNU0RVIGRlLWFnZ3JlZ2F0aW9uCisgICAgIGNvbXBsZXRpb24gc3ViLW1vZHVsZSAqLworICB2b3NfcGt0X3QqICAgICAgICAgICAgICAgICAgICB2b3NBTVNEVUNoYWluUm9vdDsKKworICAvKiBQb2ludGVyIHRvIHRoZSByb290IG9mIHRoZSBjaGFpbiAqLworICB2b3NfcGt0X3QqICAgICAgICAgICAgICAgICAgICB2b3NBTVNEVUNoYWluOworCisgIC8qIFVzZWQgZm9yIHNhdmluZy9yZXN0b3JpbmcgZnJhbWUgaGVhZGVyIGZvciA4MDIuMy8xMSBBTVNEVSBzdWItZnJhbWVzICovCisgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICAgIGF1Y01QRFVIZWFkZXJbV0xBTlRMX01QRFVfSEVBREVSX0xFTl07CisKKyAgLyogbGVuZ3RoIG9mIHRoZSBoZWFkZXIgKi8KKyAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgICAgdWNNUERVSGVhZGVyTGVuOworCisgIC8qIEVuYWJsZWQgQUNzIGN1cnJlbnRseSBzZXJ2aWNlZCBieSBUTCAoYXV0b21hdGljIHNldHVwIGluIFRMKSovCisgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICAgIGF1Y0FDTWFza1tXTEFOVExfTlVNX1RYX1FVRVVFU107CisKKyAgLyogQ3VycmVudCBBQyB0byBiZSByZXRyaWV2ZWQgKi8KKyAgV0xBTlRMX0FDRW51bVR5cGUgICAgICAgICAgICAgdWNDdXJyZW50QUM7CisKKyAgLypQYWNrZXQgcGVuZGluZyBmbGFnIC0gc2V0IGlmIHR4IGlzIHBlbmRpbmcgZm9yIHRoZSBzdGF0aW9uKi8KKyAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgICAgdWNQa3RQZW5kaW5nOworCisgIC8qRUFQT0wgUGFja2V0IHBlbmRpbmcgZmxhZyAtIHNldCBpZiBFQVBPTCBwYWNrZXQgaXMgcGVuZGluZyBmb3IgdGhlIHN0YXRpb24qLworICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgICB1Y0VhcG9sUGt0UGVuZGluZzsKKworICAvKnVzZWQgb24gdHggcGFja2V0IHRvIHNpZ25hbCB3aGVuIHRoZXJlIGlzIG5vIG1vcmUgZGF0YSB0byB0eCBmb3IgdGhlCisgICBtb21lbnQ9PiBwYWNrZXRzIGNhbiBiZSBwYXNzZWQgdG8gQkFMICovCisgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgdWNOb01vcmVEYXRhOworCisgIC8qIExhc3Qgc2VydmljZWQgQUMgdG8gYmUgcmV0cmlldmVkICovCisgIFdMQU5UTF9BQ0VudW1UeXBlICAgICAgICAgICAgIHVjU2VydmljZWRBQzsKKworICAgLyogQ3VycmVudCB3ZWlnaHQgZm9yIHRoZSBBQyAqLworICB2X1U4X3QgICAgICAgICAgICAgICAgICAgICAgICB1Y0N1cnJlbnRXZWlnaHQ7CisKKyAgLyogSW5mbyB1c2VkIGZvciBVQVBTRCB0cmlnZ2VyIGZyYW1lIGdlbmVyYXRpb24gICovCisgIFdMQU5UTF9VQVBTREluZm9UeXBlICAgICAgICAgIHdVQVBTREluZm9bV0xBTlRMX01BWF9BQ107CisKKyAgLyogZmxhZyB0byBzaWduYWwgaWYgYSB0cmlnZ2VyIGZyYW1lcyBpcyBwZW5kaW5nICovCisgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICAgIHVjUGVuZGluZ1RyaWdGcm07CisKKyAgV0xBTlRMX1RSQU5TRkVSX1NUQV9UWVBFICAgICAgdHJhZmZpY1N0YXRpc3RpY3M7CisKKyAgLypNZW1iZXJzIG5lZWRlZCBmb3IgcGFja2V0IGNhY2hpbmcgaW4gVEwqLworICAvKkJlZ2luaW5nIG9mIHRoZSBjYWNoZWQgcGFja2V0cyBjaGFpbiovCisgIHZ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ICAgICAgICAgICAgICAgICAgdm9zUGVuZGluZ0RhdGFCdWZmOworfVdMQU5UTF9NZ210RnJtQ2xpZW50VHlwZTsKKwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgIFdMQU5UTF9UcmFmZmljU3RhdHVzQ2hhbmdlZENCVHlwZSAgdHJhZmZpY0NCOworICAgV0xBTlRMX0hPX1RSQUZGSUNfU1RBVFVTX1RZUEUgICAgICB0cmFmZmljU3RhdHVzOworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZGxlVGhyZXNob2xkOworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZWFzdXJlUGVyaW9kOworICAgdl9VMzJfdCAgICAgICAgICAgICAgICAgICAgICAgICAgICBydFJYRnJhbWVDb3VudDsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnRUWEZyYW1lQ291bnQ7CisgICB2X1UzMl90ICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ydFJYRnJhbWVDb3VudDsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnJ0VFhGcmFtZUNvdW50OworICAgdm9zX3RpbWVyX3QgICAgICAgICAgICAgICAgICAgICAgICB0cmFmZmljVGltZXI7CisgICB2X1BWT0lEX3QgICAgICAgICAgICAgICAgICAgICAgICAgIHVzckN0eHQ7Cit9IFdMQU5UTF9IT19UUkFGRklDX1NUQVRVU19IQU5ETEVfVFlQRTsKKwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgIHZfUzdfdCAgICAgICAgICAgICAgICAgICAgICAgICAgcnNzaVZhbHVlOworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgICAgICB0cmlnZ2VyRXZlbnRbV0xBTlRMX0hTX05VTV9DTElFTlRdOworICAgdl9QVk9JRF90ICAgICAgICAgICAgICAgICAgICAgICB1c3JDdHh0W1dMQU5UTF9IU19OVU1fQ0xJRU5UXTsKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICAgICAgd2hvSXNDbGllbnRbV0xBTlRMX0hTX05VTV9DTElFTlRdOworICAgV0xBTlRMX1JTU0lDcm9zc1RocmVzaG9sZENCVHlwZSBjcm9zc0NCRnVuY3Rpb25bV0xBTlRMX0hTX05VTV9DTElFTlRdOworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgICAgICBudW1DbGllbnQ7Cit9IFdMQU5UTF9IT19SU1NJX0lORElDQVRJT05fVFlQRTsKKwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtVGhyZXNob2xkOworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWdpb25OdW1iZXI7CisgICB2X1M3X3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpc3RvcnlSU1NJOworICAgdl9VOF90ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2FtcGxlVGltZTsKKyAgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgZndOb3RpZmljYXRpb247Cit9IFdMQU5UTF9DVVJSRU5UX0hPX1NUQVRFX1RZUEU7CisKK3R5cGVkZWYgc3RydWN0Cit7CisgICBXTEFOVExfSE9fUlNTSV9JTkRJQ0FUSU9OX1RZUEUgICAgICAgcmVnaXN0ZXJlZEluZFtXTEFOVExfTUFYX0FWQUlMX1RIUkVTSE9MRF07CisgICBXTEFOVExfQ1VSUkVOVF9IT19TVEFURV9UWVBFICAgICAgICAgY3VycmVudEhPU3RhdGU7CisgICBXTEFOVExfSE9fVFJBRkZJQ19TVEFUVVNfSEFORExFX1RZUEUgY3VycmVudFRyYWZmaWM7CisgICB2X1BWT0lEX3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFjQ3R4dDsKKyAgIHZvc19sb2NrX3QgICAgICAgIC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gaXMgc3VwcG9ydGVkLiAqLworICB2b3NfbGlzdF90IHBNQ0JDTWFuYWdlUTsKKworICB2X1UzMl90IHNlbmRGQ0ZyYW1lOworCisgIHZfVThfdCBkb25lX29uY2U7CisgIHZfVThfdCB1RnJhbWVzUHJvY1RocmVzOworI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgIC8qbnVtYmVyIG9mIHRvdGFsIFRETFMgcGVlcnMgcmVnaXN0ZXJlZCB0byBUTAorICAgIEluY3JlbWVudGVkIGF0IFdMQU5UTF9SZWdpc3RlclNUQUNsaWVudChzdGFUeXBlID09IFdMQU5fU1RBX1RETFMpCisgICAgRGVjcmVtZW50ZWQgYXQgV0xBTlRMX0NsZWFyU1RBQ2xpZW50KHN0YVR5cGUgPT0gV0xBTl9TVEFfVERMUykgKi8KKyAgdl9VOF90ICAgICAgICB1Y1RkbHNQZWVyQ291bnQ7CisjZW5kaWYKKyAgLyp3aGV0aGVyIHdlIGFyZSBpbiBCTVBTL1VBUFNEL1dPV0wgbW9kZSwgc2luY2UgdGhlIGxhdHRlciAyIG5lZWQgdG8gYmUgQk1QUyBmaXJzdCovCisgIHZfQk9PTF90ICAgICAgICAgICAgICAgICAgaXNCTVBTOworICAvKiBXaGV0aGVyIFdEQV9EU19UWF9TVEFSVF9YTUlUIG1zZyBpcyBwZW5kaW5nIG9yIG5vdCAqLworICB2X0JPT0xfdCAgIGlzVHhUcmFubWl0TXNnUGVuZGluZzsKKyAgV0xBTlRMX01vblJ4Q0JUeXBlICAgICAgICAgICBwZm5Nb25SeDsKKyAgdl9CT09MX3QgICAgICAgICAgICAgIGlzQ29udmVyc2lvblJlcTsKKworfVdMQU5UTF9DYlR5cGU7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfR2V0RnJhbWVzCisKKyAgREVTQ1JJUFRJT04KKworICAgIEJB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IHN1cHBsaWVkLCBUTAorICAgICAgICAgICAgICAgICAgICB3aWxsIGNoYWluIHRoZW0gdGhyb3VnaCB2T1NTIGJ1ZmZlcnMKKworICBSRVRVUk4gVkFMVUUKKworICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uCisKKyAgICAxIG9yIG1vcmU6IG51bWJlciBvZiByZXF1aXJlZCByZXNvdXJjZXMgaWYgdGhlcmUgYXJlIHN0aWxsIGZyYW1lcyB0byBmZXRjaAorICAgICAgICAgICAgICAgRm9yIFZvbGFucywgaXQncyBCRC9QRFUgbnVtYmVycy4gRm9yIFByaW1hLCBpdCdzIGZyZWUgRFhFIGRlc2NyaXB0b3JzLgorICAgIDAgOiBlcnJvciBvciBIREQgcXVldWVzIGFyZSBkcmFpbmVkCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordl9VMzJfdAorV0xBTlRMX0dldEZyYW1lcworKAorICB2X1BWT0lEX3QgICAgICAgcEFkYXB0ZXIsCisgIHZvc19wa3RfdCAgICAgKipwcEZyYW1lRGF0YUJ1ZmYsCisgIHZfVTMyX3QgICAgICAgICB1U2l6ZSwKKyAgdl9VOF90ICAgICAgICAgIHVGbG93TWFzaywKKyAgdl9CT09MX3QqICAgICAgIHBiVXJnZW50CispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX1R4Q29tcAorCisgIERFU0NSSVBUSU9OCisgICAgSXQgaXMgYmVpbmcgY2FsbGVkIGJ5IEJBTCB1cG9uIGFzeW5jaHJvbm91cyBub3RpZmljYXRpb24gb2YgdGhlIHBhY2tldAorICAgIG9yIHBhY2tldHMgIGJ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IGhhbmRsZSB0byBUTCdzCisgICAgICAgICAgICAgICAgICAgIG9yIEJBTCdzIGNvbnRyb2wgYmxvY2sgY2FuIGJlIGV4dHJhY3RlZCBmcm9tIGl0cyBjb250ZXh0CisKKyAgICB2b3NEYXRhQnVmZjogICBpdCB3aWxsIGNvbnRhaW4gYSBwb2ludGVyIHRvIHRoZSBmaXJzdCBidWZmZXIgcmVjZWl2ZWQsCisgICAgICAgICAgICAgICAgICAgIGlmIHRoZXJlIGlzIG1vcmUgdGhlbiBvbmUgcGFja2V0IHRoZXkgd2lsbCBiZSBjaGFpbmVkCisgICAgICAgICAgICAgICAgICAgIHVzaW5nIHZPU1MgYnVmZmVycy4KKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5UTF9SeEZyYW1lcworKAorICB2X1BWT0lEX3QgICAgICBwQWRhcHRlciwKKyAgdm9zX3BrdF90ICAgICAqcEZyYW1lRGF0YUJ1ZmYKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfUnhDYWNoZWRGcmFtZXMKKworICBERVNDUklQVElPTgorICAgIFV0aWxpdHkgZnVuY3Rpb24gdXNlZCBieSBUTCB0byBmb3J3YXJkIHRoZSBjYWNoZWQgZnJhbWVzIHRvIGEgcGFydGljdWxhcgorICAgIHN0YXRpb247CisKKyAgREVQRU5ERU5DSUVTCisgICAgVEwgbXVzdCBiZSBpbml0aWFpbGl6ZWQgYmVmb3JlIHRoaXMgZnVuY3Rpb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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5UTF9SeENhY2hlZEZyYW1lcworKAorICBXTEFOVExfQ2JUeXBlKiAgcFRMQ2IsCisgIHZfVThfdCAgICAgICAgICB1Y1NUQUlkLAorICB2b3NfcGt0X3QqICAgICAgdm9zRGF0YUJ1ZmYKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlRMX1Jlc291cmNlQ0IKKworICBERVNDUklQVElPTgorICAgIENhbGxlZCBieSB0aGUgVEwgd2hlbiBpdCBoYXMgcGFja2V0cyBhdmFpbGFibGUgZm9yIHRyYW5zbWlzc2lvbi4KKworICBERVBFTkRFTkNJRVMKKyAgICBUaGUgVEwgbXVzdCBiZSByZWdpc3RlcmVkIHdpdGggQkFMIGJlZm9yZSB0aGlzIGZ1bmN0aW9uIGNhbiBiZSBjYWxsZWQuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICBwQWRhcHRlcjogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIGFkYXB0ZXIgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgICBvciBCQUwncyBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICAgIHVDb3VudDogICAgICAgICBhdmFpbCByZXNvdXJjZSBjb3VudCBvYnRhaW5lZCBmcm9tIGh3CisKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfUmVzb3VyY2VDQgorKAorICB2X1BWT0lEX3QgICAgICAgcEFkYXB0ZXIsCisgIHZfVTMyX3QgICAgICAgICB1Q291bnQKKyk7CisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOVExfUHJvY2Vzc01haW5NZXNzYWdlCisKKyAgREVTQ1JJUFRJT04KKyAgICBDYWxsZWQgYnkgVk9TUyB3aGVuIGEgbWVzc2FnZSB3YXMgc2VyaWFsaXplZCBmb3IgVEwgdGhyb3VnaCB0aGUKKyAgICBtYWluIHRocmVhZC90YXNrLgorCisgIERFUEVOREVOQ0lFUworICAgIFRoZSBUTCBtdXN0IGJlIGluaXRpYWxpemVkIGJlZm9yZSB0aGlzIGZ1bmN0aW9uIGNhbiBiZSBjYWxsZWQuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICBwQWRhcHRlcjogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIGFkYXB0ZXIgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICAgIG1lc3NhZ2U6ICAgICAgICB0eXBlIGFuZCBjb250ZW50IG9mIHRoZSBtZXNzYWdlCisKKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5UTF9Qcm9jZXNzTWFpbk1lc3NhZ2UKKygKKyAgdl9QVk9JRF90ICAgICAgICBwQWRhcHRlciwKKyAgdm9zX21zZ190KiAgICAgICBtZXNzYWdlCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5UTF9Qcm9jZXNzVHhNZXNzYWdlCisKKyAgREVTQ1JJUFRJT04KKyAgICBDYWxsZWQgYnkgVk9TUyB3aGVuIGEgbWVzc2FnZSB3YXMgc2VyaWFsaXplZCBmb3IgVEwgdGhyb3VnaCB0aGUKKyAgICB0eCB0aHJlYWQvdGFzay4KKworICBERVBFTkRFTkNJRVMKKyAgICBUaGUgVEwgbXVzdCBiZSBpbml0aWFsaXplZCBiZWZvcmUgdGhpcyBmdW5jdGlvbiBjYW4gYmUgY2FsbGVkLgorCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcEFkYXB0ZXI6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCBhZGFwdGVyIGNvbnRleHQ7IGEgaGFuZGxlIHRvIFRMJ3MKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQKKyAgICBtZXNzYWdlOiAgICAgICAgdHlwZSBhbmQgY29udGVudCBvZiB0aGUgbWVzc2FnZQorCisKKyAgUkVUVVJOIFZBTFVFCisKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlRMX1Byb2Nlc3NUeE1lc3NhZ2UKKygKKyAgdl9QVk9JRF90ICAgICAgICBwQWRhcHRlciwKKyAgdm9zX21zZ190KiAgICAgICBtZXNzYWdlCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5fVExHZXROZXh0VHhJZHMKKworICBERVNDUklQVElPTgorICAgIEdldHMgdGhlIG5leHQgc3RhdGlvbiBhbmQgbmV4dCBBQyBpbiB0aGUgbGlzdAorCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgT1VUCisgICBwdWNTVEFJZDogICAgU1RBdGlvbiBJRAorCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTl9UTEdldE5leHRUeElkcworKAorICB2X1BWT0lEX3QgICAgcEFkYXB0ZXIsCisgIHZfVThfdCogICAgICBwdWNTVEFJZAorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5UTF9DbGVhbkNiCisKKyAgREVTQ1JJUFRJT04KKyAgICBDbGVhbnMgVEwgY29udHJvbCBibG9jaworCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgIElOCisgICAgcFRMQ2I6ICAgICAgIHBvaW50ZXIgdG8gVEwncyBjb250cm9sIGJsb2NrCisgICAgdWNFbXB0eTogICAgIHNldCBpZiBUTCBoYXMgdG8gY2xlYW4gdXAgdGhlIHF1ZXVlcyBhbmQgcmVsZWFzZSBwZWRuaW5nIHBrdHMKKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5UTF9DbGVhbkNCCisoCisgIFdMQU5UTF9DYlR5cGUqICBwVExDYiwKKyAgdl9VOF90ICAgICAgICAgIHVjRW1wdHkKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfQ2xlYW5TVEEKKworICBERVNDUklQVElPTgorICAgIENsZWFucyBhIHN0YXRpb24gY29udHJvbCBibG9jay4KKworICBERVBFTkRFTkNJRVMKKworICBQQVJBTUVURVJTCisKKyAgICBJTgorICAgIHBBZGFwdGVyOiAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgYWRhcHRlciBjb250ZXh0OyBhIGhhbmRsZSB0byBUTCdzCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wgYmxvY2sgY2FuIGJlIGV4dHJhY3RlZCBmcm9tIGl0cyBjb250ZXh0CisgICAgdWNFbXB0eTogICAgICAgIGlmIHNldCB0aGUgcXVldWVzIGFuZCBwZW5kaW5nIHBrdHMgd2lsbCBiZSBlbXB0eWVkCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfQ2xlYW5TVEEKKygKKyAgV0xBTlRMX1NUQUNsaWVudFR5cGUqICBwdGxTVEFDbGllbnQsCisgIHZfVThfdCAgICAgICAgICAgICAgICAgdWNFbXB0eQorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOVExfR2V0VHhSZXNvdXJjZXNDQgorCisgIERFU0NSSVBUSU9OCisgICAgUHJvY2Vzc2luZyBmdW5jdGlvbiBmb3IgUmVzb3VyY2UgbmVlZGVkIHNpZ25hbC4gQSByZXF1ZXN0IHdpbGwgYmUgaXNzdWVkCisgICAgdG8gQkFMIHRvIGdldCBtb3IgdHggcmVzb3VyY2VzLgorCisgIERFUEVOREVOQ0lFUworICAgIFRoZSBUTCBtdXN0IGJlIGluaXRpYWxpemVkIGJlZm9yZSB0aGlzIGZ1bmN0aW9uIGNhbiBiZSBjYWxsZWQuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICBwdm9zR0N0eDogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIHZvcyBjb250ZXh0OyBhIGhhbmRsZSB0byBUTCdzCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wgYmxvY2sgY2FuIGJlIGV4dHJhY3RlZCBmcm9tIGl0cyBjb250ZXh0CisKKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgIHBvaW50ZXIgdG8gVEwgY2IgaXMgTlVMTCA7IGFjY2VzcyB3b3VsZCBjYXVzZSBhCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2UgZmF1bHQKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICAgRXZlcnl0aGluZyBpcyBnb29kIDopCisKKyAgT3RoZXIgdmFsdWVzIGNhbiBiZSByZXR1cm5lZCBhcyBhIHJlc3VsdCBvZiBhIGZ1bmN0aW9uIGNhbGwsIHBsZWFzZSBjaGVjaworICBjb3JyZXNwb25kaW5nIEFQSSBmb3IgbW9yZSBpbmZvLgorICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfR2V0VHhSZXNvdXJjZXNDQgorKAorICB2X1BWT0lEX3QgICAgICAgIHB2b3NHQ3R4CispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5UTF9QcmVwYXJlQkRIZWFkZXIKKworICBERVNDUklQVElPTgorICAgIENhbGxiYWNrIGZ1bmN0aW9uIGZvciBzZXJpYWxpemluZyBTdXNwZW5kIHNpZ25hbCB0aHJvdWdoIFR4IHRocmVhZAorCisgIERFUEVOREVOQ0lFUworICAgIEp1c3Qgbm90aWZ5IEhBTCB0aGF0IHN1c3BlbmQgaW4gVEwgaXMgY29tcGxldGUuCisKKyAgUEFSQU1FVEVSUworCisgICBJTgorICAgcEFkYXB0ZXI6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCBhZGFwdGVyIGNvbnRleHQ7IGEgaGFuZGxlIHRvIFRMJ3MKKyAgICAgICAgICAgICAgICAgICBjb250cm9sIGJsb2NrIGNhbiBiZSBleHRyYWN0ZWQgZnJvbSBpdHMgY29udGV4dAorICAgcFVzZXJEYXRhOiAgICAgIHVzZXIgZGF0YSBzZW50IHdpdGggdGhlIGNhbGxiYWNrCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkCitXTEFOVExfUHJlcGFyZUJESGVhZGVyCisoCisgIHZvc19wa3RfdCogICAgICB2b3NEYXRhQnVmZiwKKyAgdl9QVk9JRF90KiAgICAgIHBwdkJESGVhZGVyLAorICB2X01BQ0FERFJfdCogICAgcHZEZXN0TWFjQWRkZHIsCisgIHZfVThfdCAgICAgICAgICB1Y0Rpc2FibGVGcm1YdGwsCisgIFZPU19TVEFUVVMqICAgICBwdm9zU1RBdHVzLAorICB2X1UxNl90KiAgICAgICAgdXNQa3RMZW4sCisgIHZfVThfdCAgICAgICAgICB1Y1Fvc0VuYWJsZWQsCisgIHZfVThfdCAgICAgICAgICB1Y1dEU0VuYWJsZWQsCisgIHZfVThfdCAgICAgICAgICBleHRyYUhlYWRTcGFjZQorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOVExfVHJhbnNsYXRlODAyM1RvODAyMTFIZWFkZXIKKworICBERVNDUklQVElPTgorICAgIElubGluZSBmdW5jdGlvbiBmb3IgdHJhbnNsYXRpbmcgYW5kIDgwMi4zIGhlYWRlciBpbnRvIGFuIDgwMi4xMSBoZWFkZXIuCisKKyAgREVQRU5ERU5DSUVTCisKKworICBQQVJBTUVURVJTCisKKyAgIElOCisgICAgcFRMQ2I6ICAgICAgICAgICAgVEwgY29udHJvbCBibG9jaworCisgICAgKnB1Y1N0YUlkICAgICAgICAgU3RhdGlvbiBJRC4gSW4gY2FzZSBvZiBURExTLCB0aGlzIHJldHVybiB0aGUgYWN0dWFsCisgICAgICAgICAgICAgICAgICAgICAgc3RhdGlvbiBpbmRleCB1c2VkIHRvIHRyYW5zbWl0LgorCisgICBJTi9PVVQKKyAgICB2b3NEYXRhQnVmZjogICAgICB2b3MgZGF0YSBidWZmZXIsIHdpbGwgY29udGFpbiB0aGUgbmV3IGhlYWRlciBvbiBvdXRwdXQKKworICAgT1VUCisgICAgcHZvc1N0YXR1czogICAgICAgc3RhdHVzIG9mIHRoZSBvcGVyYXRpb24KKworICBSRVRVUk4gVkFMVUUKKyAgICBObyByZXR1cm4uCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlRMX1RyYW5zbGF0ZTgwMjNUbzgwMjExSGVhZGVyCisoCisgIHZvc19wa3RfdCogICAgICB2b3NEYXRhQnVmZiwKKyAgVk9TX1NUQVRVUyogICAgIHB2b3NTdGF0dXMsCisgIFdMQU5UTF9DYlR5cGUqICBwVExDYiwKKyAgdl9VOF90ICAgICAgICAgICpwdWNTdGFJZCwKKyAgV0xBTlRMX01ldGFJbmZvVHlwZSogcFRsTWV0YUluZm8sCisgIHZfVThfdCAgICAgICAgICAqdWNXRFNFbmFibGVkLAorICB2X1U4X3QgICAgICAgICAgKmV4dHJhSGVhZFNwYWNlCispOworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOVExfVHJhbnNsYXRlODAyMTFUbzgwMjNIZWFkZXIKKworICBERVNDUklQVElPTgorICAgIElubGluZSBmdW5jdGlvbiBmb3IgdHJhbnNsYXRpbmcgYW5kIDgwMi4xMSBoZWFkZXIgaW50byBhbiA4MDIuMyBoZWFkZXIuCisKKyAgREVQRU5ERU5DSUVTCisKKworICBQQVJBTUVURVJTCisKKyAgIElOCisgICAgcFRMQ2I6ICAgICAgICAgICAgVEwgY29udHJvbCBibG9jaworICAgIHVjU3RhSWQ6ICAgICAgICAgIHN0YXRpb24gSUQKKyAgICB1Y0hlYWRlckxlbjogICAgICBMZW5ndGggb2YgdGhlIGhlYWRlciBmcm9tIEJECisgICAgdWNBY3R1YWxITGVuOiAgICAgTGVuZ3RoIG9mIGhlYWRlciBpbmNsdWRpbmcgcGFkZGluZyBvciBhbnkgb3RoZXIgdHJhaWxlcnMKKworICAgSU4vT1VUCisgICAgdm9zRGF0YUJ1ZmY6ICAgICAgdm9zIGRhdGEgYnVmZmVyLCB3aWxsIGNvbnRhaW4gdGhlIG5ldyBoZWFkZXIgb24gb3V0cHV0CisKKyAgIE9VVAorICAgIHB2b3NTdGF0dXM6ICAgICAgIHN0YXR1cyBvZiB0aGUgb3BlcmF0aW9uCisKKyAgUkVUVVJOIFZBTFVFCisgICAgU3RhdHVzIG9mIHRoZSBvcGVyYXRpb24KKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfVHJhbnNsYXRlODAyMTFUbzgwMjNIZWFkZXIKKygKKyAgdm9zX3BrdF90KiAgICAgIHZvc0RhdGFCdWZmLAorICBWT1NfU1RBVFVTKiAgICAgcHZvc1N0YXR1cywKKyAgdl9VMTZfdCAgICAgICAgIHVzQWN0dWFsSExlbiwKKyAgdl9VOF90ICAgICAgICAgIHVjSGVhZGVyTGVuLAorICBXTEFOVExfQ2JUeXBlKiAgcFRMQ2IsCisgIHZfVThfdCAgICAgICAgICB1Y1NUQUlkLAorICB2X0JPT0xfdCAgICAgICBiRm9yd2FyZElBUFB3aXRoTExDCispOworCitWT1NfU1RBVFVTCitXTEFOVExfTW9uVHJhbnNsYXRlODAyMTFUbzgwMjNIZWFkZXIKKygKKyAgdm9zX3B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hY3QgaW5mbyBmcm9tIGRhdGEgYnVmZmVyCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgIHN1Y2Nlc3MKKworICBTSURFIEVGRkVDVFMKKyAgICBOb25lLgorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfRmluZEZyYW1lVHlwZUJjTWNVYworKAorICBXTEFOVExfQ2JUeXBlICpwVExDYiwKKyAgdl9VOF90ICAgICAgICB1Y1NUQUlkLAorICB2b3NfcGt0X3QgICAgICp2b3NEYXRhQnVmZiwKKyAgdl9VOF90ICAgICAgICAqcHVjQmNNY1VjCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX01nbXRGcm1SeERlZmF1bHRDYgorCisgIERFU0NSSVBUSU9OCisgICAgRGVmYXVsdCBNZ210IEZybSByeCBjYWxsYmFjazogYXNzZXJ0cyBhbGwgdGhlIHRpbWUuIElmIHRoaXMgZnVuY3Rpb24gZ2V0cworICAgIGNhbGxlZCAgaXQgbWVhbnMgdGhlcmUgaXMgbm8gcmVnaXN0ZXJlZCByeCBjYiBwb2ludGVyIGZvciBNZ210IEZybS4KKworICBERVBFTkRFTkNJRVMKKworICBQQVJBTUVURVJTCisKKyAgICBOb3QgdXNlZC4KKworICBSRVRVUk4gVkFMVUUKKyAgIEFsd2F5cyBGQUlMVVJFLgorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5UTF9NZ210RnJtUnhEZWZhdWx0Q2IKKygKKyAgdl9QVk9JRF90ICBwQWRhcHRlciwKKyAgdl9QVk9JRF90ICB2b3NCdWZmCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX1NUQVJ4RGVmYXVsdENiCisKKyAgREVTQ1JJUFRJT04KKyAgICBEZWZhdWx0IEJBUCByeCBjYWxsYmFjazogYXNzZXJ0cyBhbGwgdGhlIHRpbWUuIElmIHRoaXMgZnVuY3Rpb24gZ2V0cworICAgIGNhbGxlZCAgaXQgbWVhbnMgdGhlcmUgaXMgbm8gcmVnaXN0ZXJlZCByeCBjYiBwb2ludGVyIGZvciBCQVAuCisKKyAgREVQRU5ERU5DSUVTCisKKyAgUEFSQU1FVEVSUworCisgICAgTm90IHVzZWQuCisKKyAgUkVUVVJOIFZBTFVFCisgICBBbHdheXMgRkFJTFVSRS4KKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfQkFQUnhEZWZhdWx0Q2IKKygKKyAgdl9QVk9JRF90ICAgIHBBZGFwdGVyLAorICB2b3NfcGt0X3QqICAgdm9zRGF0YUJ1ZmYsCisgIFdMQU5UTF9CQVBGcmFtZUVudW1UeXBlIGZyYW1lVHlwZQorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5UTF9TVEFSeERlZmF1bHRDYgorCisgIERFU0NSSVBUSU9OCisgICAgRGVmYXVsdCBTVEEgcnggY2FsbGJhY2s6IGFzc2VydHMgYWxsIHRoZSB0aW1lLiBJZiB0aGlzIGZ1bmN0aW9uIGdldHMKKyAgICBjYWxsZWQgIGl0IG1lYW5zIHRoZXJlIGlzIG5vIHJlZ2lzdGVyZWQgcnggY2IgcG9pbnRlciBmb3Igc3RhdGlvbi4KKyAgICAoTWVtIGNvcnJ1cHRpb24gbW9zdCBsaWtlbHksIGl0IHNob3VsZCBuZXZlciBoYXBwZW4pCisKKyAgREVQRU5ERU5DSUVTCisKKyAgUEFSQU1FVEVSUworCisgICAgTm90IHVzZWQuCisKKyAgUkVUVVJOIFZBTFVFCisgICBBbHdheXMgRkFJTFVSRS4KKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfU1RBUnhEZWZhdWx0Q2IKKygKKyAgdl9QVk9JRF90ICAgICAgICAgICAgICAgcEFkYXB0ZXIsCisgIHZvc19wa3RfdCogICAgICAgICAgICAgIHZvc0RhdGFCdWZmLAorICB2X1U4X3QgICAgICAgICAgICAgICAgICB1Y1NUQUlkLAorICBXTEFOVExfUnhNZXRhSW5mb1R5cGUqICBwUnhNZXRhSW5mbworKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5UTF9TVEFGZXRjaFBrdERlZmF1bHRDYgorCisgIERFU0NSSVBUSU9OCisgICAgRGVmYXVsdCBmZXRjaCBjYWxsYmFjazogYXNzZXJ0cyBhbGwgdGhlIHRpbWUuIElmIHRoaXMgZnVuY3Rpb24gZ2V0cworICAgIGNhbGxlZCAgaXQgbWVhbnMgdGhlcmUgaXMgbm8gcmVnaXN0ZXJlZCBmZXRjaCBjYiBwb2ludGVyIGZvciBzdGF0aW9uLgorICAgIChNZW0gY29ycnVwdGlvbiBtb3N0IGxpa2VseSwgaXQgc2hvdWxkIG5ldmVyIGhhcHBlbikKKworICBERVBFTkRFTkNJRVMKKworICBQQVJBTUVURVJTCisKKyAgICBOb3QgdXNlZC4KKworICBSRVRVUk4gVkFMVUUKKyAgIEFsd2F5cyBGQUlMVVJFLgorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5UTF9TVEFGZXRjaFBrdERlZmF1bHRDYgorKAorICB2X1BWT0lEX3QgICAgICAgICAgICAgIHBBZGFwdGVyLAorICB2X1U4X3QqICAgICAgICAgICAgICAgIHB1Y1NUQUlkLAorICBXTEFOVExfQUNFbnVtVHlwZSAgICAgIHVjQUMsCisgIHZvc19wa3RfdCoqICAgICAgICAgICAgdm9zRGF0YUJ1ZmYsCisgIFdMQU5UTF9NZXRhSW5mb1R5cGUqICAgdGxNZXRhSW5mbworKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5UTF9UeENvbXBEZWZhdWx0Q2IKKworICBERVNDUklQVElPTgorICAgIERlZmF1bHQgdHggY29tcGxldGUgaGFuZGxlci4gSXQgd2lsbCByZWxlYXNlIHRoZSBjb21wbGV0ZWQgcGt0IHRvCisgICAgcHJldmVudCBtZW1vcnkgbGVha3MuCisKKyAgUEFSQU1FVEVSUworCisgICAgSU4KKyAgICBwQWRhcHRlcjogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIGFkYXB0ZXIgY29udGV4dDsgYSBoYW5kbGUgdG8KKyAgICAgICAgICAgICAgICAgICAgVEwvSEFML1BFL0JBUC9IREQgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20KKyAgICAgICAgICAgICAgICAgICAgaXRzIGNvbnRleHQKKyAgICB2b3NEYXRhQnVmZjogICBwb2ludGVyIHRvIHRoZSBWT1NTIGRhdGEgYnVmZmVyIHRoYXQgd2FzIHRyYW5zbWl0dGVkCisgICAgd1R4U1RBdHVzOiAgICAgIHN0YXR1cyBvZiB0aGUgdHJhbnNtaXNzaW9uCisKKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbjsgcGxlYXNlCisgICAgY2hlY2sgdm9zX3BrdF9yZXR1cm5fcGt0IGZvciBwb3NzaWJsZSBlcnJvciBjb2Rlcy4KKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfVHhDb21wRGVmYXVsdENiCisoCisgdl9QVk9JRF90ICAgICAgcEFkYXB0ZXIsCisgdm9zX3BrdF90KiAgICAgdm9zRGF0YUJ1ZmYsCisgVk9TX1NUQVRVUyAgICAgd1R4U1RBdHVzCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX1BhY2tVcFRyaWdnZXJGcmFtZQorCisgIERFU0NSSVBUSU9OCisgICAgUGFja3MgdXAgYSB0cmlnZ2VyIGZyYW1lIGFuZCBwbGFjZXMgaXQgaW4gVEwncyBjYWNoZSBmb3IgdHggYW5kIG5vdGlmaWVzCisgICAgQkFMCisKKyAgREVQRU5ERU5DSUVTCisKKyAgUEFSQU1FVEVSUworCisgIElOCisgICAgcFRMQ2I6ICAgICAgICAgcG9pbnRlciB0byB0aGUgVEwgY29udHJvbCBibG9jaworICAgIHBmblNUQVR4Q29tcDogIFR4IENvbXBsZXRlIENiIHRvIGJlIHVzZWQgd2hlbiBmcmFtZSBpcyByZWNlaXZlZAorICAgIHVjU1RBSWQ6ICAgICAgIHN0YXRpb24gaWQKKyAgICB1Y0FDOiAgICAgICAgICBhY2Nlc3MgY2F0ZWdvcnkKKworICBSRVRVUk4gVkFMVUUKKyAgICBOb25lCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlRMX1BhY2tVcFRyaWdnZXJGcmFtZQorKAorICBXTEFOVExfQ2JUeXBlKiAgICAgICAgICAgIHBUTENiLAorICBXTEFOVExfVHhDb21wQ0JUeXBlICAgICAgIHBmblNUQVR4Q29tcCwKKyAgdl9VOF90ICAgICAgICAgICAgICAgICAgICB1Y1NUQUlkLAorICBXTEFOVExfQUNFbnVtVHlwZSAgICAgICAgIHVjQUMKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfVHhDb21wVHJpZ2dGcmFtZVNJCisKKyAgREVTQ1JJUFRJT04KKyAgICBUeCBjb21wbGV0ZSBoYW5kbGVyIGZvciB0aGUgc2VydmljZSBpbnRlcnZhbCB0cmlnZ2VyIGZyYW1lLgorICAgIEl0IHdpbGwgcmVzdGFydCB0aGUgU0kgdGltZXIuCisKKyAgUEFSQU1FVEVSUworCisgICBJTgorICAgIHB2b3NHQ3R4OiAgICAgICBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdm9zIGNvbnRleHQ7IGEgaGFuZGxlIHRvCisgICAgICAgICAgICAgICAgICAgIFRML0hBTC9QRS9CQVAvSEREIGNvbnRyb2wgYmxvY2sgY2FuIGJlIGV4dHJhY3RlZCBmcm9tCisgICAgICAgICAgICAgICAgICAgIGl0cyBjb250ZXh0CisgICAgdm9zRGF0YUJ1ZmY6ICAgcG9pbnRlciB0byB0aGUgVk9TUyBkYXRhIGJ1ZmZlciB0aGF0IHdhcyB0cmFuc21pdHRlZAorICAgIHdUeFNUQXR1czogICAgICBzdGF0dXMgb2YgdGhlIHRyYW5zbWlzc2lvbgorCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVGhlIHJlc3VsdCBjb2RlIGFzc29jaWF0ZWQgd2l0aCBwZXJmb3JtaW5nIHRoZSBvcGVyYXRpb24KKworID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlRMX1R4Q29tcFRyaWdnRnJhbWVTSQorKAorICB2X1BWT0lEX3QgICAgICBwdm9zR0N0eCwKKyAgdm9zX3BrdF90KiAgICAgdm9zRGF0YUJ1ZmYsCisgIFZPU19TVEFUVVMgICAgIHdUeFNUQXR1cworKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIEZVTkNUSU9OICAgIFdMQU5UTF9UeENvbXBUcmlnZ0ZyYW1lU0kKKworICBERVNDUklQVElPTgorICAgIFR4IGNvbXBsZXRlIGhhbmRsZXIgZm9yIHRoZSBzZXJ2aWNlIGludGVydmFsIHRyaWdnZXIgZnJhbWUuCisgICAgSXQgd2lsbCByZXN0YXJ0IHRoZSBTSSB0aW1lci4KKworICBQQVJBTUVURVJTCisKKyAgIElOCisgICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8KKyAgICAgICAgICAgICAgICAgICAgVEwvSEFML1BFL0JBUC9IREQgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20KKyAgICAgICAgICAgICAgICAgICAgaXRzIGNvbnRleHQKKyAgICB2b3NEYXRhQnVmZjogICBwb2ludGVyIHRvIHRoZSBWT1NTIGRhdGEgYnVmZmVyIHRoYXQgd2FzIHRyYW5zbWl0dGVkCisgICAgd1R4U1RBdHVzOiAgICAgIHN0YXR1cyBvZiB0aGUgdHJhbnNtaXNzaW9uCisKKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbgorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5UTF9UeENvbXBUcmlnZ0ZyYW1lREkKKygKKyB2X1BWT0lEX3QgICAgICBwdm9zR0N0eCwKKyB2b3NfcGt0X3QqICAgICB2b3NEYXRhQnVmZiwKKyBWT1NfU1RBVFVTICAgICB3VHhTVEF0dXMKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgRlVOQ1RJT04KKworICAgREVTQ1JJUFRJT04gICBSZWFkIFJTU0kgdmFsdWUgb3V0IG9mIGEgUlggQkQKKworICAgUEFSQU1FVEVSUzogQ2FsbGVyIG11c3QgdmFsaWRhdGUgYWxsIHBhcmFtZXRlcnMKKworICAgUkVUVVJOIFZBTFVFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXTEFOVExfUmVhZFJTU0kKKygKKyAgIHZfUFZPSURfdCAgICAgICAgcEFkYXB0ZXIsCisgICB2X1BWT0lEX3QgICAgICAgIHBCREhlYWRlciwKKyAgIHZfVThfdCAgICAgICAgICAgU1RBaWQKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgRlVOQ1RJT04KKworICAgREVTQ1JJUFRJT04gICBSZWFkIFNOUiB2YWx1ZSBvdXQgb2YgYSBSWCBCRAorCisgICBQQVJBTUVURVJTOiBDYWxsZXIgbXVzdCB2YWxpZGF0ZSBhbGwgcGFyYW1ldGVycworCisgICBSRVRVUk4gVkFMVUUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdMQU5UTF9SZWFkU05SCisoCisgICB2X1BWT0lEX3QgICAgICAgIHBBZGFwdGVyLAorICAgdl9QVk9JRF90ICAgICAgICBwQkRIZWFkZXIsCisgICB2X1U4X3QgICAgICAgICAgIFNUQWlkCispOworCisKK3ZvaWQgV0xBTlRMX1Bvd2VyU3RhdGVDaGFuZ2VkQ0IKKygKKyAgIHZfUFZPSURfdCBwQWRhcHRlciwKKyAgIHRQbWNTdGF0ZSBuZXdTdGF0ZQorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgIFdMQU5UTF9Gd2RQa3RUb0hERAorCisgIERFU0NSSVBUSU9OCisgICAgRGV0ZXJtaW5lIHRoZSBEZXN0YXRpb24gU3RhdGlvbiBJRCBhbmQgcm91dGUgdGhlIEZyYW1lIHRvIFVwcGVyIExheWVyCisKKyAgREVQRU5ERU5DSUVTCisKKyAgUEFSQU1FVEVSUworCisgICBJTgorICAgcHZvc0dDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCB2b3MgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncworICAgICAgICAgICAgICAgICAgIGNvbnRyb2wgYmxvY2sgY2FuIGJlIGV4dHJhY3RlZCBmcm9tIGl0cyBjb250ZXh0CisgICB1Y1NUQUlkOiAgICAgICAgaWRlbnRpZmllciBvZiB0aGUgc3RhdGlvbiBiZWluZyBwcm9jZXNzZWQKKyAgIHZvc0RhdGFCdWZmOiAgIHBvaW50ZXIgdG8gdGhlIHJ4IHZvcyBidWZmZXIKKworICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGU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TIFNPRlRXQVJFLgorICovCisKKy8qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisjaWZuZGVmIFdMQU5fUUNUX1RMSV9CQV9ICisjZGVmaW5lIFdMQU5fUUNUX1RMSV9CQV9ICisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgIFcgTCBBIE4gICBUIFIgQSBOIFMgUCBPIFIgVCAgIEwgQSBZIEUgUiAKKyAgICAgICAgICAgICAgIEIgTCBPIEMgSyAgIEEgQyBLICAgIEkgTiBUIEUgUiBOIEEgTCAgQSBQIEkKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAKK0RFU0NSSVBUSU9OCisgIFRoaXMgZmlsZSBjb250YWlucyB0aGUgaW50ZXJuYWwgZGVjbGFyYXRpb25zIHVzZWQgd2l0aGluIHdsYW4gdHJhbnNwb3J0IAorICBsYXllciBtb2R1bGUgZm9yIEJBIHNlc3Npb24gc3VwcG9ydCwgQU1TRFUgZGUtYWdncmVnYXRpb24gYW5kIAorICBNU0RVIHJlb3JkZXJpbmcuCisgICAgICAgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisgICRIZWFkZXI6JCAkRGF0ZVRpbWU6ICQgJEF1dGhvcjogJAorCisKK3doZW4gICAgICAgIHdobyAgICB3aGF0LCB3aGVyZSwgd2h5CistLS0tLS0tLSAgICAtLS0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorMDgvMjIvMDggICAgc2NoICAgICBVcGRhdGUgYmFzZWQgb24gdW5pdCB0ZXN0CiswNy8zMS8wOCAgICBsdGkgICAgIENyZWF0ZWQgbW9kdWxlLgorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgICAgICBJTkNMVURFIEZJTEVTIEZPUiBNT0RVTEUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKiBJbmNsdWRlIEZpbGVzCisgKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKy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MVDogICAgICBTdGF0aW9uIElEIGlzIG91dHNpZGUgYXJyYXkgYm91bmRhcmllcyBvciBwb2ludGVyIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byBUTCBjYiBpcyBOVUxMIDsgYWNjZXNzIHdvdWxkIGNhdXNlIGEgcGFnZSBmYXVsdCAgCisgICAgVk9TX1NUQVRVU19FX0VYSVNUUzogICAgIFN0YXRpb24gd2FzIG5vdCByZWdpc3RlcmVkIG9yIEJBIHNlc3Npb24gYWxyZWFkeQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleGlzdHMKKyAgICBWT1NfU1RBVFVTX0VfTk9TVVBQT1JUOiAgTm90IHlldCBzdXBwb3J0ZWQKKyAgICAKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0xBTlRMX0JhU2Vzc2lvbkFkZCAKKyggCisgIHZfUFZPSURfdCAgIHB2b3NHQ3R4LCAKKyAgdl9VMTZfdCAgICAgc2Vzc2lvbklELAorICB2X1UzMl90ICAgICB1Y1NUQUlkLAorICB2X1U4X3QgICAgICB1Y1RpZCwgCisgIHZfVTMyX3QgICAgIHVCdWZmZXJTaXplLAorICB2X1UzMl90ICAgICB3aW5TaXplLAorICB2X1UzMl90ICAgICBTU04gCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX0JhU2Vzc2lvbkRlbAorCisgIERFU0NSSVBUSU9OIAorICAgIEhBTCBub3RpZmllcyBUTCB3aGVuIGEgbmV3IEJsb2NrIEFjayBzZXNzaW9uIGlzIGJlaW5nIGRlbGV0ZWQuIAorICAgIAorICBERVBFTkRFTkNJRVMgCisgICAgCisgIFBBUkFNRVRFUlMgCis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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dMQU5UTF9CYVNlc3Npb25EZWwgCisoIAorICB2X1BWT0lEX3QgICAgICAgICAgIHB2b3NHQ3R4LCAKKyAgdl9VMTZfdCAgICAgICAgICAgICB1Y1NUQUlkLAorICB2X1U4X3QgICAgICAgICAgICAgIHVjVGlkCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdMQU5UTF9BTVNEVVByb2Nlc3MKKworICBERVNDUklQVElPTiAKKyAgICBQcm9jZXNzIEEtTVNEVSBzdWItZnJhbWUuIFN0YXJ0IG9mIGNoYWluIGlmIG1hcmtlZCBhcyBmaXJzdCBmcmFtZS4gCisgICAgTGlua2VkIGF0IHRoZSBlbmQgb2YgdGhlIGV4aXN0aW5nIEFNU0RVIGNoYWluLiAKKyAgICAKKworICBERVBFTkRFTkNJRVMgCisgICAgICAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgSU4vT1VUOgorICAgdm9zRGF0YUJ1ZmY6IHZvcyBwYWNrZXQgZm9yIHRoZSByZWNlaXZlZCBkYXRhCisgICAgICAgICAgICAgICAgIG91dGdvaW5nIGNvbnRhaW5zIHRoZSByb290IG9mIHRoZSBjaGFpbiBmb3IgdGhlIHJ4IAorICAgICAgICAgICAgICAgICBhZ2dyZWdhdGVkIE1TRFUgaWYgdGhlIGZyYW1lIGlzIG1hcmtlZCBhcyBsYXN0OyBvdGhlcndpc2UgCisgICAgICAgICAgICAgICAgIE5VTEwKKyAgIAorICAgSU4KKyAgIHBBZGFwdGVyOiAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIGFkYXB0ZXIgY29udGV4dDsgYSBoYW5kbGUgdG8gVEwncyAKKyAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQgCisgICBwdkJESGVhZGVyOiAgIHBvaW50ZXIgdG8gdGhlIEJEIGhlYWRlcgorICAgdWNTVEFJZDogICAgICBTVEF0aW9uIElEIAorICAgICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfQU1TRFVQcm9jZXNzCisoIAorICB2X1BWT0lEX3QgICBwdm9zR0N0eCwKKyAgdm9zX3BrdF90KiogcHBWb3NEYXRhQnVmZiwgCisgIHZfUFZPSURfdCAgIHB2QkRIZWFkZXIsCisgIHZfVThfdCAgICAgIHVjU1RBSWQsCisgIHZfVThfdCAgICAgIHVjTVBEVUhMZW4sCisgIHZfVTE2X3QgICAgIHVzTVBEVUxlbgorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXTEFOVExfTVNEVVJlb3JkZXIKKworICBERVNDUklQVElPTiAKKyAgICBNU0RVIHJlb3JkZXJpbmcgCisKKyAgREVQRU5ERU5DSUVTIAorICAgICAgICAgCisgIFBBUkFNRVRFUlMgCisKKyAgIElOCisgICAKKyAgIHZvc0RhdGFCdWZmOiB2b3MgcGFja2V0IGZvciB0aGUgcmVjZWl2ZWQgZGF0YQorICAgcHZCREhlYWRlcjogcG9pbnRlciB0byB0aGUgQkQgaGVhZGVyCisgICB1Y1NUQUlkOiAgICBTVEF0aW9uIElEIAorICAgICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfTVNEVVJlb3JkZXIKKyggCisgICBXTEFOVExfQ2JUeXBlICAgICpwVExDYiwKKyAgIHZvc19wa3RfdCAgICAgICAgKip2b3NEYXRhQnVmZiwgCisgICB2X1BWT0lEX3QgICAgICAgIHB2QkRIZWFkZXIsCisgICB2X1U4X3QgICAgICAgICAgIHVjU1RBSWQsCisgICB2X1U4X3QgICAgICAgICAgIHVjVGlkCispOworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICBVdGlsaXR5IGZ1bmN0aW9ucworICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgV0xBTlRMX0FNU0RVQ29tcGxldGVGcmFtZQorCisgIERFU0NSSVBUSU9OIAorICAgIENvbXBsZXRlIEFNU0RVIGRlLWFnZ3JlZ2F0aW9uCisKKyAgREVQRU5ERU5DSUVTIAorICAgICAgICAgCisgIFBBUkFNRVRFUlMgCisKKyAgIElOL09VVDoKKyAgIHZvc0RhdGFCdWZmOiB2b3MgcGFja2V0IGZvciB0aGUgcmVjZWl2ZWQgZGF0YQorICAgCisgICBJTgorICAgcHZCREhlYWRlcjogcG9pbnRlciB0byB0aGUgQkQgaGVhZGVyCisgICB1Y1NUQUlkOiAgICBTVEF0aW9uIElEIAorICAgICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfQU1TRFVDb21wbGV0ZUZyYW1lCisoIAorICB2b3NfcGt0X3QqICB2b3NEYXRhQnVmZiwKKyAgdl9VOF90ICAgICAgdWNNUERVSExlbiwKKyAgdl9VMTZfdCAgICAgdXNNUERVTGVuCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTlRMX1F1ZXVlQ3VycmVudAorCisgIERFU0NSSVBUSU9OIAorICAgIEl0IHdpbGwgcXVldWUgYSBwYWNrZXQgYXQgYSBnaXZlbiBzbG90IGluZGV4IGluIHRoZSBNU0RVIHJlb3JkZXJpbmcgbGlzdC4gCisgICAgCisgIERFUEVOREVOQ0lFUyAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcHdCYVJlb3JkZXI6ICAgcG9pbnRlciB0byB0aGUgQkEgcmVvcmRlcmluZyBzZXNzaW9uIGluZm8gCisgICAgdm9zRGF0YUJ1ZmY6ICAgZGF0YSBidWZmZXIgdG8gYmUgcXVldWVkCisgICAgdWNTbG90SW5kZXg6ICAgc2xvdCBpbmRleCAKKyAgIAorICBSRVRVUk4gVkFMVUUKKyAgICBUaGUgcmVzdWx0IGNvZGUgYXNzb2NpYXRlZCB3aXRoIHBlcmZvcm1pbmcgdGhlIG9wZXJhdGlvbiAgCisKKyAgICBWT1NfU1RBVFVTX0VfU1VDQ0VTUzogICAgIEV2ZXJ5dGhpbmcgaXMgT0sKKworICAgIAorICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXTEFOVExfUXVldWVDdXJyZW50CisoCisgIFdMQU5UTF9CQVJlb3JkZXJUeXBlKiAgcHdCYVJlb3JkZXIsCisgIHZvc19wa3RfdCoqICAgICAgICAgICAgdm9zRGF0YUJ1ZmYsCisgIHZfVThfdCAgICAgICAgICAgICAgICAgdWNTbG90SW5kZXgKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBGVU5DVElPTiAgICBXTEFOVExfQ2hhaW5Gcm9udFBrdHMKKworICBERVNDUklQVElPTiAKKyAgICBJdCB3aWxsIHJlbW92ZSBhbGwgdGhlIHBhY2tldHMgZnJvbSB0aGUgZnJvbnQgb2YgYSB2b3MgbGlzdCBhbmQgY2hhaW4gCisgICAgdGhlbSB0byBhIHZvcyBwa3QgLiAKKyAgICAKKyAgREVQRU5ERU5DSUVTIAorICAgIAorICBQQVJBTUVURVJTIAorCisgICAgSU4KKyAgICB1Y0NvdW50OiAgICAgICBudW1iZXIgb2YgcGFja2V0cyB0byBleHRyYWN0CisgICAgcHdCYVJlb3JkZXI6ICAgcG9pbnRlciB0byB0aGUgQkEgcmVvcmRlcmluZyBzZXNzaW9uIGluZm8gCisKKyAgICBPVVQKKyAgICB2b3NEYXRhQnVmZjogICBkYXRhIGJ1ZmZlciBjb250YWluaW5nIHRoZSBleHRyYWN0ZWQgY2hhaW4gb2YgcGFja2V0cworICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworICAgIFZPU19TVEFUVVNfRV9TVUNDRVNTOiAgICAgRXZlcnl0aGluZyBpcyBPSworCisgICAgCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgV0xBTlRMX0NoYWluRnJvbnRQa3RzCisoIAorICAgdl9VMzJfdCAgICAgICAgICAgICAgICBmd2RJbmRleCwKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgb3BDb2RlLAorICAgdm9zX3BrdF90ICAgICAgICAgICAgICAqKnZvc0RhdGFCdWZmLAorICAgV0xBTlRMX0JBUmVvcmRlclR5cGUgICAqcHdCYVJlb3JkZXIsCisgICBXTEFOVExfQ2JUeXBlICAgICAgICAgICpwVExDYgorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorIAorICAgRlVOQ1RJT04gICAgV0xBTlRMX0ZpbGxSZXBsYXlDb3VudGVyCisgCisgICBERVNDUklQVElPTiAKKyAgICBJdCB3aWxsIGZpbGwgcmVwYWx5IGNvdW50ZXIgYXQgYSBnaXZlbiBzbG90IGluZGV4IGluIHRoZSBNU0RVIHJlb3JkZXJpbmcgbGlzdC4gCisgICAgICAgICAgICAgIAorICAgREVQRU5ERU5DSUVTIAorICAgICAgICAgICAgICAgIAorICAgUEFSQU1FVEVSUyAKKworICAgSU4KKyAgIHB3QmFSZW9yZGVyICA6ICAgcG9pbnRlciB0byB0aGUgQkEgcmVvcmRlcmluZyBzZXNzaW9uIGluZm8gCisgICByZXBsYXlDb3VudGVyOiAgIHJlcGxheSBjb3VudGVyIHRvIGJlIGZpbGxlZAorICAgdWNTbG90SW5kZXggIDogICBzbG90IGluZGV4IAorICAgICAgICAgICAgICAgICAKKyAgIFJFVFVSTiBWQUxVRQorICAgTk9ORSAKKyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgU0lERSBFRkZFQ1RTIAorICAgTk9ORQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIFdMQU5UTF9GaWxsUmVwbGF5Q291bnRlcgorKAorICAgV0xBTlRMX0JBUmVvcmRlclR5cGUqICBwd0JhUmVvcmRlciwKKyAgIHZfVTY0X3QgICAgICAgICAgICAgICAgcmVwbGF5Q291bnRlciwKKyAgIHZfVThfdCAgICAgICAgICAgICAgICAgdWNTbG90SW5kZXgKKyk7CisKKyNlbmRpZiAvKiAjaWZuZGVmIFdMQU5fUUNUX1RMSV9IICovCmRpZmYgLS1naXQgYS93bGFuL3ByaW1hL0NPUkUvVk9TUy9pbmMvZXZlbnRfZGVmcy5oIGIvd2xhbi9wcmltYS9DT1JFL1ZPU1MvaW5jL2V2ZW50X2RlZnMuaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi40ZDJiYTIwCi0tLSAvZGV2L251bGwKKysrIGIvd2xhbi9wcmltYS9DT1JFL1ZPU1MvaW5jL2V2ZW50X2RlZnMuaApAQCAtMCwwICsxLDE5MTYgQEAKKy8qCisgKiBDb3B5cmlnaHQgKGMpIDIwMTItMjAxNSBUaGUgTGludXggRm91bmRhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KKyAqCisgKiBQcmV2aW91c2x5IGxpY2Vuc2VkIHVuZGVyIHRoZSBJU0MgbGljZW5zZSBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKgorICoKKyAqIFBlcm1pc3Npb24gdG8gdXNlLCBjb3B5LCBtb2RpZnksIGFuZC9vciBkaXN0cmlidXRlIHRoaXMgc29mdHdhcmUgZm9yCisgKiBhbnkgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlI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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBheWxvYWQgKi8KKyAgRVZFTlRfTUVTU0FHRV9UUkFOU01JVFRFRCwgICAgICAgICAgLyogSW5jbHVkZXMgY2hhbm5lbCBhbmQgbWVzc2FnZSBJRCBhcyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF5bG9hZCAqLworICBFVkVOVF9USU1FUl9FWFBJUkVELCAgICAgICAgICAgICAgICAvKiBJbmNsdWRlcyB0aW1lciBJRCBhcyBwYXlsb2FkICovCisgIEVWRU5UX0NPVU5URVJfVEhSRVNIT0xELCAgICAgICAgICAgIC8qIEluY2x1ZGVzIGNvdW50ZXIgSUQgYXMgcGF5bG9hZCAqLworICBFVkVOVF9DQUxMX1BST0NFU1NJTkdfU1RBVEVfQ0hBTkdFLCAvKiBJbmNsdWRlcyBuZXcgc3RhdGUgYW5kIG9sZCBzdGF0ZSBhcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXlsb2FkICovIAorICBFVkVOVF9DQUxMX0NPTlRST0xfSU5TVEFOVElBVEVELCAgICAvKiBJbmNsdWRlcyBjb25fcmVmIGFzIHBheWxvYWQgKi8KKyAgRVZFTlRfQ0FMTF9DT05UUk9MX1NUQVRFX0NIQU5HRSwgICAgLyogSW5jbHVkZXMgY29uX3JlZiwgb2xkIHN1YnN0YXRlIGFuZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgc3Vic3RhdGUgYXMgcGF5bG9hZCAqLworICBFVkVOVF9DQUxMX0NPTlRST0xfVEVSTUlOQVRFRCwgICAgICAvKiBJbmNsdWRlcyBjb25fcmVmIGFzIHBheWxvYWQgKi8KKyAgRVZFTlRfUkVHX1pPTkVfQ0hBTkdFLCAgICAgICAgICAgICAgLyogSW5jbHVkZXMgcmVnX3pvbmUgYXMgcGF5bG9hZCAqLyAKKyAgRVZFTlRfU0xPVFRFRF9NT0RFX09QRVJ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0hfQUNRVUlSRUQsICAgICAgICAgICAgICAgLyogUGF5bG9hZDogMTQgYnl0ZXMgKi8KKyAgRVZFTlRfRkZDSF9QTFVTX0RDQ0hfQUNRVUlSRUQsICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9SRUdJU1RSQVRJT05fUEVSRk9STUVELCAgICAgICAvKiBJbmNsdWRlcyByZWdfdHlwZSBhcyBwYXlsb2FkICovIAorICBFVkVOVF9ORVdfU1lTVEVNX0lETEVfSEFORE9GRiwgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX1NZU1RFTV9SRVNFTEVDVElPTiwgICAgICAgICAgIC8qIEluY2x1ZGVzIGVjaW8gYW5kIHBzIGFzIHBheWxvYWQgKi8KKyAgRVZFTlRfUkVTQ0FOLCAgICAgICAgICAgICAgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9QUk9UT0NPTF9NSVNNQVRDSCwgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0xPQ0ssICAgICAgICAgICAgICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfVU5MT0NLLCAgICAgICAgICAgICAgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9BQ0NFU1NfREVOSUVELCAgICAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX05EU1NfT0ZGLCAgICAgICAgICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfUkVMRUFTRSwgICAgICAgICAgICAgICAgICAgICAgLyogUGF5bG9hZDogMSBieXRlICovCisgIEVWRU5UX0VSUk9SLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfUkVESVJFQ1RJT04sICAgICAgICAgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9SRUdJU1RSQVRJT05fUkVKRUNURUQsICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX1dST05HX1NZU1RFTSwgICAgICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfV1JPTkdfTkVUV09SSywgICAgICAgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9MT1NTX09GX0FDUV9BRlRFUl9TTEVFUCwgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX1BPV0VSX0RPV04sICAgICAgICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfQ0FMTF9SRUxFQVNFX1JFUVVFU1QsICAgICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9TRVJWSUNFX0lOQUNUSVZFLCAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0VYVEVOREVEX1JFTEVBU0UsICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKworICBFVkVOVF9IRFJfTVNHX1JYLCAgICAgICAgICAgICAgICAgICAvKiBwcm90b2NvbCwgbXNnLSAzIGJ5dGVzICovCisgIEVWRU5UX0hEUl9SWE1TR19JR05PUkVEX1NUQVRFLCAgICAgIC8qIHByb3RvY29sLCBtc2ctIDMgYnl0ZXMgKi8KKyAgRVZFTlRfSERSX1JYTVNHX0lHTk9SRURfU0VRLCAgICAgICAgLyogcHJvdG9jb2wsIG1zZy0gMyBieXRlcyAqLworICBFVkVOVF9IRFJfVFhNU0dfQUNLRUQsICAgICAgICAgICAgICAvKiBwcm90b2NvbCwgbXNnLSAzIGJ5dGVzICovCisgIEVWRU5UX0hEUl9UWE1TR19EUk9QUEVELCAgICAgICAgICAgIC8qIHByb3RvY29sLCBtc2ctIDMgYnl0ZXMgKi8gICAgICAKKyAgRVZFTlRfSERSX1NUQVRFX0NIQU5HRSwgICAgICAgICAgICAgLyogcHJvdG9jb2wsIGZyb20sIHRvIC0gNSBieXRlcyAqLworICBFVkVOVF9IRFJfQUxNUF9P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UNfU1VQRVJWSVNJT04sICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfSERSX09WSERfVF9TUF9TVVBFUlZJU0lPTiwgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9IRFJfT1ZIRF9UX0FQX1NVUEVSVklTSU9OLCAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0hEUl9PVkhEX0lHTk9SRURfTVNHX1VORVhQRUNURURfTElOSywgLyogbXNnLCBleHBfbGluay5jaGFuX251bSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHBfbGluay5waWxvdCwgcnhfbGluay5jaGFuX251bSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByeF9saW5rLnBpbG90IC0gMTAgYnl0ZXMgKi8KKyAgRVZFTlRfSERSX09WSERfSUdOT1JFRF9TUF9NU0dfRElGRl9TRUNfU0lHLCAvKiBleHBfc2lnLCByeF9zaWcgLSA4IGJ5dGVzICovCisgIEVWRU5UX0hEUl9PVkhEX0lHTk9SRURfQVBfTVNHX0RJRkZfQUNDX1NJRywgLyogZXhwX3NpZywgcnhfc2lnIC0gOCBieXRlcyAqLworICBFVkVOVF9IRFJfT1ZIRF9JR05PUkVEX1NQX01TR19ESUZGX1NFQ19JRCwgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfSERSX09WSERfU1BfTVNHX1JYLCAgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9IRFJfT1ZIRF9BUF9NU0dfUlgsICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0hEUl9SVVBfVF9DT05ORUNUSU9OX1NFVFVQLCAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfSERSX1NMUF9NQVhfUkVUUklFUywgICAgICAgICAgLyogbXNnIC0gMiBieXRlcyAqLworICBFVkVOVF9IRFJfTE1BQ19BQ1FfRkFJTF9QS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9OQUxfTU9ERSwgICAgICAgICAgICAgICAgIC8qICgxIGJ5dGUgcGF5bG9hZDogb3AgbW9kZSkgKi8KKyAgRVZFTlRfQ01fU1lTVEVNX01PREUsICAgICAgICAgICAgICAgICAgICAgIC8qICgxIGJ5dGUgcGF5bG9hZDogc3lzX21vZGUpICovCisKKyAgRVZFTlRfREVFUF9TTEVFUCwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIG5vIHBheWxvYWQgKi8KKyAgRVZFTlRfV0FLRVVQLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHVuc2lnbmVkIGxvbmcgKDQgYnl0ZXMpIHBheWxvYWQgKi8KKyAgRVZFTlRfQUNRVUlTSVRJT05fTU9ERSwgICAgICAgICAgICAgICAgICAgIC8qIHVuc2lnbmVkIGNoYXIgKDEgYnl0ZSkgcGF5bG9hZCAqLworICBFVkVOVF9BQ1FVSVNJVElPTl9UWVBFLCAgICAgICAgICAgICAgICAgICAgLyogdW5zaWduZWQgY2hhciAoMSBieXRlKSBwYXlsb2FkICovCisgIEVWRU5UX0FDUF9FWElULCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB1bnNpZ25lZCBjaGFyICgxIGJ5dGUpIHBheWxvYWQgKi8KKyAgRVZFTlRfQ0RNQV9FWElULCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHVuc2lnbmVkIGNoYXIgKDEgYnl0ZSkgcGF5bG9hZCAqLworCisgIEVWRU5UX0hEUl9IWUJSSURfUE9XRVJfU0FWRSwgICAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0hEUl9ERUVQX1NMRUVQLCAgICAgICAgICAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0hEUl9SRVNFTEVDVElPTiwgICAgICAgICAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX1NBTV9MT0NLX0dSQU5URUQsICAgICAgICAgICAgICAgICAgICAvKiA8TmV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AgICAgICAvKiBQYXlsb2FkOiA0IGJ5dGVzICovCisgIEVWRU5UX0NNX0NBTExfT1JJR19TRU5EX0hEUl9PUklHLCAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0NNX0NBTExfT1JJR19TRU5EX01DX09SSUcsICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0NNX0NBTExfT1JJR19FTkQsICAgICAgICAgICAvKiBQYXlsb2FkOiAyIGJ5dGVzICovCisgIEVWRU5UX0NNX0NBTExfT1JJR19DT05ORUNURUQsICAgICAvKiBQYXlsb2FkOiAzIGJ5dGVzICovCisKKyAgRVZFTlRfTVRfU01TX05PVElGWSwgICAgICAgICAgICAgIC8qIFBheWxvYWQ6IDEgYnl0ZSBtZW1fdHlwZSwgNCBieXRlIG1zZ19pbmRleCAqLworICBFVkVOVF9TTVNfU0xPVF9XQUtFVVAsICAgICAgICAgICAgLyogUGF5bG9hZDogMSBieXRlIHNsb3RfbWFzayAqLworICBFVkVOVF9NT19TTVNfU1RBVFVTLCAgICAgICAgICAgICAgLyogUGF5bG9hZDogNCBieXRlIHRyYW5zYWN0aW9uX2lkLCAxIGJ5dGUgbWVtX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0IGJ5dGUgbXNnX2luZGV4LCAxIGJ5dGUgcmVwb3J0X3N0YXR1cywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIGJ5dGUgY2FzZV9jb2RlICovCisgIEVWRU5UX0dQUlNfU1VSUk9VTkRfU0VBUkNIX1NUQVJULAorICBFVkVOVF9HUFJTX1NVUlJPVU5EX1NFQVJDSF9FTkQsCisgIEVWRU5UX0dQUlNfTUFDX1JFU0VMRUNUX0lORCwKKyAgRVZFTlRfR1BSU19QQUdFX1JFQ0VJVkVELAorICBFVkVOVF9HUFJTX0xJTktfRkFJTFVSRSwKKyAgRVZFTlRfR1BSU19DRUxMX1VQREFURV9TVEF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19HU01fUkVTRUxFQ1RJT05fU1RBUlQsICAgLyogUGF5bG9hZDogNCBieXRlcyAqLworICBFVkVOVF9XQ0RNQV9UT19HU01fUkVTRUxFQ1RJT05fRU5ELCAgICAgLyogUGF5bG9hZDogMiBieXRlcyAqLworICBFVkVOVF9XQ0RNQV9UT19XQ0RNQV9SRVNFTEVDVElPTl9FTkQsICAgLyogUGF5bG9hZDogNCBieXRlcyAqLworICBFVkVOVF9XQ0RNQV9SQUNIX0FUVEVNUFQsICAgICAgICAgICAgICAgLyogUGF5bG9hZDogMyBieXRlcyAqLworCisgIEVWRU5UX1NUQVJUX0ZXRF9TVVBQX0JVUlNUX0FTU0lHTiwgICAgICAvKiBQYXlsb2FkOiAzIGJ5dGVzICovCisgIEVWRU5UX1NUQVJUX1JFVl9TVVBQX0JVUlNUX0FTU0lHTiwgICAgICAvKiBQYXlsb2FkOiAzIGJ5dGVzICovCisgIEVWRU5UX1JFVl9GQ0hfR0FUSU5HX0lOX1VTRSwgICAgICAgICAgICAvKiBQYXlsb2FkOiAxIGJ5dGUgICovCisgIEVWRU5UX1BQUCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBQYXlsb2FkOiA3IGJ5dGVzICovCisgIEVWRU5UX01JUCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBQYXlsb2FkOiAyIGJ5dGVzICovCisgIEVWRU5UX1RDUCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBQYXlsb2FkOiA1IGJ5dGVzICovCisgIEVWRU5UX0NBTUVSQV9FWElGX0ZBSUxFRCwgICAgICAgICAgICAgICAvKiBFWElGIGVuY29kaW5nIGZhaWxlZCAqLworICBFVkVOVF9DQU1FUkFfVklERU9fRkFJTEVELCAgICAgICAgICAgICAgLyogVmlkZW8gZW5jb2RpbmcgZmFpbGVkICovCisgIEVWRU5UX0NBTUVSQV9OT19TRU5TT1IsICAgICAgICAgICAgICAgICAvKiBObyBzZW5zb3IgKi8KKyAgRVZFT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SVRfTlVNICgyIGJ5dGVzKSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEUl9TSVpFICAgICAoMWJ5dGUpIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgRVZFTlRfR1BTX0NMS19PTiwgICAgICAgICAgICAgICAgIC8qIE5vIFBheWxvYWQgKi8KKyAgRVZFTlRfR1BTX0NMS19PRkYsICAgICAgICAgICAgICAgIC8qIE5vIFBheWxvYWQgKi8KKyAgRVZFTlRfR1BTX1ZJU0lUX1JFUVVFU1QsICAgICAgICAgIC8qIE5vIFBheWxvYWQgKi8gCisgIEVWRU5UX0dQU19WSVNJVF9SRVNQT05TRSwgICAgICAgICAvKiBQYXlsb2FkOiByZXNwb25zZV9yZXN1bHQgKDEgYnl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovIAorICBFVkVOVF9HUFNfVEFfU1RBUlQsICAgICAgICAgICAgICAgLyogTm8gUGF5bG9hZCAqLworICBFVkVOVF9HUFNfRFNQX1JFQURZLCAgICAgICAgICAgICAgLyogTm8gUGF5bG9hZCAqLworICBFVkVOVF9HUFNfRFNQX0NIQU5ORUxfU1RBUlQsICAgICAgLyogUGF5bG9hZDogU1ZfSUQgICAgICAgICAoMSBieXRlKSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTUkNIX01PREUgICAgICgxIGJ5dGUpLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENIQU5ORUxfTlVNICAgKDEgYnl0ZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSRVNFUlZFRCAgICAgICgxIGJ5dGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICBFVkVOVF9HUFNfRFNQX0NIQU5ORUxfRE9ORSwgICAgICAgLyogUGF5bG9hZDogY2hhbm5lbF9udW0gKDEgYnl0ZSkgKi8KKyAgRVZFTlRfR1BTX0RTUF9TVE9QLCAgICAgICAgICAgICAgIC8qIE5vIFBheWxvYWQgKi8KKyAgRVZFTlRfR1BTX0RTUF9ET05FLCAgICAgICAgICAgICAgIC8qIE5vIFBheWxvYWQgKi8KKyAgRVZFTlRfR1BTX1RCX0VORCwgICAgICAgICAgICAgICAgIC8qIE5vIFBheWxvYWQgKi8KKyAgRVZFTlRfR1BTX1NSQ0hfTEFSR0VfRE9QUF9XSU4sICAgIC8qIFBheWxvYWQ6IHN2X3Bybl9udW0gKDEgYnl0ZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcmNoX21vZGUgKDEgYnl0ZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3BwX3dpbmQgKDIgYnl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovIAorICBFVkVOVF9HUFNfU1JDSF9FWENFUFRJT04sICAgICAgICAgLyogUGF5bG9hZDogZ3JpZF9sb2dfaWQgKDIgYnl0ZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleGNlcHRpb25fdHlwZSAoMSBieXRlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgRVZFTlRfR1BTX1NSQ0hfSFdfUE9MTElORzEsICAgICAgIC8qIFBheWxvYWQ6IGFnY192YWwgKDIgYnl0ZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkY2lfb2ZmICgyIGJ5dGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGNxX29mZiAoMiBieXRlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRya19sbyAoMiBieXRlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvX2JpYXMgKDIgYnl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisKKyAgRVZFTlRfR1BTX1NSQ0hfSFdfUE9MTElORzIsICAgICAgIC8qIFBheWxvYWQ6IHN5bmM4MCAoMiBieXRlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgRVZFTlRfR1BTX1BHSV9BQ1RJT05fUFJPQ0VTUywgICAgIC8qIFBheWxvYWQ6IHBnaV9zdWJzdGF0ZSAoMSBieXRlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBnaV9jbWQgKDEgYnl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgIEVWRU5UX0dQU19HU0NfQUNUSU9OX1BST0NFU1MsICAgICAvKiBQYXlsb2FkOiBnc2Nfc3Vic3RhdGUgKDEgYnl0ZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnc2NfY21kICgxIGJ5dGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICBFVkVOVF9HUFNfUEdJX0FCT1JULCAgICAgICAgICAgICAgLyogUGF5bG9hZDogcGdpX3N1YnNhdGUgKDEgYnl0ZSkgKi8KKyAgRVZFTlRfR1BTX0dTQ19BQk9SVCwgICAgICAgICAgICAgIC8qIFBheWxvYWQ6IGdzY19zdWJzYXRlICgxIGJ5dGUpICovCisKKworCisgIEVWRU5UX0dQU19QRF9GSVhfU1RBUlQsICAgICAgICAgICAgICAgIC8qIFBheWxvYWQ6IGV2ZW50X2xvZ19jbnQgICgyIGJ5dGUpLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wZXJhdGlvbl9tb2RlICgxIGJ5dGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgIEVWRU5UX0dQU19QRF9GSVhfRU5ELCAgICAgICAgICAgICAgICAgIC8qIFBheWxvYWQ6IGVuZF9zdGF0dXMgICAgICgxIGJ5dGUpICAqLworICBFVkVOVF9HUFNfREFUQV9ET1dOTE9BRF9TVEFSVCwgICAgICAgICAvKiBQYXlsb2FkOiBkYXRhX3R5cGUgICAoMSBieXRlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ZfbWFzayAgICAgKDQgYnl0ZSkgICAgICovCisgIEVWRU5UX0dQU19EQVRBX0RPV05MT0FEX0VORCwgICAgICAgICAgIC8qIFBheWxvYWQ6IGVuZF9zdGF0dXMgICAgICAoMSBieXRlKSAqLworICBFVkVOVF9HUFNfUERfU0VTU0lPTl9TVEFSVCwgICAgICAgICAgICAvKiBQYXlsb2FkOiBzdGFydF9zb3VyY2UgICAgKDQgYml0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcGVyYXRpb25fbW9kZSAgKDQgYml0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uX3R5cGUgICAgKDQgYml0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcml2YWN5ICAgICAgICAgKDQgYml0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1fZml4ZWQgICAgICAgKDIgYnl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZml4X3BlcmlvZCAgICAgICgyIGJ5dGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdl9kYXRhX2RsICAgICAoNCBiaXQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBycSAgICAgICAgICAgICAoMSBieXRlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJlc2hvbGQgICAgICAgKDIgYnl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNwb3J0X3R5cGUgICg0IGJpdCkgICovCisgIEVWRU5UX0dQU19ET1JNQU5DWV9CRUdJTiwgICAgICAgICAgICAgICAvKiBObyBQYXlsb2FkICovCisgIEVWRU5UX0dQU19ET1JNQU5DWV9FTkQsICAgICAgICAgICAgICAgICAvKiBObyBQYXlsb2FkICovCisgIEVWRU5UX0dQU19QUlFfVElNRU9VVCwgICAgICAgICAgICAgICAgICAvKiBObyBQYXlsb2FkICovCisgIEVWRU5UX0dQU19QRF9DT05ORUNUSU9OX1NUQVJULCAgICAgICAgICAvKiBObyBQYXlsb2FkICovCisgIEVWRU5UX0dQU19QRF9DT05ORUNUSU9OX0VTVEFCTElTSEVELCAgICAvKiBObyBQYXlsb2FkICovCisgIEVWRU5UX0dQU19QRF9ESVNDT05ORUNUSU9OX1NUQVJULCAgICAgICAvKiBObyBQYXlsb2FkICovCisgIEVWRU5UX0dQU19GVEVTVF9GSVhfU1RBUlQsICAgICAgICAgICAgICAvKiBQYXlsb2FkOiByZXNlcnZlZCAoNCBieXRlKSAqLworICBFVkVOVF9HUFNfRlRFU1RfRklYX0VORCwgICAgICAgICAgICAgICAgLyogUGF5bG9hZDogcmVzZXJ2ZWQgKDQgYnl0ZSkgKi8KKyAgRVZFTlRfR1BTX1BEX1BPU0lUSU9OLCAgICAgICAgICAgICAgICAgIC8qIE5vIFBheWxvYWQgKi8KKyAgRVZFTlRfR1BTX0U5MTFfU1RBUlQsICAgICAgICAgICAgICAgICAgIC8qIE5vIFBheWxvYWQgKi8KKyAgRVZFTlRfR1BTX0U5MTFfRU5ELCAgICAgICAgICAgICAgICAgICAgIC8qIE5vIFBheWxvYWQgKi8KKyAgRVZFTlRfR1BTX0RCTV9TRU5EX0ZBSUxVUkUsICAgICAgICAgICAgIC8qIE5vIFBheWxvYWQgKi8KKyAgRVZFTlRfR1BTX1VBUERNU19TVEFURV9DSEFOR0UsICAgICAgICAgIC8qIFBheWxvYWQ6IG5ld19zdGF0ZSAoMSBieXRlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVhc29uICAgICgxIGJ5dGUpICovCisgIEVWRU5UX1dDRE1BX09VVF9PRl9TRVJWSUNFLCAgICAgICAgICAgICAvKiBObyBQYXlsb2FkICovCisgIEVWRU5UX0dTTV9MMV9TVUJTVEFURSwgICAgICAgICAgICAgICAgICAvKiAyIGJ5dGVzIHBheWxvYWQgKi8KKyAgRVZFTlRfU0RfRVZFTlRfQUNUSU9OLCAgICAgICAgICAgICAgICAgIC8qIDggYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1NEX0VWRU5UX0FDVElPTl9IWUJSLCAgICAgICAgICAgICAvKiA4IGJ5dGUgcGF5bG9hZCAqLworCisgIEVWRU5UX1VNVFNfQ0FMTFNfU1RBVElTVElDUywgICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9QWklEX0hBVF9TVEFSVEVELCAgICAgICAgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9XQ0RNQV9EUlhfQ1lDTEUsICAgICAgICAgICAgICAgICAgLyogMyBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfV0NETUFfUkVfQUNRVUlTSVRJT05fRkFJTCwgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfV0NETUFfUlJDX1JCMF9TRVRVUF9GQUlMVVJFLCAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfV0NETUFfUlJDX1BIWUNIQU5fRVNUX0ZBSUxVUkUsICAg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VOVF9CUkVXX0FQUF9QQVVTRSwgICAgICAgICAgICAgICAgICAgLyogOCBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfQlJFV19BUFBfUkVTVU1FLCAgICAgICAgICAgICAgICAgIC8qIDggYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0JSRVdfRVhUX01PRFVMRV9TVEFSVCwgICAgICAgICAgICAvKiA4IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9CUkVXX0VYVF9NT0RVTEVfU1RPUCwgICAgICAgICAgICAgLyogOCBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfQlJFV19FUlJPUiwgICAgICAgICAgICAgICAgICAgICAgIC8qIDggYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0JSRVdfUkVTRVJWRURfNjQ3LCAgICAgICAgICAgICAgICAvKiBCUkVXIGludGVybmFsIHVzZSBvbmx5ICovCisgIEVWRU5UX0JSRVdfUkVTRVJWRURfNjQ4LCAgICAgICAgICAgICAgICAvKiBCUkVXIGludGVybmFsIHVzZSBvbmx5ICovCisgIEVWRU5UX0JSRVdfUkVTRVJWRURfNjQ5LCAgICAgICAgICAgICAgICAvKiBCUkVXIGludGVybmFsIHVzZSBvbmx5ICovCisgIEVWRU5UX0JSRVdfUkVTRVJWRURfNjUwLCAgICAgICAgICAgICAgICAvKiBCUkVXIGludGVybmFsIHVzZSBvbmx5ICovCisgIEVWRU5UX0JSRVdfUkVTRVJWRURfNjUxLCAgICAgICAgICAgICAgICAvKiBCUkVXIGludGVybmFsIHVzZSBvbmx5ICovCisgIEVWRU5UX0JSRVdfUkVTRVJWRURfNjUyLCAgICAgICAgICAgICAgICAvKiBCUkVXIGludGVybmFsIHVzZSBvbmx5ICovCisgIEVWRU5UX0JSRVdfUkVTRVJWRURfNjUzLCAgICAgICAgICAgICAgICAvKiBCUkVXIGludGVybmFsIHVzZSBvbmx5ICovCisgIEVWRU5UX0JSRVdfUkVTRVJWRURfNjU0LCAgICAgICAgICAgICAgICAvKiBCUkVXIGludGVybmFsIHVzZSBvbmx5ICovCisgIEVWRU5UX0JSRVdfUkVTRVJWRURfNjU1LCAgICAgICAgICAgICAgICAvKiBCUkVXIGludGVybmFsIHVzZSBvbmx5ICovCisgIEVWRU5UX0JSRVdfVVNFUl82NTYsICAgICAgICAgICAgICAgICAgICAvKiBTdGFydCBvZiBCUkVXIHVzZXIgZXZlbnRzICovCisgIEVWRU5UX0JSRVdfR0VORVJJQywgICAgICAgICAgICAgICAgICAgICAvKiA4IGJ5dGUgcGF5bG9hZDogY2xzaWQgKyBkYXRhICovCisgIEVWRU5UX0JSRVdfTUVESUFQTEFZRVJfU0VMRUNUX0ZJTEUsICAgICAvKiBubyBwYXlsb2FkICovCisgIEVWRU5UX0JSRVdfTUVESUFQTEFZRVJfQ09OVFJPTCwgICAgICAgICAvKiBubyBwYXlsb2FkICovCisgIEVWRU5UX0JSRVdfQVBQX0ZPUk1JVEVNX1NUQUNLX0NIQU5HRSwgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9CUkVXX0NBVEFQUF9SRUNWX1BST0FDVElWRV9DTUQsICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9CUkVXX0NBVEFQUF9URVJNSU5BTF9SU1AsICAgICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9CUkVXX0NBVEFQUF9OT19ESVNQTEFZLCAgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9CUkVXX1NJUklVU19FTUFJTF9ERUxFVEUsICAgICAgICAgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9CUkVXX1NJUklVU19FTUFJTF9PUEVSQVRJT05fQ09NUExFVEUsICAgICAgLyogOCBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfQlJFV19TSVJJVVNfRU1BSUxfTkVXX0VNQUlMX05PVElGSUNBVElPTiwgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfQlJFV19VTkR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V0NETUFfUkVTRUxFQ1RfRU5ELCAgICAgICAgICAgLyogNSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfUFpJRF9IQUlfRU5BQkxFRCwgICAgICAgICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQqLworICBFVkVOVF9QWklEX0hBSV9ESVNBQkxFRCwgICAgICAgICAgICAgICAgICAgLyogTm8gcGF5bG9hZCovCisgIEVWRU5UX0dTTV9UT19XQ0RNQV9IQU5ET1ZFUl9TVEFSVCwgICAgICAgICAvKiA0IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9XQ0RNQV9SUkNfTU9ERSwgICAgICAgICAgICAgICAgICAgICAgLyogMSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfV0NETUFfTDFfQUNRX1NVQlNUQVRFLCAgICAgICAgICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1dDRE1BX1BIWUNIQU5fQ0ZHX0NIQU5HRUQsICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworCisgIEVWRU5UX1FUVl9DTElQX1NUQVJURUQsICAgICAgICAgICAgICAgICAgICAvKiA3IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9RVFZfQ0xJUF9FTkRFRCwgICAgICAgICAgICAgICAgICAgICAgLyogNSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfUVRWX1NEUF9QQVJTRVJfUkVKRUNULCAgICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfUVRWX0NMSVBfUEFVU0UsICAgICAgICAgICAgICAgICAgICAgIC8qIDQgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1FUVl9DTElQX1JFUE9TSVRJT05JTkcsICAgICAgICAgICAgICAvKiA0IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9RVFZfQ0xJUF9aT09NX0lOLCAgICAgICAgICAgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVO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RVFZfVU5ERUZJTkVEXzk2NiwKKyAgRVZFTlRfUVRWX1VOREVGSU5FRF85NjcsCisKKyAgRVZFTlRfRFNfU0VUU19BUk1fQ0xPQ0tfRkFTVEVSLCAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfRFNfU0VUU19BUk1fQ0xPQ0tfU0xPV0VSLCAgICAgIC8qIE5vIHBheWxvYWQgKi8KKworICBFVkVOVF9TTVNfU1RBVElTVElDUywgICAgICAgICAgICAgICAgLyogMiBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfU01fUERQX1NUQVRFLCAgICAgICAgICAgICAgICAgIC8qIDQgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX01WU19TVEFURSwgICAgICAgICAgICAgICAgICAgICAvKiAyIGJ5dGUgcGF5bG9hZCAqLworCisgIEVWRU5UX1NFQ1NTTCwgICAgICAgICAgICAgICAgICAgICAgICAvKiAxNiBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfU0VDVEVTVCwgICAgICAgICAgICAgICAgICAgICAgIC8qIDE2IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9TRUNWUE4sICAgICAgICAgICAgICAgICAgICAgICAgLyogMTYgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1NFQ0NSWVBULCAgICAgICAgICAgICAgICAgICAgICAvKiAxNiBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfU0VDQ1JZUFRfQ01ELCAgICAgICAgICAgICAgICAgIC8qIDE2IGJ5dGUgcGF5bG9hZCAqLworCisgIEVWRU5UX1NFQ19SRVNFUlZFRF85NzgsICAgICAgICAgICAgICAvKiB1bmtub3duIHBheWxvYWQgKi8KKyAgRVZFTlRfU0VDX1JFU0VSVkVEXzk3OSwgICAgICAgICAgICAgIC8qIHVua25vd24gcGF5bG9hZCAqLworICBFVkVOVF9TRUNfUkVTRVJWRURfOTgwLCAgICAgICAgICAgICAgLyogdW5rbm93biBwYXlsb2FkICovCisgIEVWR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gICAgICAgICAgIC8qIDQgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0NNX0ZXRF9BT0NfSU5ELCAgICAgICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9QWklEX0lELCAgICAgICAgICAgICAgICAgICAgICAgLyogMiBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfUFpJRF9IVF9WQUxVRSwgICAgICAgICAgICAgICAgIC8qIDkgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1BaSURfRVhJU1RTX0lOX0xJU1QsICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9HU0RJX0dFVF9GSUxFX0FUVFJJQlVURVMsICAgICAgLyogNiBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfR1NESV9TSU1fUkVBRCwgICAgICAgICAgICAgICAgIC8qIDYgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0dTRElfU0lNX1dSSVRFLCAgICAgICAgICAgICAgICAvKiA2IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9HU0RJX0dFVF9QSU5fU1RBVFVTLCAgICAgICAgICAgLyogOCBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfR1NESV9WRVJJRllfUElOLCAgICAgICAgICAgICAgIC8qIDcgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0dTRElfVU5CTE9DS19QSU4sICAgICAgICAgICAgICAvKiA3IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9HU0RJX0RJU0FCTEVfUElOLCAgICAgICAgICAgICAgLyogNyBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfR1NESV9FTkFCTEVfUElOLCAgICAgICAgICAgICAgIC8qIDcgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0dTRElfU0lNX0lOQ1JFQVNFLCAgICAgICAgICAgICAvKiA2IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9HU0RJX0VYRUNVVEVf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AgICAgIC8qIDE2IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9NRkxPX09TQ0FSX0RFQ19FWENFUFRJT05fREVURUNURUQsLyogNCAgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX01GTE9fTUZOX1NVQlNUQVRFLCAgICAgICAgICAgICAgICAvKiA4ICBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfTUZMT19NRk5fU1RBVEUsICAgICAgICAgICAgICAgICAgIC8qIDEyICBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfTUZMT19NRk5fVkVSVElDQUxfSEFORE9GRiwgICAgICAgIC8qIDE2ICBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfTUZMT19NRk5fQUNRX1NUQVRFLCAgICAgICAgICAgICAgIC8qIDEwICBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfTUZMT19GTE9XX1NUQVRVUywgICAgICAgICAgICAgICAgIC8qIDEyICBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfTUZMT19ORVRXT1JLX1NUQVRVUywgICAgICAgICAgICAgIC8qIDEyICBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfTUZMT19VTkRFRklORURfMTA3MCwKKworICBFVkVOVF9DTV9MQ1NfTU9MUl9DT05GLCAgICAgICAgICAgICAgICAgLyogMSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfUFBQX05FVE1PREVMLCAgICAgICAgICAgICAgICAgICAgIC8qIDcgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0NBTUVSQV9QUk9GSUxJTkcsICAgICAgICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9NQUNfSFNfVDFfRVhQSVJZLCAgICAgICAgICAgICAgICAgLyogMiBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfQVNZTkNfRFM3MDcsICAgICAgICAgICAgICAgICAgICAgIC8qIDQgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1BLVF9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Xlsb2FkICovCisgIEVWRU5UX0FVRElPX0ZSQU1FX1NFTlRfVE9fREVDT0RFUiwgICAgICAvKiAxMiBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfVklERU9fRlJBTUVfU0VOVF9UT19ERUNPREVSLCAgICAgIC8qIDEyIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9ERUNfUkVOREVSX0ZSQU1FLCAgICAgICAgICAgICAgICAgLyogOCBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfREVDX1JFTkRFUl9ET05FLCAgICAgICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfREVDX1NUQVJUX0RFQ09ESU5HLCAgICAgICAgICAgICAgIC8qIDQgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0RFQ19GUkFNRV9ERUNPREVELCAgICAgICAgICAgICAgICAvKiA0IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9WX0VOQ09ERUQsICAgICAgICAgICAgICAgICAgICAgICAgLyogMTMgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0RFQ19TVEFSVF9ERUNPRElOR19FWFQsICAgICAgICAgICAvKiA4IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9ERUNfRlJBTUVfREVDT0RFRF9FWFQsICAgICAgICAgICAgLyogOCBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfUVZJREVPUEhPTkVfVU5ERUZJTkVEXzExNTEsCisgIEVWRU5UX1FWSURFT1BIT05FX1VOREVGSU5FRF8xMTUyLAorICBFVkVOVF9RVklERU9QSE9ORV9VTkRFRklORURfMTE1MywKKyAgRVZFTlRfUVZJREVPUEhPTkVfVU5ERUZJTkVEXzExNTQsCisgIEVWRU5UX1FWSURFT1BIT05FX1VOREVGSU5FRF8xMTU1LAorCisgIEVWRU5UX0dQU19DTUVfUE9TX1JFUSwgICAgICAgICAgICAgICAgICAvKiBubyBwYXlsb2FkICovCisgIEVWRU5UX0dQU19DTUVfRklYX1NUQVJULCAgICAgICAgICAgICAgICAvKiBubyBwYXlsb2FkICovCisgIEVWRU5UX0dQU19DTUVfRklYX0VORCwgICAgICAgICAgICAgICAgICAvKiBubyBwYXlsb2FkICovCisgIEVWRU5UX0dQU19TRUVEX0NMTSwgICAgICAgICAgICAgICAgICAgICAvKiAxMiBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfR1BTX1NFRURfU0lELCAgICAgICAgICAgICAgICAgICAgIC8qIDEwIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9HUFNfU0VFRF9TTCwgICAgICAgICAgICAgICAgICAgICAgLyogMTEgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0dQU19TRUVEX0dFVCwgICAgICAgICAgICAgICAgICAgICAvKiAxMyBieXRlIHBheWxvYWQgKi8KKworICBFVkVOVF9IRFJfT1ZIRF9CQ19NU0dfUlgsICAgICAgICAgICAgICAgLyogbm8gcGF5bG9hZCAqLworICBFVkVOVF9IRFJfT1ZIRF9UX0JDX1NVUEVSVklTSU9OLCAgICAgICAgLyogbm8gcGF5bG9hZCAqLworICBFVkVOVF9IRFJfTE1BQ19TRVRfQkNNQ1NfUEFHRV9DWUNMRSwgICAgLyogMSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfSERSX0hNUF9TRVNTSU9OX0NMT1NFRCwgICAgICAgICAgIC8qIDIgYnl0ZSBwYXlsb2FkICovCisKKyAgRVZFTlRfV0xBTl9DUCwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDE1IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9BUlAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMTIgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0RIQ1AsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAxMCBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfV0xBTl9XUEEsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDcgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0VBUCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiA3IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9MQU5fMVgsICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogNyBieXRlIHBheWxvYWQgKi8KKworICBFVkVOVF9DQU1FUkFfU1ZDU19TVEFSVCwgICAgICAgICAgICAgICAgLyogbm8gcGF5bG9hZCAqLworICBFVkVOVF9DQU1FUkFfU1ZDU19TVE9QLCAgICAgICAgICAgICAgICAgLyogbm8gcGF5bG9hZCAqLworCisgIEVWRU5UX0JDTUNTX1NSVkNfQVZBSUxBQkxFLCAgICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9CQ01DU19TUlZDX0xPU1QsICAgICAgICAgICAgICAgICAgLyogMSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfQkNNQ1NfRkxPV19SRUdJU1RFUkVELCAgICAgICAgICAgIC8qIDE4IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9CQ01DU19GTE9XX0RFUkVHSVNURVJFRCwgICAgICAgICAgLyogMTggYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0JDTUNTX0ZMT1dfU1RBVFVTX0NIQU5HRUQsICAgICAgICAvKiAxOSBieXRlIHBheWxvYWQgKi8KKworICBFVkVOVF9DQU1FUkFfU1ZDU19YLCAgICAgICAgICAgICAgICAgICAgLyogMiBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfQ01fQ0FMTF9FVkVOVF9PUklHX1RIUiwgICAgICAgICAgIC8qIDMgYnl0ZSBwYXlsb2FkICovCisKKyAgRVZFTlRfVkZFX01TR19DT05GSUdfQ09NUExFVEUsICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfVkZFX01TR19JRExFX0NPTVBMRVRFLCAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfVkZFX01TR19VUERBVE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WQgKi8KKyAgRVZFTlRfUVZTX0NBTExfUkVMRUFTRV9ET05FLCAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfUVZTX0NBTExfUkVMRUFTRV9GQUlMRUQsICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKworICBFVkVOVF9DQU1DT1JERVJfU1RBUlRfUkVDT1JELCAgICAgICAgICAgLyogOSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfQ0FNQ09SREVSX1NUQVJUX1RSQU5TQ09ERSwgICAgICAgIC8qIDYgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0NBTUNPUkRFUl9GUkFNRV9EUk9QLCAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0NBTUNPUkRFUl9BVURJT0RVQiwgICAgICAgICAgICAgICAvKiAyIGJ5dGUgcGF5bG9hZCAqLworCisgIEVWRU5UX1BTTU1fU0VOVCwgICAgICAgICAgICAgICAgICAgICAgICAvKiAxNiBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfR1BTX1BEX0ZBTExCQUNLX01PREUsICAgICAgICAgICAgIC8qIDMgYnl0ZSBwYXlsb2FkICovCisKKyAgRVZFTlRfUEVBUCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDQgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1RUTFMsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAzIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9UTFMsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMiBieXRlIHBheWxvYWQgKi8KKworICBFVkVOVF9XQ0RNQV9UT19XQ0RNQV9SRVNFTEVDVElPTl9WRVIyX1NUQVJULCAvKiA3IGJ5dGUgcGF5bG9hZCAqLworCisgIEVWRU5UX0VVTF9SRUNPTkZJR19PUl9BU1UsICAgICAgICAgICAgICAvKiAxMCBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlR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ZCAqLworICBFVkVOVF9HUFNfTE1fUERfQ09NUExFVEUsICAgICAgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9HUFNfTE1fSVFfVEVTVF9DT01QTEVURSwgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLworCisgIEVWRU5UX1BNX0FQUF9PVEdfSU5JVCwgICAgICAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX1BNX0FQUF9PVEdfUkVTRVQsICAgICAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX1BNX0FQUF9PVEdfQUNRVUlSRV9CVVNfUkVRLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAyIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9QTV9BUFBfT1RHX1JFTElOUVVJU0hfQlVTX1JFUSwgICAgICAgICAgICAgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9QTV9BUFBfT1RHX1NVU1BFTkQsICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9QTV9BUFBfT1RHX1JFU1VNRSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX1BNX0FQUF9PVEdfREVWSUNFX0FUVEFDSEVELCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAxIGJ5VGUgcGF5bG9hZCAqLworICBFVkVOVF9QTV9BUFBfT1RHX0RFVklDRV9ERVRBQ0hFRCwgICAgICAgICAgICAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX1BNX0FQUF9PVEdfSE9TVF9NT0RFX1JFTV9QRVJJX0RJUywgICAgICAgICAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX1BNX0FQUF9PVEdfUEVSSV9NT0RFX1BSRVBBUkVfRk9SX1JFTV9IT1NUX1dBS0VVUF9TSUcsICAvKiBObyB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ICAKKyAgRVZFTlRfRFRWX0RWQkhfU0VMX1BMVEZNX1JFUV9SQ1ZELCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDQgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0RUVl9EVkJIX1BMVEZNX0FDUV9TVUNDRVNTLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiA0IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9EVFZfRFZCSF9QTFRGTV9BQ1FfRkFJTCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogNCBieXRlIHBheWxvYWQgKi8gIAorICBFVkVOVF9EVFZfRFZCSF9UQkxfTUdSX1NUQVRFX0NIQU5HRUQsICAgICAgICAgICAgICAgICAgICAgICAgLyogMiBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfRFRWX0RWQkhfQ0VfU1RBVEVfQ0hBTkdFRCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDIgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0RUVl9EVkJIX01DQVNUX0pPSU5fUkVRX1JDVkQsICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAxOCBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfRFRWX0RWQkhfTUNBU1RfTEVBVkVfUkVRX1JDVkQsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDE4IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9EVFZfRFZCSF9JTklUX1JFUV9SQ1ZELCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9EVFZfRFZCSF9NQ0FTVF9KT0lOX1NVQ0NFU1MsICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMTggYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0RUVl9EVkJIX01DQVNUX0pPSU5fRkFJTFVSRSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAxOCBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfRFRWX0RWQkhfTUNBU1RfTEVBVkVfU1VDQ0VTUywgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDE4IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9EVFZfRFZCSF9NQ0FTVF9MRUFWRV9GQUlMVVJFLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMTggYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0RUVl9EVkJIX0lOSVRfU1VDQ0VTUywgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0RUVl9EVkJIX0lOSVRfRkFJTFVSRSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisKKyAgRVZFTlRfR1BTX0xNX1NFU1NJT05fU1RBUlQsICAgICAgICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0dQU19MTV9TRVNTSU9OX0VORCwgICAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0dQU19MTV9GSVhfUkVRVUVTVF9TVEFSVCwgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0dQU19MTV9GSVhfUkVRVUVTVF9FTkQsICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0dQU19MTV9QUk1fUkVRVUVTVF9TVEFSVCwgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0dQU19MTV9QUk1fUkVRVUVTVF9FTkQsICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0dQU19MTV9TRVNTSU9OX0NPTlRJTlVFLCAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9HUFNfTE1fRklYX1JFUVVFU1RfQ09OVElOVUUsICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9HUFNfTE1fUFJNX1JFUVVFU1RfQ09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8qIDIgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0NPTlRFTlRfUkVUUklFVkFMX0JFR0lOICwgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0NPTlRFTlRfUkVUUklFVkFMX0NPTVBMRVRFLCAgICAgICAvKiA0IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9DT05URU5UX0JBQ0tVUF9CRUdJTiwgICAgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9DT05URU5UX0JBQ0tVUF9DT01QTEVURSwgICAgICAgICAgLyogMiBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfQ09OVEVOVF9GV0RfQkVHSU4sICAgICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfQ09OVEVOVF9GV0RfQ09NUExFVEUsICAgICAgICAgICAgIC8qIDIgYnl0ZSBwYXlsb2FkICovCisKKyAgRVZFTlRfSEFSRF9IQU5ET0ZGX1ZPSVBfVE9fQ0RNQSwgICAgICAgIC8qIDE0IGJ5dGUgcGF5bG9hZCAqLworCisgIEVWRU5UX0VBUF9TSU1fQUtBLCAgICAgICAgICAgICAgICAgICAgICAvKiAxNCBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfV0xBTl9DUF9NRUFTLCAgICAgICAgICAgICAgICAgICAgIC8qIDE2IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9XTEFOX0NQX0hPLCAgICAgICAgICAgICAgICAgICAgICAgLyogMTMgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1dMQU5fQ1BfMTFELCAgICAgICAgICAgICAgICAgICAgICAvKiA5ICBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfV0xBTl9NQywgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDIgIGJ5dGUgcGF5bG9hZCAqLworCisgIEVWRU5UX1NWR19DT05URU5UX1NFVCwgICAgICAgICAgICAgICAgICAvKiAyICBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfU1ZHX0NPTlRFTlRfUExBWSwgICAgICAgICAgICAgICAgIC8qIDIgIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9TVkdfQ09OVEVOVF9SRVNVTUUsICAgICAgICAgICAgICAgLyogMSAgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1NWR19DT05URU5UX1BBVVNFLCAgICAgICAgICAgICAgICAvKiAxICBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfU1ZHX0NPTlRFTlRfU1RPUCwgICAgICAgICAgICAgICAgIC8qIDEgIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9TVkdfQ09OVEVOVF9VU0VSRVZFTlQsICAgICAgICAgICAgLyogMTAgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1NWR19DT05URU5UX0dFVFVSSURBVEEsICAgICAgICAgICAvKiAzICBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfU1ZHX0NPTlRFTlRfVFJBTlNGT1JNLCAgICAgICAgICAgIC8qIDEwIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9TVkdfR0VUX1BBUkFNLCAgICAgICAgICAgICAgICAgICAgLyogMyAgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1NWR19TRVRfUEFSQU0sICAgICAgICAgICAgICAgICAgICAvKiAzICBieXRlIHBheWxvYWQgKi8KKworICBFVkVOVF9XTEFOX1dQQTIsICAgICAgICAgICAgICAgICAgICAgICAgLyogNSBieXRlIHBheWxvYWQgKi8KKworICBFVkVOVF9XQ0RNQV9QU0NfU0NBTk5FUl9TVE9QLCAgICAgICAgICAgLyogMSBieXRlIHBheWxvYWQgKi8KKworICBFVkVOVF9NRURJQV9QTEFZRVJfS0VZUFJFU1MsICAgICAgICAgICAgLyogNCBieXRlIHBheWxvYWQgKi8KKworICBFVkVOVF9XTEFOX01DX1FPUywgICAgICAgICAgICAgICAgICAgICAgLyogNSBieXRlIHBheWxvYWQgKi8KKworICBFVk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F9ETUJfUkVTRVJWRUQxLCAgICAgICAgICAgICAgICAgICAgLyogNCBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfRE1CX1JFU0VSVkVEMiwgICAgICAgICAgICAgICAgICAgIC8qIDQgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0RNQl9SRVNFUlZFRDMsICAgICAgICAgICAgICAgICAgICAvKiA0IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9ETUJfUkVTRVJWRUQ0LCAgICAgICAgICAgICAgICAgICAgLyogNCBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfRE1CX1JFU0VSVkVENSwgICAgICAgICAgICAgICAgICAgIC8qIDQgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0RNQl9SRVNFUlZFRDYsICAgICAgICAgICAgICAgICAgICAvKiA0IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9ETUJfUkVTRVJWRUQ3LCAgICAgICAgICAgICAgICAgICAgLyogNCBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfRE1CX1JFU0VSVkVEOCwgICAgICAgICAgICAgICAgICAgIC8qIDQgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0RNQl9SRVNFUlZFRDksICAgICAgICAgICAgICAgICAgICAvKiA0IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9ETUJfUkVTRVJWRUQxMCwgICAgICAgICAgICAgICAgICAgLyogNCBieXRlIHBheWxvYWQgKi8KKworICBFVkVOVF9NT0JJTEVWSUVXX1JFU0VSVkVEMSwgICAgICAgICAgICAgLyogVEJEICovCisgIEVWRU5UX01PQklMRVZJRVdfUkVTRVJWRUQyLCAgICAgICAgICAgICAvKiBUQkQgKi8KKyAgRVZFTlRfTU9CSUxFVklFV19SRVNFUlZFRDMsICAgICAgICAgICAgIC8qIFRCRCAqLworICBFVkVOVF9NT0JJTEVWSUVXX1JFU0VSVkVENCwgICAgICAgICAgICAgLyogVEJEICovCisgIEVWRU5UX01PQklMRVZJRVdfUkVTRVJWRUQ1LCAgICAgICAgICAgICAvKiBUQkQgKi8KKworICBFVkVOVF9IRFJfRE9TX01PX0RPU19TVEFUVVMsICAgICAgICAgICAgLyogMyBieXRlIHBheWxvYWQgKi8gCisKKyAgRVZFTlRfR1BTT05FWFRSQV9TVEFSVF9ET1dOTE9BRCwgICAgICAgIC8qIDQgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0dQU09ORVhUUkFfRU5EX0RPV05MT0FELCAgICAgICAgICAvKiA0IGJ5dGUgcGF5bG9hZCAqLworCisgIEVWRU5UX1NOU0RfR0VORVJJQywgICAgICAgICAgICAgICAgICAgICAvKiA4IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9TTlNEX0RFVklDRV9JTklULCAgICAgICAgICAgICAgICAgLyogOCBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfU05TRF9ERVZJQ0VfQ09ORklHVVJFRCwgICAgICAgICAgIC8qIDggYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1NOU0RfRVZFTlRfREFUQV9SRUFEWSwgICAgICAgICAgICAvKiA4IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9TTlNEX0VWRU5UX0NPTkRfTUVULCAgICAgICAgICAgICAgLyogOCBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfU05TRF9ERVZJQ0VfRE9XTiwgICAgICAgICAgICAgICAgIC8qIDggYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1NOU0RfRVJST1IsICAgICAgICAgICAgICAgICAgICAgICAvKiA4IGJ5dGUgcGF5bG9hZCAqLworICAKKyAgRVZFTlRfQ01fQ09VTlRSWV9TRUxFQ1RFRCwgICAgICAgICAgICAgIC8qIDIgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0NNX1NFTEVDVF9DT1VOVFJZLCAgICAgICAgICAgICAgICAvKiA3IGJ5dGUgcGF5bG9hZCAqLworCisgIEVWRU5UX0dQU19EQ01FX05FV19TVl9BRERFR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RU5UIFRPIEJFIFJFUExBQ0VEICovCisgIEVWRU5UX01PQklMRVZJRVdfUkVTRVJWRUQzMiwgICAgICAgICAgICAvKiBFVkVOVCBUTyBCRSBSRVBMQUNFRCAqLworCisgIEVWRU5UX0dQU19EQ01FX01FQVNfQ1lDTEVfU1RBUlQsICAgICAgICAvKiBObyBwYXlsb2FkICovIAorICBFVkVOVF9HUFNfRENNRV9NRUFTX0NZQ0xFX0VORCwgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLyAKKyAgRVZFTlRfR1BTX0NNRV9FTkdBR0VELCAgICAgICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8gCisgIEVWRU5UX0dQU19DTUVfTk9UX0VOR0FHRUQsICAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovIAorICBFVkVOVF9HUFNfRENNRV9FTkdBR0VELCAgICAgICAgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLyAKKyAgRVZFTlRfR1BTX0RDTUVfTk9UX0VOR0FHRUQsICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8gCisKKyAgRVZFTlRfSFNfVVNCX0RFVklDRV9BVFRBQ0hFRCwgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfSFNfVVNCX0hJRF9ESVNDT05FQ1QsICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfSFNfVVNCX0hJRF9DT05ORUNULCAgICAgICAgICAgICAgIC8qIDIgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0hTX1VTQl9NU0RfQ09OTkVDVCwgICAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0hTX1VTQl9NU0RfRElTQ09ORUNULCAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0hTX1VTQl9TVEFDS19TVVNQRU5ERUQsICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9IU19VU0J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AgICAgICAgIC8qIDIgYnl0ZSBwYXlsb2FkICovCisKKyAgRVZFTlRfUkxQX1FOX0FERCwgICAgICAgICAgICAgICAgICAgICAgIC8qIDMgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1JMUF9RTl9EUk9QLCAgICAgICAgICAgICAgICAgICAgICAvKiAzIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9STFBfTVVMVElMSU5LX05BSywgICAgICAgICAgICAgICAgLyogOSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfUkxQX1JFVl9MSU5LX05BSywgICAgICAgICAgICAgICAgIC8qIDkgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0dTVEtfRVZFTlQsICAgICAgICAgICAgICAgICAgICAgICAvKiAxNiBieXRlIHBheWxvYWQgKi8KKworICBFVkVOVF9HQU5fUkVHSVNUUkFUSU9OX1JFUVVFU1QsICAgICAgICAgLyogMSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfR0FOX1JFR0lTVEVSX0FDQ0VQVCwgICAgICAgICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0NBTExfUklOR0lOR19BTEVSVCwgICAgICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9HQU5fUEFHSU5HX1JFQ0VJVkVELCAgICAgICAgICAgICAgLyogMSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfR0FOX0NBTExfRElTQ09OTkVDVCwgICAgICAgICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0dBTl9DQUxMX1JFTEVBU0VfQ09NUExFVEUsICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9HQU5fSEFORElOX0NPTU1BTkQsICAgICAgICAgICAgICAgLyogMSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfR0FOX0hBTkRJTl9DT01QTEVURSwgICAgICAgICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0dBTl9IQU5ET1VUX0NPTU1BTkQsICAgICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9HQU5fSEFORE9VVF9DT01QTEVURSwgICAgICAgICAgICAgLyogMSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfR0FOX1NNU19TVEFSVCwgICAgICAgICAgICAgICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0dBTl9TTVNfQUNLLCAgICAgICAgICAgICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9HQU5fUURKX0VOUVVFVUUsICAgICAgICAgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9HQU5fUURKX0RFUVVFVUUsICAgICAgICAgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9HQU5fQUNUSVZBVEVfREFUQV9DSEFOTkVMLCAgICAgICAgLyogMSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfR0FOX0RBVEFfQ0hBTk5FTF9DT05ORUNURUQsICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0dBTl9STFBfU1VTUEVORCwgICAgICAgICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9HQU5fUkxQX1JFU1VNRSwgICAgICAgICAgICAgICAgICAgLyogMSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfR0FOX1dBS0VVUF9SRVEsICAgICAgICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfR0FOX1dBS0VVUF9DTkYsICAgICAgICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfR0FOX0hJQkVSTkFUSU9OX1JFUSwgICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfR0FOX0hJQkVSTkFUSU9OX0NORiwgICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKworICBFVkVOVF9XQ0RNQV9VTF9BTVJfUkFURSwgICAgICAgICAgICAgICAgLyogMTEgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0VVTF9UVElfUkVDT05GSUcsICAgICAgICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9XQ0RNQV9DT05OX1JFTF9DQVVTRSwgICAgICAgICAgICAgLyogMSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfV0NETUFfQ09OTl9SRVFfQ0FVU0UsICAgICAgICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovCisKKyAgRVZFTlRfTFRFX1RJTUlOR19BRFZBTkNFLCAgICAgICAgICAgICAgIC8qIDMgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0xURV9VTF9PVVRfT0ZfU1lOQywgICAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0xURV9TUFNfREVBQ1RJVkFURUQsICAgICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9MVEVfUkFDSF9BQ0NFU1NfU1RBUlQsICAgICAgICAgICAgLyogMiBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfTFRFX1JBQ0hfUkFJRF9NQVRDSCwgICAgICAgICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0xURV9SQUNIX0FDQ0VTU19SRVNVTFQsICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworCisgIEVWRU5UX0RUVl9MMV9QT1dFUlVQLCAgICAgICAgICAgICAgICAgICAvKiAyIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9EVFZfTDFfUE9XRVJET1dOLCAgICAgICAgICAgICAgICAgLyogMiBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfRFRWX0wxX1NPRlRfUkVTRVQsICAgICAgICAgICAgICA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T09TX1RJTUVfUkVNQUlOSU5HLCAgICAgICAgLyogNiBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfV0NETUFfUlJDQ1NQX1NDQU5fU1RBUlQsICAgICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1dDRE1BX0FDUVVJU0lUT05fU1VDQ0VTUywgICAgICAgICAvKiA1IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9XQ0RNQV9DRUxMX1NFTEVDVElPTl9GQUlMLCAgICAgICAgLyogMSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfV0NETUFfQlBMTU5fU1RBUlQsICAgICAgICAgICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1dDRE1BX0JQTE1OX0VORCwgICAgICAgICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9XQ0RNQV9CUExNTl9TQ0FOX1NUQVJULCAgICAgICAgICAgLyogMSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfV0NETUFfQlBMTU5fU0NBTl9FTkQsICAgICAgICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovCisKKyAgRVZFTlRfTVNHX0hJR0gsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDMyIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9NU0dfTUVELCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMzIgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX01TR19MT1csICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAzMiBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfTVNHX0VSUk9SLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIDMyIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9NU0dfRkFUQUwsICAgICAgICAgICAgICAgICAgICAgICAgLyogMzIgYnl0ZSBwYXlsb2FkICovCisKKyAgRVZFTlRfR0FOX1NUQVJUX1RVMzkxMCwgICAgICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfR0FOX1NUT1BfVFUzOTEwLCAgICAgICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8gCisgIEVWRU5UX0dBTl9FWFBJUllfVFUzOTEwLCAgICAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0dBTl9TVEFSVF9UVTM5MjAsICAgICAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0dBTl9TVE9QX1RVMzkyMCwgICAgICAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0dBTl9FWFBJUllfVFUzOTIwLCAgICAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0dBTl9TVEFSVF9UVTM5MDYsICAgICAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovIAorICBFVkVOVF9HQU5fU1RPUF9UVTM5MDYsICAgICAgICAgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLyAKKyAgRVZFTlRfR0FOX0VYUElSWV9UVTM5MDYsICAgICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfR0FOX1VSUl9SRUdJU1RFUl9VUERBVEUsICAgICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovCisKKyAgRVZFTlRfSVBTRUNfSUtFX1NBX0lOSVRfU0VOVCwgICAgICAgICAgICAvKiA4IGJ5dGVzIHBheWxvYWQgKi8KKyAgRVZFTlRfSVBTRUNfSUtFX1NBX0lOSVRfUkVDViwgICAgICAgICAgICAvKiAxNiBieXRlcyBwYXlsb2FkICovCisgIEVWRU5UX0lQU0VDX0lLRV9TQV9FU1RBQkxJU0hFRCwgICAgICAgICAgLyogMTYgYnl0ZXMgcGF5bG9hZCAqLworICBFVkVOVF9JUFNFQ19JS0VfQVVUSF9TRU5ULCAgICAgICAgICAgICAgIC8qIDE2IGJ5dGVzIHBheWxvYWQ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sICAgICAgICAgIC8qIDE2IGJ5dGVzIHBheWxvYWQgKi8KKyAgRVZFTlRfSVBTRUNfSUtFX1NBX1JFS0VZX0RPTkUsICAgICAgICAgICAvKiAxNiBieXRlcyBwYXlsb2FkICovCisgIEVWRU5UX0lQU0VDX0NISUxEX1NBX1JFS0VZX1NUQVJULCAgICAgICAgLyogOCBieXRlcyBwYXlsb2FkICovCisgIEVWRU5UX0lQU0VDX0NISUxEX1NBX1JFS0VZX0RPTkUsICAgICAgICAgLyogOCBieXRlcyBwYXlsb2FkICovCisgIEVWRU5UX0lQU0VDX0lLRV9NRVNHX1JFVFJBTlNNSVQsICAgICAgICAgLyogNCBieXRlcyBwYXlsb2FkICovCisgIEVWRU5UX0lQU0VDX0lLRV9OQVRfREVURUNURUQsICAgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9JUFNFQ19JS0VfTkFUX0tFRVBBTElWRV9TRU5ULCAgICAgIC8qIDE2IGJ5dGVzIHBheWxvYWQgKi8KKyAgRVZFTlRfSVBTRUNfSUtFX0RQRF9TRU5ULCAgICAgICAgICAgICAgICAvKiAxNiBieXRlcyBwYXlsb2FkICovCisgIEVWRU5UX0lQU0VDX0lLRV9FUlJfTk9USUZZX1NFTlQsICAgICAgICAgLyogNCBieXRlcyBwYXlsb2FkICovCisgIEVWRU5UX0lQU0VDX0lLRV9FUlJfTk9USUZZX1JFQ1YsICAgICAgICAgLyogNCBieXRlcyBwYXlsb2FkICovCisKKyAgRVZFTlRfR0FOX1JPVkVJTl9DTkYsICAgICAgICAgICAgICAgICAgICAvKiBObyBwYXlsb2FkICovCisgIEVWRU5UX0dBTl9ST1ZFT1VUX0NORiwgICAgICAgICAgICAgICAgICAgLyogTm8gcGF5bG9hZCAqLworICBFVkVOVF9HQU5fUlJDX1JPVkVJTl9DTkYsICAgICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfR0FOX1JSQ19ST1ZFSU5fUkVKLCAgICAgICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9HQU5fUlJDX1JPVkVPVVRfQ05GLCAgICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfR0FOX1JSQ19ST1ZFT1VUX1JFSiwgICAgICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworCisgIEVWRU5UX0dQU1hUUkFfVF9TRVNTX0JFR0lOLCAgICAgICAgICAgICAgLyogMSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfR1BTWFRSQV9UX1NFU1NfREFUQSwgICAgICAgICAgICAgICAvKiA4IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9HUFNYVFJBX1RfU0VTU19ET05FLCAgICAgICAgICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0dQU1hUUkFfVF9TRVNTX0VORCwgICAgICAgICAgICAgICAgLyogNCBieXRlIHBheWxvYWQgKi8KKworICBFVkVOVF9EU19HT19OVUxMX1RJTUVSLCAgICAgICAgICAgICAgICAgIC8qIDUgYnl0ZSBwYXlsb2FkICovCisKKyAgRVZFTlRfTFRFX1JSQ19USU1FUl9TVEFUVVMsICAgICAgICAgICAgICAvKiA2IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9MVEVfUlJDX1NUQVRFX0NIQU5HRSwgICAgICAgICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0xURV9SUkNfT1VUX09GX1NFUlZJQ0UsICAgICAgICAgICAgLyogMiBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfTFRFX1JSQ19SQURJT19MSU5LX0ZBSUxVUkUsICAgICAgICAvKiAyIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9MVEVfUlJDX0RMX01TRywgICAgICAgICAgICAgICAgICAgIC8qIDIgYnl0ZSBwYXlsb2FkICovIAorICBFVkVOVF9MVEVfUlJDX1VMX01TRywgICAgICAgICA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VZFTlRfTUJQX1JGX0FOQUxPR19KRF9JTlQsICAgICAgICAgICAgICAvKiA0IGJ5dGUgcGF5bG9hZCAqLworCisgIEVWRU5UX0NHUFNfUVdJUF9TWVNEX1RSQU5TSVRJT04sICAgICAgICAgLyogNCBieXRlIHBheWxvYWQgKi8KKyAgCisgIEVWRU5UX0hQTE1OX1RJTUVSX0VYUElSRUQsICAgICAgICAgICAgICAgLyogTm8gUGF5bG9hZCAqLworCisgIEVWRU5UX0dTRElfR0VUX0ZFQVRVUkVfSU5ESUNBVE9SX0RBVEEsICAgLyogNiBieXRlIHBheWxvYWQgKi8KKworICBFVkVOVF9MVEVfQ01fSU5DT01JTkdfTVNHLCAgICAgICAgICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0xURV9DTV9PVVRHT0lOR19NU0csICAgICAgICAgICAgICAgLyogMSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfTFRFX0VNTV9JTkNPTUlOR19NU0csICAgICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9MVEVfRU1NX09VVEdPSU5HX01TRywgICAgICAgICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0xURV9FTU1fVElNRVJfU1RBUlQsICAgICAgICAgICAgICAgLyogMSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfTFRFX0VNTV9USU1FUl9FWFBJUlksICAgICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworCisgIEVWRU5UX0xURV9SRUdfSU5DT01JTkdfTVNHLCAgICAgICAgICAgICAgLyogMSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfTFRFX1JFR19PVVRHT0lOR19NU0csICAgICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9MVEVfRVNNX0lOQ09NSU5HX01TRywgICAgICAgICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0xURV9FU01fT1VUR09JTkdfTVNHLCAgICAgICAgICAgICAgLyogMSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfTFRFX0VTTV9USU1FUl9TVEFSVCwgICAgICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9MVEVfRVNNX1RJTUVSX0VYUElSWSwgICAgICAgICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovCisKKyAgRVZFTlRfU05TX0NPTlRFWFRfT1BFTiwgICAgICAgICAgICAgICAgICAvKiA0IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9TTlNfQ09OVEVYVF9DTE9TRSwgICAgICAgICAgICAgICAgIC8qIDQgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1NOU19DT05EX1NFVCwgICAgICAgICAgICAgICAgICAgICAgLyogOCBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfU05TX0NPTkRfQ0FOQ0VMLCAgICAgICAgICAgICAgICAgICAvKiA4IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9TTlNfQ09ORF9NRVQsICAgICAgICAgICAgICAgICAgICAgIC8qIDggYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1NOU19EQVRBX1NUQVJULCAgICAgICAgICAgICAgICAgICAgLyogMTIgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1NOU19EQVRBX1NUT1AsICAgICAgICAgICAgICAgICAgICAgLyogOCBieXRlIHBheWxvYWQgKi8KKworICBFVkVOVF9XQ0RNQV9STENfQ09ORklHLCAgICAgICAgICAgICAgICAgIC8qIDQgYnl0ZSBwYXlsb2FkICovCisKKyAgRVZFTlRfSFNQQV9QTFVTX0NGRywgICAgICAgICAgICAgICAgICAgICAvKiA2IGJ5dGUgcGF5bG9hZCAqLworCisgIEVWRU5UX1NOU19EUklWRVJfU1RBVEVfQ0hBTkdFLCAgICAgICAgICAgLyogOSBieXRlIHBheWxvYWQgKi8KKworICBFVkVOVF9XQ0RNQV9USU1FUl9ESVNDQVJEX0VYUElSWSwgICAgICAgIC8qIDMgYnl0ZSBwYXlsb2FkICovICAKKworICBFVkVOVF9OQVNfQ0JfUEFHRV9SRUNFSVZFRCwgICAgICAgICAgICAgIC8qIDUgYnl0ZSBwYXlsb2FkICovICAKKworICBFVkVOVF9XQ0RNQV9STENfUkVTRVQsICAgICAgICAgICAgICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovICAKKworICBFVkVOVF9IRFJfTVJMUF9FSFJQRF9QRVJTT05BTElUWV9JU19BQ1RJVkUsIC8qIDEgYnl0ZSBwYXlsb2FkICovICAKKyAgCisgIEVWRU5UX1dMQU5fU0VDVVJJVFksICAgICAgICAgICAgICAgICAgICAgLyogMTMgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1dMQU5fU1RBVFVTLCAgICAgICAgICAgICAgICAgICAgICAgLyogMTUgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1dMQU5fSEFORE9GRiwgICAgICAgICAgICAgICAgICAgICAgLyogMTUgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1dMQU5fVkNDLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogOCBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfV0xBTl9RT1MsICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAyIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9XTEFOX1BFLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDE2IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9XTEFOX0FERF9CTE9DS19BQ0tfU1VDQ0VTUywgICAgICAgIC8qIDExIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9XTEFOX0FERF9CTE9DS19BQ0tfRkFJTEVELCAgICAgICAgIC8qIDkgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1dMQU5fREVMRVRFX0JMT0NLX0FDS19TVUNDRVNTLCAgICAgLyogOCBieXRlIHBheWx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IE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfV0xBTl9XUFNfUEJDX0FQX0RFVEVDVEVELCAgICAgICAgICAvKiAxNCBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfV0xBTl9XUFNfUkVHSVNUUkFUSU9OX1NUQVJULCAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9XTEFOX1dQU19XU0NfTUVTU0FHRSwgICAgICAgICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX1dMQU5fV1BTX0RJU0NPVkVSWSwgICAgICAgICAgICAgICAgLyogNyBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfV0xBTl9XUFNfUkVHSVNUUkFUSU9OX0NPTVBMRVRFLCAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9XTEFOX1dQU19ESVNDT05ORUNULCAgICAgICAgICAgICAgIC8qIE5vIHBheWxvYWQgKi8KKyAgRVZFTlRfV0xBTl9CVEMsICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAxNSBieXRlIHBheWxvYWQgKi8KKworICBFVkVOVF9JUFY2X1NNX0VWRU5ULCAgICAgICAgICAgICAgICAgICAgIC8qIDQgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0lQVjZfU01fVFJBTlNJVElPTiwgICAgICAgICAgICAgICAgLyogNSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfSVBWNl9QUkVGSVhfVVBEQVRFLCAgICAgICAgICAgICAgICAvKiAxMyBieXRlIHBheWxvYWQgKi8KKworICBFVkVOVF9MVEVfTUwxX1NUQVRFX0NIQU5HRSwgICAgICAgICAgICAgIC8qIDIgYnl0ZSBwYXlsb2FkICovCisKKyAgRVZFTlRfQVVUSF9QUk9UTywgICAgICAgICAgICAgICAgICAgICAgICAvKiAyIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9WU05DUCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDI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U5UX0NNX0RTX01PREVfUFJFRiwgICAgICAgICAgICAgICAgICAgLyogNSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfQ01fRFNfR1dfQUNRX09SREVSX1BSRUYsICAgICAgICAgICAvKiA1IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9DTV9EU19TUlZfRE9NQUlOX1BSRUYsICAgICAgICAgICAgIC8qIDUgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0NNX0RTX0JBTkRfUFJFRiwgICAgICAgICAgICAgICAgICAgLyogNSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfQ01fRFNfUk9BTV9QUkVGLCAgICAgICAgICAgICAgICAgICAvKiA1IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9DTV9EU19IWUJSSURfUFJFRiwgICAgICAgICAgICAgICAgIC8qIDUgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0NNX0RTX05FVFdPUktfU0VMX01PREVfUFJFRiwgICAgICAgLyogNSBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfQ01fRFNfQ0FMTF9FVkVOVF9PUklHLCAgICAgICAgICAgICAvKiA0IGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9DTV9EU19DQUxMX0VWRU5UX0NPTk5FQ1QsICAgICAgICAgIC8qIDQgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0NNX0RTX0NBTExfRVZFTlRfRU5ELCAgICAgICAgICAgICAgLyogMyBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfQ01fRFNfRU5URVJfRU1FUkdFTkNZX0NCLCAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9DTV9EU19FWElUX0VNRVJHRU5DWV9DQiwgICAgICAgICAgIC8qIDEgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0NNX0RTX0NBTExfU1RBVEUsICAgICAgICAgICAgICAgICAgLyogMiBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfQ01fRFNfRFNfSU5URVJSQVRfU1RBVEUsICAgICAgICAgICAvKiAzIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9DTV9EU19DRUxMX1NSVl9JTkQsICAgICAgICAgICAgICAgIC8qIDYgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0NNX0RTX0NPVU5UUllfU0VMRUNURUQsICAgICAgICAgICAgLyogMyBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfQ01fRFNfREFUQV9BVkFJTEFCTEUsICAgICAgICAgICAgICAvKiAyIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9DTV9EU19TRUxFQ1RfQ09VTlRSWSwgICAgICAgICAgICAgIC8qIDggYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0NNX0RTX0NBTExfRVZFTlRfT1JJR19USFIsICAgICAgICAgLyogNCBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfQ01fRFNfUExNTl9GT1VORCwgICAgICAgICAgICAgICAgICAvKiAxMyBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfQ01fRFNfU0VSVklDRV9DT05GSVJNRUQsICAgICAgICAgICAvKiAxMyBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfQ01fRFNfR0VUX1BBU1NXT1JEX0lORCwgICAgICAgICAgICAvKiAzIGJ5dGUgcGF5bG9hZCAqLworICBFVkVOVF9DTV9EU19QQVNTV09SRF9BVVRIRU5USUNBVElPTl9TVEFUVVMsIC8qIDMgYnl0ZSBwYXlsb2FkICovCisgIEVWRU5UX0NNX0RTX1VTU19SRVNQT05TRV9OT1RJRllfSU5ELCAgICAgLyogNCBieXRlIHBheWxvYWQgKi8KKyAgRVZFTlRfQ01fRFNfTENTX01PTFJfQ09ORiwgICAgICAgICAgICAgICAvKiAyIGJ5dGUgcGF5bG9hZCAqLworCisgIEVWRU5UX0RTX05BU19NRVNTQUdFX1NFTlQsICAgICAgICAgICAgICAgLyogNSBieXRlIHBheWxvYWQgKi8gC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fUExNTl9MSVNUX1NUQVJULCAgICAgICAgICAgICAgIC8qIDIgYnl0ZSBwYXlsb2FkICovIC8qMTgxMiovCisgIEVWRU5UX0dTTV9EU19QTE1OX0xJU1RfRU5ELCAgICAgICAgICAgICAgICAgLyogMSBieXRlIHBheWxvYWQgKi8gLyoxODEzKi8KKyAgRVZFTlRfR1NNX0RTX1BPV0VSX1NDQU5fU1RBVFVTLCAgICAgICAgICAgICAvKiAyIGJ5dGUgcGF5bG9hZCAqLyAvKjE4MTQqLworICBFVkVOVF9HU01fRFNfUkVTRUxFQ1RfU1RBUlQsICAgICAgICAgICAgICAgIC8qIDIgYnl0ZSBwYXlsb2FkICovIC8qMTgxNSovCisgIEVWRU5UX0dTTV9EU19SUl9JTl9TRVJWSUNFLCAgICAgICAgICAgICAgICAgLyogMSBieXRlIHBheWxvYWQgKi8gLyoxODE2Ki8KKyAgRVZFTlRfR1NNX0RTX1JSX09VVF9PRl9TRVJWSUNFLCAgICAgICAgICAgICAvKiAxIGJ5dGUgcGF5bG9hZCAqLyAvKjE4MTcqLworICBFVkVOVF9HU01fRFNfVElNRVJfRVhQSVJFRCwgICAgICAgICAgICAgICAgIC8qIDMgYnl0ZSBwYXlsb2FkICovIC8qMTgxOCovCisgIEVWRU5UX0dTTV9EU19UT19XQ0RNQV9SRVNFTEVDVF9FTkQsICAgICAgICAgLyogNiBieXRlIHBheWxvYWQgKi8gLyoxODE5Ki8KKworICBFVkVOVF9DTV9EU19TWVNURU1fTU9ERSwgICAgICAgICAgICAgICAgICAgIC8qMiBieXRlIHBheWxvYWQqLyAvKjE4MjAqLworICBFVkVOVF9TRF9EU19FVkVOVF9BQ1RJT04sICAgICAgICAgICAgICAgICAgIC8qOSBieXRlIHBheWxvYWQqLyAvKjE4MjEqLworICBFVkVOVF9TTUdNTV9EU19SRVFVRVNUX1NFTlQsICAgICAgICAgICAgICAgIC8qMyBieXRlIHBheWxvYWQqLyAvKjE4MjIqLworCisgIEVWRU5UX0lGQUNFLCAg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IHBheWxvYWRfcHRyLCBldl9pZCApIFwKKyAgIGRvICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICB2b3NfZXZlbnRfcmVwb3J0X3BheWxvYWQoIGV2X2lkLCAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiggKihwYXlsb2FkX3B0cikgKSwgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopKHBheWxvYWRfcHRyKSApOyAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICB9IHdoaWxlICgwKQorCisjZWxzZSAvKiBGRUFUVVJFX1dMQU5fRElBR19TVVBQT1JUICovCisKKyNkZWZpbmUgV0xBTl9WT1NfRElBR19FVkVOVF9ERUYoIHBheWxvYWRfbmFtZSwgcGF5bG9hZF90eXBlICkgCisjZGVmaW5lIFdMQU5fVk9TX0RJQUdfRVZFTlRfUkVQT1JUKCBwYXlsb2FkX3B0ciwgZXZfaWQgKSAKKworI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9ESUFHX1NVUFBPUlQgKi8KKworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gCisgIEZ1bmN0aW9uIGRlY2xhcmF0aW9ucyBhbmQgZG9jdW1lbmF0aW9uCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisjaWZkZWYgRkVBVFVSRV9XTEFOX0RJQUdfU1VQUE9SVAordm9pZCB2b3NfbG9n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0lEX3QgKnBsb2dfaGRyX3B0cik7Cit2b2lkIHZvc19sb2dfc3VibWl0KHZfVk9JRF90ICpwbG9nX2hkcl9wdHIpOworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBBbGxvY2F0ZSBhbiBldmVudCBwYXlsb2FkIGhvbGRlcgorLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKworI2RlZmluZSBXTEFOX1ZPU19ESUFHX0xPR19BTExPQyggcGF5bG9hZF9wdHIsIHBheWxvYWRfdHlwZSwgbG9nX2NvZGUgKSBcCisgICAgICAgICAgIGRvIFwKKyAgICAgICAgICAgeyAgXAorICAgICAgICAgICAgICBwYXlsb2FkX3B0ciA9ICggcGF5bG9hZF90eXBlICopdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHBheWxvYWRfdHlwZSkpO1wKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgaWYoIHBheWxvYWRfcHRyICkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICB2b3NfbWVtX3plcm8ocGF5bG9hZF9wdHIsIHNpemVvZihwYXlsb2FkX3R5cGUpKTsgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgdm9zX2xvZ19zZXRfY29kZShwYXlsb2FkX3B0ciwgbG9nX2NvZGUpOyAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgIHZvc19sb2dfc2V0X2xlbmd0aChwYXlsb2FkX3B0ciwgc2l6ZW9mKHBheWxvYWRfdHlwZSkpOyAgICAgICAgXAorICAgICAgICAgICAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgfSB3aGlsZSAoMCkKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgUmVwb3J0IHRoZSBldmVudAorLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyNkZWZpbmUgV0xBTl9WT1NfRElBR19MT0dfUkVQT1JUKCBwYXlsb2FkX3B0ciApIFwKKyAgICBkbyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICBpZiggcGF5bG9hZF9wdHIpICAgICAgICAgICAgICBcCisgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgIHZvc19sb2dfc3VibWl0KCBwYXlsb2FkX3B0cik7ICBcCisgICAgICAgICAgdm9zX21lbV9mcmVlKHBheWxvYWRfcHRyKTsgXAorICAgICAgIH0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICB9IHdoaWxlICgwKQorICAgIAorLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgRnJlZSB0aGUgcGF5bG9hZAorLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyNkZWZpbmUgV0xBTl9WT1NfRElBR19MT0dfRlJFRSggcGF5bG9hZF9wdHIgKSBcCisgICAgZG8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgaWYoIHBheWxvYWRfcHRyKSAgICAgICAgICAgICAgXAorICAgICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICB2b3NfbWVtX2ZyZWUocGF5bG9hZF9wdHIpOyBcCisgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIH0gd2hpbGUgKDApCisgICAgCisKKyNlbHNlIC8qIEZFQVRVUkVfV0xBTl9ESUFHX1NVUFBPUlQgKi8KKworI2RlZmluZSBXTEFOX1ZPU19ESUFHX0xPR19BTExPQyggcGF5bG9hZF9wdHIsIHBheWxvYWRfdHlwZSwgbG9nX2NvZGUgKSAKKyNkZWZpbmUgV0xBTl9WT1NfRElBR19MT0dfUkVQT1JUKCBwYXlsb2FkX3B0ciApIAorI2RlZmluZSBXTEFOX1ZPU19ESUFHX0xPR19GUkVFKCBwYXlsb2FkX3B0ciApCisKKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fRElBR19TVVBQT1JUICovCisKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tIAorICBGdW5jdGlvbiBkZWNsYXJhdGlvbnMgYW5kIGRvY3VtZW5hdGlvbgorICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworCisjaWZkZWYgX19jcGx1c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ElTIFNPRlRXQVJFLgorICovCisKKy8qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisjaWYgIWRlZmluZWQoIF9fSV9WT1NfTE9DS19IICkKKyNkZWZpbmUgX19JX1ZPU19MT0NLX0gKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAKKyAgXGZpbGUgIGlfdm9zX2xvY2suaAorICAKKyAgXGJyaWVmIExpbnV4LXNwZWNpZmljIGRlZmluaXRpb25zIGZvciB2T1NTIExvY2tzCisgIAorICAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyogJEhlYWRlciQgKi8KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBJbmNsdWRlIEZpbGVzCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisjaW5jbHVkZSA8dm9zX3R5cGVzLmg+CisjaW5jbHVkZSA8bGludXgvbXV0ZXguaD4KKyNpbmNsdWRlIDxsaW51eC9zcGlubG9jay5oPgorI2luY2x1ZGUgPGxpbnV4L3NjaGVkLmg+CisjaWYgZGVmaW5lZChXTEFOX09QRU5fU09VUkNFKQorI2luY2x1ZGUgPGxpbnV4L3dha2Vsb2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YgT1IgSU4gQ09OTkVDVElPTiBXSVRIIFRIRSBVU0UgT1IKKyAqIFBFUkZPUk1BTkNFIE9GIFRISVMgU09GVFdBUkUuCisgKi8KKworLyoKKyAqIFRoaXMgZmlsZSB3YXMgb3JpZ2luYWxseSBkaXN0cmlidXRlZCBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKyNpZiAhZGVmaW5lZCggX19JX1ZPU19USU1FUl9IICkKKyNkZWZpbmUgX19JX1ZPU19USU1FUl9ICisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgCisgIFxmaWxlICBpX3Zvc190aW1lci5oCisgIAorICBcYnJpZWYgTGludXgtc3BlY2lmaWMgZGVmaW5pdGlvbnMgZm9yIHZPU1MgcGFja2V0cworICAKKyAgCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qICRIZWFkZXIkICovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgSW5jbHVkZSBGaWxlcworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworI2luY2x1ZGUgPHZvc190aW1lci5oPgorI2luY2x1ZGUgPHZvc190eXBlcy5oPgorI2luY2x1ZGUgPGxpbnV4L3RpbWVyLmg+CisjaW5jbHVkZSA8bGludXgvdGltZS5oP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VmZmVyLCB1bnNpZ25lZCAgaW50IHNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgKnN0ckZvcm1hdCwgLi4uKTsKKyNkZWZpbmUgVk9TX1NOUFJJTlRGIHZvc19zbnByaW50ZgorCisjaWZkZWYgVk9TX0VOQUJMRV9UUkFDSU5HCisKKworI2RlZmluZSBWT1NfQVNTRVJUKCBfY29uZGl0aW9uICkgZG8geyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICBpZiAoICEgKCBfY29uZGl0aW9uICkgKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgcHJpbnRrKEtFUk5fQ1JJVCAiVk9TIEFTU0VSVCBpbiAlcyBMaW5lICVkXG4iLCBfX2Z1bmNfXywgX19MSU5FX18pOyBcCisgICAgICAgICAgICBXQVJOX09OKDEpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgIH0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgfSB3aGlsZSgwKQorCisjZWxzZSAKKworCisgIC8vIFRoaXMgY29kZSB3aWxsIGJlIHVzZWQgZm9yIGNvbXBpbGF0aW9uIGlmIHRyYWNpbmcgaXMgdG8gYmUgY29tcGlsZWQgb3V0CisgIC8vIG9mIHRoZSBjb2RlIHNvIHRoZXNlIGZ1bmN0aW9ucy9tYWNyb3MgYXJlICdkbyBub3RoaW5nJworICBWT1NfSU5MSU5FX0ZOIHZvaWQgdm9zX3RyYWNlX21zZyggVk9TX01PRFVMRV9JRCBtb2R1bGUsIC4uLiApe30KKyAgCisgICNkZWZpbmUgVk9TX0FTU0VSVCggX2NvbmRpdGlvbiApCisKKyNlbmRpZgorCisjaWZkZWYgUEFOSUNfT05fQlVHCisKKyNkZWZpbmUgVk9TX0JVRyggX2NvbmRpdGlvbiApIGRvIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgaWYgKCAhICggX2NvbmRpdGlvbiApICkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgIHByaW50ayhLRVJOX0NSSVQgIlZPUyBCVUcgaW4gJXMgTGluZSAlZFxuIiwgX19mdW5jX18sIF9fTElORV9fKTsgXAorICAgICAgICAgICAgQlVHX09OKDEpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIH0gd2hpbGUoMCkKKworI2Vsc2UKKworI2RlZmluZSBWT1NfQlVHKCBfY29uZGl0aW9uICkgZG8geyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICBpZiAoICEgKCBfY29uZGl0aW9uICkgKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgcHJpbnRrKEtFUk5fQ1JJVCAiVk9TIEJVRyBpbiAlcyBMaW5lICVkXG4iLCBfX2Z1bmNfXywgX19MSU5FX18pOyBcCisgICAgICAgICAgICBXQVJOX09OKDEpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgIH0gICAgICAgICAgICAgICAgICAgICAgICAgIC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3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmbmRlZiBMT0dfQ09ERVNfSAorI2RlZmluZSBMT0dfQ09ERVNfSAorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgICAgTG9nIENvZGUgRGVmaW5pdGlvbnMKKworR2VuZXJhbCBEZXNjcmlwdGlvbgorICBUaGlzIGZpbGUgY29udGFpbnMgbG9nIGNvZGUgZGVmaW5pdGlvbnMgYW5kIGlzIHNoYXJlZCB3aXRoIHRoZSB0b29scy4KKworQ29weXJpZ2h0IChjKSAxOTkxLTIwMTAgYnkgUVVBTENPTU0sIEluYy4gIEFsbCBSaWdodHMgUmVzZXJ2ZWQuCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKiBETyBOT1QgTU9ESUZZIFRISVMgRklMRSBXSVRIT1VUIFBSSU9SIEFQUFJPVkFMCisqKgorKiogTG9nIGNvZGVzLCBieSBkZXNpZ24sIGFyZSBhIHRpZ2h0bHkgY29udHJvbGxlZCBzZXQgb2YgdmFsdWVzLiAgCisqKiBEZXZlbG9wZXJzIG1heSBub3QgY3JlYXRlIGxvZyBjb2RlcyBhdCB3aWxsLgorKioKKyoqIFJlcXVlc3QgbmV3IGxvZ3MgdXNpbmcgdGhlIGZvbGxvd2luZyBwcm9jZXNzOgorKioKKyoqIDEuIFNlbmQgZW1haWwgdG8gYXN3LmRpYWcucmVxdWVzdCByZXF1ZXN0aW5nIGxvZyBjb2Rhc3NpZ25tZW50cy4KKyoqIDIuIElkZW50aWZ5IHRoZSBsb2cgbmVlZGVkIGJ5IG5hbWUuCisqKiAzLiBQcm92aWRlIGEgYnJpZWYgZGVzY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zc29jaWF0ZWQgd2l0aCBlYWNoIGNvZGUgYXJlIGRlZmluZWQgYmVsb3cuCisgKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisKKy8qIFRoZSB1cHBlciA0IGJpdHMgb2YgdGhlIDE2IGJpdCBsb2cgZW50cnkgY29kZSBzcGVjaWZ5IHdoaWNoIHR5cGUKKyAqIG9mIGVxdWlwbWVudCBjcmVhdGVkIHRoZSBsb2cgZW50cnkuICovCisKKy8qIDAgTW9iaWxlIFN0YXRpb24gdGVtcG9yYWwgYW5hbHl6ZXIgZW50cnkgKi8KKyNkZWZpbmUgTE9HX1RBX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgwICsgTE9HXzFYX0JBU0VfQykKKworLyogMSBBR0MgdmFsdWVzIGFuZCBjbG9zZWQgbG9vcCBwb3dlciBjb250cm9sIGVudHJ5ICovCisjZGVmaW5lIExPR19BR0NfUENUTF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MSArIExPR18xWF9CQVNFX0MpCisKKy8qIDIgRm9yd2FyZCBsaW5rIGZyYW1lIHJhdGVzIGFuZCB0eXBlcyBlbnRyeSAqLworI2RlZmluZSBMT0dfRl9NVVgxX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDIgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAzIFJldmVyc2UgbGluayBmcmFtZSByYXRlcyBhbmQgdHlwZXMgZW50cnkgKi8KKyNkZWZpbmUgTE9HX1JfTVVYMV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgzICsgTE9HXzFYX0JBU0VfQykKKworLyogNCBBY2Nlc3MgY2hhbm5lbCBtZXNzYWdlIGVudHJ5ICovCisjZGVmaW5lIExPR19BQ19NU0dfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4NCArIExPR18xWF9CQVNFX0MpCisKKy8qIDUgUmV2ZXJzZSBsaW5rIHRyYWZmaWMgY2hhbm5lbCBtZXNzYWdlIGVudHJ5ICovCisjZGVmaW5lIExPR19SX1RDX01TR19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4NSArIExPR18xWF9CQVNFX0MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisvKiA2IFN5bmMgY2hhbm5lbCBtZXNzYWdlIGVudHJ5ICovCisjZGVmaW5lIExPR19TQ19NU0dfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4NiArIExPR18xWF9CQVNFX0MpCisKKy8qIDcgUGFnaW5nIGNoYW5uZWwgbWVzc2FnZSBlbnRyeSAqLyAKKyNkZWZpbmUgTE9HX1BDX01TR19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHg3ICsgTE9HXzFYX0JBU0VfQykKKworLyogOCBGb3J3YXJkIGxpbmsgdHJhZmZpYyBjaGFubmVsIG1lc3NhZ2UgZW50cnkgKi8KKyNkZWZpbmUgTE9HX0ZfVENfTVNHX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHg4ICsgTE9HXzFYX0JBU0VfQykKKworLyogOSBGb3J3YXJkIGxpbmsgdm9jb2RlciBwYWNrZXQgZW50cnkgKi8KKyNkZWZpbmUgTE9HX1ZPQ19GT1JfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHg5ICsgTE9HXzFYX0JBU0VfQykKKworLyogMTAgUmV2ZXJzZSBsaW5rIHZvY29kZXIgcGFja2V0IGVudHJ5ICovCisjZGVmaW5lIExPR19WT0NfUkVWX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4QSArIExPR18xWF9CQVNFX0MpCisKKy8qIDExIFRlbXBvcmFsIGFuYWx5emVyIGZpbmdlciBpbmZvIG9ubHkgKi8KKyNkZWZpbmUgTE9HX0ZJTkdfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHhCICsgTE9HXzFYX0JBU0VfQykKKworLyogMTIgU2VhcmNoZXIgcGF0aGxvZyBpbmZvIChSZXVzZWQgb2xkIFNSQ0ggbG9ndHlwZSkgKi8KKyNkZWZpbmUgTE9HX1NSQ0hfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHhDICsgTE9HXzFYX0JBU0VfQykKKworLyogMTMgUG9zaXRpb24gYW5kIHNwZWVkIGluZm9ybWF0aW9uIHJlYWQgZnJvbSBFVEFLICovCisjZGVmaW5lIExPR19FVEFLX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4RCArIExPR18xWF9CQVNFX0MpCisKKy8qIDE0IE1hcmtvdiBmcmFtZSBzdGF0aXN0aWNzICovCisjZGVmaW5lIExPR19NQVJfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4RSArIExPR18xWF9CQVNFX0MpCisKKy8qIDE1IE5ldyBhbmQgaW1wcm92ZWQgdGVtcG9yYWwgYW5hbHl6ZXIgc2VhcmNoZXIgaW5mbyAqLworI2RlZmluZSBMT0dfU1JDSDJfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweEYgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAxNiBUaGUgRnVqaXRzdSBoYW5kc2V0IGluZm9ybWF0aW9uICovCisjZGVmaW5lIExPR19IQU5EU0VUX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MTAgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAxNyBWb2NvZGVyIGJpdCBlcnJvciByYXRlIG1hc2sgKi8KKyNkZWZpbmUgTE9HX0VSUk1BU0tfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgxMSArIExPR18xWF9CQVNFX0MpCisKKy8qIDE4IEFuYWxvZyB2b2ljZSBjaGFubmVsIGluZm9ybWF0aW9uICovCisjZGVmaW5lIExPR19BTkFMT0dfSU5GT19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MTIgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAxOSBBY2Nlc3MgcHJvYmUgaW5mb3JtYXRpb24gKi8KKyNkZWZpbmUgTE9HX0FDQ19JTkZPX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgxMyArIExPR18xWF9CQVNFX0MpCisKKy8qIDIwIFBvc2l0aW9uICYgc3BlZWQgaW5mbyByZWFkIGZyb20gR1BTIHJlY2VpdmVyICovCisjZGVmaW5lIExPR19HUFNfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MTQgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAyMSBUZXN0IENvbW1hbmQgaW5mb3JtYXRpb24gKi8KKyNkZWZpbmUgTE9HX1RFU1RfQ01EX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgxNSArIExPR18xWF9CQVNFX0MpCisKKy8qIDIyIFNwYXJzZSAoMjBtcykgQUdDIC8gY2xvc2VkIGxvb3AgcG93ZXIgY29udHJvbCBlbnRyeSAqLworI2RlZmluZSBMT0dfU19BR0NfUENUTF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDE2ICsgTE9HXzFYX0JBU0VfQykKKyAgCisvKiAyMyBOb3RpZmljYXRpb24gb2YgYSBiYW5kIGNsYXNzIGNoYW5nZSAqLworI2RlZmluZSBMT0dfQkFORF9DSEFOR0VfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDE3ICsgTE9HXzFYX0JBU0VfQykKKworLyogMjQgRE0gZGVidWcgbWVzc2FnZXMsIGlmIGJlaW5nIGxvZ2dlZCB2aWEgbG9nIHNlcnZpY2VzICovCisjZGVmaW5lIExPR19EQkdfTVNHX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MTggKyBMT0dfMVhfQkFTRV9DKQorCisvKiAyNSBHZW5lcmFsIHRlbXBvcmFsIGFuYWx5emVyIGVudHJ5ICovCisjZGVmaW5lIExPR19HRU5STF9UQV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MTkgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAyNiBHZW5lcmFsIHRlbXBvcmFsIGFuYWx5emVyIHcvc3VwcGxlbWVudGFsIGNoYW5uZWxzICovCisjZGVmaW5lIExPR19HRU5STF9UQV9TVVBfQ0hfQyAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MUEgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBGZWF0dXJpemF0aW9uIFJlbW92YWwgcmVxdWVzdGVkIGJ5IENNSSAKKyNpZmRlZiBGRUFUVVJFX1BMVCAKKyovCisKKy8qIDI3IERlY29kZXIgcmF3IGJpdHMgbG9nZ2luZyAqLworI2RlZmluZSBMT0dfUExUX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDFCICsgTE9HXzFYX0JBU0VfQykKKworLyogRmVhdHVyaXphdGlvbiBSZW1vdmFsIHJlcXVlc3RlZCBieSBDTUkKKyNlbHNlCisyNyBFRlMgVXNhZ2UgSW5mbyAtIE5vIGltcGxlbWVudGF0aW9uIGFzIHlldCAKKyNkZWZpbmUgTE9HX0VGU19JTkZPX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgxQiArIExPR18xWF9CQVNFX0MpCisjZW5kaWYgICAKKyovCisKKy8qIDI4IEFuYWxvZyBGb3J3YXJkIENoYW5uZWwgKi8KKyNkZWZpbmUgTE9HX0FOQUxPR19GT1JXX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgxQyArIExPR18xWF9CQVNFX0MpCisKKy8qIDI5IEFuYWxvZyBSZXZlcnNlIENoYW5uZWwgKi8KKyNkZWZpbmUgTE9HX0FOQUxPR19SRVZTX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgxRCArIExPR18xWF9CQVNFX0MpCisKKy8qIDMwIEFuYWxvZyBIYW5kb2ZmIEVudHJ5ICovCisjZGVmaW5lIExPR19BTkFMT0dfSEFORE9GRl9DICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MUUgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAzMSBGTSBTbG90IFN0YXRpc3RpcyBlbnRyeSAqLworI2RlZmluZSBMT0dfQU5BTE9HX0ZNU0xPVF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDFGICsgTE9HXzFYX0JBU0VfQykKKyAgCisvKiAzMiBGT0NDIFdvcmQgU3luYyBDb3VudCBlbnRyeSAqLworI2RlZmluZSBMT0dfQU5BTE9HX1dTX0NPVU5UX0MgICAgICAgICAgICAgICAgICAgICAgICAgICgweDIwICsgTE9HXzFYX0JBU0VfQykKKworLyogMzMgKi8KKyNkZWZpbmUgTE9HX1JMUF9QQUNLRVRfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgyMSArIExPR18xWF9CQVNFX0MpCisKKy8qIDM0ICovCisjZGVmaW5lIExPR19BU1lOQ19UQ1BfU0VHX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MjIgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAzNSAqLworI2RlZmluZSBMT0dfUEFDS0VUX0RBVEFfSVBfUEFDS0VUU19DICAgICAgICAgICAgICAgICAgICgweDIzICsgTE9HXzFYX0JBU0VfQykKKworLyogMzYgKi8KKyNkZWZpbmUgTE9HX0ZOQkRUX01FU1NBR0VfTE9HX0MgICAgICAgICAgICAgICAgICAgICAgICAoMHgyNCArIExPR18xWF9CQVNFX0MpCisKKy8qIEJlZ2luIElTLTIwMDAgTE9HIGZlYXR1cmVzICovCisgCisvKiAzNyBSTFAgUlggRnJhbWVzIGxvZ2dpbmcgKi8gCisjZGVmaW5lIExPR19STFBfUlhfRlJBTUVTX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MjUgKyBMT0dfMVhfQkFTRV9DKQorICAKKy8qIDM4IFJMUCBUWCBGcmFtZXMgbG9nZ2luZyAqLworI2RlZmluZSBMT0dfUkxQX1RYX0ZSQU1FU19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDI2ICsgTE9HXzFYX0JBU0VfQykKKworLyogMzkgUmVzZXJ2ZWQgZm9yIGFkZGl0aW9ucyB0byBSTFAgZnJhbWVzICovCisjZGVmaW5lIExPR19STFBfUlNWRDFfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MjcgKyBMT0dfMVhfQkFTRV9DKQorCisvKiA0MCBSZXNlcnZlZCBmb3IgYWRkaXRpb25zIHRvIFJMUCBmcmFtZXMgKi8KKyNkZWZpbmUgTE9HX1JMUF9SU1ZEMl9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgyOCArIExPR18xWF9CQVNFX0MpCisKKy8qIDQxIEZvcndhcmQgTGluayBGcmFtZSBUeXBlcyBsb2dnaW5nICovCisjZGVmaW5lIExPR19GV0RfRlJBTUVfVFlQRVNfQyAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MjkgKyBMT0dfMVhfQkFTRV9DKQorICAKKy8qIDQyIFJldmVyc2UgTGluayBGcmFtZSBUeXBlcyBsb2dnaW5nICovCisjZGVmaW5lIExPR19SRVZfRlJBTUVfVFlQRVNfQyAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MkEgKyBMT0dfMVhfQkFTRV9DKQorICAKKy8qIDQzIEZhc3QgRm9yd2FyZCBQb3dlciBDb250cm9sIFBhcmFtZXRlcnMgbG9nZ2luZyAqLworI2RlZmluZSBMT0dfRkZXRF9QQ1RSTF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDJCICsgTE9HXzFYX0JBU0VfQykKKworLyogNDQgUmV2ZXJzZSBQb3dlciBDb250cm9sIFBhcmFtZXRlcnMgbG9nZ2luZyAqLworI2RlZmluZSBMT0dfUkVWX1BDVFJMX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDJDICsgTE9HXzFYX0JBU0VfQykKKworLyogNDUgU2VhcmNoZXIgYW5kIEZpbmdlciBJbmZvcm1hdGlvbiBsb2dnaW5nICovCisjZGVmaW5lIExPR19TUkNIX0ZJTkdfSU5GT19DICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MkQgKyBMT0dfMVhfQkFTRV9DKQorICAKKy8qIDQ2IFNlcnZpY2UgQ29uZmlndXJhdGlvbiBsb2dnaW5nICovCisjZGVmaW5lIExPR19TVkNfQ09ORklHX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MkUgKyBMT0dfMVhfQkFTRV9DKQorICAKKy8qIDQ3IEFjdGl2ZSBTZXQgQ29uZmlndXJhdGlvbiBsb2dnaW5nICovCisjZGVmaW5lIExPR19BU0VUX0NPTkZJR19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MkYgKyBMT0dfMVhfQkFTRV9DKQorCisvKiA0OCBRdWljayBQYWdpbmcgQ2hhbm5lbCBsb2dnaW5nICovCisjZGVmaW5lIExPR19RUENIX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MzAgKyBMT0dfMVhfQkFTRV9DKQorCisvKiA0OSBSTFAgU3RhdGlzdGljcyBsb2dnaW5nICovCisjZGVmaW5lIExPR19STFBfU1RBVF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MzEgKyBMT0dfMVhfQkFTRV9DKQorCisvKiA1MCBTaW1wbGUgVGVzdCBEYXRhIFNlcnZpY2UgT3B0aW9uIGxvZ2dpbmcgKi8KKyNkZWZpbmUgTE9HX1NURFNPX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgzMiArIExPR18xWF9CQVNFX0MpCisKKy8qIDUxIFBpbG90IFBoYXNlIE1lYXN1cmVtZW50IHJlc3VsdHMgbG9nZ2luZyAqLworI2RlZmluZSBMT0dfU1JDSF9QUE1fUkVTX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDMzICsgTE9HXzFYX0JBU0VfQykKKworLyogNTIgUGlsb3QgUGhhc2UgTWVhc3VyZW1lbnQgRGF0YSBCYXNlIGxvZ2dpbmcgKi8KKyNkZWZpbmUgTE9HX1NSQ0hfUFBNX0RCX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgzNCArIExPR18xWF9CQVNFX0MpCisKKy8qIDUzIFBpbG90IFBoYXNlIE1lYXN1cmVtZW50IHNlYXJjaCByZXN1bHRzIGxvZ2dpbmcgKi8KKyNkZWZpbmUgTE9HX1NSQ0hfUFBNX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgzNSArIExPR18xWF9CQVNFX0MpCisKKy8qIDU0IElTLTgwMSBmb3J3YXJkIGxpbmsgbWVzc2FnZSAqLworI2RlZmluZSBMT0dfR1BTX0ZXRF9NU0dfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDM2ICsgTE9HXzFYX0JBU0VfQykKKworLyogNTUgSVMtODAxIHJldmVyc2UgbGluayBtZXNzYWdlICovCisjZGVmaW5lIExPR19HUFNfUkVWX01TR19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MzcgKyBMT0dfMVhfQkFTRV9DKQorCisvKiA1NiBHUFMgc2VhcmNoIHNlc3Npb24gc3RhdGlzdGljcyAqLworI2RlZmluZSBMT0dfR1BTX1NUQVRTX01TR19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDM4ICsgTE9HXzFYX0JBU0VfQykKKworLyogNTcgR1BTIHNlYXJjaCByZXN1bHRzICovCisjZGVmaW5lIExPR19HUFNfU1JDSF9QRUFLU19NU0dfQyAgICAgICAgICAgICAgICAgICAgICAgKDB4MzkgKyBMT0dfMVhfQkFTRV9DKQorCisvKiA1OCBGYWN0b3J5IFRlc3Rtb2RlIGxvZ2dpbmcgKi8KKyNkZWZpbmUgTE9HX0ZUTV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgzQSArIExPR18xWF9CQVNFX0MpCisKKy8qIDU5IE11bHRpcGxlIFBlYWsgTG9nZ2luZyAqLworI2RlZmluZSBMT0dfU1JDSF9HUFNfTVVMVElfUEVBS1NfSU5GT19DICAgICAgICAgICAgICAgICgweDNCICsgTE9HXzFYX0JBU0VfQykKKworLyogNjAgUG9zdCBwcm9jZXNzZWQgc2VhcmNoIHJlc3VsdHMgbG9ncyAqLworI2RlZmluZSBMT0dfU1JDSF9HUFNfUE9TVF9QUk9DX0MgICAgICAgICAgICAgICAgICAgICAgICgweDNDICsgTE9HXzFYX0JBU0VfQykKKworLyogNjEgRlVMTCBUZXN0IERhdGEgU2VydmljZSBPcHRpb24gbG9nZ2luZyAqLworI2RlZmluZSBMT0dfRlREU09fQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDNEICsgTE9HXzFYX0JBU0VfQykKKworLyogNjIgQmx1ZXRvb3RoIGxvZ2dpbmcgKi8KKyNkZWZpbmUgTE9HX0JUX1JFU0VSVkVEX0NPREVTX0JBU0VfQyAgICAgICAgICAgICAgICAgICAoMHgzRSArIExPR18xWF9CQVNFX0MpCisvKiBLZWVwIGNvbmZ1c2luZyBuYW1lIGZvciBiYWNrd2FyZHMgY29tcGF0aWJpbGl0eS4gICovCisjZGVmaW5lIExPR19CVF9CQVNFX0MgTE9HX0JUX1JFU0VSVkVEX0NPREVTX0JBU0VfQworCisvKiA5MiBCbHVldG9vdGgncyBsYXN0IGxvZyBjb2RlICovCisjZGVmaW5lIExPR19CVF9MQVNUX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDMwICsgTE9HX0JUX1JFU0VSVkVEX0NPREVTX0JBU0VfQykKKworLyogOTMgSERSIGxvZyBjb2RlcyAqLworI2RlZmluZSBMT0dfSERSX1JFU0VSVkVEX0NPREVTX0JBU0VfQyAgICAgICAgICAgICAgICAgICgweDVEICsgTE9HXzFYX0JBU0VfQykKKy8qIEtlZXAgY29uZnVzaW5nIG5hbWUgZm9yIGJhY2t3YXJkcyBjb21wYXRpYmlsaXR5LiAgKi8KKyNkZWZpbmUgTE9HX0hEUl9CQVNFX0MgTE9HX0hEUl9SRVNFUlZFRF9DT0RFU19CQVNFX0MKKworLyogMTQzIGlzIEhEUidzIGxhc3QgbG9nIGNvZGUgKi8KKyNkZWZpbmUgTE9HX0hEUl9MQVNUX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoNTAgKyBMT0dfSERSX1JFU0VSVkVEX0NPREVTX0JBU0VfQykKKworLyogMTQ0IElTMjAwMCBEQ0NIIEZvcndhcmQgbGluayBjaGFubmVsICovCisjZGVmaW5lIExPR19GT1JfRENDSF9NU0dfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4OTAgKyBMT0dfMVhfQkFTRV9DKQorI2RlZmluZSBMT0dfRENDSF9GV0RfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExPR19GT1JfRENDSF9NU0dfQworICAKKy8qIDE0NSBJUzIwMDAgRENDSCBGb3J3YXJkIGxpbmsgY2hhbm5lbCAqLworI2RlZmluZSBMT0dfUkVWX0RDQ0hfTVNHX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDkxICsgTE9HXzFYX0JBU0VfQykKKyNkZWZpbmUgTE9HX0RDQ0hfUkVWX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMT0dfUkVWX0RDQ0hfTVNHX0MKKworLyogMTQ2IElTMjAwMCBEQ0NIIEZvcndhcmQgbGluayBjaGFubmVsICovCisjZGVmaW5lIExPR19aUkVYX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4OTIgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAxNDcgQWN0aXZlIHNldCBpbmZvIGxvZ2dpbmcsIHNpbWlsYXIgdG8gQVNFVF9DT05GSUcsIGJ1dCBzaW1wbGVyLiAgKi8KKyNkZWZpbmUgTE9HX0FTRVRfSU5GT19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHg5MyArIExPR18xWF9CQVNFX0MpCisKKy8qIDE0OCBQaWxvdCBQaGFzZSBNZWFzdXJlbWVudCBmb3VyLXNob3VsZGVyLXNlYXJjaCByZXN1dGx0cyBsb2dnaW5nICovCisjZGVmaW5lIExPR19TUkNIX1BQTV80U0hPVUxERVJfUkVTX0MgICAgICAgICAgICAgICAgICAgKDB4OTQgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAxNDkgRXh0ZW5kZWQgUGlsb3QgUGhhc2UgTWVhc3VyZW1lbnQgRGF0YSBCYXNlIGxvZ2dpbmcgKi8KKyNkZWZpbmUgTE9HX1NSQ0hfRVhUX1BQTV9EQl9DICAgICAgICAgICAgICAgICAgICAgICAgICAoMHg5NSArIExPR18xWF9CQVNFX0MpCisKKy8qIDE1MCBHUFMgVmlzaXQgUGFyYW1ldGVycyAqLworI2RlZmluZSBMT0dfR1BTX1ZJU0lUX1BBUkFNRVRFUlNfQyAgICAgICAgICAgICAgICAgICAgICgweDk2ICsgTE9HXzFYX0JBU0VfQykKKworLyogMTUxIEdQUyBNZWFzdXJlbWVudCAqLworI2RlZmluZSBMT0dfR1BTX01FQVNVUkVNRU5UX0MgICAgICAgICAgICAgICAgICAgICAgICAgICgweDk3ICsgTE9HXzFYX0JBU0VfQykKKworLyogMTUyIFVJTSBEYXRhICovCisjZGVmaW5lIExPR19VSU1fREFUQV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4OTggKyBMT0dfMVhfQkFTRV9DKQorCisvKiAxNTMgU1REU08gcGx1cyBQMiAqLworI2RlZmluZSBMT0dfU1REU09fUDJfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDk5ICsgTE9HXzFYX0JBU0VfQykKKworLyogMTU0IEZURFNPIHBsdXMgUDIgKi8KKyNkZWZpbmUgTE9HX0ZURFNPX1AyX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHg5QSArIExPR18xWF9CQVNFX0MpCisKKy8qIDE1NSBTZWFyY2ggUFBNIFN0YXRpc3RpY3MgKi8KKyNkZWZpbmUgTE9HX1NSQ0hfUFBNX1NUQVRTX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHg5QiArIExPR18xWF9CQVNFX0MpCisKKy8qIDE1NiBQUFAgVHggRnJhbWVzICovCisjZGVmaW5lIExPR19QUFBfVFhfRlJBTUVTX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4OUMgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAxNTcgUFBQIFJ4IEZyYW1lcyAqLworI2RlZmluZSBMT0dfUFBQX1JYX0ZSQU1FU19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDlEICsgTE9HXzFYX0JBU0VfQykKKworLyogMTU4LTE4NyBTU0wgcmVzZXJ2ZWQgbG9nIGNvZGVzICovCisjZGVmaW5lIExPR19TU0xfUkVTRVJWRURfQ09ERVNfQkFTRV9DICAgICAgICAgICAgICAgICAgKDB4OUUgKyBMT0dfMVhfQkFTRV9DKQorI2RlZmluZSBMT0dfU1NMX0xBU1RfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgyOSArIExPR19TU0xfUkVTRVJWRURfQ09ERVNfQkFTRV9DKQorCisvKiAxODgtMTk5IFB1bWEgcmVzZXJ2ZWQgbG9nIGNvZGVzICovCisvKiAxODggUVBDSCwgdmVyc2lvbiAyICovCisjZGVmaW5lIExPR19RUENIX1ZFUl8yX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4QkMgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAxODkgRW5oYW5jZWQgQWNjZXNzIFByb2JlICovCisjZGVmaW5lIExPR19FQV9QUk9CRV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4QkQgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAxOTAgQkNDSCBGcmFtZSBJbmZvcm1hdGlvbiAqLworI2RlZmluZSBMT0dfQkNDSF9GUkFNRV9JTkZPX0MgICAgICAgICAgICAgICAgICAgICAgICAgICgweEJFICsgTE9HXzFYX0JBU0VfQykKKworLyogMTkxIEZDQ0NIIEZyYW1lIEluZm9ybWF0aW9uICovCisjZGVmaW5lIExPR19GQ0NDSF9GUkFNRV9JTkZPX0MgICAgICAgICAgICAgICAgICAgICAgICAgKDB4QkYgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAxOTIgRkRDSCBGcmFtZSBJbmZvcm1hdGlvbiAqLworI2RlZmluZSBMT0dfRkRDSF9GUkFNRV9JTkZPX0MgICAgICAgICAgICAgICAgICAgICAgICAgICgweEMwICsgTE9HXzFYX0JBU0VfQykKKworLyogMTkzIFJEQ0ggRnJhbWUgSW5mb3JtYXRpb24gKi8KKyNkZWZpbmUgTE9HX1JEQ0hfRlJBTUVfSU5GT19DICAgICAgICAgICAgICAgICAgICAgICAgICAoMHhDMSArIExPR18xWF9CQVNFX0MpCisKKy8qIDE5NCBGRlBDIEluZm9ybWF0aW9uICovCisjZGVmaW5lIExPR19GRlBDX0lORk9fQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4QzIgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAxOTUgUlBDIEluZm9ybWF0aW9uICovCisjZGVmaW5lIExPR19SUENfSU5GT19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4QzMgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAxOTYgU2VhcmNoZXIgYW5kIEZpbmdlciBJbmZvcm1hdGlvbiAqLworI2RlZmluZSBMT0dfU1JDSF9GSU5HX0lORk9fVkVSXzJfQyAgICAgICAgICAgICAgICAgICAgICgweEM0ICsgTE9HXzFYX0JBU0VfQykKKworLyogMTk3IFNlcnZpY2UgQ29uZmlndXJhdGlvbiwgdmVyc2lvbiAyICovCisjZGVmaW5lIExPR19TUlZfQ09ORklHX1ZFUl8yX0MgICAgICAgICAgICAgICAgICAgICAgICAgKDB4QzUgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAxOTggQWN0aXZlIFNldCBJbmZvcm1hdGlvbiwgdmVyc2lvbiAyICovCisjZGVmaW5lIExPR19BU0VUX0lORk9fVkVSXzJfQyAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4QzYgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAxOTkgUmVkdWNlZCBBY3RpdmUgU2V0ICovCisjZGVmaW5lIExPR19SRURVQ0VEX0FTRVRfSU5GT19DICAgICAgICAgICAgICAgICAgICAgICAgKDB4QzcgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAyMDAgU2VhcmNoIFRyaWFnZSBJbmZvICovCisjZGVmaW5lIExPR19TUkNIX1RSSUFHRV9JTkZPX0MgICAgICAgICAgICAgICAgICAgICAgICAgKDB4QzggKyBMT0dfMVhfQkFTRV9DKQorCisvKiAyMDEgUkRBIEZyYW1lIEluZm9ybWF0aW9uICovCisjZGVmaW5lIExPR19SREFfRlJBTUVfSU5GT19DICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4QzkgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAyMDIgZ3BzT25lIGZhdHBhdGggaW5mb3JtYXRpb24gKi8KKyNkZWZpbmUgTE9HX0dQU19GQVRQQVRIX0lORk9fQyAgICAgICAgICAgICAgICAgICAgICAgICAoMHhDQSArIExPR18xWF9CQVNFX0MpCisKKy8qIDIwMyBFeHRlbmRlZCBBR0MgKi8KKyNkZWZpbmUgTE9HX0VYVEVOREVEX0FHQ19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHhDQiArIExPR18xWF9CQVNFX0MpCisKKy8qIDIwNCBUcmFuc21pdCBBR0MgKi8KKyNkZWZpbmUgTE9HX1RSQU5TTUlUX0FHQ19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHhDQyArIExPR18xWF9CQVNFX0MpCisKKy8qIDIwNSBJL1EgT2Zmc2V0IHJlZ2lzdGVycyAqLworI2RlZmluZSBMT0dfSVFfT0ZGU0VUX1JFR0lTVEVSU19DICAgICAgICAgICAgICAgICAgICAgICgweENEICsgTE9HXzFYX0JBU0VfQykKKworLyogMjA2IERBQ0MgSS9RIEFjY3VtdWxhdG9yIHJlZ2lzdGVycyAqLworI2RlZmluZSBMT0dfREFDQ19JUV9BQ0NVTVVMQVRPUl9DICAgICAgICAgICAgICAgICAgICAgICgweENFICsgTE9HXzFYX0JBU0VfQykKKworLyogMjA3IFJlZ2lzdGVyIHBvbGxpbmcgcmVzdWx0cyAqLworI2RlZmluZSBMT0dfUkVHSVNURVJfUE9MTElOR19SRVNVTFRTX0MgICAgICAgICAgICAgICAgICgweENGICsgTE9HXzFYX0JBU0VfQykKKworLyogMjA4IFN5c3RlbSBhcmJpdHJhdGlvbiBtb2R1bGUgKi8KKyNkZWZpbmUgTE9HX0FUX1NBTV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHhEMCArIExPR18xWF9CQVNFX0MpCisKKy8qIDIwOSBEaWFibG8gc2VhcmNoZXIgZmluZ2VyIGxvZyAqLworI2RlZmluZSBMT0dfRElBQkxPX1NSQ0hfRklOR19JTkZPX0MgICAgICAgICAgICAgICAgICAgICgweEQxICsgTE9HXzFYX0JBU0VfQykKKworLyogMjEwIGxvZyByZXNlcnZlZCBmb3IgZGFuZHJ1cyAqLworI2RlZmluZSBMT0dfU0QyMF9MQVNUX0FDVElPTl9DICAgICAgICAgICAgICAgICAgICAgICAgICgweEQyICsgTE9HXzFYX0JBU0VfQykKKworLyogMjExIGxvZyByZXNlcnZlZCBmb3IgZGFuZHJ1cyAqLworI2RlZmluZSBMT0dfU0QyMF9MQVNUX0FDVElPTl9IWUJSSURfQyAgICAgICAgICAgICAgICAgICgweEQzICsgTE9HXzFYX0JBU0VfQykKKworLyogMjEyIGxvZyByZXNlcnZlZCBmb3IgZGFuZHJ1cyAqLworI2RlZmluZSBMT0dfU0QyMF9TU19PQkpFQ1RfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICgweEQ0ICsgTE9HXzFYX0JBU0VfQykKKworLyogMjEzIGxvZyByZXNlcnZlZCBmb3IgZGFuZHJ1cyAqLworI2RlZmluZSBMT0dfU0QyMF9TU19PQkpFQ1RfSFlCUklEX0MgICAgICAgICAgICAgICAgICAgICgweEQ1ICsgTE9HXzFYX0JBU0VfQykKKworLyogMjE0IGxvZyByZXNlcnZlZCBmb3IganBpbm9zICovCisjZGVmaW5lIExPR19CQ0NIX1NJR05BTElOR19DICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4RDYgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAyMTUgbG9nIHJlc2VydmVkIGZvciBqcGlub3MgKi8KKyNkZWZpbmUgTE9HX1JFQUNIX1NJR05BTElOR19DICAgICAgICAgICAgICAgICAgICAgICAgICAoMHhENyArIExPR18xWF9CQVNFX0MpCisKKy8qIDIxNiBsb2cgcmVzZXJ2ZWQgZm9yIGpwaW5vcyAqLworI2RlZmluZSBMT0dfRkNDQ0hfU0lHTkFMSU5HX0MgICAgICAgICAgICAgICAgICAgICAgICAgICgweEQ4ICsgTE9HXzFYX0JBU0VfQykKKworLyogMjE3IFJEQSBGcmFtZSBJbmZvcm1hdGlvbiAyICovCisjZGVmaW5lIExPR19SREFfRlJBTUVfSU5GT18yX0MgICAgICAgICAgICAgICAgICAgICAgICAgKDB4RDkgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAyMTggKi8KKyNkZWZpbmUgTE9HX0dQU19CSVRfRURHRV9SRVNVTFRTX0MgICAgICAgICAgICAgICAgICAgICAoMHhEQSArIExPR18xWF9CQVNFX0MpCisKKy8qIDIxOSAqLworI2RlZmluZSBMT0dfUEVfREFUQV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweERCICsgTE9HXzFYX0JBU0VfQykKKworLyogMjIwICovCisjZGVmaW5lIExPR19QRV9QQVJUSUFMX0RBVEFfQyAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4REMgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAyMjEgKi8KKyNkZWZpbmUgTE9HX0dQU19TSU5HTEVfUEVBS19TUkNIX1JFU1VMVFNfQyAgICAgICAgICAgICAoMHhERCArIExPR18xWF9CQVNFX0MpCisKKy8qIDIyMiAqLworI2RlZmluZSBMT0dfU1JDSDRfU0FNUFJBTV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweERFICsgTE9HXzFYX0JBU0VfQykKKworLyogMjIzICovCisjZGVmaW5lIEhEUl9BTl9QUFBfVFhfRlJBTUVTICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4REYgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAyMjQgKi8KKyNkZWZpbmUgSERSX0FOX1BQUF9SWF9GUkFNRVMgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHhFMCArIExPR18xWF9CQVNFX0MpCisKKy8qIDIyNSAqLworI2RlZmluZSBMT0dfR1BTX1NDSEVEVUxFUl9UUkFDRV9DICAgICAgICAgICAgICAgICAgICAgICgweEUxICsgTE9HXzFYX0JBU0VfQykKKworLyogMjI2ICovCisjZGVmaW5lIExPR19NUEVHNF9ZVVZfRlJBTUVfQyAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4RTIgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAyMjcgKi8KKyNkZWZpbmUgTE9HX01QRUc0X0NMSVBfU1RBVFNfQyAgICAgICAgICAgICAgICAgICAgICAgICAoMHhFMyArIExPR18xWF9CQVNFX0MpCisKKy8qIDIyOCAqLworI2RlZmluZSBMT0dfTVBFRzRfQ0xJUF9TVEFUU19WRVIyX0MgICAgICAgICAgICAgICAgICAgICgweEU0ICsgTE9HXzFYX0JBU0VfQykKKworLyogMjI2LTI0MSBNTUVHIHJlc2VydmVkLiAqLworI2RlZmluZSBMT0dfTVBFR19SRVNFUlZFRF9DT0RFU19CQVNFX0MgICAgICAgICAgICAgICAgICgweEYxICsgTE9HXzFYX0JBU0VfQykKKworLyogMjQyLTI3NCBCUkVXIHJlc2VydmVkIGxvZyByYW5nZSAqLworI2RlZmluZSBMT0dfQlJFV19SRVNFUlZFRF9DT0RFU19CQVNFX0MgICAgICAgICAgICAgICAgICgweEYyICsgTE9HXzFYX0JBU0VfQykKKyNkZWZpbmUgTE9HX0JSRVdfTEFTVF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMzIgKyBMT0dfQlJFV19SRVNFUlZFRF9DT0RFU19CQVNFX0MpCisKKy8qIDI3NS0zMzkgUFBQIEV4dGVuZGVkIEZyYW1lcyAqLworI2RlZmluZSBMT0dfUFBQX0ZSQU1FU19SRVNFUlZFRF9DT0RFU19CQVNFX0MgICAgICAgICAgICgweDExMyArIExPR18xWF9CQVNFX0MpCisjZGVmaW5lIExPR19QUFBfRlJBTUVTX0xBU1RfQyAgICAgICAgICAgICAgICAgICAgICAgICAgKDY0ICsgTE9HX1BQUF9GUkFNRVNfUkVTRVJWRURfQ09ERVNfQkFTRV9DKQorCisjZGVmaW5lIExPR19QUFBfRVhUX0ZSQU1FRF9SWF9VTV9DICAgICAgICAgICAgICAgICAgICAgKDB4MTEzICsgTE9HXzFYX0JBU0VfQykKKyNkZWZpbmUgTE9HX1BQUF9FWFRfRlJBTUVEX1JYX1JNX0MgICAgICAgICAgICAgICAgICAgICAoMHgxMTQgKyBMT0dfMVhfQkFTRV9DKQorI2RlZmluZSBMT0dfUFBQX0VYVF9GUkFNRURfUlhfQU5fQyAgICAgICAgICAgICAgICAgICAgICgweDExNSArIExPR18xWF9CQVNFX0MpCisKKyNkZWZpbmUgTE9HX1BQUF9FWFRfRlJBTUVEX1RYX1VNX0MgICAgICAgICAgICAgICAgICAgICAoMHgxMjMgKyBMT0dfMVhfQkFTRV9DKQorI2RlZmluZSBMT0dfUFBQX0VYVF9GUkFNRURfVFhfUk1fQyAgICAgICAgICAgICAgICAgICAgICgweDEyNCArIExPR18xWF9CQVNFX0MpCisjZGVmaW5lIExPR19QUFBfRVhUX0ZSQU1FRF9UWF9BTl9DICAgICAgICAgICAgICAgICAgICAgKDB4MTI1ICsgTE9HXzFYX0JBU0VfQykKKworI2RlZmluZSBMT0dfUFBQX0VYVF9VTkZSQU1FRF9SWF9VTV9DICAgICAgICAgICAgICAgICAgICgweDEzMyArIExPR18xWF9CQVNFX0MpCisjZGVmaW5lIExPR19QUFBfRVhUX1VORlJBTUVEX1JYX1JNX0MgICAgICAgICAgICAgICAgICAgKDB4MTM0ICsgTE9HXzFYX0JBU0VfQykKKyNkZWZpbmUgTE9HX1BQUF9FWFRfVU5GUkFNRURfUlhfQU5fQyAgICAgICAgICAgICAgICAgICAoMHgxMzUgKyBMT0dfMVhfQkFTRV9DKQorCisjZGVmaW5lIExPR19QUFBfRVhUX1VORlJBTUVEX1RYX1VNX0MgICAgICAgICAgICAgICAgICAgKDB4MTQzICsgTE9HXzFYX0JBU0VfQykKKyNkZWZpbmUgTE9HX1BQUF9FWFRfVU5GUkFNRURfVFhfUk1fQyAgICAgICAgICAgICAgICAgICAoMHgxNDQgKyBMT0dfMVhfQkFTRV9DKQorI2RlZmluZSBMT0dfUFBQX0VYVF9VTkZSQU1FRF9UWF9BTl9DICAgICAgICAgICAgICAgICAgICgweDE0NSArIExPR18xWF9CQVNFX0MpCisKKy8qIDM0MCBMT0dfUEVfREFUQV9FWFRfQyAqLworI2RlZmluZSBMT0dfUEVfREFUQV9FWFRfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDE1NCArIExPR18xWF9CQVNFX0MpCisKKy8qIFJFWCBTdWJzeXN0ZW0gbG9ncyAqLworI2RlZmluZSBMT0dfTUVNREVCVUdfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDE1NSArIExPR18xWF9CQVNFX0MpCisjZGVmaW5lIExPR19TWVNQUk9GSUxFX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MTU2ICsgTE9HXzFYX0JBU0VfQykKKyNkZWZpbmUgTE9HX1RBU0tQUk9GSUxFX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgxNTcgKyBMT0dfMVhfQkFTRV9DKQorI2RlZmluZSBMT0dfQ09SRURVTVBfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDE1OCArIExPR18xWF9CQVNFX0MpCisKKy8qIDM0MS0zNDkgUkVYIHN1YnN5c3RlbSBsb2dzICovCisjZGVmaW5lIExPR19SRVhfUkVTRVJWRURfQ09ERVNfQkFTRV9DICAgICAgICAgICAgICAgICAgKDB4MTU1ICsgTE9HXzFYX0JBU0VfQykKKyNkZWZpbmUgTE9HX1JFWF9MQVNUX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoOCArIExPR19SRVhfUkVTRVJWRURfQ09ERVNfQkFTRV9DKQorCisvKiAzNTAgTE9HX1BFX1BBUlRJQUxfREFUQV9FWFRfQyAqLworI2RlZmluZSBMT0dfUEVfUEFSVElBTF9EQVRBX0VYVF9DICAgICAgICAgICAgICAgICAgICAgICgweDE1RSArIExPR18xWF9CQVNFX0MpCisKKy8qIDM1MSBMT0dfRElBR19TVFJFU1NfVEVTVF9DICovCisjZGVmaW5lIExPR19ESUFHX1NUUkVTU19URVNUX0MgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MTVGICsgTE9HXzFYX0JBU0VfQykKKworLyogMzUyICBMT0dfV01TX1JFQURfQyAqLworI2RlZmluZSBMT0dfV01TX1JFQURfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDE2MCArIExPR18xWF9CQVNFX0MpCisKKy8qIDM1MyBTZWFyY2ggVHJpYWdlIEluZm8gVmVyc2lvbiAyICovCisjZGVmaW5lIExPR19TUkNIX1RSSUFHRV9JTkZPMl9DICAgICAgICAgICAgICAgICAgICAgICAgICgweDE2MSArIExPR18xWF9CQVNFX0MpCisKKy8qIDM1NCBSTFAgUnggRkRDSCBGcmFtZXMgKi8KKyNkZWZpbmUgTE9HX1JMUF9SWF9GRENIX0ZSQU1FU19DICAgICAgICAgICAgICAgICAgICAgICAgKDB4MTYyICsgTE9HXzFYX0JBU0VfQykKKworCisvKiAzNTUgUkxQIFR4IEZEQ0ggRnJhbWVzICovCisjZGVmaW5lIExPR19STFBfVFhfRkRDSF9GUkFNRVNfQyAgICAgICAgICAgICAgICAgICAgICAgICgweDE2MyArIExPR18xWF9CQVNFX0MpCisKKy8qIDM1Ni0zNzEgUVRWIHN1YnN5c3RlbSBsb2dzICovCisjZGVmaW5lIExPR19RVFZfUkVTRVJWRURfQ09ERVNfQkFTRV9DICAgICAgICAgICAgICAgICAgICgweDE2NCArIExPR18xWF9CQVNFX0MpCisjZGVmaW5lIExPR19RVFZfTEFTVF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgxNSArIExPR19RVFZfUkVTRVJWRURfQ09ERVNfQkFTRV9DKQorCisvKiAzNzIgU2VhcmNoZXIgNCAxWCAqLworI2RlZmluZSBMT0dfU1JDSDRfMVhfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgxNzQgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAzNzMgU2VhcmNoZXIgc2xlZXAgc3RhdGlzdGljcyAqLworI2RlZmluZSBMT0dfU1JDSF9TTEVFUF9TVEFUU19DICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgxNzUgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAzNzQgU2VydmljZSBDb25maWd1cmF0aW9uLCB2ZXJzaW9uIDMgKi8KKyNkZWZpbmUgTE9HX1NSVl9DT05GSUdfVkVSXzNfQyAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MTc2ICsgTE9HXzFYX0JBU0VfQykKKworLyogMzc1IFNlYXJjaGVyIDQgSERSICovCisjZGVmaW5lIExPR19TUkNINF9IRFJfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDE3NyArIExPR18xWF9CQVNFX0MpCisKKy8qIDM3NiBTZWFyY2hlciA0IEFGTFQgKi8KKyNkZWZpbmUgTE9HX1NSQ0g0X0FGTFRfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MTc4ICsgTE9HXzFYX0JBU0VfQykKKworLyogMzc3IEVuaGFuY2VkIEZpbmdlciBJbmZvcm1hdGlvbiAqLworI2RlZmluZSBMT0dfRU5IX0ZJTkdfSU5GT19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgxNzkgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAzNzggRFYgSW5mb3JtYXRpb24gKi8KKyNkZWZpbmUgTE9HX0RWX0lORk9fQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MTdBICsgTE9HXzFYX0JBU0VfQykKKworLyogMzc5IFdNUyBzZXQgcm91dGVzIGluZm9ybWF0aW9uICovCisjZGVmaW5lIExPR19XTVNfU0VUX1JPVVRFU19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDE3QiArIExPR18xWF9CQVNFX0MpCisKKy8qIDM4MCBGVE0gVmVyc2lvbiAyIExvZ3MgKi8KKyNkZWZpbmUgTE9HX0ZUTV9WRVJfMl9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MTdDICsgTE9HXzFYX0JBU0VfQykKKworLyogMzgxIEdQUyBNdWx0aXBlYWsgbG9nZ2luZyAqLworI2RlZmluZSBMT0dfU1JDSF9HUFNfTVVMVElfUEVBS1NfU0lNUExJRklFRF9JTkZPX0MgICAgICAoMHgxN0QgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAzODIgR1BTIE11bHRpcGVhayBsb2dnaW5nICovCisjZGVmaW5lIExPR19TUkNIX0dQU19NVUxUSV9QRUFLU19WRVJCT1NFX0lORk9fQyAgICAgICAgICgweDE3RSArIExPR18xWF9CQVNFX0MpCisKKy8qIDM4My00MDMgSERSIHJlc2VydmVkIGxvZ3MgKi8KKyNkZWZpbmUgTE9HX0hEUl9SRVNFUlZFRF9D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KDB4MUJBICsgTE9HXzFYX0JBU0VfQykKKyNkZWZpbmUgTE9HX1FUVl9SVFNQX09QVElPTlNfQyAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MUJCICsgTE9HXzFYX0JBU0VfQykKKyNkZWZpbmUgTE9HX1FUVl9SVFNQX0dFVF9QQVJBTUVURVJfQyAgICAgICAgICAgICAgICAgICAgKDB4MUJDICsgTE9HXzFYX0JBU0VfQykKKyNkZWZpbmUgTE9HX1FUVl9SVFNQX1NFVF9QQVJBTUVURVJfQyAgICAgICAgICAgICAgICAgICAgKDB4MUJEICsgTE9HXzFYX0JBU0VfQykKKyNkZWZpbmUgTE9HX1FUVl9WSURFT19CSVRTVFJFQU0gICAgICAgICAgICAgICAgICAgICAgICAgKDB4MUJFICsgTE9HXzFYX0JBU0VfQykKKyNkZWZpbmUgTE9HX0FSTV9WSURFT19ERUNPREVfU1RBVFMgICAgICAgICAgICAgICAgICAgICAgKDB4MUJGICsgTE9HXzFYX0JBU0VfQykKKyNkZWZpbmUgTE9HX1FUVl9EU1BfU0xJQ0VfQlVGRkVSX0MgICAgICAgICAgICAgICAgICAgICAgKDB4MUMwICsgTE9HXzFYX0JBU0VfQykKKyNkZWZpbmUgTE9HX1FUVl9DTURfTE9HR0lOR19DICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MUMxICsgTE9HXzFYX0JBU0VfQykKKyNkZWZpbmUgTE9HX1FUVl9BVURJT19GUkFNRV9QVFNfSU5GT19DICAgICAgICAgICAgICAgICAgKDB4MUMyICsgTE9HXzFYX0JBU0VfQykKKyNkZWZpbmUgTE9HX1FUVl9WSURFT19GUkFNRV9ERUNPREVfSU5GT19DICAgICAgICAgICAgICAgKDB4MUMzICsgTE9HXzFYX0JBU0VfQykKKyNkZWZpbmUgTE9HX1FUVl9SVENQX0NPTVBPVU5EX1JSX0MgICAgICAgICAgICAgICAgICAgICAgKDB4MUM0ICsgTE9HXzFYX0JBU0VfQykKKyNkZWZpbmUgTE9HX1FU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b24gU3RhdHVzIGxvZyAqLworI2RlZmluZSBMT0dfU1JDSF9ERU1PRF9TVEFUVVNfQyAgICAgICAgICAgICAgICAgICAgICAgICAoMHgxRTcgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBTZWFyY2hlciBDYWxsIFN0YXRpc3RpY3MgbG9nICovCisjZGVmaW5lIExPR19TUkNIX0NBTExfU1RBVElTVElDU19DICAgICAgICAgICAgICAgICAgICAgICgweDFFOCArIExPR18xWF9CQVNFX0MpCisKKy8qIEdQUyBNUy1NUEMgRm9yd2FyZCBsaW5rICovCisjZGVmaW5lIExPR19NU19NUENfRldEX0xJTktfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDFFOSArIExPR18xWF9CQVNFX0MpCisKKy8qIEdQUyBNUy1NUEMgUmV2ZXJzZSBsaW5rICovCisjZGVmaW5lIExPR19NU19NUENfUkVWX0xJTktfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDFFQSArIExPR18xWF9CQVNFX0MpCisKKy8qIFByb3RvY29sIFNlcnZpY2VzIERhdGEgKi8KKyNkZWZpbmUgTE9HX0RBVEFfUFJPVE9DT0xfTE9HR0lOR19DICAgICAgICAgICAgICAgICAgICAgKDB4MUVCICsgTE9HXzFYX0JBU0VfQykKKworLyogTWVkaWFGTE8gcmVzZXJ2ZWQgbG9nIGNvZGVzICovCisjZGVmaW5lIExPR19NRkxPX1JFU0VSVkVEX0NPREVTX0JBU0VfQyAgICAgICAgICAgICAgICAgICgweDFFQyArIExPR18xWF9CQVNFX0MpCisjZGVmaW5lIExPR19NRkxPX0xBU1RfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICg5OSArIExPR19NRkxPX1JFU0VSVkVEX0NPREVTX0JBU0VfQykKKworLyogR1BTIGRlbW9kdWxhdGlvbiB0cmFja2luZyBoZWFkZXIgaW5mbyAqLworI2RlZmluZSBMT0dfR1BTX0RFTU9EX1RSQUNLSU5HX0hFQURFUl9DICAgICAgICAgICAgICAgICAoMHgyNTAgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBHUFMgZGVtb2R1bGF0aW9uIHRyYWNraW5nIHJlc3VsdHMgKi8KKyNkZWZpbmUgTE9HX0dQU19ERU1PRF9UUkFDS0lOR19DICAgICAgICAgICAgICAgICAgICAgICAgKDB4MjUxICsgTE9HXzFYX0JBU0VfQykKKworLyogR1BTIGJpdCBlZGdlIGxvZ3MgZnJvbSBkZW1vZCB0cmFja2luZyAqLworI2RlZmluZSBMT0dfR1BTX0RFTU9EX0JJVF9FREdFX0MgICAgICAgICAgICAgICAgICAgICAgICAoMHgyNTIgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBHUFMgZGVtb2R1bGF0aW9uIHNvZnQgZGVjaXNpb25zICovCisjZGVmaW5lIExPR19HUFNfREVNT0RfU09GVF9ERUNJU0lPTlNfQyAgICAgICAgICAgICAgICAgICgweDI1MyArIExPR18xWF9CQVNFX0MpCisKKy8qIEdQUyBwb3N0LXByb2Nlc3NlZCBkZW1vZCB0cmFja2luZyByZXN1bHRzICovCisjZGVmaW5lIExPR19HUFNfREVNT0RfVFJBQ0tJTkdfUE9TVF9QUk9DX0MgICAgICAgICAgICAgICgweDI1NCArIExPR18xWF9CQVNFX0MpCisKKy8qIEdQUyBzdWJmcmFtZSBsb2cgKi8KKyNkZWZpbmUgTE9HX0dQU19ERU1PRF9TVUJGUkFNRV9DICAgICAgICAgICAgICAgICAgICAgICAgKDB4MjU1ICsgTE9HXzFYX0JBU0VfQykKKworLyogRi1DUENDSCBRdWFsaXR5IEluZm9ybWF0aW9uICovCisjZGVmaW5lIExPR19GX0NQQ0NIX1FVQUxJVFlfSU5GT19DICAgICAgICAgICAgICAgICAgICAgICgweDI1NiArIExPR18xWF9CQVNFX0MpCisKKy8qIFJldmVyc2UgUERDQ0gvUERDSCBGcmFtZSBJbmZvcm1hdGlvbiAqLworI2RlZmluZSBMT0dfUl9QRENDSF9SX1BEQ0hfRlJBTUVfSU5GT19DICAgICAgICAgICAgICAgICAoMHgyNTcgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBGb3J3YXJkIEcgQ2hhbm5lbCBJbmZvcm1hdGlvbiAqLworI2RlZmluZSBMT0dfRl9HQ0hfSU5GT19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgyNTggKyBMT0dfMVhfQkFTRV9DKQorCisvKiBGb3J3YXJkIEcgQ2hhbm5lbCBGcmFtZSBJbmZvcm1hdGlvbiAqLworI2RlZmluZSBMT0dfRl9HQ0hfRlJBTUVfSU5GT19DICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgyNTkgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBGb3J3YXJkIFJDIENoYW5uZWwgSW5mb3JtYXRpb24gKi8KKyNkZWZpbmUgTE9HX0ZfUkNDSF9JTkZPX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MjVBICsgTE9HXzFYX0JBU0VfQykKKworLyogRm9yd2FyZCBBQ0sgQ2hhbm5lbCBJbmZvcm1hdGlvbiAqLworI2RlZmluZSBMT0dfRl9BQ0tDSF9JTkZPX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgyNUIgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBGb3J3YXJkIEFDSyBDaGFubmVsIEFDS0RBIEluZm9ybWF0aW9uICovCisjZGVmaW5lIExPR19GX0FDS0NIX0FDS0RBX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDI1QyArIExPR18xWF9CQVNFX0MpCisKKy8qIFJldmVyc2UgUkVRIENoYW5uZWwgSW5mb3JtYXRpb24gKi8KKyNkZWZpbmUgTE9HX1JfUkVRQ0hfSU5GT19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MjVEICsgTE9HXzFYX0JBU0VfQykKKworLyogU2xlZXAgVGFzayBTdGF0aXN0aWNzICovCisjZGVmaW5lIExPR19TTEVFUF9TVEFUU19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDI1RSArIExPR18xWF9CQVNFX0MpCisKKy8qIFNsZWVwIGNvbnRyb2xsZXIgc3RhdGlzdGljcyAxWCAqLworI2RlZmluZSBMT0dfMVhfU0xFRVBfQ09OVFJPTExFUl9TVEFUU19DICAgICAgICAgICAgICAgICAoMHgyNUYgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBTbGVlcCBjb250cm9sbGVyIHN0YXRpc3RpY3MgSERSICovCisjZGVmaW5lIExPR19IRFJfU0xFRVBfQ09OVFJPTExFUl9TVEFUU19DICAgICAgICAgICAgICAgICgweDI2MCArIExPR18xWF9CQVNFX0MpCisKKy8qIFNsZWVwIGNvbnRyb2xsZXIgc3RhdGlzdGljcyBHU00gKi8KKyNkZWZpbmUgTE9HX0dTTV9TTEVFUF9DT05UUk9MTEVSX1NUQVRTX0MgICAgICAgICAgICAgICAgKDB4MjYxICsgTE9HXzFYX0JBU0VfQykKKworLyogU2xlZXAgY29udHJvbGxlciBzdGF0aXN0aWNzIFdDRE1BICovCisjZGVmaW5lIExPR19XQ0RNQV9TTEVFUF9DT05UUk9MTEVSX1NUQVRTX0MgICAgICAgICAgICAgICgweDI2MiArIExPR18xWF9CQVNFX0MpCisKKy8qIFNsZWVwIHRhc2sgYW5kIGNvbnRyb2xsZXIgcmVzZXJ2ZWQgbG9ncyAqLworI2RlZmluZSBMT0dfU0xFRVBfQVBQU19TVEFUU19DICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgyNjMgKyBMT0dfMVhfQkFTRV9DKQorI2RlZmluZSBMT0dfU0xFRVBfU1RBVFNfUkVTRVJWRUQyX0MgICAgICAgICAgICAgICAgICAgICAoMHgyNjQgKyBMT0dfMVhfQkFTRV9DKQorI2RlZmluZSBMT0dfU0xFRVBfU1RBVFNfUkVTRVJWRUQzX0MgICAgICAgICAgICAgICAgICAgICAoMHgyNjUgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBEViBJbmZvcm1hdGlvbiBwbGFjZWhvbGRlciBjaGFubmVsIGxvZ3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gKi8KKyNkZWZpbmUgTE9HX1dNU19NRVNTQUdFX0xJU1RfQyAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MjcwICsgTE9HXzFYX0JBU0VfQykKKworLyogNjI1IE11bHRpbW9kZSBHZW5lcmljIFNJTSBEcml2ZXIgSW50ZXJmYWNlICovCisjZGVmaW5lIExPR19NTV9HRU5FUklDX1NJTV9EUklWRVJfQyAgICAgICAgICAgICAgICAgICAgICgweDI3MSArIExPR18xWF9CQVNFX0MpCisKKy8qIDYyNiBHZW5lcmljIFNJTSBUb29sa2l0IFRhc2sgKi8KKyNkZWZpbmUgTE9HX0dFTkVSSUNfU0lNX1RPT0xLSVRfVEFTS19DICAgICAgICAgICAgICAgICAgKDB4MjcyICsgTE9HXzFYX0JBU0VfQykKKworLyogNjI3IENhbGwgTWFuYWdlciBQaG9uZSBldmVudHMgbG9nICovCisjZGVmaW5lIExPR19DTV9QSF9FVkVOVF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDI3MyArIExPR18xWF9CQVNFX0MpCisKKy8qIDYyOCBXTVMgU2V0IE1lc3NhZ2UgTGlzdCAqLworI2RlZmluZSBMT0dfV01TX1NFVF9NRVNTQUdFX0xJU1RfQyAgICAgICAgICAgICAgICAgICAgICAoMHgyNzQgKyBMT0dfMVhfQkFTRV9DKQorCisvKiA2MjktNzA0IEhEUiByZXNlcnZlZCBsb2dzICovCisjZGVmaW5lIExPR19IRFJfUkVTRVJWRURfQ09ERVNfQkFTRV8zX0MgICAgICAgICAgICAgICAgICgweDI3NSArIExPR18xWF9CQVNFX0MpCisjZGVmaW5lIExPR19IRFJfTEFTVF8zX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICg3NSArIExPR19IRFJfUkVTRVJWRURfQ09ERVNfQkFTRV8zX0MpCisKKy8qIDcwNSBDYWxsIE1hbmFnZXIgY2FsbCBldmVudCBsb2cgKi8KKyNkZWZpbmUgTE9HX0NNX0NBTExfRVZFTlRfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MkMxICsgTE9HXzFYX0JBU0VfQykKKworLyogNzA2LTczOCBRVlAgcmVzZXJ2ZWQgbG9ncyAqLworI2RlZmluZSBMT0dfUVZQX1JFU0VSVkVEX0NPREVTX0JBU0VfQyAgICAgICAgICAgICAgICAgICAoMHgyQzIgKyBMT0dfMVhfQkFTRV9DKQorI2RlZmluZSBMT0dfUVZQX0xBU1RfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMzIgKyBMT0dfUVZQX1JFU0VSVkVEX0NPREVTX0JBU0VfQykKKworLyogNzM5IEdQUyBQRSBQb3NpdGlvbiBSZXBvcnQgbG9nICovCisjZGVmaW5lIExPR19HUFNfUEVfUE9TSVRJT05fUkVQT1JUX0MgICAgICAgICAgICAgICAgICAgICgweDJFMyArIExPR18xWF9CQVNFX0MpCisKKy8qIDc0MCBHUFMgUEUgUG9zaXRpb24gUmVwb3J0IEV4dGVuZGVkIGxvZyAqLworI2RlZmluZSBMT0dfR1BTX1BFX1BPU0lUSU9OX1JFUE9SVF9FWFRfQyAgICAgICAgICAgICAgICAoMHgyRTQgKyBMT0dfMVhfQkFTRV9DKQorCisvKiA3NDEgbG9nICovCisjZGVmaW5lIExPR19NRERJX0hPU1RfU1RBVFNfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDJFNSArIExPR18xWF9CQVNFX0MpCisKKy8qIEdQUyBEZWNvZGVkIEVwaGVtZXJpcyAqLworI2RlZmluZSBMT0dfR1BTX0RFQ09ERURfRVBIRU1FUklTX0MgICAgICAgICAgICAgICAgICAgICAoMHgyRTYgKyBMT0dfMVhfQkFTRV9DKQorIAorLyogR1BTIERlY29kZWQgQWxtYW5hYyAqLworI2RlZmluZSBMT0dfR1BTX0RFQ09ERURfQUxNQU5BQ19DICAgICAgICAgICAgICAgICAgICAgICAoMHgyRTcgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBUcmFuc2NlaXZlciBSZXNvdXJjZSBNYW5hZ2VyICovCisjZGVmaW5lIExPR19UUkFOU0NFSVZFUl9SRVNPVVJDRV9NR1JfQyAgICAgICAgICAgICAgICAgICgweDJFOCArIExPR18xWF9CQVNFX0MpCisKKy8qIEdQUyBQb3NpdGlvbiBFbmdpbmUgSW5mbyAqLworI2RlZmluZSBMT0dfR1BTX1BPU0lUSU9OX0VOR0lORV9JTkZPX0MgICAgICAgICAgICAgICAgICAoMHgyRTkgKyBMT0dfMVhfQkFTRV9DKQorCisvKiA3NDYtODEwIFJBUFRPUiByZXNlcnZlZCBsb2cgcmFuZ2UgKi8KKyNkZWZpbmUgTE9HX1JBUFRPUl9SRVNFUlZFRF9DT0RFU19CQVNFX0MgICAgICAgICAgICAgICAgKDB4MkVBICsgTE9HXzFYX0JBU0VfQykKKyNkZWZpbmUgTE9HX1JBUFRPUl9MQVNUX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDY0ICsgTE9HX1JBUFRPUl9SRVNFUlZFRF9DT0RFU19CQVNFX0MpCisKKy8qIFFPUyBTcGVjaWZpY2F0aW9uIExvZ2dpbmcgKi8KKworLyogUU9TIFJlcXVlc3RlZCBMb2cgKi8KKyNkZWZpbmUgTE9HX1FPU19SRVFVRVNURURfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MzJCICsgTE9HXzFYX0JBU0VfQykKKworLyogUU9TIEdyYW50ZWQgTG9nICovCisjZGVmaW5lIExPR19RT1NfR1JBTlRFRF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDMyQyArIExPR18xWF9CQVNFX0MpCisKKy8qIFFPUyBTdGF0ZSBMb2cgKi8KKyNkZWZpbmUgTE9HX1FPU19TVEFURV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MzJEICsgTE9HXzFYX0JBU0VfQykKKworI2RlZmluZSBMT0dfUU9TX01PRElGSUVEX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgzMkUgKyBMT0dfMVhfQkFTRV9DKQorCisjZGVmaW5lIExPR19RREpfRU5RVUVVRV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDMyRiArIExPR18xWF9CQVNFX0MpCisjZGVmaW5lIExPR19RREpfREVRVUVVRV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDMzMCArIExPR18xWF9CQVNFX0MpCisjZGVmaW5lIExPR19RREpfVVBEQVRFX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDMzMSArIExPR18xWF9CQVNFX0MpCisjZGVmaW5lIExPR19RRFRYX0VOQ09ERVJfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDMzMiArIExPR18xWF9CQVNFX0MpCisjZGVmaW5lIExPR19RRFRYX0RFQ09ERVJfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDMzMyArIExPR18xWF9CQVNFX0MpCisKKyNkZWZpbmUgTE9HX1BPUlRfQVNTSUdOTUVOVF9TVEFUVVNfQyAgICAgICAgICAgICAgICAgICAgKDB4MzM0ICsgTE9HXzFYX0JBU0VfQykKKworLyogUHJvdG9jb2wgU2VydmljZXMgcmVzZXJ2ZWQgbG9nIGNvZGVzICovCisjZGVmaW5lIExPR19QU19SRVNFUlZFRF9DT0RFU19CQVNFX0MgICAgICAgICAgICAgICAgICAgICgweDMzNSArIExPR18xWF9CQVNFX0MpCisjZGVmaW5lIExPR19QU19MQVNUX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgyNSArIExPR19QU19SRVNFUlZFRF9DKQorCisjZGVmaW5lIExPR19QU19TVEFUX0lQX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDMzNSArIExPR18xWF9CQVNFX0MpCisjZGVmaW5lIExPR19QU19TVEFUX0dMT0JBTF9JUFY0X0MgICAgICAgICAgICAgICAgICAgICAgICgweDMzNSArIExPR18xWF9CQVNFX0MpCisjZGVmaW5lIExPR19QU19TVEFUX0dMT0JBTF9JUFY2X0MgICAgICAgICAgICAgICAgICAgICAgICgweDMzNiArIExPR18xWF9CQVNFX0MpCisjZGVmaW5lIExPR19QU19TVEFUX0dMT0JBTF9JQ01QVjRfQyAgICAgICAgICAgICAgICAgICAgICgweDMzNyArIExPR18xWF9CQVNFX0MpCisjZGVmaW5lIExPR19QU19TVEFUX0dMT0JBTF9JQ01QVjZfQyAgICAgICAgICAgICAgICAgICAgICgweDMzOCArIExPR18xWF9CQVNFX0MpCisjZGVmaW5lIExPR19QU19TVEFUX0dMT0JBTF9UQ1BfQyAgICAgICAgICAgICAgICAgICAgICAgICgweDMzOSArIExPR18xWF9CQVNFX0MpCisjZGVmaW5lIExPR19QU19TVEFUX0dMT0JBTF9VRFBfQyAgICAgICAgICAgICAgICAgICAgICAgICgweDMzQSArIExPR18xWF9CQVNFX0MpCisKKy8qIFByb3RvY29sIFNlcnZpY2VzIGRlc2NyaWJlIGFsbCBUQ1AgaW5zdGFuY2VzICovCisjZGVmaW5lIExPR19QU19TVEFUX0RFU0NfQUxMX1RDUF9JTlNUX0MgICAgICAgICAgICAgICAgICgweDMzQiArIExPR18xWF9CQVNFX0MpCisKKy8qIFByb3RvY29sIFNlcnZpY2VzIGRlc2NyaWJlIGFsbCBtZW1vcnkgcG9vbCBpbnN0YW5jZXMgKi8KKyNkZWZpbmUgTE9HX1BTX1NUQVRfREVTQ19BTExfTUVNX1BPT0xfSU5TVF9DICAgICAgICAgICAgKDB4MzNDICsgTE9HXzFYX0JBU0VfQykKKworLyogUHJvdG9jb2wgU2VydmljZXMgZGVzY3JpYmUgYWxsIElGQUNFIGluc3RhbmNlcyAqLworI2RlZmluZSBMT0dfUFNfU1RBVF9ERVNDX0FMTF9JRkFDRV9JTlNUX0MgICAgICAgICAgICAgICAoMHgzM0QgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBQcm90b2NvbCBTZXJ2aWNlcyBkZXNjcmliZSBhbGwgUFBQIGluc3RhbmNlcyAqLworI2RlZmluZSBMT0dfUFNfU1RBVF9ERVN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ArIExPR18xWF9CQVNFX0MpCisKKy8qIFByb3RvY29sIFNlcnZpY2VzIGluc3RhbmNlIG1lbW9yeSBzdGF0aXN0aWNzICovCisjZGVmaW5lIExPR19QU19TVEFUX01FTV9JTlNUX0MgICAgICAgICAgICAgICAgICAgICAgICAgICgweDM0NSArIExPR18xWF9CQVNFX0MpCisKKy8qIFByb3RvY29sIFNlcnZpY2VzIGluc3RhbmNlIGZsb3cgc3RhdGlzdGljcyAqLworI2RlZmluZSBMT0dfUFNfU1RBVF9GTE9XX0lOU1RfQyAgICAgICAgICAgICAgICAgICAgICAgICAoMHgzNDYgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBQcm90b2NvbCBTZXJ2aWNlcyBpbnN0YW5jZSBwaHlzaWNhbCBsaW5rIHN0YXRpc3RpY3MgKi8KKyNkZWZpbmUgTE9HX1BTX1NUQVRfUEhZU19MSU5LX0lOU1RfQyAgICAgICAgICAgICAgICAgICAgKDB4MzQ3ICsgTE9HXzFYX0JBU0VfQykKKworLyogUHJvdG9jb2wgU2VydmljZXMgaW5zdGFuY2UgQVJQIHN0YXRpc3RpY3MgKi8KKyNkZWZpbmUgTE9HX1BTX1NUQVRfQVJQX0lOU1RfQyAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MzQ4ICsgTE9HXzFYX0JBU0VfQykKKworLyogUHJvdG9jb2wgU2VydmljZXMgaW5zdGFuY2UgTExDIHN0YXRpc3RpY3MgKi8KKyNkZWZpbmUgTE9HX1BTX1NUQVRfTExDX0lOU1RfQyAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MzQ5ICsgTE9HXzFYX0JBU0VfQykKKworLyogUHJvdG9jb2wgU2VydmljZXMgaW5zdGFuY2UgSVBIQyBzdGF0aXN0aWNzICovCisjZGVmaW5lIExPR19QU19TVEFUX0lQSENfSU5TVF9DICAgICAgICAgICAgICAgICAgICAgICAgICgweDM0QSArIExPR18xWF9CQVNFX0MpCisKKy8qIFByb3RvY29sIFNlcnZpY2VzIG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ZSBMT0dfQ0xPQ0tfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgzNTEgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBHUFMgc2VhcmNoIHByb2Nlc3NlZCBwZWFrIHJlc3VsdHMgYW5kIHRoZWlyIGFzc29jaWF0ZWQgc2VhcmNoIHBhcmFtZXRlcnMgKi8KKyNkZWZpbmUgTE9HX0dQU19QUk9DRVNTRURfUEVBS19DICAgICAgICAgICAgICAgICAgICAgICAgKDB4MzUyICsgTE9HXzFYX0JBU0VfQykKKworI2RlZmluZSBMT0dfTURTUF9MT0dfQ0hVTktTX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgzNTMgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBQZXJpb2RpYyBSU1NJIHVwZGF0ZSBsb2cgKi8KKyNkZWZpbmUgTE9HX1dMQU5fUlNTSV9VUERBVEVfQyAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MzU0ICsgTE9HXzFYX0JBU0VfQykKKworLyogUGVyaW9kaWMgTGluayBMYXllciBzdGF0aXN0aWNzIGxvZyAqLworI2RlZmluZSBMT0dfV0xBTl9MTF9TVEFUX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgzNTUgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBRT1MgRXh0ZW5kZWQgU3RhdGUgTG9nICovCisjZGVmaW5lIExPR19RT1NfU1RBVEVfRVhfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDM1NiArIExPR18xWF9CQVNFX0MpCisKKy8qIEJsdWV0b290aCBob3N0IEhDSSB0cmFuc21pdHRlZCBkYXRhICovCisjZGVmaW5lIExPR19CVF9IT1NUX0hDSV9UWF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDM1NyArIExPR18xWF9CQVNFX0MpCisKKy8qIEJsdWV0b290aCBob3N0IEhDSSByZWNlaXZlZCBkYXRhICovCisjZGVmaW5lIExPR19CVF9IT1NUX0hDSV9SWF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDM1OCArIExPR18xWF9CQVNFX0MpCisKKy8qIEludGVybmFsIC0gR1BTIFBFIFBvc2l0aW9uIFJlcG9ydCBQYXJ0IDMgKi8KKyNkZWZpbmUgTE9HX0dQU19QRV9QT1NJVElPTl9SRVBPUlRfUEFSVDNfQyAgICAgICAgICAgICAgKDB4MzU5ICsgTE9HXzFYX0JBU0VfQykKKworLyogRXh0ZW5kZWQgbG9nIGNvZGUgd2hpY2ggbG9ncyByZXF1ZXN0ZWQgUW9TICovCisjZGVmaW5lIExPR19RT1NfUkVRVUVTVEVEX0VYX0MgICAgICAgICAgICAgICAgICAgICAgICAgICgweDM1QSArIExPR18xWF9CQVNFX0MpCisKKy8qIEV4dGVuZGVkIGxvZyBjb2RlIHdoaWNoIGxvZ3MgZ3JhbnRlZCBRb1MgKi8KKyNkZWZpbmUgTE9HX1FPU19HUkFOVEVEX0VYX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MzVCICsgTE9HXzFYX0JBU0VfQykKKworLyogRXh0ZW5kZWQgbG9nIGNvZGUgd2hpY2ggbG9ncyBtb2RpZmllZCBRb1MgKi8KKyNkZWZpbmUgTE9HX1FPU19NT0RJRklFRF9FWF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MzVDICsgTE9HXzFYX0JBU0VfQykKKworLyogQnVzIE1vbml0b3IgUHJvZmlsaW5nIEluZm8gKi8KKyNkZWZpbmUgTE9HX0JVU19NT05fUFJPRl9JTkZPX0MgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MzVEICsgTE9HXzFYX0JBU0VfQykKKworLyogUGlsb3QgUGhhc2UgTWVhc3VyZW1lbnQgU2VhcmNoIHJlc3VsdHMgKi8KKyNkZWZpbmUgTE9HX1NSQ0hfUFBNX1JFU19WRVJfMl9DICAgICAgICAgICAgICAgICAgICAgICAgKDB4MzVFICsgTE9HXzFYX0JBU0VfQykKKworLyogUGlsb3QgUGhhc2UgTWVhc3VyZW1lbnQgRGF0YSBCYXNlICovCisjZGVmaW5lIExPR19TUkNIX1BQTV9EQl9WRVJfMl9DICAgICAgICAgICAgICAgICAgICAgICAgICgweDM1RiArIExPR18xWF9CQVNFX0MpCisKKy8qIFBpbG90IFBoYXNlIE1lYXN1cmVtZW50IHN0YXRlIG1hY2hpbmUgKi8KKyNkZWZpbmUgTE9HX1BQTV9TTV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MzYwICsgTE9HXzFYX0JBU0VfQykKKworLyogUm9idXN0IEhlYWRlciBDb21wcmVzc2lvbiAtIENvbXByZXNzb3IgKi8KKyNkZWZpbmUgTE9HX1JPSENfQ09NUFJFU1NPUl9DICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MzYxICsgTE9HXzFYX0JBU0VfQykKKworLyogUm9idXN0IEhlYWRlciBDb21wcmVzc2lvbiAtIERlY29tcHJlc3NvciAqLworI2RlZmluZSBMT0dfUk9IQ19ERUNPTVBSRVNTT1JfQyAgICAgICAgICAgICAgICAgICAgICAgICAoMHgzNjIgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBSb2J1c3QgSGVhZGVyIENvbXByZXNzaW9uIC0gRmVlZGJhY2sgQ29tcHJlc3NvciAqLworI2RlZmluZSBMT0dfUk9IQ19GRUVEQkFDS19DT01QUkVTU09SX0MgICAgICAgICAgICAgICAgICAoMHgzNjMgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBSb2J1c3QgSGVhZGVyIENvbXByZXNzaW9uIC0gRmVlZGJhY2sgRGVjb21wcmVzc29yICovCisjZGVmaW5lIExPR19ST0hDX0ZFRURCQUNLX0RFQ09NUFJFU1NPUl9DICAgICAgICAgICAgICAgICgweDM2NCArIExPR18xWF9CQVNFX0MpCisKKy8qIEJsdWV0b290aCBIQ0kgY29tbWFuZHMgKi8KKyNkZWZpbmUgTE9HX0JUX0hDSV9DTURfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MzY1ICsgTE9HXzFYX0JBU0VfQykKKworLyogQmx1ZXRvb3RoIEhDSSBldmVudHMgKi8KKyNkZWZpbmUgTE9HX0JUX0hDSV9FVl9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MzY2ICsgTE9HXzFYX0JBU0VfQykKKworLyogQmx1ZXRvb3RoIEhDSSBUcmFuc21pdHRlZCBBQ0wgZGF0YSAqLworI2RlZmluZSBMT0dfQlRfSENJX1RYX0FDTF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgzNjcgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBCbHVldG9vdGggSENJIFJlY2VpdmVkIEFDTCBkYXRhICovCisjZGVmaW5lIExPR19CVF9IQ0lfUlhfQUNMX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDM2OCArIExPR18xWF9CQVNFX0MpCisKKy8qIEJsdWV0b290aCBTT0MgSDQgRGVlcCBTbGVlcCAqLworI2RlZmluZSBMT0dfQlRfU09DX0g0RFNfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgzNjkgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBVTVRTIHRvIENETUEgSGFuZG92ZXIgTWVzc2FnZSAqLworI2RlZmluZSBMT0dfVU1UU19UT19DRE1BX0hBTkRPVkVSX01TR19DICAgICAgICAgICAgICAgICAoMHgzNkEgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBHcmFwaGljIEV2ZW50IERhdGEgKi8KKyNkZWZpbmUgTE9HX1BST0ZJTEVSX0dSQVBISUNfREFUQV9DICAgICAgICAgICAgICAgICAgICAgKDB4MzZCICsgTE9HXzFYX0JBU0VfQykKKworLyogQXVkaW8gRXZlbnQgRGF0YSAqLworI2RlZmluZSBMT0dfUFJPRklMRVJfQVVESU9fREFUQV9DICAgICAgICAgICAgICAgICAgICAgICAoMHgzNkMgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBHUFMgU3BlY3RyYWwgS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sdCAqLworI2RlZmluZSBMT0dfR1BTX1BSRVNDUklCRURfRFdFTExfUkVTVUxUX0MgICAgICAgICAgICAgICAoMHgzNzQgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBDR1BTIElQQyBEYXRhICovCisjZGVmaW5lIExPR19DR1BTX0lQQ19EQVRBX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDM3NSArIExPR18xWF9CQVNFX0MpCisKKy8qIENHUFMgTm9uIElQQyBEYXRhICovCisjZGVmaW5lIExPR19DR1BTX05PTl9JUENfREFUQV9DICAgICAgICAgICAgICAgICAgICAgICAgICgweDM3NiArIExPR18xWF9CQVNFX0MpCisKKy8qIENHUFMgU2Vzc2lvbiBSZXBvcnQgKi8KKyNkZWZpbmUgTE9HX0NHUFNfUkVQX0VWVF9MT0dfUEFDS0VUX0MgICAgICAgICAgICAgICAgICAgKDB4Mzc3ICsgTE9HXzFYX0JBU0VfQykKKworLyogQ0dQUyBQRFNNIEdldCBQb3NpdGlvbiAqLworI2RlZmluZSBMT0dfQ0dQU19QRFNNX0dFVF9QT1NJVElPTl9DICAgICAgICAgICAgICAgICAgICAoMHgzNzggKyBMT0dfMVhfQkFTRV9DKQorCisvKiBDR1BTIFBEU00gU2V0IFBhcmFtZXRlcnMgKi8KKyNkZWZpbmUgTE9HX0NHUFNfUERTTV9TRVRfUEFSQU1FVEVSU19DICAgICAgICAgICAgICAgICAgKDB4Mzc5ICsgTE9HXzFYX0JBU0VfQykKKworLyogQ0dQUyBQRFNNIEVuZCBTZXNzaW9uICovCisjZGVmaW5lIExPR19DR1BTX1BEU01fRU5EX1NFU1NJT05fQyAgICAgICAgICAgICAgICAgICAgICgweDM3QSArIExPR18xWF9CQVNFX0MpCisKKy8qIENHUFMgUERTTSBOb3RpZnkgVmVyaWZ5IFJlc3BvbnNlICovCisjZGVmaW5lIExPR19DR1BTX1BEU01fTk9USUZZX1ZFUklGWV9SRVNQX0MgICAgICAgICAgICAgICgweDM3QiArIExPR18xWF9CQVNFX0MpCisKKy8qIENHUFMgUERTTSBQb3NpdGlvbiBSZXBvcnQgQ2FsbGJhY2sgKi8KKyNkZWZpbmUgTE9HX0NHUFNfUERTTV9QT1NJVElPTl9SRVBPUlRfQ0FMTEJBQ0tfQyAgICAgICAgKDB4MzdDICsgTE9HXzFYX0JBU0VfQykKKworLyogQ0dQUyBQRFNNIFBEIEV2ZW50IENhbGxiYWNrICovCisjZGVmaW5lIExPR19DR1BTX1BEU01fUERfRVZFTlRfQ0FMTEJBQ0tfQyAgICAgICAgICAgICAgICgweDM3RCArIExPR18xWF9CQVNFX0MpCisKKy8qIENHUFMgUERTTSBQQSBFdmVudCBDYWxsYmFjayAqLworI2RlZmluZSBMT0dfQ0dQU19QRFNNX1BBX0VWRU5UX0NBTExCQUNLX0MgICAgICAgICAgICAgICAoMHgzN0UgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBDR1BTIFBEU00gTm90aWZ5IFZlcmlmeSBSZXF1ZXN0IENhbGxiYWNrICovCisjZGVmaW5lIExPR19DR1BTX1BEU01fTk9USUZZX1ZFUklGWV9SRVFVRVNUX0MgICAgICAgICAgICgweDM3RiArIExPR18xWF9CQVNFX0MpCisKKy8qIENHUFMgUERTTSBQRCBDb21tYW5kIEVycm9yIENhbGxiYWNrICovCisjZGVmaW5lIExPR19DR1BTX1BEU01fUERfQ01EX0VSUl9DQUxMQkFDS19DICAgICAgICAgICAgICgweDM4MCArIExPR18xWF9CQVNFX0MpCisKKy8qIENHUFMgUERTTSBQQSBDb21tYW5kIEVycm9yIENhbGxiYWNrICovCisjZGVmaW5lIExPR19DR1BTX1BEU01fUEFfQ01EX0VSUl9DQUxMQkFDS19DICAgICAgICAgICAgICgweDM4MSArIExPR18xWF9CQVNFX0MpCisKKy8qIENHUFMgUERTTSBQb3NpdGlvbiBFcnJvciAqLworI2RlZmluZSBMT0dfQ0dQU19QRFNNX1BPU19FUlJPUl9DICAgICAgICAgICAgICAgICAgICAgICAoMHgzODIgKyBMT0df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isKKy8qIFFPUyBJbmZvIENvZGUgVXBkYXRlIExvZyAqLworI2RlZmluZSBMT0dfUU9TX0lORk9fQ09ERV9VUERBVEVfQyAgICAgICAgICAgICAgICAgICAgICAoMHgzQUYgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBUcmFuc21pdChVcGxpbmspIFZvY29kZXIgUENNIFBhY2tldCBMb2cgKi8KKyNkZWZpbmUgTE9HX1RYX1BDTV9QQUNLRVRfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4M0IwICsgTE9HXzFYX0JBU0VfQykKKworLyogQXVkaW8gVm9jb2RlciBEYXRhIFBhdGhzICovCisjZGVmaW5lIExPR19BVURWT0NfREFUQV9QQVRIU19QQUNLRVRfQyAgICAgICAgICAgICAgICAgICgweDNCMCArIExPR18xWF9CQVNFX0MpCisKKy8qIFJlY2VpdmUoRG93bmxpbmspIFZvY29kZXIgUENNIFBhY2tldCBMb2cgKi8KKyNkZWZpbmUgTE9HX1JYX1BDTV9QQUNLRVRfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4M0IxICsgTE9HXzFYX0JBU0VfQykKKworLyogQ1JDIG9mIFlVViBmcmFtZSBsb2cgKi8KKyNkZWZpbmUgTE9HX0RFQ19DUkNfRlJBTUVfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4M0IyICsgTE9HXzFYX0JBU0VfQykKKworLyogRkxVVEUgU2Vzc2lvbiBJbmZvcm1hdGlvbiAqLworI2RlZmluZSBMT0dfRkxVVEVfU0VTU0lPTl9JTkZPX0MgICAgICAgICAgICAgICAgICAgICAgICAoMHgzQjMgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBGTFVURSBBRFAgRmlsZSBJbmZvcm1hdGlvbiAqLworI2RlZmluZSBMT0dfRkxVVEVfQURQX0ZJTEVfSU5GT19DICAgICAgICAgICAgICAgICAgICAgICAoMHgzQjQgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBGTFVURSBGaWxlIFJlcXVlc3QgSW5mb3JtYXRpb24gKi8KKyNkZWZpbmUgTE9HX0ZMVVRFX0ZJTEVfUkVRX0lORk9fQyAgICAgICAgICAgICAgICAgICAgICAgKDB4M0I1ICsgTE9HXzFYX0JBU0VfQykKKworLyogRkxVVEUgRkRUIEluc3RhbmNlIEluZm9ybWF0aW9uICovCisjZGVmaW5lIExPR19GTFVURV9GRFRfSU5TVF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDNCNiArIExPR18xWF9CQVNFX0MpCisKKy8qIEZMVVRFIEZEVCBJbmZvcm1hdGlvbiAqLworI2RlZmluZSBMT0dfRkxVVEVfRkRUX0lORk9fQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgzQjcgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBGTFVURSBGaWxlIExvZyBQYWNrZXQgSW5mb3JtYXRpb24gKi8KKyNkZWZpbmUgTE9HX0ZMVVRFX0ZJTEVfSU5GT19DICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4M0I4ICsgTE9HXzFYX0JBU0VfQykKKworLyogM0cgMVggUGFyYW1ldGVyIE92ZXJoZWFkIEluZm9ybWF0aW9uICovCisjZGVmaW5lIExPR19WT0lQX1RPX0NETUFfM0cxWF9QQVJBTUVURVJTX0MgICAgICAgICAgICAgICgweDNCOSArIExPR18xWF9CQVNFX0MpCisKKy8qIENHUFMgTUUgSm9iIEluZm8gKi8KKyNkZWZpbmUgTE9HX0NHUFNfTUVfSk9CX0lORk9fQyAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4M0JBICsgTE9HXzFYX0JBU0VfQykKKworLyogQ0dQUyBNRSBTViBMaXN0cyAqLworI2RlZmluZSBMT0dfQ1BHU19NRV9TVl9MSVNUU19DICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgzQkIgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBGbGV4aWJsZSBQcm9maWxpbmcgU3RhdHVzICovCisjZGVmaW5lIExPR19QUk9GRElBR19HRU5fU1RBVFVTX0MgICAgICAgICAgICAgICAgICAgICAgICgweDNCQyArIExPR18xWF9CQVNFX0MpCisKKy8qIEZsZXhpYmxlIFByb2ZpbGluZyBSZXN1bHRzICovCisjZGVmaW5lIExPR19QUk9GRElBR19HRU5fUFJPRl9DICAgICAgICAgICAgICAgICAgICAgICAgICgweDNCRCArIExPR18xWF9CQVNFX0MpCisKKy8qIEZMVVRFIEFEUCBGaWxlIENvbnRlbnQgTG9nIFBhY2tldCBJbmZvcm1hdGlvbiAqLworI2RlZmluZSBMT0dfRkxVVEVfQURQX0ZJTEVfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgzQkUgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBGTFVURSBGRFQgSW5zdGFuY2UgRmlsZSBDb250ZW50IExvZyBQYWNrZXQgSW5mb3JtYXRpb24gKi8KKyNkZWZpbmUgTE9HX0ZMVVRFX0ZEVF9JTlNUX0ZJTEVfQyAgICAgICAgICAgICAgICAgICAgICAgKDB4M0JGICsgTE9HXzFYX0JBU0VfQykKKworLyogRkxVVEUgRkRUIEVudHJpZXMgSW5mb3JtYXRpb24gKi8KKyNkZWZpbmUgTE9HX0ZMVVRFX0ZEVF9FTlRSSUVTX0lORk9fQyAgICAgICAgICAgICAgICAgICAgKDB4M0MwICsgTE9HXzFYX0JBU0VfQykKKworLyogRkxVVEUgRmlsZSBDb250ZW50cyBMb2cgUGFja2V0IEluZm9ybWF0aW9uICovCisjZGVmaW5lIExPR19GTFVURV9GSUxFX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDNDMSArIExPR18xWF9CQVNFX0MpCisKKy8qIENHUFMgTUUgVGltZS1UcmFuc2ZlciBJbmZvICovCisjZGVmaW5lIExPR19DR1BTX01FX1RJTUVfVFJBTlNGRVJfSU5GT19DICAgICAgICAgICAgICAgICgweDNDMiArIExPR18xWF9CQVNFX0MpCisKKy8qIENHUFMgTUUgVU1UUyBUaW1lLVRhZ2dpbmcgSW5mbyAq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BU0VfQykKKworLyogRGF0YSBmcm9tIGEgZHJpdmVyICovCisjZGVmaW5lIExPR19TTlNEX0RBVEEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDNDQSArIExPR18xWF9CQVNFX0MpCisjZGVmaW5lIExPR19TTlNEX0RBVEFfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDNDQSArIExPR18xWF9CQVNFX0MpCisKKy8qIENHUFMgQ2VsbCBEQiBDZWxsIENoYW5nZSBJbmZvICovCisjZGVmaW5lIExPR19DR1BTX0NFTExEQl9DRUxMX0NIQU5HRV9JTkZPX0MgICAgICAgICAgICAgICgweDNDQiArIExPR18xWF9CQVNFX0MpCisKKy8qIHhTY2FsYXIgWVVWIGZyYW1lIGxvZyAqLworI2RlZmluZSBMT0dfREVDX1hTQ0FMRV9ZVVZfRlJBTUVfQyAgICAgICAgICAgICAgICAgICAgICAoMHgzQ0MgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBDUkMgb2YgeFNjYWxlZCBZVVYgZnJhbWUgbG9nICovCisjZGVmaW5lIExPR19ERUNfWFNDQUxFX0NSQ19GUkFNRV9DICAgICAgICAgICAgICAgICAgICAgICgweDNDRCArIExPR18xWF9CQVNFX0MpCisKKy8qIENHUFMgRnJlcXVlbmN5IEVzdGltYXRlIFJlcG9ydCAqLworI2RlZmluZSBMT0dfQ0dQU19GUkVRX0VTVF9SRVBPUlRfQyAgICAgICAgICAgICAgICAgICAgICAoMHgzQ0UgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBHUFMgRENNRSBTcmNoIEpvYiBDb21wbGV0ZWQgKi8KKyNkZWZpbmUgTE9HX0dQU19EQ01FX1NSQ0hfSk9CX0NPTVBMRVRFRF9DICAgICAgICAgICAgICAgKDB4M0NGICsgTE9HXzFYX0JBU0VfQykKKworLyogQ0dQUyBNRSBGYXN0c2NhbiByZXN1bHRzICAqLworI2RlZmluZSBMT0dfQ0dQU19NRV9GQVNUU0NBTl9SRVNV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tcHQgKi8KKyNkZWZpbmUgTE9HX1VNQkNQX1NFU1NJT05fQVRURU1QVF9DICAgICAgICAgICAgICAgICAgICAgKDB4M0Q3ICsgTE9HXzFYX0JBU0VfQykKKworLyogVU1CIENhbGwgUHJvY2Vzc2luZyBSb3V0ZSBJbmZvcm1hdGlvbiAqLworI2RlZmluZSBMT0dfVU1CQ1BfUk9VVEVfSU5GT19DICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgzRDggKyBMT0dfMVhfQkFTRV9DKQorCisvKiBVTUIgQ2FsbCBQcm9jZXNzaW5nIFN0YXRlIEluZm9ybWF0aW9uICovCisjZGVmaW5lIExPR19VTUJDUF9TVEFURV9JTkZPX0MgICAgICAgICAgICAgICAgICAgICAgICAgICgweDNEOSArIExPR18xWF9CQVNFX0MpCisKKy8qIFVNQiBDYWxsIFByb2Nlc3NpbmcgU05QICovCisjZGVmaW5lIExPR19VTUJDUF9TTlBfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDNEQSArIExPR18xWF9CQVNFX0MpCisKKy8qIENHUFMgU2Vzc2lvbiBFYXJseSBFeGl0IERlY2lzaW9uICovCisjZGVmaW5lIExPR19DR1BTX1NFU1NJT05fRUFSTFlfRVhJVF9ERUNJU0lPTl9DICAgICAgICAgICgweDNEQiArIExPR18xWF9CQVNFX0MpCisKKy8qIEdQUyBSRiBMaW5lYXJpdHkgU3RhdHVzICovCisjZGVmaW5lIExPR19DR1BTX01FX1JGX0xJTkVBUklUWV9JTkZPX0MgICAgICAgICAgICAgICAgICgweDNEQyArIExPR18xWF9CQVNFX0MpCisKKy8qIENHUFMgTUUgNW1zIElRIFN1bXMgKi8KKyNkZWZpbmUgTE9HX0NHUFNfTUVfNU1TX0lRX1NVTVNfQyAgICAgICAgICAgICAgICAgICAgICAgKDB4M0REICsgTE9HXzFYX0JBU0VfQykKKworLyogQ0dQUyBNRSAyMG1zIElRIFN1bXMgKi8KKyNkZWZpbmUgTE9HX0NQR1NfTUVfMjBNU19JUV9TVU1TX0MgICAgICAgICAgICAgICAgICAgICAgKDB4M0RFICsgTE9HXzFYX0JBU0VfQykKKworLyogUk9IQyBDb21wcmVzc29yIFN0YXRpc3RpY3MgKi8KKyNkZWZpbmUgTE9HX1JPSENfQ09NUFJFU1NPUl9TVEFUU19DICAgICAgICAgICAgICAgICAgICAgKDB4M0RGICsgTE9HXzFYX0JBU0VfQykKKworLyogUk9IQyBEZWNvbXByZXNzb3IgU3RhdGlzdGljcyAqLworI2RlZmluZSBMT0dfUk9IQ19ERUNPTVBSRVNTT1JfU1RBVFNfQyAgICAgICAgICAgICAgICAgICAoMHgzRTAgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBTZW5zb3JzIC0gS2FsbWFuIGZpbHRlciBpbmZvcm1hdGlvbiAqLworI2RlZmluZSBMT0dfU0VOU09SX0tGX0lORk9fQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgzRTEgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBTZW5zb3JzIC0gSW50ZWdyYXRlZCBtZWFzdXJlbWVudHMgKi8KKyNkZWZpbmUgTE9HX1NFTlNPUl9JTlRfTUVBU19DICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4M0UyICsgTE9HXzFYX0JBU0VfQykKKworLyogU2Vuc29ycyAtIEJpYXMgY2FsaWJyYXRpb24gdmFsdWVzICovCisjZGVmaW5lIExPR19TRU5TT1JfQklBU19DQUxJQlJBVElPTl9DICAgICAgICAgICAgICAgICAgICgweDNFMyArIExPR18xWF9CQVNFX0MpCisKKy8qIExvZyBjb2RlcyAweDEzRTQtMHgxM0U3IGFyZSBub3QgZm9sbG93aW5nIHN0YW5kYXJkIGxvZyBuYW1pbmcgY29udmVudGlvbiAqLworCisvKiBEVFYgSVNEQi1UIFRyYW5zcG9ydCBTdHJlYW0gUGFja2V0cyAqLworI2RlZmluZSBMT0dfRFRWX0lTREJfVFNfUEFDS0VUUyAgICAgICAgICAgICAgICAgICAgICAgICAoMHgzRTQgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBEVFYgSVNEQi1UIFBFUyBQYWNrZXRzICovCisjZGVmaW5lIExPR19EVFZfSVNEQl9QRVNfUEFDS0VUUyAgICAgICAgICAgICAgICAgICAgICAgICgweDNFNSArIExPR18xWF9CQVNFX0MpCisKKy8qIERUViBJU0RCLVQgU2VjdGlvbnMgKi8KKyNkZWZpbmUgTE9HX0RUVl9JU0RCX1NFQ1RJT05TICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4M0U2ICsgTE9HXzFYX0JBU0VfQykKKworLyogRFRWIElTREItVCBCdWZmZXJpbmcgKi8KKyNkZWZpbmUgTE9HX0RUVl9JU0RCX0JVRkZFUklORyAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4M0U3ICsgTE9HXzFYX0JBU0VfQykKKworLyogV0xBTiBTeXN0ZW0gQWNxdWlzaXRpb24gYW5kIEhhbmRvZmYgKi8KKyNkZWZpbmUgTE9HX1dMQU5fU1lTX0FDUV9IT19DICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4M0U4ICsgTE9HXzFYX0JBU0VfQykKKworLyogV0xBTiBHZW5lcmFsIENvbmZpZ3VyYWJsZSBQYXJhbWV0ZXJzICovCisjZGVmaW5lIExPR19XTEFOX0dFTl9DT05GSUdfUEFSQU1TX0MgICAgICAgICAgICAgICAgICAgICgweDNFOSArIExPR18xWF9CQVNFX0MpCisKKy8qIFVNQiBQaHlzaWNhbCBMYXllciBDaGFubmVsIGFuZCBJbnRlcmZlcmVuY2UgRXN0aW1hdGlvbiAqLworI2RlZmluZSBMT0dfVU1CX1BIWV9SWF9EUElDSF9DSUVfQyAgICAgICAgICAgICAgICAgICAgICAoMHgzRUEgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBVTUIgUGh5c2ljYWwgTGF5ZXIgTU1TRS9NUkMgRGVtb2R1bGF0ZWQgRGF0YSBTeW1ib2xzIChMb3cpICovCisjZGVmaW5lIExPR19VTUJfUEhZX1JYX0RB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MTcgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBVTUIgUVBDSCAqLworI2RlZmluZSBMT0dfVU1CX1FQQ0hfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHg0MTggKyBMT0dfMVhfQkFTRV9DKQorCisvKiBVTUIgUkxMIEZvcndhcmQgUGFydGlhbCBSUCBQYWNrZXQgKi8KKyNkZWZpbmUgTE9HX1VNQl9STExfRk9SV0FSRF9QQVJUSUFMX1JQX0MgICAgICAgICAgICAgICAgKDB4NDE5ICsgTE9HXzFYX0JBU0VfQykKKworLyogVU1CIFJMTCBSZXZlcnNlIFBhcnRpYWwgUlAgUGFja2V0ICovCisjZGVmaW5lIExPR19VTUJfUkxMX1JFVkVSU0VfUEFSVElBTF9SUF9DICAgICAgICAgICAgICAgICgweDQxQSArIExPR18xWF9CQVNFX0MpCisKKy8qIFVNQiBSTEwgRm9yd2FyZCBTaWduYWwgUGFja2V0ICovCisjZGVmaW5lIExPR19VTUJfUkxMX0ZPUldBUkRfU0lHTkFMX0MgICAgICAgICAgICAgICAgICAgICgweDQxQiArIExPR18xWF9CQVNFX0MpCisKKy8qIFVNQiBSTEwgUmV2ZXJzZSBTaWduYWwgUGFja2V0ICovCisjZGVmaW5lIExPR19VTUJfUkxMX1JFVkVSU0VfU0lHTkFMX0MgICAgICAgICAgICAgICAgICAgICgweDQxQyArIExPR18xWF9CQVNFX0MpCisKKy8qIFVNQiBSTEwgRm9yd2FyZCBTdGF0aXN0aWNzICovCisjZGVmaW5lIExPR19VTUJfUkxMX0ZPUldBUkRfU1RBVFNfQyAgICAgICAgICAgICAgICAgICAgICgweDQxRCArIExPR18xWF9CQVNFX0MpCisKKy8qIFVNQiBSTEwgUmV2ZXJzZSBTdGF0aXN0aWNzICovCisjZGVmaW5lIExPR19VTUJfUkxMX1JFVkVSU0VfU1RBVFNfQyAgICAgICAgICAgICAgICAgICAgICgweDQxRSArIExPR18xWF9CQVNFX0MpCisKKy8qIFVNQiBSTEwgSVJUUCAqLworI2RlZmluZSBMT0dfVU1CX1JMTF9JUlRQX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHg0MUYgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBVTUIgQVAgRm9yd2FyZCBMaW5rIE1BQyBQYWNrZXRzICovCisjZGVmaW5lIExPR19VTUJfQVBfRkxfTUFDX1BBQ0tFVF9DICAgICAgICAgICAgICAgICAgICAgICgweDQyMCArIExPR18xWF9CQVNFX0MpCisKKy8qIFVNQiBBUCBSZXZlcnNlIExpbmsgTUFDIFBhY2tldHMgKi8KKyNkZWZpbmUgTE9HX1VNQl9BUF9STF9NQUNfUEFDS0VUX0MgICAgICAgICAgICAgICAgICAgICAgKDB4NDIxICsgTE9HXzFYX0JBU0VfQykKKworLyogR1BTIFBlcmZvcm1hbmNlIFN0YXRpc3RpY3MgbG9nICovCisjZGVmaW5lIExPR19DR1BTX1BFUkZPUk1BTkNFX1NUQVRTX0MgICAgICAgICAgICAgICAgICAgICgweDQyMiArIExPR18xWF9CQVNFX0MpCisKKy8qIFVNQiBTZWFyY2hlciBHZW5lcmFsIFN0YXR1cyAqLworI2RlZmluZSBMT0dfVU1CX1NSQ0hfR0VORVJBTF9TVEFUVVNfQyAgICAgICAgICAgICAgICAgICAoMHg0MjMgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBVTUIgU3VwZXJmcmFtZSBTY2hlZHVsZXIgKi8KKyNkZWZpbmUgTE9HX1VNQl9TVVBFUkZSQU1FX1NDSEVEVUxFUl9DICAgICAgICAgICAgICAgICAgKDB4NDI0ICsgTE9HXzFYX0JBU0VfQykKKworLyogVU1CIFNlY3RvciBMaXN0ICovCisjZGVmaW5lIExPR19VTUJfU0VDVE9SX0xJU1RfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDQyNSArIExPR18xWF9CQVNFX0MpCisKKy8qIFVNQiBNQUMgQWNjZXNzIEF0dGVtcHQgQ29tbWFuZCAqLworI2RlZmluZSBMT0dfVU1CX01BQ19BQ0NFU1NfQVRURU1QVF9DTURfQyAgICAgICAgICAgICAgICAoMHg0MjYgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBVTUIgTUFDIEFjY2VzcyBQcm9iZSBJbmZvcm1hdGlvbiAqLworI2RlZmluZSBMT0dfVU1CX01BQ19BQ0NFU1NfUFJPQkVfSU5GT19DICAgICAgICAgICAgICAgICAoMHg0MjcgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBVTUIgTUFDIFJUQ01BQyBQYWNrYWdlIEluZm9ybWF0aW9uICovCisjZGVmaW5lIExPR19VTUJfTUFDX1JUQ01BQ19QS0dfSU5GT19DICAgICAgICAgICAgICAgICAgICgweDQyOCArIExPR18xWF9CQVNFX0MpCisKKy8qIFVNQiBNQUMgU3VwZXIgRnJhbWUgSW5mb3JtYXRpb24gKi8KKyNkZWZpbmUgTE9HX1VNQl9NQUNfU0lfSU5GT19DICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4NDI5ICsgTE9HXzFYX0JBU0VfQykKKworLyogVU1CIE1BQyBRdWljayBDaGFubmVsIEluZm9ybWF0aW9uICovCisjZGVmaW5lIExPR19VTUJfTUFDX1FDSV9JTkZPX0MgICAgICAgICAgICAgICAgICAgICAgICAgICgweDQyQSArIExPR18xWF9CQVNFX0MpCisKKy8qIFVNQiBNQUMgUGFnaW5nIElkIExpc3QgKi8KKyNkZWZpbmUgTE9HX1VNQl9NQUNfUEFHSU5HX0lEX0xJU1RfQyAgICAgICAgICAgICAgICAgICAgKDB4NDJCICsgTE9HXzFYX0JBU0VfQykKKworLyogVU1CIE1BQyBRdWljayBQYWdpbmcgQ2hhbm5lbCBJbmZvcm1hdGlvbiAqLworI2RlZmluZSBMT0dfVU1CX01BQ19RUENIX0lORk9fQyAgICAgICAgICAgICAgICAgICAgICAgICAoMHg0MkMgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBVTUIgTUFDIEZUQ01BQyBJbmZvcm1hdGlvbiAqLworI2RlZmluZSBMT0dfVU1CX01BQ19GVENNQUNfUEtHX0lORk9fQyAgICAgICAgICAgICAgICAgICAoMHg0MkQgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBVTUIgTUFDIEFjY2VzcyBHcmFudCBSZWNlaXZpbmcgKi8KKyNkZWZpbmUgTE9HX1VNQl9NQUNfQUNDRVNTX0dSQU5UX0MgICAgICAgICAgICAgICAgICAgICAgKDB4NDJFICsgTE9HXzFYX0JBU0VfQykKKworLyogVU1CIE1BQyBHZW5lcmljIERlYnVnIExvZyAqLworI2RlZmluZSBMT0dfVU1CX01BQ19HRU5fREVCVUdfTE9HX1BLR19DICAgICAgICAgICAgICAgICAoMHg0MkYgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBDR1BTIEZyZXF1ZW5jeSBCaWFzIEVzdGltYXRlICovCisjZGVmaW5lIExPR19DR1BTX01DX0ZSRVFfQklBU19FU1RfQyAgICAgICAgICAgICAgICAgICAgICgweDQzMCArIExPR18xWF9CQVNFX0MpCisKKy8qIFVNQiBNQUMgUmVxdWVzdCBSZXBvcnQgSW5mb3JtYXRpb24gTG9nICovCisjZGVmaW5lIExPR19VTUJfTUFDX1JFUUNIX1JFUE9SVF9JTkZPX0MgICAgICAgICAgICAgICAgICgweDQzMSArIExPR18xWF9CQVNFX0MpCisKKy8qIFVNQiBNQUMgUmV2ZXJzZSBMaW5rIFFvUyBUb2tlbiBCdWNrZXQgSW5mb3JtYXRpb24gTG9nICovCisjZGVmaW5lIExPR19VTUJfTUFDX1JMUU9TX1RPS0VOX0JVQ0tFVF9JTkZPX0MgICAgICAgICAgICgweDQzMiArIExPR18xWF9CQVNFX0MpCisKKy8qIFVNQiBNQUMgUmV2ZXJzZSBMaW5rIFFvUyBTdHJlYW0gSW5mb3JtYXRpb24gTG9nICovCisjZGVmaW5lIExPR19VTUJfTUFDX1JMUU9TX1NUUkVBTV9JTkZPX0MgICAgICAgICAgICAgICAgICgweDQzMyArIExPR18xWF9CQVNFX0MpCisKKy8qIFVNQiBNQ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oZXIgNCBNdWx0aS1DYXJyaWVyIEhEUiAqLworI2RlZmluZSBMT0dfU1JDSDRfTUNfSERSX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHg0M0EgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBQcm90b2NvbCBTZXJ2aWNlcyBkZXNjcmliZSBhbGwgSVBIQyBpbnN0YW5jZXMgKi8KKyNkZWZpbmUgTE9HX1BTX1NUQVRfREVTQ19BTExfSVBIQ19JTlNUX0MgICAgICAgICAgICAgICAgKDB4NDNCICsgTE9HXzFYX0JBU0VfQykKKworLyogUHJvdG9jb2wgU2VydmljZXMgZGVzY3JpYmUgYWxsIFJPSEMgaW5zdGFuY2VzICovCisjZGVmaW5lIExPR19QU19TVEFUX0RFU0NfQUxMX1JPSENfSU5TVF9DICAgICAgICAgICAgICAgICgweDQzQyArIExPR18xWF9CQVNFX0MpCisKKy8qIEJDYXN0IHNlY3VyaXR5IGFkZCBwcm9ncmFtIGluZm9ybWF0aW9uICovCisjZGVmaW5lIExPR19CQ0FTVF9TRUNfQUREX1BST0dSQU1fSU5GT19DICAgICAgICAgICAgICAgICgweDQzRCArIExPR18xWF9CQVNFX0MpCisKKy8qIEJDYXN0IHNlY3VyaXR5IGFkZCBwcm9ncmFtIGNvbXBsZXRlICovCisjZGVmaW5lIExPR19CQ0FTVF9TRUNfQUREX1BST0dSQU1fQ09NUExFVEVfQyAgICAgICAgICAgICgweDQzRSArIExPR18xWF9CQVNFX0MpCisKKy8qIEJDYXN0IHNlY3VyaXR5IFNEUCBwYXJzZSAqLworI2RlZmluZSBMT0dfQkNBU1RfU0VDX1NEUF9QQVJTRV9DICAgICAgICAgICAgICAgICAgICAgICAoMHg0M0YgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBDR1BTIE1FIGR5bmFtaWMgcG93ZXIgb3B0aW1pemF0aW9uIHN0YXR1cyAqLworI2RlZmluZSBMT0dfQ0dQU19NRV9EUE9fU1RBVFVTX0MgICAgICAgICAgICAg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gICAgICAgICAgICAoMHg0NDcgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBSRiBSRk0gc3RhdGUgKi8KKyNkZWZpbmUgTE9HX1JGX1JGTV9TVEFURV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4NDQ4ICsgTE9HXzFYX0JBU0VfQykKKworLyogMVggUkYgV2FybXVwICovCisjZGVmaW5lIExPR18xWF9SRl9XQVJNVVBfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDQ0OSArIExPR18xWF9CQVNFX0MpCisKKy8qIDFYIFJGIHBvd2VyIGxpbWl0aW5nICovCisjZGVmaW5lIExPR18xWF9SRl9QV1JfTE1UX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDQ0QSArIExPR18xWF9CQVNFX0MpCisKKy8qIDFYIFJGIHN0YXRlICovCisjZGVmaW5lIExPR18xWF9SRl9TVEFURV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDQ0QiArIExPR18xWF9CQVNFX0MpCisKKy8qIDFYIFJGIHNsZWVwICovCisjZGVmaW5lIExPR18xWF9SRl9TTEVFUF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDQ0QyArIExPR18xWF9CQVNFX0MpCisKKy8qIDFYIFJGIFRYIHN0YXRlICovCisjZGVmaW5lIExPR18xWF9SRl9UWF9TVEFURV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDQ0RCArIExPR18xWF9CQVNFX0MpCisKKy8qIDFYIFJGIEludGVsbGlDZWl2ZXIgc3RhdGUgKi8KKyNkZWZpbmUgTE9HXzFYX1JGX0lOVF9TVEFURV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4NDRFICsgTE9HXzFYX0JBU0VfQykKKworLyogMVggUkYgUlggQURDIGNsb2NrICovCisjZGVmaW5lIExPR18xWF9SRl9SWF9BRENfQ0xLX0MgICAgICAgICAgICAgICAgICAgICAgICAgICgweDQ0RiArIExPR18xWF9CQVNFX0MpCisKKy8qIDFYIFJGIExOQSBzd2l0Y2ggcG9pbnQgKi8KKyNkZWZpbmUgTE9HXzFYX1JGX0xOQV9TV0lUQ0hQX0MgICAgICAgICAgICAgICAgICAgICAgICAgKDB4NDUwICsgTE9HXzFYX0JBU0VfQykKKworLyogMVggUkYgUlggY2FsaWJyYXRpb24gKi8KKyNkZWZpbmUgTE9HXzFYX1JGX1JYX0NBTF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4NDUxICsgTE9HXzFYX0JBU0VfQykKKworLyogMVggUkYgQVBJICovCisjZGVmaW5lIExPR18xWF9SRl9BUElfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDQ1MiArIExPR18xWF9CQVNFX0MpCisKKy8qIDFYIFJGIFJYIFBMTCBsb2NraW5nIHN0YXR1cyAqLworI2RlZmluZSBMT0dfMVhfUkZfUlhfUExMX0xPQ0tfQyAgICAgICAgICAgICAgICAgICAgICAgICAoMHg0NTMgKyBMT0dfMVhfQkFTRV9DKQorCisvKiAxWCBSRiB2b2x0YWdlIHJlZ3VsYXRvciAqLworI2RlZmluZSBMT0dfMVhfUkZfVlJFR19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHg0NTQgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBDR1BTIERJQUcgc3VjY2Vzc2Z1bCBmaXggY291bnQgKi8KKyNkZWZpbmUgTE9HX0NHUFNfRElBR19TVUNDRVNTRlVMX0ZJWF9DT1VOVF9DICAgICAgICAgICAgKDB4NDU1ICsgTE9HXzFYX0JBU0VfQykKKworLyogQ0dQUyBNQyB0cmFjayBkeW5hbWljIHBvd2VyIG9wdGltaXphdGlvbiBzdGF0dXMgKi8KKyNkZWZpbmUgTE9HX0NHUFNfTUNfVFJBQ0tfRFBPX1NUQVRVU19DICAgICAgICAgICAgICAgICAgKDB4NDU2ICsgTE9HXzFYX0JBU0VfQykKKworLyogQ0dQUyBNQyBTQkFTIGRlbW9kdWxhdGVkIGJpdHMgKi8KKyNkZWZpbmUgTE9HX0NHUFNfTUNfU0JBU19ERU1PRF9CSVRTX0MgICAgICAgICAgICAgICAgICAgKDB4NDU3ICsgTE9HXzFYX0JBU0VfQykKKworLyogQ0dQUyBNQyBTQkFTIGRlbW9kdWxhdGVkIHNvZnQgc3ltYm9scyAqLworI2RlZmluZSBMT0dfQ0dQU19NQ19TQkFTX0RFTU9EX1NPRlRfU1lNQk9MU19DICAgICAgICAgICAoMHg0NTggKyBMT0dfMVhfQkFTRV9DKQorCisvKiBEYXRhIFNlcnZpY2VzIFBQUCBjb25maWd1cmF0aW9uICovCisjZGVmaW5lIExPR19EU19QUFBfQ09ORklHX1BBUkFNU19DICAgICAgICAgICAgICAgICAgICAgICgweDQ1OSArIExPR18xWF9CQVNFX0MpCisKKy8qIERhdGEgU2VydmljZXMgcGh5c2ljYWwgbGluayBjb25maWd1cmF0aW9uICovCisjZGVmaW5lIExPR19EU19QSFlTX0xJTktfQ09ORklHX1BBUkFNU19DICAgICAgICAgICAgICAgICgweDQ1QSArIExPR18xWF9CQVNFX0MpCisKKy8qIERhdGEgU2VydmljZXMgUFBQIGRldmljZSBjb25maWd1cmF0aW9uICovCisjZGVmaW5lIExPR19QU19QUFBfREVWX0NPTkZJR19QQVJBTVNfQyAgICAgICAgICAgICAgICAgICgweDQ1QiArIExPR18xWF9CQVNFX0MpCisKKy8qIENHUFMgUERTTSBHUFMgc3RhdGUgaW5mb3JtYXRpb24gKi8KKyNkZWZpbmUgTE9HX0NHUFNfUERTTV9HUFNfU1RBVEVfSU5GT19DICAgICAgICAgICAgICAgICAgKDB4NDVDICsgTE9HXzFYX0JBU0VfQykKKworLyogQ0dQUyBQRFNNIEVYVCBzdGF0dXMgR1BTIHN0YXRlIGluZm9ybWF0aW9uICovCisjZGVmaW5lIExPR19DR1BTX1BEU01fRVhUX1NUQVRVU19HUFNfU1RBVEVfSU5GT19DICAgICAgICgweDQ1RCArIExPR18xWF9CQVNFX0MpCisKKy8qIENHUF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UHJvdG9jb2wgU2VydmljZXMgU3RhdGlzdGljcyBHbG9iYWwgU29ja2V0ICovCisjZGVmaW5lIExPR19QU19TVEFUX0dMT0JBTF9TT0NLX0MgICAgICAgICAgICAgICAgICAgICAgICgweDQ3MCArIExPR18xWF9CQVNFX0MpCisKKy8qIE1DUyBBcHBsaWNhdGlvbiBNYW5hZ2VyICovCisjZGVmaW5lIExPR19NQ1NfQVBQTUdSX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDQ3MSArIExPR18xWF9CQVNFX0MpCisKKy8qIE1DUyBNU0dSICovCisjZGVmaW5lIExPR19NQ1NfTVNHUl9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDQ3MiArIExPR18xWF9CQVNFX0MpCisKKy8qIE1DUyBRVEYgICovCisjZGVmaW5lIExPR19NQ1NfUVRGX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDQ3MyArIExPR18xWF9CQVNFX0MpCisKKy8qIFNlbnNvcnMgU3RhdGlvbmFyeSBEZXRlY3RvciBPdXRwdXQgKi8KKyNkZWZpbmUgTE9HX1NUQVRJT05BUllfREVURUNUT1JfT1VUUFVUX0MgICAgICAgICAgICAgICAgKDB4NDc0ICsgTE9HXzFYX0JBU0VfQykgIAorCisvKiBQcmludCBvdXQgdGhlIHBwbSBkYXRhIHBvcnRpb24gICovCisjZGVmaW5lIExPR19DR1BTX1BEU01fRVhUX1NUQVRVU19NRUFTX1JFUE9SVF9QUE1fQyAgICAgICgweDQ3NSArIExPR18xWF9CQVNFX0MpICAKKworLyogR05TUyBQb3NpdGlvbiBSZXBvcnQgKi8KKyNkZWZpbmUgTE9HX0dOU1NfUE9TSVRJT05fUkVQT1JUX0MgICAgICAgICAgICAgICAgICAgICAgKDB4NDc2ICsgTE9HXzFYX0JBU0VfQykgIAorCisvKiBHTlNTIEdQUyBNZWFzdXJlbWVudCBSZXBvcnQgKi8KKyNkZWZpbmUgTE9HX0dOU1NfR1BTX01FQVNVUkVNRU5UX1JFUE9SVF9DICAgICAgICAgICAgICAgKDB4NDc3ICsgTE9HXzFYX0JBU0VfQykgIAorCisvKiBHTlNTIENsb2NrIFJlcG9ydCAqLworI2RlZmluZSBMT0dfR05TU19DTE9DS19SRVBPUlRfQyAgICAgICAgICAgICAgICAgICAgICAgICAoMHg0NzggKyBMT0dfMVhfQkFTRV9DKSAgCisKKy8qIEdOU1MgRGVtb2QgU29mdCBEZWNpc2lvbiAqLworI2RlZmluZSBMT0dfR05TU19ERU1PRF9TT0ZUX0RFQ0lTSU9OU19DICAgICAgICAgICAgICAgICAoMHg0NzkgKyBMT0dfMVhfQkFTRV9DKSAgCisKKy8qIEdOU1MgTUUgNU1TIElRIHN1bSAqLworI2RlZmluZSBMT0dfR05TU19NRV81TVNfSVFfU1VNU19DICAgICAgICAgICAgICAgICAgICAgICAoMHg0N0EgKyBMT0dfMVhfQkFTRV9DKSAgCisKKy8qIEdOU1MgQ0QgREIgcmVwb3J0ICovCisjZGVmaW5lIExPR19HTlNTX0NEX0RCX1JFUE9SVF9DICAgICAgICAgICAgICAgICAgICAgICAgICgweDQ3QiArIExPR18xWF9CQVNFX0MpIAorCisvKiBHTlNTIFBFIFdMUyBwb3NpdGlvbiByZXBvcnQgKi8KKyNkZWZpbmUgTE9HX0dOU1NfUEVfV0xTX1BPU0lUSU9OX1JFUE9SVF9DICAgICAgICAgICAgICAgKDB4NDdDICsgTE9HXzFYX0JBU0VfQykgCisKKy8qIEdOU1MgUEUgS0YgcG9zaXRpb24gcmVwb3J0ICovCisjZGVmaW5lIExPR19HTlNTX1BFX0tGX1BPU0lUSU9OX1JFUE9SVF9DICAgICAgICAgICAgICAgICgweDQ3RCArIExPR18xWF9CQVNFX0MpIAorCisvKiBHTlNTIFBSWCBSRiBIVyBzdGF0dXMgcmVwb3J0ICovCisjZGVmaW5lIExPR19HTlNTX1BSWF9SRl9IV19TVEFUVVNfUkVQT1JUX0MgICAgICAgICAgICAgICgweDQ3RSArIExPR18xWF9CQVNFX0MpIAorCisvKiBHTlNTIERSWCBSRiBIVyBzdGF0dXMgcmVwb3J0ICovCisjZGVmaW5lIExPR19HTlNTX0RSWF9SRl9IV19TVEFUVVNfUkVQT1JUX0MgICAgICAgICAgICAgICgweDQ3RiArIExPR18xWF9CQVNFX0MpIAorCisvKiBHTlNTIEdsb25hc3MgTWVhc3VyZW1lbnQgcmVwb3J0ICovCisjZGVmaW5lIExPR19HTlNTX0dMT05BU1NfTUVBU1VSRU1FTlRfUkVQT1JUX0MgICAgICAgICAgICgweDQ4MCArIExPR18xWF9CQVNFX0MpIAorCisvKiBHTlNTIEdQUyBIQlcgUlhEIG1lYXN1cmVtZW50ICovCisjZGVmaW5lIExPR19HTlNTX0dQU19IQldfUlhEX01FQVNVUkVNRU5UX0MgICAgICAgICAgICAgICgweDQ4MSArIExPR18xWF9CQVNFX0MpIAorCisvKiBHTlNTIFBEU00gcG9zaXRpb24gcmVwb3J0IGNhbGxiYWNrICovCisjZGVmaW5lIExPR19HTlNTX1BEU01fUE9TSVRJT05fUkVQT1JUX0NBTExCQUNLX0MgICAgICAgICgweDQ4MiArIExPR18xWF9CQVNFX0MpCisKKy8qIElTZW5zZSBSZXF1ZXN0IFN0cmluZyAgKi8KKyNkZWZpbmUgTE9HX0lTRU5TRV9SRVFVRVNUX1NUUl9DICAgICAgICAgICAgICAgICAgICAgICAgKDB4NDgzICsgTE9HXzFYX0JBU0VfQykgCisKKy8qIElTZW5zZSBSZXNwb25zZSBTdHJpbmcgKi8KKyNkZWZpbmUgTE9HX0lTRU5TRV9SRVNQT05TRV9TVFJfQyAgICAgICAgICAgICAgICAgICAgICAgKDB4NDg0ICsgTE9HXzFYX0JBU0VfQykKKworLyogQmx1ZXRvb3RoIFNPQyBHZW5lcmFsIExvZyBQYWNrZXQqLworI2RlZmluZSBMT0dfQlRfU09DX0dFTkVSQUxfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHg0ODUgKyBMT0dfMVhfQkFTRV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AqLworI2RlZmluZSBMT0dfQ0dQU19TTkRCX1JFTU9WRV9DICAgICAgICAgICAgICAgICAgICAgICAgICAoMHg0OEQgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBDR1BTIFJlc2VydmVkICovCisjZGVmaW5lIExPR19HTlNTX0NDX1BFUkZPUk1BTkNFX1NUQVRTX0MgICAgICAgICAgICAgICAgICgweDQ4RSArIExPR18xWF9CQVNFX0MpCisKKy8qIEdOU1MgUERTTSBTZXQgUGFyYW1lcnRlcnMgKi8KKyNkZWZpbmUgTE9HX0dOU1NfUERTTV9TRVRfUEFSQU1FVEVSU19DICAgICAgICAgICAgICAgICAgKDB4NDhGICsgTE9HXzFYX0JBU0VfQykKKworLyogR05TUyBQRFNNIFBEIEV2ZW50IENhbGxiYWNrICovCisjZGVmaW5lIExPR19HTlNTX1BEU01fUERfRVZFTlRfQ0FMTEJBQ0tfQyAgICAgICAgICAgICAgICgweDQ5MCArIExPR18xWF9CQVNFX0MpCisKKy8qIEdOU1MgUERTTSBQQSBFdmVudCBDYWxsYmFjayAqLworI2RlZmluZSBMT0dfR05TU19QRFNNX1BBX0VWRU5UX0NBTExCQUNLX0MgICAgICAgICAgICAgICAoMHg0OTEgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBDR1BTIFJlc2VydmVkICovCisjZGVmaW5lIExPR19DR1BTX1JFU0VSVkVEMl9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDQ5MiArIExPR18xWF9CQVNFX0MpCisKKy8qIENHUFMgUmVzZXJ2ZWQgKi8KKyNkZWZpbmUgTE9HX0NHUFNfUkVTRVJWRUQzX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4NDkzICsgTE9HXzFYX0JBU0VfQykKKworLyogR05TUyBQRFNNIEVYVCBTdGF0dXMgTUVBUyBSZXBvcnQgKi8KKyNkZWZpbmUgTE9HX0dOU1NfUERTTV9FWFRfU1RBVFVTX01FQVNfUkVQT1JUX0MgICAgICAgICAgKDB4NDk0ICsgTE9HXzFYX0JBU0VfQykKKworLyogR05TUyBTTSBFcnJvciAqLworI2RlZmluZSBMT0dfR05TU19TTV9FUlJPUl9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHg0OTUgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBXTEFOIFNjYW4gKi8KKyNkZWZpbmUgTE9HX1dMQU5fU0NBTl9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4NDk2ICsgTE9HXzFYX0JBU0VfQykKKworLyogV0xBTiBJQlNTICovCisjZGVmaW5lIExPR19XTEFOX0lCU1NfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDQ5NyArIExPR18xWF9CQVNFX0MpCisKKy8qIFdMQU4gODAyLjExZCovCisjZGVmaW5lIExPR19XTEFOXzgwMjExRF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDQ5OCArIExPR18xWF9CQVNFX0MpCisKKy8qIFdMQU4gSGFuZG9mZiAqLworI2RlZmluZSBMT0dfV0xBTl9IQU5ET0ZGX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHg0OTkgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBXTEFOIFFvUyBFRENBICovCisjZGVmaW5lIExPR19XTEFOX1FPU19FRENBX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDQ5QSArIExPR18xWF9CQVNFX0MpCisKKy8qIFdMQU4gQmVhY29uIFVwZGF0ZSAqLworI2RlZmluZSBMT0dfV0xBTl9CRUFDT05fVVBEQVRFX0MgICAgICAgICAgICAgICAgICAgICAgICAoMHg0OUIgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBXTEFOIFBvd2VyIHNhdmUgd293IGFkZCBwYXR0ZXJuICovCisjZGVmaW5lIExPR19XTEFOX1BPV0VSU0FWRV9XT1dfQUREX1BUUk5fQyAgICAgICAgICAgICAgICgweDQ5QyArIExPR18xWF9CQVNFX0MpCisKKy8qIFdMQU4gV0NNIGxpbmsgbWV0cmljcyAqLworI2RlZmluZSBMT0dfV0xBTl9XQ01fTElOS01FVFJJQ1NfQyAgICAgICAgICAgICAgICAgICAgICAoMHg0OUQgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBXTEFOIHdwcyBzY2FuIGNvbXBsZXRlKi8KKyNkZWZpbmUgTE9HX1dMQU5fV1BTX1NDQU5fQ09NUExFVEVfQyAgICAgICAgICAgICAgICAgICAgKDB4NDlFICsgTE9HXzFYX0JBU0VfQykKKworLyogV0xBTiBXUFMgV1NDIE1lc3NhZ2UgKi8KKyNkZWZpbmUgTE9HX1dMQU5fV1BTX1dTQ19NRVNTQUdFX0MgICAgICAgICAgICAgICAgICAgICAgKDB4NDlGICsgTE9HXzFYX0JBU0VfQykKKworLyogV0xBTiBXUFMgY3JlZGVudGlhbHMgKi8KKyNkZWZpbmUgTE9HX1dMQU5fV1BTX0NSRURFTlRJQUxTX0MgICAgICAgICAgICAgICAgICAgICAgKDB4NEEwICsgTE9HXzFYX0JBU0VfQykKKworLyogV0xBTiBMaW5rbGF5ZXIgc3RhdCovCisjZGVmaW5lIExPR19XTEFOX0xJTktMQVlFUl9TVEFUX0MgICAgICAgICAgICAgICAgICAgICAgICgweDRBMSArIExPR18xWF9CQVNFX0MpCisKKy8qIFdMQU4gUW9zIFRTcGVjKi8KKyNkZWZpbmUgTE9HX1dMQU5fUU9TX1RTUEVDX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4NEEyICsgTE9HXzFYX0JBU0VfQykKKworLyogUE1JQyBWcmVnIENvbnRyb2wgKi8KKyNkZWZpbmUgTE9HX1BNX1ZSRUdfQ09OVFJPTF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4NEEzICsgTE9HXzFYX0JBU0VfQykKKworLyogUE1JQyBWcmVnIExldmVsICovCisjZGVmaW5lIExPR19QTV9WUkVHX0xFVkVMX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDRBNCArIExPR18xWF9CQVNFX0Mp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mUgTE9HX1NOU19WQ1BTX1BMQU5FX1VQREFURSAgICAgICAgICAgICAgICAgICAgICAgKDB4NEFDICsgTE9HXzFYX0JBU0VfQykKKworLyogTG9jYXRpb24gcmVwb3J0ICAqLworI2RlZmluZSBMT0dfU05TX1ZDUFNfTE9DX1JFUE9SVCAgICAgICAgICAgICAgICAgICAgICAgICAoMHg0QUQgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBDTSBBY3RpdmUgc3Vic2NyaXB0aW9uICovCisjZGVmaW5lIExPR19DTV9QSF9FVkVOVF9TVUJTQ1JJUFRJT05fUFJFRl9JTkZPX0MgICAgICAgICgweDRBRSArIExPR18xWF9CQVNFX0MpCisKKy8qIERTRFMgdmVyc2lvbiBvZiBDTSBjYWxsIGV2ZW50ICovCisjZGVmaW5lIExPR19DTV9EU19DQUxMX0VWRU5UX0MgICAgICAgICAgICAgICAgICAgICAgICAgICgweDRBRiArIExPR18xWF9CQVNFX0MpCisKKy8qIFNlbnNvcnMgP01vYmlTZW5zIE91dHB1dCAqLworI2RlZmluZSBMT0dfTU9CSVNFTlNfT1VUUFVUX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHg0QjAgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBBY2NlbGVyb21ldGVyIERhdGEgICAqLworI2RlZmluZSBMT0dfQUNDRUxfREFUQV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHg0QjEgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBBY2NlbGVyb21ldGVyIENvbXBlbnNhdGVkIERhdGEgICovCisjZGVmaW5lIExPR19BQ0NFTF9DT01QX0RBVEFfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDRCMiArIExPR18xWF9CQVNFX0MpCisKKy8qIE1vdGlvbiBTdGF0ZSBEYXRhICAqLworI2RlZmluZSBMT0dfTU9USU9OX1NUQVRFX0RBVEFfQyAgICAgICAgICAgICAgICAgICAgICAgICAoMHg0QjMgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBTdGF0aW9uYXJ5IFBvc2l0aW9uIEluZGljYXRvciAgKi8KKyNkZWZpbmUgTE9HX1NUQVRfUE9TX0lORF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4NEI0ICsgTE9HXzFYX0JBU0VfQykKKworLyogTW90aW9uIFN0YXRlIEZlYXR1cmVzICAgKi8KKyNkZWZpbmUgTE9HX01PVElPTl9TVEFURV9GRUFUVVJFU19DICAgICAgICAgICAgICAgICAgICAgKDB4NEI1ICsgTE9HXzFYX0JBU0VfQykKKworLyogTW90aW9uIFN0YXRlIEhhcmQgRGVjaXNpb24gKi8KKyNkZWZpbmUgTE9HX01PVElPTl9TVEFURV9IQVJEX0RFQ0lTSU9OX0MgICAgICAgICAgICAgICAgKDB4NEI2ICsgTE9HXzFYX0JBU0VfQykKKyAgCisvKiBNb3Rpb24gU3RhdGUgU29mdCBEZWNpc2lvbiAqLworI2RlZmluZSBMT0dfTU9USU9OX1NUQVRFX1NPRlRfREVDSVNJT05fQyAgICAgICAgICAgICAgICAoMHg0QjcgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBTZW5zb3JzIFNvZnR3YXJlIFZlcnNpb24gKi8KKyNkZWZpbmUgTE9HX1NFTlNPUlNfU09GVFdBUkVfVkVSU0lPTl9DICAgICAgICAgICAgICAgICAgKDB4NEI4ICsgTE9HXzFYX0JBU0VfQykKKworLyogTW9iaVNlbnMgU3RhdGlvbmFyeSBQb3NpdGlvbiBJbmRpY2F0b3IgTG9nIFBhY2tldCAqLworI2RlZmluZSBMT0dfTU9CSVNFTlNfU1BJX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHg0QjkgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBYTyBjYWxpYnJhdGlvbiByYXcgSVEgZGF0YSAqLworI2RlZmluZSBMT0dfWE9fSVFfREFUQV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHg0QkEgKyBMT0dfMVhfQkFTRV9DK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RBVEFfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgweDRDMSkgKyBMT0dfMVhfQkFTRV9DKQorCisvKiBDTSBTdWJzY3JpcHRpb24gZXZlbnQgKi8KKyNkZWZpbmUgTE9HX0NNX1NVQlNDUklQVElPTl9FVkVOVF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKDB4NEMyKSArIExPR18xWF9CQVNFX0MpCisKKy8qIFNlbnNvciBBbWJpZW50IExpZ2h0IERhdGEgKi8KKyNkZWZpbmUgTE9HX1NOU19BTFNfREFUQV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoMHg0QzMpICsgTE9HXzFYX0JBU0VfQykKKworLypTZW5zb3IgQW1iaWVudCBMaWdodCBBZGFwdGl2ZSBEYXRhICovCisjZGVmaW5lIExPR19TTlNfQUxTX0RBVEFfQURBUFRJVkVfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICgoMHg0QzQpICsgTE9HXzFYX0JBU0VfQykKKworLypTZW5zb3IgUHJveGltaXR5IERpc3RhbmNlIERhdGEgKi8KKyNkZWZpbmUgTE9HX1NOU19QUlhfRElTVF9EQVRBX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgweDRDNSkgKyBMT0dfMVhfQkFTRV9DKQorCisvKlNlbnNvciBQcm94aW1pdHkgRGF0YSAqLworI2RlZmluZSBMT0dfU05TX1BSWF9EQVRBX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKDB4NEM2KSArIExPR18xWF9CQVNFX0MpCisKKyNkZWZpbmUgTE9HX0dOU1NfU0JBU19SRVBPUlRfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgweDRDNykgKyBMT0dfMVhfQkFTRV9DKQorCisjZGVmaW5lIExPR19DUFVfTU9OSVRPUl9NT0RFTV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoMHg0QzgpICsgTE9HXzFYX0JBU0VfQykKKworI2RlZmluZSBMT0dfQ1BVX01PTklUT1JfQVBQU19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKDB4NEM5KSArIExPR18xWF9CQVNFX0MpCisKKyNkZWZpbmUgTE9HX0JMQVNUX1RBU0tQUk9GSUxFX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgweDRDQSkgKyBMT0dfMVhfQkFTRV9DKQorCisjZGVmaW5lIExPR19CTEFTVF9TWVNQUk9GSUxFX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoMHg0Q0IpICsgTE9HXzFYX0JBU0VfQykKKworI2RlZmluZSBMT0dfRk1fUkFESU9fRlRNX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKDB4NENDKSArIExPR18xWF9CQVNFX0MpCisKKyNkZWZpbmUgTE9HX0ZNX1JBRElPX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgweDRDRCkgKyBMT0dfMVhfQkFTRV9DKQorCisjZGVmaW5lIExPR19VSU1fRFNfREFUQV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoMHg0Q0UpICsgTE9HXzFYX0JBU0VfQykKKworI2RlZmluZSBMT0dfUU1JX0NBTExfRkxPV19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKDB4NENGKSArIExPR18xWF9CQVNFX0MpCisKKyNkZWZpbmUgTE9HX0FQUl9NT0RFTV9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgweDREMCkgKyBMT0dfMVhfQkFTRV9DKQorCisjZGVmaW5lIExPR19BUFJfQVBQU19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoMHg0RDEpICsgTE9HXzFYX0JBU0VfQykKKworI2RlZmluZSBMT0dfQVBSX0FEU1BfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKDB4NEQyKSArIExPR18xWF9CQVNFX0MpCisKKyNkZWZpbmUgTE9HX0RBVEFfTVVYX1JYX1JBV19QQUNLRVRfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgweDREMykgKyBMT0dfMVhfQkFTRV9DKQorCisjZGVmaW5lIExPR19EQVRBX01VWF9UWF9SQVdfUEFDS0VUX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoMHg0RDQpICsgTE9HXzFYX0JBU0VfQykKKworI2RlZmluZSBMT0dfREFUQV9NVVhfUlhfRlJBTUVfUEFDS0VUX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKDB4NEQ1KSArIExPR18xWF9CQVNFX0MpCisKKyNkZWZpbmUgTE9HX0RBVEFfTVVYX1RYX0ZSQU1FX1BBQ0tFVF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgweDRENikgKyBMT0dfMVhfQkFTRV9DKQorCisjZGVmaW5lIExPR19DR1BTX1BEU01fRVhUX1NUQVRVU19QT1NfSU5KX1JFUV9JTkZPX0MgICAgICAgICAgICAgICAgICgoMHg0RDcpICsgTE9HXzFYX0JBU0VfQykKKworI2RlZmluZSBMT0dfVEVNUEVSQVRVUkVfTU9OSVRPUl9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKDB4NEQ4KSArIExPR18xWF9CQVNFX0MpCisKKyNkZWZpbmUgTE9HX1NOU19HRVNUVVJFU19SRVNUX0RFVEVDVF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgweDREOSkgKyBMT0dfMVhfQkFTRV9DKQorCisjZGVmaW5lIExPR19TTlNfR0VTVFVSRVNfT1JJRU5UQVRJT05fQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoMHg0REEpICsgTE9HXzFYX0JBU0VfQykKKworI2RlZmluZSBMT0dfU05TX0dFU1RVUkVTX0ZBQ0lOR19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKDB4NERCKSArIExPR18xWF9CQVNFX0MpCisKKyNkZWZpbmUgTE9HX1NOU19HRVNUVVJFU19CQVNJQ19DICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgweDREQykgKyBMT0dfMVhfQkFTRV9DKQorCisjZGVmaW5lIExPR19TTlNfR0VTVFVSRVNfSElOQllFX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoMHg0REQpICsgTE9HXzFYX0JBU0VfQykKKworI2RlZmluZSBMT0dfR05TU19PRU1EUkVfTUVBU1VSRU1FTlRfUkVQT1JUX0MgICAgICAgICAgICAgICAgICAgICAgICAoKDB4NERFKSArIExPR18xWF9CQVNFX0MpCisKKyNkZWZpbmUgTE9HX0dOU1NfT0VNRFJFX1BPU0lUSU9OX1JFUE9SVF9DICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgweDRFMCkgKyBMT0dfMVhfQkFTRV9DKQorCisjZGVmaW5lIExPR19HTlNTX09FTURSRV9TVlBPTFlfUkVQT1JUX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoMHg0RTEpICsgTE9HXzFYX0JBU0VfQykKKworI2RlZmluZSBMT0dfR05TU19PRU1EUlNZTkNfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKDB4NEUyKSArIExPR18xWF9CQVNFX0MpCisKKyNkZWZpbmUgTE9HX1NOU19NR1JfRVZFTlRfTk9USUZZX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgweDRFMykgKyBMT0dfMVhfQkFTRV9DKQorCisjZGVmaW5lIExPR19TTlNfTUdSX0VWRU5UX1JFR0lTVEVSX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoMHg0RTQpICsgTE9HXzFYX0JBU0VfQykKKworI2RlZmluZSBMT0dfR05TU19QRFNNX1BQTV9TRVNTSU9OX0JFR0lOX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAoKDB4NEU1KSArIExPR18xWF9CQVNFX0MpCisKKyNkZWZpbmUgTE9HX0dOU1NfUERTTV9QUE1fU0VTU0lPTl9QUE1fU1VTUEVORF9DICAgICAgICAgICAgICAgICAgICAgKCgweDRFNikgKyBMT0dfMVhfQkFTRV9DKQorCisjZGVmaW5lIExPR19HTlNTX1BEU01fUFBNX1JFUE9SVF9USFJPVFRMRURfQyAgICAgICAgICAgICAgICAgICAgICAgICgoMHg0RTcpICsgTE9HXzFYX0JBU0VfQykKKworI2RlZmluZSBMT0dfR05TU19QRFNNX1BQTV9SRVBPUlRfRklSRURfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKDB4NEU4KSArIExPR18xWF9CQVNFX0MpCisKKyNkZWZpbmUgTE9HX0dOU1NfUERTTV9QUE1fU0VTU0lPTl9FTkRfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgweDRFOSkgKyBMT0dfMVhfQkFTRV9DKQorCisjZGVmaW5lIExPR19UUlNQX0RBVEFfU1RBTExfQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoMHg4MDEpICsgTE9HXzFYX0JBU0VfQykKKworLyogVGhlIGxhc3QgZGVmaW5lZCBETVNTIGxvZyBjb2RlICovCisjZGVmaW5lIExPR18xWF9MQVNUX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoMHg4MDEpICsgTE9HXzFYX0JBU0VfQykKKworCisvKiBUaGlzIGlzIG9ubHkgaGVyZSBmb3Igb2xkIChwcmUgZXF1aXBtZW50IElEIHVwZGF0ZSkgbG9nZ2luZyBjb2RlICovCisjZGVmaW5lIExPR19MQVNUX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggTE9HXzFYX0xBU1RfQyAmIDB4RkZGICkKKworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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1BR0VTIFdIQVRTT0VWRVIgUkVTVUxUSU5HIEZST00gTE9TUyBPRiBVU0UsIERBVEEgT1IKKyAqIFBST0ZJVFMsIFdIRVRIRVIgSU4gQU4gQUNUSU9OIE9GIENPTlRSQUNULCBORUdMSUdFTkNFIE9SIE9USEVSCisgKiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SCisgKiBQRVJGT1JNQU5DRSBPRiBUSElTIFNPRlRXQVJFLgorICovCisKKy8qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisjaWYgIWRlZmluZWQoIF9fVk9TX0FQSV9IICkKKyNkZWZpbmUgX19WT1NfQVBJX0gKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAKKyAgXGZpbGUgIHZvc19BcGkuaAorICAKKyAgXGJyaWVmIHZpcnR1YWwgT3BlcmF0aW5nIFN5c3RlbSBTZXJ2aWNlcyAodk9TUykgQVBJCisgICAgICAgICAgICAgICAKKyAgIEhlYWRlciBmaWxlIHRoYXQgaW5sdWRlcyBhbGwgdGhlIHZPU1MgQVBJIGRlZmluaXRpb25zLgorICAKKyAgCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisgLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gCisKKyAgICA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qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisjaWYgIWRlZmluZWQoIF9fVk9TX0RJQUdfQ09SRV9FVkVOVF9IICkKKyNkZWZpbmUgX19WT1NfRElBR19DT1JFX0VWRU5UX0gKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAKKyAgXGZpbGUgIHZvc19ldmVudC5oCisgIAorICBcYnJpZWYgdmlydHVhbCBPcGVyYXRpbmcgU3lzdGVtIFNlcnZpY2VzICh2T1NTKSBESUFHIEV2ZW50cworICAgICAgICAgICAgICAgCisgICBEZWZpbml0aW9ucyBmb3Igdk9TUyBFdmVudHMKKyAgCisgIAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKiAkSGVhZGVyJCAqLworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgIEluY2x1ZGUgRmlsZXMKKyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyNpbmNsdWRlICJ2b3NfdHlwZXMuaCIKKyNpbmNsdWRlICJ2b3NfcGFja19hbGlnbi5oIgorI2luY2x1ZGUgImlfdm9zX2RpYWdfY29yZV9ldmVudC5oIgorCisvKi0tLS0tLS0tL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worI2RlZmluZSBWT1NfTE9HX01BWF9OVU1fU1NJRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjEKKyNkZWZpbmUgVk9TX0xPR19NQVhfTlVNX0JTU0lEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIxCisjZGVmaW5lIFZPU19MT0dfTUFYX1NTSURfU0laRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzMgorI2RlZmluZSBWT1NfTE9HX01BWF9CU1NJRF9TSVpFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNgorI2RlZmluZSBWT1NfTE9HX01BWF9OVU1fQ0hBTk5FTCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjQKKyNkZWZpbmUgVk9TX0xPR19NQVhfTlVNX0hPX0NBTkRJREFURV9BUFMgICAgICAgICAgICAgICAgICAgIDIwCisjZGVmaW5lIFZPU19MT0dfTUFYX1dPV19QVFJOX1NJWkUgICAgICAgICAgICAgICAgICAgICAgICAgICAxMjgKKyNkZWZpbmUgVk9TX0xPR19NQVhfV09XX1BUUk5fTUFTS19TSVpFICAgICAgICAgICAgICAgICAgICAgIDE2CisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICBUaGlzIHBhY2tldCBjb250YWlucyB0aGUgc2NhbiByZXN1bHRzIG9mIHRoZSByZWNlbnQgc2NhbiBvcGVyYXRpb24gCisgICBMT0dfV0xBTl9TQ0FOX0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDE0OTYgCistLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLyAgIAordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgIGxvZ19oZHJfdHlwZSAgaGRyOworICAgdl9VOF90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sIERBVEEgT1IKKyAqIFBST0ZJVFMsIFdIRVRIRVIgSU4gQU4gQUNUSU9OIE9GIENPTlRSQUNULCBORUdMSUdFTkNFIE9SIE9USEVSCisgKiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SCisgKiBQRVJGT1JNQU5DRSBPRiBUSElTIFNPRlRXQVJFLgorICovCisKKy8qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisjaWYgIWRlZmluZWQoIF9fVk9TX0dFVEJJTl9IICkKKyNkZWZpbmUgX19WT1NfR0VUQklOX0gKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIFxmaWxlICB2b3NfZ2V0QmluLmgKKworICBcYnJpZWYgdmlydHVhbCBPcGVyYXRpbmcgU3lzdGVtIFNlcnZpY2VzICh2T1NTKSBiaW5hcnkgQVBJcworCisgICBCaW5hcnkgcmV0cmlldmFsIGRlZmluaXRpb25zIGFuZCBBUElzLiAgCisKKyAgIFRoZXNlIEFQSXMgYWxsb3cgY29tcG9uZW50cyB0byByZXRyaWV2ZSBiaW5hcnkgY29udGVudHMgKGZpcm13YXJlLCAKKyAgIGNvbmZpZ3VyYXRpb24gZGF0YSwgZXRjLikgZnJvbSBhIHN0b3JhZ2UgbWVkaXVtIG9uIHRoZSBwbGF0Zm9ybS4KKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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IGFuZCBhIHBvaW50ZXIgdG8gdGhlIGVuZCBvZiB0aGUgbGlzdC4gIFRoZQorICAgbGlzdCBpdGVtcyBjb250YWluIGEgZm9yd2FyZCBhbmQgYmFjayBsaW5rLgorICAgICAgICAgICAgCisgICAgIExpc3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgTm9kZXMKKyAgID09PT09PT09PT09PT0gICAgICAgICAgPT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICArLS0tLS0tLSsKKyAgIHwgRnJvbnQgfC0tLS0tLS0tLS0tLS0+Ky0tLS0tLS0tLSsgICAgICstLS0tLS0tLS0rCisgICArLS0tLS0tLSsgICAgICAgICAgICAgIHwgTmV4dCAgICB8LS0tLT58IE5leHQgICAgfC0tLS0+TlVMTAorICAgfCBCYWNrICB8LSsgICAgICAgICAgICArLS0tLS0tLS0tKyAgICAgKy0tLS0tLS0tLSsKKyAgICstLS0tLS0tKyB8ICAgTlVMTDwtLS0tfCBQcmV2ICAgIHw8LS0tLXwgUHJldiAgICB8CisgICAgICAgICAgICAgfCAgICAgICAgICAgICstLS0tLS0tLS0rICAgICArLS0tLS0tLS0tKworICAgICAgICAgICAgIHwgICAgICAgICAgICB8VXNlciBEYXRhfCAgICAgfFVzZXIgRGF0YXwKKyAgICAgICAgICAgICB8ICAgICAgICAgICAgKy0tLS0tLS0tLSsgICAgICstLS0tLS0tLS0rCisgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KKyAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorICAgICAgICAgICAgICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCisKKyAgIFRoaXMgbGlua2VkIGxpc3QgQVBJIGlzIGltcGxlbWVudGVkIHdpdGggYXBwcm9wcmlhdGUgbG9ja2luZworICAgbWVjaGFuaXNtcyB0byBhc3N1cmUgb3BlcmF0aW9ucyBvbiB0aGUgbGlzdCBhcm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kVHTElHRU5DRSBPUiBPVEhFUgorICogVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmICFkZWZpbmVkKCBfX1ZPU19MT0NLX0ggKQorI2RlZmluZSBfX1ZPU19MT0NLX0gKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAKKyAgXGZpbGUgIHZvc19sb2NrLmgKKyAgCisgIFxicmllZiB2aXJ0dWFsIE9wZXJhdGluZyBTeXN0ZW0gU2VydmllcyAodk9TKSBMb2NrcworICAgICAgICAgICAgICAgCisgICBEZWZpbml0aW9ucyBmb3Igdk9TUyBMb2NrcworICAKKyAgCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qICRIZWFkZXIkICovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgSW5jbHVkZSBGaWxlcworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworI2luY2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gICAgICAgICAgICAgICBjb25zdCB2X1ZPSURfdCAqcE1lbW9yeTIsCisjZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICB2X1ZPSURfdCAqcE1lbW9yeTIsCisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBudW1CeXRlcyk7CisKKworLyoqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgICAgXGZuIHZvc19tZW1fY29tcGFyZTIoKQorCisgICAgXGJyaWVmIHZvc19tZW1fY29tcGFyZTIoKSAtIE1lbW9yeSBjb21wYXJlCisgICAgCisgICAgRnVuY3Rpb24gdG8gY29tcGFyZSB0d28gcGllY2VzIG9mIG1lbW9yeSwgc2ltaWxhciB0byBtZW1jbXAgZnVuY3Rpb24gCisgICAgaW4gc3RhbmRhcmQgQy4KKworICAgIFxwYXJhbSBwTWVtb3J5MSAtIHBvaW50ZXIgdG8gb25lIGxvY2F0aW9uIGluIG1lbW9yeSB0byBjb21wYXJlLgorCisgICAgXHBhcmFtIHBNZW1vcnkyIC0gcG9pbnRlciB0byBzZWNvbmQgbG9jYXRpb24gaW4gbWVtb3J5IHRvIGNvbXBhcmUuCisgICAgCisgICAgXHBhcmFtIG51bUJ5dGVzIC0gdGhlIG51bWJlciBvZiBieXRlcyB0byBjb21wYXJlLgorICAgIAorICAgIFxyZXR1cm4gdl9TSU5UX3QgLSByZXR1cm5zIGEgYm9vbGVhbiB2YWx1ZSB0aGF0IHRlbGxzIGlmIHRoZSBtZW1vcnkKKyAgICAgICAgICAgICAgICAgICAgICAgbG9jYXRpb25zIGFyZSBlcXVhbCBvciBub3QgZXF1YWwuIAorICAgICAgICAgICAgICAgICAgICAgICAwIC0tIGVxdWFsCisgICAgICAgICAgICAgICAgICAgICAgIDwgMCAtLSAqcE1lbW9yeTEgaXMgbGVzcyB0aGFu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cyBvZiB0aGUgTlYgcmVhZCBvcGVyYXRpb24KKyAgXE5vdGU6IDQwTWh6IG5vdCBjdXJyZW50bHkgc3VwcG9ydGVkCisgIFxzYQorICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KK1ZPU19TVEFUVVMgdm9zX252X2dldENoYW5uZWxMaXN0V2l0aFBvd2VyKHRDaGFubmVsTGlzdFdpdGhQb3dlciAqcENoYW5uZWxzMjBNSHogLypbTlVNX0xFR0lUX1JGX0NIQU5ORUxTXSAqLywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggKnBOdW0yME1IekNoYW5uZWxzRm91bmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Q2hhbm5lbExpc3RXaXRoUG93ZXIgKnBDaGFubmVsczQwTUh6IC8qW05VTV9DSEFOX0JPTkRfQ0hBTk5FTFNdICovLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCAqcE51bTQwTUh6Q2hhbm5lbHNGb3VuZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKKworLyoqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgXGJyaWVmIHZvc19udl9vcGVuKCkgLSBpbml0aWFsaXplIHRoZSBOViBtb2R1bGUKKworICBUaGUgXGEgdm9zX252X29wZW4oKSBpbml0aWFsaXplcyB0aGUgTlYgbW9kdWxlLiAgVGhpcyBmdW5jdGlvbiByZWFkIHRoZSBiaW5hcnkKKyAgZmlsZSBxY29tX252LmJpbiBmb3IgbWFjYWRkcmVzcyxjb3VudHJ5IGNvZGUscmVndWxhdG9y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NQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NIExPU1MgT0YgVVNFLCBEQVRBIE9SCisgKiBQUk9GSVRTLCBXSEVUSEVSIElOIEFOIEFDVElPTiBPRiBDT05UUkFDVCwgTkVHTElHRU5DRSBPUiBPVEhFUgorICogVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmICFkZWZpbmVkKCBfX1ZPU19QQUNLX0FMSUdOX0ggKQorI2RlZmluZSBfX1ZPU19QQUNLX0FMSUdOX0gKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAKKyAgXGZpbGUgIHZvc19wYWNrX2FsaWduLmgKKyAgCisgIFxicmllZiB2aXJ0dWFsIE9wZXJhdGluZyBTeXN0ZW0gU2VydmllcyAodk9TKSBwYWNrIGFuZCBhbGlnbiBwcmltaXRpdmVzCisgICAgICAgICAgICAgICAKKyAgIERlZmluaXRpb25zIGZvciBwbGF0Zm9ybSBpbmRlcGVuZGVudCBtZWFucyBvZiBwYWNraW5nIGFuZCBhbGlnbmluZworICAgZGF0YSBzdHJ1Y3R1cmVzCisgIAorICAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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YgdW5rbm93biB0eXBlLiAgCisgICAgIDwvdWw+CisgICAgIAorICBccGFyYW0gZGF0YVNpemUgLSB0aGUgRGF0YSBzaXplIG5lZWRlZCBpbiB0aGUgdm9zcyBQYWNrZXQuCisgIAorICBccGFyYW0gbnVtUGFja2V0cyAtIHRoZSBudW1iZXIgb2YgcGFja2V0cyByZXF1ZXN0ZWQuICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICBccGFyYW0gemVyb0J1ZmZlciAtIHBhcmFtZXRlciB0aGF0IHRlbGxzIHRoZSBBUEkgdG8gemVybyB0aGUgZGF0YSBidWZmZXIKKyAgICAgICAgICAgICAgICAgICAgICBpbiB0aGlzIHZvc3MgUGFja2V0LiAgCisgICAgIDx1bD4gICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgPGxpPiBWT1NfVFJVRSAtIHRoZSBBUEkgd2lsbCB6ZXJvIG91dCB0aGUgZW50aXJlIGRhdGEgYnVmZmVyLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgIDxsaT4gVk9TX0ZBTFNFIC0gdGhlIEFQSSB3aWxsIG5vdCB6ZXJvIG91dCB0aGUgZGF0YSBidWZmZXIuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgIDwvdWw+CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgIFxub3RlIElmIGVub3VnaCByb29tIGZvciBoZWFkZXJzIHRvIHRyYW5zbWl0IG9yIHJlY2VpdmUgdGhlIHBhY2tldCBpcyBub3QgCisgICAgICAgIGF2YWlsYWJsZSwgdGhpcyBBUEkgd2lsbCBmYWlsLgorICAgICAgICAKKyAgXHBhcmFtIGNhbGxiYWNrIC0gVGhpcyBjYWxsYmFjayBmdW5jdGlvbiwgaWYgcHJvdmlkZWQsIGlzIGludm9rZWQgaW4gdGhlIAorICAgICAgICAgY2FzZSB3aGVuIHJlc291cmNlcyBhcmUgbm90IGF2Y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93IHJlc291cmNlIGNhbGxiYWNrLgorICAgICAgICAgIAorICAgICAgICAgIFZPU19TVEFUVVNfRV9BTFJFQURZIC0gVGhpcyBzdGF0dXMgaXMgcmV0dXJuZWQgd2hlbiB0aGUgVk9TCisgICAgICAgICAgcGFja2V0IHBvb2wgaXMgaW4gYSAnbG93IHJlc291cmNlJyBjb25kaXRpb24gYW5kIGNhbm5vdCAKKyAgICAgICAgICBhY2NvbW9kYXRlIGFueSBtb3JlIGNhbGxzIHRvIHJldHJpZXZlIHBhY2tldHMgZnJvbSB0aGF0IAorICAgICAgICAgIHBvb2wuICAgTm90ZSB0aGlzIGlzIGEgRkFJTFVSRSBhbmQgdGhlICdsb3cgcmVzb3VyY2UnIGNhbGxiYWNrCisgICAgICAgICAgd2lsbCAqbm90KiBiZSBjYWxsZWQuCisgICAgICAgICAgCisgICAgICAgICAgVk9TX1NUQVRVU19FX0ZBVUxUIC0gcHBQYWNrZXQgZG9lcyBub3Qgc3BlY2lmeSBhIHZhbGlkIHBvaW50ZXIuICAgICAgICAgIAorICAgIAorICBcc2EKKyAgCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovICAKK1ZPU19TVEFUVVMgdm9zX3BrdF9nZXRfcGFja2V0KCB2b3NfcGt0X3QgKipwcFBhY2tldCwgVk9TX1BLVF9UWVBFIHBrdFR5cGUsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfU0laRV90IGRhdGFTaXplLCB2X1NJWkVfdCBudW1QYWNrZXRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfQk9PTF90IHplcm9CdWZmZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX3BrdF9nZXRfcGFja2V0X2NhbGxiYWNrIGNhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVk9JRF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hlIGNvbXBvbmVudAorICBzcGVjaWZpZWQuCisgIAorICBOb3RlOiAgVGhlIHNpemUgb2YgdGhlIHVzZXIgZGF0YSBhcmVhcyBpbiB0aGUgdm9zcyBQYWNrZXQgYXJlIGZpeGVkLiAgVGhlCisgICAgICAgICBzaXplIG9mIGEgc2luZ2xlIHBvaW50ZXIgaXMgYXZhaWxhYmxlIGluIGVhY2ggdXNlciBhcmVhLgorICAKKyAgXHBhcmFtIHBQYWNrZXQgLSB0aGUgdm9zcyBQYWNrZXQgdG8gc2V0IHRoZSB1c2VyIHBvaW50ZXIuCisgIAorICBccGFyYW0gdXNlcklEIC0gdGhlIGlkZW50aWZpZXIgZm9yIHRoZSB1c2VyIGRhdGEgYXJlYSBpbiB0aGUgdm9zcyBQYWNrZXQKKyAgICAgICAgICAgICAgICAgIHRvIHNldC4KKyAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgVXNlciBJRHMgYW5kIHVzZXIgZGF0YSBhcmVhcyBpbiB0aGUgdm9zcyBQYWNrZXQgYXJlIAorICAgICAgICAgICAgICAgICAgYXZhaWxhYmxlIGZvcjoKKyAgICAgICAgICAgICAgICAgIC0gVHJhbnNwb3J0IExheWVyIChUTCkKKyAgICAgICAgICAgICAgICAgIC0gQnVzIEFic3RyYWN0aW9uIExheWVyIChCQUwpCisgICAgICAgICAgICAgICAgICAtIFNESU8gU2VydmljZXMgQ29tcG9uZW50IChTU0MpCisgICAgICAgICAgICAgICAgICAtIEhvc3QgRGV2aWNlIERyaXZlciAoSEREKQorICAgICAgICAgICAgICAgICAgCisgIFxwYXJhbSBwVXNlckRhdGEgLSBwb2ludGVyIHZhbHVlIHRvIHNldCBpbiB0aGUgdXNlciBkYXRhIGFyZWEgb2YgdGhlIHZvc3MgCisgICAgICAgICAgICAgICAgICAgICBwYWNrZXQuLgorICAKKyAgXHJldHVybiAtIE5vdGhpbmcuCisgICAgCisgIFxzYQorICAKKyAgLS0tLS0tLS0tLS0tLS0tLS0tLS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wQ2hhaW5lZFBhY2tldCAtIHBvaW50ZXIgdG8gbG9jYXRpb24gdG8gcmV0dXJuIHRoZSAnbmV4dCcgdm9zcyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhY2tldCBwb2ludGVyIGluIHRoZSBwYWNrZXQgY2hhaW4uICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwgbWVhbnMgdGhlcmUgaXMgd2FzIG5vdCBwYWNrZXQgY2hhaW5lZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdG8gdGhpcyBwYWNrZXQuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgXHBhcmFtIHVuY2hhaW5QYWNrZXQgLSBGbGFnIHRoYXQgc3BlY2lmaWVzIGlmIHRoZSBjYWxsZXIgd2FudHMgdGhlIHBhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAgIHRvIGJlIHJlbW92ZWQgZnJvbSB0aGUgcGFja2V0IGNoYWluLiAgVGhpcyBpcyAKKyAgICAgICAgICAgICAgICAgICAgICAgICBwcm92aWRlZCB0byBhbGxvdyB0aGUgY2FsbGVyIHRvIHdhbGsgdGhlIHBhY2tldCBjaGFpbgorICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGggb3Igd2l0aG91dCBicmVha2luZyB0aGUgY2hhaW4uICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICA8dWw+CisgICAgICA8bGk+IHRydWUgLSB3aGVuIHNldCAndHJ1ZScgdGhlIEFQSSB3aWxsIHJldHVybiAKKyAgICAgICAgICAgICAgICAgIHRoZSAnbmV4dCcgcGFja2V0IHBvaW50ZXIgaW4gdGhlIHZvc3MgUGFja3RlIGNoYWluIGFuZCAKKyAgICAgICAgICAgICAgICAgICpXSUxMKiB1bmNoYWluIHRoZSBpbnB1dCBwYWNrZXQgZnJvbSB0aGUgcGFja2V0IGNoYWluLgorICAgICAgICAgICAgICAgICAgICAKKyAgICAgIDxsaT4gTk9UIGZhbHNlIC0gd2hlbiBzZXQgJ2ZhbHNlJyB0aGUgQVBJIHdpbGwgcmV0dXJuIAorICAgICAgICAgICAgICAgICAgICAgICB0aGUgJ25leHQnIHBhY2tldCBwb2ludGVyIGluIHRoZSB2b3NzIFBhY2tldCBjaGFpbiBidXQKKyAgICAgICAgICAgICAgICAgICAgICAgKldJTEwgTk9UKiB1bmNoYWluIHRoZSBwYWNrZXQgY2hhaW4uICAgVGhpcyBvcHRpb24gZ2l2ZXMKKyAgICAgICAgICAgICAgICAgICAgICAgdGhlIGNhbGxlciB0aGUgYWJpbGl0eSB0byB3YWxrIHRoZSBwYWNrZXQgY2hhaW4gd2l0aG91dCAKKyAgICAgICAgICAgICAgICAgICAgICAgbW9kaWZ5aW5nIGl0IGluIHRoZSBwcm9jZXNzLgorICAgIDwvdWw+CisgICAgICAgICAgICAgICAgICAgIAorICBcbm90ZSBIYXZpbmcgdGhlIHBhY2tldHMgY2hhaW5lZCBoYXMgYW4gaW1wbGljYWl0b24gb24gaG93IHRoZSByZXR1cm4KKyAgICAgICAgcGFja2V0IEFQSSAodm9zX3BrdF9yZXR1cm5fcGFja2V0KCkgKSBvcGVyYXRlcy4gICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAKKyAgXHJldHVybgorICAgIAorICBcc2EKKyAgCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworVk9TX1NUQVRVUyB2b3NfcGt0X3dhbGtfcGFja2V0X2NoYWluKCB2b3NfcGt0X3QgKnBQYWNrZXQsIHZvc19wa3RfdCAqKnBwQ2hhaW5lZFBhY2tldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9CT09MX3QgdW5jaGFpblBhY2tldCApOworCisKKy8qKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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DVCwgT1IgQ09OU0VRVUVOVElBTAorICogREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NIExPU1MgT0YgVVNFLCBEQVRBIE9SCisgKiBQUk9GSVRTLCBXSEVUSEVSIElOIEFOIEFDVElPTiBPRiBDT05UUkFDVCwgTkVHTElHRU5DRSBPUiBPVEhFUgorICogVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmICFkZWZpbmVkKCBfX1ZPU19TVEFUVVNfSCApCisjZGVmaW5lIF9fVk9TX1NUQVRVU19ICisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgCisgIFxmaWxlICB2b3NfU3RhdHVzLmgKKyAgCisgIFxicmllZiB2aXJ0dWFsIE9wZXJhdGluZyBTeXN0ZW0gU2VydmljZXMgKHZPU1MpIFN0YXR1cyBjb2RlcworICAgICAgICAgICAgICAgCisgICBCYXNpYyBzdGF0dXMgY29kZXMvZGVmaW5pdGlvbnMgdXNlZCBieSB2T1NTIAorICAKKyAgCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qICRIZWFkZXIkICovCisKKy8qLS0tLS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SEVSIElOIEFOIEFDVElPTiBPRiBDT05UUkFDVCwgTkVHTElHRU5DRSBPUiBPVEhFUgorICogVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmICFkZWZpbmVkKCBfX1ZPU19USU1FUl9IICkKKyNkZWZpbmUgX19WT1NfVElNRVJfSAorCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIAorICBcZmlsZSAgdm9zX3RpbWVyLmgKKyAgCisgIFxicmllZiB2aXJ0dWFsIE9wZXJhdGluZyBTeXN0ZW0gU2VydmllcyAodk9TKQorICAgICAgICAgICAgICAgCisgICBEZWZpbml0aW9ucyBmb3Igdk9TUyBUaW1lciBzZXJ2aWNlcworICAKKyAgCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qICRIZWFkZXIkICovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgSW5jbHVkZSBGaWxlcworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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AgICAgICAgICAgICAgICBWT1NfVElNRVJfVFlQRSB0aW1lclR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfdGltZXJfY2FsbGJhY2tfdCBjYWxsYmFjaywgdl9QVk9JRF90IHVzZXJEYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhciogZmlsZU5hbWUsIHZfVTMyX3QgbGluZU51bSApOworI2Vsc2UKK1ZPU19TVEFUVVMgdm9zX3RpbWVyX2luaXQoIHZvc190aW1lcl90ICp0aW1lciwgVk9TX1RJTUVSX1RZUEUgdGltZXJUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX3RpbWVyX2NhbGxiYWNrX3QgY2FsbGJhY2ssIHZfUFZPSURfdCB1c2VyRGF0YSApOworVk9TX1NUQVRVUyB2b3NfdGltZXJfaW5pdF9kZWZlcnJhYmxlKCB2b3NfdGltZXJfdCAqdGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVElNRVJfVFlQRSB0aW1lclR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfdGltZXJfY2FsbGJhY2tfdCBjYWxsYmFjaywgdl9QVk9JRF90IHVzZXJEYXRhICk7CisjZW5kaWYKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgCisgIFxicmllZiB2b3NfdGltZXJfZGVzdHJveSgpIC0gRGVzdHJveSBhIHZPU1MgVGltZXIgb2JqZWN0CisKKyAgVGhlIFxhIHZvc190aW1lcl9kZXN0cm95KCkgZnVuY3Rpb24gc2hhbGwgZGVzdHJveSB0aGUgdGltZXIgb2JqZWN0LgorICBBZnRlciBhIHN1Y2Nlc3NmdWwgcmV0dXJuIGZyb20gXGEgdm9zX3RpbWVyX2Rlc3Ryb3koKSB0aGUgdGltZXIgCisgIG9iamVjdCBiZWNv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VHTElHRU5DRSBPUiBPVEhFUgorICogVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmICFkZWZpbmVkKCBfX1ZPU19UUkFDRV9IICkKKyNkZWZpbmUgX19WT1NfVFJBQ0VfSAorCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIAorICBcZmlsZSAgdm9zX3RyYWNlLmgKKyAgCisgIFxicmllZiB2aXJ0dWFsIE9wZXJhdGluZyBTeXN0ZW0gU2VydmllcyAodk9TKQorICAgICAgICAgICAgICAgCisgICBUcmFjZSwgbG9nZ2luZywgYW5kIGRlYnVnZ2luZyBkZWZpbml0aW9ucyBhbmQgQVBJcworICAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyogJEhlYWRlciQgKi8KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBJbmNsdWRlIEZpbGVzCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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UdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NIExPU1MgT0YgVVNFLCBEQVRBIE9SCisgKiBQUk9GSVRTLCBXSEVUSEVSIElOIEFOIEFDVElPTiBPRiBDT05UUkFDVCwgTkVHTElHRU5DRSBPUiBPVEhFUgorICogVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmICFkZWZpbmVkKCBfX1ZPU19UWVBFU19IICkKKyNkZWZpbmUgX19WT1NfVFlQRVNfSAorCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIFxmaWxlICB2b3NfVHlwZXMuaAorCisgIFxicmllZiB2aXJ0dWFsIE9wZXJhdGluZyBTeXN0ZW0gU2VydmllcyAodk9TKQorCisgICBCYXNpYyB0eXBlIGRlZmluaXRpb25zCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qICRIZWFkZXIkICovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgSW5jbHVkZSBGaWxlcworICAtLS0tLS0tLS0tLS0tLS0tL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cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworCisjaWYgIWRlZmluZWQoIF9fVk9TX1VUSUxTX0ggKQorI2RlZmluZSBfX1ZPU19VVElMU19ICisgCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIAorICBcZmlsZSAgdm9zX3V0aWxzLmgKKyAgCisgIFxicmllZiB2aXJ0dWFsIE9wZXJhdGluZyBTeXN0ZW0gU2VydmljZXMgKHZPU1MpIHV0aWxpdHkgQVBJcworICAgICAgICAgICAgICAgCisgICBWYXJpb3VzIHV0aWxpdHkgZnVuY3Rpb25zCisgIAorICAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyogJEhlYWRlciQgKi8KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBJbmNsdWRlIEZpbGVzCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisjaW5jbHVkZSA8dm9zX3R5cGVzLmg+CisjaW5jbHVkZSA8dm9zX3N0YXR1cy5oPgorI2luY2x1ZGUgPHZvc19ldmVudC5oPgorLy8jaW5jbHVkZSA8V2luY3J5cHQuaD4KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAKKyAgUHJlcHJvY2Vzc29yIGRlZmluaXRpb25zIGFuZCBjb25zdGFudHMKKyAgLS0tL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X1U4X3QgICAgICAgICAgICAgZHhlX21vbml0b3Jfcng7Ly9tb25pdG9yIHRoZSByeCBAIGR4ZSBiYXNpY2FsbHkgKEVhcG9sICkKKyAgICB2X0JPT0xfdCAgICAgICAgICAgbG9nX2R4ZV90eF9pc3I7CisgICAgdl9VOF90ICAgICAgICAgICAgIHBlZXJfbWFjX2FkZHJbNl07CisgICAgdl9VTE9OR190ICAgICAgICAgIGhkZF9maXJzdF94bWl0X3RpbWU7CisgICAgdl9VTE9OR190ICAgICAgICAgIHByZWF1dGhfcmVhc3NvY19zdGFydF90aW1lOworICAgIHZfVUxPTkdfdCAgICAgICAgICBwcmVhdXRoX2NiX3RpbWU7CisgICAgdl9VTE9OR190ICAgICAgICAgIGRpc2FibGVfdHhfcXVldWVzX3RpbWU7CisgICAgdl9VTE9OR190ICAgICAgICAgIGxpbV9hZGRfYnNzX3JlcV90aW1lOworICAgIHZfVUxPTkdfdCAgICAgICAgICBpc3N1ZV9yZWFzc29jX3JlcV90aW1lOworICAgIHZfVUxPTkdfdCAgICAgICAgICBoZGRfc2VuZGFzc29jX3JzcF90aW1lOworICAgIHZfVUxPTkdfdCAgICAgICAgICBlbmFibGVfdHhfcXVldWVzX3JlYXNzb2NfdGltZTsKKyAgICB2X1VMT05HX3QgICAgICAgICAgc2V0X3B0a19yb2FtX2tleV90aW1lOworICAgIHZfVUxPTkdfdCAgICAgICAgICBzZXRfZ3RrX3JvYW1fa2V5X3RpbWU7CisgICAgdl9VTE9OR190ICAgICAgICAgIGNvbXBsZXRlX3B0a19yb2FtX2tleV90aW1lOworICAgIHZfVUxPTkdfdCAgICAgICAgICBjb21wbGV0ZV9ndGtfcm9hbV9rZXlfdGltZTsKKyAgICB2X1VMT05HX3QgICAgICAgICAgZHhlX2ZpcnN0X3R4X3RpbWU7CisgICAgdl9VTE9OR190ICAgICAgICAgIHNlbmRfcmVhc3NvY19yZXFfdGltZTsKKyAgICB2X1VMT05HX3QgICAgICAgICAgZGlzYXNzb2NfY29tcF90aW1lOworICAgIHZfVUxPTkdfdCAgICAgICAgICBkaXNhc3NvY19pc3N1ZV90aW1lOworICAgIHZfVUxPTkdfdCAgICAgICAgICBsaW1fYWRkX2Jzc19yc3BfdGltZTsKKyAgICB2X1VMT05HX3QgICAgICAgICAgdGxfZmV0Y2hfcGt0X3RpbWU7CisgICAgdl9VTE9OR190ICAgICAgICAgIGR4ZV90eF9pc3JfdGltZTsKKyAgICB2X1VMT05HX3QgICAgICAgICAgaGRkX2VhcG9sX20xOworICAgIHZfVUxPTkdfdCAgICAgICAgICBoZGRfZWFwb2xfbTI7CisgICAgdl9VTE9OR190ICAgICAgICAgIGhkZF9lYXBvbF9tMzsKKyAgICB2X1VMT05HX3QgICAgICAgICAgaGRkX2VhcG9sX200OworICAgIHZfVUxPTkdfdCAgICAgICAgICBkeGVfZWFwb2xfbTE7CisgICAgdl9VTE9OR190ICAgICAgICAgIGR4ZV9lYXBvbF9tMjsKKyAgICB2X1VMT05HX3QgICAgICAgICAgZHhlX2VhcG9sX20zOworICAgIHZfVUxPTkdfdCAgICAgICAgICBkeGVfZWFwb2xfbTQ7CisgICAgdl9VTE9OR190ICAgICAgICAgIGhkZF9maXJzdF9wa3RfbGVuOworICAgIHZfVThfdCAgICAgICAgICAgICBoZGRfZmlyc3RfcGt0X2RhdGFbNTBdOworICAgIHZfVUxPTkdfdCAgICAgICAgICBkeGVfZmlyc3RfcGt0X2xlbjsKKyAgICB2X1U4X3QgICAgICAgICAgICAgZHhlX2ZpcnN0X3BrdF9kYXRhWzc1XTsKKyAgICB2X1VMT05HX3QgICAgICAgICAgaGRkX2FkZHRzX3ZvX3JlcV90aW1lOworICAgIHZfVUxPTkdfdCAgICAgICAgICBoZGRfYWRkdHNfdm9fcnNwX3RpbWU7CisgICAgdl9VTE9OR190ICAgICAgICAgIGhkZF9hZGR0c192aV9yZXFfdGltZTsKKyAgICB2X1VMT05HX3QgICAgICAgICAgaGRkX2FkZHRzX3ZpX3JzcF90aW1lOworICAgIG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ldyB0YWJsZS4KKyAgTWlzYyBub3RlczoKKyAgICAgMS4gRm9yIGVuZGlhbm5lc3MsIHN1cHBvcnQgb25seSA0IGJ5dGVzIGludGVnZXIgb3IgNCAxLWJ5dGUKKyAgICAgMi4gU3RyaW5nIGlkZW50aWZpZXIgbmVlZHMgdG8gYmUgc2hvcnRlbmVkIHRvIHNhdmUgc3RvcmFnZQorICAgICAzLiBzdHJpbmdfZmllbGRfbmFtZSwgIGZpZWxkIHR5cGUsICBmaWVsZCBzdG9yYWdlIGNsYXNzLCAgc3RvcmFnZSBzaXplCisqLworCisjaW5jbHVkZSAid2xhbl9udl90eXBlcy5oIgorCisvKgorICogU3RyZWFtIGhlYWRlciBiaXRtYXAKKyAqICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW1UeXBlCisgKiAgICAgICAgICAgICAgICAgICAgICAgIGJpdG1hcFs3XQorICogICAgICAgICAgICAgICAgICAgICAgLyAgICAgICAgICAgICAgICAgICAgXAorICogICAgICAgICAgICAgICAgMTogdGVtcGxhdGUgICAgICAgICAgICAgICAwOiBkYXRhCisgKiAgICAgICAgICAgICAgICAgYml0bWFwWzZdCisgKiAgICAgICAgICAgICAgICAvICAgICBcCisgKiAgICAgICAgICAgICAwOiBlbnVtICAxOiB0YWJsZQorICoKKyAqLworLyogU3RyZWFtIGhlYWRlciB0eXBlWzddLCAwOiAgZGF0YSwgMTogIHRlbXBsYXRlICovCisjZGVmaW5lIFNUUkVBTV9IRUFERVJfVFlQRV9NQVNLICAgMHg4MAorI2RlZmluZSBTVFJFQU1fSEVBREVSX1RZUEVfTFNCICAgIDcKKyNkZWZpbmUgSXNTdHJlYW1UZW1wbGF0ZShiKSAgICAgICAoKChiKSAmIChTVFJFQU1fSEVBREVSX1RZUEVfTUFTSykpID8gMSA6IDApCisKKy8qIFN0cmVhbSBoZWFkZXIgdGVtcGxhdGUgdHlwZSBbNl0sICAwOiBlbnVtOyAxOiAgdGFibGUgKi8KKyNkZWZpbmUgU1RSRUFNX0hFQURFUl9URU1QTEFURV9UWVBFX01BU0sgICAweDQwCisjZGVmaW5lIFNUUkVBTV9IRUFERVJfVEVNUExBVEVfVFlQRV9MU0IgICAgNgorI2RlZmluZSBJc1RlbXBsYXRlU3RyZWFtVGFibGUoYikgICAoKChiKSAmIChTVFJFQU1fSEVBREVSX1RFTVBMQVRFX1RZUEVfTUFTSykpID8gMSA6IDApCisKKy8qCisgKiBGaWVsZCBpZGVudGlmaWVyIGJpdG1hcAorICoKKyAqICAgICAgICAgICAgICAgIGZpZWxkIGlkZW50aWZpZXIKKyAqICAgICAgICAgICAgICAgIGJpdG1hcFs3XQorICogICAgICAgICAgICAgICAgIC8gICAgICAgICAgIFwKKyAqICAgICAgICAgICAgMDogdGFibGUvZW51bSAgICAgMTogYmFzaWMgZGF0YSB0eXBlCisgKiAgICAgICAgICAgIGJpdG1hcFs2OjBdICAgICAgICAgYml0bWFwWzY6MF0KKyAqICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgIHwKKyAqICAgICAgICAgICAgdGFibGVJZHgvICAgICAgICAgIGRhdGEgdHlwZXMgKFU4LCBVMzIsIGV0Yy4pCisgKiAgICAgICAgICAgIGVudW1JZHgKKyAqLworLyogRmllbGQgSWRlbnRpZmllciB0eXBlIFs3XQorICogICAgMDogIHRhYmxlCisgKiAgICAxOiAgYmFzaWMgZGF0YSB0eXBlcworICogTm90ZSB0aGF0CisgKiAgICAtIGJpdFs3XSB0YWJsZSB2YWx1ZT0wIG1ha2VzIHRoZSB0YWJsZSBJRCBmb2xsb3dpbmcgZGF0YSBoZWFkZXIgc3RyZWFtIG9yCisgKiAgICAgICB0ZW1wbGF0ZSBoZWFkZXIgc3RyZWFtIGlkZW50aWNhbCB0byBmaWVsZCBJRAorICogICAgLSB0YWJsZUlkeCAwIGlzIHRoZSAidGFibGUgb2YgYWxsIHRhYmxlcyIsIGEuay5hLiB0YWJsZSBjb250ZW50IG9mIGFsbAorICogICAgICB0YWJsZSBpbmRleGVzCisgKiAgICAtIGVudW1JZHggMCBpcyB0aGUgImVudW0gb2YgYWxsIGVudW1zIiwgYS5rLmEuIHRhYmxlIGNvbnRlbnQgb2YgYWxsIGVudW0KKyAqICAgICAgaW5kZXhlcworICovCisKKyNkZWZpbmUgRklFTERfSURfVFlQRV9NQVNLICAgICAgICAgICAgICAgICAgMHg4MAorI2RlZmluZSBGSUVMRF9JRF9UWVBFX0xTQiAgICAgICAgICAgICAgICAgICA3CisjZGVmaW5lIElzRmllbGRUeXBlQmFzaWNEYXRhKGIpICAgICAgICAgICAgICgoKGIpICYgKEZJRUxEX0lEX1RZUEVfTUFTSykpID8gMSA6IDApCisKKy8qIEZpZWxkIElkZW50aWZpZXIgdGFibGUgaW5kZXggWzY6MF0gKi8KKyNkZWZpbmUgRklFTERfSURfVEFCTEVfT1JfRU5VTV9JRFhfTUFTSyAgICAgMHg3ZgorI2RlZmluZSBGSUVMRF9JRF9UQUJMRV9PUl9FTlVNX0lEWF9MU0IgICAgICAwCisjZGVmaW5lIF9UQUJMRV9JRFgoYikgICAgICAgICAgICAgICAgICAgICAgICgoKGIpICYgfkZJRUxEX0lEX1RZUEVfTUFTSykgfCAoKGIpICYgRklFTERfSURfVEFCTEVfT1JfRU5VTV9JRFhfTUFTSykpCisjZGVmaW5lIElzSWR4VGFibGVPZkFsbFRhYmxlcyhiKSAgICAgICAgICAgICgoKGIpICYgRklFTERfSURfVEFCTEVfT1JfRU5VTV9JRFhfTUFTSykgPyAwIDogMSkKKyNkZWZpbmUgSXNJZHhFbnVtT2ZBbGxFbnVtcyhiKSAgICAgICAgICAgICAgKCgoYikgJiBGSUVMRF9JRF9UQUJMRV9PUl9FTlVNX0lEWF9NQVNLKSA/IDAgOiAxKQorCisvKiBGaWVsZCBJZGVudGlmaWVyIGJhc2ljIGRhdGEgdHlwZXMgWzY6MF0KKyAqICAgIDA6ICBVOAorICogICAgMTogIFUzMgorICogICAgMjogIFM4CisgKiAgICAzOiAgUzMyCisgKiAgICA0OiAgVTE2CisgKiAgICA1OiAgUzE2CisgKi8KKworI2RlZmluZSBGSUVMRF9JRF9CQVNJQ19EQVRBX1RZUEVTX01BU0sgICAgICAweDdGCisjZGVmaW5lIEZJRUxEX0lEX0JBU0lDX0RBVEFfVFlQRVNfTFNCICAgICAgIDAKKwordHlwZWRlZiBlbnVtIHsKKyAgIF9GSUVMRF9JRF9EQVRBX1RZUEVfVTggPSAwLAorICAgX0ZJRUxEX0lEX0RBVEFfVFlQRV9VMzIsCisgICBfRklFTERfSURfREFUQV9UWVBFX1M4LAorICAgX0ZJRUxEX0lEX0RBVEFfVFlQRV9TMzIsCisgICBfRklFTERfSURfREFUQV9UWVBFX1UxNiwKKyAgIF9GSUVMRF9JRF9EQVRBX1RZUEVfUzE2LAorICAgX0ZJRUxEX0lEX0RBVEFfVFlQRV9MQVNULAorfSBfRklFTERfSURfQkFTSUNfREFUQV9UWVBFOworCisjZGVmaW5lIFRoZUJhc2ljRGF0YVR5cGUoYikgICAgICAgICAgICAgICAgICgoKGIpICYgKEZJRUxEX0lEX0JBU0lDX0RBVEFfVFlQRVNfTUFTSykpID4+IEZJRUxEX0lEX0JBU0lDX0RBVEFfVFlQRVNfTFNCKQorI2RlZmluZSBfSURfVTggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKEZJRUxEX0lEX1RZUEVfTUFTSykgfCAoX0ZJRUxEX0lEX0RBVEFfVFlQRV9VOCkpCisjZGVmaW5lIF9JRF9VMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoRklFTERfSURfVFlQRV9NQVNLKSB8IChfRklFTERfSURfREFUQV9UWVBFX1UzMikpCisjZGVmaW5lIF9JRF9TOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoRklFTERfSURfVFlQRV9NQVNLKSB8IChfRklFTERfSURfREFUQV9UWVBFX1M4KSkKKyNkZWZpbmUgX0lEX1MzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChGSUVMRF9JRF9UWVBFX01BU0spIHwgKF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SUVMRF9TSVpFX1ZBTFVFX01BU0spKQorCisjZGVmaW5lIF9BRERfU0laRTEoYikgICgoKChiKSA+PiA3KSAmIDB4MykgPDwgMikKKyNkZWZpbmUgX0FERF9TSVpFMihiKSAgKCgoKGIpID4+IDcpICYgMHgzKSA8PCA0KQorI2RlZmluZSBfQUREX1NJWkUzKGIpICAoKCgoYikgPj4gNykgJiAweDMpIDw8IDYpCisKKy8qCisgKiBGaWVsZCBzdG9yYWdlIHNpemUgdHlwZSAgWzddCisgKiAgICAgICAgIC8gICAgICAgXAorICogICAgIDE6IGludCAgICAgIDA6IGVudW0KKyAqICAgYml0bWFwWzY6MF0gICBiaXRtYXBbNjowXQorICogICAgICAgfCAgICAgICAgICAgICB8CisgKiAgIG1heCBpbnQgaW5kZXggIGVudW0gaW5kZXggaW50byBlbnVtIHRhYmxlcworICoKKyAqIE5vdGUgdGhhdCBlbnVtPTAgbWFrZXMgdGhlIHRlbXBsYXRlIGVudW0gSUQgZm9sbG93aW5nIHRlbXBsYXRlIHN0cmVhbSBieXRlCisgKiBpZGVudGljYWwgdG8gZW51bSBmaWVsZCBzdG9yYWdlIHNpemUgdHlwZQorICoKKyAqIEZpZWxkIHN0b3JhZ2Ugc2l6ZSB2YWx1ZSBbNjowXQorICovCisjZGVmaW5lIEZJRUxEX1NJWkVfVFlQRV9NQVNLICAgICAgICAgICAgICAweDgwCisjZGVmaW5lIEZJRUxEX1NJWkVfVFlQRV9MU0IgICAgICAgICAgICAgICA3CisjZGVmaW5lIEZJRUxEX1NJWkVfVFlQRV9CSVQodCkgICAgICAgICAgICAoKCh0KTw8IChGSUVMRF9TSVpFX1RZUEVfTFNCKSkgJiAoRklFTERfU0laRV9UWVBFX01BU0spKQorI2RlZmluZSBJc0ZpZWxkU2l6ZUludChiKSAgICAgICAgICAgICAgICAgKCgoYikgJiAoRklFTERfU0laRV9UWVBFX01BU0spKSA/IDEgOiAwKQorCit0eXBlZGVmIGVudW0geworICAgRklFTERfU0laRV9JRFhf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JtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICBcZmlsZSAgdm9zX2FwaS5jCisKKyAgXGJyaWVmIFN0dWIgZmlsZSBmb3IgYWxsIHZpcnR1YWwgT3BlcmF0aW5nIFN5c3RlbSBTZXJ2aWNlcyAodk9TUykgQVBJcworICAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKyAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAKKworICAgICAgICAgICAgICAgICAgICAgICBFRElUIEhJU1RPUlkgRk9SIEZJTEUgCisgICAKKyAgIAorICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4gCisgIE5vdGljZSB0aGF0IGNoYW5nZXMgYXJlIGxpc3RlZCBpbiByZXZlcnNlIGNocm9ub2xvZ2ljYWwgb3JkZXIuIAorICAgCisgICAKKyAgJEhlYWRlcjokICREYXRlVGltZTogJCAkQXV0aG9yOiAkIAorICAgCisgICAKKyAgd2hlbiAgICAgICAgd2hvICAgIHdoYXQsIHdoZXJlLCB3aHkgCisgIC0tLS0tLS0tICAgIC0tLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAwMy8yOS8wOSAgICBrYW5hbmQgICAgIENyZWF0ZWQgbW9kdWxlLiAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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ICggdl9DT05URVhUX3QgKnBWb3NDb250ZXh0ICkKK3sKKyAgIGlmICggcFZvc0NvbnRleHQgPT0gTlVMTCkKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKworICAgLyogQWxsb2NhdGUgdGhlIFZPUyBDb250ZXh0ICovCisgICAqcFZvc0NvbnRleHQgPSBOVUxMOworICAgZ3BWb3NDb250ZXh0ID0gJmdWb3NDb250ZXh0OworCisgICBpZiAoTlVMTCA9PSBncFZvc0NvbnRleHQpCisgICB7CisgICAgIC8qIENyaXRpY2FsIEVycm9yIC4uLkNhbm5vdCBwcm9jZWVkIGZ1cnRoZXIgKi8KKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICIlczogRmFpbGVkIHRvIGFsbG9jYXRlIFZPUyBDb250ZXh0IiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfUkVTT1VSQ0VTOworICAgfQorCisgICB2b3NfbWVtX3plcm8oZ3BWb3NDb250ZXh0LCBzaXplb2YoVm9zQ29udGV4dFR5cGUpKTsKKworICAgKnBWb3NDb250ZXh0ID0gZ3BWb3NDb250ZXh0OworCisgICAvKiBJbml0aWFsaXplIHRoZSBzcGlubG9jayAqLworICAgdm9zX3RyYWNlX3NwaW5fbG9ja19pbml0KCk7CisgICAvKiBpdCBpcyB0aGUgcmlnaHQgdGltZSB0byBpbml0aWFsaXplIE1UUkFDRSBzdHJ1Y3R1cmVzICovCisgICAjaWYgZGVmaW5lZChUUkFDRV9SRUNPUkQpCisgICAgICAgdm9zVHJhY2VJbml0KCk7CisgICAjZW5kaWYKKworICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKKworfSAvKiB2b3NfcHJlT3BlbigpKi8KKworICAKKy8qLS0tLS0tLS0tLS0tLS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Z3BWb3NDb250ZXh0LCAmZ3BWb3NDb250ZXh0LT52b3NQYWNrZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoIHZvc19wa3RfY29udGV4dF90ICkgKTsKKworICAgaWYgKCAhVk9TX0lTX1NUQVRVU19TVUNDRVNTKCB2U3RhdHVzICkgKQorICAgeworICAgICAgLyogQ3JpdGljYWwgRXJyb3IgLi4uICBDYW5ub3QgcHJvY2VlZCBmdXJ0aGVyICovCisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICIlczogRmFpbGVkIHRvIG9wZW4gVk9TIFBhY2tldCBNb2R1bGUiLCBfX2Z1bmNfXyk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgZ290byBlcnJfd2RhX2Nsb3NlOworICAgfQorCisgICAvKiBPcGVuIHRoZSBTWVMgbW9kdWxlICovCisgICB2U3RhdHVzID0gc3lzT3BlbihncFZvc0NvbnRleHQpOworCisgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2U3RhdHVzKSkKKyAgIHsKKyAgICAgIC8qIENyaXRpY2FsIEVycm9yIC4uLiAgQ2Fubm90IHByb2NlZWQgZnVydGhlciAqLworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAiJXM6IEZhaWxlZCB0byBvcGVuIFNZUyBtb2R1bGUiLCBfX2Z1bmNfXyk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgZ290byBlcnJfcGFja2V0X2Nsb3NlOworICAgfQorCisjaWZuZGVmIENPTkZJR19FTkFCTEVfTElOVVhfUkVHCisgICAvKiBpbml0aWFsaXplIHRoZSBOViBtb2R1bGUgKi8KKyAgIHZTdGF0dXMgPSB2b3NfbnZfb3BlbigpOworICAgaW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IEZhaWxlZCB0byBvcGVuIFRMIiwgX19mdW5jX18pOworICAgICBWT1NfQVNTRVJUKDApOworICAgICBnb3RvIGVycl9zbWVfY2xvc2U7CisgICB9CisKKyAgIGlmIChncFZvc0NvbnRleHQtPnJvYW1EZWxheVN0YXRzRW5hYmxlZCAmJgorICAgICAgICF2b3Nfcm9hbV9kZWxheV9zdGF0c19pbml0KCkpCisgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IENvdWxkIG5vdCBpbml0IHJvYW1EZWxheVN0YXRzIiwgX19mdW5jX18pOworICAgfQorCisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgICIlczogVk9TUyBzdWNjZXNzZnVsbHkgT3BlbmVkIiwgX19mdW5jX18pOworCisgICAqcFZvc0NvbnRleHQgPSBncFZvc0NvbnRleHQ7CisKKyAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7CisKKworZXJyX3NtZV9jbG9zZToKKyAgIHNtZV9DbG9zZShncFZvc0NvbnRleHQtPnBNQUNDb250ZXh0KTsKKworZXJyX21hY19jbG9zZToKKyAgIG1hY0Nsb3NlKGdwVm9zQ29udGV4dC0+cE1BQ0NvbnRleHQpOworCitlcnJfbnZfY2xvc2U6CisKKyNpZm5kZWYgQ09ORklHX0VOQUJMRV9MSU5VWF9SRUcKKyAgIHZvc19udl9jbG9zZSgpOworCitlcnJfc3lzX2Nsb3NlOgorI2VuZGlmCisKKyAgIHN5c0Nsb3NlKGdwVm9zQ29udGV4dCk7CisKK2Vycl9wYWNrZXRfY2xvc2U6CisgICB2b3NfcGFja2V0X2Nsb3NlKCBncFZvc0NvbnRleHQgKTsKKworZXJyX3dkYV9jbG9zZToKKyAgIFdEQV9jbG9zZShncFZvc0N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gICAvKmNhbGwgV0RBIHByZSBzdGFydCovCisgICB2U3RhdHVzID0gV0RBX3ByZVN0YXJ0KGdwVm9zQ29udGV4dCk7CisgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2U3RhdHVzKSkKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1NZUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICJGYWlsZWQgdG8gV0RBIHByZXN0YXJ0Iik7CisgICAgICBtYWNTdG9wKGdwVm9zQ29udGV4dC0+cE1BQ0NvbnRleHQsIEhBTF9TVE9QX1RZUEVfU1lTX0RFRVBfU0xFRVApOworICAgICAgY2NtU3RvcChncFZvc0NvbnRleHQtPnBNQUNDb250ZXh0KTsKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICB9CisKKyAgIC8qIE5lZWQgdG8gdXBkYXRlIHRpbWUgb3V0IG9mIGNvbXBsZXRlICovCisgICB2U3RhdHVzID0gdm9zX3dhaXRfc2luZ2xlX2V2ZW50KCAmZ3BWb3NDb250ZXh0LT53ZGFDb21wbGV0ZUV2ZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1dEQV9USU1FT1VUICk7CisgICBpZiAoIHZTdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTICkKKyAgIHsKKyAgICAgIGlmICggdlN0YXR1cyA9PSBWT1NfU1RBVFVTX0VfVElNRU9VVCApCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICIlczogVGltZW91dCBvY2N1cnJlZCBiZWZvcmUgV0RBIGNvbXBsZXRlIiwgX19mdW5jX18pOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgVk9TX1RS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3V0IG9mIGNvbXBsZXRlICovCisgICB2U3RhdHVzID0gdm9zX3dhaXRfc2luZ2xlX2V2ZW50KCAmcFZvc0NvbnRleHQtPndkYUNvbXBsZXRlRXZlbnQsIDEwMDApOworICAgaWYgKCB2U3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUyApCisgICB7CisgICAgICBpZiAoIHZTdGF0dXMgPT0gVk9TX1NUQVRVU19FX1RJTUVPVVQgKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAiJXM6IFRpbWVvdXQgb2NjdXJyZWQgYmVmb3JlIFdEQSBjb21wbGV0ZSIsX19mdW5jX18pOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgIiVzOiBXREFfcHJlU3RhcnQgcmVwb3J0aW5nICBvdGhlciBlcnJvciIsX19mdW5jX18pOworICAgICAgfQorICAgICAgVk9TX0FTU0VSVCggMCApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgfQorCisgICAgdlN0YXR1cyA9IFdEQV9OVkRvd25sb2FkX1N0YXJ0KHBWb3NDb250ZXh0KTsKKworICAgIGlmICggdlN0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MgKQorICAgIHsKKyAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICIlczogRmFpbGVkIHRvIHN0YXJ0IE5WIERvd25sb2FkIixfX2Z1bmNfXyk7CisgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgIH0KKworICAgIHZTdGF0dXMgPSB2b3Nfd2FpdF9zaW5nbGVfZXZlbnQoJihwVm9zQ29udGV4dC0+d2RhQ29tcGxldGVFdmVudCksIDEwMDAgKiAzMCk7CisKKyAgICBpZiAoIHZTdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTICkKKyAgICB7CisgICAgICAgaWYgKCB2U3RhdHVzID09IFZPU19TVEFUVVNfRV9USU1FT1VUICkKKyAgICAgICB7CisgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICIlczogVGltZW91dCBvY2N1cnJlZCBiZWZvcmUgV0RBX05WRG93bmxvYWRfU3RhcnQgY29tcGxldGUiLF9fZnVuY19fKTsKKyAgICAgICB9CisgICAgICAgZWxzZQorICAgICAgIHsKKyAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICIlczogV0RBX05WRG93bmxvYWRfU3RhcnQgcmVwb3J0aW5nICBvdGhlciBlcnJvciIsX19mdW5jX18pOworICAgICAgIH0KKyAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICB9CisKKyAgICB2U3RhdHVzID0gV0RBX3N0YXJ0KHBWb3NDb250ZXh0KTsKKyAgICBpZiAodlN0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBGYWlsZWQgdG8gc3RhcnQgV0RBIixfX2Z1bmNfXyk7CisgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgIH0KKworICAvKiogU1RB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3J0aW5nICBvdGhlciBlcnJvciIsX19mdW5jX18pOworICAgICAgfQorICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgIH0KKyAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworfQorCitWT1NfU1RBVFVTIHZvc19tb25fc3RvcCggdl9DT05URVhUX3Qgdm9zQ29udGV4dCApCit7CisgIFZPU19TVEFUVVMgdm9zU3RhdHVzOworCisgIHZvc19ldmVudF9yZXNldCggJihncFZvc0NvbnRleHQtPndkYUNvbXBsZXRlRXZlbnQpICk7CisKKyAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICIlczogSEFMX1NUT1AgaXMgcmVxdWVzdGVkIiwgX19mdW5jX18pOworCisgIHZvc1N0YXR1cyA9IFdEQV9zdG9wKCB2b3NDb250ZXh0LCBIQUxfU1RPUF9UWVBFX1JGX0tJTEwgKTsKKworICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICB7CisgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAiJXM6IEZhaWxlZCB0byBzdG9wIFdEQSIsIF9fZnVuY19fKTsKKyAgICAgVk9TX0FTU0VSVCggVk9TX0lTX1NUQVRVU19TVUNDRVNTKCB2b3NTdGF0dXMgKSApOworICAgICBXREFfc2V0TmVlZFNodXRkb3duKHZvc0NvbnRleHQpOworICB9CisgIGVsc2UKKyAgeworICAgIHZvc1N0YXR1cyA9IHZvc193YWl0X3NpbmdsZV9ldmVudCggJihncFZvc0NvbnRleHQtPndkYUNvbXBsZXRlRXZlbnQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1dEQV9TVE9QX1RJTUVPVVQgKTsKKworICAgIGlmICggdm9zU3RhdHVzICE9IFZPU19T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KTsKKyAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICB9CisKKyAgdlN0YXR1cyA9IHZvc193YWl0X3NpbmdsZV9ldmVudCggJihncFZvc0NvbnRleHQtPndkYUNvbXBsZXRlRXZlbnQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfV0RBX1RJTUVPVVQgKTsKKworICBpZiAoIHZTdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTICkKKyAgeworICAgICBpZiAoIHZTdGF0dXMgPT0gVk9TX1NUQVRVU19FX1RJTUVPVVQgKQorICAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAiJXM6IFRpbWVvdXQgb2NjdXJyZWQgYmVmb3JlIFdEQV9OVkRvd25sb2FkX3N0YXJ0IGNvbXBsZXRlIiwgX19mdW5jX18pOworICAgICB9CisgICAgIGVsc2UKKyAgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgIiVzOiBXREFfTlZEb3dubG9hZF9zdGFydCByZXBvcnRpbmcgb3RoZXIgZXJyb3IiLCBfX2Z1bmNfXyk7CisgICAgIH0KKyAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgdm9zX2V2ZW50X3Jlc2V0KCAmKGdwVm9zQ29udGV4dC0+d2RhQ29tcGxldGVFdmVudCkgKTsKKyAgICAgaWYgKHZvc19pc19sb2dwX2luX3Byb2dyZXNzKFZPU19NT0RVTEVfSURfVk9TUywgTlVMTCkpCisgICAgIHsKKyAgICAgICBpZiAoaXNTc3JQYW5pY09uRmFpbHVyZSgpKQorICAgICAgICAgICBWT1NfQlVHKDApOworICAgICB9CisgICAgIFdEQV9zZXROZWVkU2h1dGRvd24odm9zQ29udGV4dCk7CisgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgfQorCisgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgIiVzOiBXREFfTlZEb3dubG9hZF9zdGFydCBjb3JyZWN0bHkgc3RhcnRlZCIsIF9fZnVuY19fKTsKKworICAvKiBTdGFydCB0aGUgV0RBICovCisgIHZTdGF0dXMgPSBXREFfc3RhcnQocFZvc0NvbnRleHQpOworICBpZiAoIHZTdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTICkKKyAgeworICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IEZhaWxlZCB0byBzdGFydCBXREEgLSBXREFfc2h1dGRvd24gbmVlZGVkICVkICIsCisgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHZTdGF0dXMpOworICAgICBpZiAoIHZTdGF0dXMgPT0gVk9TX1NUQVRVU19FX1RJTUVPVVQgKQorICAgICB7CisgICAgICAgICBXREFfc2V0TmVlZFNodXRkb3duKHZvc0NvbnRleHQpOworICAgICB9CisgICAgIFZPU19BU1NFUlQoMCk7CisgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgfQorICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICIlczogV0RBIGNvcnJlY3RseSBzdGFydGVkIiwgX19mdW5jX18pOworCisgIC8qIFN0YXJ0IHRoZSBNQUMgKi8KKyAgdm9zX21lbV96ZXJvKCh2X1BWT0lEX3QpJmhhbFN0YXJ0UGFyYW1zLCBzaXplb2YodEhhbE1hY1N0YXJ0UGFyYW1ldGVycykpOworCisgIC8qIFN0YXJ0IHRoZSBNQUMgKi8KKyAgc2lyU3RhdH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VkIHRvIHN0b3AgV0RBIiwgX19mdW5jX18pOworICAgICBWT1NfQVNTRVJUKCBWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIHZTdGF0dXMgKSApOworICAgICBXREFfc2V0TmVlZFNodXRkb3duKHZvc0NvbnRleHQpOworICB9CisgIGVsc2UKKyAgeworICAgIHZTdGF0dXMgPSB2b3Nfd2FpdF9zaW5nbGVfZXZlbnQoICYoZ3BWb3NDb250ZXh0LT53ZGFDb21wbGV0ZUV2ZW50KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfV0RBX1RJTUVPVVQgKTsKKyAgICBpZiggdlN0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MgKQorICAgIHsKKyAgICAgICBpZiggdlN0YXR1cyA9PSBWT1NfU1RBVFVTX0VfVElNRU9VVCApCisgICAgICAgeworICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICIlczogVGltZW91dCBvY2N1cnJlZCBiZWZvcmUgV0RBX3N0b3AgY29tcGxldGUiLCBfX2Z1bmNfXyk7CisKKyAgICAgICB9CisgICAgICAgZWxzZQorICAgICAgIHsKKyAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAiJXM6IFdEQV9zdG9wIHJlcG9ydGluZyBvdGhlciBlcnJvciIsIF9fZnVuY19fKTsKKyAgICAgICB9CisgICAgICAgVk9TX0FTU0VSVCggMCApOworICAgICAgIFdEQV9zZXROZWVkU2h1dGRvd24odm9zQ29udGV4dCk7CisgICAgfQorICB9CisKKyAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgCit9IC8qIHZvc19zdGFydCgpICovCisKKworLyogdm9zX3N0b3AgZnVuY3Rpb24gKi8KK1ZPU19TVE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AgICAgIF9fZnVuY19fKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICB2b3NTdGF0dXMgPSB2b3Nfd2FpdF9zaW5nbGVfZXZlbnQoICYoZ3BWb3NDb250ZXh0LT53ZGFDb21wbGV0ZUV2ZW50KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19XREFfU1RPUF9USU1FT1VUICk7CisgICAgfQorCisgICAgaWYgKCB2b3NTdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTICkKKyAgICB7CisgICAgICAgaWYgKCB2b3NTdGF0dXMgPT0gVk9TX1NUQVRVU19FX1RJTUVPVVQgKQorICAgICAgIHsKKyAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAiJXM6IFRpbWVvdXQgb2NjdXJyZWQgYmVmb3JlIFdEQSBjb21wbGV0ZSIsIF9fZnVuY19fKTsKKyAgICAgICB9CisgICAgICAgZWxzZQorICAgICAgIHsKKyAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAiJXM6IFdEQV9zdG9wIHJlcG9ydGluZyBvdGhlciBlcnJvciIsIF9fZnVuY19fICk7CisgICAgICAgfQorICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICIlczogVGVzdCBNQyB0aHJlYWQgYnkgcG9zdGluZyBhIHByb2JlIG1lc3NhZ2UgdG8gU1lTIiwgX19mdW5jX18pOworICAgICAgIHdsYW5fc3lzX3Byb2JlKCk7CisgICAgICAgV0RBX3NldE5lZWRTaHV0ZG93bih2b3NDb250ZXh0KTsKKyAgICB9CisgIH0KKworICAvKiBTWVMgU1RPUCB3aWxsIHN0b3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AgICAgIHBNb2RDb250ZXh0ID0gZ3BWb3NDb250ZXh0LT5wSEREQ29udGV4dDsKKyAgICAgIGJyZWFrOworICAgIH0KKworICAgIGNhc2UgVk9TX01PRFVMRV9JRF9TTUU6CisgICAgY2FzZSBWT1NfTU9EVUxFX0lEX1BFOgorICAgIGNhc2UgVk9TX01PRFVMRV9JRF9QTUM6CisgICAgeworICAgICAgLyogCisgICAgICAqKiBJbiBhbGwgdGhlc2UgY2FzZXMsIHdlIGp1c3QgcmV0dXJuIHRoZSBNQUMgQ29udGV4dAorICAgICAgKi8KKyAgICAgIHBNb2RDb250ZXh0ID0gZ3BWb3NDb250ZXh0LT5wTUFDQ29udGV4dDsKKyAgICAgIGJyZWFrOworICAgIH0KKworICAgIGNhc2UgVk9TX01PRFVMRV9JRF9XREE6CisgICAgeworICAgICAgLyogRm9yIFdEQSBtb2R1bGUgKi8KKyAgICAgIHBNb2RDb250ZXh0ID0gZ3BWb3NDb250ZXh0LT5wV0RBQ29udGV4dDsKKyAgICAgIGJyZWFrOworICAgIH0KKworICAgIGNhc2UgVk9TX01PRFVMRV9JRF9WT1NTOgorICAgIHsKKyAgICAgIC8qIEZvciBTWVMgdGhpcyBpcyBWT1MgaXRzZWxmKi8KKyAgICAgIHBNb2RDb250ZXh0ID0gZ3BWb3NDb250ZXh0OworICAgICAgYnJlYWs7CisgICAgfQorCisgICAgZGVmYXVsdDoKKyAgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIiVzOiBNb2R1bGUgSUQgJWkgIgorICAgICAgICAgICJkb2VzIG5vdCBoYXZlIGl0cyBjb250ZXh0IG1haW50YWluZWQgYnkgVk9TUyIsIF9fZnVuY19fLCBtb2R1bGVJZCk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorICB9CisKKyAgaWYgKHBNb2RDb250ZXh0ID09IE5VTEw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ICAgIH0KKworICAgIGNhc2UgVk9TX01PRFVMRV9JRF9XREE6CisgICAgeworICAgICAgcEdwTW9kQ29udGV4dCA9ICYoZ3BWb3NDb250ZXh0LT5wV0RBQ29udGV4dCk7CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBWT1NfTU9EVUxFX0lEX1NNRToKKyAgICBjYXNlIFZPU19NT0RVTEVfSURfUEU6CisgICAgY2FzZSBWT1NfTU9EVUxFX0lEX1BNQzoKKyAgICBjYXNlIFZPU19NT0RVTEVfSURfSEREOgorICAgIGNhc2UgVk9TX01PRFVMRV9JRF9IRERfU09GVEFQOgorICAgIGRlZmF1bHQ6CisgICAgeyAgICAgCisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogTW9kdWxlIElEICVpICIKKyAgICAgICAgICAiZG9lcyBub3QgaGF2ZSBpdHMgY29udGV4dCBhbGxvY2F0ZWQgYnkgVk9TUyIsIF9fZnVuY19fLCBtb2R1bGVJRCk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgICB9CisgIH0KKworICBpZiAoIE5VTEwgIT0gKnBHcE1vZENvbnRleHQpCisgIHsKKyAgICAvKgorICAgICoqIENvbnRleHQgaGFzIGFscmVhZHkgYmVlbiBhbGxvY2F0ZWQhCisgICAgKiogUHJldmVudCBkb3VibGUgYWxsb2NhdGlvbgorICAgICovCisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICIlczogTW9kdWxlIElEICVpIGNvbnRleHQgaGFzIGFscmVhZHkgYmVlbiBhbGxvY2F0ZWQiLAorICAgICAgICAgICAgICAgIF9fZnVuY19fLCBtb2R1bGVJRCk7CisgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9FWEl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IHdpdGhpbiB0aGUgCisgIFZPUyBHbG9iYWwgQ29udGV4dC4gIAorICAKKyAgXHBhcmFtIHBWb3NDb250ZXh0IC0gcG9pbnRlciB0byB0aGUgZ2xvYmFsIFZvcyBjb250ZXh0CisgIAorICBccGFyYW0gbW9kdWxlSWQgLSB0aGUgbW9kdWxlIElEIHdobydzIGNvbnRleHQgYXJlYSBpcyBiZWluZyBmcmVlCisgIAorICBccGFyYW0gcE1vZHVsZUNvbnRleHQgLSBwb2ludGVyIHRvIG1vZHVsZSBjb250ZXh0IGFyZWEgdG8gYmUgZnJlZSdkLgorICAgICAgICAgICAgICAgICAgICAgIAorICBccmV0dXJuIC0gVk9TX1NUQVRVU19TVUNDRVNTIC0gdGhlIGNvbnRleHQgZm9yIHRoZSBtb2R1bGUgSUQgaGFzIGJlZW4gCisgICAgICAgICAgICBmcmVlJ2QuICBUaGUgcG9pbnRlciB0byB0aGUgY29udGV4dCBhcmVhIGlzIG5vdCBsb25nZXIgCisgICAgICAgICAgICBhdmFpbGFibGUuCisgICAgICAgICAgICAKKyAgICAgICAgICAgIFZPU19TVEFUVVNfRV9GQVVMVCAtIHBWb3NDb250ZXh0IG9yIHBNb2R1bGVDb250ZXh0IGFyZSBub3QgCisgICAgICAgICAgICB2YWxpZCBwb2ludGVycy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgVk9TX1NUQVRVU19FX0lOVkFMIC0gdGhlIG1vZHVsZUlkIGlzIG5vdCBhIHZhbGlkIG9yIGRvZXMgCisgICAgICAgICAgICBub3QgaWRlbnRpZnkgYSBtb2R1bGUgdGhhdCBjYW4gaGF2ZSBhIGNvbnRleHQgZnJlZSdkLgorICAgICAgICAgICAgCisgICAgICAgICAgICBWT1NfU1RBVFVTX0VfRVhJU1RTIC0gdm9zIGNvdWxkIG5vdCBmcmVlIHRoZSByZXF1ZXN0ZWQgCisgICAgICAgICAgICBjb250ZXh0IGFyZWEgYmVjYXVzZSBhIGNv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lzX2ZhdGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMiBpbmRpY2F0b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyIHJlYXNvbl9jb2RlKQoreworICAgIHJldHVybiB3bGFuX3NldF9sb2dfY29tcGxldGlvbihpc19mYXRhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kaWNhdG9yLHJlYXNvbl9jb2RlKTsKK30KKwordm9pZCB2b3NfZ2V0X2xvZ19jb21wbGV0aW9uKHVpbnQzMiAqaXNfZmF0YWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMiAqaW5kaWNhdG9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzIgKnJlYXNvbl9jb2RlKQoreworICAgIHdsYW5fZ2V0X2xvZ19jb21wbGV0aW9uKGlzX2ZhdGFsLCBpbmRpY2F0b3IsIHJlYXNvbl9jb2RlKTsKK30KKworCisKK3ZvaWQgdm9zX3NlbmRfZmF0YWxfZXZlbnRfZG9uZSh2b2lkKQoreworICAgIC8qQ29tcGxldGUgdGhlIGZ3TG9nc0NvbXBsZXRlIEV2ZW50Ki8KKyAgICBWb3NDb250ZXh0VHlwZSAqdm9zX2NvbnRleHQ7CisgICAgdWludDMyX3QgaXNfZmF0YWwsIGluZGljYXRvciwgcmVhc29uX2NvZGU7CisKKyAgICB2b3NfY29udGV4dCA9IHZvc19nZXRfZ2xvYmFsX2NvbnRleHQoVk9TX01PRFVMRV9JRF9TWVMsIE5VTEwpOworICAgIGlmICghdm9zX2NvbnRleHQpIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAiJXM6IHZvcyBjb250ZXh0IGlzIEludmFsaWQiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgVk9TX1RSQUNFKF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9yPSVkIHJlYXNvbl9jb2RlPSVkIiwKKyAgICAgICAgX19mdW5jX18sIGlzX2ZhdGFsLCBpbmRpY2F0b3IsIHJlYXNvbl9jb2RlKTsKKworICAgIHZvc19ldmVudF9yZXNldCgmZ3BWb3NDb250ZXh0LT5md0xvZ3NDb21wbGV0ZSk7CisgICAgc3RhdHVzID0gc21lX2ZhdGFsX2V2ZW50X2xvZ3NfcmVxKHZvc19jb250ZXh0LT5wTUFDQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNfZmF0YWwsIGluZGljYXRvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVhc29uX2NvZGUpOworCisgICAgaWYgKEhBTF9TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpICYmICh3YWl0UmVxdWlyZWQgPT0gVFJVRSkpCisgICAgeworCisgICAgICAgIC8qIE5lZWQgdG8gdXBkYXRlIHRpbWUgb3V0IG9mIGNvbXBsZXRlICovCisgICAgICAgIHZvc1N0YXR1cyA9IHZvc193YWl0X3NpbmdsZV9ldmVudCgmZ3BWb3NDb250ZXh0LT5md0xvZ3NDb21wbGV0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdBSVRfVElNRV9GV19MT0dTKTsKKyAgICAgICAgaWYgKCB2b3NTdGF0dXMgIT0gVk9TX1NUQVRVU19TVUNDRVNTICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKCB2b3NTdGF0dXMgPT0gVk9TX1NUQVRVU19FX1RJTUVPVVQgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogVGltZW91dCBvY2N1cnJlZCBiZWZvcmUgZndMb2dzQ29tcGxldGUiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICB9CisgICAg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2V0TXEgPSAmKGdwVm9zQ29udGV4dC0+dm9zU2NoZWQuc21lTWNNcSk7CisgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgLy8vIE1lc3NhZ2UgUXVldWUgSUQgZm9yIG1lc3NhZ2VzIGJvdW5kIGZvciBQRQorICAgIGNhc2UgVk9TX01RX0lEX1BFOiAgCisgICAgeworICAgICAgIHBUYXJnZXRNcSA9ICYoZ3BWb3NDb250ZXh0LT52b3NTY2hlZC5wZU1jTXEpOworICAgICAgIGJyZWFrOworICAgIH0KKworICAgIC8vLyBNZXNzYWdlIFF1ZXVlIElEIGZvciBtZXNzYWdlcyBib3VuZCBmb3IgV0RBCisgICAgY2FzZSBWT1NfTVFfSURfV0RBOiAKKyAgICB7CisgICAgICAgcFRhcmdldE1xID0gJihncFZvc0NvbnRleHQtPnZvc1NjaGVkLndkYU1jTXEpOworICAgICAgIGJyZWFrOworICAgIH0KKworICAgIC8vLyBNZXNzYWdlIFF1ZXVlIElEIGZvciBtZXNzYWdlcyBib3VuZCBmb3IgV0RJCisgICAgY2FzZSBWT1NfTVFfSURfV0RJOgorICAgIHsKKyAgICAgICBwVGFyZ2V0TXEgPSAmKGdwVm9zQ29udGV4dC0+dm9zU2NoZWQud2RpTWNNcSk7CisgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgLy8vIE1lc3NhZ2UgUXVldWUgSUQgZm9yIG1lc3NhZ2VzIGJvdW5kIGZvciBUTAorICAgIGNhc2UgVk9TX01RX0lEX1RMOiAKKyAgICB7CisgICAgICAgcFRhcmdldE1xID0gJihncFZvc0NvbnRleHQtPnZvc1NjaGVkLnRsTWNNcSk7CisgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgLy8vIE1lc3NhZ2UgUXVldWUgSUQgZm9yIG1lc3NhZ2VzIGJvdW5kIGZvciB0aGUgU1lTIG1vZHVsZQorICAgIGNhc2UgVk9TX01RX0lEX1NZUzoKKyAgICB7CisgICAgICAgcFRhcmdldE1xID0gJihncFZvc0Nv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ZC5wZU1jTXEpOworICAgICAgIGJyZWFrOworICAgIH0KKworICAgIC8vLyBNZXNzYWdlIFF1ZXVlIElEIGZvciBtZXNzYWdlcyBib3VuZCBmb3IgV0RBCisgICAgY2FzZSBWT1NfTVFfSURfV0RBOgorICAgIHsKKyAgICAgICBwVGFyZ2V0TXEgPSAmKGdwVm9zQ29udGV4dC0+dm9zU2NoZWQud2RhTWNNcSk7CisgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgLy8vIE1lc3NhZ2UgUXVldWUgSUQgZm9yIG1lc3NhZ2VzIGJvdW5kIGZvciBXREkKKyAgICBjYXNlIFZPU19NUV9JRF9XREk6CisgICAgeworICAgICAgIHBUYXJnZXRNcSA9ICYoZ3BWb3NDb250ZXh0LT52b3NTY2hlZC53ZGlNY01xKTsKKyAgICAgICBicmVhazsKKyAgICB9CisKKyAgICAvLy8gTWVzc2FnZSBRdWV1ZSBJRCBmb3IgbWVzc2FnZXMgYm91bmQgZm9yIFRMCisgICAgY2FzZSBWT1NfTVFfSURfVEw6CisgICAgeworICAgICAgIHBUYXJnZXRNcSA9ICYoZ3BWb3NDb250ZXh0LT52b3NTY2hlZC50bE1jTXEpOworICAgICAgIGJyZWFrOworICAgIH0KKworICAgIC8vLyBNZXNzYWdlIFF1ZXVlIElEIGZvciBtZXNzYWdlcyBib3VuZCBmb3IgdGhlIFNZUyBtb2R1bGUKKyAgICBjYXNlIFZPU19NUV9JRF9TWVM6CisgICAgeworICAgICAgIHBUYXJnZXRNcSA9ICYoZ3BWb3NDb250ZXh0LT52b3NTY2hlZC5zeXNNY01xKTsKKyAgICAgICBicmVhazsKKyAgICB9CisKKyAgICBkZWZhdWx0OgorCisgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAoIiVzOiBUcnlpbmcgdG8gcXVldWUgbXNnIGludG8gdW5rbm93biBNQyBNc2cgcXVldWUgSUQgJWQiK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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGSUxFOiAgICAgICAgIHZvc19kaWFnLmMKKworICBPVkVSVklFVzogICAgIFRoaXMgc291cmNlIGZpbGUgY29udGFpbnMgZGVmaW5pdGlvbnMgZm9yIHZPUyBkaWFnIEFQSXMKKworICBERVBFTkRFTkNJRVM6Cis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworI2luY2x1ZGUgInZvc190eXBlcy5oIgorI2luY2x1ZGUgImlfdm9zX2RpYWdfY29yZV9sb2cuaCIKKyNpbmNsdWRlICJpX3Zvc19kaWFnX2NvcmVfZXZlbnQuaCIKKyNpbmNsdWRlICJ3bGFuX2hkZF9tYWluLmgiCisjaW5jbHVkZSAid2xhbl9ubGlua19jb21tb24uaCIKKyNpbmNsdWRlICJ2b3Nfc2NoZWQuaCIKKyNpbmNsdWRlICJ3bGFuX3B0dF9zb2NrX3N2Yy5oIgorI2luY2x1ZGUgIndsYW5fbmxpbmtfc3J2LmgiCisKKworI2RlZmluZSBQVFRfTVNHX0RJQUdfQ01EU19UWVBFICAgMHg1MDUwCisKKyNkZWZpbmUgRElBR19UWVBFX0xPR1MgICAxIAorI2RlZmluZSBESUFHX1RZUEVfRVZFTlRTIDIKKworI2RlZmluZSBESUFHX1NXQVAxNihBKSAoKCgodEFOSV9VMTYpKEEpICYgMHhmZjAwKSA+PiA4KSB8ICgoKHRBTklfVTE2KShBKSAmIDB4MDBmZikgPDwgOCkpCisKKworCit0eXBlZGVmIHN0cnVjdCBldmVudF9yZXBvcnRfcworeworICAgIHZfVTMyX3QgZGlhZ190eXBlOworICAgIHZfVTE2X3QgZXZlbnRfaWQ7CisgICAgdl9VMTZfdCBsZW5ndGg7Cit9IGV2ZW50X3JlcG9ydF90OworCisKKy8qKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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AgICBsb2dfaGRyX3R5cGUgKnBIZHIgPSAobG9nX2hkcl90eXBlKikgcGxvZ19oZHJfcHRyOworCisgICAgdEFuaUhkciAqd21zZyA9IE5VTEw7CisgICAgdl9VOF90ICpwQnVmOworICAgIHN0cnVjdCBoZGRfY29udGV4dF9zICpwSGRkQ3R4OworICAgIHZfQ09OVEVYVF90IHBWb3NDb250ZXh0PSBOVUxMOworICAgIHZfVTE2X3QgZGF0YV9sZW47CisgICAgdl9VMTZfdCB0b3RhbF9sZW47CisKKworICAgICAvKkdldCB0aGUgZ2xvYmFsIGNvbnRleHQgKi8KKyAgICBwVm9zQ29udGV4dCA9IHZvc19nZXRfZ2xvYmFsX2NvbnRleHQoVk9TX01PRFVMRV9JRF9TWVMsIE5VTEwpOworCisgICAgIC8qR2V0IHRoZSBIZGQgQ29udGV4dCAqLworICAgIHBIZGRDdHggPSAoKFZvc0NvbnRleHRUeXBlKikocFZvc0NvbnRleHQpKS0+cEhERENvbnRleHQ7CisKKyAgICBpZiAoV0xBTl9IRERfSVNfTE9BRF9VTkxPQURfSU5fUFJPR1JFU1MocEhkZEN0eCkpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgIiVzOiBVbmxvYWRpbmcvTG9hZGluZyBpbiBQcm9ncmVzcy4gSWdub3JlISEhIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm47CisgICAgfQorCisjaWZkZWYgV0xBTl9LRF9SRUFEWV9OT1RJRklFUgorICAgIC8qIE5MIGlzIG5vdCByZWFkeSB5ZXQsIFdMQU4gS08gc3RhcnRlZCBmaXJzdCAqLworICAgIGlmICgocEhkZEN0eC0+a2RfbmxfaW5pdCkgJiYgKCFwSGRkQ3R4LT5wdHRfcGlkKSkKKyAgICB7CisgICAgICAgIG5sX3Nydl9ubF9yZWFkeV9pbmRpY2F0aW9uKCk7CisgICAgfQorI2VuZGlmIC8qIFdMQU5fS0RfUkVBRFlfTk9USUZJRVIgKi8KKworICAgIGlmIChubF9zcnZfaXNfaW5pdGlhbGl6ZWQoKSAhPSAwKQorICAgICAgICByZXR1cm47CisKKyAgIC8qIFNlbmQgdGhlIGxvZyBkYXRhIHRvIHRoZSBwdHQgYXBwIG9ubHkgaWYgaXQgaXMgcmVnaXN0ZXJlZCB3aXRoIHRoZSB3bGFuIGRyaXZlciovCisgICAgaWYodm9zX2lzX211bHRpY2FzdF9sb2dnaW5nKCkpCisgICAgeworICAgICAgICBkYXRhX2xlbiA9IHBIZHItPmxlbjsKKyAgICAKKyAgICAgICAgdG90YWxfbGVuID0gc2l6ZW9mKHRBbmlIZHIpK3NpemVvZih2X1UzMl90KStkYXRhX2xlbjsKKyAgICAKKyAgICAgICAgcEJ1ZiA9ICAodl9VOF90Kil2b3NfbWVtX21hbGxvYyh0b3RhbF9sZW4pOworICAgIAorICAgICAgICBpZighcEJ1ZikKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJ2b3NfbWVtX21hbGxvYyBmYWlsZWQiKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgdm9zX21lbV96ZXJvKCh2X1ZPSURfdCopcEJ1Zix0b3RhbF9sZW4pOworICAgIAorICAgICAgICB3bXNnID0gKHRBbmlIZHIqKXBCdWY7CisgICAgICAgIHdtc2ctPnR5cGUgPSBQVFRfTVNHX0RJQUdfQ01EU19UWVBFOworICAgICAgICB3bXNnLT5sZW5ndGggPSB0b3RhbF9sZW47CisgICAgICAgIHdtc2ctPmxlbmd0aCA9IERJQUdfU1dBUDE2KHdtc2ctPmxlbmd0aCk7CisgICAgICAgIHBCdWYgKz0gc2l6ZW9mKHRBbmlIZHIpOworICAgIAorICAgIAorICAgICAgICAgICAgLyogIERpYWcgVHlwZSBldmVudHMgb3IgbG9nICovCisgICAgICAgICoodl9VMzJfdCopcEJ1ZiA9IERJQUdfVFlQRV9MT0dTOworICAgICAgICBwQnVmICs9IHNpemVvZih2X1UzMl90KTsKKyAgICAKKyAgICAKKyAgICAgICAgdm9zX21lbV9jb3B5KHBCdWYsIHBIZHIsZGF0YV9sZW4pOworCisgICAgICAgIGlmIChwdHRfc29ja19zZW5kX21zZ190b19hcHAod21zZywgMCwKKyAgICAgICAgICAgICAgICAgIEFOSV9OTF9NU0dfUFVNQUMsIElOVkFMSURfUElELCBNU0dfRE9OVFdBSVQpIDwgMCkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9mcmVlKCh2X1ZPSURfdCAqKXdtc2cpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgdm9zX21lbV9mcmVlKCh2X1ZPSURfdCopd21zZyk7CisgICAgfQorICAgIHJldHVybjsKK30KKworLyoqCisgKiB2b3NfbG9nX3dsb2NrX2RpYWcoKSAtIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCB0byBzZW5kIHdha2UgbG9jayBkaWFnIGV2ZW50cworICogQHJlYXNvbjogUmVhc29uIHdoeSB0aGUgd2FrZWxvY2sgd2FzIHRha2VuIG9yIHJlbGVhc2VkCisgKiBAd2FrZV9sb2NrX25hbWU6IEZ1bmN0aW9uIGluIHdoaWNoIHRoZSB3YWtlbG9jayB3YXMgdGFrZW4gb3IgcmVsZWFzZWQKKyAqIEB0aW1lb3V0OiBUaW1lb3V0IHZhbHVlIGluIGNhc2Ugb2YgdGltZWQgd2FrZWxvY2tzCisgKiBAc3RhdHVzOiBTdGF0dXMgZmllbGQgaW5kaWNhdGluZyB3aGV0aGVyIHRoZSB3YWtlIGxvY2sgd2FzIHRha2VuL3JlbGVhc2VkCisgKgorICogVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHRvIHNlbmQgd2FrZSBsb2NrIGRpYWcgZXZlbnRzIHRvIHVzZXIgc3BhY2UKKyAqCisg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oZSBldmVudCBkYXRhIHRvIHRoZSBwdHQgc29ja2V0IGFwcCBvbmx5IGlmIGl0IGlzIHJlZ2lzdGVyZWQgd2l0aCB0aGUgZHJpdmVyLgorCisgIFxwYXJhbSAgLSBwdHIgLSBQb2ludGVyIHRvIHRoZSBsb2cgaGVhZGVyIHR5cGUuCisgICAgICAgICAgICAgIAorICBccmV0dXJuIC0gTm9uZQorICAKKyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworCit2b2lkIHZvc19ldmVudF9yZXBvcnRfcGF5bG9hZCh2X1UxNl90IGV2ZW50X0lkLCB2X1UxNl90IGxlbmd0aCwgdl9WT0lEX3QgKnBQYXlsb2FkKQoreyAKKworCisgICAgdEFuaUhkciAqd21zZyA9IE5VTEw7CisgICAgdl9VOF90ICpwQnVmOworICAgIHN0cnVjdCBoZGRfY29udGV4dF9zICpwSGRkQ3R4OworICAgIHZfQ09OVEVYVF90IHBWb3NDb250ZXh0PSBOVUxMOworICAgIGV2ZW50X3JlcG9ydF90ICpwRXZlbnRfcmVwb3J0OworICAgIHZfVTE2X3QgdG90YWxfbGVuOworCisgICAgIC8qR2V0IHRoZSBnbG9iYWwgY29udGV4dCAqLworICAgIHBWb3NDb250ZXh0ID0gdm9zX2dldF9nbG9iYWxfY29udGV4dChWT1NfTU9EVUxFX0lEX1NZUywgTlVMTCk7CisgICAgaWYgKCFwVm9zQ29udGV4dCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiB2b3MgY29udGV4dCBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgIC8qR2V0IHRoZSBIZGQgQ29udGV4dCAqLworICAgIHBIZGRDdHggPSAoKFZvc0NvbnRleHRUeXBlKikocFZvc0NvbnRleHQpKS0+cEhERENvbnRleHQ7CisgICAgaWYgKCFwSGRkQ3R4KQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiJXM6IGhkZCBjb250ZXh0IGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyNpZmRlZiBXTEFOX0tEX1JFQURZX05PVElGSUVSCisgICAgLyogTkwgaXMgbm90IHJlYWR5IHlldCwgV0xBTiBLTyBzdGFydGVkIGZpcnN0ICovCisgICAgaWYgKChwSGRkQ3R4LT5rZF9ubF9pbml0KSAmJiAoIXBIZGRDdHgtPnB0dF9waWQpKQorICAgIHsKKyAgICAgICAgbmxfc3J2X25sX3JlYWR5X2luZGljYXRpb24oKTsKKyAgICB9CisjZW5kaWYgLyogV0xBTl9LRF9SRUFEWV9OT1RJRklFUiAqLworICAgIAorICAgIGlmIChubF9zcnZfaXNfaW5pdGlhbGl6ZWQoKSAhPSAwKQorICAgICAgICByZXR1cm47CisKKyAgICAvKiBTZW5kIHRoZSBsb2cgZGF0YSB0byB0aGUgcHR0IGFwcCBvbmx5IGlmIGl0IGlzIHJlZ2lzdGVyZWQgd2l0aCB0aGUgd2xhbiBkcml2ZXIqLworICAgIGlmKHZvc19pc19tdWx0aWNhc3RfbG9nZ2luZygpKQorICAgIHsKKyAgICAgICAgdG90YWxfbGVuID0gc2l6ZW9mKHRBbmlIZHIpK3NpemVvZihldmVudF9yZXBvcnRfdCkrbGVuZ3RoOworICAgICAgICAKKyAgICAgICAgcEJ1ZiA9ICAodl9VOF90Kil2b3NfbWVtX21hbGxvYyh0b3RhbF9sZW4pOworICAgIAorICAgICAgICBpZighcEJ1ZikKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJ2b3NfbWVtX21hbGxvYyBmYWlsZWQiKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICB3bXNnID0gKHRBbmlIZHIqKXBCdWY7CisgICAgICAgIHdtc2ctPnR5cGUgPSBQVFRfTVNHX0RJQUdfQ01EU19UWVBFOworICAgICAgICB3bXNnLT5sZW5ndGggPSB0b3RhbF9sZW47CisgICAgICAgIHdtc2ctPmxlbmd0aCA9IERJQUdfU1dBUDE2KHdtc2ctPmxlbmd0aCk7CisgICAgICAgIHBCdWYgKz0gc2l6ZW9mKHRBbmlIZHIpOworICAgIAorICAgICAgICBwRXZlbnRfcmVwb3J0ID0gKGV2ZW50X3JlcG9ydF90KilwQnVmOworICAgICAgICBwRXZlbnRfcmVwb3J0LT5kaWFnX3R5cGUgPSBESUFHX1RZUEVfRVZFTlRTOworICAgICAgICBwRXZlbnRfcmVwb3J0LT5ldmVudF9pZCA9IGV2ZW50X0lkOworICAgICAgICBwRXZlbnRfcmVwb3J0LT5sZW5ndGggPSBsZW5ndGg7CisgICAgCisgICAgICAgIHBCdWYgKz0gc2l6ZW9mKGV2ZW50X3JlcG9ydF90KTsgCisgICAgCisgICAgICAgIHZvc19tZW1fY29weShwQnVmLCBwUGF5bG9hZCxsZW5ndGgpOworICAgICAgCisgICAgICAgIGlmKCBwdHRfc29ja19zZW5kX21zZ190b19hcHAod21zZywgMCwKKyAgICAgICAgICAgICAgICAgICAgIEFOSV9OTF9NU0dfUFVNQUMsIElOVkFMSURfUElELCBNU0dfRE9OVFdBSVQpIDwgMCkgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICgiUHR0IFNvY2tldCBlcnJvciBzZW5kaW5nIG1lc3NhZ2UgdG8gdGhlIGFwcCEhIikpOworICAgICAgICAgICAgdm9z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4gdGhpcyBmaWxlIGFyZSB1c2VkIGZvcgorICAgICAgICAgICAgICAgIGluaXRpYWxpemluZywgc2V0dGluZywgcmVzZXR0aW5nLCBkZXN0cm95aW5nIGFuIGV2ZW50IGFuZAorICAgICAgICAgICAgICAgIHdhaXRpbmcgb24gYW4gb2NjdXJhbmNlIG9mIGFuIGV2ZW50IGFtb25nIG11bHRpcGxlIGV2ZW50cy4KKworICBERVBFTkRFTkNJRVM6CisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRURJVCBISVNUT1JZIEZPUiBNT0RVTEUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICogSW5jbHVkZSBGaWxlcworICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisjaW5jbHVkZSAidm9zX2V2ZW50LmgiCisjaW5jbHVkZSAidm9zX3RyYWNlLmgiCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICogUHJlcHJvY2Vzc29yIERlZmluaXRpb25zIGFuZCBDb25zdGFudHMKKyAqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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FX0ZBVUxUOworICAgfQorCisgICAvLyBjaGVjayBmb3IgbnVsbCBwb2ludGVyCisgICBpZiAoIE5VTEwgPT0gZXZlbnQgKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICJOVUxMIGV2ZW50IHBhc3NlZCBpbnRvICVzIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICB9CisKKyAgIC8vIGNoZWNrIGlmIGNvb2tpZSBpcyBzYW1lIGFzIHRoYXQgb2YgaW5pdGlhbGl6ZWQgZXZlbnQKKyAgIGlmICggTElOVVhfRVZFTlRfQ09PS0lFICE9IGV2ZW50LT5jb29raWUgKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICJVbmluaXRpYWxpemVkIGV2ZW50IHBhc3NlZCBpbnRvICVzIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICB9CisKKyAgIGlmICh0aW1lb3V0KQorICAgeworICAgICAgbG9uZyByZXQ7CisgICAgICByZXQgPQorICAgICAgICAgd2FpdF9mb3JfY29tcGxldGlvbl90aW1lb3V0KCZldmVudC0+Y29tcGxldGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKHRpbWVvdXQpKTsKKyAgICAgIGlmICggMCA+PSByZXQgKQorICAgICAgeworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX1RJTUVPVVQ7CisgICAgICB9CisgICB9CisgICBlbHNlCisgICB7CisgICAgICBpbnQgcmV0OworICAgICAg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TkFSWV9JRF9DT05GSUc6CisgICAgICAgICAgIHBGaWxlTmFtZSA9IFdMQU5fQ0ZHX0ZJTEU7CisgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFZPU19CSU5BUllfSURfQ09VTlRSWV9JTkZPOgorICAgICAgICAgICBwRmlsZU5hbWUgPSBXTEFOX0NPVU5UUllfSU5GT19GSUxFOworICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBWT1NfQklOQVJZX0lEX0hPX0NPTkZJRzoKKyAgICAgICAgICAgcEZpbGVOYW1lID0gV0xBTl9IT19DRkdfRklMRTsKKyAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgVk9TX0JJTkFSWV9JRF9ESUNUX0NPTkZJRzoKKyAgICAgICAgICAgcEZpbGVOYW1lID0gV0xBTl9ESUNUX0ZJTEU7CisgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJJbnZhbGlkIGJpbmFyeUlEIik7CisgICAgICAgICAgIHJldHVybiBWb3NTdHM7CisgICAgfQorICAgIGlmKDAgPT0gKnBCdWZmZXJTaXplICkKKyAgICB7CisgICAgICAgLyogIGp1c3QgYSBmaWxlIHNpemUgcmVxdWVzdC4gIHNldCB0aGUgdmFsdWUgYW5kIHJldHVybiAgVk9TX1NUQVRVU19FX05PTUVNKi8KKyAgICAgICBWb3NTdHMgPSBoZGRfZ2V0X2NmZ19maWxlX3NpemUoKChWb3NDb250ZXh0VHlwZSopKHBWb3NDb250ZXh0KSktPnBIRERDb250ZXh0LHBGaWxlTmFtZSxwQnVmZmVyU2l6ZSk7CisKKyAgICAgICBpZiAoICFWT1NfSVNfU1RBVFVTX1NVQ0NFU1MoIFZvc1N0cyApKQorICAgICAgIHsKKyAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXMgOiB2b3Nfb3BlbiBmYWlsZWQiLF9fZnVuY19fKTsKKworICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICAgICB9CisgICAgICAgVm9zU3RzID0gVk9TX1NUQVRVU19FX05PTUVNOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgIGlmKE5VTEwgIT0gcEJ1ZmZlcikgeworICAgICAgICAgIC8vIHJlYWQgdGhlIGNvbnRlbnRzIGludG8gdGhlIGJ1ZmZlcgorICAgICAgICAgIFZvc1N0cyA9IGhkZF9yZWFkX2NmZ19maWxlKCgoVm9zQ29udGV4dFR5cGUqKShwVm9zQ29udGV4dCkpLT5wSEREQ29udGV4dCxwRmlsZU5hbWUscEJ1ZmZlcixwQnVmZmVyU2l6ZSk7CisgICAgICAgfQorICAgICAgIGVsc2UgeworICAgICAgICAgICAgIFZvc1N0cyA9IFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gVm9zU3RzOworfQorCisKK3RWT1NfQ09OX01PREUgdm9zX2dldF9jb25wYXJhbSggdm9pZCApCit7CisgICAgdFZPU19DT05fTU9ERSBjb25fbW9kZTsKKyAgICBjb25fbW9kZSA9IGhkZF9nZXRfY29ucGFyYW0gKCApOworICAgIHJldHVybiBjb25fbW9kZTsKK30KK3RWT1NfQ09OQ1VSUkVOQ1lfTU9ERSB2b3NfZ2V0X2NvbmN1cnJlbmN5X21vZGUoIHZvaWQgKQoreworICAgIHRWT1NfQ09OQ1VSUkVOQ1lfTU9ERSBjb25fbW9kZTsKKyAgICBjb25fbW9kZSA9IGhkZF9nZXRfY29uY3VycmVuY3lfbW9kZSAoICk7CisgICAgcmV0dXJuIGNvbl9tb2RlOworfQorCit2X0JPT0xfdCB2b3NfY29uY3VycmVudF9vcGV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UkNIQU5UQUJJTElUWSBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFCisgKiBBVVRIT1IgQkUgTElBQkxFIEZPUiBBTlkgU1BFQ0lBTCwgRElSRUNULCBJTkRJUkVDVCwgT1IgQ09OU0VRVUVOVElBTAorICogREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NIExPU1MgT0YgVVNFLCBEQVRBIE9SCisgKiBQUk9GSVRTLCBXSEVUSEVSIElOIEFOIEFDVElPTiBPRiBDT05UUkFDVCwgTkVHTElHRU5DRSBPUiBPVEhFUgorICogVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICB2b3NfbGlzdC5jCisKKyAgXGJyaWVmCisKKyAgRGVzY3JpcHRpb24uLi4KKworCisKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09KiovCisvKiAkSEVBREVSJCAqLworCisvKiotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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tLS0tLS0tLS0tKi8KK1ZPU19TVEFUVVMgdm9zX2xpc3RfaW5pdCggdm9zX2xpc3RfdCAqcExpc3QgKQoreworICAgaWYgKCBwTGlzdCA9PSBOVUxMKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogTlVMTCBwb2ludGVyIHBhc3NlZCBpbiIsIF9fZnVuY19fKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICB9CisKKyAgIGlmICggcExpc3QtPmNvb2tpZSA9PSBWT1NfTElTVF9DT09LSUUgKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogYWxyZWFkeSBpbml0aWFsaXplZCBsaXN0IiwgX19mdW5jX18pOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9CVVNZOworICAgfQorCisgICBtdXRleF9pbml0KCZwTGlzdC0+bG9jayk7CisKKyAgIElOSVRfTElTVF9IRUFEKCAmcExpc3QtPmFuY2hvciApOworCisgICBwTGlzdC0+Y291bnQgPSAwOworICAgcExpc3QtPmNvb2tpZSA9IFZPU19MSVNUX0NPT0tJRTsKKworICAgcmV0dXJuKCBWT1NfU1RBVFVTX1NVQ0NFU1MgKTsKK30KKworCitWT1NfU1RBVFVTIHZvc19saXN0X2Rlc3Ryb3koIHZvc19saXN0X3QgKnBMaXN0ICkKK3sKKyAgIGludCByYzsKKyAgIGlmIChwTGlzdCA9PSBOVUxMKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogTlVMTCBwb2ludGVyIHBhc3NlZCBpbiIsIF9fZnVuY19fKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICB9CisKKyAgIGlmICggcExpc3QtPmNvb2tpZSAhPSBWT1NfTElTVF9DT09LSUUgKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogbGlzdCBub3QgaW5pdGlhbGl6ZWQiLCBfX2Z1bmNfXyk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICByYyA9IG11dGV4X2xvY2tfaW50ZXJydXB0aWJsZSgmcExpc3QtPmxvY2spOworICAgaWYgKHJjKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogdW5hYmxlIHRvIGxvY2sgbGlzdCIsIF9fZnVuY19fKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICB9CisKKyAgIGlmICggcExpc3QtPmNvdW50ICE9MCApCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOiBsaXN0IGxlbmd0aCBub3QgZXF1YWwgdG8gemVybyIsIF9fZnVuY19fKTsKKyAgICAgIG11dGV4X3VubG9jaygmcExpc3QtPmxvY2spOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9CVVNZOworICAgfQorCisgICAvLyBjbGVhciB0aGUgY29va2llLiBUaGlzIGluZGljYXRlcyB0aGUgbGlzdCBpcyBkZXN0cm95ZWQuCisgICBwTGlzdC0+Y29va2llID0gMDsKKyAgIG11dGV4X3VubG9jaygmcExpc3QtPmxvY2spOworCisgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfQorCisKK1ZPU19TVEFUV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JldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9CisKK1ZPU19TVEFUVVMgdm9zX2xpc3RfaW5zZXJ0X2JhY2soIHZvc19saXN0X3QgKnBMaXN0LCB2b3NfbGlzdF9ub2RlX3QgKnBOb2RlICkKK3sKKyAgIGludCByYzsKKworICAgaWYgKCAoIHBMaXN0ID09IE5VTEwpIHx8ICggcE5vZGUgPT0gTlVMTCkgKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogTlVMTCBwb2ludGVyIHBhc3NlZCBpbiIsIF9fZnVuY19fKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICB9CisKKyAgIGlmICggcExpc3QtPmNvb2tpZSAhPSBWT1NfTElTVF9DT09LSUUgKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogbGlzdCBub3QgaW5pdGlhbGl6ZWQiLCBfX2Z1bmNfXyk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICByYyA9IG11dGV4X2xvY2tfaW50ZXJydXB0aWJsZSgmcExpc3QtPmxvY2spOworICAgaWYgKHJjKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogdW5hYmxlIHRvIGxvY2sgbGlzdCIsIF9fZnVuY19fKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICB9CisKKyAgIGxpc3RfYWRkX3RhaWwoIHBOb2RlLCAmcExpc3QtPmFuY2hvciApOworCisgICBwTGlzdC0+Y291bnQrKzsKKyAgIG11dGV4X3VubG9jaygmcExpc3QtPmxvY2spOworCisgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfQorCisKK1ZPU19TVEFUVVMgdm9zX2xpc3RfaW5zZXJ0X2JhY2tfc2l6ZSggdm9zX2xpc3RfdCAqcExpc3QsIHZvc19saXN0X25vZGVfdCAqcE5vZGUsIHZfU0laRV90ICpwU2l6ZSApCit7CisgICBpbnQgcmM7CisgICBpZiAoICggcExpc3QgPT0gTlVMTCkgfHwgKCBwTm9kZSA9PSBOVUxMKSB8fCAocFNpemUgPT0gTlVMTCkgKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogTlVMTCBwb2ludGVyIHBhc3NlZCBpbiIsIF9fZnVuY19fKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICB9CisKKyAgIGlmICggcExpc3QtPmNvb2tpZSAhPSBWT1NfTElTVF9DT09LSUUgKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogbGlzdCBub3QgaW5pdGlhbGl6ZWQiLCBfX2Z1bmNfXyk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICByYyA9IG11dGV4X2xvY2tfaW50ZXJydXB0aWJsZSgmcExpc3QtPmxvY2spOworICAgaWYgKHJjKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogdW5hYmxlIHRvIGxvY2sgbGlzdCIsIF9fZnVuY19fKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICB9CisKKyAgIGxpc3RfYWRkX3RhaWwoI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gfQorCisgICByYyA9IG11dGV4X2xvY2tfaW50ZXJydXB0aWJsZSgmcExpc3QtPmxvY2spOworICAgaWYgKHJjKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogdW5hYmxlIHRvIGxvY2sgbGlzdCIsIF9fZnVuY19fKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICB9CisKKyAgIGlmICggbGlzdF9lbXB0eSggJnBMaXN0LT5hbmNob3IgKSApCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICIlczogbGlzdCBlbXB0eSIsIF9fZnVuY19fKTsKKyAgICAgIG11dGV4X3VubG9jaygmcExpc3QtPmxvY2spOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9FTVBUWTsKKyAgIH0KKworICAgbGlzdHB0ciA9IHBMaXN0LT5hbmNob3IubmV4dDsKKworICAgKnBwTm9kZSA9IGxpc3RwdHI7CisKKyAgIGxpc3RfZGVsKHBMaXN0LT5hbmNob3IubmV4dCk7CisKKyAgIHBMaXN0LT5jb3VudC0tOworICAgbXV0ZXhfdW5sb2NrKCZwTGlzdC0+bG9jayk7CisgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfQorCisKKworVk9TX1NUQVRVUyB2b3NfbGlzdF9yZW1vdmVfYmFjayggdm9zX2xpc3RfdCAqcExpc3QsIHZvc19saXN0X25vZGVfdCAqKnBwTm9kZSApCit7CisgICBzdHJ1Y3QgbGlzdF9oZWFkICogbGlzdHB0cjsKKyAgIGludCByYzsKKworICAgLy8gdGhlIGFzc3VtcHRpb24gaGVyZSBpcyB0aGF0IHBMaXN0IGlzIHRoZSBoZWFkIG9mIHRoZSBsaXN0IChkdW1teSB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gICAgIiVzOiBsaXN0IGVtcHR5IiwgX19mdW5jX18pOworICAgICAgbXV0ZXhfdW5sb2NrKCZwTGlzdC0+bG9jayk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0VNUFRZOworICAgfQorCisgICBsaXN0cHRyID0gcExpc3QtPmFuY2hvci5wcmV2OworCisgICAqcHBOb2RlID0gbGlzdHB0cjsKKworICAgbGlzdF9kZWwocExpc3QtPmFuY2hvci5wcmV2KTsKKworICAgcExpc3QtPmNvdW50LS07CisgICBtdXRleF91bmxvY2soJnBMaXN0LT5sb2NrKTsKKworICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworVk9TX1NUQVRVUyB2b3NfbGlzdF9zaXplKCB2b3NfbGlzdF90ICpwTGlzdCwgdl9TSVpFX3QgKnBTaXplICkKK3sKKyAgIGludCByYzsKKyAgIGlmICggKCBwTGlzdCA9PU5VTEwpIHx8ICggcFNpemUgPT0gTlVMTCkgKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogTlVMTCBwb2ludGVyIHBhc3NlZCBpbiIsIF9fZnVuY19fKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICB9CisKKyAgIGlmICggcExpc3QtPmNvb2tpZSAhPSBWT1NfTElTVF9DT09LSUUgKQorICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBsaXN0IG5vdCBpbml0aWFsaXplZCIsIF9fZnVuY19fKTsKKyAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICByYyA9IG11dGV4X2xvY2tfaW50ZXJydXB0aWJsZSgmcExpc3QtPmxvY2spOworICAgaWYgKHJjKQor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pc3RfcGVla19uZXh0KCB2b3NfbGlzdF90ICpwTGlzdCwgdm9zX2xpc3Rfbm9kZV90ICpwTm9kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbGlzdF9ub2RlX3QgKipwcE5vZGUgKQoreworICAgc3RydWN0IGxpc3RfaGVhZCAqIGxpc3RwdHI7CisgICBpbnQgcmMsIGZvdW5kID0gMDsKKyAgIHZvc19saXN0X25vZGVfdCAqdG1wOworCisgICBpZiAoICggcExpc3QgPT0gTlVMTCkgfHwgKCBwTm9kZSA9PSBOVUxMKSB8fCAocHBOb2RlID09IE5VTEwpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogTlVMTCBwb2ludGVyIHBhc3NlZCBpbiIsIF9fZnVuY19fKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICB9CisKKyAgIGlmICggcExpc3QtPmNvb2tpZSAhPSBWT1NfTElTVF9DT09LSUUgKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogbGlzdCBub3QgaW5pdGlhbGl6ZWQiLCBfX2Z1bmNfXyk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICByYyA9IG11dGV4X2xvY2tfaW50ZXJydXB0aWJsZSgmcExpc3QtPmxvY2spOworICAgaWYgKHJjKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogdW5hYmxlIHRvIGxvY2sgbGlzdCIsIF9fZnVuY19fKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICB9CisKKyAgIGlmICggbGlzdF9lbXB0eSgmcExpc3QtPmFuY2hvcikgKQorICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAiJXM6IGxpc3QgZW1wdHkiLCBfX2Z1bmNfXyk7CisgICAgICAgbXV0ZXhfdW5sb2NrKCZwTGlzdC0+bG9jayk7CisgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9FTVBUWTsKKyAgIH0KKworICAgLy8gdmVyaWZ5IHRoYXQgcE5vZGUgaXMgaW5kZWVkIHBhcnQgb2YgbGlzdCBwTGlzdAorICAgbGlzdF9mb3JfZWFjaCh0bXAsICZwTGlzdC0+YW5jaG9yKQorICAgeworICAgICAgaWYgKHRtcCA9PSBwTm9kZSkKKyAgICAgIHsKKyAgICAgICAgIGZvdW5kID0gMTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgfQorICAgaWYgKGZvdW5kID09IDApCisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworCisgICBsaXN0cHRyID0gcE5vZGUtPm5leHQ7CisgICBpZiAobGlzdHB0ciA9PSAmcExpc3QtPmFuY2hvcikKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICIlczogbGlzdCBlbXB0eSIsIF9fZnVuY19fKTsKKyAgICAgIG11dGV4X3VubG9jaygmcExpc3QtPmxvY2spOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9FTVBUWTsKKyAgIH0KKworICAgKnBwTm9kZSA9ICBsaXN0cHRyOworICAgbXV0ZXhfdW5sb2NrKCZwTGlzdC0+bG9jayk7CisKKyAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9CisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tL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ywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogbGlzdCBub3QgaW5pdGlhbGl6ZWQiLCBfX2Z1bmNfXyk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICByYyA9IG11dGV4X2xvY2tfaW50ZXJydXB0aWJsZSgmcExpc3QtPmxvY2spOworICAgaWYgKHJjKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogdW5hYmxlIHRvIGxvY2sgbGlzdCIsIF9fZnVuY19fKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICB9CisKKyAgIGlmICggbGlzdF9lbXB0eSgmcExpc3QtPmFuY2hvcikgKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgIiVzOiBsaXN0IGVtcHR5IiwgX19mdW5jX18pOworICAgICAgbXV0ZXhfdW5sb2NrKCZwTGlzdC0+bG9jayk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0VNUFRZOworICAgfQorCisgICAvLyB2ZXJpZnkgdGhhdCBwTm9kZSBpcyBpbmRlZWQgcGFydCBvZiBsaXN0IHBMaXN0CisgICBsaXN0X2Zvcl9lYWNoKHRtcCwgJnBMaXN0LT5hbmNob3IpCisgICB7CisgICAgICBpZiAodG1wID09IHBOb2RlKQorICAgICAgeworICAgICAgICAgZm91bmQgPSAxOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICB9CisgICBpZiAoZm91bmQgPT0gMCkKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfSU5WQUw7CisKKyAgIGxpc3RwdHIgPSBwTm9kZS0+cHJldjsKKworICAgaWYgKGxpc3RwdHIgPT0gJ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Rk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsIElORElSRUNULCBPUiBDT05TRVFVRU5USUFMCisgKiBEQU1BR0VTIE9SIEFOWSBEQU1BR0VTIFdIQVRTT0VWRVIgUkVTVUxUSU5HIEZST00gTE9TUyBPRiBVU0UsIERBVEEgT1IKKyAqIFBST0ZJVFMsIFdIRVRIRVIgSU4gQU4gQUNUSU9OIE9GIENPTlRSQUNULCBORUdMSUdFTkNFIE9SIE9USEVSCisgKiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SCisgKiBQRVJGT1JNQU5DRSBPRiBUSElTIFNPRlRXQVJFLgorICovCisKKy8qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRklMRTogICAgICAgICB2b3NfbG9jay5jCisKKyAgT1ZFUlZJRVc6ICAgICBUaGlzIHNvdXJjZSBmaWxlIGNvbnRhaW5zIGRlZmluaXRpb25zIGZvciB2T1MgbG9jayBBUElzCisgICAgICAgICAgICAgICAgVGhlIGZvdXIgQVBJcyBtZW50aW9uZWQgaW4gdGhpcyBmaWxlIGFyZSB1c2VkIGZvciAKKyAgICAgICAgICAgICAgICBpbml0aWFsaXppbmcgLCBhY3F1aXJpbmcsIHJlbGVhc2luZyBhbmQgZGVzdHJveWluZyBhIGxvY2suCisgICAgICAgICAgICAgICAgdGhlIGxvY2sgYXJlIGltcGxlbWVudGVkIHVzaW5nIGNyaXRpY2FsIHNlY3Rpb25zCisKKyAgREVQRU5ERU5DSUVTOiAKKyAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRURJVCBISVNUT1JZIEZPUiBNT0RVTEUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICogSW5jbHVkZSBGaWxlcworICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisKKyNpbmNsdWRlICJ2b3NfbG9jay5oIgorI2luY2x1ZGUgInZvc19tZW1vcnkuaCIKKyNpbmNsdWRlICJ2b3NfdHJhY2UuaCIKKyNpbmNsdWRlICJpX3Zvc19kaWFnX2NvcmVfZXZlbnQuaCIKKyNpbmNsdWRlICJ2b3NfZGlhZ19jb3JlX2V2ZW50LmgiCisjaW5jbHVkZSA8bGludXgvd2Nuc3Nfd2xhbi5oPgorCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICogUHJlcHJvY2Vzc29yIERlZmluaXRpb25zIGFuZCBDb25zdGFudHMKKyAqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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hbGl6ZWQgbG9jayBvYmplY3QuCisgICAgICAgICAgCisgICAgICAgICAgVk9TX1NUQVRVU19FX0ZBVUxUICAtIGxvY2sgaXMgYW4gaW52YWxpZCBwb2ludGVyLiAKKworICAgICAgICAgIFZPU19TVEFUVVNfRV9GQUlMVVJFIC0gZGVmYXVsdCByZXR1cm4gdmFsdWUgaWYgaXQgZmFpbHMgZHVlIHRvIAorICAgICAgICAgIHVua25vd24gcmVhc29ucworICAgICAgICAgIAorICBcc2EKKyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KK1ZPU19TVEFUVVMgdm9zX2xvY2tfYWNxdWlyZSAoIHZvc19sb2NrX3QqIGxvY2sgKQoreworICAgICAgaW50IHJjOworICAgICAgLy9DaGVjayBmb3IgaW52YWxpZCBwb2ludGVyCisgICAgICBpZiAoIGxvY2sgPT0gTlVMTCApCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogTlVMTCBwb2ludGVyIHBhc3NlZCBpbiIsX19mdW5jX18pOworICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICAgIH0KKyAgICAgIC8vIGNoZWNrIGlmIGxvY2sgcmVmZXJzIHRvIGFuIGluaXRpYWxpemVkIG9iamVjdAorICAgICAgaWYgKCBMSU5VWF9MT0NLX0NPT0tJRSAhPSBsb2NrLT5jb29raWUgKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IHVuaW5pdGlhbGl6ZWQgbG9jayIsX19mdW5jX18pOworICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgICAgIH0KKworICAgICAgaWYgKGluX2ludGVycnVwdCgpKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXMgY2Fubm90IGJlIGNhbGxlZCBmcm9tIGludGVycnVwdCBjb250ZXh0ISEhIiwgX19mdW5jX18pOworICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsgCisgICAgICB9CisgICAgICBpZiAoKGxvY2stPnByb2Nlc3NJRCA9PSBjdXJyZW50LT5waWQpICYmIAorICAgICAgICAgIChsb2NrLT5zdGF0ZSA9PSBMT0NLX0FDUVVJUkVEKSkKKyAgICAgIHsKKyAgICAgICAgIGxvY2stPnJlZmNvdW50Kys7CisjaWZkZWYgVk9TX05FU1RFRF9MT0NLX0RFQlVHCisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywiJXM6ICV4ICVkICVkIiwgX19mdW5jX18sIGxvY2ssIGN1cnJlbnQtPnBpZCwgbG9jay0+cmVmY291bnQpOworI2VuZGlmCisgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgfQorICAgICAgLy8gQWNxdWlyZSBhIExvY2sKKyAgICAgIG11dGV4X2xvY2soICZsb2NrLT5tX2xvY2sgKTsKKyAgICAgIHJjID0gbXV0ZXhfaXNfbG9ja2VkKCAmbG9jay0+bV9sb2NrICk7CisgICAgICBpZiAocmMgPT0gMCkKKyAgICAgIHsKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IHVuYWJsZSB0byBsb2NrIG11dGV4IChyYyA9ICVkKSIsIF9fZnVuY19fLCByYyk7CisgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7C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k9TX1NUQVRVUyB2b3NfbG9ja19yZWxlYXNlICggdm9zX2xvY2tfdCAqbG9jayApCit7CisgICAgICAvL0NoZWNrIGZvciBpbnZhbGlkIHBvaW50ZXIKKyAgICAgIGlmICggbG9jayA9PSBOVUxMICkKKyAgICAgIHsKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIiVzOiBOVUxMIHBvaW50ZXIgcGFzc2VkIGluIixfX2Z1bmNfXyk7CisgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgICAgfQorCisgICAgICAvLyBjaGVjayBpZiBsb2NrIHJlZmVycyB0byBhbiB1bmluaXRpYWxpemVkIG9iamVjdAorICAgICAgaWYgKCBMSU5VWF9MT0NLX0NPT0tJRSAhPSBsb2NrLT5jb29raWUgKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXM6IHVuaW5pdGlhbGl6ZWQgbG9jayIsX19mdW5jX18pOworICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgICAgIH0KKworICAgICAgaWYgKGluX2ludGVycnVwdCgpKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiJXMgY2Fubm90IGJlIGNhbGxlZCBmcm9tIGludGVycnVwdCBjb250ZXh0ISEhIiwgX19mdW5jX18pOworICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsgCisgICAgICB9CisKKyAgICAgIC8vIEN1cnJlbnRUaHJlYWQgPSBHZXRDdXJyZW50VGhyZWFkSWQoKTsgCisgICAgICAvLyBDaGVjayB0aHJlYWQgSUQgb2YgY2FsbGVyIGFnYWluc3QgdGhyZWFkIElECisgICAg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cm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQGZpbGUgdm9zX21lbW9yeS5jCisKKyAgQGJyaWVmIFZpcnR1YWwgT3BlcmF0aW5nIFN5c3RlbSBTZXJ2aWNlcyBNZW1vcnkgQVBJCisKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAKKyAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFIAorICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLiAKKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4gCisgICAKKyAgIAorICAkSGVhZGVyOiQgJERhdGVUaW1lOiAkICRBdXRob3I6ICQgCisgICAKKyAgIAorICB3aGVuICAgICAgICB3aG8gICAgd2hhdCwgd2hlcmUsIHdoeSAKKyAgLS0tLS0tLS0gICAgLS0tICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisjaWZkZWYgTUVNT1JZX0RFQlVHCit2b2lkIHZvc19tZW1faW5pdCgpCit7CisgICAvKiBJbml0YWxpemluZyB0aGUgbGlzdCB3aXRoIG1heGltdW0gc2l6ZSBvZiA2MDAwMCAqLworICAgaGRkX2xpc3RfaW5pdCgmdm9zTWVtTGlzdCwgNjAwMDApOyAgCisgICBtZW1vcnlfZGJ1Z19mbGFnID0gMTsKKyAgIHJldHVybjsgCit9CisKK3ZvaWQgdm9zX21lbV9jbGVhbigpCit7CisgICAgdl9TSVpFX3QgbGlzdFNpemU7CisgICAgaGRkX2xpc3Rfc2l6ZSgmdm9zTWVtTGlzdCwgJmxpc3RTaXplKTsKKworICAgIGlmKGxpc3RTaXplKQorICAgIHsKKyAgICAgICBoZGRfbGlzdF9ub2RlX3QqIHBOb2RlOworICAgICAgIFZPU19TVEFUVVMgdm9zU3RhdHVzOworCisgICAgICAgc3RydWN0IHNfdm9zX21lbV9zdHJ1Y3QqIG1lbVN0cnVjdDsKKyAgICAgICBjaGFyKiBwcmV2X21sZWFrX2ZpbGUgPSAiIjsKKyAgICAgICB1bnNpZ25lZCBpbnQgcHJldl9tbGVha19saW5lTnVtID0gMDsKKyAgICAgICB1bnNpZ25lZCBpbnQgcHJldl9tbGVha19zeiA9IDA7CisgICAgICAgdW5zaWduZWQgaW50IG1sZWFrX2NudCA9IDA7CisgCisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICIlczogTGlzdCBpcyBub3QgRW1wdHkuIGxpc3RTaXplICVkICIsIF9fZnVuY19fLCAoaW50KWxpc3RTaXplKTsKKworICAgICAgIGRvCisgICAgICAgeworICAgICAgICAgIHNwaW5fbG9jaygmdm9zTWVtTGlzdC5sb2NrKTsKKyAgICAgICAgICB2b3NTdGF0dXMgPSBoZGRfbGlzdF9yZW1vdmVfZnJvbnQoJnZvc01lbUxpc3QsICZwTm9kZSk7CisgICAgICAgICAgc3Bpbl91bmxvY2soJnZvc01lbUxpc3QubG9jayk7CisgICAgICAgICAgaWYoVk9TX1NUQVRVU19TVUNDRVNTID09IHZvc1N0YXR1cykKKyAgICAgICAgICB7CisgICAgICAgICAgICAgbWVtU3RydWN0ID0gKHN0cnVjdCBzX3Zvc19tZW1fc3RydWN0KilwTm9kZTsKKworICAgICAgICAgICAgIC8qIFRha2UgY2FyZSB0byBsb2cgb25seSBvbmNlIG11bHRpcGxlIG1lbW9yeSBsZWFrcyBmcm9tCisgICAgICAgICAgICAgICogdGhlIHNhbWUgcGxhY2UgKi8KKyAgICAgICAgICAgICBpZihzdHJjbXAocHJldl9tbGVha19maWxlLCBtZW1TdHJ1Y3QtPmZpbGVOYW1lKSB8fAorICAgICAgICAgICAgICAgIChwcmV2X21sZWFrX2xpbmVOdW0gIT0gbWVtU3RydWN0LT5saW5lTnVtKSB8fAorICAgICAgICAgICAgICAgIChwcmV2X21sZWFrX3N6ICE9ICBtZW1TdHJ1Y3QtPnNpemUpKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZihtbGVha19jbnQgIT0gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICAgICIlZCBUaW1lIE1lbW9yeSBMZWFrQCBGaWxlICVzLCBATGluZSAlZCwgc2l6ZSAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgbWxlYWtfY250LCBwcmV2X21sZWFrX2ZpbGUsIHByZXZfbWxlYWtfbGluZU51bSwKKyAgICAgICAgICAgICAgICAgICAgICBwcmV2X21sZWFrX3N6KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcHJldl9tbGVha19maWxlID0gbWVtU3RydWN0LT5maWxlTmFtZTsKKyAgICAgICAgICAgICAgICBwcmV2X21sZWFrX2xpbmVOdW0gPSBtZW1TdHJ1Y3QtPmxpbmVOdW07CisgICAgICAgICAgICAgICAgcHJldl9tbGVha19zeiA9ICBtZW1TdHJ1Y3QtPnNpemU7CisgICAgICAgICAgICAgICAgbWxlYWtfY250ID0gMDsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgICAgbWxlYWtfY250Kys7CisKKyAgICAgICAgICAgICBrZnJlZSgodl9WT0lEX3QqKW1lbVN0cnVjdCk7CisgICAgICAgICAgfQorICAgICAgIH13aGlsZSh2b3NTdGF0dXMgPT0gVk9TX1NUQVRVU19TVUNDRVNTKTsKKworICAgICAgIC8qIFByaW50IGxhc3QgbWVtb3J5IGxlYWsgZnJvbSB0aGUgbW9kdWxlICovCisgICAgICAgaWYobWxlYWtfY250KQorICAgICAgIHsKKyAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgICAgIiVkIFRpbWUgbWVtb3J5IExlYWtAIEZpbGUgJXMsIEBMaW5lICVkLCBzaXplICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICBtbGVha19jbnQsIHByZXZfbWxlYWtfZmlsZSwgcHJldl9tbGVha19saW5lTnVtLAorICAgICAgICAgICAgICAgICAgICAgIHByZXZfbWxlYWtfc3opOworICAgICAgIH0KKworCisjaWZkZWYgQ09ORklHX0hBTFRfS01FTUxFQUsKKyAgICAgICBCVUdfT04oMCk7CisjZW5kaWYKKyAgICB9Cit9CisKK3ZvaWQgdm9zX21lbV9leGl0KCkKK3sKKyAgICBpZiAobWVtb3J5X2RidWdfZmxhZykKKyAgICB7CisgICAgICAgdm9zX21lbV9jbGVhbigpOworICAgICAgIGhkZF9saXN0X2Rlc3Ryb3koJnZvc01lbUxpc3QpOworICAgIH0KK30KKwordl9WT0lEX3QgKiB2b3NfbWVtX21hbGxvY19kZWJ1Zyggdl9TSVpFX3Qgc2l6ZSwgY2hhciogZmlsZU5hbWUsIHZfVTMyX3QgbGluZU51bSkKK3sKKyAgIHN0cnVjdCBzX3Zvc19tZW1fc3RydWN0KiBtZW1TdHJ1Y3Q7CisgICB2X1ZPSURfdCogbWVtUHRyID0gTlVMTDsKKyAgIHZfU0laRV90IG5ld19zaXplOworICAgaW50IGZsYWdzID0gR0ZQX0tFUk5FTDsKKyAgIHVuc2lnbmVkIGxvbmcgSXJxRmxhZ3M7CisgICB1bnNpZ25lZCBsb25nICB0aW1lX2JlZm9yZV9rbWFsbG9jOworCisKKyAgIGlmIChzaXplID4gKDEwMjQqMTAyNCkgfHwgc2l6ZSA9PSAwKQorICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICIlczogY2FsbGVkIHdpdGggaW52YWxpZCBhcmcgJXUgISEhIiwgX19mdW5jX18sIHNpemUpOworICAgICAgIHJldHVybiBOVUxMOworICAgfQorCisgICBpZiAoaW5faW50ZXJydXB0KCkgfHwgaXJxc19kaXNhYmxlZCgpIHx8IGluX2F0b21pYygpKQorICAgeworICAgICAgZmxhZ3MgPSBHRlBfQVRPTUlDOworICAgfQorCisgICBpZiAoIW1lbW9yeV9kYnVnX2ZsYWcpCisgICB7CisjaWZkZWYgQ09ORklHX1dDTlNTX01FTV9QUkVfQUxMT0MKKyAgICAgIHZfVk9JRF90KiBwbWVtOworICAgICAgaWYgKHNpemUgPiBXQ05TU19QUkVfQUxMT0NfR0VUX1RIUkVTSE9MRCkKKyAgICAgIHsKKyAgICAgICAgICAgcG1lbSA9IHdjbnNzX3ByZWFsbG9jX2dldChzaXplKTsKKyAgICAgICAgICAgaWYgKE5VTEwgIT0gcG1lbSkKKyAgICAgICAgICAgICAgIHJldHVybiBwbWVtOworICAgICAgfQorI2VuZGlmCisgICAgIC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faXJxcmVzdG9yZSgmdm9zTWVtTGlzdC5sb2NrLCBJcnFGbGFncyk7CisKKyAgICAgICAgaWYoVk9TX1NUQVRVU19TVUNDRVNTID09IHZvc1N0YXR1cykKKyAgICAgICAgeworICAgICAgICAgICAgaWYoMCA9PSB2b3NfbWVtX2NvbXBhcmUobWVtU3RydWN0LT5oZWFkZXIsICZXTEFOX01FTV9IRUFERVJbMF0sIHNpemVvZihXTEFOX01FTV9IRUFERVIpKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsIAorICAgICAgICAgICAgICAgICAgICAiTWVtb3J5IEhlYWRlciBpcyBjb3JydXB0ZWQuIE1lbUluZm86IEZpbGVuYW1lICVzLCBMaW5lTnVtICVkIiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lbVN0cnVjdC0+ZmlsZU5hbWUsIChpbnQpbWVtU3RydWN0LT5saW5lTnVtKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmKDAgPT0gdm9zX21lbV9jb21wYXJlKCAodl9VOF90KilwdHIgKyBtZW1TdHJ1Y3QtPnNpemUsICZXTEFOX01FTV9UQUlMWzBdLCBzaXplb2YoV0xBTl9NRU1fVEFJTCApICkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCAKKyAgICAgICAgICAgICAgICAgICAgIk1lbW9yeSBUcmFpbGVyIGlzIGNvcnJ1cHRlZC4gTWVtSW5mbzogRmlsZW5hbWUgJXMsIExpbmVOdW0gJWQiLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVtU3RydWN0LT5maWxlTmFtZSwgKGludCltZW1TdHJ1Y3QtPmxpbmVOdW0pOworICAgICAgICAgICAgfQorICAgICAgICAgICAga2ZyZWUoKHZfVk9JRF90KiltZW1TdHJ1Y3QpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICAgICIlczogVW5hbGxvY2F0ZWQgbWVtb3J5IChkb3VibGUgZnJlZT8pIiwgX19mdW5jX18pOworICAgICAgICAgICAgVk9TX0JVRygwKTsKKyAgICAgICAgfQorICAgIH0KK30KKyNlbHNlCit2X1ZPSURfdCAqIHZvc19tZW1fbWFsbG9jKCB2X1NJWkVfdCBzaXplICkKK3sKKyAgIGludCBmbGFncyA9IEdGUF9LRVJORUw7CisgICB2X1ZPSURfdCogbWVtUHRyID0gTlVMTDsKKyNpZmRlZiBDT05GSUdfV0NOU1NfTUVNX1BSRV9BTExPQworICAgIHZfVk9JRF90KiBwbWVtOworI2VuZGlmICAgIAorICAgdW5zaWduZWQgbG9uZyAgdGltZV9iZWZvcmVfa21hbGxvYzsKKworICAgaWYgKHNpemUgPiAoMTAyNCoxMDI0KSB8fCBzaXplID09IDApCisgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIiVzOiBjYWxsZWQgd2l0aCBpbnZhbGlkIGFyZyAldSAhISEiLCBfX2Z1bmNfXywgc2l6ZSk7CisgICAgICAgcmV0dXJuIE5VTEw7CisgICB9CisgICBpZiAoaW5faW50ZXJydXB0KCkgfHwgaXJxc19kaXNhYmxlZCgpIHx8IGluX2F0b21pYygpKQorICAgeworICAgICAgZmxhZ3MgPSBHRlBfQVRPTUlDOworICAgfQorI2lmZGVmIENPTkZJR19XQ05TU19NRU1fUFJFX0FMTE9DCisgICBpZihzaXplID4gV0NOU1NfUFJFX0FMTE9DX0dFVF9USFJFU0hPTEQpCisgICB7CisgICAgICAgcG1lbSA9IHdjbnNzX3ByZWFsbG9jX2dldChzaXplKTsKKyAgICAgICBpZihOVUxMICE9IHBtZW0pIAorICAgICAgICAgICByZXR1cm4gcG1lbTsKKyAgIH0KKyNlbmRpZgorICAgdGltZV9iZWZvcmVfa21hbGxvYyA9IHZvc190aW1lcl9nZXRfc3lzdGVtX3RpbWUoKTsKKyAgIG1lbVB0ciA9IGttYWxsb2Moc2l6ZSwgZmxhZ3MpOworICAgLyogSWYgdGltZSB0YWtlbiBieSBrbWFsbG9jIGlzIGdyZWF0ZXIgdGhhbiBWT1NfR0VUX01FTU9SWV9USU1FX1RIUkVTSE9MRAorICAgICogbXNlYyAqLworICAgaWYgKHZvc190aW1lcl9nZXRfc3lzdGVtX3RpbWUoKSAtIHRpbWVfYmVmb3JlX2ttYWxsb2MgPj0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19HRVRfTUVNT1JZX1RJTUVfVEhSRVNIT0xEKQorICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICIlczoga21hbGxvYyB0b29rICVsdSBtc2VjIiwgX19mdW5jX18sCisgICAgICAgICAgdm9zX3RpbWVyX2dldF9zeXN0ZW1fdGltZSgpIC0gdGltZV9iZWZvcmVfa21hbGxvYyk7CisKKyAgIHJldHVybiBtZW1QdHI7CisKK30KKwordl9WT0lEX3Qgdm9zX21lbV9mcmVlKCB2X1ZPSURfdCAqcHRyICkKK3sKKyAgICBpZiAocHRyID09IE5VTEwpCisgICAgICByZXR1cm47CisKKyNpZmRlZiBDT05GSUdfV0NOU1NfTUVNX1BSRV9BTExPQworICAgIGlmKHdjbnNzX3ByZWFsbG9jX3B1dChwdHIpKQorICAgICAgICByZXR1cm47CisjZW5kaWYKKworICAgIGtmcmVlKHB0cik7Cit9CisjZW5kaWYKKwordl9WT0lEX3QgKiB2b3NfbWVtX3ZtYWxs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GVzICkKK3sKKyAgIGlmICgwID09IG51bUJ5dGVzKQorICAgeworICAgICAgLy8gc3BlY2lhbCBjYXNlIHdoZXJlIHB0ciBjYW4gYmUgTlVMTAorICAgICAgcmV0dXJuOworICAgfQorCisgICBpZiAocHRyID09IE5VTEwpCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlcyBjYWxsZWQgd2l0aCBOVUxMIHBhcmFtZXRlciBwdHIiLCBfX2Z1bmNfXyk7CisgICAgICByZXR1cm47CisgICB9CisgICBtZW1zZXQocHRyLCAwLCBudW1CeXRlcyk7CisgICAKK30KKwordl9WT0lEX3Qgdm9zX21lbV9jb3B5KCB2X1ZPSURfdCAqcERzdCwgY29uc3Qgdl9WT0lEX3QgKnBTcmMsIHZfU0laRV90IG51bUJ5dGVzICkKK3sKKyAgIGlmICgwID09IG51bUJ5dGVzKQorICAgeworICAgICAgLy8gc3BlY2lhbCBjYXNlIHdoZXJlIHBEc3Qgb3IgcFNyYyBjYW4gYmUgTlVMTAorICAgICAgcmV0dXJuOworICAgfQorCisgICBpZiAoKHBEc3QgPT0gTlVMTCkgfHwgKHBTcmM9PU5VTEwpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlcyBjYWxsZWQgd2l0aCBOVUxMIHBhcmFtZXRlciwgc291cmNlOiVwIGRlc3RpbmF0aW9uOiVwIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcFNyYywgcERzdCk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuOworICAgfQorICAgbWVtY3B5KHBEc3QsIHBTcmMsIG51bUJ5dGVzKTsKK30KKwordl9WT0lEX3Qgdm9zX21lbV9tb3ZlKCB2X1ZPSURfdCAqcERzdCwgY29uc3Qgdl9WT0lEX3QgKnBTcmMsIHZfU0laRV90IG51bUJ5dGVzICkKK3sKKyAgIGlmICgwID09IG51bUJ5dGVzKQorICAgeworICAgICAgLy8gc3BlY2lhbCBjYXNlIHdoZXJlIHBEc3Qgb3IgcFNyYyBjYW4gYmUgTlVMTAorICAgICAgcmV0dXJuOworICAgfQorCisgICBpZiAoKHBEc3QgPT0gTlVMTCkgfHwgKHBTcmM9PU5VTEwpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlcyBjYWxsZWQgd2l0aCBOVUxMIHBhcmFtZXRlciwgc291cmNlOiVwIGRlc3RpbmF0aW9uOiVwIiwKKyAgICAgICAgICAgICAgICBfX2Z1bmNfXywgcFNyYywgcERzdCk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuOworICAgfQorICAgbWVtbW92ZShwRHN0LCBwU3JjLCBudW1CeXRlcyk7Cit9CisKK3ZfQk9PTF90IHZvc19tZW1fY29tcGFyZSgKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsMTgsMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZfVk9JRF90ICpwTWVtb3J5MSwKKyNlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVk9JRF90ICpwTWVtb3J5MSwKKyNlbmRpZgorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxOCwwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgdl9WT0lEX3QgKnBNZW1vcnkyLAorI2Vsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdl9WT0lEX3QgKnBNZW1vcnkyLAorI2VuZGlmCisgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgbnVtQnl0ZXMgKQoreyAKK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U7CisKKyAgICAgIHZvc19tZW1fY29weSgmbWVtU3RydWN0LT5oZWFkZXJbMF0sICZXTEFOX01FTV9IRUFERVJbMF0sIHNpemVvZihXTEFOX01FTV9IRUFERVIpKTsKKyAgICAgIHZvc19tZW1fY29weSggKHZfVThfdCopKG1lbVN0cnVjdCArIDEpICsgc2l6ZSwgJldMQU5fTUVNX1RBSUxbMF0sIHNpemVvZihXTEFOX01FTV9UQUlMKSk7CisKKyAgICAgIHNwaW5fbG9jaygmdm9zTWVtTGlzdC5sb2NrKTsKKyAgICAgIHZvc1N0YXR1cyA9IGhkZF9saXN0X2luc2VydF9mcm9udCgmdm9zTWVtTGlzdCwgJm1lbVN0cnVjdC0+cE5vZGUpOworICAgICAgc3Bpbl91bmxvY2soJnZvc01lbUxpc3QubG9jayk7CisgICAgICBpZihWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gdm9zU3RhdHVzKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAiJXM6IFVuYWJsZSB0byBpbnNlcnQgbm9kZSBpbnRvIExpc3Qgdm9zU3RhdHVzICVkIiwgX19mdW5jX18sIHZvc1N0YXR1cyk7CisgICAgICB9CisKKyAgICAgIG1lbVB0ciA9ICh2X1ZPSURfdCopKG1lbVN0cnVjdCArIDEpOyAKKyAgIH0KKworICAgcmV0dXJuIG1lbVB0cjsKK30KKwordl9WT0lEX3Qgdm9zX21lbV9kbWFfZnJlZSggdl9WT0lEX3QgKnB0ciApCit7CisgICAgaWYgKHB0ciA9PSBOVUxMKQorICAgICAgICByZXR1cm47CisKKyAgICBpZiAobWVtb3J5X2RidWdfZmxhZykKKyAgICB7CisgICAgICAgIFZPU19TVEFUVVMgdm9zU3RhdHVzOworICAgICAgICBzdHJ1Y3Qgc192b3NfbWVtX3N0cnVjdCogbWVtU3RydWN0ID0gKChzdHJ1Y3Qgc192b3NfbWVtX3N0cnVjdCopcHRyKSAtIDE7CisKKyAgICAgICAgc3Bpbl9sb2NrKCZ2b3NNZW1MaXN0LmxvY2spOworICAgICAgICB2b3NTdGF0dXMgPSBoZGRfbGlzdF9yZW1vdmVfbm9kZSgmdm9zTWVtTGlzdCwgJm1lbVN0cnVjdC0+cE5vZGUpOworICAgICAgICBzcGluX3VubG9jaygmdm9zTWVtTGlzdC5sb2NrKTsKKworICAgICAgICBpZihWT1NfU1RBVFVTX1NVQ0NFU1MgPT0gdm9zU3RhdHVzKQorICAgICAgICB7CisgICAgICAgICAgICBpZigwID09IHZvc19tZW1fY29tcGFyZShtZW1TdHJ1Y3QtPmhlYWRlciwgJldMQU5fTUVNX0hFQURFUlswXSwgc2l6ZW9mKFdMQU5fTUVNX0hFQURFUikpICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwgCisgICAgICAgICAgICAgICAgICAgICJNZW1vcnkgSGVhZGVyIGlzIGNvcnJ1cHRlZC4gTWVtSW5mbzogRmlsZW5hbWUgJXMsIExpbmVOdW0gJWQiLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVtU3RydWN0LT5maWxlTmFtZSwgKGludCltZW1TdHJ1Y3QtPmxpbmVOdW0pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYoMCA9PSB2b3NfbWVtX2NvbXBhcmUoICh2X1U4X3QqKXB0ciArIG1lbVN0cnVjdC0+c2l6ZSwgJldMQU5fTUVNX1RBSUxbMF0sIHNpemVvZihXTEFOX01FTV9UQUlMICkgKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsIAorICAgICAgICAgICAgICAgICAgICAiTWVtb3J5IFRyYWlsZXIgaXMg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Q09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1IgT1RIRVIKKyAqIFRPUlRJT1VTIEFDVElPTiwgQVJJU0lORyBPVVQgT0YgT1IgSU4gQ09OTkVDVElPTiBXSVRIIFRIRSBVU0UgT1IKKyAqIFBFUkZPUk1BTkNFIE9GIFRISVMgU09GVFdBUkUuCisgKi8KKworLyoKKyAqIFRoaXMgZmlsZSB3YXMgb3JpZ2luYWxseSBkaXN0cmlidXRlZCBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGSUxFOiAgICAgICAgIHZvc19udml0ZW0uYworICBPVkVSVklFVzogICAgIFRoaXMgc291cmNlIGZpbGUgY29udGFpbnMgZGVmaW5pdGlvbnMgZm9yIHZPUyBOViBJdGVtIEFQSXMKKyAgREVQRU5ERU5DSUVTOiBOViwgcmVtb3RlIEFQSSBjbGllbnQsIFdpbkNFIFJFWAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRURJVCBISVNUT1JZIEZPUiBNT0RVTEUKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworLy8gdGhlIGZvbGxvd2luZyBpcyB1c2VkIHRvIGRpc2FibGUgd2FybmluZyBmb3IgaGF2aW5nIHRvb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gICB7UkVHRE9NQUlOX0VUU0ksIHsnQicsICdEJ319LCAvL0JBTkdMQURFU0gKKyAgICAgIHtSRUdET01BSU5fRVRTSSwgeyAnQicsICdFJ319LCAvL0JFTEdJVU0KKyAgICAgIHtSRUdET01BSU5fRVRTSSwgeydCJywgJ0cnfX0sIC8vQlVMR0FSSUEKKyAgICAgIHtSRUdET01BSU5fQVBBQywgeydCJywgJ0gnfX0sIC8vQkFIUkFJTgorICAgICAge1JFR0RPTUFJTl9FVFNJLCB7J0InLCAnTCd9fSwgLy8KKyAgICAgIHtSRUdET01BSU5fRkNDLCB7J0InLCAnTSd9fSwgLy9CRVJNVURBCisgICAgICB7UkVHRE9NQUlOX0FQQUMsIHsnQicsICdOJ319LCAvL0JSVU5FSSBEQVJVU1NBTEFNCisgICAgICB7UkVHRE9NQUlOX0VUU0ksIHsnQicsICdPJ319LCAvL0JPTElWSUEKKyAgICAgIHtSRUdET01BSU5fV09STEQsIHsnQicsICdSJ319LCAvL0JSQVpJTAorICAgICAge1JFR0RPTUFJTl9BUEFDLCB7J0InLCAnUyd9fSwgLy9CQUhBTUFTCisgICAgICB7UkVHRE9NQUlOX0VUU0ksIHsnQicsICdZJ319LCAvL0JFTEFSVVMKKyAgICAgIHtSRUdET01BSU5fRVRTSSwgeydCJywgJ1onfX0sIC8vQkVMSVpFCisgICAgICB7UkVHRE9NQUlOX0ZDQywgeydDJywgJ0EnfX0sIC8vQ0FOQURBCisgICAgICB7UkVHRE9NQUlOX0VUU0ksIHsnQycsICdIJ319LCAvL1NXSVRaRVJMQU5ECisgICAgICB7UkVHRE9NQUlOX0FQQUMsIHsnQycsICdMJ319LCAvL0NISUxFCisgICAgICB7UkVHRE9NQUlOX0FQQUMsIHsnQycsICdOJ319LCAvL0NISU5BCisgICAgICB7UkVHRE9NQUlOX0FQQUMsIHsnQycsICdPJ319LCAvL0NPTE9NQklBCisgICAgICB7UkVHRE9NQUlOX0FQQUMsIHsnQycsICdSJ319LCAvL0NPU1RBIFJ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lMTEEKKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydBJywgJ0wnfX0sICAvL0FMQkFOSUEKKyAgICAgICAgeyBSRUdET01BSU5fTl9BTUVSX0VYQ19GQ0MsIHsnQScsICdNJ319LCAgLy9BUk1FTklBCisgICAgICAgIHsgUkVHRE9NQUlOX0VUU0ksICAgIHsnQScsICdOJ319LCAgLy9ORVRIRVJMQU5EUyBBTlRJTExFUworICAgICAgICB7IFJFR0RPTUFJTl9OT181R0haLCB7J0EnLCAnTyd9fSwgIC8vQU5HT0xBCisgICAgICAgIHsgUkVHRE9NQUlOX1dPUkxELCAgIHsnQScsICdRJ319LCAgLy9BTlRBUkNUSUNBCisgICAgICAgIHsgUkVHRE9NQUlOX1dPUkxELCAgIHsnQScsICdSJ319LCAgLy9BUkdFTlRJTkEKKyAgICAgICAgeyBSRUdET01BSU5fRkNDLCAgICAgeydBJywgJ1MnfX0sICAvL0FNRVJJQ0FOIFNPTU9BCisgICAgICAgIHsgUkVHRE9NQUlOX0VUU0ksICAgIHsnQScsICdUJ319LCAgLy9BVVNUUklBCisgICAgICAgIHsgUkVHRE9NQUlOX1dPUkxELCAgIHsnQScsICdVJ319LCAgLy9BVVNUUkFMSUEKKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydBJywgJ1cnfX0sICAvL0FSVUJBCisgICAgICAgIHsgUkVHRE9NQUlOX1dPUkxELCAgIHsnQScsICdYJ319LCAgLy9BTEFORCBJU0xBTkRTCisgICAgICAgIHsgUkVHRE9NQUlOX05fQU1FUl9FWENfRkNDLCB7J0EnLCAnWid9fSwgIC8vQVpFUkJBSUpBTgorICAgICAgICB7IFJFR0RPTUFJTl9FVFNJLCAgICB7J0InLCAnQSd9fSwgIC8vQk9TTklBIEFORCBIRVJaRUdPVklOQQorICAgICAgICB7IFJFR0RPTUFJTl9BUEFDLCAgICB7J0InLCAnQid9fSwgIC8vQkFSQkFET1MKKyAgICAgICAgeyBSRUdET01BSU5fSElfNUdIWiwgeydCJywgJ0QnfX0sICAvL0JBTkdMQURFU0gKKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydCJywgJ0UnfX0sICAvL0JFTEdJVU0KKyAgICAgICAgeyBSRUdET01BSU5fSElfNUdIWiwgeydCJywgJ0YnfX0sICAvL0JVUktJTkEgRkFTTworICAgICAgICB7IFJFR0RPTUFJTl9FVFNJLCAgICB7J0InLCAnRyd9fSwgIC8vQlVMR0FSSUEKKyAgICAgICAgeyBSRUdET01BSU5fQVBBQywgICAgeydCJywgJ0gnfX0sICAvL0JBSFJBSU4KKyAgICAgICAgeyBSRUdET01BSU5fTk9fNUdIWiwgeydCJywgJ0knfX0sICAvL0JVUlVOREkKKyAgICAgICAgeyBSRUdET01BSU5fTk9fNUdIWiwgeydCJywgJ0onfX0sICAvL0JFTklOCisgICAgICAgIHsgUkVHRE9NQUlOX0ZDQywgICAgIHsnQicsICdNJ319LCAgLy9CRVJNVURBCisgICAgICAgIHsgUkVHRE9NQUlOX0FQQUMsICAgIHsnQicsICdOJ319LCAgLy9CUlVORUkgREFSVVNTQUxBTQorICAgICAgICB7IFJFR0RPTUFJTl9ISV81R0haLCB7J0InLCAnTyd9fSwgIC8vQk9MSVZJQQorICAgICAgICB7IFJFR0RPTUFJTl9XT1JMRCwgICB7J0InLCAnUid9fSwgIC8vQlJBWklMCisgICAgICAgIHsgUkVHRE9NQUlOX0FQQUMsICAgIHsnQicsICdTJ319LCAgLy9CQUhBTUFTCisgICAgICAgIHsgUkVHRE9NQUlOX05PXzVHSFosIHsnQicsICdUJ319LCAgLy9CSFVUQU4KKyAgICAgICAgeyBSRUdET01BSU5fV09STEQsICAgeydCJywgJ1YnfX0sICAvL0JPVVZFVCBJU0xBTkQKKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydCJywgJ1cnfX0sICAvL0JPVFNXQU5BCisgICAgICAgIHsgUkVHRE9NQUlOX0VUU0ksICAgIHsnQicsICdZJ319LCAgLy9CRUxBUlVTCisgICAgICAgIHsgUkVHRE9NQUlOX0hJXzVHSFosIHsnQicsICdaJ319LCAgLy9CRUxJWkUKKyAgICAgICAgeyBSRUdET01BSU5fRkNDLCAgICAgeydDJywgJ0EnfX0sICAvL0NBTkFEQQorICAgICAgICB7IFJFR0RPTUFJTl9XT1JMRCwgICB7J0MnLCAnQyd9fSwgIC8vQ09DT1MgKEtFRUxJTkcpIElTTEFORFMKKyAgICAgICAgeyBSRUdET01BSU5fTk9fNUdIWiwgeydDJywgJ0QnfX0sICAvL0NPTkdPLCBUSEUgREVNT0NSQVRJQyBSRVBVQkxJQyBPRiBUSEUKKyAgICAgICAgeyBSRUdET01BSU5fTk9fNUdIWiwgeydDJywgJ0YnfX0sICAvL0NFTlRSQUwgQUZSSUNBTiBSRVBVQkxJQworICAgICAgICB7IFJFR0RPTUFJTl9OT181R0haLCB7J0MnLCAnRyd9fSwgIC8vQ09OR08KKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydDJywgJ0gnfX0sICAvL1NXSVRaRVJMQU5ECisgICAgICAgIHsgUkVHRE9NQUlOX05PXzVHSFosIHsnQycsICdJJ319LCAgLy9DT1RFIEQnSVZPSVJFCisgICAgICAgIHsgUkVHRE9NQUlOX1dPUkxELCAgIHsnQycsICdLJ319LCAgLy9DT09LIElTTEFORFMKKyAgICAgICAgeyBSRUdET01BSU5fQVBBQywgICAgeydDJywgJ0wnfX0sICAvL0NISUxFCisgICAgICAgIHsgUkVHRE9NQUlOX05PXzVHSFosIHsnQycsICdNJ319LCAgLy9DQU1FUk9PTgorICAgICAgICB7IFJFR0RPTUFJTl9BUEFDLCAgICB7J0MnLCAnTid9fSwgIC8vQ0hJTkEKKyAgICAgICAgeyBSRUdET01BSU5fQVBBQywgICAgeydDJywgJ08nfX0sICAvL0NPTE9NQklBCisgICAgICAgIHsgUkVHRE9NQUlOX0FQQUMsICAgIHsnQycsICdSJ319LCAgLy9DT1NUQSBSSUNBCisgICAgICAgIHsgUkVHRE9NQUlOX05PXzVHSFosIHsnQycsICdVJ319LCAgLy9DVUJBCisgICAgICAgIHsgUkVHRE9NQUlOX0VUU0ksICAgIHsnQycsICdWJ319LCAgLy9DQVBFIFZFUkRFCisgICAgICAgIHsgUkVHRE9NQUlOX1dPUkxELCAgIHsnQycsICdYJ319LCAgLy9DSFJJU1RNQVMgSVNMQU5ECisgICAgICAgIHsgUkVHRE9NQUlOX0VUU0ksICAgIHsnQycsICdZJ319LCAgLy9DWVBSVVMKKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydDJywgJ1onfX0sICAvL0NaRUNIIFJFUFVCTElDCisgICAgICAgIHsgUkVHRE9NQUlOX0VUU0ksICAgIHsnRCcsICdFJ319LCAgLy9HRVJNQU5ZCisgICAgICAgIHsgUkVHRE9NQUlOX05PXzVHSFosIHsnRCcsICdKJ319LCAgLy9ESklCT1VUSQorICAgICAgICB7IFJFR0RPTUFJTl9FVFNJLCAgICB7J0QnLCAnSyd9fSwgIC8vREVOTUFSSworICAgICAgICB7IFJFR0RPTUFJTl9XT1JMRCwgICB7J0QnLCAnTSd9fSwgIC8vRE9NSU5JQ0EKKyAgICAgICAgeyBSRUdET01BSU5fQVBBQywgICAgeydEJywgJ08nfX0sICAvL0RPTUlOSUNBTiBSRVBVQkxJQworICAgICAgICB7IFJFR0RPTUFJTl9FVFNJLCAgICB7J0QnLCAnWid9fSwgIC8vQUxHRVJJQQorICAgICAgICB7IFJFR0RPTUFJTl9BUEFDLCAgICB7J0UnLCAnQyd9fSwgIC8vRUNVQURPUgorICAgICAgICB7IFJFR0RPTUFJTl9FVFNJLCAgICB7J0UnLCAnRSd9fSwgIC8vRVNUT05JQQorICAgICAgICB7IFJFR0RPTUFJTl9OX0FNRVJfRVhDX0ZDQywgeydFJywgJ0cnfX0sICAvL0VHWVBUCisgICAgICAgIHsgUkVHRE9NQUlOX1dPUkxELCAgIHsnRScsICdIJ319LCAgLy9XRVNURVJOIFNBSEFSQQorICAgICAgICB7IFJF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C8vRlJFTkNIIEdVSUFOQQorICAgICAgICB7IFJFR0RPTUFJTl9XT1JMRCwgICB7J0cnLCAnRyd9fSwgIC8vR1VFUk5TRVkKKyAgICAgICAgeyBSRUdET01BSU5fV09STEQsICAgeydHJywgJ0gnfX0sICAvL0dIQU5BCisgICAgICAgIHsgUkVHRE9NQUlOX1dPUkxELCAgIHsnRycsICdJJ319LCAgLy9HSUJSQUxUQVIKKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydHJywgJ0wnfX0sICAvL0dSRUVOTEFORAorICAgICAgICB7IFJFR0RPTUFJTl9OT181R0haLCB7J0cnLCAnTSd9fSwgIC8vR0FNQklBCisgICAgICAgIHsgUkVHRE9NQUlOX05PXzVHSFosIHsnRycsICdOJ319LCAgLy9HVUlORUEKKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydHJywgJ1AnfX0sICAvL0dVQURFTE9VUEUKKyAgICAgICAgeyBSRUdET01BSU5fTk9fNUdIWiwgeydHJywgJ1EnfX0sICAvL0VRVUFUT1JJQUwgR1VJTkVBCisgICAgICAgIHsgUkVHRE9NQUlOX0VUU0ksICAgIHsnRycsICdSJ319LCAgLy9HUkVFQ0UKKyAgICAgICAgeyBSRUdET01BSU5fV09STEQsICAgeydHJywgJ1MnfX0sICAvL1NPVVRIIEdFT1JHSUEgQU5EIFRIRSBTT1VUSCBTQU5EV0lDSCBJU0xBTkRTCisgICAgICAgIHsgUkVHRE9NQUlOX0FQQUMsICAgIHsnRycsICdUJ319LCAgLy9HVUFURU1BTEEKKyAgICAgICAgeyBSRUdET01BSU5fRkNDLCAgICAgeydHJywgJ1UnfX0sICAvL0dVQU0KKyAgICAgICAgeyBSRUdET01BSU5fTk9fNUdIWiwgeydHJywgJ1cnfX0sICAvL0dVSU5FQS1CSVNTQVUKKyAgICAgICAgeyBSRUdET01BSU5fSElfNUdIWiwgeydHJywgJ1knfX0sICAvL0dVWUFOQQorICAgICAgICB7IFJFR0RPTUFJTl9XT1JMRCwgICB7J0gnLCAnSyd9fSwgIC8vSE9OR0tPTkcKKyAgICAgICAgeyBSRUdET01BSU5fV09STEQsICAgeydIJywgJ00nfX0sICAvL0hFQVJEIElTTEFORCBBTkQgTUNET05BTEQgSVNMQU5EUworICAgICAgICB7IFJFR0RPTUFJTl9XT1JMRCwgICB7J0gnLCAnTid9fSwgIC8vSE9ORFVSQVMKKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydIJywgJ1InfX0sICAvL0NST0FUSUEKKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydIJywgJ1QnfX0sICAvL0hBSVRJCisgICAgICAgIHsgUkVHRE9NQUlOX0VUU0ksICAgIHsnSCcsICdVJ319LCAgLy9IVU5HQVJZCisgICAgICAgIHsgUkVHRE9NQUlOX0hJXzVHSFosIHsnSScsICdEJ319LCAgLy9JTkRPTkVTSUEKKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydJJywgJ0UnfX0sICAvL0lSRUxBTkQKKyAgICAgICAgeyBSRUdET01BSU5fTl9BTUVSX0VYQ19GQ0MsIHsnSScsICdMJ319LCAgLy9JU1JBRUwKKyAgICAgICAgeyBSRUdET01BSU5fV09STEQsICAgeydJJywgJ00nfX0sICAvL0lTTEUgT0YgTUFOCisgICAgICAgIHsgUkVHRE9NQUlOX0FQQUMsICAgIHsnSScsICdOJ319LCAgLy9JTkRJQQorICAgICAgICB7IFJFR0RPTUFJTl9XT1JMRCwgICB7J0knLCAnTyd9fSwgIC8vQlJJVElTSCBJTkRJQU4gT0NFQU4gVEVSUklUT1JZCisgICAgICAgIHsgUkVHRE9NQUlOX05PXzVHSFosIHsnSScsICdRJ319LCAgLy9JUkFRCisgICAgICAgIHsgUkVHRE9NQUlOX0hJXzVHSFosIHsnSScsICdSJ319LCAgLy9JUkFOLCBJU0xBTUlDIFJFUFVCTElDIE9GCisgICAgICAgIHsgUkVHRE9NQUlOX0VUU0ksICAgIHsnSScsICdTJ319LCAgLy9JQ0VMQU5ECisgICAgICAgIHsgUkVHRE9NQUlOX0VUU0ksICAgIHsnSScsICdUJ319LCAgLy9JVEFMWQorICAgICAgICB7IFJFR0RPTUFJTl9KQVBBTiwgICB7J0onLCAnMSd9fSwgIC8vSmFwYW4gYWx0ZXJuYXRlIDEKKyAgICAgICAgeyBSRUdET01BSU5fSkFQQU4sICAgeydKJywgJzInfX0sICAvL0phcGFuIGFsdGVybmF0ZSAyCisgICAgICAgIHsgUkVHRE9NQUlOX0pBUEFOLCAgIHsnSicsICczJ319LCAgLy9KYXBhbiBhbHRlcm5hdGUgMworICAgICAgICB7IFJFR0RPTUFJTl9KQVBBTiwgICB7J0onLCAnNCd9fSwgIC8vSmFwYW4gYWx0ZXJuYXRlIDQKKyAgICAgICAgeyBSRUdET01BSU5fSkFQQU4sICAgeydKJywgJzUnfX0sICAvL0phcGFuIGFsdGVybmF0ZSA1CisgICAgICAgIHsgUkVHRE9NQUlOX1dPUkxELCAgIHsnSicsICdFJ319LCAgLy9KRVJTRVkKKyAgICAgICAgeyBSRUdET01BSU5fV09STEQsICAgeydKJywgJ00nfX0sICAvL0pBTUFJQ0EKKyAgICAgICAgeyBSRUdET01BSU5fQVBBQywgICAgeydKJywgJ08nfX0sICAvL0pPUkRBTgorICAgICAgICB7IFJFR0RPTUFJTl9KQVBBTiwgICB7J0onLCAnUCd9fSwgIC8vSkFQQU4KKyAgICAgICAgeyBSRUdET01BSU5fS09SRUEsICAgeydLJywgJzEnfX0sICAvL0tvcmVhIGFsdGVybmF0ZSAxCisgICAgICAgIHsgUkVHRE9NQUlOX0tPUkVBLCAgIHsnSycsICcyJ319LCAgLy9Lb3JlYSBhbHRlcm5hdGUgMgorICAgICAgICB7IFJFR0RPTUFJTl9LT1JFQSwgICB7J0snLCAnMyd9fSwgIC8vS29yZWEgYWx0ZXJuYXRlIDMKKyAgICAgICAgeyBSRUdET01BSU5fS09SRUEsICAgeydLJywgJzQnfX0sICAvL0tvcmVhIGFsdGVybmF0ZSA0CisgICAgICAgIHsgUkVHRE9NQUlOX0FQQUMsICAgIHsnSycsICdFJ319LCAgLy9LRU5ZQQorICAgICAgICB7IFJFR0RPTUFJTl9OT181R0haLCB7J0snLCAnRyd9fSwgIC8vS1lSR1laU1RBTgorICAgICAgICB7IFJFR0RPTUFJTl9FVFNJLCAgICB7J0snLCAnSCd9fSwgIC8vQ0FNQk9ESUEKKyAgICAgICAgeyBSRUdET01BSU5fV09STEQsICAgeydLJywgJ0knfX0sICAvL0tJUklCQVRJCisgICAgICAgIHsgUkVHRE9NQUlOX05PXzVHSFosIHsnSycsICdNJ319LCAgLy9DT01PUk9TCisgICAgICAgIHsgUkVHRE9NQUlOX1dPUkxELCAgIHsnSycsICdOJ319LCAgLy9TQUlOVCBLSVRUUyBBTkQgTkVWSVMKKyAgICAgICAgeyBSRUdET01BSU5fV09STEQsICAgeydLJywgJ1AnfX0sICAvL0tPUkVBLCBERU1PQ1JBVElDIFBFT1BMRSdTIFJFUFVCTElDIE9GCisgICAgICAgIHsgUkVHRE9NQUlOX0tPUkVBLCAgIHsnSycsICdSJ319LCAgLy9LT1JFQSwgUkVQVUJMSUMgT0YKKyAgICAgICAgeyBSRUdET01BSU5fTl9BTUVSX0VYQ19GQ0MsIHsnSycsICdXJ319LCAgLy9LVVdBSVQKKyAgICAgICAgeyBSRUdET01BSU5fRkNDLCAgICAgeydLJywgJ1knfX0sICAvL0NBWU1BTiBJU0xBTkRTCisgICAgICAgIHsgUkVHRE9NQUlOX1dPUkxELCAgIHsnSycsICdaJ319LCAgLy9LQVpBS0hTVEFOCisgICAgICAgIHsgUkVHRE9NQUlOX1dPUkxELCAgIHsnTCcsICdBJ319LCAgLy9MQU8gUEVPUExFJ1MgREVNT0NSQVRJQyBSRVBVQkxJQworICAgICAgICB7IFJFR0RPTUFJTl9XT1JMRCwgICB7J0wnLCAnQid9fSwgIC8vTEVCQU5PTgorICAgICAgICB7IFJFR0RPTUFJTl9XT1JMRCwgICB7J0wnLCAnQyd9fSwgIC8vU0FJTlQgTFVDSUEKKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydMJywgJ0knfX0sICAvL0xJRUNIVEVOU1RFSU4KKyAgICAgICAgeyBSRUdET01BSU5fV09STEQsICAgeydMJywgJ0snfX0sICAvL1NSSSBMQU5LQQorICAgICAgICB7IFJFR0RPTUFJTl9XT1JMRCwgICB7J0wnLCAnUid9fSwgIC8vTElCRVJJQQorICAgICAgICB7IFJFR0RPTUFJTl9FVFNJLCAgICB7J0wnLCAnUyd9fSwgIC8vTEVTT1RITworICAgICAgICB7IFJFR0RPTUFJTl9FVFNJLCAgICB7J0wnLCAnVCd9fSwgIC8vTElUSFVBTklBCisgICAgICAgIHsgUkVHRE9NQUlOX0VUU0ksICAgIHsnTCcsICdVJ319LCAgLy9MVVhFTUJPVVJHCisgICAgICAgIHsgUkVHRE9NQUlOX0VUU0ksICAgIHsnTCcsICdWJ319LCAgLy9MQVRWSUEKKyAgICAgICAgeyBSRUdET01BSU5fTk9fNUdIWiwgeydMJywgJ1knfX0sICAvL0xJQllBTiBBUkFCIEpBTUFISVJJWUEKKyAgICAgICAgeyBSRUdET01BSU5fQVBBQywgICAgeydNJywgJ0EnfX0sICAvL01PUk9DQ08KKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydNJywgJ0MnfX0sICAvL01PTkFDTworICAgICAgICB7IFJFR0RPTUFJTl9FVFNJLCAgICB7J00nLCAnRCd9fSwgIC8vTU9MRE9WQSwgUkVQVUJMSUMgT0YKKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydNJywgJ0UnfX0sICAvL01PTlRFTkVHUk8KKyAgICAgICAgeyBSRUdET01BSU5fTk9fNUdIWiwgeydNJywgJ0cnfX0sICAvL01BREFHQVNDQVIKKyAgICAgICAgeyBSRUdET01BSU5fV09STEQsICAgeydNJywgJ0gnfX0sICAvL01BUlNIQUxMIElTTEFORFMKKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydNJywgJ0snfX0sICAvL01BQ0VET05JQSwgVEhFIEZPUk1FUiBZVUdPU0xBViBSRVBVQkxJQyBPRgorICAgICAgICB7IFJFR0RPTUFJTl9OT181R0haLCB7J00nLCAnTCd9fSwgIC8vTUFMSQorICAgICAgICB7IFJFR0RPTUFJTl9XT1JMRCwgICB7J00nLCAnTSd9fSwgIC8vTVlBTk1BUgorICAgICAgICB7IFJFR0RPTUFJTl9XT1JMRCwgICB7J00nLCAnTid9fSwgIC8vTU9OR09MSUEKKyAgICAgICAgeyBSRUdET01BSU5fQVBBQywgICAgeydNJywgJ08nfX0sICAvL01BQ0FPCisgICAgICAgIHsgUkVHRE9NQUlOX0ZDQywgICAgIHsnTScsICdQJ319LCAgLy9OT1JUSEVSTiBNQVJJQU5BIElTTEFORFMKKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydNJywgJ1EnfX0sICAvL01BUlRJTklRVUUKKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydNJywgJ1InfX0sICAvL01BVVJJVEFOSUEKKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydNJywgJ1MnfX0sICAvL01PTlRTRVJSQVQKKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydNJywgJ1QnfX0sICAvL01BTFRBCisgICAgICAgIHsgUkVHRE9NQUlOX0VUU0ksICAgIHsnTScsICdVJ319LCAgLy9NQVVSSVRJVVMKKyAgICAgICAgeyBSRUdET01BSU5fQVBBQywgICAgeydNJywgJ1YnfX0sICAvL01BTERJVkVTCisgICAgICAgIHsgUkVHRE9NQUlOX0hJXzVHSFosIHsnTScsICdXJ319LCAgLy9NQUxBV0kKKyAgICAgICAgeyBSRUdET01BSU5fQVBBQywgICAgeydNJywgJ1gnfX0sICAvL01FWElDTworICAgICAgICB7IFJFR0RPTUFJTl9BUEFDLCAgICB7J00nLCAnWSd9fSwgIC8vTUFMQVlTSUEKKyAgICAgICAgeyBSRUdET01BSU5fV09STEQsICAgeydNJywgJ1onfX0sICAvL01PWkFNQklRVUUKKyAgICAgICAgeyBSRUdET01BSU5fV09STEQsICAgeydOJywgJ0EnfX0sICAvL05BTUlCSUEKKyAgICAgICAgeyBSRUdET01BSU5fTk9fNUdIWiwgeydOJywgJ0MnfX0sICAvL05FVyBDQUxFRE9OSUEKKyAgICAgICAgeyBSRUdET01BSU5fV09STEQsICAgeydOJywgJ0UnfX0sICAvL05JR0VSCisgICAgICAgIHsgUkVHRE9NQUlOX1dPUkxELCAgIHsnTicsICdGJ319LCAgLy9OT1JGT0xEIElTTEFORAorICAgICAgICB7IFJFR0RPTUFJTl9XT1JMRCwgICB7J04nLCAnRyd9fSwgIC8vTklHRVJJQQorICAgICAgICB7IFJFR0RPTUFJTl9XT1JMRCwgICB7J04nLCAnSSd9fSwgIC8vTklDQVJBR1VBCisgICAgICAgIHsgUkVHRE9NQUlOX0VUU0ksICAgIHsnTicsICdMJ319LCAgLy9ORVRIRVJMQU5EUworICAgICAgICB7IFJFR0RPTUFJTl9FVFNJLCAgICB7J04nLCAnTyd9fSwgIC8vTk9SV0FZCisgICAgICAgIHsgUkVHRE9NQUlOX0FQQUMsICAgIHsnTicsICdQJ319LCAgLy9ORVBBTAorICAgICAgICB7IFJFR0RPTUFJTl9OT181R0haLCB7J04nLCAnUid9fSwgIC8vTkFVUlUKKyAgICAgICAgeyBSRUdET01BSU5fV09STEQsICAgeydOJywgJ1UnfX0sICAvL05JVUUKKyAgICAgICAgeyBSRUdET01BSU5fQVBBQywgICAgeydOJywgJ1onfX0sICAvL05FVyBaRUFMQU5ECisgICAgICAgIHsgUkVHRE9NQUlOX0VUU0ksICAgIHsnTycsICdNJ319LCAgLy9PTUFOCisgICAgICAgIHsgUkVHRE9NQUlOX0FQQUMsICAgIHsnUCcsICdBJ319LCAgLy9QQU5BTUEKKyAgICAgICAgeyBSRUdET01BSU5fV09STEQsICAgeydQJywgJ0UnfX0sICAvL1BFUlUKKyAgICAgICAgeyBSRUdET01B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JywgJ08nfX0sICAvL1JPTUFOSUEKKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydSJywgJ1MnfX0sICAvL1NFUkJJQQorICAgICAgICB7IFJFR0RPTUFJTl9BUEFDLCAgICB7J1InLCAnVSd9fSwgIC8vUlVTU0lBCisgICAgICAgIHsgUkVHRE9NQUlOX1dPUkxELCAgIHsnUicsICdXJ319LCAgLy9SV0FOREEKKyAgICAgICAgeyBSRUdET01BSU5fV09STEQsICAgeydTJywgJ0EnfX0sICAvL1NBVURJIEFSQUJJQQorICAgICAgICB7IFJFR0RPTUFJTl9OT181R0haLCB7J1MnLCAnQid9fSwgIC8vU09MT01PTiBJU0xBTkRTCisgICAgICAgIHsgUkVHRE9NQUlOX05PXzVHSFosIHsnUycsICdDJ319LCAgLy9TRVlDSEVMTEVTCisgICAgICAgIHsgUkVHRE9NQUlOX1dPUkxELCAgIHsnUycsICdEJ319LCAgLy9TVURBTgorICAgICAgICB7IFJFR0RPTUFJTl9FVFNJLCAgICB7J1MnLCAnRSd9fSwgIC8vU1dFREVOCisgICAgICAgIHsgUkVHRE9NQUlOX0FQQUMsICAgIHsnUycsICdHJ319LCAgLy9TSU5HQVBPUkUKKyAgICAgICAgeyBSRUdET01BSU5fV09STEQsICAgeydTJywgJ0gnfX0sICAvL1NBSU5UIEhFTEVOQQorICAgICAgICB7IFJFR0RPTUFJTl9FVFNJLCAgICB7J1MnLCAnSSd9fSwgIC8vU0xPVkVOTklBCisgICAgICAgIHsgUkVHRE9NQUlOX1dPUkxELCAgIHsnUycsICdKJ319LCAgLy9TVkFMQkFSRCBBTkQgSkFOIE1BWUVOCisgICAgICAgIHsgUkVHRE9NQUlOX0VUU0ksICAgIHsnUycsICdLJ319LCAgLy9TTE9WQUtJQQorICAgICAgICB7IFJFR0RPTUFJTl9XT1JMRCwgICB7J1MnLCAnTCd9fSwgIC8vU0lFUlJBIExFT05FCisgICAgICAgIHsgUkVHRE9NQUlOX0VUU0ksICAgIHsnUycsICdNJ319LCAgLy9TQU4gTUFSSU5PCisgICAgICAgIHsgUkVHRE9NQUlOX0VUU0ksICAgIHsnUycsICdOJ319LCAgLy9TRU5FR0FMCisgICAgICAgIHsgUkVHRE9NQUlOX05PXzVHSFosIHsnUycsICdPJ319LCAgLy9TT01BTElBCisgICAgICAgIHsgUkVHRE9NQUlOX05PXzVHSFosIHsnUycsICdSJ319LCAgLy9TVVJJTkFNRQorICAgICAgICB7IFJFR0RPTUFJTl9XT1JMRCwgICB7J1MnLCAnVCd9fSwgIC8vU0FPIFRPTUUgQU5EIFBSSU5DSVBFCisgICAgICAgIHsgUkVHRE9NQUlOX0FQQUMsICAgIHsnUycsICdWJ319LCAgLy9FTCBTQUxWQURPUgorICAgICAgICB7IFJFR0RPTUFJTl9OT181R0haLCB7J1MnLCAnWSd9fSwgIC8vU1lSSUFOIEFSQUIgUkVQVUJMSUMKKyAgICAgICAgeyBSRUdET01BSU5fTk9fNUdIWiwgeydTJywgJ1onfX0sICAvL1NXQVpJTEFORAorICAgICAgICB7IFJFR0RPTUFJTl9FVFNJLCAgICB7J1QnLCAnQyd9fSwgIC8vVFVSS1MgQU5EIENBSUNPUyBJU0xBTkRTCisgICAgICAgIHsgUkVHRE9NQUlOX05PXzVHSFosIHsnVCcsICdEJ319LCAgLy9DSEFECisgICAgICAgIHsgUkVHRE9NQUlOX0VUU0ksICAgIHsnVCcsICdGJ319LCAgLy9GUkVOQ0ggU09VVEhFUk4gVEVSUklUT1JJRVMKKyAgICAgICAgeyBSRUdET01BSU5fTk9fNUdIWiwgeydUJywgJ0cnfX0sICAvL1RPR08KKyAgICAgICAgeyBSRUdET01BSU5fV09STEQsICAgeydUJywgJ0gnfX0sICAvL1RIQUlMQU5ECisgICAgICAgIHsgUkVHRE9NQUlOX05PXzVHSFosIHsnVCcsICdKJ319LCAgLy9UQUpJS0lTVEFOCisgICAgICAgIHsgUkVHRE9NQUlOX1dPUkxELCAgIHsnVCcsICdLJ319LCAgLy9UT0tFTEFVCisgICAgICAgIHsgUkVHRE9NQUlOX1dPUkxELCAgIHsnVCcsICdMJ319LCAgLy9USU1PUi1MRVNURQorICAgICAgICB7IFJFR0RPTUFJTl9OT181R0haLCB7J1QnLCAnTSd9fSwgIC8vVFVSS01FTklTVEFOCisgICAgICAgIHsgUkVHRE9NQUlOX05fQU1FUl9FWENfRkNDLCB7J1QnLCAnTid9fSwgIC8vVFVOSVNJQQorICAgICAgICB7IFJFR0RPTUFJTl9OT181R0haLCB7J1QnLCAnTyd9fSwgIC8vVE9OR0EKKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydUJywgJ1InfX0sICAvL1RVUktFWQorICAgICAgICB7IFJFR0RPTUFJTl9XT1JMRCwgICB7J1QnLCAnVCd9fSwgIC8vVFJJTklEQUQgQU5EIFRPQkFHTworICAgICAgICB7IFJFR0RPTUFJTl9OT181R0haLCB7J1QnLCAnVid9fSwgIC8vVFVWQUxVCisgICAgICAgIHsgUkVHRE9NQUlOX0ZDQywgICAgIHsnVCcsICdXJ319LCAgLy9UQUlXQU4sIFBST1ZJTkNFIE9GIENISU5BCisgICAgICAgIHsgUkVHRE9NQUlOX0hJXzVHSFosIHsnVCcsICdaJ319LCAgLy9UQU5aQU5JQSwgVU5JVEVEIFJFUFVCTElDIE9GCisgICAgICAgIHsgUkVHRE9NQUlOX1dPUkxELCAgIHsnVScsICdBJ319LCAgLy9VS1JBSU5FCisgICAgICAgIHsgUkVHRE9NQUlOX0tPUkVBLCAgIHsnVScsICdHJ319LCAgLy9VR0FOREEKKyAgICAgICAgeyBSRUdET01BSU5fRkNDLCAgICAgeydVJywgJ00nfX0sICAvL1VOSVRFRCBTVEFURVMgTUlOT1IgT1VUTFlJTkcgSVNMQU5EUworICAgICAgICB7IFJFR0RPTUFJTl9XT1JMRCwgICB7J1UnLCAnWSd9fSwgIC8vVVJVR1VBWQorICAgICAgICB7IFJFR0RPTUFJTl9GQ0MsICAgICB7J1UnLCAnWid9fSwgIC8vVVpCRUtJU1RBTgorICAgICAgICB7IFJFR0RPTUFJTl9FVFNJLCAgICB7J1YnLCAnQSd9fSwgIC8vSE9MWSBTRUUgKFZBVElDQU4gQ0lUWSBTVEFURSkKKyAgICAgICAgeyBSRUdET01BSU5fV09STEQsICAgeydWJywgJ0MnfX0sICAvL1NBSU5UIFZJTkNFTlQgQU5EIFRIRSBHUkVOQURJTkVTCisgICAgICAgIHsgUkVHRE9NQUlOX0hJXzVHSFosIHsnVicsICdFJ319LCAgLy9WRU5FWlVFTEEKKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydWJywgJ0cnfX0sICAvL1ZJUkdJTiBJU0xBTkRTLCBCUklUSVNICisgICAgICAgIHsgUkVHRE9NQUlOX0ZDQywgICAgIHsnVicsICdJJ319LCAgLy9WSVJHSU4gSVNMQU5EUywgVVMKKyAgICAgICAgeyBSRUdET01BSU5fRkNDLCAgICAgeydWJywgJ04nfX0sICAvL1ZJRVQgTkFNCisgICAgICAgIHsgUkVHRE9NQUlOX05PXzVHSFosIHsnVicsICdVJ319LCAgLy9WQU5VQVRVCisgICAgICAgIHsgUkVHRE9NQUlOX1dPUkxELCAgIHsnVycsICdGJ319LCAgLy9XQUxMSVMgQU5EIEZVVFVOQQorICAgICAgICB7IFJFR0RPTUFJTl9OX0FNRVJfRVhDX0ZDQywgeydXJywgJ1MnfX0sICAvL1NPTU9BCisgICAgICAgIHsgUkVHRE9NQUlOX05PXzVHSFosIHsnWScsICdFJ319LCAgLy9ZRU1FTgorICAgICAgICB7IFJFR0RPTUFJTl9FVFNJLCAgICB7J1knLCAnVCd9fSwgIC8vTUFZT1RURQorICAgICAgICB7IFJFR0RPTUFJTl9XT1JMRCwgICB7J1onLCAnQSd9fSwgIC8vU09VVEggQUZSSUNBCisgICAgICAgIHsgUkVHRE9NQUlOX0FQQUMsICAgIHsnWicsICdNJ319LCAgLy9aQU1CSUEKKyAgICAgICAgeyBSRUdET01BSU5fRVRTSSwgICAgeydaJywgJ1cnfX0sICAvL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vbWFpbklkdG9TdHJpbmcodl9VOF90IGRvbWFpbklkQ3VycmVudCkKK3sKKyAgICBzd2l0Y2ggKGRvbWFpbklkQ3VycmVudCkKKyAgICB7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyggUkVHRE9NQUlOX0ZDQyApOworICAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoIFJFR0RPTUFJTl9FVFNJICk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyggUkVHRE9NQUlOX0pBUEFOICk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyggUkVHRE9NQUlOX1dPUkxEICk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyggUkVHRE9NQUlOX05fQU1FUl9FWENfRkNDICk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyggUkVHRE9NQUlOX0FQQUMgKTsKKyAgICAgICAgQ0FTRV9SRVRVUk5fU1RSSU5HKCBSRUdET01BSU5fS09SRUEgKTsKKyAgICAgICAgQ0FTRV9SRVRVUk5fU1RSSU5HKCBSRUdET01BSU5fSElfNUdIWiApOworICAgICAgICBDQVNFX1JFVFVSTl9TVFJJTkcoIFJFR0RPTUFJTl9OT181R0haICk7CisgICAgICAgIENBU0VfUkVUVVJOX1NUUklORyggUkVHRE9NQUlOX0NPVU5UICk7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICByZXR1cm4gIlJlZ3VsYXRpb24gRG9tYWluIFVua25vd24iOworICAgIH0KK30KKy8qKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBcYnJpZWYgdm9zX252X2luaXQoKSAtIGluaXRpYWxpemUgdGhlIE5WIG1vZHVsZQorICBUaGUgXGEgdm9zX252X2luaXQoKSBpbml0aWFsaXplcyB0aGUgTlYgbW9kdWxlLiAgVGhpcyByZWFkIHRoZSBiaW5hcnkKKyAgZm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bGRzLAorICAgICAgICAgICAgICAgIChjaGFyICopJm52MlRhYmxlLT5maWVsZHMsCisgICAgICAgICAgICAgICAgc2l6ZW9mKHNOdkZpZWxkcykpOworICAgc3RydWN0U2l6ZSArPSBzaXplb2Yoc052RmllbGRzKTsKKyAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICIlczogc2l6ZW9mKHNOdkZpZWxkcykgJXp1LCBzdHJ1Y3RTaXplICVkIiwKKyAgICAgICAgICAgICAgX19mdW5jX18sIHNpemVvZihzTnZGaWVsZHMpLCBzdHJ1Y3RTaXplKTsKKworICAgLyogTlYgVGFibGUsIHRSYXRlR3JvdXBQd3IsIE5PVCBkZXBlbmRzIG9uIGNoYW5uZWwgY291bnQgKi8KKyAgIHZvc19tZW1fY29weSgoY2hhciAqKWhhbE52LT50YWJsZXMucHdyT3B0aW11bSwKKyAgICAgICAgICAgICAgICAoY2hhciAqKW52MlRhYmxlLT50YWJsZXMucHdyT3B0aW11bSwKKyAgICAgICAgICAgICAgICBzaXplb2YoaGFsTnYtPnRhYmxlcy5wd3JPcHRpbXVtKSk7CisgICBzdHJ1Y3RTaXplICs9IHNpemVvZihoYWxOdi0+dGFibGVzLnB3ck9wdGltdW0pOworICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgIiVzOiBzaXplb2YoaGFsTnYtPnRhYmxlcy5wd3JPcHRpbXVtKSAlenUsIHN0cnVjdFNpemUgJWQiLAorICAgICAgICAgICAgICBfX2Z1bmNfXywgc2l6ZW9mKGhhbE52LT50YWJsZXMucHdyT3B0aW11bSksIHN0cnVjdFNpemUpOworCisgICAvKiBOViBUYWJsZSwgcmVnRG9tYWlucywgZWRlcGVuZHMgb24gY2hhbm5lbCBjb3VudCAqLworICAgZm9yIChjb3B5TG9vcCA9IDA7IGNvc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CA9PSBjaGFubmVsTG9vcCkgfHwgKFJGX0NIQU5fQk9ORF8xNDIgPT0gY2hhbm5lbExvb3ApKQorICAgICAgICAgeworICAgICAgICAgICAgdGFyZ2V0UHRyID0gdGFyZ2V0UHRyICsgc2l6ZW9mKHVBYnNQd3JQcmVjaXNpb24pOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9DSDE0NCAqLworICAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHRhcmdldFB0ciwgc291cmNlUHRyLCBzaXplb2YodUFic1B3clByZWNpc2lvbikpOworICAgICAgICAgICAgdGFyZ2V0UHRyID0gdGFyZ2V0UHRyICsgc2l6ZW9mKHVBYnNQd3JQcmVjaXNpb24pOworICAgICAgICAgICAgc291cmNlUHRyID0gc291cmNlUHRyICsgc2l6ZW9mKHVBYnNQd3JQcmVjaXNpb24pOworICAgICAgICAgICAgc3RydWN0U2l6ZSArPSBzaXplb2Yoc2l6ZW9mKHVBYnNQd3JQcmVjaXNpb24pKTsKKyAgICAgICAgIH0KKyAgICAgIH0KKyAgIH0KKyAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICIlczogc2l6ZW9mKHVBYnNQd3JQcmVjaXNpb24pICV6dSwgc3RydWN0U2l6ZSAlZCIsCisgICAgICAgICAgICAgIF9fZnVuY19fLCBzaXplb2YodUFic1B3clByZWNpc2lvbiksIHN0cnVjdFNpemUpOworCisgICAvKiBudlRhYmxlLCBkZWZhdWx0Q291bnRyeVRhYmxlLCBOT1QgZGVwZW5kcyBvbiBjaGFubmVsIGNvdW50cyAqLworICAgdm9zX21lbV9jb3B5KChjaGFyICopJmhhbE52LT50YWJsZXMuZGVmYXVsdENvdW50cnlUYWJsZSwKKyAgICAgICAgICAoY2hhciAqKSZudjJUYWJsZS0+dGFibGVzLmRlZmF1bHRDb3VudH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cywgZGVwZW5kcyBvbiBjaGFubmVsIGNvdW50CisgICAgKiBDYW5ub3QgYmxpbmRseSBjb3B5CisgICAgKiBFYWNoIHNpbmdsZSBDSCBzaG91bGQgYmUgYXNzaWduZWQgKi8KKyAgIGZvciAoY29weUxvb3AgPSAwOyBjb3B5TG9vcCA8IDI7IGNvcHlMb29wKyspCisgICB7CisgICAgICB0YXJnZXRQdHIgPSAoY2hhciAqKSYoaGFsTnYtPnRhYmxlcy5yc3NpQ2hhbk9mZnNldHNbY29weUxvb3BdLmJSc3NpT2Zmc2V0WzBdKTsKKyAgICAgIHNvdXJjZVB0ciA9IChjaGFyICopJihudjJUYWJsZS0+dGFibGVzLnJzc2lDaGFuT2Zmc2V0c1tjb3B5TG9vcF0uYlJzc2lPZmZzZXRbMF0pOworICAgICAgLyogQ2Fubm90IGJsaW5kbHkgY29weQorICAgICAgICogRWFjaCBzaW5nbGUgQ0ggc2hvdWxkIGJlIGFzc2lnbmVkICovCisgICAgICBmb3IgKGNoYW5uZWxMb29wID0gMDsgY2hhbm5lbExvb3AgPCBOVU1fUkZfQ0hBTk5FTFM7IGNoYW5uZWxMb29wKyspCisgICAgICB7CisjaWZkZWYgRkVBVFVSRV9XTEFOX0NIMTQ0CisgICAgICAgICBpZiAoKFJGX0NIQU5fMTQ0ID09IGNoYW5uZWxMb29wKSB8fCAoUkZfQ0hBTl9CT05EXzE0MiA9PSBjaGFubmVsTG9vcCkpCisgICAgICAgICB7CisgICAgICAgICAgICB0YXJnZXRQdHIgPSB0YXJnZXRQdHIgKyBzaXplb2YoaW50MTYpOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9DSDE0NCAqLworICAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHRhcmdldFB0ciwgc291cmNlUHRyLCBzaXplb2YoaW50MTYpKTsKKyAgICAgICAgICAgIHRhcmdldFB0ciA9IHRhcmdldFB0ciArIHNpemVvZihpbnQxNik7CisgICAgICAgICAgICBzb3VyY2VQdHIgPSBzb3VyY2VQdHIgKyBzaXplb2YoaW50MTYpOworICAgICAgICAgICAgc3RydWN0U2l6ZSArPSBzaXplb2YoaW50MTYpOworICAgICAgICAgfQorICAgICAgfQorICAgfQorICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgIiVzOiBzaXplb2YodGFibGVzLnJzc2lDaGFuT2Zmc2V0cykgJXp1LCBzdHJ1Y3RTaXplICVkIiwKKyAgICAgICAgICAgICAgX19mdW5jX18sIHNpemVvZihpbnQxNiksIHN0cnVjdFNpemUpOworCisgICBmb3IgKGNvcHlMb29wID0gMDsgY29weUxvb3AgPCAyOyBjb3B5TG9vcCsrKQorICAgeworICAgICAgdGFyZ2V0UHRyID0gKGNoYXIgKikmKGhhbE52LT50YWJsZXMucnNzaUNoYW5PZmZzZXRzW2NvcHlMb29wXS5nblJzc2lPZmZzZXRbMF0pOworICAgICAgc291cmNlUHRyID0gKGNoYXIgKikmKG52MlRhYmxlLT50YWJsZXMucnNzaUNoYW5PZmZzZXRzW2NvcHlMb29wXS5nblJzc2lPZmZzZXRbMF0pOworICAgICAgLyogQ2Fubm90IGJsaW5kbHkgY29weQorICAgICAgICogRWFjaCBzaW5nbGUgQ0ggc2hvdWxkIGJlIGFzc2lnbmVkICovCisgICAgICBmb3IgKGNoYW5uZWxMb29wID0gMDsgY2hhbm5lbExvb3AgPCBOVU1fUkZfQ0hBTk5FTFM7IGNoYW5uZWxMb29wKyspCisgICAgICB7CisjaWZkZWYgRkVBVFVSRV9XTEFOX0NIMTQ0CisgICAgICAgICBpZiAoKFJGX0NIQU5fMTQ0ID09IGNoYW5uZWxMb29wKSB8fCAoUkZfQ0hBTl9CT05EXzE0MiA9PSBjaGFubmVsTG9vcCkpCisgICAgICAgICB7CisgICAgICAgICAgICB0YXJnZXRQdHIgPSB0YXJnZXRQdHIgKyBzaXplb2YoaW50MTYpOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9DSDE0NCAqLworICAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHRhcmdldFB0ciwgc291cmNlUHRyLCBzaXplb2YoaW50MTYpKTsKKyAgICAgICAgICAgIHRhcmdldFB0ciA9IHRhcmdldFB0ciArIHNpemVvZihpbnQxNik7CisgICAgICAgICAgICBzb3VyY2VQdHIgPSBzb3VyY2VQdHIgKyBzaXplb2YoaW50MTYpOworICAgICAgICAgICAgc3RydWN0U2l6ZSArPSBzaXplb2YoaW50MTYpOworICAgICAgICAgfQorICAgICAgfQorICAgfQorICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgIiVzOiBzaXplb2YodGFibGVzLnJzc2lDaGFuT2Zmc2V0cykgJXp1LCBzdHJ1Y3RTaXplICVkIiwKKyAgICAgICAgICAgICAgX19mdW5jX18sIHNpemVvZihpbnQxNiksIHN0cnVjdFNpemUpOworCisgICAvKiBOViBUYWJsZSwgaHdDYWxWYWx1ZXMsIE5PVCBkZXBlbmRzIG9uIGNoYW5uZWwgY291bnQgKi8KKyAgIHZvc19tZW1fY29weSgoY2hhciAqKSZoYWxOdi0+dGFibGVzLmh3Q2FsVmFsdWVzLAorICAgICAgICAgIChjaGFyICopJm52MlRhYmxlLT50YWJsZXMuaHdDYWxWYWx1ZXMsCisgICAgICAgICAgc2l6ZW9mKGhhbE52LT50YWJsZXMuaHdDYWxWYWx1ZXMpKTsKKyAgIHN0cnVjdFNpemUgKz0gc2l6ZW9mKGhhbE52LT50YWJsZXMuZndDb25maWcpOworICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgIiVzOiBzaXplb2YoaGFsTnYtPnRhYmxlcy5od0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MTQyID09IGNoYW5uZWxMb29wKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHRhcmdldFB0ciA9IHRhcmdldFB0ciArIHNpemVvZihpbnQxNik7CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0NIMTQ0ICovCisgICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkodGFyZ2V0UHRyLCBzb3VyY2VQdHIsIHNpemVvZihpbnQxNikpOworICAgICAgICAgICAgdGFyZ2V0UHRyID0gdGFyZ2V0UHRyICsgc2l6ZW9mKGludDE2KTsKKyAgICAgICAgICAgIHNvdXJjZVB0ciA9IHNvdXJjZVB0ciArIHNpemVvZihpbnQxNik7CisgICAgICAgICAgICBzdHJ1Y3RTaXplICs9IHNpemVvZihpbnQxNik7CisgICAgICAgICB9CisgICAgICB9CisgICB9CisgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAiJXM6IHNpemVvZihoYWxOdi0+dGFibGVzLnBrdFR5cGVQd3JMaW1pdHMpICV6dSwgc3RydWN0U2l6ZSAlZCIsCisgICAgICAgICAgICAgIF9fZnVuY19fLCBzaXplb2YoaW50MTYpLCBzdHJ1Y3RTaXplKTsKKworICAgLyogTlYgVGFibGUsIG9mZG1DbWRQd3JPZmZzZXQsIE5PVCBkZXBlbmRzIG9uIGNoYW5uZWwgY291bnQgKi8KKyAgIHZvc19tZW1fY29weSgoY2hhciAqKSZoYWxOdi0+dGFibGVzLm9mZG1DbWRQd3JPZmZzZXQsCisgICAgICAgICAgKGNoYXIgKikmbnYyVGFibGUtPnRhYmxlcy5vZmRtQ21kUHdyT2Zmc2V0LAorICAgICAgICAgIHNpemVvZihoYWxOdi0+dGFibGVzLm9mZG1DbWRQd3JPZmZzZXQpKTsKKyAgIHN0cnVjdFNpemUgKz0gc2l6ZW9mKGhhbE52LT50YW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KikoKFZvc0NvbnRleHRUeXBlKikKKyAgICAgICAgICAgICAgICAgICAgICAgIChwVm9zQ29udGV4dCkpLT5wSEREQ29udGV4dCktPm52KTsKKworICAgIHZvc19tZW1fY29weSgmbWFnaWNOdW1iZXIsICZwbnZFbmNvZGVkQnVmW3NpemVvZih2X1UzMl90KV0sIHNpemVvZih2X1UzMl90KSk7CisKKyAgICAvLy8gQWxsb2NhdGUgYnVmZmVyIHdpdGggbWF4aW11bSBsZW5ndGguLgorICAgIHBFbmNvZGVkQnVmID0gKHZfVThfdCAqKXZvc19tZW1fdm1hbGxvYyhudlJlYWRCdWZTaXplKTsKKworICAgIGlmIChOVUxMID09IHBFbmNvZGVkQnVmKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiJXMgOiBmYWlsZWQgdG8gYWxsb2NhdGUgbWVtb3J5IGZvciBOViIsIF9fZnVuY19fKTsKKyAgICAgICAgdm9zX21lbV92ZnJlZShwbnZFbmNvZGVkQnVmKTsKKyAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9OT01FTTsKKyAgICB9CisKKyAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgIk5WIFRhYmxlIFNpemUgJXp1Iiwgc2l6ZW9mKG52RUZTVGFibGVfdCkpOworCisgICAgcG52RUZTVGFibGUgPSAobnZFRlNUYWJsZV90ICopdm9zX21lbV92bWFsbG9jKHNpemVvZihudkVGU1RhYmxlX3QpKTsKKyAgICBpZiAoTlVMTCA9PSBwbnZFRlNUYWJsZSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlcyA6IGZhaWxlZCB0byBhbGxvY2F0ZSBtZW1vcnkgZm9yIE5WIiwgX19mdW5jX18pOworICAgICAgICB2b3NfbWVtX3ZmcmVlKHBudkVuY29kZWRCdWYpOworICAgICAgICB2b3NfbWVtX3ZmcmVlKHBFbmNvZGVkQnVmKTsKKyAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9OT01FTTsKKyAgICB9CisgICAgdm9zX21lbV96ZXJvKCh2b2lkICopcG52RUZTVGFibGUsIHNpemVvZihudkVGU1RhYmxlX3QpKTsKKworICAgIC8vIERlZmF1bHQgTlYgdmVyc2lvbiwgTk9UX1ZBTElECisgICAgKChWb3NDb250ZXh0VHlwZSopKHBWb3NDb250ZXh0KSktPm52VmVyc2lvbiA9IEVfTlZfSU5WQUxJRDsKKyAgICBpZiAoTUFHSUNfTlVNQkVSID09IG1hZ2ljTnVtYmVyKQorICAgIHsKKyAgICAgICAgYnVmU2l6ZSA9IHNpemVvZihudkVGU1RhYmxlX3QpOworICAgICAgICBnbnZFRlNUYWJsZSA9IChudkVGU1RhYmxlX3QqKXBudkVuY29kZWRCdWY7CisgICAgICAgIHBudkRhdGEgPSAoc0hhbE52ICopdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHNIYWxOdikpOworCisgICAgICAgIGlmIChOVUxMID09IHBudkRhdGEpCisgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAiJXMgOiBmYWlsZWQgdG8gYWxsb2NhdGUgbWVtb3J5IGZvciBOViIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHZvc19tZW1fdmZyZWUocG52RW5jb2RlZEJ1Zik7CisgICAgICAgICAgICB2b3NfbWVtX3ZmcmVlKHBFbmNvZGVkQnVmKTsKKyAgICAgICAgICAgIHZvc19tZW1fdmZyZWUocG52RUZTVGFibGUpOworICAgICAgICAg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c3MgISFwcm9kdWN0SWQgJWQgY291cGxlIFR5cGUgJWQgd2xhbiBSZXZJZCAlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICBwbnZEYXRhLT5maWVsZHMucHJvZHVjdElkLAorICAgICAgICAgICAgICAgICAgICAgICAgcG52RGF0YS0+ZmllbGRzLmNvdXBsZXJUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgcG52RGF0YS0+ZmllbGRzLndsYW5OdlJldklkKTsKKworICAgICAgICAgICB2b3NfbWVtX2NvcHkoJmdudkVGU1RhYmxlLT5oYWxudiwgcG52RGF0YSwgc2l6ZW9mKHNIYWxOdikpOworCisgICAgICAgICAgIG52UmVhZEJ1ZlNpemUgPSBzaXplb2Yoc0hhbE52KSArIHNpemVvZih2X1UzMl90KTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIm52UGFyc2VyIGZhaWxlZCAlZCIsc3RhdHVzKTsKKworICAgICAgICAgICBpZiAobnZSZWFkQnVmU2l6ZSAhPSBzaXplb2Yoc0hhbE52KSkgeworICAgICAgICAgICAgICAgdm9zX21lbV92ZnJlZShwRW5jb2RlZEJ1Zik7CisgICAgICAgICAgICAgICBwRW5jb2RlZEJ1ZiA9ICh2X1U4X3QgKil2b3NfbWVtX3ZtYWxsb2Moc2l6ZW9mKHNIYWxOdikpOworCisgICAgICAgICAgICAgICBpZiAoIXBFbmNvZGVkQnVmKSB7CisgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXMgOiBmYWlsZWQgdG8gYWxsb2NhdGUgbWVtb3J5IGZvciBOViIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocG52RGF0YSk7CisgICAgICAgICAgICAgICAgICAgdm9zX21lbV92ZnJlZShwbnZFbmNvZGVkQnVmKTsKKyAgICAgICAgICAgICAgICAgICB2b3NfbWVtX3ZmcmVlKHBudkVGU1RhYmxlKTsKKyAgICAgICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX05PTUVNOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICB9CisKKyAgICAgICAgICAgbnZSZWFkQnVmU2l6ZSA9IDA7CisKKyAgICAgICAgICAgdm9zX21lbV9jb3B5KHBFbmNvZGVkQnVmLCAmbnZEZWZhdWx0cywgc2l6ZW9mKHNIYWxOdikpOworCisgICAgICAgICAgIG52UmVhZEVuY29kZUJ1ZlNpemUgPSBzaXplb2Yoc0hhbE52KTsKKyAgICAgICAgfQorICAgICAgICB2b3NfbWVtX2NvcHkoJihwbnZFRlNUYWJsZS0+aGFsbnYpLCAmbnZEZWZhdWx0cywgc2l6ZW9mKHNIYWxOdikpOworCisgICAgICAgIC8qIE5WIHZlcmlvbiBpcyBOVjMgKi8KKyAgICAgICAgKChWb3NDb250ZXh0VHlwZSopKHBWb3NDb250ZXh0KSktPm52VmVyc2lvbiA9IEVfTlZfVjM7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGJ1ZlNpemUgPSBzaXplb2YobnZFRlNUYWJsZVYyX3QpOworCisgICAgICAgIC8qQ29weWluZyB0aGUgTlYgZGVmYXVsdHMgKi8KKyAgICAgICAgdm9zX21lbV9jb3B5KCYocG52RUZTVGFibGUtPmhhbG52KSwgJm52RGVmYXVsdHMsIHNpemVvZihzSGFsTnYpKTsKKyAgICAgICAgLyogTlYyIHN0cnVjdHVyZSBzaG91bGQgYmUgbWFpbnRhaW5lZCB0byBzdXBwb3J0IE5WX0ZUTSAqLworICAgICAgICBnbnZFRlNUYWJsZVYyID0gKG52RUZTVGFibGVWMl90ICogKXBudkVuY29kZWRCdWY7CisKKyAgICAgICAgLyogU2l6ZSBtaXNtYXRjaAorICAgICAgICAgKiBOViAxIGNhc2UsIHVzZSBkZWZhdWx0IE5WIHRhYmxlICovCisgICAgICAgIGlmIChudlJlYWRCdWZTaXplICE9IGJ1ZlNpemUpCisgICAgICAgIHsKKyAgICAgICAgICAgIHBudkVGU1RhYmxlLT5udlZhbGlkaXR5Qml0bWFwID0gREVGQVVMVF9OVl9WQUxJRElUWV9CSVRNQVA7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgICAgIlNpemUgIG1pc21hdGNoIElOVkFMSUQgTlYgRklMRSAlZCAlZCEhISIsCisgICAgICAgICAgICAgICAgICAgICAgbnZSZWFkQnVmU2l6ZSwgYnVmU2l6ZSk7CisgICAgICAgICAgICB2b3NfbWVtX3ZmcmVlKHBudkVuY29kZWRCdWYpOworICAgICAgICAgICAgdm9zX21lbV92ZnJlZShwRW5jb2RlZEJ1Zik7CisgICAgICAgICAgICB2b3NfbWVtX3ZmcmVlKHBudkVGU1RhYmxlKTsKKyAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICAgICAgfQorCisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsICBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICJOVl8yOiByZWFkQnVmZmVyU2l6ZSAldSwgRUZTVjJEZWZhdWx0U2l6ZSAlenUiLAorICAgICAgICAgICAgICAgICAgbnZSZWFkQnVmU2l6ZSwgc2l6ZW9mKG52RUZTVGFibGVWMl90KSk7CisKKyAgICAgICAgLyogRnJvbSBoZXJlLCBOVjIgd2lsbCBiZSBzdG9yZWQgaW50byBOVjMgc3RydWN0dXJlICovCisgICAgICAgIGRhdGFPZmZzZXQgPSBzaXplb2Yodl9VMzJfdCk7CisgICAgICAgIG52UmVhZEVuY29kZUJ1ZlNpemUgPSBzaXplb2Yoc0hhbE52VjIpOworICAgICAgICBpZiAobnZSZWFkQnVmU2l6ZSAhPSBudlJlYWRFbmNvZGVCdWZTaXplKQorICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX3ZmcmVlKHBFbmNvZGVkQnVmKTsKKyAgICAgICAgICAgIHBFbmNvZGVkQnVmID0gKHZfVThfdCAqKXZvc19tZW1fdm1hbGxvYyhudlJlYWRFbmNvZGVCdWZTaXplKTsKKyAgICAgICAgICAgIGlmICghcEVuY29kZWRCdWYpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAiJXMgOiBmYWlsZWQgdG8gYWxsb2NhdGUgbWVtb3J5IGZvciBOViIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX3ZmcmVlKHBudkVuY29kZWRCdWYpOworICAgICAgICAgICAgICAgIHZvc19tZW1fdmZyZWUocG52RUZTVGFibGUpOworICAgICAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfTk9NRU07CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgdm9zX21lbV9jb3B5KHBFbmNvZGVkQnVmLAorICAgICAgICAgICAgICAgICAgICAgJnBudkVuY29kZWRCdWZbZGF0YU9mZnNldF0sCisgICAgICAgICAgICAgICAgICAgICBudlJlYWRCdWZTaXplIC0gZGF0YU9mZnNldCk7CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fQ0gxNDQKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICJEZWZhdWx0IE5WMiBzaXplICV6dSIsIHNpemVvZihudkRlZmF1bHRzVjIpKTsKKyNlbHNlCisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAiRGVmYXVsdCBOVjIgc2l6ZSAlenUiLCBzaXplb2YobnZEZWZhdWx0cykpOworI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9DSDE0NCAqLworICAgICAgICAvKiBGaXJzdCBhc3NpZ24gdmFsdWUgd2l0aCBOViBkZWZhdWx0ICovCisjaWZkZWYgRkVBVFVSRV9XTEFOX0NIMTQ0CisgICAgICAgIHZvc19udl9wYXJzZVYyYmluKCh0QU5JX1U4ICopJm52RGVmYXVsdHNWMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHNIYWxOdlYyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJnBudkVGU1RhYmxlLT5oYWxudik7CisjZWxzZQorICAgICAgICB2b3NfbnZfcGFyc2VWMmJpbigodEFOSV9VOCAqKSZudkRlZmF1bHRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2Yoc0hhbE52VjIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAmcG52RUZTVGFibGUtPmhhbG52KTsKKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fQ0gxNDQgKi8KKworICAgICAgICAvKiBBY3R1YWwgdXBkYXRlIGZyb20gTlYuYmluICovCisgICAgICAgIHZvc19udl9wYXJzZVYyYmluKHBFbmNvZGVkQnVmLAorICAgICAgICAgICAgICAgICAgICAgICAgICBudlJlYWRFbmNvZGVCdWZTaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgICAmcG52RUZTVGFibGUtPmhhbG52KTsKKworICAgICAgICB2b3NfbWVtX2NvcHkoKHZvaWQgKikmcG52RUZTVGFibGUtPm52VmFsaWRpdHlCaXRtYXAsCisgICAgICAgICAgICAgICAgICAgICBwbnZFbmNvZGVkQnVmLCBzaXplb2Yodl9VMzJfdCkpOworICAgICAgICBnbnZFRlNUYWJsZSA9IHBudkVGU1RhYmxlOworCisgICAgICAgIC8qIE5WIHZlcmlvbiBpcyBOVjIgKi8KKyAgICAgICAgKChWb3NDb250ZXh0VHlwZSopKHBWb3NDb250ZXh0KSktPm52VmVyc2lvbiA9IEVfTlZfVjI7CisgICAgfQorCisgICAgaWYgKE5VTEwgIT0gcG52RGF0YSkKKyAgICB7CisgICAgICAgdm9zX21lbV9mcmVlKHBudkRhdGEpOworICAgIH0KKworICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgIklORk86IE5WIHZlcnNpb24gPSAlZCBpcyBsb2FkZWQsIGRyaXZlciBzdXBwb3J0cyBOViB2ZXJzaW9uID0gJWQiLAorICAgICAgICBnbnZFRlNUYWJsZS0+aGFsbnYuZmllbGRzLm52VmVyc2lvbiwgV0xBTl9OVl9WRVJTSU9OKTsKKworICAgICAvKiBDb3B5aW5nIHRoZSByZWFkIG52IGRhdGEgdG8gdGhlIGdsb2JhIE5WIEVGUyB0YWJsZSAqLworICAgIHsKKyAgICAgICAvKiBWZXJzaW9uIG1pc21hdGNoICovCisgICAgICAgaWYgKGdudkVGU1RhYmxlLT5oYWxudi5maWVsZHMubnZWZXJzaW9uICE9IFdMQU5fTlZfVkVSU0lPTikKKyAgICAgICB7CisgICAgICAgICAgIGlmICgoV0xBTl9OVl9WRVJTSU9OID09IE5WX1ZFUlNJT05fMTFOXzExQUNfRldfQ09ORklHKSAmJgorICAgICAgICAgICAgICAgKGdudkVGU1RhYmxlLT5oYWxudi5maWVsZHMubnZWZXJzaW9uID09IE5WX1ZFUlNJT05fMTFOXzExQUNfQ09VUEVSX1RZUEUpKQorICAgICAgICAgICB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgIklORk86IFVzaW5nIENvdXBsZXIgVHlwZSBmaWVsZCBpbnN0ZWFkIG9mIEZXIENvbmZpZyB0YWJsZSwgIgorICAgICAgICAgICAgICAgICAgICJtYWtlIHN1cmUgdGhhdCB0aGlzIGlzIGludGVuZGVkIG9yIG1heSBpbXBhY3QgcGVyZm9ybWFuY2UuIik7CisgICAgICAgICAgIH0KKyNpZmRlZiBGRUFUVVJFX1dMQU5fQ0gxNDQKKyAgICAgICAgICAgZWxzZSBpZiAoKFdMQU5fTlZfVkVSU0lPTiA9PSBOVl9WRVJTSU9OX0NIMTQ0X0NPTkZJRykgJiYKKyAgICAgICAgICAgICAgICAgICAgKCgoVm9zQ29udGV4dFR5cGUqKShwVm9zQ29udGV4dCkpLT5udlZlcnNpb24gPT0gRV9OVl9WMikpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiSU5GTzogRHJpdmVyIHN1cHBvcnRzIE5WMyBDSDE0NCBieSBkZWZhdWx0LCAiCisgICAgICAgICAgICAgICAgICAgIk5WMiBpcyBjdXJyZW50bHkgbG9hZGVkLCBOVjIgd2lsbCBiZSB1c2VkLiIpOworICAgICAgICAgICB9CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0NIMTQ0ICovCisgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICJJTkZPOiBOViBsb2FkZWQgZG9lc24ndCBtYXRjaCB3aXRoIGRyaXZlciBkZWZhdWx0IE5WLCAiCisgICAgICAgICAgICAgICAgICAgImRyaXZlciBkZWZhdWx0IE5WIHdpbGwgYmUgdXNlZCwgbWF5IGltcGFjdCBwZXJmb3JtYW5jZS4iKTsKKworICAgICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgfQorICAgICAgIH0KKworICAgICAgIHBudkVGU1RhYmxlLT5udlZhbGlkaXR5Qml0bWFwID0gZ252RUZTVGFibGUtPm52VmFsaWRpdHlCaXRtYXA7CisgICAgICAgIC8qIENvcHkgdGhlIHZhbGlkIGZpZWxkcyB0byB0aGUgTlYgR2xvYmFsIHN0cnVjdHVyZSAqLworICAgICAgICBpZiAodm9zX252X2dldFZhbGlkaXR5KFZOVl9GSUVMRF9JTUFHRSwgJml0ZW1Jc1ZhbGlkKSA9PQorICAgICAgICAgICBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChpdGVtSXNWYWxpZCA9PSBWT1NfVFJVRSkgeworCisgICAgICAgICAgICAgICAgaWYodm9zX252X3JlYWQoIFZOVl9GSUVMRF9JTUFHRSwgKHZfVk9JRF90ICopJnBudkVGU1RhYmxlLT5oYWxudi5maWVsZHMsCisgICAgICAgICAgICAgICAgICAgTlVMTCwgc2l6ZW9mKHNOdkZpZWxkcykgKSAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICAgICAgICAgZ290byBlcnJvcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmICh2b3NfbnZfZ2V0VmFsaWRpdHkoVk5WX1JBVEVfVE9fUE9XRVJfVEFCTEUsICZpdGVtSXNWYWxpZCkgPT0KKyAgICAgICAgICAgICBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChpdGVtSXNWYWxpZCA9PSBWT1NfVFJVRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZih2b3NfbnZfcmVhZCggVk5WX1JBVEVfVE9fUE9XRVJfVEFCTEUsCisgICAgICAgICAgICAgICAgICAodl9WT0lEX3QgKikmcG52RUZTVGFibGUtPmhhbG52LnRhYmxlcy5wd3JPcHRpbXVtWzBdLAorICAgICAgICAgICAgICAgICAgTlVMTCwgc2l6ZW9mKHRSYXRlR3JvdXBQd3IpICogTlVNX1JGX1NVQkJBTkRTICkgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGVycm9yOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKHZvc19udl9nZXRWYWxpZGl0eShWTlZfUkVHVUxBUlRPUllfRE9NQUlOX1RBQkxFLCAmaXRlbUlzVmFsaWQpID09CisgICAgICAgICAgICAgICBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgIHsKKworICAgICAgICAgICAgaWYgKGl0ZW1Jc1ZhbGlkID09IFZPU19UUlVFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKHZvc19udl9yZWFkKCBWTlZfUkVHVUxBUlRPUllfRE9NQUlOX1RBQkxFLAorICAgICAgICAgICAgICAgICh2X1ZPSURfdCAqKSZwbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnJlZ0RvbWFpbnNbMF0sCisgICAgICAgICAgICAgICAgIE5VTEwsIHNpemVvZihzUmVndWxhdG9yeURvbWFpbnMpICogTlVNX1JFR19ET01BSU5TICkgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGVycm9yOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKHZvc19udl9nZXRWYWxpZGl0eShWTlZfREVGQVVMVF9MT0NBVElPTiwgJml0ZW1Jc1ZhbGlkKSA9PQorICAgICAgICAgICAgVk9TX1NUQVRVU19TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoaXRlbUlzVmFsaWQgPT0gVk9TX1RSVUUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYodm9zX252X3JlYWQoIFZOVl9ERUZBVUxUX0xPQ0FUSU9OLAorICAgICAgICAgICAgICAgICh2X1ZPSURfdCAqKSZwbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLmRlZmF1bHRDb3VudHJ5VGFibGUsCisgICAgICAgICAgICAgICAgTlVMTCwgc2l6ZW9mKHNEZWZhdWx0Q291bnRyeSkgKSAhPSAgVk9TX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGVycm9yOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcEhkZEN0eCA9IHZvc19nZXRfY29udGV4dChWT1NfTU9EVUxFX0lEX0hERCwgcFZvc0NvbnRleHQpOworICAgICAgICAgICAgaWYgKE5VTEwgIT0gcEhkZEN0eCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGlmICghdm9zX21lbV9jb21wYXJlKHBIZGRDdHgtPmNmZ19pbmktPm92ZXJyaWRlQ291bnRyeUNvZGUsCisgICAgICAgICAgICAgICAgICAgICBDRkdfT1ZFUlJJREVfQ09VTlRSWV9DT0RFX0RFRkFVTFQsIDMpKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCJPdmVycmlkaW5nIE5WIENvdW50cnkoJWMlYykgZnJvbSBJTkkgKCVjJWMpIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLmRlZmF1bHRDb3VudHJ5VGFibGUuY291bnRyeUNvZGVbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLmRlZmF1bHRDb3VudHJ5VGFibGUuY291bnRyeUNvZGVbMV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSGRkQ3R4LT5jZmdfaW5pLT5vdmVycmlkZUNvdW50cnlDb2RlWzBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+Y2ZnX2luaS0+b3ZlcnJpZGVDb3VudHJ5Q29kZVsxXSk7CisgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBudkVGU1RhYmxlLT5oYWxudi50YWJsZXMuZGVmYXVsdENvdW50cnlUYWJsZS5jb3VudHJ5Q29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+Y2ZnX2luaS0+b3ZlcnJpZGVDb3VudHJ5Q29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgMyk7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICgiSW52YWxpZCBwSGRkQ3R4IHBvaW50ZXIiKSApOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKHZvc19udl9nZXRWYWxpZGl0eShWTlZfVFBDX1BPV0VSX1RBQkxFLCAmaXRlbUlzVmFsaWQpID09CisgICAgICAgICAgICBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChpdGVtSXNWYWxpZCA9PSBWT1NfVFJVRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZih2b3NfbnZfcmVhZCggVk5WX1RQQ19QT1dFUl9UQUJMRSwKKyAgICAgICAgICAgICAgICAgICh2X1ZPSURfdCAqKSZwbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnBsdXRDaGFyYWN0ZXJpemVkWzBdLAorICAgICAgICAgICAgICAgICAgTlVMTCwgc2l6ZW9mKHRUcGNQb3dlclRhYmxlKSAqIE5VTV9SRl9DSEFOTkVMUyApICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICAgICAgZ290byBlcnJvcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmICh2b3NfbnZfZ2V0VmFsaWRpdHkoVk5WX1RQQ19QREFEQ19PRkZTRVRTLCAmaXRlbUlzVmFsaWQpID09CisgICAgICAgICAgICBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChpdGVtSXNWYWxpZCA9PSBWT1NfVFJVRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZih2b3NfbnZfcmVhZCggVk5WX1RQQ19QREFEQ19PRkZTRVRTLAorICAgICAgICAgICAgICAgICAgKHZfVk9JRF90ICopJnBudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucGx1dFBkYWRjT2Zmc2V0WzBdLAorICAgICAgICAgICAgICAgICAgTlVMTCwgc2l6ZW9mKHRBTklfVTE2KSAqIE5VTV9SRl9DSEFOTkVMUyApICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICAgICAgZ290byBlcnJvcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAodm9zX252X2dldFZhbGlkaXR5KFZOVl9SU1NJX0NIQU5ORUxfT0ZGU0VUUywgJml0ZW1Jc1ZhbGlkKSA9PQorICAgICAgICAgICBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChpdGVtSXNWYWxpZCA9PSBWT1NfVFJVRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZih2b3NfbnZfcmVhZCggVk5WX1JTU0lfQ0hBTk5FTF9PRkZTRVRTLAorICAgICAgICAgICAgICAgICAgKHZfVk9JRF90ICopJnBudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucnNzaUNoYW5PZmZzZXRzWzBdLAorICAgICAgICAgICAgICAgICAgTlVMTCwgc2l6ZW9mKHNSc3NpQ2hhbm5lbE9mZnNldHMpICogMiApICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICAgICAgZ290byBlcnJvcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmICh2b3NfbnZfZ2V0VmFsaWRpdHkoVk5WX0hXX0NBTF9WQUxVRVMsICZpdGVtSXNWYWxpZCkgPT0KKyAgICAgICAgIFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKGl0ZW1Jc1ZhbGlkID09IFZPU19UUlVFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKHZvc19udl9yZWFkKCBWTlZfSFdfQ0FMX1ZBTFVFUywgKHZfVk9JRF90ICopJnBudkVGU1RhYmxlLT5oYWxudgorICAgIC50YWJsZXMuaHdDYWxWYWx1ZXMsIE5VTEwsIHNpemVvZihzSHdDYWxWYWx1ZXMpICkgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGVycm9yOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKHZvc19udl9nZXRWYWxpZGl0eShWTlZfRldfQ09ORklHLCAmaXRlbUlzVmFsaWQpID09CisgICAgICAgICBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChpdGVtSXNWYWxpZCA9PSBWT1NfVFJVRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZih2b3NfbnZfcmVhZCggVk5WX0ZXX0NPTkZJRywgKHZfVk9JRF90ICopJnBudkVGU1RhYmxlLT5oYWxudgorICAgIC50YWJsZXMuZndDb25maWcsIE5VTEwsIHNpemVvZihzRndDb25maWcpICkgIT0gVk9TX1NUQVRVU19TVUNDRVNTKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGVycm9yOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKHZvc19udl9nZXRWYWxpZGl0eShWTlZfQU5URU5OQV9QQVRIX0xPU1MsICZpdGVtSXNWYWxpZCkgPT0KKyAgICAgICAgIFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKGl0ZW1Jc1ZhbGlkID09IFZPU19UUlVFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKHZvc19udl9yZWFkKCBWTlZfQU5URU5OQV9QQVRIX0xPU1MsCisgICAgICAgICAgICAgICAgICAodl9WT0lEX3QgKikmcG52RUZTVGFibGUtPmhhbG52LnRhYmxlcy5hbnRlbm5hUGF0aExvc3NbMF0sIE5VTEwsCisgICAgICAgICAgICAgICAgc2l6ZW9mKHRBTklfUzE2KSpOVU1fUkZfQ0hBTk5FTFMgKSAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZXJyb3I7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYgKHZvc19udl9nZXRWYWxpZGl0eShWTlZfUEFDS0VUX1RZUEVfUE9XRVJfTElNSVRTLCAmaXRlbUlzVmFsaWQpID09CisgICAgICAgICBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChpdGVtSXNWYWxpZCA9PSBWT1NfVFJVRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZih2b3NfbnZfcmVhZCggVk5WX1BBQ0tFVF9UWVBFX1BPV0VSX0xJTUlUUywKKyAgICAgICAgICAgICAgICAgICh2X1ZPSURfdCAqKSZwbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnBrdFR5cGVQd3JMaW1pdHNbMF0sIE5VTEwsCisgICAgICAgICAgICAgICAgc2l6ZW9mKHRBTklfUzE2KSpOVU1fODAyXzExX01PREVTKk5VTV9SRl9DSEFOTkVMUyApICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICAgICAgZ290byBlcnJvcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmICh2b3NfbnZfZ2V0VmFsaWRpdHkoVk5WX09GRE1fQ01EX1BXUl9PRkZTRVQsICZpdGVtSXNWYWxpZCkgPT0KKyAgICAgICAgIFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKGl0ZW1Jc1ZhbGlkID09IFZPU19UUlVFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKHZvc19udl9yZWFkKCBWTlZfT0ZETV9DTURfUFdSX09GRlNFVCwKKyAgICAgICAgICAgICAgICAgICh2X1ZPSURfdCAqKSZwbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLm9mZG1DbWRQd3JPZmZzZXQsIE5VTEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihzT2ZkbUNtZFB3ck9mZnNldCkpICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICAgICAgZ290byBlcnJvcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmICh2b3NfbnZfZ2V0VmFsaWRpdHkoVk5WX1RYX0JCX0ZJTFRFUl9NT0RFLCAmaXRlbUlzVmFsaWQpID09CisgICAgICAgICBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChpdGVtSXNWYWxpZCA9PSBWT1NfVFJVRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGlmKHZvc19udl9yZWFkKFZOVl9UWF9CQl9GSUxURVJfTU9ERSwKKyAgICAgICAgICAgICAgICAgICh2X1ZPSURfdCAqKSZwbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnR4YmJGaWx0ZXJNb2RlLCBOVUxMLAorICAgICAgICAgICAgICAgIHNpemVvZihzVHhCYkZpbHRlck1vZGUpKSAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICAgICAgICAgICAgZ290byBlcnJvcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAodm9zX252X2dldFZhbGlkaXR5KFZOVl9UQUJMRV9WSVJUVUFMX1JBVEUsICZpdGVtSXNWYWxpZCkgPT0KKyAgICAgICAgIFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKGl0ZW1Jc1ZhbGlkID09IFZPU19UUlVFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgaWYodm9zX252X3JlYWQoVk5WX1RBQkxFX1ZJUlRVQUxfUkFURSwKKyAgICAgICAgICAgICAgICAgICh2X1ZPSURfdCAqKSZwbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnB3ck9wdGltdW1fdmlydHVhbFJhdGUsIE5VTEwsCisgICAgICAgICAgICAgICAgc2l6ZW9mKGdudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucHdyT3B0aW11bV92aXJ0dWFsUmF0ZSkpICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICAgICBnb3RvIGVycm9yOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK2Vycm9yOgorICAgIHZvc19tZW1fdmZyZWUocG52RUZTVGFibGUpOworICAgIHZvc19tZW1fdmZyZWUocEVuY29kZWRCdWYpOworICAgIHZvc19tZW1fdmZyZWUocG52RW5jb2RlZEJ1Zik7CisgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkUgOworfQorCitWT1NfU1RBVFVTIHZvc19udl9jbG9zZSh2b2lkKQoreworICAgIHZfQ09OVEVYVF90IHBWb3NDb250ZXh0PSBOVUxMOworICAg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XRpb24KKworICBcc2EKKworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KK1ZPU19TVEFUVVMgdm9zX252X3JlYWRNdWx0aU1hY0FkZHJlc3MoIHZfVThfdCAqcE1hY0FkZHJlc3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICBtYWNDb3VudCApCit7CisgICBzTnZGaWVsZHMgICBmaWVsZEltYWdlOworICAgVk9TX1NUQVRVUyAgc3RhdHVzOworICAgdl9VOF90ICAgICAgY291bnRMb29wOworICAgdl9VOF90ICAgICAqcE5WTWFjQWRkcmVzczsKKworICAgaWYoKDAgPT0gbWFjQ291bnQpIHx8IChWT1NfTUFYX0NPTkNVUlJFTkNZX1BFUlNPTkEgPCBtYWNDb3VudCkgfHwKKyAgICAgIChOVUxMID09IHBNYWNBZGRyZXNzKSkKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgIiBJbnZhbGlkIFBhcmFtZXRlciBmcm9tIE5WIENsaWVudCBtYWNDb3VudCAlZCwgcE1hY0FkZHJlc3MgJXAiLAorICAgICAgICAgIG1hY0NvdW50LCBwTWFjQWRkcmVzcyk7CisgICB9CisKKyAgIHN0YXR1cyA9IHZvc19udl9yZWFkKCBWTlZfRklFTERfSU1BR0UsICZmaWVsZEltYWdlLCBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihmaWVsZEltYWdlKSApOworICAgaWYgKFZPU19TVEFUVVNfU1VDQ0VTUyA9PSBzdGF0dXMpCisgICB7CisgICAgICBwTlZNYWNBZGRyZXNzID0gZmllbGRJbWFnZS5tYWNBZGRyOworICAgICAgZm9yKGNvdW50TG9vcCA9IDA7IGNvdW50TG9vc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VJST1IsCisgICAgICAgICAgICAgKCJOViB0eXBlPSVkIGlzIGludmFsaWQiKSwgdHlwZSApOworICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICAgfQorICAgIC8vIGNoZWNrIGlmIHRoZSBOViBpdGVtIGhhcyB2YWxpZCBkYXRhCisgICAgc3RhdHVzID0gdm9zX252X2dldFZhbGlkaXR5KCB0eXBlLCAmaXRlbUlzVmFsaWQgKTsKKyAgIGlmICghaXRlbUlzVmFsaWQpCisgICB7CisgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgIk5WIHR5cGU9JWQgZG9lcyBub3QgaGF2ZSB2YWxpZCBkYXRhIiwgdHlwZSApOworICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRU1QVFk7CisgICB9CisgICBzd2l0Y2godHlwZSkKKyAgIHsKKyAgICAgICBjYXNlIFZOVl9GSUVMRF9JTUFHRToKKyAgICAgICAgICAgaXRlbVNpemUgPSBzaXplb2YoZ252RUZTVGFibGUtPmhhbG52LmZpZWxkcyk7CisgICAgICAgICAgIGlmKGJ1ZmZlclNpemUgIT0gaXRlbVNpemUpIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAoInR5cGUgPSAlZCBidWZmZXIgc2l6ZT0lZCBpcyBsZXNzIHRoYW4gZGF0YSBzaXplPSVkIiksdHlwZSwgYnVmZmVyU2l6ZSwKKyAgICAgICAgICAgICAgICAgaXRlbVNpemUpOworICAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0lOVkFMOworICAgICAgICAgICB9CisgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KG91dHB1dFZvaWRCdWZmZXIsJmdudkVGU1RhYmxlLT5oYWxudi5maWVsZHMsYnVmZmVyU2l6ZSk7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgYnJlYWs7CisgICAgICAgY2FzZSBWTlZfUkFURV9UT19QT1dFUl9UQUJMRToKKyAgICAgICAgICAgaXRlbVNpemUgPSBzaXplb2YoZ252RUZTVGFibGUtPmhhbG52LnRhYmxlcy5wd3JPcHRpbXVtKTsKKyAgICAgICAgICAgaWYoYnVmZmVyU2l6ZSAhPSBpdGVtU2l6ZSkgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICgidHlwZSA9ICVkIGJ1ZmZlciBzaXplPSVkIGlzIGxlc3MgdGhhbiBkYXRhIHNpemU9JWQiKSx0eXBlLCBidWZmZXJTaXplLAorICAgICAgICAgICAgICAgICBpdGVtU2l6ZSk7CisgICAgICAgICAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkob3V0cHV0Vm9pZEJ1ZmZlciwmZ252RUZTVGFibGUtPmhhbG52LnRhYmxlcy5wd3JPcHRpbXVtWzBdLGJ1ZmZlclNpemUpOworICAgICAgICAgICB9CisgICAgICAgICAgIGJyZWFrOworICAgICAgIGNhc2UgVk5WX1JFR1VMQVJUT1JZX0RPTUFJTl9UQUJMRToKKyAgICAgICAgICAgaXRlbVNpemUgPSBzaXplb2YoZ252RUZTVGFibGUtPmhhbG52LnRhYmxlcy5yZWdEb21haW5zKTsKKyAgICAgICAgICAgaWYoYnVmZmVyU2l6ZSAhPSBpdGVtU2l6ZSkgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICgidHlwZSA9ICVkIGJ1ZmZlciBzaXplPSVkIGlzIGxlc3MgdGhhbiBkYXRhIHNpemU9JWQiKSx0eXBlLCBidWZmZXJTaXplLAorICAgICAgICAgICAgICAgICBpdGVtU2l6ZSk7CisgICAgICAgICAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkob3V0cHV0Vm9pZEJ1ZmZlciwmZ252RUZTVGFibGUtPmhhbG52LnRhYmxlcy5yZWdEb21haW5zWzBdLGJ1ZmZlclNpemUpOworICAgICAgICAgICB9CisgICAgICAgICAgIGJyZWFrOworICAgICAgIGNhc2UgVk5WX0RFRkFVTFRfTE9DQVRJT046CisgICAgICAgICAgIGl0ZW1TaXplID0gc2l6ZW9mKGdudkVGU1RhYmxlLT5oYWxudi50YWJsZXMuZGVmYXVsdENvdW50cnlUYWJsZSk7CisgICAgICAgICAgIGlmKGJ1ZmZlclNpemUgIT0gaXRlbVNpemUpIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAoInR5cGUgPSAlZCBidWZmZXIgc2l6ZT0lZCBpcyBsZXNzIHRoYW4gZGF0YSBzaXplPSVkIiksdHlwZSwgYnVmZmVyU2l6ZSwKKyAgICAgICAgICAgICAgICAgaXRlbVNpemUpOworICAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0lOVkFMOworICAgICAgICAgICB9CisgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KG91dHB1dFZvaWRCdWZmZXIsJmdudkVGU1RhYmxlLT5oYWxudi50YWJsZXMuZGVmYXVsdENvdW50cnlUYWJsZSxidWZmZXJTaXplKTsKKyAgICAgICAgICAgfQorICAgICAgICAgICBicmVhazsKKyAgICAgICBjYXNlIFZOVl9UUENfUE9XRVJfVEFCTEU6CisgICAgICAgICAgIGl0ZW1TaXplID0gc2l6ZW9mKGdudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucGx1dENoYXJhY3Rlcml6ZWQpOworICAgICAgICAgICBpZihidWZmZXJTaXplICE9IGl0ZW1TaXplKSB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgKCJ0eXBlID0gJWQgYnVmZmVyIHNpemU9JWQgaXMgbGVzcyB0aGFuIGRhdGEgc2l6ZT0lZCIpLHR5cGUsIGJ1ZmZlclNpemUsCisgICAgICAgICAgICAgICAgIGl0ZW1TaXplKTsKKyAgICAgICAgICAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgICAgICAgICAgfQorICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgIHZvc19tZW1fY29weShvdXRwdXRWb2lkQnVmZmVyLCZnbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnBsdXRDaGFyYWN0ZXJpemVkWzBdLGJ1ZmZlclNpemUpOworICAgICAgICAgICB9CisgICAgICAgICAgIGJyZWFrOworICAgICAgIGNhc2UgVk5WX1RQQ19QREFEQ19PRkZTRVRTOgorICAgICAgICAgICBpdGVtU2l6ZSA9IHNpemVvZihnbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnBsdXRQZGFkY09mZnNldCk7CisgICAgICAgICAgIGlmKGJ1ZmZlclNpemUgIT0gaXRlbVNpemUpIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAoInR5cGUgPSAlZCBidWZmZXIgc2l6ZT0lZCBpcyBsZXNzIHRoYW4gZGF0YSBzaXplPSVkIiksdHlwZSwgYnVmZmVyU2l6ZSwKKyAgICAgICAgICAgICAgICAgaXRlbVNpemUpOworICAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0lOVkFMOworICAgICAgICAgICB9CisgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KG91dHB1dFZvaWRCdWZmZXIsJmdudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucGx1dFBkYWRjT2Zmc2V0WzBdLGJ1ZmZlclNpemUpOworICAgICAgICAgICB9CisgICAgICAgICAgIGJyZWFrOworICAgICAgIGNhc2UgVk5WX1JTU0lfQ0hBTk5FTF9PRkZTRVRTOgorCisgICAgICAgICAgIGl0ZW1TaXplID0gc2l6ZW9mKGdudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucnNzaUNoYW5PZmZzZXRzKTsKKworICAgICAgICAgICBpZihidWZmZXJTaXplICE9IGl0ZW1TaXplKSB7CisKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAoInR5cGUgPSAlZCBidWZmZXIgc2l6ZT0lZCBpcyBsZXNzIHRoYW4gZGF0YSBzaXplPSVkIiksdHlwZSwgYnVmZmVyU2l6ZSwKKyAgICAgICAgICAgICAgICAgaXRlbVNpemUpOworICAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0lOVkFMOworICAgICAgICAgICB9CisgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KG91dHB1dFZvaWRCdWZmZXIsJmdudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucnNzaUNoYW5PZmZzZXRzWzBdLGJ1ZmZlclNpemUpOworICAgICAgICAgICB9CisgICAgICAgICAgIGJyZWFrOworICAgICAgIGNhc2UgVk5WX0hXX0NBTF9WQUxVRVM6CisKKyAgICAgICAgICAgaXRlbVNpemUgPSBzaXplb2YoZ252RUZTVGFibGUtPmhhbG52LnRhYmxlcy5od0NhbFZhbHVlcyk7CisKKyAgICAgICAgICAgaWYoYnVmZmVyU2l6ZSAhPSBpdGVtU2l6ZSkgeworCisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgKCJ0eXBlID0gJWQgYnVmZmVyIHNpemU9JWQgaXMgbGVzcyB0aGFuIGRhdGEgc2l6ZT0lZCIpLHR5cGUsIGJ1ZmZlclNpemUsCisgICAgICAgICAgICAgICAgIGl0ZW1TaXplKTsKKyAgICAgICAgICAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgICAgICAgICAgfQorICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgIHZvc19tZW1fY29weShvdXRwdXRWb2lkQnVmZmVyLCZnbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLmh3Q2FsVmFsdWVzLGJ1ZmZlclNpemUpOworICAgICAgICAgICB9CisgICAgICAgICAgIGJyZWFrOworICAgICAgIGNhc2UgVk5WX0ZXX0NPTkZJRzoKKworICAgICAgICAgICBpdGVtU2l6ZSA9IHNpemVvZihnbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLmZ3Q29uZmlnKTsKKworICAgICAgICAgICBpZihidWZmZXJTaXplICE9IGl0ZW1TaXplKSB7CisKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAoInR5cGUgPSAlZCBidWZmZXIgc2l6ZT0lZCBpcyBsZXNzIHRoYW4gZGF0YSBzaXplPSVkIiksdHlwZSwgYnVmZmVyU2l6ZSwKKyAgICAgICAgICAgICAgICAgaXRlbVNpemUpOworICAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0lOVkFMOworICAgICAgICAgICB9CisgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KG91dHB1dFZvaWRCdWZmZXIsJmdudkVGU1RhYmxlLT5oYWxudi50YWJsZXMuZndDb25maWcsYnVmZmVyU2l6ZSk7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgYnJlYWs7CisgICAgICAgY2FzZSBWTlZfQU5URU5OQV9QQVRIX0xPU1M6CisgICAgICAgICAgIGl0ZW1TaXplID0gc2l6ZW9mKGdudkVGU1RhYmxlLT5oYWxudi50YWJsZXMuYW50ZW5uYVBhdGhMb3NzKTsKKyAgICAgICAgICAgaWYoYnVmZmVyU2l6ZSAhPSBpdGVtU2l6ZSkgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICgidHlwZSA9ICVkIGJ1ZmZlciBzaXplPSVkIGlzIGxlc3MgdGhhbiBkYXRhIHNpemU9JWQiKSx0eXBlLCBidWZmZXJTaXplLAorICAgICAgICAgICAgICAgICBpdGVtU2l6ZSk7CisgICAgICAgICAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkob3V0cHV0Vm9pZEJ1ZmZlciwmZ252RUZTVGFibGUtPmhhbG52LnRhYmxlcy5hbnRlbm5hUGF0aExvc3NbMF0sYnVmZmVyU2l6ZSk7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgYnJlYWs7CisgICAgICAgY2FzZSBWTlZfUEFDS0VUX1RZUEVfUE9XRVJfTElNSVRTOgorICAgICAgICAgICBpdGVtU2l6ZSA9IHNpemVvZihnbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnBrdFR5cGVQd3JMaW1pdHMpOworICAgICAgICAgICBpZihidWZmZXJTaXplICE9IGl0ZW1TaXplKSB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgKCJ0eXBlID0gJWQgYnVmZmVyIHNpemU9JWQgaXMgbGVzcyB0aGFuIGRhdGEgc2l6ZT0lZCIpLHR5cGUsIGJ1ZmZlclNpemUsCisgICAgICAgICAgICAgICAgIGl0ZW1TaXplKTsKKyAgICAgICAgICAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgICAgICAgICAgfQorICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgIHZvc19tZW1fY29weShvdXRwdXRWb2lkQnVmZmVyLGdudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucGt0VHlwZVB3ckxpbWl0cyxidWZmZXJTaXplKTsKKyAgICAgICAgICAgfQorICAgICAgICAgICBicmVhazsKKyAgICAgICBjYXNlIFZOVl9PRkRNX0NNRF9QV1JfT0ZGU0VUOgorICAgICAgICAgICBpdGVtU2l6ZSA9IHNpemVvZihnbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLm9mZG1DbWRQd3JPZmZzZXQpOworICAgICAgICAgICBpZihidWZmZXJTaXplICE9IGl0ZW1TaXplKSB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgKCJ0eXBlID0gJWQgYnVmZmVyIHNpemU9JWQgaXMgbGVzcyB0aGFuIGRhdGEgc2l6ZT0lZCIpLHR5cGUsIGJ1ZmZlclNpemUsCisgICAgICAgICAgICAgICAgIGl0ZW1TaXplKTsKKyAgICAgICAgICAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgICAgICAgICAgfQorICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgIHZvc19tZW1fY29weShvdXRwdXRWb2lkQnVmZmVyLCZnbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLm9mZG1DbWRQd3JPZmZzZXQsYnVmZmVyU2l6ZSk7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgYnJlYWs7CisgICAgICAgY2FzZSBWTlZfVFhfQkJfRklMVEVSX01PREU6CisgICAgICAgICAgIGl0ZW1TaXplID0gc2l6ZW9mKGdudkVGU1RhYmxlLT5oYWxudi50YWJsZXMudHhiYkZpbHRlck1vZGUpOworICAgICAgICAgICBpZihidWZmZXJTaXplICE9IGl0ZW1TaXplKSB7CisgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgKCJ0eXBlID0gJWQgYnVmZmVyIHNpemU9JWQgaXMgbGVzcyB0aGFuIGRhdGEgc2l6ZT0lZCIpLHR5cGUsIGJ1ZmZlclNpemUsCisgICAgICAgICAgICAgICAgIGl0ZW1TaXplKTsKKyAgICAgICAgICAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgICAgICAgICAgfQorICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgIHZvc19tZW1fY29weShvdXRwdXRWb2lkQnVmZmVyLCZnbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnR4YmJGaWx0ZXJNb2RlLGJ1ZmZlclNpemUpOworICAgICAgICAgICB9CisgICAgICAgICAgIGJyZWFrOworCisKKyAgICAgICBjYXNlIFZOVl9UQUJMRV9WSVJUVUFMX1JBVEU6CisgICAgICAgICAgIGl0ZW1TaXplID0gc2l6ZW9mKGdudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucHdyT3B0aW11bV92aXJ0dWFsUmF0ZSk7CisgICAgICAgICAg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eXBlKTsKKyAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworICAgIH0KKyAgICBpZiAoTlVMTCA9PSBpbnB1dFZvaWRCdWZmZXIpCisgICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIkJ1ZmZlciBwcm92aWRlZCBpcyBOVUxMIik7CisgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICB9CisgICAgaWYgKDAgPT0gYnVmZmVyU2l6ZSkKKyAgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiTlYgdHlwZT0lZCBpcyBpbnZhbGlkIiwgdHlwZSk7CisgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgICB9CisKKyAgICBzd2l0Y2ggKHR5cGUpCisgICAgeworICAgICAgICBjYXNlIFZOVl9GSUVMRF9JTUFHRToKKyAgICAgICAgICAgIGl0ZW1TaXplID0gc2l6ZW9mKGdudkVGU1RhYmxlVjItPmhhbG52VjIuZmllbGRzKTsKKyAgICAgICAgICAgIGlmIChidWZmZXJTaXplICE9IGl0ZW1TaXplKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICJ0eXBlID0gJWQgYnVmZmVyIHNpemU9JWQgaXMgbGVzcyB0aGFuIGRhdGEgc2l6ZT0lZCIsCisgICAgICAgICAgICAgICAgICAgICB0eXBlLCBidWZmZXJTaXplLCBpdGVtU2l6ZSk7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0lOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmZ252RUZTVGFibGVWMi0+aGFsbnZWMi5maWVsZHMsCisgICAgICAgICAgICAgICAgICAgICAgIGlucHV0Vm9pZEJ1ZmZlciwKKyAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyU2l6ZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFZOVl9SQVRFX1RPX1BPV0VSX1RBQkxFOgorICAgICAgICAgICAgaXRlbVNpemUgPSBzaXplb2YoZ252RUZTVGFibGVWMi0+aGFsbnZWMi50YWJsZXMucHdyT3B0aW11bSk7CisgICAgICAgICAgICBpZiAoYnVmZmVyU2l6ZSAhPSBpdGVtU2l6ZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICJ0eXBlID0gJWQgYnVmZmVyIHNpemU9JWQgaXMgbGVzcyB0aGFuIGRhdGEgc2l6ZT0lZCIsCisgICAgICAgICAgICAgICAgICAgIHR5cGUsIGJ1ZmZlclNpemUsaXRlbVNpemUpOworICAgICAgICAgICAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJmdudkVGU1RhYmxlVjItPmhhbG52VjIudGFibGVzLnB3ck9wdGltdW1bMF0sCisgICAgICAgICAgICAgICAgICAgICAgIGlucHV0Vm9pZEJ1ZmZlciwKKyAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyU2l6ZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFZOVl9SRUdVTEFSVE9SWV9ET01BSU5fVEFCTEU6CisgICAgICAgICAgICBpdGVtU2l6ZSA9IHNpemVvZihnbnZFRlNUYWJsZVYyLT5oYWxudlYyLnRhYmxlcy5yZWdEb21haW5zKTsKKyAgICAgICAgICAgIGlmIChidWZmZXJTaXplICE9IGl0ZW1TaXplKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgInR5cGUgPSAlZCBidWZmZXIgc2l6ZT0lZCBpcyBsZXNzIHRoYW4gZGF0YSBzaXplPSVkIiwKKyAgICAgICAgICAgICAgICAgICAgdHlwZSwgYnVmZmVyU2l6ZSwgaXRlbVNpemUpOworICAgICAgICAgICAgICAgIHN0YXR1cyA9IFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJmdudkVGU1RhYmxlVjItPmhhbG52VjIudGFibGVzLnJlZ0RvbWFpbnNbMF0sCisgICAgICAgICAgICAgICAgICAgICAgIGlucHV0Vm9pZEJ1ZmZlciwKKyAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyU2l6ZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFZOVl9ERUZBVUxUX0xPQ0FUSU9OOgorICAgICAgICAgICAgaXRlbVNpemUgPSBzaXplb2YoZ252RUZTVGFibGVWMi0+aGFsbnZWMi50YWJsZXMuZGVmYXVsdENvdW50cnlUYWJsZSk7CisgICAgICAgICAgICBpZiAoYnVmZmVyU2l6ZSAhPSBpdGVtU2l6ZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICJ0eXBlID0gJWQgYnVmZmVyIHNpemU9JWQgaXMgbGVzcyB0aGFuIGRhdGEgc2l6ZT0lZCIsCisgICAgICAgICAgICAgICAgICAgIHR5cGUsIGJ1ZmZlclNpemUsIGl0ZW1TaXplKTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZnbnZFRlNUYWJsZVYyLT5oYWxudlYyLnRhYmxlcy5kZWZhdWx0Q291bnRyeVRhYmxlLAorICAgICAgICAgICAgICAgICAgICAgICBpbnB1dFZvaWRCdWZmZXIsCisgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlclNpemUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBWTlZfVFBDX1BPV0VSX1RBQkxFOgorICAgICAgICAgICAgaXRlbVNpemUgPSBzaXplb2YoZ252RUZTVGFibGVWMi0+aGFsbnZWMi50YWJsZXMucGx1dENoYXJhY3Rlcml6ZWQpOworICAgICAgICAgICAgaWYgKGJ1ZmZlclNpemUgIT0gaXRlbVNpemUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAidHlwZSA9ICVkIGJ1ZmZlciBzaXplPSVkIGlzIGxlc3MgdGhhbiBkYXRhIHNpemU9JWQiLAorICAgICAgICAgICAgICAgICAgICB0eXBlLCBidWZmZXJTaXplLCBpdGVtU2l6ZSk7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0lOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmZ252RUZTVGFibGVWMi0+aGFsbnZWMi50YWJsZXMucGx1dENoYXJhY3Rlcml6ZWRbMF0sCisgICAgICAgICAgICAgICAgICAgICAgIGlucHV0Vm9pZEJ1ZmZlciwKKyAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyU2l6ZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFZOVl9UUENfUERBRENfT0ZGU0VUUzoKKyAgICAgICAgICAgIGl0ZW1TaXplID0gc2l6ZW9mKGdudkVGU1RhYmxlVjItPmhhbG52VjIudGFibGVzLnBsdXRQZGFkY09mZnNldCk7CisgICAgICAgICAgICBpZiAoYnVmZmVyU2l6ZSAhPSBpdGVtU2l6ZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICJ0eXBlID0gJWQgYnVmZmVyIHNpemU9JWQgaXMgbGVzcyB0aGFuIGRhdGEgc2l6ZT0lZCIsCisgICAgICAgICAgICAgICAgICAgIHR5cGUsIGJ1ZmZlclNpemUsIGl0ZW1TaXplKTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZnbnZFRlNUYWJsZVYyLT5oYWxudlYyLnRhYmxlcy5wbHV0UGRhZGNPZmZzZXRbMF0sCisgICAgICAgICAgICAgICAgICAgICAgIGlucHV0Vm9pZEJ1ZmZlciwKKyAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyU2l6ZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgY2FzZSBWTlZfUlNTSV9DSEFOTkVMX09GRlNFVFM6CisgICAgICAgICAgICBpdGVtU2l6ZSA9IHNpemVvZihnbnZFRlNUYWJsZVYyLT5oYWxudlYyLnRhYmxlcy5yc3NpQ2hhbk9mZnNldHMpOworICAgICAgICAgICAgaWYgKGJ1ZmZlclNpemUgIT0gaXRlbVNpemUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAidHlwZSA9ICVkIGJ1ZmZlciBzaXplPSVkIGlzIGxlc3MgdGhhbiBkYXRhIHNpemU9JWQiLAorICAgICAgICAgICAgICAgICAgICB0eXBlLCBidWZmZXJTaXplLCBpdGVtU2l6ZSk7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0lOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmZ252RUZTVGFibGVWMi0+aGFsbnZWMi50YWJsZXMucnNzaUNoYW5PZmZzZXRzWzBdLAorICAgICAgICAgICAgICAgICAgICAgICBpbnB1dFZvaWRCdWZmZXIsCisgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlclNpemUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgIGNhc2UgVk5WX0hXX0NBTF9WQUxVRVM6CisgICAgICAgICAgICBpdGVtU2l6ZSA9IHNpemVvZihnbnZFRlNUYWJsZVYyLT5oYWxudlYyLnRhYmxlcy5od0NhbFZhbHVlcyk7CisgICAgICAgICAgICBpZiAoYnVmZmVyU2l6ZSAhPSBpdGVtU2l6ZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICJ0eXBlID0gJWQgYnVmZmVyIHNpemU9JWQgaXMgbGVzcyB0aGFuIGRhdGEgc2l6ZT0lZCIsCisgICAgICAgICAgICAgICAgICAgIHR5cGUsIGJ1ZmZlclNpemUsIGl0ZW1TaXplKTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZnbnZFRlNUYWJsZVYyLT5oYWxudlYyLnRhYmxlcy5od0NhbFZhbHVlcywKKyAgICAgICAgICAgICAgICAgICAgICAgaW5wdXRWb2lkQnVmZmVyLAorICAgICAgICAgICAgICAgICAgICAgICBidWZmZXJTaXplKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgVk5WX0ZXX0NPTkZJRzoKKyAgICAgICAgICAgaXRlbVNpemUgPSBzaXplb2YoZ252RUZTVGFibGVWMi0+aGFsbnZWMi50YWJsZXMuZndDb25maWcpOworICAgICAgICAgICBpZiAoYnVmZmVyU2l6ZSAhPSBpdGVtU2l6ZSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICJ0eXBlID0gJWQgYnVmZmVyIHNpemU9JWQgaXMgbGVzcyB0aGFuIGRhdGEgc2l6ZT0lZCIsCisgICAgICAgICAgICAgICAgICAgdHlwZSwgYnVmZmVyU2l6ZSwgaXRlbVNpemUpOworICAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0lOVkFMOworICAgICAgICAgICB9CisgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZnbnZFRlNUYWJsZVYyLT5oYWxudlYyLnRhYmxlcy5md0NvbmZpZywKKyAgICAgICAgICAgICAgICAgICAgICBpbnB1dFZvaWRCdWZmZXIsCisgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyU2l6ZSk7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBWTlZfQU5URU5OQV9QQVRIX0xPU1M6CisgICAgICAgICAgICBpdGVtU2l6ZSA9IHNpemVvZihnbnZFRlNUYWJsZVYyLT5oYWxudlYyLnRhYmxlcy5hbnRlbm5hUGF0aExvc3MpOworICAgICAgICAgICAgaWYgKGJ1ZmZlclNpemUgIT0gaXRlbVNpemUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAidHlwZSA9ICVkIGJ1ZmZlciBzaXplPSVkIGlzIGxlc3MgdGhhbiBkYXRhIHNpemU9JWQiLAorICAgICAgICAgICAgICAgICAgICB0eXBlLCBidWZmZXJTaXplLCBpdGVtU2l6ZSk7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0lOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmZ252RUZTVGFibGVWMi0+aGFsbnZWMi50YWJsZXMuYW50ZW5uYVBhdGhMb3NzWzBdLAorICAgICAgICAgICAgICAgICAgICAgICBpbnB1dFZvaWRCdWZmZXIsCisgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlclNpemUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBWTlZfUEFDS0VUX1RZUEVfUE9XRVJfTElNSVRTOgorICAgICAgICAgICAgaXRlbVNpemUgPSBzaXplb2YoZ252RUZTVGFibGVWMi0+aGFsbnZWMi50YWJsZXMucGt0VHlwZVB3ckxpbWl0cyk7CisgICAgICAgICAgICBpZiAoYnVmZmVyU2l6ZSAhPSBpdGVtU2l6ZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICJ0eXBlID0gJWQgYnVmZmVyIHNpemU9JWQgaXMgbGVzcyB0aGFuIGRhdGEgc2l6ZT0lZCIsCisgICAgICAgICAgICAgICAgICAgIHR5cGUsIGJ1ZmZlclNpemUsIGl0ZW1TaXplKTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KGdudkVGU1RhYmxlVjItPmhhbG52VjIudGFibGVzLnBrdFR5cGVQd3JMaW1pdHMsCisgICAgICAgICAgICAgICAgICAgICAgIGlucHV0Vm9pZEJ1ZmZlciwKKyAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyU2l6ZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIFZOVl9PRkRNX0NNRF9QV1JfT0ZGU0VUOgorICAgICAgICAgICAgaXRlbVNpemUgPSBzaXplb2YoZ252RUZTVGFibGVWMi0+aGFsbnZWMi50YWJsZXMub2ZkbUNtZFB3ck9mZnNldCk7CisgICAgICAgICAgICBpZiAoYnVmZmVyU2l6ZSAhPSBpdGVtU2l6ZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICJ0eXBlID0gJWQgYnVmZmVyIHNpemU9JWQgaXMgbGVzcyB0aGFuIGRhdGEgc2l6ZT0lZCIsCisgICAgICAgICAgICAgICAgICAgIHR5cGUsIGJ1ZmZlclNpemUsIGl0ZW1TaXplKTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZnbnZFRlNUYWJsZVYyLT5oYWxudlYyLnRhYmxlcy5vZmRtQ21kUHdyT2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICBpbnB1dFZvaWRCdWZmZXIsCisgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlclNpemUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBWTlZfVFhfQkJfRklMVEVSX01PREU6CisgICAgICAgICAgICBpdGVtU2l6ZSA9IHNpemVvZihnbnZFRlNUYWJsZVYyLT5oYWxudlYyLnRhYmxlcy50eGJiRmlsdGVyTW9kZSk7CisgICAgICAgICAgICBpZiAoYnVmZmVyU2l6ZSAhPSBpdGVtU2l6ZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICJ0eXBlID0gJWQgYnVmZmVyIHNpemU9JWQgaXMgbGVzcyB0aGFuIGRhdGEgc2l6ZT0lZCIsCisgICAgICAgICAgICAgICAgICAgIHR5cGUsIGJ1ZmZlclNpemUsIGl0ZW1TaXplKTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZnbnZFRlNUYWJsZVYyLT5oYWxudlYyLnRhYmxlcy50eGJiRmlsdGVyTW9kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgaW5wdXRWb2lkQnVmZmVyLAorICAgICAgICAgICAgICAgICAgICAgICBidWZmZXJTaXplKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgVk5WX1RBQkxFX1ZJUlRVQUxfUkFURToKKyAgICAgICAgICAgIGl0ZW1TaXplID0gc2l6ZW9mKGdudkVGU1RhYmxlVjItPmhhbG52VjIudGFibGVzLnB3ck9wdGltdW1fdmlydHVhbFJhdGUpOworICAgICAgICAgICAgaWYgKGJ1ZmZlclNpemUgIT0gaXRlbVNpemUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAidHlwZSA9ICVkIGJ1ZmZlciBzaXplPSVkIGlzIGxlc3MgdGhhbiBkYXRhIHNpemU9JWQiLAorICAgICAgICAgICAgICAgICAgICB0eXBlLCBidWZmZXJTaXplLCBpdGVtU2l6ZSk7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0lOVkFMOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmZ252RUZTVGFibGVWMi0+aGFsbnZWMi50YWJsZXMucHdyT3B0aW11bV92aXJ0dWFsUmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgaW5wdXRWb2lkQnVmZmVyLAorICAgICAgICAgICAgICAgICAgICAgICBidWZmZXJTaXplKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGRlZm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gICAgdEFOSV9VOCAqbnVtNDBNSHpDaGFubmVsc0ZvdW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApCit7CisgICAgVk9TX1NUQVRVUyBzdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICAgaW50IGksIGNvdW50OworCisgICAgLy9UT0RPOiBEb250IHdhbnQgdG8gdXNlIHBNYWMgaGVyZS4uLmNhbiB3ZSBpbnN0ZWFkIHN0b3JlIHRoZSBjdXJSZWdEb21haW4gaW4gTlYKKyAgICAvLyBvciBwYXNzIGl0IGFzIGEgcGFyYW1ldGVyIHRvIE5WIGZyb20gU01FPworCisgICAgaWYoIGNoYW5uZWxzMjBNSHogJiYgbnVtMjBNSHpDaGFubmVsc0ZvdW5kICkKKyAgICB7CisgICAgICAgIGNvdW50ID0gMDsKKyAgICAgICAgZm9yKCBpID0gMDsgaSA8PSBSRl9DSEFOXzE0OyBpKysgKQorICAgICAgICB7CisgICAgICAgICAgICBpZiggcmVnQ2hhbm5lbHNbaV0uZW5hYmxlZCApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2hhbm5lbHMyME1Ieltjb3VudF0uY2hhbklkID0gcmZDaGFubmVsc1tpXS5jaGFubmVsTnVtOworICAgICAgICAgICAgICAgIGNoYW5uZWxzMjBNSHpbY291bnQrK10ucHdyICA9IHJlZ0NoYW5uZWxzW2ldLnB3ckxpbWl0OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGZvciggaSA9IFJGX0NIQU5fMzY7IGkgPD0gUkZfQ0hBTl8xNjU7IGkrKyApCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmKCByZWdDaGFubmVsc1tpXS5lbmFibGVkICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjaGFubmVsczIwTUh6W2NvdW50XS5jaGFuSWQgPSByZkNoYW5uZWxzW2ldLmNoYW5uZWxOdW07CisgICAgICAgICAgICAgICAgY2hhbm5lbHMyME1Ieltjb3VudCsrXS5wd3IgID0gcmVnQ2hhbm5lbHNbaV0ucHdyTGltaXQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgKm51bTIwTUh6Q2hhbm5lbHNGb3VuZCA9ICh0QU5JX1U4KWNvdW50OworICAgIH0KKworICAgIGlmKCBjaGFubmVsczQwTUh6ICYmIG51bTQwTUh6Q2hhbm5lbHNGb3VuZCApCisgICAgeworICAgICAgICBjb3VudCA9IDA7CisgICAgICAgIC8vY2VudGVyIGNoYW5uZWxzIGZvciAyLjQgR2h6IDQwIE1IeiBjaGFubmVscworICAgICAgICBmb3IoIGkgPSBSRl9DSEFOX0JPTkRfMzsgaSA8PSBSRl9DSEFOX0JPTkRfMTE7IGkrKyApCisgICAgICAgIHsKKworICAgICAgICAgICAgaWYoIHJlZ0NoYW5uZWxzW2ldLmVuYWJsZWQgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNoYW5uZWxzNDBNSHpbY291bnRdLmNoYW5JZCA9IHJmQ2hhbm5lbHNbaV0uY2hhbm5lbE51bTsKKyAgICAgICAgICAgICAgICBjaGFubmVsczQwTUh6W2NvdW50KytdLnB3ciAgPSByZWdDaGFubmVsc1tpXS5wd3JMaW1pdDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAvL2NlbnRlciBjaGFubmVscyBmb3IgNSBHaHogNDAgTUh6IGNoYW5uZWxzCisgICAgICAgIGZvciggaSA9IFJGX0NIQU5fQk9ORF8zODsgaSA8PSBSRl9DSEFOX0JPTkRfMTYzOyBpKysgKQorICAgICAgICB7CisKKyAgICAgICAgICAgIGlmKCByZWdDaGFubmVsc1tpXS5lbmFibGVkICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjaGFubmVsczQwTUh6W2NvdW50XS5jaGFuSWQgPSByZkNoYW5uZWxzW2ldLmNoYW5uZWxOdW07CisgICAgICAgICAgICAgICAgY2hhbm5lbHM0ME1Ieltjb3Vud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GFubmVscworICBccGFyYW0gcDQwTWh6Q2hhbm5lbHMgLSBsaXN0IG9mIDQwIE1oeiBjaGFubmVscworICBccGFyYW0gcE51bTQwTWh6Q2hhbm5lbHMgLSBudW1iZXIgb2YgNDAgTWh6IGNoYW5uZWxzCisgIFxyZXR1cm4gc3RhdHVzIG9mIHRoZSBOViByZWFkIG9wZXJhdGlvbgorICBcTm90ZTogNDBNaHogbm90IGN1cnJlbnRseSBzdXBwb3J0ZWQKKyAgXHNhCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworVk9TX1NUQVRVUyB2b3NfbnZfZ2V0U3VwcG9ydGVkQ2hhbm5lbHMoIHZfVThfdCAqcDIwTWh6Q2hhbm5lbHMsIGludCAqcE51bTIwTWh6Q2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VOF90ICpwNDBNaHpDaGFubmVscywgaW50ICpwTnVtNDBNaHpDaGFubmVscykKK3sKKyAgICBWT1NfU1RBVFVTIHN0YXR1cyA9IFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgICBpbnQgaSwgY291bnQgPSAwOworCisgICAgaWYoIHAyME1oekNoYW5uZWxzICYmIHBOdW0yME1oekNoYW5uZWxzICkKKyAgICB7CisgICAgICAgIGlmKCAqcE51bTIwTWh6Q2hhbm5lbHMgPj0gTlVNX1JGX0NIQU5ORUxTICkKKyAgICAgICAgeworICAgICAgICAgICAgZm9yKCBpID0gMDsgaSA8PSBSRl9DSEFOXzE0OyBpKysgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHAyME1oekNoYW5uZWxzW2NvdW50KytdID0gcmZDaGFubmVsc1tpXS5jaGFubmVsTnVtOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZm9yKCBpID0gUkZfQ0hBTl8zNjsgaSA8PSBSRl9DSEFOXz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LQorICBcYnJpZWYgdm9zX252X2dldENoYW5uZWxFbmFibGVkU3RhdGUgLQorICBccGFyYW0gcmZDaGFubmVsICAtIGlucHV0IGNoYW5uZWwgZW51bSB0byBrbm93IGV2YWJsZWQgc3RhdGUKKyAgXHJldHVybiBlTlZDaGFubmVsRW5hYmxlZFR5cGUgZW5hYmxlZCBzdGF0ZSBmb3IgY2hhbm5lbAorICAgICAgICAgICAgICogZW5hYmxlZAorICAgICAgICAgICAgICogZGlzYWJsZWQKKyAgICAgICAgICAgICAqIERGUworICBcc2EKKyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCitlTlZDaGFubmVsRW5hYmxlZFR5cGUgdm9zX252X2dldENoYW5uZWxFbmFibGVkU3RhdGUKKygKKyAgIHZfVTMyX3QgICAgIHJmQ2hhbm5lbAorKQoreworICAgdl9VMzJfdCAgICAgICBjaGFubmVsTG9vcDsKKyAgIGVSZkNoYW5uZWxzICAgY2hhbm5lbEVudW0gPSBJTlZBTElEX1JGX0NIQU5ORUw7CisKKyAgIGZvcihjaGFubmVsTG9vcCA9IDA7IGNoYW5uZWxMb29wIDw9IFJGX0NIQU5fMTY1OyBjaGFubmVsTG9vcCsrKQorICAgeworICAgICAgaWYocmZDaGFubmVsc1tjaGFubmVsTG9vcF0uY2hhbm5lbE51bSA9PSByZkNoYW5uZWwpCisgICAgICB7CisgICAgICAgICBjaGFubmVsRW51bSA9IChlUmZDaGFubmVscyljaGFubmVsTG9vcDsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgfQorCisgICBpZihJTlZBTElEX1JGX0NIQU5ORUwgPT0gY2hhbm5lbEVudW0pCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgInZvc19udl9nZXRDaGFubmVsRW5hYmxlZFN0YXRlLCBpbnZhbGlkIGNoYW5uZWwgJWQiLCByZkNoYW5uZWwpOworICAgICAgcmV0dXJuIE5WX0NIQU5ORUxfSU5WQUxJRDsKKyAgIH0KKworICAgcmV0dXJuIHJlZ0NoYW5uZWxzW2NoYW5uZWxFbnVtXS5lbmFibGVkOworfQorCisvKiotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgXGJyaWVmIHZvc19udl9nZXROdlZlcnNpb24gLQorICBccGFyYW0gTk9ORQorICBccmV0dXJuIGVOdlZlcnNpb25UeXBlIE5WLmJpbiB2ZXJzaW9uCisgICAgICAgICAgICAgKiBFX05WX1YyCisgICAgICAgICAgICAgKiBFX05WX1YzCisgICAgICAgICAgICAgKiBFX05WX0lOVkFMSUQKKyAgXHNhCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworZU52VmVyc2lvblR5cGUgdm9zX252X2dldE52VmVyc2lvbgorKAorICAgdm9pZAorKQoreworICAgVm9zQ29udGV4dFR5cGUgICp2b3NDdHh0ID0gTlVMTDsKKworICAgdm9zQ3R4dCA9IHZvc19nZXRfZ2xvYmFsX2NvbnRleHQoVk9TX01PRFVMRV9JRF9TWVMsIE5VTEwpOworICAgaWYgKHZvc0N0eHQpCisgICB7CisgICAgICByZXR1cm4gdm9zQ3R4dC0+bnZWZXJzaW9uOworICAgfQorCisgICByZXR1cm4gRV9OVl9JTlZBTElEOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgQWRkIENSREEgcmVndWxhdG9yeSBzdXBwb3J0CisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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ydGluZyBjaGFubmVsIGluZGV4IGZvciBlYWNoIGJhbmQKKyAgICAgICBpZiAoaSA9PSAwKQorICAgICAgICAgICBtID0gMDsKKyAgICAgICBlbHNlCisgICAgICAgICAgIG0gPSB3aXBoeS0+YmFuZHNbaS0xXS0+bl9jaGFubmVscyArIG07CisgICAgICAgZm9yIChqPTA7ajx3aXBoeS0+YmFuZHNbaV0tPm5fY2hhbm5lbHM7aisrKQorICAgICAgIHsKKyAgICAgICAgICAgLy8gayA9IChtICsgaikgaXMgaW50ZXJuYWwgY3VycmVudCBjaGFubmVsIGluZGV4IGZvciAyME1IeiBjaGFubmVsCisgICAgICAgICAgIC8vIG4gaXMgaW50ZXJuYWwgY2hhbm5lbCBpbmRleCBmb3IgY29ycmVzcG9uZGluZyA0ME1IeiBjaGFubmVsCisgICAgICAgICAgIGsgPSBtICsgajsKKyAgICAgICAgICAgbiA9IGJ3MjBfY2hfaW5kZXhfdG9fYnc0MF9jaF9pbmRleChrKTsKKyAgICAgICAgICAgaWYgKG4gPT0gLTEpCisgICAgICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgICAgaWYgKHdpcGh5LT5iYW5kc1tpXS0+Y2hhbm5lbHNbal0uZmxhZ3MgJiBJRUVFODAyMTFfQ0hBTl9ESVNBQkxFRCkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAocG52RUZTVGFibGUgPT0gTlVMTCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBwcl9pbmZvKCJlcnJvcjogcG52RUZTVGFibGUgaXMgTlVMTCwgcHJvYmFibHkgbm90IHBhcnNlZCBudi5iaW4geWV0XG4iKTsKKyAgICAgICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIHBudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucmVnRG9tYWluc1tOVU1fUkVHX0RPTUFJTlMtMl0uY2hhbm5lbHNba10uZW5hYmxlZCA9CisgICAgICAgICAgICAgICAgIE5WX0NIQU5ORUxfRElTQUJMRTsKKyAgICAgICAgICAgICAgcG52RUZTVGFibGUtPmhhbG52LnRhYmxlcy5yZWdEb21haW5zW05VTV9SRUdfRE9NQUlOUy0yXS5jaGFubmVsc1tuXS5lbmFibGVkID0KKyAgICAgICAgICAgICAgICAgTlZfQ0hBTk5FTF9ESVNBQkxFOworICAgICAgICAgICAgICAvL3ByX2luZm8oIkNIICVkIGRpc2FibGVkLCBubyBib25kaW5nIGNlbnRlcmVkIG9uIENIICVkLlxuIiwgcmZDaGFubmVsc1trXS5jaGFubmVsTnVtLAorICAgICAgICAgICAgICAvLyAgICByZkNoYW5uZWxzW25dLmNoYW5uZWxOdW0pOworICAgICAgICAgICB9CisgICAgICAgICAgIGVsc2UgaWYgKHdpcGh5LT5iYW5kc1tpXS0+Y2hhbm5lbHNbal0uZmxhZ3MgJiBJRUVFODAyMTFfQ0hBTl9SQURBUikKKyAgICAgICAgICAgeworICAgICAgICAgICAgICBwbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnJlZ0RvbWFpbnNbTlVNX1JFR19ET01BSU5TLTJdLmNoYW5uZWxzW2tdLmVuYWJsZWQgPQorICAgICAgICAgICAgICAgICBOVl9DSEFOTkVMX0RGUzsKKyAgICAgICAgICAgICAgLy8gbWF4X3Bvd2VyIGlzIGluIG1CbSA9IDEwMCAqIGRCbQorICAgICAgICAgICAgICBwbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnJlZ0RvbWFpbnNbTlVNX1JFR19ET01BSU5TLTJdLmNoYW5uZWxzW2tdLnB3ckxpbWl0ID0KKyAgICAgICAgICAgICAgICAgKHRBTklfUzgpICgod2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5tYXhfcG93ZXIpLzEwMCk7CisgICAgICAgICAgICAgIGlmICgod2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5mbGFncyAmIElFRUU4MDIxMV9DSEFOX05PX0hUNDApID09IDApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgcG52RUZTVGFibGUtPmhhbG52LnRhYmxlcy5yZWdEb21haW5zW05VTV9SRUdfRE9NQUlOUy0yXS5jaGFubmVsc1tuXS5lbmFibGVkID0KKyAgICAgICAgICAgICAgICAgICAgTlZfQ0hBTk5FTF9ERlM7CisgICAgICAgICAgICAgICAgIC8vIDQwTUh6IGNoYW5uZWwgcG93ZXIgaXMgaGFsZiBvZiAyME1IeiAoLTNkQikgPz8KKyAgICAgICAgICAgICAgICAgcG52RUZTVGFibGUtPmhhbG52LnRhYmxlcy5yZWdEb21haW5zW05VTV9SRUdfRE9NQUlOUy0yXS5jaGFubmVsc1tuXS5wd3JMaW1pdCA9CisgICAgICAgICAgICAgICAgICAgICh0QU5JX1M4KSAoKCh3aXBoeS0+YmFuZHNbaV0tPmNoYW5uZWxzW2pdLm1heF9wb3dlcikvMTAwKS0zKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICB9CisgICAgICAgICAgIGVsc2UgLy8gRW5hYmxlIGlzIG9ubHkgbGFzdCBmbGFnIHdlIHN1cHBvcnQKKyAgICAgICAgICAgeworI2lmZGVmIEZFQVRVUkVfV0xBTl9DSDE0NAorICAgICAgICAgICAgICBpZiAoKFJGX0NIQU5fMTQ0ID09IGspICYmIChFX05WX1YzICE9IHZvc19udl9nZXROdlZlcnNpb24oKSkpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgLy9EbyBub3QgZW5hYmxlIGNoYW5uZWwgMTQ0IHdoZW4gTlYgdmVyc2lvbiBpcyBub3QgTlYzCisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorI2VuZGlmCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgcG52RUZTVGFibGUtPmhhbG52LnRhYmxlcy5yZWdEb21haW5zW05VTV9SRUdfRE9NQUlOUy0yXS5cCisgICAgICAgICAgICAgICAgICAgICBjaGFubmVsc1trXS5lbmFibGVkID0gTlZfQ0hBTk5FTF9FTkFCTEU7CisgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAvLyBtYXhfcG93ZXIgaXMgaW4gZEJtCisgICAgICAgICAgICAgIHBudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucmVnRG9tYWluc1tOVU1fUkVHX0RPTUFJTlMtMl0uY2hhbm5lbHNba10ucHdyTGltaXQgPQorICAgICAgICAgICAgICAgICAodEFOSV9TOCkgKCh3aXBoeS0+YmFuZHNbaV0tPmNoYW5uZWxzW2pdLm1heF9wb3dlcikvMTAwKTsKKyAgICAgICAgICAgICAgaWYgKCh3aXBoeS0+YmFuZHNbaV0tPmNoYW5uZWxzW2pdLmZsYWdzICYgSUVFRTgwMjExX0NIQU5fTk9fSFQ0MCkgPT0gMCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBwbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnJlZ0RvbWFpbnNbTlVNX1JFR19ET01BSU5TLTJdLmNoYW5uZWxzW25dLmVuYWJsZWQgPQorICAgICAgICAgICAgICAgICAgICBOVl9DSEFOTkVMX0VOQUJMRTsKKyAgICAgICAgICAgICAgICAgLy8gNDBNSHogY2hhbm5lbCBwb3dlciBpcyBoYWxmIG9mIDIwTUh6ICgtM2RCKSA/PworICAgICAgICAgICAgICAgICBwbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnJlZ0RvbWFpbnNbTlVNX1JFR19ET01BSU5TLTJdLmNoYW5uZWxzW25dLnB3ckxpbWl0ID0KKyAgICAgICAgICAgICAgICAgICAgKHRBTklfUzgpICgoKHdpcGh5LT5iYW5kc1tpXS0+Y2hhbm5lbHNbal0ubWF4X3Bvd2VyKS8xMDApLTMpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgIH0KKyAgICAgICAgICAgLyogaWdub3JlIENSREEgbWF4X2FudGVubmFfZ2FpbiB0eXBpY2FsIGlzIDNkQmksIG52LmJpbiBhbnRlbm5hR2FpbiBpcworICAgICAgICA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bm8gREZTLCBtYXggRUlSUCAobUJtKSBpcyAlZFxuIiwgcmZDaGFubmVsc1tqXS5jaGFubmVsTnVtLAorICAgICAgICAgICAgICAgICB3aXBoeS0+cmVnZC0+cmVnX3J1bGVzW2ldLnBvd2VyX3J1bGUubWF4X2VpcnApOworICAgICAgICAgfQorICAgICAgICAgLyogbWF4X2VpcnAgaXMgaW4gbUJtICg9IDEwMCAqIGRCbSkgdW5pdCAqLworICAgICAgICAgcG52RUZTVGFibGUtPmhhbG52LnRhYmxlcy5yZWdEb21haW5zW2RvbWFpbl9pZF0uY2hhbm5lbHNbal0ucHdyTGltaXQgPQorICAgICAgICAgICAgKHRBTklfUzgpICgod2lwaHktPnJlZ2QtPnJlZ19ydWxlc1tpXS5wb3dlcl9ydWxlLm1heF9laXJwKS8xMDApOworICAgICAgfQorICAgICAgLyogaWdub3JlIENSREEgbWF4X2FudGVubmFfZ2FpbiB0eXBpY2FsIGlzIDNkQmksIG52LmJpbiBhbnRlbm5hR2FpbiBpcworICAgICAgICAgcmVhbCBnYWluIHdoaWNoIHNob3VsZCBiZSBwcm92aWRlZCBieSB0aGUgcmVhbCBkZXNpZ24gKi8KKyAgICAgIGlmICh3aXBoeS0+cmVnZC0+cmVnX3J1bGVzW2ldLmZyZXFfcmFuZ2UubWF4X2JhbmR3aWR0aF9raHogPT0gNDAwMDApCisgICAgICB7CisgICAgICAgICB3aXBoeV9kYmcod2lwaHksICJpbmZvOiA0ME1IeiAoY2hhbm5lbCBib25kaW5nKSBpcyBhbGxvd2VkXG4iKTsKKyAgICAgICAgIGJ3NDBfc3RhcnRfY2hhbm5lbF9pbmRleCA9CisgICAgICAgICAgICBidzQwX3N0YXJ0X2ZyZXFfdG9fY2hhbm5lbF9pbmRleCh3aXBoeS0+cmVnZC0+cmVnX3J1bGVzW2ldLmZyZXFfcmFuZ2Uuc3RhcnRfZnJlcV9raHopOworICAgICAgICAgYnc0MF9lbmRfY2hhbm5lbF9pbmRleCA9CisgICAgICAgICAgIC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X3N0YXJ0X2NoYW5uZWxfaW5kZXg7ajw9Ync0MF9lbmRfY2hhbm5lbF9pbmRleDtqKyspCisgICAgICAgICB7CisgICAgICAgICAgICBpZiAoY2hhbm5lbF9pbl9jYXBhYmxlX2JhbmQoaiwgbkJhbmRDYXBhYmlsaXR5KSA9PSBWT1NfRkFMU0UpCisgICAgICAgICAgICAgICAgY29udGludWU7IC8vIHNraXAgIHRoaXMgY2hhbm5lbCwgY29udGludWUgdG8gbmV4dAorICAgICAgICAgICAgaWYgKHdpcGh5LT5yZWdkLT5yZWdfcnVsZXNbaV0uZmxhZ3MgJiBOTDgwMjExX1JSRl9ERlMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcG52RUZTVGFibGUtPmhhbG52LnRhYmxlcy5yZWdEb21haW5zW2RvbWFpbl9pZF0uY2hhbm5lbHNbal0uZW5hYmxlZCA9IE5WX0NIQU5ORUxfREZTOworICAgICAgICAgICAgICAgIHdpcGh5X2RiZyh3aXBoeSwgImluZm86IDQwTUh6IGNlbnRlcmVkIG9uIENIICVkIGlzIERGU1xuIiwgcmZDaGFubmVsc1tqXS5jaGFubmVsTnVtKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnJlZ0RvbWFpbnNbZG9tYWluX2lkXS5jaGFubmVsc1tqXS5lbmFibGVkID0gTlZfQ0hBTk5FTF9FTkFCTEU7CisgICAgICAgICAgICAgICAgd2lwaHlfZGJnKHdpcGh5LCAiaW5mbzogNDBNSHogY2VudGVyZWQgb24gQ0ggJWQgaXMgZW5hYmxlZCwgbm8gREZTXG4iLCByZkNoYW5uZWxzW2pdLmNoYW5uZWxOdW0pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLyogc2V0IDQwTUh6IGNoYW5uZWwgcG93ZXIgYXMgaGFsZiAoLSAzIGRCKSBvZiAyME1IeiAqL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90IHBWb3NDb250ZXh0ID0gTlVMTDsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gTlVMTDsKKyAgICB2X1UxNl90IGZyZXE7CisgICAgdl9VMzJfdCBpLCBiYW5kOworICAgIHN0cnVjdCB3aXBoeSAqd2lwaHk7CisKKyAgICBwVm9zQ29udGV4dCA9IHZvc19nZXRfZ2xvYmFsX2NvbnRleHQoVk9TX01PRFVMRV9JRF9TWVMsIE5VTEwpOworCisgICAgaWYgKE5VTEwgIT0gcFZvc0NvbnRleHQpCisgICAgeworICAgICAgICBwSGRkQ3R4ID0gdm9zX2dldF9jb250ZXh0KFZPU19NT0RVTEVfSURfSERELCBwVm9zQ29udGV4dCk7CisgICAgICAgIGlmIChOVUxMID09IHBIZGRDdHgpCisgICAgICAgIHsKKyAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgKCJJbnZhbGlkIHBIZGRDdHggcG9pbnRlciIpICk7CisgICAgICAgICAgIHJldHVybiBWT1NfRkFMU0U7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgKCJJbnZhbGlkIHBWb3NDb250ZXh0IHBvaW50ZXIiKSApOworICAgICAgIHJldHVybiBWT1NfRkFMU0U7CisgICAgfQorICAgIC8qIG5vIDgwTWh6IGluIDIuNCBHSHoqLworICAgIGlmIChjaGFuIDw9IFJGX0NIQU5fMTQpCisgICAgICAgIHJldHVybiBWT1NfRkFMU0U7CisKKyAgICBiYW5kID0gSUVFRTgwMjExX0JBTkRfNUdIWjsKKyAgICBmcmVxID0gdm9zX2NoYW5fdG9fZnJlcShjaGFuKTsKKyAgICB3aXBoeSA9IHBIZGRDdHgtPndpcGh5OworCisgICAgZm9yIChpID0gMDsgaSA8IHdpcGh5LT5iYW5kc1tiYW5kXS0+bl9jaGFubmVsczsgaSsrKQorICAgIHsKKyAgICAgICAgaWYgKGZyZXEgPT0KKyAgICAgICAgICAgICB3aXBoeS0+YmFuZHNbYmFuZF0tPmNoYW5uZWxzW2ldLmNlbnRlcl9mcmVxKQorICAgICAgICB7CisgICAgICAgICAgaWYgKHdpcGh5LT5iYW5kc1tiYW5kXS0+Y2hhbm5lbHNbaV0uZmxhZ3MgJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSUVFRTgwMjExX0NIQU5fTk9fODBNSFopCisgICAgICAgICAgeworICAgICAgICAgICAgIHJldHVybiBWT1NfRkFMU0U7CisgICAgICAgICAgfQorICAgICAgICAgIHJldHVybiBWT1NfVFJVRTsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gVk9TX0ZBTFNFOworfQorCisjaWZkZWYgQ09ORklHX0VOQUJMRV9MSU5VWF9SRUcKKworc3RhdGljIGludCBidzIwX2NoX2luZGV4X3RvX2J3NDBfcGx1c19taW51c19jaF9pbmRleChpbnQgaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVDaGFubm5lbEJvbmRpbmdUeXBlcyBjYmZsYWcgKQoreworICAgaW50IG0gPSBJTlZBTElEX1JGX0NIQU5ORUw7CisgICBpZiAoayA+PSBSRl9DSEFOXzEgJiYgayA8PSBSRl9DSEFOXzE0KQorICAgeworICAgICAgaWYoUkZfQ0hBTl9CT05EX0hUNDBfUExVUyA9PSBjYmZsYWcpCisgICAgICAgICBtID0gayAtIFJGX0NIQU5fMSArIFJGX0NIQU5fQk9ORF8zIDsKKyAgICAgIGVsc2UKKyAgICAgICAgIG0gPSBrIC0gUkZfQ0hBTl8xICsgUkZfQ0hBTl9CT05EXzMgLSBIVF80ME1JTlVTX0lOREVYIDsKKworICAgICAgaWYgKG0gPiBSRl9DSEFOX0JPTkRfMTE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FZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAoIkludmFsaWQgcEhkZEN0eCBwb2ludGVyIikgKTsKKyAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICB9CisKKyAgICB0ZW1wX3JlZ19kb21haW4gPSBSRUdET01BSU5fQ09VTlQ7CisgICAgLyogbG9va3VwIHRoZSBjb3VudHJ5IGluIHRoZSBsb2NhbCBkYXRhYmFzZSAqLworICAgIGZvciAoaSA9IDA7IGkgPCBjb3VudHJ5SW5mb1RhYmxlLmNvdW50cnlDb3VudCAmJgorICAgICAgICAgICAgIFJFR0RPTUFJTl9DT1VOVCA9PSB0ZW1wX3JlZ19kb21haW47IGkrKykKKyAgICB7CisgICAgICAgIGlmIChtZW1jbXAoY291bnRyeV9jb2RlLCBjb3VudHJ5SW5mb1RhYmxlLmNvdW50cnlJbmZvW2ldLmNvdW50cnlDb2RlLAorICAgICAgICAgICAgICAgICAgIFZPU19DT1VOVFJZX0NPREVfTEVOKSA9PSAwKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBjb3VudHJ5IGNvZGUgaXMgZm91bmQgKi8KKyAgICAgICAgICAgIC8qIHJlY29yZCB0aGUgdGVtcG9yYXJ5IHJlZ3VsYXRvcnlfZG9tYWluIGFzIHdlbGwgKi8KKyAgICAgICAgICAgIHRlbXBfcmVnX2RvbWFpbiA9IGNvdW50cnlJbmZvVGFibGUuY291bnRyeUluZm9baV0ucmVnRG9tYWluOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBpZiAoUkVHRE9NQUlOX0NPVU5UID09IHRlbXBfcmVnX2RvbWFpbikgeworCisgICAgICAgIC8qIHRoZSBjb3VudHJ5IHdhcyBub3QgZm91bmQgaW4gdGhlIGRyaXZlciBkYXRhYmFzZSAqLworICAgICAgICAvKiBzbyB3ZSB3aWxsIHJldHVybiB0aGUgUkVHRE9NQUlOX1dPUkxEI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Vk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICgicmVnZG9tYWluIHJlcXVlc3QiKSk7CisKKyAgICBpZiAoKGNvdW50cnlfY29kZVswXSA9PSBsaW51eF9yZWdfY2NbMF0pICYmCisgICAgICAgIChjb3VudHJ5X2NvZGVbMV0gPT0gbGludXhfcmVnX2NjWzFdKSkgeworCisgICAgICAgIC8qIGNvdW50cnkgY29kZSBhbHJlYWR5IGV4aXN0cyAqLworCisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAoIiBjb3VudHJ5IGNvZGUgYWxyZWFkeSBleGlzdHMiKSk7CisKKyAgICAgICAgKnBSZWdEb21haW4gPSBjdXJfcmVnX2RvbWFpbjsKKworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworICAgIH0KKyAgICBlbHNlIHsKKworICAgICAgICAvKiBnZXQgdGhlIHJlZ3VsYXRvcnkgaW5mb3JtYXRpb24gZnJvbSB0aGUga2VybmVsCisgICAgICAgICAgIGRhdGFiYXNlICovCisKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICgiIGdldCBjb3VudHJ5IGluZm9ybWF0aW9uIGZyb20ga2VybmVsIGRiIikpOworCisKKyAgICAgICAgaWYgKENPVU5UUllfTlYgPT0gc291cmNlKQorICAgICAgICB7CisgICAgICAgICAgICBJTklUX0NPTVBMRVRJT04ocEhkZEN0eC0+bGludXhfcmVnX3JlcSk7CisgICAgICAgICAgICByZWd1bGF0b3J5X2hpbnQod2lwaHksIGNvdW50cnlfY29kZSk7CisgICAgICAgICAgICAvKiBXYWl0IGZvciAzMDBtcyovCisgICAgICAgICAgICB3YWl0X3Jlc3VsdCA9IHdhaXRfZm9yX2NvbXBsZXRpb25faW50ZXJydXB0aWJsZV90aW1lb3V0KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBIZGRDdHgtPmxpbnV4X3JlZ19yZXEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2Vjc190b19qaWZmaWVzKExJTlVYX1JFR19XQUlUX1RJTUUpKTsKKworICAgICAgICAgICAgLyogaWYgdGhlIGNvdW50cnkgaW5mb3JtYXRpb24gZG9lcyBub3QgZXhpc3Qgd2l0aCB0aGUga2VybmVsLAorICAgICAgICAgICAgICAgdGhlbiB0aGUgZHJpdmVyIGNhbGxiYWNrIHdvdWxkIG5vdCBiZSBjYWxsZWQgKi8KKworICAgICAgICAgICAgaWYgKHdhaXRfcmVzdWx0ID49IDApIHsKKworICAgICAgICAgICAgICAgIC8qIHRoZSBkcml2ZXIgY2FsbGJhY2sgd2FzIGNhbGxlZC4gdGhpcyBtZWFucyB0aGUgY291bnRyeQorICAgICAgICAgICAgICAgICAgIHJlZ3VsYXRvcnkgaW5mb3JtYXRpb24gd2FzIGZvdW5kIGluIHRoZSBrZXJuZWwgZGF0YWJhc2UuCisgICAgICAgICAgICAgICAgICAgVGhlIGNhbGxiYWNrIHdvdWxkIGhhdmUgdXBkYXRlZCB0aGUgaW50ZXJuYWwgZGF0YWJhc2UuIEhlcmUKKyAgICAgICAgICAgICAgICAgICB1cGRhdGUgdGhlIGNvdW50cnkgYW5kIHRoZSByZXR1cm4gdmFsdWUgZm9yIHRoZSByZWd1bGF0b3J5CisgICAgICAgICAgICAgICAgICAgZG9tYWluICovCisKKyAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAoInJ1bnRpbWUgY291bnRyeSBjb2RlIGlzIGZvdW5kIGluIGtlcm5lbCBkYiIpKTsKKworICAgICAgICAgICAgICAgICpwUmVnRG9tYWluID0gdGVtcF9yZWdfZG9tYWluOworICAgICAgICAgICAgICAgIGN1cl9yZWdfZG9tYWluID0gdGVtcF9yZWdfZG9tYWluOworICAgICAgICAgICAgICAgIGxpbnV4X3JlZ19jY1swXSA9IGNvdW50cnlfY29kZVswXTsKKyAgICAgICAgICAgICAgICBsaW51eF9yZWdfY2NbMV0gPSBjb3VudHJ5X2NvZGVbMV07CisKKyAgICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSB7CisKKyAgICAgICAgICAgICAgICAvKiB0aGUgY291bnRyeSBpbmZvcm1hdGlvbiBoYXMgbm90IGJlZW4gZm91bmQgaW4gdGhlIGtlcm5lbAorICAgICAgICAgICAgICAgICAgIGRhdGFiYXNlLCByZXR1cm4gZmFpbHVyZSAqLworCisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKCJydW50aW1lIGNvdW50cnkgY29kZSBpcyBub3QgZm91bmQgaW4ga2VybmVsIGRiIikpOworCisgICAgICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9FWElTVFM7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoQ09VTlRSWV9JRSA9PSBzb3VyY2UgfHwgQ09VTlRSWV9VU0VSID09IHNvdXJjZSkKKyAgICAgICAgeworICAgICAgICAgICAgSU5JVF9DT01QTEVUSU9OKHBIZGRDdHgtPmxpbnV4X3JlZ19yZXEpOworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMyw5LDApKQorICAgICAgICAgICAgcmVndWxhdG9yeV9oaW50X3VzZXIoY291bnRyeV9jb2RlLE5MODAyMTFfVVNFUl9SRUdfSElOVF9VU0VSKTsKKyNlbHNlCisgICAgICAgICAgICByZWd1bGF0b3J5X2hpbnRfdXNlcihjb3VudHJ5X2NvZGUpOworI2VuZGlmCisgICAgICAgICAgICB3YWl0X3Jlc3VsdCA9IHdhaXRfZm9yX2NvbXBsZXRpb25faW50ZXJydXB0aWJsZV90aW1lb3V0KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwSGRkQ3R4LT5saW51eF9yZWdfcmVxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoTElOVVhfUkVHX1dBSVRfVElNRSkpOworCisgICAgICAgICAgICAvKiBpZiB0aGUgY291bnRyeSBpbmZvcm1hdGlvbiBkb2VzIG5vdCBleGlzdCB3aXRoIHRoZSBrZXJuZWwsCisgICAgICAgICAgICAgICB0aGVuIHRoZSBkcml2ZXIgY2FsbGJhY2sgd291bGQgbm90IGJlIGNhbGxlZCAqLworCisgICAgICAgICAgICBpZiAod2FpdF9yZXN1bHQgPj0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJydW50aW1lIGNvdW50cnkgY29kZSA6ICVjJWMgaXMgZm91bmQgaW4ga2VybmVsIGRiIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb3VudHJ5X2NvZGVbMF0sIGNvdW50cnlfY29kZVsxXSk7CisgICAgICAgICAgICAgICAqcFJlZ0RvbWFpbiA9IHRlbXBfcmVnX2RvbWFpbjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICJydW50aW1lIGNvdW50cnkgY29kZSA6ICVjJWMgaXMgbm90IGZvdW5kIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBpbiBrZXJuZWwgZGIiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50cnlfY29kZVswXSwgY291bnRyeV9jb2RlWzFdKTsKKworICAgICAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRVhJU1RTOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgIH0KKworICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworaW50IHZvc191cGRhdGVfbnZfdGFibGVfZnJvbV93aXBoeV9iYW5kKHZvaWQgKmhkZF9jdHgsCisgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqcHdpcGh5LHZfVThfdCBuQmFuZENhcGFiaWxpdHkpCit7CisgICBpbnQgaSwgaiwgbTsKKyAgIGludCBrID0gMCwgbiA9IDA7CisgICBjb25zdCBzdHJ1Y3QgaWVlZTgwMjExX3JlZ19ydWxlICpyZWdfcnVsZTsKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFIDwgS0VSTkVMX1ZFUlNJT04oMyw5LDApKQorICAgaW50IGVycjsKKyNlbmRpZgorICAgaGRkX2NvbnRleHRfdCAqcEhkZEN0eCA9IChoZGRfY29udGV4dF90ICopaGRkX2N0eDsKKyAgIHN0cnVjdCB3aXBoeSAqd2lwaHkgPSAoc3RydWN0IHdpcGh5ICopcHdpcGh5OworCisgICBmb3IgKGkgPSAwLCBtID0gMDsgaTxJRUVFODAyMTFfTlVNX0JBTkRTOyBpKyspCisgICB7CisKKyAgICAgICAgaWYgKHdpcGh5LT5iYW5kc1tpXSA9PSBOVUxMKQorICAgICAgICB7CisKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICJlcnJvcjogd2lwaHktPmJhbmRzIGlzIE5VTEwsIGkgPSAlZCIsIGkpOworICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKworICAgICAgICAvKiBpbnRlcm5hbCBjaGFubmVsc1tdIGlzIG9uZSBjb250aW5vdXMgYXJyYXkgZm9yIGJvdGggMkcgYW5kIDVHIGJhbmRzCisgICAgICAgICAgIG0gaXMgaW50ZXJuYWwgc3RhcnRpbmcgY2hhbm5lbCBpbmRleCBmb3IgZWFjaCBiYW5kICovCisKKyAgICAgICAgaWYgKGkgPT0gMCkKKyAgICAgICAgICAgIG0gPSAwOworICAgICAgICBlbHNlCisgICAgICAgICAgICBtID0gd2lwaHktPmJhbmRzW2ktMV0tPm5fY2hhbm5lbHMgKyBtOworCisgICAgICAgIGZvciAoaiA9IDA7IGogPCB3aXBoeS0+YmFuZHNbaV0tPm5fY2hhbm5lbHM7IGorKykKKyAgICAgICAgeworICAgICAgICAgICAgIGlmIChJRUVFODAyMTFfQkFORF8yR0haID09IGkgJiYgZUNTUl9CQU5EXzVHID09IG5CYW5kQ2FwYWJpbGl0eSkKKyAgICAgICAgICAgICAgICAgIHdpcGh5LT5iYW5kc1tpXS0+Y2hhbm5lbHNbal0uZmxhZ3MgfD0gSUVFRTgwMjExX0NIQU5fRElTQUJMRUQ7CisgICAgICAgICAgICAgZWxzZSBpZiAoSUVFRTgwMjExX0JBTkRfNUdIWiA9PSBpICYmIGVDU1JfQkFORF8yNCA9PSBuQmFuZENhcGFiaWxpdHkpCisgICAgICAgICAgICAgICAgICB3aXBoeS0+YmFuZHNbaV0tPmNoYW5uZWxzW2pdLmZsYWdzIHw9IElFRUU4MDIxMV9DSEFOX0RJU0FCTEVEOworCisgICAgICAgICAgICAvKiBrID0gKG0gKyBqKSBpcyBpbnRlcm5hbCBjdXJyZW50IGNoYW5uZWwgaW5kZXggZm9yIDIwTUh6IGNoYW5uZWwKKyAgICAgICAgICAgICAgbiBpcyBpbnRlcm5hbCBjaGFubmVsIGluZGV4IGZvciBjb3JyZXNwb25kaW5nIDQwTUh6IGNoYW5uZWwgKi8KKworICAgICAgICAgICAgayA9IG0gKyBqOworCisgICAgICAgICAgICAvKiBJZiB0aGUgcmVndWxhdG9yeSBydWxlcyBmb3IgYSBjb3VudHJ5IGRvIG5vdCBleHBsaWNpbHR5CisgICAgICAgICAgICAgKiByZXF1aXJlIGEgcGFzc2l2ZSBzY2FuIG9uIGEgZnJlcXVlbmN5LCBsaWZ0IHRoZSBwYXNzaXZlCisgICAgICAgICAgICAgKiBzY2FuIHJlc3RyaWN0aW9uCisgICAgICAgICAgICAgKi8KKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsOSwwKSkKKyAgICAgICAgICAgIHJlZ19ydWxlID0gZnJlcV9yZWdfaW5mbyh3aXBoeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNSFpfVE9fS0haKHdpcGh5LT5iYW5kc1tpXS0+Y2hhbm5lbHNbal0uY2VudGVyX2ZyZXEpKTsKKyNlbHNlCisgICAgICAgICAgICBlcnIgPSBmcmVxX3JlZ19pbmZvKHdpcGh5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNSFpfVE9fS0haKHdpcGh5LT5iYW5kc1tpXS0+Y2hhbm5lbHNbal0uY2VudGVyX2ZyZXEpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCAmcmVnX3J1bGUpOworI2VuZGlmCisKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFID49IEtFUk5FTF9WRVJTSU9OKDMsOSwwKSkKKyAgICAgICAgICAgIGlmICghSVNfRVJSKHJlZ19ydWxlKSkKKyNlbHNlCisgICAgICAgICAgICBpZiAoMCA9PSBlcnIpCisjZW5kaWYKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBXaGVuIENvdW50cnkgY29kZSBpbiBudi5iaW4gZmlsZSBpcyBOb24gWmVybyAgYW5kIFJlZyBEb21haW4KKyAgICAgICAgICAgICAgICAgKiBpcyB3b3JsZDsgaXQncyBuZWl0aGVyIENVU1RPTSBub3IgU1RSSUNULiBJbiB0aGlzIENhc2UKKyAgICAgICAgICAgICAgICAgKiBpZiBjb3VudHJ5IGNvZGUgaXMgTm9uLVplcm8gYW5kIGRvbWFpbiBpcyB3b3JsZDsgZHJpdmVyCisgICAgICAgICAgICAgICAgICogd2lsbCBub3QgY2hhbmdlIGNoYW5uZWwgdG8gYWN0aXZlLgorICAgICAgICAgICAgICAgICAqLworCisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDE0LDApKQorICAgICAgICAgICAgICAgIGlmICAoISh3aXBoeS0+cmVndWxhdG9yeV9mbGFncyAmIFJFR1VMQVRPUllfU1RSSUNUX1JFRykpCisjZWxzZQorICAgICAgICAgICAgICAgIGlmICAoISh3aXBoeS0+ZmxhZ3MgJiBXSVBIWV9GTEFHX1NUUklDVF9SRUdVTEFUT1JZICkpCisjZW5kaWYKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmICghKHJlZ19ydWxlLT5mbGFncyAmIE5MODAyMTFfUlJGX1BBU1NJVkVfU0NBTikpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogUmVtb3ZlIHBhc3NpdmUgc2NhbiByZXN0cmljdGlvbiBmb3IgJXUiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCB3aXBoeS0+YmFuZHNbaV0tPmNoYW5uZWxzW2pdLmNlbnRlcl9mcmVxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHdpcGh5LT5iYW5kc1tpXS0+Y2hhbm5lbHNbal0uZmxhZ3MgJj0gfklFRUU4MDIxMV9DSEFOX1BBU1NJVkVfU0NBTjsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIHdpcGh5LT5iYW5kc1tpXS0+Y2hhbm5lbHNbal0ubWF4X3Bvd2VyID0KKyAgICAgICAgICAgICAgICAgICAgICAgIChpbnQpIE1CTV9UT19EQk0ocmVnX3J1bGUtPnBvd2VyX3J1bGUubWF4X2VpcnApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHdpcGh5LT5iYW5kc1tpXS0+Y2hhbm5lbHNbal0uZmxhZ3MgJiBJRUVFODAyMTFfQ0hBTl9ESVNBQkxFRCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAocG52RUZTVGFibGUgPT0gTlVMTCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJlcnJvcjogcG52RUZTVGFibGUgaXMgTlVMTCwgcHJvYmFibHkgbm90IHBhcnNlZCBudi5iaW4geWV0Iik7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcG52RUZTVGFibGUtPmhhbG52LnRhYmxlcy5yZWdEb21haW5zW3RlbXBfcmVnX2RvbWFpbl0uY2hhbm5lbHNba10uZW5hYmxlZCA9CisgICAgICAgICAgICAgICAgICAgIE5WX0NIQU5ORUxfRElTQUJMRTsKKyAgICAgICAgICAgICAgICBpZiAoSU5WQUxJRF9SRl9DSEFOTkVMICE9CisgICAgICAgICAgICAgICAgICAgIChuID0gYncyMF9jaF9pbmRleF90b19idzQwX3BsdXNfbWludXNfY2hfaW5kZXgoIGsgLCBSRl9DSEFOX0JPTkRfSFQ0MF9NSU5VUykpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcG52RUZTVGFibGUtPmhhbG52LnRhYmxlcy5yZWdEb21haW5zW3RlbXBfcmVnX2RvbWFpbl0uY2hhbm5lbHNbbl0uZW5hYmxlZCA9CisgICAgICAgICAgICAgICAgICAgICAgIE5WX0NIQU5ORUxfRElTQUJMRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKElOVkFMSURfUkZfQ0hBTk5FTCAhPQorICAgICAgICAgICAgICAgICAgICAobiA9IGJ3MjBfY2hfaW5kZXhfdG9fYnc0MF9wbHVzX21pbnVzX2NoX2luZGV4KCBrICwgUkZfQ0hBTl9CT05EX0hUNDBfUExVUykpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcG52RUZTVGFibGUtPmhhbG52LnRhYmxlcy5yZWdEb21haW5zW3RlbXBfcmVnX2RvbWFpbl0uY2hhbm5lbHNbbl0uZW5hYmxlZCA9CisgICAgICAgICAgICAgICAgICAgICAgIE5WX0NIQU5ORUxfRElTQUJMRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBudiBjYW5ub3QgZGlzdGluZ3Vpc2ggYmV0d2VlbiBERlMgYW5kIHBhc3NpdmUgY2hhbm5lbHMgKi8KKyAgICAgICAgICAgIGVsc2UgaWYgKHdpcGh5LT5iYW5kc1tpXS0+Y2hhbm5lbHNbal0uZmxhZ3MgJgorICAgICAgICAgICAgICAgICAgICAoSUVFRTgwMjExX0NIQU5fUkFEQVIgfCBJRUVFODAyMTFfQ0hBTl9QQVNTSVZFX1NDQU4pKQorICAgICAgICAgICAgeworI2lmZGVmIEZFQVRVUkVfV0xBTl9DSDE0NAorICAgICAgICAgICAgICAgIGlmICgoUkZfQ0hBTl8xNDQgPT0gaykgJiYgKEVfTlZfVjMgIT0gdm9zX252X2dldE52VmVyc2lvbigpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vRG8gbm90IGVuYWJsZSBjaGFubmVsIDE0NCB3aGVuIE5WIHZlcnNpb24gaXMgbm90IE5WMworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisjZW5kaWYKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucmVnRG9tYWluc1t0ZW1wX3JlZ19kb21haW5dLlwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxzW2tdLmVuYWJsZWQgPSBOVl9DSEFOTkVMX0RGUzsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoIWdudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucmVnRG9tYWluc1t0ZW1wX3JlZ19kb21haW5dLmNoYW5uZWxzW2tdLnB3ckxpbWl0CisgICAgICAgICAgICAgICAgICAgICYmICF3aXBoeS0+YmFuZHNbaV0tPmNoYW5uZWxzW2pdLm1heF9wb3dlcikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkJvdGggTlYgYW5kIERCLnR4dCBwb3dlciBsaW1pdCBpcyB6ZXJvLiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiU2V0dGluZyBkZWZhdWx0IHZhbHVlICVkIiksVFhfUE9XRVJfREVGQVVMVCk7CisgICAgICAgICAgICAgICAgICAgIHdpcGh5LT5iYW5kc1tpXS0+Y2hhbm5lbHNbal0ubWF4X3Bvd2VyID0gVFhfUE9XRVJfREVGQVVMVDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBlbHNlIGlmICghZ252RUZTVGFibGUtPmhhbG52LnRhYmxlcy5yZWdEb21haW5zW3RlbXBfcmVnX2RvbWFpbl0uY2hhbm5lbHNba10ucHdyTGltaXQKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCAhd2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5tYXhfcG93ZXIpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgd2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5tYXhfcG93ZXIgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFYKGdudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucmVnRG9tYWluc1t0ZW1wX3JlZ19kb21haW5dLmNoYW5uZWxzW2tdLnB3ckxpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh3aXBoeS0+YmFuZHNbaV0tPmNoYW5uZWxzW2pdLm1heF9wb3dlcikpKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBDYXAgdGhlIFRYIHBvd2VyIGJ5IHRoZSBwb3dlciBsaW1pdHMgc3BlY2lmaWVkIGluIE5WIGZvciB0aGUgcmVnZG9tYWluCisgICAgICAgICAgICAgICAgaWYgKGdudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucmVnRG9tYWluc1t0ZW1wX3JlZ19kb21haW5dLmNoYW5uZWxzW2tdLnB3ckxpbWl0CisgICAgICAgICAgICAgICAgICAgICYmIHdpcGh5LT5iYW5kc1tpXS0+Y2hhbm5lbHNbal0ubWF4X3Bvd2VyKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgd2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5tYXhfcG93ZXIgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgTUlOKGdudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucmVnRG9tYWluc1t0ZW1wX3JlZ19kb21haW5dLmNoYW5uZWxzW2tdLnB3ckxpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfUzgpICgod2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5tYXhfcG93ZXIpKSk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgcG52RUZTVGFibGUtPmhhbG52LnRhYmxlcy5yZWdEb21haW5zW3RlbXBfcmVnX2RvbWFpbl0uY2hhbm5lbHNba10ucHdyTGltaXQgPQorICAgICAgICAgICAgICAgICAgICAodEFOSV9TOCkgKCh3aXBoeS0+YmFuZHNbaV0tPmNoYW5uZWxzW2pdLm1heF9wb3dlcikpOworCisgICAgICAgICAgICAgICAgLyogRGlzYWJsZSB0aGUgY2VudGVyIGNoYW5uZWwgaWYgbmVpdGhlciBIVDQwKyBub3IgSFQ0MC0gaXMgYWxsb3dlZAorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGlmICgod2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5mbGFncyAmIElFRUU4MDIxMV9DSEFOX05PX0hUNDApID09CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSUVFRTgwMjExX0NIQU5fTk9fSFQ0MCApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIGlmICggSU5WQUxJRF9SRl9DSEFOTkVMICE9CisgICAgICAgICAgICAgICAgICAgICAgIChuID0gYncyMF9jaF9pbmRleF90b19idzQwX3BsdXNfbWludXNfY2hfaW5kZXgoIGssIFJGX0NIQU5fQk9ORF9IVDQwX01JTlVTKSkpCisgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICBwbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnJlZ0RvbWFpbnNbdGVtcF9yZWdfZG9tYWluXS5jaGFubmVsc1tuXS5lbmFibGVkID0KKyAgICAgICAgICAgICAgICAgICAgICAgIE5WX0NIQU5ORUxfRElTQUJMRTsKKyAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgaWYgKCBJTlZBTElEX1JGX0NIQU5ORUwgIT0KKyAgICAgICAgICAgICAgICAgICAgICAobiA9IGJ3MjBfY2hfaW5kZXhfdG9fYnc0MF9wbHVzX21pbnVzX2NoX2luZGV4KCBrLCBSRl9DSEFOX0JPTkRfSFQ0MF9QTFVTKSkpCisgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICBwbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnJlZ0RvbWFpbnNbdGVtcF9yZWdfZG9tYWluXS5jaGFubmVsc1tuXS5lbmFibGVkID0KKyAgICAgICAgICAgICAgICAgICAgICAgICBOVl9DSEFOTkVMX0RJU0FCTEU7CisgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAoISh3aXBoeS0+YmFuZHNbaV0tPmNoYW5uZWxzW2pdLmZsYWdzICYgSUVFRTgwMjExX0NIQU5fTk9fSFQ0MFBMVVMpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKElOVkFMSURfUkZfQ0hBTk5FTCAhPQorICAgICAgICAgICAgICAgICAgICAgICAgICAobiA9IGJ3MjBfY2hfaW5kZXhfdG9fYnc0MF9wbHVzX21pbnVzX2NoX2luZGV4KCBrLCBSRl9DSEFOX0JPTkRfSFQ0MF9QTFVTKSkpCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBwbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnJlZ0RvbWFpbnNbdGVtcF9yZWdfZG9tYWluXS5jaGFubmVsc1tuXS5lbmFibGVkID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVl9DSEFOTkVMX0RGUzsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAvKiA0ME1IeiBjaGFubmVsIHBvd2VyIGlzIGhhbGYgb2YgMjBNSHogKC0zZEIpLCBzbyBzdWJ0cmFjdCAzZEIgZnJvbQorICAgICAgICAgICAgICAgICAgICAgICAgICAgKiB3aXBoeSBsaW1pdHMsIHNpbmNlIHdpcGh5IGhhcyBzYW1lIGxpbWl0cyBmb3IgMjBNSHogYW5kIDQwTUh6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgICAgICBwbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnJlZ0RvbWFpbnNbdGVtcF9yZWdfZG9tYWluXS5jaGFubmVsc1tuXS5wd3JMaW1pdCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICBNSU4oZ252RUZTVGFibGUtPmhhbG52LnRhYmxlcy5yZWdEb21haW5zW3RlbXBfcmVnX2RvbWFpbl0uY2hhbm5lbHNbbl0ucHdyTGltaXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfUzgpICgod2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5tYXhfcG93ZXItMykpKTsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKCEod2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5mbGFncyAmIElFRUU4MDIxMV9DSEFOX05PX0hUNDBNSU5VUykpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgaWYgKElOVkFMSURfUkZfQ0hBTk5FTCAhPQorICAgICAgICAgICAgICAgICAgICAgICAgICAobiA9IGJ3MjBfY2hfaW5kZXhfdG9fYnc0MF9wbHVzX21pbnVzX2NoX2luZGV4KCBrLCBSRl9DSEFOX0JPTkRfSFQ0MF9NSU5VUykpKQorICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucmVnRG9tYWluc1t0ZW1wX3JlZ19kb21haW5dLmNoYW5uZWxzW25dLmVuYWJsZWQgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5WX0NIQU5ORUxfREZTOworCisgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDQwTUh6IGNoYW5uZWwgcG93ZXIgaXMgaGFsZiBvZiAyME1IeiAoLTNkQiksIHNvIHN1YnRyYWN0IDNkQiBmcm9tCisgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHdpcGh5IGxpbWl0cywgc2luY2Ugd2lwaHkgaGFzIHNhbWUgbGltaXRzIGZvciAyME1IeiBhbmQgNDBNSHoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICogY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucmVnRG9tYWluc1t0ZW1wX3JlZ19kb21haW5dLmNoYW5uZWxzW25dLnB3ckxpbWl0ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIE1JTihnbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnJlZ0RvbWFpbnNbdGVtcF9yZWdfZG9tYWluXS5jaGFubmVsc1tuXS5wd3JMaW1pdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfUzgpICgod2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5tYXhfcG93ZXItMykpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICgod2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5mbGFncyAmIElFRUU4MDIxMV9DSEFOX05PXzgwTUhaKSA9PSAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBpZiAoTlVMTCA9PSBwSGRkQ3R4KQorICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgiSW52YWxpZCBwSGRkQ3R4IHBvaW50ZXIiKSApOworICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPmlzVkhUODBBbGxvd2VkID0gMTsKKyAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSAvKiBFbmFibGUgaXMgb25seSBsYXN0IGZsYWcgd2Ugc3VwcG9ydCAqLworICAgICAgICAgICAgeworI2lmZGVmIEZFQVRVUkVfV0xBTl9DSDE0NAorICAgICAgICAgICAgICAgIGlmICgoUkZfQ0hBTl8xNDQgPT0gaykgJiYgKEVfTlZfVjMgIT0gdm9zX252X2dldE52VmVyc2lvbigpKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8vRG8gbm90IGVuYWJsZSBjaGFubmVsIDE0NCB3aGVuIE5WIHZlcnNpb24gaXMgbm90IE5WMworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisjZW5kaWYKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucmVnRG9tYWluc1t0ZW1wX3JlZ19kb21haW5dLlwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxzW2tdLmVuYWJsZWQgPSBOVl9DSEFOTkVMX0VOQUJMRTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoIWdudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucmVnRG9tYWluc1t0ZW1wX3JlZ19kb21haW5dLmNoYW5uZWxzW2tdLnB3ckxpbWl0CisgICAgICAgICAgICAgICAgICAgICYmICF3aXBoeS0+YmFuZHNbaV0tPmNoYW5uZWxzW2pdLm1heF9wb3dlcikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIkJvdGggTlYgYW5kIERCLnR4dCBwb3dlciBsaW1pdCBpcyB6ZXJvLiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiU2V0dGluZyBkZWZhdWx0IHZhbHVlICVkIiksVFhfUE9XRVJfREVGQVVMVCk7CisgICAgICAgICAgICAgICAgICAgIHdpcGh5LT5iYW5kc1tpXS0+Y2hhbm5lbHNbal0ubWF4X3Bvd2VyID0gVFhfUE9XRVJfREVGQVVMVDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBlbHNlIGlmICghZ252RUZTVGFibGUtPmhhbG52LnRhYmxlcy5yZWdEb21haW5zW3RlbXBfcmVnX2RvbWFpbl0uY2hhbm5lbHNba10ucHdyTGltaXQKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCAhd2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5tYXhfcG93ZXIpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgd2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5tYXhfcG93ZXIgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFYKGdudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucmVnRG9tYWluc1t0ZW1wX3JlZ19kb21haW5dLmNoYW5uZWxzW2tdLnB3ckxpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh3aXBoeS0+YmFuZHNbaV0tPmNoYW5uZWxzW2pdLm1heF9wb3dlcikpKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBDYXAgdGhlIFRYIHBvd2VyIGJ5IHRoZSBwb3dlciBsaW1pdHMgc3BlY2lmaWVkIGluIE5WIGZvciB0aGUgcmVnZG9tYWluCisgICAgICAgICAgICAgICAgaWYgKGdudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucmVnRG9tYWluc1t0ZW1wX3JlZ19kb21haW5dLmNoYW5uZWxzW2tdLnB3ckxpbWl0CisgICAgICAgICAgICAgICAgICAgICYmIHdpcGh5LT5iYW5kc1tpXS0+Y2hhbm5lbHNbal0ubWF4X3Bvd2VyKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgd2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5tYXhfcG93ZXIgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgTUlOKGdudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucmVnRG9tYWluc1t0ZW1wX3JlZ19kb21haW5dLmNoYW5uZWxzW2tdLnB3ckxpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfUzgpICgod2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5tYXhfcG93ZXIpKSk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLyogbWF4X3Bvd2VyIGlzIGluIGRCbSAqLworICAgICAgICAgICAgICAgIHBudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucmVnRG9tYWluc1t0ZW1wX3JlZ19kb21haW5dLmNoYW5uZWxzW2tdLnB3ckxpbWl0ID0KKyAgICAgICAgICAgICAgICAgICAgKHRBTklfUzgpICgod2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5tYXhfcG93ZXIpKTsKKworICAgICAgICAgICAgICAgIC8qIERpc2FibGUgdGhlIGNlbnRlciBjaGFubmVsIGlmIG5laXRoZXIgSFQ0MCsgbm9yIEhUNDAtIGlzIGFsbG93ZWQKKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBpZiAoKHdpcGh5LT5iYW5kc1tpXS0+Y2hhbm5lbHNbal0uZmxhZ3MgJiBJRUVFODAyMTFfQ0hBTl9OT19IVDQwKSA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElFRUU4MDIxMV9DSEFOX05PX0hUNDAgKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBpZiAoIElOVkFMSURfUkZfQ0hBTk5FTCAhPQorICAgICAgICAgICAgICAgICAgICAgICAobiA9IGJ3MjBfY2hfaW5kZXhfdG9fYnc0MF9wbHVzX21pbnVzX2NoX2luZGV4KCBrLCBSRl9DSEFOX0JPTkRfSFQ0MF9NSU5VUykpKQorICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgcG52RUZTVGFibGUtPmhhbG52LnRhYmxlcy5yZWdEb21haW5zW3RlbXBfcmVnX2RvbWFpbl0uY2hhbm5lbHNbbl0uZW5hYmxlZCA9CisgICAgICAgICAgICAgICAgICAgICAgICBOVl9DSEFOTkVMX0RJU0FCTEU7CisgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgIGlmICggSU5WQUxJRF9SRl9DSEFOTkVMICE9CisgICAgICAgICAgICAgICAgICAgICAgKG4gPSBidzIwX2NoX2luZGV4X3RvX2J3NDBfcGx1c19taW51c19jaF9pbmRleCggaywgUkZfQ0hBTl9CT05EX0hUNDBfUExVUykpKQorICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgcG52RUZTVGFibGUtPmhhbG52LnRhYmxlcy5yZWdEb21haW5zW3RlbXBfcmVnX2RvbWFpbl0uY2hhbm5lbHNbbl0uZW5hYmxlZCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgTlZfQ0hBTk5FTF9ESVNBQkxFOworICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCEod2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5mbGFncyAmIElFRUU4MDIxMV9DSEFOX05PX0hUNDBQTFVTKSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGlmIChJTlZBTElEX1JGX0NIQU5ORUwgIT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgKG4gPSBidzIwX2NoX2luZGV4X3RvX2J3NDBfcGx1c19taW51c19jaF9pbmRleCggaywgUkZfQ0hBTl9CT05EX0hUNDBfUExVUykpKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcG52RUZTVGFibGUtPmhhbG52LnRhYmxlcy5yZWdEb21haW5zW3RlbXBfcmVnX2RvbWFpbl0uY2hhbm5lbHNbbl0uZW5hYmxlZCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlZfQ0hBTk5FTF9FTkFCTEU7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogNDBNSHogY2hhbm5lbCBwb3dlciBpcyBoYWxmIG9mIDIwTUh6ICgtM2RCKSwgc28gc3VidHJhY3QgM2RCIGZyb20KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICogd2lwaHkgbGltaXRzLCBzaW5jZSB3aXBoeSBoYXMgc2FtZSBsaW1pdHMgZm9yIDIwTUh6IGFuZCA0ME1IegorICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBjaGFubmVscworICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgcG52RUZTVGFibGUtPmhhbG52LnRhYmxlcy5yZWdEb21haW5zW3RlbXBfcmVnX2RvbWFpbl0uY2hhbm5lbHNbbl0ucHdyTGltaXQgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgTUlOKGdudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucmVnRG9tYWluc1t0ZW1wX3JlZ19kb21haW5dLmNoYW5uZWxzW25dLnB3ckxpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QU5JX1M4KSAoKHdpcGh5LT5iYW5kc1tpXS0+Y2hhbm5lbHNbal0ubWF4X3Bvd2VyLTMpKSk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmICghKHdpcGh5LT5iYW5kc1tpXS0+Y2hhbm5lbHNbal0uZmxhZ3MgJiBJRUVFODAyMTFfQ0hBTl9OT19IVDQwTUlOVVMpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgIGlmIChJTlZBTElEX1JGX0NIQU5ORUwgIT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAobiA9IGJ3MjBfY2hfaW5kZXhfdG9fYnc0MF9wbHVzX21pbnVzX2NoX2luZGV4KCBrLCBSRl9DSEFOX0JPTkRfSFQ0MF9NSU5VUykpKQorICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucmVnRG9tYWluc1t0ZW1wX3JlZ19kb21haW5dLmNoYW5uZWxzW25dLmVuYWJsZWQgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5WX0NIQU5ORUxfRU5BQkxFOworCisgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDQwTUh6IGNoYW5uZWwgcG93ZXIgaXMgaGFsZiBvZiAyME1IeiAoLTNkQiksIHNvIHN1YnRyYWN0IDNkQiBmcm9tCisgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHdpcGh5IGxpbWl0cywgc2luY2Ugd2lwaHkgaGFzIHNhbWUgbGltaXRzIGZvciAyME1IeiBhbmQgNDBNSHoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICogY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBudkVGU1RhYmxlLT5oYWxudi50YWJsZXMucmVnRG9tYWluc1t0ZW1wX3JlZ19kb21haW5dLmNoYW5uZWxzW25dLnB3ckxpbWl0ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIE1JTihnbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnJlZ0RvbWFpbnNbdGVtcF9yZWdfZG9tYWluXS5jaGFubmVsc1tuXS5wd3JMaW1pdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRBTklfUzgpICgod2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5tYXhfcG93ZXItMykpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICgod2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5mbGFncyAmIElFRUU4MDIxMV9DSEFOX05PXzgwTUhaKSA9PSAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBpZiAoTlVMTCA9PSBwSGRkQ3R4KQorICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgiSW52YWxpZCBwSGRkQ3R4IHBvaW50ZXIiKSApOworICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIHBIZGRDdHgtPmlzVkhUODBBbGxvd2VkID0gMTsKKyAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICB9CisKKworICAgICAgICB9CisgICAgfQorCisgICAgaWYgKGsgPT0gMCkKKyAgICAgICByZXR1cm4gLTE7CisKKyAgICByZXR1cm4gMDsKK30KKworLyogY3JlYXRlX2xpbnV4X3JlZ3VsYXRvcnlfZW50cnkgdG8gcG9wdWxhdGUgaW50ZXJuYWwgc3RydWN0dXJlcyBmcm9tIHdpcGh5ICovCitzdGF0aWMgaW50IGNyZWF0ZV9saW51eF9yZWd1bGF0b3J5X2VudHJ5KHN0cnVjdCB3aXBoeSAqd2lwaHksCisgICAgICAgICAgICAgICAgc3RydWN0IHJlZ3VsYXRvcnlfcmVxdWVzdCAqcmVxdWVzdCwKKyAgICAgICAgICAgICAgICB2X1U4X3QgbkJhbmRDYXBhYmlsaXR5KQoreworICAgIHZfQ09OVEVYVF90IHBWb3NDb250ZXh0ID0gTlVMTDsKKyAgICBoZGRfY29udGV4dF90ICpwSGRkQ3R4ID0gTlVMTDsKKworICAgIHBWb3NDb250ZXh0ID0gdm9zX2dldF9nbG9iYWxfY29udGV4dChWT1NfTU9EVUxFX0lEX1NZUywgTlVMTCk7CisKKyAgICBpZiAoTlVMTCAhPSBwVm9zQ29udGV4dCkKKyAgICB7CisgICAgICAgIHBIZGRDdHggPSB2b3NfZ2V0X2NvbnRleHQoVk9TX01PRFVMRV9JRF9IREQsIHBWb3NDb250ZXh0KTsKKyAgICAgICAgaWYgKE5VTEwgPT0gcEhkZEN0eCkKKyAgICAgICAgeworICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAg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TF9WRVJTSU9OKDMsOSwwKSkKKyAgICAgICByZXR1cm47CisjZWxzZQorICAgICAgIHJldHVybiAwOworI2VuZGlmCisgICAgfQorCisgICAgaWYgKHZvc19pc19sb2dwX2luX3Byb2dyZXNzKFZPU19NT0RVTEVfSURfVk9TUywgTlVMTCkpCisgICAgeworICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAoIlNTUiBpcyBpbiBwcm9ncmVzcyIpICk7CisgICAgICAgZ290byBkb19jb21wOworICAgIH0KKworICAgIGlmIChXTEFOX0hERF9JU19VTkxPQURfSU5fUFJPR1JFU1MocEhkZEN0eCkpCisgICAgeworICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgKCIlcyBVbmxvYWQgaXMgaW4gcHJvZ3Jlc3MiKSwgX19mdW5jX18gKTsKKyAgICAgICBnb3RvIGRvX2NvbXA7CisgICAgfQorCisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgKCIlczogUmVxIGluaXRpYXRvciAlZCBDQz0lYyVjIiksIF9fZnVuY19fLAorICAgICAgICAgICAgICAgcmVxdWVzdC0+aW5pdGlhdG9yLCByZXF1ZXN0LT5hbHBoYTJbMF0sIHJlcXVlc3QtPmFscGhhMlsxXSk7CisKKyAgICBzbWVfR2V0RnJlcUJhbmQocEhkZEN0eC0+aEhhbCwgJm5CYW5kQ2FwYWJpbGl0eSk7CisgICAgLyogZmlyc3QgY2hlY2sgaWYgdGhpcyBjYWxsYmFjayBpcyBpbiByZXNwb25zZSB0byB0aGUgZHJpdmVyIGNhbGxiYWNrICovCisKKyAgICBpZiAocmVxdWVzdC0+aW5pdGlhdG9yID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gICAgICAgICovCisgICAgICAgIGxpbnV4X3JlZ19jY1swXSA9IHJlcXVlc3QtPmFscGhhMlswXTsKKyAgICAgICAgbGludXhfcmVnX2NjWzFdID0gcmVxdWVzdC0+YWxwaGEyWzFdOworICAgICAgICAvKiBmaXJzdCBsb29rdXAgdGhlIGNvdW50cnkgaW4gdGhlIGxvY2FsIGRhdGFiYXNlICovCisKKyAgICAgICAgaWYgKCEocG52RUZTVGFibGUtPmhhbG52LnRhYmxlcy5kZWZhdWx0Q291bnRyeVRhYmxlLmNvdW50cnlDb2RlWzBdID09ICcwJyAmJgorICAgICAgICAgICAgIHBudkVGU1RhYmxlLT5oYWxudi50YWJsZXMuZGVmYXVsdENvdW50cnlUYWJsZS5jb3VudHJ5Q29kZVsxXSA9PSAnMCcpICYmCisgICAgICAgICAgICAodm9zX2lzX2xvYWRfdW5sb2FkX2luX3Byb2dyZXNzKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIE5VTEwpKSkKKyAgICAgICAgeworICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAoIiBEZWZhdWx0IENvdW50cnkgaW4gbnYgaXMgbm9uIFplcm8gIGFuZCBEcml2ZXIgbG9hZC91bmxvYWQiCisgICAgICAgICAgICAgICAgICAgICAgICJpcyBpbiBwcm9ncmVzczsgYXZvaWQgdXBkYXRpbmcgY291bnRyeSBmcm9tIGtlcm5lbFxuIikpOworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMyw5LDApKQorICAgICAgICAgICByZXR1cm47CisjZWxzZQorICAgICAgICAgICByZXR1cm4gMDsKKyNlbmRpZgorICAgICAgICB9CisKKyAgICAgICAgY291bnRyeV9jb2RlWzBdID0gcmVxdWVzdC0+YWxwaGEyWzBdOworICAgICAgICBjb3VudHJ5X2NvZGVbMV0gPSByZXF1ZXN0LT5hbHBoYTJbMV07CisKKyAgICAgICAgdGVtcF9yZWdfZG9tYWluID0gUkVHRE9NQUlOX0NPVU5UOworICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY291bnRyeUluZm9UYWJsZS5jb3VudHJ5Q291bnQgJiYKKyAgICAgICAgICAgICAgICAgUkVHRE9NQUlOX0NPVU5UID09IHRlbXBfcmVnX2RvbWFpbjsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAobWVtY21wKGNvdW50cnlfY29kZSwgY291bnRyeUluZm9UYWJsZS5jb3VudHJ5SW5mb1tpXS5jb3VudHJ5Q29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgVk9TX0NPVU5UUllfQ09ERV9MRU4pID09IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogY291bnRyeSBjb2RlIGlzIGZvdW5kICovCisgICAgICAgICAgICAgICAgLyogcmVjb3JkIHRoZSB0ZW1wb3JhcnkgcmVndWxhdG9yeV9kb21haW4gYXMgd2VsbCAqLworICAgICAgICAgICAgICAgIHRlbXBfcmVnX2RvbWFpbiA9IGNvdW50cnlJbmZvVGFibGUuY291bnRyeUluZm9baV0ucmVnRG9tYWluOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgIChSRUdET01BSU5fQ09VTlQgPT0gdGVtcF9yZWdfZG9tYWluKQorICAgICAgICAgICAgdGVtcF9yZWdfZG9tYWluID0gUkVHRE9NQUlOX1dPUkxEOworCisgICAgICAgIGlzVkhUODBBbGxvd2VkID0gcEhkZEN0eC0+aXNWSFQ4MEFsbG93ZWQ7CisgICAgICAgIGlmIChjcmVhdGVfbGludXhfcmVndWxhdG9yeV9lbnRyeSh3aXBoeSwgcmVxdWVzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5CYW5kQ2FwYWJpbGl0eSkgPT0gMCkKKyAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgKCIgcmVndWxhdG9yeSBlbnRyeSBjcmVhdGVkIikpOworCisgICAgICAgIH0KKyAgICAgICAgaWYgKHBIZGRDdHgtPmlzVkhUODBBbGxvd2VkICE9IGlzVkhUODBBbGxvd2VkKQorICAgICAgICB7CisgICAgICAgICAgIGhkZF9jaGVja2FuZHVwZGF0ZV9waHltb2RlKCBwSGRkQ3R4KTsKKyAgICAgICAgfQorCisgICAgICAgIGN1cl9yZWdfZG9tYWluID0gdGVtcF9yZWdfZG9tYWluOworCisgICAgICAgIC8qIG5vdyBwYXNzIHRoZSBuZXcgY291bnRyeSBpbmZvcm1hdGlvbiB0byBzbWUgKi8KKyAgICAgICAgaWYgKHJlcXVlc3QtPmFscGhhMlswXSA9PSAnMCcgJiYgcmVxdWVzdC0+YWxwaGEyWzFdID09ICcwJykKKyAgICAgICAgeworICAgICAgICAgICBzbWVfR2VuZXJpY0NoYW5nZUNvdW50cnlDb2RlKHBIZGRDdHgtPmhIYWwsIGNvdW50cnlfY29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSRUdET01BSU5fQ09VTlQpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICBzbWVfR2VuZXJpY0NoYW5nZUNvdW50cnlDb2RlKHBIZGRDdHgtPmhIYWwsIGNvdW50cnlfY29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wX3JlZ19kb21haW4pOworICAgICAgICB9CisKKyAgICB9CisKKyAgICAvKiBNYXJrIGNoYW5uZWxzIDM2LTQ4IGFzIHBhc3NpdmUgZm9yIFVTIENDICovCisKKyAgICBpZiAocmVxdWVzdC0+aW5pdGlhdG9yID09IE5MODAyMTFfUkVHRE9NX1NFVF9CWV9EUklWRVI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09PSdTJykgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+bkVuYWJsZVN0cmljdFJlZ3VsYXRvcnlGb3JGQ0MpKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgd2lwaHktPmJhbmRzW0lFRUU4MDIxMV9CQU5EXzVHSFpdLT5jaGFubmVsc1tqXS5mbGFncyB8PSBJRUVFODAyMTFfQ0hBTl9QQVNTSVZFX1NDQU47CisgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgICB9CisgICAgfQorZG9fY29tcDoKKyAgICBpZiAoKHJlcXVlc3QtPmluaXRpYXRvciA9PSBOTDgwMjExX1JFR0RPTV9TRVRfQllfRFJJVkVSKSB8fAorICAgICAgICAgKHJlcXVlc3QtPmluaXRpYXRvciA9PSBOTDgwMjExX1JFR0RPTV9TRVRfQllfVVNFUikpCisgICAgeworICAgICAgICBjb21wbGV0ZSgmcEhkZEN0eC0+bGludXhfcmVnX3JlcSk7CisgICAgfQorI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMyw5LDApKQorICAgIHJldHVybjsKKyNlbHNlCisgICAgcmV0dXJuIDA7CisjZW5kaWYKK30KKworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMyw5LDApKQordm9pZCB3bGFuX2hkZF9saW51eF9yZWdfbm90aWZpZXIoc3RydWN0IHdpcGh5ICp3aXBoeSwKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgcmVndWxhdG9yeV9yZXF1ZXN0ICpyZXF1ZXN0KQoreworICAgIHZvc19zc3JfcHJvdGVjdChfX2Z1bmNfXyk7CisgICAgX193bGFuX2hkZF9saW51eF9yZWdfbm90aWZpZXIod2lwaHksIHJlcXVlc3QpOworICAgIHZvc19zc3JfdW5wcm90ZWN0KF9fZnVuY19fKTsKKyAgICByZXR1cm47Cit9CisjZWxzZQoraW50IHdsY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b3VudHJ5VGFibGUucmVnRG9tYWluOworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMywxNCwwKSkKKyAgICAgICAgd2lwaHktPnJlZ3VsYXRvcnlfZmxhZ3MgfD0gUkVHVUxBVE9SWV9TVFJJQ1RfUkVHOworI2Vsc2UKKyAgICAgICAgd2lwaHktPmZsYWdzIHw9IFdJUEhZX0ZMQUdfU1RSSUNUX1JFR1VMQVRPUlk7CisjZW5kaWYKKyAgICB9CisKKyAgICB0ZW1wX3JlZ19kb21haW4gPSBjdXJfcmVnX2RvbWFpbiA9IHJlZ19kb21haW47CisKKyAgICBtID0gMDsKKyAgICBmb3IgKGkgPSAwOyBpIDwgSUVFRTgwMjExX05VTV9CQU5EUzsgaSsrKQorICAgIHsKKworICAgICAgICBpZiAod2lwaHktPmJhbmRzW2ldID09IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9CisKKyAgICAgICAgLyogaW50ZXJuYWwgY2hhbm5lbHNbXSBpcyBvbmUgY29udGlub3VzIGFycmF5IGZvciBib3RoIDJHIGFuZCA1RyBiYW5kcworICAgICAgICAgICBtIGlzIGludGVybmFsIHN0YXJ0aW5nIGNoYW5uZWwgaW5kZXggZm9yIGVhY2ggYmFuZCAqLworCisgICAgICAgIGZvciAoaiA9IDA7IGogPCB3aXBoeS0+YmFuZHNbaV0tPm5fY2hhbm5lbHM7IGorKykKKyAgICAgICAgeworICAgICAgICAgICAgLyogayA9IChtICsgaikgaXMgaW50ZXJuYWwgY3VycmVudCBjaGFubmVsIGluZGV4ICovCisgICAgICAgICAgICBrID0gbSArIGo7CisKKyAgICAgICAgICAgIGlmIChwbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnJlZ0RvbWFpbnNbcmVnX2RvbWFpbl0uY2hhbm5lbHNba10uZW5hYmxlZCA9PQorICAgICAgICAgICAgICAgIE5WX0NIQU5ORUxfRElTQUJMRSkKKyAgICAgICAgICAgICAgICB3aXBoeS0+YmFuZHNbaV0tPmNoYW5uZWxzW2pdLmZsYWdzIHw9IElFRUU4MDIxMV9DSEFOX0RJU0FCTEVEOworCisgICAgICAgICAgICBlbHNlIGlmIChwbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnJlZ0RvbWFpbnNbcmVnX2RvbWFpbl0uY2hhbm5lbHNba10uZW5hYmxlZCA9PQorICAgICAgICAgICAgICAgICAgICAgTlZfQ0hBTk5FTF9ERlMpIHsKKworICAgICAgICAgICAgICAgIHdpcGh5LT5iYW5kc1tpXS0+Y2hhbm5lbHNbal0uZmxhZ3MgfD0gSUVFRTgwMjExX0NIQU5fUEFTU0lWRV9TQ0FOOworCisgICAgICAgICAgICAgICAgd2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5tYXhfcG93ZXIgPQorICAgICAgICAgICAgICAgICAgICAocG52RUZTVGFibGUtPmhhbG52LnRhYmxlcy5yZWdEb21haW5zW3JlZ19kb21haW5dLmNoYW5uZWxzW2tdLnB3ckxpbWl0KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZWxzZSBpZiAocG52RUZTVGFibGUtPmhhbG52LnRhYmxlcy5yZWdEb21haW5zW3JlZ19kb21haW5dLmNoYW5uZWxzW2tdLmVuYWJsZWQgPT0KKyAgICAgICAgICAgICAgICAgICAgIE5WX0NIQU5ORUxfRU5BQkxFKSB7CisKKyAgICAgICAgICAgICAgICB3aXBoeS0+YmFuZHNbaV0tPmNoYW5uZWxzW2pdLm1heF9wb3dlciA9CisgICAgICAgICAgICAgICAgICAgIChwbnZFRlNUYWJsZS0+aGFsbnYudGFibGVzLnJlZ0RvbWFpbnNbcmVnX2RvbWFpbl0uY2hhbm5lbHNba10ucHdyTGltaXQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKwltICs9IHdpcGh5LT5iYW5kc1tpXS0+bl9jaGFubmVsczsKKyAgICB9CisKKyAgICByZXR1cm4gVk9TX1NUQ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AgICAgICAgY291bnRyeUNvZGVbMF0sIGNvdW50cnlDb2RlWzFdKTsKKworICAgaWYgKGNyZGFfcmVndWxhdG9yeV9lbnRyeV92YWxpZCA9PSBWT1NfVFJVRSkKKyAgIHsKKyAgICAgICBpZiAoY3JkYV9hbHBoYTJbMF09PWNvdW50cnlDb2RlWzBdICYmIGNyZGFfYWxwaGEyWzFdPT1jb3VudHJ5Q29kZVsxXSkKKyAgICAgICB7CisgICAgICAgICAgKnBSZWdEb21haW4gPSBOVU1fUkVHX0RPTUFJTlMtMTsKKyAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0lORk9fSElHSCwKKyAgICAgICAgICAgICAgInZvc19udl9nZXRSZWdEb21haW5Gcm9tQ291bnRyeUNvZGUgcmV0dXJuIGNyZGEgaW5pdCBlbnRyeSIpOworICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgfQorICAgICAgIGlmIChydW5fdGltZV9hbHBoYTJbMF09PWNvdW50cnlDb2RlWzBdICYmCisgICAgICAgICAgIHJ1bl90aW1lX2FscGhhMlsxXT09Y291bnRyeUNvZGVbMV0gJiYKKyAgICAgICAgICAgY3JkYV9yZWd1bGF0b3J5X3J1bl90aW1lX2VudHJ5X3ZhbGlkID09IFZPU19UUlVFKQorICAgICAgIHsKKyAgICAgICAgICAqcFJlZ0RvbWFpbiA9IE5VTV9SRUdfRE9NQUlOUy0yOworICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAidm9zX252X2dldFJlZ0RvbWFpbkZyb21Db3VudHJ5Q29kZSByZXR1cm4gY3JkYSBub25lLWRlZmF1bHQgY291bnRyeSBlbnRyeSIpOworICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgIH0KKyAgICAgICBlbHNlCisgICAgICAgeworICAgICAgICAgICBjcmRhX3JlZ3VsYXRvcnlfcnVuX3RpbWVfZW50cnlfdmFsaWQgPSBWT1NfRkFMU0U7CisgICAgICAgICAgIHBWb3NDb250ZXh0ID0gdm9zX2dldF9nbG9iYWxfY29udGV4dChWT1NfTU9EVUxFX0lEX1NZUywgTlVMTCk7CisgICAgICAgICAgIGlmIChOVUxMICE9IHBWb3NDb250ZXh0KQorICAgICAgICAgICAgICAgcEhkZEN0eCA9IHZvc19nZXRfY29udGV4dChWT1NfTU9EVUxFX0lEX0hERCwgcFZvc0NvbnRleHQpOworICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0VYSVNUUzsKKyAgICAgICAgICAgaWYgKE5VTEwgPT0gcEhkZEN0eCkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAoIkludmFsaWQgcEhkZEN0eCBwb2ludGVyIikgKTsKKyAgICAgICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICAgICAgICAgfQorCisgICAgICAgICAgIHdpcGh5ID0gcEhkZEN0eC0+d2lwaHk7CisKKyAgICAgICAgICAgSU5JVF9DT01QTEVUSU9OKHBIZGRDdHgtPmRyaXZlcl9jcmRhX3JlcSk7CisgICAgICAgICAgIHJlZ3VsYXRvcnlfaGludCh3aXBoeSwgY291bnRyeUNvZGUpOworICAgICAgICAgICBzdGF0dXMgPSB3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGVfdGltZW91dCgKKyAgICAgICAgICAgICAgICAgICAmcEhkZEN0eC0+ZHJpdmVyX2NyZGFfcmVxLAorICAgICAgICAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoQ1JEQV9XQUlUX1RJTUUpKTsKKyAgICAgICAgICAgaWYgKCFzdGF0dXMpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBUaW1lb3V0IHdhaXRpbmcgZm9yIENSREEgUkVRIiwgX19mdW5jX18pOworICAgICAgICAgICB9CisKKyAgICAgICAgICAgaWYgKGNyZGFfcmVndWxhdG9yeV9ydW5fdGltZV9lbnRyeV92YWxpZCA9PSBWT1NfVFJVRSkKKyAgICAgICAgICAgeworICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAidm9zX252X2dldFJlZ0RvbWFpbkZyb21Db3VudHJ5Q29kZSByZXR1cm4gY3JkYSBuZXcgbm9uZS1kZWZhdWx0IGNvdW50cnkgZW50cnkiKTsKKyAgICAgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAidm9zX252X2dldFJlZ0RvbWFpbkZyb21Db3VudHJ5Q29kZSBmYWlsZWQgdG8gZ2V0IGNyZGEgbmV3IG5vbmUtZGVmYXVsdCBjb3VudHJ5IGVudHJ5Iik7CisgICAgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRVhJU1RTOworICAgICAgIH0KKyAgIH0KKworICAgLy8gaXRlcmF0ZSB0aGUgY291bnRyeSBpbmZvIHRhYmxlIHVudGlsIGVuZCBvZiB0YWJsZSBvciB0aGUgY291bnRyeSBjb2RlCisgICAvLyBpcyBmb3VuZAorICAgZm9yIChpID0gMDsgaSA8IGNvdW50cnlJbmZvVGFibGUuY291bnRyeUNvdW50ICYmCisgICAgICAgICBSRUdET01BSU5fQ09VTlQgPT0gKnBSZWdEb21haW47IGkrKykKKyAgIHsKKyAgICAgIGlmIChtZW1jbXAoY291bnRyeUNvZGUsIGNvdW50cnlJbmZvVGFibGUuY291bnRyeUluZm9baV0uY291bnRyeUNvZGUsCisgICAgICAgICAgICAgICBWT1NfQ09VTlRSWV9DT0RFX0xFTikgPT0gMCkKKyAgICAgIHsKKyAgICAgICAgIC8vIGNvdW50cnkgY29kZSBpcyBmb3VuZAorICAgICAgICAgKnBSZWdEb21haW4gPSBjb3VudHJ5SW5mb1RhYmxlLmNvdW50cnlJbmZvW2ldLnJlZ0RvbWFpbjsKKyAgICAgIH0KKyAgIH0KKyAgIGlmIChSRUdET01BSU5fQ09VTlQgIT0gKnBSZWdEb21haW4pCisgICB7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworICAgfQorICAgZWxzZQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgKCJjb3VudHJ5IGNvZGUgaXMgbm90IGZvdW5kIikpOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9FWElTVFM7CisgICB9Cit9CisvKiBGVU5DVElPTjogdm9zX252X2NoYW5nZV9jb3VudHJ5X2NvZGVfY2IKKyogIHRvIHdhaXQgZm9yIGNvbnRyeSBjb2RlIGNvbXBsZXRpb24KKyovCit2b2lkKiB2b3NfbnZfY2hhbmdlX2NvdW50cnlfY29kZV9jYih2b2lkICpwQWRhcHRlcikKK3sKKyAgIHN0cnVjdCBjb21wbGV0aW9uICpjaGFuZ2VfY29kZV9jbmcgPSBwQWRhcHRlcjsKKyAgIGNvbXBsZXRlKGNoYW5nZV9jb2RlX2NuZyk7CisgICByZXR1cm4gTlVMTDsKK30KKworLyoKKyAqIEZ1bmN0aW9uO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AgICAgICogYWNjb3JkaW5nIHRvIHJlZyBkb21haW4gc2V0IGJ5IHVzZXIgYmVmb3JlIHJldHVybmluZyB0byBubDgwMjExIHNvCisgICAgICAgKiB0aGF0IGhvc3RhcGQgd2lsbCBnZXRzIHRoZSB1cGRhdGVkIGNoYW5uZWxzLgorICAgICAgICogVGhlIGFyZ3VtZW50IHNlbmRSZWdIaW50IGluIHNtZV9DaGFuZ2VDb3VudHJ5Q29kZSBpcworICAgICAgICogc2V0IHRvIGVTSVJfRkFMU0UgKGhpbnQgaXMgZnJvbSBubDgwMjExIGFuZCB0aHVzCisgICAgICAgKiBubyBuZWVkIHRvIG5vdGlmeSBubDgwMjExIGJhY2spKi8KKyAgICAgICBzdGF0dXMgPSBzbWVfQ2hhbmdlQ291bnRyeUNvZGUocEhkZEN0eC0+aEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKikodFNtZUNoYW5nZUNvdW50cnlDYWxsYmFjaykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX252X2NoYW5nZV9jb3VudHJ5X2NvZGVfY2IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNjb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmY2hhbmdlX2NvdW50cnlfY29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+cHZvc0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfRkFMU0UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVTSVJfRkFMU0UpOworICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTID09IHN0YXR1cykKKyAgICAgICB7CisgICAgICAgICAgc3RhdHVzID0gd2FpdF9mb3JfY29tcGxldGlvbl9pbnRlcnJ1cHRpYmxlX3RpbWVvdXQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmY2hhbmdlX2NvdW50cnlfY29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZWNzX3RvX2ppZmZpZXMoV0xBTl9XQUlUX1RJTUVfQ09VTlRSWSkpOworICAgICAgICAgIGlmKHN0YXR1cyA8PSAwKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICB3aXBoeV9kYmcod2lwaHksICJpbmZvOiBzZXQgY291bnRyeSB0aW1lZCBvdXRcbiIpOworICAgICAgICAgIH0KKyAgICAgICB9CisgICAgICAgZWxzZQorICAgICAgIHsKKyAgICAgICAgICB3aXBoeV9kYmcod2lwaHksICJpbmZvOiB1bmFibGUgdG8gc2V0IGNvdW50cnkgYnkgdXNlclxuIik7CisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDksMCkpCisgICAgICAgICAgcmV0dXJuOworI2Vsc2UKKyAgICAgICAgICByZXR1cm4gMDsKKyNlbmRpZgorICAgICAgIH0KKyAgICAgICAvLyBUb0RvCisgICAgICAgLyogRG9uJ3QgY2hhbmdlIGRlZmF1bHQgY291bnRyeSBjb2RlIHRvIENSREEgY291bnRyeSBjb2RlIGJ5IHVzZXIgcmVxICovCisgICAgICAgLyogU2hvdWxkY2FsbCBzbWVfQ2hhbmdlQ291bnRyeUNvZGUgdG8gc2VuZCBhIG1lc3NhZ2UgdG8gdHJpZ2dlciByZWFkCisgICAgICAgICAgcmVnZCBmb3IgbmV3IGNvdW50cnkgc2V0dGluZ3MgKi8KKyAgICAgICAvL3NtZV9DaGFuZ2VDb3VudHJ5Q29kZShwSGRkQ3R4LT5oSGFsLCBOVUxMLAorICAgICAgIC8vICAgICZjb3VudHJ5X2NvZGVbMF0sIHBBZGFwdGVyLCBwSGRkQ3R4LT5wdm9zQ29udGV4dCk7CisgICAgfQorICAgIHNtZV9HZXRGcmVxQmFuZChwSGRkQ3R4LT5oSGFsLCAmbkJhbmRDYXBh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DIxMV9SRUdET01fU0VUX0JZX0NPUkUpfHwKKyAgICAgICAgICAgICAgICAocmVxdWVzdC0+aW5pdGlhdG9yID09IE5MODAyMTFfUkVHRE9NX1NFVF9CWV9VU0VSKSkKKyAgICB7CisgICAgICAgICBpZiAoIGVIQUxfU1RBVFVTX1NVQ0NFU1MgIT0gIHNtZV9HZXRDb3VudHJ5Q29kZShwSGRkQ3R4LT5oSGFsLCBjY29kZSwgJnVCdWZMZW4pKQorICAgICAgICAgeworICAgICAgICAgICAgd2lwaHlfZGJnKHdpcGh5LCAiaW5mbzogc2V0IGJ5IGRyaXZlciBDQ09ERSBFUlJPUlxuIik7CisjaWYgKExJTlVYX1ZFUlNJT05fQ09ERSA+PSBLRVJORUxfVkVSU0lPTigzLDksMCkpCisgICAgICAgICAgICByZXR1cm47CisjZWxzZQorICAgICAgICAgICAgcmV0dXJuIDA7CisjZW5kaWYKKyAgICAgICAgIH0KKyAgICAgICAgIGlmIChlSEFMX1NUQVRVU19TVUNDRVNTICE9IHNtZV9HZXRSZWd1bGF0b3J5RG9tYWluRm9yQ291bnRyeSAocEhkZEN0eC0+aEhhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNjb2RlLCAodl9SRUdET01BSU5fdCAqKSAmZG9tYWluSWRDdXJyZW50KSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHdpcGh5X2RiZyh3aXBoeSwgImluZm86IHNldCBieSBkcml2ZXIgRVJST1JcbiIpOworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPj0gS0VSTkVMX1ZFUlNJT04oMyw5LDApKQorICAgICAgICAgICAgcmV0dXJuOworI2Vsc2UKKyAgICAgICAgICAgIHJldHVybiAwOworI2VuZGlmCisgICAgICAgICB9CisKKyAgICAgICAgIHdpcGh5X2RiZyh3aXBoeSwgImNvdW50cnk6ICVjJWMgc2V0IGJ5IGRyaXZlclxuIixjY29kZVswXSxjY29kZVsxXSk7CisgICAgICAgICBmb3IgKG4gPSAwOyBuIDwgTUFYX0NPVU5UUllfSUdOT1JFOyBuKyspCisgICAgICAgICB7CisgICAgICAgICAgICAgaWYgKHZvc19tZW1fY29tcGFyZShjY29kZSwgY291bnRyeUlnbm9yZUxpc3Rbbl0uY291bnRyeUNvZGUsIFZPU19DT1VOVFJZX0NPREVfTEVOKSkKKyAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIGNvdW50cnlJbmRleCA9IG47CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgICAgIC8qIGlmIHNldCBieSBkcml2ZXIgaXRzZWxmLCBpdCBtZWFucyBkcml2ZXIgY2FuIGFjY2VwdCB0aGUgY3JkYQorICAgICAgICAgICAgcmVndWxhdG9yeSBzZXR0aW5ncyBhbmQgd2lwaHktPnJlZ2Qgc2hvdWxkIGJlIHBvcHVsYXRlZCB3aXRoIGNyZGEKKyAgICAgICAgICAgIHNldHRpbmdzLiBpd2lwaHktPmJhbmRzIGRvZXNuJ3Qgc2VlbSB0byBzZXQgaHQ0MCBmbGFncyBpbiBrZXJuZWwKKyAgICAgICAgICAgIGNvcnJlY3RseSwgdGhpcyBtYXkgYmUgZml4ZWQgYnkgbGF0ZXIga2VybmVsICovCisKKyAgICAgICAgIGZvciAoaSA9IDAsIG0gPSAwOyBpIDwgSUVFRTgwMjExX05VTV9CQU5EUzsgaSsrKQorICAgICAgICAgeworICAgICAgICAgICAgIGlmIChOVUxMID09IHdpcGh5LT5iYW5kc1tpXSkKKyAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgImVycm9yOiB3aXBoeS0+YmFuZHNbaV0gaXMgTlVMTCwgaSA9ICVkIiwgaSk7CisgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgIC8vIGludGVybmFsIGNoYW5uZWxzW10gaXMgb25lIGNvbnRpbm91cyBhcnJheSBmb3IgYm90aCAyRyBhbmQgNUcgYmFuZHMKKyAgICAgICAgICAgICAvLyBtIGlzIGludGVybmFsIHN0YXJ0aW5nIGNoYW5uZWwgaW5kZXggZm9yIGVhY2ggYmFuZAorICAgICAgICAgICAgIGlmICgwID09IGkpCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBtID0gMDsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgbSA9IHdpcGh5LT5iYW5kc1tpLTFdP3dpcGh5LT5iYW5kc1tpLTFdLT5uX2NoYW5uZWxzICsgbTptOworICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgIGZvciAoaj0wOyBqPHdpcGh5LT5iYW5kc1tpXS0+bl9jaGFubmVsczsgaisrKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgLy8gayA9IChtICsgaikgaXMgaW50ZXJuYWwgY3VycmVudCBjaGFubmVsIGluZGV4IGZvciAyME1IeiBjaGFubmVsCisgICAgICAgICAgICAgICAgIC8vIG4gaXMgaW50ZXJuYWwgY2hhbm5lbCBpbmRleCBmb3IgY29ycmVzcG9uZGluZyA0ME1IeiBjaGFubmVsCisgICAgICAgICAgICAgICAgIGsgPSBtICsgajsKKyAgICAgICAgICAgICAgICAgaWYgKElFRUU4MDIxMV9CQU5EXzJHSFogPT0gaSAmJiBlQ1NSX0JBTkRfNUcgPT0gbkJhbmRDYXBhYmlsaXR5KSAvLyA1RyBvbmx5CisgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgIC8vIEVuYWJsZSBzb2NpYWwgY2hhbm5lbHMgZm9yIFAyUAorICAgICAgICAgICAgICAgICAgICAgaWYgKCgyNDEyID09IHdpcGh5LT5iYW5kc1tpXS0+Y2hhbm5lbHNbal0uY2VudGVyX2ZyZXEgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgMjQzNyA9PSB3aXBoeS0+YmFuZHNbaV0tPmNoYW5uZWxzW2pdLmNlbnRlcl9mcmVxIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgIDI0NjIgPT0gd2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5jZW50ZXJfZnJlcSApICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgTlZfQ0hBTk5FTF9FTkFCTEUgPT0gcmVnQ2hhbm5lbHNba10uZW5hYmxlZCkKKyAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICB3aXBoeS0+YmFuZHNbaV0tPmNoYW5uZWxzW2pdLmZsYWdzICY9IH5JRUVFODAyMTFfQ0hBTl9ESVNBQkxFRDsKKyAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICB3aXBoeS0+YmFuZHNbaV0tPmNoYW5uZWxzW2pdLmZsYWdzIHw9IElFRUU4MDIxMV9DSEFOX0RJU0FCTEVEOworICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgZWxzZSBpZiAoSUVFRTgwMjExX0JBTkRfNUdIWiA9PSBpICYmIGVDU1JfQkFORF8yNCA9PSBuQmFuZENhcGFiaWxpdHkpIC8vIDJHIG9ubHkKKyAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgd2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5mbGFncyB8PSBJRUVFODAyMTFfQ0hBTl9ESVNBQkxFRDsKKyAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgaWYgKE5WX0NIQU5ORUxfRElTQUJMRSA9PSByZWdDaGFubmVsc1trXS5lbmFibGVkIHx8CisgICAgICAgICAgICAgICAgICAgICBOVl9DSEFOTkVMX0lOVkFMSUQgPT0gcmVnQ2hhbm5lbHNba10uZW5hYmxlZCkKKyAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgd2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5mbGFncyB8PSBJRUVFODAyMTFfQ0hBTl9ESVNBQkxFRDsKKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICBlbHNlIGlmIChOVl9DSEFOTkVMX0RGUyA9PSByZWdDaGFubmVsc1trXS5lbmFibGVkKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICB3aXBoeS0+YmFuZHNbaV0tPmNoYW5uZWxzW2pdLmZsYWdzICY9IH4oSUVFRTgwMjExX0NIQU5fRElTQUJMRUQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8SUVFRTgwMjExX0NIQU5fUkFEQVIpOworICAgICAgICAgICAgICAgICAgICAgd2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5mbGFncyB8PSBJRUVFODAyMTFfQ0hBTl9QQVNTSVZFX1NDQU47CisgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICB3aXBoeS0+YmFuZHNbaV0tPmNoYW5uZWxzW2pdLmZsYWdzICY9IH4oSUVFRTgwMjExX0NIQU5fRElTQUJMRUQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8SUVFRTgwMjExX0NIQU5fUEFTU0lWRV9TQ0FOCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfElFRUU4MDIxMV9DSEFOX05PX0lCU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8SUVFRTgwMjExX0NIQU5fUkFEQVIpOworICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgaWYgKGNvdW50cnlJbmRleCAhPSAtMSkKKyAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgZm9yIChuID0gMDsgbiA8IE1BWF9DSEFOTkVMU19JR05PUkU7IG4rKykKKyAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMTZfdCBmcmVxID0gdm9zX2NoYW5fdG9fZnJlcShjb3VudHJ5SWdub3JlTGlzdFtjb3VudHJ5SW5kZXhdLmNoYW5uZWxMaXN0W25dKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHdpcGh5LT5iYW5kc1tpXS0+Y2hhbm5lbHNbal0uY2VudGVyX2ZyZXEgPT0gZnJlcSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lwaHktPmJhbmRzW2ldLT5jaGFubmVsc1tqXS5mbGFncyAgJj0gfihJRUVFODAyMTFfQ0hBTl9ESVNBQkxFRAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxJRUVFODAyMTFfQ0hBTl9QQVNTSVZFX1NDQU4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8SUVFRTgwMjExX0NIQU5fTk9fSUJTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxJRUVFODAyMTFfQ0hBTl9SQURBUik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXBoeS0+YmFuZHNbaV0tPmNoYW5uZWxzW2pdLmZsYWdzIHw9IElFRUU4MDIxMV9DSEFOX0RJU0FCTEVEOworICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKworICAgICAgICAgLyogSGF2ZW4ndCBzZWVuIGFueSBjb25kaXRpb24gdGhhdCB3aWxsIHNldCBieSBkcml2ZXIgYWZ0ZXIgaW5pdC4KKyAgICAgICAgICAgIElmIHdlIGRvLCB0aGVuIHdlIHNob3VsZCBhbHNvIGNhbGwgc21lX0NoYW5nZUNvdW50cnlDb2RlICovCisKKyAgICAgICAgIC8qIFRvIERpc2FibGUgdGhlIHN0cmljdCByZWd1bGF0b3J5IEZDQyBydWxlLCBuZWVkIHNldAorICAgICAgICAgICAgZ0VuYWJsZVN0cmljdFJlZ3VsYXRvcnlGb3JGQ0MgdG8gemVybyBmcm9tIElOSS4KKyAgICAgICAgICAgIEJ5IGRlZmF1bHQgcmVndWxhdG9yeSBGQ0MgcnVsZSBlbmFibGUgb3Igc2V0IHRvIDEsIGFuZAorICAgICAgICAgICAgaW4gdGhpcyBjYXNlIG9uZSBjYW4gY29udHJvbCBkeW5hbWljYWxseSB1c2luZyBJT0NUTAorICAgICAgICAgICAgKG5FbmFibGVTdHJpY3RSZWd1bGF0b3J5Rm9yRkNDKS4KKyAgICAgICAgICAgIElmIGdFbmFibGVTdHJpY3RSZWd1bGF0b3J5Rm9yRkNDIGlzIHNldCB0byB6ZXJvIHRoZW4KKyAgICAgICAgICAgIElPQ1RMIG9wZXJhdGlvbiBpcyBpbmFjdGl2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisKKyAgICAgICAgIGlmICggcEhkZEN0eC0+Y2ZnX2luaS0+Z0VuYWJsZVN0cmljdFJlZ3VsYXRvcnlGb3JGQ0MgJiYKKyAgICAgICAgICAgICAgd2lwaHktPmJhbmRzW0lFRUU4MDIxMV9CQU5EXzVHSFpdKQorICAgICAgICAgeworICAgICAgICAgICAgIGZvciAoaj0wOyBqPHdpcGh5LT5iYW5kc1tJRUVFODAyMTFfQkFORF81R0haXS0+bl9jaGFubmVsczsgaisrKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgLy8gVU5JSS0xIGJhbmQgY2hhbm5lbHMgYXJlIHBhc3NpdmUgd2hlbiBkb21haW4gaXMgRkNDLgorICAgICAgICAgICAgICAgICBpZiAoKHdpcGh5LT5iYW5kc1tJRUVFODAyMTFfQkFORF81R0haIF0tPmNoYW5uZWxzW2pdLmNlbnRlcl9mcmVxID09IDUxODAgfHwKKyAgICAgICAgICAgICAgICAgICAgICB3aXBoeS0+YmFuZHNbSUVFRTgwMjExX0JBTkRfNUdIWl0tPmNoYW5uZWxzW2pdLmNlbnRlcl9mcmVxID09IDUyMDAgfHwKKyAgICAgICAgICAgICAgICAgICAgICB3aXBoeS0+YmFuZHNbSUVFRTgwMjExX0JBTkRfNUdIWl0tPmNoYW5uZWxzW2pdLmNlbnRlcl9mcmVxID09IDUyMjAgfHwKKyAgICAgICAgICAgICAgICAgICAgICB3aXBoeS0+YmFuZHNbSUVFRTgwMjExX0JBTkRfNUdIWl0tPmNoYW5uZWxzW2pdLmNlbnRlcl9mcmVxID09IDUyNDApICYmCisgICAgICAgICAgICAgICAgICAgICAoKGRvbWFpbklkQ3VycmVudCA9PSBSRUdET01BSU5fRkNDKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEhkZEN0eC0+bkVuYWJsZVN0cmljdFJlZ3VsYXRvcnlGb3JGQ0MpKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICB3aXBoeS0+YmFuZHNbSUVFRTgwMjExX0JBTkRfNUdIWl0tPmNoYW5uZWxzW2pdLmZsYWdzIHw9IElFRUU4MDIxMV9DSEFOX1BBU1NJVkVfU0NBTjsKKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICBlbHNlIGlmICgod2lwaHktPmJhbmRzW0lFRUU4MDIxMV9CQU5EXzVHSFpdLT5jaGFubmVsc1tqXS5jZW50ZXJfZnJlcSA9PSA1MTgwIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXBoeS0+YmFuZHNbSUVFRTgwMjExX0JBTkRfNUdIWl0tPmNoYW5uZWxzW2pdLmNlbnRlcl9mcmVxID09IDUyMDAgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpcGh5LT5iYW5kc1tJRUVFODAyMTFfQkFORF81R0haXS0+Y2hhbm5lbHNbal0uY2VudGVyX2ZyZXEgPT0gNTIyMCB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lwaHktPmJhbmRzW0lFRUU4MDIxMV9CQU5EXzVHSFpdLT5jaGFubmVsc1tqXS5jZW50ZXJfZnJlcSA9PSA1MjQwKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAoKGRvbWFpbklkQ3VycmVudCAhPSBSRUdET01BSU5fRkNDKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhcEhkZEN0eC0+bkVuYWJsZVN0cmljdFJlZ3VsYXRvcnlGb3JGQ0MpKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICB3aXBoeS0+YmFuZHNbSUVFRTgwMjExX0JBTkRfNUdIWl0tPmNoYW5uZWxzW2pdLmZsYWdzICY9IH5JRUVFODAyMTFfQ0hBTl9QQVNTSVZFX1NDQU47CisgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAvL01hcmtpbmcgY2hhbm5lbHMgNTItMTQ0IGFzIFJhZGFyIGNoYW5uZWxzIGlmIHRoZXkgYXJlIGVuYWJsZWQKKyAgICAgICAgICAgICAgICAgayA9IHdpcGh5LT5iYW5kc1tJRUVFODAyMTFfQkFORF8yR0haXS0+bl9jaGFubmVscyArIGo7CisKKyAgICAgICAgICAgICAgICAgaWYgKCh3aXBoeS0+YmFuZHNbSUVFRTgwMjExX0JBTkRfNUdIWl0tPmNoYW5uZWxzW2pdLmNlbnRlcl9mcmVxID09IDUyNjAgfHwKKyAgICAgICAgICAgICAgICAgICAgICB3aXBoeS0+YmFuZHNbSUVFRTgwMjExX0JBTkRfNUdIWl0tPmNoYW5uZWxzW2pdLmNlbnRlcl9mcmVxID09IDUyODAgfHwKKyAgICAgICAgICAgICAgICAgICAgICB3aXBoeS0+YmFuZHNbSUVFRTgwMjExX0JBTkRfNUdIWl0tPmNoYW5uZWxzW2pdLmNlbnRlcl9mcmVxID09IDUzMDAgfHwKKyAgICAgICAgICAgICAgICAgICAgICB3aXBoeS0+YmFuZHNbSUVFRTgwMjExX0JBTkRfNUdIWl0tPmNoYW5uZWxzW2pdLmNlbnRlcl9mcmVxID09IDUzMjAgfHwKKyAgICAgICAgICAgICAgICAgICAgICB3aXBoeS0+YmFuZHNbSUVFRTgwMjExX0JBTkRfNUdIWl0tPmNoYW5uZWxzW2pdLmNlbnRlcl9mcmVxID09IDU1MDAgfHwKKyAgICAgICAgICAgICAgICAgICAgICB3aXBoeS0+YmFuZHNbSUVFRTgwMjExX0JBTkRfNUdIWl0tPmNoYW5uZWxzW2pdLmNlbnRlcl9mcmVxID09IDU1MjApICYmCisgICAgICAgICAgICAgICAgICAgICAoKHJlZ0NoYW5uZWxzW2tdLmVuYWJsZWQgPT0gTlZfQ0hBTk5FTF9FTkFCTEUpIHx8CisgICAgICAgICAgICAgICAgICAgICAgKHJlZ0NoYW5uZWxzW2tdLmVuYWJsZWQgPT0gTlZfQ0hBTk5FTF9ERlMpKSkKKyAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgd2lwaHktPmJhbmRzW0lFRUU4MDIxMV9CQU5EXzVHSFpdLT5jaGFubmVsc1tqXS5mbGFncyB8PSBJRUVFODAyMTFfQ0hBTl9SQURBUjsKKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKworICAgICAgICAgaWYgKHJlcXVlc3QtPmluaXRpYXRvciA9PSBOTDgwMjExX1JFR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gQkUgTElBQkxFIEZPUiBBTlkgU1BFQ0lBTCwgRElSRUNULCBJTkRJUkVDVCwgT1IgQ09OU0VRVUVOVElBTAorICogREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NIExPU1MgT0YgVVNFLCBEQVRBIE9SCisgKiBQUk9GSVRTLCBXSEVUSEVSIElOIEFOIEFDVElPTiBPRiBDT05UUkFDVCwgTkVHTElHRU5DRSBPUiBPVEhFUgorICogVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIFxmaWxlICAgICAgICB2b3NfcGFja2V0LmMKKworICBcYnJpZWYgICAgICAgdmlydHVhbCBPcGVyYXRpbmcgU3lzdGVtIFNlcnZpY2VzICh2T1NTKSBuZXR3b3JrIFBhY2tldCBBUElzCisKKyAgIE5ldHdvcmsgUHJvdG9jb2wgcGFja2V0L2J1ZmZlciBzdXBwb3J0IGludGVyZmFjZXMKKworCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qICRIZWFkZXIkICovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tL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XzExX01HTVQ6CisgICAgICByZXR1cm4gIlRYXzgwMl8xMV9NR01UIjsKKyAgICAgIGJyZWFrOworICAgCisgICBjYXNlIFZPU19QS1RfVFlQRV9UWF84MDJfMTFfREFUQToKKyAgICAgIHJldHVybiAgIlRYXzgwMl8xMV9EQVRBIjsKKyAgICAgIGJyZWFrOworICAgICAgIAorICAgY2FzZSBWT1NfUEtUX1RZUEVfVFhfODAyXzNfREFUQToKKyAgICAgIHJldHVybiAiVFhfODAyXzNfREFUQSI7CisgICAgICBicmVhazsKKyAgIAorICAgY2FzZSBWT1NfUEtUX1RZUEVfUlhfUkFXOgorICAgICAgcmV0dXJuICJSWF9SQVciOworICAgICAgYnJlYWs7CisKKyAgIGRlZmF1bHQ6CisgICAgICByZXR1cm4gIlVOS05PV04iOworICAgICAgYnJlYWs7CisgICB9IAorfQorI2VuZGlmIC8vIGRlZmluZWQoIFdMQU5fREVCVUcgKQorCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIFxicmllZiB2b3NfcGFja2V0X29wZW4oKSAtIGluaXRpYWxpemUgdGhlIHZPU1MgUGFja2V0IG1vZHVsZQorCisgIFRoZSBcYSB2b3NfcGFja2V0X29wZW4oKSBmdW5jdGlvbiBpbml0aWFsaXplcyB0aGUgdk9TUyBQYWNrZXQKKyAgbW9kdWxlLgorCisgIFxwYXJhbSAgcFZvc0NvbnRleHQgLSBwb2ludGVyIHRvIHRoZSBnbG9iYWwgdk9TUyBDb250ZXh0CisKKyAgXHBhcmFtICBwVm9zUGFja2V0Q29udGV4dCAtIHBvaW50ZXIgdG8gYSBwcmV2aW91c2x5IGFsbG9jYXRlZAorICAgICAgICAgIGJ1ZmZlciBiaWcgZW5vdWdoIHRvIGhvbGQgdGhlIHZvcyBQYWNrZXQgY29udGV4dC4KKworICBccGFyYW0gIHZvc1BhY2tldENv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ja2V0Q29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1NJWkVfdCB2b3NQYWNrZXRDb250ZXh0U2l6ZSApCit7CisgICBWT1NfU1RBVFVTIHZvc1N0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgIHVuc2lnbmVkIGludCBmcmVlUGFja2V0SW5kZXg7CisgICB1bnNpZ25lZCBpbnQgaWR4OworICAgc3RydWN0IHZvc19wa3RfdCAqcFBrdDsKKyAgIHN0cnVjdCBsaXN0X2hlYWQgKnBGcmVlTGlzdDsKKworICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0lORk8sICJFbnRlcjolcyIsX19mdW5jX18pOworCisgICBkbworICAgeworCisgICAgICBpZiAoTlVMTCA9PSBwVm9zQ29udGV4dCkKKyAgICAgIHsKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAiVlBLVCBbJWRdOiBOVUxMIHBWb3NDb250ZXh0IiwgX19MSU5FX18pOworICAgICAgICAgdm9zU3RhdHVzID0gVk9TX1NUQVRVU19FX0lOVkFMOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisKKyAgICAgIGlmIChOVUxMID09IHBWb3NQYWNrZXRDb250ZXh0KQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICJWUEtUIFslZF06IE5VTEwgcFZvc1BhY2tldENvbnRleHQiLCBfX0xJTkVfXyk7CisgICAgICAgICB2b3NTdGF0dXMgPSBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKworICAgICAgaWYgKHNpemVvZih2b3NfcGt0X2NvbnRleHRfdCkgIT0g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UigmKHBQa3QtPnBhbFBhY2tldCksCisgICAgICAgICAgICAgICAgICAodm9pZCopJnBWb3NQYWNrZXRDb250ZXh0LT5yeE1ldGFJbmZvW2lkeF0pOworICAgICAgICAgV1BBTF9QQUNLRVRfU0VUX1RZUEUoJihwUGt0LT5wYWxQYWNrZXQpLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVXTEFOX1BBTF9QS1RfVFlQRV9SWF9SQVcpOworCisgICAgICAgICBpZiAoVk9TX1NUQVRVU19TVUNDRVNTICE9IHZvc1N0YXR1cykKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAgICAiVlBLVCBbJWRdOiBQYWNrZXQgaW5pdCBmYWlsdXJlIiwgX19MSU5FX18pOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisgICAgICAgICBsaXN0X2FkZF90YWlsKCZwUGt0LT5ub2RlLCBwRnJlZUxpc3QpOworICAgICAgICAgcFZvc1BhY2tldENvbnRleHQtPnJ4UmF3RnJlZUxpc3RDb3VudCsrOworICAgICAgfQorCisgICAgICAvLyBleGl0IGlmIGFueSBwcm9ibGVtcyBzbyBmYXIKKyAgICAgIGlmIChWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gdm9zU3RhdHVzKQorICAgICAgeworICAgICAgICAgYnJlYWs7CisgICAgICB9CisKKyAgICAgIC8vIGluaXRpYWxpemUgdGhlIHR4RGF0YSBmcmVlIGxpc3QgcG9vbAorICAgICAgbXV0ZXhfaW5pdCgmZ3BWb3NQYWNrZXRDb250ZXh0LT50eERhdGFGcmVlTGlzdExvY2spOworICAgICAgcEZyZWVMaXN0ID0gJnBWb3NQYWNrZXRDb250ZXh0LT50eERhdGFGcmVlTGlzdDsKKyAgICAgIElOSVRfTElTVF9IRUFEKHBGcmVlTGlzdCk7CisKKyAgICAg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XhpdCBpZiBhbnkgcHJvYmxlbXMgc28gZmFyCisgICAgICBpZiAoVk9TX1NUQVRVU19TVUNDRVNTICE9IHZvc1N0YXR1cykKKyAgICAgIHsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorCisgICAgICAvLyBpbml0aWFsaXplIHRoZSB0eE1nbXQgZnJlZSBsaXN0IHBvb2wKKyAgICAgIG11dGV4X2luaXQoJmdwVm9zUGFja2V0Q29udGV4dC0+dHhNZ210RnJlZUxpc3RMb2NrKTsKKyAgICAgIHBGcmVlTGlzdCA9ICZwVm9zUGFja2V0Q29udGV4dC0+dHhNZ210RnJlZUxpc3Q7CisgICAgICBJTklUX0xJU1RfSEVBRChwRnJlZUxpc3QpOworCisgICAgICAvLyBmaWxsIHRoZSB0eE1nbXQgZnJlZSBsaXN0CisgICAgICBmb3IgKGlkeCA9IDA7IGlkeCA8IFZQS1RfTlVNX1RYX01HTVRfUEFDS0VUUzsgaWR4KyspCisgICAgICB7CisgICAgICAgICBwUGt0ID0gJnBWb3NQYWNrZXRDb250ZXh0LT52b3NQa3RCdWZmZXJzW2ZyZWVQYWNrZXRJbmRleCsrXTsKKworICAgICAgICAgdm9zU3RhdHVzID0gdm9zX3BrdGlfcGFja2V0X2luaXQocFBrdCwgVk9TX1BLVF9UWVBFX1RYXzgwMl8xMV9NR01UKTsKKworICAgICAgICAgV1BBTF9QQUNLRVRfU0VUX01FVEFJTkZPX1BPSU5URVIoJihwUGt0LT5wYWxQYWNrZXQpLAorICAgICAgICAgICAgICAgKHZvaWQqKSZwVm9zUGFja2V0Q29udGV4dC0+dHhNZ210TWV0YUluZm9baWR4XSk7CisgICAgICAgICBXUEFMX1BBQ0tFVF9TRVRfVFlQRSgmKHBQa3QtPnBhbFBhY2tldCksIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVdMQU5fUEFMX1BLVF9UWVBFX1RYXzgwMl8xMV9NR01UKTsKKworICAgICAgICAgaWYgKFZPU19TVEFUVVNfU1VDQ0VTU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gYW5kIGNhbm5vdAorICAgICAgICAgIGFjY29tb2RhdGUgYW55IG1vcmUgY2FsbHMgdG8gcmV0cmlldmUgcGFja2V0cyBmcm9tIHRoYXQKKyAgICAgICAgICBwb29sLiAgIE5vdGUgdGhpcyBpcyBhIEZBSUxVUkUgYW5kIHRoZSAnbG93IHJlc291cmNlJyBjYWxsYmFjaworICAgICAgICAgIHdpbGwgKm5vdCogYmUgY2FsbGVkLgorCisgICAgICAgICAgVk9TX1NUQVRVU19FX0ZBVUxUIC0gcHBQYWNrZXQgZG9lcyBub3Qgc3BlY2lmeSBhIHZhbGlkIHBvaW50ZXIuCisKKyAgXHNhCisKKyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KK1ZPU19TVEFUVVMgdm9zX3BrdF9nZXRfcGFja2V0KCB2b3NfcGt0X3QgKipwcFBhY2tldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfUEtUX1RZUEUgcGt0VHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1NJWkVfdCBkYXRhU2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1NJWkVfdCBudW1QYWNrZXRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfQk9PTF90IHplcm9CdWZmZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX3BrdF9nZXRfcGFja2V0X2NhbGxiYWNrIGNhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVk9JRF90ICp1c2VyRGF0YSApCit7CisgICBzdHJ1Y3QgbGlzdF9oZWFkICpwUGt0RnJlZUxpc3Q7CisgICB2b3NfcGt0X2xvd19yZXNvdXJjZV9pbmZvICpwTG93UmVzb3VyY2VJbmZvOworICAgc3RydWN0IHZvc19wa3RfdCAqcFZvc1BhY2tldDsKKyAgIHZfU0laRV90ICpwQ291bnQgPSBOVUxMOworICAgc3RydWN0IG11dGV4ICptbG9jazsKKworICAgLy8gVmFsaWRhdGUgdGhlIHJldHVybiBwYXJhbWV0ZXIgcG9pbnRlcgorICAgaWYgKHVubGlrZWx5KE5VTEwgPT0gcHBQYWNrZXQpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICJWUEtUIFslZF06IE5VTEwgcHBQYWNrZXQiLCBfX0xJTkVfXyk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICAvLyB3ZSBvbmx5IHN1cHBvcnQgZ2V0dGluZyAxIHBhY2tldCBhdCB0aGlzIHRpbWUgKGFzIGRvIFdNICYgQU1TUykKKyAgIGlmICh1bmxpa2VseSgxICE9IG51bVBhY2tldHMpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICJWUEtUIFslZF06IGludmFsaWQgbnVtUGFja2V0cywgJWQiLCBfX0xJTkVfXywgbnVtUGFja2V0cyk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICAvLyBWYWxpZGF0ZSB0aGUgZGF0YVNpemUgaXMgd2l0aGluIHJhbmdlCisgICBpZiAodW5saWtlbHkoKDAgPT0gZGF0YVNpemUpIHx8IChkYXRhU2l6ZSA+IFZQS1RfU0laRV9CVUZGRVIpKSkKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiVlBLVCBbJWRdOiBpbnZhbGlkIGRhdGFTaXplLCAlZCIsIF9fTElORV9fLCBkYXR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cG9vbD8KKyAgIGlmICh1bmxpa2VseShsaXN0X2VtcHR5KHBQa3RGcmVlTGlzdCkpKQorICAgeworICAgICAgLy8gYWxsb2NhdGlvbiBmYWlsZWQKKyAgICAgIC8vIGRpZCB0aGUgY2FsbGVyIHNwZWNpZnkgYSBjYWxsYmFjaz8KKyAgICAgIGlmICh1bmxpa2VseShOVUxMID09IGNhbGxiYWNrKSkKKyAgICAgIHsKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiVlBLVCBbJWRdOiBMb3cgcmVzb3VyY2UgY29uZGl0aW9uIGFuZCBubyBjYWxsYmFjayBwcm92aWRlZCIsCisgICAgICAgICAgICAgICAgICAgX19MSU5FX18pOworICAgICAgICAgbXV0ZXhfdW5sb2NrKG1sb2NrKTsKKworICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgICAgfQorCisgICAgICAvLyBzYXZlIHRoZSBsb3cgcmVzb3VyY2UgaW5mb3JtYXRpb24gc28gdGhhdCB3ZSBjYW4gaW52b2tlIHRoZQorICAgICAgLy8gY2FsbGJhY2sgd2hlbiBhIHBhY2tldCBiZWNvbWVzIGF2YWlsYWJsZQorICAgICAgcExvd1Jlc291cmNlSW5mby0+Y2FsbGJhY2sgICA9IGNhbGxiYWNrOworICAgICAgcExvd1Jlc291cmNlSW5mby0+dXNlckRhdGEgICA9IHVzZXJEYXRhOworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgIlZQS1QgWyVkXTogTG93IHJlc291cmNlIGNvbmRpdGlvbiBmb3IgcGFja2V0IHR5cGUgJWRbJXNdIiwKKyAgICAgICAgICAgICAgICBfX0xJTkVfXywgcGt0VHlwZSwgdm9zX3BrdGlfcGFja2V0X3R5cGVf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ICAgICAgICAgd2lsbCAqbm90KiBiZSBjYWxsZWQuCisKKyAgICAgICAgICBWT1NfU1RBVFVTX0VfRkFVTFQgLSBwcFBhY2tldCBvciBwT1NQYWNrZXQgZG8gbm90IHNwZWNpZnkgdmFsaWQKKyAgICAgICAgICBwb2ludGVycy4KKworICBcc2Egdm9zX3BrdF9zZXRfb3NfcGFja2V0KCkKKworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworVk9TX1NUQVRVUyB2b3NfcGt0X3dyYXBfZGF0YV9wYWNrZXQoIHZvc19wa3RfdCAqKnBwUGFja2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19QS1RfVFlQRSBwa3RUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVk9JRF90ICpwT1NQYWNrZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX3BrdF9nZXRfcGFja2V0X2NhbGxiYWNrIGNhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVk9JRF90ICp1c2VyRGF0YSApCit7CisgICBzdHJ1Y3QgbGlzdF9oZWFkICpwUGt0RnJlZUxpc3Q7CisgICB2b3NfcGt0X2xvd19yZXNvdXJjZV9pbmZvICpwTG93UmVzb3VyY2VJbmZvOworICAgc3RydWN0IHZvc19wa3RfdCAqcFZvc1BhY2tldDsKKyAgIHN0cnVjdCBtdXRleCAqbWxvY2s7CisKKyAgIC8vIFZhbGlkYXRlIHRoZSByZXR1cm4gcGFyYW1ldGVyIHBvaW50ZXIKKyAgIGlmICh1bmxpa2VseShOVUxMID09IHBwUGFja2V0KSkKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9GQVRB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ICJJRCIgYW5kIHNob3VsZCBvbmx5IGJlIGFjY2Vzc2VkIGJ5IHRoZSBjb21wb25lbnQKKyAgc3BlY2lmaWVkLgorCisgIFxwYXJhbSBwUGFja2V0IC0gdGhlIHZvc3MgUGFja2V0IHRvIHJldHJlaXZlIHRoZSB1c2VyIGRhdGEgcG9pbnRlciBmcm9tLgorCisgIFxwYXJhbSB1c2VySUQgLSB0aGUgaWRlbnRpZmllciBmb3IgdGhlIHVzZXIgZGF0YSBhcmVhIGluIHRoZSB2b3NzIFBhY2tldAorICAgICAgICAgICAgICAgICAgdG8gZ2V0LgorCisgICAgICAgICAgICAgICAgICBVc2VyIElEcyBhbmQgdXNlciBkYXRhIGFyZWFzIGluIHRoZSB2b3NzIFBhY2tldCBhcmUKKyAgICAgICAgICAgICAgICAgIGF2YWlsYWJsZSBmb3I6CisgICAgICAgICAgICAgICAgICAtIFRyYW5zcG9ydCBMYXllciAoVEwpCisgICAgICAgICAgICAgICAgICAtIEJ1cyBBYnN0cmFjdGlvbiBMYXllciAoQkFMKQorICAgICAgICAgICAgICAgICAgLSBTRElPIFNlcnZpY2VzIENvbXBvbmVudCAoU1NDKQorICAgICAgICAgICAgICAgICAgLSBIb3N0IERldmljZSBEcml2ZXIgKEhERCkKKworICBccGFyYW0gcHBVc2VyRGF0YSAtIHBvaW50ZXIgdG8gbG9jYXRpb24gdG8gcmV0dXJuIHRoZSBwb2ludGVyIHRvIHRoZSB1c2VyCisgICAgICAgICAgICAgICAgICAgICAgZGF0YS4KKworICBccmV0dXJuIC0gTm90aGluZy4KKworICBcc2EKKworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwordl9WT0lEX3Qgdm9zX3BrdF9nZXRfdXNlcl9kYXRhX3B0ciggdm9zX3BrdF90ICpwUGFja2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1BLVF9VU0VSX0RBVEFfSUQgdXNlcklELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9WT0lEX3QgKipwcFVzZXJEYXRhICkKK3sKKyAgIC8vIFZhbGlkYXRlIHRoZSBpbnB1dCBhbmQgb3V0cHV0IHBhcmFtZXRlciBwb2ludGVycworICAgaWYgKHVubGlrZWx5KE5VTEwgPT0gcFBhY2tldCkpCisgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgIlZQS1QgWyVkXTogTlVMTCBwb2ludGVyIiwgX19MSU5FX18pOworICAgICAgIGlmIChwcFVzZXJEYXRhICE9IE5VTEwpCisgICAgICAgeworICAgICAgICAgICAqcHBVc2VyRGF0YSA9IE5VTEw7CisgICAgICAgfQorICAgICAgIHJldHVybjsKKyAgIH0KKworICAgLy8gVmFsaWRhdGUgdGhhdCB0aGlzIHJlYWxseSBhbiBpbml0aWFsaXplZCB2b3MgcGFja2V0CisgICBpZiAodW5saWtlbHkoVlBLVF9NQUdJQ19OVU1CRVIgIT0gcFBhY2tldC0+bWFnaWMpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICJWUEtUIFslZF06IEludmFsaWQgbWFnaWMiLCBfX0xJTkVfXyk7CisgICAgICAqcHBVc2VyRGF0YSA9IE5VTEw7CisgICAgICByZXR1cm47CisgICB9CisKKyAgIC8vIFZhbGlkYXRlIHVzZXJJRAorICAgaWYgKHVubGlrZWx5KHVzZXJJRCA+PSBWT1NfUEtUX1VTRVJfREFUQV9JRF9NQVgpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIC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0aGUgdm9zcyBQYWNrZXQgYXJlIGZpeGVkLiAgVGhlCisgICAgICAgICBzaXplIG9mIGEgc2luZ2xlIHBvaW50ZXIgaXMgYXZhaWxhYmxlIGluIGVhY2ggdXNlciBhcmVhLgorCisgIFxwYXJhbSBwUGFja2V0IC0gdGhlIHZvc3MgUGFja2V0IHRvIHNldCB0aGUgdXNlciBwb2ludGVyLgorCisgIFxwYXJhbSB1c2VySUQgLSB0aGUgaWRlbnRpZmllciBmb3IgdGhlIHVzZXIgZGF0YSBhcmVhIGluIHRoZSB2b3NzIFBhY2tldAorICAgICAgICAgICAgICAgICAgdG8gc2V0LgorCisgICAgICAgICAgICAgICAgICBVc2VyIElEcyBhbmQgdXNlciBkYXRhIGFyZWFzIGluIHRoZSB2b3NzIFBhY2tldCBhcmUKKyAgICAgICAgICAgICAgICAgIGF2YWlsYWJsZSBmb3I6CisgICAgICAgICAgICAgICAgICAtIFRyYW5zcG9ydCBMYXllciAoVEwpCisgICAgICAgICAgICAgICAgICAtIEJ1cyBBYnN0cmFjdGlvbiBMYXllciAoQkFMKQorICAgICAgICAgICAgICAgICAgLSBTRElPIFNlcnZpY2VzIENvbXBvbmVudCAoU1NDKQorICAgICAgICAgICAgICAgICAgLSBIb3N0IERldmljZSBEcml2ZXIgKEhERCkKKworICBccGFyYW0gcFVzZXJEYXRhIC0gcG9pbnRlciB2YWx1ZSB0byBzZXQgaW4gdGhlIHVzZXIgZGF0YSBhcmVhIG9mIHRoZSB2b3NzCisgICAgICAgICAgICAgICAgICAgICBwYWNrZXQuLgorCisgIFxyZXR1cm4gLSBOb3RoaW5nLgorCisgIFxzYQorCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCit2X1ZPSURfdCB2b3NfcGt0X3NldF91c2VyX2RhdGFfcHRyKCB2b3NfcGt0X3QgKnBQYWNrZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfUEtUX1VTRVJfREFUQV9JRCB1c2VySUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1ZPSURfdCAqcFVzZXJEYXRhICkKK3sKKyAgIC8vIFZhbGlkYXRlIHRoZSBpbnB1dCBwYXJhbWV0ZXIgcG9pbnRlcgorICAgaWYgKHVubGlrZWx5KE5VTEwgPT0gcFBhY2tldCkpCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgIlZQS1QgWyVkXTogTlVMTCBwb2ludGVyIiwgX19MSU5FX18pOworICAgICAgcmV0dXJuOworICAgfQorCisgICAvLyBWYWxpZGF0ZSB0aGF0IHRoaXMgaXMgcmVhbGx5IGFuIGluaXRpYWxpemVkIHZvcyBwYWNrZXQKKyAgIGlmICh1bmxpa2VseShWUEtUX01BR0lDX05VTUJFUiAhPSBwUGFja2V0LT5tYWdpYykpCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgIlZQS1QgWyVkXTogSW52YWxpZCBtYWdpYyIsIF9fTElORV9fKTsKKyAgICAgIHJldHVybjsKKyAgIH0KKworICAgLy8gVmFsaWRhdGUgdXNlcklECisgICBpZiAodW5saWtlbHkodXNlcklEID49IFZPU19QS1RfVVNFUl9EQVRBX0lEX01BWCkpCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIlZQS1QgWyVkXTogSW52YWxpZCB1c2VyIElEIFslZF0iLCBfX0xJTkVfXywgdXNlcklEKTsKKyAgICAgIHJldHVybjsKKyAgIH0KKworICAgLy8gcmV0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oVlBLVF9NQUdJQ19OVU1CRVIgIT0gcFBhY2tldC0+bWFnaWMpKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICJWUEtUIFslZF06IEludmFsaWQgbWFnaWMiLCBfX0xJTkVfXyk7CisgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworICAgICAgfQorCisgICAgICAvL0lmIGFuIHNrYiBpcyBhdHRhY2hlZCB0aGVuIHJlc2V0IHRoZSBwb2ludGVycyAgICAgIAorICAgICAgaWYgKHBQYWNrZXQtPnBTa2IpCisgICAgICB7CisgICAgICAgICBwUGFja2V0LT5wU2tiLT5sZW4gPSAwOworICAgICAgICAgcFBhY2tldC0+cFNrYi0+ZGF0YSA9IHBQYWNrZXQtPnBTa2ItPmhlYWQ7CisgICAgICAgICBza2JfcmVzZXRfdGFpbF9wb2ludGVyKHBQYWNrZXQtPnBTa2IpOworICAgICAgICAgc2tiX3Jlc2VydmUocFBhY2tldC0+cFNrYiwgVlBLVF9TSVpFX0JVRkZFUik7CisgICAgICB9CisKKyAgICAgIHBDb3VudCA9IE5VTEw7CisgICAgICAvLyBkZXRlcm1pbmUgd2hpY2ggcGFja2V0IHBvb2wgYW5kIGxvdyByZXNvdXJjZSBibG9jayB3ZSBzaG91bGQgdXNlLgorICAgICAgc3dpdGNoIChwUGFja2V0LT5wYWNrZXRUeXBlKQorICAgICAgeworICAgICAgY2FzZSBWT1NfUEtUX1RZUEVfUlhfUkFXOgorICAgICAgICAgLy8gaWYgdGhpcyBwYWNrZXQgc3RpbGwgaGFzIGFuIHNrYiBhdHRhY2hlZCwgd2UgY2FuIHB1dCBpdAorICAgICAgICAgLy8gYmFjayBpbiB0aGUgZnJlZSBwb29sLCBvdGhlcndpc2Ugd2UgbmVlZCB0byBwdXQgaXQgaW4gdGhlCisgICAgICAgICAvLyByZXBsZW5pc2ggcG9vbAorICAgICAgICAgaWYgKHBQYWNrZXQtPnBTa2IpCisgICAgICAgICB7CisgICAgICAgICAgICBwUGt0RnJlZUxpc3QgPSAmZ3BWb3NQYWNrZXRDb250ZXh0LT5yeFJhd0ZyZWVMaXN0OworICAgICAgICAgICAgcExvd1Jlc291cmNlSW5mbyA9ICZncFZvc1BhY2tldENvbnRleHQtPnJ4UmF3TG93UmVzb3VyY2VJbmZvOworICAgICAgICAgICAgcENvdW50ID0gJmdwVm9zUGFja2V0Q29udGV4dC0+cnhSYXdGcmVlTGlzdENvdW50OworICAgICAgICAgICAgbWxvY2sgPSAmZ3BWb3NQYWNrZXRDb250ZXh0LT5yeFJhd0ZyZWVMaXN0TG9jazsKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHBQa3RGcmVlTGlzdCA9ICZncFZvc1BhY2tldENvbnRleHQtPnJ4UmVwbGVuaXNoTGlzdDsKKyAgICAgICAgICAgIHBMb3dSZXNvdXJjZUluZm8gPSBOVUxMOworICAgICAgICAgICAgcENvdW50ID0gJmdwVm9zUGFja2V0Q29udGV4dC0+cnhSZXBsZW5pc2hMaXN0Q291bnQ7CisgICAgICAgICAgICBtbG9jayA9ICZncFZvc1BhY2tldENvbnRleHQtPnJ4UmVwbGVuaXNoTGlzdExvY2s7CisgICAgICAgICB9CisgICAgICAgICBwYWNrZXRUeXBlID0gVk9TX1BLVF9UWVBFX1JYX1JBVzsKKyAgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIFZPU19QS1RfVFlQRV9UWF84MDJfMTFfTUdNVDoKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgIHBQa3RGcmVlTGlzdCA9ICZncFZvc1BhY2tldENvbnRleHQtPnR4TWdtdEZyZWVMaXN0OworICAgICAgICAgcExvd1Jlc291cmNlSW5mbyA9ICZncFZvc1BhY2tldENvbnRleHQtPnR4TWdtdExvd1Jlc291cmNlSW5mbzsKKyAgICAgICAgIG1sb2NrID0gJmdwVm9zUGFja2V0Q29udGV4dC0+dHhNZ210RnJlZUxpc3RMb2NrOworCisgICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBWT1NfUEtUX1RZUEVfVFhfODAyXzNfREFUQToKKyAgICAgICAgIHBQa3RGcmVlTGlzdCA9ICZncFZvc1BhY2tldENvbnRleHQtPnR4RGF0YUZyZWVMaXN0OworICAgICAgICAgcExvd1Jlc291cmNlSW5mbyA9ICZncFZvc1BhY2tldENvbnRleHQtPnR4RGF0YUxvd1Jlc291cmNlSW5mbzsKKyAgICAgICAgIG1sb2NrID0gJmdwVm9zUGFja2V0Q29udGV4dC0+dHhEYXRhRnJlZUxpc3RMb2NrOworICAgICAgICAgZ3BWb3NQYWNrZXRDb250ZXh0LT51Y3R4RGF0YUZyZWVMaXN0Q291bnQgKys7CisgICAgICAgICBicmVhazsKKworICAgICAgZGVmYXVsdDoKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAiVlBLVCBbJWRdOiBpbnZhbGlkIHBhY2tldCB0eXBlICVkWyVzXSIsCisgICAgICAgICAgICAgICAgICAgX19MSU5FX18sIHBQYWNrZXQtPnBhY2tldFR5cGUsCisgICAgICAgICAgICAgICAgICAgdm9zX3BrdGlfcGFja2V0X3R5cGVfc3RyKHBQYWNrZXQtPnBhY2tldFR5cGUpKTsKKworICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgICAgIH0KKworCisgICAgICAvLyBpcyB0aGVyZSBhIGxvdyByZXNvdXJjZSBjb25kaXRpb24gcGVuZGluZyBmb3IgdGhpcyBwYWNrZXQgdHlwZT8KKyAgICAgIGlmIChwTG93UmVzb3VyY2VJbmZvICYmIHBMb3dSZXNvdXJjZUluZm8tPmNhbGxiYWNrKQorICAgICAgeworICAgICAgICAgLy8gcExvd1Jlc291cmNlSW5mby0+Y2FsbGJhY2sgaXMgbW9kaWZpZWQgZnJvbSB0aHJlYWRzIChkaWZmZXJlbnQgQ1BVJ3MpLiAKKyAgICAgICAgIC8vIFNvIGEgbXV0ZXggaXMgZW5vdWdoIHRvIHByb3RlY3QgaXMgYWdhaW5zdCBhIHJhY2UgY29uZGl0aW9uLgorICAgICAgICAgLy8gbXV0ZXggaXMgU01QIHNhZmUKKyAgICAgICAgIG11dGV4X2xvY2sobWxvY2spOworICAgICAgICAgY2FsbGJhY2sgPSBwTG93UmVzb3VyY2VJbmZvLT5jYWxsYmFjazsKKyAgICAgICAgIHBMb3dSZXNvdXJjZUluZm8tPmNhbGxiYWNrID0gTlVMTDsKKyAgICAgICAgIG11dGV4X3VubG9jayhtbG9jayk7CisKKyAgICAgICAgIC8vIG9ubHkgb25lIGNvbnRleHQgY2FuIGdldCBhIHZhbGlkIGNhbGxiYWNrCisgICAgICAgICBpZihjYWxsYmFjaykKKyAgICAgICAgIHsKKyAgICAgICAgICAgICAvLyBbREVCVUddCisgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0lORk8sIlZQS1QgWyVkXTogcmVjeWNsZSAlcCIsICBfX0xJTkVfXywgcFBhY2tldCk7CisKKyAgICAgICAgICAgICAvLyB5ZXMsIHNvIHJhdGhlciB0aGFuIHBsYWNpbmcgdGhlIHBhY2tldCBiYWNrIGluIHRoZSBmcmVlIHBvb2wKKyAgICAgICAgICAgICAvLyB3ZSB3aWxsIGludm9rZSB0aGUgbG93IHJlc291cmNlIGNhbGxiYWNrCisgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICJWUEtUIFslZF06IFslcF0gUGFja2V0IHJlY3ljbGVkLCB0eXBlICVkWyVzXSIsCisgICAgICAgICAgICAgICAgICAgICAgIF9fTElORV9fLCBwUGFja2V0LCBwUGFja2V0LT5wYWNrZXRUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICB2b3NfcGt0aV9wYWNrZXRfdHlwZV9zdHIocFBhY2tldC0+cGFja2V0VHlwZSkpOworCisgICAgICAgICAgICAgLy8gY2xlYXIgb3V0IHRoZSBVc2VyIERhdGEgcG9pbnRlcnMgaW4gdGhlIHZvc3MgcGFja2V0Li4KKyAgICAgICAgICAgICBtZW1zZXQoJnBQYWNrZXQtPnB2VXNlckRhdGEsIDAsIHNpemVvZihwUGFja2V0LT5wdlVzZXJEYXRhKSk7CisKKyAgICAgICAgICAgICAvLyBpbml0aWFsaXplIHRoZSAnY2hhaW4nIHBvaW50ZXIgdG8gTlVMTC4KKyAgICAgICAgICAgICBwUGFja2V0LT5wTmV4dCA9IE5VTEw7CisKKyAgICAgICAgICAgICAvLyB0aW1lc3RhbXAgdGhlIHZvcyBwYWNrZXQuCisgICAgICAgICAgICAgcFBhY2tldC0+dGltZXN0YW1wID0gdm9zX3RpbWVyX2dldF9zeXN0ZW1fdGlja3MoKTsKKworICAgICAgICAgICAgIGNhbGxiYWNrKHBQYWNrZXQsIHBMb3dSZXNvdXJjZUluZm8tPnVzZXJEYXRhKTsKKworICAgICAgICAgICAgIC8vIFdlIGRpZCBwcm9jZXNzIGxvdyByZXNvdXJjZSBjb25kaXRpb24KKyAgICAgICAgICAgICBsb3dSZXNvdXJjZSA9IFZPU19UUlVFOworICAgICAgICAgfQorICAgICAgfQorICAgICAgCisKKyAgICAgIGlmKCFsb3dSZXNvdXJjZSkKKyAgICAgIHsKKyAgICAgICAgIC8vIHRoaXMgcGFja2V0IGRvZXMgbm90IHNhdGlzZnkgYSBsb3cgcmVzb3VyY2UgY29uZGl0aW9uCisgICAgICAgICAvLyBzbyBwdXQgaXQgYmFjayBpbiB0aGUgYXBwcm9wcmlhdGUgZnJlZSBwb29sCisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1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GUgY2hhaW4KKyAgIHdoaWxlIChwUGFja2V0LT5wTmV4dCkKKyAgIHsKKyAgICAgIHBQYWNrZXQgPSBwUGFja2V0LT5wTmV4dDsKKyAgIH0KKworICAgLy8gYXR0YWNoCisgICBwUGFja2V0LT5wTmV4dCA9IHBDaGFpblBhY2tldDsKKworICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworCisvKiotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIFxicmllZiB2b3NfcGt0X3dhbGtfcGFja2V0X2NoYWluKCkgLSBXYWxrIHBhY2tldCBjaGFpbiBhbmQgKHBvc3NpYmx5KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuY2hhaW4gcGFja2V0cworCisgIFRoaXMgQVBJIHdpbGwgd2FsayB0aGUgdm9zcyBQYWNrZXQgYW5kIHVuY2hhaW4gdGhlIHBhY2tldCBmcm9tIHRoZSBjaGFpbiwKKyAgaWYgc3BlY2lmaWVkLiAgVGhlICduZXh0JyBwYWNrZXQgaW4gdGhlIHBhY2tldCBjaGFpbiBpcyByZXR1cm5lZCBhcyB0aGUKKyAgcGFja2V0IGNoYWluIGlzIHRyYXZlcnNlZC4KKworICBccGFyYW0gIHBQYWNrZXQgLSBpbnB1dCB2b3NfcGFja2V0IHdhbGsKKworICBccGFyYW0gcHBDaGFpbmVkUGFja2V0IC0gcG9pbnRlciB0byBsb2NhdGlvbiB0byByZXR1cm4gdGhlICduZXh0JyB2b3NzCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWNrZXQgcG9pbnRlciBpbiB0aGUgcGFja2V0IGNoYWluLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCBtZWFucyB0aGVyZSBpcyB3YXMgbm90IHBhY2tldCBjaGFpbmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0byB0aGlzIHBhY2tldC4KKworICBccGFyYW0gdW5jaGFpblBhY2tldCAtIEZsYWcgdGhhdCBzcGVjaWZpZXMgaWYgdGhlIGNhbGxlciB3YW50cyB0aGUgcGFja2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgdG8gYmUgcmVtb3ZlZCBmcm9tIHRoZSBwYWNrZXQgY2hhaW4uICBUaGlzIGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgcHJvdmlkZWQgdG8gYWxsb3cgdGhlIGNhbGxlciB0byB3YWxrIHRoZSBwYWNrZXQgY2hhaW4KKyAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoIG9yIHdpdGhvdXQgYnJlYWtpbmcgdGhlIGNoYWluLgorCisgICAgPHVsPgorICAgICAgPGxpPiB0cnVlIC0gd2hlbiBzZXQgJ3RydWUnIHRoZSBBUEkgd2lsbCByZXR1cm4KKyAgICAgICAgICAgICAgICAgIHRoZSAnbmV4dCcgcGFja2V0IHBvaW50ZXIgaW4gdGhlIHZvc3MgUGFja3RlIGNoYWluIGFuZAorICAgICAgICAgICAgICAgICAgKldJTEwqIHVuY2hhaW4gdGhlIGlucHV0IHBhY2tldCBmcm9tIHRoZSBwYWNrZXQgY2hhaW4uCisKKyAgICAgIDxsaT4gTk9UIGZhbHNlIC0gd2hlbiBzZXQgJ2ZhbHNlJyB0aGUgQVBJIHdpbGwgcmV0dXJuCisgICAgICAgICAgICAgICAgICAgICAgIHRoZSAnbmV4dCcgcGFja2V0IHBvaW50ZXIgaW4gdGhlIHZvc3MgUGFja2V0IGNoYWluIGJ1dAorICAgICAgICAgICAgICAgICAgICAgICAqV0lMTCBOT1QqIHVuY2hhaW4gdGhlIHBhY2tldCBjaGFpbi4gICBUaGlzIG9wdGlvbiBnaXZlcworICAgICAgICAgICAgICAgICAgICAgICB0aGUgY2FsbGVyIHRoZSBhYmlsaXR5IHRvIHdhbGsgdGhlIHBhY2tldCBjaGFpbiB3aXRob3V0CisgICAgICAgICAgICAgIC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ICAgICAgICAgICAgIHZfU0laRV90ICpwT3V0cHV0QnVmZmVyU2l6ZSApCit7CisgICB2X1NJWkVfdCBsZW47CisgICBzdHJ1Y3Qgc2tfYnVmZiAqc2tiOworCisgICAvLyBWYWxpZGF0ZSB0aGUgcGFyYW1ldGVyIHBvaW50ZXJzCisgICBpZiAodW5saWtlbHkoKE5VTEwgPT0gcFBhY2tldCkgfHwKKyAgICAgICAgICAgICAgICAoTlVMTCA9PSBwT3V0cHV0QnVmZmVyKSB8fAorICAgICAgICAgICAgICAgIChOVUxMID09IHBPdXRwdXRCdWZmZXJTaXplKSkpCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgIlZQS1QgWyVkXTogTlVMTCBwb2ludGVyIiwgX19MSU5FX18pOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgIH0KKworICAgLy8gVmFsaWRhdGUgdGhhdCB0aGlzIGlzIHJlYWxseSBhbiBpbml0aWFsaXplZCB2b3MgcGFja2V0CisgICBpZiAodW5saWtlbHkoVlBLVF9NQUdJQ19OVU1CRVIgIT0gcFBhY2tldC0+bWFnaWMpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICJWUEtUIFslZF06IEludmFsaWQgbWFnaWMiLCBfX0xJTkVfXyk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICAvLyBnZXQgcG9pbnRlciB0byB0aGUgc2tiCisgICBza2IgPSBwUGFja2V0LT5wU2tiOworCisgICAvLyBWYWxpZGF0ZSB0aGUgc2tiCisgICBpZiAodW5saWtlbHkoTlVMTCA9PSBza2IpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9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pZWYgdm9zX3BrdF9nZXRfcGFja2V0X2xlbmd0aCgpIC0gR2V0IHBhY2tldCBsZW5ndGggZm9yIGEgdm9zcyBQYWNrZXQKKworICBUaGlzIEFQSSByZXR1cm5zIHRoZSB0b3RhbCBsZW5ndGggb2YgdGhlIGRhdGEgaW4gYSB2b3NzIFBhY2tldC4KKworICBccGFyYW0gcFBhY2tldCAtIHRoZSB2b3NzIFBhY2tldCB0byBnZXQgdGhlIHBhY2tldCBsZW5ndGggZnJvbS4KKworICBccGFyYW0gcFBhY2tldFNpemUgLSBsb2NhdGlvbiB0byByZXR1cm4gdGhlIHRvdGFsIHNpemUgb2YgdGhlIGRhdGEgY29udGFpbmVkCisgICAgICAgICAgICAgICAgICAgICAgIGluIHRoZSB2b3NzIFBhY2tldC4KKyAgXHJldHVybgorCisgIFxzYQorCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCitWT1NfU1RBVFVTIHZvc19wa3RfZ2V0X3BhY2tldF9sZW5ndGgoIHZvc19wa3RfdCAqcFBhY2tldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9VMTZfdCAqcFBhY2tldFNpemUgKQoreworICAgLy8gVmFsaWRhdGUgdGhlIHBhcmFtZXRlciBwb2ludGVycworICAgaWYgKHVubGlrZWx5KChOVUxMID09IHBQYWNrZXQpIHx8CisgICAgICAgICAgICAgICAgKE5VTEwgPT0gcFBhY2tldFNpemUpKSkKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAiVlBLVCBbJWRdOiBOVUxMIHBvaW50ZXIiLCBfX0xJTkVfXyk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICAv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IHRoZSBkYXRhIHRvIHJlc2VydmUgYXQgdGhlIGhlYWQgb2YgdGhlIHZvc3MKKyAgICAgICAgICAgICAgICAgICAgUGFja2V0LiAgVXBvbiBzdWNjZXNzZnVsIHJldHVybiwgdGhlIGxlbmd0aCBvZiB0aGUgdm9zcworICAgICAgICAgICAgICAgICAgICBQYWNrZXQgaXMgaW5jcmVhc2VkIGJ5IGRhdGFTaXplLgorCisgIFxyZXR1cm4KKworICBcc2EKKworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworVk9TX1NUQVRVUyB2b3NfcGt0X3Jlc2VydmVfaGVhZCggdm9zX3BrdF90ICpwUGFja2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9WT0lEX3QgKipwcERhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1NJWkVfdCBkYXRhU2l6ZSApCit7CisgICBzdHJ1Y3Qgc2tfYnVmZiAqc2tiOworICAgc3RydWN0IHNrX2J1ZmYgKm5ld3NrYjsKKworICAgLy8gVmFsaWRhdGUgdGhlIHBhcmFtZXRlciBwb2ludGVycworICAgaWYgKHVubGlrZWx5KChOVUxMID09IHBQYWNrZXQpIHx8IChOVUxMID09IHBwRGF0YSkpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICJWUEtUIFslZF06IE5VTEwgcG9pbnRlciIsIF9fTElORV9fKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICB9CisKKyAgIC8vIFZhbGlkYXRlIHRoYXQgdGhpcyBpcyByZWFsbHkgYW4gaW5pdGlhbGl6ZWQgdm9zIHBhY2tldAorICAgaWYgKHVubGlrZWx5KFZQS1RfTUFHSUN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hZGVycywgZXRjLgorCisgIFxwYXJhbSBkYXRhU2l6ZSAtIHRoZSBzaXplIG9mIHRoZSBkYXRhIHRvIHJlc2VydmUgYXQgdGhlIGhlYWQgb2YgdGhlIHZvc3MKKyAgICAgICAgICAgICAgICAgICAgUGFja2V0LiAgVXBvbiBzdWNjZXNzZnVsIHJldHVybiwgdGhlIGxlbmd0aCBvZiB0aGUgdm9zcworICAgICAgICAgICAgICAgICAgICBQYWNrZXQgaXMgaW5jcmVhc2VkIGJ5IGRhdGFTaXplLgorCisgIFxyZXR1cm4KKworICBcc2EKKworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworVk9TX1NUQVRVUyB2b3NfcGt0X3Jlc2VydmVfaGVhZF9mYXN0KCB2b3NfcGt0X3QgKnBQYWNrZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1ZPSURfdCAqKnBwRGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfU0laRV90IGRhdGFTaXplICkKK3sKKyAgIHN0cnVjdCBza19idWZmICpza2I7CisgICBzdHJ1Y3Qgc2tfYnVmZiAqbmV3c2tiOworCisgICAvLyBnZXQgcG9pbnRlciB0byB0aGUgc2tiCisgICBza2IgPSBwUGFja2V0LT5wU2tiOworCisgICAvLyBWYWxpZGF0ZSB0aGUgc2tiCisgICBpZiAodW5saWtlbHkoTlVMTCA9PSBza2IpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICJWUEtUIFslZF06IE5VTEwgc2tiIiwgX19MSU5FX18pOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgIH0KKworICAgLy8gTWFrZSBzdXJlIHRoZXJlIGlzIGh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VzdCBjb250YWluIGF0CisgICAgICAgICAgICAgICAgICAgIGxlYXN0IHRoaXMgYW1vdW50IG9mIHNwYWNlLgorCisgIFxyZXR1cm4KKworICBcc2EKKworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworVk9TX1NUQVRVUyB2b3NfcGt0X3BvcF9oZWFkKCB2b3NfcGt0X3QgKnBQYWNrZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVk9JRF90ICpwRGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9TSVpFX3QgZGF0YVNpemUgKQoreworICAgc3RydWN0IHNrX2J1ZmYgKnNrYjsKKworICAgLy8gVmFsaWRhdGUgdGhlIHBhcmFtZXRlciBwb2ludGVycworICAgaWYgKHVubGlrZWx5KChOVUxMID09IHBQYWNrZXQpIHx8IChOVUxMID09IHBEYXRhKSkpCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgIlZQS1QgWyVkXTogTlVMTCBwb2ludGVyIiwgX19MSU5FX18pOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgIH0KKworICAgLy8gVmFsaWRhdGUgdGhhdCB0aGlzIGlzIHJlYWxseSBhbiBpbml0aWFsaXplZCB2b3MgcGFja2V0CisgICBpZiAodW5saWtlbHkoVlBLVF9NQUdJQ19OVU1CRVIgIT0gcFBhY2tldC0+bWFnaWMpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICJWUEtUIFslZF06IEludmFsaWQgbWFnaWMiLCBfX0xJTkVfXyk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICAvLyBnZXQgcG9pbnRlciB0byB0aGUgc2tiCisgICBza2IgPSBwUGFja2V0LT5wU2tiOworCisgICAvLyBWYWxpZGF0ZSB0aGUgc2tiCisgICBpZiAodW5saWtlbHkoTlVMTCA9PSBza2IpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICJWUEtUIFslZF06IE5VTEwgc2tiIiwgX19MSU5FX18pOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgIH0KKworICAgLy8gTWFrZSBzdXJlIHRoZXJlIGlzIGVub3VnaCBkYXRhIHRvIHBvcAorICAgaWYgKHVubGlrZWx5KHNrYi0+bGVuIDwgZGF0YVNpemUpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgIlZQS1QgWyVkXTogcG9wIGV4Y2VlZHMgcGFja2V0IHNpemUsIGxlblslZF0sIHJlcVslZF0iLAorICAgICAgICAgICAgICAgIF9fTElORV9fLCBza2ItPmxlbiwgZGF0YVNpemUpOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgIH0KKworICAgLy8gY29weSB0aGUgZGF0YQorICAgdm9zX21lbV9jb3B5KHBEYXRhLCBza2ItPmRhdGEsIGRhdGFTaXplKTsKKyAgIHNrYl9wdWxsKHNrYiwgZGF0YVNpemUpOworCisgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfQorCisKKy8qKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgXGJyaWVmIHZvc19wa3RfdHJpb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3IKKyAgICAgICAgICAgICAgICAgICAgdm9zX3BrdF9leHRyYWN0X2RhdGEoKSB0byBnZXQgYSBjb3B5IG9mIHRoZSBkYXRhLgorCisgIFxyZXR1cm4KKworICBcc2EKKworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworVk9TX1NUQVRVUyB2b3NfcGt0X3RyaW1faGVhZCggdm9zX3BrdF90ICpwUGFja2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9TSVpFX3QgZGF0YVNpemUgKQoreworICAgc3RydWN0IHNrX2J1ZmYgKnNrYjsKKworICAgLy8gVmFsaWRhdGUgdGhlIHBhcmFtZXRlciBwb2ludGVycworICAgaWYgKHVubGlrZWx5KE5VTEwgPT0gcFBhY2tldCkpCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgIlZQS1QgWyVkXTogTlVMTCBwb2ludGVyIiwgX19MSU5FX18pOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgIH0KKworICAgLy8gVmFsaWRhdGUgdGhhdCB0aGlzIGlzIHJlYWxseSBhbiBpbml0aWFsaXplZCB2b3MgcGFja2V0CisgICBpZiAodW5saWtlbHkoVlBLVF9NQUdJQ19OVU1CRVIgIT0gcFBhY2tldC0+bWFnaWMpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICJWUEtUIFslZF06IEludmFsaWQgbWFnaWMiLCBfX0xJTkVfXyk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICAvLyBnZXQgcG9pbnRlciB0byB0a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JuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgIH0KKworICAgLy8gVmFsaWRhdGUgdGhhdCB0aGlzIGlzIHJlYWxseSBhbiBpbml0aWFsaXplZCB2b3MgcGFja2V0CisgICBpZiAodW5saWtlbHkoVlBLVF9NQUdJQ19OVU1CRVIgIT0gcFBhY2tldC0+bWFnaWMpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICJWUEtUIFslZF06IEludmFsaWQgbWFnaWMiLCBfX0xJTkVfXyk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICAvLyBnZXQgcG9pbnRlciB0byB0aGUgc2tiCisgICBza2IgPSBwUGFja2V0LT5wU2tiOworCisgICAvLyBWYWxpZGF0ZSB0aGUgc2tiCisgICBpZiAodW5saWtlbHkoTlVMTCA9PSBza2IpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICJWUEtUIFslZF06IE5VTEwgc2tiIiwgX19MSU5FX18pOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgIH0KKworICAgLy8gTWFrZSBzdXJlIHRoZXJlIGlzIHRhaWxyb29tLiAgQXMgYSBwZXJmb3JtYW5jZSBvcHRpbWl6YXRpb24gd2UKKyAgIC8vIGNhbiBvbWl0IHRoaXMgY2hlY2sgbGF0ZXIgc2luY2Ugc2tiX3B1dCgpIHdpbGwgYWxzbyBwZXJmb3JtIHRoZQorICAgLy8gY2hlY2sgKGV4Y2VwdCBza2JfcHV0KCkgd2lsbCBwYW5pYyB0aGUga2VybmVsKQorICAgaWYgKHVubGlrZWx5KHNrYl90YWlscm9vbShza2IpIDwgZGF0YVNpemUpKQorICAgeworICAgICAgVk9TX1RSQ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gICAgICAgICAgICAgICAgdl9TSVpFX3QgZGF0YVNpemUgKQoreworICAgc3RydWN0IHNrX2J1ZmYgKnNrYjsKKworICAgLy8gVmFsaWRhdGUgdGhlIHBhcmFtZXRlciBwb2ludGVycworICAgaWYgKHVubGlrZWx5KChOVUxMID09IHBQYWNrZXQpIHx8IChOVUxMID09IHBEYXRhKSkpCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgIlZQS1QgWyVkXTogTlVMTCBwb2ludGVyIiwgX19MSU5FX18pOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgIH0KKworICAgLy8gVmFsaWRhdGUgdGhhdCB0aGlzIGlzIHJlYWxseSBhbiBpbml0aWFsaXplZCB2b3MgcGFja2V0CisgICBpZiAodW5saWtlbHkoVlBLVF9NQUdJQ19OVU1CRVIgIT0gcFBhY2tldC0+bWFnaWMpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICJWUEtUIFslZF06IEludmFsaWQgbWFnaWMiLCBfX0xJTkVfXyk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICAvLyBnZXQgcG9pbnRlciB0byB0aGUgc2tiCisgICBza2IgPSBwUGFja2V0LT5wU2tiOworCisgICAvLyBWYWxpZGF0ZSB0aGUgc2tiCisgICBpZiAodW5saWtlbHkoTlVMTCA9PSBza2IpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICJWUEtUIFslZF06IE5VTEwgc2tiIiwgX19MSU5FX18pOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9J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TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgIlZQS1QgWyVkXTogTlVMTCBwb2ludGVyIiwgX19MSU5FX18pOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgIH0KKworICAgLy8gVmFsaWRhdGUgdGhhdCB0aGlzIGlzIHJlYWxseSBhbiBpbml0aWFsaXplZCB2b3MgcGFja2V0CisgICBpZiAodW5saWtlbHkoVlBLVF9NQUdJQ19OVU1CRVIgIT0gcFBhY2tldC0+bWFnaWMpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICJWUEtUIFslZF06IEludmFsaWQgbWFnaWMiLCBfX0xJTkVfXyk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICAvLyBnZXQgcG9pbnRlciB0byB0aGUgc2tiCisgICBza2IgPSBwUGFja2V0LT5wU2tiOworCisgICAvLyBWYWxpZGF0ZSB0aGUgc2tiCisgICBpZiAodW5saWtlbHkoTlVMTCA9PSBza2IpKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICJWUEtUIFslZF06IE5VTEwgc2tiIiwgX19MSU5FX18pOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgIH0KKworICAgLy8gYWRqdXN0IHBvaW50ZXJzICh0aGVyZSBpc24ndCBhIG5hdGl2ZSBMaW51eCBBUEkgZm9yIHRoaXMpCisgICAvLyA/PyAtIGlzIHRoaXMgc3VmZmljaWVudD8gCisgICBza2Jfc2V0X3RhaWxfcG9pbnRlcihza2IsIHBrdExlbik7CisgICBza2ItPmxlbiAgID0gcGt0TGVuOworCisg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gICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgcExpc3QgPSAmZ3BWb3NQYWNrZXRDb250ZXh0LT50eERhdGFGcmVlTGlzdDsKKyAgICAgICAgIG1sb2NrID0gJmdwVm9zUGFja2V0Q29udGV4dC0+dHhEYXRhRnJlZUxpc3RMb2NrOworICAgICAgfQorICAgICAgYnJlYWs7CisKKyAgIGNhc2UgVk9TX1BLVF9UWVBFX1JYX1JBVzoKKyAgICAgIC8vIGlmIHRoZSBjYWxsZXIgaXMgY3VyaW91cyBob3cgbWFueSByYXcgcGFja2V0cyBhcmUgYXZhaWxhYmxlCisgICAgICAvLyB0aGVuIGhlIHByb2JhYmx5IHdhbnRzIGFzIG1hbnkgcGFja2V0cyB0byBiZSBhdmFpbGFibGUgYXMKKyAgICAgIC8vIHBvc3NpYmxlIHNvIHJlcGxlbmlzaCB0aGUgcmF3IHBvb2wKKyAgICAgIHZvc19wa3RpX3JlcGxlbmlzaF9yYXdfcG9vbCgpOworICAgICAgLy8gUmV0dXJuIHRoZSBwcmUtY2FsY3VsYXRlZCBjb3VudCAncnhSYXdGcmVlTGlzdENvdW50JworICAgICAgKnZvc0ZyZWVCdWZmZXIgPSBncFZvc1BhY2tldENvbnRleHQtPnJ4UmF3RnJlZUxpc3RDb3VudDsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICAgICBicmVhazsKKworICAgZGVmYXVsdDoKKyAgICAgIHJldHVybiAoVk9TX1NUQVRVU19FX0lOVkFMKTsKKyAgIH0KKworICAgY291bnQgPSAwOworICAgbXV0ZXhfbG9jayhtbG9jayk7CisgICBsaXN0X2Zvcl9lYWNoKHBOb2RlLCBwTGlzdCkKKyAgIHsKKyAgICAgIGNvdW50Kys7CisgICB9CisgICBtdXRleF91bmxvY2sobWxvY2spOworICAgKnZvc0ZyZWVCdWZmZXIgPSBjb3VudDsKKyAgIHJldHV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MTCA9PSBwc2tiKQorICAgeworICAgICAgcmV0dXJuIHBrdF9wcm90b190eXBlOworICAgfQorICAgZWxzZQorICAgeworICAgICAgc2tiID0gKHN0cnVjdCBza19idWZmICopcHNrYjsKKyAgIH0KKworICAgLyogRUFQT0wgVHJhY2tpbmcgZW5hYmxlZCAqLworICAgaWYgKFZPU19QS1RfUFJPVE9fVFlQRV9FQVBPTCAmIHRyYWNraW5nX21hcCkKKyAgIHsKKyAgICAgIGV0aGVyX3R5cGUgPSAodl9VMTZfdCkoKih2X1UxNl90ICopKHNrYi0+ZGF0YSArIFZPU19QS1RfUFJPVF9FVEhfVFlQRV9PRkZTRVQpKTsKKyAgICAgIGlmIChWT1NfUEtUX1BST1RfRUFQT0xfRVRIX1RZUEUgPT0gVk9TX1NXQVBfVTE2KGV0aGVyX3R5cGUpKQorICAgICAgeworICAgICAgICAgcGt0X3Byb3RvX3R5cGUgfD0gVk9TX1BLVF9QUk9UT19UWVBFX0VBUE9MOworICAgICAgfQorICAgfQorCisgICAvKiBBUlAgVHJhY2tpbmcgRW5hYmxlZCAqLworICAgaWYgKFZPU19QS1RfUFJPVE9fVFlQRV9BUlAgJiB0cmFja2luZ19tYXApCisgICB7CisgICAgICBldGhlcl90eXBlID0gKHZfVTE2X3QpKCoodl9VMTZfdCAqKShza2ItPmRhdGEgKyBWT1NfUEtUX1BST1RfRVRIX1RZUEVfT0ZGU0VUKSk7CisgICAgICBpZiAoVk9TX1BLVF9QUk9UX0FSUF9FVEhfVFlQRSA9PSBWT1NfU1dBUF9VMTYoZXRoZXJfdHlwZSkpCisgICAgICB7CisgICAgICAgICBwa3RfcHJvdG9fdHlwZSB8PSBWT1NfUEtUX1BST1RPX1RZUEVfQVJQOworICAgICAgfQorICAgfQorCisgICAvKiBESENQIFRyYWNraW5nIGVuYWJsZWQgKi8KKyAgIGlmIChWT1NfUEtUX1BST1RPX1RZUEVfREhDUCAmIHRyYWNraW5nX21hcCkKKyAgIHsKKyAgICAgIFNQb3J0ID0gKHZfVTE2X3QpKCoodl9VMTZfdCAqKShza2ItPmRhdGEgKyBWT1NfUEtUX1BST1RfSVBfT0ZGU0VUICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfUEtUX1BST1RfSVBfSEVBREVSX1NJWkUpKTsKKyAgICAgIERQb3J0ID0gKHZfVTE2X3QpKCoodl9VMTZfdCAqKShza2ItPmRhdGEgKyBWT1NfUEtUX1BST1RfSVBfT0ZGU0VUICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfUEtUX1BST1RfSVBfSEVBREVSX1NJWkUgKyBzaXplb2Yodl9VMTZfdCkpKTsKKyAgICAgIGlmICgoKFZPU19QS1RfUFJPVF9ESENQX1NSVl9QT1JUID09IFZPU19TV0FQX1UxNihTUG9ydCkpICYmCisgICAgICAgICAgIChWT1NfUEtUX1BST1RfREhDUF9DTElfUE9SVCA9PSBWT1NfU1dBUF9VMTYoRFBvcnQpKSkgfHwKKyAgICAgICAgICAoKFZPU19QS1RfUFJPVF9ESENQX0NMSV9QT1JUID09IFZPU19TV0FQX1UxNihTUG9ydCkpICYmCisgICAgICAgICAgIChWT1NfUEtUX1BST1RfREhDUF9TUlZfUE9SVCA9PSBWT1NfU1dBUF9VMTYoRFBvcnQpKSkpCisgICAgICB7CisgICAgICAgICBwa3RfcHJvdG9fdHlwZSB8PSBWT1NfUEtUX1BST1RPX1RZUEVfREhDUDsKKyAgICAgIH0KKyAgIH0KKworICAgLyogUHJvdG9jb2wgdHlwZSBtYXAgKi8KKyAgIHJldHVybiBwa3RfcHJvdG9fdHlwZTsKK30KKwordl9QVk9JRF90IHZvc19nZXRfcGt0X2hlYWQodm9zX3BrdF90ICpwUGFja2V0KQoreworICAgc3RydWN0IHNrX2J1ZmYgKnNrYjsKKworICAgLy8gVmFsaWRhdGUgdGhlIHBhcmFtZXRlciBwb2ludGVycworICAgaWYgKHVubGlrZWx5KE5VTEwgPT0gcFBhY2tldCkpC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HRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEBmaWxlIHZvc19zY2hlZC5jCisgIEBicmllZiBWT1MgU2NoZWR1bGVyIEltcGxlbWVudGF0aW9uCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgICAgICAgICAgICAgICAgICBFRElUIEhJU1RPUlkgRk9SIEZJTEUKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworICAkSGVhZGVyOiQgJERhdGVUaW1lOiAkICRBdXRob3I6ICQKKworICB3aGVuICAgICAgICB3aG8gICAgd2hhdCwgd2hlcmUsIHdoeQorICAtLS0tLS0tLSAgICAtLS0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICogSW5jbHVkZSBGaWxlcworICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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ICAgICAgICIlczogQmFkIEFyZ3MgcGFzc2VkIiwgX19mdW5jX18pOworICAgICByZXR1cm4gMDsKKyAgfQorICBzZXRfdXNlcl9uaWNlKGN1cnJlbnQsIC0yKTsKKworI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPCBLRVJORUxfVkVSU0lPTigzLDgsMCkpCisgIGRhZW1vbml6ZSgiTUNfVGhyZWFkIik7CisjZW5kaWYKKworICAvKgorICAqKiBBY2sgYmFjayB0byB0aGUgY29udGV4dCBmcm9tIHdoaWNoIHRoZSBtYWluIGNvbnRyb2xsZXIgdGhyZWFkIGhhcyBiZWVuCisgICoqIGNyZWF0ZWQuCisgICovCisgIGNvbXBsZXRlKCZwU2NoZWRDb250ZXh0LT5NY1N0YXJ0RXZlbnQpOworICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICIlczogTUMgVGhyZWFkICVkICglcykgc3RhcnRpbmcgdXAiLF9fZnVuY19fLCBjdXJyZW50LT5waWQsIGN1cnJlbnQtPmNvbW0pOworCisgIC8qIEdldCB0aGUgR2xvYmFsIFZPU1MgQ29udGV4dCAqLworICBwVm9zQ29udGV4dCA9IHZvc19nZXRfZ2xvYmFsX2NvbnRleHQoVk9TX01PRFVMRV9JRF9TWVMsIE5VTEwpOworICBpZighcFZvc0NvbnRleHQpIHsKKyAgICAgaGRkTG9nKFZPU19UUkFDRV9MRVZFTF9GQVRBTCwiJXM6IEdsb2JhbCBWT1MgY29udGV4dCBpcyBOdWxsIiwgX19mdW5jX18pOworICAgICByZXR1cm4gMDsKKyAgfQorCisgIC8qIEdldCB0aGUgSEREIGNvbnRleHQgKi8KKyAgcEhkZEN0eCA9IChoZGRfY29udGV4dF90ICopdm9zX2dldF9jb250ZXh0KFZPU19NT0RVTEVfSURfSERELCBwVm9zQ29udGV4dCApOworICBpZighcEhkZEN0eCkgeworICAgICBoZGRMb2coVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLCIlczogSEREIGNvbnRleHQgaXMgTnVsbCIsX19mdW5jX18pOworICAgICByZXR1cm4gMDsKKyAgfQorCisgIHdoaWxlKCFzaHV0ZG93bikKKyAgeworICAgIC8vIFRoaXMgaW1wbGVtZW50cyB0aGUgZXhlY3V0aW9uIG1vZGVsIGFsZ29yaXRobQorICAgIHJldFdhaXRTdGF0dXMgPSB3YWl0X2V2ZW50X2ludGVycnVwdGlibGUocFNjaGVkQ29udGV4dC0+bWNXYWl0UXVldWUsCisgICAgICAgdGVzdF9iaXQoTUNfUE9TVF9FVkVOVCwgJnBTY2hlZENvbnRleHQtPm1jRXZlbnRGbGFnKSB8fAorICAgICAgIHRlc3RfYml0KE1DX1NVU1BFTkRfRVZFTlQsICZwU2NoZWRDb250ZXh0LT5tY0V2ZW50RmxhZykpOworCisgICAgaWYocmV0V2FpdFN0YXR1cyA9PSAtRVJFU1RBUlRTWVMpCisgICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgIiVzOiB3YWl0X2V2ZW50X2ludGVycnVwdGlibGUgcmV0dXJuZWQgLUVSRVNUQVJUU1lTIiwgX19mdW5jX18pOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNsZWFyX2JpdChNQ19QT1NUX0VWRU5ULCAmcFNjaGVkQ29udGV4dC0+bWNFdmVudEZsYWcpOworCisgICAgd2hpbGUoMSkKKyAgICB7CisgICAgICAvLyBDaGVjayBpZiBNQyBuZWVkcyB0byBzaHV0ZG93bgorICAgICAgaWYodGVzdF9iaXQoTUNfU0hVVERPV05fRVZFTlQsICZwU2NoZWRDb250ZXh0LT5tY0V2ZW50RmxhZykpCisgICAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICIlczogTUMgdGhyZWFkIHNpZ25hbGVkIHRvIHNodXRkb3duIiwgX19mdW5jX18pOworICAgICAgICBzaHV0ZG93biA9IFZPU19UUlVFOworICAgICAgICAvKiBDaGVjayBmb3IgYW55IFN1c3BlbmQgSW5kaWNhdGlvbiAqLworICAgICAgICBpZiAodGVzdF9hbmRfY2xlYXJfYml0KE1DX1NVU1BFTkRfRVZFTlQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBTY2hlZENvbnRleHQtPm1jRXZlbnRGbGFnKSkKKyAgICAgICAgeworICAgICAgICAgICAvKiBVbmJsb2NrIGFueW9uZSB3YWl0aW5nIG9uIHN1c3BlbmQgKi8KKyAgICAgICAgICAgY29tcGxldGUoJnBIZGRDdHgtPm1jX3N1c19ldmVudF92YXIpOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgLyoKKyAgICAgICoqIENoZWNrIHRoZSBXREkgcXVldWUKKyAgICAgICoqIFNlcnZpY2UgaXQgdGlsbCB0aGUgZW50aXJlIHF1ZXVlIGlzIGVtcHR5CisgICAgICAqLworICAgICAgaWYgKCF2b3NfaXNfbXFfZW1wdHkoJnBTY2hlZENvbnRleHQtPndkaU1jTXEpKQorICAgICAgeworICAgICAgICB3cHRfbXNnICpwV2RpTXNnOworICAgICAgICAvKgorICAgICAgICAqKiBTZXJ2aWNlIHRoZSBXREkgbWVzc2FnZSBxdWV1ZQorICAgICAgICAqLworICAgICAgICBwTXNnV3JhcHBlciA9IHZvc19tcV9nZXQoJnBTY2hlZENvbnRleHQtPndkaU1jTXEpOworCisgICAgICAgIGlmIChwTXNnV3JhcHBlciA9PSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICIlczogcE1zZ1dyYXBwZXIgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgVk9TX0JVRygwKTsKKyAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBwV2RpTXNnID0gKHdwdF9tc2cgKilwTXNnV3JhcHBlci0+cFZvc01zZy0+Ym9keXB0cjsKKworICAgICAgICBpZihwV2RpTXNnID09IE5VTEwgfHwgcFdkaU1zZy0+Y2FsbGJhY2sgPT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiJXM6IFdESSBNc2cgb3IgQ2FsbGJhY2sgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgVk9TX0JVRygwKTsKKyAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBwV2RpTXNnLT5jYWxsYmFjayhwV2RpTXNnKTsKKworICAgICAgICAvKiAKKyAgICAgICAgKiogcmV0dXJuIG1lc3NhZ2UgdG8gdGhlIENvcmUKKyAgICAgICAgKi8KKyAgICAgICAgdm9zX2NvcmVfcmV0dXJuX21zZyhwU2NoZWRDb250ZXh0LT5wVkNvbnRleHQsIHBNc2dXcmFwcGVyKTsKKworICAgICAgICBjb250aW51ZTsKKyAgICAgIH0KKworICAgICAgLy8gQ2hlY2sgdGhlIFNZUyBxdWV1ZSBmaXJzdAorICAgICAgaWYgKCF2b3NfaXNfbXFfZW1wdHkoJnBTY2hlZENvbnRleHQtPnN5c01jTXEpKQorICAgICAgeworICAgICAgICAvLyBTZXJ2aWNlIHRoZSBTWVMgbWVzc2FnZSBxdWV1ZQorICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICIlczogU2VydmljaW5nIHRoZSBWT1MgU1lTIE1DIE1lc3NhZ2UgcXVldWUiLF9fZnVuY19fKTsKKyAgICAgICAgcE1zZ1dyYXBwZXIgPSB2b3NfbXFfZ2V0KCZwU2NoZWRDb250ZXh0LT5zeXNNY01xKTsKKyAgICAgICAgaWYgKHBNc2dXcmFwcGVyID09IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAiJXM6IHBNc2dXcmFwcGVyIGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIHZTdGF0dXMgPSBzeXNNY1Byb2Nlc3NNc2cocFNjaGVkQ29udGV4dC0+cFZDb250ZXh0LAorICAgICAgICAgICBwTXNnV3JhcHBlci0+cFZvc01zZyk7CisgICAgICAgIGlmICghVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZTdGF0dXMpKQorICAgICAgICB7CisgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAiJXM6IElzc3VlIFByb2Nlc3NpbmcgU1lTIG1lc3NhZ2UiLF9fZnVuY19fKTsKKyAgICAgICAgfQorICAgICAgICAvL3JldHVybiBtZXNzYWdlIHRvIHRoZSBDb3JlCisgICAgICAgIHZvc19jb3JlX3JldHVybl9tc2cocFNjaGVkQ29udGV4dC0+cFZDb250ZXh0LCBwTXNnV3JhcHBlcik7CisgICAgICAgIGNvbnRpbnVlOworICAgICAgfQorICAgICAgLy8gQ2hlY2sgdGhlIFdEQSBxdWV1ZQorICAgICAgaWYgKCF2b3NfaXNfbXFfZW1wdHkoJnBTY2hlZENvbnRleHQtPndkYU1jTXEpKQorICAgICAgeworICAgICAgICAvLyBTZXJ2aWNlIHRoZSBXREEgbWVzc2FnZSBxdWV1ZQorICAgICAgICBWT1NfVFJBQ0UoV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gcXVldWUKKyAgICAgIGlmICghdm9zX2lzX21xX2VtcHR5KCZwU2NoZWRDb250ZXh0LT5wZU1jTXEpKQorICAgICAgeworICAgICAgICAvLyBTZXJ2aWNlIHRoZSBQRSBtZXNzYWdlIHF1ZXVlCisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgIiVzOiBTZXJ2aWNpbmcgdGhlIFZPUyBQRSBNQyBNZXNzYWdlIHF1ZXVlIixfX2Z1bmNfXyk7CisgICAgICAgIHBNc2dXcmFwcGVyID0gdm9zX21xX2dldCgmcFNjaGVkQ29udGV4dC0+cGVNY01xKTsKKyAgICAgICAgaWYgKE5VTEwgPT0gcE1zZ1dyYXBwZXIpCisgICAgICAgIHsKKyAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAiJXM6IHBNc2dXcmFwcGVyIGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgLyogTmVlZCBzb21lIG9wdGltaXphdGlvbiovCisgICAgICAgIHBNYWNDb250ZXh0ID0gdm9zX2dldF9jb250ZXh0KFZPU19NT0RVTEVfSURfUEUsIHBTY2hlZENvbnRleHQtPnBWQ29udGV4dCk7CisgICAgICAgIGlmIChOVUxMID09IHBNYWNDb250ZXh0KQorICAgICAgICB7CisgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgIk1BQyBDb250ZXh0IG5vdCByZWFkeSB5ZXQiKTsKKyAgICAgICAgICAgdm9zX2NvcmVfcmV0dXJuX21zZyhwU2NoZWRDb250ZXh0LT5wVkNvbnRleHQsIHBNc2dXcmFwcGVyKTsKKyAgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKworICAgICAgICBtYWNTdGF0dXMgPSBwZVByb2Nlc3NNZXNzYWdlcyggcE1hY0NvbnRleHQsICh0U2lyTXNnUSopcE1zZ1dyYXBwZXItPnBWb3NNc2cpOworICAgICAgICBpZiAoZVNJUl9TVUNDRVNTICE9IG1hY1N0YXR1cykKKyAgICAgICAgeworICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAiJXM6IElzc3VlIFByb2Nlc3NpbmcgUEUgbWVzc2FnZSIsX19mdW5jX18pOworICAgICAgICB9CisgICAgICAgIC8vIHJldHVybiBtZXNzYWdlIHRvIHRoZSBDb3JlCisgICAgICAgIHZvc19jb3JlX3JldHVybl9tc2cocFNjaGVkQ29udGV4dC0+cFZDb250ZXh0LCBwTXNnV3JhcHBlcik7CisgICAgICAgIGNvbnRpbnVlOworICAgICAgfQorICAgICAgLyoqIENoZWNrIHRoZSBTTUUgcXVldWUgKiovCisgICAgICBpZiAoIXZvc19pc19tcV9lbXB0eSgmcFNjaGVkQ29udGV4dC0+c21lTWNNcSkpCisgICAgICB7CisgICAgICAgIC8qIFNlcnZpY2UgdGhlIFNNRSBtZXNzYWdlIHF1ZXVlICovCisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgIiVzOiBTZXJ2aWNpbmcgdGhlIFZPUyBTTUUgTUMgTWVzc2FnZSBxdWV1ZSIsX19mdW5jX18pOworICAgICAgICBwTXNnV3JhcHBlciA9IHZvc19tcV9nZXQoJnBTY2hlZENvbnRleHQtPnNtZU1jTXEpOworICAgICAgICBpZiAoTlVMTCA9PSBwTXNnV3JhcHBlcikKKyAgICAgICAgeworICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiJXM6IHBNc2dXcmFwcGVyIGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgLyogTmVlZCBzb21lIG9wdGltaXphdGlvbiovCisgICAgICAgIHBNYWNDb250ZXh0ID0gdm9zX2dldF9jb250ZXh0KFZPU19NT0RVTEVfSURfU01FLCBwU2NoZWRDb250ZXh0LT5wVkNvbnRleHQpOworICAgICAgICBpZiAoTlVMTCA9PSBwTWFjQ29udGV4dCkKKyAgICAgICAgeworICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICJNQUMgQ29udGV4dCBub3QgcmVhZHkgeWV0Iik7CisgICAgICAgICAgIHZvc19jb3JlX3JldHVybl9tc2cocFNjaGVkQ29udGV4dC0+cFZDb250ZXh0LCBwTXNnV3JhcHBlcik7CisgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9CisKKyAgICAgICAgdlN0YXR1cyA9IHNtZV9Qcm9jZXNzTXNnKCAodEhhbEhhbmRsZSlwTWFjQ29udGV4dCwgcE1zZ1dyYXBwZXItPnBWb3NNc2cpOworICAgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2U3RhdHVzKSkKKyAgICAgICAgeworICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAiJXM6IElzc3VlIFByb2Nlc3NpbmcgU01FIG1lc3NhZ2UiLF9fZnVuY19fKTsKKyAgICAgICAgfQor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Db3VudCAlZCBSWCBjb3VudCAlZCBUWCBjb3VudCAlZCIpLAorICAgICAgICBncFZvc1dhdGNoZG9nQ29udGV4dC0+bWNUaHJlYWRTdHVja0NvdW50LAorICAgICAgICBncFZvc1dhdGNoZG9nQ29udGV4dC0+cnhUaHJlYWRTdHVja0NvdW50LAorICAgICAgICBncFZvc1dhdGNoZG9nQ29udGV4dC0+dHhUaHJlYWRTdHVja0NvdW50KTsKKworICAgICBpZiAoZ3BWb3NXYXRjaGRvZ0NvbnRleHQtPm1jVGhyZWFkU3R1Y2tDb3VudCkKKyAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEludm9raW5nIGR1bXAgc3RhY2sgZm9yIE1DIHRocmVhZCIsX19mdW5jX18pOworICAgICAgICAgdm9zX2R1bXBfc3RhY2soTUNfVGhyZWFkKTsKKyAgICAgfQorICAgICBpZiAoZ3BWb3NXYXRjaGRvZ0NvbnRleHQtPnR4VGhyZWFkU3R1Y2tDb3VudCkKKyAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEludm9raW5nIGR1bXAgc3RhY2sgZm9yIFRYIHRocmVhZCIsX19mdW5jX18pOworICAgICAgICAgdm9zX2R1bXBfc3RhY2soVFhfVGhyZWFkKTsKKyAgICAgfQorICAgICBpZiAoZ3BWb3NXYXRjaGRvZ0NvbnRleHQtPnJ4VGhyZWFkU3R1Y2tDb3VudCkKKyAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IEludm9raW5nIGR1b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R1cm4gMDsKKyAgfQorCisgIC8qIEdldCB0aGUgSEREIGNvbnRleHQgKi8KKyAgcEhkZEN0eCA9IChoZGRfY29udGV4dF90ICopdm9zX2dldF9jb250ZXh0KFZPU19NT0RVTEVfSURfSERELCBwVm9zQ29udGV4dCApOworCisgIGlmKCFwSGRkQ3R4KQorICB7CisgICAgIGhkZExvZyhWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsIiVzOiBIREQgY29udGV4dCBpcyBOdWxsIixfX2Z1bmNfXyk7CisgICAgIHJldHVybiAwOworICB9CisKKyNpZiAoTElOVVhfVkVSU0lPTl9DT0RFIDwgS0VSTkVMX1ZFUlNJT04oMyw4LDApKQorICBkYWVtb25pemUoIldEX1RocmVhZCIpOworI2VuZGlmCisgIC8qIEluaXRpYWxpemUgdGhlIHRpbWVyIHRvIGRldGVjdCB0aHJlYWQgc3R1Y2sgaXNzdWVzICovCisgIGlmICh2b3NfdGltZXJfaW5pdF9kZWZlcnJhYmxlKCZwV2RDb250ZXh0LT50aHJlYWRTdHVja1RpbWVyLAorICAgICAgICAgIFZPU19USU1FUl9UWVBFX1NXLAorICAgICAgICAgIHZvc193ZF9kZXRlY3RfdGhyZWFkX3N0dWNrX2NiLCBOVUxMKSkgeworICAgICAgIGhkZExvZyhMT0dFLCBGTCgiVW5hYmxlIHRvIGluaXRpYWxpemUgdGhyZWFkIHN0dWNrIHRpbWVyIikpOworICB9CisgIGVsc2UKKyAgeworICAgICAgIGlmIChWT1NfU1RBVFVTX1NVQ0NFU1MgIT0KKyAgICAgICAgICAgICB2b3NfdGltZXJfc3RhcnQoJnBXZENvbnRleHQtPnRocmVhZFN0dWNrVGltZXIsCisgICAgICAgICAgICAgICAgIFRIUkVBRF9TVFVDS19USU1FUl9WQUwpKQorICAgICAgICAgIGhkZExvZyhMT0dFLCBGTCgiVW5hYmxlIHRvIHN0YXJ0IHRocmVhZCBzdHVjayB0aW1lciIpKTsKKyAgICAgICBlbHNlCisgICAgICAgICAgaGRkTG9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7CisgICAgd2hpbGUoMSkKKyAgICB7CisgICAgICAvKiBDaGVjayBmb3IgYW55IEFjdGl2ZSBFbnRyeSBQb2ludHMKKyAgICAgICAqIElmIGFjdGl2ZSwgZGVsYXkgU1NSIHVudGlsIG5vIGVudHJ5IHBvaW50IGlzIGFjdGl2ZSBvcgorICAgICAgICogZGVsYXkgdW50aWwgY291bnQgaXMgZGVjcmVtZW50ZWQgdG8gWkVSTworICAgICAgICovCisgICAgICBjb3VudCA9IE1BWF9TU1JfV0FJVF9JVEVSQVRJT05TOworICAgICAgd2hpbGUgKGNvdW50KQorICAgICAgeworICAgICAgICAgaWYgKCFhdG9taWNfcmVhZCgmc3NyX3Byb3RlY3RfZW50cnlfY291bnQpKQorICAgICAgICAgeworICAgICAgICAgICAgIC8qIG5vIGV4dGVybmFsIHRocmVhZHMgYXJlIGV4ZWN1dGluZyAqLworICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgfQorICAgICAgICAgLyogYXQgbGVhc3Qgb25lIGV4dGVybmFsIHRocmVhZCBpcyBleGVjdXRpbmcgKi8KKyAgICAgICAgIGlmICgtLWNvdW50KQorICAgICAgICAgeworICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBXYWl0aW5nIGZvciBhY3RpdmUgZW50cnkgcG9pbnRzIHRvIGV4aXQiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgbXNsZWVwKFNTUl9XQUlUX1NMRUVQX1RJTUUpOworICAgICAgICAgfQorICAgICAgfQorICAgICAgLyogYXQgbGVhc3Qgb25lIGV4dGVybmFsIHRocmVhZCBpcyBleGVjdXRpbmcgKi8KKyAgICAgIGlmICghY291bnQpCisgICAgICB7CisgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiJXM6IENvbnRpbnVpbmcgU1NSIHdoZW4gJWQgRW50cnkgcG9pbnRzIGFyZSBzdGlsbCBhY3RpdmUiLAorICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIGF0b21pY19yZWFkKCZzc3JfcHJvdGVjdF9lbnRyeV9jb3VudCkpOworICAgICAgfQorICAgICAgLy8gQ2hlY2sgaWYgV2F0Y2hkb2cgbmVlZHMgdG8gc2h1dGRvd24KKyAgICAgIGlmKHRlc3RfYml0KFdEX1NIVVRET1dOX0VWRU5ULCAmcFdkQ29udGV4dC0+d2RFdmVudEZsYWcpKQorICAgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAiJXM6IFdhdGNoZG9nIHRocmVhZCBzaWduYWxlZCB0byBzaHV0ZG93biIsIF9fZnVuY19fKTsKKyAgICAgICAgY2xlYXJfYml0KFdEX1NIVVRET1dOX0VWRU5ULCAmcFdkQ29udGV4dC0+d2RFdmVudEZsYWcpOworICAgICAgICBzaHV0ZG93biA9IFZPU19UUlVFOworICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIC8qIHN1YnN5c3RlbSByZXN0YXJ0OiBzaHV0ZG93biBldmVudCBoYW5kbGVyICovCisgICAgICBlbHNlIGlmKHRlc3RfYml0KFdEX1dMQU5fU0hVVERPV05fRVZFTlQsICZwV2RDb250ZXh0LT53ZEV2ZW50RmxhZykpCisgICAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAiJXM6IFdhdGNoZG9nIHRocmVhZCBzaWduYWxlZCB0byBwZXJmb3JtIFdMQU4gc2h1dGRvd24iLF9fZnVuY19fKTsKKyAgICAgICAgY2xlYXJfYml0KFdEX1dMQU5fU0hVVERPV05fRVZFTlQsICZwV2RDb250ZXh0LT53ZEV2ZW50RmxhZyk7CisKKyAgICAgICAgLy9QZXJmb3JtIFdMQU4gc2h1dGRvd24KKyAgICAgICAgaWYoIXBXZENvbnRleHQtPnJlc2V0SW5Qcm9ncmVzcykKKyAgICAgICAgeworICAgICAgICAgIHBXZENvbnRleHQtPnJlc2V0SW5Qcm9ncmVzcyA9IHRydWU7CisgICAgICAgICAgdm9zU3RhdHVzID0gaGRkX3dsYW5fc2h1dGRvd24oKTsKKworICAgICAgICAgIGlmICghIFZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgICAiJXM6IEZhaWxlZCB0byBzaHV0ZG93biBXTEFOIixfX2Z1bmNfXyk7CisgICAgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgICAgICBnb3RvIGVycl9yZXNldDsKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIC8qIHN1YnN5c3RlbSByZXN0YXJ0OiByZS1pbml0IGV2ZW50IGhhbmRsZXIgKi8KKyAgICAgIGVsc2UgaWYodGVzdF9iaXQoV0RfV0xBTl9SRUlOSVRfRVZFTlQsICZwV2RDb250ZXh0LT53ZEV2ZW50RmxhZykpCisgICAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAiJXM6IFdhdGNoZG9nIHRocmVhZCBzaWduYWxlZCB0byBwZXJmb3JtIFdMQU4gcmUtaW5pdCIsX19mdW5jX18pOworICAgICAgICBjbGVhcl9iaXQoV0RfV0xBTl9SRUlOSVRfRVZFTlQsICZwV2RDb250ZXh0LT53ZEV2ZW50RmxhZyk7CisKKyAgICAgICAgLy9QZXJmb3JtIFdMQU4gcmUtaW5pdAorICAgICAgICBpZighcFdkQ29udGV4dC0+cmVzZXRJblByb2dyZXNzKQorICAgICAgICB7CisgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICIlczogRG8gV0xBTiByZS1pbml0IG9ubHkgd2hlbiBpdCBpcyBzaHV0ZG93biAhISIsX19mdW5jX18pOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIHZvc1N0YXR1cyA9IGhkZF93bGFuX3JlX2luaXQoKTsKKworICAgICAgICBpZiAoISBWT1NfSVNfU1RBVFVTX1NVQ0NFU1Modm9zU3RhdHVzKSkKKyAgICAgICAgeworICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICIlczogRmFpbGVkIHRvIHJlLWluaXQgV0xBTiIsX19mdW5jX18pOworICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgcFdkQ29udGV4dC0+aXNGYXRhbEVycm9yID0gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICBwV2RDb250ZXh0LT5pc0ZhdGFsRXJyb3IgPSBmYWxzZTsKKyAgICAgICAgICBwSGRkQ3R4LT5pc0xvZ3BJblByb2dyZXNzID0gRkFMU0U7CisgICAgICAgICAgdm9zX3NldF9sb2dwX2luX3Byb2dyZXNzKFZPU19NT0RVTEVfSURfVk9TUywgRkFMU0UpOworICAgICAgICB9CisgICAgICAgIGF0b21pY19zZXQoJnBIZGRDdHgtPmlzUmVzdGFydEluUHJvZ3Jlc3MsIDApOworICAgICAgICBwV2RDb250ZXh0LT5yZXNldEluUHJvZ3Jlc3MgPSBmYWxzZTsKKyAgICAgICAgY29tcGxldGUoJnBIZGRDdHgtPnNzcl9jb21wX3Zhcik7CisgICAgICB9CisgICAgICAvKiBQb3N0IE1zZyB0byBkZXRlY3QgdGhyZWFkIHN0dWNrICovCisgICAgICBlbHNlIGlmKHRlc3RfYW5kX2NsZWFyX2JpdChXRF9XTEFOX0RFVEVDVF9USFJFQURfU1RVQ0ssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFdkQ29udGV4dC0+d2RFdmVudEZsYWcpKQorICAgICAgeworICAgICAgICB2b3Nfd2RfZGV0ZWN0X3RocmVhZF9zdHVjaygpOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAvL1VubmVjZXNzYXJ5IHdha2V1cCAtIFNob3VsZCBuZXZlciBoYXBwZW4hIQorICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICIlczogV2F0Y2hkb2cgdGhyZWFkIHdva2UgdXAgdW5uZWNlc3NhcmlseSIsX19mdW5jX18pOworICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfSAvLyB3aGlsZSBtZXNzYWdlIGxvb3AgcHJvY2Vzc2luZworICB9IC8vIHdoaWxlIHNodXRkb3duCisKKyAgdm9zX3RpbWVyX2Rlc3Ryb3koJnBXZENvbnRleHQtPnRocmVhZFN0dWNrVGltZXIpOworICAvLyBJZiB3ZSBnZXQgaGVyZSB0aGUgV2F0Y2hkb2cgdGhyZWFkIG11c3QgZXhpdAorICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAiJXM6IFdhdGNoZG9nIFRocmVhZCBleGl0aW5nICEhISEiLCBfX2Z1bmNfXyk7CisgIGNvbXBsZXRlX2FuZF9leGl0KCZwV2RDb250ZXh0LT5XZFNodXRkb3duLCAwKTsKKworZXJyX3Jlc2V0OgorIC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X1BPU1RfRVZFTlQsICZwU2NoZWRDb250ZXh0LT50eEV2ZW50RmxhZyk7CisKKyAgICB3aGlsZSgxKQorICAgIHsKKyAgICAgIGlmKHRlc3RfYml0KFRYX1NIVVRET1dOX0VWRU5ULCAmcFNjaGVkQ29udGV4dC0+dHhFdmVudEZsYWcpKQorICAgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgIiVzOiBUWCB0aHJlYWQgc2lnbmFsZWQgdG8gc2h1dGRvd24iLCBfX2Z1bmNfXyk7CisgICAgICAgIHNodXRkb3duID0gVk9TX1RSVUU7CisgICAgICAgIC8qIENoZWNrIGZvciBhbnkgU3VzcGVuZCBJbmRpY2F0aW9uICovCisgICAgICAgIGlmICh0ZXN0X2FuZF9jbGVhcl9iaXQoVFhfU1VTUEVORF9FVkVOVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFNjaGVkQ29udGV4dC0+dHhFdmVudEZsYWcpKQorICAgICAgICB7CisgICAgICAgICAgIC8qIFVuYmxvY2sgYW55b25lIHdhaXRpbmcgb24gc3VzcGVuZCAqLworICAgICAgICAgICBjb21wbGV0ZSgmcEhkZEN0eC0+dHhfc3VzX2V2ZW50X3Zhcik7CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICAvLyBDaGVjayB0aGUgU1lTIHF1ZXVlIGZpcnN0CisgICAgICBpZiAoIXZvc19pc19tcV9lbXB0eSgmcFNjaGVkQ29udGV4dC0+c3lzVHhNcSkpCisgICAgICB7CisgICAgICAgIC8vIFNlcnZpY2UgdGhlIFNZUyBtZXNzYWdlIHF1ZXVlCisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICIlczogU2VydmljaW5nIHRoZSBWT1MgU1lTIFRYIE1lc3NhZ2UgcXVldWUiLF9fZnVuY19fKTsKKyAgICAgICAgcE1zZ1dyYXBwZXIgPSB2b3NfbXFfZ2V0KCZwU2NoZWRDb250ZXh0LT5zeXNUeE1xKTsKKyAgICAgICAgaWYgKHBNc2dXcmFwcGVyID09IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIiVzOiBwTXNnV3JhcHBlciBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICB2U3RhdHVzID0gc3lzVHhQcm9jZXNzTXNnKCBwU2NoZWRDb250ZXh0LT5wVkNvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNc2dXcmFwcGVyLT5wVm9zTXNnKTsKKyAgICAgICAgaWYgKCFWT1NfSVNfU1RBVFVTX1NVQ0NFU1ModlN0YXR1cykpCisgICAgICAgIHsKKyAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgIiVzOiBJc3N1ZSBQcm9jZXNzaW5nIFRYIFNZUyBtZXNzYWdlIixfX2Z1bmNfXyk7CisgICAgICAgIH0KKyAgICAgICAgLy8gcmV0dXJuIG1lc3NhZ2UgdG8gdGhlIENvcmUKKyAgICAgICAgdm9zX2NvcmVfcmV0dXJuX21zZyhwU2NoZWRDb250ZXh0LT5wVkNvbnRleHQsIHBNc2dXcmFwcGVyKTsKKyAgICAgICAgY29udGludWU7CisgICAgICB9CisgICAgICAvLyBDaGVjayBub3cgdGhlIFRMIHF1ZXVlCisgICAgICBpZiAoIXZvc19pc19tcV9lbXB0eSgmcFNjaGVkQ29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hlIENvcmUKKyAgICAgICAgdm9zX2NvcmVfcmV0dXJuX21zZyhwU2NoZWRDb250ZXh0LT5wVkNvbnRleHQsIHBNc2dXcmFwcGVyKTsKKyAgICAgICAgY29udGludWU7CisgICAgICB9CisgICAgICAvLyBDaGVjayB0aGUgV0RJIHF1ZXVlCisgICAgICBpZiAoIXZvc19pc19tcV9lbXB0eSgmcFNjaGVkQ29udGV4dC0+d2RpVHhNcSkpCisgICAgICB7CisgICAgICAgIHdwdF9tc2cgKnBXZGlNc2c7CisgICAgICAgIHBNc2dXcmFwcGVyID0gdm9zX21xX2dldCgmcFNjaGVkQ29udGV4dC0+d2RpVHhNcSk7CisKKyAgICAgICAgaWYgKHBNc2dXcmFwcGVyID09IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIiVzOiBwTXNnV3JhcHBlciBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgICAgICBWT1NfQlVHKDApOworICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIHBXZGlNc2cgPSAod3B0X21zZyAqKXBNc2dXcmFwcGVyLT5wVm9zTXNnLT5ib2R5cHRyOworCisgICAgICAgIGlmKHBXZGlNc2cgPT0gTlVMTCB8fCBwV2RpTXNnLT5jYWxsYmFjayA9PSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICIlczogV0RJIE1zZyBvciBDYWxsYmFjayBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgICAgICBWT1NfQlVHKDApOworICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgcFdkaU1zZy0+Y2FsbGJhY2socFdkaU1zZyk7CisKK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1NUX0VWRU5ULCAmcFNjaGVkQ29udGV4dC0+cnhFdmVudEZsYWcpOworCisgICAgd2hpbGUoMSkKKyAgICB7CisgICAgICBpZih0ZXN0X2JpdChSWF9TSFVURE9XTl9FVkVOVCwgJnBTY2hlZENvbnRleHQtPnJ4RXZlbnRGbGFnKSkKKyAgICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICIlczogUlggdGhyZWFkIHNpZ25hbGVkIHRvIHNodXRkb3duIiwgX19mdW5jX18pOworICAgICAgICBzaHV0ZG93biA9IFZPU19UUlVFOworICAgICAgICAvKiBDaGVjayBmb3IgYW55IFN1c3BlbmQgSW5kaWNhdGlvbiAqLworICAgICAgICBpZiAodGVzdF9hbmRfY2xlYXJfYml0KFJYX1NVU1BFTkRfRVZFTlQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBTY2hlZENvbnRleHQtPnJ4RXZlbnRGbGFnKSkKKyAgICAgICAgeworICAgICAgICAgICAvKiBVbmJsb2NrIGFueW9uZSB3YWl0aW5nIG9uIHN1c3BlbmQgKi8KKyAgICAgICAgICAgY29tcGxldGUoJnBIZGRDdHgtPnJ4X3N1c19ldmVudF92YXIpOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgICAgfQorCisKKyAgICAgIC8vIENoZWNrIHRoZSBTWVMgcXVldWUgZmlyc3QKKyAgICAgIGlmICghdm9zX2lzX21xX2VtcHR5KCZwU2NoZWRDb250ZXh0LT5zeXNSeE1xKSkKKyAgICAgIHsKKyAgICAgICAgLy8gU2VydmljZSB0aGUgU1lTIG1lc3NhZ2UgcXVldWUKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgIiVzOiBTZXJ2aWNpbmcgdGhlIFZPUyBTWVMgUlggTWVzc2FnZSBxdWV1ZSIsX19mdW5jX18pOworICAgICAgICBwTXNnV3JhcHBlciA9IHZvc19tcV9nZXQoJnBTY2hlZENvbnRleHQtPnN5c1J4TXEpOworICAgICAgICBpZiAocE1zZ1dyYXBwZXIgPT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiJXM6IHBNc2dXcmFwcGVyIGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIHZTdGF0dXMgPSBzeXNSeFByb2Nlc3NNc2coIHBTY2hlZENvbnRleHQtPnBWQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1zZ1dyYXBwZXItPnBWb3NNc2cpOworICAgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2U3RhdHVzKSkKKyAgICAgICAgeworICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAiJXM6IElzc3VlIFByb2Nlc3NpbmcgVFggU1lTIG1lc3NhZ2UiLF9fZnVuY19fKTsKKyAgICAgICAgfQorICAgICAgICAvLyByZXR1cm4gbWVzc2FnZSB0byB0aGUgQ29yZQorICAgICAgICB2b3NfY29yZV9yZXR1cm5fbXNnKHBTY2hlZENvbnRleHQtPnBWQ29udGV4dCwgcE1zZ1dyYXBwZXIpOworICAgICAgICBjb250aW51ZTsKKyAgICAgIH0KKworICAgICAgLy8gQ2hlY2sgbm93IHRoZSBUTCBxdWV1ZQorICAgICAgaWYgKCF2b3NfaXNfbXFfZW1wdHkoJnBTY2hlZENvbnRleHQtPnRsUnhNcSkpCisgICAgICB7CisgICAgICAgIC8vIFNlcnZpY2UgdGhlIFRMIG1lc3NhZ2UgcXVldWUKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgIiVzOiBTZXJ2aWNpbmcgdGhlIFZPUyBUTCBSWCBNZXNzYWdlIHF1ZXVlIixfX2Z1bmNfXyk7CisgICAgICAgIHBNc2dXcmFwcGVyID0gdm9zX21xX2dldCgmcFNjaGVkQ29udGV4dC0+dGxSeE1xKTsKKyAgICAgICAgaWYgKHBNc2dXcmFwcGVyID09IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIiVzOiBwTXNnV3JhcHBlciBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICB2U3RhdHVzID0gV0xBTlRMX1J4UHJvY2Vzc01zZyggcFNjaGVkQ29udGV4dC0+cFZDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1zZ1dyYXBwZXItPnBWb3NNc2cpOworICAgICAgICBpZiAoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2U3RhdHVzKSkKKyAgICAgICAgeworICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAiJXM6IElzc3VlIFByb2Nlc3NpbmcgUlggVEwgbWVzc2FnZSIsX19mdW5jX18pOworICAgICAgICB9CisgICAgICAgIC8vIHJldHVybiBtZXNzYWdlIHRvIHRoZSBDb3JlCisgICAgICAgIHZvc19jb3JlX3JldHVybl9tc2cocFNjaGVkQ29udGV4dC0+cFZDb250ZXh0LCBwTXNnV3JhcHBlcik7CisgICAgICAgIGNvbnRpbnVlOworICAgICAgfQorCisgICAgICAvLyBDaGVjayB0aGUgV0RJIHF1ZXVlCisgICAgICBpZiAoIXZvc19pc19tcV9lbXB0eSgmcFNjaGVkQ29udGV4dC0+d2RpUnhNcSkpCisgICAgICB7CisgICAgICAgIHdwdF9tc2cgKnBXZGlNc2c7CisgICAgICAgIHBNc2dXcmFwcGVyID0gdm9zX21xX2dldCgmcFNjaGVkQ29udGV4dC0+d2RpUnhNcSk7CisgICAgICAgIGlmICgoTlVMTCA9PSBwTXNnV3JhcHBlcikgfHwgKE5VTEwgPT0gcE1zZ1dyYXBwZXItPnBWb3NNc2cpKQorICAgICAgICB7CisgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiJXM6IHdkaVJ4TXEgbWVzc2FnZSBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgICAgIFZPU19CVUcoMCk7CisgICAgICAgICAgLy8gd2Ugd29uJ3QgcmV0dXJuIHRoaXMgd3JhcHBlciBzaW5jZSBpdCBpcyBjb3JydXB0CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgcFdkaU1zZyA9ICh3cHRfbXNnICopcE1zZ1dyYXBwZXItPnBWb3NNc2ctPmJvZHlwdHI7CisgICAgICAgICAgaWYgKChOVUxMID09IHBXZGlNc2cpIHx8IChOVUxMID09IHBXZGlNc2ctPmNhbGxiYWNrKSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBXREkgTXNnIG9yIGNhbGxiYWNrIGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICBWT1NfQlVHKDApOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgLy8gaW52b2tlIHRoZSBtZXNzYWdlIGhhbmRsZXIKKyAgICAgICAgICAgIHBXZGlNc2ctPmNhbGxiYWNrKHBXZGlNc2cpOworICAgICAgICAgIH0KKworICAgICAgICAgIC8vIHJldHVybiBtZXNzYWdlIHRvIHRoZSBDb3JlCisgICAgICAgICAgdm9zX2NvcmVfcmV0dXJuX21zZyhwU2NoZWRDb250ZXh0LT5wVkNvbnRleHQsIHBNc2dXcmFwcGVyKTsKKyAgICAgICAgfQorICAgICAgICBjb250aW51ZTsKKyAgICAgIH0KKworICAgICAgLyogQ2hlY2sgZm9yIGFueSBTdXNwZW5kIEluZGljYXRpb24gKi8KKyAgICAgIGlmICh0ZXN0X2FuZF9jbGVhcl9iaXQoUlhfU1VTUEVORF9FVkVOVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBTY2hlZENvbnRleHQtPnJ4RXZlbnRGbGFnKSkKKyAgICAgIHsKKyAgICAgICAgc3Bpbl9sb2NrKCZwU2NoZWRDb250ZXh0LT5SeFRocmVhZExvY2spOworICAgICAgICBJTklUX0NPTVBMRVRJT04ocFNjaGVkQ29udGV4dC0+UmVzdW1lUnhFdmVudCk7CisgICAgICAgIC8qIFJ4IFRocmVhZCBTdXNwZW5kZWQgKi8KKyAgICAgICAgY29tcGxldGUoJnBIZGRDdHgtPnJ4X3N1c19ldmVudF92YXIpOworICAgICAgICBzcGluX3VubG9jaygmcFNjaGVkQ29udGV4dC0+UnhUaHJlYWRMb2NrKTsKKworICAgICAgICAvKiBXYWl0IGZvciBSZXN1bWUgSW5kaWNhdGlvbiAqLworICAgICAgICB3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGUoJnBTY2hlZENvbnRleHQtPlJlc3VtZVJ4RXZlbnQpOworICAgICAgfQorCisgICAgICBicmVh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yIHRvIHRoZSBDb3JlLCB0aGUgVk9TIG1lc3NhZ2Ugc2hhbGwgYmUKKyAgKiogZnJlZWQgIGZpcnN0CisgICovCisgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLAorICAgICAgICAgICAgIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICgiRmx1c2hpbmcgdGhlIE1DIFRocmVhZCBtZXNzYWdlIHF1ZXVlIikgKTsKKworICBpZiAoTlVMTCA9PSBwU2NoZWRDb250ZXh0KQorICB7CisgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICIlczogcFNjaGVkQ29udGV4dCBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICByZXR1cm47CisgIH0KKworICB2b3NDdHggPSAocFZvc0NvbnRleHRUeXBlKShwU2NoZWRDb250ZXh0LT5wVkNvbnRleHQpOworICBpZiAoTlVMTCA9PSB2b3NDdHgpCisgIHsKKyAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IHZvc0N0eCBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICByZXR1cm47CisgIH0KKworICAvKiBGbHVzaCB0aGUgU1lTIE1xICovCisgIHdoaWxlKCBOVUxMICE9IChwTXNnV3JhcHBlciA9IHZvc19tcV9nZXQoJnBTY2hlZENvbnRleHQtPnN5c01jTXEpICkpCisgIHsKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywKKyAgICAgICAgICAgICAgIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgIiVzOiBGcmVlaW5nIE1DIFNZUyBtZXNzYWdlIHR5cGUgJWQgIixfX2Z1bmNfXywKKyAgICAgICAgICAgICAgIHBNc2dXcmFwcGVyLT5wV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hlIFdESSBNcSAqLworICB3aGlsZSggTlVMTCAhPSAocE1zZ1dyYXBwZXIgPSB2b3NfbXFfZ2V0KCZwU2NoZWRDb250ZXh0LT53ZGlNY01xKSApKQorICB7CisgICAgaWYocE1zZ1dyYXBwZXItPnBWb3NNc2cgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAiJXM6IEZyZWVpbmcgTUMgV0RJIE1TRyBtZXNzYWdlIHR5cGUgJWQiLAorICAgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBwTXNnV3JhcHBlci0+cFZvc01zZy0+dHlwZSApOworCisgICAgICAgIC8qIE1TRyBib2R5IHBvaW50ZXIgaXMgbm90IE5VTEwKKyAgICAgICAgICogYW5kIE1TRyB0eXBlIGlzIDAKKyAgICAgICAgICogVGhpcyBNU0cgaXMgbm90IHBvc3RlZCBieSBTTUQgTk9USUZZCisgICAgICAgICAqIFdlIGhhdmUgdG8gZnJlZSBNU0cgYm9keSAqLworICAgICAgICBpZiAoKHBNc2dXcmFwcGVyLT5wVm9zTXNnLT5ib2R5cHRyKSAmJiAoIXBNc2dXcmFwcGVyLT5wVm9zTXNnLT50eXBlKSkKKyAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9mcmVlKCh2X1ZPSURfdCopcE1zZ1dyYXBwZXItPnBWb3NNc2ctPmJvZHlwdHIpOworICAgICAgICB9CisgICAgICAgIC8qIE1TRyBib2R5IHBvaW50ZXIgaXMgbm90IE5VTEwKKyAgICAgICAgICogYW5kIE1TRyB0eXBlIGlzIG5vdCAwCisgICAgICAgICAqIFRoaXMgTVNHIGlzIHBvc3RlZCBieSBTTUQgTk9USUZZCisgICAgICAgICAqIFdlIHNob3VsZCBub3QgZnJlZSBNU0cgYm9keSAqLworICAgICAgICBlbHNlIGlmICgocE1zZ1dyYXBwZXItPnBWb3NNc2ctPmJvZHlwdHIpICYmIHBNc2dXcmFwcGVyLT5wVm9zTXNnLT50eXBlKQorICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFNNRCBOT1RJRlkgTVNHLCBkbyBub3QgZnJlZSBib2R5IiwKKyAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICB9CisgICAgICAgIHBNc2dXcmFwcGVyLT5wVm9zTXNnLT5ib2R5cHRyID0gTlVMTDsKKyAgICAgICAgcE1zZ1dyYXBwZXItPnBWb3NNc2ctPmJvZHl2YWwgPSAwOworICAgICAgICBwTXNnV3JhcHBlci0+cFZvc01zZy0+dHlwZSA9IDA7CisgICAgfQorICAgIHZvc19jb3JlX3JldHVybl9tc2cocFNjaGVkQ29udGV4dC0+cFZDb250ZXh0LCBwTXNnV3JhcHBlcik7CisgIH0KKworICAvKiBGbHVzaCB0aGUgUEUgTXEgKi8KKyAgd2hpbGUoIE5VTEwgIT0gKHBNc2dXcmFwcGVyID0gdm9zX21xX2dldCgmcFNjaGVkQ29udGV4dC0+cGVNY01xKSApKQorICB7CisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1ZPU1MsCisgICAgICAgICAgICAgICBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICIlczogRnJlZWluZyBNQyBQRSBNU0cgbWVzc2FnZSB0eXBlICVkIixfX2Z1bmNfXywKKyAgICAgICAgICAgICAgIHBNc2dXcmFwcGVyLT5wVm9zTXNnLT50eXBlICk7CisgICAgcGVGcmVlTXNnKHZvc0N0eC0+cE1BQ0NvbnRleHQsICh0U2lyTXNnUSopcE1zZ1dyYXBwZXItPnBWb3NNc2cpOworICAgIHZvc19jb3JlX3JldHVybl9tc2cocFNjaGVkQ29udGV4dC0+cFZDb250ZXh0L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worICAgIHBWb3NDb250ZXh0ID0gdm9zX2dldF9nbG9iYWxfY29udGV4dChWT1NfTU9EVUxFX0lEX0hERCwgTlVMTCk7CisgICAgcEhkZEN0eCA9IChoZGRfY29udGV4dF90ICopdm9zX2dldF9jb250ZXh0KFZPU19NT0RVTEVfSURfSERELCBwVm9zQ29udGV4dCApOworICAgIGlmIChOVUxMID09IHBIZGRDdHgpCisgICAgeworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgIiVzOiBJbnZhbGlkIEhERCBDb250ZXh0IiwgX19mdW5jX18pOworICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICB9CisKKyAgICAvKiBUYWtlIHRoZSBsb2NrIGhlcmUgKi8KKyAgICBzcGluX2xvY2soJmdwVm9zV2F0Y2hkb2dDb250ZXh0LT53ZExvY2spOworCisgICAgLyogcmV1c2UgdGhlIGV4aXN0aW5nICdyZXNldCBpbiBwcm9ncmVzcycgKi8KKyAgICBpZiAoZ3BWb3NXYXRjaGRvZ0NvbnRleHQtPnJlc2V0SW5Qcm9ncmVzcykKKyAgICB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICIlczogU2h1dGRvd24gYWxyZWFkeSBpbiBQcm9ncmVzcy4gSWdub3Jpbmcgc2lnbmFsaW5nIFdhdGNoZG9nIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAvKiBSZWxlYXNlIHRoZSBsb2NrIGhlcmUgKi8KKyAgICAgICAgc3Bpbl91bmxvY2soJmdwVm9zV2F0Y2hkb2dDb250ZXh0LT53ZExvY2spOworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgfQorICAgIC8qIHJldXNlIHRoZSBleGlzdGluZyAnbG9ncCBpbiBwcm9ncmVzcycsIGV2ZW50aG91Z2ggaXQgaXMgbm90CisgICAgICogZXhhY3RseSB0aGUgc2FtZSAqLworICAgIGVsc2UgaWYgKHBIZGRDdHgtPmlzTG9ncEluUHJvZ3Jlc3MpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAiJXM6IHNodXRkb3duL3JlLWluaXQgYWxyZWFkeSBpbiBQcm9ncmVzcy4gSWdub3Jpbmcgc2lnbmFsaW5nIFdhdGNoZG9nIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAvKiBSZWxlYXNlIHRoZSBsb2NrIGhlcmUgKi8KKyAgICAgICAgc3Bpbl91bmxvY2soJmdwVm9zV2F0Y2hkb2dDb250ZXh0LT53ZExvY2spOworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgfQorCisgICAgaWYgKFdMQU5fSEREX0lTX0xPQURfVU5MT0FEX0lOX1BST0dSRVNTKHBIZGRDdHgpKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICIlczogTG9hZC91bmxvYWQgaW4gUHJvZ3Jlc3MuIElnbm9yaW5nIHNpZ25hbGluZyBXYXRjaGRvZyIsCisgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAvKiB3Y25zcyBoYXMgY3Jhc2hlZCwgYW5kIFNTUiBoYXMgYWxyZWR5IGJlZW4gc3RhcnRlZCBieSBLZXJuZWwgZHJpdmVyLgorICAgICAgICAgKiBTbyBkaXNhYmxlIF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gICAgCisgIAorICAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gCisgICAgCisgICAgICAgICAgICAgICAgICAgICAgIEVESVQgSElTVE9SWSBGT1IgRklMRSAKKyAgIAorICAgCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLiAKKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4gCisgICAKKyAgIAorICAkSGVhZGVyOiQgJERhdGVUaW1lOiAkICRBdXRob3I6ICQgCisgICAKKyAgIAorICB3aGVuICAgICAgICB3aG8gICAgd2hhdCwgd2hlcmUsIHdoeSAKKyAgLS0tLS0tLS0gICAgLS0tICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgIDA5LzE1LzA4ICAgIGxhYyAgICBSZW1vdmVkIGhhcmRjb2RlZCAjZGVmaW5lIGZvciBWT1NfVFJBQ0UuCisgIDA2LzEyLzA4ICAgIGhiYSAgICBDcmVhdGVkIG1vZHVsZS4gCisgICAgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8gCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgSW5jbHVkZSBGaWxlcworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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b24gICBNY1NodXRkb3duOyAKKworICAgLyogY29tcGxldGlvbiBvYmplY3QgZm9yIFR4IHRocmVhZCBzaHV0ZG93biAqLworICAgc3RydWN0IGNvbXBsZXRpb24gICBUeFNodXRkb3duOyAKKworICAgLyogY29tcGxldGlvbiBvYmplY3QgZm9yIFJ4IHRocmVhZCBzaHV0ZG93biAqLworICAgc3RydWN0IGNvbXBsZXRpb24gICBSeFNodXRkb3duOworCisgICAvKiBXYWl0IHF1ZXVlIGZvciBNQyB0aHJlYWQgKi8KKyAgIHdhaXRfcXVldWVfaGVhZF90IG1jV2FpdFF1ZXVlOworCisgICB1bnNpZ25lZCBsb25nICAgICBtY0V2ZW50RmxhZzsKKworICAgLyogV2FpdCBxdWV1ZSBmb3IgVHggdGhyZWFkICovCisgICB3YWl0X3F1ZXVlX2hlYWRfdCB0eFdhaXRRdWV1ZTsKKworICAgdW5zaWduZWQgbG9uZyAgICAgdHhFdmVudEZsYWc7CisKKyAgIC8qIFdhaXQgcXVldWUgZm9yIFJ4IHRocmVhZCAqLworICAgd2FpdF9xdWV1ZV9oZWFkX3QgcnhXYWl0UXVldWU7CisKKyAgIHVuc2lnbmVkIGxvbmcgICAgIHJ4RXZlbnRGbGFnOworICAgCisgICAvKiBDb21wbGV0aW9uIG9iamVjdCB0byByZXN1bWUgTWMgdGhyZWFkICovCisgICBzdHJ1Y3QgY29tcGxldGlvbiBSZXN1bWVNY0V2ZW50OworCisgICAvKiBDb21wbGV0aW9uIG9iamVjdCB0byByZXN1bWUgVHggdGhyZWFkICovCisgICBzdHJ1Y3QgY29tcGxldGlvbiBSZXN1bWVUeEV2ZW50OworCisgICAvKiBDb21wbGV0aW9uIG9iamVjdCB0byByZXN1bWUgUnggdGhyZWFkICovCisgICBzdHJ1Y3QgY29tcGxldGlvbiBSZXN1bWVSeEV2ZW50OworCisgICAvKiBsb2NrIHRvIG1ha2Ugc3VyZSB0aGF0IE1jVGhyZWFkIGFuZCBUeFRocmVhZCBTdXNwZW5kL3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qIHRoZSBWb3MgbWVzc2FnZSBpdCBpcyBhc3NvY2lhdGVkIHRvICovCisgICB2b3NfbXNnX3QgICAgKnBWb3NNc2c7CisKK30gVm9zTXNnV3JhcHBlciwgKnBWb3NNc2dXcmFwcGVyOworCisKKwordHlwZWRlZiBzdHJ1Y3QgX1Zvc0NvbnRleHRUeXBlCit7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgIC8qIE1lc3NhZ2VzIGJ1ZmZlcnMgKi8KKyAgIHZvc19tc2dfdCAgICAgICAgICAgYU1zZ0J1ZmZlcnNbVk9TX0NPUkVfTUFYX01FU1NBR0VTXTsKKworICAgVm9zTXNnV3JhcHBlciAgICAgICBhTXNnV3JhcHBlcnNbVk9TX0NPUkVfTUFYX01FU1NBR0VTXTsKKyAgIAorICAgLyogRnJlZSBNZXNzYWdlIHF1ZXVlKi8KKyAgIFZvc01xVHlwZSAgICAgICAgICAgZnJlZVZvc01xOworCisgICAvKiBTY2hlZHVsZXIgQ29udGV4dCAqLworICAgVm9zU2NoZWRDb250ZXh0ICAgICB2b3NTY2hlZDsKKworICAgLyogV2F0Y2hkb2cgQ29udGV4dCAqLworICAgVm9zV2F0Y2hkb2dDb250ZXh0ICB2b3NXYXRjaGRvZzsKKworICAgLyogSEREIE1vZHVsZSBDb250ZXh0ICAqLworICAgdl9WT0lEX3QgICAgICAgICAgICpwSEREQ29udGV4dDsKKworICAgLyogSEREIFNvZnRBUCBNb2R1bGUgQ29udGV4dCAgKi8KKyAgIHZfVk9JRF90ICAgICAgICAgICAqcEhERFNvZnRBUENvbnRleHQ7CisKKyAgIC8qIFRMIE1vZHVsZSBDb250ZXh0ICAqLworICAgdl9WT0lEX3QgICAgICAgICAgICpwVExDb250ZXh0OworCisgICAvKiBNQUMgTW9kdWxlIENvbnRleHQgICovCisgICB2X1ZPSURfdCAgICAgICAgICAgKnBNQUNDb250ZXh0OworCisgICAvKiBCQVAgQ29udGV4dCAqLworIC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3JtSW5mby5zcGlubG9jayxmbGFncyApOworICAgCisgICBpZiAoIFZPU19TVEFUVVNfU1VDQ0VTUyAhPSB2U3RhdHVzICkKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgIlRJTUVSIGNhbGxiYWNrIGNhbGxlZCBpbiBhIHdyb25nIHN0YXRlPSVkIiwgdGltZXItPnN0YXRlKTsKKyAgICAgIHJldHVybjsKKyAgIH0KKworICAgdHJ5QWxsb3dpbmdTbGVlcCggdHlwZSApOworCisgICBpZiAoY2FsbGJhY2sgPT0gTlVMTCkKKyAgIHsKKyAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBObyBUSU1FUiBjYWxsYmFjaywgQ291bGQgbm90IGVucXVldWUgdGltZXIgdG8gYW55IHF1ZXVlIiwKKyAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgIHJldHVybjsKKyAgIH0KKworICAgLy8gSWYgdGltZXIgaGFzIGV4cGlyZWQgdGhlbiBjYWxsIHZvc19jbGllbnQgc3BlY2lmaWMgY2FsbGJhY2sgCisgICBpZiAoIHZvc19zY2hlZF9pc190eF90aHJlYWQoIHRocmVhZElkICkgKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0lORk8sIAorICAgICAgICAgICJUSU1FUiBjYWxsYmFjazogcnVubmluZyBvbiBUWCB0aHJlYWQiKTsKKyAgICAgICAgIAorICAgICAgLy9TZXJpYWxpemUgdG8gdGhlIFR4IHRocmVhZAorICAgICAgc3lzQnVpbGRNZXNzYWdlSGVhZGVyKCBTWVNfTVNHX0lEX1RYX1RJTUVSLCAmbXNnICk7CisgICAgICBtc2cuY2FsbGJhY2sgPSBjYWxsYmFjazsKKyAgICAgIG1zZy5ib2R5cHRyICA9IHVzZXJEYXRhOworICAgICAgbXNnLmJvZHl2YWwgID0gMDsKKyAgICAgICAKKyAgICAgIGlmKHZvc190eF9tcV9zZXJpYWxpemUoIFZPU19NUV9JRF9TWVMsICZtc2cgKSA9PSBWT1NfU1RBVFVTX1NVQ0NFU1MpCisgICAgICAgICByZXR1cm47CisgICB9CisgICBlbHNlIGlmICggdm9zX3NjaGVkX2lzX3J4X3RocmVhZCggdGhyZWFkSWQgKSApCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgCisgICAgICAgICAgIlRJTUVSIGNhbGxiYWNrOiBydW5uaW5nIG9uIFJYIHRocmVhZCIpOworICAgICAgICAgCisgICAgICAvL1NlcmlhbGl6ZSB0byB0aGUgUnggdGhyZWFkCisgICAgICBzeXNCdWlsZE1lc3NhZ2VIZWFkZXIoIFNZU19NU0dfSURfUlhfVElNRVIsICZtc2cgKTsKKyAgICAgIG1zZy5jYWxsYmFjayA9IGNhbGxiYWNrOworICAgICAgbXNnLmJvZHlwdHIgID0gdXNlckRhdGE7CisgICAgICBtc2cuYm9keXZhbCAgPSAwOworICAgICAgIAorICAgICAgaWYodm9zX3J4X21xX3NlcmlhbGl6ZSggVk9TX01RX0lEX1NZUywgJm1zZyApID09IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgIHJldHVybjsKKyAgIH0KKyNpZmRlZiBXTEFOX0xPR0dJTkdfU09DS19TVkNfRU5BQkxFCisgICBlbHNlIGlmICh2b3NfaXNfd2RfdGhyZWFkKHRocmVhZElkKSkKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICJUSU1FUiBjYWxsYmFjazogcnVubmluZyBvbiB3ZCB0aHJlYWQiKTsKKyAgICAgIGNhbGxiYWNrKE5VTEwpOworICAgICAgcmV0dXJuOworICAgfQorI2VuZGlmCisgICBlbHNlCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgIlRJTUVSIGNhbGxiYWNrOiBydW5uaW5nIG9uIE1DIHRocmVhZCIpOworICAgICAgICAgICAgICAgICAgICAKKyAgICAgIC8vIFNlcmlhbGl6ZSB0byB0aGUgTUMgdGhyZWFkCisgICAgICBzeXNCdWlsZE1lc3NhZ2VIZWFkZXIoIFNZU19NU0dfSURfTUNfVElNRVIsICZtc2cgKTsKKyAgICAgIG1zZy5jYWxsYmFjayA9IGNhbGxiYWNrOworICAgICAgbXNnLmJvZHlwdHIgID0gdXNlckRhdGE7CisgICAgICBtc2cuYm9keXZhbCAgPSAwOworICAgICAgIAorICAgICAgaWYodm9zX21xX3Bvc3RfbWVzc2FnZSggVk9TX01RX0lEX1NZUywgJm1zZyApID09IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgICAgICAgcmV0dXJuOworICAgfQorCisgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICIlczogQ291bGQgbm90IGVucXVldWUgdGltZXIgdG8gYW55IHF1ZXVlIiwgX19mdW5jX18pOworICAgVk9TX0FTU0VSVCgwKTsKK30KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgCisgIFxicmllZiB2b3NfdGltZXJfZ2V0Q3VycmVudFN0YXRlKCkgLSBHZXQgdGhlIGN1cnJlbnQgc3RhdGUgb2YgdGhlIHRpbWVyCisKKyAgXHBhcmFtIHB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IHBOb2RlOworICAgICAgIFZPU19TVEFUVVMgdm9zU3RhdHVzOworCisgICAgICAgdGltZXJfbm9kZV90ICpwdGltZXJOb2RlOworICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBMaXN0IGlzIG5vdCBFbXB0eS4gbGlzdFNpemUgJWQgIiwKKyAgICAgICAgICAgICAgICAgX19mdW5jX18sIChpbnQpbGlzdFNpemUpOworCisgICAgICAgZG8KKyAgICAgICB7CisgICAgICAgICAgc3Bpbl9sb2NrX2lycXNhdmUoJnZvc1RpbWVyTGlzdC5sb2NrLCBmbGFncyk7CisgICAgICAgICAgdm9zU3RhdHVzID0gaGRkX2xpc3RfcmVtb3ZlX2Zyb250KCZ2b3NUaW1lckxpc3QsICZwTm9kZSk7CisgICAgICAgICAgc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmdm9zVGltZXJMaXN0LmxvY2ssIGZsYWdzKTsKKyAgICAgICAgICBpZiAoVk9TX1NUQVRVU19TVUNDRVNTID09IHZvc1N0YXR1cykKKyAgICAgICAgICB7CisgICAgICAgICAgICAgcHRpbWVyTm9kZSA9ICh0aW1lcl9ub2RlX3QqKXBOb2RlOworICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAgICAgIlRpbWVyIExlYWtAIEZpbGUgJXMsIEBMaW5lICVkIiwgCisgICAgICAgICAgICAgICAgICAgICAgIHB0aW1lck5vZGUtPmZpbGVOYW1lLCAoaW50KXB0aW1lck5vZGUtPmxpbmVOdW0pOworCisgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHB0aW1lck5vZGUpOworICAgICAgICAgIH0KKyAgICAgICB9IHdoaWxlICh2b3NTdGF0dXMgPT0gVk9TX1NUQVRVU19TVUNDRV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CBkZXN0cm95ZWQgdGltZXIuCisKKyAgICAgICAgICBWT1NfU1RBVFVTX0VfRkFVTFQgIC0gdGltZXIgaXMgYW4gaW52YWxpZCBwb2ludGVyLiAgICAgCisgIFxzYQorICAKKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisjaWZkZWYgVElNRVJfTUFOQUdFUgorc3RhdGljIGlubGluZSBWT1NfU1RBVFVTIF9fdm9zX3RpbWVyX2luaXRfZGVidWcodm9zX3RpbWVyX3QgKnRpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RJTUVSX1RZUEUgdGltZXJUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgdm9zX3RpbWVyX2NhbGxiYWNrX3QgY2FsbGJhY2ssCisgICAgICAgICAgICAgICAgICAgICAgICB2X1BWT0lEX3QgdXNlckRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICBib29sIGRlZmVycmFibGUsCisgICAgICAgICAgICAgICAgICAgICAgICBjaGFyKiBmaWxlTmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgbGluZU51bSkKK3sKKyAgIFZPU19TVEFUVVMgdm9zU3RhdHVzOworICAgIHVuc2lnbmVkIGxvbmcgZmxhZ3M7CisgICAvLyBDaGVjayBmb3IgaW52YWxpZCBwb2ludGVyCisgICBpZiAoKHRpbWVyID09IE5VTEwpIHx8IChjYWxsYmFjayA9PSBOVUxMKSkKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IE51bGwgcGFyYW1zIGJlaW5nIHBhc3NlZCIsX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0V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ltZXJfaW5pdF9kZWJ1Zyh2b3NfdGltZXJfdCAqdGltZXIsCisgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVElNRVJfVFlQRSB0aW1lclR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICB2b3NfdGltZXJfY2FsbGJhY2tfdCBjYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgIHZfUFZPSURfdCB1c2VyRGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIqIGZpbGVOYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgdl9VMzJfdCBsaW5lTnVtKQoreworICAgcmV0dXJuIF9fdm9zX3RpbWVyX2luaXRfZGVidWcodGltZXIsIHRpbWVyVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrLCB1c2VyRGF0YSwgZmFsc2UsIGZpbGVOYW1lLCBsaW5lTnVtKTsKK30KKworVk9TX1NUQVRVUyB2b3NfdGltZXJfaW5pdF9kZWZlcnJhYmxlX2RlYnVnKHZvc190aW1lcl90ICp0aW1lciwKKyAgICAgICAgICAgICAgICAgICAgICAgIFZPU19USU1FUl9UWVBFIHRpbWVyVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHZvc190aW1lcl9jYWxsYmFja190IGNhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgdl9QVk9JRF90IHVzZXJEYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgY2hhciogZmlsZU5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICB2X1UzMl90IGxpbmVOdW0pCit7CisgICByZXR1cm4gX192b3NfdGltZXJfaW5pdF9kZWJ1Zyh0aW1lciwgdGltZXJUeXBlLAorICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2ssIHVzZXJEYXRhLCB0cnVlLCBmaWxlTmFtZSwgbGluZU51bSk7Cit9CisjZWxzZQorc3RhdGljIGlubGluZSBWT1NfU1RBVFVTIF9fdm9zX3RpbWVyX2luaXQodm9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bGludXhfdGltZXJfY2FsbGJhY2s7CisgICB0aW1lci0+cGxhdGZvcm1JbmZvLlRpbWVyLmRhdGEgPSAodW5zaWduZWQgbG9uZyl0aW1lcjsKKyAgIHRpbWVyLT5jYWxsYmFjayA9IGNhbGxiYWNrOworICAgdGltZXItPnVzZXJEYXRhID0gdXNlckRhdGE7CisgICB0aW1lci0+dHlwZSA9IHRpbWVyVHlwZTsKKyAgIHRpbWVyLT5wbGF0Zm9ybUluZm8uY29va2llID0gTElOVVhfVElNRVJfQ09PS0lFOworICAgdGltZXItPnBsYXRmb3JtSW5mby50aHJlYWRJRCA9IDA7CisgICB0aW1lci0+c3RhdGUgPSBWT1NfVElNRVJfU1RBVEVfU1RPUFBFRDsKKyAgIAorICAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KK1ZPU19TVEFUVVMgdm9zX3RpbWVyX2luaXQodm9zX3RpbWVyX3QgKnRpbWVyLAorICAgICAgICAgICAgICAgICAgICAgVk9TX1RJTUVSX1RZUEUgdGltZXJUeXBlLAorICAgICAgICAgICAgICAgICAgICAgdm9zX3RpbWVyX2NhbGxiYWNrX3QgY2FsbGJhY2ssCisgICAgICAgICAgICAgICAgICAgICB2X1BWT0lEX3QgdXNlckRhdGEpCit7CisgICByZXR1cm4gX192b3NfdGltZXJfaW5pdCh0aW1lciwgdGltZXJUeXBlLAorICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrLCB1c2VyRGF0YSwgZmFsc2UpOworCit9CisKK1ZPU19TVEFUVVMgdm9zX3RpbWVyX2luaXRfZGVmZXJyYWJsZSh2b3NfdGltZXJfdCAqdGltZXIsCisgICAgICAgICAgICAgICAgICAgICBWT1NfVElNRVJfVFlQRSB0aW1lclR5cGUsCisgICAgICAgICAgICAgICAgICAgICB2b3NfdGltZXJfY2FsbGJhY2tfdCBjYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgIHZfUFZPSURfdCB1c2VyRGF0YSkKK3sKKyAgIHJldHVybiB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bV9mcmVlKHRpbWVyLT5wdGltZXJOb2RlKTsKKyAgIAorCisgICBzcGluX2xvY2tfaXJxc2F2ZSggJnRpbWVyLT5wbGF0Zm9ybUluZm8uc3BpbmxvY2ssZmxhZ3MgKTsKKyAgIAorICAgc3dpdGNoICggdGltZXItPnN0YXRlICkKKyAgIHsKKyAgICAgIGNhc2UgVk9TX1RJTUVSX1NUQVRFX1NUQVJUSU5HOgorICAgICAgICAgdlN0YXR1cyA9IFZPU19TVEFUVVNfRV9CVVNZOworICAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIFZPU19USU1FUl9TVEFURV9SVU5OSU5HOgorICAgICAgICAgLyogU3RvcCB0aGUgdGltZXIgZmlyc3QgKi8KKyAgICAgICAgIGRlbF90aW1lcigmKHRpbWVyLT5wbGF0Zm9ybUluZm8uVGltZXIpKTsKKyAgICAgICAgIHZTdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgVk9TX1RJTUVSX1NUQVRFX1NUT1BQRUQ6CisgICAgICAgICB2U3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIFZPU19USU1FUl9TVEFURV9VTlVTRUQ6CisgICAgICAgICB2U3RhdHVzID0gVk9TX1NUQVRVU19FX0FMUkVBRFk7CisgICAgICAgICBicmVhazsKKyAgICAgIGRlZmF1bHQ6CisgICAgICAgICB2U3RhdHVzID0gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgICAgICAgYnJlYWs7CisgICB9CisKKyAgIGlmICggVk9TX1NUQVRVU19TVUNDRVNTID09IHZTdGF0dXMgKQorICAgeworICAgICAgdGltZXItPnBsYXRmb3JtSW5mby5jb29raWUgPSBMSU5VWF9JTlZBTElEX1RJTUVSX0NPT0tJRTsKKyAgICAgIHRpbWVyLT5zdGF0ZSA9IFZPU19USU1FUl9TVEFURV9VTlVTRUQ7CisgICAgICBzcGluX3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Zvcm1JbmZvLmNvb2tpZSApCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICIlczogQ2Fubm90IGRlc3Ryb3kgdW5pbml0aWFsaXplZCB0aW1lciIsX19mdW5jX18pOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgIH0KKyAgIHNwaW5fbG9ja19pcnFzYXZlKCAmdGltZXItPnBsYXRmb3JtSW5mby5zcGlubG9jayxmbGFncyApOworICAgCisgICBzd2l0Y2ggKCB0aW1lci0+c3RhdGUgKQorICAgeworICAgICAgY2FzZSBWT1NfVElNRVJfU1RBVEVfU1RBUlRJTkc6CisgICAgICAgICB2U3RhdHVzID0gVk9TX1NUQVRVU19FX0JVU1k7CisgICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgVk9TX1RJTUVSX1NUQVRFX1JVTk5JTkc6CisgICAgICAgICAvKiBTdG9wIHRoZSB0aW1lciBmaXJzdCAqLworICAgICAgICAgZGVsX3RpbWVyKCYodGltZXItPnBsYXRmb3JtSW5mby5UaW1lcikpOworICAgICAgICAgdlN0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBWT1NfVElNRVJfU1RBVEVfU1RPUFBFRDoKKyAgICAgICAgIHZTdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgVk9TX1RJTUVSX1NUQVRFX1VOVVNFRDoKKyAgICAgICAgIHZTdGF0dXMgPSBWT1NfU1RBVFVTX0VfQUxSRUFEWTsKKyAgICAgICAgIGJyZWFrOworICAgICAgZGVmYXVsdDoKKyAgICAgICAgIHZTdGF0dXMgPSBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgICAgICAgICBicmVhazsKKyAgIH0KKworICAgaWYgKCBW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0tLS0qLworVk9TX1NUQVRVUyB2b3NfdGltZXJfc3RhcnQoIHZvc190aW1lcl90ICp0aW1lciwgdl9VMzJfdCBleHBpcmF0aW9uVGltZSApCit7CisgICB1bnNpZ25lZCBsb25nIGZsYWdzOworICAgICAKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILCAKKyAgICAgICAgICAgICAiVGltZXIgQWRkciBpbnNpZGUgdm9zc19zdGFydCA6IDB4JXAgIiwgdGltZXIgKTsKKyAgIAorICAgLy8gQ2hlY2sgZm9yIGludmFsaWQgcG9pbnRlcgorICAgaWYgKCBOVUxMID09IHRpbWVyICkKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAiJXMgTnVsbCB0aW1lciBwb2ludGVyIGJlaW5nIHBhc3NlZCIsIF9fZnVuY19fKTsKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0lOVkFMOworICAgfQorICAgICAgCisgICAvLyBDaGVjayBpZiB0aW1lciByZWZlcnMgdG8gYW4gdW5pbml0aWFsaXplZCBvYmplY3QKKyAgIGlmICggTElOVVhfVElNRVJfQ09PS0lFICE9IHRpbWVyLT5wbGF0Zm9ybUluZm8uY29va2llICkKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAiJXM6IENhbm5vdCBzdGFydCB1bmluaXRpYWxpemVkIHRpbWVyIixfX2Z1bmNfXyk7CisgICAgICBpZiAoIExJTlVYX0lOVkFMSURfVElNRVJfQ09PS0lFICE9IHRpbWVyLT5wbGF0Zm9ybUluZm8uY29va2llICkKKyAgICAgIHsKKyAgICAgICAgIFZPU19BU1NFUlQoM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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisgICRIZWFkZXI6JCAkRGF0ZVRpbWU6ICQgJEF1dGhvcjogJAorCisKKyAgd2hlbiAgICAgICAgd2hvICAgIHdoYXQsIHdoZXJlLCB3aHkKKyAgLS0tLS0tLS0gICAgLS0tICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgIDA5LzE2LzA4ICAgIGh2bSAgICBBZGRpbmcgYWJpbGl0eSB0byBzZXQgbXVsdGlwbGUgdHJhY2UgbGV2ZWxzIHBlciBjb21wb25lbnQKKyAgMDkvMTEvMDggICAgbGFjICAgIEFkZGVkIHRyYWNlIGxldmVscyBwZXIgY29tcG9uZW50LiAgQ2xlYW51cCBmcm9tIHJldmlldy4KKyAgMDgvMTQvMDggICAgdnBhaSAgIFBhcnRpY3VsYXIgbW9kdWxlcyBhbmQgZGVzaXJlZCBsZXZlbCBjYW4gYmUgc2VsZWN0ZWQKKyAgMDYvMjAvMDggICAgdnBhaSAgIENyZWF0ZWQgTW9kdWxlCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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sb2dfdG9fdXNlcihsZXZlbCwgKGNoYXIgKilzdHJCdWZmZXIsIHN0cmxlbihzdHJCdWZmZXIpKTsKKyNlbHNlCisgICAgICAgICBwcl9lcnIoIiVzXG4iLCBzdHJCdWZmZXIpOworI2VuZGlmCisgICAgICB9CisgICAgICB2YV9lbmQodmFsKTsKKyAgIH0KK30KKwordm9pZCB2b3NfdHJhY2VfZGlzcGxheSh2b2lkKQoreworICAgVk9TX01PRFVMRV9JRCBtb2R1bGVJZDsKKworICAgcHJfZXJyKCIgICAgIDEpRkFUQUwgIDIpRVJST1IgIDMpV0FSTiAgNClJTkZPICA1KUlORk9fSCAgNilJTkZPX00gIDcpSU5GT19MIDgpREVCVUdcbiIpOworICAgZm9yIChtb2R1bGVJZCA9IDA7IG1vZHVsZUlkIDwgVk9TX01PRFVMRV9JRF9NQVg7ICsrbW9kdWxlSWQpCisgICB7CisgICAgICBwcl9lcnIoIiUyZCklcyAgICAlcyAgICAgICAgJXMgICAgICAgJXMgICAgICAgJXMgICAgICAgICVzICAgICAgICAgJXMgICAgICAgICAlcyAgICAgICAgJXNcbiIsCisgICAgICAgICAgICAgKGludCltb2R1bGVJZCwKKyAgICAgICAgICAgICBnVm9zVHJhY2VJbmZvW21vZHVsZUlkXS5tb2R1bGVOYW1lU3RyLAorICAgICAgICAgICAgIChnVm9zVHJhY2VJbmZvW21vZHVsZUlkXS5tb2R1bGVUcmFjZUxldmVsICYgKDEgPDwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMKSkgPyAiWCI6IiAiLAorICAgICAgICAgICAgIChnVm9zVHJhY2VJbmZvW21vZHVsZUlkXS5tb2R1bGVUcmFjZUxldmVsICYgKDEgPDwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SKSkgPyAiWCI6IiAiLAorICAgICAgICAgICAgIChnVm9zVHJhY2VJbmZvW21vZHVsZUlkXS5tb2R1bGVUcmFjZUxldmVsICYgKDEgPDwgVk9TX1RSQUNFX0xFVkVMX1dBUk4pKSA/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19vZl9tb2R1bGVJZCwgdl9VOF90IGVuYWJsZSkKK3sKKyAgICBpbnQgaTsKKyAgICBpZiAoYml0bWFza19vZl9tb2R1bGVJZCkKKyAgICB7CisgICAgICAgZm9yIChpPTA7IGk8Vk9TX01PRFVMRV9JRF9NQVg7IGkrKykKKyAgICAgICB7CisgICAgICAgICAgIGlmICgoKGJpdG1hc2tfb2ZfbW9kdWxlSWQgPj4gaSkgJiAxICkpCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICBpZihlbmFibGUpCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChOVUxMICE9IHZvc3RyYWNlUmVzdG9yZUNCVGFibGVbaV0pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIHZvc3RyYWNlQ0JUYWJsZVtpXSA9IHZvc3RyYWNlUmVzdG9yZUNCVGFibGVbaV07CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZvc3RyYWNlUmVzdG9yZUNCVGFibGVbaV0gPSB2b3N0cmFjZUNCVGFibGVbaV07CisgICAgICAgICAgICAgICAgdm9zdHJhY2VDQlRhYmxlW2ldID0gTlVMTDsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgIH0KKyAgICAgICB9CisgICAgfQorCisgICAgZWxzZQorICAgIHsKKyAgICAgIGlmKGVuYWJsZSkKKyAgICAgIHsKKyAgICAgICAgIGZvciAoaT0wOyBpPFZPU19NT0RVTEVfSURfTUFYOyBpKyspCisgICAgICAgICB7CisgICAgICAgICAgICAgaWYgKE5VTEwgIT0gdm9zdHJhY2VSZXN0b3JlQ0JUYWJsZVtpXSkKKyAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdm9zdHJhY2VDQlRhYmxlW2ldID0gdm9zdHJhY2VSZXN0b3JlQ0JUYWJsZVtpXTsKKyAgICAgICAgICAgICB9CisgICAgICAgICB9CisgICA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F90IHNlc3Npb24sIHZfVTMyX3QgZGF0YSkKK3sKKyAgICB0cHZvc1RyYWNlUmVjb3JkIHJlYyA9IE5VTEw7CisgICAgdW5zaWduZWQgbG9uZyBmbGFnczsKKworCisgICAgaWYgKCFndm9zVHJhY2VEYXRhLmVuYWJsZSkKKyAgICB7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgLy9JZiBtb2R1bGUgaXMgbm90IHJlZ2lzdGVyZWQsIGRvbid0IHJlY29yZCBmb3IgdGhhdCBtb2R1bGUuCisgICAgaWYgKE5VTEwgPT0gdm9zdHJhY2VDQlRhYmxlW21vZHVsZV0pCisgICAgeworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgLyogQXF1aXJlIHRoZSBsb2NrIHNvIHRoYXQgb25seSBvbmUgdGhyZWFkIGF0IGEgdGltZSBjYW4gZmlsbCB0aGUgcmluZyBidWZmZXIgKi8KKyAgICBzcGluX2xvY2tfaXJxc2F2ZSgmbHRyYWNlTG9jaywgZmxhZ3MpOworCisgICAgZ3Zvc1RyYWNlRGF0YS5udW0rKzsKKworICAgIGlmIChndm9zVHJhY2VEYXRhLm51bSA+IE1BWF9WT1NfVFJBQ0VfUkVDT1JEUykKKyAgICB7CisgICAgICAgIGd2b3NUcmFjZURhdGEubnVtID0gTUFYX1ZPU19UUkFDRV9SRUNPUkRTOworICAgIH0KKworICAgIGlmIChJTlZBTElEX1ZPU19UUkFDRV9BRERSID09IGd2b3NUcmFjZURhdGEuaGVhZCkKKyAgICB7CisgICAgICAgIC8qIGZpcnN0IHJlY29yZCAqLworICAgICAgICBndm9zVHJhY2VEYXRhLmhlYWQgPSAwOworICAgICAgICBndm9zVHJhY2VEYXRhLnRhaWwgPSAwOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAvKiBxdWV1ZSBpcyBub3QgZW1wdHkgKi8KKyAgICAgICAgdl9VMzJfdCB0YWlsID0gZ3Zvc1RyYWNlRGF0YS50YWlsICsgMTsKKworICAgICAgICBpZiAoTUFYX1ZPU19UUkFDRV9SRUNPUkRTID09IHRhaWwpCisgICAgICAgIHsKKyAgICAgICAgICAgIHRhaWwgPSAwOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGd2b3NUcmFjZURhdGEuaGVhZCA9PSB0YWlsKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBmdWxsICovCisgICAgICAgICAgICBpZiAoTUFYX1ZPU19UUkFDRV9SRUNPUkRTID09ICsrZ3Zvc1RyYWNlRGF0YS5oZWFkKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGd2b3NUcmFjZURhdGEuaGVhZCA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBndm9zVHJhY2VEYXRhLnRhaWwgPSB0YWlsOworICAgIH0KKworICAgIHJlYyA9ICZndm9zVHJhY2VUYmxbZ3Zvc1RyYWNlRGF0YS50YWlsXTsKKyAgICByZWMtPmNvZGUgPSBjb2RlOworICAgIHJlYy0+c2Vzc2lvbiA9IHNlc3Npb247CisgICAgcmVjLT5kYXRhID0gZGF0YTsKKyAgICByZWMtPnRpbWUgPSB2b3NfdGltZXJfZ2V0X3N5c3RlbV90aW1lKCk7CisgICAgcmVjLT5tb2R1bGUgPSAgbW9kdWxlOworICAgIGd2b3NUcmFjZURhdGEubnVtU2luY2VMYXN0RHVtcCArKzsKKyAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlKCZsdHJhY2VMb2NrLCBmbGFncyk7Cit9CisKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBcYnJpZWYgdm9zX3RyYWNlX3NwaW5fbG9ja19pbml0KCkgLSBJbml0aWFsaXplcyB0aGUgbG9jayB2YXJpYWJsZSBiZWZvcmUgdXNlCisKKyAgVGhpcyBmdW5jdGlvbiB3aWxsIGJlIGNhbGxlZCBmcm9tIHZvc19wc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mUgdGhyZWFkIGF0IGEgdGltZSBjYW4gcmVhZCB0aGUgcmluZyBidWZmZXIgKi8KKyAgICBzcGluX2xvY2soJmx0cmFjZUxvY2spOworCisgICAgaWYgKGd2b3NUcmFjZURhdGEuaGVhZCAhPSBJTlZBTElEX1ZPU19UUkFDRV9BRERSKQorICAgIHsKKyAgICAgICAgaSA9IGd2b3NUcmFjZURhdGEuaGVhZDsKKyAgICAgICAgdGFpbCA9IGd2b3NUcmFjZURhdGEudGFpbDsKKworICAgICAgICBpZiAoY291bnQpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChjb3VudCA+IGd2b3NUcmFjZURhdGEubnVtKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNvdW50ID0gZ3Zvc1RyYWNlRGF0YS5udW07CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAodGFpbCA+PSAoY291bnQgLSAxKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpID0gdGFpbCAtIGNvdW50ICsgMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKGNvdW50ICE9IE1BWF9WT1NfVFJBQ0VfUkVDT1JEUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpID0gTUFYX1ZPU19UUkFDRV9SRUNPUkRTIC0gKChjb3VudCAtIDEpIC0gdGFpbCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwUmVjb3JkID0gZ3Zvc1RyYWNlVGJsW2ldOworICAgICAgICAvKiByaWdodCBub3cgd2UgYXJlIG5vdCB1c2luZyBudW1TaW5jZUxhc3REdW1wIG1lbWJlciBidXQgaW4gZnV0dXJlCisgICAgICAgICAgIHdlIG1pZ2h0IHJlLXZpc2l0IGFuZCB1c2UgdGhpcyBtZW1iZXIgdG8gdHJhY2sgaG93IG1hbnkgbGF0ZXN0CisgICAgICAgICAgIG1lc3NhZ2VzIGdvdCBhZGRlZCB3aGlsZSB3ZSB3ZXJlIGR1bXBpbmcgZnJvbSByaW5nIGJ1ZmZlciAqLworICAgICAgICBndm9zVHJhY2VEYXRhLm51bVNpbmNlTGFzdER1bXAgPSAwOworICAgICAgICBzcGluX3VubG9jaygmbHRyYWNlTG9jayk7CisgICAgICAgIGZvciAoOzspCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmICgoY29kZSA9PSAwIHx8IChjb2RlID09IHBSZWNvcmQuY29kZSkpICYmCisgICAgICAgICAgICAgICAgICAgICh2b3N0cmFjZUNCVGFibGVbcFJlY29yZC5tb2R1bGVdICE9IE5VTEwpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICgwID09IGJpdG1hc2tfb2ZfbW9kdWxlKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICB2b3N0cmFjZUNCVGFibGVbcFJlY29yZC5tb2R1bGVdKHBNYWMsICZwUmVjb3JkLCAodl9VMTZfdClpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICBpZiAoYml0bWFza19vZl9tb2R1bGUgJiAoMSA8PCBwUmVjb3JkLm1vZHVsZSkpCisgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIHZvc3RyYWNlQ0JUYWJsZVtwUmVjb3JkLm1vZHVsZV0ocE1hYywgJnBSZWNvcmQsICh2X1UxNl90KWkpOworICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChpID09IHRhaWwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpICs9IDE7CisKKyAgICAgICAgICAgIHNwaW5fbG9jaygmbHRyYWNlTG9jayk7CisgICAgICAgICAgICBpZiAoTUFYX1ZPU19UUkFDRV9SRUNPUkRTID09IGkpCisgICA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TkNFIE9GIFRISVMgU09GVFdBUkUuCisgKi8KKworLyoKKyAqIFRoaXMgZmlsZSB3YXMgb3JpZ2luYWxseSBkaXN0cmlidXRlZCBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGSUxFOiAgICAgICAgIHZvc191dGlscy5jCisKKyAgT1ZFUlZJRVc6ICAgICBUaGlzIHNvdXJjZSBmaWxlIGNvbnRhaW5zIGRlZmluaXRpb25zIGZvciB2T1MgY3J5cHRvIEFQSXMKKyAgICAgICAgICAgICAgICBUaGUgZm91ciBBUElzIG1lbnRpb25lZCBpbiB0aGlzIGZpbGUgYXJlIHVzZWQgZm9yCisgICAgICAgICAgICAgICAgaW5pdGlhbGl6aW5nLCBhbmQgZGUtaW5pdGlhbGl6aW5nIGEgY3J5cHRvIGNvbnRleHQsIGFuZAorICAgICAgICAgICAgICAgIG9idGFpbmluZyB0cnVseSByYW5kb20gZGF0YSAoZm9yIGtleXMpLCBhcyB3ZWxsIGFzCisgICAgICAgICAgICAgICAgU0hBMSBITUFDLCBhbmQgQUVTIGVuY3J5cHQgYW5kIGRlY3J5cHQgcm91dGluZXMuCisKKyAgICAgICAgICAgICAgICBUaGUgcm91dGluZXMgaW5jbHVkZToKKyAgICAgICAgICAgICAgICB2b3NfY3J5cHRvX2luaXQoKSAtIEluaXRpYWxpemVzIENyeXB0byBtb2R1bGUKKyAgICAgICAgICAgICAgICB2b3NfY3J5cHRvX2RlaW5pdCgpIC0gRGUtaW5pdGlhbGl6ZXMgQ3J5cHRvIG1vZHVsZQorICAgICAgICAgICAgICAgIHZvc19yYW5kX2dldF9ieXRlcygpIC0gR2VuZXJhdGVzIHJhbmRvbSBieXRlCisgICAgICAgICAgICAgICAgdm9zX3NoYTFfaG1hY19zdHIoKSAtIEdlbmVyYXRlIHRoZSBITUFDLVNIQTEgb2YgYSBzdHJpbmcgZ2l2ZW4gYSBrZXkKKyAgICAgICAgICAgICAgICB2b3NfZW5jcnlwdF9BRVMoKSAtIEdlbmVyYXRlIEFFUyBFbmNyeXB0ZWQgYnl0ZSBzdHJlYW0KKyAgICAgICAgICAgICAgICB2b3NfZGVjcnlwdF9BRVMoKSAtIERlY3J5cHRzIGFuIEFFUyBFbmNyeXB0ZWQgYnl0ZSBzdHJlYW0KKworICBERVBFTkRFTkNJRVM6CisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRURJVCBISVNUT1JZIEZPUiBNT0RVTEUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICogSW5jbHVkZSBGaWxlcworICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisKKyNpbmNsdWRlICJ2b3NfdHJhY2UuaCIKKyNpbmNsdWRlICJ2b3NfdXRpbHMuaCIKKyNpbmNsdWRlICJ2b3NfbWVtb3J5LmgiCisjaW5jbHVkZSA8bGludXgvd2Nuc3Nfd2xhbi5oPgorCis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c2ggKndjbnNzX3dsYW5fY3J5cHRvX2FsbG9jX2FoYXNoKGNvbnN0IGNoYXIgKmFsZ19uYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludCB0eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludCBtYXNrKTsKKworZXh0ZXJuIGludCB3Y25zc193bGFuX2NyeXB0b19haGFzaF9kaWdlc3Qoc3RydWN0IGFoYXNoX3JlcXVlc3QgKnJlcSk7CitleHRlcm4gdm9pZCB3Y25zc193bGFuX2NyeXB0b19mcmVlX2FoYXNoKHN0cnVjdCBjcnlwdG9fYWhhc2ggKnRmbSk7CitleHRlcm4gaW50IHdjbnNzX3dsYW5fY3J5cHRvX2FoYXNoX3NldGtleShzdHJ1Y3QgY3J5cHRvX2FoYXNoICp0Zm0sIGNvbnN0IHU4ICprZXksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQga2V5bGVuKTsKK2V4dGVybiBzdHJ1Y3QgY3J5cHRvX2FibGtjaXBoZXIgKndjbnNzX3dsYW5fY3J5cHRvX2FsbG9jX2FibGtjaXBoZXIoY29uc3QgY2hhciAqYWxnX25hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUzMiB0eXBlLCB1MzIgbWFzayk7CitleHRlcm4gdm9pZCB3Y25zc193bGFuX2FibGtjaXBoZXJfcmVxdWVzdF9mcmVlKHN0cnVjdCBhYmxrY2lwaGVyX3JlcXVlc3QgKnJlcSk7CitleHRlcm4gdm9pZCB3Y25zc193bGFuX2NyeXB0b19mcmVlX2FibGtjaXBoZXIoc3RydWN0IGNyeXB0b19hYmxrY2lwaGVyICp0Zm0pOworCisvKi0tLS0tLS0tLS0t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7CisgICAgc3RydWN0IGhtYWNfc2hhMV9yZXN1bHQgdHJlc3VsdDsKKyAgICB2b2lkICpoYXNoX2J1ZmYgPSBOVUxMOworCisgICAgdW5zaWduZWQgY2hhciBoYXNoX3Jlc3VsdFs2NF07CisgICAgaW50IGk7CisKKyAgICBtZW1zZXQob3V0cHV0LCAwLCBvdXRsZW4pOworCisgICAgaW5pdF9jb21wbGV0aW9uKCZ0cmVzdWx0LmNvbXBsZXRpb24pOworCisgICAgdGZtID0gd2Nuc3Nfd2xhbl9jcnlwdG9fYWxsb2NfYWhhc2goImhtYWMoc2hhMSkiLCBDUllQVE9fQUxHX1RZUEVfQUhBU0gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1JZUFRPX0FMR19UWVBFX0FIQVNIX01BU0spOworICAgIGlmIChJU19FUlIodGZtKSkgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgImNyeXB0b19hbGxvY19haGFzaCBmYWlsZWQiKTsKKyAgICAgICAgcmV0ID0gUFRSX0VSUih0Zm0pOworICAgICAgICBnb3RvIGVycl90Zm07CisgICAgfQorCisgICAgcmVxID0gYWhhc2hfcmVxdWVzdF9hbGxvYyh0Zm0sIEdGUF9LRVJORUwpOworICAgIGlmICghcmVxKSB7CisgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1ZPU1MsVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAiZmFpbGVkIHRvIGFsbG9jYXRlIHJlcXVlc3QgZm9yIGhtYWMoc2hhMSkiKTsKKyAgICAgICAgcmV0ID0gLUVOT01FTTsKKyAgICAgICAgZ290byBlcnJfcmVxOworICAgIH0KKworICAgIGFoYXNoX3JlcXVlc3Rfc2V0X2NhbGxiYWNrKHJlcSwgQ1JZUFRPX1RGTV9SRVFfTUFZX0JBQ0tMT0csCisgICAgICAgICAgICAgICAgICAgICAgICAgICA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ZFTF9FUlJPUiwgInJldCAweCV4IiwgcmV0KTsKKworICAgIHN3aXRjaCAocmV0KSB7CisgICAgY2FzZSAwOgorICAgICAgICBmb3IgKGk9MDsgaTwgb3V0bGVuOyBpKyspCisgICAgICAgICAgICBvdXRwdXRbaV0gPSBoYXNoX3Jlc3VsdFtpXTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSAtRUlOUFJPR1JFU1M6CisgICAgY2FzZSAtRUJVU1k6CisgICAgICAgIHJldCA9IHdhaXRfZm9yX2NvbXBsZXRpb25faW50ZXJydXB0aWJsZSgmdHJlc3VsdC5jb21wbGV0aW9uKTsKKyAgICAgICAgaWYgKCFyZXQgJiYgIXRyZXN1bHQuZXJyKSB7CisgICAgICAgICAgICBmb3IgKGk9MDsgaTwgb3V0bGVuOyBpKyspCisgICAgICAgICAgICAgICAgb3V0cHV0W2ldID0gaGFzaF9yZXN1bHRbaV07CisgICAgICAgICAgICBJTklUX0NPTVBMRVRJT04odHJlc3VsdC5jb21wbGV0aW9uKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUyxWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJ3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGUgZmFpbGVkIik7CisgICAgICAgICAgICBpZiAoIXJldCkKKyAgICAgICAgICAgICAgICByZXQgPSB0cmVzdWx0LmVycjsKKyAgICAgICAgICAgIGdvdG8gb3V0OworICAgICAgICB9CisgICAgZGVmYXVsdDoKKyAgICAgICAgZ290byBvdXQ7CisgICAgfQorCitvdXQ6CitlcnJfc2V0a2V5OgorICAgIGtmcmVlKGhhc2hfYnVmZik7CitlcnJfaGFzaF9idWY6CisgICAgYWhhc2hfcmVxdWVzdF9mcmVlKHJlcSk7CitlcnJfcmVxOgorICAgIHdjbnNzX3dsYW5fY3J5cHRvX2ZyZWVfYWhhc2godGZtKTsKK2Vycl90Zm06CisgICAgcmV0dXJuIHJldDsKK30KKworVk9TX1NUQVRVUyB2b3Nfc2hhMV9obWFjX3N0cih2X1UzMl90IGNyeXB0SGFuZGxlLCAvKiBIYW5kbGUgKi8KKyAgICAgICAgICAgdl9VOF90ICpwVGV4dCwgLyogcG9pbnRlciB0byBkYXRhIHN0cmVhbSAqLworICAgICAgICAgICB2X1UzMl90IHRleHRMZW4sIC8qIGxlbmd0aCBvZiBkYXRhIHN0cmVhbSAqLworICAgICAgICAgICB2X1U4X3QgKnBLZXksIC8qIHBvaW50ZXIgdG8gYXV0aGVudGljYXRpb24ga2V5ICovCisgICAgICAgICAgIHZfVTMyX3Qga2V5TGVuLCAvKiBsZW5ndGggb2YgYXV0aGVudGljYXRpb24ga2V5ICovCisgICAgICAgICAgIHZfVThfdCBkaWdlc3RbVk9TX0RJR0VTVF9TSEExX1NJWkVdKS8qIGNhbGxlciBkaWdlc3QgdG8gYmUgZmlsbGVkIGluICovCit7CisgICAgaW50IHJldCA9IDA7CisKKyAgICByZXQgPSBobWFjX3NoYTEoCisgICAgICAgICAgICBwS2V5LCAgICAgICAgICAgICAgICAgICAvL3ZfVThfdCAqa2V5LAorICAgICAgICAgICAgKHZfVThfdCkga2V5TGVuLCAgICAgICAgLy92X1U4X3Qga3NpemUsCisgICAgICAgICAgICAoY2hhciAqKXBUZXh0LCAgICAgICAgICAvL2NoYXIgKnBsYWludGV4dCwKKyAgICAgICAgICAgICh2X1U4X3QpIHRleHRMZW4sICAgICAgIC8vdl9VOF90IHBzaXplLAorICAgICAgICAgICAgZGlnZXN0LCAgICAgICAgICAgICAgICAgLy92X1U4X3QgKm91dHB1dCwKKyAgICAgICAgICAgIFZPU19ESUdFU1RfU0hBMV9TSVpFICAgIC8vdl9VOF90IG91dGxlbgorICAgICAgICAgICAgKTsKKworICAgIGlmIChyZXQgIT0gMCkgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLFZPU19UUkF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gICAgICAgcmV0ID0gd2Nuc3Nfd2xhbl9jcnlwdG9fYWhhc2hfc2V0a2V5KHRmbSwga2V5LCBrc2l6ZSk7CisKKyAgICAgICAgaWYgKHJldCkgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUyxWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJjcnlwdG9fYWhhc2hfc2V0a2V5IGZhaWxlZCIpOworICAgICAgICAgICAgZ290byBlcnJfc2V0a2V5OworICAgICAgICB9CisgICAgfQorCisgICAgYWhhc2hfcmVxdWVzdF9zZXRfY3J5cHQocmVxLCAmc2csIGhhc2hfcmVzdWx0LCBwc2l6ZSk7CisgICAgcmV0ID0gd2Nuc3Nfd2xhbl9jcnlwdG9fYWhhc2hfZGlnZXN0KHJlcSk7CisKKyAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgInJldCAweCV4IiwgcmV0KTsKKworICAgIHN3aXRjaCAocmV0KSB7CisgICAgICAgIGNhc2UgMDoKKyAgICAgICAgICAgIGZvciAoaT0wOyBpPCBvdXRsZW47IGkrKykKKyAgICAgICAgICAgICAgICAgICAgb3V0cHV0W2ldID0gaGFzaF9yZXN1bHRbaV07CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAtRUlOUFJPR1JFU1M6CisgICAgICAgIGNhc2UgLUVCVVNZOgorICAgICAgICAgICAgIHJldCA9IHdhaXRfZm9yX2NvbXBsZXRpb25faW50ZXJydXB0aWJsZSgmdHJlc3VsdC5jb21wbGV0aW9uKTsKKyAgICAgICAgICAgICBpZiAoIXJldCAmJiAhdHJlc3VsdC5lcnIpIHsKKyAgICAgICAgICAgICAgICAgZm9yIChpPTA7IGk8IG91dGxlbjsgaSsrKQorICAgICAgICAgICAgICAgICAgICAgb3V0cHV0W2ldID0gaGFzaF9yZXN1bHRbaV07CisgICAgICAgICAgICAgICAgIElOSVRfQ09NUExFVElPTih0cmVzdWx0LmNvbXBsZXRpb24pOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIndhaXRfZm9yX2NvbXBsZXRpb25faW50ZXJydXB0aWJsZSBmYWlsZWQiKTsKKyAgICAgICAgICAgICAgICAgaWYgKCFyZXQpCisgICAgICAgICAgICAgICAgICAgICByZXQgPSB0cmVzdWx0LmVycjsKKyAgICAgICAgICAgICAgICAgZ290byBvdXQ7CisgICAgICAgICAgICAgfQorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICBnb3RvIG91dDsKKyAgICAgICAgfQorCitvdXQ6CitlcnJfc2V0a2V5OgorICAgICAgICBrZnJlZShoYXNoX2J1ZmYpOworZXJyX2hhc2hfYnVmOgorICAgICAgICBhaGFzaF9yZXF1ZXN0X2ZyZWUocmVxKTsKK2Vycl9yZXE6CisgICAgICAgIHdjbnNzX3dsYW5fY3J5cHRvX2ZyZWVfYWhhc2godGZtKTsKK2Vycl90Zm06CisgICAgICAgIHJldHVybiByZXQ7Cit9CisKK1ZPU19TVEFUVVMgdm9zX21kNV9obWFjX3N0cih2X1UzMl90IGNyeXB0SGFuZGxlLCAvKiBIYW5kbGUgKi8KKyAgICAgICAgICAgdl9VOF90ICpwVGV4dCwgLyogcG9pbnRlciB0byBkYXRhIHN0cmVhbSAqLworICAgICAgICAgICB2X1UzMl90IHRleHRMZW4sIC8qIGxlbmd0aCBvZiBkYXRhIHN0cmVhbSAqLworICAgICAgICAgICB2X1U4X3QgKnBLZXksIC8qIHBvaW50ZXIgdG8gYXV0aGVudGljYXRpb24ga2V5ICovCisgICAgICAgICAgIHZfVTMyX3Qga2V5TGVuLCAvKiBsZW5ndGggb2YgYXV0aGVudGljYXRpb24ga2V5ICovCisgICAgICAgICAgIHZfVThfdCBkaWdlc3RbVk9TX0RJR0VTVF9NRDVfU0laRV0pLyogY2FsbGVyIGRpZ2VzdCB0byBiZSBmaWxsZWQgaW4gKi8KK3sKKyAgICBpbnQgcmV0ID0gMDsKKworICAgIHJldCA9IGhtYWNfbWQ1KAorICAgICAgICAgICAgcEtleSwgICAgICAgICAgICAgICAgICAgLy92X1U4X3QgKmtleSwKKyAgICAgICAgICAgICh2X1U4X3QpIGtleUxlbiwgICAgICAgIC8vdl9VOF90IGtzaXplLAorICAgICAgICAgICAgKGNoYXIgKilwVGV4dCwgICAgICAgICAgLy9jaGFyICpwbGFpbnRleHQsCisgICAgICAgICAgICAodl9VOF90KSB0ZXh0TGVuLCAgICAgICAvL3ZfVThfdCBwc2l6ZSwKKyAgICAgICAgICAgIGRpZ2VzdCwgICAgICAgICAgICAgICAgIC8vdl9VOF90ICpvdXRwdXQsCisgICAgICAgICAgICBWT1NfRElHRVNUX01ENV9TSVpFICAgICAvL3ZfVThfdCBvdXRsZW4KKyAgICAgICAgICAgICk7CisKKyAgICBpZiAocmV0ICE9IDApIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUyxWT1NfVFJBQ0VfTEVWRUxfRVJST1IsImhtYWNfbWQ1KCkgY2FsbCBmYWlsZWQiKTsKKyAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgICB9CisKKyAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfQorCisKK3N0cnVjdCBlY2JfYWVzX3Jlc3VsdCB7CisgICAgc3RydWN0IGNvbXBsZXRpb24gY29tcGxldGlvbjsKKyAgICBpbnQgZXJyOworfTsKKworc3RhdGljIHZvaWQgZWNiX2Flc19jb21wbGV0ZShzdHJ1Y3QgY3J5cHRvX2FzeW5jX3JlcXVlc3QgKnJlcSwgaW50IGVycikKK3sKKyAgICBzdHJ1Y3QgZWNiX2Flc19yZXN1bHQgKnIgPSByZXEtPmRhdGE7CisgICAgaWYgKGVyciA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cSA9IGFibGtjaXBoZXJfcmVxdWVzdF9hbGxvYyh0Zm0sIEdGUF9LRVJORUwpOworICAgIGlmICghcmVxKSB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJGYWlsZWQgdG8gYWxsb2NhdGUgcmVxdWVzdCBmb3IgY2JjKGFlcykiKTsKKyAgICAgICAgcmV0ID0gLUVOT01FTTsKKyAgICAgICAgZ290byBlcnJfcmVxOworICAgIH0KKworICAgIGFibGtjaXBoZXJfcmVxdWVzdF9zZXRfY2FsbGJhY2socmVxLCBDUllQVE9fVEZNX1JFUV9NQVlfQkFDS0xPRywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjYl9hZXNfY29tcGxldGUsICZyZXN1bHQpOworCisKKyAgICBjcnlwdG9fYWJsa2NpcGhlcl9jbGVhcl9mbGFncyh0Zm0sIH4wKTsKKworICAgIHJldCA9IGNyeXB0b19hYmxrY2lwaGVyX3NldGtleSh0Zm0sIHBLZXksIEtFWV9TSVpFX0FFU18xMjgpOworICAgIGlmIChyZXQpIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfVk9TUyxWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJjcnlwdG9fY2lwaGVyX3NldGtleSBmYWlsZWQiKTsKKyAgICAgICAgZ290byBlcnJfc2V0a2V5OworICAgICAgIH0KKworICAgIG1lbXNldChpdiwgMCwgSVZfU0laRV9BRVNfMTI4KTsKKworICAgIHNnX2luaXRfb25lKCZzZ19pbiwgcFRleHQsIEFFU19CTE9DS19TSVpFKTsKKworICAgIHNnX2luaXRfb25lKCZzZ19vdXQsIHBEZWNyeXB0ZWQsIEFFU19CTE9DS19TSVpFKTsKKworICAgIGFibGtjaXBoZXJfcmVxdWVzdF9zZXRfY3J5cHQocmVxLCAmc2dfaW4sICZzZ19vdXQsIEFFU19CTE9DS19TSVpFLCBpd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9EVUxFX0lEX1ZPU1MsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwgIk1lbW9yeSBhbGxvY2F0aW9uIGZhaWxlZCIpOworICAgICAgICAgICAgcmV0dXJuIFZPU19GQUxTRTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIk1lbW9yeSBpcyBhbHJlYWR5IGFsbG9jYXRlZCIpOworICAgICAgICByZXR1cm4gVk9TX0ZBTFNFOworICAgIH0KKworICAgIHJldHVybiBWT1NfVFJVRTsKK30KKworCit2X0JPT0xfdCB2b3Nfcm9hbV9kZWxheV9zdGF0c19kZWluaXQodm9pZCkKK3sKKyAgICBpZiAoZ3BSb2FtRGVsYXlUYWJsZSAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgdmZyZWUoZ3BSb2FtRGVsYXlUYWJsZSk7CisgICAgICAgIGdwUm9hbURlbGF5VGFibGUgPSBOVUxMOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgIk1lbW9yeSBpcyBhbHJlYWR5IGZyZWVkIik7CisgICAgICAgIHJldHVybiBWT1NfRkFMU0U7CisgICAgfQorCisgICAgcmV0dXJuIFZPU19UUlVFOworfQorCit2b2lkIHZvc19yZWNvcmRfcm9hbV9ldmVudChlbnVtIGVfcm9hbWluZ19ldmVudCByb2FtX2V2ZW50LCB2b2lkICpwQnVmZiwgdl9VTE9OR190IGJ1ZmZfbGVuKQoreworICAgIGlmIChncFJvYW1EZWxheVRhYmxlID09IE5VTEwpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAiUm9hb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lX3RpbWUgPSB2b3NfdGltZXJfZ2V0X3N5c3RlbV90aW1lKCk7CisgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZV9TTUVfRElTQVNTT0NfQ09NUExFVEU6CisgICAgICAgICAgICAgZ1JvYW1EZWxheU1ldGFJbmZvLmRpc2Fzc29jX2NvbXBfdGltZSA9IHZvc190aW1lcl9nZXRfc3lzdGVtX3RpbWUoKTsKKyAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlX0xJTV9BRERfQlNfUkVROgorICAgICAgICAgICAgIGdSb2FtRGVsYXlNZXRhSW5mby5saW1fYWRkX2Jzc19yZXFfdGltZSA9IHZvc190aW1lcl9nZXRfc3lzdGVtX3RpbWUoKTsKKyAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlX0xJTV9BRERfQlNfUlNQOgorICAgICAgICAgICAgIGdSb2FtRGVsYXlNZXRhSW5mby5saW1fYWRkX2Jzc19yc3BfdGltZSA9IHZvc190aW1lcl9nZXRfc3lzdGVtX3RpbWUoKTsKKyAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlX0hERF9FTkFCTEVfVFhfUVVFVUU6CisgICAgICAgICAgICAgZ1JvYW1EZWxheU1ldGFJbmZvLmhkZF9tb25pdG9yX3R4ID0gTU9OSVRPUl9TVEFSVDsKKyAgICAgICAgICAgICBnUm9hbURlbGF5TWV0YUluZm8uZW5hYmxlX3R4X3F1ZXVlc19yZWFzc29jX3RpbWUgPSB2b3NfdGltZXJfZ2V0X3N5c3RlbV90aW1lKCk7CisgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZV9IRERfU0VUX1BUS19SRVE6CisgICAgICAgICAgICAgZ1JvYW1EZWxheU1ldGFJbmZvLnNldF9wdGtfcm9hbV9rZXlfdGltZSA9IHZvc190aW1lcl9nZXRfc3lzdGVtX3RpbWUoKTsKKyAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlX0hERF9TRVRfR1RLX1JFUToKKyAgICAgICAgICAgICBnUm9hbURlbGF5TWV0YUluZm8uc2V0X2d0a19yb2FtX2tleV90aW1lID0gdm9zX3RpbWVyX2dldF9zeXN0ZW1fdGltZSgpOworICAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVfSEREX1NFVF9QVEtfUlNQOgorICAgICAgICAgICAgIGdSb2FtRGVsYXlNZXRhSW5mby5jb21wbGV0ZV9wdGtfcm9hbV9rZXlfdGltZSA9IHZvc190aW1lcl9nZXRfc3lzdGVtX3RpbWUoKTsKKyAgICAgICAgICAgICAvL3Zvc19tZW1fY29weSgmZ1JvYW1EZWxheU1ldGFJbmZvLnBlZXJfbWFjX2FkZHIsIHBCdWZmLCBidWZmX2xlbik7CisgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZV9IRERfU0VUX0dUS19SU1A6CisgICAgICAgICAgICAgZ1JvYW1EZWxheU1ldGFJbmZvLmNvbXBsZXRlX2d0a19yb2FtX2tleV90aW1lID0gdm9zX3RpbWVyX2dldF9zeXN0ZW1fdGltZSgpOworICAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVfVExfRklSU1RfWE1JVF9USU1FOgorICAgICAgICAgICAgIGlmKGdSb2FtRGVsYXlNZXRhSW5mby5sb2dfdGwpCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBnUm9hbURlbGF5TWV0YUluZm8udGxfZmV0Y2hfcGt0X3RpbWUgPSB2b3NfdGltZXJfZ2V0X3N5c3RlbV90aW1lKCk7CisgICAgICAgICAgICAgICAgIGdSb2FtRGVsYXlNZXRhSW5mby5sb2dfdGwgPSBWT1NfRkFMU0U7CisgICAgICAgICAgICAgfQorICAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVfSEREX0ZJUlNUX1hNSVRfVElNRToKKyAgICAgICAgICAgICBpZihnUm9hbURlbGF5TWV0YUluZm8uaGRkX21vbml0b3JfdHggIT0gTU9OSVRPUl9TVE9QKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgc3RydWN0IHNrX2J1ZmYgKnNrYiA9IChzdHJ1Y3Qgc2tfYnVmZiAqKXBCdWZmOworICAgICAgICAgICAgICAgICBpZighc2tiKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJldmVudCBlX0hERF9GSVJTVF9YTUlUX1RJTUUgc2tiIGlzIG51bGwiKTsKKyAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICBpZigoZ1JvYW1EZWxheU1ldGFJbmZvLmhkZF9hdXRoX3R5cGUgPT0gZVZPU19BVVRIX1RZUEVfUlNOX1BTSykgfHwKKyAgICAgICAgICAgICAgICAgICAgKGdSb2FtRGVsYXlNZXRhSW5mby5oZGRfYXV0aF90eXBlID09IGVWT1NfQVVUSF9UWVBFX1dQQV9QU0spKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAvL0hkZCB4bWl0IHdpbGwgaGF2ZSBvbmx5IDgwMi4zIHBrdCBzbyBvZmZzZXQgd2lsbCBwYXNzIGFzIGFjY29yZGluZ2x5CisgICAgICAgICAgICAgICAgICAgICBpZih2b3Nfc2tiX2lzX2VhcG9sKHNrYiwgVk9TX0VUSEVSVFlQRV84MDJfMV9YX0ZSQU1FX09GRlNFVF9JTl84MDJfM19QS1QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX0VUSEVSVFlQRV84MDJfMV9YX1NJWkUpID09IFZPU19UUlVFKQorICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBpZihnUm9hbURlbGF5TWV0YUluZm8uaGRkX2VhcG9sX20yID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCJIREQgWE1JVCBtMiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ1JvYW1EZWxheU1ldGFJbmZvLmhkZF9lYXBvbF9tMiA9IHZvc190aW1lcl9nZXRfc3lzdGVtX3RpbWUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdSb2FtRGVsYXlNZXRhSW5mby5keGVfbW9uaXRvcl90eCA9IE1PTklUT1JfU1RBUlQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigoZ1JvYW1EZWxheU1ldGFJbmZvLmhkZF9lYXBvbF9tMikgJiYgKGdSb2FtRGVsYXlNZXRhSW5mby5oZGRfZWFwb2xfbTQgPT0gMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ1JvYW1EZWxheU1ldGFJbmZvLmhkZF9lYXBvbF9tNCA9IHZvc190aW1lcl9nZXRfc3lzdGVtX3RpbWUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCJIREQgWE1JVCBtNCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ1JvYW1EZWxheU1ldGFJbmZvLmhkZF9tb25pdG9yX3R4ID0gTU9OSVRPUl9FQVBPTF9ET05FOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9XZSBzaG91bGQgcmV0dXJuIGZyb20gaGVyZSBzbyBjYW4gY2FjaGUgdGhlIHRpbWUgZm9yIGZpcnN0IGRhdGEgcGt0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBnUm9hbURlbGF5TWV0YUluZm8uaGRkX21vbml0b3JfdHggPSBNT05JVE9SX0VBUE9MX0RPTkU7CisgICAgICAgICAgICAgICAgICAgIGdSb2FtRGVsYXlNZXRhSW5mby5keGVfbW9uaXRvcl90eCA9IE1PTklUT1JfU1RBUlQ7CisgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgLy9FYXBvbCBpcyBkb25lIGl0IG11c3QgYmUgZmlyc3QgZGF0YSBmcmFtZSBjYXB0dXJlIGl0CisgICAgICAgICAgICAgICAgIGlmKGdSb2FtRGVsYXlNZXRhSW5mby5oZGRfbW9uaXRvcl90eCA9PSBNT05JVE9SX0VBUE9MX0RPTkUpCisgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgIGdSb2FtRGVsYXlNZXRhSW5mby5oZGRfZmlyc3RfcGt0X2xlbiA9IDUwOworICAgICAgICAgICAgICAgICAgICAgZ1JvYW1EZWxheU1ldGFJbmZvLmhkZF9maXJzdF94bWl0X3RpbWUgPSB2b3NfdGltZXJfZ2V0X3N5c3RlbV90aW1lKCk7CisgICAgICAgICAgICAgICAgICAgICBnUm9hbURlbGF5TWV0YUluZm8ubG9nX3RsID0gVk9TX1RSVUU7CisgICAgICAgICAgICAgICAgICAgICBnUm9hbURlbGF5TWV0YUluZm8uaGRkX21vbml0b3JfdHggPSBNT05JVE9SX1NUT1A7CisgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkhERCAlcyBYTUlUIGZpcnN0IGRhdGEgZnJhbWUgYWZ0ZXIgcm9hbWluZyIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgICAgICAgIGlmKHNrYi0+bGVuIDwgZ1JvYW1EZWxheU1ldGFJbmZvLmhkZF9maXJzdF9wa3RfbGVuKQorICAgICAgICAgICAgICAgICAgICAgICAgIGdSb2FtRGVsYXlNZXRhSW5mby5oZGRfZmlyc3RfcGt0X2xlbiA9IHNrYi0+bGVuOworICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZnUm9hbURlbGF5TWV0YUluZm8uaGRkX2ZpcnN0X3BrdF9kYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNrYi0+ZGF0YSxnUm9hbURlbGF5TWV0YUluZm8uaGRkX2ZpcnN0X3BrdF9sZW4pOworICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgfQorICAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGVfSEREX1JYX1BLVF9DQktfVElNRToKKyAgICAgICAgICAgICBpZihnUm9hbURlbGF5TWV0YUluZm8uaGRkX21vbml0b3JfcnggIT0gTU9OSVRPUl9TVE9QKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgc3RydWN0IHNrX2J1ZmYgKnNrYiA9IChzdHJ1Y3Qgc2tfYnVmZiAqKXBCdWZmOworICAgICAgICAgICAgICAgICBpZighc2tiKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZXZlbnQgZV9IRERfUlhfUEtUX0NCS19USU1FIHNrYiBpcyBudWxsIik7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICBpZigoZ1JvYW1EZWxheU1ldGFJbmZvLmhkZF9hdXRoX3R5cGUgPT0gZVZPU19BVVRIX1RZUEVfUlNOX1BTSykgfHwKKyAgICAgICAgICAgICAgICAgICAgKGdSb2FtRGVsYXlNZXRhSW5mby5oZGRfYXV0aF90eXBlID09IGVWT1NfQVVUSF9UWVBFX1dQQV9QU0spKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICBpZih2b3Nfc2tiX2lzX2VhcG9sKHNrYiwgVk9TX0VUSEVSVFlQRV84MDJfMV9YX0ZSQU1FX09GRlNFVF9JTl84MDJfM19QS1QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX0VUSEVSVFlQRV84MDJfMV9YX1NJWkUpID09IFZPU19UUlVFKQorICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGdSb2FtRGVsYXlNZXRhSW5mby5oZGRfZWFwb2xfbTEgPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCJIREQgcmVjdiBtMSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnUm9hbURlbGF5TWV0YUluZm8uaGRkX2VhcG9sX20xID0gdm9zX3RpbWVyX2dldF9zeXN0ZW1fdGltZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKChnUm9hbURlbGF5TWV0YUluZm8uaGRkX2VhcG9sX20xKSAmJiAoZ1JvYW1EZWxheU1ldGFJbmZvLmhkZF9lYXBvbF9tMyA9PSAwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdSb2FtRGVsYXlNZXRhSW5mby5oZGRfZWFwb2xfbTMgPSB2b3NfdGltZXJfZ2V0X3N5c3RlbV90aW1lKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCJIREQgcmVjdiBtMyIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnUm9hbURlbGF5TWV0YUluZm8uaGRkX21vbml0b3JfcnggPSBNT05JVE9SX0VBUE9MX0RPTkU7CisgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgZ1JvYW1EZWxheU1ldGFJbmZvLmhkZF9tb25pdG9yX3J4ID0gTU9OSVRPUl9FQVBPTF9ET05FOworICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgIGlmKGdSb2FtRGVsYXlNZXRhSW5mby5oZGRfbW9uaXRvcl9yeCA9PSBNT05JVE9SX0VBUE9MX0RPTkUpCisgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgIGdSb2FtRGVsYXlNZXRhSW5mby5oZGRfbW9uaXRvcl9yeCA9IE1PTklUT1JfU1RPUDsKKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlX0RYRV9SWF9QS1RfVElNRToKKyAgICAgICAgICAgICBpZihnUm9hbURlbGF5TWV0YUluZm8uZHhlX21vbml0b3JfcnggIT0gTU9OSVRPUl9TVE9QKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgdm9zX3BrdF90ICp2b3NfcGt0ID0gTlVMTDsKKyAgICAgICAgICAgICAgICAgc3RydWN0IHNrX2J1ZmYgKnNrYiA9IE5VTEw7CisgICAgICAgICAgICAgICAgIHZvc19wa3QgPSAodm9zX3BrdF90ICopcEJ1ZmY7CisgICAgICAgICAgICAgICAgIGlmKCF2b3NfcGt0KQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZXZlbnQgZV9EWEVfUlhfUEtUX1RJTUUgdm9zX3BrdCBpcyBudWxsIik7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICBza2IgPSB2b3NfcGt0LT5wU2tiOworICAgICAgICAgICAgICAgICBpZighc2tiKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZXZlbnQgZV9EWEVfUlhfUEtUX1RJTUUgc2tiIGlzIG51bGwiKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgIC8vRFhFIGNhbiBSRUNWIE1HTVQgYW5kIERBVEEgZnJhbWUsIHdlIGFyZSBpbnRlcmV0c2VkIGluIG9ubHkgREFUQSBmcmFtZQorICAgICAgICAgICAgICAgICBpZihidWZmX2xlbiAmIFZPU19NQUNfREFUQV9GUkFNRSkKKyAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgaWYoKGdSb2FtRGVsYXlNZXRhSW5mby5oZGRfYXV0aF90eXBlID09IGVWT1NfQVVUSF9UWVBFX1JTTl9QU0spIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAoZ1JvYW1EZWxheU1ldGFJbmZvLmhkZF9hdXRoX3R5cGUgPT0gZVZPU19BVVRIX1RZUEVfV1BBX1BTSykpCisgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgaWYodm9zX3NrYl9pc19lYXBvbChza2IsIFZPU19FVEhFUlRZUEVfODAyXzFfWF9GUkFNRV9PRkZTRVRfSU5fODAyXzExX1BLVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX0VUSEVSVFlQRV84MDJfMV9YX1NJWkUpID09IFZPU19UUlVFKQorICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZ1JvYW1EZWxheU1ldGFJbmZvLmR4ZV9lYXBvbF9tMSA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywiRFhFIHJlY3YgbTEiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdSb2FtRGVsYXlNZXRhSW5mby5keGVfZWFwb2xfbTEgPSB2b3NfdGltZXJfZ2V0X3N5c3RlbV90aW1lKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigoZ1JvYW1EZWxheU1ldGFJbmZvLmR4ZV9lYXBvbF9tMSkgJiYgKGdSb2FtRGVsYXlNZXRhSW5mby5keGVfZWFwb2xfbTMgPT0gMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdSb2FtRGVsYXlNZXRhSW5mby5keGVfZWFwb2xfbTMgPSB2b3NfdGltZXJfZ2V0X3N5c3RlbV90aW1lKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywiRFhFIHJlY3YgbTMiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdSb2FtRGVsYXlNZXRhSW5mby5keGVfbW9uaXRvcl9yeCA9IE1PTklUT1JfRUFQT0xfRE9ORTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICBnUm9hbURlbGF5TWV0YUluZm8uZHhlX21vbml0b3JfcnggPSBNT05JVE9SX0VBUE9MX0RPTkU7CisgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICBpZihnUm9hbURlbGF5TWV0YUluZm8uZHhlX21vbml0b3JfcnggPT0gTU9OSVRPUl9FQVBPTF9ET05FKQorICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgIGdSb2FtRGVsYXlNZXRhSW5mby5keGVfbW9uaXRvcl9yeCA9IE1PTklUT1JfU1RPUDsKKyAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgIHByaW50aygiZV9EWEVfUlhfUEtUX1RJTUUgZHVtcCBtZ210IGZyYW1lcyIpOworICAgICAgICAgICAgICAgICAgICAgdm9zX3RyYWNlX2hleF9kdW1wKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCAmc2tiLT5kYXRhWzBdLCBza2ItPmxlbik7CisgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICB9CisgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgZV9EWEVfRklSU1RfWE1JVF9USU1FOgorICAgICAgICAgICAgIGlmKGdSb2FtRGVsYXlNZXRhSW5mby5keGVfbW9uaXRvcl90eCAhPSBNT05JVE9SX1NUT1ApCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICB2b3NfcGt0X3QgKnZvc19wa3QgPSBOVUxMOworICAgICAgICAgICAgICAgICBzdHJ1Y3Qgc2tfYnVmZiAqc2tiID0gTlVMTDsKKyAgICAgICAgICAgICAgICAgdm9zX3BrdCA9ICh2b3NfcGt0X3QgKilwQnVmZjsKKyAgICAgICAgICAgICAgICAgaWYoIXZvc19wa3QpCisgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJldmVudCBlX0RYRV9GSVJTVF9YTUlUX1RJTUUgdm9zX3BrdCBpcyBudWxsIik7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICBza2IgPSB2b3NfcGt0LT5wU2tiOworICAgICAgICAgICAgICAgICBpZighc2tiKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZXZlbnQgZV9EWEVfRklSU1RfWE1JVF9USU1FIHNrYiBpcyBudWxsIik7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAvL0RYRSBjYW4gVHhtaXQgTUdNVCBhbmQgREFUQSBmcmFtZSwgd2UgYXJlIGludGVyZXRzZWQgaW4gb25seSBEQVRBIGZyYW1lCisgICAgICAgICAgICAgICAgIGlmKGJ1ZmZfbGVuICYgVk9TX01BQ19EQVRBX0ZSQU1FKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmKChnUm9hbURlbGF5TWV0YUluZm8uaGRkX2F1dGhfdHlwZSA9PSBlVk9TX0FVVEhfVFlQRV9SU05fUFNLKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAoZ1JvYW1EZWxheU1ldGFJbmZvLmhkZF9hdXRoX3R5cGUgPT0gZVZPU19BVVRIX1RZUEVfV1BBX1BTSykpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHZvc19za2JfaXNfZWFwb2woc2tiLCBWT1NfRVRIRVJUWVBFXzgwMl8xX1hfRlJBTUVfT0ZGU0VUX0lOXzgwMl8xMV9QS1QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX0VUSEVSVFlQRV84MDJfMV9YX1NJWkUpID09IFZPU19UUlVFKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihnUm9hbURlbGF5TWV0YUluZm8uZHhlX2VhcG9sX20yID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCJEWEUgWE1JVCBtMiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ1JvYW1EZWxheU1ldGFJbmZvLmR4ZV9lYXBvbF9tMiA9IHZvc190aW1lcl9nZXRfc3lzdGVtX3RpbWUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKChnUm9hbURlbGF5TWV0YUluZm8uZHhlX2VhcG9sX20yKSAmJiAoZ1JvYW1EZWxheU1ldGFJbmZvLmR4ZV9lYXBvbF9tNCA9PSAwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnUm9hbURlbGF5TWV0YUluZm8uZHhlX2VhcG9sX200ID0gdm9zX3RpbWVyX2dldF9zeXN0ZW1fdGltZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sIkRYRSBYTUlUIG00Iik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnUm9hbURlbGF5TWV0YUluZm8uZHhlX21vbml0b3JfdHggPSBNT05JVE9SX0VBUE9MX0RPTkU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1dlIHNob3VsZCByZXR1cm4gZnJvbSBoZXJlIHNvIGNhbiBjYWNoZSB0aGUgdGltZSBmb3IgZmlyc3QgZGF0YSBwa3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBnUm9hbURlbGF5TWV0YUluZm8uZHhlX21vbml0b3JfdHggPSBNT05JVE9SX0VBUE9MX0RPTkU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgLy9IQUNLIGJ1ZmYgbGVuIGlzIGdldHRpbmcgdXNlZCBhcyBGUkFNRSBUWVBFCisgICAgICAgICAgICAgICAgICAgIGlmKGdSb2FtRGVsYXlNZXRhSW5mby5keGVfbW9uaXRvcl90eCA9PSBNT05JVE9SX0VBUE9MX0RPTkUpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdSb2FtRGVsYXlNZXRhSW5mby5keGVfZmlyc3RfdHhfdGltZSA9IHZvc190aW1lcl9nZXRfc3lzdGVtX3RpbWUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdSb2FtRGVsYXlNZXRhSW5mby5keGVfbW9uaXRvcl90eCA9IE1PTklUT1JfU1RPUDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdSb2FtRGVsYXlNZXRhSW5mby5keGVfZmlyc3RfcGt0X2xlbiA9IDc1OworICAgICAgICAgICAgICAgICAgICAgICAgaWYoc2tiLT5sZW4gPCBnUm9hbURlbGF5TWV0YUluZm8uZHhlX2ZpcnN0X3BrdF9sZW4pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ1JvYW1EZWxheU1ldGFJbmZvLmR4ZV9maXJzdF9wa3RfbGVuID0gc2tiLT5sZW47CisgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJmdSb2FtRGVsYXlNZXRhSW5mby5keGVfZmlyc3RfcGt0X2RhdGEsIHNrYi0+ZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnUm9hbURlbGF5TWV0YUluZm8uZHhlX2ZpcnN0X3BrdF9sZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJEWEUgJXMgWE1JVCBmaXJzdCBkYXRhIGZyYW1lIGFmdGVyIHJvYW1pbmciLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlX1NNRV9WT19BRERUU19SRVE6CisgICAgICAgICAgICAgZ1JvYW1EZWxheU1ldGFJbmZvLmhkZF9hZGR0c192b19yZXFfdGltZSA9IHZvc190aW1lcl9nZXRfc3lzdGVtX3RpbWUoKTsKKyAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlX1NNRV9WT19BRERUU19SU1A6CisgICAgICAgICAgICAgZ1JvYW1EZWxheU1ldGFJbmZvLmhkZF9hZGR0c192b19yc3BfdGltZSA9IHZvc190aW1lcl9nZXRfc3lzdGVtX3RpbWUoKTsKKyAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlX1NNRV9WSV9BRERUU19SRVE6CisgICAgICAgICAgICAgZ1JvYW1EZWxheU1ldGFJbmZvLmhkZF9hZGR0c192aV9yZXFfdGltZSA9IHZvc190aW1lcl9nZXRfc3lzdGVtX3RpbWUoKTsKKyAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlX1NNRV9WSV9BRERUU19SU1A6CisgICAgICAgICAgICAgZ1JvYW1EZWxheU1ldGFJbmZvLmhkZF9hZGR0c192aV9yc3BfdGltZSA9IHZvc190aW1lcl9nZXRfc3lzdGVtX3RpbWUoKTsKKyAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBlX0NBQ0hFX1JPQU1fREVMQVlfREFUQToKKyAgICAgICAgICAgICAvL0xldCB1cyBjb3B5IHJvYW0gbWV0YSBpbmZvCisgICAgICAgICAgICAgaWYoZ1JvYW1EZWxheUN1cnJlbnRJbmRleCA+IFJPQU1fREVMQVlfVEFCTEVfU0laRSkKKyAgICAgICAgICAgICAgICAgZ1JvYW1EZWxheUN1cnJlbnRJbmRleCA9IDA7CisgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZncFJvYW1EZWxheVRhYmxlW2dSb2FtRGVsYXlDdXJyZW50SW5kZXgrK10sCisgICAgICAgICAgICAgICAgICAgICAgICAgICZnUm9hbURlbGF5TWV0YUluZm8sIHNpemVvZihnUm9hbURlbGF5TWV0YUluZm8pKTsKKyAgICAgICAgICAgICB2b3NfbWVtX3NldCgmZ1JvYW1EZWxheU1ldGFJbmZvLCBzaXplb2YoZ1Jv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hYmxlIGlzIG5vdCBpbml0aWFsaXplZFxuIik7CisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgLy9MZXQgdXMgZmlyc3QgY29weSB0aGUgY3VycmVudCBnUm9hbURlbGF5TWV0YUluZm8gaW50byBncFJvYW1EZWxheVRhYmxlCisgICAgaWYoZ1JvYW1EZWxheUN1cnJlbnRJbmRleCA+IFJPQU1fREVMQVlfVEFCTEVfU0laRSkKKyAgICAgICAgZ1JvYW1EZWxheUN1cnJlbnRJbmRleCA9IDA7CisgICAgdm9zX21lbV9jb3B5KCZncFJvYW1EZWxheVRhYmxlW2dSb2FtRGVsYXlDdXJyZW50SW5kZXgrK10sICZnUm9hbURlbGF5TWV0YUluZm8sIHNpemVvZihnUm9hbURlbGF5TWV0YUluZm8pKTsKKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgIioqIFJvYW1EZWxheSA9ICggZHhlX2ZpcnN0X3R4X3RpbWUgLSBkaXNhYmxlX3R4X3F1ZXVlc190aW1lKVxuIik7CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICJ8fD09PT09PT09PT09PT09PT09PT09PT09PSIKKyAgICAgICAgICI9PT09PT09PT09PT09PT18PT09PT09IEEgPT09PT09fD09PT09PSBCID09PT09PXw9PT09PT0gQyA9PT09PT18IgorICAgICAgICAgIj09PT09PSBEID09PT09PXw9PT09PT0gRSA9PT09PT18PT09PT09IEYgPT09PT09fD09PT09PSBHID09PT09PXwiCisgICAgICAgICAiPT09PT09IEggPT09PT09fD09PT09PSBJID09PT09PXw9PT09PT0gSiA9PT09PT18PT09PT09IEsgPT09PT09fCIKKyAgICAgICAgICI9PT09PT0gTCA9PT09PT18PT09PT09IE0gPT09PT09fHxcbiIpOworCisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAifHxTbCB8IFBlZXIgTUFDIGFkZHJlc3MgIHwiCisgICAgICAgICAiICoqUm9hbURlbGF5KiogfCBQcmVBdXRoIFRpbWVyIHwgRGlzYXNzb2MgSXNzdWV8IEFkZCBCU1MgUmVxICAgfCIKKyAgICAgICAgICIgQWRkQnNzUnNwIHRvICB8IFJlYXNzb2NSZXEgdG8gfCBSZWFzc29jUnNwIHRvIHwgRGlzYWJsZSB0byAgICB8IgorICAgICAgICAgIiBNMS1NMiBEWEUgU1cgIHwgTTEtTTIgSEREIFNXICB8IE0zLU00IERYRSBTVyAgfCBNMy1NNCBIREQgU1cgIHwiCisgICAgICAgICAiIFJlYXNzb2NSc3AgdG8gfCBIREQgdG8gRFhFICAgIHx8XG4iKTsKKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgInx8Tm8ufCAgICAgICAgICAgICAgICAgICB8IgorICAgICAgICAgIiAqKioqKioqKioqKioqIHwgdG8gUm9hbSBTdGFydCB8IHRvIENvbXBsZXRlICAgfCB0byBSc3AgdGltZSAgIHwiCisgICAgICAgICAiIFJlYXNzb2MgUmVxICAgfCBSZWFzc29jUnNwICAgIHwgRW5hYmxlIFR4IFF1ZSB8IEVuYWJsZSBUeCBRdWUgfCIKKyAgICAgICAgICIgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICB8IgorICAgICAgICAgIiBTZXQgR1RLICAgICAgIHwgMXN0IGRhdGEgZnJhbWV8fFxuIik7CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICJ8fD09PT09PT09PT09PT09PT09PT09PT09PSIKKyAgICAgICAgICI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09IgorICAgICAgICAgIj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0iCisgICAgICAgICAiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSIKKyAgICAgICAgICI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09fHxcbiIpOworCisgICAgZm9yIChpbmRleCA9IDA7IGluZGV4IDwgZ1JvYW1EZWxheUN1cnJlbnRJbmRleDsgaW5kZXgrKykKKyAgICB7CisgICAgICAgIGN1cnJlbnRSb2FtRGVsYXlJbmZvID0gZ3BSb2FtRGVsYXlUYWJsZVtpbmRleF07CisgICAgICAgIC8qIFByZUF1dGggVGltZXIgdG8gUm9hbSBTdGFydCAqLworICAgICAgICBzbEEgPSAoY3VycmVudFJvYW1EZWxheUluZm8ucHJlYXV0aF9jYl90aW1lIC0KKyAgICAgICAgICAgICAgIGN1cnJlbnRSb2FtRGVsYXlJbmZvLnByZWF1dGhfcmVhc3NvY19zdGFydF90aW1lKTsKKworICAgICAgICAvKiBEaXNhc3NvYyBJc3N1ZSB0byBDb21wbGV0ZSAqLworICAgICAgICBzbEIgPSAoY3VycmVudFJvYW1EZWxheUluZm8uZGlzYXNzb2NfY29tcF90aW1lIC0KKyAgICAgICAgICAgICAgIGN1cnJlbnRSb2FtRGVsYXlJbmZvLmRpc2Fzc29jX2lzc3VlX3RpbWUpOworCisgICAgICAgIC8qIEFkZCBCU1MgUmVxIHRvIFJzcCB0aW1lICovCisgICAgICAgIHNsQyA9IChjdXJyZW50Um9hbURlbGF5SW5mby5saW1fYWRkX2Jzc19yc3BfdGltZSAtCisgICAgICAgICAgICAgICBjdXJyZW50Um9hbURlbGF5SW5mby5saW1fYWRkX2Jzc19yZXFfdGltZSk7CisKKyAgICAgICAgLyogQWRkQnNzUnNwIHRvIFJlYXNzb2MgUmVxICovCisgICAgICAgIHNsRCA9IChjdXJyZW50Um9hbURlbGF5SW5mby5zZW5kX3JlYXNzb2NfcmVxX3RpbWUgLQorICAgICAgICAgICAgICAgY3VycmVudFJvYW1EZWxheUluZm8ubGltX2FkZF9ic3NfcnNwX3RpbWUpOworCisgICAgICAgIC8qIFJlYXNzb2NSZXEgdG8gUmVhc3NvY1JzcCAqLworICAgICAgICBzbEUgPSAoY3VycmVudFJvYW1EZWxheUluZm8uaGRkX3NlbmRhc3NvY19yc3BfdGltZSAtCisgICAgICAgICAgICAgICBjdXJyZW50Um9hbURlbGF5SW5mby5zZW5kX3JlYXNzb2NfcmVxX3RpbWUpOworCisgICAgICAgIC8qIFJlYXNzb2NSc3AgdG8gRW5hYmxlIFR4IFF1ZSAqLworICAgICAgICBzbEYgPSAoY3VycmVudFJvYW1EZWxheUluZm8uZW5hYmxlX3R4X3F1ZXVlc19yZWFzc29jX3RpbWUgLQorICAgICAgICAgICAgICAgY3VycmVudFJvYW1EZWxheUluZm8uaGRkX3NlbmRhc3NvY19yc3BfdGltZSk7CisKKyAgICAgICAgLyogRGlzYWJsZSB0byBFbmFibGUgVHggUXVlICovCisgICAgICAgIHNsRyA9IChjdXJyZW50Um9hbURlbGF5SW5mby5lbmFibGVfdHhfcXVldWVzX3JlYXNzb2NfdGltZSAtCisgICAgICAgICAgICAgICBjdXJyZW50Um9hbURlbGF5SW5mby5kaXNhYmxlX3R4X3F1ZXVlc190aW1lKTsKKworICAgICAgICAvKiBNMS1NMiBEWEUgU1cgKi8KKyAgICAgICAgc2xIID0gKGN1cnJlbnRSb2FtRGVsYXlJbmZvLmR4ZV9lYXBvbF9tMiAtCisgICAgICAgICAgICAgICBjdXJyZW50Um9hbURlbGF5SW5mby5keGVfZWFwb2xfbTEpOworCisgICAgICAgIC8qIE0xLU0yIEhERCBTVyAqLworICAgICAgICBzbEkgPSAoY3VycmVudFJvYW1EZWxheUluZm8uaGRkX2VhcG9sX20yIC0KKyAgICAgICAgICAgICAgIGN1cnJlbnRSb2FtRGVsYXlJbmZvLmhkZF9lYXBvbF9tMSk7CisKKyAgICAgICAgLyogTTMtTTQgRFhFIFNXICovCisgICAgICAgIHNsSiA9IChjdXJyZW50Um9hbURlbGF5SW5mby5keGVfZWFwb2xfbTQgLQorICAgICAgICAgICAgICAgY3VycmVudFJvYW1EZWxheUluZm8uZHhlX2VhcG9sX20zKTsKKworICAgICAgICAvKiBNMy1NNCBIREQgU1cgKi8KKyAgICAgICAgc2xLID0gKGN1cnJlbnRSb2FtRGVsYXlJbmZvLmhkZF9lYXBvbF9tNCAtCisgICAgICAgICAgICAgICBjdXJyZW50Um9hbURlbGF5SW5mby5oZGRfZWFwb2xfbTMpOworCisgICAgICAgIC8qIFJlYXNzb2NSc3AgdG8gU2V0IEdUSyAqLworICAgICAgICBzbEwgPSAoY3VycmVudFJvYW1EZWxheUluZm8uc2V0X2d0a19yb2FtX2tleV90aW1lIC0KKyAgICAgICAgICAgICAgIGN1cnJlbnRSb2FtRGVsYXlJbmZvLmhkZF9zZW5kYXNzb2NfcnNwX3RpbWUpOworCisgICAgICAgIC8qIEhERCB0byBEWEUgMXN0IGRhdGEgZnJhbWUgKi8KKyAgICAgICAgc2xNID0gKGN1cnJlbnRSb2FtRGVsYXlJbmZvLmR4ZV9maXJzdF90eF90aW1lIC0KKyAgICAgICAgICAgICAgIGN1cnJlbnRSb2FtRGVsYXlJbmZvLmhkZF9maXJzdF94bWl0X3RpbWUpOworCisgICAgICAgIC8qIENhbGN1bGF0ZSByb2FtIGRlbGF5ICovCisgICAgICAgIHNsUm9hbURlbGF5ID0gKGN1cnJlbnRSb2FtRGVsYXlJbmZvLmR4ZV9maXJzdF90eF90aW1lIC0KKyAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudFJvYW1EZWxheUluZm8uZGlzYWJsZV90eF9xdWV1ZXNfdGltZSk7CisKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgInx8JTJsZDp8PCJNQUNfQUREUkVTU19TVFIiPnwiCisgICAgICAgICAgICAgICAgIiUxNGxkIHwlMTRsZCB8JTE0bGQgfCUxNGxkIHwiCisgICAgICAgICAgICAgICAgIiUxNGxkIHwlMTRsZCB8JTE0bGQgfCUxNGxkIHwiCisgICAgICAgICAgICAgICAgIiUxNGxkIHwlMTRsZCB8JTE0bGQgfCUxNGxkIHwiCisgICAgICAgICAgICAgICAgIiUxNGxkIHwlMTRsZCB8fFxuIiwKKyAgICAgICAgICAgICAgICAoaW5kZXgrMSksIE1BQ19BRERSX0FSUkFZKGN1cnJlbnRSb2FtRGVsYXlJbmZvLnBlZXJfbWFjX2FkZHIpLAorICAgICAgICAgICAgICAgIHNsUm9hbURlbGF5LCBzbEEsIHNsQiwgc2xDLAorICAgICAgICAgICAgICAgIHNsRCwgc2xFLCBzbEYsIHNsRywKKyAgICAgICAgICAgICAgICBzbEgsIHNsSSwgc2xKLCBzbEssCisgICAgICAgICAgICAgICAgc2xMLCBzbE0gKTsKKyAgICB9CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICJ8fD09PT09PT09PT09PT09PT09PT09PT09PSIKKyAgICAgICAgICI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09IgorICAgICAgICAgIj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0iCisgICAgICAgICAiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSIKKyAgICAgICAgICI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09fHxcbiIpOworCisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAifHw9PSBNb3JlIERldGFpbHMgPT09PT09PT09PT09PT09PT09PT09IgorICAgICAgICAgIj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT18fFxuIik7CisKKyAgICBmb3IgKGluZGV4ID0gMDsgaW5kZXggPCBnUm9hbURlbGF5Q3VycmVudEluZGV4OyBpbmRleCsrKQorICAgIHsKKworICAgICAgICBjdXJyZW50Um9hbURlbGF5SW5mbyA9IGdwUm9hbURlbGF5VGFibGVbaW5kZXhdOworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAifHwlMmxkOiBQZWVyIE1hYzogPCJNQUNfQUREUkVTU19TVFIiPlxuIiwKKyAgICAgICAgICAgICAgICAoaW5kZXgrMSksIE1BQ19BRERSX0FSUkFZKGN1cnJlbnRSb2FtRGVsYXlJbmZvLnBlZXJfbWFjX2FkZHIpCisgICAgICAgICAgICAgICAgKTsKKworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAifHxwcmVhdXRoX3JlYXNzb2Nfc3RhcnRfdGltZSA6ICUxNGxkXG4iLAorICAgICAgICAgICAgICAgIGN1cnJlbnRSb2FtRGVsYXlJbmZvLnByZWF1dGhfcmVhc3NvY19zdGFydF90aW1lCisgICAgICAgICAgICAgICAgKTsKKworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAifHxwcmVhdXRoX2NiX3RpbWUgICAgICAgICAgICA6ICUxNGxkXG4iLAorICAgICAgICAgICAgICAgIGN1cnJlbnRSb2FtRGVsYXlJbmZvLnByZWF1dGhfY2JfdGltZQorICAgICAgICAgICAgICAgICk7CisKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgInx8ZGlzYWJsZV90eF9xdWV1ZXNfdGltZSAgICAgOiAlMTRsZFxuIiwKKyAgICAgICAgICAgICAgICBjdXJyZW50Um9hbURlbGF5SW5mby5kaXNhYmxlX3R4X3F1ZXVlc190aW1lCisgICAgICAgICAgICAgICAgKTsKKworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAifHxkaXNhc3NvY19pc3N1ZV90aW1lICAgICAgICA6ICUxNGxkXG4iLAorICAgICAgICAgICAgICAgIGN1cnJlbnRSb2FtRGVsYXlJbmZvLmRpc2Fzc29jX2lzc3VlX3RpbWUKKyAgICAgICAgICAgICAgICApOworCisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICJ8fGxpbV9hZGRfYnNzX3JlcV90aW1lICAgICAgIDogJTE0bGRcbiIsCisgICAgICAgICAgICAgICAgY3VycmVudFJvYW1EZWxheUluZm8ubGltX2FkZF9ic3NfcmVxX3RpbWUKKyAgICAgICAgICAgICAgICApOworCisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICJ8fGxpbV9hZGRfYnNzX3JzcF90aW1lICAgICAgIDogJTE0bGRcbiIsCisgICAgICAgICAgICAgICAgY3VycmVudFJvYW1EZWxheUluZm8ubGltX2FkZF9ic3NfcnNwX3RpbWUKKyAgICAgICAgICAgICAgICApOworCisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICJ8fGRpc2Fzc29jX2NvbXBfdGltZSAgICAgICAgIDogJTE0bGRcbiIsCisgICAgICAgICAgICAgICAgY3VycmVudFJvYW1EZWxheUluZm8uZGlzYXNzb2NfY29tcF90aW1lCisgICAgICAgICAgICAgICAgKTsKKworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAifHxzZW5kX3JlYXNzb2NfcmVxX3RpbWUgICAgICA6ICUxNGxkXG4iLAorICAgICAgICAgICAgICAgIGN1cnJlbnRSb2FtRGVsYXlJbmZvLnNlbmRfcmVhc3NvY19yZXFfdGltZQorICAgICAgICAgICAgICAgICk7CisKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgInx8aGRkX3NlbmRhc3NvY19yc3BfdGltZSAgICAgOiAlMTRsZFxuIiwKKyAgICAgICAgICAgICAgICBjdXJyZW50Um9hbURlbGF5SW5mby5oZGRfc2VuZGFzc29jX3JzcF90aW1lCisgICAgICAgICAgICAgICAgKTsKKworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAifHxlbmFibGVfdHhfcXVldWVzX3RpbWUgICAgICA6ICUxNGxkXG4iLAorICAgICAgICAgICAgICAgIGN1cnJlbnRSb2FtRGVsYXlJbmZvLmVuYWJsZV90eF9xdWV1ZXNfcmVhc3NvY190aW1lCisgICAgICAgICAgICAgICAgKTsKKworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAifHxoZGRfZWFwb2xfbTEgICAgICAgICAgICAgICA6ICUxNGxkXG4iLAorICAgICAgICAgICAgICAgIGN1cnJlbnRSb2FtRGVsYXlJbmZvLmhkZF9lYXBvbF9tMQorICAgICAgICAgICAgICAgICk7CisKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgInx8aGRkX2VhcG9sX20yICAgICAgICAgICAgICAgOiAlMTRsZFxuIiwKKyAgICAgICAgICAgICAgICBjdXJyZW50Um9hbURlbGF5SW5mby5oZGRfZWFwb2xfbTIKKyAgICAgICAgICAgICAgICApOworCisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICJ8fGhkZF9lYXBvbF9tMyAgICAgICAgICAgICAgIDogJTE0bGRcbiIsCisgICAgICAgICAgICAgICAgY3VycmVudFJvYW1EZWxheUluZm8uaGRkX2VhcG9sX20zCisgICAgICAgICAgICAgICAgKTsKKworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAifHxoZGRfZWFwb2xfbTQgICAgICAgICAgICAgICA6ICUxNGxkXG4iLAorICAgICAgICAgICAgICAgIGN1cnJlbnRSb2FtRGVsYXlJbmZvLmhkZF9lYXBvbF9tNAorICAgICAgICAgICAgICAgICk7CisKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgInx8ZHhlX2VhcG9sX20xICAgICAgICAgICAgICAgOiAlMTRsZFxuIiwKKyAgICAgICAgICAgICAgICBjdXJyZW50Um9hbURlbGF5SW5mby5keGVfZWFwb2xfbTEKKyAgICAgICAgICAgICAgICApOworCisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICJ8fGR4ZV9lYXBvbF9tMiAgICAgICAgICAgICAgIDogJTE0bGRcbiIsCisgICAgICAgICAgICAgICAgY3VycmVudFJvYW1EZWxheUluZm8uZHhlX2VhcG9sX20yCisgICAgICAgICAgICAgICAgKTsKKworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAifHxkeGVfZWFwb2xfbTMgICAgICAgICAgICAgICA6ICUxNGxkXG4iLAorICAgICAgICAgICAgICAgIGN1cnJlbnRSb2FtRGVsYXlJbmZvLmR4ZV9lYXBvbF9tMworICAgICAgICAgICAgICAgICk7CisKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgInx8ZHhlX2VhcG9sX200ICAgICAgICAgICAgICAgOiAlMTRsZFxuIiwKKyAgICAgICAgICAgICAgICBjdXJyZW50Um9hbURlbGF5SW5mby5keGVfZWFwb2xfbTQKKyAgICAgICAgICAgICAgICApOworCisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICJ8fHNldF9wdGtfcm9hbV9rZXlfdGltZSAgICAgIDogJTE0bGRcbiIsCisgICAgICAgICAgICAgICAgY3VycmVudFJvYW1EZWxheUluZm8uc2V0X3B0a19yb2FtX2tleV90aW1lCisgICAgICAgICAgICAgICAgKTsKKworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAifHxzZXRfZ3RrX3JvYW1fa2V5X3RpbWUgICAgICA6ICUxNGxkXG4iLAorICAgICAgICAgICAgICAgIGN1cnJlbnRSb2FtRGVsYXlJbmZvLnNldF9ndGtfcm9hbV9rZXlfdGltZQorICAgICAgICAgICAgICAgICk7CisKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgInx8dGxfZmV0Y2hfcGt0X3RpbWUgICAgICAgICAgOiAlMTRsZFxuIiwKKyAgICAgICAgICAgICAgICBjdXJyZW50Um9hbURlbGF5SW5mby50bF9mZXRjaF9wa3RfdGltZQorICAgICAgICAgICAgICAgICk7CisKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX0hERCwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgInx8aGRkX2ZpcnN0X3htaXRfdGltZSAgICAgICAgOiAlMTRsZFxuIiwKKyAgICAgICAgICAgICAgICBjdXJyZW50Um9hbURlbGF5SW5mby5oZGRfZmlyc3RfeG1pdF90aW1lCisgICAgICAgICAgICAgICAgKTsKKworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAifHxkeGVfZmlyc3RfdHhfdGltZSAgICAgICAgICA6ICUxNGxkXG4iLAorICAgICAgICAgICAgICAgIGN1cnJlbnRSb2FtRGVsYXlJbmZvLmR4ZV9maXJzdF90eF90aW1lCisgICAgICAgICAgICAgICAgKTsKKworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAifHxoZGRfZmlyc3RfcGt0X2RhdGEgICAgICAgICA6IFxuIgorICAgICAgICAgICAgICAgICk7CisKKworICAgICAgICBmb3IgKGk9MDsgaTxjdXJyZW50Um9hbURlbGF5SW5mby5oZGRfZmlyc3RfcGt0X2xlbiAmJiBpPCAoNTAtOCk7IGkrPTgpCisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgInx8JTJYLCAlMlgsICUyWCwgJTJYLCAlMlgsICUyWCwgJTJYLCAlMlgsICIsCisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRSb2FtRGVsYXlJbmZvLmhkZF9maXJzdF9wa3RfZGF0YVtpXSwKKyAgICAgICAgICAgICAgICAgICAgY3VycmVudFJvYW1EZWxheUluZm8uaGRkX2ZpcnN0X3BrdF9kYXRhW2krMV0sCisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRSb2FtRGVsYXlJbmZvLmhkZF9maXJzdF9wa3RfZGF0YVtpKzJdLAorICAgICAgICAgICAgICAgICAgICBjdXJyZW50Um9hbURlbGF5SW5mby5oZGRfZmlyc3RfcGt0X2RhdGFbaSszXSwKKyAgICAgICAgICAgICAgICAgICAgY3VycmVudFJvYW1EZWxheUluZm8uaGRkX2ZpcnN0X3BrdF9kYXRhW2krNF0sCisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRSb2FtRGVsYXlJbmZvLmhkZF9maXJzdF9wa3RfZGF0YVtpKzVdLAorICAgICAgICAgICAgICAgICAgICBjdXJyZW50Um9hbURlbGF5SW5mby5oZGRfZmlyc3RfcGt0X2RhdGFbaSs2XSwKKyAgICAgICAgICAgICAgICAgICAgY3VycmVudFJvYW1EZWxheUluZm8uaGRkX2ZpcnN0X3BrdF9kYXRhW2krN10KKyAgICAgICAgICAgICAgICAgICAgKTsKKworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAifHxkeGVfZmlyc3RfcGt0X2RhdGEgICAgICAgICA6IFxuIgorICAgICAgICAgICAgICAgICk7CisKKyAgICAgICAgZm9yIChpPTA7IGk8Y3VycmVudFJvYW1EZWxheUluZm8uZHhlX2ZpcnN0X3BrdF9sZW4gJiYgaSA8ICg3NS04KTsgaSs9OCkKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9IREQsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAifHwlMlgsICUyWCwgJTJYLCAlMlgsICUyWCwgJTJYLCAlMlgsICUyWCwgIiwKKyAgICAgICAgICAgICAgICAgICAgY3VycmVudFJvYW1EZWxheUluZm8uZHhlX2ZpcnN0X3BrdF9kYXRhW2ldLAorICAgICAgICAgICAgICAgICAgICBjdXJyZW50Um9hbURlbGF5SW5mby5keGVfZmlyc3RfcGt0X2RhdGFbaSsxXSwKKyAgICAgICAgICAgICAgICAgICAgY3VycmVudFJvYW1EZWxheUluZm8uZHhlX2ZpcnN0X3BrdF9kYXRhW2krMl0sCisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRSb2FtRGVsYXlJbmZvLmR4ZV9maXJzdF9wa3RfZGF0YVtpKzNdLAorICAgICAgICAgICAgICAgICAgICBjdXJyZW50Um9hbURlbGF5SW5mby5keGVfZmlyc3RfcGt0X2RhdGFbaSs0XSwKKyAgICAgICAgICAgICAgICAgICAgY3VycmVudFJvYW1EZWxheUluZm8uZHhlX2ZpcnN0X3BrdF9kYXRhW2krNV0sCisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRSb2FtRGVsYXlJbmZvLmR4ZV9maXJzdF9wa3RfZGF0YVtpKzZdLAorICAgICAgICAgICAgICAgICAgICBjdXJyZW50Um9hbURlbGF5SW5mby5keGVfZmlyc3RfcGt0X2RhdGFbaSs3XQorICAgICAgICAgICAgICAgICAgICApOworICAgIH0KKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfSERELCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICJ8fD09IEVORCA9PT09PT09PT09PT09PT09PT09PT0iCisgICAgICAgICAiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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worfTsKKworc3RhdGljIGludCBzaXplT25lRWxlbUJhc2VkT25GaWVsZElkQmFzaWNEYXRhVHlwZVtdID0geworICAgMSwgIC8vIF9GSUVMRF9JRF9EQVRBX1RZUEVfVTggPTAKKyAgIDQsICAvLyBfRklFTERfSURfREFUQV9UWVBFX1UzMgorICAgMSwgIC8vIF9GSUVMRF9JRF9EQVRBX1RZUEVfUzgKKyAgIDQsICAvLyBfRklFTERfSURfREFUQV9UWVBFX1MzMgorICAgMiwgIC8vIF9GSUVMRF9JRF9EQVRBX1RZUEVfVTE2CisgICAyLCAgLy8gX0ZJRUxEX0lEX0RBVEFfVFlQRV9TMTYKK307CisKK3N0YXRpYyBfTlZfU1RSRUFNX0JVRiBudlN0cmVhbVtfTlZfU1RSRUFNX0xFTl9NQVhdOworc3RhdGljIGludCBzdWJUYWJsZVJkLCBzdWJUYWJsZVdyOworCisjaWYgIWRlZmluZWQoX1JFQ1VSU0lWRV9WRVJTSU9OKQorI2RlZmluZSBfU1VCVEFCTEVTX01BWCAzMgorc3RhdGljIF9TVUJUQUJMRVNfUVVFVUUgc3ViVGFibGVzUXVldWVbX1NVQlRBQkxFU19NQVhdOworI2VuZGlmCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisqCisqIFN0b3JhZ2UgZm9yIE52VGFibGVzRnJvbUJpbgorKgorKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyovCisKKy8qCisgKiBJbml0IE52VGFibGVzRnJvbUJpbgorICogQWxsIGVudHJpZXMgYXJlIGluaXRpYWxpemVkIHRvIDAsIHBvaW50ZXJzIHRvIE5VTEwKKyovCisKK19OVl9URU1QTEFURV9UQUJMRSBOdlRhYmxlc0Zyb21CaW5bVEFCTEVTX01BWF1bVEFCTEVfRU5UUklFU19NQVhdID0geworICAgeyAvKiBUQUJMRV9MQVNUKi8KKyAgICAgICB7e251bH0sIDAsIDAsIDAsIDAsIDAsIDAsIHtudWx9fSwKKyAgIH0sCit9OworCitzdGF0aWMgdm9pZCBpbml0TnZUYWJsZXNGcm9tQmluKHZvaWQpCit7CisgICBpbnQgaSwgajsKKworICAgZm9yIChpID0gMDsgaSA8IFRBQkxFU19NQVg7IGkrKykgeworICAgICAgZm9yIChqID0gMDsgaiA8IFRBQkxFX0VOVFJJRVNfTUFYOyBqKyspIHsKKyAgICAgICAgIE52VGFibGVzRnJvbUJpbltpXVtqXS5maWVsZE5hbWVbMF0gPSBudWw7CisgICAgICAgICBOdlRhYmxlc0Zyb21CaW5baV1bal0uZmllbGROYW1lWzFdID0gbnVsOworICAgICAgICAgTnZUYWJsZXNGcm9tQmluW2ldW2pdLmZpZWxkTmFtZVsyXSA9IG51bDsKKyAgICAgICAgIE52VGFibGVzRnJvbUJpbltpXVtqXS5maWVsZElkID0gMDsKKyAgICAgICAgIE52VGFibGVzRnJvbUJpbltpXVtqXS5maWVsZFN0b3JhZ2VUeXBlID0gMDsKKyAgICAgICAgIE52VGFibGVzRnJvbUJpbltpXVtqXS5maWVsZFN0b3JhZ2VTaXplMSA9IDA7CisgICAgICAgICBOdlRhYmxlc0Zyb21CaW5baV1bal0uZmllbGRTdG9yYWdlU2l6ZTIgPSAwOworICAgICAgICAgTnZUYWJsZXNGcm9tQmluW2ldW2pdLmZpZWxkU3RvcmFnZVNpemUzID0gMDsKKyAgICAgICAgIE52VGFibGVzRnJvbUJpbltpXVtqXS5vZmZzZXQgPSAwOworICAgICAgICAgTnZUYWJsZXNGcm9tQmluW2ldW2pdLmZpZWxkRnVsbE5hbWVbMF0gPSBudWw7CisgICAgICAgICBOdlRhYmxlc0Zyb21CaW5baV1bal0uZmllbGRGdWxsTmFtZVsxXSA9IG51bDsKKyAgICAgICAgIE52VGFibGVzRnJvbUJpbltpXVtqXS5maWVsZEZ1bGxOYW1lWzJdID0gbnVsOworICAgICAgfQorICAgfQorCisgICByZXR1cm47Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisqCisqIFN0b3JhZ2UgZm9yIE52RW51bXNGcm9tQmluCisqCisqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorKi8KKworLyoKKyAqIFByZXBhcmUgdGhlIE5WIGVudW0gdGVtcGxhdGVzIHN0b3JhZ2UgcGFyc2VkIGZyb20gbnYuYmluCisgKiBUaGV5IGFyZSB1c2VkIGxhdGVyIGZvciBwYXJzaW5nIHRoZSBudi5iaW4gZGF0YQorICogQWxsIGVudHJpZXMgYXJlIGluaXRpYWxpemVkIHRvIDAsIHBvaW50ZXJzIHRvIE5VTEwKKyAqLworCitfTlZfVEVNUExBVEVfRU5VTSBOdkVudW1zRnJvbUJpbltJTkRFWF9FTlVNX01BWF1bRU5VTV9FTlRSSUVTX01BWF0gPSB7CisgICB7IC8qIElOREVYX0VOVU1fTEFTVCAqLworICAgICAge3tudWx9LCAwLCAwLCB7bnVsfX0sCisgICB9LAorfTsKKworc3RhdGljIHZvaWQgaW5pdE52RW51bXNGcm9tQmluKHZvaWQpCit7CisgICBpbnQgaSwgajsKKworICAgZm9yKGkgPSAwOyBpIDwgSU5ERVhfRU5VTV9NQVg7IGkrKykgeworICAgICAgZm9yKGogPSAwOyBqIDwgRU5VTV9FTlRSSUVTX01BWDsgaisrKSB7CisgICAgICAgICBOdkVudW1zRnJvbUJpbltpXVtqXS5lbnVtTmFtZVswXSA9IG51bDsKKyAgICAgICAgIE52RW51bXNGcm9tQmluW2ldW2pdLmVudW1OYW1lWzFdID0gbnVsOworICAgICAgICAgTnZFbnVtc0Zyb21CaW5baV1bal0uZW51bU5hbWVbMl0gPSBudWw7CisgICAgICAgICBOdkVudW1zRnJvbUJpbltpXVtqXS5lbnVtVmFsdWUgPSAwOworICAgICAgICAgTnZFbnVtc0Zyb21CaW5baV1bal0uZW51bVZhbHVlUGVlciA9IDB4RkY7CisgICAgICAgICBOdkVudW1zRnJvbUJpbltpXVtqXS5lbnVtRnVsbE5hbWVbMF0gPSBudWw7CisgICAgICB9CisgICB9CisgICByZXR1cm47Cit9CisKKworLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKy8vCisvLyBQYXJzZSB0ZW1wbGF0ZSBzdHJlYW1zCisvLworLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworLyoKKyAqIFJlYWQgbnYuYmluIHRvIGV4dHJhY3QgdGhlIHRlbXBsYXRlIGluZm8KKyAqICAgICBfTlZfVEVNUExBVEVfVEFCTEUgTnZUYWJsZXNGcm9tQmluW107CisgKi8KKworLyoKKyAqIFBhcnNlIG52LmJpbiBkYXRhIGFuZCBleHRyYWN0IHRvIHRoZSBidWlsZC1pbiBkYXRhIHN0b3JhZ2UKKyAqCisgKiBUaGVyZSBhcmUgdHdvIG91dGNvbWVzIGZyb20gZWFybGllciB0ZW1wbGF0ZXMgY29tcGFyaXNvbiBvcGVyYXRpb24uCisgKiAgICAgZGlmZmVyZW50IG9yIGlkZW50aWNhbAorICogSWYgaWRlbnRpY2FsLCB0aGlzIG9wZXJhdGlvbiB3aWxsIG1vc3QgbGlrZWx5IHRha2UgcGxhY2UuCisgKiBJZiBkaWZmZXJlbnQsCisgKiAgICAgT25lIGlzIHRvIHNpbXBseSBpbmRpY2F0ZSB0byB0aGUgdXNlciBhbmQgYWJvcnQgcmVhZGluZyB0aGUgbnYuYmluIGRhdGEKKyAqICAgICBUaGUgb3RoZXIgaXMgdG8gY29udGludWUgdGhpcyBvcGVyYXRpb24sIGFuZCBleHRyYWN0IHRoZSBtY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2V0IGFuZCBwcm9jZXNzIHN0cmVhbXMgb25lIGJ5IG9uZQorICAgd2hpbGUgKFJDX0ZBSUwgIT0gKHN0cmVhbVJjID0gTkVYVF9TVFJFQU0oJmxlbiwgJm52U3RyZWFtWzBdKSkgKSB7CisgICAgICAgIC8vIG5lZWQgdG8gY29weSwgc3RyZWFtIGxheWVyIGlzIGZyZWVpbmcgaXQKKyAgICAgIGlmIChsZW4gPiBfTlZfU1RSRUFNX0xFTl9NQVgpIHsKKyAgICAgICAgIGVyckNvZGUgPSBfU1RSRUFNX05PVF9GSVRfQlVGOworICAgICAgICAgZ290byBfZXJyb3I7CisgICAgICB9CisgICAgICAgIC8vIHRlbXBsYXRlIG9yIGRhdGEKKyAgICAgIGlmIChJc1N0cmVhbVRlbXBsYXRlKHBTdHJlYW1bX05WX0JJTl9TVFJFQU1fSEVBREVSX0JZVEVdKSkgeworICAgICAgICAgIGlmIChfTUlTX01BVENIID09IHByb2Nlc3NOdlRlbXBsYXRlKHBTdHJlYW0sIGxlbikpIHsKKyAgICAgICAgICAgICAgaWYgKF9GTEFHX0FORF9BQk9SVChnTlZQYXJzaW5nQ29udHJvbExvKSApIHsKKyAgICAgICAgICAgICAgICAgIGVyckNvZGUgPSBfU1dfQklOX01JU01BVENIOworICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICB9CisgICAgICBlbHNlIHsKKyAgICAgICAgICBwcm9jZXNzTnZEYXRhKHBTdHJlYW0sIGxlbik7CisgICAgICB9CisgICB9CisKK19lcnJvcjoKKyAgIGlmIChfT0sgIT0gZXJyQ29kZSkgeworICAgICAgcmV0ID0gVk9TX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICAgLy8gYWxsIGRvbmUKKyAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBfTlZfVEVNUExBVEVfUFJPQ0VTU19SQyBwcm9jZXNzTnZUZW1wbGF0ZShfTlZfU1RSRUFNX0J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gIGJyZWFrOworICAgICAgICAgfQorICAgICAgICAgaWYgKChwVGFibGVbMF1baV0uZmllbGRJZCAmIEZJRUxEX0lEX1RBQkxFX09SX0VOVU1fSURYX01BU0spID09CisgICAgICAgICAgIHRhYmxlSWR4KSB7CisgICAgICAgICAgICBzdHJsY3B5KHRhYmxlU3RyTmFtZSwgcFRhYmxlWzBdW2ldLmZpZWxkTmFtZSwgKF9UQUJMRV9OQU1FX0xFTiArMSkpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisgICAgIH0KKyAgICAgaWYgKFRBQkxFX0VOVFJJRVNfTUFYID09IGkpIHsKKyAgICAgICAgICAgIC8vIGlmIHN0cmluZyBuYW1lIG5vdCBmb3VuZCwgZG9uJ3Qga25vdyB3aGF0IHRvIGRvCisgICAgICAgIGVyckNvZGUgPSBfVEFCTEVfTk9OX0VYSVNUX0lOX1RBQkxFX09GX0FMTF9UQUJMRVM7CisgICAgICAgIGdvdG8gX2Vycm9yOworICAgICB9CisgICB9CisKKyAgICAvLyBjaGVjayBpZiB0aGUgdGFibGUgaXMgYWxyZWFkeSBwb3B1bGF0ZWQKKyAgIGlmIChudWwgIT0gcFRhYmxlW3RhYmxlSWR4XVswXS5maWVsZE5hbWVbMF0pIHsgIC8vIHRoZXJlIGlzIGRhdGEgaW4gdGhhdCBlbnR5CisgICAgICAgLy8gdGJkOiBkZWNpc2lvbiBsb2dpYyBiYXNlZCBvbiBQYXJzaW5nIENvbnRyb2wgKGJpdG1hcCkKKyAgIH0KKworICAgIC8vIG92ZXJ3cml0ZSB0YWJsZSBlbnRyeSwgdGFibGVJZHgKKyAgIHBvcyA9IF9UQUJMRV9GSUVMRFNfUE9TOworICAgZW50cnlJZHggPSAwOworICAgd2hpbGUgKHBvcyA8IGxlbikgeworICAgICAgaWYgKCEocG9zIDw9IChsZW4gLSBfVEFCTEVfRklFTERfTUlOX0xFTikpKSB7CisgICAgICAgICAgIC8vIGVycm9yIGNvbmRpdGlvbgorICAgICAgIC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1YlRhYmxlUmQrMSkgJSBfU1VCVEFCTEVTX01BWDsKKyAgICAgfQorICAgICB9CisjZW5kaWYgLy8jaWYgIWRlZmluZWQoX1JFQ1VSU0lWRV9WRVJTSU9OKQorICAgfQorCisvL19lcnJvcjoKKyAgIGlmIChfT0sgIT0gZXJyQ29kZSkgeworICAgICAgICAvL3ByaW50ZigiRXJyb3IgJWQgXG4iLCBlcnJDb2RlKTsKKyAgIH0KKworICAgLy8KKyAgIHJldHVybiByYzsKK30KKworc3RhdGljIF9OVl9URU1QTEFURV9QUk9DRVNTX1JDIGNvbXBhcmUyVGFibGVzKGludCBpZHhGcm9tQmluLCBpbnQgaWR4QnVpbHRpbikKK3sKKyAgIGludCBpLCBqOworICAgX05WX1RFTVBMQVRFX1RBQkxFICgqcFRhYmxlQnVpbHRJbilbVEFCTEVfRU5UUklFU19NQVhdOworICAgX05WX1RFTVBMQVRFX1RBQkxFICgqcFRhYmxlRnJvbUJpbilbVEFCTEVfRU5UUklFU19NQVhdOworICAgX05WX1RFTVBMQVRFX1BST0NFU1NfUkMgcmMgPSBfTUFUQ0g7CisKKyAgIHBUYWJsZUJ1aWx0SW4gPSBOdlRhYmxlc0J1aWx0SW47CisgICBwVGFibGVGcm9tQmluID0gTnZUYWJsZXNGcm9tQmluOworCisgICBmb3IgKGkgPSAwOyBpIDwgVEFCTEVfRU5UUklFU19NQVg7IGkrKykgeworICAgICAgaWYgKChudWwgPT0gcFRhYmxlQnVpbHRJbltpZHhCdWlsdGluXVtpXS5maWVsZE5hbWVbMF0pIHx8CisgICAgICAvLyBlbmQgb2YgdGFibGUgb2NjdXJzIGluIGVpdGhlciB0YWJsZQorICAgICAgICAgIChudWwgPT0gcFRhYmxlRnJvbUJpbltpZHhGcm9tQmluXVtpXS5maWVsZE5hbWVbMF0pKSB7CisgICAgICAgICAgLy8gZW5kIG9mIHRhYmxlIG9jY3VycyBpbiBlaXRoZXIgdGFibGUKKyAgICAgICAgIGlmICgobnVsID09IHBUYWJsZUJ1aWx0SW5baWR4QnVpbHRpbl1baV0uZmllbGROYW1lWzBdKSAmJgorICAgICAgICAgICAgIChudWwgPT0gcFRhYmxlRnJvbUJpbltpZHhGcm9tQmluXVtpXS5maWVsZE5hbWVbMF0pKSB7CisgICAgICAgICAgICByYyA9IF9NQVRDSDsKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgcmMgPSBfTUlTX01BVENIOworCisgICAgICAgICAgICBmb3IgKGo9MDsgajxUQUJMRV9FTlRSSUVTX01BWDsgaisrKSB7CisgICAgICAgICAgICAgICBpZiAobnVsID09IHBUYWJsZUJ1aWx0SW5baWR4QnVpbHRpbl1bal0uZmllbGROYW1lWzBdKSB7CisgICAgICAgICAgICAgICAgICAgICAgIC8vIGVuZCBvZiBiaW4gdGFibGUKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgaWYgKCFzdHJjbXAoCisgICAgICAgICAgICAgICAgICAoY29uc3QgY2hhciopIHBUYWJsZUJ1aWx0SW5baWR4QnVpbHRpbl1bal0uZmllbGROYW1lLAorICAgICAgICAgICAgICAgICAgKGNvbnN0IGNoYXIqKSBwVGFibGVGcm9tQmluW2lkeEZyb21CaW5dW2ldLmZpZWxkTmFtZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZvdW5kIG1hdGNoaW5nIGZpZWxkIGluIGJpbiB0YWJsZQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gRE8gTk9UIGNoZWNrIHJldHVybiBjb2RlLCBpdCdzIGFscmVhZHkgYSBtaXNtYXRjaAorICAgICAgICAgICAgICAgICAgY29tcGFyZTJGaWVsZHNBbmRDb3B5RnJvbUJpbigKKyAgICAgICAgICAgICAgICAgICAgICAgJihwVGFibGVCdWlsdEluW2lkeEJ1aWx0aW5dW2pdKSwKKyAgICAgICAgICAgICAgICAgICAgICAgJihwVGFibGVGcm9tQmluW2lkeEZyb21CaW5dW2ldKSwgaWR4QnVpbHRpbiwKKyAgICAgICAgICAgICAgICAgICAgICAgaWR4RnJvbUJpbik7CisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgICAgIGJyZWFrOyAvLyBlbmQgb2YgdGFibGUsIGVpdGhlciB0YWJsZSwgY29uZGl0aW9uCisgICAgICB9CisgICAgICBlbHNlIHsKKyAgICAgICAgIGlmICghc3RyY21wKHBUYWJsZUJ1aWx0SW5baWR4QnVpbHRpbl1baV0uZmllbGROYW1lLAorICAgICAgICAgICAgICAgICBwVGFibGVGcm9tQmluW2lkeEZyb21CaW5dW2ldLmZpZWxkTmFtZSkpIHsKKyAgICAgICAgIC8vIHR3byBmaWVsZCBuYW1lcyBtYXRjaAorICAgICAgICAgICAgaWYgKF9NQVRDSCA9PSBjb21wYXJlMkZpZWxkc0FuZENvcHlGcm9tQmluKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKHBUYWJsZUJ1aWx0SW5baWR4QnVpbHRpbl1baV0pLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKHBUYWJsZUZyb21CaW5baWR4RnJvbUJpbl1baV0pLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZHhCdWlsdGluLCBpZHhGcm9tQmluKSkgeworICAgICAgICAgICAgICAgcmMgPSBfTUFUQ0g7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgIHJjID0gX01JU19NQVRDSDsKKyAgICAgICAgICAgICAgIGlmICggX0ZMQUdfQU5EX0FCT1JUKGdOVlBhcnNpbmdDb250cm9sTG8pICkgeworICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgIHJjID0gX01JU19NQVRDSDsKKyAgICAgICAgICAgIGlmICggX0ZMQUdfQU5EX0FCT1JUKGdOVlBhcnNpbmdDb250cm9sTG8pICkgeworICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBlbHNlCisgICAgICAgICAgICAvLyBsb29wIHRocm91Z2ggdGhlIFdIT0xFIGJpbiB0YWJsZXMsIGxvb2tpbmcgZm9yIGEgbWF0Y2hpbmcgZmllbGQuCisgICAgICAgICAgICAvLyB0aGlzIHdvdWxkIHRha2UgY2FyZSBvZiBib3RoIGNhc2VzIHdoZXJlIGJpbiB0YWJsZSBmaWVsZCBpcworICAgICAgICAgICAgLy8gZWl0aGVyICJhaGVhZCIgb3IgImJlaGluZCIKKyAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBUQUJMRV9FTlRSSUVTX01BWDsgaisrKSB7CisgICAgICAgICAgICAvLyBlbmQgb2YgYmluIHRhYmxlCisgICAgICAgICAgICAgICBpZiAobnVsID09IHBUYWJsZUZyb21CaW5baWR4QnVpbHRpbl1bal0uZmllbGROYW1lWzBdKSB7CisgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICBpZiAoIXN0cmNtcChwVGFibGVCdWlsdEluW2lkeEJ1aWx0aW5dW2pdLmZpZWxkTmFtZSwKKyAgICAgICAgICAgICAgICAgICAgIHBUYWJsZUZyb21CaW5baWR4RnJvbUJpbl1baV0uZmllbGROYW1lKSkgeworICAgICAgICAgICAgICAgIC8vIGZvdW5kIG1hdGNoaW5nIGZpZWxkIGluIGJpbiB0YWJsZQorICAgICAgICAgICAgICAgIC8vIERPIE5PVCBjaGVjayByZXR1cm4gY29kZSwgaXQncyBhbHJlYWR5IGEgbWlzbWF0Y2gKKyAgICAgICAgICAgICAgICAgIGNvbXBhcmUyRmllbGRzQW5kQ29weUZyb21CaW4oJihwVGFibGVCdWlsdEluW2lkeEJ1aWx0aW5dW2pdKSwKKyAgICAgICAgICAgICAgICAgICAgICAmKHBUYWJsZUZyb21CaW5baWR4RnJvbUJpbl1baV0pLCBpZHhCdWlsdGluLCBpZHhGcm9tQmluKTsKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICAgfQorICAgfQorCisgICByZXR1cm4gcmM7Cit9CisKK3N0YXRpYyBfTlZfVEVNUExBVEVfUFJPQ0VTU19SQyBjb21wYXJlMkZpZWxkc0FuZENvcHlGcm9tQmluKAorICAgX05WX1RFTVBMQVRFX1RBQkxFKnBUYWJsZUJ1aWx0SW4sCisgICBfTlZfVEVNUExBVEVfVEFCTEUgKnBUYWJsZUZyb21CaW4sIGludCBpZHhCdWlsdGluLCBpbnQgaWR4RnJvbUJpbikKK3sKKyAgIF9OVl9URU1QTEFURV9QUk9DRVNTX1JDIHJjID0gX01BVENIOworCisgICAvLyBWZXJpZmllZCBhbHJlYWR5IHRoZSBmaWVsZE5hbWVzIG1hdGNoCisgICAvLyBmaWVsZElkIHR5cGUgbWF0Y2hpbmc/CisgICAvKgorICAgICogSWYgaXQncyBhIHNpbXBsZSB0eXBlLCBzaW1wbGUgY29tcGFyaXNvbiwgPT0sYWZ0ZXIgbWFzayBvdXQgdGhlIGRhdGEgdHlwZQorICAgICogZWxzZSBpZiBpdCdzIGEgdGFibGUsIG5lZWQgdG8gY29tcGFyZSAyIHRhYmxlcywgZG9uJ3QgY2FsbCByZWN1cnNpdmVseQorICAgICovCisgICBpZiAoX01JU19NQVRDSCA9PSBjb21wYXJlMkZpZWxkSURUeXBlKHBUYWJsZUJ1aWx0SW4sIHBUYWJsZUZyb21CaW4sCisgICAgICAgICBpZHhCdWlsdGluLCBpZHhGcm9tQmluKSkgeworICAgICAgcmMgPSBfTUlTX01BVENIOworICAgICAgZ290byBfZW5kOworICAgfQorICAgIC8vIHN0b3JhZ2UgdHlwZSBtYXRjaGluZz8KKyAgICAvLyBJZiBpdCdzIFNJTkdVTEFSLCBzaW1wbGUgPT0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RFX0VOVU0gKCpwRW51bUJ1aWx0aW4pW0VOVU1fRU5UUklFU19NQVhdID0gTnZFbnVtc0J1aWx0SW47CisgICBfRXJyb3JDb2RlIGVyckNvZGUgPSBfT0s7CisKKyAgIGZvciAoaSA9IDA7IGkgPCBFTlVNX0VOVFJJRVNfTUFYOyBpKyspIHsKKyAgICAgIGlmIChudWwgPT0gcEVudW1CdWlsdGluWzBdW2ldLmVudW1OYW1lWzBdKSB7CisgICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBpZiAoIXN0cmNtcChlbnVtU3RyLCBwRW51bUJ1aWx0aW5bMF1baV0uZW51bU5hbWUpKSB7CisgICAgICAgICAgZW51bUlkeEJ1aWx0aW4gPSBwRW51bUJ1aWx0aW5bMF1baV0uZW51bVZhbHVlOworICAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgfQorICAgaWYgKCFlbnVtSWR4QnVpbHRpbikgeworICAgICAgZXJyQ29kZSA9IF9FTlVNX05PVF9GT1VORF9JTl9CVUlMVF9JTjsKKyAgICAgIHJldHVybjsKKyAgIH0KKyAgIGVsc2UgeworICAgICAgY29tcGFyZTJFbnVtRW50cmllc0FuZENvcHkoZW51bUlkeEZyb21CaW4sIGVudW1JZHhCdWlsdGluKTsKKyAgIH0KKworLy9fZXJyb3I6CisgICBpZiAoX09LICE9IGVyckNvZGUpIHsKKyAgICAgIC8vcHJpbnRmKCJFcnJvciAlZFxuIiwgZXJyQ29kZSk7CisgICB9CisKKyAgIHJldHVybjsKK30KKworc3RhdGljIF9OVl9URU1QTEFURV9QUk9DRVNTX1JDIGNvbXBhcmUyRW51bUVudHJpZXNBbmRDb3B5KGludCBpZHhGcm9tQmluLAorICAgaW50IGlkeEJ1aWx0aW4pCit7CisgICBpbnQgaSxqOworICAgX05WX1RFTVBMQVRFX1BST0NFU1NfUkMgcmMgPSBfTUFUQ0g7CisgICBfTlZfVEVNUExBVEVfRU5VTSAoKmVudW1zRnJvbUJpbilbRU5VTV9FTlRSSUVTX01BWF0gPSBOdkVudW1zRnJvbUJpbjsKKyAgIF9OVl9URU1QTEFURV9FTlVNICgqZW51bXNCdWlsdGluKVtFTlVNX0VOVFJJRVNfTUFYXSA9IE52RW51bXNCdWlsdEluOworCisgICAgLy8gbmVlZCB0byBnbyB0aHJvdWdoIGFsbCBlbnVtcworICAgZm9yIChpID0gMDsgaSA8IEVOVU1fRU5UUklFU19NQVg7IGkrKykgeworICAgICAgIC8vIGVuZCBjb25kaXRpb25zOiBlaXRoZXIgYm90aCByZWFjaCB0aGUgZW5kIChtYXRjaCksCisgICAgICAgLy8gb3Igb25lIG9mIHRoZW0gcmVhY2hpbmcgdGhlIGVuZCAobWlzbWF0Y2gpCisgICAgICBpZiAoKG51bCA9PSBlbnVtc0J1aWx0aW5baWR4QnVpbHRpbl1baV0uZW51bU5hbWVbMF0pIHx8CisgICAgICAgICAgKG51bCA9PSBlbnVtc0Zyb21CaW5baWR4RnJvbUJpbl1baV0uZW51bU5hbWVbMF0pKSB7CisgICAgICAgICAgaWYgKChudWwgPT0gZW51bXNCdWlsdGluW2lkeEJ1aWx0aW5dW2ldLmVudW1OYW1lWzBdKSAmJgorICAgICAgICAgICAgICAobnVsID09IGVudW1zRnJvbUJpbltpZHhGcm9tQmluXVtpXS5lbnVtTmFtZVswXSkpIHsKKyAgICAgICAgICAgICAgICAvLyBmdWxseSBtYXRjaGVkCisgICAgICAgICAgICAgIHJjID0gX01BVENIOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgIHJjID0gX01JU19NQVRDSDsKKyAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IEVOVU1fRU5UUklFU19NQVg7IGorKykgeworICAgICAgICAgICAgICAgICAgaWYgKG51bCA9PSBlbnVtc0J1aWx0aW5baWR4QnVpbHRpbl1bal0uZW51bU5hbWVbMF0pIHsKKyAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGlmICghc3RyY21wKChjb25zdCBjaGFyKillbnVtc0Zyb21CaW5baWR4RnJvbUJpbl1baV0uZW51bU5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgIChjb25zdCBjaGFyKillbnVtc0J1aWx0aW5baWR4QnVpbHRpbl1bal0uZW51bU5hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgZW51bXNGcm9tQmluW2lkeEZyb21CaW5dW2ldLmVudW1WYWx1ZVBlZXIgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtc0J1aWx0aW5baWR4QnVpbHRpbl1bal0uZW51bVZhbHVlOworICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIGVsc2UgeworICAgICAgICAgIGlmICghc3RyY21wKGVudW1zQnVpbHRpbltpZHhCdWlsdGluXVtpXS5lbnVtTmFtZSwKKyAgICAgICAgICAgICAgICBlbnVtc0Zyb21CaW5baWR4RnJvbUJpbl1baV0uZW51bU5hbWUpKSB7CisgICAgICAgICAgICAgICAgLy8gY29weSBidWlsdEluIGVudW0gdmFsdWUgdG8gZnJvbUJpbgorICAgICAgICAgICAgICBlbnVtc0Zyb21CaW5baWR4RnJvbUJpbl1baV0uZW51bVZhbHVlUGVlciA9CisgICAgICAgICAgICAgICAgIGVudW1zQnVpbHRpbltpZHhCdWlsdGluXVtpXS5lbnVtVmFsdWU7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAvLyBtaXNtYXRjaCwgYnV0IHN0aWxsIGxvb3AgdGhyb3VnaCB0aGUgd2hvbGUgZW51bSBsaXN0CisgICAgICAgICAgICAgIC8vIGZvciB0aGUgImFoZWFkIiBhbmQgImJlaGluZCIgc2NlbmFyaW9zCisgICAgICAgICAgICAgIHJjID0gX01JU19NQVRDSDsKKyAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IEVOVU1fRU5UUklFU19NQVg7IGorKykgeworICAgICAgICAgICAgICAgICBpZiAobnVsID09IGVudW1zQnVpbHRpbltpZHhCdWlsdGluXVtqXS5lbnVtTmFtZVswXSkgeworICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgaWYgKCFzdHJjbXAoZW51bXNGcm9tQmluW2lkeEZyb21CaW5dW2ldLmVudW1OYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgZW51bXNCdWlsdGluW2lkeEJ1aWx0aW5dW2pdLmVudW1OYW1lKSkgeworICAgICAgICAgICAgICAgICAgICAgZW51bXNGcm9tQmluW2lkeEZyb21CaW5dW2ldLmVudW1WYWx1ZVBlZXIgPQorICAgICAgICAgICAgICAgICAgICAgICAgZW51bXNCdWlsdGluW2lkeEJ1aWx0aW5dW2pdLmVudW1WYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgIH0KKyAgIH0KKworICAgLy8gcmVjb3JkIG1hdGNoIG9yIG1pc21hdGNoIGZvciBsYXRlciBkYXRhIHBhcnNpbmcgdXNlCisgICBlbnVtTWV0YURhdGFGcm9tQmluW2lkeEZyb21CaW5dLm1hdGNoID0gcmM7CisKKyAgIC8vIGFsbCBkb25lCisgICByZXR1cm4gcmM7Cit9CisKK3N0YXRpYyBpbnQgY29uc3RydWN0QVRlbXBsYXRlRW51bShfTlZfU1RSRUFNX0JVRiAqcFN0cmVhbSwgaW50IGxlbiwKKyAgIGNoYXIgKmVudW1TdHIpCit7CisgICAgaW50IHBvcyA9IDA7CisgICAgX05WX1RFTVBMQVRFX0VOVU0gKCpwRW51bSlbRU5VTV9FTlRSSUVTX01BWF07CisgICAgaW50IGVudW1JZHggPSAwOworICAgIGludCBpOworICAgIGludCBlbnRyeUlkeDsKKyAgICBfRXJyb3JDb2RlIGVyckNvZGUgPSBfT0s7CisKKyAgICBlbnVtSWR4ID0gKHBTdHJlYW1bX05WX0JJTl9TVFJFQU1fRU5VTV9JRF9CWVRFXSAmCisgICAgICAgRklFTERfSURfVEFCTEVfT1JfRU5VTV9JRFhfTUFTSyk7CisgICAgcEVudW0gPSBOdkVudW1zRnJvbUJpbjsKKworICAgIC8vIGZpbmQgaXRzIHN0cmluZyBuYW1lCisgICAgLy8gdGhlIGxvZ2ljOgorICAgIC8vIHNpbmNlIHRoZSBudi5iaW4gZG9lc24ndCBlbmNvZGUgdGhlIGVudW0gc3RyaW5nIG5hbWUgaW4gdGhlIGFjdHVhbCBlbnVtCisgICAgLy8gc3RyZWFtLCBvbmx5IHRoZSBmaXJzdCAiZW51bSBvZiBhbGwgZW51bXMiCisgICAgLy8gICAgaGFzIHRoZSBuYW1lcyBvZiBhbGwgZW51bXMuCisgICAgaWYgKElzSWR4RW51bU9mQWxsRW51bXMoZW51bUlkeCkpIHsKKyAgICB9CisgICAgZWxzZSB7CisgICAgICAgIGZvciAoaSA9IDA7IGkgPCBFTlVNX0VOVFJJRVNfTUFYOyBpKyspIHsKKyAgICAgICAgICAgIGlmIChudWwgPT0gcEVudW1bMF1baV0uZW51bU5hbWVbMF0pIHsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChwRW51bVswXVtpXS5lbnVtVmFsdWUgPT0gZW51bUlkeCkgeworICAgICAgICAgICAgICAgIHN0cmxjcHkoZW51bVN0ciwgcEVudW1bMF1baV0uZW51bU5hbWUsKF9FTlVNX05BTUVfTEVOICsgMSkpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChFTlVNX0VOVFJJRVNfTUFYID09IGkpIHsKKyAgICAgICAgICAgIC8vIHdpdGhvdXQgYSBzdH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RJZDsKKyAgICAgICAgIHNpemVPbmVFbGVtID0gc2l6ZU9uZUVsZW1CYXNlZE9uRmllbGRJZEJhc2ljRGF0YVR5cGVbZmllbGQgJgorICAgICAgICAgICAgICAgICAgICAgICAgIEZJRUxEX0lEX1RBQkxFX09SX0VOVU1fSURYX01BU0tdOworCisgICAgICAgICBpZHhCdWlsdEluID0gX1NUT1JBR0VfVFlQRSgKKyAgICAgICAgICAgcFRhYmxlQnVpbHRJblt0YWJsZUlkeEJ1aWx0SW5dW2ZpZWxkSWRCdWlsdEluXS5maWVsZFN0b3JhZ2VUeXBlKTsKKyAgICAgICAgIHNpemUxQnVpbHRJbiA9IG51bUVsZW1CYXNlZE9uU3RvcmFnZVR5cGVbaWR4XSgKKyAgICAgICAgICAgICAgICAgICAgICAmKHBUYWJsZUJ1aWx0SW5bdGFibGVJZHhCdWlsdEluXVtmaWVsZElkQnVpbHRJbl0pLCAwKTsKKworICAgICAgICAgc2l6ZTEgPSBzaXplMUJpbjsKKyAgICAgICAgIGlmIChzaXplMSA+IHNpemUxQnVpbHRJbikgeworICAgICAgICAgICAgc2l6ZTEgPSBzaXplMUJ1aWx0SW47CisgICAgICAgICB9CisgICAgICB9CisgICAgICB0b3RhbFNpemUgPSBzaXplMSAqIHNpemVPbmVFbGVtOworCisgICAgICBvZmZzZXQgPSAwOworICAgICAgZm9yIChpID0gMDsgaSA8IHNpemUxOyBpKyspIHsKKyAgICAgICAgIHZvc19tZW1fY29weSgmcHRyW29mZnNldF0sICZkcHRyW29mZnNldF0sIHNpemVPbmVFbGVtKTsKKyAgICAgICAgIG9mZnNldCA9IG9mZnNldCArIHNpemVPbmVFbGVtOworICAgICAgfQorCisgICAgICAqcG9zID0gKnBvcyArIChzaXplMUJpbiAqIHNpemVPbmVFbGVtKTsKKyAgIH0KKyAgIGVsc2UgeworICAgICAgaWYgKEFSUkFZXzEgPT0gc3RvcmFnZVR5cGUpIHsKKyAgICAgICAgIHB0ciA9ICgodW5zaWduZWQgY2hh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ibGVbdGFibGVJZHhdW2ZpZWxkSWRdLmZpZWxkU3RvcmFnZVNpemUxICYKKyAgICAgICAgICAgICAgIEZJRUxEX1NJWkVfVkFMVUVfTUFTSykgPj4gRklFTERfU0laRV9WQUxVRV9MU0IpOworICAgICAgICAgICAgaXNGaXJzdEZpZWxkRW51bSA9IDE7CisgICAgICAgICB9CisgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgIGlzRmlyc3RGaWVsZEVudW0gPSAwOworICAgICAgICAgICAgaWYgKHNpemUxID4gc2l6ZTFCdWlsdEluKSB7CisgICAgICAgICAgICAgICBzaXplMSA9IHNpemUxQnVpbHRJbjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKworICAgICAgICAgb2Zmc2V0ID0gMDsKKyAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBzaXplMTsgaSsrKSB7CisgICAgICAgICAgICBpZiAoaXNGaXJzdEZpZWxkRW51bSkgeworICAgICAgICAgICAgICAgaWYgKE52RW51bXNGcm9tQmluW2VudW1JZHgxXVtpXS5lbnVtVmFsdWVQZWVyICE9IDB4RkYpIHsKKyAgICAgICAgICAgICAgICAgIGluZGV4ID0gTnZFbnVtc0Zyb21CaW5bZW51bUlkeDFdW2ldLmVudW1WYWx1ZVBlZXI7CisgICAgICAgICAgICAgICAgICBkaW5kZXggPSBOdkVudW1zRnJvbUJpbltlbnVtSWR4MV1baV0uZW51bVZhbHVlOworCisgICAgICAgICAgICAgICAgICBpbmRleCA9IGluZGV4ICogc2l6ZU9uZUVsZW07CisgICAgICAgICAgICAgICAgICBkaW5kZXggPSBkaW5kZXggKiBzaXplT25lRWxlbTsKKworICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KCZwdHJbaW5kZXhdLCAmZHB0cltkaW5kZXhdLCBzaXplT25lRWxlbSk7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgIHZvc19tZW1fY29weSgmcHRyW29mZnNldF0sICZkcHRyW29mZnNldF0sIHNpemVPbmVFbGVtKTsKKyAgICAgICAgICAgICAgIG9mZnNldCA9IG9mZnNldCArIHNpemVPbmVFbGVtOworICAgICAgICAgICAgfQorICAgICAgICAgfQorCisgICAgICAgICAqcG9zID0gKnBvcyArIChzaXplMUJpbiAqIHNpemVPbmVFbGVtKTsKKyAgICAgIH0KKyAgICAgIGVsc2UgaWYgKEFSUkFZXzIgPT0gc3RvcmFnZVR5cGUpIHsKKyAgICAgICAgIHB0ciA9ICgodW5zaWduZWQgY2hhciopZ3BudkRhdGFfdCkgKyB0YWJsZUJhc2VPZmZzZXQgKyBhZGRPZmZzZXQ7CisgICAgICAgICBkcHRyID0gKHVuc2lnbmVkIGNoYXIgKikmcFN0cmVhbVsqcG9zXTsKKworICAgICAgICAgaWR4ID0gX1NUT1JBR0VfU0laRTEocFRhYmxlW3RhYmxlSWR4XVtmaWVsZElkXS5maWVsZFN0b3JhZ2VTaXplMSwKKyAgICAgICAgICAgICAgICAgIHBUYWJsZVt0YWJsZUlkeF1bZmllbGRJZF0uZmllbGRTdG9yYWdlVHlwZSk7CisgICAgICAgICBzaXplMUJpbiA9IGdldE51bUVsZW1PdXRPZlN0b3JhZ2VTaXplKGlkeCwKKyAgICAgICAgICAgICAgICAgcFRhYmxlW3RhYmxlSWR4XVtmaWVsZElkXS5maWVsZFN0b3JhZ2VTaXplMSwgMSk7CisKKyAgICAgICAgIGlkeCA9IF9TVE9SQUdFX1NJWkUyKHBUYWJsZVt0YWJsZUlkeF1bZmllbGRJZF0uZmllbGRTdG9yYWdlU2l6ZTIsCisgICAgICAgICAgICAgICAgICBwVGFibGVbdGFibGVJZHhdW2ZpZWxkSWRdLmZpZWxkU3RvcmFnZVR5cGUpOworCisgICAgICAgICBzaXplMkJpbiA9IGdldE51bUVsZW1PdXRPZlN0b3JhZ2VTaXplKGlkeCwKKyAgICAgICAgICAgICAgICAgcFRhYmxlW3RhYmxlSWR4XVtmaWVsZElkX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ZTEpKSB7CisgICAgICAgICAgICBlbnVtSWR4MSA9ICgocFRhYmxlW3RhYmxlSWR4XVtmaWVsZElkXS5maWVsZFN0b3JhZ2VTaXplMSAmCisgICAgICAgICAgICAgICBGSUVMRF9TSVpFX1ZBTFVFX01BU0spID4+IEZJRUxEX1NJWkVfVkFMVUVfTFNCKTsKKyAgICAgICAgICAgIGlzRmlyc3RGaWVsZEVudW0gPSAxOworICAgICAgICAgfQorICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICBpc0ZpcnN0RmllbGRFbnVtID0gMDsKKyAgICAgICAgICAgIGlmIChzaXplMSA+IHNpemUxQnVpbHRJbikgeworICAgICAgICAgICAgICAgc2l6ZTEgPSBzaXplMUJ1aWx0SW47CisgICAgICAgICAgICB9CisgICAgICAgICB9CisKKyAgICAgICAgIGlmICghSXNGaWVsZFNpemVJbnQocFRhYmxlW3RhYmxlSWR4XVtmaWVsZElkXS5maWVsZFN0b3JhZ2VTaXplMikpIHsKKyAgICAgICAgICAgIGVudW1JZHgyID0gKChwVGFibGVbdGFibGVJZHhdW2ZpZWxkSWRdLmZpZWxkU3RvcmFnZVNpemUyICYKKyAgICAgICAgICAgICAgIEZJRUxEX1NJWkVfVkFMVUVfTUFTSykgPj4gRklFTERfU0laRV9WQUxVRV9MU0IpOworICAgICAgICAgICAgaXNTZWNvbmRGaWVsZEVudW0gPSAxOworICAgICAgICAgfQorICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICBpc1NlY29uZEZpZWxkRW51bSA9IDA7CisgICAgICAgICAgICBpZiAoc2l6ZTIgPiBzaXplMkJ1aWx0SW4pIHsKKyAgICAgICAgICAgICAgIHNpemUyID0gc2l6ZTJCdWlsdEluOworICAgICAgICAgICAgfQorICAgICAgICAgfQorCisgICAgICAgICBvZmZzZXQgPSAwOworCisgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgc2l6ZTE7IGkrKykgeworICAgICAgICAgICAgaWYgKGlzRmlyc3RGaWVsZEVudW0pIHsKKyAgICAgICAgICAgICAgaWYgKE52RW51bXNGcm9tQmluW2VudW1JZHgxXVtpXS5lbnVtVmFsdWVQZWVyID09IDB4RkYpIHsKKyAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICBpbmRleCA9IE52RW51bXNGcm9tQmluW2VudW1JZHgxXVtpXS5lbnVtVmFsdWVQZWVyOworICAgICAgICAgICAgICBkaW5kZXggPSBOdkVudW1zRnJvbUJpbltlbnVtSWR4MV1baV0uZW51bVZhbHVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICBpbmRleCA9IGRpbmRleCA9IGk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBzaXplMjsgaisrKSB7CisgICAgICAgICAgICAgIGlmIChpc1NlY29uZEZpZWxkRW51bSkgeworICAgICAgICAgICAgICAgICBpZiAoTnZFbnVtc0Zyb21CaW5bZW51bUlkeDJdW2pdLmVudW1WYWx1ZVBlZXIgPT0gMHhGRikgeworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgIGluZGV4MSA9IE52RW51bXNGcm9tQmluW2VudW1JZHgyXVtqXS5lbnVtVmFsdWVQZWVyOworICAgICAgICAgICAgICAgICBkaW5kZXgxID0gTnZFbnVtc0Zyb21CaW5bZW51bUlkeDJdW2pdLmVudW1WYWx1ZTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgaW5kZXgxID0gZGluZGV4MSA9IGo7CisgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnB0clsoaW5kZXgxICsgaW5kZXggKiBzaXplMkJ1aWx0SW4pKnNpemVPbmVFbGVtXSwKKyAgICAgICAgICAgICAgICAgICAmZHB0clsoZGluZGV4MStkaW5kZXgq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7CisKKyAgICAgICAgIHNpemUyQnVpbHRJbiA9IGdldE51bUVsZW1PdXRPZlN0b3JhZ2VTaXplKGlkeCwKKyAgICAgICAgICAgIHBUYWJsZUJ1aWx0SW5bdGFibGVJZHhCdWlsdEluXVtmaWVsZElkQnVpbHRJbl0uZmllbGRTdG9yYWdlU2l6ZTIsCisgICAgICAgICAgICAwKTsKKworICAgICAgICAgaWR4ID0gX1NUT1JBR0VfU0laRTMoCisgICAgICAgICAgICAgcFRhYmxlQnVpbHRJblt0YWJsZUlkeEJ1aWx0SW5dW2ZpZWxkSWRCdWlsdEluXS5maWVsZFN0b3JhZ2VTaXplMywKKyAgICAgICAgICAgICBwVGFibGVCdWlsdEluW3RhYmxlSWR4QnVpbHRJbl1bZmllbGRJZEJ1aWx0SW5dLmZpZWxkU3RvcmFnZVR5cGUpOworCisgICAgICAgICBzaXplM0J1aWx0SW4gPSBnZXROdW1FbGVtT3V0T2ZTdG9yYWdlU2l6ZShpZHgsCisgICAgICAgICAgICBwVGFibGVCdWlsdEluW3RhYmxlSWR4QnVpbHRJbl1bZmllbGRJZEJ1aWx0SW5dLmZpZWxkU3RvcmFnZVNpemUzLAorICAgICAgICAgICAgMCk7CisKKyAgICAgICAgIHNpemUxID0gc2l6ZTFCaW47CisgICAgICAgICBzaXplMiA9IHNpemUyQmluOworICAgICAgICAgc2l6ZTMgPSBzaXplM0JpbjsKKworICAgICAgICAgaWYgKCFJc0ZpZWxkU2l6ZUludChwVGFibGVbdGFibGVJZHhdW2ZpZWxkSWRdLmZpZWxkU3RvcmFnZVNpemUxKSkgeworICAgICAgICAgICAgZW51bUlkeDEgPSAoKHBUYWJsZVt0YWJsZUlkeF1bZmllbGRJZF0uZmllbGRTdG9yYWdlU2l6ZTEgJgorICAgICAgICAgICAgICAgRklFTERfU0laRV9WQUxVRV9NQVNLKSA+PiBGSUVMRF9TSVpFX1ZBTFVFX0xTQik7CisgICAgICAgICAgICBpc0ZpcnN0RmllbGRFbnVtID0gMTsKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgaXNGaXJzdEZpZWxkRW51bSA9IDA7CisgICAgICAgICAgICBpZiAoc2l6ZTEgPiBzaXplMUJ1aWx0SW4pIHsKKyAgICAgICAgICAgICAgIHNpemUxID0gc2l6ZTFCdWlsdEluOworICAgICAgICAgICAgfQorICAgICAgICAgfQorCisgICAgICAgICBpZiAoIUlzRmllbGRTaXplSW50KHBUYWJsZVt0YWJsZUlkeF1bZmllbGRJZF0uZmllbGRTdG9yYWdlU2l6ZTIpKSB7CisgICAgICAgICAgICBlbnVtSWR4MiA9ICgocFRhYmxlW3RhYmxlSWR4XVtmaWVsZElkXS5maWVsZFN0b3JhZ2VTaXplMiAmCisgICAgICAgICAgICAgICBGSUVMRF9TSVpFX1ZBTFVFX01BU0spID4+IEZJRUxEX1NJWkVfVkFMVUVfTFNCKTsKKyAgICAgICAgICAgIGlzU2Vjb25kRmllbGRFbnVtID0gMTsKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgaXNTZWNvbmRGaWVsZEVudW0gPSAwOworICAgICAgICAgICAgaWYgKHNpemUyID4gc2l6ZTJCdWlsdEluKSB7CisgICAgICAgICAgICAgICBzaXplMiA9IHNpemUyQnVpbHRJbjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKworICAgICAgICAgaWYgKCFJc0ZpZWxkU2l6ZUludChwVGFibGVbdGFibGVJZHhdW2ZpZWxkSWRdLmZpZWxkU3RvcmFnZVNpemUzKSkgeworICAgICAgICAgICAgZW51bUlkeDMgPSAoKHBUYWJsZVt0YWJsZUlkeF1bZmllbGRJZF0uZmllbGRTdG9yYWdlU2l6ZTMgJgorICAgICAgICAgICAgICAgRklFTERfU0laRV9WQUxVRV9NQVNLKSA+PiBGSUVMRF9TSVpFX1ZBTFVFX0xTQik7CisgICAgICAgICAgICBpc1RoaXJkRmllbGRFbnVtID0gMTsKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgaXNUaGlyZEZpZWxkRW51bSA9IDA7CisgICAgICAgICAgICBpZiAoc2l6ZTMgPiBzaXplM0J1aWx0SW4pIHsKKyAgICAgICAgICAgICAgIHNpemUzID0gc2l6ZTNCdWlsdEluOworICAgICAgICAgICAgfQorICAgICAgICAgfQorCisgICAgICAgICBvZmZzZXQgPSAwOworICAgICAgICAgZm9yIChpID0gMDsgaSA8IHNpemUxOyBpKyspIHsKKyAgICAgICAgICAgIGlmIChpc0ZpcnN0RmllbGRFbnVtKSB7CisgICAgICAgICAgICAgIGlmIChOdkVudW1zRnJvbUJpbltlbnVtSWR4MV1baV0uZW51bVZhbHVlUGVlciA9PSAweEZGKSB7CisgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgaW5kZXggPSBOdkVudW1zRnJvbUJpbltlbnVtSWR4MV1baV0uZW51bVZhbHVlUGVlcjsKKyAgICAgICAgICAgICAgZGluZGV4ID0gTnZFbnVtc0Zyb21CaW5bZW51bUlkeDFdW2ldLmVudW1WYWx1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICBpbmRleCA9IGRpbmRleCA9IGk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBzaXplMjsgaisrKSB7CisgICAgICAgICAgICAgIGlmIChpc1NlY29uZEZpZWxkRW51bSkgeworICAgICAgICAgICAgICAgICBpZiAoTnZFbnVtc0Zyb21CaW5bZW51bUlkeDJdW2pdLmVudW1WYWx1ZVBlZXIgPT0gMHhGRikgeworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgIGluZGV4MSA9IE52RW51bXNGcm9tQmluW2VudW1JZHgyXVtqXS5lbnVtVmFsdWVQZWVyOworICAgICAgICAgICAgICAgICBkaW5kZXgxID0gTnZFbnVtc0Zyb21CaW5bZW51bUlkeDJdW2pdLmVudW1WYWx1ZTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgaW5kZXgxID0gZGluZGV4MSA9IGo7CisgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICBmb3IgKGsgPSAwOyBrIDwgc2l6ZTM7IGsrKykgeworICAgICAgICAgICAgICAgICBpZiAoaXNUaGlyZEZpZWxkRW51bSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoTnZFbnVtc0Zyb21CaW5bZW51bUlkeDJdW2pdLmVudW1WYWx1ZVBlZXIgPT0gMHhGRikgeworICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGluZGV4MiA9IE52RW51bXNGcm9tQmluW2VudW1JZHgzXVtrXS5lbnVtVmFsdWVQZWVyOworICAgICAgICAgICAgICAgICAgICBkaW5kZXgyID0gTnZFbnVtc0Zyb21CaW5bZW51bUlkeDNdW2tdLmVudW1WYWx1ZTsKKyAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgaW5kZXgyID0gZGluZGV4MiA9IGs7CisgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICB2b3NfbWVtX2NvcHkoJnB0clsoaW5kZXgyICsgKGluZGV4MSAqIHNpemUyQnVpbHRJbikgKworICAgICAgICAgICAgICAgICAgICAgICAgICAoaW5kZXggKiBzaXplM0J1aWx0SW4gKiBzaXplMkJ1aWx0SW4pKSAqIHNpemVPbmVFbGVtXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICZkcHRyWyhkaW5kZXgyICsgKGRpbmRleDEgKiBzaXplMkJpbikgKworICAgICAgICAgICAgICAgICAgICAgICAgICAoZGluZGV4ICogc2l6ZTNCaW4gKiBzaXplMkJpbikpKnNpemVPbmVFbGVtXSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHNpemVPbmVFbGVtKTsKKworICAgICAgICAgICAgICAgICBvZmZzZXQgPSBvZmZzZXQgKyBzaXplT25lRWxlbTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgfQorCisgICAgICAgICAqcG9zID0gKnBvcyArIHNpemUxQmluICogc2l6ZTJCaW4gKiBzaXplM0JpbiAqIHNpemVPbmVFbGVtOworICAgICAgfQorICAgICAgZWxzZSB7CisgICAgICB9CisgICB9Cit9CisKKy8vIHNlYXJjaCBOdlRhYmxlc0J1aWx0SW4gZm9yIHRoZSBzYW1lIHN0cmluZyBuYW1lZCB0YWJsZSwgYW5kIGl0cyBpZHgKK3N0YXRpYyBpbnQgZ2V0QnVpbHRJbkZpZWxkQ291bnQgKGludCB0YWJsZUlkeEJpbiwgY2hhciAqdGFibGVOYW1lRnJvbUJpbiwKKyAgIGludCAqdGJsSWRCdWlsdEluLCBpbnQgKmZpZWxkSWRCdWl0SW4sIGludCAqbnVtRWxlbWVudHMpCit7CisgICBpbnQgaSxpZHgsbnVtRWxlbSx0YWJsZUlkeEJ1aWx0aW49MCxmaWVsZENudDsKKyAgIF9OVl9URU1QTEFURV9UQUJMRSAoKnBUYWJsZUJpbilbVEFCTEVfRU5UUklFU19NQVhdID0gTnZUYWJsZXNGcm9tQmluOworICAgX05WX1RFTVBMQVRFX1RBQkxFICgqcFRhYmxlKVtUQUJMRV9FTlRSSUVTX01BWF0gPSBOdlRhYmxlc0J1aWx0SW47CisgICBpbnQgZm91bmQ9MCwgZmllbGRJbmRleCA9IDA7CisKKyAgIGZvciAoaSA9IDA7IGkgPCBUQUJMRV9FTlRSSUVTX01BWDsgaSsrKSB7CisgICAgICAgaWYgKG51bCA9PSBwVGFibGVCaW5bMF1baV0uZmllbGROYW1lWzBdKSB7CisgICAgICAgICAgIGJyZWFrOworICAgICAgIH0KKworICAgICAgIGlmICgocFRhYmxlQmluWzBdW2ldLmZpZWxkSWQgJgorICAgICAgICAgICAgRklFTERfSURfVEFCTEVfT1JfRU5VTV9JRFhfTUFTSykgPT0gdGFibGVJZHhCaW4pIHsKKyAgICAgICAgICAgZm91bmQgPSAxOworICAgICAgICAgICBicmVhazsKKyAgICAgICB9CisgICB9CisKKyAgIGlmICghZm91bmQpIHsKKyAgICAgIHJldHVybiAtMTsKKyAgIH0KKworICAgLy9maWVsZE5hbWUgaW5kZXggZ290IGZyb20gdGFibGVJZCBmcm9tIEJpbgorICAgZmllbGRJbmRleCA9IGk7CisgICBmb3VuZCA9IDA7CisKKyAgIGZvciAoaT0wO2k8VEFCTEVfRU5UUklFU19NQVg7aSsrKSB7CisgICAgICBpZiAobnVsID09IHBUYWJsZVswXVtpXS5maWVsZE5hbWVbMF0pIHsKKyAgICAgICAgICAgYnJlYWs7CisgICAgICAgfQorCisgICAgICAgaWYgKCFzdHJjbXAoKGNvbnN0IGNoYXIqKXBUYWJsZUJpblswXVtmaWVsZEluZGV4XS5maWVsZE5hbWUsCisgICAgICAgICAgKGNvbnN0IGNoYXIqKXBUYWJsZVswXVtpXS5maWVsZE5hbWUpKSB7CisgICAgICAgICAgZm91bmQgPSAxOworICAgICAgICAgIGJyZWFrOworICAgICAgIH0KKyAgIH0KKworICAgaWYgKCFmb3VuZCkgeworICAgICAgcmV0dXJuIC0xOworICAgfQorCisgICAvL2ZvdW5kIHRhYmxlSWQgb2YgYnVpbHRJbgorICAgdGFibGVJZHhCdWlsdGluID0gKnRibElkQnVpbHRJbiA9CisgICAgICAgICAgICAgICAgIChwVGFibGVbMF1baV0uZmllbGRJZCAmIEZJRUxEX0lEX1RBQkxFX09SX0VOVU1fSURYX01BU0spOworICAgZm91bmQgPSAwOworCisgICBmb3IgKGkgPSAwOyBpIDwgVEFCTEVfRU5UUklFU19NQVg7IGkrKykgeworICAgICAgaWYgKG51bCA9PSBwVGFibGVbdGFibGVJZHhCdWlsdGluXVtpXS5maWVsZE5hbWVbMF0pIHsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorCisgICAgICBpZiAoIXN0cmNtcCgoY29uc3QgY2hhciopdGFibGVOYW1lRnJvbUJpbiwKKyAgICAgICAgIChjb25zdCBjaGFyKilwVGFibGVbdGFibGVJZHhCdWlsdGluXVtpXS5maWVsZE5hbWUpKSB7CisgICAgICAgICBmb3VuZCA9IDE7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgIH0KKworICAgaWYgKCFmb3VuZCkgeworICAgICAgcmV0dXJuIC0xOworICAgfQorCisgICAqZmllbGRJZEJ1aXRJbiA9IGk7CisKKyAgIGlkeCA9IF9TVE9SQUdFX1RZUEUocFRhYmxlW3RhYmxlSWR4QnVpbHRpbl1baV0uZmllbGRTdG9yYWdlVHlwZSk7CisgICBudW1FbGVtID0gbnVtRWxlbUJhc2VkT25TdG9yYWdlVHlwZVtpZHhdKCYocFRhYmxlW3RhYmxlSWR4QnVpbHRpbl1baV0pLCAwKTsKKworICAgZmllbGRTaXplID0gMDsKKyAgIGZpZWxkQ250ID0gZ2V0RmllbGRDb3VudCAodGFibGVJZHhCdWlsdGluLCBpLCBudW1FbGVtLCAwKTsKKworICAgKm51bUVsZW1lbnRzID0gbnVtRWxlbTsKKworICAgcmV0dXJuIGZpZWxkQ250OworfQorCitzdGF0aWMgaW50IGdldEZpZWxkQ291bnQoaW50IHRhYmxlSWR4LCBpbnQgZmllbGRJZCwgaW50IG51bUVsZW0sIGludCBudkJpbikKK3sKKyAgIF9OVl9URU1QTEFURV9UQUJMRSAoKnBUYWJsZSlbVEFCTEVfRU5UUklFU19NQVhdOworICAgaW50IGlkeFN1YlRhYmxlOworICAgaW50IGksIGosIHN0b3JhZ2VUeXBlLCBmaWVsZDsKKyAgIGludCBudW1TdWJFbGVtPTAsIGlkeCA9MCwgc2l6ZTE9MCwgc2l6ZTI9MCwgc2l6ZTM9MCwgc2l6ZU9uZUVsZW09MDsKKyAgIGludCBlbnVtSWR4MT0wLCBlbnVtSWR4Mj0wLCBlbnVtSWR4Mz0wOworCisgICBpZiAoIG52QmluICkgeworICAgICAgcFRhYmxlID0gTnZUYWJsZXNGcm9tQmluOworICAgfQorICAgZWxzZSB7CisgICAgICBwVGFibGUgPSBOdlRhYmxlc0J1aWx0SW47CisgICB9CisKKyAgIHN0b3JhZ2VUeXBlID0gX1NUT1JBR0VfVFlQRShwVGFibGVbdGFibGVJZHhdW2ZpZWxkSWRdLmZpZWxkU3RvcmFnZVR5cGUpOworCisgICBpZiAoU0lOR1VMQVIgPT0gc3RvcmFnZVR5cGUpIHsKKyAgICAgIGlmIChJc0ZpZWxkVHlwZUJhc2ljRGF0YShwVGFibGVbdGFibGVJZHhdW2ZpZWxkSWRdLmZpZWxkSWQpKSB7CisgICAgICAgICBpZHggPSBfU1RPUkFHRV9UWVBFKHBUYWJsZVt0YWJsZUlkeF1bZmllbGRJZF0uZmllbGRTdG9yYWdlVHlwZSk7CisgICAgICAgICBzaXplMSA9IG51bUVsZW1CYXNlZE9uU3RvcmFnZVR5cGVbaWR4XSgmKHBUYWJsZVt0YWJsZUlkeF1bZmllbGRJZF0pLAorICAgICAgICAgICAgICAgICAgIG52QmluKTsKKyAgICAgIH0KKyAgICAgIGVsc2UgeworICAgICAgfQorICAgfQorICAgZWxzZSB7CisgICAgICBpZiAoQVJSQVlfMSA9PSBzdG9yYWdlVHlwZSkgeworICAgICAgICAgaWR4ID0gX1NUT1JBR0VfU0laRTEocFRhYmxlW3RhYmxlSWR4XVtmaWVsZElkXS5maWVsZFN0b3JhZ2VTaXplMSwKKyAgICAgICAgICAgICAgIHBUYWJsZVt0YWJsZUlkeF1bZmllbGRJZF0uZmllbGRTdG9yYWdlVHlwZSk7CisgICAgICAgICBzaXplMSA9IGdldE51bUVsZW1PdXRPZlN0b3JhZ2VTaXplKGlkeCwKKyAgICAgICAgICAgICAgICAgcFRhYmxlW3RhYmxlSWR4XVtmaWVsZElkXS5maWVsZFN0b3JhZ2VTaXplMSxudkJpbik7CisKKyAgICAgICAgIGlmICghS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FRhYmxlW3RhYmxlSWR4XVtmaWVsZElkXS5maWVsZFN0b3JhZ2VUeXBlKTsKKyAgICAgICAgIHNpemUyID0gZ2V0TnVtRWxlbU91dE9mU3RvcmFnZVNpemUoaWR4LAorICAgICAgICAgICAgICAgICBwVGFibGVbdGFibGVJZHhdW2ZpZWxkSWRdLmZpZWxkU3RvcmFnZVNpemUyLG52QmluKTsKKworICAgICAgICAgaWR4ID0gX1NUT1JBR0VfU0laRTMocFRhYmxlW3RhYmxlSWR4XVtmaWVsZElkXS5maWVsZFN0b3JhZ2VTaXplMywKKyAgICAgICAgICAgICAgIHBUYWJsZVt0YWJsZUlkeF1bZmllbGRJZF0uZmllbGRTdG9yYWdlVHlwZSk7CisgICAgICAgICBzaXplMyA9IGdldE51bUVsZW1PdXRPZlN0b3JhZ2VTaXplKGlkeCwKKyAgICAgICAgICAgICAgICAgcFRhYmxlW3RhYmxlSWR4XVtmaWVsZElkXS5maWVsZFN0b3JhZ2VTaXplMyxudkJpbik7CisKKyAgICAgICAgIGlmICghSXNGaWVsZFNpemVJbnQocFRhYmxlW3RhYmxlSWR4XVtmaWVsZElkXS5maWVsZFN0b3JhZ2VTaXplMSkpIHsKKyAgICAgICAgICAgIGVudW1JZHgxID0gKChwVGFibGVbdGFibGVJZHhdW2ZpZWxkSWRdLmZpZWxkU3RvcmFnZVNpemUxICYKKyAgICAgICAgICAgICAgICAgICAgICAgICBGSUVMRF9TSVpFX1ZBTFVFX01BU0spID4+IEZJRUxEX1NJWkVfVkFMVUVfTFNCKTsKKyAgICAgICAgIH0KKworICAgICAgICAgaWYgKCFJc0ZpZWxkU2l6ZUludChwVGFibGVbdGFibGVJZHhdW2ZpZWxkSWRdLmZpZWxkU3RvcmFnZVNpemUyKSkgeworICAgICAgICAgICAgZW51bUlkeDIgPSAoKHBUYWJsZVt0YWJsZUlkeF1bZmllbGRJZF0uZmllbGRTdG9yYWdlU2l6ZTIgJgorICAgICAgICAgICAgICAgICAgICAgICAgIEZJRUxEX1NJWkVfVkFMVUVfTUFTSykgPj4gRklFTERfU0laRV9WQUxVRV9MU0IpOworICAgICAgICAgfQorCisgICAgICAgICBpZiAoIUlzRmllbGRTaXplSW50KHBUYWJsZVt0YWJsZUlkeF1bZmllbGRJZF0uZmllbGRTdG9yYWdlU2l6ZTMpKSB7CisgICAgICAgICAgICBlbnVtSWR4MyA9ICgocFRhYmxlW3RhYmxlSWR4XVtmaWVsZElkXS5maWVsZFN0b3JhZ2VTaXplMyAmCisgICAgICAgICAgICAgICAgICAgICAgICAgRklFTERfU0laRV9WQUxVRV9NQVNLKSA+PiBGSUVMRF9TSVpFX1ZBTFVFX0xTQik7CisgICAgICAgICB9CisgICAgICB9CisgICAgICBlbHNlIHsKKyAgICAgIH0KKyAgIH0KKworICAgaWYgKElzRmllbGRUeXBlQmFzaWNEYXRhKHBUYWJsZVt0YWJsZUlkeF1bZmllbGRJZF0uZmllbGRJZCkpIHsKKyAgICAgICBmaWVsZCA9IHBUYWJsZVt0YWJsZUlkeF1bZmllbGRJZF0uZmllbGRJZDsKKyAgICAgICBzaXplT25lRWxlbSA9IHNpemVPbmVFbGVtQmFzZWRPbkZpZWxkSWRCYXNpY0RhdGFUeXBlW2ZpZWxkICYKKyAgICAgICAgICAgICAgICAgICAgICAgRklFTERfSURfVEFCTEVfT1JfRU5VTV9JRFhfTUFTS107CisgICAgICAgaWYgKCBzaXplMyApIHsKKyAgICAgICAgICBmaWVsZFNpemUgPSBmaWVsZFNpemUgKyBzaXplMyAgKiBzaXplMiAqIHNpemUxICogc2l6ZU9uZUVsZW07CisgICAgICAgfQorICAgICAgIGVsc2UgaWYgKCBzaXplMiApIHsKKyAgICAgICAgICBmaWVsZFNpemUgPSBmaWVsZFNpemUgKyBzaXplMiAqIHNpemUxICogc2l6ZU9uZUVsZW07CisgICAgICAgfQorICAgICAgIGVsc2UgaWYgKCBzaXplMSApIHsKKyAgICAgICAgICBmaWVsZFNpemUgPSBmaWVsZFNpemUgKyBzaXplMSAqIHNpemVPbmVFbGVtOworICAgICAgIH0KKyAgICAgICBlbHNlIHsKKyAgICAgICB9CisgICB9CisgICBlbHNlIHsKKyAgICAgIGlkeFN1YlRhYmxlID0gKHBUYWJsZVt0YWJsZUlkeF1bZmllbGRJZF0uZmllbGRJZCAmCisgICAgICAgICAgICBGSUVMRF9JRF9UQUJMRV9PUl9FTlVNX0lEWF9NQVNLKTsKKworICAgICAgZm9yIChqPTA7IGo8bnVtRWxlbTsgaisrKSB7CisgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgVEFCTEVfRU5UUklFU19NQVg7IGkrKykgeworICAgICAgICAgICAgaWYgKG51bCA9PSBwVGFibGVbaWR4U3ViVGFibGVdW2ldLmZpZWxkTmFtZVswXSkgeworICAgICAgICAgICAgIC8vIGRhdGEgcGFyc2luZyBkb25lIGZvciB0aGlzIHN0cmVhbQorICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZHggPSBfU1RPUkFHRV9UWVBFKHBUYWJsZVtpZHhTdWJUYWJsZV1baV0uZmllbGRTdG9yYWdlVHlwZSk7CisgICAgICAgICAgICBudW1TdWJFbGVtID0gbnVtRWxlbUJhc2VkT25TdG9yYWdlVHlwZVtpZHhdKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYocFRhYmxlW2lkeFN1YlRhYmxlXVtpXSksbnZCaW4pOworCisgICAgICAgICAgICBnZXRGaWVsZENvdW50KGlkeFN1YlRhYmxlLCBpLCBudW1TdWJFbGVtLCBudkJpbik7CisgICAgICAgICB9CisgICAgICB9CisgICB9CisKKyAgIHJldHVybiBmaWVsZFNpemU7Cit9CisKK3N0YXRpYyB2b2lkIHBhcnNlU3ViRGF0YVRhYmxlQW5kQ29weShpbnQgdGFibGVJZHgsIGludCBudW1FbGVtLCBpbnQgbnVtRWxlbTIsCisgICBpbnQgbnVtRWxlbTMsIGludCBmaWVsZElkLCBfTlZfU1RSRUFNX0JVRiAqcFN0cmVhbSwgaW50ICpwb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ZShpZHgxLAorICAgICAgICAgICAgICAgICAgICBwVGFibGVbdGFibGVJZHhdW2ZpZWxkSWRdLmZpZWxkU3RvcmFnZVNpemUzLCAxKTsKKworICAgICAgICAgICAgZmllbGRTaXplID0gMDsKKyAgICAgICAgICAgIGdldEJ1aWx0SW5GaWVsZENvdW50KHRhYmxlSWR4LAorICAgICAgICAgICAgICBwVGFibGVbdGFibGVJZHhdW2ZpZWxkSWRdLmZpZWxkTmFtZSwgJnRhYmxlSWR4QnVpbHRJbiwKKyAgICAgICAgICAgICAgJmZpZWxkSWRCdWlsdEluLCAmbnVtRWxlbUJ1aWx0SW4pOworCisgICAgICAgICAgICBpZHgxID0gX1NUT1JBR0VfU0laRTMoCisgICAgICAgICAgICAgIHBUYWJsZUJ1aWx0SW5bdGFibGVJZHhCdWlsdEluXVtmaWVsZElkQnVpbHRJbl0uZmllbGRTdG9yYWdlU2l6ZTMsCisgICAgICAgICAgICAgIHBUYWJsZUJ1aWx0SW5bdGFibGVJZHhCdWlsdEluXVtmaWVsZElkQnVpbHRJbl0uZmllbGRTdG9yYWdlVHlwZSk7CisgICAgICAgICAgICBzaXplM0J1aWx0SW4gPSBnZXROdW1FbGVtT3V0T2ZTdG9yYWdlU2l6ZShpZHgxLAorICAgICAgICAgICAgICBwVGFibGVCdWlsdEluW3RhYmxlSWR4QnVpbHRJbl1bZmllbGRJZEJ1aWx0SW5dLmZpZWxkU3RvcmFnZVNpemUzLAorICAgICAgICAgICAgICAwKTsKKworICAgICAgICAgICAgaWYgKCFJc0ZpZWxkU2l6ZUludChwVGFibGVbdGFibGVJZHhdW2ZpZWxkSWRdLmZpZWxkU3RvcmFnZVNpemUzKSkgeworICAgICAgICAgICAgICAgZW51bUlkeCA9ICgocFRhYmxlW3RhYmxlSWR4XVtmaWVsZElkXS5maWVsZFN0b3JhZ2VTaXplMyAmCisgICAgICAgICAgICAgICAgICBGSUVMRF9TSVpFX1ZBTFVFX01BU0spID4+IEZJRUxEX1NJWkVfVkFMVUVfTFNCKTsKKyAgICAgICAgICAgICAgIGlmIChOdkVudW1zRnJvbUJpbltlbnVtSWR4XVtsXS5lbnVtVmFsdWVQZWVyID09IDB4RkYpIHsKKyAgICAgICAgICAgICAgICAgICpwb3MgPSAqcG9zICsgKGZpZWxkQ291bnQvc2l6ZTFCaW4pICogbnVtRWxlbSAqIG51bUVsZW0yOworICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgIGlmICgobCsxKSA+IHNpemUzQnVpbHRJbikgeworICAgICAgICAgICAgICAgICAgKnBvcyA9ICpwb3MgKyAoZmllbGRDb3VudC9zaXplMUJpbikgKiBudW1FbGVtICogbnVtRWxlbTI7CisgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgICAgIGZvciAobT0wOyBtIDwgbnVtRWxlbTI7IG0rKykgeworICAgICAgICAgICAgaWYgKHN0b3JhZ2VUeXBlID09IEFSUkFZXzIpIHsKKyAgICAgICAgICAgICAgIGlkeDEgPSBfU1RPUkFHRV9TSVpFMigKKyAgICAgICAgICAgICAgICAgICAgICAgICBwVGFibGVbdGFibGVJZHhdW2ZpZWxkSWRdLmZpZWxkU3RvcmFnZVNpemUyLAorICAgICAgICAgICAgICAgICAgICAgICAgIHBUYWJsZVt0YWJsZUlkeF1bZmllbGRJZF0uZmllbGRTdG9yYWdlVHlwZSk7CisgICAgICAgICAgICAgICBzaXplMkJpbiA9IGdldE51bUVsZW1PdXRPZlN0b3JhZ2VTaXplKGlkeDEsCisgICAgICAgICAgICAgICAgICAgIHBUYWJsZVt0YWJsZUlkeF1bZmllbGRJZF0uZmllbGRTdG9yYWdlU2l6ZTIsIDEpOworCisgICAgICAgICAgICAgICBmaWVsZFNpemUgPSAwOworICAgICAgICAgICAgICAgZ2V0QnVpbHRJbkZpZWxkQ291bnQodGFibGVJZHgsCisgICAgICAgICAgICAgICAgIHBUYWJsZVt0YWJsZUlkeF1bZmllbGRJZF0uZmllbGROYW1lLCAmdGFibGVJZHhCdWlsdEluLAorICAgICAgICAgICAgICAgICAmZmllbGRJZEJ1aWx0SW4sICZudW1FbGVtQnVpbHRJbik7CisKKyAgICAgICAgICAgICAgIGlkeDEgPSBfU1RPUkFHRV9TSVpFMigKKyAgICAgICAgICAgICAgIHBUYWJsZUJ1aWx0SW5bdGFibGVJZHhCdWlsdEluXVtmaWVsZElkQnVpbHRJbl0uZmllbGRTdG9yYWdlU2l6ZTIsCisgICAgICAgICAgICAgICBwVGFibGVCdWlsdEluW3RhYmxlSWR4QnVpbHRJbl1bZmllbGRJZEJ1aWx0SW5dLmZpZWxkU3RvcmFnZVR5cGUpOworCisgICAgICAgICAgICAgICBzaXplMkJ1aWx0SW4gPSBnZXROdW1FbGVtT3V0T2ZTdG9yYWdlU2l6ZShpZHgxLAorICAgICAgICAgICAgICAgcFRhYmxlQnVpbHRJblt0YWJsZUlkeEJ1aWx0SW5dW2ZpZWxkSWRCdWlsdEluXS5maWVsZFN0b3JhZ2VTaXplMiwKKyAgICAgICAgICAgICAgIDApOworCisgICAgICAgICAgICAgICBpZiAoIUlzRmllbGRTaXplSW50KAorICAgICAgICAgICAgICAgICAgcFRhYmxlW3RhYmxlSWR4XVtmaWVsZElkXS5maWVsZFN0b3JhZ2VTaXplMikpIHsKKyAgICAgICAgICAgICAgICAgIGVudW1JZHggPSAoKHBUYWJsZVt0YWJsZUlkeF1bZmllbGRJZF0uZmllbGRTdG9yYWdlU2l6ZTIgJgorICAgICAgICAgICAgICAgICAgICAgRklFTERfU0laRV9WQUxVRV9NQVNLKSA+PiBGSUVMRF9TSVpFX1ZBTFVFX0xTQik7CisgICAgICAgICAgICAgICAgICBpZiAoTnZFbnVtc0Zyb21CaW5bZW51bUlkeF1bbV0uZW51bVZhbHVlUGVlciA9PSAweEZGKSB7CisgICAgICAgICAgICAgICAgICAgICAqcG9zID0gKnBvcyArIChmaWVsZENvdW50L3NpemUxQmluKSAqIG51bUVsZW07CisgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgaWYgKChtKzEpID4gc2l6ZTJCdWlsdEluKSB7CisgICAgICAgICAgICAgICAgICAgICAqcG9zID0gKnBvcyArIChmaWVsZENvdW50L3NpemUxQmluKSAqIG51bUVsZW07CisgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGZvciAoaj0wOyBqIDwgbnVtRWxlbTsgaisrKSB7CisgICAgICAgICAgICAgICBpZiAoc3RvcmFnZVR5cGUgPT0gQVJSQVlfMSkgeworICAgICAgICAgICAgICAgICAgZmllbGRTaXplID0gMDsKKyAgICAgICAgICAgICAgICAgIGdldEJ1aWx0SW5GaWVsZENvdW50KHRhYmxlSWR4LAorICAgICAgICAgICAgICAgICAgcFRhYmxlW3RhYmxlSWR4XVtmaWVsZElkXS5maWVsZE5hbWUsICZ0YWJsZUlkeEJ1aWx0SW4sCisgICAgICAgICAgICAgICAgICAmZmllbGRJZEJ1aWx0SW4sICZudW1FbGVtQnVpbHRJbik7CisKKyAgICAgICAgICAgICAgICAgIGlkeDEgPSBfU1RPUkFHRV9TSVpFMSgKKyAgICAgICAgICAgICAgICAgIHBUYWJsZUJ1aWx0SW5bdGFibGVJZHhCdWlsdEluXVtmaWVsZElkQnVpbHRJbl0uZmllbGRTdG9yYWdlU2l6ZTEsCisgICAgICAgICAgICAgICAgICBwVGFibGVCdWlsdEluW3RhYmxlSWR4QnVpbHRJbl1bZmllbGRJZEJ1aWx0SW5dLmZpZWxkU3RvcmFnZVR5cGUpOworCisgICAgICAgICAgICAgICAgICBzaXplMUJ1aWx0SW4gPSBnZXROdW1FbGVtT3V0T2ZTdG9yYWdlU2l6ZShpZHgxLAorICAgICAgICAgICAgICAgICAgcFRhYmxlQnVpbHRJblt0YWJsZUlkeEJ1aWx0SW5dW2ZpZWxkSWRCdWlsdEluXS5maWVsZFN0b3JhZ2VTaXplMSwKKyAgICAgICAgICAgICAgICAgIDApOworCisgICAgICAgICAgICAgICAgICBpZiAoIUlzRmllbGRTaXplSW50KAorICAgICAgICAgICAgICAgICAgICAgICAgcFRhYmxlW3RhYmxlSWR4XVtmaWVsZElkXS5maWVsZFN0b3JhZ2VTaXplMSkpIHsKKyAgICAgICAgICAgICAgICAgICAgIGVudW1JZHggPSAoKHBUYWJsZVt0YWJsZUlkeF1bZmllbGRJZF0uZmllbGRTdG9yYWdlU2l6ZTEgJgorICAgICAgICAgICAgICAgICAgICAgICAgRklFTERfU0laRV9WQUxVRV9NQVNLKSA+PiBGSUVMRF9TSVpFX1ZBTFVFX0xTQik7CisgICAgICAgICAgICAgICAgICAgICBpZiAoTnZFbnVtc0Zyb21CaW5bZW51bUlkeF1bal0uZW51bVZhbHVlUGVlciA9PSAweEZGKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAqcG9zID0gKnBvcyArIChmaWVsZENvdW50L3NpemUxQmluKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICBpZiAoKGorMSkgPiBzaXplMUJ1aWx0SW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICpwb3MgPSAqcG9zICsgKGZpZWxkQ291bnQvc2l6ZTFCaW4pOworICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBUQUJMRV9FTlRSSUVTX01BWDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICBpZiAobnVsID09IHBUYWJsZVtpZHhTdWJUYWJsZV1baV0uZmllbGROYW1lWzBdKSB7CisgICAgICAgICAgICAgICAgICAgLy8gZGF0YSBwYXJzaW5nIGRvbmUgZm9yIHRoaXMgc3RyZWFtCisgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgIGlkeCA9IF9TVE9SQUdFX1RZUEUocFRhYmxlW2lkeFN1YlRhYmxlXVtpXS5maWVsZFN0b3JhZ2VUeXBlKTsKKyAgICAgICAgICAgICAgICAgIG51bVN1YkVsZW0gPSBudW1FbGVtQmFzZWRPblN0b3JhZ2VUeXBlW2lkeF0oCisgICAgICAgICAgICAgICAgICAgICAmKHBUYWJsZVtpZHhTdWJUYWJsZV1baV0pLDEpOworICAgICAgICAgICAgICAgICAgbnVtU3ViRWxlbTIgPSBudW1TdWJFbGVtMyA9IDE7CisKKyAgICAgICAgICAgICAgICAgIGlmIChpZHggPT0gQVJSQVlfMSkgeworICAgICAgICAgICAgICAgICAgICAgaWR4MSA9IF9TVE9SQUdFX1NJWkUxKAorICAgICAgICAgICAgICAgICAgICAgICAgcFRhYmxlW2lkeFN1YlRhYmxlXVtpXS5maWVsZFN0b3JhZ2VTaXplMSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUYWJsZVtpZHhTdWJUYWJsZV1baV0uZmllbGRTdG9yYWdlVHlwZSk7CisgICAgICAgICAgICAgICAgICAgICBudW1TdWJFbGVtID0gZ2V0TnVtRWxlbU91dE9mU3RvcmFnZVNpemUoaWR4MSwKKyAgICAgICAgICAgICAgICAgICAgICAgcFRhYmxlW2lkeFN1YlRhYmxlXVtpXS5maWVsZFN0b3JhZ2VTaXplMSwgMSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChpZHggPT0gQVJSQVlfMikgeworICAgICAgICAgICAgICAgICAgICAgaWR4MSA9IF9TVE9SQUdFX1NJWkUxKAorICAgICAgICAgICAgICAgICAgICAgICAgcFRhYmxlW2lkeFN1YlRhYmxlXVtpXS5maWVsZFN0b3JhZ2VTaXplMSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUYWJsZVtpZHhTdWJUYWJsZV1baV0uZmllbGRTdG9yYWdlVHlwZSk7CisgICAgICAgICAgICAgICAgICAgICBudW1TdWJFbGVtID0gZ2V0TnVtRWxlbU91dE9mU3RvcmFnZVNpemUoaWR4MSwKKyAgICAgICAgICAgICAgICAgICAgICAgcFRhYmxlW2lkeFN1YlRhYmxlXVtpXS5maWVsZFN0b3JhZ2VTaXplMSwgMSk7CisKKyAgICAgICAgICAgICAgICAgICAgIGlkeDEgPSBfU1RPUkFHRV9TSVpFMigKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUYWJsZVtpZHhTdWJUYWJsZV1baV0uZmllbGRTdG9yYWdlU2l6ZTIsCisgICAgICAgICAgICAgICAgICAgICAgICBwVGFibGVbaWR4U3ViVGFibGVdW2ldLmZpZWxkU3RvcmFnZVR5cGUpOworICAgICAgICAgICAgICAgICAgICAgbnVtU3ViRWxlbTIgPSBnZXROdW1FbGVtT3V0T2ZTdG9yYWdlU2l6ZShpZHgxLAorICAgICAgICAgICAgICAgICAgICAgICBwVGFibGVbaWR4U3ViVGFibGVdW2ldLmZpZWxkU3RvcmFnZVNpemUyLCAxKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGlkeCA9PSBBUlJBWV8zKSB7CisgICAgICAgICAgICAgICAgICAgICBpZHgxID0gX1NUT1JBR0VfU0laRTEoCisgICAgICAgICAgICAgICAgICAgICAgICBwVGFibGVbaWR4U3ViVGFibGVdW2ldLmZpZWxkU3RvcmFnZVNpemUxLAorICAgICAgICAgICAgICAgICAgICAgICAgcFRhYmxlW2lkeFN1YlRhYmxlXVtpXS5maWVsZFN0b3JhZ2VUeXBlKTsKKyAgICAgICAgICAgICAgICAgICAgIG51bVN1YkVsZW0gPSBnZXROdW1FbGVtT3V0T2ZTdG9yYWdlU2l6ZShpZHgxLAorICAgICAgICAgICAgICAgICAgICAgICBwVGFibGVbaWR4U3ViVGFibGVdW2ldLmZpZWxkU3RvcmFnZVNpemUxLCAxKTsKKworICAgICAgICAgICAgICAgICAgICAgaWR4MSA9IF9TVE9SQUdFX1NJWkUyKAorICAgICAgICAgICAgICAgICAgICAgICAgcFRhYmxlW2lkeFN1YlRhYmxlXVtpXS5maWVsZFN0b3JhZ2VTaXplMiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUYWJsZVtpZHhTdWJUYWJsZV1baV0uZmllbGRTdG9yYWdlVHlwZSk7CisgICAgICAgICAgICAgICAgICAgICBudW1TdWJFbGVtMiA9IGdldE51bUVsZW1PdXRPZlN0b3JhZ2VTaXplKGlkeDEsCisgICAgICAgICAgICAgICAgICAgICAgIHBUYWJsZVtpZHhTdWJUYWJsZV1baV0uZmllbGRTdG9yYWdlU2l6ZTIsIDEpOworCisgICAgICAgICAgICAgICAgICAgICBpZHgxID0gX1NUT1JBR0VfU0laRTMoCisgICAgICAgICAgICAgICAgICAgICAgICBwVGFibGVbaWR4U3ViVGFibGVdW2ldLmZpZWxkU3RvcmFnZVNpemUzLAorICAgICAgICAgICAgICAgICAgICAgICAgcFRhYmxlW2lkeFN1YlRhYmxlXVtpXS5maWVsZFN0b3JhZ2VUeXBlKTsKKyAgICAgICAgICAgICAgICAgICAgIG51bVN1YkVsZW0zID0gZ2V0TnVtRWxlbU91dE9mU3RvcmFnZVNpemUoaWR4MSwKKyAgICAgICAgICAgICAgICAgICAgICAgcFRhYmxlW2lkeFN1YlRhYmxlXVtpXS5maWVsZFN0b3JhZ2VTaXplMywgMSk7CisgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgIGlmIChfT0ZGU0VUX05PVF9TRVQgIT0gcFRhYmxlW2lkeFN1YlRhYmxlXVtpXS5vZmZzZXQpIHsKKyAgICAgICAgICAgICAgICAgICAgIGlmICggcFRhYmxlW3RhYmxlSWR4XVtmaWVsZElkXS5vZmZzZXQgPT0gYWRkT2Zmc2V0ICkgeworICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VTdWJEYXRhVGFibGVBbmRDb3B5KGlkeFN1YlRhYmxlLCBudW1TdWJFbGVtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtU3ViRWxlbTIsIG51bVN1YkVsZW0zLCBpLCBwU3RyZWFtLCBwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRPZmZzZXQsIHRhYmxlQmFzZU9mZnNldCwgbG9jYWxBZGRPZmZzZXQpOworICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAvLyBOT1QgdGhlIGZpcnN0IEVudHJ5IGluIHRoZSB0YWJsZS4uCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoICFwVGFibGVbdGFibGVJZHhdW2ZpZWxkSWRdLm9mZnNldCApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlU3ViRGF0YVRhYmxlQW5kQ29weShpZHhTdWJUYWJsZSwgbnVtU3ViRWxlbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtU3ViRWxlbTIsIG51bVN1YkVsZW0zLCBpLCBwU3RyZWFtLCBwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZE9mZnNldCwgdGFibGVCYXNlT2Zmc2V0LCBsb2NhbEFkZE9mZnNldCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vRmlyc3QgRW50cnkgaW4gdGhlIHRoZSB0YWJsZS4uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyhTZW5kaW5nIHBhcmVudCBvZmZzZXQuLikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlU3ViRGF0YVRhYmxlQW5kQ29weShpZHhTdWJUYWJsZSwgbnVtU3ViRWxlbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bVN1YkVsZW0yLCBudW1TdWJFbGVtMywgaSwgcFN0cmVhbSwgcG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkT2Zmc2V0LCB0YWJsZUJhc2VPZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVGFibGVbdGFibGVJZHhdW2ZpZWxkSWRdLm9mZnNldCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgIGZpZWxkU2l6ZSA9IDA7CisgICAgICAgICAgICAgICAgICAgICBmaWVsZENvdW50ID0gZ2V0RmllbGRDb3VudChpZHhTdWJUYWJsZSwgaSwgbnVtU3ViRWxlbSwgMSk7CisgICAgICAgICAgICAgICAgICAgICAqcG9zICs9IGZpZWxkQ291bnQ7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICBsb2NhbEFkZE9mZnNldCA9IGxvY2FsQWRkT2Zmc2V0ICsgaW5jQWRkT2Zmc2V0OworICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgfQorICB9CisKKyAgcmV0dXJuOworfQorCitzdGF0aWMgdm9pZCBwcm9jZXNzTnZEYXRhKF9OVl9TVFJFQU1fQlVGICpwU3RyZWFtLCBpbnQgbGVuKQoreworICAgaW50IHRhYmxlSWR4LCBwb3MsIGlkeCA9IDAsIGFkZE9mZnNldCA9IDAsIGk7CisgICBpbnQgbnVtRWxlbSA9IDAsIGFkZGl0aW9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VBFKHBUYWJsZVswXVtpXS5maWVsZFN0b3JhZ2VUeXBlKTsKKworICAgICAgICAgLy8gbnVtYmVyIG9mIGVsZW1lbnQKKyAgICAgICAgIG51bUVsZW0gPSBudW1FbGVtQmFzZWRPblN0b3JhZ2VUeXBlW2lkeF0oJihwVGFibGVbMF1baV0pLDEpOworCisgICAgICAgICAvLyByZWN1cnNpdmUgY2FsbHMgZm9yIHRoZSB0b3RhbCBzaXplIG9mIHRoZSBzdWJ0YWJsZSwgd2hpY2ggbWF5CisgICAgICAgICAvLyBjb250YWluIG5lc3RlZCB0YWJsZXMKKyAgICAgICAgIHN1YlRhYmxlU2l6ZSA9IDA7CisgICAgICAgICBwYXJzZVN1YkRhdGFUYWJsZTRTaXplKHRhYmxlSWR4LCBudW1FbGVtKTsKKworICAgICAgICAgLy8gYWRkaXRpb25hbCBvZmZzZXQgZm9yIEVBQ0ggc3Vic2VxdWVudCB0YWJsZSBlbGVtZW50CisgICAgICAgICBhZGRpdGlvbmFsT2Zmc2V0ID0gc3ViVGFibGVTaXplL251bUVsZW07CisKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgfQorCisgICBpZiAobnVtRWxlbSkgeworICAgICAgZm9yIChpID0gMDsgaSA8IG51bUVsZW07IGkrKykgeworICAgICAgICAgIGFkZE9mZnNldCA9IChpICogYWRkaXRpb25hbE9mZnNldCk7CisgICAgICAgICAgcGFyc2VEYXRhVGFibGVfbmV3KHBTdHJlYW0sICZwb3MsIHRhYmxlSWR4LCBhZGRPZmZzZXQsCisgICAgICAgICAgICAgdGFibGVCYXNlT2Zmc2V0KTsKKyAgICAgIH0KKyAgIH0KKworICAgLy8gdGhlIGFib3ZlIHJlY3Vyc2l2ZSBkYXRhIHRhYmxlIHBhcnNlciB0YWtlcyBjYXJlIG9mIHRoZSBuZXN0ZWQgdGFibGVzCisgICAvLyBhbGwgZG9uZQorICAgcmV0dXJuOworfQorCitzdGF0aWMgdm9pZCBwYXJzZURhdGFUYWJsZV9uZX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AgICB9CisgICAgICBlbHNlIHsKKyAgICAgICAgIHBFbnVtID0gTnZFbnVtc0J1aWx0SW47CisgICAgICB9CisKKyAgICAgIGZvciAoaSA9IDA7IGkgPCBFTlVNX0VOVFJJRVNfTUFYOyBpKyspIHsKKyAgICAgICAgICBpZiAobnVsID09IHBFbnVtW2VudW1JZHhdW2ldLmVudW1OYW1lWzBdKSB7CisgICAgICAgICAgICAgIGlmICggaSA9PSAwICkgeworICAgICAgICAgICAgICAgICBtYXhFbnVtVmFsID0gMDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgbWF4RW51bVZhbCA9IHBFbnVtW2VudW1JZHhdW2ktMV0uZW51bVZhbHVlOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIHJldCA9IChtYXhFbnVtVmFsICsgMSk7CisgICAgICByZXR1cm4gcmV0OyAvLyArMSB0byBjb3VudCBmb3IgMCB0byBtYXhFbnVtVmFsCisgICB9Cit9CisKK3N0YXRpYyBpbnQgbnVtRWxlbUFycmF5MShfTlZfVEVNUExBVEVfVEFCTEUgKnBUYWJsZUVudHJ5LCBpbnQgbnZCaW4pCit7CisgICBpbnQgZmllbGRTdG9yYWdlU2l6ZSA9IDA7CisKKyAgIGZpZWxkU3RvcmFnZVNpemUgPSBnZXROdW1FbGVtT3V0T2ZTdG9yYWdlU2l6ZShfU1RPUkFHRV9TSVpFMSgKKyAgICAgICAgICAgICBwVGFibGVFbnRyeS0+ZmllbGRTdG9yYWdlU2l6ZTEsIHBUYWJsZUVudHJ5LT5maWVsZFN0b3JhZ2VUeXBlKSwKKyAgICAgICAgICAgICBwVGFibGVFbnRyeS0+ZmllbGRTdG9yYWdlU2l6ZTEsIG52QmluKTsKKworICAgcmV0dXJuIGZpZWxkU3RvcmFnZVNpemU7Cit9CisKK3N0YXRpYyBpbnQgbnVtRWxlbUFycmF5MihfTlZfVEVNUExBVEVfVEFCTEUgKnBUYWJsZUVudHJ5LCBpbnQgbnZCaW4pCit7CisgICBpbnQgZmllbGRTdG9yYWdlU2l6ZTEsZmllbGRTdG9yYWdlU2l6ZTIsZmllbGRTdG9yYWdlU2l6ZTsKKworICAgZmllbGRTdG9yYWdlU2l6ZTEgPSBnZXROdW1FbGVtT3V0T2ZTdG9yYWdlU2l6ZShfU1RPUkFHRV9TSVpFMSgKKyAgICAgICAgICAgICAgICAgICAgICAgICBwVGFibGVFbnRyeS0+ZmllbGRTdG9yYWdlU2l6ZTEsCisgICAgICAgICAgICAgICAgICAgICAgICAgcFRhYmxlRW50cnktPmZpZWxkU3RvcmFnZVR5cGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgIHBUYWJsZUVudHJ5LT5maWVsZFN0b3JhZ2VTaXplMSwgbnZCaW4pOworCisgICBmaWVsZFN0b3JhZ2VTaXplMiA9IGdldE51bUVsZW1PdXRPZlN0b3JhZ2VTaXplKF9TVE9SQUdFX1NJWkUyKAorICAgICAgICAgICAgICAgICAgICAgICAgcFRhYmxlRW50cnktPmZpZWxkU3RvcmFnZVNpemUyLAorICAgICAgICAgICAgICAgICAgICAgICAgcFRhYmxlRW50cnktPmZpZWxkU3RvcmFnZVR5cGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgcFRhYmxlRW50cnktPmZpZWxkU3RvcmFnZVNpemUyLCBudkJpbik7CisKKyAgIGZpZWxkU3RvcmFnZVNpemUgPSBmaWVsZFN0b3JhZ2VTaXplMSAqIGZpZWxkU3RvcmFnZVNpemUyOworCisgICByZXR1cm4gZmllbGRTdG9yYWdlU2l6ZTsKK30KKworc3RhdGljIGludCBudW1FbGVtQXJyYXkzKF9OVl9URU1QTEFURV9UQUJMRSAqcFRhYmxlRW50cnksIGludCBudkJpbikKK3sKKyAgIGludCBmaWVsZFN0b3JhZ2VTaXplMSxmaWVsZFN0b3JhZ2VTaXplMixmaWVsZFN0b3JhZ2VTaXplMyxmaWVsZFN0b3JhZ2VTaXplOworCisgICBmaWVsZFN0b3JhZ2VTaXplMSA9IGdldE51bUVsZW1PdXRPZlN0b3JhZ2VTaXplKF9TVE9SQUdFX1NJWkUxKAorICAgICAgICAgICAgICAgICAgICAgICAgIHBUYWJsZUVudHJ5LT5maWVsZFN0b3JhZ2VTaXplMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBwVGFibGVFbnRyeS0+ZmllbGRTdG9yYWdlVHlwZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgcFRhYmxlRW50cnktPmZpZWxkU3RvcmFnZVNpemUxLCBudkJpbik7CisKKyAgIGZpZWxkU3RvcmFnZVNpemUyID0gZ2V0TnVtRWxlbU91dE9mU3RvcmFnZVNpemUoX1NUT1JBR0VfU0laRTIoCisgICAgICAgICAgICAgICAgICAgICAgICBwVGFibGVFbnRyeS0+ZmllbGRTdG9yYWdlU2l6ZTIsCisgICAgICAgICAgICAgICAgICAgICAgICBwVGFibGVFbnRyeS0+ZmllbGRTdG9yYWdlVHlwZSksCisgICAgICAgICAgICAgICAgICAgICAgICBwVGFibGVFbnRyeS0+ZmllbGRTdG9yYWdlU2l6ZTIsIG52QmluKTsKKworICAgZmllbGRTdG9yYWdlU2l6ZTMgPSBnZXROdW1FbGVtT3V0T2ZTdG9yYWdlU2l6ZShfU1RPUkFHRV9TSVpFMygKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUYWJsZUVudHJ5LT5maWVsZFN0b3JhZ2VTaXplMywKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUYWJsZUVudHJ5LT5maWVsZFN0b3JhZ2VUeXBlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBUYWJsZUVudHJ5LT5maWVsZFN0b3JhZ2VTaXplMywgbnZCaW4pOworCisgICBmaWVsZFN0b3JhZ2VTaXplID0gZmllbGRTdG9yYWdlU2l6ZTEgKiBmaWVsZFN0b3JhZ2VTaXplMiAqIGZpZWxkU3RvcmFnZVNpemUzOworCisgICByZXR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BMaW51eCBGb3VuZGF0aW9uLgorICovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAgICAgICAgICAgICAgICAgIEVESVQgSElTVE9SWSBGT1IgRklMRQorCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLgorICBOb3RpY2UgdGhhdCBjaGFuZ2VzIGFyZSBsaXN0ZWQgaW4gcmV2ZXJzZSBjaHJvbm9sb2dpY2FsIG9yZGVyLgorCisgICRIZWFkZXI6JCAkRGF0ZVRpbWU6ICQgJEF1dGhvcjogJAorCisgIHdoZW4gICAgICAgIHdobyAgICAgICAgd2hhdCwgd2hlcmUsIHdoeQorICAtLS0tLS0tLSAgICAtLS0gICAgICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgIDA0LzEwLzEzICAgIGt1bWFycHJhICAgbnYgYnVpbHQgaW4gIGNyZWF0aW9uCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisKKy8qCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgIFRoaXMgZmlsZSBpcyBnZW5lcmF0ZWQgYnkgbnZUbXBsUnVuIFBhcnNlcgorICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBUbyBiZSBhdXRvLWdlbmVyYXRlZCwgb3IKKyAgVGhpcyBpcyB0aGUgc291cmNlIGZpbGUgYW5kIHRoZSBoZWFkZXIgZmlsZSBjYW4gYmUgZ2VuZXJhdGVkIGZyb20gdGhpcworICB0ZW1wbGF0ZSBmaWxlLgorCisgIFRl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wKKyAgICAgIHsiYmUiLFJGX1NVQkJBTkRfNV9MT1dfR0haLDAse251bH19LAorICAgICAgeyJiZiIsUkZfU1VCQkFORF81X01JRF9HSFosMCx7bnVsfX0sCisgICAgICB7ImJnIixSRl9TVUJCQU5EXzVfSElHSF9HSFosMCx7bnVsfX0sCisgICAgICB7ImJoIixSRl9TVUJCQU5EXzRfOV9HSFosMCx7bnVsfX0sCisgICAgICB7e251bH0sMCwgMCx7bnVsfX0sCisgICB9LCAvLyBJTkRFWF9FTlVNX05VTV9SRl9TVUJCQU5EUworCisgICB7IC8vIElOREVYX0VOVU1fTlVNX1JGX0NIQU5ORUxTCisgICAgICB7ImJqIixSRl9DSEFOXzEsMCx7bnVsfX0sCisgICAgICB7ImJrIixSRl9DSEFOXzIsMCx7bnVsfX0sCisgICAgICB7ImJsIixSRl9DSEFOXzMsMCx7bnVsfX0sCisgICAgICB7ImJtIixSRl9DSEFOXzQsMCx7bnVsfX0sCisgICAgICB7ImJuIixSRl9DSEFOXzUsMCx7bnVsfX0sCisgICAgICB7ImJvIixSRl9DSEFOXzYsMCx7bnVsfX0sCisgICAgICB7ImJwIixSRl9DSEFOXzcsMCx7bnVsfX0sCisgICAgICB7ImJxIixSRl9DSEFOXzgsMCx7bnVsfX0sCisgICAgICB7ImJyIixSRl9DSEFOXzksMCx7bnVsfX0sCisgICAgICB7ImJzIixSRl9DSEFOXzEwLDAse251bH19LAorICAgICAgeyJidCIsUkZfQ0hBTl8xMSwwLHtudWx9fSwKKyAgICAgIHsiYnUiLFJGX0NIQU5fMTIsMCx7bnVsfX0sCisgICAgICB7ImJ2IixSRl9DSEFOXzEzLDAse251bH19LAorICAgICAgeyJidyIsUkZfQ0hBTl8xNCwwLHtudWx9fSwKKyAgICAgIHsiYngiLFJGX0NIQU5fMjQwLDAse251bH19LAorICAgICAgeyJieSIsUkZfQ0hBTl8yNDQsMCx7bnVsfX0sCisgICAgICB7ImJ6IixSRl9DSEFOXzI0OCwwLHtudWx9fSwKKy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pFX1RZUEVfQklUKEZJRUxEX1NJWkVfSURYX0VOVU0pKXwKKyAgICAgICAgIChGSUVMRF9TSVpFX1ZBTFVFX0JJVFMoSU5ERVhfRU5VTV9OVU1fUkZfU1VCQkFORFMpKSksMCwwLAorICAgICAgICAgKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5wd3JPcHRpbXVtWzBdKSAtIChjaGFyICopJm52RGVmYXVsdHMudGFibGVzKSwKKyAgICAgICAgICJwd3JPcHRpbXVtIn0sCisgICAgICB7ImR4IixfVEFCTEVfSURYKFRBQkxFX3NSZWd1bGF0b3J5Q2hhbm5lbCksKEFSUkFZXzEpLAorICAgICAgICAgKChGSUVMRF9TSVpFX1RZUEVfQklUKEZJRUxEX1NJWkVfSURYX0VOVU0pKXwKKyAgICAgICAgIChGSUVMRF9TSVpFX1ZBTFVFX0JJVFMoSU5ERVhfRU5VTV9OVU1fUkZfQ0hBTk5FTFMpKSksMCwwLAorICAgICAgICAgKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5yZWdEb21haW5zWzBdLmNoYW5uZWxzWzBdKSAtCisgICAgICAgICAgKGNoYXIgKikmbnZEZWZhdWx0cy50YWJsZXMucmVnRG9tYWluc1swXSksImNoYW5uZWxzIn0sCisgICAgICB7ImpuIixfVEFCTEVfSURYKFRBQkxFX3NSZWd1bGF0b3J5RG9tYWlucyksKEFSUkFZXzEpLAorICAgICAgICAgKChGSUVMRF9TSVpFX1RZUEVfQklUKEZJRUxEX1NJWkVfSURYX0VOVU0pKXwKKyAgICAgICAgIChGSUVMRF9TSVpFX1ZBTFVFX0JJVFMoSU5ERVhfRU5VTV9OVU1fUkVHX0RPTUFJTlMpKSksMCwwLAorICAgICAgICAgKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5yZWdEb21haW5zWzBdKSAtIChjaGFyICopJm52RGVmYXVsdHMudGFibGVzKSwKKyAgICAgICAgICJyZWdEb21haW5zIn0sCisgICAgICB7ImpvIixfVEFCTEVfS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ICAoY2hhciAqKSZudkRlZmF1bHRzLmZpZWxkcyksIndsYW5OdlJldklkIn0sCisgICAgICB7ImFzIixfSURfVTgsU0lOR1VMQVIsMCwwLDAsKChjaGFyICopJihudkRlZmF1bHRzLmZpZWxkcy5udW1PZlR4Q2hhaW5zKSAtCisgICAgICAgICAgKGNoYXIgKikmbnZEZWZhdWx0cy5maWVsZHMpLCJudW1PZlR4Q2hhaW5zIn0sCisgICAgICB7ImF0IixfSURfVTgsU0lOR1VMQVIsMCwwLDAsKChjaGFyICopJihudkRlZmF1bHRzLmZpZWxkcy5udW1PZlJ4Q2hhaW5zKSAtCisgICAgICAgICAgKGNoYXIgKikmbnZEZWZhdWx0cy5maWVsZHMpLCJudW1PZlJ4Q2hhaW5zIn0sCisgICAgICB7ImF1IixfSURfVTgsKF9BRERfU0laRTEoTlZfRklFTERfTUFDX0FERFJfU0laRSl8QVJSQVlfMSksCisgICAgICAgICAoKEZJRUxEX1NJWkVfVFlQRV9CSVQoRklFTERfU0laRV9JRFhfSU5UKSl8CisgICAgICAgICAoRklFTERfU0laRV9WQUxVRV9CSVRTKE5WX0ZJRUxEX01BQ19BRERSX1NJWkUpKSksMCwwLAorICAgICAgICAgKChjaGFyICopJihudkRlZmF1bHRzLmZpZWxkcy5tYWNBZGRyWzBdKSAtIChjaGFyICopJm52RGVmYXVsdHMuZmllbGRzKSwKKyAgICAgICAgICJtYWNBZGRyIn0sCisgICAgICB7ImF2IixfSURfVTgsKF9BRERfU0laRTEoTlZfRklFTERfTUFDX0FERFJfU0laRSl8QVJSQVlfMSksCisgICAgICAgICAoKEZJRUxEX1NJWkVfVFlQRV9CSVQoRklFTERfU0laRV9JRFhfSU5UKSl8CisgICAgICAgICAoRklFTERfU0laRV9WQUxVRV9CSVRTKE5WX0ZJRUxEX01BQ19BRERSX1NJWkUpKSksMCwwLAorICAgICAgICAgKChjaGFyICopJihudkRlZmF1bHRzLmZpZWxkcy5tYWNBZGRyMlswXSkgLSAoY2hhciAqKSZudk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WzBdKSAtIChjaGFyICopJm52RGVmYXVsdHMuZmllbGRzKSwibWZnU04ifQorICAgICAgICAgLAorICAgICAgeyJheiIsX0lEX1U4LFNJTkdVTEFSLDAsMCwwLCgoY2hhciAqKSYobnZEZWZhdWx0cy5maWVsZHMuY291cGxlclR5cGUpIC0KKyAgICAgICAgICAoY2hhciAqKSZudkRlZmF1bHRzLmZpZWxkcyksImNvdXBsZXJUeXBlIn0sCisgICAgICB7ImEwIixfSURfVTgsU0lOR1VMQVIsMCwwLDAsKChjaGFyICopJihudkRlZmF1bHRzLmZpZWxkcy5udlZlcnNpb24pIC0KKyAgICAgICAgICAoY2hhciAqKSZudkRlZmF1bHRzLmZpZWxkcyksIm52VmVyc2lvbiJ9LAorICAgICAge3tudWx9LCAwLCAwLCAwLCAwLCAwLCAwLHtudWx9fSwKKyAgIH0sIC8vIFRBQkxFX3NOdkZpZWxkcworCisgICB7IC8vIFRBQkxFX3NSZWd1bGF0b3J5Q2hhbm5lbAorICAgICAgeyJkdiIsX0lEX1U4LFNJTkdVTEFSLDAsMCwwLAorICAgICAgICAgKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5yZWdEb21haW5zWzBdLmNoYW5uZWxzWzBdLmVuYWJsZWQpIC0KKyAgICAgICAgICAoY2hhciAqKSZudkRlZmF1bHRzLnRhYmxlcy5yZWdEb21haW5zWzBdLmNoYW5uZWxzWzBdKSwiZW5hYmxlZCJ9LAorICAgICAgeyJkdyIsX0lEX1M4LFNJTkdVTEFSLDAsMCwwLAorICAgICAgICAgKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5yZWdEb21haW5zWzBdLmNoYW5uZWxzWzBdLnB3ckxpbWl0KSAtCisgICAgICAgICAgKGNoYXIgKikmbnZEZWZhdWx0cy50YWJsZXMucmVnRG9tYWluc1swXS5jaGFubmVsc1swXSksInB3ckxpbWl0In0sCisgICAgICB7e251bH0sIDAsIDAsIDAsIDAsIDAsIDAse251bH19LAorICAgfSwgLy8gVE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0YSksImh3UGFyYW00In0sCisgICAgICB7ImVqIixfSURfVTMyLFNJTkdVTEFSLDAsMCwwLAorICAgICAgICAgKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5od0NhbFZhbHVlcy5jYWxEYXRhLmh3UGFyYW01KSAtCisgICAgICAgICAgKGNoYXIgKikmbnZEZWZhdWx0cy50YWJsZXMuaHdDYWxWYWx1ZXMuY2FsRGF0YSksImh3UGFyYW01In0sCisgICAgICB7ImVrIixfSURfVTMyLFNJTkdVTEFSLDAsMCwwLAorICAgICAgICAgKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5od0NhbFZhbHVlcy5jYWxEYXRhLmh3UGFyYW02KSAtCisgICAgICAgICAgKGNoYXIgKikmbnZEZWZhdWx0cy50YWJsZXMuaHdDYWxWYWx1ZXMuY2FsRGF0YSksImh3UGFyYW02In0sCisgICAgICB7ImVsIixfSURfVTMyLFNJTkdVTEFSLDAsMCwwLAorICAgICAgICAgKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5od0NhbFZhbHVlcy5jYWxEYXRhLmh3UGFyYW03KSAtCisgICAgICAgICAgKGNoYXIgKikmbnZEZWZhdWx0cy50YWJsZXMuaHdDYWxWYWx1ZXMuY2FsRGF0YSksImh3UGFyYW03In0sCisgICAgICB7ImVtIixfSURfVTMyLFNJTkdVTEFSLDAsMCwwLAorICAgICAgICAgKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5od0NhbFZhbHVlcy5jYWxEYXRhLmh3UGFyYW04KSAtCisgICAgICAgICAgKGNoYXIgKikmbnZEZWZhdWx0cy50YWJsZXMuaHdDYWxWYWx1ZXMuY2FsRGF0YSksImh3UGFyYW04In0sCisgICAgICB7ImVuIixfSURfVTMyLFNJTkdVTEFSLDAsMCwwLAorICAgICAgICAgKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5od0NhbFZhbHVlcy5jYWxEYXRhLmh3UGFyYW05KSAtCisgICAgICAgICAgKGNoYXI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JsZXMuZGVmYXVsdENvdW50cnlUYWJsZS5jb3VudHJ5Q29kZVswXSkgLQorICAgICAgICAgIChjaGFyICopJm52RGVmYXVsdHMudGFibGVzLmRlZmF1bHRDb3VudHJ5VGFibGUpLCJjb3VudHJ5Q29kZSJ9LAorICAgICAge3tudWx9LCAwLCAwLCAwLCAwLCAwLCAwLHtudWx9fSwKKyAgIH0sIC8vIFRBQkxFX3NEZWZhdWx0Q291bnRyeQorCisgICB7IC8vIFRBQkxFX3NGd0NvbmZpZworICAgICAgeyJpaCIsX0lEX1U4LFNJTkdVTEFSLDAsMCwwLCgoY2hhciAqKSYobnZEZWZhdWx0cy50YWJsZXMuZndDb25maWcuc2t1SUQpIC0KKyAgICAgICAgICAoY2hhciAqKSZudkRlZmF1bHRzLnRhYmxlcy5md0NvbmZpZyksInNrdUlEIn0sCisgICAgICB7ImlpIixfSURfVTgsU0lOR1VMQVIsMCwwLDAsKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5md0NvbmZpZy50cGNNb2RlMkcpCisgICAgICAgICAgLSAoY2hhciAqKSZudkRlZmF1bHRzLnRhYmxlcy5md0NvbmZpZyksInRwY01vZGUyRyJ9LAorICAgICAgeyJpaiIsX0lEX1U4LFNJTkdVTEFSLDAsMCwwLCgoY2hhciAqKSYobnZEZWZhdWx0cy50YWJsZXMuZndDb25maWcudHBjTW9kZTVHKQorICAgICAgICAgIC0gKGNoYXIgKikmbnZEZWZhdWx0cy50YWJsZXMuZndDb25maWcpLCJ0cGNNb2RlNUcifSwKKyAgICAgIHsiaWsiLF9JRF9VOCxTSU5HVUxBUiwwLDAsMCwKKyAgICAgICAgICgoY2hhciAqKSYobnZEZWZhdWx0cy50YWJsZXMuZndDb25maWcuY29uZmlnSXRlbTEpIC0KKyAgICAgICAgICAoY2hhciAqKSZudkRlZmF1bHRzLnRhYmxlcy5md0NvbmZpZyksImNvbmZpZ0l0ZW0xIn0sCisgICAgICB7ImlsIixfSURfVTgsU0lOR1VMQVIsMCwwLDAsKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5md0NvbmZpZy54UEEyRykgLQorICAgICAgICAgIChjaGFyICopJm52RGVmYXVsdHMudGFibGVzLmZ3Q29uZmlnKSwieFBBMkcifSwKKyAgICAgIHsiaW0iLF9JRF9VOCxTSU5HVUxBUiwwLDAsMCwoKGNoYXIgKikmKG52RGVmYXVsdHMudGFibGVzLmZ3Q29uZmlnLnhQQTVHKSAtCisgICAgICAgICAgKGNoYXIgKikmbnZEZWZhdWx0cy50YWJsZXMuZndDb25maWcpLCJ4UEE1RyJ9LAorICAgICAgeyJpbiIsX0lEX1U4LFNJTkdVTEFSLDAsMCwwLAorICAgICAgICAgKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5md0NvbmZpZy5leHRQYUN0cmwwUG9sYXJpdHkpIC0KKyAgICAgICAgICAoY2hhciAqKSZudkRlZmF1bHRzLnRhYmxlcy5md0NvbmZpZyksImV4dFBhQ3RybDBQb2xhcml0eSJ9LAorICAgICAgeyJpbyIsX0lEX1U4LFNJTkdVTEFSLDAsMCwwLAorICAgICAgICAgKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5md0NvbmZpZy5leHRQYUN0cmwxUG9sYXJpdHkpIC0KKyAgICAgICAgICAoY2hhciAqKSZudkRlZmF1bHRzLnRhYmxlcy5md0NvbmZpZyksImV4dFBhQ3RybDFQb2xhcml0eSJ9LAorICAgICAgeyJpcCIsX0lEX1U4LFNJTkdVTEFSLDAsMCwwLCgoY2hhciAqKSYobnZEZWZhdWx0cy50YWJsZXMuZndDb25maWcueExOQTJHKSAtCisgICAgICAgICAgKGNoYXIgKikmbnZEZWZhdWx0cy50YWJsZXMuZndDb25maWcpLCJ4TE5BMkcifSwKKyAgICAgIHsiaXEiLF9JRF9VOCxTSU5HVUxBUiwwLDAsMCwoKGNoYXIgKikmKG52RGVmYXVsdHMudGFibGVzLmZ3Q29uZmlnLnhMTkE1RykgLQorICAgICAgICAgIChjaGFyICopJm52RGVmYXVsdHMudGFibGVzLmZ3Q29uZmlnKSwieExOQTVHIn0sCisgICAgICB7ImlyIixfSURfVTgsU0lOR1VMQVIsMCwwLDAsKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5md0NvbmZpZy54Q291cGxlcjJHKQorICAgICAgICAgIC0gKGNoYXIgKikmbnZEZWZhdWx0cy50YWJsZXMuZndDb25maWcpLCJ4Q291cGxlcjJHIn0sCisgICAgICB7ImlzIixfSURfVTgsU0lOR1VMQVIsMCwwLDAsKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5md0NvbmZpZy54Q291cGxlcjVHKQorICAgICAgICAgIC0gKGNoYXIgKikmbnZEZWZhdWx0cy50YWJsZXMuZndDb25maWcpLCJ4Q291cGxlcjVHIn0sCisgICAgICB7Iml0IixfSURfVTgsU0lOR1VMQVIsMCwwLDAsKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5md0NvbmZpZy54UGRldDJHKSAtCisgICAgICAgICAgKGNoYXIgKikmbnZEZWZhdWx0cy50YWJsZXMuZndDb25maWcpLCJ4UGRldDJHIn0sCisgICAgICB7Iml1IixfSURfVTgsU0lOR1VMQVIsMCwwLDAsKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5md0NvbmZpZy54UGRldDVHKSAtCisgICAgICAgICAgKGNoYXIgKikmbnZEZWZhdWx0cy50YWJsZXMuZndDb25maWcpLCJ4UGRldDVHIn0sCisgICAgICB7Iml2IixfSURfVTgsU0lOR1VMQVIsMCwwLDAsCisgICAgICAgICAoKGNoYXIgKikmKG52RGVmYXVsdHMudGFibGVzLmZ3Q29uZmlnLmVuYWJsZURQRDJHKSAtCisgICAgICAgICAgKGNoYXIgKikmbnZEZWZhdWx0cy50YWJsZXMuZndDb25maWcpLCJlbmFibGVEUEQyRyJ9LAorICAgICAgeyJpdyIsX0lEX1U4LFNJTkdVTEFSLDAsMCwwLAorICAgICAgICAgKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5md0NvbmZpZy5lbmFibGVEUEQ1RykgLQorICAgICAgICAgIChjaGFyICopJm52RGVmYXVsdHMudGFibGVzLmZ3Q29uZmlnKSwiZW5hYmxlRFBENUcifSwKKyAgICAgIHsiaXgiLF9JRF9VOCxTSU5HVUxBUiwwLDAsMCwKKyAgICAgICAgICgoY2hhciAqKSYobnZEZWZhdWx0cy50YWJsZXMuZndDb25maWcucGRhZGNTZWxlY3QyRykgLQorICAgICAgICAgIChjaGFyICopJm52RGVmYXVsdHMudGFibGVzLmZ3Q29uZmlnKSwicGRhZGNTZWxlY3QyRyJ9LAorICAgICAgeyJpeSIsX0lEX1U4LFNJTkdVTEFSLDAsMCwwLAorICAgICAgICAgKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5md0NvbmZpZy5wZGFkY1NlbGVjdDVHTG93KSAtCisgICAgICAgICAgKGNoYXIgKikmbnZEZWZhdWx0cy50YWJsZXMuZndDb25maWcpLCJwZGFkY1NlbGVjdDVHTG93In0sCisgICAgICB7Iml6IixfSURfVTgsU0lOR1VMQVIsMCwwLDAsCisgICAgICAgICAoKGNoYXIgKikmKG52RGVmYXVsdHMudGFibGVzLmZ3Q29uZmlnLnBkYWRjU2VsZWN0NUdNaWQpIC0KKyAgICAgICAgICAoY2hhciAqKSZudkRlZmF1bHRzLnRhYmxlcy5md0NvbmZpZyksInBkYWRjU2VsZWN0NUdNaWQifSwKKyAgICAgIHsiaTAiLF9JRF9VOCxTSU5HVUxBUiwwLDAsMCwKKyAgICAgICAgICgoY2hhciAqKSYobnZEZWZhdWx0cy50YWJsZXMuZndDb25maWcucGRhZGNTZWxlY3Q1R0hpZ2gpIC0KKyAgICAgICAgICAoY2hhciAqKSZudkRlZmF1bHRzLnRhYmxlcy5md0NvbmZpZyksInBkYWRjU2VsZWN0NUdIaWdoIn0sCisgICAgICB7ImkxIixfSURfVTMyLFNJTkdVTEFSLDAsMCwwLAorICAgICAgICAgKChjaGFyICopJihudkRlZmF1bHRzLnRh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hciAqKSYobnZEZWZhdWx0cy50YWJsZXMucGx1dENoYXJhY3Rlcml6ZWRbMF0pIC0KKyAgICAgICAgICAoY2hhciAqKSZudkRlZmF1bHRzLnRhYmxlcy5wbHV0Q2hhcmFjdGVyaXplZFswXSksInRUcGNQb3dlclRhYmxlIn0sCisgICAgICB7e251bH0sIDAsIDAsIDAsIDAsIDAsIDAse251bH19LAorICAgfSwgLy8gVEFCTEVfdFRwY1Bvd2VyVGFibGUKKworICAgeyAvLyBUQUJMRV90UmF0ZUdyb3VwUHdyCisgICAgICB7ImtiIixfSURfVTMyLChBUlJBWV8xKSwoKEZJRUxEX1NJWkVfVFlQRV9CSVQoRklFTERfU0laRV9JRFhfRU5VTSkpfAorICAgICAgICAgKEZJRUxEX1NJWkVfVkFMVUVfQklUUyhJTkRFWF9FTlVNX05VTV9IQUxfUEhZX1JBVEVTKSkpLDAsMCwKKyAgICAgICAgICgoY2hhciAqKSYobnZEZWZhdWx0cy50YWJsZXMucHdyT3B0aW11bVswXSkgLQorICAgICAgICAgIChjaGFyICopJm52RGVmYXVsdHMudGFibGVzLnB3ck9wdGltdW1bMF0pLCJ0UmF0ZUdyb3VwUHdyIn0sCisgICAgICB7e251bH0sIDAsIDAsIDAsIDAsIDAsIDAse251bH19LAorICAgfSwgLy8gVEFCTEVfdFJhdGVHcm91cFB3cgorCisgICB7IC8vIFRBQkxFX3RSYXRlR3JvdXBQd3JWUgorICAgICAgeyJrZCIsX0lEX1UzMiwoX0FERF9TSVpFMShOVU1fUkZfVlJfUkFURSl8QVJSQVlfMSksCisgICAgICAgICAoKEZJRUxEX1NJWkVfVFlQRV9CSVQoRklFTERfU0laRV9JRFhfSU5UKSl8CisgICAgICAgICAoRklFTERfU0laRV9WQUxVRV9CSVRTKE5VTV9SRl9WUl9SQVRFKSkpLDAsMCwKKyAgICAgICAgICgoY2hhciAqKSYobnZEZWZhdWx0cy50YWJsZXMucHdyT3B0aW11bV92aXJ0dWFsUmF0ZVswXSkgLQorICAgICAgICAgIChjaGFyICopJm52RGVmYXVsdHMudGFibGVzLnB3ck9wdGltdW1fdmlydHVhbFJhdGVbMF0pLCJ0UmF0ZUdyb3VwUHdyVlIifSwKKworICAgICAge3tudWx9LCAwLCAwLCAwLCAwLCAwLCAwLHtudWx9fSwKKyAgIH0sIC8vIFRBQkxFX3RSYXRlR3JvdXBQd3JWUgorCisgICB7IC8vIFRBQkxFX3NSZWd1bGF0b3J5RG9tYWlucworICAgICAgeyJkeCIsX1RBQkxFX0lEWChUQUJMRV9zUmVndWxhdG9yeUNoYW5uZWwpLChBUlJBWV8xKSwKKyAgICAgICAgICgoRklFTERfU0laRV9UWVBFX0JJVChGSUVMRF9TSVpFX0lEWF9FTlVNKSl8CisgICAgICAgICAoRklFTERfU0laRV9WQUxVRV9CSVRTKElOREVYX0VOVU1fTlVNX1JGX0NIQU5ORUxTKSkpLDAsMCwKKyAgICAgICAgICgoY2hhciAqKSYobnZEZWZhdWx0cy50YWJsZXMucmVnRG9tYWluc1swXS5jaGFubmVsc1swXSkgLQorICAgICAgICAgIChjaGFyICopJm52RGVmYXVsdHMudGFibGVzLnJlZ0RvbWFpbnNbMF0pLCJjaGFubmVscyJ9LAorICAgICAgeyJkeSIsX0lEX1UzMiwoQVJSQVlfMSksKChGSUVMRF9TSVpFX1RZUEVfQklUKEZJRUxEX1NJWkVfSURYX0VOVU0pKXwKKyAgICAgICAgIChGSUVMRF9TSVpFX1ZBTFVFX0JJVFMoSU5ERVhfRU5VTV9OVU1fUkZfU1VCQkFORFMpKSksMCwwLAorICAgICAgICAgKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5yZWdEb21haW5zWzBdLmFudGVubmFHYWluWzBdKSAtCisgICAgICAgICAgKGNoYXIgKikmbnZEZWZhdWx0cy50YWJsZXMucmVnRG9tYWluc1swXSksImFudGVubmFHYWluIn0sCisgICAgICB7ImR6IixfSURfVTMyLChBUlJBWV8xKSwoKEZJRUxEX1NJWkVfVFlQRV9CSVQoRklFTERf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TEVfSURYKFRBQkxFX3NEZWZhdWx0Q291bnRyeSksU0lOR1VMQVIsMCwwLDAsCisgICAgICAgICAoKGNoYXIgKikmKG52RGVmYXVsdHMudGFibGVzLmRlZmF1bHRDb3VudHJ5VGFibGUpIC0KKyAgICAgICAgICAoY2hhciAqKSZudkRlZmF1bHRzLnRhYmxlcyksImRlZmF1bHRDb3VudHJ5VGFibGUifSwKKyAgICAgIHsianAiLF9UQUJMRV9JRFgoVEFCTEVfdFRwY1Bvd2VyVGFibGUpLChBUlJBWV8xKSwKKyAgICAgICAgICgoRklFTERfU0laRV9UWVBFX0JJVChGSUVMRF9TSVpFX0lEWF9FTlVNKSl8CisgICAgICAgICAoRklFTERfU0laRV9WQUxVRV9CSVRTKElOREVYX0VOVU1fTlVNX1JGX0NIQU5ORUxTKSkpLDAsMCwKKyAgICAgICAgICgoY2hhciAqKSYobnZEZWZhdWx0cy50YWJsZXMucGx1dENoYXJhY3Rlcml6ZWRbMF0pIC0KKyAgICAgICAgICAoY2hhciAqKSZudkRlZmF1bHRzLnRhYmxlcyksInBsdXRDaGFyYWN0ZXJpemVkIn0sCisgICAgICB7ImpxIixfSURfUzE2LChBUlJBWV8xKSwoKEZJRUxEX1NJWkVfVFlQRV9CSVQoRklFTERfU0laRV9JRFhfRU5VTSkpfAorICAgICAgICAgKEZJRUxEX1NJWkVfVkFMVUVfQklUUyhJTkRFWF9FTlVNX05VTV9SRl9DSEFOTkVMUykpKSwwLDAsCisgICAgICAgICAoKGNoYXIgKikmKG52RGVmYXVsdHMudGFibGVzLnBsdXRQZGFkY09mZnNldFswXSkgLQorICAgICAgICAgIChjaGFyICopJm52RGVmYXVsdHMudGFibGVzKSwicGx1dFBkYWRjT2Zmc2V0In0sCisgICAgICB7ImpyIixfVEFCTEVfSURYKFRBQkxFX3RSYXRlR3JvdXBQd3JWUiksKEFSUkFZXzEpLAorICAgICAgICAgKChGSUVMRF9TSVpFX1RZUEVfQklUKEZJRUxEX1NJWkVfSURYX0VOVU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YsKEFSUkFZXzEpLCgoRklFTERfU0laRV9UWVBFX0JJVChGSUVMRF9TSVpFX0lEWF9FTlVNKSl8CisgICAgICAgICAoRklFTERfU0laRV9WQUxVRV9CSVRTKElOREVYX0VOVU1fTlVNX1JGX0NIQU5ORUxTKSkpLDAsMCwKKyAgICAgICAgICgoY2hhciAqKSYobnZEZWZhdWx0cy50YWJsZXMuYW50ZW5uYVBhdGhMb3NzWzBdKSAtCisgICAgICAgICAgKGNoYXIgKikmbnZEZWZhdWx0cy50YWJsZXMpLCJhbnRlbm5hUGF0aExvc3MifSwKKyAgICAgIHsianciLF9JRF9TMTYsKEFSUkFZXzIpLCgoRklFTERfU0laRV9UWVBFX0JJVChGSUVMRF9TSVpFX0lEWF9FTlVNKSl8CisgICAgICAgICAoRklFTERfU0laRV9WQUxVRV9CSVRTKElOREVYX0VOVU1fTlVNXzgwMl8xMV9NT0RFUykpKSwKKyAgICAgICAgICgoRklFTERfU0laRV9UWVBFX0JJVChGSUVMRF9TSVpFX0lEWF9FTlVNKSl8CisgICAgICAgICAoRklFTERfU0laRV9WQUxVRV9CSVRTKElOREVYX0VOVU1fTlVNX1JGX0NIQU5ORUxTKSkpLDAsCisgICAgICAgICAoKGNoYXIgKikmKG52RGVmYXVsdHMudGFibGVzLnBrdFR5cGVQd3JMaW1pdHNbMF1bMF0pIC0KKyAgICAgICAgICAoY2hhciAqKSZudkRlZmF1bHRzLnRhYmxlcyksInBrdFR5cGVQd3JMaW1pdHMifSwKKyAgICAgIHsiangiLF9UQUJMRV9JRFgoVEFCTEVfc09mZG1DbWRQd3JPZmZzZXQpLFNJTkdVTEFSLDAsMCwwLAorICAgICAgICAgKChjaGFyICopJihudkRlZmF1bHRzLnRhYmxlcy5vZmRtQ21kUHdyT2Zmc2V0KSAtIChjaGFyICopJm52RGVmYXVsdHMudGFibGVzKSwKKyAgICAgICAgICJvZmRtQ21kUHdyT2Zmc2V0In0sCisgICAgICB7Imp5IixfVEFCTEVfSURYKFRBQkxFX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kQmxvY2tzOworICAgIHRBTklfVTMyICByZWN2QmxvY2tzOworICAgIHRBTklfVTMyICByZXBsYXlzOworICAgIHRBTklfVTggICBtaWNFcnJvckNudDsKKyAgICB0QU5JX1UzMiAgcHJvdEV4Y2xDbnQ7CisgICAgdEFOSV9VMTYgIGZvcm1hdEVyckNudDsKKyAgICB0QU5JX1UxNiAgdW5EZWNyeXB0YWJsZUNudDsKKyAgICB0QU5JX1UzMiAgZGVjcnlwdEVyckNudDsKKyAgICB0QU5JX1UzMiAgZGVjcnlwdE9rQ250OworCit9IHREcHVTdGF0c1BhcmFtcywgKiB0cERwdVN0YXRzUGFyYW1zOworCisKKy8qCisgKiBHZXQgdGhlIERQVSBzaWduYXR1cmUgYmFzZWQgb24gYSBnaXZlbiBzdGFJZAorICovCit0eXBlZGVmIHN0cnVjdAoreworICAgIHRBTklfVTE2ICAgICAgICBzdGFJZHg7CisgICAgLyoKKyAgICAgKiBGb2xsb3dpbmcgcGFyYW1ldGVyIGlzIGZvciByZXR1cm5pbmcgc3RhdHVzCisgICAgICogdmlhIHJlc3BvbnNlIG1lc3NhZ2UuIEhBTCBkb2VzIG5vdCByZWFkIHRoZW0uCisgICAgICovCisgICAgLy8gVGhlIHJldHVybiBzdGF0dXMgb2YgU0lSX0hBTF9TRVRfQlNTS0VZX1JFUSBpcyByZXBvcnRlZCBoZXJlCisgICAgZUhhbFN0YXR1cyBzdGF0dXM7CisgICAgdEFOSV9VOCAgICBkcHVEZXNjSW5keDsKKyAgICB0QU5JX1U4ICAgIGRwdVNpZ25hdHVyZTsKK30gdEdldERwdVBhcmFtcywgKnRwR2V0RHB1UGFyYW1zOworCisKKworLy9IQUwgTVNHOiBTSVJfSEFMX1VQREFURV9CRUFDT05fSU5ECit0eXBlZGVmIHN0cnVjdAoreworCisgICAgdEFOSV9VOCAgYnNzSWR4OworCisgICAgLy9zaG9ydFByZWFtYmxlIG1vZGUuIEhBTCBzaG91bGQgdXBkYXRlIGFsbCB0aGUgU1RBIH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WZpbmUgSEFMX05VTV9HUFNUQSAgICAgICAgICAgICAgIDQKKyNkZWZpbmUgSEFMX05VTV9WU1RBICAgICAgICAgICAgICAgIChIQUxfTlVNX1NUQSAtIEhBTF9OVU1fSFdfU1RBKQorCisjZGVmaW5lIFFXTEFORldfTUFYX05VTV9WU1RBICAgICAgICBIQUxfTlVNX1ZTVEEKKyNkZWZpbmUgUVdMQU5GV19WU1RBX0lOVkFMSURfSURYICAgIChIQUxfTlVNX1NUQSArIDEpCisjZGVmaW5lIFFXTEFOX1ZTVEFfTUlOX0lEWCAgICAgICAgICBIQUxfTlVNX0hXX1NUQQorI2RlZmluZSBRV0xBTkZXX05VTV9HUFNUQSAgICAgICAgICAgSEFMX05VTV9HUFNUQQorCisKKyNkZWZpbmUgSVNfVlNUQV9WQUxJRF9JRFgoX194KSBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICgoX194KSAhPSBRV0xBTkZXX1ZTVEFfSU5WQUxJRF9JRFgpCisKKyNkZWZpbmUgSVNfVlNUQV9JRFgoX194KSBcCisgICAgICAgICAgICAgICAgICAgKCgoX194KSA+PSBRV0xBTl9WU1RBX01JTl9JRFgpICYmICgoX194KSA8IEhBTF9OVU1fU1RBKSkKKworICAgICAgICAgICAgICAgICAKKy8vIGlzIHRoZSBTVEEgYSBHZW5lcmFsIFB1cnBvc2UgU1RBPworI2RlZmluZSBJU19HUFNUQV9JRFgoX194KSBcCisgICAgKCgoX194KSA+PSAoSEFMX05VTV9IV19TVEEtSEFMX05VTV9HUFNUQSkpICYmIFwKKyAgICAgKChfX3gpIDwgSEFMX05VTV9IV19TVEEpKQorCisvLyBpcyB0aGUgU1RBIGEgSFcgU1RBIChleGNsdWRpbmcgR1AgU1RBcykKKyNkZWZpbmUgSVNfSFdTVEFfSURYKF9feCkgXAorICAgICgoX194KSA8IChIQUxfTlVNX0hXX1NUQS1IQUxfTlVNX0dQU1RBKSkKKworI2Vsc2UKKy8qSW4gcHJpbWEgMTIgSFcgc3RhdGlv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U5ESUFOIEVORAorCisgICAgLyogMHgwYyAqLworICAgIC8vIEVORElBTiBCRUdJTgorICAgIHRBTklfVTMyIG1wZHVIZWFkZXJMZW5ndGggOiA4OyAgICAgICAgICAgLyogTVBEVSBoZWFkZXIgbGVuZ3RoICovCisgICAgdEFOSV9VMzIgbXBkdUhlYWRlck9mZnNldCA6IDg7ICAgICAgICAgICAvKiBNUERVIGhlYWRlciBzdGFydCBvZmZzZXQgKi8KKyAgICB0QU5JX1UzMiBtcGR1RGF0YU9mZnNldCA6IDk7ICAgICAgICAgICAgIC8qIE1QRFUgZGF0YSBzdGFydCBvZmZzZXQgKi8KKyAgICB0QU5JX1UzMiBwZHVDb3VudCA6IDc7ICAgICAgICAgICAgICAgICAgIC8qIFBEVSBjb3VudCAqLworICAgIC8vIEVORElBTiBFTkQKKworICAgIC8qIDB4MTAgKi8KKyAgICAvLyBFTkRJQU4gQkVHSU4KKyAgICB0QU5JX1UzMiBtcGR1TGVuZ3RoIDogMTY7ICAgICAgICAgICAgICAgIC8qIE1QRFUgbGVuZ3RoICovCisgICAgdEFOSV9VMzIgcmVzZXJ2ZWQzOjQ7ICAgICAgICAgICAgLyogRFBVIGNvbXByZXNzaW9uIGZlZWRiYWNrICovCisgICAgdEFOSV9VMzIgdGlkIDogNDsgICAgICAgICAgICAgICAgICAgICAgICAvKiBUcmFmZmljIGlkZW50aWZpZXIsIHRpZCAqLworICAgIHRBTklfVTMyIHJhdGVJbmRleCA6IDg7CisgICAgLy8gRU5ESUFOIEVORAorCisgICAgLyogMHgxNCAqLworICAgIC8vIEVORElBTiBCRUdJTgorICAgIHRBTklfVTMyIGRwdURlc2NJZHggOiA4OworICAgIHRBTklfVTMyIGFkZHIxSW5kZXggOiA4OyAgLy9BMSBpbmRleCBhZnRlciBSeFAgYmluYXJ5IHNlYXJjaAorICAgIHRBTklfVTMyIGFkZHIySW5kZXggOiA4OyAgLy9BMiBpbmRleCBhZnRlciBSeFAgYmluYXJ5IHNlYXJjaAorICAg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F9SQVRFXzNfTUFTSyAgICAgICAgICAgICAgMHg0MDAwIC8vIGJpdCAxNCBmb3IgQkQgUkFURSAxCisjZGVmaW5lIEhBTF9VU0VfRldfSU5fVFhfUEFUSCAgICAgICAgICAgICAgIDB4MjAwIC8vYml0IDkgdG8gc2VuZCB2aWEgV1E1CisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgRlVOQ1RJT04gICAgV0xBTkhBTF9GaWxsVHhCZAorCisgIERFU0NSSVBUSU9OIAorICAgIENhbGxlZCBieSBQRSB0byByZWdpc3RlciBhcyBhIGNsaWVudCBmb3IgbWFuYWdlbWVudCBmcmFtZXMgZGVsaXZlcnkuIAorCisgIERFUEVOREVOQ0lFUyAKKyAgICBUTCBtdXN0IGJlIGluaXRpYWxpemVkIGJlZm9yZSB0aGlzIEFQSSBjYW4gYmUgY2FsbGVkLiAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgIElOCisgICAgcEFkYXB0ZXI6ICAgICAgIHBvaW50ZXIgdG8gdGhlIGdsb2JhbCBhZGFwdGVyIGNvbnRleHQ7YSBoYW5kbGUgdG8gVEwncyAKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbCBibG9jayBjYW4gYmUgZXh0cmFjdGVkIGZyb20gaXRzIGNvbnRleHQgCisgICAgdm9zRnJtQnVmOiAgICAgcG9pbnRlciB0byBhIHZPU1MgYnVmZmVyIGNvbnRhaW5pbmcgdGhlIG1hbmFnZW1lbnQgIAorICAgICAgICAgICAgICAgICAgICBmcmFtZSB0byBiZSB0cmFuc21pdHRlZAorICAgIHVzRnJtTGVuOiAgICAgICB0aGUgbGVuZ3RoIG9mIHRoZSBmcmFtZSB0byBiZSB0cmFuc21pdHRlZDsgaW5mb3JtYXRpb24gCisgICAgICAgICAgICAgICAgICAgIGlzIGFscmVhZHkgaW5jbHVkZWQgaW4gdGhlIHZPU1MgYnVmZmVy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fSAorI2RlZmluZSBXTEFOX1FDVF9XREFfSAorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICBXIEwgQSBOICAgREVWSUNFIEFEQVBUQVRJT04gICBMIEEgWSBFIFIKKyAgICAgICAgICAgICAgICAgICAgICAgRSBYIFQgRSBSIE4gQSBMICBBIFAgSQorCisKK0RFU0NSSVBUSU9OCisgIFRoaXMgZmlsZSBjb250YWlucyB0aGUgZXh0ZXJuYWwgQVBJIGV4cG9zZWQgYnkgdGhlIHdsYW4gYWRhcHRhdGlvbiBsYXllciBmb3IgUHJpbWEKKyAgYW5kIFZvbGFucy4KKworICBGb3IgVm9sYW5zIHRoaXMgbGF5ZXIgaXMgYWN0dWFsbHkgYSB0aGluIGxheWVyIHRoYXQgbWFwcyBhbGwgV0RBIG1lc3NhZ2VzIGFuZAorICBmdW5jdGlvbnMgdG8gZXF1aXZhbGVudCBIQUwgbWVzc2FnZXMgYW5kIGZ1bmN0aW9ucy4gVGhlIHJlYXNvbiB0aGlzIGxheWVyIHdhcyBpbnRyb2R1Y2VkCisgIHdhcyB0byBrZWVwIHRoZSBVTUFDIGlkZW50aWNhbCBhY3Jvc3MgUHJpbWEgYW5kIFZvbGFucy4gVGhpcyBsYXllciBwcm92aWRlcyB0aGUgZ2x1ZQorICBiZXR3ZWVuIFNNRSwgUEUgLCBUTCBhbmQgSEFMLgorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgIEVESVQgSElTVE9SWSBGT1IgRklMRQorCisKKyAgVGhpcyBzZWN0aW9uIGNvbnRhaW5zIGNvbW1lbnRzIGRlc2NyaWJpbmcgY2hhbmdlcyBtYWRlIHRvIHRoZSBtb2R1bGUuCisgIE5vdGljZSB0aGF0IGNoYW5nZXMgYXJlIGxpc3RlZCBpbiByZXZlcnNlIGNocm9ub2xvZ2ljYWwgb3JkZXIuCisKKworICAkSGVhZGVyOiQgJERhdGVUaW1lOiAkICRBdXRob3I6ICQKKworCit3aGVuICAgICAgICB3aG8gICAgICAgICAgd2hhdCwgd2hlcmUsIHdoeQorLS0tLS0tLS0gICAgLS0tICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorMTAvMDUvMjAxMSAgaGFwYXJuYSAgICAgQWRkaW5nIHN1cHBvcnQgZm9yIEtlZXAgQWxpdmUgRmVhdHVyZQorMDEvMjcvMjAxMSAgcm5haXIgICAgICAgQWRkaW5nIFdEQSBzdXBwb3J0IGZvciBWb2xhbnMuCisxMi8wOC8yMDEwICBzZW9reW91biAgICBNb3ZlIGRvd24gSEFMIGludGVyZmFjZXMgZnJvbSBUTCB0byBXREEKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciBVTUFDIGNvbnZlcmdlbmNlIGJ0d2VlbiBWb2xhbnMvTGlicmEgYW5kIFByaW1hCiswOC8yNS8yMDEwICBhZHdpdmVkaSAgICBXREEgQ29udGV4dCBhbmQgZXhwb3NlZCBBUEkncworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCisKKyNpbmNsdWRlICJhbmlHbG9iYWwuaCIKKworCisjICBpbmNsdWRlICJ3bGFuX3FjdF93ZGlfZHMuaCIKKworCisvKiBBZGQgSW5jbHVkZSAqLworCit0eXBlZGVmIGVudW0KK3sKKyAgIFdEQV9JTklUX1NUQVRFLAorICAgV0RBX1NUQVJUX1NUQVRFLAorICAgV0RBX1JFQURZX1NUQVRFLAorICAgV0RBX1BSRV9B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ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICBfdXNQa3RMZW4gPSB3cGFsUGFja2V0R2V0RnJhZ0NvdW50KCh3cHRfcGFja2V0Kilfdm9zQnVmZikgKyAxLypCRCovO1wKKyAgICBfdVJlc0xlbiAgPSBfdXNQa3RMZW47ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICBfdVRvdGFsUGt0TGVuID0gX3VzUGt0TGVuOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgd2hpbGUgKCAwICkKKyNlbHNlIC8qIFdJTkRPV1NfRFQgKi8KKyNkZWZpbmUgV0RBX1RMSV9QUk9DRVNTX0ZSQU1FX0xFTiggX3Zvc0J1ZmYsIF91c1BrdExlbiwgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3VSZXNMZW4sIF91VG90YWxQa3RMZW4pIFwKKyAgZG8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICBfdXNQa3RMZW4gPSAyOyAgLyogTmVlZCAxIGRlc2NyaXB0b3IgcGVyIGEgcGFja2V0ICsgcGFja2V0Ki8gICAgIFwKKyAgICBfdVJlc0xlbiAgPSAyOyAgLyogQXNzdW1lIHRoYXQgd2Ugc3BlbmRzIHR3byBEWEUgZGVzY3JpcHRvciAqLyAgIFwKKyAgICBfdVRvdGFsUGt0TGVuID0gX3VzUGt0TGVuOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgfSAgICAgICAgICAgICAgIC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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgRnVuY3Rpb25zCisgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworCisvKiBGb3IgZGF0YSBjbGllbnQgKi8KK3R5cGVkZWYgVk9TX1NUQVRVUyAoKldEQV9EU19UeENvbXBsZXRlQ2FsbGJhY2spICggdl9QVk9JRF90IHBDb250ZXh0LCB2b3NfcGt0X3QgKnBGcmFtZURhdGFCdWZmLCBWT1NfU1RBVFVTIHR4U3RhdHVzICk7Cit0eXBlZGVmIFZPU19TVEFUVVMgKCpXREFfRFNfUnhQYWNrZXRDYWxsYmFjaykgICAoIHZfUFZPSURfdCBwQ29udGV4dCwgdm9zX3BrdF90ICpwRnJhbWVEYXRhQnVmZiApOwordHlwZWRlZiB2X1UzMl90ICAgKCpXREFfRFNfVHhQYWNrZXRDYWxsYmFjaykgICAoIHZfUFZPSURfdCBwQ29udGV4dCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvc19wa3RfdCAqKnBwRnJhbWVEYXRhQnVmZiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfVTMyX3QgdVNpemUsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgdUZsb3dNYXNrLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdl9CT09MX3QgKnBiVXJnZW50ICk7Cit0eXBlZGVmIFZPU19TVEFUVVMgKCpXREFfRFNfUmVzb3VyY2VDQikgICAgICAoIHZfUFZPSURfdCBwQ29udGV4dCwgdl9VMzJfdCB1Q291bnQgKTsKKworCisvKiBGb3IgbWFuYWdlbWVudCBjbGllbnQgK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GVyOworICAgd3B0X3VpbnQ4ICAgICAgICAgICAgd2RpQWRkU3RhU2VsZlN0YUZhaWxDb3VudGVyOworICAgd3B0X3VpbnQ4ICAgICAgICAgICAgdWNTVEFTZWxmSWR4OyAvKiByZWNlaXZlZCBTZWxmU3RhSWR4Ki8KKyAgIHdwdF91aW50OCAgICAgICAgICAgIHdkYUFkZFNlbGZTdGFGYWlsUmVhc29uOworfSB0V0RBX0FkZFNlbGZTdGFEZWJ1Z1BhcmFtczsKKworI2RlZmluZSBCTVBTX0lNUFNfRkFJTFVSRV9SRVBPUlRfVEhSRVNIT0xEICAgIDEwCisKK3R5cGVkZWYgc3RydWN0Cit7CisgICB2X1BWT0lEX3QgICAgICAgICAgICBwVm9zQ29udGV4dDsgICAgICAgICAgICAgLyogZ2xvYmFsIFZPU1MgY29udGV4dCovCisgICB2X1BWT0lEX3QgICAgICAgICAgICBwV2RpQ29udGV4dDsgICAgICAgICAgICAgLyogV0RJIGNvbnRleHQgKi8KKyAgIFdEQV9zdGF0ZSAgICAgICAgICAgIHdkYVN0YXRlIDsgICAgICAgICAgICAgICAvKiBXREEgc3RhdGUgdHJhY2tpbmcgKi8gCisgICB2X1BWT0lEX3QgICAgICAgICAgICB3ZGFXZGlDZmdBcGlNc2dQYXJhbSA7ICAgLyogV0RJIEFQSSBwYXJhbXRlciB0cmFja2luZyAqLworICAgdm9zX2V2ZW50X3QgICAgICAgICAgd2RhV2RpRXZlbnQ7ICAgICAgICAgICAgIC8qIFdESSBBUEkgc3luYyBldmVudCAqLworCisgICAvKiBFdmVudCB0byB3YWl0IGZvciB0eCBjb21wbGV0aW9uICovCisgICB2b3NfZXZlbnRfdCAgICAgICAgICB0eEZyYW1lRXZlbnQ7CisKKyAgIC8qIGNhbGwgYmFjayBmdW5jdGlvbiBmb3IgdHggY29tcGxldGUqLworICAgcFdEQVR4UnhDb21wRnVuYyAgICAgcFR4Q2JGdW5jOworICAgLyogY2FsbCBiYWNrIGZ1bmN0aW9uIGZvciB0eCBwYWNrZXQgYWNrICovCisgICBwV0RBQWNrRm5UeENvbXAgICAgICBwQWNrVHhDYkZ1bmM7ICAgCisgICB0QU5JX1UzMiAgICAgICAgICAgICBmcmFtZVRyYW5zUmVxdWlyZWQ7CisgICB0U2lyTWFjQWRkciAgICAgICAgICBtYWNCU1NJRDsgICAgICAgICAgICAgLypCU1NJRCBvZiB0aGUgbmV0d29yayAqLworICAgdFNpck1hY0FkZHIgICAgICAgICAgbWFjU1RBU2VsZjsgICAgIC8qU2VsZiBTVEEgTUFDKi8KKworICAgLyogVFggY2hhbm5lbCBtYXNrIGZvciBmbG93IGNvbnRyb2wgKi8KKyAgIHZfVThfdCAgICAgICAgICAgICAgIHVUeEZsb3dNYXNrOworICAgLyogVEwncyBUWCByZXNvdXJjZSBjYWxsYmFjayAgICAgICAgKi8KKyAgIFdEQV9EU19SZXNvdXJjZUNCICAgIHBmblR4UmVzb3VyY2VDQjsKKyAgIC8qIFRMJ3MgVFggY29tcGxldGUgY2FsbGJhY2sgICAgICovCisgICBXREFfRFNfVHhDb21wbGV0ZUNhbGxiYWNrIHBmblR4Q29tcGxldGVDYWxsYmFjazsgCisgICAKKyAgIHRXZGFTdGFJbmZvICAgICAgICAgIHdkYVN0YUluZm9bV0RBX01BWF9TVEFdOworCisgICB0QU5JX1U4ICAgICAgICAgICAgICB3ZGFNYXhTdGE7CisgICB0V2RhVGltZXJzICAgICAgICAgICB3ZGFUaW1lcnM7CisKKyAgIC8qIFNUQSwgQVAsIElCU1MsIE1VTFRJLUJTUyBldGMuKi8KKyAgIHRCc3NTeXN0ZW1Sb2xlICAgICAgIHdkYUdsb2JhbFN5c3RlbVJvbGU7IAorCisgICAvKiBkcml2ZXIgbW9kZSwgUFJPRFVDVElPTiBvciBGVE0gKi8KKyAgIHREcml2ZXJUeXBlICAgICAgICAgIGRyaXZlck1vZGU7CisKKyAgIC8qIEZUTSBDb21tYW5kIFJlcXVlc3QgdHJhY2tpbmcgKi8KKyAgIHZfUFZPSURfdCAgICAgICAgICAgIHdkYUZUTUNtZFJlcTsKKworICAgLyogRXZlbnQgdG8gd2FpdCBmb3Igc3VzcGVuZCBkYXRhIHR4Ki8KKyAgIHZvc19ldmVudF90ICAgICAgICAgIHN1c3BlbmREYXRhVHhFdmVudDsKKyAgIC8qIFN0YXR1cyBmcm0gVEwgYWZ0ZXIgc3VzcGVuZC9yZXN1bWUgVHggKi8KKyAgIHRBTklfVTggICAgdHhTdGF0dXM7CisgICAvKiBGbGFnIHNldCB0byB0cnVlIHdoZW4gVEwgc3VzcGVuZCB0aW1lc291dC4qLworICAgdEFOSV9VOCAgICB0eFN1c3BlbmRUaW1lZE91dDsgICAKKworICAgdm9zX2V2ZW50X3QgICAgICAgICAgd2FpdE9uV2RpSW5kaWNhdGlvbkNhbGxCYWNrOworCisgICAvKiB2ZXJzaW9uIGluZm9ybWF0aW9uICovCisgICB0U2lyVmVyc2lvblR5cGUgICAgICB3Y25zc1dsYW5Db21waWxlZFZlcnNpb247CisgICB0U2lyVmVyc2lvblR5cGUgICAgICB3Y25zc1dsYW5SZXBvcnRlZFZlcnNpb247CisgICB0U2lyVmVyc2lvblN0cmluZyAgICB3Y25zc1NvZnR3YXJlVmVyc2lvblN0cmluZzsKKyAgIHRTaXJWZXJzaW9uU3RyaW5nICAgIHdjbnNzSGFyZHdhcmVWZXJzaW9uU3RyaW5nOworCisgICAKKyAgIHRTaXJMaW5rU3RhdGUgICAgICAgIGxpbmtTdGF0ZTsKKyAgIC8qIHNldCwgd2hlbiBCVCBBTVAgc2Vzc2lvbiBpcyBnb2luZyBvbiAqLworICAgdl9CT09MX3QgICAgICAgICAgICAgd2RhQW1wU2Vzc2lvbk9uOworICAgdl9CT09MX3QgICAgICAgICAgICAgbmVlZFNodXRkb3duOworICAgdl9CT09MX3QgICAgICAgICAgICAgd2RpRmFpbGVkOworICAgdl9CT09MX3QgICAgICAgICAgICAgd2RhVGltZXJzQ3JlYXRlZDsKKyAgIHVpbnRwdHJfdCAgICAgICA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gICAgICAgICAgICAgV0RBX0RTX1R4Q29tcGxldGVDYiBXREFfVHhDb21wbGV0ZUNhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0RBX0RTX1J4Q29tcGxldGVDYiBXREFfUnhDb21wbGV0ZUNhbGxiYWNrLCAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXREFfRFNfVHhGbG93Q29udHJvbENiIFdEQV9UeEZsb3dDdHJsQ2FsbGJhY2sgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgOworLyoKKyAqIEZVTkNUSU9OOiBXREFfTWdtdERTVHhQYWNrZXQKKyAqIEZvcndhcmQgVFggbWFuYWdlbWVudCBmcmFtZSB0byBXREkKKyAqLyAKKworVk9TX1NUQVRVUyBXREFfVHhQYWNrZXQodFdEQV9DYkNvbnRleHQgKnBXREEsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqcEZybUJ1ZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTE2IGZybUxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVGcmFtZVR5cGUgZnJtVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVGcmFtZVR4RGlyIHR4RGlyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VOCB0aWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwV0RBVHhSeENvbXBGdW5jIHBDb21wRnVuYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnBEYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFdEQUFja0ZuVHhDb21wIHBBY2tUeENvbXAsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgdHhGbGFnLAorICAgICAgICAgICAgICAgICAgICAgIC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KyMgIGRlZmluZSBXREFfR0VUX1JYX01QRFVIRUFERVIzQShwUnhNZXRhKSBcCisgICAodHBTaXJNYWNEYXRhSGRyM2EpKCAoKFdESV9EU19SeE1ldGFJbmZvVHlwZSAqKShwUnhNZXRhKSktPm1wZHVIZWFkZXJQdHIgKQorCisvKiBXREFfR0VUX1JYX01QRFVfSEVBREVSX0xFTiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworIyAgZGVmaW5lIFdEQV9HRVRfUlhfTVBEVV9IRUFERVJfTEVOKHBSeE1ldGEpICAgXAorICAgICAgICAgICAgICAgICAgICAoICgoV0RJX0RTX1J4TWV0YUluZm9UeXBlICopKHBSeE1ldGEpKS0+bXBkdUhlYWRlckxlbmd0aCApCisKKy8qIFdEQV9HRVRfUlhfTVBEVV9MRU4gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjICBkZWZpbmUgV0RBX0dFVF9SWF9NUERVX0xFTihwUnhNZXRhKSAgXAorICAgICAgICAgICAgICAgKCAoKFdESV9EU19SeE1ldGFJbmZvVHlwZSAqKShwUnhNZXRhKSktPm1wZHVMZW5ndGggKQorCisvKiBXREFfR0VUX1JYX1BBWUxPQURfTEVOICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjICBkZWZpbmUgV0RBX0dFVF9SWF9QQVlMT0FEX0xFTihwUnhNZXRhKSAgIFwKKyAgICAgICAoIFdEQV9HRVRfUlhfTVBEVV9MRU4ocFJ4TWV0YSkgLSBXREFfR0VUX1JYX01QRFVfSEVBREVSX0xFTihwUnhNZXRhKSApCisKKy8qIFdEQV9HRVRfUlhfTUFDX1JBVEVfSURYICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyMgIGRlZmluZSBXREFfR0VUX1JYX01BQ19SQVRFX0lEWChwUnhNZXRhKSAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAoICgoV0RJX0RTX1J4TWV0YUluZm9UeXBlICopKHBSeE1ldGEpKS0+cmF0ZUluZGV4ICkKKworLyogV0RBX0dFVF9SWF9NUERVX0RBVEEgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworIyAgZGVmaW5lIFdEQV9HRVRfUlhfTVBEVV9EQVRBKHBSeE1ldGEpICBcCisgICAgICAgICAgICAgICAgICAgKCAoKFdESV9EU19SeE1ldGFJbmZvVHlwZSAqKShwUnhNZXRhKSktPm1wZHVEYXRhUHRyICkKKworLyogV0RBX0dFVF9SWF9NUERVX0RBVEFfT0ZGU0VUICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLy8gRm9yIEludGVncmF0ZWQgU09DOiBXaGVuIFVNQUMgcmVjZWl2ZSB0aGUgcGFja2V0LiBCRCBpcyBhbHJlYWR5IHN0cmlwcGVkIG9mZi4KKy8vICAgICAgICAgICAgICAgICAgICAgRGF0YSBvZmZzZXQgaXMgdGhlIE1QRFUgaGVhZGVyIGxlbmd0aAorIyAgZGVmaW5lIFdEQV9HRVRfUlhfTVBEVV9EQVRBX09GRlNFVChwUnhNZXRhKSAgV0RBX0dFVF9SWF9NUERVX0hFQURFUl9MRU4ocFJ4TWV0YSkKKworLyogV0RBX0dFVF9SWF9NUERVX0hFQURFUl9PRkZTRVQgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLy8gRm9yIEludGVncmF0ZWQgU09DOiBXZSBVTUFDIHJlY2VpdmUgdGhlIGZyYW1lLCAKKy8vICAgICAgICAgICAgICAgICAgICAgQkQgaXMgZ29uZSBhbmQgTUFDIGhlYWRlciBhdCBvZmZzZXQgMAorIyAgZGVmaW5lIFdEQV9HRVRfUlhfTVBEVV9IRUFERVJfT0ZGU0VUKHBSeE1ldGEpICAgMAorCisvKiBXREFfR0VUX1JYX1VOS05PV05fVUNBU1QgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjICBkZWZpbmUgV0RBX0dFVF9SWF9VTktOT1dOX1VDQVNUKHBSeE1ldGEpICAgXAorICAgICAgICAgICAgICAgICAgICAgKCAoKFdESV9EU19SeE1ldGFJbmZvVHlwZSAqKShwUnhNZXRhKSktPnVua25vd25VY2FzdFBrdCApCisKKy8qIFdEQV9HRVRfUlhfVElEICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyMgIGRlZmluZSBXREFfR0VUX1JYX1RJRChwUnhNZXRhKSAoICgoV0RJX0RTX1J4TWV0YUluZm9UeXBlICopKHBSeE1ldGEpKS0+dGlkICkKKworLyogV0RBX0dFVF9SWF9TVEFJRCAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworIyAgZGVmaW5lIFdEQV9HRVRfUlhfU1RBSUQocFJ4TWV0YSkgKCgoV0RJX0RTX1J4TWV0YUluZm9UeXBlKikocFJ4TWV0YSkpLT5zdGFJZCkKKworLyogV0RBX0dFVF9SWF9BRERSM19JRFggKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworIyAgZGVmaW5lIFdEQV9HRVRfUlhfQUREUjNfSURYKHBSeE1ldGEpICgoKFdESV9EU19SeE1ldGFJbmZvVHlwZSopKHBSeE1ldGEpKS0+YWRkcjNJZHgpCisKKy8qIFdEQV9HRVRfUlhfQ0ggKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyMgIGRlZmluZSBXREFfR0VUX1JYX0NIKHBSeE1ldGEpICgoKFdESV9EU19SeE1ldGFJbmZvVHlwZSopKHBSeE1ldGEpKS0+cnhDaGFubmVsKQorCisvKiBXREFfR0VUX1JYX1JGQkFORCAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjICBkZWZpbmUgV0RBX0dFVF9SWF9SRkJBTkQocFJ4TWV0YSkgKCgoV0RJX0RTX1J4TWV0YUluZm9UeXBlKikocFJ4TWV0YSkpLT5yZkJhbmQpCisKKy8qIFdEQV9HRVRfUlhfRFBVU0lHICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyMgIGRlZmluZSBXREFfR0VUX1JYX0RQVVNJRyhwUnhNZXRhKSAgKCgoV0RJX0RTX1J4TWV0YUluZm9UeXBlKikocFJ4TWV0YSkpLT5kcHVTaWcpCisKKy8qIFdEQV9JU19SWF9CQ0FTVCAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyMgIGRlZmluZSBXREFfSVNfUlhfQkNBU1QocFJ4TWV0YSkgICBcCisgICAgICAoICgxID09ICgoV0RJX0RTX1J4TWV0YUluZm9UeXBlKikocFJ4TWV0YSkpLT5iY2FzdCkgPyBWT1NfVFJVRSA6IFZPU19GQUxTRSApCisgICAgCisvKiBXREFfR0VUX1JYX0ZUX0RPTkUgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjICBkZWZpbmUgV0RBX0dFVF9SWF9GVF9ET05FKHBSeE1ldGEpICgoKFdESV9EU19SeE1ldGFJbmZvVHlwZSopKHBSeE1ldGEpKS0+ZnQpCisKKy8qIFdEQV9HRVRfUlhfRFBVX0ZFRURCQUNLICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworIyAgZGVmaW5lIFdEQV9HRVRfUlhfRFBVX0ZFRURCQUNLKHBSeE1ldGEpIFwKKyAgICAgICAgICAgICAgICAgICAgICAoKChXRElfRFNfUnhNZXRhSW5mb1R5cGUqKShwUnhNZXRhKSktPmRwdUZlZWRiYWNrKQorCisvKiBXREFfR0VUX1JYX0FTRiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjICBkZWZpbmUgV0RBX0dFVF9SWF9BU0YocFJ4TWV0YSkgKCgoV0RJX0RTX1J4TWV0YUluZm9UeXBlKikocFJ4TWV0YSkpLT5hbXNkdV9hc2YpCisKKy8qIFdEQV9HRVRfUlhfQUVGICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyMgIGRlZmluZSBXREFfR0VUX1JYX0FFRihwUnhNZXRhKSAoKChXRElfRFNfUnhNZXRhSW5mb1R5cGUqKShwUnhNZXRhKSktPmFtc2R1X2FlZikKKworLyogV0RBX0dFVF9SWF9FU0YgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworIyAgZGVmaW5lIFdEQV9HRVRfUlhfRVNGKHBSeE1ldGEpICAoKChXRElfRFNfUnhNZXRhSW5mb1R5cGUqKShwUnhNZXRhKSktPmFtc2R1X2VzZikKKworLyogV0RBX0dFVF9SWF9CRUFDT05fU0VOVCAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworIyAgZGVmaW5lIFdEQV9HRVRfUlhfQkVBQ09OX1NFTlQocFJ4TWV0YSkgXAorICAgICAgICAgICAgICAgICAgICAgKCgoV0RJX0RTX1J4TWV0YUluZm9UeXBlKikocFJ4TWV0YSkpLT5ic2YpCisKKy8qIFdEQV9HRVRfUlhfVFNGX0xBVEVSICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworIyAgZGVmaW5lIFdEQV9HRVRfUlhfVFNGX0xBVEVSKHBSeE1ldGEpICgoKFdESV9EU19SeE1ldGFJbmZvVHlwZSopKHBSeE1ldGEpKS0+cnRzZikKKworLyogV0RBX0dFVF9SWF9UWVBFICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworIyAgZGVmaW5lIFdEQV9HRVRfUlhfVFlQRShwUnhNZXRhKSAoKChXRElfRFNfUnhNZXRhSW5mb1R5cGUqKShwUnhNZXRhKSktPnR5cGUpCisKKy8qIFdEQV9HRVRfUlhfU1VCVFlQRSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyMgIGRlZmluZSBXREFfR0VUX1JYX1NVQlRZUEUocFJ4TWV0YSkgKCgoV0RJX0RTX1J4TWV0YUluZm9UeXBlKikocFJ4TWV0YSkpLT5zdWJ0eXBlKQorCisvKiBXREFfR0VUX1JYX1RZUEVfU1VCVFlQRSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworIyAgZGVmaW5lIFdEQV9HRVRfUlhfVFlQRV9TVUJUWVBFKHBSeE1ldGEpICBcCisgICAgICAgICAgICAgICAgICgoV0RBX0dFVF9SWF9UWVBFKHBSeE1ldGEpPDw0KXxXREFfR0VUX1JYX1NVQlRZUEUocFJ4TWV0YSkpCisKKy8qIFdEQV9HRVRfUlhfUkVPUkRFUl9PUENPREUgOiBGb3IgTVNEVSByZW9yZGVyICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjICBkZWZpbmUgV0RBX0dFVF9SWF9SRU9SREVSX09QQ09ERShwUnhNZXRhKSBcCisgICAgICAgICAgICgoKFdESV9EU19SeE1ldGFJbmZvVHlwZSopKHBSeE1ldGEpKS0+YW1wZHVfcmVvcmRlck9wY29kZSkKKworLyogV0RBX0dFVF9SWF9SRU9SREVSX1NMT1RfSURYIDogRm9yIE1TRFUgcmVvcmRlciAqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworIyAgZGVmaW5lIFdEQV9HRVRfUlhfUkVPUkRFUl9TTE9UX0lEWCh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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBWT1NfVFJVRSkKKworI2RlZmluZSBXTEFOV0RBX0hPX0lTX0FOX0FNUERVICAgICAgICAgICAgICAgICAgICAweDQwMDAKKyNkZWZpbmUgV0xBTldEQV9IT19MQVNUX01QRFVfT0ZfQU1QRFUgICAgICAgICAgICAgMHg0MDAKKworLyogV0RBX0lTX1JYX0FOX0FNUERVICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworIyAgZGVmaW5lIFdEQV9JU19SWF9BTl9BTVBEVShwUnhNZXRhKSAgICAgICBcCisgICAoICgoV0RJX0RTX1J4TWV0YUluZm9UeXBlKikocFJ4TWV0YSkpLT5yeHBGbGFncyAmIFdMQU5XREFfSE9fSVNfQU5fQU1QRFUgKQorCisvKiBXREFfSVNfUlhfTEFTVF9NUERVICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjICBkZWZpbmUgV0RBX0lTX1JYX0xBU1RfTVBEVShwUnhNZXRhKSAgICAgIFwKKyAgICggKChXRElfRFNfUnhNZXRhSW5mb1R5cGUqKShwUnhNZXRhKSktPnJ4cEZsYWdzICYgV0xBTldEQV9IT19MQVNUX01QRFVfT0ZfQU1QRFUgKSAKKworLyogV0RBX0dFVF9SWF9USU1FU1RBTVAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjICBkZWZpbmUgV0RBX0dFVF9SWF9USU1FU1RBTVAocFJ4TWV0YSkgKCgoV0RJX0RTX1J4TWV0YUluZm9UeXBlKikocFJ4TWV0YSkpLT5tY2xrUnhUaW1lc3RhbXApCisKKy8qIFdEQV9JU19SWF9JTl9TQ0FOICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyMgIGRlZmluZSB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VF9SU1NJMV9EQihyc3NpMCkgICAgICgwIC0gV0RBX1JTU0lfT0ZGU0VUKQorIyAgZGVmaW5lIFdEQV9NQVhfT0ZfVFdPKHZhbDEsIHZhbDIpICAoICgodmFsMSkgPiAodmFsMikpID8gKHZhbDEpIDogKHZhbDIpKQorIyAgZGVmaW5lIFdEQV9HRVRfUlNTSV9EQihyc3NpMCkgIFwKKyAgICAgICAgICAgICAgICBXREFfTUFYX09GX1RXTyhXREFfR0VUX1JTU0kwX0RCKHJzc2kwKSwgV0RBX0dFVF9SU1NJMV9EQihyc3NpMCkpCisjICBkZWZpbmUgV0RBX0dFVF9SWF9SU1NJX0RCKHBSeE1ldGEpIFwKKyAgICAgICAgICAgICAgICAgICAgICAgV0RBX0dFVF9SU1NJX0RCKCgoKFdESV9EU19SeE1ldGFJbmZvVHlwZSopKHBSeE1ldGEpKS0+cnNzaTApKQorCisvKiBXREFfR0VUX1JYX1NOUiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjICBkZWZpbmUgV0RBX0dFVF9SWF9TTlIocFJ4TWV0YSkgICgoKFdESV9EU19SeE1ldGFJbmZvVHlwZSopKHBSeE1ldGEpKS0+c25yKQorCisvKiBXREFfSVNfUlhfRkMgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvLyBGbG93IGNvbnRyb2wgZnJhbWVzCisvKiBGSVhNRSBXREEgc2hvdWxkIHByb3ZpZGUgdGhlIG1ldGEgaW5mbyB3aGljaCBpbmRpY2F0ZXMgRkMgZnJhbWUgCisgICAgICAgICAgSW4gdGhlIG1lYW50aW1lLCB1c2UgaGFyZGNvZGVkIEZBTFNFLCBzaW5jZSB3ZSBkb24ndCBzdXBwb3J0IEZDIHlldCAqLworIyAgZGVmaW5lIFdEQV9JU19SWF9GQyhwUnhNZXRhKSAgICAoKChXRElfRFNfUnhNZXRhSW5mb1R5cGUqKShwUnhNZXRhKSktPmZjKQorCisvKiBXREFfR0VUX1JYX0ZDX1ZBTElEX1NUQV9NQVNLICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjICBkZWZpbmUgV0RBX0dFVF9SWF9GQ19WQUxJRF9TVEFfTUFTSyhwUnhNZXRhKSBcCisgICAgICAgICAgICAgICAgICAgICAgICgoKFdESV9EU19SeE1ldGFJbmZvVHlwZSopKHBSeE1ldGEpKS0+ZmNTVEFWYWxpZE1hc2spCisKKy8qIFdEQV9HRVRfUlhfRkNfUFdSU0FWRV9TVEFfTUFTSyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyMgIGRlZmluZSBXREFfR0VUX1JYX0ZDX1BXUlNBVkVfU1RBX01BU0socFJ4TWV0YSkgXAorICAgICAgICAgICAgICAgICAoKChXRElfRFNfUnhNZXRhSW5mb1R5cGUqKShwUnhNZXRhKSktPmZjU1RBUHdyU2F2ZVN0YXRlTWFzaykKKworLyogV0RBX0dFVF9SWF9GQ19TVEFfVEhSRF9JTkRfTUFTSyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyMgIGRlZmluZSBXREFfR0VUX1JYX0ZDX1NUQV9USFJEX0lORF9NQVNLKHBSeE1ldGEpIFwKKyAgICAgICAgICAgICAgICAgICAgICgoKFdESV9EU19SeE1ldGFJbmZvVHlwZSopKHBSeE1ldGEpKS0+ZmNTVEFUaHJlc2hJbmRNYXNrKQorCisvKiBXREFfR0VUX1JYX0ZDX0ZPUkNFRF9TVEFfVFhfRElTQUJMRURfQklUTUFQICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworIyAgZGVmaW5lIFdEQV9HRVRfUlhfRkNfU1RBX1RYX0RJU0FCTEVEX0JJVE1BUChwUnhNZXRhKSBcCisgICAgICAgICAgICAgICAgICAgICAoKChXRElfRFNfUnhNZXRhSW5mb1R5cGUqKShwUnhNZXRhKSktPmZjU3RhVHhEaXNhYmxlZEJpdG1hcCkKKworLyogV0RBX0dFVF9SWF9GQ19TVEFfVFhRX0xFTiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworIyAgZGVmaW5lIFdEQV9HRVRfUlhfRkNfU1RBX1RYUV9MRU4ocFJ4TWV0YSwgc3RhSWQpIFwKKyAgICAgICAgICAgICAgICAgICgoKFdESV9EU19SeE1ldGFJbmZvVHlwZSopKHBSeE1ldGEpKS0+ZmNTVEFUeFFMZW5bKHN0YUlkKV0pCisKKy8qIFdEQV9HRVRfUlhfRkNfU1RBX0NVUl9UWFJBVEUgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyMgIGRlZmluZSBXREFfR0VUX1JYX0ZDX1NUQV9DVVJfVFhSQVRFKHBSeE1ldGEsIHN0YUlkKSBcCisgICAgICAgICAgICAgICAgKCgoV0RJX0RTX1J4TWV0YUluZm9UeXBlKikocFJ4TWV0YSkpLT5mY1NUQUN1clR4UmF0ZVsoc3RhSWQpXSkKKworLyogV0RBX0dFVF9SWF9SRVBMQVlfQ09VTlQgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworIyAgZGVmaW5lIFdEQV9HRVRfUlhfUkVQTEFZX0NPVU5UKHBSeE1ldGEpIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChXRElfRFNfUnhNZXRhSW5mb1R5cGUqKShwUnhNZXRhKSktPnJlcGxheUNvdW50KQorCisvKiBXREFfR0VUUlNTSTAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworIyAgZGVmaW5lIFdEQV9HRVRSU1NJMChwUnhNZXRhKSAoKChXRElfRFNfUnhNZXRhSW5mb1R5cGUqKShwUnhNZXRhKSktPnJzc2kwKQorCisvKiBXREFfR0VUUlNTSTEgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworIyAgZGVmaW5lIFdEQV9HRVRSU1NJMShwUnhNZXRhKSAoKChXRElfRFNfUnhNZXRhSW5mb1R5cGUqKShwUnhNZXRhKSktPnJzc2kxKQorCisvKiBXREFfR0VUX1JYX1JNRiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisjICBkZWZpbmUgV0RBX0dFVF9SWF9STUYocFJ4TWV0YSkgKCgoV0RJX0RTX1J4TWV0YUluZm9UeXBlKikocFJ4TWV0YSkpLT5ybWYpCisjZW5kaWYKKworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworCit1aW50OCBXREFfSXNXY25zc1dsYW5Db21waWxlZFZlcnNpb25HcmVhdGVyVGhhbk9yRXF1YWwodWludDggbWFqb3IsIHVpbnQ4IG1pbm9yLCB1aW50OCB2ZXJzaW9uLCB1aW50OCByZXZpc2lvbik7Cit1aW50OCBXREFfSXNXY25zc1dsYW5SZXBvcnRlZFZlcnNpb25HcmVhdGVyVGhhbk9yRXF1YWwodWludDggbWFqb3IsIHVpbnQ4IG1pbm9yLCB1aW50OCB2ZXJzaW9uLCB1aW50OCByZXZpc2lvbik7CisKKworVk9TX1NUQVRVUyBXREFfR2V0V2Nuc3NXbGFuQ29tcGlsZWRWZXJzaW9uKHZfUFZPSURfdCBwdm9zR0N0eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyVmVyc2lvblR5cGUgKnBWZXJzaW9uKTsKK1ZPU19TVEFUVVMgV0RBX0dldFdjbnNzV2xhblJlcG9ydGVkVmVyc2lvbih2X1BWT0lEX3QgcHZvc0dD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b3IgY2hlY2tpbmcgU1RBIHR5cGUKKyAgICAKKyAgIE9VVAorICAgICAgICBwdm9zU3RhdHVzICByZXR1cm5lZCBzdGF0dXMKKyAgICAgICAgcHVGYXN0RndkT0sgRmxhZyB0byBpbmRpY2F0ZSB3aGV0aGVyIGZyYW1lIGNvdWxkIGJlIGZhc3QgZm9yd2FyZGVkCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgTm8gcmV0dXJuLiAgIAorCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgV0RBX1RMSV9GYXN0SHdGd2REYXRhRnJhbWUKKygKKyAgdl9QVk9JRF90ICAgICBwdm9zR0N0eCwKKyAgdm9zX3BrdF90KiAgICB2b3NEYXRhQnVmZiwKKyAgVk9TX1NUQVRVUyogICBwdm9zU3RhdHVzLAorICB2X1UzMl90KiAgICAgICBwdUZhc3RGd2RPSywKKyAgV0xBTlRMX01ldGFJbmZvVHlwZSogIHBNZXRhSW5mbywKKyAgV0xBTl9TVEFEZXNjVHlwZSogIHBTdGFJbmZvCispOworI2VuZGlmIC8qIFdMQU5fUEVSRiAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdEQV9EU19SZWdpc3RlcgorCisgIERFU0NSSVBUSU9OIAorICAgIFJlZ2lzdGVyIFRMIGNsaWVudCB0byBXREEuIFRoaXMgZnVuY3Rpb24gcmVnaXN0ZXJzIFRMIFJYL1RYIGZ1bmN0aW9ucworICAgIHRvIFdESSBieSBjYWxsaW5nIFdESV9EU19SZWdpc3Rlci4KKworCisgICAgRm9yIE5PTiBpbnRlZ3JhdGVkIFNPQywgdGhpcyBmdW5jdGlvbiBjYWxscyBXTEFOQkFMX1JlZ1RsQ2JGdW5jdGlvbnMKKyAgICB0byByZWdpc3RlciBUTCdzIFJYL1RYIGZ1bmN0aW9ucyB0byBCQUwKKworICBUT0RPIAorICAgIEZvciBQcmltYSwgcGZuUmVzb3VyY2VDQiBnZXRzIGNhbGxlZCBpbiBXRFRTX09PUmVzb3VyY2VOb3RpZmljYXRpb24uCisgICAgVGhlIHVDb3VudCBwYXJhbWV0ZXIgaXMgQUMgbWFzay4gSXQgc2hvdWxkIGJlIHJlZGVmaW5lZCB0byB1c2UgdGhlCisgICAgc2FtZSByZXNvdXJjZSBjYWxsYmFjayBmdW5jdGlvbi4KKworICBERVBFTkRFTkNJRVMgCisgICAgIAorICBQQVJBTUVURVJTIAorCisgICBJTgorICAgICAgICBwdm9zR0N0eCAgICBWT1MgY29udGV4dAorICAgICAgICBwZm5UeENvbXBsZXRlQ2FsbGJhY2sgICAgICAgVFggY29tcGxldGUgY2FsbGJhY2sgdXBvbiBUWCBjb21wbGV0aW9uCisgICAgICAgIHBmblJ4UGFja2V0Q2FsbGJhY2sgICAgICAgICBSWCBjYWxsYmFjaworICAgICAgICBwZm5SZXNvdXJjZUNCICAgICAgICAgICAgICAgZ2V0cyBjYWxsZWQgd2hlbiB1cGRhdGluZyBUWCBQRFUgbnVtYmVyCisgICAgICAgIHVSZXNUaGVzaG9sZCAgICAgICAgICAgICAgICBtaW5pbXVtIFRYIFBEVSBzaXplIGZvciBhIHBhY2tldAorICAgICAgICBwQ2FsbGJhY2tDb250ZXh0ICAgICAgICAgICAgV0RJIGNhbGxzIGNhbGxiYWNrIGZ1bmN0aW9uIHdpdGggaXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZPUyBnbG9iYWwgY29udGV4dCBwb2ludGVyCisgICBPVVQKKyAgICAgICAgdUF2YWlsYWJsZVR4QnVmICAgICAgIGF2YWlsYWJsZSBUWCBQRFUgbnVtYmRlci4gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCQUwgcmV0dXJucyBpdCBmb3IgTk9OIGludGVncmF0ZWQgU09DCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgcG9pbnRlciBpcyBOVUxMIGFuZCBvdGhlciBlcnJvcnMgCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgRXZlcnl0aGluZyBpcyBnb29kIDopCisKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyAKK1dEQV9EU19SZWdpc3RlciAKKyggCisgIHZfUFZPSURfdCAgICAgICAgICAgICAgICAgcHZvc0dDdHgsIAorICBXREFfRFNfVHhDb21wbGV0ZUNhbGxiYWNrIHBmblR4Q29tcGxldGVDYWxsYmFjaywKKyAgV0RBX0RTX1J4UGFja2V0Q2FsbGJhY2sgICBwZm5SeFBhY2tldENhbGxiYWNrLCAKKyAgV0RBX0RTX1R4UGFja2V0Q2FsbGJhY2sgICBwZm5UeFBhY2tldENhbGxiYWNrLAorICBXREFfRFNfUmVzb3VyY2VDQiAgICAgICAgIHBmblJlc291cmNlQ0IsCisgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgdVJlc1RoZXNob2xkLAorICB2X1BWT0lEX3QgICAgICAgICAgICAgICAgIHBDYWxsYmFja0NvbnRleHQsCisgIHZfVTMyX3QgICAgICAgICAgICAgICAgICAgKnVBdmFpbGFibGVUeEJ1ZgorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgICBXREFfRFNfU3RhcnRYbWl0CisKKyAgREVTQ1JJUFRJT04gCisgICAgU2VyaWFsaXplIFRYIHRyYW5zbWl0IHJlcXVlcyB0byBUWCB0aHJlYWQuIAorCisgIFRPRE8gVGhpcyBzZW5kcyBUWCB0cmFuc21pdCByZXF1ZXN0IHRvIFRMLiBJdCBzaG91bGQgc2VuZCB0byBXREkgZm9yCisgICAgICAgICBhYnN0cmFjdGlvbi4KKworICAgIEZvciBOT04gaW50ZWdyYXRlZCBTT0MsIHRoaXMgZnVuY3Rpb24gY2FsbHMgV0xBTkJBTF9TdGFydFhtaXQKKworICBERVBFTkRFTkNJRVMgCisgICAgIAorICBQQVJBTUVURVJTIAorCisgICBJTgorICAgICAgICBwdm9zR0N0eCAgICBWT1MgY29udGV4dAorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFZPU19TVEFUVVNfRV9GQVVMVDogIHBvaW50ZXIgaXMgTlVMTCBhbmQgb3RoZXIgZXJyb3JzIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dEQV9EU19TdGFydFhtaXQKKygKKyAgdl9QVk9JRF90IHB2b3NHQ3R4CispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdEQV9EU19GaW5pc2hVTEEKKworICBERVNDUklQVElPTiAKKyAgICBTZXJpYWxpemUgRmluaXNoIFVwcGVyIExldmVsIEF1dGhlbnRpY2F0aW9uIHJlcXVlcyB0byBUWCB0aHJlYWQuIAorCisgIERFUEVOREVOQ0lFUyAKKyAgICAgCisgIFBBUkFNRVRFUlMgCisKKyAgIElOCisgICAgICAgIGNhbGxiYWNrUm91dGluZSAgICByb3V0aW5lIHRvIGJlIGNhbGxlZCBpbiBUWCB0aHJlYWQKKyAgICAgICAgY2FsbGJhY2tDb250ZXh0ICAgIHVzZXIgZGF0YSBmb3IgdGhlIGFib3ZlIHJvdXRpbmUgCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgcGxlYXNlIHNlZSB2b3NfdHhfbXFfc2VyaWFsaXplCisKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0RBX0RTX0ZpbmlzaFVMQQorKAorIHZvaWQgKCpjYWxsYmFja1JvdXRpbmUpICh2b2lkICpjYWxsYmFja0NvbnRleHQpLAorIHZvaWQgICpjYWxsYmFja0NvbnRleHQKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgIEZVTkNUSU9OICAgIFdEQV9EU19CdWlsZFR4UGFja2V0SW5mbworCisgIERFU0NSSVBUSU9OCisgICAgQnVpbGQgVFggbWV0YSBpbmZvIGZvciBpbnRlZ3JhdGVkIFNPQy4KKyAgICAKKyAgICBTYW1lIGZ1bmN0aW9uIGNhbGxzIEhBTCBmb3IgcmVzZXJ2ZSBCRCBoZWFkZXIgc3BhY2UgaW50byBWT1MgcGFja2V0IGFuZAorICAgIEhBTCBmdW5jdGlvbiB0byBmaWxsIGl0LgorICAgIAorICBERVBFTkRFTkNJRVMKKworICBQQVJBTUVURVJTCisKKyAgIElOCisgICAgcHZvc0dDdHggICAgICAgICBWT1MgY29udGV4dAorICAgIHZvc0RhdGFCdWZmICAgICAgdm9zIGRhdGEgYnVmZmVyCisgICAgcHZEZXN0TWFjQWRkciAgIGRlc3RpbmF0aW9uIE1BQyBhZGRyZXNzIHBvbnRlcgorICAgIHVjRGlzYWJsZUZybVh0bCAgSXMgZnJhbWUgeHRsIGRpc2FibGVkPworICAgIHVjUW9zRW5hYmxlZCAgICAgSXMgUW9TIGVuYWJsZWQ/CisgICAgdWNXRFNFbmFibGVkIC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ZWQsCisgIHZfVThfdCAgICAgICAgICBleHRyYUhlYWRTcGFjZSwKKyAgdl9VOF90ICAgICAgICAgIHR5cGVTdWJ0eXBlLAorICB2X1BWT0lEX3QgICAgICAgcEFkZHIyLAorICB2X1U4X3QgICAgICAgICAgdVRpZCwKKyAgdl9VMzJfdCAgICAgICAgICB0eEZsYWcsCisgIHZfVTMyX3QgICAgICAgICB0aW1lU3RhbXAsCisgIHZfVThfdCAgICAgICAgICB1Y0lzRWFwb2wsCisgIHZfVThfdCAgICAgICAgICB1Y1VQLAorICB2X1UzMl90ICAgICAgICAgdWNUeEJkVG9rZW4KKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgIEZVTkNUSU9OICAgIFdEQV9EU19QZWVrUnhQYWNrZXRJbmZvCisKKyAgREVTQ1JJUFRJT04KKyAgICBSZXR1cm4gUlggbWV0YWluZm8gcG9pbnRlciBmb3IgZm9yIGludGVncmF0ZWQgU09DLgorICAgIAorICAgIFNhbWUgZnVuY3Rpb24gd2lsbCByZXR1cm4gQkQgaGVhZGVyIHBvaW50ZXIuCisgICAgCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgSU4KKyAgICB2b3NEYXRhQnVmZiAgICAgIHZvcyBkYXRhIGJ1ZmZlcgorCisgICAgcHZEZXN0TWFjQWRkciAgICBkZXN0aW5hdGlvbiBNQUMgYWRkcmVzcyBwb250ZXIKKyAgICBiU3dhcCAgICAgICAgICAgIFdhbnQgdG8gc3dhcCBCRCBoZWFkZXI/IEZvciBiYWNrd2FyZCBjb21wYXRhYmlsaXR5CisgICAgICAgICAgICAgICAgICAgICBJdCBkb2VzIG5vdGhpbmcgZm9yIGludGVncmF0ZWQgU09DCisgICBPVVQKKyAgICAqcHBSeEhlYWRlciAgICAgIFJYIG1ldGFpbmZvIHBvaW50ZXIKKworICBSRVRVUk4gVkFMVUUKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6ICBwb2ludGVyIGlzIE5VTEwgYW5kIG90aGVyIGVycm9ycyAKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXREFfRFNfUGVla1J4UGFja2V0SW5mbworKAorICB2b3NfcGt0X3QgKnZvc0RhdGFCdWZmLAorICB2X1BWT0lEX3QgKnBwUnhIZWFkZXIsCisgIHZfQk9PTF90ICBiU3dhcAorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgRlVOQ1RJT04gICAgV0RBX0RTX1RyaW1SeFBhY2tldEluZm8KKworICBERVNDUklQVElPTgorICAgIFRyaW0vUmVtb3ZlIFJYIEJEIGhlYWRlciBmb3IgTk9OIGludGVncmF0ZWQgU09DLgorICAgIEl0IGRvZXMgbm90aGluZyBmb3IgaW50ZWdyYXRlZCBTT0MuCisgICAgCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgSU4KKyAgICB2b3NEYXRhQnVmZiAgICAgIHZvcyBkYXRhIGJ1ZmZlcgorCisgIFJFVFVSTiBWQUxVRQorICAgIFZPU19TVEFUVVNfRV9GQVVMVDogIHBvaW50ZXIgaXMgTlVMTCBhbmQgb3RoZXIgZXJyb3JzIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dEQV9EU19UcmltUnhQYWNrZXRJbmZvCisoIAorICB2b3NfcGt0X3QgKnZvc0RhdGFCdWZmCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICBGVU5DVElPTiAgICBXREFfRFNfR2V0VHhSZXNvdXJjZXMKKworICBERVNDUklQVElPTgorICAgIEl0IGRvZXMgcmV0dXJuIGhhcmRjb2RlZCB2YWx1ZSBmb3IgUHJpbWEuIEl0IHNob3VsZCBiaWdnZXIgbnVtYmVyIHRoYW4gMC4KKyAgICBSZXR1cm5pbmcgMCB3aWxsIHB1dCBUTCBpbiBvdXQtb2YtcmVzb3VyY2UgY29uZGl0aW9uIGZvciBUWC4KKworICAgIFJldHVybiBjdXJyZW50IFBEVSByZXNvdXJjZXMgZnJvbSBCQUwgZm9yIE5PTiBpbnRlZ3JhdGVkIFNPQy4KKyAgICAKKyAgREVQRU5ERU5DSUVTCisKKyAgUEFSQU1FVEVSUworCisgICBJTgorICAgIHZvc0RhdGFCdWZmICAgICAgdm9zIGRhdGEgYnVmZmVyCisgICAKKyAgIE9VVAorICAgIHB1UmVzQ291bnQgICAgICAgIGF2YWlsYWJsZSBQRFUgbnVtYmVyIGZvciBUWAorCisgIFJFVFVSTiBWQUxVRQorICAgIFZPU19TVEFUVVNfRV9GQVVMVDogIHBvaW50ZXIgaXMgTlVMTCBhbmQgb3RoZXIgZXJyb3JzIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dEQV9EU19HZXRUeFJlc291cmNlcworKCAKKyAgdl9QVk9JRF90IHB2b3NHQ3R4LAorICB2X1UzMl90KiAgcHVSZXNDb3VudAorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgRlVOQ1RJT04gICAgV0RBX0RTX0dldFJzc2kKKworICBERVNDUklQVElPTgorICAgIEdldCBSU1NJIAorCisgIFRPRE8gSXQgcmV0dXJucyBoYXJkY29kZWQgdmFsdWUgaW4gdGhlIG1lYW50aW1lIHNpbmNlIFdEQS9XREkgZG9lcyBub3RoaW5nCisgICAgICAgc3VwcG9ydCBpdCB5ZXQgZm9yIFByaW1hLgorCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgSU4KKyAgICB2b3NEYXRhQnVmZiAgICAgIHZvcyBkYXRhIGJ1ZmZlcgorCisgICBPVVQKKyAgICBwdVJzc2kgICAgICAgICAgIFJTU0kKKworICBSRVRVUk4gVkFMVUUKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6ICBwb2ludGVyIGlzIE5VTEwgYW5kIG90aGVyIGVycm9ycyAKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXREFfRFNfR2V0UnNzaQorKAorICB2X1BWT0lEX3QgcHZvc0dDdHgsCisgIHZfUzdfdCogICBwdVJzc2kKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgIEZVTkNUSU9OICAgIFdEQV9EU19SeEFtc2R1QmRGaXgKKworICBERVNDUklQVElPTgorICAgIEZvciBiYWNrd2FyZCBjb21wYXRhYmlsaXR5IHdpdGggTGlicmEvVm9sYW5zLiBOZWVkIHRvIGNhbGwgSEFMIGZ1bmN0aW9uCisgICAgZm9yIEhXIEJEIGJ1ZyBmaXgKKworICAgIEl0IGRvZXMgbm90aGluZyBmb3IgaW50ZWdyYXRlZCBTT0MuCisKKyAgREVQRU5ERU5DSUVTCisKKyAgUEFSQU1FVEVSUworCisgICBJTgorICAgIHB2b3NHQ3R4ICAgICAgICAgVk9TIGNvbnRleHQKKyAgICBwdkJESGVhZGVyICAgICAgIEJEIGhlYWRlciBwb2ludGVyCisKKyAgIE9VVAorCisgIFJFVFVSTiBWQUxVRQorICAgIFZPU19TVEFUVVNfRV9GQVVMVDogIHBvaW50ZXIgaXMgTlVMTCBhbmQgb3RoZXIgZXJyb3JzIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dEQV9EU19SeEFtc2R1QmRGaXgKKygKKyAgdl9QVk9JRF90IHB2b3NHQ3R4LAorICB2X1BWT0lEX3QgcHZCREhlYWRlcgorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgRlVOQ1RJT04gICAgV0RBX0RTX0dldEZyYW1lVHlwZVN1YlR5cGUKKworICBERVNDUklQVElPTgorICAgIEdldCB0eXBlU3VidHlwZSBmcm9tIHRoZSBwYWNrZXQuIFRoZSBCRCBoZWFkZXIgc2hvdWxkIGhhdmUgdGhpcy4KKyAgICBCdXQgc29tZSByZWFzb24sIExpYnJhL1ZvbGFucyByZWFkIGl0IGZyb20gODAyLjExIGhlYWRlciBhbmQgc2F2ZSBpdAorICAgIGJhY2sgdG8gQkQgaGVhZGVyLiBTbyBmb3IgTk9OIGludGVncmF0ZWQgU09DLCB0aGlzIGZ1bmN0aW9uIGRvZXMKKyAgICB0aGUgc2FtZS4KKworICAgIEZvciBpbnRlZ3JhdGVkIFNPQywgV0RJIGRvZXMgdGhlIHNhbWUsIG5vdCBUTC4gCisgICAgSXQgZG9lcyByZXR1cm4gdHlwZVN1YnR5cGUgZnJvbSBSWCBtZXRhIGluZm8gZm9yIGludGVncmF0ZWQgU09DLgorCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgSU4KKyAgICBwdm9zR0N0eCAgICAgICAgIFZPUyBjb250ZXh0CisgICAgdm9zRGF0YUJ1ZmYgICAgICB2b3MgZGF0YSBidWZmZXIKKyAgICBwUnhIZWFkZXIgICAgICAgIFJYIG1ldGEgaW5mbyBvciBCRCBoZWFkZXIgcG9pbnRlcgorCisgICBPVVQKKyAgICB1Y1R5cGVTdWJ0eXBlICAgIHR5cGVTdWJ0eXBlCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgcG9pbnRlciBpcyBOVUxMIGFuZCBvdGhlciBlcnJvcnMgCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgRXZlcnl0aGluZyBpcyBnb29kIDopCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0RBX0RTX0dldEZyYW1lVHlwZVN1YlR5cGUKKygKKyAgdl9QVk9JRF90IHB2b3NHQ3R4LAorICB2b3NfcGt0X3QgKnZvc0RhdGFCdWZmLAorICB2X1BWT0lEX3QgcFJ4SGVhZGVyLAorICB2X1U4X3QgICAgKnVjVHlwZVN1YnR5cGUKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgIEZVTkNUSU9OICAgIFdEQV9EU19HZXRSZXBsYXlDb3VudGVyCisKKyAgREVTQ1JJUFRJT04KKyAgICBSZXR1cm4gcmVwbGF5IGNvdW50ZXIgZnJvbSBCRCBoZWFkZXIgb3IgUlggbWV0YSBpbmZvCisKKyAgREVQRU5ERU5DSUVTCisKKyAgUEFSQU1FVEVSUworCisgICBJTgorICAgIHBSeEhlYWRlciAgICAgICAgUlggbWV0YSBpbmZvIG9yIEJEIGhlYWRlciBwb2ludGVyCisKKyAgIE9VVAorCisgIFJFVFVSTiBWQUxVRQorICAgIFJlcGxheSBDb3VudGVyCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordl9VNjRfdAorV0RBX0RTX0dldFJlcGxheUNvdW50ZXIKKygKKyAgdl9QVk9JRF90IHBSeEhlYWRlcgorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgRlVOQ1RJT04gICAgV0RBX0RTX0dldFJlcGxheUNvdW50ZXIKKworICBERVNDUklQVElPTgorICAgIEhPIHN1cHBvcnQuIFNldCBSU1NJIHRocmVzaG9sZCB2aWEgSEFMIGZ1bmN0aW9uIGZvciBOT04gaW50ZWdyYXRlZCBTT0MKKworICBUT0RPCisgICAgU2FtZSBmdW5jdGlvbiBzaG91bGQgYmUgcHJvdmlkZWQgYnkgV0RBL1dESSBmb3IgUHJpbWEuCisKKyAgREVQRU5ERU5DSUVTCisKKyAgUEFSQU1FVEVSUworCisgICBJTgorICAgIHBNYWMgICAgICAgICAgICAgTUFDIGdsb2JhbCBwb2ludGVyCisgICAgcFRocmVzaG9sZHMgICAgICBwb2ludGVyIG9mIHRocmVzaG9sZCBzdHJ1Y3R1cmUgdG8gc2V0LgorCisgICBPVVQKKworICBSRVRVUk4gVkFMVUUKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6ICBwb2ludGVyIGlzIE5VTEwgYW5kIG90aGVyIGVycm9ycyAKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXREFfRFNfU2V0UlNTSVRocmVzaG9sZHMKKygKKyAgdHBBbmlTaXJHbG9iYWwgICAgICBwTWFjLAorICB0cFNpclJTU0lUaHJlc2hvbGRzIHBUaHJlc2hvbGRzCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICBGVU5DVElPTiAgICBXREFfRFNfVHhGcmFtZXMKKworICBERVNDUklQVElPTgorICAgIFB1bGwgcGFja2V0cyBmcm9tIFRMIGFuZCBwdXNoIHRoZW0gdG8gV0RJLiBJdCBnZXRzIGludm9rZWQgdXBvbgorICAgIFdEQV9EU19UWF9TVEFSVF9YTUlULgorCisgICAgVGhpcyBmdW5jdGlvbiBpcyBlcXVpdmVsYW50IG9mIFdMQU5TU0NfVHJhbnNtaXQgaW4gTGlicmEvVm9sYW5zLgorCisgIFRPRE8KKyAgICBUaGlzIGZ1bmN0aW9uIHNob3VsZCBiZSBpbXBsZW1lbnRlZCBhbmQgbW92ZWQgaW4gV0RJLgorCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgSU4KKyAgICBwdm9zR0N0eCAgICAgICAgIFZPUyBjb250ZXh0CisKKyAgIE9VVAorCisgIFJFVFVSTiBWQUxVRQorICAgIFZPU19TVEFUVVNfRV9GQVVMVDogIHBvaW50ZXIgaXMgTlVMTCBhbmQgb3RoZXIgZXJyb3JzIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dEQV9EU19UeEZyYW1lcworKCAKKyAgdl9QVk9JRF90IHB2b3NHQ3R4IAorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgRlVOQ1RJT04gICAgV0RBX0RTX1R4Rmxvd0NvbnRyb2xDYWxsYmFjaworCisgIERFU0NSSVBUSU9OCisgICAgSW52b2tlZCBieSBXREkgdG8gY29udHJvbCBUWCBmbG93LgorCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgSU4KKyAgICBwdm9zR0N0eCAgICAgICAgIFZPUyBjb250ZXh0CisgICAgdUZsb3dNYXNrICAgICAgICBUWCBjaGFubmVsIG1hc2sgZm9yIGZsb3cgY29udHJvbAorICAgICAgICAgICAgICAgICAgICAgRGVmaW5lZCBpbiBXREFfVFhGbG93RW51bVR5cGUKKworICAgT1VUCisKKyAgUkVUVVJOIFZBTFVFCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordl9WT0lEX3QKK1dEQV9EU19UeEZsb3dDb250cm9sQ2FsbGJhY2sKKygKKyB2X1BWT0lEX3QgcHZvc0dDdHgsCisgdl9VOF90ICAgIHVGbG93TWFzaworKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgRlVOQ1RJT04gICAgV0RBX0RTX0dldFR4Rmxvd01hc2sKKworICBERVNDUklQVElPTgorICAgIHJldHVybiBUWCBmbG93IG1hc2sgY29udHJvbCB2YWx1ZQorCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgSU4KKyAgICBwdm9zR0N0eCAgICAgICAgIFZPUyBjb250ZXh0CisKKyAgIE9VVAorICAgIHVGbG93TWFzayAgICAgICAgVFggY2hhbm5lbCBtYXNrIGZvciBmbG93IGNvbnRyb2wKKyAgICAgICAgICAgICAgICAgICAgIERlZmluZWQgaW4gV0RBX1RYRmxvd0VudW1UeXBlCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVk9TX1NUQVRVU19FX0lOVkFMOiAgcG9pbnRlciBpcyBOVUxMIGFuZCBvdGhlciBlcnJvcnMgCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgRXZlcnl0aGluZyBpcyBnb29kIDopCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0RBX0RTX0dldFR4Rmxvd01hc2sKKygKKyB2X1BWT0lEX3QgcHZvc0dDdHgsCisgdl9VOF90KiAgIHB1Rmxvd01hc2sKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgIEZVTkNUSU9OICAgIFdEQV9IQUxEdW1wQ21kUmVxCisKKyAgREVTQ1JJUFRJT04KKyAgICBTZW5kIER1bXAgY29tbWFuZHN0byBXREkKKyAgICAKKyAgREVQRU5ERU5DSUVTCisKKyAgUEFSQU1FVEVSUworCisgICBJTgorICAgIHBNYWMgICAgICAgICAgICAgTUFDIGdsb2JhbCBwb2ludGVyCisgICAgY21kICAgICAgICAgICAgICBIYWwgZHVtcCBjb21tYW5kCisgICAgYXJnMSAgICAgICAgICAgICBEdW1wIGNvbW1hbmQgYXJndW1lbnQgMQorICAgIGFyZzIgICAgICAgICAgICAgRHVtcCBjb21tYW5kIGFyZ3VtZW50IDIKKyAgICBhcmczICAgICAgICAgICAgIER1bXAgY29tbWFuZCBhcmd1bWVudCAzCisgICAgYXJnNCAgICAgICAgICAgICBEdW1wIGNvbW1hbmQgYXJndW1lbnQgNAorICAgIGFzeW5jICAgICAgICAgICAgQXN5bmNocm9ub3VzIGV2ZW50LiBEb2Vzbid0IHdhaXQgZm9yIHJzcC4KKworICAgT1VUCisgICAgICAgcEJ1ZmZlciAgICAgICAgICBEdW1wIGNvbW1hbmQgUmVzcG9uc2UgYnVmZmVyCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgcG9pbnRlciBpcyBOVUxMIGFuZCBvdGhlciBlcnJvcnMgCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgRXZlcnl0aGluZyBpcyBnb29kIDopCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXREFfSEFMRHVtcENtZFJlcSh0cEFuaVNpckdsb2JhbCAgIHBNYWMsdEFOSV9VMzIgY21kLCAKKyAgICAgICAgICAgICAgICAgdEFOSV9VMzIgICBhcmcxLCB0QU5JX1UzMiAgIGFyZzIsIHRBTklfVTMyICAgYXJnMywKKyAgICAgICAgICAgICAgICAgdEFOSV9VMzIgICBhcmc0LCB0QU5JX1U4ICAgKnBCdWZmZXIsIHdwdF9ib29sZWFuIGFzeW5jKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgRlVOQ1RJT04gICAgV0RBX2ZlYXR1cmVDYXBzRXhjaGFuZ2UKKworICBERVNDUklQVElPTgorICAgIFdEQSBBUEkgdG8gaW52b2tlIGNhcGFiaWxpdHkgZXhjaGFuZ2UgYmV0d2VlbiBob3N0IGFuZCBGVworCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgSU4KKyAgICBwVm9zQ29udGV4dCAgICAgICAgIFZPUyBjb250ZXh0CisKKyAgIE9VVAorICAgIE5PTkUKKworICBSRVRVUk4gVkFMVUUKKyAgICBOT05FCisgICAgCisgIFNJREUgRUZGRUNUUworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIFdEQV9mZWF0dXJlQ2Fwc0V4Y2hhbmdlKHZfUFZPSURfdCBwVm9zQ29udGV4dCk7CisKK3ZvaWQgV0RBX2Rpc2FibGVDYXBhYmxpdHlGZWF0dXJlKHRBTklfVTggZmVhdHVyZV9pbmRleCk7CisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICBGVU5DVElPTiAgICBXREFfZ2V0SG9zdFdsYW5GZWF0Q2FwcworCisgIERFU0NSSVBUSU9OCisgICAgV3JhcHBlciBmb3IgV0RJIEFQSSwgdGhhdCB3aWxsIHJldHVybiBpZiB0aGUgZmVhdHVyZSAoZW51bSB2YWx1ZSkucGFzc2VkCisgICAgdG8gdGhpcyBBUEkgaXMgc3VwcG9ydGVkIG9yIG5vdCBpbiBIb3N0CisKKyAgREVQRU5ERU5DSUVTCisKKyAgUEFSQU1FVEVSUworCisgICBJTgorICAgIGZlYXRFbnVtVmFsdWUgICAgIGVudW0gdmFsdWUgZm9yIHRoZSBmZWF0dXJlIGFzIGluIHBsYWNlSG9sZGVySW5DYXBCaXRtYXAgaW4gd2xhbl9oYWxfbXNnLmguCisKKyAgIE9VVAorICAgIE5PTkUKKworICBSRVRVUk4gVkFMVUUKKyAgICAwIC0gaW1wbGllcyBmZWF0dXJlIGlzIE5PVCBTdXBwb3J0ZWQKKyAgICBhbnkgbm9uIHplcm8gdmFsdWUgLSBpbXBsaWVzIGZlYXR1cmUgaXMgU1VQUE9SVEVECisgICAgCisgIFNJREUgRUZGRUNUUworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit0QU5JX1U4IFdEQV9nZXRIb3N0V2xhbkZlYXRDYXBzKHRBTklfVTggZmVhdEVudW1WYWx1ZSk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgIEZVTkNUSU9OICAgIFdEQV9nZXRGd1dsYW5GZWF0Q2FwcworCisgIERFU0NSSVBUSU9OCisgICAgV3JhcHBlciBmb3IgV0RJIEFQSSwgdGhhdCB3aWxsIHJldHVybiBpZiB0aGUgZmVhdHVyZSAoZW51bSB2YWx1ZSkucGFzc2VkCisgICAgdG8gdGhpcyBBUEkgaXMgc3VwcG9ydGVkIG9yIG5vdCBpbiBGVworCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgSU4KKyAgICBmZWF0RW51bVZhbHVlICAgICBlbnVtIHZhbHVlIGZvciB0aGUgZmVhdHVyZSBhcyBpbiBwbGFjZUhvbGRlckluQ2FwQml0bWFwIGluIHdsYW5faGFsX21zZy5oLgorCisgICBPVVQKKyAgICBOT05FCisKKyAgUkVUVVJOIFZBTFVFCisgICAgMCAtIGltcGxpZXMgZmVhdHVyZSBpcyBOT1QgU3VwcG9ydGVkCisgICAgYW55IG5vbiB6ZXJvIHZhbHVlIC0gaW1wbGllcyBmZWF0dXJlIGlzIFNVUFBPUlRFRAorICAgIAorICBTSURFIEVGRkVDVFMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordEFOSV9VOCBXREFfZ2V0RndXbGFuRmVhdENhcHModEFOSV9VOCBmZWF0RW51bVZhbHVlKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgIFdEQV9UcmFuc3BvcnRDaGFubmVsRGVidWcKKworICBERVNDUklQVElPTgorICAgIERpc3BsYXkgVHJhbnNwb3J0IENoYW5uZWwgZGVidWdnaW5nIGluZm9ybWF0aW9uCisgICAgVXNlciBtYXkgcmVxdWVzdCB0byBkaXNwbGF5IERYRSBjaGFubmVsIHNuYXBzaG90CisgICAgT3IgaWYgaG9zdCBkcml2ZXIgZGV0ZWN0cyBhbnkgYWJub3JtYWwgc3RjdWsgbWF5IGRpc3BsYXkKKworICBQQVJBTUVURVJTCisgICAgcE1hYyA6IHVwcGVyIE1BQyBjb250ZXh0IHBvaW50ZXIKKyAgICBkaXNwbGF5U25hcHNob3QgOiBEaXNwbGF5IERYRSBzbmFwc2hvdCBvcHRpb24KKyAgICBkZWJ1Z0ZsYWdzICAgICAgOiBFbmFibGUgc3RhbGwgZGV0ZWN0IGZlYXR1cmVzCisgICAgICAgICAgICAgICAgICAgICAgZGVmaW5lZCBieSBXUEFMX0RldmljZURlYnVnRmxhZ3MKKyAgICAgICAgICAgICAgICAgICAgICBUaGVzZSBmZWF0dXJlcyBtYXkgZWZmZWN0CisgICAgICAgICAgICAgICAgICAgICAgZGF0YSBwZXJmb3JtYW5jZS4KKworICBSRVRVUk4gVkFMVUUKKyAgICBOT05FCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIFdEQV9UcmFuc3BvcnRDaGFubmVsRGVidWcKKygKKyAgdHBBbmlTaXJHbG9iYWwgcE1hYywKKyAgdl9CT09MX3QgICAgICAgZGlzcGxheVNuYXBzaG90LAorICB2X1U4X3QgICAgICAgICBkZWJ1Z0ZsYWdzCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgV0RBX1RyYW5zcG9ydEtpY2tEeGUKKworICBERVNDUklQVElPTgorICAgIFJlcXVlc3QgS2ljayBEWEUgd2hlbiBmaXJzdCBoZGQgVFggdGltZSBvdXQKKyAgICBoYXBwZW5zCisKKyAgUEFSQU1FVEVSUworICAgIE5PTkUKKworICBSRVRVUk4gVkFMVUUKKyAgICBOT05FCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIFdEQV9UcmFuc3BvcnRLaWNrRHhlKHZvaWQpOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgV0RBX1RyYWZmaWNTdGF0c1RpbWVyQWN0aXZhdGUKKworICBERVNDUklQVElPTgorICAgIEFQSSB0byBhY3RpdmF0ZS9kZWFjdGl2YXRlIFRyYWZmaWMgU3RhdHMgdGltZXIuIFRyYWZmaWMgc3RhdHMgdGltZXIgaXMgb25seSBuZWVkZWQgZHVyaW5nIE1DQworICBQQVJBTUVURVJTCisgICAgYWN0aXZhdGUgOiBBY3RpdmF0ZSBvciBub3QKKworICBSRVRVUk4gVkFMVUUKKyAgICBOT05FCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIFdEQV9UcmFmZmljU3RhdHNUaW1lckFjdGl2YXRlKHdwdF9ib29sZWFuIGFjdGl2YXRlKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5D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CisgKi8KKworI2lmbmRlZiBXTEFOX1FDVF9NU0dfTUFQX0gKKyNkZWZpbmUgV0xBTl9RQ1RfTVNHX01BUF9ICisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgIFcgTCBBIE4gICBERVZJQ0UgQURBUFRBVElPTiAgIEwgQSBZIEUgUiAKKyAgICAgICAgICAgICAgICAgICAgICAgTVNHIE1BUFBJTkcgIAorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgIAorREVTQ1JJUFRJT04KKyAgVGhpcyBmaWxlIGNvbnRhaW5zIHRoZSBleHRlcm5hbCBBUEkgZXhwb3NlZCBieSB0aGUgd2xhbiBhZGFwdGF0aW9uIGxheWVyIAorICAKKyAgICAgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisgICRIZWFkZXI6JCAkRGF0ZVRpbWU6ICQgJEF1dGhvcjogJAorCisKK3doZW4gICAgICAgIHdobyAgICAgICAgICB3aGF0LCB3aGVyZSwgd2h5CistLS0tLS0tLSAgICAtLS0gICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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c2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisvKiogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqCisgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqCisKKworICAgIFxmaWxlIHdsYW5fbnYuYworCisgICBcYnJpZWYgQ29udGFpbnMgY29sbGVjdGlvbiBvZiB0YWJsZSBkZWZhdWx0IHZhbHVlcyB0byB1c2UgaW4KKyAgICAgICAgICBjYXNlIGEgdGFibGUgaXMgbm90IGZvdW5kIGluIE5WCisKKyAgICAkSWQkCisKKyAgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCisKKyNpZm5kZWYgV0xBTl9OVl9DCisjZGVmaW5lIFdMQU5fTlZfQworCisjaW5jbHVkZSAid2xhbl9udjIuaCIKKyNpbmNsdWRlICJ3bGFuX2hhbF9tc2cuaCIKKworY29uc3Qgc0hhbE52IG52RGVmYXVsdHMgPQoreworICAgIHsKKyAgICAgICAgMCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRBTklfVTE2ICBwcm9kdWN0SWQ7CisgICAgICAgIDEsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0QU5JX1U4ICAgcHJvZHVjdEJhbmRzOworICAgICAgICAyLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdEFOSV9VOCAgIHdsYW5OdlJldklkOyAvLzA6IFdDTjEzMTIsIDE6IFdDTjEzMTQsIDI6IFdDTjM2NjAKKyAgICAgICAgMSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRBTklfVTggICBudW1PZlR4Q2hhaW5zOworICAgICAgICAxLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdEFOSV9VOCAgIG51bU9mUnhDaGFpbnM7CisgICAgICAgIHsgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0QU5JX1U4ICAgbWFjQWRkcltOVl9GSUVMRF9NQUNfQUREUl9TSVpFXTsKKyAgICAgICAgeyAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRBTklfVTggICBtYWNBZGRyW05WX0ZJRUxEX01BQ19BRERSX1NJWkVdOworICAgICAgICB7IDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdEFOSV9VOCAgIG1hY0FkZHJbTlZfRklFTERfTUFDX0FERFJfU0laRV07CisgICAgICAgIHsgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0QU5JX1U4ICAgbWFjQWRkcltOVl9GSUVMRF9NQUNfQUREUl9TSVpFXTsKKyAgICAgICAgeyAiXDAiIH0sCisgICAgICAgIDAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0QU5JX1U4ICAgY291cGxlclR5cGU7CisgICAgICAgIFdMQU5fTlZfVkVSU0lPTiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0QU5JX1U4ICAgbnZWZXJzaW9uOworICAgIH0sIC8vZmllbGRzCisKKyAgICB7CisgICAgICAgIC8vIE5WX1RBQkxFX1JBVEVfUE9XRVJfU0VUVElOR1MKKyAgICAgICAgeworICAgICAgICAgICAgLy8gdHlwZWRlZiB0QU5JX1MxNiB0UG93ZXJkQm07CisgICAgICAgICAgICAvL3R5cGVkZWYgdFBvd2VyZEJtIHRSYXRlR3JvdXBQd3JbTlVNX0hBTF9QSFlfUkFURVNdOworICAgICAgICAgICAgLy90UmF0ZUdyb3VwUHdyICAgICAgIHB3ck9wdGltdW1bTlVNX1JGX1NVQkJBTkRTXTsKKyAgICAgICAgICAgIC8vMi40RworICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vODAyLjExYiBSYXRlcworICAgICAgICAgICAgICAgIHsxOTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQl9MT05HXzFfTUJQUywKKyAgICAgICAgICAgICAgICB7MTkwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfTE9OR18yX01CUFMsCisgICAgICAgICAgICAgICAgezE5MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX0xPTkdfNV81X01CUFMsCisgICAgICAgICAgICAgICAgezE5MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX0xPTkdfMTFfTUJQUywKKyAgICAgICAgICAgICAgICB7MTkwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfU0hPUlRfMl9NQlBTLAorICAgICAgICAgICAgICAgIHsxOTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQl9TSE9SVF81XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTkwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfU0hPUlRfMTFfTUJQUywKKworICAgICAgICAgICAgICAgIC8vMTFBIDIwTUh6IFJhdGVzCisgICAgICAgICAgICAgICAgezE3MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzZfTUJQUywKKyAgICAgICAgICAgICAgICB7MTcwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfOV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV8xMl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV8xOF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV8yNF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV8zNl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV80OF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV81NF9NQlBTLAorCisgICAgICAgICAgICAgICAgLy9EVVAgMTFBIDQwTUh6IFJhdGVzCisgICAgICAgICAgICAgICAgezE3MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF82X01CUFMsCisgICAgICAgICAgICAgICAgezE3MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF85X01CUFMsCisgICAgICAgICAgICAgICAgezE3MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF8xMl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfMThfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzI0X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF8zNl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfNDhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTUwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzU0X01CUFMsCisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgLy9NQ1MgSW5kZXggIzAtNygyMC80ME1IeikKKyAgICAgICAgICAgICAgICB7MTcwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU182XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTcwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU18xM19NQlBTLAorICAgICAgICAgICAgICAgIHsxNjUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzE5XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU18yNl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzM5X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfNTJfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU181OF81X01CUFMsCisgICAgICAgICAgICAgICAgezEzMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfNjVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTcwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR183XzJfTUJQUywKKyAgICAgICAgICAgICAgICB7MTcwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR18xNF80X01CUFMsCisgICAgICAgICAgICAgICAgezE2NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfMjFfN19NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzI4XzlfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR180M18zX01CUFMsCisgICAgICAgICAgICAgICAgezE1MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfNTdfOF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzY1X01CUFMsCisgICAgICAgICAgICAgICAgezEzMDB9LCAgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzcyXzJfTUJQUywKKworICAgICAgICAgICAgICAgIC8vTUNTIEluZGV4ICM4LTE1KDIwLzQwTUh6KQorICAgICAgICAgICAgICAgIHsxNzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzEzXzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTcwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl8yN19NQlBTLAorICAgICAgICAgICAgICAgIHsxNjUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzQwXzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl81NF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzgxX01CUFMsCisgICAgICAgICAgICAgICAgezE1MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfMTA4X01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfMTIxXzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl8xMzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTcwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHX0NCXzMwX01CUFMsCisgICAgICAgICAgICAgICAgezE2NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfNDVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl82MF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHX0NCXzkwX01CUFMsCisgICAgICAgICAgICAgICAgezE1MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfMTIwX01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfMTM1X01CUFMsCisgICAgICAgICAgICAgICAgezEzMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfMTUwX01CUFMsCisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFBQworICAgICAgICAgICAgICAgIC8vMTFBQyByYXRlcworICAgICAgICAgICAgICAgLy8xMUEgZHVwbGljYXRlIDgwTUh6IFJhdGVzCisgICAgICAgICAgICAgICAgezE3MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfNl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzlfTUJQUywKKyAgICAgICAgICAgICAgICB7MTcwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF8xMl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzE4X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfMjRfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF8zNl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzQ4X01CUFMsCisgICAgICAgICAgICAgICAgezE1MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfNTRfTUJQUywKKworICAgICAgICAgICAgICAgLy8xMWFjIDIwTUhaIE5HLCBTRworICAgICAgICAgICAgICAgIHswMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19DQl9OR0lfNl81X01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX05HSV8xM19NQlBTLAorICAgICAgICAgICAgICAgIHswMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19DQl9OR0lfMTlfNV9NQlBTLAorICAgICAgICAgICAgICAgIHswMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19DQl9OR0lfMjZfTUJQUywKKyAgICAgICAgICAgICAgICB7MDAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfMjBNSFpfTUNTXzFOU1NfQ0JfTkdJXzM5X01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18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0JfU0dJXzU3XzdfTUJQUywKKyAgICAgICAgICAgICAgICB7MDAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfMjBNSFpfTUNTXzFOU1NfQ0JfU0dJXzY1X01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV83Ml8yX01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV84Nl82X01CUFMsCisjaWZkZWYgV0NOX1BST05UTworICAgICAgICAgICAgICAgIHswMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19TR0lfOTZfMV9NQlBTLAorI2VuZGlmCisKKyAgICAgICAgICAgICAgIC8vMTFhYyA0ME1IWiBORywgU0cKKyAgICAgICAgICAgICAgICB7MDAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfNDBNSFpfTUNTXzFOU1NfQ0JfTkdJXzEzXzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MDAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfNDBNSFpfTUNTXzFOU1NfQ0JfTkdJXzI3X01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzQwTUhaX01DU18xTlNTX0NCX05HSV80MF81X01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzQwTUhaX01DU18xTlNTX0NCX05HSV81NF9NQlBTLAorICAgICAgICAgICAgICAgIHswMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF80ME1IWl9NQ1NfMU5TU19DQl9OR0lfODFfTUJQUywKKyAgICAgICAgICAgICAgICB7MDAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfN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F84ME1IWl9NQ1NfMU5TU19DQl9TR0lfMjkyXzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MDAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzMyNV9NQlBTLAorICAgICAgICAgICAgICAgIHswMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9TR0lfMzkwX01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV80MzNfM19NQlBTLAorI2VuZGlmCisgICAgICAgICAgICB9LCAgLy8gICAgUkZfU1VCQkFORF8yXzRfR0haCisgICAgICAgICAgICAvLyA1RyBMb3cKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLzgwMi4xMWIgUmF0ZXMKKyAgICAgICAgICAgICAgICB7MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfTE9OR18xX01CUFMsCisgICAgICAgICAgICAgICAgezB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX0xPTkdfMl9NQlBTLAorICAgICAgICAgICAgICAgIHswfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQl9MT05HXzVfNV9NQlBTLAorICAgICAgICAgICAgICAgIHswfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQl9MT05HXzExX01CUFMsCisgICAgICAgICAgICAgICAgezB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX1NIT1JUXzJfTUJQUywKKyAgICAgICAgICAgICAgICB7MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfU0hPUlRfNV81X01CUFMsCisgICAgICAgICAgICAgICAgezB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX1NIT1JUXzExX01CUFMsCisKKyAgICAgICAgICAgICAgICAvLy8xMUEgMjBNSHogUmF0ZXMKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfNl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV85X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzEyX01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzE4X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzI0X01CUFMsCisgICAgICAgICAgICAgICAgezE0NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzM2X01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzQ4X01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzU0X01CUFMsCisKKyAgICAgICAgICAgICAgICAvLy9EVVAgMTFBIDQwTUh6IFJhdGVzCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF82X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF85X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF8xMl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfMThfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzI0X01CUFMsCisgICAgICAgICAgICAgICAgezE0NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF8zNl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfNDhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzU0X01CUFMsCisKKyAgICAgICAgICAgICAgICAvLy9NQ1MgSW5kZXggIzAtNygyMC80ME1IeikKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU182XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU18xM19NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzE5XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTUwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU18yNl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzM5X01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfNTJfTUJQUywKKyAgICAgICAgICAgICAgICB7MTM1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU181OF81X01CUFMsCisgICAgICAgICAgICAgICAgezEyMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfNjVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR183XzJfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR18xNF80X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfMjFfN19NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzI4XzlfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQ1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR180M18zX01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfNTdfOF9NQlBTLAorICAgICAgICAgICAgICAgIHsxMzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzY1X01CUFMsCisgICAgICAgICAgICAgICAgezEyMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfNzJfMl9NQlBTLAorCisgICAgICAgICAgICAgICAgLy8vTUNTIEluZGV4ICM4LTE1KDIwLzQwTUh6KQorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzEzXzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl8yN19NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzQwXzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTUwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl81NF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzgxX01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfMTA4X01CUFMsCisgICAgICAgICAgICAgICAgezEzMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfMTIxXzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTIwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl8xMzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHX0NCXzMwX01CUFMsCisgICAgICAgICAgICAgICAgezE1MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfNDVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTUwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl82MF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHX0NCXzkwX01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfMTIwX01CUFMsCisgICAgICAgICAgICAgICAgezEzMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfMTM1X01CUFMsCisgICAgICAgICAgICAgICAgezEyMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfMTUwX01CUFMsCisKKyNpZmRlZiBXTEFOX0ZFQVRVVVJFXzExQUMKKyAgICAgICAgICAgICAgICAvLy8xMUFDIHJhdGVzCisgICAgICAgICAgICAgICAvLy8xMUEgZHVwbGljYXRlIDgwTUh6IFJhdGVzCisgICAgICAgICAgICAgICAgezE3MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfNl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzlfTUJQUywKKyAgICAgICAgICAgICAgICB7MTcwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF8xMl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzE4X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfMjRfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF8zNl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzQ4X01CUFMsCisgICAgICAgICAgICAgICAgezE1MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfNTRfTUJQUywKKworICAgICAgICAgICAgICAgLy8vMTFhYyAyME1IWiBORywgU0cKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfMjBNSFpfTUNTXzFOU1NfQ0JfTkdJXzZfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19DQl9OR0lfMTNfTUJQUywKKyAgICAgICAgICAgICAgICB7MTM1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfMjBNSFpfTUNTXzFOU1NfQ0JfTkdJXzE5XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfMjBNSFpfTUNTXzFOU1NfQ0JfTkdJXzI2X01CUFMsCisgICAgICAgICAgICAgICAgezEyNTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX05HSV8zOV9NQlBTLAorICAgICAgICAgICAgICAgIHsxM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NfQ0JfU0dJXzI2MF9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9TR0lfMjkyXzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzMyNV9NQlBTLAorICAgICAgICAgICAgICAgIHsgOTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9TR0lfMzkwX01CUFMsCisgICAgICAgICAgICAgICAgeyA4MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV80MzNfM19NQlBTLAorI2VuZGlmCisgICAgICAgICAgICB9LCAgLy8gICAgUkZfU1VCQkFORF81X0xPV19HSFoKKyAgICAgICAgICAgIC8vIDVHIE1pZAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vODAyLjExYiBSYXRlcworICAgICAgICAgICAgICAgIHswfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQl9MT05HXzFfTUJQUywKKyAgICAgICAgICAgICAgICB7MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfTE9OR18yX01CUFMsCisgICAgICAgICAgICAgICAgezB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX0xPTkdfNV81X01CUFMsCisgICAgICAgICAgICAgICAgezB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX0xPTkdfMTFfTUJQUywKKyAgICAgICAgICAgICAgICB7MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfU0hPUlRfMl9NQlBTLAorICAgICAgICAgICAgICAgIHswfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQl9TSE9SVF81XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfU0hPUlRfMTFfTUJQUywKKworICAgICAgICAgICAgICAgIC8vLzExQSAyME1IeiBSYXRlcworICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV82X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzlfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfMTJfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfMThfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfMjRfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQ1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfMzZfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfNDhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfNTRfTUJQUywKKworICAgICAgICAgICAgICAgIC8vL0RVIFAgMTFBIDQwTUh6IFJhdGVzCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF82X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF85X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF8xMl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfMThfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzI0X01CUFMsCisgICAgICAgICAgICAgICAgezE0NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF8zNl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfNDhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzU0X01CUFMsCisKKyAgICAgICAgICAgICAgICAvLy9NQ1NTIEluZGV4ICMwLTcoMjAvNDBNSHopCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfNl81X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfMTNfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU18xOV81X01CUFMsCisgICAgICAgICAgICAgICAgezE1MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfMjZfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQ1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU18zOV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzUyX01CUFMsCisgICAgICAgICAgICAgICAgezEzNTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfNThfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzY1X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfN18yX01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfMTRfNF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzIxXzdfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR18yOF85X01CUFMsCisgICAgICAgICAgICAgICAgezE0NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfNDNfM19NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzU3XzhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR182NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzcyXzJfTUJQUywKKworICAgICAgICAgICAgICAgIC8vL01DU1MgSW5kZXggIzgtMTUoMjAvNDBNSHopCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfMTNfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzI3X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfNDBfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzU0X01CUFMsCisgICAgICAgICAgICAgICAgezE0NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfODFfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl8xMDhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl8xMjFfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzEzNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHX0NCXzE1X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfMzBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTUwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl80NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHX0NCXzYwX01CUFMsCisgICAgICAgICAgICAgICAgezE0NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfOTBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xMjBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xMzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTIwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xNTBfTUJQUywKKworI2lmZGVmIFdMQU5fRkVBVFVVUkVfMTExQUMKKyAgICAgICAgICAgICAgICAvLy8xMUNBQyByYXRlcworICAgICAgICAgICAgICAgLy8vMTFBZCBkdXBsaWNhdGUgODBNSHogUmF0ZXMKKyAgICAgICAgICAgICAgICB7MTcwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF82X01CUFMsCisgICAgICAgICAgICAgICAgezE3MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfOV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzEyX01CUFMsCisgICAgICAgICAgICAgICAgezE2NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfMThfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF8yNF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzM2X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfNDhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTUwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF81NF9NQlBTLAorCisgICAgICAgICAgICAgICAvLy8xMWEgYyAyME1IWiBORywgU0cKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfMjBNSFpfTUNTXzFOU1NfQ0JfTkdJXzZfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19DQl9OR0lfMTNfTUJQUywKKyAgICAgICAgICAgICAgICB7MTM1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfMjBNSFpfTUNTXzFOU1NfQ0JfTkdJXzE5XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfMjBNSFpfTUNTXzFOU1NfQ0JfTkdJXzI2X01CUFMsCisgICAgICAgICAgICAgICAgezEyNTB9LCAgICAvLyBI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80ME1IWl9NQ1NfMU5TU19DQl9TR0lfOTBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfNDBNSFpfTUNTXzFOU1NfQ0JfU0dJXzEyMF9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF80ME1IWl9NQ1NfMU5TU19DQl9TR0lfMTM1X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzQwTUhaX01DU18xTlNTX0NCX1NHSV8xNTBfTUJQUywKKyAgICAgICAgICAgICAgICB7IDkwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfNDBNSFpfTUNTXzFOU1NfQ0JfU0dJXzE4MF9NQlBTLAorICAgICAgICAgICAgICAgIHsgODAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF80ME1IWl9NQ1NfMU5TU19DQl9TR0lfMjAwX01CUFMsCisKKworICAgICAgICAgICAgICAgLy8vMTFhIGMgODBNSFogTkcsIFNHCisgICAgICAgICAgICAgICAgezEzMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8yOV8zX01CUFMsCisgICAgICAgICAgICAgICAgezExMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV81OF81X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV84N184X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8xMTdfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfTkdJXzE3NV81X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8yMzRfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfTkdJXzI2M18zX01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8yOTJfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsgOTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9OR0lfMzUxX01CUFMsCisgICAgICAgICAgICAgICAgeyA4MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8zOTBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzMyXzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTEwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzY1X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV85N181X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV8xMzBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzE5NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9TR0lfMjYwX01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV8yOTJfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9TR0lfMzI1X01CUFMsCisgICAgICAgICAgICAgICAgeyA5MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV8zOTBfTUJQUywKKyAgICAgICAgICAgICAgICB7IDgwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzQzM18zX01CUFMsCisjZW5kaWYKKyAgICAgICAgICAgIH0sICAvLyAgICAvLyAgICAgUkZfU1VCQkFORF81X01JRF9HSFoKKyAgICAgICAgICAgIC8vIDVHIEhpZ2gKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLzgwMi4xMWIgUmF0ZXMKKyAgICAgICAgICAgICAgICB7MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfTE9OR18xX01CUFMsCisgICAgICAgICAgICAgICAgezB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX0xPTkdfMl9NQlBTLAorICAgICAgICAgICAgICAgIHswfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQl9MT05HXzVfNV9NQlBTLAorICAgICAgICAgICAgICAgIHswfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQl9MT05HXzExX01CUFMsCisgICAgICAgICAgICAgICAgezB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX1NIT1JUXzJfTUJQUywKKyAgICAgICAgICAgICAgICB7MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfU0hPUlRfNV81X01CUFMsCisgICAgICAgICAgICAgICAgezB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX1NIT1JUXzExX01CUFMsCisKKyAgICAgICAgICAgICAgICAvLy8xMUEgMjBNSHogUmF0ZXMKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfNl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV85X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzEyX01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzE4X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzI0X01CUFMsCisgICAgICAgICAgICAgICAgezE0NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzM2X01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzQ4X01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzU0X01CUFMsCisKKyAgICAgICAgICAgICAgICAvLy9EVSBQIDExQSA0ME1IeiBSYXRlcworICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfNl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfOV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfMTJfTUJQUywKKyAgICAgICAgICAgICAgICB7MTY1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzE4X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF8yNF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfMzZfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzQ4X01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF81NF9NQlBTLAorCisgICAgICAgICAgICAgICAgLy8vTUNTUyBJbmRleCAjMC03KDIwLzQwTUh6KQorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzZfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzEzX01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfMTlfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzI2X01CUFMsCisgICAgICAgICAgICAgICAgezE0NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfMzlfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU181Ml9NQlBTLAorICAgICAgICAgICAgICAgIHsxMzUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzU4XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTIwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU182NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzdfMl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzE0XzRfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR18yMV83X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfMjhfOV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzQzXzNfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR181N184X01CUFMsCisgICAgICAgICAgICAgICAgezEzMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfNjVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTIwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR183Ml8yX01CUFMsCisKKyAgICAgICAgICAgICAgICAvLy9NQ1NTIEluZGV4ICM4LTE1KDIwLzQwTUh6KQorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzEzXzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl8yN19NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzQwXzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTUwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl81NF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzgxX01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfMTA4X01CUFMsCisgICAgICAgICAgICAgICAgezEzMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfMTIxXzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTIwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl8xMzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHX0NCXzMwX01CUFMsCisgICAgICAgICAgICAgICAgezE1MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfNDVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTUwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl82MF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHX0NCXzkwX01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfMTIwX01CUFMsCisgICAgICAgICAgICAgICAgezEzMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfMTM1X01CUFMsCisgICAgICAgICAgICAgICAgezEyMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfMTUwX01CUFMsCisKKyNpZmRlZiBXTEFOX0ZFQVRVVVJFXzExQUMKKyAgICAgICAgICAgICAgICAvLy8xMUNBQyByYXRlcworICAgICAgICAgICAgICAgLy8vMTFBZCBkdXBsaWNhdGUgODBNSHogUmF0ZXMKKyAgICAgICAgICAgICAgICB7MTcwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF82X01CUFMsCisgICAgICAgICAgICAgICAgezE3MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfOV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzEyX01CUFMsCisgICAgICAgICAgICAgICAgezE2NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfMThfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF8yNF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzM2X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfNDhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTUwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF81NF9NQlBTLAorCisgICAgICAgICAgICAgICAvLy8xMWEgYyAyME1IWiBORywgU0cKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfMjBNSFpfTUNTXzFOU1NfQ0JfTkdJXzZfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19DQl9OR0lfMTNfTUJQUywKKyAgICAgICAgICAgICAgICB7MTM1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfMjBNSFpfTUNTXzFOU1NfQ0JfTkdJXzE5XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSF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0NCX1NHSV82MF9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF80ME1IWl9NQ1NfMU5TU19DQl9TR0lfOTBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfNDBNSFpfTUNTXzFOU1NfQ0JfU0dJXzEyMF9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF80ME1IWl9NQ1NfMU5TU19DQl9TR0lfMTM1X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzQwTUhaX01DU18xTlNTX0NCX1NHSV8xNTBfTUJQUywKKyAgICAgICAgICAgICAgICB7IDkwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfNDBNSFpfTUNTXzFOU1NfQ0JfU0dJXzE4MF9NQlBTLAorICAgICAgICAgICAgICAgIHsgODAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF80ME1IWl9NQ1NfMU5TU19DQl9TR0lfMjAwX01CUFMsCisKKworICAgICAgICAgICAgICAgLy8vMTFhIGMgODBNSFogTkcsIFNHCisgICAgICAgICAgICAgICAgezEzMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8yOV8zX01CUFMsCisgICAgICAgICAgICAgICAgezExMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV81OF81X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV84N184X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8xMTdfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfTkdJXzE3NV81X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8yMzRfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfTkdJXzI2M18zX01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8yOTJfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsgOTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9OR0lfMzUxX01CUFMsCisgICAgICAgICAgICAgICAgeyA4MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8zOTBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzMyXzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTEwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzY1X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV85N181X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV8xMzBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzE5NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9TR0lfMjYwX01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV8yOTJfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9TR0lfMzI1X01CUFMsCisgICAgICAgICAgICAgICAgeyA5MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV8zOTBfTUJQUywKKyAgICAgICAgICAgICAgICB7IDgwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzQzM18zX01CUFMsCisjZW5kaWYKKyAgICAgICAgICAgIH0sICAvLyAgICBSRl9TVUJCQU5EXzVfSElHSF9HSFosCisgICAgICAgICAgICAvLyA0LjlHCisKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLzgwMi4xMWIgUmF0ZXMKKyAgICAgICAgICAgICAgICB7MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfTE9OR18xX01CUFMsCisgICAgICAgICAgICAgICAgezB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX0xPTkdfMl9NQlBTLAorICAgICAgICAgICAgICAgIHswfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQl9MT05HXzVfNV9NQlBTLAorICAgICAgICAgICAgICAgIHswfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQl9MT05HXzExX01CUFMsCisgICAgICAgICAgICAgICAgezB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX1NIT1JUXzJfTUJQUywKKyAgICAgICAgICAgICAgICB7MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfU0hPUlRfNV81X01CUFMsCisgICAgICAgICAgICAgICAgezB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX1NIT1JUXzExX01CUFMsCisKKyAgICAgICAgICAgICAgICAvLy8xMUEgMjBNSHogUmF0ZXMKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfNl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV85X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzEyX01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzE4X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzI0X01CUFMsCisgICAgICAgICAgICAgICAgezE0NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzM2X01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzQ4X01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzU0X01CUFMsCisKKyAgICAgICAgICAgICAgICAvLy9EVSBQIDExQSA0ME1IeiBSYXRlcworICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfNl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfOV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfMTJfTUJQUywKKyAgICAgICAgICAgICAgICB7MTY1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzE4X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF8yNF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfMzZfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzQ4X01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF81NF9NQlBTLAorCisgICAgICAgICAgICAgICAgLy8vTUNTUyBJbmRleCAjMC03KDIwLzQwTUh6KQorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzZfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzEzX01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfMTlfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzI2X01CUFMsCisgICAgICAgICAgICAgICAgezE0NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfMzlfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU181Ml9NQlBTLAorICAgICAgICAgICAgICAgIHsxMzUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzU4XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTIwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU182NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzdfMl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzE0XzRfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR18yMV83X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfMjhfOV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzQzXzNfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR181N184X01CUFMsCisgICAgICAgICAgICAgICAgezEzMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfNjVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTIwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR183Ml8yX01CUFMsCisKKyAgICAgICAgICAgICAgICAvLy9NQ1NTIEluZGV4ICM4LTE1KDIwLzQwTUh6KQorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzEzXzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl8yN19NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzQwXzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTUwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl81NF9NQlBTLAorICAgICAgICA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QVRVVVJFXzExQUMKKyAgICAgICAgICAgICAgICAvLy8xMUNBQyByYXRlcworICAgICAgICAgICAgICAgLy8vMTFBZCBkdXBsaWNhdGUgODBNSHogUmF0ZXMKKyAgICAgICAgICAgICAgICB7MTcwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF82X01CUFMsCisgICAgICAgICAgICAgICAgezE3MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfOV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzEyX01CUFMsCisgICAgICAgICAgICAgICAgezE2NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfMThfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF8yNF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzM2X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfNDhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTUwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF81NF9NQlBTLAorCisgICAgICAgICAgICAgICAvLy8xMWEgYyAyME1IWiBORywgU0cKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfMjBNSFpfTUNTXzFOU1NfQ0JfTkdJXzZfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19DQl9OR0lfMTNfTUJQUywKKyAgICAgICAgICAgICAgICB7MTM1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfMjBNSFpfTUNTXzFOU1NfQ0JfTkdJXz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AgICAgICAgICAgezEyNTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzQwTUhaX01DU18xTlNTX0NCX1NHSV82MF9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF80ME1IWl9NQ1NfMU5TU19DQl9TR0lfOTBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfNDBNSFpfTUNTXzFOU1NfQ0JfU0dJXzEyMF9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF80ME1IWl9NQ1NfMU5TU19DQl9TR0lfMTM1X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzQwTUhaX01DU18xTlNTX0NCX1NHSV8xNTBfTUJQUywKKyAgICAgICAgICAgICAgICB7IDkwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfNDBNSFpfTUNTXzFOU1NfQ0JfU0dJXzE4MF9NQlBTLAorICAgICAgICAgICAgICAgIHsgODAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF80ME1IWl9NQ1NfMU5TU19DQl9TR0lfMjAwX01CUFMsCisKKworICAgICAgICAgICAgICAgLy8vMTFhIGMgODBNSFogTkcsIFNHCisgICAgICAgICAgICAgICAgezEzMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8yOV8zX01CUFMsCisgICAgICAgICAgICAgICAgezExMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV81OF81X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV84N184X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8xMTdfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfTkdJXzE3NV81X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8yMzRfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfTkdJXzI2M18zX01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8yOTJfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsgOTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9OR0lfMzUxX01CUFMsCisgICAgICAgICAgICAgICAgeyA4MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8zOTBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzMyXzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTEwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzY1X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV85N181X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV8xMzBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzE5NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9TR0lfMjYwX01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV8yOTJfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9TR0lfMzI1X01CUFMsCisgICAgICAgICAgICAgICAgeyA5MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV8zOTBfTUJQUywKKyAgICAgICAgICAgICAgICB7IDgwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzQzM18zX01CUFMsCisjZW5kaWYKKyAgICAgICAgICAgIH0sICAvLyAgICBSRl9TVUJCQU5EXzRfOV9HSFoKKyAgICAgICAgfSwKKworICAgICAgICAvLyBOVl9UQUJMRV9SRUdVTEFUT1JZX0RPTUFJTlMKKyAgICAgICAgeworICAgICAgICAgICAgLy8gdHlwZWRlZiBzdHJ1Y3QKKyAgICAgICAgICAgIC8vIHsKKyAgICAgICAgICAgIC8vICAgICB0QU5JX0JPT0xFQU4gZW5hYmxlZDsKKyAgICAgICAgICAgIC8vICAgICB0UG93ZXJkQm0gcHdyTGltaXQ7CisgICAgICAgICAgICAvLyB9c1JlZ3VsYXRvcnlDaGFubmVsOworCisgICAgICAgICAgICAvLyB0eXBlZGVmIHN0cnVjdAorICAgICAgICAgICAgLy8geworICAgICAgICAgICAgLy8gICAgIHNSZWd1bGF0b3J5Q2hhbm5lbCBjaGFubmVsc1tOVU1fUkZfQ0hBTk5FTFNdOworICAgICAgICAgICAgLy8gICAgIHVBYnNQd3JQcmVjaXNpb24gYW50ZW5uYUdhaW5bTlVNX1JGX1NVQkJBTkRTXTsKKyAgICAgICAgICAgIC8vICAgICB1QWJzUHdyUHJlY2lzaW9uIGJSYXRlUG93ZXJPZmZzZXRbTlVNXzJfNEdIWl9DSEFOTkVMU107CisgICAgICAgICAgICAvLyB9c1JlZ3VsYXRvcnlEb21haW5zOworCisgICAgICAgICAgICAvL3NSZWd1bGF0b3J5RG9tYWlucyAgcmVnRG9tYWluc1tOVU1fUkVHX0RPTUFJTlNdOworCisKKyAgICAgICAgICAgIHsgICAvLyBSRUdfRE9NQUlOX0ZDQyBzdGFydAorICAgICAgICAgICAgICAgIHsgLy9zUmVndWxhdG9yeUNoYW5uZWwgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy9lbmFibGVkLCBwd3JMaW1pdAorICAgICAgICAgICAgICAgICAgICAvLzIuNEdIeiBCYW5kLCBub25lIENCCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjN9LCAgICAgICAgICAgLy9SRl9DSEFOXzEsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjN9LCAgICAgICAgICAgLy9SRl9DSEFOXzIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjN9LCAgICAgICAgICAgLy9SRl9DSEFOXzMsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjN9LCAgICAgICAgICAgLy9SRl9DSEFOXzQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjN9LCAgICAgICAgICAgLy9SRl9DSEFOXzUsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjN9LCAgICAgICAgICAgLy9SRl9DSEFOXzYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjN9LCAgICAgICAgICAgLy9SRl9DSEFOXzcsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjN9LCAgICAgICAgICAgLy9SRl9DSEFOXzgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjN9LCAgICAgICAgICAgLy9SRl9DSEFOXzksCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjJ9LCAgICAgICAgICAgLy9SRl9DSEFOXzEwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIyfSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAzMH0sICAgICAgICAgICAvL1JGX0NIQU5fMTMsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgIC8vUkZfQ0hBTl8xNCwKKworICAgICAgICAgICAgICAgICAgICAvLzQuOUdIeiBCYW5kLCBub25lIENCCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjQwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzI0NCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yNDgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjUyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzIwOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yMTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjE2LAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBMb3cgJiBNaWQgVS1OSUkgQmFuZCwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE3fSwgICAgICAgICAgICAgLy9SRl9DSEFOXzM2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE3fSwgICAgICAgICAgICAgLy9SRl9DSEFOXzQwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE3fSwgICAgICAgICAgICAgLy9SRl9DSEFOXzQ0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE3fSwgICAgICAgICAgICAgLy9SRl9DSEFOXzQ4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzUyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzU2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzYwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzY0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBNaWQgQmFuZCAtIEVUU0ksIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyMn0sICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RGUywgMjR9LCAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTA0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEwOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RGUywgMjR9LCAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTE2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAgLy9SRl9DSEFOXzEyMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMjQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgICAvL1JGX0NIQU5fMTI4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEzMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMzYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RGUywgMjR9LCAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQwLAorI2lmZGVmIEZFQVRVUkVfV0xBTl9DSDE0NAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzE0NCwKKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fQ0gxNDQgKi8KKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogSGlnaCBVLU5JSSBCYW5kLCBub25lIENCCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNDksCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNTMsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNTcsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNjEsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMH0sICAgICAgICAgICAgIC8vUkZfQ0hBTl8xNjUsCisKKyAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZCwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMn0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMn0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfOSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMSwKKworICAgICAgICAgICAgICAgICAgICAvLyA0LjlHSHogQmFuZCwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjQyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yNDYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzI1MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjEwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yMTQsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IExvdyAmIE1pZCBVLU5JSSBCYW5kLCBjaGFubmVsIGJvbmRlZCBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8zOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNDIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzQ2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF81MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNTQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzU4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI1fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF82MiwKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogTWlkIEJhbmQgLSBFVFNJLCBjaGFubmVsIGJvbmRlZCBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTAyCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMDYKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzExMAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMTQKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTE4CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEyMgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMjYKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTMwCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMzQKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEzOAorI2lmZGVmIEZFQVRVUkVfV0xBTl9DSDE0NAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTQyCisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0NIMTQ0ICovCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBIaWdoIFUtTklJIEJhbmQsICBjaGFubmVsIGJvbmRlZCBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTUxLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTU1LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTU5LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTYzCisgICAgICAgICAgICAgICAgfSwgLy9zUmVndWxhdG9yeUNoYW5uZWwgZW5kCisKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHswfSwgIC8vIFJGX1NVQkJBTkRfMl80X0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0sICAgLy8gUkZfU1VCQkFORF81X0xPV19HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9LCAgIC8vIFJGX1NVQkJBTkRfNV9NSURfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSwgICAvLyBSRl9TVUJCQU5EXzVfSElHSF9HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9ICAgIC8vIFJGX1NVQkJBTkRfNF85X0dIWgorICAgICAgICAgICAgICAgIH0sCisKKyAgICAgICAgICAgICAgICB7IC8vIGJSYXRlUG93ZXJPZmZzZXQgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSwgLy8gYlJhdGVQb3dlck9mZnNldCBlbmQKKworICAgICAgICAgICAgICAgIHsgLy8gZ25SYXRlUG93ZXJPZmZzZXQgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy9hcHBseSB0byBhbGwgMi40IGFuZCA1RyBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSAvLyBnblJhdGVQb3dlck9mZnNldCBlbmQKKyAgICAgICAgICAgIH0sIC8vIFJFR19ET01BSU5fRkNDIGVuZAorCisgICAgICAgICAgICB7ICAgLy8gUkVHX0RPTUFJTl9FVFNJIHN0YXJ0CisgICAgICAgICAgICAgICAgeyAvL3NSZWd1bGF0b3J5Q2hhbm5lbCBzdGFydAorICAgICAgICAgICAgICAgICAgICAvL2VuYWJsZWQsIHB3ckxpbWl0CisgICAgICAgICAgICAgICAgICAgIC8vMi40R0h6IEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fMSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fNSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fNywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fOSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fMTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjB9LCAgICAgICAgICAgLy9SRl9DSEFOXzExLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE5fSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxOX0sICAgICAgICAgICAvL1JGX0NIQU5fMTMsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgLy9SRl9DSEFOXzE0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNC45R0h6IEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzI0MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzI0NCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzI0OCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzI1MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzIwOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzIxMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzIxNiwKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogTG93ICYgTWlkIFUtTklJIEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzM2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fNDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl80NCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzQ4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzUyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzU2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzYwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzY0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBNaWQgQmFuZCAtIEVUU0ksIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTA0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzEwOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTE2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTIwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTI0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTI4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzEzMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMzYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTQwLAorI2lmZGVmIEZFQVRVUkVfV0xBTl9DSDE0NAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzE0NCwKKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fQ0gxNDQgKi8KKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogSGlnaCBVLU5JSSBCYW5kLCBub25lIENCCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNDksCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNTMsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNTcsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNjEsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNjUsCisKKyAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZCwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfOSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzExLAorCisgICAgICAgICAgICAgICAgICAgIC8vIDQuOUdIeiBCYW5kLCBjaGFubmVsIGJvbmRlZCBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yNDIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzI0NiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjUwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yMTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzIxNCwKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogTG93ICYgTWlkIFUtTklJIEJhbmQsIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzM4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF80MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNDYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzUwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF81NCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNTgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzYyLAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBNaWQgQmFuZCAtIEVUU0ksIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMDIKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEwNgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTEwCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzExNAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMTgKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTIyCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEyNgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMzAKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEzNAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTM4CisjaWZkZWYgRkVBVFVSRV9XTEFOX0NIMTQ0CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xNDIKKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fQ0gxNDQgKi8KKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogSGlnaCBVLU5JSSBCYW5kLCAgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTUxLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xNTUsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE1OSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE2MworICAgICAgICAgICAgICAgIH0sIC8vc1JlZ3VsYXRvcnlDaGFubmVsIGVuZAorCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDAgfSwgIC8vIFJGX1NVQkJBTkRfMl80X0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0sICAgLy8gUkZfU1VCQkFORF81X0xPV19HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9LCAgIC8vIFJGX1NVQkJBTkRfNV9NSURfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSwgICAvLyBSRl9TVUJCQU5EXzVfSElHSF9HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9ICAgIC8vIFJGX1NVQkJBTkRfNF85X0dIWgorICAgICAgICAgICAgICAgIH0sCisKKyAgICAgICAgICAgICAgICB7IC8vIGJSYXRlUG93ZXJPZmZzZXQgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSwgLy8gYlJhdGVQb3dlck9mZnNldCBlbmQKKworICAgICAgICAgICAgICAgIHsgLy8gZ25SYXRlUG93ZXJPZmZzZXQgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy9hcHBseSB0byBhbGwgMi40IGFuZCA1RyBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSAvLyBnblJhdGVQb3dlck9mZnNldCBlbmQKKyAgICAgICAgICAgIH0sIC8vIFJFR19ET01BSU5fRVRTSSBlbmQKKworICAgICAgICAgICAgeyAgIC8vIFJFR19ET01BSU5fSkFQQU4gc3RhcnQKKyAgICAgICAgICAgICAgICB7IC8vc1JlZ3VsYXRvcnlDaGFubmVsIHN0YXJ0CisgICAgICAgICAgICAgICAgICAgIC8vZW5hYmxlZCwgcHdyTGltaXQKKyAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZCwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjB9LCAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxOH0sICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisKKyAgICAgICAgICAgICAgICAgICAgLy80LjlHSHogQmFuZCwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzI0MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yNDQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjQ4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzI1MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yMDgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjEyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzIxNiwKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogTG93ICYgTWlkIFUtTklJIEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxN30sICAgICAgICAgICAgLy9SRl9DSEFOXzM2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE3fSwgICAgICAgICAgICAvL1JGX0NIQU5fNDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl80NCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxN30sICAgICAgICAgICAgLy9SRl9DSEFOXzQ4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fNTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RGUywgMjR9LCAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81NiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzYwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fNjQsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IE1pZCBCYW5kIC0gRVRTSSwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDIyfSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTAwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTA0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTA4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTE2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDB9LCAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTIwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDB9LCAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTI0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDB9LCAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTI4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTMyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTM2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQwLAorI2lmZGVmIEZFQVRVUkVfV0xBTl9DSDE0NAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzE0NCwKKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fQ0gxNDQgKi8KKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogSGlnaCBVLU5JSSBCYW5kLCBub25lIENCCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTQ5LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE1MywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNTcsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTYxLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTY1LAorCisgICAgICAgICAgICAgICAgICAgIC8vMi40R0h6IEJhbmQsIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjJ9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzMsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzUsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzcsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjJ9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzksCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTEsCisKKyAgICAgICAgICAgICAgICAgICAgLy8gNC45R0h6IEJhbmQsIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzI0MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjQ2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yNTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzIxMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjE0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBMb3cgJiBNaWQgVS1OSUkgQmFuZCwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMzgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzQyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF80NiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzU0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF81OCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyNX0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNjIsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IE1pZCBCYW5kIC0gRVRTSSwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEwMgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTA2CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMTAKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTE0CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzExOAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMjIKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTI2CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEzMAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTM0CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMzgKKyNpZmRlZiBGRUFUVVJFX1dMQU5fQ0gxNDQKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE0MgorI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9DSDE0NCAqLworCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBIaWdoIFUtTklJIEJhbmQsICBjaGFubmVsIGJvbmRlZCBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTUxLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTU1LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTU5LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTYzCisgICAgICAgICAgICAgICAgfSwgLy9zUmVndWxhdG9yeUNoYW5uZWwgZW5kCisKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgLy8gUkZfU1VCQkFORF8yXzRfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSwgICAvLyBSRl9TVUJCQU5EXzVfTE9XX0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0sICAgLy8gUkZfU1VCQkFORF81X01JRF9HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9LCAgIC8vIFJGX1NVQkJBTkRfNV9ISUdIX0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0gICAgLy8gUkZfU1VCQkFORF80XzlfR0haCisgICAgICAgICAgICAgICAgfSwKKworICAgICAgICAgICAgICAgIHsgLy8gYlJhdGVQb3dlck9mZnNldCBzdGFydAorICAgICAgICAgICAgICAgICAgICAvLzIuNEdIeiBCYW5kCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzIsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzMsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzQsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzUsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzYsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzcsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzgsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzksCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEwLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTIsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEzLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xNCwKKyAgICAgICAgICAgICAgICB9LCAvLyBiUmF0ZVBvd2VyT2Zmc2V0IGVuZAorCisgICAgICAgICAgICAgICAgeyAvLyBnblJhdGVQb3dlck9mZnNldCBzdGFydAorICAgICAgICAgICAgICAgICAgICAvL2FwcGx5IHRvIGFsbCAyLjQgYW5kIDVHIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzIsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzMsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzQsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzUsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzYsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzcsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzgsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzksCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEwLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTIsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEzLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xNCwKKyAgICAgICAgICAgICAgICB9IC8vIGduUmF0ZVBvd2VyT2Zmc2V0IGVuZAorICAgICAgICAgICAgfSwgLy8gUkVHX0RPTUFJTl9KQVBBTiBlbmQKKworICAgICAgICAgICAgeyAgIC8vIFJFR19ET01BSU5fV09STEQgc3RhcnQKKyAgICAgICAgICAgICAgICB7IC8vc1JlZ3VsYXRvcnlDaGFubmVsIHN0YXJ0CisgICAgICAgICAgICAgICAgICAgIC8vZW5hYmxlZCwgcHdyTGltaXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vMi40R0h6IEJhbmQKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fMSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fNSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fNywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fOSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fMTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTZ9LCAgICAgICAgICAgLy9SRl9DSEFOXzExLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE2fSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fMTMsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgLy9SRl9DSEFOXzE0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNC45R0h6IEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yNDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjQ0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzI0OCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yNTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjA4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzIxMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yMTYsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IExvdyAmIE1pZCBVLU5JSSBCYW5kLCBub25lIENCCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8zNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxN30sICAgICAgICAgICAgLy9SRl9DSEFOXzQwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE3fSwgICAgICAgICAgICAvL1JGX0NIQU5fNDQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl80OCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzUyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fNTYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RGUywgMjR9LCAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzY0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBNaWQgQmFuZCAtIEVUU0ksIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyMn0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEwMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEwNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEwOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzExMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzExNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAwfSwgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAwfSwgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAwfSwgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEzMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEzNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzE0MCwKKyNpZmRlZiBGRUFUVVJFX1dMQU5fQ0gxNDQKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgLy9SRl9DSEFOXzE0NCwKKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fQ0gxNDQgKi8KKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IEhpZ2ggVS1OSUkgQmFuZCwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE0OSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNTMsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTU3LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE2MSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE2NSwKKworICAgICAgICAgICAgICAgICAgICAvLzIuNEdIeiBCYW5kLCBjaGFubmVsIGJvbmRlZCBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIyfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8zLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF80LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF81LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF82LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF83LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF84LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIyfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF85LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzExLAorCisgICAgICAgICAgICAgICAgICAgIC8vIDQuOUdIeiBCYW5kLCBjaGFubmVsIGJvbmRlZCBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yNDIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzI0NiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjUwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yMTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzIxNCwKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogTG93ICYgTWlkIFUtTklJIEJhbmQsIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzM4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF80MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNDYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzUwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF81NCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNTgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjV9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzYyLAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBNaWQgQmFuZCAtIEVUU0ksIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMDIKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEwNgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTEwCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzExNAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMTgKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTIyCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEyNgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMzAKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEzNAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTM4CisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IEhpZ2ggVS1OSUkgQmFuZCwgIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xNTEsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xNTUsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xNTksCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xNjMKKyAgICAgICAgICAgICAgICB9LCAvL3NSZWd1bGF0b3J5Q2hhbm5lbCBlbmQKKworICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgezB9LCAgIC8vIFJGX1NVQkJBTkRfMl80X0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0sICAgLy8gUkZfU1VCQkFORF81X0xPV19HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9LCAgIC8vIFJGX1NVQkJBTkRfNV9NSURfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSwgICAvLyBSRl9TVUJCQU5EXzVfSElHSF9HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9ICAgIC8vIFJGX1NVQkJBTkRfNF85X0dIWgorICAgICAgICAgICAgICAgIH0sCisKKyAgICAgICAgICAgICAgICB7IC8vIGJSYXRlUG93ZXJPZmZzZXQgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSwgLy8gYlJhdGVQb3dlck9mZnNldCBlbmQKKworICAgICAgICAgICAgICAgIHsgLy8gZ25SYXRlUG93ZXJPZmZzZXQgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy9hcHBseSB0byBhbGwgMi40IGFuZCA1RyBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSAvLyBnblJhdGVQb3dlck9mZnNldCBlbmQKKyAgICAgICAgICAgIH0sIC8vIFJFR19ET01BSU5fV09STEQgZW5kCisKKyAgICAgICAgICAgIHsgICAvLyBSRUdfRE9NQUlOX05fQU1FUl9FWENfRkNDIHN0YXJ0CisgICAgICAgICAgICAgICAgeyAvL3NSZWd1bGF0b3J5Q2hhbm5lbCBzdGFydAorICAgICAgICAgICAgICAgICAgICAvL2VuYWJsZWQsIHB3ckxpbWl0CisgICAgICAgICAgICAgICAgICAgIC8vMi40R0h6IEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fMSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fNSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fNywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fOSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fMTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTZ9LCAgICAgICAgICAgLy9SRl9DSEFOXzExLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAzMH0sICAgICAgICAgICAvL1JGX0NIQU5fMTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgLy9SRl9DSEFOXzE0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNC45R0h6IEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yNDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjQ0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzI0OCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yNTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjA4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzIxMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yMTYsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IExvdyAmIE1pZCBVLU5JSSBCYW5kLCBub25lIENCCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8zNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxN30sICAgICAgICAgICAgLy9SRl9DSEFOXzQwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE3fSwgICAgICAgICAgICAvL1JGX0NIQU5fNDQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl80OCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl81MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl81NiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl82MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl82NCwKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogTWlkIEJhbmQgLSBFVFNJLCBub25lIENCCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIyfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTAwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzEwNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMDgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fMTEyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzExNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzEyMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzEyNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzEyOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMzIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fMTM2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE0MCwKKyNpZmRlZiBGRUFUVVJFX1dMQU5fQ0gxNDQKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNDQsCisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0NIMTQ0ICovCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IEhpZ2ggVS1OSUkgQmFuZCwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTQ5LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTUzLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTU3LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTYxLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNjUsCisKKyAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZCwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMn0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMn0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfOSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMSwKKworICAgICAgICAgICAgICAgICAgICAvLyA0LjlHSHogQmFuZCwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjQyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yNDYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzI1MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjEwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yMTQsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IExvdyAmIE1pZCBVLU5JSSBCYW5kLCBjaGFubmVsIGJvbmRlZCBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8zOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNDIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzQ2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF81MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNTQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzU4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI1fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF82MiwKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogTWlkIEJhbmQgLSBFVFNJLCBjaGFubmVsIGJvbmRlZCBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTAyCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMDYKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzExMAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMTQKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTE4CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEyMgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMjYKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTMwCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMzQKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEzOAorI2lmZGVmIEZFQVRVUkVfV0xBTl9DSDE0NAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTQyCisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0NIMTQ0ICovCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IEhpZ2ggVS1OSUkgQmFuZCwgIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xNTEsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xNTUsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xNTksCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xNjMKKyAgICAgICAgICAgICAgICB9LCAvL3NSZWd1bGF0b3J5Q2hhbm5lbCBlbmQKKworICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAvLyBSRl9TVUJCQU5EXzJfNF9HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9LCAgIC8vIFJGX1NVQkJBTkRfNV9MT1dfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSwgICAvLyBSRl9TVUJCQU5EXzVfTUlEX0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0sICAgLy8gUkZfU1VCQkFORF81X0hJR0hfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSAgICAvLyBSRl9TVUJCQU5EXzRfOV9HSFoKKyAgICAgICAgICAgICAgICB9LAorCisgICAgICAgICAgICAgICAgeyAvLyBiUmF0ZVBvd2VyT2Zmc2V0IHN0YXJ0CisgICAgICAgICAgICAgICAgICAgIC8vMi40R0h6IEJhbmQKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fOCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fOSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTAsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzExLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTMsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzE0LAorICAgICAgICAgICAgICAgIH0sIC8vIGJSYXRlUG93ZXJPZmZzZXQgZW5kCisKKyAgICAgICAgICAgICAgICB7IC8vIGduUmF0ZVBvd2VyT2Zmc2V0IHN0YXJ0CisgICAgICAgICAgICAgICAgICAgIC8vYXBwbHkgdG8gYWxsIDIuNCBhbmQgNUcgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fOCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fOSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTAsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzExLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTMsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzE0LAorICAgICAgICAgICAgICAgIH0gLy8gZ25SYXRlUG93ZXJPZmZzZXQgZW5kCisgICAgICAgICAgICB9LCAgIC8vIFJFR19ET01BSU5fTl9BTUVSX0VYQ19GQ0MgZW5kCisKKyAgICAgICAgICAgIHsgICAvLyBSRUdfRE9NQUlOX0FQQUMgc3RhcnQKKyAgICAgICAgICAgICAgICB7IC8vc1JlZ3VsYXRvcnlDaGFubmVsIHN0YXJ0CisgICAgICAgICAgICAgICAgICAgIC8vZW5hYmxlZCwgcHdyTGltaXQKKyAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZCwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI2fSwgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI2fSwgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI2fSwgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI2fSwgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI2fSwgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI2fSwgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI2fSwgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI2fSwgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI2fSwgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI2fSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyNn0sICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjZ9LCAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE2fSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisKKyAgICAgICAgICAgICAgICAgICAgLy80LjlHSHogQmFuZCwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzI0MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yNDQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjQ4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzI1MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yMDgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjEyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzIxNiwKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogTG93ICYgTWlkIFUtTklJIEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxN30sICAgICAgICAgICAgLy9SRl9DSEFOXzM2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE3fSwgICAgICAgICAgICAvL1JGX0NIQU5fNDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl80NCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxN30sICAgICAgICAgICAgLy9SRl9DSEFOXzQ4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzUyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzU2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzYwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzY0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBNaWQgQmFuZCAtIEVUU0ksIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjJ9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fMTA0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzEwOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fMTE2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTIwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTI0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTI4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzEzMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMzYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fMTQwLAorI2lmZGVmIEZFQVRVUkVfV0xBTl9DSDE0NAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzE0NCwKKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fQ0gxNDQgKi8KKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogSGlnaCBVLU5JSSBCYW5kLCBub25lIENCCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNDksCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNTMsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNTcsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNjEsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE2NSwKKworICAgICAgICAgICAgICAgICAgICAvLzIuNEdIeiBCYW5kLCBjaGFubmVsIGJvbmRlZCBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIyfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8zLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF80LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF81LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF82LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF83LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF84LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIyfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF85LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzExLAorCisgICAgICAgICAgICAgICAgICAgIC8vIDQuOUdIeiBCYW5kLCBjaGFubmVsIGJvbmRlZCBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yNDIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzI0NiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjUwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yMTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzIxNCwKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogTG93ICYgTWlkIFUtTklJIEJhbmQsIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzM4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF80MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNDYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzUwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF81NCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNTgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjV9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzYyLAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBNaWQgQmFuZCAtIEVUU0ksIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMDIKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEwNgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTEwCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzExNAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMTgKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTIyCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEyNgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMzAKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEzNAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTM4CisjaWZkZWYgRkVBVFVSRV9XTEFOX0NIMTQ0CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xNDIKKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fQ0gxNDQgKi8KKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogSGlnaCBVLU5JSSBCYW5kLCAgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE1MSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE1NSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE1OSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE2MworICAgICAgICAgICAgICAgIH0sIC8vc1JlZ3VsYXRvcnlDaGFubmVsIGVuZAorCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7MH0sICAgLy8gUkZfU1VCQkFORF8yXzRfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSwgICAvLyBSRl9TVUJCQU5EXzVfTE9XX0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0sICAgLy8gUkZfU1VCQkFORF81X01JRF9HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9LCAgIC8vIFJGX1NVQkJBTkRfNV9ISUdIX0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0gICAgLy8gUkZfU1VCQkFORF80XzlfR0haCisgICAgICAgICAgICAgICAgfSwKKworICAgICAgICAgICAgICAgIHsgLy8gYlJhdGVQb3dlck9mZnNldCBzdGFydAorICAgICAgICAgICAgICAgICAgICAvLzIuNEdIeiBCYW5kCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzIsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzMsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzQsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzUsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzYsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzcsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzgsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzksCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEwLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTIsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEzLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xNCwKKyAgICAgICAgICAgICAgICB9LCAvLyBiUmF0ZVBvd2VyT2Zmc2V0IGVuZAorCisgICAgICAgICAgICAgICAgeyAvLyBnblJhdGVQb3dlck9mZnNldCBzdGFydAorICAgICAgICAgICAgICAgICAgICAvL2FwcGx5IHRvIGFsbCAyLjQgYW5kIDVHIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzIsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzMsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzQsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzUsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzYsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzcsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzgsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzksCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEwLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTIsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEzLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xNCwKKyAgICAgICAgICAgICAgICB9IC8vIGduUmF0ZVBvd2VyT2Zmc2V0IGVuZAorICAgICAgICAgICAgfSwgLy8gUkVHX0RPTUFJTl9BUEFDIGVuZAorCisgICAgICAgICAgICB7ICAgLy8gUkVHX0RPTUFJTl9LT1JFQSBzdGFydAorICAgICAgICAgICAgICAgIHsgLy9zUmVndWxhdG9yeUNoYW5uZWwgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy9lbmFibGVkLCBwd3JMaW1pdAorICAgICAgICAgICAgICAgICAgICAvLzIuNEdIeiBCYW5kLCBub25lIENCCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTV9LCAgICAgICAgICAgLy9SRl9DSEFOXzEsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTV9LCAgICAgICAgICAgLy9SRl9DSEFOXzIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTV9LCAgICAgICAgICAgLy9SRl9DSEFOXzMsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTV9LCAgICAgICAgICAgLy9SRl9DSEFOXzQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTV9LCAgICAgICAgICAgLy9SRl9DSEFOXzUsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTV9LCAgICAgICAgICAgLy9SRl9DSEFOXzYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTV9LCAgICAgICAgICAgLy9SRl9DSEFOXzcsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTV9LCAgICAgICAgICAgLy9SRl9DSEFOXzgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTV9LCAgICAgICAgICAgLy9SRl9DSEFOXzksCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTV9LCAgICAgICAgICAgLy9SRl9DSEFOXzEwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE1fSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNX0sICAgICAgICAgICAvL1JGX0NIQU5fMTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTV9LCAgICAgICAgICAgLy9SRl9DSEFOXzEzLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgIC8vUkZfQ0hBTl8xNCwKKworICAgICAgICAgICAgICAgICAgICAvLzQuOUdIeiBCYW5kLCBub25lIENCCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjQwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzI0NCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yNDgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjUyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzIwOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yMTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjE2LAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBMb3cgJiBNaWQgVS1OSUkgQmFuZCwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE3fSwgICAgICAgICAgICAvL1JGX0NIQU5fMzYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl80MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxN30sICAgICAgICAgICAgLy9SRl9DSEFOXzQ0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE3fSwgICAgICAgICAgICAvL1JGX0NIQU5fNDgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fNTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fNTYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fNjAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fNjQsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IE1pZCBCYW5kIC0gRVRTSSwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyMn0sICAgICAgICAgICAgLy9SRl9DSEFOXzEwMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMDQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fMTA4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzExMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMTYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMjAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMjQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMjgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fMTMyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzEzNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNDAsCisjaWZkZWYgRkVBVFVSRV9XTEFOX0NIMTQ0CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fMTQ0LAorI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9DSDE0NCAqLworCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBIaWdoIFUtTklJIEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE0OSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE1MywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE1NywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE2MSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTY1LAorCisgICAgICAgICAgICAgICAgICAgIC8vMi40R0h6IEJhbmQsIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjJ9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzMsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzUsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzcsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjJ9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzksCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTEsCisKKyAgICAgICAgICAgICAgICAgICAgLy8gNC45R0h6IEJhbmQsIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzI0MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjQ2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yNTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzIxMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjE0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBMb3cgJiBNaWQgVS1OSUkgQmFuZCwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMzgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzQyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF80NiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzU0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF81OCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyNX0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNjIsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IE1pZCBCYW5kIC0gRVRTSSwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEwMgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTA2CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMTAKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTE0CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzExOAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMjIKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTI2CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEzMAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTM0CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMzgKKyNpZmRlZiBGRUFUVVJFX1dMQU5fQ0gxNDQKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE0MgorI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9DSDE0NCAqLworCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBIaWdoIFUtTklJIEJhbmQsICBjaGFubmVsIGJvbmRlZCBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTUxLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTU1LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTU5LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTYzCisgICAgICAgICAgICAgICAgfSwgLy9zUmVndWxhdG9yeUNoYW5uZWwgZW5kCisKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHswfSwgICAvLyBSRl9TVUJCQU5EXzJfNF9HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9LCAgIC8vIFJGX1NVQkJBTkRfNV9MT1dfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSwgICAvLyBSRl9TVUJCQU5EXzVfTUlEX0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0sICAgLy8gUkZfU1VCQkFORF81X0hJR0hfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSAgICAvLyBSRl9TVUJCQU5EXzRfOV9HSFoKKyAgICAgICAgICAgICAgICB9LAorCisgICAgICAgICAgICAgICAgeyAvLyBiUmF0ZVBvd2VyT2Zmc2V0IHN0YXJ0CisgICAgICAgICAgICAgICAgICAgIC8vMi40R0h6IEJhbmQKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fOCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fOSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTAsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzExLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTMsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzE0LAorICAgICAgICAgICAgICAgIH0sIC8vIGJSYXRlUG93ZXJPZmZzZXQgZW5kCisKKyAgICAgICAgICAgICAgICB7IC8vIGduUmF0ZVBvd2VyT2Zmc2V0IHN0YXJ0CisgICAgICAgICAgICAgICAgICAgIC8vYXBwbHkgdG8gYWxsIDIuNCBhbmQgNUcgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fOCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fOSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTAsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzExLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTMsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzE0LAorICAgICAgICAgICAgICAgIH0gLy8gZ25SYXRlUG93ZXJPZmZzZXQgZW5kCisgICAgICAgICAgICB9LCAvLyBSRUdfRE9NQUlOX0tPUkVBIGVuZAorCisgICAgICAgICAgICB7ICAgLy8gUkVHX0RPTUFJTl9ISV81R0haIHN0YXJ0CisgICAgICAgICAgICAgICAgeyAvL3NSZWd1bGF0b3J5Q2hhbm5lbCBzdGFydAorICAgICAgICAgICAgICAgICAgICAvL2VuYWJsZWQsIHB3ckxpbWl0CisgICAgICAgICAgICAgICAgICAgIC8vMi40R0h6IEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNH0sICAgICAgICAgICAvL1JGX0NIQU5fMSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNH0sICAgICAgICAgICAvL1JGX0NIQU5fMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNH0sICAgICAgICAgICAvL1JGX0NIQU5fMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNH0sICAgICAgICAgICAvL1JGX0NIQU5fNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNH0sICAgICAgICAgICAvL1JGX0NIQU5fNSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNH0sICAgICAgICAgICAvL1JGX0NIQU5fNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNH0sICAgICAgICAgICAvL1JGX0NIQU5fNywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNH0sICAgICAgICAgICAvL1JGX0NIQU5fOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNH0sICAgICAgICAgICAvL1JGX0NIQU5fOSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNH0sICAgICAgICAgICAvL1JGX0NIQU5fMTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTR9LCAgICAgICAgICAgLy9SRl9DSEFOXzExLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE0fSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNH0sICAgICAgICAgICAvL1JGX0NIQU5fMTMsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgLy9SRl9DSEFOXzE0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNC45R0h6IEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yNDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjQ0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzI0OCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yNTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjA4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzIxMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yMTYsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IExvdyAmIE1pZCBVLU5JSSBCYW5kLCBub25lIENCCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8zNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxN30sICAgICAgICAgICAgLy9SRl9DSEFOXzQwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE3fSwgICAgICAgICAgICAvL1JGX0NIQU5fNDQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl80OCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl81MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl81NiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl82MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl82NCwKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogTWlkIEJhbmQgLSBFVFNJLCBub25lIENCCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIyfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTAwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzEwNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMDgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fMTEyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzExNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzEyMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzEyNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzEyOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMzIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fMTM2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE0MCwKKyNpZmRlZiBGRUFUVVJFX1dMQU5fQ0gxNDQKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNDQsCisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0NIMTQ0ICovCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IEhpZ2ggVS1OSUkgQmFuZCwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTQ5LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTUzLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTU3LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTYxLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNjUsCisKKyAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZCwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMn0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMn0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfOSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMSwKKworICAgICAgICAgICAgICAgICAgICAvLyA0LjlHSHogQmFuZCwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjQyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yNDYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzI1MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjEwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yMTQsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IExvdyAmIE1pZCBVLU5JSSBCYW5kLCBjaGFubmVsIGJvbmRlZCBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8zOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNDIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzQ2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF81MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNTQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzU4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI1fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF82MiwKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogTWlkIEJhbmQgLSBFVFNJLCBjaGFubmVsIGJvbmRlZCBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTAyCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMDYKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzExMAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMTQKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTE4CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEyMgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMjYKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTMwCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMzQKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEzOAorI2lmZGVmIEZFQVRVUkVfV0xBTl9DSDE0NAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTQyCisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0NIMTQ0ICovCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IEhpZ2ggVS1OSUkgQmFuZCwgIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xNTEsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xNTUsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xNTksCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xNjMKKyAgICAgICAgICAgICAgICB9LCAvL3NSZWd1bGF0b3J5Q2hhbm5lbCBlbmQKKworICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgezB9LCAgIC8vIFJGX1NVQkJBTkRfMl80X0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0sICAgLy8gUkZfU1VCQkFORF81X0xPV19HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9LCAgIC8vIFJGX1NVQkJBTkRfNV9NSURfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSwgICAvLyBSRl9TVUJCQU5EXzVfSElHSF9HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9ICAgIC8vIFJGX1NVQkJBTkRfNF85X0dIWgorICAgICAgICAgICAgICAgIH0sCisKKyAgICAgICAgICAgICAgICB7IC8vIGJSYXRlUG93ZXJPZmZzZXQgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSwgLy8gYlJhdGVQb3dlck9mZnNldCBlbmQKKworICAgICAgICAgICAgICAgIHsgLy8gZ25SYXRlUG93ZXJPZmZzZXQgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy9hcHBseSB0byBhbGwgMi40IGFuZCA1RyBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSAvLyBnblJhdGVQb3dlck9mZnNldCBlbmQKKyAgICAgICAgICAgIH0sIC8vIFJFR19ET01BSU5fSElfNUdIWiBlbmQKKworICAgICAgICAgICAgeyAgIC8vIFJFR19ET01BSU5fTk9fNUdIWiBzdGFydAorICAgICAgICAgICAgICAgIHsgLy9zUmVndWxhdG9yeUNoYW5uZWwgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy9lbmFibGVkLCBwd3JMaW1pdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxMn0sICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTJ9LCAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSwgLy9zUmVndWxhdG9yeUNoYW5uZWwgZW5kCisKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHswfSwgICAvLyBSRl9TVUJCQU5EXzJfNF9HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9LCAgIC8vIFJGX1NVQkJBTkRfNV9MT1dfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSwgICAvLyBSRl9TVUJCQU5EXzVfTUlEX0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0sICAgLy8gUkZfU1VCQkFORF81X0hJR0hfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSAgICAvLyBSRl9TVUJCQU5EXzRfOV9HSFoKKyAgICAgICAgICAgICAgICB9LAorCisgICAgICAgICAgICAgICAgeyAvLyBiUmF0ZVBvd2VyT2Zmc2V0IHN0YXJ0CisgICAgICAgICAgICAgICAgICAgIC8vMi40R0h6IEJhbmQKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fOCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fOSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTAsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzExLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTMsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzE0LAorICAgICAgICAgICAgICAgIH0sIC8vIGJSYXRlUG93ZXJPZmZzZXQgZW5kCisKKyAgICAgICAgICAgICAgICB7IC8vIGduUmF0ZVBvd2VyT2Zmc2V0IHN0YXJ0CisgICAgICAgICAgICAgICAgICAgIC8vYXBwbHkgdG8gYWxsIDIuNCBhbmQgNUcgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fOCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fOSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTAsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzExLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTMsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzE0LAorICAgICAgICAgICAgICAgIH0gLy8gZ25SYXRlUG93ZXJPZmZzZXQgZW5kCisgICAgICAgICAgICB9IC8vIFJFR19ET01BSU5fTk9fNUdIWiBlbmQKKyAgICAgICAgfSwKKworICAgICAgICAvLyBOVl9UQUJMRV9ERUZBVUxUX0NPVU5UUlkKKyAgICAgICAgeworICAgICAgICAgICAgLy8gdHlwZWRlZiBzdHJ1Y3QKKyAgICAgICAgICAgIC8vIHsKKyAgICAgICAgICAgIC8vICAgICB0QU5JX1U4IHJlZ0RvbWFpbjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZnJvbSBlUmVnRG9tYWluSWQKKyAgICAgICAgICAgIC8vICAgICB0QU5JX1U4IGNvdW50cnlDb2RlW05WX0ZJRUxEX0NPVU5UUllfQ09ERV9TSVpFXTsgICAgLy8gc3RyaW5nIGlkZW50aWZpZXIKKyAgICAgICAgICAgIC8vIH1zRGVmYXVsdENvdW50cnk7CisKKyAgICAgICAgICAgIDAsICAgICAgICAgICAgICAgICAgLy8gcmVnRG9tYWluCisgICAgICAgICAgICB7ICdVJywgJ1MnLCAnSScgfSAgIC8vIGNvdW50cnlDb2RlCisgICAgICAgIH0sCisKKyAgICAgICAgLy9OVl9UQUJMRV9UUENfUE9XRVJfVEFCTEUKKyAgICAgICAgeworICAgICAgICAgICAgLy9jaCAxCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAwICwgMCAsIDAgLCAwICwgMCAsIDEgLCAxICwgMSAsIDIgLCAyICwgMyAsIDMgLCA0ICwgNSAsIDUgLCA2ICwgNyAsIDggLCA4ICwgOSAsIDEwICwgMTAgLCAxMSAsIDEzICwgMTQgLCAxNSAsIDE3ICwKKyAgICAgICAgICAgICAgICAgICAgMTkgLCAyMCAsIDIxICwgMjIgLCAyMyAsIDI1ICwgMjYgLCAyNyAsIDI4ICwgMjkgLCAzMCAsIDMwICwgMzEgLCAzMiAsIDMzICwgMzQgLCAzNSAsIDM1ICwgMzYgLCAzNyAsIDM4ICwgMzkgLCA0MCAsCisgICAgICAgICAgICAgICAgICAgIDQwICwgNDEgL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AyICwgMTAyICwgMTAyICwgMTAyICwgMTAyICwgMTAyICwgMTAyICwgMTAzICwgMTAzICwgMTAzICwgMTAzICwKKyAgICAgICAgICAgICAgICAgICAgMTAzICwgMTAzICwgMTA0ICwgMTA0ICwgMTA0ICwgMTA0ICwgMTA0ICwgMTA1ICwgMTA1ICwgMTA1ICwgMTA1ICwgMTA1ICwgMTA2ICwgMTA2ICwgMTA2ICwgMTA2ICwgMTA2ICwgMTA2ICwgMTA3ICwKKyAgICAgICAgICAgICAgICAgICAgMTA3ICwgMTA3ICwgMTA3ICwgMTA3ICwgMTA3ICwgMTA3ICwgMTA4ICwgMTA4ICwgMTA4ICwgMTA4ICwgMTA4ICwgMTA4ICwgMTA5ICwgMTA5ICwgMTA5ICwgMTA5ICwgMTA5ICwgMTA5ICwgMTA5ICwKKyAgICAgICAgICAgICAgICAgICAgMTEwICwgMTEwICwgMTEwICwgMTEwICwgMTEwICwgMTEwICwgMTEwICwgMTEwICwgMTExICwgMTExICwgMTExICwgMTExICwgMTExICwgMTEyICwgMTEyICwgMTEyCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzgKKworICAgICAgICAgICAgLy9jaCA5CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAwICwgMCAsIDAgLCAwICwgMCAsIDAgLCAwICwgMCAsIDAgLCAwICwgMCAsIDAgLCAwICwgMCAsIDAgLCAwICwgMSAsIDEgLCAyICwgMiAsIDMgLCA1ICwgNiAsIDcgLCA5ICwgMTAgLCAxMSAsIDEzICwKKyAgICAgICAgICAgICAgICAgICAgMTQgLCAxNSAsIDE2ICwgMTcgLCAxOCAsIDIwICwgMjEgLCAyMiAsIDIyICwgMjMgLCAyMyAsIDI0ICwgMjQgLCAyNSAsIDI1ICwgMjYgLCAyNiAsIDI2ICwgMjcgLCAyNyAsIDI4ICwgMjkgLCAyOSAsCisgICAgICAgICAgICAgICAgICAgIDMwICwgMz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CA3NiAsIDc2ICwgNzYgLCA3NiAsIDc2ICwgNzYgLCA3NyAsIDc3ICwKKyAgICAgICAgICAgICAgICAgICAgNzcgLCA3NyAsIDc3ICwgNzcgLCA3OCAsIDc4ICwgNzggLCA3OCAsIDc4ICwgNzggLCA3OCAsIDc5ICwgNzkgLCA3OSAsIDc5ICwgNzkgLCA3OSAsIDgwICwgODAgLCA4MCAsIDgwICwgODAgLCA4MCAsCisgICAgICAgICAgICAgICAgICAgIDgxICwgODEgLCA4MSAsIDgxICwgODEgLCA4MSAsIDgxICwgODIgLCA4MiAsIDgyICwgODIgLCA4MiAsIDgyICwgODMgLCA4MyAsIDgzICwgODMgLCA4NCAsIDg0ICwgODUgLCA4NQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl8xMAorCisgICAgICAgICAgICAvL2NoIDExCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAwICwgMCAsIDAgLCAwICwgMCAsIDAgLCAwICwgMCAsIDAgLCAwICwgMCAsIDAgLCAwICwgMCAsIDAgLCAwICwgMSAsIDEgLCAyICwgMiAsIDMgLCA1ICwgNiAsIDcgLCA5ICwgMTAgLCAxMSAsIDEzICwKKyAgICAgICAgICAgICAgICAgICAgMTQgLCAxNSAsIDE2ICwgMTcgLCAxOCAsIDIwICwgMjEgLCAyMiAsIDIyICwgMjMgLCAyMyAsIDI0ICwgMjQgLCAyNSAsIDI1ICwgMjYgLCAyNiAsIDI2ICwgMjcgLCAyNyAsIDI4ICwgMjkgLCAyOSAsCisgICAgICAgICAgICAgICAgICAgIDMwICwgMzAgLCAzMSAsIDMxICwgMzIgLCAzMiAsIDMzICwgMzMgLCAzNCAsIDM0ICwgMzUgLCAzNiAsIDM2ICwgMzcgLCAzNyAsIDM4ICwgMzggLCAzOSAsIDM5ICwgNDAgLCA0MCAsIDQxICwgNDEgLAorICAgICAgICAgICAgICAgICAgICA0MiAsIDQyICwgN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gNzUgLCA3NSAsIDc1ICwgNzUgLCA3NiAsCisgICAgICAgICAgICAgICAgICAgIDc2ICwgNzYgLCA3NiAsIDc2ICwgNzcgLCA3NyAsIDc3ICwgNzcgLCA3OCAsIDc4ICwgNzggLCA3OCAsIDc4ICwgNzkgLCA3OSAsIDc5ICwgNzkgLCA4MCAsIDgwICwgODAgLCA4MCAsIDgwICwgODEgLAorICAgICAgICAgICAgICAgICAgICA4MSAsIDgxICwgODEgLCA4MiAsIDgyICwgODIgLCA4MiAsIDgyICwgODIgLCA4MyAsIDgzICwgODMgLCA4MyAsIDgzICwgODQgLCA4NCAsIDg0ICwgODQgLCA4NCAsIDg0ICwgODUgLCA4NSAsIDg1ICwKKyAgICAgICAgICAgICAgICAgICAgODUgLCA4NSAsIDg1ICwgODYgLCA4NiAsIDg2ICwgODYgLCA4NiAsIDg2ICwgODcgLCA4NyAsIDg3ICwgODcgLCA4NyAsIDg3ICwgODggLCA4OCAsIDg4ICwgODggLCA4OCAsIDg4ICwgODggLCA4OSAsCisgICAgICAgICAgICAgICAgICAgIDg5ICwgODkgLCA4OSAsIDg5ICwgODkgLCA5MCAsIDkwICwgOTAgLCA5MCAsIDkwICwgOTAgLCA5MCAsIDkxICwgOTEgLCA5MSAsIDkxICwgOTEgLCA5MSAsIDkyICwgOTIgLCA5MiAsIDkyICwgOTIgLAorICAgICAgICAgICAgICAgICAgICA5MiAsIDkyICwgOTMgLCA5MyAsIDkzICwgOTMgLCA5MyAsIDkzICwgOTQgLCA5NCAsIDk0ICwgOTQgLCA5NCAsIDk0ICwgOTUgLCA5NSAsIDk1ICwgOTUgLCA5NSAsIDk1ICwgOTYgLCA5NgorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl9CT05EXzMKKworICAgICAgICAgICAgLy9jaCA0CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAxMCAsIDEwICwgMTEgLCAxMiAsIDEyICw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sIDU3ICwgNTcgLCA1NyAsIDU4ICwgNTggLCA1OCAsIDU4ICwgNTggLCA1OCAsIDU5ICwgNTkgLCA1OSAsIDU5ICwgNTkgLCA1OSAsIDYwICwgNjAsCisgICAgICAgICAgICAgICAgICAgIDYwICwgNjEgLCA2MSAsIDYxICwgNjEgLCA2MiAsIDYyICwgNjIgLCA2MiAsIDYyICwgNjMgLCA2MyAsIDYzICwgNjMgLCA2MyAsIDY0ICwgNjQgLCA2NCAsIDY1ICwgNjYgLCA2NgorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl9CT05EXzE2MworICAgICAgICB9LAorCisgICAgICAgIC8vTlZfVEFCTEVfVFBDX1BEQURDX09GRlNFVFMKKyAgICAgICAgeworICAgICAgICAgICAgOTgsICAgIC8vIFJGX0NIQU5fMQorICAgICAgICAgICAgMTAxLCAgIC8vIFJGX0NIQU5fMgorICAgICAgICAgICAgMTAxLCAgIC8vIFJGX0NIQU5fMworICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fNAorICAgICAgICAgICAgOTgsICAgIC8vIFJGX0NIQU5fNQorICAgICAgICAgICAgOTcsICAgIC8vIFJGX0NIQU5fNgorICAgICAgICAgICAgOTQsICAgIC8vIFJGX0NIQU5fNworICAgICAgICAgICAgOTQsICAgIC8vIFJGX0NIQU5fOAorICAgICAgICAgICAgOTIsICAgIC8vIFJGX0NIQU5fOQorICAgICAgICAgICAgOTAsICAgIC8vIFJGX0NIQU5fMTAKKyAgICAgICAgICAgIDk0LCAgICAvLyBSRl9DSEFOXzExCisgICAgICAgICAgICA5NSwgICAgLy8gUkZfQ0hBTl8xMgorICAgICAgICAgICAgOTcsICAgIC8vIFJGX0NIQU5fMTMKKyAgICAgICAgICAgIDEwNCwgICAvLyBSRl9DSEFOXzE0CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl8yNDAKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOXzI0NAorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fMjQ4CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl8yNTIKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOXzIwOAorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fMjEyCisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl8yMTYKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOXzM2CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl80MAorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fNDQKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOXzQ4CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl81MgorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fNTYKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOXzYwCisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl82NAorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fMTAwCisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl8xMDQKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOXzEwOAorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fMTEyCisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl8xMTYKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOXzEyMAorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fMTI0CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl8xMjgKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOXzEzMgorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fMTM2CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl8xNDAKKyNpZmRlZiBGRUFUVVJFX1dMQU5fQ0gxNDQKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOXzE0NAorI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9DSDE0NCAqLworICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fMTQ5CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl8xNTMKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOXzE1NworICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fMTYxCisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl8xNjUKKyAgICAgICAgICAgIC8vQ0hBTk5FTCBCT05ERUQgQ0hBTk5FTFMKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOX0JPTkRfMworICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF80CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzUKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOX0JPTkRfNgorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF83CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzgKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOX0JPTkRfOQorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF8xMAorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF8xMQorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF8yNDIKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOX0JPTkRfMjQ2CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzI1MAorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF8yMTAKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOX0JPTkRfMjE0CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzM4CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzQyCisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzQ2CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzUwCisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzU0CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzU4CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzYyCisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzEwMgorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF8xMDYKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOX0JPTkRfMTEwCisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzExNAorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF8xMTgKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOX0JPTkRfMTIyCisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzEyNgorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF8xMzAKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOX0JPTkRfMTM0CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzEzOAorI2lmZGVmIEZFQVRVUkVfV0xBTl9DSDE0NAorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF8xNDIKKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fQ0gxNDQgKi8KKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOX0JPTkRfMTUxCisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzE1NQorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF8xNTkKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOX0JPTkRfMTYzCisgICAgICAgIH0sCisKKyAgICAgICAgLy9OVl9UQUJMRV9WSVJUVUFMX1JBVEUKKyAgICAgICAgLy8gdHlwZWRlZiB0QU5JX1MxNiB0UG93ZXJkQm07CisgICAgICAgIC8vdHlwZWRlZiB0UG93ZXJkQm0gdFJhdGVHcm91cFB3cltOVU1fSEFMX1BIWV9SQVRFU107CisgICAgICAgIC8vdFJhdGVHcm91cFB3ciAgICAgICBwd3JPcHRpbXVtW05VTV9SRl9TVUJCQU5EU107CisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIDIuNEcgUkYgU3ViYmFuZAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vODAyLjExYiBSYXRlcworICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBIQUxfUEhZX1ZSQVRFXzExQV81NF9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBIQUxfUEhZX1ZSQVRFX01DU18xTlNTXzY1X01CUFMsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIEhBTF9QSFlfVlJBVEVfTUNTXzFOU1NfTU1fU0dfNzJfMl9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBIQUxfUEhZX1ZSQVRFX01DU18xTlNTX0NCXzEzNV9NQlBTCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIEhBTF9QSFlfVlJBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfMTUwX01CUFMsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICAvLyA1RyBMb3cgUkYgU3ViYmFuZAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vODAyLjExYiBSYXRlcworICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBIQUxfUEhZX1ZSQVRFXzExQV81NF9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBIQUxfUEhZX1ZSQVRFX01DU18xTlNTXzY1X01CUFMsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIEhBTF9QSFlfVlJBVEVfTUNTXzFOU1NfTU1fU0dfNzJfMl9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBIQUxfUEhZX1ZSQVRFX01DU18xTlNTX0NCXzEzNV9NQlBTCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIEhBTF9QSFlfVlJBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfMTUwX01CUFMsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICAvLyA1RyBNaWRkbGUgUkYgU3ViYmFuZAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vODAyLjExYiBSYXRlcworICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBIQUxfUEhZX1ZSQVRFXzExQV81NF9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBIQUxfUEhZX1ZSQVRFX01DU18xTlNTXzY1X01CUFMsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIEhBTF9QSFlfVlJBVEVfTUNTXzFOU1NfTU1fU0dfNzJfMl9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBIQUxfUEhZX1ZSQVRFX01DU18xTlNTX0NCXzEzNV9NQlBTCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIEhBTF9QSFlfVlJBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfMTUwX01CUFMsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICAvLyA1RyBIaWdoIFJGIFN1YmJhbmQKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLzgwMi4xMWIgUmF0ZXMKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gSEFMX1BIWV9WUkFURV8xMUFfNTRfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gSEFMX1BIWV9WUkFURV9NQ1NfMU5TU182NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBIQUxfUEhZX1ZSQVRFX01DU18xTlNTX01NX1NHXzcyXzJfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gSEFMX1BIWV9WUkFURV9NQ1NfMU5TU19DQl8xMzVfTUJQUworICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBIQUxfUEhZX1ZSQVRFX01DU18xTlNTX01NX1NHX0NCXzE1MF9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICB9LAorICAgICAgICAgICAgLy8gNC45RyBSRiBTdWJiYW5kCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy84MDIuMTFiIFJhdGVzCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIEhBTF9QSFlfVlJBVEVfMTFBXzU0X01CUFMsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIEhBTF9QSFlfVlJBVEVfTUNTXzFOU1NfNjVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gSEFMX1BIWV9WUkFURV9NQ1NfMU5TU19NTV9TR183Ml8yX01CUFMsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIEhBTF9QSFlfVlJBVEVfTUNTXzFOU1NfQ0JfMTM1X01CUFMKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gSEFMX1BIWV9WUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xNTBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgfQorICAgICAgICB9LAorCisjaWYgMCAvL0ZJWE1FX1BSSU1BCisgICAgICAgIC8vTlZfVEFCTEVfQ0FMX01FTU9SWQorICAgICAgICB7CisgICAgICAgICAgICAweDdGRkYsICAgICAgLy8gdEFOSV9VMTYgICAgcHJvY2Vzc19tb25pdG9yOworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIGhkZXRfY2FsX2NvZGU7CisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgcnhmZV9nbV8yOworCisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgdHhfYmJmX3J0dW5lOworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIHBhX3J0dW5lX3JlZzsKKyAgICAgICAgICAgIDB4MDAsICAgICAgICAvLyB0QU5JX1U4ICAgICBydF9jb2RlOworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIGJpYXNfcnR1bmU7CisKKyAgICAgICAgICAgIDB4MDAsICAgICAgICAvLyB0QU5JX1U4ICAgICBiYl9idzE7CisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgYmJfYncyOworICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sICAgICAgICAvLyB0QU5JX1U4ICAgICByZXNlcnZlZFsyXTsKKworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIGJiX2J3MzsKKyAgICAgICAgICAgIDB4MDAsICAgICAgICAvLyB0QU5JX1U4ICAgICBiYl9idzQ7CisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgYmJfYnc1OworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIGJiX2J3NjsKKworICAgICAgICAgICAgMHg3RkZGLCAgICAgIC8vIHRBTklfVTE2ICAgIHJjTWVhc3VyZWQ7CisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgdHhfYmJmX2N0OworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIHR4X2JiZl9jdHI7CisKKyAgICAgICAgICAgIDB4MDAsICAgICAgICAvLyB0QU5JX1U4ICAgICBjc2hfbWF4Z2Fpbl9yZWc7CisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgY3NoXzBkYl9yZWc7CisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgY3NoX20zZGJfcmVnOworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIGNzaF9tNmRiX3JlZzsKKworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIGNmZl8wZGJfcmVnOworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIGNmZl9tM2RiX3JlZzsKKyAgICAgICAgICAgIDB4MDAsICAgICAgICAvLyB0QU5JX1U4ICAgICBjZmZfbTZkYl9yZWc7CisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgcnhmZV9ncGlvX2N0bF8xOworCisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgbWl4X2JhbF9jbnRfMjsKKyAgICAgICAgICAgIDB4MDAsICAgICAgICAvLyB0QU5JX1M4ICAgICByeGZlX2xuYV9oaWdoZ2Fpbl9iaWFzX2N0bF9kZWx0YTsKKyAgICAgICAgICAgIDB4MDAsICAgICAgICAvLyB0QU5JX1U4ICAgICByeGZlX2xuYV9sb2FkX2N0dW5lOworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIHJ4ZmVfbG5hX25nbV9ydHVuZTsKKworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIHJ4X2ltMl9pX2NmZzA7CisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgcnhfaW0yX2lfY2ZnMTsKKyAgICAgICAgICAgIDB4MDAsICAgICAgICAvLyB0QU5JX1U4ICAgICByeF9pbTJfcV9jZmcwOworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIHJ4X2ltMl9xX2NmZzE7CisKKyAgICAgICAgICAgIDB4MDAsICAgICAgICAvLyB0QU5JX1U4ICAgICBwbGxfdmZjX3JlZzNfYjA7CisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgcGxsX3ZmY19yZWczX2IxOworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIHBsbF92ZmNfcmVnM19iMjsKKyAgICAgICAgICAgIDB4MDAsICAgICAgICAvLyB0QU5JX1U4ICAgICBwbGxfdmZjX3JlZzNfYjM7CisKKyAgICAgICAgICAgIDB4N0ZGRiwgICAgICAgIC8vIHRBTklfVTE2ICAgIHRlbXBTdGFydDsKKyAgICAgICAgICAgIDB4N0ZGRiwgICAgICAgIC8vIHRBTklfVTE2ICAgIHRlbXBGaW5pc2g7CisKKyAgICAgICAgICAgIHsgLy90eExvQ29ycmVjdGlvbnMKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0gIC8vIFRYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl8xCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9ICAvLyBUWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fMgorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSAgLy8gVFhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzMKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0gIC8vIFRYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl80CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9ICAvLyBUWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fNQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSAgLy8gVFhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzYKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0gIC8vIFRYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl83CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9ICAvLyBUWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fOAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSAgLy8gVFhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0gIC8vIFRYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl8xMAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSAgLy8gVFhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzExCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9ICAvLyBUWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fMTIKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0gIC8vIFRYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl8xMworICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSAgLy8gVFhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSAgLy9SRl9DSEFOXzE0CisgICAgICAgICAgICB9LCAgICAgICAgLy8gdFR4TG9Db3JyZWN0aW9ucyAgICB0eExvVmFsdWVzOworCisgICAgICAgICAgICB7IC8vc1R4SVFDaGFubmVsCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9ICAvLyBUWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fMQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSAgLy8gVFhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzIKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0gIC8vIFRYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl8zCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9ICAvLyBUWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fNAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSAgLy8gVFhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzUKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0gIC8vIFRYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl82CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9ICAvLyBUWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fNworICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSAgLy8gVFhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzgKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0gIC8vIFRYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl85CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9ICAvLyBUWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fMTAKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0gIC8vIFRYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl8xMQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSAgLy8gVFhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzEyCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9ICAvLyBUWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fMTMKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0gIC8vIFRYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0gIC8vUkZfQ0hBTl8xNAorICAgICAgICAgICAgfSwgICAgICAgIC8vIHNUeElRQ2hhbm5lbCAgICAgICAgdHhJcVZhbHVlczsKKworICAgICAgICAgICAgeyAvL3NSeElRQ2hhbm5lbAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSAgLy8gUlhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzEKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0gIC8vIFJYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl8yCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9ICAvLyBSWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fMworICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSAgLy8gUlhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzQKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0gIC8vIFJYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl81CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9ICAvLyBSWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fNgorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSAgLy8gUlhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzcKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0gIC8vIFJYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl84CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9ICAvLyBSWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fOQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSAgLy8gUlhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzEwCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9ICAvLyBSWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fMTEKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0gIC8vIFJYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl8xMgorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSAgLy8gUlhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzEzCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9ICAvLyBSWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9ICAvL1JGX0NIQU5fMTQKKyAgICAgICAgICAgIH0sICAgICAgICAvLyBzUnhJUUNoYW5uZWwgICAgICAgIHJ4SXFWYWx1ZXM7CisKKyAgICAgICAgICAgIHsgLy8gdFRwY0NvbmZpZyAgICAgICAgICBjbHBjRGF0YVtNQVhfVFBDX0NIQU5ORUxTXQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF82CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0gIC8vQ0FMX1BPSU5UXzcKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gLy8gUEhZX1RYX0NIQUlOXzAKKyAgICAgICAgICAgICAgICAgICAgfSAvLyBlbXBpcmljYWwKKyAgICAgICAgICAgICAgICB9LCAvLyBSRl9DSEFOXzEKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8xCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF80CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9ICAvL0NBTF9QT0lOVF83CisgICAgICAgICAgICAgICAgICAgICAgICB9IC8vIFBIWV9UWF9DSEFJTl8wCisgICAgICAgICAgICAgICAgICAgIH0gLy8gZW1waXJpY2FsCisgICAgICAgICAgICAgICAgfSwgLy8gUkZfQ0hBTl8yCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF81CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSAgLy9DQUxfUE9JTlRfNworICAgICAgICAgICAgICAgICAgICAgICAgfSAvLyBQSFlfVFhfQ0hBSU5fMAorICAgICAgICAgICAgICAgICAgICB9IC8vIGVtcGlyaWNhbAorICAgICAgICAgICAgICAgIH0sIC8vIFJGX0NIQU5fMworICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF82CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0gIC8vQ0FMX1BPSU5UXzcKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gLy8gUEhZX1RYX0NIQUlOXzAKKyAgICAgICAgICAgICAgICAgICAgfSAvLyBlbXBpcmljYWwKKyAgICAgICAgICAgICAgICB9LCAvLyBSRl9DSEFOXzQKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8xCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF80CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9ICAvL0NBTF9QT0lOVF83CisgICAgICAgICAgICAgICAgICAgICAgICB9IC8vIFBIWV9UWF9DSEFJTl8wCisgICAgICAgICAgICAgICAgICAgIH0gLy8gZW1waXJpY2FsCisgICAgICAgICAgICAgICAgfSwgLy8gUkZfQ0hBTl81CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF81CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSAgLy9DQUxfUE9JTlRfNworICAgICAgICAgICAgICAgICAgICAgICAgfSAvLyBQSFlfVFhfQ0hBSU5fMAorICAgICAgICAgICAgICAgICAgICB9IC8vIGVtcGlyaWNhbAorICAgICAgICAgICAgICAgIH0sIC8vIFJGX0NIQU5fNgorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF82CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0gIC8vQ0FMX1BPSU5UXzcKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gLy8gUEhZX1RYX0NIQUlOXzAKKyAgICAgICAgICAgICAgICAgICAgfSAvLyBlbXBpcmljYWwKKyAgICAgICAgICAgICAgICB9LCAvLyBSRl9DSEFOXzcKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8xCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF80CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9ICAvL0NBTF9QT0lOVF83CisgICAgICAgICAgICAgICAgICAgICAgICB9IC8vIFBIWV9UWF9DSEFJTl8wCisgICAgICAgICAgICAgICAgICAgIH0gLy8gZW1waXJpY2FsCisgICAgICAgICAgICAgICAgfSwgLy8gUkZfQ0hBTl84CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF81CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSAgLy9DQUxfUE9JTlRfNworICAgICAgICAgICAgICAgICAgICAgICAgfSAvLyBQSFlfVFhfQ0hBSU5fMAorICAgICAgICAgICAgICAgICAgICB9IC8vIGVtcGlyaWNhbAorICAgICAgICAgICAgICAgIH0sIC8vIFJGX0NIQU5fOQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF82CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0gIC8vQ0FMX1BPSU5UXzcKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gLy8gUEhZX1RYX0NIQUlOXzAKKyAgICAgICAgICAgICAgICAgICAgfSAvLyBlbXBpcmljYWwKKyAgICAgICAgICAgICAgICB9LCAvLyBSRl9DSEFOXzEwCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF81CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSAgLy9DQUxfUE9JTlRfNworICAgICAgICAgICAgICAgICAgICAgICAgfSAvLyBQSFlfVFhfQ0hBSU5fMAorICAgICAgICAgICAgICAgICAgICB9IC8vIGVtcGlyaWNhbAorICAgICAgICAgICAgICAgIH0sIC8vIFJGX0NIQU5fMTEKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8xCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF80CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9ICAvL0NBTF9QT0lOVF83CisgICAgICAgICAgICAgICAgICAgICAgICB9IC8vIFBIWV9UWF9DSEFJTl8wCisgICAgICAgICAgICAgICAgICAgIH0gLy8gZW1waXJpY2FsCisgICAgICAgICAgICAgICAgfSwgLy8gUkZfQ0hBTl8xMgorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF82CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0gIC8vQ0FMX1BPSU5UXzcKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gLy8gUEhZX1RYX0NIQUlOXzAKKyAgICAgICAgICAgICAgICAgICAgfSAvLyBlbXBpcmljYWwKKyAgICAgICAgICAgICAgICB9LCAgLy8gUkZfQ0hBTl8xMworICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF82CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0gIC8vQ0FMX1BPSU5UXzcKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gLy8gUEhZX1RYX0NIQUlOXzAKKyAgICAgICAgICAgICAgICAgICAgfSAvLyBlbXBpc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vcGFQb2xhcml0eVR4OworICAgICAgICAgICAgMCwgICAvL3BhUG9sYXJpdHlSeDsKKworICAgICAgICAgICAgMCwgICAvL3hMTkEyRzsKKyAgICAgICAgICAgIDAsICAgLy94TE5BNUc7CisgICAgICAgICAgICAwLCAgIC8veENvdXBsZXIyRzsKKyAgICAgICAgICAgIDAsICAgLy94Q291cGxlcjVHOworCisgICAgICAgICAgICAwLCAgIC8veFBkZXQyRzsKKyAgICAgICAgICAgIDAsICAgLy94UGRldDVHOworICAgICAgICAgICAgMCwgICAvL2VuYWJsZURQRDJHOworICAgICAgICAgICAgMSwgICAvL2VuYWJsZURQRDVHOworCisgICAgICAgICAgICAxLCAgIC8vcGRhZGNTZWxlY3QyRzsKKyAgICAgICAgICAgIDEsICAgLy9wZGFkY1NlbGVjdDVHTG93OworICAgICAgICAgICAgMSwgICAvL3BkYWRjU2VsZWN0NUdNaWQ7CisgICAgICAgICAgICAxLCAgIC8vcGRhZGNTZWxlY3Q1R0hpZ2g7CisKKyAgICAgICAgICAgIDAsICAgLy9yZXNlcnZlZDIKKyAgICAgICAgICAgIDAsICAgLy9yZXNlcnZlZDMKKyAgICAgICAgICAgIDAsICAgLy9yZXNlcnZlZDQKKyAgICAgICAgfSwKKworCisgICAgICAgIC8vTlZfVEFCTEVfUlNTSV9DSEFOTkVMX09GRlNFVFMKKyAgICAgICAgeworICAgICAgICAgICAgLy9QSFlfUlhfQ0hBSU5fMAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vYlJzc2lPZmZzZXQKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIDI0MCwgICAgLy9SRl9DSEFOXzEsCisgICAgICAgICAgICAgICAgICAgIDI0MCwgICAgLy9SRl9DSEFOXzIsCisgICAgICAgICAgICAgICAgICAgIDI0MCwgICAgLy9SRl9DSEFOXzMsCisgICAgICAgICAgICAgICAgICAgIDI0MCwgICAgLy9SRl9DSEFOXzQsCisgICAgICAgICAgICAgICAgICAgIDI0MCwgICAgLy9SRl9DSEFOXzUsCisgICAgICAgICAgICAgICAgICAgIDI0MCwgICAgLy9SRl9DSEFOXzYsCisgICAgICAgICAgICAgICAgICAgIDI0MCwgICAgLy9SRl9DSEFOXzcsCisgICAgICAgICAgICAgICAgICAgIDI0MCwgICAgLy9SRl9DSEFOXzgsCisgICAgICAgICAgICAgICAgICAgIDI0MCwgICAgLy9SRl9DSEFOXzksCisgICAgICAgICAgICAgICAgICAgIDI0MCwgICAgLy9SRl9DSEFOXzEwLAorICAgICAgICAgICAgICAgICAgICAyNDAsICAgIC8vUkZfQ0hBTl8xMSwKKyAgICAgICAgICAgICAgICAgICAgMjQwLCAgICAvL1JGX0NIQU5fMTIsCisgICAgICAgICAgICAgICAgICAgIDI0MCwgICAgLy9SRl9DSEFOXzEzLAorICAgICAgICAgICAgICAgICAgICAyNDAsICAgIC8vUkZfQ0hBTl8xNCwKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fMjQwLAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl8yNDQsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzI0OCwKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fMjUyLAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl8yMDgsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzIxMiwKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fMjE2LAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl8zNiwKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fNDAsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzQ0LAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl80OCwKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fNTIsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzU2LAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl82MCwKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fNjQsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzEwMCwKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fMTA0LAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl8xMDgsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzExMiwKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fMTE2LAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl8xMjAsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzEyNCwKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fMTI4LAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl8xMzIsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzEzNiwKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fMTQwLAorI2lmZGVmIEZFQVRVUkVfV0xBTl9DSDE0NAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl8xNDQsCisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0NIMTQ0ICovCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzE0OSwKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fMTUzLAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl8xNTcsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzE2MSwKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fMTY1LAorICAgICAgICAgICAgICAgICAgICAyNDAsICAgIC8vUkZfQ0hBTl9CT05EXzMKKyAgICAgICAgICAgICAgICAgICAgMjQwLCAgICAvL1JGX0NIQU5fQk9ORF80CisgICAgICAgICAgICAgICAgICAgIDI0MCwgICAgLy9SRl9DSEFOX0JPTkRfNQorICAgICAgICAgICAgICAgICAgICAyNDAsICAgIC8vUkZfQ0hBTl9CT05EXzYKKyAgICAgICAgICAgICAgICAgICAgMjQwLCAgICAvL1JGX0NIQU5fQk9ORF83CisgICAgICAgICAgICAgICAgICAgIDI0MCwgICAgLy9SRl9DSEFOX0JPTkRfOAorICAgICAgICAgICAgICAgICAgICAyNDAsICAgIC8vUkZfQ0hBTl9CT05EXzkKKyAgICAgICAgICAgICAgICAgICAgMjQwLCAgICAvL1JGX0NIQU5fQk9ORF8xMAorICAgICAgICAgICAgICAgICAgICAyNDAsICAgIC8vUkZfQ0hBTl9CT05EXzExCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfMjQyCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfMjQ2CisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfMjUwCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfMjEwCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfMjE0CisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfMzgsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfNDIsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfNDYsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfNTAsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfNTQKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fQk9ORF81OAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzYyCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfMTAyCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfMTA2CisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfMTEwCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfMTE0CisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfMTE4CisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfMTIyCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfMTI2CisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfMTMwCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfMTM0CisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfMTM4CisjaWZkZWYgRkVBVFVSRV9XTEFOX0NIMTQ0CisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfMTQyCisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0NIMTQ0ICovCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfMTUxCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfMTU1CisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfMTU5CisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfMTYzCisgICAgICAgICAgICAgICAgfSwKKworICAgICAgICAgICAgICAgIC8vZ25Sc3NpT2Zmc2V0CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAyNDAsICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICAyNDAsICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICAyNDAsICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICAyNDAsICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICAyNDAsICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICAyNDAsICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICAyNDAsICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICAyNDAsICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICAyNDAsICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICAyNDAsICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAgMjQwLCAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIDI0MCwgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICAyNDAsICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAgMjQwLCAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzI0MCwKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fMjQ0LAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl8yNDgsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzI1MiwKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fMjA4LAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl8yMTIsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzIxNiwKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fMzYsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzQwLAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl80NCwKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fNDgsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzUyLAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl81NiwKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fNjAsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzY0LAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl8xMDAsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzEwNCwKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fMTA4LAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl8xMTIsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzExNiwKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fMTIwLAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl8xMjQsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzEyOCwKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fMTMyLAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl8xMzYsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzE0MCwKKyNpZmRlZiBGRUFUVVJFX1dMQU5fQ0gxNDQKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fMTQ0LAorI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9DSDE0NCAqLworICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl8xNDksCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzE1MywKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fMTU3LAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl8xNjEsCisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOXzE2NSwKKyAgICAgICAgICAgICAgICAgICAgMjQwLCAgICAvL1JGX0NIQU5fQk9ORF8zCisgICAgICAgICAgICAgICAgICAgIDI0MCwgICAgLy9SRl9DSEFOX0JPTkRfNAorICAgICAgICAgICAgICAgICAgICAyNDAsICAgIC8vUkZfQ0hBTl9CT05EXzUKKyAgICAgICAgICAgICAgICAgICAgMjQwLCAgICAvL1JGX0NIQU5fQk9ORF82CisgICAgICAgICAgICAgICAgICAgIDI0MCwgICAgLy9SRl9DSEFOX0JPTkRfNworICAgICAgICAgICAgICAgICAgICAyNDAsICAgIC8vUkZfQ0hBTl9CT05EXzgKKyAgICAgICAgICAgICAgICAgICAgMjQwLCAgICAvL1JGX0NIQU5fQk9ORF85CisgICAgICAgICAgICAgICAgICAgIDI0MCwgICAgLy9SRl9DSEFOX0JPTkRfMTAKKyAgICAgICAgICAgICAgICAgICAgMjQwLCAgICAvL1JGX0NIQU5fQk9ORF8xMQorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzI0MgorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzI0NgorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzI1MAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzIxMAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzIxNAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzM4LAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzQyLAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzQ2LAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzUwLAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzU0CisgICAgICAgICAgICAgICAgICAgIDE4MCwgICAgLy9SRl9DSEFOX0JPTkRfNTgKKyAgICAgICAgICAgICAgICAgICAgMTgwLCAgICAvL1JGX0NIQU5fQk9ORF82MgorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzEwMgorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzEwNgorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzExMAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzExNAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzExOAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzEyMgorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzEyNgorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzEzMAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzEzNAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzEzOAorI2lmZGVmIEZFQVRVUkVfV0xBTl9DSDE0NAorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzE0MgorI2VuZGlmIC8qIEZFQVRVUkVfV0xBTl9DSDE0NCAqLworICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzE1MQorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzE1NQorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzE1OQorICAgICAgICAgICAgICAgICAgICAxODAsICAgIC8vUkZfQ0hBTl9CT05EXzE2MworICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICB9LAorICAgICAgICAgICAgLy9yc3ZkCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9iUnNzaU9mZnNldAorICAgICAgICAgICAgICAgIHswfSwgICAvLyBhcHBseSB0byBhbGwgY2hhbm5sZXMKKworICAgICAgICAgICAgICAgIC8vZ25Sc3NpT2Zmc2V0CisgICAgICAgICAgICAgICAgezB9ICAgIC8vIGFwcGx5IHRvIGFsbCBjaGFubmxlcworICAgICAgICAgICAgfQorICAgICAgICB9LAorCisgICAgICAgIC8vTlZfVEFCTEVfSFdfQ0FMX1ZBTFVFUworICAgICAgICB7CisgICAgICAgICAgICAweDAsICAgICAgICAgICAgIC8vdmFsaWRCbWFwCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgMTQwMCwgICAgICAgIC8vcHNTbHBUaW1lT3ZySGQyRzsKKyAgICAgICAgICAgICAgICAxNDAwLCAgICAgICAgLy9wc1NscFRpbWVPdnJIZDVHOworCisgICAgICAgICAgICAgICAgMTYwMCwgICAgICAgIC8vcHNTbHBUaW1lT3ZySGR4TE5BNUc7CisgICAgICAgICAgICAgICAgMCwgICAgICAgICAgIC8vbnZfVHhCQkZTZWw5TUh6CisgICAgICAgICAgICAgICAgMCwgICAgICAgICAgIC8vaHdQYXJhbTEKKyAgICAgICAgICAgICAgICAwLCAgICAgICAgICAgLy9od1BhcmFtMgorCisgICAgICAgICAgICAgICAgMHgxQiwgICAgICAgIC8vY3VzdG9tX3RjeG9fcmVnOAorICAgICAgICAgICAgICAgIDB4RkYsICAgICAgICAvL2N1c3RvbV90Y3hvX3JlZzkKKworICAgICAgICAgICAgICAgIDAsICAgICAgICAgICAvL2h3UGFyYW0zOworICAgICAgICAgICAgICAgIDAsICAgICAgICAgICAvL2h3UGFyYW00OworICAgICAgICAgICAgICAgIDAsICAgICAgICAgICAvL2h3UGFyYW01OworICAgICAgICAgICAgICAgIDAsICAgICAgICAgICAvL2h3UGFyYW02OworICAgICAgICAgICAgICAgIDAsICAgICAgICAgICAvL2h3UGFyYW03OworICAgICAgICAgICAgICAgIDAsICAgICAgICAgICAvL2h3UGFyYW04OworICAgICAgICAgICAgICAgIDAsICAgICAgICAgICAvL2h3UGFyYW05OworICAgICAgICAgICAgICAgIDAsICAgICAgICAgICAvL2h3UGFyYW0xMDsKKyAgICAgICAgICAgICAgICAwLCAgICAgICAgICAgLy9od1BhcmFtMTE7CisgICAgICAgICAgICB9CisgICAgICAgIH0sCisKKworICAgICAgICAvL05WX1RBQkxFX0FOVEVOTkFfUEFUSF9MT1NTCisgICAgICAgIHsKKyAgICAgICAgICAgIDI4MCwgIC8vIFJGX0NIQU5fMQorICAgICAgICAgICAgMjcwLCAgLy8gUkZfQ0hBTl8yCisgICAgICAgICAgICAyNzAsICAvLyBSRl9DSEFOXzMKKyAgICAgICAgICAgIDI3MCwgIC8vIFJGX0NIQU5fNAorICAgICAgICAgICAgMjcwLCAgLy8gUkZfQ0hBTl81CisgICAgICAgICAgICAyNzAsICAvLyBSRl9DSEFOXzYKKyAgICAgICAgICAgIDI4MCwgIC8vIFJGX0NIQU5fNworICAgICAgICAgICAgMjgwLCAgLy8gUkZfQ0hBTl84CisgICAgICAgICAgICAyOTAsICAvLyBSRl9DSEFOXzkKKyAgICAgICAgICAgIDMwMCwgIC8vIFJGX0NIQU5fMTAKKyAgICAgICAgICAgIDMwMCwgIC8vIFJGX0NIQU5fMTEKKyAgICAgICAgICAgIDMxMCwgIC8vIFJGX0NIQU5fMTIKKyAgICAgICAgICAgIDMxMCwgIC8vIFJGX0NIQU5fMTMKKyAgICAgICAgICAgIDMxMCwgICAvLyBSRl9DSEFOXzE0CisgICAgICAgICAgICAyODAsICAvLyBSRl9DSEFOXzI0MAorICAgICAgICAgICAgMjgwLCAgLy8gUkZfQ0hBTl8yNDQKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOXzI0OAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fMjUyCisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl8yMDgKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOXzIxMgorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fMjE2CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl8zNgorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fNDAKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOXzQ0CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl80OAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fNTIKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOXzU2CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl82MAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fNjQKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOXzEwMAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fMTA0CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl8xMDgKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOXzExMgorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fMTE2CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl8xMjAKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOXzEyNAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fMTI4CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl8xMzIKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOXzEzNgorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fMTQwCisjaWZkZWYgRkVBVFVSRV9XTEFOX0NIMTQ0CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl8xNDQKKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fQ0gxNDQgKi8KKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOXzE0OQorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fMTUzCisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl8xNTcKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOXzE2MQorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fMTY1CisgICAgICAgICAgICAvL0NIQU5ORUwgQk9OREVEIENIQU5ORUxTCisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl9CT05EXzMKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfNAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF81CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl9CT05EXzYKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfNworICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF84CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl9CT05EXzkKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfMTAKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfMTEKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfMjQyCisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl9CT05EXzI0NgorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF8yNTAKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfMjEwCisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl9CT05EXzIxNAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF8zOAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF80MgorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF80NgorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF81MAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF81NAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF81OAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF82MgorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF8xMDIKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfMTA2CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl9CT05EXzExMAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF8xMTQKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfMTE4CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl9CT05EXzEyMgorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF8xMjYKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfMTMwCisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl9CT05EXzEzNAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF8xMzgKKyNpZmRlZiBGRUFUVVJFX1dMQU5fQ0gxNDQKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfMTQyCisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0NIMTQ0ICovCisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl9CT05EXzE1MQorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF8xNTUKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfMTU5CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl9CT05EXzE2MworICAgICAgICB9LAorCisgICAgICAgIC8vTlZfVEFCTEVfUEFDS0VUX1RZUEVfUE9XRVJfTElNSVRTCisgICAgICAgIHsKKyAgICAgICAgICAgIHsgMjE1MCB9LCAvLyBhcHBsaWVkIHRvIGFsbCBjaGFubmVscywgTU9ERV84MDJfMTFCCisgICAgICAgICAgICB7IDE4NTAgfSwgLy8gYXBwbGllZCB0byBhbGwgY2hhbm5lbHMsTU9ERV84MDJfMTFBRworICAgICAgICAgICAgeyAxNzUwIH0gIC8vIGFwcGxpZWQgdG8gYWxsIGNoYW5uZWxzLE1PREVfODAyXzExTgorICAgICAgICB9LAorCisgICAgICAgIC8vTlZfVEFCTEVfT0ZETV9DTURfUFdSX09GRlNFVAorICAgICAgICB7CisgICAgICAgICAgICAwLCAwCisgICAgICAgIH0sCisKKyAgICAgICAgLy9OVl9UQUJMRV9UWF9CQl9GSUxURVJfTU9ERQorICAgICAgICB7CisgICAgICAgICAgICAwCisgICAgICAgIH0KKworICAgIH0gLy8gdGFibGVzCit9OworCitjb25zdCBzSGFsTnZWMiBudkRlZmF1bHRzVjIgPQoreworICAgIHsKKyAgICAgICAgMCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRBTklfVTE2ICBwcm9kdWN0SWQ7CisgICAgICAgIDEsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0QU5JX1U4ICAgcHJvZHVjdEJhbmRzOworICAgICAgICAyLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdEFOSV9VOCAgIHdsYW5OdlJldklkOyAvLzA6IFdDTjEzMTIsIDE6IFdDTjEzMTQsIDI6IFdDTjM2NjAKKyAgICAgICAgMSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRBTklfVTggICBudW1PZlR4Q2hhaW5zOworICAgICAgICAxLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdEFOSV9VOCAgIG51bU9mUnhDaGFpbnM7CisgICAgICAgIHsgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0QU5JX1U4ICAgbWFjQWRkcltOVl9GSUVMRF9NQUNfQUREUl9TSVpFXTsKKyAgICAgICAgeyAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRBTklfVTggICBtYWNBZGRyW05WX0ZJRUxEX01BQ19BRERSX1NJWkVdOworICAgICAgICB7IDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdEFOSV9VOCAgIG1hY0FkZHJbTlZfRklFTERfTUFDX0FERFJfU0laRV07CisgICAgICAgIHsgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0QU5JX1U4ICAgbWFjQWRkcltOVl9GSUVMRF9NQUNfQUREUl9TSVpFXTsKKyAgICAgICAgeyAiXDAiIH0sCisgICAgICAgIDAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0QU5JX1U4ICAgY291cGxlclR5cGU7CisgICAgICAgIFdMQU5fTlZfVkVSU0lPTiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0QU5JX1U4ICAgbnZWZXJzaW9uOworICAgIH0sIC8vZmllbGRzCisKKyAgICB7CisgICAgICAgIC8vIE5WX1RBQkxFX1JBVEVfUE9XRVJfU0VUVElOR1MKKyAgICAgICAgeworICAgICAgICAgICAgLy8gdHlwZWRlZiB0QU5JX1MxNiB0UG93ZXJkQm07CisgICAgICAgICAgICAvL3R5cGVkZWYgdFBvd2VyZEJtIHRSYXRlR3JvdXBQd3JbTlVNX0hBTF9QSFlfUkFURVNdOworICAgICAgICAgICAgLy90UmF0ZUdyb3VwUHdyICAgICAgIHB3ck9wdGltdW1bTlVNX1JGX1NVQkJBTkRTXTsKKyAgICAgICAgICAgIC8vMi40RworICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vODAyLjExYiBSYXRlcworICAgICAgICAgICAgICAgIHsxOTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQl9MT05HXzFfTUJQUywKKyAgICAgICAgICAgICAgICB7MTkwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfTE9OR18yX01CUFMsCisgICAgICAgICAgICAgICAgezE5MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX0xPTkdfNV81X01CUFMsCisgICAgICAgICAgICAgICAgezE5MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX0xPTkdfMTFfTUJQUywKKyAgICAgICAgICAgICAgICB7MTkwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfU0hPUlRfMl9NQlBTLAorICAgICAgICAgICAgICAgIHsxOTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQl9TSE9SVF81XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTkwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfU0hPUlRfMTFfTUJQUywKKworICAgICAgICAgICAgICAgIC8vMTFBIDIwTUh6IFJhdGVzCisgICAgICAgICAgICAgICAgezE3MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzZfTUJQUywKKyAgICAgICAgICAgICAgICB7MTcwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfOV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV8xMl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV8xOF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV8yNF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV8zNl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV80OF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV81NF9NQlBTLAorCisgICAgICAgICAgICAgICAgLy9EVVAgMTFBIDQwTUh6IFJhdGVzCisgICAgICAgICAgICAgICAgezE3MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF82X01CUFMsCisgICAgICAgICAgICAgICAgezE3MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF85X01CUFMsCisgICAgICAgICAgICAgICAgezE3MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF8xMl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfMThfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzI0X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF8zNl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfNDhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTUwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzU0X01CUFMsCisKKyAgICAgICAgICAgICAgICAvL01DUyBJbmRleCAjMC03KDIwLzQwTUh6KQorICAgICAgICAgICAgICAgIHsxNzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzZfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzEzX01CUFMsCisgICAgICAgICAgICAgICAgezE2NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfMTlfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzI2X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfMzlfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU181Ml9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzU4XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU182NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzdfMl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzE0XzRfTUJQUywKKyAgICAgICAgICAgICAgICB7MTY1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR18yMV83X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfMjhfOV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzQzXzNfTUJQUywKKyAgICAgICAgICAgICAgICB7MTUwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR181N184X01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfNjVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfNzJfMl9NQlBTLAorCisgICAgICAgICAgICAgICAgLy9NQ1MgSW5kZXggIzgtMTUoMjAvNDBNSHopCisgICAgICAgICAgICAgICAgezE3MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfMTNfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzI3X01CUFMsCisgICAgICAgICAgICAgICAgezE2NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfNDBfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzU0X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfODFfTUJQUywKKyAgICAgICAgICAgICAgICB7MTUwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl8xMDhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl8xMjFfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzEzNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHX0NCXzE1X01CUFMsCisgICAgICAgICAgICAgICAgezE3MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfMzBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTY1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl80NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHX0NCXzYwX01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfOTBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTUwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xMjBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xMzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xNTBfTUJQUywKKworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisgICAgICAgICAgICAgICAgLy8xMUFDIHJhdGVzCisgICAgICAgICAgICAgICAvLzExQSBkdXBsaWNhdGUgODBNSHogUmF0ZXMKKyAgICAgICAgICAgICAgICB7MTcwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF82X01CUFMsCisgICAgICAgICAgICAgICAgezE3MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfOV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzEyX01CUFMsCisgICAgICAgICAgICAgICAgezE2NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfMThfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF8yNF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzM2X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfNDhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTUwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF81NF9NQlBTLAorCisgICAgICAgICAgICAgICAvLzExYWMgMjBNSFogTkcsIFNHCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX05HSV82XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MDAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfMjBNSFpfTUNTXzFOU1NfQ0JfTkdJXzEzX01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX05HSV8xOV81X01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX05HSV8yNl9NQlBTLAorICAgICAgICAgICAgICAgIHswMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19DQl9OR0lfMzlfTUJQUywKKyAgICAgICAgICAgICAgICB7MDAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfMjBNSFpfTUNTXzFOU1NfQ0JfTkdJXzUyX01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX05HSV81OF81X01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX05HSV82NV9NQlBTLAorICAgICAgICAgICAgICAgIHswMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19DQl9OR0lfNzhfTUJQUywKKyNpZmRlZiBXQ05fUFJPTlRPCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX05HSV84Nl81X01CUFMsCisjZW5kaWYKKyAgICAgICAgICAgICAgICB7MDAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfMjBNSFpfTUNTXzFOU1NfQ0JfU0dJXzdfMl9NQlBTLAorICAgICAgICAgICAgICAgIHswMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19DQl9TR0lfMTRfNF9NQlBTLAorICAgICAgICAgICAgICAgIHswMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRF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wTUhaX01DU18xTlNTX0NCX1NHSV80NV9NQlBTLAorICAgICAgICAgICAgICAgIHswMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF80ME1IWl9NQ1NfMU5TU19DQl9TR0lfNjBfTUJQUywKKyAgICAgICAgICAgICAgICB7MDAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfNDBNSFpfTUNTXzFOU1NfQ0JfU0dJXzkwX01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzQwTUhaX01DU18xTlNTX0NCX1NHSV8xMjBfTUJQUywKKyAgICAgICAgICAgICAgICB7MDAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfNDBNSFpfTUNTXzFOU1NfQ0JfU0dJXzEzNV9NQlBTLAorICAgICAgICAgICAgICAgIHswMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF80ME1IWl9NQ1NfMU5TU19DQl9TR0lfMTUwX01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzQwTUhaX01DU18xTlNTX0NCX1NHSV8xODBfTUJQUywKKyAgICAgICAgICAgICAgICB7MDAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfNDBNSFpfTUNTXzFOU1NfQ0JfU0dJXzIwMF9NQlBTLAorCisgICAgICAgICAgICAgICAvLzExYWMgODBNSFogTkcsIFNHCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8yOV8zX01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV81OF81X01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV84N184X01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8xMTdfTUJQUywKKyAgICAgICAgICAgICAgICB7MDAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfTkdJXzE3NV81X01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8yMzRfTUJQUywKKyAgICAgICAgICAgICAgICB7MDAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfTkdJXzI2M18zX01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8yOTJfNV9NQlBTLAorICAgICAgICAgICAgICAgIHswMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9OR0lfMzUxX01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8zOTBfTUJQUywKKyAgICAgICAgICAgICAgICB7MDAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzMyXzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MDAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzY1X01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV85N181X01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV8xMzBfTUJQUywKKyAgICAgICAgICAgICAgICB7MDAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzE5NV9NQlBTLAorICAgICAgICAgICAgICAgIHswMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9TR0lfMjYwX01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV8yOTJfNV9NQlBTLAorICAgICAgICAgICAgICAgIHswMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9TR0lfMzI1X01CUFMsCisgICAgICAgICAgICAgICAgezAwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV8zOTBfTUJQUywKKyAgICAgICAgICAgICAgICB7MDAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzQzM18zX01CUFMsCisjZW5kaWYKKyAgICAgICAgICAgIH0sICAvLyAgICBSRl9TVUJCQU5EXzJfNF9HSFoKKyAgICAgICAgICAgIC8vIDVHIExvdworICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vODAyLjExYiBSYXRlcworICAgICAgICAgICAgICAgIHswfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQl9MT05HXzFfTUJQUywKKyAgICAgICAgICAgICAgICB7MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfTE9OR18yX01CUFMsCisgICAgICAgICAgICAgICAgezB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX0xPTkdfNV81X01CUFMsCisgICAgICAgICAgICAgICAgezB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX0xPTkdfMTFfTUJQUywKKyAgICAgICAgICAgICAgICB7MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfU0hPUlRfMl9NQlBTLAorICAgICAgICAgICAgICAgIHswfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQl9TSE9SVF81XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfU0hPUlRfMTFfTUJQUywKKworICAgICAgICAgICAgICAgIC8vLzExQSAyME1IeiBSYXRlcworICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV82X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzlfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfMTJfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfMThfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfMjRfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQ1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfMzZfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfNDhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfNTRfTUJQUywKKworICAgICAgICAgICAgICAgIC8vL0RVUCAxMUEgNDBNSHogUmF0ZXMKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzZfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzlfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzEyX01CUFMsCisgICAgICAgICAgICAgICAgezE2NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF8xOF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfMjRfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQ1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzM2X01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF80OF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfNTRfTUJQUywKKworICAgICAgICAgICAgICAgIC8vL01DUyBJbmRleCAjMC03KDIwLzQwTUh6KQorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzZfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzEzX01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfMTlfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzI2X01CUFMsCisgICAgICAgICAgICAgICAgezE0NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfMzlfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU181Ml9NQlBTLAorICAgICAgICAgICAgICAgIHsxMzUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzU4XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTIwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU182NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzdfMl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzE0XzRfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR18yMV83X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfMjhfOV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzQzXzNfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR181N184X01CUFMsCisgICAgICAgICAgICAgICAgezEzMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfNjVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTIwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR183Ml8yX01CUFMsCisKKyAgICAgICAgICAgICAgICAvLy9NQ1MgSW5kZXggIzgtMTUoMjAvNDBNSHopCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfMTNfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzI3X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfNDBfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzU0X01CUFMsCisgICAgICAgICAgICAgICAgezE0NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfODFfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl8xMDhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl8xMjFfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzEzNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHX0NCXzE1X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfMzBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTUwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl80NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHX0NCXzYwX01CUFMsCisgICAgICAgICAgICAgICAgezE0NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfOTBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xMjBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xMzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTIwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xNTBfTUJQUywKKworI2lmZGVmIFdMQU5fRkVBVFVVUkVfMTFBQworICAgICAgICAgICAgICAgIC8vLzExQUMgcmF0ZXMKKyAgICAgICAgICAgICAgIC8vLzExQSBkdXBsaWNhdGUgODBNSHogUmF0ZXMKKyAgICAgICAgICAgICAgICB7MTcwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF82X01CUFMsCisgICAgICAgICAgICAgICAgezE3MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfOV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzEyX01CUFMsCisgICAgICAgICAgICAgICAgezE2NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfMThfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF8yNF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzM2X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfNDhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTUwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF81NF9NQlBTLAorCisgICAgICAgICAgICAgICAvLy8xMWFjIDIwTUhaIE5HLCBTRworICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19DQl9OR0lfNl81X01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX05HSV8xM19NQlBTLAorICAgICAgICAgICA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ICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV8yMV82X01CUFMsCisgICAgICAgICAgICAgICAgezEzMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV8yOF84X01CUFMsCisgICAgICAgICAgICAgICAgezEyNTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV80M18zX01CUFMsCisgICAgICAgICAgICAgICAgezEyMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV81N183X01CUFMsCisgICAgICAgICAgICAgICAgezExMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV82NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19DQl9TR0lfNzJfMl9NQlBTLAorICAgICAgICAgICAgICAgIHsgOTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19DQl9TR0lfODZfNl9NQlBTLAorI2lmZGVmIFdDTl9QUk9OVE8KKyAgICAgICAgICAgICAgICB7IDgwMH0sICAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX1NHSV85Nl8xX01CUFMsCisjZW5kaWYKKyAgICAgICAgICAgICAgIC8vMTFhYyA0ME1IWiBORywgU0cKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfNDBNSFpfTUNTXzFOU1NfQ0JfTkdJXzEzXzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfNDBNSFpfTUNTXzFOU1NfQ0JfTkdJXzI3X01CUFMsCisgICAgIC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F80ME1IWl9NQ1NfMU5TU19DQl9TR0lfNDVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTI1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfNDBNSFpfTUNTXzFOU1NfQ0JfU0dJXzYwX01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzQwTUhaX01DU18xTlNTX0NCX1NHSV85MF9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF80ME1IWl9NQ1NfMU5TU19DQl9TR0lfMTIwX01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzQwTUhaX01DU18xTlNTX0NCX1NHSV8xMzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfNDBNSFpfTUNTXzFOU1NfQ0JfU0dJXzE1MF9NQlBTLAorICAgICAgICAgICAgICAgIHsgOTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF80ME1IWl9NQ1NfMU5TU19DQl9TR0lfMTgwX01CUFMsCisgICAgICAgICAgICAgICAgeyA4MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzQwTUhaX01DU18xTlNTX0NCX1NHSV8yMDBfTUJQUywKKworCisgICAgICAgICAgICAgICAvLzExYWMgODBNSFogTkcsIFNHCisgICAgICAgICAgICAgICAgezEzMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8yOV8zX01CUFMsCisgICAgICAgICAgICAgICAgezExMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV81OF81X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV84N184X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8xMTdfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfTkdJXzE3NV81X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8yMzRfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfTkdJXzI2M18zX01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8yOTJfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsgOTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9OR0lfMzUxX01CUFMsCisgICAgICAgICAgICAgICAgeyA4MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX05HSV8zOTBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzMyXzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTEwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzY1X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV85N181X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV8xMzBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzE5NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9TR0lfMjYwX01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV8yOTJfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9TR0lfMzI1X01CUFMsCisgICAgICAgICAgICAgICAgeyA5MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV8zOTBfTUJQUywKKyAgICAgICAgICAgICAgICB7IDgwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzQzM18zX01CUFMsCisjZW5kaWYKKyAgICAgICAgICAgIH0sICAvLyAgICBSRl9TVUJCQU5EXzVfTE9XX0dIWgorICAgICAgICAgICAgLy8gNUcgTWlkCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy84MDIuMTFiIFJhdGVzCisgICAgICAgICAgICAgICAgezB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX0xPTkdfMV9NQlBTLAorICAgICAgICAgICAgICAgIHswfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQl9MT05HXzJfTUJQUywKKyAgICAgICAgICAgICAgICB7MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfTE9OR181XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfTE9OR18xMV9NQlBTLAorICAgICAgICAgICAgICAgIHswfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQl9TSE9SVF8yX01CUFMsCisgICAgICAgICAgICAgICAgezB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX1NIT1JUXzVfNV9NQlBTLAorICAgICAgICAgICAgICAgIHswfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQl9TSE9SVF8xMV9NQlBTLAorCisgICAgICAgICAgICAgICAgLy8vMTFBIDIwTUh6IFJhdGVzCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzZfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfOV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV8xMl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV8xOF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV8yNF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV8zNl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV80OF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV81NF9NQlBTLAorCisgICAgICAgICAgICAgICAgLy8vRFUgUCAxMUEgNDBNSHogUmF0ZXMKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzZfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzlfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzEyX01CUFMsCisgICAgICAgICAgICAgICAgezE2NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF8xOF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfMjRfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQ1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzM2X01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF80OF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfNTRfTUJQUywKKworICAgICAgICAgICAgICAgIC8vL01DU1MgSW5kZXggIzAtNygyMC80ME1IeikKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU182XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU18xM19NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzE5XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTUwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU18yNl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzM5X01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfNTJfTUJQUywKKyAgICAgICAgICAgICAgICB7MTM1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU181OF81X01CUFMsCisgICAgICAgICAgICAgICAgezEyMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfNjVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR183XzJfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR18xNF80X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfMjFfN19NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzI4XzlfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQ1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR180M18zX01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfNTdfOF9NQlBTLAorICAgICAgICAgICAgICAgIHsxMzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzY1X01CUFMsCisgICAgICAgICAgICAgICAgezEyMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfNzJfMl9NQlBTLAorCisgICAgICAgICAgICAgICAgLy8vTUNTUyBJbmRleCAjOC0xNSgyMC80ME1IeikKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl8xM181X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfMjdfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl80MF81X01CUFMsCisgICAgICAgICAgICAgICAgezE1MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfNTRfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQ1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl84MV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzEwOF9NQlBTLAorICAgICAgICAgICAgICAgIHsxMzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzEyMV81X01CUFMsCisgICAgICAgICAgICAgICAgezEyMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfMTM1X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfMTVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl8zMF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHX0NCXzQ1X01CUFMsCisgICAgICAgICAgICAgICAgezE1MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfNjBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQ1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl85MF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHX0NCXzEyMF9NQlBTLAorICAgICAgICAgICAgICAgIHsxMzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHX0NCXzEzNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHX0NCXzE1MF9NQlBTLAorCisjaWZkZWYgV0xBTl9GRUFUVVVSRV8xMTFBQworICAgICAgICAgICAgICAgIC8vLzExQ0FDIHJhdGVzCisgICAgICAgICAgICAgICAvLy8xMUFkIGR1cGxpY2F0ZSA4ME1IeiBSYXRlcworICAgICAgICAgICAgICAgIHsxNzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzZfTUJQUywKKyAgICAgICAgICAgICAgICB7MTcwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF85X01CUFMsCisgICAgICAgICAgICAgICAgezE3MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfMTJfTUJQUywKKyAgICAgICAgICAgICAgICB7MTY1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF8xOF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzI0X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfMzZfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF80OF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzU0X01CUFMsCisKKyAgICAgICAgICAgICAgIC8vLzExYSBjIDIwTUhaIE5HLCBTRworICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19DQl9OR0lfNl81X01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX05H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AgICAgICAgICAgICAgezEzNTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV8yMV82X01CUFMsCisgICAgICAgICAgICAgICAgezEzMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV8yOF84X01CUFMsCisgICAgICAgICAgICAgICAgezEyNTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV80M18zX01CUFMsCisgICAgICAgICAgICAgICAgezEyMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV81N183X01CUFMsCisgICAgICAgICAgICAgICAgezExMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV82NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19DQl9TR0lfNzJfMl9NQlBTLAorICAgICAgICAgICAgICAgIHsgOTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19DQl9TR0lfODZfNl9NQlBTLAorI2lmZGVmIFdDTl9QUk9OVE8KKyAgICAgICAgICAgICAgICB7IDgwMH0sICAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX1NHSV85Nl8xX01CUFMsCisjZW5kaWYKKyAgICAgICAgICAgICAgIC8vMTFhYyA0ME1IWiBORywgU0cKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfNDBNSFpfTUNTXzFOU1NfQ0JfTkdJXzEzXzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfNDBNSFpfTUNTXzFOU1NfQ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BNSFpfTUNTXzFOU1NfQ0JfU0dJXzk3XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzEzMF9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9TR0lfMTk1X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV8yNjBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzI5Ml81X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV8zMjVfTUJQUywKKyAgICAgICAgICAgICAgICB7IDkwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzM5MF9NQlBTLAorICAgICAgICAgICAgICAgIHsgODAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9TR0lfNDMzXzNfTUJQUywKKyNlbmRpZgorICAgICAgICAgICAgfSwgIC8vICAgIC8vICAgICBSRl9TVUJCQU5EXzVfTUlEX0dIWgorICAgICAgICAgICAgLy8gNUcgSGlnaAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vODAyLjExYiBSYXRlcworICAgICAgICAgICAgICAgIHswfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQl9MT05HXzFfTUJQUywKKyAgICAgICAgICAgICAgICB7MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfTE9OR18yX01CUFMsCisgICAgICAgICAgICAgICAgezB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX0xPTkdfNV81X01CUFMsCisgICAgICAgICAgICAgICAgezB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX0xPTkdfMTFfTUJQUywKKyAgICAgICAgICAgICAgICB7MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfU0hPUlRfMl9NQlBTLAorICAgICAgICAgICAgICAgIHswfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQl9TSE9SVF81XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfU0hPUlRfMTFfTUJQUywKKworICAgICAgICAgICAgICAgIC8vLzExQSAyME1IeiBSYXRlcworICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV82X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzlfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfMTJfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfMThfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfMjRfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQ1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfMzZfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfNDhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfNTRfTUJQUywKKworICAgICAgICAgICAgICAgIC8vL0RVIFAgMTFBIDQwTUh6IFJhdGVzCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF82X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF85X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF8xMl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfMThfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzI0X01CUFMsCisgICAgICAgICAgICAgICAgezE0NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF8zNl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfNDhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzU0X01CUFMsCisKKyAgICAgICAgICAgICAgICAvLy9NQ1NTIEluZGV4ICMwLTcoMjAvNDBNSHopCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfNl81X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfMTNfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU18xOV81X01CUFMsCisgICAgICAgICAgICAgICAgezE1MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfMjZfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQ1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU18zOV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzUyX01CUFMsCisgICAgICAgICAgICAgICAgezEzNTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfNThfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzY1X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfN18yX01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfMTRfNF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzIxXzdfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR18yOF85X01CUFMsCisgICAgICAgICAgICAgICAgezE0NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfNDNfM19NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzU3XzhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR182NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzcyXzJfTUJQUywKKworICAgICAgICAgICAgICAgIC8vL01DU1MgSW5kZXggIzgtMTUoMjAvNDBNSHopCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfMTNfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzI3X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfNDBfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzU0X01CUFMsCisgICAgICAgICAgICAgICAgezE0NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfODFfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl8xMDhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl8xMjFfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzEzNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHX0NCXzE1X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfMzBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTUwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl80NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHX0NCXzYwX01CUFMsCisgICAgICAgICAgICAgICAgezE0NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfOTBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xMjBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xMzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTIwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xNTBfTUJQUywKKworI2lmZGVmIFdMQU5fRkVBVFVVUkVfMTFBQworICAgICAgICAgICAgICAgIC8vLzExQ0FDIHJhdGVzCisgICAgICAgICAgICAgICAvLy8xMUFkIGR1cGxpY2F0ZSA4ME1IeiBSYXRlcworICAgICAgICAgICAgICAgIHsxNzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzZfTUJQUywKKyAgICAgICAgICAgICAgICB7MTcwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF85X01CUFMsCisgICAgICAgICAgICAgICAgezE3MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfMTJfTUJQUywKKyAgICAgICAgICAgICAgICB7MTY1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF8xOF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzI0X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfMzZfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF80OF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzU0X01CUFMsCisKKyAgICAgICAgICAgICAgIC8vLzExYSBjIDIwTUhaIE5HLCBTRworICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19DQl9OR0lfNl81X01CUFMsCisgICAgICAgICAg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vLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV8xNF80X01CUFMsCisgICAgICAgICAgICAgICAgezEzNTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV8yMV82X01CUFMsCisgICAgICAgICAgICAgICAgezEzMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV8yOF84X01CUFMsCisgICAgICAgICAgICAgICAgezEyNTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV80M18zX01CUFMsCisgICAgICAgICAgICAgICAgezEyMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV81N183X01CUFMsCisgICAgICAgICAgICAgICAgezExMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV82NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19DQl9TR0lfNzJfMl9NQlBTLAorICAgICAgICAgICAgICAgIHsgOTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19DQl9TR0lfODZfNl9NQlBTLAorI2lmZGVmIFdDTl9QUk9OVE8KKyAgICAgICAgICAgICAgICB7IDgwMH0sICAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX1NHSV85Nl8xX01CUFMsCisjZW5kaWYKKyAgICAgICAgICAgICAgIC8vMTFhYyA0ME1IWiBORywgU0cKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfNDBNSFpfTUNTXzFOU1NfQ0JfTkdJXzEzXzVfTUJQUywKKyAgICAgICAg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NjVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzk3XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzEzMF9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9TR0lfMTk1X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV8yNjBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzI5Ml81X01CUFMsCisgICAgICAgICAgICAgICAgezEwMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzgwTUhaX01DU18xTlNTX0NCX1NHSV8zMjVfTUJQUywKKyAgICAgICAgICAgICAgICB7IDkwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9WSFRfODBNSFpfTUNTXzFOU1NfQ0JfU0dJXzM5MF9NQlBTLAorICAgICAgICAgICAgICAgIHsgODAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF84ME1IWl9NQ1NfMU5TU19DQl9TR0lfNDMzXzNfTUJQUywKKyNlbmRpZgorICAgICAgICAgICAgfSwgIC8vICAgIFJGX1NVQkJBTkRfNV9ISUdIX0dIWiwKKyAgICAgICAgICAgIC8vIDQuOUcKKworICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vODAyLjExYiBSYXRlcworICAgICAgICAgICAgICAgIHswfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQl9MT05HXzFfTUJQUywKKyAgICAgICAgICAgICAgICB7MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfTE9OR18yX01CUFMsCisgICAgICAgICAgICAgICAgezB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX0xPTkdfNV81X01CUFMsCisgICAgICAgICAgICAgICAgezB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFCX0xPTkdfMTFfTUJQUywKKyAgICAgICAgICAgICAgICB7MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfU0hPUlRfMl9NQlBTLAorICAgICAgICAgICAgICAgIHswfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQl9TSE9SVF81XzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUJfU0hPUlRfMTFfTUJQUywKKworICAgICAgICAgICAgICAgIC8vLzExQSAyME1IeiBSYXRlcworICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV82X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBXzlfTUJQUywKKyAgICAgICAgICAgICAgICB7MTYwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfMTJfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfMThfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfMjRfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQ1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfMzZfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfNDhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfNTRfTUJQUywKKworICAgICAgICAgICAgICAgIC8vL0RVIFAgMTFBIDQwTUh6IFJhdGVzCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF82X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF85X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF8xMl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjUwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfMThfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzI0X01CUFMsCisgICAgICAgICAgICAgICAgezE0NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBX0RVUF8zNl9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQV9EVVBfNDhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFfRFVQXzU0X01CUFMsCisKKyAgICAgICAgICAgICAgICAvLy9NQ1NTIEluZGV4ICMwLTcoMjAvNDBNSHopCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfNl81X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfMTNfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU18xOV81X01CUFMsCisgICAgICAgICAgICAgICAgezE1MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfMjZfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQ1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU18zOV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzUyX01CUFMsCisgICAgICAgICAgICAgICAgezEzNTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfNThfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTXzY1X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfN18yX01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfMTRfNF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTUwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzIxXzdfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR18yOF85X01CUFMsCisgICAgICAgICAgICAgICAgezE0NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfNDNfM19NQlBTLAorICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzU3XzhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR182NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHXzcyXzJfTUJQUywKKworICAgICAgICAgICAgICAgIC8vL01DU1MgSW5kZXggIzgtMTUoMjAvNDBNSHopCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfMTNfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzI3X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfNDBfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzU0X01CUFMsCisgICAgICAgICAgICAgICAgezE0NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfQ0JfODFfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl8xMDhfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19DQl8xMjFfNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX0NCXzEzNV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHX0NCXzE1X01CUFMsCisgICAgICAgICAgICAgICAgezE2MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfMzBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTUwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl80NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX01DU18xTlNTX01NX1NHX0NCXzYwX01CUFMsCisgICAgICAgICAgICAgICAgezE0NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfOTBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xMjBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTMwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xMzVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTIwMH0sICAgIC8vIEhBTF9QSFlfUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xNTBfTUJQUywKKworI2lmZGVmIFdMQU5fRkVBVFVVUkVfMTFBQworICAgICAgICAgICAgICAgIC8vLzExQ0FDIHJhdGVzCisgICAgICAgICAgICAgICAvLy8xMUFkIGR1cGxpY2F0ZSA4ME1IeiBSYXRlcworICAgICAgICAgICAgICAgIHsxNzAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzZfTUJQUywKKyAgICAgICAgICAgICAgICB7MTcwMH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF85X01CUFMsCisgICAgICAgICAgICAgICAgezE3MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfMTJfTUJQUywKKyAgICAgICAgICAgICAgICB7MTY1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF8xOF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNjAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzI0X01CUFMsCisgICAgICAgICAgICAgICAgezE1NTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfMTFBQ19EVVBfMzZfTUJQUywKKyAgICAgICAgICAgICAgICB7MTU1MH0sICAgIC8vIEhBTF9QSFlfUkFURV8xMUFDX0RVUF80OF9NQlBTLAorICAgICAgICAgICAgICAgIHsxNTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFXzExQUNfRFVQXzU0X01CUFMsCisKKyAgICAgICAgICAgICAgIC8vLzExYSBjIDIwTUhaIE5HLCBTRworICAgICAgICAgICAgICAgIHsxNDAwfSwgICAgLy8gSEFMX1BIWV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l9NQ1NfMU5TU19DQl9TR0lfN18yX01CUFMsCisgICAgICAgICAgICAgICAgezE0MDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV8xNF80X01CUFMsCisgICAgICAgICAgICAgICAgezEzNTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV8yMV82X01CUFMsCisgICAgICAgICAgICAgICAgezEzMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV8yOF84X01CUFMsCisgICAgICAgICAgICAgICAgezEyNTB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV80M18zX01CUFMsCisgICAgICAgICAgICAgICAgezEyMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV81N183X01CUFMsCisgICAgICAgICAgICAgICAgezExMDB9LCAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX0NCX1NHSV82NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19DQl9TR0lfNzJfMl9NQlBTLAorICAgICAgICAgICAgICAgIHsgOTAwfSwgICAgLy8gSEFMX1BIWV9SQVRFX1ZIVF8yME1IWl9NQ1NfMU5TU19DQl9TR0lfODZfNl9NQlBTLAorI2lmZGVmIFdDTl9QUk9OVE8KKyAgICAgICAgICAgICAgICB7IDgwMH0sICAgICAvLyBIQUxfUEhZX1JBVEVfVkhUXzIwTUhaX01DU18xTlNTX1NHSV85Nl8xX01CUFMsCisjZW5kaWYKKyAgICAgICAgICAgICAgIC8vMTFhYyA0ME1IWiBORywgU0cKKyAgICAgICAgICAgICAgICB7MTQwMH0sICAgIC8vIEhBTF9QSFlfU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IHN0cnVjdAorICAgICAgICAgICAgLy8geworICAgICAgICAgICAgLy8gICAgIHRBTklfQk9PTEVBTiBlbmFibGVkOworICAgICAgICAgICAgLy8gICAgIHRQb3dlcmRCbSBwd3JMaW1pdDsKKyAgICAgICAgICAgIC8vIH1zUmVndWxhdG9yeUNoYW5uZWw7CisKKyAgICAgICAgICAgIC8vIHR5cGVkZWYgc3RydWN0CisgICAgICAgICAgICAvLyB7CisgICAgICAgICAgICAvLyAgICAgc1JlZ3VsYXRvcnlDaGFubmVsIGNoYW5uZWxzW05VTV9SRl9DSEFOTkVMU107CisgICAgICAgICAgICAvLyAgICAgdUFic1B3clByZWNpc2lvbiBhbnRlbm5hR2FpbltOVU1fUkZfU1VCQkFORFNdOworICAgICAgICAgICAgLy8gICAgIHVBYnNQd3JQcmVjaXNpb24gYlJhdGVQb3dlck9mZnNldFtOVU1fMl80R0haX0NIQU5ORUxTXTsKKyAgICAgICAgICAgIC8vIH1zUmVndWxhdG9yeURvbWFpbnM7CisKKyAgICAgICAgICAgIC8vc1JlZ3VsYXRvcnlEb21haW5zICByZWdEb21haW5zW05VTV9SRUdfRE9NQUlOU107CisKKworICAgICAgICAgICAgeyAgIC8vIFJFR19ET01BSU5fRkNDIHN0YXJ0CisgICAgICAgICAgICAgICAgeyAvL3NSZWd1bGF0b3J5Q2hhbm5lbCBzdGFydAorICAgICAgICAgICAgICAgICAgICAvL2VuYWJsZWQsIHB3ckxpbWl0CisgICAgICAgICAgICAgICAgICAgIC8vMi40R0h6IEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyM30sICAgICAgICAgICAvL1JGX0NIQU5fMSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyM30sICAgICAgICAgICAvL1JGX0NIQU5fMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyM30sICAgICAgICAgICAvL1JGX0NIQU5fMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyM30sICAgICAgICAgICAvL1JGX0NIQU5fNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyM30sICAgICAgICAgICAvL1JGX0NIQU5fNSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyM30sICAgICAgICAgICAvL1JGX0NIQU5fNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyM30sICAgICAgICAgICAvL1JGX0NIQU5fNywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyM30sICAgICAgICAgICAvL1JGX0NIQU5fOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyM30sICAgICAgICAgICAvL1JGX0NIQU5fOSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMn0sICAgICAgICAgICAvL1JGX0NIQU5fMTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjJ9LCAgICAgICAgICAgLy9SRl9DSEFOXzExLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAzMH0sICAgICAgICAgICAvL1JGX0NIQU5fMTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgLy9SRl9DSEFOXzE0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNC45R0h6IEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yNDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjQ0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzI0OCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yNTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjA4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzIxMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yMTYsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IExvdyAmIE1pZCBVLU5JSSBCYW5kLCBub25lIENCCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTd9LCAgICAgICAgICAgICAvL1JGX0NIQU5fMzYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTd9LCAgICAgICAgICAgICAvL1JGX0NIQU5fNDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTd9LCAgICAgICAgICAgICAvL1JGX0NIQU5fNDQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTd9LCAgICAgICAgICAgICAvL1JGX0NIQU5fNDgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RGUywgMjR9LCAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RGUywgMjR9LCAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNTYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RGUywgMjR9LCAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNjAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RGUywgMjR9LCAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNjQsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IE1pZCBCYW5kIC0gRVRTSSwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDIyfSwgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEwMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMDQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RGUywgMjR9LCAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTA4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzExMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMTYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgICAvL1JGX0NIQU5fMTIwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAgLy9SRl9DSEFOXzEyNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMjgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RGUywgMjR9LCAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTMyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEzNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xNDAsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IEhpZ2ggVS1OSUkgQmFuZCwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTQ5LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTUzLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTU3LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTYxLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDB9LCAgICAgICAgICAgICAvL1JGX0NIQU5fMTY1LAorCisgICAgICAgICAgICAgICAgICAgIC8vMi40R0h6IEJhbmQsIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjJ9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzMsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzUsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzcsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjJ9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzksCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTEsCisKKyAgICAgICAgICAgICAgICAgICAgLy8gNC45R0h6IEJhbmQsIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzI0MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjQ2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yNTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzIxMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjE0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBMb3cgJiBNaWQgVS1OSUkgQmFuZCwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMzgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzQyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF80NiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzU0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF81OCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyNX0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNjIsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IE1pZCBCYW5kIC0gRVRTSSwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEwMgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTA2CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMTAKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTE0CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzExOAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMjIKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTI2CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEzMAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTM0CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMzgKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogSGlnaCBVLU5JSSBCYW5kLCAgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE1MSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE1NSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE1OSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE2MworICAgICAgICAgICAgICAgIH0sIC8vc1JlZ3VsYXRvcnlDaGFubmVsIGVuZAorCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDAgfSwgIC8vIFJGX1NVQkJBTkRfMl80X0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0sICAgLy8gUkZfU1VCQkFORF81X0xPV19HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9LCAgIC8vIFJGX1NVQkJBTkRfNV9NSURfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSwgICAvLyBSRl9TVUJCQU5EXzVfSElHSF9HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9ICAgIC8vIFJGX1NVQkJBTkRfNF85X0dIWgorICAgICAgICAgICAgICAgIH0sCisKKyAgICAgICAgICAgICAgICB7IC8vIGJSYXRlUG93ZXJPZmZzZXQgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSwgLy8gYlJhdGVQb3dlck9mZnNldCBlbmQKKworICAgICAgICAgICAgICAgIHsgLy8gZ25SYXRlUG93ZXJPZmZzZXQgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy9hcHBseSB0byBhbGwgMi40IGFuZCA1RyBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSAvLyBnblJhdGVQb3dlck9mZnNldCBlbmQKKyAgICAgICAgICAgIH0sIC8vIFJFR19ET01BSU5fRkNDIGVuZAorCisgICAgICAgICAgICB7ICAgLy8gUkVHX0RPTUFJTl9FVFNJIHN0YXJ0CisgICAgICAgICAgICAgICAgeyAvL3NSZWd1bGF0b3J5Q2hhbm5lbCBzdGFydAorICAgICAgICAgICAgICAgICAgICAvL2VuYWJsZWQsIHB3ckxpbWl0CisgICAgICAgICAgICAgICAgICAgIC8vMi40R0h6IEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fMSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fNSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fNywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fOSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fMTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjB9LCAgICAgICAgICAgLy9SRl9DSEFOXzExLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE5fSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxOX0sICAgICAgICAgICAvL1JGX0NIQU5fMTMsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgLy9SRl9DSEFOXzE0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNC45R0h6IEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzI0MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzI0NCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzI0OCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzI1MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzIwOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzIxMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzIxNiwKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogTG93ICYgTWlkIFUtTklJIEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzM2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fNDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl80NCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzQ4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzUyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzU2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzYwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzY0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBNaWQgQmFuZCAtIEVUU0ksIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTA0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzEwOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTE2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTIwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTI0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTI4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzEzMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMzYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTQwLAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBIaWdoIFUtTklJIEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE0OSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE1MywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE1NywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE2MSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE2NSwKKworICAgICAgICAgICAgICAgICAgICAvLzIuNEdIeiBCYW5kLCBjaGFubmVsIGJvbmRlZCBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8zLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF80LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF81LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF82LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF83LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF84LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF85LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTEsCisKKyAgICAgICAgICAgICAgICAgICAgLy8gNC45R0h6IEJhbmQsIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzI0MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjQ2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yNTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzIxMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjE0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBMb3cgJiBNaWQgVS1OSUkgQmFuZCwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMzgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzQyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF80NiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzU0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF81OCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNjIsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IE1pZCBCYW5kIC0gRVRTSSwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEwMgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTA2CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMTAKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTE0CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzExOAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMjIKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTI2CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEzMAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTM0CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMzgKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogSGlnaCBVLU5JSSBCYW5kLCAgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTUxLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xNTUsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE1OSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE2MworICAgICAgICAgICAgICAgIH0sIC8vc1JlZ3VsYXRvcnlDaGFubmVsIGVuZAorCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDAgfSwgIC8vIFJGX1NVQkJBTkRfMl80X0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0sICAgLy8gUkZfU1VCQkFORF81X0xPV19HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9LCAgIC8vIFJGX1NVQkJBTkRfNV9NSURfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSwgICAvLyBSRl9TVUJCQU5EXzVfSElHSF9HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9ICAgIC8vIFJGX1NVQkJBTkRfNF85X0dIWgorICAgICAgICAgICAgICAgIH0sCisKKyAgICAgICAgICAgICAgICB7IC8vIGJSYXRlUG93ZXJPZmZzZXQgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSwgLy8gYlJhdGVQb3dlck9mZnNldCBlbmQKKworICAgICAgICAgICAgICAgIHsgLy8gZ25SYXRlUG93ZXJPZmZzZXQgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy9hcHBseSB0byBhbGwgMi40IGFuZCA1RyBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSAvLyBnblJhdGVQb3dlck9mZnNldCBlbmQKKyAgICAgICAgICAgIH0sIC8vIFJFR19ET01BSU5fRVRTSSBlbmQKKworICAgICAgICAgICAgeyAgIC8vIFJFR19ET01BSU5fSkFQQU4gc3RhcnQKKyAgICAgICAgICAgICAgICB7IC8vc1JlZ3VsYXRvcnlDaGFubmVsIHN0YXJ0CisgICAgICAgICAgICAgICAgICAgIC8vZW5hYmxlZCwgcHdyTGltaXQKKyAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZCwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjB9LCAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxOH0sICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisKKyAgICAgICAgICAgICAgICAgICAgLy80LjlHSHogQmFuZCwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzI0MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yNDQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjQ4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzI1MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yMDgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjEyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzIxNiwKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogTG93ICYgTWlkIFUtTklJIEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxN30sICAgICAgICAgICAgLy9SRl9DSEFOXzM2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE3fSwgICAgICAgICAgICAvL1JGX0NIQU5fNDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl80NCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxN30sICAgICAgICAgICAgLy9SRl9DSEFOXzQ4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fNTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RGUywgMjR9LCAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81NiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzYwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fNjQsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IE1pZCBCYW5kIC0gRVRTSSwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDIyfSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTAwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTA0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTA4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTE2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDB9LCAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTIwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDB9LCAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTI0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDB9LCAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTI4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTMyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTM2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQwLAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBIaWdoIFUtTklJIEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNDksCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTUzLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE1NywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNjEsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNjUsCisKKyAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZCwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMn0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMn0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfOSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMSwKKworICAgICAgICAgICAgICAgICAgICAvLyA0LjlHSHogQmFuZCwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjQyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yNDYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzI1MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjEwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yMTQsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IExvdyAmIE1pZCBVLU5JSSBCYW5kLCBjaGFubmVsIGJvbmRlZCBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8zOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNDIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzQ2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF81MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNTQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzU4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI1fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF82MiwKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogTWlkIEJhbmQgLSBFVFNJLCBjaGFubmVsIGJvbmRlZCBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTAyCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMDYKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzExMAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMTQKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTE4CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEyMgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMjYKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTMwCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMzQKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEzOAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBIaWdoIFUtTklJIEJhbmQsICBjaGFubmVsIGJvbmRlZCBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTUxLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTU1LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTU5LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTYzCisgICAgICAgICAgICAgICAgfSwgLy9zUmVndWxhdG9yeUNoYW5uZWwgZW5kCisKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgLy8gUkZfU1VCQkFORF8yXzRfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSwgICAvLyBSRl9TVUJCQU5EXzVfTE9XX0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0sICAgLy8gUkZfU1VCQkFORF81X01JRF9HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9LCAgIC8vIFJGX1NVQkJBTkRfNV9ISUdIX0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0gICAgLy8gUkZfU1VCQkFORF80XzlfR0haCisgICAgICAgICAgICAgICAgfSwKKworICAgICAgICAgICAgICAgIHsgLy8gYlJhdGVQb3dlck9mZnNldCBzdGFydAorICAgICAgICAgICAgICAgICAgICAvLzIuNEdIeiBCYW5kCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzIsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzMsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzQsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzUsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzYsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzcsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzgsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzksCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEwLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTIsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEzLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xNCwKKyAgICAgICAgICAgICAgICB9LCAvLyBiUmF0ZVBvd2VyT2Zmc2V0IGVuZAorCisgICAgICAgICAgICAgICAgeyAvLyBnblJhdGVQb3dlck9mZnNldCBzdGFydAorICAgICAgICAgICAgICAgICAgICAvL2FwcGx5IHRvIGFsbCAyLjQgYW5kIDVHIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzIsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzMsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzQsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzUsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzYsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzcsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzgsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzksCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEwLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTIsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEzLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xNCwKKyAgICAgICAgICAgICAgICB9IC8vIGduUmF0ZVBvd2VyT2Zmc2V0IGVuZAorICAgICAgICAgICAgfSwgLy8gUkVHX0RPTUFJTl9KQVBBTiBlbmQKKworICAgICAgICAgICAgeyAgIC8vIFJFR19ET01BSU5fV09STEQgc3RhcnQKKyAgICAgICAgICAgICAgICB7IC8vc1JlZ3VsYXRvcnlDaGFubmVsIHN0YXJ0CisgICAgICAgICAgICAgICAgICAgIC8vZW5hYmxlZCwgcHdyTGltaXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vMi40R0h6IEJhbmQKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fMSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fNSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fNywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fOSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fMTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTZ9LCAgICAgICAgICAgLy9SRl9DSEFOXzExLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE2fSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fMTMsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgLy9SRl9DSEFOXzE0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNC45R0h6IEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yNDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjQ0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzI0OCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yNTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjA4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzIxMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yMTYsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IExvdyAmIE1pZCBVLU5JSSBCYW5kLCBub25lIENCCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8zNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxN30sICAgICAgICAgICAgLy9SRl9DSEFOXzQwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE3fSwgICAgICAgICAgICAvL1JGX0NIQU5fNDQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl80OCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzUyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ERlMsIDI0fSwgICAgICAgICAgICAgICAvL1JGX0NIQU5fNTYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RGUywgMjR9LCAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzY0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBNaWQgQmFuZCAtIEVUU0ksIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyMn0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEwMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEwNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEwOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzExMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzExNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAwfSwgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAwfSwgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAwfSwgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEzMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEzNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfREZTLCAyNH0sICAgICAgICAgICAgICAgLy9SRl9DSEFOXzE0MCwKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogSGlnaCBVLU5JSSBCYW5kLCBub25lIENCCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTQ5LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE1MywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNTcsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTYxLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTY1LAorCisgICAgICAgICAgICAgICAgICAgIC8vMi40R0h6IEJhbmQsIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjJ9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzMsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzUsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzcsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjJ9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzksCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTEsCisKKyAgICAgICAgICAgICAgICAgICAgLy8gNC45R0h6IEJhbmQsIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzI0MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjQ2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yNTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzIxMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjE0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBMb3cgJiBNaWQgVS1OSUkgQmFuZCwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMzgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzQyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF80NiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzU0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF81OCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyNX0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNjIsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IE1pZCBCYW5kIC0gRVRTSSwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEwMgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTA2CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMTAKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTE0CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzExOAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMjIKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTI2CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEzMAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTM0CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMzgKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogSGlnaCBVLU5JSSBCYW5kLCAgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE1MSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE1NSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE1OSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE2MworICAgICAgICAgICAgICAgIH0sIC8vc1JlZ3VsYXRvcnlDaGFubmVsIGVuZAorCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDAgfSwgIC8vIFJGX1NVQkJBTkRfMl80X0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0sICAgLy8gUkZfU1VCQkFORF81X0xPV19HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9LCAgIC8vIFJGX1NVQkJBTkRfNV9NSURfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSwgICAvLyBSRl9TVUJCQU5EXzVfSElHSF9HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9ICAgIC8vIFJGX1NVQkJBTkRfNF85X0dIWgorICAgICAgICAgICAgICAgIH0sCisKKyAgICAgICAgICAgICAgICB7IC8vIGJSYXRlUG93ZXJPZmZzZXQgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSwgLy8gYlJhdGVQb3dlck9mZnNldCBlbmQKKworICAgICAgICAgICAgICAgIHsgLy8gZ25SYXRlUG93ZXJPZmZzZXQgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy9hcHBseSB0byBhbGwgMi40IGFuZCA1RyBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSAvLyBnblJhdGVQb3dlck9mZnNldCBlbmQKKyAgICAgICAgICAgIH0sIC8vIFJFR19ET01BSU5fV09STEQgZW5kCisKKyAgICAgICAgICAgIHsgICAvLyBSRUdfRE9NQUlOX05fQU1FUl9FWENfRkNDIHN0YXJ0CisgICAgICAgICAgICAgICAgeyAvL3NSZWd1bGF0b3J5Q2hhbm5lbCBzdGFydAorICAgICAgICAgICAgICAgICAgICAvL2VuYWJsZWQsIHB3ckxpbWl0CisgICAgICAgICAgICAgICAgICAgIC8vMi40R0h6IEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fMSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fNSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fNywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fOSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNn0sICAgICAgICAgICAvL1JGX0NIQU5fMTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTZ9LCAgICAgICAgICAgLy9SRl9DSEFOXzExLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAzMH0sICAgICAgICAgICAvL1JGX0NIQU5fMTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgLy9SRl9DSEFOXzE0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNC45R0h6IEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yNDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjQ0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzI0OCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yNTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjA4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzIxMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yMTYsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IExvdyAmIE1pZCBVLU5JSSBCYW5kLCBub25lIENCCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8zNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxN30sICAgICAgICAgICAgLy9SRl9DSEFOXzQwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE3fSwgICAgICAgICAgICAvL1JGX0NIQU5fNDQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl80OCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl81MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl81NiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl82MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl82NCwKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogTWlkIEJhbmQgLSBFVFNJLCBub25lIENCCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIyfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTAwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzEwNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMDgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fMTEyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzExNiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzEyMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzEyNCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzEyOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMzIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fMTM2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE0MCwKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogSGlnaCBVLU5JSSBCYW5kLCBub25lIENCCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNDksCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNTMsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNTcsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xNjEsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE2NSwKKworICAgICAgICAgICAgICAgICAgICAvLzIuNEdIeiBCYW5kLCBjaGFubmVsIGJvbmRlZCBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIyfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8zLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF80LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF81LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF82LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF83LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF84LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIyfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF85LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzExLAorCisgICAgICAgICAgICAgICAgICAgIC8vIDQuOUdIeiBCYW5kLCBjaGFubmVsIGJvbmRlZCBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yNDIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzI0NiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjUwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yMTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzIxNCwKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogTG93ICYgTWlkIFUtTklJIEJhbmQsIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzM4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF80MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNDYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzUwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF81NCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNTgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjV9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzYyLAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBNaWQgQmFuZCAtIEVUU0ksIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMDIKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEwNgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTEwCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzExNAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMTgKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTIyCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEyNgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMzAKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEzNAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTM4CisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IEhpZ2ggVS1OSUkgQmFuZCwgIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xNTEsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xNTUsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDMwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xNTksCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xNjMKKyAgICAgICAgICAgICAgICB9LCAvL3NSZWd1bGF0b3J5Q2hhbm5lbCBlbmQKKworICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAvLyBSRl9TVUJCQU5EXzJfNF9HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9LCAgIC8vIFJGX1NVQkJBTkRfNV9MT1dfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSwgICAvLyBSRl9TVUJCQU5EXzVfTUlEX0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0sICAgLy8gUkZfU1VCQkFORF81X0hJR0hfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSAgICAvLyBSRl9TVUJCQU5EXzRfOV9HSFoKKyAgICAgICAgICAgICAgICB9LAorCisgICAgICAgICAgICAgICAgeyAvLyBiUmF0ZVBvd2VyT2Zmc2V0IHN0YXJ0CisgICAgICAgICAgICAgICAgICAgIC8vMi40R0h6IEJhbmQKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fOCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fOSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTAsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzExLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTMsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzE0LAorICAgICAgICAgICAgICAgIH0sIC8vIGJSYXRlUG93ZXJPZmZzZXQgZW5kCisKKyAgICAgICAgICAgICAgICB7IC8vIGduUmF0ZVBvd2VyT2Zmc2V0IHN0YXJ0CisgICAgICAgICAgICAgICAgICAgIC8vYXBwbHkgdG8gYWxsIDIuNCBhbmQgNUcgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fNywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fOCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fOSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTAsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzExLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMiwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTMsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzE0LAorICAgICAgICAgICAgICAgIH0gLy8gZ25SYXRlUG93ZXJPZmZzZXQgZW5kCisgICAgICAgICAgICB9LCAgIC8vIFJFR19ET01BSU5fTl9BTUVSX0VYQ19GQ0MgZW5kCisKKyAgICAgICAgICAgIHsgICAvLyBSRUdfRE9NQUlOX0FQQUMgc3RhcnQKKyAgICAgICAgICAgICAgICB7IC8vc1JlZ3VsYXRvcnlDaGFubmVsIHN0YXJ0CisgICAgICAgICAgICAgICAgICAgIC8vZW5hYmxlZCwgcHdyTGltaXQKKyAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZCwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI2fSwgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI2fSwgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI2fSwgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI2fSwgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI2fSwgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI2fSwgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI2fSwgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI2fSwgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI2fSwgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI2fSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyNn0sICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjZ9LCAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE2fSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisKKyAgICAgICAgICAgICAgICAgICAgLy80LjlHSHogQmFuZCwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzI0MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yNDQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjQ4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzI1MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yMDgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjEyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzIxNiwKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogTG93ICYgTWlkIFUtTklJIEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxN30sICAgICAgICAgICAgLy9SRl9DSEFOXzM2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE3fSwgICAgICAgICAgICAvL1JGX0NIQU5fNDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl80NCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxN30sICAgICAgICAgICAgLy9SRl9DSEFOXzQ4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzUyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzU2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzYwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzY0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBNaWQgQmFuZCAtIEVUU0ksIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjJ9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fMTA0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzEwOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fMTE2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTIwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTI0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTI4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzEzMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMzYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fMTQwLAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBIaWdoIFUtTklJIEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE0OSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE1MywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE1NywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE2MSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTY1LAorCisgICAgICAgICAgICAgICAgICAgIC8vMi40R0h6IEJhbmQsIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjJ9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzMsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzUsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzcsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjJ9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzksCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTEsCisKKyAgICAgICAgICAgICAgICAgICAgLy8gNC45R0h6IEJhbmQsIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzI0MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjQ2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yNTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzIxMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjE0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBMb3cgJiBNaWQgVS1OSUkgQmFuZCwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMzgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzQyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF80NiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzU0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF81OCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyNX0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNjIsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IE1pZCBCYW5kIC0gRVRTSSwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEwMgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTA2CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMTAKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTE0CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzExOAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMjIKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTI2CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEzMAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTM0CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMzgKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogSGlnaCBVLU5JSSBCYW5kLCAgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE1MSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE1NSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE1OSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE2MworICAgICAgICAgICAgICAgIH0sIC8vc1JlZ3VsYXRvcnlDaGFubmVsIGVuZAorCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDAgfSwgIC8vIFJGX1NVQkJBTkRfMl80X0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0sICAgLy8gUkZfU1VCQkFORF81X0xPV19HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9LCAgIC8vIFJGX1NVQkJBTkRfNV9NSURfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSwgICAvLyBSRl9TVUJCQU5EXzVfSElHSF9HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9ICAgIC8vIFJGX1NVQkJBTkRfNF85X0dIWgorICAgICAgICAgICAgICAgIH0sCisKKyAgICAgICAgICAgICAgICB7IC8vIGJSYXRlUG93ZXJPZmZzZXQgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSwgLy8gYlJhdGVQb3dlck9mZnNldCBlbmQKKworICAgICAgICAgICAgICAgIHsgLy8gZ25SYXRlUG93ZXJPZmZzZXQgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy9hcHBseSB0byBhbGwgMi40IGFuZCA1RyBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSAvLyBnblJhdGVQb3dlck9mZnNldCBlbmQKKyAgICAgICAgICAgIH0sIC8vIFJFR19ET01BSU5fQVBBQyBlbmQKKworICAgICAgICAgICAgeyAgIC8vIFJFR19ET01BSU5fS09SRUEgc3RhcnQKKyAgICAgICAgICAgICAgICB7IC8vc1JlZ3VsYXRvcnlDaGFubmVsIHN0YXJ0CisgICAgICAgICAgICAgICAgICAgIC8vZW5hYmxlZCwgcHdyTGltaXQKKyAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZCwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE1fSwgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE1fSwgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE1fSwgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE1fSwgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE1fSwgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE1fSwgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE1fSwgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE1fSwgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE1fSwgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE1fSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNX0sICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTV9LCAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE1fSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisKKyAgICAgICAgICAgICAgICAgICAgLy80LjlHSHogQmFuZCwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzI0MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yNDQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjQ4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzI1MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yMDgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjEyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzIxNiwKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogTG93ICYgTWlkIFUtTklJIEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxN30sICAgICAgICAgICAgLy9SRl9DSEFOXzM2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE3fSwgICAgICAgICAgICAvL1JGX0NIQU5fNDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl80NCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxN30sICAgICAgICAgICAgLy9SRl9DSEFOXzQ4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzUyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzU2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzYwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzY0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBNaWQgQmFuZCAtIEVUU0ksIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjJ9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fMTA0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzEwOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fMTE2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTIwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTI0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTI4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzEzMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMzYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fMTQwLAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBIaWdoIFUtTklJIEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE0OSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE1MywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE1NywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE2MSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTY1LAorCisgICAgICAgICAgICAgICAgICAgIC8vMi40R0h6IEJhbmQsIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjJ9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzMsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzUsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzcsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjJ9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzksCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTEsCisKKyAgICAgICAgICAgICAgICAgICAgLy8gNC45R0h6IEJhbmQsIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzI0MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjQ2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yNTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzIxMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjE0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBMb3cgJiBNaWQgVS1OSUkgQmFuZCwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMzgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzQyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF80NiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzU0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF81OCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyNX0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNjIsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IE1pZCBCYW5kIC0gRVRTSSwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEwMgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTA2CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMTAKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTE0CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzExOAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMjIKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTI2CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEzMAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTM0CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMzgKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogSGlnaCBVLU5JSSBCYW5kLCAgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE1MSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE1NSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE1OSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE2MworICAgICAgICAgICAgICAgIH0sIC8vc1JlZ3VsYXRvcnlDaGFubmVsIGVuZAorCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDAgfSwgIC8vIFJGX1NVQkJBTkRfMl80X0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0sICAgLy8gUkZfU1VCQkFORF81X0xPV19HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9LCAgIC8vIFJGX1NVQkJBTkRfNV9NSURfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSwgICAvLyBSRl9TVUJCQU5EXzVfSElHSF9HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9ICAgIC8vIFJGX1NVQkJBTkRfNF85X0dIWgorICAgICAgICAgICAgICAgIH0sCisKKyAgICAgICAgICAgICAgICB7IC8vIGJSYXRlUG93ZXJPZmZzZXQgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSwgLy8gYlJhdGVQb3dlck9mZnNldCBlbmQKKworICAgICAgICAgICAgICAgIHsgLy8gZ25SYXRlUG93ZXJPZmZzZXQgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy9hcHBseSB0byBhbGwgMi40IGFuZCA1RyBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSAvLyBnblJhdGVQb3dlck9mZnNldCBlbmQKKyAgICAgICAgICAgIH0sIC8vIFJFR19ET01BSU5fS09SRUEgZW5kCisKKyAgICAgICAgICAgIHsgICAvLyBSRUdfRE9NQUlOX0hJXzVHSFogc3RhcnQKKyAgICAgICAgICAgICAgICB7IC8vc1JlZ3VsYXRvcnlDaGFubmVsIHN0YXJ0CisgICAgICAgICAgICAgICAgICAgIC8vZW5hYmxlZCwgcHdyTGltaXQKKyAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZCwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE0fSwgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE0fSwgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE0fSwgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE0fSwgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE0fSwgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE0fSwgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE0fSwgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE0fSwgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE0fSwgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE0fSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxNH0sICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTR9LCAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE0fSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisKKyAgICAgICAgICAgICAgICAgICAgLy80LjlHSHogQmFuZCwgbm9uZSBDQgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzI0MCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yNDQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjQ4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzI1MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjN9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8yMDgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDIzfSwgICAgICAgICAgICAvL1JGX0NIQU5fMjEyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyM30sICAgICAgICAgICAgLy9SRl9DSEFOXzIxNiwKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogTG93ICYgTWlkIFUtTklJIEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxN30sICAgICAgICAgICAgLy9SRl9DSEFOXzM2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDE3fSwgICAgICAgICAgICAvL1JGX0NIQU5fNDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl80NCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxN30sICAgICAgICAgICAgLy9SRl9DSEFOXzQ4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzUyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzU2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzYwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzY0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBNaWQgQmFuZCAtIEVUU0ksIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjJ9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMDAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fMTA0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzEwOCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMTIsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fMTE2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTIwLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTI0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTI4LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyNH0sICAgICAgICAgICAgLy9SRl9DSEFOXzEzMiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl8xMzYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI0fSwgICAgICAgICAgICAvL1JGX0NIQU5fMTQwLAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBIaWdoIFUtTklJIEJhbmQsIG5vbmUgQ0IKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE0OSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE1MywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE1NywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAzMH0sICAgICAgICAgICAgLy9SRl9DSEFOXzE2MSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fMTY1LAorCisgICAgICAgICAgICAgICAgICAgIC8vMi40R0h6IEJhbmQsIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjJ9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzMsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzQsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzUsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzYsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzcsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjJ9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzksCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTEsCisKKyAgICAgICAgICAgICAgICAgICAgLy8gNC45R0h6IEJhbmQsIGNoYW5uZWwgYm9uZGVkIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzI0MiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjQ2LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8yNTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzIxMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMjE0LAorCisgICAgICAgICAgICAgICAgICAgIC8vNUdIeiBMb3cgJiBNaWQgVS1OSUkgQmFuZCwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMzgsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzQyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDIwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF80NiwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNTAsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMjd9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzU0LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF81OCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAyNX0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfNjIsCisKKyAgICAgICAgICAgICAgICAgICAgLy81R0h6IE1pZCBCYW5kIC0gRVRTSSwgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMjR9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEwMgorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTA2CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMTAKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTE0CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzExOAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAwfSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMjIKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTI2CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzEzMAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9ESVNBQkxFLCAyN30sICAgICAgICAgICAgLy9SRl9DSEFOX0JPTkRfMTM0CisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0RJU0FCTEUsIDI3fSwgICAgICAgICAgICAvL1JGX0NIQU5fQk9ORF8xMzgKKworICAgICAgICAgICAgICAgICAgICAvLzVHSHogSGlnaCBVLU5JSSBCYW5kLCAgY2hhbm5lbCBib25kZWQgY2hhbm5lbHMKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE1MSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE1NSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMzB9LCAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE1OSwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAgIC8vUkZfQ0hBTl9CT05EXzE2MworICAgICAgICAgICAgICAgIH0sIC8vc1JlZ3VsYXRvcnlDaGFubmVsIGVuZAorCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDAgfSwgIC8vIFJGX1NVQkJBTkRfMl80X0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0sICAgLy8gUkZfU1VCQkFORF81X0xPV19HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9LCAgIC8vIFJGX1NVQkJBTkRfNV9NSURfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSwgICAvLyBSRl9TVUJCQU5EXzVfSElHSF9HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9ICAgIC8vIFJGX1NVQkJBTkRfNF85X0dIWgorICAgICAgICAgICAgICAgIH0sCisKKyAgICAgICAgICAgICAgICB7IC8vIGJSYXRlUG93ZXJPZmZzZXQgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSwgLy8gYlJhdGVQb3dlck9mZnNldCBlbmQKKworICAgICAgICAgICAgICAgIHsgLy8gZ25SYXRlUG93ZXJPZmZzZXQgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy9hcHBseSB0byBhbGwgMi40IGFuZCA1RyBjaGFubmVscworICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSAvLyBnblJhdGVQb3dlck9mZnNldCBlbmQKKyAgICAgICAgICAgIH0sIC8vIFJFR19ET01BSU5fSElfNUdIWiBlbmQKKworICAgICAgICAgICAgeyAgIC8vIFJFR19ET01BSU5fTk9fNUdIWiBzdGFydAorICAgICAgICAgICAgICAgIHsgLy9zUmVndWxhdG9yeUNoYW5uZWwgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgLy9lbmFibGVkLCBwd3JMaW1pdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8yLjRHSHogQmFuZAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl8xLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl8yLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl8zLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl80LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl81LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl82LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl83LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl84LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl85LAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMCwKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRU5BQkxFLCAxMn0sICAgICAgICAgICAvL1JGX0NIQU5fMTEsCisgICAgICAgICAgICAgICAgICAgIHtOVl9DSEFOTkVMX0VOQUJMRSwgMTJ9LCAgICAgICAgICAgLy9SRl9DSEFOXzEyLAorICAgICAgICAgICAgICAgICAgICB7TlZfQ0hBTk5FTF9FTkFCTEUsIDEyfSwgICAgICAgICAgIC8vUkZfQ0hBTl8xMywKKyAgICAgICAgICAgICAgICAgICAge05WX0NIQU5ORUxfRElTQUJMRSwgMH0sICAgICAgICAgICAvL1JGX0NIQU5fMTQsCisgICAgICAgICAgICAgICAgfSwgLy9zUmVndWxhdG9yeUNoYW5uZWwgZW5kCisKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgLy8gUkZfU1VCQkFORF8yXzRfR0haCisgICAgICAgICAgICAgICAgICAgIHswfSwgICAvLyBSRl9TVUJCQU5EXzVfTE9XX0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0sICAgLy8gUkZfU1VCQkFORF81X01JRF9HSFoKKyAgICAgICAgICAgICAgICAgICAgezB9LCAgIC8vIFJGX1NVQkJBTkRfNV9ISUdIX0dIWgorICAgICAgICAgICAgICAgICAgICB7MH0gICAgLy8gUkZfU1VCQkFORF80XzlfR0haCisgICAgICAgICAgICAgICAgfSwKKworICAgICAgICAgICAgICAgIHsgLy8gYlJhdGVQb3dlck9mZnNldCBzdGFydAorICAgICAgICAgICAgICAgICAgICAvLzIuNEdIeiBCYW5kCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzIsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzMsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzQsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzUsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzYsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzcsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzgsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzksCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEwLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTIsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEzLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xNCwKKyAgICAgICAgICAgICAgICB9LCAvLyBiUmF0ZVBvd2VyT2Zmc2V0IGVuZAorCisgICAgICAgICAgICAgICAgeyAvLyBnblJhdGVQb3dlck9mZnNldCBzdGFydAorICAgICAgICAgICAgICAgICAgICAvL2FwcGx5IHRvIGFsbCAyLjQgYW5kIDVHIGNoYW5uZWxzCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzIsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzMsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzQsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzUsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzYsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzcsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzgsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzksCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEwLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xMSwKKyAgICAgICAgICAgICAgICAgICAgeyAwIH0sICAgICAgICAgICAgICAgICAgICAgICAvL1JGX0NIQU5fMTIsCisgICAgICAgICAgICAgICAgICAgIHsgMCB9LCAgICAgICAgICAgICAgICAgICAgICAgLy9SRl9DSEFOXzEzLAorICAgICAgICAgICAgICAgICAgICB7IDAgfSwgICAgICAgICAgICAgICAgICAgICAgIC8vUkZfQ0hBTl8xNCwKKyAgICAgICAgICAgICAgICB9IC8vIGduUmF0ZVBvd2VyT2Zmc2V0IGVuZAorICAgICAgICAgICAgfSAvLyBSRUdfRE9NQUlOX05PXzVHSFogZW5kCisgICAgICAgIH0sCisKKyAgICAgICAgLy8gTlZfVEFCTEVfREVGQVVMVF9DT1VOVFJZCisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIHR5cGVkZWYgc3RydWN0CisgICAgICAgICAgICAvLyB7CisgICAgICAgICAgICAvLyAgICAgdEFOSV9VOCByZWdEb21haW47ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2Zyb20gZVJlZ0RvbWFpbklkCisgICAgICAgICAgICAvLyAgICAgdEFOSV9VOCBjb3VudHJ5Q29kZVtOVl9GSUVMRF9DT1VOVFJZX0NPREVfU0laRV07ICAgIC8vIHN0cmluZyBpZGVudGlmaWVyCisgICAgICAgICAgICAvLyB9c0RlZmF1bHRDb3VudHJ5OworCisgICAgICAgICAgICAwLCAgICAgICAgICAgICAgICAgIC8vIHJlZ0RvbWFpbgorICAgICAgICAgICAgeyAnVScsICdTJywgJ0knIH0gICAvLyBjb3VudHJ5Q29kZQorICAgICAgICB9LAorCisgICAgICAgIC8vTlZfVEFCTEVfVFBDX1BPV0VSX1RBQkxFCisgICAgICAgIHsKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIDAgICwgLy8wCisgICAgICAgICAgICAgICAgICAgIDQxICwgLy8xCisgICAgICAgICAgICAgICAgICAgIDQzICwgLy8yCisgICAgICAgICAgICAgICAgICAgIDQ1ICwgLy8zCisgICAgICAgICAgICAgICAgICAgIDQ3ICwgLy80CisgICAgICAgICAgICAgICAgICAgIDQ5ICwgLy81CisgICAgICAgICAgICAgICAgICAgIDUxICwgLy82CisgICAgICAgICAgICAgICAgICAgIDUzICwgLy83CisgICAgICAgICAgICAgICAgICAgIDU1ICwgLy84CisgICAgICAgICAgICAgICAgICAgIDU2ICwgLy85CisgICAgICAgICAgICAgICAgICAgIDU4ICwgLy8xMAorICAgICAgICAgICAgICAgICAgICA1OSAsIC8vMTEKKyAgICAgICAgICAgICAgICAgICAgNjAgLCAvLzEyCisgICAgICAgICAgICAgICAgICAgIDYyICwgLy8xMworICAgICAgICAgICAgICAgICAgICA2MyAsIC8vMTQKKyAgICAgICAgICAgICAgICAgICAgNjQgLCAvLzE1CisgICAgICAgICAgICAgICAgICAgIDY1ICwgLy8xNgorICAgICAgICAgICAgICAgICAgICA2NyAsIC8vMTcKKyAgICAgICAgICAgICAgICAgICAgNjggLCAvLzE4CisgICAgICAgICAgICAgICAgICAgIDY5ICwgLy8xOQorICAgICAgICAgICAgICAgICAgICA3MCAsIC8vMjAKKyAgICAgICAgICAgICAgICAgICAgNzEgLCAvLzIxCisgICAgICAgICAgICAgICAgICAgIDcyICwgLy8yMgorICAgICAgICAgICAgICAgICAgICA3MyAsIC8vMjMKKyAgICAgICAgICAgICAgICAgICAgNzQgLCAvLzI0CisgICAgICAgICAgICAgICAgICAgIDc1ICwgLy8yNQorICAgICAgICAgICAgICAgICAgICA3NSAsIC8vMjYKKyAgICAgICAgICAgICAgICAgICAgNzYgLCAvLzI3CisgICAgICAgICAgICAgICAgICAgIDc3ICwgLy8yOAorICAgICAgICAgICAgICAgICAgICA3OCAsIC8vMjkKKyAgICAgICAgICAgICAgICAgICAgNzggLCAvLzMwCisgICAgICAgICAgICAgICAgICAgIDc5ICwgLy8zMQorICAgICAgICAgICAgICAgICAgICA4MCAsIC8vMzIKKyAgICAgICAgICAgICAgICAgICAgODEgLCAvLzMzCisgICAgICAgICAgICAgICAgICAgIDgyICwgLy8zNAorICAgICAgICAgICAgICAgICAgICA4MiAsIC8vMzUKKyAgICAgICAgICAgICAgICAgICAgODMgLCAvLzM2CisgICAgICAgICAgICAgICAgICAgIDgzICwgLy8zNworICAgICAgICAgICAgICAgICAgICA4NCAsIC8vMzgKKyAgICAgICAgICAgICAgICAgICAgODUgLCAvLzM5CisgICAgICAgICAgICAgICAgICAgIDg2ICwgLy80MAorICAgICAgICAgICAgICAgICAgICA4NiAsIC8vNDEKKyAgICAgICAgICAgICAgICAgICAgODcgLCAvLzQyCisgICAgICAgICAgICAgICAgICAgIDg4ICwgLy80MworICAgICAgICAgICAgICAgICAgICA4OSAsIC8vNDQKKyAgICAgICAgICAgICAgICAgICAgODkgLCAvLzQ1CisgICAgICAgICAgICAgICAgICAgIDkwICwgLy80NgorICAgICAgICAgICAgICAgICAgICA5MSAsIC8vNDcKKyAgICAgICAgICAgICAgICAgICAgOTEgLCAvLzQ4CisgICAgICAgICAgICAgICAgICAgIDkyICwgLy80OQorICAgICAgICAgICAgICAgICAgICA5MiAsIC8vNTAKKyAgICAgICAgICAgICAgICAgICAgOTMgLCAvLzUxCisgICAgICAgICAgICAgICAgICAgIDkzICwgLy81MgorICAgICAgICAgICAgICAgICAgICA5NCAsIC8vNTMKKyAgICAgICAgICAgICAgICAgICAgOTQgLCAvLzU0CisgICAgICAgICAgICAgICAgICAgIDk1ICwgLy81NQorICAgICAgICAgICAgICAgICAgICA5NSAsIC8vNTYKKyAgICAgICAgICAgICAgICAgICAgOTUgLCAvLzU3CisgICAgICAgICAgICAgICAgICAgIDk2ICwgLy81OAorICAgICAgICAgICAgICAgICAgICA5NiAsIC8vNTkKKyAgICAgICAgICAgICAgICAgICAgOTcgLCAvLzYwCisgICAgICAgICAgICAgICAgICAgIDk3ICwgLy82MQorICAgICAgICAgICAgICAgICAgICA5OCAsIC8vNjIKKyAgICAgICAgICAgICAgICAgICAgOTggLCAvLzYzCisgICAgICAgICAgICAgICAgICAgIDk4ICwgLy82NAorICAgICAgICAgICAgICAgICAgICA5OSAsIC8vNjUKKyAgICAgICAgICAgICAgICAgICAgOTkgLCAvLzY2CisgICAgICAgICAgICAgICAgICAgIDk5ICwgLy82NworICAgICAgICAgICAgICAgICAgICAxMDAsIC8vNjgKKyAgICAgICAgICAgICAgICAgICAgMTAwLCAvLzY5CisgICAgICAgICAgICAgICAgICAgIDEwMCwgLy83MAorICAgICAgICAgICAgICAgICAgICAxMDEsIC8vNzEKKyAgICAgICAgICAgICAgICAgICAgMTAxLCAvLzcyCisgICAgICAgICAgICAgICAgICAgIDEwMiwgLy83MworICAgICAgICAgICAgICAgICAgICAxMDIsIC8vNzQKKyAgICAgICAgICAgICAgICAgICAgMTAyLCAvLzc1CisgICAgICAgICAgICAgICAgICAgIDEwMiwgLy83NgorICAgICAgICAgICAgICAgICAgICAxMDMsIC8vNzcKKyAgICAgICAgICAgICAgICAgICAgMTAzLCAvLzc4CisgICAgICAgICAgICAgICAgICAgIDEwMywgLy83OQorICAgICAgICAgICAgICAgICAgICAxMDMsIC8vODAKKyAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzgxCisgICAgICAgICAgICAgICAgICAgIDEwNCwgLy84MgorICAgICAgICAgICAgICAgICAgICAxMDQsIC8vODMKKyAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzg0CisgICAgICAgICAgICAgICAgICAgIDEwNSwgLy84NQorICAgICAgICAgICAgICAgICAgICAxMDUsIC8vODYKKyAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzg3CisgICAgICAgICAgICAgICAgICAgIDEwNSwgLy84OAorICAgICAgICAgICAgICAgICAgICAxMDUsIC8vODkKKyAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzkwCisgICAgICAgICAgICAgICAgICAgIDEwNiwgLy85MQorICAgICAgICAgICAgICAgICAgICAxMDYsIC8vOTIKKyAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzkzCisgICAgICAgICAgICAgICAgICAgIDEwNiwgLy85NAorICAgICAgICAgICAgICAgICAgICAxMDYsIC8vOTUKKyAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzk2CisgICAgICAgICAgICAgICAgICAgIDEwNiwgLy85NworICAgICAgICAgICAgICAgICAgICAxMDYsIC8vOTgKKyAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzk5CisgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDAKKyAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEwMQorICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTAyCisgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDMKKyAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEwNAorICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTA1CisgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMDYKKyAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEwNworICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTA4CisgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMDkKKyAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzExMAorICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTExCisgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTIKKyAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzExMworICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTE0CisgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTUKKyAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzExNgorICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTE3CisgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTgKKyAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzExOQorICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTIwCisgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMjEKKyAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEyMgorICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTIzCisgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMjQKKyAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEyNQorICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTI2CisgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMjcKKyAgICAgICAgICAgICAgICAgICAgMTA3LAorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl8xCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAwICAsIC8vMAorICAgICAgICAgICAgICAgICAgICA0MSAsIC8vMQorICAgICAgICAgICAgICAgICAgICA0MyAsIC8vMgorICAgICAgICAgICAgICAgICAgICA0NSAsIC8vMworICAgICAgICAgICAgICAgICAgICA0NyAsIC8vNAorICAgICAgICAgICAgICAgICAgICA0OSAsIC8vNQorICAgICAgICAgICAgICAgICAgICA1MSAsIC8vNgorICAgICAgICAgICAgICAgICAgICA1MiAsIC8vNworICAgICAgICAgICAgICAgICAgICA1NCAsIC8vOAorICAgICAgICAgICAgICAgICAgICA1NiAsIC8vOQorICAgICAgICAgICAgICAgICAgICA1NyAsIC8vMTAKKyAgICAgICAgICAgICAgICAgICAgNTkgLCAvLzExCisgICAgICAgICAgICAgICAgICAgIDYwICwgLy8xMgorICAgICAgICAgICAgICAgICAgICA2MSAsIC8vMTMKKyAgICAgICAgICAgICAgICAgICAgNjIgLCAvLzE0CisgICAgICAgICAgICAgICAgICAgIDY0ICwgLy8xNQorICAgICAgICAgICAgICAgICAgICA2NSAsIC8vMTYKKyAgICAgICAgICAgICAgICAgICAgNjYgLCAvLzE3CisgICAgICAgICAgICAgICAgICAgIDY3ICwgLy8xOAorICAgICAgICAgICAgICAgICAgICA2OCAsIC8vMTkKKyAgICAgICAgICAgICAgICAgICAgNjkgLCAvLzIwCisgICAgICAgICAgICAgICAgICAgIDcwICwgLy8yMQorICAgICAgICAgICAgICAgICAgICA3MSAsIC8vMjIKKyAgICAgICAgICAgICAgICAgICAgNzIgLCAvLzIzCisgICAgICAgICAgICAgICAgICAgIDczICwgLy8yNAorICAgICAgICAgICAgICAgICAgICA3NCAsIC8vMjUKKyAgICAgICAgICAgICAgICAgICAgNzUgLCAvLzI2CisgICAgICAgICAgICAgICAgICAgIDc1ICwgLy8yNworICAgICAgICAgICAgICAgICAgICA3NiAsIC8vMjgKKyAgICAgICAgICAgICAgICAgICAgNzcgLCAvLzI5CisgICAgICAgICAgICAgICAgICAgIDc4ICwgLy8zMAorICAgICAgICAgICAgICAgICAgICA3OSAsIC8vMzEKKyAgICAgICAgICAgICAgICAgICAgNzkgLCAvLzMyCisgICAgICAgICAgICAgICAgICAgIDgwICwgLy8zMworICAgICAgICAgICAgICAgICAgICA4MSAsIC8vMzQKKyAgICAgICAgICAgICAgICAgICAgODIgLCAvLzM1CisgICAgICAgICAgICAgICAgICAgIDgyICwgLy8zNgorICAgICAgICAgICAgICAgICAgICA4MyAsIC8vMzcKKyAgICAgICAgICAgICAgICAgICAgODQgLCAvLzM4CisgICAgICAgICAgICAgICAgICAgIDg1ICwgLy8zOQorICAgICAgICAgICAgICAgICAgICA4NSAsIC8vNDAKKyAgICAgICAgICAgICAgICAgICAgODYgLCAvLzQxCisgICAgICAgICAgICAgICAgICAgIDg3ICwgLy80MgorICAgICAgICAgICAgICAgICAgICA4OCAsIC8vNDMKKyAgICAgICAgICAgICAgICAgICAgODggLCAvLzQ0CisgICAgICAgICAgICAgICAgICAgIDg5ICwgLy80NQorICAgICAgICAgICAgICAgICAgICA4OSAsIC8vNDYKKyAgICAgICAgICAgICAgICAgICAgOTAgLCAvLzQ3CisgICAgICAgICAgICAgICAgICAgIDkxICwgLy80OAorICAgICAgICAgICAgICAgICAgICA5MSAsIC8vNDkKKyAgICAgICAgICAgICAgICAgICAgOTIgLCAvLzUwCisgICAgICAgICAgICAgICAgICAgIDkyICwgLy81MQorICAgICAgICAgICAgICAgICAgICA5MyAsIC8vNTIKKyAgICAgICAgICAgICAgICAgICAgOTMgLCAvLzUzCisgICAgICAgICAgICAgICAgICAgIDk0ICwgLy81NAorICAgICAgICAgICAgICAgICAgICA5NCAsIC8vNTUKKyAgICAgICAgICAgICAgICAgICAgOTUgLCAvLzU2CisgICAgICAgICAgICAgICAgICAgIDk1ICwgLy81NworICAgICAgICAgICAgICAgICAgICA5NiAsIC8vNTgKKyAgICAgICAgICAgICAgICAgICAgOTYgLCAvLzU5CisgICAgICAgICAgICAgICAgICAgIDk2ICwgLy82MAorICAgICAgICAgICAgICAgICAgICA5NyAsIC8vNjEKKyAgICAgICAgICAgICAgICAgICAgOTcgLCAvLzYyCisgICAgICAgICAgICAgICAgICAgIDk4ICwgLy82MworICAgICAgICAgICAgICAgICAgICA5OCAsIC8vNjQKKyAgICAgICAgICAgICAgICAgICAgOTggLCAvLzY1CisgICAgICAgICAgICAgICAgICAgIDk5ICwgLy82NgorICAgICAgICAgICAgICAgICAgICA5OSAsIC8vNjcKKyAgICAgICAgICAgICAgICAgICAgOTkgLCAvLzY4CisgICAgICAgICAgICAgICAgICAgIDEwMCwgLy82OQorICAgICAgICAgICAgICAgICAgICAxMDAsIC8vNzAKKyAgICAgICAgICAgICAgICAgICAgMTAxLCAvLzcxCisgICAgICAgICAgICAgICAgICAgIDEwMSwgLy83MgorICAgICAgICAgICAgICAgICAgICAxMDEsIC8vNzMKKyAgICAgICAgICAgICAgICAgICAgMTAxLCAvLzc0CisgICAgICAgICAgICAgICAgICAgIDEwMiwgLy83NQorICAgICAgICAgICAgICAgICAgICAxMDIsIC8vNzYKKyAgICAgICAgICAgICAgICAgICAgMTAyLCAvLzc3CisgICAgICAgICAgICAgICAgICAgIDEwMywgLy83OAorICAgICAgICAgICAgICAgICAgICAxMDMsIC8vNzkKKyAgICAgICAgICAgICAgICAgICAgMTAzLCAvLzgwCisgICAgICAgICAgICAgICAgICAgIDEwNCwgLy84MQorICAgICAgICAgICAgICAgICAgICAxMDQsIC8vODIKKyAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzgzCisgICAgICAgICAgICAgICAgICAgIDEwNCwgLy84NAorICAgICAgICAgICAgICAgICAgICAxMDUsIC8vODUKKyAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzg2CisgICAgICAgICAgICAgICAgICAgIDEwNSwgLy84NworICAgICAgICAgICAgICAgICAgICAxMDUsIC8vODgKKyAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzg5CisgICAgICAgICAgICAgICAgICAgIDEwNiwgLy85MAorICAgICAgICAgICAgICAgICAgICAxMDYsIC8vOTEKKyAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzkyCisgICAgICAgICAgICAgICAgICAgIDEwNiwgLy85MworICAgICAgICAgICAgICAgICAgICAxMDYsIC8vOTQKKyAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzk1CisgICAgICAgICAgICAgICAgICAgIDEwNiwgLy85NgorICAgICAgICAgICAgICAgICAgICAxMDYsIC8vOTcKKyAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzk4CisgICAgICAgICAgICAgICAgICAgIDEwNiwgLy85OQorICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTAwCisgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDEKKyAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEwMgorICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTAzCisgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMDQKKyAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEwNQorICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTA2CisgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMDcKKyAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEwOAorICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTA5CisgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTAKKyAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzExMQorICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTEyCisgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTMKKyAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzExNAorICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTE1CisgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTYKKyAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzExNworICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTE4CisgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTkKKyAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEyMAorICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTIxCisgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMjIKKyAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEyMworICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTI0CisgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMjUKKyAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEyNgorICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTI3CisgICAgICAgICAgICAgICAgICAgIDEwNywKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9LCAvL1JGX0NIQU5fMgorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgMCAgLCAvLzAKKyAgICAgICAgICAgICAgICAgICAgICAgIDQxICwgLy8xCisgICAgICAgICAgICAgICAgICAgICAgICA0MyAsIC8vMgorICAgICAgICAgICAgICAgICAgICAgICAgNDUgLCAvLzMKKyAgICAgICAgICAgICAgICAgICAgICAgIDQ3ICwgLy80CisgICAgICAgICAgICAgICAgICAgICAgICA0OSAsIC8vNQorICAgICAgICAgICAgICAgICAgICAgICAgNTEgLCAvLzYKKyAgICAgICAgICAgICAgICAgICAgICAgIDUyICwgLy83CisgICAgICAgICAgICAgICAgICAgICAgICA1NCAsIC8vOAorICAgICAgICAgICAgICAgICAgICAgICAgNTUgLCAvLzkKKyAgICAgICAgICAgICAgICAgICAgICAgIDU3ICwgLy8xMAorICAgICAgICAgICAgICAgICAgICAgICAgNTggLCAvLzExCisgICAgICAgICAgICAgICAgICAgICAgICA2MCAsIC8vMTIKKyAgICAgICAgICAgICAgICAgICAgICAgIDYxICwgLy8xMworICAgICAgICAgICAgICAgICAgICAgICAgNjIgLCAvLzE0CisgICAgICAgICAgICAgICAgICAgICAgICA2NCAsIC8vMTUKKyAgICAgICAgICAgICAgICAgICAgICAgIDY1ICwgLy8xNgorICAgICAgICAgICAgICAgICAgICAgICAgNjYgLCAvLzE3CisgICAgICAgICAgICAgICAgICAgICAgICA2NyAsIC8vMTgKKyAgICAgICAgICAgICAgICAgICAgICAgIDY4ICwgLy8xOQorICAgICAgICAgICAgICAgICAgICAgICAgNjkgLCAvLzIwCisgICAgICAgICAgICAgICAgICAgICAgICA3MCAsIC8vMjEKKyAgICAgICAgICAgICAgICAgICAgICAgIDcxICwgLy8yMgorICAgICAgICAgICAgICAgICAgICAgICAgNzIgLCAvLzIzCisgICAgICAgICAgICAgICAgICAgICAgICA3MyAsIC8vMjQKKyAgICAgICAgICAgICAgICAgICAgICAgIDc0ICwgLy8yNQorICAgICAgICAgICAgICAgICAgICAgICAgNzUgLCAvLzI2CisgICAgICAgICAgICAgICAgICAgICAgICA3NSAsIC8vMjcKKyAgICAgICAgICAgICAgICAgICAgICAgIDc2ICwgLy8yOAorICAgICAgICAgICAgICAgICAgICAgICAgNzcgLCAvLzI5CisgICAgICAgICAgICAgICAgICAgICAgICA3OCAsIC8vMzAKKyAgICAgICAgICAgICAgICAgICAgICAgIDc4ICwgLy8zMQorICAgICAgICAgICAgICAgICAgICAgICAgNzkgLCAvLzMyCisgICAgICAgICAgICAgICAgICAgICAgICA4MCAsIC8vMzMKKyAgICAgICAgICAgICAgICAgICAgICAgIDgxICwgLy8zNAorICAgICAgICAgICAgICAgICAgICAgICAgODIgLCAvLzM1CisgICAgICAgICAgICAgICAgICAgICAgICA4MiAsIC8vMzYKKyAgICAgICAgICAgICAgICAgICAgICAgIDgzICwgLy8zNworICAgICAgICAgICAgICAgICAgICAgICAgODQgLCAvLzM4CisgICAgICAgICAgICAgICAgICAgICAgICA4NCAsIC8vMzkKKyAgICAgICAgICAgICAgICAgICAgICAgIDg1ICwgLy80MAorICAgICAgICAgICAgICAgICAgICAgICAgODYgLCAvLzQxCisgICAgICAgICAgICAgICAgICAgICAgICA4NyAsIC8vNDIKKyAgICAgICAgICAgICAgICAgICAgICAgIDg3ICwgLy80MworICAgICAgICAgICAgICAgICAgICAgICAgODggLCAvLzQ0CisgICAgICAgICAgICAgICAgICAgICAgICA4OSAsIC8vNDUKKyAgICAgICAgICAgICAgICAgICAgICAgIDg5ICwgLy80NgorICAgICAgICAgICAgICAgICAgICAgICAgOTAgLCAvLzQ3CisgICAgICAgICAgICAgICAgICAgICAgICA5MCAsIC8vNDgKKyAgICAgICAgICAgICAgICAgICAgICAgIDkxICwgLy80OQorICAgICAgICAgICAgICAgICAgICAgICAgOTEgLCAvLzUwCisgICAgICAgICAgICAgICAgICAgICAgICA5MiAsIC8vNTEKKyAgICAgICAgICAgICAgICAgICAgICAgIDkzICwgLy81MgorICAgICAgICAgICAgICAgICAgICAgICAgOTMgLCAvLzUzCisgICAgICAgICAgICAgICAgICAgICAgICA5NCAsIC8vNTQKKyAgICAgICAgICAgICAgICAgICAgICAgIDk0ICwgLy81NQorICAgICAgICAgICAgICAgICAgICAgICAgOTQgLCAvLzU2CisgICAgICAgICAgICAgICAgICAgICAgICA5NSAsIC8vNTcKKyAgICAgICAgICAgICAgICAgICAgICAgIDk1ICwgLy81OAorICAgICAgICAgICAgICAgICAgICAgICAgOTYgLCAvLzU5CisgICAgICAgICAgICAgICAgICAgICAgICA5NiAsIC8vNjAKKyAgICAgICAgICAgICAgICAgICAgICAgIDk3ICwgLy82MQorICAgICAgICAgICAgICAgICAgICAgICAgOTcgLCAvLzYyCisgICAgICAgICAgICAgICAgICAgICAgICA5NyAsIC8vNjMKKyAgICAgICAgICAgICAgICAgICAgICAgIDk4ICwgLy82NAorICAgICAgICAgICAgICAgICAgICAgICAgOTggLCAvLzY1CisgICAgICAgICAgICAgICAgICAgICAgICA5OSAsIC8vNjYKKyAgICAgICAgICAgICAgICAgICAgICAgIDk5ICwgLy82NworICAgICAgICAgICAgICAgICAgICAgICAgOTkgLCAvLzY4CisgICAgICAgICAgICAgICAgICAgICAgICAxMDAsIC8vNjkKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgLy83MAorICAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAvLzcxCisgICAgICAgICAgICAgICAgICAgICAgICAxMDEsIC8vNzIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMSwgLy83MworICAgICAgICAgICAgICAgICAgICAgICAgMTAxLCAvLzc0CisgICAgICAgICAgICAgICAgICAgICAgICAxMDIsIC8vNzUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMiwgLy83NgorICAgICAgICAgICAgICAgICAgICAgICAgMTAyLCAvLzc3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDMsIC8vNzgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMywgLy83OQorICAgICAgICAgICAgICAgICAgICAgICAgMTAzLCAvLzgwCisgICAgICAgICAgICAgICAgICAgICAgICAxMDMsIC8vODEKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy84MgorICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzgzCisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vODQKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy84NQorICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzg2CisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vODcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy84OAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzg5CisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vOTAKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy85MQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzkyCisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vOTMKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy85NAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzk1CisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vOTYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy85NworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzk4CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vOTkKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDAKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDEKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDMKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDQKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDkKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMTAKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMTEKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMTIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMTMKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMTQKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMTUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMTYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMTcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMTgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMTkKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMjAKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMjEKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMjIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMjMKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMjQKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMjUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMjYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMjcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl8zCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAwICAsIC8vMAorICAgICAgICAgICAgICAgICAgICAgICAgNDIgLCAvLzEKKyAgICAgICAgICAgICAgICAgICAgICAgIDQ0ICwgLy8yCisgICAgICAgICAgICAgICAgICAgICAgICA0NiAsIC8vMworICAgICAgICAgICAgICAgICAgICAgICAgNDggLCAvLzQKKyAgICAgICAgICAgICAgICAgICAgICAgIDQ5ICwgLy81CisgICAgICAgICAgICAgICAgICAgICAgICA1MSAsIC8vNgorICAgICAgICAgICAgICAgICAgICAgICAgNTMgLCAvLzcKKyAgICAgICAgICAgICAgICAgICAgICAgIDU1ICwgLy84CisgICAgICAgICAgICAgICAgICAgICAgICA1NyAsIC8vOQorICAgICAgICAgICAgICAgICAgICAgICAgNTggLCAvLzEwCisgICAgICAgICAgICAgICAgICAgICAgICA2MCAsIC8vMTEKKyAgICAgICAgICAgICAgICAgICAgICAgIDYxICwgLy8xMgorICAgICAgICAgICAgICAgICAgICAgICAgNjIgLCAvLzEzCisgICAgICAgICAgICAgICAgICAgICAgICA2MyAsIC8vMTQKKyAgICAgICAgICAgICAgICAgICAgICAgIDY0ICwgLy8xNQorICAgICAgICAgICAgICAgICAgICAgICAgNjYgLCAvLzE2CisgICAgICAgICAgICAgICAgICAgICAgICA2NyAsIC8vMTcKKyAgICAgICAgICAgICAgICAgICAgICAgIDY4ICwgLy8xOAorICAgICAgICAgICAgICAgICAgICAgICAgNjkgLCAvLzE5CisgICAgICAgICAgICAgICAgICAgICAgICA3MCAsIC8vMjAKKyAgICAgICAgICAgICAgICAgICAgICAgIDcxICwgLy8yMQorICAgICAgICAgICAgICAgICAgICAgICAgNzIgLCAvLzIyCisgICAgICAgICAgICAgICAgICAgICAgICA3MyAsIC8vMjMKKyAgICAgICAgICAgICAgICAgICAgICAgIDc0ICwgLy8yNAorICAgICAgICAgICAgICAgICAgICAgICAgNzUgLCAvLzI1CisgICAgICAgICAgICAgICAgICAgICAgICA3NSAsIC8vMjYKKyAgICAgICAgICAgICAgICAgICAgICAgIDc2ICwgLy8yNworICAgICAgICAgICAgICAgICAgICAgICAgNzcgLCAvLzI4CisgICAgICAgICAgICAgICAgICAgICAgICA3OCAsIC8vMjkKKyAgICAgICAgICAgICAgICAgICAgICAgIDc4ICwgLy8zMAorICAgICAgICAgICAgICAgICAgICAgICAgNzkgLCAvLzMxCisgICAgICAgICAgICAgICAgICAgICAgICA4MCAsIC8vMzIKKyAgICAgICAgICAgICAgICAgICAgICAgIDgxICwgLy8zMworICAgICAgICAgICAgICAgICAgICAgICAgODIgLCAvLzM0CisgICAgICAgICAgICAgICAgICAgICAgICA4MiAsIC8vMzUKKyAgICAgICAgICAgICAgICAgICAgICAgIDgzICwgLy8zNgorICAgICAgICAgICAgICAgICAgICAgICAgODQgLCAvLzM3CisgICAgICAgICAgICAgICAgICAgICAgICA4NCAsIC8vMzgKKyAgICAgICAgICAgICAgICAgICAgICAgIDg1ICwgLy8zOQorICAgICAgICAgICAgICAgICAgICAgICAgODYgLCAvLzQwCisgICAgICAgICAgICAgICAgICAgICAgICA4NyAsIC8vNDEKKyAgICAgICAgICAgICAgICAgICAgICAgIDg3ICwgLy80MgorICAgICAgICAgICAgICAgICAgICAgICAgODggLCAvLzQzCisgICAgICAgICAgICAgICAgICAgICAgICA4OCAsIC8vNDQKKyAgICAgICAgICAgICAgICAgICAgICAgIDg5ICwgLy80NQorICAgICAgICAgICAgICAgICAgICAgICAgOTAgLCAvLzQ2CisgICAgICAgICAgICAgICAgICAgICAgICA5MCAsIC8vNDcKKyAgICAgICAgICAgICAgICAgICAgICAgIDkxICwgLy80OAorICAgICAgICAgICAgICAgICAgICAgICAgOTEgLCAvLzQ5CisgICAgICAgICAgICAgICAgICAgICAgICA5MiAsIC8vNTAKKyAgICAgICAgICAgICAgICAgICAgICAgIDkyICwgLy81MQorICAgICAgICAgICAgICAgICAgICAgICAgOTMgLCAvLzUyCisgICAgICAgICAgICAgICAgICAgICAgICA5MyAsIC8vNTMKKyAgICAgICAgICAgICAgICAgICAgICAgIDk0ICwgLy81NAorICAgICAgICAgICAgICAgICAgICAgICAgOTQgLCAvLzU1CisgICAgICAgICAgICAgICAgICAgICAgICA5NSAsIC8vNTYKKyAgICAgICAgICAgICAgICAgICAgICAgIDk1ICwgLy81NworICAgICAgICAgICAgICAgICAgICAgICAgOTUgLCAvLzU4CisgICAgICAgICAgICAgICAgICAgICAgICA5NiAsIC8vNTkKKyAgICAgICAgICAgICAgICAgICAgICAgIDk2ICwgLy82MAorICAgICAgICAgICAgICAgICAgICAgICAgOTcgLCAvLzYxCisgICAgICAgICAgICAgICAgICAgICAgICA5NyAsIC8vNjIKKyAgICAgICAgICAgICAgICAgICAgICAgIDk4ICwgLy82MworICAgICAgICAgICAgICAgICAgICAgICAgOTggLCAvLzY0CisgICAgICAgICAgICAgICAgICAgICAgICA5OCAsIC8vNjUKKyAgICAgICAgICAgICAgICAgICAgICAgIDk5ICwgLy82NgorICAgICAgICAgICAgICAgICAgICAgICAgOTkgLCAvLzY3CisgICAgICAgICAgICAgICAgICAgICAgICA5OSAsIC8vNjgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgLy82OQorICAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAvLzcwCisgICAgICAgICAgICAgICAgICAgICAgICAxMDAsIC8vNzEKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMSwgLy83MgorICAgICAgICAgICAgICAgICAgICAgICAgMTAxLCAvLzczCisgICAgICAgICAgICAgICAgICAgICAgICAxMDEsIC8vNzQKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMiwgLy83NQorICAgICAgICAgICAgICAgICAgICAgICAgMTAyLCAvLzc2CisgICAgICAgICAgICAgICAgICAgICAgICAxMDIsIC8vNzcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMywgLy83OAorICAgICAgICAgICAgICAgICAgICAgICAgMTAzLCAvLzc5CisgICAgICAgICAgICAgICAgICAgICAgICAxMDMsIC8vODAKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMywgLy84MQorICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzgyCisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vODMKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy84NAorICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzg1CisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vODYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy84NworICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzg4CisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vODkKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy85MAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzkxCisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vOTIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy85MworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzk0CisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vOTUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy85NgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzk3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vOTgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy85OQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwMAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwMQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwMgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwMworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwNAorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEwNQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEwNgorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEwNworICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEwOAorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEwOQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzExMAorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzExMQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzExMgorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzExMworICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzExNAorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzExNQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzExNgorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzExNworICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzExOAorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzExOQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEyMAorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEyMQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEyMgorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEyMworICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEyNAorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEyNQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEyNgorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEyNworICAgICAgICAgICAgICAgICAgICAgICAgMTA2LAorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzQKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIDAgICwgLy8wCisgICAgICAgICAgICAgICAgICAgICAgICA0MSAsIC8vMQorICAgICAgICAgICAgICAgICAgICAgICAgNDMgLCAvLzIKKyAgICAgICAgICAgICAgICAgICAgICAgIDQ1ICwgLy8zCisgICAgICAgICAgICAgICAgICAgICAgICA0NyAsIC8vNAorICAgICAgICAgICAgICAgICAgICAgICAgNDkgLCAvLzUKKyAgICAgICAgICAgICAgICAgICAgICAgIDUxICwgLy82CisgICAgICAgICAgICAgICAgICAgICAgICA1MyAsIC8vNworICAgICAgICAgICAgICAgICAgICAgICAgNTQgLCAvLzgKKyAgICAgICAgICAgICAgICAgICAgICAgIDU2ICwgLy85CisgICAgICAgICAgICAgICAgICAgICAgICA1NyAsIC8vMTAKKyAgICAgICAgICAgICAgICAgICAgICAgIDU5ICwgLy8xMQorICAgICAgICAgICAgICAgICAgICAgICAgNjAgLCAvLzEyCisgICAgICAgICAgICAgICAgICAgICAgICA2MiAsIC8vMTMKKyAgICAgICAgICAgICAgICAgICAgICAgIDYzICwgLy8xNAorICAgICAgICAgICAgICAgICAgICAgICAgNjUgLCAvLzE1CisgICAgICAgICAgICAgICAgICAgICAgICA2NiAsIC8vMTYKKyAgICAgICAgICAgICAgICAgICAgICAgIDY3ICwgLy8xNworICAgICAgICAgICAgICAgICAgICAgICAgNjggLCAvLzE4CisgICAgICAgICAgICAgICAgICAgICAgICA2OSAsIC8vMTkKKyAgICAgICAgICAgICAgICAgICAgICAgIDY5ICwgLy8yMAorICAgICAgICAgICAgICAgICAgICAgICAgNzEgLCAvLzIxCisgICAgICAgICAgICAgICAgICAgICAgICA3MiAsIC8vMjIKKyAgICAgICAgICAgICAgICAgICAgICAgIDcyICwgLy8yMworICAgICAgICAgICAgICAgICAgICAgICAgNzMgLCAvLzI0CisgICAgICAgICAgICAgICAgICAgICAgICA3NCAsIC8vMjUKKyAgICAgICAgICAgICAgICAgICAgICAgIDc1ICwgLy8yNgorICAgICAgICAgICAgICAgICAgICAgICAgNzYgLCAvLzI3CisgICAgICAgICAgICAgICAgICAgICAgICA3NyAsIC8vMjgKKyAgICAgICAgICAgICAgICAgICAgICAgIDc4ICwgLy8yOQorICAgICAgICAgICAgICAgICAgICAgICAgNzkgLCAvLzMwCisgICAgICAgICAgICAgICAgICAgICAgICA3OSAsIC8vMzEKKyAgICAgICAgICAgICAgICAgICAgICAgIDgwICwgLy8zMgorICAgICAgICAgICAgICAgICAgICAgICAgODEgLCAvLzMzCisgICAgICAgICAgICAgICAgICAgICAgICA4MiAsIC8vMzQKKyAgICAgICAgICAgICAgICAgICAgICAgIDgzICwgLy8zNQorICAgICAgICAgICAgICAgICAgICAgICAgODMgLCAvLzM2CisgICAgICAgICAgICAgICAgICAgICAgICA4NCAsIC8vMzcKKyAgICAgICAgICAgICAgICAgICAgICAgIDg1ICwgLy8zOAorICAgICAgICAgICAgICAgICAgICAgICAgODYgLCAvLzM5CisgICAgICAgICAgICAgICAgICAgICAgICA4NyAsIC8vNDAKKyAgICAgICAgICAgICAgICAgICAgICAgIDg3ICwgLy80MQorICAgICAgICAgICAgICAgICAgICAgICAgODggLCAvLzQyCisgICAgICAgICAgICAgICAgICAgICAgICA4OSAsIC8vNDMKKyAgICAgICAgICAgICAgICAgICAgICAgIDg5ICwgLy80NAorICAgICAgICAgICAgICAgICAgICAgICAgOTAgLCAvLzQ1CisgICAgICAgICAgICAgICAgICAgICAgICA5MSAsIC8vNDYKKyAgICAgICAgICAgICAgICAgICAgICAgIDkxICwgLy80NworICAgICAgICAgICAgICAgICAgICAgICAgOTIgLCAvLzQ4CisgICAgICAgICAgICAgICAgICAgICAgICA5MiAsIC8vNDkKKyAgICAgICAgICAgICAgICAgICAgICAgIDkzICwgLy81MAorICAgICAgICAgICAgICAgICAgICAgICAgOTMgLCAvLzUxCisgICAgICAgICAgICAgICAgICAgICAgICA5NCAsIC8vNTIKKyAgICAgICAgICAgICAgICAgICAgICAgIDk0ICwgLy81MworICAgICAgICAgICAgICAgICAgICAgICAgOTUgLCAvLzU0CisgICAgICAgICAgICAgICAgICAgICAgICA5NSAsIC8vNTUKKyAgICAgICAgICAgICAgICAgICAgICAgIDk2ICwgLy81NgorICAgICAgICAgICAgICAgICAgICAgICAgOTYgLCAvLzU3CisgICAgICAgICAgICAgICAgICAgICAgICA5NiAsIC8vNTgKKyAgICAgICAgICAgICAgICAgICAgICAgIDk3ICwgLy81OQorICAgICAgICAgICAgICAgICAgICAgICAgOTcgLCAvLzYwCisgICAgICAgICAgICAgICAgICAgICAgICA5OCAsIC8vNjEKKyAgICAgICAgICAgICAgICAgICAgICAgIDk4ICwgLy82MgorICAgICAgICAgICAgICAgICAgICAgICAgOTggLCAvLzYzCisgICAgICAgICAgICAgICAgICAgICAgICA5OSAsIC8vNjQKKyAgICAgICAgICAgICAgICAgICAgICAgIDk5ICwgLy82NQorICAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAvLzY2CisgICAgICAgICAgICAgICAgICAgICAgICAxMDAsIC8vNjcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgLy82OAorICAgICAgICAgICAgICAgICAgICAgICAgMTAxLCAvLzY5CisgICAgICAgICAgICAgICAgICAgICAgICAxMDEsIC8vNzAKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMSwgLy83MQorICAgICAgICAgICAgICAgICAgICAgICAgMTAyLCAvLzcyCisgICAgICAgICAgICAgICAgICAgICAgICAxMDIsIC8vNzMKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMiwgLy83NAorICAgICAgICAgICAgICAgICAgICAgICAgMTAzLCAvLzc1CisgICAgICAgICAgICAgICAgICAgICAgICAxMDMsIC8vNzYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMywgLy83NworICAgICAgICAgICAgICAgICAgICAgICAgMTAzLCAvLzc4CisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vNzkKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy84MAorICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzgxCisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vODIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy84MworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzg0CisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vODUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy84NgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzg3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vODgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy84OQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzkwCisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vOTEKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy85MgorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzkzCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vOTQKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy85NQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzk2CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vOTcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy85OAorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzk5CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTAwCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTAxCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTAyCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTAzCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTA0CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTA1CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTA2CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTA3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTA4CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTA5CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTEwCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTExCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTEyCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTEzCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTE0CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTE1CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTE2CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTE3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTE4CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTE5CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTIwCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTIxCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTIyCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTIzCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTI0CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTI1CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTI2CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTI3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fNQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgMCAgLCAvLzAKKyAgICAgICAgICAgICAgICAgICAgICAgIDQxICwgLy8xCisgICAgICAgICAgICAgICAgICAgICAgICA0MyAsIC8vMgorICAgICAgICAgICAgICAgICAgICAgICAgNDUgLCAvLzMKKyAgICAgICAgICAgICAgICAgICAgICAgIDQ3ICwgLy80CisgICAgICAgICAgICAgICAgICAgICAgICA0OSAsIC8vNQorICAgICAgICAgICAgICAgICAgICAgICAgNTEgLCAvLzYKKyAgICAgICAgICAgICAgICAgICAgICAgIDUzICwgLy83CisgICAgICAgICAgICAgICAgICAgICAgICA1NSAsIC8vOAorICAgICAgICAgICAgICAgICAgICAgICAgNTYgLCAvLzkKKyAgICAgICAgICAgICAgICAgICAgICAgIDU4ICwgLy8xMAorICAgICAgICAgICAgICAgICAgICAgICAgNTkgLCAvLzExCisgICAgICAgICAgICAgICAgICAgICAgICA2MSAsIC8vMTIKKyAgICAgICAgICAgICAgICAgICAgICAgIDYyICwgLy8xMworICAgICAgICAgICAgICAgICAgICAgICAgNjMgLCAvLzE0CisgICAgICAgICAgICAgICAgICAgICAgICA2NCAsIC8vMTUKKyAgICAgICAgICAgICAgICAgICAgICAgIDY1ICwgLy8xNgorICAgICAgICAgICAgICAgICAgICAgICAgNjYgLCAvLzE3CisgICAgICAgICAgICAgICAgICAgICAgICA2OCAsIC8vMTgKKyAgICAgICAgICAgICAgICAgICAgICAgIDY5ICwgLy8xOQorICAgICAgICAgICAgICAgICAgICAgICAgNzAgLCAvLzIwCisgICAgICAgICAgICAgICAgICAgICAgICA3MSAsIC8vMjEKKyAgICAgICAgICAgICAgICAgICAgICAgIDcyICwgLy8yMgorICAgICAgICAgICAgICAgICAgICAgICAgNzMgLCAvLzIzCisgICAgICAgICAgICAgICAgICAgICAgICA3NCAsIC8vMjQKKyAgICAgICAgICAgICAgICAgICAgICAgIDc1ICwgLy8yNQorICAgICAgICAgICAgICAgICAgICAgICAgNzYgLCAvLzI2CisgICAgICAgICAgICAgICAgICAgICAgICA3NyAsIC8vMjcKKyAgICAgICAgICAgICAgICAgICAgICAgIDc3ICwgLy8yOAorICAgICAgICAgICAgICAgICAgICAgICAgNzggLCAvLzI5CisgICAgICAgICAgICAgICAgICAgICAgICA3OSAsIC8vMzAKKyAgICAgICAgICAgICAgICAgICAgICAgIDgwICwgLy8zMQorICAgICAgICAgICAgICAgICAgICAgICAgODAgLCAvLzMyCisgICAgICAgICAgICAgICAgICAgICAgICA4MSAsIC8vMzMKKyAgICAgICAgICAgICAgICAgICAgICAgIDgyICwgLy8zNAorICAgICAgICAgICAgICAgICAgICAgICAgODMgLCAvLzM1CisgICAgICAgICAgICAgICAgICAgICAgICA4MyAsIC8vMzYKKyAgICAgICAgICAgICAgICAgICAgICAgIDg0ICwgLy8zNworICAgICAgICAgICAgICAgICAgICAgICAgODUgLCAvLzM4CisgICAgICAgICAgICAgICAgICAgICAgICA4NiAsIC8vMzkKKyAgICAgICAgICAgICAgICAgICAgICAgIDg3ICwgLy80MAorICAgICAgICAgICAgICAgICAgICAgICAgODcgLCAvLzQxCisgICAgICAgICAgICAgICAgICAgICAgICA4OCAsIC8vNDIKKyAgICAgICAgICAgICAgICAgICAgICAgIDg5ICwgLy80MworICAgICAgICAgICAgICAgICAgICAgICAgODkgLCAvLzQ0CisgICAgICAgICAgICAgICAgICAgICAgICA5MCAsIC8vNDUKKyAgICAgICAgICAgICAgICAgICAgICAgIDkxICwgLy80NgorICAgICAgICAgICAgICAgICAgICAgICAgOTEgLCAvLzQ3CisgICAgICAgICAgICAgICAgICAgICAgICA5MiAsIC8vNDgKKyAgICAgICAgICAgICAgICAgICAgICAgIDkyICwgLy80OQorICAgICAgICAgICAgICAgICAgICAgICAgOTMgLCAvLzUwCisgICAgICAgICAgICAgICAgICAgICAgICA5MyAsIC8vNTEKKyAgICAgICAgICAgICAgICAgICAgICAgIDk0ICwgLy81MgorICAgICAgICAgICAgICAgICAgICAgICAgOTQgLCAvLzUzCisgICAgICAgICAgICAgICAgICAgICAgICA5NSAsIC8vNTQKKyAgICAgICAgICAgICAgICAgICAgICAgIDk1ICwgLy81NQorICAgICAgICAgICAgICAgICAgICAgICAgOTYgLCAvLzU2CisgICAgICAgICAgICAgICAgICAgICAgICA5NiAsIC8vNTcKKyAgICAgICAgICAgICAgICAgICAgICAgIDk3ICwgLy81OAorICAgICAgICAgICAgICAgICAgICAgICAgOTcgLCAvLzU5CisgICAgICAgICAgICAgICAgICAgICAgICA5OCAsIC8vNjAKKyAgICAgICAgICAgICAgICAgICAgICAgIDk4ICwgLy82MQorICAgICAgICAgICAgICAgICAgICAgICAgOTggLCAvLzYyCisgICAgICAgICAgICAgICAgICAgICAgICA5OSAsIC8vNjMKKyAgICAgICAgICAgICAgICAgICAgICAgIDk5ICwgLy82NAorICAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAvLzY1CisgICAgICAgICAgICAgICAgICAgICAgICAxMDAsIC8vNjYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgLy82NworICAgICAgICAgICAgICAgICAgICAgICAgMTAxLCAvLzY4CisgICAgICAgICAgICAgICAgICAgICAgICAxMDEsIC8vNjkKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMSwgLy83MAorICAgICAgICAgICAgICAgICAgICAgICAgMTAyLCAvLzcxCisgICAgICAgICAgICAgICAgICAgICAgICAxMDIsIC8vNzIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMiwgLy83MworICAgICAgICAgICAgICAgICAgICAgICAgMTAzLCAvLzc0CisgICAgICAgICAgICAgICAgICAgICAgICAxMDMsIC8vNzUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMywgLy83NgorICAgICAgICAgICAgICAgICAgICAgICAgMTAzLCAvLzc3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vNzgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy83OQorICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzgwCisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vODEKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy84MgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzgzCisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vODQKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy84NQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzg2CisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vODcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy84OAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzg5CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vOTAKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy85MQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzkyCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vOTMKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy85NAorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzk1CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vOTYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy85NworICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzk4CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vOTkKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDAKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDEKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDMKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDQKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMDkKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy8xMTAKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTEKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTMKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTQKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTkKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMjAKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMjEKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMjIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMjMKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMjQKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMjUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMjYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMjcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl82CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAwICAsIC8vMAorICAgICAgICAgICAgICAgICAgICAgICAgNDEgLCAvLzEKKyAgICAgICAgICAgICAgICAgICAgICAgIDQzICwgLy8yCisgICAgICAgICAgICAgICAgICAgICAgICA0NSAsIC8vMworICAgICAgICAgICAgICAgICAgICAgICAgNDcgLCAvLzQKKyAgICAgICAgICAgICAgICAgICAgICAgIDQ5ICwgLy81CisgICAgICAgICAgICAgICAgICAgICAgICA1MSAsIC8vNgorICAgICAgICAgICAgICAgICAgICAgICAgNTMgLCAvLzcKKyAgICAgICAgICAgICAgICAgICAgICAgIDU1ICwgLy84CisgICAgICAgICAgICAgICAgICAgICAgICA1NiAsIC8vOQorICAgICAgICAgICAgICAgICAgICAgICAgNTggLCAvLzEwCisgICAgICAgICAgICAgICAgICAgICAgICA2MCAsIC8vMTEKKyAgICAgICAgICAgICAgICAgICAgICAgIDYxICwgLy8xMgorICAgICAgICAgICAgICAgICAgICAgICAgNjIgLCAvLzEzCisgICAgICAgICAgICAgICAgICAgICAgICA2MyAsIC8vMTQKKyAgICAgICAgICAgICAgICAgICAgICAgIDY0ICwgLy8xNQorICAgICAgICAgICAgICAgICAgICAgICAgNjYgLCAvLzE2CisgICAgICAgICAgICAgICAgICAgICAgICA2NyAsIC8vMTcKKyAgICAgICAgICAgICAgICAgICAgICAgIDY4ICwgLy8xOAorICAgICAgICAgICAgICAgICAgICAgICAgNjkgLCAvLzE5CisgICAgICAgICAgICAgICAgICAgICAgICA3MCAsIC8vMjAKKyAgICAgICAgICAgICAgICAgICAgICAgIDcxICwgLy8yMQorICAgICAgICAgICAgICAgICAgICAgICAgNzIgLCAvLzIyCisgICAgICAgICAgICAgICAgICAgICAgICA3MyAsIC8vMjMKKyAgICAgICAgICAgICAgICAgICAgICAgIDc0ICwgLy8yNAorICAgICAgICAgICAgICAgICAgICAgICAgNzUgLCAvLzI1CisgICAgICAgICAgICAgICAgICAgICAgICA3NiAsIC8vMjYKKyAgICAgICAgICAgICAgICAgICAgICAgIDc3ICwgLy8yNworICAgICAgICAgICAgICAgICAgICAgICAgNzcgLCAvLzI4CisgICAgICAgICAgICAgICAgICAgICAgICA3OCAsIC8vMjkKKyAgICAgICAgICAgICAgICAgICAgICAgIDc5ICwgLy8zMAorICAgICAgICAgICAgICAgICAgICAgICAgODAgLCAvLzMxCisgICAgICAgICAgICAgICAgICAgICAgICA4MCAsIC8vMzIKKyAgICAgICAgICAgICAgICAgICAgICAgIDgxICwgLy8zMworICAgICAgICAgICAgICAgICAgICAgICAgODIgLCAvLzM0CisgICAgICAgICAgICAgICAgICAgICAgICA4MyAsIC8vMzUKKyAgICAgICAgICAgICAgICAgICAgICAgIDg0ICwgLy8zNgorICAgICAgICAgICAgICAgICAgICAgICAgODQgLCAvLzM3CisgICAgICAgICAgICAgICAgICAgICAgICA4NSAsIC8vMzgKKyAgICAgICAgICAgICAgICAgICAgICAgIDg2ICwgLy8zOQorICAgICAgICAgICAgICAgICAgICAgICAgODcgLCAvLzQwCisgICAgICAgICAgICAgICAgICAgICAgICA4NyAsIC8vNDEKKyAgICAgICAgICAgICAgICAgICAgICAgIDg4ICwgLy80MgorICAgICAgICAgICAgICAgICAgICAgICAgODggLCAvLzQzCisgICAgICAgICAgICAgICAgICAgICAgICA4OSAsIC8vNDQKKyAgICAgICAgICAgICAgICAgICAgICAgIDkwICwgLy80NQorICAgICAgICAgICAgICAgICAgICAgICAgOTAgLCAvLzQ2CisgICAgICAgICAgICAgICAgICAgICAgICA5MSAsIC8vNDcKKyAgICAgICAgICAgICAgICAgICAgICAgIDkxICwgLy80OAorICAgICAgICAgICAgICAgICAgICAgICAgOTIgLCAvLzQ5CisgICAgICAgICAgICAgICAgICAgICAgICA5MiAsIC8vNTAKKyAgICAgICAgICAgICAgICAgICAgICAgIDkzICwgLy81MQorICAgICAgICAgICAgICAgICAgICAgICAgOTMgLCAvLzUyCisgICAgICAgICAgICAgICAgICAgICAgICA5NCAsIC8vNTMKKyAgICAgICAgICAgICAgICAgICAgICAgIDk0ICwgLy81NAorICAgICAgICAgICAgICAgICAgICAgICAgOTUgLCAvLzU1CisgICAgICAgICAgICAgICAgICAgICAgICA5NSAsIC8vNTYKKyAgICAgICAgICAgICAgICAgICAgICAgIDk2ICwgLy81NworICAgICAgICAgICAgICAgICAgICAgICAgOTYgLCAvLzU4CisgICAgICAgICAgICAgICAgICAgICAgICA5NyAsIC8vNTkKKyAgICAgICAgICAgICAgICAgICAgICAgIDk3ICwgLy82MAorICAgICAgICAgICAgICAgICAgICAgICAgOTcgLCAvLzYxCisgICAgICAgICAgICAgICAgICAgICAgICA5OCAsIC8vNjIKKyAgICAgICAgICAgICAgICAgICAgICAgIDk4ICwgLy82MworICAgICAgICAgICAgICAgICAgICAgICAgOTkgLCAvLzY0CisgICAgICAgICAgICAgICAgICAgICAgICA5OSAsIC8vNjUKKyAgICAgICAgICAgICAgICAgICAgICAgIDk5ICwgLy82NgorICAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAvLzY3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDAsIC8vNjgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgLy82OQorICAgICAgICAgICAgICAgICAgICAgICAgMTAxLCAvLzcwCisgICAgICAgICAgICAgICAgICAgICAgICAxMDEsIC8vNzEKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMSwgLy83MgorICAgICAgICAgICAgICAgICAgICAgICAgMTAyLCAvLzczCisgICAgICAgICAgICAgICAgICAgICAgICAxMDIsIC8vNzQKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMiwgLy83NQorICAgICAgICAgICAgICAgICAgICAgICAgMTAzLCAvLzc2CisgICAgICAgICAgICAgICAgICAgICAgICAxMDMsIC8vNzcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMywgLy83OAorICAgICAgICAgICAgICAgICAgICAgICAgMTAzLCAvLzc5CisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vODAKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy84MQorICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzgyCisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vODMKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy84NAorICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzg1CisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vODYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy84NworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzg4CisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vODkKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy85MAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzkxCisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vOTIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy85MworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzk0CisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vOTUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy85NgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzk3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vOTgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy85OQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEwMAorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEwMQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEwMgorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEwMworICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEwNAorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEwNQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEwNgorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEwNworICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEwOAorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEwOQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzExMAorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzExMQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzExMgorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzExMworICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzExNAorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzExNQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzExNgorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzExNworICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzExOAorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzExOQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEyMAorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEyMQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEyMgorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEyMworICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEyNAorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEyNQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEyNgorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzEyNworICAgICAgICAgICAgICAgICAgICAgICAgMTA2LAorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzcKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIDAgICwgLy8wCisgICAgICAgICAgICAgICAgICAgICAgICA0MCAsIC8vMQorICAgICAgICAgICAgICAgICAgICAgICAgNDIgLCAvLzIKKyAgICAgICAgICAgICAgICAgICAgICAgIDQ1ICwgLy8zCisgICAgICAgICAgICAgICAgICAgICAgICA0NyAsIC8vNAorICAgICAgICAgICAgICAgICAgICAgICAgNDkgLCAvLzUKKyAgICAgICAgICAgICAgICAgICAgICAgIDUxICwgLy82CisgICAgICAgICAgICAgICAgICAgICAgICA1MiAsIC8vNworICAgICAgICAgICAgICAgICAgICAgICAgNTQgLCAvLzgKKyAgICAgICAgICAgICAgICAgICAgICAgIDU2ICwgLy85CisgICAgICAgICAgICAgICAgICAgICAgICA1OCAsIC8vMTAKKyAgICAgICAgICAgICAgICAgICAgICAgIDU5ICwgLy8xMQorICAgICAgICAgICAgICAgICAgICAgICAgNjEgLCAvLzEyCisgICAgICAgICAgICAgICAgICAgICAgICA2MiAsIC8vMTMKKyAgICAgICAgICAgICAgICAgICAgICAgIDYzICwgLy8xNAorICAgICAgICAgICAgICAgICAgICAgICAgNjUgLCAvLzE1CisgICAgICAgICAgICAgICAgICAgICAgICA2NiAsIC8vMTYKKyAgICAgICAgICAgICAgICAgICAgICAgIDY3ICwgLy8xNworICAgICAgICAgICAgICAgICAgICAgICAgNjggLCAvLzE4CisgICAgICAgICAgICAgICAgICAgICAgICA2OSAsIC8vMTkKKyAgICAgICAgICAgICAgICAgICAgICAgIDcwICwgLy8yMAorICAgICAgICAgICAgICAgICAgICAgICAgNzEgLCAvLzIxCisgICAgICAgICAgICAgICAgICAgICAgICA3MiAsIC8vMjIKKyAgICAgICAgICAgICAgICAgICAgICAgIDczICwgLy8yMworICAgICAgICAgICAgICAgICAgICAgICAgNzQgLCAvLzI0CisgICAgICAgICAgICAgICAgICAgICAgICA3NSAsIC8vMjUKKyAgICAgICAgICAgICAgICAgICAgICAgIDc2ICwgLy8yNgorICAgICAgICAgICAgICAgICAgICAgICAgNzcgLCAvLzI3CisgICAgICAgICAgICAgICAgICAgICAgICA3NyAsIC8vMjgKKyAgICAgICAgICAgICAgICAgICAgICAgIDc4ICwgLy8yOQorICAgICAgICAgICAgICAgICAgICAgICAgNzkgLCAvLzMwCisgICAgICAgICAgICAgICAgICAgICAgICA4MCAsIC8vMzEKKyAgICAgICAgICAgICAgICAgICAgICAgIDgxICwgLy8zMgorICAgICAgICAgICAgICAgICAgICAgICAgODEgLCAvLzMzCisgICAgICAgICAgICAgICAgICAgICAgICA4MiAsIC8vMzQKKyAgICAgICAgICAgICAgICAgICAgICAgIDgzICwgLy8zNQorICAgICAgICAgICAgICAgICAgICAgICAgODQgLCAvLzM2CisgICAgICAgICAgICAgICAgICAgICAgICA4NSAsIC8vMzcKKyAgICAgICAgICAgICAgICAgICAgICAgIDg2ICwgLy8zOAorICAgICAgICAgICAgICAgICAgICAgICAgODYgLCAvLzM5CisgICAgICAgICAgICAgICAgICAgICAgICA4NyAsIC8vNDAKKyAgICAgICAgICAgICAgICAgICAgICAgIDg4ICwgLy80MQorICAgICAgICAgICAgICAgICAgICAgICAgODkgLCAvLzQyCisgICAgICAgICAgICAgICAgICAgICAgICA4OSAsIC8vNDMKKyAgICAgICAgICAgICAgICAgICAgICAgIDkwICwgLy80NAorICAgICAgICAgICAgICAgICAgICAgICAgOTEgLCAvLzQ1CisgICAgICAgICAgICAgICAgICAgICAgICA5MSAsIC8vNDYKKyAgICAgICAgICAgICAgICAgICAgICAgIDkyICwgLy80NworICAgICAgICAgICAgICAgICAgICAgICAgOTIgLCAvLzQ4CisgICAgICAgICAgICAgICAgICAgICAgICA5MyAsIC8vNDkKKyAgICAgICAgICAgICAgICAgICAgICAgIDkzICwgLy81MAorICAgICAgICAgICAgICAgICAgICAgICAgOTQgLCAvLzUxCisgICAgICAgICAgICAgICAgICAgICAgICA5NCAsIC8vNTIKKyAgICAgICAgICAgICAgICAgICAgICAgIDk1ICwgLy81MworICAgICAgICAgICAgICAgICAgICAgICAgOTUgLCAvLzU0CisgICAgICAgICAgICAgICAgICAgICAgICA5NiAsIC8vNTUKKyAgICAgICAgICAgICAgICAgICAgICAgIDk2ICwgLy81NgorICAgICAgICAgICAgICAgICAgICAgICAgOTcgLCAvLzU3CisgICAgICAgICAgICAgICAgICAgICAgICA5NyAsIC8vNTgKKyAgICAgICAgICAgICAgICAgICAgICAgIDk3ICwgLy81OQorICAgICAgICAgICAgICAgICAgICAgICAgOTggLCAvLzYwCisgICAgICAgICAgICAgICAgICAgICAgICA5OCAsIC8vNjEKKyAgICAgICAgICAgICAgICAgICAgICAgIDk5ICwgLy82MgorICAgICAgICAgICAgICAgICAgICAgICAgOTkgLCAvLzYzCisgICAgICAgICAgICAgICAgICAgICAgICA5OSAsIC8vNjQKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgLy82NQorICAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAvLzY2CisgICAgICAgICAgICAgICAgICAgICAgICAxMDAsIC8vNjcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMSwgLy82OAorICAgICAgICAgICAgICAgICAgICAgICAgMTAxLCAvLzY5CisgICAgICAgICAgICAgICAgICAgICAgICAxMDIsIC8vNzAKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMiwgLy83MQorICAgICAgICAgICAgICAgICAgICAgICAgMTAyLCAvLzcyCisgICAgICAgICAgICAgICAgICAgICAgICAxMDMsIC8vNzMKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMywgLy83NAorICAgICAgICAgICAgICAgICAgICAgICAgMTAzLCAvLzc1CisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vNzYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy83NworICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzc4CisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vNzkKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy84MAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzgxCisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vODIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy84MworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzg0CisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vODUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy84NgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzg3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vODgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy84OQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzkwCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vOTEKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy85MgorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzkzCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vOTQKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy85NQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzk2CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vOTcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy85OAorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzk5CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTAwCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTAxCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTAyCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTAzCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vMTA0CisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTA1CisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTA2CisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTA3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTA4CisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTA5CisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTEwCisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTExCisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTEyCisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTEzCisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTE0CisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTE1CisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTE2CisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTE3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTE4CisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTE5CisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTIwCisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTIxCisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTIyCisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTIzCisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTI0CisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTI1CisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTI2CisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vMTI3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fOAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgMCAgLCAvLzAKKyAgICAgICAgICAgICAgICAgICAgICAgIDQxICwgLy8xCisgICAgICAgICAgICAgICAgICAgICAgICA0NCAsIC8vMgorICAgICAgICAgICAgICAgICAgICAgICAgNDYgLCAvLzMKKyAgICAgICAgICAgICAgICAgICAgICAgIDQ4ICwgLy80CisgICAgICAgICAgICAgICAgICAgICAgICA1MCAsIC8vNQorICAgICAgICAgICAgICAgICAgICAgICAgNTIgLCAvLzYKKyAgICAgICAgICAgICAgICAgICAgICAgIDU0ICwgLy83CisgICAgICAgICAgICAgICAgICAgICAgICA1NiAsIC8vOAorICAgICAgICAgICAgICAgICAgICAgICAgNTggLCAvLzkKKyAgICAgICAgICAgICAgICAgICAgICAgIDU5ICwgLy8xMAorICAgICAgICAgICAgICAgICAgICAgICAgNjAgLCAvLzExCisgICAgICAgICAgICAgICAgICAgICAgICA2MiAsIC8vMTIKKyAgICAgICAgICAgICAgICAgICAgICAgIDYzICwgLy8xMworICAgICAgICAgICAgICAgICAgICAgICAgNjQgLCAvLzE0CisgICAgICAgICAgICAgICAgICAgICAgICA2NiAsIC8vMTUKKyAgICAgICAgICAgICAgICAgICAgICAgIDY3ICwgLy8xNgorICAgICAgICAgICAgICAgICAgICAgICAgNjggLCAvLzE3CisgICAgICAgICAgICAgICAgICAgICAgICA2OSAsIC8vMTgKKyAgICAgICAgICAgICAgICAgICAgICAgIDcwICwgLy8xOQorICAgICAgICAgICAgICAgICAgICAgICAgNzEgLCAvLzIwCisgICAgICAgICAgICAgICAgICAgICAgICA3MiAsIC8vMjEKKyAgICAgICAgICAgICAgICAgICAgICAgIDczICwgLy8yMgorICAgICAgICAgICAgICAgICAgICAgICAgNzQgLCAvLzIzCisgICAgICAgICAgICAgICAgICAgICAgICA3NSAsIC8vMjQKKyAgICAgICAgICAgICAgICAgICAgICAgIDc2ICwgLy8yNQorICAgICAgICAgICAgICAgICAgICAgICAgNzcgLCAvLzI2CisgICAgICAgICAgICAgICAgICAgICAgICA3OCAsIC8vMjcKKyAgICAgICAgICAgICAgICAgICAgICAgIDc5ICwgLy8yOAorICAgICAgICAgICAgICAgICAgICAgICAgNzkgLCAvLzI5CisgICAgICAgICAgICAgICAgICAgICAgICA4MCAsIC8vMzAKKyAgICAgICAgICAgICAgICAgICAgICAgIDgxICwgLy8zMQorICAgICAgICAgICAgICAgICAgICAgICAgODIgLCAvLzMyCisgICAgICAgICAgICAgICAgICAgICAgICA4MyAsIC8vMzMKKyAgICAgICAgICAgICAgICAgICAgICAgIDgzICwgLy8zNAorICAgICAgICAgICAgICAgICAgICAgICAgODQgLCAvLzM1CisgICAgICAgICAgICAgICAgICAgICAgICA4NSAsIC8vMzYKKyAgICAgICAgICAgICAgICAgICAgICAgIDg2ICwgLy8zNworICAgICAgICAgICAgICAgICAgICAgICAgODcgLCAvLzM4CisgICAgICAgICAgICAgICAgICAgICAgICA4NyAsIC8vMzkKKyAgICAgICAgICAgICAgICAgICAgICAgIDg4ICwgLy80MAorICAgICAgICAgICAgICAgICAgICAgICAgODkgLCAvLzQxCisgICAgICAgICAgICAgICAgICAgICAgICA4OSAsIC8vNDIKKyAgICAgICAgICAgICAgICAgICAgICAgIDkwICwgLy80MworICAgICAgICAgICAgICAgICAgICAgICAgOTEgLCAvLzQ0CisgICAgICAgICAgICAgICAgICAgICAgICA5MSAsIC8vNDUKKyAgICAgICAgICAgICAgICAgICAgICAgIDkyICwgLy80NgorICAgICAgICAgICAgICAgICAgICAgICAgOTIgLCAvLzQ3CisgICAgICAgICAgICAgICAgICAgICAgICA5MyAsIC8vNDgKKyAgICAgICAgICAgICAgICAgICAgICAgIDkzICwgLy80OQorICAgICAgICAgICAgICAgICAgICAgICAgOTQgLCAvLzUwCisgICAgICAgICAgICAgICAgICAgICAgICA5NCAsIC8vNTEKKyAgICAgICAgICAgICAgICAgICAgICAgIDk1ICwgLy81MgorICAgICAgICAgICAgICAgICAgICAgICAgOTUgLCAvLzUzCisgICAgICAgICAgICAgICAgICAgICAgICA5NiAsIC8vNTQKKyAgICAgICAgICAgICAgICAgICAgICAgIDk2ICwgLy81NQorICAgICAgICAgICAgICAgICAgICAgICAgOTcgLCAvLzU2CisgICAgICAgICAgICAgICAgICAgICAgICA5NyAsIC8vNTcKKyAgICAgICAgICAgICAgICAgICAgICAgIDk4ICwgLy81OAorICAgICAgICAgICAgICAgICAgICAgICAgOTggLCAvLzU5CisgICAgICAgICAgICAgICAgICAgICAgICA5OCAsIC8vNjAKKyAgICAgICAgICAgICAgICAgICAgICAgIDk5ICwgLy82MQorICAgICAgICAgICAgICAgICAgICAgICAgOTkgLCAvLzYyCisgICAgICAgICAgICAgICAgICAgICAgICAxMDAsIC8vNjMKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgLy82NAorICAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAvLzY1CisgICAgICAgICAgICAgICAgICAgICAgICAxMDEsIC8vNjYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMSwgLy82NworICAgICAgICAgICAgICAgICAgICAgICAgMTAxLCAvLzY4CisgICAgICAgICAgICAgICAgICAgICAgICAxMDIsIC8vNjkKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMiwgLy83MAorICAgICAgICAgICAgICAgICAgICAgICAgMTAzLCAvLzcxCisgICAgICAgICAgICAgICAgICAgICAgICAxMDMsIC8vNzIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMywgLy83MworICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzc0CisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vNzUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy83NgorICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzc3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vNzgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy83OQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzgwCisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vODEKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy84MgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzgzCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vODQKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy84NQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzg2CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vODcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy84OAorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzg5CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vOTAKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy85MQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzkyCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vOTMKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy85NAorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzk1CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vOTYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy85NworICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzk4CisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vOTkKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMDAKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMDEKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMDIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMDMKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMDQKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMDUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMDYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMDcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMDgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMDkKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTAKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTEKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTMKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTQKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMTkKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMjAKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMjEKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMjIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMjMKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMjQKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMjUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMjYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy8xMjcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl85CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAwICAsIC8vMAorICAgICAgICAgICAgICAgICAgICAgICAgNDEgLCAvLzEKKyAgICAgICAgICAgICAgICAgICAgICAgIDQzICwgLy8yCisgICAgICAgICAgICAgICAgICAgICAgICA0NyAsIC8vMworICAgICAgICAgICAgICAgICAgICAgICAgNDggLCAvLzQKKyAgICAgICAgICAgICAgICAgICAgICAgIDUwICwgLy81CisgICAgICAgICAgICAgICAgICAgICAgICA1MiAsIC8vNgorICAgICAgICAgICAgICAgICAgICAgICAgNTMgLCAvLzcKKyAgICAgICAgICAgICAgICAgICAgICAgIDU1ICwgLy84CisgICAgICAgICAgICAgICAgICAgICAgICA1NyAsIC8vOQorICAgICAgICAgICAgICAgICAgICAgICAgNTggLCAvLzEwCisgICAgICAgICAgICAgICAgICAgICAgICA2MCAsIC8vMTEKKyAgICAgICAgICAgICAgICAgICAgICAgIDYyICwgLy8xMgorICAgICAgICAgICAgICAgICAgICAgICAgNjMgLCAvLzEzCisgICAgICAgICAgICAgICAgICAgICAgICA2NCAsIC8vMTQKKyAgICAgICAgICAgICAgICAgICAgICAgIDY1ICwgLy8xNQorICAgICAgICAgICAgICAgICAgICAgICAgNjcgLCAvLzE2CisgICAgICAgICAgICAgICAgICAgICAgICA2OCAsIC8vMTcKKyAgICAgICAgICAgICAgICAgICAgICAgIDY5ICwgLy8xOAorICAgICAgICAgICAgICAgICAgICAgICAgNzAgLCAvLzE5CisgICAgICAgICAgICAgICAgICAgICAgICA3MSAsIC8vMjAKKyAgICAgICAgICAgICAgICAgICAgICAgIDcyICwgLy8yMQorICAgICAgICAgICAgICAgICAgICAgICAgNzMgLCAvLzIyCisgICAgICAgICAgICAgICAgICAgICAgICA3NCAsIC8vMjMKKyAgICAgICAgICAgICAgICAgICAgICAgIDc1ICwgLy8yNAorICAgICAgICAgICAgICAgICAgICAgICAgNzYgLCAvLzI1CisgICAgICAgICAgICAgICAgICAgICAgICA3NyAsIC8vMjYKKyAgICAgICAgICAgICAgICAgICAgICAgIDc3ICwgLy8yNworICAgICAgICAgICAgICAgICAgICAgICAgNzggLCAvLzI4CisgICAgICAgICAgICAgICAgICAgICAgICA3OSAsIC8vMjkKKyAgICAgICAgICAgICAgICAgICAgICAgIDgwICwgLy8zMAorICAgICAgICAgICAgICAgICAgICAgICAgODEgLCAvLzMxCisgICAgICAgICAgICAgICAgICAgICAgICA4MiAsIC8vMzIKKyAgICAgICAgICAgICAgICAgICAgICAgIDgzICwgLy8zMworICAgICAgICAgICAgICAgICAgICAgICAgODQgLCAvLzM0CisgICAgICAgICAgICAgICAgICAgICAgICA4NSAsIC8vMzUKKyAgICAgICAgICAgICAgICAgICAgICAgIDg1ICwgLy8zNgorICAgICAgICAgICAgICAgICAgICAgICAgODYgLCAvLzM3CisgICAgICAgICAgICAgICAgICAgICAgICA4NyAsIC8vMzgKKyAgICAgICAgICAgICAgICAgICAgICAgIDg4ICwgLy8zOQorICAgICAgICAgICAgICAgICAgICAgICAgODkgLCAvLzQwCisgICAgICAgICAgICAgICAgICAgICAgICA4OSAsIC8vNDEKKyAgICAgICAgICAgICAgICAgICAgICAgIDkwICwgLy80MgorICAgICAgICAgICAgICAgICAgICAgICAgOTAgLCAvLzQzCisgICAgICAgICAgICAgICAgICAgICAgICA5MSAsIC8vNDQKKyAgICAgICAgICAgICAgICAgICAgICAgIDkyICwgLy80NQorICAgICAgICAgICAgICAgICAgICAgICAgOTIgLCAvLzQ2CisgICAgICAgICAgICAgICAgICAgICAgICA5MyAsIC8vNDcKKyAgICAgICAgICAgICAgICAgICAgICAgIDk0ICwgLy80OAorICAgICAgICAgICAgICAgICAgICAgICAgOTQgLCAvLzQ5CisgICAgICAgICAgICAgICAgICAgICAgICA5NSAsIC8vNTAKKyAgICAgICAgICAgICAgICAgICAgICAgIDk1ICwgLy81MQorICAgICAgICAgICAgICAgICAgICAgICAgOTYgLCAvLzUyCisgICAgICAgICAgICAgICAgICAgICAgICA5NiAsIC8vNTMKKyAgICAgICAgICAgICAgICAgICAgICAgIDk2ICwgLy81NAorICAgICAgICAgICAgICAgICAgICAgICAgOTcgLCAvLzU1CisgICAgICAgICAgICAgICAgICAgICAgICA5NyAsIC8vNTYKKyAgICAgICAgICAgICAgICAgICAgICAgIDk4ICwgLy81NworICAgICAgICAgICAgICAgICAgICAgICAgOTggLCAvLzU4CisgICAgICAgICAgICAgICAgICAgICAgICA5OSAsIC8vNTkKKyAgICAgICAgICAgICAgICAgICAgICAgIDk5ICwgLy82MAorICAgICAgICAgICAgICAgICAgICAgICAgOTkgLCAvLzYxCisgICAgICAgICAgICAgICAgICAgICAgICAxMDAsIC8vNjIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgLy82MworICAgICAgICAgICAgICAgICAgICAgICAgMTAxLCAvLzY0CisgICAgICAgICAgICAgICAgICAgICAgICAxMDEsIC8vNjUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMiwgLy82NgorICAgICAgICAgICAgICAgICAgICAgICAgMTAyLCAvLzY3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDIsIC8vNjgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMywgLy82OQorICAgICAgICAgICAgICAgICAgICAgICAgMTAzLCAvLzcwCisgICAgICAgICAgICAgICAgICAgICAgICAxMDMsIC8vNzEKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy83MgorICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzczCisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vNzQKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy83NQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzc2CisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vNzcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy83OAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzc5CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vODAKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy84MQorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzgyCisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vODMKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy84NAorICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzg1CisgICAgICAgICAgICAgICAgICAgICAgICAxMDYsIC8vODYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNiwgLy84NworICAgICAgICAgICAgICAgICAgICAgICAgMTA2LCAvLzg4CisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vODkKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy85MAorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzkxCisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vOTIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy85MworICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzk0CisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vOTUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy85NgorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzk3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDcsIC8vOTgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNywgLy85OQorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEwMAorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEwMQorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEwMgorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEwMworICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEwNAorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEwNQorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEwNgorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEwNworICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEwOAorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEwOQorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzExMAorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzExMQorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzExMgorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzExMworICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzExNAorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzExNQorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzExNgorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzExNworICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzExOAorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzExOQorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEyMAorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEyMQorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEyMgorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEyMworICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEyNAorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEyNQorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEyNgorICAgICAgICAgICAgICAgICAgICAgICAgMTA3LCAvLzEyNworICAgICAgICAgICAgICAgICAgICAgICAgMTA3LAorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzEwCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAwICAsIC8vMAorICAgICAgICAgICAgICAgICAgICAgICAgNDIgLCAvLzEKKyAgICAgICAgICAgICAgICAgICAgICAgIDQ0ICwgLy8yCisgICAgICAgICAgICAgICAgICAgICAgICA0NyAsIC8vMworICAgICAgICAgICAgICAgICAgICAgICAgNDkgLCAvLzQKKyAgICAgICAgICAgICAgICAgICAgICAgIDUxICwgLy81CisgICAgICAgICAgICAgICAgICAgICAgICA1MiAsIC8vNgorICAgICAgICAgICAgICAgICAgICAgICAgNTQgLCAvLzcKKyAgICAgICAgICAgICAgICAgICAgICAgIDU1ICwgLy84CisgICAgICAgICAgICAgICAgICAgICAgICA1NyAsIC8vOQorICAgICAgICAgICAgICAgICAgICAgICAgNTggLCAvLzEwCisgICAgICAgICAgICAgICAgICAgICAgICA2MCAsIC8vMTEKKyAgICAgICAgICAgICAgICAgICAgICAgIDYxICwgLy8xMgorICAgICAgICAgICAgICAgICAgICAgICAgNjMgLCAvLzEzCisgICAgICAgICAgICAgICAgICAgICAgICA2NCAsIC8vMTQKKyAgICAgICAgICAgICAgICAgICAgICAgIDY1ICwgLy8xNQorICAgICAgICAgICAgICAgICAgICAgICAgNjYgLCAvLzE2CisgICAgICAgICAgICAgICAgICAgICAgICA2NyAsIC8vMTcKKyAgICAgICAgICAgICAgICAgICAgICAgIDY5ICwgLy8xOAorICAgICAgICAgICAgICAgICAgICAgICAgNzAgLCAvLzE5CisgICAgICAgICAgICAgICAgICAgICAgICA3MSAsIC8vMjAKKyAgICAgICAgICAgICAgICAgICAgICAgIDcyICwgLy8yMQorICAgICAgICAgICAgICAgICAgICAgICAgNzMgLCAvLzIyCisgICAgICAgICAgICAgICAgICAgICAgICA3NCAsIC8vMjMKKyAgICAgICAgICAgICAgICAgICAgICAgIDc1ICwgLy8yNAorICAgICAgICAgICAgICAgICAgICAgICAgNzYgLCAvLzI1CisgICAgICAgICAgICAgICAgICAgICAgICA3NyAsIC8vMjYKKyAgICAgICAgICAgICAgICAgICAgICAgIDc3ICwgLy8yNworICAgICAgICAgICAgICAgICAgICAgICAgNzggLCAvLzI4CisgICAgICAgICAgICAgICAgICAgICAgICA3OSAsIC8vMjkKKyAgICAgICAgICAgICAgICAgICAgICAgIDgwICwgLy8zMAorICAgICAgICAgICAgICAgICAgICAgICAgODEgLCAvLzMxCisgICAgICAgICAgICAgICAgICAgICAgICA4MiAsIC8vMzIKKyAgICAgICAgICAgICAgICAgICAgICAgIDgyICwgLy8zMworICAgICAgICAgICAgICAgICAgICAgICAgODMgLCAvLzM0CisgICAgICAgICAgICAgICAgICAgICAgICA4NCAsIC8vMzUKKyAgICAgICAgICAgICAgICAgICAgICAgIDg1ICwgLy8zNgorICAgICAgICAgICAgICAgICAgICAgICAgODYgLCAvLzM3CisgICAgICAgICAgICAgICAgICAgICAgICA4NiAsIC8vMzgKKyAgICAgICAgICAgICAgICAgICAgICAgIDg3ICwgLy8zOQorICAgICAgICAgICAgICAgICAgICAgICAgODggLCAvLzQwCisgICAgICAgICAgICAgICAgICAgICAgICA4OSAsIC8vNDEKKyAgICAgICAgICAgICAgICAgICAgICAgIDkwICwgLy80MgorICAgICAgICAgICAgICAgICAgICAgICAgOTAgLCAvLzQzCisgICAgICAgICAgICAgICAgICAgICAgICA5MSAsIC8vNDQKKyAgICAgICAgICAgICAgICAgICAgICAgIDkxICwgLy80NQorICAgICAgICAgICAgICAgICAgICAgICAgOTIgLCAvLzQ2CisgICAgICAgICAgICAgICAgICAgICAgICA5MiAsIC8vNDcKKyAgICAgICAgICAgICAgICAgICAgICAgIDkzICwgLy80OAorICAgICAgICAgICAgICAgICAgICAgICAgOTMgLCAvLzQ5CisgICAgICAgICAgICAgICAgICAgICAgICA5NCAsIC8vNTAKKyAgICAgICAgICAgICAgICAgICAgICAgIDk0ICwgLy81MQorICAgICAgICAgICAgICAgICAgICAgICAgOTUgLCAvLzUyCisgICAgICAgICAgICAgICAgICAgICAgICA5NiAsIC8vNTMKKyAgICAgICAgICAgICAgICAgICAgICAgIDk2ICwgLy81NAorICAgICAgICAgICAgICAgICAgICAgICAgOTcgLCAvLzU1CisgICAgICAgICAgICAgICAgICAgICAgICA5NyAsIC8vNTYKKyAgICAgICAgICAgICAgICAgICAgICAgIDk3ICwgLy81NworICAgICAgICAgICAgICAgICAgICAgICAgOTggLCAvLzU4CisgICAgICAgICAgICAgICAgICAgICAgICA5OCAsIC8vNTkKKyAgICAgICAgICAgICAgICAgICAgICAgIDk5ICwgLy82MAorICAgICAgICAgICAgICAgICAgICAgICAgOTkgLCAvLzYxCisgICAgICAgICAgICAgICAgICAgICAgICAxMDAsIC8vNjIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgLy82MworICAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAvLzY0CisgICAgICAgICAgICAgICAgICAgICAgICAxMDEsIC8vNjUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMSwgLy82NgorICAgICAgICAgICAgICAgICAgICAgICAgMTAxLCAvLzY3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDIsIC8vNjgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMiwgLy82OQorICAgICAgICAgICAgICAgICAgICAgICAgMTAyLCAvLzcwCisgICAgICAgICAgICAgICAgICAgICAgICAxMDMsIC8vNzEKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMywgLy83MgorICAgICAgICAgICAgICAgICAgICAgICAgMTAzLCAvLzczCisgICAgICAgICAgICAgICAgICAgICAgICAxMDMsIC8vNzQKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMywgLy83NQorICAgICAgICAgICAgICAgICAgICAgICAgMTAzLCAvLzc2CisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vNzcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy83OAorICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzc5CisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vODAKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy84MQorICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzgyCisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vODMKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy84NAorICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzg1CisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vODYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy84NworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzg4CisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vODkKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy85MAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzkxCisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vOTIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy85MworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzk0CisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vOTUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy85NgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzk3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vOTgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy85OQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwMAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwMQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwMgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwMworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwNAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwNQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwNgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwNworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwOAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwOQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExMAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExMQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExMgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExMworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExNAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExNQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExNgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExNworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExOAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExOQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyMAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyMQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyMgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyMworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyNAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyNQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyNgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyNworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzExCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAwICAsIC8vMAorICAgICAgICAgICAgICAgICAgICAgICAgNDEgLCAvLzEKKyAgICAgICAgICAgICAgICAgICAgICAgIDQ0ICwgLy8yCisgICAgICAgICAgICAgICAgICAgICAgICA0NiAsIC8vMworICAgICAgICAgICAgICAgICAgICAgICAgNDggLCAvLzQKKyAgICAgICAgICAgICAgICAgICAgICAgIDUwICwgLy81CisgICAgICAgICAgICAgICAgICAgICAgICA1MiAsIC8vNgorICAgICAgICAgICAgICAgICAgICAgICAgNTQgLCAvLzcKKyAgICAgICAgICAgICAgICAgICAgICAgIDU2ICwgLy84CisgICAgICAgICAgICAgICAgICAgICAgICA1NyAsIC8vOQorICAgICAgICAgICAgICAgICAgICAgICAgNTkgLCAvLzEwCisgICAgICAgICAgICAgICAgICAgICAgICA2MCAsIC8vMTEKKyAgICAgICAgICAgICAgICAgICAgICAgIDYxICwgLy8xMgorICAgICAgICAgICAgICAgICAgICAgICAgNjMgLCAvLzEzCisgICAgICAgICAgICAgICAgICAgICAgICA2NCAsIC8vMTQKKyAgICAgICAgICAgICAgICAgICAgICAgIDY1ICwgLy8xNQorICAgICAgICAgICAgICAgICAgICAgICAgNjYgLCAvLzE2CisgICAgICAgICAgICAgICAgICAgICAgICA2NyAsIC8vMTcKKyAgICAgICAgICAgICAgICAgICAgICAgIDY5ICwgLy8xOAorICAgICAgICAgICAgICAgICAgICAgICAgNzAgLCAvLzE5CisgICAgICAgICAgICAgICAgICAgICAgICA3MSAsIC8vMjAKKyAgICAgICAgICAgICAgICAgICAgICAgIDcyICwgLy8yMQorICAgICAgICAgICAgICAgICAgICAgICAgNzMgLCAvLzIyCisgICAgICAgICAgICAgICAgICAgICAgICA3NCAsIC8vMjMKKyAgICAgICAgICAgICAgICAgICAgICAgIDc1ICwgLy8yNAorICAgICAgICAgICAgICAgICAgICAgICAgNzYgLCAvLzI1CisgICAgICAgICAgICAgICAgICAgICAgICA3NyAsIC8vMjYKKyAgICAgICAgICAgICAgICAgICAgICAgIDc3ICwgLy8yNworICAgICAgICAgICAgICAgICAgICAgICAgNzggLCAvLzI4CisgICAgICAgICAgICAgICAgICAgICAgICA3OSAsIC8vMjkKKyAgICAgICAgICAgICAgICAgICAgICAgIDgwICwgLy8zMAorICAgICAgICAgICAgICAgICAgICAgICAgODAgLCAvLzMxCisgICAgICAgICAgICAgICAgICAgICAgICA4MSAsIC8vMzIKKyAgICAgICAgICAgICAgICAgICAgICAgIDgyICwgLy8zMworICAgICAgICAgICAgICAgICAgICAgICAgODMgLCAvLzM0CisgICAgICAgICAgICAgICAgICAgICAgICA4MyAsIC8vMzUKKyAgICAgICAgICAgICAgICAgICAgICAgIDg0ICwgLy8zNgorICAgICAgICAgICAgICAgICAgICAgICAgODUgLCAvLzM3CisgICAgICAgICAgICAgICAgICAgICAgICA4NiAsIC8vMzgKKyAgICAgICAgICAgICAgICAgICAgICAgIDg2ICwgLy8zOQorICAgICAgICAgICAgICAgICAgICAgICAgODcgLCAvLzQwCisgICAgICAgICAgICAgICAgICAgICAgICA4OCAsIC8vNDEKKyAgICAgICAgICAgICAgICAgICAgICAgIDg4ICwgLy80MgorICAgICAgICAgICAgICAgICAgICAgICAgODkgLCAvLzQzCisgICAgICAgICAgICAgICAgICAgICAgICA5MCAsIC8vNDQKKyAgICAgICAgICAgICAgICAgICAgICAgIDkwICwgLy80NQorICAgICAgICAgICAgICAgICAgICAgICAgOTEgLCAvLzQ2CisgICAgICAgICAgICAgICAgICAgICAgICA5MiAsIC8vNDcKKyAgICAgICAgICAgICAgICAgICAgICAgIDkyICwgLy80OAorICAgICAgICAgICAgICAgICAgICAgICAgOTMgLCAvLzQ5CisgICAgICAgICAgICAgICAgICAgICAgICA5MyAsIC8vNTAKKyAgICAgICAgICAgICAgICAgICAgICAgIDk0ICwgLy81MQorICAgICAgICAgICAgICAgICAgICAgICAgOTQgLCAvLzUyCisgICAgICAgICAgICAgICAgICAgICAgICA5NSAsIC8vNTMKKyAgICAgICAgICAgICAgICAgICAgICAgIDk1ICwgLy81NAorICAgICAgICAgICAgICAgICAgICAgICAgOTYgLCAvLzU1CisgICAgICAgICAgICAgICAgICAgICAgICA5NiAsIC8vNTYKKyAgICAgICAgICAgICAgICAgICAgICAgIDk2ICwgLy81NworICAgICAgICAgICAgICAgICAgICAgICAgOTcgLCAvLzU4CisgICAgICAgICAgICAgICAgICAgICAgICA5NyAsIC8vNTkKKyAgICAgICAgICAgICAgICAgICAgICAgIDk4ICwgLy82MAorICAgICAgICAgICAgICAgICAgICAgICAgOTggLCAvLzYxCisgICAgICAgICAgICAgICAgICAgICAgICA5OSAsIC8vNjIKKyAgICAgICAgICAgICAgICAgICAgICAgIDk5ICwgLy82MworICAgICAgICAgICAgICAgICAgICAgICAgOTkgLCAvLzY0CisgICAgICAgICAgICAgICAgICAgICAgICAxMDAsIC8vNjUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgLy82NgorICAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAvLzY3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDEsIC8vNjgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMSwgLy82OQorICAgICAgICAgICAgICAgICAgICAgICAgMTAxLCAvLzcwCisgICAgICAgICAgICAgICAgICAgICAgICAxMDIsIC8vNzEKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMiwgLy83MgorICAgICAgICAgICAgICAgICAgICAgICAgMTAyLCAvLzczCisgICAgICAgICAgICAgICAgICAgICAgICAxMDMsIC8vNzQKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMywgLy83NQorICAgICAgICAgICAgICAgICAgICAgICAgMTAzLCAvLzc2CisgICAgICAgICAgICAgICAgICAgICAgICAxMDMsIC8vNzcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMywgLy83OAorICAgICAgICAgICAgICAgICAgICAgICAgMTAzLCAvLzc5CisgICAgICAgICAgICAgICAgICAgICAgICAxMDMsIC8vODAKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy84MQorICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzgyCisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vODMKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy84NAorICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzg1CisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vODYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy84NworICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzg4CisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vODkKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy85MAorICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzkxCisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vOTIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy85MworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzk0CisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vOTUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy85NgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzk3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vOTgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy85OQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwMAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwMQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwMgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwMworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwNAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwNQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwNgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwNworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwOAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwOQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExMAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExMQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExMgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExMworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExNAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExNQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExNgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExNworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExOAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExOQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyMAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyMQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyMgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyMworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyNAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyNQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyNgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyNworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LAorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzEyCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAwICAsIC8vMAorICAgICAgICAgICAgICAgICAgICAgICAgNDIgLCAvLzEKKyAgICAgICAgICAgICAgICAgICAgICAgIDQ0ICwgLy8yCisgICAgICAgICAgICAgICAgICAgICAgICA0NiAsIC8vMworICAgICAgICAgICAgICAgICAgICAgICAgNDggLCAvLzQKKyAgICAgICAgICAgICAgICAgICAgICAgIDUwICwgLy81CisgICAgICAgICAgICAgICAgICAgICAgICA1MiAsIC8vNgorICAgICAgICAgICAgICAgICAgICAgICAgNTQgLCAvLzcKKyAgICAgICAgICAgICAgICAgICAgICAgIDU2ICwgLy84CisgICAgICAgICAgICAgICAgICAgICAgICA1OCAsIC8vOQorICAgICAgICAgICAgICAgICAgICAgICAgNTkgLCAvLzEwCisgICAgICAgICAgICAgICAgICAgICAgICA2MCAsIC8vMTEKKyAgICAgICAgICAgICAgICAgICAgICAgIDYxICwgLy8xMgorICAgICAgICAgICAgICAgICAgICAgICAgNjMgLCAvLzEzCisgICAgICAgICAgICAgICAgICAgICAgICA2NCAsIC8vMTQKKyAgICAgICAgICAgICAgICAgICAgICAgIDY1ICwgLy8xNQorICAgICAgICAgICAgICAgICAgICAgICAgNjYgLCAvLzE2CisgICAgICAgICAgICAgICAgICAgICAgICA2OCAsIC8vMTcKKyAgICAgICAgICAgICAgICAgICAgICAgIDY5ICwgLy8xOAorICAgICAgICAgICAgICAgICAgICAgICAgNzAgLCAvLzE5CisgICAgICAgICAgICAgICAgICAgICAgICA3MSAsIC8vMjAKKyAgICAgICAgICAgICAgICAgICAgICAgIDcyICwgLy8yMQorICAgICAgICAgICAgICAgICAgICAgICAgNzMgLCAvLzIyCisgICAgICAgICAgICAgICAgICAgICAgICA3NCAsIC8vMjMKKyAgICAgICAgICAgICAgICAgICAgICAgIDc1ICwgLy8yNAorICAgICAgICAgICAgICAgICAgICAgICAgNzUgLCAvLzI1CisgICAgICAgICAgICAgICAgICAgICAgICA3NiAsIC8vMjYKKyAgICAgICAgICAgICAgICAgICAgICAgIDc3ICwgLy8yNworICAgICAgICAgICAgICAgICAgICAgICAgNzggLCAvLzI4CisgICAgICAgICAgICAgICAgICAgICAgICA3OSAsIC8vMjkKKyAgICAgICAgICAgICAgICAgICAgICAgIDgwICwgLy8zMAorICAgICAgICAgICAgICAgICAgICAgICAgODAgLCAvLzMxCisgICAgICAgICAgICAgICAgICAgICAgICA4MSAsIC8vMzIKKyAgICAgICAgICAgICAgICAgICAgICAgIDgyICwgLy8zMworICAgICAgICAgICAgICAgICAgICAgICAgODMgLCAvLzM0CisgICAgICAgICAgICAgICAgICAgICAgICA4MyAsIC8vMzUKKyAgICAgICAgICAgICAgICAgICAgICAgIDg0ICwgLy8zNgorICAgICAgICAgICAgICAgICAgICAgICAgODUgLCAvLzM3CisgICAgICAgICAgICAgICAgICAgICAgICA4NiAsIC8vMzgKKyAgICAgICAgICAgICAgICAgICAgICAgIDg2ICwgLy8zOQorICAgICAgICAgICAgICAgICAgICAgICAgODcgLCAvLzQwCisgICAgICAgICAgICAgICAgICAgICAgICA4OCAsIC8vNDEKKyAgICAgICAgICAgICAgICAgICAgICAgIDg5ICwgLy80MgorICAgICAgICAgICAgICAgICAgICAgICAgODkgLCAvLzQzCisgICAgICAgICAgICAgICAgICAgICAgICA5MCAsIC8vNDQKKyAgICAgICAgICAgICAgICAgICAgICAgIDkxICwgLy80NQorICAgICAgICAgICAgICAgICAgICAgICAgOTEgLCAvLzQ2CisgICAgICAgICAgICAgICAgICAgICAgICA5MiAsIC8vNDcKKyAgICAgICAgICAgICAgICAgICAgICAgIDkzICwgLy80OAorICAgICAgICAgICAgICAgICAgICAgICAgOTMgLCAvLzQ5CisgICAgICAgICAgICAgICAgICAgICAgICA5NCAsIC8vNTAKKyAgICAgICAgICAgICAgICAgICAgICAgIDk0ICwgLy81MQorICAgICAgICAgICAgICAgICAgICAgICAgOTUgLCAvLzUyCisgICAgICAgICAgICAgICAgICAgICAgICA5NSAsIC8vNTMKKyAgICAgICAgICAgICAgICAgICAgICAgIDk2ICwgLy81NAorICAgICAgICAgICAgICAgICAgICAgICAgOTYgLCAvLzU1CisgICAgICAgICAgICAgICAgICAgICAgICA5NyAsIC8vNTYKKyAgICAgICAgICAgICAgICAgICAgICAgIDk3ICwgLy81NworICAgICAgICAgICAgICAgICAgICAgICAgOTcgLCAvLzU4CisgICAgICAgICAgICAgICAgICAgICAgICA5OCAsIC8vNTkKKyAgICAgICAgICAgICAgICAgICAgICAgIDk4ICwgLy82MAorICAgICAgICAgICAgICAgICAgICAgICAgOTkgLCAvLzYxCisgICAgICAgICAgICAgICAgICAgICAgICA5OSAsIC8vNjIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgLy82MworICAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAvLzY0CisgICAgICAgICAgICAgICAgICAgICAgICAxMDAsIC8vNjUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMSwgLy82NgorICAgICAgICAgICAgICAgICAgICAgICAgMTAxLCAvLzY3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDEsIC8vNjgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMiwgLy82OQorICAgICAgICAgICAgICAgICAgICAgICAgMTAyLCAvLzcwCisgICAgICAgICAgICAgICAgICAgICAgICAxMDIsIC8vNzEKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMywgLy83MgorICAgICAgICAgICAgICAgICAgICAgICAgMTAzLCAvLzczCisgICAgICAgICAgICAgICAgICAgICAgICAxMDMsIC8vNzQKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwMywgLy83NQorICAgICAgICAgICAgICAgICAgICAgICAgMTAzLCAvLzc2CisgICAgICAgICAgICAgICAgICAgICAgICAxMDMsIC8vNzcKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy83OAorICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzc5CisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vODAKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy84MQorICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzgyCisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vODMKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy84NAorICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzg1CisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vODYKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNCwgLy84NworICAgICAgICAgICAgICAgICAgICAgICAgMTA0LCAvLzg4CisgICAgICAgICAgICAgICAgICAgICAgICAxMDQsIC8vODkKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy85MAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzkxCisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vOTIKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy85MworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzk0CisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vOTUKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy85NgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzk3CisgICAgICAgICAgICAgICAgICAgICAgICAxMDUsIC8vOTgKKyAgICAgICAgICAgICAgICAgICAgICAgIDEwNSwgLy85OQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwMAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwMQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwMgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwMworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwNAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwNQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwNgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwNworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwOAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEwOQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExMAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExMQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExMgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExMworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExNAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExNQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExNgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExNworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExOAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzExOQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyMAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyMQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyMgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyMworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyNAorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyNQorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyNgorICAgICAgICAgICAgICAgICAgICAgICAgMTA1LCAvLzEyNworICAgICAgICAgICAgICAgICAgICAgICAgMTA1LAorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzEzCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgIDAsICAvLzAKKyAgICAgICAgICAgICAgICAgICAgICAgNDAsICAvLzEKKyAgICAgICAgICAgICAgICAgICAgICAgNDMsICAvLzIKKyAgICAgICAgICAgICAgICAgICAgICAgNDUsICAvLzMKKyAgICAgICAgICAgICAgICAgICAgICAgNDcsICAvLzQKKyAgICAgICAgICAgICAgICAgICAgICAgNDksICAvLzUKKyAgICAgICAgICAgICAgICAgICAgICAgNTAsICAvLzYKKyAgICAgICAgICAgICAgICAgICAgICAgNTIsICAvLzcKKyAgICAgICAgICAgICAgICAgICAgICAgNTQsICAvLzgKKyAgICAgICAgICAgICAgICAgICAgICAgNTYsICAvLzkKKyAgICAgICAgICAgICAgICAgICAgICAgNTcsICAvLzEwCisgICAgICAgICAgICAgICAgICAgICAgIDU4LCAgLy8xMQorICAgICAgICAgICAgICAgICAgICAgICA1OSwgIC8vMTIKKyAgICAgICAgICAgICAgICAgICAgICAgNjAsICAvLzEzCisgICAgICAgICAgICAgICAgICAgICAgIDYyLCAgLy8xNAorICAgICAgICAgICAgICAgICAgICAgICA2MywgIC8vMTUKKyAgICAgICAgICAgICAgICAgICAgICAgNjQsICAvLzE2CisgICAgICAgICAgICAgICAgICAgICAgIDY1LCAgLy8xNworICAgICAgICAgICAgICAgICAgICAgICA2NiwgIC8vMTgKKyAgICAgICAgICAgICAgICAgICAgICAgNjcsICAvLzE5CisgICAgICAgICAgICAgICAgICAgICAgIDY4LCAgLy8yMAorICAgICAgICAgICAgICAgICAgICAgICA2OSwgIC8vMjEKKyAgICAgICAgICAgICAgICAgICAgICAgNzAsICAvLzIyCisgICAgICAgICAgICAgICAgICAgICAgIDcxLCAgLy8yMworICAgICAgICAgICAgICAgICAgICAgICA3MiwgIC8vMjQKKyAgICAgICAgICAgICAgICAgICAgICAgNzMsICAvLzI1CisgICAgICAgICAgICAgICAgICAgICAgIDc0LCAgLy8yNgorICAgICAgICAgICAgICAgICAgICAgICA3NCwgIC8vMjcKKyAgICAgICAgICAgICAgICAgICAgICAgNzUsICAvLzI4CisgICAgICAgICAgICAgICAgICAgICAgIDc2LCAgLy8yOQorICAgICAgICAgICAgICAgICAgICAgICA3NywgIC8vMzAKKyAgICAgICAgICAgICAgICAgICAgICAgNzgsICAvLzMxCisgICAgICAgICAgICAgICAgICAgICAgIDc4LCAgLy8zMgorICAgICAgICAgICAgICAgICAgICAgICA3OSwgIC8vMzMKKyAgICAgICAgICAgICAgICAgICAgICAgODAsICAvLzM0CisgICAgICAgICAgICAgICAgICAgICAgIDgxLCAgLy8zNQorICAgICAgICAgICAgICAgICAgICAgICA4MiwgIC8vMzYKKyAgICAgICAgICAgICAgICAgICAgICAgODMsICAvLzM3CisgICAgICAgICAgICAgICAgICAgICAgIDgzLCAgLy8zOAorICAgICAgICAgICAgICAgICAgICAgICA4NCwgIC8vMzkKKyAgICAgICAgICAgICAgICAgICAgICAgODUsICAvLzQwCisgICAgICAgICAgICAgICAgICAgICAgIDg1LCAgLy80MQorICAgICAgICAgICAgICAgICAgICAgICA4NiwgIC8vNDIKKyAgICAgICAgICAgICAgICAgICAgICAgODcsICAvLzQzCisgICAgICAgICAgICAgICAgICAgICAgIDg3LCAgLy80NAorICAgICAgICAgICAgICAgICAgICAgICA4OCwgIC8vNDUKKyAgICAgICAgICAgICAgICAgICAgICAgODksICAvLzQ2CisgICAgICAgICAgICAgICAgICAgICAgIDg5LCAgLy80NworICAgICAgICAgICAgICAgICAgICAgICA5MCwgIC8vNDgKKyAgICAgICAgICAgICAgICAgICAgICAgOTAsICAvLzQ5CisgICAgICAgICAgICAgICAgICAgICAgIDkxLCAgLy81MAorICAgICAgICAgICAgICAgICAgICAgICA5MSwgIC8vNTEKKyAgICAgICAgICAgICAgICAgICAgICAgOTIsICAvLzUyCisgICAgICAgICAgICAgICAgICAgICAgIDkyLCAgLy81MworICAgICAgICAgICAgICAgICAgICAgICA5MywgIC8vNTQKKyAgICAgICAgICAgICAgICAgICAgICAgOTMsICAvLzU1CisgICAgICAgICAgICAgICAgICAgICAgIDk0LCAgLy81NgorICAgICAgICAgICAgICAgICAgICAgICA5NCwgIC8vNTcKKyAgICAgICAgICAgICAgICAgICAgICAgOTUsICAvLzU4CisgICAgICAgICAgICAgICAgICAgICAgIDk1LCAgLy81OQorICAgICAgICAgICAgICAgICAgICAgICA5NiwgIC8vNjAKKyAgICAgICAgICAgICAgICAgICAgICAgOTYsICAvLzYxCisgICAgICAgICAgICAgICAgICAgICAgIDk2LCAgLy82MgorICAgICAgICAgICAgICAgICAgICAgICA5NywgIC8vNjMKKyAgICAgICAgICAgICAgICAgICAgICAgOTcsICAvLzY0CisgICAgICAgICAgICAgICAgICAgICAgIDk3LCAgLy82NQorICAgICAgICAgICAgICAgICAgICAgICA5OCwgIC8vNjYKKyAgICAgICAgICAgICAgICAgICAgICAgOTgsICAvLzY3CisgICAgICAgICAgICAgICAgICAgICAgIDk4LCAgLy82OAorICAgICAgICAgICAgICAgICAgICAgICA5OCwgIC8vNjkKKyAgICAgICAgICAgICAgICAgICAgICAgOTksICAvLzcwCisgICAgICAgICAgICAgICAgICAgICAgIDk5LCAgLy83MQorICAgICAgICAgICAgICAgICAgICAgICA5OSwgIC8vNzIKKyAgICAgICAgICAgICAgICAgICAgICAgOTksICAvLzczCisgICAgICAgICAgICAgICAgICAgICAgIDk5LCAgLy83NAorICAgICAgICAgICAgICAgICAgICAgICA5OSwgIC8vNzUKKyAgICAgICAgICAgICAgICAgICAgICAgOTksICAvLzc2CisgICAgICAgICAgICAgICAgICAgICAgIDk5LCAgLy83NworICAgICAgICAgICAgICAgICAgICAgICA5OSwgIC8vNzgKKyAgICAgICAgICAgICAgICAgICAgICAgOTksICAvLzc5CisgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgIC8vODAKKyAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAgLy84MQorICAgICAgICAgICAgICAgICAgICAgICAxMDAsICAvLzgyCisgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgIC8vODMKKyAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAgLy84NAorICAgICAgICAgICAgICAgICAgICAgICAxMDAsICAvLzg1CisgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgIC8vODYKKyAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAgLy84NworICAgICAgICAgICAgICAgICAgICAgICAxMDAsICAvLzg4CisgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgIC8vODkKKyAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAgLy85MAorICAgICAgICAgICAgICAgICAgICAgICAxMDAsICAvLzkxCisgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgIC8vOTIKKyAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAgLy85MworICAgICAgICAgICAgICAgICAgICAgICAxMDAsICAvLzk0CisgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgIC8vOTUKKyAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAgLy85NgorICAgICAgICAgICAgICAgICAgICAgICAxMDAsICAvLzk3CisgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgLy85OAorICAgICAgICAgICAgICAgICAgICAgICAxMDAsIC8vOTkKKyAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAvLzEwMAorICAgICAgICAgICAgICAgICAgICAgICAxMDAsIC8vMTAxCisgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgLy8xMDIKKyAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAvLzEwMworICAgICAgICAgICAgICAgICAgICAgICAxMDAsIC8vMTA0CisgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgLy8xMDUKKyAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAvLzEwNgorICAgICAgICAgICAgICAgICAgICAgICAxMDAsIC8vMTA3CisgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgLy8xMDgKKyAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAvLzEwOQorICAgICAgICAgICAgICAgICAgICAgICAxMDAsIC8vMTEwCisgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgLy8xMTEKKyAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAvLzExMgorICAgICAgICAgICAgICAgICAgICAgICAxMDAsIC8vMTEzCisgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgLy8xMTQKKyAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAvLzExNQorICAgICAgICAgICAgICAgICAgICAgICAxMDAsIC8vMTE2CisgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgLy8xMTcKKyAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAvLzExOAorICAgICAgICAgICAgICAgICAgICAgICAxMDAsIC8vMTE5CisgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgLy8xMjAKKyAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAvLzEyMQorICAgICAgICAgICAgICAgICAgICAgICAxMDAsIC8vMTIyCisgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgLy8xMjMKKyAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAvLzEyNAorICAgICAgICAgICAgICAgICAgICAgICAxMDAsIC8vMTI1CisgICAgICAgICAgICAgICAgICAgICAgIDEwMCwgLy8xMjYKKyAgICAgICAgICAgICAgICAgICAgICAgMTAwLCAvLzEyNworICAgICAgICAgICAgICAgICAgICAgICAxMDAsCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fMTQKKyAgICAgICAgfSwKKworICAgICAgICAvL05WX1RBQkxFX1RQQ19QREFEQ19PRkZTRVRTCisgICAgICAgIHsKKyAgICAgICAgICAgIDk4LCAgLy8gUkZfQ0hBTl8xCisgICAgICAgICAgICAxMDEsICAvLyBSRl9DSEFOXzIKKyAgICAgICAgICAgIDEwMSwgIC8vIFJGX0NIQU5fMworICAgICAgICAgICAgMTAwLCAgLy8gUkZfQ0hBTl80CisgICAgICAgICAgICA5OCwgIC8vIFJGX0NIQU5fNQorICAgICAgICAgICAgOTcsICAvLyBSRl9DSEFOXzYKKyAgICAgICAgICAgIDk0LCAgLy8gUkZfQ0hBTl83CisgICAgICAgICAgICA5NCwgIC8vIFJGX0NIQU5fOAorICAgICAgICAgICAgOTIsICAvLyBSRl9DSEFOXzkKKyAgICAgICAgICAgIDkwLCAgLy8gUkZfQ0hBTl8xMAorICAgICAgICAgICAgOTQsICAvLyBSRl9DSEFOXzExCisgICAgICAgICAgICA5NSwgIC8vIFJGX0NIQU5fMTIKKyAgICAgICAgICAgIDk3LCAgLy8gUkZfQ0hBTl8xMworICAgICAgICAgICAgMTA0LCAgIC8vIFJGX0NIQU5fMTQKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOXzI0MAorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fMjQ0CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl8yNDgKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOXzI1MgorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fMjA4CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl8yMTIKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOXzIxNgorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fMzYKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOXzQwCisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl80NAorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fNDgKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOXzUyCisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl81NgorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fNjAKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOXzY0CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl8xMDAKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOXzEwNAorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fMTA4CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl8xMTIKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOXzExNgorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fMTIwCisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl8xMjQKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOXzEyOAorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fMTMyCisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl8xMzYKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOXzE0MAorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fMTQ5CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl8xNTMKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOXzE1NworICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fMTYxCisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl8xNjUKKyAgICAgICAgICAgIC8vQ0hBTk5FTCBCT05ERUQgQ0hBTk5FTFMKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOX0JPTkRfMworICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF80CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzUKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOX0JPTkRfNgorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF83CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzgKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOX0JPTkRfOQorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF8xMAorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF8xMQorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF8yNDIKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOX0JPTkRfMjQ2CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzI1MAorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF8yMTAKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOX0JPTkRfMjE0CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzM4CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzQyCisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzQ2CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzUwCisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzU0CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzU4CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzYyCisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzEwMgorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF8xMDYKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOX0JPTkRfMTEwCisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzExNAorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF8xMTgKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOX0JPTkRfMTIyCisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzEyNgorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF8xMzAKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOX0JPTkRfMTM0CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzEzOAorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF8xNTEKKyAgICAgICAgICAgIDEwMCwgICAvLyBSRl9DSEFOX0JPTkRfMTU1CisgICAgICAgICAgICAxMDAsICAgLy8gUkZfQ0hBTl9CT05EXzE1OQorICAgICAgICAgICAgMTAwLCAgIC8vIFJGX0NIQU5fQk9ORF8xNjMKKyAgICAgICAgfSwKKworICAgICAgICAvL05WX1RBQkxFX1ZJUlRVQUxfUkFURQorICAgICAgICAvLyB0eXBlZGVmIHRBTklfUzE2IHRQb3dlcmRCbTsKKyAgICAgICAgLy90eXBlZGVmIHRQb3dlcmRCbSB0UmF0ZUdyb3VwUHdyW05VTV9IQUxfUEhZX1JBVEVTXTsKKyAgICAgICAgLy90UmF0ZUdyb3VwUHdyICAgICAgIHB3ck9wdGltdW1bTlVNX1JGX1NVQkJBTkRTXTsKKyAgICAgICAgeworICAgICAgICAgICAgLy8gMi40RyBSRiBTdWJiYW5kCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy84MDIuMTFiIFJhdGVzCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIEhBTF9QSFlfVlJBVEVfMTFBXzU0X01CUFMsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIEhBTF9QSFlfVlJBVEVfTUNTXzFOU1NfNjVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gSEFMX1BIWV9WUkFURV9NQ1NfMU5TU19NTV9TR183Ml8yX01CUFMsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIEhBTF9QSFlfVlJBVEVfTUNTXzFOU1NfQ0JfMTM1X01CUFMKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gSEFMX1BIWV9WUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xNTBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIC8vIDVHIExvdyBSRiBTdWJiYW5kCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy84MDIuMTFiIFJhdGVzCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIEhBTF9QSFlfVlJBVEVfMTFBXzU0X01CUFMsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIEhBTF9QSFlfVlJBVEVfTUNTXzFOU1NfNjVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gSEFMX1BIWV9WUkFURV9NQ1NfMU5TU19NTV9TR183Ml8yX01CUFMsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIEhBTF9QSFlfVlJBVEVfTUNTXzFOU1NfQ0JfMTM1X01CUFMKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gSEFMX1BIWV9WUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xNTBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIC8vIDVHIE1pZGRsZSBSRiBTdWJiYW5kCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy84MDIuMTFiIFJhdGVzCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIEhBTF9QSFlfVlJBVEVfMTFBXzU0X01CUFMsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIEhBTF9QSFlfVlJBVEVfTUNTXzFOU1NfNjVfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gSEFMX1BIWV9WUkFURV9NQ1NfMU5TU19NTV9TR183Ml8yX01CUFMsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIEhBTF9QSFlfVlJBVEVfTUNTXzFOU1NfQ0JfMTM1X01CUFMKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gSEFMX1BIWV9WUkFURV9NQ1NfMU5TU19NTV9TR19DQl8xNTBfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIC8vIDVHIEhpZ2ggUkYgU3ViYmFuZAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vODAyLjExYiBSYXRlcworICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBIQUxfUEhZX1ZSQVRFXzExQV81NF9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBIQUxfUEhZX1ZSQVRFX01DU18xTlNTXzY1X01CUFMsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIEhBTF9QSFlfVlJBVEVfTUNTXzFOU1NfTU1fU0dfNzJfMl9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBIQUxfUEhZX1ZSQVRFX01DU18xTlNTX0NCXzEzNV9NQlBTCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIEhBTF9QSFlfVlJBVEVfTUNTXzFOU1NfTU1fU0dfQ0JfMTUwX01CUFMsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICAvLyA0LjlHIFJGIFN1YmJhbmQKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvLzgwMi4xMWIgUmF0ZXMKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gSEFMX1BIWV9WUkFURV8xMUFfNTRfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gSEFMX1BIWV9WUkFURV9NQ1NfMU5TU182NV9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBIQUxfUEhZX1ZSQVRFX01DU18xTlNTX01NX1NHXzcyXzJfTUJQUywKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gSEFMX1BIWV9WUkFURV9NQ1NfMU5TU19DQl8xMzVfTUJQUworICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBIQUxfUEhZX1ZSQVRFX01DU18xTlNTX01NX1NHX0NCXzE1MF9NQlBTLAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgezEwMH0sICAgIC8vIFJFU0VSVkVELAorICAgICAgICAgICAgICAgIHsxMDB9LCAgICAvLyBSRVNFUlZFRCwKKyAgICAgICAgICAgICAgICB7MTAwfSwgICAgLy8gUkVTRVJWRUQsCisgICAgICAgICAgICB9CisgICAgICAgIH0sCisKKyNpZiAwIC8vRklYTUVfUFJJTUEKKyAgICAgICAgLy9OVl9UQUJMRV9DQUxfTUVNT1JZCisgICAgICAgIHsKKyAgICAgICAgICAgIDB4N0ZGRiwgICAgICAvLyB0QU5JX1UxNiAgICBwcm9jZXNzX21vbml0b3I7CisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgaGRldF9jYWxfY29kZTsKKyAgICAgICAgICAgIDB4MDAsICAgICAgICAvLyB0QU5JX1U4ICAgICByeGZlX2dtXzI7CisKKyAgICAgICAgICAgIDB4MDAsICAgICAgICAvLyB0QU5JX1U4ICAgICB0eF9iYmZfcnR1bmU7CisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgcGFfcnR1bmVfcmVnOworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIHJ0X2NvZGU7CisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgYmlhc19ydHVuZTsKKworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIGJiX2J3MTsKKyAgICAgICAgICAgIDB4MDAsICAgICAgICAvLyB0QU5JX1U4ICAgICBiYl9idzI7CisgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgICAgICAgIC8vIHRBTklfVTggICAgIHJlc2VydmVkWzJdOworCisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgYmJfYnczOworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIGJiX2J3NDsKKyAgICAgICAgICAgIDB4MDAsICAgICAgICAvLyB0QU5JX1U4ICAgICBiYl9idzU7CisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgYmJfYnc2OworCisgICAgICAgICAgICAweDdGRkYsICAgICAgLy8gdEFOSV9VMTYgICAgcmNNZWFzdXJlZDsKKyAgICAgICAgICAgIDB4MDAsICAgICAgICAvLyB0QU5JX1U4ICAgICB0eF9iYmZfY3Q7CisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgdHhfYmJmX2N0cjsKKworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIGNzaF9tYXhnYWluX3JlZzsKKyAgICAgICAgICAgIDB4MDAsICAgICAgICAvLyB0QU5JX1U4ICAgICBjc2hfMGRiX3JlZzsKKyAgICAgICAgICAgIDB4MDAsICAgICAgICAvLyB0QU5JX1U4ICAgICBjc2hfbTNkYl9yZWc7CisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgY3NoX202ZGJfcmVnOworCisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgY2ZmXzBkYl9yZWc7CisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgY2ZmX20zZGJfcmVnOworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIGNmZl9tNmRiX3JlZzsKKyAgICAgICAgICAgIDB4MDAsICAgICAgICAvLyB0QU5JX1U4ICAgICByeGZlX2dwaW9fY3RsXzE7CisKKyAgICAgICAgICAgIDB4MDAsICAgICAgICAvLyB0QU5JX1U4ICAgICBtaXhfYmFsX2NudF8yOworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfUzggICAgIHJ4ZmVfbG5hX2hpZ2hnYWluX2JpYXNfY3RsX2RlbHRhOworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIHJ4ZmVfbG5hX2xvYWRfY3R1bmU7CisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgcnhmZV9sbmFfbmdtX3J0dW5lOworCisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgcnhfaW0yX2lfY2ZnMDsKKyAgICAgICAgICAgIDB4MDAsICAgICAgICAvLyB0QU5JX1U4ICAgICByeF9pbTJfaV9jZmcxOworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIHJ4X2ltMl9xX2NmZzA7CisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgcnhfaW0yX3FfY2ZnMTsKKworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIHBsbF92ZmNfcmVnM19iMDsKKyAgICAgICAgICAgIDB4MDAsICAgICAgICAvLyB0QU5JX1U4ICAgICBwbGxfdmZjX3JlZzNfYjE7CisgICAgICAgICAgICAweDAwLCAgICAgICAgLy8gdEFOSV9VOCAgICAgcGxsX3ZmY19yZWczX2IyOworICAgICAgICAgICAgMHgwMCwgICAgICAgIC8vIHRBTklfVTggICAgIHBsbF92ZmNfcmVnM19iMzsKKworICAgICAgICAgICAgMHg3RkZGLCAgICAgICAgLy8gdEFOSV9VMTYgICAgdGVtcFN0YXJ0OworICAgICAgICAgICAgMHg3RkZGLCAgICAgICAgLy8gdEFOSV9VMTYgICAgdGVtcEZpbmlzaDsKKworICAgICAgICAgICAgeyAvL3R4TG9Db3JyZWN0aW9ucworICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSAgLy8gVFhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzEKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0gIC8vIFRYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl8yCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9ICAvLyBUWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fMworICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSAgLy8gVFhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzQKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0gIC8vIFRYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl81CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9ICAvLyBUWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fNgorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSAgLy8gVFhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzcKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0gIC8vIFRYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl84CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9ICAvLyBUWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fOQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSAgLy8gVFhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzEwCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9ICAvLyBUWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fMTEKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0gIC8vIFRYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl8xMgorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSAgLy8gVFhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzEzCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy8gVFhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9ICAvLyBUWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9ICAvL1JGX0NIQU5fMTQKKyAgICAgICAgICAgIH0sICAgICAgICAvLyB0VHhMb0NvcnJlY3Rpb25zICAgIHR4TG9WYWx1ZXM7CisKKyAgICAgICAgICAgIHsgLy9zVHhJUUNoYW5uZWwKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0gIC8vIFRYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl8xCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9ICAvLyBUWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fMgorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSAgLy8gVFhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzMKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0gIC8vIFRYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl80CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9ICAvLyBUWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fNQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSAgLy8gVFhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzYKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0gIC8vIFRYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl83CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9ICAvLyBUWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fOAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSAgLy8gVFhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0gIC8vIFRYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl8xMAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSAgLy8gVFhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzExCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9ICAvLyBUWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fMTIKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0gIC8vIFRYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl8xMworICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gVFhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBUWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFRYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSAgLy8gVFhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSAgLy9SRl9DSEFOXzE0CisgICAgICAgICAgICB9LCAgICAgICAgLy8gc1R4SVFDaGFubmVsICAgICAgICB0eElxVmFsdWVzOworCisgICAgICAgICAgICB7IC8vc1J4SVFDaGFubmVsCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9ICAvLyBSWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fMQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSAgLy8gUlhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzIKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0gIC8vIFJYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl8zCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9ICAvLyBSWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fNAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSAgLy8gUlhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzUKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0gIC8vIFJYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl82CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9ICAvLyBSWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fNworICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSAgLy8gUlhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzgKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0gIC8vIFJYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl85CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9ICAvLyBSWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fMTAKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0gIC8vIFJYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0sIC8vUkZfQ0hBTl8xMQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8wCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8zCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzUKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF82CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzgKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF85CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEyCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xNAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSAgLy8gUlhfR0FJTl9TVEVQXzE1CisgICAgICAgICAgICAgICAgfSwgLy9SRl9DSEFOXzEyCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzAKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzMKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF80CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzYKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF83CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfOAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzkKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzExCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTIKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzE0CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9ICAvLyBSWF9HQUlOX1NURVBfMTUKKyAgICAgICAgICAgICAgICB9LCAvL1JGX0NIQU5fMTMKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMAorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8yCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMworICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF81CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfNgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzcKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF84CisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfOQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEwCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTEKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0sIC8vIFJYX0dBSU5fU1RFUF8xMgorICAgICAgICAgICAgICAgICAgICB7IDB4MDAwMCwgMHgwMDAwLCAweDAwMDAgfSwgLy8gUlhfR0FJTl9TVEVQXzEzCisgICAgICAgICAgICAgICAgICAgIHsgMHgwMDAwLCAweDAwMDAsIDB4MDAwMCB9LCAvLyBSWF9HQUlOX1NURVBfMTQKKyAgICAgICAgICAgICAgICAgICAgeyAweDAwMDAsIDB4MDAwMCwgMHgwMDAwIH0gIC8vIFJYX0dBSU5fU1RFUF8xNQorICAgICAgICAgICAgICAgIH0gIC8vUkZfQ0hBTl8xNAorICAgICAgICAgICAgfSwgICAgICAgIC8vIHNSeElRQ2hhbm5lbCAgICAgICAgcnhJcVZhbHVlczsKKworICAgICAgICAgICAgeyAvLyB0VHBjQ29uZmlnICAgICAgICAgIGNscGNEYXRhW01BWF9UUENfQ0hBTk5FTFNdCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF81CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSAgLy9DQUxfUE9JTlRfNworICAgICAgICAgICAgICAgICAgICAgICAgfSAvLyBQSFlfVFhfQ0hBSU5fMAorICAgICAgICAgICAgICAgICAgICB9IC8vIGVtcGlyaWNhbAorICAgICAgICAgICAgICAgIH0sIC8vIFJGX0NIQU5fMQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF82CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0gIC8vQ0FMX1BPSU5UXzcKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gLy8gUEhZX1RYX0NIQUlOXzAKKyAgICAgICAgICAgICAgICAgICAgfSAvLyBlbXBpcmljYWwKKyAgICAgICAgICAgICAgICB9LCAvLyBSRl9DSEFOXzIKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8xCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF80CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9ICAvL0NBTF9QT0lOVF83CisgICAgICAgICAgICAgICAgICAgICAgICB9IC8vIFBIWV9UWF9DSEFJTl8wCisgICAgICAgICAgICAgICAgICAgIH0gLy8gZW1waXJpY2FsCisgICAgICAgICAgICAgICAgfSwgLy8gUkZfQ0hBTl8zCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF81CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSAgLy9DQUxfUE9JTlRfNworICAgICAgICAgICAgICAgICAgICAgICAgfSAvLyBQSFlfVFhfQ0hBSU5fMAorICAgICAgICAgICAgICAgICAgICB9IC8vIGVtcGlyaWNhbAorICAgICAgICAgICAgICAgIH0sIC8vIFJGX0NIQU5fNAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF82CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0gIC8vQ0FMX1BPSU5UXzcKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gLy8gUEhZX1RYX0NIQUlOXzAKKyAgICAgICAgICAgICAgICAgICAgfSAvLyBlbXBpcmljYWwKKyAgICAgICAgICAgICAgICB9LCAvLyBSRl9DSEFOXzUKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8xCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF80CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9ICAvL0NBTF9QT0lOVF83CisgICAgICAgICAgICAgICAgICAgICAgICB9IC8vIFBIWV9UWF9DSEFJTl8wCisgICAgICAgICAgICAgICAgICAgIH0gLy8gZW1waXJpY2FsCisgICAgICAgICAgICAgICAgfSwgLy8gUkZfQ0hBTl82CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF81CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSAgLy9DQUxfUE9JTlRfNworICAgICAgICAgICAgICAgICAgICAgICAgfSAvLyBQSFlfVFhfQ0hBSU5fMAorICAgICAgICAgICAgICAgICAgICB9IC8vIGVtcGlyaWNhbAorICAgICAgICAgICAgICAgIH0sIC8vIFJGX0NIQU5fNworICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF82CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0gIC8vQ0FMX1BPSU5UXzcKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gLy8gUEhZX1RYX0NIQUlOXzAKKyAgICAgICAgICAgICAgICAgICAgfSAvLyBlbXBpcmljYWwKKyAgICAgICAgICAgICAgICB9LCAvLyBSRl9DSEFOXzgKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8xCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF80CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9ICAvL0NBTF9QT0lOVF83CisgICAgICAgICAgICAgICAgICAgICAgICB9IC8vIFBIWV9UWF9DSEFJTl8wCisgICAgICAgICAgICAgICAgICAgIH0gLy8gZW1waXJpY2FsCisgICAgICAgICAgICAgICAgfSwgLy8gUkZfQ0hBTl85CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF81CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSAgLy9DQUxfUE9JTlRfNworICAgICAgICAgICAgICAgICAgICAgICAgfSAvLyBQSFlfVFhfQ0hBSU5fMAorICAgICAgICAgICAgICAgICAgICB9IC8vIGVtcGlyaWNhbAorICAgICAgICAgICAgICAgIH0sIC8vIFJGX0NIQU5fMTAKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8xCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF80CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9ICAvL0NBTF9QT0lOVF83CisgICAgICAgICAgICAgICAgICAgICAgICB9IC8vIFBIWV9UWF9DSEFJTl8wCisgICAgICAgICAgICAgICAgICAgIH0gLy8gZW1waXJpY2FsCisgICAgICAgICAgICAgICAgfSwgLy8gUkZfQ0hBTl8xMQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF82CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0gIC8vQ0FMX1BPSU5UXzcKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gLy8gUEhZX1RYX0NIQUlOXzAKKyAgICAgICAgICAgICAgICAgICAgfSAvLyBlbXBpcmljYWwKKyAgICAgICAgICAgICAgICB9LCAvLyBSRl9DSEFOXzEyCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF81CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSAgLy9DQUxfUE9JTlRfNworICAgICAgICAgICAgICAgICAgICAgICAgfSAvLyBQSFlfVFhfQ0hBSU5fMAorICAgICAgICAgICAgICAgICAgICB9IC8vIGVtcGlyaWNhbAorICAgICAgICAgICAgICAgIH0sICAvLyBSRl9DSEFOXzEzCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF8yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSwgLy9DQUxfUE9JTlRfNAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgMHgwMCwgMHgwMCB9LCAvL0NBTF9QT0lOVF81CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAweDAwLCAweDAwIH0sIC8vQ0FMX1BPSU5UXzYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAgfSAgLy9DQUxfUE9JTlRfNworICAgICAgICAgICAgICAgICAgICAgICAgfSAvLyBQSFlfVFhfQ0hBSU5fMAorICAgICAgICAgICAgICAgICAgICB9IC8vIGVtcGlyaWNhbAorICAgICAgICAgICAgICAgIH0gIC8vIFJGX0NIQU5fMTQKKyAgICAgICAgICAgIH0sICAgICAgICAvLyB0VHBjQ29uZmlnICAgICAgICAgIGNscGNEYXRhW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MHgwMCwgMHgwMCB9IH0sIC8vIFJGX0NIQU5fMTA6IHBkYWRjX29mZnNldCwgcmVzZXJ2ZWRbMl0KKyAgICAgICAgICAgICAgICB7IDB4MDAwMCwgeyAweDAwLCAweDAwIH0gfSwgLy8gUkZfQ0hBTl8xMTogcGRhZGNfb2Zmc2V0LCByZXNlcnZlZFsyXQorICAgICAgICAgICAgICAgIHsgMHgwMDAwLCB7IDB4MDAsIDB4MDAgfSB9LCAvLyBSRl9DSEFOXzEyOiBwZGFkY19vZmZzZXQsIHJlc2VydmVkWzJdCisgICAgICAgICAgICAgICAgeyAweDAwMDAsIHsgMHgwMCwgMHgwMCB9IH0sIC8vIFJGX0NIQU5fMTM6IHBkYWRjX29mZnNldCwgcmVzZXJ2ZWRbMl0KKyAgICAgICAgICAgICAgICB7IDB4MDAwMCwgeyAweDAwLCAweDAwIH0gfSAgLy8gUkZfQ0hBTl8xNDogcGRhZGNfb2Zmc2V0LCByZXNlcnZlZFsyXQorICAgICAgICAgICAgfSAgICAgICAgLy8gdFRwY1BhcmFtcyAgICAgICAgICBjbHBjUGFyYW1zW01BWF9UUENfQ0hBTk5FTFNdOworCisgICAgICAgIH0sIC8vTlZfVEFCTEVfQ0FMX01FTU9SWQorI2VuZGlmCisgICAgICAgIC8vTlZfVEFCTEVfRldfQ09ORklHCisgICAgICAgIHsKKyAgICAgICAgICAgIDAsICAgLy9za3VJRAorICAgICAgICAgICAgMCwgICAvL3RwY01vZGUyRworICAgICAgICAgICAgMCwgICAvL3RwY01vZGU1RworICAgICAgICAgICAgMCwgICAvL3Jlc2VydmVkMQorCisgICAgICAgICAgICAwLCAgIC8veFBBMkcKKyAgICAgICAgICAgIDAsICAgLy94UEE1RzsKKyAgICAgICAgICAgIDAsICAgLy9wYVBvbGFyaXR5VHg7CisgICAgICAgICAgICAwLCAgIC8vcGFQb2xhcml0eVJ4OworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgMCwgICAvL3hMTkEyRzsKKyAgICAgICAgICAgIDAsICAgLy94TE5BNUc7CisgICAgICAgICAgICAwLCAgIC8veENvdXBsZXIyRzsKKyAgICAgICAgICAgIDAsICAgLy94Q291cGxlcjVHOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgMCwgICAvL3hQZGV0Mkc7CisgICAgICAgICAgICAwLCAgIC8veFBkZXQ1RzsKKyAgICAgICAgICAgIDAsICAgLy9lbmFibGVEUEQyRzsKKyAgICAgICAgICAgIDEsICAgLy9lbmFibGVEUEQ1RzsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIDEsICAgLy9wZGFkY1NlbGVjdDJHOworICAgICAgICAgICAgMSwgICAvL3BkYWRjU2VsZWN0NUdMb3c7CisgICAgICAgICAgICAxLCAgIC8vcGRhZGNTZWxlY3Q1R01pZDsKKyAgICAgICAgICAgIDEsICAgLy9wZGFkY1NlbGVjdDVHSGlnaDsKKworICAgICAgICAgICAgMCwgICAvL3Jlc2VydmVkMgorICAgICAgICAgICAgMCwgICAvL3Jlc2VydmVkMworICAgICAgICAgICAgMCwgICAvL3Jlc2VydmVkNAorICAgICAgICB9LAorCisKKyAgICAgICAgLy9OVl9UQUJMRV9SU1NJX0NIQU5ORUxfT0ZGU0VUUworICAgICAgICB7CisgICAgICAgICAgICAvL1BIWV9SWF9DSEFJTl8wCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy9iUnNzaU9mZnNldAorICAgICAgICAgICAgICAgIHszMDB9LCAvLyBhcHBseSB0byBhbGwgY2hhbm5sZXMKKworICAgICAgICAgICAgICAgIC8vZ25Sc3NpT2Zmc2V0CisgICAgICAgICAgICAgICAgezMwMH0gIC8vIGFwcGx5IHRvIGFsbCBjaGFubmxlcworICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIC8vcnN2ZAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8vYlJzc2lPZmZzZXQKKyAgICAgICAgICAgICAgICB7MH0sICAgLy8gYXBwbHkgdG8gYWxsIGNoYW5ubGVzCisKKyAgICAgICAgICAgICAgICAvL2duUnNzaU9mZnNldAorICAgICAgICAgICAgICAgIHswfSAgICAvLyBhcHBseSB0byBhbGwgY2hhbm5sZXMKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSwKKworICAgICAgICAvL05WX1RBQkxFX0hXX0NBTF9WQUxVRVMKKyAgICAgICAgeworICAgICAgICAgICAgMHgwLCAgICAgICAgICAgICAvL3ZhbGlkQm1hcAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIDE0MDAsICAgICAgICAvL3BzU2xwVGltZU92ckhkMkc7CisgICAgICAgICAgICAgICAgMTQwMCwgICAgICAgIC8vcHNTbHBUaW1lT3ZySGQ1RzsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAxNjAwLCAgICAgICAgLy9wc1NscFRpbWVPdnJIZHhMTkE1RzsKKyAgICAgICAgICAgICAgICAwLCAgICAgICAgICAgLy9udl9UeEJCRlNlbDlNSHogCisgICAgICAgICAgICAgICAgMCwgICAgICAgICAgIC8vaHdQYXJhbTEKKyAgICAgICAgICAgICAgICAwLCAgICAgICAgICAgLy9od1BhcmFtMgorCisgICAgICAgICAgICAgICAgMHgxQiwgICAgICAgIC8vY3VzdG9tX3RjeG9fcmVnOAorICAgICAgICAgICAgICAgIDB4RkYsICAgICAgICAvL2N1c3RvbV90Y3hvX3JlZzkKKworICAgICAgICAgICAgICAgIDAsICAgICAgICAgICAvL2h3UGFyYW0zOworICAgICAgICAgICAgICAgIDAsICAgICAgICAgICAvL2h3UGFyYW00OworICAgICAgICAgICAgICAgIDAsICAgICAgICAgICAvL2h3UGFyYW01OworICAgICAgICAgICAgICAgIDAsICAgICAgICAgICAvL2h3UGFyYW02OworICAgICAgICAgICAgICAgIDAsICAgICAgICAgICAvL2h3UGFyYW03OworICAgICAgICAgICAgICAgIDAsICAgICAgICAgICAvL2h3UGFyYW04OworICAgICAgICAgICAgICAgIDAsICAgICAgICAgICAvL2h3UGFyYW05OworICAgICAgICAgICAgICAgIDAsICAgICAgICAgICAvL2h3UGFyYW0xMDsKKyAgICAgICAgICAgICAgICAwLCAgICAgICAgICAgLy9od1BhcmFtMTE7CisgICAgICAgICAgICB9CisgICAgICAgIH0sCisKKworICAgICAgICAvL05WX1RBQkxFX0FOVEVOTkFfUEFUSF9MT1NTCisgICAgICAgIHsKKyAgICAgICAgICAgIDI4MCwgIC8vIFJGX0NIQU5fMQorICAgICAgICAgICAgMjcwLCAgLy8gUkZfQ0hBTl8yCisgICAgICAgICAgICAyNzAsICAvLyBSRl9DSEFOXzMKKyAgICAgICAgICAgIDI3MCwgIC8vIFJGX0NIQU5fNAorICAgICAgICAgICAgMjcwLCAgLy8gUkZfQ0hBTl81CisgICAgICAgICAgICAyNzAsICAvLyBSRl9DSEFOXzYKKyAgICAgICAgICAgIDI4MCwgIC8vIFJGX0NIQU5fNworICAgICAgICAgICAgMjgwLCAgLy8gUkZfQ0hBTl84CisgICAgICAgICAgICAyOTAsICAvLyBSRl9DSEFOXzkKKyAgICAgICAgICAgIDMwMCwgIC8vIFJGX0NIQU5fMTAKKyAgICAgICAgICAgIDMwMCwgIC8vIFJGX0NIQU5fMTEKKyAgICAgICAgICAgIDMxMCwgIC8vIFJGX0NIQU5fMTIKKyAgICAgICAgICAgIDMxMCwgIC8vIFJGX0NIQU5fMTMKKyAgICAgICAgICAgIDMxMCwgICAvLyBSRl9DSEFOXzE0CisgICAgICAgICAgICAyODAsICAvLyBSRl9DSEFOXzI0MAorICAgICAgICAgICAgMjgwLCAgLy8gUkZfQ0hBTl8yNDQKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOXzI0OAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fMjUyCisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl8yMDgKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOXzIxMgorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fMjE2CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl8zNgorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fNDAKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOXzQ0CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl80OAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fNTIKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOXzU2CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl82MAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fNjQKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOXzEwMAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fMTA0CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl8xMDgKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOXzExMgorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fMTE2CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl8xMjAKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOXzEyNAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fMTI4CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl8xMzIKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOXzEzNgorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fMTQwCisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl8xNDkKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOXzE1MworICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fMTU3CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl8xNjEKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOXzE2NQorICAgICAgICAgICAgLy9DSEFOTkVMIEJPTkRFRCBDSEFOTkVMUworICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF8zCisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl9CT05EXzQKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfNQorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF82CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl9CT05EXzcKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfOAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF85CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl9CT05EXzEwCisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl9CT05EXzExCisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl9CT05EXzI0MgorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF8yNDYKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfMjUwCisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl9CT05EXzIxMAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF8yMTQKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfMzgKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfNDIKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfNDYKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfNTAKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfNTQKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfNTgKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfNjIKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfMTAyCisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl9CT05EXzEwNgorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF8xMTAKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfMTE0CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl9CT05EXzExOAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF8xMjIKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfMTI2CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl9CT05EXzEzMAorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF8xMzQKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfMTM4CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl9CT05EXzE1MQorICAgICAgICAgICAgMjgwLCAgIC8vIFJGX0NIQU5fQk9ORF8xNTUKKyAgICAgICAgICAgIDI4MCwgICAvLyBSRl9DSEFOX0JPTkRfMTU5CisgICAgICAgICAgICAyODAsICAgLy8gUkZfQ0hBTl9CT05EXzE2MworICAgICAgICB9LAorCisgICAgICAgIC8vTlZfVEFCTEVfUEFDS0VUX1RZUEVfUE9XRVJfTElNSVRTCisgICAgICAgIHsKKyAgICAgICAgICAgIHsgMjE1MCB9LCAvLyBhcHBsaWVkIHRvIGFsbCBjaGFubmVscywgTU9ERV84MDJfMTFCCisgICAgICAgICAgICB7IDE4NTAgfSwgLy8gYXBwbGllZCB0byBhbGwgY2hhbm5lbHMsTU9ERV84MDJfMTFBRworICAgICAgICAgICAgeyAxNzUwIH0gIC8vIGFwcGxpZWQgdG8gYWxsIGNoYW5uZWxzLE1PREVfODAyXzExTgorICAgICAgICB9LAorCisgICAgICAgIC8vTlZfVEFCTEVfT0ZETV9DTURfUFdSX09GRlNFVAorICAgICAgICB7CisgICAgICAgICAgICAwLCAwCisgICA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2UGt0RmlsdGVyQ2ZnVHlwZSAqcFJjdlBrdEZpbHRlckNmZworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7CitzdGF0aWMgVk9TX1NUQVRVUyBXREFfUHJvY2Vzc1BhY2tldEZpbHRlck1hdGNoQ291bnRSZXEgKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0V0RBX0NiQ29udGV4dCAqcFdEQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBTaXJSY3ZGbHRQa3RNYXRjaFJzcCBwUmN2Rmx0UGt0TWF0Y2hSc3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7CitzdGF0aWMgVk9TX1NUQVRVUyBXREFfUHJvY2Vzc1JlY2VpdmVGaWx0ZXJDbGVhckZpbHRlclJlcSAoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFdEQV9DYkNvbnRleHQgKnBXREEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpclJjdkZsdFBrdENsZWFyUGFyYW0gKnBSY3ZGbHRQa3RDbGVhclBhcmFtCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApOworI2VuZGlmIC8vIFdMQU5fRkVBVFVSRV9QQUNLRVRfRklMVEVSSU5HCitWT1NfU1RBVFVTIFdEQV9Qcm9jZXNzU2V0UG93ZXJQYXJhbXNSZXEodFdEQV9DYkNvbnRleHQgKnBXREEsIHRTaXJTZXRQb3dlclBhcmFtc1JlcSAqcFBvd2VyUGFyYW1zKTsKK3N0YXRpYyBWT1NfU1RBVFVTIFdEQV9Qcm9jZXNzVHhDb250cm9sSW5kKHRXREFfQ2JDb250ZXh0ICpwV0RBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHBUeENvbnRyb2xQYXJhbXMgcFR4Q3RybFBhcmFtKTsKK1ZPU19TVEFUVVMgV0RBX0dldFdlcEtleXNGcm9tQ2ZnKCB0V0RBX0NiQ29udGV4dCAqcFdEQSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBEZWZhdWx0S2V5SWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBOdW1LZXlzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0RJX0tleXNUeXBlICpwV2RpS2V5cyApOworCisjaWZkZWYgV0xBTl9GRUFUVVJFX0dUS19PRkZMT0FECitzdGF0aWMgVk9TX1NUQVRVUyBXREFfUHJvY2Vzc0dUS09mZmxvYWRSZXEodFdEQV9DYkNvbnRleHQgKnBXREEsIHRwU2lyR3RrT2ZmbG9hZFBhcmFtcyBwR3RrT2ZmbG9hZFBhcmFtcyk7CitzdGF0aWMgVk9TX1NUQVRVUyBXREFfUHJvY2Vzc0dUS09mZmxvYWRHZXRJbmZvUmVxKHRXREFfQ2JDb250ZXh0ICpwV0RBLCB0cFNpckd0a09mZmxvYWRHZXRJbmZvUnNwUGFyYW1zIHBHdGtPZmZsb2FkR2V0SW5mb1JzcCk7CisjZW5kaWYgLy8gV0xBTl9GRUFUVVJFX0dUS19PRkZMT0FECisKK3ZfVk9JRF90IFdEQV9Qcm9jZXNzR2V0QmNuTWlzc1JhdGVSZXEodFdEQV9DYkNvbnRleHQgKnBXREEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJCY25NaXNzUmF0ZVJlcSAqcERhdGEpOworCitWT1NfU1RBVFVTIFdEQV9Qcm9jZXNzU2V0VG1MZXZlbFJlcSh0V0RBX0NiQ29udGV4dCAqcFdEQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBbmlTZXRUbUxldmVsU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JfU1RBVFMKK1ZPU19TVEFUVVMgV0RBX1Byb2Nlc3NMTFN0YXRzU2V0UmVxKHRXREFfQ2JDb250ZXh0ICpwV0RBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTExTdGF0c1NldFJlcSAqd2RhUmVxdWVzdCk7CisKK1ZPU19TVEFUVVMgV0RBX1Byb2Nlc3NMTFN0YXRzR2V0UmVxKHRXREFfQ2JDb250ZXh0ICpwV0RBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyTExTdGF0c0dldFJlcSAqd2RhUmVxdWVzdCk7CisKK1ZPU19TVEFUVVMgV0RBX1Byb2Nlc3NMTFN0YXRzQ2xlYXJSZXEodFdEQV9DYkNvbnRleHQgKnBXREEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJMTFN0YXRzQ2xlYXJSZXEgKndkYVJlcXVlc3QpOworI2VuZGlmIC8qIFdMQU5fRkVBVFVSRV9MSU5LX0xBWUVSX1NUQVRTICovCisKK3ZfVk9JRF90IFdEQV9Qcm9jZXNzRldTdGF0c0dldFJlcSh0V0RBX0NiQ29udGV4dCAqcFdEQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpckZXU3RhdHNHZXRSZXEgKndkYVJlcXVlc3QpOworCitWT1NfU1RBVFVTIFdEQV9Qcm9jZXNzRW5jcnlwdE1zZ1JlcSh0V0RBX0NiQ29udGV4dCAqcFdEQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggKndkYVJlcXVlc3QpOworVk9TX1NUQVRVUworV0RBX1Byb2Nlc3NTZXRSdHNDdHNIVFZodEluZCh0V0RBX0NiQ29udGV4dCAqcFdEQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiB2YWwpOworCisKK1ZPU19TVEFUVVMgV0RBX1Byb2Nlc3NNb25TdGFydFJlcSggdFdEQV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ICp3ZGFDb250ZXh0OworICAgVk9TX1NUQVRVUyBzdGF0dXM7CisgICBXRElfRGV2aWNlQ2FwYWJpbGl0eVR5cGUgd2RpRGV2Q2FwYWJpbGl0eSA9IHswfSA7CisgICAvKiBBbGxvY2F0ZSBXREEgY29udGV4dCAqLworICAgc3RhdHVzID0gdm9zX2FsbG9jX2NvbnRleHQocFZvc0NvbnRleHQsIFZPU19NT0RVTEVfSURfV0RBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZfVk9JRF90ICoqKSZ3ZGFDb250ZXh0LCBzaXplb2YodFdEQV9DYkNvbnRleHQpKSA7CisgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICIlczogRmFpbGVkIHRvICIKKyAgICAgICAgICAgICAgICAiYWxsb2NhdGUgY29udGV4dCBmb3IgV0RBIC0gc3RhdHVzID0gJWQiLF9fZnVuY19fLCBzdGF0dXMpOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9OT01FTTsKKyAgIH0KKyAgIC8qX19hc20gaW50IDM7Ki8KKyAgIHZvc19tZW1femVybyh3ZGFDb250ZXh0LHNpemVvZih0V0RBX0NiQ29udGV4dCkpOworICAgCisgICAvKiBJbml0aWFsaXplIGRhdGEgc3RydWN0dXJlcyAqLworICAgd2RhQ29udGV4dC0+cFZvc0NvbnRleHQgPSBwVm9zQ29udGV4dDsKKyAgIHdkYUNvbnRleHQtPndkYVN0YXRlID0gV0RBX0lOSVRfU1RBVEU7CisgICB3ZGFDb250ZXh0LT51VHhGbG93TWFzayA9IFdEQV9UWEZMT1dNQVNLOworICAgCisgICAvKiBJbml0aWFsaXplIFdEQS1XREkgc3luY2hyb25pemF0aW9uIGV2ZW50ICovCisgICBzdGF0dXMgPSB2b3NfZXZlbnRfaW5pdCgmd2RhQ29udGV4dC0+d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isgICB3ZGFNc2cuYm9keXB0ciA9IE5VTEw7CisgICB3ZGFNc2cuYm9keXZhbCA9IDA7CisgICAvKiBwb3N0IHRoZSBtZXNzYWdlLi4gKi8KKyAgIHZvc1N0YXR1cyA9IHZvc19tcV9wb3N0X21lc3NhZ2UoIFZPU19NUV9JRF9XREEsICZ3ZGFNc2cgKTsKKyAgIGlmICggIVZPU19JU19TVEFUVVNfU1VDQ0VTUyh2b3NTdGF0dXMpICkKKyAgIHsKKyAgICAgIHZvc1N0YXR1cyA9IFZPU19TVEFUVVNfRV9CQURNU0c7CisgICB9CisgICByZXR1cm4oIHZvc1N0YXR1cyApOworfQorLyoKKyAqIEZVTkNUSU9OOiBXREFfd2RpU3RhcnRDYWxsYmFjaworICogT25jZSBXRElfU3RhcnQgaXMgZmluaXNoZWQsIFdESSBzdGFydCBjYWxsYmFjayB3aWxsIGJlIGNhbGxlZCBieSBXREkKKyAqIHRvIGluZGljYXRlIGNvbXBsZXRpb24gb2YgV0RJX1N0YXJ0LgorICovCit2b2lkIFdEQV93ZGlTdGFydENhbGxiYWNrKFdESV9TdGFydFJzcFBhcmFtc1R5cGUgKndkaVJzcFBhcmFtcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnBWb3NDb250ZXh0KQoreworICAgdFdEQV9DYkNvbnRleHQgKndkYUNvbnRleHQ7CisgICBWT1NfU1RBVFVTIHN0YXR1czsKKyAgIGlmIChOVUxMID09IHBWb3NDb250ZXh0KQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAiJXM6IEludm9rZWQgd2l0aCBpbnZhbGlkIHBWb3NDb250ZXh0IiwgX19mdW5jX18gKTsKKyAgICAgIHJldHVybjsKKyAgIH0KKyAgIHdkYUNvbnRleHQgPSBWT1NfR0VUX1dEQV9D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MTCA7CisgICB0QU5JX1UzMiAgICAgICBzdHJMZW5ndGggPSBXTklfQ0ZHX1NUQV9JRF9MRU47CisgICB2X1BWT0lEX3QgICAgICAqY29uZmlnUGFyYW07CisgICB0QU5JX1UzMiAgICAgICBjb25maWdQYXJhbVNpemU7CisgICB0QU5JX1UzMiAgICAgICAqY29uZmlnRGF0YVZhbHVlOworICAgV0RJX1dsYW5WZXJzaW9uVHlwZSB3Y25zc0NvbXBpbGVkQXBpVmVyc2lvbjsKKyAgIHRBTklfVTggICAgICAgIGk7CisKKyAgIGlmICgoTlVMTCA9PSBwTWFjKXx8KE5VTEwgPT0gd2RhQ29udGV4dCkpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogSW52b2tlZCB3aXRoIGludmFsaWQgd2RhQ29udGV4dCBvciBwTWFjIiwgX19mdW5jX18gKTsKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICB9CisgICBjb25maWdQYXJhbVNpemUgPSAoc2l6ZW9mKHRIYWxDZmcpICogUVdMQU5fSEFMX0NGR19NQVhfUEFSQU1TKSArIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19TVEFfSURfTEVOICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfRURDQV9XTUVfQUNCS19MRU4gKworICAgICAgICAgICAgICAgICAgICAgICAgICAgV05JX0NGR19FRENBX1dNRV9BQ0JFX0xFTiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICBXTklfQ0ZHX0VEQ0FfV01FX0FDVklfTEVOICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIFdOSV9DRkdfRURDQV9XTUVfQUNWT19MRU4gKworICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAoUVdMQU5fSEFMX0NG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KHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfQ1VSUkVOVF9UWF9BTlRFTk5BLCBjb25maWdEYXRhVmFsdWUgKSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBlU0lSX1NVQ0NFU1MpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICJGYWlsZWQgdG8gZ2V0IHZhbHVlIGZvciBXTklfQ0ZHX0NVUlJFTlRfVFhfQU5URU5OQSIpOworICAgICAgZ290byBoYW5kbGVfZmFpbHVyZTsKKyAgIH0KKyAgIHRsdlN0cnVjdCA9ICh0SGFsQ2ZnICopKCggKHRBTklfVTggKikgdGx2U3RydWN0IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc2l6ZW9mKHRIYWxDZmcpICsgdGx2U3RydWN0LT5sZW5ndGgpKSA7IAorICAgLyogUVdMQU5fSEFMX0NGR19DVVJSRU5UX1JYX0FOVEVOTkEgKi8KKyAgIHRsdlN0cnVjdC0+dHlwZSA9IFFXTEFOX0hBTF9DRkdfQ1VSUkVOVF9SWF9BTlRFTk5BOworICAgdGx2U3RydWN0LT5sZW5ndGggPSBzaXplb2YodEFOSV9VMzIpOworICAgY29uZmlnRGF0YVZhbHVlID0gKHRBTklfVTMyICopKHRsdlN0cnVjdCArIDEpOworICAgaWYod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19DVVJSRU5UX1JYX0FOVEVOTkEsIGNvbmZpZ0RhdGFWYWx1ZSkgIT0gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX1NVQ0NFU1MpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0Vf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X1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiRmFpbGVkIHRvIGdldCB2YWx1ZSBmb3IgV05JX0NGR19DQUxfQ09OVFJPTCIpOworICAgICAgZ290byBoYW5kbGVfZmFpbHVyZTsKKyAgIH0KKyAgIHRsdlN0cnVjdCA9ICh0SGFsQ2ZnICopKCggKHRBTklfVTggKikgdGx2U3RydWN0IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc2l6ZW9mKHRIYWxDZmcpICsgdGx2U3RydWN0LT5sZW5ndGgpKTsKKyAgIC8qIFFXTEFOX0hBTF9DRkdfUFJPWElNSVRZICAqLworICAgdGx2U3RydWN0LT50eXBlID0gUVdMQU5fSEFMX0NGR19QUk9YSU1JVFkgOworICAgdGx2U3RydWN0LT5sZW5ndGggPSBzaXplb2YodEFOSV9VMzIpOworICAgY29uZmlnRGF0YVZhbHVlID0gKHRBTklfVTMyICopKHRsdlN0cnVjdCArIDEpOworICAgaWYod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19QUk9YSU1JVFksIGNvbmZpZ0RhdGFWYWx1ZSApIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gZVNJUl9TVUNDRVNTKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiRmFpbGVkIHRvIGdldCB2YWx1ZSBmb3IgV05JX0NGR19QUk9YSU1JVFkiKTsKKyAgICAgIGdvdG8gaGFuZGxlX2ZhaWx1cmU7CisgICB9CisgICB0bHZTdHJ1Y3QgPSAodEhhbENmZyAqKSgoICh0QU5JX1U4ICopIHRsdlN0cnVjdCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBzaXplb2YodEhhbENmZykgKyB0bHZTdHJ1Y3QtPmxlbmd0aCkpIDsgCisgICAvKiB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JX0NGR19NQVhfTUVESVVNX1RJTUUsIGNvbmZpZ0RhdGFWYWx1ZSApICE9IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlU0lSX1NVQ0NFU1MpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICJGYWlsZWQgdG8gZ2V0IHZhbHVlIGZvciBXTklfQ0ZHX01BWF9NRURJVU1fVElNRSIpOworICAgICAgZ290byBoYW5kbGVfZmFpbHVyZTsKKyAgIH0KKyAgIHRsdlN0cnVjdCA9ICh0SGFsQ2ZnICopKCggKHRBTklfVTggKikgdGx2U3RydWN0IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc2l6ZW9mKHRIYWxDZmcpICsgdGx2U3RydWN0LT5sZW5ndGgpKTsgCisgICAvKiBRV0xBTl9IQUxfQ0ZHX01BWF9NUERVU19JTl9BTVBEVSAgICovCisgICB0bHZTdHJ1Y3QtPnR5cGUgPSBRV0xBTl9IQUxfQ0ZHX01BWF9NUERVU19JTl9BTVBEVSAgOworICAgdGx2U3RydWN0LT5sZW5ndGggPSBzaXplb2YodEFOSV9VMzIpOworICAgY29uZmlnRGF0YVZhbHVlID0gKHRBTklfVTMyICopKHRsdlN0cnVjdCArIDEpOworICAgaWYod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19NQVhfTVBEVVNfSU5fQU1QRFUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ0RhdGFWYWx1ZSApICE9IGVTSVJfU1VDQ0VTUykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIkZhaWxlZCB0byBnZXQgdmFs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SggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIkZhaWxlZCB0byBnZXQgdmFsdWUgZm9yIFdOSV9DRkdfRlJBR01FTlRBVElPTl9USFJFU0hPTEQiKTsKKyAgICAgIGdvdG8gaGFuZGxlX2ZhaWx1cmU7CisgICB9CisgICB0bHZTdHJ1Y3QgPSAodEhhbENmZyAqKSgoICh0QU5JX1U4ICopIHRsdlN0cnVjdCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHNpemVvZih0SGFsQ2ZnKSArIHRsdlN0cnVjdC0+bGVuZ3RoKSkgOworICAgLyogUVdMQU5fSEFMX0NGR19EWU5BTUlDX1RIUkVTSE9MRF9aRVJPICAgKi8KKyAgIHRsdlN0cnVjdC0+dHlwZSA9IFFXTEFOX0hBTF9DRkdfRFlOQU1JQ19USFJFU0hPTERfWkVSTyAgOworICAgdGx2U3RydWN0LT5sZW5ndGggPSBzaXplb2YodEFOSV9VMzIpOworICAgY29uZmlnRGF0YVZhbHVlID0gKHRBTklfVTMyICopKHRsdlN0cnVjdCArIDEpOworICAgaWYod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19EWU5BTUlDX1RIUkVTSE9MRF9aRVJPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnRGF0YVZhbHVlICkgIT0gZVNJUl9TVUNDRVNTKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiRmFpbGVkIHRvIGdldCB2YWx1ZSBmb3IgV05JX0NGR19EWU5BTUlDX1RIUkVTSE9MRF9aRVJPIik7CisgICAgICBnb3RvIGhhbmRsZV9mYWlsdXJlOworICAgfQorICAgdGx2U3RydWN0ID0gKHRIYWxDZmcgKikoKCAodEFOSV9VOCAqK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xlX2ZhaWx1cmU7CisgICB9CisgICB0bHZTdHJ1Y3QgPSAodEhhbENmZyAqKSgoICh0QU5JX1U4ICopIHRsdlN0cnVjdCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHNpemVvZih0SGFsQ2ZnKSArIHRsdlN0cnVjdC0+bGVuZ3RoKSk7CisgCisgICAvKiBRV0xBTl9IQUxfQ0ZHX1JFVFJZUkFURV9TRUNPTkRBUlkgICAqLworICAgdGx2U3RydWN0LT50eXBlID0gUVdMQU5fSEFMX0NGR19SRVRSWVJBVEVfU0VDT05EQVJZICA7CisgICB0bHZTdHJ1Y3QtPmxlbmd0aCA9IHNpemVvZih0QU5JX1UzMik7CisgICBjb25maWdEYXRhVmFsdWUgPSAodEFOSV9VMzIgKikodGx2U3RydWN0ICsgMSk7CisgICBpZih3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX1JFVFJZUkFURV9TRUNPTkRBUlksIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ0RhdGFWYWx1ZSApICE9IGVTSVJfU1VDQ0VTUykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIkZhaWxlZCB0byBnZXQgdmFsdWUgZm9yIFdOSV9DRkdfUkVUUllSQVRFX1NFQ09OREFSWSIpOworICAgICAgZ290byBoYW5kbGVfZmFpbHVyZTsKKyAgIH0KKyAgIHRsdlN0cnVjdCA9ICh0SGFsQ2ZnICopKCggKHRBTklfVTggKikgdGx2U3RydWN0IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc2l6ZW9mKHRIYWxDZmcpICsgdGx2U3RydWN0LT5sZW5ndGgpKSA7IAorICAgLyogUVdMQU5fSEFMX0NGR19SRVRSWVJBVEVfVEVSVElBUlkgICAqLworICAgdGx2U3RydWN0LT50eXBlID0gU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gICAgICAgICAgICAgICArIHNpemVvZih0SGFsQ2ZnKSArIHRsdlN0cnVjdC0+bGVuZ3RoKTsgCisgICAKKyAgIC8qIFFXTEFOX0hBTF9DRkdfREVGQVVMVF9SQVRFX0lOREVYXzI0R0haICAgKi8KKyAgIHRsdlN0cnVjdC0+dHlwZSA9IFFXTEFOX0hBTF9DRkdfREVGQVVMVF9SQVRFX0lOREVYXzI0R0haICA7CisgICB0bHZTdHJ1Y3QtPmxlbmd0aCA9IHNpemVvZih0QU5JX1UzMik7CisgICBjb25maWdEYXRhVmFsdWUgPSAodEFOSV9VMzIgKikodGx2U3RydWN0ICsgMSk7CisgICBpZih3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0RFRkFVTFRfUkFURV9JTkRFWF8yNEdIWiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnRGF0YVZhbHVlICkgIT0gZVNJUl9TVUNDRVNTKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiRmFpbGVkIHRvIGdldCB2YWx1ZSBmb3IgV05JX0NGR19ERUZBVUxUX1JBVEVfSU5ERVhfMjRHSFoiKTsKKyAgICAgIGdvdG8gaGFuZGxlX2ZhaWx1cmU7CisgICB9CisgICB0bHZTdHJ1Y3QgPSAodEhhbENmZyAqKSggKHRBTklfVTggKikgdGx2U3RydWN0IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc2l6ZW9mKHRIYWxDZmcpICsgdGx2U3RydWN0LT5sZW5ndGgpOyAKKyAgIC8qIFFXTEFOX0hBTF9DRkdfREVGQVVMVF9SQVRFX0lOREVYXzVHSFogICAqLworICAgdGx2U3RydWN0LT50eXBlID0gUVdMQU5fSEFMX0NGR19ERUZBVUxUX1JBVEVfSU5ERVhfNUdIWiAgOworICAgdGx2U3RydWN0LT5sZW5ndGggPSBzaXplb2YodEFOSV9VMzIpOworICAgY29uZmlnRGF0YVZhbHVlID0gKHRBTklfVTMyICopKHRsdlN0cnVjdCArIDEpOworICAgaWYod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19ERUZBVUxUX1JBVEVfSU5ERVhfNUdIWiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnRGF0YVZhbHVlICkgIT0gZVNJUl9TVUNDRVNTKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiRmFpbGVkIHRvIGdldCB2YWx1ZSBmb3IgV05JX0NGR19ERUZBVUxUX1JBVEVfSU5ERVhfNUdIWiIpOworICAgICAgZ290byBoYW5kbGVfZmFpbHVyZTsKKyAgIH0KKyAgIHRsdlN0cnVjdCA9ICh0SGFsQ2ZnICopKCAodEFOSV9VOCAqKSB0bHZTdHJ1Y3QgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc2l6ZW9mKHRIYWxDZmcpICsgdGx2U3RydWN0LT5sZW5ndGgpOyAKKyAgIC8qIFFXTEFOX0hBTF9DRkdfTUFYX0JBX1NFU1NJT05TICAgKi8KKyAgIHRsdlN0cnVjdC0+dHlwZSA9IFFXTEFOX0hBTF9DRkdfTUFYX0JBX1NFU1NJT05TICA7CisgICB0bHZTdHJ1Y3QtPmxlbmd0aCA9IHNpemVvZih0QU5JX1UzMik7CisgICBjb25maWdEYXRhVmFsdWUgPSAodEFOSV9VMzIgKikodGx2U3RydWN0ICsgMSk7CisgICBpZih3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX01BWF9CQV9TRVNTSU9OUywgY29uZmlnRGF0YVZhbHVlICkgIT0gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9TVUNDRVNTKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiRmFpbGVkIHRvIGdldCB2YWx1ZSBmb3IgV05JX0NGR19NQVhfQkFfU0VTU0lPTlMiKTsKKyAgICAgIGdvdG8gaGFuZGxlX2ZhaWx1cmU7CisgICB9CisgICB0bHZTdHJ1Y3QgPSAodEhhbENmZyAqKSggKHRBTklfVTggKikgdGx2U3RydWN0IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHNpemVvZih0SGFsQ2ZnKSArIHRsdlN0cnVjdC0+bGVuZ3RoKTsKKyAKKyAgIC8qIFFXTEFOX0hBTF9DRkdfUFNfREFUQV9JTkFDVElWSVRZX1RJTUVPVVQgICAqLworICAgdGx2U3RydWN0LT50eXBlID0gUVdMQU5fSEFMX0NGR19QU19EQVRBX0lOQUNUSVZJVFlfVElNRU9VVCAgOworICAgdGx2U3RydWN0LT5sZW5ndGggPSBzaXplb2YodEFOSV9VMzIpOworICAgY29uZmlnRGF0YVZhbHVlID0gKHRBTklfVTMyICopKHRsdlN0cnVjdCArIDEpOworICAgaWYod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19QU19EQVRBX0lOQUNUSVZJVFlfVElNRU9VVCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ0RhdGFWYWx1ZSApICE9IGVTSVJfU1VDQ0VTUykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICJGYWlsZWQgdG8gZ2V0IHZhbHVlIGZvciBXTklfQ0ZHX1BTX0RBVEFfSU5BQ1RJVklUWV9USU1FT1VUIik7CisgICAgICBnb3RvIGhhbmRsZV9mYWlsdXJlOworICAgfQor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QRVJfUlNTSV9BVkVSQUdFLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnRGF0YVZhbHVlICkgIT0gZVNJUl9TVUNDRVNTKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICJGYWlsZWQgdG8gZ2V0IHZhbHVlIGZvciBXTklfQ0ZHX05VTV9CRUFDT05fUEVSX1JTU0lfQVZFUkFHRSIpOworICAgICAgZ290byBoYW5kbGVfZmFpbHVyZTsKKyAgIH0KKyAgIHRsdlN0cnVjdCA9ICh0SGFsQ2ZnICopKCAodEFOSV9VOCAqKSB0bHZTdHJ1Y3QgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHNpemVvZih0SGFsQ2ZnKSArIHRsdlN0cnVjdC0+bGVuZ3RoKTsKKyAKKyAgIC8qIFFXTEFOX0hBTF9DRkdfU1RBVFNfUEVSSU9EICAgKi8KKyAgIHRsdlN0cnVjdC0+dHlwZSA9IFFXTEFOX0hBTF9DRkdfU1RBVFNfUEVSSU9EICA7CisgICB0bHZTdHJ1Y3QtPmxlbmd0aCA9IHNpemVvZih0QU5JX1UzMik7CisgICBjb25maWdEYXRhVmFsdWUgPSAodEFOSV9VMzIgKikodGx2U3RydWN0ICsgMSk7CisgICBpZih3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX1NUQVRTX1BFUklPRCwgY29uZmlnRGF0YVZhbHVlICkgIT0gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9TVUNDRVNTKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiRmFpbGVkIHRvIGdldCB2YWx1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GVuZ3RoKSA7IAorICAgLyogUVdMQU5fSEFMX0NGR19EWU5BTUlDX1BTX1BPTExfVkFMVUUgKi8KKyAgIHRsdlN0cnVjdC0+dHlwZSA9IFFXTEFOX0hBTF9DRkdfRFlOQU1JQ19QU19QT0xMX1ZBTFVFICA7CisgICB0bHZTdHJ1Y3QtPmxlbmd0aCA9IHNpemVvZih0QU5JX1UzMik7CisgICBjb25maWdEYXRhVmFsdWUgPSAodEFOSV9VMzIgKikodGx2U3RydWN0ICsgMSk7CisgICBpZih3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0RZTkFNSUNfUFNfUE9MTF9WQUxVRSwgY29uZmlnRGF0YVZhbHVlKSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICE9IGVTSVJfU1VDQ0VTUykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIkZhaWxlZCB0byBnZXQgdmFsdWUgZm9yIFdOSV9DRkdfRFlOQU1JQ19QU19QT0xMX1ZBTFVFIik7CisgICAgICBnb3RvIGhhbmRsZV9mYWlsdXJlOworICAgfQorICAgdGx2U3RydWN0ID0gKHRIYWxDZmcgKikoICh0QU5JX1U4ICopIHRsdlN0cnVjdCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHNpemVvZih0SGFsQ2ZnKSArIHRsdlN0cnVjdC0+bGVuZ3RoKSA7IAorICAgLyogUVdMQU5fSEFMX0NGR19URUxFX0JDTl9UUkFOU19MSSAqLworICAgdGx2U3RydWN0LT50eXBlID0gUVdMQU5fSEFMX0NGR19URUxFX0JDTl9UUkFOU19MSSAgOworICAgdGx2U3RydWN0LT5sZW5ndGggPSBzaXplb2YodEFOSV9VMzIpOworICAgY29uZmlnRGF0YVZhbHVlID0gKHRBTklfVTMyICopKHRsdlN0cnVjdCArIDE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FQX0xJTktfTU9OSVRPUl9USU1FT1VUICA7CisgICB0bHZTdHJ1Y3QtPmxlbmd0aCA9IHNpemVvZih0QU5JX1UzMik7CisgICBjb25maWdEYXRhVmFsdWUgPSAodEFOSV9VMzIgKikodGx2U3RydWN0ICsgMSk7CisgICBpZih3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0FQX0xJTktfTU9OSVRPUl9USU1FT1VULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWdEYXRhVmFsdWUgKSAhPSBlU0lSX1NVQ0NFU1MpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiRmFpbGVkIHRvIGdldCB2YWx1ZSBmb3IgV05JX0NGR19BUF9MSU5LX01PTklUT1JfVElNRU9VVCIpOworICAgICAgZ290byBoYW5kbGVfZmFpbHVyZTsKKyAgIH0KKworICAgdGx2U3RydWN0ID0gKHRIYWxDZmcgKikoICh0QU5JX1U4ICopIHRsdlN0cnVjdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc2l6ZW9mKHRIYWxDZmcpICsgdGx2U3RydWN0LT5sZW5ndGgpIDsKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworICAgLyogUVdMQU5fSEFMX0NGR19URExTX1BVQVBTRF9NQVNLICAqLworICAgdGx2U3RydWN0LT50eXBlID0gUVdMQU5fSEFMX0NGR19URExTX1BVQVBTRF9NQVNLOworICAgdGx2U3RydWN0LT5sZW5ndGggPSBzaXplb2YodEFOSV9VMzIpOworICAgY29uZmlnRGF0YVZhbHVlID0gKHRBTklfVTMyICopKHRsdlN0cnVjdCArIDEpOworICAgaWYod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19URExTX1FPU19XTU1fVUFQU0RfTUFTSywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnRGF0YVZhbHVlICkgIT0gZVNJUl9TVUNDRVNTKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIkZhaWxlZCB0byBnZXQgdmFsdWUgZm9yIFdOSV9DRkdfVERMU19RT1NfV01NX1VBUFNEX01BU0siKTsKKyAgICAgIGdvdG8gaGFuZGxlX2ZhaWx1cmU7CisgICB9CisgICB0bHZTdHJ1Y3QgPSAodEhhbENmZyAqKSggKHRBTklfVTggKikgdGx2U3RydWN0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBzaXplb2YodEhhbENmZykgKyB0bHZTdHJ1Y3QtPmxlbmd0aCkgOworCisgICAvKiBRV0xBTl9IQUxfQ0ZHX1RETFNfUFVBUFNEX0JVRkZFUl9TVEFfQ0FQQUJMRSAgKi8KKyAgIHRsdlN0cnVjdC0+dHlwZSA9IFFXTEFOX0hBTF9DRkdfVERMU19QVUFQU0RfQlVGRkVSX1NUQV9DQVBBQkxFOworICAgdGx2U3RydWN0LT5sZW5ndGggPSBzaXplb2YodEFOSV9VMzIpOworICAgY29uZmlnRGF0YVZhbHVlID0gKHRBTklfVTMyICopKHRsdlN0cnVjdCArIDEpOworICAgaWYod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19URExTX0JVRl9TVEFfRU5BQkxFRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnRGF0YVZhbHVlICkgIT0gZVNJUl9TVUNDRVNTKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIkZhaWxlZCB0byBnZXQgdmFsdWUgZm9yIFdOSV9DRkdfVERMU19CVUZfU1RBX0VOQUJMRUQiKTsKKyAgICAgIGdvdG8gaGFuZGxlX2ZhaWx1cmU7CisgICB9CisgICB0bHZTdHJ1Y3QgPSAodEhhbENmZyAqKSggKHRBTklfVTggKikgdGx2U3RydWN0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBzaXplb2YodEhhbENmZykgKyB0bHZTdHJ1Y3QtPmxlbmd0aCkgOworICAgLyogUVdMQU5fSEFMX0NGR19URExTX1BVQVBTRF9JTkFDVElWSVRZX1RJTUUgKi8KKyAgIHRsdlN0cnVjdC0+dHlwZSA9IFFXTEFOX0hBTF9DRkdfVERMU19QVUFQU0RfSU5BQ1RJVklUWV9USU1FOworICAgdGx2U3RydWN0LT5sZW5ndGggPSBzaXplb2YodEFOSV9VMzIpOworICAgY29uZmlnRGF0YVZhbHVlID0gKHRBTklfVTMyICopKHRsdlN0cnVjdCArIDEpOworICAgaWYod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19URExTX1BVQVBTRF9JTkFDVF9USU1FLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWdEYXRhVmFsdWUgKSAhPSBlU0lSX1NVQ0NFU1MpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiRmFpbGVkIHRvIGdldCB2YWx1ZSBmb3IgV05JX0NGR19URExTX1BVQVBTRF9JTkFDVF9USU1FIik7CisgICAgICBnb3RvIGhhbmRsZV9mYWlsdXJlOworICAgfQorICAgdGx2U3RydWN0ID0gKHRIYWxDZmcgKikoICh0QU5JX1U4ICopIHRsdlN0cnVjdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc2l6ZW9mKHRIYWxDZmcpICsgdGx2U3RydWN0LT5sZW5ndGgpIDsKKyAgIC8qIFFXTEFOX0hBTF9DRkdfVERMU19QVUFQU0RfUlhfRlJBTUVfVEhSRVNIT0xEX0lOX1NQICovCisgICB0bHZTd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gICAgICAgICAgICAgICAgICAgKyBzaXplb2YodEhhbENmZykgKyB0bHZTdHJ1Y3QtPmxlbmd0aCkpOworCisgICAvKiBRV0xBTl9IQUxfQ0ZHX0FOVEVOTkFfRElWRVJTSVRZICovCisgICB0bHZTdHJ1Y3QtPnR5cGUgPSBRV0xBTl9IQUxfQ0ZHX0FOVEVOTkFfRElWRVJTSVRZOworICAgdGx2U3RydWN0LT5sZW5ndGggPSBzaXplb2YodEFOSV9VMzIpOworICAgY29uZmlnRGF0YVZhbHVlID0gKHRBTklfVTMyICopKHRsdlN0cnVjdCArIDEpOworICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfQU5URU5OQV9ESVZFU0lUWSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnRGF0YVZhbHVlICkgIT0gZVNJUl9TVUNDRVNTKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIkZhaWxlZCB0byBnZXQgdmFsdWUgZm9yIFdOSV9DRkdfQU5URU5OQV9ESVZFU0lUWSIpOworICAgICAgZ290byBoYW5kbGVfZmFpbHVyZTsKKyAgIH0KKworICAgdGx2U3RydWN0ID0gKHRIYWxDZmcgKikoICh0QU5JX1U4ICopIHRsdlN0cnVjdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc2l6ZW9mKHRIYWxDZmcpICsgdGx2U3RydWN0LT5sZW5ndGgpIDsKKworICAgLyogUVdMQU5fSEFMX0NGR19HT19MSU5LX01PTklUT1JfVElNRU9VVCAgICovCisgICB0bHZTdHJ1Y3QtPnR5cGUgPSBRV0xBTl9IQUxfQ0ZHX0dPX0xJTktfTU9OSVRPUl9USU1FT1VUICA7CisgICB0bHZTdHJ1Y3QtPmxlbmd0aCA9IHNpemVvZih0QU5JX1UzMik7CisgICBjb25maWdEYXRhVmFsdWUgPSAodEFOSV9VMzIgKikodGx2U3RydWN0ICsgMSk7CisgICBpZih3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0dPX0xJTktfTU9OSVRPUl9USU1FT1VULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWdEYXRhVmFsdWUgKSAhPSBlU0lSX1NVQ0NFU1MpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiRmFpbGVkIHRvIGdldCB2YWx1ZSBmb3IgV05JX0NGR19HT19MSU5LX01PTklUT1JfVElNRU9VVCIpOworICAgICAgZ290byBoYW5kbGVfZmFpbHVyZTsKKyAgIH0KKyAgIHRsdlN0cnVjdCA9ICh0SGFsQ2ZnICopKCAodEFOSV9VOCAqKSB0bHZTdHJ1Y3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHNpemVvZih0SGFsQ2ZnKSArIHRsdlN0cnVjdC0+bGVuZ3RoKSA7CisKKyAgIC8qIFFXTEFOX0hBTF9DRkdfQVRIX0RJU0FCTEUgKi8KKyAgIHRsdlN0cnVjdC0+dHlwZSA9IFFXTEFOX0hBTF9DRkdfQVRIX0RJU0FCTEUgOworICAgdGx2U3RydWN0LT5sZW5ndGggPSBzaXplb2YodEFOSV9VMzIpOworICAgY29uZmlnRGF0YVZhbHVlID0gKHRBTklfVTMyICopKHRsdlN0cnVjdCArIDEpOworICAgaWYod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19BVEhfRElTQUJMRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnRGF0YVZhbHVlICkgIT0gZVNJUl9TVUNDRVNTKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9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VfQlRfTEVOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWdEYXRhVmFsdWUgKSAhPSBlU0lSX1NVQ0NFU1MpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiRmFpbGVkIHRvIGdldCB2YWx1ZSBmb3IgV05JX0NGR19CVENfU0FQX0FDVElWRV9CVF9MRU4iKTsKKyAgICAgIGdvdG8gaGFuZGxlX2ZhaWx1cmU7CisgICB9CisgICB0bHZTdHJ1Y3QgPSAodEhhbENmZyAqKSggKHRBTklfVTggKikgdGx2U3RydWN0CisgICAgICAgICAgICAgICAgICAgICAgICAgICArIHNpemVvZih0SGFsQ2ZnKSArIHRsdlN0cnVjdC0+bGVuZ3RoKSA7CisKKyAgLyogUVdMQU5fSEFMX0NGR19BU0RfUFJPQkVfSU5URVJWQUwgKi8KKyAgIHRsdlN0cnVjdC0+dHlwZSA9IFFXTEFOX0hBTF9DRkdfQVNEX1BST0JFX0lOVEVSVkFMICA7CisgICB0bHZTdHJ1Y3QtPmxlbmd0aCA9IHNpemVvZih0QU5JX1UzMik7CisgICBjb25maWdEYXRhVmFsdWUgPSAodEFOSV9VMzIgKikodGx2U3RydWN0ICsgMSk7CisgICBpZih3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0FTRF9QUk9CRV9JTlRFUlZBTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnRGF0YVZhbHVlICkgIT0gZVNJUl9TVUNDRVNTKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIkZhaWxlZCB0byBnZXQgdmFsdWUgZm9yIFdOSV9DRkdfQVNEX1BST0JFX0lOVEVSVkFMIik7CisgICAgICBnb3RvIGhhbmRsZV9mYWlsdXJlOworICAgfQorICAgdGx2U3RydWN0ID0gKHRIYWxDZmcgKikoICh0QU5JX1U4ICopIHRsdlN0cnVjdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc2l6ZW9mKHRIYWxDZmcpICsgdGx2U3RydWN0LT5sZW5ndGgpIDsKKworICAgLyogUVdMQU5fSEFMX0NGR19BU0RfVFJJR0dFUl9USFJFU0hPTEQgKi8KKyAgIHRsdlN0cnVjdC0+dHlwZSA9IFFXTEFOX0hBTF9DRkdfQVNEX1RSSUdHRVJfVEhSRVNIT0xEICA7CisgICB0bHZTdHJ1Y3QtPmxlbmd0aCA9IHNpemVvZih0QU5JX1UzMik7CisgICBjb25maWdEYXRhVmFsdWUgPSAodEFOSV9VMzIgKikodGx2U3RydWN0ICsgMSk7CisgICBpZih3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0FTRF9UUklHR0VSX1RIUkVTSE9MRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnRGF0YVZhbHVlICkgIT0gZVNJUl9TVUNDRVNTKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIkZhaWxlZCB0byBnZXQgdmFsdWUgZm9yIFdOSV9DRkdfQVNEX1RSSUdHRVJfVEhSRVNIT0xEIik7CisgICAgICBnb3RvIGhhbmRsZV9mYWlsdXJlOworICAgfQorICAgdGx2U3RydWN0ID0gKHRIYWxDZmcgKikoICh0QU5JX1U4ICopIHRsdlN0cnVjdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc2l6ZW9mKHRIYWxDZmcpICsgdGx2U3RydWN0LT5sZW5ndGgpIDsKKworICAgLyogUVdMQU5fSEFMX0NGR19BU0RfUlRUX1JTU0lfSFlTVF9USFJFU0hPTEQgKi8K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XTklfQ0ZHX0JUQ19EWU5fQTJEUF9UWF9RVUVVRV9USE9MRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnRGF0YVZhbHVlICkgIT0gZVNJUl9TVUNDRVNTKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIkZhaWxlZCB0byBnZXQgdmFsdWUgZm9yIFdOSV9DRkdfQlRDX0RZTl9BMkRQX1RYX1FVRVVFX1RIT0xEIik7CisgICAgICBnb3RvIGhhbmRsZV9mYWlsdXJlOworICAgfQorICAgdGx2U3RydWN0ID0gKHRIYWxDZmcgKikoICh0QU5JX1U4ICopIHRsdlN0cnVjdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc2l6ZW9mKHRIYWxDZmcpICsgdGx2U3RydWN0LT5sZW5ndGgpIDsKKworICAgLyogUVdMQU5fSEFMX0NGR19CVENfRFlOX09QUF9UWF9RVUVVRV9USE9MRCAqLworICAgdGx2U3RydWN0LT50eXBlID0gUVdMQU5fSEFMX0NGR19CVENfRFlOX09QUF9UWF9RVUVVRV9USE9MRCA7CisgICB0bHZTdHJ1Y3QtPmxlbmd0aCA9IHNpemVvZih0QU5JX1UzMik7CisgICBjb25maWdEYXRhVmFsdWUgPSAodEFOSV9VMzIgKikodGx2U3RydWN0ICsgMSk7CisKKyAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0JUQ19EWU5fT1BQX1RYX1FVRVVFX1RIT0xELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWdEYXRhVmFsdWUgKSAhPSBlU0lSX1NVQ0NFU1MpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiRmFpbGVkIHRvIGdldCB2YWx1ZSBmb3IgV05JX0NGR19CVENfRFlOX09QUF9UWF9RVUVVRV9USE9MRCIpOworICAgICAgZ290byBoYW5kbGVfZmFpbHVyZTsKKyAgIH0KKyAgIHRsdlN0cnVjdCA9ICh0SGFsQ2ZnICopKCAodEFOSV9VOCAqKSB0bHZTdHJ1Y3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc2l6ZW9mKHRIYWxDZmcpICsgdGx2U3RydWN0LT5sZW5ndGgpIDsKKworICAgLyogUVdMQU5fSEFMX0NGR19NQVhfVUFQU0RfQ09OU0VDX1NQICovCisgICB0bHZTdHJ1Y3QtPnR5cGUgPSBRV0xBTl9IQUxfQ0ZHX01BWF9VQVBTRF9DT05TRUNfU1AgOworICAgdGx2U3RydWN0LT5sZW5ndGggPSBzaXplb2YodEFOSV9VMzIpOworICAgY29uZmlnRGF0YVZhbHVlID0gKHRBTklfVTMyICopKHRsdlN0cnVjdCArIDEpOworCisgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19NQVhfVUFQU0RfQ09OU0VDX1NQLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWdEYXRhVmFsdWUgKSAhPSBlU0lSX1NVQ0NFU1MpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiRmFpbGVkIHRvIGdldCB2YWx1ZSBmb3IgV05JX0NGR19NQVhfVUFQU0RfQ09OU0VDX1NQIik7CisgICAgICBnb3RvIGhhbmRsZV9mYWlsdXJlOworICAgfQorICAgdGx2U3RydWN0ID0gKHRIYWxDZmcgKikoICh0QU5JX1U4ICopIHRsdlN0cnVjdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBzaXplb2YodEhhbENmZykgKyB0bHZTdHJ1Y3QtPmxlbmd0aCkgOworCis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hbHVlIGZvciBXTklfQ0ZHX01BWF9VQVBTRF9DT05TRUNfUlhfQ05UX01FQVNfV0lORE9XIik7CisgICAgICBnb3RvIGhhbmRsZV9mYWlsdXJlOworICAgfQorICAgdGx2U3RydWN0ID0gKHRIYWxDZmcgKikoICh0QU5JX1U4ICopIHRsdlN0cnVjdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBzaXplb2YodEhhbENmZykgKyB0bHZTdHJ1Y3QtPmxlbmd0aCkgOworCisgICAvKiBRV0xBTl9IQUxfQ0ZHX01BWF9QU1BPTExfSU5fV01NX1VBUFNEX1BTX01PREUgKi8KKyAgIHRsdlN0cnVjdC0+dHlwZSA9IFFXTEFOX0hBTF9DRkdfTUFYX1BTUE9MTF9JTl9XTU1fVUFQU0RfUFNfTU9ERSA7CisgICB0bHZTdHJ1Y3QtPmxlbmd0aCA9IHNpemVvZih0QU5JX1UzMik7CisgICBjb25maWdEYXRhVmFsdWUgPSAodEFOSV9VMzIgKikodGx2U3RydWN0ICsgMSk7CisKKyAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX01BWF9QU1BPTExfSU5fV01NX1VBUFNEX1BTX01PREUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ0RhdGFWYWx1ZSApICE9IGVTSVJfU1VDQ0VTUykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICJGYWlsZWQgdG8gZ2V0IHZhbHVlIGZvciBXTklfQ0ZHX01BWF9QU1BPTExfSU5fV01NX1VBUFNEX1BTX01PREUiKTsKKyAgICAgIGdvdG8gaGFuZGxlX2ZhaWx1cmU7CisgICB9CisgICB0bHZTdHJ1Y3QgPSAodEhhbENmZyAqKSggKHRBTklfVTggKikgdGx2U3RydWN0CisgICAgICAgICAgICAgICAgICAgICAgICAgICArI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pOworCisgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19CVENfU1RBVElDX09QUF9XTEFOX0lETEVfV0xBTl9MRU4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ0RhdGFWYWx1ZSApICE9IGVTSVJfU1VDQ0VTUykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICJGYWlsZWQgdG8gZ2V0IHZhbHVlIGZvciBXTklfQ0ZHX0JUQ19TVEFUSUNfT1BQX1dMQU5fSURMRV9XTEFOX0xFTiIpOworICAgICAgZ290byBoYW5kbGVfZmFpbHVyZTsKKyAgIH0KKyAgIHRsdlN0cnVjdCA9ICh0SGFsQ2ZnICopKCAodEFOSV9VOCAqKSB0bHZTdHJ1Y3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc2l6ZW9mKHRIYWxDZmcpICsgdGx2U3RydWN0LT5sZW5ndGgpIDsKKworICAgLyogUVdMQU5fSEFMX0NGR19CVENfU1RBVElDX09QUF9XTEFOX0lETEVfQlRfTEVOICovCisgICB0bHZTdHJ1Y3QtPnR5cGUgPSBRV0xBTl9IQUxfQ0ZHX0JUQ19TVEFUSUNfT1BQX1dMQU5fSURMRV9CVF9MRU4gOworICAgdGx2U3RydWN0LT5sZW5ndGggPSBzaXplb2YodEFOSV9VMzIpOworICAgY29uZmlnRGF0YVZhbHVlID0gKHRBTklfVTMyICopKHRsdlN0cnVjdCArIDEpOworCisgICBpZiAod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19CVENfU1RBVElDX09QUF9XTEFOX0lETEVfQlRfTEVOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWdEYXRhVmFsdWUgKSAhPSBlU0lSX1NVQ0NFU1MpCisgICB7CisgICAgICBWT1NfVF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OworICAgY29uZmlnRGF0YVZhbHVlID0gKHRBTklfVTMyICopKHRsdlN0cnVjdCArIDEpOworICAgaWYgKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfT1BUSU1JWkVfQ0FfRVZFTlQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ0RhdGFWYWx1ZSApICE9IGVTSVJfU1VDQ0VTUykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICJGYWlsZWQgdG8gZ2V0IHZhbHVlIGZvciBXTklfQ0ZHX09QVElNSVpFX0NBX0VWRU5UIik7CisgICAgICBnb3RvIGhhbmRsZV9mYWlsdXJlOworICAgfQorICAgdGx2U3RydWN0ID0gKHRIYWxDZmcgKikoICh0QU5JX1U4ICopIHRsdlN0cnVjdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBzaXplb2YodEhhbENmZykgKyB0bHZTdHJ1Y3QtPmxlbmd0aCkgOworCisgICAvKiBRV0xBTl9IQUxfQ0ZHX1RPR0dMRV9BUlBfQkRSQVRFUyAqLworICAgdGx2U3RydWN0LT50eXBlID0gUVdMQU5fSEFMX0NGR19UT0dHTEVfQVJQX0JEUkFURVM7CisgICB0bHZTdHJ1Y3QtPmxlbmd0aCA9IHNpemVvZih0QU5JX1UzMik7CisgICBjb25maWdEYXRhVmFsdWUgPSAodEFOSV9VMzIgKikodGx2U3RydWN0ICsgMSk7CisKKyAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX1RPR0dMRV9BUlBfQkRSQVRFUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnRGF0YVZhbHVlICkgIT0gZVNJUl9TVUNDRVNTKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1d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ICAgICAgICAgICAgICAgICAgICsgc2l6ZW9mKHRIYWxDZmcpICsgdGx2U3RydWN0LT5sZW5ndGgpIDsKKworICAgd2RpU3RhcnRQYXJhbXMtPnVzQ29uZmlnQnVmZmVyTGVuID0gKHRBTklfVTggKil0bHZTdHJ1Y3QgLSB0bHZTdHJ1Y3RTdGFydCA7CisjaWZkZWYgV0xBTl9ERUJVRworICAgeworICAgICAgaW50IGk7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgIioqKioqKiBEdW1waW5nIENGRyBUTFYgKioqKiogIik7CisgICAgICBmb3IgKGk9MDsgKGkrNykgPCB3ZGlTdGFydFBhcmFtcy0+dXNDb25maWdCdWZmZXJMZW47IGkrPTgpCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAiJTAyeCAlMDJ4ICUwMnggJTAyeCAlMDJ4ICUwMnggJTAyeCAlMDJ4IiwgCisgICAgICAgICAgICAgICAgICAgIHRsdlN0cnVjdFN0YXJ0W2ldLAorICAgICAgICAgICAgICAgICAgICB0bHZTdHJ1Y3RTdGFydFtpKzFdLAorICAgICAgICAgICAgICAgICAgICB0bHZTdHJ1Y3RTdGFydFtpKzJdLAorICAgICAgICAgICAgICAgICAgICB0bHZTdHJ1Y3RTdGFydFtpKzNdLAorICAgICAgICAgICAgICAgICAgICB0bHZTdHJ1Y3RTdGFydFtpKzRdLAorICAgICAgICAgICAgICAgICAgICB0bHZTdHJ1Y3RTdGFydFtpKzVdLAorICAgICAgICAgICAgICAgICAgICB0bHZTdHJ1Y3RTdGFydFtpKzZdLAorICAgICAgICAgICAgICAgICAgICB0bHZTdHJ1Y3RTdGFydFtpKzddKTsKKyAgICAgIH0KKyAgICAgIC8qIER1bXAgdGhlI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oIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogSW52b2tlZCB3aXRoIGludmFsaWQgcFdEQSIsIF9fZnVuY19fICk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgfQorICAgaWYgKHBXREEtPndkaUZhaWxlZCA9PSB0cnVlKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAiJXM6IFdESSBpbiBmYWlsZWQgc3RhdGUiLCBfX2Z1bmNfXyApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9BTFJFQURZOworICAgfQorCisgICAvKiBGVE0gbW9kZSBzdGF5IFNUQVJUX1NUQVRFICovCisgICBpZiggKFdEQV9SRUFEWV9TVEFURSAhPSBwV0RBLT53ZGFTdGF0ZSkgJiYKKyAgICAgICAoV0RBX0lOSVRfU1RBVEUgIT0gcFdEQS0+d2RhU3RhdGUpICYmCisgICAgICAgKFdEQV9TVEFSVF9TVEFURSAhPSBwV0RBLT53ZGFTdGF0ZSkgKQorICAgeworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgIH0KKyAgIHdkaVN0b3BSZXEgPSAoV0RJX1N0b3BSZXFQYXJhbXNUeXBlICopCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9zX21lbV9tYWxsb2Moc2l6ZW9mKFdESV9TdG9wUmVxUGFyYW1zVHlwZSkpOworICAgaWYoTlVMTCA9PSB3ZGlTdG9wUmVxKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBWT1MgTUVNIEFsbG9jIEZhaWx1cmUi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lcG9vdXQiLCBfX2Z1bmNfXyk7CisgICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgfQorICAgICAgdm9zX2V2ZW50X2Rlc3Ryb3koJnBXREEtPmZ0bVN0b3BEb25lRXZlbnQpOworICAgfQorICAgcmV0dXJuIHN0YXR1czsKK30KKy8qCisgKiBGVU5DVElPTjogV0RBX2Nsb3NlCisgKiBjYWxsIFdESV9jbG9zZSBhbmQgZnJlZSB0aGUgV0RBIGNvbnRleHQKKyAqLworVk9TX1NUQVRVUyBXREFfY2xvc2Uodl9QVk9JRF90IHBWb3NDb250ZXh0KQoreworICAgVk9TX1NUQVRVUyBzdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICBXRElfU3RhdHVzIHdzdGF0dXM7CisgICBWT1NfU1RBVFVTIHZzdGF0dXM7CisgICB0V0RBX0NiQ29udGV4dCAqd2RhQ29udGV4dD0gKHRXREFfQ2JDb250ZXh0ICopVk9TX0dFVF9XREFfQ1RYVChwVm9zQ29udGV4dCk7CisgICBpZiAoTlVMTCA9PSB3ZGFDb250ZXh0KQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IEludm9rZWQgd2l0aCBpbnZhbGlkIHdkYUNvbnRleHQiLCBfX2Z1bmNfXyApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgfQorICAgaWYoKFdEQV9JTklUX1NUQVRFICE9IHdkYUNvbnRleHQtPndkYVN0YXRlKSAmJiAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXREFfU1RPUF9TVEFURSAhPSB3ZGFDb250ZXh0LT53ZGFTdGF0ZSkpCisgICB7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgfQorICAgLypjYWxsIFdESSBjbG9zZSovCisgICB3c3RhdHVzID0gV0RJX0Nsb3NlKCk7Cis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nZhbGlkIHBhcmFtZXRlciIsIF9fZnVuY19fKTsKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICB9CisgICBwV0RBID0gKHRXREFfQ2JDb250ZXh0ICopVk9TX0dFVF9XREFfQ1RYVChwdm9zR0N0eCk7CisgICBpZiAoTlVMTCA9PSBwV0RBICkKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogSW52YWxpZCBXREEgY29udGV4dCIsIF9fZnVuY19fKTsKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICB9CisgICAqcFZlcnNpb24gPSBwV0RBLT53Y25zc1dsYW5SZXBvcnRlZFZlcnNpb247CisgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOworfQorLyoKKyAqIEZVTkNUSU9OOiBXREFfR2V0V2Nuc3NTb2Z0d2FyZVZlcnNpb24KKyAqIFJldHVybnMgdGhlIFdDTlNTIFNvZnR3YXJlIHZlcnNpb24gc3RyaW5nCisgKi8gCitWT1NfU1RBVFVTIFdEQV9HZXRXY25zc1NvZnR3YXJlVmVyc2lvbih2X1BWT0lEX3QgcHZvc0dDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1U4ICpwVmVyc2lvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTMyIHZlcnNpb25CdWZmZXJTaXplKQoreworICAgdFdEQV9DYkNvbnRleHQgKnBXREEgPSBOVUxMOworICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAiJXM6IEVudGVyZWQiLCBfX2Z1b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wZW5kRGF0YVR4Q2FsbGJhY2soIHZfUFZPSURfdCAgICAgIHB2b3NHQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QqICAgICAgICB1Y1NUQUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1NfU1RBVFVTICAgICB2b3NTdGF0dXMpCit7CisgICB0V0RBX0NiQ29udGV4dCAqcFdEQSA9ICh0V0RBX0NiQ29udGV4dCAqKVZPU19HRVRfV0RBX0NUWFQocHZvc0dDdHgpOworICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgIiVzOiBFbnRlcmVkICIgLF9fZnVuY19fKTsKKyAgIGlmIChOVUxMID09IHBXREEgKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IEludm9rZWQgd2l0aCBpbnZhbGlkIFdEQSBjb250ZXh0ICIsIF9fZnVuY19fICk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgfQorICAgaWYoVk9TX0lTX1NUQVRVU19TVUNDRVNTKHZvc1N0YXR1cykpIAorICAgeworICAgICAgcFdEQS0+dHhTdGF0dXMgPSBXREFfVExfVFhfU1VTUEVORF9TVUNDRVNTOworICAgfQorICAgZWxzZQorICAgeworICAgICAgcFdEQS0+dHhTdGF0dXMgPSBXREFfVExfVFhfU1VTUEVORF9GQUlMVVJFOyAgICAgICAgCisgICB9CisgICAvKiBUcmlnZ2VyIHRoZSBldmVudCB0byBicmluZyB0aGUgV0RBIFRMIHN1c3BlbmQgZnVuY3Rpb24gdG8gY29tZSAKKyAgICAqIG91dCBvZiB3YWl0Ki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ElkeCA9IDA7CisKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICIlczogRW50ZXJlZCAiICxfX2Z1bmNfXyk7CisgICBwV0RBLT50eFN0YXR1cyA9IFdEQV9UTF9UWF9TVVNQRU5EX0ZBSUxVUkU7CisgICBpZiAocFdEQS0+dHhTdXNwZW5kVGltZWRPdXQpIAorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgIlRMIHN1c3BlbmQgdGltZWRvdXQgcHJldmlvdXNseSwgQ0Igbm90IGNhbGxlZCB5ZXQiKTsKKyAgICAgICAgcmV0dXJuIHN0YXR1czsKKyAgIH0KKyAgIC8qIFJlc2V0IHRoZSBldmVudCB0byBiZSBub3Qgc2lnbmFsbGVkICovCisgICBzdGF0dXMgPSB2b3NfZXZlbnRfcmVzZXQoJnBXREEtPnN1c3BlbmREYXRhVHhFdmVudCk7CisgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJWT1MgRXZlbnQgcmVzZXQgZmFpbGVkIC0gc3RhdHVzID0gJWQiLHN0YXR1cyk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICB9CisgICAvKkluZGljYXRlIFRMIHRvIHN1c3BlbmQgdHJhbnNtaXNzaW9uIGZvciBhbGwgU3RhIElkICovCisgICBzdGF0dXMgPSBXTEFOVExfU3VzcGVuZERhdGFUeChwV0RBLT5wVm9zQ29udGV4dCwgTlVMTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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9DYkNvbnRleHQgKnBXREE7IAorICAgdEluaXRTY2FuUGFyYW1zICpwV0RBX1NjYW5QYXJhbSA7CisgICBWT1NfU1RBVFVTICAgICAgc3RhdHVzOyAgICAgIAorICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiPC0tLS0tLSAlcyAiICxfX2Z1bmNfXyk7CisgICBpZihOVUxMID09IHBXZGFQYXJhbXMpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogcFdkYVBhcmFtcyByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKSA7CisgICAgICByZXR1cm4gOworICAgfQorICAgcFdEQSA9ICh0V0RBX0NiQ29udGV4dCAqKXBXZGFQYXJhbXMtPnBXZGFDb250ZXh0OworICAgcFdEQV9TY2FuUGFyYW0gPSAodEluaXRTY2FuUGFyYW1zICopcFdkYVBhcmFtcy0+d2RhTXNnUGFyYW07CisgICBpZihOVUxMID09IHBXREFfU2NhblBhcmFtKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBwV0RBX1NjYW5QYXJhbSByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zLT53ZGFXZGlBcGlNc2dQYXJhbSk7CisgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcyk7CisgICAgICByZXR1cm4gOworICAgfQorICAgaWYoV0RJX1NUQVRVU19TVUNDRVNTICE9IHdka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AgICAgICAgICAgICAgICAgICAgICAgICAgICB0SW5pdFNjYW5QYXJhbXMgKmluaXRTY2FuUGFyYW1zKQoreworICAgV0RJX1N0YXR1cyBzdGF0dXMgPSBXRElfU1RBVFVTX1NVQ0NFU1MgOworICAgV0RJX0luaXRTY2FuUmVxUGFyYW1zVHlwZSAqd2RpSW5pdFNjYW5QYXJhbSA9IAorICAgICAgICAgICAgICAgICAgKFdESV9Jbml0U2NhblJlcVBhcmFtc1R5cGUgKil2b3NfbWVtX21hbGxvYygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKFdESV9Jbml0U2NhblJlcVBhcmFtc1R5cGUpKSA7CisgICB0V0RBX1JlcVBhcmFtcyAqcFdkYVBhcmFtczsKKyAgIHRBTklfVTggaSA9IDA7CisgICAKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIi0tLS0tLT4gJXMgIiAsX19mdW5jX18pOworICAgaWYoTlVMTCA9PSB3ZGlJbml0U2NhblBhcmFtKSAKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczpWT1MgTUVNIEFsbG9jIEZhaWx1cmUiLCBfX2Z1bmNfXyk7IAorICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfTk9NRU07CisgICB9CisgICBwV2RhUGFyYW1zID0gKHRXREFfUmVxUGFyYW1zICopdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRXREFfUmVxUGFyYW1zKSkgOworICAgaWYoTlVMTCA9PSBwV2RhUGFyYW1zKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgV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KndkaUVuZFNjYW5QYXJhbXMgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXRElfRW5kU2NhblJlcVBhcmFtc1R5cGUgKil2b3NfbWVtX21hbGxvYygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihXRElfRW5kU2NhblJlcVBhcmFtc1R5cGUpKSA7CisgICB0V0RBX1JlcVBhcmFtcyAqcFdkYVBhcmFtcyA7CisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICItLS0tLS0+ICVzICIgLF9fZnVuY19fKTsKKyAgIGlmKE5VTEwgPT0gd2RpRW5kU2NhblBhcmFtcykgCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsgCisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9OT01FTTsKKyAgIH0KKyAgIHBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKil2b3NfbWVtX21hbGxvYyhzaXplb2YodFdEQV9SZXFQYXJhbXMpKSA7CisgICBpZihOVUxMID09IHBXZGFQYXJhbXMpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsgCisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgdm9zX21lbV9mcmVlKHdkaUVuZFNjYW5QYXJhbX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ZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXMgZXJyb3IgaW4gUmVzdW1lIFR4ICIsIF9fZnVuY19fICk7CisgICB9CisgICBmaW5pc2hTY2FuUGFyYW0tPnN0YXR1cyA9IHdkaVN0YXR1cyA7CisgICBXREFfU2VuZE1zZyhwV0RBLCBXREFfRklOSVNIX1NDQU5fUlNQLCAodm9pZCAqKWZpbmlzaFNjYW5QYXJhbSwgMCkgOworICAgcmV0dXJuIDsKK30KKy8qCisgKiBGVU5DVElPTjogV0RBX1Byb2Nlc3NGaW5zaFNjYW5SZXEKKyAqIFRyaWdnZXIgRmluaXNoIFNDQU4gaW4gV0RJCisgKi8gCitWT1NfU1RBVFVTICBXREFfUHJvY2Vzc0ZpbmlzaFNjYW5SZXEodFdEQV9DYkNvbnRleHQgKnBXREEsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRGaW5pc2hTY2FuUGFyYW1zICpmaW5pc2hTY2FuUGFyYW1zKQoreworICAgV0RJX1N0YXR1cyBzdGF0dXMgPSBXRElfU1RBVFVTX1NVQ0NFU1M7CisgICBXRElfRmluaXNoU2NhblJlcVBhcmFtc1R5cGUgKndkaUZpbmlzaFNjYW5QYXJhbXMgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXRElfRmluaXNoU2NhblJlcVBhcmFtc1R5cGUgKil2b3NfbWVtX21hbGxvYygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoV0RJX0ZpbmlzaFNjYW5SZXFQYXJhbXNUeXBlKSkgOworICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgOworICAgdEFOSV9VOCBpID0gMDsKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIi0tLS0tLT4gJXMgIiAsX19mdW5jX18pOworICAgaWYoTlVMTCA9PSB3ZGlGaW5pc2hTY2FuUGFyYW1zKSAKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogVk9TIE1FTSBBbGxvYyBGYWlsdXJlIiwgX19mdW5jX18pOyAKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX05PTUVNOworICAgfQorICAgcFdkYVBhcmFtcyA9ICh0V0RBX1JlcVBhcmFtcyAqKXZvc19tZW1fbWFsbG9jKHNpemVvZih0V0RBX1JlcVBhcmFtcykpIDsKKyAgIGlmKE5VTEwgPT0gcFdkYVBhcmFtcykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogVk9TIE1FTSBBbGxvYyBGYWlsdXJlIiwgX19mdW5jX18pOyAKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICB2b3NfbWVtX2ZyZWUod2RpRmluaXNoU2NhblBhcmFtcyk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX05PTUVNOworICAgfQorICAgLyogQ29weSBpbml0IFNjYW4gcGFyYW1zIHRvIFdESSBzdHJ1Y3R1cmUgKi8KKyAgIHdkaUZpbmlzaFNjYW5QYXJhbXMtPndkaVJlcUluZm8ud2RpU2Nhbk1vZGUgPSBmaW5pc2hTY2FuUGFyYW1zLT5zY2FuTW9kZSA7CisgICB2b3NfbWVtX2NvcHkod2RpRmluaXNoU2NhblBhcmFtcy0+d2RpUmVxSW5mby5tYWNCU1NJRCwgCisgICAgICAgICAgIC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Zm8ud2RpU2NhbkVudHJ5LmJzc0lkeFtpXSA9IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmlzaFNjYW5QYXJhbXMtPnNjYW5FbnRyeS5ic3NJZHhbaV0gOworICAgfQorICAgCisgCisgICAvKiBpZiBGcmFtZSBsZW5ndGgsIGNvcHkgbWFjTWdtdEhkciBybyBXREkgc3RydWN0dXJlICovIAorICAgaWYoMCAhPSB3ZGlGaW5pc2hTY2FuUGFyYW1zLT53ZGlSZXFJbmZvLnVjRnJhbWVMZW5ndGgpCisgICB7CisgICAgICB2b3NfbWVtX2NvcHkoJndkaUZpbmlzaFNjYW5QYXJhbXMtPndkaVJlcUluZm8ud2RpTUFDTWdtdEhkciwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZmluaXNoU2NhblBhcmFtcy0+bWFjTWdtdEhkciwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihXRElfTWFjTWdtdEhkcikpIDsKKyAgIH0gCisgICB3ZGlGaW5pc2hTY2FuUGFyYW1zLT53ZGlSZXFTdGF0dXNDQiA9IE5VTEwgOworICAgLyogU3RvcmUgSW5pdCBSZXEgcG9pbnRlciwgYXMgdGhpcyB3aWxsIGJlIHVzZWQgZm9yIHJlc3BvbnNlICovCisgICAvKiBzdG9yZSBQYXJhbXMgcGFzcyBpdCB0byBXREkgKi8KKyAgIHBXZGFQYXJhbXMtPnBXZGFDb250ZXh0ID0gcFdEQTsKKyAgIHBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtID0gZmluaXNoU2NhblBhcmFtczsKKyAgIHBXZGFQYXJhbXMtPndkYVdkaUFwaU1zZ1BhcmFtID0gd2RpRmluaXNoU2NhblBhcmFtczsKKyAgIC8qIGNhbGwgREFMIEFQSSB0byBwYXNzIGluaXQgc2NhbiByZXF1ZXN0IHRvIERBTCAqLworICAgc3RhdHVzID0gV0R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lnZ2VyIEluaXQgU0NBTiBjYWxsYmFjaworICovIAordm9pZCBXREFfSm9pblJzcENhbGxiYWNrKFdESV9TdGF0dXMgc3RhdHVzLCB2b2lkKiBwVXNlckRhdGEpCit7CisgICB0V0RBX1JlcVBhcmFtcyAqcFdkYVBhcmFtcyA9ICh0V0RBX1JlcVBhcmFtcyAqKXBVc2VyRGF0YTsgCisgICB0V0RBX0NiQ29udGV4dCAqcFdEQTsgCisgICB0U3dpdGNoQ2hhbm5lbFBhcmFtcyAqam9pblJlcVBhcmFtOworICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiPC0tLS0tLSAlcyAiICxfX2Z1bmNfXyk7CisgICBpZihOVUxMID09IHBXZGFQYXJhbXMpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICIlczogcFdkYVBhcmFtcyByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKSA7CisgICAgICByZXR1cm4gOworICAgfQorICAgcFdEQSA9ICh0V0RBX0NiQ29udGV4dCAqKXBXZGFQYXJhbXMtPnBXZGFDb250ZXh0OworICAgam9pblJlcVBhcmFtID0gKHRTd2l0Y2hDaGFubmVsUGFyYW1zICopcFdkYVBhcmFtcy0+d2RhTXNnUGFyYW07CisgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcy0+d2RhV2RpQXBpTXNnUGFyYW0pIDsKKyAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zKSA7CisgICAvKiByZXNldCBtYWNCU1NJRCAqLworICAgdm9zX21lbV9zZXQocFdEQS0+bWFjQlNTSUQsIHNpemVvZihwV0RBLT5tYWNCU1NJRCksMCApOworICAgLyogcmVzZXQg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ICAgICAgICAgICAgICAgdFN3aXRjaENoYW5uZWxQYXJhbXMqIGpvaW5SZXFQYXJhbSkKK3sKKyAgIFdESV9TdGF0dXMgc3RhdHVzID0gV0RJX1NUQVRVU19TVUNDRVNTIDsKKyAgIFdESV9Kb2luUmVxUGFyYW1zVHlwZSAqd2RpSm9pblJlcVBhcmFtID0gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXRElfSm9pblJlcVBhcmFtc1R5cGUgKil2b3NfbWVtX21hbGxvYygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKFdESV9Kb2luUmVxUGFyYW1zVHlwZSkpIDsKKyAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zIDsKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIi0tLS0tLT4gJXMgIiAsX19mdW5jX18pOworICAgaWYoTlVMTCA9PSB3ZGlKb2luUmVxUGFyYW0pIAorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBWT1MgTUVNIEFsbG9jIEZhaWx1cmUiLCBfX2Z1bmNfXyk7IAorICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHZvc19tZW1fZnJlZShqb2luUmVxUGFyYW0pOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9OT01FTTsKKyAgIH0KKyAgIHBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKil2b3NfbWVtX21hbGxvYyhzaXplb2YodFdEQV9SZXFQYXJhbXMpKSA7CisgICBpZihOVUxMID09IHBXZGFQYXJhbXMpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0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lKHBXZGFQYXJhbXMpOworICAgICAgam9pblJlcVBhcmFtLT5zdGF0dXMgPSBlU0lSX0ZBSUxVUkUgOworICAgICAgV0RBX1NlbmRNc2cocFdEQSwgV0RBX1NXSVRDSF9DSEFOTkVMX1JTUCwgKHZvaWQgKilqb2luUmVxUGFyYW0sIDApIDsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfSU5WQUw7CisgICB9CisKKyAgIC8qIGNvcHkgdGhlIEJTU0lEIGZvciBwV0RBICovCisgICB2b3NfbWVtX2NvcHkod2RpSm9pblJlcVBhcmFtLT53ZGlSZXFJbmZvLm1hY0JTU0lELCBwV0RBLT5tYWNCU1NJRCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKSA7CisgICB2b3NfbWVtX2NvcHkod2RpSm9pblJlcVBhcmFtLT53ZGlSZXFJbmZvLm1hY1NUQVNlbGYsIAorICAgICAgICAgICAgICAgIHBXREEtPm1hY1NUQVNlbGYsIHNpemVvZih0U2lyTWFjQWRkcikpIDsKKyAgIHdkaUpvaW5SZXFQYXJhbS0+d2RpUmVxSW5mby53ZGlDaGFubmVsSW5mby51Y0NoYW5uZWwgPSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2luUmVxUGFyYW0tPmNoYW5uZWxOdW1iZXIgOworI2lmZGVmIFdMQU5fRkVBVFVSRV9WT1dJRkkKKyAgIHdkaUpvaW5SZXFQYXJhbS0+d2RpUmVxSW5mby53ZGlDaGFubmVsSW5mby5jTWF4VHhQb3dlciA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2luUmVxUGFyYW0tPm1heFR4UG93ZXIgOworI2Vsc2UKKyAgIHdkaUpvaW5SZXFQYXJhbS0+d2RpUmVxSW5mby53ZGlDaGFubmVsSW5mby51Y0xvY2FsUG93ZXJDb25zdHJhaW50ID0gCisgIC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tcy4KKyAqLyAKK1ZPU19TVEFUVVMgV0RBX1Byb2Nlc3NDaGFubmVsU3dpdGNoUmVxKHRXREFfQ2JDb250ZXh0ICpwV0RBLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTd2l0Y2hDaGFubmVsUGFyYW1zICpwU3dpdGNoQ2hhblBhcmFtcykKK3sKKyAgIFdESV9TdGF0dXMgc3RhdHVzID0gV0RJX1NUQVRVU19TVUNDRVNTIDsKKyAgIFdESV9Td2l0Y2hDaFJlcVBhcmFtc1R5cGUgKndkaVN3aXRjaENoYW5QYXJhbSA9IAorICAgICAgICAgICAgICAgICAgICAgICAgIChXRElfU3dpdGNoQ2hSZXFQYXJhbXNUeXBlICopdm9zX21lbV9tYWxsb2MoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihXRElfU3dpdGNoQ2hSZXFQYXJhbXNUeXBlKSkgOworICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgOworICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiLS0tLS0tPiAlcyAiICxfX2Z1bmNfXyk7CisgICBpZihOVUxMID09IHdkaVN3aXRjaENoYW5QYXJhbSkgCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsgCisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9OT01FTTsKKyAgIH0KKyAgIHBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKil2b3NfbWVtX21hbGxvYyhzaX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dEQV9DYkNvbnRleHQgKnBXREE7IAorICAgdEFkZEJzc1BhcmFtcyAqY29uZmlnQnNzUmVxUGFyYW07CisgICB0QWRkU3RhUGFyYW1zICpzdGFDb25maWdCc3NQYXJhbTsKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIjwtLS0tLS0gJXMgIiAsX19mdW5jX18pOworICAgaWYoTlVMTCA9PSBwV2RhUGFyYW1zKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgIiVzOiBwV2RhUGFyYW1zIHJlY2VpdmVkIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICBWT1NfQVNTRVJUKDApIDsKKyAgICAgIHJldHVybiA7CisgICB9CisgICBwV0RBID0gKHRXREFfQ2JDb250ZXh0ICopcFdkYVBhcmFtcy0+cFdkYUNvbnRleHQ7CisgICBjb25maWdCc3NSZXFQYXJhbSA9ICh0QWRkQnNzUGFyYW1zICopcFdkYVBhcmFtcy0+d2RhTXNnUGFyYW07CisgICBzdGFDb25maWdCc3NQYXJhbSA9ICZjb25maWdCc3NSZXFQYXJhbS0+c3RhQ29udGV4dCA7CisgICBjb25maWdCc3NSZXFQYXJhbS0+c3RhdHVzID0gCisgICAgICAgICAgICAgICAgICAgICB3ZGlDb25maWdCc3NSc3AtPndkaVN0YXR1czsKKyAgIGlmKFdESV9TVEFUVVNfU1VDQ0VTUyA9PSB3ZGlDb25maWdCc3NSc3AtPndkaVN0YXR1cykKKyAgIHsKKyAgICAgIHZvc19tZW1fY29weShjb25maWdCc3NSZXFQYXJhbS0+YnNzSWQsIHdkaUNvbmZpZ0Jzc1JzcC0+bWFjQlNTSUQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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Db25maWdCc3NSc3AtPnVjQmNhc3RTaWc7CisgICAgICB2b3NfbWVtX2NvcHkoc3RhQ29uZmlnQnNzUGFyYW0tPnN0YU1hYywgd2RpQ29uZmlnQnNzUnNwLT5tYWNTVEEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICBzdGFDb25maWdCc3NQYXJhbS0+dHhDaGFubmVsV2lkdGhTZXQgPSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWdCc3NSZXFQYXJhbS0+dHhDaGFubmVsV2lkdGhTZXQ7CisgICAgICBpZihzdGFDb25maWdCc3NQYXJhbS0+c3RhVHlwZSA9PSBTVEFfRU5UUllfUEVFUiAmJiAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YUNvbmZpZ0Jzc1BhcmFtLT5odENhcGFibGUpCisgICAgICB7CisgICAgICAgICBwV0RBLT53ZGFTdGFJbmZvW3N0YUNvbmZpZ0Jzc1BhcmFtLT5zdGFJZHhdLmJzc0lkeCA9IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkaUNvbmZpZ0Jzc1JzcC0+dWNCU1NJZHg7CisgICAgICAgICBwV0RBLT53ZGFTdGFJbmZvW3N0YUNvbmZpZ0Jzc1BhcmFtLT5zdGFJZHhdLnVjVmFsaWRTdGFJbmRleCA9IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0RBX1ZBTElEX1NUQV9JTkRFWCA7CisgICAgICAgICBwV0RBLT53ZGFTdGFJbmZvW3N0YUNvbmZpZ0Jzc1BhcmFtLT5zdGFJZHhdLmN1cnJlbnRPcGVyQ2hhbiA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnQnNzUmVxUGFyYW0tPmN1cnJ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Sk7CisgICAgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcykgOworICAgICAgICAgV0RBX1NlbmRNc2cocFdEQSwgV0RBX0FERF9CU1NfUlNQLCAodm9pZCAqKWFkZEJzc1BhcmFtcyAsIDApOworICAgfQorCisgICByZXR1cm4gOworfQorCisvKgorICogRlVOQ1RJT046IFdEQV9Qcm9jZXNzQ29uZmlnQnNzUmVxCisgKiBDb25maWd1cmUgQlNTIGJlZm9yZSBzdGFydGluZyBBc3NvYyB3aXRoIEFQCisgKi8gCitWT1NfU1RBVFVTIFdEQV9Qcm9jZXNzQ29uZmlnQnNzUmVxKHRXREFfQ2JDb250ZXh0ICpwV0RBLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFkZEJzc1BhcmFtcyogY29uZmlnQnNzUmVxUGFyYW0pCit7CisgICBXRElfU3RhdHVzIHN0YXR1cyA9IFdESV9TVEFUVVNfU1VDQ0VTUyA7CisgICBXRElfQ29uZmlnQlNTUmVxUGFyYW1zVHlwZSAqd2RpQ29uZmlnQnNzUmVxUGFyYW07CisgICB0V0RBX1JlcVBhcmFtcyAqcFdkYVBhcmFtcyA7CisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICItLS0tLS0+ICVzICIgLF9fZnVuY19fKTsKKyAgIGlmIChOVUxMID09IGNvbmZpZ0Jzc1JlcVBhcmFtKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBjb25maWdCc3NSZXFQYXJhbSBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9JTlZBTDsKKyAgIH0KKworICAgd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QorICAgICAgaWYoV0RJX0RTX0FkZFNUQU1lbVBvb2wocFdEQS0+cFdkaUNvbnRleHQsIHdkaUNvbmZpZ1N0YVJzcC0+dWNTVEFJZHgpKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAiJXM6IGFkZCBTVEEgaW50byBtZW1wb29sIGZhaWwiLCBfX2Z1bmNfXyk7CisgICAgICAgICBWT1NfQVNTRVJUKDApIDsKKyAgICAgICAgIHJldHVybiA7CisgICAgICB9CisgICB9CisgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcy0+d2RhV2RpQXBpTXNnUGFyYW0pIDsKKyAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zKSA7CisgICBXREFfU2VuZE1zZyhwV0RBLCBXREFfQUREX1NUQV9SU1AsICh2b2lkICopYWRkU3RhUmVxUGFyYW0sIDApIDsKKyAgIHJldHVybiA7Cit9Cit2b2lkIFdEQV9BZGRTdGFSZXFDYWxsYmFjayhXRElfU3RhdHVzICAgd2RpU3RhdHVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkKiAgICAgICAgcFVzZXJEYXRhKQoreworICAgdFdEQV9SZXFQYXJhbXMgICAgICAgICpwV2RhUGFyYW1zID0gKHRXREFfUmVxUGFyYW1zICopcFVzZXJEYXRhOworICAgdFdEQV9DYkNvbnRleHQgICAgICAgICpwV0RBOworICAgdEFkZFN0YVBhcmFtcyAgICAgICAgICphZGRTdGFQYXJhbXM7CisKKyAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgIjwtLS0tLS0gJXMsIHdkaVN0YXR1czogJWQiLAorICAgICAgICAgICAgICBfX2Z1bmNfXywgd2RpU3RhdHVzKTsKKworICAgaWYgKE5VTEwgPT0gcF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gIFdESV9Db25maWdTVEFSZXFQYXJhbXNUeXBlICp3ZGlDb25maWdTdGFSZXFQYXJhbSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAoV0RJX0NvbmZpZ1NUQVJlcVBhcmFtc1R5cGUgKil2b3NfbWVtX21hbGxvYygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKFdESV9Db25maWdTVEFSZXFQYXJhbXNUeXBlKSkgOworICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgOworICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiLS0tLS0tPiAlcyAiICxfX2Z1bmNfXyk7CisgICBpZihOVUxMID09IHdkaUNvbmZpZ1N0YVJlcVBhcmFtKSAKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogVk9TIE1FTSBBbGxvYyBGYWlsdXJlIiwgX19mdW5jX18pOyAKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX05PTUVNOworICAgfQorICAgcFdkYVBhcmFtcyA9ICh0V0RBX1JlcVBhcmFtcyAqKXZvc19tZW1fbWFsbG9jKHNpemVvZih0V0RBX1JlcVBhcmFtcykpIDsKKyAgIGlmKE5VTEwgPT0gcFdkYVBhcmFtcykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogVk9TIE1FTSBBbGxvYyBGYWlsdXJlIiwgX19mdW5jX18pOyAKKyAgICAgIFZPU19BU1NFUlQoMCk7C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01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIjwtLS0tLS0gJXMgIiAsX19mdW5jX18pOworICAgaWYoTlVMTCA9PSBwV2RhUGFyYW1zKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgIiVzOiBwV2RhUGFyYW1zIHJlY2VpdmVkIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICBWT1NfQVNTRVJUKDApIDsKKyAgICAgIHJldHVybiA7CisgICB9CisgICBwV0RBID0gKHRXREFfQ2JDb250ZXh0ICopcFdkYVBhcmFtcy0+cFdkYUNvbnRleHQ7CisgICBkZWxCc3NSZXFQYXJhbSA9ICh0RGVsZXRlQnNzUGFyYW1zICopcFdkYVBhcmFtcy0+d2RhTXNnUGFyYW07CisgICBkZWxCc3NSZXFQYXJhbS0+c3RhdHVzID0gd2RpRGVsQnNzUnNwLT53ZGlTdGF0dXMgOworICAgaWYoV0RJX1NUQVRVU19TVUNDRVNTID09IHdkaURlbEJzc1JzcC0+d2RpU3RhdHVzKQorICAgeworICAgICAgdm9zX21lbV9jb3B5KGRlbEJzc1JlcVBhcmFtLT5ic3NpZCwgd2RpRGVsQnNzUnNwLT5tYWNCU1NJRCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKSA7CisgICB9CisgICBpZihXRElfRFNfR2V0U3RhSWR4RnJvbUJzc0lkeChwV0RBLT5wV2RpQ29udGV4dCwgZGVsQnNzUmVxUGFyYW0tPmJzc0lkeCwgJnN0YUlkeCkpCisgICB7CisgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiV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X0NiQ29udGV4dCAqcFdEQSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERlbGV0ZUJzc1BhcmFtcyAqZGVsQnNzUGFyYW0pCit7CisgICBXRElfU3RhdHVzIHN0YXR1cyA9IFdESV9TVEFUVVNfU1VDQ0VTUyA7CisgICBXRElfRGVsQlNTUmVxUGFyYW1zVHlwZSAqd2RpRGVsQnNzUmVxUGFyYW0gPSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFdESV9EZWxCU1NSZXFQYXJhbXNUeXBlICopdm9zX21lbV9tYWxsb2MoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihXRElfRGVsQlNTUmVxUGFyYW1zVHlwZSkpIDsKKyAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zIDsKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIi0tLS0tLT4gJXMgIiAsX19mdW5jX18pOworICAgaWYoTlVMTCA9PSB3ZGlEZWxCc3NSZXFQYXJhbSkgCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX05PTUVNOworICAgfQorICAgcFdkYVBhcmFtcyA9ICh0V0RBX1JlcVBhcmFtcyAqKXZvc19tZW1fbWFsbG9jKHNpemVvZih0V0RBX1JlcVBhcmFtcykpIDsKKyAgIGlmKE5VTEwgPT0gcFdkYVBhcmFtcykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01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R1cyBzdGF0dXMgPSBXRElfU1RBVFVTX1NVQ0NFU1MgOworICAgV0RJX0RlbFNUQVJlcVBhcmFtc1R5cGUgKndkaURlbFN0YVJlcVBhcmFtID0gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXRElfRGVsU1RBUmVxUGFyYW1zVHlwZSAqKXZvc19tZW1fbWFsbG9jKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoV0RJX0RlbFNUQVJlcVBhcmFtc1R5cGUpKSA7CisgICB0V0RBX1JlcVBhcmFtcyAqcFdkYVBhcmFtcyA7CisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICItLS0tLS0+ICVzICIgLF9fZnVuY19fKTsKKyAgIGlmKE5VTEwgPT0gd2RpRGVsU3RhUmVxUGFyYW0pIAorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBWT1MgTUVNIEFsbG9jIEZhaWx1cmUiLCBfX2Z1bmNfXyk7IAorICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfTk9NRU07CisgICB9CisgICBwV2RhUGFyYW1zID0gKHRXREFfUmVxUGFyYW1zICopdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRXREFfUmVxUGFyYW1zKSkgOworICAgaWYoTlVMTCA9PSBwV2RhUGFyYW1zKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBWT1MgTUVNIEFsbG9jIEZhaWx1cmUiLCBfX2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kaUFkZFN0YVNlbGZTdGFGYWlsQ291bnRlcisrOworICAgfQorICAgV0RBX1NlbmRNc2coIHBXREEsIFdEQV9BRERfU1RBX1NFTEZfUlNQLCAodm9pZCAqKXBBZGRTdGFTZWxmUnNwLCAwKSA7CisgICByZXR1cm4gOworfQordm9pZCBXREFfUHJvY2Vzc0FkZFN0YVNlbGZSZXFDYWxsYmFjayhXRElfU3RhdHVzICAgd2RpU3RhdHVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkKiAgICAgICAgcFVzZXJEYXRhKQoreworICAgdFdEQV9SZXFQYXJhbXMgICAgICAgICpwV2RhUGFyYW1zID0gKHRXREFfUmVxUGFyYW1zICopcFVzZXJEYXRhOworICAgdFdEQV9DYkNvbnRleHQgICAgICAgICpwV0RBOworICAgdEFkZFN0YVNlbGZQYXJhbXMgICAgICphZGRTdGFTZWxmUGFyYW1zOworCisgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICI8LS0tLS0tICVzLCB3ZGlTdGF0dXM6ICVkIiwKKyAgICAgICAgICAgICAgX19mdW5jX18sIHdkaVN0YXR1cyk7CisKKyAgIGlmIChOVUxMID09IHBXZGFQYXJhbXMpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICIlczogSW52YWxpZCBwV2RhUGFyYW1zIHBvaW50ZXIiLCBfX2Z1bmNfXyk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuOworICAgfQorCisgICBwV0RBID0gKHRXREFfQ2JDb250ZXh0ICopcFdkYVBhcmFtcy0+cFdkYUNvbnRleHQ7CisgICBhZGRTdGFTZWxmUGFyYW1zID0gKHRBZGRTdGFTZWxmUGFyYW1zICopcFdkYVBhcmFtcy0+d2RhTXNnUGFyYW07C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9pZCAqKXBBZGRTdGFTZWxmUmVxLCAwKSA7CisgICB9CisgICByZXR1cm4gc3RhdHVzOworfQorLyoKKyAqIEZVTkNUSU9OOiBXREFfRGVsU1RBU2VsZlJlc3BDYWxsYmFjaworICogCisgKi8gCit2b2lkIFdEQV9EZWxTVEFTZWxmUmVzcENhbGxiYWNrKFdESV9EZWxTVEFTZWxmUnNwUGFyYW1zVHlwZSAqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkaURlbFN0YVNlbGZSc3BQYXJhbXMgLCB2b2lkKiBwVXNlckRhdGEpCit7CisgICB0V0RBX1JlcVBhcmFtcyAgICAgICAgKnBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKilwVXNlckRhdGE7IAorICAgdFdEQV9DYkNvbnRleHQgICAgICAgICpwV0RBOyAKKyAgIHREZWxTdGFTZWxmUGFyYW1zICAgICAqZGVsU3RhU2VsZlBhcmFtczsKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIjwtLS0tLS0gJXMgIiAsX19mdW5jX18pOworICAgaWYgKE5VTEwgPT0gcFdkYVBhcmFtcykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIHBXZGFQYXJhbXMgcG9pbnRlciIsIF9fZnVuY19fKTsKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICByZXR1cm47CisgICB9CisgICBwV0RBID0gKHRXREFfQ2JDb250ZXh0ICopcFdkYVBhcmFtcy0+cFdkYUNvbnRleHQ7CisgICBkZWxTdGFTZWxmUGFyYW1zID0gKHREZWxTdGFTZWxmUGFyYW1zICopcFdkYVBhcmFtcy0+d2RhTXNnUGFyYW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hdHVzOworICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgPSBOVUxMOyAKKyAgIFdESV9EZWxTVEFTZWxmUmVxUGFyYW1zVHlwZSAqd2RpRGVsU3RhU2VsZlJlcSA9IAorICAgICAgICAgICAgICAgIChXRElfRGVsU1RBU2VsZlJlcVBhcmFtc1R5cGUgKil2b3NfbWVtX21hbGxvYygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihXRElfRGVsU1RBU2VsZlJlcVBhcmFtc1R5cGUpKSA7CisKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIi0tLS0tLT4gJXMgIiAsX19mdW5jX18pOworICAgaWYoIE5VTEwgPT0gd2RpRGVsU3RhU2VsZlJlcSApCisgICB7CisgICAgICBWT1NfQVNTRVJUKCAwICk7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFVuYWJsZSB0byBhbGxvY2F0ZSBtZW1vcnkgIiAsX19mdW5jX18pOworICAgICAgcmV0dXJuKCBWT1NfU1RBVFVTX0VfTk9NRU0gKTsKKyAgIH0KKyAgIAorICAgcFdkYVBhcmFtcyA9ICh0V0RBX1JlcVBhcmFtcyAqKXZvc19tZW1fbWFsbG9jKHNpemVvZih0V0RBX1JlcVBhcmFtcykpIDsKKyAgIGlmKCBOVUxMID09IHBXZGFQYXJhbXMgKQorICAgeworICAgICAgVk9TX0FTU0VSVCggMCApOworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogVW5hYm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GFyYW0udWNOdW1LZXlzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ZGlCc3NQYXJhbXMtPndkaUV4dFNldEtleVBhcmFtLndkaUtleSApOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgZm9yKCBrZXlJbmRleD0wOyBrZXlJbmRleCA8IFNJUl9NQUNfTUFYX05VTV9PRl9ERUZBVUxUX0tFWVM7IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5SW5kZXgrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHdkaUJzc1BhcmFtcy0+d2RpRXh0U2V0S2V5UGFyYW0ud2RpS2V5W2tleUluZGV4XS5rZXlJZCA9CisgICAgICAgICAgICAgICAgICB3ZGFCc3NQYXJhbXMtPmV4dFNldFN0YUtleVBhcmFtLmtleVtrZXlJbmRleF0ua2V5SWQ7CisgICAgICAgICAgICAgICB3ZGlCc3NQYXJhbXMtPndkaUV4dFNldEtleVBhcmFtLndkaUtleVtrZXlJbmRleF0udW5pY2FzdCA9CisgICAgICAgICAgICAgICAgICB3ZGFCc3NQYXJhbXMtPmV4dFNldFN0YUtleVBhcmFtLmtleVtrZXlJbmRleF0udW5pY2FzdDsKKyAgICAgICAgICAgICAgIHdkaUJzc1BhcmFtcy0+d2RpRXh0U2V0S2V5UGFyYW0ud2RpS2V5W2tleUluZGV4XS5rZXlEaXJlY3Rpb24gPQorICAgICAgICAgICAgICAgICAgd2RhQnNzUGFyYW1zLT5leHRTZXRTdGFLZXlQYXJhbS5rZXlba2V5SW5kZXhdLmtleURpcmVjdGlvbjsKKworICAgICAgICAgICAgICAgaWYoV0RBX2dldEhvc3RXbGFuRmVhdENhcHMoRElTQSkgJiYgV0RBX2dldEZ3V2xhbkZlYXRDYXBzKERJU0EpKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IFdMQU5fTUFYX0tFWV9SU0NfTEVOOyBpICsrKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB3ZGlCc3NQYXJhbXMtPndkaUV4dFNldEtleVBhcmFtLndkaUtleVtrZXlJbmRleF0ua2V5UnNjW2ldID0KKyAgICAgICAgICAgICAgICAgICAgIH4od2RhQnNzUGFyYW1zLT5leHRTZXRTdGFLZXlQYXJhbS5rZXlba2V5SW5kZXhdLmtleVJzY1tpXSk7CisgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBTSVJfTUFDX01BWF9LRVlfTEVOR1RIOyBpKyspCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgd2RpQnNzUGFyYW1zLT53ZGlFeHRTZXRLZXlQYXJhbS53ZGlLZXlba2V5SW5kZXhdLmtleVtpXSA9CisgICAgICAgICAgICAgICAgICAgICAgICB+KHdkYUJzc1BhcmFtcy0+ZXh0U2V0U3RhS2V5UGFyYW0ua2V5W2tleUluZGV4XS5rZXlbaV0pOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgRkwoIiVzOiBOZWdhdGVkIEtleXMiKSwgX19mdW5jX18pOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICBGTCgiJXM6IE5vIGNoYW5nZSBpbiBLZXlzICIpLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KAorICAgICAgICAgICAgICAgICAgICAgICB3ZGlCc3NQYXJhbXMtPndkaUV4dFNldEtleVBhcmFtLndkaUtleVtrZXlJbmRleF0ua2V5UnNjLAorICAgICAgICAgICAgICAgICAgICAgICB3ZGFCc3NQYXJhbXMtPmV4dFNldFN0YUtleVBhcmFtLmtleVtrZXlJbmRleF0ua2V5UnNjLAorICAgICAgICAgICAgICAgICAgICAgICBXTEFOX01BWF9LRVlfUlNDX0xFTik7CisgICAgICAgICAgICAgICAgICAgdm9zX21lbV9jb3B5KAorICAgICAgICAgICAgICAgICAgICAgICB3ZGlCc3NQYXJhbXMtPndkaUV4dFNldEtleVBhcmFtLndkaUtleVtrZXlJbmRleF0ua2V5LAorICAgICAgICAgICAgICAgICAgICAgICB3ZGFCc3NQYXJhbXMtPmV4dFNldFN0YUtleVBhcmFtLmtleVtrZXlJbmRleF0ua2V5LAorICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX01BWF9LRVlfTEVOR1RIKTsKKyAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgd2RpQnNzUGFyYW1zLT53ZGlFeHRTZXRLZXlQYXJhbS53ZGlLZXlba2V5SW5kZXhdLnBhZVJvbGUgPQorICAgICAgICAgICAgICAgICAgd2RhQnNzUGFyYW1zLT5leHRTZXRTdGFLZXlQYXJhbS5rZXlba2V5SW5kZXhdLnBhZVJvbGU7CisgICAgICAgICAgICAgICB3ZGlCc3NQYXJhbXMtPndkaUV4dFNldEtleVBhcmFtLndkaUtleVtrZXlJbmRleF0ua2V5TGVuZ3RoID0KKyAgICAgICAgICAgICAgICAgIHdkYUJzc1BhcmFtcy0+ZXh0U2V0U3RhS2V5UGFyYW0ua2V5W2tleUluZGV4XS5rZXlMZW5ndGg7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB3ZGlCc3NQYXJhbXMtPndkaUV4dFNldEtleVBhcmFtLnVjTnVtS2V5cyA9CisgICAgICAgICAgICAgICBTSVJfTUFDX01BWF9OVU1fT0ZfREVGQV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ID0gTlVMTDsKKyNlbmRpZgorICAgcmV0dXJuIENPTlZFUlRfV0RJMlZPU19TVEFUVVMoc3RhdHVzKSA7Cit9CisKK1ZPU19TVEFUVVMgV0RBX0dldFdlcEtleXNGcm9tQ2ZnKCB0V0RBX0NiQ29udGV4dCAqcFdEQSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBEZWZhdWx0S2V5SWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2X1U4X3QgKnBOdW1LZXlzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0RJX0tleXNUeXBlICpwV2RpS2V5cyApCit7CisgICB2X1UzMl90IGksIGosIGRlZktleUlkID0gMDsKKyAgIHZfVTMyX3QgdmFsID0gU0lSX01BQ19LRVlfTEVOR1RIOworICAgVk9TX1NUQVRVUyBzdGF0dXMgPSBXRElfU1RBVFVTX1NVQ0NFU1M7CisgICB0cEFuaVNpckdsb2JhbCBwTWFjID0gKHRwQW5pU2lyR2xvYmFsIClWT1NfR0VUX01BQ19DVFhUKHBXREEtPnBWb3NDb250ZXh0KSA7CisgICBpZiAoTlVMTCA9PSBwTWFjICkKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBJbnZva2VkIHdpdGggaW52YWxpZCBNQUMgY29udGV4dCAiLCBfX2Z1bmNfXyApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgfQorICAgaWYoIGVTSVJfU1VDQ0VTUyAhPSB3bGFuX2NmZ0dldEludCggcE1hYywgV05JX0NGR19XRVBfREVGQVVMVF9LRVlJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmRlZktleUlkICkpCisgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICJVbmFibGUgdG8gcmV0cmlldmUgZGVmYXVsdEtleUlkIGZyb20gQ0ZHLiBEZWZhdWx0aW5nIHRvIDAuLi4iKTsKKyAgIH0KKyAgIAorICAqcERlZmF1bHRLZXlJZCA9ICh2X1U4X3QpZGVmS2V5SWQ7CisgICAvKiBOZWVkIHRvIGV4dHJhY3QgQUxMIG9mIHRoZSBjb25maWd1cmVkIFdFUCBLZXlzICovCisgICBmb3IoIGkgPSAwLCBqID0gMDsgaSA8IFNJUl9NQUNfTUFYX05VTV9PRl9ERUZBVUxUX0tFWVM7IGkrKyApCisgICB7CisgICAgICB2YWwgPSBTSVJfTUFDX0tFWV9MRU5HVEg7CisgICAgICBpZiggZVNJUl9TVUNDRVNTICE9IHdsYW5fY2ZnR2V0U3RyKCBwTWFjLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodl9VMTZfdCkgKFdOSV9DRkdfV0VQX0RFRkFVTFRfS0VZXzEgKyBpKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwV2RpS2V5c1tqXS5rZXksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnZhbCApKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJXRVAgS2V5IGluZGV4IFslZF0gbWF5IG5vdCBjb25maWd1cmVkIGluIENGRyIsaSk7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICB7CisgICAgICAgICBwV2RpS2V5c1tqXS5rZXlJZCA9ICh0QU5JX1U4KSBpOworICAgICAgICAgLyogCisgICAgICAgICAqIEFjdHVhbGx5LCBhIERDIChEb24ndCBDYXJlKSBiZWNhdXNlCisgICAgICAgICAqIHRoaXMgaXMgZGV0ZXJtaW5lZCAoYW5kIHNldCkgYnkgUEUvTUxNRQorICAgICAgICAgKi8KKyAgICAgICAgIHBXZGlLZXlzW2pdLnVuaWNhc3QgPSAwOworICAgICAgICAgLyoKKyAgICAgICAgICogIEFub3RoZXIgREMgKERvbid0IENhcmUpCisgICAgICAgICAqLworICAgICAgICAgcFdkaUtleXNbal0ua2V5RGlyZWN0aW9uID0gZVNJUl9UWF9SWDsKKyAgICAgICAgIC8qIEFub3RoZXIgREMgKERvbid0IENhcmUpLiBVbnVzZWQgZm9yIFdFUCAqLworICAgICAgICAgcFdkaUtleXNbal0ucGFlUm9sZSA9IDA7CisgICAgICAgICAvKiBEZXRlcm1pbmVkIGZyb20gd2xhbl9jZmdHZXRTdHIoKSBhYm92ZS4qLworICAgICAgICAgcFdkaUtleXNbal0ua2V5TGVuZ3RoID0gKHRBTklfVTE2KSB2YWw7CisgICAgICAgICBqKys7CisgICAgICAgICAqcE51bUtleXMgPSAodEFOSV9VOCkgajsKKyAgICAgIH0KKyAgIH0KKyAgIHJldHVybiBzdGF0dXM7Cit9CisvKgorICogRlVOQ1RJT046IFdEQV9TZXRCc3NLZXlSZXFDYWxsYmFjaworICogc2VuZCBTRVQgQlNTIGtleSBSU1AgYmFjayB0byBQRQorICovIAordm9pZCBXREFfU2V0QnNzS2V5UmVxQ2FsbGJhY2soV0RJX1N0YXR1cyBzdGF0dXMsIHZvaWQqIHBVc2VyRGF0YSkKK3sKKyAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zID0gKHRXREFfUmVxUGFyYW1zICopcFVzZXJEYXRhOyAKKyAgIHRXREFfQ2JDb250ZXh0ICpwV0RBOyAKKyAgIHRTZXRCc3NLZXlQYXJhbXMgKnNldEJzc0tleVBhcmFtczsKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9X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Y2FzdCBmcmFtZXMgRW5jcnlwdGlvbikKKyAqLyAKK1ZPU19TVEFUVVMgV0RBX1Byb2Nlc3NTZXRCc3NLZXlSZXEodFdEQV9DYkNvbnRleHQgKnBXREEsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNldEJzc0tleVBhcmFtcyAqc2V0QnNzS2V5UGFyYW1zICkKK3sKKyAgIFdESV9TdGF0dXMgc3RhdHVzID0gV0RJX1NUQVRVU19TVUNDRVNTIDsKKyAgIFdESV9TZXRCU1NLZXlSZXFQYXJhbXNUeXBlICp3ZGlTZXRCc3NLZXlQYXJhbSA9IAorICAgICAgICAgICAgICAgICAgKFdESV9TZXRCU1NLZXlSZXFQYXJhbXNUeXBlICopdm9zX21lbV9tYWxsb2MoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihXRElfU2V0QlNTS2V5UmVxUGFyYW1zVHlwZSkpIDsKKyAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zIDsKKyAgIHZfVThfdCBrZXlJbmRleDsKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIi0tLS0tLT4gJXMgIiAsX19mdW5jX18pOworICAgaWYoTlVMTCA9PSB3ZGlTZXRCc3NLZXlQYXJhbSkgCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsgCisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9OT01FTTsKKyAgIH0KKyAgIHBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJ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gICAgc2V0QnNzS2V5UGFyYW1zLT5lbmNUeXBlID09IGVTSVJfRURfV0VQMTA0KSkKKyAgICAgIHsKKyAgICAgICAgIHRBTklfVTggZGVmYXVsdEtleUlkID0gMDsKKyAgICAgICAgIFdEQV9HZXRXZXBLZXlzRnJvbUNmZyggcFdEQSwgJmRlZmF1bHRLZXlJZCwgCisgICAgICAgICAgICAmd2RpU2V0QnNzS2V5UGFyYW0tPndkaUJTU0tleUluZm8udWNOdW1LZXlzLAorICAgICAgICAgICAgd2RpU2V0QnNzS2V5UGFyYW0tPndkaUJTU0tleUluZm8uYUtleXMgKTsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgIGZvcigga2V5SW5kZXg9MDsga2V5SW5kZXggPCBzZXRCc3NLZXlQYXJhbXMtPm51bUtleXM7IGtleUluZGV4KyspCisgICAgICAgICB7CisgICAgICAgICAgICB3ZGlTZXRCc3NLZXlQYXJhbS0+d2RpQlNTS2V5SW5mby5hS2V5c1trZXlJbmRleF0ua2V5SWQgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0QnNzS2V5UGFyYW1zLT5rZXlba2V5SW5kZXhdLmtleUlkOworICAgICAgICAgICAgd2RpU2V0QnNzS2V5UGFyYW0tPndkaUJTU0tleUluZm8uYUtleXNba2V5SW5kZXhdLnVuaWNhc3QgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0QnNzS2V5UGFyYW1zLT5rZXlba2V5SW5kZXhdLnVuaWNhc3Q7CisgICAgICAgICAgICB3ZGlTZXRCc3NLZXlQYXJhbS0+d2RpQlNTS2V5SW5mby5hS2V5c1trZXlJbmRleF0ua2V5RGlyZWN0aW9uID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldEJzc0tleVBhcmFtcy0+a2V5W2tleUluZGV4XS5rZXlEaXJlY3Rpb247CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkod2RpU2V0QnNzS2V5UGFyYW0tPndkaUJTU0tleUluZm8uYUtleXNba2V5SW5kZXhdLmtleVJzYywgCisgICAgICAgICAgICAgICAgICBzZXRCc3NLZXlQYXJhbXMtPmtleVtrZXlJbmRleF0ua2V5UnNjLCBXTEFOX01BWF9LRVlfUlNDX0xFTik7CisgICAgICAgICAgICB3ZGlTZXRCc3NLZXlQYXJhbS0+d2RpQlNTS2V5SW5mby5hS2V5c1trZXlJbmRleF0ucGFlUm9sZSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldEJzc0tleVBhcmFtcy0+a2V5W2tleUluZGV4XS5wYWVSb2xlOworICAgICAgICAgICAgd2RpU2V0QnNzS2V5UGFyYW0tPndkaUJTU0tleUluZm8uYUtleXNba2V5SW5kZXhdLmtleUxlbmd0aCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldEJzc0tleVBhcmFtcy0+a2V5W2tleUluZGV4XS5rZXlMZW5ndGg7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkod2RpU2V0QnNzS2V5UGFyYW0tPndkaUJTU0tleUluZm8uYUtleXNba2V5SW5kZXhdLmtleSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRCc3NLZXlQYXJhbXMtPmtleVtrZXlJbmRleF0ua2V5LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJUl9NQUNfTUFYX0tFWV9MRU5HVEgpOworICAgICAgICAgfQorICAgICAgfQorICAgfQorICAgd2RpU2V0QnNzS2V5UGFyYW0tPndkaUJTU0tleUluZm8udWNTaW5nbGVUaWRSYyA9IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRCc3NLZXlQYXJhbXMtPnNpbmdsZVRpZFJjOworICAgd2RpU2V0QnNzS2V5UGFyYW0tPndkaVJlcVN0YXR1c0NCID0gTlVMTCA7CisgICAvKiBTdG9yZSBzZXQga2V5I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V5UGFyYW1zLT5zdGF0dXMgPSBzdGF0dXMgOworICAgV0RBX1NlbmRNc2cocFdEQSwgV0RBX1JFTU9WRV9CU1NLRVlfUlNQLCAodm9pZCAqKXJlbW92ZUJzc0tleVBhcmFtcyAsIDApIDsKKyAgIHJldHVybiA7Cit9CisKKy8qCisgKiBGVU5DVElPTjogV0RBX0dldEZyYW1lTG9nUnNwQ2FsbGJhY2sKKyAqIHJlY2lldmVzIGdldCBmcmFtZSBsb2cgcmVzcG9uc2UgZnJvbSBGVworICovCit2b2lkIFdEQV9HZXRGcmFtZUxvZ1JzcENhbGxiYWNrKFdESV9HZXRGcmFtZUxvZ1JzcFBhcmFtVHlwZSogd2RpUnNwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogcFVzZXJEYXRhKQoreworICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKilwVXNlckRhdGE7CisgICB0V0RBX0NiQ29udGV4dCAqcFdEQSA9IE5VTEw7CisgICB0QW5pR2V0RnJhbWVMb2dSZXEgICpwR2V0RnJhbWVMb2dSZXFQYXJhbXMgPSBOVUxMOworCisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICI8LS0tLS0tIEVudGVyaW5nOiAlcyAiICxfX2Z1bmNfXyk7CisgICBpZihOVUxMID09IHBXZGFQYXJhbXMpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICIlczogcFdkYVBhcmFtcyByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKSA7CisgICAgICByZXR1cm4gO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VQSWR4ID0gc2V0U3RhS2V5UGFyYW1zLT5kZWZXRVBJZHg7CisgICBpZihzZXRTdGFLZXlQYXJhbXMtPmVuY1R5cGUgIT0gZVNJUl9FRF9OT05FKQorICAgeworICAgICAgaWYoICh3ZGlTZXRTdGFLZXlQYXJhbS0+d2RpS2V5SW5mby53ZGlXRVBUeXBlID09IFdESV9XRVBfU1RBVElDKSAmJiAKKyAgICAgICAgICAgICAgICAgICAgKFdEQV9JTlZBTElEX0tFWV9JTkRFWCA9PSBzZXRTdGFLZXlQYXJhbXMtPmRlZldFUElkeCkgJiYKKyAgICAgICAgICAgICAgICAgICAgKGVTWVNURU1fQVBfUk9MRSAhPSBwV0RBLT53ZGFHbG9iYWxTeXN0ZW1Sb2xlKSkKKyAgICAgIHsKKyAgICAgICAgIFdEQV9HZXRXZXBLZXlzRnJvbUNmZyggcFdEQSwgCisgICAgICAgICAgICAmd2RpU2V0U3RhS2V5UGFyYW0tPndkaUtleUluZm8udWNEZWZXRVBJZHgsIAorICAgICAgICAgICAgJndkaVNldFN0YUtleVBhcmFtLT53ZGlLZXlJbmZvLnVjTnVtS2V5cywKKyAgICAgICAgICAgIHdkaVNldFN0YUtleVBhcmFtLT53ZGlLZXlJbmZvLndkaUtleSApOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgeworICAgICAgICAgZm9yKCBrZXlJbmRleD0wOyBrZXlJbmRleCA8IFNJUl9NQUNfTUFYX05VTV9PRl9ERUZBVUxUX0tFWVM7IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5SW5kZXgrKykKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHdkaVNldFN0YUtleVBhcmFtLT53ZGlLZXlJbmZvLndkaUtleVtrZXlJbmRleF0ua2V5SWQgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFN0YUtleVBhcmFtcy0+a2V5W2tleUluZGV4XS5rZXlJZDsKKyAgICAgICAgICAgIHdkaVNldFN0YUtleVBhcmFtLT53ZGlLZXlJbmZvLndkaUtleVtrZXlJbmRleF0udW5pY2FzdCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0U3RhS2V5UGFyYW1zLT5rZXlba2V5SW5kZXhdLnVuaWNhc3Q7CisgICAgICAgICAgICB3ZGlTZXRTdGFLZXlQYXJhbS0+d2RpS2V5SW5mby53ZGlLZXlba2V5SW5kZXhdLmtleURpcmVjdGlvbiA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0U3RhS2V5UGFyYW1zLT5rZXlba2V5SW5kZXhdLmtleURpcmVjdGlvbjsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSh3ZGlTZXRTdGFLZXlQYXJhbS0+d2RpS2V5SW5mby53ZGlLZXlba2V5SW5kZXhdLmtleVJzYywgCisgICAgICAgICAgICAgICAgICBzZXRTdGFLZXlQYXJhbXMtPmtleVtrZXlJbmRleF0ua2V5UnNjLCBXTEFOX01BWF9LRVlfUlNDX0xFTik7CisgICAgICAgICAgICB3ZGlTZXRTdGFLZXlQYXJhbS0+d2RpS2V5SW5mby53ZGlLZXlba2V5SW5kZXhdLnBhZVJvbGUgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRTdGFLZXlQYXJhbXMtPmtleVtrZXlJbmRleF0ucGFlUm9sZTsKKyAgICAgICAgICAgIHdkaVNldFN0YUtleVBhcmFtLT53ZGlLZXlJbmZvLndkaUtleVtrZXlJbmRleF0ua2V5TGVuZ3RoID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0U3RhS2V5UGFyYW1zLT5rZXlba2V5SW5kZXhdLmtleUxlbmd0aDsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSh3ZGlTZXRTdGFLZXlQYXJhbS0+d2RpS2V5SW5mby53ZGlLZXlba2V5SW5kZXhdLmtleSwgCisgICAgICAgICAgICAgICAgICBzZXR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V5KCBrZXkgZm9yIEJyb2FkY2FzdCBmcmFtZXMgCisgKiBFbmNyeXB0aW9uKQorICovCitWT1NfU1RBVFVTIFdEQV9Qcm9jZXNzU2V0QmNhc3RTdGFLZXlSZXEodFdEQV9DYkNvbnRleHQgKnBXREEsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNldFN0YUtleVBhcmFtcyAqc2V0U3RhS2V5UGFyYW1zICkKK3sKKyAgIFdESV9TdGF0dXMgc3RhdHVzID0gV0RJX1NUQVRVU19TVUNDRVNTIDsKKyAgIFdESV9TZXRTVEFLZXlSZXFQYXJhbXNUeXBlICp3ZGlTZXRTdGFLZXlQYXJhbSA9IAorICAgICAgICAgICAgICAgICAgKFdESV9TZXRTVEFLZXlSZXFQYXJhbXNUeXBlICopdm9zX21lbV9tYWxsb2MoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihXRElfU2V0U1RBS2V5UmVxUGFyYW1zVHlwZSkpIDsKKyAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zIDsKKyAgIHZfVThfdCBrZXlJbmRleDsKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIi0tLS0tLT4gJXMgIiAsX19mdW5jX18pOworICAgaWYoTlVMTCA9PSB3ZGlTZXRTdGFLZXlQYXJhbSkgCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsgCisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9OT01FTTsKKyAgIH0KKyAgIHBX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KHNldFN0YUtleVBhcmFtcy0+ZW5jVHlwZSAhPSBlU0lSX0VEX05PTkUpCisgICB7CisgICAgICBmb3IoIGtleUluZGV4PTA7IGtleUluZGV4IDwgU0lSX01BQ19NQVhfTlVNX09GX0RFRkFVTFRfS0VZUzsgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXlJbmRleCsrKQorICAgICAgeworICAgICAgICAgd2RpU2V0U3RhS2V5UGFyYW0tPndkaUtleUluZm8ud2RpS2V5W2tleUluZGV4XS5rZXlJZCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0U3RhS2V5UGFyYW1zLT5rZXlba2V5SW5kZXhdLmtleUlkOworICAgICAgICAgd2RpU2V0U3RhS2V5UGFyYW0tPndkaUtleUluZm8ud2RpS2V5W2tleUluZGV4XS51bmljYXN0ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRTdGFLZXlQYXJhbXMtPmtleVtrZXlJbmRleF0udW5pY2FzdDsKKyAgICAgICAgIHdkaVNldFN0YUtleVBhcmFtLT53ZGlLZXlJbmZvLndkaUtleVtrZXlJbmRleF0ua2V5RGlyZWN0aW9uID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRTdGFLZXlQYXJhbXMtPmtleVtrZXlJbmRleF0ua2V5RGlyZWN0aW9uOworICAgICAgICAgdm9zX21lbV9jb3B5KHdkaVNldFN0YUtleVBhcmFtLT53ZGlLZXlJbmZvLndkaUtleVtrZXlJbmRleF0ua2V5UnNjLCAKKyAgICAgICAgICAgICAgIHNldFN0YUtleVBhcmFtcy0+a2V5W2tleUluZGV4XS5rZXlSc2MsIFdMQU5fTUFYX0tFWV9SU0NfTEVOKTsKKyAgICAgICAgIHdkaVNldFN0YUtleVBhcmFtLT53ZGlLZXlJbmZvLndkaUtleVtrZXlJbmRleF0ucGFlUm9sZSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFN0YUtleVBhcmFtcy0+a2V5W2tleUluZGV4XS5wYWVSb2xlOworICAgICAgICAgd2RpU2V0U3RhS2V5UGFyYW0tPndkaUtleUluZm8ud2RpS2V5W2tleUluZGV4XS5rZXlMZW5ndGggPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRTdGFLZXlQYXJhbXMtPmtleVtrZXlJbmRleF0ua2V5TGVuZ3RoOworICAgICAgICAgdm9zX21lbV9jb3B5KHdkaVNldFN0YUtleVBhcmFtLT53ZGlLZXlJbmZvLndkaUtleVtrZXlJbmRleF0ua2V5LCAKKyAgICAgICAgICAgICAgIHNldFN0YUtleVBhcmFtcy0+a2V5W2tleUluZGV4XS5rZXksIFNJUl9NQUNfTUFYX0tFWV9MRU5HVEgpOworICAgICAgfQorICAgICAgd2RpU2V0U3RhS2V5UGFyYW0tPndkaUtleUluZm8udWNOdW1LZXlzID0gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSVJfTUFDX01BWF9OVU1fT0ZfREVGQVVMVF9LRVlTOworICAgfQorICAgd2RpU2V0U3RhS2V5UGFyYW0tPndkaUtleUluZm8udWNTaW5nbGVUaWRSYyA9IHNldFN0YUtleVBhcmFtcy0+c2luZ2xlVGlkUmM7CisgICAvKiBTdG9yZSBzZXQga2V5IHBvaW50ZXIsIGFzIHRoaXMgd2lsbCBiZSB1c2VkIGZvciByZXNwb25zZSAqLworICAgLyogc3RvcmUgUGFyYW1zIHBhc3MgaXQgdG8gV0RJICovCisgICBwV2RhUGFyYW1zLT5wV2RhQ29udGV4dCA9IHBXREE7CisgICBwV2RhUGFyYW1zLT53ZGFNc2dQYXJhbSA9IHNldFN0YUtleVBhcmFtczsKKyAgIHBXZGFQYXJhbXMtPndkYVdkaUFwaU1zZ1BhcmFtID0gd2RpU2V0U3RhS2V5UGFyYW07CisgICBzdGF0dXMgPSBXRElfU2V0U1RBQmNhc3RLZXlSZXEod2RpU2V0U3RhS2V5U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AorICAgICAgICAgKiBzZXQgdGhlIFdEQSBzdGF0ZSB0byBQUkUgQVNTT0MgCisgICAgICAgICAqIGNvcHkgdGhlIEJTU0lEIGludG8gcFdEQSB0byB1c2UgaXQgaW4gam9pbiByZXF1ZXN0IGFuZCByZXR1cm4sIAorICAgICAgICAgKiBObyBuZWVkIHRvIGhhbmRsZSB0aGVzZSBtZXNzYWdlcy4KKyAgICAgICAgICovCisgICAgICAgICBpZiggIVdEQV9JU19OVUxMX01BQ19BRERSRVNTKGxpbmtTdGF0ZVBhcmFtcy0+YnNzaWQpICkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fY29weShwV0RBLT5tYWNCU1NJRCxsaW5rU3RhdGVQYXJhbXMtPmJzc2lkLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgIiVzOiBCU1NJRCBpbiBzZXQgbGluayBzdGF0ZSBpcyBOVUxMICIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICB9CisKKyAgICAgICAgIGlmKCAhV0RBX0lTX05VTExfTUFDX0FERFJFU1MobGlua1N0YXRlUGFyYW1zLT5zZWxmTWFjQWRkcikgKQorICAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KHBXREEtPm1hY1NUQVNlbGYsbGlua1N0YXRlUGFyYW1zLT5zZWxmTWFjQWRkciwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9GQVRBTCwKKyAgICAgICAgICAgICAgICIlczogc2VsZiBtYWMgYWRkcmVzcyBpbiBzZXQgbGluayBzdGF0ZSBpcyBOVUxMICIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICB9CisKKyAgICAgICAgIC8qIFVNQUMgaXMgaXNzdWluZyB0aGUgc2V0bGluayBzdGF0ZSB3aXRoIFBSRUFTU09DIHR3aWNlIChiZWZvcmUgc2V0IAorICAgICAgICAgKmNoYW5uZWwgYW5kIGFmdGVyICkgc28gcmVzZXQgdGhlIFdEQSBzdGF0ZSB0byByZWFkeSB3aGVuIHRoZSBzZWNvbmQgCisgICAgICAgICAqIHRpbWUgVU1BQyBpc3N1ZSB0aGUgbGluayBzdGF0ZSB3aXRoIFBSRUFTU09DIAorICAgICAgICAgKi8KKyAgICAgICAgIGlmKFdEQV9QUkVfQVNTT0NfU1RBVEUgPT0gcFdEQS0+d2RhU3RhdGUpCisgICAgICAgICB7CisgICAgICAgICAgICAvKiBSRVNFVCBXREEgc3RhdGUgYmFjayB0byBXREFfUkVBRFlfU1RBVEUgKi8KKyAgICAgICAgICAgIHBXREEtPndkYVN0YXRlID0gV0RBX1JFQURZX1NUQVRFOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgcFdEQS0+d2RhU3RhdGUgPSBXREFfUFJFX0FTU09DX1NUQVRFOworICAgICAgICAgfQorICAgICAgICAgLy9wb3B1bGF0ZSBsaW5rU3RhdGUgaW5mbyBpbiBXREFDYkN0eHQKKyAgICAgICAgIHBXREEtPmxpbmtTdGF0ZSA9IGxpbmtTdGF0ZVBhcmFtcy0+c3RhdGU7CisgICAgICAgICBicmVhazsKKyAgICAgIGRlZmF1bHQ6CisgICAgICAgICBpZihwV0RBLT53ZGFTdGF0ZSAhPSBXREFfUkVBRFlfU1RBVEUpCisgICAgICAgICB7CisgICAgICAgICAgICAvKklmIFdEQV9TRVRfTElOS19TVEFURSBpcyByZWNpZXZlZCB3aXRoIGFueSBvdGhlciBsaW5rIHN0YXRlIGFwYXJ0IAorICAgICAgICAgICAgICpmcm9tIGVTSVJfTElOS19QUkVBU1NPQ19TVEFURSBhbmQgZVNJUl9MSU5LX0JUQU1QX1BSRUFTU09DX1NUQVRFIHdoZW4gCisgICAgICAgICAgICAgKnBXREEtPndkYVN0YXRlIGlzIGluIFdEQV9QUkVfQVNTT0NfU1RBVEUoVGhpcyBjYW4gaGFwcGVuIG9ubHkgaW4gCisgICAgICAgICAgICAgKmVycm9yIGNhc2VzKSBzbyByZXNldCB0aGUgV0RBIHN0YXRlIHRvIFdEQV9SRUFEWV9TVEFURSB0byBhdm9pZCAKKyAgICAgICAgICAgICAqdGhlIEFTU0VSVCBpbiBXREFfU3RvcCBkdXJpbmcgbW9kdWxlIHVubG9hZC4qLworICAgICAgICAgICAgaWYgKHBXREEtPndkYVN0YXRlID09IFdEQV9QUkVfQVNTT0NfU1RBVEUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBwV0RBLT53ZGFTdGF0ZSA9IFdEQV9SRUFEWV9TVEFURTsKKyAgICAgICAgICAgICAgIC8qIERvbid0IGlnbm9yZSB0aGUgc2V0IGxpbmsgaW4gdGhpcyBjYXNlKi8KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJTZXQgbGluayBzdGF0ZSBjYWxsZWQgd2hlbiBXREEgaXMgbm90IGluIFJFQURZIFNUQVRFICIgKTsKKyAgICAgICAgICAgICAgIHN0YXR1cyA9IFdEQV9JR05PUkVfU0VUX0xJTktfU1RBVEU7CisgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgICBicmVhazsKKyAgIH0KKyAgIAorICAgcmV0dXJuIHN0YXR1czsKK30KKy8qCisgKiBGVU5DVElPTjogV0RBX1NldExpbmtTdGF0ZUNhbGxiYWNrCisgKiBjYWxsIGJhY2sgZnVuY3Rpb24gZm9yIHNldCBsaW5rIHN0YXRlIGZyb20gV0RJCisgKi8gCit2b2lkIFdEQV9TZXRMaW5rU3RhdGVDYWxsYmFjayhXRElfU3RhdHVzIHN0YXR1cywgdm9pZCogcFVzZXJEYXRhKQoreworICAgdFdEQV9DYkNvbnRleHQgKnBXREEgPSBOVUxMOworICAgdExpbmtTdGF0ZVBhcmFtcyAqbGlua1N0YXRlUGFyYW1zOworICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKilwVXNlckRhdGE7IAorICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiPC0tLS0tLSAlcyAiICxfX2Z1bmNfXyk7CisgICBpZiAoTlVMTCA9PSBwV2RhUGFyYW1zKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICIlczogcFdkYVBhcmFtcyByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKSA7CisgICAgICByZXR1cm4gOworICAgfQorICAgcFdEQSA9ICh0V0RBX0NiQ29udGV4dCAqKXBXZGFQYXJhbXMtPnBXZGFDb250ZXh0OworICAgaWYgKE5VTEwgPT0gcFdEQSkKKyAgIHsKKyAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxf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T1NfR0VUX01BQ19DVFhUKHBXREEtPnBWb3NDb250ZXh0KTsKKworICAgaWYoTlVMTCA9PSBwTWFjKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOnBNYWMgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICB2b3NfbWVtX2ZyZWUod2RpU2V0TGlua1N0YXRlUGFyYW0pOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgfQorCisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICItLS0tLS0+ICVzICIgLF9fZnVuY19fKTsKKyAgIGlmKE5VTEwgPT0gd2RpU2V0TGlua1N0YXRlUGFyYW0pIAorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBWT1MgTUVNIEFsbG9jIEZhaWx1cmUiLCBfX2Z1bmNfXyk7IAorICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfTk9NRU07CisgICB9CisgICBwV2RhUGFyYW1zID0gKHRXREFfUmVxUGFyYW1zICopdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRXREFfUmVxUGFyYW1zKSkgOworICAgaWYoTlVMTCA9PSBwV2RhUGFyYW1zKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgI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JST1IsCisgICAgICAgICAgICAgIkZhaWx1cmUgaW4gc2V0IGxpbmsgc3RhdGUgUmVxIFdESSBBUEksIGZyZWUgYWxsIHRoZSBtZW1vcnkgIiApOworICAgICAgfQorICAgfQorICAgaWYoSVNfV0RJX1NUQVRVU19GQUlMVVJFKHN0YXR1cykpCisgICB7CisgICAgICB2b3NfbWVtX2ZyZWUod2RpU2V0TGlua1N0YXRlUGFyYW0pIDsKKyAgICAgIFdEQV9TZW5kTXNnKHBXREEsIFdEQV9TRVRfTElOS19TVEFURV9SU1AsICh2b2lkICopbGlua1N0YXRlUGFyYW1zLCAwKTsKKyAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zKTsKKyAgIH0KKyAgIHJldHVybiBDT05WRVJUX1dESTJWT1NfU1RBVFVTKHN0YXR1cykgOworfQorLyoKKyAqIEZVTkNUSU9OOiBXREFfR2V0U3RhdHNSZXFQYXJhbXNDYWxsYmFjaworICogc2VuZCB0aGUgcmVzcG9uc2UgdG8gUEUgd2l0aCBTdGF0cyByZWNlaXZlZCBmcm9tIFdESQorICovIAordm9pZCBXREFfR2V0U3RhdHNSZXFQYXJhbXNDYWxsYmFjaygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdESV9HZXRTdGF0c1JzcFBhcmFtc1R5cGUgKndkaUdldFN0YXRzUnNwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogcFVzZXJEYXRhKQoreworICAgdEFuaUdldFBFU3RhdHNSc3AgKnBHZXRQRVN0YXRzUnNwUGFyYW1zOworICAgdm9zX21zZ190IHZvc01zZzsKKworICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiPC0tLS0tLSAlcyAiICxfX2Z1bmNfXyk7CisgICBwR2V0UEVTdGF0c1JzcFBhcmFtcyA9IAorICAgICAgICh0Q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3RhdHNSZXEodFdEQV9DYkNvbnRleHQgKnBXREEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QW5pR2V0UEVTdGF0c1JlcSAqcEdldFN0YXRzUGFyYW1zKQoreworICAgV0RJX1N0YXR1cyBzdGF0dXMgPSBXRElfU1RBVFVTX1NVQ0NFU1MgOworICAgV0RJX0dldFN0YXRzUmVxUGFyYW1zVHlwZSB3ZGlHZXRTdGF0c1BhcmFtOworICAgdEFuaUdldFBFU3RhdHNSc3AgKnBHZXRQRVN0YXRzUnNwUGFyYW1zOworICAgdm9zX21zZ190IHZvc01zZzsKKworICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiLS0tLS0tPiAlcyAiICxfX2Z1bmNfXyk7CisgICB3ZGlHZXRTdGF0c1BhcmFtLndkaUdldFN0YXRzUGFyYW1zSW5mby51Y1NUQUlkeCA9IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEdldFN0YXRzUGFyYW1zLT5zdGFJZDsKKyAgIHdkaUdldFN0YXRzUGFyYW0ud2RpR2V0U3RhdHNQYXJhbXNJbmZvLnVTdGF0c01hc2sgPSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBHZXRTdGF0c1BhcmFtcy0+c3RhdHNNYXNrOworICAgd2RpR2V0U3RhdHNQYXJhbS53ZGlSZXFTdGF0dXNDQiA9IE5VTEwgOworICAgc3RhdHVzID0gV0RJX0dldFN0YXRzUmVxKCZ3ZGlHZXRTdGF0c1BhcmFtLCAKKyAgICAgICAoV0RJX0dldFN0YXRzUnNwQ2IpV0RBX0dldFN0YXRzUmVxUGFyYW1zQ2FsbGJhY2ssIHBXREEpOworICAgaWYoSVNfV0RJX1NUQVRVU19GQUlMVVJFKHN0YXR1cykpCisgICB7C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RGlyZWN0aW9uKSkKKyAgIHsKKyAgICAgIC8qIFVwZGF0ZSBUTCB3aXRoIEJBIGluZm8gcmVjZWl2ZWQgZnJvbSBIQUwvV0RJICovCisgICAgICBzdGF0dXMgPSAgV0RBX1RMX0JBX1NFU1NJT05fQUREKHBXREEtPnBWb3NDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkaUFkZEJhU2Vzc2lvbi0+dXNCYVNlc3Npb25JRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ZGlBZGRCYVNlc3Npb24tPnVjU1RBSWR4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkaUFkZEJhU2Vzc2lvbi0+dWNCYVRJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ZGlBZGRCYVNlc3Npb24tPnVjQmFCdWZmZXJTaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkaUFkZEJhU2Vzc2lvbi0+dWNXaW5TaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkaUFkZEJhU2Vzc2lvbi0+dXNCYVNTTiApOworICAgICAgV0RBX1Byb2Nlc3NBZGRCQVJlcShwV0RBLCBzdGF0dXMsIHdkaUFkZEJhU2Vzc2lvbi0+dXNCYVNlc3Npb25JRCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkaUFkZEJhU2Vzc2lvbi0+dWNTVEFJZHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkaUFkZEJhU2Vzc2lvbi0+dWNXaW5TaXplLCBwQWRkQkFSZXFQYXJhbXMpIDsKKyAgIH0KKyAgIGVsc2UKKyAgIHsKKyAgICAgIHBBZGRCQVJlcVBhcmFtcy0+c3RhdHVzID0gCisgICAgICAgICAgICBDT05WRVJUX1dESTJTSVJfU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lZPU19TVEFUVVMoc3RhdHVzKSA7Cit9CisvKgorICogRlVOQ1RJT046IFdEQV9EZWxCQU5vdGlmeVRMCisgKiBzZW5kIERFTCBCQSBJTkQgdG8gVEwKKyAqLyAKK3ZvaWQgV0RBX0RlbEJBTm90aWZ5VEwodFdEQV9DYkNvbnRleHQgKnBXREEsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHREZWxCQVBhcmFtcyAqcERlbEJBUmVxUGFyYW1zKQoreworICAgdHBEZWxCQUluZCBwRGVsQkFJbmQgPSAodHBEZWxCQUluZCl2b3NfbWVtX21hbGxvYyhzaXplb2YoIHREZWxCQUluZCApKTsKKyAgIC8vdFNpck1zZ1EgbXNnOworICAgdm9zX21zZ190IHZvc01zZzsKKyAgIFZPU19TVEFUVVMgdm9zU3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgaWYoTlVMTCA9PSBwRGVsQkFJbmQpIAorICAgeyAKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsgCisgICAgICBWT1NfQVNTRVJUKDApIDsgCisgICAgICByZXR1cm47IAorICAgfSAKKyAgIHBEZWxCQUluZC0+bWVzZ1R5cGUgPSBXREFfREVMRVRFQkFfSU5EOworICAgcERlbEJBSW5kLT5zdGFJZHggPSAodEFOSV9VOCkgcERlbEJBUmVxUGFyYW1zLT5zdGFJZHg7CisgICBwRGVsQkFJbmQtPmJhVElEID0gKHRBTklfVTgpIHBEZWxCQVJlcVBhcmFtcy0+YmFUSUQ7CisgICBwRGVsQkFJbmQtPm1lc2dMZW4gPSBzaXplb2YoIHREZWxCQUluZCApOworIAorIAorICAgdm9zTXNnLnR5cGUgPSBXREFfREVMRVRFQkFfSU5EOworICAgdm9zTXNnLmJvZHl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9EZWxCQVJlcVBhcmFtc1R5cGUgKndkaURlbEJBUmVxUGFyYW0gPSAKKyAgICAgICAgICAgICAgICAgICAgIChXRElfRGVsQkFSZXFQYXJhbXNUeXBlICopdm9zX21lbV9tYWxsb2MoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoV0RJX0RlbEJBUmVxUGFyYW1zVHlwZSkpIDsKKyAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zIDsKKyAgIHRBTklfVTE2IHN0YUlkeCA9IDA7CisgICB0QU5JX1U4IHRpZCA9IDA7CisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICItLS0tLS0+ICVzICIgLF9fZnVuY19fKTsKKyAgIGlmKE5VTEwgPT0gd2RpRGVsQkFSZXFQYXJhbSkgCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsgCisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9OT01FTTsKKyAgIH0KKyAgIHBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKil2b3NfbWVtX21hbGxvYyhzaXplb2YodFdEQV9SZXFQYXJhbXMpKSA7CisgICBpZihOVUxMID09IHBXZGFQYXJhbXMpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZn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bWVtX21hbGxvYygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihXRElfQWRkVFNSZXFQYXJhbXNUeXBlKSkgOworICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgOworICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiLS0tLS0tPiAlcyAiICxfX2Z1bmNfXyk7CisgICBpZihOVUxMID09IHdkaUFkZFRTUmVxUGFyYW0pIAorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBWT1MgTUVNIEFsbG9jIEZhaWx1cmUiLCBfX2Z1bmNfXyk7IAorICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfTk9NRU07CisgICB9CisgICBwV2RhUGFyYW1zID0gKHRXREFfUmVxUGFyYW1zICopdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRXREFfUmVxUGFyYW1zKSkgOworICAgaWYoTlVMTCA9PSBwV2RhUGFyYW1zKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBWT1MgTUVNIEFsbG9jIEZhaWx1cmUiLCBfX2Z1bmNfXyk7IAorICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHZvc19tZW1fZnJlZSh3ZGlBZGRUU1JlcVBhcmFtKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfTk9NRU07CisgICB9CisgICB3ZGlBZGRUU1JlcVBhcmFtLT53ZGlUc0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NSZXFQYXJhbS0+d2RpVHNJbmZvLndkaVRzcGVjSUUud2RpVFNpbmZvLndkaVRyYWZmaWMuYWdncmVnYXRpb24gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkZFRzUmVxUGFyYW1zLT50c3BlYy50c2luZm8udHJhZmZpYy5hZ2dyZWdhdGlvbjsKKyAgIHdkaUFkZFRTUmVxUGFyYW0tPndkaVRzSW5mby53ZGlUc3BlY0lFLndkaVRTaW5mby53ZGlUcmFmZmljLmFjY2Vzc1BvbGljeSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRkVHNSZXFQYXJhbXMtPnRzcGVjLnRzaW5mby50cmFmZmljLmFjY2Vzc1BvbGljeTsKKyAgIHdkaUFkZFRTUmVxUGFyYW0tPndkaVRzSW5mby53ZGlUc3BlY0lFLndkaVRTaW5mby53ZGlUcmFmZmljLmRpcmVjdGlvbiA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRkVHNSZXFQYXJhbXMtPnRzcGVjLnRzaW5mby50cmFmZmljLmRpcmVjdGlvbjsKKyAgIHdkaUFkZFRTUmVxUGFyYW0tPndkaVRzSW5mby53ZGlUc3BlY0lFLndkaVRTaW5mby53ZGlUcmFmZmljLnRzaWQgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkZFRzUmVxUGFyYW1zLT50c3BlYy50c2luZm8udHJhZmZpYy50c2lkOworICAgd2RpQWRkVFNSZXFQYXJhbS0+d2RpVHNJbmZvLndkaVRzcGVjSUUud2RpVFNpbmZvLndkaVRyYWZmaWMudHJhZmZpY1R5cGUgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgcEFkZFRzUmVxUGFyYW1zLT50c3BlYy50c2luZm8udHJhZmZpYy50cmFmZmljVHlwZTsKKyAgIAorICAgLy9UUyBJRSA6IFRTIElORk8gOiBTQ0hFRFVMRQorICAgd2RpQWRkVFNSZXFQYXJhbS0+d2RpVHNJbmZvLndkaVRzcGVjSUUud2RpVFNpbmZvLndkaVNjaGVkdWxlLnNjaGVkdWxlID0gCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRkVHNSZXFQYXJhbXMtPnRzcGVjLnRzaW5mby5zY2hlZHVsZS5zY2hlZHVsZTsKKyAgIHdkaUFkZFRTUmVxUGFyYW0tPndkaVRzSW5mby53ZGlUc3BlY0lFLndkaVRTaW5mby53ZGlTY2hlZHVsZS5yc3ZkID0gCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRkVHNSZXFQYXJhbXMtPnRzcGVjLnRzaW5mby5zY2hlZHVsZS5yc3ZkOworICAgLy9UUyBJRQorICAgd2RpQWRkVFNSZXFQYXJhbS0+d2RpVHNJbmZvLndkaVRzcGVjSUUudXNOb21Nc2R1U3ogPSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGRUc1JlcVBhcmFtcy0+dHNwZWMubm9tTXNkdVN6OworICAgd2RpQWRkVFNSZXFQYXJhbS0+d2RpVHNJbmZvLndkaVRzcGVjSUUudXNNYXhNc2R1U3ogPSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBBZGRUc1JlcVBhcmFtcy0+dHNwZWMubWF4TXNkdVN6OworICAgd2RpQWRkVFNSZXFQYXJhbS0+d2RpVHNJbmZvLndkaVRzcGVjSUUudU1pblN2Y0ludGVydmFsID0gCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRkVHNSZXFQYXJhbXMtPnRzcGVjLm1pblN2Y0ludGVydmFsOworICAgd2RpQWRkVFNSZXFQYXJhbS0+d2RpVHNJbmZvLndkaVRzcGVjSUUudU1heFN2Y0ludGVydmFsID0gCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwQWRkVHNSZXFQYXJhbXMtPnRzcGVjLm1heFN2Y0ludGVydmFsOworICAgd2RpQWRkVFNSZXFQYXJhbS0+d2RpVHNJbmZvLndkaVRzcGVjSUUudUluYWN0SW50ZXJ2YWwgPSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBB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UU1JlcVBhcmFtID0gCisgICAgICAgICAgICAgICAgICAgICAoV0RJX0RlbFRTUmVxUGFyYW1zVHlwZSAqKXZvc19tZW1fbWFsbG9jKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKFdESV9EZWxUU1JlcVBhcmFtc1R5cGUpKSA7CisgICB0V0RBX1JlcVBhcmFtcyAqcFdkYVBhcmFtcyA7CisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICItLS0tLS0+ICVzICIgLF9fZnVuY19fKTsKKyAgIGlmKE5VTEwgPT0gd2RpRGVsVFNSZXFQYXJhbSkgCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsgCisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9OT01FTTsKKyAgIH0KKyAgIHBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKil2b3NfbWVtX21hbGxvYyhzaXplb2YodFdEQV9SZXFQYXJhbXMpKSA7CisgICBpZihOVUxMID09IHBXZGFQYXJhbXMpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsgCisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgdm9zX21lbV9mcmVlKHdkaURlbFRTUmVxUGFyYW0pOworICAgICAgcmV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X1JlcVBhcmFtcyAqcFdkYVBhcmFtcyA7CisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICItLS0tLS0+ICVzICIgLF9fZnVuY19fKTsKKyAgIGlmKE5VTEwgPT0gd2RpVXBkYXRlQmVhY29uUGFyYW1zKSAKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogVk9TIE1FTSBBbGxvYyBGYWlsdXJlIiwgX19mdW5jX18pOyAKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX05PTUVNOworICAgfQorICAgcFdkYVBhcmFtcyA9ICh0V0RBX1JlcVBhcmFtcyAqKXZvc19tZW1fbWFsbG9jKHNpemVvZih0V0RBX1JlcVBhcmFtcykpIDsKKyAgIGlmKE5VTEwgPT0gcFdkYVBhcmFtcykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogVk9TIE1FTSBBbGxvYyBGYWlsdXJlIiwgX19mdW5jX18pOyAKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICB2b3NfbWVtX2ZyZWUod2RpVXBkYXRlQmVhY29uUGFyYW1zKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfTk9NRU07CisgICB9CisgICB3ZGlVcGRhdGVCZWFjb25QYXJhbXMtPndkaVVwZGF0ZUJlYWNvblBhcmFtc0luZm8udWNCc3NJZHggPSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBVcGRhdGVCZWFjb25QYXJhbXMtPmJz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VUxMIiwgX19mdW5jX18pOworICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgcmV0dXJuIDsKKyAgIH0KKworICAgcEdldFRzbVN0YXRzUmVxUGFyYW1zID0gKHRBbmlHZXRUc21TdGF0c1JlcSAqKXBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtOworCisgICBpZihOVUxMID09IHBHZXRUc21TdGF0c1JlcVBhcmFtcykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICIlczogcEdldFRzbVN0YXRzUmVxUGFyYW1zIHJlY2VpdmVkIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYVdkaUFwaU1zZ1BhcmFtKTsKKyAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zKTsKKyAgICAgIHJldHVybjsKKyAgIH0KKworICAgcFRzbVJzcFBhcmFtcyA9CisgICAgICh0QW5pR2V0VHNtU3RhdHNSc3AgKil2b3NfbWVtX21hbGxvYyhzaXplb2YodEFuaUdldFRzbVN0YXRzUnNwKSk7CisgICBpZiggTlVMTCA9PSBwVHNtUnNwUGFyYW1zICkKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogcFRzbVJzcFBhcmFtcyByZWNlaXZlZCBOVUxMICIgLF9fZnVuY19fKTsKKyAgICAgIFZPU19BU1NFUlQoIDAgKTsKKyAgICAgIHJldHVybiA7CisgICB9CisgICB2b3NfbWVtX3NldChwVHNtUnNwUGFyYW1zLCBzaXplb2YodEFuaUdldFRzbVN0YXRzUnNwKSwgMCk7CisgICBwVHNtUnNwUG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RUc21TdGF0c1JzcFBhcmFtcyA9IE5VTEw7CisKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIi0tLS0tLT4gRW50ZXJpbmc6ICVzICIgLF9fZnVuY19fKTsKKyAgIHdkaVRTTVJlcVBhcmFtID0gKFdESV9UU01TdGF0c1JlcVBhcmFtc1R5cGUgKil2b3NfbWVtX21hbGxvYygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihXRElfVFNNU3RhdHNSZXFQYXJhbXNUeXBlKSk7CisgICBpZihOVUxMID09IHdkaVRTTVJlcVBhcmFtKSAKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogVk9TIE1FTSBBbGxvYyBGYWlsdXJlIiwgX19mdW5jX18pOyAKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX05PTUVNOworICAgfQorICAgcFdkYVBhcmFtcyA9ICh0V0RBX1JlcVBhcmFtcyAqKXZvc19tZW1fbWFsbG9jKHNpemVvZih0V0RBX1JlcVBhcmFtcykpIDsKKyAgIGlmKE5VTEwgPT0gcFdkYVBhcmFtcykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogVk9TIE1FTSBBbGxvYyBGYWlsdXJlIiwgX19mdW5jX18pOyAKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICB2b3NfbWVtX2ZyZWUod2RpVFNNUmVxUGFyYW0pOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9O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gV0RBX1NlbmRCZWFjb25QYXJhbXNDYWxsYmFjayhXRElfU3RhdHVzIHN0YXR1cywgdm9pZCogcFVzZXJEYXRhKQoreworCisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICI8LS0tLS0tICVzICIgLF9fZnVuY19fKTsKKyAgIHJldHVybiA7Cit9CisvKgorICogRlVOQ1RJT046IFdEQV9Qcm9jZXNzU2VuZEJlYWNvbgorICogUmVxdWVzdCB0byBXREkgdG8gc2VuZCB0aGUgYmVhY29uIHRlbXBsYXRlIHRvIEhBTCB0byB1cGRhdGUgdGhlIFRQRSBtZW1vcnkgYW5kIAorICogc3RhcnQgYmVhY29uIHRyYXNtaXNzaW9uCisgKi8gCitWT1NfU1RBVFVTIFdEQV9Qcm9jZXNzU2VuZEJlYWNvbih0V0RBX0NiQ29udGV4dCAqcFdEQSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2VuZGJlYWNvblBhcmFtcyAqcFNlbmRiZWFjb25QYXJhbXMpCit7CisgICBXRElfU3RhdHVzIHN0YXR1cyA9IFdESV9TVEFUVVNfU1VDQ0VTUyA7CisgICBXRElfU2VuZEJlYWNvblBhcmFtc1R5cGUgd2RpU2VuZEJlYWNvblJlcVBhcmFtOyAKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIi0tLS0tLT4gJXMgIiAsX19mdW5jX18pOworICAgdm9zX21lbV9jb3B5KHdkaVNlbmRCZWFjb25SZXFQYXJhbS53ZGlTZW5kQmVhY29uUGFyYW1zSW5mby5tYWNCU1NJRCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2VuZGJlYWNvblBhcmFtcy0+YnNzSWQsIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgd2RpU2VuZEJlYWNvblJlcVBhcmFtLndkaVNlbmRCZWFjb25QYXJhbXNJbmZvLmJlYWNvbkxlbmd0aCA9IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlbmRiZWFjb25QYXJhbXMtPmJlYWNvbkxlbmd0aDsKKyAgIHdkaVNlbmRCZWFjb25SZXFQYXJhbS53ZGlTZW5kQmVhY29uUGFyYW1zSW5mby50aW1JZU9mZnNldCA9IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlbmRiZWFjb25QYXJhbXMtPnRpbUllT2Zmc2V0OworICAgLyogcDJwSWVPZmZzZXQgc2hvdWxkIGJlIGF0bGVhc3QgZ3JlYXRlciB0aGFuIHRpbUllT2Zmc2V0ICovCisgICBpZiAoKHBTZW5kYmVhY29uUGFyYW1zLT5wMnBJZU9mZnNldCAhPSAwKSAmJgorICAgICAgICAgICAocFNlbmRiZWFjb25QYXJhbXMtPnAycEllT2Zmc2V0IDwKKyAgICAgICAgICAgIHBTZW5kYmVhY29uUGFyYW1zLT50aW1JZU9mZnNldCkpCisgICB7CisgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIkludmFsaWQgcDJwSWVPZmZzZXQgPSAlaHUgIiwgcFNlbmRiZWFjb25QYXJhbXMtPnAycEllT2Zmc2V0KTsKKyAgICAgICB2b3NfbWVtX2ZyZWUocFNlbmRiZWFjb25QYXJhbXMpOworICAgICAgIFZPU19BU1NFUlQoIDAgKTsKKyAgICAgICByZXR1cm4gV0RJX1NUQVRVU19FX0ZBSUxVUkU7CisgICB9CisgICB3ZGlTZW5kQmVhY29uUmVxUGFyYW0ud2RpU2VuZEJlYWNvblBhcmFtc0luZm8udXNQMlBJZU9mZnNldCA9IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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F4VHhQb3dlclJzcE1zZyAqIHB3ZGlTZXRNYXhUeFBvd2VyUnNwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogcFVzZXJEYXRhKQoreworICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKilwVXNlckRhdGE7CisgICB0V0RBX0NiQ29udGV4dCAqcFdEQSA9IE5VTEw7CisgICB0TWF4VHhQb3dlclBhcmFtcyAqcE1heFR4UG93ZXJQYXJhbXMgPSBOVUxMOyAKKyAgIAorICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiPC0tLS0tLSAlcyAiICxfX2Z1bmNfXyk7CisgICBpZihOVUxMID09IHBXZGFQYXJhbXMpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICIlczogcFdkYVBhcmFtcyByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKSA7CisgICAgICByZXR1cm4gOworICAgfQorICAgcFdEQSA9ICh0V0RBX0NiQ29udGV4dCAqKSBwV2RhUGFyYW1zLT5wV2RhQ29udGV4dDsKKyAgIGlmIChOVUxMID09IHBXREEpCisgICB7CisgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIiVzOnBXREEgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcy0+d2RhV2RpQXBpTXNnUGFyYW0pOworICAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zL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ICAgICAgICIlczogVk9TIE1FTSBBbGxvYyBGYWlsdXJlIiwgX19mdW5jX18pOyAKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX05PTUVNOworICAgfQorICAgcFdkYVBhcmFtcyA9ICh0V0RBX1JlcVBhcmFtcyAqKXZvc19tZW1fbWFsbG9jKHNpemVvZih0V0RBX1JlcVBhcmFtcykpIDsKKyAgIGlmKE5VTEwgPT0gcFdkYVBhcmFtcykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogVk9TIE1FTSBBbGxvYyBGYWlsdXJlIiwgX19mdW5jX18pOworICAgICAgdm9zX21lbV9mcmVlKHdkaVNldE1heFR4UG93ZXJQYXJhbXMpOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfTk9NRU07CisgICB9CisgICAvKiBDb3B5Lk1heC5UeC5Qb3dlciBQYXJhbXMgdG8gV0RJIHN0cnVjdHVyZSAqLworICAgdm9zX21lbV9jb3B5KHdkaVNldE1heFR4UG93ZXJQYXJhbXMtPndkaU1heFR4UG93ZXJJbmZvLm1hY0JTU0lkLAorICAgICAgICAgICAgICAgICBNYXhUeFBvd2VyUGFyYW1zLT5ic3NJZCwgCisgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgdm9zX21lbV9jb3B5KHdkaVNldE1heFR4UG93ZXJQYXJhbXMtPndkaU1heFR4UG93ZXJJbmZvLm1hY1NlbGZTdGFNYWNBZGRyLAorICAgICAgICAgICAgICAgICBNYXhUeFBvd2VyUGFyYW1zLT5zZWxmU3RhTWFjQWRkciwgCisgICAgICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgd2RpU2V0TWF4VHhQb3dlclBhcmFt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sIFdEQV9TRVRfTUFYX1RYX1BPV0VSX1JTUCwgTWF4VHhQb3dlclBhcmFtcyAsIDApIDsKKyAgIH0KKyAgIHJldHVybiBDT05WRVJUX1dESTJWT1NfU1RBVFVTKHN0YXR1cyk7CisgICAKK30KKyNlbmRpZgorCisvKgorICogRlVOQ1RJT046IFdEQV9TZXRNYXhUeFBvd2VyUGVyQmFuZENhbGxCYWNrCisgKiBzZW5kIHRoZSByZXNwb25zZSB0byBQRSB3aXRoIHBvd2VyIHZhbHVlIHJlY2VpdmVkIGZyb20gV0RJCisgKi8KK3ZvaWQgV0RBX1NldE1heFR4UG93ZXJQZXJCYW5kQ2FsbEJhY2soV0RJX1NldE1heFR4UG93ZXJQZXJCYW5kUnNwTXNnCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpwd2RpU2V0TWF4VHhQb3dlclBlckJhbmRSc3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQqIHBVc2VyRGF0YSkKK3sKKyAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zID0gKHRXREFfUmVxUGFyYW1zICopcFVzZXJEYXRhOworICAgdFdEQV9DYkNvbnRleHQgKnBXREEgPSBOVUxMOworICAgdE1heFR4UG93ZXJQZXJCYW5kUGFyYW1zICpwTXhUeFB3clBlckJhbmRQYXJhbXMgPSBOVUxMOworCisgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICI8LS0tLS0tICVzICIsIF9fZnVuY19fKTsKKyAgIGlmIChOVUxMID09IHBXZGFQYXJhbXMpCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IHBXZGFQYXJhbXMgcmVjZWl2ZWQgTlVMTCIsIF9fZnVuY19fKTsKKyAgIC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LlBvd2VyLlBlci5CYW5kIFBhcmFtcyB0byBXREkgc3RydWN0dXJlICovCisgICB3ZGlTZXRNeFR4UHdyUGVyQmFuZFBhcmFtcy0+d2RpTWF4VHhQb3dlclBlckJhbmRJbmZvLmJhbmRJbmZvID0gXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1heFR4UG93ZXJQZXJCYW5kUGFyYW1zLT5iYW5kSW5mbzsKKyAgIHdkaVNldE14VHhQd3JQZXJCYW5kUGFyYW1zLT53ZGlNYXhUeFBvd2VyUGVyQmFuZEluZm8udWNQb3dlciA9IFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNYXhUeFBvd2VyUGVyQmFuZFBhcmFtcy0+cG93ZXI7CisgICB3ZGlTZXRNeFR4UHdyUGVyQmFuZFBhcmFtcy0+d2RpUmVxU3RhdHVzQ0IgPSBOVUxMOworICAgcFdkYVBhcmFtcy0+cFdkYUNvbnRleHQgPSBwV0RBOworICAgcFdkYVBhcmFtcy0+d2RhTXNnUGFyYW0gPSAodm9pZCAqKU1heFR4UG93ZXJQZXJCYW5kUGFyYW1zOworICAgLyogc3RvcmUgUGFyYW1zIHBhc3MgaXQgdG8gV0RJICovCisgICBwV2RhUGFyYW1zLT53ZGFXZGlBcGlNc2dQYXJhbSA9ICh2b2lkICopd2RpU2V0TXhUeFB3clBlckJhbmRQYXJhbXM7CisgICBzdGF0dXMgPSBXRElfU2V0TWF4VHhQb3dlclBlckJhbmRSZXEod2RpU2V0TXhUeFB3clBlckJhbmRQYXJhbXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0RBX1NldE1heFR4UG93ZXJQZXJCYW5kQ2FsbEJhY2ssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFdkYVBhcmFtcyk7CisgICBpZiAoSVNfV0RJX1NUQVRVU19GQUlMVVJFKHN0YXR1cykpCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVM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tc1R5cGUgKndkaVNldFR4UG93ZXJQYXJhbXMgPSBOVUxMOworICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgPSBOVUxMOworCisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICItLS0tLS0+ICVzICIsIF9fZnVuY19fKTsKKworICAgd2RpU2V0VHhQb3dlclBhcmFtcyA9IChXRElfU2V0VHhQb3dlclBhcmFtc1R5cGUgKil2b3NfbWVtX21hbGxvYygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihXRElfU2V0VHhQb3dlclBhcmFtc1R5cGUpKTsKKyAgIGlmKE5VTEwgPT0gd2RpU2V0VHhQb3dlclBhcmFtcykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogVk9TIE1FTSBBbGxvYyBGYWlsdXJlIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfTk9NRU07CisgICB9CisgICBwV2RhUGFyYW1zID0gKHRXREFfUmVxUGFyYW1zICopdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRXREFfUmVxUGFyYW1zKSkgOworICAgaWYoTlVMTCA9PSBwV2RhUGFyYW1zKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsKKyAgICAgIHZvc19tZW1fZnJlZSh3ZGlTZXRUeFBvd2VyUGFyYW1zKTs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VTEw7CisKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIi0tLS0tLT4gJXMgIiAsX19mdW5jX18pOworICAgaWYoTlVMTCA9PSB3ZGlTZXRQMlBHT05PQVJlcVBhcmFtKSAKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogVk9TIE1FTSBBbGxvYyBGYWlsdXJlIiwgX19mdW5jX18pOyAKKyAgICAgIHZvc19tZW1fZnJlZShwUDJwUHNDb25maWdQYXJhbXMpOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfTk9NRU07CisgICB9CisKKyAgIHBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKil2b3NfbWVtX21hbGxvYyhzaXplb2YodFdEQV9SZXFQYXJhbXMpKSA7CisgICBpZihOVUxMID09IHBXZGFQYXJhbXMpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsKKyAgICAgIHZvc19tZW1fZnJlZShwUDJwUHNDb25maWdQYXJhbXMpOworICAgICAgdm9zX21lbV9mcmVlKHdkaVNldFAyUEdPTk9BUmVxUGFyYW0pOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfTk9NRU07CisgICB9CisKKyAgIHdkaVNldFAyUEdPTk9BUmVxUGFyYW0tPndkaVAyUEdPTk9BSW5mby51Y09wcF9wcyA9IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFAycFBzQ29uZmlnUGFyYW1zLT5vcHBfcHM7CisgICB3ZGlTZXRQMlBHT05PQVJlcVBhcmFtLT53ZGlQMlBHT05PQUluZm8udUN0V2luZG93ID0gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUDJwUHNDb25maWdQYXJhbXMtPmN0V2luZG93OworICAgd2RpU2V0UDJQR09OT0FSZXFQYXJhbS0+d2RpUDJQR09OT0FJbmZvLnVjQ291bnQgPSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQMnBQc0NvbmZpZ1BhcmFtcy0+Y291bnQ7CisgICB3ZGlTZXRQMlBHT05PQVJlcVBhcmFtLT53ZGlQMlBHT05PQUluZm8udUR1cmF0aW9uID0gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUDJwUHNDb25maWdQYXJhbXMtPmR1cmF0aW9uOworICAgd2RpU2V0UDJQR09OT0FSZXFQYXJhbS0+d2RpUDJQR09OT0FJbmZvLnVJbnRlcnZhbCA9IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFAycFBzQ29uZmlnUGFyYW1zLT5pbnRlcnZhbDsKKyAgIHdkaVNldFAyUEdPTk9BUmVxUGFyYW0tPndkaVAyUEdPTk9BSW5mby51U2luZ2xlX25vYV9kdXJhdGlvbiA9IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFAycFBzQ29uZmlnUGFyYW1zLT5zaW5nbGVfbm9hX2R1cmF0aW9uOworICAgd2RpU2V0UDJQR09OT0FSZXFQYXJhbS0+d2RpUDJQR09OT0FJbmZvLnVjUHNTZWxlY3Rpb24gPSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQMnBQc0NvbmZpZ1BhcmFtcy0+cHNTZWxlY3Rpb247CisKKyAgIHdkaVNldFAyUEdPTk9BUmVxUGFyYW0tPndka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YUNvbnRleHQ7CisKKyAgIGlmIChOVUxMID09IHBXREEpCisgICB7CisgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIiVzOnBXREEgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcy0+d2RhV2RpQXBpTXNnUGFyYW0pOworICAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zLT53ZGFNc2dQYXJhbSk7CisgICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMpOworICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgcmV0dXJuIDsKKyAgIH0KKworICAgcFRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zID0gKHRUZGxzTGlua0VzdGFibGlzaFBhcmFtcyAqKXBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtIDsKKyAgIGlmKCBOVUxMID09IHBUZGxzTGlua0VzdGFibGlzaFBhcmFtcyApCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IHBUZGxzTGlua0VzdGFibGlzaFBhcmFtcyAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAicmVjZWl2ZWQgTlVMTCAiICxfX2Z1bmNfXyk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYVdkaUFwaU1zZ1BhcmFtKTsKKyAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zKTsKKyAgICAgIHJldHVybiA7CisgICB9CisgICBwVGRsc0xpbmtFc3RhYmxpc2hQYXJhbXMtPnN0YXR1cyA9IENPTlZFUlRfV0RJMlNJUl9TVEFUVVMoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkaVNldFRkbHNMaW5rRXN0YWJsaXNoUmVxUnNwLT53ZGlTdGF0dXMpOworICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYVdkaUFwaU1zZ1BhcmFtKSA7CisgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcyk7CisgICAvKiBzZW5kIHJlc3BvbnNlIHRvIFVNQUMqLworICAgV0RBX1NlbmRNc2cocFdEQSwgV0RBX1NFVF9URExTX0xJTktfRVNUQUJMSVNIX1JFUV9SU1AsIHBUZGxzTGlua0VzdGFibGlzaFBhcmFtcywgMCkgOworCisgICByZXR1cm4gOworfQorCitWT1NfU1RBVFVTIFdEQV9Qcm9jZXNzU2V0VGRsc0xpbmtFc3RhYmxpc2hSZXEodFdEQV9DYkNvbnRleHQgKnBXREEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zICpwVGRsc0xpbmtFc3RhYmxpc2hQYXJhbXMpCit7CisgICAgV0RJX1N0YXR1cyBzdGF0dXMgPSBXRElfU1RBVFVTX1NVQ0NFU1MgOworICAgIFdESV9TZXRURExTTGlua0VzdGFibGlzaFJlcVBhcmFtc1R5cGUgKndkaVNldFRETFNMaW5rRXN0YWJsaXNoUmVxUGFyYW0gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV0RJX1NldFRETFNMaW5rRXN0YWJsaXNoUmVxUGFyYW1zVHlwZSAqKXZvc19tZW1fbWFsbG9jKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihXRElfU2V0VERMU0xpbmtFc3RhYmxpc2hSZXFQYXJhbXNUeXBlKSkgOworICAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zID0gTlVMTDsKKyAgICBWT1N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hYmxpc2hJbmZvLnVTdGFJZHggPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVGRsc0xpbmtFc3RhYmxpc2hQYXJhbXMtPnN0YUlkeDsKKyAgICB3ZGlTZXRURExTTGlua0VzdGFibGlzaFJlcVBhcmFtLT53ZGlURExTTGlua0VzdGFibGlzaEluZm8udUlzUmVzcG9uZGVyID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zLT5pc1Jlc3BvbmRlcjsKKyAgICB3ZGlTZXRURExTTGlua0VzdGFibGlzaFJlcVBhcmFtLT53ZGlURExTTGlua0VzdGFibGlzaEluZm8udVVhcHNkUXVldWVzID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zLT51YXBzZFF1ZXVlczsKKyAgICB3ZGlTZXRURExTTGlua0VzdGFibGlzaFJlcVBhcmFtLT53ZGlURExTTGlua0VzdGFibGlzaEluZm8udU1heFNwID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zLT5tYXhTcDsKKyAgICB3ZGlTZXRURExTTGlua0VzdGFibGlzaFJlcVBhcmFtLT53ZGlURExTTGlua0VzdGFibGlzaEluZm8udUlzQnVmU3RhID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zLT5pc0J1ZnN0YTsKKyAgICB3ZGlTZXRURExTTGlua0VzdGFibGlzaFJlcVBhcmFtLT53ZGlURExTTGlua0VzdGFibGlzaEluZm8udUlzT2ZmQ2hhbm5lbFN1cHBvcnRlZCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zLT5pc09mZkNoYW5uZWxTdXBwb3J0ZWQ7CisKKyAgICB2b3NfbWVtX2NvcHkod2RpU2V0VERMU0xpbmtFc3RhYmxpc2hSZXFQYXJhbS0+d2RpVERMU0xpbmtFc3RhYmxpc2hJbmZvLnZhbGlkQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVGRsc0xpbmtFc3RhYmxpc2hQYXJhbXMtPnZhbGlkQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVGRsc0xpbmtFc3RhYmxpc2hQYXJhbXMtPnZhbGlkQ2hhbm5lbHNMZW4pOworCisgICAgd2RpU2V0VERMU0xpbmtFc3RhYmxpc2hSZXFQYXJhbS0+d2RpVERMU0xpbmtFc3RhYmxpc2hJbmZvLnZhbGlkQ2hhbm5lbHNMZW4gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZGxzTGlua0VzdGFibGlzaFBhcmFtcy0+dmFsaWRDaGFubmVsc0xlbjsKKworICAgIHZvc19tZW1fY29weSh3ZGlTZXRURExTTGlua0VzdGFibGlzaFJlcVBhcmFtLT53ZGlURExTTGlua0VzdGFibGlzaEluZm8udmFsaWRPcGVyQ2xhc3NlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZGxzTGlua0VzdGFibGlzaFBhcmFtcy0+dmFsaWRPcGVyQ2xhc3NlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZGxzTGlua0VzdGFibGlzaFBhcmFtcy0+dmFsaWRPcGVyQ2xhc3Nlc0xlbik7CisgICAgd2RpU2V0VERMU0xpbmtFc3RhYmxpc2hSZXFQYXJhbS0+d2RpVERMU0xpbmtFc3RhYmxpc2hJbmZvLnZhbGlkT3BlckNsYXNzZXNMZW4gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZGxzTGlua0VzdGFibGlzaFBhcmFtcy0+dmFsaWRPcGVyQ2xhc3Nlc0xlbjsKKworICAgIHdkaVNldFRETFNMaW5rRXN0YWJsaXNoUmVxUGFyYW0tPndkaVJlcVN0YXR1c0NCID0gTlVMTCA7CisgICAgLyogU3RvcmUgbXNnIHBvaW50ZXIgZnJvbSBQRSwgYXMgdGhpcyB3aWxsIGJlIHVzZWQgZm9yIHJlc3BvbnNlICovCisgICAgcFdkYVBhcmFtcy0+d2RhTXNnUGFyYW0gPSAodm9pZCAqKXBUZGxzTGlua0VzdGFibGlzaFBhcmFtcyA7CisgICAgLyogc3RvcmUgUGFyYW1zIHBhc3MgaXQgdG8gV0RJICovCisgICAgcFdkYVBhcmFtcy0+d2RhV2RpQXBpTXNnUGFyYW0gPSAodm9pZCAqKXdkaVNldFRETFNMaW5rRXN0YWJsaXNoUmVxUGFyYW0gOworICAgIHBXZGFQYXJhbXMtPnBXZGFDb250ZXh0ID0gcFdEQTsKKworICAgIHN0YXR1cyA9IFdESV9TZXRURExTTGlua0VzdGFibGlzaFJlcSh3ZGlTZXRURExTTGlua0VzdGFibGlzaFJlcVBhcmFtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV0RJX1NldFRETFNMaW5rRXN0YWJsaXNoUmVxUGFyYW1zUnNwQ2IpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdEQV9TZXRURExTTGlua0VzdGFibGlzaFJlcVBhcmFtc0NhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwV2RhUGFyYW1zKTsKKyAgICBpZihJU19XRElfU1RBVFVTX0ZBSUxVUkUoc3RhdHVzKSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIC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U1zZ1BhcmFtKTsKKyAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zKTsKKyAgICAgIHJldHVybiA7CisgICB9CisgICBwVGRsc0NoYW5Td2l0Y2hQYXJhbXMtPnN0YXR1cyA9IENPTlZFUlRfV0RJMlNJUl9TVEFUVVMoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkaVNldFRkbHNDaGFuU3dpdGNoUmVxUnNwLT53ZGlTdGF0dXMpOworICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYVdkaUFwaU1zZ1BhcmFtKSA7CisgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcyk7CisgICAvKiBzZW5kIHJlc3BvbnNlIHRvIFVNQUMqLworICAgV0RBX1NlbmRNc2cocFdEQSwgV0RBX1NFVF9URExTX0NIQU5fU1dJVENIX1JFUV9SU1AsIHBUZGxzQ2hhblN3aXRjaFBhcmFtcywgMCkgOworCisgICByZXR1cm4gOworfQorVk9TX1NUQVRVUyBXREFfUHJvY2Vzc1NldFRkbHNDaGFuU3dpdGNoUmVxKHRXREFfQ2JDb250ZXh0ICpwV0RBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRUZGxzQ2hhblN3aXRjaFBhcmFtcyAqcFRkbHNDaGFuU3dpdGNoUGFyYW1zKQoreworICAgIFdESV9TdGF0dXMgc3RhdHVzID0gV0RJX1NUQVRVU19TVUNDRVNTIDsKKyAgICBXRElfU2V0VERMU0NoYW5Td2l0Y2hSZXFQYXJhbXNUeXBlICp3ZGlTZXRURExTQ2hhblN3aXRjaFJlcVBhcmFtID0KKyAgICAgICAgICAgICAgICAgICAgICAgIChXRElfU2V0VERMU0NoYW5Td2l0Y2hSZXFQYXJhbXNUeXBlICopdm9zX21lbV9tYWxsb2MoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihXRElfU2V0VERMU0NoYW5Td2l0Y2h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isgICAgfQorICAgIHdkaVNldFRETFNDaGFuU3dpdGNoUmVxUGFyYW0tPndkaVRETFNDaGFuU3dpdGNoUmVxSW5mby5zdGFJZHggPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZGxzQ2hhblN3aXRjaFBhcmFtcy0+c3RhSWR4OworICAgIHdkaVNldFRETFNDaGFuU3dpdGNoUmVxUGFyYW0tPndkaVRETFNDaGFuU3dpdGNoUmVxSW5mby5pc09mZmNoYW5uZWxJbml0aWF0b3IgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZGxzQ2hhblN3aXRjaFBhcmFtcy0+dGRsc1N3TW9kZTsKKyAgICB3ZGlTZXRURExTQ2hhblN3aXRjaFJlcVBhcmFtLT53ZGlURExTQ2hhblN3aXRjaFJlcUluZm8udGFyZ2V0T3BlckNsYXNzID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVGRsc0NoYW5Td2l0Y2hQYXJhbXMtPm9wZXJDbGFzczsKKyAgICB3ZGlTZXRURExTQ2hhblN3aXRjaFJlcVBhcmFtLT53ZGlURExTQ2hhblN3aXRjaFJlcUluZm8udGFyZ2V0Q2hhbm5lbCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRkbHNDaGFuU3dpdGNoUGFyYW1zLT50ZGxzT2ZmQ2g7CisgICAgd2RpU2V0VERMU0NoYW5Td2l0Y2hSZXFQYXJhbS0+d2RpVERMU0NoYW5Td2l0Y2hSZXFJbmZvLnNlY29uZGFyeUNoYW5uZWxPZmZzZXQgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRkbHNDaGFuU3dpdGNoUGFyYW1zLT50ZGxzT2ZmQ2hCd09mZnNldDsKKworCisgICAgLyogU3RvcmUgbXNnIHBvaW50ZXIgZnJvbSBQRSwgYXMgdGhpcyB3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VBhcmFtcy0+c3RhdHVzW2ldID0gZUhBTF9TVEFUVVNfRkFJTFVSRSA7CisgICAgICB9CisKKyAgICAgIFdEQV9TZW5kTXNnKHBXZGFQYXJhbXMtPnBXZGFDb250ZXh0LCBXREFfQUdHUl9RT1NfUlNQLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopcEFnZ3JBZGRUc1JlcVBhcmFtcyAsIDApIDsKKyAgIH0KKyAgIHJldHVybiBDT05WRVJUX1dESTJWT1NfU1RBVFVTKHN0YXR1cykgOworfQorI2VuZGlmCisvKgorICogRlVOQ1RJT046IFdEQV9FbnRlckltcHNSc3BDYWxsYmFjaworICogc2VuZCBFbnRlciBJTVBTIFJTUCBiYWNrIHRvIFBFCisgKi8gCit2b2lkIFdEQV9FbnRlckltcHNSc3BDYWxsYmFjayhXRElfU3RhdHVzIHN0YXR1cywgdm9pZCogcFVzZXJEYXRhKQoreworICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKilwVXNlckRhdGE7CisgICB0V0RBX0NiQ29udGV4dCAqcFdEQSA9IE5VTEw7CisKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIjwtLS0tLS0gJXMgc3RhdHVzPSVkIiAsX19mdW5jX18sc3RhdHVzKTsKKyAgIGlmKE5VTEwgPT0gcFdkYVBhcmFtcykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBwV2RhUGFyYW1zIHJlY2VpdmVkIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuOworICAgfQorCisgICBwV0RBID0gKHRXREFfQ2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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICItLS0tLS0+ICVzICIgLF9fZnVuY19fKTsKKyAgIGlmICgoTlVMTCA9PSBwV0RBKSB8fCAoTlVMTCA9PSBwRW50ZXJCbXBzUmVxUGFyYW1zKSkKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogaW52YWxpZCBwYXJhbSIsIF9fZnVuY19fKTsKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICB9CisgICB3ZGlFbnRlckJtcHNSZXFQYXJhbXMgPSB2b3NfbWVtX21hbGxvYyhzaXplb2YoV0RJX0VudGVyQm1wc1JlcVBhcmFtc1R5cGUpKTsKKyAgIGlmIChOVUxMID09IHdkaUVudGVyQm1wc1JlcVBhcmFtcykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogVk9TIE1FTSBBbGxvYyBGYWlsdXJlIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIFdEQV9TZW5kTXNnKHBXREEsIFdEQV9FTlRFUl9CTVBTX1JTUCwgTlVMTCAsCisgICAgICAgICBDT05WRVJUX1dESTJTSVJfU1RBVFVTKFdESV9TVEFUVVNfTUVNX0ZBSUxVUkUpKSA7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX05PTUVNOworICAgfQorICAgcFdkYVBhcmFtcyA9ICh0V0RBX1JlcVBhcmFtcyAqKXZvc19tZW1fbWFsbG9jKHNpemVvZih0V0RBX1JlcVBhcmFtcykpOworICAgaWYgKE5VTEwgPT0gcFdkYVBhcmFtcykKKyAgIHs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BFeGl0VWFwc2RQYXJhbXMpCit7CisgICBXRElfU3RhdHVzIHN0YXR1cyA9IFdESV9TVEFUVVNfU1VDQ0VTUyA7CisgICB0V0RBX1JlcVBhcmFtcyAqcFdkYVBhcmFtcyA7CisgICBXRElfRXhpdFVhcHNkUmVxUGFyYW1zVHlwZSAqd2RpRXhpdFVhcHNkUmVxUGFyYW1zID0gCisgICAgICAgICAgICAgICAgICAgICAgKFdESV9FeGl0VWFwc2RSZXFQYXJhbXNUeXBlICopdm9zX21lbV9tYWxsb2MoCisgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKFdESV9FeGl0VWFwc2RSZXFQYXJhbXNUeXBlKSkgOworCisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICItLS0tLS0+ICVzICIgLF9fZnVuY19fKTsKKworICAgaWYoTlVMTCA9PSB3ZGlFeGl0VWFwc2RSZXFQYXJhbXMpIAorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBWT1MgTUVNIEFsbG9jIEZhaWx1cmUiLCBfX2Z1bmNfXyk7IAorICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfTk9NRU07CisgICB9CisgICBwV2RhUGFyYW1zID0gKHRXREFfUmVxUGFyYW1zICopdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRXREFfUmVxUGFyYW1zKSkgOworICAgaWYoTlVMTCA9PSBwV2RhUGFyYW1zKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgIC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worICAgfQorCisgICB3ZGlHZXRGcmFtZUxvZ0luZm8gPSAoV0RJX0dldEZyYW1lTG9nUmVxSW5mb1R5cGUgKil2b3NfbWVtX21hbGxvYygKKyAgICAgICAgIHNpemVvZihXRElfR2V0RnJhbWVMb2dSZXFJbmZvVHlwZSkpOworICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiLS0tLS0tPiAlcyAiICxfX2Z1bmNfXyk7CisKKyAgIGlmKE5VTEwgPT0gd2RpR2V0RnJhbWVMb2dJbmZvKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBWT1MgTUVNIEFsbG9jIEZhaWx1cmUiLCBfX2Z1bmNfXyk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgdm9zX21lbV9mcmVlKHBHZXRGcmFtZUxvZyk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX05PTUVNOworICAgfQorCisgICBwV2RhUGFyYW1zID0gKHRXREFfUmVxUGFyYW1zICopdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRXREFfUmVxUGFyYW1zKSk7CisgICBpZihOVUxMID09IHBXZGFQYXJhbXMpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICB2b3NfbWVtX2ZyZWUod2RpR2V0RnJhbWVMb2dJbmZvKTsKKyAgICAgIHZvc19tZW1fZnJlZShwR2V0Rn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isgICAgeworICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsKKyAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgIHZvc19tZW1fZnJlZShwRmF0YWxFdmVudExvZ3NSZXFQYXJhbSk7CisgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9OT01FTTsKKyAgICB9CisgICAgcFdkYVBhcmFtcyA9ICh0V0RBX1JlcVBhcmFtcyAqKXZvc19tZW1fbWFsbG9jKHNpemVvZih0V0RBX1JlcVBhcmFtcykpIDsKKyAgICBpZihOVUxMID09IHBXZGFQYXJhbXMpCisgICAgeworICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsKKyAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgIHZvc19tZW1fZnJlZSh3ZGlGYXRhbEV2ZW50TG9nc1JlcUluZm8pOworICAgICAgIHZvc19tZW1fZnJlZShwRmF0YWxFdmVudExvZ3NSZXFQYXJhbSk7CisgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9OT01FTTsKKyAgICB9CisgICAgd2RpRmF0YWxFdmVudExvZ3NSZXFJbmZvLT5yZWFzb25fY29kZSA9IHBGYXRhbEV2ZW50TG9nc1JlcVBhcmFtLT5yZWFzb25fY29kZTsKKyAgICBwV2RhUGFyYW1zLT5wV2RhQ29udGV4dCA9IHBXREE7CisgICAgcFdkYVBhcmFtcy0+d2RhTXNnUGFyYW0gPSBwRmF0YWxFdmVudExvZ3NSZXFQYXJhbTsKKyAgICBwV2RhUGFyYW1zLT53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NfU1RBVFVTIHN0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgIFdESV9TdGF0dXMgd3N0YXR1czsKKyAgIFdESV9GV0xvZ2dpbmdJbml0UmVxSW5mb1R5cGUgKndkaUZXTG9nZ2luZ0luaXRJbmZvOworICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgOworCisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICItLS0tLS0+ICVzICIgLF9fZnVuY19fKTsKKworICAgLyogU2FuaXR5IENoZWNrKi8KKyAgIGlmKE5VTEwgPT0gcEZXTG9nZ2luZ0luaXRQYXJhbSkKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogcEZXTG9nZ2luZ0luaXRQYXJhbSByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKSA7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgfQorCisgICB3ZGlGV0xvZ2dpbmdJbml0SW5mbyA9IChXRElfRldMb2dnaW5nSW5pdFJlcUluZm9UeXBlICopdm9zX21lbV9tYWxsb2MoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoV0RJX0ZXTG9nZ2luZ0luaXRSZXFJbmZvVHlwZSkpOworICAgaWYoTlVMTCA9PSB3ZGlGV0xvZ2dpbmdJbml0SW5mbykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogVk9TIE1FTSBBbG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29udGludW91c0ZyYW1lTG9nZ2luZyA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRldMb2dnaW5nSW5pdFBhcmFtLT5jb250aW51b3VzRnJhbWVMb2dnaW5nOworICAgd2RpRldMb2dnaW5nSW5pdEluZm8tPm1pbkxvZ0J1ZmZlclNpemU9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRldMb2dnaW5nSW5pdFBhcmFtLT5taW5Mb2dCdWZmZXJTaXplOworICAgd2RpRldMb2dnaW5nSW5pdEluZm8tPm1heExvZ0J1ZmZlclNpemU9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRldMb2dnaW5nSW5pdFBhcmFtLT5tYXhMb2dCdWZmZXJTaXplOworCisgICBwV2RhUGFyYW1zLT5wV2RhQ29udGV4dCA9IHBXREE7CisgICBwV2RhUGFyYW1zLT53ZGFNc2dQYXJhbSA9IHBGV0xvZ2dpbmdJbml0UGFyYW07CisgICBwV2RhUGFyYW1zLT53ZGFXZGlBcGlNc2dQYXJhbSA9ICh2b2lkICopd2RpRldMb2dnaW5nSW5pdEluZm87CisKKyAgIHdzdGF0dXMgPSBXRElfRldMb2dnaW5nSW5pdFJlcSh3ZGlGV0xvZ2dpbmdJbml0SW5mbywKKyAgICAgICAgICAgICAgICAgICAgICAgKFdESV9GV0xvZ2dpbmdJbml0UnNwQ2IpV0RBX0ZXTG9nZ2luZ0luaXRSc3BDYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgIHBXZGFQYXJhbXMpOworICAgaWYoSVNfV0RJX1NUQVRVU19GQUlMVVJFKHdzdGF0dXMpKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAiRmFpbHVyZSBpbiBNZ210IExvZ2dpbmcgaW5pdCBSRVEgV0RJIEFQSSwgZnJlZSBhbGwgdGhlIG1lbW9yeSIgKTsKKyAgICAgIHN0YXR1cyA9IENPTlZFUlRfV0RJMlZPU19TVEFUVVMod3N0YXR1cyk7CisgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcy0+d2RhV2RpQXBpTXNnUGFyYW0pIDsKKyAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zLT53ZGFNc2dQYXJhbSk7CisgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcyk7CisgICB9CisKKyAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qCisgKiBGVU5DVElPTjogV0RBX1dkaUluZGljYXRpb25DYWxsYmFjaworICogCisgKi8gCit2b2lkIFdEQV9XZGlJbmRpY2F0aW9uQ2FsbGJhY2soIFdESV9TdGF0dXMgICB3ZGlTdGF0dXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQqICAgICAgICBwVXNlckRhdGEpCit7CisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICI8LS0tLS0tICVzICIgLF9fZnVuY19fKTsKK30KKy8qCisgKiBGVU5DVElPTjogV0RBX1Byb2Nlc3NXbGFuU3VzcGVuZEluZAorICogCisgKi8gCitWT1NfU1RBVFVTIFdEQV9Qcm9jZXNzV2xhblN1c3BlbmRJbmQodFdEQV9DYkNvbnRleHQgKnBXREEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyV2xhblN1c3BlbmRQYXJhbSAqcFdsYW5TdXNwZW5kUGFyYW0pCit7CisgICBXRElfU3RhdHVzIHdkaVN0YXR1czsKKyAgIFdESV9TdXNwZW5kUGFyYW1zVHlwZSB3ZGlTdXNwZW5kUGFyYW1zOworICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgIC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lUGFyYW0pCit7CisgICBXRElfU3RhdHVzIHdkaVN0YXR1czsKKyAgIFdESV9SZXN1bWVQYXJhbXNUeXBlICp3ZGlSZXN1bWVQYXJhbXMgPSAKKyAgICAgICAgICAgIChXRElfUmVzdW1lUGFyYW1zVHlwZSAqKXZvc19tZW1fbWFsbG9jKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKFdESV9SZXN1bWVQYXJhbXNUeXBlKSApIDsKKyAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zIDsKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIi0tLS0tLT4gJXMgIiAsX19mdW5jX18pOworICAgaWYoTlVMTCA9PSB3ZGlSZXN1bWVQYXJhbXMpIAorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBWT1MgTUVNIEFsbG9jIEZhaWx1cmUiLCBfX2Z1bmNfXyk7IAorICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfTk9NRU07CisgICB9CisgICBwV2RhUGFyYW1zID0gKHRXREFfUmVxUGFyYW1zICopdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRXREFfUmVxUGFyYW1zKSkgOworICAgaWYoTlVMTCA9PSBwV2RhUGFyYW1zKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBWT1MgTUVNIEFsbG9jIEZhaWx1cmUiLCBfX2Z1bmNfXyk7IAorICAgICAgVk9TX0FTU0VSVC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AgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuOworICAgfQorCisgICBpZihJU19XRElfU1RBVFVTX0ZBSUxVUkUod2RpU3RhdHVzKSkKKyAgIHsKKyAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zLT53ZGFXZGlBcGlNc2dQYXJhbSk7CisgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcy0+d2RhTXNnUGFyYW0pOworICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMpOworICAgfQorCisgICByZXR1cm47Cit9CisvKgorICogRlVOQ1RJT046IFdEQV9TZXRCZWFjb25GaWx0ZXJSZXEKKyAqIFJlcXVlc3QgdG8gV0RJIHRvIHNlbmQgdGhlIGJlYWNvbiBmaWx0ZXJpbmcgcmVsYXRlZCBpbmZvcm1hdGlvbi4KKyAqLyAKK1ZPU19TVEFUVVMgV0RBX1NldEJlYWNvbkZpbHRlclJlcSh0V0RBX0NiQ29udGV4dCAqcFdEQSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEJlYWNvbkZpbHRlck1zZyogcEJlYWNvbkZpbHRlckluZm8pCit7CisgICBXRElfU3RhdHVzIHN0YXR1cyA9IFdESV9TVEFUVVNfU1VDQ0VTUzsKKyAgIHRBTklfVTggICAgICAgICAgICAqZHN0UHRyLCAqc3JjUHRyOworICAgdEFOSV9VOCAgICAgICAgICAgICBmaWx0ZXJMZW5ndGg7CisgICBXRElfQmVhY29uRmlsdGVyUmVxUGFyYW1zVHlwZSAqd2RpQmVhY29uRmlsdGVySW5mbyA9IAorICAgICAgICAgICAgKFdESV9CZWFjb25GaWx0ZXJSZXFQYXJhbXNUeXBlICopdm9zX21lbV9tYWxsb2MoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoV0RJX0JlYWNvbkZpbHRlclJlcVBhcmFtc1R5cGUpICkgOworICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgOworICAgVk9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ICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgOworCisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICItLS0tLS0+ICVzICIgLF9fZnVuY19fKTsKKyAgIGlmKE5VTEwgPT0gd2RpQmVhY29uRmlsdGVySW5mbykgCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsgCisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9OT01FTTsKKyAgIH0KKyAgIHBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKil2b3NfbWVtX21hbGxvYyhzaXplb2YodFdEQV9SZXFQYXJhbXMpKSA7CisgICBpZihOVUxMID09IHBXZGFQYXJhbXMpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsgCisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgdm9zX21lbV9mcmVlKHdkaUJlYWNvbkZpbHRlckluZm8pOworICAgICAgdm9zX21lbV9mcmVlKHBCZWFjb25GaWx0ZXJJbmZvKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfTk9NRU07CisgICB9CisKKyAgIHdkaUJlYWNvbkZpbHRlckluZm8tPndkaUJlYWNvbkZpbHRlckluZm8udWNJZUNvdW50ID0KKyAgICAgIHBCZWFjb25GaWx0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ZGlIb3N0T2ZmbG9hZEluZm8ucGFyYW1zLmFIb3N0SXB2NkFkZHIsCisgICAgICAgICAgICAgICAgICAgcEhvc3RPZmZsb2FkUGFyYW1zLT5wYXJhbXMuaG9zdElwdjZBZGRyLAorICAgICAgICAgICAgICAgICAgIDE2KTsKKworI2lmZGVmIFdMQU5fTlNfT0ZGTE9BRAorICAgICAgICAgaWYocEhvc3RPZmZsb2FkUGFyYW1zLT5uc09mZmxvYWRJbmZvLnNyY0lQdjZBZGRyVmFsaWQpCisgICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkod2RpSG9zdE9mZmxvYWRJbmZvLT53ZGlOc09mZmxvYWRQYXJhbXMuc3JjSVB2NkFkZHIsCisgICAgICAgICAgICAgICAgICAgcEhvc3RPZmZsb2FkUGFyYW1zLT5uc09mZmxvYWRJbmZvLnNyY0lQdjZBZGRyLAorICAgICAgICAgICAgICAgICAgIDE2KTsKKyAgICAgICAgICAgIHdkaUhvc3RPZmZsb2FkSW5mby0+d2RpTnNPZmZsb2FkUGFyYW1zLnNyY0lQdjZBZGRyVmFsaWQgPSAxOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgd2RpSG9zdE9mZmxvYWRJbmZvLT53ZGlOc09mZmxvYWRQYXJhbXMuc3JjSVB2NkFkZHJWYWxpZCA9IDA7CisgICAgICAgICB9CisKKyAgICAgICAgIHZvc19tZW1fY29weSh3ZGlIb3N0T2ZmbG9hZEluZm8tPndkaU5zT2ZmbG9hZFBhcmFtcy5zZWxmSVB2NkFkZHIsCisgICAgICAgICAgICAgICAgICAgcEhvc3RPZmZsb2FkUGFyYW1zLT5uc09mZmxvYWRJbmZvLnNlbGZJUHY2QWRkciwKKyAgICAgICAgICAgICAgICAgICAxNik7CisgICAgICAgICB2b3NfbWVtX2NvcHkod2RpSG9zdE9mZmxvYWRJbmZvLT53ZGlOc09mZmxvYWRQYXJhbXMuc2VsZk1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgcEhvc3RPZmZsb2FkUGFyYW1zLT5uc09mZmxvYWRJbmZvLnNlbGZNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgIDYpOworCisgICAgICAgICAvL09ubHkgdHdvIGFyZSBzdXBwb3J0ZWQgc28gbGV0J3MgZ28gdGhyb3VnaCB0aGVtIHdpdGhvdXQgYSBsb29wCisgICAgICAgICBpZihwSG9zdE9mZmxvYWRQYXJhbXMtPm5zT2ZmbG9hZEluZm8udGFyZ2V0SVB2NkFkZHJWYWxpZFswXSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fY29weSh3ZGlIb3N0T2ZmbG9hZEluZm8tPndkaU5zT2ZmbG9hZFBhcmFtcy50YXJnZXRJUHY2QWRkcjEsCisgICAgICAgICAgICAgICAgICAgICAgcEhvc3RPZmZsb2FkUGFyYW1zLT5uc09mZmxvYWRJbmZvLnRhcmdldElQdjZBZGRyWzBdLAorICAgICAgICAgICAgICAgICAgICAgIDE2KTsKKyAgICAgICAgICAgIHdkaUhvc3RPZmZsb2FkSW5mby0+d2RpTnNPZmZsb2FkUGFyYW1zLnRhcmdldElQdjZBZGRyMVZhbGlkID0gMTsKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHdkaUhvc3RPZmZsb2FkSW5mby0+d2RpTnNPZmZsb2FkUGFyYW1zLnRhcmdldElQdjZBZGRyMVZhbGlkID0gMDsKKyAgICAgICAgIH0KKworICAgICAgICAgaWYocEhvc3RPZmZsb2FkUGFyYW1zLT5uc09mZmxvYWRJbmZvLnRhcmdldElQdjZBZGRyVmFsaWRbMV0pCisgICAgICAgICB7CisgICAgICAgICAgICB2b3NfbWVtX2NvcHkod2RpSG9zdE9mZmxvYWRJbmZvLT53ZGlOc09mZmxvYWRQYXJhbXMudGFyZ2V0SVB2NkFkZHIyLAorICAgICAgICAgICAgICAgICAgICAgIHBIb3N0T2ZmbG9hZFBhcmFtcy0+bnNPZmZsb2FkSW5mby50YXJnZXRJUHY2QWRkclsxXSwKKyAgICAgICAgICAgICAgICAgICAgICAxNik7CisgICAgICAgICAgICB3ZGlIb3N0T2ZmbG9hZEluZm8tPndkaU5zT2ZmbG9hZFBhcmFtcy50YXJnZXRJUHY2QWRkcjJWYWxpZCA9IDE7CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICB3ZGlIb3N0T2ZmbG9hZEluZm8tPndkaU5zT2ZmbG9hZFBhcmFtcy50YXJnZXRJUHY2QWRkcjJWYWxpZCA9IDA7CisgICAgICAgICB9CisgICAgICAgICB3ZGlIb3N0T2ZmbG9hZEluZm8tPndkaU5zT2ZmbG9hZFBhcmFtcy5zbG90SWR4ID0KKyAgICAgICAgICAgICAgICAgICAgICAgIHBIb3N0T2ZmbG9hZFBhcmFtcy0+bnNPZmZsb2FkSW5mby5zbG90SWR4OworICAgICAgICAgYnJlYWs7CisjZW5kaWYgLy9XTEFOX05TX09GRkxPQUQKKyAgICAgIGRlZmF1bHQ6CisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIk5vIEhhbmRsaW5nIGZvciBPZmZsb2FkIFR5cGUgJXggaW4gV0RBICIgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLCB3ZGlIb3N0T2ZmbG9hZEluZm8tPndkaUhvc3RPZmZsb2FkSW5mby51Y09mZmxvYWRUeXBlKTsKKyAgICAgICAgIC8vV0RBX1ZPU19BU1NFUlQoMCkgOworICAgICAgfQorICAgfQorICAgd2RpSG9zdE9mZmxvYWRJbmZvLT53ZGlSZXFTdGF0dXNDQiA9IFdEQV9Ib3N0T2ZmbG9hZFJlcUNhbGxiYWNrOworICAgd2RpSG9zdE9mZmxvYWRJbmZvLT5wVXNl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fbWVtX2ZyZWUocFdkYVBhcmFtcy0+d2RhTXNnUGFyYW0pOworICAgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcyk7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7CisKK30vKldEQV9LZWVwQWxpdmVSZXEqLworLyoKKyAqIEZVTkNUSU9OOiBXREFfV293bEFkZEJjUHRyblJlc3BDYWxsYmFjaworICogCisgKi8gCit2b2lkIFdEQV9Xb3dsQWRkQmNQdHJuUmVzcENhbGxiYWNrKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0RJX1dvd2xBZGRCY1B0cm5Sc3BQYXJhbXNUeXBlICpwV2RpV293bEFkZEJjc3RQdHJSc3AsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogcFVzZXJEYXRhKQoreworICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKilwVXNlckRhdGE7CisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICI8LS0tLS0tICVzICIgLF9fZnVuY19fKTsKKyAgIGlmKE5VTEwgPT0gcFdkYVBhcmFtcykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIiVzOiBwV2RhUGFyYW1zIHJlY2VpdmVkIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICBWT1NfQVNTRVJUKDApIDsKKyAgICAgIHJldHVybiA7CisgICB9CisgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcy0+d2RhV2RpQXBpTXNnUGFyYW0pOworICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtKTsKKyAgIHZvc19tZ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AgICAgIHBXb3dsQWRkQmNQdHJuUGFyYW1zLT51Y1BhdHRlcm5TaXplOworICAgaWYgKHdkaVdvd2xBZGRCY1B0cm5JbmZvLT53ZGlXb3dsQWRkQmNQdHJuSW5mby51Y1BhdHRlcm5TaXplIDw9IFdESV9XT1dMX0JDQVNUX1BBVFRFUk5fTUFYX1NJWkUpCisgICB7CisgICAgICAgdm9zX21lbV9jb3B5KHdkaVdvd2xBZGRCY1B0cm5JbmZvLT53ZGlXb3dsQWRkQmNQdHJuSW5mby51Y1BhdHRlcm4sCisgICAgICAgICAgICAgICAgICAgIHBXb3dsQWRkQmNQdHJuUGFyYW1zLT51Y1BhdHRlcm4sCisgICAgICAgICAgICAgICAgICAgIHdkaVdvd2xBZGRCY1B0cm5JbmZvLT53ZGlXb3dsQWRkQmNQdHJuSW5mby51Y1BhdHRlcm5TaXplKTsKKyAgICAgICB2b3NfbWVtX2NvcHkod2RpV293bEFkZEJjUHRybkluZm8tPndkaVdvd2xBZGRCY1B0cm5JbmZvLnVjUGF0dGVybk1hc2ssCisgICAgICAgICAgICAgICAgICAgIHBXb3dsQWRkQmNQdHJuUGFyYW1zLT51Y1BhdHRlcm5NYXNrLAorICAgICAgICAgICAgICAgICAgICB3ZGlXb3dsQWRkQmNQdHJuSW5mby0+d2RpV293bEFkZEJjUHRybkluZm8udWNQYXR0ZXJuTWFza1NpemUpOworICAgfQorICAgZWxzZQorICAgeworICAgICAgIHZvc19tZW1fY29weSh3ZGlXb3dsQWRkQmNQdHJuSW5mby0+d2RpV293bEFkZEJjUHRybkluZm8udWNQYXR0ZXJuLAorICAgICAgICAgICAgICAgICAgICBwV293bEFkZEJjUHRyblBhcmFtcy0+dWNQYXR0ZXJuLAorICAgICAgICAgICAgICAgICAgICBXRElfV09XTF9CQ0FTVF9QQVRURVJOX01BWF9TSVpFKTsKKyAgICAgICB2b3NfbWVtX2NvcHkod2RpV293bEFkZEJjUHRybkluZm8tPndkaVdvd2xBZGRCY1B0cm5JbmZvLn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GFyYW1zKSA7CisgICB9CisgICByZXR1cm4gc3RhdHVzOworCit9LypXREFfUHJvY2Vzc1dvd2xBZGRCY1B0cm5SZXEqLworLyoKKyAqIEZVTkNUSU9OOiBXREFfV293bERlbEJjUHRyblJlc3BDYWxsYmFjaworICogCisgKi8gCit2b2lkIFdEQV9Xb3dsRGVsQmNQdHJuUmVzcENhbGxiYWNrKAorICAgICAgICAgICAgICAgICAgICAgICAgV0RJX1dvd2xEZWxCY1B0cm5Sc3BQYXJhbXNUeXBlICpwV2RpV293bERlbEJjc3RQdHJSc3AsIAorICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogcFVzZXJEYXRhKQoreworICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKilwVXNlckRhdGE7CisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICI8LS0tLS0tICVzICIgLF9fZnVuY19fKTsKKyAgIGlmKE5VTEwgPT0gcFdkYVBhcmFtcykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIiVzOiBwV2RhUGFyYW1zIHJlY2VpdmVkIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICBWT1NfQVNTRVJUKDApIDsKKyAgICAgIHJldHVybiA7CisgICB9CisgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcy0+d2RhV2RpQXBpTXNnUGFyYW0pOworICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtKTsKKyAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zKSA7CisgICByZXR1cm4gOworfQorLyoKKyAqIEZVTkNUSU9OOiBXREFfV293bERlbEJjUHRybl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dHJuUmVxCisgKiBSZXF1ZXN0IHRvIFdESSB0byBkZWxldGUgV09XTCBCY2FzdCBwYXR0ZXJuCisgKi8gCitWT1NfU1RBVFVTIFdEQV9Qcm9jZXNzV293bERlbEJjUHRyblJlcSh0V0RBX0NiQ29udGV4dCAqcFdEQSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0U2lyV293bERlbEJjYXN0UHRybiAqcFdvd2xEZWxCY1B0cm5QYXJhbXMpCit7CisgICBWT1NfU1RBVFVTIHN0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgIFdESV9TdGF0dXMgd3N0YXR1czsKKyAgIFdESV9Xb3dsRGVsQmNQdHJuUmVxUGFyYW1zVHlwZSAqd2RpV293bERlbEJjUHRybkluZm8gPSAKKyAgICAgIChXRElfV293bERlbEJjUHRyblJlcVBhcmFtc1R5cGUgKil2b3NfbWVtX21hbGxvYygKKyAgICAgICAgIHNpemVvZihXRElfV293bERlbEJjUHRyblJlcVBhcmFtc1R5cGUpKSA7CisgICB0V0RBX1JlcVBhcmFtcyAqcFdkYVBhcmFtcyA7CisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICItLS0tLS0+ICVzICIgLF9fZnVuY19fKTsKKyAgIGlmKE5VTEwgPT0gd2RpV293bERlbEJjUHRybkluZm8pIAorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBWT1MgTUVNIEFsbG9jIEZhaWx1cmUiLCBfX2Z1bmNfXyk7IAorICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfTk9NRU07CisgICB9CisgICBwV2RhU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0sIHZvaWQqIHBVc2VyRGF0YSkKK3sKKyAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zID0gKHRXREFfUmVxUGFyYW1zICopcFVzZXJEYXRhOworICAgdFdEQV9DYkNvbnRleHQgKnBXREEgPSBOVUxMOworICAgdFNpckhhbFdvd2xFbnRlclBhcmFtcyAqcFdvd2xFbnRlclBhcmFtczsKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIjwtLS0tLS0gJXMgIiAsX19mdW5jX18pOworICAgaWYoTlVMTCA9PSBwV2RhUGFyYW1zKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAiJXM6IHBXZGFQYXJhbXMgcmVjZWl2ZWQgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgIFZPU19BU1NFUlQoMCkgOworICAgICAgcmV0dXJuIDsKKyAgIH0KKyAgIHBXREEgPSAodFdEQV9DYkNvbnRleHQgKilwV2RhUGFyYW1zLT5wV2RhQ29udGV4dCA7CisgICBpZiAoTlVMTCA9PSBwV0RBKQorICAgeworICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICIlczpwV0RBIGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisKKyAgICAgICBpZihwV2RhUGFyYW1zLT53ZGFXZGlBcGlNc2dQYXJhbSkKKyAgICAgICB7CisgICAgICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYVdkaUFwaU1zZ1BhcmFtKTsKKyAgICAgICB9CisgICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMpOworCisgICAgICAgVk9TX0FTU0VS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FTlRFUl9SU1AsICh2b2lkICopcFdvd2xFbnRlclBhcmFtcyAsIDApOworICAgfQorCisgICByZXR1cm47Cit9CisvKgorICogRlVOQ1RJT046IFdEQV9Qcm9jZXNzV293bEVudGVyUmVxCisgKiBSZXF1ZXN0IHRvIFdESSB0byBlbnRlciBXT1dMIAorICovIAorVk9TX1NUQVRVUyBXREFfUHJvY2Vzc1dvd2xFbnRlclJlcSh0V0RBX0NiQ29udGV4dCAqcFdEQSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJIYWxXb3dsRW50ZXJQYXJhbXMgKnBXb3dsRW50ZXJQYXJhbXMpCit7CisgICBWT1NfU1RBVFVTIHN0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUzsKKyAgIFdESV9TdGF0dXMgd3N0YXR1czsKKyAgIFdESV9Xb3dsRW50ZXJSZXFQYXJhbXNUeXBlICp3ZGlXb3dsRW50ZXJJbmZvID0gCisgICAgICAoV0RJX1dvd2xFbnRlclJlcVBhcmFtc1R5cGUgKil2b3NfbWVtX21hbGxvYygKKyAgICAgICAgIHNpemVvZihXRElfV293bEVudGVyUmVxUGFyYW1zVHlwZSkpIDsKKyAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zIDsKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIi0tLS0tLT4gJXMgIiAsX19mdW5jX18pOworICAgaWYoTlVMTCA9PSB3ZGlXb3dsRW50ZXJJbmZvKSAKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogVk9TIE1FTSBBbGxvYyBGYWlsdXJlIiwgX19mdW5jX18pOyAKKyAgICAgIFZPU19BU1NF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FeGl0UGFyYW1zOworICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIjwtLS0tLS0gJXMgIiAsX19mdW5jX18pOworICAgaWYoTlVMTCA9PSBwV2RhUGFyYW1zKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAiJXM6IHBXZGFQYXJhbXMgcmVjZWl2ZWQgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgIFZPU19BU1NFUlQoMCkgOworICAgICAgcmV0dXJuIDsKKyAgIH0KKyAgIHBXREEgPSAodFdEQV9DYkNvbnRleHQgKilwV2RhUGFyYW1zLT5wV2RhQ29udGV4dCA7CisgICBpZiAoTlVMTCA9PSBwV0RBKQorICAgeworICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICIlczpwV0RBIGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisKKyAgICAgICBpZihwV2RhUGFyYW1zLT53ZGFXZGlBcGlNc2dQYXJhbSkKKyAgICAgICB7CisgICAgICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYVdkaUFwaU1zZ1BhcmFtKTsKKyAgICAgICB9CisgICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMpOworCisgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICByZXR1cm4gOworICAgfQorCisgICBwV293bEV4aXRQYXJhbXMgPSAgKHRTaXJIYWxXb3dsRXhpdFBhcmFtcyAqKXBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtIDsKKworICAgcFdvd2xFeGl0UGFyYW1zLT5ic3NJZHggPSBwd2RpV293bEV4aX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U5DVElPTjogV0RBX1Byb2Nlc3NXb3dsRXhpdFJlcQorICogUmVxdWVzdCB0byBXREkgdG8gYWRkIFdPV0wgQmNhc3QgcGF0dGVybgorICovIAorVk9TX1NUQVRVUyBXREFfUHJvY2Vzc1dvd2xFeGl0UmVxKHRXREFfQ2JDb250ZXh0ICpwV0RBLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdFNpckhhbFdvd2xFeGl0UGFyYW1zICAqcFdvd2xFeGl0UGFyYW1zKQoreworICAgVk9TX1NUQVRVUyBzdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1M7CisgICBXRElfU3RhdHVzIHdzdGF0dXM7CisgICBXRElfV293bEV4aXRSZXFQYXJhbXNUeXBlICp3ZGlXb3dsRXhpdEluZm8gPSAKKyAgICAgIChXRElfV293bEV4aXRSZXFQYXJhbXNUeXBlICopdm9zX21lbV9tYWxsb2MoCisgICAgICAgICBzaXplb2YoV0RJX1dvd2xFeGl0UmVxUGFyYW1zVHlwZSkpIDsKKyAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zIDsKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIi0tLS0tLT4gJXMgIiAsX19mdW5jX18pOworICAgaWYoTlVMTCA9PSB3ZGlXb3dsRXhpdEluZm8pIAorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBWT1MgTUVNIEFsbG9jIEZhaWx1cmUiLCBfX2Z1bmNfXyk7IAorICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfTk9NRU07CisgICB9CisgICBwV2RhUGFyYW1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Ck7Cit9CisKKy8qCisgKiBGVU5DVElPTjogV0RBX0lzU2VsZlNUQQorICogUmVxdWVzdCB0byBXREkgdG8gZGV0ZXJtaW5lIHdoZXRoZXIgYSBnaXZlbiBTVEFJRCBpcyBzZWxmIHN0YXRpb24KKyAqIGluZGV4LgorICovCit2X0JPT0xfdCBXREFfSXNTZWxmU1RBKHZfUFZPSURfdCBwVm9zQ29udGV4dCwgdEFOSV9VOCB1Y1NUQUlkeCkKK3sKKworICB0V0RBX0NiQ29udGV4dCAqcFdEQSA9ICh0V0RBX0NiQ29udGV4dCAqKVZPU19HRVRfV0RBX0NUWFQocFZvc0NvbnRleHQpOworCisgIGlmIChOVUxMICE9IHBXREEpCisgICAgIHJldHVybiBXRElfSXNTZWxmU1RBKHBXREEtPnBXZGlDb250ZXh0LHVjU1RBSWR4KTsKKyAgZWxzZQorICAgICByZXR1cm4gVk9TX1RSVUU7Cit9CisvKgorICogRlVOQ1RJT046IFdEQV9OdkRvd25sb2FkUmVxQ2FsbGJhY2sKKyAqIHNlbmQgTlYgRG93bmxvYWQgUlNQIGJhY2sgdG8gUEUKKyAqLyAKK3ZvaWQgV0RBX052RG93bmxvYWRSZXFDYWxsYmFjayhXRElfTnZEb3dubG9hZFJzcEluZm9UeXBlICpwTnZEb3dubG9hZFJzcFBhcmFtcywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkKiBwVXNlckRhdGEpCit7CisKKyAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zPSAoIHRXREFfUmVxUGFyYW1zICopcFVzZXJEYXRhOworICAgdFdEQV9DYkNvbnRleHQgKnBXREEgPSBOVUxMOworCisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICI8LS0tLS0tICVzICIgLF9fZnVu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zZyk7CisKKyAgIHJldHVybiA7Cit9CisvKgorICogRlVOQ1RJT046IFdEQV9Qcm9jZXNzRmx1c2hBY1JlcQorICogUmVxdWVzdCB0byBXREkgdG8gVXBkYXRlIHRoZSBERUxCQSBSRVEgcGFyYW1zLgorICovIAorVk9TX1NUQVRVUyBXREFfUHJvY2Vzc0ZsdXNoQWNSZXEodFdEQV9DYkNvbnRleHQgKnBXREEsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEZsdXNoQUNSZXEgKnBGbHVzaEFjUmVxUGFyYW1zKQoreworICAgV0RJX1N0YXR1cyBzdGF0dXMgPSBXRElfU1RBVFVTX1NVQ0NFU1MgOworICAgV0RJX0ZsdXNoQWNSZXFQYXJhbXNUeXBlICp3ZGlGbHVzaEFjUmVxUGFyYW0gPSAKKyAgICAgICAgICAgICAgIChXRElfRmx1c2hBY1JlcVBhcmFtc1R5cGUgKil2b3NfbWVtX21hbGxvYygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihXRElfRmx1c2hBY1JlcVBhcmFtc1R5cGUpKSA7CisgICB0V0RBX1JlcVBhcmFtcyAqcFdkYVBhcmFtcyA7CisgICBpZihOVUxMID09IHdkaUZsdXNoQWNSZXFQYXJhbSkgCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsgCisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9OT01FTTsKKyAgIH0KKyAgIHBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKil2b3NfbWVtX21hbGxvYyhzaXplb2YodFdEQV9SZXFQYXJhbXMpKSA7CisgICBpZihOVUxMID09IHBXZGFQYXJhbXMp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Vc2VyRGF0YTsgCisgICB0V0RBX0NiQ29udGV4dCAqcFdEQSA9IE5VTEw7CisgICBXRElfQnRBbXBFdmVudFBhcmFtc1R5cGUgKndkaUJ0QW1wRXZlbnRQYXJhbTsKKworICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiPC0tLS0tLSAlcyAiICxfX2Z1bmNfXyk7CisgICBpZihOVUxMID09IHBXZGFQYXJhbXMpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICIlczogcFdkYVBhcmFtcyByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKSA7CisgICAgICByZXR1cm4gOworICAgfQorICAgcFdEQSA9ICh0V0RBX0NiQ29udGV4dCAqKXBXZGFQYXJhbXMtPnBXZGFDb250ZXh0OworICAgaWYgKE5VTEwgPT0gcFdEQSkKKyAgIHsKKyAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiJXM6cFdEQSBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zLT53ZGFNc2dQYXJhbSkgOworICAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zLT53ZGFXZGlBcGlNc2dQYXJhbSk7CisgICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMpIDsKKworICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgcmV0dXJuIDsKKyAgIH0KKworICAgd2RpQnRBbXBFdmVudFBhcmFtID0gKFdESV9CdEFtcEV2ZW50UGFyYW1zVHlwZSAqKXBXZG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V9TdGFydE9lbURhdGFSZXFDYWxsYmFjaygKKyAgICAgICAgICAgICAgICAgICBXRElfb2VtRGF0YVJzcFBhcmFtc1R5cGUgKndkaU9lbURhdGFSc3BQYXJhbXMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkKiBwVXNlckRhdGEpCit7CisgICBWT1NfU1RBVFVTIHN0YXR1cyA9IFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKilwVXNlckRhdGE7CisgICB0V0RBX0NiQ29udGV4dCAqcFdEQSA9IE5VTEw7CisgICB0U3RhcnRPZW1EYXRhUnNwICpwT2VtRGF0YVJzcFBhcmFtcyA9IE5VTEwgOworCisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICI8LS0tLS0tICVzICIgLF9fZnVuY19fKTsKKworICAgaWYoTlVMTCA9PSBwV2RhUGFyYW1zKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAiJXM6IHBXZGFQYXJhbXMgcmVjZWl2ZWQgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgIFZPU19BU1NFUlQoMCkgOworICAgICAgcmV0dXJuIDsKKyAgIH0KKyAgIHBXREEgPSAodFdEQV9DYkNvbnRleHQgKilwV2RhUGFyYW1zLT5wV2RhQ29udGV4dDsKKworICAgaWYgKE5VTEwgPT0gcFdEQSkKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIC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G9hZFJzcFBhcmFtcyAgKnB3ZGlHdGtPZmZsb2FkUnNwYXJhbXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogcFVzZXJEYXRhKQoreworICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKilwVXNlckRhdGE7CisKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIjwtLS0tLS0gJXMgIiAsX19mdW5jX18pOworICAgaWYoTlVMTCA9PSBwV2RhUGFyYW1zKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IHBXZGFQYXJhbXMgcmVjZWl2ZWQgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICByZXR1cm47CisgICB9CisKKyAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zLT53ZGFNc2dQYXJhbSkgOworICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYVdkaUFwaU1zZ1BhcmFtKTsKKyAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zKSA7CisKKyAgIC8vcHJpbnQgYSBtc2csIG5vdGhpbmcgZWxzZSB0byBkbworICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICJXREFfR1RLT2ZmbG9hZFJlc3BDYWxsYmFjayBpbnZva2VkICIgKTsKKworICAgcmV0dXJuIDsKK30KKy8qCisgKiBGVU5DVElPTjogV0RBX0dUS09mZmxvYWRSZXFDYWxsYmFjaworICogRnJlZSBtZW1vcnkuCisgKiBJ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VBhcmFtcyA9ICh0V0RBX1JlcVBhcmFtcyAqKXBVc2VyRGF0YTsKKyAgIHRXREFfQ2JDb250ZXh0ICpwV0RBOworICAgdHBTaXJHdGtPZmZsb2FkR2V0SW5mb1JzcFBhcmFtcyBwR3RrT2ZmbG9hZEdldEluZm9SZXE7CisgICB0cFNpckd0a09mZmxvYWRHZXRJbmZvUnNwUGFyYW1zIHBHdGtPZmZsb2FkR2V0SW5mb1JzcDsKKyAgIHZvc19tc2dfdCB2b3NNc2c7CisKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIjwtLS0tLS0gJXMgIiAsX19mdW5jX18pOworCisgICBpZihOVUxMID09IHBXZGFQYXJhbXMpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogcFdkYVBhcmFtcyByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybjsKKyAgIH0KKworICAgcEd0a09mZmxvYWRHZXRJbmZvUnNwID0gdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRTaXJHdGtPZmZsb2FkR2V0SW5mb1JzcFBhcmFtcykpOworICAgaWYoTlVMTCA9PSBwR3RrT2ZmbG9hZEdldEluZm9Sc3ApCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogdm9zX21lbV9tYWxsb2MgZmFpbGVkICIsIF9fZnVuY19fKTsKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICByZXR1cm47CisgICB9CisKKyAgIHBXREEgPSAodFdEQV9DYkNvb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T0RVTEVfSURfUEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopcE1hYyk7CisgICBpZihwVm9zQ29udGV4dCkKKyAgIHsKKyAgICAgIGlmIChwVm9zQ29udGV4dC0+aXNMb2dwSW5Qcm9ncmVzcykKKyAgICAgIHsKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6TE9HUCBpbiBQcm9ncmVzcy4gSWdub3JlISEhIiwgX19mdW5jX18pOworICAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9CVVNZOworICAgICAgfQorICAgfQorICAgZWxzZQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBDb250ZXh0IE51bGwiLCBfX2Z1bmNfXyk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX1JFU09VUkNFUzsKKyAgIH0KKworICAgaWYgKE5VTEwgPT0gcFZvc0NvbnRleHQtPnBXREFDb250ZXh0KQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBXREEgQ29udGV4dCBOdWxsIiwgX19mdW5jX18pOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9SRVNPVVJDRVM7CisgICB9CisgICBwV2RhUGFyYW1zID0gKHRXREFfSGFsRHVtcFJlcVBhcmFtcyAqKXZvc19tZW1fbWFsbG9jKHNpemVvZih0V0RBX0hhbER1bXBSZXFQYXJhbXMpKSA7CisgICBpZihOVUxMID09IHBXZGFQYXJhbX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gICAgICAgICAgICAgICAgICAgICAgICAgICBXREFfRFVNUENNRF9XQUlUX1RJTUVPVVQgKTsKKyAgICAgIGlmICggdlN0YXR1cyAhPSBWT1NfU1RBVFVTX1NVQ0NFU1MgKQorICAgICAgeworICAgICAgICAgaWYgKCB2U3RhdHVzID09IFZPU19TVEFUVVNfRV9USU1FT1VUICkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9WT1NTLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAiJXM6IFRpbWVvdXQgb2NjdXJyZWQgYmVmb3JlIFdEQV9IQUxEVU1QIGNvbXBsZXRlIixfX2Z1bmNfXyk7CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVk9TUywgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgIiVzOiBXREFfSEFMRFVNUCByZXBvcnRpbmcgIG90aGVyIGVycm9yIixfX2Z1bmNfXyk7CisgICAgICAgICB9CisgICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgfQorICAgfQorICAgcmV0dXJuIHN0YXR1czsKK30KKyNpZmRlZiBXTEFOX0ZFQVRVUkVfR1RLX09GRkxPQUQKKy8qCisgKiBGVU5DVElPTjogV0RBX1Byb2Nlc3NHVEtPZmZsb2FkZ2V0SW5mb1JlcQorICogUmVxdWVzdCB0byBXREkgdG8gZ2V0IEdUSyBPZmZsb2FkIEluZm9ybWF0aW9uCisgKi8gCitWT1NfU1RBVFVTIFdEQV9Qcm9jZXNzR1RLT2ZmbG9hZEdldEluZm9SZXEodFdEQV9DYkNvbnRleHQgKnBXREEsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRwU2lyR3RrT2ZmbG9hZEdldEluZm9Sc3BQYXJhbXMgcEd0a09mZmxvYWRHZXRJ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DICE9IHdkaVN0YXR1cykKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICJUcmlnZ2VyIGJhdGNoIHNjYW4gcmVzdWx0IGluZCBmYWlsZWQgJXM6JWQiLAorICAgICAgICAgIF9fZnVuY19fLCB3ZGlTdGF0dXMpOworICAgfQorCisgICB2b3NfbWVtX2ZyZWUocFJlcSk7CisKKyAgIHJldHVybiBDT05WRVJUX1dESTJWT1NfU1RBVFVTKHdkaVN0YXR1cyk7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gV0RBX1NldEJhdGNoU2NhblJlc3BDYWxsYmFjaworCisgIERFU0NSSVBUSU9OCisgICAgQVBJIHRvIHByb2Nlc3Mgc2V0IGJhdGNoIHNjYW4gcmVzcG9uc2UgZnJvbSBGVworCisgIFBBUkFNRVRFUlMKKyAgICBwUnNwOiBQb2ludGVyIHRvIHNldCBiYXRjaCBzY2FuIHJlc3BvbnNlCisgICAgcFVzZXJEYXRhOiBQb2ludGVyIHRvIHVzZXIgZGF0YQorCisgIFJFVFVSTiBWQUxVRQorICAgIE5PTkUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgV0RBX1NldEJhdGNoU2NhblJlc3BDYWxsYmFjaworKAorICAgIFdESV9TZXRCYXRjaFNjYW5Sc3BUeXBlICpwUnNwLAorICAgIHZvaWQqIHBVc2VyRGF0YQorKQoreworICAgdFNpclNldEJhdGNoU2NhblJzcCAqcEhkZFNldEJhdGNoU2NhblJzcDsKKyAgIHRwQW5pU2lyR2xvYmFsIHBNYWM7CisgICB2b2lkICpwQ2FsbGJhY2tDb250ZXh0OworICAgdFdEQV9DYkNvbnRleHQgKnBXREEgPSBOVUxMIDsKKyAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zID0gKHRXREFfUmVxUGFyYW1zICopcFVzZXJEYXRhOworCisKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiPC0tLS0tLSAlcyAiICxfX2Z1bmNfXyk7CisgICBpZiAoTlVMTCA9PSBwV2RhUGFyYW1zKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAiJXM6IHBXZGFQYXJhbXMgcmVjZWl2ZWQgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgIFZPU19BU1NFUlQoMCkgOworICAgICAgcmV0dXJuIDsKKyAgIH0KKworICAgLypleHRyYWN0IFdEQSBjb250ZXh0Ki8KKyAgIHBXREEgPSBwV2RhUGFyYW1zLT5wV2RhQ29udGV4dDsKKyAgIGlmIChOVUxMID09IHBXREEpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgIiVzOnBXREEgaXMgTlVMTCBjYW4ndCBpbnZvbGUgSEREIGNhbGxiYWNrIiwKKyAgICAgICAgICAgX19mdW5jX18pOworICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYVdkaUFwaU1zZ1BhcmFtKTsKKyAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zLT53ZGFNc2dQYXJhbSk7CisgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcyk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuOworICAgfQorCisgICB2b3NfbWVtX2ZyZW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HNldCBiYXRjaCBzY2FuIHJlc3BvbnNlIGRhdGEqLworICAgaWYocE1hYy0+cG1jLnNldEJhdGNoU2NhblJlcUNhbGxiYWNrKQorICAgeworICAgICAgIHBNYWMtPnBtYy5zZXRCYXRjaFNjYW5SZXFDYWxsYmFjayhwQ2FsbGJhY2tDb250ZXh0LCBwSGRkU2V0QmF0Y2hTY2FuUnNwKTsKKyAgIH0KKyAgIGVsc2UKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAiJXM6SEREIGNhbGxiYWNrIGlzIG51bGwiLCBfX2Z1bmNfXyk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgfQorCisgICB2b3NfbWVtX2ZyZWUocEhkZFNldEJhdGNoU2NhblJzcCk7CisgICByZXR1cm4gOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OIFdEQV9Qcm9jZXNzU2V0QmF0Y2hTY2FuUmVxCisKKyAgREVTQ1JJUFRJT04KKyAgICBBUEkgdG8gc2VuZCBzZXQgYmF0Y2ggc2NhbiByZXF1ZXN0IHRvIFdESQorCisgIFBBUkFNRVRFUlMKKyAgICBwV0RBOiBQb2ludGVyIHRvIFdEQSBjb250ZXh0CisgICAgcFNldEJhdGNoU2NhblJlcTogUG9pbnRlciB0byBzZXQgYmF0Y2ggc2NhbiByZXEKKworICBSRVRVUk4gVkFMVUUKKyAgICBOT05FCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdEQV9Qcm9jZXNzU2V0QmF0Y2hTY2FuUmVxKHRXREFfQ2JDb250ZXh0ICpwV0RBLAorICAgICAgIHRTaXJTZXRCYXRjaFNjY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NTRVJUKDApOworICAgICAgdm9zX3BrdF9yZXR1cm5fcGFja2V0KHBEYXRhKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgIH0KKworICAgIC8qQ2hlY2sgaWYgZnJhbWUgd2FzIHRpbWVkIG91dCBvciBub3QqLworICAgIHZvc19wa3RfZ2V0X3VzZXJfZGF0YV9wdHIoICBwRGF0YSwgVk9TX1BLVF9VU0VSX0RBVEFfSURfV0RBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2X1BWT0lEX3QpJnVVc2VyRGF0YSk7CisKKyAgICBpZiAoIFdEQV9UTF9UWF9NR01UX1RJTUVEX09VVCA9PSB1VXNlckRhdGEgKQorICAgIHsKKyAgICAgICAvKkRpc2NhcmQgZnJhbWUgLSBubyBmdXJ0aGVyIHByb2Nlc3NpbmcgaXMgbmVlZGVkKi8KKyAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogTUdNVCBGcmFtZSBUeCB0aW1lZCBvdXQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICB2b3NfcGt0X3JldHVybl9wYWNrZXQocERhdGEpOyAKKyAgICAgICByZXR1cm4gVk9TX1NUQVRVU19TVUNDRVNTOyAKKyAgICB9CisKKyAgIC8qY2hlY2sgd2hldGhlciB0aGUgY2FsbGJhY2sgaXMgbnVsbCBvciBub3QsbWFkZSBudWxsIGR1cmluZyBXREFfVExfVFhfRlJBTUVfVElNRU9VVCB0aW1lb3V0Ki8KKyAgIGlmKCBOVUxMIT13ZGFDb250ZXh0LT5wVHhDYkZ1bmMpIAorICAgeworICAgICAgLypjaGVjayBpZiBwYWNrZXQgaXMgZnJlZWQgYWxyZWFkeSovCisgICAgICBpZih2b3NfYXRvbWljX3NldCgodWludHB0cl90Kikmd2RhQ29udGV4dC0+Vm9zUGFja2V0VG9GcmVlLCAodWludHB0cl90KVdEQV9UWF9QQUNLRVRfRlJFRUQpID09ICh1aW50cHRyX3QpcERhdGEpCisgICAgICB7CisgICAgICAgICB3ZGFDb250ZXh0LT5wVHhDYkZ1bmMocE1hYywgcERhdGEpOyAKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOnBhY2tldCAoJXApIGlzIGFscmVhZHkgZnJlZWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHBEYXRhKTsKKyAgICAgICAgIC8vUmV0dXJuIGZyb20gaGVyZSBzaW5jZSB3ZSByZWFjaGluZyBoZXJlIGJlY2F1c2UgdGhlIHBhY2tldCBhbHJlYWR5IHRpbWVvdXQKKyAgICAgICAgIHJldHVybiBzdGF0dXM7CisgICAgICB9CisgICB9CisKKyAgIC8qIAorICAgICogVHJpZ2dlciB0aGUgZXZlbnQgdG8gYnJpbmcgdGhlIEhBTCBUTCBUeCBjb21wbGV0ZSBmdW5jdGlvbiB0byBjb21lIAorICAgICogb3V0IG9mIHdhaXQgCisgICAgKiBMZXQgdGhlIGNvZSBhYm92ZSB0byBjb21wbGV0ZSB0aGUgcGFja2V0IGZpcnN0LiBXaGVuIHRoaXMgZXZlbnQgaXMgc2V0LAorICAgICogdGhlIHRocmVhZCB3YWl0aW5nIGZvciB0aGUgZXZlbnQgbWF5IHJ1biBhbmQgc2V0IFZvc3BhY2tldF9mcmVlZCBjYXVzaW5nIHRoZSBvcmlnaW5hbAorICAgICogcGFja2V0IG5vdCBiZWluZyBmcmVlZC4KKyAgICAqLworICAgc3RhdHVzICA9IHZvc19ldmVudF9zZXQoJndkYUNvbnRleHQtPnR4RnJhbWVFdmVudCk7CisgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICAgICJORVcgVk9TIEV2ZW50IFNldCBmYWlsZWQgLSBzdGF0dXMgPSAlZCIsIHN0YXR1cyk7CisgICB9CisgICByZXR1cm4gc3RhdHVzOworfQorLyoKKyAqIEZVTkNUSU9OOiBXREFfVHhQYWNrZXQKKyAqIEZvcndhcmQgVFggbWFuYWdlbWVudCBmcmFtZSB0byBXREkKKyAqLyAKK1ZPU19TVEFUVVMgV0RBX1R4UGFja2V0KHRXREFfQ2JDb250ZXh0ICpwV0RBLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnBGcm1CdWYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UxNiBmcm1MZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICBlRnJhbWVUeXBlIGZybVR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBlRnJhbWVUeERpciB0eERpciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRBTklfVTggdGlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcFdEQVR4UnhDb21wRnVuYyBwQ29tcEZ1bmMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpwRGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHBXREFBY2tGblR4Q29tcCBwQWNrVHhDb21wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgdHhGbGFnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFOSV9VMzIgdHhCZFRva2VuCisgICAgICAgICAgICAgICAgICAgICAgICAgICApCit7CisgICBWT1NfU1RBVFVTIHN0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUyA7CisgICB0cFNpck1hY0ZyYW1lQ3RsIH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WT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICJUeCBDb21wbGV0ZSB0aW1lb3V0IFRpbWVyIFN0b3AgRmFpbGVkICIpOworICAgICAgICAgICB9CisgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgeworICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICJUeCBDb21wbGV0ZSB0aW1lb3V0IFRpbWVyIFN0b3AgU3VjY2VzcyAiKTsKKyAgICAgICAgICAgfQorICAgICAgIH0KKworICAgICAgIHR4RmxhZyB8PSBIQUxfVFhDT01QX1JFUVVFU1RFRF9NQVNLOworICAgICAgIHBXREEtPnBBY2tUeENiRnVuYyA9IHBBY2tUeENvbXA7CisgICAgICAgaWYoIFZPU19TVEFUVVNfU1VDQ0VTUyAhPQorICAgICAgICAgICAgICAgV0RBX1NUQVJUX1RJTUVSKCZwV0RBLT53ZGFUaW1lcnMuVHhDb21wbGV0ZVRpbWVyKSApIAorICAgICAgIHsKKyAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgIlR4IENvbXBsZXRlIFRpbWVyIFN0YXJ0IEZhaWxlZCAiKTsKKyAgICAgICAgICAgcFdEQS0+cEFja1R4Q2JGdW5jID0gTlVMTDsKKyAgICAgICAgICAgcmV0dXJuIGVIQUxfU1RBVFVTX0ZBSUxVUkU7CisgICAgICAgfQorICAgfSAKKyAgIC8qIFJlc2V0IHRoZSBldmVudCB0byBiZSBub3Qgc2lnbmFsbGVkICovCisgICBzdGF0dXMgPSB2b3NfZXZlbnRfcmVzZXQoJnBXREEtPnR4RnJhbWVFdmVudCk7CisgICBpZighVk9TX0lTX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJWT1MgRXZlbnQgcmVzZXQgZmFpbGVkIC0gc3RhdHVzID0gJWQiLHN0YXR1cyk7CisgICAgICBwQ29tcEZ1bmMocFdEQS0+cFZvc0NvbnRleHQsICh2b3NfcGt0X3QgKilwRnJtQnVmKTsKKyAgICAgIGlmKCBwQWNrVHhDb21wICkKKyAgICAgIHsKKyAgICAgICAgIHBXREEtPnBBY2tUeENiRnVuYyA9IE5VTEw7CisgICAgICAgICBpZiggVk9TX1NUQVRVU19TVUNDRVNTICE9CisgICAgICAgICAgICAgICAgICAgICAgICAgICBXREFfU1RPUF9USU1FUigmcFdEQS0+d2RhVGltZXJzLlR4Q29tcGxldGVUaW1lcikpCisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJUeCBDb21wbGV0ZSB0aW1lb3V0IFRpbWVyIFN0b3AgRmFpbGVkICIpOworICAgICAgICAgfQorICAgICAgfQorICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgfQorCisgICAvKiBJZiBQZWVyIFN0YSBtYXNrIGlzIHNldCBkb24ndCBvdmVyd3JpdGUgdG8gc2VsZiBzdGEgKi8KKyAgIGlmKHR4RmxhZyAmIEhBTF9VU0VfUEVFUl9TVEFfUkVRVUVTVEVEX01BU0spCisgICB7CisgICAgICB0eEZsYWcgJj0gfkhBTF9VU0VfUEVFUl9TVEFfUkVRVUVTVEVEX01BU0s7CisgICB9CisgICBlbHNlCisgICB7CisgICAgICAvKiBHZXQgc3lzdGVtIHJvbGUsIHVzZSB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EKTsvKnJlc2V0IHRoZSBWb3NQYWNrZXRfZnJlZWQqLworICAgICAgaWYoIHBBY2tUeENvbXAgKQorICAgICAgeworICAgICAgICAgcFdEQS0+cEFja1R4Q2JGdW5jID0gTlVMTDsKKyAgICAgICAgIGlmKCBWT1NfU1RBVFVTX1NVQ0NFU1MgIT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIFdEQV9TVE9QX1RJTUVSKCZwV0RBLT53ZGFUaW1lcnMuVHhDb21wbGV0ZVRpbWVyKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlR4IENvbXBsZXRlIHRpbWVvdXQgVGltZXIgU3RvcCBGYWlsZWQgIik7CisgICAgICAgICB9CisgICAgICB9IAorICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgfQorICAgdGltZV9zbmFwc2hvdCA9IHZvc190aW1lcl9nZXRfc3lzdGVtX3RpbWUoKTsKKyAgIC8qIAorICAgICogV2FpdCBmb3IgdGhlIGV2ZW50IHRvIGJlIHNldCBieSB0aGUgVEwsIHRvIGdldCB0aGUgcmVzcG9uc2Ugb2YgVFggCisgICAgKiBjb21wbGV0ZSwgdGhpcyBldmVudCBzaG91bGQgYmUgc2V0IGJ5IHRoZSBDYWxsYmFjayBmdW5jdGlvbiBjYWxsZWQgYnkgVEwgCisgICAgKi8KKyAgIHN0YXR1cyA9IHZvc193YWl0X2V2ZW50cygmcFdEQS0+dHhGcmFtZUV2ZW50LCAxLCBXREFfVExfVFhfRlJBTUVfVElNRU9VVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZXZlbnRJZHgpOworICAgaWYoIVZPU19JU19TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUx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X1RYX1BBQ0tFVF9GUkVFRCk7CisgICAgICAvKmlmKHZvc19hdG9taWNfc2V0KHVpbnRwdHJfdCAqKSZwV0RBLT5Wb3NQYWNrZXRUb0ZyZWUsICh1aW50cHRyX3QpV0RBX1RYX1BBQ0tFVF9GUkVFRCkgPT0gKHZfVTMyX3QpcEZybUJ1ZikKKyAgICAgIHsKKyAgICAgICAgIHBDb21wRnVuYyhWT1NfR0VUX01BQ19DVFhUKHBXREEtPnBWb3NDb250ZXh0KSwgKHZvc19wa3RfdCAqKXBGcm1CdWYpOworICAgICAgfSAqLworCisgICAgICBXTEFOVExfVExEZWJ1Z01lc3NhZ2UoV0xBTlRMX0RFQlVHX0ZXX0NMRUFOVVApOworCisgICAgICBpZiggcEFja1R4Q29tcCApCisgICAgICB7CisgICAgICAgICBwV0RBLT5wQWNrVHhDYkZ1bmMgPSBOVUxMOworICAgICAgICAgaWYoIFZPU19TVEFUVVNfU1VDQ0VTUyAhPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgV0RBX1NUT1BfVElNRVIoJnBXREEtPndkYVRpbWVycy5UeENvbXBsZXRlVGltZXIpKQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVHggQ29tcGxldGUgdGltZW91dCBUaW1lciBTdG9wIEZhaWxlZCAiKTsKKyAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIHBXREEtPm1nbXRUeGZhaWx1cmVDbnQrKzsKKworICAgICAgLyogU1NSIGlmIHRpbWVvdXQgY29udGlub3VzbHkgZm9yCisgICAgICAgKiBXREFfVFhfRkFJTFVSRV9SRUNPVkVSWV9USFJFU0hPTEQgdGltZXMuCisgICAgICAgKi8KKyAgICAgIGlmIChXREFfVFhfRkFJTFVSRV9SRUNPVkVSWV9USFJFU0hPTEQgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFdEQS0+bWdtdFR4ZmFpbHVyZUNudCkKKyAgICAgIHsKKyAgICAgICAgIHZvc193bGFuUmVzdGFydCgpOworICAgICAgfQorICAgICAgc3RhdHVzID0gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICB9CisKKyNpZmRlZiBXTEFOX0RVTVBfTUdNVEZSQU1FUworICAgaWYgKFZPU19JU19TVEFUVVNfU1VDQ0VTUyhzdGF0dXMpKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICIlcygpIFRYIHBhY2tldCA6IFN1YlR5cGUgJWQiLCBfX2Z1bmNfXyxwRmMtPnN1YlR5cGUpOworICAgICAgVk9TX1RSQUNFX0hFWF9EVU1QKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICBwRGF0YSwgZnJtTGVuKTsKKyAgIH0KKyNlbmRpZgorCisgICBpZiAoVk9TX0lTX1NUQVRVU19TVUNDRVNTKHN0YXR1cykpCisgICB7CisgICAgICBwV0RBLT5tZ210VHhmYWlsdXJlQ250ID0gMDsKKyAgICAgIGlmICgodm9zX3RpbWVyX2dldF9zeXN0ZW1fdGltZSgpIC0gdGltZV9zbmFwc2hvdCkgPj0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXREFfVFhfVElNRV9USFJFU0hPTEQpCisgICAgICB7CisgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAiVHggQ29tcGxldGUgdG9vayAlbHUgbXMiLAorICAgICAgICAgICAgICAgICAgICAgdm9zX3RpbWVyX2dldF9zeXN0ZW1fdGltZSgpIC0gdGltZV9zbmFwc2hvdCk7CisgICAgICB9CisKKyAgICAgIGlmIChwTWFjLT5mRW5hYmxlRGVidWdMb2cgJiAweDEpCisgICAgICB7CisgICAgICAgICBpZiAoKHBGYy0+dHlwZSA9PSBTSVJfTUFDX01HTVRfRlJBTUUpICYmCisgICAgICAgICAgICAgKHBGYy0+c3ViVHlwZSAhPSBTSVJfTUFDX01HTVRfUFJPQkVfUkVRKSAmJgorICAgICAgICAgICAgIChwRmMtPnN1YlR5cGUgIT0gU0lSX01BQ19NR01UX1BST0JFX1JTUCkpCisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsICJUWCBNR01UIC0gVHlwZSAlaHUsIFN1YlR5cGUgJWh1IiwKKyAgICAgICAgICAgICAgICAgICAgICAgcEZjLT50eXBlLCBwRmMtPnN1YlR5cGUpOworICAgICAgICAgfQorICAgICAgfQorICAgfQorCisKKyAgIHJldHVybiBzdGF0dXM7Cit9CisvKgorICogRlVOQ1RJT046IFdEQV9Qcm9jZXNzREhDUFN0YXJ0SW5kCisgKiBGb3J3YXJkIERIQ1AgU3RhcnQgdG8gV0RJCisgKi8KK3N0YXRpYyBWT1NfU1RBVFVTIFdEQV9Qcm9jZXNzREhDUFN0YXJ0SW5kICh0V0RBX0NiQ29udGV4dCAqcFdEQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0QW5pREhDUEluZCAqZGhjcFN0YXJ0SW5kKQoreworICAgV0RJX1N0YXR1cyBzdGF0dXM7CisgICBXRElfREhDUEluZCB3ZGlESENQSW5kOworCisgICB3ZGlESENQSW5kLmRldmljZV9tb2RlID0gZGhjcFN0YXJ0SW5kLT5kZXZpY2VfbW9kZTsKKyAgIHZvc19tZW1fY29weSh3ZGlESENQSW5kLm1hY0FkZHIsIGRoY3BTdGFydEluZC0+bWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisKKyAgIHN0YXR1cyA9IFdESV9kaGNwU3RhcnRJbmQoJndkaURIQ1BJbmQpOworCisgICBpZiAoV0RJX1NUQVRVU19QRU5ESU5HID09IHN0YXR1cykKKyAgIHsKKyAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAiUGVuZGluZyByZWNlaXZlZCBmb3IgJXM6JWQgIixfX2Z1bmNfXyxfX0xJTkVfXyApOworICAgfQorICAgZWxzZSBpZiAoV0RJX1NUQVRVU19TVUNDRVNTX1NZTkMgIT0gc3RhdHVzKQorICAgeworICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIkZhaWx1cmUgc3RhdHVzOiAlZCBpbiAlczolZCAiLCBzdGF0dXMsIF9fZnVuY19fLCBfX0xJTkVfXyk7CisgICB9CisKKyAgIHZvc19tZW1fZnJlZShkaGNwU3RhcnRJbmQpOworICAgcmV0dXJuIENPTlZFUlRfV0RJMlZPU19TVEFUVVMoc3RhdHVzKSA7Cit9CisKKyAvKgorICAqIEZVTkNUSU9OOiBXREFfUHJvY2Vzc0RIQ1BTdG9wSW5kCisgICogRm9yd2FyZCBESENQIFN0b3AgdG8gV0RJCisgICovCisgc3RhdGljIFZPU19TVEFUVVMgV0RBX1Byb2Nlc3NESENQU3RvcEluZCAodFdEQV9DYkNvbnRleHQgKnBXREEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEFuaURIQ1BJbmQgKmRoY3BTdG9wSW5kKQorIHsKKyAgIFdESV9TdGF0dXMgc3RhdHVzOworICAgV0RJX0RIQ1BJbmQgd2RpREhDUEluZDsKKworICAgd2RpREhDUEluZC5kZX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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwV2RhUGFyYW1zICk7CisKKyAgICBpZihJU19XRElfU1RBVFVTX0ZBSUxVUkUod2RpU3RhdHVzKSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICJGYWlsdXJlIGluIFNldFNwb29mTWFjQWRkclJlcSBQYXJhbXMgV0RJIEFQSSwgZnJlZSBhbGwgdGhlIG1lbW9yeSAiICk7CisgICAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zLT53ZGFXZGlBcGlNc2dQYXJhbSkgOworICAgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcy0+d2RhTXNnUGFyYW0pOworICAgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcyk7CisgICAgfQorCisgICAgcmV0dXJuIENPTlZFUlRfV0RJMlZPU19TVEFUVVMod2RpU3RhdHVzKSA7Cit9CisKKy8qCisgKiBGVU5DVElPTjogV0RBX01jUHJvY2Vzc01zZworICogVHJpZ2dlciBEQUwtQUwgdG8gc3RhcnQgQ0ZHIGRvd25sb2FkIAorICovIAorVk9TX1NUQVRVUyBXREFfTWNQcm9jZXNzTXNnKCB2X0NPTlRFWFRfdCBwVm9zQ29udGV4dCwgdm9zX21zZ190ICpwTXNnICkKK3sKKyAgIFZPU19TVEFUVVMgc3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgdFdEQV9DYkNvbnRleHQgKnBXREEgPSBOVUxMIDsgCisgICBpZihOVUxMID09IHBNc2cpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6cE1zZyBpcyBOVUxMIiwgX19mdW5jX18pOyAKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICB9CisgICAKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICAgICAgICAgIj09PT09PT09PT4gJXMgbXNnVHlwZTogJXggIiAsX19mdW5jX18sIHBNc2ctPnR5cGUpOworICAgCisgICBwV0RBID0gKHRXREFfQ2JDb250ZXh0ICopdm9zX2dldF9jb250ZXh0KCBWT1NfTU9EVUxFX0lEX1dEQSwgcFZvc0NvbnRleHQgKTsKKyAgIGlmKE5VTEwgPT0gcFdEQSApCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6cFdEQSBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHZvc19tZW1fZnJlZShwTXNnLT5ib2R5cHRyKTsKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRTsKKyAgIH0KKyAgIC8qIFByb2Nlc3MgYWxsIHRoZSBXREEgbWVzc2FnZXMuLiAqLworICAgc3dpdGNoKCBwTXNnLT50eXBlICkKKyAgIHsKKyAgICAgIGNhc2UgV05JX0NGR19ETkxEX1JFUToKKyAgICAgIHsKKyAgICAgICAgIHN0YXR1cyA9IFdEQV9XbmlDZmdEbmxkKHBXREEpOworICAgICAgICAgLyogY2FsbCBXREEgY29tcGxldGUgZXZlbnQgaWYgY29uZmlnIGRvd25sb2FkIHN1Y2Nlc3MgKi8KKyAgICAgICAgIGlmKCBWT1NfSVNfU1RBVFVTX1NVQ0NFU1Moc3RhdHVzKSApCisgICAgICAgICB7CisgICAgICAgICAgICB2b3NfV0RBQ29tcGxldGVfY2JhY2socFZvc0NvbnRleHQpOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJXREEgQ29uZmlnIERvd25sb2FkIGZhaWx1cmUiICk7CisgICAgICAgICB9CisgICAgICAgICBicmVhayA7CisgICAgICB9CisgICAgICAvKiAKKyAgICAgICAqIEluaXQgU0NBTiByZXF1ZXN0IGZyb20gUEUsIGNvbnZlcnQgaXQgaW50byBEQUwgZm9ybWF0IAorICAgICAgICogYW5kIHNlbmQgaXQgdG8gREFMIAorICAgICAgICovIAorICAgICAgY2FzZSBXREFfSU5JVF9TQ0FOX1JFUToKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzSW5pdFNjYW5SZXEocFdEQSwgKHRJbml0U2NhblBhcmFtcyAqKXBNc2ctPmJvZHlwdHIpIDsKKyAgICAgICAgIGJyZWFrIDsgICAgCisgICAgICB9CisgICAgICAvKiBzdGFydCBTQ0FOIHJlcXVlc3QgZnJvbSBQRSAqLworICAgICAgY2FzZSBXREFfU1RBUlRfU0NBTl9SRVE6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc1N0YXJ0U2NhblJlcShwV0RBLCAodFN0YXJ0U2NhblBhcmFtcyAqKXBNc2ctPmJvZHlwdHIpIDsKKyAgICAgICAgIGJyZWFrIDsgICAgCisgICAgICB9CisgICAgICAvKiBlbmQgU0NBTiByZXF1ZXN0IGZyb20gUEUgKi8KKyAgICAgIGNhc2UgV0RBX0VORF9TQ0FOX1JFUToKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzRW5kU2NhblJlcShwV0RBLCAodEVuZFNjYW5QYXJhbXMgKilwTXNnLT5ib2R5cHRyKSA7CisgICAgICAgICBicmVhayA7CisgICAgICB9CisgICAgICAvKiBlbmQgU0NBTiByZXF1ZXN0IGZyb20gUEUgKi8KKyAgICAgIGNhc2UgV0RBX0ZJTklTSF9TQ0FOX1JFUToKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzRmluaXNoU2NhblJlcShwV0RBLCAodEZpbmlzaFNjYW5QYXJhbXMgKilwTXNnLT5ib2R5cHRyKSA7CisgICAgICAgICBicmVhayA7ICAgIAorICAgICAgfQorICAgICAgLyogam9pbiByZXF1ZXN0IGZyb20gUEUgKi8KKyAgICAgIGNhc2UgV0RBX0NITkxfU1dJVENIX1JFUToKKyAgICAgIHsKKyAgICAgICAgIGlmKFdEQV9QUkVfQVNTT0NfU1RBVEUgPT0gcFdEQS0+d2RhU3RhdGUpCisgICAgICAgICB7CisgICAgICAgICAgICBXREFfUHJvY2Vzc0pvaW5SZXEocFdEQSwgKHRTd2l0Y2hDaGFubmVsUGFyYW1zICopcE1zZy0+Ym9keXB0cikgOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgaWYgKElTX0ZFQVRVUkVfU1VQUE9SVEVEX0JZX0ZXKENIX1NXSVRDSF9WMSkgJiYKKyAgICAgICAgICAgICAgICAgZUhBTF9DSEFOTkVMX1NXSVRDSF9TT1VSQ0VfQ1NBID09CisgICAgICAgICAgICAgICAgKCh0U3dpdGNoQ2hhbm5lbFBhcmFtcyopcE1zZy0+Ym9keXB0ciktPmNoYW5uZWxTd2l0Y2hTcmMgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiY2FsbCBQcm9jZXNzQ2hhbm5lbFN3aXRjaFJlcV9WMSIgKTsKKyAgICAgICAgICAgICAgICBXREFfUHJvY2Vzc0NoYW5uZWxTd2l0Y2hSZXFfVjEocFdEQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRTd2l0Y2hDaGFubmVsUGFyYW1zKilwTXNnLT5ib2R5cHRyKSA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiY2FsbCBQcm9jZXNzQ2hhbm5lbFN3aXRjaFJlcSIgKTsKKyAgICAgICAgICAgICAgIFdEQV9Qcm9jZXNzQ2hhbm5lbFN3aXRjaFJlcShwV0RBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodFN3aXRjaENoYW5uZWxQYXJhbXMqKXBNc2ctPmJvZHlwdHIpIDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgICAgIGJyZWFrIDsKKyAgICAgIH0KKyAgICAgIC8qIEFERCBCU1MgcmVxdWVzdCBmcm9tIFBFICovCisgICAgICBjYXNlIFdEQV9BRERfQlNTX1JFUToKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzQ29uZmlnQnNzUmVxKHBXREEsICh0QWRkQnNzUGFyYW1zKilwTXNnLT5ib2R5cHRyKSA7CisgICAgICAgICBicmVhayA7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9BRERfU1RBX1JFUToKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzQWRkU3RhUmVxKHBXREEsICh0QWRkU3RhUGFyYW1zICopcE1zZy0+Ym9keXB0cikgOworICAgICAgICAgYnJlYWsgOworICAgICAgfQorICAgICAgY2FzZSBXREFfREVMRVRFX0JTU19SRVE6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc0RlbEJzc1JlcShwV0RBLCAodERlbGV0ZUJzc1BhcmFtcyAqKXBNc2ctPmJvZHlwdHIpIDsKKyAgICAgICAgIGJyZWFrIDsKKyAgICAgIH0KKyAgICAgIGNhc2UgV0RBX0RFTEVURV9TVEFfUkVROgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NEZWxTdGFSZXEocFdEQSwgKHREZWxldGVTdGFQYXJhbXMgKilwTXNnLT5ib2R5cHRyKSA7CisgICAgICAgICBicmVhayA7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9DT05GSUdfUEFSQU1fVVBEQVRFX1JFUToKKyAgICAgIHsKKyAgICAgICAgIFdEQV9VcGRhdGVDZmcocFdEQSwgKHRTaXJNc2dRICopcE1zZykgOworICAgICAgICAgYnJlYWsgOworICAgICAgfQorICAgICAgY2FzZSBXREFfU0VUX0JTU0tFWV9SRVE6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc1NldEJzc0tleVJlcShwV0RBLCAodFNldEJzc0tleVBhcmFtcyAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWsgOworICAgICAgfQorICAgICAgY2FzZSBXREFfU0VUX1NUQUtFWV9SRVE6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc1NldFN0YUtleVJlcShwV0RBLCAodFNldFN0YUtleVBhcmFtcyAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWsgOworICAgICAgfQorICAgICAgY2FzZSBXREFfU0VUX1NUQV9CQ0FTVEtFWV9SRVE6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc1NldEJjYXN0U3RhS2V5UmVxKHBXREEsICh0U2V0U3RhS2V5UGFyYW1zICopcE1zZy0+Ym9keXB0cik7CisgICAgICAgICBicmVhayA7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9SRU1PVkVfQlNTS0VZX1JFUToKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzUmVtb3ZlQnNzS2V5UmVxKHBXREEsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRSZW1vdmVCc3NLZXlQYXJhbXMgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIGJyZWFrIDsKKyAgICAgIH0KKyAgICAgIGNhc2UgV0RBX1JFTU9WRV9TVEFLRVlfUkVROgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NSZW1vdmVTdGFLZXlSZXEocFdEQSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodFJlbW92ZVN0YUtleVBhcmFtcyAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWsgOworICAgICAgfQorICAgICAgY2FzZSBXREFfUkVNT1ZFX1NUQV9CQ0FTVEtFWV9SRVE6CisgICAgICB7CisgICAgICAgICAvKiBUT0RPOiBjdXJyZW50bHkgVU1BQyBpcyBub3Qgc2VuZGluZyB0aGlzIHJlcXVlc3QsIEFkZCB0aGUgY29kZSBmb3IgCisgICAgICAgICBoYW5kbGluZyB0aGlzIHJlcXVlc3Qgd2hlbiBVTUFDIHN1cHBvcnRzICovCisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyNpZmRlZiBGRUFUVVJFX1dMQU5fRVNFCisgICAgICBjYXNlIFdEQV9UU01fU1RBVFNfUkVROgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NUc21TdGF0c1JlcShwV0RBLCAodHBBbmlHZXRUc21TdGF0c1JlcSlwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorI2VuZGlmCisgICAgICBjYXNlIFdEQV9VUERBVEVfRURDQV9QUk9GSUxFX0lORDoKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzVXBkYXRlRURDQVBhcmFtUmVxKHBXREEsICh0RWRjYVBhcmFtcyAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9BRERfVFNfUkVROgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NBZGRUU1JlcShwV0RBLCAodEFkZFRzUGFyYW1zICopcE1zZy0+Ym9keXB0cik7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGNhc2UgV0RBX0RFTF9UU19SRVE6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc0RlbFRTUmVxKHBXREEsICh0RGVsVHNQYXJhbXMgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXREFfQUREQkFfUkVROgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NBZGRCQVNlc3Npb25SZXEocFdEQSwgKHRBZGRCQVBhcmFtcyAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9ERUxCQV9JTkQ6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc0RlbEJBUmVxKHBXREEsICh0RGVsQkFQYXJhbXMgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXREFfVVBEQVRFX0NIQU5fTElTVF9SRVE6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc1VwZGF0ZUNoYW5uZWxMaXN0KHBXREEsCisgICAgICAgICAgICAgICAgICh0U2lyVXBkYXRlQ2hhbkxpc3QgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXREFfU0VUX0xJTktfU1RBVEU6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc1NldExpbmtTdGF0ZShwV0RBLCAodExpbmtTdGF0ZVBhcmFtcyAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9HRVRfU1RBVElTVElDU19SRVE6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc0dldFN0YXRzUmVxKHBXREEsICh0QW5pR2V0UEVTdGF0c1JlcSAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisjaWYgZGVmaW5lZCBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUiB8fCBkZWZpbmVkIEZFQVRVUkVfV0xBTl9FU0UgfHwgZGVmaW5lZChGRUFUVVJFX1dMQU5fTEZSKQorICAgICAgY2FzZSBXREFfR0VUX1JPQU1fUlNTSV9SRVE6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc0dldFJvYW1Sc3NpUmVxKHBXREEsICh0QW5pR2V0UnNzaVJlcSAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisjZW5kaWYKKyAgICAgIGNhc2UgV0RBX1BXUl9TQVZFX0NGRzoKKyAgICAgIHsKKyAgICAgICAgIGlmKHBXREEtPndkYVN0YXRlID09IFdEQV9SRUFEWV9TVEFURSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFdEQV9Qcm9jZXNzU2V0UHdyU2F2ZUNmZ1JlcShwV0RBLCAodFNpclBvd2VyU2F2ZUNmZyAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgaWYoTlVMTCAhPSBwTXNnLT5ib2R5cHRyKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICJXREFfUFdSX1NBVkVfQ0ZHIHJlcSBpbiB3cm9uZyBzdGF0ZSAlZCIsIHBXREEtPndkYVN0YXRlICk7CisgICAgICAgICB9CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGNhc2UgV0RBX0VOVEVSX0lNUFNfUkVROgorICAgICAgeworICAgICAgICAgaWYocFdEQS0+d2RhU3RhdGUgPT0gV0RBX1JFQURZX1NUQVRFKQorICAgICAgICAgeworICAgICAgICAgICAgV0RBX1Byb2Nlc3NFbnRlckltcHNSZXEocFdEQSk7CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgIldEQV9FTlRFUl9JTVBTX1JFUSByZXEgaW4gd3Jvbmcgc3RhdGUgJWQiLCBwV0RBLT53ZGFTdGF0ZSApOworICAgICAgICAgfQorICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9FWElUX0lNUFNfUkVROgorICAgICAgeworICAgICAgICAgaWYocFdEQS0+d2RhU3RhdGUgPT0gV0RBX1JFQURZX1NUQVRFKQorICAgICAgICAgeworICAgICAgICAgICAgV0RBX1Byb2Nlc3NFeGl0SW1wc1JlcShwV0RBKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAiV0RBX0VYSVRfSU1QU19SRVEgcmVxIGluIHdyb25nIHN0YXRlICVkIiwgcFdEQS0+d2RhU3RhdGUgKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXREFfRU5URVJfQk1QU19SRVE6CisgICAgICB7CisgICAgICAgICBpZihwV0RBLT53ZGFTdGF0ZSA9PSBXREFfUkVBRFlfU1RBVEUpCisgICAgICAgICB7CisgICAgICAgICAgICBXREFfUHJvY2Vzc0VudGVyQm1wc1JlcShwV0RBLCAodEVudGVyQm1wc1BhcmFtcyAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICJXREFfRU5URVJfQk1QU19SRVEgcmVxIGluIHdyb25nIHN0YXRlICVkIiwgcFdEQS0+d2RhU3RhdGUgKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXREFfRVhJVF9CTVBTX1JFUToKKyAgICAgIHsKKyAgICAgICAgIGlmKHBXREEtPndkYVN0YXRlID09IFdEQV9SRUFEWV9TVEFURSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFdEQV9Qcm9jZXNzRXhpdEJtcHNSZXEocFdEQSwgKHRFeGl0Qm1wc1BhcmFtcyAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICJXREFfRVhJVF9CTVBTX1JFUSByZXEgaW4gd3Jvbmcgc3RhdGUgJWQiLCBwV0RBLT53ZGFTdGF0ZSApOworICAgICAgICAgfQorICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9FTlRFUl9VQVBTRF9SRVE6CisgICAgICB7CisgICAgICAgICBpZihwV0RBLT53ZGFTdGF0ZSA9PSBXREFfUkVBRFlfU1RBVEUpCisgICAgICAgICB7CisgICAgICAgICAgICBXREFfUHJvY2Vzc0VudGVyVWFwc2RSZXEocFdEQSwgKHRVYXBzZFBhcmFtcyAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICJXREFfRU5URVJfVUFQU0RfUkVRIHJlcSBpbiB3cm9uZyBzdGF0ZSAlZCIsIHBXREEtPndkYVN0YXRlICk7CisgICAgICAgICB9CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGNhc2UgV0RBX0VYSVRfVUFQU0RfUkVROgorICAgICAgeworICAgICAgICAgaWYocFdEQS0+d2RhU3RhdGUgPT0gV0RBX1JFQURZX1NUQVRFKQorICAgICAgICAgeworICAgICAgICAgICAgV0RBX1Byb2Nlc3NFeGl0VWFwc2RSZXEocFdEQSwgKHRFeGl0VWFwc2RQYXJhbXMgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAiV0RBX0VYSVRfVUFQU0RfUkVRIHJlcSBpbiB3cm9uZyBzdGF0ZSAlZCIsIHBXREEtPndkYVN0YXRlICk7CisgICAgICAgICB9CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGNhc2UgV0RBX1VQREFURV9VQVBTRF9JTkQ6CisgICAgICB7CisgICAgICAgICBpZihwV0RBLT53ZGFTdGF0ZSA9PSBXREFfUkVBRFlfU1RBVEUpCisgICAgICAgICB7CisgICAgICAgICAgICBXREFfVXBkYXRlVWFwc2RQYXJhbXNSZXEocFdEQSwgKHRVcGRhdGVVYXBzZFBhcmFtcyAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICJXREFfVVBEQVRFX1VBUFNEX0lORCByZXEgaW4gd3Jvbmcgc3RhdGUgJWQiLCBwV0RBLT53ZGFTdGF0ZSApOworICAgICAgICAgfQorICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9SRUdJU1RFUl9QRV9DQUxMQkFDSyA6CisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIkhhbmRsaW5nIG1zZyB0eXBlIFdEQV9SRUdJU1RFUl9QRV9DQUxMQkFDSyAiICk7CisgICAgICAgICAvKlRPRE86IHN0b3JlIHRoZSBQRSBjYWxsYmFjayAqLworICAgICAgICAgLyogRG8gTm90aGluZz8gTVNHIEJvZHkgc2hvdWxkIGJlIGZyZWVkIGF0IGhlcmUgKi8KKyAgICAgICAgIGlmKE5VTEwgIT0gcE1zZy0+Ym9keXB0cikKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXREFfU1lTX1JFQURZX0lORCA6CisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJIYW5kbGluZyBtc2cgdHlwZSBXREFfU1lTX1JFQURZX0lORCAiICk7CisgICAgICAgICBwV0RBLT53ZGFTdGF0ZSA9IFdEQV9SRUFEWV9TVEFURTsKKyAgICAgICAgIGlmKE5VTEwgIT0gcE1zZy0+Ym9keXB0cikKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXREFfQkVBQ09OX0ZJTFRFUl9JTkQgIDoKKyAgICAgIHsKKyAgICAgICAgIFdEQV9TZXRCZWFjb25GaWx0ZXJSZXEocFdEQSwgKHRCZWFjb25GaWx0ZXJNc2cgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXREFfQlRDX1NFVF9DRkc6CisgICAgICB7CisgICAgICAgICAvKlRPRE86IGhhbmRsZSB0aGlzIHdoaWxlIGRlYWxpbmcgd2l0aCBCVEMgKi8KKyAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0hJR0gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkhhbmRsaW5nIG1zZyB0eXBlIFdEQV9CVENfU0VUX0NGRyAgIiApOworICAgICAgICAgLyogRG8gTm90aGluZz8gTVNHIEJvZHkgc2hvdWxkIGJlIGZyZWVkIGF0IGhlcmUgKi8KKyAgICAgICAgIGlmKE5VTEwgIT0gcE1zZy0+Ym9keXB0cikKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHZvc19tZW1fZnJlZShwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXREFfU0lHTkFMX0JUX0VWRU5UOgorICAgICAgeworICAgICAgICAgLypUT0RPOiBoYW5kbGUgdGhpcyB3aGlsZSBkZWFsaW5nIHdpdGggQlRDICovCisgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJIYW5kbGluZyBtc2cgdHlwZSBXREFfU0lHTkFMX0JUX0VWRU5UICAiICk7CisgICAgICAgICAvKiBEbyBOb3RoaW5nPyBNU0cgQm9keSBzaG91bGQgYmUgZnJlZWQgYXQgaGVyZSAqLworICAgICAgICAgaWYoTlVMTCAhPSBwTXNnLT5ib2R5cHRyKQorICAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgfQorICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9DRkdfUlhQX0ZJTFRFUl9SRVE6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc0NvbmZpZ3VyZVJ4cEZpbHRlclJlcShwV0RBLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRTaXJXbGFuU2V0UnhwRmlsdGVycyAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9NR01UX0xPR0dJTkdfSU5JVF9SRVE6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc0ZXTG9nZ2luZ0luaXRSZXEocFdEQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0U2lyRldMb2dnaW5nSW5pdFBhcmFtICopcE1zZy0+Ym9keXB0cik7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGNhc2UgV0RBX0dFVF9GUkFNRV9MT0dfUkVROgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NHZXRGcmFtZUxvZ1JlcShwV0RBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0QW5pR2V0RnJhbWVMb2dSZXEgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXREFfU0VORF9MT0dfRE9ORV9JTkQ6CisgICAgICB7CisgICAgICAgICBXREFfRldMb2dnaW5nRFhFZG9uZUluZCgpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9GQVRBTF9FVkVOVF9MT0dTX1JFUToKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzRmF0YWxFdmVudExvZ3NSZXEocFdEQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0U2lyRmF0YWxFdmVudExvZ3NSZXFQYXJhbSAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9TRVRfSE9TVF9PRkZMT0FEOgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NIb3N0T2ZmbG9hZFJlcShwV0RBLCAodFNpckhvc3RPZmZsb2FkUmVxICopcE1zZy0+Ym9keXB0cik7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGNhc2UgV0RBX1NFVF9LRUVQX0FMSVZFOgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NLZWVwQWxpdmVSZXEocFdEQSwgKHRTaXJLZWVwQWxpdmVSZXEgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorI2lmZGVmIFdMQU5fTlNfT0ZGTE9BRAorICAgICAgY2FzZSBXREFfU0VUX05TX09GRkxPQUQ6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc0hvc3RPZmZsb2FkUmVxKHBXREEsICh0U2lySG9zdE9mZmxvYWRSZXEgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorI2VuZGlmIC8vV0xBTl9OU19PRkZMT0FECisgICAgICBjYXNlIFdEQV9BRERfU1RBX1NFTEZfUkVROgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NBZGRTdGFTZWxmUmVxKHBXREEsICh0QWRkU3RhU2VsZlBhcmFtcyAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9ERUxfU1RBX1NFTEZfUkVROgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NEZWxTVEFTZWxmUmVxKHBXREEsICh0RGVsU3RhU2VsZlBhcmFtcyAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9XT1dMX0FERF9CQ0FTVF9QVFJOOgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NXb3dsQWRkQmNQdHJuUmVxKHBXREEsICh0U2lyV293bEFkZEJjYXN0UHRybiAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9XT1dMX0RFTF9CQ0FTVF9QVFJOOgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NXb3dsRGVsQmNQdHJuUmVxKHBXREEsICh0U2lyV293bERlbEJjYXN0UHRybiAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9XT1dMX0VOVEVSX1JFUToKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzV293bEVudGVyUmVxKHBXREEsICh0U2lySGFsV293bEVudGVyUGFyYW1zICopcE1zZy0+Ym9keXB0cik7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGNhc2UgV0RBX1dPV0xfRVhJVF9SRVE6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc1dvd2xFeGl0UmVxKHBXREEsICh0U2lySGFsV293bEV4aXRQYXJhbXMgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXREFfVExfRkxVU0hfQUNfUkVROgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NGbHVzaEFjUmVxKHBXREEsICh0Rmx1c2hBQ1JlcSAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9TSUdOQUxfQlRBTVBfRVZFTlQ6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc0J0QW1wRXZlbnRSZXEocFdEQSwgKHRTbWVCdEFtcEV2ZW50ICopcE1zZy0+Ym9keXB0cik7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGNhc2UgV0RBX0ZXX1NUQVRTX0dFVF9SRVE6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc0ZXU3RhdHNHZXRSZXEocFdEQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0U2lyRldTdGF0c0dldFJlcSAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisjaWZkZWYgV0xBTl9GRUFUVVJFX0xJTktfTEFZRVJfU1RBVFMKKyAgICAgIGNhc2UgV0RBX0xJTktfTEFZRVJfU1RBVFNfU0VUX1JFUToKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzTExTdGF0c1NldFJlcShwV0RBLCAodFNpckxMU3RhdHNTZXRSZXEgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXREFfTElOS19MQVlFUl9TVEFUU19HRVRfUkVROgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NMTFN0YXRzR2V0UmVxKHBXREEsICh0U2lyTExTdGF0c0dldFJlcSAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9MSU5LX0xBWUVSX1NUQVRTX0NMRUFSX1JFUToKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzTExTdGF0c0NsZWFyUmVxKHBXREEsICh0U2lyTExTdGF0c0NsZWFyUmVxICopcE1zZy0+Ym9keXB0cik7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyNlbmRpZiAvKiBXTEFOX0ZFQVRVUkVfTElOS19MQVlFUl9TVEFUUyAqLworI2lmZGVmIFdMQU5fRkVBVFVSRV9FWFRTQ0FOCisgICAgICBjYXNlIFdEQV9FWFRTQ0FOX0dFVF9DQVBBQklMSVRJRVNfUkVROgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NFWFRTY2FuR2V0Q2FwYWJpbGl0aWVzUmVxKHBXREEsCisgICAgICAgICAgICAgICAgICh0U2lyR2V0RVhUU2NhbkNhcGFiaWxpdGllc1JlcVBhcmFtcyAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9FWFRTQ0FOX1NUQVJUX1JFUToKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzRVhUU2NhblN0YXJ0UmVxKHBXREEsCisgICAgICAgICAgICAgICAgICh0U2lyRVhUU2NhblN0YXJ0UmVxUGFyYW1zICopcE1zZy0+Ym9keXB0cik7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGNhc2UgV0RBX0VYVFNDQU5fU1RPUF9SRVE6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc0VYVFNjYW5TdG9wUmVxKHBXREEsCisgICAgICAgICAgICAgICAgICh0U2lyRVhUU2NhblN0b3BSZXFQYXJhbXMgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXREFfRVhUU0NBTl9HRVRfQ0FDSEVEX1JFU1VMVFNfUkVROgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NFWFRTY2FuR2V0Q2FjaGVkUmVzdWx0c1JlcShwV0RBLAorICAgICAgICAgICAgICAgICAgICAgICAgICh0U2lyRVhUU2NhbkdldENhY2hlZFJlc3VsdHNSZXFQYXJhbXMgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXREFfRVhUU0NBTl9TRVRfQlNTSURfSE9UTElTVF9SRVE6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc0VYVFNjYW5TZXRCU1NJREhvdGxpc3RSZXEocFdEQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAodFNpckVYVFNjYW5TZXRCc3NpZEhvdExpc3RSZXFQYXJhbXMgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXREFfRVhUU0NBTl9SRVNFVF9CU1NJRF9IT1RMSVNUX1JFUToKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzRVhUU2NhblJlc2V0QlNTSURIb3RsaXN0UmVxKHBXREEsCisgICAgICAgICAgICAgICAgICAgICAgICAodFNpckVYVFNjYW5SZXNldEJzc2lkSG90bGlzdFJlcVBhcmFtcyAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9FWFRTQ0FOX1NFVF9TSUdORl9SU1NJX0NIQU5HRV9SRVE6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc0VYVFNjYW5TZXRTaWduZlJTU0lDaGFuZ2VSZXEocFdEQSwKKyAgICAgICAgICAgICAgICAgICAgICh0U2lyRVhUU2NhblNldFNpZ25pZmljYW50Q2hhbmdlUmVxUGFyYW1zICopcE1zZy0+Ym9keXB0cik7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGNhc2UgV0RBX0VYVFNDQU5fUkVTRVRfU0lHTkZfUlNTSV9DSEFOR0VfUkVROgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NFWFRTY2FuUmVzZXRTaWduZlJTU0lDaGFuZ2VSZXEocFdEQSwKKyAgICAgICAgICAgICAgICAgICAodFNpckVYVFNjYW5SZXNldFNpZ25pZmljYW50Q2hhbmdlUmVxUGFyYW1zICopcE1zZy0+Ym9keXB0cik7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyNlbmRpZiAvKiBXTEFOX0ZFQVRVUkVfRVhUU0NBTiAqLworI2lmZGVmIFdEQV9VVAorICAgICAgY2FzZSBXREFfV0RJX0VWRU5UX01TRzoKKyAgICAgIHsKKyAgICAgICAgIFdESV9wcm9jZXNzRXZlbnQocE1zZy0+Ym9keXB0ciwodm9pZCAqKXBNc2ctPmJvZHl2YWwpOworICAgICAgICAgYnJlYWsgOworICAgICAgfQorI2VuZGlmCisgICAgICBjYXNlIFdEQV9VUERBVEVfQkVBQ09OX0lORDoKKyAgICAgIHsKKyAgICAgICAgICBXREFfUHJvY2Vzc1VwZGF0ZUJlYWNvblBhcmFtcyhwV0RBLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0VXBkYXRlQmVhY29uUGFyYW1zICopcE1zZy0+Ym9keXB0cik7CisgICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9TRU5EX0JFQUNPTl9SRVE6CisgICAgICB7CisgICAgICAgICAgV0RBX1Byb2Nlc3NTZW5kQmVhY29uKHBXREEsICh0U2VuZGJlYWNvblBhcmFtcyAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXREFfVVBEQVRFX1BST0JFX1JTUF9URU1QTEFURV9JTkQ6CisgICAgICB7CisgICAgICAgICAgV0RBX1Byb2Nlc3NVcGRhdGVQcm9iZVJzcFRlbXBsYXRlKHBXREEsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodFNlbmRQcm9iZVJlc3BQYXJhbXMgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICBicmVhazsKKyAgICAgIH0KKyNpZiBkZWZpbmVkKFdMQU5fRkVBVFVSRV9WT1dJRkkpIHx8IGRlZmluZWQoRkVBVFVSRV9XTEFOX0VTRSkKKyAgICAgIGNhc2UgV0RBX1NFVF9NQVhfVFhfUE9XRVJfUkVROgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NTZXRNYXhUeFBvd2VyUmVxKHBXREEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodE1heFR4UG93ZXJQYXJhbXMgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorI2VuZGlmCisgICAgICBjYXNlIFdEQV9TRVRfTUFYX1RYX1BPV0VSX1BFUl9CQU5EX1JFUToKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzU2V0TWF4VHhQb3dlclBlckJhbmRSZXEocFdEQSwgKHRNYXhUeFBvd2VyUGVyQmFuZFBhcmFtcyAqKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXREFfU0VUX1RYX1BPV0VSX1JFUToKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzU2V0VHhQb3dlclJlcShwV0RBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRTaXJTZXRUeFBvd2VyUmVxICopcE1zZy0+Ym9keXB0cik7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGNhc2UgV0RBX1NFVF9QMlBfR09fTk9BX1JFUToKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzU2V0UDJQR09OT0FSZXEocFdEQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0UDJwUHNQYXJhbXMgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgLyogdGltZXIgcmVsYXRlZCBtZXNzYWdlcyAqLworICAgICAgY2FzZSBXREFfVElNRVJfQkFfQUNUSVZJVFlfUkVROgorICAgICAgeworICAgICAgICAgV0RBX0JhQ2hlY2tBY3Rpdml0eShwV0RBKSA7CisgICAgICAgICBicmVhayA7CisgICAgICB9CisKKyAgICAgIC8qIHRpbWVyIHJlbGF0ZWQgbWVzc2FnZXMgKi8KKyAgICAgIGNhc2UgV0RBX1RJTUVSX1RSQUZGSUNfU1RBVFNfSU5EOgorICAgICAgeworICAgICAgICAgV0RBX1RpbWVyVHJhZmZpY1N0YXRzSW5kKHBXREEpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisjaWZkZWYgV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIKKyAgICAgIGNhc2UgV0RBX0FHR1JfUU9TX1JFUToKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzQWdnckFkZFRTUmVxKHBXREEsICh0QWdnckFkZFRzUGFyYW1zICopcE1zZy0+Ym9keXB0cik7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyNlbmRpZiAvKiBXTEFOX0ZFQVRVUkVfVk9XSUZJXzExUiAqLworICAgICAgY2FzZSBXREFfRlRNX0NNRF9SRVE6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc0ZUTUNvbW1hbmQocFdEQSwgKHRQdHRNc2didWZmZXIgKilwTXNnLT5ib2R5cHRyKSA7CisgICAgICAgICBicmVhayA7CisgICAgICB9CisjaWZkZWYgRkVBVFVSRV9PRU1fREFUQV9TVVBQT1JUCisgICAgICBjYXNlIFdEQV9TVEFSVF9PRU1fREFUQV9SRVE6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc1N0YXJ0T2VtRGF0YVJlcShwV0RBLCAodFN0YXJ0T2VtRGF0YVJlcSAqKXBNc2ctPmJvZHlwdHIpIDsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorI2VuZGlmIC8qIEZFQVRVUkVfT0VNX0RBVEFfU1VQUE9SVCAqLworICAgICAgLyogVHggQ29tcGxldGUgVGltZSBvdXQgSW5kaWNhdGlvbiAqLworICAgICAgY2FzZSBXREFfVFhfQ09NUExFVEVfVElNRU9VVF9JTkQ6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc1R4Q29tcGxldGVUaW1lT3V0SW5kKHBXREEpOyAKKyAgICAgICAgIGJyZWFrOworICAgICAgfSAgICAgICAgIAorICAgICAgY2FzZSBXREFfV0xBTl9TVVNQRU5EX0lORDoKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzV2xhblN1c3BlbmRJbmQocFdEQSwgCisgICAgICAgICAgICAgICAgICAgICAgICAodFNpcldsYW5TdXNwZW5kUGFyYW0gKilwTXNnLT5ib2R5cHRyKSA7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGNhc2UgV0RBX1dMQU5fUkVTVU1FX1JFUToKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzV2xhblJlc3VtZVJlcShwV0RBLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICh0U2lyV2xhblJlc3VtZVBhcmFtICopcE1zZy0+Ym9keXB0cikgOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICAKKyAgICAgIGNhc2UgV0RBX1VQREFURV9DRl9JTkQ6CisgICAgICB7CisgICAgICAgICB2b3NfbWVtX2ZyZWUoKHZfVk9JRF90KilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIHBNc2ctPmJvZHlwdHIgPSBOVUxMOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisjaWZkZWYgRkVBVFVSRV9XTEFOX1NDQU5fUE5PCisgICAgICBjYXNlIFdEQV9TRVRfUE5PX1JFUToKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzU2V0UHJlZk5ldHdvcmtSZXEocFdEQSwgKHRTaXJQTk9TY2FuUmVxICopcE1zZy0+Ym9keXB0cik7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGNhc2UgV0RBX1VQREFURV9TQ0FOX1BBUkFNU19SRVE6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc1VwZGF0ZVNjYW5QYXJhbXMocFdEQSw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xKHBXREEsICh0U2lyU2V0UG93ZXJQYXJhbXNSZXEgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorI2lmZGVmIFdMQU5fRkVBVFVSRV9HVEtfT0ZGTE9BRAorICAgICAgY2FzZSBXREFfR1RLX09GRkxPQURfUkVROgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NHVEtPZmZsb2FkUmVxKHBXREEsICh0cFNpckd0a09mZmxvYWRQYXJhbXMpcE1zZy0+Ym9keXB0cik7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKworICAgICAgY2FzZSBXREFfR1RLX09GRkxPQURfR0VUSU5GT19SRVE6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc0dUS09mZmxvYWRHZXRJbmZvUmVxKHBXREEsICh0cFNpckd0a09mZmxvYWRHZXRJbmZvUnNwUGFyYW1zKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisjZW5kaWYgLy9XTEFOX0ZFQVRVUkVfR1RLX09GRkxPQUQKKworICAgICAgY2FzZSBXREFfU0VUX1RNX0xFVkVMX1JFUToKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzU2V0VG1MZXZlbFJlcShwV0RBLCAodEFuaVNldFRtTGV2ZWxSZXEgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorCisgICAgICBjYXNlIFdEQV9VUERBVEVfT1BfTU9ERToKKyAgICAgIHsKKyAgICAgICAgICAgaWYoV0RBX2dldEhvc3RXbGFuRmVhdENhcHMoSFQ0MF9PQlNTX1NDQU4pICYmCisgICAgICAgICAgICAgIFdEQV9nZXRGd1dsYW5GZWF0Q2FwcyhIVDQwX09CU1NfU0NBTikpCisgICAgICAgICAgeworICAgICAgICAgICAgICBXREFfUHJvY2Vzc1VwZGF0ZU9wTW9kZShwV0RBLCAodFVwZGF0ZVZIVE9wTW9kZSAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmKFdEQV9nZXRIb3N0V2xhbkZlYXRDYXBzKERPVDExQUMpICYmIFdEQV9nZXRGd1dsYW5GZWF0Q2FwcyhET1QxMUFDKSkKKyAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmKFdEQV9nZXRIb3N0V2xhbkZlYXRDYXBzKERPVDExQUNfT1BNT0RFKSAmJiBXREFfZ2V0RndXbGFuRmVhdENhcHMoRE9UMTFBQ19PUE1PREUpKQorICAgICAgICAgICAgICAgICAgIFdEQV9Qcm9jZXNzVXBkYXRlT3BNb2RlKHBXREEsICh0VXBkYXRlVkhUT3BNb2RlICopcE1zZy0+Ym9keXB0cik7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBWSFQgT3BNb2RlIEZlYXR1cmUgaXMgTm90IFN1cHBvcnRlZCIpOworICAgICAgICAgIH0gCisgICAgICAgICAgZWxzZSAKKyAgICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiAxMUFDIEZlYXR1cmUgaXMgTm90IFN1cHBvcnRlZCIpOworICAgICAgICAgIGJyZWFrOworICAgICAgfQorI2lmZGVmIFdMQU5fRkVBVFVSRV8xMVcKKyAgICAgIGNhc2UgV0RBX0VYQ0xVREVfVU5FTkNSWVBURURfSU5EOgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NFeGNsdWRlVW5lY3J5cHRJbmQocFdEQSwgKHRTaXJXbGFuRXhjbHVkZVVuZW5jcnlwdFBhcmFtICopcE1zZy0+Ym9keXB0cik7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyNlbmRpZgorI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgICAgICBjYXNlIFdEQV9TRVRfVERMU19MSU5LX0VTVEFCTElTSF9SRVE6CisgICAgICB7CisgICAgICAgICAgV0RBX1Byb2Nlc3NTZXRUZGxzTGlua0VzdGFibGlzaFJlcShwV0RBLCAodFRkbHNMaW5rRXN0YWJsaXNoUGFyYW1zICopcE1zZy0+Ym9keXB0cik7CisgICAgICAgICAgYnJlYWs7CisgICAgICB9CisjZW5kaWYKKyAgICAgIGNhc2UgV0RBX0RIQ1BfU1RBUlRfSU5EOgorICAgICAgeworICAgICAgICAgIFdEQV9Qcm9jZXNzREhDUFN0YXJ0SW5kKHBXREEsICh0QW5pREhDUEluZCAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXREFfREhDUF9TVE9QX0lORDoKKyAgICAgIHsKKyAgICAgICAgICBXREFfUHJvY2Vzc0RIQ1BTdG9wSW5kKHBXREEsICh0QW5pREhDUEluZCAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgIGJyZWFrOworICAgICAgfQorI2lmZGVmIEZFQVRVUkVfV0xBTl9MUEhCCisgICAgICBjYXNlIFdEQV9MUEhCX0NPTkZfUkVROgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NMUEhCQ29uZlJlcShwV0RBLCAodFNpckxQSEJSZXEgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorI2VuZGlmCisgICAgICBjYXNlIFdEQV9BRERfUEVSSU9ESUNfVFhfUFRSTl9JTkQ6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc0FkZFBlcmlvZGljVHhQdHJuSW5kKHBXREEsCisgICAgICAgICAgICAodFNpckFkZFBlcmlvZGljVHhQdHJuICopcE1zZy0+Ym9keXB0cik7CisgICA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KKyAgICAgICAgICAgICh0U2lyU3RvcEJhdGNoU2NhbkluZCAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXREFfR0VUX0JDTl9NSVNTX1JBVEVfUkVROgorICAgICAgICAgIFdEQV9Qcm9jZXNzR2V0QmNuTWlzc1JhdGVSZXEocFdEQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRTaXJCY25NaXNzUmF0ZVJlcSAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgIGJyZWFrOworI2VuZGlmCisKKyAgICAgIGNhc2UgV0RBX0hUNDBfT0JTU19TQ0FOX0lORDoKKyAgICAgIHsKKyAgICAgICAgICBXREFfUHJvY2Vzc0hUNDBPQlNTU2NhbkluZChwV0RBLAorICAgICAgICAgICAgKHRTaXJIVDQwT0JTU1NjYW5JbmQgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGNhc2UgV0RBX0hUNDBfT0JTU19TVE9QX1NDQU5fSU5EOgorICAgICAgeworICAgICAgICAgIFdEQV9Qcm9jZXNzSFQ0ME9CU1NTdG9wU2NhbkluZChwV0RBLAorICAgICAgICAgICAgKHRBTklfVTgqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgIGJyZWFrOworICAgICAgfQorLy8gdGRsc29mZmNoYW4KKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworICAgICAgY2FzZSBXREFfU0VUX1RETFNfQ0hBTl9TV0lUQ0hfUkVROgorICAgICAgeworICAgICAgICAgIFdEQV9Qcm9jZXNzU2V0VGRsc0NoYW5Td2l0Y2hSZXEocFdEQSwgKHRUZGxzQ2hhblN3aXRjaFBhcmFtcyAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgIGJyZWFrOworICAgICAgfQorI2VuZGlmCisgICAgICBjYXNlIFdEQV9TUE9PRl9NQUNfQUREUl9SRVE6CisgICAgICB7CisgICAgICAgICAgV0RBX1Byb2Nlc3NTZXRTcG9vZk1hY0FkZHJSZXEocFdEQSwgKHRwU3Bvb2ZNYWNBZGRyUmVxUGFyYW1zKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXREFfRU5DUllQVF9NU0dfUkVROgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NFbmNyeXB0TXNnUmVxKHBXREEsICh1OCAqKXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisKKyAgICAgIGNhc2UgV0RBX05BTl9SRVFVRVNUOgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NOYW5SZXF1ZXN0KCBwV0RBLCAodE5hblJlcXVlc3QgKilwTXNnLT5ib2R5cHRyKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXREFfU0VUX1JUU19DVFNfSFRWSFQ6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc1NldFJ0c0N0c0hUVmh0SW5kKCBwV0RBLCBwTXNnLT5ib2R5dmFsKTsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorCisgICAgICBjYXNlIFdEQV9NT05fU1RBUlRfUkVROgorICAgICAgeworICAgICAgICAgV0RBX1Byb2Nlc3NNb25TdGFydFJlcShwV0RBLCh2X1BWT0lEX3QpcE1zZy0+Ym9keXB0cik7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGNhc2UgV0RBX01PTl9TVE9QX1JFUToKKyAgICAgIHsKKyAgICAgICAgIFdEQV9Qcm9jZXNzTW9uU3RvcFJlcShwV0RBLCAodl9QVk9JRF90KXBNc2ctPmJvZHlwdHIpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIFdEQV9TRU5EX0ZSRVFfUkFOR0VfQ09OVFJPTF9JTkQ6CisgICAgICB7CisgICAgICAgICBXREFfUHJvY2Vzc0VuYWJsZURpc2FibGVDQUV2ZW50SW5kKHBXREEsIHBNc2ctPmJvZHl2YWwpOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBkZWZhdWx0OgorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIk5vIEhhbmRsaW5nIGZvciBtc2cgdHlwZSAleCBpbiBXREEgIiAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAscE1zZy0+dHlwZSk7CisgICAgICAgICAvKiBEbyBOb3RoaW5nPyBNU0cgQm9keSBzaG91bGQgYmUgZnJlZWQgYXQgaGVyZSAqLworICAgICAgICAgaWYoTlVMTCAhPSBwTXNnLT5ib2R5cHRyKQorICAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBNc2ctPmJvZHlwdHIpOworICAgICAgICAgfQorICAgICAgICAgLy9XREFfVk9TX0FTU0VSVCgwKSA7CisgICAgICB9CisgICB9CisgICByZXR1cm4gc3RhdHVzIDsKK30KKworLyoKKyAqIEZVTkNUSU9OOiBXREFfTG93TGV2ZWxJbmRDYWxsYmFjaworICogSU5EIEFQSSBjYWxsYmFjayBmcm9tIFdESSwgc2VuZCBJbmQgdG8gUEUKKyAqLyAKK3ZvaWQgV0RBX2xvd0xldmVsSW5kQ2FsbGJhY2soV0RJX0xvd0xldmVsSW5kVHlwZSAqd2RpTG93TGV2ZWxJbmQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogcFVzZXJEYXRhICkKK3sKKyAgIHRXREFfQ2JDb250ZXh0ICpwV0RBID0gKHRXREFfQ2JDb250ZXh0ICopcFVzZXJEYXRhOworI2lmIGRlZmluZWQgV0xBTl9GRUFUVVJFX05FSUdIQk9SX1JPQU1JTkcKKyAgIHR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2VuZGlmCisgICAgICAgICBicmVhayA7CisgICAgICB9CisgICAgICBjYXNlIFdESV9NSVNTRURfQkVBQ09OX0lORDoKKyAgICAgIHsKKyAgICAgICAgIHRwU2lyU21lTWlzc2VkQmVhY29uSW5kIHBNaXNzQmVhY0luZCA9CisgICAgICAgICAgICAodHBTaXJTbWVNaXNzZWRCZWFjb25JbmQpdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRTaXJTbWVNaXNzZWRCZWFjb25JbmQpKTsKKyAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgIlJlY2VpdmVkIFdESV9NSVNTRURfQkVBQ09OX0lORCBmcm9tIFdESSAiKTsKKyAgICAgICAgIC8qIHNlbmQgSU5EIHRvIFBFICovCisgICAgICAgICBpZihOVUxMID09IHBNaXNzQmVhY0luZCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIH0KKyAgICAgICAgIHBNaXNzQmVhY0luZC0+bWVzc2FnZVR5cGUgPSBXREFfTUlTU0VEX0JFQUNPTl9JTkQ7CisgICAgICAgICBwTWlzc0JlYWNJbmQtPmxlbmd0aCA9IHNpemVvZih0U2lyU21lTWlzc2VkQmVhY29uSW5kKTsKKyAgICAgICAgIHBNaXNzQmVhY0luZC0+YnNzSWR4ID0KKyAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpTWlzc2VkQmVhY29uSW5kLmJzc0lkeDsKKyAgICAgICAgIFdEQV9TZW5kTXNnKHBXREEsIFdEQV9NSVNTRURfQkVBQ09OX0lORCwgKHZvaWQgKilwTWlzc0JlYWNJbmQgLCAwKSA7CisgICAgICAgICBicmVhayA7CisgICAgICB9CisgICAgICBjYXNlIFdESV9VTktOT1dOX0FERFIyX0ZSQU1FX1JYX0lORDoKKyAgICAgIHsKKyAgICAgICAgIC8qIFRPRE86IERlY29kZSBJbmQgYW5kIHNlbmQgSW5kIHRvIFBFICovCisgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICJSZWNlaXZlZCBXRElfVU5LTk9XTl9BRERSMl9GUkFNRV9SWF9JTkQgZnJvbSBXREkgIik7CisgICAgICAgICBicmVhayA7CisgICAgICB9CisgICAgICAgCisgICAgICBjYXNlIFdESV9NSUNfRkFJTFVSRV9JTkQ6CisgICAgICB7CisgICAgICAgICB0cFNpclNtZU1pY0ZhaWx1cmVJbmQgcE1pY0luZCA9CisgICAgICAgICAgICh0cFNpclNtZU1pY0ZhaWx1cmVJbmQpdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRTaXJTbWVNaWNGYWlsdXJlSW5kKSk7CisKKyAgICAgICAgIGlmKE5VTEwgPT0gcE1pY0luZCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgfQorICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlJlY2VpdmVkIFdESV9NSUNfRkFJTFVSRV9JTkQgZnJvbSBXREkgIik7CisgICAgICAgICBwTWljSW5kLT5tZXNzYWdlVHlwZSA9IGVXTklfU01FX01JQ19GQUlMVVJFX0lORDsKKyAgICAgICAgIHBNaWNJbmQtPmxlbmd0aCA9IHNpemVvZih0U2lyU21lTWljRmFpbHVyZUluZCk7CisgICAgICAgICB2b3NfbWVtX2NvcHkocE1pY0luZC0+YnNzSWQsCisgICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaU1JQ0ZhaWx1cmVJbmZvLmJzc0lkLAorICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICAgdm9zX21lbV9jb3B5KHBNaWNJbmQtPmluZm8uc3JjTWFjQWRkciwKKyAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpTUlDRmFpbHVyZUluZm8ubWFjU3JjQWRkciwKKyAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgIHZvc19tZW1fY29weShwTWljSW5kLT5pbmZvLnRhTWFjQWRkciwKKyAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpTUlDRmFpbHVyZUluZm8ubWFjVGFBZGRyLAorICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICAgdm9zX21lbV9jb3B5KHBNaWNJbmQtPmluZm8uZHN0TWFjQWRkciwKKyAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpTUlDRmFpbHVyZUluZm8ubWFjRHN0QWRkciwKKyAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKTsKKyAgICAgICAgIHZvc19tZW1fY29weShwTWljSW5kLT5pbmZvLnJ4TWFjQWRkciwKKyAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpTUlDRmFpbHVyZUluZm8ubWFjUnhBZGRyLAorICAgICAgICAgICAgIHNpemVvZih0U2lyTWFjQWRkcikpOworICAgICAgICAgcE1pY0luZC0+aW5mby5tdWx0aWNhc3QgPSAKKyAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpTUlDRmFpbHVyZUluZm8udWNNdWx0aWNhc3Q7CisgICAgICAgICBwTWljSW5kLT5pbmZvLmtleUlkPSAKKyAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpTUlDRmFpbHVyZUluZm8ua2V5SWQ7CisgICAgICAgICBwTWljSW5kLT5pbmZvLklWMT0gCisgICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaU1JQ0ZhaWx1cmVJbmZvLnVjSVYxOworICAgICAgICAgdm9zX21lbV9jb3B5KHBNaWNJbmQtPmluZm8uVFNDLAorICAgICAgICAgICAgIHdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS53ZGlNSUNGYWlsdXJlSW5mby5UU0MsU0lSX0NJUEhFUl9TRVFfQ1RSX1NJWkUpOworICAgICAgICAgV0RBX1NlbmRNc2cocFdEQSwgU0lSX0hBTF9NSUNfRkFJTFVSRV9JTkQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilwTWljSW5kICwgMCkgOworICAgICAgICAgYnJlYWsgOworICAgICAgfQorICAgICAgY2FzZSBXRElfRkFUQUxfRVJST1JfSU5EOgorICAgICAgeworICAgICAgICAgcFdEQS0+d2RpRmFpbGVkID0gdHJ1ZTsKKyAgICAgICAgIC8qIFRPRE86IERlY29kZSBJbmQgYW5kIHNlbmQgSW5kIHRvIFBFICovCisgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiUmVjZWl2ZWQgV0RJX0ZBVEFMX0VSUk9SX0lORCBmcm9tIFdESSAiKTsKKyAgICAgICAgIGJyZWFrIDsKKyAgICAgIH0KKyAgICAgIGNhc2UgV0RJX0RFTF9TVEFfSU5EOgorICAgICAgeworICAgICAgICAgdHBEZWxldGVTdGFDb250ZXh0ICBwRGVsU1RBQ3R4ID0gCisgICAgICAgICAgICAodHBEZWxldGVTdGFDb250ZXh0KXZvc19tZW1fbWFsbG9jKHNpemVvZih0RGVsZXRlU3RhQ29udGV4dCkpOworICAgICAgICAgCisgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiUmVjZWl2ZWQgV0RJX0RFTF9TVEFfSU5EIGZyb20gV0RJICIpOworICAgICAgICAgaWYoTlVMTCA9PSBwRGVsU1RBQ3R4KQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogVk9TIE1FTSBBbGxvYyBGYWlsdXJlIiwgX19mdW5jX18pOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisgICAgICAgICB2b3NfbWVtX2NvcHkocERlbFNUQUN0eC0+YWRkcjIsCisgICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaURlbGV0ZVNUQUluZFR5cGUubWFjQUREUjIsCisgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgICB2b3NfbWVtX2NvcHkocERlbFNUQUN0eC0+YnNzSWQsCisgICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaURlbGV0ZVNUQUluZFR5cGUubWFjQlNTSUQsCisgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgICBwRGVsU1RBQ3R4LT5hc3NvY0lkICAgID0gCisgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaURlbGV0ZVNUQUluZFR5cGUudXNBc3NvY0lkOworICAgICAgICAgcERlbFNUQUN0eC0+cmVhc29uQ29kZSA9IAorICAgICAgICAgIHdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS53ZGlEZWxldGVTVEFJbmRUeXBlLndwdFJlYXNvbkNvZGU7CisgICAgICAgICBwRGVsU1RBQ3R4LT5zdGFJZCAgICAgID0gCisgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaURlbGV0ZVNUQUluZFR5cGUudWNTVEFJZHg7CisgICAgICAgICBXREFfU2VuZE1zZyhwV0RBLCBTSVJfTElNX0RFTEVURV9TVEFfQ09OVEVYVF9JTkQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilwRGVsU1RBQ3R4ICwgMCkgOworICAgICAgICAgYnJlYWsgOworICAgICAgfQorICAgICAgY2FzZSBXRElfQ09FWF9JTkQ6CisgICAgICB7CisgICAgICAgICB0QU5JX1UzMiBpbmRleDsKKyAgICAgICAgIHZvc19tc2dfdCB2b3NNc2c7CisgICAgICAgICB0U2lyU21lQ29leEluZCAqcFNtZUNvZXhJbmQ7CisKKyAgICAgICAgIGlmIChTSVJfQ09FWF9JTkRfVFlQRV9DWE1fRkVBVFVSRVNfTk9USUZJQ0FUSU9OID09CisgICAgICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaUNvZXhJbmZvLmNvZXhJbmRUeXBlKQorICAgICAgICAgeworICAgICAgICAgICAgaWYod2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaUNvZXhJbmZvLmNvZXhJbmREYXRhKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgRkwoIkNvZXggc3RhdGU6IDB4JXggY29leCBmZWF0dXJlOiAweCV4IiksCisgICAgICAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpQ29leEluZm8uY29leEluZERhdGFbMF0sCisgICAgICAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpQ29leEluZm8uY29leEluZERhdGFbMV0pOworCisgICAgICAgICAgICAgICAgIGlmICh3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpQ29leEluZm8uY29leEluZERhdGFbMl0gPDwgMTYpCisgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLCBGTCgicG93ZXIgbGltaXQ6IDB4JXgiKSwKKyAgICAgICAgICAgICAgICAgICAgICh0QU5JX1UxNikod2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaUNvZXhJbmZvLmNvZXhJbmREYXRhWzJdKSk7CisgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgfQorCisgICAgICAgICBwU21lQ29leEluZCA9ICh0U2lyU21lQ29leEluZCAqKXZvc19tZW1fbWFsbG9jKHNpemVvZih0U2lyU21lQ29leEluZCkpOworICAgICAgICAgaWYoTlVMTCA9PSBwU21lQ29leEluZCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBWT1MgTUVNIEFsbG9jIEZhaWx1cmUtcFNtZUNvZXhJbmQiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIH0KKyAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJSZWNlaXZlZCBXRElfQ09FWF9JTkQgZnJvbSBXREkgIik7CisgICAgICAgICAvKiBNZXNzYWdlIEhlYWRlciAqLworICAgICAgICAgcFNtZUNvZXhJbmQtPm1lc2dUeXBlID0gZVdOSV9TTUVfQ09FWF9JTkQ7CisgICAgICAgICBwU21lQ29leEluZC0+bWVzZ0xlbiA9IHNpemVvZih0U2lyU21lQ29leEluZCk7CisgICAgICAgICAvKiBJbmZvIGZyb20gV0RJIEluZGljYXRpb24gKi8KKyAgICAgICAgIHBTbWVDb2V4SW5kLT5jb2V4SW5kVHlwZSA9IHdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS53ZGlDb2V4SW5mby5jb2V4SW5kVHlwZTsgCisgICAgICAgICBmb3IgKGluZGV4ID0gMDsgaW5kZXggPCBTSVJfQ09FWF9JTkRfREFUQV9TSVpFOyBpbmRleCsrKQorICAgICAgICAgeworICAgICAgICAgICAgcFNtZUNvZXhJbmQtPmNvZXhJbmREYXRhW2luZGV4XSA9IHdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS53ZGlDb2V4SW5mby5jb2V4SW5kRGF0YVtpbmRleF07IAorICAgICAgICAgfQorICAgICAgICAgLyogVk9TIG1lc3NhZ2Ugd3JhcHBlciAqLworICAgICAgICAgdm9zTXNnLnR5cGUgPSBlV05JX1NNRV9DT0VYX0lORDsKKyAgICAgICAgIHZvc01zZy5ib2R5cHRyID0gKHZvaWQgKilwU21lQ29leEluZDsKKyAgICAgICAgIHZvc01zZy5ib2R5dmFsID0gMDsKKyAgICAgICAgIC8qIFNlbmQgbWVzc2FnZSB0byBTTUUgKi8KKyAgICAgICAgIGlmIChWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gdm9zX21xX3Bvc3RfbWVzc2FnZShWT1NfTVFfSURfU01FLCAodm9zX21zZ190Kikmdm9zTXNnKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIGZyZWUgdGhlIG1lbSBhbmQgcmV0dXJuICovCisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUoKHZfVk9JRF90ICopcFNtZUNvZXhJbmQpOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgLyogREVCVUcgKi8KKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgIltDT0VYIFdEQV0gQ29leCBJbmQgVHlwZSAoJXgpIGRhdGEgKCV4ICV4ICV4ICV4KSIsCisgICAgICAgICAgICAgICAgICAgICAgcFNtZUNvZXhJbmQtPmNvZXhJbmRUeXBlLCAKKyAgICAgICAgICAgICAgICAgICAgICBwU21lQ29leEluZC0+Y29leEluZERhdGFbMF0sIAorICAgICAgICAgICAgICAgICAgICAgIHBTbWVDb2V4SW5kLT5jb2V4SW5kRGF0YVsxXSwgCisgICAgICAgICAgICAgICAgICAgICAgcFNtZUNvZXhJbmQtPmNvZXhJbmREYXRhWzJdLCAKKyAgICAgICAgICAgICAgICAgICAgICBwU21lQ29leEluZC0+Y29leEluZERhdGFbM10pOyAKKyAgICAgICAgIH0KKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXRElfVFhfQ09NUExFVEVfSU5EOgorICAgICAgeworICAgICAgICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9ICh0cEFuaVNpckdsb2JhbCApVk9TX0dFVF9NQUNfQ1RYVChwV0RBLT5wVm9zQ29udGV4dCkgOworICAgICAgICAgLyogQ2FsbGluZyBUeENvbXBsZXRlQWNrIEluZGljYXRpb24gZnJvbSB3ZGEgY29udGV4dCovCisgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICJDb21wbGV0ZSBJbmRpY2F0aW9uIHJlY2VpdmVkIGZyb20gSEFMIik7CisgICAgICAgICBpZiggcFdEQS0+cEFja1R4Q2JGdW5jICkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIGlmKCBWT1NfU1RBVFVTX1NVQ0NFU1MgIT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdEQV9TVE9QX1RJTUVSKCZwV0RBLT53ZGFUaW1lcnMuVHhDb21wbGV0ZVRpbWVyKSkKKyAgICAgICAgICAgIHsgIAorICAgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJUeCBDb21wbGV0ZSB0aW1lb3V0IFRpbWVyIFN0b3AgRmFpbGVkICIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKCFJU19GRUFUVVJFX1NVUFBPUlRFRF9CWV9GVyhFTkhBTkNFRF9UWEJEX0NPTVBMRVRJT04pKQorICAgICAgICAgICAgICAgIHBXREEtPnBBY2tUeENiRnVuYyggcE1hYywgJndkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS50eF9jb21wbGV0ZV9zdGF0dXMpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHBXREEtPnBBY2tUeENiRnVuYyggcE1hYywgJndkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS53ZGlUeEJkSW5kKTsKKyAgICAgICAgICAgIHBXREEtPnBBY2tUeENiRnVuYyA9IE5VTEw7CisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICJUeCBDb21wbGV0ZSBJbmRpY2F0aW9uIGlzIHJlY2VpdmVkIGFmdGVyIHRpbWVvdXQgIik7CisgICAgICAgICB9CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGNhc2UgV0RJX1AyUF9OT0FfU1RBUlRfSU5EIDoKKyAgICAgIHsKKyAgICAgICAgICB0U2lyUDJQTm9hU3RhcnQgICAqcFAycE5vYVN0YXJ0ID0gCisgICAgICAgICAgICAgKHRTaXJQMlBOb2FTdGFydCAqKXZvc19tZW1fbWFsbG9jKHNpemVvZih0U2lyUDJQTm9hU3RhcnQpKTsKKworICAgICAgICAgIGlmIChOVUxMID09IHBQMnBOb2FTdGFydCkKKyAgICAgICAgICB7CisgICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgIk1lbW9yeSBhbGxvY2F0aW9uIGZhaWx1cmUsICIKKyAgICAgICAgICAgICAgICAgICAgICAgICJXRElfUDJQX05PQV9TVEFSVF9JTkQgbm90IGZvcndhcmRlZCIpOworICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIH0KKyAgICAgICAgICBwUDJwTm9hU3RhcnQtPnN0YXR1cyAgICAgICAgICAgID0gCisgICAgICAgICAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpUDJwTm9hU3RhcnRJbmZvLnN0YXR1czsKKyAgICAgICAgICBwUDJwTm9hU3RhcnQtPmJzc0lkeCAgICAgICAgPSAKKyAgICAgICAgICAgICAgICAgICAgIHdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS53ZGlQMnBOb2FTdGFydEluZm8uYnNzSWR4OworICAgICAgICAgIFdEQV9TZW5kTXNnKHBXREEsIFNJUl9IQUxfUDJQX05PQV9TVEFSVF9JTkQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopcFAycE5vYVN0YXJ0ICwgMCkgOworICAgICAgICAgIGJyZWFrOworICAgICAgfQorCisjaWZkZWYgRkVBVFVSRV9XTEFOX1RETFMKKyAgICAgIGNhc2UgV0RJX1RETFNfSU5EIDoKKyAgICAgIHsKKyAgICAgICAgICB0U2lyVGRsc0luZCAgKnBUZGxzSW5kID0KKyAgICAgICAgICAgICAodFNpclRkbHNJbmQgKil2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpclRkbHNJbmQpKTsKKworICAgICAgICAgIGlmIChOVUxMID09IHBUZGxzSW5kKQorICAgICAgICAgIHsKKyAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAiTWVtb3J5IGFsbG9jYXRpb24gZmFpbHVyZSwgIgorICAgICAgICAgICAgICAgICAgICAgICAgIldESV9URExTX0lORCBub3QgZm9yd2FyZGVkIik7CisgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgfQorICAgICAgICAgIHBUZGxzSW5kLT5zdGF0dXMgICAgICAgICAgICA9CisgICAgICAgICAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpVGRsc0luZEluZm8uc3RhdHVzOworICAgICAgICAgIHBUZGxzSW5kLT5hc3NvY0lkICAgICAgICA9CisgICAgICAgICAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpVGRsc0luZEluZm8uYXNzb2NJZDsKKyAgICAgICAgICBwVGRsc0luZC0+c3RhSWR4ID0KKyAgICAgICAgICAgICAgICAgICAgIHdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS53ZGlUZGxzSW5kSW5mby5zdGFJZHg7CisgICAgICAgICAgcFRkbHNJbmQtPnJlYXNvbkNvZGUgICAgPQorICAgICAgICAgICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaVRkbHNJbmRJbmZvLnJlYXNvbkNvZGU7CisgICAgICAgICAgV0RBX1NlbmRNc2cocFdEQSwgU0lSX0hBTF9URExTX0lORCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKXBUZGxzSW5kICwgMCkgOworICAgICAgICAgIGJyZWFrOworICAgICAgfQorI2VuZGlmCisgICAgICBjYXNlIFdESV9QMlBfTk9BX0FUVFJfSU5EIDoKKyAgICAgIHsKKyAgICAgICAgIHRTaXJQMlBOb2FBdHRyICAgKnBQMnBOb2FBdHRyID0gCisgICAgICAgICAgICAodFNpclAyUE5vYUF0dHIgKil2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpclAyUE5vYUF0dHIpKTsKKyAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlJlY2VpdmVkIFdESV9QMlBfTk9BX0FUVFJfSU5EIGZyb20gV0RJIik7CisgICAgICAgICBpZiAoTlVMTCA9PSBwUDJwTm9hQXR0cikKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIk1lbW9yeSBhbGxvY2F0aW9uIGZhaWx1cmUsICIKKyAgICAgICAgICAgICAgICAgICAgICAgIldESV9QMlBfTk9BX0FUVFJfSU5EIG5vdCBmb3J3YXJkZWQiKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgfQorICAgICAgICAgcFAycE5vYUF0dHItPmluZGV4ICAgICAgICAgICAgPSAKKyAgICAgICAgICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaVAycE5vYUF0dHJJbmZvLnVjSW5kZXg7CisgICAgICAgICBwUDJwTm9hQXR0ci0+b3BwUHNGbGFnICAgICAgICA9IAorICAgICAgICAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpUDJwTm9hQXR0ckluZm8udWNPcHBQc0ZsYWc7CisgICAgICAgICBwUDJwTm9hQXR0ci0+Y3RXaW4gICAgICAgICAgICA9IAorICAgICAgICAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpUDJwTm9hQXR0ckluZm8udXNDdFdpbjsKKyAgICAgICAgIAorICAgICAgICAgcFAycE5vYUF0dHItPnVOb2ExSW50ZXJ2YWxDbnQgPSAKKyAgICAgICAgICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaVAycE5vYUF0dHJJbmZvLnVzTm9hMUludGVydmFsQ250OworICAgICAgICAgcFAycE5vYUF0dHItPnVOb2ExRHVyYXRpb24gICAgPSAKKyAgICAgICAgICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaVAycE5vYUF0dHJJbmZvLnVzbE5vYTFEdXJhdGlvbjsKKyAgICAgICAgIHBQMnBOb2FBdHRyLT51Tm9hMUludGVydmFsICAgID0gCisgICAgICAgICAgICAgICAgICAgIHdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS53ZGlQMnBOb2FBdHRySW5mby51c2xOb2ExSW50ZXJ2YWw7CisgICAgICAgICBwUDJwTm9hQXR0ci0+dU5vYTFTdGFydFRpbWUgICA9IAorICAgICAgICAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpUDJwTm9hQXR0ckluZm8udXNsTm9hMVN0YXJ0VGltZTsKKyAgICAgICAgIHBQMnBOb2FBdHRyLT51Tm9hMkludGVydmFsQ250ID0gCisgICAgICAgICAgICAgICAgICAgIHdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS53ZGlQMnBOb2FBdHRySW5mby51c05vYTJJbnRlcnZhbENudDsKKyAgICAgICAgIHBQMnBOb2FBdHRyLT51Tm9hMkR1cmF0aW9uICAgID0gCisgICAgICAgICAgICAgICAgICAgIHdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS53ZGlQMnBOb2FBdHRySW5mby51c2xOb2EyRHVyYXRpb247CisgICAgICAgICBwUDJwTm9hQXR0ci0+dU5vYTJJbnRlcnZhbCAgICA9IAorICAgICAgICAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpUDJwTm9hQXR0ckluZm8udXNsTm9hMkludGVydmFsOworICAgICAgICAgcFAycE5vYUF0dHItPnVOb2EyU3RhcnRUaW1lICAgPSAKKyAgICAgICAgICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaVAycE5vYUF0dHJJbmZvLnVzbE5vYTJTdGFydFRpbWU7CisgICAgICAgICBXREFfU2VuZE1zZyhwV0RBLCBTSVJfSEFMX1AyUF9OT0FfQVRUUl9JTkQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilwUDJwTm9hQXR0ciAsIDApIDsKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorI2lmZGVmIEZFQVRVUkVfV0xBTl9TQ0FOX1BOTworICAgICAgY2FzZSBXRElfUFJFRl9ORVRXT1JLX0ZPVU5EX0lORDoKKyAgICAgIHsKKyAgICAgICAgIHZvc19tc2dfdCB2b3NNc2c7CisgICAgICAgICB2X1UzMl90IHNpemUgPSBzaXplb2YodFNpclByZWZOZXR3b3JrRm91bmRJbmQpICsKKyAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpUHJlZk5ldHdvcmtGb3VuZEluZC5mcmFtZUxlbmd0aDsKKyAgICAgICAgIHRTaXJQcmVmTmV0d29ya0ZvdW5kSW5kICpwUHJlZk5ldHdvcmtGb3VuZEluZCA9CisgICAgICAgICAgICAgKHRTaXJQcmVmTmV0d29ya0ZvdW5kSW5kICopdm9zX21lbV9tYWxsb2Moc2l6ZSk7CisKKyAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlJlY2VpdmVkIFdESV9QUkVGX05FVFdPUktfRk9VTkRfSU5EIGZyb20gV0RJIik7CisgICAgICAgICBpZiAoTlVMTCA9PSBwUHJlZk5ldHdvcmtGb3VuZEluZCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIk1lbW9yeSBhbGxvY2F0aW9uIGZhaWx1cmUsICIKKyAgICAgICAgICAgICAgICAgICAgICAgIldESV9QUkVGX05FVFdPUktfRk9VTkRfSU5EIG5vdCBmb3J3YXJkZWQiKTsKKyAgICAgICAgICAgIGlmIChOVUxMICE9CisgICAgICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaVByZWZOZXR3b3JrRm91bmRJbmQucERhdGEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgd3BhbE1lbW9yeUZyZWUoCisgICAgICAgICAgICAgICAgIHdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS53ZGlQcmVmTmV0d29ya0ZvdW5kSW5kLnBEYXRhCisgICAgICAgICAgICAgICAgKTsKKyAgICAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpUHJlZk5ldHdvcmtGb3VuZEluZC5wRGF0YSA9IE5VTEw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIH0KKyAgICAgICAgIC8qIE1lc3NhZ2UgSGVhZGVyICovCisgICAgICAgICBwUHJlZk5ldHdvcmtGb3VuZEluZC0+bWVzZ1R5cGUgPSBlV05JX1NNRV9QUkVGX05FVFdPUktfRk9VTkRfSU5EOworICAgICAgICAgcFByZWZOZXR3b3JrRm91bmRJbmQtPm1lc2dMZW4gPSBzaXplOworCisgICAgICAgICAvKiBJbmZvIGZyb20gV0RJIEluZGljYXRpb24gKi8gCisgICAgICAgICBwUHJlZk5ldHdvcmtGb3VuZEluZC0+c3NJZC5sZW5ndGggPSAKKyAgICAgICAgICAgIHdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS53ZGlQcmVmTmV0d29ya0ZvdW5kSW5kLnNzSWQudWNMZW5ndGg7CisgICAgICAgICB2b3NfbWVtX3NldCggcFByZWZOZXR3b3JrRm91bmRJbmQtPnNzSWQuc3NJZCwgMzIsIDApOworICAgICAgICAgdm9zX21lbV9jb3B5KCBwUHJlZk5ldHdvcmtGb3VuZEluZC0+c3NJZC5zc0lkLCAKKyAgICAgICAgICAgICAgICAgIHdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS53ZGlQcmVmTmV0d29ya0ZvdW5kSW5kLnNzSWQuc1NTSUQsIAorICAgICAgICAgICAgICAgICAgcFByZWZOZXR3b3JrRm91bmRJbmQtPnNzSWQubGVuZ3RoKTsKKyAgICAgICAgIGlmIChOVUxMICE9CisgICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaVByZWZOZXR3b3JrRm91bmRJbmQucERhdGEpCisgICAgICAgICB7CisgICAgICAgICAgICBwUHJlZk5ldHdvcmtGb3VuZEluZC0+ZnJhbWVMZW5ndGggPQorICAgICAgICAgICAgICAgIHdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS53ZGlQcmVmTmV0d29ya0ZvdW5kSW5kLmZyYW1lTGVuZ3RoOworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCBwUHJlZk5ldHdvcmtGb3VuZEluZC0+ZGF0YSwKKyAgICAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpUHJlZk5ldHdvcmtGb3VuZEluZC5wRGF0YSwKKyAgICAgICAgICAgICAgICBwUHJlZk5ldHdvcmtGb3VuZEluZC0+ZnJhbWVMZW5ndGgpOworICAgICAgICAgICAgd3BhbE1lbW9yeUZyZWUod2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaVByZWZOZXR3b3JrRm91bmRJbmQucERhdGEpOworICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaVByZWZOZXR3b3JrRm91bmRJbmQucERhdGEgPSBOVUxMOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgcFByZWZOZXR3b3JrRm91bmRJbmQtPmZyYW1lTGVuZ3RoID0gMDsKKyAgICAgICAgIH0KKyAgICAgICAgIHBQcmVmTmV0d29ya0ZvdW5kSW5kIC0+cnNzaSA9IHdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9u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VJlYXNvbkluZCA9ICh0U2lyV2FrZVJlYXNvbkluZCAqKXZvc19tZW1fbWFsbG9jKGFsbG9jU2l6ZSk7CisKKyAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIltXQUtFX1JFQVNPTiBXREldIFdBS0VfUkVBU09OX0lORCBUeXBlICglZCkgZGF0YSAodWxSZWFzb249MHgleCwgdWxSZWFzb25Bcmc9MHgleCwgdWxTdG9yZWREYXRhTGVuPTB4JXgpIiwKKyAgICAgICAgICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25UeXBlLAorICAgICAgICAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpV2FrZVJlYXNvbkluZC51bFJlYXNvbiwKKyAgICAgICAgICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaVdha2VSZWFzb25JbmQudWxSZWFzb25BcmcsCisgICAgICAgICAgICAgICAgICAgIHdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS53ZGlXYWtlUmVhc29uSW5kLnVsU3RvcmVkRGF0YUxlbik7CisKKyAgICAgICAgIGlmIChOVUxMID09IHBXYWtlUmVhc29uSW5kKQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiTWVtb3J5IGFsbG9jYXRpb24gZmFpbHVyZSwgIgorICAgICAgICAgICAgICAgICAgICAgICAiV0RJX1dBS0VfUkVBU09OX0lORCBub3QgZm9yd2FyZGVkIik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIH0KKworICAgICAgICAgdm9zX21lbV96ZXJvKHBXYWtlUmVhc29uSW5kLCBhbGxvY1NpemUpOworCisgICAgICAgICAvKiBNZXNzYWdlIEhlYWRlciAqLworICAgICAgICAgcFdha2VSZWFzb25JbmQtPm1lc2dUeXBlID0gZVdOSV9TTUVfV0FLRV9SRUFTT05fSU5EOworICAgICAgICAgcFdha2VSZWFzb25JbmQtPm1lc2dMZW4gPSBhbGxvY1NpemU7CisKKyAgICAgICAgIC8qIEluZm8gZnJvbSBXREkgSW5kaWNhdGlvbiAqLworICAgICAgICAgLy8gRmlsbCBwV2FrZVJlYXNvbkluZCBzdHJ1Y3R1cmUgZnJvbSB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpV2FrZVJlYXNvbkluZAorICAgICAgICAgcFdha2VSZWFzb25JbmQtPnVsUmVhc29uID0gd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaVdha2VSZWFzb25JbmQudWxSZWFzb247CisgICAgICAgICBwV2FrZVJlYXNvbkluZC0+dWxSZWFzb25BcmcgPSB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpV2FrZVJlYXNvbkluZC51bFJlYXNvbkFyZzsKKyAgICAgICAgIHBXYWtlUmVhc29uSW5kLT51bFN0b3JlZERhdGFMZW4gPSB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpV2FrZVJlYXNvbkluZC51bFN0b3JlZERhdGFMZW47CisgICAgICAgICBwV2FrZVJlYXNvbkluZC0+dWxBY3R1YWxEYXRhTGVuID0gd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaVdha2VSZWFzb25JbmQudWxBY3R1YWxEYXRhTGVuOyAgICAgICAgIAorICAgICAgICAgdm9zX21lbV9jb3B5KCAodm9pZCAqKSYocFdha2VSZWFzb25JbmQtPmFEYXRhU3RhcnRbMF0pLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICYod2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaVdha2VSZWFzb25JbmQuYURhdGFTdGFydFswXSksIAorICAgICAgICAgICAgICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaVdha2VSZWFzb25JbmQudWxTdG9yZWREYXRhTGVuKTsKKworICAgICAgICAgLyogVk9TIG1lc3NhZ2Ugd3JhcHBlciAqLworICAgICAgICAgdm9zTXNnLnR5cGUgPSBlV05JX1NNRV9XQUtFX1JFQVNPTl9JTkQ7CisgICAgICAgICB2b3NNc2cuYm9keXB0ciA9ICh2b2lkICopIHBXYWtlUmVhc29uSW5kOworICAgICAgICAgdm9zTXNnLmJvZHl2YWwgPSAwOworCisgICAgICAgICAvKiBTZW5kIG1lc3NhZ2UgdG8gU01FICovCisgICAgICAgICBpZiAoVk9TX1NUQVRVU19TVUNDRVNTICE9IHZvc19tcV9wb3N0X21lc3NhZ2UoVk9TX01RX0lEX1NNRSwgKHZvc19tc2dfdCopJnZvc01zZykpCisgICAgICAgICB7CisgICAgICAgICAgICAvKiBmcmVlIHRoZSBtZW0gYW5kIHJldHVybiAqLworICAgICAgICAgICAgdm9zX21lbV9mcmVlKCh2X1ZPSURfdCAqKSBwV2FrZVJlYXNvbkluZCk7CisgICAgICAgICB9CisKKyAgICAgICAgIGJyZWFrOworICAgICAgfQorI2VuZGlmIC8vIFdMQU5fV0FLRVVQX0VWRU5UUworICAgICAgCisgICAgICBjYXNlIFdESV9UWF9QRVJfSElUX0lORDoKKyAgICAgIHsKKyAgICAgICAgIHZvc19tc2dfdCB2b3NNc2c7CisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLCAiR2V0IFdESV9UWF9QRVJfSElUX0lORCIpOworICAgICAgICAgLyogc2VuZCBJTkQgdG8gUEUgZVdOSV9TTUVfVFhfUEVSX0hJVF9JTkQqLworICAgICAgICAgLyogVk9TIG1lc3NhZ2Ugd3JhcHBlciAqLworICAgICAgICAgdm9zTXNnLnR5cGUgPSBlV05JX1NNRV9UWF9QRVJfSElUX0lORDsKKyAgICAgICAgIHZvc01zZy5ib2R5cHRyID0gTlVMTDsKKyAgICAgICAgIHZvc01zZy5ib2R5dmFsID0gMDsKKyAgICAgICAgIC8qIFNlbmQgbWVzc2FnZSB0byBTTUUgKi8KKyAgICAgICAgIGlmIChWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gdm9zX21xX3Bvc3RfbWVzc2FnZShWT1NfTVFfSURfU01FLCAodm9zX21zZ190Kikmdm9zTXNnKSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sICJwb3N0IGVXTklfU01FX1RYX1BFUl9ISVRfSU5EIHRvIFNNRSBGYWlsZWQiKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAKKyNpZmRlZiBGRUFUVVJFX1dMQU5fTFBIQgorICAgICAgY2FzZSBXRElfTFBIQl9JTkQ6CisgICAgICB7CisgICAgICAgICB2b3NfbXNnX3QgICAgIHZvc01zZzsKKyAgICAgICAgIHRTaXJMUEhCSW5kICAqbHBoYkluZDsKKworICAgICAgICAgbHBoYkluZCA9CisgICAgICAgICAgICh0U2lyTFBIQkluZCAqKXZvc19tZW1fbWFsbG9jKHNpemVvZih0U2lyTFBIQkluZCkpOworICAgICAgICAgaWYgKE5VTEwgPT0gbHBoYkluZCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBMUEhCIElORCBidWZmZXIgYWxsb2MgRmFpbCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHJldHVybiA7CisgICAgICAgICB9CisKKyAgICAgIC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TU19QRUVSX0lOQUNUSVZJVFlfSU5EOgorICAgICAgeworICAgICAgICAgdFNpcklic3NQZWVySW5hY3Rpdml0eUluZCAgKnBJYnNzSW5kID0KKyAgICAgICAgICAgICh0U2lySWJzc1BlZXJJbmFjdGl2aXR5SW5kICopCisgICAgICAgICAgICB2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpcklic3NQZWVySW5hY3Rpdml0eUluZCkpOworCisgICAgICAgICBpZiAoTlVMTCA9PSBwSWJzc0luZCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICJNZW1vcnkgYWxsb2NhdGlvbiBmYWlsdXJlLCAiCisgICAgICAgICAgICAgICAgICAiV0RJX0lCU1NfUEVFUl9JTkFDVElWSVRZX0lORCBub3QgZm9yd2FyZGVkIik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIH0KKworICAgICAgICAgcElic3NJbmQtPmJzc0lkeCA9CisgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpSWJzc1BlZXJJbmFjdGl2aXR5SW5kLmJzc0lkeDsKKyAgICAgICAgIHBJYnNzSW5kLT5zdGFJZHggPQorICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaUlic3NQZWVySW5hY3Rpdml0eUluZC5zdGFJZHg7CisgICAgICAgICB2b3NfbWVtX2NvcHkocElic3NJbmQtPnBlZXJBZGRyLAorICAgICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaUlic3NQZWVySW5hY3Rpdml0eUluZC5zdGFNYWNBZGRyLAorICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgICBXREFfU2VuZE1zZyhwV0RBLCBXREFfSUJTU19QRUVSX0lOQUNUSVZJVFlfSU5ELCAodm9pZCAqKXBJYnNzSW5kLCAwKSA7CisgICAgICAgICBicmVhazsKKyAgICAgIH0KKworI2lmZGVmIEZFQVRVUkVfV0xBTl9CQVRDSF9TQ0FOCisgICAgIGNhc2UgIFdESV9CQVRDSF9TQ0FOX1JFU1VMVF9JTkQ6CisgICAgIHsKKyAgICAgICAgIHZvaWQgKnBCYXRjaFNjYW5SZXN1bHQ7CisgICAgICAgICB2b2lkICpwQ2FsbGJhY2tDb250ZXh0OworICAgICAgICAgdHBBbmlTaXJHbG9iYWwgcE1hYzsKKworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICAgICAgICJSZWNlaXZlZCBXRElfQkFUQ0hTQ0FOX1JFU1VMVF9JTkQgZnJvbSBGVyIpOworCisgICAgICAgICAvKnNhbml0eSBjaGVjayovCisgICAgICAgICBpZiAoTlVMTCA9PSBwV0RBKQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAiJXM6cFdEQSBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgIH0KKworICAgICAgICAgcEJhdGNoU2NhblJlc3VsdCA9CisgICAgICAgICAgICAodm9pZCAqKXdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS5wQmF0Y2hTY2FuUmVzdWx0OworICAgICAgICAgaWYgKE5VTEwgPT0gcEJhdGNoU2NhblJlc3VsdCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIiVzOkJhdGNoIHNjYW4gcmVzdWx0IGZyb20gRlcgaXMgbnVsbCBjYW4ndCBpbnZva2UgSEREIGNhbGxiYWNrIiwKKyAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgIH0KKworICAgICAgICAgcE1hYyA9ICh0cEFuaVNpckdsb2JhbCApVk9TX0dFVF9NQUNfQ1RYVChwV0RBLT5wVm9zQ29udGV4dCk7CisgICAgICAgICBpZiAoTlVMTCA9PSBwTWFjKQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAiJXM6cE1hYyBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgIH0KKworICAgICAgICAgcENhbGxiYWNrQ29udGV4dCA9IHBNYWMtPnBtYy5iYXRjaFNjYW5SZXN1bHRDYWxsYmFja0NvbnRleHQ7CisgICAgICAgICAvKmNhbGwgaGRkIGNhbGxiYWNrIHdpdGggc2V0IGJhdGNoIHNjYW4gcmVzcG9uc2UgZGF0YSovCisgICAgICAgICBpZihwTWFjLT5wbWMuYmF0Y2hTY2FuUmVzdWx0Q2FsbGJhY2spCisgICAgICAgICB7CisgICAgICAgICAgICBwTWFjLT5wbWMuYmF0Y2hTY2FuUmVzdWx0Q2FsbGJhY2socENhbGxiYWNrQ29udGV4dCwKKyAgICAgICAgICAgICAgIHBCYXRjaFNjYW5SZXN1bHQpOworICAgICAgICAgfQorICAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIiVzOkhERCBjYWxsYmFjayBpcyBudWxsIiwgX19mdW5jX18pOworICAgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGJyZWFrOworICAgICB9CisjZW5kaWYKKworI2lmZGVmIEZFQVRVUkVfV0xBTl9DSF9BVk9JRAorICAgICAgY2FzZSBXRElfQ0hfQVZPSURfSU5EOgorICAgICAgeworICAgICAgICAgdm9zX21zZ190ICAgICAgICAgICAgdm9zTXNnOworICAgICAgICAgdFNpckNoQXZvaWRJbmRUeXBlICAqY2hBdm9pZEluZDsKKworICAgICAgICAgY2hBdm9pZEluZCA9CisgICAgICAgICAgICh0U2lyQ2hBdm9pZEluZFR5cGUgKil2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpckNoQXZvaWRJbmRUeXBlKSk7CisgICAgICAgICBpZiAoTlVMTCA9PSBjaEF2b2lkSW5kKQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IENIX0FWT0lEIElORCBidWZmZXIgYWxsb2MgRmFpbCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIHJldHVybiA7CisgICAgICAgICB9CisKKyAgICAgICAgIGNoQXZvaWRJbmQtPmF2b2lkUmFuZ2VDb3VudCA9CisgICAgICAgICAgICAgIHdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS53ZGlDaEF2b2lkSW5kLmF2b2lkUmFuZ2VDb3VudDsKKyAgICAgICAgIHdwYWxNZW1vcnlDb3B5KCh2b2lkICopY2hBdm9pZEluZC0+YXZvaWRGcmVxUmFuZ2UsCisgICAgICAgICAgICAgKHZvaWQgKil3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpQ2hBdm9pZEluZC5hdm9pZEZyZXFSYW5nZSwKKyAgICAgICAgICAgICBjaEF2b2lkSW5kLT5hdm9pZFJhbmdlQ291bnQgKiBzaXplb2YodFNpckNoQXZvaWRGcmVxVHlwZSkpOworCisgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICIlcyA6IFdEQSBDSCBhdm9pZCBub3RpZmljYXRpb24iLCBfX2Z1bmNfXyk7CisKKyAgICAgICAgIHZvc01zZy50eXBlICAgID0gZVdOSV9TTUVfQ0hfQVZPSURfSU5EOworICAgICAgICAgdm9zTXNnLmJvZHlwdHIgPSBjaEF2b2lkSW5kOworICAgICAgICAgdm9zTXNnLmJvZHl2YWwgPSAwOworICAgICAgICAgLyogU2VuZCBtZXNzYWdlIHRvIFNNRSAqLworICAgICAgICAgaWYgKFZPU19TVEFUVVNfU1VDQ0VTUyAhPQorICAgICAgICAgICAgIHZvc19tcV9wb3N0X21lc3NhZ2UoVk9TX01RX0lEX1NNRSwgKHZvc19tc2dfdCopJnZvc01zZykpCisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAicG9zdCBlV05JX1NNRV9DSF9BVk9JRF9JTkQgdG8gU01FIEZhaWxlZCIpOworICAgICAgICAgICAgdm9zX21lbV9mcmVlKGNoQXZvaWRJbmQpOworICAgICAgICAgfQorICAgICAgICAgYnJlYWs7CisgICAgICB9CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0NIX0FWT0lEICovCisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfTElOS19MQVlFUl9TVEFUUworICAgICBjYXNlICBXRElfTExfU1RBVFNfUkVTVUxUU19JTkQ6CisgICAgIHsKKyAgICAgICAgIHZvaWQgKnBMaW5rTGF5ZXJTdGF0c0luZDsKKyAgICAgICAgIHRwQW5pU2lyR2xvYmFsIHBNYWM7CisKKyAgICAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgIlJlY2VpdmVkIFdESV9MTF9TVEFUU19SRVNVTFRTX0lORCBmcm9tIEZXIik7CisKKyAgICAgICAgIC8qc2FuaXR5IGNoZWNrKi8KKyAgICAgICAgIGlmIChOVUxMID09IHBXREEpCisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICIlczpwV0RBIGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgfQorCisgICAgICAgICBwTGlua0xheWVyU3RhdHNJbmQgPQorICAgICAgICAgICAgKHZvaWQgKil3ZGlMb3dMZXZlbEluZC0+CisgICAgICAgICAgICB3ZGlJbmRpY2F0aW9uRGF0YS53ZGlMaW5rTGF5ZXJTdGF0c1Jlc3VsdHMucExpbmtMYXllclN0YXRzUmVzdWx0czsKKyAgICAgICAgIGlmIChOVUxMID09IHBMaW5rTGF5ZXJTdGF0c0luZCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIiVzOkxpbmsgTGF5ZXIgU3RhdGlzdGljcyBmcm9tIEZXIGlzIG51bGwgY2FuJ3QgaW52b2tlIEhERCBjYWxsYmFjayIsCisgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgICB9CisKKyAgICAgICAgIHBNYWMgPSAodHBBbmlTaXJHbG9iYWwgKVZPU19HRVRfTUFDX0NUWFQocFdEQS0+cFZvc0NvbnRleHQpOworICAgICAgICAgaWYgKE5VTEwgPT0gcE1hYykKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIiVzOnBNYWMgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgICB9CisKKyAgICAgICAgIC8qIGNhbGwgaGRkIGNhbGxiYWNrIHdpdGggTGluayBMYXllciBTdGF0aXN0aWNzLgorICAgICAgICAgICogdmRldl9pZC9pZmFjSWQgaW4gbGlua19zdGF0c19yZXN1bHRzIHdpbGwgYmUKKyAgICAgICAgICAqIHVzZWQgdG8gcmV0cmlldmUgdGhlIGNvcnJlY3QgSEREIGNvbnRleHQKKyAgICAgICAgICAqLworICAgICAgICAgaWYgKHBNYWMtPnNtZS5wTGlua0xheWVyU3RhdHNJbmRDYWxsYmFjaykKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHBNYWMtPnNtZS5wTGlua0xheWVyU3RhdHNJbmRDYWxsYmFjayhwTWFjLT5wQWRhcHRlciwKKyAgICAgICAgICAgICAgICBXREFfTElOS19MQVlFUl9TVEFUU19SRVNVTFRTX1JTUCwKKyAgICAgICAgICAgICAgIHBMaW5rTGF5ZXJTdGF0c0luZCwKKyAgICAgICAgICAgICAgIHdkaUxvd0xldmVsSW5kLT4KKyAgICAgICAgICAgICAgIHdkaUluZGljYXRpb25EYXRhLndkaUxpbmtMYXllclN0YXRzUmVzdWx0cy5tYWNBZGRyKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9F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AgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgICB9CisgICAgICAgICBpZiAod2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25UeXBlID09IFdESV9FWFRTQ0FOX1BST0dSRVNTX0lORCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgICBpbmRUeXBlID0gV0RBX0VYVFNDQU5fUFJPR1JFU1NfSU5EOworCisgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgIldESV9FWFRTQ0FOIEluZGljYXRpb24gaXMgV0RJX0VYVFNDQU5fUFJPR1JFU1NfSU5EIik7CisgICAgICAgICB9CisgICAgICAgICBpZiAod2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25UeXBlID09CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdESV9FWFRTQ0FOX1NDQU5fQVZBSUxBQkxFX0lORCkKKyAgICAgICAgIHsKKyAgICAgICAgICAgICBpbmRUeXBlID0gV0RBX0VYVFNDQU5fU0NBTl9BVkFJTEFCTEVfSU5EOworCisgICAgICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAiV0RJX0VYVFNDQU4gSW5kaWNhdGlvbiBpcyBXRElfRVhUU0NBTl9TQ0FOX0FWQUlMQUJMRV9JTkQiKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGlmICh3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvblR5cGUgPT0gV0RJX0VYVFNDQU5fU0NBTl9SRVNVTFRfSU5EKQorICAgICAgICAgeworICAgICAgICAgICAgIGluZFR5cGUgPSBXREFfRVhUU0NBTl9TQ0FOX1JFU1VMVF9JTkQ7CisKKyAgICAgICAg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hbkRhdGEgPQorICAgICAgICAgICAgKHZvaWQgKil3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEucEVYVFNjYW5JbmREYXRhOworICAgICAgICAgaWYgKE5VTEwgPT0gcEVYVFNjYW5EYXRhKQorICAgICAgICAgeworICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIiVzOiBFWFRTQ0FOIEluZGljYXRpb24gRGF0YSBpcyBudWxsLCBjYW4ndCBpbnZva2UgSEREIGNhbGxiYWNrIiwKKyAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgIH0KKworICAgICAgICAgcE1hYyA9ICh0cEFuaVNpckdsb2JhbCApVk9TX0dFVF9NQUNfQ1RYVChwV0RBLT5wVm9zQ29udGV4dCk7CisgICAgICAgICBpZiAoTlVMTCA9PSBwTWFjKQorICAgICAgICAgeworICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICIlczpwTWFjIGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICB9CisKKyAgICAgICAgIHBDYWxsYmFja0NvbnRleHQgPSBwTWFjLT5zbWUucEVYVFNjYW5DYWxsYmFja0NvbnRleHQ7CisKKyAgICAgICAgIGlmKHBNYWMtPnNtZS5wRVhUU2NhbkluZENiKQorICAgICAgICAgeworICAgICAgICAgICAgIHBNYWMtPnNtZS5wRVhUU2NhbkluZENiKHBDYWxsYmFja0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICBpbmRUeXBlLAorICAgICAgICAgICAgICAgICAgICAgcEVYVFNjYW5EYXRhKTsKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UKKyAgICAgICAgIHsKKyAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAiJXM6SEREIGNhbGxiYWNrIGlzIG51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgICB9CisgICAgICAgICBicmVhazsKKyAgICAgfQorI2VuZGlmIC8qIFdMQU5fRkVBVFVSRV9FWFRTQ0FOICovCisgICAgICBjYXNlIFdESV9ERUxfQkFfSU5EOgorICAgICAgeworICAgICAgICAgdHBCQURlbGV0ZVBhcmFtcyAgcERlbEJBSW5kID0KKyAgICAgICAgICAgKHRwQkFEZWxldGVQYXJhbXMpdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRwQkFEZWxldGVQYXJhbXMpKTsKKworICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJSZWNlaXZlZCBXRElfREVMX0JBX0lORCBmcm9tIFdESSAiKTsKKyAgICAgICAgIGlmKE5VTEwgPT0gcERlbEJBSW5kKQorICAgICAgICAgeworICAgICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogVk9TIE1FTSBBbGxvYyBGYWlsdXJlIiwgX19mdW5jX18pOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICB9CisgICAgICAgICB2b3NfbWVtX2NvcHkocERlbEJBSW5kLT5wZWVyTWFjQWRkciwKKyAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpRGVsZXRlQkFJbmQucGVlck1hY0FkZHIsCisgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgICB2b3NfbWVtX2NvcHkocERlbEJBSW5kLT5ic3NJZCwKKyAgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpRGVsZXRlQkFJbmQuYnNzSWQsCisgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgICBwRGVsQkFJbmQtPnN0YUlkeCAgPQorICAgICAgICAgIHdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS53ZGlEZWxldGVCQUluZC5zdGFJZHg7CisgICAgICAgICBwRGVsQkFJbmQtPmJhVElEICA9CisgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaURlbGV0ZUJBSW5kLmJhVElEOworICAgICAgICAgcERlbEJBSW5kLT5iYURpcmVjdGlvbiAgPQorICAgICAgICAgIHdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS53ZGlEZWxldGVCQUluZC5iYURpcmVjdGlvbjsKKyAgICAgICAgIHBEZWxCQUluZC0+cmVhc29uQ29kZSAgID0KKyAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpRGVsZXRlQkFJbmQucmVhc29uQ29kZTsKKworICAgICAgICAgV0RBX1NlbmRNc2cocFdEQSwgU0lSX0xJTV9ERUxfQkFfSU5ELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopcERlbEJBSW5kICwgMCkgOworICAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIFdESV9OQU5fRVZFTlRfSU5EOgorICAgICAgeworICAgICAgICAgdm9zX21zZ190IHZvc01zZzsKKyAgICAgICAgIHRwU2lyTmFuRXZlbnQgcFNpck5hbkV2ZW50ID0gTlVMTDsKKworICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgIlJlY2VpdmVkIFdESV9OQU5fRVZFTlQiKTsKKworICAgICAgICAgcFNpck5hbkV2ZW50ID0gKHRwU2lyTmFuRXZlbnQpdm9zX21lbV9tYWxsb2MoIHNpemVvZiggdFNpck5hbkV2ZW50ICkKKyAgICAgICAgICAgICAgLSBzaXplb2YoIHBTaXJOYW5FdmVudC0+ZXZlbnRfZGF0YSkKKyAgICAgICAgICAgICAgKyB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpTmFuRXZlbnQuZXZlbnRfZGF0YV9sZW4pOworCisgICAgICAgICBpZiAoTlVMTCA9PSBwU2lyTmFuRXZlbnQpCisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICIlczogVk9TIE1FTSBBbGxvYyBGYWlsdXJlIiwgX19mdW5jX18pOworICAgICAgICAgICAgVk9TX0FTU0VSVCgwKSA7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIH0KKworICAgICAgICAgcFNpck5hbkV2ZW50LT5ldmVudF9kYXRhX2xlbiA9CisgICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaU5hbkV2ZW50LmV2ZW50X2RhdGFfbGVuOworCisgICAgICAgICBpZiAod2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaU5hbkV2ZW50LmV2ZW50X2RhdGFfbGVuKQorICAgICAgICAgeworICAgICAgICAgICAgdm9zX21lbV9jb3B5KCBwU2lyTmFuRXZlbnQtPmV2ZW50X2RhdGEsCisgICAgICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaU5hbkV2ZW50LmV2ZW50X2RhdGEsCisgICAgICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaU5hbkV2ZW50LmV2ZW50X2RhdGFfbGVuKTsKKyAgICAgICAgIH0KKworICAgICAgICAgLyogVk9TIG1lc3NhZ2Ugd3JhcHBlciAqLworICAgICAgICAgdm9zTXNnLnR5cGUgPSBlV05JX1NNRV9OQU5fRVZFTlQ7CisgICAgICAgICB2b3NNc2cuYm9keXB0ciA9IHBTaXJOYW5FdmVudDsKKyAgICAgICAgIHZvc01zZy5ib2R5dmFsID0gMDsKKworICAgICAgICAgLyogU2VuZCBtZXNzYWdlIHRvIFNNRSAqLworICAgICAgICAgaWYgKFZPU19TVEFUVVNfU1VDQ0VTUworICAgICAgICAgICAgICE9IHZvc19tcV9wb3N0X21lc3NhZ2UoVk9TX01RX0lEX1NNRSwgKHZvc19tc2dfdCopJnZvc01zZykpCisgICAgICAgICB7CisgICAgICAgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICAgICJwb3N0IGVXTklfU01FX05BTl9FVkVOVCB0byBTTUUgRmFpbGVkIik7CisgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocFNpck5hbkV2ZW50KTsKKyAgICAgICAgIH0KKyAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBXRElfTE9TVF9MSU5LX1BBUkFNU19JTkQ6CisgICAgICB7CisgICAgICAgICAgdHBTaXJTbWVMb3N0TGlua1BhcmFtc0luZCBwTG9zdExpbmtQYXJhbUluZCA9CisgICAgICAgICAgICAodHBTaXJTbWVMb3N0TGlua1BhcmFtc0luZCl2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpclNtZUxvc3RMaW5rUGFyYW1zSW5kKSk7CisKKyAgICAgICAgICBpZiAoTlVMTCA9PSBwTG9zdExpbmtQYXJhbUluZCkKKyAgICAgICAgICB7CisgICAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgfQorICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgIlJlY2VpdmVkIFdESV9MT1NUX0xJTktfUEFSQU1TX0lORCBmcm9tIFdESSAiKTsKKworICAgICAgICAgIHBMb3N0TGlua1BhcmFtSW5kLT5tZXNzYWdlVHlwZSA9IGVXTklfU01FX0xPU1RfTElOS19QQVJBTVNfSU5EOworICAgICAgICAgIHBMb3N0TGlua1BhcmFtSW5kLT5sZW5ndGggPSBzaXplb2YodFNpclNtZU1pY0ZhaWx1cmVJbmQpOworICAgICAgICAgIHBMb3N0TGlua1BhcmFtSW5kLT5pbmZvLmJzc0lkeCA9CisgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpTG9zdExpbmtQYXJhbXNJbmQuYnNzSWR4OworICAgICAgICAgIHBMb3N0TGlua1BhcmFtSW5kLT5pbmZvLnJzc2kgPQorICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpTG9zdExpbmtQYXJhbXNJbmQucnNzaTsKKyAgICAgICAgICB2b3NfbWVtX2NvcHkocExvc3RMaW5rUGFyYW1JbmQtPmluZm8uc2VsZk1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgIHdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS53ZGlMb3N0TGlua1BhcmFtc0luZC5zZWxmTWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSk7CisgICAgICAgICAgcExvc3RMaW5rUGFyYW1JbmQtPmluZm8ubGlua0ZsQ250ID0KKyAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaUxvc3RMaW5rUGFyYW1zSW5kLmxpbmtGbENudDsKKyAgICAgICAgICBwTG9zdExpbmtQYXJhbUluZC0+aW5mby5saW5rRmxUeCA9CisgICAgICAgICAgICB3ZGlMb3dMZXZlbEluZC0+d2RpSW5kaWNhdGlvbkRhdGEud2RpTG9zdExpbmtQYXJhbXNJbmQubGlua0ZsVHg7CisgICAgICAgICAgcExvc3RMaW5rUGFyYW1JbmQtPmluZm8ubGFzdERhdGFSYXRlID0KKyAgICAgICAgICAgIHdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS53ZGlMb3N0TGlua1BhcmFtc0luZC5sYXN0RGF0YVJhdGU7CisgICAgICAgICAgcExvc3RMaW5rUGFyYW1JbmQtPmluZm8ucnN2ZDEgPQorICAgICAgICAgICAgd2RpTG93TGV2ZWxJbmQtPndkaUluZGljYXRpb25EYXRhLndkaUxvc3RMaW5rUGFyYW1zSW5kLnJzdmQxOworICAgICAgICAgIHBMb3N0TGlua1BhcmFtSW5kLT5pbmZvLnJzdmQyID0KKyAgICAgICAgICAgIHdkaUxvd0xldmVsSW5kLT53ZGlJbmRpY2F0aW9uRGF0YS53ZGlMb3N0TGlua1BhcmFtc0luZC5yc3ZkMjsKKyAgICAgICAgICBXREFfU2VuZE1zZyhwV0RBLCBTSVJfSEFMX0xPU1RfTElOS19QQVJBTVNfSU5ELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilwTG9zdExpbmtQYXJhbUluZCAsIDApIDsKKyAgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGRlZmF1bHQ6CisgICAgICB7CisgICAgICAgICAvKiBUT0RPIGVycm9yICovCisgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlJlY2VpdmVkIFVOS05PV04gSW5kaWNhdGlvbiBmcm9tIFdESSAiKTsKKyAgICAgIH0gCisgICB9CisgICByZXR1cm4gOworfQorCisvKgorICogQkEgcmVsYXRlZCBwcm9jZXNzaW5nIGluIFdEQS4KKyAqLwordm9pZCBXREFfVHJpZ2dlckJhUmVxQ2FsbGJhY2soV0RJX1RyaWdnZXJCQVJzcFBhcmFtc1R5cGUgKndkaVRyaWdnZXJCYVJzcCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogcFVzZXJEYXRhKQoreworICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKilwVXNlckRhdGE7IAorICAgdFdEQV9DYkNvbnRleHQgKnBXREE7CisgICBpZihOVUxMID09IHBXZGFQYXJhbXMpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICIlczogcFdkYVBhcmFtcyByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKSA7CisgICAgICByZXR1cm4gOworICAgfQorICAgcFdEQSA9ICh0V0RBX0NiQ29udGV4dCAqKXBXZGFQYXJhbXMtPnBXZGFDb250ZXh0OworICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtKSA7CisgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcy0+d2RhV2RpQXBpTXNnUGFyYW0p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BU1NFUlQoMCkgOworICAgICAgICAgcmV0dXJuOyAKKyAgICAgIH0KKyAgICAgIHZvc19tZW1fY29weShiYUFjdGl2aXR5SW5kLT5ic3NJZCwgd2RpVHJpZ2dlckJhUnNwLT5tYWNCU1NJRCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRTaXJNYWNBZGRyKSkgOworICAgICAgYmFBY3Rpdml0eUluZC0+YmFDYW5kaWRhdGVDbnQgPSBiYUNhbmRpZGF0ZUNvdW50IDsKKyAgICAgICAKKyAgICAgIHdkaUJhQ2FuZGlkYXRlID0gKFdESV9UcmlnZ2VyQkFSc3BDYW5kaWRhdGVUeXBlKikod2RpVHJpZ2dlckJhUnNwICsgMSkgOworICAgICAgYmFDYW5kaWRhdGUgPSAodEFkZEJhQ2FuZGlkYXRlKikoYmFBY3Rpdml0eUluZCArIDEpIDsKKyAKKyAgICAgIGZvcihpID0gMCA7IGkgPCBiYUNhbmRpZGF0ZUNvdW50IDsgaSsrKQorICAgICAgeworICAgICAgICAgdEFOSV9VOCB0aWQgPSAwIDsKKyAgICAgICAgIHZvc19tZW1fY29weShiYUNhbmRpZGF0ZS0+c3RhQWRkciwgd2RpQmFDYW5kaWRhdGUtPm1hY1NUQSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFNpck1hY0FkZHIpKSA7CisgICAgICAgICBmb3IodGlkID0gMCA7IHRpZCA8IFNUQUNGR19NQVhfVEM7IHRpZCsrKQorICAgICAgICAgeworICAgICAgICAgICAgIGJhQ2FuZGlkYXRlLT5iYUluZm9bdGlkXS5mQmFFbmFibGUgPSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkaUJhQ2FuZGlkYXRlLT53ZGlCQUluZm9bdGlkXS5mQmFFbmFibGUgOworICAgICAgICAgICAgIGJhQ2FuZGlkYXRlLT5iYUluZm9bdGlkXS5zdGFydGluZ1NlcU51bSA9IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2RpQmFDYW5kaWRhdGUtPndkaUJBSW5mb1t0aWRdLnN0YXJ0aW5nU2VxTnVtIDsKKyAgICAgICAgIH0KKyAgICAgICAgIHdkaUJhQ2FuZGlkYXRlKysgOworICAgICAgICAgYmFDYW5kaWRhdGUrKyA7CisgICAgICB9CisgICAgICBXREFfU2VuZE1zZyhwV0RBLCBTSVJfTElNX0FERF9CQV9JTkQsICh2b2lkICopYmFBY3Rpdml0eUluZCAsIDApIDsKKyAgIH0KKyAgIGVsc2UKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQkEgVHJpZ2dlciBSU1Agd2l0aCBGYWlsdXJlIHJlY2VpdmVkICIpOworICAgfQorICAgcmV0dXJuIDsKK30KKworCisvKgorICogQVBJIHRvIGFjdGl2YXRlL2RlYWN0aXZhdGUgVHJhZmZpYyBTdGF0cyB0aW1lci4gVHJhZmZpYyBzdGF0cyB0aW1lciBpcyBvbmx5IG5lZWRlZAorICogZHVyaW5nIE1DQworICovCit2b2lkIFdEQV9UcmFmZmljU3RhdHNUaW1lckFjdGl2YXRlKHdwdF9ib29sZWFuIGFjdGl2YXRlKQoreworICAgd3B0X3VpbnQzMiBlbmFibGVkOworICAgdl9WT0lEX3QgKiBwVm9zQ29udGV4dCA9IHZvc19nZXRfZ2xvYmFsX2NvbnRleHQoVk9TX01PRFVMRV9JRF9XREEsIE5VTEwpOworICAgdFdEQV9DYkNvbnRleHQgKnBXREEgPSAgdm9zX2dldF9jb250ZXh0KFZPU19NT0RVTEVfSURfV0RBLCBwVm9zQ29udGV4dCk7CisgICB0cEFuaVNpckdsb2JhbCBwTWFjID0gKHRwQW5pU2lyR2xvYmFsIClWT1NfR0VUX01BQ19DVFhUKHBWb3NDb250ZXh0KTsKKyAgIAorICAgaWYgKE5VTEwgPT0gcE1hYyApCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogSW52b2tlZCB3aXRoIGludmFsaWQgTUFDIGNvbnRleHQgIiwgX19mdW5jX18gKTsKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICByZXR1cm47CisgICB9CisKKyAgIGlmKHdsYW5fY2ZnR2V0SW50KHBNYWMsIFdOSV9DRkdfRU5BQkxFX01DQ19BREFQVElWRV9TQ0hFRCwgJmVuYWJsZWQpIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gZVNJUl9TVUNDRVNTKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICJGYWlsZWQgdG8gZ2V0IFdOSV9DRkdfRU5BQkxFX01DQ19BREFQVElWRV9TQ0hFRCIpOworICAgICAgcmV0dXJuOworICAgfQorCisgICBpZighZW5hYmxlZCkKKyAgIHsKKyAgICAgIHJldHVybjsKKyAgIH0KKworICAgaWYoTlVMTCA9PSBwV0RBKQorICAgeworICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczpXREEgY29udGV4dCBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybjsKKyAgIH0KKworICAgaWYoYWN0aXZhdGUpCisgICB7CisgICAgICBpZiggVk9TX1NUQVRVU19TVUNDRVNTICE9IAorICAgICAgICAgV0RBX1NUQVJUX1RJTUVSKCZwV0RBLT53ZGFUaW1lcnMudHJhZmZpY1N0YXRzVGltZXIpKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgIlRyYWZmaWMgU3RhdHMgVGltZXIgU3RhcnQgRmFpbGVkICIpOworICAgICAgICAgcmV0dXJuOworICAgICAgfQorICAgICAgV0RJX0RTX0FjdGl2YXRlVHJhZmZpY1N0YXRzKCk7CisgICB9CisgICBlbHNlCisgICB7CisgICAgICBXRElfRFNfRGVhY3RpdmF0ZVRyYWZmaWNTdGF0cygpOworICAgICAgV0RJX0RTX0NsZWFyVHJhZmZpY1N0YXRzKCk7CisKKyAgICAgIGlmKCBWT1NfU1RBVFVTX1NVQ0NFU1MgIT0KKyAgICAgICAgIFdEQV9TVE9QX1RJTUVSKCZwV0RBLT53ZGFUaW1lcnMudHJhZmZpY1N0YXRzVGltZXIpKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgIlRyYWZmaWMgU3RhdHMgVGltZXIgU3RvcCBGYWlsZWQgIik7CisgICAgICAgICByZXR1cm47CisgICAgICB9CisgICB9Cit9CisKKy8qCisgKiBUcmFmZmljIFN0YXRzIFRpbWVyIGhhbmRsZXIKKyAqLwordm9pZCBXREFfVGltZXJUcmFmZmljU3RhdHNJbmQodFdEQV9DYkNvbnRleHQgKnBXREEpCit7CisgICBXRElfU3RhdHVzIHdkaVN0YXR1czsKKyAgIFdESV9UcmFmZmljU3RhdHNUeXBlICpwV2RpVHJhZmZpY1N0YXRzID0gTlVMTDsKKyAgIFdESV9UcmFmZmljU3RhdHNJbmRUeXBlIHRyYWZmaWNTdGF0c0luZFBhcmFtczsKKyAgIHdwdF91aW50MzIgbGVuZ3RoLCBlbmFibGVkOworICAgdHBBbmlTaXJHbG9iYWwgcE1hYyA9ICh0cEFuaVNpckdsb2JhbCApVk9TX0dFVF9NQUNfQ1RYVChwV0RBLT5wVm9zQ29udGV4dCk7CisKKyAgIGlmIChOVUxMID09IHBNYWMgKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IEludm9rZWQgd2l0aCBpbnZhbGlkIE1BQyBjb250ZXh0ICIsIF9fZnVuY19fICk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuOworICAgfQorCisgICBpZih3bGFuX2NmZ0dldEludChwTWFjLCBXTklfQ0ZHX0VOQUJMRV9NQ0NfQURBUFRJVkVfU0NIRUQsICZlbmFibGVkKSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICE9IGVTSVJfU1VDQ0VTUykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIkZhaWxlZCB0byBnZXQgV05JX0NGR19FTkFCTEVfTUNDX0FEQVBUSVZFX1NDSEVEIik7CisgICAgICByZXR1cm47CisgICB9CisKKyAgIGlmKCFlbmFibGVkKQorICAgeworICAgICAgV0RJX0RTX0RlYWN0aXZhdGVUcmFmZmljU3RhdHMoKTsKKyAgICAgIHJldHVybjsKKyAgIH0KKworICAgV0RJX0RTX0dldFRyYWZmaWNTdGF0cygmcFdkaVRyYWZmaWNTdGF0cywgJmxlbmd0aCk7CisKKyAgIGlmKHBXZGlUcmFmZmljU3RhdHMgIT0gTlVMTCkKKyAgIHsKKyAgICAgIHRyYWZmaWNTdGF0c0luZFBhcmFtcy5wVHJhZmZpY1N0YXRzID0gcFdkaVRyYWZmaWNTdGF0czsKKyAgICAgIHRyYWZmaWNTdGF0c0luZFBhcmFtcy5sZW5ndGggPSBsZW5ndGg7CisgICAgICB0cmFmZmljU3RhdHNJbmRQYXJhbXMuZHVyYXRpb24gPQorICAgICAgICAgcFdEQS0+d2RhVGltZXJzLnRyYWZmaWNTdGF0c1RpbWVyLmluaXRTY2hlZHVsZVRpbWVJbk1zZWNzOworICAgICAgdHJhZmZpY1N0YXRzSW5kUGFyYW1zLndkaVJlcVN0YXR1c0NCID0gV0RBX1dkaUluZGljYXRpb25DYWxsYmFjazsKKyAgICAgIHRyYWZmaWNTdGF0c0luZFBhcmFtcy5wVXNlckRhdGEgPSBwV0RBOworCisgICAgICB3ZGlTdGF0dXMgPSBXRElfVHJhZmZpY1N0YXRzSW5kKCZ0cmFmZmljU3RhdHNJbmRQYXJhbXMpOworCisgICAgICBpZihXRElfU1RBVFVTX1BFTkRJTkcgPT0gd2RpU3RhdHVzKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICJQZW5kaW5nIHJlY2VpdmVkIGZvciAlczolZCAiLF9fZnVuY19fLF9fTElORV9fICk7CisgICAgICB9CisgICAgICBlbHNlIGlmKCBXRElfU1RBVFVTX1NVQ0NFU1NfU1lOQyAhPSB3ZGlTdGF0dXMgKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiRmFpbHVyZSBpbiAlczolZCAiLF9fZnVuY19fLF9fTElORV9fICk7CisgICAgICB9CisgICAgICAKKyAgICAgIFdESV9EU19DbGVhclRyYWZmaWNTdGF0cygpOworICAgfQorICAgZWxzZQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAicFdkaVRyYWZmaWNTdGF0cyBpcyBOdWxsIik7CisgICB9CisKKyAgIGlm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RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkluY29uc2lzdGVudCBTVEEgZW50cmllcyBpbiBXREEiKTsKKyAgICAgIFZPU19BU1NFUlQoMCkgOworICAgfQorICAgaWYoTlVMTCA9PSBwV0RBLT5wVm9zQ29udGV4dCkKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzOiBwVm9zQ29udGV4dCBpcyBOVUxMIixfX2Z1bmNfXyk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuIDsKKyAgIH0KKyAgIHBNYWMgPSAodHBBbmlTaXJHbG9iYWwgKVZPU19HRVRfTUFDX0NUWFQocFdEQS0+cFZvc0NvbnRleHQpOworICAgaWYoTlVMTCA9PSBwTWFjKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IHBNYWMgaXMgTlVMTCIsX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiA7CisgICB9CisKKyAgIGlmICh3bGFuX2NmZ0dldEludChwTWFjLAorICAgICAgICAgICBXTklfQ0ZHX0RFTF9BTExfUlhfVFhfQkFfU0VTU0lPTlNfMl80X0dfQlRDLCAmdmFsKSAhPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVNJUl9TVUNDRVNTKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgIlVuYWJsZSB0by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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VyU3RhLCAmdGxTVEFTdGF0ZSkpICYmCisgICAgICAgICAgICAoVk9TX1NUQVRVU19TVUNDRVNTID09IFdEQV9UTF9HRVRfVFhfUEtUQ09VTlQoIHBXREEtPnBWb3NDb250ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1clN0YSwgdGlkLCAmdHhQa3RDb3VudCkpKQorICAgICAgICAgeworI2lmIDAKKyAgICAgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPX0xPVywKKyAgICAgICAgICAgICAiKioqKioqKioqKioqKiAlZDolZCwgJWQgIixjdXJTdGEsIHR4UGt0Q291bnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwV0RBLT53ZGFTdGFJbmZvW2N1clN0YV0uZnJhbWVzVHhlZFt0aWRdKTsKKyNlbmRpZgorICAgICAgICAgICAgaWYodmFsICYmICggKGN1cnJlbnRPcGVyQ2hhbiA+PSBTSVJfMTFCX0NIQU5ORUxfQkVHSU4pICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjdXJyZW50T3BlckNoYW4gPD0gU0lSXzExQl9DSEFOTkVMX0VORCkpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICIlczogQlRDIGRpc2FibGVkIGFnZ3JlZ2F0aW9uIC0gZG9udCBzdGFydCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgIlRYIEFEREJBIHJlcSIsX19mdW5jX18pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZighV0RBX0dFVF9CQV9UWEZMQUcocFdEQSwgY3VyU3RhLCB0aWQpCisgICAgICAgICAgICAgICAgICAgJiYgKFdMQU5UTF9TVEFfQVVUSEVOVElDQVRFRCA9PSB0bFNUQVN0YXRlKQorICAgICAgICAgICAgICAgICAgICYmICgoKGVTWVNURU1fU1RBX0lOX0lCU1NfUk9MRSA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBXREEtPndkYUdsb2JhbFN5c3RlbVJvbGUpICYmIHR4UGt0Q291bnQgKQorICAgICAgICAgICAgICAgICAgIHx8ICh0eFBrdENvdW50ID49IFdEQV9MQVNUX1BPTExFRF9USFJFU0hPTEQocFdEQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1clN0YSwgdGlkKSkpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgLyogZ2V0IHByZXBhcmUgZm9yIHNlbmRpbmcgbWVzc2FnZSB0byBIQUwgKi8KKyAgICAgICAgICAgICAgIC8vYmFDYW5kaWRhdGVbYmFDYW5kaWRhdGVDb3VudF0uc3RhSWR4ID0gY3VyU3RhIDsKKyAgICAgICAgICAgICAgIGJhQ2FuZGlkYXRlW2JhQ2FuZGlkYXRlQ291bnRdLnVjVGlkQml0bWFwIHw9IDEgPDwgdGlkIDsKKyAgICAgICAgICAgICAgIG5ld0JhQ2FuZGlkYXRlID0gV0RBX0VOQUJMRV9CQSA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwV0RBLT53ZGFTdGFJbmZvW2N1clN0YV0uZnJhbWVzVHhlZFt0aWRdID0gdHhQa3RDb3VudCA7CisgICAgICAgICB9CisgICAgICB9CisgICAgICAvKiBmaWxsIHRoZSBlbnRyeSBmb3IgYWxsIHRoZSBzdGEgd2l0aCBnaXZlbiBUSUQncyAqLworICAgICAgaWYoV0RBX0VOQUJMRV9CQSA9PSBuZXdCYUNhbmRpZGF0ZSkKKyAgICAgIHsgCisgICAgICAgICAvKiBtb3ZlIHRvIG5leHQgQkEgY2FuZGlkYXRlICovCisgICAgICAgICBiY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gZm9yIGluaXRpYXRpbmcgQkEiKTsKKyAgIH0KKyAgIGlmKCBWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gCisgICAgICAgICBXREFfU1RPUF9USU1FUigmcFdEQS0+d2RhVGltZXJzLmJhQWN0aXZpdHlDaGtUbXIpKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQkEgQWN0aXZpdHkgVGltZXIgU3RvcCBGYWlsZWQgIik7CisgICAgICByZXR1cm4gOworICAgfQorICAgaWYoIFZPU19TVEFUVVNfU1VDQ0VTUyAhPSAKKyAgICAgIFdEQV9TVEFSVF9USU1FUigmcFdEQS0+d2RhVGltZXJzLmJhQWN0aXZpdHlDaGtUbXIpKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQkEgQWN0aXZpdHkgVGltZXIgU3RhcnQgRmFpbGVkICIpOworICAgICAgcmV0dXJuOworICAgfQorICAgcmV0dXJuIDsKK30KKy8qCisgKiBXREEgY29tbW9uIHJvdXRpbmUgdG8gY3JlYXRlIHRpbWVyIHVzZWQgYnkgV0RBLgorICovCitzdGF0aWMgVk9TX1NUQVRVUyB3ZGFDcmVhdGVUaW1lcnModFdEQV9DYkNvbnRleHQgKnBXREEpCit7CisgICBWT1NfU1RBVFVTIHN0YXR1cyA9IFZPU19TVEFUVVNfU1VDQ0VTUyA7CisgICB0QU5JX1UzMiB2YWwgPSAwIDsKKyAgIHRwQW5pU2lyR2xvYmFsIHBNYWMgPSAodHBBbmlTaXJHbG9iYWwgKVZPU19HRVRfTUFDX0NUWFQocFdEQS0+cFZvc0NvbnRleHQpOworICAgCisgICBpZihOVUxMID09IHBNYWMpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6TUFDIGNvbnRleHQgaXMgTlVMTCIsIF9fZnVuY19fKTsgCisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgfQorICAgaWYod2xhbl9jZmdHZXRJbnQocE1hYywgV05JX0NGR19CQV9BQ1RJVklUWV9DSEVDS19USU1FT1VULCAmdmFsICkgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gZVNJUl9TVUNDRVNTKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgIkZhaWxlZCB0byBnZXQgdmFsdWUgZm9yIFdOSV9DRkdfQ1VSUkVOVF9UWF9BTlRFTk5BIik7CisgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgICB9CisgICB2YWwgPSBTWVNfTVNfVE9fVElDS1ModmFsKSA7CisgCisgICAvKiBCQSBhY3Rpdml0eSBjaGVjayB0aW1lciAqLworICAgc3RhdHVzID0gV0RBX0NSRUFURV9USU1FUigmcFdEQS0+d2RhVGltZXJzLmJhQWN0aXZpdHlDaGtUbXIsIAorICAgICAgICAgICAgICAgICAgICAgICAgICJCQSBBY3Rpdml0eSBDaGVjayB0aW1lciIsIFdEQV9UaW1lckhhbmRsZXIsIAorICAgICAgICAgICAgICAgICAgICAgICAgIFdEQV9USU1FUl9CQV9BQ1RJVklUWV9SRVEsIHZhbCwgdmFsLCBUWF9OT19BQ1RJVkFURSkgOworICAgaWYoc3RhdHVzICE9IFRYX1NVQ0NFU1MpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURf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0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlVuYWJsZSB0byBEZXN0cm95IEJBIGFjdGl2aXR5IHRpbWVyIik7CisgICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkUgOworICAgICAgfSAKKyAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFJTFVSRSA7CisgICB9CisKKyAgIHZhbCA9IFNZU19NU19UT19USUNLUyggV0RBX1RSQUZGSUNfU1RBVFNfVElNRV9PVVRfVkFMVUUgKTsKKworICAgLyogVHJhZmZpYyBTdGF0cyB0aW1lciAqLworICAgc3RhdHVzID0gV0RBX0NSRUFURV9USU1FUigmcFdEQS0+d2RhVGltZXJzLnRyYWZmaWNTdGF0c1RpbWVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICJUcmFmZmljIFN0YXRzIHRpbWVyIiwgV0RBX1RpbWVySGFuZGxlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICBXREFfVElNRVJfVFJBRkZJQ19TVEFUU19JTkQsIHZhbCwgdmFsLCBUWF9OT19BQ1RJVkFURSkgOworICAgaWYoc3RhdHVzICE9IFRYX1NVQ0NFU1MpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlVuYWJsZSB0byBjcmVhdGUgdHJhZmZpYyBzdGF0cyB0aW1lciIpOworICAgICAgLyogRGVzdHJveSB0aW1lciBvZiBCQSBhY3Rpdml0eSBjaGVjayB0aW1lciAqLworICAgICAgc3RhdHVzID0gV0RBX0RFU1RST1lfVElNRVIoJnBXREEtPndkYVRpbWVycy5iYUFjdGl2aXR5Q2hrVG1yKTsKKyAgICAgIGlmKHN0YXR1cyAhPSBUWF9TVUNDRVNTKQorICAgICAgeworICAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJVbmFibGUgdG8gRGVzdHJveSBCQSBhY3Rpdml0eSB0aW1lciIpOworICAgICAgfQorICAgICAgLyogRGVzdHJveSB0aW1lciBvZiB0eCBjb21wbGV0ZSB0aW1lciAqLworICAgICAgc3RhdHVzID0gV0RBX0RFU1RST1lfVElNRVIoJnBXREEtPndkYVRpbWVycy5UeENvbXBsZXRlVGltZXIpOworICAgICAgaWYoc3RhdHVzICE9IFRYX1NVQ0NFU1MpCisgICAgICB7CisgICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlVuYWJsZSB0byBUeCBjb21wbGV0ZSB0aW1lciIpOworICAgICAgfQorICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFIDsKKyAgIH0KKyAgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1MgOworfQorLyoKKyAqIFdEQSBjb21tb24gcm91dGluZSB0byBkZXN0cm95IHRpbWVyIHVzZWQgYnkgV0RBLgorICovCitzdGF0aWMgVk9TX1NUQVRVUyB3ZGFEZXN0cm95VGltZXJzKHRXREFfQ2JDb250ZXh0ICpwV0RBKQoreworICAgVk9TX1NUQVRVUyBzdGF0dXMgPSBWT1NfU1RBVFVTX1NVQ0NFU1MgOworICAgc3RhdHVzID0gV0RBX0RFU1RST1lfVElNRVIoJnBXREEtPndkYVRpbWVycy5UeENvbXBsZXRlVGltZXIpOworICAgaWYoc3RhdHVzICE9IFRYX1NVQ0NFU1MpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgIC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fTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogcFdkYVBhcmFtcyByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybjsKKyAgIH0KKworICAgaWYoSVNfV0RJX1NUQVRVU19GQUlMVVJFKHdkaVN0YXR1cykpCisgICB7CisgICAgICBwUE5PU2NhblJlcVBhcmFtcyA9ICh0U2lyUE5PU2NhblJlcSAqKXBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtOworICAgICAgaWYocFBOT1NjYW5SZXFQYXJhbXMtPnN0YXR1c0NhbGxiYWNrKQorICAgICAgeworICAgICAgICAgcFBOT1NjYW5SZXFQYXJhbXMtPnN0YXR1c0NhbGxiYWNrKHBQTk9TY2FuUmVxUGFyYW1zLT5jYWxsYmFja0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1NUQVRVU19FX0ZBSUxVUkUpOworICAgICAgfQorCisgICAgICBpZiAocFBOT1NjYW5SZXFQYXJhbXMtPmVuYWJsZSA9PSAxKQorICAgICAgeworICAgICAgICAgIGlmIChwUE5PU2NhblJlcVBhcmFtcy0+YU5ldHdvcmtzKQorICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocFBOT1NjYW5SZXFQYXJhbXMtPmFOZXR3b3Jrcyk7CisgICAgICAgICAgaWYgKHBQTk9TY2FuUmVxUGFyYW1zLT5wMjRHUHJvYmVUZW1wbGF0ZSkKKyAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBQTk9TY2FuUmVxUGFyYW1zLT5wMjRHUHJvYmVUZW1wbGF0ZSk7CisgICAgICAgICAgaWYgKHBQTk9TY2FuUmVxUGFyYW1zLT5wNUdQcm9iZVRlbXBsYXRlKQorICAgICAgICAgICAgICB2b3NfbWVtX2ZyZWUocFBOT1NjYW5SZXFQYXJhbXMtPnA1R1Byb2JlVGVtcGxhdGUpOworICAgIC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XJhbXM7CisgICBzdGF0dXMgPSBXRElfU2V0UHJlZmVycmVkTmV0d29ya1JlcShwd2RpUE5PU2NhblJlcUluZm8sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKFdESV9QTk9TY2FuQ2IpV0RBX1BOT1NjYW5SZXNwQ2FsbGJhY2ssIHBXZGFQYXJhbXMpOworICAgaWYoSVNfV0RJX1NUQVRVU19GQUlMVVJFKHN0YXR1cykpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICJGYWlsdXJlIGluIFNldCBQTk8gUkVRIFdESSBBUEksIGZyZWUgYWxsIHRoZSBtZW1vcnkgIiApOworICAgICAgaWYocFBOT1NjYW5SZXFQYXJhbXMtPnN0YXR1c0NhbGxiYWNrKQorICAgICAgeworICAgICAgICAgcFBOT1NjYW5SZXFQYXJhbXMtPnN0YXR1c0NhbGxiYWNrKHBQTk9TY2FuUmVxUGFyYW1zLT5jYWxsYmFja0NvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVk9TX1NUQVRVU19FX0ZBSUxVUkUpOworICAgICAgfQorICAgICAgaWYgKHBQTk9TY2FuUmVxUGFyYW1zLT5lbmFibGUgPT0gMSkKKyAgICAgIHsKKyAgICAgICAgICBpZiAocFBOT1NjYW5SZXFQYXJhbXMtPmFOZXR3b3JrcykKKyAgICAgICAgICAgICAgdm9zX21lbV9mcmVlKHBQTk9TY2FuUmVxUGFyYW1zLT5hTmV0d29ya3MpOworICAgICAgICAgIGlmIChwUE5PU2NhblJlcVBhcmFtcy0+cDI0R1Byb2JlVGVtcGxhdGUpCisgICAgICAgICAgICAgIHZvc19tZW1fZnJlZShwUE5PU2NhblJlcVBhcmFtcy0+cDI0R1Byb2JlVGVtcGxhdGUpOworICAgICAgICAgIGlmIChwUE5PU2NhblJlcVBhcmFtcy0+cDVHUHJv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clR5cGUsIHZfVThfdCBjc3JFbmNyVHlwZSkKK3sKKyAgIHN3aXRjaCAoY3NyRW5jclR5cGUpCisgICB7CisgICAgICBjYXNlIGVDU1JfRU5DUllQVF9UWVBFX05PTkU6CisgICAgICAgICAgICpFbmNyVHlwZSA9IFdESV9FRF9OT05FOworICAgICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgZUNTUl9FTkNSWVBUX1RZUEVfV0VQNDBfU1RBVElDS0VZOgorICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVA0MDoKKyAgICAgICAgICAgKkVuY3JUeXBlID0gV0RJX0VEX1dFUDQwOworICAgICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgZUNTUl9FTkNSWVBUX1RZUEVfV0VQMTA0OgorICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9XRVAxMDRfU1RBVElDS0VZOgorICAgICAgICAgICAqRW5jclR5cGUgPSBXRElfRURfV0VQMTA0OworICAgICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgZUNTUl9FTkNSWVBUX1RZUEVfVEtJUDoKKyAgICAgICAgICAgKkVuY3JUeXBlID0gV0RJX0VEX1RLSVA7CisgICAgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBlQ1NSX0VOQ1JZUFRfVFlQRV9BRVM6CisgICAgICAgICAgICpFbmNyVHlwZSA9IFdESV9FRF9DQ01QOworICAgICAgICAgICBicmVhazsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisgICAgICBjYXNlIGVDU1JfRU5DUllQVF9UWVBFX0FFU19DTUFDOgorICAgICAgICAgICAqRW5jclR5cGUgPSBXRElfRURfQUVTXzEyOF9DTUFDOworICAgICAgICAgICBicmVhazsKKyNlbmRpZgorI2lmZGVmIEZFQVRVUkVfV0xBTl9XQVBJCisgICAgICBjYXNlIGVDU1JfRU5DUllQVF9UWVBFX1dQSToKKyAgICAgICAgICAgKkVuY3JUeXBlID0gV0RJX0VEX1dQST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UkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIjwtLS0tLS0gJXMgIiAsX19mdW5jX18pOworICAgIGlmIChOVUxMID09IHBXZGFQYXJhbXMpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICIlczogcFdkYVBhcmFtcyByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKSA7CisgICAgICByZXR1cm4gOworICAgfQorICAgaWYgKCBwV2RhUGFyYW1zICE9IE5VTEwgKQorICAgeworICAgICAgaWYgKCBwV2RhUGFyYW1zLT53ZGFXZGlBcGlNc2dQYXJhbSAhPSBOVUxMICkKKyAgICAgIHsKKyAgICAgICAgIHJlYXNvbiA9ICgoV0RJX1JvYW1TY2FuT2ZmbG9hZFJlcVBhcmFtc1R5cGUgKilwV2RhUGFyYW1zLT53ZGFXZGlBcGlNc2dQYXJhbSktPndkaVJvYW1PZmZsb2FkU2NhbkluZm8uU3RhcnRTY2FuUmVhc29uOworICAgICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYVdkaUFwaU1zZ1BhcmFtKTsKKyAgICAgIH0KKyAgICAgIGlmICggcFdkYVBhcmFtcy0+d2RhTXNnUGFyYW0gIT0gTlVMTCkKKyAgICAgIHsKKyAgICAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zLT53ZGFNc2dQYXJhbSk7CisgICAgICB9CisKKyAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zKSA7CisgICB9CisgICB2b3NNc2cudHlwZSA9IGVXTklfU01FX1JPQU1fU0NBTl9PRkZMT0FEX1JTUDsKKyAgIHZvc01zZy5ib2R5cHRyID0gTlVMTDsKKyAgIGlmIChXRElfU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pKQorICAgeworICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYVdkaUFwaU1zZ1BhcmFtKTsKKyAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zLT53ZGFNc2dQYXJhbSk7CisgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcyk7CisgICB9CisKKyAgIHJldHVybjsKK30KKworI2lmZGVmIFdMQU5fRkVBVFVSRV9QQUNLRVRfRklMVEVSSU5HCisvKgorICogRlVOQ1RJT046IFdEQV84MDIzTXVsdGljYXN0TGlzdFJlc3BDYWxsYmFjaworICogCisgKi8gCit2b2lkIFdEQV84MDIzTXVsdGljYXN0TGlzdFJlc3BDYWxsYmFjaygKKyAgICAgICAgICAgICAgICAgICAgICAgIFdESV9SY3ZGbHRQa3RTZXRNY0xpc3RSc3BQYXJhbXNUeXBlICAqcHdkaVJjdkZsdFBrdFNldE1jTGlzdFJzcEluZm8sCisgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICogcFVzZXJEYXRhKQoreworICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKilwVXNlckRhdGE7CisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICI8LS0tLS0tICVzICIgLF9fZnVuY19fKTsKKyAgIGlmKE5VTEwgPT0gcFdkYVBhcmFtcykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBwV2RhUGFyYW1zIHJlY2VpdmVkIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICBWT1NfQVNTRVJUKDApIDsKKyAgICAgIHJldHVybiA7CisgICB9CisgICAKKyAgIHZvc19tZW1f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gICAgICAgICAgIHdkaVBrdEZpbHRlckNmZy5wYXJhbXNEYXRhW2ldLnByb3RvY29sTGF5ZXIsIAorICAgICAgICAgICAgICAgICBwd2RpU2V0UmN2UGt0RmlsdGVyUmVxUGFyYW1zVHlwZS0+CisgICAgICAgICAgICAgICAgICAgICAgICAgd2RpUGt0RmlsdGVyQ2ZnLnBhcmFtc0RhdGFbaV0uY21wRmxhZyk7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywgCisgICAgICAgICAgICAgICAgICJEYXRhIE9mZnNldCAlZCBEYXRhIExlbiAlZCIsCisgICAgICAgICAgICAgICAgIHB3ZGlTZXRSY3ZQa3RGaWx0ZXJSZXFQYXJhbXNUeXBlLT4KKyAgICAgICAgICAgICAgICAgICAgICAgICB3ZGlQa3RGaWx0ZXJDZmcucGFyYW1zRGF0YVtpXS5kYXRhT2Zmc2V0LCAKKyAgICAgICAgICAgICAgICAgcHdkaVNldFJjdlBrdEZpbHRlclJlcVBhcmFtc1R5cGUtPgorICAgICAgICAgICAgICAgICAgICAgICAgIHdkaVBrdEZpbHRlckNmZy5wYXJhbXNEYXRhW2ldLmRhdGFMZW5ndGgpOworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sIAorICAgICAgICAgICAgICAgICAiQ0RhdGE6ICVkOiVkOiVkOiVkOiVkOiVkIiwKKyAgICAgICAgICAgICAgICAgcHdkaVNldFJjdlBrdEZpbHRlclJlcVBhcmFtc1R5cGUtPgorICAgICAgICAgICAgICAgICAgICAgICAgIHdkaVBrdEZpbHRlckNmZy5wYXJhbXNEYXRhW2ldLmNvbXBhcmVEYXRhWzBdLCAKKyAgICAgICAgICAgICAgICAgcHdkaVNldFJjdlBrdEZpbHRlclJlcVBhcmFtc1R5cGUtPgorICAgICAgICAgICAgICAgICAgICAgICAgIHdkaVBrdEZpbHRlckNmZy5wYXJhbXNEYXRhW2ldLmNvbXBhcmVEYXRhWzFdLCAKKyAgICAgICAgICAgICAgICAgcHdkaVNldFJjdlBrdEZpbHRlclJlcVBhcmFtc1R5cGUtPgorICAgICAgICAgICAgICAgICAgICAgICAgIHdkaVBrdEZpbHRlckNmZy5wYXJhbXNEYXRhW2ldLmNvbXBhcmVEYXRhWzJdLCAKKyAgICAgICAgICAgICAgICAgcHdkaVNldFJjdlBrdEZpbHRlclJlcVBhcmFtc1R5cGUtPgorICAgICAgICAgICAgICAgICAgICAgICAgIHdkaVBrdEZpbHRlckNmZy5wYXJhbXNEYXRhW2ldLmNvbXBhcmVEYXRhWzNdLAorICAgICAgICAgICAgICAgICBwd2RpU2V0UmN2UGt0RmlsdGVyUmVxUGFyYW1zVHlwZS0+CisgICAgICAgICAgICAgICAgICAgICAgICAgd2RpUGt0RmlsdGVyQ2ZnLnBhcmFtc0RhdGFbaV0uY29tcGFyZURhdGFbNF0sIAorICAgICAgICAgICAgICAgICBwd2RpU2V0UmN2UGt0RmlsdGVyUmVxUGFyYW1zVHlwZS0+CisgICAgICAgICAgICAgICAgICAgICAgICAgd2RpUGt0RmlsdGVyQ2ZnLnBhcmFtc0RhdGFbaV0uY29tcGFyZURhdGFbNV0pOworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sIAorICAgICAgICAgICAgICAgICAiTURhdGE6ICVkOiVkOiVkOiVkOiVkOiVkIiwKKyAgICAgICAgICAgICAgICAgcHdkaVNldFJjdlBrdEZpbHRlclJlcVBhcmFtc1R5cGUtPgorICAgICAgICAgICAgICAgICAgICAgICAgIHdkaVBrdEZpbHRlckNmZy5wYXJhbXNEYXRhW2ldLmRhdGFNYXNrWzBdLCAKKyAgICAgICAgICAgICAgICAgcHdkaVNldFJjdlBrdEZpbHRlclJlcVBhcmFtc1R5cGUtPgorICAgICAgICAgICAgICAgICAgICAgICAgIHd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250UnNwUGFyYW1zVHlwZSAqcHdkaVJjdkZsdFBrdE1hdGNoUnNwUGFyYW1zLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICogcFVzZXJEYXRhKQoreworICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKilwVXNlckRhdGE7CisgICB0V0RBX0NiQ29udGV4dCAqcFdEQTsKKyAgIHRwU2lyUmN2Rmx0UGt0TWF0Y2hSc3AgcFJjdkZsdFBrdE1hdGNoQ250UmVxOworICAgdHBTaXJSY3ZGbHRQa3RNYXRjaFJzcCBwUmN2Rmx0UGt0TWF0Y2hDbnRSc3AgPSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b3NfbWVtX21hbGxvYyhzaXplb2YodFNpclJjdkZsdFBrdE1hdGNoUnNwKSk7CisgICB0QU5JX1U4ICAgICAgICAgaTsKKyAgIHZvc19tc2dfdCB2b3NNc2c7CisKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIjwtLS0tLS0gJXMgIiAsX19mdW5jX18pOworICAgLypXREFfVk9TX0FTU0VSVChOVUxMICE9IHBXZGFQYXJhbXMpOyovCisKKyAgIGlmKE5VTEwgPT0gcFJjdkZsdFBrdE1hdGNoQ250UnNwKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IHBSY3ZGbHRQa3RNYXRjaENudFJzcCBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKSA7CisgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcyk7CisgICAgICByZXR1cm4gOworICAgfQorICAgCisgICBpZihOVUxMID09IH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RoIGludmFsaWQgcFdEQSIsIF9fZnVuY19fICk7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgfQorICAgLyogRlRNIG1vZGUgc3RheSBTVEFSVF9TVEFURSAqLworICAgaWYoIChXREFfUkVBRFlfU1RBVEUgIT0gcFdEQS0+d2RhU3RhdGUpICYmCisgICAgICAgICAoV0RBX0lOSVRfU1RBVEUgIT0gcFdEQS0+d2RhU3RhdGUpICYmCisgICAgICAgICAoV0RBX1NUQVJUX1NUQVRFICE9IHBXREEtPndkYVN0YXRlKSApCisgICB7CisgICAgICBWT1NfQVNTRVJUKDApOworICAgfQorCisgICBpZiAoZURSSVZFUl9UWVBFX01GRyAhPSBwV0RBLT5kcml2ZXJNb2RlKQorICAgeworICAgICAgIGlmKFZPU19UUlVFID09IHBXREEtPndkYVRpbWVyc0NyZWF0ZWQpCisgICAgICAgeworICAgICAgICAgIHdkYURlc3Ryb3lUaW1lcnMocFdEQSk7CisgICAgICAgICAgcFdEQS0+d2RhVGltZXJzQ3JlYXRlZCA9IFZPU19GQUxTRTsKKyAgICAgICB9CisgICB9CisgICBlbHNlCisgICB7CisgICAgICB2b3NfZXZlbnRfZGVzdHJveSgmcFdEQS0+ZnRtU3RvcERvbmVFdmVudCk7CisgICB9CisKKyAgIC8qIGNhbGwgV0RJIHNodXRkb3duICovCisgICB3ZGlTdGF0dXMgPSBXRElfU2h1dGRvd24oY2xvc2VUcmFuc3BvcnQpOworICAgaWYgKElTX1dESV9TVEFUVVNfRkFJTFVSRSh3ZGlTdGF0dXMpICkKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZXJyb3IgaW4gV0RBIFN0b3AiICk7CisgICAgICBzdGF0dXMgPSBWT1NfU1RBVFVTX0VfRkFJT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FDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAiQ291bGQgbm90IGdldCB0aGUgV0RBIENvbnRleHQgcG9pbnRlciIgKTsKKyAgICAgICByZXR1cm47CisgICB9CisgICBwV0RBLT5uZWVkU2h1dGRvd24gID0gVFJVRTsKK30KKy8qCisgKiBGVU5DVElPTjogV0RBX25lZWRTaHV0ZG93bgorICogV0RBIG5lZWRzIGEgc2h1dGRvd24KKyAqLworCit2X0JPT0xfdCBXREFfbmVlZFNodXRkb3duKHZfUFZPSURfdCBwVm9zQ29udGV4dCkKK3sKKyAgIHRXREFfQ2JDb250ZXh0ICpwV0RBID0gKHRXREFfQ2JDb250ZXh0ICopVk9TX0dFVF9XREFfQ1RYVChwVm9zQ29udGV4dCk7CisgICBpZihwV0RBID09IE5VTEwpCisgICB7CisgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICJDb3VsZCBub3QgZ2V0IHRoZSBXREEgQ29udGV4dCBwb2ludGVyIiApOworICAgICAgIHJldHVybiAwOworICAgfQorICAgcmV0dXJuIHBXREEtPm5lZWRTaHV0ZG93bjsKK30KKworI2lmZGVmIFdMQU5fRkVBVFVSRV8xMUFDCisvKgorICogRlVOQ1RJT046IFdEQV9TZXRCZWFjb25GaWx0ZXJSZXFDYWxsYmFjaworICogCisgKi8KK3ZvaWQgV0RBX1NldFVwZGF0ZU9wTW9kZVJlcUNhbGxiYWNrKFdESV9TdGF0dXMgc3RhdHVzLCB2b2lkKiBwVXNlckRhdGEpCit7CisgICB0V0RBX1JlcVBhcmFtcyAqcFdkYVBhcmFtcyA9ICh0V0RBX1JlcVBhcmFtcyAqKXBVc2VyRGF0YTsKKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgIC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VZIVE9wTW9kZSkpIDsKKyAgIGlmKE5VTEwgPT0gd2RpVGVtcCkgCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsgCisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9OT01FTTsKKyAgIH0KKyAgIHBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKil2b3NfbWVtX21hbGxvYyhzaXplb2YodFdEQV9SZXFQYXJhbXMpKSA7CisgICBpZihOVUxMID09IHBXZGFQYXJhbXMpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsgCisgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgdm9zX21lbV9mcmVlKHdkaVRlbXApOworICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9OT01FTTsKKyAgIH0KKyAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAiLS0tLS0tPiAlcyBPcG1vZGUgPSAlZCBhbmQgc3RhaWQgPSAlZCIgLAorICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18sIHBEYXRhLT5vcE1vZGUsIHBEYXRhLT5zdGFJZCk7CisgICB3ZGlUZW1wLT5vcE1vZGUgPSBwRGF0YS0+b3BNb2RlOworICAgd2RpVGVtcC0+c3RhSWQgID0gcERhdGEtPnN0YUlkOworICAgCisgICBwV2RhUGFyYW1zLT5wV2RhQ29ud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yAgREVTQ1JJUFRJT04gCisgICAgRGlzcGxheSBUcmFuc3BvcnQgQ2hhbm5lbCBkZWJ1Z2dpbmcgaW5mb3JtYXRpb24KKyAgICBVc2VyIG1heSByZXF1ZXN0IHRvIGRpc3BsYXkgRFhFIGNoYW5uZWwgc25hcHNob3QKKyAgICBPciBpZiBob3N0IGRyaXZlciBkZXRlY3RzIGFueSBhYm5vcm1hbCBzdGN1ayBtYXkgZGlzcGxheQorCisgIFBBUkFNRVRFUlMKKyAgICBwTWFjIDogdXBwZXIgTUFDIGNvbnRleHQgcG9pbnRlcgorICAgIGRpc3BsYXlTbmFwc2hvdCA6IERpc3BsYXkgRFhFIHNuYXBzaG90IG9wdGlvbgorICAgIGRlYnVnRmxhZ3MgICAgICA6IEVuYWJsZSBzdGFsbCBkZXRlY3QgZmVhdHVyZXMKKyAgICAgICAgICAgICAgICAgICAgICBkZWZpbmVkIGJ5IFdQQUxfRGV2aWNlRGVidWdGbGFncworICAgICAgICAgICAgICAgICAgICAgIFRoZXNlIGZlYXR1cmVzIG1heSBlZmZlY3QKKyAgICAgICAgICAgICAgICAgICAgICBkYXRhIHBlcmZvcm1hbmNlLgorCisgIFJFVFVSTiBWQUxVRQorICAgIE5PTkUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgV0RBX1RyYW5zcG9ydENoYW5uZWxEZWJ1ZworKAorICB0cEFuaVNpckdsb2JhbCBwTWFjLAorICB2X0JPT0xfdCAgICAgICBkaXNwbGF5U25hcHNob3QsCisgIHZfVThfdCAgICAgICAgIGRlYnVnRmxhZ3MKKykKK3sKKyAgIFdESV9UcmFuc3BvcnRDaGFubmVsRGVidWcoZGlzcGxheVNuYXBzaG90LCBkZWJ1Z0ZsYWdzKTsKKyAgIHJldHVybjsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgIFdEQV9UcmFuc3BvcnRLaWNrRHhlCisKKyAgREVTQ1JJUFRJT04KKyAgICBSZXF1ZXN0IEtpY2sgRHhlIHdoZW4gZmlyc3QgaGRkIFRYIHRpbWUgb3V0CisgICAgaGFwcGVucworCisgIFBBUkFNRVRFUlMKKyAgICBOT05FCisKKyAgUkVUVVJOIFZBTFVFCisgICAgTk9ORQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBXREFfVHJhbnNwb3J0S2lja0R4ZSgpCit7CisgICBXRElfVHJhbnNwb3J0S2lja0R4ZSgpOworICAgcmV0dXJuOworfQorCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICBXREFfU2V0RW5hYmxlU1NSCisKKyAgREVTQ1JJUFRJT04KKyAgICBBUEkgdG8gZW5hYmxlL2Rpc2FibGUgU1NSIG9uIFdESSB0aW1lb3V0CisKKyAgUEFSQU1FVEVSUworICAgIGVuYWJsZVNTUiA6IGVuYWJsZS9kaXNhYmxlIFNTUgorCisgIFJFVFVSTiBWQUxVRQorICAgIE5PTkUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgV0RBX1NldEVuYWJsZVNTUih2X0JPT0xfdCBlbmFibGVTU1IpCit7CisgICBXRElfU2V0RW5hYmxlU1NSKGVuYWJsZVNTUik7Cit9CisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fTFBIQgorLyoKKyAqIEZVTkNUSU9OOiBXREFfTFBIQmNvbmZSc3BDYWxsYmFjaworICoKKyAqLwordm9pZCBXREFfTFBIQmNvbmZSc3BDYWxsYmFj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UxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICJQZW5kaW5nIHJlY2VpdmVkIGZvciAlczolZCAiLCBfX2Z1bmNfXywgX19MSU5FX18pOworICAgfQorICAgZWxzZSBpZiAoV0RJX1NUQVRVU19TVUNDRVNTICE9IHdkaVN0YXR1cykKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAiRmFpbHVyZSBpbiAlczolZCBzICVkIiwgX19mdW5jX18sIF9fTElORV9fLCB3ZGlTdGF0dXMpOworICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtKTsKKyAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zKTsKKyAgIH0KKworICAgcmV0dXJuIENPTlZFUlRfV0RJMlZPU19TVEFUVVMod2RpU3RhdHVzKTsKK30KKyNlbmRpZiAvKiBGRUFUVVJFX1dMQU5fTFBIQiAqLworCit2b2lkIFdEQV9HZXRCY25NaXNzUmF0ZUNhbGxiYWNrKHRBTklfVTggc3RhdHVzLCB0QU5JX1UzMiBiY25NaXNzUmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogcFVzZXJEYXRhKQoreworICAgdFNpckJjbk1pc3NSYXRlSW5mbyAqcEJjbk1pc3NSYXRlSW5mbyA9ICh0U2lyQmNuTWlzc1JhdGVJbmZvICopcFVzZXJEYXRhOworCisgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICI8LS0tLS0tICVzICIgLF9fZnVuY19fKTsKKyAgIGlmIChOVUxMID09IHBCY25NaXNzUmF0ZUluZm8pCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOiBwV2RhUGFyYW1zIHJlY2VpdmVkIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICBWT1NfQVNTRVJUKDApIDsKKyAgICAgIHJldHVybiA7CisgICB9CisgICBpZiAocEJjbk1pc3NSYXRlSW5mby0+Y2FsbGJhY2spCisgICB7CisgICAgICAgcEJjbk1pc3NSYXRlSW5mby0+Y2FsbGJhY2soc3RhdHVzLCBiY25NaXNzUmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQmNuTWlzc1JhdGVJbmZvLT5kYXRhKTsKKyAgIH0KKyAgIHZvc19tZW1fZnJlZShwVXNlckRhdGEpOworCisgICByZXR1cm47Cit9CisKK3ZfVk9JRF90IFdEQV9Qcm9jZXNzR2V0QmNuTWlzc1JhdGVSZXEodFdEQV9DYkNvbnRleHQgKnBXREEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJCY25NaXNzUmF0ZVJlcSAqcERhdGEpCit7CisgICBXRElfU3RhdHVzIHdkaVN0YXR1czsKKyAgIHRTaXJCY25NaXNzUmF0ZUluZm8gKnBCY25NaXNzUmF0ZUluZm87CisKKyAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgIi0tLS0tLT4gJXMgIiAsIF9fZnVuY19fKTsKKworICAgcEJjbk1pc3NSYXRlSW5mbyA9CisgICAgICAgICAgICAgICh0U2lyQmNuTWlzc1JhdGVJbmZvICopdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRTaXJCY25NaXNzUmF0ZUluZm8pKTsKKyAgIGlmIChOVUxMID09IHBCY25NaXNzUmF0ZUluZm8pCisgICB7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsKKyAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICB2b3NfbWVtX2ZyZWUocERhdGEpOworICAgICAgcmV0dXJuOworICAgfQorCisgICBwQmNuTWlzc1JhdGVJbmZvLT5jYWxsYmFjayA9IChwR2V0QmNuTWlzc1JhdGVDQikocERhdGEtPmNhbGxiYWNrKTsKKyAgIHBCY25NaXNzUmF0ZUluZm8tPmRhdGEgICAgID0gcERhdGEtPmRhdGE7CisKKyAgIHdkaVN0YXR1cyA9IFdESV9HZXRCY25NaXNzUmF0ZShwQmNuTWlzc1JhdGVJbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdEQV9HZXRCY25NaXNzUmF0ZUNhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEYXRhLT5ic3NpZCk7CisgICBpZiAoV0RJX1NUQVRVU19QRU5ESU5HID09IHdkaVN0YXR1cykKKyAgIHsKKyAgICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICJQZW5kaW5nIHJlY2VpdmVkIGZvciAlczolZCAiLCBfX2Z1bmNfXywgX19MSU5FX18pOworICAgfQorICAgZWxzZSBpZiAoV0RJX1NUQVRVU19TVUNDRVNTICE9IHdkaVN0YXR1cykKKyAgIHsKKyAgICAgICBpZiAocEJjbk1pc3NSYXRlSW5mby0+Y2FsbGJhY2spCisgICAgICAgeworICAgICAgICAgICBwQmNuTWlzc1JhdGVJbmZvLT5jYWxsYmFjayhWT1NfU1RBVFVTX0VfRkFJTFVSRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTEsIHBCY25NaXNzUmF0ZUluZm8tPmRhdGEpOworICAgICAgIH0KKyAgIH0KKyAgIHZvc19tZW1fZnJlZShwRGF0YSk7Cit9CisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfRVhUU0NBTgorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgV0RBX0VYVFNjYW5TdGFydFJzcENhbGxiYWNrCisKKyAgREVTQ1JJUFRJT04KKyAgICBBUEkgdG8gc2VuZCBFWFRTY2FuIFN0YXJ0IFJlc3BvbnNlIHRvIEhERAorCisgIFBBUkFNRVRFUlMKKyAgICBwRXZlbnREYXRhOiBSZXNwb25zZSBmcm9tIEZXCisgICBwVXNlckRhdGE6Cis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBXREFfRVhUU2NhblN0YXJ0UnNwQ2FsbGJhY2sodm9pZCAqcEV2ZW50RGF0YSwgdm9pZCogcFVzZXJEYXRhKQoreworICAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zID0gKHRXREFfUmVxUGFyYW1zICopcFVzZXJEYXRhOworICAgIHRXREFfQ2JDb250ZXh0ICpwV0RBID0gTlVMTDsKKyAgICB2b2lkICpwQ2FsbGJhY2tDb250ZXh0OworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWM7CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICIlczoiLCBfX2Z1bmNfXyk7CisgICAgaWYgKE5VTEwgPT0gcFdkYVBhcmFtcykKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IHBXZGFQYXJhbXMgcmVjZWl2ZWQgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHBXREEgPSAodFdEQV9DYkNvbnRleHQgKikgcFdkYVBhcmFtcy0+cFdkYUNvbnRleHQ7CisKKyAgICBpZiAoTlVMTCA9PSBwV0RBKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogcFdEQSByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICBnb3RvIGVycm9yOworICAgIH0KKworICAgIHBNYWMgPSAodHBBbmlTaXJHbG9iYWwgKVZPU19HRVRfTUFDX0NUWFQocFdEQS0+cFZvc0NvbnRleHQpOworICAgIGlmIChOVUxMID09IHBNYWMpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOnBNYWMgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICB9CisKKyAgICBwQ2FsbGJhY2tDb250ZXh0ID0gcE1hYy0+c21lLnBFWFRTY2FuQ2FsbGJhY2tDb250ZXh0OworCisgICAgaWYgKHBNYWMtPnNtZS5wRVhUU2NhbkluZENiKQorICAgIHsKKyAgICAgICAgcE1hYy0+c21lLnBFWFRTY2FuSW5kQ2IocENhbGxiYWNrQ29udGV4dCwgV0RBX0VYVFNDQU5fU1RBUlRfUlNQLAorICAgICAgICAgICAgICAgIHBFdmVudERhdGEpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOkhERCBjYWxsYmFjayBpcyBudWxsIiwgX19mdW5jX18pOworICAgICAgICBWT1NfQVNTRVJUKDApOworICAgIH0KKworZXJyb3I6CisKKyAgICBpZiAocFdkYVBhcmFtcy0+d2RhV2RpQXBpTXNnUGFyYW0gIT0gTlVMTCkKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zLT53ZGFXZGlBcGlNc2dQYXJhbSk7CisgICAgfQorICAgIGlmIChwV2RhUGFyYW1zLT53ZGFNc2dQYXJhbSAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtKTsKKyAgICB9CisgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMpIDsKKworICAgIHJldHVybjsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgIFdEQV9FWFRTY2FuU3RvcFJzcENhbGxiYWNrCisKKyAgREVTQ1JJUFRJT04KKyAgICBBUEkgdG8gc2VuZCBFWFRTY2FuIFN0b3AgUmVzcG9uc2UgdG8gSERECisKKyAgUEFSQU1FVEVSUworICAgIHBFdmVudERhdGE6IFJlc3BvbnNlIGZyb20gRlcKKyAgIHBVc2VyRGF0YToKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIFdEQV9FWFRTY2FuU3RvcFJzcENhbGxiYWNrKHZvaWQgKnBFdmVudERhdGEsIHZvaWQqIHBVc2VyRGF0YSkKK3sKKyAgICB0V0RBX1JlcVBhcmFtcyAqcFdkYVBhcmFtcyA9ICh0V0RBX1JlcVBhcmFtcyAqKXBVc2VyRGF0YTsKKyAgICB0V0RBX0NiQ29udGV4dCAqcFd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lQoMCk7CisgICAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorICAgIHBDYWxsYmFja0NvbnRleHQgPSBwTWFjLT5zbWUucEVYVFNjYW5DYWxsYmFja0NvbnRleHQ7CisKKyAgICBpZiAocE1hYy0+c21lLnBFWFRTY2FuSW5kQ2IpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOkhERCBjYWxsIGJhY2sgZnVuY3Rpb24gY2FsbGVkIiwgX19mdW5jX18pOworICAgICAgICBwTWFjLT5zbWUucEVYVFNjYW5JbmRDYihwQ2FsbGJhY2tDb250ZXh0LCBXREFfRVhUU0NBTl9TVE9QX1JTUCwKKyAgICAgICAgICAgICAgICBwRXZlbnREYXRhKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczpIREQgY2FsbGJhY2sgaXMgbnVsbCIsIF9fZnVuY19fKTsKKyAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICB9CisKK2Vycm9yOgorCisgICAgaWYgKHBXZGFQYXJhbXMtPndkYVdkaUFwaU1zZ1BhcmFtICE9IE5VTEwpCisgICAgeworICAgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcy0+d2RhV2RpQXBpTXNnUGFyYW0pOworICAgIH0KKyAgICBpZiAocFdkYVBhcmFtcy0+d2RhTXNnUGFyYW0gIT0gTlVMTCkKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zLT53ZGFNc2dQYXJhbSk7CisgICAgfQorICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zKSA7CisKKworICAgIHJldHVybjsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgIFdEQV9FWFRTY2FuR2V0Q2FjaGVkUmVzdWx0c1JzcENhbGxiYWNrCisKKyAgREVTQ1JJUFRJT04KKyAgICBBUEkgdG8gc2VuZCBFWFRTY2FuIEdldCBDYWNoZWQgUmVzdWx0cyBSZXNwb25zZSB0byBIREQKKworICBQQVJBTUVURVJTCisgICAgcEV2ZW50RGF0YTogUmVzcG9uc2UgZnJvbSBGVworICAgcFVzZXJEYXRhOgorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgV0RBX0VYVFNjYW5HZXRDYWNoZWRSZXN1bHRzUnNwQ2FsbGJhY2sodm9pZCAqcEV2ZW50RGF0YSwgdm9pZCogcFVzZXJEYXRhKQoreworICAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zID0gKHRXREFfUmVxUGFyYW1zICopcFVzZXJEYXRhOworICAgIHRXREFfQ2JDb250ZXh0ICpwV0RBID0gTlVMTDsKKyAgICB2b2lkICpwQ2FsbGJhY2tDb250ZXh0OworICAgIHRwQW5pU2lyR2xvYmFsIHBNYWM7CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICIlczogIiwgX19mdW5jX18pOworICAgIGlmIChOVUxMID09IHBXZGFQYXJhbXMpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOiBwV2RhUGFyYW1zIHJlY2VpdmVkIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKy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AgICAgICAgICAgICIlczpIREQgY2FsbGJhY2sgaXMgbnVsbCIsIF9fZnVuY19fKTsKKyAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICB9CisKKworZXJyb3I6CisKKyAgICBpZiAocFdkYVBhcmFtcy0+d2RhV2RpQXBpTXNnUGFyYW0gIT0gTlVMTCkKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zLT53ZGFXZGlBcGlNc2dQYXJhbSk7CisgICAgfQorICAgIGlmIChwV2RhUGFyYW1zLT53ZGFNc2dQYXJhbSAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtKTsKKyAgICB9CisgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMpIDsKKworICAgIHJldHVybjsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgIFdEQV9FWFRTY2FuR2V0Q2FwYWJpbGl0aWVzUnNwQ2FsbGJhY2sKKworICBERVNDUklQVElPTgorICAgIEFQSSB0byBzZW5kIEVYVFNjYW4gR2V0IENhcGFiaWxpdGllcyBSZXNwb25zZSB0byBIREQKKworICBQQVJBTUVURVJTCisgICAgcEV2ZW50RGF0YTogUmVzcG9uc2UgZnJvbSBGVworICAgcFVzZXJEYXRhOgorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgV0RBX0VYVFNjYW5HZXRDYXBhYmlsaXRpZXNSc3BDYWxsYmFjayh2b2lkICpwRXZlbnREYXRhLCB2b2lkKiBwVXNlckRhdGEpCit7CisgICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKilwVXNlckRhdGE7CisgICAgdFdEQV9DYkNvbnRleHQgKnBXREEgPSBOVUxMOworICAgIHZvaWQgKnBDYWxsYmFja0NvbnRleHQ7CisgICAgdHBBbmlTaXJHbG9iYWwgcE1hYzsKKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgIiVzOiIsIF9fZnVuY19fKTsKKyAgICBpZiAoTlVMTCA9PSBwV2RhUGFyYW1zKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogcFdkYVBhcmFtcyByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgcFdEQSA9ICh0V0RBX0NiQ29udGV4dCAqKSBwV2RhUGFyYW1zLT5wV2RhQ29udGV4dDsKKworICAgIGlmIChOVUxMID09IHBXREEpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOiBwV0RBIHJlY2VpdmVkIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorCisgICAgcE1hYyA9ICh0cEFuaVNpckdsb2JhbCApVk9TX0dFVF9NQUNfQ1RYVChwV0RBLT5wVm9zQ29udGV4dCk7CisgICAgaWYgKE5VTEwgPT0gcE1hYykKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6cE1hYyBpcyBOVUxMIiwgX19mdW5jX18pOworICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICBnb3RvIGVycm9yOworICAgIH0KKworICAgIHBDYWxsYmFja0NvbnRleHQgPSBwTWFjLT5zbWUucEVYVFNjYW5DYWxsYmFja0NvbnRleHQ7CisKKyAgICBpZiAocE1hYy0+c21lLnBFWFRTY2FuSW5kQ2IpCisgICAgeworICAgICAgICBwTWFjLT5zbWUucEVYVFNjYW5JbmRDYihwQ2FsbGJhY2tDb250ZXh0LAorICAgICAgICAgICAgICAgIFdEQV9FWFRTQ0FOX0dFVF9DQVBBQklMSVRJRVNfUlNQLAorICAgICAgICAgICAgICAgIHBFdmVudERhdGEpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOkhERCBjYWxsYmFjayBpcyBudWxsIiwgX19mdW5jX18pOworICAgICAgICBWT1NfQVNTRVJUKDApOworICAgIH0KKworCitlcnJvcjoKKworICAgIGlmIChwV2RhUGFyYW1zLT53ZGFXZGlBcGlNc2dQYXJhbSAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYVdkaUFwaU1zZ1BhcmFtKTsKKyAgICB9CisgICAgaWYgKHBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtICE9IE5VTEwpCisgICAgeworICAgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcy0+d2RhTXNnUGFyYW0pOworICAgIH0KKyAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcykgOworCisgICAgcmV0dXJuOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgV0RBX0VYVFNjYW5TZXRCU1NJREhvdGxpc3RSc3BDYWxsYmFjaworCisgIERFU0NSSVBUSU9OCisgICAgQVBJIHRvIHNlbmQgRVhUU2NhbiBTZXQgQlNTSUQgSG90bGlzdCBSZXNwb25zZSB0byBIREQKKworICBQQVJBTUVURVJTCisgICAgcEV2ZW50RGF0YTogUmVzcG9uc2UgZnJvbSBGVworICAgcFVzZXJEYXRhOgorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgV0RBX0VYVFNjYW5TZXRCU1NJREhvdGxpc3RSc3BDYWxsYmFjayh2b2lkICpwRXZlbnREYXRhLCB2b2lkKiBwVXNlckRhdGEpCit7CisgICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKilwVXNlckRhdGE7CisgICAgdFdEQV9DYkNvbnRleHQgKnBXREEgPSBOVUxMOworICAgIHZvaWQgKnBDYWxsYmFja0NvbnRleHQ7CisgICAgdHBBbmlTaXJHbG9iYWwgcE1hYzsKKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgIiVzOiAiLCBfX2Z1bmNfXyk7CisgICAgaWYgKE5VTEwgPT0gcFdkYVBhcmFtcykKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IHBXZGFQYXJhbXMgcmVjZWl2ZWQgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICAgVk9TX0FTU0VSVCgwKSA7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBwV0RBID0gKHRXREFfQ2JDb250ZXh0ICopIHBXZGFQYXJhbXMtPnBXZGFDb250ZXh0OworCisgICAgaWYgKE5VTEwgPT0gcFdEQSkKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IHBXREEgcmVjZWl2ZWQgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICB9CisKKyAgICBwTWFjID0gKHRwQW5pU2lyR2xvYmFsIClWT1NfR0VUX01BQ19DVFhUKHBXREEtPnBWb3NDb250ZXh0KTsKKyAgICBpZiAoTlVMTCA9PSBwTWFjKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczpwTWFjIGlzIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorCisgICAgcENhbGxiYWNrQ29udGV4dCA9IHBNYWMtPnNtZS5wRVhUU2NhbkNhbGxiYWNrQ29udGV4dDsKKworICAgIGlmIChwTWFjLT5zbWUucEVYVFNjYW5JbmRDYikKKyAgICB7CisgICAgICAgIHBNYWMtPnNtZS5wRVhUU2NhbkluZENiKHBDYWxsYmFja0NvbnRleHQsCisgICAgICAgICAgICAgICAgV0RBX0VYVFNDQU5fU0VUX0JTU0lEX0hPVExJU1RfUlNQLAorICAgICAgICAgICAgICAgIHBFdmVudERhdGEpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOkhERCBjYWxsYmFjayBpcyBudWxsIiwgX19mdW5jX18pOworICAgICAgICBWT1NfQVNTRVJUKDApOworICAgIH0KKworCitlcnJvcjoKKworICAgIGlmIChwV2RhUGFyYW1zLT53ZGFXZGlBcGlNc2dQYXJhbSAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYVdkaUFwaU1zZ1BhcmFtKTsKKyAgICB9CisgICAgaWYgKHBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtICE9IE5VTEwpCisgICAgeworICAgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcy0+d2RhTXNnUGFyYW0pOworICAgIH0KKyAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcykgOworCisgICAgcmV0dXJuOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgV0RBX0VYVFNjYW5SZXNldEJTU0lESG90bGlzdFJzcENhbGxiYWNrCisKKyAgREVTQ1JJUFRJT04KKyAgICBBUEkgdG8gc2VuZCBFWFRTY2FuIFJlU2V0IEJTU0lEIEhvdGxpc3QgUmVzcG9uc2UgdG8gSERECisKKyAgUEFSQU1FVEVSUworICAgIHBFdmVudERhdGE6IFJlc3BvbnNlIGZyb20gRlcKKyAgIHBVc2VyRGF0YToKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIFdEQV9FWFRTY2FuUmVzZXRCU1NJREhvdGxpc3RSc3BDYWxsYmFjayh2b2lkICpwRXZlbnREYXRhLCB2b2lkKiBwVXNlckRhdGEpCit7CisgICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKilwVXNlckRhdGE7CisgICAgdFdEQV9DYkNvbnRleHQgKnBXREEgPSBOVUxMOworICAgIHZvaWQgKnBDYWxsYmFja0NvbnRleHQ7CisgICAgdHBBbmlTaXJHbG9iYWwgcE1hYzsKKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgIiVzOiIsIF9fZnVuY19fKTsKKyAgICBpZiAoTlVMTCA9PSBwV2RhUGFyYW1zKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogcFdkYVBhcmFtcyByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgICBWT1NfQVNTRVJUKDApIDsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHBXREEgPSAodFdEQV9DYkNvbnRleHQgKikgcFdkYVBhcmFtcy0+cFdkYUNvbnRleHQ7CisKKyAgICBpZiAoTlVMTCA9PSBwV0RBKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogcFdEQSByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICBnb3RvIGVycm9yOworICAgIH0KKworICAgIHBNYWMgPSAodHBBbmlTaXJHbG9iYWwgKVZPU19HRVRfTUFDX0NUWFQocFdEQS0+cFZvc0NvbnRleHQpOworICAgIGlmIChOVUxMID09IHBNYWMpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOnBNYWMgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICB9CisKKyAgICBwQ2FsbGJhY2tDb250ZXh0ID0gcE1hYy0+c21lLnBFWFRTY2FuQ2FsbGJhY2tDb250ZXh0OworCisgICAgaWYgKHBNYWMtPnNtZS5wRVhUU2NhbkluZENiKQorICAgIHsKKyAgICAgICAgcE1hYy0+c21lLnBFWFRTY2FuSW5kQ2IocENhbGxiYWNrQ29udGV4dCwKKyAgICAgICAgICAgICAgICBXREFfRVhUU0NBTl9SRVNFVF9CU1NJRF9IT1RMSVNUX1JTUCwKKyAgICAgICAgICAgICAgICBwRXZlbnREYXRhKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczpIREQgY2FsbGJhY2sgaXMgbnVsbCIsIF9fZnVuY19fKTsKKyAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICB9CisKKworZXJyb3I6CisKKyAgICBpZiAocFdkYVBhcmFtcy0+d2RhV2RpQXBpTXNnUGFyYW0gIT0gTlVMTCkKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zLT53ZGFXZGlBcGlNc2dQYXJhbSk7CisgICAgfQorICAgIGlmIChwV2RhUGFyYW1zLT53ZGFNc2dQYXJhbSAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtKTsKKyAgICB9CisgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMpIDsKKworICAgIHJldHVybjsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgIFdEQV9FWFRTY2FuU2V0U2lnbmZSU1NJQ2hhbmdlUnNwQ2FsbGJhY2sKKworICBERVNDUklQVElPTgorICAgIEFQSSB0byBzZW5kIEVYVFNjYW4gU2V0IFNpZ25pZmljYW50IFJTU0kgQ2hhbmdlIFJTUCB0byBIREQKKworICBQQVJBTUVURVJTCisgICAgcEV2ZW50RGF0YTogUmVzcG9uc2UgZnJvbSBGVworICAgcFVzZXJEYXRhOgorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZvaWQgV0RBX0VYVFNjYW5TZXRTaWduZlJTU0lDaGFuZ2VSc3BDYWxsYmFjayh2b2lkICpwRXZlbnREYXRhLCB2b2lkKiBwVXNlckRhdGEpCit7CisgICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKilwVXNlckRhdGE7CisgICAgdFdEQV9DYkNvbnRleHQgKnBXREEgPSBOVUxMOworICAgIHZvaWQgKnBDYWxsYmFja0NvbnRleHQ7CisgICAgdHBBbmlTaXJHbG9iYWwgcE1hYzsKKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgIiVzOiIsIF9fZnVuY19fKTsKKyAgICBpZiAoTlVMTCA9PSBwV2RhUGFyYW1zKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogcFdkYVBhcmFtcyByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgICBWT1NfQVNTRVJUKDApIDsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHBXREEgPSAodFdEQV9DYkNvbnRleHQgKikgcFdkYVBhcmFtcy0+cFdkYUNvbnRleHQ7CisKKyAgICBpZiAoTlVMTCA9PSBwV0RBKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogcFdEQSByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICBnb3RvIGVycm9yOworICAgIH0KKworICAgIHBNYWMgPSAodHBBbmlTaXJHbG9iYWwgKVZPU19HRVRfTUFDX0NUWFQocFdEQS0+cFZvc0NvbnRleHQpOworICAgIGlmIChOVUxMID09IHBNYWMpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOnBNYWMgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICB9CisKKyAgICBwQ2FsbGJhY2tDb250ZXh0ID0gcE1hYy0+c21lLnBFWFRTY2FuQ2FsbGJhY2tDb250ZXh0OworCisgICAgaWYgKHBNYWMtPnNtZS5wRVhUU2NhbkluZENiKQorICAgIHsKKyAgICAgICAgcE1hYy0+c21lLnBFWFRTY2FuSW5kQ2IocENhbGxiYWNrQ29udGV4dCwKKyAgICAgICAgICAgICAgICBXREFfRVhUU0NBTl9TRVRfU0lHTkZfUlNTSV9DSEFOR0VfUlNQLAorICAgICAgICAgICAgICAgIHBFdmVudERhdGEpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOkhERCBjYWxsYmFjayBpcyBudWxsIiwgX19mdW5jX18pOworICAgICAgICBWT1NfQVNTRVJUKDApOworICAgIH0KKworCitlcnJvcjoKKworICAgIGlmIChwV2RhUGFyYW1zLT53ZGFXZGlBcGlNc2dQYXJhbSAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYVdkaUFwaU1zZ1BhcmFtKTsKKyAgICB9CisgICAgaWYgKHBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtICE9IE5VTEwpCisgICAgeworICAgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcy0+d2RhTXNnUGFyYW0pOworICAgIH0KKyAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcykgOworCisgICAgcmV0dXJuOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgV0RBX0VYVFNjYW5SZXNldFNpZ25mUlNTSUNoYW5nZVJzcENhbGxiYWNrCisKKyAgREVTQ1JJUFRJT04KKyAgICBBUEkgdG8gc2VuZCBFWFRTY2FuIFNldCBTaWduaWZpY2FudCBSU1NJIENoYW5nZSBSU1AgdG8gSERECisKKyAgUEFSQU1FVEVSUworICAgIHBFdmVudERhdGE6IFJlc3BvbnNlIGZyb20gRlcKKyAgIHBVc2VyRGF0YToKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIFdEQV9FWFRTY2FuUmVzZXRTaWduZlJTU0lDaGFuZ2VSc3BDYWxsYmFjayh2b2lkICpwRXZlbnREYXRhLAorICAgICAgICB2b2lkKiBwVXNlckRhdGEpCit7CisgICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKilwVXNlckRhdGE7CisgICAgdFdEQV9DYkNvbnRleHQgKnBXREEgPSBOVUxMOworICAgIHZvaWQgKnBDYWxsYmFja0NvbnRleHQ7CisgICAgdHBBbmlTaXJHbG9iYWwgcE1hYzsKKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgIiVzOiIsIF9fZnVuY19fKTsKKyAgICBpZiAoTlVMTCA9PSBwV2RhUGFyYW1zKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogcFdkYVBhcmFtcyByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgICBWT1NfQVNTRVJUKDApIDsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIHBXREEgPSAodFdEQV9DYkNvbnRleHQgKikgcFdkYVBhcmFtcy0+cFdkYUNvbnRleHQ7CisKKyAgICBpZiAoTlVMTCA9PSBwV0RBKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogcFdEQSByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICBnb3RvIGVycm9yOworICAgIH0KKworICAgIHBNYWMgPSAodHBBbmlTaXJHbG9iYWwgKVZPU19HRVRfTUFDX0NUWFQocFdEQS0+cFZvc0NvbnRleHQpOworICAgIGlmIChOVUxMID09IHBNYWMpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOnBNYWMgaXMgTlVMTCIsIF9fZnVuY19fKTsKKyAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICB9CisKKyAgICBwQ2FsbGJhY2tDb250ZXh0ID0gcE1hYy0+c21lLnBFWFRTY2FuQ2FsbGJhY2tDb250ZXh0OworCisgICAgaWYgKHBNYWMtPnNtZS5wRVhUU2NhbkluZENiKQorICAgIHsKKyAgICAgICAgcE1hYy0+c21lLnBFWFRTY2FuSW5kQ2IocENhbGxiYWNrQ29udGV4dCwKKyAgICAgICAgICAgICAgICBXREFfRVhUU0NBTl9SRVNFVF9TSUdORl9SU1NJX0NIQU5HRV9SU1AsCisgICAgICAgICAgICAgICAgcEV2ZW50RGF0YSk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6SEREIGNhbGxiYWNrIGlzIG51bGwiLCBfX2Z1bmNfXyk7CisgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgfQorCisKK2Vycm9yOgorCisgICAgaWYgKHBXZGFQYXJhbXMtPndkYVdkaUFwaU1zZ1BhcmFtICE9IE5VTEwpCisgICAgeworICAgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcy0+d2RhV2RpQXBpTXNnUGFyYW0pOworICAgIH0KKyAgICBpZiAocFdkYVBhcmFtcy0+d2RhTXNnUGFyYW0gIT0gTlVMTCkKKyAgICB7CisgICAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zLT53ZGFNc2dQYXJhbSk7CisgICAgfQorICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zKSA7CisKKyAgICByZXR1cm47Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICBXREFfUHJvY2Vzc0VYVFNjYW5TdGFydFJlcQorCisgIERFU0NSSVBUSU9OCisgICAgQVBJIHRvIHNlbmQgRVhUU2NhbiBTdGFydCBSZXF1ZXN0IHRvIFdESQorCisgIFBBUkFNRVRFUlMKKyAgICBwV0RBOiBQb2ludGVyIHRvIFdEQSBjb250ZXh0CisgICAgd2RhUmVxdWVzdDogUG9pbnRlciB0byBFWFRTY2FuIHJlcSBwYXJhbWV0ZXJzCis9PT09PT09PT09PT09PT09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FNjYW5TdGFydFJzcENiKVdEQV9FWFRTY2FuU3RhcnRSc3BDYWxsYmFjaywKKyAgICAgICAgICAgICh2b2lkICopcFdkYVBhcmFtcyk7CisgICAgaWYgKElTX1dESV9TVEFUVVNfRkFJTFVSRShzdGF0dXMpKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICJGYWlsdXJlIHRvIHJlcXVlc3QuICBGcmVlIGFsbCB0aGUgbWVtb3J5ICIgKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMpOworICAgIH0KKyAgICByZXR1cm4gQ09OVkVSVF9XREkyVk9TX1NUQVRVUyhzdGF0dXMpOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgV0RBX1Byb2Nlc3NFWFRTY2FuU3RvcFJlcQorCisgIERFU0NSSVBUSU9OCisgICAgQVBJIHRvIHNlbmQgRVhUU2NhbiBTdGFydCBSZXF1ZXN0IHRvIFdESQorCisgIFBBUkFNRVRFUlMKKyAgICBwV0RBOiBQb2ludGVyIHRvIFdEQSBjb250ZXh0CisgICAgd2RhUmVxdWVzdDogUG9pbnRlciB0byBFWFRTY2FuIHJlcSBwYXJhbWV0ZXJzCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXREFfUHJvY2Vzc0VYVFNjYW5TdG9wUmVxKHRXREFfQ2JDb250ZXh0ICpwV0RBLAorICAgICAgICB0U2lyRVhUU2NhblN0b3BSZXFQYXJhbXMgKndkYVJlcXVlc3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Vk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICJGYWlsdXJlIHRvIHJlcXVlc3QuICBGcmVlIGFsbCB0aGUgbWVtb3J5ICIgKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMpOworICAgIH0KKyAgICByZXR1cm4gQ09OVkVSVF9XREkyVk9TX1NUQVRVUyhzdGF0dXMpOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgV0RBX1Byb2Nlc3NFWFRTY2FuR2V0Q2FjaGVkUmVzdWx0c1JlcQorCisgIERFU0NSSVBUSU9OCisgICAgQVBJIHRvIHNlbmQgRVhUU2NhbiBHZXQgQ2FjaGVkIFJlc3VsdHMgUmVxdWVzdCB0byBXREkKKworICBQQVJBTUVURVJTCisgICAgcFdEQTogUG9pbnRlciB0byBXREEgY29udGV4dAorICAgIHdkYVJlcXVlc3Q6IFBvaW50ZXIgdG8gRVhUU2NhbiByZXEgcGFyYW1ldGVycworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgV0RBX1Byb2Nlc3NFWFRTY2FuR2V0Q2FjaGVkUmVzdWx0c1JlcSh0V0RBX0NiQ29udGV4dCAqcFdEQSwKKyAgICAgICAgdFNpckVYVFNjYW5HZXRDYWNoZWRSZXN1bHRzUmVxUGFyYW1zICp3ZGFSZXF1ZXN0KQoreworICAgIFdESV9TdGF0dXMgc3RhdHVzID0gV0RJX1NUQVRVU19TVUNDRVNTOworICAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zOworCisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX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1lbW9yeSAiICk7CisgICAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zLT53ZGFNc2dQYXJhbSk7CisgICAgICAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zKTsKKyAgICB9CisgICAgcmV0dXJuIENPTlZFUlRfV0RJMlZPU19TVEFUVVMoc3RhdHVzKTsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgIFdEQV9Qcm9jZXNzRVhUU2NhbkdldENhcGFiaWxpdGllc1JlcQorCisgIERFU0NSSVBUSU9OCisgICAgQVBJIHRvIHNlbmQgRVhUU2NhbiBHZXQgQ2FwYWJpbGl0aWVzIFJlcXVlc3QgdG8gV0RJCisKKyAgUEFSQU1FVEVSUworICAgIHBXREE6IFBvaW50ZXIgdG8gV0RBIGNvbnRleHQKKyAgICB3ZGFSZXF1ZXN0OiBQb2ludGVyIHRvIEVYVFNjYW4gcmVxIHBhcmFtZXRlcnMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdEQV9Qcm9jZXNzRVhUU2NhbkdldENhcGFiaWxpdGllc1JlcSh0V0RBX0NiQ29udGV4dCAqcFdEQSwKKyAgICAgICAgdFNpckdldEVYVFNjYW5DYXBhYmlsaXRpZXNSZXFQYXJhbXMgKndkYVJlcXVlc3QpCit7CisgICAgV0RJX1N0YXR1cyBzdGF0dXMgPSBXRElfU1RBVFVTX1NVQ0NFU1M7CisgICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXM7CisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICIlczoiLCBfX2Z1bmNfXyk7CisgICAgcFdkYVBhcmFtc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9mcmVlKHBXZGFQYXJhbXMpOworICAgIH0KKyAgICByZXR1cm4gQ09OVkVSVF9XREkyVk9TX1NUQVRVUyhzdGF0dXMpOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgV0RBX1Byb2Nlc3NFWFRTY2FuU2V0QlNTSURIb3RsaXN0UmVxCisKKyAgREVTQ1JJUFRJT04KKyAgICBBUEkgdG8gc2VuZCBTZXQgQlNTSUQgSG90bGlzdCBSZXF1ZXN0IHRvIFdESQorCisgIFBBUkFNRVRFUlMKKyAgICBwV0RBOiBQb2ludGVyIHRvIFdEQSBjb250ZXh0CisgICAgd2RhUmVxdWVzdDogUG9pbnRlciB0byBFWFRTY2FuIHJlcSBwYXJhbWV0ZXJzCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXREFfUHJvY2Vzc0VYVFNjYW5TZXRCU1NJREhvdGxpc3RSZXEodFdEQV9DYkNvbnRleHQgKnBXREEsCisgICAgICAgIHRTaXJFWFRTY2FuU2V0QnNzaWRIb3RMaXN0UmVxUGFyYW1zICp3ZGFSZXF1ZXN0KQoreworICAgIFdESV9TdGF0dXMgc3RhdHVzID0gV0RJX1NUQVRVU19TVUNDRVNTOworICAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zOworCisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAiJXM6ICIsIF9fZnVuY19fKTsKKyAgICBwV2RhUGFyYW1zID0gKHRXREFfUmVxUGFyYW1zICopdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRXREFfUmVxUGFyYW1zKSk7CisgICAgaWYgKE5VTEwgPT0gcFdkYVBhcmFtcykKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IFZPUyBNRU0gQWxsb2MgRmFpbHVyZSIsIF9fZnVuY19fKTsKKyAgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9OT01FTTsKKyAgICB9CisgICAgcFdkYVBhcmFtcy0+cFdkYUNvbnRleHQgPSBwV0RBOworICAgIHBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtID0gd2RhUmVxdWVzdDsKKyAgICBwV2RhUGFyYW1zLT53ZGFXZGlBcGlNc2dQYXJhbSA9IE5VTEw7CisKKyAgICBzdGF0dXMgPSBXRElfRVhUU2NhblNldEJTU0lESG90bGlzdFJlcSgodm9pZCAqKXdkYVJlcXVlc3QsCisgICAgICAgICAoV0RJX0VYVFNjYW5TZXRCU1NJREhvdGxpc3RSc3BDYilXREFfRVhUU2NhblNldEJTU0lESG90bGlzdFJzcENhbGxiYWNrLAorICAgICAgICAgICAgKHZvaWQgKilwV2RhUGFyYW1zKTsKKyAgICBpZiAoSVNfV0RJX1NUQVRVU19GQUlMVVJFKHN0YXR1cykpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIkZhaWx1cmUgdG8gcmVxdWVzdC4gIEZyZWUgYWxsIHRoZSBtZW1vcnkgIiApOworICAgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcy0+d2RhTXNnUGFyYW0pOworICAgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcyk7CisgICAgfQorICAgIHJldHVybiBDT05WRVJUX1dESTJWT1NfU1RBVFVTKHN0YXR1cyk7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICBXREFfUHJvY2Vzc0VYVFNjYW5SZVNldEJTU0lESG90bGlzdFJlcQorCisgIERFU0NSSVBUSU9OCisgICAgQVBJIHRvIHNlbmQgUmVzZXQgQlNTSUQgSG90bGlzdCBSZXF1ZXN0IHRvIFdESQorCisgIFBBUkFNRVRFUlMKKyAgICBwV0RBOiBQb2ludGVyIHRvIFdEQSBjb250ZXh0CisgICAgd2RhUmVxdWVzdDogUG9pbnRlciB0byBFWFRTY2FuIHJlcSBwYXJhbWV0ZXJzCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXREFfUHJvY2Vzc0VYVFNjYW5SZXNldEJTU0lESG90bGlzdFJlcSh0V0RBX0NiQ29udGV4dCAqcFdEQSwKKyAgICAgICAgdFNpckVYVFNjYW5SZXNldEJzc2lkSG90bGlzdFJlcVBhcmFtcyAqd2RhUmVxdWVzdCkKK3sKKyAgICBXRElfU3RhdHVzIHN0YXR1cyA9IFdESV9TVEFUVVNfU1VDQ0VTUzsKKyAgICB0V0RBX1JlcVBhcmFtcyAqcFdkYVBhcmFtczsKKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgIiVzOiIsIF9fZnVuY19fKTsKKyAgICBwV2RhUGFyYW1zID0gKHRXREFfUmVxUGFyYW1zICopdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRXREFfUmVxUGFyYW1zKSk7CisgICAgaWYgKE5VTEwgPT0gcFdkYVBhcmFtcykKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAiJXM6IFZPUy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JIENoYW5nZSBSZXF1ZXN0IHRvIFdESQorCisgIFBBUkFNRVRFUlMKKyAgICBwV0RBOiBQb2ludGVyIHRvIFdEQSBjb250ZXh0CisgICAgd2RhUmVxdWVzdDogUG9pbnRlciB0byBFWFRTY2FuIHJlcSBwYXJhbWV0ZXJzCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUyBXREFfUHJvY2Vzc0VYVFNjYW5SZXNldFNpZ25mUlNTSUNoYW5nZVJlcSh0V0RBX0NiQ29udGV4dCAqcFdEQSwKKyAgICAgICAgdFNpckVYVFNjYW5SZXNldFNpZ25pZmljYW50Q2hhbmdlUmVxUGFyYW1zICp3ZGFSZXF1ZXN0KQoreworICAgIFdESV9TdGF0dXMgc3RhdHVzID0gV0RJX1NUQVRVU19TVUNDRVNTOworICAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zOworCisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAiJXM6IiwgX19mdW5jX18pOworICAgIHBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKil2b3NfbWVtX21hbGxvYyhzaXplb2YodFdEQV9SZXFQYXJhbXMpKTsKKyAgICBpZiAoTlVMTCA9PSBwV2RhUGFyYW1zKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICIlczogVk9TIE1FTSBBbGxvYyBGYWlsdXJlIiwgX19mdW5jX18pOworICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX05PTUVNOworICAgIH0KKyAgICBwV2RhUGFyYW1zLT5wV2RhQ29udGV4dCA9IHBXREE7Cis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NldCBsaW5rIGxheWVyIHN0YXRpc3RpY3MgcmVzcG9uc2UgZnJvbSBGVworCisgIFBBUkFNRVRFUlMKKyAgICBwUnNwOiBQb2ludGVyIHRvIHNldCBsaW5rIGxheWVyIHN0YXRpc3RpY3MgcmVzcG9uc2UKKyAgICBwVXNlckRhdGE6IFBvaW50ZXIgdG8gdXNlciBkYXRhCisKKyAgUkVUVVJOIFZBTFVFCisgICAgTk9ORQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBXREFfTExTdGF0c1NldFJzcENhbGxiYWNrKHZvaWQgKnBFdmVudERhdGEsIHZvaWQqIHBVc2VyRGF0YSkKK3sKKyAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zID0gKHRXREFfUmVxUGFyYW1zICopcFVzZXJEYXRhOworCisKKyAgIGlmIChOVUxMID09IHBXZGFQYXJhbXMpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICIlczogcFdkYVBhcmFtcyByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKSA7CisgICAgICByZXR1cm4gOworICAgfQorCisgICAvKiBEbyBub3QgbmVlZCB0byBzZW5kIG5vdGlmaWNhdGlvbiB0byB1cHBlciBsYXllcgorICAgICogSnVzdCBmcmVlIGFsbG9jYXRlZCByZXNvdXJjZXMgKi8KKyAgIGlmIChwV2RhUGFyYW1zLT53ZGFXZGlBcGlNc2dQYXJhbSAhPSBOVUxMKQorICAgeworICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYVdkaUFwaU1zZ1BhcmFtKTsKKyAgIH0KKyAgIGlmIChwV2RhUGFyYW1zLT53ZGFNc2dQYXJhbSAhPSBOVUxMKQorICAgeworICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtKTsKKyAgIH0KKyAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zKSA7CisKKyAgIHJldHVybjsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgIFdEQV9Qcm9jZXNzTExTdGF0c1NldFJlcQorCisgIERFU0NSSVBUSU9OCisgICAgQVBJIHRvIHNlbmQgU2V0IExpbmsgTGF5ZXIgU3RhdHMgcmVxdWVzdCB0byBXREkKKworICBQQVJBTUVURVJTCisgICAgcFdEQTogUG9pbnRlciB0byBXREEgY29udGV4dAorICAgIHdkYVJlcXVlc3Q6IFBvaW50ZXIgdG8gc2V0IExpbmsgTGF5ZXIgU3RhdHMgcmVxIHBhcmFtZXRlcnMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdEQV9Qcm9jZXNzTExTdGF0c1NldFJlcSh0V0RBX0NiQ29udGV4dCAqcFdEQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJMTFN0YXRzU2V0UmVxICp3ZGFSZXF1ZXN0KQoreworICAgIFdESV9TdGF0dXMgc3RhdHVzID0gV0RJX1NUQVRVU19TVUNDRVNTOworICAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zOworCisgICAgcFdkYVBhcmFtcyA9ICh0V0RBX1JlcVBhcmFtcyAqKXZvc19tZW1fbWFsbG9jKHNpemVvZih0V0RBX1JlcVBhcmFtcykpOworICAgIGlmIChOVUxMID09IHBXZGFQYXJhbXMpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgIiVzOiBWT1MgTUVNIEFsbG9jIEZhaWx1cmUiLCBfX2Z1bmNfXyk7CisgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfTk9NRU07CisgICAgfQorICAgIHBXZGFQYXJhbXMtPnBXZGFDb250ZXh0ID0gcFdEQTsKKyAgICBwV2RhUGFyYW1zLT53ZGFNc2dQYXJhbSA9IHdkYVJlcXVlc3Q7CisgICAgcFdkYVBhcmFtcy0+d2RhV2RpQXBpTXNnUGFyYW0gPSBOVUxMOworCisgICAgc3RhdHVzID0gV0RJX0xMU3RhdHNTZXRSZXEoKHZvaWQgKil3ZGFSZXF1ZXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXRElfTExTdGF0c1NldFJzcENiKVdEQV9MTFN0YXRzU2V0UnNwQ2FsbGJhY2ssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilwV2RhUGFyYW1zKTsKKyAgICBpZiAoSVNfV0RJX1NUQVRVU19GQUlMVVJFKHN0YXR1cykpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgIkZhaWx1cmUgdG8gcmVxdWVzdC4gIEZyZWUgYWxsIHRoZSBtZW1vcnkgIiApOworICAgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcy0+d2RhTXNnUGFyYW0pOworICAgICAgICB2b3NfbWVtX2ZyZWUocFdkYVBhcmFtcyk7CisgICAgfQorICAgIHJldHVybiBDT05WRVJUX1dESTJWT1NfU1RBVFVTKHN0YXR1cyk7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gV0RBX0xMU3RhdHNHZXRSc3BDYWxsYmFjaworCisgIERFU0NSSVBUSU9OCisgICAgQVBJIHRvIHByb2Nlc3MgZ2V0IGxpbmsgbGF5ZXIgc3RhdGlzdGljcyByZXNwb25zZSBmcm9tIEZXCisKKyAgUEFSQU1FVEVSUworICAgIHBSc3A6IFBvaW50ZXIgdG8gZ2V0IGxpbmsgbGF5ZXIgc3RhdGlzdGljcyByZXNwb25zZQorICAgIHBVc2VyRGF0YTogUG9pbnRlciB0byB1c2VyIGRhdGEKKworICBSRVRVUk4gVkFMVUUKKyAgICBOT05FCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIFdEQV9MTFN0YXRzR2V0UnNwQ2FsbGJhY2sodm9pZCAqcEV2ZW50RGF0YSwgdm9pZCogcFVzZXJEYXRhKQoreworICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKilwVXNlckRhdGE7CisKKyAgIGlmIChOVUxMID09IHBXZGFQYXJhbXMpCisgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICIlczogcFdkYVBhcmFtcyByZWNlaXZlZCBOVUxMIiwgX19mdW5jX18pOworICAgICAgVk9TX0FTU0VSVCgwKSA7CisgICAgICByZXR1cm4gOworICAgfQorCisgICAvKiBEbyBub3QgbmVlZCB0byBzZW5kIG5vdGlmaWNhdGlvbiB0byB1cHBlciBsYXllcgorICAgICogSnVzdCBmcmVlIGFsbG9jYXRlZCByZXNvdXJjZXMgKi8KKyAgIGlmIChwV2RhUGFyYW1zLT53ZGFXZGlBcGlNc2dQYXJhbSAhPSBOVUxMKQorICAgeworICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYVdkaUFwaU1zZ1BhcmFtKTsKKyAgIH0KKyAgIGlmIChwV2RhUGFyYW1zLT53ZGFNc2dQYXJhbSAhPSBOVUxMKQorICAgeworICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtKTsKKyAgIH0KKyAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zKSA7CisKKyAgIHJldHVybjsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBGVU5DVElPTiAgIFdEQV9Qcm9jZXNzTExTdGF0c0dldFJlcQorCisgIERFU0NSSVBUSU9OCisgICAgQVBJIHRvIHNlbmQgR2V0IExpbmsgTGF5ZXIgU3RhdHMgcmVxdWVzdCB0byBXREkKKworICBQQVJBTUVURVJTCisgICAgcFdEQTogUG9pbnRlciB0byBXREEgY29udGV4dAorICAgIHdkYVJlcXVlc3Q6IFBvaW50ZXIgdG8gZ2V0IExpbmsgTGF5ZXIgU3RhdHMgcmVxIHBhcmFtZXRlcnMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTIFdEQV9Qcm9jZXNzTExTdGF0c0dldFJlcSh0V0RBX0NiQ29udGV4dCAqcFdEQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJMTFN0YXRzR2V0UmVxICp3ZGFSZXF1ZXN0KQoreworICAgIFdESV9TdGF0dXMgc3RhdHVzID0gV0RJX1NUQVRVU19TVUNDRVNTOworICAgIHRXREFfUmVxUGFyYW1zICpwV2RhUGFyYW1zOworCisgICAgcFdkYVBhcmFtcyA9ICh0V0RBX1JlcVBhcmFtcyAqKXZvc19tZW1fbWFsbG9jKHNpemVvZih0V0RBX1JlcVBhcmFtcykpOworICAgIGlmIChOVUxMID09IHBXZGFQYXJhbXMpCisgICAgeworICAgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgIiVzOiBWT1MgTUVNIEFsbG9jIEZhaWx1cmUiLCBfX2Z1bmNfXyk7CisgICAgICAgIFZPU19BU1NFUlQoMCk7CisgICAgICAgIHJldHVybiBWT1NfU1RBVFVTX0VfTk9NRU07CisgICAgfQorICAgIHBXZGFQYXJhbXMtPnBXZGFDb250ZXh0ID0gcFdEQTsKKyAgICBwV2RhUGFyYW1zLT53ZGFNc2dQYXJhbSA9IHdkYVJlcXVlc3Q7CisgICAgcFdkYVBhcmFtcy0+d2RhV2RpQXBpTXNnUGFyYW0gPSBOVUxMOworCisgICAgc3RhdHVzID0gV0RJX0xMU3RhdHNHZXRSZXEoKHZvaWQgKikgd2RhUmVxdWVzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV0RJX0xMU3RhdHNHZXRSc3BDYilXREFfTExTdGF0c0dldFJzcENhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopcFdkYVBhcmFtcyk7CisgICAgaWYgKElTX1dESV9TVEFUVVNfRkFJTFVSRShzdGF0dXMpKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICJGYWlsdXJlIHRvIHJlcXVlc3QuICBGcmVlIGFsbCB0aGUgbWVtb3J5ICIgKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtKTsKKyAgICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMpOworICAgIH0KKyAgICByZXR1cm4gQ09OVkVSVF9XREkyVk9TX1NUQVRVUyhzdGF0dXMpOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OIFdEQV9MTFN0YXRzQ2xlYXJSc3BDYWxsYmFjaworCisgIERFU0NSSVBUSU9OCisgICAgQVBJIHRvIHByb2Nlc3MgY2xlYXIgbGluayBsYXllciBzdGF0aXN0aWNzIHJlc3BvbnNlIGZyb20gRlcKKworICBQQVJBTUVURVJTCisgICAgcFJzcDogUG9pbnRlciB0byBjbGVhciBsaW5rIGxheWVyIHN0YXRpc3RpY3MgcmVzcG9uc2UKKyAgICBwVXNlckRhdGE6IFBvaW50ZXIgdG8gdXNlciBkYXRhCisKKyAgUkVUVVJOIFZBTFVFCisgICAgTk9ORQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordm9pZCBXREFfTExTdGF0c0NsZWFyUnNwQ2FsbGJhY2sodm9pZCAqcEV2ZW50RGF0YSwgdm9pZCogcFVzZXJEYXRhKQoreworICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKilwVXNlckRhdGE7CisKKworICAgaWYgKE5VTEwgPT0gcFdkYVBhcmFtcykKKyAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIiVzOiBwV2RhUGFyYW1zIHJlY2VpdmVkIE5VTEwiLCBfX2Z1bmNfXyk7CisgICAgICBWT1NfQVNTRVJUKDApIDsKKyAgICAgIHJldHVybiA7CisgICB9CisgICAvKiBEbyBub3QgbmVlZCB0byBzZW5kIG5vdGlmaWNhdGlvbiB0byB1cHBlciBsYXllcgorICAgICogSnVzdCBmcmVlIGFsbG9jYXRlZCByZXNvdXJjZXMgKi8KKyAgIGlmIChwV2RhUGFyYW1zLT53ZGFXZGlBcGlNc2dQYXJhbSAhPSBOVUxMKQorICAgeworICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYVdkaUFwaU1zZ1BhcmFtKTsKKyAgIH0KKyAgIGlmIChwV2RhUGFyYW1zLT53ZGFNc2dQYXJhbSAhPSBOVUxMKQorICAgeworICAgICAgdm9zX21lbV9mcmVlKHBXZGFQYXJhbXMtPndkYU1zZ1BhcmFtKTsKKyAgIH0KKyAgIHZvc19tZW1fZnJlZShwV2RhUGFyYW1zKSA7CisgICByZXR1cm47Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICBXREFfUHJvY2Vzc0xMU3RhdHNDbGVhclJlcQorCisgIERFU0NSSVBUSU9OCisgICAgQVBJIHRvIHNlbmQgQ2xlYXIgTGluayBMYXllciBTdGF0cyByZXF1ZXN0IHRvIFdESQorCisgIFBBUkFNRVRFUlMKKyAgICBwV0RBOiBQb2ludGVyIHRvIFdEQSBjb250ZXh0CisgICAgd2RhUmVxdWVzdDogUG9pbnRlciB0byBlYXJMaW5rIExheWVyIFN0YXRzIHJlcQorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgV0RBX1Byb2Nlc3NMTFN0YXRzQ2xlYXJSZXEodFdEQV9DYkNvbnRleHQgKnBXREEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRTaXJMTFN0YXRzQ2xlYXJSZXEgKndkYVJlcXVlc3QpCit7CisgICAgV0RJX1N0YXR1cyBzdGF0dXMgPSBXRElfU1RBVFVTX1NVQ0NFU1M7CisgICAgdFdEQV9SZXFQYXJhbXMgKnBXZGFQYXJhbXM7CisKKyAgICBwV2RhUGFyYW1zID0gKHRXREFfUmVxUGFyYW1zICopdm9zX21lbV9tYWxsb2Moc2l6ZW9mKHRXREFfUmVxUGFyYW1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lTdGF0dXM7CisgICAgdFNpckZXU3RhdHNJbmZvICpmd1N0YXRzaW5mbzsKKworICAgIFZPU19UUkFDRShWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgIi0tLS0tLT4gJXMiICwgX19mdW5jX18pOworCisgICAgZndTdGF0c2luZm8gPQorICAgICAgICAgKHRTaXJGV1N0YXRzSW5mbyAqKXZvc19tZW1fbWFsbG9jKHNpemVvZih0U2lyRldTdGF0c0luZm8pKTsKKyAgICBpZiAoTlVMTCA9PSBmd1N0YXRzaW5mbykKKyAgICB7CisgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgIiVzOiBWT1MgTUVNIEFsbG9jIEZhaWx1cmUiLCBfX2Z1bmNfXyk7CisgICAgICAgVk9TX0FTU0VSVCgwKTsKKyAgICAgICB2b3NfbWVtX2ZyZWUocERhdGEpOworICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBmd1N0YXRzaW5mby0+Y2FsbGJhY2sgPSAodFNpckZXU3RhdHNDYWxsYmFjaykocERhdGEtPmNhbGxiYWNrKTsKKyAgICBmd1N0YXRzaW5mby0+ZGF0YSAgICAgPSBwRGF0YS0+ZGF0YTsKKworICAgIHdkaVN0YXR1cyA9IFdESV9GV1N0YXRzR2V0UmVxKGZ3U3RhdHNpbmZvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXREFfRldTdGF0c0dldFJzcENhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRGF0YS0+c3RhdHMpOworICAgIGlmIChXRElfU1RBVFVTX1BFTkRJTkcgPT0gd2RpU3RhdHVzKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgIlBlbmRpbmcgcmVjZWl2ZWQgZm9yICVzOiVkICIsIF9fZnVuY19fLCBfX0xJTkVfXyk7CisgICAgfQorICAgIGVsc2UgaWYgKFdESV9TVEFUVVNfU1VDQ0VTUyAhPSB3ZGlTdGF0dXMpCisgICAgeworICAgICAgICBpZiAoZndTdGF0c2luZm8tPmNhbGxiYWNrKQorICAgICAgICB7CisgICAgICAgICAgICBmd1N0YXRzaW5mby0+Y2FsbGJhY2soV0RJX1NUQVRVU19FX0ZBSUxVUkUsIE5VTEwgLGZ3U3RhdHNpbmZvLT5kYXRhKTsKKyAgICAgICAgfQorICAgICAgICB2b3NfbWVtX2ZyZWUoZndTdGF0c2luZm8pOworICAgIH0KKyAgICB2b3NfbWVtX2ZyZWUocERhdGEpOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICBXREFfRW5jcnlwdE1zZ1JzcENhbGxiYWNrCisKKyAgREVTQ1JJUFRJT04KKyAgICBBUEkgdG8gc2VuZCBFbmNyeXB0IG1lc3NhZ2UgcmVzcG9uc2UgdG8gSERECisKKyAgUEFSQU1FVEVSUworICAgIHBFdmVudERhdGE6IFJlc3BvbnNlIGZyb20gRlcKKyAgICBwVXNlckRhdGE6IERhdGEgc2VudCB0byBmaXJtd2FyZSBhcyBwYXJ0IG9mIHJlcXVlc3QKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIFdEQV9FbmNyeXB0TXNnUnNwQ2FsbGJhY2soV0RJX1N0YXR1cyBzdGF0dXMsIHZvaWQgKnBFdmVudERhdGEsCisgICAgICAgIHZvaWQqIHBVc2VyRGF0YSkKK3sKKyAgICB0V0RBX1JlcVBhcmFtcyAqcFdkYVBhcmFtcyA9ICh0V0RBX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T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICBXREFfUHJvY2Vzc0VuY3J5cHRNc2dSZXEKKworICBERVNDUklQVElPTgorICAgIEFQSSB0byBzZW5kIEVuY3J5cHQgbWVzc2FnZSBSZXF1ZXN0IHRvIFdESQorCisgIFBBUkFNRVRFUlMKKyAgICBwV0RBOiBQb2ludGVyIHRvIFdEQSBjb250ZXh0CisgICAgd2RhUmVxdWVzdDogUG9pbnRlciB0byBFbmNyeXB0X21zZyByZXEgcGFyYW1ldGVycworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgV0RBX1Byb2Nlc3NFbmNyeXB0TXNnUmVxKHRXREFfQ2JDb250ZXh0ICpwV0RBLAorICAgICAgICB1OCAqd2RhUmVxdWVzdCkKK3sKKyAgICBXRElfU3RhdHVzIHN0YXR1cyA9IFdESV9TVEFUVVNfU1VDQ0VTUzsKKyAgICB0V0RBX1JlcVBhcmFtcyAqcFdkYVBhcmFtczsKKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgRkwoIiVzOiAiKSwgX19mdW5jX18pOworICAgIHBXZGFQYXJhbXMgPSAodFdEQV9SZXFQYXJhbXMgKil2b3NfbWVtX21hbGxvYyhzaXplb2YodFdEQV9SZXFQYXJhbXMpKTsKKyAgICBpZiAoTlVMTCA9PSBwV2RhUGFyYW1zKQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgRkwoIiVzOiBWT1MgTUVNIEFsbG9jIEZhaWx1cmUiKSwgX19mdW5jX18pOworICAgICAgICBWT1NfQVNTRVJUKDApOworICAgICAgICByZXR1c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IHRvIFdEQSBjb250ZXh0CisgICAgcnRzQ3RzVmFsIDogQml0IG1hc2sgdmFsdWUgdG8gZW5hYmxlIFJUUy9DVFMgZm9yIGRpZmZlcmVudCBtb2RlcworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworVk9TX1NUQVRVUworV0RBX1Byb2Nlc3NTZXRSdHNDdHNIVFZodEluZCh0V0RBX0NiQ29udGV4dCAqcFdEQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0QU5JX1UzMiBydHNDdHNWYWwpCit7CisgICAgV0RJX1N0YXR1cyBzdGF0dXM7CisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgIEZMKCItLS0+ICVzIiksIF9fZnVuY19fKTsKKyAgICBzdGF0dXMgPSBXRElfU2V0UnRzQ3RzSFRWaHRJbmQocnRzQ3RzVmFsKTsKKyAgICBpZiAoV0RJX1NUQVRVU19QRU5ESU5HID09IHN0YXR1cykKKyAgICB7CisgICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICBGTCgicGVuZGluZyBzdGF0dXMgcmVjZWl2ZWQgIikpOworICAgIH0KKyAgICBlbHNlIGlmIChXRElfU1RBVFVTX1NVQ0NFU1NfU1lOQyAhPSBzdGF0dXMpCisgICAgeworICAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREEsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIEZMKCJGYWlsdXJlIHN0YXR1cyAlZCIpLCBzdGF0dXMpOworICAgIH0KKyAgICByZXR1cm4gQ09OVkVSVF9XREkyVk9TX1NUQVRVUyhzdGF0dXMpIDsKK30KKwordm9pZCBXREFfTW9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HdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgICB3bGFuX3FjdF93ZGFfZGVidWcuYworCisgIE9WRVJWSUVXOgorCisgIFRoaXMgc29mdHdhcmUgdW5pdCBob2xkcyB0aGUgaW1wbGVtZW50YXRpb24gb2YgdGhlIFdMQU4gRGV2aWNlIEFkYXB0YXRpb24KKyAgTGF5ZXIgZm9yIGRlYnVnZ2luZyBBUElzLgorCisgIFRoZSBmdW5jdGlvbnMgZXh0ZXJuYWxpemVkIGJ5IHRoaXMgbW9kdWxlIGFyZSB0byBiZSBjYWxsZWQgT05MWSBieSBvdGhlcgorICBXTEFOIG1vZHVsZXMgdGhhdCBwcm9wZXJseSByZWdpc3RlciB3aXRoIHRoZSBUcmFuc3BvcnQgTGF5ZXIgaW5pdGlhbGx5LgorCisgIERFUEVOREVOQ0lFUzoKKworICBBcmUgbGlzdGVkIGZvciBlYWNoIEFQSSBiZWxvdy4KKworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisKKyNpbmNsdWRlICJwYWxUeXBlcy5oIgorI2luY2x1ZGUgIndsYW5fcWN0X3dkYV9kZWJ1Zy5oIgorCit2b2lkIHdkYUxvZyh0cEFuaVNpckdsb2JhbCBwTWFjLCB0QU5JX1UzMiBsb2dsZXZlbCwgY29uc3QgY2hhciAqcFN0cmluZywuLi4pIHsKKyAgICB2YV9saX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REEgXyBEUyAuIEMKKworICBPVkVSVklFVzoKKworICBUaGlzIHNvZnR3YXJlIHVuaXQgaG9sZHMgdGhlIGltcGxlbWVudGF0aW9uIG9mIFdMQU4gRGF0YSBBYnRyYWN0aW9uIEFQSXMKKyAgZm9yIHRoZSBXTEFOIFRyYW5zcG9ydCBMYXllci4KKworICBERVBFTkRFTkNJRVM6CisKKyAgQXJlIGxpc3RlZCBmb3IgZWFjaCBBUEkgYmVsb3cuCisKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgIEVESVQgSElTVE9SWSBGT1IgRklMRQorCisKKyAgVGhpcyBzZWN0aW9uIGNvbnRhaW5zIGNvbW1lbnRzIGRlc2NyaWJpbmcgY2hhbmdlcyBtYWRlIHRvIHRoZSBtb2R1bGUuCisgIE5vdGljZSB0aGF0IGNoYW5nZXMgYXJlIGxpc3RlZCBpbiByZXZlcnNlIGNocm9ub2xvZ2ljYWwgb3JkZXIuCisKKworICAkSGVhZGVyOiQgJERhdGVUaW1lOiAkICRBdXRob3I6ICQKKworCit3aGVuICAgICAgICB3aG8gICAgICAgICAgd2hhdCwgd2hlcmUsIHdoeQorLS0tLS0tLS0gICAgLS0tICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorMTIvMDgvMjAxMCAgc2Vva3lvdW4gICAgQ3JlYXRlZC4gTW92ZSBkb3duIEhBTCBpbnRlcmZhY2VzIGZyb20gVEwgdG8gV0RBCisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgVU1BQyBjb252ZXJnZW5jZSBidHdlZW4gVm9sYW5zL0xpYnJhIGFuZCBQcmltYQorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCisKKyNpbmNsdWRlICJ3bGFuX3FjdF93ZGEuaCIKKyNpbmNsdWRlICJ3bGFuX3FjdF90bC5oIgorI2luY2x1ZGUgIndsYW5fcWN0X3RsaS5oIgorI2luY2x1ZGUgInRsRGVidWcuaCIKKworI2RlZmluZSBXREFfRFNfRFhFX1JFU19DT1VOVCAgIChXREFfVExJX01JTl9SRVNfREFUQSArIDIwKQorCisvKiBtYWNybydzIGZvciBhY2Vzc2luZyBUTCBBUEkvZGF0YSBzdHJ1Y3R1cmVzICovCisjZGVmaW5lIFdEQV9UTF9TRVRfVFhfWE1JVF9QRU5ESU5HKGEpIFdMQU5UTF9TZXRUeFhtaXRQZW5kaW5nKGEpCisjZGVmaW5lIFdEQV9UTF9JU19UWF9YTUlUX1BFTkRJTkcoYSkgV0xBTlRMX0lzVHhYbWl0UGVuZGluZyhhKQorI2RlZmluZSBXREFfVExfQ0xFQVJfVFhfWE1JVF9QRU5ESU5HKGEpIFdMQU5UTF9DbGVhclR4WG1pdFBlbmRpbmcoYSkKKworI2RlZmluZSBXREFfSElfRkxPV19NQVNLIDB4RjAKKyNkZWZpbmUgV0RBX0xPX0ZMT1dfTUFTSyAweDBGCisKK3N0YXRpYyB2X1ZPSURfdCAKK1dEQV9EU19UeENvbXBsZXRlQ0IKKygKKyB2X1BWT0lEX3QgcHZvc0dDdHgsIAorIHZfUFZPSURfdCBwRnJhbWVEYXRhQnVmZgorKTsKKworCisjaWZkZWYgV0xBTl9QRVJGCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdEQV9UTElfRmFzdEh3RndkRGF0YUZyYW1lCisKKyAgREVTQ1JJUFRJT04gCisgICAgRm9yIE5PTiBpbnRlZ3JhdGVkIFNPQywgdG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IFNUQSB0eXBlCisgICAgCisgICBPVVQKKyAgICAgICAgcHZvc1N0YXR1cyAgcmV0dXJuZWQgc3RhdHVzCisgICAgICAgIHB1RmFzdEZ3ZE9LIEZsYWcgdG8gaW5kaWNhdGUgd2hldGhlciBmcmFtZSBjb3VsZCBiZSBmYXN0IGZvcndhcmRlZAorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIE5vIHJldHVybi4gICAKKworICBTSURFIEVGRkVDVFMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkIFdEQV9UTElfRmFzdEh3RndkRGF0YUZyYW1lCisoCisgIHZfUFZPSURfdCAgICAgcHZvc0dDdHgsCisgIHZvc19wa3RfdCogICAgdm9zRGF0YUJ1ZmYsCisgIFZPU19TVEFUVVMqICAgcHZvc1N0YXR1cywKKyAgdl9VMzJfdCogICAgICAgcHVGYXN0RndkT0ssCisgIFdMQU5UTF9NZXRhSW5mb1R5cGUqICBwTWV0YUluZm8sCisgIFdMQU5fU1RBRGVzY1R5cGUqICBwU3RhSW5mbworKQoreworICAvKiBGSVhNRSBXREkvV0RBIHNob3VsZCBzdXBwb3J0IHRoaXMgZnVuY3Rpb24KKyAgICAgb25jZSBIQUwgc3VwcG9ydHMgaXQKKyAgICovCit9CisjZW5kaWYgLypXTEFOX1BFUkYqLworCit2b2lkIFdEQV9EU19SeExvZ0NhbGxiYWNrKHZvaWQpCit7CisgIHZvc19tc2dfdCB2b3NNZXNzYWdlOworCisgIHZvc01lc3NhZ2UuYm9keXB0ciA9IE5VTEw7CisgIHZvc01lc3NhZ2UucmVzZXJ2ZWQgPSAwOworICB2b3NNZXNzYWdlLnR5cGUgPSBXREFfU0VORF9MT0dfRE9ORV9JTkQ7CisgIGlmIChWT1NfU1RBVFVTX1NVQ0NFU1MgIT0gdm9zX21xX3Bvc3RfbWVzc2FnZSggVk9TX01RX0lEX1dEQSwgJ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ggY29tcGxldGUgY2FsbGJhY2sgdXBvbiBUWCBjb21wbGV0aW9uCisgICAgICAgIHBmblJ4UGFja2V0Q2FsbGJhY2sgICAgICAgICBSWCBjYWxsYmFjaworICAgICAgICBwZm5UeFBhY2tldENhbGxiYWNrICAgICAgICAgVFggY2FsbGJhY2sKKyAgICAgICAgcGZuUmVzb3VyY2VDQiAgICAgICAgICAgICAgIGdldHMgY2FsbGVkIHdoZW4gdXBkYXRpbmcgVFggUERVIG51bWJlcgorICAgICAgICB1UmVzVGhlc2hvbGQgICAgICAgICAgICAgICAgbWluaW11bSBUWCBQRFUgc2l6ZSBmb3IgYSBwYWNrZXQKKyAgICAgICAgcENhbGxiYWNrQ29udGV4dCAgICAgICAgICAgIFdESSBjYWxscyBjYWxsYmFjayBmdW5jdGlvbiB3aXRoIGl0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWT1MgZ2xvYmFsIGNvbnRleHQgcG9pbnRlcgorICAgT1VUCisgICAgICAgIHVBdmFpbGFibGVUeEJ1ZiAgICAgICBhdmFpbGFibGUgVFggUERVIG51bWJkZXIuIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQkFMIHJldHVybnMgaXQgZm9yIE5PTiBpbnRlZ3JhdGVkIFNPQworICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFZPU19TVEFUVVNfRV9GQVVMVDogIHBvaW50ZXIgaXMgTlVMTCBhbmQgb3RoZXIgZXJyb3JzIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisgIFNJREUgRUZGRUNUUyAKKyAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMgV0RBX0RTX1JlZ2lzdGVyIAorKCAKKyAgdl9QVk9JRF90ICAgICAgICAgICAgICAgICBwdm9zR0N0eCwgCisgIFdE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lbnQiICk7CisKKyAgdm9zX21lbV96ZXJvKCAmc01lc3NhZ2UsIHNpemVvZih2b3NfbXNnX3QpICk7CisKKyAgc01lc3NhZ2UuYm9keXB0ciA9IE5VTEw7CisgIHNNZXNzYWdlLnR5cGUgICAgPSBXREFfRFNfVFhfU1RBUlRfWE1JVDsKKworICBXREFfVExfU0VUX1RYX1hNSVRfUEVORElORyhwdm9zR0N0eCk7CisKKyAgc3RhdHVzID0gdm9zX3R4X21xX3NlcmlhbGl6ZShWT1NfTVFfSURfVEwsICZzTWVzc2FnZSk7CisKKyAgaWYoc3RhdHVzICE9IFZPU19TVEFUVVNfU1VDQ0VTUykKKyAgeworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICJTZXJpYWxpemluZyBXREEgVFggU3RhcnQgWG1pdCBldmVudCBGQUlMRUQiICk7CisgICAgV0RBX1RMX0NMRUFSX1RYX1hNSVRfUEVORElORyhwdm9zR0N0eCk7CisgIH0KKyAgcmV0dXJuIHN0YXR1czsKK30KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEZVTkNUSU9OICAgIFdEQV9EU19GaW5pc2hVTEEKKworICBERVNDUklQVElPTiAKKyAgICBTZXJpYWxpemUgRmluaXNoIFVwcGVyIExldmVsIEF1dGhlbnRpY2F0aW9uIHJlcXVlcyB0byBUWCB0aHJlYWQuIAorCisgIERFUEVOREVOQ0lFUyAKKyAgICAgCisgIFBBUkFNRVRFUlMgCisKKyAgIElOCisgICAgICAgIGNhbGxiYWNrUm91dGluZSAgICByb3V0aW5lIHRvIGJlIGNhbGxlZCBpbiBUWCB0aHJlYWQKKyAgICAgICAgY2FsbGJhY2tDb250ZXh0ICAgIHVzZXIgZGF0YSBmb3IgdGhlIGFib3ZlIHJvdXRpbmUgCisgICAKKyAgUkVUVVJOIFZBTFVFCisgICAgcGxlYXNlIHNlZSB2b3NfdHhfbXFfc2VyaWFsaXplCisKKyAgU0lERSBFRkZFQ1RTIAorICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0RBX0RTX0ZpbmlzaFVMQQorKAorIHZvaWQgKCpjYWxsYmFja1JvdXRpbmUpICh2b2lkICpjYWxsYmFja0NvbnRleHQpLAorIHZvaWQgICpjYWxsYmFja0NvbnRleHQKKykKK3sKKyAgdm9zX21zZ190ICAgICAgICAgICAgICAgICAgICBzTWVzc2FnZTsKKy8qIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtICovCisKKyAgLyogU2VyaWFsaXplIG91ciBldmVudCAgKi8KKyAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19ISUdILAorICAgICAgICAgICAgICJTZXJpYWxpemluZyBXREFfRFNfRmluaXNoVUxBIGV2ZW50IiApOworCisgIHZvc19tZW1femVybyggJnNNZXNzYWdlLCBzaXplb2Yodm9zX21zZ190KSApOworICBzTWVzc2FnZS5ib2R5cHRyICA9IGNhbGxiYWNrQ29udGV4dDsKKyAgc01lc3NhZ2UuY2FsbGJhY2sgPSBjYWxsYmFja1JvdXRpbmU7CisgIHNNZXNzYWdlLmJvZHl2YWwgID0gMDsKKyAgc01lc3NhZ2UudHlwZSAgICAgPSBXREFfRFNfRklOSVNIX1VMQTsKKworICByZXR1cm4gdm9zX3R4X21xX3NlcmlhbGl6ZShWT1NfTVFfSURfVEwsICZzTWVzc2FnZSk7Cit9LypXREFfRFNfRmluaXNoVUxBKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgRlVOQ1RJT04gICAgV0RBX0RTX0J1aWxkVHhQYWNrZXRJbmZvCisKKyAgREVTQ1JJUFRJT04KKyAgICBCdWlsZCBUWCBtZXRhIGluZm8gZm9yIGludGVncmF0ZWQgU09DLgorICAgIAorICAgIFNhbWUgZnVuY3Rpb24gY2FsbHMgSEFMIGZvciByZXNlcnZlIEJEIGhlYWRlciBzcGFjZSBpbnRvIFZPUyBwYWNrZXQgYW5kCisgICAgSEFMIGZ1bmN0aW9uIHRvIGZpbGwgaXQuCisgICAgCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgSU4KKyAgICBwdm9zR0N0eCAgICAgICAgIFZPUyBjb250ZXh0CisgICAgdm9zRGF0YUJ1ZmYgICAgICB2b3MgZGF0YSBidWZmZXIKKyAgICBwdkRlc3RNYWNBZGRyICAgZGVzdGluYXRpb24gTUFDIGFkZHJlc3MgcG9udGVyCisgICAgdWNEaXNhYmxlRnJtWHRsICBJcyBmcmFtZSB4dGwgZGlzYWJsZWQ/CisgICAgdWNRb3NFbmFibGVkICAgICBJcyBRb1MgZW5hYmxlZD8KKyAgICB1Y1dEU0VuYWJsZWQgICAgIElzIFdEUyBlbmFibGVkPworICAgIGV4dHJhSGVhZFNwYWNlICAgRXh0cmEgaGVhZCBieXRlcy4gSWYgaXQncyBub3QgMCBkdWUgdG8gNCBieXRlcyBhbGlnbgorICAgICAgICAgICAgICAgICAgICAgb2YgQkQgaGVhZGVyLgorICAgIHR5cGVTdWJ0eXBlICAgICAgdHlwZVN1YnR5cGUgZnJvbSBNQUMgaGVhZGVyIG9yIFRYIG1ldGFpbmZvL0JECisgICAgcEFkZHIyICAgICAgICAgICBhZGRyZXNzIDIKKyAgICB1VGlkICAgICAgICAgICAgIHRpZAorICAgIHR4RmxhZworICAgIHRpbWVTdGFtcAorICAgIHVjSXNFYXBvbAorICAgIHVjVVAKKworICAgT1VUCisgICAgKnB1c1BrdExlbiAgICAgICBQYWNrZXQgbGVuZ3RoCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVk9TX1NUQVRVU19FX0ZBVUxUOiAgcG9pbnRlciBpcyBOVUxMIGFuZCBvdGhlciBlcnJvcnMgCisgICAgVk9TX1NUQVRVU19TVUNDRVNTOiAgRXZlcnl0aGluZyBpcyBnb29kIDopCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworVk9TX1NUQVRVUworV0RBX0RTX0J1aWxkVHhQYWNrZXRJbmZvCisoCisgIHZfUFZPSURfdCAgICAgICBwdm9zR0N0eCwKKyAgdm9zX3BrdF90KiAgICAgIHZvc0RhdGFCdWZmLAorICB2X01BQ0FERFJfdCogICAgcHZEZXN0TWFjQWRkciwKKyAgdl9VOF90ICAgICAgICAgIHVjRGlzYWJsZUZybVh0bCwKKyAgdl9VMTZfdCogICAgICAgIHB1c1BrdExlbiwKKyAgdl9VOF90ICAgICAgICAgIHVjUW9zRW5hYmxlZCwKKyAgdl9VOF90ICAgICAgICAgIHVjV0RTRW5hYmxlZCwKKyAgdl9VOF90ICAgICAgICAgIGV4dHJhSGVhZFNwYWNlLAorICB2X1U4X3QgICAgICAgICAgdHlwZVN1YnR5cGUsCisgIHZfUFZPSURfdCAgICAgICBwQWRkcjIsCisgIHZfVThfdCAgICAgICAgICB1VGlkLAorICB2X1UzMl90ICAgICAgICAgIHR4RmxhZywKKyAgdl9VMzJfdCAgICAgICAgIHRpbWVTdGFtcCwKKyAgdl9VOF90ICAgICAgICAgIHVjSXNFYXBvbCwKKyAgdl9VOF90ICAgICAgICAgIHVjVVAsCisgIHZfVTMyX3QgICAgICAgICB1Y1R4QmRUb2tlbgorKQoreworICBWT1NfU1RBVFVTICAgICAgICAgICAgIHZvc1N0YXR1czsKKyAgV0RJX0RTX1R4TWV0YUluZm9UeXBlKiBwVHh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ICAgICAgICAgICAgICAgICAgICJGcmFtZSBDb250cm9sLCBzdGF0dXMgJWQiLCB2b3NTdGF0dXMgKTsKKyAgICAgICAgVk9TX0FTU0VSVCggMCApOworICAgICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworICAgICAgfQorICAgICAgcFR4TWV0YUluZm8tPmZQcm90TWdtdEZyYW1lID0gcEZyYW1lQ29udHJvbC0+d2VwOworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAgICAgICJXTEFOIFRMOiBmUHJvdE1nbXRGcmFtZTolZCIsIHBUeE1ldGFJbmZvLT5mUHJvdE1nbXRGcmFtZSApOworICAgIH0KKyAgfQorCisgIC8vIERzdCBhZGRyZXNzCisgIHVzTWFjQWRkclNpemUgPSBWT1NfTUFDX0FERFJfU0laRTsKKyAgdm9zU3RhdHVzID0gdm9zX3BrdF9leHRyYWN0X2RhdGEoIHZvc0RhdGFCdWZmLAorICAgICAgICAgICAgICAgICAgICBXTEFOVExfTUFDX0FERFJfQUxJR04oIHVjRGlzYWJsZUZybVh0bCApLAorICAgICAgICAgICAgICAgICAgICAodl9QVk9JRF90KXB2RGVzdE1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICZ1c01hY0FkZHJTaXplICk7CisgIGlmICgoVk9TX1NUQVRVU19TVUNDRVNTICE9IHZvc1N0YXR1cykgfHwKKyAgICAgICAgICAodXNNYWNBZGRyU2l6ZSAhPSBWT1NfTUFDX0FERFJfU0laRSkpCisgIHsKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICJXREE6RmFpbGVkIHdoaWxlIGF0dGVtcHRpbmcgdG8gZXh0cmFjdCBNQUMgQWRkciAlZCIsCisgICAgICAgICAgICAgICAgdm9zU3RhdHVzICk7CisgICAgVk9TX0FTU0VSVCggMCApOworICAgIHJldHVybiBWT1NfU1RBVFVTX0VfRkFVTFQ7CisgIH0KKworICB2b3NfY29weV9tYWNhZGRyKCAodl9NQUNBRERSX3QqKXBUeE1ldGFJbmZvLT5mU1RBTUFDQWRkcmVzcywgcHZEZXN0TWFjQWRkciApOworCisgIC8vIEFERFIyCisgIHZvc19jb3B5X21hY2FkZHIoICh2X01BQ0FERFJfdCopcFR4TWV0YUluZm8tPmFkZHIyTUFDQWRkcmVzcywgcEFkZHIyICk7CisKKyAgLyogRHVtcCBUWCBtZXRhIGluZnJvIGZvciBkZWJ1Z2dpbmcgKi8KKyAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1RMLCBWT1NfVFJBQ0VfTEVWRUxfSU5GT19MT1csCisgICAgICAgICAgICAgIldMQU4gVEw6IER1bXAgVFggbWV0YSBpbmZvOiAiCisgICAgICAgICAgICAgInR4RmxhZ3M6JWQsIHFvc0VuYWJsZWQ6JWQsIGFjOiVkLCAiCisgICAgICAgICAgICAgImlzRWFwb2w6JWQsIGZkaXNhYmxlRnJtWGx0OiVkLCBmcm1UeXBlOiVkIiwKKyAgICAgICAgICAgICBwVHhNZXRhSW5mby0+dHhGbGFncywgdWNRb3NFbmFibGVkLCBwVHhNZXRhSW5mby0+YWMsCisgICAgICAgICAgICAgcFR4TWV0YUluZm8tPmlzRWFwb2wsIHBUeE1ldGFJbmZvLT5mZGlzYWJsZUZybVhsdCwKKyAgICAgICAgICAgICBwVHhNZXRhSW5mby0+ZnJtVHlwZSApOworCisgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9CisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgRlVOQ1RJT04gICAgV0RTX0RTX1RyaW1SeFBhY2tldEluZm8KKworICBERVNDUklQVElPTgorICAgIFRyaW0vUmVtb3ZlIFJYIEJEIGhlYWRlciBmb3IgTk9OIGludGVncmF0ZWQgU09DLgorICAgIEl0IGRvZXMgbm90aGluZyBmb3IgaW50ZWdyYXRlZCBTT0MuCisgICAgCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgSU4KKyAgICB2b3NEYXRhQnVmZiAgICAgIHZvcyBkYXRhIGJ1ZmZlcgorCisgIFJFVFVSTiBWQUxVRQorICAgIFZPU19TVEFUVVNfRV9GQVVMVDogIHBvaW50ZXIgaXMgTlVMTCBhbmQgb3RoZXIgZXJyb3JzIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dEQV9EU19UcmltUnhQYWNrZXRJbmZvCisoIAorICB2b3NfcGt0X3QgKnZvc0RhdGFCdWZmCispCit7CisgIC8qIE5vdGhpbmcgdG8gdHJpbQorICAgKiBEbyBOb3RoaW5nICovCisKKyAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgIEZVTkNUSU9OICAgIFdEQV9EU19QZWVrUnhQYWNrZXRJbmZvCisKKyAgREVTQ1JJUFRJT04KKyAgICBSZXR1cm4gUlggbWV0YWluZm8gcG9pbnRlciBmb3IgZm9yIGludGVncmF0ZWQgU09DLgorICAgIAorICAgIFNhbWUgZnVuY3Rpb24gd2lsbCByZXR1cm4gQkQgaGVhZGVyIHBvaW50ZXIuCisgICAgCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgSU4KKyAgICB2b3NEYXRhQnVmZiAgICAgIHZvcyBkYXRhIGJ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FDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICJXREE6SW52YWxpZCBwYXJhbWV0ZXIgc2VudCBvbiBXREFfRFNfUGVla1J4UGFja2V0SW5mbyIgKTsKKyAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBVUxUOworICB9CisKKyAgKnBwUnhIZWFkZXIgPSBXRElfRFNfRXh0cmFjdFJ4TWV0YURhdGEoICh3cHRfcGFja2V0Kil2b3NEYXRhQnVmZiApOworCisgIGlmICggTlVMTCA9PSAqcHBSeEhlYWRlciApCisgIHsKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiV0RBOkZhaWxlZCB0byBnZXQgUlggbWV0YSBkYXRhIGZyb20gV0RJIiApOworICAgICByZXR1cm4gVk9TX1NUQVRVU19FX0ZBSUxVUkU7CisgIH0KKyAgICAgCisgIHJldHVybiBWT1NfU1RBVFVTX1NVQ0NFU1M7Cit9CisKKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICBGVU5DVElPTiAgICBXREFfRFNfR2V0RnJhbWVUeXBlU3ViVHlwZQorCisgIERFU0NSSVBUSU9OCisgICAgR2V0IHR5cGVTdWJ0eXBlIGZyb20gdGhlIHBhY2tldC4gVGhlIEJEIGhlYWRlciBzaG91bGQgaGF2ZSB0aGlzLgorICAgIEJ1dCBzb21lIHJlYXNvbiwgTGlicmEvVm9sYW5zIHJlYWQgaXQgZnJvbSA4MDIuMTEgaGVhZGVyIGFuZCBzYXZlIGl0CisgICAgYmFjayB0byBCRCBoZWFkZXIuIFNvIGZvciBOT04gaW50ZWdyYXRlZCBTT0MsIHRoaXMgZnVuY3Rpb24gZG9lcworICAgIHRoZSBzYW1lLgorCisgICAgRm9yIGludGVncmF0ZWQgU09DLCBXREkgZG9lcyB0aGU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S0tLS0tLS0tLS0tLS0tKi8KKyAgaWYgKCBOVUxMID09IHBSeEhlYWRlciApCisgIHsKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiV0RBOkludmFsaWQgcGFyYW1ldGVyIHNlbnQgb24gV0RBX0RTX0dldEZyYW1lVHlwZVN1YlR5cGUiICk7CisgICAgcmV0dXJuIFZPU19TVEFUVVNfRV9GQVVMVDsKKyAgfQorCisgICp1Y1R5cGVTdWJ0eXBlID0gKCBXREFfR0VUX1JYX1RZUEUoIHBSeEhlYWRlciApIDw8IDQgKSB8IFdEQV9HRVRfUlhfU1VCVFlQRSggcFJ4SGVhZGVyICk7CisKKyAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICBGVU5DVElPTiAgICBXREFfRFNfUnhBbXNkdUJkRml4CisKKyAgREVTQ1JJUFRJT04KKyAgICBGb3IgYmFja3dhcmQgY29tcGF0YWJpbGl0eSB3aXRoIExpYnJhL1ZvbGFucy4gTmVlZCB0byBjYWxsIEhBTCBmdW5jdGlvbgorICAgIGZvciBIVyBCRCBidWcgZml4CisKKyAgICBJdCBkb2VzIG5vdGhpbmcgZm9yIGludGVncmF0ZWQgU09DLgorCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgSU4KKyAgICBwdm9zR0N0eCAgICAgICAgIFZPUyBjb250ZXh0CisgICAgcHZCREhlYWRlciAgICAgICBCRCBoZWFkZXIgcG9pbnRlcgorCisgICBPVVQKKworICBSRVRVUk4gVkFMVUUKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6ICBwb2ludGVyIGlzIE5VTEwgYW5kIG90aGVyIGVycm9ycyAKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitWT1NfU1RBVFVTCitXREFfRFNfUnhBbXNkdUJkRml4CisoCisgIHZfUFZPSURfdCBwdm9zR0N0eCwKKyAgdl9QVk9JRF90IHB2QkRIZWFkZXIKKykKK3sKKyAgLyogRG8gbm90aGluZyBmb3IgUHJpbWEgKi8KKyAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgRlVOQ1RJT04gICAgV0RBX0RTX0dldFJzc2kKKworICBERVNDUklQVElPTgorICAgIEdldCBSU1NJIAorCisgIFRPRE8gSXQgcmV0dXJucyBoYXJkY29kZWQgdmFsdWUgaW4gdGhlIG1lYW50aW1lIHNpbmNlIFdEQS9XREkgZG9lcyBub3RoaW5nCisgICAgICAgc3VwcG9ydCBpdCB5ZXQgZm9yIFByaW1hLgorCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgSU4KKyAgICB2b3NEYXRhQnVmZiAgICAgIHZvcyBkYXRhIGJ1ZmZlcgorCisgICBPVVQKKyAgICBwdVJzc2kgICAgICAgICAgIFJTU0kKKworICBSRVRVUk4gVkFMVUUKKyAgICBWT1NfU1RBVFVTX0VfRkFVTFQ6ICBwb2ludGVyIGlzIE5VTEwgYW5kIG90aGVyIGVycm9ycyAKKyAgICBWT1NfU1RBVFVTX1NVQ0NFU1M6ICBFdmVyeXRoaW5nIGlzIGdvb2QgOikKKworICBTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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ZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK1ZPU19TVEFUVVMKK1dEQV9EU19HZXRUeFJlc291cmNlcworKCAKKyAgdl9QVk9JRF90IHB2b3NHQ3R4LAorICB2X1UzMl90KiAgcHVSZXNDb3VudAorKQoreworICAvKiBSZXR1cm4gbWluaW11bSBuZWNlc3NhcnkgbnVtYmVyIG9mIHBhY2tldChEWEUgZGVzY3JpcHRvcikgZm9yIGRhdGEgKi8KKyAgLyogVE9ETyBOZWVkIHRvIGdldCB0aGlzIGZyb20gRFhFPz8/ICovCisgICpwdVJlc0NvdW50ID0gV0RBX1RMSV9CRF9QRFVfUkVTRVJWRV9USFJFU0hPTEQgKyA1MDsKKyAgcmV0dXJuIFZPU19TVEFUVVNfU1VDQ0VTUzsKK30KKworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgIEZVTkNUSU9OICAgIFdEQV9EU19HZXRSZXBsYXlDb3VudGVyCisKKyAgREVTQ1JJUFRJT04KKyAgICBSZXR1cm4gcmVwbGF5IGNvdW50ZXIgZnJvbSBCRCBoZWFkZXIgb3IgUlggbWV0YSBpbmZvCisKKyAgREVQRU5ERU5DSUVTCisKKyAgUEFSQU1FVEVSUworCisgICBJTgorICAgIHBSeEhlYWRlciAgICAgICAgUlggbWV0YSBpbmZvIG9yIEJEIGhlYWRlciBwb2ludGVyCisKKyAgIE9VVAorCisgIFJFVFVSTiBWQUxVRQorICAgIFJlcGxheSBDb3VudGVyCisKKyAgU0lERSBFRkZFQ1RTCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordl9VNjRfdAorV0RBX0RTX0dldFJlcGxheUNvdW50ZXIKKygKKyAgdl9QVk9JRF90IHBSeEhlYWRlcgorKQoreworICByZXR1cm4gV0RBX0dFVF9SWF9SRVBMQVlfQ09VTlQoIHBSeEhlYWRlciApOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICBGVU5DVElPTiAgICBXREFfRFNfVHhGcmFtZXMKKworICBERVNDUklQVElPTgorICAgIFB1bGwgcGFja2V0cyBmcm9tIFRMIGFuZCBwdXNoIHRoZW0gdG8gV0RJLiBJdCBnZXRzIGludm9rZWQgdXBvbgorICAgIFdEQV9EU19UWF9TVEFSVF9YTUlULgorCisgICAgVGhpcyBmdW5jdGlvbiBpcyBlcXVpdmVsYW50IG9mIFdMQU5TU0NfVHJhbnNtaXQgaW4gTGlicmEvVm9sYW5zLgorCisgIFRPRE8KKyAgICBUaGlzIGZ1bmN0aW9uIHNob3VsZCBiZSBpbXBsZW1lbnRlZCBhbmQgbW92ZWQgaW4gV0RJLgorCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgSU4KKyAgICBwdm9zR0N0eCAgICAgICAgIFZPUyBjb250ZXh0CisKKyAgIE9VVAorCisgIFJFVFVSTiBWQUxVRQorICAgIFZPU19TVEFUVVNfRV9GQVVMVDogIHBvaW50ZXIgaXMgTlVMTCBhbmQgb3RoZXIgZXJyb3JzIAorICAgIFZPU19TVEFUVVNfU1VDQ0VTUzogIEV2ZXJ5dGhpbmcgaXMgZ29vZCA6KQorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworVk9TX1NUQVRVUworV0RBX0RTX1R4RnJhbWVzCisoIAorICB2X1BWT0lEX3QgcHZvc0dD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ICAwIC8qIG1vcmUgKi8gKTsKKyAgICBpZiAoIFdESV9TVEFUVVNfU1VDQ0VTUyAhPSB3ZGlTdGF0dXMgKQorICAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICAiV0RBIDogUHVzaGluZyBhIHBhY2tldCB0byBXREkgZmFpbGVkLiIgKTsKKyAgICAgIGlmICggV0RJX1NUQVRVU19FX05PVF9BTExPV0VEICE9IHdkaVN0YXR1cyApCisgICAgICB7CisgICAgICAgIHVUeEZhaWxDb3VudCsrOworICAgICAgfQorICAgICAgVk9TX0FTU0VSVCggd2RpU3RhdHVzID09IFdESV9TVEFUVVNfRV9OT1RfQUxMT1dFRCApOworICAgICAgLy9XZSBuZWVkIHRvIGZyZWUgdGhlIHBhY2tldCBoZXJlCisgICAgICB2b3NfcGt0X2dldF91c2VyX2RhdGFfcHRyKHBUeFBhY2tldCwgVk9TX1BLVF9VU0VSX0RBVEFfSURfVEwsICh2b2lkICoqKSZwZm5UeENvbXApOworICAgICAgaWYocGZuVHhDb21wKQorICAgICAgeworICAgICAgICAgcGZuVHhDb21wKHB2b3NHQ3R4LCBwVHhQYWNrZXQsIFZPU19TVEFUVVNfRV9GQUlMVVJFKTsKKyAgICAgIH0KKyAgICB9CisKKyAgfTsKKworICBpZiAoIHVUeEZhaWxDb3VudCApCisgIHsKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIldEQSA6IFR4IGZhaWwgY291bnQgZm9yIG1nbXQgcGt0czogJWQuIiwgdVR4RmFpbENvdW50KTsKKyAgICB1VHhGYWlsQ291bnQgPSAwOworICB9CisKKyAgLypEYXRhIHR4Ki8KKyAgdURhdGFBdmFpbFJlcyA9IFdESV9HZXRBdmFpbGFibGVSZXNDb3VudCh3ZGFDb250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WNrZXRfY2hhaW4oIHBUeERhdGFDaGFpbiwgJnBUeERhdGFDaGFpbiwgVk9TX1RSVUUgKTsKKworICAgIGlmKCAoVk9TX1NUQVRVU19TVUNDRVNTICE9IHZvc1N0YXR1cykgJiYKKyAgICAgICAgKFZPU19TVEFUVVNfRV9FTVBUWSAhPSB2b3NTdGF0dXMpICkKKyAgICB7CisgICAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RBLCBWT1NfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICJXREEgV2Fsa2luZyBwYWNrZXQgY2hhaW4gcmV0dXJuZWQgc3RhdHVzIDogJWQiLCB2b3NTdGF0dXMgKTsKKyAgICAgIFZPU19BU1NFUlQoIDAgKTsKKyAgICAgIHZvc1N0YXR1cyA9IFZPU19TVEFUVVNfRV9GQUlMVVJFOworICAgICAgYnJlYWs7CisgICAgfQorCisgICAgaWYgKCBWT1NfU1RBVFVTX0VfRU1QVFkgPT0gdm9zU3RhdHVzICkKKyAgICB7CisgICAgICAgdm9zU3RhdHVzID0gVk9TX1NUQVRVU19TVUNDRVNTOworICAgIH0KKworICAgIHdkaVN0YXR1cyA9IFdESV9EU19UeFBhY2tldCggd2RhQ29udGV4dC0+cFdkaUNvbnRleHQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHdwdF9wYWNrZXQqKXBUeFBhY2tldCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIC8qIG1vcmUgKi8gKTsKKyAgICBpZiAoIFdESV9TVEFUVVNfU1VDQ0VTUyAhPSB3ZGlTdGF0dXMgKQorICAgIHsKKyAgICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9UTCwgVk9TX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICAiV0RBIDogUHVzaGluZyBhIHBhY2tldCB0byBXREkgZmFpbGVkLiIgKTsKKyAgICAgIGlmICggV0RJX1NUQVRVU19FX05PVF9BTExPV0VEICE9IHdkaVN0YXR1cyApCisgICAgICB7CisgICAgICAgIHVUeEZhaWxDb3VudCsrOworICAgICAgfQorICAgICAgVk9TX0FTU0VSVCggd2RpU3RhdHVzID09IFdESV9TVEFUVVNfRV9OT1RfQUxMT1dFRCApOworICAgICAgLy9XZSBuZWVkIHRvIGZyZWUgdGhlIHBhY2tldCBoZXJlCisgICAgICB2b3NfcGt0X2dldF91c2VyX2RhdGFfcHRyKHBUeFBhY2tldCwgVk9TX1BLVF9VU0VSX0RBVEFfSURfVEwsICh2b2lkICoqKSZwZm5UeENvbXApOworICAgICAgaWYocGZuVHhDb21wKQorICAgICAgeworICAgICAgICAgcGZuVHhDb21wKHB2b3NHQ3R4LCBwVHhQYWNrZXQsIFZPU19TVEFUVVNfRV9GQUlMVVJFKTsKKyAgICAgIH0KKyAgICB9CisKKyAgfTsKKworICBpZiAoIHVUeEZhaWxDb3VudCApCisgIHsKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfVEwsIFZPU19UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIldEQSA6IFR4IGZhaWwgY291bnQgZm9yIGRhdGEgcGt0czogJWQuIiwgdVR4RmFpbENvdW50KTsKKyAgfQorCisKKyAgV0RJX0RTX1R4Q29tcGxldGUod2RhQ29udGV4dC0+cFdkaUNvbnRleHQsIHVjVHhSZXNSZXEpOworCisgIHJldHVybiB2b3NTdGF0dXM7Cit9CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgIEZVTkNUSU9OICAgIFdEQV9EU19UeEZsb3dDb250cm9sQ2FsbGJhY2sKKworICBERVNDUklQVElPTgorICAgIEludm9rZWQgYnkgV0RJIHRvIGNvbnRyb2wgVFggZmxvdy4KKworICBERVBFTkRFTkNJRVMKKworICBQQVJBTUVURVJTCisKKyAgIElOCisgICAgcHZvc0dDdHggICAgICAgICBWT1MgY29udGV4dAorICAgIHVGbG93TWFzayAgICAgICAgVFggY2hhbm5lbCBtYXNrIGZvciBmbG93IGNvbnRyb2wKKyAgICAgICAgICAgICAgICAgICAgIERlZmluZWQgaW4gV0RBX1RYRmxvd0VudW1UeXBlCisKKyAgIE9VVAorCisgIFJFVFVSTiBWQUxVRQorCisgIFNJREUgRUZGRUNUUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3ZfVk9JRF90CitXREFfRFNfVHhGbG93Q29udHJvbENhbGxiYWNrCisoCisgICB2X1BWT0lEX3QgcHZvc0dDdHgsCisgICB2X1U4X3QgICAgdWNGbG93TWFzaworKQoreworICAgdFdEQV9DYkNvbnRleHQqIHdkYUNvbnRleHQgPSBOVUxMOworICAgIHZfVThfdCAgICAgICAgICB1Y09sZEZsb3dNYXNrOworICAgLyotIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSovCisKKyAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgIFNhbml0eSBjaGVjaworICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisgICBpZiAoIE5VTEwgPT0gcHZvc0dDdHggKQorICAgeworICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dEQSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiV0RBOiBJbnZhbGlkIHBhcmFtZXRlciBzZW50IG9uIFdEQV9EU19UeEZsb3dDb250cm9sQ2F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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgICBPRkYgIHwgIDEwICp8IDAwICoKKyAgICAKKyAgICAgICAgKiAtIHN0YXRlcyBpbiB3aGljaCBhIGNoYW5uZWwgY2FuIGJlIGVuYWJsZWQKKyAgICAKKyAgICAgIHVjRmxvd01hc2sgd2lsbCB0ZWxsIHdoaWNoIGNoYW5uZWwgbXVzdCBiZSBlbmFibGVkCisgICAgICB0byBlbmFibGUgYSBjaGFubmVsIGEgbmV3IGJpdCBtdXN0IGJlIHR1cm5lZCBvbiA9PgorICAgICAgdWNGbG93TWFzayA+IHdkYUNvbnRleHQtPnVUeEZsb3dNYXNrIHdoZW4gZW5hYmxlIGhhcHBlbnMKKyAgICovCisKKyAgIGlmICggdWNGbG93TWFzayA+IHVjT2xkRmxvd01hc2sgICkKKyAgIHsKKyAgICAgV0RBX0RTX1N0YXJ0WG1pdChwdm9zR0N0eCk7CisgICB9CisKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgRlVOQ1RJT04gICAgV0RBX0RTX0dldFR4Rmxvd01hc2sKKworICBERVNDUklQVElPTgorICAgIHJldHVybiBUWCBmbG93IG1hc2sgY29udHJvbCB2YWx1ZQorCisgIERFUEVOREVOQ0lFUworCisgIFBBUkFNRVRFUlMKKworICAgSU4KKyAgICBwdm9zR0N0eCAgICAgICAgIFZPUyBjb250ZXh0CisKKyAgIE9VVAorICAgIHVGbG93TWFzayAgICAgICAgVFggY2hhbm5lbCBtYXNrIGZvciBmbG93IGNvbnRyb2wKKyAgICAgICAgICAgICAgICAgICAgIERlZmluZWQgaW4gV0RBX1RYRmxvd0VudW1UeXBlCisKKyAgUkVUVVJOIFZBTFVFCisgICAgVk9TX1NUQVRVU19FX0lOVkFMOiAgcG9pbnRlciBpcyBOVUxMIGFuZCBvdGhlciBlcnJvcnMgCisgICAgVk9TX1NUQVRVU19TVU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0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1IgT1RIRVIKKyAqIFRPUlRJT1VTIEFDVElPTiwgQVJJU0lORyBPVVQgT0YgT1IgSU4gQ09OTkVDVElPTiBXSVRIIFRIRSBVU0UgT1IKKyAqIFBFUkZPUk1BTkNFIE9GIFRISVMgU09GVFdBUkUuCisgKi8KKworLyoKKyAqIFRoaXMgZmlsZSB3YXMgb3JpZ2luYWxseSBkaXN0cmlidXRlZCBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKworCisKKyNpZm5kZWYgV0xBTl9RQ1RfV0RJX0gKKyNkZWZpbmUgV0xBTl9RQ1RfV0RJX0gKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgVyBMIEEgTiAgIEQgRSBWIEkgQyBFICAgQSBCIFMgVCBSIEEgQyBUIEkgTyBOICAgTCBBIFkgRSBSIAorICAgICAgICAgICAgICAgICAgICAgICBFIFggVCBFIFIgTiBBIEwgIEEgUCBJCisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgCitERVNDUklQVElPTgorICBUaGlzIGZpbGUgY29udGFpbnMgdGhlIGV4dGVybmFsIEFQSSBleHBvc2VkIGJ5IHRoZSB3bGFuIHRyYW5zcG9ydCBsYXllciAKKyAgbW9kdWxlLgorICAKKyAgICAgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisgICRIZWFkZXI6JCAkRGF0ZVRpbWU6ICQgJEF1dGhvcjogJAorCisKK3doZW4gICAgICAgIHdobyAgICB3aGF0LCB3aGVyZSwgd2h5CistLS0tLS0tLSAgICAtLS0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorMTAvMDUvMTEgICAgaGFwICAgICBBZGRpbmcgc3VwcG9ydCBmb3IgS2VlcCBBbGl2ZQorMDgvMDQvMTAgICAgbHRpICAgICBDcmVhdGVkIG1vZHVsZS4KKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgSU5DTFVERSBGSUxFUyBGT1IgTU9EVUxFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICogSW5jbHVkZSBGaWxlcworICogLS0tLS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wZXIgbGltaXQgKi8KKworLyogUGVyaW9kaWMgVHggcGF0dGVybiBvZmZsb2FkIGZlYXR1cmUgKi8KKyNkZWZpbmUgUEVSSU9ESUNfVFhfUFRSTl9NQVhfU0laRSAxNTM2CisjZGVmaW5lIE1BWE5VTV9QRVJJT0RJQ19UWF9QVFJOUyA2CisjZGVmaW5lIFdESV9ESVNBX01BWF9QQVlMT0FEX1NJWkUgICAgICAgICAgICAgICAgMTYwMAorI2RlZmluZSBNQVhfTlVNX09GX0JVRkZFUiAzCisjZGVmaW5lIFZBTElEX0ZXX0xPR19UWVBFUyAgICAgIDIKKyNkZWZpbmUgTUFYX0xPR19CVUZGRVJfTEVOR1RIICAgICAgMTI4ICogMTAyNAorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICAgICBHRU5FUklDIFNUUlVDVFVSRVMgCisgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgV0RJIFZlcnNpb24gSW5mb3JtYXRpb24KKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCit0eXBlZGVmIHN0cnVjdAoreworICAgIHdwdF91aW50OCAgICAgICAgICAgICAgICAgIHJldmlzaW9uOworICAgIHdwdF91aW50OCAgICAgICAgICAgICAgICAgIHZlcnNpb247CisgICAgd3B0X3VpbnQ4ICAgICAgICAgICAgICAgICAgbWlub3I7CisgICAgd3B0X3VpbnQ4ICAgICAgICAgICAgICAgICAgbWFqb3I7Cit9IF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qLworICB3cHRfdWludDE2IHVzVG90YWxGcmFnbWVudDsKKworICAvKiBOViBmcmFnbWVudCBzaXplICovCisgIHdwdF91aW50MTYgdXNGcmFnbWVudFNpemU7CisKKyAgLyogY3VycmVudCBmcmFnbWVudCB0byBiZSBzZW50ICovCisgIHdwdF91aW50MTYgdXNDdXJyZW50RnJhZ21lbnQ7CisKK30gV0RJX052QmxvYkluZm9QYXJhbXM7CisKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgRGF0YSBwYXRoIGVudW1zIG1lbW9yeSBwb29sIHJlc291cmNlCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisKK3R5cGVkZWYgZW51bQoreworICAvKiBtYW5hZ21lbnQgcmVzb3VyY2UgcG9vbCBJRCAqLworICBXRElfTUdNVF9QT09MX0lEID0gMCwKKyAgLyogRGF0YSByZXNvdXJjZSBwb29sIElEICovCisgIFdESV9EQVRBX1BPT0xfSUQgPSAxCit9V0RJX1Jlc1Bvb2xUeXBlOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICAgICBHRU5FUklDIFNUUlVDVFVSRVMgLSBFTkQKKyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKiAgVHlwZSBEZWNsYXJhdGlvbnMKKyAqIC0tLS0tLS0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tb2R1bGVzLiovCisgIFdESV9TVEFFbnRyeVR5cGUgICAgICAgICAgd2RpU1RBVHlwZTsKKworICAvKlNUQSBJbmRleCAqLworICB3cHRfdWludDggICAgICAgICAgICAgICAgIHN0YUlkeDsKKworICAvKlNob3J0IFByZWFtYmxlIFN1cHBvcnRlZC4qLworICB3cHRfdWludDggICAgICAgICAgICAgICAgIHVjU2hvcnRQcmVhbWJsZVN1cHBvcnRlZDsKKworICAvKk1BQyBBZGRyZXNzIG9mIFNUQSovCisgIHdwdF9tYWNBZGRyICAgICAgICAgICAgICAgbWFjU1RBOworCisgIC8qTGlzdGVuIGludGVydmFsIG9mIHRoZSBTVEEqLworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgIHVzTGlzdGVuSW50ZXJ2YWw7CisKKyAgLypTdXBwb3J0IGZvciAxMWUvV01NKi8KKyAgd3B0X3VpbnQ4ICAgICAgICAgICAgICAgICB1Y1dNTUVuYWJsZWQ7CisKKyAgLyoxMW4gSFQgY2FwYWJsZSBTVEEqLworICB3cHRfdWludDggICAgICAgICAgICAgICAgIHVjSFRDYXBhYmxlOworCisgIC8qVFggV2lkdGggU2V0OiAwIC0gMjAgTUh6IG9ubHksIDEgLSAyMC80MCBNSHoqLworICB3cHRfdWludDggICAgICAgICAgICAgICAgIHVjVFhDaGFubmVsV2lkdGhTZXQ7CisKKyAgLypSSUZTIG1vZGUgMCAtIE5BLCAxIC0gQWxsb3dlZCovCisgIHdwdF91aW50OCAgICAgICAgICAgICAgICAgdWNSSUZTTW9kZTsKKworICAvKkwtU0lHIFRYT1AgUHJvdGVjdGlvbiBtZWNoYW5pc20KKyAgMCAtIE5vIFN1cHBvcnQsIDEgLSBTdXBwb3J0ZWQKKyAgICAgIFNHIC0gdGhlcmUgaXMgZ2xvYmFsIGZpZWxkKi8KKyAgd3B0X3VpbnQ4ICAgICAgICAgICAgICAgICB1Y0xTSUdUeG9wUHJvdGVjdGlvbjsKKworICAvKk1heCBBbXBkdSBTaXplIHN1cHBvcnRlZCBieSBTVEEuIERldmljZSBwcm9ncmFtbWluZy4KKyAgICAwIDogOGsgLCAxIDogMTZrLCAyIDogMzJrLCAzIDogNjRrICovCisgIHdwdF91aW50OCAgICAgICAgICAgICAgICAgdWNNYXhBbXBkdVNpemU7CisKKyAgLypNYXggQW1wZHUgZGVuc2l0eS4gVXNlZCBieSBSQS4gMyA6IDB+NyA6IDJeKDExbkFNUERVZGVuc2l0eSAtNCkqLworICB3cHRfdWludDggICAgICAgICAgICAgICAgIHVjTWF4QW1wZHVEZW5zaXR5OworCisgIC8qTWF4IEFNU0RVIHNpemUgMSA6IDM4MzkgYnl0ZXMsIDAgOiA3OTM1IGJ5dGVzKi8KKyAgd3B0X3VpbnQ4ICAgICAgICAgICAgICAgICB1Y01heEFtc2R1U2l6ZTsKKworICAvKlNob3J0IEdJIHN1cHBvcnQgZm9yIDQwTWh6IHBhY2tldHMqLworICB3cHRfdWludDggICAgICAgICAgICAgICAgIHVjU2hvcnRHSTQwTWh6OworCisgIC8qU2hvcnQgR0kgc3VwcG9ydCBmb3IgMjBNaHogcGFja2V0cyovCisgIHdwdF91aW50OCAgICAgICAgICAgICAgICAgdWNTaG9ydEdJMjBNaHo7CisKKyAgLypUaGVzZSByYXRlcyBhcmUgdGhlIGludGVyc2VjdGlvbiBvZiBwZWVyIGFuZCBzZWxmIGNhcGFiaWxpdGllcy4qLworICBXRElfU3VwcG9ydGVkUmF0ZXMgICAgICAgIHdkaVN1cHBvcnRlZFJhdGVzOworCisgIC8qUm9idXN0IE1hbmFnZW1lbnQgRnJhbWUgKFJNRikgZW5hYmxlZC9kaXNhYmxlZCovCisgIHdwdF91aW50OCAgICAgICAgICAgICAgICAgdWNSTUZFbmFibGVkOworCisgIC8qIFRoZSB1bmljYXN0IGVuY3J5cHRpb24gdHlwZSBpbiB0aGUgYXNzb2NpYXRpb24gKi8KKyAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICB1Y0VuY3J5cHRUeXBlOworCisgIC8qSEF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ICAgICAgICAgICAgICAgIHVuaWNhc3Q7ICAgICAKKyAgICAvKiBLZXkgRGlyZWN0aW9uICovCisgICAgV0RJX0tleURpcmVjdGlvblR5cGUgICAgICAga2V5RGlyZWN0aW9uOworICAgIC8qIFVzYWdlIGlzIHVua25vd24gKi8KKyAgICB3cHRfdWludDggICAgICAgICAgICAgICAgICBrZXlSc2NbV0RJX01BWF9LRVlfUlNDX0xFTl07ICAgCisgICAgLyogPTEgZm9yIGF1dGhlbnRpY2F0b3IsID0wIGZvciBzdXBwbGljYW50ICovCisgICAgd3B0X3VpbnQ4ICAgICAgICAgICAgICAgICAgcGFlUm9sZTsgICAgIAorICAgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgIGtleUxlbmd0aDsKKyAgICB3cHRfdWludDggICAgICAgICAgICAgICAgICBrZXlbV0RJX01BWF9LRVlfTEVOR1RIXTsKKworfVdESV9LZXlzVHlwZTsKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgV0RJX1NldEJTU0tleVJlcUluZm9UeXBlCistLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgIC8qQlNTIEluZGV4IG9mIHRoZSBCU1MqLworICB3cHRfdWludDggICAgICB1Y0Jzc0lkeDsgCisKKyAgLypFbmNyeXB0aW9uIFR5cGUgdXNlZCB3aXRoIHBlZXIqLworICBXRElfRW5jcnlwdFR5cGUgIHdkaUVuY1R5cGU7CisKKyAgLypOdW1iZXIgb2Yga2V5cyovCisgIHdwdF91aW50OCAgICAgICAgdWNOdW1LZXlzOworCisgIC8qQXJyYXkgb2Yga2V5cy4qLworICBXRElfS2V5c1R5cGUgICAgIGFLZXlzW1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UluZm9UeXBlCistLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgLypQZWVyIEJTU0lEKi8KKyAgd3B0X21hY0FkZHIgICAgICAgICAgICAgIG1hY0JTU0lEOworCisgIC8qU2VsZiBNQUMgQWRkcmVzcyovCisgIHdwdF9tYWNBZGRyICAgICAgICAgICAgICBtYWNTZWxmQWRkcjsgCisKKyAgLypCU1MgVHlwZSovCisgIFdESV9Cc3NUeXBlICAgICAgICAgICAgICB3ZGlCU1NUeXBlOworCisgIC8qT3BlcmF0aW9uYWwgTW9kZTogQVAgPTAsIFNUQSA9IDEqLworICB3cHRfdWludDggICAgICAgICAgICAgICAgdWNPcGVyTW9kZTsKKworICAvKk5ldHdvcmsgVHlwZSovCisgIFdESV9Od1R5cGUgICAgICAgICAgICAgICB3ZGlOV1R5cGU7CisKKyAgLypVc2VkIHRvIGNsYXNzaWZ5IFBVUkVfMTFHLzExR19NSVhFRCB0byBwcm9ncmFtIE1UVSovCisgIHdwdF91aW50OCAgICAgICAgICAgICAgICB1Y1Nob3J0U2xvdFRpbWVTdXBwb3J0ZWQ7CisKKyAgLypDby1leGlzdCB3aXRoIDExYSBTVEEqLworICB3cHRfdWludDggICAgICAgICAgICAgICAgdWNsbGFDb2V4aXN0OworCisgIC8qQ28tZXhpc3Qgd2l0aCAxMWIgU1RBKi8KKyAgd3B0X3VpbnQ4ICAgICAgICAgICAgICAgIHVjbGxiQ29leGlzdDsKKworICAvKkNvLWV4aXN0IHdpdGggMTFnIFNUQSovCisgIHdwdF91aW50OCAgICAgICAgICAgICAgICB1Y2xsZ0NvZXhpc3Q7CisKKyAgLypDb2V4aXN0ZW5jZSB3aXRoIDExbiBTVEEqLworICB3cHRfdWludDggICAgICAgICAgICAgICAgdWNIVDIwQ29leGlzdDsKKworICAvKk5vbiBHRiBjb2V4aXN0IGZsYWcqLworICB3cHRfdWludDggICAgICAgICAgICAgICAgdWNsbG5Ob25HRkNvZXhpc3Q7CisKKyAgLypUWE9QIHByb3RlY3Rpb24gc3VwcG9ydCovCisgIHdwdF91aW50OCAgICAgICAgICAgICAgICB1Y1RYT1BQcm90ZWN0aW9uRnVsbFN1cHBvcnQ7CisKKyAgLypSSUZTIG1vZGUqLworICB3cHRfdWludDggICAgICAgICAgICAgICAgdWNSSUZTTW9kZTsKKworICAvKkJlYWNvbiBJbnRlcnZhbCBpbiBUVSovCisgIHdwdF91aW50MTYgICAgICAgICAgICAgICB1c0JlYWNvbkludGVydmFsOworCisgIC8qRFRJTSBwZXJpb2QqLworICB3cHRfdWludDggICAgICAgICAgICAgICAgdWNEVElNUGVyaW9kOworCisgIC8qVFggV2lkdGggU2V0OiAwIC0gMjAgTUh6IG9ubHksIDEgLSAyMC80MCBNSHoqLworICB3cHRfdWludDggICAgICAgICAgICAgICAgdWNUWENoYW5uZWxXaWR0aFNldDsKKworICAvKk9wZXJhdGluZyBjaGFubmVsKi8KKyAgd3B0X3VpbnQ4ICAgICAgICAgICAgICAgIHVjQ3VycmVudE9wZXJDaGFubmVsOworCisgIC8qRXh0ZW5zaW9uIGNoYW5uZWwgZm9yIGNoYW5uZWwgYm9uZGluZyovCisgIHdwdF91aW50OCAgICAgICAgICAgICAgICB1Y0N1cnJlbnRFeHRDaGFubmVsOworCisgIC8qQ29udGV4dCBvZiB0aGUgc3RhdGlvbiBiZWluZyBhZGRlZCBpbiBIVy4qLworICBXRElfQ29uZmlnU3RhUmVxSW5mb1R5cGUgd2RpU1RBQ29udGV4dDsKKworICAvKlNTSUQgb2YgdGhlIEJTUyovCisgIFdESV9NYWNTU2lkICAgICAgICAgICAgICB3ZGlTU0lEOworCisgIC8qSEFMIHNob3VsZCB1cGRhdGUgdGhlIGV4aXN0aW5nIEJTUyBlbnRyeSwgaWYgdGhpcyBmbGFnIGlzIHNldC4gVU1BQyB3aW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ydmFsOworICAgIHdwdF91aW50MzIgICAgICAgICAgICB1U3ZjU3RhcnRUaW1lOworICAgIHdwdF91aW50MzIgICAgICAgICAgICB1TWluRGF0YVJhdGU7CisgICAgd3B0X3VpbnQzMiAgICAgICAgICAgIHVNZWFuRGF0YVJhdGU7CisgICAgd3B0X3VpbnQzMiAgICAgICAgICAgIHVQZWFrRGF0YVJhdGU7CisgICAgd3B0X3VpbnQzMiAgICAgICAgICAgIHVNYXhCdXJzdFN6OworICAgIHdwdF91aW50MzIgICAgICAgICAgICB1RGVsYXlCb3VuZDsKKyAgICB3cHRfdWludDMyICAgICAgICAgICAgdU1pblBoeVJhdGU7CisgICAgd3B0X3VpbnQxNiAgICAgICAgICAgIHVzU3VycGx1c0J3OworICAgIHdwdF91aW50MTYgICAgICAgICAgICB1c01lZGl1bVRpbWU7Cit9V0RJX1RzcGVjSUVUeXBlOworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBXRElfQWRkVFNSZXFJbmZvVHlwZQorLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KK3R5cGVkZWYgc3RydWN0Cit7CisgIC8qU1RBIEluZGV4Ki8KKyAgd3B0X3VpbnQ4ICAgICAgICAgdWNTVEFJZHg7IAorCisgIC8qSWRlbnRpZmllciBmb3IgVFNwZWMqLworICB3cHRfdWludDE2ICAgICAgICB1Y1RzcGVjSWR4OworCisgIC8qVHNwZWMgSUUgbmVnb3RpYXRlZCBPVEEqLworICBXRElfVHNwZWNJRVR5cGUgICB3ZGlUc3BlY0lFOworCisgIC8qVUFQU0QgZGVsaXZlcnkgYW5kIHRyaWdnZXIgZW5hYmxlZCBmbGFncyAqLworICB3cHRfdWludDggICAgICAgICB1Y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TktfQlRBTVBfUE9TVEFTU09DX1NUQVRFICAgPSA2LAorICAgIFdESV9MSU5LX0JUQU1QX0FQX1NUQVRFICAgICAgICAgID0gNywKKyAgICBXRElfTElOS19CVEFNUF9TVEFfU1RBVEUgICAgICAgICA9IDgsCisgICAgCisgICAgLy8gUmVzZXJ2ZWQgZm9yIEhBTCBpbnRlcm5hbCB1c2UKKyAgICBXRElfTElOS19MRUFSTl9TVEFURSAgICAgICAgICAgICA9IDksCisgICAgV0RJX0xJTktfU0NBTl9TVEFURSAgICAgICAgICAgICAgPSAxMCwKKyAgICBXRElfTElOS19GSU5JU0hfU0NBTl9TVEFURSAgICAgICA9IDExLAorICAgIFdESV9MSU5LX0lOSVRfQ0FMX1NUQVRFICAgICAgICAgID0gMTIsCisgICAgV0RJX0xJTktfRklOSVNIX0NBTF9TVEFURSAgICAgICAgPSAxMywKKyAgICBXRElfTElOS19MSVNURU5fU1RBVEUgICAgICAgICAgICA9IDE0LAorICAgIFdESV9MSU5LX1NFTkRfQUNUSU9OX1NUQVRFICAgICAgID0gMTUsCisgICAgV0RJX0xJTktfTUFYICAgICAgICAgICAgICAgICAgICAgPSAweDdGRkZGRkZGCit9IFdESV9MaW5rU3RhdGVUeXBlOworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBXRElfU2V0TGlua1JlcUluZm9UeXBlCistLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgLypCU1NJRCBvZiB0aGUgQlNTKi8KKyAgd3B0X21hY0FkZHIgICAgICAgICAgIG1hY0JTU0lEOworCisgIC8qTGluayBzdGF0ZSovCisgIFdESV9MaW5rU3RhdGVUeXBlICAgICB3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gY21wRmxhZzsKKy8qIExlbmd0aCBvZiB0aGUgZGF0YSB0byBjb21wYXJlICovCisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YUxlbmd0aDsgCisvKiBmcm9tIHN0YXJ0IG9mIHRoZSByZXNwZWN0aXZlIGZyYW1lIGhlYWRlciAqLyAgCisgIHdwdF91aW50OCAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YU9mZnNldDsgCisgIHdwdF91aW50OCAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzZXJ2ZWQ7IC8qIFJlc2VydmVkIGZpZWxkICovCisvKiBEYXRhIHRvIGNvbXBhcmUgKi8KKyAgd3B0X3VpbnQ4ICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wYXJlRGF0YVtXRElfTUFYX0ZJTFRFUl9URVNUX0RBVEFfTEVOXTsgIAorLyogTWFzayB0byBiZSBhcHBsaWVkIG9uIHRoZSByZWNlaXZlZCBwYWNrZXQgZGF0YSBiZWZvcmUgY29tcGFyZSAqLworICB3cHRfdWludDggICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFNYXNrW1dESV9NQVhfRklMVEVSX1RFU1RfREFUQV9MRU5dOyAgIAorfVdESV9SY3ZQa3RGaWx0ZXJGaWVsZFBhcmFtczsKKwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgd3B0X3VpbnQ4ICAgICAgICAgICAgICAgICAgICAgICBmaWx0ZXJJZDsgCisgIHdwdF91aW50OCAgICAgICAgICAgICAgICAgICAgICAgZmlsdGVyVHlwZTsKKyAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICAgICBudW1GaWVsZFBhcmFtczsKKyAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICAgICBjb2FsZXNjZVRpbWU7CisgIHdwdF9tYWNBZGRyICAgICAgICAgICAgICAgICAgICAgc2VsZk1hY0FkZHI7CisgIHdwdF9tYWNBZGRyICAgICAgICAgICAgICAgICAgICAgYnNzSWQ7C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RJX1dJRklfQkFORF9CRyAgICAgICAgICAgICA9IDEsICAgIC8vIDIuNCBHSHoKKyAgICBXRElfV0lGSV9CQU5EX0EgICAgICAgICAgICAgID0gMiwgICAgLy8gNSBHSHogd2l0aG91dCBERlMKKyAgICBXRElfV0lGSV9CQU5EX0FCRyAgICAgICAgICAgID0gMywgICAgLy8gMi40IEdIeiArIDUgR0h6OyBubyBERlMKKyAgICBXRElfV0lGSV9CQU5EX0FfREZTICAgICAgICAgID0gNCwgICAgLy8gNSBHSHogREZTIG9ubHkKKyAgICBXRElfV0lGSV9CQU5EX0FfV0lUSF9ERlMgICAgID0gNiwgICAgLy8gNSBHSHogd2l0aCBERlMKKyAgICBXRElfV0lGSV9CQU5EX0FCR19XSVRIX0RGUyAgID0gNywgICAgLy8gMi40IEdIeiArIDUgR0h6IHdpdGggREZTCisKKyAgICAvKiBLZWVwIGl0IGxhc3QgKi8KKyAgICBXRElfV0lGSV9CQU5EX01BWAorfSBXRElfV2lmaUJhbmQ7CisKK3R5cGVkZWYgc3RydWN0Cit7CisgICAgd3B0X3VpbnQzMiAgICAgIGNoYW5uZWw7ICAgICAgICAvLyBmcmVxdWVuY3kKKyAgICB3cHRfdWludDMyICAgICAgZHdlbGxUaW1lTXM7ICAgIC8vIGR3ZWxsIHRpbWUgaGludAorICAgIHdwdF91aW50OCAgICAgICBwYXNzaXZlOyAgICAgICAgLy8gMCA9PiBhY3RpdmUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gMSA9PiBwYXNzaXZlIHNjYW47IGlnbm9yZWQgZm9yIERGUworICAgIHdwdF91aW50OCAgICAgICBjaG5sQ2xhc3M7Cit9IFdESV9XaWZpU2NhbkNoYW5uZWxTcGVjOworCit0eXBlZGVmIHN0cnVjdAoreworICAgIHdwdF91aW50OCAgICAgICBidWNrZXQ7ICAvLyBidWNrZXQgaW5kZXgsIDAgYmFzZWQKKyAgICBXRElfV2lmaUJhbmQgICAgIGJhbmQ7ICAgIC8vIHdoZW4gVU5TUEVDSUZJRUQsIHVzZSBjaGFubmVsIGxpc3QKKworICAgIC8qCisgICAgICogZGVzaXJlZCBwZXJpb2QsIGluIG1pbGxpc2Vjb25kOyBpZiB0aGlzIGlzIHRvbworICAgICAqIGxvdywgdGhlIGZpcm13YXJlIHNob3VsZCBjaG9vc2UgdG8gZ2VuZXJhdGUgcmVzdWx0cyBhcyBmYXN0IGFzCisgICAgICogaXQgY2FuIGluc3RlYWQgb2YgZmFpbGluZyB0aGUgY29tbWFuZCBieXRlCisgICAgICovCisgICAgd3B0X3VpbnQzMiAgICAgIHBlcmlvZDsKKworICAgIC8qCisgICAgICogMCA9PiBub3JtYWwgcmVwb3J0aW5nIChyZXBvcnRpbmcgcnNzaSBoaXN0b3J5CisgICAgICogb25seSwgd2hlbiByc3NpIGhpc3RvcnkgYnVmZmVyIGlzICUgZnVsbCkKKyAgICAgKiAxID0+IHNhbWUgYXMgMCArIHJlcG9ydCBhIHNjYW4gY29tcGxldGlvbiBldmVudCBhZnRlciBzY2FubmluZworICAgICAqIHRoaXMgYnVja2V0CisgICAgICogMiA9PiBzYW1lIGFzIDEgKyBmb3J3YXJkIHNjYW4gcmVzdWx0cyAoYmVhY29ucy9wcm9iZSByZXNwb25zZXMgKyBJRXMpCisgICAgICogaW4gcmVhbCB0aW1lIHRvIEhBTAorICAgICAqLworICAgIHdwdF91aW50OCAgICAgIHJlcG9ydEV2ZW50czsKKworICAgIHdwdF91aW50OCAgICAgIG51bUNoYW5uZWxzOworCisgICAgLyoKKyAgICAgKiBjaGFubmVscyB0byBzY2FuOyB0aGVzZSBtYXkgaW5jbHVkZSBERlMgY2hhbm5lbHMKKyAgICAgKi8KKyAgICBXRElfV2lmaVNjYW5DaGFubmVsU3BlYyBjaGFubmVsc1tXRElfV0xBTl9FWFRTQ0FOX01BWF9DSEFOTkVMU107Cit9IFdESV9XaWZpU2NhbkJ1Y2tldFNwZWM7CisKK3R5cGVkZWYgc3RydWN0Cit7CisgICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICByZXF1ZXN0SWQ7CisgICAgd3B0X3VpbnQ4ICAgICAgICAgICAgICAgICBzZXNzaW9uSWQ7CisgICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICBiYXNlUGVyaW9kOyAgIC8vIGJhc2UgdGltZXIgcGVyaW9kCisgICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICBtYXhBUHBlclNjYW47CisKKyAgICAvKiBpbiAlLCB3aGVuIGJ1ZmZlciBpcyB0aGlzIG11Y2ggZnVsbCwgd2FrZSB1cCBob3N0ICovCisgICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICByZXBvcnRUaHJlc2hvbGQ7CisKKyAgICB3cHRfdWludDggICAgICAgICAgICAgICAgbnVtQnVja2V0czsKKyAgICBXRElfV2lmaVNjYW5CdWNrZXRTcGVjICBidWNrZXRzW1dESV9XTEFOX0VYVFNDQU5fTUFYX0JVQ0tFVFNdOworfSBXRElfRVhUU2NhblN0YXJ0UmVxUGFyYW1zOworCit0eXBlZGVmIHN0cnVjdAoreworICAgIHdwdF91aW50MzIgICAgICByZXF1ZXN0SWQ7CisgICAgd3B0X3VpbnQ4ICAgICAgIHNlc3Npb25JZDsKK30gV0RJX0VYVFNjYW5TdG9wUmVxUGFyYW1zOworCit0eXBlZGVmIHN0cnVjdAoreworICAgIHdwdF91aW50MzIgICAgICByZXF1ZXN0SWQ7CisgICAgd3B0X3VpbnQ4ICAgICAgIHNlc3Npb25JZDsKKworICAgIC8qCisgICAgICogMSByZXR1cm4gY2FjaGVkIHJlc3VsdHMgYW5kIGZsdXNoIGl0CisgICAgICogMCByZXR1cm4gY2FjaGVkIHJlc3VsdHMgYW5kIGRvIG5vdCBmbHVzaAorICAgICAqLworICAgIHdwdF9ib29sZWFuICBmbHVzaDsKK30gV0RJX0VYVFNjYW5HZXRDYWNoZWRSZXN1bHRzUmVxUGFyYW1zOworCit0eXBlZGVmIHN0cnVjdAoreworICAgIHdwdF91aW50M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SBtYXhpbXVtIG9mIGFuIGludCBmb3IgZW51bQorI2RlZmluZSBTSVJfTUFYX0VOVU1fU0laRSAgICAweDdGRkZGRkZGCisvLyBFbnVtIHRvIHNwZWNpZnkgd2hldGhlciBrZXkgaXMgdXNlZAorLy8gZm9yIFRYIG9ubHksIFJYIG9ubHkgb3IgYm90aAordHlwZWRlZiBlbnVtCit7CisgICAgZVdESV9UWF9PTkxZLAorICAgIGVXRElfUlhfT05MWSwKKyAgICBlV0RJX1RYX1JYLAorICAgIGVXRElfVFhfREVGQVVMVCwKKyAgICBlV0RJX0RPTk9UX1VTRV9LRVlfRElSRUNUSU9OID0gU0lSX01BWF9FTlVNX1NJWkUKK30gdFdESUtleURpcmVjdGlvbjsKKworLy8gTUFYIGtleSBsZW5ndGggd2hlbiBVTEEgaXMgdXNlZAorI2RlZmluZSBTSVJfTUFDX01BWF9LRVlfTEVOR1RIICAgICAgICAgICAgICAgMzIKKy8qIE1heCBrZXkgc2l6ZSAgaW5jbHVkaW5nIHRoZSBXQVBJIGFuZCBUS0lQICovCisjZGVmaW5lIFdMQU5fTUFYX0tFWV9SU0NfTEVOICAgICAgICAgMTYKKy8vIERlZmluaXRpb24gZm9yIEVuY3J5cHRpb24gS2V5cworLy90eXBlZGVmIHN0cnVjdCBzU2lyS2V5cwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgICB3cHRfdWludDggICAgICAgICAgICAgICAgICBrZXlJZDsKKyAgICB3cHRfdWludDggICAgICAgICAgICAgICAgICB1bmljYXN0OyAgICAgLy8gMCBmb3IgbXVsdGljYXN0CisgICAgdFdESUtleURpcmVjdGlvbiAgICBrZXlEaXJlY3Rpb247CisgICAgd3B0X3VpbnQ4ICAgICAgICAgICAgICAgICAga2V5UnNjW1dMQU5fTUFYX0tFWV9SU0NfTEVOXTsgICAvLyBVc2FnZSBpcyB1bmtub3duCisgICAgd3B0X3VpbnQ4ICAgICAgICAgICAgICAgICAgcGFlUm9sZTsgICAgIC8vID0xIGZvciBhdXRoZW50aWNhdG9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vID0wIGZvciBzdXBwbGljYW50CisgICAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgICAga2V5TGVuZ3RoOworICAgIHdwdF91aW50OCAgICAgICAgICAgICAgICAgIGtleVtTSVJfTUFDX01BWF9LRVlfTEVOR1RIXTsKK30gdFdESUtleXMsICp0cFdESUtleXM7CisKK3R5cGVkZWYgZW51bQoreworICAgIGVXRElfV0VQX1NUQVRJQywKKyAgICBlV0RJX1dFUF9EWU5BTUlDLAorfSB0V0RJV2VwVHlwZTsKKworLy8gRW5jcnlwdGlvbiB0eXBlIGVudW0gdXNlZCB3aXRoIHBlZXIKK3R5cGVkZWYgZW51bQoreworICAgIGVXRElfRURfTk9ORSwKKyAgICBlV0RJX0VEX1dFUDQwLAorICAgIGVXRElfRURfV0VQMTA0LAorICAgIGVXRElfRURfVEtJUCwKKyAgICBlV0RJX0VEX0NDTVAsCisjaWYgZGVmaW5lZChGRUFUVVJFX1dMQU5fV0FQSSkKKyAgICBlV0RJX0VEX1dQSSwKKyNlbmRpZgorICAgIC8qIERQVSBIVyB0cmVhdHMgZW5jcnlwdGlvbiBtb2RlIDQgcGx1cyBSTUYgYml0IHNldCBpbiBUWCBCRCBhcyBCSVAuCisgICAgICogVGh1cyB3aGlsZSBzZXR0aW5nIEJJUCBlbmNyeXB0aW9uIG1vZGUgaW4gY29ycmVzcG9uZGluZyBEUFUgRGVzYworICAgICAqIGVTSVJfRURfQUVTXzEyOF9DTUFDIHNob3VsZCBiZSBzZXQgdG8gZVNJUl9FRF9DQ01QCisgICAgICovCisgICAgZVdESV9FRF9BRVNfMTI4X0NNQUMsCisgICAgZVdESV9FRF9OT1RfSU1QTEVNRU5URUQgPSBTSVJfTUFYX0VOVU1fU0laRQorfSB0V0RJRWRUeXBlOworI2RlZmluZSBTSVJfV0RJX01BWF9OVU1fT0ZfREVGQVVMVF9LRVlTICAgICAgNAorL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ZSAqcFJzcCk7CisKKyNlbmRpZgorCit0eXBlZGVmIHZvaWQgKCpXRElfR2V0QmNuTWlzc1JhdGVDYikod3B0X3VpbnQ4IHN0YXR1cywgd3B0X3VpbnQzMiBiY25NaXNzUmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkKiBwVXNlckRhdGEpOworCisjaWZkZWYgV0xBTl9GRUFUVVJFX0VYVFNDQU4KK3R5cGVkZWYgdm9pZCAgKCpXRElfRVhUU2NhblN0YXJ0UnNwQ2IpKHZvaWQgKnBFdmVudERhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpwVXNlckRhdGEpOwordHlwZWRlZiB2b2lkICAoKldESV9FWFRTY2FuU3RvcFJzcENiKSh2b2lkICpwRXZlbnREYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqcFVzZXJEYXRhKTsKK3R5cGVkZWYgdm9pZCAgKCpXRElfRVhUU2NhbkdldENhY2hlZFJlc3VsdHNSc3BDYikodm9pZCAqcEV2ZW50RGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnBVc2VyRGF0YSk7Cit0eXBlZGVmIHZvaWQgICgqV0RJX0VYVFNjYW5HZXRDYXBhYmlsaXRpZXNSc3BDYikodm9pZCAqcEV2ZW50RGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnBVc2VyRGF0YSk7Cit0eXBlZGVmIHZvaWQgICgqV0RJX0VYVFNjYW5TZXRCU1NJREhvdGxpc3RSc3BDYikodm9pZCAqcEV2ZW50RGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnBVc2VyRGF0YSk7Cit0eXBlZGVmIHZvaWQgICgqV0RJX0VYVFNjYW5SZXNldEJTU0lESG90bGlzdFJzcENiKSh2b2lkICpwRXZlbnREYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqcFVzZXJEYXRhKTsKK3R5cGVkZWYgdm9pZCAgKCpXRElfRVhUU2NhblNldFNpZ25mUlNTSUNoYW5nZVJzcENiKSh2b2lkICpwRXZlbnREYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqcFVzZXJEYXRhKTsKK3R5cGVkZWYgdm9pZCAgKCpXRElfRVhUU2NhblJlc2V0U2lnbmZSU1NJQ2hhbmdlUnNwQ2IpKHZvaWQgKnBFdmVudERhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpwVXNlckRhdGEpOworI2VuZGlmIC8qIFdMQU5fRkVBVFVSRV9FWFRTQ0FOICovCisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfTElOS19MQVlFUl9TVEFUUwordHlwZWRlZiB2b2lkICAoKldESV9MTFN0YXRzU2V0UnNwQ2IpKHZvaWQgKnBFdmVudERhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpwVXNlckRhdGEpOwordHlwZWRlZiB2b2lkICAoKldESV9MTFN0YXRzR2V0UnNwQ2IpKHZvaWQgKnBFdmVudERhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpwVXNlckRhdGEpOwordHlwZWRlZiB2b2lkICAoKldESV9MTFN0YXRzQ2xlYXJSc3BDYikodm9pZCAqcEV2ZW50RGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnBVc2VyRGF0YSk7CisjZW5kaWYgLyogV0xBTl9GRUFUVVJFX0xJTktfTEFZRVJfU1RBVFMgKi8KKwordHlwZWRlZiB2b2lkICAoKldESV9TZXRTcG9vZk1hY0FkZHJSc3BDYikoCisgICAgICAgICAgICAgICAgICAgICAgICBXRElfU3Bvb2ZNYWNBZGRyUnNwUGFyYW1UeXBlKiB3ZGlSc3AsIHZvaWQgKnBVc2VyRGF0YSk7CisKK3R5cGVkZWYgdm9pZCAgKCpXRElfRldTdGF0c0dldFJzcENiKShXRElfU3RhdHVzIHN0YXR1cyx2b2lkICpmd1N0YXRzUmVzcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqcFVzZXJEYXRhKTsKKwordHlwZWRlZiB2b2lkICAoKldESV9FbmNyeXB0TXNnUnNwQ2IpKHdwdF91aW50OCBzdGF0dXMsIHZvaWQgKnBFdmVudERhdGEsIHZvaWQqIHBVc2VyRGF0YSk7Cit0eXBlZGVmIHZvaWQgICgqV0RJX0ZXTG9nZ2luZ0luaXRSc3BDYikoCisgICAgICAgICAgICAgICAgICAgICAgICBXRElfRldMb2dnaW5nSW5pdFJzcFBhcmFtVHlwZSAqd2RpUnNwLCB2b2lkICpwVXNlckRhdGEpOwordHlwZWRlZiB2b2lkICAoKldESV9HZXRGcmFtZUxvZ1JzcENiKSgKKyAgICAgICAgICAgICAgICAgICAgICAgIFdESV9HZXRGcmFtZUxvZ1JzcFBhcmFtVHlwZSAqd2RpUnNwLCB2b2lkICpwVXNlckRhdGEpOwordHlwZWRlZiB2b2lkICAoKldESV9GYXRhbEV2ZW50TG9nc1JzcENiKSgKKyAgICAgICAgICAgICAgICAgICAgICAgICBXRElfRmF0YWxFdmVudExvZ3NSc3BQYXJhbVR5cGUgKndkaVJzcCwgdm9pZCAqcFVzZXJEYXRhKTsKKwordHlwZWRlZiB2b2lkICAoKldESV9Nb25Nb2RlUnNwQ2IpKHZvaWQgKnBFdmVudERhdGEsdm9pZCAqcFVzZXJEYXRhKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICAgICBGdW5jdGlvbiBEZWNsYXJhdGlvbnMgYW5kIERvY3VtZW50YXRpb24KKyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09IAorIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJTklUSUFMSVpBVElPTiBBUElzCisgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qKgorIEBicmllZiBXRElfSW5pdCBpcyB1c2VkIHRvIGluaXRpYWxpemUgdGhlIERBTC4KKyAKKyBEQUwgd2lsbCBhbGxvY2F0ZSBhbGwgdGhlIHJlc291cmNlcyBpdCBuZWVkcy4gSXQgd2lsbCBvcGVuIFBBTCwgaXQgd2lsbCBhbHNvCisgb3BlbiBib3RoIHRoZSBkYXRhIGFuZCB0aGUgY29udHJvbCB0cmFuc3BvcnQgd2hpY2ggaW4gdGhlaXIgdHVybiB3aWxsIG9wZW4KKyBEWEUvU01EIG9yIGFueSBvdGhlciBkcml2ZXJzIHRoYXQgdGhleSBuZWVkLiAKKyAKKyBAcGFyYW0gZGV2SGFuZGxlOiBwb2ludGVyIHRvIHRoZSBPUyBzcGVjaWZpYyBkZXZpY2UgaGFuZGxlCisgICAgICAgIHBwV0RJR2xvYmFsQ3R4OiBvdXRwdXQgcG9pbnRlciBvZiBHbG9iYWwgQ29udGV4dAorICAgICAgICBwV2RpRGV2Q2FwYWJpbGl0eTogb3V0cHV0IHBvaW50ZXIgb2YgZGV2aWNlIGNhcGFiaWxpdHkKKworIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cyAKK1dESV9Jbml0CisoIAorICB2b2lkKiAgICAgICAgICAgICAgICAgICAgICBkZXZIYW5kbGUsCisgIHZvaWQqKiAgICAgICAg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QHNlZSBXRElfU3RvcAorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cyAKK1dESV9DbG9zZQorKAorICB2b2lkCispOworCisKKy8qKgorIEBicmllZiAgV0RJX1NodXRkb3duIHdpbGwgYmUgY2FsbGVkIGR1cmluZyAnU1NSIHNodXRkb3duJyBvcGVyYXRpb24uCisgICAgICAgICBUaGlzIHdpbGwgZG8gbW9zdCBvZiB0aGUgV0RJIHN0b3AgJiBjbG9zZQorICAgICAgICAgb3BlcmF0aW9ucyB3aXRob3V0IGRvaW5nIGFueSBoYW5kc2hha2Ugd2l0aCBSaXZhCisKKyAgICAgICAgIFRoaXMgd2lsbCBhbHNvIG1ha2Ugc3VyZSB0aGF0IHRoZSBjb250cm9sIHRyYW5zcG9ydAorICAgICAgICAgd2lsbCBOT1QgYmUgY2xvc2VkLgorCisgICAgICAgICBUaGlzIHJlcXVlc3Qgd2lsbCBub3QgYmUgcXVldWVkLgorCisKKyBXRElfU3RhcnQgbXVzdCBoYXZlIGJlZW4gY2FsbGVkLgorCisgQHBhcmFtICBjbG9zZVRyYW5zcG9ydDogIENsb3NlIGNvbnRyb2wgY2hhbm5lbCBpZiB0aGlzIGlzIHNldAorCisgQHJldHVybiBSZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGwKKyovCitXRElfU3RhdHVzCitXRElfU2h1dGRvd24KKygKKyB3cHRfYm9vbGVhbiBjbG9zZVRyYW5zcG9ydAorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gCisgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNDQU4gQVBJcworIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKioKKyBAYnJpZWYgV0RJX0luaXRTY2FuUmVx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XBlKiBwd2RpRmluaXNoU2NhblBhcmFtcywKKyAgV0RJX0ZpbmlzaFNjYW5Sc3BDYiAgICAgICAgICB3ZGlGaW5pc2hTY2FuUnNwQ2IsCisgIHZvaWQqICAgICAgICAgICAgICAgICAgICAgICAgcFVzZXJEYXRhCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAKKyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgQVNTT0NJQVRJT04gQVBJcworIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKioKKyBAYnJpZWYgV0RJX0pvaW5SZXEgd2lsbCBiZSBjYWxsZWQgd2hlbiB0aGUgdXBwZXIgTUFDIGlzIHJlYWR5IAorICAgICAgICB0byBzdGFydCBhbiBhc3NvY2lhdGlvbiBwcm9jZWR1cmUgdG8gYSBCU1MuIFVwb24gdGhlCisgICAgICAgIGNhbGwgb2YgdGhpcyBBUEkgdGhlIFdMQU4gREFMIHdpbGwgcGFjayBhbmQgc2VuZCBhIEhBTAorICAgICAgICBKb2luIHJlcXVlc3QgbWVzc2FnZSB0byB0aGUgbG93ZXIgUklWQSBzdWItc3lzdGVtIGlmCisgICAgICAgIERBTCBpcyBpbiBzdGF0ZSBTVEFSVEVELgorCisgICAgICAgIEluIHN0YXRlIEJVU1kgdGhpcyByZXF1ZXN0IHdpbGwgYmUgcXVldWVkLiBSZXF1ZXN0IHdvbid0CisgICAgICAgIGJlIGFsbG93ZWQgaW4gYW55IG90aGVyIHN0YXRlLiAKKworIFdESV9TdGFydCBtdXN0IGhhdmUgYmVlbiBjYWxsZWQuCisKKyBAcGFyYW0gd2RpSm9pblBhcmFtczogdGhlIGpvaW4gcGFyYW1ldGVycyBhcyBzcGVjaWZpZWQgYnkgCisgICAgICAgICAgICAgICAgICAgICAgdGhlIERldmljZSBJ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c3QgaGF2ZSBiZWVuIGNhbGxlZC4KKworIEBwYXJhbSB3ZGlEZWxTVEFQYXJhbXM6IHRoZSBEZWwgU1RBIHBhcmFtZXRlcnMgYXMgc3BlY2lmaWVkIGJ5IAorICAgICAgICAgICAgICAgICAgICAgIHRoZSBEZXZpY2UgSW50ZXJmYWNlCisgIAorICAgICAgICB3ZGlEZWxTVEFSc3BDYjogY2FsbGJhY2sgZm9yIHBhc3NpbmcgYmFjayB0aGUgcmVzcG9uc2UKKyAgICAgICAgb2YgdGhlIGRlbCBTVEEgb3BlcmF0aW9uIHJlY2VpdmVkIGZyb20gdGhlIGRldmljZQorICAKKyAgICAgICAgcFVzZXJEYXRhOiB1c2VyIGRhdGEgd2lsbCBiZSBwYXNzZWQgYmFjayB3aXRoIHRoZQorICAgICAgICBjYWxsYmFjayAKKyAgCisgQHNlZSBXRElfUG9zdEFzc29jUmVxCisgQHJldHVybiBSZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGwKKyovCitXRElfU3RhdHVzIAorV0RJX0RlbFNUQVJlcQorKAorICBXRElfRGVsU1RBUmVxUGFyYW1zVHlwZSogcHdkaURlbFNUQVBhcmFtcywKKyAgV0RJX0RlbFNUQVJzcENiICAgICAgICAgIHdkaURlbFNUQVJzcENiLAorICB2b2lkKiAgICAgICAgICAgICAgICAgICAgcFVzZXJEYXRhCispOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAKKyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0VDVVJJVFkgQVBJcworIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKioKKyBAYnJpZWYgV0RJX1NldEJTU0tleVJlcSB3aWxsIGJlIGNhbGxlZCB3aGVuIHRoZSB1cHBlciBNQUMgaXRvIAorICAgICAgICBpbnN0YW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b2YgdGhlIGZ1bmN0aW9uIGNhbGwKKyovCitXRElfU3RhdHVzIAorV0RJX1RTTVN0YXRzUmVxCisoCisgIFdESV9UU01TdGF0c1JlcVBhcmFtc1R5cGUqIHB3ZGlUc21TdGF0c1JlcVBhcmFtcywKKyAgV0RJX1RzbVJzcENiICAgICAgICAgIHdkaVRzbVN0YXRzUnNwQ2IsCisgIHZvaWQqICAgICAgICAgICAgICAgICAgIHBVc2VyRGF0YQorKTsKKworCisjZW5kaWYKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gCisgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUW9TIGFuZCBCQSBBUElzCisgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qKgorIEBicmllZiBXRElfQWRkVFNSZXEgd2lsbCBiZSBjYWxsZWQgd2hlbiB0aGUgdXBwZXIgTUFDIHRvIGluZm9ybQorICAgICAgICB0aGUgZGV2aWNlIG9mIGEgc3VjY2Vzc2Z1bCBhZGQgVFNwZWMgbmVnb3RpYXRpb24uIEhXCisgICAgICAgIG5lZWRzIHRvIHJlY2VpdmUgdGhlIFRTcGVjIEluZm8gZnJvbSB0aGUgVU1BQyBpbiBvcmRlcgorICAgICAgICB0byBjb25maWd1cmUgcHJvcGVybHkgdGhlIFFvUyBkYXRhIHRyYWZmaWMuIFVwb24gdGhlCisgICAgICAgIGNhbGwgb2YgdGhpcyBBUEkgdGhlIFdMQU4gREFMIHdpbGwgcGFjayBhbmQgc2VuZCBhIEhBTAorICAgICAgICBBZGQgVFMgcmVxdWVzdCBtZXNzYWdlIHRvIHRoZSBsb3dlciBSSVZBIHN1Yi1zeXN0ZW0gaWYKKyAgICAgICAgREFMIGlzIGluIHN0YXRlIFNUQVJURUQuCisKKyAgICAgICAgSW4gc3RhdGUgQlVT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AgICAgICAgICAgICAgcFVzZXJEYXRhCispOworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gCisgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUG93ZXIgU2F2ZSBBUElzCisgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qKgorIEBicmllZiBXRElfU2V0UHdyU2F2ZUNmZ1JlcSB3aWxsIGJlIGNhbGxlZCB3aGVuIHRoZSB1cHBlciBNQUMgCisgICAgICAgIHdhbnRzIHRvIHNldCB0aGUgcG93ZXIgc2F2ZSByZWxhdGVkIGNvbmZpZ3VyYXRpb25zIG9mCisgICAgICAgIHRoZSBXTEFOIERldmljZS4gVXBvbiB0aGUgY2FsbCBvZiB0aGlzIEFQSSB0aGUgV0xBTiBEQUwKKyAgICAgICAgd2lsbCBwYWNrIGFuZCBzZW5kIGEgSEFMIFVwZGF0ZSBDRkcgcmVxdWVzdCBtZXNzYWdlIHRvCisgICAgICAgIHRoZSBsb3dlciBSSVZBIHN1Yi1zeXN0ZW0gaWYgREFMIGlzIGluIHN0YXRlIFNUQVJURUQuCisKKyAgICAgICAgSW4gc3RhdGUgQlVTWSB0aGlzIHJlcXVlc3Qgd2lsbCBiZSBxdWV1ZWQuIFJlcXVlc3Qgd29uJ3QKKyAgICAgICAgYmUgYWxsb3dlZCBpbiBhbnkgb3RoZXIgc3RhdGUuIAorCisgV0RJX1N0YXJ0IG11c3QgaGF2ZSBiZWVuIGNhbGxlZC4KKworIEBwYXJhbSBwd2RpUG93ZXJTYXZlQ2ZnOiB0aGUgcG93ZXIgc2F2ZSBjZmcgcGFyYW1ldGVycyBhcyAKKyAgICAgICAgICAgICAgICAgICAgICBzcGVjaWZpZWQgYnkgdGhlIERldmljZSBJbnRlcmZhY2UKKyAgCisgICAgICAgIHdkaVNldFB3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W0gZGF0YSByZXEgcGFyYW1ldGVycyBhcyAKKyAgICAgICAgICAgICAgICAgICAgICBzcGVjaWZpZWQgYnkgdGhlIERldmljZSBJbnRlcmZhY2UKKyAgCisgICAgICAgIHdkaVN0YXJ0T2VtRGF0YVJzcENiOiBjYWxsYmFjayBmb3IgcGFzc2luZyBiYWNrIHRoZQorICAgICAgICByZXNwb25zZSBvZiB0aGUgT2VtIERhdGEgUmVxIHJlY2VpdmVkIGZyb20gdGhlCisgICAgICAgIGRldmljZQorICAKKyAgICAgICAgcFVzZXJEYXRhOiB1c2VyIGRhdGEgd2lsbCBiZSBwYXNzZWQgYmFjayB3aXRoIHRoZQorICAgICAgICBjYWxsYmFjayAKKyAKKyBAcmV0dXJuIFJlc3VsdCBvZiB0aGUgZnVuY3Rpb24gY2FsbAorKi8KK1dESV9TdGF0dXMgCitXRElfU3RhcnRPZW1EYXRhUmVxCisoCisgIFdESV9vZW1EYXRhUmVxUGFyYW1zVHlwZSogICAgICAgcFdkaU9lbURhdGFSZXFQYXJhbXMsCisgIFdESV9vZW1EYXRhUnNwQ2IgICAgICAgICAgICAgICAgd2RpT2VtRGF0YVJzcENiLAorICB2b2lkKiAgICAgICAgICAgICAgICAgICAgICAgICAgIHBVc2VyRGF0YQorKTsKKyNlbmRpZgorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAKKyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ09OVFJPTCBBUElzCisgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisvKioKKyBAYnJpZWYgV0RJX1N3aXRjaENoUmVxIHdpbGwgYmUgY2FsbGVkIHdoZW4gdGhlIHVwcGVyIE1BQyB3YW50cyAKKyAgICAgICAgdGhlIFdMQU4gSFcgdG8gY2hhbmdlIHRoZSBjdXJyZW50IGNo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VmIHdkaV9IVDQwT0JTU1N0b3BTY2FuSW5kCisgICAgVGhpcyBBUEkgaXMgY2FsbGVkIHRvIHN0b3AgT0JTUyBzY2FuCisKKyBAcGFyYW0gYnNzSWR4IDogYnNzSWR4IHRvIHN0b3AKKyBAc2VlCisgQHJldHVybiBTVUNDRVNTIG9yIEZBSUwKKyovCisKK1dESV9TdGF0dXMgV0RJX0hUNDBPQlNTU3RvcFNjYW5JbmQod3B0X3VpbnQ4ICBic3NJZHgpOworCisKK1dESV9TdGF0dXMgV0RJX0dldEJjbk1pc3NSYXRlKCB2b2lkICpwVXNlckRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdESV9HZXRCY25NaXNzUmF0ZUNiIHdkaUdldEJjbk1pc3NSYXRlQ2IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdwdF91aW50OCAgICpic3NpZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICApOworV0RJX1N0YXR1cworV0RJX1NldFNwb29mTWFjQWRkclJlcQorKAorV0RJX1Nwb29mTWFjQWRkckluZm9UeXBlICpwV2RpUmVxLAorICBXRElfU2V0U3Bvb2ZNYWNBZGRyUnNwQ2IgICAgICAgICAgc2V0U3Bvb2ZNYWNBZGRyUnNwQ2IsCisgIHZvaWQqICAgICAgICAgICAgICAgICAgICAgICAgICBwVXNlckRhdGEKKyk7CisKK1dESV9TdGF0dXMKK1dESV9FbmNyeXB0TXNnUmVxKHZvaWQqIHB3ZGlFbmNyeXB0TXNnUGFyYW1zLAorICAgICAgICBXRElfRW5jcnlwdE1zZ1JzcENiIHdkaUVuY3J5cHRNc2dDYlJzcCwKKyAgICAgICAgdm9pZCogICAgICAgICAgICAgICAgICAgcFVzZXJEYXRhCisgICAgICAgICk7CisKKy8qKgorIEBicmllZiBXRElfTmFuUmVxdWVzdAorICAgICAgICBOQU4gcmVxdWVzdAorCisgQHBhcmFtIHB3ZGlOYW5SZXF1ZXN0OiBkYXRhCisKKyAgICAgIC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AgRCBFIFYgSSBDIEUgICBBIEIgUyBUIFIgQSBDIFQgSSBPIE4gICBMIEEgWSBFIFIgCisgICAgICAgICAgICAgIEkgTiBUIEUgUiBOIEEgTCAgICAgQSBQIEkgICAgICAgRiBPIFIgICAgVCBIIEUKKyAgICAgICAgICAgICAgICBCIEQgICBIIEUgQSBEIEUgUiAgIEQgRSBGIEkgTiBJIFQgSSBPIE4gCisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgCitERVNDUklQVElPTgorICBUaGlzIGZpbGUgY29udGFpbnMgdGhlIGludGVybmFsIEJEIGRlZmluaXRpb24gZXhwb3NlZCBieSB0aGUgREFMIENvbnRyb2wgICAgICAgCisgIFBhdGggQ29yZSBtb2R1bGUgdG8gYmUgdXNlZCBieSB0aGUgREFMIERhdGEgUGF0aCBDb3JlLgorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisgICRIZWFkZXI6JCAkRGF0ZVRpbWU6ICQgJEF1dGhvcjogJAorCisKK3doZW4gICAgICAgIHdobyAgICB3aGF0LCB3aGVyZSwgd2h5CistLS0tLS0tLSAgICAtLS0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorMDgvMTkvMTAgICAgbHRpICAgICBDcmVhdGVkIG1vZHVsZS4KKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworI2luY2x1ZGUgIndsYW5fcWN0X3BhbF90eXBlLmgiCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICAgICAgICAgCisgICAgIEJEIFNUUlVDVFVSRSBEZWZpbmVzICAKKyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICAgICAgICAgCisgIFdESV9SeEJkVHlwZSAtIFRoZSBmb3JtYXQgb2YgdGhlIFJYIEJEIAorLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KK3R5cGVkZWYgc3RydWN0IAoreworICAgICAgICAvKiAweDAwICovCisjaWZkZWYgV1BUX0JJR19CWVRFX0VORElBTgorICAgIAorICAgICAgICAvKiogKE9ubHkgdXNlZCBieSB0aGUgRFBVKQorICAgICAgICBUaGlzIHJvdXRpbmcgZmxhZyBpbmRpY2F0ZXMgdGhlIFdRIG51bWJlciB0byB3aGljaCB0aGUgRFBVIHdpbGwgcHVzaCB0aGUKKyAgICAgICAgZnJhbWUgYWZ0ZXIgaXQgZmluaXNoZWQgcHJvY2Vzc2luZyBpdC4gKi8KKyAgICAgICAgd3B0X3VpbnQzMiBkcHVSRjo4OworICAgIAorICAgICAgICAvKiogVGhpcyBpcyBEUFUgc2lnIGluc2Vyd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GFzIGluZGljdGVkIGFib3ZlCisgICAgICAgIDAxOiBEZS1mcmFnbWVudGF0aW9uIGZvcm1hdCAKKyAgICAgICAgMTAtMTE6IFJlc2VydmVkIGZvciBmdXR1cmUgdXNlLiAqLworICAgICAgICB3cHRfdWludDMyIGJkdDoyOworICAgICAgICAKKyNlbHNlCisgICAgICAgIHdwdF91aW50MzIgYmR0OjI7CisgICAgICAgIHdwdF91aW50MzIgZnQ6MTsKKyAgICAgICAgd3B0X3VpbnQzMiBkcHVORToxOworICAgICAgICB3cHRfdWludDMyIHJ4S2V5SWQ6MzsKKyAgICAgICAgd3B0X3VpbnQzMiB1YjoxOworICAgICAgICB3cHRfdWludDMyIHJtZjoxOworICAgICAgICB3cHRfdWludDMyIHVtYUJ5UGFzczoxOworICAgICAgICB3cHRfdWludDMyIGxsY3I6MTsKKworI2lmZGVmIFdDTl9QUk9OVE9fQ1NVCisgICAgICAgIHdwdF91aW50MzIgY3N1SVBDaGtzdW1FcnJvcjoxOworICAgICAgICB3cHRfdWludDMyIGNzdVRMQ2hrc3VtRXJyb3I6MTsKKyAgICAgICAgd3B0X3VpbnQzMiBjc3VDaGtzdW1WYWxpZDoxOworICAgICAgICB3cHRfdWludDMyIGNzdVZlcmlmaWVkSVBDaGtzdW06MTsKKyAgICAgICAgd3B0X3VpbnQzMiBjc3VWZXJpZmllZFRMQ2hrc3VtOjE7CisgICAgICAgIHdwdF91aW50MzIgY3N1Tm9WYWxIZDoxOworI2Vsc2UgLypXQ05fUFJPTlRPKi8KKyAgICAgICAgd3B0X3VpbnQzMiByZXNlcnZlZDA6MTsKKyAgICAgICAgd3B0X3VpbnQzMiBzY2FuTGVhcm46MTsKKyAgICAgICAgd3B0X3VpbnQzMiByeENoYW5uZWw6NDsKKyNlbmRpZiAvKldDTl9QUk9OVE8qLworCisgICAgICAgIHdwdF91aW50MzIgcnRzZjoxOworICAgICAgICB3cHRfdWludDMyIGJzZjoxOworICAgICAgICB3cHRfdWludDMyIEEySEY6MTsKKyAgICAgICAgd3B0X3VpbnQzMiBzdEF1RjoxOworICAgICAgICB3cHRfdWludDMyIGRwdVNpZ25hdHVyZTozOworICAgICAgICB3cHRfdWludDMyIGRwdVJGOjg7CisjZW5kaWYKKyAgICAKKyAgICAgICAgLyogMHgwNCAqLworI2lmZGVmIFdQVF9CSUdfQllURV9FTkRJQU4KKyAgICAKKyAgICAgICAgLyoqIFRoaXMgaXMgdXNlZCBmb3IgQU1TRFUgdGhpcyBpcyB0aGUgUERVIGluZGV4IG9mIHRoZSBQRFUgd2hpY2ggaXMgdGhlCisgICAgICAgIG9uZSBiZWZvcmUgbGFzdCBQRFU7IGZvciBhbGwgbm9uIEFNU0RVIGZyYW1lcywgdGhpcyBmaWVsZCBTSEFMTCBiZSAwLgorICAgICAgICBVc2VkIGluIEFEVSAoZm9yIEFNU0RVIGRlYWdncmVnYXRpb24pICovCisgICAgICAgIHdwdF91aW50MzIgcGVudWx0aW1hdGVQZHVJZHg6MTY7CisgICAgCisjaWZkZWYgV0NOX1BST05UTyAKKyAgICAgICAgd3B0X3VpbnQzMiBhZHVGZWVkYmFjazo3OworICAgICAgICB3cHRfdWludDMyIGRwdU1hZ2ljUGFja2V0OiAxOyAKKyNlbHNlCisgICAgICAgIHdwdF91aW50MzIgYWR1RmVlZGJhY2s6ODsKKyNlbmRpZiAvL1dDTl9QUk9OVE8KKyAgICAKKyAgICAgICAgLyoqIERQVSBmZWVkYmFjayAqLworICAgICAgICB3cHRfdWludDMyIGRwdUZlZWRiYWNrOjg7CisgICAgICAgIAorI2Vsc2UKKyAgICAgICAgd3B0X3VpbnQzMiBkcHVGZWVkYmFjazo4OworI2lmZGVmIFdDTl9QUk9OVE8gCisgICAgICAgIHdwdF91aW50MzIgZHB1TWFnaWNQYWNrZXQ6IDE7IAorICAgICAgICB3cHRfdWludDMyIGFkdUZlZWRiYWNrOjc7CisjZWxzZQorICAgICAgICB3cHRfdWludDMyIGFkdUZlZWRiYWNrOjg7CisjZW5kaWYgLy9X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gICAgCisjZWxzZQorICAgIAorICAgICAgICB3cHRfdWludDMyIHJ4cEZsYWdzOjIzOyAgICAgICAgICAgICAgICAgICAgIC8qIFJ4UCBmbGFncyovCisgICAgICAgIHdwdF91aW50MzIgcmF0ZUluZGV4Ojk7CisgICAgCisjZW5kaWYKKyAgICAgICAgLyogMHgxYywgMjAgKi8KKyAgICAgICAgLyoqIFRoZSBQSFkgY2FuIGJlIHByb2dyYW1tZWQgdG8gcHV0IGFsbCB0aGUgUEhZIFNUQVRTIHJlY2VpdmVkIGZyb20gdGhlCisgICAgICAgIFBIWSB3aGVuIHJlY2VpdmluZyBhIGZyYW1lIGluIHRoZSBCRC4gICovCisgICAgICAgIHdwdF91aW50MzIgcGh5U3RhdHMwOyAgICAgICAgICAgICAgICAgICAgICAvKiBQSFkgc3RhdHVzIHdvcmQgMCovCisgICAgICAgIHdwdF91aW50MzIgcGh5U3RhdHMxOyAgICAgICAgICAgICAgICAgICAgICAvKiBQSFkgc3RhdHVzIHdvcmQgMSovCisgICAgCisgICAgICAgIC8qIDB4MjQgKi8KKyAgICAgICAgLyoqIFRoZSB2YWx1ZSBvZiB0aGUgVFNGWzMxOjBdIGJpdHMgYXQgdGhlIG1vbWVudCB0aGF0IHRoZSBSWFAgc3RhcnQKKyAgICAgICAgcmVjZWl2aW5nIGEgZnJhbWUgZnJvbSB0aGUgUEhZIFJYLiAqLworICAgICAgICB3cHRfdWludDMyIG1jbGtSeFRpbWVzdGFtcDsgICAgICAgICAgICAgICAgLyogUnggdGltZXN0YW1wLCBtaWNyb3NlY29uZCBiYXNlZCovCisgICAgCisgICAgICAgIC8qIDB4Mjh+MHgzOCAqLworICAgICAgICAvKiogVGhlIGJpdHMgZnJvbSB0aGUgUE1JIGNvbW1hbmQgYXMgcmVjZWl2ZWQgZnJvbSB0aGUgUEhZIFJYLiAqLworICAgICAgICB3cHRfdWludDMyIHBtaUNtZDR0bzIzWzVdOyAgICAgICAgICAgICAgIC8qIFBNSSBjbWQgcmN2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9yZGVyT3Bjb2RlOjQ7CisgICAgCisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQ2OjEyOworICAgIAorICAgICAgICAvKiogRmlsbGVkIGJ5IFJQRSB0byBJbmRpY2F0ZSB0byB0aGUgaG9zdCB1cCB0byB3aGljaCBzbG90IHRoZSBob3N0IG5lZWRzCisgICAgICAgIHRvIGZvcndhcmQgdGhlIHBhY2tldHMgdG8gdXBwZXIgTWFjIGxheWVyLiBUaGlzIGZpZWxkIG1vc3RseSB1c2VkIGZvciBBTURQVQorICAgICAgICBwYWNrZXRzICovCisgICAgICAgIHdwdF91aW50MzIgcmVvcmRlckZ3ZElkeDo2OworICAgIAorICAgICAgICAvKiogRmlsbGVkIGJ5IFJQRSB3aGljaCBpbmRpY2F0ZXMgdG8gdGhlIGhvc3Qgd2hpY2ggb25lIG9mIHNsb3RzIGluIHRoZQorICAgICAgICBhdmFpbGFibGUgNjQgc2xvdHMgc2hvdWxkIHRoZSBob3N0IFF1ZXVlIHRoZSBwYWNrZXQuIFRoaXMgZmllbGQgb25seQorICAgICAgICBhcHBsaWVkIHRvIEFNUERVIHBhY2tldHMuICovCisgICAgICAgIHdwdF91aW50MzIgcmVvcmRlclNsb3RJZHg6NjsKKyAgICAgICAgCisjaWZkZWYgV0NOX1BST05UTworICAgICAgICB3cHRfdWludDMyIHJlc2VydmVkNzogMjsKKyAgICAgICAgd3B0X3VpbnQzMiBvdXRPZk9yZGVyRm9yd2FyZDogMTsKKyAgICAgICAgd3B0X3VpbnQzMiByZW9yZGVyRW5hYmxlOiAxOworI2Vsc2UKKyAgICAgICAgd3B0X3VpbnQzMiByZXNlcnZlZDc6NDsKKyNlbmRpZiAvL1dDTl9QUk9OVE8KKworI2Vsc2UKKworI2lmZGVmIFdDTl9QUk9OVE8KKyAgICAgICAgd3B0X3VpbnQzMiByZW9yZGVyRW5hYmxlOiAxOworICAgICAgICB3cHRfdWludDMyIG91dE9mT3JkZXJGb3J3YXJkOiAxOworICAgICAgICB3cHRfdWludDMyIHJlc2VydmVkNzogMjsKKyNlbHNlCisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQ3OjQ7CisjZW5kaWYgLy9XQ05fUFJPTlRPCisgICAgICAgIHdwdF91aW50MzIgcmVvcmRlclNsb3RJZHg6NjsKKyAgICAgICAgd3B0X3VpbnQzMiByZW9yZGVyRndkSWR4OjY7CisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQ2OjEyOworICAgICAgICB3cHRfdWludDMyIHJlb3JkZXJPcGNvZGU6NDsKKyNlbmRpZgorICAgIAorICAgICAgICAvKiAweDQ0ICovCisjaWZkZWYgV1BUX0JJR19CWVRFX0VORElBTgorICAgICAgICAvKiogcmVzZXJ2ZWQ4IGZyb20gYSBoYXJkd2FyZSBwZXJzcGVjdGl2ZS4KKyAgICAgICAgVXNlZCBieSBTVyB0byBwcm9wb2dhdGUgZnJhbWUgdHlwZS9zdWJ0eXBlIGluZm9ybWF0aW9uICovCisgICAgICAgIHdwdF91aW50MzIgZnJhbWVUeXBlU3VidHlwZTo2OworICAgICAgICB3cHRfdWludDMyIHJmQmFuZDoyOworICAgIAorICAgICAgICAvKiogRmlsbGVkIFJQRSBnaXZlcyB0aGUgY3VycmVudCBzZXF1ZW5jZSBudW1iZXIgaW4gYml0bWFwICovCisgICAgICAgIHdwdF91aW50MzIgY3VycmVudFBrdFNlcU5vOjEyOworICAgIAorICAgICAgICAvKiogRmlsbGVkIGJ5IFJQRSB3aGljaCBnaXZlcyB0aGUgc2VxdWVuY2UgbnVtYmVyIG9mIG5leHQgZXhwZWN0ZWQgcGFja2V0CisgICAgICAgIGluIGJpdG1hcCAqLworICAgICAgICB3cHRfdWludDMyIGV4cGVjdGVkUGt0U2VxTm86MTI7CisjZWxzZQorICAgICAgICB3cHRfdWludDMyIGV4cGVjdGVkUGt0U2VxTm86MTI7CisgICAgICAgIHdwdF91aW50MzIgY3VycmVudFBrdFNlcU5vOjEyOworICAgICAgICB3cHRfdWludDMyIHJmQmFuZDoyOworICAgICAgICB3cHRfdWludDMyIGZyYW1lVHlwZVN1YnR5cGU6NjsKKyNlbmRpZgorICAgIAorICAgICAgICAvKiAweDQ4ICovCisjaWZkZWYgV1BUX0JJR19CWVRFX0VORElBTgorICAgIAorICAgICAgICAvKiogV2hlbiBzZXQgaXQgaXMgdGhlIEFNU0RVIHN1YmZyYW1lICovCisgICAgICAgIHdwdF91aW50MzIgYXNmOjE7CisgICAgCisgICAgICAgIC8qKiBXaGVuIHNldCBpdCBpcyB0aGUgRmlyc3Qgc3ViZnJhbWUgb2YgdGhlIEFNU0RVIHBhY2tldCAqLworICAgICAgICB3cHRfdWludDMyIGVzZjoxOworICAgIAorICAgICAgICAvKiogV2hlbiBzZXQgaXQgaXMgdGhlIGxhc3Qgc3ViZnJhbWUgb2YgdGhlIEFNU0RVIHBhY2tldCAqLworICAgICAgICB3cHRfdWludDMyIGxzZjoxOworICAgIAorICAgICAgICAvKiogV2hlbiBzZXQgaXQgaW5kaWNhdGVzIGFuIEVycm9yZWQgQU1TRFUgcGFja2V0ICovCisgICAgICAgIHdwdF91aW50MzIgYWVmOjE7CisgICAgICAgIAorICAgICAgICB3cHRfdWludDMyIHJlc2VydmVkOTo0OworICAgIAorICAgICAgICAvKiogSXQgZ2l2ZXMgdGhlIG9yZGVyIGluIHdoaWNoIHRoZSBBTVNEVSBwYWNrZXQgaXMgcHJvY2Vzc2VkCisgICAgICAgIEJhc2ljYWxseSB0aGlzIGlzIGEgbnVtYmVyIHdoaWNoIGluY3JlbWVudHMgYnkgb25lIGZvciBldmVyeSBBTVNEVSBmcmFtZQorICAgICAgICByZWNlaXZlZC4gTWFpbmx5IGZvciBkZWJ1Z2dpbmcgcHVycG9zZS4gKi8KKyAgICAgICAgd3B0X3VpbnQzMiBwcm9jZXNzT3JkZXI6NDsKKyAgICAKKyAgICAgICAgLyoqIEl0IGlzIHRoZSBvcmRlciBvZiB0aGUgc3ViZnJhbWUgb2YgQU1TRFUgdGhhd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ICAgICAgICB3cHRfdWludDMyIGRwdU5FOjE7CisgICAgICAgIHdwdF91aW50MzIgcnhLZXlJZDozOworICAgICAgICB3cHRfdWludDMyIHViOjE7CisgICAgICAgIHdwdF91aW50MzIgcm1mOjE7CisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQxOjE7CisgICAgICAgIHdwdF91aW50MzIgbGxjOjE7CisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQwOjE7CisgICAgICAgIHdwdF91aW50MzIgc2NhbkxlYXJuOjE7CisgICAgICAgIHdwdF91aW50MzIgcnhDaGFubmVsOjQ7CisgICAgICAgIHdwdF91aW50MzIgcnRzZjoxOworICAgICAgICB3cHRfdWludDMyIGJzZjoxOworICAgICAgICB3cHRfdWludDMyIEEySEY6MTsKKyAgICAgICAgd3B0X3VpbnQzMiBzdEF1RjoxOworICAgICAgICB3cHRfdWludDMyIGRwdVNpZ25hdHVyZTozOworICAgICAgICB3cHRfdWludDMyIGRwdVJGOjg7CisjZW5kaWYKKyAgICAKKyAgICAgICAgLyogMHgwNCAqLworI2lmZGVmIFdQVF9CSUdfQllURV9FTkRJQU4KKyAgICAKKyAgICAgICAgLyoqIFRoaXMgaXMgdXNlZCBmb3IgQU1TRFUgdGhpcyBpcyB0aGUgUERVIGluZGV4IG9mIHRoZSBQRFUgd2hpY2ggaXMgdGhlCisgICAgICAgIG9uZSBiZWZvcmUgbGFzdCBQRFU7IGZvciBhbGwgbm9uIEFNU0RVIGZyYW1lcywgdGhpcyBmaWVsZCBTSEFMTCBiZSAwLgorICAgICAgICBVc2VkIGluIEFEVSAoZm9yIEFNU0RVIGRlYWdncmVnYXRpb24pICovCisgICAgICAgIHdwdF91aW50MzIgcGVudWx0aW1hdGVQZHVJZHg6MTY7CisgICAgCisgICAgICAgIHdwdF91aW50MzIgYWR1RmVlZGJhY2s6ODsKKyAgICAKKyAgICAgICAgLyoqIERQVSBmZWVkYmFjayAqLworICAgICAgICB3cHRfdWludDMyIGRwdUZlZWRiYWNrOjg7CisgICAgICAgIAorI2Vsc2UKKyAgICAgICAgd3B0X3VpbnQzMiBkcHVGZWVkYmFjazo4OworICAgICAgICB3cHRfdWludDMyIGFkdUZlZWRiYWNrOjg7CisgICAgICAgIHdwdF91aW50MzIgcGVudWx0aW1hdGVQZHVJZHg6MTY7CisjZW5kaWYKKyAgICAKKyAgICAgICAgLyogMHgwOCAqLworI2lmZGVmIFdQVF9CSUdfQllURV9FTkRJQU4KKyAgICAKKyAgICAgICAgLyoqIEluIGNhc2UgUERVcyBhcmUgbGlua2VkIHRvIHRoZSBCRCwgdGhpcyBmaWVsZCBpbmRpY2F0ZXMgdGhlIGluZGV4IG9mCisgICAgICAgIHRoZSBmaXJzdCBQRFUgbGlua2VkIHRvIHRoZSBCRC4gV2hlbiBQRFUgY291bnQgaXMgemVybywgdGhpcyBmaWVsZCBoYXMgYW4KKyAgICAgICAgdW5kZWZpbmVkIHZhbHVlLiAqLworICAgICAgICB3cHRfdWludDMyIGhlYWRQZHVJZHg6MTY7CisgICAgCisgICAgICAgIC8qKiBJbiBjYXNlIFBEVXMgYXJlIGxpbmtlZCB0byB0aGUgQkQsIHRoaXMgZmllbGQgaW5kaWNhdGVzIHRoZSBpbmRleCBvZgorICAgICAgICB0aGUgbGFzdCBQRFUuIFdoZW4gUERVIGNvdW50IGlzIHplcm8sIHRoaXMgZmllbGQgaGFzIGFuIHVuZGVmaW5lZCB2YWx1ZS4qLworICAgICAgICB3cHRfdWludDMyIHRhaWxQZHVJZHg6MTY7CisgICAgICAgIAorI2Vsc2UKKyAgICAgICAgd3B0X3VpbnQzMiB0YWlsUGR1SWR4OjE2OworICAgICAgICB3cHRfdWludDMyIGhlYWRQZHVJZHg6MTY7CisjZW5kaWYKKyAgICAKKyAgICAgICAgLyogMHgwYyAqLworI2lmZGVmIFdQVF9CSUdfQllURV9FTkRJQU4KKyAgICAKKyAgICAgICAgLyoqIFRoZSBsZW5ndGggKGluIG51bWJlciBvZiBieXRlcykgb2Y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XlzIGluZGljYXRlIHRoZSBjb3JyZWN0IGFtb3VudC4gKi8KKyAgICAgICAgd3B0X3VpbnQzMiBwZHVDb3VudDo3OworI2Vsc2UKKyAgICAKKyAgICAgICAgd3B0X3VpbnQzMiBwZHVDb3VudDo3OworICAgICAgICB3cHRfdWludDMyIG1wZHVEYXRhT2Zmc2V0Ojk7CisgICAgICAgIHdwdF91aW50MzIgbXBkdUhlYWRlck9mZnNldDo4OworICAgICAgICB3cHRfdWludDMyIG1wZHVIZWFkZXJMZW5ndGg6ODsKKyNlbmRpZgorICAgIAorICAgICAgICAvKiAweDEwICovCisjaWZkZWYgV1BUX0JJR19CWVRFX0VORElBTgorICAgIAorICAgICAgICAvKiogVGhpcyBpcyB0aGUgbGVuZ3RoIChpbiBudW1iZXIgb2YgYnl0ZXMpIG9mIHRoZSBlbnRpcmUgTVBEVSAKKyAgICAgICAgKGhlYWRlciBhbmQgZGF0YSkuIE5vdGUgdGhhdCB0aGUgbGVuZ3RoIGRvZXMgbm90IGluY2x1ZGUgRkNTIGZpZWxkLiAqLworICAgICAgICB3cHRfdWludDMyIG1wZHVMZW5ndGg6MTY7CisgICAgCisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQzOjQ7CisgICAgCisgICAgICAgIC8qKiBUcmFmZmljIElkZW50aWZpZXIKKyAgICAgICAgSW5kaWNhdGVzIHRoZSB0cmFmZmljIGNsYXNzIHRoZSBmcmFtZSBiZWxvbmdzIHRvLiBGb3Igbm9uIFFvUyBmcmFtZXMsCisgICAgICAgIHRoaXMgZmllbGQgaXMgc2V0IHRvIHplcm8uICovCisgICAgICAgIHdwdF91aW50MzIgdGlkOjQ7CisgICAgICAgIAorICAgICAgICB3cHRfdWludDMyIHJlc2VydmVkNDo3OworICAgICAgICB3cHRfdWludDMyIGZjOjE7ICAgICAgICAvL2lmIHNldCB0aGVuIGl0cyBzcGVjaWFsIGZsb3cgY29udHJvbCBCRC4KKyNlbHNlCisgICAgICAgIHdwdF91aW50Mz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IEFuIG92ZXJ2aWV3IG9mIFJYUCBzdGF0dXMgaW5mb3JtYXRpb24gcmVsYXRlZCB0byByZWNlaXZpbmcgdGhlIGZyYW1lLiovCisgICAgICAgIHdwdF91aW50MzIgcnhwRmxhZ3M6MjM7IAorICAgIAorI2Vsc2UKKyAgICAKKyAgICAgICAgd3B0X3VpbnQzMiByeHBGbGFnczoyMzsgICAgICAgICAgICAgICAgICAgICAvKiBSeFAgZmxhZ3MqLworICAgICAgICB3cHRfdWludDMyIHJhdGVJbmRleDo5OworICAgIAorI2VuZGlmCisgICAgICAgIC8qIDB4MWMsIDIwICovCisgICAgICAgIC8qKiBUaGUgUEhZIGNhbiBiZSBwcm9ncmFtbWVkIHRvIHB1dCBhbGwgdGhlIFBIWSBTVEFUUyByZWNlaXZlZCBmcm9tIHRoZQorICAgICAgICBQSFkgd2hlbiByZWNlaXZpbmcgYSBmcmFtZSBpbiB0aGUgQkQuICAqLworICAgICAgICB3cHRfdWludDMyIHBoeVN0YXRzMDsgICAgICAgICAgICAgICAgICAgICAgLyogUEhZIHN0YXR1cyB3b3JkIDAqLworICAgICAgICB3cHRfdWludDMyIHBoeVN0YXRzMTsgICAgICAgICAgICAgICAgICAgICAgLyogUEhZIHN0YXR1cyB3b3JkIDEqLworICAgIAorICAgICAgICAvKiAweDI0ICovCisgICAgICAgIC8qKiBUaGUgdmFsdWUgb2YgdGhlIFRTRlszMTowXSBiaXRzIGF0IHRoZSBtb21lbnQgdGhhdCB0aGUgUlhQIHN0YXJ0CisgICAgICAgIHJlY2VpdmluZyBhIGZyYW1lIGZyb20gdGhlIFBIWSBSWC4gKi8KKyAgICAgICAgd3B0X3VpbnQzMiBtY2xrUnhUaW1lc3RhbXA7ICAgICAgICAgICAgICAgIC8qIFJ4IHRpbWVzdGFtcCwgbWljcm9zZWNvbmQgYmFzZWQqLworICAgIAorICAgICAgIC8qIDB4MjggLSAweDJjKi8gICAgIAorI2lmZGVmIFdQVF9CSUdfQllURV9FTkRJQU4gIA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dG8gODAyLjMgZnJhbWUgdHJhbnNsYXRpb24uIFdoZW4gdXNlZCBieSBBRFUgCisgICAgICAgIDAgLSBObyBmcmFtZSB0cmFuc2xhdGlvbiByZXF1aXJlZAorICAgICAgICAxIC0gRnJhbWUgVHJhbnNsYXRpb24gcmVxdWlyZWQgKi8KKyAgICAgICAgd3B0X3VpbnQzMiBmdDoxOworICAgIAorICAgICAgICAvKiogQkQgVHlwZSAKKyAgICAgICAgMDA6ICdHZW5lcmljIEJEJywgYXMgaW5kaWN0ZWQgYWJvdmUKKyAgICAgICAgMDE6IERlLWZyYWdtZW50YXRpb24gZm9ybWF0IAorICAgICAgICAxMC0xMTogUmVzZXJ2ZWQgZm9yIGZ1dHVyZSB1c2UuICovCisgICAgICAgIHdwdF91aW50MzIgYmR0OjI7CisjZWxzZQorICAgICAgICB3cHRfdWludDMyIGJkdDoyOworICAgICAgICB3cHRfdWludDMyIGZ0OjE7CisgICAgICAgIHdwdF91aW50MzIgZHB1TkU6MTsKKyAgICAgICAgd3B0X3VpbnQzMiBmd1R4Q29tcGxldGUwOjE7IAorICAgICAgICB3cHRfdWludDMyIHR4Q29tcGxldGUxOjE7CisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQxOjE7CisgICAgICAgIHdwdF91aW50MzIgdWI6MTsKKyAgICAgICAgd3B0X3VpbnQzMiBybWY6MTsKKyNpZmRlZiBXQ05fUFJPTlRPICAgICAgICAKKyAgICAgICAgd3B0X3VpbnQzMiBjc3VOb1ZhbGlkSGVhZGVyOjE7CisgICAgICAgIHdwdF91aW50MzIgY3N1VExDa3N1bUdlbmVyYXRlZDoxOworICAgICAgICB3cHRfdWludDMyIGNzdUVuYWJsZUlQQ2tzdW06MTsKKyAgICAgICAgd3B0X3VpbnQzMiBjc3VFbmFibGVUTENrc3VtOjE7CisgICAgICAgIHdwdF91aW50MzIgY3N1VFhFbmFibGU6MTsKKyAgICAgICAgd3B0X3VpbnQzMiBjc3VTV01vZGU6MTsKKyAgICAgICAgd3B0X3VpbnQzMiB1bWFCREVuYWJsZToxOworICAgICAgICB3cHRfdWludDMyIHVtYUJzc2lkSWR4OjI7CisgICAgICAgIHdwdF91aW50MzIgdGVybWluYXRlQU1QRFU6MTsKKyAgICAgICAgd3B0X3VpbnQzMiByZXNlcnZlZDA6MjsKKyNlbHNlIC8qV0NOX1BST05UTyovCisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQwOjEyOworI2VuZGlmIC8qV0NOX1BST05UTyovCisgICAgICAgIHdwdF91aW50MzIgZHB1U2lnbmF0dXJlOjM7CisgICAgICAgIHdwdF91aW50MzIgZHB1UkY6ODsKKyNlbmRpZgorICAgIAorICAgICAgICAvKiAweDA0ICovCisjaWZkZWYgV1BUX0JJR19CWVRFX0VORElBTgorICAgICAgICB3cHRfdWludDMyIHJlc2VydmVkMjoxNjsgLyogTVVTVCBCRSAwIG90aGVyd2lzZSB0cmlnZ2VycyBCTVUgZXJyb3IqLworICAgICAgICB3cHRfdWludDMyIGFkdUZlZWRiYWNrOjg7CisgICAgCisgICAgICAgIC8qIERQVSBmZWVkYmFjayBpbiBUeCBwYXRoLiovCisgICAgICAgIHdwdF91aW50MzIgZHB1RmVlZGJhY2s6ODsKKyAgICAKKyNlbHNlCisgICAgICAgIHdwdF91aW50MzIgZHB1RmVlZGJhY2s6ODsKKyAgICAgICAgd3B0X3VpbnQzMiBhZHVGZWVkYmFjazo4OworICAgICAgICB3cHRfdWludDMyIHJlc2VydmVkMjoxNjsKKyNlbmRpZgorICAgIAorICAgICAgICAvKiAweDA4ICovCisjaWZkZWYgV1BUX0JJR19CWVRFX0VORElBTgorICAgICAgICAvKiogSXQgaXMgaW5pdGlhbGx5IGZpbGxlZCBieSBEWEUgdGhlbiBpZiBlbmNyeXB0aW9uIGlzIG9uLCB0aGVuIERQVSB3aWxsCisgICAgICAgIG92ZXJ3cml0ZSB0aGVzZSBmaWVsZHMuIEluIGNhc2UgUERVcyBhcmUgbGlua2VkIHRvIHRoZ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hZGRyZXNzICovCisgICAgICAgIHdwdF91aW50MzIgc3RhSW5kZXg6ODsKKyAgICAKKyAgICAgICAgLyoqIEEgZmllbGQgcGFzc2VkIG9uIHRvIFRQRSB3aGljaCBpbmZsdWVuY2VzIHRoZSBBQ0sgcG9saWN5IHRvIGJlIHVzZWQgZm9yCisgICAgICAgIHRoaXMgZnJhbWUKKyAgICAgICAgMDAgLSBJYWNrCisgICAgICAgIDAxLDEwLDExIC0gTm8gQWNrICovCisgICAgICAgIHdwdF91aW50MzIgYXA6MjsKKyAgICAKKyAgICAgICAgLyoqIE92ZXJ3cml0ZSBvcHRpb24gZm9yIHRoZSB0cmFuc21pdCByYXRlCisgICAgICAgIDAwOiBVc2UgcmF0ZSBwcm9ncmFtbWVkIGluIHRoZSBUUEUgU1RBIGRlc2NyaXB0b3IKKyAgICAgICAgMDE6IFVzZSBUUEUgQkQgcmF0ZSAxCisgICAgICAgIDEwOiBVc2UgVFBFIEJEIHJhdGUgMgorICAgICAgICAxMTogRGVsYXllZCBVc2UgVFBFIEJEIHJhdGUgMyAqLworICAgICAgICB3cHRfdWludDMyIGJkUmF0ZToyOworICAgIAorICAgICAgICAvKiogCisgICAgICAgIFRoaXMgaXMgZmlsbGVkIGJ5IEhvc3QgaW4gVmlyZ28gMS4wIGJ1dCBpdCBnZXRzIGZpbGxlZCBieSBBRFUgaW4KKyAgICAgICAgVmlyZ28yLjAvTGlicmEuIFF1ZXVlIElEICovCisgICAgICAgIHdwdF91aW50MzIgcXVldWVJZDo1OworICAgIAorICAgICAgICB3cHRfdWludDMyIHJlc2VydmVkNTo3OworI2Vsc2UKKyAgICAgICAgd3B0X3VpbnQzMiByZXNlcnZlZDU6NzsKKyAgICAgICAgd3B0X3VpbnQzMiBxdWV1ZUlkOjU7CisgICAgICAgIHdwdF91aW50MzIgYmRSYXRlOjI7CisgICAgICAgIHdwdF91aW50MzIgYXA6MjsKKyAgICAgICAgd3B0X3VpbnQzMiBzdGFJbmRleDo4OworICAgICAgIC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aW50MzIgcmVzZXJ2ZWQzOjE2OworICAgICAgICB3cHRfdWludDMyIGZyYWcwQmRJZHg6MTY7CisjZWxzZQorICAgICAgICB3cHRfdWludDMyIGZyYWcwQmRJZHg6MTY7CisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQzOjE2OworI2VuZGlmCisKKyNpZmRlZiBXUFRfQklHX0JZVEVfRU5ESUFOCisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQ0OjE2OworICAgICAgICB3cHRfdWludDMyIGZyYWcxQmRJZHg6MTY7CisjZWxzZQorICAgICAgICB3cHRfdWludDMyIGZyYWcxQmRJZHg6MTY7CisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQ0OjE2OworI2VuZGlmCisKKyNpZmRlZiBXUFRfQklHX0JZVEVfRU5ESUFOCisgICAgICAgIHdwdF91aW50MzIgZnJhZzJCZElkeDoxNjsKKyAgICAgICAgd3B0X3VpbnQzMiByZXNlcnZlZDU6MTY7CisjZWxzZQorICAgICAgICB3cHRfdWludDMyIGZyYWcyQmRJZHg6MTY7CisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQ1OjE2OworI2VuZGlmCisKKyNpZmRlZiBXUFRfQklHX0JZVEVfRU5ESUFOCisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQ2OjE2OworICAgICAgICB3cHRfdWludDMyIGZyYWczQmRJZHg6MTY7CisjZWxzZQorICAgICAgICB3cHRfdWludDMyIGZyYWczQmRJZHg6MTY7CisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQ2OjE2OworI2VuZGlmCisKKyNpZmRlZiBXUFRfQklHX0JZVEVfRU5ESUFOCisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQ3OjE2OworICAgICAgICB3cHRfdWludDMyIGZyYWc0QmRJZHg6MTY7CisjZWxzZQorICAgICAgICB3cHRfdWludDMyIGZyYWc0QmRJZHg6MTY7CisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQ3OjE2OworI2VuZGlmCisKKyNpZmRlZiBXUFRfQklHX0JZVEVfRU5ESUFOCisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQ4OjE2OworICAgICAgICB3cHRfdWludDMyIGZyYWc1QmRJZHg6MTY7CisjZWxzZQorICAgICAgICB3cHRfdWludDMyIGZyYWc1QmRJZHg6MTY7CisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQ4OjE2OworI2VuZGlmCisKKyNpZmRlZiBXUFRfQklHX0JZVEVfRU5ESUFOCisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQ5OjE2OworICAgICAgICB3cHRfdWludDMyIGZyYWc2QmRJZHg6MTY7CisjZWxzZQorICAgICAgICB3cHRfdWludDMyIGZyYWc2QmRJZHg6MTY7CisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQ5OjE2OworI2VuZGlmCisKKyNpZmRlZiBXUFRfQklHX0JZVEVfRU5ESUFOCisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQxMDoxNjsKKyAgICAgICAgd3B0X3VpbnQzMiBmcmFnN0JkSWR4OjE2OworI2Vsc2UKKyAgICAgICAgd3B0X3VpbnQzMiBmcmFnN0JkSWR4OjE2OworICAgICAgICB3cHRfdWludDMyIHJlc2VydmVkMTA6MTY7CisjZW5kaWYKKworI2lmZGVmIFdQVF9CSUdfQllURV9FTkRJQU4KKyAgICAgICAgd3B0X3VpbnQzMiByZXNlcnZlZDExOjE2OworICAgICAgICB3cHRfdWludDMyIGZyYWc4QmRJZHg6MTY7CisjZWxzZQorICAgICAgICB3cHRfdWludDMyIGZyYWc4QmRJZHg6MTY7CisgICAgICAgIHdwdF91aW50MzIgcmVzZXJ2ZWQxMToxNjsKKyNlbmRpZgorCisjaWZkZWYgV1BUX0JJR19CWVRFX0VORElBTgorICAgICAgICB3cHRfdWludDMyIHJlc2VydmVkMTI6MTY7CisgICAgICAgIHdwdF91aW50MzIgZnJhZz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luYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmbmRlZiBXTEFOX1FDVF9XRElfQ0ZHX0gKKyNkZWZpbmUgV0xBTl9RQ1RfV0RJX0NGR19ICisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgIFcgTCBBIE4gICBEIEUgViBJIEMgRSAgIEEgQiBTIFQgUiBBIEMgVCBJIE8gTiAgIEwgQSBZIEUgUiAKKyAgICAgICAgICAgICAgQyBPIE4gRiBJIEcgVSBSIEEgVCBJIE8gTiAgIEQgRSBGIEkgTiBFIFMKKyAgICAgICAgICAgICAgICAgICAgICAgICBFIFggVCBFIFIgTiBBIEwgICBBIFAgSSAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAKK0RFU0NSSVBUSU9OCisgIFRoaXMgZmlsZSBjb250YWlucyB0aGUgY29uZmlndXJhdGlvbiBkZWZpbmVzIHRvIGJlIHVzZWQgYnkgdGhlIFVNQUMgZm9yCisgIHNldHRpbmcgdXAgdGhlIGNvbmZpZyBwYXJhbWV0ZXJzIGluIERBTC4KKyAKKyAgISEgVGhlIHZhbHVlcyBpbiBoZXJlIHNob3VsZCBiZSBhbiBpZGVudGljYWwgbWF0Y2ggb2YgdGhlIEhBTCBkZWZpbmVzCisgIGJ5IHRoZSBzYW1lIG5hbWUgISEgCisgIAorICAgICAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKy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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworI2RlZmluZSBXRElfQ0ZHX1NUQV9JRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBXRElfQ0ZHX0NVUlJFTlRfVFhfQU5URU5OQSAgICAgICAgICAgICAgICAgMQorI2RlZmluZSBXRElfQ0ZHX0NVUlJFTlRfUlhfQU5URU5OQSAgICAgICAgICAgICAgICAgMgorI2RlZmluZSBXRElfQ0ZHX0xPV19HQUlOX09WRVJSSURFICAgICAgICAgICAgICAgICAgMworI2RlZmluZSBXRElfQ0ZHX1BPV0VSX1NUQVRFX1BFUl9DSEFJTiAgICAgICAgICAgICAgNAorI2RlZmluZSBXRElfQ0ZHX0NBTF9QRVJJT0QgICAgICAgICAgICAgICAgICAgICAgICAgNQorI2RlZmluZSBXRElfQ0ZHX0NBTF9DT05UUk9MICAgICAgICAgICAgICAgICAgICAgICAgNgorI2RlZmluZSBXRElfQ0ZHX1BST1hJTUlUWSAgICAgICAgICAgICAgICAgICAgICAgICAgNworI2RlZmluZSBXRElfQ0ZHX05FVFdPUktfREVOU0lUWSAgICAgICAgICAgICAgICAgICAgOAorI2RlZmluZSBXRElfQ0ZHX01BWF9NRURJVU1fVElNRSAgICAgICAgICAgICAgICAgICAgOQorI2RlZmluZSBXRElfQ0ZHX01BWF9NUERVU19JTl9BTVBEVSAgICAgICAgICAgICAgICAgMTAKKyNkZWZpbmUgV0RJX0NGR19SVFNfVEhSRVNIT0xEICAgICAgICAgICAgICAgICAgICAgIDExCisjZGVmaW5lIFdESV9DRkdfU0hPUlRfUkVUUllfTElNSVQgICAgICAgICAgICAgICAgICAxMgorI2RlZmluZSBXRElfQ0ZHX0xPTkdfUkVUUllfTElNSVQgICAgICAgICAgICAgICAgICAgMTMKKyNkZWZpbmUgV0RJX0NGR19GUkFHTUVOVEFUSU9OX1RIUkVTSE9MRCAgICAgICAgICAgIDE0CisjZGVmaW5lIFdESV9DRkdfRFlOQU1JQ19USFJFU0hPTERfWkVSTyAgICAgICAgICAgICAxNQorI2RlZmluZSBXRElfQ0ZHX0RZTkFNSUNfVEhSRVNIT0xEX09ORSAgICAgICAgICAgICAgMTYKKyNkZWZpbmUgV0RJX0NGR19EWU5BTUlDX1RIUkVTSE9MRF9UV08gICAgICAgICAgICAgIDE3CisjZGVmaW5lIFdESV9DRkdfRklYRURfUkFURSAgICAgICAgICAgICAgICAgICAgICAgICAxOAorI2RlZmluZSBXRElfQ0ZHX1JFVFJZUkFURV9QT0xJQ1kgICAgICAgICAgICAgICAgICAgMTkKKyNkZWZpbmUgV0RJX0NGR19SRVRSWVJBVEVfU0VDT05EQVJZICAgICAgICAgICAgICAgIDIwCisjZGVmaW5lIFdESV9DRkdfUkVUUllSQVRFX1RFUlRJQVJZICAgICAgICAgICAgICAgICAyMQorI2RlZmluZSBXRElfQ0ZHX0ZPUkNFX1BPTElDWV9QUk9URUNUSU9OICAgICAgICAgICAgMjIKKyNkZWZpbmUgV0RJX0NGR19GSVhFRF9SQVRFX01VTFRJQ0FTVF8yNEdIWiAgICAgICAgIDIzCisjZGVmaW5lIFdESV9DRkdfRklYRURfUkFURV9NVUxUSUNBU1RfNUdIWiAgICAgICAgICAyNAorI2RlZmluZSBXRElfQ0ZHX0RFRkFVTFRfUkFURV9JTkRFWF8yNEdIWiAgICAgICAgICAgMjUKKyNkZWZpbmUgV0RJX0NGR19ERUZBVUxUX1JBVEVfSU5ERVhfNUdIWiAgICAgICAgICAgIDI2CisjZGVmaW5lIFdESV9DRkdfTUFYX0JBX1NFU1NJT05TICAgICAgICAgICAgICAgICAgICAyNworI2RlZmluZSBXRElfQ0ZHX1BTX0RBVEFfSU5BQ1RJVklUWV9USU1FT1VUICAgICAgICAgMjgKKyNkZWZpbmUgV0RJX0NGR19QU19FTkFCTEVfQkNOX0ZJTFRFUiAgICAgICAgICAgICAgIDI5CisjZGVmaW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VQgICAgIDQKKyNkZWZpbmUgV0RJX0NGR19QT1dFUl9TVEFURV9QRVJfQ0hBSU5fQ0hBSU5fMl9PRkZTRVQgICAgIDgKKworLyogV0RJX0NGR19DQUxfUEVSSU9EICovCisjZGVmaW5lIFdESV9DRkdfQ0FMX1BFUklPRF9TVEFNSU4gICAgICAgICAgICAgICAgICAyCisjZGVmaW5lIFdESV9DRkdfQ0FMX1BFUklPRF9TVEFNQVggICAgICAgICAgICAgICAgICAxMAorI2RlZmluZSBXRElfQ0ZHX0NBTF9QRVJJT0RfU1RBREVGICAgICAgICAgICAgICAgICAgNQorCisvKiBXRElfQ0ZHX0NBTF9DT05UUk9MICovCisjZGVmaW5lIFdESV9DRkdfQ0FMX0NPTlRST0xfU1RBTUlOICAgIDAKKyNkZWZpbmUgV0RJX0NGR19DQUxfQ09OVFJPTF9TVEFNQVggICAgMQorI2RlZmluZSBXRElfQ0ZHX0NBTF9DT05UUk9MX1NUQURFRiAgICAwCisKKy8qIFdESV9DRkdfUFJPWElNSVRZICovCisjZGVmaW5lIFdESV9DRkdfUFJPWElNSVRZX1NUQU1JTiAgICAwCisjZGVmaW5lIFdESV9DRkdfUFJPWElNSVRZX1NUQU1BWCAgICAxCisjZGVmaW5lIFdESV9DRkdfUFJPWElNSVRZX1NUQURFRiAgICAwCisjZGVmaW5lIFdESV9DRkdfUFJPWElNSVRZX09GRiAgICAgICAwCisjZGVmaW5lIFdESV9DRkdfUFJPWElNSVRZX09OICAgICAgICAxCisKKy8qIFdESV9DRkdfTkVUV09SS19ERU5TSVRZICovCisjZGVmaW5lIFdESV9DRkdfTkVUV09SS19ERU5TSVRZX1NUQU1JTiAgICAwCisjZGVmaW5lIFdESV9DRkdfTkVUV09SS19ERU5TSVRZX1NUQU1BWCAgICAzCisjZGVmaW5lIFdESV9DRkdfTkVUV09SS19ERU5TSVRZX1NUQURFRiAgICAzCisjZGVmaW5lIFdESV9DRkdfTkVUV09SS19ERU5TSVRZX0xPVyAgICAgICAwCisjZGVmaW5lIFdESV9DRkdfTkVUV09SS19ERU5TSVRZX01FRElVTSAgICAxCisjZGVmaW5lIFdESV9DRkdfTkVUV09SS19ERU5TSVRZX0hJR0ggICAgICAyCisjZGVmaW5lIFdESV9DRkdfTkVUV09SS19ERU5TSVRZX0FEQVBUSVZFICAzCisKKy8qIFdESV9DRkdfTUFYX01FRElVTV9USU1FICovCisjZGVmaW5lIFdESV9DRkdfTUFYX01FRElVTV9USU1FX1NUQU1JTiAgICAwCisjZGVmaW5lIFdESV9DRkdfTUFYX01FRElVTV9USU1FX1NUQU1BWCAgICA2NTUzNQorI2RlZmluZSBXRElfQ0ZHX01BWF9NRURJVU1fVElNRV9TVEFERUYgICAgMTAyNAorCisvKiBXRElfQ0ZHX01BWF9NUERVU19JTl9BTVBEVSAqLworI2RlZmluZSBXRElfQ0ZHX01BWF9NUERVU19JTl9BTVBEVV9TVEFNSU4gICAgMAorI2RlZmluZSBXRElfQ0ZHX01BWF9NUERVU19JTl9BTVBEVV9TVEFNQVggICAgNjU1MzUKKyNkZWZpbmUgV0RJX0NGR19NQVhfTVBEVVNfSU5fQU1QRFVfU1RBREVGICAgIDY0CisKKy8qIFdESV9DRkdfUlRTX1RIUkVTSE9MRCAqLworI2RlZmluZSBXRElfQ0ZHX1JUU19USFJFU0hPTERfU1RBTUlOICAgICAgICAgICAgICAgMAorI2RlZmluZSBXRElfQ0ZHX1JUU19USFJFU0hPTERfU1RBTUFYICAgICAgICAgICAgICAgMjM0NworI2RlZmluZSBXRElfQ0ZHX1JUU19USFJFU0hPTERfU1RBREVGICAgICAgICAgICAgICAgMjM0NworCisvKiBXRElfQ0ZHX1NIT1JUX1JFVFJZX0xJTUlUICovCisjZGVmaW5lIFdESV9DRkdfU0hPUlRfUkVUUllfTElNSVRfU1RBTUlOICAgIDAKKyNkZWZpbmUgV0RJX0NGR19TSE9SVF9SRVRSWV9MSU1JVF9TVEFNQVggICAgMjU1CisjZGVmaW5lIFdESV9DRkdfU0hPUlRfUkV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MRF9UV08gKi8KKyNkZWZpbmUgV0RJX0NGR19EWU5BTUlDX1RIUkVTSE9MRF9UV09fU1RBTUlOICAgIDAKKyNkZWZpbmUgV0RJX0NGR19EWU5BTUlDX1RIUkVTSE9MRF9UV09fU1RBTUFYICAgIDI1NQorI2RlZmluZSBXRElfQ0ZHX0RZTkFNSUNfVEhSRVNIT0xEX1RXT19TVEFERUYgICAgNgorCisvKiBXRElfQ0ZHX0ZJWEVEX1JBVEUgKi8KKyNkZWZpbmUgV0RJX0NGR19GSVhFRF9SQVRFX1NUQU1JTiAgICAgICAgICAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgV0RJX0NGR19GSVhFRF9SQVRFX1NUQU1BWCAgICAgICAgICAgICAgICAgICAgICAgIDMxCisjZGVmaW5lIFdESV9DRkdfRklYRURfUkFURV9TVEFERUYgICAgICAgICAgICAgICAgICAgICAgICAwCisjZGVmaW5lIFdESV9DRkdfRklYRURfUkFURV9BVVRPICAgICAgICAgICAgICAgICAgICAgICAgICAwCisjZGVmaW5lIFdESV9DRkdfRklYRURfUkFURV8xTUJQUyAgICAgICAgICAgICAgICAgICAgICAgICAxCisjZGVmaW5lIFdESV9DRkdfRklYRURfUkFURV8yTUJQUyAgICAgICAgICAgICAgICAgICAgICAgICAyCisjZGVmaW5lIFdESV9DRkdfRklYRURfUkFURV81XzVNQlBTICAgICAgICAgICAgICAgICAgICAgICAzCisjZGVmaW5lIFdESV9DRkdfRklYRURfUkFURV8xMU1CUFMgICAgICAgICAgICAgICAgICAgICAgICA0CisjZGVmaW5lIFdESV9DRkdfRklYRURfUkFURV82TUJQUyAgICAgICAgICAgICAgICAgICAgICAgICA1CisjZGVmaW5lIFdESV9DRkdfRklYRURfUkFURV85TUJQUyAgICAgICAgICAgICAgICAgICAgICAgICA2CisjZGVmaW5lIFdESV9DRkdfRklYRURfUkFURV8xMk1CUFMgICAgICAgICAgICAgICAgICAgICAgICA3CisjZGVmaW5lIFdESV9DRkdfRklYRURfUkFURV8xO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IAorICAgICAgICAgICAgICBJIE4gVCBFIFIgTiBBIEwgICAgIEEgUCBJICAgICAgIEYgTyBSICAgIFQgSCBFCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEIEEgVCBBICAgUCBBIFQgSCAKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAKK0RFU0NSSVBUSU9OCisgIFRoaXMgZmlsZSBjb250YWlucyB0aGUgaW50ZXJuYWwgQVBJIGV4cG9zZWQgYnkgdGhlIERBTCBDb250cm9sIFBhdGggQ29yZSAKKyAgbW9kdWxlIHRvIGJlIHVzZWQgYnkgdGhlIERBTCBEYXRhIFBhdGggQ29yZS4gCisgIAorICAgICAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICBFRElUIEhJU1RPUlkgRk9SIEZJTEUKKworCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLgorICBOb3RpY2UgdGhhdCBjaGFuZ2VzIGFyZSBsaXN0ZWQgaW4gcmV2ZXJzZSBjaHJvbm9sb2dpY2FsIG9yZGVyLgorCisKKyAgJEhlYWRlcjokICREYXRlVGltZTogJCAkQXV0aG9yOiAkCisKKword2hlbiAgICAgICAgd2hvICAgIHdoYXQsIHdoZXJlLCB3aHkKKy0tLS0tLS0tICAgIC0tLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiswOC8xOS8xMCAgICBsdGkgICAgIENyZWF0ZWQgbW9kdWxlLgorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisjaW5jbHVkZSAid2xhbl9xY3RfcGFsX3R5cGUuaCIKKyNpbmNsdWRlICJ3bGFuX3FjdF93ZGlfaS5oIgorI2luY2x1ZGUgIndsYW5fcWN0X3dkaV9iZC5oIgorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gCisgICBCRCBNYWNybyBEZWZpbmVzICAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLyAKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBCRCBEZWZpbml0aW9ucyB1c2VkIGJ5IHRoZSBEQUwgZGF0YSBwYXRoIAorLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworI2RlZmluZSBXRElfVFhCRF9CRFJBVEVfREVGQVVMVCAwCisjZGVmaW5lIFdESV9UWEJEX0JEUkFURV9GSVJTVCAgIDEKKyNkZWZpbmUgV0RJX1RYQkRfQkRSQVRFX1NFQ09ORCAgMgorI2RlZmluZSBXRElfVFhCRF9CRFJBVEVfVEhJUkQgICAzCisKKyNkZWZpbmUgV0RJX0ZSQU1FX1RZUEVfTUFTSyAgICAgMHgzMAorI2RlZmluZSBXRElfRlJBTUVfVFlQRV9PRkZTRVQgICAweDQKKyNkZWZpbmUgV0RJX0ZSQU1FX1NVQlRZUEVfTUFTSyAgMHgwRgorCisjZGVmaW5lIFdESV9UWEJEX0JEX1NTTl9GSUxMX0hPU1QgICAgICAgICAwCisjZGVmaW5lIFdESV9UWEJEX0JEX1NTTl9GSUxMX0RQVV9OT05fUU9TICAxCisjZGVmaW5lIFdESV9UWEJEX0JEX1NTTl9GSUxMX0RQVV9RT1MgICAgICAyCisKKyNkZWZpbmUgV0RJX0FDS1BPTElDWV9BQ0tfUkVRVUlSRUQgICAgICAgIDAKKyNkZWZpbmUgV0RJX0FDS1BPTElDWV9BQ0tfTk9UUkVRVUlSRUQgICAgIDEKKworI2RlZmluZSBXRElfQkRSQVRFX0JDREFUQV9GUkFNRSAgICAgICAgICAgMQorI2RlZmluZSBXRElfQkRSQVRFX0JDTUdNVF9GUkFNRSAgICAgICAgICAgMgorI2RlZmluZSBXRElfQkRSQVRFX0NUUkxfRlJBTUUgICAgICAgICAgICAgMworICAgIAorLyogRGVmYXVsdCB2YWx1ZXMgZm9yIEZpbGxUeCBCRCAqLworI2RlZmluZSBXRElfREVGQVVMVF9VTklDQVNUX0VOQUJMRUQgICAgICAgMQorI2RlZmluZSBXRElfUk1GX0RJU0FCTEVEICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBXRElfUk1GX0VOQUJMRUQgICAgICAgICAgICAgICAgICAgMQorI2RlZmluZSBXRElfTk9fRU5DUllQVElPTl9ESVNBQkxFRCAgICAgICAgMAorI2RlZmluZSBXRElfTk9fRU5DUllQVElPTl9FTkFCTEVEICAgICAgICAgMQorICAgIAorI2RlZmluZSBXRElfUlhfQkRfQUREUjNfU0VMRl9JRFggICAgICAgICAgMAorCisjZGVmaW5lIFdESV9UWENPTVBfUkVRVUVTVEVEX01BU0sgICAgICAgICAgIDB4MSAgLy9iaXQgMCBmb3IgVHhDb21wIGludHIgcmVxdWVzdGVkLiAKKyNkZWZpbmUgV0RJX1VTRV9TRUxGX1NUQV9SRVFVRVNURURfTUFTSyAgICAgMHgyICAvL2JpdCAxIGZvciBTVEEgb3ZlcndyaXRlIHdpdGggc2VsZlN0YSBSZXF1ZXN0ZWQuCisjZGVmaW5lIFdESV9UWF9OT19FTkNSWVBUSU9OX01B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AgICAgICAgICAgIDB4MTAwMAorI2RlZmluZSBXRElfVVNFX0JEX1JBVEVfMl9NQVNLICAgICAgICAgICAgMHgyMDAwCisjZGVmaW5lIFdESV9VU0VfQkRfUkFURV8zX01BU0sgICAgICAgICAgICAweDQwMDAKKyNkZWZpbmUgV0RJX1VTRV9GV19JTl9UWF9QQVRIICAgICAgICAgICAgIDB4MjAwIC8vYml0IDkgdXNlZCB0byByb3V0ZSB0aGUgZnJhbWVzIHRvIFdvcmsgUXVldWUgNQorCisvKk1hY3JvIGZvciBnZXR0aW5nIHRoZSBzaXplIG9mIHRoZSBUWCBCRCovCisjZGVmaW5lIFdESV9UWF9CRF9IRUFERVJfU0laRSAgICAgICAgc2l6ZW9mKFdESV9UeEJkVHlwZSkKKworLypNYWNybyBmb3IgZ2V0dGluZyB0aGUgc2l6ZSBvZiB0aGUgUlggQkQqLworI2RlZmluZSBXRElfUlhfQkRfSEVBREVSX1NJWkUgICAgICAgIHNpemVvZihXRElfUnhCZFR5cGUpCisKKyNkZWZpbmUgV0RJX1JYX0JEX0hFQURFUl9PRkZTRVQgICAgICAgMAorCisjZGVmaW5lIFdESV9EUFVfRkVFREJBQ0tfT0ZGU0VUICAgICAgIDEKKworLy8gRnJhbWUgVHlwZSBkZWZpbml0aW9ucworCisjZGVmaW5lIFdESV9NQUNfTUdNVF9GUkFNRSAgICAweDAKKyNkZWZpbmUgV0RJX01BQ19DVFJMX0ZSQU1FICAgIDB4MQorI2RlZmluZSBXRElfTUFDX0RBVEFfRlJBTUUgICAgMHgyCisKKy8vIERhdGEgZnJhbWUgc3VidHlwZSBkZWZpbml0aW9ucworI2RlZmluZSBXRElfTUFDX0RBVEFfREFUQSAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBXRElfTUFDX0RBVEFfREFUQV9BQ0sgICAgICAgICAgICAgMQorI2RlZmluZSBXRElfTUFDX0RBVEFfREFUQV9QT0xMICAgICAgICAgICAgMgorI2RlZmluZSBXRElfTUFDX0RBVEFfREFUQV9BQ0tfUE9MTCAgICAgICAgMworI2RlZmluZSBXRElfTUFDX0RBVEFfTlVMTCAgICAgICAgICAgICAgICAgNAorI2RlZmluZSBXRElfTUFDX0RBVEFfTlVMTF9BQ0sgICAgICAgICAgICAgNQorI2RlZmluZSBXRElfTUFDX0RBVEFfTlVMTF9QT0xMICAgICAgICAgICAgNgorI2RlZmluZSBXRElfTUFDX0RBVEFfTlVMTF9BQ0tfUE9MTCAgICAgICAgNworI2RlZmluZSBXRElfTUFDX0RBVEFfUU9TX0RBVEEgICAgICAgICAgICAgOAorI2RlZmluZSBXRElfTUFDX0RBVEFfUU9TX0RBVEFfQUNLICAgICAgICAgOQorI2RlZmluZSBXRElfTUFDX0RBVEFfUU9TX0RBVEFfUE9MTCAgICAgICAgMTAKKyNkZWZpbmUgV0RJX01BQ19EQVRBX1FPU19EQVRBX0FDS19QT0xMICAgIDExCisjZGVmaW5lIFdESV9NQUNfREFUQV9RT1NfTlVMTCAgICAgICAgICAgICAxMgorI2RlZmluZSBXRElfTUFDX0RBVEFfUU9TX05VTExfQUNLICAgICAgICAgMTMKKyNkZWZpbmUgV0RJX01BQ19EQVRBX1FPU19OVUxMX1BPTEwgICAgICAgIDE0CisjZGVmaW5lIFdESV9NQUNfREFUQV9RT1NfTlVMTF9BQ0tfUE9MTCAgICAxNQorCisjZGVmaW5lIFdESV9NQUNfRlJBTUVfU1VCVFlQRV9TVEFSVCAgICAgICAwCisjZGVmaW5lIFdESV9NQUNfRlJBTUVfU1VCVFlQRV9FTkQgICAgICAgICAxNgorCisjZGVmaW5lIFdESV9NQUNfREFUQV9RT1NfTUFTSyAgICAgICAgICAgICA4CisjZGVmaW5lIFdESV9NQUNfREFUQV9OVUxMX01BU0sgICAgICAgICAgICA0CisjZGVmaW5lIFdESV9NQUNfREFUQV9QT0xMX01BU0sgICAgICAgICAgICAyCisjZGVmaW5lIFdESV9NQUNfREFUQV9BQ0tfTUFTSyAgICAgICAgICAgICAxCisKKy8vIE1hbmFnZW1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goV0RJX1J4QmRUeXBlKilfcHZCREhlYWRlciktPmxsYykKKworI2RlZmluZSBXRElfUlhfQkRfR0VUX1RJRCggX3B2QkRIZWFkZXIgKSAgICAgICAgKCgoV0RJX1J4QmRUeXBlKilfcHZCREhlYWRlciktPnRpZCkKKworI2RlZmluZSBXRElfUlhfQkRfR0VUX1JGQkFORCggX3B2QkRIZWFkZXIgKSAgICAgICAgKCgoV0RJX1J4QmRUeXBlKilfcHZCREhlYWRlciktPnJmQmFuZCkKKworI2RlZmluZSBXRElfUlhfQkRfR0VUX0FTRiggX3B2QkRIZWFkZXIgKSAgICAgICAgKCgoV0RJX1J4QmRUeXBlKilfcHZCREhlYWRlciktPmFzZikKKworI2RlZmluZSBXRElfUlhfQkRfR0VUX0FFRiggX3B2QkRIZWFkZXIgKSAgICAgICAgKCgoV0RJX1J4QmRUeXBlKilfcHZCREhlYWRlciktPmFlZikKKworI2RlZmluZSBXRElfUlhfQkRfR0VUX0xTRiggX3B2QkRIZWFkZXIgKSAgICAgICAgKCgoV0RJX1J4QmRUeXBlKilfcHZCREhlYWRlciktPmxzZikKKworI2RlZmluZSBXRElfUlhfQkRfR0VUX0VTRiggX3B2QkRIZWFkZXIgKSAgICAgICAgKCgoV0RJX1J4QmRUeXBlKilfcHZCREhlYWRlciktPmVzZikKKworI2RlZmluZSBXRElfUlhfQkRfR0VUX1NUQV9JRCggX3B2QkRIZWFkZXIgKSAgICAgKCgoV0RJX1J4QmRUeXBlKilfcHZCREhlYWRlciktPmFkZHIySW5kZXgpCisjZGVmaW5lIFdESV9SWF9CRF9HRVRfVUIoIF9wdkJESGVhZGVyICkgICAgICgoKFdESV9SeEJkVHlwZSopX3B2QkRIZWFkZXIpLT51YikKKyNkZWZpbmUgV0RJX1JYX0JEX0dFVF9BRERSM19JRFgoIF9wdkJESGVhZGVyICkgICgoKFdESV9SeEJkVHlwZSopX3B2QkRIZWFkZXIpLT5hZGRyM0luZGV4KQorI2RlZmluZSBXRElfUlhfQkRfR0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IZWFkZXIpICAgICAgICAoKChXRElfUnhCZFR5cGUqKV9wdkJESGVhZGVyKS0+cG1pQ21kMjR0bzI1KQorCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExVworI2RlZmluZSBXRElfUlhfQkRfR0VUX1JNRiggX3B2QkRIZWFkZXIgKSAgICAgICAgICgoKFdESV9SeEJkVHlwZSopX3B2QkRIZWFkZXIpLT5ybWYpCisjZW5kaWYKKworI2RlZmluZSBXRElfUlhfQkRfQVNGX1NFVCAgICAgICAgICAgICAgIDEgLypUaGUgdmFsdWUgb2YgdGhlIGZpZWxkIHdoZW4gc2V0IGFuZCBwa3QgaXMgQU1TRFUqLworCisjZGVmaW5lIFdESV9SWF9CRF9GU0ZfU0VUICAgICAgICAgICAgICAgMQorCisjZGVmaW5lIFdESV9SWF9CRF9MU0ZfU0VUICAgICAgICAgICAgICAgMQorCisjZGVmaW5lIFdESV9SWF9CRF9BRUZfU0VUICAgICAgICAgICAgICAgMQorCisgCisjZGVmaW5lIFdESV9SWF9CRF9MTENfUFJFU0VOVCAgICAgICAgICAgMCAvKlRoZSB2YWx1ZSBvZiB0aGUgZmllbGQgd2hlbiBMTEMgaXMgcHJlc2VudCovCisKKyNkZWZpbmUgV0RJX1JYX0JEX0ZUX0RPTkUgICAgICAgICAgICAgICAgMSAvKiBUaGUgdmFsdWUgb2YgdGhlIGZpZWxkIHdoZW4gZnJhbWUgeHRsIHdhcyBkb25lKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09IAorICAgQVBJIERlZmluaXRpb24gIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovIAorCisKKy8qKgorIEBicmllZiBXRElfUnhCRF9HZXRGcmFtZVR5cGVTdWJUeXBlIC0gQ2FsbGVkIGJ5IHRoZSBkYXRhIHBhdGggCisgICAgICAg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IGJ5IEhXCisgICAgIHBUeEJkOiAgICAgICAgICBwb2ludGVyIHRvIHRoZSBUWCBCRAorICAgICB1Y1R4RmxhZzogICAgICAgY2FuIGhhdmUgYXBwcm9wcmlhdGUgYml0IHNldHRpbmcgYXMgcmVxdWlyZWQKKyAgICAgdWNQcm90TWdtdEZyYW1lOiBmb3IgbWFuYWdlbWVudCBmcmFtZXMsIHdoZXRoZXIgdGhlIGZyYW1lIGlzCisgICAgICAgICAgICAgICAgICAgICAgcHJvdGVjdGVkIChwcm90ZWN0IGJpdCBpcyBzZXQgaW4gRkMpCisgICAgIHVUaW1lc3RhbXA6ICAgICBwa3QgdGltZXN0YW1wCisgIAorICAKKyBAcmV0dXJuIHN1Y2Nlc3Mgb3Igbm90CisqLworCitXRElfU3RhdHVzCitXRElfRmlsbFR4QmQKKygKKyAgICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsIAorICAgIHdwdF91aW50OCAgICAgICAgICAgICAgdWNUeXBlU3VidHlwZSwgCisgICAgdm9pZCogICAgICAgICAgICAgICAgICBwRGVzdE1hY0FkZHIsCisgICAgdm9pZCogICAgICAgICAgICAgICAgICBwQWRkcjIsCisgICAgd3B0X3VpbnQ4KiAgICAgICAgICAgICBwVGlkLCAKKyAgICB3cHRfdWludDggICAgICAgICAgICAgIHVjRGlzYWJsZUZybVh0bCwgCisgICAgdm9pZCogICAgICAgICAgICAgICAgICBwVHhCZCwgCisgICAgd3B0X3VpbnQzMiAgICAgICAgICAgICB1Y1R4RmxhZywKKyAgICB3cHRfdWludDggICAgICAgICAgICAgIHVjUHJvdE1nbXRGcmFtZSwKKyAgICB3cHRfdWludDMyICAgICAgICAgICAgIHVUaW1lU3RhbXAsCisgICAgd3B0X3VpbnQ4ICAgICAgICAgICAgICBpc0VhcG9sLAorICAgIHdwdF91aW50OCogICAgICAgICAgICAgc3RhSW5kZXgsCisgICAgd3B0X3VpbnQzMiAgICAgICAgICAgICB0eEJkVG9rZW4KKyk7CisKKy8qKgorIEBicmllZiBXRElfU3dhcFJ4QmQgc3dhcHMgdGhlIFJYIEJELgorCisgIAorIEBwYXJhbSBwQmQgLSBwb2ludGVyIHRvIHRoZSBCRCAoaW4vb3V0KQorICAKKyBAcmV0dXJuIE5vbmUKKyovCit2b2lkIAorV0RJX1N3YXBSeEJkCisoCisgIHdwdF91aW50OCAqcEJkCispOworCisvKioKKyBAYnJpZWYgV0RJX1N3YXBUeEJkIC0gU3dhcHMgdGhlIFRYIEJECisgIAorIEBwYXJhbSAgcEJkIC0gcG9pbnRlciB0byB0aGUgQkQgKGluL291dCkKKyAgCisgQHJldHVybiAgIG5vbmUKKyovCit2b2lkIAorV0RJX1N3YXBUeEJkCisoCisgIHdwdF91aW50OCAqcEJkCispOworCisvKioKKyBAYnJpZWYgV0RJX1J4QW1zZHVCZEZpeCAtIGZpeCBmb3IgSFcgaXNzdWUgZm9yIEFNU0RVIAorCisgIAorIEBwYXJhbSAgIHBXRElDdHg6ICAgICAgIENvbnRleHQgdG8gdGhlIFdESQorICAgICAgICAgIHBCREhlYWRlciAtIHBvaW50ZXIgdG8gdGhlIEJEIGhlYWRlcgorICAKKyBAcmV0dXJuIE5vbmUKKyovCit2b2lkIAorV0RJX1J4QW1zZHVCZEZpeAorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsIAorICB2b2lkKiAgICAgICAgICAgICAgICAgIHBCREhlYWRlcgorKTsKKworI2lmZGVmIFdMQU5fUEVSRgorLyoqCisgQGJyaWVmIFdESV9UeEJkRmFzdEZ3ZCAtIGV2YWx1YXRlcyBpZiBhIGZyYW1lIGNhbiBiZSBmYXN0IAorICAgICAgICBmb3J3YXJkZWQgCisgIAorIEBwYXJhbSAgIHBXRElDdHg6IENvbnRleHQgdG8gdGhlIFdESSAKKyAgICAgICAgICBwRGVzdE1hYzogRGVzdGluYXRpb24gTUFDCisgICAgICAgICAgdWNUaWQ6IHBhY2tldCBUSUQgcEJESGVhZGVyCisgICAgICAgICAg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T09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgVyBMIEEgTiAgIEQgRSBWIEkgQyBFICAgQSBCIFMgVCBSIEEgQyBUIEkgTyBOICAgTCBBIFkgRSBSIAorICAgICAgICAgICAgICBJIE4gVCBFIFIgTiBBIEwgICAgIEEgUCBJICAgICAgIEYgTyBSICAgIFQgSCBFCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEIEEgVCBBICAgUCBBIFQgSCAKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAKK0RFU0NSSVBUSU9OCisgIFRoaXMgZmlsZSBjb250YWlucyB0aGUgaW50ZXJuYWwgQVBJIGV4cG9zZWQgYnkgdGhlIERBTCBDb250cm9sIFBhdGggQ29yZSAKKyAgbW9kdWxlIHRvIGJlIHVzZWQgYnkgdGhlIERBTCBEYXRhIFBhdGggQ29yZS4KKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgIEVESVQgSElTVE9SWSBGT1IgRklMRQorCisKKyAgVGhpcyBzZWN0aW9uIGNvbnRhaW5zIGNvbW1lbnRzIGRlc2NyaWJpbmcgY2hhbmdlcyBtYWRlIHRvIHRoZSBtb2R1bGUuCisgIE5vdGljZSB0aGF0IGNoYW5nZXMgYXJlIGxpc3RlZCBpbiByZXZlcnNlIGNocm9ub2xvZ2ljYWwgb3JkZXIuCisKKworICAkSGVhZGVyOiQgJERhdGVUaW1lOiAkICRBdXRob3I6ICQKKworCit3aGVuICAgICAgICB3aG8gICAgd2hhdCwgd2hlcmUsIHdoeQorLS0tLS0tLS0gICAgLS0tICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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QSBNRUFTIFJlcXVlc3QqLworICBXRElfU1RBUlRfT0VNX0RBVEFfUkVRICAgPSA2MCwKKyAgLyogV0xBTiBob3N0IHJlc3VtZSByZXF1ZXN0ICovCisgIFdESV9IT1NUX1JFU1VNRV9SRVEgICAgICA9IDYxLAorICAKKyAgV0RJX0tFRVBfQUxJVkVfUkVRICAgICAgID0gNjIsICAKKworICAvKiBTZXQgUE5PICovCisgIFdESV9TRVRfUFJFRl9ORVRXT1JLX1JFUSAgICAgPSA2MywKKworICAvKlJTU0kgRmlsdGVyIFJlcXVlc3QqLworICBXRElfU0VUX1JTU0lfRklMVEVSX1JFUSAgICAgID0gNjQsCisKKyAgLyogVXBkYXRlIFNjYW4gUGFyYW1ldGVycyovCisgIFdESV9VUERBVEVfU0NBTl9QQVJBTVNfUkVRICAgPSA2NSwKKworICBXRElfU0VUX1RYX1BFUl9UUkFDS0lOR19SRVEgPSA2NiwKKworICBXRElfODAyM19NVUxUSUNBU1RfTElTVF9SRVEgICAgICAgICAgICAgICAgICAgPSA2NywKKyAgV0RJX1JFQ0VJVkVfRklMVEVSX1NFVF9GSUxURVJfUkVRICAgICAgICAgICAgID0gNjgsCisgIFdESV9QQUNLRVRfQ09BTEVTQ0lOR19GSUxURVJfTUFUQ0hfQ09VTlRfUkVRICA9IDY5LAorICBXRElfUkVDRUlWRV9GSUxURVJfQ0xFQVJfRklMVEVSX1JFUSAgICAgICAgICAgPSA3MCwKKyAgCisgIC8qVGhpcyBpcyB0ZW1wIGZpeC4gU2hvdWxkIGJlIHJlbW92ZWQgb25jZSAKKyAgICogSG9zdCBhbmQgUml2YSBjb2RlIGlzIGluIHN5bmMqLworICBXRElfSU5JVF9TQ0FOX0NPTl9SRVEgICAgICAgICAgICAgICAgICAgICAgICAgPSA3MSwgCisKKyAgLyogV0xBTiBIQUwgRFVNUCBDb21tYW5kIHJlcXVlc3QgKi8KKyAgV0RJX0hBTF9EVU1QX0NNRF9SRVEgICAgICAgICAgICAgICAgICAgICAgICAgID0gNzIsCisKKyAgLyogV0xBTiBEQUwgU2h1dGRvd24gUmVxdWVzdCAqLworICBXRElfU0hVVERPV05fUkVRICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSA3MywKKworICAvKlNldCBwb3dlciBwYXJhbWV0ZXJzIG9uIHRoZSBkZXZpY2UqLworICBXRElfU0VUX1BPV0VSX1BBUkFNU19SRVEgICAgICAgICAgICAgICAgICAgICAgPSA3NCwKKworICAvKiBUcmFmZmljIFN0cmVhbSBNZXRyaWNzIHN0YXRpc3RpYyByZXF1ZXN0ICovCisgIFdESV9UU01fU1RBVFNfUkVRICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IDc1LAorICAvKiBHVEsgUmVrZXkgT2ZmbG9hZCAqLworICBXRElfR1RLX09GRkxPQURfUkVRICAgICAgICAgICAgID0gNzYsIAorICBXRElfR1RLX09GRkxPQURfR0VUSU5GT19SRVEgICA9IDc3LCAKKworICAvKlNldCBUaGVybWFsIE1pZ3JhdGlvbiBsZXZlbCB0byBSSVZBKi8KKyAgV0RJX1NFVF9UTV9MRVZFTF9SRVEgICAgICAgICAgICAgICAgICAgICAgICAgID0gNzgsIAorCisgIC8qIFNlbmQgYSBjYXBhYmlsaXR5IGV4Y2hhbmdlIG1lc3NhZ2UgdG8gSEFMICovCisgIFdESV9GRUFUVVJFX0NBUFNfRVhDSEFOR0VfUkVRICAgICAgICAgICAgICAgICA9IDc5LAorCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExQUMKKyAgLyogU2VuZCBhIGNhcGFiaWxpdHkgZXhjaGFuZ2UgbWVzc2FnZSB0byBIQUwgKi8KKyAgV0RJX1VQREFURV9WSFRfT1BfTU9ERV9SRVEgICAgICAgICAgICAgICAgICAgID0gODAsCisjZW5kaWYKKworICAvKldMQU4gREFMIEdldCBSb2FtIFJzc2kgUmVxdWVzdCovCisgIFdESV9HRVRfUk9BTV9SU1NJX1JFUSAgICAgICAgICAgICAgICAgICAgICAgICA9IDgxLAorCisgIC8qV0xBTiBEQUwgU2V0IFR4IFBvd2VyIFJlcXVlc3QqLworICBXRElfU0VUX1RYX1BPV0VSX1JFUSAgICAgICAgICAgICAgICAgICAgICAgICAgPSA4MiwKKyAgV0RJX1JPQU1fU0NBTl9PRkZMT0FEX1JFUSAgICAgICAgICAgICAgICAgICAgID0gODMsCisKKyAgV0RJX1RETFNfTElOS19FU1RBQkxJU0hfUkVRICAgICAgICAgICAgICAgICAgID0gODQsCisKKyAgLyogV0xBTiBGVyBMUEhCIGNvbmZpZyByZXF1ZXN0ICovCisgIFdESV9MUEhCX0NGR19SRVEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IDg1LAorCisgIC8qIFdMQU4gRlcgc2V0IGJhdGNoIHNjYW4gcmVxdWVzdCAqLworICBXRElfU0VUX0JBVENIX1NDQU5fUkVRICAgICAgICAgICAgICAgICAgICAgICAgPSA4NiwKKworICAvKldMQU4gREFMIFNldCBNYXggVHggUG93ZXIgUGVyIGJhbmQgUmVxdWVzdCovCisgIFdESV9TRVRfTUFYX1RYX1BPV0VSX1BFUl9CQU5EX1JFUSAgICAgICAgICAgICA9IDg3LAorCisgIFdESV9VUERBVEVfQ0hBTl9SRVEgICAgICAgICAgICAgICAgICAgICAgICAgICA9IDg4LAorCisgIFdESV9HRVRfQkNOX01JU1NfUkFURV9SRVEgICAgICAgICAgICAgICAgICAgICA9IDg5LAorCisjaWZkZWYgV0xBTl9GRUFUVVJFX0xJTktfTEFZRVJfU1RBVFMKKyAgV0RJX0xMX1NUQVRTX1NFVF9SRVEgICAgICAgICAgICAgICAgICAgICAgICAgID0gOTAsCisgIFdESV9MTF9TVEFUU19HRVRfUkVRICAgICAgICAgICAgICAgICAgICAgICAgICA9IDkxLAorICBXRElfTExfU1RBVFNfQ0xFQVJfUkVRICAgICAgICAgICAgICAgICAgICAgICAgPSA5MiwKKyNlbmRpZgorCisjaWZkZWYgV0xBTl9GRUFUVVJFX0VYVFNDQU4KKyAgV0RJX0VYVFNDQU5fU1RBUlRfUkVRICAgICAgICAgICAgICAgICAgICAgICAgICA9IDkzLAorICBXRElfRVhUU0NBTl9TVE9QX1JFUSAgICAgICAgICAgICAgICAgICAgICAgICAgID0gOTQsCisgIFdESV9FWFRTQ0FOX0dFVF9DQUNIRURfUkVTVUxUU19SRVEgICAgICAgICAgICAgPSA5NSwKKyAgV0RJX0VYVFNDQU5fR0VUX0NBUEFCSUxJVElFU19SRVEgICAgICAgICAgICAgICA9IDk2LAorICBXRElfRVhUU0NBTl9TRVRfQlNTSURfSE9UTElTVF9SRVEgICAgICAgICAgICAgID0gOTcsCisgIFdESV9FWFRTQ0FOX1JFU0VUX0JTU0lEX0hPVExJU1RfUkVRICAgICAgICAgICAgPSA5OCwKKyAgV0RJX0VYVFNDQU5fU0VUX1NJR05GX1JTU0lfQ0hBTkdFX1JFUSAgICAgICAgICA9IDk5LAorICBXRElfRVhUU0NBTl9SRVNFVF9TSUdORl9SU1NJX0NIQU5HRV9SRVEgICAgICAgID0gMTAwLAorI2VuZGlmCisKKyAgV0RJX1NQT09GX01BQ19BRERSX1JFUSAgICAgICAgICAgICAgICAgICAgICAgICA9IDEwMSwKKworICBXRElfR0VUX0ZXX1NUQVRTX1JFUSAgICAgICAgICAgICAgICAgICAgICAgICAgID0gMTAyLAorCisgIC8qIFNlbmQgY29tbWFuZCB0byBlbmNyeXB0IHRoZSBnaXZlbiBtZXNzYWdlICovCisgIFdESV9FTkNSWVBUX01TR19SRVEgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSAxMDMsCisKKyAgV0RJX0ZXX0xPR0dJTkdfSU5JVF9SRVEgICAgICAgICAgICAgICAgICAgICAgICA9IDEwNCwKKyAgV0RJX0dFVF9GUkFNRV9MT0dfUkVRICAgICAgICAgICAgICAgICAgICAgICAgICA9IDEwNSwKKworICAvKiBOQU4gUmVxdWVzdCAqLworICBXRElfTkFOX1JFUVVFU1QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gMTA2LAorCisgIFdESV9NT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AgICAgICA9IDY2LAorCisKKyAgCisgIC8qIFBhY2tldCBGaWx0ZXJpbmcgUmVzcG9uc2UgKi8KKyAgV0RJXzgwMjNfTVVMVElDQVNUX0xJU1RfUkVTUCAgICAgICAgICAgICAgICAgID0gNjcsCisKKyAgV0RJX1JFQ0VJVkVfRklMVEVSX1NFVF9GSUxURVJfUkVTUCAgICAgICAgICAgID0gNjgsCisKKyAgV0RJX1BBQ0tFVF9DT0FMRVNDSU5HX0ZJTFRFUl9NQVRDSF9DT1VOVF9SRVNQID0gNjksCisKKyAgV0RJX1JFQ0VJVkVfRklMVEVSX0NMRUFSX0ZJTFRFUl9SRVNQICAgICAgICAgID0gNzAsCisKKyAgCisgIC8qIFdMQU4gSEFMIERVTVAgQ29tbWFuZCBSZXNwb25zZSAqLworICBXRElfSEFMX0RVTVBfQ01EX1JFU1AgICAgICAgICAgICAgICAgICAgICAgICAgPSA3MSwKKworICAvKiBXTEFOIFNodXRkb3duIFJlc3BvbnNlICovCisgIFdESV9TSFVURE9XTl9SRVNQICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IDcyLAorCisgIC8qU2V0IHBvd2VyIHBhcmFtZXRlcnMgcmVzcG9uc2UgKi8KKyAgV0RJX1NFVF9QT1dFUl9QQVJBTVNfUkVTUCAgICAgICAgICAgICAgICAgICAgID0gNzMsCisKKyAgV0RJX1RTTV9TVEFUU19SRVNQICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gNzQsCisgIC8qIEdUSyBSZWtleSBPZmZsb2FkICovCisgIFdESV9HVEtfT0ZGTE9BRF9SRVNQICAgICAgICAgICAgICAgICAgICAgICAgICA9IDc1LCAKKyAgV0RJX0dUS19PRkZMT0FEX0dFVElORk9fUkVTUCAgICAgICAgICAgICAgICAgID0gNzYsIAorCisgIFdESV9TRVRfVE1fTEVWRUxfUkVTUCAgICAgICAgICAgICAgICAgICAgICAgICA9IDc3LAorCisgIC8qIEZXIHNlbmRzIGl0cyBjYXBhYmlsaXR5IGJpdG1hcCBhcyBhIHJlc3BvbnNlICovCisgIFdESV9GRUFUVVJFX0NBUFNfRVhDSEFOR0VfUkVTUCAgICAgICAgICAgICAgICA9IDc4LAorCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExQUMKKyAgV0RJX1VQREFURV9WSFRfT1BfTU9ERV9SRVNQICAgICAgICAgICAgICAgICAgID0gNzksCisjZW5kaWYKKworICAvKiBXTEFOIERBTCBHZXQgUm9hbSBSc3NpIFJlc3BvbnNlKi8KKyAgV0RJX0dFVF9ST0FNX1JTU0lfUkVTUCAgICAgICAgICAgICAgICAgICAgICAgID0gODAsCisKKyAgV0RJX1NFVF9UWF9QT1dFUl9SRVNQICAgICAgICAgICAgICAgICAgICAgICAgID0gODEsCisgIFdESV9ST0FNX1NDQU5fT0ZGTE9BRF9SRVNQICAgICAgICAgICAgICAgICAgICA9IDgyLAorCisgIFdESV9URExTX0xJTktfRVNUQUJMSVNIX1JFUV9SRVNQICAgICAgICAgICAgICA9IDgzLAorCisgIC8qIFdMQU4gRlcgTFBIQiBDb25maWcgcmVzcG9uc2UgKi8KKyAgV0RJX0xQSEJfQ0ZHX1JFU1AgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gODQsCisKKyAgV0RJX1NFVF9CQVRDSF9TQ0FOX1JFU1AgICAgICAgICAgICAgICAgICAgICAgID0gODUsCisKKyAgV0RJX1NFVF9NQVhfVFhfUE9XRVJfUEVSX0JBTkRfUlNQICAgICAgICAgICAgID0gODYsCisKKyAgV0RJX1VQREFURV9DSEFOX1JFU1AgICAgICAgICAgICAgICAgICAgICAgICAgID0gODcsCisgIC8qIGNoYW5uZWwgc3dpdGNoIHJlc3AgdjEqLworICBXRElfQ0hfU1dJVENIX1JFU1BfVjEgICAgICAgICAgICAgICAgICAgICAgICAgPSA4OCwKKworICBXRElfR0VUX0JDTl9NSVNTX1JBVEVfUlNQICAgICAgICAgICAgICAgICAgICAgPSA4OSwKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfTElOS19MQVlFUl9TVEFUUworICBXRElfTExfU1RBVFNfU0VUX1JTUCAgICAgICAgICAgICAgICAgICAgICAgICAgPSA5MCwKKyAgV0RJX0xMX1NUQVRTX0dFVF9SU1AgICAgICAgICAgICAgICAgICAgICAgICAgID0gOTEsCisgIFdESV9MTF9TVEFUU19DTEVBUl9SU1AgICAgICAgICAgICAgICAgICAgICAgICA9IDkyLAorI2VuZGlmCisKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfRVhUU0NBTgorICBXRElfRVhUU0NBTl9TVEFSVF9SU1AgICAgICAgICAgICAgICAgICAgICAgICAgID0gOTMsCisgIFdESV9FWFRTQ0FOX1NUT1BfUlNQICAgICAgICAgICAgICAgICAgICAgICAgICAgPSA5NCwKKyAgV0RJX0VYVFNDQU5fR0VUX0NBQ0hFRF9SRVNVTFRTX1JTUCAgICAgICAgICAgICA9IDk1LAorICBXRElfRVhUU0NBTl9HRVRfQ0FQQUJJTElUSUVTX1JTUCAgICAgICAgICAgICAgID0gOTYsCisgIFdESV9FWFRTQ0FOX1NFVF9IT1RMSVNUX0JTU0lEX1JTUCAgICAgICAgICAgICAgPSA5NywKKyAgV0RJX0VYVFNDQU5fUkVTRVRfSE9UTElTVF9CU1NJRF9SU1AgICAgICAgICAgICA9IDk4LAorICBXRElfRVhUU0NBTl9TRVRfU0lHTkZfUlNTSV9DSEFOR0VfUlNQICAgICAgICAgID0gOTksCisgIFdESV9FWFRTQ0FOX1JFU0VUX1NJR05GX1JTU0lfQ0hBTkdFX1JTUCAgICAgICAgPSAxMDAsCisjZW5kaWYKKyAgV0RJX1NQT09GX01BQ19BRERSX1JTUCAgICAgICAgICAgICAgICAgICAgICAgICA9IDEwMSwKKyAgV0RJX0dFVF9GV19TVEFUU19SU1AgICAgICAgICAgICAgICAgICAgICAgICAgICA9IDEwMiwKKworICAvKiBTZW5kIGNvbW1hbmQgdG8gZW5jcnlwdCB0aGUgZ2l2ZW4gbWVzc2FnZSAqLworICBXRElfRU5DUllQVF9NU0dfUlNQICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gMTAzLAorCisgIFdESV9GV19MT0dHSU5HX0lOSVRfUlNQICAgICAgICAgICAgICAgICAgICAgICAgPSAxMDQsCisgIFdESV9HRVRfRlJBTUVfTE9HX1JTUCAgICAgICAgICAgICAgICAgICAgICAgICAgPSAxMDUsCisKKyAgV0RJX05BTl9SRVNQT05TRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IDEwNiwKKworICBXRElfTU9OX1NUQVJUX1JTUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gMTA3LAorICBXRElfTU9OX1NUT1BfUlNQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gMTA4LAorICBXRElfRkFUQUxfRVZFTlRfTE9HR0lOR19SU1AgICAgICAgICAgICAgICAgICAgID0gMTA5LAorCisgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgIEluZGljYXRpb25zCisgICAgICEhIEtlZXAgdGhlc2UgbGFzdCBpbiB0aGUgZW51bSBpZiBwb3NzaWJsZQorICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworICBXRElfSEFMX0lORF9NSU4gICAgICAgICAgICAgICAgICAgICAsIAorICAvKldoZW4gUlNTSSBtb25pdG9yaW5nIGlzIGVuYWJsZWQgb2YgdGhlIExvd2VyIE1BQyBhbmQgYSB0aHJlc2hvbGQgaGFzIGJlZW4KKyAgICBwYXNzZWQuICovCisgIFdESV9IQUxfUlNTSV9OT1RJRklDQVRJT05fSU5EICAgICAgID0gV0RJX0hBTF9JTkRfTUlOLCAKKworICAvKkxpbmsgbG9zcyBpbiB0aGUgbG93IE1BQyAqLworICBXRElfSEFMX01JU1NFRF9CRUFDT05fSU5EICAgICAgICAgICA9IFdESV9IQUxfSU5EX01JTiArIDEsCisKKyAgLypXaGVuIGhhcmR3YXJlIGhhcyBzaWduYWxlZCBhbiB1bmtub3duIGFkZHIyIGZyYW1lcy4gVGhlIGluZGljYXRpb24gd2lsbAorICBjb250YWluIGluZm8gZnJvbSBmcmFtZXMgdG8gYmUgcGFzc2VkIHRvIHRoZSBVTUFDLCB0aGlzIG1heSB1c2UgdGhpcyBpbmZvIHRvCisgIGRlYXV0aCB0aGUgU1RBKi8KKyAgV0RJX0hBTF9VTktOT1dOX0FERFIyX0ZSQU1FX1JYX0lORCAgPSBXRElfSEFMX0lORF9NSU4gKyAyLAorCisgIC8qTUlDIEZhaWx1cmUgZGV0ZWN0ZWQgYnkgSFcqLworICBXRElfSEFMX01JQ19GQUlMVVJFX0lORCAgICAgICAgICAgICA9IFdESV9IQUxfSU5EX01JTiArIDMsCisKKyAgLypGYXRhbCBFcnJvciBJbmQqLworICBXRElfSEFMX0ZBVEFMX0VSUk9SX0lORCAgICAgICAgICAgICA9IFdESV9IQUxfSU5EX01JTiArIDQsIAorCisgIC8qUmVjZWl2ZWQgd2hlbiB0aGUgUklWQSBTVyBkZWNpZGVzIHRvIGF1dG9ub21vdXNseSBkZWxldGUgYW4gYXNzb2NpYXRlCisgICAgc3RhdGlvbiAoZS5nLiBTb2Z0IEFQIFRJTSBiYXNlZCBkaXNzYXNzb2MpICovCisgIFdESV9IQUxfREVMX1NUQV9JTkQgICAgICAgICAgICAgICAgID0gV0RJX0hBTF9JTkRfTUlOICsgNSwKKworICAvKkNvZXggaW5kaWNhdGlvbiovCisgIFdESV9IQUxfQ09FWF9JTkQgICAgICAgICAgICAgICAgICAgID0gV0RJX0hBTF9JTkRfTUlOICsgNiwKKworICAvKiBUeCBDb21wbGV0ZSBJbmRpY2F0aW9uICovCisgIFdESV9IQUxfVFhfQ09NUExFVEVfSU5EICAgICAgICAgICAgID0gV0RJX0hBTF9JTkRfTUlOICsgNywKKworICBXRElfSEFMX1AyUF9OT0FfQVRUUl9JTkQgICAgICAgICAgICA9IFdESV9IQUxfSU5EX01JTiArIDgsCisKKyAgLyogUHJlZmVycmVkIE5ldHdvcmsgRm91bmQgSW5kaWNhdGlvbiAqLworICBXRElfSEFMX1BSRUZfTkVUV09SS19GT1VORF9JTkQgICAgICA9IFdESV9IQUxfSU5EX01JTiArIDksCisKKyAgLyogV2FrZXVwIFJlYXNvbiBJbmRpY2F0aW9uICovCisgIFdESV9IQUxfV0FLRV9SRUFTT05fSU5EICAgICAgICAgICAgICA9IFdESV9IQUxfSU5EX01JTiArIDEwLAorCisgIC8qIFR4IFBFUiBIaXQgSW5kaWNhdGlvbiAqLworICBXRElfSEFMX1RYX1BFUl9ISVRfSU5EICAgICAgICAgICAgICA9IFdESV9IQUxfSU5EX01JTiArIDExLAorCisgIC8qIE5PQSBTdGFydCBJbmRpY2F0aW9uIGZyb20gRlcgdG8gSG9zdCAqLworICBXRElfSEFMX1AyUF9OT0FfU1RBUlRfSU5EICAgICAgICAgICAgPSBXRElfSEFMX0lORF9NSU4gKyAxMiwKKworICAvKiBURExTIEluZGljYXRpb24gZnJvbSBGVyB0byBIb3N0ICovCisgIFdESV9IQUxfVERMU19JTkQgICAgICAgICAgICAgICAgICAgICA9IFdESV9IQUxfSU5EX01JTiArIDEzLAorCisgIC8qIExQSEIgdGltZW91dCBpbmRpY2F0aW9uICovCisgIFdESV9IQUxfTFBIQl9JTkQgICAgICAgICAgICAgICAgICAgICA9IFdESV9IQUxfSU5EX01JTiArIDE0LAorCisgIC8qIElCU1MgUGVlciBJbmFjdGl2aXR5IEluZGljYXRpb24gZnJvbSBGVyB0byBIb3N0ICovCisgIFdESV9IQUxfSUJTU19QRUVSX0lOQUNUSVZJVFlfSU5EICAgICA9IFdESV9IQUxfSU5EX01JTiArIDE1LAorCisgIC8qIFBlcmlvZGljIFR4IFBhdHRlcm4gSW5kaWNhdGlvbiBmcm9tIEZXIHRvIEhvc3QgKi8KKyAgV0RJ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Q4ICAgICAgICAgICAgICAgICAgIHVjTWF4QnNzaWRzOworCisgIC8qIEdsb2JhbCBCU1MgYW5kIFNUQSB0YWJsZSAtICBNZW1vcnkgaXMgYWxsb2NhdGVkIHdoZW4gbmVlZGVkLiovCisgIHZvaWQqICAgICAgICAgICAgICAgICAgICAgICBzdGFUYWJsZTsKKworI2lmbmRlZiBIQUxfU0VMRl9TVEFfUEVSX0JTUworICAvKkluZGV4IG9mIHRoZSBTZWxmIFNUQSAqLworICB3cHRfdWludDggICAgICAgICAgICAgICAgICAgdWNTZWxmU3RhSWQ7CisKKyAgLyogU2VsZiBTVEEgRFBVIEluZGV4ICovCisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICB1c1NlbGZTdGFEcHVJZDsKKworICAvKlNlbGYgU1RBIE1hYyovCisgIHdwdF9tYWNBZGRyICAgICAgICAgICAgICAgICBtYWNTZWxmU3RhOworI2VuZGlmCisKKyAgLypJcyBmcmFtZSB0cmFuc2xhdGlvbiBlbmFibGVkICovCisgIHdwdF91aW50OCAgICAgICAgICAgICAgICAgICBiRnJhbWVUcmFuc0VuYWJsZWQ7CisKKyAgLypBTVNEVSBCRCBGaXggTWFzayAtIHVzZWQgYnkgdGhlIEZpeGluZyByb3V0aW5lIGZvciBEYXRhIFBhdGggKi8KKyAgV0RJX1J4QmRUeXBlICAgICAgICAgICAgICAgIHdkaVJ4QW1zZHVCZEZpeE1hc2s7CisKKyAgLypGaXJzdCBBTVNEVSBCRCAtIHVzZWQgYnkgdGhlIEZpeGluZyByb3V0aW5lIGZvciBEYXRhIFBhdGggKi8KKyAgV0RJX1J4QmRUeXBlICAgICAgICAgICAgICAgIHdkaVJ4QW1zZHVGaXJzdEJkQ2FjaGU7CisKKyAgLypUaGlzIG11c3QgYmUgaW5jcmVtZW50ZWQgb24gc3RhIGNoYW5nZSAqLworICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgdUJkU2lnU2VyaWFsTnVtOworCisgIC8qIGRwdSByb3V0aW5n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cltXRElfRlRNX01BWF9SRUNFSVZFX0JVRkZFUl07CisKKyAgLypEcml2ZXIgaW4gQk1QUyBzdGF0ZSovCisgIHdwdF9ib29sZWFuICAgICAgICAgICAgICAgICBiSW5CbXBzOworCisgIC8qdmVyc2lvbiBvZiB0aGUgUE5PIGltcGxlbWVudGF0aW9uIGluIFJJVkEqLworICB3cHRfdWludDggICAgICAgICAgICAgICAgICAgd2RpUE5PVmVyc2lvbjsKKworICAvKlNTUiB0aW1lciovCisgIHdwdF90aW1lciAgICAgICAgICAgICAgICAgICBzc3JUaW1lcjsKKworICAvKlZlcnNpb24gb2YgdGhlIFdMQU4gSEFMIEFQSSByZWNlaXZlZCBvbiBzdGFydCByZXNwKi8KKyAgV0RJX1dsYW5WZXJzaW9uVHlwZSB3bGFuVmVyc2lvbjsKKworICAvKnRpbWVzdGFtcCB3aGVuIHdlIHN0YXJ0IHJlc3BvbnNlIHRpbWVyKi8KKyAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgIHVUaW1lU3RhbXBSc3BUbXJTdGFydDsKKworICAvKnRpbWVzdGFtcCB3aGVuIHdlIGdldCByZXNwb25zZSB0aW1lciBldmVudCovCisgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICB1VGltZVN0YW1wUnNwVG1yRXhwOworCisgIC8qIGVuYWJsZS9kaXNhYmxlIFNTUiBvbiBXREkgdGltZW91dCAqLworICB3cHRfYm9vbGVhbiAgICAgICAgICAgICAgICAgYkVuYWJsZVNTUjsKKworICAvKiB0aW1lc3RhbXAgZGVyaXZlZCBmcm9tIG1zbSBhcmNoIGNvdW50ZXIuICovCisgIC8qdGltZXN0YW1wIHdoZW4gd2Ugc3RhcnQgcmVzcG9uc2UgdGltZXIqLworICB3cHRfdWludDY0ICAgICAgICAgICAgICAgICAgdUFyY2hUaW1lU3RhbXBSc3BUbXJTdGFydDsKKworICAvKnRpbWVzdGFtcCB3aGVuIHdlIGdldCByZXNwb25zZSB0aW1lciBldmVudCovCisgIHdwdF91aW50NjQgICAgICAgICAgICAgICAgICB1QXJjaFRpbWVTdGFtcFJzcFRtckV4cDsKKworICAvKiByZWFzb24gZm9yIFdESV9EZXRlY3RlZERldmljZUVycm9yICovCisgIHZvaWQgKiAgICAgICAgICAgICAgICAgICAgICAgIERldmljZUVycm9yUmVhc29uOworCisgICAvKiBSb2FtIGRlbGF5IHN0YXRpc3RpYyBlbmFibGVkIGluIGluaSovCisgICB3cHRfdWludDggICAgICAgICAgICAgICAgICByb2FtRGVsYXlTdGF0c0VuYWJsZWQ7Cit9V0RJX0NvbnRyb2xCbG9ja1R5cGU7IAorCisKKworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIERFU0NSSVBUSU9OIAorICAgIFdMQU4gREFMIFJlcXVlc3QgUHJvY2Vzc2luZyBmdW5jdGlvbiBkZWZpbml0aW9uLiAKKyAgICAKKyAgUEFSQU1FVEVSUyAKKworICAgSU4KKyAgIHBXRElDdHg6ICAgICAgICAgcG9pbnRlciB0byB0aGUgV0xBTiBEQUwgY29udGV4dCAKKyAgIHBFdmVudERhdGE6ICAgICAgcG9pbnRlciB0byB0aGUgZXZlbnQgaW5mb3JtYXRpb24gc3RydWN0dXJlIAorIAorICAgCisgIFJFVFVSTiBWQUxVRQorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKworLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KK3R5cGVkZWYgV0RJX1N0YXR1cyAoKldESV9SZXFQcm9jRnVuY1R5cGUpKCBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgICAgICAgICAgICAgICAgICAgIC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XZlbnREYXRhKTsKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgTUFJTiBEQUwgRlNNIEVudHJ5IHR5cGUKKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovICAgICAgCit0eXBlZGVmIHN0cnVjdAoreworICBXRElfTWFpbkZ1bmNUeXBlICBwZm5NYWluVGJsW1dESV9NQVhfRVZFTlRdOworfSBXRElfTWFpbkZzbUVudHJ5VHlwZTsKKworLypNYWNybyB0byBjaGVjayBmb3IgdmFsaWQgc2Vzc2lvbiBpZCovCisjZGVmaW5lIFdESV9WQUxJRF9TRVNTSU9OX0lEWChfaWR4KSAgKCBfaWR4IDwgV0RJX01BWF9CU1NfU0VTU0lPTlMgKSAKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAKKyAKKyAgICAgICAgICAgICAgICAgICAgICBEQUwgSU5URVJOQUwgRlVOQ1RJT04gREVDTEFSQVRJT04KKyAKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8gCisKKy8qKgorIEBicmllZiBIZWxwZXIgcm91dGluZSBmb3IgcmV0cmlldmluZyB0aGUgUEFMIENvbnRleHQgZnJvbSBXREkgLSAKKyAgICAgICAgY2FuIGJlIHVzZWQgYnkgQ1RTLCBEVFMsIERYRSBhbmQgb3RoZSBEQUwgaW50ZXJuYWxzIAorIAorIEBwYXJhbSAgTm9uZQorICAKKyBAc2VlCisgQHJldHVybiBwb2ludGVyIHRvIHRoZSBjb250ZXh0IAorKi8KK3ZvaWQqIFdESV9HRVRf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1bmN0aW9uIGNhbGwKKyovCitXRElfU3RhdHVzCitXRElfTWFpbkNsb3NlQnVzeQorKCAKKyAgV0RJX0NvbnRyb2xCbG9ja1R5cGUqICBwV0RJQ3R4LAorICBXRElfRXZlbnRJbmZvVHlwZSogICAgIHBFdmVudERhdGEKKyk7CisKKy8qKgorIEBicmllZiBNYWluIEZTTSBTaHV0ZG93biBmdW5jdGlvbiBmb3IgSU5JVCAmIFNUQVJURUQgc3RhdGVzCisKKworIEBwYXJhbSAgcFdESUN0eDogICAgICAgICBwb2ludGVyIHRvIHRoZSBXTEFOIERBTCBjb250ZXh0CisgICAgICAgICBwRXZlbnREYXRhOiAgICAgIHBvaW50ZXIgdG8gdGhlIGV2ZW50IGluZm9ybWF0aW9uIHN0cnVjdHVyZQorCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cworV0RJX01haW5TaHV0ZG93bgorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKTsKKworLyoqCisgQGJyaWVmIE1haW4gRlNNIFNodXRkb3duIGZ1bmN0aW9uIGZvciBCVVNZIHN0YXRlCisKKworIEBwYXJhbSAgcFdESUN0eDogICAgICAgICBwb2ludGVyIHRvIHRoZSBXTEFOIERBTCBjb250ZXh0CisgICAgICAgICBwRXZlbnREYXRhOiAgICAgIHBvaW50ZXIgdG8gdGhlIGV2ZW50IGluZm9ybWF0aW9uIHN0cnVjdHVyZQorCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cworV0RJX01haW5TaHV0ZG93bkJ1c3kKKygKKyAgV0RJX0NvbnRyb2xCbG9ja1R5cGUqICBwV0RJQ3R4LAorICBXRElfRXZlbnRJbmZvVHlwZSogICAgIHBFdmVudERhdGEKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAgICAgTWFpbiBEQUwgQ29udHJvbCBQYXRoIFJlcXVlc3QgUHJvY2Vzc2luZyBBUEkgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKioKKyBAYnJpZWYgUHJvY2VzcyBTdGFydCBSZXF1ZXN0IGZ1bmN0aW9uIChjYWxsZWQgd2hlbiBNYWluIEZTTSAKKyAgICAgICAgYWxsb3dzIGl0KQorIAorIEBwYXJhbSAgcFdESUN0eDogICAgICAgICBwb2ludGVyIHRvIHRoZSBXTEFOIERBTCBjb250ZXh0IAorICAgICAgICAgcEV2ZW50RGF0YTogICAgICBwb2ludGVyIHRvIHRoZSBldmVudCBpbmZvcm1hdGlvbiBzdHJ1Y3R1cmUgCisgIAorIEBzZWUKKyBAcmV0dXJuIFJlc3VsdCBvZiB0aGUgZnVuY3Rpb24gY2FsbAorKi8KK1dESV9TdGF0dXMKK1dESV9Qcm9jZXNzU3RhcnRSZXEKKyggCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispOworCisKKy8qKgorIEBicmllZiBQcm9jZXNzIFN0b3AgUmVxdWVzdCBmdW5jdGlvbiAoY2FsbGVkIHdoZW4gTWFpbiBGU00gCisgICAgICAgIGFsbG93cyBpdCkKKyAKKyBAcGFyYW0gIHBXRElDdHg6ICAgICAgICAgcG9pbnRlciB0byB0aGUgV0xBTiBEQUwgY29udGV4dCAKKyAgICAgICAgIHBFdmVudERhdGE6ICAgICAgcG9pbnRlciB0byB0aGUgZXZlbnQgaW5mb3JtYXRpb24gc3RydWN0dXJlIAorICAKKyBAc2VlCisgQHJldHVybiBSZXN1bHQgb2YgdGhlIGZ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bnREYXRhCispOworCisvKioKKyBAYnJpZWYgV0RJX1Byb2Nlc3NHZXRCYXRjaFNjYW5SZXEgLQorICAgIFNlbmQgZ2V0IGJhdGNoIHNjYW4gcmVxdWVzdCB0byBGVworCisgQHBhcmFtICBwV0RJQ3R4IDogd2RpIGNvbnRleHQKKyAgICAgICAgIHBFdmVudERhdGEgOiBpbmRpY2F0aW9uIGRhdGEKKworIEBzZWUKKyBAcmV0dXJuIHN1Y2Nlc3Mgb3IgZmFpbHVyZQorKi8KK1dESV9TdGF0dXMgV0RJX1Byb2Nlc3NHZXRCYXRjaFNjYW5SZXEKKygKKyAgV0RJX0NvbnRyb2xCbG9ja1R5cGUqICBwV0RJQ3R4LAorICBXRElfRXZlbnRJbmZvVHlwZSogICAgIHBFdmVudERhdGEKKyk7CisjZW5kaWYgLyogRkVBVFVSRV9XTEFOX0JBVENIX1NDQU4gKi8KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW5kaWNhdGlvbnMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKioKKyBAYnJpZWYgUHJvY2VzcyBTdXNwZW5kIEluZGljYXRpb25zIGZ1bmN0aW9uIChjYWxsZWQgd2hlbiBNYWluIEZTTSBhbGxvd3MgaXQpCisgCisgQHBhcmFtICBwV0RJQ3R4OiAgICAgICAgIHBvaW50ZXIgdG8gdGhlIFdMQU4gREFMIGNvbnRleHQgCisgICAgICAgICBwRXZlbnREYXRhOiAgICAgIHBvaW50ZXIgdG8gdGhlIGV2ZW50IGluZm9ybWF0aW9uIHN0cnVjdHVyZSAKKyAgCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cworV0RJX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V9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorICk7CisKKyNlbmRpZgorLyoqCisgQGJyaWVmIFByb2Nlc3Mgc3RhcnQgT0JTUyBzY2FuIHJlcXVlc3QgZnJvbSBIb3N0CisKKyBAcGFyYW0gIHBXRElDdHg6ICAgICAgICAgcG9pbnRlciB0byB0aGUgV0xBTiBEQUwgY29udGV4dAorICAgICAgICAgcEV2ZW50RGF0YTogICAgICBwb2ludGVyIHRvIHRoZSBldmVudCBpbmZvcm1hdGlvbiBzdHJ1Y3R1cmUKKworIEBzZWUKKyBAcmV0dXJuIFJlc3VsdCBvZiB0aGUgZnVuY3Rpb24gY2FsbAorKi8KK1dESV9TdGF0dXMKK1dESV9Qcm9jZXNzSFQ0ME9CU1NTY2FuSW5kKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsICBXRElfRXZlbnRJbmZvVHlwZSogICBwRXZlbnREYXRhICk7CisKKworLyoqCisgQGJyaWVmIFByb2Nlc3Mgc3RvcCBPQlNTIHNjYW4gcmVxdWVzdCBmcm9tIEhvc3QKKworIEBwYXJhbSAgcFdESUN0eDogICAgICAgICBwb2ludGVyIHRvIHRoZSBXTEFOIERBTCBjb250ZXh0CisgICAgICAgICBwRXZlbnREYXRhOiAgICAgIHBvaW50ZXIgdG8gdGhlIGV2ZW50IGluZm9ybWF0aW9uIHN0cnVjdHVyZQorCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cworV0RJX1Byb2Nlc3NIVDQwT0JTU1N0b3BTY2FuSW5kKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsICBXRElfRXZlbnRJbmZvVHlwZSogICBwRXZlbnREYXRhICk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAgICAgTWFpbiBE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KyAKKyBAcGFyYW0gIHBXRElDdHg6ICAgICAgICAgcG9pbnRlciB0byB0aGUgV0xBTiBEQUwgY29udGV4dCAKKyAgICAgICAgIHBFdmVudERhdGE6ICAgICAgcG9pbnRlciB0byB0aGUgZXZlbnQgaW5mb3JtYXRpb24gc3RydWN0dXJlIAorICAKKyBAc2VlCisgQHJldHVybiBSZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGwKKyovCitXRElfU3RhdHVzCitXRElfUHJvY2Vzc1NldFBvd2VyUGFyYW1zUnNwCisoIAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKTsKKworLyoqCisgQGJyaWVmIFByb2Nlc3MgU2V0IFRNIExldmVsIFJzcCBmdW5jdGlvbiAoY2FsbGVkIHdoZW4gYQorICAgICAgICByZXNwb25zZSBpcyBiZWluZyByZWNlaXZlZCBvdmVyIHRoZSBidXMgZnJvbSBIQUwpCisgCisgQHBhcmFtICBwV0RJQ3R4OiAgICAgICAgIHBvaW50ZXIgdG8gdGhlIFdMQU4gREFMIGNvbnRleHQgCisgICAgICAgICBwRXZlbnREYXRhOiAgICAgIHBvaW50ZXIgdG8gdGhlIGV2ZW50IGluZm9ybWF0aW9uIHN0cnVjdHVyZSAKKyAgCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cworV0RJX1Byb2Nlc3NTZXRUbUxldmVsUnNwCisoIAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgICAgICAgICAgICAgICAgICAgSW5kaWNhdGlvbnMgZnJvb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gZnVuY3Rpb24gY2FsbAorKi8KK1dESV9TdGF0dXMKK1dESV9Qcm9jZXNzSWJzc1BlZXJJbmFjdGl2aXR5SW5kCisKKygKKyBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKTsKKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgICAgSW50ZXJuYWwgSGVscGVyIFJvdXRpbmVzIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyoqCisgQGJyaWVmIFdESV9DbGVhbkNCIC0gaW50ZXJuYWwgaGVscGVyIHJvdXRpbmUgdXNlZCB0byBjbGVhbiB0aGUgCisgICAgICAgIFdESSBNYWluIENvbnRyb2wgQmxvY2sKKyAKKyBAcGFyYW0gcFdESUN0eCAtIHBvaW50ZXIgdG8gdGhlIGNvbnRyb2wgYmxvY2sKKworIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cworV0RJX0NsZWFuQ0IKKygKKyAgV0RJX0NvbnRyb2xCbG9ja1R5cGUqICBwV0RJQ3R4CispOworCisvKioKKyBAYnJpZWYgTWFpbiBGU00gQ2xvc2UgZnVuY3Rpb24gZm9yIGFsbCBzdGF0ZXMgZXhjZXB0IEJVU1kKKworIAorIEBwYXJhbSAgcFdESUN0eDogICAgICAgICBwb2ludGVyIHRvIHRoZSBXTEFOIERBTCBjb250ZXh0IAorICAgICAgICAgcEV2ZW50RGF0YTogICAgICBwb2ludGVyIHRvIHRoZSBldmVudCBpbmZvcm1hdGlvbiBzdHJ1Y3R1cmUgCisgIAorIEBzZWUKKyBAcmV0dXJuIFJlc3VsdCBvZiB0aGUgZnVuY3Rpb24gY2FsbAorK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dESUN0eCwgCisgIFdESV9SZXF1ZXN0RW51bVR5cGUgICAgd2RpUmVxVHlwZSwgCisgIHdwdF91aW50MTYgICAgICAgICAgICAgdXNCdWZmZXJMZW4sCisgIHdwdF91aW50OCoqICAgICAgICAgICAgcE1zZ0J1ZmZlciwgCisgIHdwdF91aW50MTYqICAgICAgICAgICAgcHVzRGF0YU9mZnNldCwgCisgIHdwdF91aW50MTYqICAgICAgICAgICAgcHVzQnVmZmVyU2l6ZQorKTsKKworLyoqCisgQGJyaWVmIFdESV9EZXRlY3RlZERldmljZUVycm9yIC0gY2FsbGVkIGludGVybmFsbHkgYnkgREFMIHdoZW4gCisgICAgICAgIGl0IGhhcyBkZXRlY3RlZCBhIGZhaWx1cmUgaW4gdGhlIGRldmljZSAKKyAKKyBAcGFyYW0gIHBXRElDdHg6ICAgICAgICBwb2ludGVyIHRvIHRoZSBXTEFOIERBTCBjb250ZXh0IAorICAgICAgICAgdXNFcnJvckNvZGU6ICAgIGVycm9yIGNvZGUgZGV0ZWN0ZWQgYnkgV0RJIG9yIHJlY2VpdmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgZnJvbSBIQUwKKyAgCisgQHNlZQorIEByZXR1cm4gTm9uZSAKKyovCit2b2lkCitXRElfRGV0ZWN0ZWREZXZpY2VFcnJvcgorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIHdwdF91aW50MTYgICAgICAgICAgICAgdXNFcnJvckNvZGUKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgICAgICAgICAgICAgIFFVRVVFIFNVUFBPUlQgVVRJTElUWSBGVU5DVElPTlMgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyoqCisgQGJyaWVmICAgIFV0aWxpdHkgZnVuY3Rp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VuIGEgdGltZXIgdGhhdCAKKyAgICAgICAgICAgd2Ugc3RhcnRlZCBvbiBzZW5kIG1lc3NhZ2UgaGFzIGV4cGlyZSAtIHRoaXMgc2hvdWxkCisgICAgICAgICAgIG5ldmVyIGhhcHBlbiAtIGl0IG1lYW5zIGRldmljZSBpcyBzdHVjayBhbmQgY2Fubm90CisgICAgICAgICAgIHJlcGx5IC0gdHJpZ2dlciBjYXRhc3Ryb3BoaWMgZmFpbHVyZSAKKyBAcGFyYW0gCisgICAgCisgICAgcFVzZXJEYXRhOiB0aGUgY2FsbGJhY2sgZGF0YSBvZiB0aGUgdXNlciAocHRyIHRvIFdESSBDQikKKyAgICAKKyBAc2VlIAorIEByZXR1cm4gTm9uZSAKKyovCit2b2lkIAorV0RJX1Jlc3BvbnNlVGltZXJDQgorKAorICB2b2lkICpwVXNlckRhdGEKKyk7CisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICAgICAgICAgICAgICAgICAgIENPTlRSTCBUUkFOU1BPUlQgSU5URVJBQ1RJT04KKyAKKyAgICBDYWxsYmFjayBmdW5jdGlvbiByZWdpc3RlcmVkIHdpdGggdGhlIGNvbnRyb2wgdHJhbnNwb3J0IC0gZm9yIHJlY2VpdmluZworICAgIG5vdGlmaWNhdGlvbnMgYW5kIHBhY2tldHMgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisvKioKKyBAYnJpZWYgICAgVGhpcyBjYWxsYmFjayBpcyBpbnZva2VkIGJ5IHRoZSBjb250cm9sIHRyYW5zcG9ydCAKKyAgIHdoZW4gaXQgd2lzaGVzIHRvIHNlbmQgdXAgYSBub3RpZmljYXRpb24gbGlrZSB0aGUgb25lcworICAgbWVudGlvbmVkIGFib3ZlLgorIAorIEBwYXJhbQorICAgIAorICAgIHdjdHNIYW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AtIHNhdmUgaW4gdGhlIFdESQorICAgICAgICAgQ0IKKyAgICAgICAgIHBVc2VyRGF0YTogICAgICAgICB1c2VyIGRhdGEgYXNzb2NpYXRlZCB3aXRoIHRoZQorICAgICAgICAgY2FsbGJhY2sKKyAgICAgICAgIHdkaUV4cGVjdGVkUmVzcG9uc2U6IHRoZSBjb2RlIG9mIHRoZSByZXNwb25zZSB0aGF0IGlzCisgICAgICAgICBleHBlY3RlZCB0byBiZSByeC1lZCBmb3IgdGhpcyByZXF1ZXN0CisgIAorIEBzZWUKKyBAcmV0dXJuIFJlc3VsdCBvZiB0aGUgZnVuY3Rpb24gY2FsbAorKi8KK1dESV9TdGF0dXMgCitXRElfU2VuZE1zZworKCAKKyAgV0RJX0NvbnRyb2xCbG9ja1R5cGUqICBwV0RJQ3R4LCAgCisgIHdwdF91aW50OCogICAgICAgICAgICAgcFNlbmRCdWZmZXIsIAorICB3cHRfdWludDMyICAgICAgICAgICAgIHVTZW5kU2l6ZSwgCisgIHZvaWQqICAgICAgICAgICAgICAgICAgcFJzcENiLCAKKyAgdm9pZCogICAgICAgICAgICAgICAgICBwVXNlckRhdGEsCisgIFdESV9SZXNwb25zZUVudW1UeXBlICAgd2RpRXhwZWN0ZWRSZXNwb25zZQorKTsKKworCisvKioKKyBAYnJpZWYgU2VuZCBpbmRpY2F0aW9uIGhlbHBlciBmdW5jdGlvbiAtIHNlbmRzIGEgbWVzc2FnZSBvdmVyIAorICAgICAgICB0aGUgYnVzIHVzaW5nIHRoZSBjb250cm9sIHRyYW5zcG9ydCBhbmQgc2F2ZXMgc29tZSBpbmZvCisgICAgICAgIGluIHRoZSBDQgorIAorIEBwYXJhbSAgcFdESUN0eDogICAgICAgICBwb2ludGVyIHRvIHRoZSBXTEFOIERBTCBjb250ZXh0IAorICAgICAgICAgcFNlbmRCdWZmZXI6ICAgICBidWZmZXIgdG8gYmUgc2VudAorICAgICAgICAgdXNTZW5kU2l6ZTogc2l6ZSBvZiB0aGUgYnVmZmV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JQ3R4LAorICAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispOworCitXRElfU3RhdHVzCitXRElfUHJvY2Vzc0xMU3RhdHNDbGVhclJzcAorKAorICAgV0RJX0NvbnRyb2xCbG9ja1R5cGUqICBwV0RJQ3R4LAorICAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispOworCitXRElfU3RhdHVzCitXRElfUHJvY2Vzc0xMU3RhdHNDbGVhclJlcQorKAorICAgV0RJX0NvbnRyb2xCbG9ja1R5cGUqICBwV0RJQ3R4LAorICAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispOworCitXRElfU3RhdHVzCitXRElfUHJvY2Vzc0xpbmtMYXllclN0YXRzUmVzdWx0c0luZAorKAorICAgV0RJX0NvbnRyb2xCbG9ja1R5cGUqICBwV0RJQ3R4LAorICAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispOworCisjZW5kaWYgLyogV0xBTl9GRUFUVVJFX0xJTktfTEFZRVJfU1RBVFMgKi8KKworV0RJX1N0YXR1cworV0RJX2RlbEJhSW5kCisoCisgICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgICBXRElfRXZlbnRJbmZvVHlwZSogICAgIHBFdmVudERhdGEKKyk7CisKK1dESV9TdGF0dXMKK1dESV9Qcm9jZXNzU3Bvb2ZNYWNBZGRyUmVxCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispOworV0RJX1N0YXR1cworV0RJX1Byb2Nlc3NTcG9vZk1hY0FkZHJSc3AKKygKKyAgV0RJX0NvbnRyb2xCbG9ja1R5cGUqICBwV0RJQ3R4LAorICBXRElfRXZlbnRJbmZvVHlwZSogICAgIHBFdmVudERhdGEKKyk7CisKK1dESV9TdGF0dXMKK1dESV9Qcm9jZX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19Mb3N0TGlua1BhcmFtSW5kCisoCisgICAgV0RJX0NvbnRyb2xCbG9ja1R5cGUqICBwV0RJQ3R4LAorICAgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKTsKKworCisvKioKKyBAYnJpZWYgV0RJX1Byb2Nlc3NTZXRSdHNDdHNIdHZodEluZAorICAgICAgICBTZXQgUlRTL0NUUyBpbmRpY2F0aW9uIGZvciBkaWZmIG1vZGVzLgorCisgQHBhcmFtICBwV0RJQ3R4OiAgICAgICAgIHBvaW50ZXIgdG8gdGhlIFdMQU4gREFMIGNvbnRleHQKKyAgICAgICAgIHBFdmVudERhdGE6ICAgICAgcG9pbnRlciB0byB0aGUgZXZlbnQgaW5mb3JtYXRpb24gc3RydWN0dXJlCisKKyBAcmV0dXJuIFJlc3VsdCBvZiB0aGUgZnVuY3Rpb24gY2FsbAorKi8KKworCitXRElfU3RhdHVzCitXRElfUHJvY2Vzc1NldFJ0c0N0c0h0dmh0SW5kCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispOworCitXRElfU3RhdHVzCitXRElfUHJvY2Vzc01vblN0YXJ0UmVxCisoCisgICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgICBXRElfRXZlbnRJbmZvVHlwZSogICAgIHBFdmVudERhdGEKKyk7CisKK1dESV9TdGF0dXMKK1dESV9Qcm9jZXNzTW9uU3RhcnRSc3AKKygKKyAgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKTsKKworV0RJX1N0YXR1cworV0RJX1Byb2Nlc3NNb25TdG9wUmVxCisoCisgICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgICBXRElfRXZlbnRJbmZvVHlwZSogICAgIHBFdmVudERhd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1RfREFMX1NUQV9ICisjZGVmaW5lIFdMQU5fUUNUX0RBTF9TVEFfSAorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICBXIEwgQSBOICAgRCBFIFYgSSBDIEUgICBBIEIgUyBUIFIgQSBDIFQgSSBPIE4gICBMIEEgWSBFIFIgCisgICAgICAgICAgICAgIEkgTiBUIEUgUiBOIEEgTCAgICAgQSBQIEkgICAgICAgRiBPIFIgICAgVCBIIEUKKyAgICAgICAgICAgICAgICAgICAgICAgUyBUIEEgVCBJIE8gTiAgICBNIEcgTSBUCisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgCitERVNDUklQVElPTgorICBUaGlzIGZpbGUgY29udGFpbnMgdGhlIGludGVybmFsIEFQSSBleHBvc2VkIGJ5IHRoZSBTVEEgTWFuYWdlbWVudCBlbnRpdHkgdG8KKyAgYmUgdXNlZCBieSB0aGUgREFMIENvbnRyb2wgUGF0aCBDb3JlIC4gCisgIAorICAgICAgCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICBFRElUIEhJU1RPUlkgRk9SIEZJTEUKKworCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLgorICBOb3RpY2UgdGhhdCBjaGFuZ2VzIGFyZSBsaXN0ZWQgaW4gcmV2ZXJzZSBjaHJvbm9sb2dpY2FsIG9yZGVyLgorCisKKyAgJEhlYWRlcjokICREYXRlVGltZTogJCAkQXV0aG9yOiAkCisKKword2hlbiAg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DAgLSBTZWxmLCAxIG90aGVyL3JlbW90ZSwgMiAtIGJzc2lkCisgIHdwdF91aW50OCAgIHVjU3RhVHlwZTsgICAgICAgCisKKworICAvKkRQVSBJbmZvcm1hdGlvbiovCisgIHdwdF91aW50OCBkcHVJbmRleDsgICAgICAgICAgICAgICAgICAgICAgLy8gRFBVIHRhYmxlIGluZGV4CisgIHdwdF91aW50OCBkcHVTaWc7ICAgICAgICAgICAgICAgICAgICAgICAgLy8gRFBVIHNpZ25hdHVyZQorICB3cHRfdWludDggYmNhc3REcHVJbmRleDsKKyAgd3B0X3VpbnQ4IGJjYXN0RHB1U2lnbmF0dXJlOworICB3cHRfdWludDggYmNhc3RNZ210RHB1SW5kZXg7CisgIHdwdF91aW50OCBiY2FzdE1nbXREcHVTaWduYXR1cmU7CisgICAgIAorfSBXRElfU3RhU3RydWN0OworCisvKioKKyBAYnJpZWYgV0RJX1NUQVRhYmxlSW5pdCAtIEluaXRpYWxpemVzIHRoZSBTVEEgdGFibGVzLiAKKyAgICAgICAgQWxsb2NhdGVzIHRoZSBuZWNlc2FyeSBtZW1vcnkuCisKKyAKKyBAcGFyYW0gIHBXRElDdHg6ICAgICAgICAgcG9pbnRlciB0byB0aGUgV0xBTiBEQUwgY29udGV4dCAKKyAgCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cyBXRElfU1RBVGFibGVJbml0CisoCisgICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgKKyk7CisKKy8qKgorIEBicmllZiBXRElfU1RBVGFibGVTdGFydCAtIHJlc2V0cyB0aGUgbWF4IGFuZCBudW1iZXIgdmFsdWVzIG9mIAorICAgICAgICBTVEF0aW9ucworCisgCisgQHBhcmFtICBwV0RJQ3R4OiAgICAgICAgIHBvaW50ZXIgdG8gdGhlIFdMQU4gREFMIGNvbnRleHQgCisgIAorIEBzZWUKKyBAcmV0dXJuIFJlc3VsdCBv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gICAgd3B0X3VpbnQ4ICAgICAgICAgICAgICB1Y1NUQUlkeCwgCisgICAgd3B0X3VpbnQ4KiAgICAgICAgICAgICBxb3NFbmFibGVkCispOworCisvKioKKyBAYnJpZWYgV0RJX1NUQVRhYmxlU2V0U3RhUW9zRW5hYmxlZCAtIHNldCBxb3MgbW9kZSBmb3IgU1RBCisKKyAKKyBAcGFyYW0gIHBXRElDdHg6ICAgIHBvaW50ZXIgdG8gdGhlIFdMQU4gREFMIGNvbnRleHQgCisgICAgICAgICB1Y1NUQUlkeDogICBzdGF0aW9uIGluZGV4CisgICAgICAgICBxb3NFbmFibGVkOiBxb3MgZW5hYmxlZAorICAKKyBAc2VlCisgQHJldHVybiBSZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGwKKyovCitXRElfU3RhdHVzIAorV0RJX1NUQVRhYmxlU2V0U3RhUW9zRW5hYmxlZAorKAorICAgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwgIAorICAgIHdwdF91aW50OCAgICAgICAgICAgICAgdWNTVEFJZHgsIAorICAgIHdwdF91aW50OCAgICAgICAgICAgICAgcW9zRW5hYmxlZAorKTsKKworLyoqCisgQGJyaWVmIFdESV9TVEFUYWJsZUdldFN0YVR5cGUgLSBnZXQgc3RhIHR5cGUgZm9yIFNUQQorCisgCisgQHBhcmFtICBwV0RJQ3R4OiAgIHBvaW50ZXIgdG8gdGhlIFdMQU4gREFMIGNvbnRleHQgCisgICAgICAgICB1Y1NUQUlkeDogIHN0YXRpb24gaW5kZXgKKyAgICAgICAgIHBTdGFUeXBlOiAgcW9zIGVuYWJsZWQKKyAgCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cyAKK1dESV9TVEFUYWJsZUdldFN0YVR5cGUKKygKKyAgICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsICAKKyAgICB3cHRfdWludDggICAgICAgICAgIC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ZSogIHBXRElDdHgsIAorICAgIHdwdF9tYWNBZGRyICAgICAgICAgICAgc3RhQWRkciwgCisgICAgd3B0X3VpbnQ4KiAgICAgICAgICAgICBwdWNTdGFJZAorKTsKKworLyoqCisgQGJyaWVmIFdESV9TVEFUYWJsZUdldFN0YUFkZHIgLSBnZXQgc3RhdGlvbiBhZGRyZXNzCisgCisgQHBhcmFtICBwV0RJQ3R4OiAgV0RJIENvbnRleHQgcG9pbnRlcgorICAgICAgICAgdWNTVEFJZHg6ICBzdGF0aW9uIGluZGV4CisgICAgICAgICBwU3RhQWRkcjogb3V0cHV0IHN0YXRpb24gYWRkcmVzcyAKKyAgCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cyAKK1dESV9TVEFUYWJsZUdldFN0YUFkZHIKKygKKyAgICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsICAKKyAgICB3cHRfdWludDggICAgICAgICAgICAgIHVjU1RBSWR4LCAKKyAgICB3cHRfdWludDgqKiAgICAgICAgICAgIHBTdGFBZGRyCispOworCisvKioKKyBAYnJpZWYgV0RJX1NUQVRhYmxlR2V0U3RhTWFjQWRkciAtIGdldCBzdGF0aW9uIE1BQyBhZGRyZXNzCisKKyBAcGFyYW0gIHBXRElDdHg6ICBXREkgQ29udGV4dCBwb2ludGVyCisgICAgICAgICB1Y1NUQUlkeDogIHN0YXRpb24gaW5kZXgKKyAgICAgICAgIHBTdGFBZGRyOiBvdXRwdXQgc3RhdGlvbiBNQUMgYWRkcmVzcworCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworCitXRElfU3RhdHVzCitXRElfU1RBVGFibGVHZXRTdGFNYWNBZGRyCisoCisgICAgV0RJX0NvbnRyb2xCbG9ja1R5cGUqICBwV0RJQ3R4LAorICAgIHdwdF91aW50OCAgICAgICAgICAgICAgdWNTVEFJZHgsCisgICAgd3B0X21hY0FkZHIqICAgICAgICAgICBzdGFNYWNBZGRyCispOworCisvKioKKyBAYnJpZWYgV0RJX1NUQVRhYmxlU2V0U3RhQWRkciAtIHNldCBzdGF0aW9uIGFkZHJlc3MKKyAKKyBAcGFyYW0gIHBXRElDdHg6ICBXREkgQ29udGV4dCBwb2ludGVyCisgICAgICAgICB1Y1NUQUlkeDogICBzdGF0aW9uIGluZGV4CisgICAgICAgICBwU3RhQWRkcjogb3V0cHV0IHN0YXRpb24gYWRkcmVzcyAKKyAgCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cyAKK1dESV9TVEFUYWJsZVNldFN0YUFkZHIKKygKKyAgICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsICAKKyAgICB3cHRfdWludDggICAgICAgICAgICAgIHVjU1RBSWR4LCAKKyAgICB3cHRfbWFjQWRkciAgICAgICAgICAgIHN0YUFkZHIKKyk7CisKKy8qKgorIEBicmllZiBXRElfU1RBVGFibGVTZXRCU1NJRCAtIHNldCBzdGF0aW9uIGNvcnJlc3BvbmRpbmcgQlNTSUQKKyAKKyBAcGFyYW0gIHBXRElDdHg6ICBXREkgQ29udGV4dCBwb2ludGVyCisgICAgICAgICB1Y1NUQUlkeDogICBzdGF0aW9uIGluZGV4CisgICAgICAgICBwU3RhQWRkcjogb3V0cHV0IHN0YXRpb24gYWRkcmVzcyAKKyAgCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cyAKK1dESV9TVEFUYWJsZVNldEJTU0lECisoCisgICAgV0RJX0NvbnRyb2xCbG9ja1R5cGUqICBwV0RJQ3R4LCAgCisgICAgd3B0X3VpbnQ4ICAgICAgICAgICAgICB1Y1NUQUlkeCwgCisgICAgd3B0X21hY0FkZHIgICAgICAgICAgICBtYWNCU1NJRAorKTsKKworLyoq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uCisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICAgVyBMIEEgTiBfIFEgQyBUIF8gVyBEIEkuIEMKKworICBPVkVSVklFVzoKKworICBUaGlzIHNvZnR3YXJlIHVuaXQgaG9sZHMgdGhlIGltcGxlbWVudGF0aW9uIG9mIHRoZSBXTEFOIERldmljZSBBYnN0cmFjdGlvbgorICBMYXllciBJbnRlcmZhY2UuCisKKyAgVGhlIGZ1bmN0aW9ucyBleHRlcm5hbGl6ZWQgYnkgdGhpcyBtb2R1bGUgYXJlIHRvIGJlIGNhbGxlZCBieSBhbnkgdXBwZXIKKyAgTUFDIGltcGxlbWVudGF0aW9uIHRoYXQgd2lzaGVzIHRvIHVzZSB0aGUgV0xBTiBEZXZpY2UuCisKKyAgREVQRU5ERU5DSUVTOgorCisgIEFyZSBsaXN0ZWQgZm9yIGVhY2ggQVBJIGJlbG93LgorCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICBFRElUIEhJU1RPUlkgRk9SIEZJTEUKKworCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLgorICBOb3RpY2UgdGhhdCBjaGFuZ2VzIGFyZSBsaXN0ZWQgaW4g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UVVJFX05PVF9TVVBQT1JURUQgICAgICAgICAgLy8xMAorICAgICxGRUFUVVJFX05PVF9TVVBQT1JURUQgICAgICAgICAgLy8xMQorICAgICxGRUFUVVJFX05PVF9TVVBQT1JURUQgICAgICAgICAgLy8xMgorICAgICxGRUFUVVJFX05PVF9TVVBQT1JURUQgICAgICAgICAgLy8xMworICAgICxGRUFUVVJFX05PVF9TVVBQT1JURUQgICAgICAgICAgLy8xNAorICAgICxGRUFUVVJFX05PVF9TVVBQT1JURUQgICAgICAgICAgLy8xNQorICAgICxGRUFUVVJFX05PVF9TVVBQT1JURUQgICAgICAgICAgLy8xNgorICAgICxGRUFUVVJFX05PVF9TVVBQT1JURUQgICAgICAgICAgLy8xNworICAgICxGRUFUVVJFX05PVF9TVVBQT1JURUQgICAgICAgICAgLy8xOAorICAgICxGRUFUVVJFX05PVF9TVVBQT1JURUQgICAgICAgICAgLy8xOQorICAgICxGRUFUVVJFX05PVF9TVVBQT1JURUQgICAgICAgICAgLy8yMAorICAgICxGRUFUVVJFX05PVF9TVVBQT1JURUQgICAgICAgICAgLy8yMQorICAgICxXT1cgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8yMgorI2lmZGVmIFdMQU5fRkVBVFVSRV9ST0FNX1NDQU5fT0ZGTE9BRAorICAgICxXTEFOX1JPQU1fU0NBTl9PRkZMT0FEICAgICAgICAgLy8yMworI2Vsc2UKKyAgICAsRkVBVFVSRV9OT1RfU1VQUE9SVEVECisjZW5kaWYKKyAgICAsRkVBVFVSRV9OT1RfU1VQUE9SVEVEICAgICAgICAgIC8vMjQKKyAgICAsRkVBVFVSRV9OT1RfU1VQUE9SVEVEICAgICAgICAgIC8vMjUKKyAgICAsSUJTU19IRUFSVEJFQVRfT0ZGTE9BRCAgICAgICAgIC8vMjYKKyAgICAsRkVBVFVSRV9OT1RfU1VQUE9SVEVEICAgICAgICAgIC8vMjcKKyAgICAsV0xBTl9QRVJJT0RJQ19UWF9QVFJOICAgICAgICAgIC8vMjgKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworICAgICxBRFZBTkNFX1RETFMgICAgICAgICAgICAgICAgICAgLy8yOQorI2Vsc2UKKyAgICAsRkVBVFVSRV9OT1RfU1VQUE9SVEVEICAgICAgICAgIC8vMjkKKyNlbmRpZgorICAgICxGRUFUVVJFX05PVF9TVVBQT1JURUQgICAgICAgICAgLy8zMAorICAgICxGV19JTl9UWF9QQVRIICAgICAgICAgICAgICAgICAgLy8zMQorICAgICxFWFRFTkRFRF9OU09GRkxPQURfU0xPVCAgICAgICAgLy8zMgorICAgICxDSF9TV0lUQ0hfVjEgICAgICAgICAgICAgICAgICAgLy8zMworICAgICxIVDQwX09CU1NfU0NBTiAgICAgICAgICAgICAgICAgLy8zNAorICAgICxVUERBVEVfQ0hBTk5FTF9MSVNUICAgICAgICAgICAgLy8zNQorICAgICxGRUFUVVJFX05PVF9TVVBQT1JURUQgICAgICAgICAgLy8zNgorICAgICxGRUFUVVJFX05PVF9TVVBQT1JURUQgICAgICAgICAgLy8zNworICAgICxGRUFUVVJFX05PVF9TVVBQT1JURUQgICAgICAgICAgLy8zOAorI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgICAgLFRETFNfU0NBTl9DT0VYSVNURU5DRSAgICAgICAgICAvLzM5CisjZWxzZQorICAgICxGRUFUVVJFX05PVF9TVVBQT1JURUQgICAgICAgICAgLy8zOQorI2VuZGlmCisjaWZkZWYgV0xBTl9GRUFUVVJFX0xJTktfTEFZRVJfU1RBVFMKKyAgICAsTElOS19MQVlFUl9TVEFUU19NRUFTICAgICAgICAgIC8vNDAKKyNlbHNlCisgICAgLEZFQVRVUkVfTk9UX1NVUFBPUlRFRCAgICAgICAgICAvLzQwCisjZW5kaWYKKyAgICAsTVVfTUlNTyAgICAgICAgICAgICAgICAgICAgICAgIC8vNDEKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfRVhUU0NBTgorICAgICxFWFRFTkRFRF9TQ0FOICAgICAgICAgICAgICAgICAgLy80MgorI2Vsc2UKKyAgICAsRkVBVFVSRV9OT1RfU1VQUE9SVEVEICAgICAgICAgIC8vNDIKKyNlbmRpZgorICAgLERZTkFNSUNfV01NX1BTICAgICAgICAgICAgICAgICAvLzQzCisKKyAgICxNQUNfU1BPT0ZFRF9TQ0FOICAgICAgICAgICAgICAgLy80NAorICAgLEZFQVRVUkVfTk9UX1NVUFBPUlRFRCAgICAgICAgICAvLzQ1CisgICAsRElTQSAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vNDYKKyAgICxGV19TVEFUUyAgICAgICAgICAgICAgICAgICAgICAgLy80NworICAgLFdQU19QUkJSU1BfVE1QTCAgICAgICAgICAgICAgICAvLzQ4CisgICAsQkNOX0lFX0ZMVF9ERUxUQSAgICAgICAgICAgICAgIC8vNDkKKyAgICxGRUFUVVJFX05PVF9TVVBQT1JURUQgICAgICAgICAgLy81MAorI2lmZGVmIEZFQVRVUkVfV0xBTl9URExTCisgICAgLFRETFNfT0ZGX0NIQU5ORUwgICAgICAgICAgICAgIC8vNTEKKyNlbHNlCisgICAgLEZFQVRVUkVfTk9UX1NVUFBPUlRFRCAgICAgICAgIC8vNTEKKyNlbmRpZgorICAgLEZFQVRVUkVfTk9UX1NVUFBPUlRFRCAgICAgICAgICAvLzUyCisgICAsTUdNVF9GUkFNRV9MT0dHSU5HICAgICAgICAgICAgIC8vNTMKKyAgICxFTkhBTkNFRF9UWEJEX0NPTVBMRVRJT04gICAgICAgLy81NAorICAgLExPR0dJTkdfRU5IQU5DRU1FTlQgICAgICAgICAgICAvLzU1Cit9OworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tIAorICAgV0xBTiBEQUwgIFN0YXRlIE1hY2hpbmUKKyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCitXUFRfU1RBVElDIGNvbnN0IFdESV9NYWluRnNtRW50cnlUeXBlIHdkaU1haW5GU01bV0RJX01BWF9TVF0gPQoreworICAvKldESV9JTklUX1NUKi8KKyAge3sKKyAgICBXRElfTWFpblN0YXJ0LCAgICAgICAgICAgICAgLypXRElfU1RBUlRfRVZFTlQqLworICAgIE5VTEwsICAgICAgICAgICAgICAgICAgICAgICAvKldESV9TVE9QX0VWRU5UKi8KKyAgICBXRElfTWFpblJlcUJ1c3ksICAgICAgICAgICAgLypXRElfUkVRVUVTVF9FVkVOVCovCisgICAgV0RJX01haW5Sc3BJbml0LCAgICAgICAgICAgIC8qV0RJX1JFU1BPTlNFX0VWRU5UKi8KKyAgICBXRElfTWFpbkNsb3NlLCAgICAgICAgICAgICAgLypXRElfQ0xPU0VfRVZFTlQqLworICAgIFdESV9NYWluU2h1dGRvd24gICAgICAgICAgICAvKldESV9TSFVURE9XTl9FVkVOVCovCisgIH19LAorCisgIC8qV0RJX1NUQVJURURfU1QqLworICB7eworICAgIFdESV9NYWluU3RhcnRTdGFydGVkLCAgICAgICAvKldESV9TVEFSVF9FVkVOVCovCisgICAgV0RJX01haW5TdG9wU3RhcnRlZCwgICAgICAgIC8qV0RJX1NUT1BfRVZFTlQqLworICAgIFdESV9NYWluUmVxU3RhcnRlZCwgICAgICAgICAvKldESV9SRVFVRVNUX0VWRU5UKi8KKyAgICBXRElfTWFpblJzcCwgICAgICAgICAgICAgICAgLypXRElfUkVTUE9OU0VfRVZFTlQqLworICAgIE5VTEwsICAgICAgICAgICAgICAgICAgICAgICAvKldESV9DTE9TRV9FVkVOVCovCisgICAgV0RJX01haW5TaHV0ZG93biAgICAgICAgICAgIC8qV0RJX1NIVVRET1dOX0VWRU5UKi8KKyAgfX0sCisKKyAgLypXRElfU1RPUFBFRF9TVCovCisgIHt7CisgICAgV0RJX01haW5TdGFydCwgICAgICAgICAgICAgIC8qV0RJX1NUQVJUX0VWRU5UKi8KKyAgICBXRElfTWFpblN0b3BTdG9wcGVkLCAgICAgICAgLypXRElfU1RPUF9FVkVOVCovCisgICAgTlVMTCwgICAgICAgICAgICAgICAgICAgICAgIC8qV0RJX1JFUVVFU1RfRVZFTlQqLworICAgIFdESV9NYWluUnNwLCAgICAgICAgICAgICAgICAvKldESV9SRVNQT05TRV9FVkVOVCovCisgICAgV0RJX01haW5DbG9zZSwgICAgICAgICAgICAgIC8qV0RJX0NMT1NFX0VWRU5UKi8KKyAgICBXRElfTWFpblNodXRkb3duICAgICAgICAgICAgLypXRElfU0hVVERPV05fRVZFTlQqLworICB9fSwKKworICAvKldESV9CVVNZX1NUKi8KKyAge3sKKyAgICBXRElfTWFpblN0YXJ0QnVzeSwgICAgICAgICAgLypXRElfU1RBUlRfRVZFTlQqLworICAgIFdESV9NYWluU3RvcEJ1c3ksICAgICAgICAgICAvKldESV9TVE9QX0VWRU5UKi8KKyAgICBXRElfTWFpblJlcUJ1c3ksICAgICAgICAgICAgLypXRElfUkVRVUVTVF9FVkVOVCovCisgICAgV0RJX01haW5Sc3AsICAgICAgICAgICAgICAgIC8qV0RJX1JFU1BPTlNFX0VWRU5UKi8KKyAgICBXRElfTWFpbkNsb3NlQnVzeSwgICAgICAgICAgLypXRElfQ0xPU0VfRVZFTlQqLworICAgIFdESV9NYWluU2h1dGRvd25CdXN5ICAgICAgICAvKldESV9TSFVURE9XTl9FVkVOVCovCisgIH19Cit9OworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBEQUwgUmVxdWVzdCBQcm9jZXNzaW5nIEFycmF5ICAtIHRoZSBmdW5jdGlvbnMgaW4gdGhpcyB0YWJsZSB3aWxsIG9ubHkgYmUKKyAgY2FsbGVkIHdoZW4gdGhlIHByb2Nlc3Npbmcgb2YgdGhlIHNwZWNpZmljIHJlcXVlc3QgaXM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09PT09PT09CisgIEhlbHBlciBpbmxpbmUgY29udmVydGVycworID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworLypDb252ZXJ0IFdESSBkcml2ZXIgdHlwZSBpbnRvIEhBTCBkcml2ZXIgdHlwZSovCitXUFRfU1RBVElDIFdQVF9JTkxJTkUgV0RJX1N0YXR1cworV0RJX0hBTF8yX1dESV9TVEFUVVMKKygKKyAgZUhhbFN0YXR1cyBoYWxTdGF0dXMKKyk7CisKKy8qQ29udmVydCBXREkgcmVxdWVzdCB0eXBlIGludG8gSEFMIHJlcXVlc3QgdHlwZSovCitXUFRfU1RBVElDIFdQVF9JTkxJTkUgdEhhbEhvc3RNc2dUeXBlCitXRElfMl9IQUxfUkVRX1RZUEUKKygKKyAgV0RJX1JlcXVlc3RFbnVtVHlwZSAgICB3ZGlSZXFUeXBlCispOworCisvKkNvbnZlcnQgV0RJIHJlc3BvbnNlIHR5cGUgaW50byBIQUwgcmVzcG9uc2UgdHlwZSovCitXUFRfU1RBVElDIFdQVF9JTkxJTkUgV0RJX1Jlc3BvbnNlRW51bVR5cGUKK0hBTF8yX1dESV9SU1BfVFlQRQorKAorICB0SGFsSG9zdE1zZ1R5cGUgaGFsTXNnCispOworCisvKkNvbnZlcnQgV0RJIGRyaXZlciB0eXBlIGludG8gSEFMIGRyaXZlciB0eXBlKi8KK1dQVF9TVEFUSUMgV1BUX0lOTElORSB0RHJpdmVyVHlwZQorV0RJXzJfSEFMX0RSVl9UWVBFCisoCisgIFdESV9Ecml2ZXJUeXBlIHdkaURyaXZlclR5cGUKKyk7CisKKy8qQ29udmVydCBXREkgc3RvcCByZWFzb24gaW50byBIQUwgc3RvcCByZWFzb24qLworV1BUX1NUQVRJQyBXUFRfSU5MSU5FIHRIYWxTdG9wVHlwZQorV0RJXzJfSEFMX1NUT1BfUkVBU09OCisoCisgIFdESV9TdG9wVHlwZSB3ZGlTdG9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IC0gUGFyc2VzIGJvdGggaG9zdCBhbmQgRmlybXdhcmUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2FwYWJpbGl0eSBiaXRtYXAgYXJyYXkuCisgIEBwYXJhbSBjYXBhYmlsaXR5Qml0bWFwIC0gQmFzZSBhZGRyZXNzIG9mIGEgNCBlbGVtZW50IEJpdG1hcCBhcnJheQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZiB0eXBlIHRBTklfVTMyLgorICBAc2VlCisgIEByZXR1cm5zICBOb25lCisgICovCit2b2lkIFdESV9UcmFjZUhvc3RGV0NhcGFiaWxpdGllcyh0QU5JX1UzMiAqY2FwYWJpbGl0eUJpdG1hcCkKK3sKKyAgICAgaW50IGksajsKKyAgICAgY2hhciAqcFRlbXBDYXBTdHIgPSBOVUxMOworICAgICBjaGFyICpwQ2FwU3RyID0gTlVMTDsKKyAgICAgcFRlbXBDYXBTdHIgPSB2b3NfbWVtX21hbGxvYyhNQVhfRldfSE9TVF9DQVBfU0laRSk7CisgICAgIGlmIChOVUxMID09IHBUZW1wQ2FwU3RyKQorICAgICB7CisgICAgICAgICBXUEFMX1RSQUNFKGVXTEFOX01PRFVMRV9EQUxfQ1RSTCwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAiTWVtb3J5IGFsbG9jYXRpb24gZmFpbGVkIGZvciBDYXBTdHIiKTsKKyAgICAgICAgIHJldHVybjsKKyAgICAgfQorCisgICAgIHBDYXBTdHIgPSBwVGVtcENhcFN0cjsKKyAgICAgZm9yIChqID0gMDsgaiA8IDQ7IGorKykgeworICAgICAgICAgZm9yIChpID0gMDsgaSA8IDMyOyBpKyspIHsKKyAgICAgICAgICAgICBpZiAoKCooY2FwYWJpbGl0eUJpdG1hcCArIGopICYgKDEgPDwgaSkpKSB7CisgICAgICAgICAgICAgICAgIHN3aXRjaChpICsgKGogKiAzMikpIHsKKyAgICAgICAgICAgICAgICAgICAgIGNhc2UgTUNDOiBzbnByaW50ZihwQ2FwU3RyLCBzaXplb2YoIk1DQyIpLCAiJXMiLCAiTUNDIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBDYXBTdHIgKz0gc3RybGVuKCJNQ0MiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICBjYXNlIFAyUDogc25wcmludGYocENhcFN0ciwgc2l6ZW9mKCJQMlAiKSwgIiVzIiwgIlAyUCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2FwU3RyICs9IHN0cmxlbigiUDJQIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgY2FzZSBET1QxMUFDOiBzbnByaW50ZihwQ2FwU3RyLCBzaXplb2YoIkRPVDExQUMiKSAsICIlcyIsICJET1QxMUFDIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBDYXBTdHIgKz0gc3RybGVuKCJET1QxMUFDIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgY2FzZSBTTE1fU0VTU0lPTklaQVRJT046IHNucHJpbnRmKHBDYXBTdHIsIHNpemVvZigiU0xNX1NFU1NJT05JWkFUSU9OIiksICIlcyIsICJTTE1fU0VTU0lPTklaQVRJT04iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcENhcFN0ciArPSBzdHJsZW4oIlNMTV9TRVNTSU9OSVpBVElPTiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgIGNhc2UgRE9UMTFBQ19PUE1PREU6IHNucHJpbnRmKHBDYXBTdHIsICBzaXplb2YoIkRPVDExQUNfT1BNT0RFIiksICIlcyIsICJET1QxMUFDX09QTU9ERSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2FwU3RyICs9IHN0cmxlbigiRE9UMTFBQ19PUE1PREUiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICBjYXNlIFNBUDMyU1RBOiBzbnByaW50ZihwQ2FwU3RyLCBzaXplb2YoIlNBUDMyU1RBIiksICIlcyIsICJTQVAzMlNUQSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2FwU3RyICs9IHN0cmxlbigiU0FQMzJTVEEiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICBjYXNlIFRETFM6IHNucHJpbnRmKHBDYXBTdHIsIHNpemVvZigiVERMUyIpLCAiJXMiLCAiVERMUyIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2FwU3RyICs9IHN0cmxlbigiVERMUyIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgIGNhc2UgUDJQX0dPX05PQV9ERUNPVVBMRV9JTklUX1NDQU46IHNucHJpbnRmKHBDYXBTdHIsIHNpemVvZigiUDJQX0dPX05PQV9ERUNPVVBMRV9JTklUX1NDQU4iKSwgIiVzIiwgIlAyUF9HT19OT0FfREVDT1VQTEVfSU5JVF9TQ0FOIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBDYXBTdHIgKz0gc3RybGVuKCJQMlBfR09fTk9BX0RFQ09VUExFX0lOSVRfU0NBTiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgIGNhc2UgV0xBTkFDVElWRV9PRkZMT0FEOiBzbnByaW50ZihwQ2FwU3RyLCBzaXplb2YoIldMQU5BQ1RJVkVfT0ZGTE9BRCIpLCAiJXMiLCAiV0xBTkFDVElWRV9PRkZMT0FEIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBDYXBTdHIgKz0gc3RybGVuKCJXTEFOQUNUSVZFX09GRkxPQUQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICBjYXNlIEJFQUNPTl9PRkZMT0FEOiBzbnByaW50ZihwQ2FwU3RyLCBzaXplb2YoIkJFQUNPTl9PRkZMT0FEIiksICIlcyIsIkJFQUNPTl9PRkZMT0FEIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBDYXBTdHIgKz0gc3RybGVuKCJCRUFDT05fT0ZGTE9BRCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgIGNhc2UgU0NBTl9PRkZMT0FEOiBzbnByaW50ZihwQ2FwU3RyLCBzaXplb2YoIlNDQU5fT0ZGTE9BRCIpLCAiJXMiLCAiU0NBTl9PRkZMT0FEIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBDYXBTdHIgKz0gc3RybGVuKCJTQ0FOX09GRkxPQUQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICBjYXNlIFJPQU1fT0ZGTE9BRDogc25wcmludGYocENhcFN0ciwgIHNpemVvZigiUk9BTV9PRkZMT0FEIiksICIlcyIsICJST0FNX09GRkxPQUQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcENhcFN0ciArPSBzdHJsZW4oIlJPQU1fT0ZGTE9BRCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgIGNhc2UgQkNOX01JU1NfT0ZGTE9BRDogc25wcmludGYocENhcFN0ciwgc2l6ZW9mKCJCQ05fTUlTU19PRkZMT0FEIiksICIlcyIsICJCQ05fTUlTU19PRkZMT0FEIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBDYXBTdHIgKz0gc3RybGVuKCJCQ05fTUlTU19PRkZMT0FEIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgY2FzZSBTVEFfUE9XRVJTQVZFOiBzbnByaW50ZihwQ2FwU3RyLCBzaXplb2YoIlNUQV9QT1dFUlNBVkUiKSwgIiVzIiwgIlNUQV9QT1dFUlNBVkUiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcENhcFN0ciArPSBzdHJsZW4oIlNUQV9QT1dFUlNBVkUiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICBjYXNlIEFQX1VBUFNEOiBzbnByaW50ZihwQ2FwU3RyLCBzaXplb2YoIkFQX1VBUFNEIiksICIlcyIsICJBUF9VQVBTRCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2FwU3RyICs9IHN0cmxlbigiQVBfVUFQU0QiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICBjYXNlIEFQX0RGUzogc25wcmludGYocENhcFN0ciwgc2l6ZW9mKCJBUF9ERlMiKSwgIiVzIiwgIkFQX0RGUyIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2FwU3RyICs9IHN0cmxlbigiQVBfREZTIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgY2FzZSBCTE9DS0FDSzogc25wcmludGYocENhcFN0ciwgc2l6ZW9mKCJCTE9DS0FDSyIpLCAiJXMiLCAiQkxPQ0tBQ0siKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcENhcFN0ciArPSBzdHJsZW4oIkJMT0NLQUNLIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgY2FzZSBQSFlfRVJSOiBzbnByaW50ZihwQ2FwU3RyLCBzaXplb2YoIlBIWV9FUlIiKSwgIiVzIiwgIlBIWV9FUlIiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcENhcFN0ciArPSBzdHJsZW4oIlBIWV9FUlIiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICBjYXNlIEJDTl9GSUxURVI6IHNucHJpbnRmKHBDYXBTdHIsIHNpemVvZigiQkNOX0ZJTFRFUiIpLCAiJXMiLCAiQkNOX0ZJTFRFUiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2FwU3RyICs9IHN0cmxlbigiQkNOX0ZJTFRFUiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgIGNhc2UgUlRUOiBzbnByaW50ZihwQ2FwU3RyLCBzaXplb2YoIlJUVCIpLCAiJXMiLCAiUlRUIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBDYXBTdHIgKz0gc3RybGVuKCJSVFQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICBjYXNlIFJBVEVDVFJMOiBzbnByaW50ZihwQ2FwU3RyLCBzaXplb2YoIlJBVEVDVFJMIiksICIlcyIsICJSQVRFQ1RSTCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2FwU3RyICs9IHN0cmxlbigiUkFURUNUUkwiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICBjYXNlIFdPVzogc25wcmludGYocENhcFN0ciwgc2l6ZW9mKCJXT1ciKSwgIiVzIiwgIldPVyIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2FwU3RyICs9IHN0cmxlbigiV09XIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgY2FzZSBXTEFOX1JPQU1fU0NBTl9PRkZMT0FEOiBzbnByaW50ZihwQ2FwU3RyLCBzaXplb2YoIldMQU5fUk9BTV9TQ0FOX09GRkxPQUQiKSwgIiVzIiwgIldMQU5fUk9BTV9TQ0FOX09GRkxPQUQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcENhcFN0ciArPSBzdHJsZW4oIldMQU5fUk9BTV9TQ0FOX09GRkxPQUQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICBjYXNlIEZXX0lOX1RYX1BBVEg6IHNucHJpbnRmKHBDYXBTdHIsIHNpemVvZigiRldfSU5fVFhfUEFUSCIpLCAiJXMiLCAiRldfSU5fVFhfUEFUSCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2FwU3RyICs9IHN0cmxlbigiRldfSU5fVFhfUEFUSCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgIGNhc2UgSFQ0MF9PQlNTX1NDQU46CisgICAgICAgICAgICAgICAgICAgICAgICAgIHNucHJpbnRmKHBDYXBTdHIsIHNpemVvZigiSFQ0MF9PQlNTX1NDQU4iKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiVzIiwgIkhUNDBfT0JTU19TQ0FOIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBDYXBTdHIgKz0gc3RybGVuKCJIVDQwX09CU1NfU0NBTiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgIGNhc2UgRVhURU5ERURfTlNPRkZMT0FEX1NMT1Q6IHNucHJpbnRmKHBDYXBTdHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCJFWFRFTkRFRF9OU09GRkxPQURfU0xPVCIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlcyIsICJFWFRFTkRFRF9OU09GRkxPQURfU0xPVCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2FwU3RyICs9IHN0cmxlbigiRVhURU5ERURfTlNPRkZMT0FEX1NMT1QiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICBjYXNlIFRETFNfU0NBTl9DT0VYSVNURU5DRTogc25wcmludGYocENhcFN0ciwgc2l6ZW9mKCJURExTX1NDQU5fQ09FWElTVEVOQ0UiKSwgIiVzIiwgIlRETFNfU0NBTl9DT0VYSVNURU5DRSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2FwU3RyICs9IHN0cmxlbigiVERMU19TQ0FOX0NPRVhJU1RFTkNFIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgY2FzZSBDSF9TV0lUQ0hfVjE6IHNucHJpbnRmKHBDYXBTdHIsIHNpemVvZigiQ0hfU1dJVENIX1YxIiksICIlcyIsICJDSF9TV0lUQ0hfVjEiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcENhcFN0ciArPSBzdHJsZW4oIkNIX1NXSVRDSF9WMSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfTElOS19MQVlFUl9TVEFUUworICAgICAgICAgICAgICAgICAgICAgY2FzZSBMSU5LX0xBWUVSX1NUQVRTX01FQVM6IHNucHJpbnRmKHBDYXBTdHIsIHNpemVvZigiTElOS19MQVlFUl9TVEFUU19NRUFTIiksICIlcyIsICJMSU5LX0xBWUVSX1NUQVRTX01FQVMiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcENhcFN0ciArPSBzdHJsZW4oIkxJTktfTEFZRVJfU1RBVFNfTUVBUyIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyNlbmRpZgorI2lmZGVmIFdMQU5fRkVBVFVSRV9FWFRTQ0FOCisgICAgICAgICAgICAgICAgICAgICBjYXNlIEVYVEVOREVEX1NDQU46IHNucHJpbnRmKHBDYXBTdHIsIHNpemVvZigiRVhURU5ERURfU0NBTiIpLCAiJXMiLCAiRVhURU5ERURfU0NBTiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2FwU3RyICs9IHN0cmxlbigiRVhURU5ERURfU0NBTiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyNlbmRpZgorICAgICAgICAgICAgICAgICAgICAgY2FzZSBNVV9NSU1POiBzbnByaW50ZihwQ2FwU3RyLCBzaXplb2YoIk1VX01JTU8iKSwgIiVzIiwgIk1VX01JTU8iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcENhcFN0ciArPSBzdHJsZW4oIk1VX01JTU8iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICAgICAgIGNhc2UgRFlOQU1JQ19XTU1fUFM6IHNucHJpbnRmKHBDYXBTdHIsIHNpemVvZigiRFlOQU1JQ19XTU1fUFMiKSwgIiVzIiwgIkRZTkFNSUNfV01NX1BTIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBDYXBTdHIgKz0gc3RybGVuKCJEWU5BTUlDX1dNTV9QUyIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgIGNhc2UgRldfU1RBVFM6IHNucHJpbnRmKHBDYXBTdHIsIHNpemVvZigiRldfU1RBVFMiKSwgIiVzIiwgIkZXX1NUQVRTIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBDYXBTdHIgKz0gc3RybGVuKCJGV19TVEFUUyIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgIGNhc2UgTUFDX1NQT09GRURfU0NBTjogc25wcmludGYocENhcFN0ciwgc2l6ZW9mKCJNQUNfU1BPT0ZFRF9TQ0FOIiksICIlcyIsICJNQUNfU1BPT0ZFRF9TQ0FOIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBDYXBTdHIgKz0gc3RybGVuKCJNQUNfU1BPT0ZFRF9TQ0FOIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgY2FzZSBXUFNfUFJCUlNQX1RNUEw6IHNucHJpbnRmKHBDYXBTdHIsIHNpemVvZigiV1BTX1BSQlJTUF9UTVBMIiksICIlcyIsICJXUFNfUFJCUlNQX1RNUEwiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcENhcFN0ciArPSBzdHJsZW4oIldQU19QUkJSU1BfVE1QTCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgIGNhc2UgQkNOX0lFX0ZMVF9ERUxUQTogc25wcmludGYocENhcFN0ciwgc2l6ZW9mKCJCQ05fSUVfRkxUX0RFTFRBIiksICIlcyIsICJCQ05fSUVfRkxUX0RFTFRBIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBDYXBTdHIgKz0gc3RybGVuKCJCQ05fSUVfRkxUX0RFTFRBIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgY2FzZSBNR01UX0ZSQU1FX0xPR0dJTkc6IHNucHJpbnRmKHBDYXBTdHIsIHNpemVvZigiTUdNVF9GUkFNRV9MT0dHSU5HIiksICIlcyIsICJNR01UX0ZSQU1FX0xPR0dJTkciKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcENhcFN0ciArPSBzdHJsZW4oIk1HTVRfRlJBTUVfTE9HR0lORyIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgIGNhc2UgQk1VX0VSUk9SX0dFTkVSSUNfUkVDT1ZFUlk6IHNucHJpbnRmKHBDYXBTdHIsIHNpemVvZigiQk1VX0VSUk9SX0dFTkVSSUNfUkVDT1ZFUlkiKSwgIiVzIiwgIkJNVV9FUlJPUl9HRU5FUklDX1JFQ09WRVJZIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBDYXBTdHIgKz0gc3RybGVuKCJCTVVfRVJST1JfR0VORVJJQ19SRUNPVkVSWSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgICAgICAgY2FzZSBESVNBOiBzbnByaW50ZihwQ2FwU3RyLCBzaXplb2YoIkRJU0EiKSwgIiVzIiwgIkRJU0EiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcENhcFN0ciArPSBzdHJsZW4oIkRJU0EiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICAgICAgIGNhc2UgVERMU19PRkZfQ0hBTk5FTDogc25wcmludGYocENhcFN0ciwgc2l6ZW9mKCJURExTX09GRl9DSEFOTkVMIiksICIlcyIsICJURExTX09GRl9DSEFOTkVMIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBDYXBTdHIgKz0gc3RybGVuKCJURExTX09GRl9DSEFOTkVMIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgY2FzZSBMT0dHSU5HX0VOSEFOQ0VNRU5UOiBzbnByaW50ZihwQ2FwU3RyLCBzaXplb2YoIkxPR0dJTkdfRU5IQU5DRU1FTlQiKSwgIiVzIiwgIkxPR0dJTkdfRU5IQU5DRU1FTlQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcENhcFN0ciArPSBzdHJsZW4oIkxPR0dJTkdfRU5IQU5DRU1FTlQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKworICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICpwQ2FwU3RyKysgPSAnLCc7CisgICAgICAgICAgICAgICAgICpwQ2FwU3RyKysgPSAnICc7CisgICAgICAgICAgICAgfQorICAgICAgICAgfQorICAgICB9CisgICAgIHBDYXBTdHIgLT0gMjsKKyAgICAgKnBDYXBTdHIgPSAnXDAnOworICAgICBXUEFMX1RS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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJTklUSUFMSVpBVElPTiBBUElzCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyoqCisgQGJyaWVmIFdESV9Jbml0IGlzIHVzZWQgdG8gaW5pdGlhbGl6ZSB0aGUgREFMLgorCisgREFMIHdpbGwgYWxsb2NhdGUgYWxsIHRoZSByZXNvdXJjZXMgaXQgbmVlZHMuIEl0IHdpbGwgb3BlbiBQQUwsIGl0IHdpbGwgYWxzbworIG9wZW4gYm90aCB0aGUgZGF0YSBhbmQgdGhlIGNvbnRyb2wgdHJhbnNwb3J0IHdoaWNoIGluIHRoZWlyIHR1cm4gd2lsbCBvcGVuCisgRFhFL1NNRCBvciBhbnkgb3RoZXIgZHJpdmVycyB0aGF0IHRoZXkgbmVlZC4KKworIEBwYXJhbSBkZXZIYW5kbGU6IHBvaW50ZXIgdG8gdGhlIE9TIHNwZWNpZmljIGRldmljZSBoYW5kbGUKKyAgICAgICAgcHBXRElHbG9iYWxDdHg6IG91dHB1dCBwb2ludGVyIG9mIEdsb2JhbCBDb250ZXh0CisgICAgICAgIHBXZGlEZXZDYXBhYmlsaXR5OiBvdXRwdXQgcG9pbnRlciBvZiBkZXZpY2UgY2FwYWJpbGl0eQorCisgQHJldHVybiBSZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGwKKyovCitXRElfU3RhdHVzCitXRElfSW5pdAorKAorICB2b2lkKiAgICAgICAgICAgICAgICAgICAgICBkZXZIYW5kbGUsCisgIHZvaWQqKiAgICAgICAgICAgICAgICAgICAgIHBwV0RJR2xvYmFsQ3R4LAorICBXRElfRGV2aWNlQ2FwYWJpbGl0eVR5cGUqICBwV2RpRGV2Q2FwYWJpbGl0eSwKKyAgdW5zaWduZWQgaW50ICAgICAgICAgICAgICAgZHJpdmV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VhdENhcHMpOworICAgZ3BIb3N0V2xhbkZlYXRDYXBzID0gTlVMTDsKKyAgIGdwRndXbGFuRmVhdENhcHMgPSBOVUxMOworICAgLypDbGVhciBjb250cm9sIGJsb2NrLiAgbm90ZSB0aGF0IHRoaXMgd2lsbCBjbGVhciB0aGUgIm1hZ2ljIgorICAgICB3aGljaCB3aWxsIGluaGliaXQgYWxsIGFzeW5jaHJvbm91cyBjYWxsYmFja3MqLworICAgV0RJX0NsZWFuQ0IoJmdXRElDYik7CisgICByZXR1cm4gd3B0U3RhdHVzOworCit9LypXRElfU2h1dGRvd24qLworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0NBTiBBUElzCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyoqCisgQGJyaWVmIFdESV9Jbml0U2NhblJlcSB3aWxsIGJlIGNhbGxlZCB3aGVuIHRoZSB1cHBlciBNQUMgd2FudHMKKyAgICAgICAgdGhlIFdMQU4gRGV2aWNlIHRvIGdldCByZWFkeSBmb3IgYSBzY2FuIHByb2NlZHVyZS4gVXBvbgorICAgICAgICB0aGUgY2FsbCBvZiB0aGlzIEFQSSB0aGUgV0xBTiBEQUwgd2lsbCBwYWNrIGFuZCBzZW5kIGEKKyAgICAgICAgSEFMIEluaXQgU2NhbiByZXF1ZXN0IG1lc3NhZ2UgdG8gdGhlIGxvd2VyIFJJVkEKKyAgICAgICAgc3ViLXN5c3RlbSBpZiBEQUwgaXMgaW4gc3RhdGUgU1RBUlRFRC4KKworICAgICAgICBJbiBzdGF0ZSBCVVNZIHRoaXMgcmVxdWVzdCB3aWxsIGJlIHF1ZXVlZC4gUmVxdWVzdCB3b24ndAorICAgICAgICBiZSBhbGxvd2VkIGluIGFueSBvd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50KCZnV0RJQ2IsIFdESV9SRVFVRVNUX0VWRU5ULCAmd2RpRXZlbnREYXRhKTsKKworfS8qV0RJX0ZpbmlzaFNjYW5SZXEqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgICAgIEFTU09DSUFUSU9OIEFQSXMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKioKKyBAYnJpZWYgV0RJX0pvaW5SZXEgd2lsbCBiZSBjYWxsZWQgd2hlbiB0aGUgdXBwZXIgTUFDIGlzIHJlYWR5CisgICAgICAgIHRvIHN0YXJ0IGFuIGFzc29jaWF0aW9uIHByb2NlZHVyZSB0byBhIEJTUy4gVXBvbiB0aGUKKyAgICAgICAgY2FsbCBvZiB0aGlzIEFQSSB0aGUgV0xBTiBEQUwgd2lsbCBwYWNrIGFuZCBzZW5kIGEgSEFMCisgICAgICAgIEpvaW4gcmVxdWVzdCBtZXNzYWdlIHRvIHRoZSBsb3dlciBSSVZBIHN1Yi1zeXN0ZW0gaWYKKyAgICAgICAgREFMIGlzIGluIHN0YXRlIFNUQVJURUQuCisKKyAgICAgICAgSW4gc3RhdGUgQlVTWSB0aGlzIHJlcXVlc3Qgd2lsbCBiZSBxdWV1ZWQuIFJlcXVlc3Qgd29uJ3QKKyAgICAgICAgYmUgYWxsb3dlZCBpbiBhbnkgb3RoZXIgc3RhdGUuCisKKyBXRElfU3RhcnQgbXVzdCBoYXZlIGJlZW4gY2FsbGVkLgorCisgQHBhcmFtIHdkaUpvaW5QYXJhbXM6IHRoZSBqb2luIHBhcmFtZXRlcnMgYXMgc3BlY2lmaWVkIGJ5CisgICAgICAgICAgICAgICAgICAgICAgdGhlIERldmljZSBJbnRlcmZhY2UKKworICAgICAgICB3ZGlKb2luUnNwQ2I6IGNh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nBFdmVudERhdGEgICAgICA9IHB3ZGlEZWxTVEFQYXJhbXM7CisgIHdkaUV2ZW50RGF0YS51RXZlbnREYXRhU2l6ZSAgPSBzaXplb2YoKnB3ZGlEZWxTVEFQYXJhbXMpOworICB3ZGlFdmVudERhdGEucENCZm5jICAgICAgICAgID0gd2RpRGVsU1RBUnNwQ2I7CisgIHdkaUV2ZW50RGF0YS5wVXNlckRhdGEgICAgICAgPSBwVXNlckRhdGE7CisKKyAgcmV0dXJuIFdESV9Qb3N0TWFpbkV2ZW50KCZnV0RJQ2IsIFdESV9SRVFVRVNUX0VWRU5ULCAmd2RpRXZlbnREYXRhKTsKKworfS8qV0RJX0RlbFNUQVJlcSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0VDVVJJVFkgQVBJcworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qKgorIEBicmllZiBXRElfU2V0QlNTS2V5UmVxIHdpbGwgYmUgY2FsbGVkIHdoZW4gdGhlIHVwcGVyIE1BQyB3YW50cyB0bworICAgICAgICBpbnN0YWxsIGEgQlNTIGVuY3J5cHRpb24ga2V5IG9uIHRoZSBIVy4gVXBvbiB0aGUgY2FsbCBvZiB0aGlzCisgICAgICAgIEFQSSB0aGUgV0xBTiBEQUwgd2lsbCBwYWNrIGFuZCBzZW5kIGEgU2V0IEJTUyBLZXkgcmVxdWVzdAorICAgICAgICBtZXNzYWdlIHRvIHRoZSBsb3dlciBSSVZBIHN1Yi1zeXN0ZW0gaWYgREFMIGlzIGluIHN0YXRlCisgICAgICAgIFNUQVJURUQuCisKKyAgICAgICAgSW4gc3RhdGUgQlVTWSB0aGlzIHJlcXVlc3Qgd2lsbCBiZSBxdWV1ZWQuIFJlcXVlc3Qg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gIHdkaUV2ZW50RGF0YS53ZGlSZXF1ZXN0ICAgICAgPSBXRElfVFNNX1NUQVRTX1JFUTsKKyAgd2RpRXZlbnREYXRhLnBFdmVudERhdGEgICAgICA9IHB3ZGlUc21SZXFQYXJhbXM7IAorICB3ZGlFdmVudERhdGEudUV2ZW50RGF0YVNpemUgID0gc2l6ZW9mKCpwd2RpVHNtUmVxUGFyYW1zKTsgCisgIHdkaUV2ZW50RGF0YS5wQ0JmbmMgICAgICAgICAgPSB3ZGlSZXFTdGF0dXNDYjsgCisgIHdkaUV2ZW50RGF0YS5wVXNlckRhdGEgICAgICAgPSBwVXNlckRhdGE7CisKKyAgcmV0dXJuIFdESV9Qb3N0TWFpbkV2ZW50KCZnV0RJQ2IsIFdESV9SRVFVRVNUX0VWRU5ULCAmd2RpRXZlbnREYXRhKTsKKworfQorI2VuZGlmCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09IAorIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFFvUyBhbmQgQkEgQVBJcworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qKgorIEBicmllZiBXRElfQWRkVFNSZXEgd2lsbCBiZSBjYWxsZWQgd2hlbiB0aGUgdXBwZXIgTUFDIHRvIGluZm9ybQorICAgICAgICB0aGUgZGV2aWNlIG9mIGEgc3VjY2Vzc2Z1bCBhZGQgVFNwZWMgbmVnb3RpYXRpb24uIEhXCisgICAgICAgIG5lZWRzIHRvIHJlY2VpdmUgdGhlIFRTcGVjIEluZm8gZnJvbSB0aGUgVU1BQyBpbiBvcmRlcgorICAgICAgICB0byBjb25maWd1cmUgcHJvcGVybHkgdGhlIFFvUyBkYXRhIHRyYWZmaWMuIFVwb24gdGhlCisgICAgICAgIGNhbGwgb2YgdGhpcyBBUEkgdGhlIFdMQU4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RpRXZlbnREYXRhKTsKKworfS8qV0RJX0RlbEJBUmVxKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBvd2VyIFNhdmUgQVBJcworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qKgorIEBicmllZiBXRElfU2V0UHdyU2F2ZUNmZ1JlcSB3aWxsIGJlIGNhbGxlZCB3aGVuIHRoZSB1cHBlciBNQUMKKyAgICAgICAgd2FudHMgdG8gc2V0IHRoZSBwb3dlciBzYXZlIHJlbGF0ZWQgY29uZmlndXJhdGlvbnMgb2YKKyAgICAgICAgdGhlIFdMQU4gRGV2aWNlLiBVcG9uIHRoZSBjYWxsIG9mIHRoaXMgQVBJIHRoZSBXTEFOIERBTAorICAgICAgICB3aWxsIHBhY2sgYW5kIHNlbmQgYSBIQUwgVXBkYXRlIENGRyByZXF1ZXN0IG1lc3NhZ2UgdG8KKyAgICAgICAgdGhlIGxvd2VyIFJJVkEgc3ViLXN5c3RlbSBpZiBEQUwgaXMgaW4gc3RhdGUgU1RBUlRFRC4KKworICAgICAgICBJbiBzdGF0ZSBCVVNZIHRoaXMgcmVxdWVzdCB3aWxsIGJlIHF1ZXVlZC4gUmVxdWVzdCB3b24ndAorICAgICAgICBiZSBhbGxvd2VkIGluIGFueSBvdGhlciBzdGF0ZS4KKworIFdESV9TdGFydCBtdXN0IGhhdmUgYmVlbiBjYWxsZWQuCisKKyBAcGFyYW0gcHdkaVBvd2VyU2F2ZUNmZzogdGhlIHBvd2VyIHNhdmUgY2ZnIHBhcmFtZXRlcnMgYXMKKyAgICAgICAgICAgICAgICAgICAgICBzcGVjaWZpZWQgYnkgdGhlIERldmljZSBJbnRlcmZhY2UKKworICAgICAgICB3ZGlTZXRQd3JTYXZ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XRhLnVFdmVudERhdGFTaXplICA9IHNpemVvZigqcHdkaU9lbURhdGFSZXFQYXJhbXMpOyAKKyAgIHdkaUV2ZW50RGF0YS5wQ0JmbmMgICAgICAgICAgPSB3ZGlPZW1EYXRhUnNwQ2I7IAorICAgd2RpRXZlbnREYXRhLnBVc2VyRGF0YSAgICAgICA9IHBVc2VyRGF0YTsKKworICAgcmV0dXJuIFdESV9Qb3N0TWFpbkV2ZW50KCZnV0RJQ2IsIFdESV9SRVFVRVNUX0VWRU5ULCAmd2RpRXZlbnREYXRhKTsKKworCit9CisKKyNlbmRpZgorCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ09OVFJPTCBBUElzCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKy8qKgorIEBicmllZiBXRElfU3dpdGNoQ2hSZXEgd2lsbCBiZSBjYWxsZWQgd2hlbiB0aGUgdXBwZXIgTUFDIHdhbnRzCisgICAgICAgIHRoZSBXTEFOIEhXIHRvIGNoYW5nZSB0aGUgY3VycmVudCBjaGFubmVsIG9mIG9wZXJhdGlvbi4KKyAgICAgICAgVXBvbiB0aGUgY2FsbCBvZiB0aGlzIEFQSSB0aGUgV0xBTiBEQUwgd2lsbCBwYWNrIGFuZAorICAgICAgICBzZW5kIGEgSEFMIFN0YXJ0IHJlcXVlc3QgbWVzc2FnZSB0byB0aGUgbG93ZXIgUklWQQorICAgICAgICBzdWItc3lzdGVtIGlmIERBTCBpcyBpbiBzdGF0ZSBTVEFSVEVELgorCisgICAgICAgIEluIHN0YXRlIEJVU1kgdGhpcyByZXF1ZXN0IHdpbGwgYmUgcXVldWVkLiBSZXF1ZXN0IHdvbid0CisgICAgICAgIGJlIGFsbG93ZWQgaW4gYW55IG90aGVy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xEdW1wQ21kUmVxUGFyYW1zOworICB3ZGlFdmVudERhdGEudUV2ZW50RGF0YVNpemUgPSAgIHNpemVvZihXRElfSEFMRHVtcENtZFJlcVBhcmFtc1R5cGUpOworICB3ZGlFdmVudERhdGEucENCZm5jICAgICAgICAgPSAgIGhhbER1bXBDbWRSc3BDYjsKKyAgd2RpRXZlbnREYXRhLnBVc2VyRGF0YSAgICAgID0gICBwVXNlckRhdGE7CisKKyAgcmV0dXJuIFdESV9Qb3N0TWFpbkV2ZW50KCZnV0RJQ2IsIFdESV9SRVFVRVNUX0VWRU5ULCAmd2RpRXZlbnREYXRhKTsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgIERBTCBDb250cm9sIFBhdGggTWFpbiBGU00gRnVuY3Rpb24gSW1wbGVtZW50YXRpb24KKworID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKioKKyBAYnJpZWYgTWFpbiBGU00gU3RhcnQgZnVuY3Rpb24gZm9yIGFsbCBzdGF0ZXMgZXhjZXB0IEJVU1kKKworCisgQHBhcmFtICBwV0RJQ3R4OiAgICAgICAgIHBvaW50ZXIgdG8gdGhlIFdMQU4gREFMIGNvbnRleHQKKyAgICAgICAgIHdkaUVWOiAgICAgICAgICAgZXZlbnQgcG9zdGVkIHRvIHRoZSBtYWluIERBTCBGU00KKyAgICAgICAgIHBFdmVudERhdGE6ICAgICAgcG9pbnRlciB0byB0aGUgZXZlbnQgaW5mb3JtYXRpb24KKyAgICAgICAgIHN0cnVjdHVyZQorCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cworV0RJX1Bvc3RNYWluRXZlbnQKKygKKyAgV0RJX0NvbnRyb2xCbG9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Y2Vzc1JlcXVlc3QoIHBXRElDdHgsIHBFdmVudERhdGEgKTsKKworfS8qV0RJX01haW5TaHV0ZG93bkJ1c3kqLworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICBXTEFOIERBTCBDb250cm9sIFBhdGggTWFpbiBQcm9jZXNzaW5nIEZ1bmN0aW9ucworCisqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgICAgIE1haW4gREFMIENvbnRyb2wgUGF0aCBSZXF1ZXN0IFByb2Nlc3NpbmcgQVBJCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworLyoqCisgQGJyaWVmIFByb2Nlc3MgU3RhcnQgUmVxdWVzdCBmdW5jdGlvbiAoY2FsbGVkIHdoZW4gTWFpbiBGU00KKyAgICAgICAgYWxsb3dzIGl0KQorCisgQHBhcmFtICBwV0RJQ3R4OiAgICAgICAgIHBvaW50ZXIgdG8gdGhlIFdMQU4gREFMIGNvbnRleHQKKyAgICAgICAgIHBFdmVudERhdGE6ICAgICAgcG9pbnRlciB0byB0aGUgZXZlbnQgaW5mb3JtYXRpb24gc3RydWN0dXJlCisKKyBAc2VlCisgQHJldHVybiBSZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGwKKyovCitXRElfU3RhdHVzCitXRElfUHJvY2Vzc1N0YXJ0UmVxCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispCit7CisgIFdESV9TdGFydFJlc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Ki8KKyAgIHdwdFN0YXR1cyA9IHdwYWxDbG9zZShwV0RJQ3R4LT5wUEFMQ29udGV4dCk7CisgICBpZiAoIGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUyAhPSAgd3B0U3RhdHVzICkKKyAgIHsKKyAgICAgV1BBTF9UUkFDRShlV0xBTl9NT0RVTEVfREFMX0NUUkwsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICJGYWlsZWQgdG8gd3BhbCBDbG9zZSAlZCIsIHdwdFN0YXR1cyk7CisgICAgIFdESV9BU1NFUlQoMCk7CisgICB9CisKKyAgIC8qVHJhbnNpdGlvbiBiYWNrIHRvIGluaXQgc3RhdGUqLworICAgV0RJX1NUQVRFX1RSQU5TSVRJT04oIHBXRElDdHgsIFdESV9JTklUX1NUKTsKKworICAgd3BhbE11dGV4UmVsZWFzZSgmcFdESUN0eC0+d3B0TXV0ZXgpOworCisgICAvKk1ha2Ugc3VyZSB0aGUgZXhwZWN0ZWQgc3RhdGUgaXMgcHJvcGVybHkgZGVmYXVsdGVkIHRvIEluaXQqLworICAgcFdESUN0eC0+dWNFeHBlY3RlZFN0YXRlVHJhbnNpdGlvbiA9IFdESV9JTklUX1NUOworCisgICByZXR1cm4gV0RJX1NUQVRVU19TVUNDRVNTOworfS8qV0RJX1Byb2Nlc3NDbG9zZVJlcSovCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICAgICAgICAgICAgICAgIFNDQU5JTkcgUkVRVUVTVCBQUk9DRVNTSU5HIEFQSQorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyoqCisgQGJyaWVmIFByb2Nlc3MgSW5pdCBTY2FuIFJlcXVlc3QgZnVuY3Rpb24gKGNhbGxlZCB3aGVuIE1haW4gRlNNCisgICAgICAgIGFsbG93cyBpdCkKKworIEBwYXJhbSAgcFdESUN0eDogICAgICAgICBwb2ludGVyIHRvIHRoZSBXTEFOIERBTCBjb250ZXh0CisgICAgICAgICBwRXZlbnREYXRhOiAgICAgIHBvaW50ZXIgdG8gdGhlIGV2ZW50IGluZm9ybWF0aW9uIHN0cnVjdHVyZQorCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cworV0RJX1Byb2Nlc3NJbml0U2NhblJlcQorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKQoreworICBXRElfSW5pdFNjYW5SZXFQYXJhbXNUeXBlKiAgcHdkaUluaXRTY2FuUGFyYW1zICAgID0gTlVMTDsKKyAgV0RJX0luaXRTY2FuUnNwQ2IgICAgICAgICAgIHdkaUluaXRTY2FuUnNwQ2IgICAgICA9IE5VTEw7CisgIHdwdF91aW50OCogICAgICAgICAgICAgICAgICBwU2VuZEJ1ZmZlciAgICAgICAgICAgPSBOVUxMOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICAgdXNEYXRhT2Zmc2V0ICAgICAgICAgID0gMDsKKyAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgICAgIHVzU2VuZFNpemUgICAgICAgICAgICA9IDA7CisgIHdwdF91aW50OCAgICAgICAgICAgICAgICAgICBpID0gMDsKKworICB0SGFsSW5pdFNjYW5SZXFNc2cgICAgICAgICAgaGFsSW5pdFNjYW5SZXFNc2c7CisKKyAgLypUaGlzIGlzIHRlbXBvcmFyeSBmaXguCisgICAqIEl0IHNob2xkIGJlIHJlbW92ZWQgb25jZSBob3N0IGFuZCByaXZhIGNoYW5nZXMgYXJlIGluIHN5bmMqLworICB0SGFsSW5pdFNjYW5Db25SZXFNc2cgICAgICAgaGFsSW5pdFNjYW5Db25S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ZW50IGluZm9ybWF0aW9uIHN0cnVjdHVyZQorCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cworV0RJX1Byb2Nlc3NGaW5pc2hTY2FuUmVxCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispCit7CisgIFdESV9GaW5pc2hTY2FuUmVxUGFyYW1zVHlwZSogIHB3ZGlGaW5pc2hTY2FuUGFyYW1zOworICBXRElfRmluaXNoU2NhblJzcENiICAgICAgICAgICB3ZGlGaW5pc2hTY2FuUnNwQ2I7CisgIHdwdF91aW50OCogICAgICAgICAgICAgICAgICAgIHBTZW5kQnVmZmVyICAgICAgICAgID0gTlVMTDsKKyAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgICAgICAgdXNEYXRhT2Zmc2V0ICAgICAgICAgPSAwOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICAgICB1c1NlbmRTaXplICAgICAgICAgICA9IDA7CisgIHdwdF91aW50OCAgICAgICAgICAgICAgICAgICAgIGkgICAgICAgICAgICAgICAgICAgID0gMDsKKyAgd3B0X3N0YXR1cyAgICAgICAgICAgICAgICAgICAgd3B0U3RhdHVzOworICB0SGFsRmluaXNoU2NhblJlcU1zZyAgICAgICAgICBoYWxGaW5pc2hTY2FuUmVxTXNnOworICAvKi0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtICovCisKKyAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgU2FuaXR5IGNoZWNrCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisgIHJldHVybiAgV0RJX1NlbmRNc2coIHBXRElDdHgsIHBTZW5kQnVmZmVyLCB1c1NlbmRTaXplLAorICAgICAgICAgICAgICAgICAgICAgICB3ZGlGaW5pc2hTY2FuUnNwQ2IsIHBFdmVudERhdGEtPnBVc2VyRGF0YSwgV0RJX0ZJTklTSF9TQ0FOX1JFU1ApOworfS8qV0RJX1Byb2Nlc3NGaW5pc2hTY2FuUmVxKi8KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAgICAgICAgICAgICAgIEFTU09DSUFUSU9OIFJFUVVFU1QgQVBJCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisvKioKKyBAYnJpZWYgUHJvY2VzcyBCU1MgSm9pbiBmb3IgYSBnaXZlbiBTZXNzaW9uCisKKyBAcGFyYW0gIHBXRElDdHg6ICAgICAgICAgcG9pbnRlciB0byB0aGUgV0xBTiBEQUwgY29udGV4dAorICAgICAgICAgcEV2ZW50RGF0YTogICAgICBwb2ludGVyIHRvIHRoZSBldmVudCBpbmZvcm1hdGlvbiBzdHJ1Y3R1cmUKKworIEBzZWUKKyBAcmV0dXJuIFJlc3VsdCBvZiB0aGUgZnVuY3Rpb24gY2FsbAorKi8KK1dESV9TdGF0dXMKK1dESV9Qcm9jZXNzQlNTU2Vzc2lvbkpvaW5SZXEKKygKKyAgV0RJX0NvbnRyb2xCbG9ja1R5cGUqICAgcFdESUN0eCwKKyAgV0RJX0pvaW5SZXFQYXJhbXNUeXBlKiAgcHdkaUpvaW5QYXJhbXMsCisgIFdESV9Kb2luUnNwQ2IgICAgICAgICAgIHdkaUpva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EV2ZW50RGF0YQorKQoreworICBXRElfQ29uZmlnQlNTUmVxUGFyYW1zVHlwZSogIHB3ZGlDb25maWdCU1NQYXJhbXM7CisgIFdESV9Db25maWdCU1NSc3BDYiAgICAgICAgICAgd2RpQ29uZmlnQlNTUnNwQ2I7CisgIHdwdF91aW50OCAgICAgICAgICAgICAgICAgICAgdWNDdXJyZW50QlNTU2VzSWR4ICA9IDA7CisgIFdESV9CU1NTZXNzaW9uVHlwZSogICAgICAgICAgcEJTU1NlcyAgICAgICAgICAgICA9IE5VTEw7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgdU1zZ1NpemUgICAgICAgICAgICA9IDA7CisgIHdwdF91aW50OCogICAgICAgICAgICAgICAgICAgcFNlbmRCdWZmZXIgICAgICAgICA9IE5VTEw7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgdXNEYXRhT2Zmc2V0ICAgICAgICA9IDA7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgdXNTZW5kU2l6ZSAgICAgICAgICA9IDA7CisgIFdESV9TdGF0dXMgICAgICAgICAgICAgICAgICAgd2RpU3RhdHVzICAgICAgICAgICA9IFdESV9TVEFUVVNfU1VDQ0VTUzsKKworICB0Q29uZmlnQnNzUmVxTXNnICAgICAgICAgICAgIGhhbENvbmZpZ0Jzc1JlcU1zZzsKKyAgLyotIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAqLworCisgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgIFNhbml0eSBjaGVjaworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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dESUN0eDogICAgICAgICBwb2ludGVyIHRvIHRoZSBXTEFOIERBTCBjb250ZXh0CisgICAgICAgICBwRXZlbnREYXRhOiAgICAgIHBvaW50ZXIgdG8gdGhlIGV2ZW50IGluZm9ybWF0aW9uIHN0cnVjdHVyZQorCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cworV0RJX1Byb2Nlc3NQb3N0QXNzb2NSZXEKKygKKyAgV0RJX0NvbnRyb2xCbG9ja1R5cGUqICBwV0RJQ3R4LAorICBXRElfRXZlbnRJbmZvVHlwZSogICAgIHBFdmVudERhdGEKKykKK3sKKyAgV0RJX1Bvc3RBc3NvY1JlcVBhcmFtc1R5cGUqIHB3ZGlQb3N0QXNzb2NQYXJhbXMgICA9IE5VTEw7CisgIFdESV9Qb3N0QXNzb2NSc3BDYiAgICAgICAgICB3ZGlQb3N0QXNzb2NSc3BDYiAgICAgPSBOVUxMOworICB3cHRfdWludDggICAgICAgICAgICAgICAgICAgdWNDdXJyZW50QlNTU2VzSWR4ICAgID0gMDsKKyAgV0RJX0JTU1Nlc3Npb25UeXBlKiAgICAgICAgIHBCU1NTZXMgICAgICAgICAgICAgICA9IE5VTEw7CisgIHdwdF91aW50OCogICAgICAgICAgICAgICAgICBwU2VuZEJ1ZmZlciAgICAgICAgICAgPSBOVUxMOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICAgdXNEYXRhT2Zmc2V0ICAgICAgICAgID0gMDsKKyAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgICAgIHVzU2VuZFNpemUgICAgICAgICAgICA9IDA7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICB1TXNnU2l6ZSAgICAgICAgICAgICAgPSAwOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICAgdU9mZnNldCAgICAgICAgICAgICAgID0gMDsKKyAgV0RJX1N0YXR1cyAgICAgICAgICAgICAgICAgIHdkaVN0YXR1c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orIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cworV0RJX1Byb2Nlc3NEZWxTVEFSZXEKKygKKyAgV0RJX0NvbnRyb2xCbG9ja1R5cGUqICBwV0RJQ3R4LAorICBXRElfRXZlbnRJbmZvVHlwZSogICAgIHBFdmVudERhdGEKKykKK3sKKyAgV0RJX0RlbFNUQVJlcVBhcmFtc1R5cGUqICBwd2RpRGVsU1RBUGFyYW1zOworICBXRElfRGVsU1RBUnNwQ2IgICAgICAgICAgIHdkaURlbFNUQVJzcENiOworICB3cHRfdWludDggICAgICAgICAgICAgICAgIHVjQ3VycmVudEJTU1Nlc0lkeCAgPSAwOworICBXRElfQlNTU2Vzc2lvblR5cGUqICAgICAgIHBCU1NTZXMgICAgICAgICAgICAgPSBOVUxMOworICB3cHRfdWludDgqICAgICAgICAgICAgICAgIHBTZW5kQnVmZmVyICAgICAgICAgPSBOVUxMOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgIHVzRGF0YU9mZnNldCAgICAgICAgPSAwOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgIHVzU2VuZFNpemUgICAgICAgICAgPSAwOworICB3cHRfbWFjQWRkciAgICAgICAgICAgICAgIG1hY0JTU0lEOworICBXRElfU3RhdHVzICAgICAgICAgICAgICAgIHdkaVN0YXR1cyAgICAgICAgICAgPSBXRElfU1RBVFVTX1NVQ0NFU1M7CisKKyAgdERlbGV0ZVN0YVJlcU1zZyAgICAgICAgICBoYWxEZWxTdGFSZXFNc2c7CisgIC8qLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gKi8KKworICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICBTYW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pemUsCisgICAgICAgICAgICAgICAgICAgICAgIHdkaURlbFNUQVJzcENiLCBwRXZlbnREYXRhLT5wVXNlckRhdGEsIFdESV9ERUxfU1RBX1JFU1ApOworCit9LypXRElfUHJvY2Vzc0RlbFNUQVJlcSovCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgICAgICAgICAgICBTRUNVUklUWSBSRVFVRVNUIFBST0NFU1NJTkcgQVBJCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisvKioKKyBAYnJpZWYgUHJvY2VzcyBTZXQgQlNTIEtleSBSZXF1ZXN0IGZ1bmN0aW9uIChjYWxsZWQgd2hlbiBNYWluIEZTTQorICAgICAgICBhbGxvd3MgaXQpCisKKyBAcGFyYW0gIHBXRElDdHg6ICAgICAgICAgcG9pbnRlciB0byB0aGUgV0xBTiBEQUwgY29udGV4dAorICAgICAgICAgcEV2ZW50RGF0YTogICAgICBwb2ludGVyIHRvIHRoZSBldmVudCBpbmZvcm1hdGlvbiBzdHJ1Y3R1cmUKKworIEBzZWUKKyBAcmV0dXJuIFJlc3VsdCBvZiB0aGUgZnVuY3Rpb24gY2FsbAorKi8KK1dESV9TdGF0dXMKK1dESV9Qcm9jZXNzU2V0QnNzS2V5UmVxCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispCit7CisgIFdESV9TZXRCU1NLZXlSZXFQYXJhbXNUeXBlKiAgcHdkaVNldEJTU0tleVBhcmFtczsKKyAgV0RJX1NldEJTU0tleVJzcENiICAgICAgICAgICB3ZGlTZXRCU1NLZXlSc3BDYjsKKyAgd3B0X3VpbnQ4ICAgICAgICAgICAgICAgICAgICB1Y0N1cnJlbnRCU1NTZX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KHB3ZGlTZXRCU1NLZXlQYXJhbXMtPndkaUJTU0tleUluZm8ud2RpRW5jVHlwZSk7CisKKyAgaGFsU2V0QnNzS2V5UmVxTXNnLnNldEJzc0tleVBhcmFtcy5udW1LZXlzID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwd2RpU2V0QlNTS2V5UGFyYW1zLT53ZGlCU1NLZXlJbmZvLnVjTnVtS2V5czsKKworICBmb3Ioa2V5SW5kZXggPSAwOyBrZXlJbmRleCA8IHB3ZGlTZXRCU1NLZXlQYXJhbXMtPndkaUJTU0tleUluZm8udWNOdW1LZXlzIDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5SW5kZXgrKykKKyAgeworICAgIGhhbFNldEJzc0tleVJlcU1zZy5zZXRCc3NLZXlQYXJhbXMua2V5W2tleUluZGV4XS5rZXlJZCA9CisgICAgICAgICAgICAgICAgICAgICAgcHdkaVNldEJTU0tleVBhcmFtcy0+d2RpQlNTS2V5SW5mby5hS2V5c1trZXlJbmRleF0ua2V5SWQ7CisgICAgaGFsU2V0QnNzS2V5UmVxTXNnLnNldEJzc0tleVBhcmFtcy5rZXlba2V5SW5kZXhdLnVuaWNhc3QgPQorICAgICAgICAgICAgICAgICAgICAgcHdkaVNldEJTU0tleVBhcmFtcy0+d2RpQlNTS2V5SW5mby5hS2V5c1trZXlJbmRleF0udW5pY2FzdDsKKyAgICBoYWxTZXRCc3NLZXlSZXFNc2cuc2V0QnNzS2V5UGFyYW1zLmtleVtrZXlJbmRleF0ua2V5RGlyZWN0aW9uID0KKyAgICAgICAgICAgICAgICBwd2RpU2V0QlNTS2V5UGFyYW1zLT53ZGlCU1NLZXlJbmZvLmFLZXlzW2tleUluZGV4XS5rZXlEaXJlY3Rpb247CisKKyAgICBpZihXRElfZ2V0SG9zdFdsYW5GZWF0Q2FwcyhESVNBKSAmJiBXRElfZ2V0RndXbGFuRmVhdENhc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ZXlzW2tleUluZGV4XS5rZXlSc2MsCisgICAgICAgICAgICAgICAgICAgICBXRElfTUFYX0tFWV9SU0NfTEVOKTsKKyAgICAgIHdwYWxNZW1vcnlDb3B5KGhhbFNldEJzc0tleVJlcU1zZy5zZXRCc3NLZXlQYXJhbXMua2V5W2tleUluZGV4XS5rZXksCisgICAgICAgICAgICAgICAgICAgICBwd2RpU2V0QlNTS2V5UGFyYW1zLT53ZGlCU1NLZXlJbmZvLmFLZXlzW2tleUluZGV4XS5rZXksCisgICAgICAgICAgICAgICAgICAgICBXRElfTUFYX0tFWV9MRU5HVEgpOworICAgIH0KKyAgICBoYWxTZXRCc3NLZXlSZXFNc2cuc2V0QnNzS2V5UGFyYW1zLmtleVtrZXlJbmRleF0ucGFlUm9sZSA9CisgICAgICAgICAgICAgICAgICAgICBwd2RpU2V0QlNTS2V5UGFyYW1zLT53ZGlCU1NLZXlJbmZvLmFLZXlzW2tleUluZGV4XS5wYWVSb2xlOworICAgIGhhbFNldEJzc0tleVJlcU1zZy5zZXRCc3NLZXlQYXJhbXMua2V5W2tleUluZGV4XS5rZXlMZW5ndGggPQorICAgICAgICAgICAgICAgICAgIHB3ZGlTZXRCU1NLZXlQYXJhbXMtPndkaUJTU0tleUluZm8uYUtleXNba2V5SW5kZXhdLmtleUxlbmd0aDsKKyAgfQorCisgIHdwYWxNZW1vcnlDb3B5KCBwU2VuZEJ1ZmZlcit1c0RhdGFPZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICZoYWxTZXRCc3NLZXlSZXFNc2cuc2V0QnNzS2V5UGFyYW1zLAorICAgICAgICAgICAgICAgICAgICBzaXplb2YoaGFsU2V0QnNzS2V5UmVxTXNnLnNldEJzc0tleVBhcmFtcykpOworCisgIHBXRElDdHgtPndkaVJlcVN0YXR1c0NCICAgICA9IHB3ZGlTZXRCU1NLZXlQYXJhbXMtPndkaVJlcVN0YXR1c0NCOworICBwV0RJQ3R4LT5wUmVxU3RhdHVzVXNlckRhdGEgPSBwd2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gIFdESV9TZXRTVEFLZXlSc3BDYiAgICAgICAgICAgd2RpU2V0U1RBS2V5UnNwQ2I7CisgIFdESV9CU1NTZXNzaW9uVHlwZSogICAgICAgICAgcEJTU1NlcyAgICAgICAgICAgICA9IE5VTEw7CisgIHdwdF91aW50OCogICAgICAgICAgICAgICAgICAgcFNlbmRCdWZmZXIgICAgICAgICA9IE5VTEw7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgdXNEYXRhT2Zmc2V0ICAgICAgICA9IDA7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgdXNTZW5kU2l6ZSAgICAgICAgICA9IDA7CisgIFdESV9TdGF0dXMgICAgICAgICAgICAgICAgICAgd2RpU3RhdHVzICAgICAgICAgICA9IFdESV9TVEFUVVNfU1VDQ0VTUzsKKyAgd3B0X21hY0FkZHIgICAgICAgICAgICAgICAgICBtYWNCU1NJRDsKKyAgd3B0X3VpbnQ4ICAgICAgICAgICAgICAgICAgICB1Y0N1cnJlbnRCU1NTZXNJZHg7CisgIHRTZXRTdGFLZXlSZXFNc2cgICAgICAgICAgICAgaGFsU2V0U3RhS2V5UmVxTXNnICA9IHt7MH19OworICB3cHRfdWludDggICAgICAgICAgICAgICAgICAgIGtleUluZGV4ICAgICAgICAgICAgPSAwOworICB3cHRfdWludDggICAgICAgICAgICAgICAgICAgIGk7CisKKyAgLyotIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAqLworCisgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgIFNhbml0eSBjaGVjaworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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BmdW5jdGlvbiAoY2FsbGVkIHdoZW4gTWFpbiBGU00KKyAgICAgICAgYWxsb3dzIGl0KQorCisgQHBhcmFtICBwV0RJQ3R4OiAgICAgICAgIHBvaW50ZXIgdG8gdGhlIFdMQU4gREFMIGNvbnRleHQKKyAgICAgICAgIHBFdmVudERhdGE6ICAgICAgcG9pbnRlciB0byB0aGUgZXZlbnQgaW5mb3JtYXRpb24gc3RydWN0dXJlCisKKyBAc2VlCisgQHJldHVybiBSZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGwKKyovCitXRElfU3RhdHVzCitXRElfUHJvY2Vzc1NldFN0YUJjYXN0S2V5UmVxCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispCit7CisgIFdESV9TZXRTVEFLZXlSZXFQYXJhbXNUeXBlKiAgcHdkaVNldFNUQUtleVBhcmFtczsKKyAgV0RJX1NldFNUQUtleVJzcENiICAgICAgICAgICB3ZGlTZXRTVEFLZXlSc3BDYjsKKyAgV0RJX0JTU1Nlc3Npb25UeXBlKiAgICAgICAgICBwQlNTU2VzICAgICAgICAgICAgID0gTlVMTDsKKyAgd3B0X3VpbnQ4KiAgICAgICAgICAgICAgICAgICBwU2VuZEJ1ZmZlciAgICAgICAgID0gTlVMTDsKKyAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgICAgICB1c0RhdGFPZmZzZXQgICAgICAgID0gMDsKKyAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgICAgICB1c1NlbmRTaXplICAgICAgICAgID0gMDsKKyAgV0RJX1N0YXR1cyAgICAgICAgICAgICAgICAgICB3ZGlTdGF0dXMgICAgICAgICAgID0gV0RJX1NUQVRVU19TVUNDRVNTOworICB3cHRfbWFjQWRkciAgICAgICAgICAgICAgICAgIG1hY0JTU0lEOworICB3cHRfdWludDggICAgICAgICAgICAgICAgICAgIHVjQ3VycmVudEJTU1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ICAgICAgICAgIiVzOiBOZWdhdGVkIEtleXMiLCBfX2Z1bmNfXyk7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICBXUEFMX1RSQUNFKGVXTEFOX01PRFVMRV9EQUxfQ1RSTCwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgIiVzOiBObyBjaGFuZ2UgaW4gS2V5cyIsIF9fZnVuY19fKTsKKyAgICAgIHdwYWxNZW1vcnlDb3B5KGhhbFNldFN0YUtleVJlcU1zZy5zZXRTdGFLZXlQYXJhbXMua2V5W2tleUluZGV4XS5rZXlSc2MsCisgICAgICAgICAgICAgICAgICAgICBwd2RpU2V0U1RBS2V5UGFyYW1zLT53ZGlLZXlJbmZvLndkaUtleVtrZXlJbmRleF0ua2V5UnNjLAorICAgICAgICAgICAgICAgICAgICAgV0RJX01BWF9LRVlfUlNDX0xFTik7CisgICAgICB3cGFsTWVtb3J5Q29weShoYWxTZXRTdGFLZXlSZXFNc2cuc2V0U3RhS2V5UGFyYW1zLmtleVtrZXlJbmRleF0ua2V5LAorICAgICAgICAgICAgICAgICAgICAgcHdkaVNldFNUQUtleVBhcmFtcy0+d2RpS2V5SW5mby53ZGlLZXlba2V5SW5kZXhdLmtleSwKKyAgICAgICAgICAgICAgICAgICAgIFdESV9NQVhfS0VZX0xFTkdUSCk7CisgICAgfQorICAgIGhhbFNldFN0YUtleVJlcU1zZy5zZXRTdGFLZXlQYXJhbXMua2V5W2tleUluZGV4XS5wYWVSb2xlID0KKyAgICAgICAgICAgICAgICAgICAgIHB3ZGlTZXRTVEFLZXlQYXJhbXMtPndkaUtleUluZm8ud2RpS2V5W2tleUluZGV4XS5wYWVSb2xlOworICAgIGhhbFNldFN0YUtleVJlcU1zZy5zZXRTdGFLZXlQYXJhbXMua2V5W2tleUluZGV4XS5rZXlMZW5ndGggPQorICAgICAgICAgICAgICAgICAgIHB3ZGlTZXRTVEFLZXlQYXJhbXMtPndkaUtleUluZm8ud2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4KKyAgICAgICAgTWFpbiBGU00gYWxsb3dzIGl0KQorCisgQHBhcmFtICBwV0RJQ3R4OiAgICAgICAgIHBvaW50ZXIgdG8gdGhlIFdMQU4gREFMIGNvbnRleHQKKyAgICAgICAgIHBFdmVudERhdGE6ICAgICAgcG9pbnRlciB0byB0aGUgZXZlbnQgaW5mb3JtYXRpb24gc3RydWN0dXJlCisKKyBAc2VlCisgQHJldHVybiBSZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGwKKyovCitXRElfU3RhdHVzCitXRElfUHJvY2Vzc1JlbW92ZVN0YUJjYXN0S2V5UmVxCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispCit7CisgIFdESV9SZW1vdmVTVEFLZXlSZXFQYXJhbXNUeXBlKiAgcHdkaVJlbW92ZVNUQUJjYXN0S2V5UGFyYW1zOworICBXRElfUmVtb3ZlU1RBS2V5UnNwQ2IgICAgICAgICAgIHdkaVJlbW92ZVNUQUtleVJzcENiOworICBXRElfQlNTU2Vzc2lvblR5cGUqICAgICAgICAgICAgIHBCU1NTZXMgICAgICAgICAgICAgICAgPSBOVUxMOworICB3cHRfdWludDgqICAgICAgICAgICAgICAgICAgICAgIHBTZW5kQnVmZmVyICAgICAgICAgICAgPSBOVUxMOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICAgICAgIHVzRGF0YU9mZnNldCAgICAgICAgICAgPSAwOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICAgICAgIHVzU2VuZFNpemUgICAgICAgICAgICAgPSAwOworICBXRElfU3RhdHVzICAgICAgICAgICAgICAgICAgICAgIHdkaVN0YXR1cyAgICAgICAgICAgICAgPSBXRElfU1RBVFVTX1NVQ0NFU1M7CisgIHdwdF9tYWNBZGRyICAgICAgICAgICAgICAgICAgICAgbWFjQlNTSUQ7CisgIHdwdF91aW50OCAgICAgICAgICAgICAgIC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Ki0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICBTZW5kIFJlbW92ZSBTVEEgS2V5IFJlcXVlc3QgdG8gSEFMCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworICByZXR1cm4gIFdESV9TZW5kTXNnKCBwV0RJQ3R4LCBwU2VuZEJ1ZmZlciwgdXNTZW5kU2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgd2RpUmVtb3ZlU1RBS2V5UnNwQ2IsIHBFdmVudERhdGEtPnBVc2VyRGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgV0RJX1JNVl9TVEFfS0VZX1JFU1ApOworCit9LypXRElfUHJvY2Vzc1JlbW92ZVNUQUJjYXN0S2V5UmVxKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgICAgICAgICAgICAgIFFPUyBhbmQgQkEgUFJPQ0VTU0lORyBSRVFVRVNUIEFQSQorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworLyoqCisgQGJyaWVmIFByb2Nlc3MgQWRkIFRTcGVjIFJlcXVlc3QgZnVuY3Rpb24gKGNhbGxlZCB3aGVuIE1haW4gRlNNCisgICAgICAgIGFsbG93cyBpdCkKKworIEBwYXJhbSAgcFdESUN0eDogICAgICAgICBwb2ludGVyIHRvIHRoZSBXTEFOIERBTCBjb250ZXh0CisgICAgICAgICBwRXZlbnREYXRhOiAgICAgIHBvaW50ZXIgdG8gdGhlIGV2ZW50IGluZm9ybWF0aW9uIHN0cnVjdHVyZQorCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cworV0RJX1Byb2Nlc3NBZGRUU3BlY1JlcQorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKQoreworICBXRElfQWRkVFNSZXFQYXJhbXNUeXBlKiAgcHdkaUFkZFRTUGFyYW1zOworICBXRElfQWRkVHNSc3BDYiAgICAgICAgICAgd2RpQWRkVFNSc3BDYjsKKyAgd3B0X3VpbnQ4ICAgICAgICAgICAgICAgIHVjQ3VycmVudEJTU1Nlc0lkeCAgPSAwOworICBXRElfQlNTU2Vzc2lvblR5cGUqICAgICAgcEJTU1NlcyAgICAgICAgICAgICA9IE5VTEw7CisgIHdwdF91aW50OCogICAgICAgICAgICAgICBwU2VuZEJ1ZmZlciAgICAgICAgID0gTlVMTDsKKyAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgIHVzRGF0YU9mZnNldCAgICAgICAgPSAwOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgdXNTZW5kU2l6ZSAgICAgICAgICA9IDA7CisgIFdESV9TdGF0dXMgICAgICAgICAgICAgICB3ZGlTdGF0dXMgICAgICAgICAgID0gV0RJX1NUQVRVU19TVUNDRVNTOworICB3cHRfbWFjQWRkciAgICAgICAgICAgICAgbWFjQlNTSUQ7CisgIHRBZGRUc1BhcmFtcyAgICAgICAgICAgICBoYWxBZGRUc1BhcmFtcyAgICAgID0gezB9OworCisgIC8qLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gKi8KKworICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0K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N0eDogICAgICAgICBwb2ludGVyIHRvIHRoZSBXTEFOIERBTCBjb250ZXh0CisgICAgICAgICBwRXZlbnREYXRhOiAgICAgIHBvaW50ZXIgdG8gdGhlIGV2ZW50IGluZm9ybWF0aW9uIHN0cnVjdHVyZQorCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cworV0RJX1Byb2Nlc3NEZWxUU3BlY1JlcQorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKQoreworICBXRElfRGVsVFNSZXFQYXJhbXNUeXBlKiAgICAgIHB3ZGlEZWxUU1BhcmFtczsKKyAgV0RJX0RlbFRzUnNwQ2IgICAgICAgICAgICAgICB3ZGlEZWxUU1JzcENiOworICB3cHRfdWludDggICAgICAgICAgICAgICAgICAgIHVjQ3VycmVudEJTU1Nlc0lkeCAgPSAwOworICBXRElfQlNTU2Vzc2lvblR5cGUqICAgICAgICAgIHBCU1NTZXMgICAgICAgICAgICAgPSBOVUxMOworICB3cHRfdWludDgqICAgICAgICAgICAgICAgICAgIHBTZW5kQnVmZmVyICAgICAgICAgPSBOVUxMOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICAgIHVzRGF0YU9mZnNldCAgICAgICAgPSAwOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICAgIHVzU2VuZFNpemUgICAgICAgICAgPSAwOworICBXRElfU3RhdHVzICAgICAgICAgICAgICAgICAgIHdkaVN0YXR1cyAgICAgICAgICAgPSBXRElfU1RBVFVTX1NVQ0NFU1M7CisgIC8qLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gKi8KKworICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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gQHJldHVybiBSZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGwKKyovCitXRElfU3RhdHVzCitXRElfUHJvY2Vzc0FkZEJBU2Vzc2lvblJlcQorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKQoreworICBXRElfQWRkQkFTZXNzaW9uUmVxUGFyYW1zVHlwZSogIHB3ZGlBZGRCQVNlc3Npb25QYXJhbXM7CisgIFdESV9BZGRCQVNlc3Npb25Sc3BDYiAgICAgICAgICAgd2RpQWRkQkFTZXNzaW9uUnNwQ2I7CisgIHdwdF91aW50OCAgICAgICAgICAgICAgICAgICAgICAgdWNDdXJyZW50QlNTU2VzSWR4ICA9IDA7CisgIFdESV9CU1NTZXNzaW9uVHlwZSogICAgICAgICAgICAgcEJTU1NlcyAgICAgICAgICAgICA9IE5VTEw7CisgIHdwdF91aW50OCogICAgICAgICAgICAgICAgICAgICAgcFNlbmRCdWZmZXIgICAgICAgICA9IE5VTEw7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgICAgdXNEYXRhT2Zmc2V0ICAgICAgICA9IDA7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgICAgdXNTZW5kU2l6ZSAgICAgICAgICA9IDA7CisgIFdESV9TdGF0dXMgICAgICAgICAgICAgICAgICAgICAgd2RpU3RhdHVzICAgICAgICAgICA9IFdESV9TVEFUVVNfU1VDQ0VTUzsKKyAgd3B0X21hY0FkZHIgICAgICAgICAgICAgICAgICAgICBtYWNCU1NJRDsKKworICB0QWRkQkFTZXNzaW9uUmVxTXNnICAgICAgICAgICAgIGhhbEFkZEJBU2Vzc2lvblJlcTsKKyAgLyotIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAqLworCisgIC8qLS0tLS0tLS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VzCitXRElfUHJvY2Vzc0RlbEJBUmVxCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispCit7CisgIFdESV9EZWxCQVJlcVBhcmFtc1R5cGUqICAgICAgcHdkaURlbEJBUGFyYW1zOworICBXRElfRGVsQkFSc3BDYiAgICAgICAgICAgICAgIHdkaURlbEJBUnNwQ2I7CisgIHdwdF91aW50OCAgICAgICAgICAgICAgICAgICAgdWNDdXJyZW50QlNTU2VzSWR4ICA9IDA7CisgIFdESV9CU1NTZXNzaW9uVHlwZSogICAgICAgICAgcEJTU1NlcyAgICAgICAgICAgICA9IE5VTEw7CisgIHdwdF91aW50OCogICAgICAgICAgICAgICAgICAgcFNlbmRCdWZmZXIgICAgICAgICA9IE5VTEw7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgdXNEYXRhT2Zmc2V0ICAgICAgICA9IDA7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgdXNTZW5kU2l6ZSAgICAgICAgICA9IDA7CisgIFdESV9TdGF0dXMgICAgICAgICAgICAgICAgICAgd2RpU3RhdHVzICAgICAgICAgICA9IFdESV9TVEFUVVNfU1VDQ0VTUzsKKyAgd3B0X21hY0FkZHIgICAgICAgICAgICAgICAgICBtYWNCU1NJRDsKKyAgdERlbEJBUGFyYW1zICAgICAgICAgICAgICAgICBoYWxEZWxCQXBhcmFtOworICAvKi0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtICovCisKKyAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgU2FuaXR5IGNoZWNrCisgIC0tLS0tLS0tLS0tLS0tLS0tLS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IHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKQoreworICBXRElfVFNNU3RhdHNSZXFQYXJhbXNUeXBlKiAgcHdkaVRTTVBhcmFtczsKKyAgV0RJX1RzbVJzcENiICAgICAgICAgICAgICAgIHdkaVRTTVJzcENiOworICB3cHRfdWludDggICAgICAgICAgICAgICAgICAgdWNDdXJyZW50QlNTU2VzSWR4ICAgPSAwOyAKKyAgV0RJX0JTU1Nlc3Npb25UeXBlKiAgICAgICAgIHBCU1NTZXMgICAgICAgICAgICAgID0gTlVMTDsKKyAgd3B0X3VpbnQ4KiAgICAgICAgICAgICAgICAgIHBTZW5kQnVmZmVyICAgICAgICAgID0gTlVMTDsgCisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICB1c0RhdGFPZmZzZXQgICAgICAgICA9IDA7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICB1c1NlbmRTaXplICAgICAgICAgICA9IDA7CisgIFdESV9TdGF0dXMgICAgICAgICAgICAgICAgICB3ZGlTdGF0dXMgICAgICAgICAgICA9IFdESV9TVEFUVVNfU1VDQ0VTUzsgCisgIHRUc21TdGF0c1BhcmFtcyAgICAgICAgICAgICBoYWxUc21TdGF0c1JlcVBhcmFtcyA9IHswfTsKKyAgCisgIC8qLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gKi8KKworICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgICBTYW5pdHkgY2hlY2sgCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworICBpZiAoKCB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uIChjYWxsZWQgd2hlbiBNYWluIEZTTQorICAgICAgICBhbGxvd3MgaXQpCisKKyBAcGFyYW0gIHBXRElDdHg6ICAgICAgICAgcG9pbnRlciB0byB0aGUgV0xBTiBEQUwgY29udGV4dAorICAgICAgICAgcEV2ZW50RGF0YTogICAgICBwb2ludGVyIHRvIHRoZSBldmVudCBpbmZvcm1hdGlvbiBzdHJ1Y3R1cmUKKworIEBzZWUKKyBAcmV0dXJuIFJlc3VsdCBvZiB0aGUgZnVuY3Rpb24gY2FsbAorKi8KK1dESV9TdGF0dXMKK1dESV9Qcm9jZXNzQWRkU1RBU2VsZlJlcQorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKQoreworICBXRElfQWRkU1RBU2VsZlJlcVBhcmFtc1R5cGUqICAgICAgICAgIHB3ZGlBZGRTVEFTZWxmUmVxUGFyYW1zOworICBXRElfQWRkU1RBU2VsZlBhcmFtc1JzcENiICAgICAgICAgICAgIHdkaUFkZFNUQVNlbGZSZXFSc3BDYjsKKyAgd3B0X3VpbnQ4KiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2VuZEJ1ZmZlciAgICAgICAgID0gTlVMTDsKKyAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c0RhdGFPZmZzZXQgICAgICAgID0gMDsKKyAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c1NlbmRTaXplICAgICAgICAgID0gMDsKKyAgdEFkZFN0YVNlbGZQYXJhbXNfVjEgICAgICAgICAgICAgICAgICBoYWxBZGRTVEFTZWxmUGFyYW1zOworICAvKi0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtICovCisKKyAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0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0gTlVMTDsKKyAgV0RJX29lbURhdGFSc3BDYiAgICAgICAgICAgICB3ZGlPZW1EYXRhUnNwQ2I7CisgIHdwdF91aW50OCogICAgICAgICAgICAgICAgICAgcFNlbmRCdWZmZXIgICAgICAgICA9IE5VTEw7IAorICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICAgIHVzRGF0YU9mZnNldCAgICAgICAgPSAwOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICAgIHVzU2VuZFNpemUgICAgICAgICAgPSAwOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICAgIHJlcUxlbjsKKyAgdFN0YXJ0T2VtRGF0YVJlcVBhcmFtcyogICAgICBoYWxTdGFydE9lbURhdGFSZXFQYXJhbXM7CisKKyAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgIFNhbml0eSBjaGVjaworICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyAgaWYgKCggTlVMTCA9PSBwRXZlbnREYXRhICkgfHwgKCBOVUxMID09IHBFdmVudERhdGEtPnBFdmVudERhdGEgKSB8fAorICAgICAgKCBOVUxMID09IHBFdmVudERhdGEtPnBDQmZuYyApKQorICB7CisgICAgICBXUEFMX1RSQUNFKCBlV0xBTl9NT0RVTEVfREFMX0NUUkwsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgIiVzOiBJbnZhbGlkIHBhcmFtZXRlcnMiLCBfX2Z1bmNfXyk7CisgICAgICBXRElfQVNTRVJUKDApOworICAgICAgcmV0dXJuIFdESV9TVEFUVVNfRV9GQUlMVVJFOworICB9CisKKyAgcHdkaU9lbURhdGFSZXFQYXJhbXMgPSAoV0RJX29lbURhdGFS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IHBXRElDdHgsIHBTZW5kQnVmZmVyLCB1c1NlbmRTaXplLCAKKyAgICAgICAgICAgICAgICAgICAgICAgIHdkaU9lbURhdGFSc3BDYiwgcEV2ZW50RGF0YS0+cFVzZXJEYXRhLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0RJX1NUQVJUX09FTV9EQVRBX1JFU1ApOyAKK30vKldESV9Qcm9jZXNzU3RhcnRPZW1EYXRhUmVxKi8KKyNlbmRpZgorCisvKioKKyBAYnJpZWYgUHJvY2VzcyBIb3N0IFJlc3VtZSBSZXF1ZXN0IGZ1bmN0aW9uIChjYWxsZWQgd2hlbiBNYWluCisgICAgICAgIEZTTSBhbGxvd3MgaXQpCisKKyBAcGFyYW0gIHBXRElDdHg6ICAgICAgICAgcG9pbnRlciB0byB0aGUgV0xBTiBEQUwgY29udGV4dAorICAgICAgICAgcEV2ZW50RGF0YTogICAgICBwb2ludGVyIHRvIHRoZSBldmVudCBpbmZvcm1hdGlvbiBzdHJ1Y3R1cmUKKworIEBzZWUKKyBAcmV0dXJuIFJlc3VsdCBvZiB0aGUgZnVuY3Rpb24gY2FsbAorKi8KK1dESV9TdGF0dXMKK1dESV9Qcm9jZXNzSG9zdFJlc3VtZVJlcQorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKQoreworICBXRElfUmVzdW1lUGFyYW1zVHlwZSogICAgICAgICAgcHdkaUhvc3RSZXN1bWVQYXJhbXMgPSBOVUxMOworICBXRElfSG9zdFJlc3VtZUV2ZW50UnNwQ2IgICAgICAgd2RpSG9zdFJlc3VtZVJzcENiOworICB3cHRfdWludDgqICAgICAgICAgICAgICAgICAgICAgcFNlbmRCdWZmZXIgICAgICAgICA9IE5VTEw7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgICB1c0RhdGFPZmZzZXQgICAgICAgID0gMDsKK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xdWVzdCB0byBIQUwKKyAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworICAgcmV0dXJuICBXRElfU2VuZE1zZyggcFdESUN0eCwgcFNlbmRCdWZmZXIsIHVzU2VuZFNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICBwd2RpU2V0VHhQZXJUcmFja2luZ1JzcENiLCBwRXZlbnREYXRhLT5wVXNlckRhdGEsIFdESV9TRVRfVFhfUEVSX1RSQUNLSU5HX1JFU1ApOworfS8qV0RJX1Byb2Nlc3NTZXRUeFBlclRyYWNraW5nUmVxKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEluZGljYXRpb25zCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyoqCisgQGJyaWVmIFByb2Nlc3MgU3VzcGVuZCBJbmRpY2F0aW9ucyBmdW5jdGlvbiAoY2FsbGVkIHdoZW4gTWFpbiBGU00gYWxsb3dzIGl0KQorCisgQHBhcmFtICBwV0RJQ3R4OiAgICAgICAgIHBvaW50ZXIgdG8gdGhlIFdMQU4gREFMIGNvbnRleHQKKyAgICAgICAgIHBFdmVudERhdGE6ICAgICAgcG9pbnRlciB0byB0aGUgZXZlbnQgaW5mb3JtYXRpb24gc3RydWN0dXJlCisKKyBAc2VlCisgQHJldHVybiBSZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGwKKyovCitXRElfU3RhdHVzCitXRElfUHJvY2Vzc0hvc3RTdXNwZW5kSW5kCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUq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KKyAgcmV0dXJuICAoIHdkaVN0YXR1cyAhPSBXRElfU1RBVFVTX1NVQ0NFU1MgKT93ZGlTdGF0dXM6V0RJX1NUQVRVU19TVUNDRVNTX1NZTkM7Cit9LypXRElfUHJvY2Vzc0hvc3RTdXNwZW5kSW5kKi8KKworCisKKy8qKgorIEBicmllZiBQcm9jZXNzIFRyYWZmaWMgU3RhdHMgSW5kaWNhdGlvbnMgZnVuY3Rpb24gKGNhbGxlZCB3aGVuIE1haW4gRlNNIGFsbG93cyBpdCkKKworIEBwYXJhbSAgcFdESUN0eDogICAgICAgICBwb2ludGVyIHRvIHRoZSBXTEFOIERBTCBjb250ZXh0CisgICAgICAgICAgICAgIHBFdmVudERhdGE6ICAgICAgcG9pbnRlciB0byB0aGUgZXZlbnQgaW5mb3JtYXRpb24gc3RydWN0dXJlCisKKyBAc2VlCisgQHJldHVybiBSZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGwKKyovCitXRElfU3RhdHVzCitXRElfUHJvY2Vzc1RyYWZmaWNTdGF0c0luZAorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKQoreworICBXRElfVHJhZmZpY1N0YXRzSW5kVHlwZSogICAgICAgcFRyYWZmaWNTdGF0c0luZFBhcmFtczsKKyAgd3B0X3VpbnQ4KiAgICAgICAgICAgICAgICAgICAgIHBTZW5kQnVmZmVyICAgICAgICAgPSBOVUxMOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICAgICAgdXNEYXRhT2Zmc2V0ICAgICAgICA9IDA7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgICB1c1NlbmRTaXplICAgICAgICAgID0gMDsKKyAgV0RJX1N0YXR1cyAgICAgICAgICAgICAgICAgICAgIHdkaVN0YXR1czsKKyAgdFN0YXRzQ2xhc3NCSW5kUGFyYW1zKiAgICAgICAgIHBTdGF0c0NsYXNzQk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TZW50IFdMQU5fSEFMX0FERF9QRVJJT0RJQ19UWF9QVFJOX0lORCB0byBIQUwuIiwgX19mdW5jX18pOworCisgIHJldHVybiAod2RpU3RhdHVzICE9IFdESV9TVEFUVVNfU1VDQ0VTUykgPyB3ZGlTdGF0dXMgOiBXRElfU1RBVFVTX1NVQ0NFU1NfU1lOQzsKK30gLyogV0RJX1Byb2Nlc3NBZGRQZXJpb2RpY1R4UHRybkluZCAqLworCisvKioKKyBAYnJpZWYgUHJvY2VzcyBEZWxldGUgUGVyaW9kaWMgVHggUGF0dGVybiBJbmRpY2F0aW9uIGZ1bmN0aW9uIChjYWxsZWQgd2hlbgorICAgICAgICAgICBNYWluIEZTTSBhbGxvd3MgaXQpCisKKyBAcGFyYW0gcFdESUN0eDogICAgICAgICBwb2ludGVyIHRvIHRoZSBXTEFOIERBTCBjb250ZXh0CisgICAgICAgIHBFdmVudERhdGE6ICAgICAgcG9pbnRlciB0byB0aGUgZXZlbnQgaW5mb3JtYXRpb24gc3RydWN0dXJlCisKKyBAc2VlCisgQHJldHVybiBSZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGwKKyovCitXRElfU3RhdHVzCitXRElfUHJvY2Vzc0RlbFBlcmlvZGljVHhQdHJuSW5kCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispCit7CisgIFdESV9EZWxQZXJpb2RpY1R4UHRyblBhcmFtc1R5cGUgICAqcERlbFBlcmlvZGljVHhQdHJuUGFyYW1zOworICB3cHRfdWludDgqICAgICAgICAgICAgICAgICAgICAgcFNlbmRCdWZmZXIgICAgICAgICA9IE5VTEw7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgICB1c0RhdGFPZmZzZXQgICAgICAgID0gMDsKKyAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgICAgICAgIHVzU2VuZFNpemUgICAgICAgICAgPSAwOworIC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ICAgICAgICAgICAgICIlczogU2VudCBXTEFOX0hBTF9ERUxfUEVSSU9ESUNfVFhfUFRSTl9JTkQgdG8gSEFMLiIsIF9fZnVuY19fKTsKKworICByZXR1cm4gKHdkaVN0YXR1cyAhPSBXRElfU1RBVFVTX1NVQ0NFU1MpID8gd2RpU3RhdHVzIDogV0RJX1NUQVRVU19TVUNDRVNTX1NZTkM7Cit9IC8qIFdESV9Qcm9jZXNzRGVsUGVyaW9kaWNUeFB0cm5JbmQgKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgICAgICAgICAgICAgTUlTQyBDT05UUk9MIFBST0NFU1NJTkcgUkVRVUVTVCBBUEkKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKy8qKgorIEBicmllZiBQcm9jZXNzIENoYW5uZWwgU3dpdGNoIFJlcXVlc3QgZnVuY3Rpb24gKGNhbGxlZCB3aGVuCisgICAgICAgIE1haW4gRlNNIGFsbG93cyBpdCkKKworIEBwYXJhbSAgcFdESUN0eDogICAgICAgICBwb2ludGVyIHRvIHRoZSBXTEFOIERBTCBjb250ZXh0CisgICAgICAgICBwRXZlbnREYXRhOiAgICAgIHBvaW50ZXIgdG8gdGhlIGV2ZW50IGluZm9ybWF0aW9uIHN0cnVjdHVyZQorCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cworV0RJX1Byb2Nlc3NDaGFubmVsU3dpdGNoUmVxCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispCit7CisgIFdESV9Td2l0Y2hDaFJlcVBhcmFtc1R5cGUqICAgcHdkaVN3aXRjaENoU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0eCggJmhhbENvbmZpZ1N0YVJlcU1zZy51U3RhUGFyYW1zLmNvbmZpZ1N0YVBhcmFtcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnB3ZGlDb25maWdTVEFQYXJhbXMtPndkaVJlcUluZm8pOworCisgIGlmKHB3ZGlDb25maWdTVEFQYXJhbXMtPndkaVJlcUluZm8ud2RpU1RBVHlwZSA9PSBXRElfU1RBX0VOVFJZX1NFTEYpCisgIHsKKyAgICAvKiBOZWVkIHRvIGZpbGwgaW4gdGhlIHNlbGYgU1RBIEluZGV4ICovCisgICAgaWYgKCBXRElfU1RBVFVTX1NVQ0NFU1MgIT0KKyAgICAgICAgIFdESV9TVEFUYWJsZUZpbmRTdGFpZEJ5QWRkcihwV0RJQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB3ZGlDb25maWdTVEFQYXJhbXMtPndkaVJlcUluZm8ubWFjU1RBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh3cHRfdWludDgqKSZoYWxDb25maWdTdGFSZXFNc2cudVN0YVBhcmFtcy5jb25maWdTdGFQYXJhbXMuc3RhSWR4ICkpCisgICAgeworICAgICAgV1BBTF9UUkFDRSggZVdMQU5fTU9EVUxFX0RBTF9DVFJMLCAgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICBNQUNfQUREUkVTU19TVFIKKyAgICAgICAgICAgICAgICAgICI6IFRoaXMgc3RhdGlvbiBkb2VzIG5vdCBleGlzdCBpbiB0aGUgV0RJIFN0YXRpb24gVGFibGUiLAorICAgICAgICAgICAgICAgIE1BQ19BRERSX0FSUkFZKHB3ZGlDb25maWdTVEFQYXJhbXMtPndkaVJlcUluZm8ubWFjU1RBKSk7CisgICAgICB3cGFsTXV0ZXhSZWxlYXNlKCZwV0RJQ3R4LT53cHRNdXRleCk7CisgICAgICB3cGFsTWVtb3J5RnJlZShwU2VuZEJ1Zm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BVFVSRV9XTEFOX0xGUikKKy8qKgorIEBicmllZiBQcm9jZXNzIEdldCBSb2FtIFJzc2kgUmVxdWVzdCBmdW5jdGlvbiAoY2FsbGVkIHdoZW4gTWFpbiBGU00KKyAgICAgICAgYWxsb3dzIGl0KQorCisgQHBhcmFtICBwV0RJQ3R4OiAgICAgICAgIHBvaW50ZXIgdG8gdGhlIFdMQU4gREFMIGNvbnRleHQKKyAgICAgICAgIHBFdmVudERhdGE6ICAgICAgcG9pbnRlciB0byB0aGUgZXZlbnQgaW5mb3JtYXRpb24gc3RydWN0dXJlCisKKyBAc2VlCisgQHJldHVybiBSZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGwKKyovCitXRElfU3RhdHVzCitXRElfUHJvY2Vzc0dldFJvYW1Sc3NpUmVxCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispCit7CisgIFdESV9HZXRSb2FtUnNzaVJlcVBhcmFtc1R5cGUqICAgcHdkaUdldFJvYW1Sc3NpUGFyYW1zOworICBXRElfR2V0U3RhdHNSc3BDYiAgICAgICAgICAgIHdkaUdldFN0YXRzUnNwQ2I7CisgIHdwdF91aW50OCogICAgICAgICAgICAgICAgICAgcFNlbmRCdWZmZXIgICAgICAgICA9IE5VTEw7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgdXNEYXRhT2Zmc2V0ICAgICAgICA9IDA7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgdXNTZW5kU2l6ZSAgICAgICAgICA9IDA7CisgIHdwdF91aW50OCAgICAgICAgICAgICAgICAgICAgdWNDdXJyZW50QlNTU2VzSWR4ICA9IDA7CisgIFdESV9CU1NTZXNzaW9uVHlwZSogICAgICAgICAgcEJTU1NlcyAgICAgICAgICAgICA9IE5VTEw7CisgIHdwdF9tYWNBZGRyICAgICAgICAgICAgICAgICAgbWFjQlNTSUQ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B1c1NlbmRTaXplIDwgKHVzRGF0YU9mZnNldCArIHNpemVvZihoYWxTZXRNYXhUeFBvd2VyLnNldE1heFR4UHdyUGFyYW1zKQorKSkpCisgIHsKKyAgICAgV1BBTF9UUkFDRSggZVdMQU5fTU9EVUxFX0RBTF9DVFJMLCAgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAiVW5hYmxlIHRvIGdldCBTZXQgTWF4IFR4IFBvd2VyIHJlcSAlcCAlcCAlcCIsCisgICAgICAgICAgICAgICAgcEV2ZW50RGF0YSwgcHdkaVNldE1heFR4UG93ZXJQYXJhbXMsIHdkaVNldE1heFR4UG93ZXJSc3BDYik7CisgICAgIFdESV9BU1NFUlQoMCk7CisgICAgIHJldHVybiBXRElfU1RBVFVTX0VfRkFJTFVSRTsKKyAgfQorCisgIHdwYWxNZW1vcnlDb3B5KGhhbFNldE1heFR4UG93ZXIuc2V0TWF4VHhQd3JQYXJhbXMuYnNzSWQsCisgICAgICAgICAgICAgICAgICBwd2RpU2V0TWF4VHhQb3dlclBhcmFtcy0+d2RpTWF4VHhQb3dlckluZm8ubWFjQlNTSWQsCisgICAgICAgICAgICAgICAgICBXRElfTUFDX0FERFJfTEVOKTsKKworICB3cGFsTWVtb3J5Q29weShoYWxTZXRNYXhUeFBvd2VyLnNldE1heFR4UHdyUGFyYW1zLnNlbGZTdGFNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgcHdkaVNldE1heFR4UG93ZXJQYXJhbXMtPndkaU1heFR4UG93ZXJJbmZvLm1hY1NlbGZTdGFNYWNBZGRyLAorICAgICAgICAgICAgICAgICAgV0RJX01BQ19BRERSX0xFTik7CisgIGhhbFNldE1heFR4UG93ZXIuc2V0TWF4VHhQd3JQYXJhbXMucG93ZXIgPQorICAgICAgICAgICAgICAgICAgcHdkaVNldE1heFR4UG93ZXJQYXJhbXMtPndkaU1heFR4UG93ZXJJbmZvLnVjUG93ZXI7CisKKyAgd3BhbE1lbW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FyYW0gIHBXRElDdHg6ICAgICAgICAgcG9pbnRlciB0byB0aGUgV0xBTiBEQUwgY29udGV4dAorICAgICAgICAgcEV2ZW50RGF0YTogICAgICBwb2ludGVyIHRvIHRoZSBldmVudCBpbmZvcm1hdGlvbiBzdHJ1Y3R1cmUKKworIEBzZWUKKyBAcmV0dXJuIFJlc3VsdCBvZiB0aGUgZnVuY3Rpb24gY2FsbAorKi8KK1dESV9TdGF0dXMgV0RJX1Byb2Nlc3NTZXRNYXhUeFBvd2VyUGVyQmFuZFJlcQorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKQoreworICBXRElfU2V0TWF4VHhQb3dlclBlckJhbmRQYXJhbXNUeXBlKiAgICBwd2RpU2V0TWF4VHhQb3dlclBlckJhbmRQYXJhbXMgPSBOVUxMOworICBXREFfU2V0TWF4VHhQb3dlclBlckJhbmRSc3BDYiAgICAgICAgICB3ZGlTZXRNYXhUeFBvd2VyUGVyQmFuZFJzcENiOworICB3cHRfdWludDgqICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2VuZEJ1ZmZlciAgICAgICAgID0gTlVMTDsKKyAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNEYXRhT2Zmc2V0ICAgICAgICA9IDA7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzU2VuZFNpemUgICAgICAgICAgPSAwOworICB0cFNldE1heFR4UHdyUGVyQmFuZFBhcmFtcyAgICAgICAgICAgICBwaGFsU2V0TXhUeFB3clBlckJhbmQgPSBOVUxMOworICBXRElfU3RhdHVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICByVmFsdWUgPSBXRElfU1RBVFVTX1NVQ0NFU1M7CisgIC8qLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLS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ZXQgVHggUG93ZXIgUmVxdWVzdCBmdW5jdGlvbiAoY2FsbGVkIHdoZW4gTWFpbgorICAgICAgICBGU00gYWxsb3dzIGl0KQorCisgQHBhcmFtICBwV0RJQ3R4OiAgICAgICAgIHBvaW50ZXIgdG8gdGhlIFdMQU4gREFMIGNvbnRleHQKKyAgICAgICAgIHBFdmVudERhdGE6ICAgICAgcG9pbnRlciB0byB0aGUgZXZlbnQgaW5mb3JtYXRpb24gc3RydWN0dXJlCisKKyBAc2VlCisgQHJldHVybiBSZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGwKKyovCitXRElfU3RhdHVzIFdESV9Qcm9jZXNzU2V0VHhQb3dlclJlcQorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKQoreworICBXRElfU2V0VHhQb3dlclBhcmFtc1R5cGUqICAgICAgcHdkaVNldFR4UG93ZXJQYXJhbXMgPSBOVUxMOworICBXREFfU2V0VHhQb3dlclJzcENiICAgICAgICAgICAgd2RpU2V0VHhQb3dlclJzcENiOworICB3cHRfdWludDgqICAgICAgICAgICAgICAgICAgICAgcFNlbmRCdWZmZXIgICAgICAgICAgPSBOVUxMOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICAgICAgdXNEYXRhT2Zmc2V0ICAgICAgICAgPSAwOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICAgICAgdXNTZW5kU2l6ZSAgICAgICAgICAgPSAwOworICB0U2V0VHhQd3JSZXFQYXJhbXMgICAgICAgICAgICAqaGFsU2V0VHhQb3dlciAgICAgICA9IE5VTEw7CisgIC8qLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gKi8KKworICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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l9BQlNFTkNFX1JFU1ApOworfS8qV0RJX1Byb2Nlc3NQMlBHT05PQVJlcSovCisKKyNpZmRlZiBGRUFUVVJFX1dMQU5fVERMUworCisvKioKKyBAYnJpZWYgUHJvY2VzcyBQMlAgTm90aWNlIE9mIEFic2VuY2UgUmVxdWVzdCBmdW5jdGlvbiAoY2FsbGVkIHdoZW4gTWFpbiBGU00KKyAgICAgICAgYWxsb3dzIGl0KQorCisgQHBhcmFtICBwV0RJQ3R4OiAgICAgICAgIHBvaW50ZXIgdG8gdGhlIFdMQU4gREFMIGNvbnRleHQKKyAgICAgICAgIHBFdmVudERhdGE6ICAgICAgcG9pbnRlciB0byB0aGUgZXZlbnQgaW5mb3JtYXRpb24gc3RydWN0dXJlCisKKyBAc2VlCisgQHJldHVybiBSZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGwKKyovCitXRElfU3RhdHVzCitXRElfUHJvY2Vzc1RkbHNMaW5rRXN0YWJsaXNoUmVxCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispCit7CisgIFdESV9TZXRURExTTGlua0VzdGFibGlzaFJlcVBhcmFtc1R5cGUqIHB3ZGlURExTTGlua0VzdGFibGlzaFJlcVBhcmFtczsKKyAgV0RJX1NldFRETFNMaW5rRXN0YWJsaXNoUmVxUGFyYW1zUnNwQ2Igd2RpVERMU0xpbmtFc3RhYmxpc2hSZXFSc3BDYjsKKyAgd3B0X3VpbnQ4KiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlbmRCdWZmZXIgICAgICAgICA9IE5VTEw7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzRGF0YU9mZnNldCAgICAgICAgPSAwOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c1NlbmRTaXplICAgICAgICAgID0gMDsKKworICB0VERMU0xpbm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sgPSAwOworICBoYWxTZXRURExTTGlua0VzdGFibGlzaFBhcmFtcy5tYXhTZXJ2aWNlUGVyaW9kTGVuZ3RoID0gKHB3ZGlURExTTGlua0VzdGFibGlzaFJlcVBhcmFtcy0+d2RpVERMU0xpbmtFc3RhYmxpc2hJbmZvLnVNYXhTcCAmIDB4MDMpOworICBoYWxTZXRURExTTGlua0VzdGFibGlzaFBhcmFtcy5tb3JlRGF0YUFjayA9IDA7CisgIGhhbFNldFRETFNMaW5rRXN0YWJsaXNoUGFyYW1zLlRQVUJ1ZmZlclN0YVN1cHBvcnQgPSAgcHdkaVRETFNMaW5rRXN0YWJsaXNoUmVxUGFyYW1zLT53ZGlURExTTGlua0VzdGFibGlzaEluZm8udUlzQnVmU3RhOworICBoYWxTZXRURExTTGlua0VzdGFibGlzaFBhcmFtcy50ZGxzT2ZmQ2hhbm5lbFN1cHBvcnQgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwd2RpVERMU0xpbmtFc3RhYmxpc2hSZXFQYXJhbXMtPndkaVRETFNMaW5rRXN0YWJsaXNoSW5mby51SXNPZmZDaGFubmVsU3VwcG9ydGVkOworCisgIHdwYWxNZW1vcnlDb3B5KCBoYWxTZXRURExTTGlua0VzdGFibGlzaFBhcmFtcy52YWxpZENoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgcHdkaVRETFNMaW5rRXN0YWJsaXNoUmVxUGFyYW1zLT53ZGlURExTTGlua0VzdGFibGlzaEluZm8udmFsaWRDaGFubmVscywKKyAgICAgICAgICAgICAgICAgIHB3ZGlURExTTGlua0VzdGFibGlzaFJlcVBhcmFtcy0+d2RpVERMU0xpbmtFc3RhYmxpc2hJbmZvLnZhbGlkQ2hhbm5lbHNMZW4pOworICBoYWxTZXRURExTTGlua0VzdGFibGlzaFBhcmFtcy52YWxpZENoYW5uZWxzTGVuID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHdkaVRETFNMaW5rRXN0YWJsaXNoUmVxUGFyYW1zL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VkIHRvIHNldCBhbiBldmVudCIpOworCisgICAgICBXRElfQVNTRVJUKDApOworICAgfQorICAgcmV0dXJuOworfQorCisKKy8qKgorIEBicmllZiBQcm9jZXNzIEVudGVyIElNUFMgUmVxdWVzdCBmdW5jdGlvbiAoY2FsbGVkIHdoZW4KKyAgICAgICAgTWFpbiBGU00gYWxsb3dzIGl0KQorCisgQHBhcmFtICBwV0RJQ3R4OiAgICAgICAgIHBvaW50ZXIgdG8gdGhlIFdMQU4gREFMIGNvbnRleHQKKyAgICAgICAgIHBFdmVudERhdGE6ICAgICAgcG9pbnRlciB0byB0aGUgZXZlbnQgaW5mb3JtYXRpb24gc3RydWN0dXJlCisKKyBAc2VlCisgQHJldHVybiBSZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGwKKyovCitXRElfU3RhdHVzCitXRElfUHJvY2Vzc0VudGVySW1wc1JlcQorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKQoreworICAgd3B0X3N0YXR1cyAgICAgICAgICAgICAgIHdwdFN0YXR1czsgCisgICBXRElfRW50ZXJJbXBzUnNwQ2IgICAgICAgd2RpRW50ZXJJbXBzUnNwQ2IgPSBOVUxMOworICAgd3B0X3VpbnQ4KiAgICAgICAgICAgICAgIHBTZW5kQnVmZmVyICAgICAgICAgPSBOVUxMOworICAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgIHVzRGF0YU9mZnNldCAgICAgICAgPSAwOworICAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgIHVzU2VuZFNpemUgICAgICAgICAgPSAwOworICAgV0RJX0VudGVySW1wc1JlcVBhcmFtc1R5cGUqICBwd2RpRW50ZXJJbXBzUmVxUGFyYW1zID0gTlVMTDsKKyAgIC8qLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworICAgaWYgKCggV0RJX1NUQVRVU19TVUNDRVNTICE9IFdESV9HZXRNZXNzYWdlQnVmZmVyKCBwV0RJQ3R4LCBXRElfRU5URVJfSU1QU19SRVEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwU2VuZEJ1ZmZlciwgJnVzRGF0YU9mZnNldCwgJnVzU2VuZFNpemUpKXx8CisgICAgICAgKCB1c1NlbmRTaXplIDwgKHVzRGF0YU9mZnNldCApKSkKKyAgIHsKKyAgICAgIFdQQUxfVFJBQ0UoIGVXTEFOX01PRFVMRV9EQUxfQ1RSTCwgIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgIlVuYWJsZSB0byBnZXQgc2VuZCBidWZmZXIgaW4gRW50ZXIgSU1QUyByZXEgJXAgJXAiLAorICAgICAgICAgICAgICAgICBwRXZlbnREYXRhLCB3ZGlFbnRlckltcHNSc3BDYik7CisgICAgICBXRElfQVNTRVJUKDApOworICAgICAgZ290byBmYWlsUmVxdWVzdDsKKyAgIH0KKworICAgLyogUmVzZXQgdGhlIGV2ZW50IHRvIGJlIG5vdCBzaWduYWxsZWQgKi8KKyAgIHdwdFN0YXR1cyA9IHdwYWxFdmVudFJlc2V0KCZwV0RJQ3R4LT5zZXRQb3dlclN0YXRlRXZlbnQpOworICAgaWYgKCBlV0xBTl9QQUxfU1RBVFVTX1NVQ0NFU1MgIT0gd3B0U3RhdHVzICkgCisgICB7CisgICAgICBXUEFMX1RSQUNFKGVXTEFOX01PRFVMRV9EQUxfQ1RSTCwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgIldESSBJbml0IGZhaWxlZCB0byByZ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fRVhJVF9VQVBTRF9SRVEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih3cHRfdWludDgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFNlbmRCdWZmZXIsICZ1c0RhdGFPZmZzZXQsICZ1c1NlbmRTaXplKSl8fAorICAgICAgICggdXNTZW5kU2l6ZSA8ICh1c0RhdGFPZmZzZXQgKyBzaXplb2Yod3B0X3VpbnQ4KSkpKQorICAgeworICAgICAgV1BBTF9UUkFDRSggZVdMQU5fTU9EVUxFX0RBTF9DVFJMLCAgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAiVW5hYmxlIHRvIGdldCBzZW5kIGJ1ZmZlciBpbiBFeGl0IFVBUFNEIHJlcSAlcCAlcCIsCisgICAgICAgICAgICAgICAgIHBFdmVudERhdGEsIHdkaUV4aXRVYXBzZFJzcENiKTsKKyAgICAgIFdESV9BU1NFUlQoMCk7CisgICAgICByZXR1cm4gV0RJX1NUQVRVU19FX0ZBSUxVUkU7CisgICB9CisKKyAgIGJzc0lkeCA9IHBFeGl0VWFwc2RwYXJhbXMtPndkaUV4aXRVYXBzZEluZm8uYnNzSWR4OworCisgICB3cGFsTWVtb3J5Q29weSggcFNlbmRCdWZmZXIrdXNEYXRhT2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICZic3NJZHgsCisgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHdwdF91aW50OCkpOworCisgICBwV0RJQ3R4LT53ZGlSZXFTdGF0dXNDQiAgICAgPSBwRXhpdFVhcHNkcGFyYW1zLT53ZGlSZXFTdGF0dXNDQjsKKyAgIHBXRElDdHgtPnBSZXFTdGF0dXNVc2VyRGF0YSA9IHBFeGl0VWFwc2RwYXJhbXMtPnBVc2VyRGF0YTsKKworICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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KKyAgICAgICAgd2hlbiBNYWluIEZTTSBhbGxvd3MgaXQpCisKKyBAcGFyYW0gIHBXRElDdHg6ICAgICAgICAgcG9pbnRlciB0byB0aGUgV0xBTiBEQUwgY29udGV4dAorICAgICAgICAgcEV2ZW50RGF0YTogICAgICBwb2ludGVyIHRvIHRoZSBldmVudCBpbmZvcm1hdGlvbiBzdHJ1Y3R1cmUKKworIEBzZWUKKyBAcmV0dXJuIFJlc3VsdCBvZiB0aGUgZnVuY3Rpb24gY2FsbAorKi8KK1dESV9TdGF0dXMKK1dESV9Qcm9jZXNzV293bERlbEJjUHRyblJlcQorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKQoreworICAgV0RJX1dvd2xEZWxCY1B0cm5SZXFQYXJhbXNUeXBlKiAgcHdkaVdvd2xEZWxCY1B0cm5QYXJhbXMgPSBOVUxMOworICAgV0RJX1dvd2xEZWxCY1B0cm5DYiAgICAgICAgICAgICAgd2RpV293bERlbEJjUHRybkNiID0gTlVMTDsKKyAgIHdwdF91aW50OCogICAgICAgICAgICAgICBwU2VuZEJ1ZmZlciAgICAgICAgID0gTlVMTDsKKyAgIHdwdF91aW50MTYgICAgICAgICAgICAgICB1c0RhdGFPZmZzZXQgICAgICAgID0gMDsKKyAgIHdwdF91aW50MTYgICAgICAgICAgICAgICB1c1NlbmRTaXplICAgICAgICAgID0gMDsKKyAgIHRIYWxXb3dsRGVsQmNhc3RQdHJuICAgICB3b3dsRGVsQmNQdHJuUmVxOworICAgd3B0X3VpbnQ4ICAgICAgICAgICAgICAgIHVjQ3VycmVudEJTU1Nlc0lkeCAgPSAwOworICAgV0RJX0JTU1Nlc3Npb25UeXBlKiAgICAgICAgcEJTU1NlcyA9IE5VTEw7CisgICAvKi0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworICAgaWYgKCggV0RJX1NUQVRVU19TVUNDRVNTICE9IFdESV9HZXRNZXNzYWdlQnVmZmVyKCBwV0RJQ3R4LCBXRElfV09XTF9ERUxfQkNfUFRSTl9SRVEsCisgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHdvd2xEZWxCY1B0cm5SZXEpLAorICAgICAgICAgICAgICAgICAgICAgICAgICZwU2VuZEJ1ZmZlciwgJnVzRGF0YU9mZnNldCwgJnVzU2VuZFNpemUpKXx8CisgICAgICAgKCB1c1NlbmRTaXplIDwgKHVzRGF0YU9mZnNldCArIHNpemVvZih3b3dsRGVsQmNQdHJuUmVxKSApKSkKKyAgIHsKKyAgICAgIFdQQUxfVFJBQ0UoIGVXTEFOX01PRFVMRV9EQUxfQ1RSTCwgIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgIlVuYWJsZSB0byBnZXQgc2VuZCBidWZmZXIgaW4gV293bCBkZWwgYmMgcHRybiByZXEgJXAgJXAgJXAiLAorICAgICAgICAgICAgICAgICAgcEV2ZW50RGF0YSwgcHdkaVdvd2xEZWxCY1B0cm5QYXJhbXMsIHdkaVdvd2xEZWxCY1B0cm5DYik7CisgICAgICBXRElfQVNTRVJUKDApOworICAgICAgZ290byBmYWlsUmVxdWVzdDsKKyAgIH0KKworICAgIHVjQ3VycmVudEJTU1Nlc0lkeCA9IFdESV9GaW5kQXNzb2NTZXNzaW9uKCBwV0RJQ3R4LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwd2RpV293bERlbEJjUHRyblBhcmFtcy0+d2RpV293bERlbEJjUHRybkluZm8uYnNzSWQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwQlNTU2VzKTsKKyAgIGlmICggTlVMTCA9PSBwQlNTU2VzICkKKyAgIHsKKyAg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VhJVF9SRVEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih3b3dsRXhpdHBhcmFtcyksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwU2VuZEJ1ZmZlciwgJnVzRGF0YU9mZnNldCwgJnVzU2VuZFNpemUpKXx8CisgICAgICAgKCB1c1NlbmRTaXplIDwgKHVzRGF0YU9mZnNldCArIHNpemVvZih3b3dsRXhpdHBhcmFtcykpKSkKKyAgIHsKKyAgICAgIFdQQUxfVFJBQ0UoIGVXTEFOX01PRFVMRV9EQUxfQ1RSTCwgIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgIlVuYWJsZSB0byBnZXQgc2VuZCBidWZmZXIgaW4gV293bCBFeGl0IHJlcSAlcCAlcCIsCisgICAgICAgICAgICAgICAgIHBFdmVudERhdGEsIHdkaVdvd2xFeGl0Q2IpOworICAgICAgV0RJX0FTU0VSVCgwKTsKKyAgICAgIHJldHVybiBXRElfU1RBVFVTX0VfRkFJTFVSRTsKKyAgIH0KKworICAgd293bEV4aXRwYXJhbXMuYnNzSWR4ID0gcHdkaVdvd2xFeGl0UGFyYW1zLT53ZGlXb3dsRXhpdEluZm8uYnNzSWR4OworCisgICB3cGFsTWVtb3J5Q29weSggcFNlbmRCdWZmZXIrdXNEYXRhT2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICZ3b3dsRXhpdHBhcmFtcywKKyAgICAgICAgICAgICAgICAgICBzaXplb2Yod293bEV4aXRwYXJhbXMpKTsKKyAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICBTZW5kIEdldCBTVEEgUmVxdWVzdCB0byBIQUwKKyAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tL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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAgICAgTWFpbiBEQUwgQ29udHJvbCBQYXRoIFJlc3BvbnNlIFByb2Nlc3NpbmcgQVBJCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKioKKyBAYnJpZWYgUHJvY2VzcyBTdGFydCBSZXNwb25zZSBmdW5jdGlvbiAoY2FsbGVkIHdoZW4gYSByZXNwb25zZQorICAgICAgICBpcyBiZWluZyByZWNlaXZlZCBvdmVyIHRoZSBidXMgZnJvbSBIQUwpCisKKyBAcGFyYW0gIHBXRElDdHg6ICAgICAgICAgcG9pbnRlciB0byB0aGUgV0xBTiBEQUwgY29udGV4dAorICAgICAgICAgcEV2ZW50RGF0YTogICAgICBwb2ludGVyIHRvIHRoZSBldmVudCBpbmZvcm1hdGlvbiBzdHJ1Y3R1cmUKKworIEBzZWUKKyBAcmV0dXJuIFJlc3VsdCBvZiB0aGUgZnVuY3Rpb24gY2FsbAorKi8KK1dESV9TdGF0dXMKK1dESV9Qcm9jZXNzU3RhcnRSc3AKKygKKyAgV0RJX0NvbnRyb2xCbG9ja1R5cGUqICBwV0RJQ3R4LAorICBXRElfRXZlbnRJbmZvVHlwZSogICAgIHBFdmVudERhdGEKKykKK3sKKyAgV0RJX1N0YXJ0UnNwUGFyYW1zVHlwZSAgIHdkaVJzcFBhcmFtczsKKyAgV0RJX1N0YXJ0UnNwQ2IgICAgICAgICAgIHdkaVN0YXJ0UnNwQ2IgPSBOVUxMOworCisgIHRIYWxNYWNTdGFydFJzcFBhcmFtcyogICBzdGFydFJzcFBhcmFtczsKKworI2lmbmRlZiBIQUxfU0VMRl9TVEFfUEVSX0JTUworICBXRElfQWRkU3RhUGFyYW1zICAgICAgICAgd2RpQWRkU1RBUGFyYW0gPSB7MH07CisjZW5kaWYKKyAgLyotIC0gLSAtIC0gLSAtIC0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itXRElfU3RhdHVzCitXRElfUHJvY2Vzc0Nsb3NlUnNwCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispCit7CisgIC8qVGhlcmUgaXMgbm8gY2xvc2UgcmVzcG9uc2UgY29tbWluZyBmcm9tIEhBTCAtIGZ1bmN0aW9uIGp1c3Qga2VwdCBmb3IKKyAgc2ltbWV0cnkgKi8KKyAgV0RJX0FTU0VSVCgwKTsKKyAgcmV0dXJuIFdESV9TVEFUVVNfU1VDQ0VTUzsKK30vKldESV9Qcm9jZXNzQ2xvc2VSc3AqLworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgICAgICAgICAgICAgICAgIFNDQU4gUkVTUE9OU0UgUFJPQ0VTU0lORyBBUEkKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKioKKyBAYnJpZWYgUHJvY2VzcyBJbml0IFNjYW4gUnNwIGZ1bmN0aW9uIChjYWxsZWQgd2hlbiBhIHJlc3BvbnNlCisgICAgICAgIGlzIGJlaW5nIHJlY2VpdmVkIG92ZXIgdGhlIGJ1cyBmcm9tIEhBTCkKKworIEBwYXJhbSAgcFdESUN0eDogICAgICAgICBwb2ludGVyIHRvIHRoZSBXTEFOIERBTCBjb250ZXh0CisgICAgICAgICBwRXZlbnREYXRhOiAgICAgIHBvaW50ZXIgdG8gdGhlIGV2ZW50IGluZm9ybWF0aW9uIHN0cnVjdHVyZQorCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cworV0RJX1Byb2Nlc3NJbml0U2NhblJzcAorKAorICBXRElfQ29udHJvbEJsb2NrVH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TVEFUYWJsZVt3ZGlEZWxTVEFSc3AudWNTVEFJZHhdLmJjYXN0RHB1U2lnbmF0dXJlID0gV0RJX0RQVV9TRUxGX1NUQV9ERUZBVUxUX1NJRzsKKyAgICBwU1RBVGFibGVbd2RpRGVsU1RBUnNwLnVjU1RBSWR4XS5iY2FzdE1nbXREcHVTaWduYXR1cmUgPSBXRElfRFBVX1NFTEZfU1RBX0RFRkFVTFRfU0lHOworICAgIHBTVEFUYWJsZVt3ZGlEZWxTVEFSc3AudWNTVEFJZHhdLmRwdVNpZyA9IFdESV9EUFVfU0VMRl9TVEFfREVGQVVMVF9TSUc7CisKKyAgICBwU1RBVGFibGVbd2RpRGVsU1RBUnNwLnVjU1RBSWR4XS5ic3NJZHggPSBXRElfQlNTX0lOVkFMSURfSURYOworICB9CisgIGVsc2UKKyAgeworICAgIC8vRGVsZXRlIHRoZSBzdGF0aW9uIGluIHRoZSB0YWJsZQorICAgIFdESV9TVEFUYWJsZURlbFN0YSggcFdESUN0eCwgd2RpRGVsU1RBUnNwLnVjU1RBSWR4KTsKKyAgfQorCisgIC8qTm90aWZ5IFVNQUMqLworICB3ZGlEZWxTVEFSc3BDYiggJndkaURlbFNUQVJzcCwgcFdESUN0eC0+cFJzcENCVXNlckRhdGEpOworCisgIHJldHVybiBXRElfU1RBVFVTX1NVQ0NFU1M7Cit9LypXRElfUHJvY2Vzc0RlbFNUQVJzcCovCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgICAgICAgICAgICAgIFNlY3VyaXR5IFJlc3BvbnNlIFByb2Nlc3NpbmcgRnVuY3Rpb25zCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qKgorIEBicmllZiBQcm9jZXNzIFNldCBCU1MgS2V5IFJzcCBmdW5jdGlvbiAoY2Fsb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HJpbmcoaGFsU3RhdHVzKSwKKyAgICAgICAgICAgICAgaGFsU3RhdHVzKTsKKyAgICAgLyogc2VuZCB0aGUgc3RhdHVzIHRvIFVNQUMsIGRvbid0IHJldHVybiBmcm9tIGhlcmUqLworICB9CisKKyAgLypOb3RpZnkgVU1BQyovCisgIHdkaVJlbW92ZVNUQUJjYXN0S2V5UnNwQ2IoIHdkaVN0YXR1cywgcFdESUN0eC0+cFJzcENCVXNlckRhdGEpOworCisgIHJldHVybiBXRElfU1RBVFVTX1NVQ0NFU1M7Cit9LypXRElfUHJvY2Vzc1JlbW92ZVN0YUJjYXN0S2V5UnNwKi8KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAgICAgICAgICAgICAgUW9TIGFuZCBCQSBSZXNwb25zZSBQcm9jZXNzaW5nIEZ1bmN0aW9ucworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKioKKyBAYnJpZWYgUHJvY2VzcyBBZGQgVFNwZWMgUnNwIGZ1bmN0aW9uIChjYWxsZWQgd2hlbiBhIHJlc3BvbnNlCisgICAgICAgIGlzIGJlaW5nIHJlY2VpdmVkIG92ZXIgdGhlIGJ1cyBmcm9tIEhBTCkKKworIEBwYXJhbSAgcFdESUN0eDogICAgICAgICBwb2ludGVyIHRvIHRoZSBXTEFOIERBTCBjb250ZXh0CisgICAgICAgICBwRXZlbnREYXRhOiAgICAgIHBvaW50ZXIgdG8gdGhlIGV2ZW50IGluZm9ybWF0aW9uIHN0cnVjdHVyZQorCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cworV0RJX1Byb2Nlc3NBZGRUU3BlY1JzcAorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDd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VkID0KKyAgICAgICAgcFdESUN0eC0+d2RpQ2FjaGVkQ29uZmlnU3RhUmVxLndkaVJlcUluZm8udWNXTU1FbmFibGVkOworICAgICAgd2RpQWRkU1RBUGFyYW0udWNIVENhcGFibGUgID0KKyAgICAgICAgcFdESUN0eC0+d2RpQ2FjaGVkQ29uZmlnU3RhUmVxLndkaVJlcUluZm8udWNIVENhcGFibGU7CisgICAgICB3ZGlBZGRTVEFQYXJhbS51Y1N0YVR5cGUgICAgPQorICAgICAgICBwV0RJQ3R4LT53ZGlDYWNoZWRDb25maWdTdGFSZXEud2RpUmVxSW5mby53ZGlTVEFUeXBlOworICAgICAgd2RpQWRkU1RBUGFyYW0udWNSbWZFbmFibGVkID0KKyAgICAgICAgcFdESUN0eC0+d2RpQ2FjaGVkQ29uZmlnU3RhUmVxLndkaVJlcUluZm8udWNSTUZFbmFibGVkOworCisgICAgICAvKiBNQUMgQWRkcmVzcyBvZiBTVEEgKi8KKyAgICAgIHdwYWxNZW1vcnlDb3B5KHdkaUFkZFNUQVBhcmFtLnN0YU1hY0FkZHIsCisgICAgICAgICAgICAgICAgICAgICBwV0RJQ3R4LT53ZGlDYWNoZWRDb25maWdTdGFSZXEud2RpUmVxSW5mby5tYWNTVEEsCisgICAgICAgICAgICAgICAgICAgICBXRElfTUFDX0FERFJfTEVOKTsKKworICAgICAgd3BhbE1lbW9yeUNvcHkod2RpQWRkU1RBUGFyYW0ubWFjQlNTSUQsCisgICAgICAgICAgICAgICAgICAgICBwV0RJQ3R4LT53ZGlDYWNoZWRDb25maWdTdGFSZXEud2RpUmVxSW5mby5tYWNCU1NJRCAsCisgICAgICAgICAgICAgICAgICAgICBXRElfTUFDX0FERFJfTEVOKTsKKworICAgICAgdWNDdXJyZW50QlNTU2VzSWR4ID0gV0RJX0ZpbmRBc3NvY1Nlc3Npb24oIHBXRElDdHgsCisgICAgICAgICAgICAgICAgICAgIHBXRElDdHgtPndkaUNhY2hlZENvbmZpZ1N0YVJlcS53ZGlSZX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UUkFDRSggZVdMQU5fTU9EVUxFX0RBTF9DVFJMLCAgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICJbQ09FWCBXREldIENvZXggSW5kIFR5cGUgKCV4KSBkYXRhICgleCAleCAleCAleCkiLAorICAgICAgICAgICAgICB3ZGlJbmQud2RpSW5kaWNhdGlvbkRhdGEud2RpQ29leEluZm8uY29leEluZFR5cGUsCisgICAgICAgICAgICAgIHdkaUluZC53ZGlJbmRpY2F0aW9uRGF0YS53ZGlDb2V4SW5mby5jb2V4SW5kRGF0YVswXSwKKyAgICAgICAgICAgICAgd2RpSW5kLndkaUluZGljYXRpb25EYXRhLndkaUNvZXhJbmZvLmNvZXhJbmREYXRhWzFdLAorICAgICAgICAgICAgICB3ZGlJbmQud2RpSW5kaWNhdGlvbkRhdGEud2RpQ29leEluZm8uY29leEluZERhdGFbMl0sCisgICAgICAgICAgICAgIHdkaUluZC53ZGlJbmRpY2F0aW9uRGF0YS53ZGlDb2V4SW5mby5jb2V4SW5kRGF0YVszXSApOworCisgIGlmICggcFdESUN0eC0+d2RpTG93TGV2ZWxJbmRDQiApCisgIHsKKyAgICAvKk5vdGlmeSBVTUFDKi8KKyAgICBwV0RJQ3R4LT53ZGlMb3dMZXZlbEluZENCKCAmd2RpSW5kLCBwV0RJQ3R4LT5wSW5kVXNlckRhdGEgKTsKKyAgfQorCisgIHJldHVybiBXRElfU1RBVFVTX1NVQ0NFU1M7Cit9LypXRElfUHJvY2Vzc0NvZXhJbmQqLworCisvKioKKypAYnJpZWYgUHJvY2VzcyBUeCBDb21wbGV0ZSBJbmRpY2F0aW9uIGZ1bmN0aW9uIChjYWxsZWQgd2hlbgorICAgICAgICBhbiBpbmRpY2F0aW9uIG9mIHRoaXMga2luZCBpcyBiZWluZyByZWNlaXZlZCBvdmVyIHRoZQorICAgICAgICBidXMgZnJvbSBIQUwpCisKKyBAcGFyYW0gIHBXRElDdHg6ICAgICAgICAgcG9pbnRlciB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udGRsc0luZFBhcmFtcy5zdGF0dXM7CisKKyAgd2RpSW5kLndkaUluZGljYXRpb25EYXRhLndkaVRkbHNJbmRJbmZvLnN0YUlkeAorICAgICAgICAgICAgICAgICAgICAgICAgICA9IGhhbFRkbHNJbmRNc2cudGRsc0luZFBhcmFtcy5zdGFJZHg7CisKKyAgd2RpSW5kLndkaUluZGljYXRpb25EYXRhLndkaVRkbHNJbmRJbmZvLnJlYXNvbkNvZGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPSBoYWxUZGxzSW5kTXNnLnRkbHNJbmRQYXJhbXMucmVhc29uQ29kZTsKKworICB3ZGlJbmQud2RpSW5kaWNhdGlvbkRhdGEud2RpVGRsc0luZEluZm8uYXNzb2NJZAorICAgICAgICAgICAgICAgICAgICAgICAgICA9IGhhbFRkbHNJbmRNc2cudGRsc0luZFBhcmFtcy5hc3NvY0lkOworICAvKk5vdGlmeSBVTUFDKi8KKyAgcFdESUN0eC0+d2RpTG93TGV2ZWxJbmRDQiggJndkaUluZCwgcFdESUN0eC0+cEluZFVzZXJEYXRhICk7CisKKyAgcmV0dXJuIFdESV9TVEFUVVNfU1VDQ0VTUzsKK30vKldESV9Qcm9jZXNzVGRsc0luZCovCisjZW5kaWYKKy8qKgorKkBicmllZiBQcm9jZXNzIE5vYSBTdGFydCBJbmRpY2F0aW9uIGZ1bmN0aW9uIChjYWxsZWQgd2hlbgorICAgICAgICBhbiBpbmRpY2F0aW9uIG9mIHRoaXMga2luZCBpcyBiZWluZyByZWNlaXZlZCBvdmVyIHRoZQorICAgICAgICBidXMgZnJvbSBIQUwpCisKKyBAcGFyYW0gIHBXRElDdHg6ICAgICAgICAgcG9pbnRlciB0byB0aGUgV0xBTiBEQUwgY29udGV4dAorICAgICAgICAgcEV2ZW50RGF0YTogICAgICBwb2ludGVyIHRvIHRoZSBldmVudCBpbmZvcm1hdGlvbiBzdHJ1Y3R1cmUKKworIEBzZWUKKyBAcmV0dXJuIFJlc3VsdCBvZiB0aGUg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zdGF0dXM7CisKKyAgd2RpSW5kLndkaUluZGljYXRpb25EYXRhLndkaVAycE5vYUF0dHJJbmZvLnVjSW5kZXgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPSBoYWxOb2FBdHRySW5kTXNnLm5vYUF0dHJJbmRQYXJhbXMuaW5kZXg7CisgIHdkaUluZC53ZGlJbmRpY2F0aW9uRGF0YS53ZGlQMnBOb2FBdHRySW5mby51Y09wcFBzRmxhZworICAgICAgICAgICAgICAgICAgICAgICAgICA9IGhhbE5vYUF0dHJJbmRNc2cubm9hQXR0ckluZFBhcmFtcy5vcHBQc0ZsYWc7CisgIHdkaUluZC53ZGlJbmRpY2F0aW9uRGF0YS53ZGlQMnBOb2FBdHRySW5mby51c0N0V2luCisgICAgICAgICAgICAgICAgICAgICAgICAgID0gaGFsTm9hQXR0ckluZE1zZy5ub2FBdHRySW5kUGFyYW1zLmN0V2luOworCisgIHdkaUluZC53ZGlJbmRpY2F0aW9uRGF0YS53ZGlQMnBOb2FBdHRySW5mby51c05vYTFJbnRlcnZhbENudAorICAgICAgICAgICAgICAgICAgICAgICAgICA9IGhhbE5vYUF0dHJJbmRNc2cubm9hQXR0ckluZFBhcmFtcy51Tm9hMUludGVydmFsQ250OworICB3ZGlJbmQud2RpSW5kaWNhdGlvbkRhdGEud2RpUDJwTm9hQXR0ckluZm8udXNsTm9hMUR1cmF0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgID0gaGFsTm9hQXR0ckluZE1zZy5ub2FBdHRySW5kUGFyYW1zLnVOb2ExRHVyYXRpb247CisgIHdkaUluZC53ZGlJbmRpY2F0aW9uRGF0YS53ZGlQMnBOb2FBdHRySW5mby51c2xOb2ExSW50ZXJ2YWwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSBoYWxOb2FBdHRySW5kTXNnLm5vYUF0dHJJbmRQYXJhbXMudU5vYTFJbnRlcnZhbDsKKyAgd2RpSW5kLndkaUluZGljYXRpb25EYXRhLndkaVAycE5vYUF0dHJJbmZvLnVzbE5vYTFTdGFydFRpbWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPSBoYWxOb2FBdHRySW5kTXNnLm5vYUF0dHJJbmRQYXJhbXMudU5vYTFTdGFydFRpbWU7CisKKyAgd2RpSW5kLndkaUluZGljYXRpb25EYXRhLndkaVAycE5vYUF0dHJJbmZvLnVzTm9hMkludGVydmFsQ250CisgICAgICAgICAgICAgICAgICAgICAgICAgID0gaGFsTm9hQXR0ckluZE1zZy5ub2FBdHRySW5kUGFyYW1zLnVOb2EySW50ZXJ2YWxDbnQ7CisgIHdkaUluZC53ZGlJbmRpY2F0aW9uRGF0YS53ZGlQMnBOb2FBdHRySW5mby51c2xOb2EyRHVyYXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgPSBoYWxOb2FBdHRySW5kTXNnLm5vYUF0dHJJbmRQYXJhbXMudU5vYTJEdXJhdGlvbjsKKyAgd2RpSW5kLndkaUluZGljYXRpb25EYXRhLndkaVAycE5vYUF0dHJJbmZvLnVzbE5vYTJJbnRlcnZhbAorICAgICAgICAgICAgICAgICAgICAgICAgICA9IGhhbE5vYUF0dHJJbmRNc2cubm9hQXR0ckluZFBhcmFtcy51Tm9hMkludGVydmFsOworICB3ZGlJbmQud2RpSW5kaWNhdGlvbkRhdGEud2RpUDJwTm9hQXR0ckluZm8udXNsTm9hMlN0YXJ0VGltZQorICAgICAgICAgICAgICAgICAgICAgICAgICA9IGhhbE5vYUF0dHJJbmRNc2cubm9hQXR0ckluZFBhcmFtcy51Tm9hMlN0YXJ0VGltZTsKKworICBpZiAoIHBXRElDdHgtPndkaUxvd0xldmVsSW5kQ0IgKQorICB7CisgICAgLypOb3RpZnkgVU1BQyovCisgICAgcFdESUN0eC0+d2RpTG93TGV2ZWxJbmRDQiggJndkaUluZCwgcFdESUN0eC0+cEluZFVzZXJEYXRhICk7CisgIH0KKworICByZXR1cm4gV0RJX1NUQVRVU19TVUNDRVNTOworfS8qV0RJX1Byb2Nlc3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EV2ZW50RGF0YSApIHx8CisgICAgICAoIE5VTEwgPT0gcEV2ZW50RGF0YS0+cEV2ZW50RGF0YSkpCisKKyAgeworICAgICBXUEFMX1RSQUNFKCBlV0xBTl9NT0RVTEVfREFMX0NUUkwsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgcGFyYW1ldGVycyIsIF9fZnVuY19fKTsKKyAgICAgV0RJX0FTU0VSVCgwKTsKKyAgICAgcmV0dXJuIFdESV9TVEFUVVNfRV9GQUlMVVJFOworICB9CisKKyAgZnRtQ29tbWFuZFJlcSA9IChXRElfRlRNQ29tbWFuZFJlcVR5cGUgKilwRXZlbnREYXRhLT5wRXZlbnREYXRhOworCisgIC8qIEdldCBNU0cgQnVmZmVyICovCisgIFdESV9HZXRNZXNzYWdlQnVmZmVyKHBXRElDdHgsCisgICAgICAgICAgICAgICAgICAgICAgIFdESV9GVE1fQ01EX1JFUSwKKyAgICAgICAgICAgICAgICAgICAgICAgZnRtQ29tbWFuZFJlcS0+Ym9keUxlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgJmZ0bUNvbW1hbmRCdWZmZXIsCisgICAgICAgICAgICAgICAgICAgICAgICZkYXRhT2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAmYnVmZmVyU2l6ZSk7CisKKyAgd3BhbE1lbW9yeUNvcHkoZnRtQ29tbWFuZEJ1ZmZlciArIGRhdGFPZmZzZXQsCisgICAgICAgICAgICAgICAgIGZ0bUNvbW1hbmRSZXEtPkZUTUNvbW1hbmRCb2R5LAorICAgICAgICAgICAgICAgICBmdG1Db21tYW5kUmVxLT5ib2R5TGVuZ3RoKTsKKworICAvKiBTZW5kIE1TRyAqLworICByZXR1cm4gV0RJX1NlbmRNc2cocFdESUN0eCwKKyAgICAgICAgICAgICAgICAgICAgIGZ0bUNvbW1hbmRCdWZmZXIsCisgICAgICAgICAgICAgICAgICAgICBidWZmZXJTa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PVVQpOworCisgICAgcmV0dXJuOworICB9CisKKyAgV1BBTF9UUkFDRSggZVdMQU5fTU9EVUxFX0RBTF9DVFJMLCAgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICJSeCBzbXRoIGZyb20gSEFMOiAlZCIsIHdkaUV2ZW50RGF0YS53ZGlSZXNwb25zZSk7CisKKyAgLypQb3N0IHJlc3BvbnNlIGV2ZW50IHRvIHRoZSBzdGF0ZSBtYWNoaW5lKi8KKyAgV0RJX1Bvc3RNYWluRXZlbnQocFdESUN0eCwgV0RJX1JFU1BPTlNFX0VWRU5ULCAmd2RpRXZlbnREYXRhKTsKKworfS8qV0RJX1JYTXNnQ1RTQ0IqLworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAgICBJbnRlcm5hbCBIZWxwZXIgUm91dGluZXMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qKgorIEBicmllZiBXRElfQ2xlYW5DQiAtIGludGVybmFsIGhlbHBlciByb3V0aW5lIHVzZWQgdG8gY2xlYW4gdGhlCisgICAgICAgIFdESSBNYWluIENvbnRyb2wgQmxvY2sKKworIEBwYXJhbSBwV0RJQ3R4IC0gcG9pbnRlciB0byB0aGUgY29udHJvbCBibG9jaworCisgQHJldHVybiBSZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGwKKyovCitXUFRfSU5MSU5FIFdESV9TdGF0dXMKK1dESV9DbGVhbkNCCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eAorKQoreworICAvKi0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtKi8KKworICAvKkNsZWFuIHRoZ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MX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICJDYWxsaW5nIHJlc3BvbnNlIHByb2Nlc3NpbmcgZnVuY3Rpb24gZm9yIHJlc3AgJXMgKCVkKSAlcCIsCisgICAgICAgICAgICAgIFdESV9nZXRSZXNwTXNnU3RyaW5nKHBFdmVudERhdGEtPndkaVJlc3BvbnNlKSwKKyAgICAgICAgICAgICAgcEV2ZW50RGF0YS0+d2RpUmVzcG9uc2UsIHBmblJzcFByb2NUYmxbcEV2ZW50RGF0YS0+d2RpUmVzcG9uc2VdKTsKKyAgICByZXR1cm4gcGZuUnNwUHJvY1RibFtwRXZlbnREYXRhLT53ZGlSZXNwb25zZV0ocFdESUN0eCwgcEV2ZW50RGF0YSk7CisgIH0KKyAgZWxzZQorICB7CisgICAgV1BBTF9UUkFDRShlV0xBTl9NT0RVTEVfREFMX0NUUkwsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIk9wZXJhdGlvbiAlZCBpcyBub3QgeWV0IGltcGxlbWVudGVkICIsCisgICAgICAgICAgICAgIHBFdmVudERhdGEtPndkaVJlc3BvbnNlKTsKKyAgICByZXR1cm4gV0RJX1NUQVRVU19FX05PVF9JTVBMRU1FTlQ7CisgIH0KK30vKldESV9Qcm9jZXNzUmVzcG9uc2UqLworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgICAgICAgICAgICAgIFFVRVVFIFNVUFBPUlQgVVRJTElUWSBGVU5DVElPTlMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKioKKyBAYnJpZWYgICAgVXRpbGl0eSBmdW5jdGlvbiB1c2VkIGJ5IHRoZSBEQUwgQ29yZSB0byBoZWxwIHF1ZXVlIGEKKyAgICAgICAgICAgcmV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5wQ0JmbmMgICAgICAgICAgPSBwRXZlbnREYXRhLT5wQ0JmbmM7CisgIHBFdmVudERhdGFRdWV1ZS0+cFVzZXJEYXRhICAgICAgID0gcEV2ZW50RGF0YS0+cFVzZXJEYXRhOworICBwRXZlbnREYXRhUXVldWUtPnVFdmVudERhdGFTaXplICA9IHBFdmVudERhdGEtPnVFdmVudERhdGFTaXplOworICBwRXZlbnREYXRhUXVldWUtPndkaVJlcXVlc3QgICAgICA9IHBFdmVudERhdGEtPndkaVJlcXVlc3Q7CisgIHBFdmVudERhdGFRdWV1ZS0+d2RpUmVzcG9uc2UgICAgID0gcEV2ZW50RGF0YS0+d2RpUmVzcG9uc2U7CisKKyAgaWYoIHBFdmVudERhdGEtPnVFdmVudERhdGFTaXplICE9IDAgJiYgcEV2ZW50RGF0YS0+cEV2ZW50RGF0YSAhPSBOVUxMICkKKyAgeworICAgICBwRXZlbnRJbmZvID0gd3BhbE1lbW9yeUFsbG9jYXRlKHBFdmVudERhdGEtPnVFdmVudERhdGFTaXplKTsKKworICAgICBpZiAoIE5VTEwgPT0gIHBFdmVudEluZm8gKQorICAgICB7CisgICAgICAgV1BBTF9UUkFDRShlV0xBTl9NT0RVTEVfREFMX0NUUkwsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIkNhbm5vdCBhbGxvY2F0ZSBtZW1vcnkgZm9yIHF1ZXVlaW5nIGV2ZW50IGRhdGEgaW5mbyIpOworICAgICAgIFdESV9BU1NFUlQoMCk7CisgICAgICAgd3BhbE1lbW9yeUZyZWUocEV2ZW50RGF0YVF1ZXVlKTsKKyAgICAgICByZXR1cm4gV0RJX1NUQVRVU19NRU1fRkFJTFVSRTsKKyAgICAgfQorCisgICAgIHdwYWxNZW1vcnlDb3B5KHBFdmVudEluZm8sIHBFdmVudERhdGEtPnBFdmVudERhdGEsIHBFdmVudERhdGEtPnVFdmVudERhdGFTaXplKTsKKworICB9CisgIHBFdmVudERhd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TZXNzaW9uc1tpXS5iSW5Vc2UgKQorICAgICB7CisgICAgICAgLypGb3VuZCBhIHNlc3Npb24qLworICAgICAgICpwcFNlc3Npb24gPSAmcFdESUN0eC0+YUJTU1Nlc3Npb25zW2ldOworICAgICAgIHJldHVybiBpOworICAgICB9CisgIH0KKworICByZXR1cm4gaTsKK30vKldESV9GaW5kRW1wdHlTZXNzaW9uKi8KKworCisvKioKKyBAYnJpZWYgSGVscGVyIHJvdXRpbmUgdXNlZCB0byBnZXQgdGhlIHRvdGFsIGNvdW50IG9mIGFjdGl2ZQorICAgICAgICBzZXNzaW9ucworCisKKyBAcGFyYW0gIHBXRElDdHg6ICAgICAgIHBvaW50ZXIgdG8gdGhlIFdMQU4gREFMIGNvbnRleHQKKyAgICAgICAgIG1hY0JTU0lEOiAgICAgIHBvaW50ZXIgdG8gQlNTSUQuIElmIE5VTEwsIGdldCBhbGwgdGhlIHNlc3Npb24uCisgICAgICAgICAgICAgICAgICAgICAgICBJZiBub3QgTlVMTCwgY291bnQgQWN0aXZlU2Vzc2lvbiBieSBleGNsdWRpbmcgKFRSVUUpIG9yIGluY2x1ZGluZyAoRkFMU0UpIHNraXBCU1NJRC4KKyAgICAgICAgIHNraXBCU1NJRDogICAgIGlmIFRSVUUsIGdldCBhbGwgdGhlIHNlc3Npb25zIGV4Y2VwdCBtYXRjaGluZyB0byBtYWNCU1NJRC4gSWYgRkFMU0UsIGdldCBhbGwgc2Vzc2lvbi4KKyAgICAgICAgICAgICAgICAgICAgICAgIFRoaXMgYXJndW1lbnQgaXMgaWdub3JlZCBpZiBtYWNCU1NJRCBpcyBOVUxMLgorIEBzZWUKKyBAcmV0dXJuIE51bWJlciBvZiBzZXNzaW9ucyBpbiB1c2UKKyovCit3cHRfdWludDgKK1dESV9HZXRBY3RpdmVTZXNzaW9uc0NvdW50CisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgIHBXRElDdHgsCisgIHdwdF9tYWNBZGRyICAgICAgICAgICAgIG1hY0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ZXIgdG8gdGhlIGV2ZW50IGluZm9ybWF0aW9uIHN0cnVjdHVyZQorCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisgKi8KKworV0RJX1N0YXR1cyBXRElfU2VuZE52QmxvYlJlcQorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKQoreworCisgIHRIYWxOdkltZ0Rvd25sb2FkUmVxTXNnICAgIGhhbE52SW1nRG93bmxvYWRQYXJhbTsKKyAgd3B0X3VpbnQ4KiAgICAgICAgICAgICAgICAgcFNlbmRCdWZmZXIgICA9IE5VTEw7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgIHVzRGF0YU9mZnNldCAgPSAwOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICB1c1NlbmRTaXplICAgID0gMDsKKyAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgICAgdXNDdXJyZW50RnJhZ21lbnRTaXplID0wOworICB3cHRfdWludDgqICAgICAgICAgICAgICAgICBwU3JjQnVmZmVyID0gTlVMTDsKKyAgV0RJX052RG93bmxvYWRSZXFQYXJhbXNUeXBlKiAgcHdkaU52RG93bmxvYWRSZXFQYXJhbXMgPU5VTEwgOworICBXRElfTnZEb3dubG9hZFJzcENiICAgICAgd2RpTnZEb3dubG9hZFJzcENiOworCisgIHdkaU52RG93bmxvYWRSc3BDYiA9IChXRElfTnZEb3dubG9hZFJzcENiKXBFdmVudERhdGEtPnBDQmZuYzsKKyAgV0RJX0FTU0VSVChOVUxMICE9IHdkaU52RG93bmxvYWRSc3BDYik7CisgIHB3ZGlOdkRvd25sb2FkUmVxUGFyYW1zID0gKFdESV9OdkRvd25sb2FkUmVxUGFyYW1zVHlwZSopcEV2ZW50RGF0YS0+cEV2ZW50RGF0YTsKKworICAvKiBTYW5pdHkgQ2hlY2sgaXMgZG9uZSBieSB0aGU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ZmZXIgKyB1c0RhdGFPZmZzZXQgKyBzaXplb2YodEhhbE52SW1nRG93bmxvYWRSZXFQYXJhbXMpLAorICAgICAgICAodm9pZCAqKShwU3JjQnVmZmVyICsgaGFsTnZJbWdEb3dubG9hZFBhcmFtLm52SW1hZ2VSZXFQYXJhbXMuZnJhZ051bWJlciAqIEZSQUdNRU5UX1NJWkUpLAorICAgICAgICAgICAgICAgICAgdXNDdXJyZW50RnJhZ21lbnRTaXplKTsKKworICBwV0RJQ3R4LT53ZGlSZXFTdGF0dXNDQiAgICAgPSBwd2RpTnZEb3dubG9hZFJlcVBhcmFtcy0+d2RpUmVxU3RhdHVzQ0I7CisgIHBXRElDdHgtPnBSZXFTdGF0dXNVc2VyRGF0YSA9IHB3ZGlOdkRvd25sb2FkUmVxUGFyYW1zLT5wVXNlckRhdGE7CisKKyAgcmV0dXJuICBXRElfU2VuZE1zZyggcFdESUN0eCwgcFNlbmRCdWZmZXIsIHVzU2VuZFNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB3ZGlOdkRvd25sb2FkUnNwQ2IsIHBFdmVudERhdGEtPnBVc2VyRGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIFdESV9OVl9ET1dOTE9BRF9SRVNQKTsKKworfQorLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEhlbHBlciBpbmxpbmUgZnVuY3Rpb25zIGZvcgorID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworLyoqCisgQGJyaWVmIEhlbHBlciByb3V0aW5lIHVzZWQgdG8gZmluZCBhIHNlc3Npb24gYmFzZWQgb24gdGhlIEJTU0lECisgQHBhcmFtICBwQ29udGV4dDogICBwb2ludGVyIHRvIHRoZSBXTEFOIERBTCBjb250ZXh0CisgQHBhcmFtICBwRFBDb250ZXh0OiAgIHBvaW50ZXIgdG8gdGhlIERhdGFwYXRoIGNvbnRleHQKKworIEBzZWUKKyBAcmV0dXJuCisqLworV1BUX0lOTElORSB2b2lkCitXRElfRFNfQXNzaWduRGF0YXBhdGhDb250ZXh0ICh2b2lkICpwQ29udGV4dCwgdm9pZCAqcERQQ29udGV4dCkKK3sKKyAgIFdESV9Db250cm9sQmxvY2tUeXBlICpwQ0IgPSAoV0RJX0NvbnRyb2xCbG9ja1R5cGUgKilwQ29udGV4dDsKKworICAgcENCLT5wRFBDb250ZXh0ID0gcERQQ29udGV4dDsKKyAgIHJldHVybjsKK30KKworLyoqCisgQGJyaWVmIEhlbHBlciByb3V0aW5lIHVzZWQgdG8gZmluZCBhIHNlc3Npb24gYmFzZWQgb24gdGhlIEJTU0lECisKKworIEBwYXJhbSAgcENvbnRleHQ6ICAgcG9pbnRlciB0byB0aGUgV0xBTiBEQUwgY29udGV4dAorCisgQHNlZQorIEByZXR1cm4gcG9pbnRlciB0byBEYXRhcGF0aCBjb250ZXh0CisqLworV1BUX0lOTElORSB2b2lkICoKK1dESV9EU19HZXREYXRhcGF0aENvbnRleHQgKHZvaWQgKnBDb250ZXh0KQoreworICAgV0RJX0NvbnRyb2xCbG9ja1R5cGUgKnBDQiA9IChXRElfQ29udHJvbEJsb2NrVHlwZSAqKXBDb250ZXh0OworICAgcmV0dXJuIHBDQi0+cERQQ29udGV4dDsKK30KKy8qKgorIEBicmllZiBIZWxwZXIgcm91dGluZSB1c2VkIHRvIGZpbmQgYSBzZXNzaW9uIGJhc2VkIG9uIHRoZSBCU1NJRAorCisKKyBAcGFyYW0gIHBDb250ZXh0OiAgIHBvaW50ZXIgdG8gdGhlIFdMQU4gREFMIGNvbnRleHQKKyBAcGFyYW0gIHBEVERyaXZlckNvbnRleHQ6ICAgcG9pbnRlciB0byB0aGUgVHJhbnNwb3J0IERyaXZlciBjb250ZXh0CisKKyBAc2VlCisgQHJldHVybiB2b2lkCisqLworV1BUX0lOTElORSB2b2lkCitXRFRfQXNzaWduVHJhbnNwb3J0RHJpdmVyQ29udGV4dCAodm9pZCAqcENvbnRleHQsIHZvaWQgKnBEVERyaXZlckNvbnRleHQpCit7CisgICBXRElfQ29udHJvbEJsb2NrVHlwZSAqcENCID0gKFdESV9Db250cm9sQmxvY2tUeXBlICopcENvbnRleHQ7CisKKyAgIHBDQi0+cERURHJpdmVyQ29udGV4dCA9IHBEVERyaXZlckNvbnRleHQ7CisgICByZXR1cm47Cit9CisKKy8qKgorIEBicmllZiBIZWxwZXIgcm91dGluZSB1c2VkIHRvIGZpbmQgYSBzZXNzaW9uIGJhc2VkIG9uIHRoZSBCU1NJRAorCisKKyBAcGFyYW0gIHBXRElDdHg6ICAgcG9pbnRlciB0byB0aGUgV0xBTiBEQUwgY29udGV4dAorCisgQHNlZQorIEByZXR1cm4gcG9pbnRlciB0byBkYXRhcGF0aCBjb250ZXh0CisqLworV1BUX0lOTElORSB2b2lkICoKK1dEVF9HZXRUcmFuc3BvcnREcml2ZXJDb250ZXh0ICh2b2lkICpwQ29udGV4dCkKK3sKKyAgIFdESV9Db250cm9sQmxvY2tUeXBlICpwQ0IgPSAoV0RJX0NvbnRyb2xCbG9ja1R5cGUgKilwQ29udGV4dDsKKyAgIHJldHVybihwQ0ItPnBEVERyaXZlckNvbnRleHQpOworfQorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgSGVscGVyIGlubGluZSBjb252ZXJ0ZXJzCisgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisvKkNvbnZlcnQgV0RJIGRyaXZlciB0eXBlIGludG8gSEFMIGRyaXZlciB0eXBlKi8KK1dQVF9TVEFUSUMgV1BUX0lOTElORSBXRElfU3RhdHVzCitXRElfSEFMXzJfV0RJX1NUQVRVUworKAorICBlSGFsU3RhdH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AgeworICBjYXNlIFdESV9MSU5LX0lETEVfU1RBVEU6CisgICAgcmV0dXJuIGVTSVJfTElOS19JRExFX1NUQVRFOworCisgIGNhc2UgV0RJX0xJTktfUFJFQVNTT0NfU1RBVEU6CisgICAgcmV0dXJuIGVTSVJfTElOS19QUkVBU1NPQ19TVEFURTsKKworICBjYXNlIFdESV9MSU5LX1BPU1RBU1NPQ19TVEFURToKKyAgICByZXR1cm4gZVNJUl9MSU5LX1BPU1RBU1NPQ19TVEFURTsKKworICBjYXNlIFdESV9MSU5LX0FQX1NUQVRFOgorICAgIHJldHVybiBlU0lSX0xJTktfQVBfU1RBVEU7CisKKyAgY2FzZSBXRElfTElOS19JQlNTX1NUQVRFOgorICAgIHJldHVybiBlU0lSX0xJTktfSUJTU19TVEFURTsKKworICBjYXNlIFdESV9MSU5LX0JUQU1QX1BSRUFTU09DX1NUQVRFOgorICAgIHJldHVybiBlU0lSX0xJTktfQlRBTVBfUFJFQVNTT0NfU1RBVEU7CisKKyAgY2FzZSBXRElfTElOS19CVEFNUF9QT1NUQVNTT0NfU1RBVEU6CisgICAgcmV0dXJuIGVTSVJfTElOS19CVEFNUF9QT1NUQVNTT0NfU1RBVEU7CisKKyAgY2FzZSBXRElfTElOS19CVEFNUF9BUF9TVEFURToKKyAgICByZXR1cm4gZVNJUl9MSU5LX0JUQU1QX0FQX1NUQVRFOworCisgIGNhc2UgV0RJX0xJTktfQlRBTVBfU1RBX1NUQVRFOgorICAgIHJldHVybiBlU0lSX0xJTktfQlRBTVBfU1RBX1NUQVRFOworCisgIGNhc2UgV0RJX0xJTktfTEVBUk5fU1RBVEU6CisgICAgcmV0dXJuIGVTSVJfTElOS19MRUFSTl9TVEFURTsKKworICBjYXNlIFdESV9MSU5LX1NDQU5fU1RBVEU6CisgICAgcmV0dXJuIGVTSVJfTElOS19TQ0FOX1NUQVRFOworCisgIGNhc2UgV0RJX0xJTktfRklOSVNIX1NDQU5fU1RBVEU6CisgICAgcmV0dXJuIGVTSVJf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y0+d2RpUmF0ZVNldCk7CisKKyAgcGhhbENvbmZpZ0JTUy0+ZWRjYVBhcmFtc1ZhbGlkID0gcHdkaUNvbmZpZ0JTUy0+dWNFRENBUGFyYW1zVmFsaWQ7CisKKyAgaWYocGhhbENvbmZpZ0JTUy0+ZWRjYVBhcmFtc1ZhbGlkKQorICB7CisgICAgIFdESV9Db3B5V0RJRURDQVBhcmFtc1RvSEFMRURDQVBhcmFtcyggJnBoYWxDb25maWdCU1MtPmFjYmUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnB3ZGlDb25maWdCU1MtPndkaUJFRURDQVBhcmFtcyk7CisgICAgIFdESV9Db3B5V0RJRURDQVBhcmFtc1RvSEFMRURDQVBhcmFtcyggJnBoYWxDb25maWdCU1MtPmFjYmssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnB3ZGlDb25maWdCU1MtPndkaUJLRURDQVBhcmFtcyk7CisgICAgIFdESV9Db3B5V0RJRURDQVBhcmFtc1RvSEFMRURDQVBhcmFtcyggJnBoYWxDb25maWdCU1MtPmFjdmksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnB3ZGlDb25maWdCU1MtPndkaVZJRURDQVBhcmFtcyk7CisgICAgIFdESV9Db3B5V0RJRURDQVBhcmFtc1RvSEFMRURDQVBhcmFtcyggJnBoYWxDb25maWdCU1MtPmFjdm8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnB3ZGlDb25maWdCU1MtPndkaVZPRURDQVBhcmFtcyk7CisgIH0KKworICBwaGFsQ29uZmlnQlNTLT5oYWxQZXJzb25hID0gcHdkaUNvbmZpZ0JTUy0+dWNQZXJzb25hOworCisgIHBoYWxDb25maWdCU1MtPmJTcGVjdHJ1bU1ndEVuYWJsZSA9IHB3ZGlDb25maWdCU1MtPmJTcGVjdHJ1bU1ndEVuOworCisjaWZkZWYgV0xBTl9G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AgICAgICAgICAgICAgV0RJX01BWF9LRVlfUlNDX0xFTik7CisgICAgICAgIHBoYWxDb25maWdCU1MtPmV4dFNldFN0YUtleVBhcmFtLmtleVtrZXlJbmRleF0ucGFlUm9sZSA9CisgICAgICAgICAgIHB3ZGlDb25maWdCU1MtPndkaUV4dFNldEtleVBhcmFtLndkaUtleVtrZXlJbmRleF0ucGFlUm9sZTsKKyAgICAgICAgcGhhbENvbmZpZ0JTUy0+ZXh0U2V0U3RhS2V5UGFyYW0ua2V5W2tleUluZGV4XS5rZXlMZW5ndGggPQorICAgICAgICAgICBwd2RpQ29uZmlnQlNTLT53ZGlFeHRTZXRLZXlQYXJhbS53ZGlLZXlba2V5SW5kZXhdLmtleUxlbmd0aDsKKyAgICAgICAgd3BhbE1lbW9yeUNvcHkocGhhbENvbmZpZ0JTUy0+ZXh0U2V0U3RhS2V5UGFyYW0ua2V5W2tleUluZGV4XS5rZXksCisgICAgICAgICAgICAgICAgICAgICAgIHB3ZGlDb25maWdCU1MtPndkaUV4dFNldEtleVBhcmFtLndkaUtleVtrZXlJbmRleF0ua2V5LAorICAgICAgICAgICAgICAgICAgICAgICBXRElfTUFYX0tFWV9MRU5HVEgpOworICAgICB9CisgIH0KKyAgZWxzZS8qIHBoYWxDb25maWdCU1MtPmV4dFNldFN0YUtleVBhcmFtVmFsaWQgaXMgbm90IHNldCAqLworICB7CisgICAgIHdwYWxNZW1vcnlaZXJvKCAmcGhhbENvbmZpZ0JTUy0+ZXh0U2V0U3RhS2V5UGFyYW0sCisgICAgICAgICAgICAgICAgICAgICBzaXplb2YocGhhbENvbmZpZ0JTUy0+ZXh0U2V0U3RhS2V5UGFyYW0pICk7CisgIH0KKworI2VuZGlmIC8qV0xBTl9GRUFUVVJFX1ZPV0lGSV8xMVIqLworCisjaWZkZWYgV0xBTl9GRUFUVVJFXzExQUMKKyAgaWYocGhhbENvbmZpZ0JTU19WMSAhPSBOVUxMKQorICB7CisgICAgICBwaGFsQ29uZmlnQlNTX1Y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5PU2NhblJlcVBhcmFtczogICAgICBwb2ludGVyIHRvIHRoZSBpbmZvIHJlY2VpdmVkCisgICAgICAgICBmcm9tIHVwcGVyIGxheWVycworICAgICAgICAgcHBTZW5kQnVmZmVyLCBwU2l6ZSAtIG91dCBwb2ludGVycyBvZiB0aGUgcGFja2VkIGJ1ZmZlcgorICAgICAgICAgYW5kIGl0cyBzaXplCisKKyBAcmV0dXJuIFJlc3VsdCBvZiB0aGUgZnVuY3Rpb24gY2FsbAorKi8KKworV0RJX1N0YXR1cworV0RJX1BhY2tQcmVmZXJyZWROZXR3b3JrTGlzdE5ldworKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogICAgICBwV0RJQ3R4LAorICBXRElfUE5PU2NhblJlcVBhcmFtc1R5cGUqICBwd2RpUE5PU2NhblJlcVBhcmFtcywKKyAgd3B0X3VpbnQ4KiogICAgICAgICAgICAgICAgcHBTZW5kQnVmZmVyLAorICB3cHRfdWludDE2KiAgICAgICAgICAgICAgICBwU2l6ZQorKQoreworICAgd3B0X3VpbnQ4KiAgICAgICAgICAgICAgICAgcFNlbmRCdWZmZXIgICAgICAgICAgID0gTlVMTDsKKyAgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgIHVzRGF0YU9mZnNldCAgICAgICAgICA9IDA7CisgICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICB1c1NlbmRTaXplICAgICAgICAgICAgPSAwOworICAgdHBQcmVmTmV0d0xpc3RQYXJhbXNOZXcgICAgcFByZWZOZXR3TGlzdFBhcmFtczsKKyAgIHdwdF91aW50OCBpOworCisgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgIEdldCBtZXNzYWdlIGJ1ZmZlcgorICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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QUwgY29udGV4dAorICAgICAgICAgcEV2ZW50RGF0YTogICAgICBwb2ludGVyIHRvIHRoZSBldmVudCBpbmZvcm1hdGlvbiBzdHJ1Y3R1cmUKKworIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cworV0RJX1Byb2Nlc3NTZXRQcmVmZXJyZWROZXR3b3JrUmVxCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispCit7CisgICBXRElfUE5PU2NhblJlcVBhcmFtc1R5cGUqICBwd2RpUE5PU2NhblJlcVBhcmFtcyAgPSBOVUxMOworICAgV0RJX1BOT1NjYW5DYiAgICAgICAgICAgICAgd2RpUE5PU2NhbkNiICAgICAgICAgID0gTlVMTDsKKyAgIHdwdF91aW50OCogICAgICAgICAgICAgICAgIHBTZW5kQnVmZmVyICAgICAgICAgICA9IE5VTEw7CisgICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICB1c1NlbmRTaXplICAgICAgICAgICAgPSAwOworICAgV0RJX1N0YXR1cyAgICAgICAgICAgICAgICAgd2RpU3RhdHVzOworCisgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgU2FuaXR5IGNoZWNrCisgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyAgIGlmICgoIE5VTEwgPT0gcEV2ZW50RGF0YSApIHx8CisgICAgICAgKCBOVUxMID09IChwd2RpUE5PU2NhblJlcVBhcmFtcyA9IChXRElfUE5PU2NhblJlcVBhcmFtc1R5cGUqKXBFdmVudERhdGEtPnBFdmVudERhdGEpKSB8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FuQ2IsIHBFdmVudERhdGEtPnBVc2VyRGF0YSwgV0RJX1NFVF9QUkVGX05FVFdPUktfUkVTUCk7Cit9CisKKy8qKgorIEBicmllZiBQcm9jZXNzIFNldCBSU1NJIEZpbHRlciBSZXF1ZXN0IGZ1bmN0aW9uCisKKyBAcGFyYW0gIHBXRElDdHg6ICAgICAgICAgcG9pbnRlciB0byB0aGUgV0xBTiBEQUwgY29udGV4dAorICAgICAgICAgcEV2ZW50RGF0YTogICAgICBwb2ludGVyIHRvIHRoZSBldmVudCBpbmZvcm1hdGlvbiBzdHJ1Y3R1cmUKKworIEBzZWUKKyBAcmV0dXJuIFJlc3VsdCBvZiB0aGUgZnVuY3Rpb24gY2FsbAorKi8KK1dESV9TdGF0dXMKK1dESV9Qcm9jZXNzU2V0UnNzaUZpbHRlclJlcQorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKQoreworICAgV0RJX1NldFJzc2lGaWx0ZXJSZXFQYXJhbXNUeXBlKiBwd2RpUnNzaUZpbHRlclJlcVBhcmFtcyA9IE5VTEw7CisgICBXRElfUnNzaUZpbHRlckNiICAgICAgICAgICAgICAgIHdkaVJzc2lGaWx0ZXJDYiAgICAgICAgID0gTlVMTDsKKyAgIHdwdF91aW50OCogICAgICAgICAgICAgICAgICAgICAgcFNlbmRCdWZmZXIgICAgICAgICAgICAgPSBOVUxMOworICAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgICAgICAgICB1c0RhdGFPZmZzZXQgICAgICAgICAgICA9IDA7CisgICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICAgICAgIHVzU2VuZFNpemUgICAgICAgICAgICAgID0gMDsKKyAgIHdwdF91aW50OCAgICAgICAgICAgICAgICAgICAgICAgdWNSc3NpVGhyZXNob2xkOworCisgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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ICAgIGNhc2UgV0RJX0VEX1RLSVA6CisgICAgICAgICAqRWRUeXBlID0gZUVEX1RLSVA7CisgICAgICAgICAgYnJlYWs7CisgICAgY2FzZSBXRElfRURfQ0NNUDoKKyNpZmRlZiBXTEFOX0ZFQVRVUkVfMTFXCisgICAgY2FzZSBXRElfRURfQUVTXzEyOF9DTUFDOgorI2VuZGlmCisgICAgICAgICAqRWRUeXBlID0gZUVEX0NDTVA7CisgICAgICAgICAgYnJlYWs7CisjaWZkZWYgRkVBVFVSRV9XTEFOX1dBUEkKKyAgICBjYXNlIFdESV9FRF9XUEk6CisgICAgICAgICAqRWRUeXBlID0gZUVEX1dQSTsKKyAgICAgICAgICBicmVhazsKKyNlbmRpZgorICAgIGNhc2UgV0RJX0VEX0FOWToKKyAgICAgICAgICpFZFR5cGUgPSBlRURfQU5ZOworICAgICAgICAgIGJyZWFrOworCisgICAgZGVmYXVsdDoKKyAgICAgICAgIFdQQUxfVFJBQ0UoIGVXTEFOX01PRFVMRV9EQUxfQ1RSTCwgIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgICAgIiVzOiBVbmtub3duIEVuY3J5cHRpb24gVHlwZSIsIF9fZnVuY19fKTsKKyAgICAgICAgIGJyZWFrOworICAgICB9Cit9CisKKy8qKgorIEBicmllZiBIZWxwZXIgZnVuY3Rpb24gdG8gcGFjayBTdGFydCBSb2FtIENhbmRpZGF0ZSBMb29rdXAKKyAgICAgICAgUmVxdWVzdCBwYXJhbWV0ZXJzCisKKyBAcGFyYW0gIHBXRElDdHg6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50ZXIgdG8gdGhlIFdMQU4gREFMIGNvbnRleHQKKyAgICAgICAgIHB3ZGlSb2FtU2Nhbk9mZmxvYWRSZXFQYXJhbXM6ICAgICAgcG9pbnRlciB0byB0aGUgaW5mbyByZWNlaXZlZAorICAgICAgICAgZnJvbSB1cHBlciBsYXllcnMKKyAgICAgIC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U2NhblBhcmFtc0NiLCBwRXZlbnREYXRhLT5wVXNlckRhdGEsIAorICAgICAgICAgICAgICAgICAgICAgICAgV0RJX1VQREFURV9TQ0FOX1BBUkFNU19SRVNQKTsKK30KKworLyoqCisgQGJyaWVmIFByb2Nlc3MgVXBkYXRlIENoYW5uZWwgUGFyYW1zIGZ1bmN0aW9uCisKKyBAcGFyYW0gIHBXRElDdHg6ICAgICAgICAgcG9pbnRlciB0byB0aGUgV0xBTiBEQUwgY29udGV4dAorICAgICAgICAgcEV2ZW50RGF0YTogICAgICBwb2ludGVyIHRvIHRoZSBldmVudCBpbmZvcm1hdGlvbiBzdHJ1Y3R1cmUKKworIEBzZWUKKyBAcmV0dXJuIFJlc3VsdCBvZiB0aGUgZnVuY3Rpb24gY2FsbAorKi8KK1dESV9TdGF0dXMKK1dESV9Qcm9jZXNzVXBkYXRlQ2hhbm5lbFBhcmFtc1JlcQorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKQoreworICAgV0RJX1VwZGF0ZUNoUmVxUGFyYW1zVHlwZSAgICAgKnB3ZGlVcGRhdGVDaGFuTGlzdFBhcmFtcyAgPSBOVUxMOworICAgV0RJX1VwZGF0ZUNoYW5uZWxSc3BDYiAgICAgICAgd2RpVXBkYXRlQ2hhblBhcmFtc0NiID0gTlVMTDsKKyAgIHdwdF91aW50OCogICAgICAgICAgICAgICAgICAgIHBTZW5kQnVmZmVyICAgICAgICAgICA9IE5VTEw7CisgICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICAgICB1c0RhdGFPZmZzZXQgICAgICAgICAgPSAwOworICAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgICAgICAgdXNTZW5kU2l6ZSAgICAgICAgICAgID0gMDsKKyAgIHRVcGRhdGVDaGFubmVsUmVxVHlwZSAgICAgICAgICp1cGRhdGVDaGFubmVsUGFyYW1zOworICAgd3B0X3Vp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cFdESUN0eCwgV0RJX1JFQ0VJVkVfRklMVEVSX1NFVF9GSUxURVJfUkVRLAorICAgICAgICAgICAgICAgICAgICAgICAgIHVzUmN2UGt0RmlsdGVyQ2ZnU2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAmcFNlbmRCdWZmZXIsICZ1c0RhdGFPZmZzZXQsICZ1c1NlbmRTaXplKSl8fAorICAgICAgICAgICAgKCB1c1NlbmRTaXplIDwgKHVzRGF0YU9mZnNldCArIHVzUmN2UGt0RmlsdGVyQ2ZnU2l6ZSkpKQorICAgICAgICB7CisgICAgICAgICAgICAgIFdQQUxfVFJBQ0UoIGVXTEFOX01PRFVMRV9EQUxfQ1RSTCwgIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAgIlVuYWJsZSB0byBnZXQgc2VuZCBidWZmZXIgaW4gIgorICAgICAgICAgICAgICAgICAgIldESV9Qcm9jZXNzUmVjZWl2ZUZpbHRlclNldEZpbHRlclJlcSgpICVwICVwICVwIiwKKyAgICAgICAgICAgICAgICAgIHBFdmVudERhdGEsIHB3ZGlTZXRSY3ZQa3RGaWx0ZXJSZXFJbmZvLAorICAgICAgICAgICAgICAgICAgd2RpUmVjZWl2ZUZpbHRlclNldEZpbHRlckNiKTsKKyAgICAgICAgICAgICAgV0RJX0FTU0VSVCgwKTsKKyAgICAgICAgICAgICAgd3BhbE1lbW9yeUZyZWUocFJjdlBrdEZpbHRlckNmZyk7CisgICAgICAgICAgICAgIHJldHVybiBXRElfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICAgICAgfQorCisgICAgICAgV1BBTF9UUkFDRShlV0xBTl9NT0RVTEVfREFMX0NUUkwsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAiVXNEYXRhIE9mZiAlZCBVc1NlbmQgJWQgY2ZnICVkIix1c0RhdGFPZmZzZXQsCisgICAgICAgICAgICAgIHVzU2VuZFNpemUs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1JFU1ApOworfQorCisvKioKKyBAYnJpZWYgUHJvY2VzcyBQYWNrZXQgRmlsdGVyIE1hdGNoIENvdW50IFJlcXVlc3QgZnVuY3Rpb24KKworIEBwYXJhbSAgcFdESUN0eDogICAgICAgICBwb2ludGVyIHRvIHRoZSBXTEFOIERBTCBjb250ZXh0CisgICAgICAgICBwRXZlbnREYXRhOiAgICAgIHBvaW50ZXIgdG8gdGhlIGV2ZW50IGluZm9ybWF0aW9uIHN0cnVjdHVyZQorCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cworV0RJX1Byb2Nlc3NGaWx0ZXJNYXRjaENvdW50UmVxCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispCit7CisgICBXRElfUmN2Rmx0UGt0TWF0Y2hDbnRSZXFQYXJhbXNUeXBlKiAgICBwd2RpUmN2Rmx0UGt0TWF0Y2hDbnRSZXFQYXJhbXNUeXBlID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMOworICAgV0RJX0ZpbHRlck1hdGNoQ291bnRDYiAgICAgICAgICAgICAgICAgd2RpRmlsdGVyTWF0Y2hDb3VudENiICAgICAgICAgICAgICA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTDsKKyAgIHdwdF91aW50OCogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTZW5kQnVmZmVyICAgICAgICAgICA9IE5VTEw7CisgICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c0RhdGFPZmZzZXQgICAgICAgICAgPSAwOworICAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgICAgICAg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01BVENIX0NPVU5UX1JFUSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodEhhbFJjdkZsdFBrdE1hdGNoQ250UmVxUGFyYW1zKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAmcFNlbmRCdWZmZXIsICZ1c0RhdGFPZmZzZXQsICZ1c1NlbmRTaXplKSl8fAorICAgICAgICggdXNTZW5kU2l6ZSA8ICh1c0RhdGFPZmZzZXQgKyBzaXplb2YodEhhbFJjdkZsdFBrdE1hdGNoQ250UmVxUGFyYW1zKSkpKQorICAgeworICAgICAgV1BBTF9UUkFDRSggZVdMQU5fTU9EVUxFX0RBTF9DVFJMLCAgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICAiVW5hYmxlIHRvIGdldCBzZW5kIGJ1ZmZlciBpbiAiCisgICAgICAgICAgICAgICAgICAiV0RJX1Byb2Nlc3NGaWx0ZXJNYXRjaENvdW50UmVxKCkgJXAgJXAgJXAiLAorICAgICAgICAgICAgICAgICAgcEV2ZW50RGF0YSwgcHdkaVJjdkZsdFBrdE1hdGNoQ250UmVxUGFyYW1zVHlwZSwKKyAgICAgICAgICAgICAgICAgIHdkaUZpbHRlck1hdGNoQ291bnRDYik7CisgICAgICBXRElfQVNTRVJUKDApOworICAgICAgcmV0dXJuIFdESV9TVEFUVVNfRV9GQUlMVVJFOworICAgfQorCisgICByY3ZGbHRQa3RNYXRjaENudFJlcVBhcmFtLmJzc0lkeCA9IHBCU1NTZXMtPnVjQlNTSWR4OworICAgd3BhbE1lbW9yeUNvcHkoIHBTZW5kQnVmZmVyK3VzRGF0YU9mZnNldCwKKyAgICAgICAgICAgICAgICAgICAmcmN2Rmx0UGt0TWF0Y2hDbnRSZXFQYXJhbSwKKyAgICAgICAgICAgICAgICAgICBzaXplb2YocmN2Rmx0UGt0TWF0Y2hDbnRSZXFQYXJhbSkpOworCisgICAvLworICAgLy8gRG9uJ3QgbmVlZCB0byBmaWxsIH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ICAgICAgICBwRXZlbnREYXRhOiAgICAgIHBvaW50ZXIgdG8gdGhlIGV2ZW50IGluZm9ybWF0aW9uIHN0cnVjdHVyZQorCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cworV0RJX1Byb2Nlc3NTZXRQb3dlclBhcmFtc1JlcQorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKQoreworICAgV0RJX1NldFBvd2VyUGFyYW1zUmVxUGFyYW1zVHlwZSogcHdkaVBvd2VyUGFyYW1zUmVxUGFyYW1zID0gTlVMTDsKKyAgIFdESV9TZXRQb3dlclBhcmFtc0NiICAgICAgICAgICAgIHdkaVBvd2VyUGFyYW1zQ2IgICAgICAgICA9IE5VTEw7CisgICB3cHRfdWludDgqICAgICAgICAgICAgICAgICAgICAgICBwU2VuZEJ1ZmZlciAgICAgICAgICAgICAgPSBOVUxMOworICAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgICAgICAgICAgdXNEYXRhT2Zmc2V0ICAgICAgICAgICAgID0gMDsKKyAgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgICAgIHVzU2VuZFNpemUgICAgICAgICAgICAgICA9IDA7CisgICB0U2V0UG93ZXJQYXJhbXNUeXBlICAgICAgICAgICAgICBwb3dlclBhcmFtczsKKworICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgIFNhbml0eSBjaGVjaworICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisgICBpZiAoKCBOVUxMID09IHBFdmVudERhdGEgKSB8fAorIC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yB3ZGlTdGF0dXM6V0RJX1NUQVRVU19TVUNDRVNTX1NZTkM7Cit9LypXRElfUHJvY2Vzc0RIQ1BTdGFydEluZCovCisKKy8qKgorIEBicmllZiBQcm9jZXNzIERIQ1AgU3RvcCBpbmRpY2F0aW9uIG1lc3NhZ2UgYW5kIHBvc3QgaXQgdG8gSEFMCisKKyBAcGFyYW0gIHBXRElDdHg6ICAgIHBvaW50ZXIgdG8gdGhlIFdMQU4gREFMIGNvbnRleHQKKyAgICAgICAgIHBFdmVudERhdGE6ICAgICAgcG9pbnRlciB0byB0aGUgZXZlbnQgaW5mb3JtYXRpb24gc3RydWN0dXJlCisKKyBAc2VlCisgQHJldHVybiBSZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGwKKyovCitXRElfU3RhdHVzCitXRElfUHJvY2Vzc0RIQ1BTdG9wSW5kCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispCit7CisgIHdwdF91aW50OCogICAgICAgICAgICAgIHBTZW5kQnVmZmVyICAgICAgICA9IE5VTEw7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgIHVzRGF0YU9mZnNldCAgICAgICA9IDA7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgIHVzU2VuZFNpemUgICAgICAgICA9IDA7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgIHVzTGVuICAgICAgICAgICAgICA9IDA7CisgIFdESV9ESENQSW5kKiAgICAgICAgICAgIHB3ZGlESENQSW5kICAgICAgICA9IE5VTEw7CisgIHRESENQSW5mbyogICAgICAgICAgICAgIHBESENQSW5mbzsKKyAgV0RJX1N0YXR1cyAgICAgICAgICAgICAgd2RpU3RhdHVzOworCisgIC8qLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gK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0byB0aGUgV0xBTiBEQUwgY29udGV4dCAKKyAgICAgICAgIHBFdmVudERhdGE6ICAgICAgcG9pbnRlciB0byB0aGUgZXZlbnQgaW5mb3JtYXRpb24gc3RydWN0dXJlIAorICAKKyBAc2VlCisgQHJldHVybiBSZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGwKKyovCitXRElfU3RhdHVzCitXRElfUHJvY2Vzc0dUS09mZmxvYWRHZXRJbmZvUmVxCisoIAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKQoreworICAgV0RJX0d0a09mZmxvYWRHZXRJbmZvUmVxTXNnKiAgICAgcHdkaUd0a09mZmxvYWRHZXRJbmZvUmVxTXNnID0gTlVMTDsKKyAgIFdESV9HdGtPZmZsb2FkR2V0SW5mb0NiICAgICAgICAgIHdkaUd0a09mZmxvYWRHZXRJbmZvQ2IgICAgICA9IE5VTEw7CisgICB3cHRfdWludDgqICAgICAgICAgICAgICAgICAgICAgICBwU2VuZEJ1ZmZlciAgICAgICAgICAgPSBOVUxMOyAKKyAgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgICAgIHVzRGF0YU9mZnNldCAgICAgICAgICA9IDA7CisgICB3cHRfdWludDE2ICAgICAgICAgICAgICAgICAgICAgICB1c1NlbmRTaXplICAgICAgICAgICAgPSAwOworICAgdEhhbEd0a09mZmxvYWRHZXRJbmZvUmVxUGFyYW1zICAgaGFsR3RrT2ZmbG9hZEdldEluZm9SZXFQYXJhbXM7CisgICB3cHRfdWludDggICAgICAgICAgICAgICAgICAgICAgICB1Y0N1cnJlbnRTZXNzaW9uSWQgPSAwOworICAgV0RJX0JTU1Nlc3Npb25UeXBlKiAgICAgICAgICAgICAgcEJTU1NlcyA9IE5VTEw7CisKKyAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyAgIGlmKFdESV9nZXRGd1dsYW5GZWF0Q2FwcyhTTE1fU0VTU0lPTklaQVRJT04pKQorICAgeworICAgICAgICB3cGFsTWVtb3J5Q29weSggJmhhbEd0a09mZmxvYWRSc3BQYXJhbXMsCisgICAgICAgICAgICAgICAgICAgcEV2ZW50RGF0YS0+cEV2ZW50RGF0YSwKKyAgICAgICAgICAgICAgICAgICBzaXplb2YoaGFsR3RrT2ZmbG9hZFJzcFBhcmFtcykpOworCisgICAgICAgd2RpR3RrT2ZmbG9hZFJzcGFyYW1zLnVsU3RhdHVzID0gICAKKyAgICAgICAgICAgICAgICAgICAgICAgV0RJX0hBTF8yX1dESV9TVEFUVVMoaGFsR3RrT2ZmbG9hZFJzcFBhcmFtcy51bFN0YXR1cyk7CisgICAgICAgd2RpR3RrT2ZmbG9hZFJzcGFyYW1zLmJzc0lkeCA9ICAgCisgICAgICAgICAgICAgICAgICAgICAgIGhhbEd0a09mZmxvYWRSc3BQYXJhbXMuYnNzSWR4OworICAgfQorICAgZWxzZQorICAgeworICAgICAgIGhhbFN0YXR1cyA9ICooKGVIYWxTdGF0dXMqKXBFdmVudERhdGEtPnBFdmVudERhdGEpOworICAgICAgIHdkaUd0a09mZmxvYWRSc3BhcmFtcy51bFN0YXR1cyAgID0gICBXRElfSEFMXzJfV0RJX1NUQVRVUyhoYWxTdGF0dXMpOworICAgfQorCisgICAvKk5vdGlmeSBVTUFDKi8KKyAgIHdkaUd0a09mZmxvYWRDYiggJndkaUd0a09mZmxvYWRSc3BhcmFtcywgcFdESUN0eC0+cFJzcENCVXNlckRhdGEpOworCisgICByZXR1cm4gV0RJX1NUQVRVU19TVUNDRVNTOyAKK30KKworLyoqCisgQGJyaWVmIFByb2Nlc3MgR1RLIE9mZmxvYWQgR2V0IEluZm9ybWF0aW9uIFJlc3BvbnNlIGZ1bmN0aW9uCisgCisgQHBhcmFtICBwV0RJ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X1dESV9TVEFUVVMoaGFsR3RrT2ZmbG9hZEdldEluZm9Sc3BQYXJhbXMudWxTdGF0dXMpOworICAgICAgIHdkaUd0a09mZmxvYWRHZXRJbmZvUnNwYXJhbXMudWxsS2V5UmVwbGF5Q291bnRlciA9IAorICAgICAgICAgICAgICAgICAgICAgICBoYWxHdGtPZmZsb2FkR2V0SW5mb1JzcFBhcmFtcy51bGxLZXlSZXBsYXlDb3VudGVyOworICAgICAgIHdkaUd0a09mZmxvYWRHZXRJbmZvUnNwYXJhbXMudWxUb3RhbFJla2V5Q291bnQgPSAKKyAgICAgICAgICAgICAgICAgICAgICAgaGFsR3RrT2ZmbG9hZEdldEluZm9Sc3BQYXJhbXMudWxUb3RhbFJla2V5Q291bnQ7CisgICAgICAgd2RpR3RrT2ZmbG9hZEdldEluZm9Sc3BhcmFtcy51bEdUS1Jla2V5Q291bnQgPSAKKyAgICAgICAgICAgICAgICAgICAgICAgaGFsR3RrT2ZmbG9hZEdldEluZm9Sc3BQYXJhbXMudWxHVEtSZWtleUNvdW50OworICAgICAgIHdkaUd0a09mZmxvYWRHZXRJbmZvUnNwYXJhbXMudWxJR1RLUmVrZXlDb3VudCA9IAorICAgICAgICAgICAgICAgICAgICAgICBoYWxHdGtPZmZsb2FkR2V0SW5mb1JzcFBhcmFtcy51bElHVEtSZWtleUNvdW50OworCisgICAgICAgd3BhbE11dGV4QWNxdWlyZSgmcFdESUN0eC0+d3B0TXV0ZXgpOworICAgICAgIFdESV9GaW5kQXNzb2NTZXNzaW9uQnlCU1NJZHgocFdESUN0eCwgaGFsR3RrT2ZmbG9hZEdldEluZm9Sc3BQYXJhbXMuYnNzSWR4LAorICAgICAgICAgICAgICAgICAgICAgICAmcEJTU1Nlcyk7CisKKyAgICAgICBpZiAoIE5VTEwgPT0gcEJTU1NlcyApCisgICAgICAgeworICAgICAgICAgICBXUEFMX1RSQUNFKCBlV0xBTl9NT0RVTEVfREFMX0NUUkwsIGVXTEFOX1BBTF9UUkFDRV9M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ZlYXRTdXBwb3J0ZWQpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgIFdQQUxfVFJBQ0UoZVdMQU5fTU9EVUxFX0RBTF9DVFJMLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICJDYXBzIGV4Y2hhbmdlIGZlYXR1cmUgTk9UIHN1cHBvcnRlZC4gUmV0dXJuIE5PVCBTVVBQT1JURUQgZm9yICV1IGZlYXR1cmUiLCBmZWF0X2VudW1fdmFsdWUpOworICAgIH0KKyAgICByZXR1cm4gZmVhdFN1cHBvcnRlZDsKK30KKword3B0X3VpbnQ4IFdESV9zZWxlY3RDYk1vZGUoIHdwdF91aW50OCBjaGFubmVsLCB3cHRfdWludDggQ2hhbm5lbEJXICkKK3sKKyAgLyogNWdIeiBDaGFubmVsICovCisgIGlmKCBjaGFubmVsID49IDM0ICYmIGNoYW5uZWwgPD0gMTY1ICkKKyAgeworICAgIGlmKCBDaGFubmVsQlcgPT0gODAgJiYgV0RJX2dldEZ3V2xhbkZlYXRDYXBzKERPVDExQUMpICkKKyAgICB7CisgICAgICBpZiAoIGNoYW5uZWw9PSAzNiB8fCBjaGFubmVsID09IDUyIHx8IGNoYW5uZWwgPT0gMTAwIHx8CisgICAgICAgICAgICBjaGFubmVsID09IDExNiB8fCBjaGFubmVsID09IDE0OSApCisgICAgICB7CisgICAgICAgICAgICByZXR1cm4gUEhZX1FVQURSVVBMRV9DSEFOTkVMXzIwTUhaX0xPV180ME1IWl9MT1c7CisgICAgICB9CisgICAgICBlbHNlIGlmICggY2hhbm5lbCA9PSA0MCB8fCBjaGFubmVsID09IDU2IHx8IGNoYW5uZWwgPT0gMTA0IHx8CisgICAgICAgICAgICBjaGFubmVsID09IDEyMCB8fCBjaGFubmVsID09IDE1MyApCisgICAgICB7CisgICAgICAgICByZXR1cm4gIFBIWV9RVUFEUlVQTEVfQ0hBTk5FTF8yME1IWl9ISUdIXzQwTUhaX0xPVzsKKyAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCBjaGFubmVsID09IDQ0IHx8IGNoYW5uZWwgPT0gNjAgfHwgY2hhbm5lbCA9PSAxMDggfHwKKyAgICAgICAgICAgIGNoYW5uZWwgPT0gMTI0IHx8IGNoYW5uZWwgPT0gMTU3ICkKKyAgICAgIHsKKyAgICAgICAgIHJldHVybiBQSFlfUVVBRFJVUExFX0NIQU5ORUxfMjBNSFpfTE9XXzQwTUhaX0hJR0g7CisgICAgICB9CisgICAgICBlbHNlIGlmICggY2hhbm5lbCA9PSA0OCB8fCBjaGFubmVsID09IDY0IHx8IGNoYW5uZWwgPT0gMTEyIHx8CisgICAgICAgICAgICBjaGFubmVsID09IDEyOCB8fCBjaGFubmVsID09IDE0NCB8fCBjaGFubmVsID09IDE2MSApCisgICAgICB7CisgICAgICAgICByZXR1cm4gUEhZX1FVQURSVVBMRV9DSEFOTkVMXzIwTUhaX0hJR0hfNDBNSFpfSElHSDsKKyAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCBjaGFubmVsID09IDE2NSApCisgICAgICB7CisgICAgICAgICByZXR1cm4gUEhZX1NJTkdMRV9DSEFOTkVMX0NFTlRFUkVEOworICAgICAgfQorICAgICB9CisKKyAgICBlbHNlCisgICAgeworICAgICAgaWYgKCBjaGFubmVsPT0gNDAgfHwgY2hhbm5lbCA9PSA0OCB8fCBjaGFubmVsID09IDU2IHx8CisgICAgICAgICAgICBjaGFubmVsID09IDY0IHx8IGNoYW5uZWwgPT0gMTA0IHx8IGNoYW5uZWwgPT0gMTEyIHx8CisgICAgICAgICAgICBjaGFubmVsID09IDEyMCB8fCBjaGFubmVsID09IDEyOCB8fCBjaGFubmVsID09IDEzNiB8fAorICAgICAgICAgICAgY2hhbm5lbCA9PSAxNDQgfHwgY2hhbm5lbCA9PSAxNTMgfHwgY2hhbm5lbCA9PSAxNjEgKQorICAgICAgeworICAgICAgICAgcmV0dXJuIFBIWV9ET1VCTEVfQ0hBTk5FTF9ISUdIX1BSSU1BUl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BFdmVudERhdGEpOworICAgd2RpU3RhdHVzID0gV0RJX0hBTF8yX1dESV9TVEFUVVMoaGFsU3RhdHVzKTsKKworICAgV1BBTF9UUkFDRShlV0xBTl9NT0RVTEVfREFMX0NUUkwsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgIkxQSEIgQ2ZnIFJzcCBSZXR1cm4gc3RhdHVzICVkIiwgd2RpU3RhdHVzKTsKKyAgIC8qTm90aWZ5IFVNQUMqLworICAgaWYgKE5VTEwgIT0gd2RpTHBoYkNmZ0NiKQorICAgeworICAgICAgd2RpTHBoYkNmZ0NiKHdkaVN0YXR1cywgcFdESUN0eC0+cFJzcENCVXNlckRhdGEpOworICAgfQorCisgICByZXR1cm4gV0RJX1NUQVRVU19TVUNDRVNTOworfQorCisvKioKKyBAYnJpZWYgV0RJX1Byb2Nlc3NMUEhCQ29uZlJlcSAtCisgICAgTFBIQiBjb25maWd1cmF0aW9uIHJlcXVlc3QgdG8gRlcKKworIEBwYXJhbSAgcFdESUN0eCA6IHdkaSBjb250ZXh0CisgICAgICAgICBwRXZlbnREYXRhIDogaW5kaWNhdGlvbiBkYXRhCisKKyBAc2VlCisgQHJldHVybiBub25lCisqLworV0RJX1N0YXR1cyBXRElfUHJvY2Vzc0xQSEJDb25mUmVxCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispCit7CisgIFdESV9MUEhCUmVxICAgICAgICAgICAgICAgICAgICpwTHBoYlJlcVBhcmFtczsKKyAgV0RJX1N0YXR1cyAgICAgICAgICAgICAgICAgICAgIHdkaVN0YXR1czsKKyAgd3B0X3VpbnQ4KiAgICAgICAgICAgICAgICAgICAgIHBTZW5kQnVmZmVyICAgICAgICA9IE5VTEw7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgICB1c0RhdGFPZmZzZXQgICAgICAgP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THBoYlJlcVBhcmFtcy0+Y21kKTsKKyAgc3dpdGNoICgodEFOSV9VMTYpcExwaGJSZXFQYXJhbXMtPmNtZCkKKyAgeworICAgIGNhc2UgV0RJX0xQSEJfU0VUX0VOX1BBUkFNU19JTkRJRDoKKyAgICAgIGhhbExwaGJSZXFSYXJhbXMtPnNlc3Npb25JZHggPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTHBoYlJlcVBhcmFtcy0+cGFyYW1zLmxwaGJFbmFibGVSZXEuc2Vzc2lvbjsKKyAgICAgIGhhbExwaGJSZXFSYXJhbXMtPm9wdGlvbnMuY29udHJvbC5oZWFydEJlYXRFbmFibGUgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTHBoYlJlcVBhcmFtcy0+cGFyYW1zLmxwaGJFbmFibGVSZXEuZW5hYmxlOworICAgICAgaGFsTHBoYlJlcVJhcmFtcy0+b3B0aW9ucy5jb250cm9sLmhlYXJ0QmVhdFR5cGUgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTHBoYlJlcVBhcmFtcy0+cGFyYW1zLmxwaGJFbmFibGVSZXEuaXRlbTsKKyAgICAgIGJyZWFrOworCisgICAgY2FzZSBXRElfTFBIQl9TRVRfVENQX1BBUkFNU19JTkRJRDoKKyAgICAgIGhhbExwaGJSZXFSYXJhbXMtPnNlc3Npb25JZHggPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTHBoYlJlcVBhcmFtcy0+cGFyYW1zLmxwaGJUY3BQYXJhbVJlcS5zZXNzaW9uOworICAgICAgaGFsTHBoYlJlcVJhcmFtcy0+b3B0aW9ucy50Y3BQYXJhbXMudGltZU91dFNlYyA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBMcGhiUmVxUGFyYW1zLT5wYXJhbXMubHBoYlRjcFBhcmFtUmVxLnRpbWVvdXQ7CisgICAgICB3cGFsTWVtb3J5Q29weSgmaGFsTHBoYlJlcVJhcmFtcy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U2VjID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcExwaGJSZXFQYXJhbXMtPnBhcmFtcy5scGhiVGNwUGFyYW1SZXEudGltZVBlcmlvZFNlYzsKKyAgICAgIGhhbExwaGJSZXFSYXJhbXMtPm9wdGlvbnMudGNwUGFyYW1zLnRjcFNuID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcExwaGJSZXFQYXJhbXMtPnBhcmFtcy5scGhiVGNwUGFyYW1SZXEudGNwU247CisgICAgICBicmVhazsKKworICAgIGNhc2UgV0RJX0xQSEJfU0VUX1RDUF9QS1RfRklMVEVSX0lORElEOgorICAgICAgaGFsTHBoYlJlcVJhcmFtcy0+c2Vzc2lvbklkeCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcExwaGJSZXFQYXJhbXMtPnBhcmFtcy5scGhiVGNwRmlsdGVyUmVxLnNlc3Npb247CisgICAgICBoYWxMcGhiUmVxUmFyYW1zLT5vcHRpb25zLnRjcFVkcEZpbHRlci5vZmZzZXQgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBMcGhiUmVxUGFyYW1zLT5wYXJhbXMubHBoYlRjcEZpbHRlclJlcS5vZmZzZXQ7CisgICAgICBoYWxMcGhiUmVxUmFyYW1zLT5vcHRpb25zLnRjcFVkcEZpbHRlci5maWx0ZXJMZW5ndGggPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBMcGhiUmVxUGFyYW1zLT5wYXJhbXMubHBoYlRjcEZpbHRlclJlcS5sZW5ndGg7CisgICAgICB3cGFsTWVtb3J5Q29weShoYWxMcGhiUmVxUmFyYW1zLT5vcHRpb25zLnRjcFVkcEZpbHRlci5maWx0ZXIsCisgICAgICAgICAgICAgICAgICAgICBwTHBoYlJlcVBhcmFtcy0+cGFyYW1zLmxwaGJUY3BGaWx0ZXJSZXEuZmlsdGVyLAorICAgICAgICAgICAgICAgICAgICAgV0RJX0xQSEJfRklMVEVSX0xFTik7CisgICAgICBicmVhazsKKworICAgIGNhc2UgV0RJX0xQSEJfU0VUX1VEUF9QQVJBTVNfSU5ESUQ6CisgICAgICBoYWxMcGhiUmVxUmFyYW1zLT5zZXNzaW9uSWR4ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcExwaGJSZXFQYXJhbXMtPnBhcmFtcy5scGhiVWRwUGFyYW1SZXEuc2Vzc2lvbjsKKyAgICAgIGhhbExwaGJSZXFSYXJhbXMtPm9wdGlvbnMudWRwUGFyYW1zLnRpbWVPdXRTZWMgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTHBoYlJlcVBhcmFtcy0+cGFyYW1zLmxwaGJVZHBQYXJhbVJlcS50aW1lb3V0OworICAgICAgaGFsTHBoYlJlcVJhcmFtcy0+b3B0aW9ucy51ZHBQYXJhbXMudGltZVBlcmlvZFNlYyA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBMcGhiUmVxUGFyYW1zLT5wYXJhbXMubHBoYlVkcFBhcmFtUmVxLmludGVydmFsOworICAgICAgd3BhbE1lbW9yeUNvcHkoJmhhbExwaGJSZXFSYXJhbXMtPm9wdGlvbnMudWRwUGFyYW1zLmhvc3RJcHY0QWRkciwKKyAgICAgICAgICAgICAgICAgICAgICZwTHBoYlJlcVBhcmFtcy0+cGFyYW1zLmxwaGJVZHBQYXJhbVJlcS5kZXZfaXAsCisgICAgICAgICAgICAgICAgICAgICBzaXplb2Yodl9VMzJfdCkpOworICAgICAgd3BhbE1lbW9yeUNvcHkoJmhhbExwaGJSZXFSYXJhbXMtPm9wdGlvbnMudWRwUGFyYW1zLmRlc3RJcHY0QWRkciwKKyAgICAgICAgICAgICAgICAgICAgICZwTHBoYlJlcVBhcmFtcy0+cGFyYW1zLmxwaGJVZHBQYXJhbVJlcS5zcnZfaXAsCisgICAgICAgICAgICAgICAgICAgICBzaXplb2Yodl9VMzJfdCkpOworCisgICAgICB3cGFsTWVtb3J5Q29weShoYWxMcGhiUmVxUmFyYW1zLT5vcHRpb25zLnVkcFBhcmFtcy5nYXRld2F5TWFjQWRkciwKKyAgICAgICAgICAgICAgICAgICAgIHBMcGhiUmVxUGFyYW1zLT5wYXJhbXMubHBoYlVkcFBhcmFtUmVxLmdhdGV3YXlfbWFjLAorICAgICAgICAgICAgICAgICAgICAgV0RJX01BQ19BRERSX0xFTik7CisKKyAgICAgIGhhbExwaGJSZXFSYXJhbXMtPm9wdGlvbnMudWRwUGFyYW1zLmhvc3RQb3J0ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcExwaGJSZXFQYXJhbXMtPnBhcmFtcy5scGhiVWRwUGFyYW1SZXEuc3JjX3BvcnQ7CisgICAgICBoYWxMcGhiUmVxUmFyYW1zLT5vcHRpb25zLnVkcFBhcmFtcy5kZXN0UG9ydCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBMcGhiUmVxUGFyYW1zLT5wYXJhbXMubHBoYlVkcFBhcmFtUmVxLmRzdF9wb3J0OworICAgICAgYnJlYWs7CisKKyAgICBjYXNlIFdESV9MUEhCX1NFVF9VRFBfUEtUX0ZJTFRFUl9JTkRJRDoKKyAgICAgIGhhbExwaGJSZXFSYXJhbXMtPnNlc3Npb25JZHggPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTHBoYlJlcVBhcmFtcy0+cGFyYW1zLmxwaGJVZHBGaWx0ZXJSZXEuc2Vzc2lvbjsKKyAgICAgIGhhbExwaGJSZXFSYXJhbXMtPm9wdGlvbnMudGNwVWRwRmlsdGVyLm9mZnNldCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBMcGhiUmVxUGFyYW1zLT5wYXJhbXMubHBoYlVkcEZpbHRlclJlcS5vZmZzZXQ7CisgICAgICBoYWxMcGhiUmVxUmFyYW1zLT5vcHRpb25zLnRjcFVkcEZpbHRlci5maWx0ZXJMZW5ndGggPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBw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KCBXRElfU1RBVFVTX1NVQ0NFU1MgIT0gV0RJX0dldE1lc3NhZ2VCdWZmZXIoIHBXRElDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgIFdESV9SQVRFX1VQREFURV9JTkQsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih0SGFsUmF0ZVVwZGF0ZVBhcmFtcyksCisgICAgICAgICAgICAgICAgICAgICAgICAgICZwU2VuZEJ1ZmZlciwgJnVzRGF0YU9mZnNldCwgJnVzU2VuZFNpemUpKXx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICggdXNTZW5kU2l6ZSA8ICh1c0RhdGFPZmZzZXQgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRIYWxSYXRlVXBkYXRlUGFyYW1zKSApKSkKKyAgICB7CisgICAgICAgV1BBTF9UUkFDRSggZVdMQU5fTU9EVUxFX0RBTF9DVFJMLCAgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgICAgICAgICAgICAgICJVbmFibGUgdG8gZ2V0IHNlbmQgYnVmZmVyIGluIFJhdGUgVXBkYXRlIEluZGljYXRpb24gJXAgIiwKKyAgICAgICAgICAgICAgICAgIHBFdmVudERhdGEpOworICAgICAgIFdESV9BU1NFUlQoMCk7CisgICAgICAgcmV0dXJuIFdESV9TVEFUVVNfRV9GQUlMVVJFOworICAgIH0KKworICAgIHBSYXRlVXBkYXRlSW5kID0gKHRIYWxSYXRlVXBkYXRlSW5kICopcFNlbmRCdWZmZXI7CisKKyAgICAvKiBDb3B5IHRoZSBic3NpZCAqLworICAgIHdwYWxNZW1vcnlDb3B5KHBSYXRlVXBkYXRlSW5kLT5oYWxSYXRlVXBkYXRlUGFyYW1zLmJzc2lkLAorICAgICAgICAgICAgICAgICAgICAgcHdkaVJhdGVVcGRhdGVJbmQtPmJzc2lkLCBXRElfTUFDX0FERFJfTEVOKTsKKworICAgIC8qIENvcHkgdGhlIHR4IGZsYWdzIC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KyAgICB7CisgICAgICAgIFdQQUxfVFJBQ0UoIGVXTEFOX01PRFVMRV9EQUxfQ1RSTCwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgcGFyYW1ldGVycyIsIF9fZnVuY19fKTsKKyAgICAgICAgV0RJX0FTU0VSVCgwKTsKKyAgICAgICAgcmV0dXJuIFdESV9TVEFUVVNfRV9GQUlMVVJFOworICAgIH0KKworICAgIC8qIGV4dHJhY3QgcmVzcG9uc2UgYW5kIHNlbmQgaXQgdG8gVU1BQyAqLworICAgIHBMaW5rTGF5ZXJTdGF0c0luZCA9ICh2b2lkICopcEV2ZW50RGF0YS0+cEV2ZW50RGF0YTsKKworICAgIC8qIEZpbGwgaW4gdGhlIGluZGljYXRpb24gcGFyYW1ldGVycyAqLworICAgIHdkaUluZC53ZGlJbmRpY2F0aW9uVHlwZSA9IFdESV9MTF9TVEFUU19SRVNVTFRTX0lORDsKKworICAgIHdkaUluZC53ZGlJbmRpY2F0aW9uRGF0YS53ZGlMaW5rTGF5ZXJTdGF0c1Jlc3VsdHMucExpbmtMYXllclN0YXRzUmVzdWx0cworICAgICAgICAgICA9IHBMaW5rTGF5ZXJTdGF0c0luZDsKKworICAgIGhhbExMU3RhdHNSZXN1bHRzID0gKFdESV9MTHN0YXRzUmVzdWx0c1R5cGUgKikgcExpbmtMYXllclN0YXRzSW5kOworCisKKyAgIC8qIE5lZWQgdG8gZmlsbCBpbiB0aGUgTUFDIGFkZHJlc3MgKi8KKyAgIGlmICggV0RJX1NUQVRVU19TVUNDRVNTICE9CisgICAgICAgICBXRElfU1RBVGFibGVHZXRTdGFNYWNBZGRyKHBXRElDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhbExMU3RhdHNSZXN1bHRzLT5pZmFjZV9pZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm1hY0FkZHIpKQorICAgeworICAgICBWT1Nf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FUlQoMCk7CisgICAgICAgIHJldHVybiBXRElfU1RBVFVTX0VfRkFJTFVSRTsKKyAgICB9CisKKyAgICByZXR1cm4gV0RJX1NUQVRVU19TVUNDRVNTOworfSAvKiBFbmQgb2YgV0RJX1Byb2Nlc3NMaW5rTGF5ZXJTdGF0c1Jlc3VsdHNJbmQgKi8KKyNlbmRpZiAvKiBXTEFOX0ZFQVRVUkVfTElOS19MQVlFUl9TVEFUUyAqLworCisvKioKKyBAYnJpZWYgV0RJX1Byb2Nlc3NTZXRCYXRjaFNjYW5SZXEgLQorICAgIFNldCBiYXRjaCBzY2FuIHJlcXVlc3QgdG8gRlcKKworIEBwYXJhbSAgcFdESUN0eCA6IHdkaSBjb250ZXh0CisgICAgICAgICBwRXZlbnREYXRhIDogaW5kaWNhdGlvbiBkYXRhCisKKyBAc2VlCisgQHJldHVybiBub25lCisqLworV0RJX1N0YXR1cyBXRElfUHJvY2Vzc1NldEJhdGNoU2NhblJlcQorKAorICAgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgICBXRElfRXZlbnRJbmZvVHlwZSogICAgIHBFdmVudERhdGEKKykKK3sKKyAgICBXRElfU2V0QmF0Y2hTY2FuUmVxVHlwZSAqcFdkaVJlcTsKKyAgICBXRElfU3RhdHVzICAgICAgICAgICAgICAgd2RpU3RhdHVzOworICAgIHdwdF91aW50OCogICAgICAgICAgICAgICBwU2VuZEJ1ZmZlciAgICAgICAgPSBOVUxMOworICAgIHdwdF91aW50MTYgICAgICAgICAgICAgICB1c0RhdGFPZmZzZXQgICAgICAgPSAwOworICAgIHdwdF91aW50MTYgICAgICAgICAgICAgICB1c1NlbmRTaXplICAgICAgICAgPSAwOworICAgIHRIYWxCYXRjaFNjYW5TZXRQYXJhbXMgICpwSGFsUmVxOworICAgIC8qLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAt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ZUNiKXBXRElDdHgtPnBmbmNSc3BDQjsKKworICAvKk5vdGlmeSBVTUFDKi8KKyAgd2RpR2V0QmNuTWlzc1JhdGVDYihwSGFsQmNuTWlzc1JhdGVSc3AtPnN0YXR1cywKKyAgICAgICAgICAgICAgICAgICAgICBwSGFsQmNuTWlzc1JhdGVSc3AtPmJjbk1pc3NDbnQsIHBXRElDdHgtPnBSc3BDQlVzZXJEYXRhKTsKKyAgcmV0dXJuIFdESV9TVEFUVVNfU1VDQ0VTUzsKK30KKworLyoKKyAqIEZVTkNUSU9OOiBXRElfUHJvY2Vzc0dldEJjbk1pc3NSYXRlUmVxCisgKiBSZXF1ZXN0IHRvIFdESSB0byBnZXQgbWlzc2VkIGJlYWNvbiByYXRlLgorICovCitXRElfU3RhdHVzCitXRElfUHJvY2Vzc0dldEJjbk1pc3NSYXRlUmVxCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispCit7CisgIHdwdF91aW50OCogICAgICAgICAgICAgICAgICAgcFNlbmRCdWZmZXIgICAgICAgICA9IE5VTEw7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgdXNEYXRhT2Zmc2V0ICAgICAgICA9IDA7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgdXNTZW5kU2l6ZSAgICAgICAgICA9IDA7CisgIHdwdF91aW50OCAgICAgICAgICAgICAgICAgICAgdWNDdXJyZW50QlNTU2VzSWR4ICA9IDA7CisgIFdESV9CU1NTZXNzaW9uVHlwZSogICAgICAgICAgcEJTU1NlcyAgICAgICAgICAgICA9IE5VTEw7CisgIFdESV9HZXRCY25NaXNzUmF0ZUNiICAgICAgICAqd2RpR2V0QmNuTWlzc1JhdGVDYjsKKyAgdEhhbEJjbk1pc3NSYXRlUmVxUGFyYW1zICAgIGhhbEJjbk1pc3NSYXRlUmVxOworCisvKi0gLSAtIC0gLSAtIC0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VXTEFOX1BBTF9UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgcGFyYW1ldGVycyIsIF9fZnVuY19fKTsKKyAgICAgV0RJX0FTU0VSVCgwKTsKKyAgICAgcmV0dXJuIFdESV9TVEFUVVNfRV9GQUlMVVJFOworICB9CisgIHBIYWxGd3N0YXRzUnNwID0gKHRIYWxmd1N0YXRzUnNwUGFyYW1zICopcEV2ZW50RGF0YS0+cEV2ZW50RGF0YTsKKyAgd2RpR2V0RndzdGF0c0NiID0gKFdESV9GV1N0YXRzR2V0UnNwQ2IpIHBXRElDdHgtPnBmbmNSc3BDQjsKKworICBpZihwSGFsRndzdGF0c1JzcC0+bGVuZ3RoKQorICB7CisgICAgIHN3aXRjaCggcEhhbEZ3c3RhdHNSc3AtPnR5cGUgKQorICAgICB7CisgICAgICAgIGNhc2UgRldfVUJTUF9TVEFUUzoKKyAgICAgICAgeworICAgICAgICAgICAgIHVic3BGd1N0YXRzICp1YnNwU3RhdHNmcm9tRnc7CisKKyAgICAgICAgICAgICBmd1N0YXRzLnR5cGUgPSBwSGFsRndzdGF0c1JzcC0+dHlwZTsKKyAgICAgICAgICAgICB1YnNwU3RhdHNmcm9tRncgPSAodWJzcEZ3U3RhdHMgKikgcEhhbEZ3c3RhdHNSc3AtPmRhdGE7CisgICAgICAgICAgICAgZndTdGF0cy53ZGlGd1N0YXRzRGF0YS51YnNwU3RhdHMudWJzcF9lbnRlcl9jbnQgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWJzcFN0YXRzZnJvbUZ3LT51YnNwX2VudGVyX2NudDsKKyAgICAgICAgICAgICBmd1N0YXRzLndkaUZ3U3RhdHNEYXRhLnVic3BTdGF0cy51YnNwX2p1bXBfZGRyX2NudCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1YnNwU3RhdHNmcm9tRnctPnVic3BfanVtcF9kZHJfY250OworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICB7CisgICAgICAgICAgICAgV1BBTF9UUkFDRSggZVdMQU5fTU9EVUxFX0RBTF9DVFJMLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAiJXM6IE5vIGhhbmRsaW5nIGZvciBzdGF0cyB0eXBlICVkIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICBwSGFsRndzdGF0c1JzcC0+dHlwZSk7CisgICAgICAgICAgICAgd2RpR2V0RndzdGF0c0NiKFdESV9TVEFUVVNfRV9GQUlMVVJFLAorICAgICAgICAgICAgICAgICAgICBOVUxMLCBwV0RJQ3R4LT5wUnNwQ0JVc2VyRGF0YSk7CisgICAgICAgICAgICAgcmV0dXJuIFdESV9TVEFUVVNfRV9GQUlMVVJFOworICAgICAgICB9CisgICAgIH0KKyAgICAgd2RpR2V0RndzdGF0c0NiKFdESV9TVEFUVVNfU1VDQ0VTUywgJmZ3U3RhdHMgLCBwV0RJQ3R4LT5wUnNwQ0JVc2VyRGF0YSk7CisgIH0KKyAgZWxzZQorICB7CisgICAgIFdQQUxfVFJBQ0UoIGVXTEFOX01PRFVMRV9EQUxfQ1RSTCwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgIiVzOiBMZW5ndGggPSAwIGZvciB0eXBlICVkIHJldHVybiBmYWlsdXJlICIsIF9fZnVuY19fLAorICAgICAgICAgICAgICBwSGFsRndzdGF0c1JzcC0+dHlwZSk7CisgICAgIHdkaUdldEZ3c3RhdHNDYihXRElfU1RBVFVTX0VfRkFJTFVSRSwKKyAgICAgICAgICAgICAgICAgICAgICBOVUxMLCBwV0RJQ3R4LT5wUnNwQ0JVc2VyRGF0YSk7CisgICAgIHJldHVybiBXRElfU1RBVFVTX0VfRkFJTFVSRTsKKyAgfQorICByZXR1cm4gV0RJX1NUQVRVU19TVUNDRVNTOworfQorC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gICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dESSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICJXREkgQVBJIGNhbGwgYmVmb3JlIG1vZHVsZSBpcyBpbml0aWFsaXplZCAtIEZhaWwgcmVxdWVzdCIpOworCisgICAgIHJldHVybiBXRElfU1RBVFVTX0VfTk9UX0FMTE9XRUQ7CisgIH0KKworICB3ZGlFdmVudERhdGEud2RpUmVxdWVzdCAgICAgID0gV0RJX0xMX1NUQVRTX1NFVF9SRVE7CisgIHdkaUV2ZW50RGF0YS5wRXZlbnREYXRhICAgICAgPSBwd2RpTExTdGF0c1NldFJlcVBhcmFtczsKKyAgd2RpRXZlbnREYXRhLnVFdmVudERhdGFTaXplICA9IHNpemVvZigqcHdkaUxMU3RhdHNTZXRSZXFQYXJhbXMpOworICB3ZGlFdmVudERhdGEucENCZm5jICAgICAgICAgID0gd2RpTExTdGF0c1NldFJzcENiOworICB3ZGlFdmVudERhdGEucFVzZXJEYXRhICAgICAgID0gcFVzZXJEYXRhOworCisgIHJldHVybiBXRElfUG9zdE1haW5FdmVudCgmZ1dESUNiLCBXRElfUkVRVUVTVF9FVkVOVCwgJndkaUV2ZW50RGF0YSk7Cit9CisKKy8qKgorIEBicmllZiBXRElfUHJvY2Vzc0xMU3RhdHNTZXRSZXEgLQorICAgIFNldCBMaW5rIExheWVyIFN0YXRzIHJlcXVlc3QgdG8gRlcKKworIEBwYXJhbSAgcFdESUN0eCA6IHdkaSBjb250ZXh0CisgICAgICAgICBwRXZlbnREYXRhIDogaW5kaWNhdGlvbiBkYXRhCisKKyBAc2VlCisgQHJldHVybiBub25lCisqLworV0RJX1N0YXR1cworV0RJX1Byb2Nlc3NMTFN0YXRzU2V0UmVxCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispCit7CisgIFdESV9MT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nVmZmVyCisgICAgISBUTyBETyA6IHByb3BlciBjb252ZXJzaW9uIGludG8gdGhlIEhBTCBNZXNzYWdlIFJlcXVlc3QgRm9ybWF0CisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyAgaWYgKCggV0RJX1NUQVRVU19TVUNDRVNTICE9IFdESV9HZXRNZXNzYWdlQnVmZmVyKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBXRElDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0RJX0xMX1NUQVRTX1NFVF9SRVEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRIYWxNYWNMbFNldFN0YXRzUmVxUGFyYW1zKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFNlbmRCdWZmZXIsICZ1c0RhdGFPZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnVzU2VuZFNpemUpKXx8CisgICAgICAoIHVzU2VuZFNpemUgPCAodXNEYXRhT2Zmc2V0ICsgc2l6ZW9mKGhhbExMU3RhdHNTZXRQYXJhbXMpICkpKQorICB7CisgICAgIFdQQUxfVFJBQ0UoIGVXTEFOX01PRFVMRV9EQUxfQ1RSTCwgIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAiVW5hYmxlIHRvIGdldCBzZW5kIGJ1ZmZlciBpbiAlcyAlcCAlcCAlcCIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgIHBFdmVudERhdGEsIHB3ZGlMTFN0YXRzU2V0UmVxUGFyYW1zLCB3ZGlMTFN0YXRzU2V0Q2IpOworICAgICBXRElfQVNTRVJUKDApOworICAgICByZXR1cm4gV0RJX1NUQVRVU19FX0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YXRhLnBDQmZuYyAgICAgICAgICA9IHdkaUxMU3RhdHNHZXRSc3BDYjsKKyAgd2RpRXZlbnREYXRhLnBVc2VyRGF0YSAgICAgICA9IHBVc2VyRGF0YTsKKworICByZXR1cm4gV0RJX1Bvc3RNYWluRXZlbnQoJmdXRElDYiwgV0RJX1JFUVVFU1RfRVZFTlQsICZ3ZGlFdmVudERhdGEpOworfQorCisvKioKKyBAYnJpZWYgV0RJX1Byb2Nlc3NMTFN0YXRzR2V0UmVxIC0KKyAgICBHZXQgTGluayBMYXllciBTdGF0cyByZXF1ZXN0IHRvIEZXCisKKyBAcGFyYW0gIHBXRElDdHggOiB3ZGkgY29udGV4dAorICAgICAgICAgcEV2ZW50RGF0YSA6IGluZGljYXRpb24gZGF0YQorCisgQHNlZQorIEByZXR1cm4gbm9uZQorKi8KK1dESV9TdGF0dXMKK1dESV9Qcm9jZXNzTExTdGF0c0dldFJlcQorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKQoreworICBXRElfTExTdGF0c0dldFJlcVR5cGUqIHB3ZGlMTFN0YXRzR2V0UmVxUGFyYW1zOworICBXRElfTExTdGF0c0dldFJzcENiIHdkaUxMU3RhdHNHZXRDYjsKKyAgd3B0X3VpbnQ4KiAgICAgICAgICAgICAgIHBTZW5kQnVmZmVyICAgICAgICAgPSBOVUxMOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgdXNTZW5kU2l6ZSAgICAgICAgICA9IDA7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICB1c0RhdGFPZmZzZXQgICAgICAgID0gMDsKKyAgdEhhbE1hY0xsR2V0U3RhdHNSZXFQYXJhbXMgaGFsTExTdGF0c0dldFBhcmFtczsKKworICBpZiAoKCBOVUxMID09IHBFdmVudERhdGEgKSB8fCAoIE5VTEwgPT0gcEV2ZW50RGF0YS0+cEV2ZW50RGF0YSApIHx8CisgICA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gICAgICAgIHNpemVvZih0SGFsTWFjTGxHZXRTdGF0c1JlcVBhcmFtcyksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwU2VuZEJ1ZmZlciwgJnVzRGF0YU9mZnNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ1c1NlbmRTaXplKSl8fAorICAgICAgKCB1c1NlbmRTaXplIDwgKHVzRGF0YU9mZnNldCArIHNpemVvZihoYWxMTFN0YXRzR2V0UGFyYW1zKSApKSkKKyAgeworICAgICBXUEFMX1RSQUNFKCBlV0xBTl9NT0RVTEVfREFMX0NUUkwsICBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgIlVuYWJsZSB0byBnZXQgc2VuZCBidWZmZXIgaW4gJXMgJXAgJXAgJXAiLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICBwRXZlbnREYXRhLCBwd2RpTExTdGF0c0dldFJlcVBhcmFtcywgd2RpTExTdGF0c0dldENiKTsKKyAgICAgV0RJX0FTU0VSVCgwKTsKKyAgICAgcmV0dXJuIFdESV9TVEFUVVNfRV9GQUlMVVJFOworICB9CisgIC8qIE5lZWQgdG8gZmlsbCBpbiB0aGUgc2VsZiBTVEEgSW5kZXggKi8KKyAgaWYgKCBXRElfU1RBVFVTX1NVQ0NFU1MgIT0KKyAgV0RJX1NUQVRhYmxlRmluZFN0YWlkQnlBZGRyKHBXRElDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwd2RpTExTdGF0c0dldFJlcVBhcmFtcy0+bWFjQWRkciwKKyAgICAgICAgICAgICAgICAmaGFsTExTdGF0c0dldFBhcmFtcy5zdGFfaWQpKQorICB7CisgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dESSwgVk9TX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgIE1BQ19BRERSRVNTX1NUUgorICAg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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisgIGlmICgoIFdESV9TVEFUVVNfU1VDQ0VTUyAhPSBXRElfR2V0TWVzc2FnZUJ1ZmZlcigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBXRElDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXRElfTExfU1RBVFNfQ0xFQVJfUkVRLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRIYWxNYWNMbENsZWFyU3RhdHNSZXFQYXJhbXMpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBTZW5kQnVmZmVyLCAmdXNEYXRhT2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnVzU2VuZFNpemUpKXx8CisgICAgICAoIHVzU2VuZFNpemUgPCAodXNEYXRhT2Zmc2V0ICsgc2l6ZW9mKGhhbExMU3RhdHNDbGVhclBhcmFtcykgKSkpCisgIHsKKyAgICAgV1BBTF9UUkFDRSggZVdMQU5fTU9EVUxFX0RBTF9DVFJMLCAgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICJVbmFibGUgdG8gZ2V0IHNlbmQgYnVmZmVyIGluICVzICVwICVwICVwIiwgX19mdW5jX18sCisgICAgICAgICAgICAgICAgcEV2ZW50RGF0YSwgcHdkaUxMU3RhdHNDbGVhclJlcVBhcmFtcywgd2RpTExTdGF0c0NsZWFyQ2IpOworICAgICBXRElfQVNTRVJUKDApOworICAgICByZXR1cm4gV0RJX1NUQVRVU19FX0ZBSUxVUkU7CisgIH0KKyAgLyogTmVlZCB0byBmaWxsIGluIHRoZSBzZWxmIFNUQSBJbmRleCAqLworICBpZiAoIFdESV9TV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iKXBFdmVudERhdGEtPnBDQmZuYzsKKworICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgR2V0IG1lc3NhZ2UgYnVmZmVyCisgICAgISBUTyBETyA6IHByb3BlciBjb252ZXJzaW9uIGludG8gdGhlIEhBTCBNZXNzYWdlIFJlcXVlc3QgRm9ybWF0CisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyAgaWYgKCggV0RJX1NUQVRVU19TVUNDRVNTICE9IFdESV9HZXRNZXNzYWdlQnVmZmVyKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBXRElDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0RJX01PTl9TVEFSVF9SRVEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRIYWxFbmFibGVNb25pdG9yTW9kZVJlcVBhcmFtcyksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBTZW5kQnVmZmVyLCAmdXNEYXRhT2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ1c1NlbmRTaXplKSl8fAorICAgICAgKCB1c1NlbmRTaXplIDwgKHVzRGF0YU9mZnNldCArIHNpemVvZihoYWxFbmFibGVNb25pdG9yTW9kZVBhcmFtcykgKSkpCisgIHsKKyAgICAgV1BBTF9UUkFDRSggZVdMQU5fTU9EVUxFX0RBTF9DVFJMLCAgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICJVbmFibGUgdG8gZ2V0IHNlbmQgYnVmZmVyIGluICVzICVwICVwICVwIiwgX19mdW5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hdGE7CisKKyAgcmV0dXJuIFdESV9Qb3N0TWFpbkV2ZW50KCZnV0RJQ2IsIFdESV9SRVFVRVNUX0VWRU5ULCAmd2RpRXZlbnREYXRhKTsKK30KKworV0RJX1N0YXR1cworV0RJX1Byb2Nlc3NNb25TdG9wUmVxCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispCit7CisgIFdESV9Nb25Nb2RlUnNwQ2IgICAgICAgICB3ZGlNb25TdG9wQ2I7CisgIHdwdF91aW50OCogICAgICAgICAgICAgICBwU2VuZEJ1ZmZlciAgICAgICAgID0gTlVMTDsKKyAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgIHVzU2VuZFNpemUgICAgICAgICAgPSAwOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgdXNEYXRhT2Zmc2V0ICAgICAgICA9IDA7CisgIHdwdF91aW50OCAgICAgICAgICAgICAgICByZXNldENvbmZpZ3VyYXRpb247CisKKyAgV1BBTF9UUkFDRShlV0xBTl9NT0RVTEVfREFMX0NUUkwsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgIiVzIiwgX19mdW5jX18pOworCisgIGlmICgoIE5VTEwgPT0gcEV2ZW50RGF0YSApIHx8ICggTlVMTCA9PSBwRXZlbnREYXRhLT5wQ0JmbmMgKSkKKyAgeworICAgICBXUEFMX1RSQUNFKCBlV0xBTl9NT0RVTEVfREFMX0NUUkwsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgcGFyYW1ldGVycyIsIF9fZnVuY19fKTsKKyAgICAgV0RJX0FTU0VSVCgwKTsKKyAgICAgcmV0dXJuIFdESV9TVEFUVVNfRV9GQUlMVVJFOworICB9CisKKyAgd2RpTW9uU3RvcENiICAgPSAoV0RJX01vbk1vZGVSc3BDYilwRXZlbnREYXRhLT5wQ0JmbmM7CisKKyAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgIEdldCBtZXNzYWdlIGJ1ZmZlcgorICAgICEgVE8gRE8gOiBwcm9wZXIgY29udmVyc2lvbiBpbnRvIHRoZSBIQUwgTWVzc2FnZSBSZXF1ZXN0IEZvcm1hdAorICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisgIGlmICgoIFdESV9TVEFUVVNfU1VDQ0VTUyAhPSBXRElfR2V0TWVzc2FnZUJ1ZmZlcigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwV0RJQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdESV9NT05fU1RPUF9SRVEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHdwdF91aW50OCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBTZW5kQnVmZmVyLCAmdXNEYXRhT2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ1c1NlbmRTaXplKSl8fAorICAgICAgKCB1c1NlbmRTaXplIDwgKHVzRGF0YU9mZnNldCArIHNpemVvZih3cHRfdWludDgpICkpKQorICB7CisgICAgIFdQQUxfVFJBQ0UoIGVXTEFOX01PRFVMRV9EQUxfQ1RSTCwgIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAiVW5hYmxlIHRvIGdldCBzZW5kIGJ1ZmZlciBpbiAlcyAlcCAlcCIsIF9fZnVuY19fLAorICAgICAgICAgICAgICAgIHBFdmVudERhdGEsIHdkaU1vblN0b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FdESV9Mb3dMZXZlbEluZFR5cGUgd2RpSW5kOworICAgIC8qLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gKi8KKworICAgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREksIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICIlczogIiwgX19mdW5jX18pOworCisgICAgLyogc2FuaXR5IGNoZWNrICovCisgICAgaWYgKCggTlVMTCA9PSBwV0RJQ3R4ICkgfHwgKCBOVUxMID09IHBFdmVudERhdGEgKSB8fAorICAgICAgKCBOVUxMID09IHBFdmVudERhdGEtPnBFdmVudERhdGEpKQorICAgIHsKKyAgICAgICAgV1BBTF9UUkFDRSggZVdMQU5fTU9EVUxFX0RBTF9DVFJMLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogSW52YWxpZCBwYXJhbWV0ZXJzIiwgX19mdW5jX18pOworICAgICAgICBXRElfQVNTRVJUKDApOworICAgICAgICByZXR1cm4gV0RJX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgfQorCisgICAgLyogRmlsbCBpbiB0aGUgaW5kaWNhdGlvbiBwYXJhbWV0ZXJzICovCisgICAgd2RpSW5kLndkaUluZGljYXRpb25UeXBlID0gV0RJX0VYVFNDQU5fUFJPR1JFU1NfSU5EOworCisgICAgLyogZXh0cmFjdCByZXNwb25zZSBhbmQgc2VuZCBpdCB0byBVTUFDICovCisgICAgd2RpSW5kLndkaUluZGljYXRpb25EYXRhLnBFWFRTY2FuSW5kRGF0YSA9ICh2b2lkICopcEV2ZW50RGF0YS0+cEV2ZW50RGF0YTsKKworICAgIC8qIE5vdGlmeSBVTUFDICovCisgICAgaWYgKHBXRElDdHgtPndkaUxvd0xldmVsSW5kQ0IpCisgICAgeworICAgICAgICBwV0RJQ3R4LT53ZGl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ICAgICIlczogIiwgX19mdW5jX18pOworCisgICAgLyogc2FuaXR5IGNoZWNrICovCisgICAgaWYgKCggTlVMTCA9PSBwV0RJQ3R4ICkgfHwgKCBOVUxMID09IHBFdmVudERhdGEgKSB8fAorICAgICAgKCBOVUxMID09IHBFdmVudERhdGEtPnBFdmVudERhdGEpKQorICAgIHsKKyAgICAgICAgV1BBTF9UUkFDRSggZVdMQU5fTU9EVUxFX0RBTF9DVFJMLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogSW52YWxpZCBwYXJhbWV0ZXJzIiwgX19mdW5jX18pOworICAgICAgICBXRElfQVNTRVJUKDApOworICAgICAgICByZXR1cm4gV0RJX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgfQorCisgICAgLyogRmlsbCBpbiB0aGUgaW5kaWNhdGlvbiBwYXJhbWV0ZXJzICovCisgICAgd2RpSW5kLndkaUluZGljYXRpb25UeXBlID0gV0RJX0VYVFNDQU5fU0NBTl9SRVNVTFRfSU5EOworCisgICAgLyogZXh0cmFjdCByZXNwb25zZSBhbmQgc2VuZCBpdCB0byBVTUFDICovCisgICAgd2RpSW5kLndkaUluZGljYXRpb25EYXRhLnBFWFRTY2FuSW5kRGF0YSA9ICh2b2lkICopcEV2ZW50RGF0YS0+cEV2ZW50RGF0YTsKKworICAgIC8qIE5vdGlmeSBVTUFDICovCisgICAgaWYgKHBXRElDdHgtPndkaUxvd0xldmVsSW5kQ0IpCisgICAgeworICAgICAgICBwV0RJQ3R4LT53ZGlMb3dMZXZlbEluZENCKCAmd2RpSW5kLCBwV0RJQ3R4LT5wSW5kVXNlckRhdGEgKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dESSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICIlczogV0RJTG93TGV2ZWxJbmRDYiBpcyBudWxsI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SBwRXZlbnREYXRhLT5wRXZlbnREYXRhKSkKKyAgICB7CisgICAgICAgIFdQQUxfVFJBQ0UoIGVXTEFOX01PRFVMRV9EQUxfQ1RSTCwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgcGFyYW1ldGVycyIsIF9fZnVuY19fKTsKKyAgICAgICAgV0RJX0FTU0VSVCgwKTsKKyAgICAgICAgcmV0dXJuIFdESV9TVEFUVVNfRV9GQUlMVVJFOworICAgIH0KKworICAgIC8qIEZpbGwgaW4gdGhlIGluZGljYXRpb24gcGFyYW1ldGVycyAqLworICAgIHdkaUluZC53ZGlJbmRpY2F0aW9uVHlwZSA9IFdESV9FWFRTQ0FOX1NJR05fUlNTSV9SRVNVTFRfSU5EOworCisgICAgLyogZXh0cmFjdCByZXNwb25zZSBhbmQgc2VuZCBpdCB0byBVTUFDICovCisgICAgd2RpSW5kLndkaUluZGljYXRpb25EYXRhLnBFWFRTY2FuSW5kRGF0YSA9ICh2b2lkICopcEV2ZW50RGF0YS0+cEV2ZW50RGF0YTsKKworICAgIC8qIE5vdGlmeSBVTUFDICovCisgICAgaWYgKHBXRElDdHgtPndkaUxvd0xldmVsSW5kQ0IpCisgICAgeworICAgICAgICBwV0RJQ3R4LT53ZGlMb3dMZXZlbEluZENCKCAmd2RpSW5kLCBwV0RJQ3R4LT5wSW5kVXNlckRhdGEgKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dESSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICIlczogV0RJTG93TGV2ZWxJbmRDYiBpcyBudWxsIiwgX19mdW5jX18pOworICAgICAgICBXRElfQVNTRVJUKDApOworICAgICAgICByZXR1cm4gV0RJX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgfQorICAgIHJldHVybiBXRElfU1RBVFVTX1NVQ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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0RJX0VYVFNDQU5fR0VUX0NBQ0hFRF9SRVNVTFRTX1JFUSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodEhhbEV4dFNjYW5HZXRTY2FuUmVxKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFNlbmRCdWZmZXIsICZ1c0RhdGFPZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnVzU2VuZFNpemUpKXx8CisgICAgICAoIHVzU2VuZFNpemUgPCAodXNEYXRhT2Zmc2V0ICsgc2l6ZW9mKGhhbEVYVFNjYW5HZXRTY2FuUmVxUGFyYW1zKSApKSkKKyAgeworICAgICBXUEFMX1RSQUNFKCBlV0xBTl9NT0RVTEVfREFMX0NUUkwsICBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgIlVuYWJsZSB0byBnZXQgc2VuZCBidWZmZXIgaW4gJXMgJXAgJXAgJXAiLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICBwRXZlbnREYXRhLCBwd2RpRVhUU2NhbkdldENhY2hlZFJlc3VsdHNSZXFQYXJhbXMsCisgICAgICAgICAgICAgICAgd2RpRVhUU2NhbkdldENhY2hlZFJlc3VsdHNDYik7CisgICAgIFdESV9BU1NFUlQoMCk7CisgICAgIHJldHVybiBXRElfU1RBVFVTX0VfRkFJTFVSRTsKKyAgfQorCisgIGhhbEVYVFNjYW5HZXRTY2FuUmVxUGFyYW1zLnJlcXVlc3RJZCA9CisgICAgICAgICAgICAgICAgICAgIHB3ZGlFWFRTY2FuR2V0Q2FjaGVkUmVzdWx0c1JlcVBhcmFtcy0+cmVxdWVzdElkOworICBoYWxFWFRTY2FuR2V0U2NhblJlcVBhcmFtcy5zZXNzaW9uSWQgPQorICAgICAgICAgICAgICAgICAgICBwd2RpRVhUU2NhbkdldENhY2hlZFJlc3VsdHNSZXFQYXJhbXMtPnNlc3Npb25JZDsKKyAgaGFsRVhUU2NhbkdldFNjYW5SZXFQYXJhbXMuZmx1c2ggPQorICAgICAgICAgICAgICAgICAgICBwd2RpRVhUU2NhbkdldENhY2hlZFJlc3VsdHNSZXFQYXJhbXMtPmZsdXNoOworCisgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREksIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgIiByZXF1ZXN0SWQgJXUgIgorICAgICAgICAgICAgICAgICAgIiBzZXNzaW9uSWQgJXUgIgorICAgICAgICAgICAgICAgICAgIiBmbHVzaCAldSAiLAorICAgICAgICAgICAgICAgICAgaGFsRVhUU2NhbkdldFNjYW5SZXFQYXJhbXMucmVxdWVzdElkLAorICAgICAgICAgICAgICAgICAgaGFsRVhUU2NhbkdldFNjYW5SZXFQYXJhbXMuc2Vzc2lvbklkLAorICAgICAgICAgICAgICAgICAgaGFsRVhUU2NhbkdldFNjYW5SZXFQYXJhbXMuZmx1c2gpOworCisgIHdwYWxNZW1vcnlDb3B5KHBTZW5kQnVmZmVyK3VzRGF0YU9mZnNldCwKKyAgICAgICAgICAgICAgICAgICZoYWxFWFRTY2FuR2V0U2NhblJlcVBhcmFtcywKKyAgICAgICAgICAgICAgICAgIHNpemVvZihoYWxFWFRTY2FuR2V0U2NhblJlcVBhcmFtcykpOworCisgIHBXRElDdHgtPnBSZXFTdGF0dXNVc2VyRGF0YSA9IHBFdmVudERhdGEtPnBVc2VyRGF0YTsKKworCisgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgIFNlbmQgRVhUU2NhbiBTdG9wIFJlcXVlc3QgdG8gSEFMCisgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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1RfRVZFTlQsICZ3ZGlFdmVudERhdGEpOworfQorCisvKioKKyBAYnJpZWYgV0RJX1Byb2Nlc3NFWFRTY2FuU3RvcFJlcSAtCisgICAgRXh0ZW5kZWQgU2NhbiBTdG9wIHJlcXVlc3QgdG8gRlcKKworIEBwYXJhbSAgcFdESUN0eCA6IHdkaSBjb250ZXh0CisgICAgICAgICBwRXZlbnREYXRhIDogaW5kaWNhdGlvbiBkYXRhCisKKyBAc2VlCisgQHJldHVybiBub25lCisqLworV0RJX1N0YXR1cworV0RJX1Byb2Nlc3NFWFRTY2FuU3RvcFJlcQorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKQoreworICBXRElfRVhUU2NhblN0b3BSZXFQYXJhbXMqIHB3ZGlFWFRTY2FuU3RvcFJlcVBhcmFtczsKKyAgV0RJX0VYVFNjYW5TdG9wUnNwQ2Igd2RpRVhUU2NhblN0b3BDYjsKKyAgd3B0X3VpbnQ4KiAgICAgICAgICAgICAgIHBTZW5kQnVmZmVyICAgICAgICAgPSBOVUxMOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgdXNTZW5kU2l6ZSAgICAgICAgICA9IDA7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICB1c0RhdGFPZmZzZXQgICAgICAgID0gMDsKKyAgdEhhbEV4dFNjYW5TdG9wUmVxIGhhbEVYVFNjYW5TdG9wUmVxUGFyYW1zOworCisgIFZPU19UUkFDRSggVk9TX01PRFVMRV9JRF9XREksIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgIiVzOiAlZCAiLF9fZnVuY19fLCBfX0xJTkVfXyk7CisKKyAgaWYgKCggTlVMTCA9PSBwRXZlbnREYXRhICkgfHwgKCBOVUxMID09IHBFdmVudERhdGEtPnBFdmVudERhdGEgKSB8fAorICAgICAgKCBOVUxMID09IHBFdmVudERhdGEtPnBD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cmFtcyogcHdkaUVYVFNjYW5TdGFydFJlcVBhcmFtczsKKyAgV0RJX0VYVFNjYW5TdGFydFJzcENiIHdkaUVYVFNjYW5TdGFydENiOworICB3cHRfdWludDgqICAgICAgICAgICAgICAgcFNlbmRCdWZmZXIgICAgICAgICA9IE5VTEw7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICB1c1NlbmRTaXplICAgICAgICAgID0gMDsKKyAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgIHVzRGF0YU9mZnNldCAgICAgICAgPSAwOworICB0cEhhbEV4dFNjYW5TdGFydFJlcSBwSGFsRXh0U2NhblN0YXJ0UmVxUGFyYW1zOworICBpbnQgaSA9IDA7CisgIGludCBqID0gMDsKKworICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RJLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICIlczogJWQgRW50ZXIiLF9fZnVuY19fLCBfX0xJTkVfXyk7CisKKyAgaWYgKCggTlVMTCA9PSBwRXZlbnREYXRhICkgfHwgKCBOVUxMID09IHBFdmVudERhdGEtPnBFdmVudERhdGEgKSB8fAorICAgICAgKCBOVUxMID09IHBFdmVudERhdGEtPnBDQmZuYyApKQorICB7CisgICAgIFdQQUxfVFJBQ0UoIGVXTEFOX01PRFVMRV9EQUxfQ1RSTCwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICIlczogSW52YWxpZCBwYXJhbWV0ZXJzIiwgX19mdW5jX18pOworICAgICBXRElfQVNTRVJUKDApOworICAgICByZXR1cm4gV0RJX1NUQVRVU19FX0ZBSUxVUkU7CisgIH0KKworICBwd2RpRVhUU2NhblN0YXJ0UmVxUGFyYW1zID0KKyAgICAgICAgICAgICAgICAoV0RJX0VYVFNjYW5TdGFydFJlcVBhcmFtcyopcEV2ZW50RGF0YS0+cEV2ZW50RGF0YTsKKyAgd2RpRVhUU2NhblN0YXJ0Q2IgICA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ub25lCisqLworV0RJX1N0YXR1cworV0RJX1Byb2Nlc3NFWFRTY2FuU2V0QlNTSURIb3RsaXN0UmVxCisoCisgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgV0RJX0V2ZW50SW5mb1R5cGUqICAgICBwRXZlbnREYXRhCispCit7CisgIFdESV9FWFRTY2FuU2V0QlNTSURIb3RsaXN0UmVxUGFyYW1zKiBwd2RpRVhUU2NhblNldEJTU0lESG90bGlzdFJlcVBhcmFtczsKKyAgV0RJX0VYVFNjYW5TZXRCU1NJREhvdGxpc3RSc3BDYiAgd2RpRVhUU2NhblNldEJTU0lESG90bGlzdFJzcENiOworICB3cHRfdWludDgqICAgICAgICAgICAgICAgcFNlbmRCdWZmZXIgICAgICAgICA9IE5VTEw7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICB1c1NlbmRTaXplICAgICAgICAgID0gMDsKKyAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgIHVzRGF0YU9mZnNldCAgICAgICAgPSAwOworICB0cEhhbEJzc2lkSG90bGlzdFNldFJlcSAgcEhhbEJzc2lkSG90bGlzdFNldFJlcVBhcmFtczsKKyAgaW50IGk7CisKKyAgVk9TX1RSQUNFKCBWT1NfTU9EVUxFX0lEX1dESSwgVk9TX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICAgICAiJXM6ICVkIEVudGVyIixfX2Z1bmNfXywgX19MSU5FX18pOworCisgIGlmICgoIE5VTEwgPT0gcEV2ZW50RGF0YSApIHx8ICggTlVMTCA9PSBwRXZlbnREYXRhLT5wRXZlbnREYXRhICkgfHwKKyAgICAgICggTlVMTCA9PSBwRXZlbnREYXRhLT5wQ0JmbmMgKSkKKyAgeworICAgICBXUEFMX1RSQUNFKCBlV0xBTl9NT0RVTEVfREFMX0NUUkwsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICAiJXM6IEludmFsaWQgcGFyYW1ldGVycyI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AgICAgICAgID0gd2RpRVhUU2NhblJlc2V0QlNTSURIb3RsaXN0UnNwQ2I7CisgIHdkaUV2ZW50RGF0YS5wVXNlckRhdGEgICAgICAgPSBwVXNlckRhdGE7CisKKyAgcmV0dXJuIFdESV9Qb3N0TWFpbkV2ZW50KCZnV0RJQ2IsIFdESV9SRVFVRVNUX0VWRU5ULCAmd2RpRXZlbnREYXRhKTsKK30KKworLyoqCisgQGJyaWVmIFdESV9Qcm9jZXNzRVhUU2NhblJlc2V0QlNTSURIb3RsaXN0UmVxIC0KKyAgICBFeHRlbmRlZCBTY2FuIHJlc2V0IEJTU0lEIGhvdGxpc3QgUmVxdWVzdCB0byBGVworCisgQHBhcmFtICBwV0RJQ3R4IDogd2RpIGNvbnRleHQKKyAgICAgICAgIHBFdmVudERhdGEgOiBpbmRpY2F0aW9uIGRhdGEKKworIEBzZWUKKyBAcmV0dXJuIG5vbmUKKyovCitXRElfU3RhdHVzCitXRElfUHJvY2Vzc0VYVFNjYW5SZXNldEJTU0lESG90bGlzdFJlcQorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKQoreworICBXRElfRVhUU2NhblJlc2V0QlNTSURIb3RsaXN0UmVxUGFyYW1zKiBwd2RpRVhUU2NhblJlc2V0QlNTSURIb3RsaXN0UmVxUGFyYW1zOworICBXRElfRVhUU2NhblJlc2V0QlNTSURIb3RsaXN0UnNwQ2IgIHdkaUVYVFNjYW5SZXNldEJTU0lESG90bGlzdFJzcENiOworICB3cHRfdWludDgqICAgICAgICAgICAgICAgcFNlbmRCdWZmZXIgICAgICAgICA9IE5VTEw7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICB1c1NlbmRTaXplICAgICAgICAgID0gMDsKKyAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgIHVzRGF0YU9mZnNldCAgICAgICAgPSAwOworICB0cEhhbEhvdGxpc3RSZXNldFJ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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyAgaWYgKCggV0RJX1NUQVRVU19TVUNDRVNTICE9IFdESV9HZXRNZXNzYWdlQnVmZmVyKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBXRElDdHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0RJX0VYVFNDQU5fUkVTRVRfQlNTSURfSE9UTElTVF9SRVEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRIYWxIb3RsaXN0UmVzZXRSZXEpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwU2VuZEJ1ZmZlciwgJnVzRGF0YU9mZnNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdXNTZW5kU2l6ZSkpfHwKKyAgICAgKCB1c1NlbmRTaXplIDwgKHVzRGF0YU9mZnNldCArIHNpemVvZih0SGFsSG90bGlzdFJlc2V0UmVxKSApKSkKKyAgeworICAgICBXUEFMX1RSQUNFKCBlV0xBTl9NT0RVTEVfREFMX0NUUkwsICBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgIlVuYWJsZSB0byBnZXQgc2VuZCBidWZmZXIgaW4gJXMgJXAgJXAgJXAiLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICBwRXZlbnREYXRhLCBwd2RpRVhUU2NhblJlc2V0QlNTSURIb3RsaXN0UmVxUGFyYW1zLAorICAgICAgICAgICAgICAgIHdkaUVYVFNjYW5SZXNldEJTU0lESG90bGlzdFJzcENiKTsKKyAgICAgV0RJX0FTU0VSVCgwKTsKKyAgICAgcmV0dXJuIFdESV9TVEFUVVNfRV9GQUlMVVJFOworICB9CisgIHBIYWxIb3RsaXN0UmVz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IDogaW5kaWNhdGlvbiBkYXRhCisKKyBAc2VlCisgQHJldHVybiBub25lCisqLworV0RJX1N0YXR1cworV0RJX1Byb2Nlc3NFWFRTY2FuU2V0U2lnbmlmUlNTSUNoYW5nZVJlcQorKAorICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsCisgIFdESV9FdmVudEluZm9UeXBlKiAgICAgcEV2ZW50RGF0YQorKQoreworICBXRElfRVhUU2NhblNldFNpZ25mUlNTSUNoYW5nZVJlcVBhcmFtcyoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHdkaUVYVFNjYW5TZXRTaWduZlJTU0lDaGFuZ2VSZXFQYXJhbXM7CisgIFdESV9FWFRTY2FuU2V0U2lnbmZSU1NJQ2hhbmdlUnNwQ2IgIHdkaUVYVFNjYW5TZXRTaWduZlJTU0lDaGFuZ2VSc3BDYjsKKyAgd3B0X3VpbnQ4KiAgICAgICAgICAgICAgIHBTZW5kQnVmZmVyICAgICAgICAgPSBOVUxMOworICB3cHRfdWludDE2ICAgICAgICAgICAgICAgdXNTZW5kU2l6ZSAgICAgICAgICA9IDA7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICB1c0RhdGFPZmZzZXQgICAgICAgID0gMDsKKyAgdHBIYWxTaWdSc3NpU2V0UmVxICAgICAgIHBIYWxTaWdSc3NpU2V0UmVxUGFyYW1zOworICBpbnQgaTsKKworICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RJLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICIlczogJWQgRW50ZXIiLF9fZnVuY19fLCBfX0xJTkVfXyk7CisKKyAgaWYgKCggTlVMTCA9PSBwRXZlbnREYXRhICkgfHwgKCBOVUxMID09IHBFdmVudERhdGEtPnBFdmVudERhdGEgKSB8fAorICAgICAgKCBOVUxMID09IHBFdmVudERhdGEtPnBDQmZuYyApKQorICB7CisgICAgIFdQQUxfVFJBQ0UoIGVXTEFO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gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRIYWxTaWdSc3NpU2V0UmVxKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFNlbmRCdWZmZXIsICZ1c0RhdGFPZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnVzU2VuZFNpemUpKXx8CisgICAgICAoIHVzU2VuZFNpemUgPCAodXNEYXRhT2Zmc2V0ICsgc2l6ZW9mKHRIYWxTaWdSc3NpU2V0UmVxKSApKSkKKyAgeworICAgICBXUEFMX1RSQUNFKCBlV0xBTl9NT0RVTEVfREFMX0NUUkwsICBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgIlVuYWJsZSB0byBnZXQgc2VuZCBidWZmZXIgaW4gJXMgJXAgJXAgJXAiLCBfX2Z1bmNfXywKKyAgICAgICAgICAgICAgICBwRXZlbnREYXRhLCBwd2RpRVhUU2NhblNldFNpZ25mUlNTSUNoYW5nZVJlcVBhcmFtcywKKyAgICAgICAgICAgICAgICB3ZGlFWFRTY2FuU2V0U2lnbmZSU1NJQ2hhbmdlUnNwQ2IpOworICAgICBXRElfQVNTRVJUKDApOworICAgICByZXR1cm4gV0RJX1NUQVRVU19FX0ZBSUxVUkU7CisgIH0KKworICBwSGFsU2lnUnNzaVNldFJlcVBhcmFtcyA9CisgICAgICAodHBIYWxTaWdSc3NpU2V0UmVxKSAocFNlbmRCdWZmZXIgKyB1c0RhdGFPZmZzZXQpOworCisgIHBIYWxTaWdSc3NpU2V0UmVxUGFyYW1zLT5yZXF1ZXN0SWQgPQorICAgICAgICAgICAgICAgICAgICBwd2RpRVhUU2NhblNldFNpZ25mUlNTSUNoYW5nZVJlcVBhcmFtcy0+cmVxdWVzdElkOworICBwSGFsU2lnUnNzaVNldFJlcVBhcmFtcy0+c2Vzc2lvbklkID0KKyAgICAgICAgICAgICAgICAgICAgcHdkaUVYVF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50MTYgICAgICAgICAgICAgICAgICAgICB1c0RhdGFPZmZzZXQgPSAwOworICAgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgICB1c1NlbmRTaXplICAgPSAwOworICAgIFdESV9TdGF0dXMgICAgICAgICAgICAgICAgICAgICB3ZGlTdGF0dXM7CisgICAgdEdldEZyYW1lTG9nUmVxTXNnICAgICAgICAgICAgIGhhbEdldEZyYW1lTG9nUmVxOworICAgIFdESV9GV0xvZ2dpbmdJbml0UnNwQ2IgICAgICAgICB3ZGlHZXRGcmFtZUxvZ1JzcENiOworCisKKyAgICBWT1NfVFJBQ0UoIFZPU19NT0RVTEVfSURfV0RJLCBWT1NfVFJBQ0VfTEVWRUxfSU5GTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlczogJWQgRW50ZXIiLF9fZnVuY19fLCBfX0xJTkVfXyk7CisKKyAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgIFNhbml0eSBjaGVjaworICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyAgICBpZiAoKCBOVUxMID09IHBXRElDdHggKSB8fCAoIE5VTEwgPT0gcEV2ZW50RGF0YSApIHx8CisgICAgICAgICAgICAoIE5VTEwgPT0gcEV2ZW50RGF0YS0+cEV2ZW50RGF0YSkpCisgICAgeworICAgICAgICBXUEFMX1RSQUNFKCBlV0xBTl9NT0RVTEVfREFMX0NUUkwsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9XQVJOLAorICAgICAgICAgICAgICAgICIlczogSW52YWxpZCBwYXJhbWV0ZXJzIiwgX19mdW5jX18pOworICAgICAgICBXRElfQVNTRVJUKDApOworICAgICAgICByZXR1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XZlbnREYXRhICAgICAgPSBwd2RpTmFuUmVxdWVzdDsKKyAgd2RpRXZlbnREYXRhLnVFdmVudERhdGFTaXplICA9IHNpemVvZigqcHdkaU5hblJlcXVlc3QpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHB3ZGlOYW5SZXF1ZXN0LT5yZXF1ZXN0X2RhdGFfbGVuOworICB3ZGlFdmVudERhdGEucFVzZXJEYXRhICAgICAgID0gdXNyRGF0YTsKKyAgd2RpRXZlbnREYXRhLnBDQmZuYyAgICAgICAgICA9IE5VTEw7CisKKworICByZXR1cm4gV0RJX1Bvc3RNYWluRXZlbnQoJmdXRElDYiwgV0RJX1JFUVVFU1RfRVZFTlQsICZ3ZGlFdmVudERhdGEpOworfQorCitXRElfU3RhdHVzCitXRElfUHJvY2Vzc05hblJlcXVlc3QKKygKKyAgV0RJX0NvbnRyb2xCbG9ja1R5cGUqICBwV0RJQ3R4LAorICBXRElfRXZlbnRJbmZvVHlwZSogICAgIHBFdmVudERhdGEKKykKK3sKKyAgV0RJX05hblJlcXVlc3RUeXBlICAgICAgICAgICAgICAgKnB3ZGlOYW5SZXF1ZXN0ICAgPSBOVUxMOworICB3cHRfdWludDgqICAgICAgICAgICAgICAgICAgICAgICBwU2VuZEJ1ZmZlciAgICAgICA9IE5VTEw7CisgIHdwdF91aW50MTYgICAgICAgICAgICAgICAgICAgICAgIHVzRGF0YU9mZnNldCAgICAgID0gMDsKKyAgd3B0X3VpbnQxNiAgICAgICAgICAgICAgICAgICAgICAgdXNTZW5kU2l6ZSAgICAgICAgPSAwOworCisgIFdQQUxfVFJBQ0UoIGVXTEFOX01PRFVMRV9EQUxfQ1RSTCwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0lORk8sCisgICAgICAgICAgICAgICJXRElfUHJvY2Vzc05hblJlcXVlc3QiKTsKKworICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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UgdG8gYmUgb25seSBieSB0aGUgV0RJIGRhdGEKKyAgcGF0aC4KKyAKKyAgVGhlIG1vZHVsZSBsZXZlcmFnZWQgYXMgbXVjaCBhcyBmdW5jdGlvbmFsaXR5IGFzIHdhcyBwb3NzaWJsZSBmcm9tIHRoZSBIQUwKKyAgaW4gTGlicmEvVm9sYW5zLgorIAorICBERVBFTkRFTkNJRVM6CisKKyAgQXJlIGxpc3RlZCBmb3IgZWFjaCBBUEkgYmVsb3cuCisKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgIEVESVQgSElTVE9SWSBGT1IgRklMRQorCisKKyAgVGhpcyBzZWN0aW9uIGNvbnRhaW5zIGNvbW1lbnRzIGRlc2NyaWJpbmcgY2hhbmdlcyBtYWRlIHRvIHRoZSBtb2R1bGUuCisgIE5vdGljZSB0aGF0IGNoYW5nZXMgYXJlIGxpc3RlZCBpbiByZXZlcnNlIGNocm9ub2xvZ2ljYWwgb3JkZXIuCisKKworICAgJEhlYWRlciQkRGF0ZVRpbWUkJEF1dGhvciQKKworCisgIHdoZW4gICAgICAgIHdobyAgICAgd2hhdCwgd2hlcmUsIHdoeQorLS0tLS0tLS0tLSAgICAtLS0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKzIwMTAtMDgtMTkgICAgbHRpICAgICBDcmVhdGVkIG1vZHVsZQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisjaW5jbHVkZSAid2xhbl9xY3RfcGFsX2FwaS5oIgorI2luY2x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gIHdwdF91aW50OCAqcEJkLCAKKyAgICB3cHRfdWludDMyIG5iU3dhcAorKQoreworICB3cHRfdWludDMyICpwVTMyOworICB3cHRfdWludDMyIG5VMzI7CisgIHdwdF91aW50MzIgd2M7CisKKyAgblUzMiA9ICgoKG5iU3dhcCkgKyAzKT4+Mik7CisKKyAgcFUzMiA9ICh3cHRfdWludDMyICopcEJkOworICBmb3IgKCB3YyA9IDA7IHdjIDwgblUzMjsgd2MrKyApCisgIHsKKyAgICBwVTMyWyB3YyBdID0gV1BBTF9CRTMyX1RPX0NQVSggcFUzMlsgd2MgXSApOworICB9Cit9LypXRElfU3dhcEJ5dGVzKi8KKworLyoqCisgQGJyaWVmIFdESV9CbXVHZXRRaWRGb3JRT1NUaWQgLSByZXR1cm5zIHRoZSBCTVUgUUlEIGZvciBhIGdpdmVuIAorICAgICAgICBUSUQKKyAKKyBAcGFyYW0gIHVjVGlkOiAgVElECisgICAgICAgICBwUWlkOiAgIG91dCBRSUQKKyAgCisgQHNlZQorIEByZXR1cm4gUmVzdWx0IG9mIHRoZSBmdW5jdGlvbiBjYWxsCisqLworV0RJX1N0YXR1cyAKK1dESV9CbXVHZXRRaWRGb3JRT1NUaWQKKygKKyAgICB3cHRfdWludDggICB1Y1RpZCwgCisgICAgd3B0X3VpbnQ4KiAgcFFpZAorKQoreworICAgIGlmICh1Y1RpZCA+IEJUUU1fUVVFVUVfVFhfVElEXzcgKQorICAgICAgICByZXR1cm4gV0RJX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgICAgIAorICAgICpwUWlkID0gYnRxbVFvc1RpZDJRaWRNYXBwaW5nW3VjVGlkXTsKKyAgICByZXR1cm4gV0RJX1NUQVRVU19TVUNDRVNTOworfS8qV0RJX0JtdUdldFFpZEZvclFPU1RpZCovCisKKyNpZmRlZiBXTEFOX1BFUkYKKworLyoqCisgQGJyaWVmIFdESV9Db21wdXRlVHhCZFNpZ25hdHVyZSAtIGNvbXB1dGVzIHRoZSBCRCBzaWduYXR1cmUKKyAgCisgQHBhcmFtICAgcFdESUN0eDogICAgICAgcG9pbnRlciB0byB0aGUgZ2xvYmFsIFdESSBjb250ZXh0OworIAorICAgIHBEZXN0TWFjQWRkcjogICBkZXN0aW5hdGlvbiBNQUMgYWRkcmVzcworICAgIAorICAgIHVjVGlkOiAgICAgICAgICAgIFRJRCBvZiB0aGUgZnJhbWUKKworICAgIHVjRGlzYWJsZUZybVh0bDogIFVuaWNhc3QgZGVzdGluYXRpb24KKyAgCisgQHJldHVybiAgIHRoZSBzaWduYXR1cmUKKyovCitzdGF0aWMgd3B0X3VpbnQzMiAKK1dESV9Db21wdXRlVHhCZFNpZ25hdHVyZQorKCAgCisgICAgV0RJX0NvbnRyb2xCbG9ja1R5cGUqICBwV0RJQ3R4LAorICAgIHdwdF91aW50OCogICAgICAgICAgICAgcERlc3RNYWMsIAorICAgIHdwdF91aW50OCAgICAgICAgICAgICAgdWNUaWQsIAorICAgIHdwdF91aW50OCAgICAgICAgICAgICAgdWNVbmljYXN0RHN0CispCit7CisgICAgd3B0X3VpbnQxNiAqcE1hY1UxNiA9ICh3cHRfdWludDE2ICopIHBEZXN0TWFjOworCisgICAgcmV0dXJuICgocE1hY1UxNlswXSBeIHBNYWNVMTZbMV0gXiBwTWFjVTE2WzJdKTw8IFdESV9UWEJEX1NJR19NQUNBRERSX0hBU0hfT0ZGU0VUIHwKKyAgICAgICAgcFdESUN0eC0+dUJkU2lnU2VyaWFsTnVtIDw8IFdESV9UWEJEX1NJR19TRVJJQUxfT0ZGU0VUIHwgCisgICAgICAgIHVjVGlkIDw8IFdESV9UWEJEX1NJR19USURfT0ZGU0VUIHwKKyAgICAgICAgdWNVbmljYXN0RHN0IDw8IFdESV9UWEJEX1NJR19VQ0FTVF9EQVRBX09GRlNFVCk7Cit9LypXRElfQ29tcHV0ZVR4QmRTaWduYXR1cmUqLworCisKKy8qKgorIEBicmllZiBXRElfVHhCZEZhc3RGd2QgLSBldmFsdWF0ZXMgaWYgYSBmcmFtZSBjYW4gYmUgZmFzdCAKKyAgICAgICAgZm9yd2FyZGVkIAorICAKKyBAcGFyYW0gICBwV0RJQ3R4OiBDb250ZXh0IHRvIHRoZSBXREkgCisgICAgICAgICAgcERlc3RNYWM6IERlc3RpbmF0aW9uIE1BQworICAgICAgICAgIHVjVGlkOiBwYWNrZXQgVElEIHBCREhlYWRlcgorICAgICAgICAgIHVjVW5pY2FzdERzdDogaXMgcGFja2V0IHVuaWNhc3QKKyAgICAgICAgICBwVHhCZDogICAgICAgcG9pbnRlciB0byB0aGUgQkQgaGVhZGVyCisgICAgICAgICAgdXNNcGR1TGVuZ3RoOiBsZW4gCisgIAorIEByZXR1cm4gMSAtIGlmIHRoZSBmcmFtZSBjYW4gYmUgZmFzdCBmd2QtZWQgOyAwIGlmIG5vdCAKKyovCit3cHRfdWludDMyIAorV0RJX1R4QmRGYXN0RndkCisoCisgICAgV0RJX0NvbnRyb2xCbG9ja1R5cGUqICBwV0RJQ3R4LAorICAgIHdwdF91aW50OCogICAgICAgICAgICAgcERlc3RNYWMsIAorICAgIHdwdF91aW50OCAgICAgICAgICAgICAgdWNUaWQsIAorICAgIHdwdF91aW50OCAgICAgICAgICAgICAgdWNVbmljYXN0RHN0LCAKKyAgICB2b2lkKiAgICAgICAgICAgICAgICAgIHBUeEJkLCAKKyAgICB3cHRfdWludDE2ICAgICAgICAgICAgIHVzTXBkdUxlbmd0aCAKKyApCit7CisgICAgV0RJX1R4QmRUeXBlKiAgICAgcEJkICAgICAgPSAoV0RJX1R4QmRUeXBlKikgcFR4QmQ7CisgICAgd3B0X3VpbnQzMiAgICAgICAgdVJldHZhbCAgPSAwOworI2lmZGVmIFdQVF9MSVRUTEVfQllURV9FTkRJQU4KKyAgICB3cHRfdWludDE2ICAgICAgICB1c1N3YXBwZWQ7IAorICAgIHdwdF91aW50MTYqICAgICAgIHBVMTYgICAgID0gKHdwdF91aW50MTYgKikgcFR4QmQ7CisjZW5kaWYKKworICAgIC8qLSAtIC0gLSAtIC0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JlY2VpdmVkIGZyb20gSERELiAodXNlYykKKyAgIAorICAgQHJldHVybgorICAgIFRoZSByZXN1bHQgY29kZSBhc3NvY2lhdGVkIHdpdGggcGVyZm9ybWluZyB0aGUgb3BlcmF0aW9uICAKKyAKKyovCisKK1dESV9TdGF0dXMKK1dESV9GaWxsVHhCZAorKAorICAgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwgCisgICAgd3B0X3VpbnQ4ICAgICAgICAgICAgICB1Y1R5cGVTdWJ0eXBlLCAKKyAgICB2b2lkKiAgICAgICAgICAgICAgICAgIHBEZXN0TWFjQWRkciwKKyAgICB2b2lkKiAgICAgICAgICAgICAgICAgIHBBZGRyMiwKKyAgICB3cHRfdWludDgqICAgICAgICAgICAgIHBUaWQsIAorICAgIHdwdF91aW50OCAgICAgICAgICAgICAgdWNEaXNhYmxlRnJtWHRsLCAKKyAgICB2b2lkKiAgICAgICAgICAgICAgICAgIHBUeEJkLCAKKyAgICB3cHRfdWludDMyICAgICAgICAgICAgIHVjVHhGbGFnLAorICAgIHdwdF91aW50OCAgICAgICAgICAgICAgdWNQcm90TWdtdEZyYW1lLAorICAgIHdwdF91aW50MzIgICAgICAgICAgICAgdVRpbWVTdGFtcCwKKyAgICB3cHRfdWludDggICAgICAgICAgICAgIGlzRWFwb2wsCisgICAgd3B0X3VpbnQ4KiAgICAgICAgICAgICBzdGFJbmRleCwKKyAgICB3cHRfdWludDMyICAgICAgICAgICAgIHR4QmRUb2tlbgorKQoreworICAgIHdwdF91aW50OCAgICAgICAgICAgICAgdWNUaWQgICAgICAgID0gKnBUaWQ7IAorICAgIFdESV9UeEJkVHlwZSogICAgICAgICAgcEJkICAgICAgICAgID0gKFdESV9UeEJkVHlwZSopIHBUeEJkOworICAgIFdESV9TdGF0dXMgICAgICAgICAgICAgd2RpU3RhdHVzICAgID0gV0RJX1NUQVRVU19TVUNDRVNTOworICAgIHdwdF91aW50OCAgICAgICAgICAgICAgdWNVbmljYXN0RHN0ID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ZD0lZCIsCisgICAgICAgICAgICAgICAgICAgIHVjVHlwZSwgdWNTdWJUeXBlLAorICAgICAgICAgICAgICAgICAgICAqKCh3cHRfdWludDMyICopIHBBZGRyMiksCisgICAgICAgICAgICAgICAgICAgKigod3B0X3VpbnQzMiAqKSBwRGVzdE1hY0FkZHIpLAorICAgICAgICAgICAgICAgICAgICB1Y1RpZCk7CisKKyAgICAgICAgcEJkLT5kcHVSRiA9IEJNVVdRX0ZXX0RQVV9UWDsKKyAgICB9CisKKyAgICBwQmQtPnRpZCAgICAgICAgICAgPSB1Y1RpZDsgCisgICAgLy8gQ2xlYXIgdGhlIHJlc2VydmVkIGZpZWxkIGFzIHRoaXMgZmllbGQgaXMgdXNlZCBmb3IgZGVmaW5pbmcgc3BlY2lhbCAKKyAgICAvLyBmbG93IGNvbnRyb2wgQkQuCisgICAgcEJkLT5yZXNlcnZlZDQgPSAwOworICAgIHBCZC0+ZndUeENvbXBsZXRlMCA9IDA7CisKKyAgICAvKiBUaGlzIGJpdCBpcyBmb3IgaG9zdCB0byByZWdpc3RlciBUeENvbXBsZXRlIEludGVycnVwdCAqLworICAgIHBCZC0+dHhDb21wbGV0ZTEgICA9ICh1Y1R4RmxhZyAmIFdESV9UWENPTVBfUkVRVUVTVEVEX01BU0spID8gMSA6IDA7IAorCisgICAgcEJkLT5hcCAgICA9IFdESV9BQ0tQT0xJQ1lfQUNLX1JFUVVJUkVEOyAKKyAgICBwQmQtPmRwdU5FID0gV0RJX05PX0VOQ1JZUFRJT05fRElTQUJMRUQ7ICAKKworICAgIHVjVW5pY2FzdERzdCA9ICEoKCh3cHRfdWludDggKilwRGVzdE1hY0FkZHIpWzBdICYgMHgwMSk7ICAgIAorICAgICooKHdwdF91aW50MzIgKilwQmQgKyBXRElfRFBVX0ZFRURCQUNLX09GRlNFVCkgPSAwOworCisgICAgaWYoIXVjVW5pY2FzdERzdCkKKyAgICB7CisgICAgICBwQmQtPmFwICAgID0gV0RJX0FDS1BPTElDWV9BQ0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IFdESV9NQUNfREFUQV9RT1NfREFUQSkmJgorICAgICAgICAgICAgKHVjU3ViVHlwZSAhPSBXRElfTUFDX0RBVEFfUU9TX05VTEwpKQorICAgICAgICB7CisgICAgICAgICAgICBwQmQtPmJkX3NzbiA9IFdESV9UWEJEX0JEX1NTTl9GSUxMX0RQVV9RT1M7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBwQmQtPmJkX3NzbiA9IFdESV9UWEJEX0JEX1NTTl9GSUxMX0RQVV9OT05fUU9TOworICAgICAgICB9CisKKyAgICAgICAgLyogVW5pY2FzdC9NY2FzdCBkZWNpc2lvbjoKKyAgICAgICAgICogIEluIEluZnJhIFNUQSByb2xlLCBhbGwgZnJhbWVzIHRvIEFQIGFyZSB1bmljYXN0IGZyYW1lcy4KKyAgICAgICAgICogIEZvciBJQlNTLCB0aGVuIGNoZWNrIHRoZSBhY3R1YWwgREEgTUFDIGFkZHJlc3MgCisgICAgICAgICAgICBUaGlzIGltcGxlbWVudGF0aW9uIGRvZXNuJ3Qgc3VwcG9ydCBtdWx0aSBCU1MgYW5kIEFQIGNhc2UuCisgICAgICAgICAgICBpZihlU1lTVEVNX1NUQV9JTl9JQlNTX1JPTEUgPT0gc3lzdGVtUm9sZSkgCisgICAgICAgICAgICB1Y1VuaWNhc3REc3QgPSAhKCgod3B0X3VpbnQ4ICopcERlc3RNYWNBZGRyKVswXSAmIDB4MDEpOworICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgdWNVbmljYXN0RHN0ID0gV0RJX0RFRkFVTFRfVU5JQ0FTVF9FTkFCTEVEOworIAorICAgICAgICAgICAgVGhlIGFib3ZlIGlzICBvcmlnaW5hbCBIQUwgY29kZSAtIGhvd2V2ZXIgdG8gbWFrZSBpbXBsZW1lbnRhdGlvbgorICAgICAgICAgICAgbW9yZSBlbGFzdGljIGFuZCBzdXBwb3J0aXZlIG9mIGNvbmN1cnJlbmN5IHNjZW5hcmlvcyB3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NLKQorICAgICAgICB7CisgICAgICAgICAgICBwQmQtPmJkUmF0ZSA9IFdESV9CRFJBVEVfQkNEQVRBX0ZSQU1FOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYodWNUeEZsYWcgJiBXRElfVVNFX0JEX1JBVEVfMl9NQVNLKQorICAgICAgICB7CisgICAgICAgICAgICBwQmQtPmJkUmF0ZSA9IFdESV9CRFJBVEVfQkNNR01UX0ZSQU1FOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYodWNUeEZsYWcgJiBXRElfVVNFX0JEX1JBVEVfM19NQVNLKQorICAgICAgICB7CisgICAgICAgICAgICBwQmQtPmJkUmF0ZSA9IFdESV9CRFJBVEVfQ1RSTF9GUkFNRTsKKyAgICAgICAgfQorCisgICAgICAgIHBCZC0+cm1mICAgID0gV0RJX1JNRl9ESVNBQkxFRDsgICAgIAorCisgICAgICAgIC8qIHNhbml0eTogTWlnaHQgYWxyZWFkeSBiZSBzZXQgYnkgY2FsbGVyLCBidXQgZW5mb3JjZSBpdCBoZXJlIGFnYWluICovCisgICAgICAgIGlmKCBXRElfTUFDX0RBVEFfTlVMTCA9PSAodWNTdWJUeXBlICYgfldESV9NQUNfREFUQV9RT1NfREFUQSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIHVjRGlzYWJsZUZybVh0bCA9IDE7CisgICAgICAgICAgICBpZiAodWNUeEZsYWcgJiBXRElfVFhDT01QX1JFUVVFU1RFRF9NQVNLKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKlNlbmQgdG8gRlcgdG8gdHJhbnNtaXQgTlVMTCBmcmFtZXMuKi8KKyAgICAgICAgICAgICAgICBwQmQtPmRwdVJGID0gQk1VV1FfRldfVFJBTlNNSVQ7IAorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworI2lmZGVmIExJQlJBX1dBUElfU1VQUE9SVAorICAgICAgICAgICAgICAgIGlmICh1Y1R4RmxhZyAmIFdESV9XQVBJX1NUQV9NQVNLKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEJkLT5kcHVSRiA9IEJNVVdRX1dBUElfRFBVX1RYOworICAgICAgICAgICAgICAgICAgICAvKnNldCBORSBiaXQgdG8gMSBmb3IgdGhlIG51bGwvcW9zIG51bGwgZnJhbWVzKi8KKyAgICAgICAgICAgICAgICAgICAgcEJkLT5kcHVORSA9IFdESV9OT19FTkNSWVBUSU9OX0VOQUJMRUQ7CisgICAgICAgICAgICAgICAgfQorI2VuZGlmCisgICAgICAgICAgICB9CisgICAgICAgICB9CisjaWYgZGVmaW5lZChXTEFOX1BFUkYpIHx8IGRlZmluZWQoRkVBVFVSRV9XTEFOX1dBUEkpIHx8IGRlZmluZWQoTElCUkFfV0FQSV9TVVBQT1JUKQorICAgICAgICAvL0ZvciBub3QtTlVMTCBkYXRhIGZyYW1lcworICAgICAgICBlbHNlCisgICAgICAgIHsKKyNpZiBkZWZpbmVkKEZFQVRVUkVfV0xBTl9XQVBJKQorICAgICAgICAgICAgLy9JZiBjYWxsZXIgZG9lc24ndCB3YW50IHRoaXMgZnJhbWUgdG8gYmUgZW5jcnlwdGVkLCBmb3IgZXhhbXBsZSwgV0FJIHBhY2tldHMKKyAgICAgICAgICAgIGlmKCAodWNUeEZsYWcgJiBXRElfVFhfTk9fRU5DUllQVElPTl9NQVNLKSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcEJkLT5kcHVORSA9IFdESV9OT19FTkNSWVBUSU9OX0VOQUJMRUQ7CisgICAgICAgICAgICB9CisjZW5kaWYgLy9kZWZpbmVkKEZFQVRVUkVfV0xBTl9XQVBJKQorI2lmZGVmIExJQlJBX1dBUElfU1VQUE9SVAorICAgICAgICAgICAgaWYgKHVjVHhGbGFnICYgV0RJX1dBUElfU1RBX01BU0spCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcEJkLT5kcHVSRiA9IEJNVVdRX1dBUElfRFBVX1RYOworICAgICA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sb29rdXAgaXMgZG9uZS4KKyAgICAgICAgICogU2FuaXR5OiBGb3JjZSBIVyBmcmFtZSB0cmFuc2xhdGlvbiBPRkYgZm9yIG1nbXQgZnJhbWVzLgorICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworICAgICAgICAgLyogYXBwbHkgdG8gYm90aCB1Y2FzdC9tY2FzdCBtZ210IGZyYW1lcyAqLworICAgICAgICAgLyogUHJvYmUgcmVxdWVzdHMgYXJlIHNlbnQgdXNpbmcgQkQgcmF0ZSAqLworICAgICAgICAgaWYoIHVjU3ViVHlwZSA9PSAgV0RJX01BQ19NR01UX1BST0JFX1JFUSApCisgICAgICAgICB7CisgICAgICAgICAgICAgcEJkLT5iZFJhdGUgPSBXRElfQkRSQVRFX0JDTUdNVF9GUkFNRTsKKyAgICAgICAgIH0KKyAgICAgICAgIGVsc2UKKyAgICAgICAgIHsKKyAgICAgICAgICAgICBpZiAodXNlU3RhUmF0ZUZvckJjYXN0RnJhbWVzKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgcEJkLT5iZFJhdGUgPSAodWNVbmljYXN0RHN0KT8gV0RJX0JEUkFURV9CQ01HTVRfRlJBTUUgOiBXRElfVFhCRF9CRFJBVEVfREVGQVVMVDsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgcEJkLT5iZFJhdGUgPSBXRElfQkRSQVRFX0JDTUdNVF9GUkFNRTsKKyAgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgICBpZiAoIHVjVHhGbGFnICYgV0RJX1VTRV9CRF9SQVRFMl9GT1JfTUFOQUdFTUVOVF9GUkFNRSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgcEJkLT5iZFJhdGUgPSBXRElfQkRSQVRFX0NUUkxfRlJBTUU7CisgICAgICAgICB9CisKKyAgICAgICAgIHBCZC0+YmRfc3NuID0gV0RJX1RYQkRfQkRfU1NOX0ZJTExfRFBVX05PTl9RT1M7CisgICAgICAgICBpZigodWNTdWJUeXBlID09IFdESV9NQUNfTUdNVF9BQ1RJT04pIHx8ICh1Y1N1YlR5cGUgPT0gV0RJX01BQ19NR01UX0RFQVVUSCkgfHwgCisgICAgICAgICAgICAodWNTdWJUeXBlID09IFdESV9NQUNfTUdNVF9ESVNBU1NPQykpCisgICAgICAgICAgICB1Y0lzUk1GID0gMTsKKyAgICAgICAgIHVjRGlzYWJsZUZybVh0bCA9IDE7CisgICAgfSAKKyAgICBlbHNlIAorICAgIHsgICAvLyBDb250cm9sIFBhY2tldAorICAgICAgICAvKiBXZSBzaG91bGQgbmV2ZXIgZ2V0IGEgY29udHJvbCBwYWNrZXQsIGFzc2VydGluZyBoZXJlIHNpbmNlIHNvbWV0aGluZworICAgICAgICBpcyB3cm9uZyAqLworICAgICAgICBXRElfQVNTRVJUKDApOworICAgIH0KKworICAgIHBCZC0+dWIgPSAhdWNVbmljYXN0RHN0OworCisgICAgLyogRmFzdCBwYXRoOiBMZXZlcmFnZSBVTUEgZm9yIEJEIGZpbGxpbmcvZnJhbWUgdHJhbnNsYXRpb24uCisgICAgICogTXVzdCBiZSBhIGRhdGEgZnJhbWUgdG8gcmVxdWVzdCBmb3IgRlQuCisgICAgICogV2hlbiBIVyBmcmFtZSB0cmFuc2xhdGlvbiBpcyBlbmFibGVkLCBVTUEgZmlsbHMgaW4gdGhlIGZvbGxvd2luZyBmaWVsZHM6CisgICAgICogICBEUFUgU2lnIAorICAgICAqICAgRFBVIGRlc2NyaXB0b3IgaW5kZXgKKyAgICAgKiAgIFVwZGF0ZXMgTVBEVSBoZWFkZXIgb2Zmc2V0LCBkYXRhIG9mZnNldCwgTVBEVSBsZW5ndGggYWZ0ZXIgdHJhbnNsYXRpb24KKyAgICAgKiAgIFNUQSBpZAorICAgICAqICAgQlRRTSB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ZXQgdGhlIChzZWxmKSBzdGF0aW9uIGluZGV4IGZyb20gQUREUjIsIHdoaWNoIHNob3VsZCBiZSB0aGUgc2VsZiBNQUMgYWRkcgorICAgICAgICAgICB3ZGlTdGF0dXMgPSBXRElfU1RBVGFibGVGaW5kU3RhaWRCeUFkZHIoIHBXRElDdHgsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICood3B0X21hY0FkZHIqKXBBZGRyMiwgJnVjU3RhSWQgKTsKKyAgICAgICAgICAgaWYgKFdESV9TVEFUVVNfU1VDQ0VTUyAhPSB3ZGlTdGF0dXMpIAorICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgV1BBTF9UUkFDRShlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwgIldESV9TVEFUYWJsZUZpbmRTdGFpZEJ5QWRkciBmYWlsZWQiKTsKKyAgICAgICAgICAgICAgICBXUEFMX1RSQUNFKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLCAiU1RBIElEID0gJWQgIiBNQUNfQUREUkVTU19TVFIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWNTdGFJZCwgTUFDX0FERFJfQVJSQVkoKih3cHRfbWFjQWRkciopcEFkZHIyKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIFdESV9TVEFUVVNfRV9OT1RfQUxMT1dFRDsKKyAgICAgICAgICAgfQorI2Vsc2UKKyAgICAgICAgICAgdWNTdGFJZCA9IHBXRElDdHgtPnVjU2VsZlN0YUlkOworI2VuZGlmCisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCisgICAgICAgICAgICAgICB8ICAgIHwgICAgICAgfCAgICAgICAgICAgICAgICAgRGF0YSAgICAgICAgICAgICAgICAgIHx8ICAgICAgICAgICAgICAgIE1nbXQgICAgICAgICAgICAgICAgICAgfAorICAgICAgICAgICAgICAgfF9fX198X19fX19fX3xfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198fF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKKyAgICAgICAgICAgICAgIHwgICAgfCBNb2RlICB8IERlc3RBZGRyICAgICAgICAgIHwgQWRkcjIgKHNlbGZNYWMpICAgfHwgRGVzdEFkZHIgICAgICAgICAgfCBBZGRyMiAoc2VsZk1hYykgICB8CisgICAgICAgICAgICAgICB8X19fX3xfX19fX19ffF9fX19fX19fX19fX19fX19fX198X19fX19fX19fX19fX19fX19fX3x8X19fX19fX19fX19fX19fX19fX3xfX19fX19fX19fX19fX19fX19ffAorICAgICAgICAgICAgICAgfCAgICB8ICAgICAgIHwgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICB8fCAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgIHwKKyAgICAgICAgICAgICAgIHwgICAgfCBTVEEgICB8IERlc3RBZGRyLT5zdGFJZHggIHwgV2hlbiBEZXN0QWRkciAgICAgfHwgRGVzdEFkZHItPnN0YUlkeCAgfCAtICAgICAgICAgICAgICAgICB8CisgICAgICAgICAgICAgICB8ICAgIHwgICAgICAgfCAgICAgICAgICAgICAgICAgICB8IGxvb2t1cCBmYWlscywgICAgIHx8ICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgfAorICAgICAgICAgICAgICAgfCAgICB8ICAgICAgIHwgICAgICAgICAgICAgICAgICAgfCBBZGRyMi0+c3RhSWR4ICAgICB8fCAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgIHwKKyAgICAgICAgICAgICAgIHxVL0MgfCBJQlNTICB8IERlc3RBZGRyLT5zdGFJZHggIHwgICAgICAgIC0gICAgICAgICAgfHwgRGVzdEFkZHItPnN0YUlkeCAgfCAtICAgICAgICAgICAgICAgICB8CisgICAgICAgICAgICAgICB8ICAgIHwgU29mdEFQfCBEZXN0QWRkci0+c3RhSWR4ICB8ICAgICAgICAtICAgICAgICAgIHx8IERlc3RBZGRyLT5zdGFJZHggIHwgV2hlbiBEZXN0QWRkciAgICAgfAorICAgICAgICAgICAgICAgfCAgICB8ICAgICAgIHwgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICB8fCAgICAgICAgICAgICAgICAgICB8IGxvb2t1cCBmYWlscywgICAgIHwKKyAgICAgICAgICAgICAgIHwgICAgfCAgICAgICB8ICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgfHwgICAgICAgICAgICAgICAgICAgfCBBZGRyMi0+U3RhSWR4ICAgICB8CisgICAgICAgICAgICAgICB8ICAgIHwgSWRsZSAgfCAgICAgTi9BICAgICAgICAgICB8ICAgICAgICBOL0EgICAgICAgIHx8ICAgICAgICAgLSAgICAgICAgIHwgQWRkcjItPlN0YUlkeCAgICAgfAorICAgICAgICAgICAgICAgfF9fX198X19fX19fX3xfX19fX19fX19fX19fX19fX19ffF9fX19fX19fX19fX19fX19fX198fF9fX19fX19fX19fX19fX19fX198X19fX19fX19fX19fX19fX19fX3wKKyAgICAgICAgICAgICAgIHwgICAgfCAgICAgICB8ICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgfHwgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICB8CisgICAgICAgICAgICAgICB8ICAgIHwgU1RBICAgfCAgICAgTi9BICAgICAgICAgICB8ICAgICAgICBOL0EgICAgICAgIHx8ICAgICAgICAgLSAgICAgICAgIHwgQWRkcjItPnN0YUlkeC0+ICAgfAorICAgICAgICAgICAgICAgfCAgICB8ICAgICAgIHwgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICB8fCAgICAgICAgICAgICAgICAgICB8IGJzc0lkeC0+YmNhc1N0YUlkeHwKKyAgICAgICAgICAgICAgIHxCL0MgfCBJQlNTICB8ICAgICAtICAgICAgICAgICAgIHwgQWRkcjItPnN0YUlkeC0+ICAgfHwgICAgICAgICAtICAgICAgICAgfCBBZGRyMi0+c3RhSWR4LT4gICB8CisgICAgICAgICAgICAgICB8ICAgIHwgICAgICAgfCAgICAgICAgICAgICAgICAgICB8IGJzc0lkeC0+YmNhc1N0YUlkeHx8ICAgICAgICAgICAgICAgICAgIHwgYnNzSWR4LT5iY2FzU3RhSWR4fAorICAgICAgICAgICAgICAgfCAgICB8IFNvZnRBUHwgICAgIC0gICAgICAgICAgICAgfCBBZGRyMi0+c3RhSWR4LT4gICB8fCAgICAgICAgIC0gICAgICAgICB8IEFkZHIyLT5zdGFJZHgtPiAgIHwKKyAgICAgICAgICAgICAgIHwgICAgfCAgICAgICB8ICAgICAgICAgICAgICAgICAgIHwgYnNzSWR4LT5iY2FzU3RhSWR4fHwgICAgICAgICAgICAgICAgICAgfCBic3NJZHgtPmJjYXNTdGFJZHh8CisgICAgICAgICAgICAgICB8ICAgIHwgSWRsZSAgfCAgICAgTi9BICAgICAgICAgICB8ICAgICAgICBOL0EgICAgICAgIHx8ICAgICAgICAgLSAgICAgICAgIHwgQWRkcjItPnN0YUlkeC0+ICAgfAorICAgICAgICAgICAgICAgfCAgICB8ICAgICAgIHwgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICB8fCAgICAgICAgICAgICAgICAgICB8IGJzc0lkeC0+YmNhc1N0YUlkeHwKKyAgICAgICAgICAgICAgIHxfX19ffF9fX19fX198X19fX19fX19fX19fX19fX19fX3xfX19fX19fX19fX19fX19fX19ffHxfX19fX19fX19fX19fX19fX19ffF9fX19fX19fX19fX19fX19fX198Ki8KKyAgICAgICAgICAgIC8vIEdldCB0aGUgc3RhdGlvbiBpbmRleCBiYXNlZCBvbiB0aG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NfTUdNVF9GUkFNRSkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgLy9Gb3IgbWFuYWdlbWVudCBmcmFtZXMsIHVzZSBzZWxmIHN0YUlkeCBpZiBwZWVyIHN0YSAKKyAgICAgICAgICAgICAgICAgLy9lbnRyeSBpcyBub3QgZm91bmQuCisgICAgICAgICAgICAgICAgIHdkaVN0YXR1cyA9IFdESV9TVEFUYWJsZUZpbmRTdGFpZEJ5QWRkciggcFdESUN0eCwgCisgICAgICAgICAgICAgICAgICAgICAqKHdwdF9tYWNBZGRyKilwQWRkcjIsICZ1Y1N0YUlkICk7IAorICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICBpZiggIXVjRGlzYWJsZUZybVh0bCApCisgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAvLyBGcmFtZVRyYW5zbGF0aW9uIGluIEhXIGlzIGVuYW5sZWQuIFRoaXMgbWVhbnMsIAorICAgICAgICAgICAgICAgICAgIC8vIHBEZXN0TWFjYWRkcmVzcyBtYXkgYmUgdW5rbm93bi4gR2V0IHRoZSBzdGF0aW9uIGluZGV4IAorICAgICAgICAgICAgICAgICAgIC8vIGZvciBBRERSMiwgd2hpY2ggc2hvdWxkIGJlIHRoZSBzZWxmIE1BQyBhZGRyCisgICAgICAgICAgICAgICAgICAgd2RpU3RhdHVzID0gV0RJX1NUQVRhYmxlRmluZFN0YWlkQnlBZGRyKCBwV0RJQ3R4LCAKKyAgICAgICAgICAgICAgICAgICAgICAgKih3cHRfbWFjQWRkciopcEFkZHIyLCAmdWNTdGFJZCApOyAKKyAgICAgICAgICAgICAgICAgICBpZiAoV0RJX1NUQVRVU19TVUNDRVNTID09IHdkaVN0YXR1cykKKyAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAvL0ZvdW5kIHNlbGYgU3RhIGluZGV4LgorICAgICAgICAgICAgICAgICAgICAgV0RJX1N0YVN0cnVjdCogcFNUQVRhYmxlID0gKFdESV9TdGFTdHJ1Y3QqKSBwV0RJQ3R4LT5zdGFUYWJsZTsKKyAgICAgICAgICAgICAgICAgICAgIHdwdF91aW50OCAgICAgICAgICAgICAgICAgYnNzSWR4ICA9IDA7CisKKyAgICAgICAgICAgICAgICAgICAgIHBCU1NTZXMgPSBOVUxMOworICAgICAgICAgICAgICAgICAgICAgLy9Jbml0aWFsaXplIFdESSBzdGF0dXMgdG8gZXJyb3IuCisgICAgICAgICAgICAgICAgICAgICB3ZGlTdGF0dXMgPSBXRElfU1RBVFVTX0VfTk9UX0FMTE9XRUQ7CisKKyAgICAgICAgICAgICAgICAgICAgIC8vQ2hlY2sgaWYgaXRzIEJTU0lkeCBpcyB2YWxpZC4KKyAgICAgICAgICAgICAgICAgICAgIGlmIChwU1RBVGFibGVbdWNTdGFJZF0uYnNzSWR4ICE9IFdESV9CU1NfSU5WQUxJRF9JRFgpIAorICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAvL1VzZSBCU1NJZHggdG8gZ2V0IHRoZSBhc3NvY2lhdGlvbiBzZXF1ZW5jZSBhbmQgdXNlCisgICAgICAgICAgICAgICAgICAgICAgIC8vbWFjQnNzSWQgdG8gZ2V0IHRoZSBwZWVyTWFjIEFkZHJlc3MoTWFjQlNTSUQpLgorICAgICAgICAgICAgICAgICAgICAgICBic3NJZHggPSBXRElfRmluZEFzc29jU2Vzc2lvbkJ5QlNTSWR4KCBwV0RJQ3R4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNUQVRhYmxlW3VjU3RhSWRdLmJzc0lkeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICZwQlNTU2VzKTsKKworICAgICAgICAgICAgICAgICAgICAgICBpZiAoIE5VTEwgIT0gcEJTU1NlcyApCisgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAvL0dldCBzdGFJZCBmcm9tIHRoZSBwZWVyTWFjLiAKKyAgICAgICAgICAgICAgICAgICAgICAgICB3ZGlTdGF0dXMgPSBXRElfU1RBVGFibGVGaW5kU3RhaWRCeUFkZHIoIHBXRElDdHgsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQlNTU2VzLT5tYWNCU1NJRCwgJnVjU3RhSWQgKTsgCisgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIC8vd2RpU3RhdHVzIHdpbGwgYmUgc3VjY2VzcyBpZiBpdCBmb3VuZCB2YWxpZCBwZWVyU3RhSWR4CisgICAgICAgICAgICAgICAvL090aGVyd2lzZSByZXR1cm4gZmFpbHVyZS4KKyAgICAgICAgICAgICAgIGlmKFdESV9TVEFUVVNfU1VDQ0VTUyAhPSB3ZGlTdGF0dXMgKQorICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICByZXR1cm4gV0RJX1NUQVRVU19FX05PVF9BTExPV0VEOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgIH0KKyAgICAgICAgICAgfSAKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLy8gRm9yIGJjYXN0IGZyYW1lcyB1c2UgdGhlIGJjYXN0IHN0YXRpb24gaW5kZXgKKyAgICAgICAgICAgICAgd3B0X3VpbnQ4IGJzc1Nlc3NJZHg7CisKKyAgICAgICAgICAgICAgLy8gR2V0IHRoZSBzdGF0aW9uIGluZGV4IGZvciBBRERSMiwgd2hpY2ggc2hvdWxkIGJlIHRoZSBzZWxmIE1BQyBhZGRyCisgICAgICAgICAgICAgIHdkaVN0YXR1cyA9IFdESV9TVEFUYWJsZUZpbmRTdGFpZEJ5QWRkciggcFdESUN0eCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKih3cHRfbWFjQWRkciopcEFkZHIyLCAmdWNTdGFJZCApOyAKKyAgICAgICAgICAgICAgaWYgKFdESV9TVEFUVVNfU1VDQ0VTUyAhPSB3ZGlTdGF0dXMpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gV0RJX1NUQVRVU19FX05PVF9BTExPV0VEOworICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgLy8gR2V0IHRoZSBCc3MgSW5kZXggcmVsYXRlZCB0byB0aGUgc3RhSWQKKyAgICAgICAgICAgICAgYnNzU2Vzc0lkeCA9IHBTdGFbdWNTdGFJZF0uYnNzSWR4OworCisgICAgICAgICAgICAgIC8vIEdldCB0aGUgYnJvYWRjYXN0IHN0YXRpb24gaW5kZXggZm9yIHRoaXMgYnNzCisgICAgICAgICAgICAgICh2b2lkKSBXRElfRmluZEFzc29jU2Vzc2lvbkJ5QlNTSWR4KCBwV0RJQ3R4LCBic3NTZXNzSWR4LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwQlNTU2VzICk7IAorICAgICAgICAgICAgICBpZiAoTlVMTCA9PSBwQlNTU2VzKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gc2Vzc2lvbiBub3QgZm91bmQgPyE/CisgICAgICAgICAgICAgICAgcmV0dXJuIFdESV9TVEFUVVNfRV9GQUlMVVJFOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIHVjU3RhSWQgPSBwQlNTU2VzLT5iY2FzdFN0YUlkeDsKKyAgICAgICAgICAgfQorICAgICAgICAgfQorCisgICAgICAgIFdQQUxfVFJBQ0UoZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfSU5GTywiU3RhSWQ6JWQgYW5kIHVjVHhGbGFnOiUwMngiLCB1Y1N0YUlkLCB1Y1R4RmxhZyk7CisKKyAgICAgICAgcEJkLT5zdGFJbmRleCA9IHVjU3RhSWQ7CisgICAgICAgIAorICAgICAgICAqc3RhSW5kZXggPSB1Y1N0YUlkOworCisgICAgICAgIHBTdGEgKz0gdWNTdGFJZDsgIC8vIEdvIHRvIHRoZSBjdXJyZXNwb25kaW5nIHN0YXRpb24ncyBzdGF0aW9uIHRhYmxlCisKKyAgICAgICAgaWYodWNUeXBlID09IFdESV9NQUNfTUdNVF9GUkFNRSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKHVjVW5pY2FzdERzdCkgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogSWYgbm8gYWNrIGlzIHJlcXVlc3RlZCB1c2UgdGhlIGJjYXN0IHF1ZXVlICovCisgICAgICAgICAgICAgICAgaWYgKHVjVHhGbGFnICYgV0RJX1VTRV9OT19BQ0tfUkVRVUVTVEVEX01BU0spIAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcEJkLT5xdWV1ZUlkID0gQlRRTV9RVUVVRV9TRUxGX1NUQV9CQ0FTVF9NR01UOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBBc3NpZ25pbmcgUXVldWUgSWQgY29uZmlndXJlZCB0byBBY2sgKi8gCisgICAgICAgICAgICAgICAgICAgIHBCZC0+cXVldWVJZCA9IEJUUU1fUVVFVUVfU0VMRl9TVEFfVUNBU1RfTUdNVDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IAorICAgICAgICAgICAgZWxzZSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBc3NpZ25pbmcgdG8gUXVldWUgSWQgY29uZmlndXJlZCB0byBObyBBY2sgKi8gCisgICAgICAgICAgICAgICAgcEJkLT5xdWV1ZUlkID0gQlRRTV9RVUVVRV9TRUxGX1NUQV9CQ0FTVF9NR01UOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZih1Y0lzUk1GICYmIHBTdGEtPnJtZkVuYWJsZWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcEJkLT5kcHVORSA9ICF1Y1Byb3RNZ210RnJhbWU7CisgICAgICAgICAgICAgICAgcEJkLT5ybWYgPSAxOworICAgICAgICAgICAgICAgIGlmKCF1Y1VuaWNhc3REc3QpCisgICAgICAgICAgICAgICAgICAgIHBCZC0+ZHB1RGVzY0lkeCA9IHBTdGEtPmJjYXN0TWdtdERwdUluZGV4OyAvKiBJR1RLICovCisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICBwQmQtPmRwdURlc2NJZHggPSBwU3RhLT5kcHVJbmRleDsgLyogUFRLICovCisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcEJkLT5kcHVORSA9IFdESV9OT19FTkNSWVBUSU9OX0VOQUJMRUQ7ICAKKyAgICAgICAgICAgICAgICBwQmQtPnJtZiA9IDA7CisgICAgICAgICAgICAgICAgcEJkLT5kcHVEZXNjSWR4ID0gcFN0YS0+ZHB1SW5kZXg7IC8qIFBUSyBmb3IgYm90aCB1L21jYXN0IG1nbXQgZnJhbWVzICovCisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvKiBkYXRhIGZyYW1lcyAqLworICAgICAgICAgICAgLyogVElELT5RSUQgaXMgb25lLXRvLW9uZSBtYXBwaW5nLCB0aGUgc2FtZSB3YXkgYXMgZm9sbG93ZWQgaW4gSC9XICovCisgICAgICAgICAgICB3cHRfdWludDggcXVldWVJZCA9IDA7CisKKyAgIAorICAgICAgICAgICAgV0RJX1NUQVRhYmxlR2V0U3RhVHlwZShwV0RJQ3R4LCB1Y1N0YUlkLCAmdWNTVEFUeXBlKTsKKyAgICAgICAgICAgIGlmKCF1Y1VuaWNhc3REc3QpCisgICAgICAgICAgICAgICAgcEJkLT5xdWV1ZUlkID0gQlRRTV9RSUQwOworI2lmbmRlZiBIQUxfU0VMRl9TVEFfUEVSX0JTUworICAgICAgICAgICAgZWxzZSBpZiggdWNVbmljYXN0RHN0ICYmICh1Y1N0YUlkID09IHBXRElDdHgtPnVjU2VsZlN0YUlkKSkKKyAgICAgICAgICAgICAgICBwQmQtPnF1ZXVlSWQgPSBCVFFNX1FVRVVFX1NFTEZfU1RBX1VDQVNUX0RBVEE7CisjZWxzZQorICAgICAgICAgICAgZWxzZSBpZiggdWNVbmljYXN0RHN0ICYmICh1Y1NUQVR5cGUgPT0gV0RJX1NUQV9FTlRSWV9TRUxGKSkKKyAgICAgICAgICAgICAgICBwQmQtPnF1ZXVlSWQgPSBCVFFNX1FVRVVFX1NFTEZfU1RBX1VDQVNUX0RBVEE7CisjZW5kaWYKKyAgICAgICAgICAgIGVsc2UgaWYgKHBTdGEtPnFvc0VuYWJsZWQpIAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFdESV9CbXVHZXRRaWRGb3JRT1NUaWQoIHVjVGlkLCAmcXVldWVJZCk7IAorICAgICAgICAgICAgICAgIHBCZC0+cXVldWVJZCA9ICh3cHRfdWludDMyKSBxdWV1ZUlkOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHBCZC0+cXVldWVJZCA9IEJUUU1fUVVFVUVfVFhfblFPUzsKKworICAgICAgICAgICAgaWYodWNVbmljYXN0RHN0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHBCZC0+ZHB1RGVzY0lkeCA9IHBTdGEtPmRwdUluZGV4OyAvKnVuaWNhc3QgZGF0YSBmcmFtZXM6IFBUSyovCisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcEJkLT5kcHVEZXNjSWR4ID0gcFN0YS0+YmNhc3REcHVJbmRleDsgLyogbWNhc3QgZGF0YSBmcmFt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dWludDggCitXRElfUnhCRF9HZXRGcmFtZVR5cGVTdWJUeXBlCisoCisgICAgdm9pZCogX3B2QkRIZWFkZXIsIAorICAgIHdwdF91aW50MTYgdXNGcm1DdHJsCispCit7CisgICAgV0RJX1J4QmRUeXBlKiAgICBwUnhCZCA9IChXRElfUnhCZFR5cGUqKSBfcHZCREhlYWRlcjsKKyAgICB3cHRfdWludDggICAgICAgIHR5cGVTdWJUeXBlOworICAgIFdESV9NYWNGcmFtZUN0bCAgd2RpRnJtQ3RsOyAKKyAgICAKKyAgICBpZiAocFJ4QmQtPmZ0ICE9IFdESV9SWF9CRF9GVF9ET05FKQorICAgIHsKKyAgICAgICAgaWYgKHBSeEJkLT5hc2YpCisgICAgICAgIHsKKyAgICAgICAgICAgIHR5cGVTdWJUeXBlID0gKFdESV9NQUNfREFUQV9GUkFNRSA8PCBXRElfRlJBTUVfVFlQRV9PRkZTRVQpIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXRElfTUFDX0RBVEFfUU9TX0RBVEE7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgIHdwYWxNZW1vcnlDb3B5KCZ3ZGlGcm1DdGwsICZ1c0ZybUN0cmwsIHNpemVvZih3ZGlGcm1DdGwpKTsgCisgICAgICAgICAgIHR5cGVTdWJUeXBlID0gKHdkaUZybUN0bC50eXBlIDw8IFdESV9GUkFNRV9UWVBFX09GRlNFVCkgfAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkaUZybUN0bC5zdWJUeXBlOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHdwYWxNZW1vcnlDb3B5KCZ3ZGlGcm1DdGwsICZ1c0ZybUN0cmwsIHNpemVvZih3ZGlGcm1DdGwpKTsgCisgICAgICAgIHR5cGVTdWJUeXBlID0gKHdkaUZybUN0bC50eXBlIDw8IFdESV9GUkFNRV9UWVBFX09GRlNFVCkgfAorICAgICAgICAgICAgICAgICAgICAgICAgd2RpRnJtQ3RsLnN1YlR5cGU7CisgICAgfQorICAgIAorICAgIHJldHVybiB0eXBlU3ViVHlwZTsKK30vKldESV9SeEJEX0dldEZyYW1lVHlwZVN1YlR5cGUqLworCisvKioKKyBAYnJpZWYgV0RJX1N3YXBSeEJkIHN3YXBzIHRoZSBSWCBCRC4KKworICAKKyBAcGFyYW0gcEJkIC0gcG9pbnRlciB0byB0aGUgQkQgKGluL291dCkKKyAgCisgQHJldHVybiBOb25lCisqLwordm9pZCAKK1dESV9Td2FwUnhCZCh3cHRfdWludDggKnBCZCkKK3sKKyNpZm5kZWYgV0RJX0JJR19CWVRFX0VORElBTgorICAgIFdESV9Td2FwQnl0ZXMocEJkICwgV0RJX1JYX0JEX0hFQURFUl9TSVpFKTsKKyNlbmRpZgorfS8qV0RJX1N3YXBSeEJkKi8KKworCisvKioKKyBAYnJpZWYgV0RJX1N3YXBUeEJkIC0gU3dhcHMgdGhlIFRYIEJECisgIAorIEBwYXJhbSAgcEJkIC0gcG9pbnRlciB0byB0aGUgQkQgKGluL291dCkKKyAgCisgQHJldHVybiAgIG5vbmUKKyovCit2b2lkIAorV0RJX1N3YXBUeEJkKHdwdF91aW50OCAqcEJkKQoreworI2lmbmRlZiBXRElfQklHX0JZVEVfRU5ESUFOCisgICAgV0RJX1N3YXBCeXRlcyhwQmQgLCBXRElfVFhfQkRfSEVBREVSX1NJWkUpOworI2VuZGlmCit9LypXRElfU3dhcFR4QmQqLworCisvKiEgVE8gRE86ICAtIGNoZWNrIGlmIHdlIHN0aWxsIG5lZWQgdGhpcyBmb3IgUklWQSovCisvKioKKyBAYnJpZWYgV0RJX1J4QW1zZHVCZEZpeCAtIGZpeCBmb3IgSFcgaXNzdWUgZm9yIEFNU0RVIAorCisKKyBAcGFyYW0gICBwV0RJQ3R4OiAgICAgICBDb250ZXh0IHRvIHRoZSBXREkKKyAgICAgICAgICBwQkRIZWFkZXIgLSBwb2ludGVyIHRvIHRoZSBCRCBoZWFkZXIKKworIEByZXR1cm4gTm9uZQorKi8KK3ZvaWQgCitXRElfUnhBbXNkdUJkRml4CisoCisgICAgV0RJX0NvbnRyb2xCbG9ja1R5cGUqICBwV0RJQ3R4LAorICAgIHZvaWQqICAgICAgICAgICAgICAgICBfcHZCREhlYWRlcgorKQoreworICAgIFdESV9SeEJkVHlwZSogICAgICAgICAgcFJ4QmQgICA9IChXRElfUnhCZFR5cGUqKSBfcHZCREhlYWRlcjsKKyAgICB3cHRfdWludDMyICpwTW9kQmQsICpwTWFza0JkLCAqcEZpcnN0QmQsIGk7CisgICAgLyotIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSovCisKKyAgICBpZiAocFJ4QmQtPmFzZikKKyAgICB7CisgICAgICAgIGlmIChwUnhCZC0+c3liRnJhbWVJZHggPT0gMCkKKyAgICAgICAgeworICAgICAgICAgICAgLy9jb3B5IHRoZSBCRCBvZiBmaXJzdCBBTVNEVQorICAgICAgICAgICAgcFdESUN0eC0+d2RpUnhBbXNkdUZpcnN0QmRDYWNoZSA9ICpwUnhCZDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIHBNb2RCZCAgID0gKHdwdF91aW50MzIqKXBSeEJkOworICAgICAgICAgICAgcE1hc2tCZCAgPSAod3B0X3VpbnQzMiopJnBXRElDdHgtPndkaVJ4QW1zZHVCZEZpeE1hc2s7CisgICAgICAgICAgICBwRmlyc3RCZCA9ICh3cHRfdWludDMyKikmcFdESUN0eC0+d2RpUnhBbXNkdUZpcnN0QmRDYWNoZTsKKworICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHNpemVvZihXRElfUnhCZFR5cGUpL3NpemVvZih3cHRfdWludDMyICopOyBpKyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgL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KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgICBXIEwgQSBOIF8gUSBDIFQgXyBXIEQgSSBfIFMgVCBBIC4gQworCisgIE9WRVJWSUVXOgorCisgIFRoaXMgc29mdHdhcmUgdW5pdCBob2xkcyB0aGUgaW1wbGVtZW50YXRpb24gb2YgdGhlIFdMQU4gRGV2aWNlIEFic3RyYWN0aW9uICAgICAKKyAgTGF5ZXIgU3RhdGlvbiBUYWJsZSBNYW5hZ2VtZW50IEVudGl0eS4KKworICBUaGUgZnVuY3Rpb25zIGV4dGVybmFsaXplZCBieSB0aGlzIG1vZHVsZSBhcmUgaW50ZXJuYWwgQVBJcyBmb3IgREFMIENvcmUKKyAgYW5kIGNhbiBvbmx5IGJlIGNhbGxlZCBieSBpdC4gCisKKyAgREVQRU5ERU5DSUVTOgorCisgIEFyZSBsaXN0ZWQgZm9yIGVhY2ggQVBJIGJlbG93LgorCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICBFRElUIEhJU1RPUlkgRk9SIEZJTEUKKworCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLgorICBOb3RpY2UgdGhhdCBjaGFuZ2VzIGFyZSBsaXN0ZWQgaW4gcmV2ZXJzZSBjaHJvbm9sb2dpY2FsIG9yZGVyLgorCisKKyAgICRIZWFkZXIkJERhdGVUaW1lJCRBdXRob3IkCisKKworICB3aGVuICAgICAgICB3aG8gICAgIHdoYXQsIHdoZ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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwd2RpUGFyYW0tPnN0YU1hY0FkZHIpKQorICAgIHsKKyAgICAgICBXUEFMX1RSQUNFKGVXTEFOX01PRFVMRV9EQUxfQ1RSTCwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiRmFpbGVkIHRvIHVwZGF0ZSBzdGF0aW9uIGVudHJ5IC0gaW50ZXJuYWwgZmFpbHVyZSIpOworICAgICAgIFdESV9BU1NFUlQoMCk7CisgICAgICAgcmV0dXJuIFdESV9TVEFUVVNfRV9GQUlMVVJFOyAKKyAgICB9CisKKyAgICAvKiBOb3cgdXBkYXRlIHRoZSBTVEEgZW50cnkgd2l0aCB0aGUgbmV3IEJTU0lEIGFkZHJlc3MgKi8KKyAgICBpZihXRElfU1RBVFVTX1NVQ0NFU1MgIT0gV0RJX1NUQVRhYmxlU2V0QlNTSUQoIHBXRElDdHgsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1Y1NUQUlkeCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB3ZGlQYXJhbS0+bWFjQlNTSUQpKQorICAgIHsKKyAgICAgICBXUEFMX1RSQUNFKGVXTEFOX01PRFVMRV9EQUxfQ1RSTCwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiRmFpbGVkIHRvIHVwZGF0ZSBzdGF0aW9uIGVudHJ5IC0gaW50ZXJuYWwgZmFpbHVyZSIpOworICAgICAgIFdESV9BU1NFUlQoMCk7CisgICAgICAgcmV0dXJuIFdESV9TVEFUVVNfRV9GQUlMVVJFOyAKKyAgICB9CisKKyAgICByZXR1cm4gV0RJX1NUQVRVU19TVUNDRVNTOworfS8qV0RJX0FkZFN0YSovCisKKy8qKgorIEBicmllZiBXRElfU1RBVGFibGVEZWxTdGEgLSB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W9ucyApKQorICAgIHsKKyAgICAgICBXUEFMX1RSQUNFKGVXTEFOX01PRFVMRV9EQUxfQ1RSTCwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiU1RBIElkIGludmFsaWQgb24gRGVsIFNUQSAtIGludGVybmFsIGZhaWx1cmUiKTsKKyAgICAgICBXRElfQVNTRVJUKDApOworICAgICAgIHJldHVybiBXRElfU1RBVFVTX0VfRkFJTFVSRTsgCisgICAgfQorICAgIAorICAgIHdwYWxNZW1vcnlaZXJvKCZwU1RBVGFibGVbdWNTVEFJZHhdLCBzaXplb2YocFNUQVRhYmxlW3VjU1RBSWR4XSkpOyAKKyAgICBwU1RBVGFibGUtPnZhbGlkID0gMDsgCisgICAgcmV0dXJuIFdESV9TVEFUVVNfU1VDQ0VTUzsKK30vKldESV9TVEFUYWJsZURlbFN0YSovCisKKy8qKgorIEBicmllZiBXRElfU1RBVGFibGVCU1NEZWxTdGEgLSBGdW5jdGlvbiB0byBEZWxldGUgU3RhdGlvbnMgaW4gdGhpcyBCU1MKKworIAorIEBwYXJhbSAgcFdESUN0eDogICAgICAgICBwb2ludGVyIHRvIHRoZSBXTEFOIERBTCBjb250ZXh0IAorICAgICAgICAgdWNCU1NJZHg6ICAgICAgICBCU1MgaW5kZXggCisgIAorIEBzZWUKKyBAcmV0dXJuIFJlc3VsdCBvZiB0aGUgZnVuY3Rpb24gY2FsbAorKi8KK1dESV9TdGF0dXMKK1dESV9TVEFUYWJsZUJTU0RlbFN0YQorKAorICAgIFdESV9Db250cm9sQmxvY2tUeXBlKiAgcFdESUN0eCwKKyAgICB3cHRfdWludDggICAgICAgICAgICAgIHVjQlNTSWR4CispCit7CisgICAgV0RJX1N0YVN0cnVjdCogICBwU1RBVGFibGUgPSAoV0RJX1N0YVN0cnVjdCopIHBXRElDdHgtPnN0YVRhYmxlOworICAgIHdwdF91aW50OCAgICAgICAgdWNTVEFJZHg7CisgICAgLyotIC0gLSAt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AgcmV0dXJuICgoKigod3B0X3VpbnQxNiAqKSAmYWRkcjFbNF0pID09ICooKHdwdF91aW50MTYgKikgJmFkZHIyWzRdKSkgJiYKKyAgICAgICAgICAgICgqKCh3cHRfdWludDE2ICopICZhZGRyMVsyXSkgPT0gKigod3B0X3VpbnQxNiAqKSAmYWRkcjJbMl0pKSAmJgorICAgICAgICAgICAgKCooKHdwdF91aW50MTYgKikgJmFkZHIxWzBdKSA9PSAqKCh3cHRfdWludDE2ICopICZhZGRyMlswXSkpKTsKKyAgICB9ZWxzZXsKKyAgICAgICAgcmV0dXJuICggKGFkZHIxWzVdPT1hZGRyMls1XSkmJgorICAgICAgICAgICAgKGFkZHIxWzRdPT1hZGRyMls0XSkmJgorICAgICAgICAgICAgKGFkZHIxWzNdPT1hZGRyMlszXSkmJgorICAgICAgICAgICAgKGFkZHIxWzJdPT1hZGRyMlsyXSkmJgorICAgICAgICAgICAgKGFkZHIxWzFdPT1hZGRyMlsxXSkmJgorICAgICAgICAgICAgKGFkZHIxWzBdPT1hZGRyMlswXSkpOworICAgIH0KKyNlbHNlCisgICAgICAgICByZXR1cm4gKCAoYWRkcjFbMF09PWFkZHIyWzBdKSYmCisgICAgICAgICAgICAoYWRkcjFbMV09PWFkZHIyWzFdKSYmCisgICAgICAgICAgICAoYWRkcjFbMl09PWFkZHIyWzJdKSYmCisgICAgICAgICAgICAoYWRkcjFbM109PWFkZHIyWzNdKSYmCisgICAgICAgICAgICAoYWRkcjFbNF09PWFkZHIyWzRdKSYmCisgICAgICAgICAgICAoYWRkcjFbNV09PWFkZHIyWzVdKSk7CisjZW5kaWYKK30vKldESV9Db21wYXJlTWFjQWRkciovCisKKworLyoqCisgQGJyaWVmIFdESV9TVEFUYWJsZUZpbmRTdGFpZEJ5QWRkciAtIEdpdmVuIGEgc3RhdGlvbiBtYWMgYWRkcmVzcywgc2VhcmNoCisgICAgICAgIGZvciB0aGUgY29ycmVzcG9uZGluZyBzdGF0aW9uIGluZGV4IGZyb20gdGhlIFN0YXRpb24gVGFibGUuCisgCisgQHBhcmFtICBwV0RJQ3R4OiAgV0RJIENvbnRleHQgcG9pbnRlcgorICAgICAgICAgc3RhQWRkcjogIHN0YXRpb24gYWRkcmVzcworICAgICAgICAgcHVjU3RhSWQ6IG91dHB1dCBzdGF0aW9uIGlkIAorICAKKyBAc2VlCisgQHJldHVybiBSZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGwKKyovCitXRElfU3RhdHVzCitXRElfU1RBVGFibGVGaW5kU3RhaWRCeUFkZHIKKygKKyAgICBXRElfQ29udHJvbEJsb2NrVHlwZSogIHBXRElDdHgsIAorICAgIHdwdF9tYWNBZGRyICAgICAgICAgICAgc3RhQWRkciwgCisgICAgd3B0X3VpbnQ4KiAgICAgICAgICAgICBwdWNTdGFJZAorKQoreworICAgIFdESV9TdGF0dXMgd2RpU3RhdHVzID0gV0RJX1NUQVRVU19FX0ZBSUxVUkU7CisgICAgd3B0X3VpbnQ4IGk7CisgICAgV0RJX1N0YVN0cnVjdCogcFNUQVRhYmxlID0gKFdESV9TdGFTdHJ1Y3QqKSBwV0RJQ3R4LT5zdGFUYWJsZTsKKworICAgIGZvciAoaT0wOyBpIDwgcFdESUN0eC0+dWNNYXhTdGF0aW9uczsgaSsrLCBwU1RBVGFibGUrKykKKyAgICB7CisgICAgICAgIGlmICggKHBTVEFUYWJsZS0+dmFsaWQgPT0gMSkgJiYgKFdESV9Db21wYXJlTWFjQWRkcihwU1RBVGFibGUtPnN0YUFkZHIsIHN0YUFkZHIpKSApCisgICAgICAgIHsKKyAgICAgICAgICAgICpwdWNTdGFJZCA9IGk7CisgICAgICAgICAgICB3ZGlTdGF0dXMgPSBXRElfU1RBVFVTX1NVQ0NFU1M7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gd2RpU3RhdHVzOworfS8qV0RJX1NUQVRhYmxlRmluZFN0YWlkQnlBZGRyKi8KKworLyoqCisgQGJyaWVmI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ludXggRm91bmRhdGlvbi4KKyAqLworCisjaWYgIWRlZmluZWQoIF9fV0xBTl9RQ1RfV1RJX0RTX0ggKQorI2RlZmluZSBfX1dMQU5fUUNUX1dUSV9EU19ICisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICAgICAKKyAqICAgICAgIFxmaWxlICB3bGFuX3FjdF93ZGlfZHMuaAorICogICAgICAgICAgCisgKiAgICAgICBcYnJpZWYgZGVmaW5lIERhdGFzZXJ2aWNlIEFQSSAKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICogV0xBTiBEZXZpY2UgQWJzdHJhY3Rpb24gbGF5ZXIgRXh0ZXJuYWwgQVBJIGZvciBEYXRhc2VydmljZQorICogREVTQ1JJUFRJT04KKyAqICBUaGlzIGZpbGUgY29udGFpbnMgdGhlIGV4dGVybmFsIEFQSSBleHBvc2VkIGJ5IHRoZSAKKyAqICAgd2xhbiBkZXZpY2UgYWJzdGFyY3Rpb24gbGF5ZXIgbW9kdWxlLgorICoKKyAqLworCisKKyNpbmNsdWRlICJ3bGFuX3FjdF9wYWxfdHlwZS5oIgorI2luY2x1ZGUgIndsYW5fcWN0X3BhbF9zdGF0dXMuaCIKKyNpbmNsdWRlICJ3bGFuX3FjdF9wYWxfcGFja2V0LmgiCisjaW5jbHVkZSAid2xhbl9xY3Rfd2RpLmgiCisgICAKKwordHlwZWRlZiBzdHJ1Y3QgCit7CisgICB3cHRfdWludDMyIHR4RmxhZ3M7CisgICB3cHRfdWludDggYWM7CisgICB3cHRfdWludDggaXNFYXBvbDoxOyAvLzAgLSBub3QgZWFwb2wgMSAtIGVhcG9sCisgICB3cHRfdWludDggaXNXYWk6MTsgICAvL1dBUEkgMCAtIG5vdCBXQUkgMSBXQUkgCisgICB3cHRfdWludDggZmRpc2FibGVGcm1YbHQ6MTsgICAvLzAgLSBMZXQgQURVIGRvIEZULiAxI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BXRElfRFNfR2V0UmVzZXJ2ZWRSZXNDb3VudFBlclNUQSh2b2lkICpwQ29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0RJX1Jlc1Bvb2xUeXBlIHdkaVJlc1Bvb2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdwdF91aW50OCBzdGFJZCk7CisKKy8qIERBTCBBREQgU1RBIGludG8gbWVtUG9vbAorICogUGFyYW1ldGVyczoKKyAqICBwQ29udGV4dDpDb29raWUgdGhhdCBzaG91bGQgYmUgcGFzc2VkIGJhY2sgdG8gdGhlIGNhbGxlciBhbG9uZyB3aXRoIHRoZSBjYWxsYmFjay4KKyAqICBzdGFJZDogU1RBIElECisgKiBSZXR1cm4gVmFsdWU6IFNVQ0NFU1Mgb3IgRkFJTAorICoKKyAqLworV0RJX1N0YXR1cyBXRElfRFNfQWRkU1RBTWVtUG9vbCh2b2lkICpwQ29udGV4dCwgd3B0X3VpbnQ4IHN0YUluZGV4KTsKKworLyogREFMIFJlbW92ZSBTVEEgZnJvbSBtZW1Qb29sCisgKiBQYXJhbWV0ZXJzOgorICogIHBDb250ZXh0OkNvb2tpZSB0aGF0IHNob3VsZCBiZSBwYXNzZWQgYmFjayB0byB0aGUgY2FsbGVyIGFsb25nIHdpdGggdGhlIGNhbGxiYWNrLgorICogIHN0YUlkOiBTVEEgSUQKKyAqIFJldHVybiBWYWx1ZTogU1VDQ0VTUyBvciBGQUlMCisgKgorICovCitXRElfU3RhdHVzIFdESV9EU19EZWxTVEFNZW1Qb29sKHZvaWQgKnBDb250ZXh0LCB3cHRfdWludDggc3RhSW5kZXgpOworCisvKiBEQUwgU2V0IFNUQSBpbmRleCBhc3NvY2lhdGVkIHdpdGggQlNTIGluZGV4LiAKKyAqIFBhcmFtZXRlcnM6CisgKiAgcENvbnRleHQ6Q29va2llIHRoYXQgc2hvdWxkIGJ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GVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmICFkZWZpbmVkKCBfX1dMQU5fUUNUX1dESV9EU19JX0ggKQorI2RlZmluZSBfX1dMQU5fUUNUX1dESV9EU19JX0gKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAqICAgICAgIFxmaWxlICB3bGFuX3FjdF93ZGlfZHNfaS5oCisgKgorICogICAgICAgXGJyaWVmIGRlZmluZSBEYXRhc2VydmljZSBBUEkKKyAqCisgKiBXTEFOIERldmljZSBBYnN0cmFjdGlvbiBsYXllciBFeHRlcm5hbCBBUEkgZm9yIERhdGFzZXJ2aWNlCisgKiBERVNDUklQVElPTgorICogICBUaGlzIGZpbGUgY29udGFpbnMgdGhlIGV4dGVybmFsIEFQSSBleHBvc2VkIGJ5IHRoZQorICogICB3bGFuIGRldmljZSBhYnN0YXJjdGlvbiBsYXllciBtb2R1bGUuCisgKgorICovCisKKyNpbmNsdWRlICJ3bGFuX3FjdF9wYWxfdHlwZS5oIgorI2luY2x1ZGUgIndsYW5fcWN0X3BhbF9zdGF0dXMuaCIKKyNpbmNsdWRlICJ3bGFuX3FjdF9wYWxfcGFja2V0LmgiCisjaW5jbHVkZSAid2xhbl9xY3RfcGFsX3RyYWNlLmgiCisjaW5jbHVkZSAid2xhbl9xY3Rfd2RpX2RzLmgiCisjaW5jbHVkZSAid2xhbl9xY3RfZHhlLmgiCisjaW5jbHVkZSAid2xhbl9oYWxfbXNnLmgiCisKKyNkZWZpbmUgV0RJX0RTX01BWF9DSFVOS19TSVpFIDEyOAorI2RlZmluZSBXRElfODAyXzExX01BWF9IRUFERVJf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FQURFUl9MRU4gICAgICAgICAgICAgMTQKKy8qIE9mZnNldCBvZiBEQSBmaWVsZCBpbiBhIDgwMi4zIGhlYWRlciovCisjZGVmaW5lICBXRElfODAyXzNfSEVBREVSX0RBX09GRlNFVCAgICAgICAgMAorLyo4MDIuMTEgaGVhZGVyIGRlZmluaXRpb25zIC0gaGVhZGVyIGxlbiB3aXRob3V0IFFPUyBjdHJsIGZpZWxkKi8KKyNkZWZpbmUgIFdESV84MDJfMTFfSEVBREVSX0xFTiAgICAgICAgICAgIDI0CisvKjgwMi4xMSBoZWFkZXIgbGVuZ3RoICsgUU9TIGN0cmwgZmllbGQqLworI2RlZmluZSAgV0RJX01QRFVfSEVBREVSX0xFTiAgICAgICAgICAgICAgMjYKKy8qODAyLjExIGhlYWRlciBkZWZpbml0aW9ucyovCisjZGVmaW5lICBXRElfODAyXzExX01BWF9IRUFERVJfTEVOICAgICAgICA0MAorLyo4MDIuMTEgaGVhZGVyIGRlZmluaXRpb25zIC0gcW9zIGN0cmwgZmllbGQgbGVuKi8KKyNkZWZpbmUgIFdESV84MDJfMTFfSEVBREVSX1FPU19DVEwgICAgICAgICAyCisvKjgwMi4xMSBBRERSNCBNQUMgYWRkciBmaWVsZCBsZW4gKi8KKyNkZWZpbmUgIFdESV84MDJfMTFfSEVBREVSX0FERFI0X0xFTiAgICAgICBXRElfTUFDX0FERFJfU0laRQorCisKKworCisKK3R5cGVkZWYgZW51bQoreworICAgRFRJX1RSQUNFX0xFVkVMX0ZBVEFMLAorICAgRFRJX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgRFRJX1RSQUNFX0xFVkVMX1dBUk4sCisgICBEVElfVFJBQ0VfTEVWRUxfSU5GTworCit9IERUSV9UUkFDRV9MRVZFTDsKKworV1BUX1NUQVRJQyBXUFRfSU5MSU5FIHZvaWQgRFRJX1RSQUNFICggRFRJX1RSQUNFX0xFVkVMIGxldmVsLCAuLi4pIHsgfTsKKworLyogISEhIE1BWCBOVU0gU1RBIGlzIG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Y3Rpb24gbGF5ZXIgRXh0ZXJuYWwgQVBJIGZvciBEYXRhc2VydmljZQorICogREVTQ1JJUFRJT04KKyAqICBUaGlzIGZpbGUgY29udGFpbnMgdGhlIGV4dGVybmFsIEFQSSBpbXBsZW1udGF0aW9uIGV4cG9zZWQgYnkgdGhlCisgKiAgIHdsYW4gZGV2aWNlIGFic3RhcmN0aW9uIGxheWVyIG1vZHVsZS4KKyAqCisgKi8KKworI2luY2x1ZGUgIndsYW5fcWN0X3dkaS5oIgorI2luY2x1ZGUgIndsYW5fcWN0X3dkaV9kcy5oIgorI2luY2x1ZGUgIndsYW5fcWN0X3dkaV9kc19pLmgiCisjaW5jbHVkZSAid2xhbl9xY3Rfd2RpX2R0cy5oIgorI2luY2x1ZGUgIndsYW5fcWN0X3dkaV9kcC5oIgorI2luY2x1ZGUgIndsYW5fcWN0X3BhbF90eXBlLmgiCisjaW5jbHVkZSAid2xhbl9xY3RfcGFsX3N0YXR1cy5oIgorI2luY2x1ZGUgIndsYW5fcWN0X3BhbF9hcGkuaCIKKyNpbmNsdWRlICJ3bGFuX3FjdF9wYWxfcGFja2V0LmgiCisKKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKgorIEZVTkNUSU9OICAgIFdESV9EU19QcmVwYXJlQkRIZWFkZXIKKworIERFU0NSSVBUSU9OCisgZnVuY3Rpb24gZm9yIHByZXBhcmluZyBCRCBoZWFkZXIgYmVmb3JlIEhBTCBwcm9jZXNzaW5nLgorCisgUEFSQU1FVEVSUworCisgSU4KK3BhbFBhY2tldDogICAgIFBBTCBwYWNrZXQgcG9pbnRlcgorCisKK1JFVFVSTiBWQUxVRQorTm8gcmV0dXJuLgorCitTSURFIEVGRkVDVFMKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCit2b2lkCitXR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3IgbWFuYWdpbmcgdGhlIEJEIGhlYWRlciBtZW1vcnkgcG9vbAorIFBBUkFNRVRFUlMKKworIElOCitXRElfRFNfQmRNZW1Qb29sVHlwZTogICAgIE1lbW9yeSBwb29sIHBvaW50ZXIKKworCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKgorICogQ3JlYXRlIGEgbWVtb3J5IHBvb2wgd2hpY2ggaXMgRE1BIGNhcGFiYWxlCisgKi8KK1dESV9TdGF0dXMgV0RJX0RTX01lbVBvb2xDcmVhdGUoV0RJX0RTX0JkTWVtUG9vbFR5cGUgKm1lbVBvb2wsIHdwdF91aW50OCBjaHVua1NpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cHRfdWludDggbnVtQ2h1bmtzKQoreworICB3cHRfdWludDggc3RhTG9vcDsKKworICAvL0FsbG9jYXRlIGFsbCB0aGUgbWF4IHNpemUgYW5kIGFsaWduIHRoZW0gdG8gYSBkb3VibGUgd29yZCBib3VuZGFyeS4gVGhlIGZpcnN0IDggYnl0ZXMgYXJlIGNvbnRyb2wgYnl0ZXMuCisgIG1lbVBvb2wtPm51bUNodW5rcyA9IDA7CisgIG1lbVBvb2wtPmNodW5rU2l6ZSA9IGNodW5rU2l6ZSArIDE2IC0gKGNodW5rU2l6ZSU4KTsKKyAgbWVtUG9vbC0+cFZpcnRCYXNlQWRkcmVzcyA9IHdwYWxEbWFNZW1vcnlBbGxvY2F0ZSgobnVtQ2h1bmtzICogbWVtUG9vbC0+Y2h1bmtTaXplKSwKKyAgICAgICAgICAmKG1lbVBvb2wtPnBQaHlzQmFzZUFkZHJlc3MpKTsKKworICBpZiggbWVtUG9vbC0+cFZpcnRCYXNlQWRkcmVzcyA9PSAwKQorICAgIHJldHVybiBXRElfU1RBVFVTX0VfRkFJTFVSRTsKKworICB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Xh0OworCisgIHJldHVybiAmcENsaWVudERhdGEtPmxvZ2dpbmdNYkNvbnRleHQubG9nZ2luZ1Nlc3Npb247Cit9CisKK3ZvaWQgV0RJX0RTX0xvZ2dpbmdNYkRlc3Ryb3koV0RJX0RTX0xvZ2dpbmdNYlR5cGUgKnBMb2dnaW5nTWFpbGJveCkKK3sKKyAgd3BhbERtYU1lbW9yeUZyZWUocExvZ2dpbmdNYWlsYm94LT5wTG9nZ2luZ01iVmlydEFkZHJlc3MpOworfQorCisvKgorICogQWxsb2NhdGUgY2h1bmsgbWVtb3J5CisgKi8KK1dQVF9TVEFUSUMgV1BUX0lOTElORSBpbnQgZmluZF9sZWFkaW5nX3plcm9fYW5kX3NldGJpdCh3cHRfdWludDMyICpiaXRtYXAsIHdwdF91aW50MzIgbWF4TnVtUG9vbCkKK3sKKyAgd3B0X3VpbnQzMiBpLGosIHdvcmQ7CisgIGludCByZXRfdmFsID0gLTE7CisKKyAgZm9yKGk9MDsgaSA8IChtYXhOdW1Qb29sLzMyICsgMSk7IGkrKyl7CisgICAgaiA9IDA7CisgICAgd29yZCA9IGJpdG1hcFtpXTsKKyAgICBmb3Ioaj0wOyBqPCAzMjsgaisrKXsKKyAgICAgIGlmKCh3b3JkICYgMSkgPT0gMCkgeworICAgICAgICBiaXRtYXBbaV0gfD0gKDEgPDwgaik7CisgICAgICAgIHJldHVybigoaTw8NSkgKyBqKTsKKyAgICAgIH0KKyAgICAgIHdvcmQgPj49IDE7CisgICAgfQorICB9CisgIHJldHVybiByZXRfdmFsOworfQorCit2b2lkICpXRElfRFNfTWVtUG9vbEFsbG9jKFdESV9EU19CZE1lbVBvb2xUeXBlICptZW1Qb29sLCB2b2lkICoqcFBoeXNBZGRyZXNzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdESV9SZXNQb29sVHlwZSB3ZGlSZXNQb29sKQoreworICB3cHRfdWludDMyIGluZGV4OworICB2b2lkICpwVmlydEFkZHJlc3M7CisgIHdwdF91aW50MzIgbWF4TnVtUG9vbDsKKyAgc3dpdGNoKHdkaVJlc1Bvb2wpCisgIHsKKyAgICBjYXNlIFdESV9NR01UX1BPT0xfSUQ6CisgICAgICBtYXhOdW1Qb29sID0gV0RJX0RTX0hJX1BSSV9SRVNfTlVNOworICAgICAgYnJlYWs7CisgICAgY2FzZSBXRElfREFUQV9QT09MX0lEOgorICAgICAgIG1heE51bVBvb2wgPSBXRElfRFNfTE9fUFJJX1JFU19OVU07CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgcmV0dXJuIE5VTEw7CisgIH0KKworICBpZihtYXhOdW1Qb29sID09IG1lbVBvb2wtPm51bUNodW5rcykKKyAgeworICAgICByZXR1cm4gTlVMTDsKKyAgfQorICAvL0ZpbmQgdGhlIGxlYWRpbmcgMCBpbiB0aGUgYWxsb2NhdGlvbiBiaXRtYXAKKworICBpZigoaW5kZXggPSBmaW5kX2xlYWRpbmdfemVyb19hbmRfc2V0Yml0KG1lbVBvb2wtPkFsbG9jYXRpb25CaXRtYXAsIG1heE51bVBvb2wpKSA9PSAtRVBFUk0pCisgIHsKKyAgICAgLy9EYmdCcmVha1BvaW50KCk7CisgICAgIERUSV9UUkFDRSggIERUSV9UUkFDRV9MRVZFTF9JTkZPLCAiV0RJX0RTX01lbVBvb2xBbGxvYzogaW5kZXg6JWQoTlVMTCksIG51bUNodW5rczolZCIsCisgICAgICAgICAgICAgICAgICBpbmRleCwgbWVtUG9vbC0+bnVtQ2h1bmtzICk7CisgICAgIHJldHVybiBOVUxMOworICB9CisgIG1lbVBvb2wtPm51bUNodW5rcysrOworICAvLyBUaGUgZmlyc3QgOCBieXRlcyBhcmUgcmVzZXJ2ZWQgZm9yIGludGVybmFsIHVzZSBmb3IgY29udHJvbCBiaXRzIGFuZCBoYXNoLgorICBwVmlydEFkZHJlc3MgID0gKHdwdF91aW50OCAqKW1lbVBvb2wtPnBWaXJ0QmFzZUFkZHJlc3MgKyAobWVtUG9vbC0+Y2h1bmtTaX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CisgIFdESV9EU19SeFBhY2tldENhbGxiYWNrIHBmblJ4UGFja2V0Q2FsbGJhY2ssCisgIFdESV9EU19UeEZsb3dDb250cm9sQ2FsbGJhY2sgcGZuVHhGbG93Q29udHJvbENhbGxiYWNrLAorICBXRElfRFNfUnhMb2dDYWxsYmFjayBwZm5SeExvZ0NhbGxiYWNrLAorICB2b2lkICpwQ2FsbGJhY2tDb250ZXh0KQoreworICBXRElfRFNfQ2xpZW50RGF0YVR5cGUgKnBDbGllbnREYXRhOworICB3cHRfdWludDggICAgICAgICAgICAgIGJzc0xvb3A7CisKKyAgLy8gRG8gU2FuaXR5IGNoZWNrcworICBpZiAoTlVMTCA9PSBwQ29udGV4dCB8fAorICAgICAgTlVMTCA9PSBwQ2FsbGJhY2tDb250ZXh0IHx8CisgICAgICBOVUxMID09IHBmblR4Q29tcGxldGVDYWxsYmFjayB8fAorICAgICAgTlVMTCA9PSBwZm5SeFBhY2tldENhbGxiYWNrIHx8CisgICAgICBOVUxMID09IHBmblR4Rmxvd0NvbnRyb2xDYWxsYmFjaykgeworICAgIHJldHVybiBXRElfU1RBVFVTX0VfRkFJTFVSRTsKKyAgfQorCisgIHBDbGllbnREYXRhID0gKFdESV9EU19DbGllbnREYXRhVHlwZSAqKVdESV9EU19HZXREYXRhcGF0aENvbnRleHQocENvbnRleHQpOworICBpZiAoTlVMTCA9PSBwQ2xpZW50RGF0YSkKKyAgeworICAgIHJldHVybiBXRElfU1RBVFVTX01FTV9GQUlMVVJFOworICB9CisKKyAgLy8gU3RvcmUgY2FsbGJhY2tzIGluIGNsaWVudCBzdHJ1Y3R1cmUKKyAgcENsaWVudERhdGEtPnBjb250ZXh0ID0gcENvbnRleHQ7CisgIHBDbGllbnREYXRhLT5yZWNlaXZlRnJhbWVDQiA9IHBmblJ4UGFja2V0Q2FsbGJhY2s7CisgIHBDbGllbnREYXRhLT50eENvbXBsZXRlQ0IgPSBwZm5UeENvbXBsZXRlQ2FsbGJhY2s7CisgIHBDbGllbn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3RhdHVzIFdESV9EU19UeFBhY2tldCh2b2lkICpwQ29udGV4dCwKKyAgd3B0X3BhY2tldCAqcEZyYW1lLAorICB3cHRfYm9vbGVhbiBtb3JlKQoreworICBXRElfRFNfQ2xpZW50RGF0YVR5cGUgKnBDbGllbnREYXRhOworICB3cHRfdWludDggICAgICB1Y1N3RnJhbWVUWFhsYXRpb247CisgIHdwdF91aW50OCAgICAgIHVjVVA7CisgIHdwdF91aW50OCAgICAgIHVjVHlwZVN1YnR5cGU7CisgIHdwdF91aW50OCAgICAgIGlzRWFwb2w7CisgIHdwdF91aW50OCAgICAgIGFsaWdubWVudDsKKyAgd3B0X3VpbnQzMiAgICAgdWNUeEZsYWc7CisgIHdwdF91aW50OCAgICAgIHVjUHJvdE1nbXRGcmFtZTsKKyAgd3B0X3VpbnQ4KiAgICAgcFNUQU1BQ0FkZHJlc3M7CisgIHdwdF91aW50OCogICAgIHBBZGRyMk1BQ0FkZHJlc3M7CisgIFdESV9EU19UeE1ldGFJbmZvVHlwZSAgICAgKnBUeE1ldGFkYXRhOworICB2b2lkICpwaHlzQkRIZWFkZXIsICpwdkJESGVhZGVyOworICB3cHRfdWludDggICAgICB1Y1R5cGU7CisgIFdESV9EU19CZE1lbVBvb2xUeXBlICpwTWVtUG9vbDsKKyAgd3B0X3VpbnQ4ICAgICAgdWNCZFBvb2xUeXBlOworICB3cHRfdWludDggICAgICBzdGFJZDsKKyAgV0RJX1N0YXR1cyB3ZGlTdGF0dXM7CisKKyAgLy8gRG8gU2FuaXR5IGNoZWNrcworICBpZiAoTlVMTCA9PSBwQ29udGV4dCkKKyAgeworICAgIHJldHVybiBXRElfU1RBVFVTX0VfRkFJTFVSRTsKKyAgfQorCisgIHBDbGllbnREYXRhID0gKFdESV9EU19DbGllbnREYXRhVHlwZSAqKSBXRElfRFNfR2V0RGF0YXBhdGhDb250ZXh0KHBDb250ZXh0KTsKKyAgaWYgKE5VTEwgPT0gcENsaWVudERhdGEgfHwgcENsaWVudERhdGEt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VFJBQ1QsIE5FR0xJR0VOQ0UgT1IgT1RIRVIKKyAqIFRPUlRJT1VTIEFDVElPTiwgQVJJU0lORyBPVVQgT0YgT1IgSU4gQ09OTkVDVElPTiBXSVRIIFRIRSBVU0UgT1IKKyAqIFBFUkZPUk1BTkNFIE9GIFRISVMgU09GVFdBUkUuCisgKi8KKworLyoKKyAqIFRoaXMgZmlsZSB3YXMgb3JpZ2luYWxseSBkaXN0cmlidXRlZCBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKyNpZm5kZWYgV0xBTl9RQ1RfV0RJX0NUU19ICisjZGVmaW5lIFdMQU5fUUNUX1dESV9DVFNfSAorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICBXIEwgQSBOICAgQyBPIE4gVCBSIE8gTCAgICBUIFIgQSBOIFMgUCBPIFIgVCAgIFMgRSBSIFYgSSBDIEUgIAorICAgICAgICAgICAgICAgICAgICAgICBFIFggVCBFIFIgTiBBIEwgIEEgUCBJCisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgCitERVNDUklQVElPTgorICBUaGlzIGZpbGUgY29udGFpbnMgdGhlIGV4dGVybmFsIEFQSSBleHBvc2VkIGJ5IHRoZSB3bGFuIGNvbnRyb2wgdHJhbnNwb3J0CisgIHNlcnZpY2UgbW9kdWxlLgorICAKKyAgICAgIAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKworICBUaGlzIHNlY3Rpb24gY29udGFpbnMgY29tbWVudHMgZGVzY3JpYmluZyBjaGFuZ2VzIG1hZGUgdG8gdGhlIG1vZHVsZS4KKyAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlci4KKworCisgICRIZWFkZXI6JCAkRGF0ZVRpbWU6ICQgJEF1dGhvcjogJAorCisKK3doZW4gICAgICAgIHdobyAgICB3aGF0LCB3aGVyZSwgd2h5CistLS0tLS0tLSAgICAtLS0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorMDgvMDQvMTAgICAgbXNzICAgICBDcmVhdGVkIG1vZHVsZS4KKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgSU5DTFVERSBGSUxFUyBGT1IgTU9EVUxFCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICogSW5jbHVkZSBGaWxlcworICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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lwZSAgICAgICB3Y3RzUnhNc2dDQjsKKyAgICAgdm9pZCogICAgICAgICAgICAgICAgICB3Y3RzUnhNc2dDQkRhdGE7Cit9IFdDVFNfVHJhbnNwb3J0Q0JzVHlwZTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICAgICBGdW5jdGlvbiBEZWNsYXJhdGlvbnMgYW5kIERvY3VtZW50YXRpb24KKyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisvKioKKyBAYnJpZWYgICAgIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCBieSB0aGUgREFMIENvcmUgdG8gaW5pdGlhbGl6ZSB0aGUgQ29udHJvbAorICAgICAgICAgICAgVHJhbnNwb3J0IGZvciBwcm9jZXNzaW5nLiBJdCBtdXN0IGJlIGNhbGxlZCBwcmlvciB0byBjYWxsaW5nIGFueQorICAgICAgICAgICAgb3RoZXIgQVBJcyBvZiB0aGUgQ29udHJvbCBUcmFuc3BvcnQuIAorCisKKyBAcGFyYW0gc3pOYW1lOiAgIHVuaXF1ZSBuYW1lIGZvciB0aGUgY2hhbm5lbCB0aGF0IGlzIHRvIGJlIG9wZW5lZCAKKyAgICAgICAgIHVTaXplOiAgIHNpemUgb2YgdGhlIGNoYW5uZWwgdGhhdCBtdXN0IGJlIG9wZW5lZCAoc2hvdWxkIGZpdCB0aGUKKyAgICAgICAgICAgICAgICAgIGxhcmdlc3Qgc2l6ZSBvZiAgcGFja2V0IHRoYXQgdGhlIERhbCBDb3JlIHdpc2hlcyB0byBzZW5kKQorICAgICAgICAgd2N0c0NCczogIGEgbGlzdCBvZiBjYWxsYmFja3MgdGhhdCB0aGUgQ1QgbmVlZHMgdG8gdXNlIHRvIHNlbmQKKyAgICAgICAgICAgICAgICAgIG5vdGlmaWNhdGlvbiBhbmQgbWVz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nNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgICAgICAgICAgICAgICAgICAgIFcgTCBBIE4gXyBRIEMgVCBfIEMgVCBTIC4gQworCisgIE9WRVJWSUVXOgorCisgIFRoaXMgc29mdHdhcmUgdW5pdCBob2xkcyB0aGUgaW1wbGVtZW50YXRpb24gb2YgdGhlIFdMQU4gQ29udHJvbCBUcmFuc3BvcnQKKyAgU2VydmljZSBMYXllci4KKworICBUaGUgZnVuY3Rpb25zIGV4dGVybmFsaXplZCBieSB0aGlzIG1vZHVsZSBhcmUgdG8gYmUgY2FsbGVkIGJ5IHRoZSBEQUwgQ29yZQorICB0aGF0IHdpc2hlcyB0byB1c2UgYSBwbGF0Zm9ybSBhZ25vc3RpYyBBUEkgdG8gY29tbXVuaWNhdGUgd2l0aCB0aGUgV0xBTiBTUy4KKworICBERVBFTkRFTkNJRVM6CisKKyAgQXJlIGxpc3RlZCBmb3IgZWFjaCBBUEkgYmVsb3cuCisKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgIEVESVQgSElTVE9SWSBGT1IgRklMRQorCisKKyAgVGhpcyBzZWN0aW9uIGNvbnRhaW5zIGNvbW1lbnRzIGRlc2NyaWJpbmcgY2hhbmdlcyBtYWRlIHRvIHRoZSBtb2R1bGUuCisgIE5vdGljZSB0aGF0IGNoYW5nZXMgYXJlIGxpc3RlZCBpbiByZXZlcnNlIGNocm9ub2xvZ2ljYWwgb3JkZXIuCisKKworICAkSGVhZGVyJCREYXRlVGltZSQkQXV0aG9yJAorCisKKyAgd2hlbiAgICAgICAgICB3aG8gICAgd2hhdCwgd2hlcmUsIHdoeQorICAtLS0tLS0tLS0tICAgIC0tLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAyMDExLTAyLTI4ICAgIGp0aiAgICBMaW51eC9BbmRyb2lkIGltcGxlbWVudGF0aW9uIHdoaWNoIHV0aWxpemVzIFNNRAorICAyMDEwLTA4LTA5ICAgIG1zcyAgICBDcmVhdGVkIG1vZHVsZQorCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgICAgICBJTkNMVURFIEZJTEVTIEZPUiBNT0RVTEUKKworPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKiBJbmNsdWRlIEZpbGVzCisgKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKyNpbmNsdWRlICJ3bGFuX3FjdF93ZGlfY3RzLmgiCisjaW5jbHVkZSAid2xhbl9xY3RfcGFsX21zZy5oIgorI2luY2x1ZGUgIndsYW5fcWN0X3BhbF9hcGkuaCIKKyNpbmNsdWRlICJ3bGFuX3FjdF9wYWxfdHJ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JlYWRDYWxsYmFjazogTWVtb3J5IGFsbG9jYXRpb24gZmFpbHVyZSIpOworICAgICAgICAgV1BBTF9BU1NFUlQoMCk7CisgICAgICAgICByZXR1cm47CisgICAgICB9CisKKyAgICAgIGJ5dGVzX3JlYWQgPSBzbWRfcmVhZChwV0NUU0NiLT53Y3RzQ2hhbm5lbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWZmZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFja2V0X3NpemUpOworCisgICAgICBpZiAoYnl0ZXNfcmVhZCAhPSBwYWNrZXRfc2l6ZSkgeworICAgICAgICAgLypTb21lIHByb2JsZW0sIGRvIG5vdCBmb3J3YXJkIGl0IHRvIFdESS4qLworICAgICAgICAgV1BBTF9UUkFDRShlV0xBTl9NT0RVTEVfREFMX0NUUkwsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgICAgIldDVFNfUEFMUmVhZENhbGxiYWNrOiBGYWlsZWQgdG8gcmVhZCBkYXRhIGZyb20gU01EIik7CisgICAgICAgICB3cGFsTWVtb3J5RnJlZShidWZmZXIpOworICAgICAgICAgV1BBTF9BU1NFUlQoMCk7CisgICAgICAgICByZXR1cm47CisgICAgICB9CisKKyAgICAgIC8qIGZvcndhcmQgdGhlIG1lc3NhZ2UgdG8gdGhlIHJlZ2lzdGVyZWQgaGFuZGxlciAqLworICAgICAgcFdDVFNDYi0+d2N0c1J4TXNnQ0IoKFdDVFNfSGFuZGxlVHlwZSlwV0NUU0NiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFja2V0X3NpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwV0NUU0NiLT53Y3RzUnhNc2dDQkRhdGEpOworCisgICAgICAvKiBGcmVlIHRoZSBhbGxvY2F0ZWQgYnVmZmVyKi8KKyAgICAgIHdwYWxNZW1vcnlaZX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F91aW50OClXRElfVFhfQkRfR0VUX1NUQV9JRChwdkJESGVhZGVyKTsKKyAgICAgIFdESV9EU19NZW1Qb29sRnJlZSgmKHBDbGllbnREYXRhLT5kYXRhTWVtUG9vbCksIHB2QkRIZWFkZXIsIHBoeXNCREhlYWRlcik7CisgICAgICBXRElfRFNfTWVtUG9vbERlY3JlYXNlUmVzZXJ2ZUNvdW50KCYocENsaWVudERhdGEtPmRhdGFNZW1Qb29sKSwgc3RhSW5kZXgpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIC8vIGludGVudGlvbmFsIGZhbGwtdGhyb3VnaCB0byBoYW5kbGUgZWFwb2wgcGFja2V0IGFzIG1nbXQKKyAgICBjYXNlIFdESV9NQUNfTUdNVF9GUkFNRToKKyAgICAgIFdESV9EU19NZW1Qb29sRnJlZSgmKHBDbGllbnREYXRhLT5tZ210TWVtUG9vbCksIHB2QkRIZWFkZXIsIHBoeXNCREhlYWRlcik7CisgICAgICBWT1NfVFJBQ0UoVk9TX01PRFVMRV9JRF9XREksIFZPU19UUkFDRV9MRVZFTF9JTkZPLAorICAgICAgICAgICAgICAgICAgICIlczogTWFuYWdlbWVudCBmcmFtZSBUeCBjb21wbGV0ZSBzdGF0dXM6ICVkIiwgX19mdW5jX18sIHN0YXR1cyk7CisgICAgICBicmVhazsKKyAgfQorICBXRElfU2V0QkRQb2ludGVycyhwRnJhbWUsIDAsIDApOworCisgIC8vIEludm9rZSBUeCBjb21wbGV0ZSBjYWxsYmFjaworICBwQ2xpZW50RGF0YS0+dHhDb21wbGV0ZUNCKHBDbGllbnREYXRhLT5wQ2FsbGJhY2tDb250ZXh0LCBwRnJhbWUpOyAgCisgIHJldHVybiBlV0xBTl9QQUxfU1RBVFVTX1NVQ0NFU1M7CisKK30KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgRlVOQ1RJT04gICAgICBXTEFOVExfR2V0UmVwbGF5Q291bnRlckZyb21SeEJECisgICAgIAorICBERVNDUklQVElPTiAgIFRoaXMgZnVuY3Rpb24gZXh0cmFjdHMgNDgtYml0IHJlcGxheSBwYWNrZXQgbnVtYmVyIGZyb20gUlggQkQgCisgCisgIERFUEVOREVOQ0lFUyAgVmFsaWRpdHkgb2YgcmVwbGF5IGNoZWNrIG11c3QgYmUgZG9uZSBiZWZvcmUgdGhlIGZ1bmN0aW9uIAorICAgICAgICAgICAgICAgIGlzIGNhbGxlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgUEFSQU1FVEVSUyAgICBwdWNSeEhlYWRlciBwb2ludGVyIHRvIFJYIEJEIGhlYWRlcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgIFJFVFJVTiAgICAgICAgdl9VNjRfdCAgICBQYWNrZXQgbnVtYmVyIGV4dGFyY3RlZCBmcm9tIFJYIEJECisKKyAgU0lERSBFRkZFQ1RTICAgbm9uZQorID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwordl9VNjRfdAorV0RUU19HZXRSZXBsYXlDb3VudGVyRnJvbVJ4QkQKKygKKyAgIHZfVThfdCAqcHVjUnhCREhlYWRlcgorKQoreworICB2X1U2NF90IHVsbGN1cnJlbnRSZXBsYXlDb3VudGVyID0gMDsKKyAgLyotIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gKi8KKy8qIDQ4LWJpdCByZXBsYXkgY291bnRlciBpcyBjcmVhdGVkIGFzIGZvbGxvd3MKKyAgIGZyb20gUlggQkQgNiBieXRlIFBNSSBjb21tYW5kOgorICAgQWRkciA6IEFFUy9US0lQCisgICAweDM4IDogcG4zL3RzYzMKKyAgIDB4MzkgOiBwbjIvdHNjMgorICAgMHgzYSA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gICAgICAgICAgICAgICAgICAgICAgICBXRFRTX1NldFBvd2VyU3RhdGVDYlR5cGUgY2JhY2spCit7CisgICB2b2lkICpwRFREcml2ZXJDb250ZXh0ID0gV0RUX0dldFRyYW5zcG9ydERyaXZlckNvbnRleHQocENvbnRleHQpOworICAgd3B0X3N0YXR1cyBzdGF0dXMgPSBlV0xBTl9QQUxfU1RBVFVTX1NVQ0NFU1M7CisKKyAgIGlmKCBjYmFjayApCisgICB7CisgICAgICAvL3NhdmUgdGhlIGNiYWNrICYgY29va2llCisgICAgICBnU2V0UG93ZXJTdGF0ZUNiSW5mby5wVXNlckRhdGEgPSBwQ29udGV4dDsKKyAgICAgIGdTZXRQb3dlclN0YXRlQ2JJbmZvLmNiYWNrID0gY2JhY2s7CisgICAgICBzdGF0dXMgPSBnVHJhbnNwb3J0RHJpdmVyLnNldFBvd2VyU3RhdGUocERURHJpdmVyQ29udGV4dCwgcG93ZXJTdGF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV0RUU19TZXRQb3dlclN0YXRlQ2IpOworICAgfQorICAgZWxzZQorICAgeworICAgICAgc3RhdHVzID0gZ1RyYW5zcG9ydERyaXZlci5zZXRQb3dlclN0YXRlKHBEVERyaXZlckNvbnRleHQsIHBvd2VyU3RhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwpOworICAgfQorCisgICByZXR1cm4gc3RhdHVzOworfQorCisvKiBEVFMgVHJhbnNwb3J0IENoYW5uZWwgRGVidWcKKyAqIERpc3BsYXkgRFhFIENoYW5uZWwgZGVidWdnaW5nIGluZm9ybWF0aW9uCisgKiBVc2VyIG1heSByZXF1ZXN0IHRvIGRpc3BsYXkgRFhFIGNoYW5uZWwgc25hcHNob3QKKyAqIE9yIGlmIGhvc3QgZHJpdmVyIGRldGVjdHMgYW55IGFibm9ybWFsIHN0Y3VrIG1heSBkaXNwbGF5CisgKiBQYXJhbWV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VRTT0VWRVIgUkVTVUxUSU5HIEZST00gTE9TUyBPRiBVU0UsIERBVEEgT1IKKyAqIFBST0ZJVFMsIFdIRVRIRVIgSU4gQU4gQUNUSU9OIE9GIENPTlRSQUNULCBORUdMSUdFTkNFIE9SIE9USEVSCisgKiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SCisgKiBQRVJGT1JNQU5DRSBPRiBUSElTIFNPRlRXQVJFLgorICovCisKKy8qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisjaWYgIWRlZmluZWQoIF9fV0xBTl9RQ1RfT1NfU1RBVFVTX0ggKQorI2RlZmluZSBfX1dMQU5fUUNUX09TX1NUQVRVU19ICisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgCisgIFxmaWxlICB3bGFuX3FjdF9vc19zdGF0dXMuaAorICAKKyAgXGJyaWVmIGRlZmluZSBzeW5jaHJvbml6YXRpb24gb2JqZWN0cyBQQUwgZXhwb3J0cy4gd3B0ID0gKFdsYW4gUGFsIFR5cGUpIHdwYWwgPSAoV2xhbiBQQUwpCisgICAgICAgICAgICAgICAKKyAgIERlZmluaXRpb25zIGZvciBwbGF0Zm9ybSBkZXBlbmRlbnQoV2luZG93cyBYUCkuIAorICAKKyAgCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKyNpbmNsdWRlICJ2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ZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisjaWYgIWRlZmluZWQoIF9fV0xBTl9RQ1RfT1NfU1lOQ19IICkKKyNkZWZpbmUgX19XTEFOX1FDVF9PU19TWU5DX0gKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAKKyAgXGZpbGUgIHdsYW5fcWN0X29zX3N5bmMuaAorICAKKyAgXGJyaWVmIGRlZmluZSBzeW5jaHJvbml6YXRpb24gb2JqZWN0cyBQQUwgZXhwb3J0cy4gd3B0ID0gKFdsYW4gUGFsIFR5cGUpIHdwYWwgPSAoV2xhbiBQQUwpCisgICAgICAgICAgICAgICAKKyAgIERlZmluaXRpb25zIGZvciBwbGF0Zm9ybSBkZXBlbmRlbnQoTEEpLiAKKyAgCisgIAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisjaW5jbHVkZSAidm9zX2V2ZW50LmgiCisjaW5jbHVkZSAidm9zX2xvY2suaCIKKworLypSZXVzZSB0aGUgdm9zIGxvY2sgYW5kIHZvcyBldmVudCovCit0eXBlZGVmIHZvc19sb2NrX3QgIHdwdF9tdXRleDsKK3R5cGVkZWYgdm9zX2V2ZW50X3Qgd3B0X2V2ZW50OworCisKKyNlbmRpZiAvLyBfX1dMQU5fUUNUX09TX1NZTkNfSApkaWZmIC0tZ2l0IGEvd2xhbi9wcmltYS9DT1JFL1dESS9XUEFML2luYy93bGFuX3FjdF9vc190aW1lci5oIGIvd2xhbi9wcmltYS9DT1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T1IgQ09OU0VRVUVOVElBTAorICogREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NIExPU1MgT0YgVVNFLCBEQVRBIE9SCisgKiBQUk9GSVRTLCBXSEVUSEVSIElOIEFOIEFDVElPTiBPRiBDT05UUkFDVCwgTkVHTElHRU5DRSBPUiBPVEhFUgorICogVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmICFkZWZpbmVkKCBfX1dMQU5fUUNUX09TX1RJTUVSX0ggKQorI2RlZmluZSBfX1dMQU5fUUNUX09TX1RJTUVSX0gKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAKKyAgXGZpbGUgIHdsYW5fcWN0X29zX3RpbWVyLmgKKyAgCisgIFxicmllZiBkZWZpbmUgc3luY2hyb25pemF0aW9uIG9iamVjdHMgUEFMIGV4cG9ydHMuIHdwdCA9IChXbGFuIFBhbCBUeXBlKSB3cGFsID0gKFdsYW4gUEFMKQorICAgICAgICAgICAgICAgCisgICBEZWZpbml0aW9ucyBmb3IgcGxhdGZvcm0gZGVwZW5kZW50IChMaW51eCBBbmRyb2lkKS4KKyAgCisgIAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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KyAgICAgICAgaWYgKCAhICggX2NvbmRpdGlvbiApICkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgIHByaW50ayhLRVJOX0NSSVQgIlZPUyBBU1NFUlQgaW4gJXMgTGluZSAlZFxuIiwgX19mdW5jX18sIF9fTElORV9fKTsgXAorICAgICAgICAgICAgV0FSTl9PTigxKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIH0gd2hpbGUgKDApCisjZWxzZSAvL1dMQU5fREVCVUcKKworc3RhdGljIGlubGluZSB2b2lkIHdwYWxUcmFjZSggd3B0X21vZHVsZWlkIG1vZHVsZSwgd3B0X3RyYWNlbGV2ZWwgbGV2ZWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyICpzdHJGb3JtYXQsIC4uLiApe307CitzdGF0aWMgaW5saW5lIHZvaWQgd3BhbER1bXAoIHdwdF9tb2R1bGVpZCBtb2R1bGUsIHdwdF90cmFjZWxldmVsIGxldmVsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cHRfdWludDggKm1lbW9yeSwgd3B0X3VpbnQzMiBsZW5ndGgpIHt9Oworc3RhdGljIGlubGluZSB2b2lkIHdwYWxUcmFjZVNldExldmVsKCB3cHRfbW9kdWxlaWQgbW9kdWxlLAorICAgICAgICAgICAgICAgICAgICAgICAgIHdwdF90cmFjZWxldmVsIGxldmVsLCB3cHRfYm9vbGVhbiBvbiApIHt9Oworc3RhdGljIGlubGluZSB2b2lkIHdwYWxUcmFjZURpc3BsYXkodm9pZCkge307CisjZGVmaW5lIFdQQUxfQVNTRVJUKHgp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VRIRVIgSU4gQU4gQUNUSU9OIE9GIENPTlRSQUNULCBORUdMSUdFTkNFIE9SIE9USEVSCisgKiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SCisgKiBQRVJGT1JNQU5DRSBPRiBUSElTIFNPRlRXQVJFLgorICovCisKKy8qCisgKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorICogdW5kZXIgcHJvcHJpZXRhcnkgdGVybXMgYmVmb3JlIENvcHlyaWdodCBvd25lcnNoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisjaWYgIWRlZmluZWQoIF9fV0xBTl9RQ1RfUEFDS19BTElHTl9IICkKKyNkZWZpbmUgX19XTEFOX1FDVF9QQUNLX0FMSUdOX0gKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAKKyAgXGZpbGUgIHdsYW5fcGFja19hbGlnbi5oCisgIAorICBcYnJpZWYgcGFjayBhbmQgYWxpZ24gcHJpbWl0aXZlcworICAgICAgICAgICAgICAgCisgICBEZWZpbml0aW9ucyBmb3IgcGxhdGZvcm0gaW5kZXBlbmRlbnQgbWVhbnMgb2YgcGFja2luZyBhbmQgYWxpZ25pbmcKKyAgIGRhdGEgc3RydWN0dXJlcworICAKKyAgCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qCisgCisgIFBsYWNlIHRoZSBtYWNybyBXUFRfUEFDS19TVEFSVCBhYm92ZSBhIHN0cnVjdHVyZSBkZWNsYXJhdGlvbiB0byBwYWNrLiBXZSAKKyAgYXJlIG5vdCBnb2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PT0KKyAgCisgIFxmaWxlICB3bGFuX3FjdF9wYWxfYXBpLmgKKyAgCisgIFxicmllZiBkZWZpbmUgZ2VuZXJhbCBBUElzIFBBTCBleHBvcnRzLiB3cHQgPSAoV2xhbiBQYWwgVHlwZSkgd3BhbCA9IChXbGFuIFBBTCkKKyAgICAgICAgICAgICAgIAorICAgRGVmaW5pdGlvbnMgZm9yIHBsYXRmb3JtIGluZGVwZW5kZW50CisgIAorICAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworI2luY2x1ZGUgIndsYW5fcWN0X3BhbF90eXBlLmgiCisjaW5jbHVkZSAid2xhbl9xY3RfcGFsX3N0YXR1cy5oIgorCisjaWZkZWYgTUVNT1JZX0RFQlVHCisjaW5jbHVkZSAidm9zX21lbW9yeS5oIgorI2VuZGlmIC8qIE1FTU9SWV9ERUJVRyAqLworCit0eXBlZGVmIHN0cnVjdCBzUGFsU3RydWN0Cit7CisgICAvKj9tdXN0IGNoZWNrIHRoZSBkYXRhIHR5cGUqLworICAgdm9pZCogZGV2SGFuZGxlOworfSB0UGFsQ29udGV4dDsKKworZXh0ZXJuIHRQYWxDb250ZXh0IGdDb250ZXh0OworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqTUFDUk8qKioqKioqKioqKioqKioqKioqKioqLworCisvLyBtYWNybyB0byBnZXQgbWF4aW11bSBvZiB0d28gdmFsdWVzLgorI2RlZmluZSBXUEFMX01BWCggX3gsIF95ICkgKCAoIChfeCkgPiAoX3kpICkgPyAoX3gpIDogKF95KSApICAKKworLy8gbWFjcm8gdG8gZ2V0IG1pbmltdW0gb2YgdHdvIHZhbHVlcworI2RlZmluZSBXUEFMX01JTiggX3gsIF95ICkgKCAoIChfeCkgPCAoX3kpICkgPyAoX3gpIDogKF95KSAgKSAgCisKKy8vIG1hY3JvIHRvIGdldCB0aGUgY2VpbGluZyBvZiBhbiB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Fzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisjaWZuZGVmIFdMQU5fUUNUX1BBTF9ERVZJQ0VfSAorI2RlZmluZSBXTEFOX1FDVF9QQUxfREVWSUNFX0gKKy8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgIEBmaWxlICAgd2xhbl9xY3RfcGFsX2RldmljZS5oCisKKyAgIEBicmllZgorICAgIFRoaXMgZmlsZSBjb250YWlucyB0aGUgZXh0ZXJuYWwgQVBJIGV4cG9zZWQgYnkgV0xBTiBQQUwgRGV2aWNlIHNwZWNpZmljIGZ1bmN0aW9uYWxpdGllcworICAgIENvcHlyaWdodCAoYykgMjAxMSBRdWFsY29tbSBJbmNvcnBvcmF0ZWQuIEFsbCBSaWdodHMgUmVzZXJ2ZWQKKyAgICBRdWFsY29tbSBDb25maWRlbnRpYWwgYW5kIFByb3BlcmlldGFyeQorCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgICAgICAgICAgICAgRURJVCBISVNUT1JZIEZPUiBGSUxFCisKKyAgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLgorICAgTm90aWNlIHRoYXQgY2hhbmdlcyBhcmUgbGlzdGVkIGluIHJldmVyc2UgY2hyb25vbG9naWNhbCBvcmRlcgorCisgICBXaGVuICAgICAgICAgICAgIFdobyAgICAgICAgICAgICAgICAgV2hhdCwgV2hlcmUsIFdoeQorICAgLS0tLS0tLS0tICAgICAgICAtLS0tLS0tLSAgICAgICAgICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgIEZFQi8wNy8xMSAgICAgICAgc2NoICAgICAgICAgICAgICAgICBDcmVhdGUgbW9kdWxlCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgICAgICAgICAgICAgSU5DTFVERSBGSUxFUyBGT1IgTU9EVUxFUworICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKyNpbmNsdWRlICJ3bGFuX3FjdF9wYWxfdHlwZS5oIgorI2luY2x1ZGUgIndsYW5fcWN0X3BhbF9zdGF0dXMuaCIKKyNpbmNsdWRlICJ3bGFuX3FjdF9wYWxfdHJhY2UuaCIKKworLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICAgICAgICAgICAgICAgIFBSRVBST0NFU1NPUlMgQU5EIERFRklOSVRJT05TCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworI2RlZmluZSAgICAgRFhFX0lOVEVSUlVQVF9UWF9DT01QTEUgICAgICAweDAyCisjZGVmaW5lICAgICBEWEVfSU5URVJSVVBUX1JYX1JFQURZICAgICAgIDB4MDQKKyNkZWZpbmUgICAgIFdQQUxfSVNSX0NMSUVOVF9NQVggICAgICAgICAgMHgwOAorCisjZGVmaW5lICAgICBXUEFMX1NNU01fV0xBTl9UWF9FTkFCTEUgICAgICAgICAgMHgwMDAwMDQwMAorI2RlZmluZSAgICAgV1BBTF9TTVNNX1dMQU5fVFhfUklOR1NfRU1QVFkgICAgIDB4MDAwMDAyMDAKKwordHlwZWRlZiBlbnVtCit7CisgICBXUEFMX0RFQlVHX1NUQVJUX0hFQUxUSF9USU1FUiA9IDE8PDAsCisgICBXUEFMX0RFQlVHX1RYX0RFU0NfUkVTWU5DICAgICA9IDE8PDEsCit9IFdQQUxfRGV2aWNlRGVidWdGbGFnczsKKy8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIEAgIEZ1bmN0aW9uIE5hbWUgCisgICAgICB3cGFsSXNyVHlwZQorCisgIEAgIERlc2NyaXB0aW9uIAorICAgICAgRFhFIElTUiBmdW5jdGlvIHByb3RvdHlwZQorICAgICAgRFhFIHNob3VsZCByZWdpc3RlciBJU1IgZnVuY3Rpb24gaW50byBwbGF0Zm9ybQorCisgIEAgIFBhcmFtZXRlcnMKKyAgICAgIHBWb2lkICAgICAgICAgICAgICAgICAgICAgICBwRFhFQ29udGV4dCA6IERYRSBtb2R1bGUgY29udHJvbCBibG9jaworCisgIEAgIFJldHVybgorICAgICAgTk9ORQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3R5cGVkZWYgdm9pZCAoKiB3cGFsSXNyVHlwZSkodm9pZCAqdXNyQ3R4dCk7CisKKy8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAgICAgICAgICAgICBHTE9CQUwgRlVOQ1RJT05TCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgIEAgRnVuY3Rpb24gTmFtZQorCisgICBAIERlc2NyaXB0aW9uCisKKyAgIEAgQXJndW1lbnRzCisKKyAgIEAgUmV0dXJuIHZhbHVlCisKKyAgIEAgTm90ZQorCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLword3B0X3N0YXR1cyB3cGFsRGV2aWNlSW5pdAorKAorICAgdm9pZCAgICAgICAgICAgICAgICAgKmRldkhhbmRsZQorKTsKKworLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgIEAgRnVuY3Rpb24gTmFtZQorCisgICBAIERlc2NyaXB0aW9uCisKKyAgIEAgQXJndW1lbnRzCisKKyAgIEAgUmV0dXJuIHZhbHVlCisKKyAgIEAgTm90ZQorCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLword3B0X3N0YXR1cyB3cGFsRGV2aWNlQ2xvc2UKKygKKyAgIHZvaWQgICAgICAgICAgICAgICAgICpkZXZpY2VDCispOworCisvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgICAgICAgICAgICAgQ0xJRU5UIFNFUlZJQ0UgRVhQT1NFIEZVTkNUSU9OUyBHRU5FUklDCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKy8qKgorICBAYnJpZWYgd3BhbFJlZ2lzdGVySW50ZXJydXB0IHByb3ZpZGVzIGEgbWVjaGFuc2ltIGZvciBjbGllbnQKKyAgICAgICAgIHRvIHJlZ2lzdGVyIHN1cHBvcnQgZm9yIGEgZ2l2ZW4gaW50ZXJydXB0CisKKyAgVGhlIERYRSBpbnRlcmZhY2Ugc3VwcG9ydHMgdHdvIGludGVycnVwdHMsIFRYIENvbXBsZXRlIGFuZCBSWAorICBBdmFpbGFibGUuICBUaGlzIGludGVyZmFjZSBwcm92aWRlcyB0aGUgbWVjaGFuaXNtIHdoZXJlYnkgYSBjbGllbnQKKyAgY2FuIHJlZ2lzdGVyIHRvIHN1cHBvcnQgb25lIG9mIHRoZXNlLiAgSXQgaXMgZXhwZWN0ZWQgdGhhdCB0aGUgY29yZQorICBEWEUgaW1wbGVtZW50YXRpb24gd2lsbCBpbnZva2UgdGhpcyBBUEkgdHdpY2UsIG9uY2UgZm9yIGVhY2ggaW50ZXJydXB0LgorICAKKyAgQHBhcmFtICBpbnRUeXBlOiAgICAgICAgICBFbnVtZXJhdGlvbiBvZiB0aGUgaW50ZXJydXB0IHR5cGUgKFRYIG9yIFJYKQorICBAcGFyYW0gIGNhbGxiYWNrRnVuY3Rpb246IElTUiBmdW5jdGlvbiBwb2ludGVyCisgIEBwYXJhbSAgdXNyQ3R4dDogICAgICAgICAgVXNlciBjb250ZXh0IHBhc3NlZCBiYWNrIHdoZW5ldmVyIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrRnVuY3Rpb24gaXMgaW52b2tlZAorCisgIEByZXR1cm4gU1VDQ0VTUyBpZiB0aGUgcmVnaXN0cmF0aW9uIHdhcyBzdWNjZXNzZnVsCisqLword3B0X3N0YXR1cyB3cGFsUmVnaXN0ZXJJbnRlcnJ1cHQKKygKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRUeXBlLAorICAgd3BhbElzclR5cGUgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrRnVuY3Rpb24sCisgICB2b2lkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqdXNyQ3R4dAorKTsKKworLyoqCisgIEBicmllZiB3cGFsVW5SZWdpc3RlckludGVycnVwdCBwcm92aWRlcyBhIG1lY2hhbnNpbSBmb3IgY2xpZW50CisgICAgICAgICB0byB1bi1yZWdpc3RlciBmb3IgYSBnaXZlbiBpbnRlcnJ1cHQKKworICBXaGVuIERYRSBzdG9wLCByZW1vdmUgcmVnaXN0ZXJlZCBpbmZvcm1hdGlvbiBmcm9tIFBBTAorICAKKyAgQHBhcmFtICBpbnRUeXBlOiAgICAgICAgICBFbnVtZXJhdGlvbiBvZiB0aGUgaW50ZXJydXB0IHR5cGUgKFRYIG9yIFJYKQorCisgIEByZXR1cm4gTk9ORQorKi8KKwordm9pZ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AgQHJldHVybiBTVUNDRVNTIGlmIHRoZSBkYXRhIHdhcyBzdWNjZXNzZnVsbHkgd3JpdHRlbgorKi8KK3dwdF9zdGF0dXMgd3BhbFdyaXRlRGV2aWNlTWVtb3J5CisoCisgICB3cHRfdWludDMyICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZHJlc3MsCisgICB3cHRfdWludDggICAgICAgICAgICAgICAgICAgICAgICAgICAgKnNyY0J1ZmZlciwKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVuCispOworCisvKioKKyAgQGJyaWVmIHdwYWxOb3RpZnlTbXNtIHByb3ZpZGVzIGEgbWVjaGFuc2ltIGZvciBhIGNsaWVudCB0byAKKyAgICAgICAgIG5vdGlmeSBTTVNNIHRvIHN0YXJ0IERYRSBlbmdpbmUgYW5kL29yIGNvbmRpdGlvbiBvZiBUeAorICAgICAgICAgcmluZyBidWZmZXIKKworICBAcGFyYW0gIGNsclN0OiAgIGJpdChzKSB0byBiZSBjbGVhcmVkIG9uIHRoZSBNQVNLIAorICBAcGFyYW0gIHNldFN0OiAgIGJpdChzKSB0byBiZSBzZXQgb24gdGhlIE1BU0sKKworICBAcmV0dXJuIFNVQ0NFU1MgaWYgdGhlIG9wZXJhdGlvbiBpcyBzdWNjZXNzZnVsCisqLword3B0X3N0YXR1cyB3cGFsTm90aWZ5U21zbQorKAorICAgd3B0X3VpbnQzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHJTdCwKKyAgIHdwdF91aW50MzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0U3QKKyk7CisKKy8qKgorICBAYnJpZWYgd3BhbEFjdGl2YXRlUnhJbnRlcnJ1cHQgYWN0aXZhdGVzIHdwYWxSeElzcgorCisgIEBwYXJhbSAgTk9ORQorCisgIEByZXR1cm4gTk9ORQorKi8KK3ZvaWQgd3BhbEFjdGl2YXRlUnhJbnRlcnJ1cHQodm9pZCk7CisKKy8qKgorICBAYnJpZWY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4IEZvdW5kYXRpb24uCisgKi8KKworI2lmICFkZWZpbmVkKCBfX1dMQU5fUUNUX1BBTF9NU0dfSCApCisjZGVmaW5lIF9fV0xBTl9RQ1RfUEFMX01TR19ICisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgCisgIFxmaWxlICB3bGFuX3FjdF9wYWxfbXNnLmgKKyAgCisgIFxicmllZiBkZWZpbmUgZ2VuZXJhbCBtZXNzYWdlIEFQSXMgUEFMIGV4cG9ydHMgdG8gc3VwcG9ydCBsZWdhY3kgVU1BQy4gCisgICB3cHQgPSAoV2xhbiBQYWwgVHlwZSkgd3BhbCA9IChXbGFuIFBBTCkKKyAgICAgICAgICAgICAgIAorICAgRGVmaW5pdGlvbnMgZm9yIHBsYXRmb3JtIGRlcGVuZGVudC4gT25seSB3b3JrIHdpdGggbGVnYWN5IFVNQUMuCisgIAorICAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworI2luY2x1ZGUgIndsYW5fcWN0X3BhbF90eXBlLmgiCisjaW5jbHVkZSAid2xhbl9xY3RfcGFsX3N0YXR1cy5oIgorCisvKiBSYW5kb20gc2lnbmF0dXJlIHRvIGRldGVjdCBTTUQgT1BFTiBOT1RJRlkgKi8KKyNkZWZpbmUgV1BBTF9NQ19NU0dfU01EX05PVElGX09QRU5fU0lHICAgMHgwOUUyCisKKy8qIFJhbmRvbSBzaWduYXR1cmUgdG8gZGV0ZWN0IFNNRCBEQVRBIE5PVElGWSAqLworI2RlZmluZSBXUEFMX01DX01TR19TTURfTk9USUZfREFUQV9TSUcgICAweERBN0EKKwordHlwZWRlZiBzdHJ1Y3Qgc3dwdF9tc2cgd3B0X21zZzsKKwordHlwZWRlZiB2b2lkICgqd3BhbF9tc2dfY2FsbGJhY2spKHdwdF9tc2cgKnBN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9TWU5DX0ggKQorI2RlZmluZSBfX1dMQU5fUUNUX1BBTF9TWU5DX0gKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAKKyAgXGZpbGUgIHdsYW5fcGFsX3N5bmMuaAorICAKKyAgXGJyaWVmIGRlZmluZSBzeW5jaHJvbml6YXRpb24gb2JqZWN0cyBQQUwgZXhwb3J0cy4gd3B0ID0gKFdsYW4gUGFsIFR5cGUpIHdwYWwgPSAoV2xhbiBQQUwpCisgICAgICAgICAgICAgICAKKyAgIERlZmluaXRpb25zIGZvciBwbGF0Zm9ybSBpbmRlcGVuZGVudC4gCisgIAorICAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworI2luY2x1ZGUgIndsYW5fcWN0X3BhbF90eXBlLmgiCisjaW5jbHVkZSAid2xhbl9xY3RfcGFsX3N0YXR1cy5oIgorI2luY2x1ZGUgIndsYW5fcWN0X29zX3N5bmMuaCIKKworCisjZGVmaW5lIFdMQU5fUEFMX1dBSVRfSU5GSU5JVEUgICAgMHhGRkZGRkZGRgorCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgIHdwYWxNdXRleEluaXQgliBpbml0aWFsaXplIGEgbXV0ZXggb2JqZWN0CisgICAgUGFyYW06CisgICAgICAgIHBNdXRleCCWIGEgcG9pbnRlciB0byBjYWxsZXIgYWxsb2NhdGVkIG9iamVjdCBvZiB3cHRfbXV0ZXgKKyAgICBSZXR1cm46CisgICAgICAgIGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUyCWIHN1Y2Nlc3MuIEZhaWwgb3RoZXJ3aXNlLgorLS0tLS0tLS0tLS0tLS0tLS0tLS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CisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKyNpZiAhZGVmaW5lZCggX19XTEFOX1FDVF9QQUxfVElNRVJfSCApCisjZGVmaW5lIF9fV0xBTl9RQ1RfUEFMX1RJTUVSX0gKKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAKKyAgXGZpbGUgIHdsYW5fcWN0X3BhbF90aW1lci5oCisgIAorICBcYnJpZWYgZGVmaW5lIHN5bmNocm9uaXphdGlvbiBvYmplY3RzIFBBTCBleHBvcnRzLiB3cHQgPSAoV2xhbiBQYWwgVHlwZSkgd3BhbCA9IChXbGFuIFBBTCkKKyAgICAgICAgICAgICAgIAorICAgRGVmaW5pdGlvbnMgZm9yIHBsYXRmb3JtIGluZGVwZW5kZW50LgorICAKKyAgCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKyNpbmNsdWRlICJ3bGFuX3FjdF9wYWxfdHlwZS5oIgorI2luY2x1ZGUgIndsYW5fcWN0X3BhbF9zdGF0dXMuaCIKKyNpbmNsdWRlICJ3bGFuX3FjdF9vc190aW1lci5oIgorCisKK3R5cGVkZWYgVk9TX1RJTUVSX1NUQVRFIFdQQUxfVElNRVJfU1RBVEU7CisKK3R5cGVkZWYgdm9pZCAoKndwYWxfdGltZXJfY2FsbGJhY2spKHZvaWQgKnBVc2VyRGF0YSk7CisKK3R5cGVkZWYgc3RydWN0Cit7CisgICB3cHRfb3NfdGltZXIgdGltZXI7CisgICB3cGFsX3RpbWVyX2NhbGxiYWNrIGNhbGxiYWNrOworICAgdm9pZCAqcFVzZXJEYXRhOworfSB3cHRfdGltZXI7CisK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E9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworI2lmICFkZWZpbmVkKCBfX1dMQU5fUUNUX1BBTF9UUkFDRV9IICkKKyNkZWZpbmUgX19XTEFOX1FDVF9QQUxfVFJBQ0VfSAorCisvKio9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIAorICBcZmlsZSAgd2xhbl9xY3RfcGFsX2FwaS5oCisgIAorICBcYnJpZWYgZGVmaW5lIGdlbmVyYWwgQVBJcyBQQUwgZXhwb3J0cy4gd3B0ID0gKFdsYW4gUGFsIFR5cGUpIHdwYWwgPSAoV2xhbiBQQUwpCisgICAgICAgICAgICAgICAKKyAgIERlZmluaXRpb25zIGZvciBwbGF0Zm9ybSBpbmRlcGVuZGVudAorICAKKyAgCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKyNpbmNsdWRlICJ3bGFuX3FjdF9wYWxfdHlwZS5oIgorI2luY2x1ZGUgIndsYW5fcWN0X3BhbF9zdGF0dXMuaCIKKwordHlwZWRlZiBlbnVtCit7CisgICAvLyBOT05FIG1lYW5zIE5PIHRyYWNlcyB3aWxsIGJlIGxvZ2dlZC4gIFRoaXMgdmFsdWUgaXMgaW4g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UxfVFlQRV9ICisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgCisgIFxmaWxlICB3bGFuX3FjdF9wYWxfdHlwZS5oCisgIAorICBcYnJpZWYgZGVmaW5lIGJhc2ljIHR5cGVzIFBBTCBleHBvcnRzLiB3cHQgPSAoV2xhbiBQYWwgVHlwZSkKKyAgICAgICAgICAgICAgIAorICAgRGVmaW5pdGlvbnMgZm9yIHBsYXRmb3JtIGluZGVwZW5kZW50LiAKKyAgCisgIAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworI2luY2x1ZGUgIndsYW5fcWN0X29zX3R5cGUuaCIKKwordHlwZWRlZiB3cHRfdWludDggd3B0X21hY0FkZHJbNl07CisKK2VudW0KK3sKKyAgIGVXTEFOX1BBTF9GQUxTRSA9IDAsCisgICBlV0xBTl9QQUxfVFJVRSA9IDEsCit9OworCit0eXBlZGVmIGVudW0KK3sKKyAgIGVXTEFOX01PRFVMRV9EQUwsCisgICBlV0xBTl9NT0RVTEVfREFMX0NUUkwsCisgICBlV0xBTl9NT0RVTEVfREFMX0RBVEEsCisgICBlV0xBTl9NT0RVTEVfUEFMLAorICAgCisgICAvL0Fsd2F5cyB0aGUgbGFzdCBvbmUKKyAgIGVXTEFOX01PRFVMRV9DT1VOVAorfSB3cHRfbW9kdWxlaWQ7CisKKwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgIC8vQklUIG9yZGVyIGlzIG1vc3QgbGlrZWx5IGxpdHRsZSBlbmRpYW4uIAorICAgLy9UaGlzIHN0cnVjdHVyZSBpcyBmb3IgbmV0b3drci1vcmRlciBieXRlIGFycmF5IChvciBiaWctZW5kaWFuIGJ5dGUgb3JkZXIpCisjaWZuZGVmIFdMQU5fUEFMX0JJR19FTkRJQU5fQklUCisgICB3cHRfYnl0ZS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GFydC5oPgorI2VuZGlmCisjaW5jbHVkZSA8bGludXgvd2Nuc3Nfd2xhbi5oPgorCisKKyNkZWZpbmUgV1BBTF9HRVRfTkRJU19IQU5ETEUocCkgICggKCh0UGFsQ29udGV4dCAqKShwKSktPmRldkhhbmRsZSApCisKK3RQYWxDb250ZXh0IGdDb250ZXh0OworCisvL1RoaXMgc3RydWN0dXJlIG5lZWQgdG8gYmUgNC1ieXRlIGFsaWduZWQuIE5vIHBhY2tpbmcuCit0eXBlZGVmIHN0cnVjdAoreworICAgd3B0X3VpbnQzMiBsZW5ndGg7CisgICAvL1RoZSBvZmZzZXQgZnJvbSBiZWdpbm5pbmcgb2YgdGhlIGJ1ZmZlciB3aGVyZSBpdCBpcyBhbGxvY2F0ZWQKKyAgIHdwdF91aW50MzIgb2Zmc2V0OyAgIAorICAgd3B0X3VpbnQzMiBwaHlBZGRyOworfSB0UGFsRG1hTWVtSW5mbzsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZVTkNUSU9OUworCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKioKKyAqIEBicmllZiBJbml0aWFsaXplIFBBTAorICogICAgICAgIEluIGNhc2Ugb2YgUU5QLCB0aGlzIGRvZXMgbm90aGluZy4KKyAqIEBwYXJhbSBwcFBhbENvbnRleHQgcG9pbnRlciB0byBhIGNhbGxlciBhbGxvY2F0ZWQgcG9pbnRlci4gSXQgCisgKiAgICAgICAgICAgICAgICAgICAgIGlzIG9wYXF1ZSB0byBjYWxsZXIuCisgKiAgICAgICAgICAgICAgICAgICAgQ2FsbGVyIHNhdmUgdGhlIHJldHVybmVkIHBvaW50ZXIgZm9yIGZ1dHVyZSB1c2Ugd2hlbgorICogICAgICAgICAgICAgIC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KKyAgICgodFBhbERtYU1lbUluZm8gKilwdiktPnBoeUFkZHIgPSBQaHlBZGRyOworICAgKCh0UGFsRG1hTWVtSW5mbyAqKXB2KS0+b2Zmc2V0ICA9IHNpemVvZih0UGFsRG1hTWVtSW5mbyk7CisgICBwdiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gKHdwdF9ieXRlICopcHYgKyBzaXplb2YodFBhbERtYU1lbUluZm8pOworICAgKnBwUGh5c2ljYWxBZGRyICAgICAgICAgICAgICAgICA9ICh2b2lkKilQaHlBZGRyICsgc2l6ZW9mKHRQYWxEbWFNZW1JbmZvKTsKKworCisgICByZXR1cm4gKHB2KTsKK30vKndwYWxEbWFNZW1vcnlBbGxvY2F0ZSovCisKKworLyoqCisgKiBAYnJpZWYgd3BhbERtYU1lbW9yeUZyZWUgLSAgRnJlZSBtZW1vcnkgcmVhZHkgZm9yIERNQQorICogQHBhcmFtIHB2IGFkZHJlc3MgZm9yIHRoZSBidWZmZXIgdG8gYmUgZnJlZWQKKyAqLwordm9pZCB3cGFsRG1hTWVtb3J5RnJlZSh2b2lkICpwdikKK3sKKyAgIHN0cnVjdCBkZXZpY2UgKndjbnNzX2RldmljZSA9IChzdHJ1Y3QgZGV2aWNlICopIGdDb250ZXh0LmRldkhhbmRsZTsKKworICAgdFBhbERtYU1lbUluZm8gKnBNZW1JbmZvID0gKHRQYWxEbWFNZW1JbmZvICopKCgod3B0X2J5dGUgKilwdikgLQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodFBhbERtYU1lbUluZm8pKTsKKyAgICBpZihwdikKKyAgICB7IAorICAgICAgICBwdiA9ICh3cHRfYnl0ZSAqKXB2IC0gcE1lbUluZm8tPm9mZnNldDsKKyAgICAgICAgZG1hX2ZyZWVfY29oZXJlbnQod2Nuc3NfZGV2aWNlLCBwTWVtSW5mby0+bGVuZ3RoLCBwdiwgcE1lbUluZm8tPnBoeUFkZHIpOworICAgIH0KKworfS8qd3BhbER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qIFRoaXMgZmlsZSB3YXMgb3JpZ2luYWxseSBkaXN0cmlidXRlZCBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgCisgIEBmaWxlICB3bGFuX3FjdF9wYWxfZGV2aWNlLmMKKyAgCisgIEBicmllZiAKKyAgICAgICAgICAgICAgIAorICBUaGlzIGZpbGUgaW1wbGVtZW50cyB0aGUgZGV2aWNlIHNwZWNpZmljIEhXIGFjY2VzcyBpbnRlcmZhY2UKKyAgcmVxdWlyZWQgYnkgdGhlIFdMQU4gUGxhdGZvcm0gQWJzdHJhY3Rpb24gTGF5ZXIgKFdQQUwpCisKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgICAgICAgICAgICAgICAgICBFRElUIEhJU1RPUlkgRk9SIEZJTEUKKworCisgIFRoaXMgc2VjdGlvbiBjb250YWlucyBjb21tZW50cyBkZXNjcmliaW5nIGNoYW5nZXMgbWFkZSB0byB0aGUgbW9kdWxlLgorICBOb3RpY2UgdGhhdCBjaGFuZ2VzIGFyZSBsaXN0ZWQgaW4gcmV2ZXJzZSBjaHJvbm9sb2dpY2FsIG9yZGVyLgorCisKKyAgJEhlYWRlcjokICREYXRlVGltZTogJCAkQXV0aG9yOiAkCisKKworICB3aGVuICAgICAgICB3aG8gIHdoYXQsIHdoZXJlLCB3aHkK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JxOworICAgd3BhbElzclR5cGUgICAgICB0eF9pc3I7CisgICB2b2lkICAgICAgICAgICAgKnR4X2NvbnRleHQ7CisgICBpbnQgICAgICAgICAgICAgIHJ4X2lycTsKKyAgIHdwYWxJc3JUeXBlICAgICAgcnhfaXNyOworICAgdm9pZCAgICAgICAgICAgICpyeF9jb250ZXh0OworICAgaW50ICAgICAgICAgICAgICByeF9yZWdpc3RlcmVkOworICAgaW50ICAgICAgICAgICAgICB0eF9yZWdpc3RlcmVkOworICAgdTggICAgICAgICAgICAgICByeF9pc3JfZW5hYmxlZDsKKyAgIHU2NCAgICAgICAgICAgICAgKnJ4X2Rpc2FibGVfcmV0dXJuOworICAgdTY0ICAgICAgICAgICAgICAqcnhfZW5hYmxlX3JldHVybjsKKyAgIHU4ICAgICAgICAgICAgICAgcnhfaXNyX2VuYWJsZV9mYWlsdXJlOworICAgdTggICAgICAgICAgICAgICByeF9pc3JfZW5hYmxlX3BhcnRpYWxfZmFpbHVyZTsKKyAgIHU4ICAgICAgICAgICAgICAgdHhfaXNyX2VuYWJsZWQ7Cit9IHdjbnNzX2VudjsKKworc3RhdGljIHdjbnNzX2VudiAgZ0VudjsKK3N0YXRpYyB3Y25zc19lbnYgKmdwRW52ID0gTlVMTDsKKworI2RlZmluZSBXUEFMX1JFQURfUkVHSVNURVJfUkFURUxJTUlUX0lOVEVSVkFMIDIwKkhaCisjZGVmaW5lIFdQQUxfUkVBRF9SRUdJU1RFUl9SQVRFTElNSVRfQlVSU1QgICAgMQorCitzdGF0aWMgREVGSU5FX1JBVEVMSU1JVF9TVEFURSh3cGFsUmVhZFJlZ2lzdGVyX3JzLCBcCisgICAgICAgIFdQQUxfUkVBRF9SRUdJU1RFUl9SQVRFTElNSVRfSU5URVJWQUwsICAgICBcCisgICAgICAgIFdQQUxfUkVBRF9SRUdJU1RFUl9SQVRFTElNSVRfQlVSU1QpOworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICBzd2l0Y2ggKGludFR5cGUpIHsKKworICAgY2FzZSBEWEVfSU5URVJSVVBUX1RYX0NPTVBMRToKKyAgICAgIGlmIChOVUxMICE9IGdwRW52LT50eF9pc3IpIHsKKyAgICAgICAgIC8qIFRYIGNvbXBsZXRlIGhhbmRsZXIgYWxyZWFkeSByZWdpc3RlcmVkICovCisgICAgICAgICBXUEFMX1RSQUNFKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX1dBUk4sCisgICAgICAgICAgICAgICAgICIlczogVFggaW50ZXJydXB0IGhhbmRsZXIgYWxyZWFkeSByZWdpc3RlcmVkIiwKKyAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgLyogZmFsbCB0aG91Z2ggYW5kIGFjY2VwdCB0aGUgbmV3IHZhbHVlcyAqLworICAgICAgfQorICAgICAgZ3BFbnYtPnR4X2lzciA9IGNhbGxiYWNrRnVuY3Rpb247CisgICAgICBncEVudi0+dHhfY29udGV4dCA9IHVzckN0eHQ7CisgICAgICBicmVhazsKKworICAgY2FzZSBEWEVfSU5URVJSVVBUX1JYX1JFQURZOgorICAgICAgaWYgKE5VTEwgIT0gZ3BFbnYtPnJ4X2lzcikgeworICAgICAgICAgLyogUlggY29tcGxldGUgaGFuZGxlciBhbHJlYWR5IHJlZ2lzdGVyZWQgKi8KKyAgICAgICAgIFdQQUxfVFJBQ0UoZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfV0FSTiwKKyAgICAgICAgICAgICAgICAgIiVzOiBSWCBpbnRlcnJ1cHQgaGFuZGxlciBhbHJlYWR5IHJlZ2lzdGVyZWQiLAorICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAvKiBmYWxsIHRob3VnaCBhbmQgYWNjZXB0IHRoZSBuZXcgdmFsdWVzICovCisgICAgICB9CisgICAgICBncEVudi0+cnhfaXNyID0gY2FsbGJhY2tGdW5jdGlvbjsKKyAgICAgIGdwRW52LT5yeF9jb250ZXh0ID0gdXNyQ3R4dDsKKyAgICAgIGJyZWFrOworCisgICBkZWZhdWx0OgorICAgICAgV1BBTF9UUkFDRShlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBVbmtub3duIGludGVycnVwdCB0eXBlIFsldV0iLAorICAgICAgICAgICAgICAgICBfX2Z1bmNfXywgaW50VHlwZSk7CisgICAgICByZXR1cm4gZVdMQU5fUEFMX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICByZXR1cm4gZVdMQU5fUEFMX1NUQVRVU19TVUNDRVNTOworfQorCisvKioKKyAgQGJyaWVmIHdwYWxVblJlZ2lzdGVySW50ZXJydXB0IHByb3ZpZGVzIGEgbWVjaGFuc2ltIGZvciBjbGllbnQKKyAgICAgICAgIHRvIHVuLXJlZ2lzdGVyIGZvciBhIGdpdmVuIGludGVycnVwdAorCisgIFdoZW4gRFhFIHN0b3AsIHJlbW92ZSByZWdpc3RlcmVkIGluZm9ybWF0aW9uIGZyb20gUEFMCisgIAorICBAcGFyYW0gIGludFR5cGU6ICAgICAgICAgIEVudW1lcmF0aW9uIG9mIHRoZSBpbnRlcnJ1cHQgdHlwZSAoVFggb3IgUlgpCisKKyAgQHJldHVybiBOT05FCisqLworCit2b2lkIHdwYWxVblJlZ2lzdGVySW50ZXJydXB0CisoCisgICB3cHRfdWludDMyICAgICAgaW50VHlwZQorKQoreworICAgaWYgKE5VTEwgPT0gZ3BFbnYpIHsKKyAgICAgIFdQQUxfVFJBQ0UoZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICIlczogaW52b2tlZCBiZWZvcmUgc3Vic3lzdGVtIGluaXRpYWxpemVkIiwKKyAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgcmV0dXJuOworICAgfQorCisgICBzd2l0Y2ggKGludFR5cGUpIHsKKworICAgY2FzZSBEWEVfSU5URVJSVVBUX1RYX0NPTVBMRToKKyAgICAgIGRpc2FibGVfaXJxX25vc3luYyhncEVudi0+dHhfaXJxKTsKKyAgICAgIGlmIChncEVudi0+dHhfcmVnaXN0ZXJlZCkKKyAgICAgIHsKKyAgICAgICAgIGZyZWVfaXJxKGdwRW52LT50eF9pcnEsIGdwRW52KTsKKyAgICAgICAgIGdwRW52LT50eF9yZWdpc3RlcmVkID0gMDsKKyAgICAgIH0KKyAgICAgIGdwRW52LT50eF9pc3IgPSBOVUxMOworICAgICAgZ3BFbnYtPnR4X2NvbnRleHQgPSBOVUxMOworICAgICAgYnJlYWs7CisKKyAgIGNhc2UgRFhFX0lOVEVSUlVQVF9SWF9SRUFEWToKKyAgICAgIGRpc2FibGVfaXJxX25vc3luYyhncEVudi0+cnhfaXJxKTsKKyAgICAgIGlmIChncEVudi0+cnhfcmVnaXN0ZXJlZCkKKyAgICAgIHsKKyAgICAgICAgIGZyZWVfaXJxKGdwRW52LT5yeF9pcnEsIGdwRW52KTsKKyAgICAgICAgIGdwRW52LT5yeF9yZWdpc3RlcmVkID0gMDsKKyAgICAgIH0KKyAgICAgIGdwRW52LT5yeF9pc3IgPSBOVUxMOworICAgICAgZ3BFbnYtPnJ4X2NvbnRleHQgPSBOVUxMOworICAgICAgYnJlYWs7CisKKyAgIGRlZmF1bHQ6CisgICAgICBXUEFMX1RSQUNFKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IFVua25vd24gaW50ZXJydXB0IHR5cGUgWyV1XSIsCisgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBpbnRUeXBlKTsKKyAgICAgIHJldHVybjsKKyAgIH0KKworICAgcmV0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2UgRFhFX0lOVEVSUlVQVF9SWF9SRUFEWToKKyAgICAgIGdwRW52LT5yeF9lbmFibGVfcmV0dXJuID0gVk9TX1JFVFVSTl9BRERSRVNTOworICAgICAgaWYgKCFncEVudi0+cnhfcmVnaXN0ZXJlZCkgCisgICAgICB7CisgICAgICAgICBncEVudi0+cnhfcmVnaXN0ZXJlZCA9IDE7CisgICAgICAgICByZXQgPSByZXF1ZXN0X2lycShncEVudi0+cnhfaXJxLCB3cGFsUnhJc3IsIElSUUZfVFJJR0dFUl9ISUdILAorICAgICAgICAgICAgICAgICAgICAgIndjbnNzX3dsYW4iLCBncEVudik7CisgICAgICAgICBpZiAocmV0KSB7CisgICAgICAgICAgICBXUEFMX1RSQUNFKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFJYIElSUSByZXF1ZXN0IGZhaWx1cmUiLAorICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgIGdwRW52LT5yeF9pc3JfZW5hYmxlX2ZhaWx1cmUgPSAxOworICAgICAgICAgICBicmVhazsKKyAgICAgICAgIH0KKyAgICAgIAorICAgICAgICAKKyAgICAgICAgIHJldCA9IGVuYWJsZV9pcnFfd2FrZShncEVudi0+cnhfaXJxKTsKKyAgICAgICAgIGlmIChyZXQpIHsKKyAgICAgICAgICAgIFdQQUxfVFJBQ0UoZVdMQU5fTU9EVUxFX0RBTF9EQVRBLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICIlczogZW5hYmxlX2lycV93YWtlIGZhaWxlZCBmb3IgUlggSVJRIiwKKyAgICAgICAgICAgICAgICAgICAgICAgX19mdW5jX18pOworICAgICAgICAgICBncEVudi0+cnhfaXNyX2VuYWJsZV9wYXJ0aWFsX2ZhaWx1cmUgPSAxOworICAgICAgICAgICAgLyogbm90IGZhdGFsIC0tIGtlZXAgb24gZ29pbmcgKi8KKyAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgIGVuYWJsZV9pcnEoZ3BFbnYtPnJ4X2lycSk7CisgICAgICB9CisgICAgICBncEVudi0+cnhfaXNyX2VuYWJsZWQgPSAxOworICAgICAgYnJlYWs7CisgICBjYXNlIERYRV9JTlRFUlJVUFRfVFhfQ09NUExFOgorICAgICAgaWYgKCFncEVudi0+dHhfcmVnaXN0ZXJlZCkgCisgICAgICB7CisgICAgICAgICBncEVudi0+dHhfcmVnaXN0ZXJlZCA9IDE7CisgICAgICAgICByZXQgPSByZXF1ZXN0X2lycShncEVudi0+dHhfaXJxLCB3cGFsVHhJc3IsIElSUUZfVFJJR0dFUl9ISUdILAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIndjbnNzX3dsYW4iLCBncEVudik7CisgICAgICAgICBpZiAocmV0KSB7CisgICAgICAgICAgICBXUEFMX1RSQUNFKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IFRYIElSUSByZXF1ZXN0IGZhaWx1cmUiLAorICAgICAgICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIH0KKyAgIAorICAgCisgICAgICAgICByZXQgPSBlbmFibGVfaXJxX3dha2UoZ3BFbnYtPnR4X2lycSk7CisgICAgICAgICBpZiAocmV0KSB7CisgICAgICAgICAgICBXUEFMX1RSQUNFKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAiJXM6IGVuYWJsZV9pcnFfd2FrZSBmYWlsZWQgZm9yIFRYIElSUSIsCisgICAgICAgICAgICAgICAgICAgICAgIF9fZnVuY19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QU5fUEFMX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICBhZGRyZXNzID0gKGFkZHJlc3MgfCBncEVudi0+d2Nuc3NfbWVtb3J5LT5zdGFydCk7CisKKyAgIGlmICgoYWRkcmVzcyA8IGdwRW52LT53Y25zc19tZW1vcnktPnN0YXJ0KSB8fAorICAgICAgIChhZGRyZXNzID4gZ3BFbnYtPndjbnNzX21lbW9yeS0+ZW5kKSkgeworICAgICAgV1BBTF9UUkFDRShlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBSZWdpc3RlciBhZGRyZXNzIDB4JTB4IG91dCBvZiByYW5nZSAweCUweCAtIDB4JTB4IiwKKyAgICAgICAgICAgICAgICAgX19mdW5jX18sIGFkZHJlc3MsCisgICAgICAgICAgICAgICAgICh1MzIpIGdwRW52LT53Y25zc19tZW1vcnktPnN0YXJ0LAorICAgICAgICAgICAgICAgICAodTMyKSBncEVudi0+d2Nuc3NfbWVtb3J5LT5lbmQpOworICAgICAgcmV0dXJuIGVXTEFOX1BBTF9TVEFUVVNfRV9JTlZBTDsKKyAgIH0KKworICAgaWYgKDAgIT0gKGFkZHJlc3MgJiAweDMpKSB7CisgICAgICBXUEFMX1RSQUNFKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IFJlZ2lzdGVyIGFkZHJlc3MgMHglMHggaXMgbm90IHdvcmQgYWxpZ25lZCIsCisgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBhZGRyZXNzKTsKKyAgICAgIHJldHVybiBlV0xBTl9QQUxfU1RBVFVTX0VfSU5WQUw7CisgICB9CisKKyAgICpkYXRhID0gcmVhZGxfcmVsYXhlZChncEVudi0+bW1pbyArIChhZGRyZXNzIC0gZ3BFbnYtPndjbnNzX21lbW9yeS0+c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TEVfSURfV0RJLCBOVUxMKSAmJgorICAgICAgICAgICAgIXZvc19pc19yZWluaXRfaW5fcHJvZ3Jlc3MoVk9TX01PRFVMRV9JRF9XREksIE5VTEwpKSkgeworICAgICAgV1BBTF9UUkFDRShlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBpbnZva2VkIGJlZm9yZSBzdWJzeXN0ZW0gaW5pdGlhbGl6ZWQiLAorICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICByZXR1cm4gZVdMQU5fUEFMX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICBhZGRyZXNzID0gKGFkZHJlc3MgfCBncEVudi0+d2Nuc3NfbWVtb3J5LT5zdGFydCk7CisKKyAgIGlmICgoYWRkcmVzcyA8IGdwRW52LT53Y25zc19tZW1vcnktPnN0YXJ0KSB8fAorICAgICAgICgoYWRkcmVzcyArIGxlbikgPiBncEVudi0+d2Nuc3NfbWVtb3J5LT5lbmQpKSB7CisgICAgICBXUEFMX1RSQUNFKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IE1lbW9yeSBhZGRyZXNzIDB4JTB4IGxlbiAlZCBvdXQgb2YgcmFuZ2UgMHglMHggLSAweCUweCIsCisgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBhZGRyZXNzLCBsZW4sCisgICAgICAgICAgICAgICAgICh1MzIpIGdwRW52LT53Y25zc19tZW1vcnktPnN0YXJ0LAorICAgICAgICAgICAgICAgICAodTMyKSBncEVudi0+d2Nuc3NfbWVtb3J5LT5lbmQpOworICAgICAgcmV0dXJuIGVXTEFOX1BBTF9TVEFUVVNfRV9JTlZBTDsKKyAgIH0KKworICAgdm9zX21lbV9jb3B5KGdwRW52LT5tbWlvICsgKGFkZHJlc3MgLSB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BFbnYgfHwgd2Nuc3NfZGV2aWNlX2lzX3NodXRkb3duKCkgfHwKKyAgICAgICAgKHZvc19pc19sb2dwX2luX3Byb2dyZXNzKFZPU19NT0RVTEVfSURfV0RJLCBOVUxMKSAmJgorICAgICAgICAgICAgIXZvc19pc19yZWluaXRfaW5fcHJvZ3Jlc3MoVk9TX01PRFVMRV9JRF9XREksIE5VTEwpKSkgeworICAgICAgV1BBTF9UUkFDRShlV0xBTl9NT0RVTEVfREFMX0RBVEEsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwKKyAgICAgICAgICAgICAgICAgIiVzOiBpbnZva2VkIGJlZm9yZSBzdWJzeXN0ZW0gaW5pdGlhbGl6ZWQiLAorICAgICAgICAgICAgICAgICBfX2Z1bmNfXyk7CisgICAgICByZXR1cm4gZVdMQU5fUEFMX1NUQVRVU19FX0lOVkFMOworICAgfQorCisgICBhZGRyZXNzID0gKGFkZHJlc3MgfCBncEVudi0+d2Nuc3NfbWVtb3J5LT5zdGFydCk7CisKKyAgIGlmICgoYWRkcmVzcyA8IGdwRW52LT53Y25zc19tZW1vcnktPnN0YXJ0KSB8fAorICAgICAgICgoYWRkcmVzcyArIGxlbikgPiBncEVudi0+d2Nuc3NfbWVtb3J5LT5lbmQpKSB7CisgICAgICBXUEFMX1RSQUNFKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IE1lbW9yeSBhZGRyZXNzIDB4JTB4IGxlbiAlZCBvdXQgb2YgcmFuZ2UgMHglMHggLSAweCUweCIsCisgICAgICAgICAgICAgICAgIF9fZnVuY19fLCBhZGRyZXNzLCBsZW4sCisgICAgICAgICAgICAgICAgICh1MzIpIGdwRW52LT53Y25zc19tZW1vcnktPnN0YXJ0LAorICAgICAgICAgICAgICAgICAodTMyKSBncEVudi0+d2Nuc3NfbWVtb3J5LT5lbmQpOworICAgICAgcmV0dXJuIGVXTEFOX1BBTF9TVEFUVVNfRV9JTlZBTDsKKyAgIH0KKworICAgdm9zX21lbV9jb3B5KGRfYnVmZmVyLAorICAgICAgICAgICAgICAgICAgIGdwRW52LT5tbWlvICsgKGFkZHJlc3MgLSBncEVudi0+d2Nuc3NfbWVtb3J5LT5zdGFydCksIGxlbik7CisgICBybWIoKTsKKworICAgcmV0dXJuIGVXTEFOX1BBTF9TVEFUVVNfU1VDQ0VTUzsKK30KKworLyoqCisgIEBicmllZiB3cGFsRGV2aWNlSW5pdCBwcm92aWRlcyBhIG1lY2hhbmlzbSB0byBpbml0aWFsaXplIHRoZSBEWEUKKyAgICAgICAgIHBsYXRmb3JtIGFkYXB0YXRpb24KKworICBAcGFyYW0gIGRldmljZUNCOiAgSW1wbGVtZW50YXRpb24tc3BlY2lmaWMgZGV2aWNlIGNvbnRyb2wgYmxvY2sKKworICBAc2VlICAgIHdwYWxEZXZpY2VDbG9zZQorCisgIEByZXR1cm4gU1VDQ0VTUyBpZiB0aGUgRFhFIGFic3RyYWN0aW9uIHdhcyBvcGVuZWQKKyovCit3cHRfc3RhdHVzIHdwYWxEZXZpY2VJbml0CisoCisgICB2b2lkICogZGV2SGFuZGxlCispCit7CisgICBzdHJ1Y3QgZGV2aWNlICp3Y25zc19kZXZpY2UgPSAoc3RydWN0IGRldmljZSAqKWRldkhhbmRsZTsKKyAgIHN0cnVjdCByZXNvdXJjZSAqd2Nuc3NfbWVtb3J5OworICAgaW50IHR4X2lycTsKKyAgIGludCByeF9pcnE7CisKKyAgIGlmIChOVUxMICE9IGdwRW52KSB7CisgICAgICBXUEFMX1RSQUNFKGVXTEFOX01PRFVMRV9EQUxfREFUQSwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLAorICAgICAgICAgICAgICAgICAiJXM6IGludm9rZWQgIGFmdGVyIHN1YnN5c3RlbSBpbml0aWFsaXplZCIsCisgICAgICAgICAgICAgICAgIF9fZnVuY19fKTsKKyAgICAgIHJldHVybi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B3YXMgb3JpZ2luYWxseSBkaXN0cmlidXRlZCBieSBRdWFsY29tbSBBdGhlcm9zLCBJbmMuCisgKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyAqIHRvIHRoZSBMaW51eCBGb3VuZGF0aW9uLgorICovCisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgCisgIFxmaWxlICB3bGFuX3FjdF9wYWxfbXNnLmMKKyAgCisgIFxicmllZiBJbXBsZW1lbnRhdGlvbiBtZXNzYWdlIEFQSXMgUEFMIGV4cG9ydHMuIHdwdCA9IChXbGFuIFBhbCBUeXBlKSB3cGFsID0gKFdsYW4gUEFMKQorICAgICAgICAgICAgICAgCisgICBEZWZpbml0aW9ucyBmb3IgcGxhdGZvcm0gd2l0aCBsZWdhY3kgVU1BQyBzdXBwb3J0LgorICAKKyAgCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKyNpbmNsdWRlICJ3bGFuX3FjdF9wYWxfbXNnLmgiCisjaW5jbHVkZSAid2xhbl9xY3RfcGFsX2FwaS5oIgorI2luY2x1ZGUgIndsYW5fcWN0X3BhbF90cmFjZS5oIgorI2luY2x1ZGUgInZvc19tcS5oIgorCisKKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgd3BhbFBvc3RDdHJsTXNnIC0gUG9zdCBhIG1lc3NhZ2UgdG8gY29udHJvbCBjb250ZXh0IHNvIGl0IGNhbiBiZSBwcm9jZXNzZWQgaW4gdGhhdCBjb250ZXh0LgorICAgIFBhcmFtOiAKKyAgICAgICAgcF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BGb3VuZGF0aW9uLgorICovCisKKy8qKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgCisgIFxmaWxlICB3bGFuX3FjdF9wYWxfcGFja2V0LmMKKyAgCisgIFxicmllZiBJbXBsZW1lbnRhdGlvbiBmb3IgUEFMIHBhY2tldC4gd3B0ID0gKFdsYW4gUGFsIFR5cGUpIHdwYWwgPSAoV2xhbiBQQUwpCisgICAgICAgICAgICAgICAKKyAgIERlZmluaXRpb25zIGZvciBwbGF0Zm9ybSB3aXRoIFZPU1MgcGFja2V0IHN1cHBvcnQgYW5kIExBLgorICAKKyAgCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKyNpbmNsdWRlICJ3bGFuX3FjdF9wYWxfcGFja2V0LmgiCisjaW5jbHVkZSAid2xhbl9xY3RfcGFsX2FwaS5oIgorI2luY2x1ZGUgIndsYW5fcWN0X3BhbF90cmFjZS5oIgorI2luY2x1ZGUgIndsYW5fcWN0X29zX3N0YXR1cy5oIgorI2luY2x1ZGUgInZvc19wYWNrZXQuaCIKKyNpbmNsdWRlICJ2b3NfdHJhY2UuaCIKKyNpbmNsdWRlICJ2b3NfbGlzdC5oIgorI2luY2x1ZGUgInZvc19hcGkuaCIKKworI2luY2x1ZGUgPGxpbnV4L3NrYnVmZi5oPgorI2luY2x1ZGUgImRtYS1tYXBwaW5nLmgiCisjaW5jbHVkZSA8bGludXgvd2Nuc3Nfd2xhbi5oPgorCisvKlBlciBzcGVjIGRlZmluaXRpb24qLworI2RlZmluZSBXUEFMX0VUSEVSTkVUX1BBS0NFVF9IRUFERVJfU0laRSAgICAgMTQKKworLypQZXIgc3BlYyBkZWZpbml0aW9uIC0gbm90IGluY2x1ZGluZyBRT1MgZmllbGQqLworI2RlZmluZSBXUEFMXzgwMl8xMV9QQUNLRVRfSEV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GFibGVDQiBpcyBzdGlsbCBOVUxMIHRoZSBsb3cKKyAgICAgICAqICAgIHJlc291cmNlIHJlY292ZXJ5IGZhaWxzLgorICAgICAgICovCisgICAgICB3cGFsUGFja2V0QXZhaWxhYmxlQ0IgPSByeExvd0NCOworCisgICAgICB2b3NTdGF0dXMgPSB2b3NfcGt0X2dldF9wYWNrZXQoJnBWb3NQa3QsIFZPU19QS1RfVFlQRV9SWF9SQVcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuUGt0U2l6ZSwgMSwgVk9TX0ZBTFNFLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdwYWxQYWNrZXRSWExvd1Jlc291cmNlQ0IsIHVzckRhdGEpOworCisgICAgICAvKiBSZXNlcnZlIHRoZSBlbnRpcmUgcmF3IHJ4IGJ1ZmZlciBmb3IgRFhFICovCisgICAgICBpZiggdm9zU3RhdHVzID09IFZPU19TVEFUVVNfU1VDQ0VTUyApCisgICAgICB7CisgICAgICAgIHdwYWxQYWNrZXRBdmFpbGFibGVDQiA9IE5VTEw7CisgICAgICAgIHZvc1N0YXR1cyA9ICB2b3NfcGt0X3Jlc2VydmVfaGVhZF9mYXN0KCBwVm9zUGt0LCAmcERhdGEsIG5Qa3RTaXplICk7IAorICAgICAgfQorCisgICAgICBpZigoTlVMTCAhPSBwVm9zUGt0KSAmJiAoVk9TX1NUQVRVU19FX1JFU09VUkNFUyAhPSB2b3NTdGF0dXMpKQorICAgICAgeworICAgICAgICAgdm9zX3BrdF9nZXRfcGFja2V0X2xlbmd0aChwVm9zUGt0LCAmYWxsb2NMZW4pOworICAgICAgICAgaWYgKG5Qa3RTaXplICE9IGFsbG9jTGVuKQorICAgICAgICAgeworICAgICAgICAgICAgV1BBTF9UUkFDRShlV0xBTl9NT0RVTEVfUEFMLCBlV0xBTl9QQUxfVFJBQ0VfTEVWRUxfRVJST1IsCisgICAgICAgICAgICAgICAgICAgICAgICJSWCBwYWNr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orICAgY2FzZSBlV0xBTl9QQUxfUEtUX1RZUEVfVFhfODAyXzNfREFUQToKKyAgICAgIHsKKyAgICAgICAgIC8qVFggUGFja2V0cyBuZWVkIHRvIGJlIERNQS1lZCB0byB0aGUgZGV2aWNlLCBwZXJmb3JtIERNQSBtYXBwaW5nIAorICAgICAgICAgICBhY2NvcmRpbmdseSAqLworICAgICAgICAgcFBoeURhdGEgPSAodm9pZCopaXRHZXRPU1BrdEFkZHJGb3JEZXZpY2UoIHBQYWNrZXQgKTsKKyAgICAgIH0KKyAgICAgIGJyZWFrOworCisgICAgICAvKiBGb3IgUmF3IFJYLCBCRCArIGhlYWRlciArIHJlc3Qgb2YgdGhlIHBhY2tldCBpcyBhbGwgY29udGFpbmVkIGluIHRoZSByYXcKKyAgICAgICAgIGJ1ZmZlciAqLworICAgY2FzZSBlV0xBTl9QQUxfUEtUX1RZUEVfUlhfUkFXOgorICAgICAgeworICAgICAgICAgLypSWCBQYWNrZXRzIG5lZWQgdG8gYmUgRE1BLWVkIGZyb20gdGhlIGRldmljZSwgcGVyZm9ybSBETUEgbWFwcGluZyAKKyAgICAgICAgICAgYWNjb3JkaW5nbHkgKi8KKyAgICAgICAgIHBQaHlEYXRhID0gKHZvaWQqKWl0R2V0T1NQa3RBZGRyRnJvbURldmljZSggcFBhY2tldCApOworICAgICAgfQorICAgICAgYnJlYWs7CisKKyAgIGRlZmF1bHQ6CisgICAgICB7CisgICAgICAgICBXUEFMX1RSQUNFKGVXTEFOX01PRFVMRV9QQUwsIGVXTEFOX1BBTF9UUkFDRV9MRVZFTF9FUlJPUiwgCisgICAgICAgICAgICAgICAgICAgICIgV0xBTl9QQUw6ICVzOiBJbnZhbGlkIHBhY2tldCB0eXBlICVkISIsICBfX2Z1bmNfXywgCisgICAgICAgICAgICAgICAgICAgIFdQQUxfUEFDS0VUX0dFVF9UWVBFKHBQYWNrZXQpICk7IAorICAgICAgICAgV1BBTF9BU1NFUlQoMCk7IAorICAgICAgICAgcmV0dXJu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R1cm5PU1BrdEFkZHJGb3JEZXZpY2UocFBhY2tldCwgcEluZm8tPnBQaHlBZGRyLCBwSW5mby0+dUxlbik7ICAgCisgICAgICB9CisgICAgICBicmVhazsKKworICAgICAgLyogRm9yIFJhdyBSWCwgQkQgKyBoZWFkZXIgKyByZXN0IG9mIHRoZSBwYWNrZXQgaXMgYWxsIGNvbnRhaW5lZCBpbiB0aGUgcmF3CisgICAgICAgICBidWZmZXIgKi8KKyAgIGNhc2UgZVdMQU5fUEFMX1BLVF9UWVBFX1JYX1JBVzoKKyAgICAgIHsKKyAgICAgICAgIC8qUlggUGFja2V0cyBuZWVkIHRvIGJlIERNQS1lZCBmcm9tIHRoZSBkZXZpY2UsIHBlcmZvcm0gRE1BIG1hcHBpbmcgCisgICAgICAgICAgIGFjY29yZGluZ2x5ICovCisgICAgICAgICBpZihOVUxMID09IHBJbmZvLT5wUGh5QWRkcikKKyAgICAgICAgIHsKKyAgICAgICAgICAgIFdQQUxfVFJBQ0UoZVdMQU5fTU9EVUxFX1BBTCwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAgICAgIiBXTEFOX1BBTDogJXM6IFJYIGZyYW1lIHdhcyBub3QgbG9ja2VkIHByb3Blcmx5IiwgIF9fZnVuY19fKTsgCisgICAgICAgICB9CisgICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgICBpdFJldHVybk9TUGt0QWRkckZyb21EZXZpY2UocFBhY2tldCwgcEluZm8tPnBQaHlBZGRyLCBwSW5mby0+dUxlbik7ICAgCisgICAgICAgICB9CisgICAgICB9CisgICAgICBicmVhazsKKworICAgZGVmYXVsdDoKKyAgICAgIHsKKyAgICAgICAgIFdQQUxfVFJBQ0UoZVdMQU5fTU9EVUxFX1BBTCwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SLCAKKyAgICAgICAgICAgICAgICAgICAgIiBXTEFOX1BBTDogJXM6IEludmFsaWQgc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UgTElBQkxFIEZPUiBBTlkgU1BFQ0lBTCwgRElSRUNULCBJTkRJUkVDVCwgT1IgQ09OU0VRVUVOVElBTAorICogREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NIExPU1MgT0YgVVNFLCBEQVRBIE9SCisgKiBQUk9GSVRTLCBXSEVUSEVSIElOIEFOIEFDVElPTiBPRiBDT05UUkFDVCwgTkVHTElHRU5DRSBPUiBPVEhFUgorICogVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAKKyAgXGZpbGUgIHdsYW5fcWN0X3BhbF90aW1lci5jCisgIAorICBcYnJpZWYgSW1wbGVtZW50YXRpb24gdHJhY2UvbG9nZ2luZyBBUElzIFBBTCBleHBvcnRzLiB3cHQgPSAoV2xhbiBQYWwgVHlwZSkgd3BhbCA9IChXbGFuIFBBTCkKKyAgICAgICAgICAgICAgIAorICAgRGVmaW5pdGlvbnMgZm9yIHBsYXRmb3JtIFdpbmRvd3MuCisgIAorICAKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworI2luY2x1Z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VVRIT1IgQkUgTElBQkxFIEZPUiBBTlkgU1BFQ0lBTCwgRElSRUNULCBJTkRJUkVDVCwgT1IgQ09OU0VRVUVOVElBTAorICogREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NIExPU1MgT0YgVVNFLCBEQVRBIE9SCisgKiBQUk9GSVRTLCBXSEVUSEVSIElOIEFOIEFDVElPTiBPRiBDT05UUkFDVCwgTkVHTElHRU5DRSBPUiBPVEhFUgorICogVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgorICogUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4KKyAqLworCisvKgorICogVGhpcyBmaWxlIHdhcyBvcmlnaW5hbGx5IGRpc3RyaWJ1dGVkIGJ5IFF1YWxjb21tIEF0aGVyb3MsIEluYy4KKyAqIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworLyoqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAKKyAgXGZpbGUgIHdsYW5fcWN0X3BhbF90cmFjZS5jCisgIAorICBcYnJpZWYgSW1wbGVtZW50YXRpb24gdHJhY2UvbG9nZ2luZyBBUElzIFBBTCBleHBvcnRzLiB3cHQgPSAoV2xhbiBQYWwgVHlwZSkgd3BhbCA9IChXbGFuIFBBTCkKKyAgICAgICAgICAgICAgIAorICAgRGVmaW5pdGlvbnMgZm9yIExpbnV4L0FuZHJvaWQgcGxhdGZvcm0KKyAgCisgIAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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VHJhY2VMZXZlbCApID8gZVdMQU5fUEFMX1RSVUUgOiBlV0xBTl9QQUxfRkFMU0U7CisgICB9CisKKyAgIHJldHVybiggdHJhY2VPbiApOworfQorCit2b2lkIHdwYWxUcmFjZURpc3BsYXkodm9pZCkKK3sKKyAgIHdwdF9tb2R1bGVpZCBtb2R1bGVJZDsKKworICAgcHJpbnRrKEtFUk5fQ1JJVAorICAgICAgICAgICIgICAgIDEpRkFUQUwgIDIpRVJST1IgIDMpV0FSTiAgNClJTkZPICAiCisgICAgICAgICAgIjUpSU5GT19IICA2KUlORk9fTSAgNylJTkZPX0xcbiIpOyAKKyAgIGZvciAobW9kdWxlSWQgPSAwOyBtb2R1bGVJZCA8IGVXTEFOX01PRFVMRV9DT1VOVDsgKyttb2R1bGVJZCkKKyAgIHsKKyAgICAgIHByaW50ayhLRVJOX0NSSVQKKyAgICAgICAgICAgICAiJTJkKSVzICAgICVzICAgICAgICAlcyAgICAgICAlcyAgICAgICAiCisgICAgICAgICAgICAgIiVzICAgICAgICAlcyAgICAgICAgICVzICAgICAgICAgJXNcbiIsCisgICAgICAgICAgICAgKGludCltb2R1bGVJZCwKKyAgICAgICAgICAgICBnVHJhY2VJbmZvW21vZHVsZUlkXS5tb2R1bGVOYW1lU3RyLAorICAgICAgICAgICAgIChnVHJhY2VJbmZvW21vZHVsZUlkXS5tb2R1bGVUcmFjZUxldmVsICYKKyAgICAgICAgICAgICAgKDEgPDwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0ZBVEFMKSkgPyAiWCI6IiAiLAorICAgICAgICAgICAgIChnVHJhY2VJbmZvW21vZHVsZUlkXS5tb2R1bGVUcmFjZUxldmVsICYKKyAgICAgICAgICAgICAgKDEgPDwgZVdMQU5fUEFMX1RSQUNFX0xFVkVMX0VSUk9SKSkgPyAiWCI6IiAiLAorICAgICAgICAgICAgIChnVHJhY2VJbmZvW21vZHVsZUlkXS5tb2R1bGVUcmFjZUxldmVsICYKKyAgICAgICAgICAgICAgKDE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yAgIHsKKyAgICAgIG51bSA9IDA7CisgICAgICBvZmZzZXQgPSAwOworICAgICAgd2hpbGUgKGxlbmd0aCA+IDApCisgICAgICB7CisgICAgICAgICBuID0gc25wcmludGYoc3RyQnVmZmVyICsgb2Zmc2V0LCBDSEFSU19QRVJfTElORSAtIG9mZnNldCAtIDEsCisgICAgICAgICAgICAgICAgICAgICAgIiUwMlggIiwgKnBNZW1vcnkpOworICAgICAgICAgb2Zmc2V0ICs9IG47CisgICAgICAgICBudW0rKzsKKyAgICAgICAgIGxlbmd0aC0tOworICAgICAgICAgcE1lbW9yeSsrOworICAgICAgICAgaWYgKEJZVEVTX1BFUl9MSU5FID09IG51bSkKKyAgICAgICAgIHsKKyAgICAgICAgICAgIHdwYWxPdXRwdXQobGV2ZWwsIHN0ckJ1ZmZlcik7CisgICAgICAgICAgICBudW0gPSAwOworICAgICAgICAgICAgb2Zmc2V0ID0gMDsKKyAgICAgICAgIH0KKyAgICAgIH0KKworICAgICAgaWYgKG9mZnNldCA+IDApCisgICAgICB7CisgICAgICAgICAvLyBwYXJ0aWFsIGxpbmUgcmVtYWlucworICAgICAgICAgd3BhbE91dHB1dChsZXZlbCwgc3RyQnVmZmVyKTsKKyAgICAgIH0KKyAgIH0KK30KKyNlbmRpZiAvL1dMQU5fREVCVUcKZGlmZiAtLWdpdCBhL3dsYW4vcHJpbWEvS2J1aWxkIGIvd2xhbi9wcmltYS9LYnVpbGQKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uY2ViY2JlYQotLS0gL2Rldi9udWxsCisrKyBiL3dsYW4vcHJpbWEvS2J1aWxkCkBAIC0wLDAgKzEsNjc1IEBACisjIFdlIGNhbiBidWlsZCBlaXRoZXIgYXMgcGFydCBvZiBhIHN0YW5kYWxvbmUgS2VybmVsIGJ1aWxkIG9yIHBhcnQKKyMgb2YgYW4gQW5kcm9pZCBidWlsZC4gIERldGVybWluZSB3aGljaCBtZWNoYW5pc20gaXMgYmVpb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yo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAqICBAZmlsZTogICAgIGFuaUNvbXBpbGVyLmgKKyAqCisgKiAgQGJyaWVmOiAgICBUaGlzIGZpbGUgdHJpZXMgdG8gYWJzdHJhY3QgdGhlIGRpZmZlcmVuY2VzIGFtb25nIGNvbXBpbGVycy4KKyAqICAgICAgICAgICAgIFN1cHBvcnRlZCBjb21waWxlcnMgYXJlOiAKKyAqICAgICAgICAgICAgIEFSTSBSVkNUIGNvbXBpbGVyCisgKgorICogIEBhdXRob3I6ICAgS3VtYXIgQW5hbmQKKyAqCisgKgorICo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKyNpZm5kZWYgX19BTklfQ09NUElMRVJfQUJTVFJBQ1RfSAorI2RlZmluZSBfX0FOSV9DT01QSUxFUl9BQlNUUkFDVF9ICisKKy8qCisgKiAxLiBHTlUgQy9DKysgQ29tcGlsZXIKKyAqCisgKiBIb3cgdG8gZGV0ZWN0IGdjYyA6IF9fR05VQ19fCisgKiBIb3cgdG8gZGV0ZWN0IGdjYyB2ZXJzaW9uIDogCisgKiAgIG1ham9yIHZlcnNpb24gOiBfX0dOVUNfXyAoMiA9IDIueCwgMyA9IDMueCwgNCA9IDQueCkKKyAqICAgbWlub3IgdmVyc2lvbiA6IF9fR05VQ19NSU5PUl9fCisgKgorICogMi4gTWljcm9zb2Z0IEMvQysrIENvbXBpbGVyCisgKgorICogSG93IHRvIGRldGVjdCBtc2MgOiBfTVNDX1ZFUgorICogSG93IHRvIGRldGVjdCBtc2MgdmVyc2lvbiA6CisgKiAgIF9NU0NfVkVSICgxMjAwID0gTVNWQyA2LjAsIDEzMDAgPSBNU1ZDIDcuMCwgLi4uKQorICoKKyAqIDMuIEludGVsIEMvQysrIENvbXBpbGVyCisgKgorICogSG93IH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WxpZ25lZCg0KSkpCisjZGVmaW5lIF9fYW5pX2F0dHJfYWxpZ25lZF84ICAgICAgICAgICAgICAgICAgICBfX2F0dHJpYnV0ZV9fKChhbGlnbmVkKDgpKSkKKyNkZWZpbmUgX19hbmlfYXR0cl9hbGlnbmVkXzE2ICAgICAgICAgICAgICAgICAgIF9fYXR0cmlidXRlX18oKGFsaWduZWQoMTYpKSkKKyNkZWZpbmUgX19hbmlfYXR0cl9hbGlnbmVkXzMyICAgICAgICAgICAgICAgICAgIF9fYXR0cmlidXRlX18oKGFsaWduZWQoMzIpKSkKKyNkZWZpbmUgUEFDS0VEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fcGFja2VkCisjZGVmaW5lIFBBQ0tFRF9QT1NUCisjZGVmaW5lIEFMSUdOKF9fdmFsdWUpICAgICAgICAgICAgICAgICAgICAgICAgICBfX2FsaWduKF9fdmFsdWUpCisjZGVmaW5lIFBSRVBBQ0sgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX3BhY2tlZAorI2RlZmluZSBQT1NUUEFDSworI2Vsc2UKKyNkZWZpbmUgX19hbmlfYXR0cl9wYWNrZWQKKyNkZWZpbmUgX19hbmlfYXR0cl9wcmVfcGFja2VkICAgICAgICAgICAgICAgICAgIF9fcGFja2VkCisjZGVmaW5lIF9fYW5pX2F0dHJfYWxpZ25lZF8yICAgICAgICAgICAgICAgICAgICBfX2FsaWduKDIpCisjZGVmaW5lIF9fYW5pX2F0dHJfYWxpZ25lZF80ICAgICAgICAgICAgICAgICAgICBfX2FsaWduKDQpCisjZGVmaW5lIF9fYW5pX2F0dHJfYWxpZ25lZF84ICAgICAgICAgICAgICAgICAgICBfX2FsaWduKDgpCisjZGVmaW5lIF9fYW5pX2F0dHJfYWxpZ25lZF8xNiAgICAgICAgICAgICAgICAgICBfX2FsaWduKDE2KQorI2RlZmluZSBfX2FuaV9hdHRyX2FsaWduZWRfMzIgICAgICAgICAgICAgICAgICAgX19hbGlnbigzM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NoaXAgd2FzIGFzc2lnbmVkCisgKiB0byB0aGUgTGludXggRm91bmRhdGlvbi4KKyAqLworCisjaWYgIWRlZmluZWQoIF9fTEVHQUNZUEFMVFlQRVNfSF9fICkKKyNkZWZpbmUgX19MRUdBQ1lQQUxUWVBFU19IX18KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAqICBAZmlsZTogICAgIGhhbExlZ2FjeVBhbFR5cGVzLmgKKyAqCisgKiAgQGJyaWVmOiAgICBFeHBvcnRzIGFuZCB0eXBlcyBmb3IgdGhlIFBsYXRmb3JtIEFic3RyYWN0aW9uIExheWVyIHR5cGVkZWZzLgorICoKKyAqICBAYXV0aG9yOiAgIEt1bWFyIEFuYW5kCisgKgorICoKKyAqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKyNpbmNsdWRlICJxd2xhbmZ3X2RlZnMuaCIKKworLyogQ29tbW9uIHR5cGUgZGVmaW5pdGlvbnMgKi8KK3R5cGVkZWYgdWludDggICAgIHRBTklfVTg7Cit0eXBlZGVmIGludDggICAgICB0QU5JX1M4OwordHlwZWRlZiB1aW50MTYgICAgdEFOSV9VMTY7Cit0eXBlZGVmIGludDE2ICAgICB0QU5JX1MxNjsKK3R5cGVkZWYgdWludDMyICAgIHRBTklfVTMyOwordHlwZWRlZiBpbnQzMiAgICAgdEFOSV9TMzI7CisKKyNpZm5kZWYgQlVJTERfUVdQVFRTVEFUSUMKK3R5cGVkZWYgdWludDY0ICAgIHRBTklfVTY0OworI2VuZGlmCisKK3R5cGVkZWYgYnl0ZSAgICAgIHRBTklfQllURTsKK3R5cGVkZWYgYm9vbGVhbiAgIHRBTklfQk9PTEVBTjsKK3R5cGVkZWYgdWludDMyICAgIHRBTklfVElNRVNUQU1QOworCisjZW5kaWYgLypfX0xFR0FDWVB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9IDBYMzJDRCwKKworICAgUFRUX01TR19FWElUID0gMHgzMmZmLAorICAgUFRUX01BWF9NU0dfSUQgPSBQVFRfTVNHX0VYSVQKK30gZVB0dE1zZ0lkOworCitlbnVtIAoreworICAgUFRUX01TR19QUklNQV9HRU5FUklDX0NNRF9GQVNUX1NFVF9DSEFOTkVMID0gMHgwLAorfTsKKworI2RlZmluZSBQVFRfTVNHX1RZUEVTX0JFR0lOXzMwICAgICAgICAgIFBUVF9NU0dfVFlQRVNfQkVHSU4KKyNkZWZpbmUgUFRUX01TR19UWVBFU19CRUdJTl8zMSAgICAgICAgICBQVFRfTVNHX1RZUEVTX0JFR0lOICsgMHgxMDAKKyNkZWZpbmUgUFRUX01TR19UWVBFU19CRUdJTl8zMiAgICAgICAgICBQVFRfTVNHX1RZUEVTX0JFR0lOICsgMHgyMDAKKworLy8gZm9yIEZUTSBQRVIgZmVhdHVyZQorZW51bSB7CitMZWdhY3lfRlRNID0gMCwKK0ZUTV9QRVJfVFggPSAxLAorRlRNX1BFUl9SWCA9IDIsCit9OworCisjaWZuZGVmIHRBTklfQk9PTEVBTgorI2RlZmluZSB0QU5JX0JPT0xFQU4gdEFOSV9VOAorI2VuZGlmCisKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgUFRUIE1FU1NBR0VTCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvL0luaXQKK3R5cGVkZWYgUEFDS0VEX1BSRSBzdHJ1Y3QgUEFDS0VEX1BPU1QgeworICAgdFB0dE1vZHVsZVZhcmlhYmxlcyBwdHQ7Cit9IHRNc2dQdHRNc2dJbml0OworCit0eXBlZGVmIFBBQ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QUNLRURfUFJFIHN0cnVjdCBQQUNLRURfUE9TVCB7CisgICB0UVdQVFRfVTMyIGNtZElkeDsKKyAgIHRRV1BUVF9VMzIgcGFyYW0xOworICAgdFFXUFRUX1UzMiBwYXJhbTI7CisgICB0UVdQVFRfVTMyIHBhcmFtMzsKKyAgIHRRV1BUVF9VMzIgcGFyYW00OworfSB0TXNnUHR0UHJpbWFHZW5lcmljQ21kOworCit0eXBlZGVmIFBBQ0tFRF9QUkUgc3RydWN0IFBBQ0tFRF9QT1NUIHsKKyAgIHRBTklfVTE2IHRlc3RJRDsKKyAgIHRBTklfVTE2IHJlc3VsdDsKK30gdE1zZ1B0dFBpbkNvbm5UZXN0UmVzOworLy8jZW5kaWYKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgIEVORCBPRiBQVFQgTUVTU0FHRVMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBQQUNLRURfUFJFIHVuaW9uIFBBQ0tFRF9QT1NUIHB0dE1zZ1VuaW9ueworLy90eXBlZGVmIHVuaW9uIHB0dE1zZ1VuaW9uIHsKKyAgIHRNc2dQdHRNc2dJbml0IE1zZ0luaXQ7CisgICB0TXNnUHR0R2V0TnZUYWJsZSBHZXROdlRhYmxlOworICAgdE1zZ1B0dFNldE52VGFibGUgU2V0TnZUYWJsZTsKKyAgIHRNc2dQdHREZWxOdlRhYmxlIERlbE52VGFibGU7CisgICB0TXNnUHR0QmxhbmtOdiBCbGFua052OworICAgdE1zZ1B0dFN0b3JlTnZUYWJsZSBTdG9yZU52VGFibGU7CisgICB0TXNnUHR0U2V0UmVnRG9tYWluIFNldFJ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EFMX0NGR19TVEFfSUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgUVdMQU5fSEFMX0NGR19DVVJSRU5UX1RYX0FOVEVOTkEgICAgICAgICAgICAgICAgIDEKKyNkZWZpbmUgUVdMQU5fSEFMX0NGR19DVVJSRU5UX1JYX0FOVEVOTkEgICAgICAgICAgICAgICAgIDIKKyNkZWZpbmUgUVdMQU5fSEFMX0NGR19MT1dfR0FJTl9PVkVSUklERSAgICAgICAgICAgICAgICAgIDMKKyNkZWZpbmUgUVdMQU5fSEFMX0NGR19QT1dFUl9TVEFURV9QRVJfQ0hBSU4gICAgICAgICAgICAgIDQKKyNkZWZpbmUgUVdMQU5fSEFMX0NGR19DQUxfUEVSSU9EICAgICAgICAgICAgICAgICAgICAgICAgIDUKKyNkZWZpbmUgUVdMQU5fSEFMX0NGR19DQUxfQ09OVFJPTCAgICAgICAgICAgICAgICAgICAgICAgIDYKKyNkZWZpbmUgUVdMQU5fSEFMX0NGR19QUk9YSU1JVFkgICAgICAgICAgICAgICAgICAgICAgICAgIDcKKyNkZWZpbmUgUVdMQU5fSEFMX0NGR19ORVRXT1JLX0RFTlNJVFkgICAgICAgICAgICAgICAgICAgIDgKKyNkZWZpbmUgUVdMQU5fSEFMX0NGR19NQVhfTUVESVVNX1RJTUUgICAgICAgICAgICAgICAgICAgIDkKKyNkZWZpbmUgUVdMQU5fSEFMX0NGR19NQVhfTVBEVVNfSU5fQU1QRFUgICAgICAgICAgICAgICAgIDEwCisjZGVmaW5lIFFXTEFOX0hBTF9DRkdfUlRTX1RIUkVTSE9MRCAgICAgICAgICAgICAgICAgICAgICAxMQorI2RlZmluZSBRV0xBTl9IQUxfQ0ZHX1NIT1JUX1JFVFJZX0xJTUlUICAgICAgICAgICAgICAgICAgMTIKKyNkZWZpbmUgUVdMQU5fSEFMX0NGR19MT05HX1JFVFJZX0xJTUlUICAgICAgICAgICAgICAgICAgIDEzCisjZGVmaW5lIFFXTEFOX0hBTF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U0xPVF9USU1FICAgICAgICAgICAgICAgICAgIDE3NgorI2RlZmluZSBRV0xBTl9IQUxfQ0ZHX0RFTEFZRURfQkEgICAgICAgICAgICAgICAgICAgICAgICAxNzcKKyNkZWZpbmUgUVdMQU5fSEFMX0NGR19JTU1FRElBVEVfQkEgICAgICAgICAgICAgICAgICAgICAgMTc4CisjZGVmaW5lIFFXTEFOX0hBTF9DRkdfRE9UMTFfTU9ERSAgICAgICAgICAgICAgICAgICAgICAgIDE3OQorI2RlZmluZSBRV0xBTl9IQUxfQ0ZHX0hUX0NBUFMgICAgICAgICAgICAgICAgICAgICAgICAgICAxODAKKyNkZWZpbmUgUVdMQU5fSEFMX0NGR19BTVBEVV9QQVJBTVMgICAgICAgICAgICAgICAgICAgICAgMTgxCisjZGVmaW5lIFFXTEFOX0hBTF9DRkdfVFhfQkZfSU5GTyAgICAgICAgICAgICAgICAgICAgICAgIDE4MgorI2RlZmluZSBRV0xBTl9IQUxfQ0ZHX0FTQ19DQVBfSU5GTyAgICAgICAgICAgICAgICAgICAgICAxODMKKyNkZWZpbmUgUVdMQU5fSEFMX0NGR19FWFRfSFRfQ0FQUyAgICAgICAgICAgICAgICAgICAgICAgMTg0CisjZGVmaW5lIFFXTEFOX0hBTF9DRkdfUU9TX0VOQUJMRUQgICAgICAgICAgICAgICAgICAgICAgIDE4NQorI2RlZmluZSBRV0xBTl9IQUxfQ0ZHX1dNRV9FTkFCTEVEICAgICAgICAgICAgICAgICAgICAgICAxODYKKyNkZWZpbmUgUVdMQU5fSEFMX0NGR19XU01fRU5BQkxFRCAgICAgICAgICAgICAgICAgICAgICAgMTg3CisjZGVmaW5lIFFXTEFOX0hBTF9DRkdfV01NX0VOQUJMRUQgICAgICAgICAgICAgICAgICAgICAgIDE4OAorI2RlZmluZSBRV0xBTl9IQUxfQ0ZHX1VBUFNEX1BFUl9BQ19CSVRNQVNLICAgICAgICAgICAgICAxODkKKyNkZWZpbmUgUVdMQU5fSEFMX0NGR19NQ1NfUkF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T1NTIE9GIFVTRSwgREFUQSBPUgorKiBQUk9GSVRTLCBXSEVUSEVSIElOIEFOIEFDVElPTiBPRiBDT05UUkFDVCwgTkVHTElHRU5DRSBPUiBPVEhFUgorKiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SCisqIFBFUkZPUk1BTkNFIE9GIFRISVMgU09GVFdBUkUuCisqLworCisvKgorKiBUaGlzIGZpbGUgd2FzIG9yaWdpbmFsbHkgZGlzdHJpYnV0ZWQgYnkgUXVhbGNvbW0gQXRoZXJvcywgSW5jLgorKiB1bmRlciBwcm9wcmlldGFyeSB0ZXJtcyBiZWZvcmUgQ29weXJpZ2h0IG93bmVyc2hpcCB3YXMgYXNzaWduZWQKKyogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisqLworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKgorICogIEBmaWxlOiAgICAgd2xhbl9oYWxfbXNnLmgKKyAqCisgKiAgQGJyaWVmOiAgICBFeHBvcnRzIGFuZCB0eXBlcyBmb3IgbWVzc2FnZXMgc2VudCB0byBIQUwgZnJvbSBXREkKKyAqCisgKiAgQGF1dGhvcjogICBLdW1hciBBbmFuZAorICoKKyAqCisgKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisjaWZuZGVmIF9XTEFOX0hBTF9NU0dfSF8KKyNkZWZpbmUgX1dMQU5fSEFMX01TR19IXworCisjaW5jbHVkZSAiaGFsTGVnYWN5UGFsVHlwZXMuaCIKKyNpbmNsdWRlICJoYWxDb21waWxlci5oIgorI2luY2x1ZGUgIndsYW5fcWN0X2Rldl9kZWZzLmgiCisjaW5jbHVkZSAid2xhbl9udi5oIgorCisvKi0tLS0tLS0tLS0tL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CisgICBXTEFOX0hBTF9ET1dOTE9BRF9OVl9SU1AgICAgICAgICAgICAgPSA1NiwKKworICAgV0xBTl9IQUxfQUREX0JBX1NFU1NJT05fUkVRICAgICAgICAgID0gNTcsCisgICBXTEFOX0hBTF9BRERfQkFfU0VTU0lPTl9SU1AgICAgICAgICAgPSA1OCwKKyAgIFdMQU5fSEFMX1RSSUdHRVJfQkFfUkVRICAgICAgICAgICAgICA9IDU5LAorICAgV0xBTl9IQUxfVFJJR0dFUl9CQV9SU1AgICAgICAgICAgICAgID0gNjAsCisgICBXTEFOX0hBTF9VUERBVEVfQkVBQ09OX1JFUSAgICAgICAgICAgPSA2MSwKKyAgIFdMQU5fSEFMX1VQREFURV9CRUFDT05fUlNQICAgICAgICAgICA9IDYyLAorICAgV0xBTl9IQUxfU0VORF9CRUFDT05fUkVRICAgICAgICAgICAgID0gNjMsCisgICBXTEFOX0hBTF9TRU5EX0JFQUNPTl9SU1AgICAgICAgICAgICAgPSA2NCwKKworICAgV0xBTl9IQUxfU0VUX0JDQVNUS0VZX1JFUSAgICAgICAgICAgICAgID0gNjUsCisgICBXTEFOX0hBTF9TRVRfQkNBU1RLRVlfUlNQICAgICAgICAgICAgICAgPSA2NiwKKyAgIFdMQU5fSEFMX0RFTEVURV9TVEFfQ09OVEVYVF9JTkQgICAgICAgICA9IDY3LAorICAgV0xBTl9IQUxfVVBEQVRFX1BST0JFX1JTUF9URU1QTEFURV9SRVEgID0gNjgsCisgICBXTEFOX0hBTF9VUERBVEVfUFJPQkVfUlNQX1RFTVBMQVRFX1JTUCAgPSA2OSwKKworICAvLyBQVFQgaW50ZXJmYWNlIHN1cHBvcnQKKyAgIFdMQU5fSEFMX1BST0NFU1NfUFRUX1JFUSAgID0gNzAsCisgICBXTEFOX0hBTF9QUk9DRVNTX1BUVF9SU1AgICA9IDcxLAorCisgICAvLyBCVEFNUCByZWxhdGVkIGV2ZW50cworICAgV0xBTl9IQUxfU0lHTkFMX0JUQU1QX0VWRU5UX1JF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FMX0dUS19PRkZMT0FEX1JTUCAgICAgICAgICAgICAgICAgPSAxNzIsCisgICBXTEFOX0hBTF9HVEtfT0ZGTE9BRF9HRVRJTkZPX1JFUSAgICAgICAgID0gMTczLAorICAgV0xBTl9IQUxfR1RLX09GRkxPQURfR0VUSU5GT19SU1AgICAgICAgICA9IDE3NCwKKworICAgV0xBTl9IQUxfRkVBVFVSRV9DQVBTX0VYQ0hBTkdFX1JFUSAgICAgICA9IDE3NSwKKyAgIFdMQU5fSEFMX0ZFQVRVUkVfQ0FQU19FWENIQU5HRV9SU1AgICAgICAgPSAxNzYsCisgICBXTEFOX0hBTF9FWENMVURFX1VORU5DUllQVEVEX0lORCAgICAgICAgID0gMTc3LAorCisgICBXTEFOX0hBTF9TRVRfVEhFUk1BTF9NSVRJR0FUSU9OX1JFUSAgICAgID0gMTc4LAorICAgV0xBTl9IQUxfU0VUX1RIRVJNQUxfTUlUSUdBVElPTl9SU1AgICAgICA9IDE3OSwKKworICAgV0xBTl9IQUxfVVBEQVRFX1ZIVF9PUF9NT0RFX1JFUSAgICAgICAgICA9IDE4MiwKKyAgIFdMQU5fSEFMX1VQREFURV9WSFRfT1BfTU9ERV9SU1AgICAgICAgICAgPSAxODMsCisKKyAgIFdMQU5fSEFMX1AyUF9OT0FfU1RBUlRfSU5EICAgICAgICAgICAgICAgPSAxODQsCisKKyAgIFdMQU5fSEFMX0dFVF9ST0FNX1JTU0lfUkVRICAgICAgICAgICAgICAgPSAxODUsCisgICBXTEFOX0hBTF9HRVRfUk9BTV9SU1NJX1JTUCAgICAgICAgICAgICAgID0gMTg2LAorCisgICBXTEFOX0hBTF9DTEFTU19CX1NUQVRTX0lORCAgICAgICAgICAgICAgID0gMTg3LAorICAgV0xBTl9IQUxfREVMX0JBX0lORCAgICAgICAgICAgICAgICAgICAgICA9IDE4OCwKKyAgIFdMQU5fSEFMX0RIQ1BfU1RBUlRfSU5EICAgICAgICAgICAgICAgICAgPSAxODksCisgICBXTEFOX0hBTF9ESENQX1NUT1BfSU5EICAgICAgICAgICAgICAgICAgID0gMTkwLAorICAgV0xBTl9ST0FNX1NDQU5fT0ZGTE9BRF9SRVEgICAgICAgICAgICAgICA9IDE5MSwKKyAgIFdMQU5fUk9BTV9TQ0FOX09GRkxPQURfUlNQICAgICAgICAgICAgICAgPSAxOTIsCisgICBXTEFOX0hBTF9XSUZJX1BST1hJTUlUWV9SRVEgICAgICAgICAgICAgID0gMTkzLAorICAgV0xBTl9IQUxfV0lGSV9QUk9YSU1JVFlfUlNQICAgICAgICAgICAgICA9IDE5NCwKKworICAgV0xBTl9IQUxfU1RBUlRfU1BFQ1VMQVRJVkVfUFNfUE9MTFNfUkVRICA9IDE5NSwKKyAgIFdMQU5fSEFMX1NUQVJUX1NQRUNVTEFUSVZFX1BTX1BPTExTX1JTUCAgPSAxOTYsCisgICBXTEFOX0hBTF9TVE9QX1NQRUNVTEFUSVZFX1BTX1BPTExTX0lORCAgID0gMTk3LAorCisgICBXTEFOX0hBTF9URExTX0xJTktfRVNUQUJMSVNIRURfUkVRICAgICAgID0gMTk4LAorICAgV0xBTl9IQUxfVERMU19MSU5LX0VTVEFCTElTSEVEX1JTUCAgICAgICA9IDE5OSwKKyAgIFdMQU5fSEFMX1RETFNfTElOS19URUFSRE9XTl9SRVEgICAgICAgICAgPSAyMDAsCisgICBXTEFOX0hBTF9URExTX0xJTktfVEVBUkRPV05fUlNQICAgICAgICAgID0gMjAxLAorICAgV0xBTl9IQUxfVERMU19JTkQgICAgICAgICAgICAgICAgICAgICAgICA9IDIwMiwKKyAgIFdMQU5fSEFMX0lCU1NfUEVFUl9JTkFDVElWSVRZX0lORCAgICAgICAgPSAyMDMsCisKKyAgIC8qIFNjYW4gT2ZmbG9hZCBBUElzICovCisgICBXTEFOX0hBTF9TVEFSVF9TQ0FOX09GRkxPQURfUkVRICAgICAgICAgID0gMjA0LAorICAgV0xBTl9IQUxfU1RBUlRfU0NBTl9PRkZMT0FEX1JTUCAgICAgICAgICA9IDIwNS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Y29sICovCisgICBXTEFOX0hBTF9MQlBfTEVBREVSX1JFUSAgICAgICAgICAgICAgICAgID0gMjE5LAorICAgV0xBTl9IQUxfTEJQX0xFQURFUl9SU1AgICAgICAgICAgICAgICAgICA9IDIyMCwKKyAgIFdMQU5fSEFMX0xCUF9VUERBVEVfSU5EICAgICAgICAgICAgICAgICAgPSAyMjEsCisKKyAgIC8qIEJhdGNoc2NhbiAqLworICAgV0xBTl9IQUxfQkFUQ0hTQ0FOX1NFVF9SRVEgICAgICAgICAgICAgICA9IDIyMiwKKyAgIFdMQU5fSEFMX0JBVENIU0NBTl9TRVRfUlNQICAgICAgICAgICAgICAgPSAyMjMsCisgICBXTEFOX0hBTF9CQVRDSFNDQU5fVFJJR0dFUl9SRVNVTFRfSU5EICAgID0gMjI0LAorICAgV0xBTl9IQUxfQkFUQ0hTQ0FOX1JFU1VMVF9JTkQgICAgICAgICAgICA9IDIyNSwKKyAgIFdMQU5fSEFMX0JBVENIU0NBTl9TVE9QX0lORCAgICAgICAgICAgICAgPSAyMjYsCisKKyAgIFdMQU5fSEFMX0dFVF9JQlNTX1BFRVJfSU5GT19SRVEgICAgICAgICAgPSAyMjcsCisgICBXTEFOX0hBTF9HRVRfSUJTU19QRUVSX0lORk9fUlNQICAgICAgICAgID0gMjI4LAorCisgICBXTEFOX0hBTF9SQVRFX1VQREFURV9JTkQgICAgICAgICAgICAgICAgID0gMjI5LAorCisgICAvKiBUeCBGYWlsIGZvciB3ZWFrIGxpbmsgbm90aWZpY2F0aW9uICovCisgICBXTEFOX0hBTF9UWF9GQUlMX01PTklUT1JfSU5EICAgICAgICAgICAgID0gMjMwLAorICAgV0xBTl9IQUxfVFhfRkFJTF9JTkQgICAgICAgICAgICAgICAgICAgICA9IDIzMSwKKworICAgLyogTXVsdGktaG9wIElQIHJvdXRpbmcgb2ZmbG9hZCAqLworICAgV0xBTl9IQUxfSVBfRk9SV0FSRF9UQUJMRV9VUERBVEVfSU5EICAgICA9IDIzMiwKKworICAgL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AgICAgPSAyNTYsCisgICBXTEFOX0hBTF9OQU5fUkVRICAgICAgICAgICAgICAgICAgICAgICAgID0gV0xBTl9IQUxfTkFOX0ZJUlNULAorICAgV0xBTl9IQUxfTkFOX1JTUCAgICAgICAgICAgICAgICAgICAgICAgICA9IDI1NywKKyAgIFdMQU5fSEFMX05BTl9FVlQgICAgICAgICAgICAgICAgICAgICAgICAgPSAyNTgsCisgICBXTEFOX0hBTF9OQU5fTEFTVCAgICAgICAgICAgICAgICAgICAgICAgID0gV0xBTl9IQUxfTkFOX0VWVCwKKyAgIFdMQU5fSEFMX1BSSU5UX1JFR19JTkZPX0lORCAgICAgICAgICAgICAgPSAyNTksCisKKyAgIFdMQU5fSEFMX0dFVF9CQ05fTUlTU19SQVRFX1JFUSAgICAgICAgICAgPSAyNjAsCisgICBXTEFOX0hBTF9HRVRfQkNOX01JU1NfUkFURV9SU1AgICAgICAgICAgID0gMjYxLAorCisgICAvKiBXTEFOIExJTksgTEFZRVIgU1RBVFMgTWVzc2FnZXMgKi8KKyAgIFdMQU5fSEFMX0xMX1NFVF9TVEFUU19SRVEgICAgICAgICAgICAgICAgPSAyNjIsCisgICBXTEFOX0hBTF9MTF9TRVRfU1RBVFNfUlNQICAgICAgICAgICAgICAgID0gMjYzLAorICAgV0xBTl9IQUxfTExfR0VUX1NUQVRTX1JFUSAgICAgICAgICAgICAgICA9IDI2NCwKKyAgIFdMQU5fSEFMX0xMX0dFVF9TVEFUU19SU1AgICAgICAgICAgICAgICAgPSAyNjUsCisgICBXTEFOX0hBTF9MTF9DTEVBUl9TVEFUU19SRVEgICAgICAgICAgICAgID0gMjY2LAorICAgV0xBTl9IQUxfTExfQ0xFQVJfU1RBVFNfUlNQICAgICAgICAgICAgICA9IDI2NywKKyAgIFdMQU5fSEFMX0xMX05PVElGWV9TVEFUUyAgICAgICAgICAgICAgICAgPSAyNjgsCisgICBXTEFOX0hBTF9MTF9MQVNUICAgICAgICAgICAgICAgICAgICAgICAgID0gV0xBTl9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V0xBTl9IQUxfU0lHX1JTU0lfUkVTRVRfUlNQICAgICAgICAgICAgICA9IDI4NCwKKworICAgV0xBTl9IQUxfRVhUX1NDQU5fUkVTVUxUX0lORCAgICAgICAgICAgICA9IDI4NSwKKyAgIFdMQU5fSEFMX0JTU0lEX0hPVExJU1RfUkVTVUxUX0lORCAgICAgICAgPSAyODYsCisgICBXTEFOX0hBTF9TSUdfUlNTSV9SRVNVTFRfSU5EICAgICAgICAgICAgID0gMjg3LAorICAgV0xBTl9IQUxfRVhUX1NDQU5fUFJPR1JFU1NfSU5EICAgICAgICAgICA9IDI4OCwKKyAgIFdMQU5fSEFMX0VYVF9TQ0FOX1JFU1VMVF9BVkFJTEFCTEVfSU5EICAgPSAyODksCisgICBXTEFOX0hBTF9URExTX0NIQU5fU1dJVENIX1JFUSAgICAgICAgICAgID0gMjkwLAorICAgV0xBTl9IQUxfVERMU19DSEFOX1NXSVRDSF9SU1AgICAgICAgICAgICA9IDI5MSwKKyAgIFdMQU5fSEFMX01BQ19TUE9PRkVEX1NDQU5fUkVRICAgICAgICAgICAgPSAyOTIsCisgICBXTEFOX0hBTF9NQUNfU1BPT0ZFRF9TQ0FOX1JTUCAgICAgICAgICAgID0gMjkzLAorICAgLyogTEdFIERJU0EgZW5jcnlwdC1kZWNyeXB0IE1lc3NhZ2VzICovCisgICBXTEFOX0hBTF9FTkNSWVBUX0RBVEFfUkVRICAgICAgICAgICAgICAgID0gMjk0LAorICAgV0xBTl9IQUxfRU5DUllQVF9EQVRBX1JTUCAgICAgICAgICAgICAgICA9IDI5NSwKKworICAgV0xBTl9IQUxfRldfU1RBVFNfUkVRICAgICAgICAgICAgICAgICAgICA9IDI5NiwKKyAgIFdMQU5fSEFMX0ZXX1NUQVRTX1JTUCAgICAgICAgICAgICAgICAgICAgPSAyOTcsCisgICBXTEFOX0hBTF9GV19MT0dHSU5HX0lOSVRfUkVRICAgICAgICAgICAgID0gMjk4LAorICAgV0xBTl9IQUxfRldfTE9HR0lOR19J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UEVfTUFYID0gV0xBTl9IQUxfTUFYX0VOVU1fU0laRSwgLy9UaGlzIGFuZCBiZXlvbmQgYXJlIGludmFsaWQgdmFsdWVzCit9IHRCdEFtcEV2ZW50VHlwZTsKKworLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKworCisvKioqKioqKioqKioqKioqKioqKlBFIFN0YXRpc3RpY3MqKioqKioqKioqKioqKioqKioqKioqKioqLwordHlwZWRlZiBlbnVtCit7CisgICAgUEVfU1VNTUFSWV9TVEFUU19JTkZPICAgICAgICAgICA9IDB4MDAwMDAwMDEsCisgICAgUEVfR0xPQkFMX0NMQVNTX0FfU1RBVFNfSU5GTyAgICA9IDB4MDAwMDAwMDIsCisgICAgUEVfR0xPQkFMX0NMQVNTX0JfU1RBVFNfSU5GTyAgICA9IDB4MDAwMDAwMDQsCisgICAgUEVfR0xPQkFMX0NMQVNTX0NfU1RBVFNfSU5GTyAgICA9IDB4MDAwMDAwMDgsCisgICAgUEVfR0xPQkFMX0NMQVNTX0RfU1RBVFNfSU5GTyAgICA9IDB4MDAwMDAwMTAsCisgICAgUEVfUEVSX1NUQV9TVEFUU19JTkZPICAgICAgICAgICA9IDB4MDAwMDAwMjAsCisgICAgUEVfU1RBVFNfVFlQRV9NQVggPSBXTEFOX0hBTF9NQVhfRU5VTV9TSVpFIC8vVGhpcyBhbmQgYmV5b25kIGFyZSBpbnZhbGlkIHZhbHVlcworfWVQRVN0YXRzTWFzazsKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqTElOSyBMQVlFUiBTdGF0aXRpY3MqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIGludCB3aWZpX3JhZGlvOwordHlwZWRlZiBpbnQgd2lmaV9jaGFubmVsOwordHlwZWRlZiBpbnQgd2lmaV90eF9yYXRlOworCisvKiBjaGFubmVsIG9wZXJhdGluZyB3aWR0aCAqLwordHlwZWRlZiBlbnVtIHsK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ICBtYWNfYWRkcls2XTsgICAgICAgICAgICAgICAvLyBpbnRlcmZhY2UgbWFjIGFkZHJlc3MgKHNlbGYpCisgICAgd2lmaV9jb25uZWN0aW9uX3N0YXRlICAgIHN0YXRlOyAgICAgICAgICAgICAgICAgICAgIC8vIGNvbm5lY3Rpb24gc3RhdGUgKHZhbGlkIGZvciBTVEEsIENMSSBvbmx5KQorICAgIHdpZmlfcm9hbV9zdGF0ZSAgICAgICAgICByb2FtaW5nOyAgICAgICAgICAgICAgICAgICAvLyByb2FtaW5nIHN0YXRlCisgICAgdEFOSV9VMzIgICAgICAgICAgICAgICAgIGNhcGFiaWxpdGllczsgICAgICAgICAgICAgIC8vIFdJRklfQ0FQQUJJTElUWV9YWFggKHNlbGYpCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgIHNzaWRbMzNdOyAgICAgICAgICAgICAgICAgIC8vIG51bGwgdGVybWluYXRlZCBTU0lECisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgIGJzc2lkWzZdOyAgICAgICAgICAgICAgICAgIC8vIGJzc2lkCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgIGFwX2NvdW50cnlfc3RyWzNdOyAgICAgICAgIC8vIGNvdW50cnkgc3RyaW5nIGFkdmVydGlzZWQgYnkgQVAKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgY291bnRyeV9zdHJbM107ICAgICAgICAgICAgLy8gY291bnRyeSBzdHJpbmcgZm9yIHRoaXMgYXNzb2NpYXRpb24KK30gd2lmaV9pbnRlcmZhY2VfaW5mbzsKKworLyogY2hhbm5lbCBpbmZvcm1hdGlvbiAqLwordHlwZWRlZiBQQUNLRURfUFJFIHN0cnVjdCBQQUNLRURfUE9TVAoreworICAgIHdpZmlfY2hhbm5lbF93aWR0aCB3aWR0aDsgICAgICAgICAvLyBjaGFubmVsIHdpZHRoICgyMCwgNDAsIDgwLCA4MCs4MCwgMTYwKQorICAgIHdpZmlfY2hhbm5lbCAgICAgICBj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1BPU1QKK3sKKyAgICB3aWZpX2NoYW5uZWxfaW5mbyBjaGFubmVsOyAgICAgICAgICAgICAgICAvLyBjaGFubmVsCisgICAgdEFOSV9VMzIgICAgICAgICAgb25fdGltZTsgICAgICAgICAgICAgICAgLy8gbXNlY3MgdGhlIHJhZGlvIGlzIGF3YWtlICgzMiBiaXRzIG51bWJlciBhY2NydWluZyBvdmVyIHRpbWUpCisgICAgdEFOSV9VMzIgICAgICAgICAgY2NhX2J1c3lfdGltZTsgICAgICAgICAgLy8gbXNlY3MgdGhlIENDQSByZWdpc3RlciBpcyBidXN5ICgzMiBiaXRzIG51bWJlciBhY2NydWluZyBvdmVyIHRpbWUpCit9IHdpZmlfY2hhbm5lbF9zdGF0czsKKworLyogcmFkaW8gc3RhdGlzdGljcyAqLwordHlwZWRlZiBQQUNLRURfUFJFIHN0cnVjdCBQQUNLRURfUE9TVAoreworICAgIHdpZmlfcmFkaW8gcmFkaW87ICAgICAgICAgICAgICAgICAgICAgIC8vIHdpZmkgcmFkaW8gKGlmIG11bHRpcGxlIHJhZGlvIHN1cHBvcnRlZCkKKyAgICB0QU5JX1UzMiAgIG9uX3RpbWU7ICAgICAgICAgICAgICAgICAgICAvLyBtc2VjcyB0aGUgcmFkaW8gaXMgYXdha2UgKDMyIGJpdHMgbnVtYmVyIGFjY3J1aW5nIG92ZXIgdGltZSkKKyAgICB0QU5JX1UzMiAgIHR4X3RpbWU7ICAgICAgICAgICAgICAgICAgICAvLyBtc2VjcyB0aGUgcmFkaW8gaXMgdHJhbnNtaXR0aW5nICgzMiBiaXRzIG51bWJlciBhY2NydWluZyBvdmVyIHRpbWUpCisgICAgdEFOSV9VMzIgICByeF90aW1lOyAgICAgICAgICAgICAgICAgICAgLy8gbXNlY3MgdGhlIHJhZGlvIGlzIGluIGFjdGl2ZSByZWNlaXZlICgzMiBiaXRzIG51bWJlciBhY2NydWluZyBvdmVyIHRpbWUpCisgICAgdEFOSV9VMzIgICBvbl90aW1lX3NjYW47ICAg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nQ7ICAgICAgICAgICAgICAvLyBudW1iZXIgb2Ygc2hvcnQgZGF0YSBwa3QgcmV0cmllcworICAgIHRBTklfVTMyIHJldHJpZXNfbG9uZzsgICAgICAgICAgICAgICAvLyBudW1iZXIgb2YgbG9uZyBkYXRhIHBrdCByZXRyaWVzCisgICAgdEFOSV9VMzIgY29udGVudGlvbl90aW1lX21pbjsgICAgICAgIC8vIGRhdGEgcGt0IG1pbiBjb250ZW50aW9uIHRpbWUgKHVzZWNzKQorICAgIHRBTklfVTMyIGNvbnRlbnRpb25fdGltZV9tYXg7ICAgICAgICAvLyBkYXRhIHBrdCBtYXggY29udGVudGlvbiB0aW1lICh1c2VjcykKKyAgICB0QU5JX1UzMiBjb250ZW50aW9uX3RpbWVfYXZnOyAgICAgICAgLy8gZGF0YSBwa3QgYXZnIGNvbnRlbnRpb24gdGltZSAodXNlY3MpCisgICAgdEFOSV9VMzIgY29udGVudGlvbl9udW1fc2FtcGxlczsgICAgIC8vIG51bSBvZiBkYXRhIHBrdHMgdXNlZCBmb3IgY29udGVudGlvbiBzdGF0aXN0aWNzCit9IHdpZmlfd21tX2FjX3N0YXQ7CisKKy8qIEludGVyZmFjZSBzdGF0aXN0aWNzIC0gY29ycmVzcG9uZGluZyB0byAybmQgbW9zdCBMU0IgaW4gd2lmaSBzdGF0aXN0aWNzIGJpdG1hcCAgZm9yIGdldHRpbmcgc3RhdGlzdGljcyAqLwordHlwZWRlZiBQQUNLRURfUFJFIHN0cnVjdCBQQUNLRURfUE9TVAoreworICAgIHdpZmlfaW50ZXJmYWNlX2luZm8gaW5mbzsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBjdXJyZW50IHN0YXRlIG9mIHRoZSBpbnRlcmZhY2UKKyAgICB0QU5JX1UzMiAgICAgICAgICAgIGJlYWNvbl9yeDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYWNjZXNzIHBvaW50IGJlYWNvbiByZWNlaXZlZCBjb3VudCBmcm9tIGNvbm5lY3RlZCBBUAorICAgIHRBTklfVTMyICAgICAgICAgICAgbWdtdF9yeDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhY2Nlc3MgcG9pbnQgbWdtdCBmcmFtZXMgcmVjZWl2ZWQgY291bnQgZnJvbSBjb25uZWN0ZWQgQVAgKGluY2x1ZGluZyBCZWFjb24pCisgICAgdEFOSV9VMzIgICAgICAgICAgICBtZ210X2FjdGlvbl9yeDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFjdGlvbiBmcmFtZXMgcmVjZWl2ZWQgY291bnQKKyAgICB0QU5JX1UzMiAgICAgICAgICAgIG1nbXRfYWN0aW9uX3R4OyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYWN0aW9uIGZyYW1lcyB0cmFuc21pdCBjb3VudAorICAgIHRBTklfVTMyICAgICAgICAgICAgcnNzaV9tZ210OyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhY2Nlc3MgUG9pbnQgQmVhY29uIGFuZCBNYW5hZ2VtZW50IGZyYW1lcyBSU1NJIChhdmVyYWdlZCkKKyAgICB0QU5JX1UzMiAgICAgICAgICAgIHJzc2lfZGF0YTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYWNjZXNzIFBvaW50IERhdGEgRnJhbWVzIFJTU0kgKGF2ZXJhZ2VkKSBmcm9tIGNvbm5lY3RlZCBBUAorICAgIHRBTklfVTMyICAgICAgICAgICAgcnNzaV9hY2s7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhY2Nlc3MgUG9pbnQgQUNLIFJTU0kgKGF2ZXJhZ2VkKSBmcm9tIGNvbm5lY3RlZCBBUAorICAgIHdpZmlfd21tX2FjX3N0YXQgICAgQWNjZXNzY2xhc3NTdGF0c1tXSUZJX0FDX01BWF07ICAgICAgICAgICAgICAvLyBwZXIgYWMgZGF0YSBwYWNrZXQgc3RhdGlzd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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKworI2lmIGRlZmluZWQoX19BTklfQ09NUElMRVJfUFJBR01BX1BBQ0tfU1RBQ0spCisjcHJhZ21hIHBhY2socHVzaCwgMSkKKyNlbGlmIGRlZmluZWQoX19BTklfQ09NUElMRVJfUFJBR01BX1BBQ0spCisjcHJhZ21hIHBhY2soMSkKKyNlbHNlCisjZW5kaWYKKworLy8vIERlZmluaXRpb24gZm9yIEhBTCBBUEkgVmVyc2lvbi4KK3R5cGVkZWYgUEFDS0VEX1BSRSBzdHJ1Y3QgUEFDS0VEX1BPU1QKK3sKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAgcmV2aXNpb247CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgIHZlcnNpb247CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgIG1pbm9yOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICBtYWpvcjsKK30gdFdjbnNzV2xhblZlcnNpb24sICp0cFdjbnNzV2xhblZlcnNpb247CisKKy8vLyBEZWZpbml0aW9uIGZvciBFbmNyeXB0aW9uIEtleXMKK3R5cGVkZWYgUEFDS0VEX1BSRSBzdHJ1Y3QgUEFDS0VEX1BPU1QKK3sKKyAgICB0QU5JX1U4ICAgICAgICAgICAgICAgICAga2V5SWQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgIHVuaWNhc3Q7ICAvLyAwIGZvciBtdWx0aWNhc3QKKyAgICB0QW5pS2V5RGlyZWN0aW9uICAgICAgICAga2V5RGlyZWN0aW9uOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICBrZXlSc2NbV0xBTl9NQVhfS0VZX1JTQ19MRU5dOyAgLy8gVXNhZ2UgaXMgdW5rbm93bgorICAgIHRBTklfVTggICAgICAgICAgICAgICAgICBwYWVSb2xlOyAgLy8gPTEgZm9yIGF1dGhlbnRpY2F0b3IsPTAgZm9yI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FOX0hBTF9JTklUX1NDQU5fUkVRCistLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworCisvLy8gRnJhbWUgY29udHJvbCBmaWVsZCBmb3JtYXQgKDIgYnl0ZXMpCit0eXBlZGVmICBfX2FuaV9hdHRyX3ByZV9wYWNrZWQgc3RydWN0IHNTaXJNYWNGcmFtZUN0bAoreworCisjaWZuZGVmIEFOSV9MSVRUTEVfQklUX0VORElBTgorCisgICAgdEFOSV9VOCBzdWJUeXBlIDo0OworICAgIHRBTklfVTggdHlwZSA6MjsKKyAgICB0QU5JX1U4IHByb3RWZXIgOjI7CisKKyAgICB0QU5JX1U4IG9yZGVyIDoxOworICAgIHRBTklfVTggd2VwIDoxOworICAgIHRBTklfVTggbW9yZURhdGEgOjE7CisgICAgdEFOSV9VOCBwb3dlck1nbXQgOjE7CisgICAgdEFOSV9VOCByZXRyeSA6MTsKKyAgICB0QU5JX1U4IG1vcmVGcmFnIDoxOworICAgIHRBTklfVTggZnJvbURTIDoxOworICAgIHRBTklfVTggdG9EUyA6MTsKKworI2Vsc2UKKworICAgIHRBTklfVTggcHJvdFZlciA6MjsKKyAgICB0QU5JX1U4IHR5cGUgOjI7CisgICAgdEFOSV9VOCBzdWJUeXBlIDo0OworCisgICAgdEFOSV9VOCB0b0RTIDoxOworICAgIHRBTklfVTggZnJvbURTIDoxOworICAgIHRBTklfVTggbW9yZUZyYWcgOjE7CisgICAgdEFOSV9VOCByZXRyeSA6MTsKKyAgICB0QU5JX1U4IHBvd2VyTWdtdCA6MTsKKyAgICB0QU5JX1U4IG1vcmVEYXRhIDoxOworICAgIHRBTklfVTggd2VwIDoxOworICAgIHRBTklfVTggb3JkZXIgOjE7CisKKyNlbmRpZgorCit9IF9fYW5pX2F0dHJfcGFja2VkICB0U2lyTWFjRnJhbWVDdGwsICp0cFNpck1hY0ZyYW1lQ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30gdEhhbEVuY0NvbmZpZ1BhcmFtczsKKwordHlwZWRlZiBQQUNLRURfUFJFIHN0cnVjdCBQQUNLRURfUE9TVAoreworICAgdWludDE2IGxlbmd0aDsKKyAgIHVpbnQ4ICBkYXRhW0RJU0FfTUFYX1BBWUxPQURfU0laRV07Cit9IHRIYWxEaXNhUGF5bG9hZDsKKwordHlwZWRlZiBQQUNLRURfUFJFIHN0cnVjdCBQQUNLRURfUE9TVAoreworI2lmZGVmIEJZVEVfT1JERVJfQklHX0VORElBTgorICAgIHVpbnQ4ICAgcmVzZXJ2ZWQxICAgICAgICAgIDogMTsKKyAgICB1aW50OCAgIGFja3BvbGljeSAgICAgICAgICA6IDI7CisgICAgdWludDggICBlb3NwICAgICAgICAgICAgICAgOiAxOworICAgIHVpbnQ4ICAgdGlkICAgICAgICAgICAgICAgIDogNDsKKworICAgIHVpbnQ4ICAgYXBwc2J1ZmZlcnN0YXRlICAgIDogODsKKyNlbHNlCisgICAgdWludDggICBhcHBzYnVmZmVyc3RhdGUgICAgOiA4OworCisgICAgdWludDggICB0aWQgICAgICAgICAgICAgICAgOiA0OworICAgIHVpbnQ4ICAgZW9zcCAgICAgICAgICAgICAgIDogMTsKKyAgICB1aW50OCAgIGFja3BvbGljeSAgICAgICAgICA6IDI7CisgICAgdWludDggICByZXNlcnZlZDEgICAgICAgICAgOiAxOworI2VuZGlmCit9IHRIYWxRb3NDdHJsRmllbGRUeXBlOworCit0eXBlZGVmIFBBQ0tFRF9QUkUgc3RydWN0IFBBQ0tFRF9QT1NUCisgeworI2lmZGVmICBCWVRFX09SREVSX0JJR19FTkRJQU4KKyAgICB1aW50MTYgc3VidHlwZSAgIDogNDsKKyAgICB1aW50MTYgdHlwZSAgICAgIDogMjsKKyAgICB1aW50MTYgcHJvdG9jb2wgIDogMjsKKworICAgIHVpbnQxNiBvcmRlciAgICAgOiAxOworICAgIHVpbnQxNiB3ZXAgICAgICAgOiAxOworICAgIHVpbnQxNiBtb3JlZGF0YSAgOiAxOworICAgIHVpbnQxNiBwbSAgICAgICAgOiAxOworICAgIHVpbnQxNiByZXRyeSAgICAgOiAxOworICAgIHVpbnQxNiBtb3JlZnJhZyAgOiAxOworICAgIHVpbnQxNiBmcm9tZHMgICAgOiAxOworICAgIHVpbnQxNiB0b2RzICAgICAgOiAxOworI2Vsc2UKKworICAgIHVpbnQxNiB0b2RzICAgICAgOiAxOworICAgIHVpbnQxNiBmcm9tZHMgICAgOiAxOworICAgIHVpbnQxNiBtb3JlZnJhZyAgOiAxOworICAgIHVpbnQxNiByZXRyeSAgICAgOiAxOworICAgIHVpbnQxNiBwbSAgICAgICAgOiAxOworICAgIHVpbnQxNiBtb3JlZGF0YSAgOiAxOworICAgIHVpbnQxNiB3ZXAgICAgICAgOiAxOworICAgIHVpbnQxNiBvcmRlciAgICAgOiAxOworCisgICAgdWludDE2IHByb3RvY29sICA6IDI7CisgICAgdWludDE2IHR5cGUgICAgICA6IDI7CisgICAgdWludDE2IHN1YnR5cGUgICA6IDQ7CisjZW5kaWYKK30gdEhhbEZybUN0cmxUeXBlOworCit0eXBlZGVmIFBBQ0tFRF9QUkUgc3RydWN0IFBBQ0tFRF9QT1NUCit7CisgICAvKiBGcmFtZSBjb250cm9sIGZpZWxkICovCisgICB0SGFsRnJtQ3RybFR5cGUgZmM7CisgICAvKiBEdXJhdGlvbiBJRCAqLworICAgdWludDE2IHVzRHVyYXRpb25JZDsKKyAgIC8qIEFkZHJlc3MgMSBmaWVsZCAqLworICAgdWludDggdkExW0hBTF9NQUNfQUREUl9MRU5dOworICAgLyogQWRkcmVzcyAyIGZpZWxkICovCisgICB1aW50OCB2QTJbSEFMX01BQ19BRERSX0xFTl07CisgICAvKiBBZGRyZXNzIDMgZmllbGQgKi8KKyAgIHVpbnQ4IHZBM1tIQUxfTUFDX0FERFJfTEVOXTsKKyAgIC8qIFNlcXVlbmNlIGNvbnRyb2wgZmllbGQgKi8KKyAgIHVpbnQxNiBzZXFOdW07CisgICAvKiBPcHRpb25h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IGRwdURlc2NJbmR4OworCisgICAgLyogUFRLIERQVSBzaWduYXR1cmUgKi8KKyAgICB0QU5JX1U4ICAgIHVjYXN0RHB1U2lnbmF0dXJlOworCisgICAgLyogRFBVIGRlc2NyaXB0b3IgaW5kZXggZm9yIEdUSyovCisgICAgdEFOSV9VOCAgICBiY2FzdERwdURlc2NJbmR4OworCisgICAgLyogR1RLIERQVSBzaWduYXR1cmUgKi8KKyAgICB0QU5JX1U4ICAgIGJjYXN0RHB1U2lnbmF0dXJlOworCisgICAgLypEUFUgZGVzY3JpcHRvciBmb3IgSUdUSyovCisgICAgdEFOSV9VOCAgICBtZ210RHB1RGVzY0luZHg7CisKKyAgICAvKiBJR1RLIERQVSBzaWduYXR1cmUgKi8KKyAgICB0QU5JX1U4ICAgIG1nbXREcHVTaWduYXR1cmU7CisKKyAgICAvKiBTdGF0aW9uIEluZGV4IGZvciBCU1MgZW50cnkqLworICAgIHRBTklfVTggICAgIGJzc1N0YUlkeDsKKworICAgIC8qIFNlbGYgc3RhdGlvbiBpbmRleCBmb3IgdGhpcyBCU1MgKi8KKyAgICB0QU5JX1U4ICAgICBic3NTZWxmU3RhSWR4OworCisgICAgLyogQmNhc3Qgc3RhdGlvbiBmb3IgYnVmZmVyaW5nIGJjYXN0IGZyYW1lcyBpbiBBUCByb2xlICovCisgICAgdEFOSV9VOCAgICAgYnNzQmNhc3RTdGFJZHg7CisKKyAgICAvKk1BQyBBZGRyZXNzIG9mIFNUQShQRUVSL1NFTEYpIGluIHN0YUNvbnRleHQgb2YgY29uZmlnQlNTUmVxKi8KKyAgICB0U2lyTWFjQWRkciAgIHN0YU1hYzsKKworICAgIC8qSEFMIGZpbGxzIGluIHRoZSB0eCBwb3dlciB1c2VkIGZvciBtZ210IGZyYW1lcyBpbiB0aGlzIGZpZWxkLiAqLworICAgIHRBTklfUzggICAgIHR4TWdtdFBvd2VyOworCit9IHRDb25maWdCc3NSc3BQYXJhbXMsICogdHBDb25maWdCc3NSc3BQYXJhbX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B0aGUgTUFDIGxheWVyIGRpc2NhcmRlZCB3aGVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3RoZSBJRUVFIDgwMi4xMSBkb3QxMUV4Y2x1ZGVVbmVuY3J5cHRlZCBtYW5hZ2VtZW50IGluZm9ybWF0aW9uIGJhc2UgKE1JQikgb2JqZWN0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2lzIGVuYWJsZWQKKyAgICB0QU5JX1UzMiByeF9taWNfZmFpbF9jbnQ7ICAgICAgICAgICAgIC8vVGhlIG51bWJlciBvZiByZWNlaXZlZCBNU0RVIHBhY2tldHMgdGhhdCB0aGF0IHRoZSA4MDIuMTEgc3RhdGlvbiBkaXNjYXJkZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vYmVjYXVzZSBvZiBNSUMgZmFpbHVyZXMKKyAgICB0QU5JX1UzMiB0a2lwX2ljdl9lcnI7ICAgICAgICAgICAgICAgIC8vVGhlIG51bWJlciBvZiBlbmNyeXB0ZWQgTVBEVSBmcmFtZXMgdGhhdCB0aGUgODAyLjExIHN0YXRpb24gZmFpbGVkIHRvIGRlY3J5cHQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vYmVjYXVzZSBvZiBhIFRLSVAgSUNWIGVycm9yCisgICAgdEFOSV9VMzIgYWVzX2NjbXBfZm9ybWF0X2VycjsgICAgICAgICAvL1RoZSBudW1iZXIgb2YgcmVjZWl2ZWQgTVBEVSBmcmFtZXMgdGhhdCB0aGUgODAyLjExIGRpc2NhcmRlZCBiZWNhdXNlIG9mIGFuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2ludmFsaWQgQUVTLUNDTVAgZm9ybWF0CisgICAgdEFOSV9VMzIgYWVzX2NjbXBfcmVwbGF5X2NudDsgICAgICAgICAvL1RoZSBudW1iZXIgb2YgcmVjZ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1Npck1hY1RzcGVjSUUKK3sKKyAgICB0QU5JX1U4ICAgICAgICAgICAgIHR5cGU7CisgICAgdEFOSV9VOCAgICAgICAgICAgICBsZW5ndGg7CisgICAgdFNpck1hY1RTSW5mbyAgICAgICB0c2luZm87CisgICAgdEFOSV9VMTYgICAgICAgICAgICBub21Nc2R1U3o7CisgICAgdEFOSV9VMTYgICAgICAgICAgICBtYXhNc2R1U3o7CisgICAgdEFOSV9VMzIgICAgICAgICAgICBtaW5TdmNJbnRlcnZhbDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgIG1heFN2Y0ludGVydmFsOworICAgIHRBTklfVTMyICAgICAgICAgICAgaW5hY3RJbnRlcnZhbDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgIHN1c3BlbmRJbnRlcnZhbDsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgIHN2Y1N0YXJ0VGltZTsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgIG1pbkRhdGFSYXRlOworICAgIHRBTklfVTMyICAgICAgICAgICAgbWVhbkRhdGFSYXRlOworICAgIHRBTklfVTMyICAgICAgICAgICAgcGVha0RhdGFSYXRlOworICAgIHRBTklfVTMyICAgICAgICAgICAgbWF4QnVyc3RTejsKKyAgICB0QU5JX1UzMiAgICAgICAgICAgIGRlbGF5Qm91bmQ7CisgICAgdEFOSV9VMzIgICAgICAgICAgICBtaW5QaHlSYXRlOworICAgIHRBTklfVTE2ICAgICAgICAgICAgc3VycGx1c0J3OworICAgIHRBTklfVTE2ICAgICAgICAgICAgbWVkaXVtVGltZTsKK31fX2FuaV9hdHRyX3BhY2tlZCB0U2lyTWFjVHNwZWNJRTsKKwordHlwZWRlZiBQQUNLRURfUFJFIHN0cnVjdCBQQUNLRURfUE9TVAoreworICAgIC8qIFN0YXRpb24gSW5kZXggKi8KKyAgICB0QU5JX1UxNiBzdGFJZHg7CisKKyAgICAvKiBUU1BFQyBoYW5kbGVyIHVuaXF1ZWx5IGlkZW50aWZ5aW5nIGE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BFX09QRU5fU1lTVEVNICAgICAgICAgICA9IDEsCisKKyAgICAvLyBVcHBlciBsYXllciBhdXRoZW50aWNhdGlvbiB0eXBlcworICAgIGVBVVRIX1RZUEVfV1BBICAgICAgICAgICAgICAgICAgID0gMiwKKyAgICBlQVVUSF9UWVBFX1dQQV9QU0sgICAgICAgICAgICAgICA9IDMsCisKKyAgICBlQVVUSF9UWVBFX1JTTiAgICAgICAgICAgICAgICAgICA9IDQsCisgICAgZUFVVEhfVFlQRV9SU05fUFNLICAgICAgICAgICAgICAgPSA1LAorICAgIGVBVVRIX1RZUEVfRlRfUlNOICAgICAgICAgICAgICAgID0gNiwKKyAgICBlQVVUSF9UWVBFX0ZUX1JTTl9QU0sgICAgICAgICAgICA9IDcsCisgICAgZUFVVEhfVFlQRV9XQVBJX1dBSV9DRVJUSUZJQ0FURSAgPSA4LAorICAgIGVBVVRIX1RZUEVfV0FQSV9XQUlfUFNLICAgICAgICAgID0gOSwKKyAgICBlQVVUSF9UWVBFX0NDS01fV1BBICAgICAgICAgICAgICA9IDEwLAorICAgIGVBVVRIX1RZUEVfQ0NLTV9SU04gICAgICAgICAgICAgID0gMTEsCisgICAgZUFVVEhfVFlQRV9SU05fUFNLX1NIQTI1NiAgICAgICAgPSAxMiwKKyAgICBlQVVUSF9UWVBFX1JTTl84MDIxWF9TSEEyNTYgICAgICA9IDEzLAorCisgICAgZUFVVEhfVFlQRV9NQVggPSBXTEFOX0hBTF9NQVhfRU5VTV9TSVpFCisKK310QXV0aFR5cGU7CisKKy8qIEVuY3J5cHRpb24gdHlwZSAqLwordHlwZWRlZiBlbnVtIGVFZFR5cGUKK3sKKyAgICBlRURfQU5ZICAgICAgICAgICA9IDAsCisgICAgZUVEX05PTkUgICAgICAgICAgPSAxLAorICAgIGVFRF9XRVAgICAgICAgICAgID0gMiwKKyAgICBlRURfVEtJUCAgICAgICAgICA9IDMsCisgICAgZUVEX0NDTVAgICAgICAgICAgPSA0LAorICAgIGVFRF9XUEkgICAgIC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ICAgICAgVmFsaWRDaGFubmVsQ291bnQ7CisgICB0QU5JX1U4ICAgICAgICAgICBWYWxpZENoYW5uZWxMaXN0W1dMQU5fSEFMX1JPQU1fU0NBTl9NQVhfQ0hBTk5FTFNdOworICAgZUFuaUJvb2xlYW4gICAgICAgSXNFU0VFbmFibGVkOworCisgICB0QU5JX1UxNiAgICAgICAgICB1czI0R1Byb2JlU2l6ZTsKKyAgIHRBTklfVTggICAgICAgICAgIGEyNEdQcm9iZVRlbXBsYXRlW1dMQU5fSEFMX1JPQU1fU0NBTl9NQVhfUFJPQkVfU0laRV07CisgICB0QU5JX1UxNiAgICAgICAgICB1czVHUHJvYmVTaXplOworICAgdEFOSV9VOCAgICAgICAgICAgYTVHUHJvYmVUZW1wbGF0ZVtXTEFOX0hBTF9ST0FNX1NDQU5fTUFYX1BST0JFX1NJWkVdOworICAgLyogQWRkIFJlc2VydmVkIGJ5dGVzICovCisgICB0QU5JX1U4ICAgICAgICAgICBuUHJvYmVzOworICAgdEFOSV9VMTYgICAgICAgICAgSG9tZUF3YXlUaW1lOworICAgZUFuaUJvb2xlYW4gICAgICAgTUFXQ0VuYWJsZWQ7CisgICB0QU5JX1M4ICAgICAgICAgICBSeFNlbnNpdGl2aXR5VGhyZXNob2xkOworICAgdEFOSV9VOCAgICAgICAgICAgUm9hbU9mZmxvYWRFbmFibGVkOworICAgdEFOSV9VOCAgICAgICAgICAgUE1LW1dMQU5fSEFMX1JPQU1fU0FDTl9QTUtfU0laRV07CisgICB0QU5JX1U4ICAgICAgICAgICBQcmVmZXI1R0h6OworICAgdEFOSV9VOCAgICAgICAgICAgUm9hbVJzc2lDYXRHYXA7CisgICB0QU5JX1U4ICAgICAgICAgICBTZWxlY3Q1R0h6TWFyZ2luOworICAgdEFOSV9VOCAgICAgICAgICAgUmVzZXJ2ZWRCeXRlc1tXTEFOX0hBTF9ST0FNX1NDQU5fUkVTRVJWRURfQllURVNdOworICAgdFJvYW1OZXR3b3JrVHlwZSAgQ29ubmV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OSV9VOCAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzZXJ2ZWQ7IC8qIFJlc2VydmVkIGZpZWxkICovCisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcGFyZURhdGFbSEFMX1BST1RPQ09MX0RBVEFfTEVOXTsgIC8qIERhdGEgdG8gY29tcGFyZSAqLworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFNYXNrW0hBTF9QUk9UT0NPTF9EQVRBX0xFTl07ICAgLyogTWFzayB0byBiZSBhcHBsaWVkIG9uIHRoZSByZWNlaXZlZCBwYWNrZXQgZGF0YSBiZWZvcmUgY29tcGFyZSAqLworfXRIYWxSY3ZQa3RGaWx0ZXJQYXJhbXMsICp0cEhhbFJjdlBrdEZpbHRlclBhcmFtczsKKwordHlwZWRlZiBQQUNLRURfUFJFIHN0cnVjdCBQQUNLRURfUE9TVAoreworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgICAgZmlsdGVySWQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgICAgICBmaWx0ZXJUeXBlOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgICAgbnVtUGFyYW1zOworICAgIHRBTklfVTMyICAgICAgICAgICAgICAgICAgICAgICAgY29hbGVzY2VUaW1lOworICAgIHRIYWxSY3ZQa3RGaWx0ZXJQYXJhbXMgICAgICAgICAgcGFyYW1zRGF0YVsxXTsKK310SGFsUmN2UGt0RmlsdGVyQ2ZnVHlwZSwgKnRwSGFsUmN2UGt0RmlsdGVyQ2ZnVHlwZTsKKwordHlwZWRlZiBQQUNLRURfUFJFIHN0cnVjdCBQQUNLRURfUE9TVAoreworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgICAgZmlsdGVySWQ7CisgICAgdEFOSV9VOCAgICAgICAgICAgICAgICAgICAgICAgICBmaWx0ZXJUeXBlOworICAgIHRBTklfVTggICAgICAgICAgICAgICAgICAgICAgICA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gICAgICAgICAgID0gMTEsCisgICAgQkNOX01JU1NfT0ZGTE9BRCAgICAgICA9IDEyLAorICAgIFNUQV9QT1dFUlNBVkUgICAgICAgICAgPSAxMywKKyAgICBTVEFfQURWQU5DRURfUFdSU0FWRSAgID0gMTQsCisgICAgQVBfVUFQU0QgICAgICAgICAgICAgICA9IDE1LAorICAgIEFQX0RGUyAgICAgICAgICAgICAgICAgPSAxNiwKKyAgICBCTE9DS0FDSyAgICAgICAgICAgICAgID0gMTcsCisgICAgUEhZX0VSUiAgICAgICAgICAgICAgICA9IDE4LAorICAgIEJDTl9GSUxURVIgICAgICAgICAgICAgPSAxOSwKKyAgICBSVFQgICAgICAgICAgICAgICAgICAgID0gMjAsCisgICAgUkFURUNUUkwgICAgICAgICAgICAgICA9IDIxLAorICAgIFdPVyAgICAgICAgICAgICAgICAgICAgPSAyMiwKKyAgICBXTEFOX1JPQU1fU0NBTl9PRkZMT0FEID0gMjMsCisgICAgU1BFQ1VMQVRJVkVfUFNfUE9MTCAgICA9IDI0LAorICAgIFNDQU5fU0NIICAgICAgICAgICAgICAgPSAyNSwKKyAgICBJQlNTX0hFQVJUQkVBVF9PRkZMT0FEID0gMjYsCisgICAgV0xBTl9TQ0FOX09GRkxPQUQgICAgICA9IDI3LAorICAgIFdMQU5fUEVSSU9ESUNfVFhfUFRSTiAgPSAyOCwKKyAgICBBRFZBTkNFX1RETFMgICAgICAgICAgID0gMjksCisgICAgQkFUQ0hfU0NBTiAgICAgICAgICAgICA9IDMwLAorICAgIEZXX0lOX1RYX1BBVEggICAgICAgICAgPSAzMSwKKyAgICBFWFRFTkRFRF9OU09GRkxPQURfU0xPVCA9IDMyLAorICAgIENIX1NXSVRDSF9WMSAgICAgICAgICAgPSAzMywKKyAgICBIVDQwX09CU1NfU0NBTiAgICAgICAgID0gMzQsCisgICAgVVBEQVRFX0NIQU5ORUxfTElTVCAgICA9IDM1LAorICAgIFdMQU5fTUNBRERSX0ZMVCAgICAgICAgPSAzNiwKKyA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ICAgICAgICAgICAgICAgIGJpdF9pbmRleCA9IChiKSUzMjsgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihhcnJfaW5kZXggPCA0KSBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhKS0+ZmVhdENhcHNbYXJyX2luZGV4XSB8PSAoMTw8Yml0X2luZGV4KTsgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisjZGVmaW5lIGdldEZlYXRDYXBzKGEsYixjKSB7ICB0QU5JX1UzMiBhcnJfaW5kZXgsIGJpdF9pbmRleDsgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChiKTw9MTI3KSB7IFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyX2luZGV4ID0gKGIpLzMyOyBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJpdF9pbmRleCA9IChiKSUzMjsgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYykgPSAoKGEpLT5mZWF0Q2Fwc1thcnJfaW5kZXhdICYgKDE8PGJpdF9pbmRleCkpPzE6MDsgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisjZGVmaW5lIGNsZWFyRmVhdENhcHMoYSxiKSB7ICB0QU5JX1UzMiBhcnJfaW5kZXgsIGJpdF9pbmRleDsgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChiKTw9MTI3KSB7IFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyX2luZGV4ID0gKGIpLzMyOyBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJpdF9pbmRleCA9IChiKSUzMjsgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYSktPmZlYXRDYXBzW2Fycl9pbmRleF0gJj0gfigxPDxiaXRfa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ICAgICAgYUFjazoxOworICAgIHRBTklfVTggICAgICAgIG1heFNlcnZpY2VQZXJpb2RMZW5ndGg6MjsKKyAgICB0QU5JX1U4ICAgICAgICBtb3JlRGF0YUFjazoxOworCisgICAgLypURExTIFBlZXIgVS1BUFNEIEJ1ZmZlciBTVEEgU3VwcG9ydCovCisgICAgdEFOSV9VOCAgICAgICAgVFBVQnVmZmVyU3RhU3VwcG9ydDsKKworICAgIC8qVERMUyBvZmYgY2hhbm5lbCByZWxhdGVkIHBhcmFtcyAqLworICAgIHRBTklfVTggICAgICAgIHRkbHNPZmZDaGFubmVsU3VwcG9ydDsKKyAgICB0QU5JX1U4ICAgICAgICBwZWVyQ3Vyck9wZXJDbGFzczsKKyAgICB0QU5JX1U4ICAgICAgICBzZWxmQ3Vyck9wZXJDbGFzczsKKyAgICB0QU5JX1U4ICAgICAgICB2YWxpZENoYW5uZWxzTGVuOworICAgIHRBTklfVTggICAgICAgIHZhbGlkQ2hhbm5lbHNbSEFMX01BWF9TVVBQX0NIQU5ORUxTXTsKKyAgICB0QU5JX1U4ICAgICAgICB2YWxpZE9wZXJDbGFzc2VzTGVuOworICAgIHRBTklfVTggICAgICAgIHZhbGlkT3BlckNsYXNzZXNbSEFMX01BWF9TVVBQX09QRVJfQ0xBU1NFU107Cit9dFRETFNMaW5rRXN0YWJsaXNoZWRUeXBlLCAqdHBURExTTGlua0VzdGFibGlzaGVkVHlwZTsKKwordHlwZWRlZiBQQUNLRURfUFJFIHN0cnVjdCBQQUNLRURfUE9TVAoreworICAgIHRIYWxNc2dIZWFkZXIgICAgICAgICAgICAgICBoZWFkZXI7CisgICAgdFRETFNMaW5rRXN0YWJsaXNoZWRUeXBlICAgIHRkbHNMaW5rRXN0YWJsaXNoZWRQYXJhbXM7Cit9IHRURExTTGlua0VzdGFibGlzaGVkUmVxTXNnLCAqdHBURExTTGlua0VzdGFibGlzaGVkUmVxTXNnOworCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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orCisgICAgJElkJAorCisKKyAgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCisKKyNpZiAhZGVmaW5lZCggX19XTEFOX05WX0ggKQorI2RlZmluZSBfX1dMQU5fTlZfSAorCisjaW5jbHVkZSAiaGFsTGVnYWN5UGFsVHlwZXMuaCIKKyNpbmNsdWRlICJoYWxDb21waWxlci5oIgorCisvL0Zyb20gSEFML2luYy9oYWxOdi5oCit0eXBlZGVmIGVudW0KK3sKKyAgICAvL0NvbW1vbiBOdiBGaWVsZHMKKyAgICBOVl9DT01NT05fUFJPRFVDVF9JRCwgICAgICAgICAgICAgICAvLyAwCisgICAgTlZfQ09NTU9OX1BST0RVQ1RfQkFORFMsICAgICAgICAgICAgLy8gMQorICAgIE5WX0NPTU1PTl9OVU1fT0ZfVFhfQ0hBSU5TLCAgICAgICAgIC8vIDIKKyAgICBOVl9DT01NT05fTlVNX09GX1JYX0NIQUlOUywgICAgICAgICAvLyAzCisgICAgTlZfQ09NTU9OX01BQ19BRERSLCAgICAgICAgICAgICAgICAgLy8gNAorICAgIE5WX0NPTU1PTl9NRkdfU0VSSUFMX05VTUJFUiwgICAgICAgIC8vIDUKKyAgICBOVl9DT01NT05fV0xBTl9OVl9SRVZfSUQsICAgICAgICAgICAvLyA2CisgICAgTlZfQ09NTU9OX0NPVVBMRVJfVFlQRSwgICAgICAgICAgICAgLy8gNworICAgIE5WX0NPTU1PTl9OVl9WRVJTSU9OLCAgICAgICAgICAgICAgIC8vIDgKKyAgICBOVl9DT01NT05fUkVTRVJWRUQsICAgICAgICAgICAgICAgICAvLyA5CisKKyAgICBOVU1fTlZfRklFTERTLAorICAgIE5WX01BWF9GSUVMRCA9IDB4N0ZGRkZGRkYgIC8qIGRlZmluZSBhcyA0IGJ5dGVzIGRhdGEgKi8KKworfWVOdkZpZWxkOworCisKKyNkZWZpbmUgTlZfRklFTERfTUFDX0FERFJfU0laR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AgICAgICAgICAgMHgyMAorI2RlZmluZSBIV19DQUxfVkFMVUVTX1ZBTElEX0FOVEVOTkFfRElWRVJTSVRZX0VOQUJMRURfTUFTSyAgICAgICAgICAweDQwCisjZGVmaW5lIEhXX0NBTF9WQUxVRVNfVkFMSURfQ1VTVE9NX1JDX0RFTEFZX01BU0sgICAgICAgICAgICAgICAgICAgIDB4ODAKKworLy9Gcm9tIHdsYW5mdy9pbmMvaGFsUGh5Q2FsTWVtb3J5LmgKK3R5cGVkZWYgUEFDS0VEX1BSRSBzdHJ1Y3QgUEFDS0VEX1BPU1QKK3sKKyAgICB1aW50MTYgICAgcHNTbHBUaW1lT3ZySGQyRzsKKyAgICB1aW50MTYgICAgcHNTbHBUaW1lT3ZySGQ1RzsKKworICAgIHVpbnQxNiAgICBwc1NscFRpbWVPdnJIZHhMTkE1RzsKKyAgICB1aW50OCAgICAgbnZfVHhCQkZTZWw5TUh6ICAgICAgIDogMTsKKyAgICB1aW50OCAgICAgaHdQYXJhbTEgICAgICAgICAgICAgIDogNzsKKyAgICB1aW50OCAgICAgaHdQYXJhbTI7CisgICAgCisgICAgdWludDE2ICAgIGN1c3RvbV90Y3hvX3JlZzg7CisgICAgdWludDE2ICAgIGN1c3RvbV90Y3hvX3JlZzk7CisgICAgCisgICAgdWludDMyICAgIGh3UGFyYW0zOworICAgIHVpbnQzMiAgICBod1BhcmFtNDsKKyAgICB1aW50MzIgICAgaHdQYXJhbTU7CisgICAgdWludDMyICAgIGh3UGFyYW02OworICAgIHVpbnQzMiAgICBod1BhcmFtNzsKKyAgICB1aW50MzIgICAgaHdQYXJhbTg7CisgICAgdWludDMyICAgIGh3UGFyYW05OworICAgIHVpbnQzMiAgICBod1BhcmFtMTA7CisgICAgdWludDMyICAgIGh3UGFyYW0xMTsKK31zQ2FsRGF0YTsKKwordHlwZWRlZiBQQUNLRURfUFJFIHN0cnVjdCBQQUNLRURfUE9TVAoreworICAgIHVpbnQzMiB2YWxpZEJtYXA7ICAvL3VzZ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fVFBDX1BEQURDX09GRlNFVFMKKyAgICB0UmF0ZUdyb3VwUHdyVlIgICAgICBwd3JPcHRpbXVtX3ZpcnR1YWxSYXRlW05VTV9SRl9TVUJCQU5EU107ICAgICAgICAgICAgIC8vIE5WX1RBQkxFX1ZJUlRVQUxfUkFURQorICAgIHNGd0NvbmZpZyAgICAgICAgICAgIGZ3Q29uZmlnOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5WX1RBQkxFX0ZXX0NPTkZJRworICAgIHNSc3NpQ2hhbm5lbE9mZnNldHMgIHJzc2lDaGFuT2Zmc2V0c1syXTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTlZfVEFCTEVfUlNTSV9DSEFOTkVMX09GRlNFVFMKKyAgICBzSHdDYWxWYWx1ZXMgICAgICAgICBod0NhbFZhbHVlczsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5WX1RBQkxFX0hXX0NBTF9WQUxVRVMKKyAgICBpbnQxNiAgICAgICAgICAgICBhbnRlbm5hUGF0aExvc3NbTlVNX1JGX0NIQU5ORUxTXTsgICAgICAgICAgICAgICAgICAgIC8vIE5WX1RBQkxFX0FOVEVOTkFfUEFUSF9MT1NTCisgICAgaW50MTYgICAgICAgICAgICAgcGt0VHlwZVB3ckxpbWl0c1tOVU1fODAyXzExX01PREVTXVtOVU1fUkZfQ0hBTk5FTFNdOyAvLyBOVl9UQUJMRV9QQUNLRVRfVFlQRV9QT1dFUl9MSU1JVFMKKyAgICBzT2ZkbUNtZFB3ck9mZnNldCAgICBvZmRtQ21kUHdyT2Zmc2V0OyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5WX1RBQkxFX09GRE1fQ01EX1BXUl9PRkZTRVQKKyAgICBzVHhCYkZpbHRlck1vZGUgICAgICB0eGJiRmlsdGVyTW9kZTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI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VEhfTE9TUyAgICAgICAgICA9IDEyLAorICAgIE5WX1RBQkxFX1BBQ0tFVF9UWVBFX1BPV0VSX0xJTUlUUyAgID0gMTMsCisgICAgTlZfVEFCTEVfT0ZETV9DTURfUFdSX09GRlNFVCAgICAgICAgPSAxNCwKKyAgICBOVl9UQUJMRV9UWF9CQl9GSUxURVJfTU9ERSAgICAgICAgICA9IDE1LAorICAgIE5WX1RBQkxFX1ZJUlRVQUxfUkFURSAgICAgICAgICAgICAgID0gMTgsCisKKyAgICBOVU1fTlZfVEFCTEVfSURTLAorICAgIE5WX0FMTF9UQUJMRVMgICAgICAgICAgICAgICAgICAgPSAweEZGRiwKKyAgICBOVl9CSU5BUllfSU1BR0UgICAgICAgICAgICAgICAgID0gMHgxMDAwLAorICAgIE5WX01BWF9UQUJMRSAgICAgICAgICAgICAgICAgICAgPSAweDdGRkZGRkZGICAvKiBkZWZpbmUgYXMgNCBieXRlcyBkYXRhICovCit9ZU52VGFibGU7CisKK3R5cGVkZWYgUEFDS0VEX1BSRSBzdHJ1Y3QgUEFDS0VEX1BPU1QKK3sKKyAgICB0UmF0ZUdyb3VwUHdyICAgICAgICBwd3JPcHRpbXVtW05VTV9SRl9TVUJCQU5EU107ICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5WX1RBQkxFX1JBVEVfUE9XRVJfU0VUVElOR1MKKyAgICBzUmVndWxhdG9yeURvbWFpbnMgICByZWdEb21haW5zW05VTV9SRUdfRE9NQUlOU107ICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5WX1RBQkxFX1JFR1VMQVRPUllfRE9NQUlOUworICAgIHNEZWZhdWx0Q291bnRyeSAgICAgIGRlZmF1bHRDb3VudHJ5VGFibGU7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTlZfVEFCTEVfREVGQVVMVF9DT1VOVFJZCisgICAgdFRwY1Bvd2VyVGFibGUgICAgICAgcGx1dENoYXJhY3Rlcml6ZWRbTlVNX1JGX0NIQU5ORUxTXTsgICAgICAgICAgICAgICAgICAvLyBOVl9UQUJMRV9UUENfUE9XRVJfVEFCTEUKKyAgICBpbnQxNiAgICAgICAgICAgICBwbHV0UGRhZGNPZmZzZXRbTlVNX1JGX0NIQU5ORUxTXTsgICAgICAgICAgICAgICAgICAgIC8vIE5WX1RBQkxFX1RQQ19QREFEQ19PRkZTRVRTCisgICAgdFJhdGVHcm91cFB3clZSICAgICAgcHdyT3B0aW11bV92aXJ0dWFsUmF0ZVtOVU1fUkZfU1VCQkFORFNdOyAgICAgICAgICAgICAvLyBOVl9UQUJMRV9WSVJUVUFMX1JBVEUKKyAgICBzRndDb25maWcgICAgICAgICAgIGZ3Q29uZmlnOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBOVl9UQUJMRV9GV19DT05GSUcKKyAgICBzUnNzaUNoYW5uZWxPZmZzZXRzICByc3NpQ2hhbk9mZnNldHNbMl07ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5WX1RBQkxFX1JTU0lfQ0hBTk5FTF9PRkZTRVRTCisgICAgc0h3Q2FsVmFsdWVzICAgICAgICAgaHdDYWxWYWx1ZXM7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBOVl9UQUJMRV9IV19DQUxfVkFMVUVTCisgICAgaW50MTYgICAgICAgICAgICAgYW50ZW5uYVBhdGhMb3NzW05VTV9SRl9DSEFOTkVMU107ICAgICAgICAgICAgICAgICAgICAvLyBOVl9UQUJMRV9BTlRFTk5BX1BBVEhfTE9TUworICAgIGludDE2ICAgICAgICAgICAgIHBrdFR5cGVQd3JMaW1pdHNbTlVNXzgwMl8xMV9NT0RFU11bTlVNX1JGX0NIQU5ORUxTXTsgLy8gTlZfVEFCTEVfUEFDS0VUX1RZUEVfUE9XRVJfTElNSVRTCisgICAgc09mZG1DbWRQd3JPZmZzZXQgICAgb2ZkbUNtZFB3ck9mZnNldDsgICAgICAgICAgICAgICAgIC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T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKy8qKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICoKKworICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKgorCisKKyAgICBcZmlsZSB3bGFuX252Mi5oCisKKyAgICBcYnJpZWYgVHlwZXMgZm9yIE5WIGltcGxlbWVudGF0aW9uCisgICAgICAgICAgIEFueXRoaW5nIHRoYXQgbmVlZHMgdG8gYmUgcHVibGljbHkgYXZhaWxhYmxlIHNob3VsZAorICAgICAgICAgICBiZSBpbiB0aGlzIGZpbGUKKworICAgICRJZCQKKworCisgICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworCisjaWYgIWRlZmluZWQoIF9fV0xBTl9OVjJfSCApCisjZGVmaW5lIF9fV0xBTl9OVjJfSAorCisjaW5jbHVkZSAiaGFsTGVnYWN5UGFsVHlwZXMuaCIKKyNpbmNsdWRlICJoYWxDb21waWxlci5oIgorI2luY2x1ZGUgIndsYW5fbnYuaCIKKworLyogRnJvbSBoZXJlLCBOVjIgTm8gQ0gxNDQgc3VwcG9ydCByZWR1Y2VkIHN0cnVjdHVyZQorICogVGhpcyBzdHJ1Y3R1cmUgd2lsbCBiZSB1c2VkIGZvciBOVjIgYmFja3dhcmQgY29tcGF0aWJpbGl0eSAqLworCit0eXBlZGVmIGVudW0KK3sKKyAgICAvLzIuNEdIeiBCYW5kCisgICAgUkZfQ0hBTl8xX1YyICAgICAgICAgICAgICAgICA9IDAsCisgICAgUkZfQ0hBTl8yX1YyICAgICAgICAgICAgICAgICA9IDEsCisgICAgUkZfQ0hBTl8zX1YyICAgICAgICAgICAgICAgICA9IDIsCisgICAgUkZfQ0hBTl80X1YyICAgICAgICAgICAgICAgICA9IDMsCisgICAgUkZfQ0hBTl81X1YyICAgICAgICAgICAgICAgICA9IDQsCisgICAgUkZfQ0hBTl82X1YyICAgICAgICAgICAgICAgICA9IDUsCisgICAgUkZfQ0hBTl83X1YyICAgICAgICAgICAgICAgICA9IDYsCisgICAgUkZfQ0hBTl84X1YyICAgICAgICAgICAgICAgICA9IDcsCisgICAgUkZfQ0hBTl85X1YyICAgICAgICAgICAgICAgICA9IDgsCisgICAgUkZfQ0hBTl8xMF9WMiAgICAgICAgICAgICAgICA9IDksCisgICAgUkZfQ0hBTl8xMV9WMiAgICAgICAgICAgICAgICA9IDEwLAorICAgIFJGX0NIQU5fMTJfVjIgICAgICAgICAgICAgICAgPSAxMSwKKyAgICBSRl9DSEFOXzEzX1YyICAgICAgICAgICAgICAgID0gMTIsCisgICAgUkZfQ0hBTl8xNF9WMiAgICAgICAgICAgICAgICA9IDEzLAorCisgICAgLy80LjlHSHogQmFuZAorICAgIFJGX0NIQU5fMjQwX1YyICAgICAgICAgICAgICAgPSAxNCwKKyAgICBSRl9DSEFOXzI0NF9WMiAgICAgICAgICAgICAgID0gMTUsCisgICAgUkZfQ0hBTl8yNDhfVjIgICAgICAgICAgICAgICA9IDE2LAorICAgIFJGX0NIQU5fMjUyX1YyICAgICAgICAgICAgICAgPSAxNywKKyAgICBSRl9DSEFOXzIwOF9WMiAgICAgICAgICAgICAgID0gMTgsCisgICAgUkZfQ0hBTl8yMTJfVjIgICAgICAgICAgICAgICA9IDE5LAorICAgIFJGX0NIQU5fMjE2X1YyICAgICAgICAgICAgICAgPSAyMCwKKworICAgIC8vNUdIeiBMb3cgJiBNaWQgVS1OSUkgQmFuZAorICAgIFJGX0NIQU5fMzZfVjIgICAgICAgICAgICAgICAgPSAyMSwKKyAgICBSRl9DSEFOXzQwX1YyICAgICAgICAgICAgICAgID0gMjIsCisgICAgUkZfQ0hBTl80NF9WMiAgICAgICAgICAgICAgICA9IDIzLAorICAgIFJGX0NIQU5fNDhfVjIgICAgICAgICAgICAgICAgPSAyNCwKKyAgICBSRl9DSEFOXzUyX1YyICAgICAgICAgICAgICAgID0gMjUsCisgICAgUkZfQ0hBTl81Nl9WMiAgICAgICAgICAgICAgICA9IDI2LAorICAgIFJGX0NIQU5fNjBfVjIgICAgICAgICAgICAgICAgPSAyNywKKyAgICBSRl9DSEFOXzY0X1YyICAgICAgICAgICAgICAgID0gMjgsCisKKyAgICAvLzVHSHogTWlkIEJhbmQgLSBFVFNJICYgRkNDCisgICAgUkZfQ0hBTl8xMDBfVjIgICAgICAgICAgICAgICA9IDI5LAorICAgIFJGX0NIQU5fMTA0X1YyICAgICAgICAgICAgICAgPSAzMCwKKyAgICBSRl9DSEFOXzEwOF9WMiAgICAgICAgICAgICAgID0gMzEsCisgICAgUkZfQ0hBTl8xMTJfVjIgICAgICAgICAgICAgICA9IDMyLAorICAgIFJGX0NIQU5fMTE2X1YyICAgICAgICAgICAgICAgPSAzMywKKyAgICBSRl9DSEFOXzEyMF9WMiAgICAgICAgICAgICAgID0gMzQsCisgICAgUkZfQ0hBTl8xMjRfVjIgICAgICAgICAgICAgICA9IDM1LAorICAgIFJGX0NIQU5fMTI4X1YyICAgICAgICAgICAgICAgPSAzNiwKKyAgICBSRl9DSEFOXzEzMl9WMiAgICAgICAgICAgICAgID0gMzcsCisgICAgUkZfQ0hBTl8xMzZfVjIgICAgICAgICAgICAgICA9IDM4LAorICAgIFJGX0NIQU5fMTQwX1YyICAgICAgICAgICAgICAgPSAzOSwKKworICAgIC8vNUdIeiBIaWdoIFUtTklJIEJhbmQKKyAgICBSRl9DSEFOXzE0OV9WMiAgICAgICAgICAgICAgID0gNDAsCisgICAgUkZfQ0hBTl8xNTNfVjIgICAgICAgICAgICAgICA9IDQxLAorICAgIFJGX0NIQU5fMTU3X1YyICAgICAgICAgICAgICAgPSA0MiwKKyAgICBSRl9DSEFOXzE2MV9WMiAgICAgICAgICAgICAgID0gNDMsCisgICAgUkZfQ0hBTl8xNjVfVjIgICAgICAgICAgICAgICA9IDQ0LAorCisgICAgLy9DSEFOTkVMIEJPTkRFRCBDSEFOTkVMUworICAgIFJGX0NIQU5fQk9ORF8zX1YyICAgICAgICAgICAgPSA0NSwKKyAgICBSRl9DSEFOX0JPTkRfNF9WMiAgICAgICAgICAgID0gNDYsCisgICAgUkZfQ0hBTl9CT05EXzVfVjIgICAgICAgICAgICA9IDQ3LAorICAgIFJGX0NIQU5fQk9ORF82X1YyICAgICAgICAgICAgPSA0OCwKKyAgICBSRl9DSEFOX0JPTkRfN19WMiAgICAgICAgICAgID0gNDksCisgICAgUkZfQ0hBTl9CT05EXzhfVjIgICAgICAgICAgICA9IDUwLAorICAgIFJGX0NIQU5fQk9ORF85X1YyICAgICAgICAgICAgPSA1MSwKKyAgICBSRl9DSEFOX0JPTkRfMTBfVjIgICAgICAgICAgID0gNTIsCisgICAgUkZfQ0hBTl9CT05EXzExX1YyICAgICAgICAgICA9IDUzLAorICAgIFJGX0NIQU5fQk9ORF8yNDJfVjIgICAgICAgICAgPSA1NCwgICAgLy80LjlHSHogQmFuZAorICAgIFJGX0NIQU5fQk9ORF8yNDZfVjIgICAgICAgICAgPSA1NSwKKyAgICBSRl9DSEFOX0JPTkRfMjUwX1YyICAgICAgICAgID0gNTYsCisgICAgUkZfQ0hBTl9CT05EXzIxMF9WMiAgICAgICAgICA9IDU3LAorICAgIFJGX0NIQU5fQk9ORF8yMTRfVjIgICAgICAgICAgPSA1OCwKKyAgICBSRl9DSEFOX0JPTkRfMzhfVjIgICAgICAgICAgID0gNTksICAgIC8vNUdIeiBMb3cgJiBNaWQgVS1OSUkgQmFuZAorICAgIFJGX0NIQU5fQk9ORF80Ml9WMiAgICAgICAgICAgPSA2MCwKKyAgICBSRl9DSEFOX0JPTkRfNDZfVjIgICAgICAgICAgID0gNjEsCisgICAgUkZfQ0hBTl9CT05EXzUwX1YyICAgICAgICAgICA9IDYyLAorICAgIFJGX0NIQU5fQk9ORF81NF9WMiAgICAgICAgICAgPSA2MywKKyAgICBSRl9DSEFOX0JPTkRfNThfVjIgICAgICAgICAgID0gNjQsCisgICAgUkZfQ0hBTl9CT05EXzYyX1YyICAgICAgICAgICA9IDY1LAorICAgIFJGX0NIQU5fQk9ORF8xMDJfVjIgICAgICAgICAgPSA2NiwgICAgLy81R0h6IE1pZCBCYW5kIC0gRVRTSSAmIEZDQworICAgIFJGX0NIQU5fQk9ORF8xMDZfVjIgICAgICAgICAgPSA2NywKKyAgICBSRl9DSEFOX0JPTkRfMTEwX1YyICAgICAgICAgID0gNjgsCisgICAgUkZfQ0hBTl9CT05EXzExNF9WMiAgICAgICAgICA9IDY5LAorICAgIFJGX0NIQU5fQk9ORF8xMThfVjIgICAgICAgICAgPSA3MCwKKyAgICBSRl9DSEFOX0JPTkRfMTIyX1YyICAgICAgICAgID0gNzEsCisgICAgUkZfQ0hBTl9CT05EXzEyNl9WMiAgICAgICAgICA9IDcyLAorICAgIFJGX0NIQU5fQk9ORF8xMzBfVjIgICAgICAgICAgPSA3MywKKyAgICBSRl9DSEFOX0JPTkRfMTM0X1YyICAgICAgICAgID0gNzQsCisgICAgUkZfQ0hBTl9CT05EXzEzOF9WMiAgICAgICAgICA9IDc1LAorICAgIFJGX0NIQU5fQk9ORF8xNTFfVjIgICAgICAgICAgPSA3NiwgICAgLy81R0h6IEhpZ2ggVS1OSUkgQmFuZAorICAgIFJGX0NIQU5fQk9ORF8xNTVfVjIgICAgICAgICAgPSA3NywKKyAgICBSRl9DSEFOX0JPTkRfMTU5X1YyICAgICAgICAgID0gNzgsCisgICAgUkZfQ0hBTl9CT05EXzE2M19WMiAgICAgICAgICA9IDc5LAorCisgICAgTlVNX1JGX0NIQU5ORUxTX1YyLAorCisgICAgTUlOXzJfNEdIWl9DS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ICAgICAgICAgICAgICAgICAgICAgLy8gTlZfVEFCTEVfUkFURV9QT1dFUl9TRVRUSU5HUworICAgIHNSZWd1bGF0b3J5RG9tYWluc1YyICAgcmVnRG9tYWluc1tOVU1fUkVHX0RPTUFJTlNdOyAgICAgICAgICAgICAgICAgICAgICAgICAvLyBOVl9UQUJMRV9SRUdVTEFUT1JZX0RPTUFJTlMKKyAgICBzRGVmYXVsdENvdW50cnkgICAgICBkZWZhdWx0Q291bnRyeVRhYmxlOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5WX1RBQkxFX0RFRkFVTFRfQ09VTlRSWQorICAgIHRUcGNQb3dlclRhYmxlICAgICAgIHBsdXRDaGFyYWN0ZXJpemVkW05VTV9SRl9DSEFOTkVMU19WMl07ICAgICAgICAgICAgICAgICAgLy8gTlZfVEFCTEVfVFBDX1BPV0VSX1RBQkxFCisgICAgaW50MTYgICAgICAgICAgICAgcGx1dFBkYWRjT2Zmc2V0W05VTV9SRl9DSEFOTkVMU19WMl07ICAgICAgICAgICAgICAgICAgICAgICAvLyBOVl9UQUJMRV9UUENfUERBRENfT0ZGU0VUUworICAgIHRSYXRlR3JvdXBQd3JWUiAgICAgIHB3ck9wdGltdW1fdmlydHVhbFJhdGVbTlVNX1JGX1NVQkJBTkRTXTsgICAgICAgICAgICAgLy8gTlZfVEFCTEVfVklSVFVBTF9SQVRFCisgICAgc0Z3Q29uZmlnICAgICAgICAgICAgZndDb25maWc7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTlZfVEFCTEVfRldfQ09ORklHCisgICAgc1Jzc2lDaGFubmVsT2Zmc2V0c1YyICByc3NpQ2hhbk9mZnNldHNbMl07ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5WX1RBQkxFX1JTU0lfQ0hBTk5FTF9PRkZTRVRTCisgICAgc0h3Q2FsVmFsdWVzICAgICAgICAgaHdDYWxWYWx1ZXM7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBOVl9UQUJMRV9IV19DQUxfVkFMVUVTCisgICAgaW50MTYgICAgICAgICAgICAgYW50ZW5uYVBhdGhMb3NzW05VTV9SRl9DSEFOTkVMU19WMl07ICAgICAgICAgICAgICAgICAgICAvLyBOVl9UQUJMRV9BTlRFTk5BX1BBVEhfTE9TUworICAgIGludDE2ICAgICAgICAgICAgIHBrdFR5cGVQd3JMaW1pdHNbTlVNXzgwMl8xMV9NT0RFU11bTlVNX1JGX0NIQU5ORUxTX1YyXTsgLy8gTlZfVEFCTEVfUEFDS0VUX1RZUEVfUE9XRVJfTElNSVRTCisgICAgc09mZG1DbWRQd3JPZmZzZXQgICAgb2ZkbUNtZFB3ck9mZnNldDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBOVl9UQUJMRV9PRkRNX0NNRF9QV1JfT0ZGU0VUCisgICAgc1R4QmJGaWx0ZXJNb2RlICAgICAgdHhiYkZpbHRlck1vZGU7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBOVl9UQUJMRV9UWF9CQl9GSUxURVJfTU9ERQorfUFMSUdOXzQgdU52VGFibGVzVjI7CisKK3R5cGVkZWYgUEFDS0VEX1BSRSBzdHJ1Y3QgUEFDS0VEX1BPU1QKK3sKKyAgICB0UmF0ZUdyb3VwUHdyICAgICAgICBwd3JPcHRpbXVtW05VTV9SRl9TVUJCQU5EU107ICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5WX1RBQkxFX1JBVEVfUE9XRVJfU0VUVElOR1MKKyAgICBzUmVndWxhdG9yeURvbWFpbnNWMiAgIHJlZ0RvbWFpbnNbTlVNX1JFR19ET01BSU5TXTsgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTlZfVEFCTEVfUkVHVUxBVE9SWV9ET01BSU5TCisgICAgc0RlZmF1bHRDb3VudHJ5ICAgICAgZGVmYXVsdENvdW50cnlUYWJsZTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBOVl9UQUJMRV9ERUZBVUxUX0NPVU5UUlkKKyAgICB0VHBjUG93ZXJUYWJsZSAgICAgICBwbHV0Q2hhcmFjdGVyaXplZFtOVU1fUkZfQ0hBTk5FTFNfVjJdOyAgICAgICAgICAgICAgICAgIC8vIE5WX1RBQkxFX1RQQ19QT1dFUl9UQUJMRQorICAgIGludDE2ICAgICAgICAgICAgIHBsdXRQZGFkY09mZnNldFtOVU1fUkZfQ0hBTk5FTFNfVjJdOyAgICAgICAgICAgICAgICAgICAgLy8gTlZfVEFCTEVfVFBDX1BEQURDX09GRlNFVFMKKyAgICB0UmF0ZUdyb3VwUHdyVlIgICAgICBwd3JPcHRpbXVtX3ZpcnR1YWxSYXRlW05VTV9SRl9TVUJCQU5EU107ICAgICAgICAgICAgIC8vIE5WX1RBQkxFX1ZJUlRVQUxfUkFURQorICAgIHNGd0NvbmZpZyAgICAgICAgICAgZndDb25maWc7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5WX1RBQkxFX0ZXX0NPTkZJRworICAgIHNSc3NpQ2hhbm5lbE9mZnNldHNWMiAgcnNzaUNoYW5PZmZzZXRzWzJdOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBOVl9UQUJMRV9SU1NJX0NIQU5ORUxfT0ZGU0VUUworICAgIHNId0NhbFZhbHVlcyAgICAgICAgIGh3Q2FsVmFsdWVzOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTlZfVEFCTEVfSFdfQ0FMX1ZBTFVFUworICAgIGludDE2ICAgICAgICAgICAgIGFudGVubmFQYXRoTG9zc1tOVU1fUkZfQ0hBTk5FTFNfVjJdOyAgICAgICAgICAgICAgICAgICAgLy8gTlZfVEFCTEVfQU5URU5OQV9QQVRIX0xPU1MKKyAgICBpbnQxNiAgICAgICAgICAgICBwa3RUeXBlUHdyTGltaXRzW05VTV84M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1wbGVzOworCit0eXBlZGVmIHRJUVNhbXBsZXMgdElRQWRjOwordHlwZWRlZiB0SVFTYW1wbGVzIHRJUURhYzsKKwordHlwZWRlZiBQQUNLRURfUFJFIHN0cnVjdCBQQUNLRURfUE9TVAoreworICAgIHRBTklfVTggbWF4R2FpbkluZGV4OworICAgIHRBTklfVTggdG9wR2FpbkRiOworICAgIHRBTklfVTggYm90dG9tR2FpbkRiOworICAgIHRBTklfVTggdW51c2VkWzFdOworfXRBc2ljQWdjOworCisjZGVmaW5lIFRYRklSX01FTSAgICAgICAgICAgICAgICAgICAgICAgICAgIFFXTEFOX1RYRklSX1RYQ0FMX01FTTBfTVJFRworI2RlZmluZSBUWEZJUl9NRU1fR0FJTl9NVUxUICAgICAgICAgICAgICAgICAoMTYpICAgIC8vYnl0ZXMgcGVyIGdhaW4KKyNkZWZpbmUgVFhGSVJfTUVNX1BFUl9DSEFJTiAgICAgICAgICAgICAgICAgKDE2ICogVFhGSVJfTUVNX0dBSU5fTVVMVCkgICAgLy8jIG9mIGdhaW5zIHBlciBjaGFpbiAqIGJ5dGVzIHBlciBnYWluCisKK3R5cGVkZWYgdElRQWRjIHRUeENhcnJpZXJFcnJvcjsKKworI2RlZmluZSBPTkVfTUlDUk9TRUNPTkQgICAgICAgICAgICAgKDE2MCkKKyNkZWZpbmUgREVGQVVMVF9JTlRFUkZSQU1FX1NQQUNFICAgIChPTkVfTUlDUk9TRUNPTkQgKiAxMCkgIC8vMTAgbWljcm9zZWNvbmRzCisKK3R5cGVkZWYgZW51bSB7CisgICBQSFlEQkdfVFhfSURMRSA9IDAsCisgICBQSFlEQkdfVFhfU1RBUlQgPSAxLAorICAgUEhZREJHX1RYX1dBUk1VUCA9IDIsCisgICBQSFlEQkdfVFhfSU5GRCA9IDMsCisgICBQSFlEQkdfVFhfQ01EID0gNCwKKyAgIFBIWURCR19UWF9TVkMgPSA1LAorICAgUEhZREJHX1RYX1BZTERGID0gNiwKKyAgIFBIWURCR19UWF9QWUxEU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OX09GRlNFVAorI2RlZmluZSBUUENfR0FJTl9ESUdfTUFTSyAgICAgICAgICAgICAgICAgICAgICBRV0xBTl9UUENfR0FJTl9MVVQwX0RJR19HQUlOX01BU0sKKworCisjZGVmaW5lIFRQQ19NRU1fR0FJTl9MVVRfREVQVEggICAgICAgICAgICAgICAgICAzMgorCisKKyNkZWZpbmUgVFBDX0FEQ19DVFJMX1JFRyAgICAgICAgICAgICAgICAgICAgICAgIFFXTEFOX1RQQ19BRENfQ1RSTF9HRVRfQURDX1JFRworI2RlZmluZSBUUENfQURDX0dFVF9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgUVdMQU5fVFBDX0FEQ19DVFJMX0dFVF9BRENfR0VUX0FEQ19NQVNLCisKKyNkZWZpbmUgVFBDX0FEQ19GQUlMRURfTUFTSyAgICAgICAgICAgICAgICAgICAgIFFXTEFOX1RQQ19BRENfU1RBVFVTX0ZBSUxFRF9NQVNLCisjZGVmaW5lIFRQQ19BRENfQlVTWV9QX01BU0sgICAgICAgICAgICAgICAgICAgICBRV0xBTl9UUENfQURDX1NUQVRVU19CVVNZX1BfTUFTSworI2RlZmluZSBUUENfQURDX0JVU1lfVF9NQVNLICAgICAgICAgICAgICAgICAgICAgUVdMQU5fVFBDX0FEQ19TVEFUVVNfQlVTWV9UX01BU0sKKworCisjZGVmaW5lIE1TS18xICAgMHgxCisjZGVmaW5lIE1TS18yICAgMHgzCisjZGVmaW5lIE1TS18zICAgMHg3CisjZGVmaW5lIE1TS180ICAgMHhGCisjZGVmaW5lIE1TS181ICAgMHgxRgorI2RlZmluZSBNU0tfNiAgIDB4M0YKKyNkZWZpbmUgTVNLXzcgICAweDdGCisjZGVmaW5lIE1TS184ICAgMHhGRgorI2RlZmluZSBNU0tfOSAgIDB4MUZGCisjZGVmaW5lIE1TS18xMCAgMHgzRkYKKyNkZWZpbmUgTVNLXzExICAweDdGRgorI2RlZmluZSBNU0tfMTIgIDB4RkZGCisjZGVmaW5lIE1TS18xMyAgMHgxR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NPQ19TVEEgICAgICAgICAgIDMyCisjZGVmaW5lIEhBTF9OVU1fU1RBICAgICAgICAgICAgICAgICA0MQorI2RlZmluZSBIQUxfTlVNX0hXX1NUQSAgICAgICAgICAgICAgMTYKKyNkZWZpbmUgSEFMX05VTV9HUFNUQSAgICAgICAgICAgICAgIDQKKyNkZWZpbmUgSEFMX05VTV9WU1RBICAgICAgICAgICAgICAgIChIQUxfTlVNX1NUQSAtIEhBTF9OVU1fSFdfU1RBKQorCisjZGVmaW5lIFFXTEFORldfTUFYX05VTV9WU1RBICAgICAgICBIQUxfTlVNX1ZTVEEKKyNkZWZpbmUgUVdMQU5GV19WU1RBX0lOVkFMSURfSURYICAgIChIQUxfTlVNX1NUQSsxKQorI2RlZmluZSBRV0xBTl9WU1RBX01JTl9JRFggICAgICAgICAgSEFMX05VTV9IV19TVEEKKyNkZWZpbmUgUVdMQU5GV19OVU1fR1BTVEEgICAgICAgICAgIEhBTF9OVU1fR1BTVEEKKworCisjZGVmaW5lIElTX1ZTVEFfVkFMSURfSURYKF9feCkgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAoKF9feCkgIT0gUVdMQU5GV19WU1RBX0lOVkFMSURfSURYKQorCisjZGVmaW5lIElTX1ZTVEFfSURYKF9feCkgXAorICAgICAgICAgICAgICAgICAgICgoKF9feCkgPj0gUVdMQU5fVlNUQV9NSU5fSURYKSAmJiAoKF9feCkgPCBIQUxfTlVNX1NUQSkpCisKKyNkZWZpbmUgR0VUX1ZTVEFfSU5ERVhfRk9SX1NUQV9JTkRFWChfX2lkeCkgICAgKChfX2lkeCkgLSBRV0xBTl9WU1RBX01JTl9JRFgpCisKKy8vIGlzIHRoZSBTVEEgYSBHZW5lcmFsIFB1cnBvc2UgU1RBPworI2RlZmluZSBJU19HUFNUQV9JRFgoX194KSBcCisgICAgKCgoX194KSA+PSAoSEFMX05VTV9IV19TVEEtSEFMX05VTV9HUFNUQSkpICYmIFwKKyAgICAgKChfX3gpIDwgSEFMX05VTV9I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RX0JNVV9JRExFX0JEID0gMCwKKyAgICBCTVVXUV9CTVVfSURMRV9QRFUgPSAxLAorCisgICAgLyogUnhQICovCisgICAgQk1VV1FfUlhQX1VOS05XT05fQUREUiA9IDIsICAvKiBjdXJyZW50bHkgdW5oYW5kbGVkIGJ5IEhBTCAqLworCisgICAgLyogRFBVIFJYICovCisgICAgQk1VV1FfRFBVX1JYID0gMywKKworICAgIC8qIERQVSBUWCAqLworICAgIEJNVVdRX0RQVV9UWCA9IDYsCisKKyAgICAvKiBGaXJtd2FyZSAqLworICAgIEJNVVdRX0ZXX1RSQU5TTUlUID0gMTIsICAvKiBEUFUgVHgtPkZXIFR4ICovCisgICAgQk1VV1FfRldfUkVDViA9IDcsICAgICAgIC8qIERQVSBSeC0+RlcgUnggKi8KKworICAgIEJNVVdRX0ZXX1JQRV9SRUNWID0gMTYsICAgLyogUlhQL1JQRSBSeC0+RlcgUnggKi8KKyAgICBGV19TQ09fV1EgPSBCTVVXUV9GV19SUEVfUkVDViwKKworICAgIC8qIERQVSBFcnJvciAqLworICAgIEJNVVdRX0RQVV9FUlJPUl9XUSA9IDgsCisKKyAgICAvKiBEWEUgUlggKi8KKyAgICBCTVVXUV9EWEVfUlggPSAxMSwKKworICAgIEJNVVdRX0RYRV9SWF9ISSA9IDQsCisKKyAgICAvKiBBRFUvVU1BICovCisgICAgQk1VV1FfQURVX1VNQV9UWCA9IDIzLAorICAgIEJNVVdRX0FEVV9VTUFfUlggPSAyNCwKKworICAgIC8qIEJNVSBCVFFNICovCisgICAgQk1VV1FfQlRRTSA9IDI1LAorCisgICAgLyogU3BlY2lhbCBXUSBmb3IgQk1VIHRvIGRyb3BwaW5nIGFsbCBmcmFtZXMgY29taW5nIHRvIHRoaXMgV1EgSUQgKi8KKyAgICBCTVVXUV9TSU5LID0gMjU1LAorCisjaWZkZWYgV0NOX1BST05UTworICAgIEJNVVdRX0JNVV9DTUVNX0lETEVfQkQgPSAyNywKKyAgICAvKiBUb3RhbCBCTVUgV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qIHVuZGVyIHByb3ByaWV0YXJ5IHRlcm1zIGJlZm9yZSBDb3B5cmlnaHQgb3duZXJzaGlwIHdhcyBhc3NpZ25lZAorICogdG8gdGhlIExpbnV4IEZvdW5kYXRpb24uCisgKi8KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqCisgKiAgQGZpbGU6ICAgICB3bGFuX3N0YXR1c19jb2RlLmgKKyAqCisgKiAgQGJyaWVmOiAgICBDb21tb24gaGVhZGVyIGZpbGUgY29udGFpbmluZyBhbGwgdGhlIHN0YXR1cyBjb2RlcworICogICAgICAgICAgICAgQWxsIHN0YXR1cyBjb2RlcyBoYXZlIGJlZW4gY29uc29saWRhdGVkIGludG8gb25lIGVudW0KKyAqCisgKiAgQGF1dGhvcjogICBLdW1hciBBbmFuZAorICoKKyAqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKyNpZm5kZWYgX19XTEFOX1NUQVRVU19DT0RFX0hfXworI2RlZmluZSBfX1dMQU5fU1RBVFVTX0NPREVfSF9fCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBJbmNsdWRlIEZpbGVzCistLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKiBQcmVwcm9jZXNzb3IgRGVmaW5pdGlvbnMgYW5kIENvbnN0YW50cworICogLS0tLS0tLS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